From f0d03b8c0909d7325d77abcbcab2f1253df83e3e Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Sat, 15 Jan 2022 14:07:52 +0100 Subject: [PATCH] Built motion from commit 6145771d.|2.5.47 --- 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 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/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.events.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/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/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.events.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/realtime/index.js | 2 +- server/api/realtime/realtime.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 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.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-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.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/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.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 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.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/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.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/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.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/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.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/project.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/setting.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/rpc/setting.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/model/whatsappQueue.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 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.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 +- .../routing/server/applications/dialogflowV2.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/tvox.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 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1170 files changed, 1170 insertions(+), 1170 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4c78518..8f2cf7c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-14T21:25:32.446Z", + "time": "2022-01-15T12:54:17.186Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 2053216..8f42abc 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-14T21:25:32.446Z", + "time": "2022-01-15T12:54:17.186Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 9dd32ae..decf48b 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 _0x0e50=['exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x0e50,0x168));var _0x00e5=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x0e50[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x00e5('0x0'));module[_0x00e5('0x1')]={'name':{'type':Sequelize[_0x00e5('0x2')],'get':function(_0x5e177a){return this[_0x00e5('0x3')](_0x00e5('0x4'));}},'action':{'type':Sequelize[_0x00e5('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x00e5('0x6'),_0x00e5('0x7'),'motionbar',_0x00e5('0x8'),'urlForward',_0x00e5('0x9'),_0x00e5('0xa'),_0x00e5('0xb')]],'msg':_0x00e5('0xc')}},'comment':_0x00e5('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x00e5('0xd')},'data2':{'type':Sequelize[_0x00e5('0x5')](0x1000),'comment':_0x00e5('0xe')},'data3':{'type':Sequelize[_0x00e5('0x5')](0x1000),'comment':_0x00e5('0xf')},'data4':{'type':Sequelize[_0x00e5('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x00e5('0x5')](0x1000),'comments':_0x00e5('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x00e5('0x11')},'data7':{'type':Sequelize[_0x00e5('0x12')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xd877=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x5b5144,_0x3c94ec){var _0x27dbd0=function(_0x51efd1){while(--_0x51efd1){_0x5b5144['push'](_0x5b5144['shift']());}};_0x27dbd0(++_0x3c94ec);}(_0xd877,0xcf));var _0x7d87=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd877[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d87('0x0')],'get':function(_0x4d853d){return this[_0x7d87('0x1')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7d87('0x2'),_0x7d87('0x3'),_0x7d87('0x4'),_0x7d87('0x5'),_0x7d87('0x6'),'browser',_0x7d87('0x7'),_0x7d87('0x8')]],'msg':_0x7d87('0x9')}},'comment':_0x7d87('0x9')},'data1':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comment':_0x7d87('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x7d87('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comments':_0x7d87('0xd')},'data6':{'type':Sequelize[_0x7d87('0xa')],'comments':_0x7d87('0xe')},'data7':{'type':Sequelize[_0x7d87('0xf')],'comments':_0x7d87('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index e847d0e..0c97c2c 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 _0x4ca6=['mustache','ejs','fs-extra','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x327f41,_0x5c3672){var _0x3ffdae=function(_0x128465){while(--_0x128465){_0x327f41['push'](_0x327f41['shift']());}};_0x3ffdae(++_0x5c3672);}(_0x4ca6,0x110));var _0x64ca=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x4ca6[_0x34d346];return _0x122d76;};'use strict';var emlformat=require(_0x64ca('0x0'));var rimraf=require(_0x64ca('0x1'));var zipdir=require(_0x64ca('0x2'));var jsonpatch=require(_0x64ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x64ca('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64ca('0x5'));var fs=require('fs');var fs_extra=require(_0x64ca('0x6'));var _=require(_0x64ca('0x7'));var squel=require(_0x64ca('0x8'));var crypto=require(_0x64ca('0x9'));var jsforce=require(_0x64ca('0xa'));var deskjs=require(_0x64ca('0xb'));var toCsv=require(_0x64ca('0xc'));var querystring=require(_0x64ca('0xd'));var Papa=require(_0x64ca('0xe'));var Redis=require(_0x64ca('0xf'));var authService=require(_0x64ca('0x10'));var qs=require(_0x64ca('0x11'));var as=require(_0x64ca('0x12'));var hardwareService=require(_0x64ca('0x13'));var logger=require(_0x64ca('0x14'))(_0x64ca('0x15'));var utils=require('../../config/utils');var config=require(_0x64ca('0x16'));var licenseUtil=require(_0x64ca('0x17'));var db=require(_0x64ca('0x18'))['db'];function respondWithStatusCode(_0x315c8b,_0x3004ec){_0x3004ec=_0x3004ec||0xcc;return function(_0x57e9ac){if(_0x57e9ac){return _0x315c8b[_0x64ca('0x19')](_0x3004ec);}return _0x315c8b['status'](_0x3004ec)[_0x64ca('0x1a')]();};}function respondWithResult(_0x12f688,_0x4b3e1d){_0x4b3e1d=_0x4b3e1d||0xc8;return function(_0x4e510b){if(_0x4e510b){return _0x12f688[_0x64ca('0x1b')](_0x4b3e1d)[_0x64ca('0x1c')](_0x4e510b);}};}function respondWithFilteredResult(_0x1e6d04,_0x3408cd){return function(_0x3cb6d8){if(_0x3cb6d8){var _0x11e815=typeof _0x3408cd[_0x64ca('0x1d')]==='undefined'&&typeof _0x3408cd['limit']===_0x64ca('0x1e');var _0x4d6bda=_0x3cb6d8[_0x64ca('0x1f')];var _0x157033=_0x11e815?0x0:_0x3408cd[_0x64ca('0x1d')];var _0x88da81=_0x11e815?_0x3cb6d8[_0x64ca('0x1f')]:_0x3408cd[_0x64ca('0x1d')]+_0x3408cd[_0x64ca('0x20')];var _0x318e72;if(_0x88da81>=_0x4d6bda){_0x88da81=_0x4d6bda;_0x318e72=0xc8;}else{_0x318e72=0xce;}_0x1e6d04[_0x64ca('0x1b')](_0x318e72);return _0x1e6d04['set']('Content-Range',_0x157033+'-'+_0x88da81+'/'+_0x4d6bda)[_0x64ca('0x1c')](_0x3cb6d8);}return null;};}function patchUpdates(_0x4217bb){return function(_0x515615){try{jsonpatch['apply'](_0x515615,_0x4217bb,!![]);}catch(_0x3594b3){return BPromise[_0x64ca('0x21')](_0x3594b3);}return _0x515615[_0x64ca('0x22')]();};}function saveUpdates(_0xb9145d,_0x6ce676){return function(_0x4d0412){if(_0x4d0412){return _0x4d0412[_0x64ca('0x23')](_0xb9145d)[_0x64ca('0x24')](function(_0x15a89e){return _0x15a89e;});}return null;};}function removeEntity(_0x3197c3,_0x1c02ca){return function(_0x1366d1){if(_0x1366d1){return _0x1366d1[_0x64ca('0x25')]()[_0x64ca('0x24')](function(){_0x3197c3[_0x64ca('0x1b')](0xcc)[_0x64ca('0x1a')]();});}};}function handleEntityNotFound(_0x184b2a,_0x44e714){return function(_0xac63c2){if(!_0xac63c2){_0x184b2a[_0x64ca('0x19')](0x194);}return _0xac63c2;};}function handleError(_0x4380ba,_0x191b02){_0x191b02=_0x191b02||0x1f4;return function(_0x312790){logger[_0x64ca('0x26')](_0x312790[_0x64ca('0x27')]);if(_0x312790[_0x64ca('0x28')]){delete _0x312790[_0x64ca('0x28')];}_0x4380ba[_0x64ca('0x1b')](_0x191b02)[_0x64ca('0x29')](_0x312790);};}exports[_0x64ca('0x23')]=function(_0x1efb33,_0x1111f8){if(_0x1efb33[_0x64ca('0x2a')]['id']){delete _0x1efb33[_0x64ca('0x2a')]['id'];}return db[_0x64ca('0x2b')][_0x64ca('0x2c')]({'where':{'id':_0x1efb33['params']['id']}})[_0x64ca('0x24')](handleEntityNotFound(_0x1111f8,null))[_0x64ca('0x24')](saveUpdates(_0x1efb33[_0x64ca('0x2a')],null))[_0x64ca('0x24')](respondWithResult(_0x1111f8,null))['catch'](handleError(_0x1111f8,null));};exports['destroy']=function(_0x49a6c3,_0x58d2a6){return db['Action'][_0x64ca('0x2c')]({'where':{'id':_0x49a6c3[_0x64ca('0x2d')]['id']}})[_0x64ca('0x24')](handleEntityNotFound(_0x58d2a6,null))['then'](removeEntity(_0x58d2a6,null))['catch'](handleError(_0x58d2a6,null));}; \ No newline at end of file +var _0xba31=['count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','update','Action','find','params','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','end','status','offset','undefined','limit'];(function(_0x38fa20,_0x301993){var _0x4ce943=function(_0x99fe7e){while(--_0x99fe7e){_0x38fa20['push'](_0x38fa20['shift']());}};_0x4ce943(++_0x301993);}(_0xba31,0x17a));var _0x1ba3=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xba31[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0x1ba3('0x0'));var rimraf=require(_0x1ba3('0x1'));var zipdir=require(_0x1ba3('0x2'));var jsonpatch=require(_0x1ba3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ba3('0x4'));var Mustache=require(_0x1ba3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1ba3('0x6'));var csv=require(_0x1ba3('0x7'));var ejs=require(_0x1ba3('0x8'));var fs=require('fs');var fs_extra=require(_0x1ba3('0x9'));var _=require('lodash');var squel=require(_0x1ba3('0xa'));var crypto=require('crypto');var jsforce=require(_0x1ba3('0xb'));var deskjs=require(_0x1ba3('0xc'));var toCsv=require(_0x1ba3('0x7'));var querystring=require(_0x1ba3('0xd'));var Papa=require(_0x1ba3('0xe'));var Redis=require(_0x1ba3('0xf'));var authService=require(_0x1ba3('0x10'));var qs=require(_0x1ba3('0x11'));var as=require(_0x1ba3('0x12'));var hardwareService=require(_0x1ba3('0x13'));var logger=require('../../config/logger')(_0x1ba3('0x14'));var utils=require('../../config/utils');var config=require(_0x1ba3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128e41,_0x7bda1e){_0x7bda1e=_0x7bda1e||0xcc;return function(_0x501f17){if(_0x501f17){return _0x128e41['sendStatus'](_0x7bda1e);}return _0x128e41['status'](_0x7bda1e)[_0x1ba3('0x16')]();};}function respondWithResult(_0x4c343e,_0x3bb4c0){_0x3bb4c0=_0x3bb4c0||0xc8;return function(_0x2fc798){if(_0x2fc798){return _0x4c343e[_0x1ba3('0x17')](_0x3bb4c0)['json'](_0x2fc798);}};}function respondWithFilteredResult(_0x9f79c9,_0x372f04){return function(_0x2b69ac){if(_0x2b69ac){var _0x2390d8=typeof _0x372f04[_0x1ba3('0x18')]===_0x1ba3('0x19')&&typeof _0x372f04[_0x1ba3('0x1a')]==='undefined';var _0x478fbe=_0x2b69ac[_0x1ba3('0x1b')];var _0x8b58d7=_0x2390d8?0x0:_0x372f04[_0x1ba3('0x18')];var _0x340b40=_0x2390d8?_0x2b69ac[_0x1ba3('0x1b')]:_0x372f04[_0x1ba3('0x18')]+_0x372f04['limit'];var _0x227b1a;if(_0x340b40>=_0x478fbe){_0x340b40=_0x478fbe;_0x227b1a=0xc8;}else{_0x227b1a=0xce;}_0x9f79c9[_0x1ba3('0x17')](_0x227b1a);return _0x9f79c9[_0x1ba3('0x1c')](_0x1ba3('0x1d'),_0x8b58d7+'-'+_0x340b40+'/'+_0x478fbe)['json'](_0x2b69ac);}return null;};}function patchUpdates(_0x4db163){return function(_0x390f3a){try{jsonpatch[_0x1ba3('0x1e')](_0x390f3a,_0x4db163,!![]);}catch(_0x5935d1){return BPromise[_0x1ba3('0x1f')](_0x5935d1);}return _0x390f3a[_0x1ba3('0x20')]();};}function saveUpdates(_0x1bba92,_0x2edeaa){return function(_0x46d37a){if(_0x46d37a){return _0x46d37a['update'](_0x1bba92)[_0x1ba3('0x21')](function(_0xe1781f){return _0xe1781f;});}return null;};}function removeEntity(_0x3c0bc7,_0x547a6a){return function(_0x1f1d48){if(_0x1f1d48){return _0x1f1d48[_0x1ba3('0x22')]()['then'](function(){_0x3c0bc7[_0x1ba3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22903b,_0xa717f9){return function(_0x44403b){if(!_0x44403b){_0x22903b[_0x1ba3('0x23')](0x194);}return _0x44403b;};}function handleError(_0x4d6c57,_0x54e917){_0x54e917=_0x54e917||0x1f4;return function(_0x442ed5){logger[_0x1ba3('0x24')](_0x442ed5[_0x1ba3('0x25')]);if(_0x442ed5[_0x1ba3('0x26')]){delete _0x442ed5[_0x1ba3('0x26')];}_0x4d6c57[_0x1ba3('0x17')](_0x54e917)['send'](_0x442ed5);};}exports[_0x1ba3('0x27')]=function(_0x478424,_0x20acad){if(_0x478424['body']['id']){delete _0x478424['body']['id'];}return db[_0x1ba3('0x28')][_0x1ba3('0x29')]({'where':{'id':_0x478424[_0x1ba3('0x2a')]['id']}})[_0x1ba3('0x21')](handleEntityNotFound(_0x20acad,null))['then'](saveUpdates(_0x478424[_0x1ba3('0x2b')],null))['then'](respondWithResult(_0x20acad,null))[_0x1ba3('0x2c')](handleError(_0x20acad,null));};exports[_0x1ba3('0x22')]=function(_0x4e0d49,_0x220d93){return db[_0x1ba3('0x28')][_0x1ba3('0x29')]({'where':{'id':_0x4e0d49[_0x1ba3('0x2a')]['id']}})[_0x1ba3('0x21')](handleEntityNotFound(_0x220d93,null))['then'](removeEntity(_0x220d93,null))['catch'](handleError(_0x220d93,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 05990bd..7c19ad1 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 _0xc022=['rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xc022,0xd1));var _0x2c02=function(_0x3958fe,_0x3c6605){_0x3958fe=_0x3958fe-0x0;var _0x1f27d6=_0xc022[_0x3958fe];return _0x1f27d6;};'use strict';var _=require(_0x2c02('0x0'));var util=require(_0x2c02('0x1'));var logger=require('../../config/logger')(_0x2c02('0x2'));var moment=require(_0x2c02('0x3'));var BPromise=require(_0x2c02('0x4'));var rp=require(_0x2c02('0x5'));var fs=require('fs');var path=require(_0x2c02('0x6'));var rimraf=require(_0x2c02('0x7'));var config=require(_0x2c02('0x8'));var attributes=require(_0x2c02('0x9'));module['exports']=function(_0x1b382b,_0x15bac4){return _0x1b382b[_0x2c02('0xa')]('Action',attributes,{'tableName':_0x2c02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dc2=['rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x47c983,_0x5a2896){var _0x3e7cc3=function(_0x119c26){while(--_0x119c26){_0x47c983['push'](_0x47c983['shift']());}};_0x3e7cc3(++_0x5a2896);}(_0x4dc2,0xf5));var _0x24dc=function(_0x403fbd,_0x5f3e3d){_0x403fbd=_0x403fbd-0x0;var _0x2bbf8b=_0x4dc2[_0x403fbd];return _0x2bbf8b;};'use strict';var _=require(_0x24dc('0x0'));var util=require(_0x24dc('0x1'));var logger=require(_0x24dc('0x2'))(_0x24dc('0x3'));var moment=require(_0x24dc('0x4'));var BPromise=require('bluebird');var rp=require(_0x24dc('0x5'));var fs=require('fs');var path=require(_0x24dc('0x6'));var rimraf=require(_0x24dc('0x7'));var config=require(_0x24dc('0x8'));var attributes=require(_0x24dc('0x9'));module['exports']=function(_0x3a1844,_0x48471c){return _0x3a1844['define'](_0x24dc('0xa'),attributes,{'tableName':_0x24dc('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 360ee8e..fb99169 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x53ec,0x192));var _0xc53e=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x53ec[_0x393500];return _0x120d3b;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0xf494,0x1c6));var _0x4f49=function(_0x531552,_0x2c78b4){_0x531552=_0x531552-0x0;var _0x3e0076=_0xf494[_0x531552];return _0x3e0076;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 79f8589..2ce1cf9 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 _0x2a7b=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0xaf3952,_0x1ab368){var _0x55842e=function(_0x24891b){while(--_0x24891b){_0xaf3952['push'](_0xaf3952['shift']());}};_0x55842e(++_0x1ab368);}(_0x2a7b,0x172));var _0xb2a7=function(_0x9cdfec,_0xb2df92){_0x9cdfec=_0x9cdfec-0x0;var _0x6d0546=_0x2a7b[_0x9cdfec];return _0x6d0546;};'use strict';var multer=require(_0xb2a7('0x0'));var util=require(_0xb2a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb2a7('0x2'));var router=express[_0xb2a7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb2a7('0x4'));var config=require(_0xb2a7('0x5'));var controller=require(_0xb2a7('0x6'));router[_0xb2a7('0x7')](_0xb2a7('0x8'),auth[_0xb2a7('0x9')](),controller[_0xb2a7('0xa')]);router[_0xb2a7('0xb')]('/:id',auth[_0xb2a7('0x9')](),controller[_0xb2a7('0xc')]);module[_0xb2a7('0xd')]=router; \ No newline at end of file +var _0xb6d7=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','destroy'];(function(_0x12ab13,_0xb4a491){var _0x1a272c=function(_0x720ed4){while(--_0x720ed4){_0x12ab13['push'](_0x12ab13['shift']());}};_0x1a272c(++_0xb4a491);}(_0xb6d7,0x17a));var _0x7b6d=function(_0x386019,_0x1eac10){_0x386019=_0x386019-0x0;var _0x253833=_0xb6d7[_0x386019];return _0x253833;};'use strict';var multer=require(_0x7b6d('0x0'));var util=require(_0x7b6d('0x1'));var path=require(_0x7b6d('0x2'));var timeout=require(_0x7b6d('0x3'));var express=require(_0x7b6d('0x4'));var router=express[_0x7b6d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7b6d('0x6'));var interaction=require(_0x7b6d('0x7'));var config=require(_0x7b6d('0x8'));var controller=require(_0x7b6d('0x9'));router['put'](_0x7b6d('0xa'),auth[_0x7b6d('0xb')](),controller['update']);router[_0x7b6d('0xc')]('/:id',auth[_0x7b6d('0xb')](),controller[_0x7b6d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d80c109..7357427 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 _0x8958=['TEXT','exports'];(function(_0x2f6dfe,_0x115dab){var _0x5e5c9c=function(_0x502840){while(--_0x502840){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5e5c9c(++_0x115dab);}(_0x8958,0x93));var _0x8895=function(_0x2047af,_0x44b840){_0x2047af=_0x2047af-0x0;var _0x1b4b9f=_0x8958[_0x2047af];return _0x1b4b9f;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x2675,0x75));var _0x5267=function(_0x3aab30,_0x4dc40d){_0x3aab30=_0x3aab30-0x0;var _0x57d644=_0x2675[_0x3aab30];return _0x57d644;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index c4c4d6f..ab0070b 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 _0xc8f2=['destroy','end','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','keyBy','field','groupBy','output','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','cross_join','MIN(%s)','ROUND(%s)','%s.%s\x20=\x20%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','save','update','then','get','CustomReports','UserProfileResource'];(function(_0x491130,_0x1db45e){var _0x30c2b1=function(_0x18ada0){while(--_0x18ada0){_0x491130['push'](_0x491130['shift']());}};_0x30c2b1(++_0x1db45e);}(_0xc8f2,0x120));var _0x2c8f=function(_0x1b5256,_0x10179d){_0x1b5256=_0x1b5256-0x0;var _0x2ffa09=_0xc8f2[_0x1b5256];return _0x2ffa09;};'use strict';var emlformat=require(_0x2c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c8f('0x1'));var jsonpatch=require(_0x2c8f('0x2'));var rp=require(_0x2c8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c8f('0x4'));var util=require(_0x2c8f('0x5'));var path=require(_0x2c8f('0x6'));var sox=require(_0x2c8f('0x7'));var csv=require(_0x2c8f('0x8'));var ejs=require(_0x2c8f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c8f('0xa'));var _=require('lodash');var squel=require(_0x2c8f('0xb'));var crypto=require(_0x2c8f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c8f('0xd'));var toCsv=require(_0x2c8f('0x8'));var querystring=require('querystring');var Papa=require(_0x2c8f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c8f('0xf'));var hardwareService=require(_0x2c8f('0x10'));var logger=require(_0x2c8f('0x11'))(_0x2c8f('0x12'));var utils=require(_0x2c8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2c8f('0x14'));var db=require(_0x2c8f('0x15'))['db'];var dbH=require('../../mysqldb')[_0x2c8f('0x16')];function respondWithStatusCode(_0x472cb7,_0x3ac1ba){_0x3ac1ba=_0x3ac1ba||0xcc;return function(_0x53ede5){if(_0x53ede5){return _0x472cb7[_0x2c8f('0x17')](_0x3ac1ba);}return _0x472cb7['status'](_0x3ac1ba)['end']();};}function respondWithResult(_0x5075ce,_0xf38976){_0xf38976=_0xf38976||0xc8;return function(_0x3445e4){if(_0x3445e4){return _0x5075ce[_0x2c8f('0x18')](_0xf38976)[_0x2c8f('0x19')](_0x3445e4);}};}function respondWithFilteredResult(_0x530e53,_0x1220c9){return function(_0x301ee1){if(_0x301ee1){var _0x5dd7be=typeof _0x1220c9['offset']==='undefined'&&typeof _0x1220c9[_0x2c8f('0x1a')]===_0x2c8f('0x1b');var _0x508e87=_0x301ee1[_0x2c8f('0x1c')];var _0x53855e=_0x5dd7be?0x0:_0x1220c9[_0x2c8f('0x1d')];var _0x2b6480=_0x5dd7be?_0x301ee1[_0x2c8f('0x1c')]:_0x1220c9[_0x2c8f('0x1d')]+_0x1220c9[_0x2c8f('0x1a')];var _0x4859b6;if(_0x2b6480>=_0x508e87){_0x2b6480=_0x508e87;_0x4859b6=0xc8;}else{_0x4859b6=0xce;}_0x530e53[_0x2c8f('0x18')](_0x4859b6);return _0x530e53[_0x2c8f('0x1e')](_0x2c8f('0x1f'),_0x53855e+'-'+_0x2b6480+'/'+_0x508e87)[_0x2c8f('0x19')](_0x301ee1);}return null;};}function patchUpdates(_0x40f53f){return function(_0x3e23f0){try{jsonpatch['apply'](_0x3e23f0,_0x40f53f,!![]);}catch(_0x5b0bc2){return BPromise['reject'](_0x5b0bc2);}return _0x3e23f0[_0x2c8f('0x20')]();};}function saveUpdates(_0xc46e89,_0x92375d){return function(_0x401167){if(_0x401167){return _0x401167[_0x2c8f('0x21')](_0xc46e89)['then'](function(_0x9139fb){return _0x9139fb;});}return null;};}function removeEntity(_0x1b77d6,_0x3d9f99){return function(_0x4f2ba8){if(_0x4f2ba8){return _0x4f2ba8['destroy']()[_0x2c8f('0x22')](function(){var _0xa96d33=_0x4f2ba8[_0x2c8f('0x23')]({'plain':!![]});var _0x25fff8=_0x2c8f('0x24');return db[_0x2c8f('0x25')][_0x2c8f('0x26')]({'where':{'type':_0x25fff8,'resourceId':_0xa96d33['id']}})['then'](function(){return _0x4f2ba8;});})[_0x2c8f('0x22')](function(){_0x1b77d6[_0x2c8f('0x18')](0xcc)[_0x2c8f('0x27')]();});}};}function handleEntityNotFound(_0x127a7d,_0x245ec0){return function(_0x1f04ca){if(!_0x1f04ca){_0x127a7d[_0x2c8f('0x17')](0x194);}return _0x1f04ca;};}function handleError(_0x10ac10,_0x3336ca){_0x3336ca=_0x3336ca||0x1f4;return function(_0x341bc3){logger[_0x2c8f('0x28')](_0x341bc3['stack']);if(_0x341bc3['name']){delete _0x341bc3[_0x2c8f('0x29')];}_0x10ac10[_0x2c8f('0x18')](_0x3336ca)[_0x2c8f('0x2a')](_0x341bc3);};}exports[_0x2c8f('0x2b')]=function(_0x2352f9,_0x4c1238){var _0x5bc53e={},_0x18cf3c={},_0xdee737={'count':0x0,'rows':[]};var _0x14bdee=_['map'](db[_0x2c8f('0x2c')][_0x2c8f('0x2d')],function(_0x14057b){return{'name':_0x14057b[_0x2c8f('0x2e')],'type':_0x14057b['type']['key']};});_0x18cf3c[_0x2c8f('0x2f')]=_[_0x2c8f('0x30')](_0x14bdee,_0x2c8f('0x29'));_0x18cf3c[_0x2c8f('0x31')]=_['keys'](_0x2352f9[_0x2c8f('0x31')]);_0x18cf3c[_0x2c8f('0x32')]=_['intersection'](_0x18cf3c['model'],_0x18cf3c['query']);_0x5bc53e[_0x2c8f('0x33')]=_[_0x2c8f('0x34')](_0x18cf3c[_0x2c8f('0x2f')],qs['fields'](_0x2352f9[_0x2c8f('0x31')][_0x2c8f('0x35')]));_0x5bc53e[_0x2c8f('0x33')]=_0x5bc53e[_0x2c8f('0x33')]['length']?_0x5bc53e['attributes']:_0x18cf3c[_0x2c8f('0x2f')];if(!_0x2352f9[_0x2c8f('0x31')][_0x2c8f('0x36')]('nolimit')){_0x5bc53e[_0x2c8f('0x1a')]=qs[_0x2c8f('0x1a')](_0x2352f9[_0x2c8f('0x31')][_0x2c8f('0x1a')]);_0x5bc53e['offset']=qs[_0x2c8f('0x1d')](_0x2352f9[_0x2c8f('0x31')]['offset']);}_0x5bc53e[_0x2c8f('0x37')]=qs[_0x2c8f('0x38')](_0x2352f9[_0x2c8f('0x31')][_0x2c8f('0x38')]);_0x5bc53e[_0x2c8f('0x39')]=qs[_0x2c8f('0x32')](_[_0x2c8f('0x3a')](_0x2352f9['query'],_0x18cf3c[_0x2c8f('0x32')]),_0x14bdee);if(_0x2352f9[_0x2c8f('0x31')]['filter']){_0x5bc53e[_0x2c8f('0x39')]=_[_0x2c8f('0x3b')](_0x5bc53e[_0x2c8f('0x39')],{'$or':_['map'](_0x14bdee,function(_0x2afa07){if(_0x2afa07[_0x2c8f('0x3c')]!==_0x2c8f('0x3d')){var _0x5038c8={};_0x5038c8[_0x2afa07[_0x2c8f('0x29')]]={'$like':'%'+_0x2352f9['query'][_0x2c8f('0x3e')]+'%'};return _0x5038c8;}})});}_0x5bc53e=_[_0x2c8f('0x3b')]({},_0x5bc53e,_0x2352f9[_0x2c8f('0x3f')]);var _0x5d218e={'where':_0x5bc53e[_0x2c8f('0x39')]};return db[_0x2c8f('0x2c')][_0x2c8f('0x1c')](_0x5d218e)[_0x2c8f('0x22')](function(_0x21dc81){_0xdee737[_0x2c8f('0x1c')]=_0x21dc81;if(_0x2352f9[_0x2c8f('0x31')][_0x2c8f('0x40')]){_0x5bc53e[_0x2c8f('0x41')]=[{'all':!![]}];}return db[_0x2c8f('0x2c')][_0x2c8f('0x42')](_0x5bc53e);})[_0x2c8f('0x22')](function(_0x312d9e){_0xdee737[_0x2c8f('0x43')]=_0x312d9e;return _0xdee737;})[_0x2c8f('0x22')](respondWithFilteredResult(_0x4c1238,_0x5bc53e))[_0x2c8f('0x44')](handleError(_0x4c1238,null));};exports[_0x2c8f('0x45')]=function(_0x8c5fa8,_0x5b28a9){var _0x1a38ff={'raw':![],'where':{'id':_0x8c5fa8[_0x2c8f('0x46')]['id']}},_0x370c17={};_0x370c17[_0x2c8f('0x2f')]=_[_0x2c8f('0x47')](db[_0x2c8f('0x2c')]['rawAttributes']);_0x370c17[_0x2c8f('0x31')]=_['keys'](_0x8c5fa8[_0x2c8f('0x31')]);_0x370c17[_0x2c8f('0x32')]=_['intersection'](_0x370c17['model'],_0x370c17[_0x2c8f('0x31')]);_0x1a38ff[_0x2c8f('0x33')]=_['intersection'](_0x370c17[_0x2c8f('0x2f')],qs[_0x2c8f('0x35')](_0x8c5fa8['query'][_0x2c8f('0x35')]));_0x1a38ff[_0x2c8f('0x33')]=_0x1a38ff[_0x2c8f('0x33')][_0x2c8f('0x48')]?_0x1a38ff[_0x2c8f('0x33')]:_0x370c17[_0x2c8f('0x2f')];if(_0x8c5fa8['query']['includeAll']){_0x1a38ff[_0x2c8f('0x41')]=[{'all':!![]}];}_0x1a38ff=_['merge']({},_0x1a38ff,_0x8c5fa8['options']);return db[_0x2c8f('0x2c')][_0x2c8f('0x49')](_0x1a38ff)[_0x2c8f('0x22')](handleEntityNotFound(_0x5b28a9,null))[_0x2c8f('0x22')](respondWithResult(_0x5b28a9,null))[_0x2c8f('0x44')](handleError(_0x5b28a9,null));};exports[_0x2c8f('0x4a')]=function(_0x554dd5,_0x4eebe3){return db[_0x2c8f('0x2c')][_0x2c8f('0x4a')](_0x554dd5[_0x2c8f('0x4b')],{})[_0x2c8f('0x22')](function(_0x265119){var _0x2313cf=_0x554dd5[_0x2c8f('0x4c')][_0x2c8f('0x23')]({'plain':!![]});if(!_0x2313cf)throw new Error(_0x2c8f('0x4d'));if(_0x2313cf['role']===_0x2c8f('0x4c')){var _0x247480=_0x265119['get']({'plain':!![]});var _0x596dd3='Reports';return db[_0x2c8f('0x4e')][_0x2c8f('0x49')]({'where':{'name':_0x596dd3,'userProfileId':_0x2313cf[_0x2c8f('0x4f')]},'raw':!![]})[_0x2c8f('0x22')](function(_0x23bca6){if(_0x23bca6&&_0x23bca6['autoAssociation']===0x0){return db[_0x2c8f('0x25')][_0x2c8f('0x4a')]({'name':_0x247480[_0x2c8f('0x29')],'resourceId':_0x247480['id'],'type':'CustomReports','sectionId':_0x23bca6['id']},{})[_0x2c8f('0x22')](function(){return _0x265119;});}else{return _0x265119;}})[_0x2c8f('0x44')](function(_0x1b24d7){logger[_0x2c8f('0x28')](_0x2c8f('0x50'),_0x1b24d7);throw _0x1b24d7;});}return _0x265119;})[_0x2c8f('0x22')](respondWithResult(_0x4eebe3,0xc9))[_0x2c8f('0x44')](handleError(_0x4eebe3,null));};exports[_0x2c8f('0x21')]=function(_0x3a4ebf,_0x3e1434){if(_0x3a4ebf['body']['id']){delete _0x3a4ebf[_0x2c8f('0x4b')]['id'];}return db[_0x2c8f('0x2c')][_0x2c8f('0x49')]({'where':{'id':_0x3a4ebf['params']['id']}})[_0x2c8f('0x22')](handleEntityNotFound(_0x3e1434,null))[_0x2c8f('0x22')](saveUpdates(_0x3a4ebf[_0x2c8f('0x4b')],null))[_0x2c8f('0x22')](respondWithResult(_0x3e1434,null))[_0x2c8f('0x44')](handleError(_0x3e1434,null));};exports[_0x2c8f('0x26')]=function(_0x5fe66,_0x1d9cc4){return db[_0x2c8f('0x2c')][_0x2c8f('0x49')]({'where':{'id':_0x5fe66[_0x2c8f('0x46')]['id']}})[_0x2c8f('0x22')](handleEntityNotFound(_0x1d9cc4,null))[_0x2c8f('0x22')](removeEntity(_0x1d9cc4,null))[_0x2c8f('0x44')](handleError(_0x1d9cc4,null));};exports['preview']=function(_0x41dcc6,_0x536269){var _0x200bf2=0xa;var _0x2d450e=['join',_0x2c8f('0x51'),_0x2c8f('0x52'),'cross_join'];var _0x10635c={'SUM':_0x2c8f('0x53'),'COUNT':_0x2c8f('0x54'),'COUNT DISTINCT':_0x2c8f('0x55'),'MAX':_0x2c8f('0x56'),'MIN':'MIN(%s)','AVG':_0x2c8f('0x57'),'GROUP_CONCAT':_0x2c8f('0x58'),'GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0x31c597={'SEC_TO_TIME':_0x2c8f('0x5b'),'DATE':_0x2c8f('0x5c'),'HOUR':_0x2c8f('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2c8f('0x5e')};var _0x3ce7b5=function(_0x34de37){return!_[_0x2c8f('0x5f')]([_0x2c8f('0x60'),_0x2c8f('0x61'),_0x2c8f('0x62'),_0x2c8f('0x63')],_0x34de37);};var _0x798704=function(_0x519bef){if(!_0x519bef||!_0x519bef['rules'][_0x2c8f('0x48')]){return'';}for(var _0x127f81='(',_0x24100a=0x0;_0x24100a<_0x519bef[_0x2c8f('0x64')][_0x2c8f('0x48')];_0x24100a+=0x1){_0x24100a>0x0&&(_0x127f81+='\x20'+_0x519bef[_0x2c8f('0x65')]+'\x20');_0x127f81+=_0x519bef[_0x2c8f('0x64')][_0x24100a][_0x2c8f('0x66')]?_0x798704(_0x519bef[_0x2c8f('0x64')][_0x24100a]['group']):_0x519bef[_0x2c8f('0x64')][_0x24100a]['field']+'\x20'+_0x519bef['rules'][_0x24100a][_0x2c8f('0x67')]+(_0x3ce7b5(_0x519bef['rules'][_0x24100a][_0x2c8f('0x67')])?'\x20'+_0x519bef[_0x2c8f('0x64')][_0x24100a][_0x2c8f('0x68')]:'');}return _0x127f81+')';};var _0x26adcf={'where':{'id':_0x41dcc6[_0x2c8f('0x46')]['id']}},_0x4c1842,_0x3089ba,_0x271c4c,_0x748236,_0x3b11e2;_0x26adcf=_[_0x2c8f('0x3b')]({},_0x26adcf,_0x41dcc6['options']);return db[_0x2c8f('0x2c')]['find'](_0x26adcf)[_0x2c8f('0x22')](function(_0x40bb21){if(_0x40bb21){_0x4c1842=_0x40bb21;return _0x40bb21[_0x2c8f('0x69')]();}return null;})['then'](function(_0x3c4ddd){if(_0x3c4ddd){if(!_0x3c4ddd[_0x2c8f('0x48')]){throw new db[(_0x2c8f('0x6a'))][(_0x2c8f('0x6b'))](_0x2c8f('0x6c'),0x193);}_0x3089ba=_0x3c4ddd;return db[_0x2c8f('0x6d')][_0x2c8f('0x42')]({'raw':!![]});}return null;})[_0x2c8f('0x22')](function(_0x564936){if(_0x564936){_0x271c4c=_['keyBy'](_0x564936,'id');var _0x11cb35;var _0x439bbf=squel[_0x2c8f('0x6e')]();_0x439bbf[_0x2c8f('0x6f')](_0x4c1842[_0x2c8f('0x70')]);for(var _0x19c273=0x0;_0x19c273<_0x3089ba[_0x2c8f('0x48')];_0x19c273+=0x1){_0x11cb35=_0x3089ba[_0x19c273][_0x2c8f('0x71')]?_0x271c4c[_0x3089ba[_0x19c273][_0x2c8f('0x71')]][_0x2c8f('0x72')]:_0x3089ba[_0x19c273]['field'];_0x11cb35=_0x3089ba[_0x19c273]['function']?_[_0x2c8f('0x73')](_0x10635c[_0x3089ba[_0x19c273][_0x2c8f('0x74')]],'%s',_0x11cb35):_0x11cb35;_0x11cb35=_0x3089ba[_0x19c273][_0x2c8f('0x75')]?_['replace'](_0x31c597[_0x3089ba[_0x19c273][_0x2c8f('0x75')]],'%s',_0x11cb35):_0x11cb35;if(_0x3089ba[_0x19c273]['groupBy']){_0x439bbf['group'](_0x11cb35);}_0x3089ba[_0x19c273][_0x2c8f('0x76')]&&_0x439bbf[_0x2c8f('0x37')](_0x11cb35,_0x3089ba[_0x19c273][_0x2c8f('0x76')]===_0x2c8f('0x77')?![]:!![]);_0x439bbf['field'](_0x11cb35,_0x3089ba[_0x19c273][_0x2c8f('0x78')]||_0x11cb35);}if(_0x4c1842[_0x2c8f('0x79')]){_0x4c1842[_0x2c8f('0x79')]=JSON[_0x2c8f('0x7a')](_0x4c1842[_0x2c8f('0x79')]);for(var _0x2e920e=0x0;_0x2e920e<_0x4c1842[_0x2c8f('0x79')][_0x2c8f('0x48')];_0x2e920e+=0x1){if(_0x4c1842[_0x2c8f('0x79')][_0x2e920e]['type']&&_['includes'](_0x2d450e,_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x3c')])&&_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x7b')]&&_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x7c')]&&_0x4c1842['joins'][_0x2e920e]['foreignKey']){_0x439bbf[_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x3c')]](_0x4c1842['joins'][_0x2e920e][_0x2c8f('0x7c')],null,util[_0x2c8f('0x75')]('%s.%s\x20=\x20%s.%s',_0x4c1842[_0x2c8f('0x70')],_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x7b')],_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x7c')],_0x4c1842[_0x2c8f('0x79')][_0x2e920e][_0x2c8f('0x7d')]));}}}if(_0x4c1842[_0x2c8f('0x7e')]){_0x4c1842['conditions']=JSON[_0x2c8f('0x7a')](_0x4c1842[_0x2c8f('0x7e')]);_0x439bbf['where'](_0x798704(_0x4c1842[_0x2c8f('0x7e')][_0x2c8f('0x66')]));}_0x3b11e2=_0x439bbf[_0x2c8f('0x7f')]();_0x439bbf['limit'](_0x200bf2);_0x439bbf['offset'](0x0);logger[_0x2c8f('0x80')](_0x2c8f('0x81'),_0x439bbf['toString']());return dbH[_0x2c8f('0x82')][_0x2c8f('0x31')](_0x439bbf[_0x2c8f('0x83')](),{'type':dbH[_0x2c8f('0x82')][_0x2c8f('0x84')][_0x2c8f('0x85')]});}})[_0x2c8f('0x22')](respondWithResult(_0x536269,null))['catch'](handleError(_0x536269,null));};function runReport(_0x17da9b,_0x428c90,_0x180fd9){var _0x29f824=_0x428c90[_0x2c8f('0x29')];var _0x3a5a93=0xa;var _0x547294=[_0x2c8f('0x86'),_0x2c8f('0x51'),_0x2c8f('0x52'),'cross_join'];var _0x210b08={'SUM':_0x2c8f('0x53'),'COUNT':_0x2c8f('0x54'),'COUNT DISTINCT':_0x2c8f('0x55'),'MAX':_0x2c8f('0x56'),'MIN':'MIN(%s)','AVG':_0x2c8f('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0x38c4a6={'SEC_TO_TIME':_0x2c8f('0x5b'),'DATE':_0x2c8f('0x5c'),'HOUR':_0x2c8f('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2c8f('0x5e')};var _0x50ae8f=function(_0x26ebac){return!_['includes']([_0x2c8f('0x60'),_0x2c8f('0x61'),'IS\x20EMPTY',_0x2c8f('0x63')],_0x26ebac);};var _0xc63860=function(_0x30714d){if(!_0x30714d||!_0x30714d[_0x2c8f('0x64')][_0x2c8f('0x48')]){return'';}for(var _0x49f25d='(',_0x5d2da0=0x0;_0x5d2da0<_0x30714d['rules'][_0x2c8f('0x48')];_0x5d2da0+=0x1){_0x5d2da0>0x0&&(_0x49f25d+='\x20'+_0x30714d[_0x2c8f('0x65')]+'\x20');_0x49f25d+=_0x30714d[_0x2c8f('0x64')][_0x5d2da0]['group']?_0xc63860(_0x30714d[_0x2c8f('0x64')][_0x5d2da0][_0x2c8f('0x66')]):_0x30714d[_0x2c8f('0x64')][_0x5d2da0]['field']+'\x20'+_0x30714d[_0x2c8f('0x64')][_0x5d2da0][_0x2c8f('0x67')]+(_0x50ae8f(_0x30714d[_0x2c8f('0x64')][_0x5d2da0]['condition'])?'\x20'+_0x30714d['rules'][_0x5d2da0][_0x2c8f('0x68')]:'');}return _0x49f25d+')';};var _0x14e429={'where':{'id':_0x17da9b['id']}},_0x969e82,_0x1712a1,_0x2f0159,_0x944b34,_0x38aae;_0x14e429=_[_0x2c8f('0x3b')]({},_0x14e429,_0x180fd9);return db[_0x2c8f('0x2c')][_0x2c8f('0x49')](_0x14e429)[_0x2c8f('0x22')](function(_0x8f12f9){if(_0x8f12f9){_0x969e82=_0x8f12f9;return _0x8f12f9[_0x2c8f('0x69')]();}return null;})[_0x2c8f('0x22')](function(_0x21f690){if(_0x21f690){if(!_0x21f690[_0x2c8f('0x48')]){throw new db[(_0x2c8f('0x6a'))][(_0x2c8f('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1712a1=_0x21f690;return db[_0x2c8f('0x6d')][_0x2c8f('0x42')]({'raw':!![]});}return null;})[_0x2c8f('0x22')](function(_0x1b09bb){if(_0x1b09bb){_0x2f0159=_[_0x2c8f('0x87')](_0x1b09bb,'id');var _0x586ca5;var _0x45ef1b=squel[_0x2c8f('0x6e')]();_0x45ef1b['from'](_0x969e82['table']);for(var _0x4e55cd=0x0;_0x4e55cd<_0x1712a1[_0x2c8f('0x48')];_0x4e55cd+=0x1){_0x586ca5=_0x1712a1[_0x4e55cd][_0x2c8f('0x71')]?_0x2f0159[_0x1712a1[_0x4e55cd][_0x2c8f('0x71')]][_0x2c8f('0x72')]:_0x1712a1[_0x4e55cd][_0x2c8f('0x88')];_0x586ca5=_0x1712a1[_0x4e55cd][_0x2c8f('0x74')]?_[_0x2c8f('0x73')](_0x210b08[_0x1712a1[_0x4e55cd]['function']],'%s',_0x586ca5):_0x586ca5;_0x586ca5=_0x1712a1[_0x4e55cd][_0x2c8f('0x75')]?_['replace'](_0x38c4a6[_0x1712a1[_0x4e55cd][_0x2c8f('0x75')]],'%s',_0x586ca5):_0x586ca5;if(_0x1712a1[_0x4e55cd][_0x2c8f('0x89')]){_0x45ef1b[_0x2c8f('0x66')](_0x586ca5);}_0x1712a1[_0x4e55cd][_0x2c8f('0x76')]&&_0x45ef1b[_0x2c8f('0x37')](_0x586ca5,_0x1712a1[_0x4e55cd][_0x2c8f('0x76')]===_0x2c8f('0x77')?![]:!![]);_0x45ef1b[_0x2c8f('0x88')](_0x586ca5,_0x1712a1[_0x4e55cd]['alias']||_0x586ca5);}if(_0x969e82[_0x2c8f('0x79')]){_0x969e82[_0x2c8f('0x79')]=JSON[_0x2c8f('0x7a')](_0x969e82[_0x2c8f('0x79')]);for(var _0x52f27=0x0;_0x52f27<_0x969e82[_0x2c8f('0x79')]['length'];_0x52f27+=0x1){if(_0x969e82[_0x2c8f('0x79')][_0x52f27][_0x2c8f('0x3c')]&&_[_0x2c8f('0x5f')](_0x547294,_0x969e82[_0x2c8f('0x79')][_0x52f27]['type'])&&_0x969e82['joins'][_0x52f27][_0x2c8f('0x7b')]&&_0x969e82['joins'][_0x52f27][_0x2c8f('0x7c')]&&_0x969e82['joins'][_0x52f27][_0x2c8f('0x7d')]){_0x45ef1b[_0x969e82[_0x2c8f('0x79')][_0x52f27][_0x2c8f('0x3c')]](_0x969e82[_0x2c8f('0x79')][_0x52f27][_0x2c8f('0x7c')],null,util[_0x2c8f('0x75')]('%s.%s\x20=\x20%s.%s',_0x969e82['table'],_0x969e82[_0x2c8f('0x79')][_0x52f27][_0x2c8f('0x7b')],_0x969e82[_0x2c8f('0x79')][_0x52f27]['foreignTable'],_0x969e82[_0x2c8f('0x79')][_0x52f27][_0x2c8f('0x7d')]));}}}if(_0x969e82[_0x2c8f('0x7e')]){_0x969e82[_0x2c8f('0x7e')]=JSON['parse'](_0x969e82['conditions']);_0x45ef1b[_0x2c8f('0x39')](_0xc63860(_0x969e82[_0x2c8f('0x7e')]['group']));}_0x38aae=_0x45ef1b[_0x2c8f('0x7f')]();_0x45ef1b[_0x2c8f('0x1a')](_0x3a5a93);_0x45ef1b['offset'](0x0);return;}})[_0x2c8f('0x22')](function(){if(_0x428c90[_0x2c8f('0x8a')]===_0x2c8f('0x8b')){return null;}var _0x5b1e0a=_[_0x2c8f('0x3b')](_0x428c90,{'name':_0x428c90['fullPath']||_0x428c90[_0x2c8f('0x29')]||_0x969e82[_0x2c8f('0x29')],'basename':_0x29f824,'savename':util[_0x2c8f('0x75')](_0x2c8f('0x8c'),_0x428c90[_0x2c8f('0x29')]||_0x969e82[_0x2c8f('0x29')],require('randomstring')[_0x2c8f('0x8d')](0x4),_0x428c90['output']||_0x2c8f('0x8e')),'reportId':_0x969e82['id'],'reportType':_0x2c8f('0x8f')});return db[_0x2c8f('0x90')][_0x2c8f('0x4a')](_0x5b1e0a,{'raw':!![]});})[_0x2c8f('0x22')](function(_0x5f080c){if(_0x969e82[_0x2c8f('0x70')]==='cdr'){_0x38aae[_0x2c8f('0x39')](_0x969e82[_0x2c8f('0x70')]+_0x2c8f('0x91'),_0x428c90[_0x2c8f('0x92')],_0x428c90[_0x2c8f('0x93')]);}else{_0x38aae['where'](_0x969e82['table']+_0x2c8f('0x94'),_0x428c90['startDate'],_0x428c90[_0x2c8f('0x93')]);}if(_0x5f080c){logger[_0x2c8f('0x95')](_0x2c8f('0x96'),_0x38aae['toString']());require(_0x2c8f('0x97'))[_0x2c8f('0x98')](path['join'](__dirname,_0x2c8f('0x99'),_0x5f080c['output']),[_0x5f080c['id'],_0x38aae[_0x2c8f('0x83')](),path['join'](__dirname,_0x2c8f('0x9a'),_0x5f080c[_0x2c8f('0x9b')]),_0x29f824]);return _0x5f080c;}else{var _0x2067cd=squel['select']();_0x2067cd[_0x2c8f('0x6f')]('('+_0x38aae[_0x2c8f('0x83')]()+')','countTable');_0x2067cd[_0x2c8f('0x88')](_0x2c8f('0x9c'),_0x2c8f('0x1c'));_0x38aae[_0x2c8f('0x1a')](_0x428c90[_0x2c8f('0x1a')]||_0x3a5a93);_0x38aae['offset'](_0x428c90[_0x2c8f('0x1d')]||0x0);return dbH[_0x2c8f('0x82')][_0x2c8f('0x31')](_0x2067cd[_0x2c8f('0x83')](),{'type':dbH[_0x2c8f('0x82')][_0x2c8f('0x84')]['SELECT']})[_0x2c8f('0x22')](function(_0x535b11){if(!_0x535b11[_0x2c8f('0x48')]){_0x944b34=0x0;}else{_0x944b34=_0x535b11[0x0][_0x2c8f('0x1c')]||0x0;}return dbH[_0x2c8f('0x82')][_0x2c8f('0x31')](_0x38aae[_0x2c8f('0x83')](),{'type':dbH[_0x2c8f('0x82')][_0x2c8f('0x84')][_0x2c8f('0x85')]});})[_0x2c8f('0x22')](function(_0x5ed072){return{'rows':_0x5ed072||[],'count':_0x944b34};});}});}exports[_0x2c8f('0x9d')]=function(_0x47f519,_0x3d38c0){return runReport(_0x47f519[_0x2c8f('0x46')],_0x47f519[_0x2c8f('0x31')],_0x47f519['options'])[_0x2c8f('0x22')](respondWithResult(_0x3d38c0,null))[_0x2c8f('0x44')](handleError(_0x3d38c0,null));};exports[_0x2c8f('0x9e')]=runReport;exports[_0x2c8f('0x31')]=function(_0x58834a,_0x5945cd){var _0x169fde=0xa;var _0x3cc172=[_0x2c8f('0x86'),_0x2c8f('0x51'),_0x2c8f('0x52'),_0x2c8f('0x9f')];var _0x202700={'SUM':_0x2c8f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c8f('0x55'),'MAX':_0x2c8f('0x56'),'MIN':_0x2c8f('0xa0'),'AVG':_0x2c8f('0x57'),'GROUP_CONCAT':_0x2c8f('0x58'),'GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0x45a947={'SEC_TO_TIME':_0x2c8f('0x5b'),'DATE':_0x2c8f('0x5c'),'HOUR':_0x2c8f('0x5d'),'ROUND':_0x2c8f('0xa1'),'UNIX_TIMESTAMP':_0x2c8f('0x5e')};var _0x17cd7b=function(_0x383423){return!_['includes'](['IS\x20NULL',_0x2c8f('0x61'),'IS\x20EMPTY',_0x2c8f('0x63')],_0x383423);};var _0x2778d1=function(_0x46269a){if(!_0x46269a||!_0x46269a[_0x2c8f('0x64')][_0x2c8f('0x48')]){return'';}for(var _0x47c8e1='(',_0x18ddee=0x0;_0x18ddee<_0x46269a[_0x2c8f('0x64')][_0x2c8f('0x48')];_0x18ddee+=0x1){_0x18ddee>0x0&&(_0x47c8e1+='\x20'+_0x46269a[_0x2c8f('0x65')]+'\x20');_0x47c8e1+=_0x46269a[_0x2c8f('0x64')][_0x18ddee]['group']?_0x2778d1(_0x46269a[_0x2c8f('0x64')][_0x18ddee][_0x2c8f('0x66')]):_0x46269a[_0x2c8f('0x64')][_0x18ddee][_0x2c8f('0x88')]+'\x20'+_0x46269a[_0x2c8f('0x64')][_0x18ddee]['condition']+(_0x17cd7b(_0x46269a[_0x2c8f('0x64')][_0x18ddee][_0x2c8f('0x67')])?'\x20'+_0x46269a[_0x2c8f('0x64')][_0x18ddee][_0x2c8f('0x68')]:'');}return _0x47c8e1+')';};var _0x33f877={'where':{'id':_0x58834a[_0x2c8f('0x46')]['id']}},_0x298c22,_0x4df495,_0x3f6164,_0xea8d3d,_0x486009;_0x33f877=_[_0x2c8f('0x3b')]({},_0x33f877,_0x58834a['options']);return db[_0x2c8f('0x2c')][_0x2c8f('0x49')](_0x33f877)[_0x2c8f('0x22')](function(_0x30cb82){if(_0x30cb82){_0x298c22=_0x30cb82;return _0x30cb82['getFields']();}return null;})[_0x2c8f('0x22')](function(_0x201e46){if(_0x201e46){if(!_0x201e46[_0x2c8f('0x48')]){throw new db[(_0x2c8f('0x6a'))]['ValidationErrorItem'](_0x2c8f('0x6c'),0x193);}_0x4df495=_0x201e46;return db[_0x2c8f('0x6d')][_0x2c8f('0x42')]({'raw':!![]});}return null;})[_0x2c8f('0x22')](function(_0x5948bc){if(_0x5948bc){_0x3f6164=_[_0x2c8f('0x87')](_0x5948bc,'id');var _0x4b7e9f;var _0x1c619b=squel[_0x2c8f('0x6e')]();_0x1c619b[_0x2c8f('0x6f')](_0x298c22[_0x2c8f('0x70')]);for(var _0x13eb25=0x0;_0x13eb25<_0x4df495[_0x2c8f('0x48')];_0x13eb25+=0x1){_0x4b7e9f=_0x4df495[_0x13eb25][_0x2c8f('0x71')]?_0x3f6164[_0x4df495[_0x13eb25]['MetricId']][_0x2c8f('0x72')]:_0x4df495[_0x13eb25]['field'];_0x4b7e9f=_0x4df495[_0x13eb25][_0x2c8f('0x74')]?_['replace'](_0x202700[_0x4df495[_0x13eb25][_0x2c8f('0x74')]],'%s',_0x4b7e9f):_0x4b7e9f;_0x4b7e9f=_0x4df495[_0x13eb25][_0x2c8f('0x75')]?_[_0x2c8f('0x73')](_0x45a947[_0x4df495[_0x13eb25][_0x2c8f('0x75')]],'%s',_0x4b7e9f):_0x4b7e9f;if(_0x4df495[_0x13eb25][_0x2c8f('0x89')]){_0x1c619b[_0x2c8f('0x66')](_0x4b7e9f);}_0x4df495[_0x13eb25][_0x2c8f('0x76')]&&_0x1c619b['order'](_0x4b7e9f,_0x4df495[_0x13eb25][_0x2c8f('0x76')]===_0x2c8f('0x77')?![]:!![]);_0x1c619b[_0x2c8f('0x88')](_0x4b7e9f,_0x4df495[_0x13eb25][_0x2c8f('0x78')]||_0x4b7e9f);}if(_0x298c22[_0x2c8f('0x79')]){_0x298c22[_0x2c8f('0x79')]=JSON[_0x2c8f('0x7a')](_0x298c22[_0x2c8f('0x79')]);for(var _0x1af8c2=0x0;_0x1af8c2<_0x298c22['joins'][_0x2c8f('0x48')];_0x1af8c2+=0x1){if(_0x298c22[_0x2c8f('0x79')][_0x1af8c2]['type']&&_[_0x2c8f('0x5f')](_0x3cc172,_0x298c22['joins'][_0x1af8c2]['type'])&&_0x298c22[_0x2c8f('0x79')][_0x1af8c2][_0x2c8f('0x7b')]&&_0x298c22[_0x2c8f('0x79')][_0x1af8c2][_0x2c8f('0x7c')]&&_0x298c22['joins'][_0x1af8c2][_0x2c8f('0x7d')]){_0x1c619b[_0x298c22['joins'][_0x1af8c2][_0x2c8f('0x3c')]](_0x298c22[_0x2c8f('0x79')][_0x1af8c2][_0x2c8f('0x7c')],null,util[_0x2c8f('0x75')](_0x2c8f('0xa2'),_0x298c22[_0x2c8f('0x70')],_0x298c22[_0x2c8f('0x79')][_0x1af8c2][_0x2c8f('0x7b')],_0x298c22['joins'][_0x1af8c2][_0x2c8f('0x7c')],_0x298c22[_0x2c8f('0x79')][_0x1af8c2][_0x2c8f('0x7d')]));}}}if(_0x298c22[_0x2c8f('0x7e')]){_0x298c22[_0x2c8f('0x7e')]=JSON['parse'](_0x298c22[_0x2c8f('0x7e')]);_0x1c619b[_0x2c8f('0x39')](_0x2778d1(_0x298c22['conditions']['group']));}_0x486009=_0x1c619b[_0x2c8f('0x7f')]();_0x1c619b[_0x2c8f('0x1a')](_0x169fde);_0x1c619b['offset'](0x0);logger['debug'](_0x2c8f('0x81'),_0x1c619b['toString']());return dbH[_0x2c8f('0x82')][_0x2c8f('0x31')](_0x1c619b[_0x2c8f('0x83')](),{'type':dbH[_0x2c8f('0x82')]['QueryTypes']['SELECT']});}})[_0x2c8f('0x22')](function(){return{'sql':_0x486009['toString']()};})[_0x2c8f('0x22')](respondWithResult(_0x5945cd,null))[_0x2c8f('0x44')](handleError(_0x5945cd,null));}; \ No newline at end of file +var _0xfc8f=['path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','user','get','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%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\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','UNIX_TIMESTAMP(%s)','operator','keyBy','MetricId','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MAX(%s)','AVG(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x128437,_0x588bab){var _0x27ca7a=function(_0x2f9765){while(--_0x2f9765){_0x128437['push'](_0x128437['shift']());}};_0x27ca7a(++_0x588bab);}(_0xfc8f,0xa0));var _0xffc8=function(_0x21bc1d,_0x5cf2f7){_0x21bc1d=_0x21bc1d-0x0;var _0x4a9c53=_0xfc8f[_0x21bc1d];return _0x4a9c53;};'use strict';var emlformat=require(_0xffc8('0x0'));var rimraf=require(_0xffc8('0x1'));var zipdir=require(_0xffc8('0x2'));var jsonpatch=require(_0xffc8('0x3'));var rp=require('request-promise');var moment=require(_0xffc8('0x4'));var BPromise=require(_0xffc8('0x5'));var Mustache=require(_0xffc8('0x6'));var util=require(_0xffc8('0x7'));var path=require(_0xffc8('0x8'));var sox=require(_0xffc8('0x9'));var csv=require('to-csv');var ejs=require(_0xffc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffc8('0xb'));var crypto=require(_0xffc8('0xc'));var jsforce=require(_0xffc8('0xd'));var deskjs=require(_0xffc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffc8('0xf'));var Papa=require(_0xffc8('0x10'));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(_0xffc8('0x11'));var logger=require(_0xffc8('0x12'))(_0xffc8('0x13'));var utils=require(_0xffc8('0x14'));var config=require(_0xffc8('0x15'));var licenseUtil=require(_0xffc8('0x16'));var db=require(_0xffc8('0x17'))['db'];var dbH=require(_0xffc8('0x17'))[_0xffc8('0x18')];function respondWithStatusCode(_0x4464bf,_0x61308a){_0x61308a=_0x61308a||0xcc;return function(_0x51c31c){if(_0x51c31c){return _0x4464bf[_0xffc8('0x19')](_0x61308a);}return _0x4464bf[_0xffc8('0x1a')](_0x61308a)[_0xffc8('0x1b')]();};}function respondWithResult(_0x4542c6,_0x56dd24){_0x56dd24=_0x56dd24||0xc8;return function(_0x4dfc77){if(_0x4dfc77){return _0x4542c6[_0xffc8('0x1a')](_0x56dd24)[_0xffc8('0x1c')](_0x4dfc77);}};}function respondWithFilteredResult(_0x324f2a,_0x27f1fc){return function(_0x3bb14b){if(_0x3bb14b){var _0x4d8c3c=typeof _0x27f1fc[_0xffc8('0x1d')]===_0xffc8('0x1e')&&typeof _0x27f1fc[_0xffc8('0x1f')]===_0xffc8('0x1e');var _0x239f23=_0x3bb14b[_0xffc8('0x20')];var _0x326a4a=_0x4d8c3c?0x0:_0x27f1fc[_0xffc8('0x1d')];var _0x4b9ac9=_0x4d8c3c?_0x3bb14b[_0xffc8('0x20')]:_0x27f1fc['offset']+_0x27f1fc[_0xffc8('0x1f')];var _0x2baba7;if(_0x4b9ac9>=_0x239f23){_0x4b9ac9=_0x239f23;_0x2baba7=0xc8;}else{_0x2baba7=0xce;}_0x324f2a[_0xffc8('0x1a')](_0x2baba7);return _0x324f2a[_0xffc8('0x21')](_0xffc8('0x22'),_0x326a4a+'-'+_0x4b9ac9+'/'+_0x239f23)[_0xffc8('0x1c')](_0x3bb14b);}return null;};}function patchUpdates(_0x3d9b2a){return function(_0x17fd8d){try{jsonpatch['apply'](_0x17fd8d,_0x3d9b2a,!![]);}catch(_0x1f909c){return BPromise['reject'](_0x1f909c);}return _0x17fd8d[_0xffc8('0x23')]();};}function saveUpdates(_0x24de04,_0x5e982f){return function(_0x212745){if(_0x212745){return _0x212745[_0xffc8('0x24')](_0x24de04)[_0xffc8('0x25')](function(_0x35ab3d){return _0x35ab3d;});}return null;};}function removeEntity(_0x3885ff,_0x57c6f4){return function(_0x100163){if(_0x100163){return _0x100163[_0xffc8('0x26')]()[_0xffc8('0x25')](function(){var _0x495221=_0x100163['get']({'plain':!![]});var _0x14dc5d=_0xffc8('0x27');return db[_0xffc8('0x28')][_0xffc8('0x26')]({'where':{'type':_0x14dc5d,'resourceId':_0x495221['id']}})[_0xffc8('0x25')](function(){return _0x100163;});})[_0xffc8('0x25')](function(){_0x3885ff[_0xffc8('0x1a')](0xcc)[_0xffc8('0x1b')]();});}};}function handleEntityNotFound(_0x442227,_0x48e931){return function(_0x1c3155){if(!_0x1c3155){_0x442227[_0xffc8('0x19')](0x194);}return _0x1c3155;};}function handleError(_0x3abf91,_0x393caa){_0x393caa=_0x393caa||0x1f4;return function(_0x32439f){logger[_0xffc8('0x29')](_0x32439f[_0xffc8('0x2a')]);if(_0x32439f[_0xffc8('0x2b')]){delete _0x32439f[_0xffc8('0x2b')];}_0x3abf91[_0xffc8('0x1a')](_0x393caa)[_0xffc8('0x2c')](_0x32439f);};}exports[_0xffc8('0x2d')]=function(_0x1bd6ad,_0x58d9fe){var _0x328d86={},_0x3e5b71={},_0x11a169={'count':0x0,'rows':[]};var _0x282906=_['map'](db[_0xffc8('0x2e')][_0xffc8('0x2f')],function(_0xf9036d){return{'name':_0xf9036d[_0xffc8('0x30')],'type':_0xf9036d[_0xffc8('0x31')][_0xffc8('0x32')]};});_0x3e5b71[_0xffc8('0x33')]=_['map'](_0x282906,_0xffc8('0x2b'));_0x3e5b71[_0xffc8('0x34')]=_['keys'](_0x1bd6ad['query']);_0x3e5b71[_0xffc8('0x35')]=_[_0xffc8('0x36')](_0x3e5b71[_0xffc8('0x33')],_0x3e5b71[_0xffc8('0x34')]);_0x328d86[_0xffc8('0x37')]=_[_0xffc8('0x36')](_0x3e5b71[_0xffc8('0x33')],qs[_0xffc8('0x38')](_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x38')]));_0x328d86[_0xffc8('0x37')]=_0x328d86[_0xffc8('0x37')]['length']?_0x328d86[_0xffc8('0x37')]:_0x3e5b71[_0xffc8('0x33')];if(!_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x39')]('nolimit')){_0x328d86[_0xffc8('0x1f')]=qs[_0xffc8('0x1f')](_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x1f')]);_0x328d86[_0xffc8('0x1d')]=qs[_0xffc8('0x1d')](_0x1bd6ad[_0xffc8('0x34')]['offset']);}_0x328d86[_0xffc8('0x3a')]=qs[_0xffc8('0x3b')](_0x1bd6ad['query'][_0xffc8('0x3b')]);_0x328d86[_0xffc8('0x3c')]=qs[_0xffc8('0x35')](_['pick'](_0x1bd6ad[_0xffc8('0x34')],_0x3e5b71[_0xffc8('0x35')]),_0x282906);if(_0x1bd6ad['query'][_0xffc8('0x3d')]){_0x328d86[_0xffc8('0x3c')]=_[_0xffc8('0x3e')](_0x328d86[_0xffc8('0x3c')],{'$or':_[_0xffc8('0x3f')](_0x282906,function(_0x23dcc7){if(_0x23dcc7['type']!==_0xffc8('0x40')){var _0x261285={};_0x261285[_0x23dcc7['name']]={'$like':'%'+_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x3d')]+'%'};return _0x261285;}})});}_0x328d86=_['merge']({},_0x328d86,_0x1bd6ad[_0xffc8('0x41')]);var _0x4dcda4={'where':_0x328d86[_0xffc8('0x3c')]};return db[_0xffc8('0x2e')]['count'](_0x4dcda4)[_0xffc8('0x25')](function(_0x4f9930){_0x11a169[_0xffc8('0x20')]=_0x4f9930;if(_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x42')]){_0x328d86[_0xffc8('0x43')]=[{'all':!![]}];}return db[_0xffc8('0x2e')][_0xffc8('0x44')](_0x328d86);})[_0xffc8('0x25')](function(_0x19cf79){_0x11a169[_0xffc8('0x45')]=_0x19cf79;return _0x11a169;})[_0xffc8('0x25')](respondWithFilteredResult(_0x58d9fe,_0x328d86))[_0xffc8('0x46')](handleError(_0x58d9fe,null));};exports[_0xffc8('0x47')]=function(_0x5146f8,_0x21f5a4){var _0x447470={'raw':![],'where':{'id':_0x5146f8[_0xffc8('0x48')]['id']}},_0x202113={};_0x202113['model']=_['keys'](db[_0xffc8('0x2e')][_0xffc8('0x2f')]);_0x202113[_0xffc8('0x34')]=_[_0xffc8('0x49')](_0x5146f8[_0xffc8('0x34')]);_0x202113[_0xffc8('0x35')]=_[_0xffc8('0x36')](_0x202113['model'],_0x202113[_0xffc8('0x34')]);_0x447470['attributes']=_[_0xffc8('0x36')](_0x202113['model'],qs[_0xffc8('0x38')](_0x5146f8['query'][_0xffc8('0x38')]));_0x447470[_0xffc8('0x37')]=_0x447470[_0xffc8('0x37')][_0xffc8('0x4a')]?_0x447470[_0xffc8('0x37')]:_0x202113['model'];if(_0x5146f8['query'][_0xffc8('0x42')]){_0x447470[_0xffc8('0x43')]=[{'all':!![]}];}_0x447470=_['merge']({},_0x447470,_0x5146f8[_0xffc8('0x41')]);return db[_0xffc8('0x2e')]['find'](_0x447470)[_0xffc8('0x25')](handleEntityNotFound(_0x21f5a4,null))[_0xffc8('0x25')](respondWithResult(_0x21f5a4,null))[_0xffc8('0x46')](handleError(_0x21f5a4,null));};exports[_0xffc8('0x4b')]=function(_0x4d0afb,_0x4f75c9){return db[_0xffc8('0x2e')][_0xffc8('0x4b')](_0x4d0afb['body'],{})['then'](function(_0x27fa13){var _0x68ef02=_0x4d0afb[_0xffc8('0x4c')][_0xffc8('0x4d')]({'plain':!![]});if(!_0x68ef02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x68ef02[_0xffc8('0x4e')]==='user'){var _0x4006fb=_0x27fa13[_0xffc8('0x4d')]({'plain':!![]});var _0x24aa94=_0xffc8('0x4f');return db[_0xffc8('0x50')][_0xffc8('0x51')]({'where':{'name':_0x24aa94,'userProfileId':_0x68ef02[_0xffc8('0x52')]},'raw':!![]})[_0xffc8('0x25')](function(_0x39016b){if(_0x39016b&&_0x39016b[_0xffc8('0x53')]===0x0){return db[_0xffc8('0x28')][_0xffc8('0x4b')]({'name':_0x4006fb[_0xffc8('0x2b')],'resourceId':_0x4006fb['id'],'type':_0xffc8('0x27'),'sectionId':_0x39016b['id']},{})[_0xffc8('0x25')](function(){return _0x27fa13;});}else{return _0x27fa13;}})['catch'](function(_0xff4dfc){logger[_0xffc8('0x29')](_0xffc8('0x54'),_0xff4dfc);throw _0xff4dfc;});}return _0x27fa13;})[_0xffc8('0x25')](respondWithResult(_0x4f75c9,0xc9))[_0xffc8('0x46')](handleError(_0x4f75c9,null));};exports['update']=function(_0x3d8392,_0x30e0cc){if(_0x3d8392[_0xffc8('0x55')]['id']){delete _0x3d8392['body']['id'];}return db[_0xffc8('0x2e')][_0xffc8('0x51')]({'where':{'id':_0x3d8392[_0xffc8('0x48')]['id']}})[_0xffc8('0x25')](handleEntityNotFound(_0x30e0cc,null))[_0xffc8('0x25')](saveUpdates(_0x3d8392[_0xffc8('0x55')],null))[_0xffc8('0x25')](respondWithResult(_0x30e0cc,null))[_0xffc8('0x46')](handleError(_0x30e0cc,null));};exports[_0xffc8('0x26')]=function(_0x37ecab,_0x119c1c){return db['AnalyticCustomReport'][_0xffc8('0x51')]({'where':{'id':_0x37ecab[_0xffc8('0x48')]['id']}})[_0xffc8('0x25')](handleEntityNotFound(_0x119c1c,null))['then'](removeEntity(_0x119c1c,null))[_0xffc8('0x46')](handleError(_0x119c1c,null));};exports[_0xffc8('0x56')]=function(_0x5dbaa7,_0x27fb50){var _0xdf0ebd=0xa;var _0x37eb2a=[_0xffc8('0x57'),_0xffc8('0x58'),_0xffc8('0x59'),_0xffc8('0x5a')];var _0x311d81={'SUM':_0xffc8('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xffc8('0x5c'),'MAX':'MAX(%s)','MIN':_0xffc8('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x36b9bf={'SEC_TO_TIME':_0xffc8('0x61'),'DATE':_0xffc8('0x62'),'HOUR':_0xffc8('0x63'),'ROUND':_0xffc8('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1db047=function(_0x45cb80){return!_[_0xffc8('0x65')]([_0xffc8('0x66'),_0xffc8('0x67'),_0xffc8('0x68'),_0xffc8('0x69')],_0x45cb80);};var _0x3b809c=function(_0x28ca4a){if(!_0x28ca4a||!_0x28ca4a[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x14b890='(',_0x5121da=0x0;_0x5121da<_0x28ca4a['rules'][_0xffc8('0x4a')];_0x5121da+=0x1){_0x5121da>0x0&&(_0x14b890+='\x20'+_0x28ca4a['operator']+'\x20');_0x14b890+=_0x28ca4a['rules'][_0x5121da][_0xffc8('0x6b')]?_0x3b809c(_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6b')]):_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6c')]+'\x20'+_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6d')]+(_0x1db047(_0x28ca4a['rules'][_0x5121da][_0xffc8('0x6d')])?'\x20'+_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6e')]:'');}return _0x14b890+')';};var _0x538b14={'where':{'id':_0x5dbaa7['params']['id']}},_0x58b6ce,_0x2216f5,_0x26c0bc,_0x8dddcb,_0x250525;_0x538b14=_[_0xffc8('0x3e')]({},_0x538b14,_0x5dbaa7[_0xffc8('0x41')]);return db[_0xffc8('0x2e')]['find'](_0x538b14)['then'](function(_0x1ccc5e){if(_0x1ccc5e){_0x58b6ce=_0x1ccc5e;return _0x1ccc5e[_0xffc8('0x6f')]();}return null;})[_0xffc8('0x25')](function(_0x303155){if(_0x303155){if(!_0x303155['length']){throw new db[(_0xffc8('0x70'))][(_0xffc8('0x71'))](_0xffc8('0x72'),0x193);}_0x2216f5=_0x303155;return db[_0xffc8('0x73')][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x1ab127){if(_0x1ab127){_0x26c0bc=_['keyBy'](_0x1ab127,'id');var _0x5dc5da;var _0x217cdb=squel[_0xffc8('0x74')]();_0x217cdb[_0xffc8('0x75')](_0x58b6ce[_0xffc8('0x76')]);for(var _0x12659f=0x0;_0x12659f<_0x2216f5['length'];_0x12659f+=0x1){_0x5dc5da=_0x2216f5[_0x12659f]['MetricId']?_0x26c0bc[_0x2216f5[_0x12659f]['MetricId']][_0xffc8('0x77')]:_0x2216f5[_0x12659f]['field'];_0x5dc5da=_0x2216f5[_0x12659f]['function']?_[_0xffc8('0x78')](_0x311d81[_0x2216f5[_0x12659f][_0xffc8('0x79')]],'%s',_0x5dc5da):_0x5dc5da;_0x5dc5da=_0x2216f5[_0x12659f]['format']?_[_0xffc8('0x78')](_0x36b9bf[_0x2216f5[_0x12659f][_0xffc8('0x7a')]],'%s',_0x5dc5da):_0x5dc5da;if(_0x2216f5[_0x12659f][_0xffc8('0x7b')]){_0x217cdb[_0xffc8('0x6b')](_0x5dc5da);}_0x2216f5[_0x12659f][_0xffc8('0x7c')]&&_0x217cdb['order'](_0x5dc5da,_0x2216f5[_0x12659f][_0xffc8('0x7c')]===_0xffc8('0x7d')?![]:!![]);_0x217cdb[_0xffc8('0x6c')](_0x5dc5da,_0x2216f5[_0x12659f][_0xffc8('0x7e')]||_0x5dc5da);}if(_0x58b6ce[_0xffc8('0x7f')]){_0x58b6ce[_0xffc8('0x7f')]=JSON['parse'](_0x58b6ce[_0xffc8('0x7f')]);for(var _0x5b362d=0x0;_0x5b362d<_0x58b6ce[_0xffc8('0x7f')]['length'];_0x5b362d+=0x1){if(_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['type']&&_[_0xffc8('0x65')](_0x37eb2a,_0x58b6ce['joins'][_0x5b362d]['type'])&&_0x58b6ce['joins'][_0x5b362d]['parentKey']&&_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['foreignTable']&&_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x80')]){_0x217cdb[_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['type']](_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x81')],null,util[_0xffc8('0x7a')](_0xffc8('0x82'),_0x58b6ce[_0xffc8('0x76')],_0x58b6ce[_0xffc8('0x7f')][_0x5b362d][_0xffc8('0x83')],_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x81')],_0x58b6ce[_0xffc8('0x7f')][_0x5b362d][_0xffc8('0x80')]));}}}if(_0x58b6ce[_0xffc8('0x84')]){_0x58b6ce[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x58b6ce[_0xffc8('0x84')]);_0x217cdb[_0xffc8('0x3c')](_0x3b809c(_0x58b6ce[_0xffc8('0x84')]['group']));}_0x250525=_0x217cdb['clone']();_0x217cdb['limit'](_0xdf0ebd);_0x217cdb[_0xffc8('0x1d')](0x0);logger[_0xffc8('0x86')](_0xffc8('0x87'),_0x217cdb[_0xffc8('0x88')]());return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x217cdb[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});}})[_0xffc8('0x25')](respondWithResult(_0x27fb50,null))[_0xffc8('0x46')](handleError(_0x27fb50,null));};function runReport(_0x962763,_0x5dc242,_0x3a6ce5){var _0x55b463=_0x5dc242[_0xffc8('0x2b')];var _0x4d3bda=0xa;var _0x58b8e6=[_0xffc8('0x57'),_0xffc8('0x58'),_0xffc8('0x59'),_0xffc8('0x5a')];var _0x450691={'SUM':_0xffc8('0x5b'),'COUNT':_0xffc8('0x8c'),'COUNT DISTINCT':_0xffc8('0x5c'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x5f337e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xffc8('0x62'),'HOUR':_0xffc8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xffc8('0x8d')};var _0x44b6b3=function(_0x2196c6){return!_['includes']([_0xffc8('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xffc8('0x69')],_0x2196c6);};var _0x3a7d1d=function(_0x3cf7fe){if(!_0x3cf7fe||!_0x3cf7fe[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x4a2463='(',_0xa6311c=0x0;_0xa6311c<_0x3cf7fe['rules'][_0xffc8('0x4a')];_0xa6311c+=0x1){_0xa6311c>0x0&&(_0x4a2463+='\x20'+_0x3cf7fe[_0xffc8('0x8e')]+'\x20');_0x4a2463+=_0x3cf7fe['rules'][_0xa6311c][_0xffc8('0x6b')]?_0x3a7d1d(_0x3cf7fe['rules'][_0xa6311c][_0xffc8('0x6b')]):_0x3cf7fe['rules'][_0xa6311c]['field']+'\x20'+_0x3cf7fe['rules'][_0xa6311c]['condition']+(_0x44b6b3(_0x3cf7fe[_0xffc8('0x6a')][_0xa6311c][_0xffc8('0x6d')])?'\x20'+_0x3cf7fe[_0xffc8('0x6a')][_0xa6311c]['value']:'');}return _0x4a2463+')';};var _0x584d07={'where':{'id':_0x962763['id']}},_0x5a1abb,_0x3ef204,_0x134f86,_0x19404a,_0x4190d6;_0x584d07=_[_0xffc8('0x3e')]({},_0x584d07,_0x3a6ce5);return db[_0xffc8('0x2e')][_0xffc8('0x51')](_0x584d07)['then'](function(_0x368946){if(_0x368946){_0x5a1abb=_0x368946;return _0x368946['getFields']();}return null;})[_0xffc8('0x25')](function(_0x1ef7b3){if(_0x1ef7b3){if(!_0x1ef7b3[_0xffc8('0x4a')]){throw new db[(_0xffc8('0x70'))]['ValidationErrorItem'](_0xffc8('0x72'),0x193);}_0x3ef204=_0x1ef7b3;return db['AnalyticMetric'][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x5615f2){if(_0x5615f2){_0x134f86=_[_0xffc8('0x8f')](_0x5615f2,'id');var _0x4c4217;var _0x13037e=squel[_0xffc8('0x74')]();_0x13037e['from'](_0x5a1abb['table']);for(var _0x517db2=0x0;_0x517db2<_0x3ef204[_0xffc8('0x4a')];_0x517db2+=0x1){_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x90')]?_0x134f86[_0x3ef204[_0x517db2][_0xffc8('0x90')]][_0xffc8('0x77')]:_0x3ef204[_0x517db2]['field'];_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x79')]?_[_0xffc8('0x78')](_0x450691[_0x3ef204[_0x517db2][_0xffc8('0x79')]],'%s',_0x4c4217):_0x4c4217;_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x7a')]?_[_0xffc8('0x78')](_0x5f337e[_0x3ef204[_0x517db2][_0xffc8('0x7a')]],'%s',_0x4c4217):_0x4c4217;if(_0x3ef204[_0x517db2][_0xffc8('0x7b')]){_0x13037e[_0xffc8('0x6b')](_0x4c4217);}_0x3ef204[_0x517db2][_0xffc8('0x7c')]&&_0x13037e['order'](_0x4c4217,_0x3ef204[_0x517db2]['orderBy']===_0xffc8('0x7d')?![]:!![]);_0x13037e[_0xffc8('0x6c')](_0x4c4217,_0x3ef204[_0x517db2][_0xffc8('0x7e')]||_0x4c4217);}if(_0x5a1abb[_0xffc8('0x7f')]){_0x5a1abb['joins']=JSON[_0xffc8('0x85')](_0x5a1abb['joins']);for(var _0x34b9c8=0x0;_0x34b9c8<_0x5a1abb[_0xffc8('0x7f')]['length'];_0x34b9c8+=0x1){if(_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x31')]&&_[_0xffc8('0x65')](_0x58b8e6,_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x31')])&&_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x83')]&&_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x81')]&&_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x80')]){_0x13037e[_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x31')]](_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x81')],null,util[_0xffc8('0x7a')](_0xffc8('0x82'),_0x5a1abb[_0xffc8('0x76')],_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x83')],_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x81')],_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8]['foreignKey']));}}}if(_0x5a1abb[_0xffc8('0x84')]){_0x5a1abb[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x5a1abb['conditions']);_0x13037e[_0xffc8('0x3c')](_0x3a7d1d(_0x5a1abb['conditions']['group']));}_0x4190d6=_0x13037e[_0xffc8('0x91')]();_0x13037e[_0xffc8('0x1f')](_0x4d3bda);_0x13037e[_0xffc8('0x1d')](0x0);return;}})['then'](function(){if(_0x5dc242[_0xffc8('0x92')]===_0xffc8('0x93')){return null;}var _0x5f3169=_[_0xffc8('0x3e')](_0x5dc242,{'name':_0x5dc242[_0xffc8('0x94')]||_0x5dc242[_0xffc8('0x2b')]||_0x5a1abb['name'],'basename':_0x55b463,'savename':util[_0xffc8('0x7a')](_0xffc8('0x95'),_0x5dc242['name']||_0x5a1abb[_0xffc8('0x2b')],require('randomstring')[_0xffc8('0x96')](0x4),_0x5dc242[_0xffc8('0x92')]||_0xffc8('0x97')),'reportId':_0x5a1abb['id'],'reportType':_0xffc8('0x98')});return db[_0xffc8('0x99')]['create'](_0x5f3169,{'raw':!![]});})[_0xffc8('0x25')](function(_0x3cec6f){if(_0x5a1abb[_0xffc8('0x76')]===_0xffc8('0x9a')){_0x4190d6[_0xffc8('0x3c')](_0x5a1abb[_0xffc8('0x76')]+_0xffc8('0x9b'),_0x5dc242[_0xffc8('0x9c')],_0x5dc242[_0xffc8('0x9d')]);}else{_0x4190d6['where'](_0x5a1abb['table']+_0xffc8('0x9e'),_0x5dc242[_0xffc8('0x9c')],_0x5dc242['endDate']);}if(_0x3cec6f){logger['info']('Run\x20Query:',_0x4190d6[_0xffc8('0x88')]());require(_0xffc8('0x9f'))['fork'](path[_0xffc8('0x57')](__dirname,'../../components/export/',_0x3cec6f['output']),[_0x3cec6f['id'],_0x4190d6[_0xffc8('0x88')](),path[_0xffc8('0x57')](__dirname,_0xffc8('0xa0'),_0x3cec6f[_0xffc8('0xa1')]),_0x55b463]);return _0x3cec6f;}else{var _0x33e069=squel[_0xffc8('0x74')]();_0x33e069[_0xffc8('0x75')]('('+_0x4190d6[_0xffc8('0x88')]()+')',_0xffc8('0xa2'));_0x33e069['field'](_0xffc8('0xa3'),_0xffc8('0x20'));_0x4190d6[_0xffc8('0x1f')](_0x5dc242[_0xffc8('0x1f')]||_0x4d3bda);_0x4190d6[_0xffc8('0x1d')](_0x5dc242[_0xffc8('0x1d')]||0x0);return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x33e069[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]})[_0xffc8('0x25')](function(_0x17d7a7){if(!_0x17d7a7[_0xffc8('0x4a')]){_0x19404a=0x0;}else{_0x19404a=_0x17d7a7[0x0]['count']||0x0;}return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x4190d6[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});})[_0xffc8('0x25')](function(_0x2762ff){return{'rows':_0x2762ff||[],'count':_0x19404a};});}});}exports[_0xffc8('0xa4')]=function(_0x53ce74,_0x44e87b){return runReport(_0x53ce74['params'],_0x53ce74[_0xffc8('0x34')],_0x53ce74['options'])['then'](respondWithResult(_0x44e87b,null))[_0xffc8('0x46')](handleError(_0x44e87b,null));};exports[_0xffc8('0xa5')]=runReport;exports[_0xffc8('0x34')]=function(_0x41dcfa,_0x4e10c9){var _0x11e6c3=0xa;var _0x4002f5=[_0xffc8('0x57'),'left_join',_0xffc8('0x59'),_0xffc8('0x5a')];var _0x1a854f={'SUM':_0xffc8('0x5b'),'COUNT':_0xffc8('0x8c'),'COUNT DISTINCT':_0xffc8('0x5c'),'MAX':_0xffc8('0xa6'),'MIN':'MIN(%s)','AVG':_0xffc8('0xa7'),'GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x367b8f={'SEC_TO_TIME':_0xffc8('0x61'),'DATE':'DATE(%s)','HOUR':_0xffc8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xffc8('0x8d')};var _0x42bb1f=function(_0x1e7df5){return!_[_0xffc8('0x65')](['IS\x20NULL',_0xffc8('0x67'),'IS\x20EMPTY',_0xffc8('0x69')],_0x1e7df5);};var _0x2f9ff5=function(_0x53c709){if(!_0x53c709||!_0x53c709[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x40758d='(',_0xf4310a=0x0;_0xf4310a<_0x53c709[_0xffc8('0x6a')][_0xffc8('0x4a')];_0xf4310a+=0x1){_0xf4310a>0x0&&(_0x40758d+='\x20'+_0x53c709[_0xffc8('0x8e')]+'\x20');_0x40758d+=_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6b')]?_0x2f9ff5(_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6b')]):_0x53c709['rules'][_0xf4310a][_0xffc8('0x6c')]+'\x20'+_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6d')]+(_0x42bb1f(_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6d')])?'\x20'+_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6e')]:'');}return _0x40758d+')';};var _0x558772={'where':{'id':_0x41dcfa[_0xffc8('0x48')]['id']}},_0x26d27e,_0x1b75d2,_0xb2b022,_0x47aeee,_0x2f85ed;_0x558772=_['merge']({},_0x558772,_0x41dcfa[_0xffc8('0x41')]);return db['AnalyticCustomReport'][_0xffc8('0x51')](_0x558772)[_0xffc8('0x25')](function(_0x55a93d){if(_0x55a93d){_0x26d27e=_0x55a93d;return _0x55a93d[_0xffc8('0x6f')]();}return null;})['then'](function(_0x387c5e){if(_0x387c5e){if(!_0x387c5e[_0xffc8('0x4a')]){throw new db[(_0xffc8('0x70'))][(_0xffc8('0x71'))](_0xffc8('0x72'),0x193);}_0x1b75d2=_0x387c5e;return db[_0xffc8('0x73')][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x5d34be){if(_0x5d34be){_0xb2b022=_[_0xffc8('0x8f')](_0x5d34be,'id');var _0x366d66;var _0x5788f7=squel[_0xffc8('0x74')]();_0x5788f7[_0xffc8('0x75')](_0x26d27e[_0xffc8('0x76')]);for(var _0x1bcb55=0x0;_0x1bcb55<_0x1b75d2[_0xffc8('0x4a')];_0x1bcb55+=0x1){_0x366d66=_0x1b75d2[_0x1bcb55]['MetricId']?_0xb2b022[_0x1b75d2[_0x1bcb55][_0xffc8('0x90')]][_0xffc8('0x77')]:_0x1b75d2[_0x1bcb55][_0xffc8('0x6c')];_0x366d66=_0x1b75d2[_0x1bcb55]['function']?_[_0xffc8('0x78')](_0x1a854f[_0x1b75d2[_0x1bcb55][_0xffc8('0x79')]],'%s',_0x366d66):_0x366d66;_0x366d66=_0x1b75d2[_0x1bcb55][_0xffc8('0x7a')]?_[_0xffc8('0x78')](_0x367b8f[_0x1b75d2[_0x1bcb55][_0xffc8('0x7a')]],'%s',_0x366d66):_0x366d66;if(_0x1b75d2[_0x1bcb55][_0xffc8('0x7b')]){_0x5788f7[_0xffc8('0x6b')](_0x366d66);}_0x1b75d2[_0x1bcb55][_0xffc8('0x7c')]&&_0x5788f7[_0xffc8('0x3a')](_0x366d66,_0x1b75d2[_0x1bcb55][_0xffc8('0x7c')]===_0xffc8('0x7d')?![]:!![]);_0x5788f7[_0xffc8('0x6c')](_0x366d66,_0x1b75d2[_0x1bcb55][_0xffc8('0x7e')]||_0x366d66);}if(_0x26d27e[_0xffc8('0x7f')]){_0x26d27e[_0xffc8('0x7f')]=JSON[_0xffc8('0x85')](_0x26d27e['joins']);for(var _0x582ae5=0x0;_0x582ae5<_0x26d27e['joins'][_0xffc8('0x4a')];_0x582ae5+=0x1){if(_0x26d27e[_0xffc8('0x7f')][_0x582ae5]['type']&&_['includes'](_0x4002f5,_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x31')])&&_0x26d27e['joins'][_0x582ae5][_0xffc8('0x83')]&&_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x81')]&&_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x80')]){_0x5788f7[_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x31')]](_0x26d27e['joins'][_0x582ae5][_0xffc8('0x81')],null,util['format'](_0xffc8('0x82'),_0x26d27e['table'],_0x26d27e['joins'][_0x582ae5][_0xffc8('0x83')],_0x26d27e[_0xffc8('0x7f')][_0x582ae5]['foreignTable'],_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x80')]));}}}if(_0x26d27e[_0xffc8('0x84')]){_0x26d27e[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x26d27e[_0xffc8('0x84')]);_0x5788f7[_0xffc8('0x3c')](_0x2f9ff5(_0x26d27e[_0xffc8('0x84')][_0xffc8('0x6b')]));}_0x2f85ed=_0x5788f7[_0xffc8('0x91')]();_0x5788f7[_0xffc8('0x1f')](_0x11e6c3);_0x5788f7['offset'](0x0);logger[_0xffc8('0x86')](_0xffc8('0x87'),_0x5788f7[_0xffc8('0x88')]());return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x5788f7[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});}})[_0xffc8('0x25')](function(){return{'sql':_0x2f85ed[_0xffc8('0x88')]()};})[_0xffc8('0x25')](respondWithResult(_0x4e10c9,null))[_0xffc8('0x46')](handleError(_0x4e10c9,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 109ffc0..da317a1 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 _0xd038=['rimraf','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','path'];(function(_0x412993,_0x1c7d02){var _0x5ef802=function(_0x3e0a94){while(--_0x3e0a94){_0x412993['push'](_0x412993['shift']());}};_0x5ef802(++_0x1c7d02);}(_0xd038,0x1b4));var _0x8d03=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xd038[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0x8d03('0x0'));var util=require(_0x8d03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8d03('0x2'));var BPromise=require(_0x8d03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d03('0x4'));var rimraf=require(_0x8d03('0x5'));var config=require('../../config/environment');var attributes=require(_0x8d03('0x6'));module['exports']=function(_0x296fb7,_0xe898e5){return _0x296fb7['define'](_0x8d03('0x7'),attributes,{'tableName':_0x8d03('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0bc=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x27d633,_0x205c94){var _0x74ba36=function(_0x5517e0){while(--_0x5517e0){_0x27d633['push'](_0x27d633['shift']());}};_0x74ba36(++_0x205c94);}(_0xd0bc,0xc0));var _0xcd0b=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0xd0bc[_0x1e3c02];return _0x4d26d7;};'use strict';var _=require(_0xcd0b('0x0'));var util=require(_0xcd0b('0x1'));var logger=require(_0xcd0b('0x2'))(_0xcd0b('0x3'));var moment=require(_0xcd0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd0b('0x5'));var fs=require('fs');var path=require(_0xcd0b('0x6'));var rimraf=require(_0xcd0b('0x7'));var config=require(_0xcd0b('0x8'));var attributes=require(_0xcd0b('0x9'));module[_0xcd0b('0xa')]=function(_0x3a7230,_0xd46164){return _0x3a7230[_0xcd0b('0xb')](_0xcd0b('0xc'),attributes,{'tableName':'analytics_custom_reports','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 a0631cb..b292007 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 _0x2a8c=['error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x48c681,_0x371864){var _0x2d24c5=function(_0x4079a6){while(--_0x4079a6){_0x48c681['push'](_0x48c681['shift']());}};_0x2d24c5(++_0x371864);}(_0x2a8c,0x1bc));var _0xc2a8=function(_0x3c15c1,_0x4d73e2){_0x3c15c1=_0x3c15c1-0x0;var _0xff8565=_0x2a8c[_0x3c15c1];return _0xff8565;};'use strict';var _=require(_0xc2a8('0x0'));var util=require(_0xc2a8('0x1'));var moment=require(_0xc2a8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2a8('0x4'));var logger=require(_0xc2a8('0x5'))(_0xc2a8('0x6'));var config=require(_0xc2a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc2a8('0x8')][_0xc2a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e8bbe,_0x285418,_0x2fcb36){return new BPromise(function(_0x187aa1,_0x393405){return client[_0xc2a8('0xa')](_0x2e8bbe,_0x2fcb36)[_0xc2a8('0xb')](function(_0x39fd89){logger[_0xc2a8('0xc')](_0xc2a8('0xd'),_0x285418,_0xc2a8('0xe'));logger[_0xc2a8('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x285418,'request\x20sent',JSON[_0xc2a8('0x10')](_0x39fd89));if(_0x39fd89['error']){if(_0x39fd89['error'][_0xc2a8('0x11')]===0x1f4){logger[_0xc2a8('0x12')](_0xc2a8('0xd'),_0x285418,_0x39fd89['error'][_0xc2a8('0x13')]);return _0x393405(_0x39fd89[_0xc2a8('0x12')][_0xc2a8('0x13')]);}logger[_0xc2a8('0x12')](_0xc2a8('0xd'),_0x285418,_0x39fd89[_0xc2a8('0x12')][_0xc2a8('0x13')]);return _0x187aa1(_0x39fd89[_0xc2a8('0x12')][_0xc2a8('0x13')]);}else{logger[_0xc2a8('0xc')](_0xc2a8('0xd'),_0x285418,_0xc2a8('0xe'));_0x187aa1(_0x39fd89[_0xc2a8('0x14')][_0xc2a8('0x13')]);}})[_0xc2a8('0x15')](function(_0x330461){logger[_0xc2a8('0x12')](_0xc2a8('0xd'),_0x285418,_0x330461);_0x393405(_0x330461);});});} \ No newline at end of file +var _0x7146=['AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x119940,_0x265a3f){var _0x59af49=function(_0x580199){while(--_0x580199){_0x119940['push'](_0x119940['shift']());}};_0x59af49(++_0x265a3f);}(_0x7146,0x1cf));var _0x6714=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x7146[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0x6714('0x0'));var util=require(_0x6714('0x1'));var moment=require(_0x6714('0x2'));var BPromise=require('bluebird');var rs=require(_0x6714('0x3'));var fs=require('fs');var Redis=require(_0x6714('0x4'));var db=require(_0x6714('0x5'))['db'];var utils=require(_0x6714('0x6'));var logger=require(_0x6714('0x7'))(_0x6714('0x8'));var config=require(_0x6714('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6714('0xa')][_0x6714('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x556c1f,_0x4353b8,_0x5db85d){return new BPromise(function(_0x20cbde,_0x18a422){return client[_0x6714('0xc')](_0x556c1f,_0x5db85d)[_0x6714('0xd')](function(_0x300ce7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x6714('0xe'));logger['debug'](_0x6714('0xf'),_0x4353b8,_0x6714('0xe'),JSON[_0x6714('0x10')](_0x300ce7));if(_0x300ce7[_0x6714('0x11')]){if(_0x300ce7[_0x6714('0x11')][_0x6714('0x12')]===0x1f4){logger[_0x6714('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x300ce7[_0x6714('0x11')][_0x6714('0x13')]);return _0x18a422(_0x300ce7[_0x6714('0x11')][_0x6714('0x13')]);}logger[_0x6714('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x300ce7[_0x6714('0x11')]['message']);return _0x20cbde(_0x300ce7[_0x6714('0x11')]['message']);}else{logger['info'](_0x6714('0x14'),_0x4353b8,_0x6714('0xe'));_0x20cbde(_0x300ce7[_0x6714('0x15')][_0x6714('0x13')]);}})[_0x6714('0x16')](function(_0x1fb4b2){logger[_0x6714('0x11')](_0x6714('0x14'),_0x4353b8,_0x1fb4b2);_0x18a422(_0x1fb4b2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 5be35e8..301127f 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 _0xf58a=['get','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xf58a,0x1e8));var _0xaf58=function(_0x22a33a,_0x4a7487){_0x22a33a=_0x22a33a-0x0;var _0x2d0a92=_0xf58a[_0x22a33a];return _0x2d0a92;};'use strict';var multer=require(_0xaf58('0x0'));var util=require(_0xaf58('0x1'));var path=require(_0xaf58('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf58('0x3'));var router=express[_0xaf58('0x4')]();var fs_extra=require(_0xaf58('0x5'));var auth=require(_0xaf58('0x6'));var interaction=require(_0xaf58('0x7'));var config=require(_0xaf58('0x8'));var controller=require(_0xaf58('0x9'));router['get']('/',auth[_0xaf58('0xa')](),controller[_0xaf58('0xb')]);router[_0xaf58('0xc')](_0xaf58('0xd'),auth['isAuthenticated'](),controller[_0xaf58('0xe')]);router['get'](_0xaf58('0xf'),auth[_0xaf58('0xa')](),controller['preview']);router['get'](_0xaf58('0x10'),auth['isAuthenticated'](),controller[_0xaf58('0x11')]);router[_0xaf58('0xc')](_0xaf58('0x12'),auth[_0xaf58('0xa')](),controller['query']);router[_0xaf58('0x13')]('/',auth['isAuthenticated'](),controller[_0xaf58('0x14')]);router[_0xaf58('0x15')](_0xaf58('0xd'),auth[_0xaf58('0xa')](),controller['update']);router[_0xaf58('0x16')](_0xaf58('0xd'),auth[_0xaf58('0xa')](),controller[_0xaf58('0x17')]);module[_0xaf58('0x18')]=router; \ No newline at end of file +var _0xcdbe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','query','post','create','put','destroy','exports','util','path'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0xcdbe,0x6c));var _0xecdb=function(_0x10ab62,_0x21d1da){_0x10ab62=_0x10ab62-0x0;var _0x3b325b=_0xcdbe[_0x10ab62];return _0x3b325b;};'use strict';var multer=require('multer');var util=require(_0xecdb('0x0'));var path=require(_0xecdb('0x1'));var timeout=require(_0xecdb('0x2'));var express=require(_0xecdb('0x3'));var router=express[_0xecdb('0x4')]();var fs_extra=require(_0xecdb('0x5'));var auth=require(_0xecdb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xecdb('0x7'));var controller=require(_0xecdb('0x8'));router[_0xecdb('0x9')]('/',auth['isAuthenticated'](),controller[_0xecdb('0xa')]);router[_0xecdb('0x9')](_0xecdb('0xb'),auth[_0xecdb('0xc')](),controller[_0xecdb('0xd')]);router[_0xecdb('0x9')]('/:id/preview',auth[_0xecdb('0xc')](),controller[_0xecdb('0xe')]);router['get'](_0xecdb('0xf'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0xecdb('0xc')](),controller[_0xecdb('0x10')]);router[_0xecdb('0x11')]('/',auth['isAuthenticated'](),controller[_0xecdb('0x12')]);router[_0xecdb('0x13')](_0xecdb('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xecdb('0xb'),auth['isAuthenticated'](),controller[_0xecdb('0x14')]);module[_0xecdb('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a201b97..6e4579c 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0xdc97,0x13b));var _0x7dc9=function(_0x13d82c,_0xa3ad0a){_0x13d82c=_0x13d82c-0x0;var _0x27a58f=_0xdc97[_0x13d82c];return _0x27a58f;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0x5d58=['TEXT','STRING'];(function(_0x3f8862,_0x1ece6e){var _0x305066=function(_0x591f95){while(--_0x591f95){_0x3f8862['push'](_0x3f8862['shift']());}};_0x305066(++_0x1ece6e);}(_0x5d58,0x187));var _0x85d5=function(_0x575878,_0x5604c6){_0x575878=_0x575878-0x0;var _0x1ebebe=_0x5d58[_0x575878];return _0x1ebebe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 9827443..6ba4600 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6d38[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file +var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','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','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x1fee2f,_0x31ae6c){var _0x53c34d=function(_0xa5a72d){while(--_0xa5a72d){_0x1fee2f['push'](_0x1fee2f['shift']());}};_0x53c34d(++_0x31ae6c);}(_0x53ec,0x192));var _0xc53e=function(_0x444716,_0x1fd1ef){_0x444716=_0x444716-0x0;var _0x9e6df5=_0x53ec[_0x444716];return _0x9e6df5;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 1eb5aa1..7d89a91 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 _0x848a=['moment','path','./analyticDefaultReport.attributes','define','lodash','util'];(function(_0x2484ed,_0x9886bb){var _0x464e91=function(_0xc0ff52){while(--_0xc0ff52){_0x2484ed['push'](_0x2484ed['shift']());}};_0x464e91(++_0x9886bb);}(_0x848a,0x70));var _0xa848=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x848a[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0xa848('0x0'));var util=require(_0xa848('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa848('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa848('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa848('0x4'));module['exports']=function(_0x4f25ad,_0x39aa7f){return _0x4f25ad[_0xa848('0x5')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf76=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf76,0x166));var _0x6cf7=function(_0x27755b,_0x370ff3){_0x27755b=_0x27755b-0x0;var _0x13eaec=_0xcf76[_0x27755b];return _0x13eaec;};'use strict';var _=require(_0x6cf7('0x0'));var util=require(_0x6cf7('0x1'));var logger=require(_0x6cf7('0x2'))(_0x6cf7('0x3'));var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var rp=require(_0x6cf7('0x6'));var fs=require('fs');var path=require(_0x6cf7('0x7'));var rimraf=require(_0x6cf7('0x8'));var config=require(_0x6cf7('0x9'));var attributes=require(_0x6cf7('0xa'));module[_0x6cf7('0xb')]=function(_0x4527d4,_0x2b736b){return _0x4527d4['define'](_0x6cf7('0xc'),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 829a979..3b6fef8 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 _0xe95f=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','ioredis'];(function(_0x51d2b7,_0x26de9e){var _0x5a364f=function(_0x3103e3){while(--_0x3103e3){_0x51d2b7['push'](_0x51d2b7['shift']());}};_0x5a364f(++_0x26de9e);}(_0xe95f,0x1b5));var _0xfe95=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe95f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe95('0x0'));var util=require(_0xfe95('0x1'));var moment=require(_0xfe95('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe95('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe95('0x4'));var logger=require(_0xfe95('0x5'))(_0xfe95('0x6'));var config=require('../../config/environment');var jayson=require(_0xfe95('0x7'));var client=jayson[_0xfe95('0x8')][_0xfe95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc7cd03,_0x57adc0,_0x32e2db){return new BPromise(function(_0x203dfd,_0x276f8f){return client[_0xfe95('0xa')](_0xc7cd03,_0x32e2db)[_0xfe95('0xb')](function(_0x432589){logger[_0xfe95('0xc')](_0xfe95('0xd'),_0x57adc0,_0xfe95('0xe'));logger[_0xfe95('0xf')](_0xfe95('0x10'),_0x57adc0,'request\x20sent',JSON[_0xfe95('0x11')](_0x432589));if(_0x432589[_0xfe95('0x12')]){if(_0x432589[_0xfe95('0x12')]['code']===0x1f4){logger['error'](_0xfe95('0xd'),_0x57adc0,_0x432589[_0xfe95('0x12')][_0xfe95('0x13')]);return _0x276f8f(_0x432589[_0xfe95('0x12')][_0xfe95('0x13')]);}logger[_0xfe95('0x12')](_0xfe95('0xd'),_0x57adc0,_0x432589[_0xfe95('0x12')][_0xfe95('0x13')]);return _0x203dfd(_0x432589[_0xfe95('0x12')][_0xfe95('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x57adc0,_0xfe95('0xe'));_0x203dfd(_0x432589[_0xfe95('0x14')][_0xfe95('0x13')]);}})['catch'](function(_0x218f8c){logger[_0xfe95('0x12')](_0xfe95('0xd'),_0x57adc0,_0x218f8c);_0x276f8f(_0x218f8c);});});} \ No newline at end of file +var _0x7e3e=['util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x14ddac,_0x36b509){var _0x31aadf=function(_0x11ccb1){while(--_0x11ccb1){_0x14ddac['push'](_0x14ddac['shift']());}};_0x31aadf(++_0x36b509);}(_0x7e3e,0x155));var _0xe7e3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7e3e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xe7e3('0x0'));var util=require(_0xe7e3('0x1'));var moment=require('moment');var BPromise=require(_0xe7e3('0x2'));var rs=require(_0xe7e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7e3('0x5'))(_0xe7e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1951,_0x1ee297,_0x192742){return new BPromise(function(_0xbb854b,_0x20e82b){return client['request'](_0x4c1951,_0x192742)[_0xe7e3('0x8')](function(_0x317bea){logger[_0xe7e3('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ee297,_0xe7e3('0xa'));logger[_0xe7e3('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1ee297,_0xe7e3('0xa'),JSON[_0xe7e3('0xc')](_0x317bea));if(_0x317bea[_0xe7e3('0xd')]){if(_0x317bea[_0xe7e3('0xd')]['code']===0x1f4){logger[_0xe7e3('0xd')](_0xe7e3('0xe'),_0x1ee297,_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);return _0x20e82b(_0x317bea['error']['message']);}logger['error'](_0xe7e3('0xe'),_0x1ee297,_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);return _0xbb854b(_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);}else{logger['info'](_0xe7e3('0xe'),_0x1ee297,'request\x20sent');_0xbb854b(_0x317bea[_0xe7e3('0x10')]['message']);}})[_0xe7e3('0x11')](function(_0x1dc800){logger[_0xe7e3('0xd')](_0xe7e3('0xe'),_0x1ee297,_0x1dc800);_0x20e82b(_0x1dc800);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 412456e..8c65394 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 _0x2b4d=['/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0x2b4d,0xfa));var _0xd2b4=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x2b4d[_0x26fc81];return _0x9feece;};'use strict';var multer=require(_0xd2b4('0x0'));var util=require(_0xd2b4('0x1'));var path=require(_0xd2b4('0x2'));var timeout=require(_0xd2b4('0x3'));var express=require('express');var router=express[_0xd2b4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2b4('0x5'));var config=require(_0xd2b4('0x6'));var controller=require(_0xd2b4('0x7'));router[_0xd2b4('0x8')]('/',auth[_0xd2b4('0x9')](),controller['index']);router[_0xd2b4('0x8')](_0xd2b4('0xa'),auth[_0xd2b4('0x9')](),controller[_0xd2b4('0xb')]);router[_0xd2b4('0x8')](_0xd2b4('0xc'),auth[_0xd2b4('0x9')](),controller[_0xd2b4('0xd')]);router[_0xd2b4('0x8')](_0xd2b4('0xe'),auth[_0xd2b4('0x9')](),controller[_0xd2b4('0xf')]);router[_0xd2b4('0x8')](_0xd2b4('0x10'),auth[_0xd2b4('0x9')](),controller[_0xd2b4('0x11')]);router['post']('/',auth[_0xd2b4('0x9')](),controller[_0xd2b4('0x12')]);router[_0xd2b4('0x13')]('/:id',auth[_0xd2b4('0x9')](),controller[_0xd2b4('0x14')]);router[_0xd2b4('0x15')](_0xd2b4('0xa'),auth[_0xd2b4('0x9')](),controller[_0xd2b4('0x16')]);module[_0xd2b4('0x17')]=router; \ No newline at end of file +var _0x256a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/query','query','post','create','delete','exports','util','path'];(function(_0x59af5c,_0x317398){var _0x1afb48=function(_0x5d5bb3){while(--_0x5d5bb3){_0x59af5c['push'](_0x59af5c['shift']());}};_0x1afb48(++_0x317398);}(_0x256a,0x83));var _0xa256=function(_0x265cd2,_0x5281a3){_0x265cd2=_0x265cd2-0x0;var _0x1ba5ec=_0x256a[_0x265cd2];return _0x1ba5ec;};'use strict';var multer=require('multer');var util=require(_0xa256('0x0'));var path=require(_0xa256('0x1'));var timeout=require(_0xa256('0x2'));var express=require('express');var router=express[_0xa256('0x3')]();var fs_extra=require(_0xa256('0x4'));var auth=require(_0xa256('0x5'));var interaction=require(_0xa256('0x6'));var config=require('../../config/environment');var controller=require(_0xa256('0x7'));router[_0xa256('0x8')]('/',auth[_0xa256('0x9')](),controller[_0xa256('0xa')]);router[_0xa256('0x8')](_0xa256('0xb'),auth[_0xa256('0x9')](),controller[_0xa256('0xc')]);router[_0xa256('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get']('/:id/run',auth[_0xa256('0x9')](),controller['run']);router['get'](_0xa256('0xd'),auth[_0xa256('0x9')](),controller[_0xa256('0xe')]);router[_0xa256('0xf')]('/',auth[_0xa256('0x9')](),controller[_0xa256('0x10')]);router['put'](_0xa256('0xb'),auth[_0xa256('0x9')](),controller['update']);router[_0xa256('0x11')](_0xa256('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa256('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 9f8bd37..c4cbe8f 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 _0xc19f=['csv','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xc19f,0xaf));var _0xfc19=function(_0x24cd81,_0x301d1f){_0x24cd81=_0x24cd81-0x0;var _0x44d561=_0xc19f[_0x24cd81];return _0x44d561;};'use strict';var Sequelize=require(_0xfc19('0x0'));var moment=require(_0xfc19('0x1'));module[_0xfc19('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xfc19('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xfc19('0x4')](_0xfc19('0x5'),'pdf',_0xfc19('0x6')),'allowNull':![],'defaultValue':_0xfc19('0x5')},'savename':{'type':Sequelize[_0xfc19('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfc19('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xfc19('0x3')],'defaultValue':_0xfc19('0x8')},'type':{'type':Sequelize['ENUM'](_0xfc19('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xfc19('0x9')},'reportId':{'type':Sequelize[_0xfc19('0xa')](0xb)[_0xfc19('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6484=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0xbb5c55,_0xad78ba){var _0x4121b8=function(_0x2b38dc){while(--_0x2b38dc){_0xbb5c55['push'](_0xbb5c55['shift']());}};_0x4121b8(++_0xad78ba);}(_0x6484,0x1d2));var _0x4648=function(_0x29802d,_0xbd2062){_0x29802d=_0x29802d-0x0;var _0x3590f=_0x6484[_0x29802d];return _0x3590f;};'use strict';var Sequelize=require(_0x4648('0x0'));var moment=require(_0x4648('0x1'));module[_0x4648('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4648('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4648('0x4')](_0x4648('0x5'),_0x4648('0x6'),_0x4648('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x4648('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4648('0x8')]},'status':{'type':Sequelize[_0x4648('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4648('0x4')](_0x4648('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4648('0xa')](0xb)[_0x4648('0xb')]},'reportType':{'type':Sequelize[_0x4648('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 6ae3afa..add4569 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 _0x7d90=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','ExtractedReports','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','AnalyticExtractedReport','findAll','rows','catch','show','keys','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','params','basename','savename','output','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7d90,0x1d1));var _0x07d9=function(_0x478be,_0x4fa7fe){_0x478be=_0x478be-0x0;var _0x54adca=_0x7d90[_0x478be];return _0x54adca;};'use strict';var emlformat=require(_0x07d9('0x0'));var rimraf=require(_0x07d9('0x1'));var zipdir=require(_0x07d9('0x2'));var jsonpatch=require(_0x07d9('0x3'));var rp=require(_0x07d9('0x4'));var moment=require(_0x07d9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x07d9('0x6'));var util=require('util');var path=require(_0x07d9('0x7'));var sox=require(_0x07d9('0x8'));var csv=require('to-csv');var ejs=require(_0x07d9('0x9'));var fs=require('fs');var fs_extra=require(_0x07d9('0xa'));var _=require(_0x07d9('0xb'));var squel=require(_0x07d9('0xc'));var crypto=require('crypto');var jsforce=require(_0x07d9('0xd'));var deskjs=require(_0x07d9('0xe'));var toCsv=require(_0x07d9('0xf'));var querystring=require(_0x07d9('0x10'));var Papa=require(_0x07d9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x07d9('0x12'));var as=require(_0x07d9('0x13'));var hardwareService=require(_0x07d9('0x14'));var logger=require('../../config/logger')(_0x07d9('0x15'));var utils=require(_0x07d9('0x16'));var config=require(_0x07d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x07d9('0x18'))['db'];function respondWithStatusCode(_0x16cacf,_0x253d83){_0x253d83=_0x253d83||0xcc;return function(_0x178c6c){if(_0x178c6c){return _0x16cacf[_0x07d9('0x19')](_0x253d83);}return _0x16cacf[_0x07d9('0x1a')](_0x253d83)[_0x07d9('0x1b')]();};}function respondWithResult(_0x1c92eb,_0x15131a){_0x15131a=_0x15131a||0xc8;return function(_0x3279d3){if(_0x3279d3){return _0x1c92eb[_0x07d9('0x1a')](_0x15131a)['json'](_0x3279d3);}};}function respondWithFilteredResult(_0x335ed8,_0x188444){return function(_0xca8819){if(_0xca8819){var _0x3452eb=typeof _0x188444[_0x07d9('0x1c')]===_0x07d9('0x1d')&&typeof _0x188444[_0x07d9('0x1e')]===_0x07d9('0x1d');var _0x176b55=_0xca8819['count'];var _0x2d59a7=_0x3452eb?0x0:_0x188444[_0x07d9('0x1c')];var _0x36c01b=_0x3452eb?_0xca8819[_0x07d9('0x1f')]:_0x188444[_0x07d9('0x1c')]+_0x188444[_0x07d9('0x1e')];var _0x2ac9f3;if(_0x36c01b>=_0x176b55){_0x36c01b=_0x176b55;_0x2ac9f3=0xc8;}else{_0x2ac9f3=0xce;}_0x335ed8['status'](_0x2ac9f3);return _0x335ed8[_0x07d9('0x20')](_0x07d9('0x21'),_0x2d59a7+'-'+_0x36c01b+'/'+_0x176b55)[_0x07d9('0x22')](_0xca8819);}return null;};}function patchUpdates(_0x59321b){return function(_0x18f4be){try{jsonpatch[_0x07d9('0x23')](_0x18f4be,_0x59321b,!![]);}catch(_0x1cd9de){return BPromise[_0x07d9('0x24')](_0x1cd9de);}return _0x18f4be['save']();};}function saveUpdates(_0x192916,_0xd1874a){return function(_0x299bc4){if(_0x299bc4){return _0x299bc4[_0x07d9('0x25')](_0x192916)[_0x07d9('0x26')](function(_0x45f8db){return _0x45f8db;});}return null;};}function removeEntity(_0x4eb489,_0x1f81ad){return function(_0x4bbd40){if(_0x4bbd40){return _0x4bbd40['destroy']()['then'](function(){var _0xe69eda=_0x4bbd40[_0x07d9('0x27')]({'plain':!![]});var _0x434ea8=_0x07d9('0x28');return db['UserProfileResource'][_0x07d9('0x29')]({'where':{'type':_0x434ea8,'resourceId':_0xe69eda['id']}})[_0x07d9('0x26')](function(){return _0x4bbd40;});})[_0x07d9('0x26')](function(){_0x4eb489['status'](0xcc)[_0x07d9('0x1b')]();});}};}function handleEntityNotFound(_0x1643f5,_0x37d11d){return function(_0x4232b2){if(!_0x4232b2){_0x1643f5[_0x07d9('0x19')](0x194);}return _0x4232b2;};}function handleError(_0x124783,_0x473922){_0x473922=_0x473922||0x1f4;return function(_0x3974a6){logger[_0x07d9('0x2a')](_0x3974a6[_0x07d9('0x2b')]);if(_0x3974a6[_0x07d9('0x2c')]){delete _0x3974a6[_0x07d9('0x2c')];}_0x124783[_0x07d9('0x1a')](_0x473922)[_0x07d9('0x2d')](_0x3974a6);};}exports[_0x07d9('0x2e')]=function(_0x36e688,_0x50e362){var _0x500834={},_0xc23f55={},_0x119e97={'count':0x0,'rows':[]};var _0x19cb24=_[_0x07d9('0x2f')](db['AnalyticExtractedReport'][_0x07d9('0x30')],function(_0x228fd9){return{'name':_0x228fd9['fieldName'],'type':_0x228fd9[_0x07d9('0x31')][_0x07d9('0x32')]};});_0xc23f55['model']=_['map'](_0x19cb24,'name');_0xc23f55[_0x07d9('0x33')]=_['keys'](_0x36e688[_0x07d9('0x33')]);_0xc23f55[_0x07d9('0x34')]=_[_0x07d9('0x35')](_0xc23f55[_0x07d9('0x36')],_0xc23f55['query']);_0x500834[_0x07d9('0x37')]=_[_0x07d9('0x35')](_0xc23f55[_0x07d9('0x36')],qs[_0x07d9('0x38')](_0x36e688['query'][_0x07d9('0x38')]));_0x500834[_0x07d9('0x37')]=_0x500834[_0x07d9('0x37')][_0x07d9('0x39')]?_0x500834[_0x07d9('0x37')]:_0xc23f55[_0x07d9('0x36')];if(!_0x36e688['query']['hasOwnProperty'](_0x07d9('0x3a'))){_0x500834['limit']=qs[_0x07d9('0x1e')](_0x36e688['query']['limit']);_0x500834[_0x07d9('0x1c')]=qs[_0x07d9('0x1c')](_0x36e688['query']['offset']);}_0x500834[_0x07d9('0x3b')]=qs[_0x07d9('0x3c')](_0x36e688[_0x07d9('0x33')][_0x07d9('0x3c')]);_0x500834[_0x07d9('0x3d')]=qs[_0x07d9('0x34')](_['pick'](_0x36e688[_0x07d9('0x33')],_0xc23f55[_0x07d9('0x34')]),_0x19cb24);if(_0x36e688[_0x07d9('0x33')][_0x07d9('0x3e')]){_0x500834[_0x07d9('0x3d')]=_[_0x07d9('0x3f')](_0x500834[_0x07d9('0x3d')],{'$or':_['map'](_0x19cb24,function(_0xe40085){if(_0xe40085['type']!==_0x07d9('0x40')){var _0x8616dc={};_0x8616dc[_0xe40085['name']]={'$like':'%'+_0x36e688[_0x07d9('0x33')][_0x07d9('0x3e')]+'%'};return _0x8616dc;}})});}_0x500834=_[_0x07d9('0x3f')]({},_0x500834,_0x36e688['options']);var _0x549d16={'where':_0x500834['where']};return db['AnalyticExtractedReport'][_0x07d9('0x1f')](_0x549d16)[_0x07d9('0x26')](function(_0x2becaf){_0x119e97[_0x07d9('0x1f')]=_0x2becaf;if(_0x36e688[_0x07d9('0x33')][_0x07d9('0x41')]){_0x500834['include']=[{'all':!![]}];}return db[_0x07d9('0x42')][_0x07d9('0x43')](_0x500834);})[_0x07d9('0x26')](function(_0x949082){_0x119e97[_0x07d9('0x44')]=_0x949082;return _0x119e97;})['then'](respondWithFilteredResult(_0x50e362,_0x500834))[_0x07d9('0x45')](handleError(_0x50e362,null));};exports[_0x07d9('0x46')]=function(_0x3e45a8,_0x557e75){var _0x20374b={'raw':!![],'where':{'id':_0x3e45a8['params']['id']}},_0x302e6f={};_0x302e6f[_0x07d9('0x36')]=_[_0x07d9('0x47')](db[_0x07d9('0x42')]['rawAttributes']);_0x302e6f['query']=_[_0x07d9('0x47')](_0x3e45a8[_0x07d9('0x33')]);_0x302e6f[_0x07d9('0x34')]=_[_0x07d9('0x35')](_0x302e6f['model'],_0x302e6f[_0x07d9('0x33')]);_0x20374b[_0x07d9('0x37')]=_[_0x07d9('0x35')](_0x302e6f['model'],qs['fields'](_0x3e45a8[_0x07d9('0x33')][_0x07d9('0x38')]));_0x20374b[_0x07d9('0x37')]=_0x20374b[_0x07d9('0x37')][_0x07d9('0x39')]?_0x20374b[_0x07d9('0x37')]:_0x302e6f['model'];if(_0x3e45a8['query'][_0x07d9('0x41')]){_0x20374b[_0x07d9('0x48')]=[{'all':!![]}];}_0x20374b=_[_0x07d9('0x3f')]({},_0x20374b,_0x3e45a8[_0x07d9('0x49')]);return db[_0x07d9('0x42')]['find'](_0x20374b)[_0x07d9('0x26')](handleEntityNotFound(_0x557e75,null))[_0x07d9('0x26')](respondWithResult(_0x557e75,null))[_0x07d9('0x45')](handleError(_0x557e75,null));};exports[_0x07d9('0x4a')]=function(_0x5875a2,_0x183ee2){return db['AnalyticExtractedReport'][_0x07d9('0x4a')](_0x5875a2[_0x07d9('0x4b')],{})[_0x07d9('0x26')](function(_0x3e8b0e){var _0x3e38bc=_0x5875a2['user'][_0x07d9('0x27')]({'plain':!![]});if(!_0x3e38bc)throw new Error(_0x07d9('0x4c'));if(_0x3e38bc[_0x07d9('0x4d')]===_0x07d9('0x4e')){var _0x253f29=_0x3e8b0e[_0x07d9('0x27')]({'plain':!![]});var _0x1d1161=_0x07d9('0x28');return db[_0x07d9('0x4f')]['find']({'where':{'name':_0x1d1161,'userProfileId':_0x3e38bc['userProfileId']},'raw':!![]})['then'](function(_0x49154a){if(_0x49154a&&_0x49154a[_0x07d9('0x50')]===0x0){return db[_0x07d9('0x51')][_0x07d9('0x4a')]({'name':_0x253f29[_0x07d9('0x2c')],'resourceId':_0x253f29['id'],'type':_0x49154a[_0x07d9('0x2c')],'sectionId':_0x49154a['id']},{})[_0x07d9('0x26')](function(){return _0x3e8b0e;});}else{return _0x3e8b0e;}})['catch'](function(_0x5e7b5e){logger[_0x07d9('0x2a')](_0x07d9('0x52'),_0x5e7b5e);throw _0x5e7b5e;});}return _0x3e8b0e;})[_0x07d9('0x26')](respondWithResult(_0x183ee2,0xc9))[_0x07d9('0x45')](handleError(_0x183ee2,null));};exports[_0x07d9('0x25')]=function(_0x233550,_0x1803a9){if(_0x233550['body']['id']){delete _0x233550['body']['id'];}return db[_0x07d9('0x42')][_0x07d9('0x53')]({'where':{'id':_0x233550['params']['id']}})[_0x07d9('0x26')](handleEntityNotFound(_0x1803a9,null))[_0x07d9('0x26')](saveUpdates(_0x233550[_0x07d9('0x4b')],null))[_0x07d9('0x26')](respondWithResult(_0x1803a9,null))[_0x07d9('0x45')](handleError(_0x1803a9,null));};exports[_0x07d9('0x29')]=function(_0x18c58f,_0x6e26c4){return db['AnalyticExtractedReport'][_0x07d9('0x53')]({'where':{'id':_0x18c58f['params']['id']}})['then'](handleEntityNotFound(_0x6e26c4,null))[_0x07d9('0x26')](removeEntity(_0x6e26c4,null))[_0x07d9('0x45')](handleError(_0x6e26c4,null));};exports[_0x07d9('0x54')]=function(_0x3046da,_0x30abee,_0xda4014){return db[_0x07d9('0x42')]['find']({'where':{'id':_0x3046da[_0x07d9('0x55')]['id']},'attributes':['name',_0x07d9('0x56'),_0x07d9('0x57'),_0x07d9('0x58')],'raw':!![]})[_0x07d9('0x26')](handleEntityNotFound(_0x30abee,null))['then'](function(_0x45a202){if(_0x45a202){if(!fs['existsSync'](path[_0x07d9('0x59')](config['root'],'server/files/reports',_0x45a202[_0x07d9('0x57')]))){throw new db['Sequelize'][(_0x07d9('0x5a'))](_0x07d9('0x5b'));}if(_0x3046da[_0x07d9('0x33')][_0x07d9('0x5c')]){return _0x30abee[_0x07d9('0x19')](0xc8);}return _0x30abee[_0x07d9('0x54')](path['join'](config[_0x07d9('0x5d')],'server/files/reports',_0x45a202[_0x07d9('0x57')]),util[_0x07d9('0x5e')](_0x07d9('0x5f'),_0x45a202[_0x07d9('0x56')]||_0x45a202['name'],_0x45a202[_0x07d9('0x58')][_0x07d9('0x60')]()));}})['catch'](handleError(_0x30abee,null));}; \ No newline at end of file +var _0x2280=['exists','join','server/files/reports','format','basename','output','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','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','download','savename','existsSync','root','Sequelize','ValidationError'];(function(_0x573289,_0x191a2d){var _0x35184b=function(_0x2e4440){while(--_0x2e4440){_0x573289['push'](_0x573289['shift']());}};_0x35184b(++_0x191a2d);}(_0x2280,0xc2));var _0x0228=function(_0x2f1090,_0x1bada4){_0x2f1090=_0x2f1090-0x0;var _0x1da182=_0x2280[_0x2f1090];return _0x1da182;};'use strict';var emlformat=require(_0x0228('0x0'));var rimraf=require(_0x0228('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0228('0x2'));var rp=require(_0x0228('0x3'));var moment=require('moment');var BPromise=require(_0x0228('0x4'));var Mustache=require(_0x0228('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0228('0x6'));var csv=require(_0x0228('0x7'));var ejs=require(_0x0228('0x8'));var fs=require('fs');var fs_extra=require(_0x0228('0x9'));var _=require(_0x0228('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0228('0xb'));var deskjs=require(_0x0228('0xc'));var toCsv=require(_0x0228('0x7'));var querystring=require(_0x0228('0xd'));var Papa=require(_0x0228('0xe'));var Redis=require(_0x0228('0xf'));var authService=require(_0x0228('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0228('0x11'));var hardwareService=require(_0x0228('0x12'));var logger=require(_0x0228('0x13'))('api');var utils=require(_0x0228('0x14'));var config=require(_0x0228('0x15'));var licenseUtil=require(_0x0228('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ba95d,_0x106f16){_0x106f16=_0x106f16||0xcc;return function(_0x548a41){if(_0x548a41){return _0x3ba95d[_0x0228('0x17')](_0x106f16);}return _0x3ba95d[_0x0228('0x18')](_0x106f16)['end']();};}function respondWithResult(_0x2b28e3,_0x51bba5){_0x51bba5=_0x51bba5||0xc8;return function(_0x2bcd0d){if(_0x2bcd0d){return _0x2b28e3[_0x0228('0x18')](_0x51bba5)[_0x0228('0x19')](_0x2bcd0d);}};}function respondWithFilteredResult(_0x553d7c,_0x492790){return function(_0x4f6709){if(_0x4f6709){var _0x216944=typeof _0x492790[_0x0228('0x1a')]===_0x0228('0x1b')&&typeof _0x492790[_0x0228('0x1c')]===_0x0228('0x1b');var _0x3fb58f=_0x4f6709[_0x0228('0x1d')];var _0x5b3baf=_0x216944?0x0:_0x492790[_0x0228('0x1a')];var _0x2625ef=_0x216944?_0x4f6709[_0x0228('0x1d')]:_0x492790['offset']+_0x492790[_0x0228('0x1c')];var _0x133e64;if(_0x2625ef>=_0x3fb58f){_0x2625ef=_0x3fb58f;_0x133e64=0xc8;}else{_0x133e64=0xce;}_0x553d7c['status'](_0x133e64);return _0x553d7c[_0x0228('0x1e')]('Content-Range',_0x5b3baf+'-'+_0x2625ef+'/'+_0x3fb58f)[_0x0228('0x19')](_0x4f6709);}return null;};}function patchUpdates(_0x27b00e){return function(_0x2f83bf){try{jsonpatch[_0x0228('0x1f')](_0x2f83bf,_0x27b00e,!![]);}catch(_0x1e8a85){return BPromise['reject'](_0x1e8a85);}return _0x2f83bf[_0x0228('0x20')]();};}function saveUpdates(_0x26391d,_0x4afce1){return function(_0x4555b4){if(_0x4555b4){return _0x4555b4[_0x0228('0x21')](_0x26391d)[_0x0228('0x22')](function(_0x5e4129){return _0x5e4129;});}return null;};}function removeEntity(_0x5616bd,_0x176764){return function(_0x40cf0a){if(_0x40cf0a){return _0x40cf0a['destroy']()['then'](function(){var _0x24cb1b=_0x40cf0a[_0x0228('0x23')]({'plain':!![]});var _0x23b635=_0x0228('0x24');return db[_0x0228('0x25')][_0x0228('0x26')]({'where':{'type':_0x23b635,'resourceId':_0x24cb1b['id']}})['then'](function(){return _0x40cf0a;});})[_0x0228('0x22')](function(){_0x5616bd[_0x0228('0x18')](0xcc)[_0x0228('0x27')]();});}};}function handleEntityNotFound(_0x4f17a1,_0x23fa6c){return function(_0x5d38b6){if(!_0x5d38b6){_0x4f17a1['sendStatus'](0x194);}return _0x5d38b6;};}function handleError(_0xba4b73,_0xce3988){_0xce3988=_0xce3988||0x1f4;return function(_0x59cb1b){logger[_0x0228('0x28')](_0x59cb1b['stack']);if(_0x59cb1b[_0x0228('0x29')]){delete _0x59cb1b[_0x0228('0x29')];}_0xba4b73[_0x0228('0x18')](_0xce3988)[_0x0228('0x2a')](_0x59cb1b);};}exports[_0x0228('0x2b')]=function(_0xf09731,_0x3e32bf){var _0x10ce94={},_0x59fce={},_0x60b7c8={'count':0x0,'rows':[]};var _0x5966b2=_[_0x0228('0x2c')](db[_0x0228('0x2d')][_0x0228('0x2e')],function(_0x304511){return{'name':_0x304511[_0x0228('0x2f')],'type':_0x304511[_0x0228('0x30')][_0x0228('0x31')]};});_0x59fce['model']=_[_0x0228('0x2c')](_0x5966b2,_0x0228('0x29'));_0x59fce[_0x0228('0x32')]=_[_0x0228('0x33')](_0xf09731['query']);_0x59fce['filters']=_[_0x0228('0x34')](_0x59fce[_0x0228('0x35')],_0x59fce[_0x0228('0x32')]);_0x10ce94[_0x0228('0x36')]=_['intersection'](_0x59fce['model'],qs[_0x0228('0x37')](_0xf09731[_0x0228('0x32')]['fields']));_0x10ce94[_0x0228('0x36')]=_0x10ce94['attributes'][_0x0228('0x38')]?_0x10ce94['attributes']:_0x59fce['model'];if(!_0xf09731[_0x0228('0x32')]['hasOwnProperty'](_0x0228('0x39'))){_0x10ce94[_0x0228('0x1c')]=qs[_0x0228('0x1c')](_0xf09731['query'][_0x0228('0x1c')]);_0x10ce94[_0x0228('0x1a')]=qs[_0x0228('0x1a')](_0xf09731[_0x0228('0x32')][_0x0228('0x1a')]);}_0x10ce94['order']=qs[_0x0228('0x3a')](_0xf09731[_0x0228('0x32')][_0x0228('0x3a')]);_0x10ce94[_0x0228('0x3b')]=qs[_0x0228('0x3c')](_[_0x0228('0x3d')](_0xf09731[_0x0228('0x32')],_0x59fce['filters']),_0x5966b2);if(_0xf09731['query'][_0x0228('0x3e')]){_0x10ce94[_0x0228('0x3b')]=_[_0x0228('0x3f')](_0x10ce94['where'],{'$or':_[_0x0228('0x2c')](_0x5966b2,function(_0x557552){if(_0x557552['type']!==_0x0228('0x40')){var _0xddd4dc={};_0xddd4dc[_0x557552[_0x0228('0x29')]]={'$like':'%'+_0xf09731[_0x0228('0x32')][_0x0228('0x3e')]+'%'};return _0xddd4dc;}})});}_0x10ce94=_['merge']({},_0x10ce94,_0xf09731[_0x0228('0x41')]);var _0x5a0cd5={'where':_0x10ce94[_0x0228('0x3b')]};return db[_0x0228('0x2d')][_0x0228('0x1d')](_0x5a0cd5)[_0x0228('0x22')](function(_0x3fe9c1){_0x60b7c8[_0x0228('0x1d')]=_0x3fe9c1;if(_0xf09731[_0x0228('0x32')]['includeAll']){_0x10ce94['include']=[{'all':!![]}];}return db[_0x0228('0x2d')][_0x0228('0x42')](_0x10ce94);})[_0x0228('0x22')](function(_0x53c4e3){_0x60b7c8['rows']=_0x53c4e3;return _0x60b7c8;})[_0x0228('0x22')](respondWithFilteredResult(_0x3e32bf,_0x10ce94))[_0x0228('0x43')](handleError(_0x3e32bf,null));};exports[_0x0228('0x44')]=function(_0x15e630,_0x2848f9){var _0x5c90b3={'raw':!![],'where':{'id':_0x15e630[_0x0228('0x45')]['id']}},_0x3a0b3b={};_0x3a0b3b[_0x0228('0x35')]=_['keys'](db[_0x0228('0x2d')][_0x0228('0x2e')]);_0x3a0b3b[_0x0228('0x32')]=_[_0x0228('0x33')](_0x15e630[_0x0228('0x32')]);_0x3a0b3b[_0x0228('0x3c')]=_['intersection'](_0x3a0b3b['model'],_0x3a0b3b['query']);_0x5c90b3[_0x0228('0x36')]=_[_0x0228('0x34')](_0x3a0b3b['model'],qs[_0x0228('0x37')](_0x15e630['query'][_0x0228('0x37')]));_0x5c90b3[_0x0228('0x36')]=_0x5c90b3[_0x0228('0x36')][_0x0228('0x38')]?_0x5c90b3[_0x0228('0x36')]:_0x3a0b3b[_0x0228('0x35')];if(_0x15e630[_0x0228('0x32')][_0x0228('0x46')]){_0x5c90b3[_0x0228('0x47')]=[{'all':!![]}];}_0x5c90b3=_[_0x0228('0x3f')]({},_0x5c90b3,_0x15e630[_0x0228('0x41')]);return db[_0x0228('0x2d')][_0x0228('0x48')](_0x5c90b3)[_0x0228('0x22')](handleEntityNotFound(_0x2848f9,null))[_0x0228('0x22')](respondWithResult(_0x2848f9,null))[_0x0228('0x43')](handleError(_0x2848f9,null));};exports[_0x0228('0x49')]=function(_0x23d1ea,_0x29c7a5){return db[_0x0228('0x2d')][_0x0228('0x49')](_0x23d1ea[_0x0228('0x4a')],{})[_0x0228('0x22')](function(_0x2d58ee){var _0x2f2dd4=_0x23d1ea[_0x0228('0x4b')]['get']({'plain':!![]});if(!_0x2f2dd4)throw new Error(_0x0228('0x4c'));if(_0x2f2dd4[_0x0228('0x4d')]===_0x0228('0x4b')){var _0x58d5c8=_0x2d58ee['get']({'plain':!![]});var _0x1fbc4c=_0x0228('0x24');return db[_0x0228('0x4e')]['find']({'where':{'name':_0x1fbc4c,'userProfileId':_0x2f2dd4[_0x0228('0x4f')]},'raw':!![]})[_0x0228('0x22')](function(_0x25cc64){if(_0x25cc64&&_0x25cc64[_0x0228('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x58d5c8[_0x0228('0x29')],'resourceId':_0x58d5c8['id'],'type':_0x25cc64[_0x0228('0x29')],'sectionId':_0x25cc64['id']},{})[_0x0228('0x22')](function(){return _0x2d58ee;});}else{return _0x2d58ee;}})['catch'](function(_0xe5036d){logger[_0x0228('0x28')](_0x0228('0x51'),_0xe5036d);throw _0xe5036d;});}return _0x2d58ee;})[_0x0228('0x22')](respondWithResult(_0x29c7a5,0xc9))[_0x0228('0x43')](handleError(_0x29c7a5,null));};exports[_0x0228('0x21')]=function(_0x59b522,_0x53a497){if(_0x59b522[_0x0228('0x4a')]['id']){delete _0x59b522[_0x0228('0x4a')]['id'];}return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x59b522[_0x0228('0x45')]['id']}})['then'](handleEntityNotFound(_0x53a497,null))[_0x0228('0x22')](saveUpdates(_0x59b522['body'],null))[_0x0228('0x22')](respondWithResult(_0x53a497,null))[_0x0228('0x43')](handleError(_0x53a497,null));};exports[_0x0228('0x26')]=function(_0x5be7c5,_0x150ba1){return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x5be7c5[_0x0228('0x45')]['id']}})[_0x0228('0x22')](handleEntityNotFound(_0x150ba1,null))[_0x0228('0x22')](removeEntity(_0x150ba1,null))['catch'](handleError(_0x150ba1,null));};exports[_0x0228('0x52')]=function(_0x5a16d2,_0x481810,_0x3e8101){return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x5a16d2[_0x0228('0x45')]['id']},'attributes':[_0x0228('0x29'),'basename',_0x0228('0x53'),'output'],'raw':!![]})[_0x0228('0x22')](handleEntityNotFound(_0x481810,null))[_0x0228('0x22')](function(_0x1e7ab9){if(_0x1e7ab9){if(!fs[_0x0228('0x54')](path['join'](config[_0x0228('0x55')],'server/files/reports',_0x1e7ab9[_0x0228('0x53')]))){throw new db[(_0x0228('0x56'))][(_0x0228('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5a16d2[_0x0228('0x32')][_0x0228('0x58')]){return _0x481810[_0x0228('0x17')](0xc8);}return _0x481810['download'](path[_0x0228('0x59')](config[_0x0228('0x55')],_0x0228('0x5a'),_0x1e7ab9[_0x0228('0x53')]),util[_0x0228('0x5b')]('%s.%s',_0x1e7ab9[_0x0228('0x5c')]||_0x1e7ab9[_0x0228('0x29')],_0x1e7ab9[_0x0228('0x5d')]['toLowerCase']()));}})[_0x0228('0x43')](handleError(_0x481810,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b049f47..560045b 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 _0xde60=['analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x74c6c6,_0x54d54e){var _0x56ba8b=function(_0x2c885f){while(--_0x2c885f){_0x74c6c6['push'](_0x74c6c6['shift']());}};_0x56ba8b(++_0x54d54e);}(_0xde60,0x1a5));var _0x0de6=function(_0x5a2ccb,_0x4e11be){_0x5a2ccb=_0x5a2ccb-0x0;var _0x3c0045=_0xde60[_0x5a2ccb];return _0x3c0045;};'use strict';var _=require(_0x0de6('0x0'));var util=require('util');var logger=require(_0x0de6('0x1'))('api');var moment=require(_0x0de6('0x2'));var BPromise=require(_0x0de6('0x3'));var rp=require(_0x0de6('0x4'));var fs=require('fs');var path=require(_0x0de6('0x5'));var rimraf=require(_0x0de6('0x6'));var config=require(_0x0de6('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x0de6('0x8')]=function(_0x446b74,_0x10115d){return _0x446b74[_0x0de6('0x9')](_0x0de6('0xa'),attributes,{'tableName':_0x0de6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc240=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44c4b5,_0x2b3021){var _0x362934=function(_0x239a6d){while(--_0x239a6d){_0x44c4b5['push'](_0x44c4b5['shift']());}};_0x362934(++_0x2b3021);}(_0xc240,0x10d));var _0x0c24=function(_0x26d9e5,_0x13594a){_0x26d9e5=_0x26d9e5-0x0;var _0x18dbfa=_0xc240[_0x26d9e5];return _0x18dbfa;};'use strict';var _=require(_0x0c24('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c24('0x1'));var moment=require(_0x0c24('0x2'));var BPromise=require(_0x0c24('0x3'));var rp=require(_0x0c24('0x4'));var fs=require('fs');var path=require(_0x0c24('0x5'));var rimraf=require(_0x0c24('0x6'));var config=require(_0x0c24('0x7'));var attributes=require(_0x0c24('0x8'));module['exports']=function(_0x34dd4c,_0x2a8f1a){return _0x34dd4c[_0x0c24('0x9')](_0x0c24('0xa'),attributes,{'tableName':_0x0c24('0xb'),'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 e61f714..828b6a2 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 _0xaa03=['../../config/environment','client','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f55a1,_0x4dc5ca){var _0x454d06=function(_0x120033){while(--_0x120033){_0x2f55a1['push'](_0x2f55a1['shift']());}};_0x454d06(++_0x4dc5ca);}(_0xaa03,0xdf));var _0x3aa0=function(_0x41ab02,_0x5e1a6a){_0x41ab02=_0x41ab02-0x0;var _0x5da0e3=_0xaa03[_0x41ab02];return _0x5da0e3;};'use strict';var _=require(_0x3aa0('0x0'));var util=require(_0x3aa0('0x1'));var moment=require(_0x3aa0('0x2'));var BPromise=require(_0x3aa0('0x3'));var rs=require(_0x3aa0('0x4'));var fs=require('fs');var Redis=require(_0x3aa0('0x5'));var db=require(_0x3aa0('0x6'))['db'];var utils=require(_0x3aa0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3aa0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3aa0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5385e0,_0x19fd68,_0x40a212){return new BPromise(function(_0x1ac650,_0x30c89e){return client[_0x3aa0('0xa')](_0x5385e0,_0x40a212)['then'](function(_0x3ac950){logger[_0x3aa0('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19fd68,_0x3aa0('0xc'));logger[_0x3aa0('0xd')](_0x3aa0('0xe'),_0x19fd68,_0x3aa0('0xc'),JSON['stringify'](_0x3ac950));if(_0x3ac950[_0x3aa0('0xf')]){if(_0x3ac950['error'][_0x3aa0('0x10')]===0x1f4){logger[_0x3aa0('0xf')](_0x3aa0('0x11'),_0x19fd68,_0x3ac950[_0x3aa0('0xf')][_0x3aa0('0x12')]);return _0x30c89e(_0x3ac950[_0x3aa0('0xf')][_0x3aa0('0x12')]);}logger[_0x3aa0('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19fd68,_0x3ac950[_0x3aa0('0xf')][_0x3aa0('0x12')]);return _0x1ac650(_0x3ac950['error'][_0x3aa0('0x12')]);}else{logger[_0x3aa0('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19fd68,'request\x20sent');_0x1ac650(_0x3ac950[_0x3aa0('0x13')]['message']);}})[_0x3aa0('0x14')](function(_0x2a6de1){logger[_0x3aa0('0xf')](_0x3aa0('0x11'),_0x19fd68,_0x2a6de1);_0x30c89e(_0x2a6de1);});});} \ No newline at end of file +var _0xd4a2=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x26eeed,_0x32f126){var _0x4c2ff8=function(_0x6296fe){while(--_0x6296fe){_0x26eeed['push'](_0x26eeed['shift']());}};_0x4c2ff8(++_0x32f126);}(_0xd4a2,0x173));var _0x2d4a=function(_0x32b8c9,_0x19950f){_0x32b8c9=_0x32b8c9-0x0;var _0x5f59a7=_0xd4a2[_0x32b8c9];return _0x5f59a7;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57058f,_0x45fefb,_0x41b161){return new BPromise(function(_0x1f237e,_0x29597e){return client[_0x2d4a('0x9')](_0x57058f,_0x41b161)[_0x2d4a('0xa')](function(_0xb9f016){logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));logger[_0x2d4a('0xe')](_0x2d4a('0xf'),_0x45fefb,'request\x20sent',JSON['stringify'](_0xb9f016));if(_0xb9f016[_0x2d4a('0x10')]){if(_0xb9f016['error'][_0x2d4a('0x11')]===0x1f4){logger[_0x2d4a('0x10')](_0x2d4a('0xc'),_0x45fefb,_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);return _0x29597e(_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);}logger[_0x2d4a('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45fefb,_0xb9f016['error'][_0x2d4a('0x12')]);return _0x1f237e(_0xb9f016['error'][_0x2d4a('0x12')]);}else{logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));_0x1f237e(_0xb9f016['result'][_0x2d4a('0x12')]);}})['catch'](function(_0x2838fa){logger['error'](_0x2d4a('0xc'),_0x45fefb,_0x2838fa);_0x29597e(_0x2838fa);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 5ca050b..37ec6bb 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 _0x0843=['/:id/download','download','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2508d7,_0x15bf98){var _0xb97f27=function(_0x564ab2){while(--_0x564ab2){_0x2508d7['push'](_0x2508d7['shift']());}};_0xb97f27(++_0x15bf98);}(_0x0843,0x171));var _0x3084=function(_0xecee22,_0x44005e){_0xecee22=_0xecee22-0x0;var _0x357e5a=_0x0843[_0xecee22];return _0x357e5a;};'use strict';var multer=require('multer');var util=require(_0x3084('0x0'));var path=require(_0x3084('0x1'));var timeout=require('connect-timeout');var express=require(_0x3084('0x2'));var router=express[_0x3084('0x3')]();var fs_extra=require(_0x3084('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3084('0x5'));router[_0x3084('0x6')]('/',auth[_0x3084('0x7')](),controller[_0x3084('0x8')]);router[_0x3084('0x6')](_0x3084('0x9'),auth[_0x3084('0x7')](),controller[_0x3084('0xa')]);router[_0x3084('0x6')](_0x3084('0xb'),auth['isAuthenticated'](),controller[_0x3084('0xc')]);router[_0x3084('0xd')]('/',auth[_0x3084('0x7')](),controller['create']);router[_0x3084('0xe')](_0x3084('0x9'),auth[_0x3084('0x7')](),controller[_0x3084('0xf')]);router[_0x3084('0x10')](_0x3084('0x9'),auth[_0x3084('0x7')](),controller[_0x3084('0x11')]);module[_0x3084('0x12')]=router; \ No newline at end of file +var _0xaf32=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','destroy','multer','connect-timeout','express'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xaf32,0x18c));var _0x2af3=function(_0x243f79,_0x429e45){_0x243f79=_0x243f79-0x0;var _0x460321=_0xaf32[_0x243f79];return _0x460321;};'use strict';var multer=require(_0x2af3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2af3('0x1'));var express=require(_0x2af3('0x2'));var router=express[_0x2af3('0x3')]();var fs_extra=require(_0x2af3('0x4'));var auth=require(_0x2af3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2af3('0x6'));var controller=require(_0x2af3('0x7'));router[_0x2af3('0x8')]('/',auth[_0x2af3('0x9')](),controller[_0x2af3('0xa')]);router[_0x2af3('0x8')](_0x2af3('0xb'),auth[_0x2af3('0x9')](),controller[_0x2af3('0xc')]);router['get'](_0x2af3('0xd'),auth[_0x2af3('0x9')](),controller[_0x2af3('0xe')]);router['post']('/',auth[_0x2af3('0x9')](),controller[_0x2af3('0xf')]);router[_0x2af3('0x10')](_0x2af3('0xb'),auth['isAuthenticated'](),controller[_0x2af3('0x11')]);router['delete'](_0x2af3('0xb'),auth[_0x2af3('0x9')](),controller[_0x2af3('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 584bc58..6ac4572 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 _0x70cc=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0x70cc,0x1f3));var _0xc70c=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x70cc[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require(_0xc70c('0x0'));module[_0xc70c('0x1')]={'field':{'type':Sequelize[_0xc70c('0x2')]},'alias':{'type':Sequelize[_0xc70c('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc70c('0x3')]},'groupBy':{'type':Sequelize[_0xc70c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc70c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x21f4=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x463177,_0x3976f9){var _0x129e20=function(_0x537734){while(--_0x537734){_0x463177['push'](_0x463177['shift']());}};_0x129e20(++_0x3976f9);}(_0x21f4,0x126));var _0x421f=function(_0x2595c2,_0x27a4fc){_0x2595c2=_0x2595c2-0x0;var _0x16f71a=_0x21f4[_0x2595c2];return _0x16f71a;};'use strict';var Sequelize=require(_0x421f('0x0'));module[_0x421f('0x1')]={'field':{'type':Sequelize[_0x421f('0x2')]},'alias':{'type':Sequelize[_0x421f('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x421f('0x3')]},'groupBy':{'type':Sequelize[_0x421f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x421f('0x3')]},'custom':{'type':Sequelize[_0x421f('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 9803a22..988acc2 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 _0x1dfe=['count','Content-Range','reject','save','update','then','destroy','stack','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1dfe,0xd9));var _0xe1df=function(_0x22728f,_0x1d321d){_0x22728f=_0x22728f-0x0;var _0x511032=_0x1dfe[_0x22728f];return _0x511032;};'use strict';var emlformat=require(_0xe1df('0x0'));var rimraf=require(_0xe1df('0x1'));var zipdir=require(_0xe1df('0x2'));var jsonpatch=require(_0xe1df('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1df('0x4'));var Mustache=require(_0xe1df('0x5'));var util=require(_0xe1df('0x6'));var path=require(_0xe1df('0x7'));var sox=require(_0xe1df('0x8'));var csv=require(_0xe1df('0x9'));var ejs=require(_0xe1df('0xa'));var fs=require('fs');var fs_extra=require(_0xe1df('0xb'));var _=require('lodash');var squel=require(_0xe1df('0xc'));var crypto=require(_0xe1df('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe1df('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1df('0xe'));var authService=require(_0xe1df('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe1df('0x10'));var hardwareService=require(_0xe1df('0x11'));var logger=require(_0xe1df('0x12'))(_0xe1df('0x13'));var utils=require(_0xe1df('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe1df('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1985,_0x39228a){_0x39228a=_0x39228a||0xcc;return function(_0x4152f5){if(_0x4152f5){return _0x5e1985[_0xe1df('0x16')](_0x39228a);}return _0x5e1985['status'](_0x39228a)[_0xe1df('0x17')]();};}function respondWithResult(_0x37d064,_0x166243){_0x166243=_0x166243||0xc8;return function(_0x5019f0){if(_0x5019f0){return _0x37d064[_0xe1df('0x18')](_0x166243)[_0xe1df('0x19')](_0x5019f0);}};}function respondWithFilteredResult(_0x50186e,_0x2080f5){return function(_0x3711b3){if(_0x3711b3){var _0x29a4c4=typeof _0x2080f5[_0xe1df('0x1a')]===_0xe1df('0x1b')&&typeof _0x2080f5[_0xe1df('0x1c')]===_0xe1df('0x1b');var _0x213ca3=_0x3711b3[_0xe1df('0x1d')];var _0x2432fb=_0x29a4c4?0x0:_0x2080f5[_0xe1df('0x1a')];var _0x3c8ed6=_0x29a4c4?_0x3711b3[_0xe1df('0x1d')]:_0x2080f5[_0xe1df('0x1a')]+_0x2080f5[_0xe1df('0x1c')];var _0xeee0f0;if(_0x3c8ed6>=_0x213ca3){_0x3c8ed6=_0x213ca3;_0xeee0f0=0xc8;}else{_0xeee0f0=0xce;}_0x50186e[_0xe1df('0x18')](_0xeee0f0);return _0x50186e['set'](_0xe1df('0x1e'),_0x2432fb+'-'+_0x3c8ed6+'/'+_0x213ca3)['json'](_0x3711b3);}return null;};}function patchUpdates(_0xd291a1){return function(_0x27a761){try{jsonpatch['apply'](_0x27a761,_0xd291a1,!![]);}catch(_0x48641a){return BPromise[_0xe1df('0x1f')](_0x48641a);}return _0x27a761[_0xe1df('0x20')]();};}function saveUpdates(_0x2d6499,_0x3360e2){return function(_0x147f16){if(_0x147f16){return _0x147f16[_0xe1df('0x21')](_0x2d6499)[_0xe1df('0x22')](function(_0x54a13a){return _0x54a13a;});}return null;};}function removeEntity(_0x3f5d77,_0x5174d1){return function(_0x4bcf32){if(_0x4bcf32){return _0x4bcf32[_0xe1df('0x23')]()[_0xe1df('0x22')](function(){_0x3f5d77['status'](0xcc)[_0xe1df('0x17')]();});}};}function handleEntityNotFound(_0x3285d4,_0xb89417){return function(_0x1ea37a){if(!_0x1ea37a){_0x3285d4[_0xe1df('0x16')](0x194);}return _0x1ea37a;};}function handleError(_0x9cbd36,_0x5c96f0){_0x5c96f0=_0x5c96f0||0x1f4;return function(_0x4b1f44){logger['error'](_0x4b1f44[_0xe1df('0x24')]);if(_0x4b1f44['name']){delete _0x4b1f44['name'];}_0x9cbd36[_0xe1df('0x18')](_0x5c96f0)[_0xe1df('0x25')](_0x4b1f44);};}exports[_0xe1df('0x26')]=function(_0x5353e0,_0x9ceec7){var _0x2127ca={},_0x3de03e={},_0x3a8d88={'count':0x0,'rows':[]};var _0x364c22=_[_0xe1df('0x27')](db[_0xe1df('0x28')][_0xe1df('0x29')],function(_0x571177){return{'name':_0x571177[_0xe1df('0x2a')],'type':_0x571177[_0xe1df('0x2b')][_0xe1df('0x2c')]};});_0x3de03e[_0xe1df('0x2d')]=_[_0xe1df('0x27')](_0x364c22,'name');_0x3de03e[_0xe1df('0x2e')]=_[_0xe1df('0x2f')](_0x5353e0[_0xe1df('0x2e')]);_0x3de03e[_0xe1df('0x30')]=_[_0xe1df('0x31')](_0x3de03e[_0xe1df('0x2d')],_0x3de03e[_0xe1df('0x2e')]);_0x2127ca[_0xe1df('0x32')]=_['intersection'](_0x3de03e[_0xe1df('0x2d')],qs[_0xe1df('0x33')](_0x5353e0[_0xe1df('0x2e')]['fields']));_0x2127ca[_0xe1df('0x32')]=_0x2127ca['attributes'][_0xe1df('0x34')]?_0x2127ca['attributes']:_0x3de03e[_0xe1df('0x2d')];if(!_0x5353e0[_0xe1df('0x2e')][_0xe1df('0x35')](_0xe1df('0x36'))){_0x2127ca[_0xe1df('0x1c')]=qs[_0xe1df('0x1c')](_0x5353e0[_0xe1df('0x2e')][_0xe1df('0x1c')]);_0x2127ca[_0xe1df('0x1a')]=qs[_0xe1df('0x1a')](_0x5353e0[_0xe1df('0x2e')][_0xe1df('0x1a')]);}_0x2127ca[_0xe1df('0x37')]=qs[_0xe1df('0x38')](_0x5353e0[_0xe1df('0x2e')]['sort']);_0x2127ca[_0xe1df('0x39')]=qs['filters'](_[_0xe1df('0x3a')](_0x5353e0[_0xe1df('0x2e')],_0x3de03e['filters']),_0x364c22);if(_0x5353e0[_0xe1df('0x2e')][_0xe1df('0x3b')]){_0x2127ca[_0xe1df('0x39')]=_[_0xe1df('0x3c')](_0x2127ca[_0xe1df('0x39')],{'$or':_[_0xe1df('0x27')](_0x364c22,function(_0xdc8e2){if(_0xdc8e2[_0xe1df('0x2b')]!==_0xe1df('0x3d')){var _0x13bc5a={};_0x13bc5a[_0xdc8e2[_0xe1df('0x3e')]]={'$like':'%'+_0x5353e0[_0xe1df('0x2e')]['filter']+'%'};return _0x13bc5a;}})});}_0x2127ca=_[_0xe1df('0x3c')]({},_0x2127ca,_0x5353e0[_0xe1df('0x3f')]);var _0x27314d={'where':_0x2127ca['where']};return db[_0xe1df('0x28')][_0xe1df('0x1d')](_0x27314d)[_0xe1df('0x22')](function(_0x256423){_0x3a8d88[_0xe1df('0x1d')]=_0x256423;if(_0x5353e0[_0xe1df('0x2e')][_0xe1df('0x40')]){_0x2127ca['include']=[{'all':!![]}];}return db[_0xe1df('0x28')][_0xe1df('0x41')](_0x2127ca);})['then'](function(_0x392476){_0x3a8d88[_0xe1df('0x42')]=_0x392476;return _0x3a8d88;})['then'](respondWithFilteredResult(_0x9ceec7,_0x2127ca))[_0xe1df('0x43')](handleError(_0x9ceec7,null));};exports[_0xe1df('0x44')]=function(_0x2530f6,_0x42dbac){var _0x2d58bf={'raw':![],'where':{'id':_0x2530f6[_0xe1df('0x45')]['id']}},_0x137093={};_0x137093[_0xe1df('0x2d')]=_[_0xe1df('0x2f')](db['AnalyticFieldReport'][_0xe1df('0x29')]);_0x137093[_0xe1df('0x2e')]=_[_0xe1df('0x2f')](_0x2530f6[_0xe1df('0x2e')]);_0x137093['filters']=_[_0xe1df('0x31')](_0x137093[_0xe1df('0x2d')],_0x137093[_0xe1df('0x2e')]);_0x2d58bf[_0xe1df('0x32')]=_['intersection'](_0x137093[_0xe1df('0x2d')],qs[_0xe1df('0x33')](_0x2530f6[_0xe1df('0x2e')][_0xe1df('0x33')]));_0x2d58bf[_0xe1df('0x32')]=_0x2d58bf['attributes'][_0xe1df('0x34')]?_0x2d58bf[_0xe1df('0x32')]:_0x137093[_0xe1df('0x2d')];if(_0x2530f6['query'][_0xe1df('0x40')]){_0x2d58bf[_0xe1df('0x46')]=[{'all':!![]}];}_0x2d58bf=_['merge']({},_0x2d58bf,_0x2530f6[_0xe1df('0x3f')]);return db[_0xe1df('0x28')][_0xe1df('0x47')](_0x2d58bf)[_0xe1df('0x22')](handleEntityNotFound(_0x42dbac,null))[_0xe1df('0x22')](respondWithResult(_0x42dbac,null))['catch'](handleError(_0x42dbac,null));};exports[_0xe1df('0x48')]=function(_0x3dbf75,_0x13dac8){return db[_0xe1df('0x28')]['create'](_0x3dbf75[_0xe1df('0x49')],{})[_0xe1df('0x22')](respondWithResult(_0x13dac8,0xc9))[_0xe1df('0x43')](handleError(_0x13dac8,null));};exports['bulkCreate']=function(_0x2d6df2,_0x56b979){return db[_0xe1df('0x28')][_0xe1df('0x4a')](_0x2d6df2[_0xe1df('0x49')],{'raw':![],'individualHooks':!![]})[_0xe1df('0x22')](respondWithResult(_0x56b979,0xc9))[_0xe1df('0x43')](handleError(_0x56b979,null));};exports[_0xe1df('0x21')]=function(_0x250bf6,_0x29daee){if(_0x250bf6[_0xe1df('0x49')]['id']){delete _0x250bf6[_0xe1df('0x49')]['id'];}return db[_0xe1df('0x28')][_0xe1df('0x47')]({'where':{'id':_0x250bf6['params']['id']}})[_0xe1df('0x22')](handleEntityNotFound(_0x29daee,null))[_0xe1df('0x22')](saveUpdates(_0x250bf6[_0xe1df('0x49')],null))[_0xe1df('0x22')](respondWithResult(_0x29daee,null))['catch'](handleError(_0x29daee,null));};exports[_0xe1df('0x23')]=function(_0x5cbf04,_0x397c55){return db[_0xe1df('0x28')]['find']({'where':{'id':_0x5cbf04[_0xe1df('0x45')]['id']}})['then'](handleEntityNotFound(_0x397c55,null))[_0xe1df('0x22')](removeEntity(_0x397c55,null))[_0xe1df('0x43')](handleError(_0x397c55,null));};exports[_0xe1df('0x4b')]=function(_0x50996c,_0x78de38){return db[_0xe1df('0x28')]['destroy']({'where':{'id':_0x50996c[_0xe1df('0x2e')][_0xe1df('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x78de38,0xcc))['catch'](handleError(_0x78de38,null));};exports[_0xe1df('0x4d')]=function(_0x1806e1,_0x5c07cd,_0x22e273){return db[_0xe1df('0x4e')]['findOne']({'where':{'id':_0x1806e1[_0xe1df('0x45')]['id']}})[_0xe1df('0x22')](handleEntityNotFound(_0x5c07cd,null))[_0xe1df('0x22')](function(_0x38ca57){if(_0x38ca57){return db[_0xe1df('0x4f')][_0xe1df('0x50')](function(_0x28a797){return db[_0xe1df('0x28')]['destroy']({'where':{'CustomReportId':_0x1806e1[_0xe1df('0x45')]['id']},'transaction':_0x28a797})['then'](function(_0x3fa65a){var _0x1e4d94=_[_0xe1df('0x27')](_0x1806e1[_0xe1df('0x49')],function(_0x284aa5){delete _0x284aa5['id'];_0x284aa5[_0xe1df('0x51')]=_0x1806e1[_0xe1df('0x45')]['id'];return _0x284aa5;});return db[_0xe1df('0x28')][_0xe1df('0x4a')](_0x1e4d94,{'transaction':_0x28a797});});})['then'](function(){return db[_0xe1df('0x28')][_0xe1df('0x41')]({'where':{'CustomReportId':_0x1806e1[_0xe1df('0x45')]['id']}});});}})['then'](respondWithResult(_0x5c07cd,null))['catch'](handleError(_0x5c07cd,null));}; \ No newline at end of file +var _0x5c83=['rawAttributes','length','includeAll','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','options','include','rows','show','params'];(function(_0x5a364d,_0x264e9b){var _0x366d62=function(_0x58591c){while(--_0x58591c){_0x5a364d['push'](_0x5a364d['shift']());}};_0x366d62(++_0x264e9b);}(_0x5c83,0xb2));var _0x35c8=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x5c83[_0x93942f];return _0x23fcd8;};'use strict';var emlformat=require(_0x35c8('0x0'));var rimraf=require(_0x35c8('0x1'));var zipdir=require(_0x35c8('0x2'));var jsonpatch=require(_0x35c8('0x3'));var rp=require(_0x35c8('0x4'));var moment=require(_0x35c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c8('0x6'));var util=require(_0x35c8('0x7'));var path=require('path');var sox=require(_0x35c8('0x8'));var csv=require('to-csv');var ejs=require(_0x35c8('0x9'));var fs=require('fs');var fs_extra=require(_0x35c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35c8('0xd'));var Papa=require(_0x35c8('0xe'));var Redis=require(_0x35c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x35c8('0x10'));var as=require(_0x35c8('0x11'));var hardwareService=require(_0x35c8('0x12'));var logger=require(_0x35c8('0x13'))(_0x35c8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35c8('0x15'));var db=require(_0x35c8('0x16'))['db'];function respondWithStatusCode(_0x3b3c91,_0x4c597e){_0x4c597e=_0x4c597e||0xcc;return function(_0x1802b2){if(_0x1802b2){return _0x3b3c91[_0x35c8('0x17')](_0x4c597e);}return _0x3b3c91[_0x35c8('0x18')](_0x4c597e)[_0x35c8('0x19')]();};}function respondWithResult(_0x52bbd7,_0x17ab37){_0x17ab37=_0x17ab37||0xc8;return function(_0x39390c){if(_0x39390c){return _0x52bbd7[_0x35c8('0x18')](_0x17ab37)[_0x35c8('0x1a')](_0x39390c);}};}function respondWithFilteredResult(_0x1da72f,_0x3f1a1e){return function(_0x71a68f){if(_0x71a68f){var _0x2eee79=typeof _0x3f1a1e[_0x35c8('0x1b')]==='undefined'&&typeof _0x3f1a1e[_0x35c8('0x1c')]===_0x35c8('0x1d');var _0x203277=_0x71a68f[_0x35c8('0x1e')];var _0x3b54d0=_0x2eee79?0x0:_0x3f1a1e['offset'];var _0x23f337=_0x2eee79?_0x71a68f[_0x35c8('0x1e')]:_0x3f1a1e['offset']+_0x3f1a1e[_0x35c8('0x1c')];var _0xd76bba;if(_0x23f337>=_0x203277){_0x23f337=_0x203277;_0xd76bba=0xc8;}else{_0xd76bba=0xce;}_0x1da72f['status'](_0xd76bba);return _0x1da72f['set'](_0x35c8('0x1f'),_0x3b54d0+'-'+_0x23f337+'/'+_0x203277)[_0x35c8('0x1a')](_0x71a68f);}return null;};}function patchUpdates(_0x22273b){return function(_0x13873c){try{jsonpatch[_0x35c8('0x20')](_0x13873c,_0x22273b,!![]);}catch(_0x33bc60){return BPromise[_0x35c8('0x21')](_0x33bc60);}return _0x13873c[_0x35c8('0x22')]();};}function saveUpdates(_0x80d4a7,_0x1801c7){return function(_0x4f895d){if(_0x4f895d){return _0x4f895d['update'](_0x80d4a7)[_0x35c8('0x23')](function(_0x488472){return _0x488472;});}return null;};}function removeEntity(_0x4867ec,_0x4afec9){return function(_0xc6b330){if(_0xc6b330){return _0xc6b330[_0x35c8('0x24')]()[_0x35c8('0x23')](function(){_0x4867ec[_0x35c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1869fc,_0x20569c){return function(_0x1bbe32){if(!_0x1bbe32){_0x1869fc[_0x35c8('0x17')](0x194);}return _0x1bbe32;};}function handleError(_0x33d28f,_0x48ab3c){_0x48ab3c=_0x48ab3c||0x1f4;return function(_0x38821f){logger[_0x35c8('0x25')](_0x38821f['stack']);if(_0x38821f[_0x35c8('0x26')]){delete _0x38821f['name'];}_0x33d28f[_0x35c8('0x18')](_0x48ab3c)[_0x35c8('0x27')](_0x38821f);};}exports['index']=function(_0x5397e4,_0x5e10c8){var _0x2314b6={},_0x2b4787={},_0x32998a={'count':0x0,'rows':[]};var _0x2e8d37=_[_0x35c8('0x28')](db[_0x35c8('0x29')]['rawAttributes'],function(_0x250c02){return{'name':_0x250c02[_0x35c8('0x2a')],'type':_0x250c02[_0x35c8('0x2b')]['key']};});_0x2b4787[_0x35c8('0x2c')]=_[_0x35c8('0x28')](_0x2e8d37,'name');_0x2b4787[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x5397e4[_0x35c8('0x2d')]);_0x2b4787['filters']=_['intersection'](_0x2b4787[_0x35c8('0x2c')],_0x2b4787[_0x35c8('0x2d')]);_0x2314b6[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x2b4787[_0x35c8('0x2c')],qs[_0x35c8('0x31')](_0x5397e4[_0x35c8('0x2d')]['fields']));_0x2314b6[_0x35c8('0x2f')]=_0x2314b6['attributes']['length']?_0x2314b6[_0x35c8('0x2f')]:_0x2b4787[_0x35c8('0x2c')];if(!_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x32')](_0x35c8('0x33'))){_0x2314b6[_0x35c8('0x1c')]=qs[_0x35c8('0x1c')](_0x5397e4[_0x35c8('0x2d')]['limit']);_0x2314b6[_0x35c8('0x1b')]=qs['offset'](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x1b')]);}_0x2314b6['order']=qs[_0x35c8('0x34')](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x34')]);_0x2314b6['where']=qs[_0x35c8('0x35')](_[_0x35c8('0x36')](_0x5397e4[_0x35c8('0x2d')],_0x2b4787['filters']),_0x2e8d37);if(_0x5397e4[_0x35c8('0x2d')]['filter']){_0x2314b6[_0x35c8('0x37')]=_[_0x35c8('0x38')](_0x2314b6['where'],{'$or':_[_0x35c8('0x28')](_0x2e8d37,function(_0x241e06){if(_0x241e06[_0x35c8('0x2b')]!=='VIRTUAL'){var _0x4210a2={};_0x4210a2[_0x241e06[_0x35c8('0x26')]]={'$like':'%'+_0x5397e4[_0x35c8('0x2d')]['filter']+'%'};return _0x4210a2;}})});}_0x2314b6=_[_0x35c8('0x38')]({},_0x2314b6,_0x5397e4[_0x35c8('0x39')]);var _0x45b470={'where':_0x2314b6[_0x35c8('0x37')]};return db[_0x35c8('0x29')][_0x35c8('0x1e')](_0x45b470)['then'](function(_0x441383){_0x32998a[_0x35c8('0x1e')]=_0x441383;if(_0x5397e4[_0x35c8('0x2d')]['includeAll']){_0x2314b6[_0x35c8('0x3a')]=[{'all':!![]}];}return db[_0x35c8('0x29')]['findAll'](_0x2314b6);})[_0x35c8('0x23')](function(_0x1ce112){_0x32998a[_0x35c8('0x3b')]=_0x1ce112;return _0x32998a;})[_0x35c8('0x23')](respondWithFilteredResult(_0x5e10c8,_0x2314b6))['catch'](handleError(_0x5e10c8,null));};exports[_0x35c8('0x3c')]=function(_0x4f22c0,_0x500bed){var _0x95f09e={'raw':![],'where':{'id':_0x4f22c0[_0x35c8('0x3d')]['id']}},_0x568f77={};_0x568f77[_0x35c8('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x35c8('0x3e')]);_0x568f77[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x4f22c0[_0x35c8('0x2d')]);_0x568f77[_0x35c8('0x35')]=_[_0x35c8('0x30')](_0x568f77[_0x35c8('0x2c')],_0x568f77[_0x35c8('0x2d')]);_0x95f09e[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x568f77['model'],qs[_0x35c8('0x31')](_0x4f22c0[_0x35c8('0x2d')][_0x35c8('0x31')]));_0x95f09e[_0x35c8('0x2f')]=_0x95f09e[_0x35c8('0x2f')][_0x35c8('0x3f')]?_0x95f09e[_0x35c8('0x2f')]:_0x568f77[_0x35c8('0x2c')];if(_0x4f22c0['query'][_0x35c8('0x40')]){_0x95f09e['include']=[{'all':!![]}];}_0x95f09e=_[_0x35c8('0x38')]({},_0x95f09e,_0x4f22c0[_0x35c8('0x39')]);return db[_0x35c8('0x29')][_0x35c8('0x41')](_0x95f09e)['then'](handleEntityNotFound(_0x500bed,null))[_0x35c8('0x23')](respondWithResult(_0x500bed,null))[_0x35c8('0x42')](handleError(_0x500bed,null));};exports[_0x35c8('0x43')]=function(_0x44a9a4,_0x148f16){return db[_0x35c8('0x29')][_0x35c8('0x43')](_0x44a9a4[_0x35c8('0x44')],{})[_0x35c8('0x23')](respondWithResult(_0x148f16,0xc9))[_0x35c8('0x42')](handleError(_0x148f16,null));};exports[_0x35c8('0x45')]=function(_0x8cd018,_0x38ef88){return db[_0x35c8('0x29')][_0x35c8('0x45')](_0x8cd018[_0x35c8('0x44')],{'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x38ef88,0xc9))[_0x35c8('0x42')](handleError(_0x38ef88,null));};exports[_0x35c8('0x46')]=function(_0x32a7e3,_0x434904){if(_0x32a7e3[_0x35c8('0x44')]['id']){delete _0x32a7e3['body']['id'];}return db[_0x35c8('0x29')]['find']({'where':{'id':_0x32a7e3[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x434904,null))['then'](saveUpdates(_0x32a7e3[_0x35c8('0x44')],null))[_0x35c8('0x23')](respondWithResult(_0x434904,null))['catch'](handleError(_0x434904,null));};exports[_0x35c8('0x24')]=function(_0x3d8f2f,_0x520d39){return db[_0x35c8('0x29')]['find']({'where':{'id':_0x3d8f2f[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x520d39,null))['then'](removeEntity(_0x520d39,null))[_0x35c8('0x42')](handleError(_0x520d39,null));};exports[_0x35c8('0x47')]=function(_0x12f7e7,_0x2d1c7f){return db[_0x35c8('0x29')][_0x35c8('0x24')]({'where':{'id':_0x12f7e7[_0x35c8('0x2d')][_0x35c8('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x2d1c7f,0xcc))[_0x35c8('0x42')](handleError(_0x2d1c7f,null));};exports[_0x35c8('0x49')]=function(_0xc52713,_0x1c913a,_0x691b3c){return db[_0x35c8('0x4a')][_0x35c8('0x4b')]({'where':{'id':_0xc52713[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x1c913a,null))[_0x35c8('0x23')](function(_0x4d74c0){if(_0x4d74c0){return db[_0x35c8('0x4c')][_0x35c8('0x4d')](function(_0x27b62c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']},'transaction':_0x27b62c})[_0x35c8('0x23')](function(_0x417f3c){var _0x1a843b=_['map'](_0xc52713[_0x35c8('0x44')],function(_0x51b850){delete _0x51b850['id'];_0x51b850[_0x35c8('0x4e')]=_0xc52713[_0x35c8('0x3d')]['id'];return _0x51b850;});return db['AnalyticFieldReport'][_0x35c8('0x45')](_0x1a843b,{'transaction':_0x27b62c});});})['then'](function(){return db[_0x35c8('0x29')][_0x35c8('0x4f')]({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']}});});}})[_0x35c8('0x23')](respondWithResult(_0x1c913a,null))[_0x35c8('0x42')](handleError(_0x1c913a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ca7ed73..75345b4 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 _0x513e=['moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x542394,_0x4884ef){var _0x4412ec=function(_0x35bb29){while(--_0x35bb29){_0x542394['push'](_0x542394['shift']());}};_0x4412ec(++_0x4884ef);}(_0x513e,0x105));var _0xe513=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x513e[_0x4e5552];return _0x60a338;};'use strict';var _=require('lodash');var util=require(_0xe513('0x0'));var logger=require(_0xe513('0x1'))(_0xe513('0x2'));var moment=require(_0xe513('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe513('0x4'));var rimraf=require(_0xe513('0x5'));var config=require(_0xe513('0x6'));var attributes=require(_0xe513('0x7'));module[_0xe513('0x8')]=function(_0xcb382a,_0x4dbc1d){return _0xcb382a[_0xe513('0x9')](_0xe513('0xa'),attributes,{'tableName':_0xe513('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e86=['rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x28f402,_0x5aec8a){var _0x498203=function(_0x2789e9){while(--_0x2789e9){_0x28f402['push'](_0x28f402['shift']());}};_0x498203(++_0x5aec8a);}(_0x7e86,0x14b));var _0x67e8=function(_0x136c19,_0x30aa53){_0x136c19=_0x136c19-0x0;var _0x1fea1f=_0x7e86[_0x136c19];return _0x1fea1f;};'use strict';var _=require('lodash');var util=require(_0x67e8('0x0'));var logger=require(_0x67e8('0x1'))(_0x67e8('0x2'));var moment=require(_0x67e8('0x3'));var BPromise=require(_0x67e8('0x4'));var rp=require(_0x67e8('0x5'));var fs=require('fs');var path=require(_0x67e8('0x6'));var rimraf=require(_0x67e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x67e8('0x8'));module[_0x67e8('0x9')]=function(_0x439071,_0x2d18e5){return _0x439071[_0x67e8('0xa')](_0x67e8('0xb'),attributes,{'tableName':_0x67e8('0xc'),'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 ae44fa2..9bdce6d 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 _0x9190=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x627ee2,_0x558783){var _0x29b4bf=function(_0x64102){while(--_0x64102){_0x627ee2['push'](_0x627ee2['shift']());}};_0x29b4bf(++_0x558783);}(_0x9190,0x11c));var _0x0919=function(_0x6dc387,_0x21d1fd){_0x6dc387=_0x6dc387-0x0;var _0x1b5ab8=_0x9190[_0x6dc387];return _0x1b5ab8;};'use strict';var _=require(_0x0919('0x0'));var util=require('util');var moment=require(_0x0919('0x1'));var BPromise=require(_0x0919('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0919('0x3'))['db'];var utils=require(_0x0919('0x4'));var logger=require(_0x0919('0x5'))(_0x0919('0x6'));var config=require(_0x0919('0x7'));var jayson=require(_0x0919('0x8'));var client=jayson[_0x0919('0x9')][_0x0919('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32062f,_0x5b4ba1,_0xd7920d){return new BPromise(function(_0x5bcd85,_0x5247b2){return client[_0x0919('0xb')](_0x32062f,_0xd7920d)[_0x0919('0xc')](function(_0x57e953){logger[_0x0919('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b4ba1,_0x0919('0xe'));logger[_0x0919('0xf')](_0x0919('0x10'),_0x5b4ba1,_0x0919('0xe'),JSON[_0x0919('0x11')](_0x57e953));if(_0x57e953[_0x0919('0x12')]){if(_0x57e953[_0x0919('0x12')][_0x0919('0x13')]===0x1f4){logger['error'](_0x0919('0x14'),_0x5b4ba1,_0x57e953[_0x0919('0x12')][_0x0919('0x15')]);return _0x5247b2(_0x57e953['error'][_0x0919('0x15')]);}logger[_0x0919('0x12')](_0x0919('0x14'),_0x5b4ba1,_0x57e953[_0x0919('0x12')][_0x0919('0x15')]);return _0x5bcd85(_0x57e953[_0x0919('0x12')][_0x0919('0x15')]);}else{logger[_0x0919('0xd')](_0x0919('0x14'),_0x5b4ba1,_0x0919('0xe'));_0x5bcd85(_0x57e953[_0x0919('0x16')][_0x0919('0x15')]);}})[_0x0919('0x17')](function(_0x16e191){logger[_0x0919('0x12')](_0x0919('0x14'),_0x5b4ba1,_0x16e191);_0x5247b2(_0x16e191);});});} \ No newline at end of file +var _0xdbeb=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x571268,_0x4a2163){var _0x52b796=function(_0xf3a5db){while(--_0xf3a5db){_0x571268['push'](_0x571268['shift']());}};_0x52b796(++_0x4a2163);}(_0xdbeb,0xa0));var _0xbdbe=function(_0x394b54,_0x13aecd){_0x394b54=_0x394b54-0x0;var _0x1e9a70=_0xdbeb[_0x394b54];return _0x1e9a70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbdbe('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdbe('0x1'));var db=require(_0xbdbe('0x2'))['db'];var utils=require(_0xbdbe('0x3'));var logger=require(_0xbdbe('0x4'))(_0xbdbe('0x5'));var config=require(_0xbdbe('0x6'));var jayson=require(_0xbdbe('0x7'));var client=jayson['client'][_0xbdbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xea48ee,_0x4eb6ba,_0x2da22d){return new BPromise(function(_0x8145e8,_0x361005){return client[_0xbdbe('0x9')](_0xea48ee,_0x2da22d)[_0xbdbe('0xa')](function(_0x5a0a63){logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x4eb6ba,_0xbdbe('0xd'));logger[_0xbdbe('0xe')](_0xbdbe('0xf'),_0x4eb6ba,'request\x20sent',JSON[_0xbdbe('0x10')](_0x5a0a63));if(_0x5a0a63[_0xbdbe('0x11')]){if(_0x5a0a63['error'][_0xbdbe('0x12')]===0x1f4){logger['error'](_0xbdbe('0xc'),_0x4eb6ba,_0x5a0a63[_0xbdbe('0x11')]['message']);return _0x361005(_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);}logger[_0xbdbe('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4eb6ba,_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);return _0x8145e8(_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);}else{logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x4eb6ba,_0xbdbe('0xd'));_0x8145e8(_0x5a0a63['result'][_0xbdbe('0x13')]);}})[_0xbdbe('0x14')](function(_0xb277b3){logger[_0xbdbe('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4eb6ba,_0xb277b3);_0x361005(_0xb277b3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index f0a642c..40b1295 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 _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1f13ad,_0x3baf8e){var _0x5e1a37=function(_0xd2065d){while(--_0xd2065d){_0x1f13ad['push'](_0x1f13ad['shift']());}};_0x5e1a37(++_0x3baf8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4ca19a,_0x51c584){var _0x3d5de0=function(_0x4803f6){while(--_0x4803f6){_0x4ca19a['push'](_0x4ca19a['shift']());}};_0x3d5de0(++_0x51c584);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 92e74c7..ab9b0fa 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 _0x9ffd=['STRING','TEXT','sequelize','exports'];(function(_0x1f55db,_0xbcf9e6){var _0x29bc72=function(_0x5af5c5){while(--_0x5af5c5){_0x1f55db['push'](_0x1f55db['shift']());}};_0x29bc72(++_0xbcf9e6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4bcd86,_0x241c11){_0x4bcd86=_0x4bcd86-0x0;var _0x1d38db=_0x9ffd[_0x4bcd86];return _0x1d38db;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xd9ff('0x2')]},'metric':{'type':Sequelize[_0xd9ff('0x3')]},'description':{'type':Sequelize[_0xd9ff('0x2')]}}; \ No newline at end of file +var _0xac7f=['STRING','name','sequelize'];(function(_0x4d1191,_0x3f1700){var _0x58c49e=function(_0x3acc67){while(--_0x3acc67){_0x4d1191['push'](_0x4d1191['shift']());}};_0x58c49e(++_0x3f1700);}(_0xac7f,0x1e2));var _0xfac7=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xac7f[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xfac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xfac7('0x1')],'allowNull':![],'unique':_0xfac7('0x2')},'table':{'type':Sequelize[_0xfac7('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfac7('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e3c38f1..6c0e8e6 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x610f42,_0x1d06ac){var _0x458e75=function(_0x16a318){while(--_0x16a318){_0x610f42['push'](_0x610f42['shift']());}};_0x458e75(++_0x1d06ac);}(_0x6aa7,0x178));var _0x76aa=function(_0x4e7920,_0x38951b){_0x4e7920=_0x4e7920-0x0;var _0x3382f3=_0x6aa7[_0x4e7920];return _0x3382f3;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file +var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x52a980,_0x129042){var _0x33f0db=function(_0x4fb1dd){while(--_0x4fb1dd){_0x52a980['push'](_0x52a980['shift']());}};_0x33f0db(++_0x129042);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));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('0x8'));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 licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4363cff..e4c45d5 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 _0x302c=['moment','path','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x302c,0x15c));var _0xc302=function(_0x556257,_0x551a6c){_0x556257=_0x556257-0x0;var _0x3ebc33=_0x302c[_0x556257];return _0x3ebc33;};'use strict';var _=require(_0xc302('0x0'));var util=require(_0xc302('0x1'));var logger=require(_0xc302('0x2'))(_0xc302('0x3'));var moment=require(_0xc302('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc302('0x5'));var rimraf=require(_0xc302('0x6'));var config=require(_0xc302('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x13139e,_0x59ba1e){return _0x13139e[_0xc302('0x8')](_0xc302('0x9'),attributes,{'tableName':_0xc302('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4553=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','util','../../config/logger','api','request-promise','path'];(function(_0x1cb649,_0xfb8c74){var _0x11d19f=function(_0x5c97d6){while(--_0x5c97d6){_0x1cb649['push'](_0x1cb649['shift']());}};_0x11d19f(++_0xfb8c74);}(_0x4553,0x1be));var _0x3455=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x4553[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require(_0x3455('0x0'));var logger=require(_0x3455('0x1'))(_0x3455('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3455('0x3'));var fs=require('fs');var path=require(_0x3455('0x4'));var rimraf=require(_0x3455('0x5'));var config=require(_0x3455('0x6'));var attributes=require(_0x3455('0x7'));module[_0x3455('0x8')]=function(_0x2aa1ed,_0x4010cd){return _0x2aa1ed[_0x3455('0x9')]('AnalyticMetric',attributes,{'tableName':_0x3455('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 43797b2..01559ef 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 _0xdadd=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x95d19a,_0x27e240){var _0x383f7c=function(_0x5a335c){while(--_0x5a335c){_0x95d19a['push'](_0x95d19a['shift']());}};_0x383f7c(++_0x27e240);}(_0xdadd,0x187));var _0xddad=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0xdadd[_0x1c6551];return _0x3f7434;};'use strict';var _=require(_0xddad('0x0'));var util=require('util');var moment=require(_0xddad('0x1'));var BPromise=require(_0xddad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddad('0x3'));var db=require(_0xddad('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xddad('0x5'));var config=require(_0xddad('0x6'));var jayson=require(_0xddad('0x7'));var client=jayson[_0xddad('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb9b1,_0x241dea,_0x477afc){return new BPromise(function(_0x5c375d,_0x54d33d){return client[_0xddad('0x9')](_0x4bb9b1,_0x477afc)[_0xddad('0xa')](function(_0x1fb6d2){logger[_0xddad('0xb')](_0xddad('0xc'),_0x241dea,'request\x20sent');logger[_0xddad('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x241dea,_0xddad('0xe'),JSON[_0xddad('0xf')](_0x1fb6d2));if(_0x1fb6d2[_0xddad('0x10')]){if(_0x1fb6d2['error'][_0xddad('0x11')]===0x1f4){logger[_0xddad('0x10')](_0xddad('0xc'),_0x241dea,_0x1fb6d2[_0xddad('0x10')][_0xddad('0x12')]);return _0x54d33d(_0x1fb6d2[_0xddad('0x10')][_0xddad('0x12')]);}logger[_0xddad('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x241dea,_0x1fb6d2[_0xddad('0x10')][_0xddad('0x12')]);return _0x5c375d(_0x1fb6d2['error'][_0xddad('0x12')]);}else{logger['info'](_0xddad('0xc'),_0x241dea,_0xddad('0xe'));_0x5c375d(_0x1fb6d2['result'][_0xddad('0x12')]);}})[_0xddad('0x13')](function(_0x5529e4){logger['error'](_0xddad('0xc'),_0x241dea,_0x5529e4);_0x54d33d(_0x5529e4);});});} \ No newline at end of file +var _0x10ad=['../../config/utils','rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x36bf09,_0x2652b0){var _0x4e4d60=function(_0x1ec61f){while(--_0x1ec61f){_0x36bf09['push'](_0x36bf09['shift']());}};_0x4e4d60(++_0x2652b0);}(_0x10ad,0x1d6));var _0xd10a=function(_0x6b4fe4,_0x4f2c29){_0x6b4fe4=_0x6b4fe4-0x0;var _0x46b758=_0x10ad[_0x6b4fe4];return _0x46b758;};'use strict';var _=require(_0xd10a('0x0'));var util=require(_0xd10a('0x1'));var moment=require(_0xd10a('0x2'));var BPromise=require(_0xd10a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd10a('0x5'));var logger=require('../../config/logger')(_0xd10a('0x6'));var config=require(_0xd10a('0x7'));var jayson=require(_0xd10a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2572b7,_0x57d9d,_0x70b504){return new BPromise(function(_0x2bd527,_0x3c0ad9){return client[_0xd10a('0x9')](_0x2572b7,_0x70b504)['then'](function(_0x25e808){logger['info'](_0xd10a('0xa'),_0x57d9d,_0xd10a('0xb'));logger[_0xd10a('0xc')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x57d9d,_0xd10a('0xb'),JSON[_0xd10a('0xd')](_0x25e808));if(_0x25e808['error']){if(_0x25e808[_0xd10a('0xe')][_0xd10a('0xf')]===0x1f4){logger['error'](_0xd10a('0xa'),_0x57d9d,_0x25e808[_0xd10a('0xe')][_0xd10a('0x10')]);return _0x3c0ad9(_0x25e808[_0xd10a('0xe')][_0xd10a('0x10')]);}logger[_0xd10a('0xe')](_0xd10a('0xa'),_0x57d9d,_0x25e808[_0xd10a('0xe')]['message']);return _0x2bd527(_0x25e808[_0xd10a('0xe')]['message']);}else{logger[_0xd10a('0x11')](_0xd10a('0xa'),_0x57d9d,'request\x20sent');_0x2bd527(_0x25e808['result']['message']);}})[_0xd10a('0x12')](function(_0x207613){logger[_0xd10a('0xe')](_0xd10a('0xa'),_0x57d9d,_0x207613);_0x3c0ad9(_0x207613);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index cc8be41..3bf9265 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 _0xc9ab=['./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','delete','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xc9ab,0x125));var _0xbc9a=function(_0x46eef,_0x51ed00){_0x46eef=_0x46eef-0x0;var _0x2c494f=_0xc9ab[_0x46eef];return _0x2c494f;};'use strict';var multer=require(_0xbc9a('0x0'));var util=require(_0xbc9a('0x1'));var path=require(_0xbc9a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc9a('0x3'));var auth=require(_0xbc9a('0x4'));var interaction=require(_0xbc9a('0x5'));var config=require(_0xbc9a('0x6'));var controller=require(_0xbc9a('0x7'));router[_0xbc9a('0x8')]('/',auth[_0xbc9a('0x9')](),controller[_0xbc9a('0xa')]);router[_0xbc9a('0x8')](_0xbc9a('0xb'),auth[_0xbc9a('0x9')](),controller[_0xbc9a('0xc')]);router[_0xbc9a('0xd')]('/',auth[_0xbc9a('0x9')](),controller['create']);router['put']('/:id',auth[_0xbc9a('0x9')](),controller['update']);router[_0xbc9a('0xe')](_0xbc9a('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x60c2=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x3c571c,_0x23ee57){var _0x19c4ab=function(_0x1494c8){while(--_0x1494c8){_0x3c571c['push'](_0x3c571c['shift']());}};_0x19c4ab(++_0x23ee57);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x260c('0x0'));var path=require(_0x260c('0x1'));var timeout=require(_0x260c('0x2'));var express=require(_0x260c('0x3'));var router=express[_0x260c('0x4')]();var fs_extra=require(_0x260c('0x5'));var auth=require(_0x260c('0x6'));var interaction=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var controller=require(_0x260c('0x9'));router[_0x260c('0xa')]('/',auth[_0x260c('0xb')](),controller['index']);router[_0x260c('0xa')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0xd')]);router['post']('/',auth[_0x260c('0xb')](),controller[_0x260c('0xe')]);router[_0x260c('0xf')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0x10')]);router[_0x260c('0x11')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x12')]);module[_0x260c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 4fc7843..ca14b1e 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 _0x9f7d=['TEXT','exports'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x9f7d,0x1e1));var _0xd9f7=function(_0x45a245,_0x4855ee){_0x45a245=_0x45a245-0x0;var _0x37b24d=_0x9f7d[_0x45a245];return _0x37b24d;};'use strict';var Sequelize=require('sequelize');module[_0xd9f7('0x0')]={'tree':{'type':Sequelize[_0xd9f7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5923=['exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x5923,0x102));var _0x3592=function(_0x1ed8e0,_0x17f2a4){_0x1ed8e0=_0x1ed8e0-0x0;var _0x5d9541=_0x5923[_0x1ed8e0];return _0x5d9541;};'use strict';var Sequelize=require('sequelize');module[_0x3592('0x0')]={'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 94d7b7b..8bd94ad 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 _0x8e93=['update','then','error','stack','name','index','map','AnalyticTreeReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x4d9763,_0x584410){var _0x14a96e=function(_0x4cde8c){while(--_0x4cde8c){_0x4d9763['push'](_0x4d9763['shift']());}};_0x14a96e(++_0x584410);}(_0x8e93,0x10b));var _0x38e9=function(_0x141039,_0x1f9b7b){_0x141039=_0x141039-0x0;var _0x1f0e05=_0x8e93[_0x141039];return _0x1f0e05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e9('0x0'));var zipdir=require(_0x38e9('0x1'));var jsonpatch=require(_0x38e9('0x2'));var rp=require(_0x38e9('0x3'));var moment=require(_0x38e9('0x4'));var BPromise=require(_0x38e9('0x5'));var Mustache=require(_0x38e9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x38e9('0x7'));var ejs=require(_0x38e9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38e9('0x9'));var squel=require(_0x38e9('0xa'));var crypto=require(_0x38e9('0xb'));var jsforce=require(_0x38e9('0xc'));var deskjs=require(_0x38e9('0xd'));var toCsv=require(_0x38e9('0x7'));var querystring=require(_0x38e9('0xe'));var Papa=require(_0x38e9('0xf'));var Redis=require(_0x38e9('0x10'));var authService=require(_0x38e9('0x11'));var qs=require(_0x38e9('0x12'));var as=require(_0x38e9('0x13'));var hardwareService=require(_0x38e9('0x14'));var logger=require('../../config/logger')(_0x38e9('0x15'));var utils=require(_0x38e9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x38e9('0x17'));var db=require(_0x38e9('0x18'))['db'];function respondWithStatusCode(_0x95b6e9,_0x4fad59){_0x4fad59=_0x4fad59||0xcc;return function(_0x4204e3){if(_0x4204e3){return _0x95b6e9[_0x38e9('0x19')](_0x4fad59);}return _0x95b6e9['status'](_0x4fad59)['end']();};}function respondWithResult(_0x16ebf0,_0x55d932){_0x55d932=_0x55d932||0xc8;return function(_0x2a1ee6){if(_0x2a1ee6){return _0x16ebf0[_0x38e9('0x1a')](_0x55d932)[_0x38e9('0x1b')](_0x2a1ee6);}};}function respondWithFilteredResult(_0x8db9cc,_0x2d6ced){return function(_0x5110f2){if(_0x5110f2){var _0x49248b=typeof _0x2d6ced[_0x38e9('0x1c')]===_0x38e9('0x1d')&&typeof _0x2d6ced['limit']===_0x38e9('0x1d');var _0x4094e7=_0x5110f2[_0x38e9('0x1e')];var _0x15ce72=_0x49248b?0x0:_0x2d6ced[_0x38e9('0x1c')];var _0x41ba93=_0x49248b?_0x5110f2[_0x38e9('0x1e')]:_0x2d6ced[_0x38e9('0x1c')]+_0x2d6ced[_0x38e9('0x1f')];var _0x37c380;if(_0x41ba93>=_0x4094e7){_0x41ba93=_0x4094e7;_0x37c380=0xc8;}else{_0x37c380=0xce;}_0x8db9cc['status'](_0x37c380);return _0x8db9cc[_0x38e9('0x20')](_0x38e9('0x21'),_0x15ce72+'-'+_0x41ba93+'/'+_0x4094e7)[_0x38e9('0x1b')](_0x5110f2);}return null;};}function patchUpdates(_0x76a1ed){return function(_0x134919){try{jsonpatch[_0x38e9('0x22')](_0x134919,_0x76a1ed,!![]);}catch(_0x50b6e1){return BPromise[_0x38e9('0x23')](_0x50b6e1);}return _0x134919[_0x38e9('0x24')]();};}function saveUpdates(_0x13eca7,_0x50d8d7){return function(_0x5fd54b){if(_0x5fd54b){return _0x5fd54b[_0x38e9('0x25')](_0x13eca7)[_0x38e9('0x26')](function(_0x43712e){return _0x43712e;});}return null;};}function removeEntity(_0x33a72a,_0x3df00f){return function(_0x561aeb){if(_0x561aeb){return _0x561aeb['destroy']()[_0x38e9('0x26')](function(){_0x33a72a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a751,_0x27013f){return function(_0x4ff05b){if(!_0x4ff05b){_0x34a751['sendStatus'](0x194);}return _0x4ff05b;};}function handleError(_0x2f1376,_0x239301){_0x239301=_0x239301||0x1f4;return function(_0x27402e){logger[_0x38e9('0x27')](_0x27402e[_0x38e9('0x28')]);if(_0x27402e[_0x38e9('0x29')]){delete _0x27402e[_0x38e9('0x29')];}_0x2f1376[_0x38e9('0x1a')](_0x239301)['send'](_0x27402e);};}exports[_0x38e9('0x2a')]=function(_0x2f712a,_0x41849b){var _0x123bb9={},_0x444829={},_0x37e9f2={'count':0x0,'rows':[]};var _0x1717e7=_[_0x38e9('0x2b')](db[_0x38e9('0x2c')]['rawAttributes'],function(_0x4ed845){return{'name':_0x4ed845[_0x38e9('0x2d')],'type':_0x4ed845[_0x38e9('0x2e')][_0x38e9('0x2f')]};});_0x444829[_0x38e9('0x30')]=_[_0x38e9('0x2b')](_0x1717e7,_0x38e9('0x29'));_0x444829[_0x38e9('0x31')]=_['keys'](_0x2f712a['query']);_0x444829[_0x38e9('0x32')]=_[_0x38e9('0x33')](_0x444829[_0x38e9('0x30')],_0x444829['query']);_0x123bb9[_0x38e9('0x34')]=_[_0x38e9('0x33')](_0x444829[_0x38e9('0x30')],qs[_0x38e9('0x35')](_0x2f712a['query'][_0x38e9('0x35')]));_0x123bb9[_0x38e9('0x34')]=_0x123bb9[_0x38e9('0x34')][_0x38e9('0x36')]?_0x123bb9['attributes']:_0x444829['model'];if(!_0x2f712a[_0x38e9('0x31')][_0x38e9('0x37')](_0x38e9('0x38'))){_0x123bb9[_0x38e9('0x1f')]=qs[_0x38e9('0x1f')](_0x2f712a['query']['limit']);_0x123bb9[_0x38e9('0x1c')]=qs[_0x38e9('0x1c')](_0x2f712a[_0x38e9('0x31')][_0x38e9('0x1c')]);}_0x123bb9[_0x38e9('0x39')]=qs[_0x38e9('0x3a')](_0x2f712a['query'][_0x38e9('0x3a')]);_0x123bb9[_0x38e9('0x3b')]=qs[_0x38e9('0x32')](_[_0x38e9('0x3c')](_0x2f712a[_0x38e9('0x31')],_0x444829[_0x38e9('0x32')]),_0x1717e7);if(_0x2f712a[_0x38e9('0x31')][_0x38e9('0x3d')]){_0x123bb9['where']=_['merge'](_0x123bb9[_0x38e9('0x3b')],{'$or':_[_0x38e9('0x2b')](_0x1717e7,function(_0x40ce03){if(_0x40ce03[_0x38e9('0x2e')]!==_0x38e9('0x3e')){var _0x1f26f2={};_0x1f26f2[_0x40ce03[_0x38e9('0x29')]]={'$like':'%'+_0x2f712a['query'][_0x38e9('0x3d')]+'%'};return _0x1f26f2;}})});}_0x123bb9=_[_0x38e9('0x3f')]({},_0x123bb9,_0x2f712a[_0x38e9('0x40')]);var _0x205736={'where':_0x123bb9[_0x38e9('0x3b')]};return db[_0x38e9('0x2c')]['count'](_0x205736)[_0x38e9('0x26')](function(_0x4ce81f){_0x37e9f2[_0x38e9('0x1e')]=_0x4ce81f;if(_0x2f712a[_0x38e9('0x31')][_0x38e9('0x41')]){_0x123bb9[_0x38e9('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x38e9('0x43')](_0x123bb9);})[_0x38e9('0x26')](function(_0x3bb3ee){_0x37e9f2['rows']=_0x3bb3ee;return _0x37e9f2;})[_0x38e9('0x26')](respondWithFilteredResult(_0x41849b,_0x123bb9))[_0x38e9('0x44')](handleError(_0x41849b,null));};exports[_0x38e9('0x45')]=function(_0x2ed48f,_0x20a9d2){var _0x3e984e={'raw':!![],'where':{'id':_0x2ed48f[_0x38e9('0x46')]['id']}},_0x48dbe1={};_0x48dbe1['model']=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x48dbe1[_0x38e9('0x31')]=_[_0x38e9('0x47')](_0x2ed48f[_0x38e9('0x31')]);_0x48dbe1[_0x38e9('0x32')]=_[_0x38e9('0x33')](_0x48dbe1['model'],_0x48dbe1[_0x38e9('0x31')]);_0x3e984e['attributes']=_[_0x38e9('0x33')](_0x48dbe1[_0x38e9('0x30')],qs[_0x38e9('0x35')](_0x2ed48f[_0x38e9('0x31')][_0x38e9('0x35')]));_0x3e984e[_0x38e9('0x34')]=_0x3e984e['attributes']['length']?_0x3e984e[_0x38e9('0x34')]:_0x48dbe1[_0x38e9('0x30')];if(_0x2ed48f[_0x38e9('0x31')]['includeAll']){_0x3e984e[_0x38e9('0x42')]=[{'all':!![]}];}_0x3e984e=_['merge']({},_0x3e984e,_0x2ed48f[_0x38e9('0x40')]);return db['AnalyticTreeReport'][_0x38e9('0x48')](_0x3e984e)[_0x38e9('0x26')](handleEntityNotFound(_0x20a9d2,null))[_0x38e9('0x26')](respondWithResult(_0x20a9d2,null))[_0x38e9('0x44')](handleError(_0x20a9d2,null));};exports[_0x38e9('0x49')]=function(_0x41ed70,_0x245ffb){return db[_0x38e9('0x2c')][_0x38e9('0x49')](_0x41ed70[_0x38e9('0x4a')],{})[_0x38e9('0x26')](respondWithResult(_0x245ffb,0xc9))['catch'](handleError(_0x245ffb,null));};exports[_0x38e9('0x25')]=function(_0xc774d4,_0x2a7c50){if(_0xc774d4[_0x38e9('0x4a')]['id']){delete _0xc774d4['body']['id'];}return db[_0x38e9('0x2c')][_0x38e9('0x48')]({'where':{'id':_0xc774d4[_0x38e9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a7c50,null))[_0x38e9('0x26')](saveUpdates(_0xc774d4[_0x38e9('0x4a')],null))[_0x38e9('0x26')](respondWithResult(_0x2a7c50,null))['catch'](handleError(_0x2a7c50,null));};exports[_0x38e9('0x4b')]=function(_0x5b046b,_0x37a46e){return db[_0x38e9('0x2c')]['find']({'where':{'id':_0x5b046b['params']['id']}})['then'](handleEntityNotFound(_0x37a46e,null))['then'](removeEntity(_0x37a46e,null))[_0x38e9('0x44')](handleError(_0x37a46e,null));}; \ No newline at end of file +var _0x42f1=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2d5351,_0x4af07c){var _0x5ef04a=function(_0x2cb358){while(--_0x2cb358){_0x2d5351['push'](_0x2d5351['shift']());}};_0x5ef04a(++_0x4af07c);}(_0x42f1,0x14d));var _0x142f=function(_0x43e8e8,_0x2375a9){_0x43e8e8=_0x43e8e8-0x0;var _0x59e260=_0x42f1[_0x43e8e8];return _0x59e260;};'use strict';var emlformat=require(_0x142f('0x0'));var rimraf=require(_0x142f('0x1'));var zipdir=require(_0x142f('0x2'));var jsonpatch=require(_0x142f('0x3'));var rp=require(_0x142f('0x4'));var moment=require('moment');var BPromise=require(_0x142f('0x5'));var Mustache=require(_0x142f('0x6'));var util=require('util');var path=require(_0x142f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x142f('0x8'));var _=require(_0x142f('0x9'));var squel=require(_0x142f('0xa'));var crypto=require(_0x142f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x142f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x142f('0xd'));var Papa=require('papaparse');var Redis=require(_0x142f('0xe'));var authService=require(_0x142f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x142f('0x10'));var hardwareService=require(_0x142f('0x11'));var logger=require(_0x142f('0x12'))('api');var utils=require(_0x142f('0x13'));var config=require(_0x142f('0x14'));var licenseUtil=require(_0x142f('0x15'));var db=require(_0x142f('0x16'))['db'];function respondWithStatusCode(_0x4ce120,_0x29d653){_0x29d653=_0x29d653||0xcc;return function(_0x341d8e){if(_0x341d8e){return _0x4ce120[_0x142f('0x17')](_0x29d653);}return _0x4ce120['status'](_0x29d653)['end']();};}function respondWithResult(_0x344c8a,_0x6fdbb6){_0x6fdbb6=_0x6fdbb6||0xc8;return function(_0x875dea){if(_0x875dea){return _0x344c8a[_0x142f('0x18')](_0x6fdbb6)[_0x142f('0x19')](_0x875dea);}};}function respondWithFilteredResult(_0x1fdcdb,_0x3335ca){return function(_0x1f866f){if(_0x1f866f){var _0x51d353=typeof _0x3335ca[_0x142f('0x1a')]===_0x142f('0x1b')&&typeof _0x3335ca[_0x142f('0x1c')]===_0x142f('0x1b');var _0xe476fe=_0x1f866f[_0x142f('0x1d')];var _0x2a3980=_0x51d353?0x0:_0x3335ca[_0x142f('0x1a')];var _0x189d01=_0x51d353?_0x1f866f[_0x142f('0x1d')]:_0x3335ca['offset']+_0x3335ca[_0x142f('0x1c')];var _0x51d8b1;if(_0x189d01>=_0xe476fe){_0x189d01=_0xe476fe;_0x51d8b1=0xc8;}else{_0x51d8b1=0xce;}_0x1fdcdb[_0x142f('0x18')](_0x51d8b1);return _0x1fdcdb[_0x142f('0x1e')](_0x142f('0x1f'),_0x2a3980+'-'+_0x189d01+'/'+_0xe476fe)['json'](_0x1f866f);}return null;};}function patchUpdates(_0x3d9136){return function(_0x3a849f){try{jsonpatch[_0x142f('0x20')](_0x3a849f,_0x3d9136,!![]);}catch(_0x1a6488){return BPromise[_0x142f('0x21')](_0x1a6488);}return _0x3a849f['save']();};}function saveUpdates(_0x147d81,_0x1e74cb){return function(_0x533561){if(_0x533561){return _0x533561[_0x142f('0x22')](_0x147d81)[_0x142f('0x23')](function(_0x17e259){return _0x17e259;});}return null;};}function removeEntity(_0x1503ed,_0x18bdf0){return function(_0x318095){if(_0x318095){return _0x318095['destroy']()[_0x142f('0x23')](function(){_0x1503ed[_0x142f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6546,_0x99dcca){return function(_0x1bf050){if(!_0x1bf050){_0x5e6546['sendStatus'](0x194);}return _0x1bf050;};}function handleError(_0x7e08d6,_0x1ec1df){_0x1ec1df=_0x1ec1df||0x1f4;return function(_0x191535){logger[_0x142f('0x24')](_0x191535['stack']);if(_0x191535[_0x142f('0x25')]){delete _0x191535[_0x142f('0x25')];}_0x7e08d6[_0x142f('0x18')](_0x1ec1df)[_0x142f('0x26')](_0x191535);};}exports[_0x142f('0x27')]=function(_0x224f78,_0x4a3376){var _0x5cab5d={},_0x4c8f23={},_0x32bed3={'count':0x0,'rows':[]};var _0x1f050d=_[_0x142f('0x28')](db[_0x142f('0x29')][_0x142f('0x2a')],function(_0x47a220){return{'name':_0x47a220[_0x142f('0x2b')],'type':_0x47a220[_0x142f('0x2c')]['key']};});_0x4c8f23[_0x142f('0x2d')]=_[_0x142f('0x28')](_0x1f050d,_0x142f('0x25'));_0x4c8f23['query']=_[_0x142f('0x2e')](_0x224f78[_0x142f('0x2f')]);_0x4c8f23[_0x142f('0x30')]=_[_0x142f('0x31')](_0x4c8f23[_0x142f('0x2d')],_0x4c8f23[_0x142f('0x2f')]);_0x5cab5d[_0x142f('0x32')]=_['intersection'](_0x4c8f23[_0x142f('0x2d')],qs[_0x142f('0x33')](_0x224f78[_0x142f('0x2f')][_0x142f('0x33')]));_0x5cab5d[_0x142f('0x32')]=_0x5cab5d['attributes'][_0x142f('0x34')]?_0x5cab5d[_0x142f('0x32')]:_0x4c8f23['model'];if(!_0x224f78[_0x142f('0x2f')][_0x142f('0x35')](_0x142f('0x36'))){_0x5cab5d[_0x142f('0x1c')]=qs[_0x142f('0x1c')](_0x224f78[_0x142f('0x2f')]['limit']);_0x5cab5d[_0x142f('0x1a')]=qs[_0x142f('0x1a')](_0x224f78['query']['offset']);}_0x5cab5d['order']=qs['sort'](_0x224f78[_0x142f('0x2f')][_0x142f('0x37')]);_0x5cab5d[_0x142f('0x38')]=qs['filters'](_[_0x142f('0x39')](_0x224f78[_0x142f('0x2f')],_0x4c8f23[_0x142f('0x30')]),_0x1f050d);if(_0x224f78['query'][_0x142f('0x3a')]){_0x5cab5d['where']=_[_0x142f('0x3b')](_0x5cab5d[_0x142f('0x38')],{'$or':_[_0x142f('0x28')](_0x1f050d,function(_0x304805){if(_0x304805[_0x142f('0x2c')]!==_0x142f('0x3c')){var _0x5f1cbe={};_0x5f1cbe[_0x304805[_0x142f('0x25')]]={'$like':'%'+_0x224f78[_0x142f('0x2f')][_0x142f('0x3a')]+'%'};return _0x5f1cbe;}})});}_0x5cab5d=_[_0x142f('0x3b')]({},_0x5cab5d,_0x224f78[_0x142f('0x3d')]);var _0x11aac8={'where':_0x5cab5d[_0x142f('0x38')]};return db[_0x142f('0x29')][_0x142f('0x1d')](_0x11aac8)['then'](function(_0x4d6fb4){_0x32bed3['count']=_0x4d6fb4;if(_0x224f78[_0x142f('0x2f')][_0x142f('0x3e')]){_0x5cab5d[_0x142f('0x3f')]=[{'all':!![]}];}return db[_0x142f('0x29')][_0x142f('0x40')](_0x5cab5d);})[_0x142f('0x23')](function(_0x42ae45){_0x32bed3['rows']=_0x42ae45;return _0x32bed3;})[_0x142f('0x23')](respondWithFilteredResult(_0x4a3376,_0x5cab5d))[_0x142f('0x41')](handleError(_0x4a3376,null));};exports[_0x142f('0x42')]=function(_0x10aa9d,_0x4be260){var _0x19075b={'raw':!![],'where':{'id':_0x10aa9d['params']['id']}},_0x3f203b={};_0x3f203b[_0x142f('0x2d')]=_[_0x142f('0x2e')](db[_0x142f('0x29')][_0x142f('0x2a')]);_0x3f203b[_0x142f('0x2f')]=_['keys'](_0x10aa9d[_0x142f('0x2f')]);_0x3f203b[_0x142f('0x30')]=_[_0x142f('0x31')](_0x3f203b[_0x142f('0x2d')],_0x3f203b[_0x142f('0x2f')]);_0x19075b[_0x142f('0x32')]=_[_0x142f('0x31')](_0x3f203b[_0x142f('0x2d')],qs['fields'](_0x10aa9d[_0x142f('0x2f')][_0x142f('0x33')]));_0x19075b[_0x142f('0x32')]=_0x19075b['attributes'][_0x142f('0x34')]?_0x19075b[_0x142f('0x32')]:_0x3f203b['model'];if(_0x10aa9d['query'][_0x142f('0x3e')]){_0x19075b[_0x142f('0x3f')]=[{'all':!![]}];}_0x19075b=_[_0x142f('0x3b')]({},_0x19075b,_0x10aa9d[_0x142f('0x3d')]);return db[_0x142f('0x29')][_0x142f('0x43')](_0x19075b)[_0x142f('0x23')](handleEntityNotFound(_0x4be260,null))[_0x142f('0x23')](respondWithResult(_0x4be260,null))[_0x142f('0x41')](handleError(_0x4be260,null));};exports[_0x142f('0x44')]=function(_0x515c94,_0x7b0fd){return db[_0x142f('0x29')][_0x142f('0x44')](_0x515c94[_0x142f('0x45')],{})[_0x142f('0x23')](respondWithResult(_0x7b0fd,0xc9))[_0x142f('0x41')](handleError(_0x7b0fd,null));};exports['update']=function(_0x2c1954,_0x1e7bd2){if(_0x2c1954[_0x142f('0x45')]['id']){delete _0x2c1954[_0x142f('0x45')]['id'];}return db[_0x142f('0x29')][_0x142f('0x43')]({'where':{'id':_0x2c1954[_0x142f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e7bd2,null))[_0x142f('0x23')](saveUpdates(_0x2c1954[_0x142f('0x45')],null))[_0x142f('0x23')](respondWithResult(_0x1e7bd2,null))['catch'](handleError(_0x1e7bd2,null));};exports['destroy']=function(_0x1cace1,_0x3e0e22){return db[_0x142f('0x29')][_0x142f('0x43')]({'where':{'id':_0x1cace1[_0x142f('0x46')]['id']}})[_0x142f('0x23')](handleEntityNotFound(_0x3e0e22,null))[_0x142f('0x23')](removeEntity(_0x3e0e22,null))[_0x142f('0x41')](handleError(_0x3e0e22,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4f52675..36e31f0 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 _0x0f20=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x576a45,_0x53ecfb){var _0xfd57a8=function(_0x2ae596){while(--_0x2ae596){_0x576a45['push'](_0x576a45['shift']());}};_0xfd57a8(++_0x53ecfb);}(_0x0f20,0x1f3));var _0x00f2=function(_0x3fc4d9,_0x2a7608){_0x3fc4d9=_0x3fc4d9-0x0;var _0x40a4af=_0x0f20[_0x3fc4d9];return _0x40a4af;};'use strict';var _=require('lodash');var util=require(_0x00f2('0x0'));var logger=require('../../config/logger')(_0x00f2('0x1'));var moment=require('moment');var BPromise=require(_0x00f2('0x2'));var rp=require(_0x00f2('0x3'));var fs=require('fs');var path=require(_0x00f2('0x4'));var rimraf=require(_0x00f2('0x5'));var config=require(_0x00f2('0x6'));var attributes=require(_0x00f2('0x7'));module['exports']=function(_0x44f65b,_0x356c37){return _0x44f65b['define'](_0x00f2('0x8'),attributes,{'tableName':_0x00f2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd139=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','../../config/logger','bluebird','path'];(function(_0x3eb800,_0x263792){var _0x32b52f=function(_0x5d6ae3){while(--_0x5d6ae3){_0x3eb800['push'](_0x3eb800['shift']());}};_0x32b52f(++_0x263792);}(_0xd139,0x7e));var _0x9d13=function(_0x4c687d,_0x9d62f){_0x4c687d=_0x4c687d-0x0;var _0x1ae390=_0xd139[_0x4c687d];return _0x1ae390;};'use strict';var _=require(_0x9d13('0x0'));var util=require('util');var logger=require(_0x9d13('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9d13('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d13('0x3'));var rimraf=require(_0x9d13('0x4'));var config=require(_0x9d13('0x5'));var attributes=require(_0x9d13('0x6'));module[_0x9d13('0x7')]=function(_0x542a75,_0x416eff){return _0x542a75[_0x9d13('0x8')](_0x9d13('0x9'),attributes,{'tableName':'analytics_report_trees','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 37a21a3..d6bd954 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3246f4,_0x38d29f){var _0xaffa35=function(_0x512f5e){while(--_0x512f5e){_0x3246f4['push'](_0x3246f4['shift']());}};_0xaffa35(++_0x38d29f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x436713,_0x16e96c){var _0x5661b7=function(_0x2ede72){while(--_0x2ede72){_0x436713['push'](_0x436713['shift']());}};_0x5661b7(++_0x16e96c);}(_0xdb28,0x106));var _0x8db2=function(_0x441183,_0x5bb7f9){_0x441183=_0x441183-0x0;var _0x294587=_0xdb28[_0x441183];return _0x294587;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index a496854..76be789 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 _0x4b79=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40632f,_0x38ba11){var _0x399524=function(_0x1eae59){while(--_0x1eae59){_0x40632f['push'](_0x40632f['shift']());}};_0x399524(++_0x38ba11);}(_0x4b79,0xf6));var _0x94b7=function(_0x43fa03,_0x4d1ab2){_0x43fa03=_0x43fa03-0x0;var _0x570966=_0x4b79[_0x43fa03];return _0x570966;};'use strict';var multer=require(_0x94b7('0x0'));var util=require(_0x94b7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x94b7('0x2'));var router=express['Router']();var fs_extra=require(_0x94b7('0x3'));var auth=require(_0x94b7('0x4'));var interaction=require(_0x94b7('0x5'));var config=require(_0x94b7('0x6'));var controller=require(_0x94b7('0x7'));router[_0x94b7('0x8')]('/',auth[_0x94b7('0x9')](),controller[_0x94b7('0xa')]);router[_0x94b7('0x8')](_0x94b7('0xb'),auth[_0x94b7('0x9')](),controller[_0x94b7('0xc')]);router[_0x94b7('0xd')]('/',auth[_0x94b7('0x9')](),controller[_0x94b7('0xe')]);router[_0x94b7('0xf')](_0x94b7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x94b7('0x10')](_0x94b7('0xb'),auth['isAuthenticated'](),controller[_0x94b7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0d1b=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x38c6b4,_0x8a6bca){var _0x4c45e4=function(_0x9cf700){while(--_0x9cf700){_0x38c6b4['push'](_0x38c6b4['shift']());}};_0x4c45e4(++_0x8a6bca);}(_0x0d1b,0x8f));var _0xb0d1=function(_0x385edd,_0x2a40e1){_0x385edd=_0x385edd-0x0;var _0x3083d0=_0x0d1b[_0x385edd];return _0x3083d0;};'use strict';var multer=require('multer');var util=require(_0xb0d1('0x0'));var path=require(_0xb0d1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb0d1('0x2')]();var fs_extra=require(_0xb0d1('0x3'));var auth=require(_0xb0d1('0x4'));var interaction=require(_0xb0d1('0x5'));var config=require(_0xb0d1('0x6'));var controller=require(_0xb0d1('0x7'));router[_0xb0d1('0x8')]('/',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xa')]);router['get'](_0xb0d1('0xb'),auth['isAuthenticated'](),controller[_0xb0d1('0xc')]);router[_0xb0d1('0xd')]('/',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xe')]);router['put']('/:id',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xf')]);router[_0xb0d1('0x10')](_0xb0d1('0xb'),auth[_0xb0d1('0x9')](),controller[_0xb0d1('0x11')]);module[_0xb0d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 1a0a963..b0b041e 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 _0x7217=['STRING'];(function(_0x503fbf,_0x9a02a9){var _0x229354=function(_0x25899c){while(--_0x25899c){_0x503fbf['push'](_0x503fbf['shift']());}};_0x229354(++_0x9a02a9);}(_0x7217,0xa9));var _0x7721=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7217[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7721('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7721('0x0')]}}; \ No newline at end of file +var _0xf675=['STRING','sequelize','exports'];(function(_0x4d3de3,_0x1ea983){var _0x36becc=function(_0x537964){while(--_0x537964){_0x4d3de3['push'](_0x4d3de3['shift']());}};_0x36becc(++_0x1ea983);}(_0xf675,0x199));var _0x5f67=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xf675[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'name':{'type':Sequelize[_0x5f67('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5f67('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index faa504b..960b2ae 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 _0xeac6=['include','findAll','rows','catch','show','keys','find','clone','params','omit','createdAt','updatedAt','create','body','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Attachment','includeAll'];(function(_0x2001fd,_0x34967a){var _0x8d3fe0=function(_0x1f255d){while(--_0x1f255d){_0x2001fd['push'](_0x2001fd['shift']());}};_0x8d3fe0(++_0x34967a);}(_0xeac6,0x12c));var _0x6eac=function(_0x53b5ea,_0x3f5afc){_0x53b5ea=_0x53b5ea-0x0;var _0xf9b810=_0xeac6[_0x53b5ea];return _0xf9b810;};'use strict';var emlformat=require(_0x6eac('0x0'));var rimraf=require(_0x6eac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6eac('0x2'));var moment=require(_0x6eac('0x3'));var BPromise=require(_0x6eac('0x4'));var Mustache=require('mustache');var util=require(_0x6eac('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6eac('0x6'));var ejs=require(_0x6eac('0x7'));var fs=require('fs');var fs_extra=require(_0x6eac('0x8'));var _=require(_0x6eac('0x9'));var squel=require(_0x6eac('0xa'));var crypto=require('crypto');var jsforce=require(_0x6eac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6eac('0x6'));var querystring=require(_0x6eac('0xc'));var Papa=require('papaparse');var Redis=require(_0x6eac('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6eac('0xe'));var as=require(_0x6eac('0xf'));var hardwareService=require(_0x6eac('0x10'));var logger=require(_0x6eac('0x11'))(_0x6eac('0x12'));var utils=require(_0x6eac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6eac('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4522f1,_0x416f87){_0x416f87=_0x416f87||0xcc;return function(_0x18578c){if(_0x18578c){return _0x4522f1[_0x6eac('0x15')](_0x416f87);}return _0x4522f1[_0x6eac('0x16')](_0x416f87)['end']();};}function respondWithResult(_0x465060,_0x1c1ae7){_0x1c1ae7=_0x1c1ae7||0xc8;return function(_0x5f3fe3){if(_0x5f3fe3){return _0x465060['status'](_0x1c1ae7)[_0x6eac('0x17')](_0x5f3fe3);}};}function respondWithFilteredResult(_0x181502,_0x1dcd4f){return function(_0x56865e){if(_0x56865e){var _0x555d6a=typeof _0x1dcd4f[_0x6eac('0x18')]===_0x6eac('0x19')&&typeof _0x1dcd4f[_0x6eac('0x1a')]===_0x6eac('0x19');var _0x1166ff=_0x56865e[_0x6eac('0x1b')];var _0x5efba6=_0x555d6a?0x0:_0x1dcd4f[_0x6eac('0x18')];var _0x3ce9ff=_0x555d6a?_0x56865e['count']:_0x1dcd4f[_0x6eac('0x18')]+_0x1dcd4f[_0x6eac('0x1a')];var _0x1f0c28;if(_0x3ce9ff>=_0x1166ff){_0x3ce9ff=_0x1166ff;_0x1f0c28=0xc8;}else{_0x1f0c28=0xce;}_0x181502[_0x6eac('0x16')](_0x1f0c28);return _0x181502[_0x6eac('0x1c')](_0x6eac('0x1d'),_0x5efba6+'-'+_0x3ce9ff+'/'+_0x1166ff)[_0x6eac('0x17')](_0x56865e);}return null;};}function patchUpdates(_0x232b6d){return function(_0x1ab1af){try{jsonpatch['apply'](_0x1ab1af,_0x232b6d,!![]);}catch(_0x5259aa){return BPromise[_0x6eac('0x1e')](_0x5259aa);}return _0x1ab1af[_0x6eac('0x1f')]();};}function saveUpdates(_0x33ca5c,_0xc38480){return function(_0x3a6d34){if(_0x3a6d34){return _0x3a6d34[_0x6eac('0x20')](_0x33ca5c)[_0x6eac('0x21')](function(_0x4d52a5){return _0x4d52a5;});}return null;};}function removeEntity(_0x2f9a3f,_0x21c5be){return function(_0x32cdb9){if(_0x32cdb9){return _0x32cdb9['destroy']()[_0x6eac('0x21')](function(){_0x2f9a3f['status'](0xcc)[_0x6eac('0x22')]();});}};}function handleEntityNotFound(_0x558131,_0x29de3f){return function(_0x5bf2a7){if(!_0x5bf2a7){_0x558131[_0x6eac('0x15')](0x194);}return _0x5bf2a7;};}function handleError(_0x596a99,_0x523ecd){_0x523ecd=_0x523ecd||0x1f4;return function(_0x20efdb){logger[_0x6eac('0x23')](_0x20efdb[_0x6eac('0x24')]);if(_0x20efdb['name']){delete _0x20efdb[_0x6eac('0x25')];}_0x596a99[_0x6eac('0x16')](_0x523ecd)[_0x6eac('0x26')](_0x20efdb);};}exports[_0x6eac('0x27')]=function(_0x5dc188,_0x21a4b5){var _0x26f749={},_0x565278={},_0x320ad4={'count':0x0,'rows':[]};var _0x876a5b=_['map'](db['Attachment'][_0x6eac('0x28')],function(_0x280343){return{'name':_0x280343[_0x6eac('0x29')],'type':_0x280343[_0x6eac('0x2a')][_0x6eac('0x2b')]};});_0x565278['model']=_[_0x6eac('0x2c')](_0x876a5b,_0x6eac('0x25'));_0x565278[_0x6eac('0x2d')]=_['keys'](_0x5dc188[_0x6eac('0x2d')]);_0x565278['filters']=_[_0x6eac('0x2e')](_0x565278[_0x6eac('0x2f')],_0x565278[_0x6eac('0x2d')]);_0x26f749[_0x6eac('0x30')]=_['intersection'](_0x565278[_0x6eac('0x2f')],qs['fields'](_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x31')]));_0x26f749['attributes']=_0x26f749[_0x6eac('0x30')][_0x6eac('0x32')]?_0x26f749[_0x6eac('0x30')]:_0x565278[_0x6eac('0x2f')];if(!_0x5dc188['query'][_0x6eac('0x33')](_0x6eac('0x34'))){_0x26f749[_0x6eac('0x1a')]=qs[_0x6eac('0x1a')](_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x1a')]);_0x26f749[_0x6eac('0x18')]=qs['offset'](_0x5dc188['query'][_0x6eac('0x18')]);}_0x26f749[_0x6eac('0x35')]=qs[_0x6eac('0x36')](_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x36')]);_0x26f749[_0x6eac('0x37')]=qs[_0x6eac('0x38')](_[_0x6eac('0x39')](_0x5dc188[_0x6eac('0x2d')],_0x565278[_0x6eac('0x38')]),_0x876a5b);if(_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x3a')]){_0x26f749[_0x6eac('0x37')]=_[_0x6eac('0x3b')](_0x26f749[_0x6eac('0x37')],{'$or':_['map'](_0x876a5b,function(_0x393161){if(_0x393161['type']!==_0x6eac('0x3c')){var _0x39026b={};_0x39026b[_0x393161[_0x6eac('0x25')]]={'$like':'%'+_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x3a')]+'%'};return _0x39026b;}})});}_0x26f749=_[_0x6eac('0x3b')]({},_0x26f749,_0x5dc188[_0x6eac('0x3d')]);var _0x5a752a={'where':_0x26f749[_0x6eac('0x37')]};return db[_0x6eac('0x3e')]['count'](_0x5a752a)[_0x6eac('0x21')](function(_0xde430e){_0x320ad4[_0x6eac('0x1b')]=_0xde430e;if(_0x5dc188[_0x6eac('0x2d')][_0x6eac('0x3f')]){_0x26f749[_0x6eac('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x6eac('0x41')](_0x26f749);})['then'](function(_0x405b61){_0x320ad4[_0x6eac('0x42')]=_0x405b61;return _0x320ad4;})['then'](respondWithFilteredResult(_0x21a4b5,_0x26f749))[_0x6eac('0x43')](handleError(_0x21a4b5,null));};exports[_0x6eac('0x44')]=function(_0x398a4f,_0x5e9228){var _0x16f649={'raw':!![],'where':{'id':_0x398a4f['params']['id']}},_0xe32783={};_0xe32783[_0x6eac('0x2f')]=_[_0x6eac('0x45')](db[_0x6eac('0x3e')][_0x6eac('0x28')]);_0xe32783[_0x6eac('0x2d')]=_[_0x6eac('0x45')](_0x398a4f[_0x6eac('0x2d')]);_0xe32783['filters']=_[_0x6eac('0x2e')](_0xe32783[_0x6eac('0x2f')],_0xe32783[_0x6eac('0x2d')]);_0x16f649[_0x6eac('0x30')]=_[_0x6eac('0x2e')](_0xe32783[_0x6eac('0x2f')],qs[_0x6eac('0x31')](_0x398a4f[_0x6eac('0x2d')][_0x6eac('0x31')]));_0x16f649['attributes']=_0x16f649[_0x6eac('0x30')]['length']?_0x16f649[_0x6eac('0x30')]:_0xe32783[_0x6eac('0x2f')];if(_0x398a4f[_0x6eac('0x2d')][_0x6eac('0x3f')]){_0x16f649['include']=[{'all':!![]}];}_0x16f649=_[_0x6eac('0x3b')]({},_0x16f649,_0x398a4f[_0x6eac('0x3d')]);return db['Attachment'][_0x6eac('0x46')](_0x16f649)[_0x6eac('0x21')](handleEntityNotFound(_0x5e9228,null))[_0x6eac('0x21')](respondWithResult(_0x5e9228,null))[_0x6eac('0x43')](handleError(_0x5e9228,null));};exports[_0x6eac('0x47')]=function(_0x4ad94e,_0x2f8259){var _0x4a0f80={'where':{'id':_0x4ad94e[_0x6eac('0x48')]['id']}},_0x1ef969={};_0x1ef969[_0x6eac('0x2f')]=_[_0x6eac('0x45')](db[_0x6eac('0x3e')][_0x6eac('0x28')]);_0x4a0f80[_0x6eac('0x30')]=_[_0x6eac('0x2e')](_0x1ef969[_0x6eac('0x2f')],qs['fields'](_0x4ad94e[_0x6eac('0x2d')][_0x6eac('0x31')]));_0x4a0f80[_0x6eac('0x30')]=_0x4a0f80[_0x6eac('0x30')][_0x6eac('0x32')]?_0x4a0f80['attributes']:_0x1ef969[_0x6eac('0x2f')];if(_0x4ad94e[_0x6eac('0x2d')][_0x6eac('0x3f')]){_0x4a0f80['include']=[{'all':!![]}];}_0x4a0f80=_[_0x6eac('0x3b')]({},_0x4a0f80,_0x4ad94e[_0x6eac('0x3d')]);return db[_0x6eac('0x3e')]['find'](_0x4a0f80)[_0x6eac('0x21')](handleEntityNotFound(_0x2f8259,null))['then'](function(_0x4b7c71){if(_0x4b7c71){var _0x45b559=_0x4b7c71['get']({'plain':!![]});_0x45b559=qs[_0x6eac('0x49')](_0x45b559,['id',_0x6eac('0x4a'),_0x6eac('0x4b')]);_0x4ad94e['body']=_[_0x6eac('0x49')](_0x4ad94e['body'],['id','createdAt',_0x6eac('0x4b')]);return db[_0x6eac('0x3e')][_0x6eac('0x4c')](_[_0x6eac('0x3b')](_0x45b559,_0x4ad94e[_0x6eac('0x4d')]),{'include':_0x4ad94e[_0x6eac('0x2d')][_0x6eac('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2f8259,0xc9))['catch'](handleError(_0x2f8259,null));};exports['update']=function(_0x49e3d1,_0x286ece){if(_0x49e3d1[_0x6eac('0x4d')]['id']){delete _0x49e3d1[_0x6eac('0x4d')]['id'];}return db[_0x6eac('0x3e')][_0x6eac('0x46')]({'where':{'id':_0x49e3d1['params']['id']}})[_0x6eac('0x21')](handleEntityNotFound(_0x286ece,null))['then'](saveUpdates(_0x49e3d1[_0x6eac('0x4d')],null))[_0x6eac('0x21')](respondWithResult(_0x286ece,null))[_0x6eac('0x43')](handleError(_0x286ece,null));};exports[_0x6eac('0x4e')]=function(_0x47b52d,_0x789c56){return db[_0x6eac('0x3e')][_0x6eac('0x46')]({'where':{'id':_0x47b52d[_0x6eac('0x48')]['id']}})[_0x6eac('0x21')](handleEntityNotFound(_0x789c56,null))[_0x6eac('0x21')](removeEntity(_0x789c56,null))[_0x6eac('0x43')](handleError(_0x789c56,null));};exports[_0x6eac('0x4c')]=function(_0x5d2754,_0x2d00a2,_0x42e283){_0x5d2754[_0x6eac('0x4d')][_0x6eac('0x25')]=_0x5d2754[_0x6eac('0x4f')][_0x6eac('0x50')];_0x5d2754[_0x6eac('0x4d')][_0x6eac('0x51')]=_0x5d2754[_0x6eac('0x4f')][_0x6eac('0x52')];_0x5d2754[_0x6eac('0x4d')][_0x6eac('0x2a')]=_0x5d2754[_0x6eac('0x4f')][_0x6eac('0x53')];return db['Attachment'][_0x6eac('0x4c')](_0x5d2754[_0x6eac('0x4d')])[_0x6eac('0x21')](respondWithResult(_0x2d00a2,0xc9))['catch'](handleError(_0x2d00a2,null));};exports[_0x6eac('0x54')]=function(_0x3bfa7d,_0x8938f0,_0x49d4da){return db[_0x6eac('0x3e')][_0x6eac('0x55')]({'where':{'id':_0x3bfa7d[_0x6eac('0x48')]['id']},'raw':!![]})[_0x6eac('0x21')](handleEntityNotFound(_0x8938f0,null))[_0x6eac('0x21')](function(_0x3085e7){if(_0x3085e7){var _0x5d1981=_0x3085e7[_0x6eac('0x56')]!==null;var _0x5cd70c=path[_0x6eac('0x57')](config[_0x6eac('0x58')],_0x6eac('0x59'));if(_0x5d1981){_0x5cd70c=path[_0x6eac('0x57')](_0x5cd70c,_0x6eac('0x5a'));}var _0x62fe24=path[_0x6eac('0x57')](_0x5cd70c,_0x3085e7[_0x6eac('0x51')]);return _0x8938f0[_0x6eac('0x54')](_0x62fe24);}})[_0x6eac('0x43')](handleError(_0x8938f0,null));}; \ No newline at end of file +var _0xf675=['findAll','catch','show','params','find','get','omit','body','createdAt','create','file','originalname','mimetype','join','root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0x179038,_0x2cd85e){var _0x2a4761=function(_0x258601){while(--_0x258601){_0x179038['push'](_0x179038['shift']());}};_0x2a4761(++_0x2cd85e);}(_0xf675,0x163));var _0x5f67=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xf675[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require(_0x5f67('0x1'));var zipdir=require(_0x5f67('0x2'));var jsonpatch=require(_0x5f67('0x3'));var rp=require('request-promise');var moment=require(_0x5f67('0x4'));var BPromise=require(_0x5f67('0x5'));var Mustache=require(_0x5f67('0x6'));var util=require(_0x5f67('0x7'));var path=require(_0x5f67('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f67('0x9'));var _=require(_0x5f67('0xa'));var squel=require(_0x5f67('0xb'));var crypto=require(_0x5f67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f67('0xd'));var querystring=require(_0x5f67('0xe'));var Papa=require(_0x5f67('0xf'));var Redis=require(_0x5f67('0x10'));var authService=require(_0x5f67('0x11'));var qs=require(_0x5f67('0x12'));var as=require(_0x5f67('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f67('0x14'))(_0x5f67('0x15'));var utils=require(_0x5f67('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f67('0x17'))['db'];function respondWithStatusCode(_0x3a62da,_0x3856df){_0x3856df=_0x3856df||0xcc;return function(_0x284d7e){if(_0x284d7e){return _0x3a62da['sendStatus'](_0x3856df);}return _0x3a62da[_0x5f67('0x18')](_0x3856df)['end']();};}function respondWithResult(_0x4854ae,_0x424790){_0x424790=_0x424790||0xc8;return function(_0x4208ae){if(_0x4208ae){return _0x4854ae[_0x5f67('0x18')](_0x424790)[_0x5f67('0x19')](_0x4208ae);}};}function respondWithFilteredResult(_0x291f4e,_0x5949bf){return function(_0x43b7c9){if(_0x43b7c9){var _0x39542c=typeof _0x5949bf['offset']===_0x5f67('0x1a')&&typeof _0x5949bf[_0x5f67('0x1b')]===_0x5f67('0x1a');var _0x1feb20=_0x43b7c9[_0x5f67('0x1c')];var _0x251e1b=_0x39542c?0x0:_0x5949bf['offset'];var _0x4d764e=_0x39542c?_0x43b7c9[_0x5f67('0x1c')]:_0x5949bf[_0x5f67('0x1d')]+_0x5949bf[_0x5f67('0x1b')];var _0x5a17f9;if(_0x4d764e>=_0x1feb20){_0x4d764e=_0x1feb20;_0x5a17f9=0xc8;}else{_0x5a17f9=0xce;}_0x291f4e[_0x5f67('0x18')](_0x5a17f9);return _0x291f4e['set']('Content-Range',_0x251e1b+'-'+_0x4d764e+'/'+_0x1feb20)[_0x5f67('0x19')](_0x43b7c9);}return null;};}function patchUpdates(_0x455703){return function(_0x4be9be){try{jsonpatch[_0x5f67('0x1e')](_0x4be9be,_0x455703,!![]);}catch(_0x1eeeab){return BPromise[_0x5f67('0x1f')](_0x1eeeab);}return _0x4be9be[_0x5f67('0x20')]();};}function saveUpdates(_0x3d10dd,_0x3b691a){return function(_0x166027){if(_0x166027){return _0x166027[_0x5f67('0x21')](_0x3d10dd)[_0x5f67('0x22')](function(_0x461a2b){return _0x461a2b;});}return null;};}function removeEntity(_0x2f0842,_0x8f1b69){return function(_0x5968a4){if(_0x5968a4){return _0x5968a4[_0x5f67('0x23')]()[_0x5f67('0x22')](function(){_0x2f0842[_0x5f67('0x18')](0xcc)[_0x5f67('0x24')]();});}};}function handleEntityNotFound(_0x2f3e27,_0x29f177){return function(_0x4ed5b0){if(!_0x4ed5b0){_0x2f3e27[_0x5f67('0x25')](0x194);}return _0x4ed5b0;};}function handleError(_0x5ad2eb,_0x20e846){_0x20e846=_0x20e846||0x1f4;return function(_0x4b18cb){logger['error'](_0x4b18cb[_0x5f67('0x26')]);if(_0x4b18cb[_0x5f67('0x27')]){delete _0x4b18cb['name'];}_0x5ad2eb[_0x5f67('0x18')](_0x20e846)[_0x5f67('0x28')](_0x4b18cb);};}exports[_0x5f67('0x29')]=function(_0x19e00b,_0x193b93){var _0x4b2dc1={},_0x37e4f5={},_0x326d0d={'count':0x0,'rows':[]};var _0x127c7a=_[_0x5f67('0x2a')](db[_0x5f67('0x2b')][_0x5f67('0x2c')],function(_0x137584){return{'name':_0x137584[_0x5f67('0x2d')],'type':_0x137584[_0x5f67('0x2e')]['key']};});_0x37e4f5[_0x5f67('0x2f')]=_['map'](_0x127c7a,_0x5f67('0x27'));_0x37e4f5[_0x5f67('0x30')]=_[_0x5f67('0x31')](_0x19e00b[_0x5f67('0x30')]);_0x37e4f5['filters']=_[_0x5f67('0x32')](_0x37e4f5[_0x5f67('0x2f')],_0x37e4f5[_0x5f67('0x30')]);_0x4b2dc1[_0x5f67('0x33')]=_[_0x5f67('0x32')](_0x37e4f5['model'],qs[_0x5f67('0x34')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x34')]));_0x4b2dc1['attributes']=_0x4b2dc1[_0x5f67('0x33')][_0x5f67('0x35')]?_0x4b2dc1[_0x5f67('0x33')]:_0x37e4f5[_0x5f67('0x2f')];if(!_0x19e00b[_0x5f67('0x30')][_0x5f67('0x36')]('nolimit')){_0x4b2dc1[_0x5f67('0x1b')]=qs[_0x5f67('0x1b')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x1b')]);_0x4b2dc1[_0x5f67('0x1d')]=qs[_0x5f67('0x1d')](_0x19e00b['query'][_0x5f67('0x1d')]);}_0x4b2dc1[_0x5f67('0x37')]=qs[_0x5f67('0x38')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x38')]);_0x4b2dc1['where']=qs[_0x5f67('0x39')](_[_0x5f67('0x3a')](_0x19e00b[_0x5f67('0x30')],_0x37e4f5[_0x5f67('0x39')]),_0x127c7a);if(_0x19e00b[_0x5f67('0x30')][_0x5f67('0x3b')]){_0x4b2dc1[_0x5f67('0x3c')]=_[_0x5f67('0x3d')](_0x4b2dc1[_0x5f67('0x3c')],{'$or':_[_0x5f67('0x2a')](_0x127c7a,function(_0x21ab76){if(_0x21ab76[_0x5f67('0x2e')]!==_0x5f67('0x3e')){var _0x580867={};_0x580867[_0x21ab76[_0x5f67('0x27')]]={'$like':'%'+_0x19e00b[_0x5f67('0x30')][_0x5f67('0x3b')]+'%'};return _0x580867;}})});}_0x4b2dc1=_[_0x5f67('0x3d')]({},_0x4b2dc1,_0x19e00b['options']);var _0x5334af={'where':_0x4b2dc1[_0x5f67('0x3c')]};return db[_0x5f67('0x2b')][_0x5f67('0x1c')](_0x5334af)['then'](function(_0x342cca){_0x326d0d[_0x5f67('0x1c')]=_0x342cca;if(_0x19e00b['query'][_0x5f67('0x3f')]){_0x4b2dc1[_0x5f67('0x40')]=[{'all':!![]}];}return db[_0x5f67('0x2b')][_0x5f67('0x41')](_0x4b2dc1);})[_0x5f67('0x22')](function(_0x150f9a){_0x326d0d['rows']=_0x150f9a;return _0x326d0d;})[_0x5f67('0x22')](respondWithFilteredResult(_0x193b93,_0x4b2dc1))[_0x5f67('0x42')](handleError(_0x193b93,null));};exports[_0x5f67('0x43')]=function(_0x3a5b61,_0x5d030d){var _0x16ca2f={'raw':!![],'where':{'id':_0x3a5b61[_0x5f67('0x44')]['id']}},_0x2c79b1={};_0x2c79b1['model']=_[_0x5f67('0x31')](db[_0x5f67('0x2b')][_0x5f67('0x2c')]);_0x2c79b1[_0x5f67('0x30')]=_['keys'](_0x3a5b61['query']);_0x2c79b1[_0x5f67('0x39')]=_[_0x5f67('0x32')](_0x2c79b1[_0x5f67('0x2f')],_0x2c79b1['query']);_0x16ca2f[_0x5f67('0x33')]=_['intersection'](_0x2c79b1['model'],qs['fields'](_0x3a5b61[_0x5f67('0x30')][_0x5f67('0x34')]));_0x16ca2f[_0x5f67('0x33')]=_0x16ca2f[_0x5f67('0x33')][_0x5f67('0x35')]?_0x16ca2f['attributes']:_0x2c79b1[_0x5f67('0x2f')];if(_0x3a5b61['query'][_0x5f67('0x3f')]){_0x16ca2f[_0x5f67('0x40')]=[{'all':!![]}];}_0x16ca2f=_[_0x5f67('0x3d')]({},_0x16ca2f,_0x3a5b61['options']);return db['Attachment'][_0x5f67('0x45')](_0x16ca2f)[_0x5f67('0x22')](handleEntityNotFound(_0x5d030d,null))[_0x5f67('0x22')](respondWithResult(_0x5d030d,null))[_0x5f67('0x42')](handleError(_0x5d030d,null));};exports['clone']=function(_0x48988d,_0x4b0907){var _0x3fab09={'where':{'id':_0x48988d[_0x5f67('0x44')]['id']}},_0x104119={};_0x104119['model']=_[_0x5f67('0x31')](db[_0x5f67('0x2b')][_0x5f67('0x2c')]);_0x3fab09[_0x5f67('0x33')]=_['intersection'](_0x104119['model'],qs[_0x5f67('0x34')](_0x48988d['query'][_0x5f67('0x34')]));_0x3fab09[_0x5f67('0x33')]=_0x3fab09[_0x5f67('0x33')][_0x5f67('0x35')]?_0x3fab09[_0x5f67('0x33')]:_0x104119['model'];if(_0x48988d[_0x5f67('0x30')][_0x5f67('0x3f')]){_0x3fab09[_0x5f67('0x40')]=[{'all':!![]}];}_0x3fab09=_[_0x5f67('0x3d')]({},_0x3fab09,_0x48988d['options']);return db[_0x5f67('0x2b')][_0x5f67('0x45')](_0x3fab09)[_0x5f67('0x22')](handleEntityNotFound(_0x4b0907,null))[_0x5f67('0x22')](function(_0x23ade1){if(_0x23ade1){var _0x34b101=_0x23ade1[_0x5f67('0x46')]({'plain':!![]});_0x34b101=qs[_0x5f67('0x47')](_0x34b101,['id','createdAt','updatedAt']);_0x48988d[_0x5f67('0x48')]=_[_0x5f67('0x47')](_0x48988d[_0x5f67('0x48')],['id',_0x5f67('0x49'),'updatedAt']);return db[_0x5f67('0x2b')][_0x5f67('0x4a')](_[_0x5f67('0x3d')](_0x34b101,_0x48988d[_0x5f67('0x48')]),{'include':_0x48988d[_0x5f67('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5f67('0x22')](respondWithResult(_0x4b0907,0xc9))[_0x5f67('0x42')](handleError(_0x4b0907,null));};exports[_0x5f67('0x21')]=function(_0x465bae,_0x89060e){if(_0x465bae[_0x5f67('0x48')]['id']){delete _0x465bae['body']['id'];}return db[_0x5f67('0x2b')][_0x5f67('0x45')]({'where':{'id':_0x465bae['params']['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x89060e,null))[_0x5f67('0x22')](saveUpdates(_0x465bae[_0x5f67('0x48')],null))[_0x5f67('0x22')](respondWithResult(_0x89060e,null))[_0x5f67('0x42')](handleError(_0x89060e,null));};exports['destroy']=function(_0x19f4a4,_0x17d967){return db[_0x5f67('0x2b')][_0x5f67('0x45')]({'where':{'id':_0x19f4a4[_0x5f67('0x44')]['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x17d967,null))[_0x5f67('0x22')](removeEntity(_0x17d967,null))[_0x5f67('0x42')](handleError(_0x17d967,null));};exports['create']=function(_0x51257e,_0x823bfe,_0x2cb63b){_0x51257e['body'][_0x5f67('0x27')]=_0x51257e[_0x5f67('0x4b')][_0x5f67('0x4c')];_0x51257e['body']['basename']=_0x51257e[_0x5f67('0x4b')]['filename'];_0x51257e[_0x5f67('0x48')][_0x5f67('0x2e')]=_0x51257e['file'][_0x5f67('0x4d')];return db[_0x5f67('0x2b')]['create'](_0x51257e[_0x5f67('0x48')])[_0x5f67('0x22')](respondWithResult(_0x823bfe,0xc9))[_0x5f67('0x42')](handleError(_0x823bfe,null));};exports['download']=function(_0x37c5b3,_0x2128e7,_0x39e7cc){return db[_0x5f67('0x2b')]['findOne']({'where':{'id':_0x37c5b3[_0x5f67('0x44')]['id']},'raw':!![]})[_0x5f67('0x22')](handleEntityNotFound(_0x2128e7,null))[_0x5f67('0x22')](function(_0x1f7186){if(_0x1f7186){var _0x438300=_0x1f7186['ChatOfflineMessageId']!==null;var _0x49cdd6=path[_0x5f67('0x4e')](config[_0x5f67('0x4f')],_0x5f67('0x50'));if(_0x438300){_0x49cdd6=path['join'](_0x49cdd6,_0x5f67('0x51'));}var _0x4444aa=path[_0x5f67('0x4e')](_0x49cdd6,_0x1f7186[_0x5f67('0x52')]);return _0x2128e7[_0x5f67('0x53')](_0x4444aa);}})['catch'](handleError(_0x2128e7,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index ca8c47d..da2cfb5 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 _0x636e=['moment','request-promise','rimraf','./attachment.attributes','exports','lodash','util','api'];(function(_0x3a0e09,_0x49e10a){var _0x5de991=function(_0xafa6a7){while(--_0xafa6a7){_0x3a0e09['push'](_0x3a0e09['shift']());}};_0x5de991(++_0x49e10a);}(_0x636e,0x65));var _0xe636=function(_0x3182bf,_0x316760){_0x3182bf=_0x3182bf-0x0;var _0x28d536=_0x636e[_0x3182bf];return _0x28d536;};'use strict';var _=require(_0xe636('0x0'));var util=require(_0xe636('0x1'));var logger=require('../../config/logger')(_0xe636('0x2'));var moment=require(_0xe636('0x3'));var BPromise=require('bluebird');var rp=require(_0xe636('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe636('0x5'));var config=require('../../config/environment');var attributes=require(_0xe636('0x6'));module[_0xe636('0x7')]=function(_0x538402,_0x4ef7d6){return _0x538402['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2a1=['exports','define','Attachment','attachments','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x26bf45,_0x1c8091){var _0x48a84e=function(_0x18e2ac){while(--_0x18e2ac){_0x26bf45['push'](_0x26bf45['shift']());}};_0x48a84e(++_0x1c8091);}(_0xa2a1,0xe0));var _0x1a2a=function(_0x10982b,_0x4fd22c){_0x10982b=_0x10982b-0x0;var _0x45e3a6=_0xa2a1[_0x10982b];return _0x45e3a6;};'use strict';var _=require('lodash');var util=require(_0x1a2a('0x0'));var logger=require(_0x1a2a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a2a('0x2'));var fs=require('fs');var path=require(_0x1a2a('0x3'));var rimraf=require(_0x1a2a('0x4'));var config=require(_0x1a2a('0x5'));var attributes=require(_0x1a2a('0x6'));module[_0x1a2a('0x7')]=function(_0x56d10f,_0x240d7e){return _0x56d10f[_0x1a2a('0x8')](_0x1a2a('0x9'),attributes,{'tableName':_0x1a2a('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 7c12b42..3ada7d0 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 _0xaf80=['client','request','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateAttachment','options','then','debug','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x161f03,_0x5d141b){var _0x2f396f=function(_0x2c1b7a){while(--_0x2c1b7a){_0x161f03['push'](_0x161f03['shift']());}};_0x2f396f(++_0x5d141b);}(_0xaf80,0x1ef));var _0x0af8=function(_0x75d768,_0x3d8ee3){_0x75d768=_0x75d768-0x0;var _0x3be197=_0xaf80[_0x75d768];return _0x3be197;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Attachment,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});}exports[_0x0af8('0x13')]=function(_0x54e946){var _0x2ace30=this;return new Promise(function(_0x230a68,_0x38068d){return db['Attachment']['create'](_0x54e946['body'],{'raw':_0x54e946[_0x0af8('0x14')]?_0x54e946[_0x0af8('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0af8('0x15')](function(_0x4891e6){logger['info'](_0x0af8('0x13'),_0x54e946);logger[_0x0af8('0x16')](_0x0af8('0x13'),_0x54e946,JSON[_0x0af8('0xf')](_0x4891e6));_0x230a68(_0x4891e6);})[_0x0af8('0x17')](function(_0x52778f){logger['error'](_0x0af8('0x13'),_0x52778f[_0x0af8('0x11')],_0x54e946);_0x38068d(_0x2ace30[_0x0af8('0x10')](0x1f4,_0x52778f[_0x0af8('0x11')]));});});}; \ No newline at end of file +var _0xfc1e=['message','result','CreateAttachment','create','body','options','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x243fef,_0x2f087c){var _0x214621=function(_0xe8efc5){while(--_0xe8efc5){_0x243fef['push'](_0x243fef['shift']());}};_0x214621(++_0x2f087c);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfc1e[_0x11ce46];return _0x368a1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Attachment,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Attachment'][_0xefc1('0x15')](_0x257914[_0xefc1('0x16')],{'raw':_0x257914[_0xefc1('0x17')]?_0x257914['options']['raw']===undefined?!![]:![]:!![]})[_0xefc1('0x9')](function(_0x492d7d){logger[_0xefc1('0xa')]('CreateAttachment',_0x257914);logger[_0xefc1('0xc')](_0xefc1('0x14'),_0x257914,JSON['stringify'](_0x492d7d));_0x3b5a6e(_0x492d7d);})[_0xefc1('0x18')](function(_0x2ea108){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x2ea108[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c[_0xefc1('0x10')](0x1f4,_0x2ea108['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e01b4da..1293bda 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x448613,_0x9f150f){var _0x319242=function(_0xe9d65a){while(--_0xe9d65a){_0x448613['push'](_0x448613['shift']());}};_0x319242(++_0x9f150f);}(_0xadb5,0xad));var _0x5adb=function(_0x501f6f,_0x526726){_0x501f6f=_0x501f6f-0x0;var _0x3cfa86=_0xadb5[_0x501f6f];return _0x3cfa86;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x18b4a1,_0x4ed3a0){var _0x1432be=function(_0x37516d){while(--_0x37516d){_0x18b4a1['push'](_0x18b4a1['shift']());}};_0x1432be(++_0x4ed3a0);}(_0x757a,0xde));var _0xa757=function(_0x24bd8f,_0x8659c4){_0x24bd8f=_0x24bd8f-0x0;var _0x1b5cd1=_0x757a[_0x24bd8f];return _0x1b5cd1;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 9d9a0d6..8b7e5fd 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd022=['add','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent'];(function(_0x455b79,_0x380ea8){var _0x4f5dfd=function(_0x512c96){while(--_0x512c96){_0x455b79['push'](_0x455b79['shift']());}};_0x4f5dfd(++_0x380ea8);}(_0xd022,0xa1));var _0x2d02=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xd022[_0x2064e5];return _0x21a233;};'use strict';var passport=require(_0x2d02('0x0'));var LocalStrategy=require(_0x2d02('0x1'))[_0x2d02('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x2d02('0x3'));var BPromise=require(_0x2d02('0x4'));var util=require(_0x2d02('0x5'));var db=require(_0x2d02('0x6'))['db'];var authService=require(_0x2d02('0x7'));var utils=require(_0x2d02('0x8'));var config=require(_0x2d02('0x9'));var logger=require(_0x2d02('0xa'))(_0x2d02('0xb'));function isActiveDirectoryConfigured(_0x3e8796){var _0x52e299=![];if(typeof _0x3e8796[_0x2d02('0xc')]!==_0x2d02('0xd')){_0x52e299=_0x3e8796[_0x2d02('0xc')][_0x2d02('0xe')]&&_0x3e8796[_0x2d02('0xc')][_0x2d02('0xf')]&&_0x3e8796[_0x2d02('0xc')][_0x2d02('0x10')];}return _0x52e299;}function adAuthenticate(_0x272381,_0x3abfd1,_0x14186c){return new BPromise(function(_0x561033,_0x4db0c3){try{var _0x1dac6c=new ActiveDirectory(_0x272381);_0x1dac6c[_0x2d02('0x11')](_0x3abfd1,_0x14186c,function(_0x17dc12,_0x7ee4a5){if(_0x17dc12){logger[_0x2d02('0x12')](_0x2d02('0x13'),_0x3abfd1,util[_0x2d02('0x14')](_0x17dc12,{'showHidden':![],'depth':null}));_0x4db0c3(_0x2d02('0x15'));}else if(!_0x7ee4a5){logger['error'](_0x2d02('0x16'),_0x3abfd1);_0x4db0c3(_0x2d02('0x15'));}else{_0x561033(_0x7ee4a5);}});}catch(_0x5be603){_0x4db0c3(_0x5be603);}});}function ActiveDirectoryAuthenticate(_0x10ca1c,_0x3c7654,_0x1e9da7,_0x8e92a){var _0x5a786b,_0x101053;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x2d02('0x17'),_0x3c7654);return _0x8e92a(null,![],{'message':_0x2d02('0x15')});}return db['Setting'][_0x2d02('0x18')]({'where':{'id':0x1},'attributes':[_0x2d02('0x19'),_0x2d02('0x1a')],'raw':!![]})[_0x2d02('0x1b')](function(_0x24ae00){_0x5a786b=_0x24ae00;if(!_0x5a786b['adSsoEnabled']){logger[_0x2d02('0x12')](_0x2d02('0x1c'),_0x3c7654);throw new Error(_0x2d02('0x15'));}return _0x10ca1c[_0x2d02('0x18')]({'logging':!![],'attributes':['id',_0x2d02('0x1d'),'password',_0x2d02('0x1e'),_0x2d02('0x1f'),_0x2d02('0x20'),_0x2d02('0x21'),_0x2d02('0x22'),_0x2d02('0x23')],'where':{'name':_0x3c7654,'role':{'$or':[_0x2d02('0x24'),_0x2d02('0x25'),_0x2d02('0x26')]},'adSsoEnabled':!![]}});})[_0x2d02('0x1b')](function(_0x42cb72){if(!_0x42cb72||_0x42cb72&&_0x42cb72[_0x2d02('0x1d')]!==_0x3c7654){throw new Error(_0x2d02('0x15'));}_0x101053=_0x42cb72;var _0x48c195=_0x101053[_0x2d02('0x1d')]+'@'+config['activedirectory'][_0x2d02('0x10')];return adAuthenticate(config[_0x2d02('0xc')],_0x48c195,_0x1e9da7);})[_0x2d02('0x1b')](function(_0x24390b){if(_0x101053['disabled']){throw new Error(_0x2d02('0x15'));}if(_0x5a786b[_0x2d02('0x1a')]>0x0){if(_0x101053[_0x2d02('0x21')]){if(moment(_0x101053['blockedAt'])[_0x2d02('0x27')](_0x5a786b['blockDuration'],'minutes')>moment()){throw new Error(_0x2d02('0x15'));}return utils['clearBlockUser'](_0x101053,0x0,![],null)['then'](function(){return utils[_0x2d02('0x28')](_0x101053);})['then'](function(){return _0x8e92a(null,_0x101053);});}else{return utils[_0x2d02('0x28')](_0x101053)['then'](function(){return _0x8e92a(null,_0x101053);});}}else{return utils[_0x2d02('0x28')](_0x101053)[_0x2d02('0x1b')](function(){return _0x8e92a(null,_0x101053);});}})[_0x2d02('0x29')](function(_0x2dbdf9){return _0x8e92a(null,![],_0x2dbdf9);});}function handleError(_0x5ec5a9,_0x1d65ba,_0x276af9){return _0x5ec5a9[_0x2d02('0x2a')](_0x1d65ba||0x1f4)[_0x2d02('0x2b')]({'message':_0x276af9?_0x276af9[_0x2d02('0x2c')]||_0x276af9:''});}exports[_0x2d02('0x2d')]=function(_0x51aa83,_0x412d63,_0xad6dd8){passport[_0x2d02('0x11')]('ad-login',function(_0x167cb0,_0x34cb0a,_0x36335f){var _0x2e1ff3=_0x167cb0||_0x36335f;if(_0x2e1ff3){return handleError(_0x412d63,0x191,_0x2e1ff3);}if(!_0x34cb0a){return handleError(_0x412d63,0x194,{'message':_0x2d02('0x2e')});}else{var _0x43f458={'payload':{'id':_0x34cb0a['id'],'role':_0x34cb0a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x43f458)[_0x2d02('0x1b')](function(_0x18201f){_0x412d63['json']({'id':_0x34cb0a['id'],'token':_0x18201f,'statusCall':'','isAlreadyLogged':_0x34cb0a[_0x2d02('0x23')]});});}})(_0x51aa83,_0x412d63,_0xad6dd8);};passport[_0x2d02('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0x2d02('0x1d'),'passwordField':_0x2d02('0x30')},function(_0x554067,_0xfac706,_0x362eac){return ActiveDirectoryAuthenticate(db[_0x2d02('0x31')],_0x554067,_0xfac706,_0x362eac);})); \ No newline at end of file +var _0x873e=['online','admin','user','agent','blocked','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','use','password','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','disabled','blockedAt'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x873e,0xa1));var _0xe873=function(_0x157aef,_0x3e7774){_0x157aef=_0x157aef-0x0;var _0x5b8f6a=_0x873e[_0x157aef];return _0x5b8f6a;};'use strict';var passport=require(_0xe873('0x0'));var LocalStrategy=require(_0xe873('0x1'))[_0xe873('0x2')];var moment=require(_0xe873('0x3'));var ActiveDirectory=require(_0xe873('0x4'));var BPromise=require('bluebird');var util=require(_0xe873('0x5'));var db=require(_0xe873('0x6'))['db'];var authService=require(_0xe873('0x7'));var utils=require(_0xe873('0x8'));var config=require(_0xe873('0x9'));var logger=require(_0xe873('0xa'))(_0xe873('0xb'));function isActiveDirectoryConfigured(_0x512161){var _0x45cda5=![];if(typeof _0x512161[_0xe873('0xc')]!==_0xe873('0xd')){_0x45cda5=_0x512161[_0xe873('0xc')][_0xe873('0xe')]&&_0x512161[_0xe873('0xc')]['url']&&_0x512161['activedirectory'][_0xe873('0xf')];}return _0x45cda5;}function adAuthenticate(_0x5a08b2,_0x500463,_0x3af9c7){return new BPromise(function(_0x34b9cd,_0x2ffdd8){try{var _0x30e0e2=new ActiveDirectory(_0x5a08b2);_0x30e0e2[_0xe873('0x10')](_0x500463,_0x3af9c7,function(_0x1bb607,_0x1be8f4){if(_0x1bb607){logger[_0xe873('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x500463,util[_0xe873('0x12')](_0x1bb607,{'showHidden':![],'depth':null}));_0x2ffdd8(_0xe873('0x13'));}else if(!_0x1be8f4){logger['error'](_0xe873('0x14'),_0x500463);_0x2ffdd8(_0xe873('0x13'));}else{_0x34b9cd(_0x1be8f4);}});}catch(_0x1c25bc){_0x2ffdd8(_0x1c25bc);}});}function ActiveDirectoryAuthenticate(_0x596f8c,_0x37c3fb,_0x2a6c79,_0x31f7d7){var _0xbbcb83,_0x24ef37;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe873('0x15'),_0x37c3fb);return _0x31f7d7(null,![],{'message':_0xe873('0x13')});}return db['Setting'][_0xe873('0x16')]({'where':{'id':0x1},'attributes':[_0xe873('0x17'),_0xe873('0x18')],'raw':!![]})[_0xe873('0x19')](function(_0x1c4124){_0xbbcb83=_0x1c4124;if(!_0xbbcb83[_0xe873('0x17')]){logger[_0xe873('0x11')](_0xe873('0x1a'),_0x37c3fb);throw new Error(_0xe873('0x13'));}return _0x596f8c[_0xe873('0x16')]({'logging':!![],'attributes':['id',_0xe873('0x1b'),'password',_0xe873('0x1c'),'role',_0xe873('0x1d'),'blocked',_0xe873('0x1e'),_0xe873('0x1f')],'where':{'name':_0x37c3fb,'role':{'$or':[_0xe873('0x20'),_0xe873('0x21'),_0xe873('0x22')]},'adSsoEnabled':!![]}});})[_0xe873('0x19')](function(_0x29e1f7){if(!_0x29e1f7||_0x29e1f7&&_0x29e1f7['name']!==_0x37c3fb){throw new Error(_0xe873('0x13'));}_0x24ef37=_0x29e1f7;var _0x17778f=_0x24ef37[_0xe873('0x1b')]+'@'+config[_0xe873('0xc')][_0xe873('0xf')];return adAuthenticate(config[_0xe873('0xc')],_0x17778f,_0x2a6c79);})[_0xe873('0x19')](function(_0x444bb9){if(_0x24ef37['disabled']){throw new Error(_0xe873('0x13'));}if(_0xbbcb83[_0xe873('0x18')]>0x0){if(_0x24ef37[_0xe873('0x23')]){if(moment(_0x24ef37[_0xe873('0x1e')])['add'](_0xbbcb83[_0xe873('0x18')],'minutes')>moment()){throw new Error(_0xe873('0x13'));}return utils[_0xe873('0x24')](_0x24ef37,0x0,![],null)[_0xe873('0x19')](function(){return utils[_0xe873('0x25')](_0x24ef37);})[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}else{return utils[_0xe873('0x25')](_0x24ef37)[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}}else{return utils[_0xe873('0x25')](_0x24ef37)[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}})['catch'](function(_0x4e704a){return _0x31f7d7(null,![],_0x4e704a);});}function handleError(_0x192e5b,_0x460f57,_0x50c86d){return _0x192e5b[_0xe873('0x26')](_0x460f57||0x1f4)[_0xe873('0x27')]({'message':_0x50c86d?_0x50c86d[_0xe873('0x28')]||_0x50c86d:''});}exports[_0xe873('0x29')]=function(_0x2a1506,_0x569d36,_0x2e6c5c){passport[_0xe873('0x10')](_0xe873('0x2a'),function(_0x27c6e8,_0x56c6f2,_0x7044ff){var _0x40f0f5=_0x27c6e8||_0x7044ff;if(_0x40f0f5){return handleError(_0x569d36,0x191,_0x40f0f5);}if(!_0x56c6f2){return handleError(_0x569d36,0x194,{'message':_0xe873('0x2b')});}else{var _0x436092={'payload':{'id':_0x56c6f2['id'],'role':_0x56c6f2[_0xe873('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0xe873('0x2d')](_0x436092)['then'](function(_0x595ba7){_0x569d36['json']({'id':_0x56c6f2['id'],'token':_0x595ba7,'statusCall':'','isAlreadyLogged':_0x56c6f2[_0xe873('0x1f')]});});}})(_0x2a1506,_0x569d36,_0x2e6c5c);};passport[_0xe873('0x2e')](_0xe873('0x2a'),new LocalStrategy({'usernameField':_0xe873('0x1b'),'passwordField':_0xe873('0x2f')},function(_0x57e5bf,_0xe9a24d,_0x370e05){return ActiveDirectoryAuthenticate(db['User'],_0x57e5bf,_0xe9a24d,_0x370e05);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index c20cc81..90d9b92 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2b=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0x5f2b,0xa9));var _0xb5f2=function(_0x30527c,_0x4d2c52){_0x30527c=_0x30527c-0x0;var _0x353208=_0x5f2b[_0x30527c];return _0x353208;};'use strict';var express=require('express');var router=express[_0xb5f2('0x0')]();var controller=require(_0xb5f2('0x1'));router[_0xb5f2('0x2')]('/',controller[_0xb5f2('0x3')]);module[_0xb5f2('0x4')]=router; \ No newline at end of file +var _0x0076=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0076,0x6a));var _0x6007=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0076[_0xfae23b];return _0x200640;};'use strict';var express=require(_0x6007('0x0'));var router=express[_0x6007('0x1')]();var controller=require(_0x6007('0x2'));router[_0x6007('0x3')]('/',controller['login']);module[_0x6007('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e02b50a..8709e81 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x48be0b,_0x28cd94){_0x48be0b=_0x48be0b-0x0;var _0x3edfb5=_0x7a54[_0x48be0b];return _0x3edfb5;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 2e90e02..d8107c2 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 _0x7857=['exports','passport','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie'];(function(_0x267080,_0x34af89){var _0x36a1af=function(_0x3151d1){while(--_0x3151d1){_0x267080['push'](_0x267080['shift']());}};_0x36a1af(++_0x34af89);}(_0x7857,0x1af));var _0x7785=function(_0x13128a,_0x5b4a85){_0x13128a=_0x13128a-0x0;var _0x1d79d4=_0x7857[_0x13128a];return _0x1d79d4;};'use strict';var express=require('express');var passport=require(_0x7785('0x0'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x7785('0x1'));var authService=require(_0x7785('0x2'));router['get']('/',controller['login']);router[_0x7785('0x3')](_0x7785('0x4'),controller[_0x7785('0x5')],authService[_0x7785('0x6')],userController[_0x7785('0x7')],authService[_0x7785('0x8')]);module[_0x7785('0x9')]=router; \ No newline at end of file +var _0x8ff3=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x2f0e79,_0x526f44){var _0x4e2500=function(_0x338759){while(--_0x338759){_0x2f0e79['push'](_0x2f0e79['shift']());}};_0x4e2500(++_0x526f44);}(_0x8ff3,0x1a9));var _0x38ff=function(_0x3b6bab,_0x4dd853){_0x3b6bab=_0x3b6bab-0x0;var _0x3f6478=_0x8ff3[_0x3b6bab];return _0x3f6478;};'use strict';var express=require(_0x38ff('0x0'));var passport=require(_0x38ff('0x1'));var router=express[_0x38ff('0x2')]();var controller=require(_0x38ff('0x3'));var userController=require(_0x38ff('0x4'));var authService=require(_0x38ff('0x5'));router['get']('/',controller[_0x38ff('0x6')]);router[_0x38ff('0x7')](_0x38ff('0x8'),controller[_0x38ff('0x9')],authService[_0x38ff('0xa')],userController[_0x38ff('0x6')],authService[_0x38ff('0xb')]);module[_0x38ff('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ab00428..e402449 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 _0xa5aa=['If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','use','local-login','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','trim','toLowerCase','find','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','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','https://','headers','host','/reset/'];(function(_0x49d940,_0x516f31){var _0x3201be=function(_0x311c8c){while(--_0x311c8c){_0x49d940['push'](_0x49d940['shift']());}};_0x3201be(++_0x516f31);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x359183,_0x33f176){_0x359183=_0x359183-0x0;var _0x16c6a1=_0xa5aa[_0x359183];return _0x16c6a1;};'use strict';var util=require(_0xaa5a('0x0'));var passport=require(_0xaa5a('0x1'));var LocalStrategy=require('passport-local')[_0xaa5a('0x2')];var jayson=require(_0xaa5a('0x3'));var _=require(_0xaa5a('0x4'));var rs=require(_0xaa5a('0x5'));var moment=require(_0xaa5a('0x6'));var db=require(_0xaa5a('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xaa5a('0x8'));var client=jayson[_0xaa5a('0x9')][_0xaa5a('0xa')]({'port':0x232b});function localAuthenticate(_0x561d19,_0x5ca487,_0x26e49b,_0x3ec50a){var _0x4daa9a,_0x8f2d83;return db[_0xaa5a('0xb')][_0xaa5a('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xaa5a('0xd')],'raw':!![]})[_0xaa5a('0xe')](function(_0x771d06){_0x4daa9a=_0x771d06;return _0x561d19[_0xaa5a('0xc')]({'attributes':['id',_0xaa5a('0xf'),_0xaa5a('0x10'),'salt',_0xaa5a('0x11'),_0xaa5a('0x12'),_0xaa5a('0x13'),_0xaa5a('0x14'),_0xaa5a('0x15')],'where':{'name':_0x5ca487,'role':{'$or':[_0xaa5a('0x16'),_0xaa5a('0x17'),_0xaa5a('0x18')]}}});})[_0xaa5a('0xe')](function(_0x773260){if(!_0x773260||_0x773260&&_0x773260[_0xaa5a('0xf')]!==_0x5ca487){throw new Error(_0xaa5a('0x19'));}else{_0x8f2d83=_0x773260;return _0x8f2d83;}})['then'](function(){_0x8f2d83[_0xaa5a('0x1a')](_0x26e49b,function(_0x40b34f,_0x10919d){var _0x5ee610=_0x8f2d83[_0xaa5a('0x15')]+0x1;if(_0x40b34f){return _0x3ec50a(_0x40b34f);}else if(!_0x10919d){if(_0x8f2d83[_0xaa5a('0x12')]){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});}else if(_0x4daa9a[_0xaa5a('0x1b')]>0x0){if(_0x8f2d83[_0xaa5a('0x13')]){if(_0x4daa9a[_0xaa5a('0xd')]>0x0){if(moment(_0x8f2d83[_0xaa5a('0x14')])[_0xaa5a('0x1c')](_0x4daa9a[_0xaa5a('0xd')],_0xaa5a('0x1d'))>moment()){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});}else{return utils[_0xaa5a('0x1e')](_0x8f2d83,_0x5ee610,![],null)[_0xaa5a('0xe')](function(){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});});}}else{return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});}}else{if(_0x5ee610>=_0x4daa9a[_0xaa5a('0x1b')]){return utils[_0xaa5a('0x1e')](_0x8f2d83,0x0,!![],moment())['then'](function(){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});});}else{return utils[_0xaa5a('0x1e')](_0x8f2d83,_0x5ee610,![],null)[_0xaa5a('0xe')](function(){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});});}}}else{return _0x3ec50a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x8f2d83[_0xaa5a('0x12')]){return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});}else if(_0x4daa9a[_0xaa5a('0x1b')]>0x0){if(_0x8f2d83[_0xaa5a('0x13')]){if(_0x4daa9a[_0xaa5a('0xd')]>0x0){if(moment(_0x8f2d83[_0xaa5a('0x14')])[_0xaa5a('0x1c')](_0x4daa9a[_0xaa5a('0xd')],_0xaa5a('0x1d'))>moment()){return _0x3ec50a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xaa5a('0x1e')](_0x8f2d83,0x0,![],null)['then'](function(){return utils[_0xaa5a('0x1f')](_0x8f2d83);})[_0xaa5a('0xe')](function(){return _0x3ec50a(null,_0x8f2d83);});}}else{return _0x3ec50a(null,![],{'message':_0xaa5a('0x19')});}}else{return utils[_0xaa5a('0x1e')](_0x8f2d83,0x0,![],null)[_0xaa5a('0xe')](function(){return utils['getLicense'](_0x8f2d83);})[_0xaa5a('0xe')](function(){return _0x3ec50a(null,_0x8f2d83);})[_0xaa5a('0x20')](function(_0x4e2311){return _0x3ec50a(null,![],_0x4e2311);});}}else{if(_0x8f2d83[_0xaa5a('0x13')]){return _0x3ec50a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xaa5a('0x1f')](_0x8f2d83)[_0xaa5a('0xe')](function(){return _0x3ec50a(null,_0x8f2d83);});}}}});})[_0xaa5a('0x20')](function(_0x27fe53){return _0x3ec50a(null,![],_0x27fe53);});}function sendServiceMail(_0x4117a6){return db[_0xaa5a('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xaa5a('0xf'),_0xaa5a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xaa5a('0x23'),'include':[{'model':db[_0xaa5a('0x24')],'as':'CloudProvider'}]}]})[_0xaa5a('0xe')](function(_0x453a46){if(!_0x453a46){throw new Error(_0xaa5a('0x25'));}var _0x115f03=_0x453a46[_0xaa5a('0x26')]();var _0xa01478={'account':_0x115f03,'message':_['merge']({'from':util[_0xaa5a('0x27')](_0xaa5a('0x28'),_0x453a46[_0xaa5a('0xf')],_0x453a46[_0xaa5a('0x22')]||_0x453a46['Smtp']['user'])},_0x4117a6)};return client[_0xaa5a('0x29')](_0xaa5a('0x2a'),_0xa01478);})['then'](function(_0x363e16){if(_0x363e16['error']){throw new Error(util['format'](_0xaa5a('0x2b'),_0x363e16[_0xaa5a('0x2c')][_0xaa5a('0x2d')]||JSON[_0xaa5a('0x2e')](_0x363e16[_0xaa5a('0x2c')])));}return!![];});}function handleError(_0x34f94a,_0x249db4,_0x5632aa){return _0x34f94a[_0xaa5a('0x2f')](_0x249db4||0x1f4)[_0xaa5a('0x30')]({'message':_0x5632aa?_0x5632aa[_0xaa5a('0x2d')]||_0x5632aa:''});}exports['login']=function(_0x1b1c6f,_0x5314c5,_0x1fc0eb){passport['authenticate']('local-login',function(_0x368a6d,_0x1bd910,_0x2bbe8e){var _0x21e0b1=_0x368a6d||_0x2bbe8e;if(_0x21e0b1){return handleError(_0x5314c5,0x191,_0x21e0b1);}if(!_0x1bd910){return handleError(_0x5314c5,0x194,{'message':_0xaa5a('0x31')});}else{var _0x53618c={'payload':{'id':_0x1bd910['id'],'role':_0x1bd910[_0xaa5a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xaa5a('0x32')](_0x53618c)['then'](function(_0x5b9300){_0x5314c5['json']({'id':_0x1bd910['id'],'token':_0x5b9300,'statusCall':'','isAlreadyLogged':_0x1bd910[_0xaa5a('0x33')]});});}})(_0x1b1c6f,_0x5314c5,_0x1fc0eb);};exports[_0xaa5a('0x34')]=function(_0x330a97,_0x456ed4){if(!_0x330a97[_0xaa5a('0x35')][_0xaa5a('0x22')]){return handleError(_0x456ed4,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5aa3f6=rs['generate']();_0x330a97[_0xaa5a('0x35')]['email']=_0x330a97['body']['email'][_0xaa5a('0x36')]()[_0xaa5a('0x37')]();var _0x264a35;return db['Setting'][_0xaa5a('0xc')]({'where':{'id':0x1},'attributes':[_0xaa5a('0x1b'),_0xaa5a('0xd')],'raw':!![]})[_0xaa5a('0xe')](function(_0x20132a){_0x264a35=_0x20132a;return db['User'][_0xaa5a('0x38')]({'where':{'email':_0x330a97[_0xaa5a('0x35')][_0xaa5a('0x22')]}});})[_0xaa5a('0xe')](function(_0x361967){if(!_0x361967){throw new Error(_0xaa5a('0x39'));}if(_0x361967[_0xaa5a('0x12')]){throw new Error(_0xaa5a('0x3a'));}if(_0x361967[_0xaa5a('0x13')]){if(moment(_0x361967['blockedAt'])['add'](_0x264a35['blockDuration'],'minutes')>moment()){throw new Error(_0xaa5a('0x3b'));}else{_0x361967[_0xaa5a('0x13')]=![];_0x361967[_0xaa5a('0x14')]=null;}}_0x361967[_0xaa5a('0x3c')]=_0x5aa3f6;_0x361967[_0xaa5a('0x3d')]=Date[_0xaa5a('0x3e')]()+0x36ee80;return _0x361967[_0xaa5a('0x3f')]();})[_0xaa5a('0xe')](function(){return sendServiceMail({'to':_0x330a97[_0xaa5a('0x35')][_0xaa5a('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xaa5a('0x40')+_0xaa5a('0x41')+_0xaa5a('0x42')+_0x330a97[_0xaa5a('0x43')][_0xaa5a('0x44')]+_0xaa5a('0x45')+_0x5aa3f6+'\x0a\x0a'+_0xaa5a('0x46')});})['then'](function(){_0x456ed4[_0xaa5a('0x2f')](0xc8)[_0xaa5a('0x30')]({'message':_0xaa5a('0x47')});})[_0xaa5a('0x20')](function(_0x3b5723){return handleError(_0x456ed4,0x1f4,_0x3b5723);});};exports[_0xaa5a('0x48')]=function(_0x1a536e,_0x3c2931){return db[_0xaa5a('0x49')]['find']({'where':{'resetPasswordToken':_0x1a536e['params'][_0xaa5a('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xaa5a('0x3e')]()}}})[_0xaa5a('0xe')](function(_0xd8337d){if(!_0xd8337d){throw new Error(_0xaa5a('0x4b'));}return db[_0xaa5a('0xb')][_0xaa5a('0xc')]({'attributes':['id','securePassword',_0xaa5a('0x4c'),_0xaa5a('0x4d')]})[_0xaa5a('0xe')](function(_0x2be50f){if(_0x2be50f[_0xaa5a('0x4e')])authService['validatePasswordPattern'](_0x1a536e['body']['password']);if(!_0x2be50f['enforcePasswordHistory']||!_0xd8337d[_0xaa5a('0x4f')])return _0xd8337d;authService[_0xaa5a('0x50')](_0x1a536e[_0xaa5a('0x35')][_0xaa5a('0x10')],_0xd8337d[_0xaa5a('0x4f')],_0x2be50f[_0xaa5a('0x4d')]);return _0xd8337d;})[_0xaa5a('0xe')](function(){_0xd8337d[_0xaa5a('0x10')]=_0x1a536e[_0xaa5a('0x35')][_0xaa5a('0x10')];_0xd8337d[_0xaa5a('0x3c')]=null;_0xd8337d[_0xaa5a('0x3d')]=null;return _0xd8337d[_0xaa5a('0x3f')]();});})[_0xaa5a('0xe')](function(){_0x3c2931[_0xaa5a('0x2f')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x3ce5f0){return handleError(_0x3c2931,0x1f4,_0x3ce5f0);});};passport[_0xaa5a('0x51')](_0xaa5a('0x52'),new LocalStrategy({'usernameField':_0xaa5a('0xf'),'passwordField':_0xaa5a('0x10')},function(_0x433f76,_0x3e3a98,_0x21dc40){return localAuthenticate(db[_0xaa5a('0x49')],_0x433f76,_0x3e3a98,_0x21dc40);})); \ No newline at end of file +var _0x6fa4=['now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','previousPasswords','password','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fa4,0x15d));var _0x46fa=function(_0x425d3e,_0x331f7c){_0x425d3e=_0x425d3e-0x0;var _0x2d1bf2=_0x6fa4[_0x425d3e];return _0x2d1bf2;};'use strict';var util=require(_0x46fa('0x0'));var passport=require(_0x46fa('0x1'));var LocalStrategy=require(_0x46fa('0x2'))['Strategy'];var jayson=require(_0x46fa('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x46fa('0x4'));var db=require(_0x46fa('0x5'))['db'];var authService=require(_0x46fa('0x6'));var utils=require(_0x46fa('0x7'));var client=jayson[_0x46fa('0x8')][_0x46fa('0x9')]({'port':0x232b});function localAuthenticate(_0x33da09,_0x4b02e7,_0x256a69,_0x1db1f9){var _0x2bf28c,_0x5a6e54;return db[_0x46fa('0xa')][_0x46fa('0xb')]({'where':{'id':0x1},'attributes':[_0x46fa('0xc'),_0x46fa('0xd')],'raw':!![]})[_0x46fa('0xe')](function(_0x5b6f1d){_0x2bf28c=_0x5b6f1d;return _0x33da09[_0x46fa('0xb')]({'attributes':['id',_0x46fa('0xf'),'password','salt',_0x46fa('0x10'),'disabled',_0x46fa('0x11'),_0x46fa('0x12'),_0x46fa('0x13')],'where':{'name':_0x4b02e7,'role':{'$or':[_0x46fa('0x14'),_0x46fa('0x15'),_0x46fa('0x16')]}}});})[_0x46fa('0xe')](function(_0x37385a){if(!_0x37385a||_0x37385a&&_0x37385a[_0x46fa('0xf')]!==_0x4b02e7){throw new Error(_0x46fa('0x17'));}else{_0x5a6e54=_0x37385a;return _0x5a6e54;}})[_0x46fa('0xe')](function(){_0x5a6e54[_0x46fa('0x18')](_0x256a69,function(_0x3dcfb1,_0x67a1c9){var _0x1f5e78=_0x5a6e54[_0x46fa('0x13')]+0x1;if(_0x3dcfb1){return _0x1db1f9(_0x3dcfb1);}else if(!_0x67a1c9){if(_0x5a6e54['disabled']){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else if(_0x2bf28c[_0x46fa('0xc')]>0x0){if(_0x5a6e54[_0x46fa('0x11')]){if(_0x2bf28c[_0x46fa('0xd')]>0x0){if(moment(_0x5a6e54[_0x46fa('0x12')])[_0x46fa('0x19')](_0x2bf28c[_0x46fa('0xd')],_0x46fa('0x1a'))>moment()){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,_0x1f5e78,![],null)[_0x46fa('0xe')](function(){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1f5e78>=_0x2bf28c[_0x46fa('0xc')]){return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,!![],moment())[_0x46fa('0xe')](function(){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,_0x1f5e78,![],null)['then'](function(){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}}else{if(_0x5a6e54[_0x46fa('0x1c')]){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else if(_0x2bf28c[_0x46fa('0xc')]>0x0){if(_0x5a6e54[_0x46fa('0x11')]){if(_0x2bf28c['blockDuration']>0x0){if(moment(_0x5a6e54[_0x46fa('0x12')])[_0x46fa('0x19')](_0x2bf28c[_0x46fa('0xd')],_0x46fa('0x1a'))>moment()){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,![],null)['then'](function(){return utils['getLicense'](_0x5a6e54);})[_0x46fa('0xe')](function(){return _0x1db1f9(null,_0x5a6e54);});}}else{return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,![],null)['then'](function(){return utils[_0x46fa('0x1d')](_0x5a6e54);})['then'](function(){return _0x1db1f9(null,_0x5a6e54);})[_0x46fa('0x1e')](function(_0x57d4cd){return _0x1db1f9(null,![],_0x57d4cd);});}}else{if(_0x5a6e54[_0x46fa('0x11')]){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else{return utils[_0x46fa('0x1d')](_0x5a6e54)[_0x46fa('0xe')](function(){return _0x1db1f9(null,_0x5a6e54);});}}}});})[_0x46fa('0x1e')](function(_0x419f20){return _0x1db1f9(null,![],_0x419f20);});}function sendServiceMail(_0x4461d8){return db[_0x46fa('0x1f')][_0x46fa('0x20')]({'where':{'service':!![]},'attributes':['id',_0x46fa('0xf'),_0x46fa('0x21')],'include':[{'model':db[_0x46fa('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x46fa('0x23')}]}]})['then'](function(_0x51bc4f){if(!_0x51bc4f){throw new Error(_0x46fa('0x24'));}var _0x5925ca=_0x51bc4f[_0x46fa('0x25')]();var _0x5680bf={'account':_0x5925ca,'message':_[_0x46fa('0x26')]({'from':util[_0x46fa('0x27')](_0x46fa('0x28'),_0x51bc4f[_0x46fa('0xf')],_0x51bc4f['email']||_0x51bc4f[_0x46fa('0x29')][_0x46fa('0x15')])},_0x4461d8)};return client[_0x46fa('0x2a')](_0x46fa('0x2b'),_0x5680bf);})[_0x46fa('0xe')](function(_0x2ab4d8){if(_0x2ab4d8[_0x46fa('0x2c')]){throw new Error(util[_0x46fa('0x27')](_0x46fa('0x2d'),_0x2ab4d8[_0x46fa('0x2c')][_0x46fa('0x2e')]||JSON[_0x46fa('0x2f')](_0x2ab4d8[_0x46fa('0x2c')])));}return!![];});}function handleError(_0x5d44b2,_0x4f4e95,_0x2811ed){return _0x5d44b2[_0x46fa('0x30')](_0x4f4e95||0x1f4)[_0x46fa('0x31')]({'message':_0x2811ed?_0x2811ed[_0x46fa('0x2e')]||_0x2811ed:''});}exports[_0x46fa('0x32')]=function(_0x32f24b,_0x2986b5,_0x9be203){passport[_0x46fa('0x18')](_0x46fa('0x33'),function(_0x1cd985,_0x39e22a,_0x47c392){var _0x5b4249=_0x1cd985||_0x47c392;if(_0x5b4249){return handleError(_0x2986b5,0x191,_0x5b4249);}if(!_0x39e22a){return handleError(_0x2986b5,0x194,{'message':_0x46fa('0x34')});}else{var _0x3a0d5b={'payload':{'id':_0x39e22a['id'],'role':_0x39e22a[_0x46fa('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x46fa('0x35')](_0x3a0d5b)[_0x46fa('0xe')](function(_0x4c8702){_0x2986b5[_0x46fa('0x36')]({'id':_0x39e22a['id'],'token':_0x4c8702,'statusCall':'','isAlreadyLogged':_0x39e22a[_0x46fa('0x37')]});});}})(_0x32f24b,_0x2986b5,_0x9be203);};exports[_0x46fa('0x38')]=function(_0x492078,_0x4df1b0){if(!_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]){return handleError(_0x4df1b0,0x1f4,{'message':_0x46fa('0x3a')});}var _0x148f19=rs[_0x46fa('0x3b')]();_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]=_0x492078[_0x46fa('0x39')][_0x46fa('0x21')][_0x46fa('0x3c')]()[_0x46fa('0x3d')]();var _0x4e7f3e;return db['Setting'][_0x46fa('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x46fa('0xd')],'raw':!![]})[_0x46fa('0xe')](function(_0xee912d){_0x4e7f3e=_0xee912d;return db[_0x46fa('0x3e')][_0x46fa('0x20')]({'where':{'email':_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]}});})['then'](function(_0x12ecb7){if(!_0x12ecb7){throw new Error(_0x46fa('0x3f'));}if(_0x12ecb7['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x12ecb7[_0x46fa('0x11')]){if(moment(_0x12ecb7['blockedAt'])['add'](_0x4e7f3e[_0x46fa('0xd')],'minutes')>moment()){throw new Error(_0x46fa('0x40'));}else{_0x12ecb7[_0x46fa('0x11')]=![];_0x12ecb7[_0x46fa('0x12')]=null;}}_0x12ecb7[_0x46fa('0x41')]=_0x148f19;_0x12ecb7['resetPasswordExpires']=Date[_0x46fa('0x42')]()+0x36ee80;return _0x12ecb7['save']();})['then'](function(){return sendServiceMail({'to':_0x492078[_0x46fa('0x39')][_0x46fa('0x21')],'subject':_0x46fa('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x46fa('0x44')+_0x46fa('0x45')+_0x492078[_0x46fa('0x46')][_0x46fa('0x47')]+_0x46fa('0x48')+_0x148f19+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x46fa('0xe')](function(){_0x4df1b0[_0x46fa('0x30')](0xc8)[_0x46fa('0x31')]({'message':_0x46fa('0x49')});})[_0x46fa('0x1e')](function(_0x54fea7){return handleError(_0x4df1b0,0x1f4,_0x54fea7);});};exports[_0x46fa('0x4a')]=function(_0x1aecaf,_0x3f45eb){return db['User'][_0x46fa('0x20')]({'where':{'resetPasswordToken':_0x1aecaf[_0x46fa('0x4b')][_0x46fa('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x46fa('0x42')]()}}})[_0x46fa('0xe')](function(_0x1ef88d){if(!_0x1ef88d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x46fa('0xa')]['findOne']({'attributes':['id','securePassword',_0x46fa('0x4d'),'passwordHistoryLimit']})['then'](function(_0x1607e1){if(_0x1607e1['securePassword'])authService['validatePasswordPattern'](_0x1aecaf['body']['password']);if(!_0x1607e1[_0x46fa('0x4d')]||!_0x1ef88d[_0x46fa('0x4e')])return _0x1ef88d;authService['validatePasswordHistory'](_0x1aecaf[_0x46fa('0x39')][_0x46fa('0x4f')],_0x1ef88d[_0x46fa('0x4e')],_0x1607e1['passwordHistoryLimit']);return _0x1ef88d;})[_0x46fa('0xe')](function(){_0x1ef88d[_0x46fa('0x4f')]=_0x1aecaf[_0x46fa('0x39')][_0x46fa('0x4f')];_0x1ef88d[_0x46fa('0x41')]=null;_0x1ef88d[_0x46fa('0x50')]=null;return _0x1ef88d['save']();});})['then'](function(){_0x3f45eb[_0x46fa('0x30')](0xc8)['send']({'message':_0x46fa('0x51')});})[_0x46fa('0x1e')](function(_0x474711){return handleError(_0x3f45eb,0x1f4,_0x474711);});};passport[_0x46fa('0x52')](_0x46fa('0x33'),new LocalStrategy({'usernameField':'name','passwordField':_0x46fa('0x4f')},function(_0xcd2035,_0x5d34f0,_0x23c412){return localAuthenticate(db[_0x46fa('0x3e')],_0xcd2035,_0x5d34f0,_0x23c412);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e4fbb81..b12df39 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 _0xe104=['exports','Router','login','forgot','post','/reset/:token'];(function(_0x24b852,_0x2bad67){var _0x180ad2=function(_0x454562){while(--_0x454562){_0x24b852['push'](_0x24b852['shift']());}};_0x180ad2(++_0x2bad67);}(_0xe104,0x1bd));var _0x4e10=function(_0x40d6f9,_0x35b4e8){_0x40d6f9=_0x40d6f9-0x0;var _0x290e2c=_0xe104[_0x40d6f9];return _0x290e2c;};'use strict';var express=require('express');var router=express[_0x4e10('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4e10('0x1')]);router['post']('/forgot',controller[_0x4e10('0x2')]);router[_0x4e10('0x3')](_0x4e10('0x4'),controller['reset']);module[_0x4e10('0x5')]=router; \ No newline at end of file +var _0x1cd7=['exports','./authLocal.controller','login','/forgot','forgot','post','/reset/:token','reset'];(function(_0x2d9144,_0x29691a){var _0x190bb8=function(_0x2b80ae){while(--_0x2b80ae){_0x2d9144['push'](_0x2d9144['shift']());}};_0x190bb8(++_0x29691a);}(_0x1cd7,0xb1));var _0x71cd=function(_0x190a54,_0x2d61d0){_0x190a54=_0x190a54-0x0;var _0x91adb0=_0x1cd7[_0x190a54];return _0x91adb0;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x71cd('0x0'));router['post']('/',controller[_0x71cd('0x1')]);router['post'](_0x71cd('0x2'),controller[_0x71cd('0x3')]);router[_0x71cd('0x4')](_0x71cd('0x5'),controller[_0x71cd('0x6')]);module[_0x71cd('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f7e72e6..5ddfb9d 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 _0xda83=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda83,0x1f3));var _0x3da8=function(_0x1b3699,_0x1a1b06){_0x1b3699=_0x1b3699-0x0;var _0x12c4c2=_0xda83[_0x1b3699];return _0x12c4c2;};'use strict';var Sequelize=require('sequelize');module[_0x3da8('0x0')]={'name':{'type':Sequelize[_0x3da8('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3da8('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3da8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3da8('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x262e=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x454762,_0x480d8c){var _0x3c05c5=function(_0x4bc53e){while(--_0x4bc53e){_0x454762['push'](_0x454762['shift']());}};_0x3c05c5(++_0x480d8c);}(_0x262e,0x156));var _0xe262=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x262e[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0xe262('0x0'));module[_0xe262('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe262('0x2')]},'description':{'type':Sequelize[_0xe262('0x2')]},'status':{'type':Sequelize[_0xe262('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe262('0x4')],'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 fc8b367..889d217 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 _0xf7be=['body','params','addConditions','Condition','omit','ids','getConditions','findOne','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Automation','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','findAll','rows','show','rawAttributes','includeAll','include','find','catch','create'];(function(_0x526f40,_0x1593a1){var _0x2475bc=function(_0x3f59d4){while(--_0x3f59d4){_0x526f40['push'](_0x526f40['shift']());}};_0x2475bc(++_0x1593a1);}(_0xf7be,0xb4));var _0xef7b=function(_0x5cbfef,_0x4dabec){_0x5cbfef=_0x5cbfef-0x0;var _0x20f0f6=_0xf7be[_0x5cbfef];return _0x20f0f6;};'use strict';var emlformat=require(_0xef7b('0x0'));var rimraf=require(_0xef7b('0x1'));var zipdir=require(_0xef7b('0x2'));var jsonpatch=require(_0xef7b('0x3'));var rp=require('request-promise');var moment=require(_0xef7b('0x4'));var BPromise=require(_0xef7b('0x5'));var Mustache=require(_0xef7b('0x6'));var util=require('util');var path=require(_0xef7b('0x7'));var sox=require('sox');var csv=require(_0xef7b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef7b('0x9'));var _=require(_0xef7b('0xa'));var squel=require(_0xef7b('0xb'));var crypto=require('crypto');var jsforce=require(_0xef7b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xef7b('0x8'));var querystring=require(_0xef7b('0xd'));var Papa=require(_0xef7b('0xe'));var Redis=require(_0xef7b('0xf'));var authService=require(_0xef7b('0x10'));var qs=require(_0xef7b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef7b('0x12'));var logger=require(_0xef7b('0x13'))(_0xef7b('0x14'));var utils=require(_0xef7b('0x15'));var config=require(_0xef7b('0x16'));var licenseUtil=require(_0xef7b('0x17'));var db=require(_0xef7b('0x18'))['db'];function respondWithStatusCode(_0x82e603,_0x2f3344){_0x2f3344=_0x2f3344||0xcc;return function(_0x962d24){if(_0x962d24){return _0x82e603[_0xef7b('0x19')](_0x2f3344);}return _0x82e603[_0xef7b('0x1a')](_0x2f3344)[_0xef7b('0x1b')]();};}function respondWithResult(_0xa72c8c,_0x2bf523){_0x2bf523=_0x2bf523||0xc8;return function(_0xb47a0d){if(_0xb47a0d){return _0xa72c8c[_0xef7b('0x1a')](_0x2bf523)[_0xef7b('0x1c')](_0xb47a0d);}};}function respondWithFilteredResult(_0x2e5f9e,_0x3bf509){return function(_0x4ba40e){if(_0x4ba40e){var _0x19b6fa=typeof _0x3bf509[_0xef7b('0x1d')]===_0xef7b('0x1e')&&typeof _0x3bf509['limit']==='undefined';var _0x1773a4=_0x4ba40e['count'];var _0x2bd070=_0x19b6fa?0x0:_0x3bf509[_0xef7b('0x1d')];var _0x3259eb=_0x19b6fa?_0x4ba40e[_0xef7b('0x1f')]:_0x3bf509[_0xef7b('0x1d')]+_0x3bf509['limit'];var _0x32827b;if(_0x3259eb>=_0x1773a4){_0x3259eb=_0x1773a4;_0x32827b=0xc8;}else{_0x32827b=0xce;}_0x2e5f9e['status'](_0x32827b);return _0x2e5f9e[_0xef7b('0x20')](_0xef7b('0x21'),_0x2bd070+'-'+_0x3259eb+'/'+_0x1773a4)[_0xef7b('0x1c')](_0x4ba40e);}return null;};}function patchUpdates(_0x4c97d6){return function(_0x17dcc3){try{jsonpatch[_0xef7b('0x22')](_0x17dcc3,_0x4c97d6,!![]);}catch(_0x2256d9){return BPromise[_0xef7b('0x23')](_0x2256d9);}return _0x17dcc3['save']();};}function saveUpdates(_0x57d3ae,_0x59e0cb){return function(_0x18d48c){if(_0x18d48c){return _0x18d48c[_0xef7b('0x24')](_0x57d3ae)[_0xef7b('0x25')](function(_0x49178d){return _0x49178d;});}return null;};}function removeEntity(_0x528ae2,_0x46aab7){return function(_0xcdedf0){if(_0xcdedf0){return _0xcdedf0[_0xef7b('0x26')]()[_0xef7b('0x25')](function(){_0x528ae2[_0xef7b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7277a,_0x3284fa){return function(_0x50f700){if(!_0x50f700){_0xa7277a[_0xef7b('0x19')](0x194);}return _0x50f700;};}function handleError(_0x4ca554,_0x129763){_0x129763=_0x129763||0x1f4;return function(_0x2d039a){logger[_0xef7b('0x27')](_0x2d039a[_0xef7b('0x28')]);if(_0x2d039a[_0xef7b('0x29')]){delete _0x2d039a[_0xef7b('0x29')];}_0x4ca554['status'](_0x129763)[_0xef7b('0x2a')](_0x2d039a);};}exports[_0xef7b('0x2b')]=function(_0x29bb33,_0x537523){var _0x53793b={},_0x487c39={},_0x37d210={'count':0x0,'rows':[]};var _0x1b34b5=_['map'](db[_0xef7b('0x2c')]['rawAttributes'],function(_0xe04ca9){return{'name':_0xe04ca9[_0xef7b('0x2d')],'type':_0xe04ca9['type'][_0xef7b('0x2e')]};});_0x487c39['model']=_[_0xef7b('0x2f')](_0x1b34b5,'name');_0x487c39['query']=_[_0xef7b('0x30')](_0x29bb33['query']);_0x487c39[_0xef7b('0x31')]=_[_0xef7b('0x32')](_0x487c39['model'],_0x487c39[_0xef7b('0x33')]);_0x53793b[_0xef7b('0x34')]=_['intersection'](_0x487c39[_0xef7b('0x35')],qs[_0xef7b('0x36')](_0x29bb33[_0xef7b('0x33')][_0xef7b('0x36')]));_0x53793b[_0xef7b('0x34')]=_0x53793b[_0xef7b('0x34')][_0xef7b('0x37')]?_0x53793b[_0xef7b('0x34')]:_0x487c39[_0xef7b('0x35')];if(!_0x29bb33[_0xef7b('0x33')][_0xef7b('0x38')](_0xef7b('0x39'))){_0x53793b[_0xef7b('0x3a')]=qs['limit'](_0x29bb33[_0xef7b('0x33')][_0xef7b('0x3a')]);_0x53793b[_0xef7b('0x1d')]=qs[_0xef7b('0x1d')](_0x29bb33[_0xef7b('0x33')]['offset']);}_0x53793b[_0xef7b('0x3b')]=qs[_0xef7b('0x3c')](_0x29bb33[_0xef7b('0x33')][_0xef7b('0x3c')]);_0x53793b[_0xef7b('0x3d')]=qs['filters'](_[_0xef7b('0x3e')](_0x29bb33[_0xef7b('0x33')],_0x487c39['filters']),_0x1b34b5);if(_0x29bb33[_0xef7b('0x33')]['filter']){_0x53793b[_0xef7b('0x3d')]=_[_0xef7b('0x3f')](_0x53793b[_0xef7b('0x3d')],{'$or':_[_0xef7b('0x2f')](_0x1b34b5,function(_0x2942e1){if(_0x2942e1['type']!=='VIRTUAL'){var _0x57f0ec={};_0x57f0ec[_0x2942e1[_0xef7b('0x29')]]={'$like':'%'+_0x29bb33[_0xef7b('0x33')][_0xef7b('0x40')]+'%'};return _0x57f0ec;}})});}_0x53793b=_[_0xef7b('0x3f')]({},_0x53793b,_0x29bb33[_0xef7b('0x41')]);var _0x53947d={'where':_0x53793b[_0xef7b('0x3d')]};return db['Automation'][_0xef7b('0x1f')](_0x53947d)['then'](function(_0x1047fe){_0x37d210['count']=_0x1047fe;if(_0x29bb33[_0xef7b('0x33')]['includeAll']){_0x53793b['include']=[{'all':!![]}];}return db[_0xef7b('0x2c')][_0xef7b('0x42')](_0x53793b);})['then'](function(_0x56f9dc){_0x37d210[_0xef7b('0x43')]=_0x56f9dc;return _0x37d210;})[_0xef7b('0x25')](respondWithFilteredResult(_0x537523,_0x53793b))['catch'](handleError(_0x537523,null));};exports[_0xef7b('0x44')]=function(_0xb2beb4,_0x1d2d94){var _0x2f8703={'raw':![],'where':{'id':_0xb2beb4['params']['id']}},_0x361009={};_0x361009[_0xef7b('0x35')]=_[_0xef7b('0x30')](db[_0xef7b('0x2c')][_0xef7b('0x45')]);_0x361009[_0xef7b('0x33')]=_[_0xef7b('0x30')](_0xb2beb4[_0xef7b('0x33')]);_0x361009[_0xef7b('0x31')]=_[_0xef7b('0x32')](_0x361009['model'],_0x361009['query']);_0x2f8703['attributes']=_[_0xef7b('0x32')](_0x361009[_0xef7b('0x35')],qs[_0xef7b('0x36')](_0xb2beb4['query'][_0xef7b('0x36')]));_0x2f8703[_0xef7b('0x34')]=_0x2f8703[_0xef7b('0x34')]['length']?_0x2f8703['attributes']:_0x361009['model'];if(_0xb2beb4[_0xef7b('0x33')][_0xef7b('0x46')]){_0x2f8703[_0xef7b('0x47')]=[{'all':!![]}];}_0x2f8703=_[_0xef7b('0x3f')]({},_0x2f8703,_0xb2beb4[_0xef7b('0x41')]);return db['Automation'][_0xef7b('0x48')](_0x2f8703)[_0xef7b('0x25')](handleEntityNotFound(_0x1d2d94,null))['then'](respondWithResult(_0x1d2d94,null))[_0xef7b('0x49')](handleError(_0x1d2d94,null));};exports[_0xef7b('0x4a')]=function(_0x4099f3,_0x1200f8){return db[_0xef7b('0x2c')][_0xef7b('0x4a')](_0x4099f3[_0xef7b('0x4b')],{})[_0xef7b('0x25')](respondWithResult(_0x1200f8,0xc9))[_0xef7b('0x49')](handleError(_0x1200f8,null));};exports[_0xef7b('0x24')]=function(_0x4f039e,_0x15252a){if(_0x4f039e[_0xef7b('0x4b')]['id']){delete _0x4f039e[_0xef7b('0x4b')]['id'];}return db['Automation'][_0xef7b('0x48')]({'where':{'id':_0x4f039e[_0xef7b('0x4c')]['id']}})[_0xef7b('0x25')](handleEntityNotFound(_0x15252a,null))[_0xef7b('0x25')](saveUpdates(_0x4f039e['body'],null))[_0xef7b('0x25')](respondWithResult(_0x15252a,null))[_0xef7b('0x49')](handleError(_0x15252a,null));};exports[_0xef7b('0x26')]=function(_0x3b3bae,_0x4ecd46){return db[_0xef7b('0x2c')][_0xef7b('0x48')]({'where':{'id':_0x3b3bae[_0xef7b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ecd46,null))[_0xef7b('0x25')](removeEntity(_0x4ecd46,null))[_0xef7b('0x49')](handleError(_0x4ecd46,null));};exports[_0xef7b('0x4d')]=function(_0x4f0b08,_0x26cc60,_0x50d591){return db[_0xef7b('0x4e')][_0xef7b('0x48')]({'where':{'id':_0x4f0b08['params']['id']}})[_0xef7b('0x25')](handleEntityNotFound(_0x26cc60,null))[_0xef7b('0x25')](function(_0x5a994f){if(_0x5a994f){return _0x5a994f[_0xef7b('0x4d')](_0x4f0b08[_0xef7b('0x4b')]['ids'],_[_0xef7b('0x4f')](_0x4f0b08[_0xef7b('0x4b')],[_0xef7b('0x50'),'id'])||{});}})['then'](respondWithResult(_0x26cc60,null))['catch'](handleError(_0x26cc60,null));};exports[_0xef7b('0x51')]=function(_0x81438b,_0x501eb8,_0x1ae32e){var _0x3d98db={};var _0x4fbeb1={};var _0x573323;var _0x620bb0;return db[_0xef7b('0x2c')][_0xef7b('0x52')]({'where':{'id':_0x81438b['params']['id']}})[_0xef7b('0x25')](handleEntityNotFound(_0x501eb8,null))[_0xef7b('0x25')](function(_0x2f366b){if(_0x2f366b){_0x573323=_0x2f366b;_0x4fbeb1[_0xef7b('0x35')]=_[_0xef7b('0x30')](db['Condition']['rawAttributes']);_0x4fbeb1[_0xef7b('0x33')]=_['keys'](_0x81438b[_0xef7b('0x33')]);_0x4fbeb1[_0xef7b('0x31')]=_[_0xef7b('0x32')](_0x4fbeb1[_0xef7b('0x35')],_0x4fbeb1[_0xef7b('0x33')]);_0x3d98db['attributes']=_[_0xef7b('0x32')](_0x4fbeb1[_0xef7b('0x35')],qs[_0xef7b('0x36')](_0x81438b['query'][_0xef7b('0x36')]));_0x3d98db[_0xef7b('0x34')]=_0x3d98db['attributes'][_0xef7b('0x37')]?_0x3d98db[_0xef7b('0x34')]:_0x4fbeb1['model'];_0x3d98db[_0xef7b('0x3b')]=qs[_0xef7b('0x3c')](_0x81438b['query'][_0xef7b('0x3c')]);_0x3d98db['where']=qs[_0xef7b('0x31')](_[_0xef7b('0x3e')](_0x81438b[_0xef7b('0x33')],_0x4fbeb1['filters']));if(_0x81438b['query'][_0xef7b('0x40')]){_0x3d98db[_0xef7b('0x3d')]=_[_0xef7b('0x3f')](_0x3d98db[_0xef7b('0x3d')],{'$or':_[_0xef7b('0x2f')](_0x3d98db[_0xef7b('0x34')],function(_0x4c5111){var _0x87f8eb={};_0x87f8eb[_0x4c5111]={'$like':'%'+_0x81438b[_0xef7b('0x33')][_0xef7b('0x40')]+'%'};return _0x87f8eb;})});}_0x3d98db=_[_0xef7b('0x3f')]({},_0x3d98db,_0x81438b['options']);return _0x573323[_0xef7b('0x51')](_0x3d98db);}})[_0xef7b('0x25')](function(_0xfe5639){if(_0xfe5639){_0x620bb0=_0xfe5639[_0xef7b('0x37')];if(!_0x81438b['query'][_0xef7b('0x38')]('nolimit')){_0x3d98db['limit']=qs[_0xef7b('0x3a')](_0x81438b[_0xef7b('0x33')][_0xef7b('0x3a')]);_0x3d98db['offset']=qs[_0xef7b('0x1d')](_0x81438b[_0xef7b('0x33')][_0xef7b('0x1d')]);}return _0x573323[_0xef7b('0x51')](_0x3d98db);}})[_0xef7b('0x25')](function(_0x14d7b5){if(_0x14d7b5){return _0x14d7b5?{'count':_0x620bb0,'rows':_0x14d7b5}:null;}})[_0xef7b('0x25')](respondWithResult(_0x501eb8,null))['catch'](handleError(_0x501eb8,null));};exports['addActions']=function(_0x10da1f,_0x1b5a05,_0x1704ef){return db['Action'][_0xef7b('0x48')]({'where':{'id':_0x10da1f[_0xef7b('0x4c')]['id']}})[_0xef7b('0x25')](handleEntityNotFound(_0x1b5a05,null))['then'](function(_0x5a4300){if(_0x5a4300){return _0x5a4300[_0xef7b('0x53')](_0x10da1f[_0xef7b('0x4b')]['ids'],_[_0xef7b('0x4f')](_0x10da1f[_0xef7b('0x4b')],[_0xef7b('0x50'),'id'])||{});}})[_0xef7b('0x25')](respondWithResult(_0x1b5a05,null))[_0xef7b('0x49')](handleError(_0x1b5a05,null));};exports['getActions']=function(_0x2d41d2,_0x507579,_0x1605f8){var _0x54ea9b={};var _0x506466={};var _0x4fe7b3;var _0x2a1131;return db[_0xef7b('0x2c')][_0xef7b('0x52')]({'where':{'id':_0x2d41d2[_0xef7b('0x4c')]['id']}})[_0xef7b('0x25')](handleEntityNotFound(_0x507579,null))[_0xef7b('0x25')](function(_0x35124f){if(_0x35124f){_0x4fe7b3=_0x35124f;_0x506466[_0xef7b('0x35')]=_[_0xef7b('0x30')](db['Action'][_0xef7b('0x45')]);_0x506466[_0xef7b('0x33')]=_[_0xef7b('0x30')](_0x2d41d2[_0xef7b('0x33')]);_0x506466[_0xef7b('0x31')]=_[_0xef7b('0x32')](_0x506466[_0xef7b('0x35')],_0x506466['query']);_0x54ea9b[_0xef7b('0x34')]=_[_0xef7b('0x32')](_0x506466[_0xef7b('0x35')],qs[_0xef7b('0x36')](_0x2d41d2[_0xef7b('0x33')][_0xef7b('0x36')]));_0x54ea9b[_0xef7b('0x34')]=_0x54ea9b[_0xef7b('0x34')]['length']?_0x54ea9b['attributes']:_0x506466['model'];_0x54ea9b[_0xef7b('0x3b')]=qs[_0xef7b('0x3c')](_0x2d41d2[_0xef7b('0x33')][_0xef7b('0x3c')]);_0x54ea9b['where']=qs[_0xef7b('0x31')](_[_0xef7b('0x3e')](_0x2d41d2['query'],_0x506466['filters']));if(_0x2d41d2[_0xef7b('0x33')]['filter']){_0x54ea9b[_0xef7b('0x3d')]=_['merge'](_0x54ea9b['where'],{'$or':_[_0xef7b('0x2f')](_0x54ea9b[_0xef7b('0x34')],function(_0x324c13){var _0x37ba50={};_0x37ba50[_0x324c13]={'$like':'%'+_0x2d41d2['query']['filter']+'%'};return _0x37ba50;})});}_0x54ea9b=_[_0xef7b('0x3f')]({},_0x54ea9b,_0x2d41d2[_0xef7b('0x41')]);return _0x4fe7b3[_0xef7b('0x54')](_0x54ea9b);}})[_0xef7b('0x25')](function(_0x38b2ac){if(_0x38b2ac){_0x2a1131=_0x38b2ac['length'];if(!_0x2d41d2[_0xef7b('0x33')][_0xef7b('0x38')](_0xef7b('0x39'))){_0x54ea9b[_0xef7b('0x3a')]=qs[_0xef7b('0x3a')](_0x2d41d2['query']['limit']);_0x54ea9b[_0xef7b('0x1d')]=qs['offset'](_0x2d41d2[_0xef7b('0x33')][_0xef7b('0x1d')]);}return _0x4fe7b3[_0xef7b('0x54')](_0x54ea9b);}})[_0xef7b('0x25')](function(_0x2a00d0){if(_0x2a00d0){return _0x2a00d0?{'count':_0x2a1131,'rows':_0x2a00d0}:null;}})[_0xef7b('0x25')](respondWithResult(_0x507579,null))['catch'](handleError(_0x507579,null));}; \ No newline at end of file +var _0xb06c=['findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','rawAttributes','includeAll','include','options','find','create','body','params','destroy','Condition','addConditions','ids','omit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb06c,0x1f3));var _0xcb06=function(_0x35d17f,_0x9b51ae){_0x35d17f=_0x35d17f-0x0;var _0x1b20b2=_0xb06c[_0x35d17f];return _0x1b20b2;};'use strict';var emlformat=require(_0xcb06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb06('0x2'));var BPromise=require(_0xcb06('0x3'));var Mustache=require(_0xcb06('0x4'));var util=require(_0xcb06('0x5'));var path=require(_0xcb06('0x6'));var sox=require(_0xcb06('0x7'));var csv=require('to-csv');var ejs=require(_0xcb06('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb06('0x9'));var squel=require('squel');var crypto=require(_0xcb06('0xa'));var jsforce=require(_0xcb06('0xb'));var deskjs=require(_0xcb06('0xc'));var toCsv=require(_0xcb06('0xd'));var querystring=require(_0xcb06('0xe'));var Papa=require(_0xcb06('0xf'));var Redis=require(_0xcb06('0x10'));var authService=require(_0xcb06('0x11'));var qs=require(_0xcb06('0x12'));var as=require(_0xcb06('0x13'));var hardwareService=require(_0xcb06('0x14'));var logger=require(_0xcb06('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcb06('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c4ea,_0x3fac23){_0x3fac23=_0x3fac23||0xcc;return function(_0x20868f){if(_0x20868f){return _0x35c4ea['sendStatus'](_0x3fac23);}return _0x35c4ea[_0xcb06('0x17')](_0x3fac23)['end']();};}function respondWithResult(_0x212d81,_0x13b379){_0x13b379=_0x13b379||0xc8;return function(_0x2e47ce){if(_0x2e47ce){return _0x212d81[_0xcb06('0x17')](_0x13b379)[_0xcb06('0x18')](_0x2e47ce);}};}function respondWithFilteredResult(_0x2ae667,_0x46fbe1){return function(_0xb58947){if(_0xb58947){var _0x3676ce=typeof _0x46fbe1[_0xcb06('0x19')]==='undefined'&&typeof _0x46fbe1['limit']===_0xcb06('0x1a');var _0x229d9a=_0xb58947['count'];var _0x51fce6=_0x3676ce?0x0:_0x46fbe1[_0xcb06('0x19')];var _0x5ddb3d=_0x3676ce?_0xb58947[_0xcb06('0x1b')]:_0x46fbe1[_0xcb06('0x19')]+_0x46fbe1[_0xcb06('0x1c')];var _0x28f50d;if(_0x5ddb3d>=_0x229d9a){_0x5ddb3d=_0x229d9a;_0x28f50d=0xc8;}else{_0x28f50d=0xce;}_0x2ae667[_0xcb06('0x17')](_0x28f50d);return _0x2ae667[_0xcb06('0x1d')]('Content-Range',_0x51fce6+'-'+_0x5ddb3d+'/'+_0x229d9a)[_0xcb06('0x18')](_0xb58947);}return null;};}function patchUpdates(_0x72cebc){return function(_0x1f0862){try{jsonpatch[_0xcb06('0x1e')](_0x1f0862,_0x72cebc,!![]);}catch(_0x3df251){return BPromise[_0xcb06('0x1f')](_0x3df251);}return _0x1f0862[_0xcb06('0x20')]();};}function saveUpdates(_0x1f2dd3,_0x496c6f){return function(_0x441d78){if(_0x441d78){return _0x441d78[_0xcb06('0x21')](_0x1f2dd3)[_0xcb06('0x22')](function(_0x2b8521){return _0x2b8521;});}return null;};}function removeEntity(_0x46373e,_0x30ff21){return function(_0x4b7471){if(_0x4b7471){return _0x4b7471['destroy']()[_0xcb06('0x22')](function(){_0x46373e[_0xcb06('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc387,_0x1b43fa){return function(_0x44550b){if(!_0x44550b){_0x4fc387['sendStatus'](0x194);}return _0x44550b;};}function handleError(_0x33a723,_0x4ea798){_0x4ea798=_0x4ea798||0x1f4;return function(_0x20ef7d){logger['error'](_0x20ef7d[_0xcb06('0x23')]);if(_0x20ef7d[_0xcb06('0x24')]){delete _0x20ef7d[_0xcb06('0x24')];}_0x33a723[_0xcb06('0x17')](_0x4ea798)['send'](_0x20ef7d);};}exports[_0xcb06('0x25')]=function(_0xffe81c,_0x2a078d){var _0x2a4447={},_0x2a51d4={},_0x9f0fff={'count':0x0,'rows':[]};var _0x326e00=_[_0xcb06('0x26')](db[_0xcb06('0x27')]['rawAttributes'],function(_0x820d4){return{'name':_0x820d4[_0xcb06('0x28')],'type':_0x820d4[_0xcb06('0x29')][_0xcb06('0x2a')]};});_0x2a51d4[_0xcb06('0x2b')]=_[_0xcb06('0x26')](_0x326e00,_0xcb06('0x24'));_0x2a51d4[_0xcb06('0x2c')]=_[_0xcb06('0x2d')](_0xffe81c['query']);_0x2a51d4[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x2a51d4['model'],_0x2a51d4[_0xcb06('0x2c')]);_0x2a4447[_0xcb06('0x30')]=_[_0xcb06('0x2f')](_0x2a51d4[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0xffe81c['query'][_0xcb06('0x31')]));_0x2a4447[_0xcb06('0x30')]=_0x2a4447[_0xcb06('0x30')][_0xcb06('0x32')]?_0x2a4447[_0xcb06('0x30')]:_0x2a51d4[_0xcb06('0x2b')];if(!_0xffe81c[_0xcb06('0x2c')]['hasOwnProperty']('nolimit')){_0x2a4447[_0xcb06('0x1c')]=qs[_0xcb06('0x1c')](_0xffe81c['query']['limit']);_0x2a4447['offset']=qs[_0xcb06('0x19')](_0xffe81c[_0xcb06('0x2c')][_0xcb06('0x19')]);}_0x2a4447[_0xcb06('0x33')]=qs[_0xcb06('0x34')](_0xffe81c['query'][_0xcb06('0x34')]);_0x2a4447['where']=qs[_0xcb06('0x2e')](_[_0xcb06('0x35')](_0xffe81c[_0xcb06('0x2c')],_0x2a51d4[_0xcb06('0x2e')]),_0x326e00);if(_0xffe81c[_0xcb06('0x2c')][_0xcb06('0x36')]){_0x2a4447[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x2a4447['where'],{'$or':_[_0xcb06('0x26')](_0x326e00,function(_0x4ff4b1){if(_0x4ff4b1[_0xcb06('0x29')]!==_0xcb06('0x39')){var _0x56c6cd={};_0x56c6cd[_0x4ff4b1['name']]={'$like':'%'+_0xffe81c[_0xcb06('0x2c')]['filter']+'%'};return _0x56c6cd;}})});}_0x2a4447=_[_0xcb06('0x38')]({},_0x2a4447,_0xffe81c['options']);var _0x3f914f={'where':_0x2a4447[_0xcb06('0x37')]};return db[_0xcb06('0x27')][_0xcb06('0x1b')](_0x3f914f)[_0xcb06('0x22')](function(_0x44ddc4){_0x9f0fff[_0xcb06('0x1b')]=_0x44ddc4;if(_0xffe81c[_0xcb06('0x2c')]['includeAll']){_0x2a4447['include']=[{'all':!![]}];}return db[_0xcb06('0x27')][_0xcb06('0x3a')](_0x2a4447);})[_0xcb06('0x22')](function(_0x11d594){_0x9f0fff[_0xcb06('0x3b')]=_0x11d594;return _0x9f0fff;})[_0xcb06('0x22')](respondWithFilteredResult(_0x2a078d,_0x2a4447))[_0xcb06('0x3c')](handleError(_0x2a078d,null));};exports[_0xcb06('0x3d')]=function(_0x4c0bd8,_0x3a1e0f){var _0x3fdce0={'raw':![],'where':{'id':_0x4c0bd8['params']['id']}},_0x3b812d={};_0x3b812d['model']=_[_0xcb06('0x2d')](db[_0xcb06('0x27')][_0xcb06('0x3e')]);_0x3b812d[_0xcb06('0x2c')]=_[_0xcb06('0x2d')](_0x4c0bd8[_0xcb06('0x2c')]);_0x3b812d[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x3b812d[_0xcb06('0x2b')],_0x3b812d[_0xcb06('0x2c')]);_0x3fdce0[_0xcb06('0x30')]=_['intersection'](_0x3b812d[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0x4c0bd8[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x3fdce0['attributes']=_0x3fdce0[_0xcb06('0x30')]['length']?_0x3fdce0[_0xcb06('0x30')]:_0x3b812d['model'];if(_0x4c0bd8[_0xcb06('0x2c')][_0xcb06('0x3f')]){_0x3fdce0[_0xcb06('0x40')]=[{'all':!![]}];}_0x3fdce0=_[_0xcb06('0x38')]({},_0x3fdce0,_0x4c0bd8[_0xcb06('0x41')]);return db['Automation'][_0xcb06('0x42')](_0x3fdce0)[_0xcb06('0x22')](handleEntityNotFound(_0x3a1e0f,null))[_0xcb06('0x22')](respondWithResult(_0x3a1e0f,null))[_0xcb06('0x3c')](handleError(_0x3a1e0f,null));};exports[_0xcb06('0x43')]=function(_0x26094e,_0x1581da){return db[_0xcb06('0x27')][_0xcb06('0x43')](_0x26094e[_0xcb06('0x44')],{})[_0xcb06('0x22')](respondWithResult(_0x1581da,0xc9))['catch'](handleError(_0x1581da,null));};exports[_0xcb06('0x21')]=function(_0xb5578c,_0x57736d){if(_0xb5578c['body']['id']){delete _0xb5578c[_0xcb06('0x44')]['id'];}return db[_0xcb06('0x27')][_0xcb06('0x42')]({'where':{'id':_0xb5578c[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x57736d,null))[_0xcb06('0x22')](saveUpdates(_0xb5578c['body'],null))[_0xcb06('0x22')](respondWithResult(_0x57736d,null))[_0xcb06('0x3c')](handleError(_0x57736d,null));};exports[_0xcb06('0x46')]=function(_0x3930de,_0x418469){return db['Automation'][_0xcb06('0x42')]({'where':{'id':_0x3930de[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x418469,null))[_0xcb06('0x22')](removeEntity(_0x418469,null))['catch'](handleError(_0x418469,null));};exports['addConditions']=function(_0x36e4f1,_0x537bea,_0x388d93){return db[_0xcb06('0x47')][_0xcb06('0x42')]({'where':{'id':_0x36e4f1[_0xcb06('0x45')]['id']}})['then'](handleEntityNotFound(_0x537bea,null))[_0xcb06('0x22')](function(_0x695593){if(_0x695593){return _0x695593[_0xcb06('0x48')](_0x36e4f1[_0xcb06('0x44')][_0xcb06('0x49')],_[_0xcb06('0x4a')](_0x36e4f1[_0xcb06('0x44')],[_0xcb06('0x49'),'id'])||{});}})[_0xcb06('0x22')](respondWithResult(_0x537bea,null))['catch'](handleError(_0x537bea,null));};exports['getConditions']=function(_0x2aa377,_0x3f628c,_0x2f0aaa){var _0x2afcc0={};var _0x73e0a4={};var _0x42bf01;var _0x15b869;return db[_0xcb06('0x27')][_0xcb06('0x4b')]({'where':{'id':_0x2aa377[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x3f628c,null))[_0xcb06('0x22')](function(_0x22e5a8){if(_0x22e5a8){_0x42bf01=_0x22e5a8;_0x73e0a4[_0xcb06('0x2b')]=_[_0xcb06('0x2d')](db[_0xcb06('0x47')][_0xcb06('0x3e')]);_0x73e0a4['query']=_['keys'](_0x2aa377['query']);_0x73e0a4['filters']=_[_0xcb06('0x2f')](_0x73e0a4[_0xcb06('0x2b')],_0x73e0a4['query']);_0x2afcc0[_0xcb06('0x30')]=_['intersection'](_0x73e0a4['model'],qs['fields'](_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x2afcc0[_0xcb06('0x30')]=_0x2afcc0[_0xcb06('0x30')]['length']?_0x2afcc0['attributes']:_0x73e0a4['model'];_0x2afcc0[_0xcb06('0x33')]=qs[_0xcb06('0x34')](_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x34')]);_0x2afcc0[_0xcb06('0x37')]=qs[_0xcb06('0x2e')](_['pick'](_0x2aa377['query'],_0x73e0a4[_0xcb06('0x2e')]));if(_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x36')]){_0x2afcc0[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x2afcc0[_0xcb06('0x37')],{'$or':_[_0xcb06('0x26')](_0x2afcc0['attributes'],function(_0x2e9121){var _0x1256de={};_0x1256de[_0x2e9121]={'$like':'%'+_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x36')]+'%'};return _0x1256de;})});}_0x2afcc0=_['merge']({},_0x2afcc0,_0x2aa377[_0xcb06('0x41')]);return _0x42bf01[_0xcb06('0x4c')](_0x2afcc0);}})[_0xcb06('0x22')](function(_0x2b0c22){if(_0x2b0c22){_0x15b869=_0x2b0c22[_0xcb06('0x32')];if(!_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x4d')](_0xcb06('0x4e'))){_0x2afcc0[_0xcb06('0x1c')]=qs['limit'](_0x2aa377[_0xcb06('0x2c')]['limit']);_0x2afcc0[_0xcb06('0x19')]=qs['offset'](_0x2aa377['query'][_0xcb06('0x19')]);}return _0x42bf01[_0xcb06('0x4c')](_0x2afcc0);}})[_0xcb06('0x22')](function(_0x152823){if(_0x152823){return _0x152823?{'count':_0x15b869,'rows':_0x152823}:null;}})[_0xcb06('0x22')](respondWithResult(_0x3f628c,null))[_0xcb06('0x3c')](handleError(_0x3f628c,null));};exports[_0xcb06('0x4f')]=function(_0x43bf9c,_0x4a6cae,_0x93f8d6){return db['Action'][_0xcb06('0x42')]({'where':{'id':_0x43bf9c[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x4a6cae,null))['then'](function(_0xa35df8){if(_0xa35df8){return _0xa35df8[_0xcb06('0x4f')](_0x43bf9c[_0xcb06('0x44')][_0xcb06('0x49')],_[_0xcb06('0x4a')](_0x43bf9c['body'],['ids','id'])||{});}})[_0xcb06('0x22')](respondWithResult(_0x4a6cae,null))[_0xcb06('0x3c')](handleError(_0x4a6cae,null));};exports['getActions']=function(_0x426efc,_0x5ec4eb,_0x507013){var _0x4ac03c={};var _0x3ecd16={};var _0x3cbd62;var _0x57f46c;return db[_0xcb06('0x27')]['findOne']({'where':{'id':_0x426efc[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x5ec4eb,null))[_0xcb06('0x22')](function(_0x1ab9ed){if(_0x1ab9ed){_0x3cbd62=_0x1ab9ed;_0x3ecd16[_0xcb06('0x2b')]=_[_0xcb06('0x2d')](db[_0xcb06('0x50')][_0xcb06('0x3e')]);_0x3ecd16[_0xcb06('0x2c')]=_['keys'](_0x426efc[_0xcb06('0x2c')]);_0x3ecd16[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x3ecd16[_0xcb06('0x2b')],_0x3ecd16[_0xcb06('0x2c')]);_0x4ac03c[_0xcb06('0x30')]=_['intersection'](_0x3ecd16[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x4ac03c[_0xcb06('0x30')]=_0x4ac03c[_0xcb06('0x30')][_0xcb06('0x32')]?_0x4ac03c[_0xcb06('0x30')]:_0x3ecd16[_0xcb06('0x2b')];_0x4ac03c[_0xcb06('0x33')]=qs['sort'](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x34')]);_0x4ac03c[_0xcb06('0x37')]=qs[_0xcb06('0x2e')](_[_0xcb06('0x35')](_0x426efc[_0xcb06('0x2c')],_0x3ecd16[_0xcb06('0x2e')]));if(_0x426efc[_0xcb06('0x2c')]['filter']){_0x4ac03c[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x4ac03c[_0xcb06('0x37')],{'$or':_['map'](_0x4ac03c['attributes'],function(_0x45bcc9){var _0x1b60b2={};_0x1b60b2[_0x45bcc9]={'$like':'%'+_0x426efc[_0xcb06('0x2c')][_0xcb06('0x36')]+'%'};return _0x1b60b2;})});}_0x4ac03c=_[_0xcb06('0x38')]({},_0x4ac03c,_0x426efc['options']);return _0x3cbd62[_0xcb06('0x51')](_0x4ac03c);}})[_0xcb06('0x22')](function(_0x4987e8){if(_0x4987e8){_0x57f46c=_0x4987e8[_0xcb06('0x32')];if(!_0x426efc[_0xcb06('0x2c')][_0xcb06('0x4d')](_0xcb06('0x4e'))){_0x4ac03c[_0xcb06('0x1c')]=qs[_0xcb06('0x1c')](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x1c')]);_0x4ac03c['offset']=qs[_0xcb06('0x19')](_0x426efc['query'][_0xcb06('0x19')]);}return _0x3cbd62[_0xcb06('0x51')](_0x4ac03c);}})[_0xcb06('0x22')](function(_0x42ebd3){if(_0x42ebd3){return _0x42ebd3?{'count':_0x57f46c,'rows':_0x42ebd3}:null;}})[_0xcb06('0x22')](respondWithResult(_0x5ec4eb,null))[_0xcb06('0x3c')](handleError(_0x5ec4eb,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index caf386f..056e4aa 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 _0xd1a5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api'];(function(_0x4d36f4,_0x13415e){var _0x247f4d=function(_0x24a5e7){while(--_0x24a5e7){_0x4d36f4['push'](_0x4d36f4['shift']());}};_0x247f4d(++_0x13415e);}(_0xd1a5,0xce));var _0x5d1a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xd1a5[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x5d1a('0x0'));var util=require(_0x5d1a('0x1'));var logger=require(_0x5d1a('0x2'))(_0x5d1a('0x3'));var moment=require(_0x5d1a('0x4'));var BPromise=require(_0x5d1a('0x5'));var rp=require(_0x5d1a('0x6'));var fs=require('fs');var path=require(_0x5d1a('0x7'));var rimraf=require(_0x5d1a('0x8'));var config=require(_0x5d1a('0x9'));var attributes=require(_0x5d1a('0xa'));module[_0x5d1a('0xb')]=function(_0x661664,_0x29989d){return _0x661664[_0x5d1a('0xc')](_0x5d1a('0xd'),attributes,{'tableName':_0x5d1a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a45=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x4a45,0x180));var _0x54a4=function(_0x294272,_0x178245){_0x294272=_0x294272-0x0;var _0x36fcf9=_0x4a45[_0x294272];return _0x36fcf9;};'use strict';var _=require('lodash');var util=require(_0x54a4('0x0'));var logger=require(_0x54a4('0x1'))(_0x54a4('0x2'));var moment=require(_0x54a4('0x3'));var BPromise=require(_0x54a4('0x4'));var rp=require(_0x54a4('0x5'));var fs=require('fs');var path=require(_0x54a4('0x6'));var rimraf=require(_0x54a4('0x7'));var config=require(_0x54a4('0x8'));var attributes=require(_0x54a4('0x9'));module[_0x54a4('0xa')]=function(_0x39c5c9,_0x406abf){return _0x39c5c9[_0x54a4('0xb')]('Automation',attributes,{'tableName':'tools_automations','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 84555fc..0b468ef 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 _0xbecf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x36feba,_0x2e2430){var _0x46a718=function(_0x38f84d){while(--_0x38f84d){_0x36feba['push'](_0x36feba['shift']());}};_0x46a718(++_0x2e2430);}(_0xbecf,0x15c));var _0xfbec=function(_0x494eb8,_0x2ee75e){_0x494eb8=_0x494eb8-0x0;var _0x2013b3=_0xbecf[_0x494eb8];return _0x2013b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbec('0x0'));var BPromise=require(_0xfbec('0x1'));var rs=require(_0xfbec('0x2'));var fs=require('fs');var Redis=require(_0xfbec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbec('0x4'));var logger=require(_0xfbec('0x5'))(_0xfbec('0x6'));var config=require(_0xfbec('0x7'));var jayson=require(_0xfbec('0x8'));var client=jayson['client'][_0xfbec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34a717,_0x33c701,_0x410cab){return new BPromise(function(_0x43bc5b,_0x312ad1){return client[_0xfbec('0xa')](_0x34a717,_0x410cab)[_0xfbec('0xb')](function(_0x21863f){logger['info']('Automation,\x20%s,\x20%s',_0x33c701,'request\x20sent');logger[_0xfbec('0xc')](_0xfbec('0xd'),_0x33c701,_0xfbec('0xe'),JSON[_0xfbec('0xf')](_0x21863f));if(_0x21863f[_0xfbec('0x10')]){if(_0x21863f['error'][_0xfbec('0x11')]===0x1f4){logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f[_0xfbec('0x10')]['message']);return _0x312ad1(_0x21863f[_0xfbec('0x10')][_0xfbec('0x13')]);}logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f['error'][_0xfbec('0x13')]);return _0x43bc5b(_0x21863f['error'][_0xfbec('0x13')]);}else{logger['info'](_0xfbec('0x12'),_0x33c701,_0xfbec('0xe'));_0x43bc5b(_0x21863f[_0xfbec('0x14')]['message']);}})[_0xfbec('0x15')](function(_0x2a3329){logger[_0xfbec('0x10')]('Automation,\x20%s,\x20%s',_0x33c701,_0x2a3329);_0x312ad1(_0x2a3329);});});} \ No newline at end of file +var _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x1c9a,0x98));var _0xa1c9=function(_0x558759,_0xd9ea38){_0x558759=_0x558759-0x0;var _0x1c712f=_0x1c9a[_0x558759];return _0x1c712f;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4116b8a..cf85eff 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 _0xd58c=['/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd58c,0xb6));var _0xcd58=function(_0x54ff7a,_0x425ffc){_0x54ff7a=_0x54ff7a-0x0;var _0x4c6106=_0xd58c[_0x54ff7a];return _0x4c6106;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd58('0x3'));var router=express['Router']();var fs_extra=require(_0xcd58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var controller=require(_0xcd58('0x7'));router[_0xcd58('0x8')]('/',auth[_0xcd58('0x9')](),controller['index']);router['get'](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0xb')]);router[_0xcd58('0x8')](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0xd')]);router[_0xcd58('0x8')]('/:id/actions',auth[_0xcd58('0x9')](),controller['getActions']);router[_0xcd58('0xe')]('/',auth[_0xcd58('0x9')](),controller[_0xcd58('0xf')]);router['post'](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0x10')]);router['post'](_0xcd58('0x11'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x12')]);router[_0xcd58('0x13')](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x14')]);router[_0xcd58('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcd58('0x16')]);module[_0xcd58('0x17')]=router; \ No newline at end of file +var _0x4c67=['show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x3d40db,_0x26f3c1){var _0x3b92c4=function(_0x28c086){while(--_0x28c086){_0x3d40db['push'](_0x3d40db['shift']());}};_0x3b92c4(++_0x26f3c1);}(_0x4c67,0x1cd));var _0x74c6=function(_0x52b034,_0x5d89ff){_0x52b034=_0x52b034-0x0;var _0xeb7545=_0x4c67[_0x52b034];return _0xeb7545;};'use strict';var multer=require(_0x74c6('0x0'));var util=require(_0x74c6('0x1'));var path=require(_0x74c6('0x2'));var timeout=require(_0x74c6('0x3'));var express=require(_0x74c6('0x4'));var router=express[_0x74c6('0x5')]();var fs_extra=require(_0x74c6('0x6'));var auth=require(_0x74c6('0x7'));var interaction=require(_0x74c6('0x8'));var config=require(_0x74c6('0x9'));var controller=require(_0x74c6('0xa'));router[_0x74c6('0xb')]('/',auth[_0x74c6('0xc')](),controller[_0x74c6('0xd')]);router[_0x74c6('0xb')]('/:id',auth[_0x74c6('0xc')](),controller[_0x74c6('0xe')]);router[_0x74c6('0xb')](_0x74c6('0xf'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x10')]);router['get'](_0x74c6('0x11'),auth['isAuthenticated'](),controller[_0x74c6('0x12')]);router[_0x74c6('0x13')]('/',auth[_0x74c6('0xc')](),controller['create']);router[_0x74c6('0x13')]('/:id/conditions',auth[_0x74c6('0xc')](),controller[_0x74c6('0x14')]);router['post'](_0x74c6('0x11'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x15')]);router['put'](_0x74c6('0x16'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x17')]);router['delete'](_0x74c6('0x16'),auth['isAuthenticated'](),controller[_0x74c6('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 1e12934..5ce4d1f 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 _0xaa61=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','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)','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)'];(function(_0x4abffc,_0x31ea3f){var _0xa42cf6=function(_0x1b8d6b){while(--_0x1b8d6b){_0x4abffc['push'](_0x4abffc['shift']());}};_0xa42cf6(++_0x31ea3f);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x34a89a,_0x4895e3){_0x34a89a=_0x34a89a-0x0;var _0x47f646=_0xaa61[_0x34a89a];return _0x47f646;};'use strict';var Sequelize=require(_0x1aa6('0x0'));module[_0x1aa6('0x1')]={'name':{'type':Sequelize[_0x1aa6('0x2')],'unique':_0x1aa6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1aa6('0x4')),'allowNull':![],'defaultValue':_0x1aa6('0x4')},'description':{'type':Sequelize[_0x1aa6('0x2')]},'active':{'type':Sequelize[_0x1aa6('0x5')],'defaultValue':0x0,'comment':_0x1aa6('0x6')},'limitCalls':{'type':Sequelize[_0x1aa6('0x7')](0x4)[_0x1aa6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1aa6('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1aa6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1aa6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1aa6('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1aa6('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1aa6('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1aa6('0x7')](0x5)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'comment':_0x1aa6('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1aa6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1aa6('0x11')},'dialTimezone':{'type':Sequelize[_0x1aa6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1aa6('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1aa6('0x12')](_0x1aa6('0x13'),'never',_0x1aa6('0x14')),'defaultValue':_0x1aa6('0x13')},'dialAMDActive':{'type':Sequelize[_0x1aa6('0x5')],'defaultValue':0x0,'comment':_0x1aa6('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x1aa6('0x7')](0x9)[_0x1aa6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1aa6('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1aa6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1aa6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1aa6('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1aa6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1aa6('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1aa6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1aa6('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1aa6('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1aa6('0x7')](0x9)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1aa6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1aa6('0x7')](0x9)[_0x1aa6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1aa6('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1aa6('0x12')]('DESC',_0x1aa6('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1aa6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1aa6('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1aa6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1aa6('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1aa6('0x7')](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1aa6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1aa6('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1aa6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1aa6('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1aa6('0x7')](0x5)[_0x1aa6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x6c93=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x6c93,0x160));var _0x36c9=function(_0x18cf74,_0x1b6eb6){_0x18cf74=_0x18cf74-0x0;var _0x2f6f1f=_0x6c93[_0x18cf74];return _0x2f6f1f;};'use strict';var Sequelize=require(_0x36c9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x36c9('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x36c9('0x2')](_0x36c9('0x3')),'allowNull':![],'defaultValue':_0x36c9('0x3')},'description':{'type':Sequelize[_0x36c9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x36c9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x36c9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x36c9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x36c9('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x36c9('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'comment':_0x36c9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x36c9('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x36c9('0x2')](_0x36c9('0xf'),'never',_0x36c9('0x10')),'defaultValue':_0x36c9('0xf')},'dialAMDActive':{'type':Sequelize[_0x36c9('0x11')],'defaultValue':0x0,'comment':_0x36c9('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x36c9('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x36c9('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x36c9('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x36c9('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x36c9('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x36c9('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x36c9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x36c9('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x36c9('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x36c9('0x2')]('DESC','ASC'),'defaultValue':_0x36c9('0x1a')},'dialPrefix':{'type':Sequelize[_0x36c9('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x36c9('0x1b')},'dialCutDigit':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 65512ef..17caf92 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 _0x9c45=['CmHopperHistory','pick','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','reject','save','update','destroy','then','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Campaign','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','userProfileId','findOne','CmHopper'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x9c45,0xb2));var _0x59c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c45[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x59c4('0x0'));var rimraf=require(_0x59c4('0x1'));var zipdir=require(_0x59c4('0x2'));var jsonpatch=require(_0x59c4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x59c4('0x4'));var Mustache=require(_0x59c4('0x5'));var util=require(_0x59c4('0x6'));var path=require(_0x59c4('0x7'));var sox=require(_0x59c4('0x8'));var csv=require('to-csv');var ejs=require(_0x59c4('0x9'));var fs=require('fs');var fs_extra=require(_0x59c4('0xa'));var _=require(_0x59c4('0xb'));var squel=require(_0x59c4('0xc'));var crypto=require('crypto');var jsforce=require(_0x59c4('0xd'));var deskjs=require(_0x59c4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x59c4('0xf'));var authService=require(_0x59c4('0x10'));var qs=require(_0x59c4('0x11'));var as=require(_0x59c4('0x12'));var hardwareService=require(_0x59c4('0x13'));var logger=require(_0x59c4('0x14'))('api');var utils=require(_0x59c4('0x15'));var config=require(_0x59c4('0x16'));var licenseUtil=require(_0x59c4('0x17'));var db=require(_0x59c4('0x18'))['db'];function respondWithStatusCode(_0x36d0c5,_0x297476){_0x297476=_0x297476||0xcc;return function(_0x4c72ae){if(_0x4c72ae){return _0x36d0c5['sendStatus'](_0x297476);}return _0x36d0c5['status'](_0x297476)[_0x59c4('0x19')]();};}function respondWithResult(_0x54461f,_0x16f905){_0x16f905=_0x16f905||0xc8;return function(_0x17447e){if(_0x17447e){return _0x54461f[_0x59c4('0x1a')](_0x16f905)[_0x59c4('0x1b')](_0x17447e);}};}function respondWithFilteredResult(_0x4a8a89,_0x15b45e){return function(_0x31673d){if(_0x31673d){var _0x1f79cd=typeof _0x15b45e[_0x59c4('0x1c')]==='undefined'&&typeof _0x15b45e[_0x59c4('0x1d')]===_0x59c4('0x1e');var _0x4be369=_0x31673d['count'];var _0x4bd756=_0x1f79cd?0x0:_0x15b45e[_0x59c4('0x1c')];var _0x162d51=_0x1f79cd?_0x31673d[_0x59c4('0x1f')]:_0x15b45e[_0x59c4('0x1c')]+_0x15b45e[_0x59c4('0x1d')];var _0x56f4be;if(_0x162d51>=_0x4be369){_0x162d51=_0x4be369;_0x56f4be=0xc8;}else{_0x56f4be=0xce;}_0x4a8a89['status'](_0x56f4be);return _0x4a8a89['set']('Content-Range',_0x4bd756+'-'+_0x162d51+'/'+_0x4be369)[_0x59c4('0x1b')](_0x31673d);}return null;};}function patchUpdates(_0x3750dd){return function(_0x1a5b9f){try{jsonpatch['apply'](_0x1a5b9f,_0x3750dd,!![]);}catch(_0x489657){return BPromise[_0x59c4('0x20')](_0x489657);}return _0x1a5b9f[_0x59c4('0x21')]();};}function saveUpdates(_0x70304e,_0x486a63){return function(_0x1de74f){if(_0x1de74f){return _0x1de74f[_0x59c4('0x22')](_0x70304e)['then'](function(_0x57e79b){return _0x57e79b;});}return null;};}function removeEntity(_0x2647bf,_0x42c740){return function(_0x9ab238){if(_0x9ab238){return _0x9ab238[_0x59c4('0x23')]()[_0x59c4('0x24')](function(){var _0x254761=_0x9ab238['get']({'plain':!![]});var _0x4c894e=_0x59c4('0x25');return db[_0x59c4('0x26')]['destroy']({'where':{'type':_0x4c894e,'resourceId':_0x254761['id']}})[_0x59c4('0x24')](function(){return _0x9ab238;});})[_0x59c4('0x24')](function(){_0x2647bf[_0x59c4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536691,_0x288b79){return function(_0x3154a6){if(!_0x3154a6){_0x536691[_0x59c4('0x27')](0x194);}return _0x3154a6;};}function handleError(_0x58dc7e,_0x5332ea){_0x5332ea=_0x5332ea||0x1f4;return function(_0x5690e1){logger[_0x59c4('0x28')](_0x5690e1[_0x59c4('0x29')]);if(_0x5690e1[_0x59c4('0x2a')]){delete _0x5690e1['name'];}_0x58dc7e[_0x59c4('0x1a')](_0x5332ea)[_0x59c4('0x2b')](_0x5690e1);};}exports['index']=function(_0x195031,_0x32ed2d){var _0x31bff7={},_0x4ab322={},_0x2e6ef6={'count':0x0,'rows':[]};var _0x18176b=_[_0x59c4('0x2c')](db['Campaign'][_0x59c4('0x2d')],function(_0x329dd5){return{'name':_0x329dd5[_0x59c4('0x2e')],'type':_0x329dd5[_0x59c4('0x2f')][_0x59c4('0x30')]};});_0x4ab322[_0x59c4('0x31')]=_[_0x59c4('0x2c')](_0x18176b,_0x59c4('0x2a'));_0x4ab322[_0x59c4('0x32')]=_[_0x59c4('0x33')](_0x195031['query']);_0x4ab322[_0x59c4('0x34')]=_[_0x59c4('0x35')](_0x4ab322[_0x59c4('0x31')],_0x4ab322[_0x59c4('0x32')]);_0x31bff7[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x4ab322[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x195031[_0x59c4('0x32')]['fields']));_0x31bff7[_0x59c4('0x36')]=_0x31bff7[_0x59c4('0x36')][_0x59c4('0x38')]?_0x31bff7['attributes']:_0x4ab322[_0x59c4('0x31')];if(!_0x195031[_0x59c4('0x32')][_0x59c4('0x39')](_0x59c4('0x3a'))){_0x31bff7[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x195031[_0x59c4('0x32')]['limit']);_0x31bff7[_0x59c4('0x1c')]=qs['offset'](_0x195031[_0x59c4('0x32')]['offset']);}_0x31bff7[_0x59c4('0x3b')]=qs[_0x59c4('0x3c')](_0x195031[_0x59c4('0x32')][_0x59c4('0x3c')]);_0x31bff7[_0x59c4('0x3d')]=qs['filters'](_['pick'](_0x195031['query'],_0x4ab322['filters']),_0x18176b);if(_0x195031['query'][_0x59c4('0x3e')]){_0x31bff7['where']=_[_0x59c4('0x3f')](_0x31bff7['where'],{'$or':_[_0x59c4('0x2c')](_0x18176b,function(_0x3ab4a1){if(_0x3ab4a1[_0x59c4('0x2f')]!==_0x59c4('0x40')){var _0x44f024={};_0x44f024[_0x3ab4a1[_0x59c4('0x2a')]]={'$like':'%'+_0x195031[_0x59c4('0x32')][_0x59c4('0x3e')]+'%'};return _0x44f024;}})});}_0x31bff7=_[_0x59c4('0x3f')]({},_0x31bff7,_0x195031[_0x59c4('0x41')]);var _0x5387f3={'where':_0x31bff7['where']};return db['Campaign'][_0x59c4('0x1f')](_0x5387f3)[_0x59c4('0x24')](function(_0x3c07c7){_0x2e6ef6[_0x59c4('0x1f')]=_0x3c07c7;if(_0x195031[_0x59c4('0x32')][_0x59c4('0x42')]){_0x31bff7[_0x59c4('0x43')]=[{'all':!![]}];}return db[_0x59c4('0x44')][_0x59c4('0x45')](_0x31bff7);})[_0x59c4('0x24')](function(_0xf12a75){_0x2e6ef6[_0x59c4('0x46')]=_0xf12a75;return _0x2e6ef6;})[_0x59c4('0x24')](respondWithFilteredResult(_0x32ed2d,_0x31bff7))[_0x59c4('0x47')](handleError(_0x32ed2d,null));};exports[_0x59c4('0x48')]=function(_0x4e7028,_0x3487f2){var _0x4d7761={'raw':![],'where':{'id':_0x4e7028['params']['id']}},_0x6a611e={};_0x6a611e[_0x59c4('0x31')]=_[_0x59c4('0x33')](db[_0x59c4('0x44')][_0x59c4('0x2d')]);_0x6a611e[_0x59c4('0x32')]=_['keys'](_0x4e7028[_0x59c4('0x32')]);_0x6a611e['filters']=_[_0x59c4('0x35')](_0x6a611e[_0x59c4('0x31')],_0x6a611e['query']);_0x4d7761[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x6a611e[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x4e7028[_0x59c4('0x32')][_0x59c4('0x37')]));_0x4d7761['attributes']=_0x4d7761['attributes'][_0x59c4('0x38')]?_0x4d7761['attributes']:_0x6a611e[_0x59c4('0x31')];if(_0x4e7028[_0x59c4('0x32')][_0x59c4('0x42')]){_0x4d7761[_0x59c4('0x43')]=[{'all':!![]}];}_0x4d7761=_[_0x59c4('0x3f')]({},_0x4d7761,_0x4e7028['options']);return db[_0x59c4('0x44')][_0x59c4('0x49')](_0x4d7761)[_0x59c4('0x24')](handleEntityNotFound(_0x3487f2,null))[_0x59c4('0x24')](respondWithResult(_0x3487f2,null))[_0x59c4('0x47')](handleError(_0x3487f2,null));};exports[_0x59c4('0x4a')]=function(_0x279311,_0x5127a1){return db[_0x59c4('0x44')]['create'](_0x279311[_0x59c4('0x4b')],{})[_0x59c4('0x24')](function(_0x5dbf8c){var _0x1c8da9=_0x279311[_0x59c4('0x4c')]['get']({'plain':!![]});if(!_0x1c8da9)throw new Error(_0x59c4('0x4d'));if(_0x1c8da9[_0x59c4('0x4e')]===_0x59c4('0x4c')){var _0x1f412f=_0x5dbf8c[_0x59c4('0x4f')]({'plain':!![]});var _0x3fc906='IvrCampaigns';return db[_0x59c4('0x50')][_0x59c4('0x49')]({'where':{'name':_0x3fc906,'userProfileId':_0x1c8da9['userProfileId']},'raw':!![]})[_0x59c4('0x24')](function(_0x214dfd){if(_0x214dfd&&_0x214dfd[_0x59c4('0x51')]===0x0){return db['UserProfileResource'][_0x59c4('0x4a')]({'name':_0x1f412f[_0x59c4('0x2a')],'resourceId':_0x1f412f['id'],'type':_0x214dfd[_0x59c4('0x2a')],'sectionId':_0x214dfd['id']},{})[_0x59c4('0x24')](function(){return _0x5dbf8c;});}else{return _0x5dbf8c;}})[_0x59c4('0x47')](function(_0x57ff85){logger[_0x59c4('0x28')](_0x59c4('0x52'),_0x57ff85);throw _0x57ff85;});}return _0x5dbf8c;})[_0x59c4('0x24')](respondWithResult(_0x5127a1,0xc9))[_0x59c4('0x47')](handleError(_0x5127a1,null));};exports['clone']=function(_0x1a9124,_0x425b13){var _0x5abff6={'where':{'id':_0x1a9124[_0x59c4('0x53')]['id']}},_0x555eed={};_0x555eed[_0x59c4('0x31')]=_[_0x59c4('0x33')](db[_0x59c4('0x44')]['rawAttributes']);_0x5abff6[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x555eed[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x1a9124[_0x59c4('0x32')][_0x59c4('0x37')]));_0x5abff6['attributes']=_0x5abff6['attributes'][_0x59c4('0x38')]?_0x5abff6['attributes']:_0x555eed[_0x59c4('0x31')];if(_0x1a9124[_0x59c4('0x32')]['includeAll']){_0x5abff6[_0x59c4('0x43')]=[{'all':!![]}];}_0x5abff6=_[_0x59c4('0x3f')]({},_0x5abff6,_0x1a9124['options']);return db[_0x59c4('0x44')][_0x59c4('0x49')](_0x5abff6)[_0x59c4('0x24')](handleEntityNotFound(_0x425b13,null))['then'](function(_0x472401){if(_0x472401){var _0x42388e=_0x472401[_0x59c4('0x4f')]({'plain':!![]});_0x42388e=qs[_0x59c4('0x54')](_0x42388e,['id',_0x59c4('0x55'),'updatedAt']);_0x1a9124[_0x59c4('0x4b')]=_[_0x59c4('0x54')](_0x1a9124['body'],['id',_0x59c4('0x55'),_0x59c4('0x56')]);return db[_0x59c4('0x44')][_0x59c4('0x4a')](_[_0x59c4('0x3f')](_0x42388e,_0x1a9124[_0x59c4('0x4b')]),{'include':_0x1a9124[_0x59c4('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x59c4('0x24')](function(_0x459fab){var _0x16866d=_0x1a9124[_0x59c4('0x4c')]['get']({'plain':!![]});if(!_0x16866d)throw new Error(_0x59c4('0x4d'));if(_0x16866d[_0x59c4('0x4e')]===_0x59c4('0x4c')){var _0x1d15f7=_0x459fab[_0x59c4('0x4f')]({'plain':!![]});var _0x79bf17='IvrCampaigns';return db[_0x59c4('0x50')][_0x59c4('0x49')]({'where':{'name':_0x79bf17,'userProfileId':_0x16866d[_0x59c4('0x57')]},'raw':!![]})['then'](function(_0x4e50ae){if(_0x4e50ae&&_0x4e50ae[_0x59c4('0x51')]===0x0){return db[_0x59c4('0x26')][_0x59c4('0x4a')]({'name':_0x1d15f7[_0x59c4('0x2a')],'resourceId':_0x1d15f7['id'],'type':_0x4e50ae['name'],'sectionId':_0x4e50ae['id']},{})[_0x59c4('0x24')](function(){return _0x459fab;});}else{return _0x459fab;}})[_0x59c4('0x47')](function(_0x3e8918){logger[_0x59c4('0x28')](_0x59c4('0x52'),_0x3e8918);throw _0x3e8918;});}return _0x459fab;});}})['then'](respondWithResult(_0x425b13,0xc9))['catch'](handleError(_0x425b13,null));};exports[_0x59c4('0x22')]=function(_0x21a3e4,_0x331b2b){if(_0x21a3e4[_0x59c4('0x4b')]['id']){delete _0x21a3e4[_0x59c4('0x4b')]['id'];}return db[_0x59c4('0x44')]['find']({'where':{'id':_0x21a3e4[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x331b2b,null))[_0x59c4('0x24')](saveUpdates(_0x21a3e4[_0x59c4('0x4b')],null))[_0x59c4('0x24')](respondWithResult(_0x331b2b,null))[_0x59c4('0x47')](handleError(_0x331b2b,null));};exports[_0x59c4('0x23')]=function(_0x46338a,_0x3c0710){return db['Campaign']['find']({'where':{'id':_0x46338a[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c0710,null))[_0x59c4('0x24')](removeEntity(_0x3c0710,null))[_0x59c4('0x47')](handleError(_0x3c0710,null));};exports['getHoppers']=function(_0x4e4531,_0x349dc1,_0x4eb841){var _0x3e90f9={'raw':!![],'where':{}};var _0x18ce2c={};var _0x227823={'count':0x0,'rows':[]};return db[_0x59c4('0x44')][_0x59c4('0x58')]({'where':{'id':_0x4e4531[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x349dc1,null))[_0x59c4('0x24')](function(_0x5179c4){if(_0x5179c4){_0x18ce2c[_0x59c4('0x31')]=_['keys'](db[_0x59c4('0x59')][_0x59c4('0x2d')]);_0x18ce2c[_0x59c4('0x32')]=_[_0x59c4('0x33')](_0x4e4531[_0x59c4('0x32')]);_0x18ce2c[_0x59c4('0x34')]=_['intersection'](_0x18ce2c['model'],_0x18ce2c[_0x59c4('0x32')]);_0x3e90f9[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x18ce2c[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x4e4531[_0x59c4('0x32')]['fields']));_0x3e90f9['attributes']=_0x3e90f9[_0x59c4('0x36')][_0x59c4('0x38')]?_0x3e90f9[_0x59c4('0x36')]:_0x18ce2c[_0x59c4('0x31')];if(!_0x4e4531[_0x59c4('0x32')][_0x59c4('0x39')](_0x59c4('0x3a'))){_0x3e90f9[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x4e4531[_0x59c4('0x32')][_0x59c4('0x1d')]);_0x3e90f9[_0x59c4('0x1c')]=qs['offset'](_0x4e4531[_0x59c4('0x32')][_0x59c4('0x1c')]);}_0x3e90f9[_0x59c4('0x3b')]=qs[_0x59c4('0x3c')](_0x4e4531[_0x59c4('0x32')][_0x59c4('0x3c')]);_0x3e90f9[_0x59c4('0x3d')]=qs[_0x59c4('0x34')](_['pick'](_0x4e4531[_0x59c4('0x32')],_0x18ce2c[_0x59c4('0x34')]));_0x3e90f9['where']['CampaignId']=_0x5179c4['id'];if(_0x4e4531[_0x59c4('0x32')][_0x59c4('0x3e')]){_0x3e90f9['where']=_['merge'](_0x3e90f9[_0x59c4('0x3d')],{'$or':_[_0x59c4('0x2c')](_0x3e90f9[_0x59c4('0x36')],function(_0x242c73){var _0x5848f3={};_0x5848f3[_0x242c73]={'$like':'%'+_0x4e4531[_0x59c4('0x32')][_0x59c4('0x3e')]+'%'};return _0x5848f3;})});}_0x3e90f9=_[_0x59c4('0x3f')]({},_0x3e90f9,_0x4e4531[_0x59c4('0x41')]);return db[_0x59c4('0x59')][_0x59c4('0x1f')]({'where':_0x3e90f9[_0x59c4('0x3d')]})[_0x59c4('0x24')](function(_0x4cb61b){_0x227823[_0x59c4('0x1f')]=_0x4cb61b;if(_0x4e4531[_0x59c4('0x32')][_0x59c4('0x42')]){_0x3e90f9[_0x59c4('0x43')]=[{'all':!![]}];}return db[_0x59c4('0x59')][_0x59c4('0x45')](_0x3e90f9);})[_0x59c4('0x24')](function(_0x3f5add){_0x227823['rows']=_0x3f5add;return _0x227823;});}})[_0x59c4('0x24')](respondWithFilteredResult(_0x349dc1,_0x3e90f9))[_0x59c4('0x47')](handleError(_0x349dc1,null));};exports['getHopperHistories']=function(_0x1ea305,_0x46181b,_0xf0f16c){var _0x308782={'raw':!![],'where':{}};var _0x52a379={};var _0x237309={'count':0x0,'rows':[]};return db[_0x59c4('0x44')][_0x59c4('0x58')]({'where':{'id':_0x1ea305[_0x59c4('0x53')]['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x46181b,null))[_0x59c4('0x24')](function(_0x36ac72){if(_0x36ac72){_0x52a379['model']=_[_0x59c4('0x33')](db[_0x59c4('0x5a')][_0x59c4('0x2d')]);_0x52a379[_0x59c4('0x32')]=_[_0x59c4('0x33')](_0x1ea305[_0x59c4('0x32')]);_0x52a379[_0x59c4('0x34')]=_[_0x59c4('0x35')](_0x52a379['model'],_0x52a379[_0x59c4('0x32')]);_0x308782[_0x59c4('0x36')]=_['intersection'](_0x52a379[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x1ea305['query']['fields']));_0x308782[_0x59c4('0x36')]=_0x308782[_0x59c4('0x36')]['length']?_0x308782[_0x59c4('0x36')]:_0x52a379[_0x59c4('0x31')];if(!_0x1ea305[_0x59c4('0x32')]['hasOwnProperty'](_0x59c4('0x3a'))){_0x308782[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x1ea305[_0x59c4('0x32')][_0x59c4('0x1d')]);_0x308782[_0x59c4('0x1c')]=qs['offset'](_0x1ea305[_0x59c4('0x32')][_0x59c4('0x1c')]);}_0x308782['order']=qs[_0x59c4('0x3c')](_0x1ea305['query'][_0x59c4('0x3c')]);_0x308782[_0x59c4('0x3d')]=qs['filters'](_[_0x59c4('0x5b')](_0x1ea305[_0x59c4('0x32')],_0x52a379[_0x59c4('0x34')]));_0x308782[_0x59c4('0x3d')][_0x59c4('0x5c')]=_0x36ac72['id'];if(_0x1ea305[_0x59c4('0x32')][_0x59c4('0x3e')]){_0x308782[_0x59c4('0x3d')]=_[_0x59c4('0x3f')](_0x308782[_0x59c4('0x3d')],{'$or':_['map'](_0x308782[_0x59c4('0x36')],function(_0x3e8231){var _0x1ebbc3={};_0x1ebbc3[_0x3e8231]={'$like':'%'+_0x1ea305['query'][_0x59c4('0x3e')]+'%'};return _0x1ebbc3;})});}_0x308782=_['merge']({},_0x308782,_0x1ea305[_0x59c4('0x41')]);return db[_0x59c4('0x5a')][_0x59c4('0x1f')]({'where':_0x308782[_0x59c4('0x3d')]})[_0x59c4('0x24')](function(_0x53293f){_0x237309[_0x59c4('0x1f')]=_0x53293f;if(_0x1ea305[_0x59c4('0x32')][_0x59c4('0x42')]){_0x308782[_0x59c4('0x43')]=[{'all':!![]}];}return db[_0x59c4('0x5a')][_0x59c4('0x45')](_0x308782);})[_0x59c4('0x24')](function(_0x2fb622){_0x237309['rows']=_0x2fb622;return _0x237309;});}})[_0x59c4('0x24')](respondWithFilteredResult(_0x46181b,_0x308782))['catch'](handleError(_0x46181b,null));};exports[_0x59c4('0x5d')]=function(_0x5504a0,_0x35ac07,_0x5eeb9c){var _0x4ce9bf={'raw':!![],'where':{}};var _0x4a4384={};var _0xb0eea6={'count':0x0,'rows':[]};return db[_0x59c4('0x44')][_0x59c4('0x58')]({'where':{'id':_0x5504a0[_0x59c4('0x53')]['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x35ac07,null))[_0x59c4('0x24')](function(_0x3e39fc){if(_0x3e39fc){_0x4a4384[_0x59c4('0x31')]=_['keys'](db[_0x59c4('0x5e')][_0x59c4('0x2d')]);_0x4a4384['query']=_['keys'](_0x5504a0[_0x59c4('0x32')]);_0x4a4384[_0x59c4('0x34')]=_['intersection'](_0x4a4384[_0x59c4('0x31')],_0x4a4384[_0x59c4('0x32')]);_0x4ce9bf[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x4a4384['model'],qs['fields'](_0x5504a0[_0x59c4('0x32')]['fields']));_0x4ce9bf['attributes']=_0x4ce9bf['attributes'][_0x59c4('0x38')]?_0x4ce9bf['attributes']:_0x4a4384[_0x59c4('0x31')];if(!_0x5504a0[_0x59c4('0x32')][_0x59c4('0x39')](_0x59c4('0x3a'))){_0x4ce9bf[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x5504a0[_0x59c4('0x32')][_0x59c4('0x1d')]);_0x4ce9bf[_0x59c4('0x1c')]=qs[_0x59c4('0x1c')](_0x5504a0[_0x59c4('0x32')][_0x59c4('0x1c')]);}_0x4ce9bf[_0x59c4('0x3b')]=qs['sort'](_0x5504a0['query'][_0x59c4('0x3c')]);_0x4ce9bf['where']=qs[_0x59c4('0x34')](_[_0x59c4('0x5b')](_0x5504a0[_0x59c4('0x32')],_0x4a4384['filters']));_0x4ce9bf[_0x59c4('0x3d')]['CampaignId']=_0x3e39fc['id'];if(_0x5504a0['query'][_0x59c4('0x3e')]){_0x4ce9bf[_0x59c4('0x3d')]=_[_0x59c4('0x3f')](_0x4ce9bf['where'],{'$or':_[_0x59c4('0x2c')](_0x4ce9bf[_0x59c4('0x36')],function(_0x18e78e){var _0x1c09a7={};_0x1c09a7[_0x18e78e]={'$like':'%'+_0x5504a0[_0x59c4('0x32')]['filter']+'%'};return _0x1c09a7;})});}_0x4ce9bf=_['merge']({},_0x4ce9bf,_0x5504a0[_0x59c4('0x41')]);return db['CmHopperFinal'][_0x59c4('0x1f')]({'where':_0x4ce9bf['where']})[_0x59c4('0x24')](function(_0x2f461c){_0xb0eea6[_0x59c4('0x1f')]=_0x2f461c;if(_0x5504a0[_0x59c4('0x32')][_0x59c4('0x42')]){_0x4ce9bf[_0x59c4('0x43')]=[{'all':!![]}];}return db[_0x59c4('0x5e')]['findAll'](_0x4ce9bf);})[_0x59c4('0x24')](function(_0x478660){_0xb0eea6[_0x59c4('0x46')]=_0x478660;return _0xb0eea6;});}})[_0x59c4('0x24')](respondWithFilteredResult(_0x35ac07,_0x4ce9bf))['catch'](handleError(_0x35ac07,null));};exports[_0x59c4('0x5f')]=function(_0x561767,_0x35e9ac,_0xc24dcc){var _0x3d4748={'raw':!![],'where':{}};var _0x1f1389={};var _0x50b994={'count':0x0,'rows':[]};return db[_0x59c4('0x44')][_0x59c4('0x58')]({'where':{'id':_0x561767['params']['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x35e9ac,null))[_0x59c4('0x24')](function(_0x43d97b){if(_0x43d97b){_0x1f1389[_0x59c4('0x31')]=_['keys'](db[_0x59c4('0x60')][_0x59c4('0x2d')]);_0x1f1389[_0x59c4('0x32')]=_[_0x59c4('0x33')](_0x561767[_0x59c4('0x32')]);_0x1f1389[_0x59c4('0x34')]=_['intersection'](_0x1f1389[_0x59c4('0x31')],_0x1f1389['query']);_0x3d4748[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x1f1389[_0x59c4('0x31')],qs['fields'](_0x561767[_0x59c4('0x32')]['fields']));_0x3d4748[_0x59c4('0x36')]=_0x3d4748['attributes'][_0x59c4('0x38')]?_0x3d4748[_0x59c4('0x36')]:_0x1f1389[_0x59c4('0x31')];if(!_0x561767[_0x59c4('0x32')][_0x59c4('0x39')]('nolimit')){_0x3d4748[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x561767[_0x59c4('0x32')]['limit']);_0x3d4748['offset']=qs[_0x59c4('0x1c')](_0x561767[_0x59c4('0x32')][_0x59c4('0x1c')]);}_0x3d4748[_0x59c4('0x3b')]=qs[_0x59c4('0x3c')](_0x561767[_0x59c4('0x32')][_0x59c4('0x3c')]);_0x3d4748['where']=qs['filters'](_[_0x59c4('0x5b')](_0x561767[_0x59c4('0x32')],_0x1f1389['filters']));_0x3d4748['where']['CampaignId']=_0x43d97b['id'];if(_0x561767[_0x59c4('0x32')][_0x59c4('0x3e')]){_0x3d4748['where']=_[_0x59c4('0x3f')](_0x3d4748[_0x59c4('0x3d')],{'$or':_['map'](_0x3d4748['attributes'],function(_0x13c466){var _0x20cc96={};_0x20cc96[_0x13c466]={'$like':'%'+_0x561767[_0x59c4('0x32')][_0x59c4('0x3e')]+'%'};return _0x20cc96;})});}_0x3d4748=_[_0x59c4('0x3f')]({},_0x3d4748,_0x561767[_0x59c4('0x41')]);return db['CmHopperBlack'][_0x59c4('0x1f')]({'where':_0x3d4748[_0x59c4('0x3d')]})[_0x59c4('0x24')](function(_0x2e996a){_0x50b994[_0x59c4('0x1f')]=_0x2e996a;if(_0x561767[_0x59c4('0x32')]['includeAll']){_0x3d4748['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3d4748);})[_0x59c4('0x24')](function(_0x53413c){_0x50b994['rows']=_0x53413c;return _0x50b994;});}})['then'](respondWithFilteredResult(_0x35e9ac,_0x3d4748))['catch'](handleError(_0x35e9ac,null));};exports[_0x59c4('0x61')]=function(_0x302068,_0x58474c,_0x5077b0){var _0xd4581f={};var _0x56a8a0={};var _0x563884;var _0xc456b6;return db[_0x59c4('0x44')][_0x59c4('0x58')]({'where':{'id':_0x302068[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x58474c,null))[_0x59c4('0x24')](function(_0x3ad4d7){if(_0x3ad4d7){_0x563884=_0x3ad4d7;_0x56a8a0[_0x59c4('0x31')]=_[_0x59c4('0x33')](db[_0x59c4('0x62')][_0x59c4('0x2d')]);_0x56a8a0['query']=_[_0x59c4('0x33')](_0x302068['query']);_0x56a8a0[_0x59c4('0x34')]=_[_0x59c4('0x35')](_0x56a8a0[_0x59c4('0x31')],_0x56a8a0[_0x59c4('0x32')]);_0xd4581f[_0x59c4('0x36')]=_['intersection'](_0x56a8a0[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x302068[_0x59c4('0x32')][_0x59c4('0x37')]));_0xd4581f['attributes']=_0xd4581f[_0x59c4('0x36')]['length']?_0xd4581f[_0x59c4('0x36')]:_0x56a8a0[_0x59c4('0x31')];_0xd4581f[_0x59c4('0x3b')]=qs[_0x59c4('0x3c')](_0x302068[_0x59c4('0x32')]['sort']);_0xd4581f[_0x59c4('0x3d')]=qs[_0x59c4('0x34')](_[_0x59c4('0x5b')](_0x302068['query'],_0x56a8a0[_0x59c4('0x34')]));if(_0x302068['query'][_0x59c4('0x3e')]){_0xd4581f['where']=_[_0x59c4('0x3f')](_0xd4581f[_0x59c4('0x3d')],{'$or':_[_0x59c4('0x2c')](_0xd4581f[_0x59c4('0x36')],function(_0x1e0fc6){var _0x1a1047={};_0x1a1047[_0x1e0fc6]={'$like':'%'+_0x302068['query']['filter']+'%'};return _0x1a1047;})});}_0xd4581f=_['merge']({},_0xd4581f,_0x302068[_0x59c4('0x41')]);return _0x563884[_0x59c4('0x61')](_0xd4581f);}})[_0x59c4('0x24')](function(_0x128c06){if(_0x128c06){_0xc456b6=_0x128c06[_0x59c4('0x38')];if(!_0x302068[_0x59c4('0x32')][_0x59c4('0x39')](_0x59c4('0x3a'))){_0xd4581f['limit']=qs[_0x59c4('0x1d')](_0x302068['query'][_0x59c4('0x1d')]);_0xd4581f['offset']=qs['offset'](_0x302068[_0x59c4('0x32')][_0x59c4('0x1c')]);}return _0x563884['getLists'](_0xd4581f);}})[_0x59c4('0x24')](function(_0x2816ac){if(_0x2816ac){return _0x2816ac?{'count':_0xc456b6,'rows':_0x2816ac}:null;}})['then'](respondWithResult(_0x58474c,null))['catch'](handleError(_0x58474c,null));};exports[_0x59c4('0x63')]=function(_0x50a31c,_0x48a1b6,_0x3c9c30){var _0x34e7ae,_0x24d86c;return db[_0x59c4('0x44')][_0x59c4('0x49')]({'where':{'id':_0x50a31c[_0x59c4('0x53')]['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x48a1b6,null))[_0x59c4('0x24')](function(_0x383fea){if(_0x383fea){_0x24d86c=_0x383fea;return _0x383fea[_0x59c4('0x63')](_0x50a31c['body'][_0x59c4('0x64')],_[_0x59c4('0x54')](_0x50a31c[_0x59c4('0x4b')],[_0x59c4('0x64'),'id'])||{});}return null;})[_0x59c4('0x65')](function(_0x4fe921){var _0x7afaaf;_0x34e7ae=_0x4fe921||[];var _0x5c0491=[];if(_0x4fe921){for(var _0x3da204=0x0;_0x3da204<_0x4fe921[_0x59c4('0x38')];_0x3da204+=0x1){var _0x156fa8=_0x4fe921[_0x3da204][_0x59c4('0x4f')]({'plain':!![]});_0x24d86c[_0x59c4('0x66')]=_0x50a31c['body'][_0x59c4('0x66')]?_0x50a31c[_0x59c4('0x4b')]['dialCheckDuplicateType']:_0x24d86c[_0x59c4('0x66')];switch(_0x24d86c[_0x59c4('0x66')]){case _0x59c4('0x67'):_0x7afaaf=squel['insert']()[_0x59c4('0x68')](_0x59c4('0x69'))[_0x59c4('0x6a')]([_0x59c4('0x6b'),'scheduledAt','ContactId',_0x59c4('0x6c'),'CampaignId',_0x59c4('0x55'),_0x59c4('0x56')],squel[_0x59c4('0x6d')]()[_0x59c4('0x6e')](_0x59c4('0x6b'),'phone')['field'](_0x59c4('0x6f'),_0x59c4('0x70'))['field']('id',_0x59c4('0x71'))['field'](_0x156fa8[_0x59c4('0x72')][_0x59c4('0x73')](),_0x59c4('0x6c'))[_0x59c4('0x6e')](_0x50a31c['params']['id'][_0x59c4('0x73')](),_0x59c4('0x5c'))[_0x59c4('0x6e')]('NOW()',_0x59c4('0x55'))[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x56'))[_0x59c4('0x74')](_0x59c4('0x75'))[_0x59c4('0x3d')]('deletedAt\x20IS\x20NULL')[_0x59c4('0x3d')](_0x59c4('0x76'),_0x156fa8['CmListId']['toString']())[_0x59c4('0x3d')](_0x59c4('0x77'))[_0x59c4('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x59c4('0x6e')](_0x59c4('0x78'))[_0x59c4('0x74')](_0x59c4('0x79'))['where'](_0x59c4('0x7a'),_0x50a31c[_0x59c4('0x53')]['id']['toString']()))['where'](_0x59c4('0x7b'),squel['select']()[_0x59c4('0x6e')](_0x59c4('0x7c'))[_0x59c4('0x74')](_0x59c4('0x69'))[_0x59c4('0x3d')](_0x59c4('0x7a'),_0x50a31c['params']['id'][_0x59c4('0x73')]())))[_0x59c4('0x73')]();break;case _0x59c4('0x7d'):_0x7afaaf=squel['insert']()[_0x59c4('0x68')]('cm_hopper')[_0x59c4('0x6a')]([_0x59c4('0x6b'),_0x59c4('0x70'),'ContactId',_0x59c4('0x6c'),_0x59c4('0x5c'),_0x59c4('0x55'),_0x59c4('0x56')],squel[_0x59c4('0x6d')]()[_0x59c4('0x6e')]('phone',_0x59c4('0x6b'))[_0x59c4('0x6e')]('NOW()',_0x59c4('0x70'))[_0x59c4('0x6e')]('id','ContactId')[_0x59c4('0x6e')](_0x156fa8['CmListId'][_0x59c4('0x73')](),'ListId')[_0x59c4('0x6e')](_0x50a31c['params']['id']['toString'](),_0x59c4('0x5c'))[_0x59c4('0x6e')](_0x59c4('0x6f'),'createdAt')[_0x59c4('0x6e')]('NOW()',_0x59c4('0x56'))[_0x59c4('0x74')](_0x59c4('0x75'))[_0x59c4('0x3d')](_0x59c4('0x7e'))['where'](_0x59c4('0x76'),_0x156fa8[_0x59c4('0x72')][_0x59c4('0x73')]())[_0x59c4('0x3d')](_0x59c4('0x77'))[_0x59c4('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x59c4('0x6e')]('COALESCE(phone,\x27\x27)')[_0x59c4('0x74')]('cm_hopper')[_0x59c4('0x3d')](_0x59c4('0x7a'),_0x50a31c[_0x59c4('0x53')]['id'][_0x59c4('0x73')]())))[_0x59c4('0x73')]();break;default:_0x7afaaf=squel['insert']()[_0x59c4('0x68')](_0x59c4('0x69'))[_0x59c4('0x6a')](['phone','scheduledAt',_0x59c4('0x71'),'ListId',_0x59c4('0x5c'),_0x59c4('0x55'),'updatedAt'],squel['select']()[_0x59c4('0x6e')](_0x59c4('0x6b'),'phone')[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x70'))[_0x59c4('0x6e')]('id',_0x59c4('0x71'))[_0x59c4('0x6e')](_0x156fa8['CmListId'][_0x59c4('0x73')](),'ListId')['field'](_0x50a31c[_0x59c4('0x53')]['id'][_0x59c4('0x73')](),_0x59c4('0x5c'))[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x55'))[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x56'))[_0x59c4('0x74')](_0x59c4('0x75'))[_0x59c4('0x3d')](_0x59c4('0x7e'))[_0x59c4('0x3d')](_0x59c4('0x76'),_0x156fa8[_0x59c4('0x72')][_0x59c4('0x73')]())[_0x59c4('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x59c4('0x73')]();}_0x5c0491[_0x59c4('0x7f')](db['sequelize']['query'](_0x7afaaf));}return BPromise[_0x59c4('0x80')](_0x5c0491);}})[_0x59c4('0x24')](function(){return _0x34e7ae;})[_0x59c4('0x24')](respondWithResult(_0x48a1b6,null))[_0x59c4('0x47')](handleError(_0x48a1b6,null));};exports[_0x59c4('0x81')]=function(_0x549e3e,_0x3cc52c,_0x2f6d67){return db[_0x59c4('0x44')][_0x59c4('0x49')]({'where':{'id':_0x549e3e[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x3cc52c,null))[_0x59c4('0x24')](function(_0x4b64ed){if(_0x4b64ed){return _0x4b64ed[_0x59c4('0x81')](_0x549e3e[_0x59c4('0x32')][_0x59c4('0x64')]);}})['then'](function(_0x38d2ad){if(_0x38d2ad){return db['CmHopper'][_0x59c4('0x23')]({'where':{'ListId':_0x549e3e['query']['ids'],'CampaignId':_0x549e3e[_0x59c4('0x53')]['id']}})[_0x59c4('0x24')](function(){return _0x38d2ad;});}})[_0x59c4('0x24')](respondWithStatusCode(_0x3cc52c,null))[_0x59c4('0x47')](handleError(_0x3cc52c,null));};exports['getBlackLists']=function(_0x5aed5d,_0x58df75,_0xcd961){var _0x4a4583={};var _0x242c24={};var _0x534332;var _0xab415c;return db[_0x59c4('0x44')]['findOne']({'where':{'id':_0x5aed5d['params']['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x58df75,null))[_0x59c4('0x24')](function(_0x2f605d){if(_0x2f605d){_0x534332=_0x2f605d;_0x242c24[_0x59c4('0x31')]=_[_0x59c4('0x33')](db['CmList'][_0x59c4('0x2d')]);_0x242c24[_0x59c4('0x32')]=_[_0x59c4('0x33')](_0x5aed5d[_0x59c4('0x32')]);_0x242c24['filters']=_[_0x59c4('0x35')](_0x242c24[_0x59c4('0x31')],_0x242c24[_0x59c4('0x32')]);_0x4a4583[_0x59c4('0x36')]=_[_0x59c4('0x35')](_0x242c24[_0x59c4('0x31')],qs[_0x59c4('0x37')](_0x5aed5d[_0x59c4('0x32')][_0x59c4('0x37')]));_0x4a4583['attributes']=_0x4a4583[_0x59c4('0x36')][_0x59c4('0x38')]?_0x4a4583['attributes']:_0x242c24[_0x59c4('0x31')];_0x4a4583[_0x59c4('0x3b')]=qs['sort'](_0x5aed5d[_0x59c4('0x32')][_0x59c4('0x3c')]);_0x4a4583[_0x59c4('0x3d')]=qs[_0x59c4('0x34')](_[_0x59c4('0x5b')](_0x5aed5d[_0x59c4('0x32')],_0x242c24[_0x59c4('0x34')]));if(_0x5aed5d[_0x59c4('0x32')][_0x59c4('0x3e')]){_0x4a4583[_0x59c4('0x3d')]=_[_0x59c4('0x3f')](_0x4a4583[_0x59c4('0x3d')],{'$or':_[_0x59c4('0x2c')](_0x4a4583['attributes'],function(_0x45e9c1){var _0xcfe9e4={};_0xcfe9e4[_0x45e9c1]={'$like':'%'+_0x5aed5d[_0x59c4('0x32')][_0x59c4('0x3e')]+'%'};return _0xcfe9e4;})});}_0x4a4583=_[_0x59c4('0x3f')]({},_0x4a4583,_0x5aed5d[_0x59c4('0x41')]);return _0x534332[_0x59c4('0x82')](_0x4a4583);}})[_0x59c4('0x24')](function(_0x44c304){if(_0x44c304){_0xab415c=_0x44c304['length'];if(!_0x5aed5d[_0x59c4('0x32')]['hasOwnProperty'](_0x59c4('0x3a'))){_0x4a4583['limit']=qs[_0x59c4('0x1d')](_0x5aed5d['query'][_0x59c4('0x1d')]);_0x4a4583[_0x59c4('0x1c')]=qs[_0x59c4('0x1c')](_0x5aed5d['query'][_0x59c4('0x1c')]);}return _0x534332[_0x59c4('0x82')](_0x4a4583);}})[_0x59c4('0x24')](function(_0x31d968){if(_0x31d968){return _0x31d968?{'count':_0xab415c,'rows':_0x31d968}:null;}})[_0x59c4('0x24')](respondWithResult(_0x58df75,null))['catch'](handleError(_0x58df75,null));};exports[_0x59c4('0x83')]=function(_0x4f5b70,_0x29ac05,_0x262f2f){var _0x1cbbf2,_0x5f1dd5;return db[_0x59c4('0x44')][_0x59c4('0x49')]({'where':{'id':_0x4f5b70['params']['id']}})[_0x59c4('0x24')](handleEntityNotFound(_0x29ac05,null))[_0x59c4('0x24')](function(_0x29c93b){if(_0x29c93b){_0x5f1dd5=_0x29c93b;return _0x29c93b[_0x59c4('0x83')](_0x4f5b70['body'][_0x59c4('0x64')],_[_0x59c4('0x54')](_0x4f5b70['body'],[_0x59c4('0x64'),'id'])||{});}return null;})[_0x59c4('0x65')](function(_0x2d959d){var _0x4d1d79;_0x1cbbf2=_0x2d959d||[];var _0x3027eb=[];if(_0x2d959d){for(var _0x1e08ab=0x0;_0x1e08ab<_0x2d959d['length'];_0x1e08ab+=0x1){var _0x48f253=_0x2d959d[_0x1e08ab]['get']({'plain':!![]});_0x4d1d79=squel['insert']()[_0x59c4('0x68')](_0x59c4('0x84'))[_0x59c4('0x6a')]([_0x59c4('0x6b'),'ContactId',_0x59c4('0x6c'),_0x59c4('0x5c'),_0x59c4('0x55'),_0x59c4('0x56')],squel[_0x59c4('0x6d')]()[_0x59c4('0x6e')](_0x59c4('0x6b'),_0x59c4('0x6b'))[_0x59c4('0x6e')]('id',_0x59c4('0x71'))[_0x59c4('0x6e')](_0x48f253['CmListId']['toString'](),_0x59c4('0x6c'))[_0x59c4('0x6e')](_0x4f5b70[_0x59c4('0x53')]['id'][_0x59c4('0x73')](),_0x59c4('0x5c'))[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x55'))[_0x59c4('0x6e')](_0x59c4('0x6f'),_0x59c4('0x56'))['from'](_0x59c4('0x75'))[_0x59c4('0x3d')]('deletedAt\x20IS\x20NULL')[_0x59c4('0x3d')](_0x59c4('0x76'),_0x48f253[_0x59c4('0x72')]['toString']())[_0x59c4('0x3d')](_0x59c4('0x77')))['toString']();_0x3027eb[_0x59c4('0x7f')](db[_0x59c4('0x85')][_0x59c4('0x32')](_0x4d1d79));}return BPromise[_0x59c4('0x80')](_0x3027eb);}})[_0x59c4('0x24')](function(){return _0x1cbbf2;})['then'](respondWithResult(_0x29ac05,null))[_0x59c4('0x47')](handleError(_0x29ac05,null));};exports['removeBlackLists']=function(_0x1eefb2,_0x1df502,_0x435de3){return db[_0x59c4('0x44')][_0x59c4('0x49')]({'where':{'id':_0x1eefb2[_0x59c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x1df502,null))[_0x59c4('0x24')](function(_0x4af5a0){if(_0x4af5a0){return _0x4af5a0['removeBlackLists'](_0x1eefb2[_0x59c4('0x32')][_0x59c4('0x64')]);}})['then'](function(_0xefe20){if(_0xefe20){return db[_0x59c4('0x60')][_0x59c4('0x23')]({'where':{'ListId':_0x1eefb2[_0x59c4('0x32')][_0x59c4('0x64')],'CampaignId':_0x1eefb2[_0x59c4('0x53')]['id']}})[_0x59c4('0x24')](function(){return _0xefe20;});}})[_0x59c4('0x24')](respondWithStatusCode(_0x1df502,null))[_0x59c4('0x47')](handleError(_0x1df502,null));}; \ No newline at end of file +var _0x5dca=['mustache','util','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','includeAll','include','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','nolimit','order','findOne','CmHopperHistory','getHopperFinals','CampaignId','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','select','field','ContactId','toString','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','phone','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x5dca,0x191));var _0xa5dc=function(_0x5f2282,_0xc29c83){_0x5f2282=_0x5f2282-0x0;var _0x1c1b8b=_0x5dca[_0x5f2282];return _0x1c1b8b;};'use strict';var emlformat=require(_0xa5dc('0x0'));var rimraf=require(_0xa5dc('0x1'));var zipdir=require(_0xa5dc('0x2'));var jsonpatch=require(_0xa5dc('0x3'));var rp=require(_0xa5dc('0x4'));var moment=require(_0xa5dc('0x5'));var BPromise=require(_0xa5dc('0x6'));var Mustache=require(_0xa5dc('0x7'));var util=require(_0xa5dc('0x8'));var path=require('path');var sox=require(_0xa5dc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5dc('0xa'));var _=require(_0xa5dc('0xb'));var squel=require(_0xa5dc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa5dc('0xd'));var toCsv=require(_0xa5dc('0xe'));var querystring=require(_0xa5dc('0xf'));var Papa=require(_0xa5dc('0x10'));var Redis=require(_0xa5dc('0x11'));var authService=require(_0xa5dc('0x12'));var qs=require(_0xa5dc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5dc('0x14'));var logger=require(_0xa5dc('0x15'))(_0xa5dc('0x16'));var utils=require('../../config/utils');var config=require(_0xa5dc('0x17'));var licenseUtil=require(_0xa5dc('0x18'));var db=require(_0xa5dc('0x19'))['db'];function respondWithStatusCode(_0x2c5807,_0x28f55a){_0x28f55a=_0x28f55a||0xcc;return function(_0x1608ed){if(_0x1608ed){return _0x2c5807['sendStatus'](_0x28f55a);}return _0x2c5807[_0xa5dc('0x1a')](_0x28f55a)[_0xa5dc('0x1b')]();};}function respondWithResult(_0x58aaf0,_0x33ba28){_0x33ba28=_0x33ba28||0xc8;return function(_0x28dd7a){if(_0x28dd7a){return _0x58aaf0[_0xa5dc('0x1a')](_0x33ba28)[_0xa5dc('0x1c')](_0x28dd7a);}};}function respondWithFilteredResult(_0x2e5314,_0x245630){return function(_0x4b2e4){if(_0x4b2e4){var _0x33869e=typeof _0x245630['offset']===_0xa5dc('0x1d')&&typeof _0x245630[_0xa5dc('0x1e')]===_0xa5dc('0x1d');var _0x58e72d=_0x4b2e4[_0xa5dc('0x1f')];var _0x4b15d5=_0x33869e?0x0:_0x245630[_0xa5dc('0x20')];var _0x3a1e27=_0x33869e?_0x4b2e4['count']:_0x245630[_0xa5dc('0x20')]+_0x245630['limit'];var _0x2397e0;if(_0x3a1e27>=_0x58e72d){_0x3a1e27=_0x58e72d;_0x2397e0=0xc8;}else{_0x2397e0=0xce;}_0x2e5314[_0xa5dc('0x1a')](_0x2397e0);return _0x2e5314['set'](_0xa5dc('0x21'),_0x4b15d5+'-'+_0x3a1e27+'/'+_0x58e72d)['json'](_0x4b2e4);}return null;};}function patchUpdates(_0x3c8d80){return function(_0x2d12df){try{jsonpatch[_0xa5dc('0x22')](_0x2d12df,_0x3c8d80,!![]);}catch(_0x3dda89){return BPromise[_0xa5dc('0x23')](_0x3dda89);}return _0x2d12df['save']();};}function saveUpdates(_0x1dab3d,_0x125b4e){return function(_0x3527e2){if(_0x3527e2){return _0x3527e2[_0xa5dc('0x24')](_0x1dab3d)[_0xa5dc('0x25')](function(_0x5863dd){return _0x5863dd;});}return null;};}function removeEntity(_0xa0f4ed,_0x4255c3){return function(_0x8def96){if(_0x8def96){return _0x8def96['destroy']()[_0xa5dc('0x25')](function(){var _0x43f298=_0x8def96[_0xa5dc('0x26')]({'plain':!![]});var _0x39b65e=_0xa5dc('0x27');return db[_0xa5dc('0x28')][_0xa5dc('0x29')]({'where':{'type':_0x39b65e,'resourceId':_0x43f298['id']}})[_0xa5dc('0x25')](function(){return _0x8def96;});})['then'](function(){_0xa0f4ed[_0xa5dc('0x1a')](0xcc)[_0xa5dc('0x1b')]();});}};}function handleEntityNotFound(_0x30a583,_0x55b42e){return function(_0x1f557a){if(!_0x1f557a){_0x30a583['sendStatus'](0x194);}return _0x1f557a;};}function handleError(_0x55e4f4,_0x27f923){_0x27f923=_0x27f923||0x1f4;return function(_0x22e24a){logger[_0xa5dc('0x2a')](_0x22e24a[_0xa5dc('0x2b')]);if(_0x22e24a['name']){delete _0x22e24a[_0xa5dc('0x2c')];}_0x55e4f4['status'](_0x27f923)[_0xa5dc('0x2d')](_0x22e24a);};}exports[_0xa5dc('0x2e')]=function(_0x4b3645,_0x46e721){var _0x1e4f26={},_0x3dfc1d={},_0x1bb06f={'count':0x0,'rows':[]};var _0x10ebff=_[_0xa5dc('0x2f')](db[_0xa5dc('0x30')][_0xa5dc('0x31')],function(_0x307f74){return{'name':_0x307f74[_0xa5dc('0x32')],'type':_0x307f74[_0xa5dc('0x33')][_0xa5dc('0x34')]};});_0x3dfc1d[_0xa5dc('0x35')]=_[_0xa5dc('0x2f')](_0x10ebff,_0xa5dc('0x2c'));_0x3dfc1d[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x4b3645['query']);_0x3dfc1d[_0xa5dc('0x38')]=_['intersection'](_0x3dfc1d[_0xa5dc('0x35')],_0x3dfc1d[_0xa5dc('0x36')]);_0x1e4f26[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x3dfc1d[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x4b3645['query'][_0xa5dc('0x3b')]));_0x1e4f26['attributes']=_0x1e4f26[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x1e4f26[_0xa5dc('0x39')]:_0x3dfc1d['model'];if(!_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x3d')]('nolimit')){_0x1e4f26['limit']=qs[_0xa5dc('0x1e')](_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x1e4f26[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x4b3645['query'][_0xa5dc('0x20')]);}_0x1e4f26['order']=qs[_0xa5dc('0x3e')](_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x1e4f26[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x4b3645[_0xa5dc('0x36')],_0x3dfc1d[_0xa5dc('0x38')]),_0x10ebff);if(_0x4b3645['query'][_0xa5dc('0x41')]){_0x1e4f26['where']=_['merge'](_0x1e4f26['where'],{'$or':_[_0xa5dc('0x2f')](_0x10ebff,function(_0x141672){if(_0x141672[_0xa5dc('0x33')]!==_0xa5dc('0x42')){var _0x3cd3b5={};_0x3cd3b5[_0x141672[_0xa5dc('0x2c')]]={'$like':'%'+_0x4b3645['query'][_0xa5dc('0x41')]+'%'};return _0x3cd3b5;}})});}_0x1e4f26=_[_0xa5dc('0x43')]({},_0x1e4f26,_0x4b3645[_0xa5dc('0x44')]);var _0x199c7f={'where':_0x1e4f26['where']};return db[_0xa5dc('0x30')]['count'](_0x199c7f)[_0xa5dc('0x25')](function(_0x23131f){_0x1bb06f[_0xa5dc('0x1f')]=_0x23131f;if(_0x4b3645[_0xa5dc('0x36')]['includeAll']){_0x1e4f26['include']=[{'all':!![]}];}return db[_0xa5dc('0x30')][_0xa5dc('0x45')](_0x1e4f26);})[_0xa5dc('0x25')](function(_0x4c6b61){_0x1bb06f[_0xa5dc('0x46')]=_0x4c6b61;return _0x1bb06f;})[_0xa5dc('0x25')](respondWithFilteredResult(_0x46e721,_0x1e4f26))['catch'](handleError(_0x46e721,null));};exports[_0xa5dc('0x47')]=function(_0x53fbc1,_0x22a37c){var _0x17060c={'raw':![],'where':{'id':_0x53fbc1[_0xa5dc('0x48')]['id']}},_0x5566de={};_0x5566de[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x30')]['rawAttributes']);_0x5566de['query']=_[_0xa5dc('0x37')](_0x53fbc1[_0xa5dc('0x36')]);_0x5566de[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x5566de[_0xa5dc('0x35')],_0x5566de['query']);_0x17060c[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x5566de['model'],qs[_0xa5dc('0x3b')](_0x53fbc1['query'][_0xa5dc('0x3b')]));_0x17060c[_0xa5dc('0x39')]=_0x17060c['attributes']['length']?_0x17060c[_0xa5dc('0x39')]:_0x5566de['model'];if(_0x53fbc1[_0xa5dc('0x36')]['includeAll']){_0x17060c['include']=[{'all':!![]}];}_0x17060c=_['merge']({},_0x17060c,_0x53fbc1[_0xa5dc('0x44')]);return db[_0xa5dc('0x30')][_0xa5dc('0x49')](_0x17060c)['then'](handleEntityNotFound(_0x22a37c,null))[_0xa5dc('0x25')](respondWithResult(_0x22a37c,null))['catch'](handleError(_0x22a37c,null));};exports[_0xa5dc('0x4a')]=function(_0x39fcae,_0x57493e){return db[_0xa5dc('0x30')]['create'](_0x39fcae[_0xa5dc('0x4b')],{})[_0xa5dc('0x25')](function(_0xef90d3){var _0x3c273c=_0x39fcae[_0xa5dc('0x4c')][_0xa5dc('0x26')]({'plain':!![]});if(!_0x3c273c)throw new Error(_0xa5dc('0x4d'));if(_0x3c273c[_0xa5dc('0x4e')]==='user'){var _0xb53cf6=_0xef90d3['get']({'plain':!![]});var _0x43672c=_0xa5dc('0x27');return db[_0xa5dc('0x4f')]['find']({'where':{'name':_0x43672c,'userProfileId':_0x3c273c[_0xa5dc('0x50')]},'raw':!![]})['then'](function(_0x4cd1c6){if(_0x4cd1c6&&_0x4cd1c6['autoAssociation']===0x0){return db[_0xa5dc('0x28')][_0xa5dc('0x4a')]({'name':_0xb53cf6[_0xa5dc('0x2c')],'resourceId':_0xb53cf6['id'],'type':_0x4cd1c6[_0xa5dc('0x2c')],'sectionId':_0x4cd1c6['id']},{})[_0xa5dc('0x25')](function(){return _0xef90d3;});}else{return _0xef90d3;}})['catch'](function(_0x1cb7bc){logger[_0xa5dc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cb7bc);throw _0x1cb7bc;});}return _0xef90d3;})['then'](respondWithResult(_0x57493e,0xc9))[_0xa5dc('0x51')](handleError(_0x57493e,null));};exports['clone']=function(_0xfaca60,_0xd68c4){var _0xbc209b={'where':{'id':_0xfaca60[_0xa5dc('0x48')]['id']}},_0x52e1dc={};_0x52e1dc[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x30')]['rawAttributes']);_0xbc209b[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x52e1dc['model'],qs['fields'](_0xfaca60[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0xbc209b['attributes']=_0xbc209b[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0xbc209b[_0xa5dc('0x39')]:_0x52e1dc['model'];if(_0xfaca60[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0xbc209b[_0xa5dc('0x53')]=[{'all':!![]}];}_0xbc209b=_[_0xa5dc('0x43')]({},_0xbc209b,_0xfaca60[_0xa5dc('0x44')]);return db[_0xa5dc('0x30')][_0xa5dc('0x49')](_0xbc209b)[_0xa5dc('0x25')](handleEntityNotFound(_0xd68c4,null))[_0xa5dc('0x25')](function(_0x50bb5f){if(_0x50bb5f){var _0x465964=_0x50bb5f[_0xa5dc('0x26')]({'plain':!![]});_0x465964=qs['omit'](_0x465964,['id',_0xa5dc('0x54'),_0xa5dc('0x55')]);_0xfaca60[_0xa5dc('0x4b')]=_['omit'](_0xfaca60[_0xa5dc('0x4b')],['id',_0xa5dc('0x54'),_0xa5dc('0x55')]);return db[_0xa5dc('0x30')][_0xa5dc('0x4a')](_['merge'](_0x465964,_0xfaca60['body']),{'include':_0xfaca60[_0xa5dc('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2577b3){var _0x37eb5f=_0xfaca60[_0xa5dc('0x4c')][_0xa5dc('0x26')]({'plain':!![]});if(!_0x37eb5f)throw new Error(_0xa5dc('0x4d'));if(_0x37eb5f[_0xa5dc('0x4e')]==='user'){var _0xeed85e=_0x2577b3[_0xa5dc('0x26')]({'plain':!![]});var _0x1378ba=_0xa5dc('0x27');return db[_0xa5dc('0x4f')][_0xa5dc('0x49')]({'where':{'name':_0x1378ba,'userProfileId':_0x37eb5f['userProfileId']},'raw':!![]})[_0xa5dc('0x25')](function(_0x2d6ea3){if(_0x2d6ea3&&_0x2d6ea3[_0xa5dc('0x56')]===0x0){return db[_0xa5dc('0x28')]['create']({'name':_0xeed85e[_0xa5dc('0x2c')],'resourceId':_0xeed85e['id'],'type':_0x2d6ea3['name'],'sectionId':_0x2d6ea3['id']},{})[_0xa5dc('0x25')](function(){return _0x2577b3;});}else{return _0x2577b3;}})[_0xa5dc('0x51')](function(_0x30e62b){logger[_0xa5dc('0x2a')](_0xa5dc('0x57'),_0x30e62b);throw _0x30e62b;});}return _0x2577b3;});}})['then'](respondWithResult(_0xd68c4,0xc9))['catch'](handleError(_0xd68c4,null));};exports[_0xa5dc('0x24')]=function(_0x5df928,_0x389850){if(_0x5df928[_0xa5dc('0x4b')]['id']){delete _0x5df928[_0xa5dc('0x4b')]['id'];}return db['Campaign'][_0xa5dc('0x49')]({'where':{'id':_0x5df928['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x389850,null))[_0xa5dc('0x25')](saveUpdates(_0x5df928[_0xa5dc('0x4b')],null))['then'](respondWithResult(_0x389850,null))[_0xa5dc('0x51')](handleError(_0x389850,null));};exports[_0xa5dc('0x29')]=function(_0x3111dc,_0x1ebf8b){return db[_0xa5dc('0x30')][_0xa5dc('0x49')]({'where':{'id':_0x3111dc['params']['id']}})['then'](handleEntityNotFound(_0x1ebf8b,null))[_0xa5dc('0x25')](removeEntity(_0x1ebf8b,null))[_0xa5dc('0x51')](handleError(_0x1ebf8b,null));};exports[_0xa5dc('0x58')]=function(_0x529454,_0xd17c2f,_0xdc04a0){var _0x568efd={'raw':!![],'where':{}};var _0x52885c={};var _0x3398ae={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')]['findOne']({'where':{'id':_0x529454[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0xd17c2f,null))['then'](function(_0x1d45e0){if(_0x1d45e0){_0x52885c['model']=_[_0xa5dc('0x37')](db[_0xa5dc('0x59')][_0xa5dc('0x31')]);_0x52885c[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x529454['query']);_0x52885c[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x52885c[_0xa5dc('0x35')],_0x52885c[_0xa5dc('0x36')]);_0x568efd['attributes']=_['intersection'](_0x52885c['model'],qs[_0xa5dc('0x3b')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x568efd['attributes']=_0x568efd[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x568efd[_0xa5dc('0x39')]:_0x52885c[_0xa5dc('0x35')];if(!_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x568efd['limit']=qs['limit'](_0x529454['query'][_0xa5dc('0x1e')]);_0x568efd[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x568efd[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x568efd[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_['pick'](_0x529454[_0xa5dc('0x36')],_0x52885c[_0xa5dc('0x38')]));_0x568efd['where']['CampaignId']=_0x1d45e0['id'];if(_0x529454[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x568efd[_0xa5dc('0x3f')]=_['merge'](_0x568efd['where'],{'$or':_['map'](_0x568efd[_0xa5dc('0x39')],function(_0x36386a){var _0x815822={};_0x815822[_0x36386a]={'$like':'%'+_0x529454[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x815822;})});}_0x568efd=_['merge']({},_0x568efd,_0x529454[_0xa5dc('0x44')]);return db['CmHopper']['count']({'where':_0x568efd['where']})['then'](function(_0x31e1bf){_0x3398ae[_0xa5dc('0x1f')]=_0x31e1bf;if(_0x529454[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x568efd[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x59')][_0xa5dc('0x45')](_0x568efd);})['then'](function(_0x89a87d){_0x3398ae[_0xa5dc('0x46')]=_0x89a87d;return _0x3398ae;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0xd17c2f,_0x568efd))[_0xa5dc('0x51')](handleError(_0xd17c2f,null));};exports['getHopperHistories']=function(_0xef06fd,_0x11063e,_0x326cfa){var _0x4b5cbb={'raw':!![],'where':{}};var _0x9ed2da={};var _0x2dd27b={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0xef06fd[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x11063e,null))[_0xa5dc('0x25')](function(_0x4822c6){if(_0x4822c6){_0x9ed2da[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x5d')][_0xa5dc('0x31')]);_0x9ed2da[_0xa5dc('0x36')]=_['keys'](_0xef06fd[_0xa5dc('0x36')]);_0x9ed2da[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x9ed2da[_0xa5dc('0x35')],_0x9ed2da[_0xa5dc('0x36')]);_0x4b5cbb[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x9ed2da[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x4b5cbb['attributes']=_0x4b5cbb[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x4b5cbb[_0xa5dc('0x39')]:_0x9ed2da['model'];if(!_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x4b5cbb[_0xa5dc('0x1e')]=qs['limit'](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x4b5cbb[_0xa5dc('0x20')]=qs['offset'](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x4b5cbb[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0xef06fd['query'][_0xa5dc('0x3e')]);_0x4b5cbb[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0xef06fd[_0xa5dc('0x36')],_0x9ed2da[_0xa5dc('0x38')]));_0x4b5cbb['where']['CampaignId']=_0x4822c6['id'];if(_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x4b5cbb['where']=_[_0xa5dc('0x43')](_0x4b5cbb[_0xa5dc('0x3f')],{'$or':_[_0xa5dc('0x2f')](_0x4b5cbb[_0xa5dc('0x39')],function(_0x911df9){var _0x2021bb={};_0x2021bb[_0x911df9]={'$like':'%'+_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x2021bb;})});}_0x4b5cbb=_[_0xa5dc('0x43')]({},_0x4b5cbb,_0xef06fd[_0xa5dc('0x44')]);return db['CmHopperHistory'][_0xa5dc('0x1f')]({'where':_0x4b5cbb['where']})['then'](function(_0x54e83c){_0x2dd27b[_0xa5dc('0x1f')]=_0x54e83c;if(_0xef06fd['query'][_0xa5dc('0x52')]){_0x4b5cbb[_0xa5dc('0x53')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa5dc('0x45')](_0x4b5cbb);})[_0xa5dc('0x25')](function(_0xe15fb5){_0x2dd27b[_0xa5dc('0x46')]=_0xe15fb5;return _0x2dd27b;});}})['then'](respondWithFilteredResult(_0x11063e,_0x4b5cbb))['catch'](handleError(_0x11063e,null));};exports[_0xa5dc('0x5e')]=function(_0x1c00e7,_0x538507,_0x3b0529){var _0x2efa1c={'raw':!![],'where':{}};var _0x5eceea={};var _0x17b387={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0x1c00e7[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x538507,null))[_0xa5dc('0x25')](function(_0x46775e){if(_0x46775e){_0x5eceea['model']=_[_0xa5dc('0x37')](db['CmHopperFinal'][_0xa5dc('0x31')]);_0x5eceea['query']=_[_0xa5dc('0x37')](_0x1c00e7[_0xa5dc('0x36')]);_0x5eceea['filters']=_[_0xa5dc('0x3a')](_0x5eceea[_0xa5dc('0x35')],_0x5eceea[_0xa5dc('0x36')]);_0x2efa1c[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x5eceea['model'],qs[_0xa5dc('0x3b')](_0x1c00e7['query'][_0xa5dc('0x3b')]));_0x2efa1c[_0xa5dc('0x39')]=_0x2efa1c[_0xa5dc('0x39')]['length']?_0x2efa1c[_0xa5dc('0x39')]:_0x5eceea[_0xa5dc('0x35')];if(!_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x2efa1c[_0xa5dc('0x1e')]=qs['limit'](_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x2efa1c[_0xa5dc('0x20')]=qs['offset'](_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x2efa1c[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0x1c00e7['query']['sort']);_0x2efa1c[_0xa5dc('0x3f')]=qs['filters'](_[_0xa5dc('0x40')](_0x1c00e7['query'],_0x5eceea[_0xa5dc('0x38')]));_0x2efa1c['where'][_0xa5dc('0x5f')]=_0x46775e['id'];if(_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x2efa1c[_0xa5dc('0x3f')]=_['merge'](_0x2efa1c['where'],{'$or':_[_0xa5dc('0x2f')](_0x2efa1c[_0xa5dc('0x39')],function(_0x2bfdec){var _0x2b2bae={};_0x2b2bae[_0x2bfdec]={'$like':'%'+_0x1c00e7[_0xa5dc('0x36')]['filter']+'%'};return _0x2b2bae;})});}_0x2efa1c=_[_0xa5dc('0x43')]({},_0x2efa1c,_0x1c00e7[_0xa5dc('0x44')]);return db[_0xa5dc('0x60')][_0xa5dc('0x1f')]({'where':_0x2efa1c[_0xa5dc('0x3f')]})[_0xa5dc('0x25')](function(_0x5101b7){_0x17b387['count']=_0x5101b7;if(_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x2efa1c[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x60')][_0xa5dc('0x45')](_0x2efa1c);})['then'](function(_0x527c39){_0x17b387['rows']=_0x527c39;return _0x17b387;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0x538507,_0x2efa1c))['catch'](handleError(_0x538507,null));};exports['getHopperBlacks']=function(_0x24ad5c,_0x140f73,_0x12ec3a){var _0x171b14={'raw':!![],'where':{}};var _0x52e167={};var _0x4707df={'count':0x0,'rows':[]};return db['Campaign'][_0xa5dc('0x5c')]({'where':{'id':_0x24ad5c['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x140f73,null))[_0xa5dc('0x25')](function(_0x4d8d51){if(_0x4d8d51){_0x52e167[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x61')]['rawAttributes']);_0x52e167[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x24ad5c[_0xa5dc('0x36')]);_0x52e167[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x52e167[_0xa5dc('0x35')],_0x52e167['query']);_0x171b14[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x52e167[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x171b14['attributes']=_0x171b14[_0xa5dc('0x39')]['length']?_0x171b14[_0xa5dc('0x39')]:_0x52e167[_0xa5dc('0x35')];if(!_0x24ad5c[_0xa5dc('0x36')]['hasOwnProperty'](_0xa5dc('0x5a'))){_0x171b14['limit']=qs['limit'](_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x171b14[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x24ad5c[_0xa5dc('0x36')]['offset']);}_0x171b14[_0xa5dc('0x5b')]=qs['sort'](_0x24ad5c['query'][_0xa5dc('0x3e')]);_0x171b14[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_['pick'](_0x24ad5c[_0xa5dc('0x36')],_0x52e167[_0xa5dc('0x38')]));_0x171b14['where'][_0xa5dc('0x5f')]=_0x4d8d51['id'];if(_0x24ad5c['query'][_0xa5dc('0x41')]){_0x171b14['where']=_[_0xa5dc('0x43')](_0x171b14['where'],{'$or':_[_0xa5dc('0x2f')](_0x171b14['attributes'],function(_0x4f314b){var _0x3bd657={};_0x3bd657[_0x4f314b]={'$like':'%'+_0x24ad5c[_0xa5dc('0x36')]['filter']+'%'};return _0x3bd657;})});}_0x171b14=_['merge']({},_0x171b14,_0x24ad5c['options']);return db[_0xa5dc('0x61')][_0xa5dc('0x1f')]({'where':_0x171b14[_0xa5dc('0x3f')]})[_0xa5dc('0x25')](function(_0x4726f6){_0x4707df[_0xa5dc('0x1f')]=_0x4726f6;if(_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x171b14[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x61')][_0xa5dc('0x45')](_0x171b14);})[_0xa5dc('0x25')](function(_0x2a021b){_0x4707df[_0xa5dc('0x46')]=_0x2a021b;return _0x4707df;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0x140f73,_0x171b14))[_0xa5dc('0x51')](handleError(_0x140f73,null));};exports['getLists']=function(_0x5cce6c,_0x473b6c,_0x5f3567){var _0x2f99a6={};var _0x557f1c={};var _0xf0ba5e;var _0x2e16d3;return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0x5cce6c['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x473b6c,null))[_0xa5dc('0x25')](function(_0x218c57){if(_0x218c57){_0xf0ba5e=_0x218c57;_0x557f1c[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x62')][_0xa5dc('0x31')]);_0x557f1c[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x5cce6c[_0xa5dc('0x36')]);_0x557f1c[_0xa5dc('0x38')]=_['intersection'](_0x557f1c['model'],_0x557f1c[_0xa5dc('0x36')]);_0x2f99a6[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x557f1c[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x5cce6c['query'][_0xa5dc('0x3b')]));_0x2f99a6[_0xa5dc('0x39')]=_0x2f99a6['attributes'][_0xa5dc('0x3c')]?_0x2f99a6['attributes']:_0x557f1c[_0xa5dc('0x35')];_0x2f99a6['order']=qs[_0xa5dc('0x3e')](_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x2f99a6[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x5cce6c[_0xa5dc('0x36')],_0x557f1c['filters']));if(_0x5cce6c['query'][_0xa5dc('0x41')]){_0x2f99a6[_0xa5dc('0x3f')]=_['merge'](_0x2f99a6['where'],{'$or':_['map'](_0x2f99a6['attributes'],function(_0x50246f){var _0x122aa2={};_0x122aa2[_0x50246f]={'$like':'%'+_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x122aa2;})});}_0x2f99a6=_[_0xa5dc('0x43')]({},_0x2f99a6,_0x5cce6c[_0xa5dc('0x44')]);return _0xf0ba5e[_0xa5dc('0x63')](_0x2f99a6);}})[_0xa5dc('0x25')](function(_0x1d9dc1){if(_0x1d9dc1){_0x2e16d3=_0x1d9dc1[_0xa5dc('0x3c')];if(!_0x5cce6c['query']['hasOwnProperty']('nolimit')){_0x2f99a6[_0xa5dc('0x1e')]=qs[_0xa5dc('0x1e')](_0x5cce6c['query'][_0xa5dc('0x1e')]);_0x2f99a6['offset']=qs[_0xa5dc('0x20')](_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x20')]);}return _0xf0ba5e[_0xa5dc('0x63')](_0x2f99a6);}})[_0xa5dc('0x25')](function(_0x2555f1){if(_0x2555f1){return _0x2555f1?{'count':_0x2e16d3,'rows':_0x2555f1}:null;}})['then'](respondWithResult(_0x473b6c,null))['catch'](handleError(_0x473b6c,null));};exports['addLists']=function(_0x2dfc44,_0x13029e,_0x5d8e49){var _0x519538,_0x4c4974;return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x2dfc44['params']['id']}})['then'](handleEntityNotFound(_0x13029e,null))[_0xa5dc('0x25')](function(_0x3f0fcf){if(_0x3f0fcf){_0x4c4974=_0x3f0fcf;return _0x3f0fcf[_0xa5dc('0x64')](_0x2dfc44[_0xa5dc('0x4b')][_0xa5dc('0x65')],_[_0xa5dc('0x66')](_0x2dfc44['body'],['ids','id'])||{});}return null;})[_0xa5dc('0x67')](function(_0x14da1c){var _0x299055;_0x519538=_0x14da1c||[];var _0x3c0095=[];if(_0x14da1c){for(var _0xbeb74e=0x0;_0xbeb74e<_0x14da1c[_0xa5dc('0x3c')];_0xbeb74e+=0x1){var _0x11f85a=_0x14da1c[_0xbeb74e][_0xa5dc('0x26')]({'plain':!![]});_0x4c4974['dialCheckDuplicateType']=_0x2dfc44[_0xa5dc('0x4b')][_0xa5dc('0x68')]?_0x2dfc44['body'][_0xa5dc('0x68')]:_0x4c4974['dialCheckDuplicateType'];switch(_0x4c4974[_0xa5dc('0x68')]){case'always':_0x299055=squel[_0xa5dc('0x69')]()[_0xa5dc('0x6a')]('cm_hopper')[_0xa5dc('0x6b')](['phone',_0xa5dc('0x6c'),'ContactId','ListId',_0xa5dc('0x5f'),_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')]('phone','phone')[_0xa5dc('0x6e')]('NOW()',_0xa5dc('0x6c'))[_0xa5dc('0x6e')]('id',_0xa5dc('0x6f'))[_0xa5dc('0x6e')](_0x11f85a['CmListId'][_0xa5dc('0x70')](),_0xa5dc('0x71'))[_0xa5dc('0x6e')](_0x2dfc44[_0xa5dc('0x48')]['id']['toString'](),_0xa5dc('0x5f'))['field'](_0xa5dc('0x72'),_0xa5dc('0x54'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x55'))['from'](_0xa5dc('0x73'))[_0xa5dc('0x3f')](_0xa5dc('0x74'))[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x11f85a[_0xa5dc('0x76')]['toString']())[_0xa5dc('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xa5dc('0x77'),squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')]('COALESCE(calleridnum,\x27\x27)')[_0xa5dc('0x78')](_0xa5dc('0x79'))['where'](_0xa5dc('0x7a'),_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')]()))[_0xa5dc('0x3f')](_0xa5dc('0x77'),squel[_0xa5dc('0x6d')]()['field'](_0xa5dc('0x7b'))[_0xa5dc('0x78')](_0xa5dc('0x7c'))[_0xa5dc('0x3f')]('CampaignId\x20=\x20?',_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')]())))[_0xa5dc('0x70')]();break;case _0xa5dc('0x7d'):_0x299055=squel[_0xa5dc('0x69')]()[_0xa5dc('0x6a')]('cm_hopper')['fromQuery']([_0xa5dc('0x7e'),_0xa5dc('0x6c'),_0xa5dc('0x6f'),_0xa5dc('0x71'),'CampaignId',_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7e'),_0xa5dc('0x7e'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),'scheduledAt')['field']('id',_0xa5dc('0x6f'))[_0xa5dc('0x6e')](_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')](),_0xa5dc('0x71'))[_0xa5dc('0x6e')](_0x2dfc44['params']['id'][_0xa5dc('0x70')](),_0xa5dc('0x5f'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x54'))['field'](_0xa5dc('0x72'),'updatedAt')[_0xa5dc('0x78')](_0xa5dc('0x73'))[_0xa5dc('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')]())['where'](_0xa5dc('0x7f'))[_0xa5dc('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7b'))[_0xa5dc('0x78')](_0xa5dc('0x7c'))[_0xa5dc('0x3f')]('CampaignId\x20=\x20?',_0x2dfc44[_0xa5dc('0x48')]['id']['toString']())))[_0xa5dc('0x70')]();break;default:_0x299055=squel['insert']()[_0xa5dc('0x6a')](_0xa5dc('0x7c'))[_0xa5dc('0x6b')]([_0xa5dc('0x7e'),_0xa5dc('0x6c'),_0xa5dc('0x6f'),_0xa5dc('0x71'),'CampaignId',_0xa5dc('0x54'),'updatedAt'],squel[_0xa5dc('0x6d')]()['field'](_0xa5dc('0x7e'),'phone')['field'](_0xa5dc('0x72'),_0xa5dc('0x6c'))[_0xa5dc('0x6e')]('id','ContactId')[_0xa5dc('0x6e')](_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')](),'ListId')[_0xa5dc('0x6e')](_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')](),_0xa5dc('0x5f'))['field'](_0xa5dc('0x72'),_0xa5dc('0x54'))['field'](_0xa5dc('0x72'),_0xa5dc('0x55'))[_0xa5dc('0x78')](_0xa5dc('0x73'))['where'](_0xa5dc('0x74'))[_0xa5dc('0x3f')]('ListId\x20=\x20?',_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')]())['where'](_0xa5dc('0x7f')))[_0xa5dc('0x70')]();}_0x3c0095[_0xa5dc('0x80')](db['sequelize'][_0xa5dc('0x36')](_0x299055));}return BPromise[_0xa5dc('0x81')](_0x3c0095);}})['then'](function(){return _0x519538;})[_0xa5dc('0x25')](respondWithResult(_0x13029e,null))[_0xa5dc('0x51')](handleError(_0x13029e,null));};exports[_0xa5dc('0x82')]=function(_0x2c6648,_0x1c538e,_0x2e052e){return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x2c6648['params']['id']}})['then'](handleEntityNotFound(_0x1c538e,null))['then'](function(_0x263b61){if(_0x263b61){return _0x263b61[_0xa5dc('0x82')](_0x2c6648[_0xa5dc('0x36')][_0xa5dc('0x65')]);}})[_0xa5dc('0x25')](function(_0x79ea41){if(_0x79ea41){return db[_0xa5dc('0x59')][_0xa5dc('0x29')]({'where':{'ListId':_0x2c6648['query']['ids'],'CampaignId':_0x2c6648[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](function(){return _0x79ea41;});}})[_0xa5dc('0x25')](respondWithStatusCode(_0x1c538e,null))[_0xa5dc('0x51')](handleError(_0x1c538e,null));};exports[_0xa5dc('0x83')]=function(_0x4c4564,_0x15faeb,_0x57a08d){var _0x46f369={};var _0x3aa164={};var _0x4a0691;var _0x45cb08;return db[_0xa5dc('0x30')]['findOne']({'where':{'id':_0x4c4564[_0xa5dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x15faeb,null))[_0xa5dc('0x25')](function(_0x1e4f0f){if(_0x1e4f0f){_0x4a0691=_0x1e4f0f;_0x3aa164[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x62')][_0xa5dc('0x31')]);_0x3aa164[_0xa5dc('0x36')]=_['keys'](_0x4c4564[_0xa5dc('0x36')]);_0x3aa164[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x3aa164['model'],_0x3aa164[_0xa5dc('0x36')]);_0x46f369[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x3aa164[_0xa5dc('0x35')],qs['fields'](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x46f369[_0xa5dc('0x39')]=_0x46f369[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x46f369[_0xa5dc('0x39')]:_0x3aa164[_0xa5dc('0x35')];_0x46f369['order']=qs[_0xa5dc('0x3e')](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x46f369[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x4c4564[_0xa5dc('0x36')],_0x3aa164[_0xa5dc('0x38')]));if(_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x46f369['where']=_[_0xa5dc('0x43')](_0x46f369[_0xa5dc('0x3f')],{'$or':_[_0xa5dc('0x2f')](_0x46f369[_0xa5dc('0x39')],function(_0xba4619){var _0x22ce21={};_0x22ce21[_0xba4619]={'$like':'%'+_0x4c4564['query'][_0xa5dc('0x41')]+'%'};return _0x22ce21;})});}_0x46f369=_[_0xa5dc('0x43')]({},_0x46f369,_0x4c4564['options']);return _0x4a0691[_0xa5dc('0x83')](_0x46f369);}})[_0xa5dc('0x25')](function(_0x3ee9b3){if(_0x3ee9b3){_0x45cb08=_0x3ee9b3['length'];if(!_0x4c4564['query'][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x46f369[_0xa5dc('0x1e')]=qs['limit'](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x46f369['offset']=qs[_0xa5dc('0x20')](_0x4c4564['query'][_0xa5dc('0x20')]);}return _0x4a0691['getBlackLists'](_0x46f369);}})[_0xa5dc('0x25')](function(_0x3fedeb){if(_0x3fedeb){return _0x3fedeb?{'count':_0x45cb08,'rows':_0x3fedeb}:null;}})[_0xa5dc('0x25')](respondWithResult(_0x15faeb,null))['catch'](handleError(_0x15faeb,null));};exports['addBlackLists']=function(_0x7052e0,_0x23f300,_0x1699a0){var _0x1bcca2,_0x55c835;return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x7052e0['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x23f300,null))['then'](function(_0x25dbb3){if(_0x25dbb3){_0x55c835=_0x25dbb3;return _0x25dbb3[_0xa5dc('0x84')](_0x7052e0[_0xa5dc('0x4b')]['ids'],_[_0xa5dc('0x66')](_0x7052e0[_0xa5dc('0x4b')],[_0xa5dc('0x65'),'id'])||{});}return null;})[_0xa5dc('0x67')](function(_0x3f8709){var _0x513bbe;_0x1bcca2=_0x3f8709||[];var _0x208b11=[];if(_0x3f8709){for(var _0x341e7c=0x0;_0x341e7c<_0x3f8709[_0xa5dc('0x3c')];_0x341e7c+=0x1){var _0x9aa40c=_0x3f8709[_0x341e7c][_0xa5dc('0x26')]({'plain':!![]});_0x513bbe=squel['insert']()['into'](_0xa5dc('0x85'))[_0xa5dc('0x6b')]([_0xa5dc('0x7e'),'ContactId',_0xa5dc('0x71'),_0xa5dc('0x5f'),_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7e'),_0xa5dc('0x7e'))[_0xa5dc('0x6e')]('id',_0xa5dc('0x6f'))['field'](_0x9aa40c[_0xa5dc('0x76')][_0xa5dc('0x70')](),'ListId')[_0xa5dc('0x6e')](_0x7052e0['params']['id']['toString'](),_0xa5dc('0x5f'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x54'))[_0xa5dc('0x6e')]('NOW()',_0xa5dc('0x55'))['from'](_0xa5dc('0x73'))[_0xa5dc('0x3f')](_0xa5dc('0x74'))[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x9aa40c['CmListId'][_0xa5dc('0x70')]())[_0xa5dc('0x3f')](_0xa5dc('0x7f')))['toString']();_0x208b11[_0xa5dc('0x80')](db[_0xa5dc('0x86')][_0xa5dc('0x36')](_0x513bbe));}return BPromise['all'](_0x208b11);}})[_0xa5dc('0x25')](function(){return _0x1bcca2;})[_0xa5dc('0x25')](respondWithResult(_0x23f300,null))[_0xa5dc('0x51')](handleError(_0x23f300,null));};exports[_0xa5dc('0x87')]=function(_0x1d400f,_0x31271b,_0x24f568){return db[_0xa5dc('0x30')][_0xa5dc('0x49')]({'where':{'id':_0x1d400f[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x31271b,null))[_0xa5dc('0x25')](function(_0x42f030){if(_0x42f030){return _0x42f030[_0xa5dc('0x87')](_0x1d400f[_0xa5dc('0x36')][_0xa5dc('0x65')]);}})[_0xa5dc('0x25')](function(_0x40ebfe){if(_0x40ebfe){return db[_0xa5dc('0x61')][_0xa5dc('0x29')]({'where':{'ListId':_0x1d400f[_0xa5dc('0x36')][_0xa5dc('0x65')],'CampaignId':_0x1d400f['params']['id']}})['then'](function(){return _0x40ebfe;});}})[_0xa5dc('0x25')](respondWithStatusCode(_0x31271b,null))[_0xa5dc('0x51')](handleError(_0x31271b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3f80e2a..f727c80 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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':'campaigns','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 e9d9699..38bcfa8 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 _0x4584=['info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1042cd,_0x47865f){var _0xf52445=function(_0x4847f5){while(--_0x4847f5){_0x1042cd['push'](_0x1042cd['shift']());}};_0xf52445(++_0x47865f);}(_0x4584,0x1cf));var _0x4458=function(_0x5c2ad7,_0x2872a5){_0x5c2ad7=_0x5c2ad7-0x0;var _0x32871c=_0x4584[_0x5c2ad7];return _0x32871c;};'use strict';var _=require(_0x4458('0x0'));var util=require('util');var moment=require(_0x4458('0x1'));var BPromise=require(_0x4458('0x2'));var rs=require(_0x4458('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4458('0x4'));var logger=require(_0x4458('0x5'))(_0x4458('0x6'));var config=require(_0x4458('0x7'));var jayson=require(_0x4458('0x8'));var client=jayson[_0x4458('0x9')][_0x4458('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215b2d,_0x102b5f,_0x51da14){return new BPromise(function(_0x14bb0f,_0x83fb96){return client[_0x4458('0xb')](_0x215b2d,_0x51da14)[_0x4458('0xc')](function(_0x1ab8c3){logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));logger[_0x4458('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x102b5f,_0x4458('0xf'),JSON[_0x4458('0x11')](_0x1ab8c3));if(_0x1ab8c3[_0x4458('0x12')]){if(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x13')]===0x1f4){logger['error'](_0x4458('0xe'),_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x83fb96(_0x1ab8c3['error'][_0x4458('0x14')]);}logger[_0x4458('0x12')]('Campaign,\x20%s,\x20%s',_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x14bb0f(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x14')]);}else{logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));_0x14bb0f(_0x1ab8c3[_0x4458('0x15')][_0x4458('0x14')]);}})['catch'](function(_0x31e500){logger['error'](_0x4458('0xe'),_0x102b5f,_0x31e500);_0x83fb96(_0x31e500);});});}exports[_0x4458('0x16')]=function(_0x130d39){var _0x587cbb=this;return new Promise(function(_0x319247,_0x422e35){return db[_0x4458('0x17')][_0x4458('0x18')]({'raw':_0x130d39[_0x4458('0x19')]?_0x130d39[_0x4458('0x19')][_0x4458('0x1a')]===undefined?!![]:![]:!![],'where':_0x130d39[_0x4458('0x19')]?_0x130d39[_0x4458('0x19')][_0x4458('0x1b')]||null:null,'attributes':_0x130d39['options']?_0x130d39[_0x4458('0x19')][_0x4458('0x1c')]||null:null,'limit':_0x130d39[_0x4458('0x19')]?_0x130d39['options'][_0x4458('0x1d')]||null:null,'include':_0x130d39[_0x4458('0x19')]?_0x130d39['options'][_0x4458('0x1e')]?_[_0x4458('0x1f')](_0x130d39['options'][_0x4458('0x1e')],function(_0x17e482){return{'model':db[_0x17e482[_0x4458('0x20')]],'as':_0x17e482['as'],'attributes':_0x17e482['attributes'],'include':_0x17e482[_0x4458('0x1e')]?_['map'](_0x17e482[_0x4458('0x1e')],function(_0x504a86){return{'model':db[_0x504a86['model']],'as':_0x504a86['as'],'attributes':_0x504a86[_0x4458('0x1c')],'include':_0x504a86[_0x4458('0x1e')]?_[_0x4458('0x1f')](_0x504a86[_0x4458('0x1e')],function(_0x153a98){return{'model':db[_0x153a98[_0x4458('0x20')]],'as':_0x153a98['as'],'attributes':_0x153a98[_0x4458('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4458('0xc')](function(_0x452ec4){logger[_0x4458('0xd')](_0x4458('0x16'),_0x130d39);logger['debug'](_0x4458('0x16'),_0x130d39,JSON['stringify'](_0x452ec4));_0x319247(_0x452ec4);})[_0x4458('0x21')](function(_0x5f22be){logger[_0x4458('0x12')](_0x4458('0x16'),_0x5f22be[_0x4458('0x14')],_0x130d39);_0x422e35(_0x587cbb[_0x4458('0x12')](0x1f4,_0x5f22be[_0x4458('0x14')]));});});}; \ No newline at end of file +var _0x342b=['map','model','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','include'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x342b,0xbc));var _0xb342=function(_0x1f1d4e,_0x4125c4){_0x1f1d4e=_0x1f1d4e-0x0;var _0xc764a1=_0x342b[_0x1f1d4e];return _0xc764a1;};'use strict';var _=require(_0xb342('0x0'));var util=require('util');var moment=require(_0xb342('0x1'));var BPromise=require(_0xb342('0x2'));var rs=require(_0xb342('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb342('0x4'));var config=require(_0xb342('0x5'));var jayson=require(_0xb342('0x6'));var client=jayson[_0xb342('0x7')][_0xb342('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f6281,_0x30106f,_0x3c7ac7){return new BPromise(function(_0x54175e,_0x54c788){return client[_0xb342('0x9')](_0x2f6281,_0x3c7ac7)[_0xb342('0xa')](function(_0x4e8f65){logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,_0xb342('0xd'));logger[_0xb342('0xe')](_0xb342('0xf'),_0x30106f,_0xb342('0xd'),JSON[_0xb342('0x10')](_0x4e8f65));if(_0x4e8f65[_0xb342('0x11')]){if(_0x4e8f65[_0xb342('0x11')][_0xb342('0x12')]===0x1f4){logger[_0xb342('0x11')]('Campaign,\x20%s,\x20%s',_0x30106f,_0x4e8f65[_0xb342('0x11')]['message']);return _0x54c788(_0x4e8f65['error']['message']);}logger[_0xb342('0x11')](_0xb342('0xc'),_0x30106f,_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);return _0x54175e(_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);}else{logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,'request\x20sent');_0x54175e(_0x4e8f65[_0xb342('0x14')][_0xb342('0x13')]);}})['catch'](function(_0x5ee646){logger['error'](_0xb342('0xc'),_0x30106f,_0x5ee646);_0x54c788(_0x5ee646);});});}exports[_0xb342('0x15')]=function(_0x52b3b6){var _0x26583c=this;return new Promise(function(_0x2fa7cd,_0x1694c7){return db[_0xb342('0x16')][_0xb342('0x17')]({'raw':_0x52b3b6['options']?_0x52b3b6['options'][_0xb342('0x18')]===undefined?!![]:![]:!![],'where':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1a')]||null:null,'attributes':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1b')]||null:null,'limit':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')]['limit']||null:null,'include':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6['options'][_0xb342('0x1c')]?_[_0xb342('0x1d')](_0x52b3b6[_0xb342('0x19')][_0xb342('0x1c')],function(_0x4eda3a){return{'model':db[_0x4eda3a[_0xb342('0x1e')]],'as':_0x4eda3a['as'],'attributes':_0x4eda3a['attributes'],'include':_0x4eda3a['include']?_[_0xb342('0x1d')](_0x4eda3a['include'],function(_0x31aa2b){return{'model':db[_0x31aa2b[_0xb342('0x1e')]],'as':_0x31aa2b['as'],'attributes':_0x31aa2b[_0xb342('0x1b')],'include':_0x31aa2b[_0xb342('0x1c')]?_['map'](_0x31aa2b[_0xb342('0x1c')],function(_0x31469f){return{'model':db[_0x31469f[_0xb342('0x1e')]],'as':_0x31469f['as'],'attributes':_0x31469f[_0xb342('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb342('0xa')](function(_0x27005b){logger[_0xb342('0xb')]('GetCampaign',_0x52b3b6);logger[_0xb342('0xe')](_0xb342('0x15'),_0x52b3b6,JSON[_0xb342('0x10')](_0x27005b));_0x2fa7cd(_0x27005b);})['catch'](function(_0x54cc70){logger['error'](_0xb342('0x15'),_0x54cc70['message'],_0x52b3b6);_0x1694c7(_0x26583c[_0xb342('0x11')](0x1f4,_0x54cc70['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ae18000..af41200 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 _0x2666=['get','isAuthenticated','index','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','/:id','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller'];(function(_0x55a4d9,_0x5467e2){var _0x325ef7=function(_0x2c1343){while(--_0x2c1343){_0x55a4d9['push'](_0x55a4d9['shift']());}};_0x325ef7(++_0x5467e2);}(_0x2666,0xe3));var _0x6266=function(_0x32e54a,_0x59fc0d){_0x32e54a=_0x32e54a-0x0;var _0x109af4=_0x2666[_0x32e54a];return _0x109af4;};'use strict';var multer=require(_0x6266('0x0'));var util=require(_0x6266('0x1'));var path=require(_0x6266('0x2'));var timeout=require(_0x6266('0x3'));var express=require(_0x6266('0x4'));var router=express[_0x6266('0x5')]();var fs_extra=require(_0x6266('0x6'));var auth=require(_0x6266('0x7'));var interaction=require(_0x6266('0x8'));var config=require(_0x6266('0x9'));var controller=require(_0x6266('0xa'));router[_0x6266('0xb')]('/',auth[_0x6266('0xc')](),controller[_0x6266('0xd')]);router['get']('/:id',auth[_0x6266('0xc')](),controller['show']);router[_0x6266('0xb')](_0x6266('0xe'),auth[_0x6266('0xc')](),controller[_0x6266('0xf')]);router[_0x6266('0xb')](_0x6266('0x10'),auth[_0x6266('0xc')](),controller[_0x6266('0x11')]);router[_0x6266('0xb')](_0x6266('0x12'),auth[_0x6266('0xc')](),controller['getHopperFinals']);router['get'](_0x6266('0x13'),auth[_0x6266('0xc')](),controller['getHopperBlacks']);router[_0x6266('0xb')]('/:id/lists',auth[_0x6266('0xc')](),controller['getLists']);router[_0x6266('0xb')](_0x6266('0x14'),auth[_0x6266('0xc')](),controller[_0x6266('0x15')]);router[_0x6266('0x16')]('/',auth[_0x6266('0xc')](),controller['create']);router[_0x6266('0x16')](_0x6266('0x17'),auth[_0x6266('0xc')](),controller[_0x6266('0x18')]);router['post'](_0x6266('0x19'),auth[_0x6266('0xc')](),controller[_0x6266('0x1a')]);router[_0x6266('0x16')]('/:id/blacklists',auth[_0x6266('0xc')](),controller['addBlackLists']);router['put'](_0x6266('0x1b'),auth['isAuthenticated'](),controller[_0x6266('0x1c')]);router['delete'](_0x6266('0x1b'),auth[_0x6266('0xc')](),controller[_0x6266('0x1d')]);router[_0x6266('0x1e')](_0x6266('0x19'),auth[_0x6266('0xc')](),controller[_0x6266('0x1f')]);router[_0x6266('0x1e')](_0x6266('0x14'),auth[_0x6266('0xc')](),controller[_0x6266('0x20')]);module[_0x6266('0x21')]=router; \ No newline at end of file +var _0xb701=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','put','update','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x4d0ebd,_0x17ab0b){var _0x594e9c=function(_0x4d22ab){while(--_0x4d22ab){_0x4d0ebd['push'](_0x4d0ebd['shift']());}};_0x594e9c(++_0x17ab0b);}(_0xb701,0x144));var _0x1b70=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb701[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x1b70('0x0'));var path=require('path');var timeout=require(_0x1b70('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b70('0x2'));var auth=require(_0x1b70('0x3'));var interaction=require(_0x1b70('0x4'));var config=require(_0x1b70('0x5'));var controller=require(_0x1b70('0x6'));router[_0x1b70('0x7')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x9')]);router[_0x1b70('0x7')](_0x1b70('0xa'),auth['isAuthenticated'](),controller[_0x1b70('0xb')]);router[_0x1b70('0x7')](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0xd')]);router[_0x1b70('0x7')](_0x1b70('0xe'),auth['isAuthenticated'](),controller[_0x1b70('0xf')]);router[_0x1b70('0x7')](_0x1b70('0x10'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x11')]);router[_0x1b70('0x7')](_0x1b70('0x12'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x13')]);router[_0x1b70('0x7')](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x15')]);router['get'](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x17')]);router[_0x1b70('0x18')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1b70('0x19'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1a')]);router[_0x1b70('0x18')](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller['addLists']);router[_0x1b70('0x18')](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller['addBlackLists']);router[_0x1b70('0x1b')](_0x1b70('0xa'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1c')]);router[_0x1b70('0x1d')](_0x1b70('0xa'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1e')]);router['delete'](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1f')]);router['delete'](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x20')]);module[_0x1b70('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c65c6d2..78ae88a 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 _0x0599=['exports','STRING','TEXT','getDataValue','key','sequelize'];(function(_0x14d160,_0x55c327){var _0x2a324b=function(_0xb68946){while(--_0xb68946){_0x14d160['push'](_0x14d160['shift']());}};_0x2a324b(++_0x55c327);}(_0x0599,0x155));var _0x9059=function(_0x4d81e3,_0x27f1c5){_0x4d81e3=_0x4d81e3-0x0;var _0x194d3b=_0x0599[_0x4d81e3];return _0x194d3b;};'use strict';var Sequelize=require(_0x9059('0x0'));module[_0x9059('0x1')]={'key':{'type':Sequelize[_0x9059('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9059('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9059('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9059('0x4')](_0x9059('0x5'));}}}; \ No newline at end of file +var _0x244b=['key','sequelize','exports','STRING','getDataValue'];(function(_0x5a15ac,_0x2b2595){var _0x5d0c48=function(_0x575d14){while(--_0x575d14){_0x5a15ac['push'](_0x5a15ac['shift']());}};_0x5d0c48(++_0x2b2595);}(_0x244b,0x1eb));var _0xb244=function(_0x2a59e0,_0xc12ff){_0x2a59e0=_0x2a59e0-0x0;var _0x48813a=_0x244b[_0x2a59e0];return _0x48813a;};'use strict';var Sequelize=require(_0xb244('0x0'));module[_0xb244('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xb244('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb244('0x3')](_0xb244('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 80ce137..d35e05c 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 _0x8a4a=['intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','options','CannedAnswer','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x8a4a,0x131));var _0xa8a4=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x8a4a[_0x104e21];return _0x605b37;};'use strict';var emlformat=require(_0xa8a4('0x0'));var rimraf=require(_0xa8a4('0x1'));var zipdir=require(_0xa8a4('0x2'));var jsonpatch=require(_0xa8a4('0x3'));var rp=require(_0xa8a4('0x4'));var moment=require(_0xa8a4('0x5'));var BPromise=require(_0xa8a4('0x6'));var Mustache=require(_0xa8a4('0x7'));var util=require(_0xa8a4('0x8'));var path=require(_0xa8a4('0x9'));var sox=require(_0xa8a4('0xa'));var csv=require(_0xa8a4('0xb'));var ejs=require(_0xa8a4('0xc'));var fs=require('fs');var fs_extra=require(_0xa8a4('0xd'));var _=require(_0xa8a4('0xe'));var squel=require('squel');var crypto=require(_0xa8a4('0xf'));var jsforce=require(_0xa8a4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa8a4('0xb'));var querystring=require(_0xa8a4('0x11'));var Papa=require(_0xa8a4('0x12'));var Redis=require(_0xa8a4('0x13'));var authService=require(_0xa8a4('0x14'));var qs=require(_0xa8a4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8a4('0x16'));var logger=require(_0xa8a4('0x17'))('api');var utils=require(_0xa8a4('0x18'));var config=require(_0xa8a4('0x19'));var licenseUtil=require(_0xa8a4('0x1a'));var db=require(_0xa8a4('0x1b'))['db'];function respondWithStatusCode(_0x49def7,_0x187edc){_0x187edc=_0x187edc||0xcc;return function(_0x13a4e0){if(_0x13a4e0){return _0x49def7['sendStatus'](_0x187edc);}return _0x49def7[_0xa8a4('0x1c')](_0x187edc)[_0xa8a4('0x1d')]();};}function respondWithResult(_0x275347,_0x1a87c8){_0x1a87c8=_0x1a87c8||0xc8;return function(_0x186b14){if(_0x186b14){return _0x275347[_0xa8a4('0x1c')](_0x1a87c8)[_0xa8a4('0x1e')](_0x186b14);}};}function respondWithFilteredResult(_0x5aa5a6,_0x3a6e77){return function(_0x1c4c13){if(_0x1c4c13){var _0xf0de33=typeof _0x3a6e77[_0xa8a4('0x1f')]===_0xa8a4('0x20')&&typeof _0x3a6e77[_0xa8a4('0x21')]==='undefined';var _0x2b34c0=_0x1c4c13[_0xa8a4('0x22')];var _0x39ce07=_0xf0de33?0x0:_0x3a6e77[_0xa8a4('0x1f')];var _0x55ab12=_0xf0de33?_0x1c4c13[_0xa8a4('0x22')]:_0x3a6e77[_0xa8a4('0x1f')]+_0x3a6e77[_0xa8a4('0x21')];var _0x535934;if(_0x55ab12>=_0x2b34c0){_0x55ab12=_0x2b34c0;_0x535934=0xc8;}else{_0x535934=0xce;}_0x5aa5a6[_0xa8a4('0x1c')](_0x535934);return _0x5aa5a6[_0xa8a4('0x23')](_0xa8a4('0x24'),_0x39ce07+'-'+_0x55ab12+'/'+_0x2b34c0)[_0xa8a4('0x1e')](_0x1c4c13);}return null;};}function patchUpdates(_0x4d7362){return function(_0x2aa71a){try{jsonpatch['apply'](_0x2aa71a,_0x4d7362,!![]);}catch(_0x2945bc){return BPromise[_0xa8a4('0x25')](_0x2945bc);}return _0x2aa71a['save']();};}function saveUpdates(_0x57b27b,_0x2c5965){return function(_0x315216){if(_0x315216){return _0x315216['update'](_0x57b27b)['then'](function(_0xfec716){return _0xfec716;});}return null;};}function removeEntity(_0x5d8413,_0x1c0402){return function(_0x487216){if(_0x487216){return _0x487216[_0xa8a4('0x26')]()[_0xa8a4('0x27')](function(){var _0x3af292=_0x487216['get']({'plain':!![]});var _0xc5e21=_0xa8a4('0x28');return db[_0xa8a4('0x29')][_0xa8a4('0x26')]({'where':{'type':_0xc5e21,'resourceId':_0x3af292['id']}})['then'](function(){return _0x487216;});})[_0xa8a4('0x27')](function(){_0x5d8413[_0xa8a4('0x1c')](0xcc)[_0xa8a4('0x1d')]();});}};}function handleEntityNotFound(_0x2de9c3,_0x125537){return function(_0x1324a3){if(!_0x1324a3){_0x2de9c3[_0xa8a4('0x2a')](0x194);}return _0x1324a3;};}function handleError(_0x233285,_0x197b12){_0x197b12=_0x197b12||0x1f4;return function(_0x569ccd){logger[_0xa8a4('0x2b')](_0x569ccd[_0xa8a4('0x2c')]);if(_0x569ccd[_0xa8a4('0x2d')]){delete _0x569ccd['name'];}_0x233285[_0xa8a4('0x1c')](_0x197b12)['send'](_0x569ccd);};}exports[_0xa8a4('0x2e')]=function(_0x3b5929,_0x278e5e){var _0x46d4bc={},_0x34c748={},_0x4397dc={'count':0x0,'rows':[]};var _0x59e62e=_[_0xa8a4('0x2f')](db['CannedAnswer'][_0xa8a4('0x30')],function(_0x57e330){return{'name':_0x57e330[_0xa8a4('0x31')],'type':_0x57e330[_0xa8a4('0x32')][_0xa8a4('0x33')]};});_0x34c748[_0xa8a4('0x34')]=_['map'](_0x59e62e,_0xa8a4('0x2d'));_0x34c748[_0xa8a4('0x35')]=_[_0xa8a4('0x36')](_0x3b5929['query']);_0x34c748['filters']=_[_0xa8a4('0x37')](_0x34c748[_0xa8a4('0x34')],_0x34c748[_0xa8a4('0x35')]);_0x46d4bc['attributes']=_['intersection'](_0x34c748[_0xa8a4('0x34')],qs[_0xa8a4('0x38')](_0x3b5929['query'][_0xa8a4('0x38')]));_0x46d4bc[_0xa8a4('0x39')]=_0x46d4bc[_0xa8a4('0x39')][_0xa8a4('0x3a')]?_0x46d4bc[_0xa8a4('0x39')]:_0x34c748[_0xa8a4('0x34')];if(!_0x3b5929['query']['hasOwnProperty'](_0xa8a4('0x3b'))){_0x46d4bc[_0xa8a4('0x21')]=qs['limit'](_0x3b5929['query'][_0xa8a4('0x21')]);_0x46d4bc['offset']=qs[_0xa8a4('0x1f')](_0x3b5929['query'][_0xa8a4('0x1f')]);}_0x46d4bc[_0xa8a4('0x3c')]=qs[_0xa8a4('0x3d')](_0x3b5929['query'][_0xa8a4('0x3d')]);_0x46d4bc[_0xa8a4('0x3e')]=qs[_0xa8a4('0x3f')](_['pick'](_0x3b5929[_0xa8a4('0x35')],_0x34c748[_0xa8a4('0x3f')]),_0x59e62e);if(_0x3b5929['query'][_0xa8a4('0x40')]){_0x46d4bc[_0xa8a4('0x3e')]=_[_0xa8a4('0x41')](_0x46d4bc['where'],{'$or':[{'key':{'$like':'%'+_0x3b5929[_0xa8a4('0x35')][_0xa8a4('0x40')]+'%'}},{'value':{'$like':'%'+_0x3b5929[_0xa8a4('0x35')]['filter']+'%'}}]});}_0x46d4bc=_[_0xa8a4('0x41')]({},_0x46d4bc,_0x3b5929[_0xa8a4('0x42')]);var _0x89a152={'where':_0x46d4bc[_0xa8a4('0x3e')]};return db[_0xa8a4('0x43')][_0xa8a4('0x22')](_0x89a152)[_0xa8a4('0x27')](function(_0x3fc6c2){_0x4397dc['count']=_0x3fc6c2;if(_0x3b5929[_0xa8a4('0x35')]['includeAll']){_0x46d4bc[_0xa8a4('0x44')]=[{'all':!![]}];}return db[_0xa8a4('0x43')][_0xa8a4('0x45')](_0x46d4bc);})[_0xa8a4('0x27')](function(_0x45dd6c){_0x4397dc[_0xa8a4('0x46')]=_0x45dd6c;return _0x4397dc;})[_0xa8a4('0x27')](respondWithFilteredResult(_0x278e5e,_0x46d4bc))[_0xa8a4('0x47')](handleError(_0x278e5e,null));};exports[_0xa8a4('0x48')]=function(_0x105503,_0x47adb4){var _0x54fcf3={'raw':!![],'where':{'id':_0x105503[_0xa8a4('0x49')]['id']}},_0xe6d48d={};_0xe6d48d[_0xa8a4('0x34')]=_['keys'](db[_0xa8a4('0x43')][_0xa8a4('0x30')]);_0xe6d48d['query']=_[_0xa8a4('0x36')](_0x105503[_0xa8a4('0x35')]);_0xe6d48d[_0xa8a4('0x3f')]=_[_0xa8a4('0x37')](_0xe6d48d[_0xa8a4('0x34')],_0xe6d48d['query']);_0x54fcf3[_0xa8a4('0x39')]=_[_0xa8a4('0x37')](_0xe6d48d[_0xa8a4('0x34')],qs[_0xa8a4('0x38')](_0x105503['query'][_0xa8a4('0x38')]));_0x54fcf3[_0xa8a4('0x39')]=_0x54fcf3[_0xa8a4('0x39')][_0xa8a4('0x3a')]?_0x54fcf3[_0xa8a4('0x39')]:_0xe6d48d[_0xa8a4('0x34')];if(_0x105503['query']['includeAll']){_0x54fcf3[_0xa8a4('0x44')]=[{'all':!![]}];}_0x54fcf3=_[_0xa8a4('0x41')]({},_0x54fcf3,_0x105503[_0xa8a4('0x42')]);return db[_0xa8a4('0x43')][_0xa8a4('0x4a')](_0x54fcf3)['then'](handleEntityNotFound(_0x47adb4,null))[_0xa8a4('0x27')](respondWithResult(_0x47adb4,null))[_0xa8a4('0x47')](handleError(_0x47adb4,null));};exports['update']=function(_0x278623,_0x26a72a){if(_0x278623[_0xa8a4('0x4b')]['id']){delete _0x278623[_0xa8a4('0x4b')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x278623[_0xa8a4('0x49')]['id']}})[_0xa8a4('0x27')](handleEntityNotFound(_0x26a72a,null))['then'](saveUpdates(_0x278623[_0xa8a4('0x4b')],null))[_0xa8a4('0x27')](respondWithResult(_0x26a72a,null))['catch'](handleError(_0x26a72a,null));};exports['destroy']=function(_0x5bfe45,_0x38eafc){return db[_0xa8a4('0x43')][_0xa8a4('0x4a')]({'where':{'id':_0x5bfe45[_0xa8a4('0x49')]['id']}})[_0xa8a4('0x27')](handleEntityNotFound(_0x38eafc,null))[_0xa8a4('0x27')](removeEntity(_0x38eafc,null))[_0xa8a4('0x47')](handleError(_0x38eafc,null));};exports[_0xa8a4('0x4c')]=function(_0x575c1c,_0x48f19b){var _0x2bc09c={'key':_0x575c1c['body'][_0xa8a4('0x33')]};if(_0x575c1c[_0xa8a4('0x4b')]['MailAccountId']){_0x2bc09c[_0xa8a4('0x4d')]=_0x575c1c[_0xa8a4('0x4b')][_0xa8a4('0x4d')];}else if(_0x575c1c[_0xa8a4('0x4b')][_0xa8a4('0x4e')]){_0x2bc09c[_0xa8a4('0x4e')]=_0x575c1c[_0xa8a4('0x4b')]['SmsAccountId'];}else if(_0x575c1c['body'][_0xa8a4('0x4f')]){_0x2bc09c[_0xa8a4('0x4f')]=_0x575c1c[_0xa8a4('0x4b')][_0xa8a4('0x4f')];}else if(_0x575c1c[_0xa8a4('0x4b')]['ChatWebsiteId']){_0x2bc09c[_0xa8a4('0x50')]=_0x575c1c[_0xa8a4('0x4b')][_0xa8a4('0x50')];}return db[_0xa8a4('0x43')][_0xa8a4('0x4a')]({'where':_0x2bc09c})[_0xa8a4('0x27')](function(_0x2079bf){if(_0x2079bf){throw new db['Sequelize'][(_0xa8a4('0x51'))](_0xa8a4('0x52'));}return db[_0xa8a4('0x43')]['create'](_0x575c1c[_0xa8a4('0x4b')]);})['then'](function(_0x260adc){var _0x2f2449=_0x575c1c[_0xa8a4('0x53')][_0xa8a4('0x54')]({'plain':!![]});if(!_0x2f2449)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f2449[_0xa8a4('0x55')]===_0xa8a4('0x53')){var _0x577beb=_0x260adc[_0xa8a4('0x54')]({'plain':!![]});return db[_0xa8a4('0x56')][_0xa8a4('0x4a')]({'where':{'name':_0xa8a4('0x28'),'userProfileId':_0x2f2449[_0xa8a4('0x57')]},'raw':!![]})[_0xa8a4('0x27')](function(_0x1c1aca){if(_0x1c1aca&&_0x1c1aca[_0xa8a4('0x58')]===0x0){return db[_0xa8a4('0x29')][_0xa8a4('0x4c')]({'name':_0x577beb['name'],'resourceId':_0x577beb['id'],'type':_0x1c1aca[_0xa8a4('0x2d')],'sectionId':_0x1c1aca['id']},{})[_0xa8a4('0x27')](function(){return _0x260adc;});}else{return _0x260adc;}})[_0xa8a4('0x47')](function(_0x5f20f7){logger[_0xa8a4('0x2b')](_0xa8a4('0x59'),_0x5f20f7);throw _0x5f20f7;});}return _0x260adc;})[_0xa8a4('0x27')](respondWithResult(_0x48f19b,0xc9))['catch'](handleError(_0x48f19b,null));}; \ No newline at end of file +var _0xe39f=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','CannedAnswers','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','get','UserProfileSection','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch'];(function(_0x7ed412,_0x223b70){var _0x1ed154=function(_0x3d5315){while(--_0x3d5315){_0x7ed412['push'](_0x7ed412['shift']());}};_0x1ed154(++_0x223b70);}(_0xe39f,0x16d));var _0xfe39=function(_0x5e8912,_0x5b6370){_0x5e8912=_0x5e8912-0x0;var _0xb5060b=_0xe39f[_0x5e8912];return _0xb5060b;};'use strict';var emlformat=require(_0xfe39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe39('0x1'));var jsonpatch=require(_0xfe39('0x2'));var rp=require(_0xfe39('0x3'));var moment=require(_0xfe39('0x4'));var BPromise=require(_0xfe39('0x5'));var Mustache=require(_0xfe39('0x6'));var util=require(_0xfe39('0x7'));var path=require(_0xfe39('0x8'));var sox=require(_0xfe39('0x9'));var csv=require(_0xfe39('0xa'));var ejs=require(_0xfe39('0xb'));var fs=require('fs');var fs_extra=require(_0xfe39('0xc'));var _=require(_0xfe39('0xd'));var squel=require(_0xfe39('0xe'));var crypto=require(_0xfe39('0xf'));var jsforce=require(_0xfe39('0x10'));var deskjs=require(_0xfe39('0x11'));var toCsv=require(_0xfe39('0xa'));var querystring=require(_0xfe39('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe39('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe39('0x14'));var logger=require(_0xfe39('0x15'))(_0xfe39('0x16'));var utils=require(_0xfe39('0x17'));var config=require(_0xfe39('0x18'));var licenseUtil=require(_0xfe39('0x19'));var db=require(_0xfe39('0x1a'))['db'];function respondWithStatusCode(_0x33067d,_0x68006f){_0x68006f=_0x68006f||0xcc;return function(_0x4399fe){if(_0x4399fe){return _0x33067d[_0xfe39('0x1b')](_0x68006f);}return _0x33067d[_0xfe39('0x1c')](_0x68006f)[_0xfe39('0x1d')]();};}function respondWithResult(_0x48d5d2,_0x4a810a){_0x4a810a=_0x4a810a||0xc8;return function(_0x3c86ef){if(_0x3c86ef){return _0x48d5d2['status'](_0x4a810a)[_0xfe39('0x1e')](_0x3c86ef);}};}function respondWithFilteredResult(_0xacfab6,_0x8918b1){return function(_0x4d457a){if(_0x4d457a){var _0x573ff6=typeof _0x8918b1[_0xfe39('0x1f')]===_0xfe39('0x20')&&typeof _0x8918b1[_0xfe39('0x21')]===_0xfe39('0x20');var _0x43660b=_0x4d457a[_0xfe39('0x22')];var _0x5618cd=_0x573ff6?0x0:_0x8918b1[_0xfe39('0x1f')];var _0x159ce9=_0x573ff6?_0x4d457a[_0xfe39('0x22')]:_0x8918b1['offset']+_0x8918b1[_0xfe39('0x21')];var _0x331753;if(_0x159ce9>=_0x43660b){_0x159ce9=_0x43660b;_0x331753=0xc8;}else{_0x331753=0xce;}_0xacfab6[_0xfe39('0x1c')](_0x331753);return _0xacfab6[_0xfe39('0x23')]('Content-Range',_0x5618cd+'-'+_0x159ce9+'/'+_0x43660b)[_0xfe39('0x1e')](_0x4d457a);}return null;};}function patchUpdates(_0x335adb){return function(_0x3aa3a1){try{jsonpatch[_0xfe39('0x24')](_0x3aa3a1,_0x335adb,!![]);}catch(_0x1e0286){return BPromise[_0xfe39('0x25')](_0x1e0286);}return _0x3aa3a1[_0xfe39('0x26')]();};}function saveUpdates(_0x1c3d71,_0x556a29){return function(_0x3032e){if(_0x3032e){return _0x3032e[_0xfe39('0x27')](_0x1c3d71)[_0xfe39('0x28')](function(_0x315816){return _0x315816;});}return null;};}function removeEntity(_0x29aa95,_0x479fa3){return function(_0x1adeee){if(_0x1adeee){return _0x1adeee[_0xfe39('0x29')]()[_0xfe39('0x28')](function(){var _0x2cc152=_0x1adeee['get']({'plain':!![]});var _0x2d35e1=_0xfe39('0x2a');return db['UserProfileResource'][_0xfe39('0x29')]({'where':{'type':_0x2d35e1,'resourceId':_0x2cc152['id']}})[_0xfe39('0x28')](function(){return _0x1adeee;});})[_0xfe39('0x28')](function(){_0x29aa95[_0xfe39('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x205ab2,_0x1ee8ec){return function(_0x4cd4be){if(!_0x4cd4be){_0x205ab2['sendStatus'](0x194);}return _0x4cd4be;};}function handleError(_0x108125,_0x17ea7a){_0x17ea7a=_0x17ea7a||0x1f4;return function(_0x3d142b){logger[_0xfe39('0x2b')](_0x3d142b[_0xfe39('0x2c')]);if(_0x3d142b['name']){delete _0x3d142b[_0xfe39('0x2d')];}_0x108125[_0xfe39('0x1c')](_0x17ea7a)[_0xfe39('0x2e')](_0x3d142b);};}exports['index']=function(_0x305c22,_0x477219){var _0x502e43={},_0x161d91={},_0x1be3bd={'count':0x0,'rows':[]};var _0x24c58c=_[_0xfe39('0x2f')](db[_0xfe39('0x30')][_0xfe39('0x31')],function(_0x5cb2e8){return{'name':_0x5cb2e8[_0xfe39('0x32')],'type':_0x5cb2e8[_0xfe39('0x33')][_0xfe39('0x34')]};});_0x161d91['model']=_[_0xfe39('0x2f')](_0x24c58c,_0xfe39('0x2d'));_0x161d91['query']=_[_0xfe39('0x35')](_0x305c22[_0xfe39('0x36')]);_0x161d91[_0xfe39('0x37')]=_[_0xfe39('0x38')](_0x161d91[_0xfe39('0x39')],_0x161d91[_0xfe39('0x36')]);_0x502e43[_0xfe39('0x3a')]=_['intersection'](_0x161d91[_0xfe39('0x39')],qs['fields'](_0x305c22[_0xfe39('0x36')][_0xfe39('0x3b')]));_0x502e43['attributes']=_0x502e43[_0xfe39('0x3a')]['length']?_0x502e43[_0xfe39('0x3a')]:_0x161d91[_0xfe39('0x39')];if(!_0x305c22[_0xfe39('0x36')][_0xfe39('0x3c')](_0xfe39('0x3d'))){_0x502e43[_0xfe39('0x21')]=qs['limit'](_0x305c22['query'][_0xfe39('0x21')]);_0x502e43[_0xfe39('0x1f')]=qs[_0xfe39('0x1f')](_0x305c22['query'][_0xfe39('0x1f')]);}_0x502e43[_0xfe39('0x3e')]=qs[_0xfe39('0x3f')](_0x305c22['query']['sort']);_0x502e43[_0xfe39('0x40')]=qs[_0xfe39('0x37')](_[_0xfe39('0x41')](_0x305c22[_0xfe39('0x36')],_0x161d91['filters']),_0x24c58c);if(_0x305c22['query'][_0xfe39('0x42')]){_0x502e43[_0xfe39('0x40')]=_['merge'](_0x502e43['where'],{'$or':[{'key':{'$like':'%'+_0x305c22['query']['filter']+'%'}},{'value':{'$like':'%'+_0x305c22[_0xfe39('0x36')][_0xfe39('0x42')]+'%'}}]});}_0x502e43=_[_0xfe39('0x43')]({},_0x502e43,_0x305c22[_0xfe39('0x44')]);var _0x44f763={'where':_0x502e43[_0xfe39('0x40')]};return db[_0xfe39('0x30')][_0xfe39('0x22')](_0x44f763)[_0xfe39('0x28')](function(_0x3b2ad6){_0x1be3bd['count']=_0x3b2ad6;if(_0x305c22[_0xfe39('0x36')][_0xfe39('0x45')]){_0x502e43[_0xfe39('0x46')]=[{'all':!![]}];}return db[_0xfe39('0x30')][_0xfe39('0x47')](_0x502e43);})[_0xfe39('0x28')](function(_0x1b8383){_0x1be3bd['rows']=_0x1b8383;return _0x1be3bd;})[_0xfe39('0x28')](respondWithFilteredResult(_0x477219,_0x502e43))[_0xfe39('0x48')](handleError(_0x477219,null));};exports[_0xfe39('0x49')]=function(_0x535f34,_0x2b9589){var _0x17c11f={'raw':!![],'where':{'id':_0x535f34[_0xfe39('0x4a')]['id']}},_0x1d3e73={};_0x1d3e73[_0xfe39('0x39')]=_['keys'](db[_0xfe39('0x30')][_0xfe39('0x31')]);_0x1d3e73[_0xfe39('0x36')]=_[_0xfe39('0x35')](_0x535f34['query']);_0x1d3e73[_0xfe39('0x37')]=_[_0xfe39('0x38')](_0x1d3e73['model'],_0x1d3e73[_0xfe39('0x36')]);_0x17c11f['attributes']=_[_0xfe39('0x38')](_0x1d3e73[_0xfe39('0x39')],qs['fields'](_0x535f34[_0xfe39('0x36')][_0xfe39('0x3b')]));_0x17c11f['attributes']=_0x17c11f[_0xfe39('0x3a')][_0xfe39('0x4b')]?_0x17c11f[_0xfe39('0x3a')]:_0x1d3e73[_0xfe39('0x39')];if(_0x535f34['query'][_0xfe39('0x45')]){_0x17c11f['include']=[{'all':!![]}];}_0x17c11f=_[_0xfe39('0x43')]({},_0x17c11f,_0x535f34[_0xfe39('0x44')]);return db[_0xfe39('0x30')]['find'](_0x17c11f)['then'](handleEntityNotFound(_0x2b9589,null))['then'](respondWithResult(_0x2b9589,null))[_0xfe39('0x48')](handleError(_0x2b9589,null));};exports[_0xfe39('0x27')]=function(_0x3cab26,_0x43ba4e){if(_0x3cab26[_0xfe39('0x4c')]['id']){delete _0x3cab26[_0xfe39('0x4c')]['id'];}return db[_0xfe39('0x30')][_0xfe39('0x4d')]({'where':{'id':_0x3cab26[_0xfe39('0x4a')]['id']}})[_0xfe39('0x28')](handleEntityNotFound(_0x43ba4e,null))[_0xfe39('0x28')](saveUpdates(_0x3cab26[_0xfe39('0x4c')],null))[_0xfe39('0x28')](respondWithResult(_0x43ba4e,null))[_0xfe39('0x48')](handleError(_0x43ba4e,null));};exports[_0xfe39('0x29')]=function(_0xfe7e2f,_0x5596fa){return db['CannedAnswer'][_0xfe39('0x4d')]({'where':{'id':_0xfe7e2f[_0xfe39('0x4a')]['id']}})[_0xfe39('0x28')](handleEntityNotFound(_0x5596fa,null))[_0xfe39('0x28')](removeEntity(_0x5596fa,null))[_0xfe39('0x48')](handleError(_0x5596fa,null));};exports[_0xfe39('0x4e')]=function(_0xe8455c,_0xb3b8a4){var _0x3bf491={'key':_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x34')]};if(_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x4f')]){_0x3bf491['MailAccountId']=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x4f')];}else if(_0xe8455c['body'][_0xfe39('0x50')]){_0x3bf491[_0xfe39('0x50')]=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x50')];}else if(_0xe8455c[_0xfe39('0x4c')]['OpenchannelAccountId']){_0x3bf491[_0xfe39('0x51')]=_0xe8455c[_0xfe39('0x4c')]['OpenchannelAccountId'];}else if(_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x52')]){_0x3bf491[_0xfe39('0x52')]=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x52')];}return db[_0xfe39('0x30')][_0xfe39('0x4d')]({'where':_0x3bf491})[_0xfe39('0x28')](function(_0x1e6992){if(_0x1e6992){throw new db[(_0xfe39('0x53'))][(_0xfe39('0x54'))](_0xfe39('0x55'));}return db[_0xfe39('0x30')][_0xfe39('0x4e')](_0xe8455c['body']);})[_0xfe39('0x28')](function(_0x1cef76){var _0x1dbd3f=_0xe8455c[_0xfe39('0x56')]['get']({'plain':!![]});if(!_0x1dbd3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dbd3f[_0xfe39('0x57')]==='user'){var _0x54a394=_0x1cef76[_0xfe39('0x58')]({'plain':!![]});return db[_0xfe39('0x59')][_0xfe39('0x4d')]({'where':{'name':_0xfe39('0x2a'),'userProfileId':_0x1dbd3f['userProfileId']},'raw':!![]})['then'](function(_0x59ef55){if(_0x59ef55&&_0x59ef55[_0xfe39('0x5a')]===0x0){return db[_0xfe39('0x5b')][_0xfe39('0x4e')]({'name':_0x54a394[_0xfe39('0x2d')],'resourceId':_0x54a394['id'],'type':_0x59ef55[_0xfe39('0x2d')],'sectionId':_0x59ef55['id']},{})['then'](function(){return _0x1cef76;});}else{return _0x1cef76;}})[_0xfe39('0x48')](function(_0x16a4de){logger[_0xfe39('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16a4de);throw _0x16a4de;});}return _0x1cef76;})['then'](respondWithResult(_0xb3b8a4,0xc9))['catch'](handleError(_0xb3b8a4,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d4b725b..495c00b 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 _0x71c3=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer'];(function(_0x2f89c0,_0x455702){var _0x164223=function(_0x11a234){while(--_0x11a234){_0x2f89c0['push'](_0x2f89c0['shift']());}};_0x164223(++_0x455702);}(_0x71c3,0x1ed));var _0x371c=function(_0x54319c,_0x565322){_0x54319c=_0x54319c-0x0;var _0x51fc44=_0x71c3[_0x54319c];return _0x51fc44;};'use strict';var _=require(_0x371c('0x0'));var util=require('util');var logger=require(_0x371c('0x1'))(_0x371c('0x2'));var moment=require(_0x371c('0x3'));var BPromise=require(_0x371c('0x4'));var rp=require(_0x371c('0x5'));var fs=require('fs');var path=require(_0x371c('0x6'));var rimraf=require(_0x371c('0x7'));var config=require(_0x371c('0x8'));var attributes=require(_0x371c('0x9'));module['exports']=function(_0x4a7e54,_0x1fb741){return _0x4a7e54['define'](_0x371c('0xa'),attributes,{'tableName':_0x371c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x371c('0xc'),'collate':_0x371c('0xd')});}; \ No newline at end of file +var _0xed0c=['CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xed0c,0x1d7));var _0xced0=function(_0x154f3d,_0x28e8fe){_0x154f3d=_0x154f3d-0x0;var _0xe6f1c2=_0xed0c[_0x154f3d];return _0xe6f1c2;};'use strict';var _=require(_0xced0('0x0'));var util=require(_0xced0('0x1'));var logger=require('../../config/logger')(_0xced0('0x2'));var moment=require('moment');var BPromise=require(_0xced0('0x3'));var rp=require(_0xced0('0x4'));var fs=require('fs');var path=require(_0xced0('0x5'));var rimraf=require(_0xced0('0x6'));var config=require(_0xced0('0x7'));var attributes=require(_0xced0('0x8'));module['exports']=function(_0x1bc3ce,_0x48ca15){return _0x1bc3ce[_0xced0('0x9')](_0xced0('0xa'),attributes,{'tableName':_0xced0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xced0('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 72c9ad2..866cddb 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 _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0xfb8093,_0x86e1bd){var _0x397525=function(_0x2e0f21){while(--_0x2e0f21){_0xfb8093['push'](_0xfb8093['shift']());}};_0x397525(++_0x86e1bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x40f3e5,_0x1620e9){var _0x4db38a=function(_0x3321cd){while(--_0x3321cd){_0x40f3e5['push'](_0x40f3e5['shift']());}};_0x4db38a(++_0x1620e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index c2460c3..fc89585 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 _0xd0c0=['post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xd0c0,0x7a));var _0x0d0c=function(_0x180b88,_0x49cf00){_0x180b88=_0x180b88-0x0;var _0x1ec5d6=_0xd0c0[_0x180b88];return _0x1ec5d6;};'use strict';var multer=require(_0x0d0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0d0c('0x1'));var express=require(_0x0d0c('0x2'));var router=express[_0x0d0c('0x3')]();var fs_extra=require(_0x0d0c('0x4'));var auth=require(_0x0d0c('0x5'));var interaction=require(_0x0d0c('0x6'));var config=require(_0x0d0c('0x7'));var controller=require('./cannedAnswer.controller');router[_0x0d0c('0x8')]('/',auth[_0x0d0c('0x9')](),controller['index']);router[_0x0d0c('0x8')]('/:id',auth[_0x0d0c('0x9')](),controller[_0x0d0c('0xa')]);router[_0x0d0c('0xb')]('/',auth[_0x0d0c('0x9')](),controller[_0x0d0c('0xc')]);router[_0x0d0c('0xd')](_0x0d0c('0xe'),auth[_0x0d0c('0x9')](),controller[_0x0d0c('0xf')]);router[_0x0d0c('0x10')](_0x0d0c('0xe'),auth[_0x0d0c('0x9')](),controller[_0x0d0c('0x11')]);module[_0x0d0c('0x12')]=router; \ No newline at end of file +var _0x978f=['index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x978f,0x1f0));var _0xf978=function(_0x1e08fa,_0x2177b8){_0x1e08fa=_0x1e08fa-0x0;var _0x48a80f=_0x978f[_0x1e08fa];return _0x48a80f;};'use strict';var multer=require(_0xf978('0x0'));var util=require(_0xf978('0x1'));var path=require(_0xf978('0x2'));var timeout=require('connect-timeout');var express=require(_0xf978('0x3'));var router=express['Router']();var fs_extra=require(_0xf978('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf978('0x5'));var config=require('../../config/environment');var controller=require(_0xf978('0x6'));router[_0xf978('0x7')]('/',auth['isAuthenticated'](),controller[_0xf978('0x8')]);router[_0xf978('0x7')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf978('0xc')]);router[_0xf978('0xd')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0xe')]);router[_0xf978('0xf')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0x10')]);module[_0xf978('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index bce502a..ad519d4 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 _0x1e9f=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x35f957,_0x487574){var _0x4e2182=function(_0x344119){while(--_0x344119){_0x35f957['push'](_0x35f957['shift']());}};_0x4e2182(++_0x487574);}(_0x1e9f,0x107));var _0xf1e9=function(_0x14a1b4,_0x2c72b0){_0x14a1b4=_0x14a1b4-0x0;var _0x3cb209=_0x1e9f[_0x14a1b4];return _0x3cb209;};'use strict';var Sequelize=require(_0xf1e9('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf1e9('0x1')],'allowNull':![],'defaultValue':_0xf1e9('0x2')},'clid':{'type':Sequelize[_0xf1e9('0x3')]},'src':{'type':Sequelize[_0xf1e9('0x3')]},'dst':{'type':Sequelize[_0xf1e9('0x3')]},'dcontext':{'type':Sequelize[_0xf1e9('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xf1e9('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf1e9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf1e9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf1e9('0x3')]},'userfield':{'type':Sequelize[_0xf1e9('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf1e9('0x3')]},'sequence':{'type':Sequelize[_0xf1e9('0x3')]},'peeraccount':{'type':Sequelize[_0xf1e9('0x3')]},'type':{'type':Sequelize[_0xf1e9('0x3')]},'tag':{'type':Sequelize[_0xf1e9('0x3')]}}; \ No newline at end of file +var _0x6482=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x30c92b,_0x154324){var _0x33837b=function(_0x3366e6){while(--_0x3366e6){_0x30c92b['push'](_0x30c92b['shift']());}};_0x33837b(++_0x154324);}(_0x6482,0xb0));var _0x2648=function(_0x4b1904,_0x102e50){_0x4b1904=_0x4b1904-0x0;var _0x5ad3d1=_0x6482[_0x4b1904];return _0x5ad3d1;};'use strict';var Sequelize=require('sequelize');module[_0x2648('0x0')]={'calldate':{'type':Sequelize[_0x2648('0x1')],'allowNull':![],'defaultValue':_0x2648('0x2')},'clid':{'type':Sequelize[_0x2648('0x3')]},'src':{'type':Sequelize[_0x2648('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2648('0x3')]},'dstchannel':{'type':Sequelize[_0x2648('0x3')]},'lastapp':{'type':Sequelize[_0x2648('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2648('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2648('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2648('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2648('0x3')]},'uniqueid':{'type':Sequelize[_0x2648('0x3')]},'linkedid':{'type':Sequelize[_0x2648('0x3')]},'sequence':{'type':Sequelize[_0x2648('0x3')]},'peeraccount':{'type':Sequelize[_0x2648('0x3')]},'type':{'type':Sequelize[_0x2648('0x3')]},'tag':{'type':Sequelize[_0x2648('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index b0ee117..4680d21 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 _0x3c94=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Cdr','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x2505c9,_0x12c77f){var _0x357162=function(_0x40c67e){while(--_0x40c67e){_0x2505c9['push'](_0x2505c9['shift']());}};_0x357162(++_0x12c77f);}(_0x3c94,0xcd));var _0x43c9=function(_0x1f9862,_0x1047d7){_0x1f9862=_0x1f9862-0x0;var _0x5c41b0=_0x3c94[_0x1f9862];return _0x5c41b0;};'use strict';var emlformat=require(_0x43c9('0x0'));var rimraf=require(_0x43c9('0x1'));var zipdir=require(_0x43c9('0x2'));var jsonpatch=require(_0x43c9('0x3'));var rp=require(_0x43c9('0x4'));var moment=require(_0x43c9('0x5'));var BPromise=require(_0x43c9('0x6'));var Mustache=require(_0x43c9('0x7'));var util=require(_0x43c9('0x8'));var path=require(_0x43c9('0x9'));var sox=require(_0x43c9('0xa'));var csv=require(_0x43c9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43c9('0xc'));var _=require(_0x43c9('0xd'));var squel=require(_0x43c9('0xe'));var crypto=require(_0x43c9('0xf'));var jsforce=require(_0x43c9('0x10'));var deskjs=require(_0x43c9('0x11'));var toCsv=require(_0x43c9('0xb'));var querystring=require(_0x43c9('0x12'));var Papa=require(_0x43c9('0x13'));var Redis=require('ioredis');var authService=require(_0x43c9('0x14'));var qs=require(_0x43c9('0x15'));var as=require(_0x43c9('0x16'));var hardwareService=require(_0x43c9('0x17'));var logger=require(_0x43c9('0x18'))(_0x43c9('0x19'));var utils=require(_0x43c9('0x1a'));var config=require(_0x43c9('0x1b'));var licenseUtil=require(_0x43c9('0x1c'));var db=require(_0x43c9('0x1d'))['db'];function respondWithStatusCode(_0x62bb3b,_0x31faa1){_0x31faa1=_0x31faa1||0xcc;return function(_0x11fe24){if(_0x11fe24){return _0x62bb3b[_0x43c9('0x1e')](_0x31faa1);}return _0x62bb3b[_0x43c9('0x1f')](_0x31faa1)[_0x43c9('0x20')]();};}function respondWithResult(_0x275b2b,_0x569fa9){_0x569fa9=_0x569fa9||0xc8;return function(_0x37932f){if(_0x37932f){return _0x275b2b[_0x43c9('0x1f')](_0x569fa9)[_0x43c9('0x21')](_0x37932f);}};}function respondWithFilteredResult(_0xe02707,_0x3f908d){return function(_0x5cc1fa){if(_0x5cc1fa){var _0x549d3f=typeof _0x3f908d[_0x43c9('0x22')]===_0x43c9('0x23')&&typeof _0x3f908d[_0x43c9('0x24')]===_0x43c9('0x23');var _0x501856=_0x5cc1fa[_0x43c9('0x25')];var _0x1da149=_0x549d3f?0x0:_0x3f908d[_0x43c9('0x22')];var _0x22bf3d=_0x549d3f?_0x5cc1fa[_0x43c9('0x25')]:_0x3f908d[_0x43c9('0x22')]+_0x3f908d[_0x43c9('0x24')];var _0x1e3996;if(_0x22bf3d>=_0x501856){_0x22bf3d=_0x501856;_0x1e3996=0xc8;}else{_0x1e3996=0xce;}_0xe02707[_0x43c9('0x1f')](_0x1e3996);return _0xe02707[_0x43c9('0x26')](_0x43c9('0x27'),_0x1da149+'-'+_0x22bf3d+'/'+_0x501856)['json'](_0x5cc1fa);}return null;};}function patchUpdates(_0x39c6f1){return function(_0x772b71){try{jsonpatch[_0x43c9('0x28')](_0x772b71,_0x39c6f1,!![]);}catch(_0x4c2d7c){return BPromise[_0x43c9('0x29')](_0x4c2d7c);}return _0x772b71[_0x43c9('0x2a')]();};}function saveUpdates(_0x2ef8d9,_0x5705c6){return function(_0x28290a){if(_0x28290a){return _0x28290a[_0x43c9('0x2b')](_0x2ef8d9)[_0x43c9('0x2c')](function(_0x4d58d7){return _0x4d58d7;});}return null;};}function removeEntity(_0x4963d2,_0x2a40f4){return function(_0x3fd641){if(_0x3fd641){return _0x3fd641[_0x43c9('0x2d')]()['then'](function(){_0x4963d2[_0x43c9('0x1f')](0xcc)[_0x43c9('0x20')]();});}};}function handleEntityNotFound(_0x1e676a,_0x16fee9){return function(_0x2c69af){if(!_0x2c69af){_0x1e676a['sendStatus'](0x194);}return _0x2c69af;};}function handleError(_0x386078,_0x3b5c47){_0x3b5c47=_0x3b5c47||0x1f4;return function(_0x3910af){logger[_0x43c9('0x2e')](_0x3910af[_0x43c9('0x2f')]);if(_0x3910af[_0x43c9('0x30')]){delete _0x3910af[_0x43c9('0x30')];}_0x386078[_0x43c9('0x1f')](_0x3b5c47)[_0x43c9('0x31')](_0x3910af);};}exports[_0x43c9('0x32')]=function(_0x4eb970,_0x11e3c3){var _0x2cbfd7={},_0x15028c={},_0x519e2c={'count':0x0,'rows':[]};var _0x2c0ccc=_[_0x43c9('0x33')](db['Cdr'][_0x43c9('0x34')],function(_0x497719){return{'name':_0x497719[_0x43c9('0x35')],'type':_0x497719[_0x43c9('0x36')][_0x43c9('0x37')]};});_0x15028c[_0x43c9('0x38')]=_['map'](_0x2c0ccc,_0x43c9('0x30'));_0x15028c[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0x4eb970['query']);_0x15028c[_0x43c9('0x3b')]=_['intersection'](_0x15028c[_0x43c9('0x38')],_0x15028c[_0x43c9('0x39')]);_0x2cbfd7[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x15028c['model'],qs[_0x43c9('0x3e')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x2cbfd7[_0x43c9('0x3c')]=_0x2cbfd7['attributes'][_0x43c9('0x3f')]?_0x2cbfd7[_0x43c9('0x3c')]:_0x15028c[_0x43c9('0x38')];if(!_0x4eb970[_0x43c9('0x39')][_0x43c9('0x40')](_0x43c9('0x41'))){_0x2cbfd7[_0x43c9('0x24')]=qs[_0x43c9('0x24')](_0x4eb970['query'][_0x43c9('0x24')]);_0x2cbfd7[_0x43c9('0x22')]=qs[_0x43c9('0x22')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x22')]);}_0x2cbfd7[_0x43c9('0x42')]=qs[_0x43c9('0x43')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x43')]);_0x2cbfd7['where']=qs[_0x43c9('0x3b')](_['pick'](_0x4eb970[_0x43c9('0x39')],_0x15028c[_0x43c9('0x3b')]),_0x2c0ccc);if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]){_0x2cbfd7[_0x43c9('0x45')]=_[_0x43c9('0x46')](_0x2cbfd7[_0x43c9('0x45')],{'$or':_[_0x43c9('0x33')](_0x2c0ccc,function(_0x518bd3){if(_0x518bd3['type']!==_0x43c9('0x47')){var _0x2d63bd={};_0x2d63bd[_0x518bd3['name']]={'$like':'%'+_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]+'%'};return _0x2d63bd;}})});}_0x2cbfd7=_[_0x43c9('0x46')]({},_0x2cbfd7,_0x4eb970['options']);var _0xb01a6e={'where':_0x2cbfd7[_0x43c9('0x45')]};return db[_0x43c9('0x48')][_0x43c9('0x25')](_0xb01a6e)[_0x43c9('0x2c')](function(_0x39601e){_0x519e2c[_0x43c9('0x25')]=_0x39601e;if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x49')]){_0x2cbfd7[_0x43c9('0x4a')]=[{'all':!![]}];}return db[_0x43c9('0x48')][_0x43c9('0x4b')](_0x2cbfd7);})['then'](function(_0x2d5dd5){_0x519e2c[_0x43c9('0x4c')]=_0x2d5dd5;return _0x519e2c;})[_0x43c9('0x2c')](respondWithFilteredResult(_0x11e3c3,_0x2cbfd7))[_0x43c9('0x4d')](handleError(_0x11e3c3,null));};exports['show']=function(_0xff891d,_0x66cac9){var _0x5ce14f={'raw':!![],'where':{'id':_0xff891d[_0x43c9('0x4e')]['id']}},_0x2a8f7d={};_0x2a8f7d[_0x43c9('0x38')]=_[_0x43c9('0x3a')](db[_0x43c9('0x48')][_0x43c9('0x34')]);_0x2a8f7d[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0xff891d[_0x43c9('0x39')]);_0x2a8f7d['filters']=_[_0x43c9('0x3d')](_0x2a8f7d['model'],_0x2a8f7d[_0x43c9('0x39')]);_0x5ce14f[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x2a8f7d[_0x43c9('0x38')],qs['fields'](_0xff891d[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x5ce14f['attributes']=_0x5ce14f[_0x43c9('0x3c')][_0x43c9('0x3f')]?_0x5ce14f['attributes']:_0x2a8f7d[_0x43c9('0x38')];if(_0xff891d[_0x43c9('0x39')][_0x43c9('0x49')]){_0x5ce14f['include']=[{'all':!![]}];}_0x5ce14f=_[_0x43c9('0x46')]({},_0x5ce14f,_0xff891d['options']);return db['Cdr'][_0x43c9('0x4f')](_0x5ce14f)[_0x43c9('0x2c')](handleEntityNotFound(_0x66cac9,null))[_0x43c9('0x2c')](respondWithResult(_0x66cac9,null))[_0x43c9('0x4d')](handleError(_0x66cac9,null));};exports[_0x43c9('0x50')]=function(_0x28fe5d,_0x1f966e){return db[_0x43c9('0x48')][_0x43c9('0x50')](_0x28fe5d[_0x43c9('0x51')],{})[_0x43c9('0x2c')](respondWithResult(_0x1f966e,0xc9))[_0x43c9('0x4d')](handleError(_0x1f966e,null));};exports[_0x43c9('0x2b')]=function(_0x5082e9,_0xc57086){if(_0x5082e9[_0x43c9('0x51')]['id']){delete _0x5082e9['body']['id'];}return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x5082e9[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0xc57086,null))[_0x43c9('0x2c')](saveUpdates(_0x5082e9[_0x43c9('0x51')],null))[_0x43c9('0x2c')](respondWithResult(_0xc57086,null))[_0x43c9('0x4d')](handleError(_0xc57086,null));};exports[_0x43c9('0x2d')]=function(_0x508b62,_0x27db89){return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x508b62[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0x27db89,null))[_0x43c9('0x2c')](removeEntity(_0x27db89,null))['catch'](handleError(_0x27db89,null));};exports[_0x43c9('0x52')]=function(_0x1bc3b5,_0x3aff2e){return db[_0x43c9('0x48')][_0x43c9('0x52')]()[_0x43c9('0x2c')](respondWithResult(_0x3aff2e,null))[_0x43c9('0x4d')](handleError(_0x3aff2e,null));}; \ No newline at end of file +var _0xda19=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','findAll','catch','show','body','find','params','describe'];(function(_0x492cd4,_0x2a640f){var _0x2c73f5=function(_0x720b8){while(--_0x720b8){_0x492cd4['push'](_0x492cd4['shift']());}};_0x2c73f5(++_0x2a640f);}(_0xda19,0xd5));var _0x9da1=function(_0x100573,_0x443a74){_0x100573=_0x100573-0x0;var _0x38be6a=_0xda19[_0x100573];return _0x38be6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['Cdr'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['create']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['create'](_0x336fc3[_0x9da1('0x43')],{})['then'](respondWithResult(_0x351d4d,0xc9))['catch'](handleError(_0x351d4d,null));};exports[_0x9da1('0x23')]=function(_0x43c47d,_0x5afbc7){if(_0x43c47d[_0x9da1('0x43')]['id']){delete _0x43c47d[_0x9da1('0x43')]['id'];}return db['Cdr'][_0x9da1('0x44')]({'where':{'id':_0x43c47d[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5afbc7,null))[_0x9da1('0x24')](saveUpdates(_0x43c47d[_0x9da1('0x43')],null))[_0x9da1('0x24')](respondWithResult(_0x5afbc7,null))[_0x9da1('0x41')](handleError(_0x5afbc7,null));};exports[_0x9da1('0x25')]=function(_0x3889f4,_0x5c9b46){return db[_0x9da1('0x3e')][_0x9da1('0x44')]({'where':{'id':_0x3889f4[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5c9b46,null))['then'](removeEntity(_0x5c9b46,null))['catch'](handleError(_0x5c9b46,null));};exports[_0x9da1('0x46')]=function(_0x6ca1ac,_0x3870dd){return db[_0x9da1('0x3e')][_0x9da1('0x46')]()[_0x9da1('0x24')](respondWithResult(_0x3870dd,null))[_0x9da1('0x41')](handleError(_0x3870dd,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b24102c..135ad6d 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x575414,_0x2d4759){var _0x251f38=function(_0x4fc84e){while(--_0x4fc84e){_0x575414['push'](_0x575414['shift']());}};_0x251f38(++_0x2d4759);}(_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 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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x42930b,_0x3e920d){var _0x1c27a1=function(_0x4912ad){while(--_0x4912ad){_0x42930b['push'](_0x42930b['shift']());}};_0x1c27a1(++_0x3e920d);}(_0x7a54,0x106));var _0x47a5=function(_0x413719,_0x2aa3b8){_0x413719=_0x413719-0x0;var _0x352ced=_0x7a54[_0x413719];return _0x352ced;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f36ff79..83646d8 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 _0x89f3=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x262b3d,_0x1e882a){var _0xe7c51a=function(_0xd82d59){while(--_0xd82d59){_0x262b3d['push'](_0x262b3d['shift']());}};_0xe7c51a(++_0x1e882a);}(_0x89f3,0x6a));var _0x389f=function(_0x532b62,_0xd5bdf3){_0x532b62=_0x532b62-0x0;var _0x1c927d=_0x89f3[_0x532b62];return _0x1c927d;};'use strict';var _=require(_0x389f('0x0'));var util=require(_0x389f('0x1'));var moment=require(_0x389f('0x2'));var BPromise=require(_0x389f('0x3'));var rs=require(_0x389f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x389f('0x5'))['db'];var utils=require(_0x389f('0x6'));var logger=require('../../config/logger')(_0x389f('0x7'));var config=require(_0x389f('0x8'));var jayson=require(_0x389f('0x9'));var client=jayson[_0x389f('0xa')][_0x389f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4daea9,_0x245d7d,_0x1aad8c){return new BPromise(function(_0x2e4f29,_0x1b0a47){return client[_0x389f('0xc')](_0x4daea9,_0x1aad8c)[_0x389f('0xd')](function(_0x4584bb){logger[_0x389f('0xe')](_0x389f('0xf'),_0x245d7d,_0x389f('0x10'));logger[_0x389f('0x11')](_0x389f('0x12'),_0x245d7d,_0x389f('0x10'),JSON[_0x389f('0x13')](_0x4584bb));if(_0x4584bb['error']){if(_0x4584bb['error'][_0x389f('0x14')]===0x1f4){logger[_0x389f('0x15')]('Cdr,\x20%s,\x20%s',_0x245d7d,_0x4584bb[_0x389f('0x15')][_0x389f('0x16')]);return _0x1b0a47(_0x4584bb[_0x389f('0x15')][_0x389f('0x16')]);}logger[_0x389f('0x15')]('Cdr,\x20%s,\x20%s',_0x245d7d,_0x4584bb['error'][_0x389f('0x16')]);return _0x2e4f29(_0x4584bb[_0x389f('0x15')][_0x389f('0x16')]);}else{logger[_0x389f('0xe')]('Cdr,\x20%s,\x20%s',_0x245d7d,'request\x20sent');_0x2e4f29(_0x4584bb['result']['message']);}})[_0x389f('0x17')](function(_0x3d481e){logger[_0x389f('0x15')](_0x389f('0xf'),_0x245d7d,_0x3d481e);_0x1b0a47(_0x3d481e);});});} \ No newline at end of file +var _0xed40=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x185487,_0x278958){var _0x8c7d49=function(_0x53362d){while(--_0x53362d){_0x185487['push'](_0x185487['shift']());}};_0x8c7d49(++_0x278958);}(_0xed40,0x17b));var _0x0ed4=function(_0x3a1bd7,_0x13657d){_0x3a1bd7=_0x3a1bd7-0x0;var _0x456f58=_0xed40[_0x3a1bd7];return _0x456f58;};'use strict';var _=require(_0x0ed4('0x0'));var util=require(_0x0ed4('0x1'));var moment=require(_0x0ed4('0x2'));var BPromise=require(_0x0ed4('0x3'));var rs=require(_0x0ed4('0x4'));var fs=require('fs');var Redis=require(_0x0ed4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ed4('0x6'))('rpc');var config=require(_0x0ed4('0x7'));var jayson=require(_0x0ed4('0x8'));var client=jayson[_0x0ed4('0x9')][_0x0ed4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c370c,_0x3c81e7,_0x4a2b21){return new BPromise(function(_0x2503e5,_0x3df7bb){return client[_0x0ed4('0xb')](_0x3c370c,_0x4a2b21)['then'](function(_0x4b7a0e){logger[_0x0ed4('0xc')](_0x0ed4('0xd'),_0x3c81e7,_0x0ed4('0xe'));logger['debug'](_0x0ed4('0xf'),_0x3c81e7,'request\x20sent',JSON[_0x0ed4('0x10')](_0x4b7a0e));if(_0x4b7a0e[_0x0ed4('0x11')]){if(_0x4b7a0e[_0x0ed4('0x11')]['code']===0x1f4){logger[_0x0ed4('0x11')](_0x0ed4('0xd'),_0x3c81e7,_0x4b7a0e[_0x0ed4('0x11')]['message']);return _0x3df7bb(_0x4b7a0e[_0x0ed4('0x11')][_0x0ed4('0x12')]);}logger[_0x0ed4('0x11')](_0x0ed4('0xd'),_0x3c81e7,_0x4b7a0e[_0x0ed4('0x11')]['message']);return _0x2503e5(_0x4b7a0e[_0x0ed4('0x11')][_0x0ed4('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x3c81e7,_0x0ed4('0xe'));_0x2503e5(_0x4b7a0e['result'][_0x0ed4('0x12')]);}})[_0x0ed4('0x13')](function(_0x4fdc04){logger['error'](_0x0ed4('0xd'),_0x3c81e7,_0x4fdc04);_0x3df7bb(_0x4fdc04);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 142224b..8bca059 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3c126c,_0x22f353){var _0x3b89e4=function(_0x1472c0){while(--_0x1472c0){_0x3c126c['push'](_0x3c126c['shift']());}};_0x3b89e4(++_0x22f353);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c2b2233..63cca07 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 _0xba1c=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba1c,0x1ec));var _0xcba1=function(_0x2b3524,_0x562f67){_0x2b3524=_0x2b3524-0x0;var _0x449b72=_0xba1c[_0x2b3524];return _0x449b72;};'use strict';var Sequelize=require(_0xcba1('0x0'));module[_0xcba1('0x1')]={'priority':{'type':Sequelize[_0xcba1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcba1('0x3')},'appdata':{'type':Sequelize[_0xcba1('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcba1('0x5')],'defaultValue':_0xcba1('0x6')}}; \ No newline at end of file +var _0xd0ab=['STRING','*,*,*,*','sequelize','INTEGER','TEXT'];(function(_0xa6f6a6,_0x138b7a){var _0x71a78a=function(_0x3070d1){while(--_0x3070d1){_0xa6f6a6['push'](_0xa6f6a6['shift']());}};_0x71a78a(++_0x138b7a);}(_0xd0ab,0x66));var _0xbd0a=function(_0x1ad248,_0x1579a6){_0x1ad248=_0x1ad248-0x0;var _0x3636df=_0xd0ab[_0x1ad248];return _0x3636df;};'use strict';var Sequelize=require(_0xbd0a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbd0a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbd0a('0x2')]()},'description':{'type':Sequelize[_0xbd0a('0x3')]},'interval':{'type':Sequelize[_0xbd0a('0x3')],'defaultValue':_0xbd0a('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 84614f9..b2dde11 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 _0x5fc7=['offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','sendStatus','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x366668,_0x7673fc){var _0x3bd9be=function(_0x987487){while(--_0x987487){_0x366668['push'](_0x366668['shift']());}};_0x3bd9be(++_0x7673fc);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x5fc7[_0x40822a];return _0x357420;};'use strict';var emlformat=require(_0x75fc('0x0'));var rimraf=require(_0x75fc('0x1'));var zipdir=require(_0x75fc('0x2'));var jsonpatch=require(_0x75fc('0x3'));var rp=require(_0x75fc('0x4'));var moment=require(_0x75fc('0x5'));var BPromise=require(_0x75fc('0x6'));var Mustache=require(_0x75fc('0x7'));var util=require(_0x75fc('0x8'));var path=require(_0x75fc('0x9'));var sox=require(_0x75fc('0xa'));var csv=require(_0x75fc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75fc('0xc'));var _=require(_0x75fc('0xd'));var squel=require(_0x75fc('0xe'));var crypto=require(_0x75fc('0xf'));var jsforce=require(_0x75fc('0x10'));var deskjs=require(_0x75fc('0x11'));var toCsv=require(_0x75fc('0xb'));var querystring=require(_0x75fc('0x12'));var Papa=require(_0x75fc('0x13'));var Redis=require(_0x75fc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x75fc('0x15'));var as=require(_0x75fc('0x16'));var hardwareService=require(_0x75fc('0x17'));var logger=require(_0x75fc('0x18'))('api');var utils=require(_0x75fc('0x19'));var config=require(_0x75fc('0x1a'));var licenseUtil=require(_0x75fc('0x1b'));var db=require(_0x75fc('0x1c'))['db'];function respondWithStatusCode(_0xf703a7,_0x22bdb0){_0x22bdb0=_0x22bdb0||0xcc;return function(_0x22b73d){if(_0x22b73d){return _0xf703a7['sendStatus'](_0x22bdb0);}return _0xf703a7['status'](_0x22bdb0)['end']();};}function respondWithResult(_0x195606,_0x2e0e83){_0x2e0e83=_0x2e0e83||0xc8;return function(_0x2e073b){if(_0x2e073b){return _0x195606[_0x75fc('0x1d')](_0x2e0e83)[_0x75fc('0x1e')](_0x2e073b);}};}function respondWithFilteredResult(_0x2cd131,_0x3b64b2){return function(_0x3053b6){if(_0x3053b6){var _0x53f23d=typeof _0x3b64b2[_0x75fc('0x1f')]===_0x75fc('0x20')&&typeof _0x3b64b2['limit']===_0x75fc('0x20');var _0x9a1359=_0x3053b6['count'];var _0x5cdf1e=_0x53f23d?0x0:_0x3b64b2[_0x75fc('0x1f')];var _0x2608bf=_0x53f23d?_0x3053b6[_0x75fc('0x21')]:_0x3b64b2[_0x75fc('0x1f')]+_0x3b64b2[_0x75fc('0x22')];var _0x47123f;if(_0x2608bf>=_0x9a1359){_0x2608bf=_0x9a1359;_0x47123f=0xc8;}else{_0x47123f=0xce;}_0x2cd131['status'](_0x47123f);return _0x2cd131[_0x75fc('0x23')]('Content-Range',_0x5cdf1e+'-'+_0x2608bf+'/'+_0x9a1359)[_0x75fc('0x1e')](_0x3053b6);}return null;};}function patchUpdates(_0x2373b0){return function(_0x2780e3){try{jsonpatch[_0x75fc('0x24')](_0x2780e3,_0x2373b0,!![]);}catch(_0x518945){return BPromise[_0x75fc('0x25')](_0x518945);}return _0x2780e3[_0x75fc('0x26')]();};}function saveUpdates(_0x48f586,_0x458cc4){return function(_0x3ed9d5){if(_0x3ed9d5){return _0x3ed9d5['update'](_0x48f586)[_0x75fc('0x27')](function(_0x5a79e0){return _0x5a79e0;});}return null;};}function removeEntity(_0x14745f,_0x924c53){return function(_0x54b684){if(_0x54b684){return _0x54b684[_0x75fc('0x28')]()[_0x75fc('0x27')](function(){_0x14745f['status'](0xcc)[_0x75fc('0x29')]();});}};}function handleEntityNotFound(_0x2418be,_0x53fcd2){return function(_0x5774bb){if(!_0x5774bb){_0x2418be[_0x75fc('0x2a')](0x194);}return _0x5774bb;};}function handleError(_0x5a75b2,_0x19a59e){_0x19a59e=_0x19a59e||0x1f4;return function(_0x4268ed){logger['error'](_0x4268ed['stack']);if(_0x4268ed['name']){delete _0x4268ed[_0x75fc('0x2b')];}_0x5a75b2[_0x75fc('0x1d')](_0x19a59e)[_0x75fc('0x2c')](_0x4268ed);};}exports[_0x75fc('0x2d')]=function(_0xe13951,_0xc7025){var _0x337058={'raw':!![],'where':{'id':_0xe13951[_0x75fc('0x2e')]['id']}},_0x54bcd5={};_0x54bcd5[_0x75fc('0x2f')]=_[_0x75fc('0x30')](db[_0x75fc('0x31')]['rawAttributes']);_0x54bcd5[_0x75fc('0x32')]=_['keys'](_0xe13951[_0x75fc('0x32')]);_0x54bcd5[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x54bcd5[_0x75fc('0x2f')],_0x54bcd5['query']);_0x337058[_0x75fc('0x35')]=_['intersection'](_0x54bcd5[_0x75fc('0x2f')],qs[_0x75fc('0x36')](_0xe13951['query'][_0x75fc('0x36')]));_0x337058[_0x75fc('0x35')]=_0x337058['attributes'][_0x75fc('0x37')]?_0x337058[_0x75fc('0x35')]:_0x54bcd5[_0x75fc('0x2f')];if(_0xe13951[_0x75fc('0x32')][_0x75fc('0x38')]){_0x337058[_0x75fc('0x39')]=[{'all':!![]}];}_0x337058=_[_0x75fc('0x3a')]({},_0x337058,_0xe13951[_0x75fc('0x3b')]);return db['ChatApplication'][_0x75fc('0x3c')](_0x337058)[_0x75fc('0x27')](handleEntityNotFound(_0xc7025,null))[_0x75fc('0x27')](respondWithResult(_0xc7025,null))[_0x75fc('0x3d')](handleError(_0xc7025,null));};exports[_0x75fc('0x3e')]=function(_0x3a629c,_0x998936){if(_0x3a629c[_0x75fc('0x3f')]['id']){delete _0x3a629c[_0x75fc('0x3f')]['id'];}return db[_0x75fc('0x31')][_0x75fc('0x3c')]({'where':{'id':_0x3a629c[_0x75fc('0x2e')]['id']}})[_0x75fc('0x27')](handleEntityNotFound(_0x998936,null))['then'](saveUpdates(_0x3a629c[_0x75fc('0x3f')],null))[_0x75fc('0x27')](respondWithResult(_0x998936,null))[_0x75fc('0x3d')](handleError(_0x998936,null));};exports[_0x75fc('0x28')]=function(_0x51b9fa,_0x458bdf){return db[_0x75fc('0x31')][_0x75fc('0x3c')]({'where':{'id':_0x51b9fa[_0x75fc('0x2e')]['id']}})[_0x75fc('0x27')](handleEntityNotFound(_0x458bdf,null))[_0x75fc('0x27')](removeEntity(_0x458bdf,null))[_0x75fc('0x3d')](handleError(_0x458bdf,null));}; \ No newline at end of file +var _0x0c5d=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','fields','length','includeAll','include','options','find','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x17e799,_0x490f26){var _0x682f42=function(_0x4b9043){while(--_0x4b9043){_0x17e799['push'](_0x17e799['shift']());}};_0x682f42(++_0x490f26);}(_0x0c5d,0x6c));var _0xd0c5=function(_0xf7f498,_0x3238c5){_0xf7f498=_0xf7f498-0x0;var _0x2bde38=_0x0c5d[_0xf7f498];return _0x2bde38;};'use strict';var emlformat=require(_0xd0c5('0x0'));var rimraf=require(_0xd0c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0c5('0x2'));var rp=require('request-promise');var moment=require(_0xd0c5('0x3'));var BPromise=require(_0xd0c5('0x4'));var Mustache=require(_0xd0c5('0x5'));var util=require(_0xd0c5('0x6'));var path=require(_0xd0c5('0x7'));var sox=require(_0xd0c5('0x8'));var csv=require(_0xd0c5('0x9'));var ejs=require(_0xd0c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd0c5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd0c5('0xd'));var Papa=require(_0xd0c5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0c5('0xf'));var qs=require(_0xd0c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0c5('0x11'));var logger=require(_0xd0c5('0x12'))(_0xd0c5('0x13'));var utils=require(_0xd0c5('0x14'));var config=require(_0xd0c5('0x15'));var licenseUtil=require(_0xd0c5('0x16'));var db=require(_0xd0c5('0x17'))['db'];function respondWithStatusCode(_0x46db00,_0x1e5ac4){_0x1e5ac4=_0x1e5ac4||0xcc;return function(_0x125470){if(_0x125470){return _0x46db00[_0xd0c5('0x18')](_0x1e5ac4);}return _0x46db00[_0xd0c5('0x19')](_0x1e5ac4)['end']();};}function respondWithResult(_0x11511d,_0x1c1cc8){_0x1c1cc8=_0x1c1cc8||0xc8;return function(_0x1fc98d){if(_0x1fc98d){return _0x11511d[_0xd0c5('0x19')](_0x1c1cc8)['json'](_0x1fc98d);}};}function respondWithFilteredResult(_0x280e22,_0x23d941){return function(_0x242615){if(_0x242615){var _0x639e72=typeof _0x23d941['offset']===_0xd0c5('0x1a')&&typeof _0x23d941['limit']===_0xd0c5('0x1a');var _0x57c76a=_0x242615[_0xd0c5('0x1b')];var _0x692aeb=_0x639e72?0x0:_0x23d941[_0xd0c5('0x1c')];var _0x1cfe05=_0x639e72?_0x242615[_0xd0c5('0x1b')]:_0x23d941[_0xd0c5('0x1c')]+_0x23d941[_0xd0c5('0x1d')];var _0x287961;if(_0x1cfe05>=_0x57c76a){_0x1cfe05=_0x57c76a;_0x287961=0xc8;}else{_0x287961=0xce;}_0x280e22['status'](_0x287961);return _0x280e22[_0xd0c5('0x1e')](_0xd0c5('0x1f'),_0x692aeb+'-'+_0x1cfe05+'/'+_0x57c76a)['json'](_0x242615);}return null;};}function patchUpdates(_0x835e8d){return function(_0x30f548){try{jsonpatch[_0xd0c5('0x20')](_0x30f548,_0x835e8d,!![]);}catch(_0x6febb1){return BPromise[_0xd0c5('0x21')](_0x6febb1);}return _0x30f548[_0xd0c5('0x22')]();};}function saveUpdates(_0x331849,_0x49db81){return function(_0x4ac41c){if(_0x4ac41c){return _0x4ac41c[_0xd0c5('0x23')](_0x331849)[_0xd0c5('0x24')](function(_0x439dd5){return _0x439dd5;});}return null;};}function removeEntity(_0x6ce082,_0x5eb093){return function(_0x185e33){if(_0x185e33){return _0x185e33['destroy']()['then'](function(){_0x6ce082[_0xd0c5('0x19')](0xcc)[_0xd0c5('0x25')]();});}};}function handleEntityNotFound(_0x364963,_0x73f292){return function(_0x3a5edf){if(!_0x3a5edf){_0x364963[_0xd0c5('0x18')](0x194);}return _0x3a5edf;};}function handleError(_0xbcef61,_0x17443b){_0x17443b=_0x17443b||0x1f4;return function(_0x19b9ec){logger[_0xd0c5('0x26')](_0x19b9ec[_0xd0c5('0x27')]);if(_0x19b9ec[_0xd0c5('0x28')]){delete _0x19b9ec[_0xd0c5('0x28')];}_0xbcef61[_0xd0c5('0x19')](_0x17443b)[_0xd0c5('0x29')](_0x19b9ec);};}exports[_0xd0c5('0x2a')]=function(_0x24d35f,_0x572e66){var _0x39284e={'raw':!![],'where':{'id':_0x24d35f[_0xd0c5('0x2b')]['id']}},_0x36415f={};_0x36415f[_0xd0c5('0x2c')]=_[_0xd0c5('0x2d')](db[_0xd0c5('0x2e')][_0xd0c5('0x2f')]);_0x36415f['query']=_[_0xd0c5('0x2d')](_0x24d35f['query']);_0x36415f[_0xd0c5('0x30')]=_[_0xd0c5('0x31')](_0x36415f[_0xd0c5('0x2c')],_0x36415f[_0xd0c5('0x32')]);_0x39284e[_0xd0c5('0x33')]=_[_0xd0c5('0x31')](_0x36415f[_0xd0c5('0x2c')],qs['fields'](_0x24d35f['query'][_0xd0c5('0x34')]));_0x39284e['attributes']=_0x39284e[_0xd0c5('0x33')][_0xd0c5('0x35')]?_0x39284e[_0xd0c5('0x33')]:_0x36415f[_0xd0c5('0x2c')];if(_0x24d35f['query'][_0xd0c5('0x36')]){_0x39284e[_0xd0c5('0x37')]=[{'all':!![]}];}_0x39284e=_['merge']({},_0x39284e,_0x24d35f[_0xd0c5('0x38')]);return db['ChatApplication'][_0xd0c5('0x39')](_0x39284e)[_0xd0c5('0x24')](handleEntityNotFound(_0x572e66,null))[_0xd0c5('0x24')](respondWithResult(_0x572e66,null))['catch'](handleError(_0x572e66,null));};exports[_0xd0c5('0x23')]=function(_0x263d3b,_0x2e8f04){if(_0x263d3b[_0xd0c5('0x3a')]['id']){delete _0x263d3b[_0xd0c5('0x3a')]['id'];}return db[_0xd0c5('0x2e')][_0xd0c5('0x39')]({'where':{'id':_0x263d3b[_0xd0c5('0x2b')]['id']}})[_0xd0c5('0x24')](handleEntityNotFound(_0x2e8f04,null))[_0xd0c5('0x24')](saveUpdates(_0x263d3b[_0xd0c5('0x3a')],null))[_0xd0c5('0x24')](respondWithResult(_0x2e8f04,null))[_0xd0c5('0x3b')](handleError(_0x2e8f04,null));};exports['destroy']=function(_0x4e3d0e,_0x1fe07f){return db['ChatApplication'][_0xd0c5('0x39')]({'where':{'id':_0x4e3d0e[_0xd0c5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1fe07f,null))[_0xd0c5('0x24')](removeEntity(_0x1fe07f,null))[_0xd0c5('0x3b')](handleError(_0x1fe07f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 551321a..bbbae4b 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 _0x3fb1=['moment','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0xa01c56,_0x919f79){var _0x32fb57=function(_0x331360){while(--_0x331360){_0xa01c56['push'](_0xa01c56['shift']());}};_0x32fb57(++_0x919f79);}(_0x3fb1,0x15a));var _0x13fb=function(_0x67b060,_0x5b2995){_0x67b060=_0x67b060-0x0;var _0x947671=_0x3fb1[_0x67b060];return _0x947671;};'use strict';var _=require('lodash');var util=require(_0x13fb('0x0'));var logger=require('../../config/logger')(_0x13fb('0x1'));var moment=require(_0x13fb('0x2'));var BPromise=require('bluebird');var rp=require(_0x13fb('0x3'));var fs=require('fs');var path=require(_0x13fb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x13fb('0x5'));module[_0x13fb('0x6')]=function(_0x1ba60f,_0x46030c){return _0x1ba60f[_0x13fb('0x7')](_0x13fb('0x8'),attributes,{'tableName':_0x13fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13fb('0xa'),'collate':_0x13fb('0xb')});}; \ No newline at end of file +var _0xec22=['exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3670f1,_0x378d01){var _0x4fed56=function(_0x2b0d27){while(--_0x2b0d27){_0x3670f1['push'](_0x3670f1['shift']());}};_0x4fed56(++_0x378d01);}(_0xec22,0x1b1));var _0x2ec2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xec22[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2ec2('0x0'));var util=require(_0x2ec2('0x1'));var logger=require(_0x2ec2('0x2'))(_0x2ec2('0x3'));var moment=require(_0x2ec2('0x4'));var BPromise=require(_0x2ec2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ec2('0x6'));var rimraf=require(_0x2ec2('0x7'));var config=require(_0x2ec2('0x8'));var attributes=require('./chatApplication.attributes');module[_0x2ec2('0x9')]=function(_0x3bed29,_0x2aa01f){return _0x3bed29['define'](_0x2ec2('0xa'),attributes,{'tableName':_0x2ec2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2ec2('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 76f8fcb..2918a24 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 _0x326a=['catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatApplication,\x20%s,\x20%s','message'];(function(_0x5d4bad,_0x61a453){var _0x6ea19e=function(_0x277020){while(--_0x277020){_0x5d4bad['push'](_0x5d4bad['shift']());}};_0x6ea19e(++_0x61a453);}(_0x326a,0xa1));var _0xa326=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x326a[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xa326('0x0'));var moment=require(_0xa326('0x1'));var BPromise=require('bluebird');var rs=require(_0xa326('0x2'));var fs=require('fs');var Redis=require(_0xa326('0x3'));var db=require(_0xa326('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa326('0x5'));var config=require(_0xa326('0x6'));var jayson=require(_0xa326('0x7'));var client=jayson[_0xa326('0x8')][_0xa326('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3aecd4,_0x39da08,_0x6f476b){return new BPromise(function(_0x2e5752,_0x1e05d5){return client[_0xa326('0xa')](_0x3aecd4,_0x6f476b)[_0xa326('0xb')](function(_0x50b1f6){logger[_0xa326('0xc')]('ChatApplication,\x20%s,\x20%s',_0x39da08,_0xa326('0xd'));logger[_0xa326('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x39da08,_0xa326('0xd'),JSON[_0xa326('0xf')](_0x50b1f6));if(_0x50b1f6['error']){if(_0x50b1f6[_0xa326('0x10')]['code']===0x1f4){logger['error'](_0xa326('0x11'),_0x39da08,_0x50b1f6[_0xa326('0x10')]['message']);return _0x1e05d5(_0x50b1f6[_0xa326('0x10')][_0xa326('0x12')]);}logger[_0xa326('0x10')](_0xa326('0x11'),_0x39da08,_0x50b1f6[_0xa326('0x10')][_0xa326('0x12')]);return _0x2e5752(_0x50b1f6['error']['message']);}else{logger[_0xa326('0xc')](_0xa326('0x11'),_0x39da08,_0xa326('0xd'));_0x2e5752(_0x50b1f6['result']['message']);}})[_0xa326('0x13')](function(_0x85a1f3){logger[_0xa326('0x10')]('ChatApplication,\x20%s,\x20%s',_0x39da08,_0x85a1f3);_0x1e05d5(_0x85a1f3);});});} \ No newline at end of file +var _0xe95a=['error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x714046,_0x183573){var _0x486bfc=function(_0x3d8fac){while(--_0x3d8fac){_0x714046['push'](_0x714046['shift']());}};_0x486bfc(++_0x183573);}(_0xe95a,0x1a8));var _0xae95=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe95a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xae95('0x0'));var util=require('util');var moment=require(_0xae95('0x1'));var BPromise=require('bluebird');var rs=require(_0xae95('0x2'));var fs=require('fs');var Redis=require(_0xae95('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae95('0x4'))(_0xae95('0x5'));var config=require(_0xae95('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xae95('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a9953,_0x275e2d,_0x493076){return new BPromise(function(_0x2bfc76,_0xfe613c){return client[_0xae95('0x8')](_0x4a9953,_0x493076)[_0xae95('0x9')](function(_0x7246a2){logger[_0xae95('0xa')](_0xae95('0xb'),_0x275e2d,_0xae95('0xc'));logger[_0xae95('0xd')](_0xae95('0xe'),_0x275e2d,_0xae95('0xc'),JSON[_0xae95('0xf')](_0x7246a2));if(_0x7246a2['error']){if(_0x7246a2['error'][_0xae95('0x10')]===0x1f4){logger[_0xae95('0x11')](_0xae95('0xb'),_0x275e2d,_0x7246a2[_0xae95('0x11')][_0xae95('0x12')]);return _0xfe613c(_0x7246a2[_0xae95('0x11')]['message']);}logger[_0xae95('0x11')](_0xae95('0xb'),_0x275e2d,_0x7246a2[_0xae95('0x11')]['message']);return _0x2bfc76(_0x7246a2[_0xae95('0x11')][_0xae95('0x12')]);}else{logger[_0xae95('0xa')]('ChatApplication,\x20%s,\x20%s',_0x275e2d,'request\x20sent');_0x2bfc76(_0x7246a2[_0xae95('0x13')][_0xae95('0x12')]);}})[_0xae95('0x14')](function(_0x412f29){logger[_0xae95('0x11')]('ChatApplication,\x20%s,\x20%s',_0x275e2d,_0x412f29);_0xfe613c(_0x412f29);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 1fe1a2b..3a7dd2a 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 _0x40b2=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','delete','exports','multer'];(function(_0x225191,_0x4813a9){var _0x5a2dbd=function(_0x1a3987){while(--_0x1a3987){_0x225191['push'](_0x225191['shift']());}};_0x5a2dbd(++_0x4813a9);}(_0x40b2,0x10f));var _0x240b=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x40b2[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x240b('0x0'));var util=require(_0x240b('0x1'));var path=require(_0x240b('0x2'));var timeout=require(_0x240b('0x3'));var express=require(_0x240b('0x4'));var router=express[_0x240b('0x5')]();var fs_extra=require(_0x240b('0x6'));var auth=require(_0x240b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x240b('0x8'));var controller=require(_0x240b('0x9'));router[_0x240b('0xa')](_0x240b('0xb'),auth[_0x240b('0xc')](),controller['show']);router['put'](_0x240b('0xb'),auth['isAuthenticated'](),controller[_0x240b('0xd')]);router[_0x240b('0xe')](_0x240b('0xb'),auth[_0x240b('0xc')](),controller['destroy']);module[_0x240b('0xf')]=router; \ No newline at end of file +var _0x0bdd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','update','delete','isAuthenticated','destroy','exports','util','connect-timeout','express'];(function(_0x32bbb1,_0xa0e27e){var _0x42b415=function(_0x23f4e2){while(--_0x23f4e2){_0x32bbb1['push'](_0x32bbb1['shift']());}};_0x42b415(++_0xa0e27e);}(_0x0bdd,0xa7));var _0xd0bd=function(_0x5215e6,_0x14c378){_0x5215e6=_0x5215e6-0x0;var _0x145c9c=_0x0bdd[_0x5215e6];return _0x145c9c;};'use strict';var multer=require('multer');var util=require(_0xd0bd('0x0'));var path=require('path');var timeout=require(_0xd0bd('0x1'));var express=require(_0xd0bd('0x2'));var router=express[_0xd0bd('0x3')]();var fs_extra=require(_0xd0bd('0x4'));var auth=require(_0xd0bd('0x5'));var interaction=require(_0xd0bd('0x6'));var config=require(_0xd0bd('0x7'));var controller=require('./chatApplication.controller');router[_0xd0bd('0x8')](_0xd0bd('0x9'),auth['isAuthenticated'](),controller[_0xd0bd('0xa')]);router[_0xd0bd('0xb')](_0xd0bd('0x9'),auth['isAuthenticated'](),controller[_0xd0bd('0xc')]);router[_0xd0bd('0xd')](_0xd0bd('0x9'),auth[_0xd0bd('0xe')](),controller[_0xd0bd('0xf')]);module[_0xd0bd('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 09e4198..1aa028c 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 _0x741a=['sequelize','exports','STRING'];(function(_0x34bf03,_0x7ebc65){var _0x478925=function(_0x46508c){while(--_0x46508c){_0x34bf03['push'](_0x34bf03['shift']());}};_0x478925(++_0x7ebc65);}(_0x741a,0x7b));var _0xa741=function(_0xa68324,_0x424be1){_0xa68324=_0xa68324-0x0;var _0x19dd73=_0x741a[_0xa68324];return _0x19dd73;};'use strict';var Sequelize=require(_0xa741('0x0'));module[_0xa741('0x1')]={'name':{'type':Sequelize[_0xa741('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa741('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7f59=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f59,0x156));var _0x97f5=function(_0x4785fa,_0x5763b4){_0x4785fa=_0x4785fa-0x0;var _0x5cd6a2=_0x7f59[_0x4785fa];return _0x5cd6a2;};'use strict';var Sequelize=require('sequelize');module[_0x97f5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x97f5('0x1')]},'write':{'type':Sequelize[_0x97f5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 73eb392..63f701f 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 _0x5b14=['include','findAll','rows','show','params','length','includeAll','find','body','catch','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','merge','removeMembers','addMessage','ChatGroupId','create','order','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x5b14,0x142));var _0x45b1=function(_0x3b267f,_0x2a7dd9){_0x3b267f=_0x3b267f-0x0;var _0x4c0cd8=_0x5b14[_0x3b267f];return _0x4c0cd8;};'use strict';var emlformat=require(_0x45b1('0x0'));var rimraf=require(_0x45b1('0x1'));var zipdir=require(_0x45b1('0x2'));var jsonpatch=require(_0x45b1('0x3'));var rp=require('request-promise');var moment=require(_0x45b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x45b1('0x5'));var sox=require(_0x45b1('0x6'));var csv=require(_0x45b1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45b1('0x8'));var _=require(_0x45b1('0x9'));var squel=require(_0x45b1('0xa'));var crypto=require(_0x45b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x45b1('0xc'));var toCsv=require(_0x45b1('0x7'));var querystring=require(_0x45b1('0xd'));var Papa=require(_0x45b1('0xe'));var Redis=require(_0x45b1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x45b1('0x10'));var hardwareService=require(_0x45b1('0x11'));var logger=require(_0x45b1('0x12'))(_0x45b1('0x13'));var utils=require('../../config/utils');var config=require(_0x45b1('0x14'));var licenseUtil=require(_0x45b1('0x15'));var db=require(_0x45b1('0x16'))['db'];config[_0x45b1('0x17')]=_[_0x45b1('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x45b1('0x19'))(new Redis(config['redis']));require(_0x45b1('0x1a'))[_0x45b1('0x1b')](socket);function respondWithStatusCode(_0x465e06,_0x57029f){_0x57029f=_0x57029f||0xcc;return function(_0x33b9eb){if(_0x33b9eb){return _0x465e06[_0x45b1('0x1c')](_0x57029f);}return _0x465e06[_0x45b1('0x1d')](_0x57029f)[_0x45b1('0x1e')]();};}function respondWithResult(_0x59f73f,_0xf21672){_0xf21672=_0xf21672||0xc8;return function(_0xef22f5){if(_0xef22f5){return _0x59f73f[_0x45b1('0x1d')](_0xf21672)['json'](_0xef22f5);}};}function respondWithFilteredResult(_0x198b86,_0x46e731){return function(_0x289277){if(_0x289277){var _0x48df70=typeof _0x46e731[_0x45b1('0x1f')]===_0x45b1('0x20')&&typeof _0x46e731[_0x45b1('0x21')]==='undefined';var _0x4e0419=_0x289277[_0x45b1('0x22')];var _0xa14c28=_0x48df70?0x0:_0x46e731[_0x45b1('0x1f')];var _0x2dfc6e=_0x48df70?_0x289277[_0x45b1('0x22')]:_0x46e731[_0x45b1('0x1f')]+_0x46e731['limit'];var _0xfeae7b;if(_0x2dfc6e>=_0x4e0419){_0x2dfc6e=_0x4e0419;_0xfeae7b=0xc8;}else{_0xfeae7b=0xce;}_0x198b86[_0x45b1('0x1d')](_0xfeae7b);return _0x198b86['set'](_0x45b1('0x23'),_0xa14c28+'-'+_0x2dfc6e+'/'+_0x4e0419)[_0x45b1('0x24')](_0x289277);}return null;};}function patchUpdates(_0x440f90){return function(_0x596195){try{jsonpatch[_0x45b1('0x25')](_0x596195,_0x440f90,!![]);}catch(_0x3169b0){return BPromise[_0x45b1('0x26')](_0x3169b0);}return _0x596195['save']();};}function saveUpdates(_0x51ebda,_0x6770f2){return function(_0x228d93){if(_0x228d93){return _0x228d93[_0x45b1('0x27')](_0x51ebda)[_0x45b1('0x28')](function(_0x3b4c12){return _0x3b4c12;});}return null;};}function removeEntity(_0x371222,_0x173121){return function(_0x3ac385){if(_0x3ac385){return _0x3ac385[_0x45b1('0x29')]()['then'](function(){_0x371222[_0x45b1('0x1d')](0xcc)[_0x45b1('0x1e')]();});}};}function handleEntityNotFound(_0x4155e1,_0x52007f){return function(_0x5567aa){if(!_0x5567aa){_0x4155e1[_0x45b1('0x1c')](0x194);}return _0x5567aa;};}function handleError(_0x1c47ba,_0x41a202){_0x41a202=_0x41a202||0x1f4;return function(_0x1d4972){logger[_0x45b1('0x2a')](_0x1d4972['stack']);if(_0x1d4972[_0x45b1('0x2b')]){delete _0x1d4972['name'];}_0x1c47ba[_0x45b1('0x1d')](_0x41a202)[_0x45b1('0x2c')](_0x1d4972);};}exports[_0x45b1('0x2d')]=function(_0xb76e69,_0x10e38e){var _0x5993df={},_0x4bb2da={},_0x3e7c53={'count':0x0,'rows':[]};var _0x1ce09b=_['map'](db[_0x45b1('0x2e')][_0x45b1('0x2f')],function(_0x22629d){return{'name':_0x22629d[_0x45b1('0x30')],'type':_0x22629d[_0x45b1('0x31')][_0x45b1('0x32')]};});_0x4bb2da[_0x45b1('0x33')]=_[_0x45b1('0x34')](_0x1ce09b,_0x45b1('0x2b'));_0x4bb2da[_0x45b1('0x35')]=_[_0x45b1('0x36')](_0xb76e69[_0x45b1('0x35')]);_0x4bb2da[_0x45b1('0x37')]=_[_0x45b1('0x38')](_0x4bb2da['model'],_0x4bb2da['query']);_0x5993df[_0x45b1('0x39')]=_[_0x45b1('0x38')](_0x4bb2da[_0x45b1('0x33')],qs['fields'](_0xb76e69[_0x45b1('0x35')][_0x45b1('0x3a')]));_0x5993df['attributes']=_0x5993df[_0x45b1('0x39')]['length']?_0x5993df[_0x45b1('0x39')]:_0x4bb2da['model'];if(!_0xb76e69[_0x45b1('0x35')][_0x45b1('0x3b')](_0x45b1('0x3c'))){_0x5993df[_0x45b1('0x21')]=qs['limit'](_0xb76e69['query']['limit']);_0x5993df[_0x45b1('0x1f')]=qs['offset'](_0xb76e69[_0x45b1('0x35')]['offset']);}_0x5993df['order']=qs['sort'](_0xb76e69[_0x45b1('0x35')][_0x45b1('0x3d')]);_0x5993df['where']=qs[_0x45b1('0x37')](_['pick'](_0xb76e69[_0x45b1('0x35')],_0x4bb2da[_0x45b1('0x37')]),_0x1ce09b);if(_0xb76e69[_0x45b1('0x35')]['filter']){_0x5993df[_0x45b1('0x3e')]=_['merge'](_0x5993df[_0x45b1('0x3e')],{'$or':_[_0x45b1('0x34')](_0x1ce09b,function(_0x279f1e){if(_0x279f1e[_0x45b1('0x31')]!==_0x45b1('0x3f')){var _0x157105={};_0x157105[_0x279f1e[_0x45b1('0x2b')]]={'$like':'%'+_0xb76e69['query'][_0x45b1('0x40')]+'%'};return _0x157105;}})});}_0x5993df=_['merge']({},_0x5993df,_0xb76e69[_0x45b1('0x41')]);var _0xe6bf15={'where':_0x5993df['where']};return db['ChatGroup'][_0x45b1('0x22')](_0xe6bf15)['then'](function(_0xda35ca){_0x3e7c53[_0x45b1('0x22')]=_0xda35ca;if(_0xb76e69[_0x45b1('0x35')]['includeAll']){_0x5993df[_0x45b1('0x42')]=[{'all':!![]}];}return db[_0x45b1('0x2e')][_0x45b1('0x43')](_0x5993df);})[_0x45b1('0x28')](function(_0x37dbe5){_0x3e7c53[_0x45b1('0x44')]=_0x37dbe5;return _0x3e7c53;})[_0x45b1('0x28')](respondWithFilteredResult(_0x10e38e,_0x5993df))['catch'](handleError(_0x10e38e,null));};exports[_0x45b1('0x45')]=function(_0x5db9dd,_0x23b652){var _0x185be6={'raw':!![],'where':{'id':_0x5db9dd[_0x45b1('0x46')]['id']}},_0x176553={};_0x176553['model']=_[_0x45b1('0x36')](db[_0x45b1('0x2e')][_0x45b1('0x2f')]);_0x176553[_0x45b1('0x35')]=_['keys'](_0x5db9dd[_0x45b1('0x35')]);_0x176553['filters']=_[_0x45b1('0x38')](_0x176553['model'],_0x176553[_0x45b1('0x35')]);_0x185be6[_0x45b1('0x39')]=_[_0x45b1('0x38')](_0x176553['model'],qs[_0x45b1('0x3a')](_0x5db9dd[_0x45b1('0x35')][_0x45b1('0x3a')]));_0x185be6[_0x45b1('0x39')]=_0x185be6[_0x45b1('0x39')][_0x45b1('0x47')]?_0x185be6[_0x45b1('0x39')]:_0x176553['model'];if(_0x5db9dd[_0x45b1('0x35')][_0x45b1('0x48')]){_0x185be6[_0x45b1('0x42')]=[{'all':!![]}];}_0x185be6=_['merge']({},_0x185be6,_0x5db9dd['options']);return db[_0x45b1('0x2e')][_0x45b1('0x49')](_0x185be6)[_0x45b1('0x28')](handleEntityNotFound(_0x23b652,null))[_0x45b1('0x28')](respondWithResult(_0x23b652,null))['catch'](handleError(_0x23b652,null));};exports['create']=function(_0x2a979b,_0x23908e){return db[_0x45b1('0x2e')]['create'](_0x2a979b[_0x45b1('0x4a')],{})['then'](respondWithResult(_0x23908e,0xc9))['catch'](handleError(_0x23908e,null));};exports[_0x45b1('0x27')]=function(_0x2d6aca,_0x3f8328){if(_0x2d6aca[_0x45b1('0x4a')]['id']){delete _0x2d6aca[_0x45b1('0x4a')]['id'];}return db[_0x45b1('0x2e')][_0x45b1('0x49')]({'where':{'id':_0x2d6aca['params']['id']}})['then'](handleEntityNotFound(_0x3f8328,null))[_0x45b1('0x28')](saveUpdates(_0x2d6aca[_0x45b1('0x4a')],null))[_0x45b1('0x28')](respondWithResult(_0x3f8328,null))[_0x45b1('0x4b')](handleError(_0x3f8328,null));};exports[_0x45b1('0x29')]=function(_0x3a682b,_0x5f55ce){return db[_0x45b1('0x2e')][_0x45b1('0x49')]({'where':{'id':_0x3a682b['params']['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x5f55ce,null))[_0x45b1('0x28')](removeEntity(_0x5f55ce,null))[_0x45b1('0x4b')](handleError(_0x5f55ce,null));};exports[_0x45b1('0x4c')]=function(_0x5a5248,_0x5b3518){return db[_0x45b1('0x2e')][_0x45b1('0x4c')]()[_0x45b1('0x28')](respondWithResult(_0x5b3518,null))[_0x45b1('0x4b')](handleError(_0x5b3518,null));};exports[_0x45b1('0x4d')]=function(_0xfc448f,_0x115b63,_0x723e0){return db[_0x45b1('0x4e')]['count']({'where':{'ChatGroupId':_0xfc448f[_0x45b1('0x46')]['id'],'ToId':_0xfc448f[_0x45b1('0x4f')]['id'],'read':![]}})[_0x45b1('0x28')](function(_0x1aa729){return{'id':_['toInteger'](_0xfc448f['params']['id']),'count':_0x1aa729};})[_0x45b1('0x28')](respondWithResult(_0x115b63,null))['catch'](handleError(_0x115b63,null));};exports['addMembers']=function(_0x258d80,_0x3e78ee,_0xb5a8a6){return db[_0x45b1('0x2e')][_0x45b1('0x49')]({'where':{'id':_0x258d80[_0x45b1('0x46')]['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x3e78ee,null))[_0x45b1('0x28')](function(_0xb49c60){if(_0xb49c60){return _0xb49c60[_0x45b1('0x50')](_0x258d80['body'][_0x45b1('0x51')],_[_0x45b1('0x52')](_0x258d80[_0x45b1('0x4a')],[_0x45b1('0x51'),'id'])||{});}})['then'](respondWithResult(_0x3e78ee,null))[_0x45b1('0x4b')](handleError(_0x3e78ee,null));};exports[_0x45b1('0x53')]=function(_0x1cef7a,_0x4324db,_0x3a30ef){var _0x4820b6={};var _0x1b9c12={};var _0x3e3617;var _0x18dfc4;return db['ChatGroup'][_0x45b1('0x54')]({'where':{'id':_0x1cef7a['params']['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x4324db,null))[_0x45b1('0x28')](function(_0x1f18e5){if(_0x1f18e5){_0x3e3617=_0x1f18e5;_0x1b9c12[_0x45b1('0x33')]=_[_0x45b1('0x36')](db[_0x45b1('0x55')][_0x45b1('0x2f')]);_0x1b9c12[_0x45b1('0x35')]=_['keys'](_0x1cef7a[_0x45b1('0x35')]);_0x1b9c12[_0x45b1('0x37')]=_[_0x45b1('0x38')](_0x1b9c12[_0x45b1('0x33')],_0x1b9c12[_0x45b1('0x35')]);_0x4820b6['attributes']=_['intersection'](_0x1b9c12[_0x45b1('0x33')],qs[_0x45b1('0x3a')](_0x1cef7a['query'][_0x45b1('0x3a')]));_0x4820b6['attributes']=_0x4820b6[_0x45b1('0x39')][_0x45b1('0x47')]?_0x4820b6[_0x45b1('0x39')]:_0x1b9c12[_0x45b1('0x33')];_0x4820b6['order']=qs[_0x45b1('0x3d')](_0x1cef7a[_0x45b1('0x35')][_0x45b1('0x3d')]);_0x4820b6['where']=qs['filters'](_['pick'](_0x1cef7a['query'],_0x1b9c12[_0x45b1('0x37')]));if(_0x1cef7a['query']['filter']){_0x4820b6[_0x45b1('0x3e')]=_[_0x45b1('0x56')](_0x4820b6[_0x45b1('0x3e')],{'$or':_[_0x45b1('0x34')](_0x4820b6[_0x45b1('0x39')],function(_0x256a2f){var _0x4f1b4f={};_0x4f1b4f[_0x256a2f]={'$like':'%'+_0x1cef7a['query'][_0x45b1('0x40')]+'%'};return _0x4f1b4f;})});}_0x4820b6=_['merge']({},_0x4820b6,_0x1cef7a['options']);return _0x3e3617[_0x45b1('0x53')](_0x4820b6);}})[_0x45b1('0x28')](function(_0x498c63){if(_0x498c63){_0x18dfc4=_0x498c63[_0x45b1('0x47')];if(!_0x1cef7a[_0x45b1('0x35')]['hasOwnProperty'](_0x45b1('0x3c'))){_0x4820b6['limit']=qs[_0x45b1('0x21')](_0x1cef7a['query'][_0x45b1('0x21')]);_0x4820b6[_0x45b1('0x1f')]=qs[_0x45b1('0x1f')](_0x1cef7a['query'][_0x45b1('0x1f')]);}return _0x3e3617[_0x45b1('0x53')](_0x4820b6);}})['then'](function(_0x4e9e01){if(_0x4e9e01){return _0x4e9e01?{'count':_0x18dfc4,'rows':_0x4e9e01}:null;}})['then'](respondWithResult(_0x4324db,null))[_0x45b1('0x4b')](handleError(_0x4324db,null));};exports[_0x45b1('0x57')]=function(_0x265bef,_0x194929,_0x20916e){return db[_0x45b1('0x2e')][_0x45b1('0x49')]({'where':{'id':_0x265bef[_0x45b1('0x46')]['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x194929,null))[_0x45b1('0x28')](function(_0x20c0b3){if(_0x20c0b3){return _0x20c0b3[_0x45b1('0x57')](_0x265bef[_0x45b1('0x35')][_0x45b1('0x51')]);}})[_0x45b1('0x28')](respondWithStatusCode(_0x194929,null))['catch'](handleError(_0x194929,null));};exports[_0x45b1('0x58')]=function(_0x23baa2,_0x258c2c,_0x20be83){if(_0x23baa2['body']['id']){delete _0x23baa2[_0x45b1('0x4a')]['id'];}return db[_0x45b1('0x2e')][_0x45b1('0x49')]({'where':{'id':_0x23baa2['params']['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x258c2c,null))['then'](function(_0x262037){if(_0x262037){_0x23baa2[_0x45b1('0x4a')][_0x45b1('0x59')]=_0x262037['id'];return db[_0x45b1('0x4e')][_0x45b1('0x5a')](_0x23baa2[_0x45b1('0x4a')]);}})[_0x45b1('0x28')](respondWithResult(_0x258c2c,null))['catch'](handleError(_0x258c2c,null));};exports['getMessages']=function(_0x144023,_0x26bcd1,_0x37e034){var _0x6f93a6={};var _0x2cc948={};var _0x4e8b02;var _0x4522b0;return db['ChatGroup'][_0x45b1('0x54')]({'where':{'id':_0x144023[_0x45b1('0x46')]['id']}})[_0x45b1('0x28')](handleEntityNotFound(_0x26bcd1,null))[_0x45b1('0x28')](function(_0x436792){if(_0x436792){_0x4e8b02=_0x436792;_0x2cc948['model']=_[_0x45b1('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x2cc948[_0x45b1('0x35')]=_[_0x45b1('0x36')](_0x144023[_0x45b1('0x35')]);_0x2cc948[_0x45b1('0x37')]=_[_0x45b1('0x38')](_0x2cc948['model'],_0x2cc948['query']);_0x6f93a6[_0x45b1('0x39')]=_[_0x45b1('0x38')](_0x2cc948[_0x45b1('0x33')],qs[_0x45b1('0x3a')](_0x144023[_0x45b1('0x35')][_0x45b1('0x3a')]));_0x6f93a6[_0x45b1('0x39')]=_0x6f93a6[_0x45b1('0x39')][_0x45b1('0x47')]?_0x6f93a6[_0x45b1('0x39')]:_0x2cc948['model'];_0x6f93a6[_0x45b1('0x5b')]=qs[_0x45b1('0x3d')](_0x144023['query'][_0x45b1('0x3d')]);_0x6f93a6[_0x45b1('0x3e')]=qs['filters'](_[_0x45b1('0x5c')](_0x144023['query'],_0x2cc948[_0x45b1('0x37')]));if(_0x144023[_0x45b1('0x35')][_0x45b1('0x40')]){_0x6f93a6[_0x45b1('0x3e')]=_['merge'](_0x6f93a6[_0x45b1('0x3e')],{'$or':_[_0x45b1('0x34')](_0x6f93a6[_0x45b1('0x39')],function(_0x24cdb4){var _0x588f8a={};_0x588f8a[_0x24cdb4]={'$like':'%'+_0x144023['query'][_0x45b1('0x40')]+'%'};return _0x588f8a;})});}if(_0x144023[_0x45b1('0x35')][_0x45b1('0x5d')]){var _0x1824b1=_0x144023['query'][_0x45b1('0x5d')][_0x45b1('0x5e')](',');var _0x3d3482={};_0x3d3482[_0x1824b1[0x0]]={'$gte':moment(_0x1824b1[0x1])[_0x45b1('0x5f')](_0x45b1('0x60'))};_0x6f93a6['where']=_[_0x45b1('0x56')](_0x6f93a6[_0x45b1('0x3e')],_0x3d3482);}_0x6f93a6=_[_0x45b1('0x56')]({},_0x6f93a6,_0x144023[_0x45b1('0x41')]);return _0x4e8b02['getMessages'](_0x6f93a6);}})['then'](function(_0x27a212){if(_0x27a212){_0x4522b0=_0x27a212[_0x45b1('0x47')];if(!_0x144023[_0x45b1('0x35')][_0x45b1('0x3b')](_0x45b1('0x3c'))){_0x6f93a6['limit']=qs[_0x45b1('0x21')](_0x144023['query'][_0x45b1('0x21')]);_0x6f93a6[_0x45b1('0x1f')]=qs[_0x45b1('0x1f')](_0x144023[_0x45b1('0x35')]['offset']);}return _0x4e8b02['getMessages'](_0x6f93a6);}})['then'](function(_0x64d5b8){if(_0x64d5b8){return _0x64d5b8?{'count':_0x4522b0,'rows':_0x64d5b8}:null;}})[_0x45b1('0x28')](respondWithResult(_0x26bcd1,null))[_0x45b1('0x4b')](handleError(_0x26bcd1,null));}; \ No newline at end of file +var _0xbd19=['stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','getUnread','user','addMembers','omit','ids','getMembers','findOne','length','removeMembers','getMessages','ChatInternalMessage','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error'];(function(_0x4459bd,_0x46c786){var _0x30fd4b=function(_0x461456){while(--_0x461456){_0x4459bd['push'](_0x4459bd['shift']());}};_0x30fd4b(++_0x46c786);}(_0xbd19,0x8c));var _0x9bd1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbd19[_0x35da42];return _0x370035;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bd1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bd1('0x1'));var rp=require(_0x9bd1('0x2'));var moment=require(_0x9bd1('0x3'));var BPromise=require(_0x9bd1('0x4'));var Mustache=require('mustache');var util=require(_0x9bd1('0x5'));var path=require('path');var sox=require(_0x9bd1('0x6'));var csv=require(_0x9bd1('0x7'));var ejs=require(_0x9bd1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bd1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bd1('0xa'));var toCsv=require(_0x9bd1('0x7'));var querystring=require(_0x9bd1('0xb'));var Papa=require(_0x9bd1('0xc'));var Redis=require(_0x9bd1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9bd1('0xe'));var as=require(_0x9bd1('0xf'));var hardwareService=require(_0x9bd1('0x10'));var logger=require(_0x9bd1('0x11'))(_0x9bd1('0x12'));var utils=require(_0x9bd1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9bd1('0x14'))['db'];config['redis']=_[_0x9bd1('0x15')](config[_0x9bd1('0x16')],{'host':_0x9bd1('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bd1('0x16')]));require(_0x9bd1('0x18'))['register'](socket);function respondWithStatusCode(_0x25b51e,_0x312dd1){_0x312dd1=_0x312dd1||0xcc;return function(_0x3593bb){if(_0x3593bb){return _0x25b51e[_0x9bd1('0x19')](_0x312dd1);}return _0x25b51e['status'](_0x312dd1)['end']();};}function respondWithResult(_0x407c1a,_0x492474){_0x492474=_0x492474||0xc8;return function(_0xd2dab8){if(_0xd2dab8){return _0x407c1a[_0x9bd1('0x1a')](_0x492474)[_0x9bd1('0x1b')](_0xd2dab8);}};}function respondWithFilteredResult(_0x1da7f3,_0x483e6f){return function(_0x509167){if(_0x509167){var _0x1ffbd3=typeof _0x483e6f[_0x9bd1('0x1c')]==='undefined'&&typeof _0x483e6f['limit']==='undefined';var _0x3c4968=_0x509167[_0x9bd1('0x1d')];var _0x3fccc6=_0x1ffbd3?0x0:_0x483e6f[_0x9bd1('0x1c')];var _0x229dd5=_0x1ffbd3?_0x509167[_0x9bd1('0x1d')]:_0x483e6f[_0x9bd1('0x1c')]+_0x483e6f[_0x9bd1('0x1e')];var _0x57848f;if(_0x229dd5>=_0x3c4968){_0x229dd5=_0x3c4968;_0x57848f=0xc8;}else{_0x57848f=0xce;}_0x1da7f3['status'](_0x57848f);return _0x1da7f3[_0x9bd1('0x1f')](_0x9bd1('0x20'),_0x3fccc6+'-'+_0x229dd5+'/'+_0x3c4968)['json'](_0x509167);}return null;};}function patchUpdates(_0x61aa14){return function(_0x662c67){try{jsonpatch[_0x9bd1('0x21')](_0x662c67,_0x61aa14,!![]);}catch(_0x5700ec){return BPromise[_0x9bd1('0x22')](_0x5700ec);}return _0x662c67[_0x9bd1('0x23')]();};}function saveUpdates(_0x41310f,_0x4c4f64){return function(_0x4b2766){if(_0x4b2766){return _0x4b2766[_0x9bd1('0x24')](_0x41310f)['then'](function(_0x4b4bb2){return _0x4b4bb2;});}return null;};}function removeEntity(_0x5375e4,_0x184032){return function(_0x1fc6b3){if(_0x1fc6b3){return _0x1fc6b3[_0x9bd1('0x25')]()[_0x9bd1('0x26')](function(){_0x5375e4[_0x9bd1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x98f646,_0x43ba76){return function(_0x598fd1){if(!_0x598fd1){_0x98f646[_0x9bd1('0x19')](0x194);}return _0x598fd1;};}function handleError(_0xa202d,_0x287563){_0x287563=_0x287563||0x1f4;return function(_0xe0bb78){logger[_0x9bd1('0x27')](_0xe0bb78[_0x9bd1('0x28')]);if(_0xe0bb78[_0x9bd1('0x29')]){delete _0xe0bb78[_0x9bd1('0x29')];}_0xa202d[_0x9bd1('0x1a')](_0x287563)[_0x9bd1('0x2a')](_0xe0bb78);};}exports[_0x9bd1('0x2b')]=function(_0x4aabdb,_0x5d42ca){var _0x62ef82={},_0x43209e={},_0x507966={'count':0x0,'rows':[]};var _0x5c5af1=_['map'](db[_0x9bd1('0x2c')][_0x9bd1('0x2d')],function(_0x275f98){return{'name':_0x275f98[_0x9bd1('0x2e')],'type':_0x275f98['type'][_0x9bd1('0x2f')]};});_0x43209e[_0x9bd1('0x30')]=_['map'](_0x5c5af1,'name');_0x43209e[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x4aabdb['query']);_0x43209e[_0x9bd1('0x33')]=_['intersection'](_0x43209e[_0x9bd1('0x30')],_0x43209e['query']);_0x62ef82['attributes']=_[_0x9bd1('0x34')](_0x43209e[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x4aabdb['query'][_0x9bd1('0x35')]));_0x62ef82[_0x9bd1('0x36')]=_0x62ef82['attributes']['length']?_0x62ef82[_0x9bd1('0x36')]:_0x43209e['model'];if(!_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x37')](_0x9bd1('0x38'))){_0x62ef82[_0x9bd1('0x1e')]=qs[_0x9bd1('0x1e')](_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x62ef82[_0x9bd1('0x1c')]=qs['offset'](_0x4aabdb[_0x9bd1('0x31')]['offset']);}_0x62ef82[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x62ef82['where']=qs[_0x9bd1('0x33')](_[_0x9bd1('0x3b')](_0x4aabdb[_0x9bd1('0x31')],_0x43209e[_0x9bd1('0x33')]),_0x5c5af1);if(_0x4aabdb['query']['filter']){_0x62ef82[_0x9bd1('0x3c')]=_[_0x9bd1('0x3d')](_0x62ef82[_0x9bd1('0x3c')],{'$or':_[_0x9bd1('0x3e')](_0x5c5af1,function(_0x3d78c2){if(_0x3d78c2[_0x9bd1('0x3f')]!==_0x9bd1('0x40')){var _0xdfad9f={};_0xdfad9f[_0x3d78c2['name']]={'$like':'%'+_0x4aabdb['query'][_0x9bd1('0x41')]+'%'};return _0xdfad9f;}})});}_0x62ef82=_[_0x9bd1('0x3d')]({},_0x62ef82,_0x4aabdb[_0x9bd1('0x42')]);var _0x5d24a4={'where':_0x62ef82[_0x9bd1('0x3c')]};return db[_0x9bd1('0x2c')][_0x9bd1('0x1d')](_0x5d24a4)['then'](function(_0x302503){_0x507966[_0x9bd1('0x1d')]=_0x302503;if(_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x43')]){_0x62ef82[_0x9bd1('0x44')]=[{'all':!![]}];}return db[_0x9bd1('0x2c')][_0x9bd1('0x45')](_0x62ef82);})['then'](function(_0x46d26b){_0x507966[_0x9bd1('0x46')]=_0x46d26b;return _0x507966;})['then'](respondWithFilteredResult(_0x5d42ca,_0x62ef82))[_0x9bd1('0x47')](handleError(_0x5d42ca,null));};exports['show']=function(_0x5ed7e9,_0x233fe7){var _0x46f695={'raw':!![],'where':{'id':_0x5ed7e9['params']['id']}},_0x522de7={};_0x522de7[_0x9bd1('0x30')]=_[_0x9bd1('0x32')](db[_0x9bd1('0x2c')][_0x9bd1('0x2d')]);_0x522de7[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x5ed7e9[_0x9bd1('0x31')]);_0x522de7[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x522de7[_0x9bd1('0x30')],_0x522de7[_0x9bd1('0x31')]);_0x46f695[_0x9bd1('0x36')]=_[_0x9bd1('0x34')](_0x522de7[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x5ed7e9['query'][_0x9bd1('0x35')]));_0x46f695['attributes']=_0x46f695['attributes']['length']?_0x46f695[_0x9bd1('0x36')]:_0x522de7[_0x9bd1('0x30')];if(_0x5ed7e9[_0x9bd1('0x31')]['includeAll']){_0x46f695[_0x9bd1('0x44')]=[{'all':!![]}];}_0x46f695=_[_0x9bd1('0x3d')]({},_0x46f695,_0x5ed7e9[_0x9bd1('0x42')]);return db['ChatGroup'][_0x9bd1('0x48')](_0x46f695)[_0x9bd1('0x26')](handleEntityNotFound(_0x233fe7,null))[_0x9bd1('0x26')](respondWithResult(_0x233fe7,null))['catch'](handleError(_0x233fe7,null));};exports['create']=function(_0x24c676,_0x54c120){return db[_0x9bd1('0x2c')][_0x9bd1('0x49')](_0x24c676['body'],{})[_0x9bd1('0x26')](respondWithResult(_0x54c120,0xc9))[_0x9bd1('0x47')](handleError(_0x54c120,null));};exports[_0x9bd1('0x24')]=function(_0x3307f8,_0x2af2fc){if(_0x3307f8['body']['id']){delete _0x3307f8[_0x9bd1('0x4a')]['id'];}return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x3307f8[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x2af2fc,null))[_0x9bd1('0x26')](saveUpdates(_0x3307f8[_0x9bd1('0x4a')],null))[_0x9bd1('0x26')](respondWithResult(_0x2af2fc,null))[_0x9bd1('0x47')](handleError(_0x2af2fc,null));};exports['destroy']=function(_0x1b560c,_0x58c1b2){return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x1b560c[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58c1b2,null))[_0x9bd1('0x26')](removeEntity(_0x58c1b2,null))[_0x9bd1('0x47')](handleError(_0x58c1b2,null));};exports[_0x9bd1('0x4c')]=function(_0x380279,_0x559395){return db[_0x9bd1('0x2c')][_0x9bd1('0x4c')]()[_0x9bd1('0x26')](respondWithResult(_0x559395,null))[_0x9bd1('0x47')](handleError(_0x559395,null));};exports[_0x9bd1('0x4d')]=function(_0x2aca7a,_0x454feb,_0x5b2adc){return db['ChatInternalMessage'][_0x9bd1('0x1d')]({'where':{'ChatGroupId':_0x2aca7a[_0x9bd1('0x4b')]['id'],'ToId':_0x2aca7a[_0x9bd1('0x4e')]['id'],'read':![]}})[_0x9bd1('0x26')](function(_0x1f3eb7){return{'id':_['toInteger'](_0x2aca7a[_0x9bd1('0x4b')]['id']),'count':_0x1f3eb7};})[_0x9bd1('0x26')](respondWithResult(_0x454feb,null))['catch'](handleError(_0x454feb,null));};exports[_0x9bd1('0x4f')]=function(_0x578aa9,_0x1f888f,_0x2ef8c6){return db[_0x9bd1('0x2c')][_0x9bd1('0x48')]({'where':{'id':_0x578aa9[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x1f888f,null))[_0x9bd1('0x26')](function(_0x407e20){if(_0x407e20){return _0x407e20[_0x9bd1('0x4f')](_0x578aa9[_0x9bd1('0x4a')]['ids'],_[_0x9bd1('0x50')](_0x578aa9['body'],[_0x9bd1('0x51'),'id'])||{});}})[_0x9bd1('0x26')](respondWithResult(_0x1f888f,null))[_0x9bd1('0x47')](handleError(_0x1f888f,null));};exports[_0x9bd1('0x52')]=function(_0x1f49ad,_0x4af848,_0x4ede62){var _0x2080df={};var _0x39d2b6={};var _0x36c2a2;var _0x520193;return db[_0x9bd1('0x2c')][_0x9bd1('0x53')]({'where':{'id':_0x1f49ad[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x4af848,null))[_0x9bd1('0x26')](function(_0x549a33){if(_0x549a33){_0x36c2a2=_0x549a33;_0x39d2b6['model']=_[_0x9bd1('0x32')](db['User'][_0x9bd1('0x2d')]);_0x39d2b6[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x1f49ad[_0x9bd1('0x31')]);_0x39d2b6[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x39d2b6[_0x9bd1('0x30')],_0x39d2b6[_0x9bd1('0x31')]);_0x2080df[_0x9bd1('0x36')]=_[_0x9bd1('0x34')](_0x39d2b6[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x35')]));_0x2080df[_0x9bd1('0x36')]=_0x2080df[_0x9bd1('0x36')][_0x9bd1('0x54')]?_0x2080df[_0x9bd1('0x36')]:_0x39d2b6['model'];_0x2080df[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x2080df[_0x9bd1('0x3c')]=qs[_0x9bd1('0x33')](_[_0x9bd1('0x3b')](_0x1f49ad[_0x9bd1('0x31')],_0x39d2b6[_0x9bd1('0x33')]));if(_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x41')]){_0x2080df[_0x9bd1('0x3c')]=_[_0x9bd1('0x3d')](_0x2080df[_0x9bd1('0x3c')],{'$or':_['map'](_0x2080df[_0x9bd1('0x36')],function(_0x4a1513){var _0x53230a={};_0x53230a[_0x4a1513]={'$like':'%'+_0x1f49ad['query'][_0x9bd1('0x41')]+'%'};return _0x53230a;})});}_0x2080df=_[_0x9bd1('0x3d')]({},_0x2080df,_0x1f49ad[_0x9bd1('0x42')]);return _0x36c2a2[_0x9bd1('0x52')](_0x2080df);}})[_0x9bd1('0x26')](function(_0x2e1312){if(_0x2e1312){_0x520193=_0x2e1312['length'];if(!_0x1f49ad[_0x9bd1('0x31')]['hasOwnProperty']('nolimit')){_0x2080df['limit']=qs[_0x9bd1('0x1e')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x2080df['offset']=qs[_0x9bd1('0x1c')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x1c')]);}return _0x36c2a2[_0x9bd1('0x52')](_0x2080df);}})[_0x9bd1('0x26')](function(_0x4c8c90){if(_0x4c8c90){return _0x4c8c90?{'count':_0x520193,'rows':_0x4c8c90}:null;}})[_0x9bd1('0x26')](respondWithResult(_0x4af848,null))['catch'](handleError(_0x4af848,null));};exports[_0x9bd1('0x55')]=function(_0x323f87,_0x4c4e60,_0x49853f){return db[_0x9bd1('0x2c')][_0x9bd1('0x48')]({'where':{'id':_0x323f87[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c4e60,null))['then'](function(_0x1735c3){if(_0x1735c3){return _0x1735c3[_0x9bd1('0x55')](_0x323f87[_0x9bd1('0x31')][_0x9bd1('0x51')]);}})[_0x9bd1('0x26')](respondWithStatusCode(_0x4c4e60,null))[_0x9bd1('0x47')](handleError(_0x4c4e60,null));};exports['addMessage']=function(_0x3c7d33,_0x45d1,_0x4335fe){if(_0x3c7d33[_0x9bd1('0x4a')]['id']){delete _0x3c7d33[_0x9bd1('0x4a')]['id'];}return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x3c7d33[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45d1,null))[_0x9bd1('0x26')](function(_0x361ba5){if(_0x361ba5){_0x3c7d33[_0x9bd1('0x4a')]['ChatGroupId']=_0x361ba5['id'];return db['ChatInternalMessage'][_0x9bd1('0x49')](_0x3c7d33['body']);}})[_0x9bd1('0x26')](respondWithResult(_0x45d1,null))[_0x9bd1('0x47')](handleError(_0x45d1,null));};exports[_0x9bd1('0x56')]=function(_0x2b1ce1,_0x104db1,_0x5b40ce){var _0x20392e={};var _0x324cef={};var _0x461444;var _0x1783c5;return db[_0x9bd1('0x2c')]['findOne']({'where':{'id':_0x2b1ce1[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x104db1,null))[_0x9bd1('0x26')](function(_0x501da5){if(_0x501da5){_0x461444=_0x501da5;_0x324cef[_0x9bd1('0x30')]=_['keys'](db[_0x9bd1('0x57')]['rawAttributes']);_0x324cef['query']=_['keys'](_0x2b1ce1[_0x9bd1('0x31')]);_0x324cef[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x324cef[_0x9bd1('0x30')],_0x324cef[_0x9bd1('0x31')]);_0x20392e['attributes']=_[_0x9bd1('0x34')](_0x324cef['model'],qs[_0x9bd1('0x35')](_0x2b1ce1['query'][_0x9bd1('0x35')]));_0x20392e[_0x9bd1('0x36')]=_0x20392e[_0x9bd1('0x36')][_0x9bd1('0x54')]?_0x20392e[_0x9bd1('0x36')]:_0x324cef[_0x9bd1('0x30')];_0x20392e[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x20392e[_0x9bd1('0x3c')]=qs[_0x9bd1('0x33')](_['pick'](_0x2b1ce1[_0x9bd1('0x31')],_0x324cef[_0x9bd1('0x33')]));if(_0x2b1ce1['query'][_0x9bd1('0x41')]){_0x20392e['where']=_[_0x9bd1('0x3d')](_0x20392e['where'],{'$or':_[_0x9bd1('0x3e')](_0x20392e[_0x9bd1('0x36')],function(_0x120416){var _0x2a0ba2={};_0x2a0ba2[_0x120416]={'$like':'%'+_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x41')]+'%'};return _0x2a0ba2;})});}if(_0x2b1ce1['query']['$gte']){var _0x2c1f6c=_0x2b1ce1[_0x9bd1('0x31')]['$gte'][_0x9bd1('0x58')](',');var _0x4f165f={};_0x4f165f[_0x2c1f6c[0x0]]={'$gte':moment(_0x2c1f6c[0x1])['format'](_0x9bd1('0x59'))};_0x20392e[_0x9bd1('0x3c')]=_['merge'](_0x20392e[_0x9bd1('0x3c')],_0x4f165f);}_0x20392e=_[_0x9bd1('0x3d')]({},_0x20392e,_0x2b1ce1['options']);return _0x461444['getMessages'](_0x20392e);}})[_0x9bd1('0x26')](function(_0x560710){if(_0x560710){_0x1783c5=_0x560710[_0x9bd1('0x54')];if(!_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x37')](_0x9bd1('0x38'))){_0x20392e['limit']=qs[_0x9bd1('0x1e')](_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x20392e[_0x9bd1('0x1c')]=qs[_0x9bd1('0x1c')](_0x2b1ce1['query']['offset']);}return _0x461444['getMessages'](_0x20392e);}})[_0x9bd1('0x26')](function(_0x2d2b77){if(_0x2d2b77){return _0x2d2b77?{'count':_0x1783c5,'rows':_0x2d2b77}:null;}})[_0x9bd1('0x26')](respondWithResult(_0x104db1,null))[_0x9bd1('0x47')](handleError(_0x104db1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3c8b3ae..bc2b6cd 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 _0xc3ed=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2d2257,_0x4224c8){var _0x2f17c5=function(_0x4082dc){while(--_0x4082dc){_0x2d2257['push'](_0x2d2257['shift']());}};_0x2f17c5(++_0x4224c8);}(_0xc3ed,0x111));var _0xdc3e=function(_0x30eb5b,_0x234476){_0x30eb5b=_0x30eb5b-0x0;var _0x559d73=_0xc3ed[_0x30eb5b];return _0x559d73;};'use strict';var EventEmitter=require(_0xdc3e('0x0'));var ChatGroup=require(_0xdc3e('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xdc3e('0x2')](0x0);var events={'afterCreate':_0xdc3e('0x3'),'afterUpdate':_0xdc3e('0x4'),'afterDestroy':_0xdc3e('0x5')};function emitEvent(_0x1af61c){return function(_0x55ffdd,_0x278702,_0x5922b7){ChatGroupEvents[_0xdc3e('0x6')](_0x1af61c+':'+_0x55ffdd['id'],_0x55ffdd);ChatGroupEvents[_0xdc3e('0x6')](_0x1af61c,_0x55ffdd);_0x5922b7(null);};}for(var e in events){if(events[_0xdc3e('0x7')](e)){var event=events[e];ChatGroup[_0xdc3e('0x8')](e,emitEvent(event));}}module[_0xdc3e('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x8294=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x2fcd0c,_0x3fe101){var _0x19c93d=function(_0xd2faae){while(--_0xd2faae){_0x2fcd0c['push'](_0x2fcd0c['shift']());}};_0x19c93d(++_0x3fe101);}(_0x8294,0x1c6));var _0x4829=function(_0x706786,_0x53f40f){_0x706786=_0x706786-0x0;var _0x10d2ae=_0x8294[_0x706786];return _0x10d2ae;};'use strict';var EventEmitter=require(_0x4829('0x0'));var ChatGroup=require(_0x4829('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4829('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4829('0x3')};function emitEvent(_0x31c3ac){return function(_0x27a714,_0x494a7d,_0x1cbde3){ChatGroupEvents['emit'](_0x31c3ac+':'+_0x27a714['id'],_0x27a714);ChatGroupEvents[_0x4829('0x4')](_0x31c3ac,_0x27a714);_0x1cbde3(null);};}for(var e in events){if(events[_0x4829('0x5')](e)){var event=events[e];ChatGroup[_0x4829('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 76a3aee..43fa024 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 _0x52a5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util','../../config/logger'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0x52a5,0x1ec));var _0x552a=function(_0x414144,_0x4e5ad1){_0x414144=_0x414144-0x0;var _0x390244=_0x52a5[_0x414144];return _0x390244;};'use strict';var _=require('lodash');var util=require(_0x552a('0x0'));var logger=require(_0x552a('0x1'))(_0x552a('0x2'));var moment=require(_0x552a('0x3'));var BPromise=require(_0x552a('0x4'));var rp=require(_0x552a('0x5'));var fs=require('fs');var path=require(_0x552a('0x6'));var rimraf=require(_0x552a('0x7'));var config=require(_0x552a('0x8'));var attributes=require(_0x552a('0x9'));module[_0x552a('0xa')]=function(_0x30df91,_0x352bb0){return _0x30df91[_0x552a('0xb')]('ChatGroup',attributes,{'tableName':_0x552a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7915=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define'];(function(_0x236e72,_0x2199d9){var _0x57b4a8=function(_0x4522d8){while(--_0x4522d8){_0x236e72['push'](_0x236e72['shift']());}};_0x57b4a8(++_0x2199d9);}(_0x7915,0x128));var _0x5791=function(_0x3d2b6d,_0x1c710e){_0x3d2b6d=_0x3d2b6d-0x0;var _0x268764=_0x7915[_0x3d2b6d];return _0x268764;};'use strict';var _=require(_0x5791('0x0'));var util=require(_0x5791('0x1'));var logger=require(_0x5791('0x2'))(_0x5791('0x3'));var moment=require(_0x5791('0x4'));var BPromise=require(_0x5791('0x5'));var rp=require(_0x5791('0x6'));var fs=require('fs');var path=require(_0x5791('0x7'));var rimraf=require(_0x5791('0x8'));var config=require('../../config/environment');var attributes=require(_0x5791('0x9'));module[_0x5791('0xa')]=function(_0x549311,_0x3a13dd){return _0x549311[_0x5791('0xb')](_0x5791('0xc'),attributes,{'tableName':_0x5791('0xd'),'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 1d4fa5f..3f6e71d 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 _0x7e63=['http','redis','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7e63,0x74));var _0x37e6=function(_0x573482,_0x59b12d){_0x573482=_0x573482-0x0;var _0x23998e=_0x7e63[_0x573482];return _0x23998e;};'use strict';var _=require(_0x37e6('0x0'));var util=require(_0x37e6('0x1'));var moment=require(_0x37e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x37e6('0x3'));var fs=require('fs');var Redis=require(_0x37e6('0x4'));var db=require(_0x37e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37e6('0x6'))(_0x37e6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37e6('0x8')][_0x37e6('0x9')]({'port':0x232a});config[_0x37e6('0xa')]=_['defaults'](config[_0x37e6('0xa')],{'host':_0x37e6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37e6('0xa')]));require(_0x37e6('0xc'))[_0x37e6('0xd')](socket);function respondWithRpcPromise(_0xfdc255,_0x5ea219,_0x676035){return new BPromise(function(_0x1f5d30,_0x10eb16){return client['request'](_0xfdc255,_0x676035)[_0x37e6('0xe')](function(_0x3f3158){logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));logger[_0x37e6('0x12')](_0x37e6('0x13'),_0x5ea219,_0x37e6('0x11'),JSON[_0x37e6('0x14')](_0x3f3158));if(_0x3f3158[_0x37e6('0x15')]){if(_0x3f3158[_0x37e6('0x15')]['code']===0x1f4){logger[_0x37e6('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158['error'][_0x37e6('0x16')]);return _0x10eb16(_0x3f3158['error'][_0x37e6('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158[_0x37e6('0x15')][_0x37e6('0x16')]);return _0x1f5d30(_0x3f3158[_0x37e6('0x15')]['message']);}else{logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));_0x1f5d30(_0x3f3158[_0x37e6('0x17')][_0x37e6('0x16')]);}})[_0x37e6('0x18')](function(_0x3cfebd){logger[_0x37e6('0x15')](_0x37e6('0x10'),_0x5ea219,_0x3cfebd);_0x10eb16(_0x3cfebd);});});} \ No newline at end of file +var _0xe5f7=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0xb9333c,_0x258707){var _0x4eecdc=function(_0x34569b){while(--_0x34569b){_0xb9333c['push'](_0xb9333c['shift']());}};_0x4eecdc(++_0x258707);}(_0xe5f7,0x178));var _0x7e5f=function(_0x5c2d47,_0x393371){_0x5c2d47=_0x5c2d47-0x0;var _0x222d7a=_0xe5f7[_0x5c2d47];return _0x222d7a;};'use strict';var _=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var moment=require(_0x7e5f('0x2'));var BPromise=require(_0x7e5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e5f('0x4'))['db'];var utils=require(_0x7e5f('0x5'));var logger=require(_0x7e5f('0x6'))('rpc');var config=require(_0x7e5f('0x7'));var jayson=require(_0x7e5f('0x8'));var client=jayson['client'][_0x7e5f('0x9')]({'port':0x232a});config[_0x7e5f('0xa')]=_[_0x7e5f('0xb')](config[_0x7e5f('0xa')],{'host':_0x7e5f('0xc'),'port':0x18eb});var socket=require(_0x7e5f('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x7e5f('0xe')](socket);function respondWithRpcPromise(_0x1fec12,_0x313706,_0x1900d8){return new BPromise(function(_0x3844af,_0x218e50){return client[_0x7e5f('0xf')](_0x1fec12,_0x1900d8)[_0x7e5f('0x10')](function(_0x23a476){logger[_0x7e5f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x313706,_0x7e5f('0x12'));logger['debug'](_0x7e5f('0x13'),_0x313706,_0x7e5f('0x12'),JSON[_0x7e5f('0x14')](_0x23a476));if(_0x23a476[_0x7e5f('0x15')]){if(_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x16')]===0x1f4){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x18')]);return _0x218e50(_0x23a476['error'][_0x7e5f('0x18')]);}logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')]['message']);return _0x3844af(_0x23a476['error']['message']);}else{logger[_0x7e5f('0x11')](_0x7e5f('0x17'),_0x313706,'request\x20sent');_0x3844af(_0x23a476[_0x7e5f('0x19')][_0x7e5f('0x18')]);}})[_0x7e5f('0x1a')](function(_0xd97c29){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0xd97c29);_0x218e50(_0xd97c29);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f0ef037..ae82024 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 _0x0fc7=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','emit'];(function(_0x498e97,_0x5d465e){var _0x15b65d=function(_0x423411){while(--_0x423411){_0x498e97['push'](_0x498e97['shift']());}};_0x15b65d(++_0x5d465e);}(_0x0fc7,0xf8));var _0x70fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fc7[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require(_0x70fc('0x0'));var events=[_0x70fc('0x1'),_0x70fc('0x2'),'update'];function createListener(_0x11b12d,_0x243349){return function(_0x1b6e16){_0x243349[_0x70fc('0x3')](_0x11b12d,_0x1b6e16);};}function removeListener(_0x1981f9,_0x2e5314){return function(){ChatGroupEvents[_0x70fc('0x4')](_0x1981f9,_0x2e5314);};}exports['register']=function(_0x3f2936){for(var _0x281ae6=0x0,_0x3e9c0c=events[_0x70fc('0x5')];_0x281ae6<_0x3e9c0c;_0x281ae6++){var _0xe8d81d=events[_0x281ae6];var _0x476ea3=createListener(_0x70fc('0x6')+_0xe8d81d,_0x3f2936);ChatGroupEvents['on'](_0xe8d81d,_0x476ea3);}}; \ No newline at end of file +var _0x49a3=['chatGroup:','./chatGroup.events','save','remove','removeListener'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x49a3,0x114));var _0x349a=function(_0x499abc,_0x31a2dc){_0x499abc=_0x499abc-0x0;var _0x48d808=_0x49a3[_0x499abc];return _0x48d808;};'use strict';var ChatGroupEvents=require(_0x349a('0x0'));var events=[_0x349a('0x1'),_0x349a('0x2'),'update'];function createListener(_0x31e583,_0x5490cc){return function(_0x4453f6){_0x5490cc['emit'](_0x31e583,_0x4453f6);};}function removeListener(_0x40b1f4,_0x5cf0a7){return function(){ChatGroupEvents[_0x349a('0x3')](_0x40b1f4,_0x5cf0a7);};}exports['register']=function(_0x155770){for(var _0x2078d3=0x0,_0x142b72=events['length'];_0x2078d3<_0x142b72;_0x2078d3++){var _0xca9e1d=events[_0x2078d3];var _0xd206d5=createListener(_0x349a('0x4')+_0xca9e1d,_0x155770);ChatGroupEvents['on'](_0xca9e1d,_0xd206d5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e5728ea..4be05b0 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 _0x2ac5=['connect-timeout','Router','fs-extra','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','util','path'];(function(_0x575195,_0x408116){var _0x594e25=function(_0x552b54){while(--_0x552b54){_0x575195['push'](_0x575195['shift']());}};_0x594e25(++_0x408116);}(_0x2ac5,0xf9));var _0x52ac=function(_0xa087f5,_0x34fd10){_0xa087f5=_0xa087f5-0x0;var _0x4c8806=_0x2ac5[_0xa087f5];return _0x4c8806;};'use strict';var multer=require(_0x52ac('0x0'));var util=require(_0x52ac('0x1'));var path=require(_0x52ac('0x2'));var timeout=require(_0x52ac('0x3'));var express=require('express');var router=express[_0x52ac('0x4')]();var fs_extra=require(_0x52ac('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x52ac('0x6'));var controller=require(_0x52ac('0x7'));router[_0x52ac('0x8')]('/',auth[_0x52ac('0x9')](),controller[_0x52ac('0xa')]);router[_0x52ac('0x8')](_0x52ac('0xb'),auth[_0x52ac('0x9')](),controller[_0x52ac('0xc')]);router['get'](_0x52ac('0xd'),auth[_0x52ac('0x9')](),controller['show']);router[_0x52ac('0x8')]('/:id/unread',auth[_0x52ac('0x9')](),controller[_0x52ac('0xe')]);router[_0x52ac('0x8')](_0x52ac('0xf'),auth['isAuthenticated'](),controller[_0x52ac('0x10')]);router[_0x52ac('0x8')](_0x52ac('0x11'),auth[_0x52ac('0x9')](),controller[_0x52ac('0x12')]);router[_0x52ac('0x13')]('/',auth['isAuthenticated'](),controller[_0x52ac('0x14')]);router[_0x52ac('0x13')](_0x52ac('0xf'),auth[_0x52ac('0x9')](),controller[_0x52ac('0x15')]);router[_0x52ac('0x13')](_0x52ac('0x11'),auth[_0x52ac('0x9')](),controller[_0x52ac('0x16')]);router[_0x52ac('0x17')](_0x52ac('0xd'),auth[_0x52ac('0x9')](),controller[_0x52ac('0x18')]);router[_0x52ac('0x19')]('/:id',auth[_0x52ac('0x9')](),controller['destroy']);router['delete'](_0x52ac('0xf'),auth[_0x52ac('0x9')](),controller[_0x52ac('0x1a')]);module[_0x52ac('0x1b')]=router; \ No newline at end of file +var _0xbd01=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','update','delete','removeMembers','exports','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x168d88,_0x2c98c7){var _0x457997=function(_0x47d725){while(--_0x47d725){_0x168d88['push'](_0x168d88['shift']());}};_0x457997(++_0x2c98c7);}(_0xbd01,0xaa));var _0x1bd0=function(_0x524b15,_0x51c457){_0x524b15=_0x524b15-0x0;var _0x28bdef=_0xbd01[_0x524b15];return _0x28bdef;};'use strict';var multer=require('multer');var util=require(_0x1bd0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1bd0('0x1'));var router=express[_0x1bd0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1bd0('0x3'));var interaction=require(_0x1bd0('0x4'));var config=require(_0x1bd0('0x5'));var controller=require(_0x1bd0('0x6'));router[_0x1bd0('0x7')]('/',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x9')]);router[_0x1bd0('0x7')]('/describe',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0xa')]);router[_0x1bd0('0x7')](_0x1bd0('0xb'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0xc')]);router[_0x1bd0('0x7')](_0x1bd0('0xd'),auth['isAuthenticated'](),controller[_0x1bd0('0xe')]);router[_0x1bd0('0x7')](_0x1bd0('0xf'),auth[_0x1bd0('0x8')](),controller['getMembers']);router[_0x1bd0('0x7')](_0x1bd0('0x10'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1bd0('0x12')]);router[_0x1bd0('0x13')](_0x1bd0('0xf'),auth['isAuthenticated'](),controller[_0x1bd0('0x14')]);router[_0x1bd0('0x13')]('/:id/messages',auth[_0x1bd0('0x8')](),controller['addMessage']);router['put'](_0x1bd0('0xb'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x15')]);router[_0x1bd0('0x16')](_0x1bd0('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x17')]);module[_0x1bd0('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 942efc4..03b6586 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 _0xf6e8=['STRING','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x4d89cd,_0x7d6541){var _0x319090=function(_0x643897){while(--_0x643897){_0x4d89cd['push'](_0x4d89cd['shift']());}};_0x319090(++_0x7d6541);}(_0xf6e8,0xc1));var _0x8f6e=function(_0xaa4461,_0xbf37b5){_0xaa4461=_0xaa4461-0x0;var _0x14d128=_0xf6e8[_0xaa4461];return _0x14d128;};'use strict';var Sequelize=require('sequelize');module[_0x8f6e('0x0')]={'closed':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8f6e('0x2')]},'ratingType':{'type':Sequelize[_0x8f6e('0x3')](_0x8f6e('0x4'),_0x8f6e('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8f6e('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8f6e('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8f6e('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8f6e('0x7')]},'thirdDisposition':{'type':Sequelize[_0x8f6e('0x7')]},'note':{'type':Sequelize[_0x8f6e('0x7')]},'browserName':{'type':Sequelize[_0x8f6e('0x7')]},'browserVersion':{'type':Sequelize[_0x8f6e('0x7')]},'osName':{'type':Sequelize[_0x8f6e('0x7')]},'osVersion':{'type':Sequelize[_0x8f6e('0x7')]},'deviceModel':{'type':Sequelize[_0x8f6e('0x7')]},'deviceVendor':{'type':Sequelize[_0x8f6e('0x7')]},'deviceType':{'type':Sequelize[_0x8f6e('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8f6e('0x7')]},'formData':{'type':Sequelize[_0x8f6e('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x8f6e('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8f6e('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x8f6e('0x3')]('in',_0x8f6e('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8f6e('0x7')]},'customerPort':{'type':Sequelize[_0x8f6e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x8f6e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x777d=['ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','STRING','TEXT','long','DATE'];(function(_0x31ed51,_0x346405){var _0x257c83=function(_0x47aa99){while(--_0x47aa99){_0x31ed51['push'](_0x31ed51['shift']());}};_0x257c83(++_0x346405);}(_0x777d,0xe9));var _0xd777=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x777d[_0x571a17];return _0x3ef337;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'closed':{'type':Sequelize[_0xd777('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd777('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xd777('0x3'),_0xd777('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xd777('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd777('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd777('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd777('0x5')]},'osVersion':{'type':Sequelize[_0xd777('0x5')]},'deviceModel':{'type':Sequelize[_0xd777('0x5')]},'deviceVendor':{'type':Sequelize[_0xd777('0x5')]},'deviceType':{'type':Sequelize[_0xd777('0x5')]},'referer':{'type':Sequelize[_0xd777('0x6')]},'customerIp':{'type':Sequelize[_0xd777('0x5')]},'formData':{'type':Sequelize[_0xd777('0x6')](_0xd777('0x7'))},'read1stAt':{'type':Sequelize[_0xd777('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd777('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xd777('0x9')]('in',_0xd777('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd777('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index e12ca0d..d870f72 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 _0x3279=['downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','update','stack','send','render','merge','body','contact','agent','interaction','account','Users','fullname','Tags','TagIds','split','forEach','catch','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','ChatInteraction','rawAttributes','fieldName','key','model','name','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','tools_tags','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','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','find','having','`\x20>\x200','Contact','operator','$substring','value','length','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','map','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Unauthorized','Attachment','findOne','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','mailTranscript','format','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','includeAgent','addTags','setTags','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','Owner','N.A.','closedAt','browserName','osName','referer','customerPort','tail','pipe','createWriteStream','renderFile'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x3279,0x13c));var _0x9327=function(_0x58a6a6,_0x268798){_0x58a6a6=_0x58a6a6-0x0;var _0x279b48=_0x3279[_0x58a6a6];return _0x279b48;};'use strict';var rimraf=require(_0x9327('0x0'));var zipdir=require(_0x9327('0x1'));var rp=require('request-promise');var moment=require(_0x9327('0x2'));var BPromise=require(_0x9327('0x3'));var Mustache=require(_0x9327('0x4'));var util=require(_0x9327('0x5'));var path=require(_0x9327('0x6'));var ejs=require(_0x9327('0x7'));var fs=require('fs');var _=require(_0x9327('0x8'));var squel=require(_0x9327('0x9'));var Redis=require(_0x9327('0xa'));var qs=require(_0x9327('0xb'));var as=require(_0x9327('0xc'));var pdf=require('../../components/export/pdf');var logger=require(_0x9327('0xd'))(_0x9327('0xe'));var config=require(_0x9327('0xf'));var db=require(_0x9327('0x10'))['db'];config[_0x9327('0x11')]=_[_0x9327('0x12')](config[_0x9327('0x11')],{'host':_0x9327('0x13'),'port':0x18eb});var socket=require(_0x9327('0x14'))(new Redis(config[_0x9327('0x11')]));require(_0x9327('0x15'))[_0x9327('0x16')](socket);var jayson=require(_0x9327('0x17'));var client=jayson[_0x9327('0x18')][_0x9327('0x19')]({'port':0x232b});var client9004=jayson['client'][_0x9327('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x1b4627,_0xc6fade,_0x3fc89a,_0xfad334){return new BPromise(function(_0x14007f,_0xd86cdd){var _0x60dbd8=_0xfad334||client;return _0x60dbd8[_0x9327('0x1a')](_0x1b4627,_0x3fc89a)[_0x9327('0x1b')](function(_0x4f2227){logger[_0x9327('0x1c')](_0x9327('0x1d'),_0xc6fade,_0x9327('0x1e'));logger[_0x9327('0x1f')](_0x9327('0x20'),_0xc6fade,_0x9327('0x1e'),JSON['stringify'](_0x4f2227));if(_0x4f2227[_0x9327('0x21')]){if(_0x4f2227['error']['code']===0x1f4){logger[_0x9327('0x21')]('ChatInteraction,\x20%s,\x20%s',_0xc6fade,_0x4f2227[_0x9327('0x21')][_0x9327('0x22')]);return _0xd86cdd(_0x4f2227[_0x9327('0x21')][_0x9327('0x22')]);}logger[_0x9327('0x21')](_0x9327('0x1d'),_0xc6fade,_0x4f2227[_0x9327('0x21')][_0x9327('0x22')]);return _0x14007f(_0x4f2227[_0x9327('0x21')][_0x9327('0x22')]);}else{logger[_0x9327('0x1c')](_0x9327('0x1d'),_0xc6fade,_0x9327('0x1e'));_0x14007f(_0x4f2227[_0x9327('0x23')][_0x9327('0x22')]);}})['catch'](function(_0x2bcd17){logger[_0x9327('0x21')]('ChatInteraction,\x20%s,\x20%s',_0xc6fade,_0x2bcd17);_0xd86cdd(_0x2bcd17);});});}function respondWithStatusCode(_0x25813b,_0x2b5ee8){_0x2b5ee8=_0x2b5ee8||0xcc;return function(_0x405cf0){if(_0x405cf0){return _0x25813b[_0x9327('0x24')](_0x2b5ee8);}return _0x25813b['status'](_0x2b5ee8)[_0x9327('0x25')]();};}function respondWithResult(_0x357afc,_0x4c7aaf){_0x4c7aaf=_0x4c7aaf||0xc8;return function(_0x165f8f){if(_0x165f8f){return _0x357afc[_0x9327('0x26')](_0x4c7aaf)[_0x9327('0x27')](_0x165f8f);}};}function respondWithFilteredResult(_0x3a22e0,_0x418359){return function(_0x2b70ed){if(_0x2b70ed){var _0x34aa4f=typeof _0x418359[_0x9327('0x28')]===_0x9327('0x29')&&typeof _0x418359[_0x9327('0x2a')]===_0x9327('0x29');var _0x56299c=_0x2b70ed[_0x9327('0x2b')];var _0x4789a1=_0x34aa4f?0x0:_0x418359[_0x9327('0x28')];var _0x2fdd47=_0x34aa4f?_0x2b70ed['count']:_0x418359[_0x9327('0x28')]+_0x418359['limit'];var _0x441fd4;if(_0x2fdd47>=_0x56299c){_0x2fdd47=_0x56299c;_0x441fd4=0xc8;}else{_0x441fd4=0xce;}_0x3a22e0[_0x9327('0x26')](_0x441fd4);return _0x3a22e0[_0x9327('0x2c')]('Content-Range',_0x4789a1+'-'+_0x2fdd47+'/'+_0x56299c)['json'](_0x2b70ed);}return null;};}function saveUpdates(_0x22a268){return function(_0xcd3560){if(_0xcd3560){return _0xcd3560[_0x9327('0x2d')](_0x22a268)[_0x9327('0x1b')](function(_0x538ca0){return _0x538ca0;});}return null;};}function removeEntity(_0x1339e2){return function(_0x368f68){if(_0x368f68){return _0x368f68['destroy']()[_0x9327('0x1b')](function(){_0x1339e2[_0x9327('0x26')](0xcc)[_0x9327('0x25')]();});}};}function handleEntityNotFound(_0x47a41f){return function(_0x1efc4b){if(!_0x1efc4b){_0x47a41f[_0x9327('0x24')](0x194);}return _0x1efc4b;};}function handleError(_0x1164bd,_0x1c1f84){_0x1c1f84=_0x1c1f84||0x1f4;return function(_0x5bbc8d){logger[_0x9327('0x21')](_0x5bbc8d[_0x9327('0x2e')]);if(_0x5bbc8d['name']){delete _0x5bbc8d['name'];}_0x1164bd[_0x9327('0x26')](_0x1c1f84)[_0x9327('0x2f')](_0x5bbc8d);};}function getMustacheRender(_0x358851,_0x190514){return Mustache[_0x9327('0x30')](_0x358851,_[_0x9327('0x31')](_0x190514[_0x9327('0x32')],{'contact':_0x190514[_0x9327('0x33')],'message':_0x190514[_0x9327('0x22')],'agent':_0x190514[_0x9327('0x34')],'interaction':_0x190514[_0x9327('0x35')],'account':_0x190514[_0x9327('0x36')]}))||'';}function getInteractionUsers(_0x15a279,_0x35ecb5){return new BPromise(function(_0x402f95,_0xb6ece6){try{if(_0x35ecb5[_0x15a279['id']]){_0x15a279[_0x9327('0x37')]=_['map'](_0x35ecb5[_0x15a279['id']],function(_0x3b18bc){return{'id':_0x3b18bc['id'],'fullname':_0x3b18bc[_0x9327('0x38')]};});}}catch(_0x1ea96a){_0xb6ece6(_0x1ea96a);}_0x402f95(_0x15a279);});}function getInteractionTags(_0x475237,_0x42bb58){return new BPromise(function(_0x238570,_0x3cb07a){try{if(_0x475237['TagIds']){_0x475237[_0x9327('0x39')]=[];_0x475237[_0x9327('0x3a')][_0x9327('0x3b')](',')[_0x9327('0x3c')](function(_0x5c5fec){_0x475237[_0x9327('0x39')]['push'](_0x42bb58[_0x5c5fec]);});}delete _0x475237[_0x9327('0x3a')];}catch(_0x41fb3a){_0x3cb07a(_0x41fb3a);}_0x238570(_0x475237);});}function updateChatInteraction(_0x4c7faa,_0x5dbec5,_0x54f8c1){return new BPromise(function(_0x390f27,_0x1cd4e3){return getInteractionUsers(_0x4c7faa,_0x54f8c1)['then'](function(_0x33f603){return getInteractionTags(_0x33f603,_0x5dbec5);})['then'](function(_0x218547){return getStateInteraction(_0x218547);})[_0x9327('0x1b')](function(_0x4c5747){_0x390f27(_0x4c5747);})[_0x9327('0x3d')](function(_0x344d00){_0x1cd4e3(_0x344d00);});});}function getStateInteraction(_0x4e7840){return new BPromise(function(_0x4007d3){_0x4e7840[_0x9327('0x3e')]=0x0;_0x4e7840[_0x9327('0x3f')]=0x0;_0x4e7840[_0x9327('0x40')]=0x0;_0x4e7840[_0x9327('0x41')]=0x0;_0x4e7840[_0x9327('0x42')]=0x0;_0x4e7840[_0x9327('0x43')]=0x0;if(!_0x4e7840['closed']&&!_0x4e7840[_0x9327('0x44')]){_0x4e7840['waiting']+=0x1;}if(!_0x4e7840['closed']&&_0x4e7840[_0x9327('0x44')]){_0x4e7840[_0x9327('0x3f')]+=0x1;if(_0x4e7840['waiting']){_0x4e7840[_0x9327('0x3e')]-=0x1;}}if(_0x4e7840[_0x9327('0x45')]&&_0x4e7840['disposition']==='abandoned'){_0x4e7840[_0x9327('0x42')]+=0x1;if(_0x4e7840[_0x9327('0x3e')]){_0x4e7840['waiting']-=0x1;}}else if(_0x4e7840[_0x9327('0x45')]&&!_0x4e7840['UserId']&&_0x4e7840[_0x9327('0x46')]){_0x4e7840[_0x9327('0x41')]+=0x1;if(_0x4e7840[_0x9327('0x3e')]){_0x4e7840[_0x9327('0x3e')]-=0x1;}}else if(_0x4e7840['closed']&&_0x4e7840[_0x9327('0x44')]){_0x4e7840[_0x9327('0x40')]+=0x1;if(_0x4e7840[_0x9327('0x3f')]){_0x4e7840['talking']-=0x1;}}_0x4e7840[_0x9327('0x43')]+=0x1;_0x4007d3(_0x4e7840);});}exports['index']=function(_0x3ac6d6,_0x35a736){var _0x2dae2f={},_0x266f48={},_0x434156={'count':0x0,'rows':[]};var _0x48a579=_['map'](db[_0x9327('0x47')][_0x9327('0x48')],function(_0x106964){return{'name':_0x106964[_0x9327('0x49')],'type':_0x106964['type'][_0x9327('0x4a')]};});_0x266f48[_0x9327('0x4b')]=_['map'](_0x48a579,_0x9327('0x4c'));_0x266f48[_0x9327('0x4d')]=_[_0x9327('0x4e')](_0x3ac6d6[_0x9327('0x4d')]);_0x266f48['filters']=_['intersection'](_0x266f48['model'],_0x266f48[_0x9327('0x4d')]);_0x2dae2f[_0x9327('0x4f')]=_[_0x9327('0x50')](_0x266f48[_0x9327('0x4b')],qs[_0x9327('0x51')](_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x51')]));_0x2dae2f[_0x9327('0x4f')]=_0x2dae2f[_0x9327('0x4f')]['length']?_0x2dae2f[_0x9327('0x4f')]:_0x266f48['model'];if(!_0x3ac6d6['query'][_0x9327('0x52')](_0x9327('0x53'))){_0x2dae2f[_0x9327('0x2a')]=qs[_0x9327('0x2a')](_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x2a')]);_0x2dae2f[_0x9327('0x28')]=qs[_0x9327('0x28')](_0x3ac6d6['query'][_0x9327('0x28')]);}_0x2dae2f[_0x9327('0x54')]=qs[_0x9327('0x55')](_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x55')]);_0x2dae2f[_0x9327('0x56')]=qs[_0x9327('0x57')](_['pick'](_0x3ac6d6[_0x9327('0x4d')],_0x266f48[_0x9327('0x57')]),_0x48a579);var _0x4e101c=[];var _0x4ab690=squel[_0x9327('0x58')]()[_0x9327('0x59')]('id')[_0x9327('0x59')](_0x9327('0x4c'))[_0x9327('0x59')](_0x9327('0x5a'))['from'](_0x9327('0x5b'));var _0x4ee0d4=squel[_0x9327('0x58')]()['field'](_0x9327('0x5c'))[_0x9327('0x59')](_0x9327('0x5d'))[_0x9327('0x59')]('ui.ChatInteractionId')['from'](_0x9327('0x5e'),'ui')[_0x9327('0x5f')](_0x9327('0x60'),'u',_0x9327('0x61'));var _0x2dacc6=squel['select']()[_0x9327('0x62')](_0x9327('0x63'),'i')[_0x9327('0x5f')](_0x9327('0x64'),'c',_0x9327('0x65'))[_0x9327('0x5f')](_0x9327('0x60'),'o','o.id\x20=\x20i.UserId')[_0x9327('0x5f')](_0x9327('0x66'),'a',_0x9327('0x67'))[_0x9327('0x5f')](_0x9327('0x68'),'me',_0x9327('0x69'))[_0x9327('0x5f')](_0x9327('0x6a'),'it',_0x9327('0x6b'))[_0x9327('0x5f')](_0x9327('0x5b'),'t',_0x9327('0x6c'));var _0x4dacc6=squel[_0x9327('0x6d')]();var _0xf6e368=[];var _0x356491=squel[_0x9327('0x6d')]();var _0x5a45da;if(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x6e')]){_0x5a45da=as[_0x9327('0x6f')](_0x3ac6d6['query'][_0x9327('0x6e')]);var _0x44088c=_0x5a45da['sqlOperator'];for(var _0x490c45=0x0;_0x490c45<_0x5a45da[_0x9327('0x70')]['length'];_0x490c45++){var _0x53a2d7=_0x5a45da['conditions'][_0x490c45];var _0x2db539='i';var _0x582e52=_[_0x9327('0x71')](_0x48a579,[_0x9327('0x4c'),_0x53a2d7[_0x9327('0x59')]]);if(!_0x582e52){switch(_0x53a2d7[_0x9327('0x59')]){case'unreadMessages':if(_0x53a2d7['value']==0x1){_0x2dacc6[_0x9327('0x72')]('`'+_0x53a2d7[_0x9327('0x59')]+'`\x20=\x200');}else{_0x2dacc6[_0x9327('0x72')]('`'+_0x53a2d7['field']+_0x9327('0x73'));}break;case _0x9327('0x74'):if(_0x53a2d7[_0x9327('0x75')]===_0x9327('0x76')){if(_0x53a2d7[_0x9327('0x77')][_0x9327('0x3b')]('\x20')[_0x9327('0x78')]>0x1){_0x4dacc6[_0x44088c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9327('0x79')](_0x53a2d7[_0x9327('0x77')]),null);}else{var _0x1c475e='%'+_0x53a2d7['value']+'%';_0x4dacc6[_0x44088c](_0x9327('0x7a'),_0x1c475e,_0x1c475e,_0x1c475e);}}else{_0x582e52=_[_0x9327('0x71')](_0x48a579,[_0x9327('0x4c'),_0x9327('0x7b')]);_0x53a2d7[_0x9327('0x59')]='ContactId';_0x55f6ca=as['buildExpression'](_0x2db539,_0x582e52[_0x9327('0x7c')],_0x53a2d7);_0x4dacc6[_0x44088c](_0x55f6ca[_0x9327('0x7d')],_0x55f6ca[_0x9327('0x77')]['start'],_0x55f6ca['value']['end']);}break;case _0x9327('0x7e'):var _0x43038f=_0x53a2d7[_0x9327('0x77')][_0x9327('0x3b')](',')['map'](function(_0x353b8e){return Number(_0x353b8e);});_0x43038f[_0x9327('0x3c')](function(_0x2dea07){_0x356491['or'](_0x9327('0x7f'),'%,'+_0x2dea07+',%');});_0xf6e368=_[_0x9327('0x80')](_0xf6e368,_0x43038f);break;case _0x9327('0x81'):if(_0x53a2d7[_0x9327('0x75')]===_0x9327('0x76')){_0x4dacc6[_0x44088c](_0x9327('0x82'),'%'+_0x53a2d7[_0x9327('0x77')]+'%',null);}else{_0x582e52=_[_0x9327('0x71')](_0x48a579,[_0x9327('0x4c'),_0x9327('0x44')]);_0x53a2d7[_0x9327('0x59')]=_0x9327('0x44');_0x55f6ca=as[_0x9327('0x83')](_0x2db539,_0x582e52[_0x9327('0x7c')],_0x53a2d7);_0x4dacc6[_0x44088c](_0x55f6ca[_0x9327('0x7d')],_0x55f6ca[_0x9327('0x77')]['start'],_0x55f6ca[_0x9327('0x77')][_0x9327('0x25')]);}break;case _0x9327('0x32'):_0x55f6ca=as[_0x9327('0x83')]('me',null,_0x53a2d7);_0x4dacc6[_0x44088c](_0x55f6ca[_0x9327('0x7d')],_0x55f6ca[_0x9327('0x77')][_0x9327('0x84')],_0x55f6ca[_0x9327('0x77')][_0x9327('0x25')]);break;}}else{var _0x55f6ca=as[_0x9327('0x83')](_0x2db539,_0x582e52[_0x9327('0x7c')],_0x53a2d7);_0x4dacc6[_0x44088c](_0x55f6ca[_0x9327('0x7d')],_0x55f6ca[_0x9327('0x77')][_0x9327('0x84')],_0x55f6ca[_0x9327('0x77')][_0x9327('0x25')]);}}}else{var _0xe05c6a=_(_0x3ac6d6['query'])[_0x9327('0x4e')]()[_0x9327('0x85')](function(_0x4ba6d3){return _[_0x9327('0x86')](_0x48a579,[_0x9327('0x4c'),_0x4ba6d3])?_0x4ba6d3:undefined;})[_0x9327('0x87')]()[_0x9327('0x77')]();if(!_['isEmpty'](_0xe05c6a)){_0xe05c6a[_0x9327('0x3c')](function(_0x28506b){if(_0x28506b===_0x9327('0x88')){_0x2dacc6[_0x9327('0x56')](_0x9327('0x89'),[][_0x9327('0x8a')](_0x3ac6d6[_0x9327('0x4d')][_0x28506b]));}else if(_0x28506b===_0x9327('0x8b')){var _0x3993cb=JSON[_0x9327('0x8c')](_0x3ac6d6[_0x9327('0x4d')][_0x28506b])[_0x9327('0x8d')];var _0x5e813a=JSON['parse'](_0x3ac6d6[_0x9327('0x4d')][_0x28506b])[_0x9327('0x8e')];_0x2dacc6[_0x9327('0x56')](_0x9327('0x8f'),_0x3993cb,_0x5e813a);}else{if(_0x3ac6d6[_0x9327('0x4d')][_0x28506b]===_0x9327('0x90')){_0x2dacc6[_0x9327('0x56')]('i.'+_0x28506b+'\x20IS\x20NULL');}else{_0x2dacc6['where']('i.'+_0x28506b+_0x9327('0x91'),_0x3ac6d6[_0x9327('0x4d')][_0x28506b]);}}});}if(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x92')]){if(_0x3ac6d6['query']['read']==0x1){_0x2dacc6[_0x9327('0x72')]('`unreadMessages`\x20=\x200');}else{_0x2dacc6['having'](_0x9327('0x93'));}}if(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x94')]){_0xf6e368=_[_0x9327('0x95')](_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x94')])?_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x94')]:new Array(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x94')]);_0xf6e368[_0x9327('0x3c')](function(_0x4d6451){_0x356491['or'](_0x9327('0x7f'),'%,'+_0x4d6451+',%');});}if(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x96')]){var _0x2e6c13=_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x96')]['replace']('\x5c','\x5c\x5c')[_0x9327('0x97')](/'/g,'\x27\x27');if(qs[_0x9327('0x98')](_0x2e6c13)){_0x4dacc6['or']('i.id\x20LIKE\x20?',_0x2e6c13+'%');}else{_0x4dacc6['or'](_0x9327('0x99'),qs[_0x9327('0x79')](_0x2e6c13))['or'](_0x9327('0x9a'),_0x2e6c13+'%');}}}_0x2dacc6[_0x9327('0x56')](_0x4dacc6);_0x2dacc6[_0x9327('0x9b')](_0x9327('0x9c'));var _0x24ae1b={'type':db[_0x9327('0x9d')][_0x9327('0x9e')][_0x9327('0x9f')],'raw':!![]};var _0x41c950=_0x2dacc6[_0x9327('0xa0')]();_0x41c950[_0x9327('0x59')]('i.id');_0x41c950['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9327('0xa1'));if(_0x2dae2f[_0x9327('0x54')]){_0x2dae2f[_0x9327('0x54')][_0x9327('0x3c')](function(_0x56f598){var _0x34440e=_0x56f598[0x0]===_0x9327('0xa2')?_0x56f598[0x0]:'i.'+_0x56f598[0x0];_0x2dacc6[_0x9327('0x54')](_0x34440e,_0x56f598[0x1]===_0x9327('0xa3')?![]:!![]);});}if(!_['isEmpty'](_0xf6e368)){_0x2dacc6[_0x9327('0x72')](_0x356491);_0x41c950['where']('t.id\x20IN\x20?',_0xf6e368);}BPromise[_0x9327('0xa4')]()[_0x9327('0x1b')](function(){if(!_0x5a45da){if(_0x3ac6d6[_0x9327('0x4d')][_0x9327('0x88')])return;_0x41c950[_0x9327('0x56')](_0x9327('0xa5'));_0x2dacc6[_0x9327('0x56')](_0x9327('0xa5'));return;}if(_0x3ac6d6[_0x9327('0xa6')][_0x9327('0xa7')]!==_0x9327('0x34'))return;return _0x3ac6d6[_0x9327('0xa6')][_0x9327('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x51cfc5){if(_[_0x9327('0xa9')](_0x51cfc5)){_0x41c950[_0x9327('0x56')](_0x9327('0xaa'));_0x2dacc6[_0x9327('0x56')](_0x9327('0xaa'));}else{_0x41c950[_0x9327('0x56')](_0x9327('0x89'),_['map'](_0x51cfc5,'id'));_0x2dacc6[_0x9327('0x56')]('i.ChatWebsiteId\x20IN\x20?',_[_0x9327('0x85')](_0x51cfc5,'id'));}});})['then'](function(){if(_0x3ac6d6[_0x9327('0xa6')][_0x9327('0xa7')]==='agent'&&!_0x5a45da&&!_0x3ac6d6['query'][_0x9327('0x88')])return[];return db[_0x9327('0xab')][_0x9327('0x4d')](_0x41c950[_0x9327('0xac')](),_0x24ae1b);})[_0x9327('0x1b')](function(_0x4919f4){_0x434156[_0x9327('0x2b')]=_0x4919f4['length'];if(_0x434156['count']===0x0)return[];return db[_0x9327('0xab')][_0x9327('0x4d')](_0x4ab690[_0x9327('0xac')](),_0x24ae1b)[_0x9327('0x1b')](function(_0x2624de){_0x4e101c=_[_0x9327('0xad')](_0x2624de,'id');_0x24ae1b=_[_0x9327('0x31')](_0x24ae1b,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ac6d6['query'][_0x9327('0x51')]){_0x2dae2f[_0x9327('0x4f')][_0x9327('0x3c')](function(_0x28e26c){_0x2dacc6[_0x9327('0x59')]('i.'+_0x28e26c);});}else{_0x2dacc6[_0x9327('0x59')](_0x9327('0xae'),_0x9327('0xa1'));_0x2dacc6['field'](_0x9327('0xaf'),_0x9327('0xb0'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xb1'),_0x9327('0xb2'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xb3'),_0x9327('0xa2'));_0x2dacc6['field'](_0x9327('0xb4'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xb5'),'Contact.firstName');_0x2dacc6[_0x9327('0x59')](_0x9327('0xb6'),_0x9327('0xb7'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xb8'),_0x9327('0xb9'));_0x2dacc6['field'](_0x9327('0xba'),_0x9327('0xbb'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xbc'),_0x9327('0xbd'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xbe'),_0x9327('0xbf'));_0x2dacc6[_0x9327('0x59')](_0x9327('0xc0'),'Owner.fullname');_0x2dacc6[_0x9327('0x59')]('o.internal','Owner.internal');_0x2dacc6[_0x9327('0x59')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2dae2f[_0x9327('0x2a')])_0x2dacc6[_0x9327('0x2a')](_0x2dae2f[_0x9327('0x2a')]);if(_0x2dae2f[_0x9327('0x28')])_0x2dacc6['offset'](_0x2dae2f[_0x9327('0x28')]);return db[_0x9327('0xab')][_0x9327('0x4d')](_0x2dacc6[_0x9327('0xac')](),_0x24ae1b);})[_0x9327('0x1b')](function(_0x597ffe){if(_0x597ffe['length']>0x0)_0x4ee0d4[_0x9327('0x56')](_0x9327('0xc1'),_[_0x9327('0x85')](_0x597ffe,'id'));return db[_0x9327('0xab')][_0x9327('0x4d')](_0x4ee0d4[_0x9327('0xac')](),_0x24ae1b)['then'](function(_0x47cf34){var _0x1032de=_[_0x9327('0xc2')](_0x47cf34,_0x9327('0xc3'));var _0x1edd27=[];_0x597ffe['forEach'](function(_0x111732){_0x1edd27[_0x9327('0xc4')](updateChatInteraction(_0x111732,_0x4e101c,_0x1032de));});return BPromise[_0x9327('0xc5')](_0x1edd27);});});})[_0x9327('0x1b')](function(_0x53be64){_0x434156[_0x9327('0xc6')]=_0x53be64;return _0x434156;})[_0x9327('0x1b')](respondWithFilteredResult(_0x35a736,_0x2dae2f))[_0x9327('0x3d')](handleError(_0x35a736,null));};exports[_0x9327('0xc7')]=function(_0x126c57,_0x3c5288){var _0xa41e12={'raw':![],'where':{'id':_0x126c57[_0x9327('0xc8')]['id']}},_0x3a1748={};_0x3a1748[_0x9327('0x4b')]=_[_0x9327('0x4e')](db[_0x9327('0x47')]['rawAttributes']);_0x3a1748[_0x9327('0x4d')]=_[_0x9327('0x4e')](_0x126c57['query']);_0x3a1748[_0x9327('0x57')]=_[_0x9327('0x50')](_0x3a1748[_0x9327('0x4b')],_0x3a1748[_0x9327('0x4d')]);_0xa41e12[_0x9327('0x4f')]=_['intersection'](_0x3a1748[_0x9327('0x4b')],qs[_0x9327('0x51')](_0x126c57[_0x9327('0x4d')][_0x9327('0x51')]));_0xa41e12['attributes']=_0xa41e12['attributes'][_0x9327('0x78')]?_0xa41e12[_0x9327('0x4f')]:_0x3a1748['model'];if(_0x126c57[_0x9327('0x4d')][_0x9327('0xc9')]){_0xa41e12['include']=[{'all':!![]}];}_0xa41e12=_['merge']({},_0xa41e12,_0x126c57[_0x9327('0xca')]);return db['ChatInteraction']['find'](_0xa41e12)['then'](handleEntityNotFound(_0x3c5288,null))[_0x9327('0x1b')](respondWithResult(_0x3c5288,null))['catch'](handleError(_0x3c5288,null));};exports[_0x9327('0xcb')]=function(_0x38701f,_0x1161a6){return db[_0x9327('0x47')][_0x9327('0xcb')](_0x38701f[_0x9327('0x32')],{})[_0x9327('0x1b')](respondWithResult(_0x1161a6,0xc9))[_0x9327('0x3d')](handleError(_0x1161a6,null));};exports[_0x9327('0x2d')]=function(_0x2156a5,_0x5c3d9f){if(_0x2156a5['body']['id']){delete _0x2156a5[_0x9327('0x32')]['id'];}return db[_0x9327('0x47')][_0x9327('0x71')]({'where':{'id':_0x2156a5[_0x9327('0xc8')]['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x5c3d9f,null))[_0x9327('0x1b')](saveUpdates(_0x2156a5['body'],null))[_0x9327('0x1b')](respondWithResult(_0x5c3d9f,null))['catch'](handleError(_0x5c3d9f,null));};exports[_0x9327('0xcc')]=function(_0x3cb342,_0x1dd100){return db['ChatInteraction']['find']({'where':{'id':_0x3cb342[_0x9327('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1dd100,null))[_0x9327('0x1b')](removeEntity(_0x1dd100,null))[_0x9327('0x3d')](handleError(_0x1dd100,null));};exports[_0x9327('0xcd')]=function(_0x1e6da1,_0x64929e){return db[_0x9327('0x47')][_0x9327('0xcd')]()['then'](respondWithResult(_0x64929e,null))[_0x9327('0x3d')](handleError(_0x64929e,null));};exports[_0x9327('0xce')]=function(_0x2c9b4b,_0x4a59bc){var _0x28b5dc=_0x2c9b4b[_0x9327('0xc8')]['id'];var _0x8f9a8d;var _0x35508f;var _0x33f444;return db['ChatInteraction']['findOne']({'where':{'id':_0x28b5dc}})[_0x9327('0x1b')](function(_0x312daa){_0x8f9a8d=_0x312daa;return db[_0x9327('0xcf')]['findOne']({'where':{'id':_0x312daa[_0x9327('0x88')]},'attributes':['id',_0x9327('0xd0'),_0x9327('0xd1'),_0x9327('0xd2'),_0x9327('0xd3'),_0x9327('0xd4')],'raw':!![]});})[_0x9327('0x1b')](function(_0x25b3f0){if(_0x25b3f0&&_0x25b3f0[_0x9327('0xd0')]&&_0x25b3f0['vidaooEscalation']){_0x35508f=_0x25b3f0;var _0x20e6d7={'interaction':{'id':_0x28b5dc},'agent':{'id':_0x2c9b4b[_0x9327('0xa6')]['id'],'name':_0x2c9b4b[_0x9327('0xa6')][_0x9327('0x4c')],'fullname':_0x2c9b4b['user'][_0x9327('0x38')],'email':_0x2c9b4b['user'][_0x9327('0xd5')]},'contact':_0x2c9b4b[_0x9327('0x32')][_0x9327('0x33')],'account':_0x2c9b4b[_0x9327('0x32')][_0x9327('0x36')]};var _0x1925c7={'rejectUnauthorized':![],'method':_0x9327('0xd6'),'url':_0x9327('0xd7'),'headers':{'X-APIKEY':_0x25b3f0[_0x9327('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2c9b4b['user'][_0x9327('0xd5')]],'buttons':null,'topic':_0x35508f['vidaooTopic'],'note':_['isNull'](_0x35508f[_0x9327('0xd3')])?null:getMustacheRender(_0x35508f[_0x9327('0xd3')],_0x20e6d7),'metadata':null},'redirect':_0x9327('0xd8'),'json':!![]};try{if(!_[_0x9327('0xd9')](_0x35508f[_0x9327('0xd4')])){var _0x2da31b=getMustacheRender(_0x35508f[_0x9327('0xd4')],_0x20e6d7);var _0x37667a=JSON[_0x9327('0x8c')](_0x2da31b);_0x1925c7['body']['metadata']=_0x37667a;}}catch(_0x1bda2f){throw new db['Sequelize'][(_0x9327('0xda'))](_0x9327('0xdb'));}return rp(_0x1925c7);}else{throw new db[(_0x9327('0x9d'))][(_0x9327('0xda'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x5d5160){_0x33f444=_0x5d5160;if(_0x33f444['id']){var _0x1f4b42={'body':_0x33f444[_0x9327('0xdc')],'ChatWebsiteId':_0x35508f['id'],'ChatInteractionId':_0x8f9a8d['id'],'direction':_0x9327('0xdd'),'UserId':_0x2c9b4b['user']['id']};return db[_0x9327('0xde')][_0x9327('0xcb')](_0x1f4b42,{});}else{throw new db[(_0x9327('0x9d'))]['ValidationError'](_0x9327('0xdf'));}})[_0x9327('0x1b')](function(){return _0x8f9a8d[_0x9327('0xe0')]({'vidaooSessionId':_0x33f444['id']});})[_0x9327('0x1b')](respondWithResult(_0x4a59bc,null))['catch'](handleError(_0x4a59bc,null));};exports[_0x9327('0xe1')]=function(_0x6fe6ae,_0x4bf1a5){if(_0x6fe6ae[_0x9327('0x32')]['id']){delete _0x6fe6ae[_0x9327('0x32')]['id'];}return db['ChatInteraction'][_0x9327('0x71')]({'where':{'id':_0x6fe6ae['params']['id']},'include':[{'model':db[_0x9327('0xe2')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4bf1a5,null))['then'](saveUpdates(_0x6fe6ae[_0x9327('0x32')],null))[_0x9327('0x1b')](respondWithResult(_0x4bf1a5,null))[_0x9327('0x3d')](handleError(_0x4bf1a5,null));};exports[_0x9327('0xe3')]=function(_0x1558ef,_0x5a6af6){if(_0x1558ef[_0x9327('0x32')]['id']){delete _0x1558ef[_0x9327('0x32')]['id'];}return db[_0x9327('0x47')]['find']({'where':{'id':_0x1558ef[_0x9327('0xc8')]['id']}})['then'](function(_0x7186e1){if(!_0x7186e1){logger[_0x9327('0x21')](_0x9327('0xe4'),_0x9327('0xe3'),0x194,'entity\x20not\x20found');_0x5a6af6[_0x9327('0x24')](0x194);}else{if(_0x7186e1[_0x9327('0x44')]){throw new db[(_0x9327('0x9d'))][(_0x9327('0xda'))](_0x9327('0xe5'));}}return _0x7186e1;})[_0x9327('0x1b')](function(_0x54f8e8){if(_0x54f8e8){return _0x54f8e8[_0x9327('0x2d')]({'closed':_0x1558ef['body'][_0x9327('0x45')],'disposition':_0x1558ef[_0x9327('0x32')][_0x9327('0x46')]})['then'](function(_0x53831a){return _0x53831a;});}})[_0x9327('0x1b')](function(){return respondWithRpcPromise(_0x9327('0xe6'),_0x9327('0xe3'),_0x1558ef['body'],client9004);})[_0x9327('0x1b')](respondWithResult(_0x5a6af6,null))['catch'](handleError(_0x5a6af6,null));};exports[_0x9327('0xe7')]=function(_0x3ebedd,_0x28a6b4){_0x3ebedd['body']['name']=_0x3ebedd[_0x9327('0xe8')][_0x9327('0xe9')];_0x3ebedd[_0x9327('0x32')][_0x9327('0xea')]=_0x3ebedd[_0x9327('0xe8')][_0x9327('0xeb')];_0x3ebedd['body']['type']=_0x3ebedd['file'][_0x9327('0xec')];return db['Attachment'][_0x9327('0xcb')](_0x3ebedd['body'])[_0x9327('0x1b')](respondWithResult(_0x28a6b4,0xc9))['catch'](handleError(_0x28a6b4,null));};exports['attachmentDownload']=function(_0x2d8b22,_0x2e2b1b){return db[_0x9327('0x47')]['findOne']({'where':{'id':_0x2d8b22[_0x9327('0xc8')]['id']},'raw':!![]})[_0x9327('0x1b')](handleEntityNotFound(_0x2e2b1b,null))[_0x9327('0x1b')](function(_0x27194a){if(_0x27194a){if(_0x27194a[_0x9327('0x45')]){return _0x2e2b1b['status'](0x193)['json']({'status':0x193,'message':_0x9327('0xed')});}return db[_0x9327('0xee')][_0x9327('0xef')]({'where':{'id':_0x2d8b22[_0x9327('0x4d')][_0x9327('0xf0')]},'raw':!![]})['then'](handleEntityNotFound(_0x2e2b1b,null));}})['then'](function(_0x21c5f4){if(_0x21c5f4){var _0x3947b2=_0x21c5f4[_0x9327('0xf1')]!==null;var _0x212d77=path[_0x9327('0xf2')](config[_0x9327('0xf3')],_0x9327('0xf4'));if(_0x3947b2){_0x212d77=path[_0x9327('0xf2')](_0x212d77,'offline-chat/');}var _0x9d038a=path[_0x9327('0xf2')](_0x212d77,_0x21c5f4['basename']);return _0x2e2b1b[_0x9327('0xf5')](_0x9d038a);}})['catch'](handleError(_0x2e2b1b,null));};exports['close']=function(_0x4d9944,_0x303eb9){var _0x4e9af5=null;var _0x8dd01e=null;var _0x2257f1=null;if(_0x4d9944[_0x9327('0x32')]['id']){delete _0x4d9944[_0x9327('0x32')]['id'];}if(_0x4d9944[_0x9327('0x32')][_0x9327('0xf6')]){_0x2257f1=path[_0x9327('0xf2')](config[_0x9327('0xf3')],'server/files/chat/upload/',util[_0x9327('0xf7')]('transcript-%s.txt',Date['now']()));_0x4d9944['body'][_0x9327('0xf8')]=_0x2257f1;}return db['ChatInteraction']['find']({'where':{'id':_0x4d9944[_0x9327('0xc8')]['id']},'include':[{'model':db[_0x9327('0xde')],'as':_0x9327('0xf9'),'include':[{'model':db['User'],'as':_0x9327('0x81')}]}]})['then'](handleEntityNotFound(_0x303eb9,null))[_0x9327('0x1b')](saveUpdates(_0x4d9944[_0x9327('0x32')],null))[_0x9327('0x1b')](function(_0x6356de){if(_0x6356de){_0x4e9af5=_0x6356de;return db[_0x9327('0xcf')][_0x9327('0x71')]({'where':{'id':_0x4e9af5[_0x9327('0x88')]}});}})[_0x9327('0x1b')](function(_0x9aa564){if(_0x9aa564){_0x8dd01e=_0x9aa564;return db[_0x9327('0xe2')]['find']({'where':{'id':_0x4e9af5[_0x9327('0x7b')]}});}})['then'](function(_0x4cda27){if(_0x4cda27){if(_0x2257f1){var _0x2685f8=null;for(var _0x586c9a=0x1;_0x586c9a<_0x4e9af5[_0x9327('0xf9')][_0x9327('0x78')];++_0x586c9a){_0x2685f8=_0x4e9af5[_0x9327('0xf9')][_0x586c9a];var _0xbdef64=_0x2685f8[_0x9327('0x44')]?util['format'](_0x9327('0xfa'),_0x8dd01e[_0x9327('0xfb')],_0x2685f8[_0x9327('0x44')]):_0x9327('0xfc');var _0x527997=_0x4d9944[_0x9327('0x32')][_0x9327('0xfd')]||util['format'](_0x9327('0xfa'),_0x9327('0xfe'),_0x2685f8['ContactId']);switch(_0x8dd01e[_0x9327('0xff')]){case _0x9327('0x100'):_0xbdef64=_0x2685f8[_0x9327('0x44')]?util[_0x9327('0xf7')]('%s%d',_0x8dd01e['agentAlias'],_0x2685f8['UserId']):_0x9327('0xfc');break;case _0x9327('0x101'):_0xbdef64=_0x2685f8[_0x9327('0x44')]?_0x2685f8[_0x9327('0x81')][_0x9327('0x102')]||_0x2685f8[_0x9327('0x81')]['fullname']:'System';break;case'agent_fullname':_0xbdef64=_0x2685f8[_0x9327('0x44')]?_0x2685f8[_0x9327('0x81')]['fullname']:_0x9327('0xfc');break;default:_0xbdef64=_0x2685f8[_0x9327('0x44')]?util[_0x9327('0xf7')]('%s%d',_0x8dd01e['agentAlias'],_0x2685f8[_0x9327('0x44')]):'System';}var _0x4c5fed=util[_0x9327('0xf7')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2685f8[_0x9327('0x8b')])[_0x9327('0xf7')](_0x9327('0x103')),_0x2685f8[_0x9327('0x104')]==='in'?_0x527997:_0xbdef64,_0x2685f8['body']);if(!_0x2685f8[_0x9327('0x105')]){fs['appendFileSync'](_0x2257f1,_0x4c5fed);}}return db['MailAccount'][_0x9327('0xef')]({'where':{'service':!![]},'include':[{'model':db[_0x9327('0x106')],'as':_0x9327('0x107'),'raw':!![],'include':[{'model':db[_0x9327('0x108')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x9327('0x1b')](function(_0x3ae974){if(!_0x3ae974||!_0x3ae974[_0x9327('0x107')]||!_0x4d9944['body'])return _0x4e9af5;var _0x36ae07=_0x3ae974[_0x9327('0x109')]();return respondWithRpcPromise(_0x9327('0x10a'),_0x9327('0x10b'),{'account':_0x36ae07,'message':{'from':util[_0x9327('0xf7')](_0x9327('0x10c'),_0x3ae974['name'],_0x3ae974['email']||_0x3ae974[_0x9327('0x107')][_0x9327('0xa6')]),'to':_0x4d9944[_0x9327('0x32')][_0x9327('0xf6')],'subject':'Mail\x20Transcript','text':util[_0x9327('0xf7')](_0x9327('0x10d'),_0x4d9944[_0x9327('0x32')][_0x9327('0xf6')]),'attachments':[{'path':_0x2257f1}]}})[_0x9327('0x1b')](function(){return _0x4e9af5;})['catch'](function(_0x38fc74){logger['error'](_0x38fc74);});})[_0x9327('0x1b')](respondWithStatusCode(_0x303eb9,0xc8))[_0x9327('0x3d')](handleError(_0x303eb9,null));};exports[_0x9327('0x10e')]=function(_0x3ffbb7,_0x1d9b8b){return db[_0x9327('0xde')]['find']({'where':{'id':_0x3ffbb7[_0x9327('0xc8')]['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x1d9b8b,null))['then'](function(_0x15399a){if(_0x15399a){return _0x15399a[_0x9327('0x10e')](_0x3ffbb7[_0x9327('0x32')][_0x9327('0x10f')],_[_0x9327('0x110')](_0x3ffbb7[_0x9327('0x32')],[_0x9327('0x10f'),'id'])||{});}})[_0x9327('0x1b')](respondWithResult(_0x1d9b8b,null))[_0x9327('0x3d')](handleError(_0x1d9b8b,null));};exports[_0x9327('0x111')]=function(_0x104397,_0x2208ab){var _0xbe8d29={'raw':![],'where':{}};var _0x4a099d={};var _0x1c41be={'count':0x0,'rows':[]};return db[_0x9327('0x47')][_0x9327('0xef')]({'where':{'id':_0x104397[_0x9327('0xc8')]['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x2208ab,null))[_0x9327('0x1b')](function(_0x5dfc13){if(_0x5dfc13){_0x4a099d['model']=_[_0x9327('0x4e')](db[_0x9327('0xde')][_0x9327('0x48')]);_0x4a099d[_0x9327('0x4d')]=_[_0x9327('0x4e')](_0x104397[_0x9327('0x4d')]);_0x4a099d['filters']=_[_0x9327('0x50')](_0x4a099d[_0x9327('0x4b')],_0x4a099d[_0x9327('0x4d')]);_0xbe8d29['attributes']=_[_0x9327('0x50')](_0x4a099d[_0x9327('0x4b')],qs['fields'](_0x104397[_0x9327('0x4d')][_0x9327('0x51')]));_0xbe8d29[_0x9327('0x4f')]=_0xbe8d29[_0x9327('0x4f')]['length']?_0xbe8d29[_0x9327('0x4f')]:_0x4a099d['model'];if(!_0x104397[_0x9327('0x4d')][_0x9327('0x52')](_0x9327('0x53'))){_0xbe8d29[_0x9327('0x2a')]=qs[_0x9327('0x2a')](_0x104397[_0x9327('0x4d')]['limit']);_0xbe8d29['offset']=qs[_0x9327('0x28')](_0x104397[_0x9327('0x4d')][_0x9327('0x28')]);}_0xbe8d29[_0x9327('0x54')]=qs[_0x9327('0x55')](_0x104397[_0x9327('0x4d')]['sort']);_0xbe8d29[_0x9327('0x56')]=qs[_0x9327('0x57')](_[_0x9327('0x112')](_0x104397['query'],_0x4a099d[_0x9327('0x57')]));_0xbe8d29[_0x9327('0x56')][_0x9327('0xc3')]=_0x5dfc13['id'];if(_0x104397['query']['filter']){_0xbe8d29[_0x9327('0x56')]=_[_0x9327('0x31')](_0xbe8d29[_0x9327('0x56')],{'$or':_[_0x9327('0x85')](_0xbe8d29['attributes'],function(_0xd8fe15){var _0x36f104={};_0x36f104[_0xd8fe15]={'$like':'%'+_0x104397['query'][_0x9327('0x96')]+'%'};return _0x36f104;})});}if(_0x104397[_0x9327('0x4d')][_0x9327('0x8d')]){var _0x2e7a8c=_0x104397[_0x9327('0x4d')][_0x9327('0x8d')][_0x9327('0x3b')](',');var _0x3dcef5={};_0x3dcef5[_0x2e7a8c[0x0]]={'$gte':moment(_0x2e7a8c[0x1])[_0x9327('0xf7')](_0x9327('0x113'))};_0xbe8d29[_0x9327('0x56')]=_[_0x9327('0x31')](_0xbe8d29[_0x9327('0x56')],_0x3dcef5);}_0xbe8d29=_[_0x9327('0x31')]({},_0xbe8d29,_0x104397[_0x9327('0xca')]);return db[_0x9327('0xde')]['count']({'where':_0xbe8d29[_0x9327('0x56')]})[_0x9327('0x1b')](function(_0x43bfae){_0x1c41be[_0x9327('0x2b')]=_0x43bfae;if(_0x104397['query'][_0x9327('0xc9')]){_0xbe8d29[_0x9327('0x114')]=[{'all':!![]}];}return db[_0x9327('0xde')][_0x9327('0x115')](_0xbe8d29);})['then'](function(_0x33bd08){_0x1c41be[_0x9327('0xc6')]=_0x33bd08;return _0x1c41be;});}})[_0x9327('0x1b')](respondWithFilteredResult(_0x2208ab,_0xbe8d29))[_0x9327('0x3d')](handleError(_0x2208ab,null));};exports['getMyMessages']=function(_0x506e9b,_0x3b15a0){var _0x39d99b={'where':{}},_0x93fa06={},_0xd5abba={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x506e9b['params']['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x3b15a0,null))['then'](function(_0x5effcc){if(_0x5effcc){_0x93fa06[_0x9327('0x4b')]=_[_0x9327('0x4e')](db['ChatMessage'][_0x9327('0x48')]);_0x93fa06[_0x9327('0x4d')]=_[_0x9327('0x4e')](_0x506e9b[_0x9327('0x4d')]);_0x93fa06[_0x9327('0x57')]=_[_0x9327('0x50')](_0x93fa06['model'],_0x93fa06[_0x9327('0x4d')]);_0x39d99b[_0x9327('0x4f')]=_[_0x9327('0x50')](_0x93fa06[_0x9327('0x4b')],qs[_0x9327('0x51')](_0x506e9b[_0x9327('0x4d')][_0x9327('0x51')]));_0x39d99b[_0x9327('0x4f')]=_0x39d99b[_0x9327('0x4f')][_0x9327('0x78')]?_0x39d99b['attributes']:_0x93fa06[_0x9327('0x4b')];if(!_0x506e9b[_0x9327('0x4d')][_0x9327('0x52')](_0x9327('0x53'))){_0x39d99b[_0x9327('0x2a')]=qs['limit'](_0x506e9b[_0x9327('0x4d')][_0x9327('0x2a')]);_0x39d99b[_0x9327('0x28')]=qs[_0x9327('0x28')](_0x506e9b[_0x9327('0x4d')][_0x9327('0x28')]);}_0x39d99b[_0x9327('0x54')]=qs[_0x9327('0x55')](_0x506e9b['query'][_0x9327('0x55')]);_0x39d99b[_0x9327('0x56')]=qs[_0x9327('0x57')](_[_0x9327('0x112')](_0x506e9b['query'],_0x93fa06[_0x9327('0x57')]));_0x39d99b[_0x9327('0x56')][_0x9327('0xc3')]=_0x5effcc['id'];if(_0x506e9b[_0x9327('0x4d')]['filter']){_0x39d99b[_0x9327('0x56')]=_[_0x9327('0x31')](_0x39d99b[_0x9327('0x56')],{'$or':_['map'](_0x39d99b[_0x9327('0x4f')],function(_0x34c53b){var _0xd0b5ee={};_0xd0b5ee[_0x34c53b]={'$like':'%'+_0x506e9b[_0x9327('0x4d')][_0x9327('0x96')]+'%'};return _0xd0b5ee;})});}_0x39d99b['where'][_0x9327('0x105')]=![];if(_0x506e9b[_0x9327('0x4d')]['id']){_0x39d99b['where']['id']={'$gt':_0x506e9b[_0x9327('0x4d')]['id']};}_0x39d99b=_[_0x9327('0x31')]({},_0x39d99b,_0x506e9b[_0x9327('0xca')]);return db[_0x9327('0xde')][_0x9327('0x2b')]({'where':_0x39d99b[_0x9327('0x56')]})[_0x9327('0x1b')](function(_0x14c80e){_0xd5abba[_0x9327('0x2b')]=_0x14c80e;_0x39d99b[_0x9327('0x114')]=[];if(_0x506e9b['query'][_0x9327('0x116')]){_0x39d99b[_0x9327('0x114')][_0x9327('0xc4')]({'model':db[_0x9327('0x81')],'as':_0x9327('0x81'),'attributes':['id',_0x9327('0x38'),'alias']});}if(_0x506e9b[_0x9327('0x4d')][_0x9327('0xc9')]){_0x39d99b[_0x9327('0x114')]=[{'all':!![]}];}return db[_0x9327('0xde')][_0x9327('0x115')](_0x39d99b);})['then'](function(_0x330b8a){_0xd5abba['rows']=_0x330b8a;return _0xd5abba;});}})[_0x9327('0x1b')](respondWithFilteredResult(_0x3b15a0,_0x39d99b))['catch'](handleError(_0x3b15a0,null));};exports[_0x9327('0x117')]=function(_0x4aaa12,_0x3ffd20){return db[_0x9327('0x47')][_0x9327('0x71')]({'where':{'id':_0x4aaa12['params']['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x3ffd20,null))[_0x9327('0x1b')](function(_0x1b4539){if(_0x1b4539){return _0x1b4539[_0x9327('0x118')](_0x4aaa12[_0x9327('0x32')][_0x9327('0x10f')],_[_0x9327('0x110')](_0x4aaa12[_0x9327('0x32')],[_0x9327('0x10f'),'id'])||{})['spread'](function(){return db[_0x9327('0x7e')][_0x9327('0x115')]({'attributes':['id',_0x9327('0x4c'),_0x9327('0x5a')],'where':{'id':_0x4aaa12['body'][_0x9327('0x10f')]}});})[_0x9327('0x1b')](function(_0x22c272){socket[_0x9327('0x119')]('chatInteractionTags:save',{'id':Number(_0x4aaa12[_0x9327('0xc8')]['id']),'tags':_0x22c272||[]});return{'id':Number(_0x4aaa12[_0x9327('0xc8')]['id']),'tags':_0x22c272||[]};});}})[_0x9327('0x1b')](respondWithResult(_0x3ffd20,null))[_0x9327('0x3d')](handleError(_0x3ffd20,null));};exports[_0x9327('0x11a')]=function(_0x2e3b5f,_0x2e77cd){return db[_0x9327('0x47')][_0x9327('0x71')]({'where':{'id':_0x2e3b5f[_0x9327('0xc8')]['id']}})[_0x9327('0x1b')](handleEntityNotFound(_0x2e77cd,null))[_0x9327('0x1b')](function(_0x173c6e){if(_0x173c6e){return _0x173c6e[_0x9327('0x11a')](_0x2e3b5f[_0x9327('0x4d')][_0x9327('0x10f')]);}})[_0x9327('0x1b')](respondWithStatusCode(_0x2e77cd,null))[_0x9327('0x3d')](handleError(_0x2e77cd,null));};exports[_0x9327('0xf5')]=function(_0xfb54d1,_0x312632){var _0x14e9b2=moment()[_0x9327('0x11b')]()['toString']();var _0x5e22df=path[_0x9327('0xf2')](config['root'],_0x9327('0x11c'),_0x9327('0x11d'),_0x9327('0x11e'));var _0x241a53=path['join'](config[_0x9327('0xf3')],_0x9327('0x11c'),_0x9327('0x11d'),_0x9327('0x11f'));var _0x25d570=path[_0x9327('0xf2')](_0x5e22df,_0x14e9b2);var _0x314b3b=util[_0x9327('0xf7')](_0x9327('0x120'),_0xfb54d1[_0x9327('0xc8')]['id'],_0x14e9b2);var _0x42d02f=path['join'](_0x5e22df,_0x314b3b);var _0x49eb0e=[];_0x49eb0e['push']({'model':db[_0x9327('0x81')],'as':_0x9327('0x81'),'attributes':['id',_0x9327('0x38')],'raw':!![]});_0x49eb0e[_0x9327('0xc4')]({'model':db[_0x9327('0xe2')],'as':_0x9327('0x74'),'attributes':['id',_0x9327('0x121'),_0x9327('0x122')],'raw':!![]});if(_0xfb54d1[_0x9327('0x4d')][_0x9327('0x11f')]){_0x49eb0e[_0x9327('0xc4')]({'model':db[_0x9327('0xee')],'as':_0x9327('0xee'),'raw':!![]});}var _0x4ab950=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x9327('0x32'),_0x9327('0x8b'),_0x9327('0x104'),_0x9327('0x105'),'read'],'include':_0x49eb0e}];_0x4ab950[_0x9327('0xc4')]({'model':db[_0x9327('0xcf')],'as':_0x9327('0x123'),'attributes':['id','name']});_0x4ab950[_0x9327('0xc4')]({'model':db[_0x9327('0x81')],'as':'Owner','attributes':['id',_0x9327('0x38')]});return db['ChatInteraction'][_0x9327('0x71')]({'where':{'id':_0xfb54d1[_0x9327('0xc8')]['id']},'include':_0x4ab950})[_0x9327('0x1b')](handleEntityNotFound(_0x312632,null))[_0x9327('0x1b')](function(_0x4393d2){if(_0x4393d2){var _0x298d14=_0x4393d2[_0x9327('0x124')]({'plain':!![]});fs['mkdirSync'](_0x25d570);var _0x3c02eb={'channel':'Chat','account':_0x298d14[_0x9327('0x123')]['name'],'agent':_0x298d14[_0x9327('0x125')]?_0x298d14[_0x9327('0x125')][_0x9327('0x38')]:_0x9327('0x126'),'createdAt':moment(_0x298d14['createdAt'])[_0x9327('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9327('0xac')](),'closedAt':_0x298d14['closed']?moment(_0x298d14[_0x9327('0x127')])[_0x9327('0xf7')](_0x9327('0x113'))[_0x9327('0xac')]():'','disposition':_0x298d14[_0x9327('0x46')],'chatInfo':{'browser':_0x298d14[_0x9327('0x128')],'os':_0x298d14[_0x9327('0x129')],'referer':_0x298d14[_0x9327('0x12a')],'customerIp':_0x298d14['customerIp'],'customerPort':_0x298d14[_0x9327('0x12b')]?_0x298d14[_0x9327('0x12b')]:_0x9327('0x126')},'messages':_(_0x298d14[_0x9327('0xf9')])[_0x9327('0x12c')]()[_0x9327('0x96')]({'secret':![]})[_0x9327('0x85')](function(_0x14dd38){if(_0x14dd38[_0x9327('0xee')]){var _0x262d7b=path[_0x9327('0xf2')](_0x241a53,_0x14dd38[_0x9327('0xee')][_0x9327('0xea')]);if(fs['existsSync'](_0x262d7b)){fs['createReadStream'](_0x262d7b)[_0x9327('0x12d')](fs[_0x9327('0x12e')](path[_0x9327('0xf2')](_0x25d570,_0x14dd38[_0x9327('0xee')][_0x9327('0xea')])));}}return{'date':moment(_0x14dd38['createdAt'])[_0x9327('0xf7')](_0x9327('0x113'))[_0x9327('0xac')](),'sender':_0x14dd38[_0x9327('0x104')]===_0x9327('0xdd')?_0x14dd38[_0x9327('0x81')]?_0x14dd38['User'][_0x9327('0x38')]:_0x9327('0xfc'):_0x14dd38[_0x9327('0x74')][_0x9327('0x121')]+(_0x14dd38['Contact'][_0x9327('0x122')]?'\x20'+_0x14dd38[_0x9327('0x74')][_0x9327('0x122')]:''),'body':_0x14dd38[_0x9327('0xee')]?_0x14dd38[_0x9327('0xee')][_0x9327('0xea')]:_0x14dd38['body'],'direction':_0x14dd38[_0x9327('0x104')]==='out'?'A':'C','secret':_0x14dd38['secret'],'read':_0x14dd38[_0x9327('0x92')],'attachment':_0x14dd38[_0x9327('0xee')]};})[_0x9327('0x77')]()};return ejs[_0x9327('0x12f')](path[_0x9327('0xf2')](config['root'],_0x9327('0x11c'),'views',_0x9327('0x130')),{'interaction':_0x3c02eb})[_0x9327('0x1b')](function(_0x1e96d8){var _0x42ba18=path[_0x9327('0xf2')](_0x25d570,_0x9327('0x131')+_0x298d14['id']+'-'+_0x14e9b2+_0x9327('0x132'));var _0x367a0a={'path':_0x42ba18,'channel':_0x9327('0x133'),'interactionId':_0x298d14['id']};return pdf['createPdfFromHTML'](_0x1e96d8,_0x367a0a);})[_0x9327('0x1b')](function(){return new Promise(function(_0x2fd5f3,_0x5dc781){zipdir(_0x25d570,{'saveTo':_0x42d02f},function(_0x3d9bee,_0x24f7b0){if(_0x3d9bee)return _0x5dc781(_0x3d9bee);return _0x2fd5f3(_0x24f7b0);});})['then'](function(){return new BPromise(function(_0x4fad8a,_0x46e526){rimraf(_0x25d570,function(_0x42eab5){if(_0x42eab5)_0x46e526(_0x42eab5);return _0x4fad8a();});});})[_0x9327('0x1b')](function(){return _0x312632[_0x9327('0xf5')](_0x42d02f,_0x314b3b,function(_0x2bdaf1){if(_0x2bdaf1){logger['error'](_0x9327('0x134'),_0x2bdaf1);}else{fs[_0x9327('0x135')](_0x42d02f);}});});});}else{return _0x312632[_0x9327('0x24')](0xc8);}})[_0x9327('0x3d')](handleError(_0x312632,null));}; \ No newline at end of file +var _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x32df1f,_0x228b18){var _0x41ef00=function(_0x1bb63c){while(--_0x1bb63c){_0x32df1f['push'](_0x32df1f['shift']());}};_0x41ef00(++_0x228b18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9e4ea81..622da66 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 _0xf766=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x102d1c,_0x36f1e4){var _0x5b9be5=function(_0x1c827a){while(--_0x1c827a){_0x102d1c['push'](_0x102d1c['shift']());}};_0x5b9be5(++_0x36f1e4);}(_0xf766,0x131));var _0x6f76=function(_0x273f88,_0x5d4150){_0x273f88=_0x273f88-0x0;var _0x177ca1=_0xf766[_0x273f88];return _0x177ca1;};'use strict';var EventEmitter=require(_0x6f76('0x0'));var ChatInteraction=require(_0x6f76('0x1'))['db'][_0x6f76('0x2')];var ChatMessage=require(_0x6f76('0x1'))['db'][_0x6f76('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6f76('0x4')](0x0);var events={'afterCreate':_0x6f76('0x5'),'afterUpdate':_0x6f76('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2325f0){return function(_0x1f9f4c,_0x4c6247,_0x10d581){_0x1f9f4c[_0x6f76('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4f2378){_0x1f9f4c[_0x6f76('0x8')](_0x6f76('0x9'),_0x4f2378[_0x6f76('0xa')](function(_0x4fb9a7){return{'id':_0x4fb9a7['id']};}));return ChatMessage[_0x6f76('0xb')]({'where':{'ChatInteractionId':_0x1f9f4c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6f76('0xc')](function(_0x3b2d7e){_0x1f9f4c['setDataValue'](_0x6f76('0xd'),_0x3b2d7e[_0x6f76('0xe')]);ChatInteractionEvents[_0x6f76('0xf')](_0x2325f0+':'+_0x1f9f4c['id'],_0x1f9f4c);ChatInteractionEvents['emit'](_0x2325f0,_0x1f9f4c);_0x10d581(null);})['catch'](_0x10d581(null));};}for(var e in events){if(events[_0x6f76('0x10')](e)){var event=events[e];ChatInteraction[_0x6f76('0x11')](e,emitEvent(event));}}module[_0x6f76('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x5066=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','then','setDataValue','Users','map','findAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5066,0x116));var _0x6506=function(_0x28e502,_0x3e36c5){_0x28e502=_0x28e502-0x0;var _0x2fd662=_0x5066[_0x28e502];return _0x2fd662;};'use strict';var EventEmitter=require(_0x6506('0x0'));var ChatInteraction=require(_0x6506('0x1'))['db'][_0x6506('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x6506('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6506('0x4'),'afterDestroy':_0x6506('0x5')};function emitEvent(_0x3b4709){return function(_0x5e3192,_0x1a884f,_0x346b40){_0x5e3192['getUsers']({'attributes':['id'],'raw':!![]})[_0x6506('0x6')](function(_0x280733){_0x5e3192[_0x6506('0x7')](_0x6506('0x8'),_0x280733[_0x6506('0x9')](function(_0x5e934f){return{'id':_0x5e934f['id']};}));return ChatMessage[_0x6506('0xa')]({'where':{'ChatInteractionId':_0x5e3192['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2412df){_0x5e3192['setDataValue'](_0x6506('0xb'),_0x2412df['length']);ChatInteractionEvents[_0x6506('0xc')](_0x3b4709+':'+_0x5e3192['id'],_0x5e3192);ChatInteractionEvents[_0x6506('0xc')](_0x3b4709,_0x5e3192);_0x346b40(null);})[_0x6506('0xd')](_0x346b40(null));};}for(var e in events){if(events[_0x6506('0xe')](e)){var event=events[e];ChatInteraction[_0x6506('0xf')](e,emitEvent(event));}}module[_0x6506('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f430ced..7bebe39 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 _0x3cd1=['utf8mb4_unicode_ci','util','api','moment','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x211e87,_0x19bcbc){var _0x2d027f=function(_0x185d0e){while(--_0x185d0e){_0x211e87['push'](_0x211e87['shift']());}};_0x2d027f(++_0x19bcbc);}(_0x3cd1,0xd1));var _0x13cd=function(_0x46a1ec,_0x384761){_0x46a1ec=_0x46a1ec-0x0;var _0x3e5dce=_0x3cd1[_0x46a1ec];return _0x3e5dce;};'use strict';var _=require('lodash');var util=require(_0x13cd('0x0'));var logger=require('../../config/logger')(_0x13cd('0x1'));var moment=require(_0x13cd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x13cd('0x3'));var rimraf=require(_0x13cd('0x4'));var config=require(_0x13cd('0x5'));var attributes=require(_0x13cd('0x6'));module[_0x13cd('0x7')]=function(_0x44d782,_0x13ae24){return _0x44d782[_0x13cd('0x8')](_0x13cd('0x9'),attributes,{'tableName':_0x13cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e4844,_0x4fc791,_0x1aacdb){if(_0x3e4844['changed']('closed')){_0x3e4844[_0x13cd('0xb')]=moment()[_0x13cd('0xc')](_0x13cd('0xd'));}_0x1aacdb(null,_0x3e4844);}},'charset':_0x13cd('0xe'),'collate':_0x13cd('0xf')});}; \ No newline at end of file +var _0x978b=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci'];(function(_0x233c32,_0x3bdb3e){var _0x316ec6=function(_0x2e889d){while(--_0x2e889d){_0x233c32['push'](_0x233c32['shift']());}};_0x316ec6(++_0x3bdb3e);}(_0x978b,0xe0));var _0xb978=function(_0x22b085,_0x558e12){_0x22b085=_0x22b085-0x0;var _0x31bb92=_0x978b[_0x22b085];return _0x31bb92;};'use strict';var _=require(_0xb978('0x0'));var util=require('util');var logger=require(_0xb978('0x1'))('api');var moment=require(_0xb978('0x2'));var BPromise=require(_0xb978('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb978('0x4'));var rimraf=require(_0xb978('0x5'));var config=require(_0xb978('0x6'));var attributes=require(_0xb978('0x7'));module[_0xb978('0x8')]=function(_0x37215b,_0x3dfba2){return _0x37215b[_0xb978('0x9')]('ChatInteraction',attributes,{'tableName':_0xb978('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d101d,_0x355d02,_0x5f229b){if(_0x2d101d[_0xb978('0xb')]('closed')){_0x2d101d[_0xb978('0xc')]=moment()[_0xb978('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f229b(null,_0x2d101d);}},'charset':_0xb978('0xe'),'collate':_0xb978('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 066714f..2e54e01 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 _0x5d34=['options','raw','where','limit','then','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body'];(function(_0x29d0e7,_0x71dfd9){var _0x133f7e=function(_0x327f1a){while(--_0x327f1a){_0x29d0e7['push'](_0x29d0e7['shift']());}};_0x133f7e(++_0x71dfd9);}(_0x5d34,0x17e));var _0x45d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d34[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x45d3('0x0'));var moment=require(_0x45d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45d3('0x2'));var db=require(_0x45d3('0x3'))['db'];var utils=require(_0x45d3('0x4'));var logger=require('../../config/logger')(_0x45d3('0x5'));var config=require('../../config/environment');var jayson=require(_0x45d3('0x6'));var client=jayson['client'][_0x45d3('0x7')]({'port':0x232a});config[_0x45d3('0x8')]=_[_0x45d3('0x9')](config[_0x45d3('0x8')],{'host':_0x45d3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45d3('0x8')]));require(_0x45d3('0xb'))['register'](socket);function respondWithRpcPromise(_0x1edcc4,_0x1a9961,_0x166028){return new BPromise(function(_0x510017,_0x2ebd6f){return client['request'](_0x1edcc4,_0x166028)['then'](function(_0x230333){logger[_0x45d3('0xc')](_0x45d3('0xd'),_0x1a9961,_0x45d3('0xe'));logger[_0x45d3('0xf')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1a9961,_0x45d3('0xe'),JSON['stringify'](_0x230333));if(_0x230333[_0x45d3('0x10')]){if(_0x230333['error'][_0x45d3('0x11')]===0x1f4){logger[_0x45d3('0x10')](_0x45d3('0xd'),_0x1a9961,_0x230333[_0x45d3('0x10')][_0x45d3('0x12')]);return _0x2ebd6f(_0x230333[_0x45d3('0x10')]['message']);}logger[_0x45d3('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x1a9961,_0x230333[_0x45d3('0x10')][_0x45d3('0x12')]);return _0x510017(_0x230333['error'][_0x45d3('0x12')]);}else{logger[_0x45d3('0xc')](_0x45d3('0xd'),_0x1a9961,_0x45d3('0xe'));_0x510017(_0x230333[_0x45d3('0x13')][_0x45d3('0x12')]);}})[_0x45d3('0x14')](function(_0x49a7cd){logger[_0x45d3('0x10')](_0x45d3('0xd'),_0x1a9961,_0x49a7cd);_0x2ebd6f(_0x49a7cd);});});}exports[_0x45d3('0x15')]=function(_0x1118ee){var _0x2fb905=this;return new Promise(function(_0x3e774e,_0x438591){return db[_0x45d3('0x16')][_0x45d3('0x17')](_0x1118ee[_0x45d3('0x18')],{'raw':_0x1118ee[_0x45d3('0x19')]?_0x1118ee[_0x45d3('0x19')][_0x45d3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1118ee[_0x45d3('0x19')]?_0x1118ee[_0x45d3('0x19')][_0x45d3('0x1b')]||null:null,'attributes':_0x1118ee[_0x45d3('0x19')]?_0x1118ee['options']['attributes']||null:null,'limit':_0x1118ee[_0x45d3('0x19')]?_0x1118ee['options'][_0x45d3('0x1c')]||null:null})[_0x45d3('0x1d')](function(_0x2acca6){logger[_0x45d3('0xc')](_0x45d3('0x15'),_0x1118ee);logger[_0x45d3('0xf')](_0x45d3('0x15'),_0x1118ee,JSON[_0x45d3('0x1e')](_0x2acca6));_0x3e774e(_0x2acca6);})[_0x45d3('0x14')](function(_0x1f454e){logger[_0x45d3('0x10')](_0x45d3('0x15'),_0x1f454e['message'],_0x1118ee);_0x438591(_0x2fb905[_0x45d3('0x10')](0x1f4,_0x1f454e[_0x45d3('0x12')]));});});};exports[_0x45d3('0x1f')]=function(_0x157a3a){return new Promise(function(_0x916871,_0x5cb251){return db['ChatInteraction'][_0x45d3('0x20')]({'where':_0x157a3a[_0x45d3('0x19')]?_0x157a3a[_0x45d3('0x19')][_0x45d3('0x1b')]||null:null})[_0x45d3('0x1d')](function(_0x1a553f){if(_0x1a553f){return _0x1a553f[_0x45d3('0x21')](_0x157a3a[_0x45d3('0x18')][_0x45d3('0x22')],_[_0x45d3('0x23')](_0x157a3a[_0x45d3('0x18')],[_0x45d3('0x22'),'id'])||{});}})['spread'](function(_0x54a94e){logger['info'](_0x45d3('0x24'),_0x157a3a);logger[_0x45d3('0xf')](_0x45d3('0x24'),_0x157a3a,JSON[_0x45d3('0x1e')](_0x54a94e));_0x916871(_0x54a94e);})[_0x45d3('0x14')](function(_0x4184cf){logger[_0x45d3('0x10')](_0x45d3('0x24'),_0x4184cf[_0x45d3('0x12')],_0x157a3a);_0x5cb251(_this[_0x45d3('0x10')](0x1f4,_0x4184cf[_0x45d3('0x12')]));});});}; \ No newline at end of file +var _0xc8b9=['attributes','limit','AddTagsToChatInteraction','ChatInteraction','where','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','options','raw'];(function(_0x4f36a6,_0x9f224d){var _0x1f8a94=function(_0xb3ab2e){while(--_0xb3ab2e){_0x4f36a6['push'](_0x4f36a6['shift']());}};_0x1f8a94(++_0x9f224d);}(_0xc8b9,0x1ae));var _0x9c8b=function(_0x15b56a,_0x567846){_0x15b56a=_0x15b56a-0x0;var _0x5a6617=_0xc8b9[_0x15b56a];return _0x5a6617;};'use strict';var _=require(_0x9c8b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9c8b('0x1'));var rs=require(_0x9c8b('0x2'));var fs=require('fs');var Redis=require(_0x9c8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c8b('0x4'));var logger=require(_0x9c8b('0x5'))('rpc');var config=require(_0x9c8b('0x6'));var jayson=require(_0x9c8b('0x7'));var client=jayson[_0x9c8b('0x8')][_0x9c8b('0x9')]({'port':0x232a});config[_0x9c8b('0xa')]=_['defaults'](config[_0x9c8b('0xa')],{'host':_0x9c8b('0xb'),'port':0x18eb});var socket=require(_0x9c8b('0xc'))(new Redis(config[_0x9c8b('0xa')]));require(_0x9c8b('0xd'))[_0x9c8b('0xe')](socket);function respondWithRpcPromise(_0x3774df,_0x2aee8a,_0x174270){return new BPromise(function(_0x226c24,_0x35e307){return client[_0x9c8b('0xf')](_0x3774df,_0x174270)[_0x9c8b('0x10')](function(_0x1895a4){logger[_0x9c8b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x2aee8a,_0x9c8b('0x12'));logger[_0x9c8b('0x13')](_0x9c8b('0x14'),_0x2aee8a,'request\x20sent',JSON[_0x9c8b('0x15')](_0x1895a4));if(_0x1895a4[_0x9c8b('0x16')]){if(_0x1895a4[_0x9c8b('0x16')]['code']===0x1f4){logger[_0x9c8b('0x16')](_0x9c8b('0x17'),_0x2aee8a,_0x1895a4['error']['message']);return _0x35e307(_0x1895a4['error'][_0x9c8b('0x18')]);}logger[_0x9c8b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2aee8a,_0x1895a4[_0x9c8b('0x16')][_0x9c8b('0x18')]);return _0x226c24(_0x1895a4['error']['message']);}else{logger[_0x9c8b('0x11')](_0x9c8b('0x17'),_0x2aee8a,'request\x20sent');_0x226c24(_0x1895a4[_0x9c8b('0x19')]['message']);}})[_0x9c8b('0x1a')](function(_0x51b266){logger[_0x9c8b('0x16')](_0x9c8b('0x17'),_0x2aee8a,_0x51b266);_0x35e307(_0x51b266);});});}exports[_0x9c8b('0x1b')]=function(_0x20a600){var _0x2af727=this;return new Promise(function(_0x1f9af3,_0x4e1b48){return db['ChatInteraction'][_0x9c8b('0x1c')](_0x20a600[_0x9c8b('0x1d')],{'raw':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')][_0x9c8b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')]['where']||null:null,'attributes':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')][_0x9c8b('0x20')]||null:null,'limit':_0x20a600['options']?_0x20a600['options'][_0x9c8b('0x21')]||null:null})[_0x9c8b('0x10')](function(_0x40b4e1){logger['info'](_0x9c8b('0x1b'),_0x20a600);logger['debug']('UpdateChatInteraction',_0x20a600,JSON[_0x9c8b('0x15')](_0x40b4e1));_0x1f9af3(_0x40b4e1);})['catch'](function(_0x394c44){logger[_0x9c8b('0x16')](_0x9c8b('0x1b'),_0x394c44[_0x9c8b('0x18')],_0x20a600);_0x4e1b48(_0x2af727[_0x9c8b('0x16')](0x1f4,_0x394c44[_0x9c8b('0x18')]));});});};exports[_0x9c8b('0x22')]=function(_0x55a6c2){return new Promise(function(_0x102985,_0x2d499d){return db[_0x9c8b('0x23')]['find']({'where':_0x55a6c2[_0x9c8b('0x1e')]?_0x55a6c2[_0x9c8b('0x1e')][_0x9c8b('0x24')]||null:null})[_0x9c8b('0x10')](function(_0x942d45){if(_0x942d45){return _0x942d45[_0x9c8b('0x25')](_0x55a6c2['body'][_0x9c8b('0x26')],_[_0x9c8b('0x27')](_0x55a6c2[_0x9c8b('0x1d')],[_0x9c8b('0x26'),'id'])||{});}})[_0x9c8b('0x28')](function(_0x11ea7e){logger[_0x9c8b('0x11')](_0x9c8b('0x29'),_0x55a6c2);logger[_0x9c8b('0x13')](_0x9c8b('0x29'),_0x55a6c2,JSON[_0x9c8b('0x15')](_0x11ea7e));_0x102985(_0x11ea7e);})[_0x9c8b('0x1a')](function(_0x274b05){logger[_0x9c8b('0x16')]('AddTags',_0x274b05[_0x9c8b('0x18')],_0x55a6c2);_0x2d499d(_this[_0x9c8b('0x16')](0x1f4,_0x274b05[_0x9c8b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 40696a3..0adb9c9 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 _0x32f6=['update','emit','length','chatInteraction:','remove'];(function(_0x32a04a,_0x53a6f0){var _0x525cf8=function(_0x18caea){while(--_0x18caea){_0x32a04a['push'](_0x32a04a['shift']());}};_0x525cf8(++_0x53a6f0);}(_0x32f6,0xbd));var _0x632f=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x32f6[_0x45d55e];return _0x29812a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x632f('0x0'),_0x632f('0x1')];function createListener(_0x52096f,_0x4338c6){return function(_0xf725bd){_0x4338c6[_0x632f('0x2')](_0x52096f,_0xf725bd);};}function removeListener(_0x3b5c4a,_0x272348){return function(){ChatInteractionEvents['removeListener'](_0x3b5c4a,_0x272348);};}exports['register']=function(_0x4cead1){for(var _0x5f3464=0x0,_0x3a7a11=events[_0x632f('0x3')];_0x5f3464<_0x3a7a11;_0x5f3464++){var _0x3c7840=events[_0x5f3464];var _0x23a925=createListener(_0x632f('0x4')+_0x3c7840,_0x4cead1);ChatInteractionEvents['on'](_0x3c7840,_0x23a925);}}; \ No newline at end of file +var _0x97db=['length','chatInteraction:','save','remove','update','removeListener','register'];(function(_0x2edd52,_0x421654){var _0x4cf728=function(_0x4a60da){while(--_0x4a60da){_0x2edd52['push'](_0x2edd52['shift']());}};_0x4cf728(++_0x421654);}(_0x97db,0x8e));var _0xb97d=function(_0x5039e1,_0x5167e7){_0x5039e1=_0x5039e1-0x0;var _0x46dc2f=_0x97db[_0x5039e1];return _0x46dc2f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb97d('0x0'),_0xb97d('0x1'),_0xb97d('0x2')];function createListener(_0xdc4f5,_0xe05ea6){return function(_0x5f250b){_0xe05ea6['emit'](_0xdc4f5,_0x5f250b);};}function removeListener(_0x4c34ed,_0x42b7e0){return function(){ChatInteractionEvents[_0xb97d('0x3')](_0x4c34ed,_0x42b7e0);};}exports[_0xb97d('0x4')]=function(_0x54d574){for(var _0x523e31=0x0,_0x3a0842=events[_0xb97d('0x5')];_0x523e31<_0x3a0842;_0x523e31++){var _0x2a96c3=events[_0x523e31];var _0x4c81d0=createListener(_0xb97d('0x6')+_0x2a96c3,_0x54d574);ChatInteractionEvents['on'](_0x2a96c3,_0x4c81d0);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c5a4754..c4eca7a 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 _0xb234=['attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','%s-%s','now','/:id/attachment_upload','single','file'];(function(_0x288cf9,_0x2bc8e6){var _0x4a6348=function(_0x12b895){while(--_0x12b895){_0x288cf9['push'](_0x288cf9['shift']());}};_0x4a6348(++_0x2bc8e6);}(_0xb234,0x11c));var _0x4b23=function(_0x50d8fa,_0x4142c2){_0x50d8fa=_0x50d8fa-0x0;var _0x3a8aad=_0xb234[_0x50d8fa];return _0x3a8aad;};'use strict';var multer=require('multer');var util=require(_0x4b23('0x0'));var path=require(_0x4b23('0x1'));var timeout=require(_0x4b23('0x2'));var express=require(_0x4b23('0x3'));var router=express[_0x4b23('0x4')]();var fs_extra=require(_0x4b23('0x5'));var auth=require(_0x4b23('0x6'));var interaction=require(_0x4b23('0x7'));var config=require('../../config/environment');var controller=require(_0x4b23('0x8'));router[_0x4b23('0x9')]('/',auth[_0x4b23('0xa')](),controller[_0x4b23('0xb')]);router[_0x4b23('0x9')](_0x4b23('0xc'),auth[_0x4b23('0xa')](),controller[_0x4b23('0xd')]);router[_0x4b23('0x9')](_0x4b23('0xe'),auth[_0x4b23('0xf')](),controller[_0x4b23('0x10')]);router[_0x4b23('0x9')]('/:id/attachment_download',auth[_0x4b23('0xf')](),controller[_0x4b23('0x11')]);router['get'](_0x4b23('0x12'),auth[_0x4b23('0xa')](),controller['getMessages']);router[_0x4b23('0x9')](_0x4b23('0x13'),auth[_0x4b23('0xf')](),controller[_0x4b23('0x14')]);router[_0x4b23('0x9')](_0x4b23('0x15'),auth[_0x4b23('0xa')](),controller[_0x4b23('0x16')]);router[_0x4b23('0x17')]('/',auth[_0x4b23('0xa')](),controller[_0x4b23('0x18')]);router[_0x4b23('0x17')](_0x4b23('0x19'),auth[_0x4b23('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4b23('0x1a')]({'destination':function(_0x28f7e4,_0x23abe8,_0x36ded7){_0x36ded7(null,path[_0x4b23('0x1b')](config[_0x4b23('0x1c')],'server/files/attachments/'));},'filename':function(_0x330baf,_0x50f512,_0x59f630){_0x59f630(null,util['format'](_0x4b23('0x1d'),Date[_0x4b23('0x1e')](),_0x50f512['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4b23('0x17')](_0x4b23('0x1f'),upload[_0x4b23('0x20')](_0x4b23('0x21')),controller[_0x4b23('0x22')]);router[_0x4b23('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x4b23('0x17')](_0x4b23('0x23'),auth[_0x4b23('0xa')](),interaction[_0x4b23('0x24')](_0x4b23('0x25'),_0x4b23('0x26')),controller['addTags']);router[_0x4b23('0x27')](_0x4b23('0xe'),auth[_0x4b23('0xa')](),interaction[_0x4b23('0x24')](_0x4b23('0x25'),_0x4b23('0x28')),controller[_0x4b23('0x29')]);router['put'](_0x4b23('0x2a'),controller[_0x4b23('0x2b')]);router[_0x4b23('0x27')](_0x4b23('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x4b23('0x2d')]);router[_0x4b23('0x27')](_0x4b23('0x2e'),controller[_0x4b23('0x2f')]);router[_0x4b23('0x30')](_0x4b23('0xe'),auth[_0x4b23('0xa')](),interaction['tracked'](_0x4b23('0x25'),_0x4b23('0x31')),controller[_0x4b23('0x32')]);router['delete']('/:id/tags',auth[_0x4b23('0xa')](),controller[_0x4b23('0x33')]);module[_0x4b23('0x34')]=router; \ No newline at end of file +var _0x264f=['attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized'];(function(_0x201197,_0x33b7e6){var _0x1468bf=function(_0x13239c){while(--_0x13239c){_0x201197['push'](_0x201197['shift']());}};_0x1468bf(++_0x33b7e6);}(_0x264f,0x177));var _0xf264=function(_0x408611,_0x4c2768){_0x408611=_0x408611-0x0;var _0x5a6bf1=_0x264f[_0x408611];return _0x5a6bf1;};'use strict';var multer=require(_0xf264('0x0'));var util=require(_0xf264('0x1'));var path=require(_0xf264('0x2'));var timeout=require(_0xf264('0x3'));var express=require(_0xf264('0x4'));var router=express[_0xf264('0x5')]();var fs_extra=require(_0xf264('0x6'));var auth=require(_0xf264('0x7'));var interaction=require(_0xf264('0x8'));var config=require(_0xf264('0x9'));var controller=require('./chatInteraction.controller');router[_0xf264('0xa')]('/',auth['isAuthenticated'](),controller[_0xf264('0xb')]);router[_0xf264('0xa')](_0xf264('0xc'),auth[_0xf264('0xd')](),controller[_0xf264('0xe')]);router[_0xf264('0xa')](_0xf264('0xf'),auth[_0xf264('0x10')](),controller['show']);router['get']('/:id/attachment_download',auth[_0xf264('0x10')](),controller[_0xf264('0x11')]);router[_0xf264('0xa')](_0xf264('0x12'),auth['isAuthenticated'](),controller[_0xf264('0x13')]);router[_0xf264('0xa')]('/:id/my_messages',auth[_0xf264('0x10')](),controller[_0xf264('0x14')]);router['get'](_0xf264('0x15'),auth[_0xf264('0xd')](),controller[_0xf264('0x16')]);router[_0xf264('0x17')]('/',auth['isAuthenticated'](),controller[_0xf264('0x18')]);router['post'](_0xf264('0x19'),auth[_0xf264('0xd')](),controller[_0xf264('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f608b,_0x461436,_0x52504f){_0x52504f(null,path['join'](config[_0xf264('0x1b')],_0xf264('0x1c')));},'filename':function(_0xc332ff,_0x10019c,_0x55b7c7){_0x55b7c7(null,util[_0xf264('0x1d')]('%s-%s',Date[_0xf264('0x1e')](),_0x10019c[_0xf264('0x1f')][_0xf264('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf264('0x17')](_0xf264('0x21'),upload['single'](_0xf264('0x22')),controller['attachmentUpload']);router[_0xf264('0x17')]('/:id/messages',auth[_0xf264('0x10')](),controller['addMessage']);router[_0xf264('0x17')]('/:id/tags',auth[_0xf264('0xd')](),interaction[_0xf264('0x23')]('chat',_0xf264('0x24')),controller[_0xf264('0x25')]);router[_0xf264('0x26')](_0xf264('0xf'),auth[_0xf264('0xd')](),interaction[_0xf264('0x23')](_0xf264('0x27'),_0xf264('0x28')),controller[_0xf264('0x29')]);router['put'](_0xf264('0x2a'),controller[_0xf264('0x2b')]);router[_0xf264('0x26')]('/:id/abandon',auth[_0xf264('0x10')](),controller[_0xf264('0x2c')]);router[_0xf264('0x26')]('/:id/close',controller['close']);router[_0xf264('0x2d')](_0xf264('0xf'),auth['isAuthenticated'](),interaction[_0xf264('0x23')](_0xf264('0x27'),_0xf264('0x2e')),controller['destroy']);router[_0xf264('0x2d')](_0xf264('0x2f'),auth[_0xf264('0xd')](),controller['removeTags']);module[_0xf264('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 3390ebf..7e3cb65 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 _0x43db=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x5ea804,_0x24716f){var _0x28cd4e=function(_0x48680e){while(--_0x48680e){_0x5ea804['push'](_0x5ea804['shift']());}};_0x28cd4e(++_0x24716f);}(_0x43db,0xc6));var _0xb43d=function(_0x288db3,_0x3a88a0){_0x288db3=_0x288db3-0x0;var _0x2a476e=_0x43db[_0x288db3];return _0x2a476e;};'use strict';var Sequelize=require(_0xb43d('0x0'));module[_0xb43d('0x1')]={'body':{'type':Sequelize[_0xb43d('0x2')](_0xb43d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb43d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb43d('0x5')]}}; \ No newline at end of file +var _0x55f6=['medium','INTEGER','exports','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x55f6,0x14e));var _0x655f=function(_0x35c013,_0x456f78){_0x35c013=_0x35c013-0x0;var _0x3e1e17=_0x55f6[_0x35c013];return _0x3e1e17;};'use strict';var Sequelize=require('sequelize');module[_0x655f('0x0')]={'body':{'type':Sequelize[_0x655f('0x1')](_0x655f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x655f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6b25ac2..29c0549 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 _0xca20=['fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','body','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xca20,0x1ca));var _0x0ca2=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xca20[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0x0ca2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ca2('0x1'));var jsonpatch=require(_0x0ca2('0x2'));var rp=require(_0x0ca2('0x3'));var moment=require(_0x0ca2('0x4'));var BPromise=require(_0x0ca2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0ca2('0x6'));var csv=require(_0x0ca2('0x7'));var ejs=require(_0x0ca2('0x8'));var fs=require('fs');var fs_extra=require(_0x0ca2('0x9'));var _=require(_0x0ca2('0xa'));var squel=require(_0x0ca2('0xb'));var crypto=require('crypto');var jsforce=require(_0x0ca2('0xc'));var deskjs=require(_0x0ca2('0xd'));var toCsv=require(_0x0ca2('0x7'));var querystring=require(_0x0ca2('0xe'));var Papa=require(_0x0ca2('0xf'));var Redis=require(_0x0ca2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ca2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ca2('0x12'))(_0x0ca2('0x13'));var utils=require(_0x0ca2('0x14'));var config=require(_0x0ca2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ca2('0x16'))['db'];config['redis']=_[_0x0ca2('0x17')](config[_0x0ca2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ca2('0x19'))(new Redis(config[_0x0ca2('0x18')]));require(_0x0ca2('0x1a'))[_0x0ca2('0x1b')](socket);function respondWithStatusCode(_0x590a54,_0x5ba8d3){_0x5ba8d3=_0x5ba8d3||0xcc;return function(_0x5b2a73){if(_0x5b2a73){return _0x590a54[_0x0ca2('0x1c')](_0x5ba8d3);}return _0x590a54[_0x0ca2('0x1d')](_0x5ba8d3)[_0x0ca2('0x1e')]();};}function respondWithResult(_0x5a4d3e,_0x205845){_0x205845=_0x205845||0xc8;return function(_0x2a7a2e){if(_0x2a7a2e){return _0x5a4d3e[_0x0ca2('0x1d')](_0x205845)[_0x0ca2('0x1f')](_0x2a7a2e);}};}function respondWithFilteredResult(_0x3af5ff,_0x26a3e0){return function(_0x313349){if(_0x313349){var _0x39d97a=typeof _0x26a3e0[_0x0ca2('0x20')]===_0x0ca2('0x21')&&typeof _0x26a3e0['limit']===_0x0ca2('0x21');var _0x3b6d08=_0x313349[_0x0ca2('0x22')];var _0x72e5d3=_0x39d97a?0x0:_0x26a3e0[_0x0ca2('0x20')];var _0x4b5406=_0x39d97a?_0x313349['count']:_0x26a3e0['offset']+_0x26a3e0[_0x0ca2('0x23')];var _0x1788ab;if(_0x4b5406>=_0x3b6d08){_0x4b5406=_0x3b6d08;_0x1788ab=0xc8;}else{_0x1788ab=0xce;}_0x3af5ff['status'](_0x1788ab);return _0x3af5ff[_0x0ca2('0x24')](_0x0ca2('0x25'),_0x72e5d3+'-'+_0x4b5406+'/'+_0x3b6d08)[_0x0ca2('0x1f')](_0x313349);}return null;};}function patchUpdates(_0xb82772){return function(_0x1b917a){try{jsonpatch[_0x0ca2('0x26')](_0x1b917a,_0xb82772,!![]);}catch(_0x3a4b8c){return BPromise[_0x0ca2('0x27')](_0x3a4b8c);}return _0x1b917a[_0x0ca2('0x28')]();};}function saveUpdates(_0x569136,_0x113a8c){return function(_0x51e78a){if(_0x51e78a){return _0x51e78a[_0x0ca2('0x29')](_0x569136)[_0x0ca2('0x2a')](function(_0x1a93ec){return _0x1a93ec;});}return null;};}function removeEntity(_0x32f917,_0x2fe5d3){return function(_0x565db2){if(_0x565db2){return _0x565db2['destroy']()[_0x0ca2('0x2a')](function(){_0x32f917[_0x0ca2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b52fd,_0x388e05){return function(_0x1336da){if(!_0x1336da){_0x3b52fd['sendStatus'](0x194);}return _0x1336da;};}function handleError(_0x3dc177,_0x2283ac){_0x2283ac=_0x2283ac||0x1f4;return function(_0x203b62){logger[_0x0ca2('0x2b')](_0x203b62[_0x0ca2('0x2c')]);if(_0x203b62[_0x0ca2('0x2d')]){delete _0x203b62['name'];}_0x3dc177[_0x0ca2('0x1d')](_0x2283ac)[_0x0ca2('0x2e')](_0x203b62);};}exports[_0x0ca2('0x2f')]=function(_0x2249d5,_0x5823b3){var _0x3ab2c1={},_0x45f83b={},_0x1eef26={'count':0x0,'rows':[]};var _0x2bf852=_[_0x0ca2('0x30')](db[_0x0ca2('0x31')]['rawAttributes'],function(_0x2ccf68){return{'name':_0x2ccf68[_0x0ca2('0x32')],'type':_0x2ccf68[_0x0ca2('0x33')]['key']};});_0x45f83b[_0x0ca2('0x34')]=_[_0x0ca2('0x30')](_0x2bf852,_0x0ca2('0x2d'));_0x45f83b['query']=_[_0x0ca2('0x35')](_0x2249d5[_0x0ca2('0x36')]);_0x45f83b['filters']=_[_0x0ca2('0x37')](_0x45f83b[_0x0ca2('0x34')],_0x45f83b[_0x0ca2('0x36')]);_0x3ab2c1[_0x0ca2('0x38')]=_[_0x0ca2('0x37')](_0x45f83b[_0x0ca2('0x34')],qs['fields'](_0x2249d5[_0x0ca2('0x36')][_0x0ca2('0x39')]));_0x3ab2c1[_0x0ca2('0x38')]=_0x3ab2c1['attributes'][_0x0ca2('0x3a')]?_0x3ab2c1['attributes']:_0x45f83b['model'];if(!_0x2249d5[_0x0ca2('0x36')][_0x0ca2('0x3b')](_0x0ca2('0x3c'))){_0x3ab2c1[_0x0ca2('0x23')]=qs[_0x0ca2('0x23')](_0x2249d5[_0x0ca2('0x36')][_0x0ca2('0x23')]);_0x3ab2c1[_0x0ca2('0x20')]=qs['offset'](_0x2249d5[_0x0ca2('0x36')][_0x0ca2('0x20')]);}_0x3ab2c1[_0x0ca2('0x3d')]=qs[_0x0ca2('0x3e')](_0x2249d5['query'][_0x0ca2('0x3e')]);_0x3ab2c1['where']=qs['filters'](_[_0x0ca2('0x3f')](_0x2249d5[_0x0ca2('0x36')],_0x45f83b[_0x0ca2('0x40')]),_0x2bf852);if(_0x2249d5[_0x0ca2('0x36')][_0x0ca2('0x41')]){_0x3ab2c1[_0x0ca2('0x42')]=_[_0x0ca2('0x43')](_0x3ab2c1['where'],{'$or':_['map'](_0x2bf852,function(_0x47970d){if(_0x47970d[_0x0ca2('0x33')]!==_0x0ca2('0x44')){var _0xce578={};_0xce578[_0x47970d['name']]={'$like':'%'+_0x2249d5[_0x0ca2('0x36')]['filter']+'%'};return _0xce578;}})});}_0x3ab2c1=_[_0x0ca2('0x43')]({},_0x3ab2c1,_0x2249d5['options']);var _0xdeb6b3={'where':_0x3ab2c1[_0x0ca2('0x42')]};return db[_0x0ca2('0x31')]['count'](_0xdeb6b3)[_0x0ca2('0x2a')](function(_0x4816c0){_0x1eef26['count']=_0x4816c0;if(_0x2249d5['query']['includeAll']){_0x3ab2c1[_0x0ca2('0x45')]=[{'all':!![]}];}return db[_0x0ca2('0x31')][_0x0ca2('0x46')](_0x3ab2c1);})[_0x0ca2('0x2a')](function(_0x36208c){_0x1eef26[_0x0ca2('0x47')]=_0x36208c;return _0x1eef26;})['then'](respondWithFilteredResult(_0x5823b3,_0x3ab2c1))[_0x0ca2('0x48')](handleError(_0x5823b3,null));};exports['show']=function(_0x4fc624,_0x2057d2){var _0x39b514={'raw':!![],'where':{'id':_0x4fc624[_0x0ca2('0x49')]['id']}},_0x1543e0={};_0x1543e0[_0x0ca2('0x34')]=_[_0x0ca2('0x35')](db[_0x0ca2('0x31')][_0x0ca2('0x4a')]);_0x1543e0[_0x0ca2('0x36')]=_[_0x0ca2('0x35')](_0x4fc624[_0x0ca2('0x36')]);_0x1543e0[_0x0ca2('0x40')]=_[_0x0ca2('0x37')](_0x1543e0[_0x0ca2('0x34')],_0x1543e0[_0x0ca2('0x36')]);_0x39b514[_0x0ca2('0x38')]=_['intersection'](_0x1543e0[_0x0ca2('0x34')],qs[_0x0ca2('0x39')](_0x4fc624[_0x0ca2('0x36')][_0x0ca2('0x39')]));_0x39b514['attributes']=_0x39b514[_0x0ca2('0x38')][_0x0ca2('0x3a')]?_0x39b514[_0x0ca2('0x38')]:_0x1543e0['model'];if(_0x4fc624[_0x0ca2('0x36')][_0x0ca2('0x4b')]){_0x39b514['include']=[{'all':!![]}];}_0x39b514=_[_0x0ca2('0x43')]({},_0x39b514,_0x4fc624[_0x0ca2('0x4c')]);return db[_0x0ca2('0x31')][_0x0ca2('0x4d')](_0x39b514)[_0x0ca2('0x2a')](handleEntityNotFound(_0x2057d2,null))[_0x0ca2('0x2a')](respondWithResult(_0x2057d2,null))[_0x0ca2('0x48')](handleError(_0x2057d2,null));};exports[_0x0ca2('0x4e')]=function(_0x47ee74,_0x1c15b4){return db['ChatInternalMessage'][_0x0ca2('0x4e')](_0x47ee74['body'],{})[_0x0ca2('0x2a')](respondWithResult(_0x1c15b4,0xc9))[_0x0ca2('0x48')](handleError(_0x1c15b4,null));};exports[_0x0ca2('0x29')]=function(_0x47e528,_0x57fcad){if(_0x47e528['body']['id']){delete _0x47e528[_0x0ca2('0x4f')]['id'];}return db['ChatInternalMessage'][_0x0ca2('0x4d')]({'where':{'id':_0x47e528[_0x0ca2('0x49')]['id']}})[_0x0ca2('0x2a')](handleEntityNotFound(_0x57fcad,null))[_0x0ca2('0x2a')](saveUpdates(_0x47e528['body'],null))['then'](respondWithResult(_0x57fcad,null))['catch'](handleError(_0x57fcad,null));};exports[_0x0ca2('0x50')]=function(_0x3f201d,_0x1f6ce6){return db[_0x0ca2('0x31')][_0x0ca2('0x4d')]({'where':{'id':_0x3f201d['params']['id']}})[_0x0ca2('0x2a')](handleEntityNotFound(_0x1f6ce6,null))[_0x0ca2('0x2a')](removeEntity(_0x1f6ce6,null))[_0x0ca2('0x48')](handleError(_0x1f6ce6,null));};exports[_0x0ca2('0x51')]=function(_0xbc2102,_0x161356){return db[_0x0ca2('0x31')][_0x0ca2('0x51')]()[_0x0ca2('0x2a')](respondWithResult(_0x161356,null))['catch'](handleError(_0x161356,null));};function wrapUser(_0x76f1a1){return function(_0x339465){var _0x239c7f=_0x76f1a1[_0x0ca2('0x52')]({'plain':!![]});_0x239c7f[_0x0ca2('0x53')]=[];if(_0x339465){_0x239c7f['lastMessageAt']=_0x339465[_0x0ca2('0x54')];_0x239c7f[_0x0ca2('0x55')]=_0x339465;}else{_0x239c7f[_0x0ca2('0x56')]=moment(0x0)[_0x0ca2('0x57')](_0x0ca2('0x58'));_0x239c7f['lastMessage']={};}return _0x239c7f;};}exports[_0x0ca2('0x59')]=function(_0x512789,_0x1f9731,_0x165c91){var _0x372951=[];return db[_0x0ca2('0x5a')][_0x0ca2('0x46')]({'where':{'role':[_0x0ca2('0x5b'),'admin',_0x0ca2('0x5c')]},'attributes':['id',_0x0ca2('0x5d'),_0x0ca2('0x2d'),_0x0ca2('0x5e'),_0x0ca2('0x5f'),_0x0ca2('0x60'),_0x0ca2('0x61'),_0x0ca2('0x62'),_0x0ca2('0x63'),_0x0ca2('0x64')],'order':qs[_0x0ca2('0x3e')]('-online'),'include':[{'model':db[_0x0ca2('0x65')],'as':_0x0ca2('0x66'),'attributes':['id',_0x0ca2('0x2d'),_0x0ca2('0x33')],'through':{'attributes':[]}}]})[_0x0ca2('0x2a')](function(_0x51b795){if(_0x51b795){var _0x371ff4=_0x512789['user'][_0x0ca2('0x52')]({'plain':!![]});if(!_0x371ff4)throw new Error(_0x0ca2('0x67'));if(_0x371ff4[_0x0ca2('0x5e')]===_0x0ca2('0x5c')){return db[_0x0ca2('0x68')]['find']({'where':{'name':_0x0ca2('0x69'),'userProfileId':_0x371ff4[_0x0ca2('0x6a')]},'raw':!![]})[_0x0ca2('0x2a')](function(_0x39f8f7){if(_0x39f8f7){if(_0x39f8f7['autoAssociation']===0x0){return db[_0x0ca2('0x6b')][_0x0ca2('0x46')]({'where':{'sectionId':_0x39f8f7['id']},'raw':!![]})[_0x0ca2('0x2a')](function(_0x50c32d){var _0x56a085=[];if(_[_0x0ca2('0x6c')](_0x50c32d)){_0x56a085=_[_0x0ca2('0x41')](_0x51b795,function(_0x1ef294){if(_0x1ef294[_0x0ca2('0x5e')]!=='agent'){return _0x1ef294;}});return _0x56a085;}else{for(var _0x1bda34=0x0;_0x1bda34<_0x51b795['length'];_0x1bda34++){var _0x108ad8=_0x51b795[_0x1bda34];if(_0x108ad8[_0x0ca2('0x5e')]==='agent'){var _0x42afc0=_[_0x0ca2('0x4d')](_0x50c32d,function(_0x53ce59){return _0x53ce59[_0x0ca2('0x6d')]===_0x108ad8['id'];});if(_0x42afc0)_0x56a085[_0x0ca2('0x6e')](_0x108ad8);}else{_0x56a085['push'](_0x108ad8);}}return _0x56a085;}});}else{return _0x51b795;}}else{var _0x5bd847=_[_0x0ca2('0x41')](_0x51b795,function(_0x3c0d8f){if(_0x3c0d8f[_0x0ca2('0x5e')]!==_0x0ca2('0x5b')){return _0x3c0d8f;}});return _0x5bd847;}});}else{return _0x51b795;}}})[_0x0ca2('0x2a')](function(_0x578a5a){var _0x186de3=[];if(_0x578a5a){_0x372951=_0x578a5a;for(var _0x278231=0x0;_0x278231<_0x578a5a[_0x0ca2('0x3a')];_0x278231+=0x1){_0x372951[_0x278231]['messages']=[];_0x186de3[_0x0ca2('0x6e')](db[_0x0ca2('0x31')][_0x0ca2('0x4d')]({'where':{'FromId':[_0x512789['user']['id'],_0x578a5a[_0x278231]['id']],'ToId':[_0x512789[_0x0ca2('0x5c')]['id'],_0x578a5a[_0x278231]['id']],'ChatGroupId':null},'attributes':['id',_0x0ca2('0x54'),'FromId',_0x0ca2('0x6f'),_0x0ca2('0x70'),'body'],'order':qs[_0x0ca2('0x3e')](_0x0ca2('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x578a5a[_0x278231])));}return BPromise[_0x0ca2('0x72')](_0x186de3);}return[];})['then'](function(_0x12d372){return{'rows':_0x12d372,'count':_0x12d372[_0x0ca2('0x3a')]};})[_0x0ca2('0x2a')](respondWithResult(_0x1f9731,null))['catch'](handleError(_0x1f9731,null));}; \ No newline at end of file +var _0x8a95=['UserProfileResource','isEmpty','resourceId','push','filter','messages','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','destroy','error','stack','name','send','index','ChatInternalMessage','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','get','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId'];(function(_0x2806e0,_0xc69dad){var _0x356c7b=function(_0x13b322){while(--_0x13b322){_0x2806e0['push'](_0x2806e0['shift']());}};_0x356c7b(++_0xc69dad);}(_0x8a95,0x1bb));var _0x58a9=function(_0x242e7d,_0x4545ac){_0x242e7d=_0x242e7d-0x0;var _0x2caafa=_0x8a95[_0x242e7d];return _0x2caafa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58a9('0x0'));var zipdir=require(_0x58a9('0x1'));var jsonpatch=require(_0x58a9('0x2'));var rp=require('request-promise');var moment=require(_0x58a9('0x3'));var BPromise=require(_0x58a9('0x4'));var Mustache=require(_0x58a9('0x5'));var util=require(_0x58a9('0x6'));var path=require(_0x58a9('0x7'));var sox=require(_0x58a9('0x8'));var csv=require(_0x58a9('0x9'));var ejs=require(_0x58a9('0xa'));var fs=require('fs');var fs_extra=require(_0x58a9('0xb'));var _=require(_0x58a9('0xc'));var squel=require(_0x58a9('0xd'));var crypto=require(_0x58a9('0xe'));var jsforce=require(_0x58a9('0xf'));var deskjs=require(_0x58a9('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x58a9('0x11'));var Redis=require(_0x58a9('0x12'));var authService=require(_0x58a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x58a9('0x14'));var hardwareService=require(_0x58a9('0x15'));var logger=require('../../config/logger')(_0x58a9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58a9('0x17'));var db=require('../../mysqldb')['db'];config[_0x58a9('0x18')]=_[_0x58a9('0x19')](config['redis'],{'host':_0x58a9('0x1a'),'port':0x18eb});var socket=require(_0x58a9('0x1b'))(new Redis(config[_0x58a9('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x33f2b5,_0x3aa5ca){_0x3aa5ca=_0x3aa5ca||0xcc;return function(_0x39e1be){if(_0x39e1be){return _0x33f2b5[_0x58a9('0x1c')](_0x3aa5ca);}return _0x33f2b5[_0x58a9('0x1d')](_0x3aa5ca)[_0x58a9('0x1e')]();};}function respondWithResult(_0x3ac8d7,_0x23ef06){_0x23ef06=_0x23ef06||0xc8;return function(_0x24b4f7){if(_0x24b4f7){return _0x3ac8d7[_0x58a9('0x1d')](_0x23ef06)[_0x58a9('0x1f')](_0x24b4f7);}};}function respondWithFilteredResult(_0x1088ed,_0x48a0e4){return function(_0x15922d){if(_0x15922d){var _0x2025c5=typeof _0x48a0e4['offset']===_0x58a9('0x20')&&typeof _0x48a0e4[_0x58a9('0x21')]==='undefined';var _0x56c7c2=_0x15922d[_0x58a9('0x22')];var _0x4340b7=_0x2025c5?0x0:_0x48a0e4[_0x58a9('0x23')];var _0xd6ce3f=_0x2025c5?_0x15922d[_0x58a9('0x22')]:_0x48a0e4[_0x58a9('0x23')]+_0x48a0e4[_0x58a9('0x21')];var _0x1bc688;if(_0xd6ce3f>=_0x56c7c2){_0xd6ce3f=_0x56c7c2;_0x1bc688=0xc8;}else{_0x1bc688=0xce;}_0x1088ed[_0x58a9('0x1d')](_0x1bc688);return _0x1088ed['set']('Content-Range',_0x4340b7+'-'+_0xd6ce3f+'/'+_0x56c7c2)[_0x58a9('0x1f')](_0x15922d);}return null;};}function patchUpdates(_0x1cf7a6){return function(_0x1d6d58){try{jsonpatch[_0x58a9('0x24')](_0x1d6d58,_0x1cf7a6,!![]);}catch(_0x1cb7d3){return BPromise['reject'](_0x1cb7d3);}return _0x1d6d58[_0x58a9('0x25')]();};}function saveUpdates(_0x4794ff,_0x3e2297){return function(_0x20bf2c){if(_0x20bf2c){return _0x20bf2c[_0x58a9('0x26')](_0x4794ff)[_0x58a9('0x27')](function(_0x37b560){return _0x37b560;});}return null;};}function removeEntity(_0x248110,_0x2db306){return function(_0x13025e){if(_0x13025e){return _0x13025e[_0x58a9('0x28')]()[_0x58a9('0x27')](function(){_0x248110[_0x58a9('0x1d')](0xcc)[_0x58a9('0x1e')]();});}};}function handleEntityNotFound(_0x1a382d,_0x37b85a){return function(_0x305bbc){if(!_0x305bbc){_0x1a382d[_0x58a9('0x1c')](0x194);}return _0x305bbc;};}function handleError(_0x63e1b1,_0x2262e7){_0x2262e7=_0x2262e7||0x1f4;return function(_0x564c32){logger[_0x58a9('0x29')](_0x564c32[_0x58a9('0x2a')]);if(_0x564c32[_0x58a9('0x2b')]){delete _0x564c32[_0x58a9('0x2b')];}_0x63e1b1[_0x58a9('0x1d')](_0x2262e7)[_0x58a9('0x2c')](_0x564c32);};}exports[_0x58a9('0x2d')]=function(_0x307e24,_0x169cb8){var _0x3e1e9a={},_0x58537e={},_0x23c72f={'count':0x0,'rows':[]};var _0x44856c=_['map'](db[_0x58a9('0x2e')]['rawAttributes'],function(_0x203da1){return{'name':_0x203da1[_0x58a9('0x2f')],'type':_0x203da1['type'][_0x58a9('0x30')]};});_0x58537e['model']=_[_0x58a9('0x31')](_0x44856c,'name');_0x58537e[_0x58a9('0x32')]=_['keys'](_0x307e24[_0x58a9('0x32')]);_0x58537e[_0x58a9('0x33')]=_[_0x58a9('0x34')](_0x58537e[_0x58a9('0x35')],_0x58537e[_0x58a9('0x32')]);_0x3e1e9a[_0x58a9('0x36')]=_[_0x58a9('0x34')](_0x58537e[_0x58a9('0x35')],qs[_0x58a9('0x37')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x37')]));_0x3e1e9a[_0x58a9('0x36')]=_0x3e1e9a[_0x58a9('0x36')][_0x58a9('0x38')]?_0x3e1e9a[_0x58a9('0x36')]:_0x58537e[_0x58a9('0x35')];if(!_0x307e24[_0x58a9('0x32')][_0x58a9('0x39')]('nolimit')){_0x3e1e9a[_0x58a9('0x21')]=qs[_0x58a9('0x21')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x21')]);_0x3e1e9a[_0x58a9('0x23')]=qs[_0x58a9('0x23')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x23')]);}_0x3e1e9a[_0x58a9('0x3a')]=qs[_0x58a9('0x3b')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x3b')]);_0x3e1e9a[_0x58a9('0x3c')]=qs[_0x58a9('0x33')](_[_0x58a9('0x3d')](_0x307e24[_0x58a9('0x32')],_0x58537e[_0x58a9('0x33')]),_0x44856c);if(_0x307e24[_0x58a9('0x32')]['filter']){_0x3e1e9a[_0x58a9('0x3c')]=_[_0x58a9('0x3e')](_0x3e1e9a[_0x58a9('0x3c')],{'$or':_['map'](_0x44856c,function(_0x4d797f){if(_0x4d797f['type']!==_0x58a9('0x3f')){var _0x441ee9={};_0x441ee9[_0x4d797f['name']]={'$like':'%'+_0x307e24[_0x58a9('0x32')]['filter']+'%'};return _0x441ee9;}})});}_0x3e1e9a=_[_0x58a9('0x3e')]({},_0x3e1e9a,_0x307e24[_0x58a9('0x40')]);var _0x18ce5a={'where':_0x3e1e9a[_0x58a9('0x3c')]};return db[_0x58a9('0x2e')]['count'](_0x18ce5a)[_0x58a9('0x27')](function(_0x15c3fa){_0x23c72f['count']=_0x15c3fa;if(_0x307e24[_0x58a9('0x32')][_0x58a9('0x41')]){_0x3e1e9a[_0x58a9('0x42')]=[{'all':!![]}];}return db[_0x58a9('0x2e')][_0x58a9('0x43')](_0x3e1e9a);})[_0x58a9('0x27')](function(_0x38bcd0){_0x23c72f[_0x58a9('0x44')]=_0x38bcd0;return _0x23c72f;})[_0x58a9('0x27')](respondWithFilteredResult(_0x169cb8,_0x3e1e9a))[_0x58a9('0x45')](handleError(_0x169cb8,null));};exports[_0x58a9('0x46')]=function(_0x1618cb,_0x5acba5){var _0x2b0691={'raw':!![],'where':{'id':_0x1618cb[_0x58a9('0x47')]['id']}},_0x538d5d={};_0x538d5d[_0x58a9('0x35')]=_[_0x58a9('0x48')](db[_0x58a9('0x2e')][_0x58a9('0x49')]);_0x538d5d[_0x58a9('0x32')]=_[_0x58a9('0x48')](_0x1618cb[_0x58a9('0x32')]);_0x538d5d[_0x58a9('0x33')]=_['intersection'](_0x538d5d[_0x58a9('0x35')],_0x538d5d[_0x58a9('0x32')]);_0x2b0691['attributes']=_[_0x58a9('0x34')](_0x538d5d[_0x58a9('0x35')],qs['fields'](_0x1618cb[_0x58a9('0x32')][_0x58a9('0x37')]));_0x2b0691['attributes']=_0x2b0691[_0x58a9('0x36')][_0x58a9('0x38')]?_0x2b0691[_0x58a9('0x36')]:_0x538d5d['model'];if(_0x1618cb[_0x58a9('0x32')]['includeAll']){_0x2b0691[_0x58a9('0x42')]=[{'all':!![]}];}_0x2b0691=_[_0x58a9('0x3e')]({},_0x2b0691,_0x1618cb['options']);return db[_0x58a9('0x2e')][_0x58a9('0x4a')](_0x2b0691)['then'](handleEntityNotFound(_0x5acba5,null))[_0x58a9('0x27')](respondWithResult(_0x5acba5,null))[_0x58a9('0x45')](handleError(_0x5acba5,null));};exports[_0x58a9('0x4b')]=function(_0x653b06,_0x576797){return db[_0x58a9('0x2e')][_0x58a9('0x4b')](_0x653b06[_0x58a9('0x4c')],{})[_0x58a9('0x27')](respondWithResult(_0x576797,0xc9))[_0x58a9('0x45')](handleError(_0x576797,null));};exports[_0x58a9('0x26')]=function(_0xecf5a7,_0x38a6ef){if(_0xecf5a7[_0x58a9('0x4c')]['id']){delete _0xecf5a7[_0x58a9('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0xecf5a7[_0x58a9('0x47')]['id']}})[_0x58a9('0x27')](handleEntityNotFound(_0x38a6ef,null))[_0x58a9('0x27')](saveUpdates(_0xecf5a7[_0x58a9('0x4c')],null))[_0x58a9('0x27')](respondWithResult(_0x38a6ef,null))[_0x58a9('0x45')](handleError(_0x38a6ef,null));};exports['destroy']=function(_0x3d12ef,_0x14b3cb){return db['ChatInternalMessage'][_0x58a9('0x4a')]({'where':{'id':_0x3d12ef[_0x58a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b3cb,null))[_0x58a9('0x27')](removeEntity(_0x14b3cb,null))['catch'](handleError(_0x14b3cb,null));};exports[_0x58a9('0x4d')]=function(_0x996e3e,_0x321fce){return db[_0x58a9('0x2e')][_0x58a9('0x4d')]()['then'](respondWithResult(_0x321fce,null))[_0x58a9('0x45')](handleError(_0x321fce,null));};function wrapUser(_0x4d0baf){return function(_0x3947aa){var _0x413e36=_0x4d0baf[_0x58a9('0x4e')]({'plain':!![]});_0x413e36['messages']=[];if(_0x3947aa){_0x413e36[_0x58a9('0x4f')]=_0x3947aa['createdAt'];_0x413e36[_0x58a9('0x50')]=_0x3947aa;}else{_0x413e36[_0x58a9('0x4f')]=moment(0x0)[_0x58a9('0x51')](_0x58a9('0x52'));_0x413e36[_0x58a9('0x50')]={};}return _0x413e36;};}exports[_0x58a9('0x53')]=function(_0x2eadb3,_0x304063,_0xc877b4){var _0x692a79=[];return db['User'][_0x58a9('0x43')]({'where':{'role':[_0x58a9('0x54'),'admin',_0x58a9('0x55')]},'attributes':['id','fullname',_0x58a9('0x2b'),_0x58a9('0x56'),'userpic',_0x58a9('0x57'),_0x58a9('0x58'),_0x58a9('0x59'),'allowmessenger',_0x58a9('0x5a')],'order':qs[_0x58a9('0x3b')]('-online'),'include':[{'model':db[_0x58a9('0x5b')],'as':_0x58a9('0x5c'),'attributes':['id',_0x58a9('0x2b'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3d149d){if(_0x3d149d){var _0x2269e4=_0x2eadb3[_0x58a9('0x55')]['get']({'plain':!![]});if(!_0x2269e4)throw new Error(_0x58a9('0x5d'));if(_0x2269e4[_0x58a9('0x56')]===_0x58a9('0x55')){return db[_0x58a9('0x5e')][_0x58a9('0x4a')]({'where':{'name':_0x58a9('0x5f'),'userProfileId':_0x2269e4[_0x58a9('0x60')]},'raw':!![]})[_0x58a9('0x27')](function(_0x30e7e7){if(_0x30e7e7){if(_0x30e7e7['autoAssociation']===0x0){return db[_0x58a9('0x61')][_0x58a9('0x43')]({'where':{'sectionId':_0x30e7e7['id']},'raw':!![]})[_0x58a9('0x27')](function(_0x1b2e08){var _0x33ffca=[];if(_[_0x58a9('0x62')](_0x1b2e08)){_0x33ffca=_['filter'](_0x3d149d,function(_0x3039be){if(_0x3039be['role']!==_0x58a9('0x54')){return _0x3039be;}});return _0x33ffca;}else{for(var _0x313293=0x0;_0x313293<_0x3d149d['length'];_0x313293++){var _0x26b622=_0x3d149d[_0x313293];if(_0x26b622['role']==='agent'){var _0xe0338b=_[_0x58a9('0x4a')](_0x1b2e08,function(_0x59fb13){return _0x59fb13[_0x58a9('0x63')]===_0x26b622['id'];});if(_0xe0338b)_0x33ffca['push'](_0x26b622);}else{_0x33ffca[_0x58a9('0x64')](_0x26b622);}}return _0x33ffca;}});}else{return _0x3d149d;}}else{var _0x3f8f13=_[_0x58a9('0x65')](_0x3d149d,function(_0x282dbe){if(_0x282dbe[_0x58a9('0x56')]!==_0x58a9('0x54')){return _0x282dbe;}});return _0x3f8f13;}});}else{return _0x3d149d;}}})[_0x58a9('0x27')](function(_0x24b112){var _0x3510df=[];if(_0x24b112){_0x692a79=_0x24b112;for(var _0x2e7e86=0x0;_0x2e7e86<_0x24b112[_0x58a9('0x38')];_0x2e7e86+=0x1){_0x692a79[_0x2e7e86][_0x58a9('0x66')]=[];_0x3510df[_0x58a9('0x64')](db[_0x58a9('0x2e')][_0x58a9('0x4a')]({'where':{'FromId':[_0x2eadb3[_0x58a9('0x55')]['id'],_0x24b112[_0x2e7e86]['id']],'ToId':[_0x2eadb3[_0x58a9('0x55')]['id'],_0x24b112[_0x2e7e86]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x58a9('0x67'),_0x58a9('0x68'),_0x58a9('0x69'),_0x58a9('0x4c')],'order':qs[_0x58a9('0x3b')](_0x58a9('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x58a9('0x27')](wrapUser(_0x24b112[_0x2e7e86])));}return BPromise[_0x58a9('0x6b')](_0x3510df);}return[];})[_0x58a9('0x27')](function(_0x4ed5b3){return{'rows':_0x4ed5b3,'count':_0x4ed5b3[_0x58a9('0x38')]};})[_0x58a9('0x27')](respondWithResult(_0x304063,null))[_0x58a9('0x45')](handleError(_0x304063,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 138b298..3900f6b 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 _0x7aad=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x40adc3,_0x47c13b){var _0x366853=function(_0x2ab437){while(--_0x2ab437){_0x40adc3['push'](_0x40adc3['shift']());}};_0x366853(++_0x47c13b);}(_0x7aad,0x1e1));var _0xd7aa=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7aad[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xd7aa('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd7aa('0x1')](0x0);var events={'afterCreate':_0xd7aa('0x2'),'afterUpdate':'update','afterDestroy':_0xd7aa('0x3')};function emitEvent(_0x8ad183){return function(_0x5cfa29,_0x277d15,_0x2e06b2){ChatInternalMessageEvents[_0xd7aa('0x4')](_0x8ad183+':'+_0x5cfa29['id'],_0x5cfa29);ChatInternalMessageEvents[_0xd7aa('0x4')](_0x8ad183,_0x5cfa29);_0x2e06b2(null);};}for(var e in events){if(events[_0xd7aa('0x5')](e)){var event=events[e];ChatInternalMessage[_0xd7aa('0x6')](e,emitEvent(event));}}module[_0xd7aa('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3166=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3166,0xbb));var _0x6316=function(_0x20afa0,_0xaf84ab){_0x20afa0=_0x20afa0-0x0;var _0x5981f2=_0x3166[_0x20afa0];return _0x5981f2;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6316('0x0'))['db'][_0x6316('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6316('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6316('0x3'),'afterDestroy':_0x6316('0x4')};function emitEvent(_0x516ce3){return function(_0x42c249,_0x2d7fed,_0x5c34c5){ChatInternalMessageEvents[_0x6316('0x5')](_0x516ce3+':'+_0x42c249['id'],_0x42c249);ChatInternalMessageEvents[_0x6316('0x5')](_0x516ce3,_0x42c249);_0x5c34c5(null);};}for(var e in events){if(events[_0x6316('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6316('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7c56d2b..76a0da6 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 _0x8470=['./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','util','../../config/logger','rimraf'];(function(_0x22a084,_0x1cbfaa){var _0x552d4b=function(_0x33eb5a){while(--_0x33eb5a){_0x22a084['push'](_0x22a084['shift']());}};_0x552d4b(++_0x1cbfaa);}(_0x8470,0xbd));var _0x0847=function(_0x473159,_0x1a59b1){_0x473159=_0x473159-0x0;var _0x278a70=_0x8470[_0x473159];return _0x278a70;};'use strict';var _=require('lodash');var util=require(_0x0847('0x0'));var logger=require(_0x0847('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0847('0x2'));var config=require('../../config/environment');var attributes=require(_0x0847('0x3'));module[_0x0847('0x4')]=function(_0xca30f4,_0x1c28ef){return _0xca30f4['define'](_0x0847('0x5'),attributes,{'tableName':_0x0847('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0847('0x7'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xafce=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xce1ca4,_0x2fe068){var _0x20d9d8=function(_0x524eb2){while(--_0x524eb2){_0xce1ca4['push'](_0xce1ca4['shift']());}};_0x20d9d8(++_0x2fe068);}(_0xafce,0x1ba));var _0xeafc=function(_0xe41ba8,_0xfd2419){_0xe41ba8=_0xe41ba8-0x0;var _0x4872f6=_0xafce[_0xe41ba8];return _0x4872f6;};'use strict';var _=require(_0xeafc('0x0'));var util=require('util');var logger=require(_0xeafc('0x1'))(_0xeafc('0x2'));var moment=require(_0xeafc('0x3'));var BPromise=require(_0xeafc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeafc('0x5'));var rimraf=require(_0xeafc('0x6'));var config=require('../../config/environment');var attributes=require(_0xeafc('0x7'));module['exports']=function(_0x17530d,_0x555235){return _0x17530d[_0xeafc('0x8')](_0xeafc('0x9'),attributes,{'tableName':_0xeafc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeafc('0xb'),'collate':_0xeafc('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1f3cbe7..388eee2 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 _0xef72=['register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x4f1423,_0x13cc99){var _0x33c235=function(_0x48f704){while(--_0x48f704){_0x4f1423['push'](_0x4f1423['shift']());}};_0x33c235(++_0x13cc99);}(_0xef72,0xf8));var _0x2ef7=function(_0x9cf9ca,_0x1f8738){_0x9cf9ca=_0x9cf9ca-0x0;var _0x13ba06=_0xef72[_0x9cf9ca];return _0x13ba06;};'use strict';var _=require(_0x2ef7('0x0'));var util=require(_0x2ef7('0x1'));var moment=require(_0x2ef7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ef7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ef7('0x4'))(_0x2ef7('0x5'));var config=require(_0x2ef7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2ef7('0x7')]['http']({'port':0x232a});config[_0x2ef7('0x8')]=_[_0x2ef7('0x9')](config[_0x2ef7('0x8')],{'host':_0x2ef7('0xa'),'port':0x18eb});var socket=require(_0x2ef7('0xb'))(new Redis(config[_0x2ef7('0x8')]));require('./chatInternalMessage.socket')[_0x2ef7('0xc')](socket);function respondWithRpcPromise(_0x5e1adf,_0x574115,_0x448770){return new BPromise(function(_0x5f54f2,_0x54e43b){return client[_0x2ef7('0xd')](_0x5e1adf,_0x448770)[_0x2ef7('0xe')](function(_0xb1cc9){logger[_0x2ef7('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x574115,'request\x20sent');logger[_0x2ef7('0x10')](_0x2ef7('0x11'),_0x574115,_0x2ef7('0x12'),JSON[_0x2ef7('0x13')](_0xb1cc9));if(_0xb1cc9['error']){if(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x15')]===0x1f4){logger[_0x2ef7('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x54e43b(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}logger['error'](_0x2ef7('0x17'),_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x5f54f2(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}else{logger['info'](_0x2ef7('0x17'),_0x574115,'request\x20sent');_0x5f54f2(_0xb1cc9[_0x2ef7('0x18')][_0x2ef7('0x16')]);}})[_0x2ef7('0x19')](function(_0x290e13){logger[_0x2ef7('0x14')](_0x2ef7('0x17'),_0x574115,_0x290e13);_0x54e43b(_0x290e13);});});} \ No newline at end of file +var _0x1f10=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1f10,0x69));var _0x01f1=function(_0x3b590a,_0x340cf5){_0x3b590a=_0x3b590a-0x0;var _0x525e70=_0x1f10[_0x3b590a];return _0x525e70;};'use strict';var _=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var moment=require('moment');var BPromise=require(_0x01f1('0x2'));var rs=require(_0x01f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x01f1('0x4'));var logger=require('../../config/logger')(_0x01f1('0x5'));var config=require(_0x01f1('0x6'));var jayson=require(_0x01f1('0x7'));var client=jayson['client'][_0x01f1('0x8')]({'port':0x232a});config[_0x01f1('0x9')]=_[_0x01f1('0xa')](config[_0x01f1('0x9')],{'host':_0x01f1('0xb'),'port':0x18eb});var socket=require(_0x01f1('0xc'))(new Redis(config[_0x01f1('0x9')]));require(_0x01f1('0xd'))['register'](socket);function respondWithRpcPromise(_0x120bd1,_0x413939,_0x46dd46){return new BPromise(function(_0x38c644,_0x4fee68){return client['request'](_0x120bd1,_0x46dd46)[_0x01f1('0xe')](function(_0x2df4f5){logger[_0x01f1('0xf')](_0x01f1('0x10'),_0x413939,_0x01f1('0x11'));logger[_0x01f1('0x12')](_0x01f1('0x13'),_0x413939,_0x01f1('0x11'),JSON['stringify'](_0x2df4f5));if(_0x2df4f5[_0x01f1('0x14')]){if(_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x15')]===0x1f4){logger[_0x01f1('0x14')](_0x01f1('0x10'),_0x413939,_0x2df4f5['error'][_0x01f1('0x16')]);return _0x4fee68(_0x2df4f5['error'][_0x01f1('0x16')]);}logger[_0x01f1('0x14')](_0x01f1('0x10'),_0x413939,_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x16')]);return _0x38c644(_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x16')]);}else{logger[_0x01f1('0xf')](_0x01f1('0x10'),_0x413939,_0x01f1('0x11'));_0x38c644(_0x2df4f5[_0x01f1('0x17')][_0x01f1('0x16')]);}})[_0x01f1('0x18')](function(_0xb4d953){logger['error'](_0x01f1('0x10'),_0x413939,_0xb4d953);_0x4fee68(_0xb4d953);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 987183b..0a43b99 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 _0xde44=['chatInternalMessage:','save','remove','update','emit','length'];(function(_0x145e72,_0x47f45c){var _0x3966f0=function(_0x34199c){while(--_0x34199c){_0x145e72['push'](_0x145e72['shift']());}};_0x3966f0(++_0x47f45c);}(_0xde44,0x9d));var _0x4de4=function(_0x573722,_0x2ef89a){_0x573722=_0x573722-0x0;var _0x5e4550=_0xde44[_0x573722];return _0x5e4550;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x4de4('0x0'),_0x4de4('0x1'),_0x4de4('0x2')];function createListener(_0x1c6205,_0x465102){return function(_0x4775fb){_0x465102[_0x4de4('0x3')](_0x1c6205,_0x4775fb);};}function removeListener(_0x39520d,_0x17f945){return function(){ChatInternalMessageEvents['removeListener'](_0x39520d,_0x17f945);};}exports['register']=function(_0x1a18fd){for(var _0x43dd4d=0x0,_0x54b086=events[_0x4de4('0x4')];_0x43dd4d<_0x54b086;_0x43dd4d++){var _0x3f1a02=events[_0x43dd4d];var _0x1a2766=createListener(_0x4de4('0x5')+_0x3f1a02,_0x1a18fd);ChatInternalMessageEvents['on'](_0x3f1a02,_0x1a2766);}}; \ No newline at end of file +var _0x6e85=['./chatInternalMessage.events','removeListener','register','length'];(function(_0x4bc997,_0x4e68cf){var _0x452dbf=function(_0x4b3fa0){while(--_0x4b3fa0){_0x4bc997['push'](_0x4bc997['shift']());}};_0x452dbf(++_0x4e68cf);}(_0x6e85,0xd8));var _0x56e8=function(_0x1cf919,_0x4ed777){_0x1cf919=_0x1cf919-0x0;var _0x276cf4=_0x6e85[_0x1cf919];return _0x276cf4;};'use strict';var ChatInternalMessageEvents=require(_0x56e8('0x0'));var events=['save','remove','update'];function createListener(_0x589555,_0x148bb9){return function(_0x40936c){_0x148bb9['emit'](_0x589555,_0x40936c);};}function removeListener(_0x59ad6e,_0xe98553){return function(){ChatInternalMessageEvents[_0x56e8('0x1')](_0x59ad6e,_0xe98553);};}exports[_0x56e8('0x2')]=function(_0x672050){for(var _0x2f8fc6=0x0,_0x5ad072=events[_0x56e8('0x3')];_0x2f8fc6<_0x5ad072;_0x2f8fc6++){var _0xb9d7f0=events[_0x2f8fc6];var _0x5404be=createListener('chatInternalMessage:'+_0xb9d7f0,_0x672050);ChatInternalMessageEvents['on'](_0xb9d7f0,_0x5404be);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4b60a8d..e20e49a 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 _0x4684=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post'];(function(_0xddeb96,_0x1c3406){var _0x1f270c=function(_0x2632ad){while(--_0x2632ad){_0xddeb96['push'](_0xddeb96['shift']());}};_0x1f270c(++_0x1c3406);}(_0x4684,0x156));var _0x4468=function(_0x11c331,_0x523ccf){_0x11c331=_0x11c331-0x0;var _0x1b89e1=_0x4684[_0x11c331];return _0x1b89e1;};'use strict';var multer=require(_0x4468('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4468('0x1'));var express=require(_0x4468('0x2'));var router=express['Router']();var fs_extra=require(_0x4468('0x3'));var auth=require(_0x4468('0x4'));var interaction=require(_0x4468('0x5'));var config=require(_0x4468('0x6'));var controller=require(_0x4468('0x7'));router[_0x4468('0x8')]('/',auth[_0x4468('0x9')](),controller[_0x4468('0xa')]);router[_0x4468('0x8')](_0x4468('0xb'),auth[_0x4468('0x9')](),controller[_0x4468('0xc')]);router['get'](_0x4468('0xd'),auth[_0x4468('0x9')](),controller[_0x4468('0xe')]);router[_0x4468('0x8')](_0x4468('0xf'),auth[_0x4468('0x9')](),controller[_0x4468('0x10')]);router[_0x4468('0x11')]('/',auth[_0x4468('0x9')](),controller[_0x4468('0x12')]);router[_0x4468('0x13')](_0x4468('0xf'),controller[_0x4468('0x14')]);router[_0x4468('0x15')](_0x4468('0xf'),auth['isAuthenticated'](),controller[_0x4468('0x16')]);module[_0x4468('0x17')]=router; \ No newline at end of file +var _0x6464=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','describe','/users','/:id','post','create','put'];(function(_0xbc6ee1,_0x1f5b0f){var _0x1aa916=function(_0x139248){while(--_0x139248){_0xbc6ee1['push'](_0xbc6ee1['shift']());}};_0x1aa916(++_0x1f5b0f);}(_0x6464,0x137));var _0x4646=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6464[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x4646('0x0'));var path=require(_0x4646('0x1'));var timeout=require(_0x4646('0x2'));var express=require(_0x4646('0x3'));var router=express[_0x4646('0x4')]();var fs_extra=require(_0x4646('0x5'));var auth=require(_0x4646('0x6'));var interaction=require(_0x4646('0x7'));var config=require('../../config/environment');var controller=require(_0x4646('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4646('0x9')]);router[_0x4646('0xa')](_0x4646('0xb'),auth[_0x4646('0xc')](),controller[_0x4646('0xd')]);router[_0x4646('0xa')](_0x4646('0xe'),auth[_0x4646('0xc')](),controller['getUsers']);router['get'](_0x4646('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x4646('0x10')]('/',auth[_0x4646('0xc')](),controller[_0x4646('0x11')]);router[_0x4646('0x12')](_0x4646('0xf'),controller[_0x4646('0x13')]);router['delete']('/:id',auth[_0x4646('0xc')](),controller[_0x4646('0x14')]);module[_0x4646('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 3e3c956..e03e471 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 _0xb03e=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1a76a6,_0x1a20a1){var _0x20a7a1=function(_0x436e99){while(--_0x436e99){_0x1a76a6['push'](_0x1a76a6['shift']());}};_0x20a7a1(++_0x1a20a1);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4f2741,_0x4548fd){_0x4f2741=_0x4f2741-0x0;var _0x1e4795=_0xb03e[_0x4f2741];return _0x1e4795;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'body':{'type':Sequelize[_0xeb03('0x1')](_0xeb03('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb03('0x4')]('in',_0xeb03('0x5')),'defaultValue':_0xeb03('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeb03('0x6')]},'providerName':{'type':Sequelize[_0xeb03('0x7')]},'providerResponse':{'type':Sequelize[_0xeb03('0x1')]}}; \ No newline at end of file +var _0x8f59=['medium','BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x1fea37,_0x5bbd0e){var _0x3776ca=function(_0x43ccf3){while(--_0x43ccf3){_0x1fea37['push'](_0x1fea37['shift']());}};_0x3776ca(++_0x5bbd0e);}(_0x8f59,0x11d));var _0x98f5=function(_0x560fc6,_0x59bd68){_0x560fc6=_0x560fc6-0x0;var _0x14d08a=_0x8f59[_0x560fc6];return _0x14d08a;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'body':{'type':Sequelize[_0x98f5('0x2')](_0x98f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x98f5('0x5')),'defaultValue':_0x98f5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x98f5('0x6')]},'providerName':{'type':Sequelize[_0x98f5('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 886795b..d073cb8 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 _0xdd76=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','chat','RejectMessage','rejectMessage','QueryTypes','contact','rejectmessage','formData','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','ChatMessage','findAll','rows','catch','include','options','find','create','body','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','ChatInteraction','ChatInteractionId','isNil','interaction','get','info'];(function(_0x5e1752,_0x235610){var _0x2382d2=function(_0x589694){while(--_0x589694){_0x5e1752['push'](_0x5e1752['shift']());}};_0x2382d2(++_0x235610);}(_0xdd76,0x122));var _0x6dd7=function(_0x19162f,_0xd40ef7){_0x19162f=_0x19162f-0x0;var _0x5b8a04=_0xdd76[_0x19162f];return _0x5b8a04;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6dd7('0x0'));var rp=require(_0x6dd7('0x1'));var moment=require('moment');var BPromise=require(_0x6dd7('0x2'));var Mustache=require('mustache');var util=require(_0x6dd7('0x3'));var path=require(_0x6dd7('0x4'));var sox=require('sox');var csv=require(_0x6dd7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6dd7('0x6'));var _=require(_0x6dd7('0x7'));var squel=require(_0x6dd7('0x8'));var crypto=require(_0x6dd7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6dd7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6dd7('0xb'));var Papa=require(_0x6dd7('0xc'));var Redis=require(_0x6dd7('0xd'));var authService=require(_0x6dd7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dd7('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x6dd7('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x6dd7('0x11'));var db=require(_0x6dd7('0x12'))['db'];config[_0x6dd7('0x13')]=_['defaults'](config[_0x6dd7('0x13')],{'host':_0x6dd7('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dd7('0x13')]));require(_0x6dd7('0x15'))[_0x6dd7('0x16')](socket);var jayson=require(_0x6dd7('0x17'));var client=jayson[_0x6dd7('0x18')][_0x6dd7('0x19')]({'port':0x232c});var client9002=jayson[_0x6dd7('0x18')][_0x6dd7('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x260f50,_0x3d6de1,_0x5b897a,_0x38c126){return new BPromise(function(_0x41b28a,_0x4aebfb){var _0x3f74eb=_0x38c126||client;return _0x3f74eb[_0x6dd7('0x1a')](_0x260f50,_0x5b897a)[_0x6dd7('0x1b')](function(_0x1ac6cb){logger['info'](_0x6dd7('0x1c'),_0x3d6de1,_0x6dd7('0x1d'));logger['debug'](_0x6dd7('0x1e'),_0x3d6de1,_0x6dd7('0x1d'),JSON[_0x6dd7('0x1f')](_0x1ac6cb));if(_0x1ac6cb[_0x6dd7('0x20')]){if(_0x1ac6cb[_0x6dd7('0x20')][_0x6dd7('0x21')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3d6de1,_0x1ac6cb['error']['message']);return _0x4aebfb(_0x1ac6cb['error'][_0x6dd7('0x22')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3d6de1,_0x1ac6cb[_0x6dd7('0x20')][_0x6dd7('0x22')]);return _0x41b28a(_0x1ac6cb[_0x6dd7('0x20')][_0x6dd7('0x22')]);}else{logger['info'](_0x6dd7('0x1c'),_0x3d6de1,_0x6dd7('0x1d'));_0x41b28a(_0x1ac6cb['result'][_0x6dd7('0x22')]);}})['catch'](function(_0x31d1e3){logger[_0x6dd7('0x20')](_0x6dd7('0x1c'),_0x3d6de1,_0x31d1e3);_0x4aebfb(_0x31d1e3);});});}function respondWithStatusCode(_0x1a64ef,_0x38d436){_0x38d436=_0x38d436||0xcc;return function(_0x276c5b){if(_0x276c5b){return _0x1a64ef[_0x6dd7('0x23')](_0x38d436);}return _0x1a64ef[_0x6dd7('0x24')](_0x38d436)['end']();};}function respondWithResult(_0x2cb951,_0x4ba9fa){_0x4ba9fa=_0x4ba9fa||0xc8;return function(_0x39c8a6){if(_0x39c8a6){return _0x2cb951[_0x6dd7('0x24')](_0x4ba9fa)[_0x6dd7('0x25')](_0x39c8a6);}};}function respondWithFilteredResult(_0x306c9b,_0x4a4d40){return function(_0x53fafc){if(_0x53fafc){var _0x1554db=typeof _0x4a4d40[_0x6dd7('0x26')]===_0x6dd7('0x27')&&typeof _0x4a4d40[_0x6dd7('0x28')]===_0x6dd7('0x27');var _0x2336f5=_0x53fafc[_0x6dd7('0x29')];var _0x49395e=_0x1554db?0x0:_0x4a4d40[_0x6dd7('0x26')];var _0x196e71=_0x1554db?_0x53fafc[_0x6dd7('0x29')]:_0x4a4d40['offset']+_0x4a4d40[_0x6dd7('0x28')];var _0x3f2eb3;if(_0x196e71>=_0x2336f5){_0x196e71=_0x2336f5;_0x3f2eb3=0xc8;}else{_0x3f2eb3=0xce;}_0x306c9b[_0x6dd7('0x24')](_0x3f2eb3);return _0x306c9b[_0x6dd7('0x2a')](_0x6dd7('0x2b'),_0x49395e+'-'+_0x196e71+'/'+_0x2336f5)[_0x6dd7('0x25')](_0x53fafc);}return null;};}function patchUpdates(_0x3ce8bd){return function(_0x4d21e5){try{jsonpatch[_0x6dd7('0x2c')](_0x4d21e5,_0x3ce8bd,!![]);}catch(_0x2cfdc9){return BPromise['reject'](_0x2cfdc9);}return _0x4d21e5[_0x6dd7('0x2d')]();};}function saveUpdates(_0x27d639,_0x254530){return function(_0x501441){if(_0x501441){return _0x501441[_0x6dd7('0x2e')](_0x27d639)[_0x6dd7('0x1b')](function(_0x16bc1a){return _0x16bc1a;});}return null;};}function removeEntity(_0x1e4f02,_0x120b2f){return function(_0x1fa923){if(_0x1fa923){return _0x1fa923[_0x6dd7('0x2f')]()['then'](function(){_0x1e4f02[_0x6dd7('0x24')](0xcc)[_0x6dd7('0x30')]();});}};}function handleEntityNotFound(_0xa84114,_0x548db8){return function(_0x20342a){if(!_0x20342a){_0xa84114[_0x6dd7('0x23')](0x194);}return _0x20342a;};}function handleError(_0x2b6c7f,_0x3777b6){_0x3777b6=_0x3777b6||0x1f4;return function(_0x2e87e1){logger[_0x6dd7('0x20')](_0x2e87e1[_0x6dd7('0x31')]);if(_0x2e87e1[_0x6dd7('0x32')]){delete _0x2e87e1[_0x6dd7('0x32')];}_0x2b6c7f[_0x6dd7('0x24')](_0x3777b6)[_0x6dd7('0x33')](_0x2e87e1);};}exports[_0x6dd7('0x34')]=function(_0x456152,_0x5d1cd9){var _0x42b269={},_0x2b136d={},_0xfa5060={'count':0x0,'rows':[]};var _0x590c23=_['map'](db['ChatMessage'][_0x6dd7('0x35')],function(_0x20b089){return{'name':_0x20b089[_0x6dd7('0x36')],'type':_0x20b089['type'][_0x6dd7('0x37')]};});_0x2b136d[_0x6dd7('0x38')]=_[_0x6dd7('0x39')](_0x590c23,_0x6dd7('0x32'));_0x2b136d[_0x6dd7('0x3a')]=_[_0x6dd7('0x3b')](_0x456152[_0x6dd7('0x3a')]);_0x2b136d[_0x6dd7('0x3c')]=_[_0x6dd7('0x3d')](_0x2b136d[_0x6dd7('0x38')],_0x2b136d[_0x6dd7('0x3a')]);_0x42b269[_0x6dd7('0x3e')]=_[_0x6dd7('0x3d')](_0x2b136d['model'],qs[_0x6dd7('0x3f')](_0x456152[_0x6dd7('0x3a')][_0x6dd7('0x3f')]));_0x42b269[_0x6dd7('0x3e')]=_0x42b269[_0x6dd7('0x3e')][_0x6dd7('0x40')]?_0x42b269[_0x6dd7('0x3e')]:_0x2b136d[_0x6dd7('0x38')];if(!_0x456152[_0x6dd7('0x3a')]['hasOwnProperty'](_0x6dd7('0x41'))){_0x42b269['limit']=qs['limit'](_0x456152['query']['limit']);_0x42b269['offset']=qs[_0x6dd7('0x26')](_0x456152[_0x6dd7('0x3a')][_0x6dd7('0x26')]);}_0x42b269['order']=qs[_0x6dd7('0x42')](_0x456152[_0x6dd7('0x3a')]['sort']);_0x42b269[_0x6dd7('0x43')]=qs[_0x6dd7('0x3c')](_['pick'](_0x456152[_0x6dd7('0x3a')],_0x2b136d['filters']),_0x590c23);if(_0x456152[_0x6dd7('0x3a')][_0x6dd7('0x44')]){_0x42b269[_0x6dd7('0x43')]=_[_0x6dd7('0x45')](_0x42b269[_0x6dd7('0x43')],{'$or':_[_0x6dd7('0x39')](_0x590c23,function(_0x221f18){if(_0x221f18[_0x6dd7('0x46')]!==_0x6dd7('0x47')){var _0x475409={};_0x475409[_0x221f18['name']]={'$like':'%'+_0x456152[_0x6dd7('0x3a')][_0x6dd7('0x44')]+'%'};return _0x475409;}})});}_0x42b269=_[_0x6dd7('0x45')]({},_0x42b269,_0x456152['options']);var _0x1cbe62={'where':_0x42b269[_0x6dd7('0x43')]};return db['ChatMessage']['count'](_0x1cbe62)[_0x6dd7('0x1b')](function(_0x1b72fb){_0xfa5060[_0x6dd7('0x29')]=_0x1b72fb;if(_0x456152[_0x6dd7('0x3a')][_0x6dd7('0x48')]){_0x42b269['include']=[{'all':!![]}];}return db[_0x6dd7('0x49')][_0x6dd7('0x4a')](_0x42b269);})[_0x6dd7('0x1b')](function(_0x158a5f){_0xfa5060[_0x6dd7('0x4b')]=_0x158a5f;return _0xfa5060;})[_0x6dd7('0x1b')](respondWithFilteredResult(_0x5d1cd9,_0x42b269))[_0x6dd7('0x4c')](handleError(_0x5d1cd9,null));};exports['show']=function(_0x3625dd,_0x130553){var _0x5899d8={'raw':!![],'where':{'id':_0x3625dd['params']['id']}},_0x4fc8a0={};_0x4fc8a0[_0x6dd7('0x38')]=_['keys'](db['ChatMessage'][_0x6dd7('0x35')]);_0x4fc8a0[_0x6dd7('0x3a')]=_[_0x6dd7('0x3b')](_0x3625dd['query']);_0x4fc8a0[_0x6dd7('0x3c')]=_[_0x6dd7('0x3d')](_0x4fc8a0[_0x6dd7('0x38')],_0x4fc8a0[_0x6dd7('0x3a')]);_0x5899d8[_0x6dd7('0x3e')]=_[_0x6dd7('0x3d')](_0x4fc8a0[_0x6dd7('0x38')],qs[_0x6dd7('0x3f')](_0x3625dd['query'][_0x6dd7('0x3f')]));_0x5899d8[_0x6dd7('0x3e')]=_0x5899d8[_0x6dd7('0x3e')][_0x6dd7('0x40')]?_0x5899d8[_0x6dd7('0x3e')]:_0x4fc8a0[_0x6dd7('0x38')];if(_0x3625dd[_0x6dd7('0x3a')][_0x6dd7('0x48')]){_0x5899d8[_0x6dd7('0x4d')]=[{'all':!![]}];}_0x5899d8=_['merge']({},_0x5899d8,_0x3625dd[_0x6dd7('0x4e')]);return db[_0x6dd7('0x49')][_0x6dd7('0x4f')](_0x5899d8)[_0x6dd7('0x1b')](handleEntityNotFound(_0x130553,null))[_0x6dd7('0x1b')](respondWithResult(_0x130553,null))[_0x6dd7('0x4c')](handleError(_0x130553,null));};exports[_0x6dd7('0x50')]=function(_0x464319,_0x6bd872){return db['ChatMessage']['create'](_0x464319[_0x6dd7('0x51')],{})[_0x6dd7('0x1b')](respondWithResult(_0x6bd872,0xc9))[_0x6dd7('0x4c')](handleError(_0x6bd872,null));};exports[_0x6dd7('0x2e')]=function(_0x292542,_0x393727){if(_0x292542[_0x6dd7('0x51')]['id']){delete _0x292542[_0x6dd7('0x51')]['id'];}return db[_0x6dd7('0x49')]['find']({'where':{'id':_0x292542['params']['id']}})[_0x6dd7('0x1b')](handleEntityNotFound(_0x393727,null))[_0x6dd7('0x1b')](saveUpdates(_0x292542[_0x6dd7('0x51')],null))['then'](respondWithResult(_0x393727,null))[_0x6dd7('0x4c')](handleError(_0x393727,null));};exports[_0x6dd7('0x2f')]=function(_0x47972d,_0x30e7db){return db[_0x6dd7('0x49')][_0x6dd7('0x4f')]({'where':{'id':_0x47972d['params']['id']}})[_0x6dd7('0x1b')](handleEntityNotFound(_0x30e7db,null))['then'](removeEntity(_0x30e7db,null))[_0x6dd7('0x4c')](handleError(_0x30e7db,null));};exports[_0x6dd7('0x52')]=function(_0x919310,_0x3223df){return db[_0x6dd7('0x49')][_0x6dd7('0x52')]()[_0x6dd7('0x1b')](respondWithResult(_0x3223df,null))[_0x6dd7('0x4c')](handleError(_0x3223df,null));};var interaction_log=require(_0x6dd7('0x53'))(_0x6dd7('0x54'));exports[_0x6dd7('0x55')]=function(_0x174bfa,_0x2771a3,_0x512cd7){var _0x2d70ae={'agent':{},'channel':'chat'};if(_0x174bfa[_0x6dd7('0x51')]['id']){delete _0x174bfa[_0x6dd7('0x51')]['id'];}_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x56')]=!![];_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x57')]=moment()[_0x6dd7('0x58')](_0x6dd7('0x59'));_0x174bfa['body'][_0x6dd7('0x5a')]=_0x174bfa['body'][_0x6dd7('0x5a')]||_0x174bfa[_0x6dd7('0x5b')]['id'];_0x2d70ae[_0x6dd7('0x5c')]['id']=_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x5a')];return db[_0x6dd7('0x49')][_0x6dd7('0x4f')]({'where':{'id':_0x174bfa[_0x6dd7('0x5d')]['id'],'UserId':null}})[_0x6dd7('0x1b')](handleEntityNotFound(_0x2771a3,null))[_0x6dd7('0x1b')](saveUpdates(_0x174bfa[_0x6dd7('0x51')],null))['then'](function(_0x4e429c){if(_0x4e429c){_0x2d70ae[_0x6dd7('0x22')]=_0x4e429c['get']({'plain':!![]});return db[_0x6dd7('0x5e')]['find']({'where':{'id':_0x4e429c[_0x6dd7('0x5f')]}});}return null;})[_0x6dd7('0x1b')](handleEntityNotFound(_0x2771a3,null))['then'](function(_0x3057e6){if(_0x3057e6){return _0x3057e6[_0x6dd7('0x2e')]({'UserId':_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x5a')],'read1stAt':_[_0x6dd7('0x60')](_0x3057e6['read1stAt'])?moment()[_0x6dd7('0x58')](_0x6dd7('0x59')):undefined});}return null;})['then'](function(_0x2a36ee){if(_0x2a36ee){_0x2d70ae[_0x6dd7('0x61')]=_0x2a36ee[_0x6dd7('0x62')]({'plain':!![]});interaction_log[_0x6dd7('0x63')](_0x6dd7('0x64'),_0x174bfa['user']['id'],_0x174bfa[_0x6dd7('0x5b')][_0x6dd7('0x32')],_0x174bfa['user'][_0x6dd7('0x65')],_0x2d70ae[_0x6dd7('0x61')]['id'],_0x174bfa[_0x6dd7('0x51')]?JSON['stringify'](_0x174bfa[_0x6dd7('0x51')]):_0x6dd7('0x66'));return respondWithRpcPromise(_0x6dd7('0x67'),_0x6dd7('0x68'),_0x2d70ae);}return null;})[_0x6dd7('0x1b')](function(_0x2c5211){var _0x1843fc=_0x6dd7('0x69')+_0x2c5211[_0x6dd7('0x22')][_0x6dd7('0x6a')];return db[_0x6dd7('0x6b')][_0x6dd7('0x3a')](_0x1843fc,{'type':db[_0x6dd7('0x6c')]['QueryTypes'][_0x6dd7('0x6d')],'raw':!![]})[_0x6dd7('0x1b')](function(_0x179813){return _0x179813;});})[_0x6dd7('0x1b')](function(_0x429efe){if(_0x429efe){_0x2d70ae[_0x6dd7('0x22')]['contact']=_0x429efe[0x0];if(!_0x174bfa['body'][_0x6dd7('0x5a')])return;return db[_0x6dd7('0x6e')][_0x6dd7('0x4f')]({'where':{'id':_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x5a')],'role':_0x6dd7('0x5c')},'attributes':['id','name',_0x6dd7('0x6f'),'email',_0x6dd7('0x70')],'raw':!![]});}return null;})[_0x6dd7('0x1b')](function(_0x2a7e46){if(!_0x2a7e46)return null;_0x2d70ae[_0x6dd7('0x22')][_0x6dd7('0x5c')]=_0x2a7e46;return _0x2d70ae;})['then'](function(_0xd3bb7d){if(_0xd3bb7d){if(_0x174bfa[_0x6dd7('0x51')][_0x6dd7('0x71')]){_0x2d70ae[_0x6dd7('0x22')][_0x6dd7('0x72')]=util[_0x6dd7('0x58')](_0x6dd7('0x73'),_0x174bfa[_0x6dd7('0x5b')][_0x6dd7('0x32')]);_0x2d70ae[_0x6dd7('0x22')][_0x6dd7('0x74')]=_0x2d70ae[_0x6dd7('0x74')];_0x2d70ae[_0x6dd7('0x22')][_0x6dd7('0x75')]=_0x2d70ae[_0x6dd7('0x74')];_0x2d70ae['message'][_0x6dd7('0x76')]=_0x6dd7('0x55');return respondWithRpcPromise(_0x6dd7('0x77'),_0x6dd7('0x77'),{'event':_0x6dd7('0x78'),'message':_[_0x6dd7('0x45')](_0x2d70ae[_0x6dd7('0x22')],JSON[_0x6dd7('0x79')](_0x2d70ae[_0x6dd7('0x61')]['formData']))},client9002)[_0x6dd7('0x1b')](function(){return _0x2d70ae;});}return _0x2d70ae;}return null;})[_0x6dd7('0x1b')](respondWithResult(_0x2771a3,null))[_0x6dd7('0x4c')](handleError(_0x2771a3,null));};var interaction_log=require(_0x6dd7('0x53'))(_0x6dd7('0x54'));exports[_0x6dd7('0x7a')]=function(_0x40134a,_0x378a78,_0x38d4ab){var _0x591e0c={'agent':{},'channel':_0x6dd7('0x7b')};if(_0x40134a['body']['id']){delete _0x40134a[_0x6dd7('0x51')]['id'];}_0x40134a[_0x6dd7('0x51')][_0x6dd7('0x5a')]=_0x40134a[_0x6dd7('0x51')][_0x6dd7('0x5a')]||_0x40134a['user']['id'];_0x591e0c[_0x6dd7('0x5c')]['id']=_0x40134a['body'][_0x6dd7('0x5a')];return db[_0x6dd7('0x49')]['find']({'where':{'id':_0x40134a[_0x6dd7('0x5d')]['id'],'UserId':null}})[_0x6dd7('0x1b')](handleEntityNotFound(_0x378a78,null))['then'](function(_0x23dafd){if(_0x23dafd){_0x591e0c[_0x6dd7('0x22')]=_0x23dafd[_0x6dd7('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x23dafd[_0x6dd7('0x5f')]}});}return null;})[_0x6dd7('0x1b')](handleEntityNotFound(_0x378a78,null))['then'](function(_0x11aad2){if(_0x11aad2){_0x591e0c['interaction']=_0x11aad2['get']({'plain':!![]});interaction_log[_0x6dd7('0x63')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40134a[_0x6dd7('0x5b')]['id'],_0x40134a[_0x6dd7('0x5b')][_0x6dd7('0x32')],_0x40134a[_0x6dd7('0x5b')]['role'],_0x591e0c[_0x6dd7('0x61')]['id'],_0x40134a[_0x6dd7('0x51')]?JSON['stringify'](_0x40134a[_0x6dd7('0x51')]):_0x6dd7('0x66'));return respondWithRpcPromise(_0x6dd7('0x7c'),_0x6dd7('0x7d'),_0x591e0c);}return null;})['then'](function(_0x2e7475){var _0x1fbd89=_0x6dd7('0x69')+_0x2e7475[_0x6dd7('0x22')][_0x6dd7('0x6a')];return db['sequelize']['query'](_0x1fbd89,{'type':db[_0x6dd7('0x6c')][_0x6dd7('0x7e')][_0x6dd7('0x6d')],'raw':!![]})[_0x6dd7('0x1b')](function(_0x3032f0){return _0x3032f0;});})[_0x6dd7('0x1b')](function(_0x504d29){if(_0x504d29){_0x591e0c[_0x6dd7('0x22')][_0x6dd7('0x7f')]=_0x504d29[0x0];if(!_0x40134a[_0x6dd7('0x51')]['UserId'])return;return db[_0x6dd7('0x6e')][_0x6dd7('0x4f')]({'where':{'id':_0x40134a['body'][_0x6dd7('0x5a')],'role':'agent'},'attributes':['id',_0x6dd7('0x32'),_0x6dd7('0x6f'),'email',_0x6dd7('0x70')],'raw':!![]});}return null;})['then'](function(_0x412bb0){if(!_0x412bb0)return null;_0x591e0c[_0x6dd7('0x22')][_0x6dd7('0x5c')]=_0x412bb0;return _0x591e0c;})[_0x6dd7('0x1b')](function(_0x2d03d8){if(_0x2d03d8){_0x2d03d8['message']['interface']=util[_0x6dd7('0x58')]('SIP/%s',_0x40134a[_0x6dd7('0x5b')][_0x6dd7('0x32')]);_0x2d03d8[_0x6dd7('0x22')][_0x6dd7('0x74')]=_0x591e0c[_0x6dd7('0x74')];_0x2d03d8[_0x6dd7('0x22')][_0x6dd7('0x75')]=_0x591e0c[_0x6dd7('0x74')];_0x2d03d8[_0x6dd7('0x22')][_0x6dd7('0x76')]=_0x6dd7('0x7a');respondWithRpcPromise(_0x6dd7('0x77'),_0x6dd7('0x77'),{'event':_0x6dd7('0x80'),'message':_[_0x6dd7('0x45')](_0x591e0c['message'],JSON['parse'](_0x591e0c['interaction'][_0x6dd7('0x81')]))},client9002);return _0x591e0c;}return null;})[_0x6dd7('0x1b')](respondWithResult(_0x378a78,null))['catch'](handleError(_0x378a78,null));}; \ No newline at end of file +var _0x9b40=['count','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatMessage','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','rejectMessage','Sequelize','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9b40,0x15e));var _0x09b4=function(_0x17b5ff,_0x3fe9e7){_0x17b5ff=_0x17b5ff-0x0;var _0x123993=_0x9b40[_0x17b5ff];return _0x123993;};'use strict';var emlformat=require(_0x09b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09b4('0x1'));var jsonpatch=require(_0x09b4('0x2'));var rp=require(_0x09b4('0x3'));var moment=require(_0x09b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x09b4('0x5'));var csv=require(_0x09b4('0x6'));var ejs=require(_0x09b4('0x7'));var fs=require('fs');var fs_extra=require(_0x09b4('0x8'));var _=require(_0x09b4('0x9'));var squel=require(_0x09b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09b4('0xb'));var toCsv=require(_0x09b4('0x6'));var querystring=require(_0x09b4('0xc'));var Papa=require(_0x09b4('0xd'));var Redis=require(_0x09b4('0xe'));var authService=require(_0x09b4('0xf'));var qs=require(_0x09b4('0x10'));var as=require(_0x09b4('0x11'));var hardwareService=require(_0x09b4('0x12'));var logger=require(_0x09b4('0x13'))(_0x09b4('0x14'));var utils=require(_0x09b4('0x15'));var config=require(_0x09b4('0x16'));var licenseUtil=require(_0x09b4('0x17'));var db=require('../../mysqldb')['db'];config[_0x09b4('0x18')]=_[_0x09b4('0x19')](config['redis'],{'host':_0x09b4('0x1a'),'port':0x18eb});var socket=require(_0x09b4('0x1b'))(new Redis(config[_0x09b4('0x18')]));require(_0x09b4('0x1c'))[_0x09b4('0x1d')](socket);var jayson=require(_0x09b4('0x1e'));var client=jayson[_0x09b4('0x1f')][_0x09b4('0x20')]({'port':0x232c});var client9002=jayson[_0x09b4('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x437fad,_0x345636,_0x3c3c85,_0x3eda14){return new BPromise(function(_0x25149d,_0x3196a8){var _0x448d98=_0x3eda14||client;return _0x448d98[_0x09b4('0x21')](_0x437fad,_0x3c3c85)['then'](function(_0x20fb06){logger[_0x09b4('0x22')]('ChatMessage,\x20%s,\x20%s',_0x345636,'request\x20sent');logger['debug'](_0x09b4('0x23'),_0x345636,_0x09b4('0x24'),JSON[_0x09b4('0x25')](_0x20fb06));if(_0x20fb06[_0x09b4('0x26')]){if(_0x20fb06[_0x09b4('0x26')][_0x09b4('0x27')]===0x1f4){logger['error'](_0x09b4('0x28'),_0x345636,_0x20fb06[_0x09b4('0x26')]['message']);return _0x3196a8(_0x20fb06[_0x09b4('0x26')]['message']);}logger['error'](_0x09b4('0x28'),_0x345636,_0x20fb06[_0x09b4('0x26')]['message']);return _0x25149d(_0x20fb06[_0x09b4('0x26')][_0x09b4('0x29')]);}else{logger[_0x09b4('0x22')](_0x09b4('0x28'),_0x345636,'request\x20sent');_0x25149d(_0x20fb06[_0x09b4('0x2a')]['message']);}})[_0x09b4('0x2b')](function(_0x14ffb7){logger[_0x09b4('0x26')](_0x09b4('0x28'),_0x345636,_0x14ffb7);_0x3196a8(_0x14ffb7);});});}function respondWithStatusCode(_0x5c7292,_0x297b11){_0x297b11=_0x297b11||0xcc;return function(_0x46b780){if(_0x46b780){return _0x5c7292[_0x09b4('0x2c')](_0x297b11);}return _0x5c7292['status'](_0x297b11)[_0x09b4('0x2d')]();};}function respondWithResult(_0x2bb6ff,_0x83f756){_0x83f756=_0x83f756||0xc8;return function(_0x2a618c){if(_0x2a618c){return _0x2bb6ff[_0x09b4('0x2e')](_0x83f756)['json'](_0x2a618c);}};}function respondWithFilteredResult(_0x52e18a,_0x153a0f){return function(_0x3c2690){if(_0x3c2690){var _0x47d45b=typeof _0x153a0f[_0x09b4('0x2f')]===_0x09b4('0x30')&&typeof _0x153a0f['limit']===_0x09b4('0x30');var _0x129cc8=_0x3c2690[_0x09b4('0x31')];var _0x4e1ef3=_0x47d45b?0x0:_0x153a0f[_0x09b4('0x2f')];var _0x2cade4=_0x47d45b?_0x3c2690[_0x09b4('0x31')]:_0x153a0f['offset']+_0x153a0f['limit'];var _0x574e19;if(_0x2cade4>=_0x129cc8){_0x2cade4=_0x129cc8;_0x574e19=0xc8;}else{_0x574e19=0xce;}_0x52e18a[_0x09b4('0x2e')](_0x574e19);return _0x52e18a[_0x09b4('0x32')]('Content-Range',_0x4e1ef3+'-'+_0x2cade4+'/'+_0x129cc8)[_0x09b4('0x33')](_0x3c2690);}return null;};}function patchUpdates(_0x38b0b9){return function(_0x88edfd){try{jsonpatch[_0x09b4('0x34')](_0x88edfd,_0x38b0b9,!![]);}catch(_0x741e0e){return BPromise[_0x09b4('0x35')](_0x741e0e);}return _0x88edfd[_0x09b4('0x36')]();};}function saveUpdates(_0x5f11dc,_0x5914e9){return function(_0x93c7f3){if(_0x93c7f3){return _0x93c7f3[_0x09b4('0x37')](_0x5f11dc)[_0x09b4('0x38')](function(_0x51ec84){return _0x51ec84;});}return null;};}function removeEntity(_0x37b9d5,_0x3a5cff){return function(_0x1ec9af){if(_0x1ec9af){return _0x1ec9af[_0x09b4('0x39')]()[_0x09b4('0x38')](function(){_0x37b9d5['status'](0xcc)[_0x09b4('0x2d')]();});}};}function handleEntityNotFound(_0x348c81,_0x3f9da5){return function(_0x571a9f){if(!_0x571a9f){_0x348c81[_0x09b4('0x2c')](0x194);}return _0x571a9f;};}function handleError(_0x5dcc81,_0x2207de){_0x2207de=_0x2207de||0x1f4;return function(_0x4f2a47){logger[_0x09b4('0x26')](_0x4f2a47[_0x09b4('0x3a')]);if(_0x4f2a47[_0x09b4('0x3b')]){delete _0x4f2a47[_0x09b4('0x3b')];}_0x5dcc81[_0x09b4('0x2e')](_0x2207de)[_0x09b4('0x3c')](_0x4f2a47);};}exports[_0x09b4('0x3d')]=function(_0x3a6df0,_0x4b7616){var _0x2488ac={},_0x3428ff={},_0x396d89={'count':0x0,'rows':[]};var _0x36a6de=_[_0x09b4('0x3e')](db[_0x09b4('0x3f')]['rawAttributes'],function(_0x5dca4b){return{'name':_0x5dca4b['fieldName'],'type':_0x5dca4b[_0x09b4('0x40')][_0x09b4('0x41')]};});_0x3428ff['model']=_[_0x09b4('0x3e')](_0x36a6de,'name');_0x3428ff[_0x09b4('0x42')]=_[_0x09b4('0x43')](_0x3a6df0['query']);_0x3428ff[_0x09b4('0x44')]=_['intersection'](_0x3428ff[_0x09b4('0x45')],_0x3428ff[_0x09b4('0x42')]);_0x2488ac[_0x09b4('0x46')]=_[_0x09b4('0x47')](_0x3428ff[_0x09b4('0x45')],qs[_0x09b4('0x48')](_0x3a6df0[_0x09b4('0x42')]['fields']));_0x2488ac[_0x09b4('0x46')]=_0x2488ac[_0x09b4('0x46')][_0x09b4('0x49')]?_0x2488ac['attributes']:_0x3428ff['model'];if(!_0x3a6df0[_0x09b4('0x42')]['hasOwnProperty'](_0x09b4('0x4a'))){_0x2488ac[_0x09b4('0x4b')]=qs[_0x09b4('0x4b')](_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x4b')]);_0x2488ac['offset']=qs['offset'](_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x2f')]);}_0x2488ac[_0x09b4('0x4c')]=qs[_0x09b4('0x4d')](_0x3a6df0[_0x09b4('0x42')]['sort']);_0x2488ac[_0x09b4('0x4e')]=qs['filters'](_[_0x09b4('0x4f')](_0x3a6df0[_0x09b4('0x42')],_0x3428ff['filters']),_0x36a6de);if(_0x3a6df0['query'][_0x09b4('0x50')]){_0x2488ac['where']=_[_0x09b4('0x51')](_0x2488ac[_0x09b4('0x4e')],{'$or':_[_0x09b4('0x3e')](_0x36a6de,function(_0x1a2df7){if(_0x1a2df7['type']!=='VIRTUAL'){var _0x2fd7b2={};_0x2fd7b2[_0x1a2df7['name']]={'$like':'%'+_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x50')]+'%'};return _0x2fd7b2;}})});}_0x2488ac=_[_0x09b4('0x51')]({},_0x2488ac,_0x3a6df0['options']);var _0x13c116={'where':_0x2488ac[_0x09b4('0x4e')]};return db['ChatMessage'][_0x09b4('0x31')](_0x13c116)[_0x09b4('0x38')](function(_0x2ee4dc){_0x396d89[_0x09b4('0x31')]=_0x2ee4dc;if(_0x3a6df0['query'][_0x09b4('0x52')]){_0x2488ac[_0x09b4('0x53')]=[{'all':!![]}];}return db[_0x09b4('0x3f')][_0x09b4('0x54')](_0x2488ac);})[_0x09b4('0x38')](function(_0x32d645){_0x396d89[_0x09b4('0x55')]=_0x32d645;return _0x396d89;})[_0x09b4('0x38')](respondWithFilteredResult(_0x4b7616,_0x2488ac))['catch'](handleError(_0x4b7616,null));};exports[_0x09b4('0x56')]=function(_0x447258,_0x570c50){var _0x5debdd={'raw':!![],'where':{'id':_0x447258[_0x09b4('0x57')]['id']}},_0x409531={};_0x409531[_0x09b4('0x45')]=_['keys'](db[_0x09b4('0x3f')][_0x09b4('0x58')]);_0x409531[_0x09b4('0x42')]=_['keys'](_0x447258[_0x09b4('0x42')]);_0x409531[_0x09b4('0x44')]=_[_0x09b4('0x47')](_0x409531[_0x09b4('0x45')],_0x409531[_0x09b4('0x42')]);_0x5debdd['attributes']=_[_0x09b4('0x47')](_0x409531[_0x09b4('0x45')],qs[_0x09b4('0x48')](_0x447258[_0x09b4('0x42')][_0x09b4('0x48')]));_0x5debdd[_0x09b4('0x46')]=_0x5debdd[_0x09b4('0x46')][_0x09b4('0x49')]?_0x5debdd[_0x09b4('0x46')]:_0x409531[_0x09b4('0x45')];if(_0x447258[_0x09b4('0x42')][_0x09b4('0x52')]){_0x5debdd['include']=[{'all':!![]}];}_0x5debdd=_[_0x09b4('0x51')]({},_0x5debdd,_0x447258[_0x09b4('0x59')]);return db[_0x09b4('0x3f')][_0x09b4('0x5a')](_0x5debdd)[_0x09b4('0x38')](handleEntityNotFound(_0x570c50,null))[_0x09b4('0x38')](respondWithResult(_0x570c50,null))[_0x09b4('0x2b')](handleError(_0x570c50,null));};exports[_0x09b4('0x5b')]=function(_0xcd3f24,_0x12ecf4){return db['ChatMessage'][_0x09b4('0x5b')](_0xcd3f24['body'],{})['then'](respondWithResult(_0x12ecf4,0xc9))[_0x09b4('0x2b')](handleError(_0x12ecf4,null));};exports[_0x09b4('0x37')]=function(_0x11b824,_0x2bb281){if(_0x11b824[_0x09b4('0x5c')]['id']){delete _0x11b824[_0x09b4('0x5c')]['id'];}return db[_0x09b4('0x3f')]['find']({'where':{'id':_0x11b824[_0x09b4('0x57')]['id']}})[_0x09b4('0x38')](handleEntityNotFound(_0x2bb281,null))[_0x09b4('0x38')](saveUpdates(_0x11b824[_0x09b4('0x5c')],null))['then'](respondWithResult(_0x2bb281,null))[_0x09b4('0x2b')](handleError(_0x2bb281,null));};exports['destroy']=function(_0x1d91f2,_0x2ee965){return db['ChatMessage'][_0x09b4('0x5a')]({'where':{'id':_0x1d91f2['params']['id']}})[_0x09b4('0x38')](handleEntityNotFound(_0x2ee965,null))[_0x09b4('0x38')](removeEntity(_0x2ee965,null))['catch'](handleError(_0x2ee965,null));};exports[_0x09b4('0x5d')]=function(_0xbed24c,_0x15605a){return db[_0x09b4('0x3f')][_0x09b4('0x5d')]()['then'](respondWithResult(_0x15605a,null))[_0x09b4('0x2b')](handleError(_0x15605a,null));};var interaction_log=require('../../config/logger')(_0x09b4('0x5e'));exports[_0x09b4('0x5f')]=function(_0x4221c9,_0x55adb3,_0x50da79){var _0x578e21={'agent':{},'channel':_0x09b4('0x60')};if(_0x4221c9['body']['id']){delete _0x4221c9[_0x09b4('0x5c')]['id'];}_0x4221c9['body'][_0x09b4('0x61')]=!![];_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x62')]=moment()[_0x09b4('0x63')](_0x09b4('0x64'));_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')]=_0x4221c9[_0x09b4('0x5c')]['UserId']||_0x4221c9['user']['id'];_0x578e21[_0x09b4('0x66')]['id']=_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')];return db[_0x09b4('0x3f')]['find']({'where':{'id':_0x4221c9['params']['id'],'UserId':null}})[_0x09b4('0x38')](handleEntityNotFound(_0x55adb3,null))[_0x09b4('0x38')](saveUpdates(_0x4221c9[_0x09b4('0x5c')],null))[_0x09b4('0x38')](function(_0x483a79){if(_0x483a79){_0x578e21[_0x09b4('0x29')]=_0x483a79[_0x09b4('0x67')]({'plain':!![]});return db[_0x09b4('0x68')][_0x09b4('0x5a')]({'where':{'id':_0x483a79[_0x09b4('0x69')]}});}return null;})[_0x09b4('0x38')](handleEntityNotFound(_0x55adb3,null))[_0x09b4('0x38')](function(_0x5038ef){if(_0x5038ef){return _0x5038ef[_0x09b4('0x37')]({'UserId':_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')],'read1stAt':_[_0x09b4('0x6a')](_0x5038ef[_0x09b4('0x6b')])?moment()[_0x09b4('0x63')](_0x09b4('0x64')):undefined});}return null;})[_0x09b4('0x38')](function(_0x5d71d5){if(_0x5d71d5){_0x578e21['interaction']=_0x5d71d5[_0x09b4('0x67')]({'plain':!![]});interaction_log['info'](_0x09b4('0x6c'),_0x4221c9[_0x09b4('0x6d')]['id'],_0x4221c9[_0x09b4('0x6d')][_0x09b4('0x3b')],_0x4221c9[_0x09b4('0x6d')]['role'],_0x578e21[_0x09b4('0x6e')]['id'],_0x4221c9[_0x09b4('0x5c')]?JSON[_0x09b4('0x25')](_0x4221c9[_0x09b4('0x5c')]):_0x09b4('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x09b4('0x70'),_0x578e21);}return null;})[_0x09b4('0x38')](function(_0x281583){var _0xbfb0e6=_0x09b4('0x71')+_0x281583[_0x09b4('0x29')][_0x09b4('0x72')];return db['sequelize'][_0x09b4('0x42')](_0xbfb0e6,{'type':db['Sequelize'][_0x09b4('0x73')][_0x09b4('0x74')],'raw':!![]})[_0x09b4('0x38')](function(_0x156b2a){return _0x156b2a;});})[_0x09b4('0x38')](function(_0x219674){if(_0x219674){_0x578e21[_0x09b4('0x29')][_0x09b4('0x75')]=_0x219674[0x0];if(!_0x4221c9['body'][_0x09b4('0x65')])return;return db['User'][_0x09b4('0x5a')]({'where':{'id':_0x4221c9['body'][_0x09b4('0x65')],'role':_0x09b4('0x66')},'attributes':['id',_0x09b4('0x3b'),_0x09b4('0x76'),_0x09b4('0x77'),'internal'],'raw':!![]});}return null;})[_0x09b4('0x38')](function(_0xc31579){if(!_0xc31579)return null;_0x578e21[_0x09b4('0x29')][_0x09b4('0x66')]=_0xc31579;return _0x578e21;})[_0x09b4('0x38')](function(_0x2a73df){if(_0x2a73df){if(_0x4221c9['body'][_0x09b4('0x78')]){_0x578e21[_0x09b4('0x29')][_0x09b4('0x79')]=util[_0x09b4('0x63')](_0x09b4('0x7a'),_0x4221c9[_0x09b4('0x6d')][_0x09b4('0x3b')]);_0x578e21[_0x09b4('0x29')][_0x09b4('0x7b')]=_0x578e21['channel'];_0x578e21[_0x09b4('0x29')][_0x09b4('0x7c')]=_0x578e21[_0x09b4('0x7b')];_0x578e21[_0x09b4('0x29')][_0x09b4('0x7d')]=_0x09b4('0x5f');return respondWithRpcPromise(_0x09b4('0x7e'),'EventManager',{'event':_0x09b4('0x7f'),'message':_[_0x09b4('0x51')](_0x578e21[_0x09b4('0x29')],JSON[_0x09b4('0x80')](_0x578e21[_0x09b4('0x6e')][_0x09b4('0x81')]))},client9002)['then'](function(){return _0x578e21;});}return _0x578e21;}return null;})[_0x09b4('0x38')](respondWithResult(_0x55adb3,null))[_0x09b4('0x2b')](handleError(_0x55adb3,null));};var interaction_log=require(_0x09b4('0x13'))(_0x09b4('0x5e'));exports[_0x09b4('0x35')]=function(_0x22b247,_0x29a4bb,_0x2a5418){var _0x4eadef={'agent':{},'channel':_0x09b4('0x60')};if(_0x22b247[_0x09b4('0x5c')]['id']){delete _0x22b247[_0x09b4('0x5c')]['id'];}_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')]=_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')]||_0x22b247['user']['id'];_0x4eadef[_0x09b4('0x66')]['id']=_0x22b247[_0x09b4('0x5c')]['UserId'];return db[_0x09b4('0x3f')][_0x09b4('0x5a')]({'where':{'id':_0x22b247[_0x09b4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29a4bb,null))[_0x09b4('0x38')](function(_0x1c5b47){if(_0x1c5b47){_0x4eadef['message']=_0x1c5b47[_0x09b4('0x67')]({'plain':!![]});return db[_0x09b4('0x68')][_0x09b4('0x5a')]({'where':{'id':_0x1c5b47[_0x09b4('0x69')]}});}return null;})[_0x09b4('0x38')](handleEntityNotFound(_0x29a4bb,null))[_0x09b4('0x38')](function(_0x32f9c7){if(_0x32f9c7){_0x4eadef[_0x09b4('0x6e')]=_0x32f9c7[_0x09b4('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x22b247['user']['id'],_0x22b247[_0x09b4('0x6d')][_0x09b4('0x3b')],_0x22b247['user']['role'],_0x4eadef[_0x09b4('0x6e')]['id'],_0x22b247[_0x09b4('0x5c')]?JSON['stringify'](_0x22b247[_0x09b4('0x5c')]):_0x09b4('0x6f'));return respondWithRpcPromise('RejectMessage',_0x09b4('0x82'),_0x4eadef);}return null;})[_0x09b4('0x38')](function(_0x511c50){var _0x1c7051=_0x09b4('0x71')+_0x511c50['message'][_0x09b4('0x72')];return db['sequelize'][_0x09b4('0x42')](_0x1c7051,{'type':db[_0x09b4('0x83')]['QueryTypes']['SELECT'],'raw':!![]})[_0x09b4('0x38')](function(_0x29aedd){return _0x29aedd;});})[_0x09b4('0x38')](function(_0xed989e){if(_0xed989e){_0x4eadef[_0x09b4('0x29')][_0x09b4('0x75')]=_0xed989e[0x0];if(!_0x22b247[_0x09b4('0x5c')]['UserId'])return;return db['User'][_0x09b4('0x5a')]({'where':{'id':_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')],'role':_0x09b4('0x66')},'attributes':['id',_0x09b4('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x5d67a2){if(!_0x5d67a2)return null;_0x4eadef[_0x09b4('0x29')][_0x09b4('0x66')]=_0x5d67a2;return _0x4eadef;})[_0x09b4('0x38')](function(_0xec67b4){if(_0xec67b4){_0xec67b4[_0x09b4('0x29')]['interface']=util[_0x09b4('0x63')](_0x09b4('0x7a'),_0x22b247['user'][_0x09b4('0x3b')]);_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7b')]=_0x4eadef[_0x09b4('0x7b')];_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7c')]=_0x4eadef['channel'];_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7d')]=_0x09b4('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x09b4('0x84'),'message':_[_0x09b4('0x51')](_0x4eadef['message'],JSON[_0x09b4('0x80')](_0x4eadef[_0x09b4('0x6e')][_0x09b4('0x81')]))},client9002);return _0x4eadef;}return null;})[_0x09b4('0x38')](respondWithResult(_0x29a4bb,null))['catch'](handleError(_0x29a4bb,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ab9b4d5..22cb73a 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 _0x2e93=['exports','events','ChatMessage','save','remove','emit','hasOwnProperty'];(function(_0x4a166e,_0x37910f){var _0xd79e10=function(_0x2d0cd2){while(--_0x2d0cd2){_0x4a166e['push'](_0x4a166e['shift']());}};_0xd79e10(++_0x37910f);}(_0x2e93,0x13c));var _0x32e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e93[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x32e9('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x32e9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32e9('0x2'),'afterUpdate':'update','afterDestroy':_0x32e9('0x3')};function emitEvent(_0x4cba3f){return function(_0x271ee6,_0x3aedfc,_0x2bf3d8){ChatMessageEvents[_0x32e9('0x4')](_0x4cba3f+':'+_0x271ee6['id'],_0x271ee6);ChatMessageEvents[_0x32e9('0x4')](_0x4cba3f,_0x271ee6);_0x2bf3d8(null);};}for(var e in events){if(events[_0x32e9('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x32e9('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x2742=['../../mysqldb','ChatMessage','save','emit','hook','exports','events'];(function(_0x2fb7c5,_0x466765){var _0x9cc189=function(_0x2be180){while(--_0x2be180){_0x2fb7c5['push'](_0x2fb7c5['shift']());}};_0x9cc189(++_0x466765);}(_0x2742,0x1aa));var _0x2274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2742[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2274('0x0'));var ChatMessage=require(_0x2274('0x1'))['db'][_0x2274('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2274('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46bcfe){return function(_0x8f33d0,_0x2c432f,_0x581175){ChatMessageEvents[_0x2274('0x4')](_0x46bcfe+':'+_0x8f33d0['id'],_0x8f33d0);ChatMessageEvents['emit'](_0x46bcfe,_0x8f33d0);_0x581175(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2274('0x5')](e,emitEvent(event));}}module[_0x2274('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 c6767a8..ff5cafe 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 _0x36da=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','isNil','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1e80ac,_0x5ce7be){var _0x27294e=function(_0x5bfc49){while(--_0x5bfc49){_0x1e80ac['push'](_0x1e80ac['shift']());}};_0x27294e(++_0x5ce7be);}(_0x36da,0xd7));var _0xa36d=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0x36da[_0x257841];return _0x1b87ed;};'use strict';var _=require('lodash');var util=require(_0xa36d('0x0'));var logger=require(_0xa36d('0x1'))(_0xa36d('0x2'));var moment=require(_0xa36d('0x3'));var BPromise=require(_0xa36d('0x4'));var rp=require(_0xa36d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa36d('0x6'));var config=require(_0xa36d('0x7'));var attributes=require(_0xa36d('0x8'));module[_0xa36d('0x9')]=function(_0x2fafad,_0x1af58d){return _0x2fafad[_0xa36d('0xa')](_0xa36d('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa36d('0xc'),'fields':[_0xa36d('0xd')],'type':_0xa36d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e792e,_0xb81bcb,_0x8445ab){var _0x29360b=_0x2fafad[_0xa36d('0xf')];var _0x3d0097=_0x5e792e[_0xa36d('0x10')]({'plain':!![]});if(_0x3d0097['direction'][_0xa36d('0x11')]()==='in'||_0x3d0097[_0xa36d('0x12')][_0xa36d('0x11')]()==='out'&&!_0x3d0097['secret']&&!_[_0xa36d('0x13')](_0x3d0097['UserId'])){_0x29360b['ChatInteraction'][_0xa36d('0x14')]({'where':{'id':_0x3d0097[_0xa36d('0x15')]}})['then'](function(_0x126f1a){if(_0x126f1a){_0x126f1a[_0xa36d('0x16')]({'lastMsgAt':_0x3d0097[_0xa36d('0x17')],'lastMsgDirection':_0x3d0097['direction'][_0xa36d('0x11')]()});}})['catch'](function(_0x128552){console[_0xa36d('0x18')](_0x128552);});}_0x8445ab();}},'charset':_0xa36d('0x19'),'collate':_0xa36d('0x1a')});}; \ No newline at end of file +var _0xba4e=['util','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','utf8mb4_unicode_ci','lodash'];(function(_0x250323,_0x5517af){var _0x4bcce1=function(_0xd0c4b8){while(--_0xd0c4b8){_0x250323['push'](_0x250323['shift']());}};_0x4bcce1(++_0x5517af);}(_0xba4e,0x67));var _0xeba4=function(_0x51539c,_0x25f587){_0x51539c=_0x51539c-0x0;var _0x4f7914=_0xba4e[_0x51539c];return _0x4f7914;};'use strict';var _=require(_0xeba4('0x0'));var util=require(_0xeba4('0x1'));var logger=require('../../config/logger')(_0xeba4('0x2'));var moment=require(_0xeba4('0x3'));var BPromise=require(_0xeba4('0x4'));var rp=require(_0xeba4('0x5'));var fs=require('fs');var path=require(_0xeba4('0x6'));var rimraf=require('rimraf');var config=require(_0xeba4('0x7'));var attributes=require(_0xeba4('0x8'));module[_0xeba4('0x9')]=function(_0x5f51fb,_0x24d2d5){return _0x5f51fb['define'](_0xeba4('0xa'),attributes,{'tableName':_0xeba4('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xeba4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x553bb4,_0x236c0c,_0x3ec9c6){var _0x4be11f=_0x5f51fb[_0xeba4('0xd')];var _0x4db6d4=_0x553bb4[_0xeba4('0xe')]({'plain':!![]});if(_0x4db6d4[_0xeba4('0xf')][_0xeba4('0x10')]()==='in'||_0x4db6d4['direction'][_0xeba4('0x10')]()==='out'&&!_0x4db6d4[_0xeba4('0x11')]&&!_[_0xeba4('0x12')](_0x4db6d4[_0xeba4('0x13')])){_0x4be11f[_0xeba4('0x14')][_0xeba4('0x15')]({'where':{'id':_0x4db6d4['ChatInteractionId']}})[_0xeba4('0x16')](function(_0x3db4a6){if(_0x3db4a6){_0x3db4a6[_0xeba4('0x17')]({'lastMsgAt':_0x4db6d4[_0xeba4('0x18')],'lastMsgDirection':_0x4db6d4['direction'][_0xeba4('0x10')]()});}})['catch'](function(_0x2710b7){console['error'](_0x2710b7);});}_0x3ec9c6();}},'charset':'utf8mb4','collate':_0xeba4('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f27ffb9..c9ac628 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 _0xaeff=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','ChatMessage','options','raw','CreateChatMessage','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5dbe37,_0x11685e){var _0x182424=function(_0x1dfb98){while(--_0x1dfb98){_0x5dbe37['push'](_0x5dbe37['shift']());}};_0x182424(++_0x11685e);}(_0xaeff,0x18d));var _0xfaef=function(_0x466568,_0x36f661){_0x466568=_0x466568-0x0;var _0x38c049=_0xaeff[_0x466568];return _0x38c049;};'use strict';var _=require('lodash');var util=require(_0xfaef('0x0'));var moment=require(_0xfaef('0x1'));var BPromise=require(_0xfaef('0x2'));var rs=require(_0xfaef('0x3'));var fs=require('fs');var Redis=require(_0xfaef('0x4'));var db=require(_0xfaef('0x5'))['db'];var utils=require(_0xfaef('0x6'));var logger=require(_0xfaef('0x7'))('rpc');var config=require(_0xfaef('0x8'));var jayson=require(_0xfaef('0x9'));var client=jayson[_0xfaef('0xa')]['http']({'port':0x232a});config[_0xfaef('0xb')]=_[_0xfaef('0xc')](config['redis'],{'host':_0xfaef('0xd'),'port':0x18eb});var socket=require(_0xfaef('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xfaef('0xf')](socket);function respondWithRpcPromise(_0x1644fc,_0xd91162,_0x5ace64){return new BPromise(function(_0x5f321e,_0x4fef77){return client['request'](_0x1644fc,_0x5ace64)[_0xfaef('0x10')](function(_0x3f121f){logger[_0xfaef('0x11')](_0xfaef('0x12'),_0xd91162,'request\x20sent');logger[_0xfaef('0x13')](_0xfaef('0x14'),_0xd91162,_0xfaef('0x15'),JSON['stringify'](_0x3f121f));if(_0x3f121f[_0xfaef('0x16')]){if(_0x3f121f[_0xfaef('0x16')]['code']===0x1f4){logger[_0xfaef('0x16')](_0xfaef('0x12'),_0xd91162,_0x3f121f['error'][_0xfaef('0x17')]);return _0x4fef77(_0x3f121f[_0xfaef('0x16')]['message']);}logger[_0xfaef('0x16')](_0xfaef('0x12'),_0xd91162,_0x3f121f[_0xfaef('0x16')][_0xfaef('0x17')]);return _0x5f321e(_0x3f121f['error'][_0xfaef('0x17')]);}else{logger[_0xfaef('0x11')](_0xfaef('0x12'),_0xd91162,_0xfaef('0x15'));_0x5f321e(_0x3f121f[_0xfaef('0x18')][_0xfaef('0x17')]);}})['catch'](function(_0x47a0bf){logger['error']('ChatMessage,\x20%s,\x20%s',_0xd91162,_0x47a0bf);_0x4fef77(_0x47a0bf);});});}exports['CreateChatMessage']=function(_0x52b976){var _0x547327=this;return new Promise(function(_0x347836,_0x4b4aea){return db[_0xfaef('0x19')]['create'](_0x52b976['body'],{'raw':_0x52b976[_0xfaef('0x1a')]?_0x52b976[_0xfaef('0x1a')][_0xfaef('0x1b')]===undefined?!![]:![]:!![]})[_0xfaef('0x10')](function(_0x64fdb8){logger[_0xfaef('0x11')](_0xfaef('0x1c'),_0x52b976);logger[_0xfaef('0x13')]('CreateChatMessage',_0x52b976,JSON[_0xfaef('0x1d')](_0x64fdb8));_0x347836(_0x64fdb8);})[_0xfaef('0x1e')](function(_0x195235){logger[_0xfaef('0x16')](_0xfaef('0x1c'),_0x195235[_0xfaef('0x17')],_0x52b976);_0x4b4aea(_0x547327[_0xfaef('0x16')](0x1f4,_0x195235[_0xfaef('0x17')]));});});}; \ No newline at end of file +var _0xd142=['register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x3a1878,_0x46afed){var _0x45a7e3=function(_0xb60fcb){while(--_0xb60fcb){_0x3a1878['push'](_0x3a1878['shift']());}};_0x45a7e3(++_0x46afed);}(_0xd142,0x6f));var _0x2d14=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0xd142[_0x12b830];return _0x261dc4;};'use strict';var _=require(_0x2d14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d14('0x1'));var fs=require('fs');var Redis=require(_0x2d14('0x2'));var db=require(_0x2d14('0x3'))['db'];var utils=require(_0x2d14('0x4'));var logger=require('../../config/logger')(_0x2d14('0x5'));var config=require(_0x2d14('0x6'));var jayson=require(_0x2d14('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2d14('0x8')](config[_0x2d14('0x9')],{'host':_0x2d14('0xa'),'port':0x18eb});var socket=require(_0x2d14('0xb'))(new Redis(config[_0x2d14('0x9')]));require(_0x2d14('0xc'))[_0x2d14('0xd')](socket);function respondWithRpcPromise(_0x1144dc,_0xf93a74,_0x60ef8c){return new BPromise(function(_0x1c0c5e,_0xfc60f9){return client[_0x2d14('0xe')](_0x1144dc,_0x60ef8c)[_0x2d14('0xf')](function(_0x5d7d8c){logger[_0x2d14('0x10')](_0x2d14('0x11'),_0xf93a74,_0x2d14('0x12'));logger[_0x2d14('0x13')](_0x2d14('0x14'),_0xf93a74,'request\x20sent',JSON[_0x2d14('0x15')](_0x5d7d8c));if(_0x5d7d8c[_0x2d14('0x16')]){if(_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x17')]===0x1f4){logger['error'](_0x2d14('0x11'),_0xf93a74,_0x5d7d8c[_0x2d14('0x16')]['message']);return _0xfc60f9(_0x5d7d8c[_0x2d14('0x16')]['message']);}logger[_0x2d14('0x16')](_0x2d14('0x11'),_0xf93a74,_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x18')]);return _0x1c0c5e(_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x18')]);}else{logger[_0x2d14('0x10')](_0x2d14('0x11'),_0xf93a74,'request\x20sent');_0x1c0c5e(_0x5d7d8c['result']['message']);}})[_0x2d14('0x19')](function(_0x2e7ec0){logger[_0x2d14('0x16')](_0x2d14('0x11'),_0xf93a74,_0x2e7ec0);_0xfc60f9(_0x2e7ec0);});});}exports[_0x2d14('0x1a')]=function(_0x2cc945){var _0x37ab4a=this;return new Promise(function(_0x517e24,_0x2d9bd2){return db[_0x2d14('0x1b')]['create'](_0x2cc945[_0x2d14('0x1c')],{'raw':_0x2cc945[_0x2d14('0x1d')]?_0x2cc945['options'][_0x2d14('0x1e')]===undefined?!![]:![]:!![]})[_0x2d14('0xf')](function(_0x3859f3){logger['info'](_0x2d14('0x1a'),_0x2cc945);logger[_0x2d14('0x13')](_0x2d14('0x1a'),_0x2cc945,JSON[_0x2d14('0x15')](_0x3859f3));_0x517e24(_0x3859f3);})[_0x2d14('0x19')](function(_0xb7e51f){logger[_0x2d14('0x16')](_0x2d14('0x1a'),_0xb7e51f[_0x2d14('0x18')],_0x2cc945);_0x2d9bd2(_0x37ab4a[_0x2d14('0x16')](0x1f4,_0xb7e51f[_0x2d14('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4170d56..049b187 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 _0x8375=['./chatMessage.events','save','remove','emit','register','length','chatMessage:'];(function(_0x475785,_0x2b09a7){var _0x5da41c=function(_0x269566){while(--_0x269566){_0x475785['push'](_0x475785['shift']());}};_0x5da41c(++_0x2b09a7);}(_0x8375,0xa8));var _0x5837=function(_0x2b5581,_0xeb289f){_0x2b5581=_0x2b5581-0x0;var _0x1bfbac=_0x8375[_0x2b5581];return _0x1bfbac;};'use strict';var ChatMessageEvents=require(_0x5837('0x0'));var events=[_0x5837('0x1'),_0x5837('0x2'),'update'];function createListener(_0x24c393,_0x181ec3){return function(_0x86f16a){_0x181ec3[_0x5837('0x3')](_0x24c393,_0x86f16a);};}function removeListener(_0x317452,_0x1edfc5){return function(){ChatMessageEvents['removeListener'](_0x317452,_0x1edfc5);};}exports[_0x5837('0x4')]=function(_0x19491e){for(var _0x365da3=0x0,_0x2e383c=events[_0x5837('0x5')];_0x365da3<_0x2e383c;_0x365da3++){var _0x5bc421=events[_0x365da3];var _0x508caf=createListener(_0x5837('0x6')+_0x5bc421,_0x19491e);ChatMessageEvents['on'](_0x5bc421,_0x508caf);}}; \ No newline at end of file +var _0xce50=['save','remove','update','register'];(function(_0x47568d,_0x59420b){var _0x5984e0=function(_0x59a63e){while(--_0x59a63e){_0x47568d['push'](_0x47568d['shift']());}};_0x5984e0(++_0x59420b);}(_0xce50,0x1d8));var _0x0ce5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xce50[_0x39096d];return _0x13da4f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x0ce5('0x0'),_0x0ce5('0x1'),_0x0ce5('0x2')];function createListener(_0x363236,_0x1eddd3){return function(_0x563b79){_0x1eddd3['emit'](_0x363236,_0x563b79);};}function removeListener(_0x11f9e0,_0x52a2f1){return function(){ChatMessageEvents['removeListener'](_0x11f9e0,_0x52a2f1);};}exports[_0x0ce5('0x3')]=function(_0x42fadd){for(var _0x69892c=0x0,_0x3eb5b2=events['length'];_0x69892c<_0x3eb5b2;_0x69892c++){var _0x32610d=events[_0x69892c];var _0x8d611f=createListener('chatMessage:'+_0x32610d,_0x42fadd);ChatMessageEvents['on'](_0x32610d,_0x8d611f);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 2c0e6b2..388d995 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 _0x4d68=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','post','tracked','chat','chatmessage:create','/:id','update','put','accept','delete','exports','util','path','express'];(function(_0x3de01a,_0xcc1fd4){var _0x43f31e=function(_0xf8e692){while(--_0xf8e692){_0x3de01a['push'](_0x3de01a['shift']());}};_0x43f31e(++_0xcc1fd4);}(_0x4d68,0x1d8));var _0x84d6=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x4d68[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require('multer');var util=require(_0x84d6('0x0'));var path=require(_0x84d6('0x1'));var timeout=require('connect-timeout');var express=require(_0x84d6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x84d6('0x3'));var config=require(_0x84d6('0x4'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x84d6('0x5')](),controller['index']);router[_0x84d6('0x6')](_0x84d6('0x7'),auth[_0x84d6('0x5')](),controller[_0x84d6('0x8')]);router[_0x84d6('0x6')]('/:id',auth[_0x84d6('0x5')](),controller['show']);router[_0x84d6('0x9')]('/',auth[_0x84d6('0x5')](),interaction[_0x84d6('0xa')](_0x84d6('0xb'),_0x84d6('0xc')),controller['create']);router['put'](_0x84d6('0xd'),controller[_0x84d6('0xe')]);router[_0x84d6('0xf')]('/:id/accept',auth[_0x84d6('0x5')](),controller[_0x84d6('0x10')]);router[_0x84d6('0xf')]('/:id/reject',auth[_0x84d6('0x5')](),controller['reject']);router[_0x84d6('0x11')](_0x84d6('0xd'),auth[_0x84d6('0x5')](),controller['destroy']);module[_0x84d6('0x12')]=router; \ No newline at end of file +var _0x7ae6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','describe','/:id','isAuthenticated','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x7ae6,0xa8));var _0x67ae=function(_0x5c292f,_0x20efd4){_0x5c292f=_0x5c292f-0x0;var _0x27d10b=_0x7ae6[_0x5c292f];return _0x27d10b;};'use strict';var multer=require(_0x67ae('0x0'));var util=require(_0x67ae('0x1'));var path=require(_0x67ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x67ae('0x3'));var router=express[_0x67ae('0x4')]();var fs_extra=require(_0x67ae('0x5'));var auth=require(_0x67ae('0x6'));var interaction=require(_0x67ae('0x7'));var config=require(_0x67ae('0x8'));var controller=require(_0x67ae('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x67ae('0xa')]);router[_0x67ae('0xb')](_0x67ae('0xc'),auth['isAuthenticated'](),controller[_0x67ae('0xd')]);router[_0x67ae('0xb')](_0x67ae('0xe'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x10')]);router['post']('/',auth[_0x67ae('0xf')](),interaction[_0x67ae('0x11')](_0x67ae('0x12'),_0x67ae('0x13')),controller[_0x67ae('0x14')]);router[_0x67ae('0x15')](_0x67ae('0xe'),controller[_0x67ae('0x16')]);router[_0x67ae('0x15')](_0x67ae('0x17'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x18')]);router['put'](_0x67ae('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x67ae('0x1a')](_0x67ae('0xe'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x1b')]);module[_0x67ae('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8895804..403d91f 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1b168f,_0x358a1d){var _0x5d8504=function(_0x28d1f5){while(--_0x28d1f5){_0x1b168f['push'](_0x1b168f['shift']());}};_0x5d8504(++_0x358a1d);}(_0xdb28,0x106));var _0x8db2=function(_0x168492,_0x446902){_0x168492=_0x168492-0x0;var _0x2ded14=_0xdb28[_0x168492];return _0x2ded14;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x757a=['exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x757a,0xde));var _0xa757=function(_0x8f8ae2,_0x47fe1d){_0x8f8ae2=_0x8f8ae2-0x0;var _0x3f2198=_0x757a[_0x8f8ae2];return _0x3f2198;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index b090f2e..03894bd 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x272a40,_0x202eee){var _0x26fb88=function(_0x15b0ef){while(--_0x15b0ef){_0x272a40['push'](_0x272a40['shift']());}};_0x26fb88(++_0x202eee);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));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 licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x47b75d,_0x1ce843){_0x47b75d=_0x47b75d-0x0;var _0x4fc343=_0x7a54[_0x47b75d];return _0x4fc343;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index c286313..8ede9ca 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4380=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','ChatOfflineMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4380,0xb6));var _0x0438=function(_0x4ca486,_0x1e100b){_0x4ca486=_0x4ca486-0x0;var _0x5c1659=_0x4380[_0x4ca486];return _0x5c1659;};'use strict';var EventEmitter=require(_0x0438('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x0438('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0438('0x2')](0x0);var events={'afterCreate':_0x0438('0x3'),'afterUpdate':'update','afterDestroy':_0x0438('0x4')};function emitEvent(_0x2f170e){return function(_0x326e3e,_0xabcb9c,_0x1794a0){ChatOfflineMessageEvents[_0x0438('0x5')](_0x2f170e+':'+_0x326e3e['id'],_0x326e3e);ChatOfflineMessageEvents[_0x0438('0x5')](_0x2f170e,_0x326e3e);_0x1794a0(null);};}for(var e in events){if(events[_0x0438('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x0438('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x1f36=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x16578f,_0x7a1cdf){var _0x52f6e4=function(_0x170f99){while(--_0x170f99){_0x16578f['push'](_0x16578f['shift']());}};_0x52f6e4(++_0x7a1cdf);}(_0x1f36,0x187));var _0x61f3=function(_0x19a9a5,_0x2bf8b2){_0x19a9a5=_0x19a9a5-0x0;var _0x5306fe=_0x1f36[_0x19a9a5];return _0x5306fe;};'use strict';var EventEmitter=require(_0x61f3('0x0'));var ChatOfflineMessage=require(_0x61f3('0x1'))['db'][_0x61f3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x61f3('0x3')](0x0);var events={'afterCreate':_0x61f3('0x4'),'afterUpdate':_0x61f3('0x5'),'afterDestroy':_0x61f3('0x6')};function emitEvent(_0x8ad14f){return function(_0xfc8e04,_0x208982,_0x421fb8){ChatOfflineMessageEvents[_0x61f3('0x7')](_0x8ad14f+':'+_0xfc8e04['id'],_0xfc8e04);ChatOfflineMessageEvents[_0x61f3('0x7')](_0x8ad14f,_0xfc8e04);_0x421fb8(null);};}for(var e in events){if(events[_0x61f3('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x61f3('0x9')](e,emitEvent(event));}}module[_0x61f3('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3a90e10..dbc1985 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 _0xb940=['define','ChatOfflineMessage','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x44ecba,_0x374ed9){var _0x3098a9=function(_0x2fab72){while(--_0x2fab72){_0x44ecba['push'](_0x44ecba['shift']());}};_0x3098a9(++_0x374ed9);}(_0xb940,0x1cf));var _0x0b94=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0xb940[_0xefb4e];return _0x36c78c;};'use strict';var attributes=require(_0x0b94('0x0'));module[_0x0b94('0x1')]=function(_0x39ce3a){return _0x39ce3a[_0x0b94('0x2')](_0x0b94('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b94('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb64d=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb64d,0x1df));var _0xdb64=function(_0x1905fa,_0x114a51){_0x1905fa=_0x1905fa-0x0;var _0x68d09a=_0xb64d[_0x1905fa];return _0x68d09a;};'use strict';var attributes=require(_0xdb64('0x0'));module[_0xdb64('0x1')]=function(_0x414018){return _0x414018[_0xdb64('0x2')](_0xdb64('0x3'),attributes,{'tableName':_0xdb64('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb64('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index dacc9b2..404b745 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xcb99,0x8b));var _0x9cb9=function(_0x2ff022,_0x183a9c){_0x2ff022=_0x2ff022-0x0;var _0x1cbaa5=_0xcb99[_0x2ff022];return _0x1cbaa5;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0x3074=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x2424fa,_0x1d4322){var _0x294f68=function(_0x13da05){while(--_0x13da05){_0x2424fa['push'](_0x2424fa['shift']());}};_0x294f68(++_0x1d4322);}(_0x3074,0x1dd));var _0x4307=function(_0x4dc40f,_0x3012ff){_0x4dc40f=_0x4dc40f-0x0;var _0x525685=_0x3074[_0x4dc40f];return _0x525685;};'use strict';var _=require(_0x4307('0x0'));var util=require('util');var moment=require(_0x4307('0x1'));var BPromise=require(_0x4307('0x2'));var rs=require(_0x4307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4307('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4307('0x5'))(_0x4307('0x6'));var config=require('../../config/environment');var jayson=require(_0x4307('0x7'));var client=jayson[_0x4307('0x8')][_0x4307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x590bda,_0x4336a5,_0x14e01d){return new BPromise(function(_0x11663f,_0x188961){return client[_0x4307('0xa')](_0x590bda,_0x14e01d)[_0x4307('0xb')](function(_0x29b4c0){logger[_0x4307('0xc')](_0x4307('0xd'),_0x4336a5,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4336a5,_0x4307('0xe'),JSON['stringify'](_0x29b4c0));if(_0x29b4c0[_0x4307('0xf')]){if(_0x29b4c0[_0x4307('0xf')][_0x4307('0x10')]===0x1f4){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x188961(_0x29b4c0[_0x4307('0xf')]['message']);}logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x11663f(_0x29b4c0['error'][_0x4307('0x11')]);}else{logger['info'](_0x4307('0xd'),_0x4336a5,'request\x20sent');_0x11663f(_0x29b4c0[_0x4307('0x12')][_0x4307('0x11')]);}})[_0x4307('0x13')](function(_0x2686ee){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x2686ee);_0x188961(_0x2686ee);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e47829c..e6d8a7d 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 _0xda32=['connect-timeout','express','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','path'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xda32,0x12f));var _0x2da3=function(_0x167b5c,_0x22e123){_0x167b5c=_0x167b5c-0x0;var _0x535a49=_0xda32[_0x167b5c];return _0x535a49;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2da3('0x0'));var timeout=require(_0x2da3('0x1'));var express=require(_0x2da3('0x2'));var router=express['Router']();var fs_extra=require(_0x2da3('0x3'));var auth=require(_0x2da3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2da3('0x5'));router['get']('/',auth[_0x2da3('0x6')](),controller[_0x2da3('0x7')]);router[_0x2da3('0x8')](_0x2da3('0x9'),auth[_0x2da3('0x6')](),controller[_0x2da3('0xa')]);router[_0x2da3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2da3('0xb')]);router[_0x2da3('0xc')]('/',auth[_0x2da3('0x6')](),controller['create']);router[_0x2da3('0xd')]('/:id',auth[_0x2da3('0x6')](),controller[_0x2da3('0xe')]);router[_0x2da3('0xf')](_0x2da3('0x10'),auth[_0x2da3('0x6')](),controller[_0x2da3('0x11')]);module[_0x2da3('0x12')]=router; \ No newline at end of file +var _0xf11a=['connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id','post','create','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf11a,0x19e));var _0xaf11=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf11a[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xaf11('0x0'));var util=require('util');var path=require(_0xaf11('0x1'));var timeout=require(_0xaf11('0x2'));var express=require(_0xaf11('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf11('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf11('0x5'));var controller=require(_0xaf11('0x6'));router['get']('/',auth[_0xaf11('0x7')](),controller['index']);router[_0xaf11('0x8')](_0xaf11('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xaf11('0x8')](_0xaf11('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xaf11('0xb')]('/',auth[_0xaf11('0x7')](),controller[_0xaf11('0xc')]);router['put'](_0xaf11('0xa'),auth[_0xaf11('0x7')](),controller['update']);router['delete'](_0xaf11('0xa'),auth[_0xaf11('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0247cda..11a3794 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 _0x1ac6=['STRING','INTEGER','sequelize','ENUM','mouseOver'];(function(_0x5e9e6f,_0x1dcda2){var _0x86b533=function(_0x7e6fad){while(--_0x7e6fad){_0x5e9e6f['push'](_0x5e9e6f['shift']());}};_0x86b533(++_0x1dcda2);}(_0x1ac6,0x17e));var _0x61ac=function(_0x575584,_0x149395){_0x575584=_0x575584-0x0;var _0x120d12=_0x1ac6[_0x575584];return _0x120d12;};'use strict';var Sequelize=require(_0x61ac('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x61ac('0x1')](_0x61ac('0x2'),'timeout'),'defaultValue':_0x61ac('0x2')},'selector':{'type':Sequelize[_0x61ac('0x3')]},'timeout':{'type':Sequelize[_0x61ac('0x4')]}}; \ No newline at end of file +var _0x2340=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x40bb52,_0x37660c){var _0x1f926c=function(_0x37a6a1){while(--_0x37a6a1){_0x40bb52['push'](_0x40bb52['shift']());}};_0x1f926c(++_0x37660c);}(_0x2340,0x158));var _0x0234=function(_0x1e2742,_0x1baf4f){_0x1e2742=_0x1e2742-0x0;var _0xfe90f8=_0x2340[_0x1e2742];return _0xfe90f8;};'use strict';var Sequelize=require(_0x0234('0x0'));module[_0x0234('0x1')]={'name':{'type':Sequelize[_0x0234('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0234('0x3'),_0x0234('0x4')),'defaultValue':_0x0234('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0234('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index b17dfea..118874d 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 _0x7edb=['destroy','error','name','send','show','model','keys','ChatProactiveAction','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then'];(function(_0x422c74,_0xedf31c){var _0x28d051=function(_0x227ab4){while(--_0x227ab4){_0x422c74['push'](_0x422c74['shift']());}};_0x28d051(++_0xedf31c);}(_0x7edb,0x158));var _0xb7ed=function(_0x221e4c,_0x1f1bcf){_0x221e4c=_0x221e4c-0x0;var _0x4f1439=_0x7edb[_0x221e4c];return _0x4f1439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7ed('0x0'));var zipdir=require(_0xb7ed('0x1'));var jsonpatch=require(_0xb7ed('0x2'));var rp=require(_0xb7ed('0x3'));var moment=require(_0xb7ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7ed('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb7ed('0x6'));var csv=require(_0xb7ed('0x7'));var ejs=require(_0xb7ed('0x8'));var fs=require('fs');var fs_extra=require(_0xb7ed('0x9'));var _=require(_0xb7ed('0xa'));var squel=require(_0xb7ed('0xb'));var crypto=require(_0xb7ed('0xc'));var jsforce=require(_0xb7ed('0xd'));var deskjs=require(_0xb7ed('0xe'));var toCsv=require(_0xb7ed('0x7'));var querystring=require('querystring');var Papa=require(_0xb7ed('0xf'));var Redis=require(_0xb7ed('0x10'));var authService=require(_0xb7ed('0x11'));var qs=require(_0xb7ed('0x12'));var as=require(_0xb7ed('0x13'));var hardwareService=require(_0xb7ed('0x14'));var logger=require(_0xb7ed('0x15'))('api');var utils=require(_0xb7ed('0x16'));var config=require(_0xb7ed('0x17'));var licenseUtil=require(_0xb7ed('0x18'));var db=require(_0xb7ed('0x19'))['db'];function respondWithStatusCode(_0x52a37b,_0x56a439){_0x56a439=_0x56a439||0xcc;return function(_0x4da6ff){if(_0x4da6ff){return _0x52a37b[_0xb7ed('0x1a')](_0x56a439);}return _0x52a37b['status'](_0x56a439)[_0xb7ed('0x1b')]();};}function respondWithResult(_0x1492aa,_0x1a61d0){_0x1a61d0=_0x1a61d0||0xc8;return function(_0x2febc7){if(_0x2febc7){return _0x1492aa[_0xb7ed('0x1c')](_0x1a61d0)[_0xb7ed('0x1d')](_0x2febc7);}};}function respondWithFilteredResult(_0x3e7c29,_0x2cb4fd){return function(_0x4046c7){if(_0x4046c7){var _0x2ea4cf=typeof _0x2cb4fd[_0xb7ed('0x1e')]===_0xb7ed('0x1f')&&typeof _0x2cb4fd['limit']===_0xb7ed('0x1f');var _0x48d849=_0x4046c7[_0xb7ed('0x20')];var _0x20fe85=_0x2ea4cf?0x0:_0x2cb4fd['offset'];var _0x4f1bb3=_0x2ea4cf?_0x4046c7[_0xb7ed('0x20')]:_0x2cb4fd[_0xb7ed('0x1e')]+_0x2cb4fd[_0xb7ed('0x21')];var _0x59d52a;if(_0x4f1bb3>=_0x48d849){_0x4f1bb3=_0x48d849;_0x59d52a=0xc8;}else{_0x59d52a=0xce;}_0x3e7c29[_0xb7ed('0x1c')](_0x59d52a);return _0x3e7c29[_0xb7ed('0x22')](_0xb7ed('0x23'),_0x20fe85+'-'+_0x4f1bb3+'/'+_0x48d849)[_0xb7ed('0x1d')](_0x4046c7);}return null;};}function patchUpdates(_0x483633){return function(_0x10d622){try{jsonpatch[_0xb7ed('0x24')](_0x10d622,_0x483633,!![]);}catch(_0xf5c308){return BPromise[_0xb7ed('0x25')](_0xf5c308);}return _0x10d622[_0xb7ed('0x26')]();};}function saveUpdates(_0x1aefd4,_0xc1a24a){return function(_0x93cf31){if(_0x93cf31){return _0x93cf31['update'](_0x1aefd4)[_0xb7ed('0x27')](function(_0x27519a){return _0x27519a;});}return null;};}function removeEntity(_0x507225,_0x4f68b6){return function(_0x4ea1e9){if(_0x4ea1e9){return _0x4ea1e9[_0xb7ed('0x28')]()['then'](function(){_0x507225['status'](0xcc)[_0xb7ed('0x1b')]();});}};}function handleEntityNotFound(_0x5807fd,_0x361f31){return function(_0x52f6c8){if(!_0x52f6c8){_0x5807fd[_0xb7ed('0x1a')](0x194);}return _0x52f6c8;};}function handleError(_0x2ec849,_0x3e48e8){_0x3e48e8=_0x3e48e8||0x1f4;return function(_0x27eb83){logger[_0xb7ed('0x29')](_0x27eb83['stack']);if(_0x27eb83['name']){delete _0x27eb83[_0xb7ed('0x2a')];}_0x2ec849[_0xb7ed('0x1c')](_0x3e48e8)[_0xb7ed('0x2b')](_0x27eb83);};}exports[_0xb7ed('0x2c')]=function(_0x2f726c,_0x59b080){var _0x2ef587={'raw':!![],'where':{'id':_0x2f726c['params']['id']}},_0x43bb8f={};_0x43bb8f[_0xb7ed('0x2d')]=_[_0xb7ed('0x2e')](db[_0xb7ed('0x2f')]['rawAttributes']);_0x43bb8f[_0xb7ed('0x30')]=_[_0xb7ed('0x2e')](_0x2f726c[_0xb7ed('0x30')]);_0x43bb8f[_0xb7ed('0x31')]=_['intersection'](_0x43bb8f[_0xb7ed('0x2d')],_0x43bb8f['query']);_0x2ef587[_0xb7ed('0x32')]=_[_0xb7ed('0x33')](_0x43bb8f[_0xb7ed('0x2d')],qs[_0xb7ed('0x34')](_0x2f726c[_0xb7ed('0x30')][_0xb7ed('0x34')]));_0x2ef587[_0xb7ed('0x32')]=_0x2ef587['attributes'][_0xb7ed('0x35')]?_0x2ef587['attributes']:_0x43bb8f[_0xb7ed('0x2d')];if(_0x2f726c['query'][_0xb7ed('0x36')]){_0x2ef587[_0xb7ed('0x37')]=[{'all':!![]}];}_0x2ef587=_[_0xb7ed('0x38')]({},_0x2ef587,_0x2f726c[_0xb7ed('0x39')]);return db['ChatProactiveAction'][_0xb7ed('0x3a')](_0x2ef587)[_0xb7ed('0x27')](handleEntityNotFound(_0x59b080,null))[_0xb7ed('0x27')](respondWithResult(_0x59b080,null))[_0xb7ed('0x3b')](handleError(_0x59b080,null));};exports[_0xb7ed('0x3c')]=function(_0x5c4a73,_0x10962d){return db[_0xb7ed('0x2f')][_0xb7ed('0x3c')](_0x5c4a73[_0xb7ed('0x3d')],{})[_0xb7ed('0x27')](respondWithResult(_0x10962d,0xc9))[_0xb7ed('0x3b')](handleError(_0x10962d,null));};exports[_0xb7ed('0x3e')]=function(_0x16a6fe,_0x1fed0e){if(_0x16a6fe['body']['id']){delete _0x16a6fe[_0xb7ed('0x3d')]['id'];}return db['ChatProactiveAction'][_0xb7ed('0x3a')]({'where':{'id':_0x16a6fe[_0xb7ed('0x3f')]['id']}})[_0xb7ed('0x27')](handleEntityNotFound(_0x1fed0e,null))['then'](saveUpdates(_0x16a6fe[_0xb7ed('0x3d')],null))[_0xb7ed('0x27')](respondWithResult(_0x1fed0e,null))[_0xb7ed('0x3b')](handleError(_0x1fed0e,null));};exports[_0xb7ed('0x28')]=function(_0x21b92f,_0x2ee99d){return db['ChatProactiveAction']['find']({'where':{'id':_0x21b92f[_0xb7ed('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2ee99d,null))[_0xb7ed('0x27')](removeEntity(_0x2ee99d,null))[_0xb7ed('0x3b')](handleError(_0x2ee99d,null));}; \ No newline at end of file +var _0x7579=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x7579,0x1e2));var _0x9757=function(_0x1d0da5,_0x429318){_0x1d0da5=_0x1d0da5-0x0;var _0x57744a=_0x7579[_0x1d0da5];return _0x57744a;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={'raw':!![],'where':{'id':_0x21a4bd[_0x9757('0x2c')]['id']}},_0x4ebdb6={};_0x4ebdb6[_0x9757('0x2d')]=_[_0x9757('0x2e')](db[_0x9757('0x2f')][_0x9757('0x30')]);_0x4ebdb6[_0x9757('0x31')]=_['keys'](_0x21a4bd[_0x9757('0x31')]);_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x4ebdb6[_0x9757('0x2d')],_0x4ebdb6[_0x9757('0x31')]);_0x3aae8b[_0x9757('0x34')]=_[_0x9757('0x33')](_0x4ebdb6['model'],qs[_0x9757('0x35')](_0x21a4bd[_0x9757('0x31')][_0x9757('0x35')]));_0x3aae8b[_0x9757('0x34')]=_0x3aae8b[_0x9757('0x34')][_0x9757('0x36')]?_0x3aae8b[_0x9757('0x34')]:_0x4ebdb6[_0x9757('0x2d')];if(_0x21a4bd['query'][_0x9757('0x37')]){_0x3aae8b['include']=[{'all':!![]}];}_0x3aae8b=_[_0x9757('0x38')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x39')]);return db['ChatProactiveAction'][_0x9757('0x3a')](_0x3aae8b)[_0x9757('0x28')](handleEntityNotFound(_0xc81976,null))[_0x9757('0x28')](respondWithResult(_0xc81976,null))[_0x9757('0x3b')](handleError(_0xc81976,null));};exports[_0x9757('0x3c')]=function(_0x2f2688,_0x3c94b2){return db[_0x9757('0x2f')][_0x9757('0x3c')](_0x2f2688[_0x9757('0x3d')],{})['then'](respondWithResult(_0x3c94b2,0xc9))[_0x9757('0x3b')](handleError(_0x3c94b2,null));};exports[_0x9757('0x27')]=function(_0x457d6c,_0x4f2ea4){if(_0x457d6c[_0x9757('0x3d')]['id']){delete _0x457d6c[_0x9757('0x3d')]['id'];}return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x457d6c[_0x9757('0x2c')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x4f2ea4,null))[_0x9757('0x28')](saveUpdates(_0x457d6c[_0x9757('0x3d')],null))[_0x9757('0x28')](respondWithResult(_0x4f2ea4,null))['catch'](handleError(_0x4f2ea4,null));};exports['destroy']=function(_0x2cf830,_0x2d0a6e){return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x2cf830['params']['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x2d0a6e,null))['then'](removeEntity(_0x2d0a6e,null))[_0x9757('0x3b')](handleError(_0x2d0a6e,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 27c9517..7f6606f 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 _0x5773=['ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x579b37,_0x5b4bf0){var _0x5b26b6=function(_0x78449b){while(--_0x78449b){_0x579b37['push'](_0x579b37['shift']());}};_0x5b26b6(++_0x5b4bf0);}(_0x5773,0x1e3));var _0x3577=function(_0x277a61,_0x2ddde8){_0x277a61=_0x277a61-0x0;var _0x1fc8f9=_0x5773[_0x277a61];return _0x1fc8f9;};'use strict';var _=require('lodash');var util=require(_0x3577('0x0'));var logger=require(_0x3577('0x1'))(_0x3577('0x2'));var moment=require(_0x3577('0x3'));var BPromise=require('bluebird');var rp=require(_0x3577('0x4'));var fs=require('fs');var path=require(_0x3577('0x5'));var rimraf=require(_0x3577('0x6'));var config=require(_0x3577('0x7'));var attributes=require(_0x3577('0x8'));module[_0x3577('0x9')]=function(_0x51c272,_0x597fa6){return _0x51c272[_0x3577('0xa')](_0x3577('0xb'),attributes,{'tableName':_0x3577('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x708f=['moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x708f,0x17c));var _0xf708=function(_0x5772df,_0x635fec){_0x5772df=_0x5772df-0x0;var _0x1332d0=_0x708f[_0x5772df];return _0x1332d0;};'use strict';var _=require(_0xf708('0x0'));var util=require(_0xf708('0x1'));var logger=require(_0xf708('0x2'))(_0xf708('0x3'));var moment=require(_0xf708('0x4'));var BPromise=require(_0xf708('0x5'));var rp=require(_0xf708('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf708('0x7'));var attributes=require(_0xf708('0x8'));module[_0xf708('0x9')]=function(_0x5284a8,_0x407166){return _0x5284a8['define'](_0xf708('0xa'),attributes,{'tableName':_0xf708('0xb'),'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 7e72d48..fd469ed 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 _0xb51a=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c1370,_0x2b89be){var _0xb04190=function(_0xb19096){while(--_0xb19096){_0x5c1370['push'](_0x5c1370['shift']());}};_0xb04190(++_0x2b89be);}(_0xb51a,0xcb));var _0xab51=function(_0x110b2e,_0xacc2cf){_0x110b2e=_0x110b2e-0x0;var _0x4863fb=_0xb51a[_0x110b2e];return _0x4863fb;};'use strict';var _=require(_0xab51('0x0'));var util=require('util');var moment=require(_0xab51('0x1'));var BPromise=require('bluebird');var rs=require(_0xab51('0x2'));var fs=require('fs');var Redis=require(_0xab51('0x3'));var db=require(_0xab51('0x4'))['db'];var utils=require(_0xab51('0x5'));var logger=require(_0xab51('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab51('0x7')][_0xab51('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58cc75,_0x1189b5,_0x4ed2c0){return new BPromise(function(_0x5c315a,_0x1408c3){return client[_0xab51('0x9')](_0x58cc75,_0x4ed2c0)[_0xab51('0xa')](function(_0x3a94b0){logger[_0xab51('0xb')](_0xab51('0xc'),_0x1189b5,_0xab51('0xd'));logger['debug'](_0xab51('0xe'),_0x1189b5,_0xab51('0xd'),JSON[_0xab51('0xf')](_0x3a94b0));if(_0x3a94b0[_0xab51('0x10')]){if(_0x3a94b0[_0xab51('0x10')]['code']===0x1f4){logger[_0xab51('0x10')](_0xab51('0xc'),_0x1189b5,_0x3a94b0[_0xab51('0x10')]['message']);return _0x1408c3(_0x3a94b0[_0xab51('0x10')]['message']);}logger[_0xab51('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x1189b5,_0x3a94b0[_0xab51('0x10')][_0xab51('0x11')]);return _0x5c315a(_0x3a94b0['error'][_0xab51('0x11')]);}else{logger[_0xab51('0xb')](_0xab51('0xc'),_0x1189b5,'request\x20sent');_0x5c315a(_0x3a94b0[_0xab51('0x12')][_0xab51('0x11')]);}})[_0xab51('0x13')](function(_0x1b3019){logger[_0xab51('0x10')](_0xab51('0xc'),_0x1189b5,_0x1b3019);_0x1408c3(_0x1b3019);});});} \ No newline at end of file +var _0x69dc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x69dc,0x9d));var _0xc69d=function(_0x6621b7,_0x6010df){_0x6621b7=_0x6621b7-0x0;var _0x1c197b=_0x69dc[_0x6621b7];return _0x1c197b;};'use strict';var _=require('lodash');var util=require(_0xc69d('0x0'));var moment=require(_0xc69d('0x1'));var BPromise=require(_0xc69d('0x2'));var rs=require(_0xc69d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc69d('0x4'))['db'];var utils=require(_0xc69d('0x5'));var logger=require(_0xc69d('0x6'))(_0xc69d('0x7'));var config=require('../../config/environment');var jayson=require(_0xc69d('0x8'));var client=jayson[_0xc69d('0x9')][_0xc69d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdfaa,_0x4b37db,_0x3f2b53){return new BPromise(function(_0x34801f,_0x4e07a7){return client[_0xc69d('0xb')](_0x3cdfaa,_0x3f2b53)[_0xc69d('0xc')](function(_0x109a2b){logger[_0xc69d('0xd')](_0xc69d('0xe'),_0x4b37db,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4b37db,_0xc69d('0xf'),JSON['stringify'](_0x109a2b));if(_0x109a2b[_0xc69d('0x10')]){if(_0x109a2b['error']['code']===0x1f4){logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x109a2b['error'][_0xc69d('0x11')]);return _0x4e07a7(_0x109a2b[_0xc69d('0x10')][_0xc69d('0x11')]);}logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x109a2b[_0xc69d('0x10')][_0xc69d('0x11')]);return _0x34801f(_0x109a2b['error'][_0xc69d('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4b37db,'request\x20sent');_0x34801f(_0x109a2b[_0xc69d('0x12')][_0xc69d('0x11')]);}})[_0xc69d('0x13')](function(_0x3cbeae){logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x3cbeae);_0x4e07a7(_0x3cbeae);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6eed8c0..b79489c 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x7da7,0x10d));var _0x77da=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x7da7[_0x334fea];return _0x3c5829;};'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 fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router; \ No newline at end of file +var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x68b040,_0x263ba9){var _0x269f90=function(_0x5c6b1f){while(--_0x5c6b1f){_0x68b040['push'](_0x68b040['shift']());}};_0x269f90(++_0x263ba9);}(_0x53ec,0x192));var _0xc53e=function(_0x349080,_0x485b71){_0x349080=_0x349080-0x0;var _0x1ef849=_0x53ec[_0x349080];return _0x1ef849;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);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 d1e2105..75963b9 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 _0xe303=['INTEGER','ENUM','rrmemory','beepall','roundrobin','name','STRING'];(function(_0x1ed197,_0x2b43b8){var _0x37f97a=function(_0x5d4d38){while(--_0x5d4d38){_0x1ed197['push'](_0x1ed197['shift']());}};_0x37f97a(++_0x2b43b8);}(_0xe303,0x6e));var _0x3e30=function(_0x23b895,_0x58a854){_0x23b895=_0x23b895-0x0;var _0x88a9a7=_0xe303[_0x23b895];return _0x88a9a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3e30('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e30('0x1')]},'timeout':{'type':Sequelize[_0x3e30('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e30('0x3')](_0x3e30('0x4'),_0x3e30('0x5'),_0x3e30('0x6'))}}; \ No newline at end of file +var _0x894d=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x15ebc8,_0x4b05af){var _0x29f88a=function(_0x5ec0ce){while(--_0x5ec0ce){_0x15ebc8['push'](_0x15ebc8['shift']());}};_0x29f88a(++_0x4b05af);}(_0x894d,0xd4));var _0xd894=function(_0x5cec18,_0x34d5ea){_0x5cec18=_0x5cec18-0x0;var _0x4b878f=_0x894d[_0x5cec18];return _0x4b878f;};'use strict';var Sequelize=require(_0xd894('0x0'));module['exports']={'name':{'type':Sequelize[_0xd894('0x1')],'unique':_0xd894('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd894('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd894('0x4')](_0xd894('0x5'),_0xd894('0x6'),_0xd894('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0e0c446..979fcdf 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 _0xb996=['socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost'];(function(_0x5e739f,_0x194ca9){var _0x53c2be=function(_0x10b23e){while(--_0x10b23e){_0x5e739f['push'](_0x5e739f['shift']());}};_0x53c2be(++_0x194ca9);}(_0xb996,0x1ad));var _0x6b99=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb996[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b99('0x0'));var zipdir=require(_0x6b99('0x1'));var jsonpatch=require(_0x6b99('0x2'));var rp=require(_0x6b99('0x3'));var moment=require('moment');var BPromise=require(_0x6b99('0x4'));var Mustache=require(_0x6b99('0x5'));var util=require(_0x6b99('0x6'));var path=require(_0x6b99('0x7'));var sox=require(_0x6b99('0x8'));var csv=require(_0x6b99('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b99('0xa'));var _=require(_0x6b99('0xb'));var squel=require(_0x6b99('0xc'));var crypto=require(_0x6b99('0xd'));var jsforce=require(_0x6b99('0xe'));var deskjs=require(_0x6b99('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6b99('0x10'));var Papa=require('papaparse');var Redis=require(_0x6b99('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6b99('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b99('0x13'));var logger=require(_0x6b99('0x14'))(_0x6b99('0x15'));var utils=require(_0x6b99('0x16'));var config=require(_0x6b99('0x17'));var licenseUtil=require(_0x6b99('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6b99('0x19')](config['redis'],{'host':_0x6b99('0x1a'),'port':0x18eb});var socket=require(_0x6b99('0x1b'))(new Redis(config['redis']));require(_0x6b99('0x1c'))[_0x6b99('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6b99('0x1e')][_0x6b99('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x328a2d,_0x472a2a,_0x3b2cc3,_0xf2df53){return new BPromise(function(_0x4b4e37,_0xfc7190){var _0x1f58f4=_0xf2df53||client;return _0x1f58f4[_0x6b99('0x20')](_0x328a2d,_0x3b2cc3)[_0x6b99('0x21')](function(_0x157811){logger[_0x6b99('0x22')](_0x6b99('0x23'),_0x472a2a,_0x6b99('0x24'));logger[_0x6b99('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x472a2a,_0x6b99('0x24'),JSON[_0x6b99('0x26')](_0x157811));if(_0x157811[_0x6b99('0x27')]){if(_0x157811[_0x6b99('0x27')][_0x6b99('0x28')]===0x1f4){logger[_0x6b99('0x27')](_0x6b99('0x23'),_0x472a2a,_0x157811[_0x6b99('0x27')][_0x6b99('0x29')]);return _0xfc7190(_0x157811['error'][_0x6b99('0x29')]);}logger['error'](_0x6b99('0x23'),_0x472a2a,_0x157811[_0x6b99('0x27')]['message']);return _0x4b4e37(_0x157811[_0x6b99('0x27')][_0x6b99('0x29')]);}else{logger['info'](_0x6b99('0x23'),_0x472a2a,_0x6b99('0x24'));_0x4b4e37(_0x157811[_0x6b99('0x2a')][_0x6b99('0x29')]);}})['catch'](function(_0x11e775){logger[_0x6b99('0x27')](_0x6b99('0x23'),_0x472a2a,_0x11e775);_0xfc7190(_0x11e775);});});}function respondWithStatusCode(_0x2d9a2a,_0x30cb2e){_0x30cb2e=_0x30cb2e||0xcc;return function(_0x3c9f03){if(_0x3c9f03){return _0x2d9a2a['sendStatus'](_0x30cb2e);}return _0x2d9a2a[_0x6b99('0x2b')](_0x30cb2e)[_0x6b99('0x2c')]();};}function respondWithResult(_0x23c97e,_0x34b165){_0x34b165=_0x34b165||0xc8;return function(_0x1737e3){if(_0x1737e3){return _0x23c97e[_0x6b99('0x2b')](_0x34b165)[_0x6b99('0x2d')](_0x1737e3);}};}function respondWithFilteredResult(_0x39c43a,_0x37980c){return function(_0x4f9382){if(_0x4f9382){var _0x37f93b=typeof _0x37980c[_0x6b99('0x2e')]==='undefined'&&typeof _0x37980c[_0x6b99('0x2f')]===_0x6b99('0x30');var _0x208536=_0x4f9382['count'];var _0x12590f=_0x37f93b?0x0:_0x37980c[_0x6b99('0x2e')];var _0x1d3b7d=_0x37f93b?_0x4f9382[_0x6b99('0x31')]:_0x37980c['offset']+_0x37980c[_0x6b99('0x2f')];var _0x7d08dd;if(_0x1d3b7d>=_0x208536){_0x1d3b7d=_0x208536;_0x7d08dd=0xc8;}else{_0x7d08dd=0xce;}_0x39c43a[_0x6b99('0x2b')](_0x7d08dd);return _0x39c43a[_0x6b99('0x32')](_0x6b99('0x33'),_0x12590f+'-'+_0x1d3b7d+'/'+_0x208536)[_0x6b99('0x2d')](_0x4f9382);}return null;};}function patchUpdates(_0x581bf4){return function(_0x2014e9){try{jsonpatch['apply'](_0x2014e9,_0x581bf4,!![]);}catch(_0x5dae03){return BPromise[_0x6b99('0x34')](_0x5dae03);}return _0x2014e9[_0x6b99('0x35')]();};}function saveUpdates(_0x9a28bd,_0x3b7a81){return function(_0x2d9e34){if(_0x2d9e34){return _0x2d9e34[_0x6b99('0x36')](_0x9a28bd)['then'](function(_0x1bb8e9){return _0x1bb8e9;});}return null;};}function removeEntity(_0x4f6ea2,_0x3c9f6e){return function(_0x5a7039){if(_0x5a7039){return _0x5a7039[_0x6b99('0x37')]()['then'](function(){var _0xd9b289=_0x5a7039[_0x6b99('0x38')]({'plain':!![]});var _0x360d1f=_0x6b99('0x39');return db[_0x6b99('0x3a')][_0x6b99('0x37')]({'where':{'type':_0x360d1f,'resourceId':_0xd9b289['id']}})[_0x6b99('0x21')](function(){return _0x5a7039;});})[_0x6b99('0x21')](function(){_0x4f6ea2[_0x6b99('0x2b')](0xcc)[_0x6b99('0x2c')]();});}};}function handleEntityNotFound(_0x1dcf83,_0xdb5921){return function(_0xce1964){if(!_0xce1964){_0x1dcf83[_0x6b99('0x3b')](0x194);}return _0xce1964;};}function handleError(_0x451721,_0x5389ed){_0x5389ed=_0x5389ed||0x1f4;return function(_0x52c0b9){logger[_0x6b99('0x27')](_0x52c0b9[_0x6b99('0x3c')]);if(_0x52c0b9[_0x6b99('0x3d')]){delete _0x52c0b9['name'];}_0x451721['status'](_0x5389ed)[_0x6b99('0x3e')](_0x52c0b9);};}exports[_0x6b99('0x3f')]=function(_0x5e4d49,_0x1af568){var _0x458b3c={},_0x5ccdf9={},_0x40dbe5={'count':0x0,'rows':[]};var _0x3692e5=_[_0x6b99('0x40')](db[_0x6b99('0x41')]['rawAttributes'],function(_0x537d7b){return{'name':_0x537d7b[_0x6b99('0x42')],'type':_0x537d7b[_0x6b99('0x43')]['key']};});_0x5ccdf9[_0x6b99('0x44')]=_[_0x6b99('0x40')](_0x3692e5,_0x6b99('0x3d'));_0x5ccdf9[_0x6b99('0x45')]=_[_0x6b99('0x46')](_0x5e4d49[_0x6b99('0x45')]);_0x5ccdf9[_0x6b99('0x47')]=_[_0x6b99('0x48')](_0x5ccdf9['model'],_0x5ccdf9[_0x6b99('0x45')]);_0x458b3c[_0x6b99('0x49')]=_[_0x6b99('0x48')](_0x5ccdf9['model'],qs['fields'](_0x5e4d49['query'][_0x6b99('0x4a')]));_0x458b3c[_0x6b99('0x49')]=_0x458b3c[_0x6b99('0x49')]['length']?_0x458b3c[_0x6b99('0x49')]:_0x5ccdf9[_0x6b99('0x44')];if(!_0x5e4d49['query'][_0x6b99('0x4b')](_0x6b99('0x4c'))){_0x458b3c[_0x6b99('0x2f')]=qs[_0x6b99('0x2f')](_0x5e4d49[_0x6b99('0x45')][_0x6b99('0x2f')]);_0x458b3c['offset']=qs[_0x6b99('0x2e')](_0x5e4d49[_0x6b99('0x45')][_0x6b99('0x2e')]);}_0x458b3c[_0x6b99('0x4d')]=qs[_0x6b99('0x4e')](_0x5e4d49[_0x6b99('0x45')]['sort']);_0x458b3c[_0x6b99('0x4f')]=qs[_0x6b99('0x47')](_[_0x6b99('0x50')](_0x5e4d49[_0x6b99('0x45')],_0x5ccdf9[_0x6b99('0x47')]),_0x3692e5);if(_0x5e4d49[_0x6b99('0x45')]['filter']){_0x458b3c[_0x6b99('0x4f')]=_['merge'](_0x458b3c[_0x6b99('0x4f')],{'$or':_['map'](_0x3692e5,function(_0x1272e7){if(_0x1272e7[_0x6b99('0x43')]!=='VIRTUAL'){var _0x434c40={};_0x434c40[_0x1272e7[_0x6b99('0x3d')]]={'$like':'%'+_0x5e4d49[_0x6b99('0x45')][_0x6b99('0x51')]+'%'};return _0x434c40;}})});}_0x458b3c=_[_0x6b99('0x52')]({},_0x458b3c,_0x5e4d49[_0x6b99('0x53')]);var _0x51c9e1={'where':_0x458b3c[_0x6b99('0x4f')]};return db[_0x6b99('0x41')]['count'](_0x51c9e1)[_0x6b99('0x21')](function(_0xa8cf86){_0x40dbe5['count']=_0xa8cf86;if(_0x5e4d49[_0x6b99('0x45')][_0x6b99('0x54')]){_0x458b3c['include']=[{'all':!![]}];}return db[_0x6b99('0x41')]['findAll'](_0x458b3c);})[_0x6b99('0x21')](function(_0x3fe96d){_0x40dbe5[_0x6b99('0x55')]=_0x3fe96d;return _0x40dbe5;})[_0x6b99('0x21')](respondWithFilteredResult(_0x1af568,_0x458b3c))[_0x6b99('0x56')](handleError(_0x1af568,null));};exports['show']=function(_0x127a8c,_0x3a52ab){var _0x53c2fe={'raw':!![],'where':{'id':_0x127a8c['params']['id']}},_0x2a76b1={};_0x2a76b1[_0x6b99('0x44')]=_['keys'](db[_0x6b99('0x41')][_0x6b99('0x57')]);_0x2a76b1[_0x6b99('0x45')]=_[_0x6b99('0x46')](_0x127a8c['query']);_0x2a76b1['filters']=_['intersection'](_0x2a76b1[_0x6b99('0x44')],_0x2a76b1['query']);_0x53c2fe[_0x6b99('0x49')]=_[_0x6b99('0x48')](_0x2a76b1[_0x6b99('0x44')],qs[_0x6b99('0x4a')](_0x127a8c[_0x6b99('0x45')][_0x6b99('0x4a')]));_0x53c2fe[_0x6b99('0x49')]=_0x53c2fe[_0x6b99('0x49')][_0x6b99('0x58')]?_0x53c2fe[_0x6b99('0x49')]:_0x2a76b1['model'];if(_0x127a8c[_0x6b99('0x45')]['includeAll']){_0x53c2fe['include']=[{'all':!![]}];}_0x53c2fe=_['merge']({},_0x53c2fe,_0x127a8c[_0x6b99('0x53')]);return db[_0x6b99('0x41')]['find'](_0x53c2fe)[_0x6b99('0x21')](handleEntityNotFound(_0x3a52ab,null))[_0x6b99('0x21')](respondWithResult(_0x3a52ab,null))[_0x6b99('0x56')](handleError(_0x3a52ab,null));};exports['create']=function(_0x2583bd,_0x5c300c){return db[_0x6b99('0x41')][_0x6b99('0x59')](_0x2583bd['body'],{})[_0x6b99('0x21')](function(_0x209aa6){var _0x48d8ba=_0x2583bd[_0x6b99('0x5a')][_0x6b99('0x38')]({'plain':!![]});if(!_0x48d8ba)throw new Error(_0x6b99('0x5b'));if(_0x48d8ba[_0x6b99('0x5c')]===_0x6b99('0x5a')){var _0x2ecb09=_0x209aa6['get']({'plain':!![]});var _0x415f89=_0x6b99('0x39');return db[_0x6b99('0x5d')][_0x6b99('0x5e')]({'where':{'name':_0x415f89,'userProfileId':_0x48d8ba[_0x6b99('0x5f')]},'raw':!![]})[_0x6b99('0x21')](function(_0x5c91e0){if(_0x5c91e0&&_0x5c91e0[_0x6b99('0x60')]===0x0){return db[_0x6b99('0x3a')][_0x6b99('0x59')]({'name':_0x2ecb09[_0x6b99('0x3d')],'resourceId':_0x2ecb09['id'],'type':_0x5c91e0[_0x6b99('0x3d')],'sectionId':_0x5c91e0['id']},{})['then'](function(){return _0x209aa6;});}else{return _0x209aa6;}})[_0x6b99('0x56')](function(_0x4a02d1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a02d1);throw _0x4a02d1;});}return _0x209aa6;})[_0x6b99('0x21')](respondWithResult(_0x5c300c,0xc9))['catch'](handleError(_0x5c300c,null));};exports[_0x6b99('0x36')]=function(_0x5cb266,_0x4c6f1c){if(_0x5cb266[_0x6b99('0x61')]['id']){delete _0x5cb266['body']['id'];}return db[_0x6b99('0x41')][_0x6b99('0x5e')]({'where':{'id':_0x5cb266[_0x6b99('0x62')]['id']}})['then'](handleEntityNotFound(_0x4c6f1c,null))[_0x6b99('0x21')](saveUpdates(_0x5cb266[_0x6b99('0x61')],null))[_0x6b99('0x21')](respondWithResult(_0x4c6f1c,null))[_0x6b99('0x56')](handleError(_0x4c6f1c,null));};exports['destroy']=function(_0xa470f,_0x427548){return db[_0x6b99('0x41')][_0x6b99('0x5e')]({'where':{'id':_0xa470f['params']['id']}})['then'](handleEntityNotFound(_0x427548,null))[_0x6b99('0x21')](removeEntity(_0x427548,null))['catch'](handleError(_0x427548,null));};exports[_0x6b99('0x63')]=function(_0x2793fe,_0xfcf516){return db[_0x6b99('0x41')][_0x6b99('0x63')]()[_0x6b99('0x21')](respondWithResult(_0xfcf516,null))['catch'](handleError(_0xfcf516,null));};exports[_0x6b99('0x64')]=function(_0x34c7a8,_0x3dbd43,_0x192c1c){var _0x459be3={'raw':!![],'where':{}},_0x5ac0fd={},_0x906433;return db[_0x6b99('0x41')][_0x6b99('0x65')]({'where':{'id':_0x34c7a8[_0x6b99('0x62')]['id']}})['then'](handleEntityNotFound(_0x3dbd43,null))[_0x6b99('0x21')](function(_0x336517){if(_0x336517){_0x906433=_0x336517['get']({'plain':!![]});_0x5ac0fd[_0x6b99('0x44')]=_[_0x6b99('0x46')](db['UserChatQueue'][_0x6b99('0x57')]);_0x5ac0fd[_0x6b99('0x45')]=_['keys'](_0x34c7a8[_0x6b99('0x45')]);_0x5ac0fd['filters']=_[_0x6b99('0x48')](_0x5ac0fd[_0x6b99('0x44')],_0x5ac0fd['query']);_0x459be3[_0x6b99('0x49')]=_['intersection'](_0x5ac0fd[_0x6b99('0x44')],qs[_0x6b99('0x4a')](_0x34c7a8[_0x6b99('0x45')][_0x6b99('0x4a')]));_0x459be3[_0x6b99('0x49')]=_0x459be3[_0x6b99('0x49')][_0x6b99('0x58')]?_0x459be3[_0x6b99('0x49')]:_0x5ac0fd[_0x6b99('0x44')];if(!_0x34c7a8['query'][_0x6b99('0x4b')](_0x6b99('0x4c'))){_0x459be3[_0x6b99('0x2f')]=qs[_0x6b99('0x2f')](_0x34c7a8[_0x6b99('0x45')][_0x6b99('0x2f')]);_0x459be3['offset']=qs['offset'](_0x34c7a8[_0x6b99('0x45')][_0x6b99('0x2e')]);}_0x459be3['order']=qs[_0x6b99('0x4e')](_0x34c7a8[_0x6b99('0x45')]['sort']);_0x459be3[_0x6b99('0x4f')]=qs[_0x6b99('0x47')](_[_0x6b99('0x50')](_0x34c7a8[_0x6b99('0x45')],_0x5ac0fd[_0x6b99('0x47')]));_0x459be3[_0x6b99('0x4f')]['ChatQueueId']=_0x336517['id'];if(_0x34c7a8[_0x6b99('0x45')]['filter']){_0x459be3[_0x6b99('0x4f')]=_[_0x6b99('0x52')](_0x459be3[_0x6b99('0x4f')],{'$or':_[_0x6b99('0x40')](_0x459be3[_0x6b99('0x49')],function(_0x13c940){var _0x555046={};_0x555046[_0x13c940]={'$like':'%'+_0x34c7a8[_0x6b99('0x45')][_0x6b99('0x51')]+'%'};return _0x555046;})});}_0x459be3=_[_0x6b99('0x52')]({},_0x459be3,_0x34c7a8[_0x6b99('0x53')]);return db[_0x6b99('0x66')][_0x6b99('0x67')](_0x459be3);}})['then'](function(_0x294f5d){if(_0x294f5d){return db[_0x6b99('0x68')][_0x6b99('0x69')]({'where':{'id':_[_0x6b99('0x40')](_0x294f5d,_0x6b99('0x6a')),'role':_0x6b99('0x6b')},'attributes':['id','name','chatPause',_0x6b99('0x6c'),_0x6b99('0x6d')]});}})[_0x6b99('0x21')](function(_0x20c821){if(_0x20c821){return{'count':_0x20c821[_0x6b99('0x31')],'rows':_[_0x6b99('0x40')](_0x20c821[_0x6b99('0x55')],function(_0x36da59){return{'membername':_0x36da59[_0x6b99('0x3d')],'UserId':_0x36da59['id'],'queue_name':_0x906433['name'],'ChatQueueId':_0x906433['id'],'interface':util[_0x6b99('0x6e')]('%s/%s',_0x6b99('0x6f'),_0x36da59[_0x6b99('0x3d')]),'penalty':0x0,'paused':_0x36da59[_0x6b99('0x70')],'createdAt':_0x36da59['createdAt'],'updatedAt':_0x36da59[_0x6b99('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6b99('0x21')](respondWithFilteredResult(_0x3dbd43,_0x459be3))[_0x6b99('0x56')](handleError(_0x3dbd43,null));};exports[_0x6b99('0x71')]=function(_0x1995f2,_0x3de1ff,_0xe176a1){var _0x129144={};var _0x22c7fc={};var _0x5e7e29;var _0x2385a0;return db[_0x6b99('0x41')][_0x6b99('0x65')]({'where':{'id':_0x1995f2[_0x6b99('0x62')]['id']}})[_0x6b99('0x21')](handleEntityNotFound(_0x3de1ff,null))[_0x6b99('0x21')](function(_0x469715){if(_0x469715){_0x5e7e29=_0x469715;_0x22c7fc['model']=_[_0x6b99('0x46')](db[_0x6b99('0x72')]['rawAttributes']);_0x22c7fc['query']=_[_0x6b99('0x46')](_0x1995f2[_0x6b99('0x45')]);_0x22c7fc[_0x6b99('0x47')]=_[_0x6b99('0x48')](_0x22c7fc[_0x6b99('0x44')],_0x22c7fc[_0x6b99('0x45')]);_0x129144[_0x6b99('0x49')]=_[_0x6b99('0x48')](_0x22c7fc[_0x6b99('0x44')],qs[_0x6b99('0x4a')](_0x1995f2['query'][_0x6b99('0x4a')]));_0x129144[_0x6b99('0x49')]=_0x129144[_0x6b99('0x49')][_0x6b99('0x58')]?_0x129144[_0x6b99('0x49')]:_0x22c7fc['model'];_0x129144[_0x6b99('0x4d')]=qs[_0x6b99('0x4e')](_0x1995f2[_0x6b99('0x45')][_0x6b99('0x4e')]);_0x129144[_0x6b99('0x4f')]=qs[_0x6b99('0x47')](_['pick'](_0x1995f2[_0x6b99('0x45')],_0x22c7fc[_0x6b99('0x47')]));if(_0x1995f2['query'][_0x6b99('0x51')]){_0x129144['where']=_[_0x6b99('0x52')](_0x129144['where'],{'$or':_[_0x6b99('0x40')](_0x129144[_0x6b99('0x49')],function(_0x37d82d){var _0x9d9a21={};_0x9d9a21[_0x37d82d]={'$like':'%'+_0x1995f2[_0x6b99('0x45')][_0x6b99('0x51')]+'%'};return _0x9d9a21;})});}_0x129144=_[_0x6b99('0x52')]({},_0x129144,_0x1995f2[_0x6b99('0x53')]);return _0x5e7e29[_0x6b99('0x71')](_0x129144);}})['then'](function(_0x12f142){if(_0x12f142){_0x2385a0=_0x12f142[_0x6b99('0x58')];if(!_0x1995f2[_0x6b99('0x45')]['hasOwnProperty'](_0x6b99('0x4c'))){_0x129144[_0x6b99('0x2f')]=qs[_0x6b99('0x2f')](_0x1995f2[_0x6b99('0x45')]['limit']);_0x129144['offset']=qs[_0x6b99('0x2e')](_0x1995f2[_0x6b99('0x45')][_0x6b99('0x2e')]);}return _0x5e7e29[_0x6b99('0x71')](_0x129144);}})[_0x6b99('0x21')](function(_0x286a8f){if(_0x286a8f){return _0x286a8f?{'count':_0x2385a0,'rows':_0x286a8f}:null;}})[_0x6b99('0x21')](respondWithResult(_0x3de1ff,null))[_0x6b99('0x56')](handleError(_0x3de1ff,null));};exports[_0x6b99('0x73')]=function(_0x3917fc,_0x3278b8,_0x8e2d09){var _0x5edfda=_0x3917fc['body'][_0x6b99('0x74')];return db['Team'][_0x6b99('0x67')]({'where':{'id':_0x5edfda},'attributes':['id'],'include':[{'model':db[_0x6b99('0x68')],'as':_0x6b99('0x75'),'attributes':['id',_0x6b99('0x3d'),_0x6b99('0x76'),_0x6b99('0x77'),_0x6b99('0x78')],'raw':!![]}]})[_0x6b99('0x21')](function(_0x48be0a){if(_0x48be0a){var _0x2fd591=_['flatMap'](_0x48be0a,function(_0x38c86b){var _0x1680b3=_0x38c86b[_0x6b99('0x38')]({'plain':!![]});return _0x1680b3['Agents'];});return db[_0x6b99('0x41')][_0x6b99('0x5e')]({'where':{'id':_0x3917fc[_0x6b99('0x62')]['id']}})[_0x6b99('0x21')](function(_0x430dca){return db[_0x6b99('0x79')][_0x6b99('0x7a')](function(_0x200353){return _0x430dca[_0x6b99('0x73')](_0x5edfda,{'transaction':_0x200353})['then'](function(){return BPromise[_0x6b99('0x7b')](_0x2fd591,function(_0x509a3c){return db[_0x6b99('0x66')][_0x6b99('0x7c')]({'where':{'UserId':_0x509a3c['id'],'ChatQueueId':_0x3917fc[_0x6b99('0x62')]['id']},'transaction':_0x200353});});})['then'](function(){_0x2fd591[_0x6b99('0x7d')](function(_0x30ba45){socket[_0x6b99('0x7e')]('userChatQueue:save',{'UserId':_0x30ba45['id'],'ChatQueueId':_0x430dca['id']});});});});});}})[_0x6b99('0x21')](respondWithStatusCode(_0x3278b8,null))['catch'](handleError(_0x3278b8,null));};exports[_0x6b99('0x7f')]=function(_0x30bda5,_0x41c65a,_0x1634d0){return db[_0x6b99('0x72')][_0x6b99('0x67')]({'where':{'id':_0x30bda5['query'][_0x6b99('0x74')]},'attributes':['id'],'include':[{'model':db[_0x6b99('0x68')],'as':_0x6b99('0x75'),'attributes':['id'],'raw':!![]}]})[_0x6b99('0x21')](handleEntityNotFound(_0x41c65a,null))[_0x6b99('0x21')](function(_0x40ee79){var _0x552161=_[_0x6b99('0x40')](_0x40ee79,'id');var _0x53e127=[];var _0x2c21e6=[];var _0x55f028=squel['select']();_0x55f028[_0x6b99('0x80')](_0x6b99('0x81'))['from'](_0x6b99('0x82'),'tq')['join'](_0x6b99('0x83'),'ut',_0x6b99('0x84'))['where'](_0x6b99('0x85'),_0x30bda5[_0x6b99('0x62')]['id']);for(var _0x2a4800=0x0;_0x2a4800<_0x40ee79[_0x6b99('0x58')];_0x2a4800+=0x1){let _0x190cbf=_0x40ee79[_0x2a4800];for(var _0x1eaf26=0x0;_0x1eaf26<_0x190cbf['Agents'][_0x6b99('0x58')];_0x1eaf26+=0x1){let _0x4817a0=_0x190cbf[_0x6b99('0x75')][_0x1eaf26];var _0x20166b=_0x55f028['clone']();_0x20166b[_0x6b99('0x4f')](_0x6b99('0x86'),_0x4817a0['id']);_0x2c21e6[_0x6b99('0x87')](db[_0x6b99('0x79')][_0x6b99('0x45')](_0x20166b[_0x6b99('0x88')](),{'type':db['sequelize']['QueryTypes'][_0x6b99('0x89')]})['then'](function(_0x5b2e1b){if(_0x5b2e1b['length']===0x1){return _0x4817a0['id'];}else{var _0x5c3124=_[_0x6b99('0x8a')](_[_0x6b99('0x40')](_0x5b2e1b,_0x6b99('0x8b')),function(_0x27b6bd){return _[_0x6b99('0x8c')](_0x552161,_0x27b6bd);});if(_0x5c3124){return _0x4817a0['id'];}}}));}}return BPromise[_0x6b99('0x8d')](_0x2c21e6)[_0x6b99('0x21')](function(_0x2a5e2a){_0x53e127=_(_0x53e127)[_0x6b99('0x8e')](_0x2a5e2a)[_0x6b99('0x8f')]()[_0x6b99('0x90')]();return db['ChatQueue']['find']({'where':{'id':_0x30bda5['params']['id']}})['then'](function(_0x21cb8d){return db['sequelize'][_0x6b99('0x7a')](function(_0x740735){return _0x21cb8d['removeTeams'](_0x30bda5['query'][_0x6b99('0x74')],{'transaction':_0x740735})[_0x6b99('0x21')](function(){if(!_['isEmpty'](_0x53e127)){return _0x21cb8d[_0x6b99('0x91')](_0x53e127,{'transaction':_0x740735});}})['then'](function(){_0x53e127[_0x6b99('0x7d')](function(_0x1a0ab0){socket['emit'](_0x6b99('0x92'),{'UserId':_0x1a0ab0,'ChatQueueId':_0x21cb8d['id']});});});});});});})[_0x6b99('0x21')](respondWithStatusCode(_0x41c65a,null))['catch'](handleError(_0x41c65a,null));};exports['addAgents']=function(_0x18279b,_0x1bb20f,_0x2da94a){return db[_0x6b99('0x41')][_0x6b99('0x5e')]({'where':{'id':_0x18279b[_0x6b99('0x62')]['id']}})[_0x6b99('0x21')](handleEntityNotFound(_0x1bb20f,null))[_0x6b99('0x21')](function(_0x81bc54){if(_0x81bc54){return _0x81bc54[_0x6b99('0x93')](_0x18279b[_0x6b99('0x61')][_0x6b99('0x74')],_['omit'](_0x18279b[_0x6b99('0x61')],[_0x6b99('0x74'),'id'])||{})[_0x6b99('0x94')](function(_0x2b5ef4){for(var _0x274df9=0x0;_0x274df9<_0x18279b[_0x6b99('0x61')][_0x6b99('0x74')][_0x6b99('0x58')];_0x274df9+=0x1){socket[_0x6b99('0x7e')](_0x6b99('0x95'),{'UserId':Number(_0x18279b[_0x6b99('0x61')][_0x6b99('0x74')][_0x274df9]),'ChatQueueId':Number(_0x18279b[_0x6b99('0x62')]['id'])});}return _0x2b5ef4;});}})[_0x6b99('0x21')](respondWithResult(_0x1bb20f,null))[_0x6b99('0x56')](handleError(_0x1bb20f,null));};exports[_0x6b99('0x91')]=function(_0x13c0cf,_0x1dd301,_0x59e0ee){return db[_0x6b99('0x41')][_0x6b99('0x5e')]({'where':{'id':_0x13c0cf['params']['id']}})[_0x6b99('0x21')](handleEntityNotFound(_0x1dd301,null))[_0x6b99('0x21')](function(_0x233f65){if(_0x233f65){return _0x233f65[_0x6b99('0x91')](_0x13c0cf[_0x6b99('0x45')][_0x6b99('0x74')])['then'](function(){if(_[_0x6b99('0x96')](_0x13c0cf['query'][_0x6b99('0x74')])){for(var _0x3ad8f3=0x0;_0x3ad8f3<_0x13c0cf[_0x6b99('0x45')][_0x6b99('0x74')]['length'];_0x3ad8f3+=0x1){socket[_0x6b99('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x13c0cf[_0x6b99('0x45')][_0x6b99('0x74')][_0x3ad8f3]),'ChatQueueId':Number(_0x13c0cf[_0x6b99('0x62')]['id'])});}}else{socket[_0x6b99('0x7e')](_0x6b99('0x92'),{'UserId':Number(_0x13c0cf['query'][_0x6b99('0x74')]),'ChatQueueId':Number(_0x13c0cf[_0x6b99('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x1dd301,null))[_0x6b99('0x56')](handleError(_0x1dd301,null));};exports[_0x6b99('0x97')]=function(_0x3df439,_0x1da9c1,_0x3f4003){var _0x382558={};var _0x56a119={};var _0x2a2a9f;var _0x2fe208;return db[_0x6b99('0x41')][_0x6b99('0x65')]({'where':{'id':_0x3df439['params']['id']}})[_0x6b99('0x21')](handleEntityNotFound(_0x1da9c1,null))['then'](function(_0x2f7ef6){if(_0x2f7ef6){_0x2a2a9f=_0x2f7ef6;_0x56a119['model']=_[_0x6b99('0x46')](db[_0x6b99('0x68')][_0x6b99('0x57')]);_0x56a119[_0x6b99('0x45')]=_[_0x6b99('0x46')](_0x3df439[_0x6b99('0x45')]);_0x56a119[_0x6b99('0x47')]=_[_0x6b99('0x48')](_0x56a119[_0x6b99('0x44')],_0x56a119[_0x6b99('0x45')]);_0x382558['attributes']=_[_0x6b99('0x48')](_0x56a119[_0x6b99('0x44')],qs['fields'](_0x3df439[_0x6b99('0x45')][_0x6b99('0x4a')]));_0x382558['attributes']=_0x382558[_0x6b99('0x49')][_0x6b99('0x58')]?_0x382558['attributes']:_0x56a119['model'];_0x382558[_0x6b99('0x4d')]=qs['sort'](_0x3df439[_0x6b99('0x45')]['sort']);_0x382558[_0x6b99('0x4f')]=qs[_0x6b99('0x47')](_[_0x6b99('0x50')](_0x3df439[_0x6b99('0x45')],_0x56a119[_0x6b99('0x47')]));if(_0x3df439[_0x6b99('0x45')]['filter']){_0x382558[_0x6b99('0x4f')]=_[_0x6b99('0x52')](_0x382558['where'],{'$or':_[_0x6b99('0x40')](_0x382558[_0x6b99('0x49')],function(_0x2c7907){var _0x293d18={};_0x293d18[_0x2c7907]={'$like':'%'+_0x3df439[_0x6b99('0x45')][_0x6b99('0x51')]+'%'};return _0x293d18;})});}_0x382558=_[_0x6b99('0x52')]({},_0x382558,_0x3df439['options']);return _0x2a2a9f[_0x6b99('0x97')](_0x382558);}})[_0x6b99('0x21')](function(_0x4ad235){if(_0x4ad235){_0x2fe208=_0x4ad235[_0x6b99('0x58')];if(!_0x3df439['query'][_0x6b99('0x4b')](_0x6b99('0x4c'))){_0x382558['limit']=qs[_0x6b99('0x2f')](_0x3df439[_0x6b99('0x45')]['limit']);_0x382558['offset']=qs['offset'](_0x3df439[_0x6b99('0x45')][_0x6b99('0x2e')]);}return _0x2a2a9f[_0x6b99('0x97')](_0x382558);}})[_0x6b99('0x21')](function(_0x34f582){if(_0x34f582){return _0x34f582?{'count':_0x2fe208,'rows':_0x34f582}:null;}})['then'](respondWithResult(_0x1da9c1,null))[_0x6b99('0x56')](handleError(_0x1da9c1,null));}; \ No newline at end of file +var _0x6bc4=['nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','params','describe','getMembers','UserChatQueue','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','order','addTeams','ids','User','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','limit','count','offset','apply','reject','save','update','destroy','sendStatus','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2fe9aa,_0x4748a5){var _0x264200=function(_0x27d8ce){while(--_0x27d8ce){_0x2fe9aa['push'](_0x2fe9aa['shift']());}};_0x264200(++_0x4748a5);}(_0x6bc4,0xe0));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x46bc('0x0'));var rimraf=require(_0x46bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46bc('0x2'));var rp=require(_0x46bc('0x3'));var moment=require(_0x46bc('0x4'));var BPromise=require(_0x46bc('0x5'));var Mustache=require(_0x46bc('0x6'));var util=require(_0x46bc('0x7'));var path=require(_0x46bc('0x8'));var sox=require('sox');var csv=require(_0x46bc('0x9'));var ejs=require(_0x46bc('0xa'));var fs=require('fs');var fs_extra=require(_0x46bc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46bc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x46bc('0xd'));var Papa=require(_0x46bc('0xe'));var Redis=require(_0x46bc('0xf'));var authService=require(_0x46bc('0x10'));var qs=require(_0x46bc('0x11'));var as=require(_0x46bc('0x12'));var hardwareService=require(_0x46bc('0x13'));var logger=require('../../config/logger')(_0x46bc('0x14'));var utils=require(_0x46bc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x46bc('0x16'));var db=require('../../mysqldb')['db'];config[_0x46bc('0x17')]=_[_0x46bc('0x18')](config[_0x46bc('0x17')],{'host':_0x46bc('0x19'),'port':0x18eb});var socket=require(_0x46bc('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x46bc('0x1b'));var client=jayson[_0x46bc('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x420d1f,_0x205c52,_0x4ee72b,_0x242172){return new BPromise(function(_0x402344,_0x52cf48){var _0x4067e3=_0x242172||client;return _0x4067e3[_0x46bc('0x1d')](_0x420d1f,_0x4ee72b)[_0x46bc('0x1e')](function(_0x10d311){logger['info'](_0x46bc('0x1f'),_0x205c52,_0x46bc('0x20'));logger[_0x46bc('0x21')](_0x46bc('0x22'),_0x205c52,_0x46bc('0x20'),JSON['stringify'](_0x10d311));if(_0x10d311['error']){if(_0x10d311[_0x46bc('0x23')][_0x46bc('0x24')]===0x1f4){logger[_0x46bc('0x23')]('ChatQueue,\x20%s,\x20%s',_0x205c52,_0x10d311[_0x46bc('0x23')][_0x46bc('0x25')]);return _0x52cf48(_0x10d311[_0x46bc('0x23')]['message']);}logger[_0x46bc('0x23')]('ChatQueue,\x20%s,\x20%s',_0x205c52,_0x10d311[_0x46bc('0x23')][_0x46bc('0x25')]);return _0x402344(_0x10d311['error'][_0x46bc('0x25')]);}else{logger[_0x46bc('0x26')](_0x46bc('0x1f'),_0x205c52,_0x46bc('0x20'));_0x402344(_0x10d311[_0x46bc('0x27')][_0x46bc('0x25')]);}})[_0x46bc('0x28')](function(_0x3e2c8b){logger['error'](_0x46bc('0x1f'),_0x205c52,_0x3e2c8b);_0x52cf48(_0x3e2c8b);});});}function respondWithStatusCode(_0x27456c,_0x4709e1){_0x4709e1=_0x4709e1||0xcc;return function(_0x2d7842){if(_0x2d7842){return _0x27456c['sendStatus'](_0x4709e1);}return _0x27456c['status'](_0x4709e1)[_0x46bc('0x29')]();};}function respondWithResult(_0x4b7388,_0x49abee){_0x49abee=_0x49abee||0xc8;return function(_0x5b73b9){if(_0x5b73b9){return _0x4b7388[_0x46bc('0x2a')](_0x49abee)[_0x46bc('0x2b')](_0x5b73b9);}};}function respondWithFilteredResult(_0x57f56a,_0x339b37){return function(_0x4a7863){if(_0x4a7863){var _0xdcd17a=typeof _0x339b37['offset']==='undefined'&&typeof _0x339b37[_0x46bc('0x2c')]==='undefined';var _0x1d7cb4=_0x4a7863[_0x46bc('0x2d')];var _0x1a0eae=_0xdcd17a?0x0:_0x339b37[_0x46bc('0x2e')];var _0x295e9b=_0xdcd17a?_0x4a7863[_0x46bc('0x2d')]:_0x339b37[_0x46bc('0x2e')]+_0x339b37['limit'];var _0x46a9dd;if(_0x295e9b>=_0x1d7cb4){_0x295e9b=_0x1d7cb4;_0x46a9dd=0xc8;}else{_0x46a9dd=0xce;}_0x57f56a[_0x46bc('0x2a')](_0x46a9dd);return _0x57f56a['set']('Content-Range',_0x1a0eae+'-'+_0x295e9b+'/'+_0x1d7cb4)[_0x46bc('0x2b')](_0x4a7863);}return null;};}function patchUpdates(_0x3f975f){return function(_0x136f5a){try{jsonpatch[_0x46bc('0x2f')](_0x136f5a,_0x3f975f,!![]);}catch(_0x1764f4){return BPromise[_0x46bc('0x30')](_0x1764f4);}return _0x136f5a[_0x46bc('0x31')]();};}function saveUpdates(_0x1e8772,_0x165b23){return function(_0x4083e6){if(_0x4083e6){return _0x4083e6[_0x46bc('0x32')](_0x1e8772)[_0x46bc('0x1e')](function(_0x5597e0){return _0x5597e0;});}return null;};}function removeEntity(_0x15e55c,_0x2aa9ae){return function(_0x47521c){if(_0x47521c){return _0x47521c[_0x46bc('0x33')]()['then'](function(){var _0x5701d7=_0x47521c['get']({'plain':!![]});var _0x4540da='ChatQueues';return db['UserProfileResource'][_0x46bc('0x33')]({'where':{'type':_0x4540da,'resourceId':_0x5701d7['id']}})[_0x46bc('0x1e')](function(){return _0x47521c;});})['then'](function(){_0x15e55c[_0x46bc('0x2a')](0xcc)[_0x46bc('0x29')]();});}};}function handleEntityNotFound(_0xb32f11,_0x5cb6d5){return function(_0x4d97e8){if(!_0x4d97e8){_0xb32f11[_0x46bc('0x34')](0x194);}return _0x4d97e8;};}function handleError(_0x1ec686,_0x2cbcc6){_0x2cbcc6=_0x2cbcc6||0x1f4;return function(_0x51aa30){logger[_0x46bc('0x23')](_0x51aa30['stack']);if(_0x51aa30[_0x46bc('0x35')]){delete _0x51aa30[_0x46bc('0x35')];}_0x1ec686[_0x46bc('0x2a')](_0x2cbcc6)[_0x46bc('0x36')](_0x51aa30);};}exports[_0x46bc('0x37')]=function(_0x3c4ade,_0x260ce7){var _0xbb6d7e={},_0x1201a5={},_0x4fa5e0={'count':0x0,'rows':[]};var _0x90c225=_['map'](db[_0x46bc('0x38')][_0x46bc('0x39')],function(_0x204503){return{'name':_0x204503[_0x46bc('0x3a')],'type':_0x204503[_0x46bc('0x3b')][_0x46bc('0x3c')]};});_0x1201a5[_0x46bc('0x3d')]=_['map'](_0x90c225,_0x46bc('0x35'));_0x1201a5['query']=_[_0x46bc('0x3e')](_0x3c4ade[_0x46bc('0x3f')]);_0x1201a5[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x1201a5[_0x46bc('0x3d')],_0x1201a5[_0x46bc('0x3f')]);_0xbb6d7e[_0x46bc('0x42')]=_['intersection'](_0x1201a5[_0x46bc('0x3d')],qs['fields'](_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x43')]));_0xbb6d7e[_0x46bc('0x42')]=_0xbb6d7e[_0x46bc('0x42')][_0x46bc('0x44')]?_0xbb6d7e[_0x46bc('0x42')]:_0x1201a5[_0x46bc('0x3d')];if(!_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0xbb6d7e[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x3c4ade['query'][_0x46bc('0x2c')]);_0xbb6d7e['offset']=qs[_0x46bc('0x2e')](_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x2e')]);}_0xbb6d7e['order']=qs[_0x46bc('0x47')](_0x3c4ade[_0x46bc('0x3f')]['sort']);_0xbb6d7e[_0x46bc('0x48')]=qs[_0x46bc('0x40')](_[_0x46bc('0x49')](_0x3c4ade[_0x46bc('0x3f')],_0x1201a5[_0x46bc('0x40')]),_0x90c225);if(_0x3c4ade['query'][_0x46bc('0x4a')]){_0xbb6d7e['where']=_[_0x46bc('0x4b')](_0xbb6d7e['where'],{'$or':_[_0x46bc('0x4c')](_0x90c225,function(_0x4f16d8){if(_0x4f16d8[_0x46bc('0x3b')]!=='VIRTUAL'){var _0x20d1f6={};_0x20d1f6[_0x4f16d8[_0x46bc('0x35')]]={'$like':'%'+_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x4a')]+'%'};return _0x20d1f6;}})});}_0xbb6d7e=_[_0x46bc('0x4b')]({},_0xbb6d7e,_0x3c4ade[_0x46bc('0x4d')]);var _0x488485={'where':_0xbb6d7e[_0x46bc('0x48')]};return db[_0x46bc('0x38')][_0x46bc('0x2d')](_0x488485)['then'](function(_0x3dd88c){_0x4fa5e0['count']=_0x3dd88c;if(_0x3c4ade['query'][_0x46bc('0x4e')]){_0xbb6d7e[_0x46bc('0x4f')]=[{'all':!![]}];}return db[_0x46bc('0x38')][_0x46bc('0x50')](_0xbb6d7e);})[_0x46bc('0x1e')](function(_0x1d0922){_0x4fa5e0[_0x46bc('0x51')]=_0x1d0922;return _0x4fa5e0;})[_0x46bc('0x1e')](respondWithFilteredResult(_0x260ce7,_0xbb6d7e))['catch'](handleError(_0x260ce7,null));};exports[_0x46bc('0x52')]=function(_0x2eeff8,_0x53790a){var _0x55555e={'raw':!![],'where':{'id':_0x2eeff8['params']['id']}},_0x510cc6={};_0x510cc6[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x38')][_0x46bc('0x39')]);_0x510cc6[_0x46bc('0x3f')]=_['keys'](_0x2eeff8['query']);_0x510cc6['filters']=_['intersection'](_0x510cc6['model'],_0x510cc6[_0x46bc('0x3f')]);_0x55555e['attributes']=_[_0x46bc('0x41')](_0x510cc6[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x2eeff8[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x55555e['attributes']=_0x55555e[_0x46bc('0x42')][_0x46bc('0x44')]?_0x55555e[_0x46bc('0x42')]:_0x510cc6[_0x46bc('0x3d')];if(_0x2eeff8[_0x46bc('0x3f')][_0x46bc('0x4e')]){_0x55555e[_0x46bc('0x4f')]=[{'all':!![]}];}_0x55555e=_[_0x46bc('0x4b')]({},_0x55555e,_0x2eeff8[_0x46bc('0x4d')]);return db[_0x46bc('0x38')]['find'](_0x55555e)[_0x46bc('0x1e')](handleEntityNotFound(_0x53790a,null))['then'](respondWithResult(_0x53790a,null))[_0x46bc('0x28')](handleError(_0x53790a,null));};exports['create']=function(_0x9df5e9,_0x55736f){return db[_0x46bc('0x38')][_0x46bc('0x53')](_0x9df5e9[_0x46bc('0x54')],{})[_0x46bc('0x1e')](function(_0x4996fc){var _0x5e5db5=_0x9df5e9[_0x46bc('0x55')]['get']({'plain':!![]});if(!_0x5e5db5)throw new Error(_0x46bc('0x56'));if(_0x5e5db5['role']===_0x46bc('0x55')){var _0x42a9c4=_0x4996fc[_0x46bc('0x57')]({'plain':!![]});var _0x5c23a6=_0x46bc('0x58');return db[_0x46bc('0x59')][_0x46bc('0x5a')]({'where':{'name':_0x5c23a6,'userProfileId':_0x5e5db5[_0x46bc('0x5b')]},'raw':!![]})[_0x46bc('0x1e')](function(_0x315e9e){if(_0x315e9e&&_0x315e9e[_0x46bc('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x42a9c4['name'],'resourceId':_0x42a9c4['id'],'type':_0x315e9e[_0x46bc('0x35')],'sectionId':_0x315e9e['id']},{})[_0x46bc('0x1e')](function(){return _0x4996fc;});}else{return _0x4996fc;}})['catch'](function(_0x54b120){logger[_0x46bc('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54b120);throw _0x54b120;});}return _0x4996fc;})[_0x46bc('0x1e')](respondWithResult(_0x55736f,0xc9))[_0x46bc('0x28')](handleError(_0x55736f,null));};exports[_0x46bc('0x32')]=function(_0x3fa61a,_0x3661eb){if(_0x3fa61a[_0x46bc('0x54')]['id']){delete _0x3fa61a[_0x46bc('0x54')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x3fa61a[_0x46bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3661eb,null))[_0x46bc('0x1e')](saveUpdates(_0x3fa61a[_0x46bc('0x54')],null))['then'](respondWithResult(_0x3661eb,null))[_0x46bc('0x28')](handleError(_0x3661eb,null));};exports[_0x46bc('0x33')]=function(_0x5bed94,_0x16ba14){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x5bed94[_0x46bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x16ba14,null))[_0x46bc('0x1e')](removeEntity(_0x16ba14,null))[_0x46bc('0x28')](handleError(_0x16ba14,null));};exports[_0x46bc('0x5e')]=function(_0x5888e8,_0x168494){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x168494,null))[_0x46bc('0x28')](handleError(_0x168494,null));};exports[_0x46bc('0x5f')]=function(_0x20ca08,_0xcca876,_0x2c35d9){var _0x57a02a={'raw':!![],'where':{}},_0x4d1d4a={},_0x2686c3;return db[_0x46bc('0x38')]['findOne']({'where':{'id':_0x20ca08[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0xcca876,null))[_0x46bc('0x1e')](function(_0x2ef201){if(_0x2ef201){_0x2686c3=_0x2ef201[_0x46bc('0x57')]({'plain':!![]});_0x4d1d4a['model']=_[_0x46bc('0x3e')](db[_0x46bc('0x60')][_0x46bc('0x39')]);_0x4d1d4a['query']=_[_0x46bc('0x3e')](_0x20ca08[_0x46bc('0x3f')]);_0x4d1d4a[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x4d1d4a['model'],_0x4d1d4a[_0x46bc('0x3f')]);_0x57a02a[_0x46bc('0x42')]=_[_0x46bc('0x41')](_0x4d1d4a['model'],qs[_0x46bc('0x43')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x57a02a['attributes']=_0x57a02a['attributes'][_0x46bc('0x44')]?_0x57a02a[_0x46bc('0x42')]:_0x4d1d4a[_0x46bc('0x3d')];if(!_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x57a02a[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x57a02a['offset']=qs[_0x46bc('0x2e')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x2e')]);}_0x57a02a['order']=qs[_0x46bc('0x47')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x47')]);_0x57a02a[_0x46bc('0x48')]=qs[_0x46bc('0x40')](_['pick'](_0x20ca08[_0x46bc('0x3f')],_0x4d1d4a['filters']));_0x57a02a[_0x46bc('0x48')][_0x46bc('0x61')]=_0x2ef201['id'];if(_0x20ca08['query'][_0x46bc('0x4a')]){_0x57a02a[_0x46bc('0x48')]=_[_0x46bc('0x4b')](_0x57a02a[_0x46bc('0x48')],{'$or':_[_0x46bc('0x4c')](_0x57a02a[_0x46bc('0x42')],function(_0x34ba15){var _0x1c634b={};_0x1c634b[_0x34ba15]={'$like':'%'+_0x20ca08[_0x46bc('0x3f')]['filter']+'%'};return _0x1c634b;})});}_0x57a02a=_[_0x46bc('0x4b')]({},_0x57a02a,_0x20ca08[_0x46bc('0x4d')]);return db['UserChatQueue'][_0x46bc('0x50')](_0x57a02a);}})[_0x46bc('0x1e')](function(_0x47ba6d){if(_0x47ba6d){return db['User'][_0x46bc('0x62')]({'where':{'id':_['map'](_0x47ba6d,'UserId'),'role':_0x46bc('0x63')},'attributes':['id','name',_0x46bc('0x64'),_0x46bc('0x65'),_0x46bc('0x66')]});}})[_0x46bc('0x1e')](function(_0x3934cc){if(_0x3934cc){return{'count':_0x3934cc[_0x46bc('0x2d')],'rows':_[_0x46bc('0x4c')](_0x3934cc[_0x46bc('0x51')],function(_0x29928b){return{'membername':_0x29928b[_0x46bc('0x35')],'UserId':_0x29928b['id'],'queue_name':_0x2686c3[_0x46bc('0x35')],'ChatQueueId':_0x2686c3['id'],'interface':util[_0x46bc('0x67')](_0x46bc('0x68'),'SIP',_0x29928b['name']),'penalty':0x0,'paused':_0x29928b[_0x46bc('0x64')],'createdAt':_0x29928b['createdAt'],'updatedAt':_0x29928b[_0x46bc('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xcca876,_0x57a02a))[_0x46bc('0x28')](handleError(_0xcca876,null));};exports[_0x46bc('0x69')]=function(_0x46fbff,_0x92c0e1,_0x30aab6){var _0x8c7818={};var _0x29c248={};var _0x2348f1;var _0x41acee;return db['ChatQueue'][_0x46bc('0x6a')]({'where':{'id':_0x46fbff[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x92c0e1,null))['then'](function(_0xdfde17){if(_0xdfde17){_0x2348f1=_0xdfde17;_0x29c248[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x6b')][_0x46bc('0x39')]);_0x29c248['query']=_[_0x46bc('0x3e')](_0x46fbff[_0x46bc('0x3f')]);_0x29c248[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x29c248['model'],_0x29c248[_0x46bc('0x3f')]);_0x8c7818[_0x46bc('0x42')]=_[_0x46bc('0x41')](_0x29c248[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x46fbff[_0x46bc('0x3f')]['fields']));_0x8c7818[_0x46bc('0x42')]=_0x8c7818[_0x46bc('0x42')][_0x46bc('0x44')]?_0x8c7818[_0x46bc('0x42')]:_0x29c248['model'];_0x8c7818[_0x46bc('0x6c')]=qs[_0x46bc('0x47')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x47')]);_0x8c7818[_0x46bc('0x48')]=qs['filters'](_[_0x46bc('0x49')](_0x46fbff[_0x46bc('0x3f')],_0x29c248[_0x46bc('0x40')]));if(_0x46fbff['query']['filter']){_0x8c7818['where']=_['merge'](_0x8c7818['where'],{'$or':_[_0x46bc('0x4c')](_0x8c7818['attributes'],function(_0x2708b0){var _0x3b4c3b={};_0x3b4c3b[_0x2708b0]={'$like':'%'+_0x46fbff[_0x46bc('0x3f')]['filter']+'%'};return _0x3b4c3b;})});}_0x8c7818=_[_0x46bc('0x4b')]({},_0x8c7818,_0x46fbff[_0x46bc('0x4d')]);return _0x2348f1['getTeams'](_0x8c7818);}})[_0x46bc('0x1e')](function(_0x4eed4e){if(_0x4eed4e){_0x41acee=_0x4eed4e['length'];if(!_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x8c7818[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x8c7818[_0x46bc('0x2e')]=qs[_0x46bc('0x2e')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x2e')]);}return _0x2348f1[_0x46bc('0x69')](_0x8c7818);}})[_0x46bc('0x1e')](function(_0x1896ce){if(_0x1896ce){return _0x1896ce?{'count':_0x41acee,'rows':_0x1896ce}:null;}})[_0x46bc('0x1e')](respondWithResult(_0x92c0e1,null))[_0x46bc('0x28')](handleError(_0x92c0e1,null));};exports[_0x46bc('0x6d')]=function(_0x2e91f6,_0x160d9d,_0x4cc248){var _0x5afdde=_0x2e91f6[_0x46bc('0x54')][_0x46bc('0x6e')];return db[_0x46bc('0x6b')][_0x46bc('0x50')]({'where':{'id':_0x5afdde},'attributes':['id'],'include':[{'model':db[_0x46bc('0x6f')],'as':'Agents','attributes':['id',_0x46bc('0x35'),'online','voicePause',_0x46bc('0x70')],'raw':!![]}]})[_0x46bc('0x1e')](function(_0x510b2a){if(_0x510b2a){var _0x383147=_[_0x46bc('0x71')](_0x510b2a,function(_0xac1534){var _0x4b3910=_0xac1534[_0x46bc('0x57')]({'plain':!![]});return _0x4b3910[_0x46bc('0x72')];});return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x2e91f6['params']['id']}})['then'](function(_0x3be347){return db[_0x46bc('0x73')][_0x46bc('0x74')](function(_0x9857ff){return _0x3be347['addTeams'](_0x5afdde,{'transaction':_0x9857ff})[_0x46bc('0x1e')](function(){return BPromise[_0x46bc('0x75')](_0x383147,function(_0x5d8035){return db[_0x46bc('0x60')][_0x46bc('0x76')]({'where':{'UserId':_0x5d8035['id'],'ChatQueueId':_0x2e91f6[_0x46bc('0x5d')]['id']},'transaction':_0x9857ff});});})[_0x46bc('0x1e')](function(){_0x383147[_0x46bc('0x77')](function(_0x5728a4){socket[_0x46bc('0x78')](_0x46bc('0x79'),{'UserId':_0x5728a4['id'],'ChatQueueId':_0x3be347['id']});});});});});}})[_0x46bc('0x1e')](respondWithStatusCode(_0x160d9d,null))[_0x46bc('0x28')](handleError(_0x160d9d,null));};exports[_0x46bc('0x7a')]=function(_0x11728d,_0x10c941,_0x1df9f3){return db[_0x46bc('0x6b')]['findAll']({'where':{'id':_0x11728d['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x46bc('0x6f')],'as':_0x46bc('0x72'),'attributes':['id'],'raw':!![]}]})[_0x46bc('0x1e')](handleEntityNotFound(_0x10c941,null))[_0x46bc('0x1e')](function(_0x3aaa59){var _0x2d2e79=_[_0x46bc('0x4c')](_0x3aaa59,'id');var _0x17a30e=[];var _0x4a4b52=[];var _0x4b98cd=squel[_0x46bc('0x7b')]();_0x4b98cd[_0x46bc('0x7c')]('tq.TeamId')[_0x46bc('0x7d')](_0x46bc('0x7e'),'tq')[_0x46bc('0x7f')](_0x46bc('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x46bc('0x48')](_0x46bc('0x81'),_0x11728d[_0x46bc('0x5d')]['id']);for(var _0x15d885=0x0;_0x15d885<_0x3aaa59[_0x46bc('0x44')];_0x15d885+=0x1){let _0x197134=_0x3aaa59[_0x15d885];for(var _0xc841b5=0x0;_0xc841b5<_0x197134[_0x46bc('0x72')][_0x46bc('0x44')];_0xc841b5+=0x1){let _0x59ea55=_0x197134[_0x46bc('0x72')][_0xc841b5];var _0x44b367=_0x4b98cd['clone']();_0x44b367[_0x46bc('0x48')](_0x46bc('0x82'),_0x59ea55['id']);_0x4a4b52[_0x46bc('0x83')](db[_0x46bc('0x73')]['query'](_0x44b367[_0x46bc('0x84')](),{'type':db[_0x46bc('0x73')][_0x46bc('0x85')][_0x46bc('0x86')]})['then'](function(_0x10a066){if(_0x10a066['length']===0x1){return _0x59ea55['id'];}else{var _0x5917d6=_[_0x46bc('0x87')](_[_0x46bc('0x4c')](_0x10a066,'TeamId'),function(_0x363b35){return _[_0x46bc('0x88')](_0x2d2e79,_0x363b35);});if(_0x5917d6){return _0x59ea55['id'];}}}));}}return BPromise['all'](_0x4a4b52)['then'](function(_0x5933b1){_0x17a30e=_(_0x17a30e)[_0x46bc('0x89')](_0x5933b1)[_0x46bc('0x8a')]()[_0x46bc('0x8b')]();return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x11728d[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](function(_0x402f68){return db[_0x46bc('0x73')][_0x46bc('0x74')](function(_0x1391f7){return _0x402f68[_0x46bc('0x7a')](_0x11728d[_0x46bc('0x3f')][_0x46bc('0x6e')],{'transaction':_0x1391f7})[_0x46bc('0x1e')](function(){if(!_[_0x46bc('0x8c')](_0x17a30e)){return _0x402f68[_0x46bc('0x8d')](_0x17a30e,{'transaction':_0x1391f7});}})['then'](function(){_0x17a30e[_0x46bc('0x77')](function(_0x402389){socket[_0x46bc('0x78')](_0x46bc('0x8e'),{'UserId':_0x402389,'ChatQueueId':_0x402f68['id']});});});});});});})[_0x46bc('0x1e')](respondWithStatusCode(_0x10c941,null))['catch'](handleError(_0x10c941,null));};exports['addAgents']=function(_0x608dbd,_0x4e4b83,_0x4b3d8a){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x608dbd[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x4e4b83,null))[_0x46bc('0x1e')](function(_0x377835){if(_0x377835){return _0x377835[_0x46bc('0x8f')](_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')],_[_0x46bc('0x90')](_0x608dbd[_0x46bc('0x54')],[_0x46bc('0x6e'),'id'])||{})[_0x46bc('0x91')](function(_0x496bc1){for(var _0x5d8b30=0x0;_0x5d8b30<_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')]['length'];_0x5d8b30+=0x1){socket[_0x46bc('0x78')]('userChatQueue:save',{'UserId':Number(_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')][_0x5d8b30]),'ChatQueueId':Number(_0x608dbd[_0x46bc('0x5d')]['id'])});}return _0x496bc1;});}})[_0x46bc('0x1e')](respondWithResult(_0x4e4b83,null))[_0x46bc('0x28')](handleError(_0x4e4b83,null));};exports[_0x46bc('0x8d')]=function(_0x3b6a97,_0x2557b2,_0x15bd95){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x3b6a97[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x2557b2,null))['then'](function(_0x180b7b){if(_0x180b7b){return _0x180b7b[_0x46bc('0x8d')](_0x3b6a97[_0x46bc('0x3f')]['ids'])[_0x46bc('0x1e')](function(){if(_['isArray'](_0x3b6a97['query'][_0x46bc('0x6e')])){for(var _0x2c9c74=0x0;_0x2c9c74<_0x3b6a97[_0x46bc('0x3f')][_0x46bc('0x6e')][_0x46bc('0x44')];_0x2c9c74+=0x1){socket[_0x46bc('0x78')](_0x46bc('0x8e'),{'UserId':Number(_0x3b6a97[_0x46bc('0x3f')]['ids'][_0x2c9c74]),'ChatQueueId':Number(_0x3b6a97['params']['id'])});}}else{socket['emit'](_0x46bc('0x8e'),{'UserId':Number(_0x3b6a97[_0x46bc('0x3f')][_0x46bc('0x6e')]),'ChatQueueId':Number(_0x3b6a97['params']['id'])});}});}})[_0x46bc('0x1e')](respondWithStatusCode(_0x2557b2,null))[_0x46bc('0x28')](handleError(_0x2557b2,null));};exports['getAgents']=function(_0x201b94,_0x171df3,_0x48d5ba){var _0x51d7b8={};var _0x47d3b2={};var _0x1c1829;var _0x18873c;return db[_0x46bc('0x38')]['findOne']({'where':{'id':_0x201b94[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x171df3,null))[_0x46bc('0x1e')](function(_0x282473){if(_0x282473){_0x1c1829=_0x282473;_0x47d3b2[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x6f')]['rawAttributes']);_0x47d3b2[_0x46bc('0x3f')]=_[_0x46bc('0x3e')](_0x201b94[_0x46bc('0x3f')]);_0x47d3b2[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x47d3b2['model'],_0x47d3b2[_0x46bc('0x3f')]);_0x51d7b8[_0x46bc('0x42')]=_['intersection'](_0x47d3b2[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x201b94[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x51d7b8[_0x46bc('0x42')]=_0x51d7b8[_0x46bc('0x42')][_0x46bc('0x44')]?_0x51d7b8['attributes']:_0x47d3b2['model'];_0x51d7b8[_0x46bc('0x6c')]=qs['sort'](_0x201b94['query'][_0x46bc('0x47')]);_0x51d7b8['where']=qs[_0x46bc('0x40')](_[_0x46bc('0x49')](_0x201b94[_0x46bc('0x3f')],_0x47d3b2[_0x46bc('0x40')]));if(_0x201b94[_0x46bc('0x3f')][_0x46bc('0x4a')]){_0x51d7b8[_0x46bc('0x48')]=_['merge'](_0x51d7b8[_0x46bc('0x48')],{'$or':_[_0x46bc('0x4c')](_0x51d7b8[_0x46bc('0x42')],function(_0x459503){var _0x1be19f={};_0x1be19f[_0x459503]={'$like':'%'+_0x201b94[_0x46bc('0x3f')]['filter']+'%'};return _0x1be19f;})});}_0x51d7b8=_[_0x46bc('0x4b')]({},_0x51d7b8,_0x201b94['options']);return _0x1c1829[_0x46bc('0x92')](_0x51d7b8);}})[_0x46bc('0x1e')](function(_0x21729c){if(_0x21729c){_0x18873c=_0x21729c['length'];if(!_0x201b94[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x51d7b8[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x201b94[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x51d7b8[_0x46bc('0x2e')]=qs[_0x46bc('0x2e')](_0x201b94[_0x46bc('0x3f')]['offset']);}return _0x1c1829[_0x46bc('0x92')](_0x51d7b8);}})[_0x46bc('0x1e')](function(_0x123852){if(_0x123852){return _0x123852?{'count':_0x18873c,'rows':_0x123852}:null;}})[_0x46bc('0x1e')](respondWithResult(_0x171df3,null))['catch'](handleError(_0x171df3,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a8814e1..dd8bb01 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 _0xf969=['hasOwnProperty','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xf969,0x13a));var _0x9f96=function(_0x247a55,_0x2771ea){_0x247a55=_0x247a55-0x0;var _0x13c467=_0xf969[_0x247a55];return _0x13c467;};'use strict';var EventEmitter=require(_0x9f96('0x0'));var ChatQueue=require(_0x9f96('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f96('0x2'),'afterUpdate':_0x9f96('0x3'),'afterDestroy':_0x9f96('0x4')};function emitEvent(_0x24907f){return function(_0x17726e,_0x2ca4c2,_0x4fcda8){ChatQueueEvents[_0x9f96('0x5')](_0x24907f+':'+_0x17726e['id'],_0x17726e);ChatQueueEvents[_0x9f96('0x5')](_0x24907f,_0x17726e);_0x4fcda8(null);};}for(var e in events){if(events[_0x9f96('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9f96('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x4134=['exports','events','ChatQueue','setMaxListeners'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4134,0x89));var _0x4413=function(_0x12c65a,_0x3ba5ac){_0x12c65a=_0x12c65a-0x0;var _0x262a77=_0x4134[_0x12c65a];return _0x262a77;};'use strict';var EventEmitter=require(_0x4413('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4413('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4413('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x30e001){return function(_0x373dc7,_0x5d7f2c,_0x39856d){ChatQueueEvents['emit'](_0x30e001+':'+_0x373dc7['id'],_0x373dc7);ChatQueueEvents['emit'](_0x30e001,_0x373dc7);_0x39856d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4413('0x3')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cec00b3..615f7e1 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 _0x0f62=['lodash','../../config/logger','api','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x3fdf41,_0xcf9406){var _0x5bdd1b=function(_0x1bd676){while(--_0x1bd676){_0x3fdf41['push'](_0x3fdf41['shift']());}};_0x5bdd1b(++_0xcf9406);}(_0x0f62,0x160));var _0x20f6=function(_0x2341bf,_0x14617e){_0x2341bf=_0x2341bf-0x0;var _0x281a88=_0x0f62[_0x2341bf];return _0x281a88;};'use strict';var _=require(_0x20f6('0x0'));var util=require('util');var logger=require(_0x20f6('0x1'))(_0x20f6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x20f6('0x3'));var fs=require('fs');var path=require(_0x20f6('0x4'));var rimraf=require(_0x20f6('0x5'));var config=require('../../config/environment');var attributes=require(_0x20f6('0x6'));module[_0x20f6('0x7')]=function(_0x21dbc9,_0x1ad7dc){return _0x21dbc9[_0x20f6('0x8')](_0x20f6('0x9'),attributes,{'tableName':_0x20f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6093=['path','rimraf','../../config/environment','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x15891b,_0xb8c1ee){var _0x3c16ce=function(_0x230da0){while(--_0x230da0){_0x15891b['push'](_0x15891b['shift']());}};_0x3c16ce(++_0xb8c1ee);}(_0x6093,0x66));var _0x3609=function(_0x54aa73,_0x1a53a5){_0x54aa73=_0x54aa73-0x0;var _0x12e83d=_0x6093[_0x54aa73];return _0x12e83d;};'use strict';var _=require(_0x3609('0x0'));var util=require(_0x3609('0x1'));var logger=require(_0x3609('0x2'))(_0x3609('0x3'));var moment=require(_0x3609('0x4'));var BPromise=require('bluebird');var rp=require(_0x3609('0x5'));var fs=require('fs');var path=require(_0x3609('0x6'));var rimraf=require(_0x3609('0x7'));var config=require(_0x3609('0x8'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x2711f3,_0x48bd21){return _0x2711f3[_0x3609('0x9')](_0x3609('0xa'),attributes,{'tableName':_0x3609('0xb'),'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 8ea539a..664c017 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 _0xd5fc=['./chatQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','ChatQueue','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter'];(function(_0x2b2df7,_0x561392){var _0x2a3fc3=function(_0x4412cb){while(--_0x4412cb){_0x2b2df7['push'](_0x2b2df7['shift']());}};_0x2a3fc3(++_0x561392);}(_0xd5fc,0xae));var _0xcd5f=function(_0x1d11cd,_0x30651b){_0x1d11cd=_0x1d11cd-0x0;var _0x1aea94=_0xd5fc[_0x1d11cd];return _0x1aea94;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});config[_0xcd5f('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcd5f('0xa'))(new Redis(config['redis']));require(_0xcd5f('0xb'))[_0xcd5f('0xc')](socket);function respondWithRpcPromise(_0x5e5019,_0x11a3b4,_0x56f77c){return new BPromise(function(_0x112554,_0x515ed4){return client[_0xcd5f('0xd')](_0x5e5019,_0x56f77c)[_0xcd5f('0xe')](function(_0x45f43f){logger[_0xcd5f('0xf')]('ChatQueue,\x20%s,\x20%s',_0x11a3b4,_0xcd5f('0x10'));logger[_0xcd5f('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x11a3b4,_0xcd5f('0x10'),JSON[_0xcd5f('0x12')](_0x45f43f));if(_0x45f43f[_0xcd5f('0x13')]){if(_0x45f43f[_0xcd5f('0x13')][_0xcd5f('0x14')]===0x1f4){logger['error'](_0xcd5f('0x15'),_0x11a3b4,_0x45f43f[_0xcd5f('0x13')][_0xcd5f('0x16')]);return _0x515ed4(_0x45f43f[_0xcd5f('0x13')][_0xcd5f('0x16')]);}logger[_0xcd5f('0x13')](_0xcd5f('0x15'),_0x11a3b4,_0x45f43f['error'][_0xcd5f('0x16')]);return _0x112554(_0x45f43f[_0xcd5f('0x13')][_0xcd5f('0x16')]);}else{logger[_0xcd5f('0xf')]('ChatQueue,\x20%s,\x20%s',_0x11a3b4,_0xcd5f('0x10'));_0x112554(_0x45f43f['result'][_0xcd5f('0x16')]);}})[_0xcd5f('0x17')](function(_0x48d5bb){logger[_0xcd5f('0x13')](_0xcd5f('0x15'),_0x11a3b4,_0x48d5bb);_0x515ed4(_0x48d5bb);});});}exports['GetChatQueue']=function(_0x3a952b){var _0x48c664=this;return new Promise(function(_0x404488,_0x5c3c9f){return db['ChatQueue'][_0xcd5f('0x18')]({'raw':_0x3a952b['options']?_0x3a952b['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a952b[_0xcd5f('0x19')]?_0x3a952b['options'][_0xcd5f('0x1a')]||null:null,'attributes':_0x3a952b[_0xcd5f('0x19')]?_0x3a952b[_0xcd5f('0x19')][_0xcd5f('0x1b')]||null:null,'limit':_0x3a952b[_0xcd5f('0x19')]?_0x3a952b['options'][_0xcd5f('0x1c')]||null:null,'include':_0x3a952b[_0xcd5f('0x19')]?_0x3a952b[_0xcd5f('0x19')][_0xcd5f('0x1d')]?_[_0xcd5f('0x1e')](_0x3a952b[_0xcd5f('0x19')][_0xcd5f('0x1d')],function(_0x97fff9){return{'model':db[_0x97fff9[_0xcd5f('0x1f')]],'as':_0x97fff9['as'],'attributes':_0x97fff9[_0xcd5f('0x1b')],'include':_0x97fff9[_0xcd5f('0x1d')]?_[_0xcd5f('0x1e')](_0x97fff9[_0xcd5f('0x1d')],function(_0x36d100){return{'model':db[_0x36d100[_0xcd5f('0x1f')]],'as':_0x36d100['as'],'attributes':_0x36d100[_0xcd5f('0x1b')],'include':_0x36d100[_0xcd5f('0x1d')]?_['map'](_0x36d100[_0xcd5f('0x1d')],function(_0x3ae2f1){return{'model':db[_0x3ae2f1['model']],'as':_0x3ae2f1['as'],'attributes':_0x3ae2f1[_0xcd5f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bc913){logger[_0xcd5f('0xf')](_0xcd5f('0x20'),_0x3a952b);logger[_0xcd5f('0x11')](_0xcd5f('0x20'),_0x3a952b,JSON[_0xcd5f('0x12')](_0x3bc913));_0x404488(_0x3bc913);})['catch'](function(_0x5955bb){logger[_0xcd5f('0x13')](_0xcd5f('0x20'),_0x5955bb[_0xcd5f('0x16')],_0x3a952b);_0x5c3c9f(_0x48c664[_0xcd5f('0x13')](0x1f4,_0x5955bb[_0xcd5f('0x16')]));});});};exports[_0xcd5f('0x21')]=function(_0xca874f){var _0x4b0eb8=this;return new Promise(function(_0x4237db,_0x28f65a){return db[_0xcd5f('0x22')][_0xcd5f('0x23')]({'raw':_0xca874f['options']?_0xca874f[_0xcd5f('0x19')][_0xcd5f('0x24')]===undefined?!![]:![]:!![],'where':_0xca874f[_0xcd5f('0x19')]?_0xca874f['options'][_0xcd5f('0x1a')]||null:null,'attributes':_0xca874f[_0xcd5f('0x19')]?_0xca874f[_0xcd5f('0x19')][_0xcd5f('0x1b')]||null:null,'include':_0xca874f[_0xcd5f('0x19')]?_0xca874f[_0xcd5f('0x19')][_0xcd5f('0x1d')]?_[_0xcd5f('0x1e')](_0xca874f['options']['include'],function(_0x440706){return{'model':db[_0x440706['model']],'as':_0x440706['as'],'attributes':_0x440706[_0xcd5f('0x1b')],'include':_0x440706[_0xcd5f('0x1d')]?_[_0xcd5f('0x1e')](_0x440706['include'],function(_0x354205){return{'model':db[_0x354205[_0xcd5f('0x1f')]],'as':_0x354205['as'],'attributes':_0x354205[_0xcd5f('0x1b')],'include':_0x354205[_0xcd5f('0x1d')]?_['map'](_0x354205[_0xcd5f('0x1d')],function(_0x505dfa){return{'model':db[_0x505dfa[_0xcd5f('0x1f')]],'as':_0x505dfa['as'],'attributes':_0x505dfa[_0xcd5f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcd5f('0xe')](function(_0x301a83){logger[_0xcd5f('0xf')](_0xcd5f('0x21'),_0xca874f);logger['debug'](_0xcd5f('0x21'),_0xca874f,JSON['stringify'](_0x301a83));_0x4237db(_0x301a83);})[_0xcd5f('0x17')](function(_0x6b5174){logger[_0xcd5f('0x13')]('ShowChatQueue',_0x6b5174[_0xcd5f('0x16')],_0xca874f);_0x28f65a(_0x4b0eb8[_0xcd5f('0x13')](0x1f4,_0x6b5174[_0xcd5f('0x16')]));});});}; \ No newline at end of file +var _0x3746=['catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x5318fc,_0x22b166){var _0x5537d6=function(_0x3e9e8a){while(--_0x3e9e8a){_0x5318fc['push'](_0x5318fc['shift']());}};_0x5537d6(++_0x22b166);}(_0x3746,0xa9));var _0x6374=function(_0x28076e,_0x3c2b2c){_0x28076e=_0x28076e-0x0;var _0x53eb69=_0x3746[_0x28076e];return _0x53eb69;};'use strict';var _=require(_0x6374('0x0'));var util=require(_0x6374('0x1'));var moment=require('moment');var BPromise=require(_0x6374('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6374('0x3'));var db=require(_0x6374('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6374('0x5'));var config=require(_0x6374('0x6'));var jayson=require(_0x6374('0x7'));var client=jayson[_0x6374('0x8')][_0x6374('0x9')]({'port':0x232a});config[_0x6374('0xa')]=_[_0x6374('0xb')](config[_0x6374('0xa')],{'host':_0x6374('0xc'),'port':0x18eb});var socket=require(_0x6374('0xd'))(new Redis(config['redis']));require(_0x6374('0xe'))['register'](socket);function respondWithRpcPromise(_0x323af1,_0x32b4d3,_0x1acacf){return new BPromise(function(_0x585eed,_0x154b00){return client[_0x6374('0xf')](_0x323af1,_0x1acacf)[_0x6374('0x10')](function(_0x4f0189){logger[_0x6374('0x11')](_0x6374('0x12'),_0x32b4d3,'request\x20sent');logger[_0x6374('0x13')](_0x6374('0x14'),_0x32b4d3,_0x6374('0x15'),JSON['stringify'](_0x4f0189));if(_0x4f0189[_0x6374('0x16')]){if(_0x4f0189[_0x6374('0x16')][_0x6374('0x17')]===0x1f4){logger['error'](_0x6374('0x12'),_0x32b4d3,_0x4f0189['error']['message']);return _0x154b00(_0x4f0189[_0x6374('0x16')]['message']);}logger[_0x6374('0x16')](_0x6374('0x12'),_0x32b4d3,_0x4f0189[_0x6374('0x16')][_0x6374('0x18')]);return _0x585eed(_0x4f0189[_0x6374('0x16')][_0x6374('0x18')]);}else{logger[_0x6374('0x11')](_0x6374('0x12'),_0x32b4d3,_0x6374('0x15'));_0x585eed(_0x4f0189[_0x6374('0x19')][_0x6374('0x18')]);}})[_0x6374('0x1a')](function(_0x4f8db8){logger[_0x6374('0x16')](_0x6374('0x12'),_0x32b4d3,_0x4f8db8);_0x154b00(_0x4f8db8);});});}exports[_0x6374('0x1b')]=function(_0x46fdc2){var _0x3b8ed2=this;return new Promise(function(_0x3ec117,_0x101d49){return db['ChatQueue']['findAll']({'raw':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2['options'][_0x6374('0x1d')]===undefined?!![]:![]:!![],'where':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x1e')]||null:null,'attributes':_0x46fdc2['options']?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x1f')]||null:null,'limit':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x20')]||null:null,'include':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x21')]?_['map'](_0x46fdc2[_0x6374('0x1c')][_0x6374('0x21')],function(_0x1b8f18){return{'model':db[_0x1b8f18['model']],'as':_0x1b8f18['as'],'attributes':_0x1b8f18[_0x6374('0x1f')],'include':_0x1b8f18['include']?_[_0x6374('0x22')](_0x1b8f18[_0x6374('0x21')],function(_0x8d5419){return{'model':db[_0x8d5419[_0x6374('0x23')]],'as':_0x8d5419['as'],'attributes':_0x8d5419[_0x6374('0x1f')],'include':_0x8d5419[_0x6374('0x21')]?_[_0x6374('0x22')](_0x8d5419[_0x6374('0x21')],function(_0x2f1f06){return{'model':db[_0x2f1f06['model']],'as':_0x2f1f06['as'],'attributes':_0x2f1f06[_0x6374('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6374('0x10')](function(_0x11ae6d){logger['info'](_0x6374('0x1b'),_0x46fdc2);logger[_0x6374('0x13')]('GetChatQueue',_0x46fdc2,JSON[_0x6374('0x24')](_0x11ae6d));_0x3ec117(_0x11ae6d);})['catch'](function(_0x4b7038){logger['error']('GetChatQueue',_0x4b7038['message'],_0x46fdc2);_0x101d49(_0x3b8ed2[_0x6374('0x16')](0x1f4,_0x4b7038['message']));});});};exports['ShowChatQueue']=function(_0x3e7278){var _0x413043=this;return new Promise(function(_0x3e5a5a,_0x37906f){return db['ChatQueue'][_0x6374('0x25')]({'raw':_0x3e7278['options']?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e7278[_0x6374('0x1c')]?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1e')]||null:null,'attributes':_0x3e7278[_0x6374('0x1c')]?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1f')]||null:null,'include':_0x3e7278[_0x6374('0x1c')]?_0x3e7278['options'][_0x6374('0x21')]?_[_0x6374('0x22')](_0x3e7278['options'][_0x6374('0x21')],function(_0x253bb1){return{'model':db[_0x253bb1[_0x6374('0x23')]],'as':_0x253bb1['as'],'attributes':_0x253bb1[_0x6374('0x1f')],'include':_0x253bb1[_0x6374('0x21')]?_[_0x6374('0x22')](_0x253bb1['include'],function(_0x38b7f6){return{'model':db[_0x38b7f6[_0x6374('0x23')]],'as':_0x38b7f6['as'],'attributes':_0x38b7f6[_0x6374('0x1f')],'include':_0x38b7f6[_0x6374('0x21')]?_[_0x6374('0x22')](_0x38b7f6[_0x6374('0x21')],function(_0x3f309a){return{'model':db[_0x3f309a['model']],'as':_0x3f309a['as'],'attributes':_0x3f309a[_0x6374('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6374('0x10')](function(_0x18206e){logger['info'](_0x6374('0x26'),_0x3e7278);logger[_0x6374('0x13')]('ShowChatQueue',_0x3e7278,JSON[_0x6374('0x24')](_0x18206e));_0x3e5a5a(_0x18206e);})[_0x6374('0x1a')](function(_0x2d0100){logger[_0x6374('0x16')](_0x6374('0x26'),_0x2d0100['message'],_0x3e7278);_0x37906f(_0x413043[_0x6374('0x16')](0x1f4,_0x2d0100[_0x6374('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 101d520..2de3ba7 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 _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xed1f[_0x8a969d];return _0x1d8dc7;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}}; \ No newline at end of file +var _0x1cc7=['remove','emit','length','chatQueue:','./chatQueue.events','save'];(function(_0xf6b6f7,_0x4a24e3){var _0x357b1a=function(_0x33c32d){while(--_0x33c32d){_0xf6b6f7['push'](_0xf6b6f7['shift']());}};_0x357b1a(++_0x4a24e3);}(_0x1cc7,0x15a));var _0x71cc=function(_0x1c6118,_0x225e9a){_0x1c6118=_0x1c6118-0x0;var _0x5da93e=_0x1cc7[_0x1c6118];return _0x5da93e;};'use strict';var ChatQueueEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){ChatQueueEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);ChatQueueEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 3b366c6..bf82a13 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3e74,0x175));var _0x43e7=function(_0x2ec166,_0xbd47d6){_0x2ec166=_0x2ec166-0x0;var _0x4f2428=_0x3e74[_0x2ec166];return _0x4f2428;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x496380,_0xdf128a){var _0x438e2f=function(_0x15dfb5){while(--_0x15dfb5){_0x496380['push'](_0x496380['shift']());}};_0x438e2f(++_0xdf128a);}(_0x55ca,0x126));var _0xa55c=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0x55ca[_0x22b70f];return _0x100985;};'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 fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b5b4771..a38a232 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 _0xf6d5=['STRING','DATE','moment','sequelize','exports'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xf6d5,0x179));var _0x5f6d=function(_0x3d4ee3,_0x33d474){_0x3d4ee3=_0x3d4ee3-0x0;var _0x54d966=_0xf6d5[_0x3d4ee3];return _0x54d966;};'use strict';var moment=require(_0x5f6d('0x0'));var Sequelize=require(_0x5f6d('0x1'));module[_0x5f6d('0x2')]={'uniqueid':{'type':Sequelize[_0x5f6d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5f6d('0x4')]},'leaveAt':{'type':Sequelize[_0x5f6d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5f6d('0x4')]},'reason':{'type':Sequelize[_0x5f6d('0x3')]}}; \ No newline at end of file +var _0x4c9e=['DATE','sequelize','exports','STRING'];(function(_0x2d8864,_0x34171a){var _0x435a6a=function(_0x3deecd){while(--_0x3deecd){_0x2d8864['push'](_0x2d8864['shift']());}};_0x435a6a(++_0x34171a);}(_0x4c9e,0x145));var _0xe4c9=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x4c9e[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require('moment');var Sequelize=require(_0xe4c9('0x0'));module[_0xe4c9('0x1')]={'uniqueid':{'type':Sequelize[_0xe4c9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe4c9('0x2')]},'joinAt':{'type':Sequelize[_0xe4c9('0x3')]},'leaveAt':{'type':Sequelize[_0xe4c9('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe4c9('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e2aae70..6b160e1 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 _0xa498=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge'];(function(_0x188faa,_0x4b2e6b){var _0x5615d0=function(_0x13ea35){while(--_0x13ea35){_0x188faa['push'](_0x188faa['shift']());}};_0x5615d0(++_0x4b2e6b);}(_0xa498,0x1d6));var _0x8a49=function(_0x1c1820,_0x18bb79){_0x1c1820=_0x1c1820-0x0;var _0x6690e6=_0xa498[_0x1c1820];return _0x6690e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a49('0x0'));var zipdir=require(_0x8a49('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a49('0x2'));var BPromise=require(_0x8a49('0x3'));var Mustache=require(_0x8a49('0x4'));var util=require(_0x8a49('0x5'));var path=require(_0x8a49('0x6'));var sox=require('sox');var csv=require(_0x8a49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a49('0x8'));var _=require(_0x8a49('0x9'));var squel=require(_0x8a49('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a49('0xb'));var deskjs=require(_0x8a49('0xc'));var toCsv=require(_0x8a49('0x7'));var querystring=require(_0x8a49('0xd'));var Papa=require(_0x8a49('0xe'));var Redis=require(_0x8a49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x10'));var as=require(_0x8a49('0x11'));var hardwareService=require(_0x8a49('0x12'));var logger=require(_0x8a49('0x13'))(_0x8a49('0x14'));var utils=require(_0x8a49('0x15'));var config=require(_0x8a49('0x16'));var licenseUtil=require(_0x8a49('0x17'));var db=require(_0x8a49('0x18'))['db'];function respondWithStatusCode(_0x5b8111,_0x352528){_0x352528=_0x352528||0xcc;return function(_0x6ee27b){if(_0x6ee27b){return _0x5b8111[_0x8a49('0x19')](_0x352528);}return _0x5b8111['status'](_0x352528)[_0x8a49('0x1a')]();};}function respondWithResult(_0x57b350,_0x4454de){_0x4454de=_0x4454de||0xc8;return function(_0x2fe212){if(_0x2fe212){return _0x57b350['status'](_0x4454de)[_0x8a49('0x1b')](_0x2fe212);}};}function respondWithFilteredResult(_0x902ee2,_0x329a7b){return function(_0x4760d7){if(_0x4760d7){var _0x5275aa=typeof _0x329a7b['offset']===_0x8a49('0x1c')&&typeof _0x329a7b[_0x8a49('0x1d')]===_0x8a49('0x1c');var _0x2d0261=_0x4760d7['count'];var _0x47604e=_0x5275aa?0x0:_0x329a7b[_0x8a49('0x1e')];var _0x47328a=_0x5275aa?_0x4760d7[_0x8a49('0x1f')]:_0x329a7b[_0x8a49('0x1e')]+_0x329a7b['limit'];var _0x5ac3ca;if(_0x47328a>=_0x2d0261){_0x47328a=_0x2d0261;_0x5ac3ca=0xc8;}else{_0x5ac3ca=0xce;}_0x902ee2[_0x8a49('0x20')](_0x5ac3ca);return _0x902ee2[_0x8a49('0x21')](_0x8a49('0x22'),_0x47604e+'-'+_0x47328a+'/'+_0x2d0261)['json'](_0x4760d7);}return null;};}function patchUpdates(_0x2baa30){return function(_0x2e45fc){try{jsonpatch[_0x8a49('0x23')](_0x2e45fc,_0x2baa30,!![]);}catch(_0x21f407){return BPromise[_0x8a49('0x24')](_0x21f407);}return _0x2e45fc[_0x8a49('0x25')]();};}function saveUpdates(_0x16072f,_0x4bc3bc){return function(_0x304372){if(_0x304372){return _0x304372[_0x8a49('0x26')](_0x16072f)['then'](function(_0x3b6220){return _0x3b6220;});}return null;};}function removeEntity(_0x479bca,_0x41bee7){return function(_0x52811c){if(_0x52811c){return _0x52811c[_0x8a49('0x27')]()[_0x8a49('0x28')](function(){_0x479bca[_0x8a49('0x20')](0xcc)[_0x8a49('0x1a')]();});}};}function handleEntityNotFound(_0xe2ca8b,_0x2b5d8b){return function(_0x1b0a01){if(!_0x1b0a01){_0xe2ca8b['sendStatus'](0x194);}return _0x1b0a01;};}function handleError(_0x2fc60e,_0x4d72a3){_0x4d72a3=_0x4d72a3||0x1f4;return function(_0x29af9f){logger['error'](_0x29af9f[_0x8a49('0x29')]);if(_0x29af9f[_0x8a49('0x2a')]){delete _0x29af9f['name'];}_0x2fc60e['status'](_0x4d72a3)[_0x8a49('0x2b')](_0x29af9f);};}exports[_0x8a49('0x2c')]=function(_0x387b06,_0x30fffd){var _0x484a57={},_0x29de89={},_0xef6542={'count':0x0,'rows':[]};var _0x33d7c6=_[_0x8a49('0x2d')](db[_0x8a49('0x2e')]['rawAttributes'],function(_0x223ed9){return{'name':_0x223ed9[_0x8a49('0x2f')],'type':_0x223ed9[_0x8a49('0x30')][_0x8a49('0x31')]};});_0x29de89[_0x8a49('0x32')]=_[_0x8a49('0x2d')](_0x33d7c6,_0x8a49('0x2a'));_0x29de89['query']=_['keys'](_0x387b06[_0x8a49('0x33')]);_0x29de89[_0x8a49('0x34')]=_[_0x8a49('0x35')](_0x29de89[_0x8a49('0x32')],_0x29de89['query']);_0x484a57[_0x8a49('0x36')]=_[_0x8a49('0x35')](_0x29de89['model'],qs[_0x8a49('0x37')](_0x387b06['query'][_0x8a49('0x37')]));_0x484a57[_0x8a49('0x36')]=_0x484a57[_0x8a49('0x36')][_0x8a49('0x38')]?_0x484a57['attributes']:_0x29de89[_0x8a49('0x32')];if(!_0x387b06[_0x8a49('0x33')][_0x8a49('0x39')]('nolimit')){_0x484a57[_0x8a49('0x1d')]=qs['limit'](_0x387b06['query'][_0x8a49('0x1d')]);_0x484a57[_0x8a49('0x1e')]=qs[_0x8a49('0x1e')](_0x387b06[_0x8a49('0x33')]['offset']);}_0x484a57['order']=qs[_0x8a49('0x3a')](_0x387b06[_0x8a49('0x33')][_0x8a49('0x3a')]);_0x484a57[_0x8a49('0x3b')]=qs['filters'](_[_0x8a49('0x3c')](_0x387b06[_0x8a49('0x33')],_0x29de89[_0x8a49('0x34')]),_0x33d7c6);if(_0x387b06['query']['filter']){_0x484a57[_0x8a49('0x3b')]=_[_0x8a49('0x3d')](_0x484a57[_0x8a49('0x3b')],{'$or':_['map'](_0x33d7c6,function(_0x158d8c){if(_0x158d8c[_0x8a49('0x30')]!==_0x8a49('0x3e')){var _0x7b71bb={};_0x7b71bb[_0x158d8c[_0x8a49('0x2a')]]={'$like':'%'+_0x387b06[_0x8a49('0x33')]['filter']+'%'};return _0x7b71bb;}})});}_0x484a57=_[_0x8a49('0x3d')]({},_0x484a57,_0x387b06[_0x8a49('0x3f')]);var _0x309482={'where':_0x484a57[_0x8a49('0x3b')]};return db[_0x8a49('0x2e')][_0x8a49('0x1f')](_0x309482)['then'](function(_0x2c9838){_0xef6542[_0x8a49('0x1f')]=_0x2c9838;if(_0x387b06[_0x8a49('0x33')][_0x8a49('0x40')]){_0x484a57[_0x8a49('0x41')]=[{'all':!![]}];}return db[_0x8a49('0x2e')][_0x8a49('0x42')](_0x484a57);})[_0x8a49('0x28')](function(_0x41b6c2){_0xef6542[_0x8a49('0x43')]=_0x41b6c2;return _0xef6542;})[_0x8a49('0x28')](respondWithFilteredResult(_0x30fffd,_0x484a57))['catch'](handleError(_0x30fffd,null));};exports[_0x8a49('0x44')]=function(_0x1b4b6d,_0x2938a8){var _0x4aac2b={'raw':!![],'where':{'id':_0x1b4b6d[_0x8a49('0x45')]['id']}},_0x411c9d={};_0x411c9d[_0x8a49('0x32')]=_[_0x8a49('0x46')](db[_0x8a49('0x2e')]['rawAttributes']);_0x411c9d[_0x8a49('0x33')]=_[_0x8a49('0x46')](_0x1b4b6d['query']);_0x411c9d[_0x8a49('0x34')]=_['intersection'](_0x411c9d['model'],_0x411c9d[_0x8a49('0x33')]);_0x4aac2b['attributes']=_[_0x8a49('0x35')](_0x411c9d[_0x8a49('0x32')],qs[_0x8a49('0x37')](_0x1b4b6d[_0x8a49('0x33')]['fields']));_0x4aac2b[_0x8a49('0x36')]=_0x4aac2b[_0x8a49('0x36')][_0x8a49('0x38')]?_0x4aac2b[_0x8a49('0x36')]:_0x411c9d[_0x8a49('0x32')];if(_0x1b4b6d[_0x8a49('0x33')][_0x8a49('0x40')]){_0x4aac2b['include']=[{'all':!![]}];}_0x4aac2b=_['merge']({},_0x4aac2b,_0x1b4b6d[_0x8a49('0x3f')]);return db[_0x8a49('0x2e')][_0x8a49('0x47')](_0x4aac2b)[_0x8a49('0x28')](handleEntityNotFound(_0x2938a8,null))[_0x8a49('0x28')](respondWithResult(_0x2938a8,null))[_0x8a49('0x48')](handleError(_0x2938a8,null));};exports[_0x8a49('0x49')]=function(_0x33ec7a,_0x5a428a){return db[_0x8a49('0x2e')][_0x8a49('0x49')](_0x33ec7a[_0x8a49('0x4a')],{})[_0x8a49('0x28')](respondWithResult(_0x5a428a,0xc9))[_0x8a49('0x48')](handleError(_0x5a428a,null));};exports[_0x8a49('0x26')]=function(_0x3d8fcc,_0xe3e213){if(_0x3d8fcc[_0x8a49('0x4a')]['id']){delete _0x3d8fcc[_0x8a49('0x4a')]['id'];}return db[_0x8a49('0x2e')]['find']({'where':{'id':_0x3d8fcc['params']['id']}})[_0x8a49('0x28')](handleEntityNotFound(_0xe3e213,null))[_0x8a49('0x28')](saveUpdates(_0x3d8fcc[_0x8a49('0x4a')],null))[_0x8a49('0x28')](respondWithResult(_0xe3e213,null))[_0x8a49('0x48')](handleError(_0xe3e213,null));};exports[_0x8a49('0x27')]=function(_0x3e066e,_0x4d9306){return db['ChatQueueReport']['find']({'where':{'id':_0x3e066e[_0x8a49('0x45')]['id']}})[_0x8a49('0x28')](handleEntityNotFound(_0x4d9306,null))[_0x8a49('0x28')](removeEntity(_0x4d9306,null))['catch'](handleError(_0x4d9306,null));};exports[_0x8a49('0x4b')]=function(_0x1debb8,_0x3746ff){return db[_0x8a49('0x2e')][_0x8a49('0x4b')]()[_0x8a49('0x28')](respondWithResult(_0x3746ff,null))[_0x8a49('0x48')](handleError(_0x3746ff,null));}; \ No newline at end of file +var _0xe451=['count','update','then','destroy','sendStatus','error','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit'];(function(_0x5c7621,_0x2e4e44){var _0x3406c1=function(_0x39cd44){while(--_0x39cd44){_0x5c7621['push'](_0x5c7621['shift']());}};_0x3406c1(++_0x2e4e44);}(_0xe451,0xec));var _0x1e45=function(_0x3f5172,_0x5c6313){_0x3f5172=_0x3f5172-0x0;var _0xa29e3b=_0xe451[_0x3f5172];return _0xa29e3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e45('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e45('0x1'));var Mustache=require(_0x1e45('0x2'));var util=require(_0x1e45('0x3'));var path=require(_0x1e45('0x4'));var sox=require('sox');var csv=require(_0x1e45('0x5'));var ejs=require(_0x1e45('0x6'));var fs=require('fs');var fs_extra=require(_0x1e45('0x7'));var _=require('lodash');var squel=require(_0x1e45('0x8'));var crypto=require(_0x1e45('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1e45('0x5'));var querystring=require(_0x1e45('0xa'));var Papa=require(_0x1e45('0xb'));var Redis=require('ioredis');var authService=require(_0x1e45('0xc'));var qs=require(_0x1e45('0xd'));var as=require(_0x1e45('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1e45('0xf'));var utils=require(_0x1e45('0x10'));var config=require(_0x1e45('0x11'));var licenseUtil=require(_0x1e45('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16cafc,_0x2ec564){_0x2ec564=_0x2ec564||0xcc;return function(_0x3d25a8){if(_0x3d25a8){return _0x16cafc['sendStatus'](_0x2ec564);}return _0x16cafc[_0x1e45('0x13')](_0x2ec564)[_0x1e45('0x14')]();};}function respondWithResult(_0x31215a,_0x21f68d){_0x21f68d=_0x21f68d||0xc8;return function(_0x5b3ee1){if(_0x5b3ee1){return _0x31215a[_0x1e45('0x13')](_0x21f68d)['json'](_0x5b3ee1);}};}function respondWithFilteredResult(_0xf66042,_0x2c7ace){return function(_0x4e1400){if(_0x4e1400){var _0xfdeae3=typeof _0x2c7ace[_0x1e45('0x15')]===_0x1e45('0x16')&&typeof _0x2c7ace[_0x1e45('0x17')]===_0x1e45('0x16');var _0x308c29=_0x4e1400[_0x1e45('0x18')];var _0x2a6f47=_0xfdeae3?0x0:_0x2c7ace[_0x1e45('0x15')];var _0x5d24a7=_0xfdeae3?_0x4e1400[_0x1e45('0x18')]:_0x2c7ace['offset']+_0x2c7ace['limit'];var _0x17c63a;if(_0x5d24a7>=_0x308c29){_0x5d24a7=_0x308c29;_0x17c63a=0xc8;}else{_0x17c63a=0xce;}_0xf66042['status'](_0x17c63a);return _0xf66042['set']('Content-Range',_0x2a6f47+'-'+_0x5d24a7+'/'+_0x308c29)['json'](_0x4e1400);}return null;};}function patchUpdates(_0x207335){return function(_0x4476eb){try{jsonpatch['apply'](_0x4476eb,_0x207335,!![]);}catch(_0xc0deec){return BPromise['reject'](_0xc0deec);}return _0x4476eb['save']();};}function saveUpdates(_0x41cfae,_0x59aaa7){return function(_0x4ffe97){if(_0x4ffe97){return _0x4ffe97[_0x1e45('0x19')](_0x41cfae)[_0x1e45('0x1a')](function(_0x4ce4c5){return _0x4ce4c5;});}return null;};}function removeEntity(_0x48209a,_0x2fb478){return function(_0x40c216){if(_0x40c216){return _0x40c216[_0x1e45('0x1b')]()[_0x1e45('0x1a')](function(){_0x48209a[_0x1e45('0x13')](0xcc)[_0x1e45('0x14')]();});}};}function handleEntityNotFound(_0x55e968,_0x3f6771){return function(_0x394f7e){if(!_0x394f7e){_0x55e968[_0x1e45('0x1c')](0x194);}return _0x394f7e;};}function handleError(_0x25b131,_0x1a8355){_0x1a8355=_0x1a8355||0x1f4;return function(_0xfd7633){logger[_0x1e45('0x1d')](_0xfd7633['stack']);if(_0xfd7633[_0x1e45('0x1e')]){delete _0xfd7633[_0x1e45('0x1e')];}_0x25b131[_0x1e45('0x13')](_0x1a8355)[_0x1e45('0x1f')](_0xfd7633);};}exports['index']=function(_0xe7cdcf,_0x34046e){var _0x3dd6c3={},_0x5229e7={},_0x3def67={'count':0x0,'rows':[]};var _0x4a04aa=_[_0x1e45('0x20')](db['ChatQueueReport']['rawAttributes'],function(_0x34d75e){return{'name':_0x34d75e[_0x1e45('0x21')],'type':_0x34d75e[_0x1e45('0x22')][_0x1e45('0x23')]};});_0x5229e7['model']=_[_0x1e45('0x20')](_0x4a04aa,'name');_0x5229e7[_0x1e45('0x24')]=_[_0x1e45('0x25')](_0xe7cdcf[_0x1e45('0x24')]);_0x5229e7['filters']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],_0x5229e7[_0x1e45('0x24')]);_0x3dd6c3['attributes']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],qs[_0x1e45('0x28')](_0xe7cdcf[_0x1e45('0x24')]['fields']));_0x3dd6c3[_0x1e45('0x29')]=_0x3dd6c3[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x3dd6c3[_0x1e45('0x29')]:_0x5229e7[_0x1e45('0x27')];if(!_0xe7cdcf['query']['hasOwnProperty']('nolimit')){_0x3dd6c3['limit']=qs[_0x1e45('0x17')](_0xe7cdcf['query'][_0x1e45('0x17')]);_0x3dd6c3[_0x1e45('0x15')]=qs['offset'](_0xe7cdcf['query'][_0x1e45('0x15')]);}_0x3dd6c3[_0x1e45('0x2b')]=qs[_0x1e45('0x2c')](_0xe7cdcf[_0x1e45('0x24')]['sort']);_0x3dd6c3[_0x1e45('0x2d')]=qs[_0x1e45('0x2e')](_[_0x1e45('0x2f')](_0xe7cdcf[_0x1e45('0x24')],_0x5229e7['filters']),_0x4a04aa);if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]){_0x3dd6c3[_0x1e45('0x2d')]=_['merge'](_0x3dd6c3['where'],{'$or':_[_0x1e45('0x20')](_0x4a04aa,function(_0x47c200){if(_0x47c200['type']!==_0x1e45('0x31')){var _0x587a0a={};_0x587a0a[_0x47c200['name']]={'$like':'%'+_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]+'%'};return _0x587a0a;}})});}_0x3dd6c3=_[_0x1e45('0x32')]({},_0x3dd6c3,_0xe7cdcf[_0x1e45('0x33')]);var _0x11a327={'where':_0x3dd6c3[_0x1e45('0x2d')]};return db[_0x1e45('0x34')][_0x1e45('0x18')](_0x11a327)[_0x1e45('0x1a')](function(_0x53713a){_0x3def67[_0x1e45('0x18')]=_0x53713a;if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x35')]){_0x3dd6c3[_0x1e45('0x36')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1e45('0x37')](_0x3dd6c3);})[_0x1e45('0x1a')](function(_0x2984ae){_0x3def67[_0x1e45('0x38')]=_0x2984ae;return _0x3def67;})['then'](respondWithFilteredResult(_0x34046e,_0x3dd6c3))[_0x1e45('0x39')](handleError(_0x34046e,null));};exports[_0x1e45('0x3a')]=function(_0x32a42a,_0x393a50){var _0x522b40={'raw':!![],'where':{'id':_0x32a42a[_0x1e45('0x3b')]['id']}},_0x460d38={};_0x460d38[_0x1e45('0x27')]=_[_0x1e45('0x25')](db[_0x1e45('0x34')][_0x1e45('0x3c')]);_0x460d38['query']=_[_0x1e45('0x25')](_0x32a42a['query']);_0x460d38[_0x1e45('0x2e')]=_[_0x1e45('0x26')](_0x460d38[_0x1e45('0x27')],_0x460d38[_0x1e45('0x24')]);_0x522b40[_0x1e45('0x29')]=_[_0x1e45('0x26')](_0x460d38['model'],qs[_0x1e45('0x28')](_0x32a42a[_0x1e45('0x24')][_0x1e45('0x28')]));_0x522b40['attributes']=_0x522b40[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x522b40[_0x1e45('0x29')]:_0x460d38['model'];if(_0x32a42a['query']['includeAll']){_0x522b40[_0x1e45('0x36')]=[{'all':!![]}];}_0x522b40=_[_0x1e45('0x32')]({},_0x522b40,_0x32a42a[_0x1e45('0x33')]);return db[_0x1e45('0x34')]['find'](_0x522b40)[_0x1e45('0x1a')](handleEntityNotFound(_0x393a50,null))[_0x1e45('0x1a')](respondWithResult(_0x393a50,null))[_0x1e45('0x39')](handleError(_0x393a50,null));};exports[_0x1e45('0x3d')]=function(_0x3994d8,_0x53e41b){return db[_0x1e45('0x34')][_0x1e45('0x3d')](_0x3994d8[_0x1e45('0x3e')],{})[_0x1e45('0x1a')](respondWithResult(_0x53e41b,0xc9))[_0x1e45('0x39')](handleError(_0x53e41b,null));};exports['update']=function(_0x374c32,_0x14b06f){if(_0x374c32[_0x1e45('0x3e')]['id']){delete _0x374c32[_0x1e45('0x3e')]['id'];}return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x374c32['params']['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x14b06f,null))[_0x1e45('0x1a')](saveUpdates(_0x374c32['body'],null))[_0x1e45('0x1a')](respondWithResult(_0x14b06f,null))['catch'](handleError(_0x14b06f,null));};exports[_0x1e45('0x1b')]=function(_0x3e6845,_0x5bafc7){return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x3e6845[_0x1e45('0x3b')]['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x5bafc7,null))[_0x1e45('0x1a')](removeEntity(_0x5bafc7,null))[_0x1e45('0x39')](handleError(_0x5bafc7,null));};exports[_0x1e45('0x40')]=function(_0x4cdf47,_0x2f19f3){return db[_0x1e45('0x34')]['describe']()['then'](respondWithResult(_0x2f19f3,null))[_0x1e45('0x39')](handleError(_0x2f19f3,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 08de079..66ecb89 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x13a5a8,_0x186495){var _0x397582=function(_0x33dc56){while(--_0x33dc56){_0x13a5a8['push'](_0x13a5a8['shift']());}};_0x397582(++_0x186495);}(_0xe706,0xa3));var _0x6e70=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xe706[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0xa60419,_0x7f3e3d){var _0xa7cb7d=function(_0x772759){while(--_0x772759){_0xa60419['push'](_0xa60419['shift']());}};_0xa7cb7d(++_0x7f3e3d);}(_0x757a,0xde));var _0xa757=function(_0x2efdc3,_0x276171){_0x2efdc3=_0x2efdc3-0x0;var _0x4660bc=_0x757a[_0x2efdc3];return _0x4660bc;};'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')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 54165db..974bdc5 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 _0x6528=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','body','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6528,0x160));var _0x8652=function(_0x35605c,_0x3dcf7c){_0x35605c=_0x35605c-0x0;var _0x1b98f7=_0x6528[_0x35605c];return _0x1b98f7;};'use strict';var _=require(_0x8652('0x0'));var util=require(_0x8652('0x1'));var moment=require(_0x8652('0x2'));var BPromise=require('bluebird');var rs=require(_0x8652('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8652('0x4'));var logger=require(_0x8652('0x5'))(_0x8652('0x6'));var config=require('../../config/environment');var jayson=require(_0x8652('0x7'));var client=jayson[_0x8652('0x8')][_0x8652('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41b9d0,_0x4a3479,_0xa77081){return new BPromise(function(_0x350737,_0x3c9cad){return client[_0x8652('0xa')](_0x41b9d0,_0xa77081)[_0x8652('0xb')](function(_0x528ebe){logger[_0x8652('0xc')](_0x8652('0xd'),_0x4a3479,_0x8652('0xe'));logger[_0x8652('0xf')](_0x8652('0x10'),_0x4a3479,_0x8652('0xe'),JSON[_0x8652('0x11')](_0x528ebe));if(_0x528ebe[_0x8652('0x12')]){if(_0x528ebe[_0x8652('0x12')][_0x8652('0x13')]===0x1f4){logger[_0x8652('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x4a3479,_0x528ebe[_0x8652('0x12')][_0x8652('0x14')]);return _0x3c9cad(_0x528ebe[_0x8652('0x12')][_0x8652('0x14')]);}logger['error'](_0x8652('0xd'),_0x4a3479,_0x528ebe[_0x8652('0x12')][_0x8652('0x14')]);return _0x350737(_0x528ebe['error'][_0x8652('0x14')]);}else{logger[_0x8652('0xc')](_0x8652('0xd'),_0x4a3479,_0x8652('0xe'));_0x350737(_0x528ebe[_0x8652('0x15')][_0x8652('0x14')]);}})[_0x8652('0x16')](function(_0x32c2a2){logger[_0x8652('0x12')](_0x8652('0xd'),_0x4a3479,_0x32c2a2);_0x3c9cad(_0x32c2a2);});});}exports['CreateChatQueueReport']=function(_0x3c6449){var _0xf5692e=this;return new Promise(function(_0x457b02,_0x281bd6){return db[_0x8652('0x17')][_0x8652('0x18')](_0x3c6449['body'],{'raw':_0x3c6449[_0x8652('0x19')]?_0x3c6449['options'][_0x8652('0x1a')]===undefined?!![]:![]:!![]})[_0x8652('0xb')](function(_0x287f1a){logger[_0x8652('0xc')](_0x8652('0x1b'),_0x3c6449);logger[_0x8652('0xf')]('CreateChatQueueReport',_0x3c6449,JSON['stringify'](_0x287f1a));_0x457b02(_0x287f1a);})[_0x8652('0x16')](function(_0x10a160){logger[_0x8652('0x12')](_0x8652('0x1b'),_0x10a160[_0x8652('0x14')],_0x3c6449);_0x281bd6(_0xf5692e[_0x8652('0x12')](0x1f4,_0x10a160[_0x8652('0x14')]));});});};exports[_0x8652('0x1c')]=function(_0x214d29){var _0x346ab2=this;return new Promise(function(_0x760c26,_0x70765d){return db['ChatQueueReport']['update'](_0x214d29[_0x8652('0x1d')],{'raw':_0x214d29['options']?_0x214d29[_0x8652('0x19')][_0x8652('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x214d29[_0x8652('0x19')]?_0x214d29['options']['where']||null:null,'attributes':_0x214d29[_0x8652('0x19')]?_0x214d29['options'][_0x8652('0x1e')]||null:null,'limit':_0x214d29[_0x8652('0x19')]?_0x214d29[_0x8652('0x19')][_0x8652('0x1f')]||null:null})['then'](function(_0x5c122d){logger['info'](_0x8652('0x1c'),_0x214d29);logger['debug'](_0x8652('0x1c'),_0x214d29,JSON[_0x8652('0x11')](_0x5c122d));_0x760c26(_0x5c122d);})[_0x8652('0x16')](function(_0x407113){logger['error'](_0x8652('0x1c'),_0x407113[_0x8652('0x14')],_0x214d29);_0x70765d(_0x346ab2['error'](0x1f4,_0x407113[_0x8652('0x14')]));});});}; \ No newline at end of file +var _0x5eff=['CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','catch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5eff,0xc8));var _0xf5ef=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5eff[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xf5ef('0x0'));var util=require(_0xf5ef('0x1'));var moment=require(_0xf5ef('0x2'));var BPromise=require(_0xf5ef('0x3'));var rs=require(_0xf5ef('0x4'));var fs=require('fs');var Redis=require(_0xf5ef('0x5'));var db=require(_0xf5ef('0x6'))['db'];var utils=require(_0xf5ef('0x7'));var logger=require(_0xf5ef('0x8'))(_0xf5ef('0x9'));var config=require(_0xf5ef('0xa'));var jayson=require(_0xf5ef('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39f0ad,_0x4b655a,_0x29de37){return new BPromise(function(_0x544036,_0x44aac0){return client[_0xf5ef('0xc')](_0x39f0ad,_0x29de37)[_0xf5ef('0xd')](function(_0x4a5662){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x4b655a,_0xf5ef('0xe'));logger[_0xf5ef('0xf')](_0xf5ef('0x10'),_0x4b655a,_0xf5ef('0xe'),JSON[_0xf5ef('0x11')](_0x4a5662));if(_0x4a5662[_0xf5ef('0x12')]){if(_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x13')]===0x1f4){logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x15')]);return _0x44aac0(_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x15')]);}logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x4a5662['error'][_0xf5ef('0x15')]);return _0x544036(_0x4a5662[_0xf5ef('0x12')]['message']);}else{logger[_0xf5ef('0x16')](_0xf5ef('0x14'),_0x4b655a,_0xf5ef('0xe'));_0x544036(_0x4a5662['result'][_0xf5ef('0x15')]);}})[_0xf5ef('0x17')](function(_0x22b78f){logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x22b78f);_0x44aac0(_0x22b78f);});});}exports[_0xf5ef('0x18')]=function(_0x43595b){var _0x3ad136=this;return new Promise(function(_0x46cf6d,_0x10cfe3){return db[_0xf5ef('0x19')][_0xf5ef('0x1a')](_0x43595b[_0xf5ef('0x1b')],{'raw':_0x43595b['options']?_0x43595b[_0xf5ef('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf5ef('0xd')](function(_0x48382c){logger['info'](_0xf5ef('0x18'),_0x43595b);logger['debug'](_0xf5ef('0x18'),_0x43595b,JSON[_0xf5ef('0x11')](_0x48382c));_0x46cf6d(_0x48382c);})[_0xf5ef('0x17')](function(_0x29b8ca){logger[_0xf5ef('0x12')]('CreateChatQueueReport',_0x29b8ca['message'],_0x43595b);_0x10cfe3(_0x3ad136[_0xf5ef('0x12')](0x1f4,_0x29b8ca[_0xf5ef('0x15')]));});});};exports[_0xf5ef('0x1d')]=function(_0x46b881){var _0x1ad4e2=this;return new Promise(function(_0x83cf9e,_0x200d23){return db[_0xf5ef('0x19')]['update'](_0x46b881[_0xf5ef('0x1b')],{'raw':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')][_0xf5ef('0x1e')]||null:null,'attributes':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')]['attributes']||null:null,'limit':_0x46b881[_0xf5ef('0x1c')]?_0x46b881['options'][_0xf5ef('0x1f')]||null:null})[_0xf5ef('0xd')](function(_0x355448){logger[_0xf5ef('0x16')](_0xf5ef('0x1d'),_0x46b881);logger[_0xf5ef('0xf')](_0xf5ef('0x1d'),_0x46b881,JSON[_0xf5ef('0x11')](_0x355448));_0x83cf9e(_0x355448);})[_0xf5ef('0x17')](function(_0x3a9bb4){logger[_0xf5ef('0x12')](_0xf5ef('0x1d'),_0x3a9bb4['message'],_0x46b881);_0x200d23(_0x1ad4e2[_0xf5ef('0x12')](0x1f4,_0x3a9bb4['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index a1a4d5f..127c0d8 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 _0x8276=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','update','delete','destroy','util'];(function(_0x20be8c,_0xf41964){var _0x52f3cf=function(_0x195a9f){while(--_0x195a9f){_0x20be8c['push'](_0x20be8c['shift']());}};_0x52f3cf(++_0xf41964);}(_0x8276,0x109));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x6827('0x0'));var path=require(_0x6827('0x1'));var timeout=require(_0x6827('0x2'));var express=require(_0x6827('0x3'));var router=express[_0x6827('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6827('0x5'));var config=require(_0x6827('0x6'));var controller=require(_0x6827('0x7'));router['get']('/',auth[_0x6827('0x8')](),controller[_0x6827('0x9')]);router[_0x6827('0xa')](_0x6827('0xb'),auth[_0x6827('0x8')](),controller[_0x6827('0xc')]);router[_0x6827('0xa')](_0x6827('0xd'),auth['isAuthenticated'](),controller[_0x6827('0xe')]);router['post']('/',auth[_0x6827('0x8')](),controller[_0x6827('0xf')]);router['put'](_0x6827('0xd'),auth[_0x6827('0x8')](),controller[_0x6827('0x10')]);router[_0x6827('0x11')](_0x6827('0xd'),auth[_0x6827('0x8')](),controller[_0x6827('0x12')]);module['exports']=router; \ No newline at end of file +var _0x49e6=['../../config/environment','isAuthenticated','get','/describe','/:id','create','put','update','delete','destroy','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x49e6,0xeb));var _0x649e=function(_0x4dda67,_0x5669c2){_0x4dda67=_0x4dda67-0x0;var _0x3e3fdb=_0x49e6[_0x4dda67];return _0x3e3fdb;};'use strict';var multer=require(_0x649e('0x0'));var util=require('util');var path=require(_0x649e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x649e('0x2')]();var fs_extra=require(_0x649e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x649e('0x4'));var config=require(_0x649e('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x649e('0x6')](),controller['index']);router[_0x649e('0x7')](_0x649e('0x8'),auth[_0x649e('0x6')](),controller['describe']);router[_0x649e('0x7')](_0x649e('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x649e('0x6')](),controller[_0x649e('0xa')]);router[_0x649e('0xb')](_0x649e('0x9'),auth['isAuthenticated'](),controller[_0x649e('0xc')]);router[_0x649e('0xd')](_0x649e('0x9'),auth[_0x649e('0x6')](),controller[_0x649e('0xe')]);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 52ba8bf..40f5f50 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x145100,_0xaacc8a){var _0x429ad1=function(_0x54421d){while(--_0x54421d){_0x145100['push'](_0x145100['shift']());}};_0x429ad1(++_0xaacc8a);}(_0x008c,0x188));var _0xc008=function(_0x126c0d,_0x1644a5){_0x126c0d=_0x126c0d-0x0;var _0x299c58=_0x008c[_0x126c0d];return _0x299c58;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26a28c,_0x43a785){var _0x50daed=function(_0x13fb99){while(--_0x13fb99){_0x26a28c['push'](_0x26a28c['shift']());}};_0x50daed(++_0x43a785);}(_0xedd9,0xfc));var _0x9edd=function(_0x34a403,_0x2069ae){_0x34a403=_0x34a403-0x0;var _0x4fee1a=_0xedd9[_0x34a403];return _0x4fee1a;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e214d66..c7de645 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 _0x0df1=['squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','ChatTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','length','includeAll','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0x0df1,0x86));var _0x10df=function(_0xaa98bd,_0x194eea){_0xaa98bd=_0xaa98bd-0x0;var _0x337240=_0x0df1[_0xaa98bd];return _0x337240;};'use strict';var emlformat=require(_0x10df('0x0'));var rimraf=require(_0x10df('0x1'));var zipdir=require(_0x10df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10df('0x3'));var moment=require('moment');var BPromise=require(_0x10df('0x4'));var Mustache=require(_0x10df('0x5'));var util=require('util');var path=require(_0x10df('0x6'));var sox=require(_0x10df('0x7'));var csv=require(_0x10df('0x8'));var ejs=require(_0x10df('0x9'));var fs=require('fs');var fs_extra=require(_0x10df('0xa'));var _=require(_0x10df('0xb'));var squel=require(_0x10df('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x10df('0xd'));var toCsv=require(_0x10df('0x8'));var querystring=require('querystring');var Papa=require(_0x10df('0xe'));var Redis=require(_0x10df('0xf'));var authService=require(_0x10df('0x10'));var qs=require(_0x10df('0x11'));var as=require(_0x10df('0x12'));var hardwareService=require(_0x10df('0x13'));var logger=require(_0x10df('0x14'))(_0x10df('0x15'));var utils=require(_0x10df('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c687b,_0x35a7a7){_0x35a7a7=_0x35a7a7||0xcc;return function(_0x20782e){if(_0x20782e){return _0x2c687b[_0x10df('0x17')](_0x35a7a7);}return _0x2c687b['status'](_0x35a7a7)[_0x10df('0x18')]();};}function respondWithResult(_0xec5d92,_0x14b63f){_0x14b63f=_0x14b63f||0xc8;return function(_0xd357c3){if(_0xd357c3){return _0xec5d92[_0x10df('0x19')](_0x14b63f)[_0x10df('0x1a')](_0xd357c3);}};}function respondWithFilteredResult(_0x48c2a3,_0x3eb3a9){return function(_0x128f84){if(_0x128f84){var _0x5500fb=typeof _0x3eb3a9[_0x10df('0x1b')]===_0x10df('0x1c')&&typeof _0x3eb3a9[_0x10df('0x1d')]===_0x10df('0x1c');var _0x18e3b8=_0x128f84['count'];var _0x2b1a15=_0x5500fb?0x0:_0x3eb3a9[_0x10df('0x1b')];var _0xdf24b1=_0x5500fb?_0x128f84['count']:_0x3eb3a9[_0x10df('0x1b')]+_0x3eb3a9[_0x10df('0x1d')];var _0x262c65;if(_0xdf24b1>=_0x18e3b8){_0xdf24b1=_0x18e3b8;_0x262c65=0xc8;}else{_0x262c65=0xce;}_0x48c2a3['status'](_0x262c65);return _0x48c2a3[_0x10df('0x1e')](_0x10df('0x1f'),_0x2b1a15+'-'+_0xdf24b1+'/'+_0x18e3b8)[_0x10df('0x1a')](_0x128f84);}return null;};}function patchUpdates(_0x528f95){return function(_0x25afb1){try{jsonpatch[_0x10df('0x20')](_0x25afb1,_0x528f95,!![]);}catch(_0x227508){return BPromise[_0x10df('0x21')](_0x227508);}return _0x25afb1[_0x10df('0x22')]();};}function saveUpdates(_0x4fdecb,_0x290839){return function(_0xe51eb7){if(_0xe51eb7){return _0xe51eb7['update'](_0x4fdecb)[_0x10df('0x23')](function(_0x220a2f){return _0x220a2f;});}return null;};}function removeEntity(_0x1cecf4,_0x20df12){return function(_0x414623){if(_0x414623){return _0x414623[_0x10df('0x24')]()[_0x10df('0x23')](function(){_0x1cecf4[_0x10df('0x19')](0xcc)[_0x10df('0x18')]();});}};}function handleEntityNotFound(_0x4ec703,_0x3720cb){return function(_0x5db2bd){if(!_0x5db2bd){_0x4ec703[_0x10df('0x17')](0x194);}return _0x5db2bd;};}function handleError(_0x41ad58,_0x53dd0e){_0x53dd0e=_0x53dd0e||0x1f4;return function(_0x17339d){logger[_0x10df('0x25')](_0x17339d[_0x10df('0x26')]);if(_0x17339d[_0x10df('0x27')]){delete _0x17339d[_0x10df('0x27')];}_0x41ad58[_0x10df('0x19')](_0x53dd0e)[_0x10df('0x28')](_0x17339d);};}exports['index']=function(_0x12669a,_0x317b2b){var _0x11c366={},_0x1ef801={},_0xedf0f2={'count':0x0,'rows':[]};var _0x41078b=_['map'](db[_0x10df('0x29')][_0x10df('0x2a')],function(_0x5ed1e1){return{'name':_0x5ed1e1[_0x10df('0x2b')],'type':_0x5ed1e1[_0x10df('0x2c')]['key']};});_0x1ef801[_0x10df('0x2d')]=_[_0x10df('0x2e')](_0x41078b,_0x10df('0x27'));_0x1ef801['query']=_[_0x10df('0x2f')](_0x12669a[_0x10df('0x30')]);_0x1ef801[_0x10df('0x31')]=_[_0x10df('0x32')](_0x1ef801[_0x10df('0x2d')],_0x1ef801[_0x10df('0x30')]);_0x11c366[_0x10df('0x33')]=_['intersection'](_0x1ef801[_0x10df('0x2d')],qs[_0x10df('0x34')](_0x12669a[_0x10df('0x30')][_0x10df('0x34')]));_0x11c366['attributes']=_0x11c366['attributes']['length']?_0x11c366[_0x10df('0x33')]:_0x1ef801['model'];if(!_0x12669a[_0x10df('0x30')][_0x10df('0x35')]('nolimit')){_0x11c366[_0x10df('0x1d')]=qs[_0x10df('0x1d')](_0x12669a[_0x10df('0x30')][_0x10df('0x1d')]);_0x11c366[_0x10df('0x1b')]=qs[_0x10df('0x1b')](_0x12669a[_0x10df('0x30')][_0x10df('0x1b')]);}_0x11c366['order']=qs[_0x10df('0x36')](_0x12669a[_0x10df('0x30')]['sort']);_0x11c366[_0x10df('0x37')]=qs[_0x10df('0x31')](_[_0x10df('0x38')](_0x12669a[_0x10df('0x30')],_0x1ef801[_0x10df('0x31')]),_0x41078b);if(_0x12669a[_0x10df('0x30')][_0x10df('0x39')]){_0x11c366[_0x10df('0x37')]=_[_0x10df('0x3a')](_0x11c366[_0x10df('0x37')],{'$or':_[_0x10df('0x2e')](_0x41078b,function(_0x4df26e){if(_0x4df26e[_0x10df('0x2c')]!==_0x10df('0x3b')){var _0x58505f={};_0x58505f[_0x4df26e[_0x10df('0x27')]]={'$like':'%'+_0x12669a[_0x10df('0x30')]['filter']+'%'};return _0x58505f;}})});}_0x11c366=_[_0x10df('0x3a')]({},_0x11c366,_0x12669a[_0x10df('0x3c')]);var _0x4f82ea={'where':_0x11c366[_0x10df('0x37')]};return db[_0x10df('0x29')]['count'](_0x4f82ea)[_0x10df('0x23')](function(_0x111138){_0xedf0f2[_0x10df('0x3d')]=_0x111138;if(_0x12669a[_0x10df('0x30')]['includeAll']){_0x11c366[_0x10df('0x3e')]=[{'all':!![]}];}return db[_0x10df('0x29')][_0x10df('0x3f')](_0x11c366);})[_0x10df('0x23')](function(_0x44a5bd){_0xedf0f2[_0x10df('0x40')]=_0x44a5bd;return _0xedf0f2;})[_0x10df('0x23')](respondWithFilteredResult(_0x317b2b,_0x11c366))[_0x10df('0x41')](handleError(_0x317b2b,null));};exports[_0x10df('0x42')]=function(_0xdd8595,_0xb83743){var _0x46da94={'raw':!![],'where':{'id':_0xdd8595['params']['id']}},_0x1b18e5={};_0x1b18e5[_0x10df('0x2d')]=_[_0x10df('0x2f')](db[_0x10df('0x29')][_0x10df('0x2a')]);_0x1b18e5[_0x10df('0x30')]=_['keys'](_0xdd8595['query']);_0x1b18e5[_0x10df('0x31')]=_[_0x10df('0x32')](_0x1b18e5[_0x10df('0x2d')],_0x1b18e5[_0x10df('0x30')]);_0x46da94[_0x10df('0x33')]=_[_0x10df('0x32')](_0x1b18e5[_0x10df('0x2d')],qs['fields'](_0xdd8595[_0x10df('0x30')][_0x10df('0x34')]));_0x46da94[_0x10df('0x33')]=_0x46da94['attributes'][_0x10df('0x43')]?_0x46da94[_0x10df('0x33')]:_0x1b18e5[_0x10df('0x2d')];if(_0xdd8595[_0x10df('0x30')][_0x10df('0x44')]){_0x46da94['include']=[{'all':!![]}];}_0x46da94=_[_0x10df('0x3a')]({},_0x46da94,_0xdd8595[_0x10df('0x3c')]);return db[_0x10df('0x29')]['find'](_0x46da94)[_0x10df('0x23')](handleEntityNotFound(_0xb83743,null))[_0x10df('0x23')](respondWithResult(_0xb83743,null))[_0x10df('0x41')](handleError(_0xb83743,null));};exports['create']=function(_0x4bc347,_0x291d7b){return db[_0x10df('0x29')]['create'](_0x4bc347[_0x10df('0x45')],{})[_0x10df('0x23')](respondWithResult(_0x291d7b,0xc9))['catch'](handleError(_0x291d7b,null));};exports['update']=function(_0x2d2450,_0x421af3){if(_0x2d2450[_0x10df('0x45')]['id']){delete _0x2d2450[_0x10df('0x45')]['id'];}return db['ChatTransferReport'][_0x10df('0x46')]({'where':{'id':_0x2d2450[_0x10df('0x47')]['id']}})['then'](handleEntityNotFound(_0x421af3,null))[_0x10df('0x23')](saveUpdates(_0x2d2450[_0x10df('0x45')],null))['then'](respondWithResult(_0x421af3,null))[_0x10df('0x41')](handleError(_0x421af3,null));};exports[_0x10df('0x24')]=function(_0x4ff056,_0x48d32e){return db[_0x10df('0x29')][_0x10df('0x46')]({'where':{'id':_0x4ff056[_0x10df('0x47')]['id']}})[_0x10df('0x23')](handleEntityNotFound(_0x48d32e,null))[_0x10df('0x23')](removeEntity(_0x48d32e,null))[_0x10df('0x41')](handleError(_0x48d32e,null));};exports[_0x10df('0x48')]=function(_0x23162d,_0x51c9b3){return db[_0x10df('0x29')][_0x10df('0x48')]()['then'](respondWithResult(_0x51c9b3,null))[_0x10df('0x41')](handleError(_0x51c9b3,null));}; \ No newline at end of file +var _0x26b9=['reject','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x194934,_0x231270){var _0x59bb6b=function(_0xa10426){while(--_0xa10426){_0x194934['push'](_0x194934['shift']());}};_0x59bb6b(++_0x231270);}(_0x26b9,0x10a));var _0x926b=function(_0x1ab20a,_0x50a80a){_0x1ab20a=_0x1ab20a-0x0;var _0x42c089=_0x26b9[_0x1ab20a];return _0x42c089;};'use strict';var emlformat=require(_0x926b('0x0'));var rimraf=require(_0x926b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x926b('0x2'));var rp=require(_0x926b('0x3'));var moment=require(_0x926b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x926b('0x5'));var path=require(_0x926b('0x6'));var sox=require(_0x926b('0x7'));var csv=require(_0x926b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x926b('0x9'));var squel=require('squel');var crypto=require(_0x926b('0xa'));var jsforce=require(_0x926b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x926b('0x8'));var querystring=require(_0x926b('0xc'));var Papa=require(_0x926b('0xd'));var Redis=require(_0x926b('0xe'));var authService=require(_0x926b('0xf'));var qs=require(_0x926b('0x10'));var as=require(_0x926b('0x11'));var hardwareService=require(_0x926b('0x12'));var logger=require(_0x926b('0x13'))('api');var utils=require(_0x926b('0x14'));var config=require(_0x926b('0x15'));var licenseUtil=require(_0x926b('0x16'));var db=require(_0x926b('0x17'))['db'];function respondWithStatusCode(_0x42cb51,_0x5bd123){_0x5bd123=_0x5bd123||0xcc;return function(_0xe09589){if(_0xe09589){return _0x42cb51['sendStatus'](_0x5bd123);}return _0x42cb51[_0x926b('0x18')](_0x5bd123)[_0x926b('0x19')]();};}function respondWithResult(_0x217537,_0x205036){_0x205036=_0x205036||0xc8;return function(_0x1da982){if(_0x1da982){return _0x217537[_0x926b('0x18')](_0x205036)[_0x926b('0x1a')](_0x1da982);}};}function respondWithFilteredResult(_0xd39507,_0x3c030c){return function(_0x1db1e5){if(_0x1db1e5){var _0x82c900=typeof _0x3c030c[_0x926b('0x1b')]===_0x926b('0x1c')&&typeof _0x3c030c[_0x926b('0x1d')]==='undefined';var _0x179310=_0x1db1e5[_0x926b('0x1e')];var _0x12b6b1=_0x82c900?0x0:_0x3c030c[_0x926b('0x1b')];var _0x5d4655=_0x82c900?_0x1db1e5[_0x926b('0x1e')]:_0x3c030c[_0x926b('0x1b')]+_0x3c030c['limit'];var _0xc8d96b;if(_0x5d4655>=_0x179310){_0x5d4655=_0x179310;_0xc8d96b=0xc8;}else{_0xc8d96b=0xce;}_0xd39507[_0x926b('0x18')](_0xc8d96b);return _0xd39507[_0x926b('0x1f')](_0x926b('0x20'),_0x12b6b1+'-'+_0x5d4655+'/'+_0x179310)['json'](_0x1db1e5);}return null;};}function patchUpdates(_0x5311a6){return function(_0xdcbbfc){try{jsonpatch[_0x926b('0x21')](_0xdcbbfc,_0x5311a6,!![]);}catch(_0x18e9fe){return BPromise[_0x926b('0x22')](_0x18e9fe);}return _0xdcbbfc['save']();};}function saveUpdates(_0x37b941,_0x4f6a06){return function(_0x166d3b){if(_0x166d3b){return _0x166d3b['update'](_0x37b941)[_0x926b('0x23')](function(_0x1a5944){return _0x1a5944;});}return null;};}function removeEntity(_0x410202,_0xca434d){return function(_0x41c594){if(_0x41c594){return _0x41c594[_0x926b('0x24')]()[_0x926b('0x23')](function(){_0x410202['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ab72c,_0x56d85e){return function(_0x408475){if(!_0x408475){_0x4ab72c[_0x926b('0x25')](0x194);}return _0x408475;};}function handleError(_0x20e551,_0x16d650){_0x16d650=_0x16d650||0x1f4;return function(_0x59df1a){logger['error'](_0x59df1a[_0x926b('0x26')]);if(_0x59df1a[_0x926b('0x27')]){delete _0x59df1a['name'];}_0x20e551['status'](_0x16d650)[_0x926b('0x28')](_0x59df1a);};}exports[_0x926b('0x29')]=function(_0x4da778,_0x1ba301){var _0x409442={},_0x118857={},_0x4c35e9={'count':0x0,'rows':[]};var _0xdd9b2a=_[_0x926b('0x2a')](db['ChatTransferReport'][_0x926b('0x2b')],function(_0x29d869){return{'name':_0x29d869[_0x926b('0x2c')],'type':_0x29d869[_0x926b('0x2d')]['key']};});_0x118857['model']=_[_0x926b('0x2a')](_0xdd9b2a,'name');_0x118857[_0x926b('0x2e')]=_['keys'](_0x4da778['query']);_0x118857['filters']=_[_0x926b('0x2f')](_0x118857['model'],_0x118857['query']);_0x409442['attributes']=_[_0x926b('0x2f')](_0x118857[_0x926b('0x30')],qs[_0x926b('0x31')](_0x4da778[_0x926b('0x2e')][_0x926b('0x31')]));_0x409442[_0x926b('0x32')]=_0x409442['attributes']['length']?_0x409442[_0x926b('0x32')]:_0x118857[_0x926b('0x30')];if(!_0x4da778[_0x926b('0x2e')][_0x926b('0x33')](_0x926b('0x34'))){_0x409442[_0x926b('0x1d')]=qs[_0x926b('0x1d')](_0x4da778['query']['limit']);_0x409442[_0x926b('0x1b')]=qs[_0x926b('0x1b')](_0x4da778[_0x926b('0x2e')][_0x926b('0x1b')]);}_0x409442[_0x926b('0x35')]=qs[_0x926b('0x36')](_0x4da778[_0x926b('0x2e')][_0x926b('0x36')]);_0x409442['where']=qs[_0x926b('0x37')](_['pick'](_0x4da778[_0x926b('0x2e')],_0x118857[_0x926b('0x37')]),_0xdd9b2a);if(_0x4da778[_0x926b('0x2e')]['filter']){_0x409442[_0x926b('0x38')]=_[_0x926b('0x39')](_0x409442[_0x926b('0x38')],{'$or':_[_0x926b('0x2a')](_0xdd9b2a,function(_0x570060){if(_0x570060[_0x926b('0x2d')]!==_0x926b('0x3a')){var _0x2f47ac={};_0x2f47ac[_0x570060[_0x926b('0x27')]]={'$like':'%'+_0x4da778['query'][_0x926b('0x3b')]+'%'};return _0x2f47ac;}})});}_0x409442=_['merge']({},_0x409442,_0x4da778[_0x926b('0x3c')]);var _0x201755={'where':_0x409442[_0x926b('0x38')]};return db[_0x926b('0x3d')]['count'](_0x201755)[_0x926b('0x23')](function(_0x500fe1){_0x4c35e9[_0x926b('0x1e')]=_0x500fe1;if(_0x4da778[_0x926b('0x2e')][_0x926b('0x3e')]){_0x409442[_0x926b('0x3f')]=[{'all':!![]}];}return db[_0x926b('0x3d')][_0x926b('0x40')](_0x409442);})[_0x926b('0x23')](function(_0x458415){_0x4c35e9[_0x926b('0x41')]=_0x458415;return _0x4c35e9;})[_0x926b('0x23')](respondWithFilteredResult(_0x1ba301,_0x409442))[_0x926b('0x42')](handleError(_0x1ba301,null));};exports[_0x926b('0x43')]=function(_0x4973ba,_0x466757){var _0x3f6282={'raw':!![],'where':{'id':_0x4973ba[_0x926b('0x44')]['id']}},_0x66563e={};_0x66563e['model']=_[_0x926b('0x45')](db[_0x926b('0x3d')][_0x926b('0x2b')]);_0x66563e[_0x926b('0x2e')]=_[_0x926b('0x45')](_0x4973ba[_0x926b('0x2e')]);_0x66563e[_0x926b('0x37')]=_[_0x926b('0x2f')](_0x66563e[_0x926b('0x30')],_0x66563e[_0x926b('0x2e')]);_0x3f6282['attributes']=_[_0x926b('0x2f')](_0x66563e['model'],qs[_0x926b('0x31')](_0x4973ba[_0x926b('0x2e')][_0x926b('0x31')]));_0x3f6282['attributes']=_0x3f6282[_0x926b('0x32')][_0x926b('0x46')]?_0x3f6282[_0x926b('0x32')]:_0x66563e[_0x926b('0x30')];if(_0x4973ba[_0x926b('0x2e')][_0x926b('0x3e')]){_0x3f6282[_0x926b('0x3f')]=[{'all':!![]}];}_0x3f6282=_['merge']({},_0x3f6282,_0x4973ba[_0x926b('0x3c')]);return db[_0x926b('0x3d')][_0x926b('0x47')](_0x3f6282)[_0x926b('0x23')](handleEntityNotFound(_0x466757,null))[_0x926b('0x23')](respondWithResult(_0x466757,null))[_0x926b('0x42')](handleError(_0x466757,null));};exports['create']=function(_0x53440b,_0x44589e){return db['ChatTransferReport'][_0x926b('0x48')](_0x53440b[_0x926b('0x49')],{})[_0x926b('0x23')](respondWithResult(_0x44589e,0xc9))[_0x926b('0x42')](handleError(_0x44589e,null));};exports['update']=function(_0x5a0f80,_0x1fd009){if(_0x5a0f80[_0x926b('0x49')]['id']){delete _0x5a0f80[_0x926b('0x49')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5a0f80[_0x926b('0x44')]['id']}})[_0x926b('0x23')](handleEntityNotFound(_0x1fd009,null))['then'](saveUpdates(_0x5a0f80['body'],null))['then'](respondWithResult(_0x1fd009,null))[_0x926b('0x42')](handleError(_0x1fd009,null));};exports[_0x926b('0x24')]=function(_0x3fd99e,_0x1e550a){return db['ChatTransferReport'][_0x926b('0x47')]({'where':{'id':_0x3fd99e[_0x926b('0x44')]['id']}})[_0x926b('0x23')](handleEntityNotFound(_0x1e550a,null))[_0x926b('0x23')](removeEntity(_0x1e550a,null))['catch'](handleError(_0x1e550a,null));};exports[_0x926b('0x4a')]=function(_0x5ddb0c,_0x9ba127){return db[_0x926b('0x3d')][_0x926b('0x4a')]()[_0x926b('0x23')](respondWithResult(_0x9ba127,null))[_0x926b('0x42')](handleError(_0x9ba127,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3d24fba..8a02ff9 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 _0x01aa=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid'];(function(_0x185b99,_0x1d8140){var _0xc49026=function(_0x59abcc){while(--_0x59abcc){_0x185b99['push'](_0x185b99['shift']());}};_0xc49026(++_0x1d8140);}(_0x01aa,0x134));var _0xa01a=function(_0x90d555,_0xbe300){_0x90d555=_0x90d555-0x0;var _0x2513da=_0x01aa[_0x90d555];return _0x2513da;};'use strict';var _=require(_0xa01a('0x0'));var util=require(_0xa01a('0x1'));var logger=require(_0xa01a('0x2'))(_0xa01a('0x3'));var moment=require(_0xa01a('0x4'));var BPromise=require(_0xa01a('0x5'));var rp=require(_0xa01a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa01a('0x7'));var config=require(_0xa01a('0x8'));var attributes=require(_0xa01a('0x9'));module[_0xa01a('0xa')]=function(_0x53af74,_0x164fde){return _0x53af74[_0xa01a('0xb')]('ChatTransferReport',attributes,{'tableName':_0xa01a('0xc'),'paranoid':![],'indexes':[{'name':_0xa01a('0xd'),'fields':[_0xa01a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x981b=['bluebird','path','rimraf','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x158ca9,_0x5ea5b3){var _0x3bbaf4=function(_0xed0587){while(--_0xed0587){_0x158ca9['push'](_0x158ca9['shift']());}};_0x3bbaf4(++_0x5ea5b3);}(_0x981b,0x1c9));var _0xb981=function(_0x149f8d,_0x5a2642){_0x149f8d=_0x149f8d-0x0;var _0x3110a4=_0x981b[_0x149f8d];return _0x3110a4;};'use strict';var _=require(_0xb981('0x0'));var util=require(_0xb981('0x1'));var logger=require(_0xb981('0x2'))(_0xb981('0x3'));var moment=require(_0xb981('0x4'));var BPromise=require(_0xb981('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb981('0x6'));var rimraf=require(_0xb981('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x13bedb,_0x199226){return _0x13bedb[_0xb981('0x8')]('ChatTransferReport',attributes,{'tableName':_0xb981('0x9'),'paranoid':![],'indexes':[{'name':_0xb981('0xa'),'fields':[_0xb981('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 66431a8..0b9de05 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 _0x6942=['../../config/logger','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x56f9f8,_0x28498e){var _0x9728f3=function(_0x4c9295){while(--_0x4c9295){_0x56f9f8['push'](_0x56f9f8['shift']());}};_0x9728f3(++_0x28498e);}(_0x6942,0xd1));var _0x2694=function(_0x26da99,_0x40e5b9){_0x26da99=_0x26da99-0x0;var _0x4f832a=_0x6942[_0x26da99];return _0x4f832a;};'use strict';var _=require('lodash');var util=require(_0x2694('0x0'));var moment=require(_0x2694('0x1'));var BPromise=require(_0x2694('0x2'));var rs=require(_0x2694('0x3'));var fs=require('fs');var Redis=require(_0x2694('0x4'));var db=require(_0x2694('0x5'))['db'];var utils=require(_0x2694('0x6'));var logger=require(_0x2694('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2694('0x8'));var client=jayson[_0x2694('0x9')][_0x2694('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44c012,_0x157b98,_0x39f56c){return new BPromise(function(_0x5ad01b,_0xdd94a3){return client['request'](_0x44c012,_0x39f56c)['then'](function(_0x36dbf4){logger[_0x2694('0xb')](_0x2694('0xc'),_0x157b98,_0x2694('0xd'));logger[_0x2694('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x157b98,_0x2694('0xd'),JSON[_0x2694('0xf')](_0x36dbf4));if(_0x36dbf4[_0x2694('0x10')]){if(_0x36dbf4[_0x2694('0x10')]['code']===0x1f4){logger[_0x2694('0x10')](_0x2694('0xc'),_0x157b98,_0x36dbf4['error']['message']);return _0xdd94a3(_0x36dbf4[_0x2694('0x10')][_0x2694('0x11')]);}logger[_0x2694('0x10')](_0x2694('0xc'),_0x157b98,_0x36dbf4[_0x2694('0x10')][_0x2694('0x11')]);return _0x5ad01b(_0x36dbf4['error'][_0x2694('0x11')]);}else{logger['info'](_0x2694('0xc'),_0x157b98,_0x2694('0xd'));_0x5ad01b(_0x36dbf4['result'][_0x2694('0x11')]);}})['catch'](function(_0x46b43d){logger[_0x2694('0x10')](_0x2694('0xc'),_0x157b98,_0x46b43d);_0xdd94a3(_0x46b43d);});});} \ No newline at end of file +var _0xc024=['ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2b9bdf,_0x8fa76f){var _0x20dd2a=function(_0x2810d0){while(--_0x2810d0){_0x2b9bdf['push'](_0x2b9bdf['shift']());}};_0x20dd2a(++_0x8fa76f);}(_0xc024,0x101));var _0x4c02=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xc024[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x4c02('0x0'));var util=require(_0x4c02('0x1'));var moment=require(_0x4c02('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c02('0x3'));var fs=require('fs');var Redis=require(_0x4c02('0x4'));var db=require(_0x4c02('0x5'))['db'];var utils=require(_0x4c02('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c02('0x7'));var jayson=require(_0x4c02('0x8'));var client=jayson[_0x4c02('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460d79,_0x1bd2e9,_0x43eef9){return new BPromise(function(_0x167769,_0x197afa){return client[_0x4c02('0xa')](_0x460d79,_0x43eef9)[_0x4c02('0xb')](function(_0x20309a){logger[_0x4c02('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x1bd2e9,'request\x20sent');logger[_0x4c02('0xd')](_0x4c02('0xe'),_0x1bd2e9,_0x4c02('0xf'),JSON[_0x4c02('0x10')](_0x20309a));if(_0x20309a[_0x4c02('0x11')]){if(_0x20309a[_0x4c02('0x11')][_0x4c02('0x12')]===0x1f4){logger[_0x4c02('0x11')](_0x4c02('0x13'),_0x1bd2e9,_0x20309a[_0x4c02('0x11')]['message']);return _0x197afa(_0x20309a[_0x4c02('0x11')][_0x4c02('0x14')]);}logger[_0x4c02('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1bd2e9,_0x20309a[_0x4c02('0x11')][_0x4c02('0x14')]);return _0x167769(_0x20309a['error']['message']);}else{logger[_0x4c02('0xc')](_0x4c02('0x13'),_0x1bd2e9,_0x4c02('0xf'));_0x167769(_0x20309a[_0x4c02('0x15')][_0x4c02('0x14')]);}})[_0x4c02('0x16')](function(_0x104601){logger['error'](_0x4c02('0x13'),_0x1bd2e9,_0x104601);_0x197afa(_0x104601);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d8d0095..9e3b733 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 _0x4bf4=['delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x4bf4,0xe3));var _0x44bf=function(_0x1f1283,_0x1bea3b){_0x1f1283=_0x1f1283-0x0;var _0x205041=_0x4bf4[_0x1f1283];return _0x205041;};'use strict';var multer=require(_0x44bf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x44bf('0x1'));var express=require('express');var router=express[_0x44bf('0x2')]();var fs_extra=require(_0x44bf('0x3'));var auth=require(_0x44bf('0x4'));var interaction=require(_0x44bf('0x5'));var config=require(_0x44bf('0x6'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x44bf('0x7')](),controller['index']);router['get'](_0x44bf('0x8'),auth[_0x44bf('0x7')](),controller[_0x44bf('0x9')]);router['get'](_0x44bf('0xa'),auth[_0x44bf('0x7')](),controller[_0x44bf('0xb')]);router[_0x44bf('0xc')]('/',auth[_0x44bf('0x7')](),controller['create']);router['put'](_0x44bf('0xa'),auth[_0x44bf('0x7')](),controller['update']);router[_0x44bf('0xd')](_0x44bf('0xa'),auth[_0x44bf('0x7')](),controller['destroy']);module[_0x44bf('0xe')]=router; \ No newline at end of file +var _0xdcfa=['isAuthenticated','describe','/:id','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdcfa,0xe4));var _0xadcf=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xdcfa[_0x454018];return _0x24697d;};'use strict';var multer=require(_0xadcf('0x0'));var util=require(_0xadcf('0x1'));var path=require('path');var timeout=require(_0xadcf('0x2'));var express=require(_0xadcf('0x3'));var router=express[_0xadcf('0x4')]();var fs_extra=require(_0xadcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xadcf('0x6'));var config=require(_0xadcf('0x7'));var controller=require(_0xadcf('0x8'));router[_0xadcf('0x9')]('/',auth['isAuthenticated'](),controller[_0xadcf('0xa')]);router[_0xadcf('0x9')](_0xadcf('0xb'),auth[_0xadcf('0xc')](),controller[_0xadcf('0xd')]);router[_0xadcf('0x9')](_0xadcf('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xadcf('0xf')]('/',auth['isAuthenticated'](),controller[_0xadcf('0x10')]);router['put'](_0xadcf('0xe'),auth['isAuthenticated'](),controller[_0xadcf('0x11')]);router[_0xadcf('0x12')]('/:id',auth[_0xadcf('0xc')](),controller['destroy']);module[_0xadcf('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3708f5f..912851d 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 _0xcbf9=['parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','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','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xcbf9,0x174));var _0x9cbf=function(_0x229066,_0x443063){_0x229066=_0x229066-0x0;var _0xd7c89=_0xcbf9[_0x229066];return _0xd7c89;};'use strict';var Sequelize=require(_0x9cbf('0x0'));var rs=require('randomstring');module[_0x9cbf('0x1')]={'name':{'type':Sequelize[_0x9cbf('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9cbf('0x2')],'allowNull':![],'unique':_0x9cbf('0x3')},'description':{'type':Sequelize[_0x9cbf('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x5')},'customerAlias':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9cbf('0x2')],'allowNull':![],'defaultValue':_0x9cbf('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9cbf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9cbf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9cbf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9cbf('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9cbf('0x9')](_0x9cbf('0xa'),'squared'),'defaultValue':_0x9cbf('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0xb')},'offline_chat_button':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0xc')},'header_offline':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9cbf('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9cbf('0xf')]},'closingQuestion':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x10')},'noteTitle':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x11')},'placeholderMessage':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x13')},'conditionAgreement':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x14')},'ratingType':{'type':Sequelize[_0x9cbf('0x9')](_0x9cbf('0x15'),_0x9cbf('0x16')),'defaultValue':_0x9cbf('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x9cbf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9cbf('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9cbf('0x17'),'variable':null,'config':{'placeholder':_0x9cbf('0x18'),'type':_0x9cbf('0x19'),'required':!![]},'props':{'title':_0x9cbf('0x18'),'helpText':''}},{'type':_0x9cbf('0x17'),'props':{'title':_0x9cbf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9cbf('0x4'),'type':_0x9cbf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9cbf('0x1a')](_0x9cbf('0x1b'))?JSON[_0x9cbf('0x1c')](this[_0x9cbf('0x1a')]('onlineForm')):{};},'set':function(_0x2b8868){return this[_0x9cbf('0x1d')](_0x9cbf('0x1b'),JSON[_0x9cbf('0x1e')](_0x2b8868));}},'offlineForm':{'type':Sequelize[_0x9cbf('0xf')],'defaultValue':function(){return JSON[_0x9cbf('0x1e')]({'items':[{'type':_0x9cbf('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9cbf('0x4'),'type':_0x9cbf('0x4')},'variable':null},{'type':_0x9cbf('0x1f'),'config':{'placeholder':_0x9cbf('0x20')},'props':{'title':'Comments','helpText':_0x9cbf('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9cbf('0x1a')](_0x9cbf('0x22'))?JSON['parse'](this[_0x9cbf('0x1a')]('offlineForm')):{};},'set':function(_0x1a5584){return this[_0x9cbf('0x1d')]('offlineForm',JSON[_0x9cbf('0x1e')](_0x1a5584));}},'token':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9cbf('0x2')]},'forwardOffline':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9cbf('0x2')]},'waitingTitle':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x23')},'waitingMessage':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x26')},'skipUnmanaged':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x13')},'sendUnmanaged':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9cbf('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9cbf('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9cbf('0xf')],'defaultValue':function(){return _0x9cbf('0x27');}},'notificationSound':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cbf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9cbf('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9cbf('0x2a')},'defaultTitle':{'type':Sequelize[_0x9cbf('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9cbf('0x2')],'allowNull':![],'defaultValue':_0x9cbf('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cbf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9cbf('0x2')],'defaultValue':_0x9cbf('0x2c')},'systemAvatar':{'type':Sequelize[_0x9cbf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cbf('0x8')],'comment':_0x9cbf('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58e234){if(!_0x58e234)this[_0x9cbf('0x1d')](_0x9cbf('0x2e'),null);this['setDataValue'](_0x9cbf('0x2f'),_0x58e234);}},'vidaooEscalation':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9cbf('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9cbf('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x9cbf('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x9cbf('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9cbf('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9cbf('0xf')]}}; \ No newline at end of file +var _0x5bf6=['Comments','offlineForm','generate','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:','Send','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea'];(function(_0x1cea76,_0x11c8ad){var _0x1b359b=function(_0x4e849d){while(--_0x4e849d){_0x1cea76['push'](_0x1cea76['shift']());}};_0x1b359b(++_0x11c8ad);}(_0x5bf6,0x13e));var _0x65bf=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x5bf6[_0x1a21ff];return _0x25afc1;};'use strict';var Sequelize=require(_0x65bf('0x0'));var rs=require('randomstring');module[_0x65bf('0x1')]={'name':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'unique':_0x65bf('0x3')},'description':{'type':Sequelize[_0x65bf('0x2')]},'mapKey':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x5')},'customerAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':_0x65bf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65bf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x65bf('0xa')](_0x65bf('0xb'),_0x65bf('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0xd')},'start_chat_button':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x65bf('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x13')},'placeholderMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x14')},'closingMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x15')},'conditionAgreement':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x16')},'ratingType':{'type':Sequelize[_0x65bf('0xa')](_0x65bf('0x17'),'thumb'),'defaultValue':_0x65bf('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x65bf('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x65bf('0x19'),'helpText':''}},{'type':_0x65bf('0x18'),'props':{'title':_0x65bf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x65bf('0x4'),'type':_0x65bf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x65bf('0x1a')](_0x65bf('0x1b'))?JSON[_0x65bf('0x1c')](this[_0x65bf('0x1a')]('onlineForm')):{};},'set':function(_0x5f0c8a){return this[_0x65bf('0x1d')](_0x65bf('0x1b'),JSON[_0x65bf('0x1e')](_0x5f0c8a));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x65bf('0x1e')]({'items':[{'type':_0x65bf('0x18'),'props':{'title':_0x65bf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x65bf('0x4'),'type':_0x65bf('0x4')},'variable':null},{'type':_0x65bf('0x1f'),'config':{'placeholder':_0x65bf('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x65bf('0x1a')](_0x65bf('0x21'))?JSON[_0x65bf('0x1c')](this[_0x65bf('0x1a')]('offlineForm')):{};},'set':function(_0x874c78){return this['setDataValue'](_0x65bf('0x21'),JSON[_0x65bf('0x1e')](_0x874c78));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x65bf('0x22')]();}},'autoclose':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x65bf('0x2')]},'forwardOffline':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x65bf('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x24')},'offlineMessageBody':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x15')},'sendUnmanaged':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x26')},'enableCustomerAttachment':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x65bf('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x65bf('0x2')]},'notificationTemplate':{'type':Sequelize[_0x65bf('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x28')},'verticalAlignment':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x2a')},'defaultTitle':{'type':Sequelize[_0x65bf('0x2')]},'customerAvatar':{'type':Sequelize[_0x65bf('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':_0x65bf('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x2c')},'systemAvatar':{'type':Sequelize[_0x65bf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65bf('0x8')],'comment':_0x65bf('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![],'comment':_0x65bf('0x2e'),'set':function(_0x46ff3e){if(!_0x46ff3e)this['setDataValue'](_0x65bf('0x2f'),null);this[_0x65bf('0x1d')](_0x65bf('0x30'),_0x46ff3e);}},'vidaooEscalation':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x65bf('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65bf('0x31')},'vidaooNote':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 22848e4..1076643 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 _0x0881=['ChatApplication','Applications','account','applications','orderBy','priority','defaults','contact','customerIp','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','get','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','fromString','originalname','mimetype','server','files','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','order','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','../../config/license/util','virtual','License','Intervals','some','server/files/chat/iframe.ejs','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','render','alignment','labelText','textColor','color_button','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','update','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','sort','where','pick','filter','merge','options','includeAll','rows','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','length','hasOwnProperty','include','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','CmList','List','Contacts'];(function(_0x41c6e4,_0x2e9ee7){var _0x480e1a=function(_0x2a3c31){while(--_0x2a3c31){_0x41c6e4['push'](_0x41c6e4['shift']());}};_0x480e1a(++_0x2e9ee7);}(_0x0881,0x1bf));var _0x1088=function(_0x569b7a,_0x377a61){_0x569b7a=_0x569b7a-0x0;var _0x39d00a=_0x0881[_0x569b7a];return _0x39d00a;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x1088('0x0'));var util=require(_0x1088('0x1'));var path=require(_0x1088('0x2'));var ejs=require(_0x1088('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1088('0x4'));var querystring=require('querystring');var Redis=require(_0x1088('0x5'));var qs=require(_0x1088('0x6'));var logger=require(_0x1088('0x7'))('api');var config=require('../../config/environment');var db=require(_0x1088('0x8'))['db'];config[_0x1088('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1088('0xa'))(new Redis(config[_0x1088('0x9')]));require(_0x1088('0xb'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x1088('0xc'));var client=jayson['client'][_0x1088('0xd')]({'port':0x232c});var client9002=jayson['client'][_0x1088('0xd')]({'port':0x232a});var client9003=jayson['client'][_0x1088('0xd')]({'port':0x232b});var client9001=jayson[_0x1088('0xe')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3b962d,_0x4057ff,_0x4e9b35,_0x216d65){return new BPromise(function(_0x518488,_0x23cff4){var _0x224b0e=_0x216d65||client;return _0x224b0e[_0x1088('0xf')](_0x3b962d,_0x4e9b35)[_0x1088('0x10')](function(_0x4b6a77){logger[_0x1088('0x11')](_0x1088('0x12'),_0x4057ff,_0x1088('0x13'));logger[_0x1088('0x14')](_0x1088('0x15'),_0x4057ff,_0x1088('0x13'),JSON[_0x1088('0x16')](_0x4b6a77));if(_0x4b6a77[_0x1088('0x17')]){if(_0x4b6a77[_0x1088('0x17')][_0x1088('0x18')]===0x1f4){logger[_0x1088('0x17')](_0x1088('0x12'),_0x4057ff,_0x4b6a77[_0x1088('0x17')][_0x1088('0x19')]);return _0x23cff4(_0x4b6a77['error']['message']);}logger[_0x1088('0x17')](_0x1088('0x12'),_0x4057ff,_0x4b6a77[_0x1088('0x17')][_0x1088('0x19')]);return _0x518488(_0x4b6a77[_0x1088('0x17')][_0x1088('0x19')]);}else{logger[_0x1088('0x11')](_0x1088('0x12'),_0x4057ff,_0x1088('0x13'));_0x518488(_0x4b6a77[_0x1088('0x1a')][_0x1088('0x19')]);}})[_0x1088('0x1b')](function(_0x212781){logger[_0x1088('0x17')](_0x1088('0x12'),_0x4057ff,_0x212781);_0x23cff4(_0x212781);});});}function respondWithStatusCode(_0x57a411,_0x8a42fc){_0x8a42fc=_0x8a42fc||0xcc;return function(_0x5603a5){if(_0x5603a5){return _0x57a411['sendStatus'](_0x8a42fc);}return _0x57a411[_0x1088('0x1c')](_0x8a42fc)[_0x1088('0x1d')]();};}function respondWithResult(_0x217691,_0x4a2e6a){_0x4a2e6a=_0x4a2e6a||0xc8;return function(_0x31b1b1){if(_0x31b1b1){return _0x217691[_0x1088('0x1c')](_0x4a2e6a)[_0x1088('0x1e')](_0x31b1b1);}};}function respondWithFilteredResult(_0x46f467,_0x21dddf){return function(_0x380d04){if(_0x380d04){var _0x25365c=typeof _0x21dddf[_0x1088('0x1f')]==='undefined'&&typeof _0x21dddf[_0x1088('0x20')]===_0x1088('0x21');var _0x1f9389=_0x380d04[_0x1088('0x22')];var _0x5804ab=_0x25365c?0x0:_0x21dddf['offset'];var _0x1f5dae=_0x25365c?_0x380d04[_0x1088('0x22')]:_0x21dddf[_0x1088('0x1f')]+_0x21dddf[_0x1088('0x20')];var _0x5ed595;if(_0x1f5dae>=_0x1f9389){_0x1f5dae=_0x1f9389;_0x5ed595=0xc8;}else{_0x5ed595=0xce;}_0x46f467['status'](_0x5ed595);return _0x46f467[_0x1088('0x23')]('Content-Range',_0x5804ab+'-'+_0x1f5dae+'/'+_0x1f9389)[_0x1088('0x1e')](_0x380d04);}return null;};}function saveUpdates(_0xe66673){return function(_0x198a62){if(_0x198a62){return _0x198a62[_0x1088('0x24')](_0xe66673)[_0x1088('0x10')](function(_0x226bec){return _0x226bec;});}return null;};}function removeEntity(_0x57694b){return function(_0x2ca12a){if(_0x2ca12a){return _0x2ca12a['destroy']()[_0x1088('0x10')](function(){var _0x255248=_0x2ca12a['get']({'plain':!![]});var _0x1cbd5f=_0x1088('0x25');return db[_0x1088('0x26')]['destroy']({'where':{'type':_0x1cbd5f,'resourceId':_0x255248['id']}})[_0x1088('0x10')](function(){return _0x2ca12a;});})[_0x1088('0x10')](function(){_0x57694b[_0x1088('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eca49){return function(_0x3802c6){if(!_0x3802c6){_0x4eca49['sendStatus'](0x194);}return _0x3802c6;};}function handleError(_0x4a9ccf,_0x3afa9b){_0x3afa9b=_0x3afa9b||0x1f4;return function(_0x13d8a5){logger[_0x1088('0x17')](_0x13d8a5[_0x1088('0x27')]);if(_0x13d8a5[_0x1088('0x28')]){delete _0x13d8a5[_0x1088('0x28')];}_0x4a9ccf[_0x1088('0x1c')](_0x3afa9b)[_0x1088('0x29')](_0x13d8a5);};}exports[_0x1088('0x2a')]=function(_0x718b20,_0x1a6c62){var _0x3fb246={'include':[{'model':db[_0x1088('0x2b')],'as':_0x1088('0x2c')}]},_0x371e62={},_0x2dc3f9={'count':0x0,'rows':[]};var _0x29f11f=_['map'](db[_0x1088('0x2d')][_0x1088('0x2e')],function(_0x2549a7){return{'name':_0x2549a7[_0x1088('0x2f')],'type':_0x2549a7[_0x1088('0x30')]['key']};});_0x371e62[_0x1088('0x31')]=_[_0x1088('0x32')](_0x29f11f,_0x1088('0x28'));_0x371e62[_0x1088('0x33')]=_[_0x1088('0x34')](_0x718b20[_0x1088('0x33')]);_0x371e62[_0x1088('0x35')]=_['intersection'](_0x371e62[_0x1088('0x31')],_0x371e62[_0x1088('0x33')]);_0x3fb246[_0x1088('0x36')]=_['intersection'](_0x371e62[_0x1088('0x31')],qs[_0x1088('0x37')](_0x718b20['query'][_0x1088('0x37')]));_0x3fb246[_0x1088('0x36')]=_0x3fb246[_0x1088('0x36')]['length']?_0x3fb246[_0x1088('0x36')]:_0x371e62[_0x1088('0x31')];if(!_0x718b20[_0x1088('0x33')]['hasOwnProperty']('nolimit')){_0x3fb246['limit']=qs[_0x1088('0x20')](_0x718b20[_0x1088('0x33')][_0x1088('0x20')]);_0x3fb246['offset']=qs[_0x1088('0x1f')](_0x718b20[_0x1088('0x33')][_0x1088('0x1f')]);}_0x3fb246['order']=qs[_0x1088('0x38')](_0x718b20[_0x1088('0x33')][_0x1088('0x38')]);_0x3fb246[_0x1088('0x39')]=qs[_0x1088('0x35')](_[_0x1088('0x3a')](_0x718b20[_0x1088('0x33')],_0x371e62[_0x1088('0x35')]),_0x29f11f);if(_0x718b20[_0x1088('0x33')][_0x1088('0x3b')]){_0x3fb246['where']=_[_0x1088('0x3c')](_0x3fb246[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x29f11f,function(_0x2314dc){if(_0x2314dc[_0x1088('0x30')]!=='VIRTUAL'){var _0x22f50c={};_0x22f50c[_0x2314dc[_0x1088('0x28')]]={'$like':'%'+_0x718b20[_0x1088('0x33')]['filter']+'%'};return _0x22f50c;}})});}_0x3fb246=_[_0x1088('0x3c')]({},_0x3fb246,_0x718b20[_0x1088('0x3d')]);var _0x112d6d={'where':_0x3fb246[_0x1088('0x39')]};return db['ChatWebsite'][_0x1088('0x22')](_0x112d6d)[_0x1088('0x10')](function(_0x8f1efd){_0x2dc3f9['count']=_0x8f1efd;if(_0x718b20['query'][_0x1088('0x3e')]){_0x3fb246['include']=[{'all':!![]}];}return db[_0x1088('0x2d')]['findAll'](_0x3fb246);})[_0x1088('0x10')](function(_0x4c1f14){_0x2dc3f9[_0x1088('0x3f')]=_0x4c1f14;return _0x2dc3f9;})[_0x1088('0x10')](respondWithFilteredResult(_0x1a6c62,_0x3fb246))[_0x1088('0x1b')](handleError(_0x1a6c62,null));};exports[_0x1088('0x40')]=function(_0x169906,_0x2d0ab1){var _0x44a60d={'raw':![],'where':{'id':_0x169906['params']['id']},'include':[{'model':db['Pause'],'as':_0x1088('0x2c')}]},_0x30af72={};_0x30af72[_0x1088('0x31')]=_['keys'](db[_0x1088('0x2d')][_0x1088('0x2e')]);_0x30af72['query']=_['keys'](_0x169906[_0x1088('0x33')]);_0x30af72[_0x1088('0x35')]=_[_0x1088('0x41')](_0x30af72[_0x1088('0x31')],_0x30af72[_0x1088('0x33')]);_0x44a60d[_0x1088('0x36')]=_['intersection'](_0x30af72[_0x1088('0x31')],qs[_0x1088('0x37')](_0x169906[_0x1088('0x33')][_0x1088('0x37')]));_0x44a60d[_0x1088('0x36')]=_0x44a60d[_0x1088('0x36')]['length']?_0x44a60d['attributes']:_0x30af72[_0x1088('0x31')];if(_0x169906[_0x1088('0x33')][_0x1088('0x3e')]){_0x44a60d['include']=[{'all':!![]}];}_0x44a60d=_['merge']({},_0x44a60d,_0x169906[_0x1088('0x3d')]);return db[_0x1088('0x2d')][_0x1088('0x42')](_0x44a60d)[_0x1088('0x10')](handleEntityNotFound(_0x2d0ab1,null))[_0x1088('0x10')](respondWithResult(_0x2d0ab1,null))[_0x1088('0x1b')](handleError(_0x2d0ab1,null));};exports[_0x1088('0x43')]=function(_0x198208,_0x4090da){return db[_0x1088('0x2d')][_0x1088('0x43')](_0x198208[_0x1088('0x44')],{})[_0x1088('0x10')](function(_0xaaec7c){var _0x13dc5d=_0x198208[_0x1088('0x45')]['get']({'plain':!![]});if(!_0x13dc5d)throw new Error(_0x1088('0x46'));if(_0x13dc5d[_0x1088('0x47')]==='user'){var _0x4620aa=_0xaaec7c['get']({'plain':!![]});var _0x8e45e3='ChatWebsites';return db[_0x1088('0x48')][_0x1088('0x42')]({'where':{'name':_0x8e45e3,'userProfileId':_0x13dc5d[_0x1088('0x49')]},'raw':!![]})[_0x1088('0x10')](function(_0x271c02){if(_0x271c02&&_0x271c02['autoAssociation']===0x0){return db[_0x1088('0x26')][_0x1088('0x43')]({'name':_0x4620aa[_0x1088('0x28')],'resourceId':_0x4620aa['id'],'type':_0x271c02[_0x1088('0x28')],'sectionId':_0x271c02['id']},{})[_0x1088('0x10')](function(){return _0xaaec7c;});}else{return _0xaaec7c;}})[_0x1088('0x1b')](function(_0x59e4e9){logger[_0x1088('0x17')](_0x1088('0x4a'),_0x59e4e9);throw _0x59e4e9;});}return _0xaaec7c;})[_0x1088('0x10')](respondWithResult(_0x4090da,0xc9))['catch'](handleError(_0x4090da,null));};exports['update']=function(_0x444cef,_0x5eb041){if(_0x444cef[_0x1088('0x44')]['id']){delete _0x444cef[_0x1088('0x44')]['id'];}return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x444cef[_0x1088('0x4b')]['id']},'include':[{'model':db[_0x1088('0x2b')],'as':_0x1088('0x2c')}]})[_0x1088('0x10')](handleEntityNotFound(_0x5eb041,null))[_0x1088('0x10')](saveUpdates(_0x444cef['body'],null))[_0x1088('0x10')](respondWithResult(_0x5eb041,null))[_0x1088('0x1b')](handleError(_0x5eb041,null));};exports[_0x1088('0x4c')]=function(_0x11df5d,_0x319696){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x11df5d[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x319696,null))[_0x1088('0x10')](removeEntity(_0x319696,null))[_0x1088('0x1b')](handleError(_0x319696,null));};exports[_0x1088('0x4d')]=function(_0x326ef7,_0x491d71){return db[_0x1088('0x2d')][_0x1088('0x4d')]()[_0x1088('0x10')](respondWithResult(_0x491d71,null))[_0x1088('0x1b')](handleError(_0x491d71,null));};exports[_0x1088('0x4e')]=function(_0xdcf860,_0x5a4a7c){if(_0xdcf860['body']['id']){delete _0xdcf860['body']['id'];}return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0xdcf860['params']['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x5a4a7c,null))[_0x1088('0x10')](function(_0x519247){if(_0x519247){_0xdcf860['body'][_0x1088('0x4f')]=_0x519247['id'];return db['Disposition'][_0x1088('0x43')](_0xdcf860[_0x1088('0x44')]);}})[_0x1088('0x10')](respondWithResult(_0x5a4a7c,null))[_0x1088('0x1b')](handleError(_0x5a4a7c,null));};exports[_0x1088('0x50')]=function(_0x378af8,_0x56f462){var _0x225ca4={'raw':![],'where':{}};var _0xff5dfc={};var _0x10ec26={'count':0x0,'rows':[]};return db[_0x1088('0x2d')][_0x1088('0x51')]({'where':{'id':_0x378af8[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x56f462,null))['then'](function(_0x54d986){if(_0x54d986){_0xff5dfc[_0x1088('0x31')]=_[_0x1088('0x34')](db[_0x1088('0x52')][_0x1088('0x2e')]);_0xff5dfc[_0x1088('0x33')]=_['keys'](_0x378af8[_0x1088('0x33')]);_0xff5dfc[_0x1088('0x35')]=_['intersection'](_0xff5dfc[_0x1088('0x31')],_0xff5dfc[_0x1088('0x33')]);_0x225ca4[_0x1088('0x36')]=_['intersection'](_0xff5dfc[_0x1088('0x31')],qs[_0x1088('0x37')](_0x378af8['query'][_0x1088('0x37')]));_0x225ca4[_0x1088('0x36')]=_0x225ca4[_0x1088('0x36')][_0x1088('0x53')]?_0x225ca4[_0x1088('0x36')]:_0xff5dfc[_0x1088('0x31')];if(!_0x378af8[_0x1088('0x33')][_0x1088('0x54')]('nolimit')){_0x225ca4[_0x1088('0x20')]=qs[_0x1088('0x20')](_0x378af8[_0x1088('0x33')][_0x1088('0x20')]);_0x225ca4[_0x1088('0x1f')]=qs['offset'](_0x378af8['query']['offset']);}_0x225ca4['order']=qs[_0x1088('0x38')](_0x378af8[_0x1088('0x33')][_0x1088('0x38')]);_0x225ca4[_0x1088('0x39')]=qs[_0x1088('0x35')](_['pick'](_0x378af8[_0x1088('0x33')],_0xff5dfc[_0x1088('0x35')]));_0x225ca4[_0x1088('0x39')]['ChatWebsiteId']=_0x54d986['id'];if(_0x378af8[_0x1088('0x33')][_0x1088('0x3b')]){_0x225ca4['where']=_[_0x1088('0x3c')](_0x225ca4[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x225ca4[_0x1088('0x36')],function(_0x47ff26){var _0x56e319={};_0x56e319[_0x47ff26]={'$like':'%'+_0x378af8[_0x1088('0x33')]['filter']+'%'};return _0x56e319;})});}_0x225ca4=_[_0x1088('0x3c')]({},_0x225ca4,_0x378af8[_0x1088('0x3d')]);return db[_0x1088('0x52')]['count']({'where':_0x225ca4[_0x1088('0x39')]})[_0x1088('0x10')](function(_0x2d07ca){_0x10ec26[_0x1088('0x22')]=_0x2d07ca;if(_0x378af8[_0x1088('0x33')][_0x1088('0x3e')]){_0x225ca4[_0x1088('0x55')]=[{'all':!![]}];}return db[_0x1088('0x52')][_0x1088('0x56')](_0x225ca4);})[_0x1088('0x10')](function(_0x201406){_0x10ec26['rows']=_0x201406;return _0x10ec26;});}})['then'](respondWithFilteredResult(_0x56f462,_0x225ca4))['catch'](handleError(_0x56f462,null));};exports[_0x1088('0x57')]=function(_0x3c0062,_0x2e419f){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x3c0062['params']['id']}})['then'](handleEntityNotFound(_0x2e419f,null))['then'](function(_0x1763c9){if(_0x1763c9){return _0x1763c9[_0x1088('0x57')](_0x3c0062[_0x1088('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x2e419f,null))[_0x1088('0x1b')](handleError(_0x2e419f,null));};exports[_0x1088('0x58')]=function(_0x297e39,_0x5ac982){if(_0x297e39[_0x1088('0x44')]['id']){delete _0x297e39['body']['id'];}return db['ChatWebsite'][_0x1088('0x42')]({'where':{'id':_0x297e39['params']['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x5ac982,null))[_0x1088('0x10')](function(_0x5c7d70){if(_0x5c7d70){_0x297e39['body']['ChatWebsiteId']=_0x5c7d70['id'];return db[_0x1088('0x59')][_0x1088('0x43')](_0x297e39[_0x1088('0x44')]);}})[_0x1088('0x10')](respondWithResult(_0x5ac982,null))['catch'](handleError(_0x5ac982,null));};exports[_0x1088('0x5a')]=function(_0x38c828,_0x3378d1){var _0x4f12d7={'raw':![],'where':{}};var _0x35e415={};var _0x5ae322={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x38c828[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x3378d1,null))['then'](function(_0x48bfdd){if(_0x48bfdd){_0x35e415[_0x1088('0x31')]=_[_0x1088('0x34')](db[_0x1088('0x59')][_0x1088('0x2e')]);_0x35e415['query']=_[_0x1088('0x34')](_0x38c828[_0x1088('0x33')]);_0x35e415[_0x1088('0x35')]=_[_0x1088('0x41')](_0x35e415[_0x1088('0x31')],_0x35e415[_0x1088('0x33')]);_0x4f12d7['attributes']=_[_0x1088('0x41')](_0x35e415['model'],qs[_0x1088('0x37')](_0x38c828['query']['fields']));_0x4f12d7[_0x1088('0x36')]=_0x4f12d7['attributes'][_0x1088('0x53')]?_0x4f12d7[_0x1088('0x36')]:_0x35e415[_0x1088('0x31')];if(!_0x38c828[_0x1088('0x33')][_0x1088('0x54')](_0x1088('0x5b'))){_0x4f12d7[_0x1088('0x20')]=qs[_0x1088('0x20')](_0x38c828['query'][_0x1088('0x20')]);_0x4f12d7['offset']=qs['offset'](_0x38c828[_0x1088('0x33')]['offset']);}_0x4f12d7['order']=qs[_0x1088('0x38')](_0x38c828[_0x1088('0x33')][_0x1088('0x38')]);_0x4f12d7[_0x1088('0x39')]=qs['filters'](_[_0x1088('0x3a')](_0x38c828['query'],_0x35e415[_0x1088('0x35')]));_0x4f12d7[_0x1088('0x39')]['ChatWebsiteId']=_0x48bfdd['id'];if(_0x38c828[_0x1088('0x33')][_0x1088('0x3b')]){_0x4f12d7['where']=_[_0x1088('0x3c')](_0x4f12d7[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x4f12d7[_0x1088('0x36')],function(_0x4c53e8){var _0x3f1dc5={};_0x3f1dc5[_0x4c53e8]={'$like':'%'+_0x38c828[_0x1088('0x33')][_0x1088('0x3b')]+'%'};return _0x3f1dc5;})});}_0x4f12d7=_[_0x1088('0x3c')]({},_0x4f12d7,_0x38c828[_0x1088('0x3d')]);return db[_0x1088('0x59')][_0x1088('0x22')]({'where':_0x4f12d7[_0x1088('0x39')]})[_0x1088('0x10')](function(_0x453080){_0x5ae322[_0x1088('0x22')]=_0x453080;if(_0x38c828[_0x1088('0x33')][_0x1088('0x3e')]){_0x4f12d7['include']=[{'all':!![]}];}return db[_0x1088('0x59')]['findAll'](_0x4f12d7);})['then'](function(_0xa3290f){_0x5ae322[_0x1088('0x3f')]=_0xa3290f;return _0x5ae322;});}})['then'](respondWithFilteredResult(_0x3378d1,_0x4f12d7))[_0x1088('0x1b')](handleError(_0x3378d1,null));};exports[_0x1088('0x5c')]=function(_0x16aebc,_0x2bedea){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x16aebc[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2bedea,null))[_0x1088('0x10')](function(_0x37b042){if(_0x37b042){return _0x37b042[_0x1088('0x5c')](_0x16aebc[_0x1088('0x33')][_0x1088('0x5d')]);}})['then'](respondWithStatusCode(_0x2bedea,null))['catch'](handleError(_0x2bedea,null));};exports[_0x1088('0x5e')]=function(_0x3b08b3,_0x1bb928){_0x3b08b3[_0x1088('0x44')]['sitepic']=_0x3b08b3[_0x1088('0x5f')][_0x1088('0x60')];return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x3b08b3[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bb928,null))['then'](saveUpdates(_0x3b08b3[_0x1088('0x44')],null))[_0x1088('0x10')](respondWithResult(_0x1bb928,null))[_0x1088('0x1b')](handleError(_0x1bb928,null));};exports['addAvatar']=function(_0xa657c2,_0x3325b5){_0xa657c2['body'][_0x1088('0x61')]=_0xa657c2[_0x1088('0x5f')][_0x1088('0x60')];return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0xa657c2[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3325b5,null))[_0x1088('0x10')](saveUpdates(_0xa657c2[_0x1088('0x44')],null))[_0x1088('0x10')](respondWithResult(_0x3325b5,null))[_0x1088('0x1b')](handleError(_0x3325b5,null));};exports[_0x1088('0x62')]=function(_0xa9f644,_0x2c312e){_0xa9f644['body'][_0x1088('0x63')]=_0xa9f644[_0x1088('0x5f')][_0x1088('0x60')];return db[_0x1088('0x2d')]['find']({'where':{'id':_0xa9f644[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x2c312e,null))[_0x1088('0x10')](saveUpdates(_0xa9f644[_0x1088('0x44')],null))[_0x1088('0x10')](respondWithResult(_0x2c312e,null))[_0x1088('0x1b')](handleError(_0x2c312e,null));};exports['addSystemAvatar']=function(_0x55eb55,_0x33b236){_0x55eb55['body'][_0x1088('0x64')]=_0x55eb55['file'][_0x1088('0x60')];return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x55eb55[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x33b236,null))[_0x1088('0x10')](saveUpdates(_0x55eb55[_0x1088('0x44')],null))[_0x1088('0x10')](respondWithResult(_0x33b236,null))[_0x1088('0x1b')](handleError(_0x33b236,null));};exports[_0x1088('0x65')]=function(_0x5e6855,_0x5d1d89){var _0x506f8f=path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0x68'));var _0x1c82bd={'where':{'id':_0x5e6855[_0x1088('0x4b')]['id']},'attributes':['id',_0x1088('0x69')],'raw':!![]};var _0x55b371=![];return require('../../config/license/util')[_0x1088('0x6a')]()['then'](function(_0x4e76f2){if(_0x4e76f2){_0x55b371=_0x4e76f2[_0x1088('0x6b')];}})[_0x1088('0x10')](function(){return db[_0x1088('0x2d')][_0x1088('0x42')](_0x1c82bd);})[_0x1088('0x10')](handleEntityNotFound(_0x5d1d89,null))['then'](function(_0x296b01){if(_0x296b01){if(!_[_0x1088('0x6c')](_0x296b01[_0x1088('0x69')])){if(fs[_0x1088('0x6d')](path[_0x1088('0x66')](config[_0x1088('0x67')],'server/files/images/logos/',_0x296b01[_0x1088('0x69')]))&&_0x55b371){_0x506f8f=path['join'](config[_0x1088('0x67')],'server/files/images/logos/',_0x296b01['sitepic']);}}return _0x5d1d89[_0x1088('0x6e')](_0x506f8f);}})['catch'](handleError(_0x5d1d89,null));};exports['getAvatar']=function(_0x41edb6,_0x4558f9){var _0x30098e=path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0x6f'));var _0x4dd1d5={'where':{'id':_0x41edb6['params']['id']},'attributes':['id',_0x1088('0x61')],'raw':!![]};return db[_0x1088('0x2d')][_0x1088('0x42')](_0x4dd1d5)[_0x1088('0x10')](handleEntityNotFound(_0x4558f9,null))[_0x1088('0x10')](function(_0x3898d2){if(_0x3898d2){if(!_['isNil'](_0x3898d2[_0x1088('0x61')])){if(fs['existsSync'](path[_0x1088('0x66')](config['root'],_0x1088('0x70'),_0x3898d2[_0x1088('0x61')]))){_0x30098e=path[_0x1088('0x66')](config['root'],_0x1088('0x70'),_0x3898d2['agentAvatar']);}}return _0x4558f9[_0x1088('0x6e')](_0x30098e);}})[_0x1088('0x1b')](handleError(_0x4558f9,null));};exports[_0x1088('0x71')]=function(_0x199f08,_0xc33aaf){var _0x11b5ac=path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0x72'));var _0x441097={'where':{'id':_0x199f08[_0x1088('0x4b')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x1088('0x2d')][_0x1088('0x42')](_0x441097)[_0x1088('0x10')](handleEntityNotFound(_0xc33aaf,null))[_0x1088('0x10')](function(_0x28b679){if(_0x28b679){if(!_[_0x1088('0x6c')](_0x28b679[_0x1088('0x63')])){if(fs[_0x1088('0x6d')](path[_0x1088('0x66')](config[_0x1088('0x67')],'server/files/images/avatars/',_0x28b679[_0x1088('0x63')]))&&_0x28b679[_0x1088('0x73')]){_0x11b5ac=path[_0x1088('0x66')](config['root'],_0x1088('0x70'),_0x28b679['customerAvatar']);}}return _0xc33aaf[_0x1088('0x6e')](_0x11b5ac);}})[_0x1088('0x1b')](handleError(_0xc33aaf,null));};exports['getSystemAvatar']=function(_0x521e1c,_0x1f5038){var _0x3832d0=path[_0x1088('0x66')](config[_0x1088('0x67')],'server/files/images/avatars/system_avatar.png');var _0x48ab94={'where':{'id':_0x521e1c['params']['id']},'attributes':['id',_0x1088('0x64')],'raw':!![]};return db['ChatWebsite'][_0x1088('0x42')](_0x48ab94)[_0x1088('0x10')](handleEntityNotFound(_0x1f5038,null))[_0x1088('0x10')](function(_0x1d612e){if(_0x1d612e){if(!_['isNil'](_0x1d612e[_0x1088('0x64')])){if(fs[_0x1088('0x6d')](path['join'](config[_0x1088('0x67')],_0x1088('0x70'),_0x1d612e[_0x1088('0x64')]))){_0x3832d0=path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0x70'),_0x1d612e[_0x1088('0x64')]);}}return _0x1f5038[_0x1088('0x6e')](_0x3832d0);}})[_0x1088('0x1b')](handleError(_0x1f5038,null));};exports[_0x1088('0x74')]=function(_0x56d17a,_0x1a738e){var _0x5e9851=require('user-agent-parser');var _0x3c207d=new _0x5e9851();var _0x363d06=_0x3c207d['setUA'](_0x56d17a['headers']['user-agent'])['getResult']();var _0x4e0939={'body':_0x56d17a[_0x1088('0x44')],'channel':_0x1088('0x75')};var _0x544504=[];var _0x1d8f3b=[];var _0x586e88={};var _0x549911=![];return db[_0x1088('0x76')][_0x1088('0x4d')]()[_0x1088('0x10')](function(_0x2ab3b8){if(!_0x2ab3b8){throw new db[(_0x1088('0x77'))][(_0x1088('0x78'))](_0x1088('0x79'));}_0x544504=_[_0x1088('0x7a')](_['keys'](_0x2ab3b8),[_0x1088('0x7b'),'updatedAt']);_0x1d8f3b=_[_0x1088('0x7a')](_[_0x1088('0x34')](_0x2ab3b8),[_0x1088('0x7b'),_0x1088('0x7c'),_0x1088('0x7d'),_0x1088('0x7e')]);if(_0x56d17a['body']['id']){delete _0x56d17a[_0x1088('0x44')]['id'];}if(_[_0x1088('0x6c')](_0x56d17a['body'][_0x1088('0x7f')])){throw new db[(_0x1088('0x77'))]['ValidationError'](_0x1088('0x80'));}if(_[_0x1088('0x6c')](_0x56d17a[_0x1088('0x44')][_0x1088('0x44')])||_0x56d17a[_0x1088('0x44')]['body']===''){throw new db[(_0x1088('0x77'))]['ValidationError'](_0x1088('0x81'));}if(_['isNil'](_0x56d17a[_0x1088('0x44')][_0x1088('0x82')])){throw new db[(_0x1088('0x77'))][(_0x1088('0x78'))](_0x1088('0x83')+_0x1d8f3b);}if(!_[_0x1088('0x84')](_0x1d8f3b,_0x56d17a[_0x1088('0x44')]['mapKey'])){throw new db[(_0x1088('0x77'))][(_0x1088('0x78'))](_0x1088('0x85')+_0x1d8f3b);}_0x586e88[_0x56d17a[_0x1088('0x44')][_0x1088('0x82')]]=_0x56d17a['body'][_0x1088('0x7f')];})['then'](function(){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x56d17a[_0x1088('0x4b')]['id']},'include':[{'model':db[_0x1088('0x86')],'as':_0x1088('0x87'),'include':[{'model':db[_0x1088('0x76')],'as':_0x1088('0x88'),'where':_0x586e88,'limit':0x1,'order':[[_0x1088('0x7c'),'DESC']]}]},{'model':db[_0x1088('0x89')],'as':_0x1088('0x8a')}]});})[_0x1088('0x10')](handleEntityNotFound(_0x1a738e,null))[_0x1088('0x10')](function(_0xe75346){if(_0xe75346&&_0xe75346[_0x1088('0x87')]){_0x4e0939[_0x1088('0x8b')]=_0xe75346;_0x4e0939['applications']=_0xe75346[_0x1088('0x8a')];_0x4e0939['list']=_0xe75346[_0x1088('0x87')];_0x4e0939[_0x1088('0x8c')]=_[_0x1088('0x8d')](_0x4e0939['applications'],[_0x1088('0x8e')],['asc']);if(_0x4e0939[_0x1088('0x8b')][_0x1088('0x8a')]){delete _0x4e0939[_0x1088('0x8b')][_0x1088('0x8a')];}if(_0x4e0939[_0x1088('0x8b')]['List']&&_0x4e0939[_0x1088('0x8b')][_0x1088('0x87')][_0x1088('0x88')][_0x1088('0x53')]){return _0x4e0939[_0x1088('0x8b')][_0x1088('0x87')]['Contacts'][0x0];}var _0xb18cd7=_[_0x1088('0x8f')](_0x56d17a[_0x1088('0x44')],{'firstName':_0x56d17a[_0x1088('0x44')][_0x1088('0x7f')],'ListId':_0xe75346[_0x1088('0x7e')]});_0xb18cd7[_0x56d17a[_0x1088('0x44')][_0x1088('0x82')]]=_0x56d17a[_0x1088('0x44')][_0x1088('0x7f')];return db[_0x1088('0x76')][_0x1088('0x43')](_0xb18cd7,{'fields':_0x544504,'raw':!![]});}})[_0x1088('0x10')](handleEntityNotFound(_0x1a738e,null))['then'](function(_0x1784f8){_0x4e0939[_0x1088('0x90')]=_0x1784f8;var _0x36ae92=_0x56d17a[_0x1088('0x44')][_0x1088('0x91')];if(_0x56d17a[_0x1088('0x92')][_0x1088('0x93')]){_0x36ae92=_0x56d17a[_0x1088('0x92')]['cf-connecting-ip'];}else if(_0x56d17a[_0x1088('0x92')]['x-forwarded-for']){_0x36ae92=_[_0x1088('0x94')](_0x56d17a[_0x1088('0x92')]['x-forwarded-for'][_0x1088('0x95')](','));}if(_0x1784f8){var _0x5d02a2={'ContactId':_0x1784f8['id'],'ChatWebsiteId':_0x56d17a[_0x1088('0x4b')]['id'],'from':(_0x1784f8[_0x1088('0x96')]||'')+'\x20'+(_0x1784f8[_0x1088('0x97')]||''),'customerIp':_0x36ae92,'customerPort':_0x56d17a[_0x1088('0x92')]['x-real-port']?_0x56d17a[_0x1088('0x92')][_0x1088('0x98')]:null,'referer':_0x56d17a['body'][_0x1088('0x99')],'browserName':_0x363d06[_0x1088('0x9a')][_0x1088('0x28')]&&_0x363d06[_0x1088('0x9a')][_0x1088('0x9b')]?util[_0x1088('0x9c')](_0x1088('0x9d'),_0x363d06[_0x1088('0x9a')][_0x1088('0x28')],_0x363d06[_0x1088('0x9a')]['version']):'unknown','browserVersion':_0x363d06[_0x1088('0x9a')][_0x1088('0x9b')]||_0x1088('0x9e'),'osName':util['format'](_0x1088('0x9d'),_0x363d06['os'][_0x1088('0x28')],_0x363d06['os'][_0x1088('0x9b')]),'osVersion':_0x363d06['os'][_0x1088('0x9b')],'deviceModel':_0x363d06[_0x1088('0x9f')][_0x1088('0x31')]&&_0x363d06[_0x1088('0x9f')][_0x1088('0xa0')]?util[_0x1088('0x9c')](_0x1088('0xa1'),_0x363d06[_0x1088('0x9f')][_0x1088('0x31')],_0x363d06[_0x1088('0x9f')][_0x1088('0xa0')],_0x363d06[_0x1088('0x9f')][_0x1088('0x30')]):null,'deviceVendor':_0x363d06['device'][_0x1088('0xa0')],'deviceType':_0x363d06[_0x1088('0x9f')][_0x1088('0x30')],'formData':JSON[_0x1088('0x16')](_0x56d17a[_0x1088('0x44')])};var _0x144dcb={'ChatWebsiteId':_0x56d17a[_0x1088('0x4b')]['id'],'closed':![]};if(_0x56d17a[_0x1088('0x44')][_0x1088('0xa2')]){_0x144dcb[_0x1088('0xa2')]=_0x56d17a['body'][_0x1088('0xa2')];return db[_0x1088('0xa3')]['find']({'where':_0x144dcb})['then'](function(_0x198f36){if(_0x198f36){return[_0x198f36,![]];}_0x5d02a2['threadId']=_0x56d17a[_0x1088('0x44')][_0x1088('0xa2')];_0x5d02a2[_0x1088('0xa4')]=_0x56d17a['body']['externalUrl'];return db[_0x1088('0xa3')][_0x1088('0x43')](_0x5d02a2)[_0x1088('0x10')](function(_0x2cfcb8){return[_0x2cfcb8,!![]];});});}_0x144dcb['ContactId']=_0x1784f8['id'];if(_0x56d17a[_0x1088('0x44')][_0x1088('0xa5')]&&_0x56d17a[_0x1088('0x44')][_0x1088('0xa5')]['id']){_0x144dcb['id']=_0x56d17a[_0x1088('0x44')][_0x1088('0xa5')]['id'];return db['ChatInteraction']['find']({'where':_0x144dcb})[_0x1088('0x10')](function(_0x19781f){if(_0x19781f){return[_0x19781f,![]];}return db[_0x1088('0xa3')]['create'](_0x5d02a2)[_0x1088('0x10')](function(_0x54321c){return[_0x54321c,!![]];});});}return db[_0x1088('0xa3')]['create'](_0x5d02a2)[_0x1088('0x10')](function(_0x5d577a){return[_0x5d577a,!![]];});}})[_0x1088('0xa6')](function(_0x23ce19,_0x2555db){if(_0x23ce19){_0x549911=_0x2555db;if(!_0x2555db){var _0x15b02a={'from':(_0x4e0939[_0x1088('0x90')][_0x1088('0x96')]||'')+'\x20'+(_0x4e0939[_0x1088('0x90')][_0x1088('0x97')]||'')};if(_0x56d17a[_0x1088('0x44')]['threadId']&&_0x56d17a[_0x1088('0x44')][_0x1088('0xa7')]&&_0x56d17a[_0x1088('0x44')][_0x1088('0xa2')]!=_0x56d17a[_0x1088('0x44')][_0x1088('0xa7')]){_0x15b02a[_0x1088('0xa2')]=_0x56d17a[_0x1088('0x44')][_0x1088('0xa7')];}return _0x23ce19[_0x1088('0x24')](_0x15b02a);}else{return _0x23ce19;}}})[_0x1088('0x10')](function(_0x1b14ea){_0x4e0939['interaction']=_0x1b14ea[_0x1088('0xa8')]({'plain':!![]});_0x4e0939['interaction'][_0x1088('0xa9')]=_0x549911;if(_0x4e0939['interaction'][_0x1088('0xa9')]){if(_0x4e0939['account'][_0x1088('0xaa')]){_0x4e0939[_0x1088('0x8c')][_0x1088('0xab')]({'id':0x0,'priority':_0x4e0939[_0x1088('0x8c')]['length']+0x1,'app':_0x1088('0xac'),'appdata':_0x1088('0xad'),'interval':_0x1088('0xae')});}}return db[_0x1088('0xaf')][_0x1088('0x43')]({'body':_0x56d17a[_0x1088('0x44')][_0x1088('0x44')],'ChatWebsiteId':_0x56d17a[_0x1088('0x4b')]['id'],'ChatInteractionId':_0x1b14ea['id'],'direction':'in','ContactId':_0x4e0939[_0x1088('0x90')]['id'],'AttachmentId':_0x56d17a[_0x1088('0x44')]['AttachmentId']});})[_0x1088('0x10')](function(_0x58595d){_0x4e0939['message']=_0x58595d;if(_0x4e0939[_0x1088('0xa5')][_0x1088('0xb0')]){return db[_0x1088('0xb1')][_0x1088('0x42')]({'attributes':['id',_0x1088('0x28')],'where':{'id':_0x4e0939[_0x1088('0xa5')][_0x1088('0xb0')]}})[_0x1088('0x10')](function(_0x34e57c){if(_0x34e57c){_0x4e0939[_0x1088('0x8c')][_0x1088('0xb2')]({'id':0x0,'priority':0x0,'app':_0x1088('0xb3'),'appdata':_0x34e57c['name']+','+(_0x4e0939[_0x1088('0x8b')][_0x1088('0xb4')]||0xa),'interval':'*,*,*,*'});_0x4e0939['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1088('0xb5'),_0x1088('0xb6'),_0x4e0939);});}return respondWithRpcPromise(_0x1088('0xb5'),_0x1088('0xb6'),_0x4e0939);})[_0x1088('0x10')](function(_0x481706){respondWithRpcPromise(_0x1088('0xb7'),_0x1088('0xb7'),{'event':_0x1088('0x74'),'message':_0x481706},client9002);return _0x481706;})[_0x1088('0x10')](respondWithResult(_0x1a738e,null))['catch'](handleError(_0x1a738e,null));};exports[_0x1088('0xb8')]=function(_0x22f445,_0x243966){var _0x93b109,_0x4e41f1,_0x210db2;var _0x1a1a08=[];var _0x15d05b={};var _0x1c97b4=_0x22f445['files']||[];var _0x294678=[];var _0x3345d9;return db[_0x1088('0x76')]['describe']()[_0x1088('0x10')](function(_0x28af80){if(!_0x28af80){throw new db['Sequelize']['ValidationError'](_0x1088('0x79'));}_0x1a1a08=_['difference'](_['keys'](_0x28af80),[_0x1088('0x7b'),_0x1088('0x7c'),_0x1088('0x7d'),'ListId']);if(_0x22f445[_0x1088('0x44')]['id']){delete _0x22f445[_0x1088('0x44')]['id'];}if(_[_0x1088('0x6c')](_0x22f445[_0x1088('0x44')]['from'])){throw _0x243966[_0x1088('0x1c')](0x1f4)[_0x1088('0x29')](new db[(_0x1088('0x77'))][(_0x1088('0x78'))](_0x1088('0x80')));}if(_[_0x1088('0x6c')](_0x22f445[_0x1088('0x44')][_0x1088('0x44')])||_0x22f445[_0x1088('0x44')]['body']===''){throw _0x243966[_0x1088('0x1c')](0x1f4)[_0x1088('0x29')](new db[(_0x1088('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1088('0x6c')](_0x22f445[_0x1088('0x44')][_0x1088('0xb9')])){throw _0x243966[_0x1088('0x1c')](0x1f4)[_0x1088('0x29')](new db['Sequelize'][(_0x1088('0x78'))](_0x1088('0xba')+_0x1a1a08));}if(!_[_0x1088('0x84')](_0x1a1a08,_0x22f445[_0x1088('0x44')]['mapKeyOffline'])){throw _0x243966['status'](0x1f4)['send'](new db[(_0x1088('0x77'))][(_0x1088('0x78'))](_0x1088('0xbb')+_0x1a1a08));}_0x15d05b[_0x22f445[_0x1088('0x44')][_0x1088('0xb9')]]=_0x22f445[_0x1088('0x44')][_0x1088('0x7f')];})[_0x1088('0x10')](function(){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x22f445[_0x1088('0x4b')]['id']},'include':[{'model':db[_0x1088('0x86')],'as':_0x1088('0x87')},{'model':db[_0x1088('0xbc')],'as':'MailAccount'}]});})[_0x1088('0x10')](handleEntityNotFound(_0x243966,null))[_0x1088('0x10')](function(_0x4e8de9){if(_0x4e8de9&&_0x4e8de9[_0x1088('0x87')]){_0x4e41f1=_0x4e8de9;var _0x3fce25=_[_0x1088('0x8f')](_0x22f445[_0x1088('0x44')],{'firstName':_0x22f445[_0x1088('0x44')][_0x1088('0x7f')],'phone':_0x22f445[_0x1088('0x44')][_0x1088('0x7f')],'ListId':_0x4e8de9[_0x1088('0x7e')]});_0x3fce25[_0x22f445[_0x1088('0x44')][_0x1088('0xb9')]]=_0x22f445['body'][_0x1088('0x7f')];return db['CmContact'][_0x1088('0xbd')]({'where':_0x15d05b,'defaults':_0x3fce25});}})[_0x1088('0xa6')](function(_0xcfb3ce){if(_0xcfb3ce){_0x210db2=_0xcfb3ce;var _0x59820b=fs[_0x1088('0xbe')](path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0xbf')),_0x1088('0xc0'));var _0x285e08=ejs['render'](_0x59820b,{'body':_[_0x1088('0xc1')](_0x22f445[_0x1088('0x44')][_0x1088('0x44')]),'bodyTitle':_0x4e41f1['offlineMessageBody']});return db['ChatOfflineMessage'][_0x1088('0x43')]({'body':_0x285e08,'plainBody':htmlToText[_0x1088('0xc2')](_0x285e08),'ContactId':_0xcfb3ce['id'],'ChatWebsiteId':_0x4e41f1['id']});}})[_0x1088('0x10')](function(_0x1f31b3){_0x3345d9=_0x1f31b3;if(_0x1c97b4['length']){var _0x676424=_0x1c97b4[_0x1088('0x32')](function(_0x2fc78f){return{'name':_0x2fc78f[_0x1088('0xc3')],'basename':_0x2fc78f[_0x1088('0x60')],'type':_0x2fc78f[_0x1088('0xc4')],'ChatOfflineMessageId':_0x1f31b3['id']};});_0x294678=_0x676424['map'](_0x5d6be8=>{var _0x39ec06={'filename':_0x5d6be8[_0x1088('0x28')],'path':path[_0x1088('0x66')](config[_0x1088('0x67')],_0x1088('0xc5'),_0x1088('0xc6'),_0x1088('0xc7'),'offline-chat',_0x5d6be8[_0x1088('0xc8')])};return _0x39ec06;});if(!_0x4e41f1['openNewInteraction']){return db[_0x1088('0xc9')][_0x1088('0xca')](function(_0x2a50aa){return db[_0x1088('0xcb')][_0x1088('0xcc')](_0x676424,{'transaction':_0x2a50aa});});}}})[_0x1088('0x10')](function(){if(_0x3345d9){_0x93b109=_0x3345d9;return db['MailAccount'][_0x1088('0x51')]({'where':{'active':!![]},'include':[{'model':db[_0x1088('0xcd')],'as':_0x1088('0xce'),'raw':!![],'include':[{'model':db[_0x1088('0xcf')],'as':_0x1088('0xcf'),'raw':!![]}]}]});}})['then'](function(_0x5cf863){if(_0x5cf863&&_0x5cf863[_0x1088('0xce')]&&_0x4e41f1[_0x1088('0xd0')]&&_0x4e41f1['forwardOfflineAddress']){var _0x1bf7d7=_0x5cf863[_0x1088('0xd1')]();return respondWithRpcPromise('SendMail',_0x1088('0xd2'),{'account':_0x1bf7d7,'message':{'from':util[_0x1088('0x9c')](_0x1088('0xd3'),_0x5cf863['name'],_0x5cf863[_0x1088('0xd4')]||_0x5cf863[_0x1088('0xce')]['user']),'to':_0x4e41f1[_0x1088('0xd5')],'subject':_0x4e41f1['offlineMessageSubject'],'html':_0x93b109[_0x1088('0x44')],'attachments':_0x294678}},client9003)[_0x1088('0x10')](function(){return _0x93b109;})[_0x1088('0x1b')](function(_0x290408){logger[_0x1088('0x17')](_0x290408);});}})[_0x1088('0x10')](function(){if(_0x4e41f1&&_0x4e41f1[_0x1088('0xd6')]&&_0x4e41f1[_0x1088('0xd7')]){var _0x4a64f9=[];if(_0x1c97b4[_0x1088('0x53')]){_0x4a64f9=_0x1c97b4[_0x1088('0x32')](function(_0xff59ca){return{'name':_0xff59ca[_0x1088('0xc3')],'basename':_0xff59ca[_0x1088('0x60')],'type':_0xff59ca['mimetype'],'ChatOfflineMessageId':_0x3345d9['id']};});}var _0x396d08;if(!_[_0x1088('0x6c')](_0x4e41f1['subjectOffline'])){var _0x195105=_[_0x1088('0x32')](_0x22f445[_0x1088('0x44')],function(_0x3cd5ec){return _0x3cd5ec;});var _0x4466b9=_[_0x1088('0xd8')](_0x195105)[0x0];var _0x4062b0=_[_0x1088('0xd9')](_0x4466b9,function(_0x566b78){return _0x566b78;});_0x396d08=_0x4062b0[0x1][_0x4e41f1[_0x1088('0xda')]];}var _0x3593c3={'from':_0x210db2['email'],'firstName':_0x210db2[_0x1088('0x96')],'lastName':_0x210db2[_0x1088('0x97')],'mapKey':_0x1088('0xd4'),'message':{'from':_0x210db2['email'],'to':_0x4e41f1[_0x1088('0xbc')][_0x1088('0xd4')],'cc':'','subject':_['isNil'](_0x396d08)?_0x4e41f1[_0x1088('0xdb')]:_0x396d08,'messageId':'','sentAt':new Date(),'attach':_0x4a64f9['length'],'attachments':_0x4a64f9,'originChannel':_0x1088('0xdc'),'ChatWebsiteId':_0x4e41f1['id'],'ChatOfflineMessageId':_0x93b109['id'],'originTo':_0x4e41f1[_0x1088('0xbc')][_0x1088('0xd4')]},'body':_0x93b109[_0x1088('0x44')]};var _0x21861b={'account':{'id':_0x4e41f1[_0x1088('0xd7')]},'body':_0x3593c3,'log':_0x1088('0xdd')};return respondWithRpcPromise(_0x1088('0xdd'),_0x1088('0xde'),_0x21861b,client9001)[_0x1088('0x10')](function(){return _0x93b109;})[_0x1088('0x1b')](function(_0x4d9e44){logger[_0x1088('0x17')](_0x4d9e44);});}return;})['then'](function(){if(_0x93b109){return _0x93b109;}})[_0x1088('0x10')](respondWithResult(_0x243966,null))[_0x1088('0x1b')](function(_0x9aabd4){logger[_0x1088('0x17')](_0x1088('0x1b'),_0x9aabd4);for(var _0x82f9b8 of _0x1c97b4){var _0x28f2fa=path[_0x1088('0x66')](config['root'],_0x1088('0xc5'),'files',_0x1088('0xc7'),_0x1088('0xdf'),_0x82f9b8[_0x1088('0x60')]);fs_extra['remove'](_0x28f2fa)[_0x1088('0x1b')](function(_0x5cb7ee){logger[_0x1088('0x17')](_0x1088('0xe0'),_0x28f2fa,_0x5cb7ee);});}});};exports[_0x1088('0xe1')]=function(_0x468c08,_0x499a92){return db[_0x1088('0xa3')][_0x1088('0x42')]({'where':{'id':_0x468c08['params']['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x499a92,null))[_0x1088('0x10')](function(_0x37417f){if(_0x37417f){return _0x37417f[_0x1088('0xe1')](_0x468c08['body'][_0x1088('0x5d')],_[_0x1088('0xe2')](_0x468c08[_0x1088('0x44')],['ids','id'])||{});}})[_0x1088('0x10')](respondWithResult(_0x499a92,null))[_0x1088('0x1b')](handleError(_0x499a92,null));};exports[_0x1088('0xe3')]=function(_0x28e4e7,_0x183da1){var _0x3a2217={'raw':![],'where':{}};var _0x1f2655={};var _0x1949d3={'count':0x0,'rows':[]};return db[_0x1088('0x2d')][_0x1088('0x51')]({'where':{'id':_0x28e4e7[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x183da1,null))[_0x1088('0x10')](function(_0x3ed31){if(_0x3ed31){_0x1f2655[_0x1088('0x31')]=_[_0x1088('0x34')](db[_0x1088('0xa3')][_0x1088('0x2e')]);_0x1f2655['query']=_[_0x1088('0x34')](_0x28e4e7[_0x1088('0x33')]);_0x1f2655['filters']=_[_0x1088('0x41')](_0x1f2655[_0x1088('0x31')],_0x1f2655[_0x1088('0x33')]);_0x3a2217[_0x1088('0x36')]=_[_0x1088('0x41')](_0x1f2655[_0x1088('0x31')],qs[_0x1088('0x37')](_0x28e4e7[_0x1088('0x33')][_0x1088('0x37')]));_0x3a2217[_0x1088('0x36')]=_0x3a2217[_0x1088('0x36')][_0x1088('0x53')]?_0x3a2217[_0x1088('0x36')]:_0x1f2655['model'];if(!_0x28e4e7[_0x1088('0x33')][_0x1088('0x54')](_0x1088('0x5b'))){_0x3a2217[_0x1088('0x20')]=qs[_0x1088('0x20')](_0x28e4e7[_0x1088('0x33')][_0x1088('0x20')]);_0x3a2217[_0x1088('0x1f')]=qs[_0x1088('0x1f')](_0x28e4e7[_0x1088('0x33')][_0x1088('0x1f')]);}_0x3a2217[_0x1088('0xe4')]=qs[_0x1088('0x38')](_0x28e4e7['query']['sort']);_0x3a2217[_0x1088('0x39')]=qs[_0x1088('0x35')](_[_0x1088('0x3a')](_0x28e4e7['query'],_0x1f2655[_0x1088('0x35')]));_0x3a2217[_0x1088('0x39')][_0x1088('0x4f')]=_0x3ed31['id'];if(_0x28e4e7[_0x1088('0x33')][_0x1088('0x3b')]){_0x3a2217[_0x1088('0x39')]=_[_0x1088('0x3c')](_0x3a2217[_0x1088('0x39')],{'$or':_['map'](_0x3a2217['attributes'],function(_0x3f9552){var _0x9b51c6={};_0x9b51c6[_0x3f9552]={'$like':'%'+_0x28e4e7[_0x1088('0x33')]['filter']+'%'};return _0x9b51c6;})});}_0x3a2217=_[_0x1088('0x3c')]({},_0x3a2217,_0x28e4e7[_0x1088('0x3d')]);return db[_0x1088('0xa3')][_0x1088('0x22')]({'where':_0x3a2217[_0x1088('0x39')]})['then'](function(_0x4a39a6){_0x1949d3['count']=_0x4a39a6;if(_0x28e4e7['query'][_0x1088('0x3e')]){_0x3a2217[_0x1088('0x55')]=[{'model':db[_0x1088('0x76')],'as':_0x1088('0xe5'),'required':![]},{'model':db[_0x1088('0xb1')],'as':_0x1088('0xe6'),'attributes':[_0x1088('0x28'),_0x1088('0xe7'),_0x1088('0xe8')],'required':![]},{'model':db[_0x1088('0xe9')],'as':_0x1088('0xea'),'attributes':['id',_0x1088('0x28'),_0x1088('0xeb')],'where':_0x28e4e7[_0x1088('0x33')][_0x1088('0xec')]?{'id':_0x28e4e7[_0x1088('0x33')]['tag']}:undefined,'required':_0x28e4e7[_0x1088('0x33')][_0x1088('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x1088('0x56')](_0x3a2217);})[_0x1088('0x10')](function(_0x277cc6){_0x1949d3[_0x1088('0x3f')]=_0x277cc6;return _0x1949d3;});}})[_0x1088('0x10')](respondWithFilteredResult(_0x183da1,_0x3a2217))[_0x1088('0x1b')](handleError(_0x183da1,null));};function iftimePromise(_0x36d8c3,_0x1cc0e2){return respondWithRpcPromise('Command',_0x1088('0xed'),{'command':_0x1cc0e2[_0x1088('0xee')]?util[_0x1088('0x9c')]('iftime\x20%s,%s',_0x36d8c3[_0x1088('0xef')],_0x1cc0e2['timezone']):util[_0x1088('0x9c')](_0x1088('0xf0'),_0x36d8c3[_0x1088('0xef')])},client9002)['then'](function(_0x3f07be){var _0x157587=_0x3f07be&&_0x3f07be[_0x1088('0xf1')](_0x1088('0xf2'))>=0x0?!![]:![];logger[_0x1088('0x11')](_0x1088('0xf3'),_0x1cc0e2['id'],_0x36d8c3['id'],_0x36d8c3[_0x1088('0xef')],_0x157587?_0x1088('0xf4'):_0x1088('0xf5'),_0x1cc0e2[_0x1088('0xee')]?_0x1cc0e2[_0x1088('0xee')]:_0x1088('0xf6'));return _0x157587;})['catch'](function(_0xcb227){logger[_0x1088('0x17')](_0x1088('0xf3'),_0x1cc0e2['id'],_0x36d8c3['id'],_0x36d8c3[_0x1088('0xef')],util[_0x1088('0xf7')](_0xcb227,{'showHidden':![],'depth':null}),_0x1cc0e2[_0x1088('0xee')]?_0x1cc0e2['timezone']:_0x1088('0xf6'));return![];});}exports[_0x1088('0xed')]=function(_0xee506f,_0x2c4d83){var _0x4a5886=0x0;var _0x49b18d=0x0;var _0x5681c9=![];var _0x3735df;var _0x35b42a;return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0xee506f[_0x1088('0x4b')]['id']},'include':[{'model':db[_0x1088('0xf8')],'as':_0x1088('0xf8'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x1088('0xef')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2c4d83,null))[_0x1088('0x10')](function(_0x4b5386){if(_0x4b5386){_0x3735df=_0x4b5386;return _0x4b5386[_0x1088('0xf9')]({'raw':!![]});}})[_0x1088('0x10')](function(_0xfe582a){if(_0x3735df){if(_0xfe582a){_0x35b42a=_0xfe582a;}}return require(_0x1088('0xfa'))[_0x1088('0x6a')]();})[_0x1088('0x10')](function(_0x350c1a){if(_0x350c1a){_0x49b18d=_0x350c1a[_0x1088('0xfb')];_0x5681c9=_0x350c1a[_0x1088('0x6b')];}})[_0x1088('0x10')](function(){return db[_0x1088('0xa3')][_0x1088('0x22')]({'where':{'closed':![]}});})[_0x1088('0x10')](function(_0x3df388){_0x4a5886=_0x3df388;if(_0x49b18d&&_0x3df388>_0x49b18d){return db[_0x1088('0xfc')][_0x1088('0x51')]({'where':{'id':0x1}})[_0x1088('0x10')](function(_0x4c72c3){if(_0x4c72c3){_0x4c72c3['increment']('chatLicenseExceeded');}});}})[_0x1088('0x10')](function(){if(_0x3735df['Interval']&&_0x3735df[_0x1088('0xf8')][_0x1088('0xfd')]){var _0x5c4c4f=[];for(var _0x3017f9=0x0;_0x3017f9<_0x3735df['Interval'][_0x1088('0xfd')][_0x1088('0x53')];_0x3017f9++){var _0x1d66a5=_0x3735df[_0x1088('0xf8')]['Intervals'][_0x3017f9][_0x1088('0xa8')]({'plain':!![]});_0x5c4c4f['push'](iftimePromise(_0x1d66a5,_0x3735df));}return BPromise['all'](_0x5c4c4f)['then'](function(_0x5f38ee){return _[_0x1088('0xfe')](_0x5f38ee);});}else{return!![];}})[_0x1088('0x10')](function(_0xf65fa4){var _0x37bfb5=fs[_0x1088('0xbe')](path['join'](config[_0x1088('0x67')],_0x1088('0xff')),_0x1088('0xc0'));var _0x2ea69e={'remote':_0x3735df[_0x1088('0x100')],'query':querystring[_0x1088('0x16')](_[_0x1088('0x3c')](_0x3735df[_0x1088('0xa8')]({'plain':!![]}),{'customerIp':_0xee506f[_0x1088('0x92')][_0x1088('0x101')]||_0xee506f[_0x1088('0x92')][_0x1088('0x102')]||_0xee506f[_0x1088('0x103')][_0x1088('0x104')]||_0xee506f['ip'],'referer':_0xee506f['headers'][_0x1088('0x99')],'openedInteractions':_0x4a5886,'maxInteractions':_0x49b18d,'virtual':_0x5681c9[_0x1088('0xfb')],'online':_0xf65fa4,'custom':_0x5681c9}))[_0x1088('0x105')](/'/g,'\x5c\x27')};_0x2c4d83[_0x1088('0x29')](ejs[_0x1088('0x106')](Mustache[_0x1088('0x106')](_0x37bfb5,_0x2ea69e),{'proactiveActions':_0x35b42a,'alignment':_0x3735df[_0x1088('0x107')],'verticalAlignment':_0x3735df['verticalAlignment'],'div_color':_0x3735df[_0x1088('0xeb')],'labelText':_0x3735df[_0x1088('0x108')],'text_color':_0x3735df[_0x1088('0x109')],'button_color':_0x3735df[_0x1088('0x10a')],'background_color':_0x3735df['backgroundColor'],'hideWhenOffline':_0x3735df[_0x1088('0x10b')],'interval':_0x3735df['IntervalId']}));})[_0x1088('0x1b')](handleError(_0x2c4d83,null));};exports[_0x1088('0x10c')]=function(_0x26b727,_0x3197a2){var _0x5659db=_0x26b727[_0x1088('0x4b')]['id'];var _0x705056=_0x26b727['body'];var _0x33cde3=0xc8;var _0x3643f0=null;return db[_0x1088('0xc9')][_0x1088('0xca')]({'isolationLevel':db[_0x1088('0xc9')][_0x1088('0x10d')][_0x1088('0x10e')]['READ_COMMITTED']},function(_0x45266b){return db[_0x1088('0x2d')][_0x1088('0x51')]({'where':{'id':_0x5659db},'transaction':_0x45266b})[_0x1088('0x10')](function(_0x4de501){if(_0x4de501){return db[_0x1088('0x89')][_0x1088('0x4c')]({'where':{'ChatWebsiteId':_0x5659db},'transaction':_0x45266b})[_0x1088('0x10')](function(){var _0x109f86=_[_0x1088('0x32')](_0x705056,function(_0x4fde7b){_0x4fde7b[_0x1088('0x4f')]=_0x5659db;return _0x4fde7b;});return db[_0x1088('0x89')]['bulkCreate'](_0x109f86,{'transaction':_0x45266b});});}else{_0x33cde3=0x194;_0x3643f0=[];}});})[_0x1088('0x10')](function(){if(_0x33cde3!==0x194){return db[_0x1088('0x89')][_0x1088('0x10f')]({'where':{'ChatWebsiteId':_0x5659db},'order':_0x1088('0x8e')})[_0x1088('0x10')](function(_0x145611){_0x3643f0=_0x145611;});}})[_0x1088('0x1b')](function(_0x4696ae){_0x33cde3=0x1f4;logger[_0x1088('0x17')](_0x4696ae[_0x1088('0x27')]);if(_0x4696ae[_0x1088('0x28')]){delete _0x4696ae[_0x1088('0x28')];}_0x3643f0=_0x4696ae;})[_0x1088('0x110')](function(){if(_0x3643f0===null){_0x3197a2['sendStatus'](_0x33cde3);}else{if(_0x33cde3===0x1f4){_0x3197a2[_0x1088('0x1c')](_0x33cde3)['send'](_0x3643f0);}else{_0x3197a2[_0x1088('0x1c')](_0x33cde3)[_0x1088('0x1e')](_0x3643f0);}}});};exports[_0x1088('0x111')]=function(_0x1fabce,_0x3a841b){var _0x22d98d={};var _0x4110a6={};var _0x290ef4;var _0xa2683;return db[_0x1088('0x2d')][_0x1088('0x51')]({'where':{'id':_0x1fabce[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x3a841b,null))[_0x1088('0x10')](function(_0x30199d){if(_0x30199d){_0x290ef4=_0x30199d;_0x4110a6[_0x1088('0x31')]=_[_0x1088('0x34')](db['ChatApplication']['rawAttributes']);_0x4110a6['query']=_[_0x1088('0x34')](_0x1fabce[_0x1088('0x33')]);_0x4110a6[_0x1088('0x35')]=_['intersection'](_0x4110a6['model'],_0x4110a6[_0x1088('0x33')]);_0x22d98d[_0x1088('0x36')]=_['intersection'](_0x4110a6[_0x1088('0x31')],qs[_0x1088('0x37')](_0x1fabce[_0x1088('0x33')][_0x1088('0x37')]));_0x22d98d[_0x1088('0x36')]=_0x22d98d[_0x1088('0x36')][_0x1088('0x53')]?_0x22d98d[_0x1088('0x36')]:_0x4110a6[_0x1088('0x31')];_0x22d98d[_0x1088('0xe4')]=qs[_0x1088('0x38')](_0x1fabce[_0x1088('0x33')][_0x1088('0x38')]);_0x22d98d[_0x1088('0x39')]=qs['filters'](_[_0x1088('0x3a')](_0x1fabce[_0x1088('0x33')],_0x4110a6['filters']));if(_0x1fabce[_0x1088('0x33')][_0x1088('0x3b')]){_0x22d98d[_0x1088('0x39')]=_['merge'](_0x22d98d[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x22d98d[_0x1088('0x36')],function(_0x1b2f15){var _0x5a306a={};_0x5a306a[_0x1b2f15]={'$like':'%'+_0x1fabce[_0x1088('0x33')][_0x1088('0x3b')]+'%'};return _0x5a306a;})});}_0x22d98d=_['merge']({},_0x22d98d,_0x1fabce[_0x1088('0x3d')]);return _0x290ef4[_0x1088('0x111')](_0x22d98d);}})[_0x1088('0x10')](function(_0x21e28f){if(_0x21e28f){_0xa2683=_0x21e28f['length'];if(!_0x1fabce[_0x1088('0x33')][_0x1088('0x54')](_0x1088('0x5b'))){_0x22d98d[_0x1088('0x20')]=qs[_0x1088('0x20')](_0x1fabce[_0x1088('0x33')][_0x1088('0x20')]);_0x22d98d[_0x1088('0x1f')]=qs[_0x1088('0x1f')](_0x1fabce[_0x1088('0x33')]['offset']);}return _0x290ef4[_0x1088('0x111')](_0x22d98d);}})[_0x1088('0x10')](function(_0x27f938){if(_0x27f938){return _0x27f938?{'count':_0xa2683,'rows':_0x27f938}:null;}})[_0x1088('0x10')](respondWithResult(_0x3a841b,null))[_0x1088('0x1b')](handleError(_0x3a841b,null));};exports[_0x1088('0x112')]=function(_0x46ca78,_0x426740){return db[_0x1088('0x113')][_0x1088('0x42')]({'where':{'id':_0x46ca78[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x426740,null))['then'](function(_0x5d9771){if(_0x5d9771){return _0x5d9771[_0x1088('0x112')](_0x46ca78[_0x1088('0x44')][_0x1088('0x5d')],_['omit'](_0x46ca78[_0x1088('0x44')],[_0x1088('0x5d'),'id'])||{});}})[_0x1088('0x10')](respondWithResult(_0x426740,null))[_0x1088('0x1b')](handleError(_0x426740,null));};exports[_0x1088('0xf9')]=function(_0x5ffde4,_0x579721){var _0x1b6622={};var _0x36c0eb={};var _0x5776ea;var _0x492701;return db[_0x1088('0x2d')][_0x1088('0x51')]({'where':{'id':_0x5ffde4['params']['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x579721,null))[_0x1088('0x10')](function(_0x990407){if(_0x990407){_0x5776ea=_0x990407;_0x36c0eb[_0x1088('0x31')]=_[_0x1088('0x34')](db['ChatProactiveAction'][_0x1088('0x2e')]);_0x36c0eb['query']=_[_0x1088('0x34')](_0x5ffde4[_0x1088('0x33')]);_0x36c0eb[_0x1088('0x35')]=_['intersection'](_0x36c0eb[_0x1088('0x31')],_0x36c0eb['query']);_0x1b6622[_0x1088('0x36')]=_[_0x1088('0x41')](_0x36c0eb['model'],qs[_0x1088('0x37')](_0x5ffde4['query'][_0x1088('0x37')]));_0x1b6622['attributes']=_0x1b6622['attributes'][_0x1088('0x53')]?_0x1b6622['attributes']:_0x36c0eb[_0x1088('0x31')];_0x1b6622['order']=qs[_0x1088('0x38')](_0x5ffde4[_0x1088('0x33')]['sort']);_0x1b6622[_0x1088('0x39')]=qs[_0x1088('0x35')](_[_0x1088('0x3a')](_0x5ffde4[_0x1088('0x33')],_0x36c0eb[_0x1088('0x35')]));if(_0x5ffde4[_0x1088('0x33')][_0x1088('0x3b')]){_0x1b6622[_0x1088('0x39')]=_['merge'](_0x1b6622[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x1b6622[_0x1088('0x36')],function(_0x4736db){var _0x5ac303={};_0x5ac303[_0x4736db]={'$like':'%'+_0x5ffde4['query'][_0x1088('0x3b')]+'%'};return _0x5ac303;})});}_0x1b6622=_[_0x1088('0x3c')]({},_0x1b6622,_0x5ffde4[_0x1088('0x3d')]);return _0x5776ea[_0x1088('0xf9')](_0x1b6622);}})['then'](function(_0x1683ef){if(_0x1683ef){_0x492701=_0x1683ef[_0x1088('0x53')];if(!_0x5ffde4['query'][_0x1088('0x54')](_0x1088('0x5b'))){_0x1b6622['limit']=qs[_0x1088('0x20')](_0x5ffde4[_0x1088('0x33')][_0x1088('0x20')]);_0x1b6622[_0x1088('0x1f')]=qs[_0x1088('0x1f')](_0x5ffde4['query'][_0x1088('0x1f')]);}return _0x5776ea[_0x1088('0xf9')](_0x1b6622);}})['then'](function(_0xcaf741){if(_0xcaf741){return _0xcaf741?{'count':_0x492701,'rows':_0xcaf741}:null;}})[_0x1088('0x10')](respondWithResult(_0x579721,null))[_0x1088('0x1b')](handleError(_0x579721,null));};exports[_0x1088('0x114')]=function(_0x2c23f9,_0x3050e0){var _0x17057b=_0x2c23f9[_0x1088('0x33')][_0x1088('0x115')]===_0x1088('0x116')?_0x1088('0x117'):'onlineForm';return db[_0x1088('0x2d')]['find']({'attributes':['id',_0x17057b],'where':{'id':_0x2c23f9[_0x1088('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3050e0,null))['then'](function(_0x33c835){if(_0x33c835){var _0x24676c=_0x33c835[_0x17057b];var _0x4046bf=_0x24676c&&_0x24676c[_0x1088('0x118')]?_0x24676c[_0x1088('0x118')]:[];_0x3050e0[_0x1088('0x29')]({'fromKey':_['isNil'](_0x24676c[_0x1088('0x119')])?undefined:_0x24676c[_0x1088('0x119')],'count':_0x4046bf[_0x1088('0x53')],'rows':_0x4046bf});}})[_0x1088('0x1b')](handleError(_0x3050e0,null));};exports[_0x1088('0x11a')]=function(_0x310e4f,_0x1bfce4){var _0x736ffa={'raw':![],'where':{}};var _0x34d507={};var _0x4903a5={'count':0x0,'rows':[]};return db[_0x1088('0x2d')]['findOne']({'where':{'id':_0x310e4f['params']['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x1bfce4,null))['then'](function(_0x6b87b2){if(_0x6b87b2){_0x34d507[_0x1088('0x31')]=_[_0x1088('0x34')](db['ChatOfflineMessage'][_0x1088('0x2e')]);_0x34d507['query']=_[_0x1088('0x34')](_0x310e4f[_0x1088('0x33')]);_0x34d507['filters']=_[_0x1088('0x41')](_0x34d507[_0x1088('0x31')],_0x34d507[_0x1088('0x33')]);_0x736ffa[_0x1088('0x36')]=_[_0x1088('0x41')](_0x34d507['model'],qs[_0x1088('0x37')](_0x310e4f['query'][_0x1088('0x37')]));_0x736ffa['attributes']=_0x736ffa['attributes']['length']?_0x736ffa[_0x1088('0x36')]:_0x34d507[_0x1088('0x31')];if(!_0x310e4f[_0x1088('0x33')][_0x1088('0x54')](_0x1088('0x5b'))){_0x736ffa['limit']=qs[_0x1088('0x20')](_0x310e4f[_0x1088('0x33')][_0x1088('0x20')]);_0x736ffa[_0x1088('0x1f')]=qs[_0x1088('0x1f')](_0x310e4f[_0x1088('0x33')][_0x1088('0x1f')]);}_0x736ffa['order']=qs['sort'](_0x310e4f['query'][_0x1088('0x38')]);_0x736ffa[_0x1088('0x39')]=qs[_0x1088('0x35')](_[_0x1088('0x3a')](_0x310e4f[_0x1088('0x33')],_0x34d507[_0x1088('0x35')]));_0x736ffa['where'][_0x1088('0x4f')]=_0x6b87b2['id'];if(_0x310e4f[_0x1088('0x33')][_0x1088('0x3b')]){_0x736ffa['where']=_[_0x1088('0x3c')](_0x736ffa[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x736ffa[_0x1088('0x36')],function(_0x9f0deb){var _0x5980b1={};_0x5980b1[_0x9f0deb]={'$like':'%'+_0x310e4f[_0x1088('0x33')][_0x1088('0x3b')]+'%'};return _0x5980b1;})});}_0x736ffa=_[_0x1088('0x3c')]({},_0x736ffa,_0x310e4f[_0x1088('0x3d')]);return db[_0x1088('0x11b')][_0x1088('0x22')]({'where':_0x736ffa[_0x1088('0x39')]})[_0x1088('0x10')](function(_0x144f65){_0x4903a5[_0x1088('0x22')]=_0x144f65;if(_0x310e4f[_0x1088('0x33')][_0x1088('0x3e')]){_0x736ffa[_0x1088('0x55')]=[{'all':!![]}];}else{_0x736ffa[_0x1088('0x55')]=[{'model':db[_0x1088('0x76')],'as':_0x1088('0xe5'),'required':![]},{'model':db[_0x1088('0xcb')],'as':_0x1088('0x11c'),'required':![]}];}return db[_0x1088('0x11b')][_0x1088('0x56')](_0x736ffa);})[_0x1088('0x10')](function(_0x28d609){_0x4903a5[_0x1088('0x3f')]=_0x28d609;return _0x4903a5;});}})[_0x1088('0x10')](respondWithFilteredResult(_0x1bfce4,_0x736ffa))[_0x1088('0x1b')](handleError(_0x1bfce4,null));};exports[_0x1088('0x11d')]=function(_0x1a2724,_0x1c296d){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x1a2724[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x1c296d,null))[_0x1088('0x10')](function(_0xd9114f){if(_0xd9114f){return _0xd9114f[_0x1088('0x11d')](_0x1a2724['body']['ids'],_['omit'](_0x1a2724[_0x1088('0x44')],[_0x1088('0x5d'),'id'])||{})[_0x1088('0xa6')](function(_0xe3f78a){for(var _0x1067b3=0x0;_0x1067b3<_0x1a2724[_0x1088('0x44')]['ids'][_0x1088('0x53')];_0x1067b3+=0x1){socket['emit'](_0x1088('0x11e'),{'UserId':Number(_0x1a2724[_0x1088('0x44')][_0x1088('0x5d')][_0x1067b3]),'ChatWebsiteId':Number(_0x1a2724['params']['id'])});}return _0xe3f78a;});}})[_0x1088('0x10')](respondWithResult(_0x1c296d,null))['catch'](handleError(_0x1c296d,null));};exports[_0x1088('0x11f')]=function(_0x442936,_0x31f864){return db[_0x1088('0x2d')][_0x1088('0x42')]({'where':{'id':_0x442936[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0x31f864,null))[_0x1088('0x10')](function(_0x2c5989){if(_0x2c5989){return _0x2c5989[_0x1088('0x11f')](_0x442936[_0x1088('0x33')][_0x1088('0x5d')])[_0x1088('0x10')](function(){if(_[_0x1088('0x120')](_0x442936[_0x1088('0x33')][_0x1088('0x5d')])){for(var _0x387bea=0x0;_0x387bea<_0x442936[_0x1088('0x33')][_0x1088('0x5d')]['length'];_0x387bea+=0x1){socket['emit'](_0x1088('0x121'),{'UserId':Number(_0x442936[_0x1088('0x33')][_0x1088('0x5d')][_0x387bea]),'ChatWebsiteId':Number(_0x442936[_0x1088('0x4b')]['id'])});}}else{socket[_0x1088('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x442936[_0x1088('0x33')][_0x1088('0x5d')]),'ChatWebsiteId':Number(_0x442936[_0x1088('0x4b')]['id'])});}});}})[_0x1088('0x10')](respondWithStatusCode(_0x31f864,null))[_0x1088('0x1b')](handleError(_0x31f864,null));};exports[_0x1088('0x123')]=function(_0x34eec6,_0xb7b432){var _0x471ce3={};var _0x581a66={};var _0x5a21bb;var _0x3608fc;return db['ChatWebsite'][_0x1088('0x51')]({'where':{'id':_0x34eec6[_0x1088('0x4b')]['id']}})[_0x1088('0x10')](handleEntityNotFound(_0xb7b432,null))[_0x1088('0x10')](function(_0x549ba0){if(_0x549ba0){_0x5a21bb=_0x549ba0;_0x581a66['model']=_[_0x1088('0x34')](db[_0x1088('0xb1')][_0x1088('0x2e')]);_0x581a66[_0x1088('0x33')]=_[_0x1088('0x34')](_0x34eec6[_0x1088('0x33')]);_0x581a66[_0x1088('0x35')]=_[_0x1088('0x41')](_0x581a66['model'],_0x581a66[_0x1088('0x33')]);_0x471ce3[_0x1088('0x36')]=_[_0x1088('0x41')](_0x581a66['model'],qs[_0x1088('0x37')](_0x34eec6[_0x1088('0x33')]['fields']));_0x471ce3[_0x1088('0x36')]=_0x471ce3[_0x1088('0x36')][_0x1088('0x53')]?_0x471ce3[_0x1088('0x36')]:_0x581a66[_0x1088('0x31')];_0x471ce3['order']=qs[_0x1088('0x38')](_0x34eec6[_0x1088('0x33')][_0x1088('0x38')]);_0x471ce3[_0x1088('0x39')]=qs[_0x1088('0x35')](_[_0x1088('0x3a')](_0x34eec6['query'],_0x581a66[_0x1088('0x35')]));if(_0x34eec6[_0x1088('0x33')][_0x1088('0x3b')]){_0x471ce3[_0x1088('0x39')]=_[_0x1088('0x3c')](_0x471ce3[_0x1088('0x39')],{'$or':_[_0x1088('0x32')](_0x471ce3[_0x1088('0x36')],function(_0x7cd9b8){var _0xcbcf0={};_0xcbcf0[_0x7cd9b8]={'$like':'%'+_0x34eec6[_0x1088('0x33')][_0x1088('0x3b')]+'%'};return _0xcbcf0;})});}_0x471ce3=_['merge']({},_0x471ce3,_0x34eec6[_0x1088('0x3d')]);return _0x5a21bb[_0x1088('0x123')](_0x471ce3);}})[_0x1088('0x10')](function(_0x59e56b){if(_0x59e56b){_0x3608fc=_0x59e56b[_0x1088('0x53')];if(!_0x34eec6[_0x1088('0x33')][_0x1088('0x54')](_0x1088('0x5b'))){_0x471ce3[_0x1088('0x20')]=qs[_0x1088('0x20')](_0x34eec6[_0x1088('0x33')][_0x1088('0x20')]);_0x471ce3[_0x1088('0x1f')]=qs[_0x1088('0x1f')](_0x34eec6['query']['offset']);}return _0x5a21bb[_0x1088('0x123')](_0x471ce3);}})['then'](function(_0x1ac14c){if(_0x1ac14c){return _0x1ac14c?{'count':_0x3608fc,'rows':_0x1ac14c}:null;}})[_0x1088('0x10')](respondWithResult(_0xb7b432,null))[_0x1088('0x1b')](handleError(_0xb7b432,null));}; \ No newline at end of file +var _0xa9e0=['fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','bluebird','mustache','util','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','asc','from','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','attachments','offline-chat','basename','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','mapValues','subjectOffline','Chat','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','some','x-real-ip','connection','remoteAddress','replace','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x51cf2b,_0x17bc1e){var _0x505756=function(_0xc43054){while(--_0xc43054){_0x51cf2b['push'](_0x51cf2b['shift']());}};_0x505756(++_0x17bc1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var BPromise=require(_0x0a9e('0x0'));var Mustache=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x3'));var _=require('lodash');var querystring=require(_0x0a9e('0x4'));var Redis=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var db=require(_0x0a9e('0x9'))['db'];config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0a9e('0xd')](socket);var htmlToText=require(_0x0a9e('0xe'));var jayson=require(_0x0a9e('0xf'));var client=jayson[_0x0a9e('0x10')][_0x0a9e('0x11')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x10')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x0a9e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x12')](_0x36471c,_0x26d672)[_0x0a9e('0x13')](function(_0x281129){logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x17'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x18')]){if(_0x281129[_0x0a9e('0x18')]['code']===0x1f4){logger[_0x0a9e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x5db4b0(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}logger[_0x0a9e('0x18')](_0x0a9e('0x15'),_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x69aeb7(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}else{logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1a')][_0x0a9e('0x19')]);}})['catch'](function(_0x20f109){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1b')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1d')](_0x3b45bc)[_0x0a9e('0x1e')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x1f')]===_0x0a9e('0x20')&&typeof _0x5ea472[_0x0a9e('0x21')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x22')]:_0x5ea472[_0x0a9e('0x1f')]+_0x5ea472[_0x0a9e('0x21')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1d')](_0x140511);return _0x16b1ca[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x25')](_0x3652a7)[_0x0a9e('0x13')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x26')]()[_0x0a9e('0x13')](function(){var _0x58b06f=_0x40e7a3[_0x0a9e('0x27')]({'plain':!![]});var _0x296f41=_0x0a9e('0x28');return db[_0x0a9e('0x29')]['destroy']({'where':{'type':_0x296f41,'resourceId':_0x58b06f['id']}})[_0x0a9e('0x13')](function(){return _0x40e7a3;});})['then'](function(){_0x15b200[_0x0a9e('0x1d')](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x1122db){return function(_0x33bdb7){if(!_0x33bdb7){_0x1122db[_0x0a9e('0x1b')](0x194);}return _0x33bdb7;};}function handleError(_0x5180f1,_0x66c1d2){_0x66c1d2=_0x66c1d2||0x1f4;return function(_0x46f0a5){logger[_0x0a9e('0x18')](_0x46f0a5[_0x0a9e('0x2a')]);if(_0x46f0a5[_0x0a9e('0x2b')]){delete _0x46f0a5[_0x0a9e('0x2b')];}_0x5180f1[_0x0a9e('0x1d')](_0x66c1d2)[_0x0a9e('0x2c')](_0x46f0a5);};}exports['index']=function(_0x44295a,_0x5e7238){var _0x2cc7a0={'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]},_0x14b13f={},_0x2b7e7f={'count':0x0,'rows':[]};var _0x191e91=_[_0x0a9e('0x2e')](db[_0x0a9e('0x2f')][_0x0a9e('0x30')],function(_0x4853b1){return{'name':_0x4853b1['fieldName'],'type':_0x4853b1[_0x0a9e('0x31')]['key']};});_0x14b13f[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](_0x191e91,_0x0a9e('0x2b'));_0x14b13f[_0x0a9e('0x33')]=_['keys'](_0x44295a[_0x0a9e('0x33')]);_0x14b13f[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x14b13f['model'],_0x14b13f[_0x0a9e('0x33')]);_0x2cc7a0[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x14b13f['model'],qs['fields'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x2cc7a0['attributes']=_0x2cc7a0[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x2cc7a0[_0x0a9e('0x36')]:_0x14b13f[_0x0a9e('0x32')];if(!_0x44295a['query']['hasOwnProperty'](_0x0a9e('0x39'))){_0x2cc7a0[_0x0a9e('0x21')]=qs['limit'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x2cc7a0[_0x0a9e('0x1f')]=qs['offset'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x2cc7a0[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x2cc7a0[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x44295a[_0x0a9e('0x33')],_0x14b13f[_0x0a9e('0x34')]),_0x191e91);if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x2cc7a0[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x2cc7a0['where'],{'$or':_['map'](_0x191e91,function(_0x473fdc){if(_0x473fdc[_0x0a9e('0x31')]!==_0x0a9e('0x40')){var _0x315881={};_0x315881[_0x473fdc[_0x0a9e('0x2b')]]={'$like':'%'+_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x315881;}})});}_0x2cc7a0=_[_0x0a9e('0x3f')]({},_0x2cc7a0,_0x44295a[_0x0a9e('0x41')]);var _0x25c6e6={'where':_0x2cc7a0[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2f')]['count'](_0x25c6e6)[_0x0a9e('0x13')](function(_0x138b8b){_0x2b7e7f[_0x0a9e('0x22')]=_0x138b8b;if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x2cc7a0[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x2f')][_0x0a9e('0x44')](_0x2cc7a0);})['then'](function(_0x2e9d90){_0x2b7e7f['rows']=_0x2e9d90;return _0x2b7e7f;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x5e7238,_0x2cc7a0))[_0x0a9e('0x45')](handleError(_0x5e7238,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){var _0x7f6eb1={'raw':![],'where':{'id':_0x562fb4[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':_0x0a9e('0x48')}]},_0x4774f4={};_0x4774f4[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x2f')][_0x0a9e('0x30')]);_0x4774f4[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x33')]);_0x4774f4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],_0x4774f4[_0x0a9e('0x33')]);_0x7f6eb1['attributes']=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],qs['fields'](_0x562fb4['query']['fields']));_0x7f6eb1[_0x0a9e('0x36')]=_0x7f6eb1[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x7f6eb1[_0x0a9e('0x36')]:_0x4774f4[_0x0a9e('0x32')];if(_0x562fb4[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x7f6eb1[_0x0a9e('0x43')]=[{'all':!![]}];}_0x7f6eb1=_['merge']({},_0x7f6eb1,_0x562fb4['options']);return db['ChatWebsite'][_0x0a9e('0x4a')](_0x7f6eb1)[_0x0a9e('0x13')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x13')](respondWithResult(_0x14bec2,null))['catch'](handleError(_0x14bec2,null));};exports[_0x0a9e('0x4b')]=function(_0x161aa7,_0x53d113){return db['ChatWebsite'][_0x0a9e('0x4b')](_0x161aa7['body'],{})[_0x0a9e('0x13')](function(_0x4c3845){var _0x2e5e62=_0x161aa7[_0x0a9e('0x4c')][_0x0a9e('0x27')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x4d')]===_0x0a9e('0x4c')){var _0x508b47=_0x4c3845['get']({'plain':!![]});var _0x128aa6=_0x0a9e('0x28');return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':_0x128aa6,'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x13')](function(_0x523cd2){if(_0x523cd2&&_0x523cd2[_0x0a9e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x523cd2[_0x0a9e('0x2b')],'sectionId':_0x523cd2['id']},{})['then'](function(){return _0x4c3845;});}else{return _0x4c3845;}})[_0x0a9e('0x45')](function(_0x65432){logger[_0x0a9e('0x18')](_0x0a9e('0x4f'),_0x65432);throw _0x65432;});}return _0x4c3845;})[_0x0a9e('0x13')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x45')](handleError(_0x53d113,null));};exports[_0x0a9e('0x25')]=function(_0x28d814,_0x4e67ab){if(_0x28d814[_0x0a9e('0x50')]['id']){delete _0x28d814[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x28d814[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x4e67ab,null))[_0x0a9e('0x13')](saveUpdates(_0x28d814['body'],null))[_0x0a9e('0x13')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x26')]=function(_0x5ba1f9,_0x4b3c1a){return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x5ba1f9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x13')](removeEntity(_0x4b3c1a,null))[_0x0a9e('0x45')](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x51')]=function(_0x1cca9f,_0x26d7db){return db['ChatWebsite'][_0x0a9e('0x51')]()['then'](respondWithResult(_0x26d7db,null))[_0x0a9e('0x45')](handleError(_0x26d7db,null));};exports[_0x0a9e('0x52')]=function(_0x51aaf7,_0x5adf8f){if(_0x51aaf7[_0x0a9e('0x50')]['id']){delete _0x51aaf7[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51aaf7['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x5adf8f,null))[_0x0a9e('0x13')](function(_0x54327c){if(_0x54327c){_0x51aaf7[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x54327c['id'];return db[_0x0a9e('0x54')][_0x0a9e('0x4b')](_0x51aaf7[_0x0a9e('0x50')]);}})['then'](respondWithResult(_0x5adf8f,null))[_0x0a9e('0x45')](handleError(_0x5adf8f,null));};exports[_0x0a9e('0x55')]=function(_0x281c7d,_0x47bb43){var _0x3528b7={'raw':![],'where':{}};var _0x4f1e60={};var _0x5211e3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x281c7d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x13')](function(_0xc8c264){if(_0xc8c264){_0x4f1e60[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x54')][_0x0a9e('0x30')]);_0x4f1e60[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x281c7d[_0x0a9e('0x33')]);_0x4f1e60[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4f1e60[_0x0a9e('0x32')],_0x4f1e60[_0x0a9e('0x33')]);_0x3528b7[_0x0a9e('0x36')]=_['intersection'](_0x4f1e60[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x281c7d[_0x0a9e('0x33')]['fields']));_0x3528b7[_0x0a9e('0x36')]=_0x3528b7[_0x0a9e('0x36')]['length']?_0x3528b7[_0x0a9e('0x36')]:_0x4f1e60[_0x0a9e('0x32')];if(!_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x3528b7['limit']=qs['limit'](_0x281c7d['query'][_0x0a9e('0x21')]);_0x3528b7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x3528b7[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x281c7d[_0x0a9e('0x33')]['sort']);_0x3528b7[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x281c7d['query'],_0x4f1e60[_0x0a9e('0x34')]));_0x3528b7['where'][_0x0a9e('0x53')]=_0xc8c264['id'];if(_0x281c7d[_0x0a9e('0x33')]['filter']){_0x3528b7[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x3528b7[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x3528b7['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2e9552;})});}_0x3528b7=_['merge']({},_0x3528b7,_0x281c7d[_0x0a9e('0x41')]);return db[_0x0a9e('0x54')][_0x0a9e('0x22')]({'where':_0x3528b7[_0x0a9e('0x3c')]})['then'](function(_0x290d43){_0x5211e3[_0x0a9e('0x22')]=_0x290d43;if(_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x3528b7[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x54')][_0x0a9e('0x44')](_0x3528b7);})[_0x0a9e('0x13')](function(_0x1a7b03){_0x5211e3[_0x0a9e('0x58')]=_0x1a7b03;return _0x5211e3;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x47bb43,_0x3528b7))[_0x0a9e('0x45')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x59')]=function(_0xe0749e,_0x5b35db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0xe0749e[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b35db,null))[_0x0a9e('0x13')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0[_0x0a9e('0x59')](_0xe0749e[_0x0a9e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x5b35db,null))[_0x0a9e('0x45')](handleError(_0x5b35db,null));};exports[_0x0a9e('0x5a')]=function(_0x4c54fa,_0x45108c){if(_0x4c54fa['body']['id']){delete _0x4c54fa[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x4c54fa[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x13')](function(_0x42b959){if(_0x42b959){_0x4c54fa[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x42b959['id'];return db[_0x0a9e('0x5b')]['create'](_0x4c54fa[_0x0a9e('0x50')]);}})[_0x0a9e('0x13')](respondWithResult(_0x45108c,null))[_0x0a9e('0x45')](handleError(_0x45108c,null));};exports[_0x0a9e('0x5c')]=function(_0x492543,_0xf51744){var _0xf0db1={'raw':![],'where':{}};var _0x4bf3a5={};var _0x1d6834={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x492543[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x13')](function(_0x5af453){if(_0x5af453){_0x4bf3a5['model']=_[_0x0a9e('0x49')](db[_0x0a9e('0x5b')][_0x0a9e('0x30')]);_0x4bf3a5['query']=_[_0x0a9e('0x49')](_0x492543[_0x0a9e('0x33')]);_0x4bf3a5['filters']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],_0x4bf3a5['query']);_0xf0db1['attributes']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0xf0db1[_0x0a9e('0x36')]=_0xf0db1[_0x0a9e('0x36')]['length']?_0xf0db1[_0x0a9e('0x36')]:_0x4bf3a5['model'];if(!_0x492543[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0xf0db1[_0x0a9e('0x21')]=qs['limit'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0xf0db1[_0x0a9e('0x1f')]=qs['offset'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0xf0db1[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0xf0db1[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x492543[_0x0a9e('0x33')],_0x4bf3a5[_0x0a9e('0x34')]));_0xf0db1['where'][_0x0a9e('0x53')]=_0x5af453['id'];if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0xf0db1['where']=_[_0x0a9e('0x3f')](_0xf0db1['where'],{'$or':_[_0x0a9e('0x2e')](_0xf0db1[_0x0a9e('0x36')],function(_0x558a87){var _0x1f29bd={};_0x1f29bd[_0x558a87]={'$like':'%'+_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x1f29bd;})});}_0xf0db1=_[_0x0a9e('0x3f')]({},_0xf0db1,_0x492543[_0x0a9e('0x41')]);return db['CannedAnswer'][_0x0a9e('0x22')]({'where':_0xf0db1[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x30ef6e){_0x1d6834[_0x0a9e('0x22')]=_0x30ef6e;if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0xf0db1[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x44')](_0xf0db1);})[_0x0a9e('0x13')](function(_0x3754e2){_0x1d6834[_0x0a9e('0x58')]=_0x3754e2;return _0x1d6834;});}})['then'](respondWithFilteredResult(_0xf51744,_0xf0db1))[_0x0a9e('0x45')](handleError(_0xf51744,null));};exports[_0x0a9e('0x5d')]=function(_0x12843d,_0x2ed526){return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x12843d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2ed526,null))['then'](function(_0x23b447){if(_0x23b447){return _0x23b447['removeAnswers'](_0x12843d[_0x0a9e('0x33')][_0x0a9e('0x5e')]);}})[_0x0a9e('0x13')](respondWithStatusCode(_0x2ed526,null))[_0x0a9e('0x45')](handleError(_0x2ed526,null));};exports['addLogo']=function(_0x3ceba6,_0x4cf72d){_0x3ceba6[_0x0a9e('0x50')][_0x0a9e('0x5f')]=_0x3ceba6['file'][_0x0a9e('0x60')];return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x3ceba6['params']['id']}})['then'](handleEntityNotFound(_0x4cf72d,null))[_0x0a9e('0x13')](saveUpdates(_0x3ceba6[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x4cf72d,null))[_0x0a9e('0x45')](handleError(_0x4cf72d,null));};exports[_0x0a9e('0x61')]=function(_0x2450a8,_0x17793e){_0x2450a8[_0x0a9e('0x50')][_0x0a9e('0x62')]=_0x2450a8['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2450a8[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x17793e,null))[_0x0a9e('0x13')](saveUpdates(_0x2450a8[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x17793e,null))[_0x0a9e('0x45')](handleError(_0x17793e,null));};exports[_0x0a9e('0x63')]=function(_0x2791c5,_0x2aa5f2){_0x2791c5[_0x0a9e('0x50')]['customerAvatar']=_0x2791c5['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2791c5[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x13')](saveUpdates(_0x2791c5[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports['addSystemAvatar']=function(_0x1889ed,_0x5dfbe2){_0x1889ed[_0x0a9e('0x50')]['systemAvatar']=_0x1889ed[_0x0a9e('0x64')]['filename'];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x1889ed[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dfbe2,null))[_0x0a9e('0x13')](saveUpdates(_0x1889ed[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x5dfbe2,null))[_0x0a9e('0x45')](handleError(_0x5dfbe2,null));};exports[_0x0a9e('0x65')]=function(_0x5ab0bc,_0x5505f4){var _0x16449b=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x68'));var _0x59303b={'where':{'id':_0x5ab0bc['params']['id']},'attributes':['id',_0x0a9e('0x5f')],'raw':!![]};var _0xadce3d=![];return require('../../config/license/util')[_0x0a9e('0x69')]()[_0x0a9e('0x13')](function(_0xcacabb){if(_0xcacabb){_0xadce3d=_0xcacabb[_0x0a9e('0x6a')];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x59303b);})[_0x0a9e('0x13')](handleEntityNotFound(_0x5505f4,null))[_0x0a9e('0x13')](function(_0x16afb3){if(_0x16afb3){if(!_['isNil'](_0x16afb3[_0x0a9e('0x5f')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3['sitepic']))&&_0xadce3d){_0x16449b=path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3[_0x0a9e('0x5f')]);}}return _0x5505f4[_0x0a9e('0x6d')](_0x16449b);}})[_0x0a9e('0x45')](handleError(_0x5505f4,null));};exports['getAvatar']=function(_0x1339d0,_0x3c775a){var _0x3450ae=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/default_avatar.png');var _0x2144ca={'where':{'id':_0x1339d0['params']['id']},'attributes':['id',_0x0a9e('0x62')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x2144ca)['then'](handleEntityNotFound(_0x3c775a,null))[_0x0a9e('0x13')](function(_0x5ed560){if(_0x5ed560){if(!_[_0x0a9e('0x6e')](_0x5ed560[_0x0a9e('0x62')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]))){_0x3450ae=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]);}}return _0x3c775a[_0x0a9e('0x6d')](_0x3450ae);}})[_0x0a9e('0x45')](handleError(_0x3c775a,null));};exports[_0x0a9e('0x70')]=function(_0x98c62c,_0x248368){var _0x5b93dd=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x1d999b={'where':{'id':_0x98c62c[_0x0a9e('0x47')]['id']},'attributes':['id','customerAvatar',_0x0a9e('0x71')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x1d999b)[_0x0a9e('0x13')](handleEntityNotFound(_0x248368,null))['then'](function(_0x148fd9){if(_0x148fd9){if(!_[_0x0a9e('0x6e')](_0x148fd9[_0x0a9e('0x72')])){if(fs[_0x0a9e('0x6b')](path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9[_0x0a9e('0x72')]))&&_0x148fd9['showCustomerAvatar']){_0x5b93dd=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9['customerAvatar']);}}return _0x248368[_0x0a9e('0x6d')](_0x5b93dd);}})[_0x0a9e('0x45')](handleError(_0x248368,null));};exports[_0x0a9e('0x73')]=function(_0x1a7f58,_0x2394d3){var _0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/images/avatars/system_avatar.png');var _0x3bab3e={'where':{'id':_0x1a7f58[_0x0a9e('0x47')]['id']},'attributes':['id',_0x0a9e('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x3bab3e)['then'](handleEntityNotFound(_0x2394d3,null))[_0x0a9e('0x13')](function(_0x4a70ce){if(_0x4a70ce){if(!_['isNil'](_0x4a70ce[_0x0a9e('0x74')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config['root'],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]))){_0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]);}}return _0x2394d3[_0x0a9e('0x6d')](_0x555780);}})[_0x0a9e('0x45')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x75')]=function(_0x5a1848,_0x43c397){var _0x5526a7=require(_0x0a9e('0x76'));var _0x4093e6=new _0x5526a7();var _0x2097d8=_0x4093e6[_0x0a9e('0x77')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x79')])['getResult']();var _0x1a0314={'body':_0x5a1848[_0x0a9e('0x50')],'channel':_0x0a9e('0x7a')};var _0x1af799=[];var _0x51aa2f=[];var _0x2e4887={};var _0x3c9135=![];return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x2be526){if(!_0x2be526){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x1af799=_[_0x0a9e('0x7f')](_['keys'](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81')]);_0x51aa2f=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81'),_0x0a9e('0x82'),_0x0a9e('0x83')]);if(_0x5a1848['body']['id']){delete _0x5a1848[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')]['from'])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x84'));}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x86')+_0x51aa2f);}if(!_['includes'](_0x51aa2f,_0x5a1848[_0x0a9e('0x50')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a9e('0x87')+_0x51aa2f);}_0x2e4887[_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')]['from'];})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5a1848[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x88')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0a9e('0x89'),'where':_0x2e4887,'limit':0x1,'order':[[_0x0a9e('0x81'),_0x0a9e('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x0a9e('0x8b')}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x4cee8c){if(_0x4cee8c&&_0x4cee8c[_0x0a9e('0x8c')]){_0x1a0314[_0x0a9e('0x8d')]=_0x4cee8c;_0x1a0314[_0x0a9e('0x8e')]=_0x4cee8c['Applications'];_0x1a0314[_0x0a9e('0x8f')]=_0x4cee8c[_0x0a9e('0x8c')];_0x1a0314[_0x0a9e('0x8e')]=_['orderBy'](_0x1a0314['applications'],['priority'],[_0x0a9e('0x90')]);if(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8b')]){delete _0x1a0314[_0x0a9e('0x8d')]['Applications'];}if(_0x1a0314[_0x0a9e('0x8d')]['List']&&_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')]['length']){return _0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')][0x0];}var _0x580dd6=_[_0x0a9e('0xb')](_0x5a1848['body'],{'firstName':_0x5a1848[_0x0a9e('0x50')]['from'],'ListId':_0x4cee8c[_0x0a9e('0x83')]});_0x580dd6[_0x5a1848['body'][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0x4b')](_0x580dd6,{'fields':_0x1af799,'raw':!![]});}})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x5acdc9){_0x1a0314[_0x0a9e('0x92')]=_0x5acdc9;var _0x1c9ea2=_0x5a1848['body'][_0x0a9e('0x93')];if(_0x5a1848[_0x0a9e('0x78')]['cf-connecting-ip']){_0x1c9ea2=_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x94')];}else if(_0x5a1848[_0x0a9e('0x78')]['x-forwarded-for']){_0x1c9ea2=_[_0x0a9e('0x95')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x96')][_0x0a9e('0x97')](','));}if(_0x5acdc9){var _0x2003bc={'ContactId':_0x5acdc9['id'],'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'from':(_0x5acdc9[_0x0a9e('0x98')]||'')+'\x20'+(_0x5acdc9[_0x0a9e('0x99')]||''),'customerIp':_0x1c9ea2,'customerPort':_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x9a')]?_0x5a1848['headers'][_0x0a9e('0x9a')]:null,'referer':_0x5a1848['body'][_0x0a9e('0x9b')],'browserName':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')]&&_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]?util[_0x0a9e('0x9e')]('%s\x20%s',_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')],_0x2097d8[_0x0a9e('0x9c')]['version']):_0x0a9e('0x9f'),'browserVersion':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]||_0x0a9e('0x9f'),'osName':util[_0x0a9e('0x9e')](_0x0a9e('0xa0'),_0x2097d8['os'][_0x0a9e('0x2b')],_0x2097d8['os']['version']),'osVersion':_0x2097d8['os'][_0x0a9e('0x9d')],'deviceModel':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x32')]&&_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')]?util[_0x0a9e('0x9e')](_0x0a9e('0xa3'),_0x2097d8['device']['model'],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x31')]):null,'deviceVendor':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],'deviceType':_0x2097d8[_0x0a9e('0xa1')]['type'],'formData':JSON[_0x0a9e('0xa4')](_0x5a1848[_0x0a9e('0x50')])};var _0x2d8e91={'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'closed':![]};if(_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]){_0x2d8e91[_0x0a9e('0xa5')]=_0x5a1848['body'][_0x0a9e('0xa5')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':_0x2d8e91})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return[_0x2b8ad4,![]];}_0x2003bc[_0x0a9e('0xa5')]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')];_0x2003bc['externalUrl']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa7')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4b')](_0x2003bc)[_0x0a9e('0x13')](function(_0x20c130){return[_0x20c130,!![]];});});}_0x2d8e91[_0x0a9e('0xa8')]=_0x5acdc9['id'];if(_0x5a1848[_0x0a9e('0x50')]['interaction']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id']){_0x2d8e91['id']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id'];return db['ChatInteraction']['find']({'where':_0x2d8e91})[_0x0a9e('0x13')](function(_0x2abe55){if(_0x2abe55){return[_0x2abe55,![]];}return db[_0x0a9e('0xa6')]['create'](_0x2003bc)[_0x0a9e('0x13')](function(_0x40180d){return[_0x40180d,!![]];});});}return db['ChatInteraction'][_0x0a9e('0x4b')](_0x2003bc)['then'](function(_0x35cc2a){return[_0x35cc2a,!![]];});}})['spread'](function(_0x5b42b9,_0x48eaa3){if(_0x5b42b9){_0x3c9135=_0x48eaa3;if(!_0x48eaa3){var _0xad4d10={'from':(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x98')]||'')+'\x20'+(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x99')]||'')};if(_0x5a1848[_0x0a9e('0x50')]['threadId']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]!=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]){_0xad4d10[_0x0a9e('0xa5')]=_0x5a1848['body']['messageId'];}return _0x5b42b9[_0x0a9e('0x25')](_0xad4d10);}else{return _0x5b42b9;}}})['then'](function(_0x29537a){_0x1a0314[_0x0a9e('0xa9')]=_0x29537a[_0x0a9e('0x27')]({'plain':!![]});_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xab')]=_0x3c9135;if(_0x1a0314[_0x0a9e('0xa9')]['created']){if(_0x1a0314[_0x0a9e('0x8d')]['autoclose']){_0x1a0314['applications'][_0x0a9e('0xac')]({'id':0x0,'priority':_0x1a0314['applications'][_0x0a9e('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0a9e('0xad')});}}return db['ChatMessage'][_0x0a9e('0x4b')]({'body':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')],'ChatWebsiteId':_0x5a1848['params']['id'],'ChatInteractionId':_0x29537a['id'],'direction':'in','ContactId':_0x1a0314[_0x0a9e('0x92')]['id'],'AttachmentId':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xae')]});})['then'](function(_0x5236c9){_0x1a0314[_0x0a9e('0x19')]=_0x5236c9;if(_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]){return db[_0x0a9e('0xb0')][_0x0a9e('0x4a')]({'attributes':['id',_0x0a9e('0x2b')],'where':{'id':_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]}})[_0x0a9e('0x13')](function(_0x1020a0){if(_0x1020a0){_0x1a0314['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1020a0[_0x0a9e('0x2b')]+','+(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0xb1')]||0xa),'interval':_0x0a9e('0xad')});_0x1a0314[_0x0a9e('0xb2')]=!![];}return respondWithRpcPromise(_0x0a9e('0xb3'),_0x0a9e('0xb4'),_0x1a0314);});}return respondWithRpcPromise(_0x0a9e('0xb3'),'startRouting',_0x1a0314);})['then'](function(_0x2869cc){respondWithRpcPromise(_0x0a9e('0xb5'),'EventManager',{'event':_0x0a9e('0x75'),'message':_0x2869cc},client9002);return _0x2869cc;})[_0x0a9e('0x13')](respondWithResult(_0x43c397,null))[_0x0a9e('0x45')](handleError(_0x43c397,null));};exports[_0x0a9e('0xb6')]=function(_0x2bb549,_0x2683ad){var _0x167196,_0x262281,_0x59f8f7;var _0x400800=[];var _0xbd1af3={};var _0x20e191=_0x2bb549['files']||[];var _0x4412a5=[];var _0x261ef8;return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x21ada7){if(!_0x21ada7){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x400800=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x21ada7),[_0x0a9e('0x80'),'updatedAt','CompanyId',_0x0a9e('0x83')]);if(_0x2bb549[_0x0a9e('0x50')]['id']){delete _0x2bb549[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)['send'](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0x84')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0xb7')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db['Sequelize']['ValidationError'](_0x0a9e('0xb9')+_0x400800));}if(!_[_0x0a9e('0xba')](_0x400800,_0x2bb549['body']['mapKeyOffline'])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0xbb')+_0x400800));}_0xbd1af3[_0x2bb549['body'][_0x0a9e('0xb8')]]=_0x2bb549['body'][_0x0a9e('0x91')];})['then'](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x2bb549[_0x0a9e('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x0a9e('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x2683ad,null))[_0x0a9e('0x13')](function(_0x3c691f){if(_0x3c691f&&_0x3c691f[_0x0a9e('0x8c')]){_0x262281=_0x3c691f;var _0x1d51fd=_[_0x0a9e('0xb')](_0x2bb549[_0x0a9e('0x50')],{'firstName':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'phone':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'ListId':_0x3c691f[_0x0a9e('0x83')]});_0x1d51fd[_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')]]=_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0xbc')]({'where':_0xbd1af3,'defaults':_0x1d51fd});}})[_0x0a9e('0xbd')](function(_0x51a987){if(_0x51a987){_0x59f8f7=_0x51a987;var _0x233e48=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x54658d=ejs[_0x0a9e('0xbf')](_0x233e48,{'body':_['toPairs'](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]),'bodyTitle':_0x262281[_0x0a9e('0xc0')]});return db[_0x0a9e('0xc1')][_0x0a9e('0x4b')]({'body':_0x54658d,'plainBody':htmlToText[_0x0a9e('0xc2')](_0x54658d),'ContactId':_0x51a987['id'],'ChatWebsiteId':_0x262281['id']});}})[_0x0a9e('0x13')](function(_0x1cc73e){_0x261ef8=_0x1cc73e;if(_0x20e191[_0x0a9e('0x38')]){var _0x6b948a=_0x20e191['map'](function(_0x283c59){return{'name':_0x283c59['originalname'],'basename':_0x283c59[_0x0a9e('0x60')],'type':_0x283c59['mimetype'],'ChatOfflineMessageId':_0x1cc73e['id']};});_0x4412a5=_0x6b948a[_0x0a9e('0x2e')](_0x2c5385=>{var _0x216791={'filename':_0x2c5385['name'],'path':path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server','files',_0x0a9e('0xc3'),_0x0a9e('0xc4'),_0x2c5385[_0x0a9e('0xc5')])};return _0x216791;});if(!_0x262281['openNewInteraction']){return db['sequelize']['transaction'](function(_0x374964){return db[_0x0a9e('0xc6')][_0x0a9e('0xc7')](_0x6b948a,{'transaction':_0x374964});});}}})[_0x0a9e('0x13')](function(){if(_0x261ef8){_0x167196=_0x261ef8;return db[_0x0a9e('0xc8')][_0x0a9e('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xca'),'raw':!![],'include':[{'model':db[_0x0a9e('0xcb')],'as':_0x0a9e('0xcb'),'raw':!![]}]}]});}})[_0x0a9e('0x13')](function(_0x2f4de1){if(_0x2f4de1&&_0x2f4de1[_0x0a9e('0xca')]&&_0x262281[_0x0a9e('0xcc')]&&_0x262281[_0x0a9e('0xcd')]){var _0x1a74c4=_0x2f4de1[_0x0a9e('0xce')]();return respondWithRpcPromise(_0x0a9e('0xcf'),'sendMail',{'account':_0x1a74c4,'message':{'from':util[_0x0a9e('0x9e')](_0x0a9e('0xd0'),_0x2f4de1[_0x0a9e('0x2b')],_0x2f4de1[_0x0a9e('0xd1')]||_0x2f4de1[_0x0a9e('0xca')][_0x0a9e('0x4c')]),'to':_0x262281['forwardOfflineAddress'],'subject':_0x262281[_0x0a9e('0xd2')],'html':_0x167196[_0x0a9e('0x50')],'attachments':_0x4412a5}},client9003)[_0x0a9e('0x13')](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x37390b){logger[_0x0a9e('0x18')](_0x37390b);});}})[_0x0a9e('0x13')](function(){if(_0x262281&&_0x262281[_0x0a9e('0xd3')]&&_0x262281[_0x0a9e('0xd4')]){var _0x541af6=[];if(_0x20e191['length']){_0x541af6=_0x20e191[_0x0a9e('0x2e')](function(_0x3a0b30){return{'name':_0x3a0b30['originalname'],'basename':_0x3a0b30[_0x0a9e('0x60')],'type':_0x3a0b30[_0x0a9e('0xd5')],'ChatOfflineMessageId':_0x261ef8['id']};});}var _0x4c8d75;if(!_[_0x0a9e('0x6e')](_0x262281['subjectOffline'])){var _0x3468a4=_[_0x0a9e('0x2e')](_0x2bb549['body'],function(_0x27a41c){return _0x27a41c;});var _0x31ab12=_['toPairsIn'](_0x3468a4)[0x0];var _0x197d65=_[_0x0a9e('0xd6')](_0x31ab12,function(_0x53ad2b){return _0x53ad2b;});_0x4c8d75=_0x197d65[0x1][_0x262281[_0x0a9e('0xd7')]];}var _0x237994={'from':_0x59f8f7[_0x0a9e('0xd1')],'firstName':_0x59f8f7[_0x0a9e('0x98')],'lastName':_0x59f8f7[_0x0a9e('0x99')],'mapKey':_0x0a9e('0xd1'),'message':{'from':_0x59f8f7['email'],'to':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')],'cc':'','subject':_['isNil'](_0x4c8d75)?_0x262281[_0x0a9e('0xd2')]:_0x4c8d75,'messageId':'','sentAt':new Date(),'attach':_0x541af6[_0x0a9e('0x38')],'attachments':_0x541af6,'originChannel':_0x0a9e('0xd8'),'ChatWebsiteId':_0x262281['id'],'ChatOfflineMessageId':_0x167196['id'],'originTo':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')]},'body':_0x167196[_0x0a9e('0x50')]};var _0x368a12={'account':{'id':_0x262281['MailAccountId']},'body':_0x237994,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x368a12,client9001)['then'](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x23ef4e){logger['error'](_0x23ef4e);});}return;})['then'](function(){if(_0x167196){return _0x167196;}})[_0x0a9e('0x13')](respondWithResult(_0x2683ad,null))['catch'](function(_0x41600e){logger[_0x0a9e('0x18')](_0x0a9e('0x45'),_0x41600e);for(var _0x175c97 of _0x20e191){var _0x336518=path[_0x0a9e('0x66')](config['root'],_0x0a9e('0xd9'),_0x0a9e('0xda'),'attachments',_0x0a9e('0xc4'),_0x175c97[_0x0a9e('0x60')]);fs_extra[_0x0a9e('0xdb')](_0x336518)[_0x0a9e('0x45')](function(_0x1282da){logger[_0x0a9e('0x18')](_0x0a9e('0xdc'),_0x336518,_0x1282da);});}});};exports['addInteraction']=function(_0x331216,_0x508395){return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':{'id':_0x331216['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x508395,null))[_0x0a9e('0x13')](function(_0x5061e5){if(_0x5061e5){return _0x5061e5[_0x0a9e('0xdd')](_0x331216['body'][_0x0a9e('0x5e')],_[_0x0a9e('0xde')](_0x331216['body'],[_0x0a9e('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x508395,null))[_0x0a9e('0x45')](handleError(_0x508395,null));};exports[_0x0a9e('0xdf')]=function(_0x732141,_0x37ef45){var _0x288127={'raw':![],'where':{}};var _0x26d010={};var _0xa45906={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x732141[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x37ef45,null))[_0x0a9e('0x13')](function(_0x38e256){if(_0x38e256){_0x26d010['model']=_[_0x0a9e('0x49')](db['ChatInteraction']['rawAttributes']);_0x26d010[_0x0a9e('0x33')]=_['keys'](_0x732141[_0x0a9e('0x33')]);_0x26d010[_0x0a9e('0x34')]=_['intersection'](_0x26d010[_0x0a9e('0x32')],_0x26d010[_0x0a9e('0x33')]);_0x288127[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x26d010[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x288127[_0x0a9e('0x36')]=_0x288127['attributes'][_0x0a9e('0x38')]?_0x288127[_0x0a9e('0x36')]:_0x26d010[_0x0a9e('0x32')];if(!_0x732141[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x288127[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x732141['query'][_0x0a9e('0x21')]);_0x288127[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x732141['query'][_0x0a9e('0x1f')]);}_0x288127['order']=qs[_0x0a9e('0x3b')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x288127[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x732141[_0x0a9e('0x33')],_0x26d010['filters']));_0x288127[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x38e256['id'];if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x288127[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x288127[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x288127[_0x0a9e('0x36')],function(_0x4712c9){var _0x4542d3={};_0x4542d3[_0x4712c9]={'$like':'%'+_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x4542d3;})});}_0x288127=_[_0x0a9e('0x3f')]({},_0x288127,_0x732141[_0x0a9e('0x41')]);return db[_0x0a9e('0xa6')][_0x0a9e('0x22')]({'where':_0x288127[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x611e46){_0xa45906[_0x0a9e('0x22')]=_0x611e46;if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x288127['include']=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xb0')],'as':'Owner','attributes':[_0x0a9e('0x2b'),'fullname',_0x0a9e('0xe1')],'required':![]},{'model':db[_0x0a9e('0xe2')],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2b'),_0x0a9e('0xe4')],'where':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?{'id':_0x732141[_0x0a9e('0x33')]['tag']}:undefined,'required':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a9e('0x44')](_0x288127);})[_0x0a9e('0x13')](function(_0x579bb0){_0xa45906['rows']=_0x579bb0;return _0xa45906;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x37ef45,_0x288127))[_0x0a9e('0x45')](handleError(_0x37ef45,null));};function iftimePromise(_0x315299,_0x1bf053){return respondWithRpcPromise('Command',_0x0a9e('0xe6'),{'command':_0x1bf053[_0x0a9e('0xe7')]?util[_0x0a9e('0x9e')](_0x0a9e('0xe8'),_0x315299[_0x0a9e('0xe9')],_0x1bf053['timezone']):util[_0x0a9e('0x9e')](_0x0a9e('0xea'),_0x315299['interval'])},client9002)[_0x0a9e('0x13')](function(_0x2d20a0){var _0x38284a=_0x2d20a0&&_0x2d20a0['indexOf']('true')>=0x0?!![]:![];logger[_0x0a9e('0x14')](_0x0a9e('0xeb'),_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],_0x38284a?_0x0a9e('0xec'):_0x0a9e('0xed'),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:_0x0a9e('0xee'));return _0x38284a;})['catch'](function(_0x5cc8cb){logger[_0x0a9e('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],util[_0x0a9e('0xef')](_0x5cc8cb,{'showHidden':![],'depth':null}),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:'No\x20timezone');return![];});}exports[_0x0a9e('0xe6')]=function(_0x43c1d1,_0x546bc9){var _0x10e370=0x0;var _0x5092af=0x0;var _0x2e1de7=![];var _0x30a77e;var _0xd63c87;return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x43c1d1[_0x0a9e('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x0a9e('0xf0'),'include':[{'model':db['Interval'],'as':_0x0a9e('0xf1'),'attributes':['id',_0x0a9e('0xe9')],'raw':!![]}]}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x546bc9,null))[_0x0a9e('0x13')](function(_0xa244bc){if(_0xa244bc){_0x30a77e=_0xa244bc;return _0xa244bc[_0x0a9e('0xf2')]({'raw':!![]});}})[_0x0a9e('0x13')](function(_0x5bdba6){if(_0x30a77e){if(_0x5bdba6){_0xd63c87=_0x5bdba6;}}return require(_0x0a9e('0xf3'))[_0x0a9e('0x69')]();})[_0x0a9e('0x13')](function(_0x188231){if(_0x188231){_0x5092af=_0x188231[_0x0a9e('0xf4')];_0x2e1de7=_0x188231['custom'];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0xa6')]['count']({'where':{'closed':![]}});})['then'](function(_0x2240ea){_0x10e370=_0x2240ea;if(_0x5092af&&_0x2240ea>_0x5092af){return db[_0x0a9e('0xf5')][_0x0a9e('0x56')]({'where':{'id':0x1}})[_0x0a9e('0x13')](function(_0x380539){if(_0x380539){_0x380539[_0x0a9e('0xf6')]('chatLicenseExceeded');}});}})[_0x0a9e('0x13')](function(){if(_0x30a77e[_0x0a9e('0xf0')]&&_0x30a77e[_0x0a9e('0xf0')]['Intervals']){var _0x294e90=[];for(var _0x1969e3=0x0;_0x1969e3<_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')]['length'];_0x1969e3++){var _0x5d4935=_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')][_0x1969e3][_0x0a9e('0x27')]({'plain':!![]});_0x294e90[_0x0a9e('0xac')](iftimePromise(_0x5d4935,_0x30a77e));}return BPromise[_0x0a9e('0xf7')](_0x294e90)[_0x0a9e('0x13')](function(_0x371943){return _[_0x0a9e('0xf8')](_0x371943);});}else{return!![];}})['then'](function(_0x17187c){var _0x4be017=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x462ecd={'remote':_0x30a77e['remote'],'query':querystring[_0x0a9e('0xa4')](_['merge'](_0x30a77e['get']({'plain':!![]}),{'customerIp':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x96')]||_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0xf9')]||_0x43c1d1[_0x0a9e('0xfa')][_0x0a9e('0xfb')]||_0x43c1d1['ip'],'referer':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x9b')],'openedInteractions':_0x10e370,'maxInteractions':_0x5092af,'virtual':_0x2e1de7[_0x0a9e('0xf4')],'online':_0x17187c,'custom':_0x2e1de7}))[_0x0a9e('0xfc')](/'/g,'\x5c\x27')};_0x546bc9[_0x0a9e('0x2c')](ejs[_0x0a9e('0xbf')](Mustache[_0x0a9e('0xbf')](_0x4be017,_0x462ecd),{'proactiveActions':_0xd63c87,'alignment':_0x30a77e['alignment'],'verticalAlignment':_0x30a77e['verticalAlignment'],'div_color':_0x30a77e[_0x0a9e('0xe4')],'labelText':_0x30a77e['labelText'],'text_color':_0x30a77e[_0x0a9e('0xfd')],'button_color':_0x30a77e[_0x0a9e('0xfe')],'background_color':_0x30a77e[_0x0a9e('0xff')],'hideWhenOffline':_0x30a77e['hideWhenOffline'],'interval':_0x30a77e['IntervalId']}));})[_0x0a9e('0x45')](handleError(_0x546bc9,null));};exports[_0x0a9e('0x100')]=function(_0x2c316b,_0x142c65){var _0x193e3b=_0x2c316b[_0x0a9e('0x47')]['id'];var _0x36e428=_0x2c316b['body'];var _0x12984a=0xc8;var _0x5799a6=null;return db[_0x0a9e('0x101')][_0x0a9e('0x102')]({'isolationLevel':db['sequelize'][_0x0a9e('0x103')][_0x0a9e('0x104')][_0x0a9e('0x105')]},function(_0x4524b8){return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x193e3b},'transaction':_0x4524b8})['then'](function(_0x475bcd){if(_0x475bcd){return db[_0x0a9e('0x106')][_0x0a9e('0x26')]({'where':{'ChatWebsiteId':_0x193e3b},'transaction':_0x4524b8})['then'](function(){var _0x857983=_[_0x0a9e('0x2e')](_0x36e428,function(_0x24dc3f){_0x24dc3f['ChatWebsiteId']=_0x193e3b;return _0x24dc3f;});return db[_0x0a9e('0x106')][_0x0a9e('0xc7')](_0x857983,{'transaction':_0x4524b8});});}else{_0x12984a=0x194;_0x5799a6=[];}});})[_0x0a9e('0x13')](function(){if(_0x12984a!==0x194){return db[_0x0a9e('0x106')][_0x0a9e('0x107')]({'where':{'ChatWebsiteId':_0x193e3b},'order':_0x0a9e('0x108')})['then'](function(_0x483aed){_0x5799a6=_0x483aed;});}})[_0x0a9e('0x45')](function(_0x1e01af){_0x12984a=0x1f4;logger['error'](_0x1e01af[_0x0a9e('0x2a')]);if(_0x1e01af[_0x0a9e('0x2b')]){delete _0x1e01af[_0x0a9e('0x2b')];}_0x5799a6=_0x1e01af;})[_0x0a9e('0x109')](function(){if(_0x5799a6===null){_0x142c65[_0x0a9e('0x1b')](_0x12984a);}else{if(_0x12984a===0x1f4){_0x142c65[_0x0a9e('0x1d')](_0x12984a)['send'](_0x5799a6);}else{_0x142c65[_0x0a9e('0x1d')](_0x12984a)[_0x0a9e('0x1e')](_0x5799a6);}}});};exports[_0x0a9e('0x10a')]=function(_0x4edb79,_0x45c6ce){var _0x4532de={};var _0x1747ab={};var _0x3afafa;var _0x5beea6;return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x4edb79[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45c6ce,null))['then'](function(_0x3d75c9){if(_0x3d75c9){_0x3afafa=_0x3d75c9;_0x1747ab[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x106')][_0x0a9e('0x30')]);_0x1747ab[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x4edb79[_0x0a9e('0x33')]);_0x1747ab['filters']=_['intersection'](_0x1747ab[_0x0a9e('0x32')],_0x1747ab[_0x0a9e('0x33')]);_0x4532de['attributes']=_[_0x0a9e('0x35')](_0x1747ab['model'],qs[_0x0a9e('0x37')](_0x4edb79[_0x0a9e('0x33')]['fields']));_0x4532de[_0x0a9e('0x36')]=_0x4532de[_0x0a9e('0x36')]['length']?_0x4532de[_0x0a9e('0x36')]:_0x1747ab[_0x0a9e('0x32')];_0x4532de[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4532de[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x4edb79[_0x0a9e('0x33')],_0x1747ab[_0x0a9e('0x34')]));if(_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4532de[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x4532de['where'],{'$or':_['map'](_0x4532de[_0x0a9e('0x36')],function(_0x14c3f1){var _0x1e6bba={};_0x1e6bba[_0x14c3f1]={'$like':'%'+_0x4edb79['query']['filter']+'%'};return _0x1e6bba;})});}_0x4532de=_[_0x0a9e('0x3f')]({},_0x4532de,_0x4edb79['options']);return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x112789){if(_0x112789){_0x5beea6=_0x112789[_0x0a9e('0x38')];if(!_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4532de[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4edb79['query']['limit']);_0x4532de[_0x0a9e('0x1f')]=qs['offset'](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x4ad6fc){if(_0x4ad6fc){return _0x4ad6fc?{'count':_0x5beea6,'rows':_0x4ad6fc}:null;}})[_0x0a9e('0x13')](respondWithResult(_0x45c6ce,null))[_0x0a9e('0x45')](handleError(_0x45c6ce,null));};exports[_0x0a9e('0x10b')]=function(_0x5174c5,_0x1ebf20){return db[_0x0a9e('0x10c')][_0x0a9e('0x4a')]({'where':{'id':_0x5174c5['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x1ebf20,null))[_0x0a9e('0x13')](function(_0x459ab7){if(_0x459ab7){return _0x459ab7[_0x0a9e('0x10b')](_0x5174c5[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x5174c5['body'],[_0x0a9e('0x5e'),'id'])||{});}})[_0x0a9e('0x13')](respondWithResult(_0x1ebf20,null))[_0x0a9e('0x45')](handleError(_0x1ebf20,null));};exports['getProactiveActions']=function(_0x5990e1,_0x2a5c2a){var _0x304a57={};var _0x2302a2={};var _0x5f5963;var _0x4b51ff;return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5990e1[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2a5c2a,null))[_0x0a9e('0x13')](function(_0x4f0bca){if(_0x4f0bca){_0x5f5963=_0x4f0bca;_0x2302a2[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x10d')][_0x0a9e('0x30')]);_0x2302a2['query']=_[_0x0a9e('0x49')](_0x5990e1['query']);_0x2302a2[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2302a2[_0x0a9e('0x32')],_0x2302a2[_0x0a9e('0x33')]);_0x304a57[_0x0a9e('0x36')]=_['intersection'](_0x2302a2[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5990e1[_0x0a9e('0x33')]['fields']));_0x304a57[_0x0a9e('0x36')]=_0x304a57['attributes'][_0x0a9e('0x38')]?_0x304a57[_0x0a9e('0x36')]:_0x2302a2[_0x0a9e('0x32')];_0x304a57['order']=qs[_0x0a9e('0x3b')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x304a57[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5990e1['query'],_0x2302a2[_0x0a9e('0x34')]));if(_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x304a57[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x304a57[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x304a57[_0x0a9e('0x36')],function(_0x597e99){var _0x2dc0de={};_0x2dc0de[_0x597e99]={'$like':'%'+_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2dc0de;})});}_0x304a57=_[_0x0a9e('0x3f')]({},_0x304a57,_0x5990e1['options']);return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})['then'](function(_0xf81cc){if(_0xf81cc){_0x4b51ff=_0xf81cc[_0x0a9e('0x38')];if(!_0x5990e1[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x304a57[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5990e1[_0x0a9e('0x33')]['limit']);_0x304a57[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})[_0x0a9e('0x13')](function(_0xbdc88e){if(_0xbdc88e){return _0xbdc88e?{'count':_0x4b51ff,'rows':_0xbdc88e}:null;}})['then'](respondWithResult(_0x2a5c2a,null))[_0x0a9e('0x45')](handleError(_0x2a5c2a,null));};exports[_0x0a9e('0x10e')]=function(_0x337c29,_0xa42055){var _0x52cdf4=_0x337c29[_0x0a9e('0x33')]['online']===_0x0a9e('0x10f')?_0x0a9e('0x110'):_0x0a9e('0x111');return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'attributes':['id',_0x52cdf4],'where':{'id':_0x337c29[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xa42055,null))['then'](function(_0x173f03){if(_0x173f03){var _0x4ac7f1=_0x173f03[_0x52cdf4];var _0x382412=_0x4ac7f1&&_0x4ac7f1[_0x0a9e('0x112')]?_0x4ac7f1['items']:[];_0xa42055[_0x0a9e('0x2c')]({'fromKey':_[_0x0a9e('0x6e')](_0x4ac7f1[_0x0a9e('0x113')])?undefined:_0x4ac7f1[_0x0a9e('0x113')],'count':_0x382412['length'],'rows':_0x382412});}})[_0x0a9e('0x45')](handleError(_0xa42055,null));};exports[_0x0a9e('0x114')]=function(_0x5a75d9,_0xcc859d){var _0x4a396c={'raw':![],'where':{}};var _0x58cb87={};var _0x50e7ec={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5a75d9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xcc859d,null))[_0x0a9e('0x13')](function(_0x5ef7e8){if(_0x5ef7e8){_0x58cb87[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0xc1')][_0x0a9e('0x30')]);_0x58cb87[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x5a75d9[_0x0a9e('0x33')]);_0x58cb87['filters']=_[_0x0a9e('0x35')](_0x58cb87['model'],_0x58cb87[_0x0a9e('0x33')]);_0x4a396c[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x58cb87[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5a75d9[_0x0a9e('0x33')]['fields']));_0x4a396c[_0x0a9e('0x36')]=_0x4a396c[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x4a396c['attributes']:_0x58cb87[_0x0a9e('0x32')];if(!_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4a396c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x4a396c[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x4a396c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4a396c['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5a75d9[_0x0a9e('0x33')],_0x58cb87['filters']));_0x4a396c[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x5ef7e8['id'];if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4a396c['where']=_[_0x0a9e('0x3f')](_0x4a396c[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x4a396c[_0x0a9e('0x36')],function(_0x4e8eb9){var _0x2b263b={};_0x2b263b[_0x4e8eb9]={'$like':'%'+_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2b263b;})});}_0x4a396c=_[_0x0a9e('0x3f')]({},_0x4a396c,_0x5a75d9['options']);return db['ChatOfflineMessage'][_0x0a9e('0x22')]({'where':_0x4a396c[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x353960){_0x50e7ec[_0x0a9e('0x22')]=_0x353960;if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x4a396c[_0x0a9e('0x43')]=[{'all':!![]}];}else{_0x4a396c[_0x0a9e('0x43')]=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xc6')],'as':_0x0a9e('0x115'),'required':![]}];}return db[_0x0a9e('0xc1')]['findAll'](_0x4a396c);})[_0x0a9e('0x13')](function(_0x5ce227){_0x50e7ec[_0x0a9e('0x58')]=_0x5ce227;return _0x50e7ec;});}})['then'](respondWithFilteredResult(_0xcc859d,_0x4a396c))['catch'](handleError(_0xcc859d,null));};exports[_0x0a9e('0x116')]=function(_0x51ec16,_0x3d2007){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51ec16[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d2007,null))['then'](function(_0x2ad86f){if(_0x2ad86f){return _0x2ad86f[_0x0a9e('0x116')](_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x51ec16[_0x0a9e('0x50')],[_0x0a9e('0x5e'),'id'])||{})[_0x0a9e('0xbd')](function(_0x25f5fa){for(var _0x193ef7=0x0;_0x193ef7<_0x51ec16['body']['ids'][_0x0a9e('0x38')];_0x193ef7+=0x1){socket[_0x0a9e('0x117')](_0x0a9e('0x118'),{'UserId':Number(_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')][_0x193ef7]),'ChatWebsiteId':Number(_0x51ec16[_0x0a9e('0x47')]['id'])});}return _0x25f5fa;});}})[_0x0a9e('0x13')](respondWithResult(_0x3d2007,null))['catch'](handleError(_0x3d2007,null));};exports[_0x0a9e('0x119')]=function(_0xd73712,_0x173daf){return db['ChatWebsite']['find']({'where':{'id':_0xd73712['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x173daf,null))[_0x0a9e('0x13')](function(_0x5448ee){if(_0x5448ee){return _0x5448ee[_0x0a9e('0x119')](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])['then'](function(){if(_['isArray'](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])){for(var _0xf10a48=0x0;_0xf10a48<_0xd73712[_0x0a9e('0x33')]['ids'][_0x0a9e('0x38')];_0xf10a48+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd73712[_0x0a9e('0x33')]['ids'][_0xf10a48]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}}else{socket[_0x0a9e('0x117')](_0x0a9e('0x11a'),{'UserId':Number(_0xd73712['query'][_0x0a9e('0x5e')]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}});}})[_0x0a9e('0x13')](respondWithStatusCode(_0x173daf,null))['catch'](handleError(_0x173daf,null));};exports['getAgents']=function(_0x3aa901,_0xb3e9cb){var _0x34b05f={};var _0x21fcaa={};var _0x1c3b0e;var _0x1966dd;return db['ChatWebsite']['findOne']({'where':{'id':_0x3aa901[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xb3e9cb,null))['then'](function(_0x539f84){if(_0x539f84){_0x1c3b0e=_0x539f84;_0x21fcaa['model']=_['keys'](db['User']['rawAttributes']);_0x21fcaa[_0x0a9e('0x33')]=_['keys'](_0x3aa901[_0x0a9e('0x33')]);_0x21fcaa[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21fcaa[_0x0a9e('0x32')],_0x21fcaa[_0x0a9e('0x33')]);_0x34b05f[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x21fcaa['model'],qs[_0x0a9e('0x37')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x34b05f[_0x0a9e('0x36')]=_0x34b05f[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x34b05f[_0x0a9e('0x36')]:_0x21fcaa[_0x0a9e('0x32')];_0x34b05f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3aa901[_0x0a9e('0x33')]['sort']);_0x34b05f[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x3aa901[_0x0a9e('0x33')],_0x21fcaa['filters']));if(_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x34b05f['where']=_['merge'](_0x34b05f[_0x0a9e('0x3c')],{'$or':_['map'](_0x34b05f[_0x0a9e('0x36')],function(_0xa8c784){var _0x132f85={};_0x132f85[_0xa8c784]={'$like':'%'+_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x132f85;})});}_0x34b05f=_['merge']({},_0x34b05f,_0x3aa901[_0x0a9e('0x41')]);return _0x1c3b0e['getAgents'](_0x34b05f);}})['then'](function(_0x398a88){if(_0x398a88){_0x1966dd=_0x398a88[_0x0a9e('0x38')];if(!_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x34b05f['limit']=qs[_0x0a9e('0x21')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x34b05f[_0x0a9e('0x1f')]=qs['offset'](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x1c3b0e['getAgents'](_0x34b05f);}})[_0x0a9e('0x13')](function(_0x36d8a1){if(_0x36d8a1){return _0x36d8a1?{'count':_0x1966dd,'rows':_0x36d8a1}:null;}})[_0x0a9e('0x13')](respondWithResult(_0xb3e9cb,null))[_0x0a9e('0x45')](handleError(_0xb3e9cb,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 63c4461..20839dc 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 _0x6dfa=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x5b50ae,_0x7da7e1){var _0x84eb56=function(_0xad6b38){while(--_0xad6b38){_0x5b50ae['push'](_0x5b50ae['shift']());}};_0x84eb56(++_0x7da7e1);}(_0x6dfa,0x7b));var _0xa6df=function(_0x25843d,_0x573af0){_0x25843d=_0x25843d-0x0;var _0x1e9e8d=_0x6dfa[_0x25843d];return _0x1e9e8d;};'use strict';var EventEmitter=require(_0xa6df('0x0'));var ChatWebsite=require(_0xa6df('0x1'))['db'][_0xa6df('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa6df('0x3')](0x0);var events={'afterCreate':_0xa6df('0x4'),'afterUpdate':'update','afterDestroy':_0xa6df('0x5')};function emitEvent(_0x4e356f){return function(_0x2ea163,_0x4da450,_0x5b92a8){ChatWebsiteEvents[_0xa6df('0x6')](_0x4e356f+':'+_0x2ea163['id'],_0x2ea163);ChatWebsiteEvents[_0xa6df('0x6')](_0x4e356f,_0x2ea163);_0x5b92a8(null);};}for(var e in events){if(events[_0xa6df('0x7')](e)){var event=events[e];ChatWebsite[_0xa6df('0x8')](e,emitEvent(event));}}module[_0xa6df('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe015=['update','emit','hasOwnProperty','events','../../mysqldb','ChatWebsite'];(function(_0x2a6385,_0xf10ba0){var _0x258535=function(_0x5bcfbb){while(--_0x5bcfbb){_0x2a6385['push'](_0x2a6385['shift']());}};_0x258535(++_0xf10ba0);}(_0xe015,0x13b));var _0x5e01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe015[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5e01('0x0'));var ChatWebsite=require(_0x5e01('0x1'))['db'][_0x5e01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e01('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2136cf){return function(_0x420f00,_0x7ce4b9,_0x241c0e){ChatWebsiteEvents['emit'](_0x2136cf+':'+_0x420f00['id'],_0x420f00);ChatWebsiteEvents[_0x5e01('0x4')](_0x2136cf,_0x420f00);_0x241c0e(null);};}for(var e in events){if(events[_0x5e01('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index dc68d1e..2570a12 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 _0xe3d8=['bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment'];(function(_0x1758dc,_0x2a24a8){var _0x4ba456=function(_0x197ec8){while(--_0x197ec8){_0x1758dc['push'](_0x1758dc['shift']());}};_0x4ba456(++_0x2a24a8);}(_0xe3d8,0xd9));var _0x8e3d=function(_0x174d35,_0x934581){_0x174d35=_0x174d35-0x0;var _0x172697=_0xe3d8[_0x174d35];return _0x172697;};'use strict';var _=require('lodash');var util=require(_0x8e3d('0x0'));var logger=require(_0x8e3d('0x1'))(_0x8e3d('0x2'));var moment=require(_0x8e3d('0x3'));var BPromise=require(_0x8e3d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e3d('0x5'));var rimraf=require(_0x8e3d('0x6'));var config=require(_0x8e3d('0x7'));var attributes=require(_0x8e3d('0x8'));module[_0x8e3d('0x9')]=function(_0xc73f24,_0x163203){return _0xc73f24[_0x8e3d('0xa')](_0x8e3d('0xb'),attributes,{'tableName':_0x8e3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9ab=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfed6c5,_0x208e71){var _0x143596=function(_0x9226b7){while(--_0x9226b7){_0xfed6c5['push'](_0xfed6c5['shift']());}};_0x143596(++_0x208e71);}(_0xc9ab,0x17f));var _0xbc9a=function(_0x886d08,_0x2b985d){_0x886d08=_0x886d08-0x0;var _0x163828=_0xc9ab[_0x886d08];return _0x163828;};'use strict';var _=require(_0xbc9a('0x0'));var util=require(_0xbc9a('0x1'));var logger=require('../../config/logger')(_0xbc9a('0x2'));var moment=require(_0xbc9a('0x3'));var BPromise=require(_0xbc9a('0x4'));var rp=require(_0xbc9a('0x5'));var fs=require('fs');var path=require(_0xbc9a('0x6'));var rimraf=require(_0xbc9a('0x7'));var config=require(_0xbc9a('0x8'));var attributes=require(_0xbc9a('0x9'));module[_0xbc9a('0xa')]=function(_0x584e48,_0x5593d1){return _0x584e48[_0xbc9a('0xb')](_0xbc9a('0xc'),attributes,{'tableName':_0xbc9a('0xd'),'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 705d56f..fde676e 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 _0x98ab=['code','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x98ab,0x101));var _0xb98a=function(_0xbd1964,_0x2e77a8){_0xbd1964=_0xbd1964-0x0;var _0x1242b4=_0x98ab[_0xbd1964];return _0x1242b4;};'use strict';var _=require(_0xb98a('0x0'));var util=require(_0xb98a('0x1'));var moment=require('moment');var BPromise=require(_0xb98a('0x2'));var rs=require(_0xb98a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb98a('0x4'))['db'];var utils=require(_0xb98a('0x5'));var logger=require(_0xb98a('0x6'))(_0xb98a('0x7'));var config=require(_0xb98a('0x8'));var jayson=require(_0xb98a('0x9'));var client=jayson['client'][_0xb98a('0xa')]({'port':0x232a});config['redis']=_[_0xb98a('0xb')](config[_0xb98a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb98a('0xc')]));require('./chatWebsite.socket')[_0xb98a('0xd')](socket);function respondWithRpcPromise(_0x22000e,_0x5d764d,_0x5274b3){return new BPromise(function(_0x33b0c3,_0x29992a){return client['request'](_0x22000e,_0x5274b3)[_0xb98a('0xe')](function(_0x3f0a6c){logger['info'](_0xb98a('0xf'),_0x5d764d,_0xb98a('0x10'));logger['debug'](_0xb98a('0x11'),_0x5d764d,_0xb98a('0x10'),JSON['stringify'](_0x3f0a6c));if(_0x3f0a6c['error']){if(_0x3f0a6c[_0xb98a('0x12')][_0xb98a('0x13')]===0x1f4){logger['error'](_0xb98a('0xf'),_0x5d764d,_0x3f0a6c[_0xb98a('0x12')]['message']);return _0x29992a(_0x3f0a6c[_0xb98a('0x12')][_0xb98a('0x14')]);}logger['error'](_0xb98a('0xf'),_0x5d764d,_0x3f0a6c[_0xb98a('0x12')]['message']);return _0x33b0c3(_0x3f0a6c[_0xb98a('0x12')][_0xb98a('0x14')]);}else{logger[_0xb98a('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5d764d,'request\x20sent');_0x33b0c3(_0x3f0a6c['result'][_0xb98a('0x14')]);}})[_0xb98a('0x16')](function(_0x250edc){logger[_0xb98a('0x12')](_0xb98a('0xf'),_0x5d764d,_0x250edc);_0x29992a(_0x250edc);});});} \ No newline at end of file +var _0x6002=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xe7aa8a,_0x2eec45){var _0xd7df8c=function(_0x414f72){while(--_0x414f72){_0xe7aa8a['push'](_0xe7aa8a['shift']());}};_0xd7df8c(++_0x2eec45);}(_0x6002,0x117));var _0x2600=function(_0x107132,_0x13f848){_0x107132=_0x107132-0x0;var _0xeb25b1=_0x6002[_0x107132];return _0xeb25b1;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var moment=require('moment');var BPromise=require(_0x2600('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2600('0x3'));var db=require(_0x2600('0x4'))['db'];var utils=require(_0x2600('0x5'));var logger=require(_0x2600('0x6'))('rpc');var config=require(_0x2600('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2600('0x8')][_0x2600('0x9')]({'port':0x232a});config['redis']=_[_0x2600('0xa')](config[_0x2600('0xb')],{'host':_0x2600('0xc'),'port':0x18eb});var socket=require(_0x2600('0xd'))(new Redis(config[_0x2600('0xb')]));require(_0x2600('0xe'))[_0x2600('0xf')](socket);function respondWithRpcPromise(_0x9d0649,_0xa87290,_0x494815){return new BPromise(function(_0x1532db,_0x1b93bf){return client[_0x2600('0x10')](_0x9d0649,_0x494815)[_0x2600('0x11')](function(_0x5b759c){logger[_0x2600('0x12')](_0x2600('0x13'),_0xa87290,_0x2600('0x14'));logger[_0x2600('0x15')](_0x2600('0x16'),_0xa87290,_0x2600('0x14'),JSON[_0x2600('0x17')](_0x5b759c));if(_0x5b759c[_0x2600('0x18')]){if(_0x5b759c[_0x2600('0x18')][_0x2600('0x19')]===0x1f4){logger['error'](_0x2600('0x13'),_0xa87290,_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);return _0x1b93bf(_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);}logger['error'](_0x2600('0x13'),_0xa87290,_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);return _0x1532db(_0x5b759c[_0x2600('0x18')]['message']);}else{logger['info'](_0x2600('0x13'),_0xa87290,_0x2600('0x14'));_0x1532db(_0x5b759c['result'][_0x2600('0x1a')]);}})[_0x2600('0x1b')](function(_0x41db0b){logger[_0x2600('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xa87290,_0x41db0b);_0x1b93bf(_0x41db0b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 19e5aa8..a34e173 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 _0x3af5=['removeListener','register','length','./chatWebsite.events','emit'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x3af5,0xa8));var _0x53af=function(_0x4b418f,_0x3b6a96){_0x4b418f=_0x4b418f-0x0;var _0x2ed208=_0x3af5[_0x4b418f];return _0x2ed208;};'use strict';var ChatWebsiteEvents=require(_0x53af('0x0'));var events=['save','remove','update'];function createListener(_0x34b988,_0xeee9a0){return function(_0x1809b0){_0xeee9a0[_0x53af('0x1')](_0x34b988,_0x1809b0);};}function removeListener(_0x2e72b6,_0x593eed){return function(){ChatWebsiteEvents[_0x53af('0x2')](_0x2e72b6,_0x593eed);};}exports[_0x53af('0x3')]=function(_0x512510){for(var _0x1ed571=0x0,_0x2e389f=events[_0x53af('0x4')];_0x1ed571<_0x2e389f;_0x1ed571++){var _0x32b4c0=events[_0x1ed571];var _0x55d644=createListener('chatWebsite:'+_0x32b4c0,_0x512510);ChatWebsiteEvents['on'](_0x32b4c0,_0x55d644);}}; \ No newline at end of file +var _0x5c27=['update','emit','removeListener','chatWebsite:','./chatWebsite.events','save'];(function(_0x544700,_0x37f134){var _0x39260b=function(_0x4faf4a){while(--_0x4faf4a){_0x544700['push'](_0x544700['shift']());}};_0x39260b(++_0x37f134);}(_0x5c27,0x19c));var _0x75c2=function(_0x54ece6,_0x11a6c6){_0x54ece6=_0x54ece6-0x0;var _0x2cfd35=_0x5c27[_0x54ece6];return _0x2cfd35;};'use strict';var ChatWebsiteEvents=require(_0x75c2('0x0'));var events=[_0x75c2('0x1'),'remove',_0x75c2('0x2')];function createListener(_0x205d27,_0x4844cf){return function(_0x469b63){_0x4844cf[_0x75c2('0x3')](_0x205d27,_0x469b63);};}function removeListener(_0x2d9f08,_0x4f848f){return function(){ChatWebsiteEvents[_0x75c2('0x4')](_0x2d9f08,_0x4f848f);};}exports['register']=function(_0x3b5b92){for(var _0x5b37f5=0x0,_0x28704c=events['length'];_0x5b37f5<_0x28704c;_0x5b37f5++){var _0x44dab3=events[_0x5b37f5];var _0x158299=createListener(_0x75c2('0x5')+_0x44dab3,_0x3b5b92);ChatWebsiteEvents['on'](_0x44dab3,_0x158299);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8153187..9782040 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 _0x6354=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','addDisposition','post','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','any','offline','addInteraction','addProactiveActions','put','update','delete','removeDispositions','removeAgents','exports','multer'];(function(_0x5b0d9d,_0x427871){var _0x3f7330=function(_0x4a97ce){while(--_0x4a97ce){_0x5b0d9d['push'](_0x5b0d9d['shift']());}};_0x3f7330(++_0x427871);}(_0x6354,0x14e));var _0x4635=function(_0x5d728f,_0xfbad5f){_0x5d728f=_0x5d728f-0x0;var _0x440b1a=_0x6354[_0x5d728f];return _0x440b1a;};'use strict';var multer=require(_0x4635('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4635('0x1'));var express=require(_0x4635('0x2'));var router=express[_0x4635('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4635('0x4'));var interaction=require(_0x4635('0x5'));var config=require(_0x4635('0x6'));var controller=require(_0x4635('0x7'));router['get']('/',auth[_0x4635('0x8')](),controller[_0x4635('0x9')]);router[_0x4635('0xa')](_0x4635('0xb'),auth['isAuthenticated'](),controller[_0x4635('0xc')]);router['get'](_0x4635('0xd'),auth[_0x4635('0x8')](),controller[_0x4635('0xe')]);router[_0x4635('0xa')](_0x4635('0xf'),auth[_0x4635('0x8')](),controller['getDispositions']);router['get'](_0x4635('0x10'),auth[_0x4635('0x8')](),controller['getAnswers']);router['get'](_0x4635('0x11'),controller[_0x4635('0x12')]);router['get'](_0x4635('0x13'),controller['getAvatar']);router[_0x4635('0xa')](_0x4635('0x14'),controller[_0x4635('0x15')]);router[_0x4635('0xa')](_0x4635('0x16'),controller[_0x4635('0x17')]);router[_0x4635('0xa')](_0x4635('0x18'),auth[_0x4635('0x8')](),controller[_0x4635('0x19')]);router[_0x4635('0xa')](_0x4635('0x1a'),controller['getSnippet']);router[_0x4635('0xa')](_0x4635('0x1b'),auth[_0x4635('0x8')](),controller['getApplications']);router[_0x4635('0xa')](_0x4635('0x1c'),auth[_0x4635('0x8')](),controller[_0x4635('0x1d')]);router['get']('/:id/fields',controller[_0x4635('0x1e')]);router['get'](_0x4635('0x1f'),auth[_0x4635('0x8')](),controller[_0x4635('0x20')]);router[_0x4635('0xa')](_0x4635('0x21'),auth[_0x4635('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x4635('0x22')]);router['post']('/:id/dispositions',auth[_0x4635('0x8')](),controller[_0x4635('0x23')]);router[_0x4635('0x24')](_0x4635('0x10'),auth[_0x4635('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x4635('0x25')]({'destination':function(_0x2daa4d,_0x14f0f3,_0x273fbf){_0x273fbf(null,path['join'](config[_0x4635('0x26')],_0x4635('0x27')));},'filename':function(_0x5c8588,_0x40ba24,_0x28d253){_0x28d253(null,util[_0x4635('0x28')](_0x4635('0x29'),Date[_0x4635('0x2a')](),_0x40ba24[_0x4635('0x2b')]));}})});router[_0x4635('0x24')](_0x4635('0x11'),upload[_0x4635('0x2c')](_0x4635('0x2d')),controller[_0x4635('0x2e')]);var upload=multer({'storage':multer[_0x4635('0x25')]({'destination':function(_0x41542d,_0x4ad2f,_0x454fb1){_0x454fb1(null,path[_0x4635('0x2f')](config[_0x4635('0x26')],'server/files/images/avatars/'));},'filename':function(_0x3b4efc,_0x52c216,_0x39321e){_0x39321e(null,util[_0x4635('0x28')](_0x4635('0x29'),Date[_0x4635('0x2a')](),_0x52c216['originalname']));}})});router[_0x4635('0x24')](_0x4635('0x13'),upload['single'](_0x4635('0x2d')),controller[_0x4635('0x30')]);var upload=multer({'storage':multer[_0x4635('0x25')]({'destination':function(_0xac8c8e,_0x1fa5c9,_0x58c391){_0x58c391(null,path[_0x4635('0x2f')](config[_0x4635('0x26')],'server/files/images/avatars/'));},'filename':function(_0x2c470e,_0xcd8c87,_0x4352b4){_0x4352b4(null,util['format'](_0x4635('0x29'),Date['now'](),_0xcd8c87[_0x4635('0x2b')]));}})});router[_0x4635('0x24')]('/:id/customer_avatar',upload['single'](_0x4635('0x2d')),controller[_0x4635('0x31')]);var upload=multer({'storage':multer[_0x4635('0x25')]({'destination':function(_0x4ce251,_0x4fcabf,_0x2645d5){_0x2645d5(null,path[_0x4635('0x2f')](config['root'],_0x4635('0x32')));},'filename':function(_0x2a4fab,_0x26a2e3,_0x15b14e){_0x15b14e(null,util[_0x4635('0x28')](_0x4635('0x29'),Date['now'](),_0x26a2e3[_0x4635('0x2b')]));}})});router['post'](_0x4635('0x16'),upload[_0x4635('0x2c')](_0x4635('0x2d')),controller[_0x4635('0x33')]);router[_0x4635('0x24')](_0x4635('0x34'),controller[_0x4635('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x51293f,_0x2505cb,_0x44afa5){const _0x1c62ec=path[_0x4635('0x2f')](config['root'],_0x4635('0x36'),'attachments','offline-chat');fs_extra[_0x4635('0x37')](_0x1c62ec,function(){_0x44afa5(null,_0x1c62ec);});},'filename':function(_0x3aca36,_0x6b99f5,_0x338055){const _0x5e6c5d=_0x6b99f5[_0x4635('0x2b')][_0x4635('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x425476=path['extname'](_0x5e6c5d);const _0x4d4587=Date['now']()+'-'+_0x5e6c5d[_0x4635('0x38')](_0x425476,'')+_0x425476;_0x338055(null,_0x4d4587);}})});router[_0x4635('0x24')]('/:id/offline',offlineUploadMulter[_0x4635('0x39')](),controller[_0x4635('0x3a')]);router[_0x4635('0x24')](_0x4635('0x18'),auth['isAuthenticated'](),controller[_0x4635('0x3b')]);router[_0x4635('0x24')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x4635('0x1c'),auth[_0x4635('0x8')](),controller[_0x4635('0x3c')]);router[_0x4635('0x24')](_0x4635('0x21'),auth[_0x4635('0x8')](),controller['addAgents']);router[_0x4635('0x3d')](_0x4635('0xd'),auth[_0x4635('0x8')](),controller[_0x4635('0x3e')]);router[_0x4635('0x3f')](_0x4635('0xd'),auth[_0x4635('0x8')](),controller['destroy']);router['delete'](_0x4635('0xf'),auth[_0x4635('0x8')](),controller[_0x4635('0x40')]);router[_0x4635('0x3f')]('/:id/canned_answers',auth[_0x4635('0x8')](),controller['removeAnswers']);router[_0x4635('0x3f')](_0x4635('0x21'),auth[_0x4635('0x8')](),controller[_0x4635('0x41')]);module[_0x4635('0x42')]=router; \ No newline at end of file +var _0x2cb7=['connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','/:id/dispositions','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','addDisposition','addAnswer','join','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','addLogo','diskStorage','server/files/images/avatars/','format','root','file','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','extname','any','offline','addInteraction','/:id/applications','addApplications','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','/:id/users','removeAgents','exports','util'];(function(_0x5b5e65,_0x4b7417){var _0x230214=function(_0x2d968a){while(--_0x2d968a){_0x5b5e65['push'](_0x5b5e65['shift']());}};_0x230214(++_0x4b7417);}(_0x2cb7,0x81));var _0x72cb=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0x2cb7[_0x699200];return _0x266fd1;};'use strict';var multer=require('multer');var util=require(_0x72cb('0x0'));var path=require('path');var timeout=require(_0x72cb('0x1'));var express=require(_0x72cb('0x2'));var router=express['Router']();var fs_extra=require(_0x72cb('0x3'));var auth=require(_0x72cb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x72cb('0x5'));router['get']('/',auth[_0x72cb('0x6')](),controller[_0x72cb('0x7')]);router[_0x72cb('0x8')]('/describe',auth[_0x72cb('0x6')](),controller[_0x72cb('0x9')]);router[_0x72cb('0x8')](_0x72cb('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x72cb('0xb'),auth[_0x72cb('0x6')](),controller['getDispositions']);router[_0x72cb('0x8')]('/:id/canned_answers',auth[_0x72cb('0x6')](),controller[_0x72cb('0xc')]);router[_0x72cb('0x8')]('/:id/logo',controller[_0x72cb('0xd')]);router[_0x72cb('0x8')](_0x72cb('0xe'),controller['getAvatar']);router[_0x72cb('0x8')](_0x72cb('0xf'),controller[_0x72cb('0x10')]);router[_0x72cb('0x8')](_0x72cb('0x11'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x72cb('0x12')]);router[_0x72cb('0x8')](_0x72cb('0x13'),controller['getSnippet']);router[_0x72cb('0x8')]('/:id/applications',auth[_0x72cb('0x6')](),controller[_0x72cb('0x14')]);router[_0x72cb('0x8')](_0x72cb('0x15'),auth['isAuthenticated'](),controller[_0x72cb('0x16')]);router[_0x72cb('0x8')](_0x72cb('0x17'),controller[_0x72cb('0x18')]);router[_0x72cb('0x8')](_0x72cb('0x19'),auth[_0x72cb('0x6')](),controller['getOfflineMessages']);router[_0x72cb('0x8')]('/:id/users',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1a')]);router[_0x72cb('0x1b')]('/',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1c')]);router['post'](_0x72cb('0xb'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x1d')]);router[_0x72cb('0x1b')]('/:id/canned_answers',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a77fd,_0x3ddbe0,_0x24e819){_0x24e819(null,path[_0x72cb('0x1f')](config['root'],_0x72cb('0x20')));},'filename':function(_0x8df478,_0x466e9a,_0x383dca){_0x383dca(null,util['format'](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x466e9a[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0x24'),upload[_0x72cb('0x25')]('file'),controller[_0x72cb('0x26')]);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x4ac6ed,_0x1023db,_0x349e46){_0x349e46(null,path[_0x72cb('0x1f')](config['root'],_0x72cb('0x28')));},'filename':function(_0x339d3c,_0x12821f,_0xd0b144){_0xd0b144(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x12821f[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0xe'),upload[_0x72cb('0x25')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x121ade,_0x4bf9f6,_0x275600){_0x275600(null,path['join'](config[_0x72cb('0x2a')],_0x72cb('0x28')));},'filename':function(_0x5cdf9c,_0x4c7e52,_0xec8a39){_0xec8a39(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x4c7e52['originalname']));}})});router[_0x72cb('0x1b')](_0x72cb('0xf'),upload[_0x72cb('0x25')](_0x72cb('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x7d1bed,_0x193d47,_0x5437a5){_0x5437a5(null,path[_0x72cb('0x1f')](config[_0x72cb('0x2a')],_0x72cb('0x28')));},'filename':function(_0x6b72bb,_0xac6549,_0x4280ff){_0x4280ff(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0xac6549[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0x11'),upload[_0x72cb('0x25')](_0x72cb('0x2b')),controller[_0x72cb('0x2c')]);router[_0x72cb('0x1b')](_0x72cb('0x2d'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x57fbb6,_0x56736a,_0x587291){const _0x4eed2e=path[_0x72cb('0x1f')](config[_0x72cb('0x2a')],_0x72cb('0x2e'),_0x72cb('0x2f'),_0x72cb('0x30'));fs_extra['ensureDir'](_0x4eed2e,function(){_0x587291(null,_0x4eed2e);});},'filename':function(_0x32c5c0,_0x283f32,_0x4d548d){const _0xcce1b2=_0x283f32[_0x72cb('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3f6495=path[_0x72cb('0x31')](_0xcce1b2);const _0x14d615=Date[_0x72cb('0x22')]()+'-'+_0xcce1b2['replace'](_0x3f6495,'')+_0x3f6495;_0x4d548d(null,_0x14d615);}})});router[_0x72cb('0x1b')]('/:id/offline',offlineUploadMulter[_0x72cb('0x32')](),controller[_0x72cb('0x33')]);router[_0x72cb('0x1b')]('/:id/interactions',auth[_0x72cb('0x6')](),controller[_0x72cb('0x34')]);router[_0x72cb('0x1b')](_0x72cb('0x35'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x36')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x72cb('0x37')]('/:id',auth[_0x72cb('0x6')](),controller[_0x72cb('0x38')]);router[_0x72cb('0x39')](_0x72cb('0xa'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x3a')]);router[_0x72cb('0x39')]('/:id/dispositions',auth[_0x72cb('0x6')](),controller[_0x72cb('0x3b')]);router[_0x72cb('0x39')](_0x72cb('0x3c'),auth['isAuthenticated'](),controller[_0x72cb('0x3d')]);router[_0x72cb('0x39')](_0x72cb('0x3e'),auth['isAuthenticated'](),controller[_0x72cb('0x3f')]);module[_0x72cb('0x40')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b6561cf..22a4f10 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff6d=['../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','express'];(function(_0x1a7cab,_0x261e6a){var _0x12d0cf=function(_0xef75d){while(--_0xef75d){_0x1a7cab['push'](_0x1a7cab['shift']());}};_0x12d0cf(++_0x261e6a);}(_0xff6d,0x11d));var _0xdff6=function(_0x2a2f8a,_0x5d3058){_0x2a2f8a=_0x2a2f8a-0x0;var _0x1de5f6=_0xff6d[_0x2a2f8a];return _0x1de5f6;};var beaverLogger=require('beaver-logger/server');var express=require(_0xdff6('0x0'));var auth=require(_0xdff6('0x1'));var config=require(_0xdff6('0x2'));var router=express[_0xdff6('0x3')]();var isProduction=config[_0xdff6('0x4')]===_0xdff6('0x5')||![];function clientSideLogs(_0x45c4a8,_0x23dbaf,_0x2cc27c){var _0x4ea203=_0x45c4a8[_0xdff6('0x6')][_0xdff6('0x7')](_0xdff6('0x8'));if(!_0x4ea203){throw new Error(_0xdff6('0x9'));}return beaverLogger[_0xdff6('0xa')]({'uri':'/client-logs','logger':_0x4ea203,'enableCors':!isProduction})(_0x45c4a8,_0x23dbaf,_0x2cc27c);}router['use'](auth[_0xdff6('0xb')](),clientSideLogs);module[_0xdff6('0xc')]=router; \ No newline at end of file +var _0x84f9=['env','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','Router'];(function(_0x5ad358,_0x342f88){var _0x190226=function(_0x3c7ead){while(--_0x3c7ead){_0x5ad358['push'](_0x5ad358['shift']());}};_0x190226(++_0x342f88);}(_0x84f9,0x13b));var _0x984f=function(_0x46275a,_0x157c56){_0x46275a=_0x46275a-0x0;var _0x1b6b39=_0x84f9[_0x46275a];return _0x1b6b39;};var beaverLogger=require(_0x984f('0x0'));var express=require(_0x984f('0x1'));var auth=require(_0x984f('0x2'));var config=require('../config/environment');var router=express[_0x984f('0x3')]();var isProduction=config[_0x984f('0x4')]==='production'||![];function clientSideLogs(_0x170a9a,_0x1b4238,_0x2c65f2){var _0x225b2c=_0x170a9a[_0x984f('0x5')][_0x984f('0x6')]('client-side-logger');if(!_0x225b2c){throw new Error(_0x984f('0x7'));}return beaverLogger[_0x984f('0x8')]({'uri':'/client-logs','logger':_0x225b2c,'enableCors':!isProduction})(_0x170a9a,_0x1b4238,_0x2c65f2);}router[_0x984f('0x9')](auth[_0x984f('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ee7846f..e28a0e1 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8418=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x5653e7,_0x417f0a){var _0x1b2773=function(_0x3a19e2){while(--_0x3a19e2){_0x5653e7['push'](_0x5653e7['shift']());}};_0x1b2773(++_0x417f0a);}(_0x8418,0x180));var _0x8841=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x8418[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require('sequelize');module[_0x8841('0x0')]={'name':{'type':Sequelize[_0x8841('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8841('0x2')](_0x8841('0x3'),_0x8841('0x4'),_0x8841('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8841('0x2')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x8841('0x1')],'comment':_0x8841('0x6')},'data2':{'type':Sequelize[_0x8841('0x1')],'comment':_0x8841('0x7')},'data3':{'type':Sequelize[_0x8841('0x1')],'comment':_0x8841('0x8')},'data4':{'type':Sequelize[_0x8841('0x1')],'comment':_0x8841('0x9')},'data5':{'type':Sequelize[_0x8841('0xa')],'comment':_0x8841('0xb')},'data6':{'type':Sequelize[_0x8841('0xa')],'comment':_0x8841('0xc')},'data7':{'type':Sequelize[_0x8841('0xa')],'comment':_0x8841('0xd')}}; \ No newline at end of file +var _0x9165=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x16d2c3,_0x3ca212){var _0x538674=function(_0x549e0b){while(--_0x549e0b){_0x16d2c3['push'](_0x16d2c3['shift']());}};_0x538674(++_0x3ca212);}(_0x9165,0x17e));var _0x5916=function(_0x3dbce7,_0x1756dd){_0x3dbce7=_0x3dbce7-0x0;var _0x226f10=_0x9165[_0x3dbce7];return _0x226f10;};'use strict';var Sequelize=require('sequelize');module[_0x5916('0x0')]={'name':{'type':Sequelize[_0x5916('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x3'),'Google',_0x5916('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x5916('0x1')],'comment':_0x5916('0x6')},'data2':{'type':Sequelize[_0x5916('0x1')],'comment':_0x5916('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x5916('0x8')},'data5':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xa')},'data6':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xb')},'data7':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 749a576..cd50272 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23a0=['findAll','rows','service','data3','catch','show','params','MicrosoftAzure','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x23a0,0x89));var _0x023a=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x23a0[_0x56e0e8];return _0x2dab50;};'use strict';var _=require(_0x023a('0x0'));var Redis=require(_0x023a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x023a('0x2'));var config=require(_0x023a('0x3'));var logger=require(_0x023a('0x4'))(_0x023a('0x5'));var db=require(_0x023a('0x6'))['db'];var oauth=require(_0x023a('0x7'));config[_0x023a('0x8')]=_[_0x023a('0x9')](config[_0x023a('0x8')],{'host':_0x023a('0xa'),'port':0x18eb});var socket=require(_0x023a('0xb'))(new Redis(config[_0x023a('0x8')]));var redis=new Redis(config[_0x023a('0x8')]);function respondWithStatusCode(_0x5d4a73,_0x516d9b){_0x516d9b=_0x516d9b||0xcc;return function(_0x948c4f){if(_0x948c4f){return _0x5d4a73['sendStatus'](_0x516d9b);}return _0x5d4a73[_0x023a('0xc')](_0x516d9b)[_0x023a('0xd')]();};}function respondWithResult(_0xadce97,_0x4cb07f){_0x4cb07f=_0x4cb07f||0xc8;return function(_0x9462d6){if(_0x9462d6){return _0xadce97[_0x023a('0xc')](_0x4cb07f)[_0x023a('0xe')](_0x9462d6);}};}function respondWithFilteredResult(_0x2c4aab,_0x4a641c){return function(_0x5d84b7){if(_0x5d84b7){var _0xb7cb87=typeof _0x4a641c[_0x023a('0xf')]==='undefined'&&typeof _0x4a641c[_0x023a('0x10')]===_0x023a('0x11');var _0x26f380=_0x5d84b7[_0x023a('0x12')];var _0x95d03f=_0xb7cb87?0x0:_0x4a641c['offset'];var _0x146fe8=_0xb7cb87?_0x5d84b7[_0x023a('0x12')]:_0x4a641c['offset']+_0x4a641c[_0x023a('0x10')];var _0x18802c;if(_0x146fe8>=_0x26f380){_0x146fe8=_0x26f380;_0x18802c=0xc8;}else{_0x18802c=0xce;}_0x2c4aab['status'](_0x18802c);return _0x2c4aab['set']('Content-Range',_0x95d03f+'-'+_0x146fe8+'/'+_0x26f380)[_0x023a('0xe')](_0x5d84b7);}return null;};}function saveUpdates(_0x43491c){return function(_0x43d79c){if(_0x43d79c){return _0x43d79c[_0x023a('0x13')](_0x43491c)[_0x023a('0x14')](function(_0x21b1d0){return _0x21b1d0;});}return null;};}function removeEntity(_0x4169ea){return function(_0x544d22){if(_0x544d22){return _0x544d22[_0x023a('0x15')]()[_0x023a('0x14')](function(){_0x4169ea[_0x023a('0xc')](0xcc)[_0x023a('0xd')]();});}};}function handleEntityNotFound(_0x53bc65){return function(_0x11c585){if(!_0x11c585){_0x53bc65[_0x023a('0x16')](0x194);}return _0x11c585;};}function handleError(_0x3417e9,_0x1be051){_0x1be051=_0x1be051||0x1f4;return function(_0x4dde4c){logger[_0x023a('0x17')](_0x4dde4c[_0x023a('0x18')]);if(_0x4dde4c[_0x023a('0x19')]){delete _0x4dde4c[_0x023a('0x19')];}_0x3417e9['status'](_0x1be051)[_0x023a('0x1a')](_0x4dde4c);};}function maskClientSecret(_0x5caa1b){return _[_0x023a('0x1b')](_0x5caa1b[_0x023a('0x1c')](0x0,0x3),0x14,'*');}exports[_0x023a('0x1d')]=function(_0x2396ab,_0xc8329a){var _0x234f14={},_0x43f722={},_0x4338d5={'count':0x0,'rows':[]};var _0xd7e08a=_['map'](db[_0x023a('0x1e')][_0x023a('0x1f')],function(_0x1dedb4){return{'name':_0x1dedb4[_0x023a('0x20')],'type':_0x1dedb4[_0x023a('0x21')]['key']};});_0x43f722[_0x023a('0x22')]=_[_0x023a('0x23')](_0xd7e08a,_0x023a('0x19'));_0x43f722[_0x023a('0x24')]=_[_0x023a('0x25')](_0x2396ab[_0x023a('0x24')]);_0x43f722[_0x023a('0x26')]=_[_0x023a('0x27')](_0x43f722[_0x023a('0x22')],_0x43f722[_0x023a('0x24')]);_0x234f14['attributes']=_[_0x023a('0x27')](_0x43f722[_0x023a('0x22')],qs[_0x023a('0x28')](_0x2396ab[_0x023a('0x24')][_0x023a('0x28')]));_0x234f14['attributes']=_0x234f14[_0x023a('0x29')][_0x023a('0x2a')]?_0x234f14[_0x023a('0x29')]:_0x43f722['model'];if(!_0x2396ab[_0x023a('0x24')]['hasOwnProperty'](_0x023a('0x2b'))){_0x234f14[_0x023a('0x10')]=qs['limit'](_0x2396ab[_0x023a('0x24')]['limit']);_0x234f14['offset']=qs[_0x023a('0xf')](_0x2396ab['query'][_0x023a('0xf')]);}_0x234f14[_0x023a('0x2c')]=qs[_0x023a('0x2d')](_0x2396ab['query']['sort']);_0x234f14[_0x023a('0x2e')]=qs['filters'](_[_0x023a('0x2f')](_0x2396ab[_0x023a('0x24')],_0x43f722[_0x023a('0x26')]),_0xd7e08a);if(_0x2396ab[_0x023a('0x24')]['filter']){_0x234f14['where']=_[_0x023a('0x30')](_0x234f14['where'],{'$or':_[_0x023a('0x23')](_0xd7e08a,function(_0x52639b){if(_0x52639b[_0x023a('0x21')]!==_0x023a('0x31')){var _0x584ecd={};_0x584ecd[_0x52639b['name']]={'$like':'%'+_0x2396ab[_0x023a('0x24')]['filter']+'%'};return _0x584ecd;}})});}_0x234f14=_[_0x023a('0x30')]({},_0x234f14,_0x2396ab[_0x023a('0x32')]);var _0x22b87f={'where':_0x234f14[_0x023a('0x2e')]};return db[_0x023a('0x1e')]['count'](_0x22b87f)[_0x023a('0x14')](function(_0x366c5f){_0x4338d5['count']=_0x366c5f;if(_0x2396ab[_0x023a('0x24')][_0x023a('0x33')]){_0x234f14[_0x023a('0x34')]=[{'all':!![]}];}return db[_0x023a('0x1e')][_0x023a('0x35')](_0x234f14);})[_0x023a('0x14')](function(_0x4c3a8d){_0x4338d5[_0x023a('0x36')]=_[_0x023a('0x23')](_0x4c3a8d,function(_0x4845dd){if(_0x4845dd[_0x023a('0x37')]==='MicrosoftAzure'){var _0x3304b1=encryptor['decryptString'](_0x4845dd[_0x023a('0x38')]);_0x4845dd[_0x023a('0x38')]=maskClientSecret(_0x3304b1);}return _0x4845dd;});return _0x4338d5;})[_0x023a('0x14')](respondWithFilteredResult(_0xc8329a,_0x234f14))[_0x023a('0x39')](handleError(_0xc8329a,null));};exports[_0x023a('0x3a')]=function(_0x4d73cf,_0xcadb08){var _0x5dd61a={'raw':!![],'where':{'id':_0x4d73cf[_0x023a('0x3b')]['id']}},_0x4f3df8={};_0x4f3df8[_0x023a('0x22')]=_[_0x023a('0x25')](db[_0x023a('0x1e')][_0x023a('0x1f')]);_0x4f3df8[_0x023a('0x24')]=_[_0x023a('0x25')](_0x4d73cf[_0x023a('0x24')]);_0x4f3df8[_0x023a('0x26')]=_[_0x023a('0x27')](_0x4f3df8[_0x023a('0x22')],_0x4f3df8[_0x023a('0x24')]);_0x5dd61a[_0x023a('0x29')]=_[_0x023a('0x27')](_0x4f3df8[_0x023a('0x22')],qs[_0x023a('0x28')](_0x4d73cf[_0x023a('0x24')][_0x023a('0x28')]));_0x5dd61a[_0x023a('0x29')]=_0x5dd61a[_0x023a('0x29')]['length']?_0x5dd61a[_0x023a('0x29')]:_0x4f3df8[_0x023a('0x22')];if(_0x4d73cf[_0x023a('0x24')][_0x023a('0x33')]){_0x5dd61a['include']=[{'all':!![]}];}_0x5dd61a=_['merge']({},_0x5dd61a,_0x4d73cf['options']);return db[_0x023a('0x1e')]['find'](_0x5dd61a)['then'](handleEntityNotFound(_0xcadb08,null))['then'](function(_0x2155b9){if(_0x2155b9[_0x023a('0x37')]===_0x023a('0x3c')){var _0x2556d2=encryptor[_0x023a('0x3d')](_0x2155b9['data3']);_0x2155b9[_0x023a('0x38')]=maskClientSecret(_0x2556d2);}return _0x2155b9;})[_0x023a('0x14')](respondWithResult(_0xcadb08,null))['catch'](handleError(_0xcadb08,null));};exports[_0x023a('0x3e')]=function(_0x505b62,_0x44f37d){if(!_0x505b62[_0x023a('0x3f')]['name'])throw new Error(_0x023a('0x40'));if(!_0x505b62['body'][_0x023a('0x37')])throw new Error(_0x023a('0x41'));var _0x16cbfe=db[_0x023a('0x1e')][_0x023a('0x1f')][_0x023a('0x37')][_0x023a('0x42')];if(!_0x16cbfe[_0x023a('0x43')](_0x505b62[_0x023a('0x3f')]['service']))throw new Error(_0x023a('0x44')+_0x16cbfe[_0x023a('0x45')](',\x20'));if(_0x505b62[_0x023a('0x3f')][_0x023a('0x37')]===_0x023a('0x3c')&&_0x505b62[_0x023a('0x3f')][_0x023a('0x38')]){_0x505b62['body'][_0x023a('0x38')]=encryptor[_0x023a('0x46')](_0x505b62[_0x023a('0x3f')]['data3']);}return db[_0x023a('0x1e')][_0x023a('0x3e')](_0x505b62['body'],{})[_0x023a('0x14')](respondWithResult(_0x44f37d,0xc9))[_0x023a('0x39')](handleError(_0x44f37d,null));};exports['update']=function(_0x3e437d,_0x36fe60){if(_0x3e437d[_0x023a('0x3f')]['id']){delete _0x3e437d['body']['id'];}return db[_0x023a('0x1e')][_0x023a('0x47')]({'where':{'id':_0x3e437d[_0x023a('0x3b')]['id']}})[_0x023a('0x14')](handleEntityNotFound(_0x36fe60,null))['then'](function(_0x2b73f9){if(_0x2b73f9[_0x023a('0x37')]===_0x023a('0x3c')&&_0x3e437d['body']['data3']){_0x3e437d[_0x023a('0x3f')][_0x023a('0x38')]=encryptor[_0x023a('0x46')](_0x3e437d[_0x023a('0x3f')]['data3']);}return _0x2b73f9;})['then'](saveUpdates(_0x3e437d[_0x023a('0x3f')],null))[_0x023a('0x14')](respondWithResult(_0x36fe60,null))[_0x023a('0x39')](handleError(_0x36fe60,null));};exports[_0x023a('0x15')]=function(_0x214161,_0x3fa7d0){return db['CloudProvider'][_0x023a('0x47')]({'where':{'id':_0x214161['params']['id']}})['then'](handleEntityNotFound(_0x3fa7d0,null))['then'](removeEntity(_0x3fa7d0,null))[_0x023a('0x39')](handleError(_0x3fa7d0,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3da3d1,_0x3b1bcf){return db[_0x023a('0x1e')][_0x023a('0x48')]({'where':{'id':_0x3da3d1[_0x023a('0x3b')]['id']},'raw':!![]})[_0x023a('0x14')](function(_0x465051){if(!_0x465051)return _0x3b1bcf['sendStatus'](0x194);return{'url':oauth[_0x023a('0x49')](_0x465051,_0x3da3d1[_0x023a('0x4a')]['id'])};})[_0x023a('0x14')](respondWithResult(_0x3b1bcf,null))[_0x023a('0x39')](handleError(_0x3b1bcf,null));};exports[_0x023a('0x4b')]=function(_0xb20c74,_0x461dc2){var _0x669ec6=_0xb20c74[_0x023a('0x3f')];var _0x13353c;var _0x30ced1;if(_0x669ec6['error'])throw _0x669ec6;redis[_0x023a('0x4c')](_0x669ec6['state'])['then'](function(_0x70bc38){if(!_0x70bc38)throw new Error(_0x023a('0x4d'));_0x13353c=JSON[_0x023a('0x4e')](_0x70bc38);var _0xc016b3=Buffer['from'](_0x669ec6['state'],'base64')[_0x023a('0x4f')](_0x023a('0x50'));_0x30ced1=JSON['parse'](_0xc016b3);if(!oauth[_0x023a('0x51')](_0x669ec6['id_token'],_0x13353c[_0x023a('0x52')]))throw new Error(_0x023a('0x53'));redis[_0x023a('0x54')](_0x669ec6[_0x023a('0x55')]);return oauth[_0x023a('0x56')](_0x669ec6[_0x023a('0x57')],_0x13353c);})[_0x023a('0x14')](function(_0xfc829b){_0x13353c[_0x023a('0x58')]=_0xfc829b['access_token'];_0x13353c[_0x023a('0x59')]=_0xfc829b[_0x023a('0x5a')];return db[_0x023a('0x1e')][_0x023a('0x13')]({'data5':_0x13353c['data5'],'data6':_0x13353c['data6']},{'where':{'id':_0x13353c['id']}});})[_0x023a('0x14')](function(){oauth[_0x023a('0x5b')](_0x13353c);socket['emit'](_0x023a('0x5c'),{'id':_0x30ced1['id']});return;})[_0x023a('0x14')](respondWithStatusCode(_0x461dc2,null))['catch'](function(_0x405c87){if(_0x30ced1){socket[_0x023a('0x5d')](_0x023a('0x5e'),{'id':_0x30ced1['id']});}if(!_0x13353c){logger[_0x023a('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x405c87);return _0x461dc2[_0x023a('0xc')](0x1f4)[_0x023a('0x1a')](_0x405c87['message']);}logger[_0x023a('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x13353c['id'],JSON['stringify'](_0x405c87));});}; \ No newline at end of file +var _0x6881=['catch','update','MicrosoftAzure','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','base64','toString','ascii','parse','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','service','decryptString','data3','show','params','keys','include','options','find','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6881,0x139));var _0x1688=function(_0xbcb35c,_0x927e24){_0xbcb35c=_0xbcb35c-0x0;var _0x47702d=_0x6881[_0xbcb35c];return _0x47702d;};'use strict';var _=require(_0x1688('0x0'));var Redis=require(_0x1688('0x1'));var qs=require(_0x1688('0x2'));var encryptor=require(_0x1688('0x3'));var config=require(_0x1688('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x1688('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x1688('0x6')](config[_0x1688('0x7')],{'host':_0x1688('0x8'),'port':0x18eb});var socket=require(_0x1688('0x9'))(new Redis(config[_0x1688('0x7')]));var redis=new Redis(config[_0x1688('0x7')]);function respondWithStatusCode(_0x21b2f5,_0x4f0016){_0x4f0016=_0x4f0016||0xcc;return function(_0x3cce22){if(_0x3cce22){return _0x21b2f5['sendStatus'](_0x4f0016);}return _0x21b2f5[_0x1688('0xa')](_0x4f0016)[_0x1688('0xb')]();};}function respondWithResult(_0x328f70,_0x276baa){_0x276baa=_0x276baa||0xc8;return function(_0x2137c6){if(_0x2137c6){return _0x328f70[_0x1688('0xa')](_0x276baa)[_0x1688('0xc')](_0x2137c6);}};}function respondWithFilteredResult(_0x1d5a2e,_0x19e16b){return function(_0x2b8c30){if(_0x2b8c30){var _0x3fcfb8=typeof _0x19e16b['offset']===_0x1688('0xd')&&typeof _0x19e16b[_0x1688('0xe')]===_0x1688('0xd');var _0x2c0332=_0x2b8c30[_0x1688('0xf')];var _0x11e61b=_0x3fcfb8?0x0:_0x19e16b['offset'];var _0x38a364=_0x3fcfb8?_0x2b8c30[_0x1688('0xf')]:_0x19e16b[_0x1688('0x10')]+_0x19e16b[_0x1688('0xe')];var _0x407fec;if(_0x38a364>=_0x2c0332){_0x38a364=_0x2c0332;_0x407fec=0xc8;}else{_0x407fec=0xce;}_0x1d5a2e[_0x1688('0xa')](_0x407fec);return _0x1d5a2e[_0x1688('0x11')](_0x1688('0x12'),_0x11e61b+'-'+_0x38a364+'/'+_0x2c0332)[_0x1688('0xc')](_0x2b8c30);}return null;};}function saveUpdates(_0x244148){return function(_0x3ae22a){if(_0x3ae22a){return _0x3ae22a['update'](_0x244148)['then'](function(_0x4f92be){return _0x4f92be;});}return null;};}function removeEntity(_0x3af8ad){return function(_0x354ce0){if(_0x354ce0){return _0x354ce0[_0x1688('0x13')]()['then'](function(){_0x3af8ad[_0x1688('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33694a){return function(_0x2029aa){if(!_0x2029aa){_0x33694a[_0x1688('0x14')](0x194);}return _0x2029aa;};}function handleError(_0x2242c7,_0x5a8969){_0x5a8969=_0x5a8969||0x1f4;return function(_0xc45f65){logger[_0x1688('0x15')](_0xc45f65[_0x1688('0x16')]);if(_0xc45f65[_0x1688('0x17')]){delete _0xc45f65[_0x1688('0x17')];}_0x2242c7['status'](_0x5a8969)[_0x1688('0x18')](_0xc45f65);};}function maskClientSecret(_0x12f37d){return _[_0x1688('0x19')](_0x12f37d[_0x1688('0x1a')](0x0,0x3),0x14,'*');}exports[_0x1688('0x1b')]=function(_0xab4d08,_0x4cc549){var _0x31315c={},_0x261336={},_0x4f6dbb={'count':0x0,'rows':[]};var _0xa5fcde=_[_0x1688('0x1c')](db[_0x1688('0x1d')][_0x1688('0x1e')],function(_0x5569a5){return{'name':_0x5569a5[_0x1688('0x1f')],'type':_0x5569a5[_0x1688('0x20')][_0x1688('0x21')]};});_0x261336[_0x1688('0x22')]=_['map'](_0xa5fcde,_0x1688('0x17'));_0x261336[_0x1688('0x23')]=_['keys'](_0xab4d08[_0x1688('0x23')]);_0x261336[_0x1688('0x24')]=_[_0x1688('0x25')](_0x261336[_0x1688('0x22')],_0x261336[_0x1688('0x23')]);_0x31315c[_0x1688('0x26')]=_[_0x1688('0x25')](_0x261336[_0x1688('0x22')],qs[_0x1688('0x27')](_0xab4d08[_0x1688('0x23')][_0x1688('0x27')]));_0x31315c[_0x1688('0x26')]=_0x31315c[_0x1688('0x26')][_0x1688('0x28')]?_0x31315c[_0x1688('0x26')]:_0x261336[_0x1688('0x22')];if(!_0xab4d08[_0x1688('0x23')]['hasOwnProperty'](_0x1688('0x29'))){_0x31315c[_0x1688('0xe')]=qs[_0x1688('0xe')](_0xab4d08[_0x1688('0x23')][_0x1688('0xe')]);_0x31315c[_0x1688('0x10')]=qs[_0x1688('0x10')](_0xab4d08[_0x1688('0x23')][_0x1688('0x10')]);}_0x31315c[_0x1688('0x2a')]=qs[_0x1688('0x2b')](_0xab4d08[_0x1688('0x23')][_0x1688('0x2b')]);_0x31315c[_0x1688('0x2c')]=qs[_0x1688('0x24')](_[_0x1688('0x2d')](_0xab4d08[_0x1688('0x23')],_0x261336[_0x1688('0x24')]),_0xa5fcde);if(_0xab4d08['query']['filter']){_0x31315c['where']=_[_0x1688('0x2e')](_0x31315c[_0x1688('0x2c')],{'$or':_['map'](_0xa5fcde,function(_0x52eb43){if(_0x52eb43[_0x1688('0x20')]!==_0x1688('0x2f')){var _0x2d1075={};_0x2d1075[_0x52eb43['name']]={'$like':'%'+_0xab4d08[_0x1688('0x23')][_0x1688('0x30')]+'%'};return _0x2d1075;}})});}_0x31315c=_[_0x1688('0x2e')]({},_0x31315c,_0xab4d08['options']);var _0x184d44={'where':_0x31315c[_0x1688('0x2c')]};return db[_0x1688('0x1d')]['count'](_0x184d44)[_0x1688('0x31')](function(_0x50e1b7){_0x4f6dbb[_0x1688('0xf')]=_0x50e1b7;if(_0xab4d08[_0x1688('0x23')][_0x1688('0x32')]){_0x31315c['include']=[{'all':!![]}];}return db[_0x1688('0x1d')][_0x1688('0x33')](_0x31315c);})[_0x1688('0x31')](function(_0x282a74){_0x4f6dbb[_0x1688('0x34')]=_[_0x1688('0x1c')](_0x282a74,function(_0x181d61){if(_0x181d61[_0x1688('0x35')]==='MicrosoftAzure'){var _0x2f1639=encryptor[_0x1688('0x36')](_0x181d61[_0x1688('0x37')]);_0x181d61[_0x1688('0x37')]=maskClientSecret(_0x2f1639);}return _0x181d61;});return _0x4f6dbb;})[_0x1688('0x31')](respondWithFilteredResult(_0x4cc549,_0x31315c))['catch'](handleError(_0x4cc549,null));};exports[_0x1688('0x38')]=function(_0x338136,_0x35d702){var _0x49e3d0={'raw':!![],'where':{'id':_0x338136[_0x1688('0x39')]['id']}},_0xeaf9cb={};_0xeaf9cb[_0x1688('0x22')]=_[_0x1688('0x3a')](db['CloudProvider'][_0x1688('0x1e')]);_0xeaf9cb[_0x1688('0x23')]=_['keys'](_0x338136[_0x1688('0x23')]);_0xeaf9cb[_0x1688('0x24')]=_['intersection'](_0xeaf9cb[_0x1688('0x22')],_0xeaf9cb[_0x1688('0x23')]);_0x49e3d0[_0x1688('0x26')]=_[_0x1688('0x25')](_0xeaf9cb[_0x1688('0x22')],qs[_0x1688('0x27')](_0x338136['query'][_0x1688('0x27')]));_0x49e3d0[_0x1688('0x26')]=_0x49e3d0[_0x1688('0x26')][_0x1688('0x28')]?_0x49e3d0[_0x1688('0x26')]:_0xeaf9cb['model'];if(_0x338136[_0x1688('0x23')]['includeAll']){_0x49e3d0[_0x1688('0x3b')]=[{'all':!![]}];}_0x49e3d0=_[_0x1688('0x2e')]({},_0x49e3d0,_0x338136[_0x1688('0x3c')]);return db[_0x1688('0x1d')][_0x1688('0x3d')](_0x49e3d0)['then'](handleEntityNotFound(_0x35d702,null))[_0x1688('0x31')](function(_0x3074e3){if(_0x3074e3[_0x1688('0x35')]==='MicrosoftAzure'){var _0x3d84d6=encryptor[_0x1688('0x36')](_0x3074e3[_0x1688('0x37')]);_0x3074e3[_0x1688('0x37')]=maskClientSecret(_0x3d84d6);}return _0x3074e3;})['then'](respondWithResult(_0x35d702,null))['catch'](handleError(_0x35d702,null));};exports['create']=function(_0x1c2c74,_0x5adb3d){if(!_0x1c2c74['body'][_0x1688('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1c2c74[_0x1688('0x3e')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x28aa89=db[_0x1688('0x1d')][_0x1688('0x1e')][_0x1688('0x35')]['values'];if(!_0x28aa89['includes'](_0x1c2c74[_0x1688('0x3e')]['service']))throw new Error(_0x1688('0x3f')+_0x28aa89[_0x1688('0x40')](',\x20'));if(_0x1c2c74[_0x1688('0x3e')]['service']==='MicrosoftAzure'&&_0x1c2c74[_0x1688('0x3e')]['data3']){_0x1c2c74[_0x1688('0x3e')][_0x1688('0x37')]=encryptor[_0x1688('0x41')](_0x1c2c74['body']['data3']);}return db[_0x1688('0x1d')][_0x1688('0x42')](_0x1c2c74[_0x1688('0x3e')],{})[_0x1688('0x31')](respondWithResult(_0x5adb3d,0xc9))[_0x1688('0x43')](handleError(_0x5adb3d,null));};exports[_0x1688('0x44')]=function(_0x390483,_0x280c90){if(_0x390483[_0x1688('0x3e')]['id']){delete _0x390483[_0x1688('0x3e')]['id'];}return db[_0x1688('0x1d')]['find']({'where':{'id':_0x390483[_0x1688('0x39')]['id']}})[_0x1688('0x31')](handleEntityNotFound(_0x280c90,null))[_0x1688('0x31')](function(_0x4c32ff){if(_0x4c32ff[_0x1688('0x35')]===_0x1688('0x45')&&_0x390483[_0x1688('0x3e')][_0x1688('0x37')]){_0x390483[_0x1688('0x3e')][_0x1688('0x37')]=encryptor[_0x1688('0x41')](_0x390483[_0x1688('0x3e')][_0x1688('0x37')]);}return _0x4c32ff;})[_0x1688('0x31')](saveUpdates(_0x390483[_0x1688('0x3e')],null))['then'](respondWithResult(_0x280c90,null))['catch'](handleError(_0x280c90,null));};exports[_0x1688('0x13')]=function(_0x13ddff,_0x471627){return db[_0x1688('0x1d')][_0x1688('0x3d')]({'where':{'id':_0x13ddff[_0x1688('0x39')]['id']}})[_0x1688('0x31')](handleEntityNotFound(_0x471627,null))['then'](removeEntity(_0x471627,null))[_0x1688('0x43')](handleError(_0x471627,null));};exports[_0x1688('0x46')]=function(_0x547c97,_0x1f7ab0){return db[_0x1688('0x1d')][_0x1688('0x47')]({'where':{'id':_0x547c97[_0x1688('0x39')]['id']},'raw':!![]})['then'](function(_0x4c4ff5){if(!_0x4c4ff5)return _0x1f7ab0[_0x1688('0x14')](0x194);return{'url':oauth[_0x1688('0x48')](_0x4c4ff5,_0x547c97[_0x1688('0x49')]['id'])};})['then'](respondWithResult(_0x1f7ab0,null))[_0x1688('0x43')](handleError(_0x1f7ab0,null));};exports[_0x1688('0x4a')]=function(_0x5e7b2e,_0x26b9c3){var _0x438352=_0x5e7b2e[_0x1688('0x3e')];var _0x16c586;var _0x4186fc;if(_0x438352[_0x1688('0x15')])throw _0x438352;redis[_0x1688('0x4b')](_0x438352[_0x1688('0x4c')])[_0x1688('0x31')](function(_0x53dca6){if(!_0x53dca6)throw new Error('Invalid\x20state\x20parameter');_0x16c586=JSON['parse'](_0x53dca6);var _0x622553=Buffer['from'](_0x438352[_0x1688('0x4c')],_0x1688('0x4d'))[_0x1688('0x4e')](_0x1688('0x4f'));_0x4186fc=JSON[_0x1688('0x50')](_0x622553);if(!oauth['isValidIdToken'](_0x438352['id_token'],_0x16c586[_0x1688('0x51')]))throw new Error(_0x1688('0x52'));redis[_0x1688('0x53')](_0x438352[_0x1688('0x4c')]);return oauth[_0x1688('0x54')](_0x438352[_0x1688('0x55')],_0x16c586);})[_0x1688('0x31')](function(_0x235f0a){_0x16c586['data5']=_0x235f0a['access_token'];_0x16c586[_0x1688('0x56')]=_0x235f0a[_0x1688('0x57')];return db[_0x1688('0x1d')][_0x1688('0x44')]({'data5':_0x16c586[_0x1688('0x58')],'data6':_0x16c586[_0x1688('0x56')]},{'where':{'id':_0x16c586['id']}});})[_0x1688('0x31')](function(){oauth[_0x1688('0x59')](_0x16c586);socket['emit']('microsoftAuthorization:success',{'id':_0x4186fc['id']});return;})[_0x1688('0x31')](respondWithStatusCode(_0x26b9c3,null))[_0x1688('0x43')](function(_0x17f86f){if(_0x4186fc){socket[_0x1688('0x5a')](_0x1688('0x5b'),{'id':_0x4186fc['id']});}if(!_0x16c586){logger[_0x1688('0x15')](_0x1688('0x5c'),_0x17f86f);return _0x26b9c3[_0x1688('0xa')](0x1f4)[_0x1688('0x18')](_0x17f86f['message']);}logger[_0x1688('0x15')](_0x1688('0x5d'),_0x16c586['id'],JSON[_0x1688('0x5e')](_0x17f86f));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 76f6d59..8a4ab20 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7745=['api','moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x5910ed,_0xe70d9){var _0x480eba=function(_0x496a33){while(--_0x496a33){_0x5910ed['push'](_0x5910ed['shift']());}};_0x480eba(++_0xe70d9);}(_0x7745,0x105));var _0x5774=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7745[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x5774('0x0'));var util=require(_0x5774('0x1'));var logger=require(_0x5774('0x2'))(_0x5774('0x3'));var moment=require(_0x5774('0x4'));var BPromise=require('bluebird');var rp=require(_0x5774('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5774('0x6'));var config=require(_0x5774('0x7'));var attributes=require(_0x5774('0x8'));module[_0x5774('0x9')]=function(_0x186a13,_0x317406){return _0x186a13['define'](_0x5774('0xa'),attributes,{'tableName':_0x5774('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x270a=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash'];(function(_0x349ccf,_0x5a0a91){var _0x4b393b=function(_0x55f068){while(--_0x55f068){_0x349ccf['push'](_0x349ccf['shift']());}};_0x4b393b(++_0x5a0a91);}(_0x270a,0x11d));var _0xa270=function(_0x57c96a,_0x24f6f2){_0x57c96a=_0x57c96a-0x0;var _0x33a849=_0x270a[_0x57c96a];return _0x33a849;};'use strict';var _=require(_0xa270('0x0'));var util=require(_0xa270('0x1'));var logger=require(_0xa270('0x2'))('api');var moment=require(_0xa270('0x3'));var BPromise=require(_0xa270('0x4'));var rp=require(_0xa270('0x5'));var fs=require('fs');var path=require(_0xa270('0x6'));var rimraf=require('rimraf');var config=require(_0xa270('0x7'));var attributes=require(_0xa270('0x8'));module[_0xa270('0x9')]=function(_0x3f6d8b,_0x3700da){return _0x3f6d8b['define']('CloudProvider',attributes,{'tableName':_0xa270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index ffdfa5e..d7612eb 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf37=['data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','oauth2/','set','decode','iss','audience','isAfter','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','{TENANT_ID}','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','../../config/environment','../../config/logger','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','data2','code','id_token','stringify','toString','hex','client_id'];(function(_0x36a09c,_0x1b0a6f){var _0x3c0123=function(_0x3d307b){while(--_0x3d307b){_0x36a09c['push'](_0x36a09c['shift']());}};_0x3c0123(++_0x1b0a6f);}(_0xdf37,0x1f1));var _0x7df3=function(_0x5a679f,_0x19854e){_0x5a679f=_0x5a679f-0x0;var _0x8009ef=_0xdf37[_0x5a679f];return _0x8009ef;};'use strict';var _=require('lodash');var crypto=require(_0x7df3('0x0'));var jwt=require(_0x7df3('0x1'));var moment=require(_0x7df3('0x2'));var Redis=require(_0x7df3('0x3'));var rp=require(_0x7df3('0x4'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x7df3('0x5'));var logger=require(_0x7df3('0x6'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x7df3('0x7'))['db'];config[_0x7df3('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7df3('0x8')]);var MICROSOFT_AUTH_URL=_0x7df3('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7df3('0xa'),_0x7df3('0xb'),_0x7df3('0xc'),_0x7df3('0xd'),_0x7df3('0xe'),_0x7df3('0xf'),_0x7df3('0x10')],'Dynamics365':[_0x7df3('0xa'),_0x7df3('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x7df3('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x7df3('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2c4374){var _0x27a014=_[_0x7df3('0x13')](AZURE_AUTH_SCOPES[_0x2c4374['type']]);if(_0x2c4374[_0x7df3('0x14')]===_0x7df3('0x15'))_0x27a014[_0x7df3('0x16')](_0x2c4374['data7']+_0x7df3('0x17'));return _0x27a014[_0x7df3('0x18')]('\x20');}function getAccessTokenScope(_0x40ac04){if(_0x40ac04[_0x7df3('0x14')]===_0x7df3('0x19'))return _0x7df3('0xe');if(_0x40ac04[_0x7df3('0x14')]===_0x7df3('0x15'))return _0x40ac04[_0x7df3('0x1a')]+_0x7df3('0x17');}function generateMicrosoftAuthorizationUrl(_0x383776,_0x482d8f){var _0x1a0fad=MICROSOFT_AUTH_URL[_0x7df3('0x1b')]('{TENANT_ID}',_0x383776[_0x7df3('0x1c')]);var _0x52db7d=[_0x7df3('0x1d'),_0x7df3('0x1e')];var _0x1ced6c=Buffer['from'](JSON[_0x7df3('0x1f')]({'id':_0x482d8f}))['toString']('base64');var _0x42bf0c=crypto['randomBytes'](0x10)[_0x7df3('0x20')](_0x7df3('0x21'));var _0xd5f48f=getAuthorizationScopes(_0x383776);var _0x18befd=[{'key':_0x7df3('0x22'),'value':_0x383776[_0x7df3('0x23')]},{'key':_0x7df3('0x24'),'value':encodeURIComponent(_0x52db7d[_0x7df3('0x18')]('\x20'))},{'key':_0x7df3('0x25'),'value':_0x383776['data4']},{'key':_0x7df3('0x26'),'value':_0x7df3('0x27')},{'key':_0x7df3('0x28'),'value':encodeURIComponent(_0xd5f48f)},{'key':_0x7df3('0x29'),'value':_0x1ced6c},{'key':_0x7df3('0x2a'),'value':_0x42bf0c},{'key':'prompt','value':'login'}];var _0x1f8781=_0x1a0fad+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7df3('0x13')](_0x18befd,function(_0x2f4bbd){return _0x2f4bbd[_0x7df3('0x2b')]+'='+_0x2f4bbd[_0x7df3('0x2c')];})[_0x7df3('0x18')]('&');_0x383776[_0x7df3('0x2d')]={'issuer':_0x1a0fad['replace'](_0x7df3('0x2e'),''),'audience':_0x383776[_0x7df3('0x23')],'state':_0x1ced6c,'nonce':_0x42bf0c};redis[_0x7df3('0x2f')](_0x1ced6c,JSON[_0x7df3('0x1f')](_0x383776));return _0x1f8781;}function isValidIdToken(_0x122cf8,_0x4d9c17){try{var _0x5b720b=jwt[_0x7df3('0x30')](_0x122cf8,{'complete':!![]});var _0x35233c=_0x5b720b['payload'];if(_0x35233c[_0x7df3('0x31')]!==_0x4d9c17['issuer'])return![];if(_0x35233c['aud']!==_0x4d9c17[_0x7df3('0x32')])return![];if(_0x35233c[_0x7df3('0x2a')]!==_0x4d9c17[_0x7df3('0x2a')])return![];if(moment()[_0x7df3('0x33')](moment['unix'](_0x35233c['exp'])))return![];return!![];}catch(_0x44fcb8){throw _0x44fcb8;}}function refreshOauth2MicrosoftAccessToken(_0x3a554d){return Promise[_0x7df3('0x34')]()[_0x7df3('0x35')](function(){if(_0x3a554d['data3'])return _0x3a554d;return db[_0x7df3('0x36')][_0x7df3('0x37')]({'where':{'id':_0x3a554d['id']},'raw':!![]});})[_0x7df3('0x35')](function(_0x2c2f69){var _0x28fad9={'grant_type':_0x7df3('0x38'),'refresh_token':_0x2c2f69[_0x7df3('0x39')],'scope':getAccessTokenScope(_0x2c2f69),'redirect_uri':_0x2c2f69[_0x7df3('0x3a')],'client_id':_0x2c2f69[_0x7df3('0x23')],'client_secret':encryptor[_0x7df3('0x3b')](_0x2c2f69['data3'])};var _0x4ee81c={'method':_0x7df3('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x7df3('0x1b')]('{TENANT_ID}',_0x2c2f69[_0x7df3('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28fad9,'json':!![]};return rp(_0x4ee81c);})[_0x7df3('0x35')](function(_0x3f1858){_0x3a554d['data5']=_0x3f1858['access_token'];_0x3a554d[_0x7df3('0x39')]=_0x3f1858[_0x7df3('0x38')];return db['CloudProvider'][_0x7df3('0x3d')]({'data5':_0x3a554d[_0x7df3('0x3e')],'data6':_0x3a554d['data6']},{'where':{'id':_0x3a554d['id']}});})['then'](function(){return _0x3a554d;})[_0x7df3('0x3f')](function(_0x27c907){logger[_0x7df3('0x40')](_0x7df3('0x41'),_0x3a554d['id'],_0x27c907);});}function getOauth2MicrosoftAccessToken(_0x3bed48,_0x4a5f69){var _0x17b309={'grant_type':_0x7df3('0x42'),'code':_0x3bed48,'scope':getAccessTokenScope(_0x4a5f69),'redirect_uri':_0x4a5f69[_0x7df3('0x3a')],'client_id':_0x4a5f69[_0x7df3('0x23')],'client_secret':encryptor['decryptString'](_0x4a5f69[_0x7df3('0x43')])};var _0x332fa6={'method':_0x7df3('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x7df3('0x1b')](_0x7df3('0x44'),_0x4a5f69['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17b309,'json':!![]};return rp(_0x332fa6);}function startRefreshInterval(_0x19976a){var _0x46ca12=schedule[_0x7df3('0x45')];if(_0x46ca12[_0x19976a['id']])clearInterval(_0x46ca12[_0x19976a['id']]);_0x46ca12[_0x19976a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7df3('0x46')](this,{'id':_0x19976a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x46ca12;}function startAllRefreshIntervals(){return db[_0x7df3('0x36')][_0x7df3('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7df3('0x35')](function(_0x2320b4){var _0x525e42=_0x2320b4[_0x7df3('0x13')](function(_0x270944){return refreshOauth2MicrosoftAccessToken(_0x270944)['then'](function(_0x85d344){startRefreshInterval(_0x85d344);});});return Promise[_0x7df3('0x48')](_0x525e42);})[_0x7df3('0x3f')](function(_0x3276af){var _0x511009=_0x3276af?util[_0x7df3('0x49')](_0x3276af,{'showHidden':![],'depth':null}):'';logger[_0x7df3('0x40')](_0x7df3('0x4a'),_0x511009);});}module[_0x7df3('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7db4=['then','refresh_token','data6','data1','decryptString','POST','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','join','Outlook365','replace','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','client_id','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne'];(function(_0x5c4a95,_0x26447d){var _0x8ec6a0=function(_0x4779b6){while(--_0x4779b6){_0x5c4a95['push'](_0x5c4a95['shift']());}};_0x8ec6a0(++_0x26447d);}(_0x7db4,0x1f2));var _0x47db=function(_0x55c193,_0x3dc41a){_0x55c193=_0x55c193-0x0;var _0x56f621=_0x7db4[_0x55c193];return _0x56f621;};'use strict';var _=require(_0x47db('0x0'));var crypto=require(_0x47db('0x1'));var jwt=require(_0x47db('0x2'));var moment=require(_0x47db('0x3'));var Redis=require(_0x47db('0x4'));var rp=require(_0x47db('0x5'));var util=require(_0x47db('0x6'));var encryptor=require(_0x47db('0x7'));var config=require(_0x47db('0x8'));var logger=require('../../config/logger')(_0x47db('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x47db('0xa'))['db'];config['redis']=_['defaults'](config[_0x47db('0xb')],{'host':_0x47db('0xc'),'port':0x18eb});var redis=new Redis(config[_0x47db('0xb')]);var MICROSOFT_AUTH_URL=_0x47db('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x47db('0xe'),_0x47db('0xf'),_0x47db('0x10'),_0x47db('0x11'),_0x47db('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x47db('0x13')],'Dynamics365':[_0x47db('0xe'),_0x47db('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x47db('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x40f6b0){var _0x535470=_[_0x47db('0x15')](AZURE_AUTH_SCOPES[_0x40f6b0[_0x47db('0x16')]]);if(_0x40f6b0['type']===_0x47db('0x17'))_0x535470[_0x47db('0x18')](_0x40f6b0['data7']+'/.default');return _0x535470[_0x47db('0x19')]('\x20');}function getAccessTokenScope(_0x519ec7){if(_0x519ec7[_0x47db('0x16')]===_0x47db('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x519ec7[_0x47db('0x16')]===_0x47db('0x17'))return _0x519ec7['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x3f7f40,_0x10a6c4){var _0x1df8a7=MICROSOFT_AUTH_URL[_0x47db('0x1b')](_0x47db('0x1c'),_0x3f7f40[_0x47db('0x1d')]);var _0x4f6cb9=[_0x47db('0x1e'),'id_token'];var _0x3935c4=Buffer['from'](JSON[_0x47db('0x1f')]({'id':_0x10a6c4}))[_0x47db('0x20')](_0x47db('0x21'));var _0x546bff=crypto[_0x47db('0x22')](0x10)[_0x47db('0x20')]('hex');var _0x4ea554=getAuthorizationScopes(_0x3f7f40);var _0x366f03=[{'key':_0x47db('0x23'),'value':_0x3f7f40['data1']},{'key':_0x47db('0x24'),'value':encodeURIComponent(_0x4f6cb9[_0x47db('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x3f7f40[_0x47db('0x25')]},{'key':_0x47db('0x26'),'value':_0x47db('0x27')},{'key':_0x47db('0x28'),'value':encodeURIComponent(_0x4ea554)},{'key':_0x47db('0x29'),'value':_0x3935c4},{'key':_0x47db('0x2a'),'value':_0x546bff},{'key':_0x47db('0x2b'),'value':_0x47db('0x2c')}];var _0x155dc4=_0x1df8a7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x47db('0x15')](_0x366f03,function(_0xb02de7){return _0xb02de7[_0x47db('0x2d')]+'='+_0xb02de7['value'];})['join']('&');_0x3f7f40[_0x47db('0x2e')]={'issuer':_0x1df8a7[_0x47db('0x1b')](_0x47db('0x2f'),''),'audience':_0x3f7f40['data1'],'state':_0x3935c4,'nonce':_0x546bff};redis[_0x47db('0x30')](_0x3935c4,JSON[_0x47db('0x1f')](_0x3f7f40));return _0x155dc4;}function isValidIdToken(_0x1a8954,_0x23bb59){try{var _0x44ee56=jwt[_0x47db('0x31')](_0x1a8954,{'complete':!![]});var _0x4d5e4c=_0x44ee56[_0x47db('0x32')];if(_0x4d5e4c[_0x47db('0x33')]!==_0x23bb59[_0x47db('0x34')])return![];if(_0x4d5e4c[_0x47db('0x35')]!==_0x23bb59[_0x47db('0x36')])return![];if(_0x4d5e4c['nonce']!==_0x23bb59[_0x47db('0x2a')])return![];if(moment()[_0x47db('0x37')](moment[_0x47db('0x38')](_0x4d5e4c[_0x47db('0x39')])))return![];return!![];}catch(_0x3b7e16){throw _0x3b7e16;}}function refreshOauth2MicrosoftAccessToken(_0x51aa20){return Promise[_0x47db('0x3a')]()['then'](function(){if(_0x51aa20[_0x47db('0x3b')])return _0x51aa20;return db[_0x47db('0x3c')][_0x47db('0x3d')]({'where':{'id':_0x51aa20['id']},'raw':!![]});})[_0x47db('0x3e')](function(_0x11503f){var _0x29f619={'grant_type':_0x47db('0x3f'),'refresh_token':_0x11503f[_0x47db('0x40')],'scope':getAccessTokenScope(_0x11503f),'redirect_uri':_0x11503f['data4'],'client_id':_0x11503f[_0x47db('0x41')],'client_secret':encryptor[_0x47db('0x42')](_0x11503f[_0x47db('0x3b')])};var _0x325d36={'method':_0x47db('0x43'),'uri':MICROSOFT_AUTH_URL[_0x47db('0x1b')]('{TENANT_ID}',_0x11503f[_0x47db('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x29f619,'json':!![]};return rp(_0x325d36);})[_0x47db('0x3e')](function(_0x50cbef){_0x51aa20[_0x47db('0x44')]=_0x50cbef[_0x47db('0x45')];_0x51aa20['data6']=_0x50cbef[_0x47db('0x3f')];return db[_0x47db('0x3c')]['update']({'data5':_0x51aa20[_0x47db('0x44')],'data6':_0x51aa20[_0x47db('0x40')]},{'where':{'id':_0x51aa20['id']}});})[_0x47db('0x3e')](function(){return _0x51aa20;})['catch'](function(_0x17a3ff){logger[_0x47db('0x46')](_0x47db('0x47'),_0x51aa20['id'],_0x17a3ff);});}function getOauth2MicrosoftAccessToken(_0x4a3cf0,_0x3382a){var _0x15010c={'grant_type':'authorization_code','code':_0x4a3cf0,'scope':getAccessTokenScope(_0x3382a),'redirect_uri':_0x3382a[_0x47db('0x25')],'client_id':_0x3382a[_0x47db('0x41')],'client_secret':encryptor[_0x47db('0x42')](_0x3382a['data3'])};var _0x4d21e5={'method':_0x47db('0x43'),'uri':MICROSOFT_AUTH_URL[_0x47db('0x1b')](_0x47db('0x1c'),_0x3382a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x15010c,'json':!![]};return rp(_0x4d21e5);}function startRefreshInterval(_0x384d7a){var _0x32c40a=schedule[_0x47db('0x48')];if(_0x32c40a[_0x384d7a['id']])clearInterval(_0x32c40a[_0x384d7a['id']]);_0x32c40a[_0x384d7a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x47db('0x49')](this,{'id':_0x384d7a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x47db('0x48')]=_0x32c40a;}function startAllRefreshIntervals(){return db[_0x47db('0x3c')][_0x47db('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x29d35a){var _0x413362=_0x29d35a[_0x47db('0x15')](function(_0x2f0392){return refreshOauth2MicrosoftAccessToken(_0x2f0392)['then'](function(_0x58499c){startRefreshInterval(_0x58499c);});});return Promise[_0x47db('0x4b')](_0x413362);})[_0x47db('0x4c')](function(_0x571057){var _0x324d34=_0x571057?util[_0x47db('0x4d')](_0x571057,{'showHidden':![],'depth':null}):'';logger[_0x47db('0x46')](_0x47db('0x4e'),_0x324d34);});}module[_0x47db('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 9895af0..f4305a4 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['client','http','request','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x53c496,_0x510fc4){var _0x140869=function(_0x498ab1){while(--_0x498ab1){_0x53c496['push'](_0x53c496['shift']());}};_0x140869(++_0x510fc4);}(_0x57ca,0x108));var _0xa57c=function(_0x3c5c08,_0x3693ec){_0x3c5c08=_0x3c5c08-0x0;var _0x1b39d2=_0x57ca[_0x3c5c08];return _0x1b39d2;};'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')]('CloudProvider,\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')]('CloudProvider,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x25e7=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x1b10de,_0xe0ae69){var _0x59c631=function(_0x4e76d5){while(--_0x4e76d5){_0x1b10de['push'](_0x1b10de['shift']());}};_0x59c631(++_0xe0ae69);}(_0x25e7,0x1d6));var _0x725e=function(_0x5098d3,_0x245091){_0x5098d3=_0x5098d3-0x0;var _0x285389=_0x25e7[_0x5098d3];return _0x285389;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f03aaab..23b6e34 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b8919,_0x3d2103){_0x5b8919=_0x5b8919-0x0;var _0x5baa5b=_0x5f2f[_0x5b8919];return _0x5baa5b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x1c4397,_0x3bb634){_0x1c4397=_0x1c4397-0x0;var _0x2bb766=_0x7a54[_0x1c4397];return _0x2bb766;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 372032d..b14859d 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 _0xf57a=['name','STRING','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf57a,0x182));var _0xaf57=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xf57a[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0xaf57('0x0'));module[_0xaf57('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xaf57('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xaf57('0x3')]},'companyId':{'type':Sequelize[_0xaf57('0x3')]},'website':{'type':Sequelize[_0xaf57('0x3')]},'phone':{'type':Sequelize[_0xaf57('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf57('0x3')]},'street':{'type':Sequelize[_0xaf57('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xaf57('0x3')]},'country':{'type':Sequelize[_0xaf57('0x3')]},'email':{'type':Sequelize[_0xaf57('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xaf57('0x3')]},'sStreet':{'type':Sequelize[_0xaf57('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xaf57('0x3')]},'sCountry':{'type':Sequelize[_0xaf57('0x3')]},'description':{'type':Sequelize[_0xaf57('0x3')]}}; \ No newline at end of file +var _0xab8a=['sequelize','STRING','name'];(function(_0x4fe0bf,_0x59f8f3){var _0x3a769f=function(_0x4a0a5a){while(--_0x4a0a5a){_0x4fe0bf['push'](_0x4fe0bf['shift']());}};_0x3a769f(++_0x59f8f3);}(_0xab8a,0x195));var _0xaab8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xab8a[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0xaab8('0x0'));module['exports']={'name':{'type':Sequelize[_0xaab8('0x1')],'unique':_0xaab8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xaab8('0x1')]},'website':{'type':Sequelize[_0xaab8('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xaab8('0x1')]},'type':{'type':Sequelize[_0xaab8('0x1')]},'street':{'type':Sequelize[_0xaab8('0x1')]},'postalCode':{'type':Sequelize[_0xaab8('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xaab8('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xaab8('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xaab8('0x1')]},'description':{'type':Sequelize[_0xaab8('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a8f71bf..de46532 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 _0x1b11=['../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Companies','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','map','filter','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','error','body','addContacts','ids','omit','getContacts','CmContact','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util'];(function(_0x5767d1,_0x20323b){var _0x37b060=function(_0x2f9d9a){while(--_0x2f9d9a){_0x5767d1['push'](_0x5767d1['shift']());}};_0x37b060(++_0x20323b);}(_0x1b11,0x144));var _0x11b1=function(_0x59ad4f,_0x5978d6){_0x59ad4f=_0x59ad4f-0x0;var _0x2c4284=_0x1b11[_0x59ad4f];return _0x2c4284;};'use strict';var emlformat=require(_0x11b1('0x0'));var rimraf=require(_0x11b1('0x1'));var zipdir=require(_0x11b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11b1('0x3'));var moment=require(_0x11b1('0x4'));var BPromise=require(_0x11b1('0x5'));var Mustache=require(_0x11b1('0x6'));var util=require(_0x11b1('0x7'));var path=require(_0x11b1('0x8'));var sox=require(_0x11b1('0x9'));var csv=require(_0x11b1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11b1('0xb'));var _=require(_0x11b1('0xc'));var squel=require(_0x11b1('0xd'));var crypto=require(_0x11b1('0xe'));var jsforce=require(_0x11b1('0xf'));var deskjs=require(_0x11b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x11b1('0x11'));var Papa=require(_0x11b1('0x12'));var Redis=require(_0x11b1('0x13'));var authService=require(_0x11b1('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x11b1('0x15'));var utils=require(_0x11b1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x11b1('0x17'));var db=require(_0x11b1('0x18'))['db'];function respondWithStatusCode(_0x58c8b7,_0x1e92f1){_0x1e92f1=_0x1e92f1||0xcc;return function(_0x4565ed){if(_0x4565ed){return _0x58c8b7['sendStatus'](_0x1e92f1);}return _0x58c8b7[_0x11b1('0x19')](_0x1e92f1)[_0x11b1('0x1a')]();};}function respondWithResult(_0x33f1ad,_0x28d548){_0x28d548=_0x28d548||0xc8;return function(_0x4f44e6){if(_0x4f44e6){return _0x33f1ad['status'](_0x28d548)[_0x11b1('0x1b')](_0x4f44e6);}};}function respondWithFilteredResult(_0x1947e8,_0x2e7aec){return function(_0x3a064a){if(_0x3a064a){var _0x19b69f=typeof _0x2e7aec[_0x11b1('0x1c')]===_0x11b1('0x1d')&&typeof _0x2e7aec[_0x11b1('0x1e')]===_0x11b1('0x1d');var _0x49ceaf=_0x3a064a[_0x11b1('0x1f')];var _0xe0e739=_0x19b69f?0x0:_0x2e7aec[_0x11b1('0x1c')];var _0x27c66a=_0x19b69f?_0x3a064a['count']:_0x2e7aec['offset']+_0x2e7aec[_0x11b1('0x1e')];var _0x245d45;if(_0x27c66a>=_0x49ceaf){_0x27c66a=_0x49ceaf;_0x245d45=0xc8;}else{_0x245d45=0xce;}_0x1947e8[_0x11b1('0x19')](_0x245d45);return _0x1947e8[_0x11b1('0x20')](_0x11b1('0x21'),_0xe0e739+'-'+_0x27c66a+'/'+_0x49ceaf)[_0x11b1('0x1b')](_0x3a064a);}return null;};}function patchUpdates(_0x3ff83e){return function(_0x2c7532){try{jsonpatch[_0x11b1('0x22')](_0x2c7532,_0x3ff83e,!![]);}catch(_0x28a8a3){return BPromise[_0x11b1('0x23')](_0x28a8a3);}return _0x2c7532[_0x11b1('0x24')]();};}function saveUpdates(_0x4d4d5f,_0x12b45a){return function(_0x4ac76a){if(_0x4ac76a){return _0x4ac76a[_0x11b1('0x25')](_0x4d4d5f)[_0x11b1('0x26')](function(_0x3a5b62){return _0x3a5b62;});}return null;};}function removeEntity(_0xd37ada,_0x22eb15){return function(_0x14867b){if(_0x14867b){return _0x14867b[_0x11b1('0x27')]()[_0x11b1('0x26')](function(){var _0x2404b0=_0x14867b['get']({'plain':!![]});var _0x7abae5=_0x11b1('0x28');return db['UserProfileResource'][_0x11b1('0x27')]({'where':{'type':_0x7abae5,'resourceId':_0x2404b0['id']}})[_0x11b1('0x26')](function(){return _0x14867b;});})['then'](function(){_0xd37ada[_0x11b1('0x19')](0xcc)[_0x11b1('0x1a')]();});}};}function handleEntityNotFound(_0x28c9be,_0x385bf1){return function(_0x5de64f){if(!_0x5de64f){_0x28c9be[_0x11b1('0x29')](0x194);}return _0x5de64f;};}function handleError(_0x123a38,_0x36afa4){_0x36afa4=_0x36afa4||0x1f4;return function(_0x45b2ca){logger['error'](_0x45b2ca[_0x11b1('0x2a')]);if(_0x45b2ca[_0x11b1('0x2b')]){delete _0x45b2ca[_0x11b1('0x2b')];}_0x123a38[_0x11b1('0x19')](_0x36afa4)[_0x11b1('0x2c')](_0x45b2ca);};}exports[_0x11b1('0x2d')]=function(_0x6884,_0x56780c){var _0xef0fb3={},_0x13a9b2={},_0x2f738b={'count':0x0,'rows':[]};return db[_0x11b1('0x2e')][_0x11b1('0x2f')]()[_0x11b1('0x26')](function(_0x4d5660){_0x13a9b2[_0x11b1('0x30')]=_[_0x11b1('0x31')](_0x4d5660);_0x13a9b2[_0x11b1('0x32')]=_[_0x11b1('0x31')](_0x6884[_0x11b1('0x32')]);_0x13a9b2['filters']=_['intersection'](_0x13a9b2[_0x11b1('0x30')],_0x13a9b2['query']);_0xef0fb3[_0x11b1('0x33')]=_[_0x11b1('0x34')](_0x13a9b2[_0x11b1('0x30')],qs[_0x11b1('0x35')](_0x6884[_0x11b1('0x32')]['fields']));_0xef0fb3[_0x11b1('0x33')]=_0xef0fb3[_0x11b1('0x33')][_0x11b1('0x36')]?_0xef0fb3[_0x11b1('0x33')]:_0x13a9b2['model'];if(!_0x6884[_0x11b1('0x32')][_0x11b1('0x37')](_0x11b1('0x38'))){_0xef0fb3['limit']=qs[_0x11b1('0x1e')](_0x6884['query'][_0x11b1('0x1e')]);_0xef0fb3[_0x11b1('0x1c')]=qs[_0x11b1('0x1c')](_0x6884[_0x11b1('0x32')]['offset']);}_0xef0fb3['order']=qs[_0x11b1('0x39')](_0x6884[_0x11b1('0x32')][_0x11b1('0x39')]);_0xef0fb3[_0x11b1('0x3a')]=qs['filters'](_[_0x11b1('0x3b')](_0x6884[_0x11b1('0x32')],_0x13a9b2[_0x11b1('0x3c')]),_0x4d5660);if(_0x6884['query']['filter']){_0xef0fb3[_0x11b1('0x3a')]=_[_0x11b1('0x3d')](_0xef0fb3[_0x11b1('0x3a')],{'$or':_[_0x11b1('0x3e')](_0xef0fb3['attributes'],function(_0x50266c){var _0x244f27={};_0x244f27[_0x50266c]={'$like':'%'+_0x6884[_0x11b1('0x32')][_0x11b1('0x3f')]+'%'};return _0x244f27;})});}_0xef0fb3=_[_0x11b1('0x3d')]({},_0xef0fb3,_0x6884[_0x11b1('0x40')]);var _0x111849={'where':_0xef0fb3[_0x11b1('0x3a')]};return db[_0x11b1('0x2e')][_0x11b1('0x1f')](_0x111849)[_0x11b1('0x26')](function(_0x91b9d0){_0x2f738b['count']=_0x91b9d0;if(_0x6884[_0x11b1('0x32')][_0x11b1('0x41')]){_0xef0fb3['include']=[{'all':!![]}];}return db[_0x11b1('0x2e')]['findAll'](_0xef0fb3);})[_0x11b1('0x26')](function(_0x429e49){_0x2f738b[_0x11b1('0x42')]=_0x429e49;return _0x2f738b;})[_0x11b1('0x26')](respondWithFilteredResult(_0x56780c,_0xef0fb3))[_0x11b1('0x43')](handleError(_0x56780c,null));})[_0x11b1('0x43')](handleError(_0x56780c,null));};exports[_0x11b1('0x44')]=function(_0x481229,_0x375e13){var _0x343f9f={'raw':![],'where':{'id':_0x481229[_0x11b1('0x45')]['id']}},_0x58e032={};_0x58e032[_0x11b1('0x30')]=_[_0x11b1('0x31')](db[_0x11b1('0x2e')][_0x11b1('0x46')]);_0x58e032[_0x11b1('0x32')]=_[_0x11b1('0x31')](_0x481229['query']);_0x58e032[_0x11b1('0x3c')]=_['intersection'](_0x58e032['model'],_0x58e032[_0x11b1('0x32')]);_0x343f9f[_0x11b1('0x33')]=_[_0x11b1('0x34')](_0x58e032[_0x11b1('0x30')],qs[_0x11b1('0x35')](_0x481229[_0x11b1('0x32')][_0x11b1('0x35')]));_0x343f9f[_0x11b1('0x33')]=_0x343f9f[_0x11b1('0x33')]['length']?_0x343f9f[_0x11b1('0x33')]:_0x58e032[_0x11b1('0x30')];if(_0x481229[_0x11b1('0x32')][_0x11b1('0x41')]){_0x343f9f[_0x11b1('0x47')]=[{'all':!![]}];}_0x343f9f=_[_0x11b1('0x3d')]({},_0x343f9f,_0x481229[_0x11b1('0x40')]);return db[_0x11b1('0x2e')][_0x11b1('0x48')](_0x343f9f)[_0x11b1('0x26')](handleEntityNotFound(_0x375e13,null))[_0x11b1('0x26')](respondWithResult(_0x375e13,null))['catch'](handleError(_0x375e13,null));};exports[_0x11b1('0x49')]=function(_0x25995b,_0x2125dd){return db[_0x11b1('0x2e')][_0x11b1('0x49')](_0x25995b['body'],{})[_0x11b1('0x26')](function(_0x28acc8){var _0x11c936=_0x25995b[_0x11b1('0x4a')][_0x11b1('0x4b')]({'plain':!![]});if(!_0x11c936)throw new Error(_0x11b1('0x4c'));if(_0x11c936[_0x11b1('0x4d')]===_0x11b1('0x4a')){var _0x149084=_0x28acc8[_0x11b1('0x4b')]({'plain':!![]});var _0x500213=_0x11b1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x500213,'userProfileId':_0x11c936['userProfileId']},'raw':!![]})[_0x11b1('0x26')](function(_0x1968dc){if(_0x1968dc&&_0x1968dc['autoAssociation']===0x0){return db[_0x11b1('0x4e')]['create']({'name':_0x149084[_0x11b1('0x2b')],'resourceId':_0x149084['id'],'type':_0x1968dc[_0x11b1('0x2b')],'sectionId':_0x1968dc['id']},{})['then'](function(){return _0x28acc8;});}else{return _0x28acc8;}})['catch'](function(_0x11c31e){logger[_0x11b1('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11c31e);throw _0x11c31e;});}return _0x28acc8;})[_0x11b1('0x26')](respondWithResult(_0x2125dd,0xc9))[_0x11b1('0x43')](handleError(_0x2125dd,null));};exports['update']=function(_0x5ebe12,_0x402be6){if(_0x5ebe12[_0x11b1('0x50')]['id']){delete _0x5ebe12[_0x11b1('0x50')]['id'];}return db[_0x11b1('0x2e')][_0x11b1('0x48')]({'where':{'id':_0x5ebe12['params']['id']}})[_0x11b1('0x26')](handleEntityNotFound(_0x402be6,null))['then'](saveUpdates(_0x5ebe12[_0x11b1('0x50')],null))[_0x11b1('0x26')](respondWithResult(_0x402be6,null))[_0x11b1('0x43')](handleError(_0x402be6,null));};exports['destroy']=function(_0x22f713,_0x240c87){return db[_0x11b1('0x2e')][_0x11b1('0x48')]({'where':{'id':_0x22f713['params']['id']}})[_0x11b1('0x26')](handleEntityNotFound(_0x240c87,null))[_0x11b1('0x26')](removeEntity(_0x240c87,null))[_0x11b1('0x43')](handleError(_0x240c87,null));};exports[_0x11b1('0x2f')]=function(_0x25fb87,_0x388025){return db['CmCompany'][_0x11b1('0x2f')]()[_0x11b1('0x26')](respondWithResult(_0x388025,null))['catch'](handleError(_0x388025,null));};exports[_0x11b1('0x51')]=function(_0x1fbc22,_0xf89334,_0x454ec2){return db['CmContact'][_0x11b1('0x48')]({'where':{'id':_0x1fbc22[_0x11b1('0x45')]['id']}})[_0x11b1('0x26')](handleEntityNotFound(_0xf89334,null))[_0x11b1('0x26')](function(_0x1a2322){if(_0x1a2322){return _0x1a2322[_0x11b1('0x51')](_0x1fbc22[_0x11b1('0x50')][_0x11b1('0x52')],_[_0x11b1('0x53')](_0x1fbc22[_0x11b1('0x50')],[_0x11b1('0x52'),'id'])||{});}})[_0x11b1('0x26')](respondWithResult(_0xf89334,null))[_0x11b1('0x43')](handleError(_0xf89334,null));};exports[_0x11b1('0x54')]=function(_0x559d9e,_0x137b56,_0x52abab){var _0x2faa50={};var _0x42ef87={};var _0x1b8a24;var _0x461970;return db[_0x11b1('0x2e')]['findOne']({'where':{'id':_0x559d9e['params']['id']}})[_0x11b1('0x26')](handleEntityNotFound(_0x137b56,null))[_0x11b1('0x26')](function(_0x119d75){if(_0x119d75){_0x1b8a24=_0x119d75;_0x42ef87['model']=_['keys'](db[_0x11b1('0x55')]['rawAttributes']);_0x42ef87[_0x11b1('0x32')]=_[_0x11b1('0x31')](_0x559d9e['query']);_0x42ef87[_0x11b1('0x3c')]=_['intersection'](_0x42ef87[_0x11b1('0x30')],_0x42ef87[_0x11b1('0x32')]);_0x2faa50[_0x11b1('0x33')]=_[_0x11b1('0x34')](_0x42ef87[_0x11b1('0x30')],qs['fields'](_0x559d9e[_0x11b1('0x32')]['fields']));_0x2faa50['attributes']=_0x2faa50['attributes'][_0x11b1('0x36')]?_0x2faa50[_0x11b1('0x33')]:_0x42ef87[_0x11b1('0x30')];_0x2faa50[_0x11b1('0x56')]=qs[_0x11b1('0x39')](_0x559d9e[_0x11b1('0x32')][_0x11b1('0x39')]);_0x2faa50['where']=qs[_0x11b1('0x3c')](_[_0x11b1('0x3b')](_0x559d9e[_0x11b1('0x32')],_0x42ef87[_0x11b1('0x3c')]));if(_0x559d9e[_0x11b1('0x32')][_0x11b1('0x3f')]){_0x2faa50['where']=_[_0x11b1('0x3d')](_0x2faa50[_0x11b1('0x3a')],{'$or':_[_0x11b1('0x3e')](_0x2faa50[_0x11b1('0x33')],function(_0x5d25c7){var _0x27f673={};_0x27f673[_0x5d25c7]={'$like':'%'+_0x559d9e['query'][_0x11b1('0x3f')]+'%'};return _0x27f673;})});}_0x2faa50=_['merge']({},_0x2faa50,_0x559d9e[_0x11b1('0x40')]);return _0x1b8a24[_0x11b1('0x54')](_0x2faa50);}})['then'](function(_0xef08c4){if(_0xef08c4){_0x461970=_0xef08c4[_0x11b1('0x36')];if(!_0x559d9e[_0x11b1('0x32')][_0x11b1('0x37')](_0x11b1('0x38'))){_0x2faa50[_0x11b1('0x1e')]=qs['limit'](_0x559d9e[_0x11b1('0x32')][_0x11b1('0x1e')]);_0x2faa50[_0x11b1('0x1c')]=qs[_0x11b1('0x1c')](_0x559d9e[_0x11b1('0x32')]['offset']);}return _0x1b8a24['getContacts'](_0x2faa50);}})['then'](function(_0x1ea518){if(_0x1ea518){return _0x1ea518?{'count':_0x461970,'rows':_0x1ea518}:null;}})['then'](respondWithResult(_0x137b56,null))[_0x11b1('0x43')](handleError(_0x137b56,null));}; \ No newline at end of file +var _0xa990=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','get','Companies','sendStatus','name','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','filter','options','includeAll','include','CmCompany','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','rawAttributes','length','pick','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x358675,_0x12aa40){var _0xab59aa=function(_0x37c618){while(--_0x37c618){_0x358675['push'](_0x358675['shift']());}};_0xab59aa(++_0x12aa40);}(_0xa990,0xed));var _0x0a99=function(_0x31c001,_0x51c2cd){_0x31c001=_0x31c001-0x0;var _0x1e2888=_0xa990[_0x31c001];return _0x1e2888;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require('request-promise');var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var Mustache=require(_0x0a99('0x6'));var util=require(_0x0a99('0x7'));var path=require(_0x0a99('0x8'));var sox=require('sox');var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require('lodash');var squel=require(_0x0a99('0xc'));var crypto=require(_0x0a99('0xd'));var jsforce=require(_0x0a99('0xe'));var deskjs=require(_0x0a99('0xf'));var toCsv=require(_0x0a99('0x9'));var querystring=require('querystring');var Papa=require(_0x0a99('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0a99('0x11'));var hardwareService=require(_0x0a99('0x12'));var logger=require(_0x0a99('0x13'))(_0x0a99('0x14'));var utils=require(_0x0a99('0x15'));var config=require(_0x0a99('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x17'))['db'];function respondWithStatusCode(_0x3326ef,_0x31a53f){_0x31a53f=_0x31a53f||0xcc;return function(_0xdae76){if(_0xdae76){return _0x3326ef['sendStatus'](_0x31a53f);}return _0x3326ef['status'](_0x31a53f)[_0x0a99('0x18')]();};}function respondWithResult(_0x4d92cd,_0x18a26d){_0x18a26d=_0x18a26d||0xc8;return function(_0x401a13){if(_0x401a13){return _0x4d92cd['status'](_0x18a26d)[_0x0a99('0x19')](_0x401a13);}};}function respondWithFilteredResult(_0x54bcc5,_0x552596){return function(_0x37d374){if(_0x37d374){var _0x3e9301=typeof _0x552596[_0x0a99('0x1a')]===_0x0a99('0x1b')&&typeof _0x552596[_0x0a99('0x1c')]==='undefined';var _0x37b48b=_0x37d374[_0x0a99('0x1d')];var _0x3abcbb=_0x3e9301?0x0:_0x552596['offset'];var _0xd279f7=_0x3e9301?_0x37d374[_0x0a99('0x1d')]:_0x552596[_0x0a99('0x1a')]+_0x552596[_0x0a99('0x1c')];var _0x598187;if(_0xd279f7>=_0x37b48b){_0xd279f7=_0x37b48b;_0x598187=0xc8;}else{_0x598187=0xce;}_0x54bcc5[_0x0a99('0x1e')](_0x598187);return _0x54bcc5[_0x0a99('0x1f')](_0x0a99('0x20'),_0x3abcbb+'-'+_0xd279f7+'/'+_0x37b48b)[_0x0a99('0x19')](_0x37d374);}return null;};}function patchUpdates(_0x55c4c4){return function(_0x4b4149){try{jsonpatch[_0x0a99('0x21')](_0x4b4149,_0x55c4c4,!![]);}catch(_0x5b5719){return BPromise[_0x0a99('0x22')](_0x5b5719);}return _0x4b4149['save']();};}function saveUpdates(_0x232d80,_0x1dd76e){return function(_0x2bf6f4){if(_0x2bf6f4){return _0x2bf6f4[_0x0a99('0x23')](_0x232d80)[_0x0a99('0x24')](function(_0x80a1b9){return _0x80a1b9;});}return null;};}function removeEntity(_0x4549f6,_0x2744b1){return function(_0x4a1c61){if(_0x4a1c61){return _0x4a1c61[_0x0a99('0x25')]()[_0x0a99('0x24')](function(){var _0x4d0aae=_0x4a1c61[_0x0a99('0x26')]({'plain':!![]});var _0x5bbfc3=_0x0a99('0x27');return db['UserProfileResource'][_0x0a99('0x25')]({'where':{'type':_0x5bbfc3,'resourceId':_0x4d0aae['id']}})['then'](function(){return _0x4a1c61;});})[_0x0a99('0x24')](function(){_0x4549f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3235c1,_0x4fb23b){return function(_0x4f981f){if(!_0x4f981f){_0x3235c1[_0x0a99('0x28')](0x194);}return _0x4f981f;};}function handleError(_0x1f4c0f,_0x20707b){_0x20707b=_0x20707b||0x1f4;return function(_0x4ee77c){logger['error'](_0x4ee77c['stack']);if(_0x4ee77c[_0x0a99('0x29')]){delete _0x4ee77c[_0x0a99('0x29')];}_0x1f4c0f['status'](_0x20707b)['send'](_0x4ee77c);};}exports['index']=function(_0x718e55,_0x2c5123){var _0x530a33={},_0x98cdd6={},_0x17ecf3={'count':0x0,'rows':[]};return db['CmCompany'][_0x0a99('0x2a')]()[_0x0a99('0x24')](function(_0x5e4f78){_0x98cdd6[_0x0a99('0x2b')]=_[_0x0a99('0x2c')](_0x5e4f78);_0x98cdd6[_0x0a99('0x2d')]=_[_0x0a99('0x2c')](_0x718e55[_0x0a99('0x2d')]);_0x98cdd6['filters']=_[_0x0a99('0x2e')](_0x98cdd6[_0x0a99('0x2b')],_0x98cdd6[_0x0a99('0x2d')]);_0x530a33[_0x0a99('0x2f')]=_['intersection'](_0x98cdd6[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x30')]));_0x530a33[_0x0a99('0x2f')]=_0x530a33['attributes']['length']?_0x530a33[_0x0a99('0x2f')]:_0x98cdd6[_0x0a99('0x2b')];if(!_0x718e55[_0x0a99('0x2d')][_0x0a99('0x31')](_0x0a99('0x32'))){_0x530a33[_0x0a99('0x1c')]=qs[_0x0a99('0x1c')](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x1c')]);_0x530a33[_0x0a99('0x1a')]=qs['offset'](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x1a')]);}_0x530a33[_0x0a99('0x33')]=qs[_0x0a99('0x34')](_0x718e55[_0x0a99('0x2d')]['sort']);_0x530a33['where']=qs[_0x0a99('0x35')](_['pick'](_0x718e55[_0x0a99('0x2d')],_0x98cdd6[_0x0a99('0x35')]),_0x5e4f78);if(_0x718e55[_0x0a99('0x2d')]['filter']){_0x530a33[_0x0a99('0x36')]=_[_0x0a99('0x37')](_0x530a33[_0x0a99('0x36')],{'$or':_[_0x0a99('0x38')](_0x530a33[_0x0a99('0x2f')],function(_0x4540bf){var _0x1452b6={};_0x1452b6[_0x4540bf]={'$like':'%'+_0x718e55[_0x0a99('0x2d')][_0x0a99('0x39')]+'%'};return _0x1452b6;})});}_0x530a33=_[_0x0a99('0x37')]({},_0x530a33,_0x718e55[_0x0a99('0x3a')]);var _0x2432cb={'where':_0x530a33[_0x0a99('0x36')]};return db['CmCompany'][_0x0a99('0x1d')](_0x2432cb)[_0x0a99('0x24')](function(_0x20f5d6){_0x17ecf3[_0x0a99('0x1d')]=_0x20f5d6;if(_0x718e55['query'][_0x0a99('0x3b')]){_0x530a33[_0x0a99('0x3c')]=[{'all':!![]}];}return db[_0x0a99('0x3d')][_0x0a99('0x3e')](_0x530a33);})['then'](function(_0x17d06f){_0x17ecf3[_0x0a99('0x3f')]=_0x17d06f;return _0x17ecf3;})['then'](respondWithFilteredResult(_0x2c5123,_0x530a33))[_0x0a99('0x40')](handleError(_0x2c5123,null));})[_0x0a99('0x40')](handleError(_0x2c5123,null));};exports[_0x0a99('0x41')]=function(_0x7eeaea,_0x1f96b9){var _0x5bdc0b={'raw':![],'where':{'id':_0x7eeaea[_0x0a99('0x42')]['id']}},_0x319263={};_0x319263[_0x0a99('0x2b')]=_[_0x0a99('0x2c')](db[_0x0a99('0x3d')]['rawAttributes']);_0x319263['query']=_['keys'](_0x7eeaea['query']);_0x319263['filters']=_[_0x0a99('0x2e')](_0x319263['model'],_0x319263['query']);_0x5bdc0b[_0x0a99('0x2f')]=_[_0x0a99('0x2e')](_0x319263[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x7eeaea['query'][_0x0a99('0x30')]));_0x5bdc0b[_0x0a99('0x2f')]=_0x5bdc0b['attributes']['length']?_0x5bdc0b[_0x0a99('0x2f')]:_0x319263[_0x0a99('0x2b')];if(_0x7eeaea[_0x0a99('0x2d')][_0x0a99('0x3b')]){_0x5bdc0b['include']=[{'all':!![]}];}_0x5bdc0b=_[_0x0a99('0x37')]({},_0x5bdc0b,_0x7eeaea['options']);return db[_0x0a99('0x3d')][_0x0a99('0x43')](_0x5bdc0b)[_0x0a99('0x24')](handleEntityNotFound(_0x1f96b9,null))[_0x0a99('0x24')](respondWithResult(_0x1f96b9,null))[_0x0a99('0x40')](handleError(_0x1f96b9,null));};exports[_0x0a99('0x44')]=function(_0x410b7a,_0x394c52){return db[_0x0a99('0x3d')][_0x0a99('0x44')](_0x410b7a[_0x0a99('0x45')],{})[_0x0a99('0x24')](function(_0x3afe55){var _0x1aa412=_0x410b7a[_0x0a99('0x46')][_0x0a99('0x26')]({'plain':!![]});if(!_0x1aa412)throw new Error(_0x0a99('0x47'));if(_0x1aa412[_0x0a99('0x48')]===_0x0a99('0x46')){var _0x1985dd=_0x3afe55[_0x0a99('0x26')]({'plain':!![]});var _0x362ab3=_0x0a99('0x27');return db['UserProfileSection'][_0x0a99('0x43')]({'where':{'name':_0x362ab3,'userProfileId':_0x1aa412[_0x0a99('0x49')]},'raw':!![]})[_0x0a99('0x24')](function(_0x51f55b){if(_0x51f55b&&_0x51f55b[_0x0a99('0x4a')]===0x0){return db[_0x0a99('0x4b')][_0x0a99('0x44')]({'name':_0x1985dd[_0x0a99('0x29')],'resourceId':_0x1985dd['id'],'type':_0x51f55b[_0x0a99('0x29')],'sectionId':_0x51f55b['id']},{})['then'](function(){return _0x3afe55;});}else{return _0x3afe55;}})[_0x0a99('0x40')](function(_0x1aadd7){logger[_0x0a99('0x4c')](_0x0a99('0x4d'),_0x1aadd7);throw _0x1aadd7;});}return _0x3afe55;})['then'](respondWithResult(_0x394c52,0xc9))[_0x0a99('0x40')](handleError(_0x394c52,null));};exports[_0x0a99('0x23')]=function(_0x2429b4,_0x2b67fb){if(_0x2429b4[_0x0a99('0x45')]['id']){delete _0x2429b4[_0x0a99('0x45')]['id'];}return db[_0x0a99('0x3d')]['find']({'where':{'id':_0x2429b4[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x2b67fb,null))['then'](saveUpdates(_0x2429b4[_0x0a99('0x45')],null))[_0x0a99('0x24')](respondWithResult(_0x2b67fb,null))[_0x0a99('0x40')](handleError(_0x2b67fb,null));};exports['destroy']=function(_0x5484b0,_0x326957){return db['CmCompany']['find']({'where':{'id':_0x5484b0[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x326957,null))[_0x0a99('0x24')](removeEntity(_0x326957,null))[_0x0a99('0x40')](handleError(_0x326957,null));};exports[_0x0a99('0x2a')]=function(_0x1f8aa7,_0x36245e){return db[_0x0a99('0x3d')][_0x0a99('0x2a')]()[_0x0a99('0x24')](respondWithResult(_0x36245e,null))['catch'](handleError(_0x36245e,null));};exports[_0x0a99('0x4e')]=function(_0x9d75b1,_0x8a0ce6,_0x51e761){return db[_0x0a99('0x4f')]['find']({'where':{'id':_0x9d75b1[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x8a0ce6,null))[_0x0a99('0x24')](function(_0x4cc220){if(_0x4cc220){return _0x4cc220[_0x0a99('0x4e')](_0x9d75b1[_0x0a99('0x45')][_0x0a99('0x50')],_[_0x0a99('0x51')](_0x9d75b1[_0x0a99('0x45')],[_0x0a99('0x50'),'id'])||{});}})['then'](respondWithResult(_0x8a0ce6,null))['catch'](handleError(_0x8a0ce6,null));};exports['getContacts']=function(_0x55d37b,_0x32e553,_0x371fee){var _0x17a914={};var _0x186e05={};var _0x35e279;var _0x550450;return db['CmCompany'][_0x0a99('0x52')]({'where':{'id':_0x55d37b[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x32e553,null))['then'](function(_0x197457){if(_0x197457){_0x35e279=_0x197457;_0x186e05['model']=_[_0x0a99('0x2c')](db[_0x0a99('0x4f')][_0x0a99('0x53')]);_0x186e05[_0x0a99('0x2d')]=_[_0x0a99('0x2c')](_0x55d37b['query']);_0x186e05[_0x0a99('0x35')]=_[_0x0a99('0x2e')](_0x186e05[_0x0a99('0x2b')],_0x186e05['query']);_0x17a914['attributes']=_['intersection'](_0x186e05[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x30')]));_0x17a914[_0x0a99('0x2f')]=_0x17a914[_0x0a99('0x2f')][_0x0a99('0x54')]?_0x17a914[_0x0a99('0x2f')]:_0x186e05[_0x0a99('0x2b')];_0x17a914[_0x0a99('0x33')]=qs[_0x0a99('0x34')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x34')]);_0x17a914['where']=qs[_0x0a99('0x35')](_[_0x0a99('0x55')](_0x55d37b[_0x0a99('0x2d')],_0x186e05[_0x0a99('0x35')]));if(_0x55d37b['query'][_0x0a99('0x39')]){_0x17a914[_0x0a99('0x36')]=_[_0x0a99('0x37')](_0x17a914[_0x0a99('0x36')],{'$or':_[_0x0a99('0x38')](_0x17a914['attributes'],function(_0x265d59){var _0x183c33={};_0x183c33[_0x265d59]={'$like':'%'+_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x39')]+'%'};return _0x183c33;})});}_0x17a914=_[_0x0a99('0x37')]({},_0x17a914,_0x55d37b[_0x0a99('0x3a')]);return _0x35e279[_0x0a99('0x56')](_0x17a914);}})[_0x0a99('0x24')](function(_0x2c1a92){if(_0x2c1a92){_0x550450=_0x2c1a92[_0x0a99('0x54')];if(!_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x31')]('nolimit')){_0x17a914[_0x0a99('0x1c')]=qs['limit'](_0x55d37b['query'][_0x0a99('0x1c')]);_0x17a914[_0x0a99('0x1a')]=qs[_0x0a99('0x1a')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x1a')]);}return _0x35e279[_0x0a99('0x56')](_0x17a914);}})[_0x0a99('0x24')](function(_0x2256f0){if(_0x2256f0){return _0x2256f0?{'count':_0x550450,'rows':_0x2256f0}:null;}})[_0x0a99('0x24')](respondWithResult(_0x32e553,null))[_0x0a99('0x40')](handleError(_0x32e553,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 7e02152..c7f86a6 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 _0x8579=['path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','bluebird','request-promise'];(function(_0x48e233,_0x4189c5){var _0x887c5=function(_0x5c5026){while(--_0x5c5026){_0x48e233['push'](_0x48e233['shift']());}};_0x887c5(++_0x4189c5);}(_0x8579,0xf7));var _0x9857=function(_0x502b3a,_0x381e69){_0x502b3a=_0x502b3a-0x0;var _0x38241c=_0x8579[_0x502b3a];return _0x38241c;};'use strict';var _=require(_0x9857('0x0'));var util=require(_0x9857('0x1'));var logger=require('../../config/logger')(_0x9857('0x2'));var moment=require('moment');var BPromise=require(_0x9857('0x3'));var rp=require(_0x9857('0x4'));var fs=require('fs');var path=require(_0x9857('0x5'));var rimraf=require('rimraf');var config=require(_0x9857('0x6'));var attributes=require(_0x9857('0x7'));module[_0x9857('0x8')]=function(_0x12cff5,_0x4c924c){return _0x12cff5[_0x9857('0x9')](_0x9857('0xa'),attributes,{'tableName':_0x9857('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9eb=['util','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany'];(function(_0x4ebc20,_0x4c087b){var _0x26fce3=function(_0x59253f){while(--_0x59253f){_0x4ebc20['push'](_0x4ebc20['shift']());}};_0x26fce3(++_0x4c087b);}(_0xd9eb,0xa8));var _0xbd9e=function(_0x2d2ccc,_0x30f2fe){_0x2d2ccc=_0x2d2ccc-0x0;var _0x54dc55=_0xd9eb[_0x2d2ccc];return _0x54dc55;};'use strict';var _=require('lodash');var util=require(_0xbd9e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd9e('0x1'));var fs=require('fs');var path=require(_0xbd9e('0x2'));var rimraf=require(_0xbd9e('0x3'));var config=require(_0xbd9e('0x4'));var attributes=require(_0xbd9e('0x5'));module['exports']=function(_0x476629,_0x121125){return _0x476629['define'](_0xbd9e('0x6'),attributes,{'tableName':'cm_companies','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 40af63e..202745c 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 _0x0570=['code','error','message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0570,0x1a7));var _0x0057=function(_0x3f248d,_0x348cea){_0x3f248d=_0x3f248d-0x0;var _0x2db49e=_0x0570[_0x3f248d];return _0x2db49e;};'use strict';var _=require(_0x0057('0x0'));var util=require(_0x0057('0x1'));var moment=require(_0x0057('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require(_0x0057('0x4'))['db'];var utils=require(_0x0057('0x5'));var logger=require('../../config/logger')(_0x0057('0x6'));var config=require('../../config/environment');var jayson=require(_0x0057('0x7'));var client=jayson['client'][_0x0057('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11596c,_0x3ed6ec,_0x27b425){return new BPromise(function(_0x4c4fcf,_0x4d627b){return client[_0x0057('0x9')](_0x11596c,_0x27b425)[_0x0057('0xa')](function(_0x4feba4){logger[_0x0057('0xb')](_0x0057('0xc'),_0x3ed6ec,'request\x20sent');logger[_0x0057('0xd')](_0x0057('0xe'),_0x3ed6ec,_0x0057('0xf'),JSON[_0x0057('0x10')](_0x4feba4));if(_0x4feba4['error']){if(_0x4feba4['error'][_0x0057('0x11')]===0x1f4){logger[_0x0057('0x12')]('CmCompany,\x20%s,\x20%s',_0x3ed6ec,_0x4feba4[_0x0057('0x12')][_0x0057('0x13')]);return _0x4d627b(_0x4feba4[_0x0057('0x12')]['message']);}logger['error'](_0x0057('0xc'),_0x3ed6ec,_0x4feba4[_0x0057('0x12')][_0x0057('0x13')]);return _0x4c4fcf(_0x4feba4['error'][_0x0057('0x13')]);}else{logger[_0x0057('0xb')](_0x0057('0xc'),_0x3ed6ec,_0x0057('0xf'));_0x4c4fcf(_0x4feba4['result'][_0x0057('0x13')]);}})['catch'](function(_0x3bb75d){logger[_0x0057('0x12')](_0x0057('0xc'),_0x3ed6ec,_0x3bb75d);_0x4d627b(_0x3bb75d);});});} \ No newline at end of file +var _0xe05a=['stringify','error','code','message','result','lodash','moment','bluebird','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x42ea30,_0x3c60c1){var _0x83e81e=function(_0x3b0e4a){while(--_0x3b0e4a){_0x42ea30['push'](_0x42ea30['shift']());}};_0x83e81e(++_0x3c60c1);}(_0xe05a,0xf3));var _0xae05=function(_0x5be0e5,_0x187d76){_0x5be0e5=_0x5be0e5-0x0;var _0x518f42=_0xe05a[_0x5be0e5];return _0x518f42;};'use strict';var _=require(_0xae05('0x0'));var util=require('util');var moment=require(_0xae05('0x1'));var BPromise=require(_0xae05('0x2'));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')(_0xae05('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae05('0x4')][_0xae05('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1c5c3e,_0x43a8ba,_0x3a8867){return new BPromise(function(_0x112eec,_0x1c1752){return client[_0xae05('0x6')](_0x1c5c3e,_0x3a8867)[_0xae05('0x7')](function(_0x25a136){logger[_0xae05('0x8')](_0xae05('0x9'),_0x43a8ba,_0xae05('0xa'));logger[_0xae05('0xb')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x43a8ba,'request\x20sent',JSON[_0xae05('0xc')](_0x25a136));if(_0x25a136[_0xae05('0xd')]){if(_0x25a136[_0xae05('0xd')][_0xae05('0xe')]===0x1f4){logger[_0xae05('0xd')](_0xae05('0x9'),_0x43a8ba,_0x25a136[_0xae05('0xd')]['message']);return _0x1c1752(_0x25a136['error']['message']);}logger['error'](_0xae05('0x9'),_0x43a8ba,_0x25a136[_0xae05('0xd')]['message']);return _0x112eec(_0x25a136[_0xae05('0xd')][_0xae05('0xf')]);}else{logger[_0xae05('0x8')](_0xae05('0x9'),_0x43a8ba,'request\x20sent');_0x112eec(_0x25a136[_0xae05('0x10')]['message']);}})['catch'](function(_0x42e690){logger[_0xae05('0xd')](_0xae05('0x9'),_0x43a8ba,_0x42e690);_0x1c1752(_0x42e690);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 5a7d143..8929424 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 _0xfe20=['express','Router','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id/contacts','getContacts','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x44d2a8,_0x337c45){var _0x53b4bf=function(_0x2b872b){while(--_0x2b872b){_0x44d2a8['push'](_0x44d2a8['shift']());}};_0x53b4bf(++_0x337c45);}(_0xfe20,0x11f));var _0x0fe2=function(_0x3ff6e4,_0xcc15ee){_0x3ff6e4=_0x3ff6e4-0x0;var _0x5b8381=_0xfe20[_0x3ff6e4];return _0x5b8381;};'use strict';var multer=require(_0x0fe2('0x0'));var util=require('util');var path=require(_0x0fe2('0x1'));var timeout=require('connect-timeout');var express=require(_0x0fe2('0x2'));var router=express[_0x0fe2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fe2('0x4'));var controller=require(_0x0fe2('0x5'));router[_0x0fe2('0x6')]('/',auth[_0x0fe2('0x7')](),controller[_0x0fe2('0x8')]);router['get']('/describe',auth[_0x0fe2('0x7')](),controller['describe']);router[_0x0fe2('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0fe2('0x6')](_0x0fe2('0x9'),auth[_0x0fe2('0x7')](),controller[_0x0fe2('0xa')]);router['post']('/',auth[_0x0fe2('0x7')](),controller[_0x0fe2('0xb')]);router['post'](_0x0fe2('0x9'),auth[_0x0fe2('0x7')](),controller['addContacts']);router['put'](_0x0fe2('0xc'),auth[_0x0fe2('0x7')](),controller[_0x0fe2('0xd')]);router[_0x0fe2('0xe')](_0x0fe2('0xc'),auth[_0x0fe2('0x7')](),controller[_0x0fe2('0xf')]);module[_0x0fe2('0x10')]=router; \ No newline at end of file +var _0x190d=['../../config/environment','get','isAuthenticated','index','/describe','show','/:id/contacts','getContacts','post','addContacts','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x51e916,_0x549682){var _0x2f718d=function(_0x402905){while(--_0x402905){_0x51e916['push'](_0x51e916['shift']());}};_0x2f718d(++_0x549682);}(_0x190d,0x126));var _0xd190=function(_0x25131c,_0x55c347){_0x25131c=_0x25131c-0x0;var _0x829a63=_0x190d[_0x25131c];return _0x829a63;};'use strict';var multer=require(_0xd190('0x0'));var util=require('util');var path=require(_0xd190('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd190('0x2')]();var fs_extra=require(_0xd190('0x3'));var auth=require(_0xd190('0x4'));var interaction=require(_0xd190('0x5'));var config=require(_0xd190('0x6'));var controller=require('./cmCompany.controller');router[_0xd190('0x7')]('/',auth[_0xd190('0x8')](),controller[_0xd190('0x9')]);router[_0xd190('0x7')](_0xd190('0xa'),auth[_0xd190('0x8')](),controller['describe']);router[_0xd190('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd190('0xb')]);router[_0xd190('0x7')](_0xd190('0xc'),auth['isAuthenticated'](),controller[_0xd190('0xd')]);router[_0xd190('0xe')]('/',auth[_0xd190('0x8')](),controller['create']);router['post'](_0xd190('0xc'),auth[_0xd190('0x8')](),controller[_0xd190('0xf')]);router['put'](_0xd190('0x10'),auth[_0xd190('0x8')](),controller[_0xd190('0x11')]);router['delete']('/:id',auth[_0xd190('0x8')](),controller[_0xd190('0x12')]);module[_0xd190('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 759707e..d0990b7 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 _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x757a,0xde));var _0xa757=function(_0x5d8799,_0x1966fd){_0x5d8799=_0x5d8799-0x0;var _0x20c246=_0x757a[_0x5d8799];return _0x20c246;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x3e447f,_0x1162b9){var _0x7f2d95=function(_0x8ac030){while(--_0x8ac030){_0x3e447f['push'](_0x3e447f['shift']());}};_0x7f2d95(++_0x1162b9);}(_0xb10b,0x12a));var _0xbb10=function(_0xe3a46,_0x4f9273){_0xe3a46=_0xe3a46-0x0;var _0x5bb333=_0xb10b[_0xe3a46];return _0x5bb333;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a3856b6..3d6b93e 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 _0xe610=['ContactId','options','includeAll','include','getHopperHistories','pick','getHopperFinals','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','firstName','../../components/import/cm/csv2','message','start\x20child\x20process\x20correctly!','getJourney','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','chat','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','all','sortBy','slice','moment','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','status','undefined','limit','count','offset','set','json','update','then','destroy','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','cf_','CmCustomField','trimStart','model','query','intersection','attributes','hasOwnProperty','nolimit','order','where','filters','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','search','parseSearch','conditions','Tag','split','forEach','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','value','start','map','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','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.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','Tags','rows','params','catch','startsWith','columnName','analytics','displayName','alias','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','spread','show','find','color','$and','findAll','cf_%d','omit','pickBy','format','table','setFields','toParam','text','CmHopper','phone','getTags','findOne','rawAttributes','fields','sort','setTags','ids','getHoppers'];(function(_0x5a36be,_0x270d4a){var _0x5b2981=function(_0x536dd5){while(--_0x536dd5){_0x5a36be['push'](_0x5a36be['shift']());}};_0x5b2981(++_0x270d4a);}(_0xe610,0x184));var _0x0e61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe610[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x0e61('0x0'));var BPromise=require('bluebird');var util=require(_0x0e61('0x1'));var path=require(_0x0e61('0x2'));var fs=require('fs');var _=require(_0x0e61('0x3'));var squel=require(_0x0e61('0x4'));var Papa=require('papaparse');var Redis=require(_0x0e61('0x5'));var qs=require(_0x0e61('0x6'));var as=require(_0x0e61('0x7'));var logger=require('../../config/logger')(_0x0e61('0x8'));var config=require(_0x0e61('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x0e61('0xa')]=_[_0x0e61('0xb')](config['redis'],{'host':_0x0e61('0xc'),'port':0x18eb});var socket=require(_0x0e61('0xd'))(new Redis(config[_0x0e61('0xa')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x50b817,_0x5c36b5){_0x5c36b5=_0x5c36b5||0xc8;return function(_0x4a7a20){if(_0x4a7a20){return _0x50b817[_0x0e61('0xe')](_0x5c36b5)['json'](_0x4a7a20);}};}function respondWithFilteredResult(_0x23011e,_0x42550a){return function(_0x2c5005){if(_0x2c5005){var _0x17f5ad=typeof _0x42550a['offset']===_0x0e61('0xf')&&typeof _0x42550a[_0x0e61('0x10')]==='undefined';var _0x22c62a=_0x2c5005[_0x0e61('0x11')];var _0x34b4a3=_0x17f5ad?0x0:_0x42550a[_0x0e61('0x12')];var _0x23a3db=_0x17f5ad?_0x2c5005[_0x0e61('0x11')]:_0x42550a[_0x0e61('0x12')]+_0x42550a[_0x0e61('0x10')];var _0x5e81da;if(_0x23a3db>=_0x22c62a){_0x23a3db=_0x22c62a;_0x5e81da=0xc8;}else{_0x5e81da=0xce;}_0x23011e[_0x0e61('0xe')](_0x5e81da);return _0x23011e[_0x0e61('0x13')]('Content-Range',_0x34b4a3+'-'+_0x23a3db+'/'+_0x22c62a)[_0x0e61('0x14')](_0x2c5005);}return null;};}function saveUpdates(_0xfd0c61){return function(_0x5eaa20){if(_0x5eaa20){return _0x5eaa20[_0x0e61('0x15')](_0xfd0c61)[_0x0e61('0x16')](function(_0x193f28){return _0x193f28;});}return null;};}function removeEntity(_0x2fe45e){return function(_0x496618){if(_0x496618){return _0x496618[_0x0e61('0x17')]()[_0x0e61('0x16')](function(){_0x2fe45e[_0x0e61('0xe')](0xcc)[_0x0e61('0x18')]();});}};}function handleEntityNotFound(_0x417448){return function(_0x1b95d2){if(!_0x1b95d2){_0x417448[_0x0e61('0x19')](0x194);}return _0x1b95d2;};}function handleError(_0x40a74a,_0xbc6938){_0xbc6938=_0xbc6938||0x1f4;return function(_0x1c31e5){logger['error'](_0x1c31e5[_0x0e61('0x1a')]);if(_0x1c31e5[_0x0e61('0x1b')]){delete _0x1c31e5['name'];}_0x40a74a['status'](_0xbc6938)[_0x0e61('0x1c')](_0x1c31e5);};}exports[_0x0e61('0x1d')]=function(_0x536164,_0xf81824){var _0x549e43={},_0x27709d={},_0x41b72b={'count':0x0,'rows':[]};return db[_0x0e61('0x1e')][_0x0e61('0x1f')]()[_0x0e61('0x16')](function(_0x336b1e){var _0x593105=[];for(var _0x1525bf=0x0;_0x1525bf0x1){_0x5de303['or'](_0x0e61('0x5a'),qs[_0x0e61('0x5b')](_0x132dab),null);}else{if(qs[_0x0e61('0x5c')](_0x132dab)){_0x5de303['or'](_0x0e61('0x5d'),_0x132dab+'%');_0x5de303['or'](_0x0e61('0x5e'),_0x132dab+'%');_0x5de303['or'](_0x0e61('0x5f'),_0x132dab+'%');_0x5de303['or'](_0x0e61('0x60'),_0x132dab+'%');}else if(qs[_0x0e61('0x61')](_0x132dab)){_0x5de303['or'](_0x0e61('0x62'),_0x132dab+'%');}else{_0x5de303['or'](_0x0e61('0x63'),'%'+_0x132dab+'%');_0x5de303['or'](_0x0e61('0x64'),'%'+_0x132dab+'%');_0x5de303['or'](_0x0e61('0x62'),'%'+_0x132dab+'%');}}}}_0x294ee2[_0x0e61('0x2c')](_0x5de303);_0x294ee2['group'](_0x0e61('0x65'));var _0x3603f8={'type':db[_0x0e61('0x66')][_0x0e61('0x67')][_0x0e61('0x68')],'raw':!![]};var _0x1f6b86=_0x294ee2[_0x0e61('0x69')]()[_0x0e61('0x2e')](_0x0e61('0x65'));if(_0x549e43[_0x0e61('0x2b')]){_0x549e43[_0x0e61('0x2b')]['forEach'](function(_0x408a18){_0x294ee2['order']('c.'+_0x408a18[0x0],_0x408a18[0x1]===_0x0e61('0x6a')?![]:!![]);});}if(!_[_0x0e61('0x50')](_0x52a306)){_0x294ee2[_0x0e61('0x6b')](_0x5051d8);_0x1f6b86[_0x0e61('0x2c')](_0x0e61('0x6c'),_0x52a306);}BPromise[_0x0e61('0x6d')]()[_0x0e61('0x16')](function(){if(!_0x29552a)return;if(_0x536164[_0x0e61('0x6e')][_0x0e61('0x6f')]!==_0x0e61('0x70'))return;if(!_[_0x0e61('0x71')](_0x29552a[_0x0e61('0x3b')],[_0x0e61('0x2e'),_0x0e61('0x40')])){return _0x536164[_0x0e61('0x6e')][_0x0e61('0x72')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c93e5){if(_[_0x0e61('0x50')](_0x4c93e5)){_0x1f6b86[_0x0e61('0x2c')]('c.ListId\x20IS\x20NULL');_0x294ee2[_0x0e61('0x2c')](_0x0e61('0x73'));}else{_0x1f6b86[_0x0e61('0x2c')](_0x0e61('0x52'),_[_0x0e61('0x4b')](_0x4c93e5,'id'));_0x294ee2[_0x0e61('0x2c')](_0x0e61('0x52'),_[_0x0e61('0x4b')](_0x4c93e5,'id'));}});}})[_0x0e61('0x16')](function(){if(_0x536164['user'][_0x0e61('0x6f')]===_0x0e61('0x70')&&!_0x29552a&&!_0x536164[_0x0e61('0x26')][_0x0e61('0x51')])return[];return db['sequelize'][_0x0e61('0x26')](_0x1f6b86['toString'](),_0x3603f8);})[_0x0e61('0x16')](function(_0x2c73da){_0x41b72b[_0x0e61('0x11')]=_0x2c73da[_0x0e61('0x21')];if(_0x41b72b[_0x0e61('0x11')]===0x0)return[];return db['sequelize']['query'](_0x2bbe35[_0x0e61('0x74')](),_0x3603f8)[_0x0e61('0x16')](function(_0x436c9d){_0x2092f7=_[_0x0e61('0x75')](_0x436c9d,'id');_0x3603f8=_[_0x0e61('0x76')](_0x3603f8,{'model':db[_0x0e61('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x536164[_0x0e61('0x26')]['fields']){_0x549e43[_0x0e61('0x28')][_0x0e61('0x3e')](function(_0x4c0806){_0x294ee2[_0x0e61('0x2e')]('c.'+_0x4c0806);});}else{_0x294ee2['field']('c.id');_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x77'));_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x78'));_0x294ee2['field']('c.phone');_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x79'));_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x7a'));_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x7b'));_0x294ee2['field'](_0x0e61('0x7c'));_0x294ee2[_0x0e61('0x2e')]('c.createdAt');_0x294ee2['field'](_0x0e61('0x7d'));_0x294ee2['field'](_0x0e61('0x7e'));_0x294ee2[_0x0e61('0x2e')](_0x0e61('0x7f'),_0x0e61('0x80'));}if(_0x549e43[_0x0e61('0x10')])_0x294ee2['limit'](_0x549e43[_0x0e61('0x10')]);if(_0x549e43['offset'])_0x294ee2[_0x0e61('0x12')](_0x549e43[_0x0e61('0x12')]);return db[_0x0e61('0x81')][_0x0e61('0x26')](_0x294ee2[_0x0e61('0x74')](),_0x3603f8);});})[_0x0e61('0x16')](function(_0x556405){_0x556405[_0x0e61('0x3e')](function(_0x324f47){if(_0x324f47['TagIds']){_0x324f47['Tags']=[];_0x324f47[_0x0e61('0x80')][_0x0e61('0x3d')](',')['forEach'](function(_0x13a07e){_0x324f47[_0x0e61('0x82')][_0x0e61('0x4f')](_0x2092f7[_0x13a07e]);});}delete _0x324f47[_0x0e61('0x80')];});_0x41b72b[_0x0e61('0x83')]=_0x556405;return _0x41b72b;})[_0x0e61('0x16')](respondWithFilteredResult(_0xf81824,_0x549e43));})['catch'](handleError(_0xf81824,null));};exports['destroy']=function(_0xf827cd,_0x352440){return db[_0x0e61('0x1e')]['find']({'where':{'id':_0xf827cd[_0x0e61('0x84')]['id']}})['then'](handleEntityNotFound(_0x352440,null))['then'](removeEntity(_0x352440,null))[_0x0e61('0x85')](handleError(_0x352440,null));};exports['describe']=function(_0x338fb0,_0x345d2e){return db['CmContact'][_0x0e61('0x1f')]()['then'](function(_0x54d04b){delete _0x54d04b['tags'];for(var _0x240d55=0x0;_0x240d55=_0x5998fd){_0x23e507=_0x5998fd;_0x1e3bdb=0xc8;}else{_0x1e3bdb=0xce;}_0x3b4ee0[_0x515d('0x15')](_0x1e3bdb);return _0x3b4ee0[_0x515d('0x16')](_0x515d('0x17'),_0x247da2+'-'+_0x23e507+'/'+_0x5998fd)['json'](_0x457b56);}return null;};}function saveUpdates(_0x48fe29){return function(_0x3c2668){if(_0x3c2668){return _0x3c2668['update'](_0x48fe29)['then'](function(_0x176082){return _0x176082;});}return null;};}function removeEntity(_0x435be0){return function(_0x26a955){if(_0x26a955){return _0x26a955['destroy']()[_0x515d('0x18')](function(){_0x435be0[_0x515d('0x15')](0xcc)[_0x515d('0x19')]();});}};}function handleEntityNotFound(_0x599c93){return function(_0x212d0e){if(!_0x212d0e){_0x599c93['sendStatus'](0x194);}return _0x212d0e;};}function handleError(_0x46c166,_0x50f421){_0x50f421=_0x50f421||0x1f4;return function(_0x3a1b8d){logger[_0x515d('0x1a')](_0x3a1b8d[_0x515d('0x1b')]);if(_0x3a1b8d[_0x515d('0x1c')]){delete _0x3a1b8d[_0x515d('0x1c')];}_0x46c166['status'](_0x50f421)['send'](_0x3a1b8d);};}exports[_0x515d('0x1d')]=function(_0x3a8106,_0x3fa849){var _0x27ef06={},_0x3a3348={},_0x3be20a={'count':0x0,'rows':[]};return db[_0x515d('0x1e')][_0x515d('0x1f')]()['then'](function(_0xf916ab){var _0x14778c=[];for(var _0x377e32=0x0;_0x377e320x1){_0x2b5f62['or'](_0x515d('0x5e'),qs[_0x515d('0x5f')](_0x51a65c),null);}else{if(qs[_0x515d('0x60')](_0x51a65c)){_0x2b5f62['or'](_0x515d('0x61'),_0x51a65c+'%');_0x2b5f62['or'](_0x515d('0x62'),_0x51a65c+'%');_0x2b5f62['or'](_0x515d('0x63'),_0x51a65c+'%');_0x2b5f62['or']('c.fax\x20LIKE\x20?',_0x51a65c+'%');}else if(qs[_0x515d('0x64')](_0x51a65c)){_0x2b5f62['or']('c.email\x20LIKE\x20?',_0x51a65c+'%');}else{_0x2b5f62['or'](_0x515d('0x65'),'%'+_0x51a65c+'%');_0x2b5f62['or'](_0x515d('0x66'),'%'+_0x51a65c+'%');_0x2b5f62['or'](_0x515d('0x67'),'%'+_0x51a65c+'%');}}}}_0x550c03[_0x515d('0x32')](_0x2b5f62);_0x550c03[_0x515d('0x68')](_0x515d('0x69'));var _0x2f302d={'type':db[_0x515d('0x6a')]['QueryTypes'][_0x515d('0x6b')],'raw':!![]};var _0x4f0c84=_0x550c03[_0x515d('0x6c')]()['field'](_0x515d('0x69'));if(_0x27ef06[_0x515d('0x31')]){_0x27ef06[_0x515d('0x31')][_0x515d('0x48')](function(_0x14b545){_0x550c03[_0x515d('0x31')]('c.'+_0x14b545[0x0],_0x14b545[0x1]===_0x515d('0x6d')?![]:!![]);});}if(!_['isEmpty'](_0x450a02)){_0x550c03[_0x515d('0x6e')](_0x366124);_0x4f0c84[_0x515d('0x32')]('t.id\x20IN\x20?',_0x450a02);}BPromise[_0x515d('0x6f')]()[_0x515d('0x18')](function(){if(!_0x9a2ba2)return;if(_0x3a8106['user'][_0x515d('0x70')]!==_0x515d('0x71'))return;if(!_[_0x515d('0x72')](_0x9a2ba2[_0x515d('0x43')],[_0x515d('0x34'),'User'])){return _0x3a8106[_0x515d('0x73')][_0x515d('0x74')]({'attributes':['id'],'raw':!![]})[_0x515d('0x18')](function(_0x48063b){if(_['isEmpty'](_0x48063b)){_0x4f0c84['where']('c.ListId\x20IS\x20NULL');_0x550c03[_0x515d('0x32')](_0x515d('0x75'));}else{_0x4f0c84[_0x515d('0x32')](_0x515d('0x55'),_[_0x515d('0x51')](_0x48063b,'id'));_0x550c03[_0x515d('0x32')](_0x515d('0x55'),_[_0x515d('0x51')](_0x48063b,'id'));}});}})[_0x515d('0x18')](function(){if(_0x3a8106['user'][_0x515d('0x70')]===_0x515d('0x71')&&!_0x9a2ba2&&!_0x3a8106[_0x515d('0x2a')][_0x515d('0x76')])return[];return db[_0x515d('0x77')][_0x515d('0x2a')](_0x4f0c84[_0x515d('0x78')](),_0x2f302d);})[_0x515d('0x18')](function(_0x4b2e97){_0x3be20a[_0x515d('0x14')]=_0x4b2e97[_0x515d('0x21')];if(_0x3be20a['count']===0x0)return[];return db[_0x515d('0x77')][_0x515d('0x2a')](_0x276661[_0x515d('0x78')](),_0x2f302d)['then'](function(_0x3b28e6){_0x16561e=_[_0x515d('0x79')](_0x3b28e6,'id');_0x2f302d=_[_0x515d('0x7a')](_0x2f302d,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a8106['query'][_0x515d('0x2e')]){_0x27ef06[_0x515d('0x2c')][_0x515d('0x48')](function(_0x2ecee4){_0x550c03[_0x515d('0x34')]('c.'+_0x2ecee4);});}else{_0x550c03[_0x515d('0x34')](_0x515d('0x69'));_0x550c03['field']('c.firstName');_0x550c03['field'](_0x515d('0x7b'));_0x550c03[_0x515d('0x34')](_0x515d('0x7c'));_0x550c03[_0x515d('0x34')](_0x515d('0x7d'));_0x550c03['field'](_0x515d('0x7e'));_0x550c03[_0x515d('0x34')](_0x515d('0x7f'));_0x550c03[_0x515d('0x34')](_0x515d('0x80'));_0x550c03['field'](_0x515d('0x81'));_0x550c03[_0x515d('0x34')](_0x515d('0x82'));_0x550c03[_0x515d('0x34')](_0x515d('0x83'));_0x550c03[_0x515d('0x34')](_0x515d('0x84'),_0x515d('0x85'));}if(_0x27ef06['limit'])_0x550c03[_0x515d('0x13')](_0x27ef06[_0x515d('0x13')]);if(_0x27ef06[_0x515d('0x11')])_0x550c03[_0x515d('0x11')](_0x27ef06[_0x515d('0x11')]);return db[_0x515d('0x77')][_0x515d('0x2a')](_0x550c03['toString'](),_0x2f302d);});})[_0x515d('0x18')](function(_0x586836){_0x586836[_0x515d('0x48')](function(_0x43a4aa){if(_0x43a4aa[_0x515d('0x85')]){_0x43a4aa[_0x515d('0x86')]=[];_0x43a4aa[_0x515d('0x85')][_0x515d('0x47')](',')[_0x515d('0x48')](function(_0x1ff53a){_0x43a4aa[_0x515d('0x86')][_0x515d('0x23')](_0x16561e[_0x1ff53a]);});}delete _0x43a4aa[_0x515d('0x85')];});_0x3be20a['rows']=_0x586836;return _0x3be20a;})[_0x515d('0x18')](respondWithFilteredResult(_0x3fa849,_0x27ef06));})[_0x515d('0x87')](handleError(_0x3fa849,null));};exports[_0x515d('0x88')]=function(_0x234f57,_0xfff4a4){return db['CmContact'][_0x515d('0x44')]({'where':{'id':_0x234f57[_0x515d('0x89')]['id']}})[_0x515d('0x18')](handleEntityNotFound(_0xfff4a4,null))[_0x515d('0x18')](removeEntity(_0xfff4a4,null))[_0x515d('0x87')](handleError(_0xfff4a4,null));};exports[_0x515d('0x1f')]=function(_0x244b46,_0x2fd1ff){return db[_0x515d('0x1e')][_0x515d('0x1f')]()['then'](function(_0x4324af){delete _0x4324af[_0x515d('0x8a')];for(var _0x587195=0x0;_0x587195{}\s\\|]/g,'-');_0x56cc85(null,util[_0x4e59('0x24')](_0x4e59('0x25'),path[_0x4e59('0x26')](_0x2f0a25[_0x4e59('0x22')],path[_0x4e59('0x27')](_0x2f0a25['originalname'])),Date[_0x4e59('0x28')](),path['extname'](_0x2f0a25[_0x4e59('0x22')])));}})});router[_0x4e59('0x18')]('/csv',upload[_0x4e59('0x29')](_0x4e59('0x2a')),controller[_0x4e59('0x2b')]);var upload=multer({'storage':multer[_0x4e59('0x1e')]({'destination':function(_0x4fc9fb,_0x21bbdf,_0x4d939b){_0x4d939b(null,path['join'](config[_0x4e59('0x20')],_0x4e59('0x21')));},'filename':function(_0x332cdf,_0xddf6a1,_0x597ec8){_0xddf6a1[_0x4e59('0x22')]=_0xddf6a1[_0x4e59('0x22')][_0x4e59('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x597ec8(null,util[_0x4e59('0x24')](_0x4e59('0x25'),path['basename'](_0xddf6a1['originalname'],path[_0x4e59('0x27')](_0xddf6a1[_0x4e59('0x22')])),Date['now'](),path[_0x4e59('0x27')](_0xddf6a1[_0x4e59('0x22')])));}})});router['post']('/upload',upload['single']('file'),controller[_0x4e59('0x2c')]);router[_0x4e59('0x18')](_0x4e59('0x2d'),auth[_0x4e59('0xa')](),controller[_0x4e59('0x2e')]);router[_0x4e59('0x2f')](_0x4e59('0xe'),auth[_0x4e59('0xa')](),controller['update']);router[_0x4e59('0x30')]('/:id',auth[_0x4e59('0xa')](),controller[_0x4e59('0x31')]);module[_0x4e59('0x32')]=router; \ No newline at end of file +var _0xa1b9=['create','bulkCreate','join','originalname','replace','%s-%s%s','extname','/csv','diskStorage','server/files/tmp','format','basename','/upload','single','file','upload','/upload/:id','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/journey','getJourney','merge','post'];(function(_0x5d9df8,_0x500358){var _0x234cae=function(_0x3d119e){while(--_0x3d119e){_0x5d9df8['push'](_0x5d9df8['shift']());}};_0x234cae(++_0x500358);}(_0xa1b9,0x9e));var _0x9a1b=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa1b9[_0x3e112d];return _0x531c31;};'use strict';var multer=require('multer');var util=require(_0x9a1b('0x0'));var path=require(_0x9a1b('0x1'));var timeout=require(_0x9a1b('0x2'));var express=require(_0x9a1b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9a1b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9a1b('0x5'));var controller=require('./cmContact.controller');router[_0x9a1b('0x6')]('/',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x8')]);router[_0x9a1b('0x6')]('/describe',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x9')]);router['get'](_0x9a1b('0xa'),auth[_0x9a1b('0x7')](),controller[_0x9a1b('0xb')]);router[_0x9a1b('0x6')](_0x9a1b('0xc'),auth['isAuthenticated'](),controller['getTags']);router[_0x9a1b('0x6')](_0x9a1b('0xd'),auth['isAuthenticated'](),controller[_0x9a1b('0xe')]);router[_0x9a1b('0x6')]('/:id/hopper_histories',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0xf')]);router[_0x9a1b('0x6')](_0x9a1b('0x10'),auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x11')]);router['get']('/:id/jscripty_sessions',auth[_0x9a1b('0x7')](),controller['getJscriptySessions']);router[_0x9a1b('0x6')](_0x9a1b('0x12'),auth['isAuthenticated'](),controller[_0x9a1b('0x13')]);router['post']('/merge',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x14')]);router[_0x9a1b('0x15')]('/',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x16')]);router[_0x9a1b('0x15')]('/create_many',auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x17')]);router[_0x9a1b('0x15')]('/:id/tags',auth[_0x9a1b('0x7')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45ac61,_0x80068b,_0x30103a){_0x30103a(null,path[_0x9a1b('0x18')](config['root'],'server/files/tmp'));},'filename':function(_0xd8a230,_0x3ec147,_0x31d4f0){_0x3ec147[_0x9a1b('0x19')]=_0x3ec147[_0x9a1b('0x19')][_0x9a1b('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x31d4f0(null,util['format'](_0x9a1b('0x1b'),path['basename'](_0x3ec147[_0x9a1b('0x19')],path[_0x9a1b('0x1c')](_0x3ec147[_0x9a1b('0x19')])),Date['now'](),path[_0x9a1b('0x1c')](_0x3ec147[_0x9a1b('0x19')])));}})});router[_0x9a1b('0x15')](_0x9a1b('0x1d'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x9a1b('0x1e')]({'destination':function(_0xc7e126,_0x226366,_0x2ae104){_0x2ae104(null,path['join'](config['root'],_0x9a1b('0x1f')));},'filename':function(_0x251460,_0xdf6d7f,_0x25576c){_0xdf6d7f[_0x9a1b('0x19')]=_0xdf6d7f[_0x9a1b('0x19')][_0x9a1b('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25576c(null,util[_0x9a1b('0x20')](_0x9a1b('0x1b'),path[_0x9a1b('0x21')](_0xdf6d7f[_0x9a1b('0x19')],path['extname'](_0xdf6d7f[_0x9a1b('0x19')])),Date['now'](),path['extname'](_0xdf6d7f['originalname'])));}})});router[_0x9a1b('0x15')](_0x9a1b('0x22'),upload[_0x9a1b('0x23')](_0x9a1b('0x24')),controller[_0x9a1b('0x25')]);router[_0x9a1b('0x15')](_0x9a1b('0x26'),auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x27')]);router[_0x9a1b('0x28')]('/:id',auth['isAuthenticated'](),controller[_0x9a1b('0x29')]);router[_0x9a1b('0x2a')](_0x9a1b('0xa'),auth[_0x9a1b('0x7')](),controller[_0x9a1b('0x2b')]);module[_0x9a1b('0x2c')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 0d373a6..df3f13d 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 _0x53ed=['BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','alias','STRING','name','TEXT','getDataValue','select','parse','values','isArray','setDataValue','stringify'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x53ed,0x18a));var _0xd53e=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x53ed[_0x903228];return _0xcec81d;};'use strict';var Sequelize=require(_0xd53e('0x0'));var _=require('lodash');module[_0xd53e('0x1')]={'name':{'type':Sequelize[_0xd53e('0x2')],'get':function(_0x565bb5){return this['getDataValue'](_0xd53e('0x3'));}},'alias':{'type':Sequelize[_0xd53e('0x4')],'allowNull':![],'set':function(_0x90cfe4){this['setDataValue'](_0xd53e('0x3'),_0x90cfe4?_0x90cfe4:this['getDataValue'](_0xd53e('0x5')));}},'type':{'type':Sequelize[_0xd53e('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xd53e('0x6')]('long'),'get':function(){if(this[_0xd53e('0x7')]('type')===_0xd53e('0x8')){return JSON[_0xd53e('0x9')](this['getDataValue'](_0xd53e('0xa')));}else{return this[_0xd53e('0x7')](_0xd53e('0xa'));}},'set':function(_0xdc0930){if(Array[_0xd53e('0xb')](_0xdc0930)){this[_0xd53e('0xc')](_0xd53e('0xa'),JSON[_0xd53e('0xd')](_0xdc0930));}else{this[_0xd53e('0xc')](_0xd53e('0xa'),_0xdc0930);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd53e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd53e('0xf')](_0xd53e('0x10'))}}; \ No newline at end of file +var _0xc146=['parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type'];(function(_0x5b065e,_0x51d0d2){var _0x1afd26=function(_0x33b3ee){while(--_0x33b3ee){_0x5b065e['push'](_0x5b065e['shift']());}};_0x1afd26(++_0x51d0d2);}(_0xc146,0x1c0));var _0x6c14=function(_0x89a94d,_0x6742ed){_0x89a94d=_0x89a94d-0x0;var _0x14d3f9=_0xc146[_0x89a94d];return _0x14d3f9;};'use strict';var Sequelize=require(_0x6c14('0x0'));var _=require(_0x6c14('0x1'));module[_0x6c14('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fa8e2){return this[_0x6c14('0x3')](_0x6c14('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2b6570){this[_0x6c14('0x5')](_0x6c14('0x4'),_0x2b6570?_0x2b6570:this[_0x6c14('0x3')](_0x6c14('0x6')));}},'type':{'type':Sequelize[_0x6c14('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0x6c14('0x8')](_0x6c14('0x9')),'get':function(){if(this[_0x6c14('0x3')](_0x6c14('0xa'))==='select'){return JSON[_0x6c14('0xb')](this[_0x6c14('0x3')](_0x6c14('0xc')));}else{return this[_0x6c14('0x3')](_0x6c14('0xc'));}},'set':function(_0x1cfbf1){if(Array['isArray'](_0x1cfbf1)){this['setDataValue'](_0x6c14('0xc'),JSON[_0x6c14('0xd')](_0x1cfbf1));}else{this[_0x6c14('0x5')](_0x6c14('0xc'),_0x1cfbf1);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6c14('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6c14('0xf')](_0x6c14('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 87b37b0..5ad07ea 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 _0x6887=['length','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','keys','find','body','params','sequelize','transaction','create','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','differenceBy','intersection','model','query','attributes','fields'];(function(_0x5efca1,_0x346487){var _0x1f0b73=function(_0x845797){while(--_0x845797){_0x5efca1['push'](_0x5efca1['shift']());}};_0x1f0b73(++_0x346487);}(_0x6887,0x129));var _0x7688=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0x6887[_0x41930d];return _0x455ade;};'use strict';var emlformat=require(_0x7688('0x0'));var rimraf=require(_0x7688('0x1'));var zipdir=require(_0x7688('0x2'));var jsonpatch=require(_0x7688('0x3'));var rp=require('request-promise');var moment=require(_0x7688('0x4'));var BPromise=require(_0x7688('0x5'));var Mustache=require(_0x7688('0x6'));var util=require(_0x7688('0x7'));var path=require(_0x7688('0x8'));var sox=require(_0x7688('0x9'));var csv=require(_0x7688('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7688('0xb'));var _=require(_0x7688('0xc'));var squel=require(_0x7688('0xd'));var crypto=require(_0x7688('0xe'));var jsforce=require(_0x7688('0xf'));var deskjs=require(_0x7688('0x10'));var toCsv=require(_0x7688('0xa'));var querystring=require(_0x7688('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7688('0x12'));var qs=require(_0x7688('0x13'));var as=require(_0x7688('0x14'));var hardwareService=require(_0x7688('0x15'));var logger=require('../../config/logger')(_0x7688('0x16'));var utils=require(_0x7688('0x17'));var config=require(_0x7688('0x18'));var licenseUtil=require(_0x7688('0x19'));var db=require(_0x7688('0x1a'))['db'];function respondWithStatusCode(_0x1a15d4,_0x30bf63){_0x30bf63=_0x30bf63||0xcc;return function(_0x4c36b0){if(_0x4c36b0){return _0x1a15d4[_0x7688('0x1b')](_0x30bf63);}return _0x1a15d4[_0x7688('0x1c')](_0x30bf63)[_0x7688('0x1d')]();};}function respondWithResult(_0x545af7,_0x27cfb8){_0x27cfb8=_0x27cfb8||0xc8;return function(_0x3999eb){if(_0x3999eb){return _0x545af7[_0x7688('0x1c')](_0x27cfb8)[_0x7688('0x1e')](_0x3999eb);}};}function respondWithFilteredResult(_0x3a907e,_0x20a0bd){return function(_0x4f0b0c){if(_0x4f0b0c){var _0x194195=typeof _0x20a0bd['offset']===_0x7688('0x1f')&&typeof _0x20a0bd[_0x7688('0x20')]===_0x7688('0x1f');var _0x2f07f9=_0x4f0b0c[_0x7688('0x21')];var _0x31041e=_0x194195?0x0:_0x20a0bd['offset'];var _0x49dcc1=_0x194195?_0x4f0b0c['count']:_0x20a0bd[_0x7688('0x22')]+_0x20a0bd[_0x7688('0x20')];var _0x469b64;if(_0x49dcc1>=_0x2f07f9){_0x49dcc1=_0x2f07f9;_0x469b64=0xc8;}else{_0x469b64=0xce;}_0x3a907e[_0x7688('0x1c')](_0x469b64);return _0x3a907e['set']('Content-Range',_0x31041e+'-'+_0x49dcc1+'/'+_0x2f07f9)['json'](_0x4f0b0c);}return null;};}function patchUpdates(_0x5e3e55){return function(_0x25fd1e){try{jsonpatch[_0x7688('0x23')](_0x25fd1e,_0x5e3e55,!![]);}catch(_0x52f274){return BPromise[_0x7688('0x24')](_0x52f274);}return _0x25fd1e[_0x7688('0x25')]();};}function saveUpdates(_0x3d7f40,_0x1d8aee){return function(_0x171f85){if(_0x171f85){return _0x171f85[_0x7688('0x26')](_0x3d7f40)[_0x7688('0x27')](function(_0x56c8cc){return _0x56c8cc;});}return null;};}function removeEntity(_0x44e719,_0x49944d){return function(_0x5354b4){if(_0x5354b4){return _0x5354b4[_0x7688('0x28')]()[_0x7688('0x27')](function(){_0x44e719[_0x7688('0x1c')](0xcc)[_0x7688('0x1d')]();});}};}function handleEntityNotFound(_0x4733ef,_0x552292){return function(_0x1f98ae){if(!_0x1f98ae){_0x4733ef[_0x7688('0x1b')](0x194);}return _0x1f98ae;};}function handleError(_0x1b5829,_0x373561){_0x373561=_0x373561||0x1f4;return function(_0x4c7f3a){logger[_0x7688('0x29')](_0x4c7f3a[_0x7688('0x2a')]);if(_0x4c7f3a[_0x7688('0x2b')]){delete _0x4c7f3a[_0x7688('0x2b')];}_0x1b5829[_0x7688('0x1c')](_0x373561)['send'](_0x4c7f3a);};}exports[_0x7688('0x2c')]=function(_0x3d64f2,_0x1a82a0){var _0x100c4c={},_0x2dfb55={},_0x36fd6d={'count':0x0,'rows':[]};var _0x46d319=_[_0x7688('0x2d')](db[_0x7688('0x2e')][_0x7688('0x2f')],function(_0x5b04a8){return{'name':_0x5b04a8[_0x7688('0x30')],'type':_0x5b04a8['type']['key']};});_0x2dfb55['model']=_[_0x7688('0x31')](_[_0x7688('0x2d')](_0x46d319,'name'),[_0x7688('0x2b')]);_0x2dfb55['query']=_['keys'](_0x3d64f2['query']);_0x2dfb55['filters']=_[_0x7688('0x32')](_0x2dfb55[_0x7688('0x33')],_0x2dfb55[_0x7688('0x34')]);_0x100c4c[_0x7688('0x35')]=_[_0x7688('0x32')](_0x2dfb55[_0x7688('0x33')],qs[_0x7688('0x36')](_0x3d64f2[_0x7688('0x34')][_0x7688('0x36')]));_0x100c4c[_0x7688('0x35')]=_0x100c4c['attributes'][_0x7688('0x37')]?_0x100c4c[_0x7688('0x35')]:_0x2dfb55[_0x7688('0x33')];if(!_0x3d64f2[_0x7688('0x34')]['hasOwnProperty'](_0x7688('0x38'))){_0x100c4c[_0x7688('0x20')]=qs[_0x7688('0x20')](_0x3d64f2[_0x7688('0x34')][_0x7688('0x20')]);_0x100c4c[_0x7688('0x22')]=qs[_0x7688('0x22')](_0x3d64f2['query']['offset']);}_0x100c4c['order']=qs[_0x7688('0x39')](_0x3d64f2[_0x7688('0x34')]['sort']);_0x100c4c[_0x7688('0x3a')]=qs[_0x7688('0x3b')](_[_0x7688('0x3c')](_0x3d64f2[_0x7688('0x34')],_0x2dfb55[_0x7688('0x3b')]),_0x46d319);if(_0x3d64f2[_0x7688('0x34')][_0x7688('0x3d')]){_0x100c4c[_0x7688('0x3a')]=_['merge'](_0x100c4c['where'],{'$or':_[_0x7688('0x2d')](_0x46d319,function(_0x753e9c){if(_0x753e9c[_0x7688('0x3e')]!=='VIRTUAL'){var _0x595e77={};_0x595e77[_0x753e9c[_0x7688('0x2b')]]={'$like':'%'+_0x3d64f2['query'][_0x7688('0x3d')]+'%'};return _0x595e77;}})});}_0x100c4c=_[_0x7688('0x3f')]({},_0x100c4c,_0x3d64f2[_0x7688('0x40')]);var _0x201236={'where':_0x100c4c[_0x7688('0x3a')]};return db[_0x7688('0x2e')][_0x7688('0x21')](_0x201236)[_0x7688('0x27')](function(_0x5541b9){_0x36fd6d[_0x7688('0x21')]=_0x5541b9;if(_0x3d64f2['query'][_0x7688('0x41')]){_0x100c4c[_0x7688('0x42')]=[{'all':!![]}];}return db[_0x7688('0x2e')][_0x7688('0x43')](_0x100c4c);})[_0x7688('0x27')](function(_0x3674d2){_0x36fd6d[_0x7688('0x44')]=_0x3674d2;return _0x36fd6d;})[_0x7688('0x27')](respondWithFilteredResult(_0x1a82a0,_0x100c4c))[_0x7688('0x45')](handleError(_0x1a82a0,null));};exports['show']=function(_0x5ef780,_0x2ebbe7){var _0x3a58d8={'raw':!![],'where':{'id':_0x5ef780['params']['id']}},_0x2c5e9b={};_0x2c5e9b['model']=_[_0x7688('0x46')](db[_0x7688('0x2e')][_0x7688('0x2f')]);_0x2c5e9b[_0x7688('0x34')]=_[_0x7688('0x46')](_0x5ef780[_0x7688('0x34')]);_0x2c5e9b['filters']=_[_0x7688('0x32')](_0x2c5e9b[_0x7688('0x33')],_0x2c5e9b['query']);_0x3a58d8['attributes']=_['intersection'](_0x2c5e9b[_0x7688('0x33')],qs[_0x7688('0x36')](_0x5ef780[_0x7688('0x34')][_0x7688('0x36')]));_0x3a58d8[_0x7688('0x35')]=_0x3a58d8['attributes'][_0x7688('0x37')]?_0x3a58d8['attributes']:_0x2c5e9b['model'];if(_0x5ef780[_0x7688('0x34')][_0x7688('0x41')]){_0x3a58d8['include']=[{'all':!![]}];}_0x3a58d8=_[_0x7688('0x3f')]({},_0x3a58d8,_0x5ef780['options']);return db[_0x7688('0x2e')][_0x7688('0x47')](_0x3a58d8)[_0x7688('0x27')](handleEntityNotFound(_0x2ebbe7,null))[_0x7688('0x27')](respondWithResult(_0x2ebbe7,null))['catch'](handleError(_0x2ebbe7,null));};exports['update']=function(_0x11745b,_0x38d44f){if(_0x11745b[_0x7688('0x48')]['id']){delete _0x11745b[_0x7688('0x48')]['id'];}return db[_0x7688('0x2e')]['find']({'where':{'id':_0x11745b['params']['id']}})[_0x7688('0x27')](handleEntityNotFound(_0x38d44f,null))[_0x7688('0x27')](saveUpdates(_0x11745b[_0x7688('0x48')],null))[_0x7688('0x27')](respondWithResult(_0x38d44f,null))[_0x7688('0x45')](handleError(_0x38d44f,null));};exports[_0x7688('0x28')]=function(_0x27db5c,_0x70f0d2){return db[_0x7688('0x2e')][_0x7688('0x47')]({'where':{'id':_0x27db5c[_0x7688('0x49')]['id']}})['then'](handleEntityNotFound(_0x70f0d2,null))[_0x7688('0x27')](removeEntity(_0x70f0d2,null))[_0x7688('0x45')](handleError(_0x70f0d2,null));};exports['create']=function(_0x3ed7d0,_0x15407a){var _0x5547dc;return db[_0x7688('0x4a')][_0x7688('0x4b')](function(_0x28a6c4){return db['CmCustomField'][_0x7688('0x4c')](_0x3ed7d0['body'],{'transaction':_0x28a6c4})[_0x7688('0x27')](function(_0xde27cd){_0x5547dc=_0xde27cd;var _0x943bcf={'type':db[_0x7688('0x4d')]['TEXT'],'transaction':_0x28a6c4};switch(_0x3ed7d0[_0x7688('0x48')]['type']){case _0x7688('0x4e'):_0x943bcf['type']=db[_0x7688('0x4d')][_0x7688('0x4f')];break;case _0x7688('0x50'):_0x943bcf[_0x7688('0x3e')]=db[_0x7688('0x4d')]['INTEGER'];break;case _0x7688('0x51'):_0x943bcf['type']=db[_0x7688('0x4d')][_0x7688('0x52')];_0x943bcf[_0x7688('0x53')]=![];break;default:}return db[_0x7688('0x4a')][_0x7688('0x54')][_0x7688('0x55')](_0x7688('0x56'),util['format'](_0x7688('0x57'),_0x5547dc['id']),_0x943bcf);})[_0x7688('0x27')](function(){return _0x5547dc;});})[_0x7688('0x27')](respondWithResult(_0x15407a,0xc9))['catch'](handleError(_0x15407a,null));}; \ No newline at end of file +var _0xe60b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','CmCustomField','includeAll','include','rows','show','params','rawAttributes','catch','update','body','find','create','sequelize','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x30122d,_0x4ff436){var _0x4b88bc=function(_0x3020d6){while(--_0x3020d6){_0x30122d['push'](_0x30122d['shift']());}};_0x4b88bc(++_0x4ff436);}(_0xe60b,0xf1));var _0xbe60=function(_0x4ebba4,_0x1ffdfd){_0x4ebba4=_0x4ebba4-0x0;var _0x29a6d3=_0xe60b[_0x4ebba4];return _0x29a6d3;};'use strict';var emlformat=require(_0xbe60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe60('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe60('0x2'));var moment=require('moment');var BPromise=require(_0xbe60('0x3'));var Mustache=require('mustache');var util=require(_0xbe60('0x4'));var path=require(_0xbe60('0x5'));var sox=require(_0xbe60('0x6'));var csv=require(_0xbe60('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe60('0x8'));var _=require(_0xbe60('0x9'));var squel=require(_0xbe60('0xa'));var crypto=require(_0xbe60('0xb'));var jsforce=require(_0xbe60('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe60('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe60('0xe'));var qs=require(_0xbe60('0xf'));var as=require(_0xbe60('0x10'));var hardwareService=require(_0xbe60('0x11'));var logger=require(_0xbe60('0x12'))(_0xbe60('0x13'));var utils=require(_0xbe60('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbe60('0x15'));var db=require(_0xbe60('0x16'))['db'];function respondWithStatusCode(_0x1a28e8,_0x4b92a1){_0x4b92a1=_0x4b92a1||0xcc;return function(_0x53e915){if(_0x53e915){return _0x1a28e8[_0xbe60('0x17')](_0x4b92a1);}return _0x1a28e8['status'](_0x4b92a1)[_0xbe60('0x18')]();};}function respondWithResult(_0x262cb3,_0x3efc47){_0x3efc47=_0x3efc47||0xc8;return function(_0x2c58bb){if(_0x2c58bb){return _0x262cb3['status'](_0x3efc47)[_0xbe60('0x19')](_0x2c58bb);}};}function respondWithFilteredResult(_0x49f242,_0x53a68c){return function(_0x5266f3){if(_0x5266f3){var _0x180345=typeof _0x53a68c[_0xbe60('0x1a')]===_0xbe60('0x1b')&&typeof _0x53a68c[_0xbe60('0x1c')]==='undefined';var _0x392714=_0x5266f3[_0xbe60('0x1d')];var _0x3cd5c6=_0x180345?0x0:_0x53a68c[_0xbe60('0x1a')];var _0x32f857=_0x180345?_0x5266f3[_0xbe60('0x1d')]:_0x53a68c[_0xbe60('0x1a')]+_0x53a68c['limit'];var _0x86c91d;if(_0x32f857>=_0x392714){_0x32f857=_0x392714;_0x86c91d=0xc8;}else{_0x86c91d=0xce;}_0x49f242[_0xbe60('0x1e')](_0x86c91d);return _0x49f242['set'](_0xbe60('0x1f'),_0x3cd5c6+'-'+_0x32f857+'/'+_0x392714)[_0xbe60('0x19')](_0x5266f3);}return null;};}function patchUpdates(_0x9c067){return function(_0x5e8de8){try{jsonpatch[_0xbe60('0x20')](_0x5e8de8,_0x9c067,!![]);}catch(_0x1716c9){return BPromise[_0xbe60('0x21')](_0x1716c9);}return _0x5e8de8[_0xbe60('0x22')]();};}function saveUpdates(_0x34cd45,_0x30dc5b){return function(_0xb8d8b0){if(_0xb8d8b0){return _0xb8d8b0['update'](_0x34cd45)[_0xbe60('0x23')](function(_0x545a0a){return _0x545a0a;});}return null;};}function removeEntity(_0x3ff587,_0x282b61){return function(_0x1696f8){if(_0x1696f8){return _0x1696f8[_0xbe60('0x24')]()[_0xbe60('0x23')](function(){_0x3ff587[_0xbe60('0x1e')](0xcc)[_0xbe60('0x18')]();});}};}function handleEntityNotFound(_0x6ea599,_0x4d4e66){return function(_0x1f5507){if(!_0x1f5507){_0x6ea599[_0xbe60('0x17')](0x194);}return _0x1f5507;};}function handleError(_0x5245b7,_0x29b4e2){_0x29b4e2=_0x29b4e2||0x1f4;return function(_0x4b6aa0){logger[_0xbe60('0x25')](_0x4b6aa0[_0xbe60('0x26')]);if(_0x4b6aa0[_0xbe60('0x27')]){delete _0x4b6aa0[_0xbe60('0x27')];}_0x5245b7[_0xbe60('0x1e')](_0x29b4e2)['send'](_0x4b6aa0);};}exports[_0xbe60('0x28')]=function(_0x4bb3a3,_0x364057){var _0x13a98c={},_0x251151={},_0x2f868e={'count':0x0,'rows':[]};var _0x3cab1f=_['map'](db['CmCustomField']['rawAttributes'],function(_0x3d7ea3){return{'name':_0x3d7ea3[_0xbe60('0x29')],'type':_0x3d7ea3[_0xbe60('0x2a')][_0xbe60('0x2b')]};});_0x251151[_0xbe60('0x2c')]=_['differenceBy'](_['map'](_0x3cab1f,_0xbe60('0x27')),[_0xbe60('0x27')]);_0x251151[_0xbe60('0x2d')]=_[_0xbe60('0x2e')](_0x4bb3a3[_0xbe60('0x2d')]);_0x251151[_0xbe60('0x2f')]=_[_0xbe60('0x30')](_0x251151['model'],_0x251151['query']);_0x13a98c[_0xbe60('0x31')]=_['intersection'](_0x251151[_0xbe60('0x2c')],qs[_0xbe60('0x32')](_0x4bb3a3[_0xbe60('0x2d')]['fields']));_0x13a98c['attributes']=_0x13a98c[_0xbe60('0x31')][_0xbe60('0x33')]?_0x13a98c[_0xbe60('0x31')]:_0x251151[_0xbe60('0x2c')];if(!_0x4bb3a3[_0xbe60('0x2d')][_0xbe60('0x34')]('nolimit')){_0x13a98c[_0xbe60('0x1c')]=qs[_0xbe60('0x1c')](_0x4bb3a3[_0xbe60('0x2d')][_0xbe60('0x1c')]);_0x13a98c[_0xbe60('0x1a')]=qs['offset'](_0x4bb3a3['query'][_0xbe60('0x1a')]);}_0x13a98c['order']=qs[_0xbe60('0x35')](_0x4bb3a3['query'][_0xbe60('0x35')]);_0x13a98c[_0xbe60('0x36')]=qs[_0xbe60('0x2f')](_[_0xbe60('0x37')](_0x4bb3a3[_0xbe60('0x2d')],_0x251151[_0xbe60('0x2f')]),_0x3cab1f);if(_0x4bb3a3['query'][_0xbe60('0x38')]){_0x13a98c[_0xbe60('0x36')]=_[_0xbe60('0x39')](_0x13a98c[_0xbe60('0x36')],{'$or':_[_0xbe60('0x3a')](_0x3cab1f,function(_0x1cc280){if(_0x1cc280['type']!==_0xbe60('0x3b')){var _0x9626b7={};_0x9626b7[_0x1cc280['name']]={'$like':'%'+_0x4bb3a3['query'][_0xbe60('0x38')]+'%'};return _0x9626b7;}})});}_0x13a98c=_[_0xbe60('0x39')]({},_0x13a98c,_0x4bb3a3[_0xbe60('0x3c')]);var _0x333f30={'where':_0x13a98c[_0xbe60('0x36')]};return db[_0xbe60('0x3d')][_0xbe60('0x1d')](_0x333f30)['then'](function(_0x28779b){_0x2f868e[_0xbe60('0x1d')]=_0x28779b;if(_0x4bb3a3[_0xbe60('0x2d')][_0xbe60('0x3e')]){_0x13a98c[_0xbe60('0x3f')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x13a98c);})[_0xbe60('0x23')](function(_0x31d325){_0x2f868e[_0xbe60('0x40')]=_0x31d325;return _0x2f868e;})['then'](respondWithFilteredResult(_0x364057,_0x13a98c))['catch'](handleError(_0x364057,null));};exports[_0xbe60('0x41')]=function(_0x24c50d,_0xf24faa){var _0xef6723={'raw':!![],'where':{'id':_0x24c50d[_0xbe60('0x42')]['id']}},_0x1877d3={};_0x1877d3[_0xbe60('0x2c')]=_[_0xbe60('0x2e')](db[_0xbe60('0x3d')][_0xbe60('0x43')]);_0x1877d3[_0xbe60('0x2d')]=_[_0xbe60('0x2e')](_0x24c50d[_0xbe60('0x2d')]);_0x1877d3[_0xbe60('0x2f')]=_[_0xbe60('0x30')](_0x1877d3['model'],_0x1877d3[_0xbe60('0x2d')]);_0xef6723[_0xbe60('0x31')]=_[_0xbe60('0x30')](_0x1877d3[_0xbe60('0x2c')],qs[_0xbe60('0x32')](_0x24c50d[_0xbe60('0x2d')]['fields']));_0xef6723[_0xbe60('0x31')]=_0xef6723['attributes'][_0xbe60('0x33')]?_0xef6723[_0xbe60('0x31')]:_0x1877d3[_0xbe60('0x2c')];if(_0x24c50d[_0xbe60('0x2d')][_0xbe60('0x3e')]){_0xef6723[_0xbe60('0x3f')]=[{'all':!![]}];}_0xef6723=_[_0xbe60('0x39')]({},_0xef6723,_0x24c50d['options']);return db[_0xbe60('0x3d')]['find'](_0xef6723)['then'](handleEntityNotFound(_0xf24faa,null))[_0xbe60('0x23')](respondWithResult(_0xf24faa,null))[_0xbe60('0x44')](handleError(_0xf24faa,null));};exports[_0xbe60('0x45')]=function(_0x41a113,_0x5ee570){if(_0x41a113[_0xbe60('0x46')]['id']){delete _0x41a113[_0xbe60('0x46')]['id'];}return db['CmCustomField'][_0xbe60('0x47')]({'where':{'id':_0x41a113[_0xbe60('0x42')]['id']}})[_0xbe60('0x23')](handleEntityNotFound(_0x5ee570,null))[_0xbe60('0x23')](saveUpdates(_0x41a113['body'],null))[_0xbe60('0x23')](respondWithResult(_0x5ee570,null))[_0xbe60('0x44')](handleError(_0x5ee570,null));};exports[_0xbe60('0x24')]=function(_0x48d892,_0x5bdfb4){return db['CmCustomField'][_0xbe60('0x47')]({'where':{'id':_0x48d892[_0xbe60('0x42')]['id']}})[_0xbe60('0x23')](handleEntityNotFound(_0x5bdfb4,null))['then'](removeEntity(_0x5bdfb4,null))[_0xbe60('0x44')](handleError(_0x5bdfb4,null));};exports[_0xbe60('0x48')]=function(_0x357c7f,_0x3f8969){var _0x5a66c6;return db[_0xbe60('0x49')]['transaction'](function(_0x484dd9){return db['CmCustomField']['create'](_0x357c7f[_0xbe60('0x46')],{'transaction':_0x484dd9})['then'](function(_0x387682){_0x5a66c6=_0x387682;var _0x19a170={'type':db[_0xbe60('0x4a')]['TEXT'],'transaction':_0x484dd9};switch(_0x357c7f[_0xbe60('0x46')][_0xbe60('0x2a')]){case _0xbe60('0x4b'):_0x19a170[_0xbe60('0x2a')]=db[_0xbe60('0x4a')][_0xbe60('0x4c')];break;case _0xbe60('0x4d'):_0x19a170['type']=db[_0xbe60('0x4a')][_0xbe60('0x4e')];break;case _0xbe60('0x4f'):_0x19a170[_0xbe60('0x2a')]=db['Sequelize'][_0xbe60('0x50')];_0x19a170['defaultValue']=![];break;default:}return db[_0xbe60('0x49')][_0xbe60('0x51')][_0xbe60('0x52')](_0xbe60('0x53'),util[_0xbe60('0x54')](_0xbe60('0x55'),_0x5a66c6['id']),_0x19a170);})['then'](function(){return _0x5a66c6;});})['then'](respondWithResult(_0x3f8969,0xc9))[_0xbe60('0x44')](handleError(_0x3f8969,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 52a540a..827a38d 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 _0x8834=['api','moment','bluebird','request-promise','../../config/environment','define','cm_custom_fields','lodash','../../config/logger'];(function(_0x1f92b0,_0x5b44c5){var _0x298486=function(_0x176095){while(--_0x176095){_0x1f92b0['push'](_0x1f92b0['shift']());}};_0x298486(++_0x5b44c5);}(_0x8834,0x139));var _0x4883=function(_0x572216,_0x273b32){_0x572216=_0x572216-0x0;var _0x593c7e=_0x8834[_0x572216];return _0x593c7e;};'use strict';var _=require(_0x4883('0x0'));var util=require('util');var logger=require(_0x4883('0x1'))(_0x4883('0x2'));var moment=require(_0x4883('0x3'));var BPromise=require(_0x4883('0x4'));var rp=require(_0x4883('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4883('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x2c28c1,_0x2bfd4e){return _0x2c28c1[_0x4883('0x7')]('CmCustomField',attributes,{'tableName':_0x4883('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7611=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0xd7b7c4,_0x3bde33){var _0x3701d4=function(_0x37f7de){while(--_0x37f7de){_0xd7b7c4['push'](_0xd7b7c4['shift']());}};_0x3701d4(++_0x3bde33);}(_0x7611,0x19b));var _0x1761=function(_0x1551a8,_0x3f9847){_0x1551a8=_0x1551a8-0x0;var _0x4f2969=_0x7611[_0x1551a8];return _0x4f2969;};'use strict';var _=require(_0x1761('0x0'));var util=require(_0x1761('0x1'));var logger=require(_0x1761('0x2'))(_0x1761('0x3'));var moment=require(_0x1761('0x4'));var BPromise=require(_0x1761('0x5'));var rp=require(_0x1761('0x6'));var fs=require('fs');var path=require(_0x1761('0x7'));var rimraf=require(_0x1761('0x8'));var config=require(_0x1761('0x9'));var attributes=require(_0x1761('0xa'));module[_0x1761('0xb')]=function(_0xc064bd,_0x173f71){return _0xc064bd[_0x1761('0xc')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','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 5052a28..3a9c679 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 _0x86da=['error','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x105f36,_0x5d2705){var _0x51e68f=function(_0x10da8e){while(--_0x10da8e){_0x105f36['push'](_0x105f36['shift']());}};_0x51e68f(++_0x5d2705);}(_0x86da,0xfb));var _0xa86d=function(_0x4fe328,_0x5e456d){_0x4fe328=_0x4fe328-0x0;var _0x11a53b=_0x86da[_0x4fe328];return _0x11a53b;};'use strict';var _=require(_0xa86d('0x0'));var util=require(_0xa86d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa86d('0x2'));var fs=require('fs');var Redis=require(_0xa86d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa86d('0x4'));var logger=require(_0xa86d('0x5'))(_0xa86d('0x6'));var config=require(_0xa86d('0x7'));var jayson=require(_0xa86d('0x8'));var client=jayson[_0xa86d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f64b,_0x453327,_0x2ab1c9){return new BPromise(function(_0x46a3b5,_0x240a58){return client['request'](_0x17f64b,_0x2ab1c9)[_0xa86d('0xa')](function(_0xe1d9d1){logger[_0xa86d('0xb')]('CmCustomField,\x20%s,\x20%s',_0x453327,'request\x20sent');logger[_0xa86d('0xc')](_0xa86d('0xd'),_0x453327,_0xa86d('0xe'),JSON['stringify'](_0xe1d9d1));if(_0xe1d9d1[_0xa86d('0xf')]){if(_0xe1d9d1['error']['code']===0x1f4){logger['error'](_0xa86d('0x10'),_0x453327,_0xe1d9d1['error'][_0xa86d('0x11')]);return _0x240a58(_0xe1d9d1[_0xa86d('0xf')]['message']);}logger['error'](_0xa86d('0x10'),_0x453327,_0xe1d9d1[_0xa86d('0xf')]['message']);return _0x46a3b5(_0xe1d9d1[_0xa86d('0xf')]['message']);}else{logger['info'](_0xa86d('0x10'),_0x453327,_0xa86d('0xe'));_0x46a3b5(_0xe1d9d1['result'][_0xa86d('0x11')]);}})[_0xa86d('0x12')](function(_0x1687d6){logger[_0xa86d('0xf')](_0xa86d('0x10'),_0x453327,_0x1687d6);_0x240a58(_0x1687d6);});});} \ No newline at end of file +var _0xd991=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xd991,0x104));var _0x1d99=function(_0x49ee83,_0x3ff5ce){_0x49ee83=_0x49ee83-0x0;var _0xef654a=_0xd991[_0x49ee83];return _0xef654a;};'use strict';var _=require(_0x1d99('0x0'));var util=require('util');var moment=require(_0x1d99('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d99('0x2'));var fs=require('fs');var Redis=require(_0x1d99('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d99('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d99('0x5'));var jayson=require(_0x1d99('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55ccbc,_0x2a3851,_0x14950b){return new BPromise(function(_0x3f1be1,_0xc43337){return client[_0x1d99('0x7')](_0x55ccbc,_0x14950b)['then'](function(_0x594bc4){logger[_0x1d99('0x8')]('CmCustomField,\x20%s,\x20%s',_0x2a3851,_0x1d99('0x9'));logger['debug'](_0x1d99('0xa'),_0x2a3851,'request\x20sent',JSON[_0x1d99('0xb')](_0x594bc4));if(_0x594bc4[_0x1d99('0xc')]){if(_0x594bc4[_0x1d99('0xc')]['code']===0x1f4){logger['error'](_0x1d99('0xd'),_0x2a3851,_0x594bc4[_0x1d99('0xc')][_0x1d99('0xe')]);return _0xc43337(_0x594bc4[_0x1d99('0xc')]['message']);}logger['error'](_0x1d99('0xd'),_0x2a3851,_0x594bc4[_0x1d99('0xc')][_0x1d99('0xe')]);return _0x3f1be1(_0x594bc4[_0x1d99('0xc')][_0x1d99('0xe')]);}else{logger[_0x1d99('0x8')]('CmCustomField,\x20%s,\x20%s',_0x2a3851,_0x1d99('0x9'));_0x3f1be1(_0x594bc4[_0x1d99('0xf')][_0x1d99('0xe')]);}})[_0x1d99('0x10')](function(_0x1d3307){logger[_0x1d99('0xc')](_0x1d99('0xd'),_0x2a3851,_0x1d3307);_0xc43337(_0x1d3307);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d61867e..0afd9a2 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 _0xfcda=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x53ff8d,_0x53b3f8){var _0x36ae29=function(_0x31e1f6){while(--_0x31e1f6){_0x53ff8d['push'](_0x53ff8d['shift']());}};_0x36ae29(++_0x53b3f8);}(_0xfcda,0x198));var _0xafcd=function(_0x371186,_0xaea471){_0x371186=_0x371186-0x0;var _0x7d5c44=_0xfcda[_0x371186];return _0x7d5c44;};'use strict';var multer=require(_0xafcd('0x0'));var util=require(_0xafcd('0x1'));var path=require('path');var timeout=require(_0xafcd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xafcd('0x3'));var interaction=require(_0xafcd('0x4'));var config=require(_0xafcd('0x5'));var controller=require(_0xafcd('0x6'));router[_0xafcd('0x7')]('/',auth[_0xafcd('0x8')](),controller[_0xafcd('0x9')]);router['get'](_0xafcd('0xa'),auth['isAuthenticated'](),controller[_0xafcd('0xb')]);router[_0xafcd('0xc')]('/',auth[_0xafcd('0x8')](),controller[_0xafcd('0xd')]);router[_0xafcd('0xe')](_0xafcd('0xa'),auth['isAuthenticated'](),controller[_0xafcd('0xf')]);router[_0xafcd('0x10')](_0xafcd('0xa'),auth[_0xafcd('0x8')](),controller[_0xafcd('0x11')]);module[_0xafcd('0x12')]=router; \ No newline at end of file +var _0x2f3d=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x29a435,_0x21acb0){var _0x2fdc1f=function(_0x5aedaa){while(--_0x5aedaa){_0x29a435['push'](_0x29a435['shift']());}};_0x2fdc1f(++_0x21acb0);}(_0x2f3d,0x1a8));var _0xd2f3=function(_0x60ff54,_0x4ed385){_0x60ff54=_0x60ff54-0x0;var _0x4e8e28=_0x2f3d[_0x60ff54];return _0x4e8e28;};'use strict';var multer=require('multer');var util=require(_0xd2f3('0x0'));var path=require(_0xd2f3('0x1'));var timeout=require(_0xd2f3('0x2'));var express=require(_0xd2f3('0x3'));var router=express[_0xd2f3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2f3('0x5'));var config=require(_0xd2f3('0x6'));var controller=require(_0xd2f3('0x7'));router['get']('/',auth[_0xd2f3('0x8')](),controller[_0xd2f3('0x9')]);router[_0xd2f3('0xa')](_0xd2f3('0xb'),auth[_0xd2f3('0x8')](),controller[_0xd2f3('0xc')]);router[_0xd2f3('0xd')]('/',auth['isAuthenticated'](),controller[_0xd2f3('0xe')]);router[_0xd2f3('0xf')]('/:id',auth[_0xd2f3('0x8')](),controller[_0xd2f3('0x10')]);router[_0xd2f3('0x11')](_0xd2f3('0xb'),auth[_0xd2f3('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 13eec54..6bd4ab7 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 _0x01d9=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x1f1678,_0x45d3a6){var _0x1d4edb=function(_0x17a469){while(--_0x17a469){_0x1f1678['push'](_0x1f1678['shift']());}};_0x1d4edb(++_0x45d3a6);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x901d('0x0'));var Sequelize=require(_0x901d('0x1'));module[_0x901d('0x2')]={'phone':{'type':Sequelize[_0x901d('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x901d('0x4')],'defaultValue':moment()[_0x901d('0x5')](_0x901d('0x6'))},'countbusyretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x901d('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x901d('0x4')]},'priority':{'type':Sequelize[_0x901d('0x7')](0x2)[_0x901d('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x901d('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x901d('0x7')],'unique':_0x901d('0xa')},'ListId':{'type':Sequelize[_0x901d('0x7')],'unique':_0x901d('0xa')},'UserId':{'type':Sequelize[_0x901d('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x901d('0x7')],'unique':_0x901d('0xa')},'CampaignId':{'type':Sequelize[_0x901d('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x901d('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x901d('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x901d('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x33af=['UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x4538db,_0x2b3b95){var _0x5c069c=function(_0x284f82){while(--_0x284f82){_0x4538db['push'](_0x4538db['shift']());}};_0x5c069c(++_0x2b3b95);}(_0x33af,0xec));var _0xf33a=function(_0x37a45b,_0x1056ef){_0x37a45b=_0x37a45b-0x0;var _0x35f3bb=_0x33af[_0x37a45b];return _0x35f3bb;};'use strict';var moment=require('moment');var Sequelize=require(_0xf33a('0x0'));module['exports']={'phone':{'type':Sequelize[_0xf33a('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xf33a('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf33a('0x3')],'defaultValue':moment()[_0xf33a('0x4')](_0xf33a('0x5'))},'countbusyretry':{'type':Sequelize[_0xf33a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf33a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf33a('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf33a('0x3')]},'priority':{'type':Sequelize[_0xf33a('0x6')](0x2)[_0xf33a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf33a('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf33a('0x6')],'unique':_0xf33a('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf33a('0x8')},'UserId':{'type':Sequelize[_0xf33a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xf33a('0x6')],'unique':_0xf33a('0x8')},'CampaignId':{'type':Sequelize[_0xf33a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xf33a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf33a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf33a('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xf33a('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0xf33a('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 890905d..fc54210 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 _0xe559=['ContactId','firstName','lastName','isNil','calleridname','finally','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','Company','CmList','getPreviewRecall','hopperId','UPDATE','CmCompany','List','VoiceQueue','Queue','dialActive','getOpenContacts','getTimezones','timezones','push','getTimezone','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$contained','$any','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','CmHopper','rows','show','params','rawAttributes','fields','length','find','catch','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue'];(function(_0x4bf0dc,_0x33498f){var _0x4a2af4=function(_0x59d7ef){while(--_0x59d7ef){_0x4bf0dc['push'](_0x4bf0dc['shift']());}};_0x4a2af4(++_0x33498f);}(_0xe559,0xc1));var _0x9e55=function(_0x132062,_0x5d1de4){_0x132062=_0x132062-0x0;var _0x59d72d=_0xe559[_0x132062];return _0x59d72d;};'use strict';var emlformat=require(_0x9e55('0x0'));var rimraf=require(_0x9e55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e55('0x2'));var rp=require(_0x9e55('0x3'));var moment=require(_0x9e55('0x4'));var BPromise=require(_0x9e55('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9e55('0x6'));var csv=require(_0x9e55('0x7'));var ejs=require(_0x9e55('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9e55('0x9'));var crypto=require('crypto');var jsforce=require(_0x9e55('0xa'));var deskjs=require(_0x9e55('0xb'));var toCsv=require(_0x9e55('0x7'));var querystring=require(_0x9e55('0xc'));var Papa=require(_0x9e55('0xd'));var Redis=require(_0x9e55('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9e55('0xf'));var as=require(_0x9e55('0x10'));var hardwareService=require(_0x9e55('0x11'));var logger=require(_0x9e55('0x12'))('api');var utils=require(_0x9e55('0x13'));var config=require(_0x9e55('0x14'));var shared=require(_0x9e55('0x14'));var licenseUtil=require(_0x9e55('0x15'));var db=require(_0x9e55('0x16'))['db'];function respondWithStatusCode(_0x3d3a3a,_0x31f22e){_0x31f22e=_0x31f22e||0xcc;return function(_0x26a40d){if(_0x26a40d){return _0x3d3a3a[_0x9e55('0x17')](_0x31f22e);}return _0x3d3a3a[_0x9e55('0x18')](_0x31f22e)[_0x9e55('0x19')]();};}function respondWithResult(_0x1a797f,_0x4ebdca){_0x4ebdca=_0x4ebdca||0xc8;return function(_0x19c7c1){if(_0x19c7c1){return _0x1a797f['status'](_0x4ebdca)[_0x9e55('0x1a')](_0x19c7c1);}};}function respondWithFilteredResult(_0x53ec3b,_0x18a2ac){return function(_0x17d448){if(_0x17d448){var _0x80d97=typeof _0x18a2ac[_0x9e55('0x1b')]==='undefined'&&typeof _0x18a2ac[_0x9e55('0x1c')]===_0x9e55('0x1d');var _0x5cbd26=_0x17d448[_0x9e55('0x1e')];var _0x1a1233=_0x80d97?0x0:_0x18a2ac[_0x9e55('0x1b')];var _0x2599d8=_0x80d97?_0x17d448[_0x9e55('0x1e')]:_0x18a2ac[_0x9e55('0x1b')]+_0x18a2ac[_0x9e55('0x1c')];var _0x2dde25;if(_0x2599d8>=_0x5cbd26){_0x2599d8=_0x5cbd26;_0x2dde25=0xc8;}else{_0x2dde25=0xce;}_0x53ec3b[_0x9e55('0x18')](_0x2dde25);return _0x53ec3b[_0x9e55('0x1f')](_0x9e55('0x20'),_0x1a1233+'-'+_0x2599d8+'/'+_0x5cbd26)[_0x9e55('0x1a')](_0x17d448);}return null;};}function patchUpdates(_0x12da93){return function(_0x4301eb){try{jsonpatch[_0x9e55('0x21')](_0x4301eb,_0x12da93,!![]);}catch(_0xbf92f3){return BPromise['reject'](_0xbf92f3);}return _0x4301eb[_0x9e55('0x22')]();};}function saveUpdates(_0x4887bb,_0x5bc77d){return function(_0x253e20){if(_0x253e20){return _0x253e20[_0x9e55('0x23')](_0x4887bb)[_0x9e55('0x24')](function(_0x3ecb41){return _0x3ecb41;});}return null;};}function removeEntity(_0x2f00ef,_0x257a1a){return function(_0x327732){if(_0x327732){return _0x327732[_0x9e55('0x25')]()[_0x9e55('0x24')](function(){_0x2f00ef[_0x9e55('0x18')](0xcc)[_0x9e55('0x19')]();});}};}function handleEntityNotFound(_0x5def47,_0x4b0a19){return function(_0x25e121){if(!_0x25e121){_0x5def47[_0x9e55('0x17')](0x194);}return _0x25e121;};}function handleError(_0x4fa243,_0x3a16f7){_0x3a16f7=_0x3a16f7||0x1f4;return function(_0x26350d){logger['error'](_0x26350d[_0x9e55('0x26')]);if(_0x26350d[_0x9e55('0x27')]){delete _0x26350d[_0x9e55('0x27')];}_0x4fa243['status'](_0x3a16f7)['send'](_0x26350d);};}exports['index']=function(_0x267e20,_0x490602){var _0x41eb41={},_0x2f91f3={},_0x451572={'count':0x0,'rows':[]};var _0x11989d=_[_0x9e55('0x28')](db['CmHopper']['rawAttributes'],function(_0x49cb4f){return{'name':_0x49cb4f[_0x9e55('0x29')],'type':_0x49cb4f[_0x9e55('0x2a')][_0x9e55('0x2b')]};});_0x2f91f3[_0x9e55('0x2c')]=_[_0x9e55('0x28')](_0x11989d,_0x9e55('0x27'));_0x2f91f3[_0x9e55('0x2d')]=_[_0x9e55('0x2e')](_0x267e20['query']);_0x2f91f3[_0x9e55('0x2f')]=_[_0x9e55('0x30')](_0x2f91f3[_0x9e55('0x2c')],_0x2f91f3[_0x9e55('0x2d')]);_0x2f91f3['filters']=_[_0x9e55('0x31')](_0x2f91f3[_0x9e55('0x2f')],[_0x9e55('0x32'),_0x9e55('0x33'),_0x9e55('0x34'),_0x9e55('0x35'),'$lt',_0x9e55('0x36'),_0x9e55('0x37'),_0x9e55('0x38'),'$not',_0x9e55('0x39'),_0x9e55('0x3a'),_0x9e55('0x3b'),'$notIn','$like',_0x9e55('0x3c'),_0x9e55('0x3d'),_0x9e55('0x3e'),_0x9e55('0x3f'),'$overlap','$contains',_0x9e55('0x40'),_0x9e55('0x41')]);_0x41eb41[_0x9e55('0x42')]=_[_0x9e55('0x30')](_0x2f91f3[_0x9e55('0x2c')],qs['fields'](_0x267e20[_0x9e55('0x2d')]['fields']));_0x41eb41[_0x9e55('0x42')]=_0x41eb41[_0x9e55('0x42')]['length']?_0x41eb41['attributes']:_0x2f91f3['model'];if(!_0x267e20['query'][_0x9e55('0x43')]('nolimit')){_0x41eb41[_0x9e55('0x1c')]=qs[_0x9e55('0x1c')](_0x267e20[_0x9e55('0x2d')][_0x9e55('0x1c')]);_0x41eb41[_0x9e55('0x1b')]=qs[_0x9e55('0x1b')](_0x267e20[_0x9e55('0x2d')][_0x9e55('0x1b')]);}_0x41eb41[_0x9e55('0x44')]=qs[_0x9e55('0x45')](_0x267e20[_0x9e55('0x2d')]['sort']);_0x41eb41[_0x9e55('0x46')]=qs[_0x9e55('0x2f')](_[_0x9e55('0x47')](_0x267e20[_0x9e55('0x2d')],_0x2f91f3[_0x9e55('0x2f')]),_0x11989d);if(_0x267e20[_0x9e55('0x2d')][_0x9e55('0x48')]){_0x41eb41['where']=_[_0x9e55('0x49')](_0x41eb41['where'],{'$or':_[_0x9e55('0x28')](_0x11989d,function(_0x4cfbb3){if(_0x4cfbb3[_0x9e55('0x2a')]!=='VIRTUAL'){var _0x551151={};_0x551151[_0x4cfbb3[_0x9e55('0x27')]]={'$like':'%'+_0x267e20[_0x9e55('0x2d')][_0x9e55('0x48')]+'%'};return _0x551151;}})});}_0x41eb41=_[_0x9e55('0x49')]({},_0x41eb41,_0x267e20[_0x9e55('0x4a')]);var _0x1bb93d={'where':_0x41eb41['where']};return db['CmHopper'][_0x9e55('0x1e')](_0x1bb93d)[_0x9e55('0x24')](function(_0x5c0ecf){_0x451572[_0x9e55('0x1e')]=_0x5c0ecf;if(_0x267e20[_0x9e55('0x2d')][_0x9e55('0x4b')]){_0x41eb41[_0x9e55('0x4c')]=[{'all':!![]}];}return db[_0x9e55('0x4d')]['findAll'](_0x41eb41);})[_0x9e55('0x24')](function(_0x554442){_0x451572[_0x9e55('0x4e')]=_0x554442;return _0x451572;})['then'](respondWithFilteredResult(_0x490602,_0x41eb41))['catch'](handleError(_0x490602,null));};exports[_0x9e55('0x4f')]=function(_0x321862,_0x2cc8ab){var _0x41f63d={'raw':!![],'where':{'id':_0x321862[_0x9e55('0x50')]['id']}},_0x15df03={};_0x15df03[_0x9e55('0x2c')]=_[_0x9e55('0x2e')](db['CmHopper'][_0x9e55('0x51')]);_0x15df03[_0x9e55('0x2d')]=_[_0x9e55('0x2e')](_0x321862[_0x9e55('0x2d')]);_0x15df03['filters']=_['intersection'](_0x15df03[_0x9e55('0x2c')],_0x15df03['query']);_0x41f63d[_0x9e55('0x42')]=_[_0x9e55('0x30')](_0x15df03['model'],qs[_0x9e55('0x52')](_0x321862[_0x9e55('0x2d')]['fields']));_0x41f63d[_0x9e55('0x42')]=_0x41f63d['attributes'][_0x9e55('0x53')]?_0x41f63d[_0x9e55('0x42')]:_0x15df03[_0x9e55('0x2c')];if(_0x321862[_0x9e55('0x2d')][_0x9e55('0x4b')]){_0x41f63d['include']=[{'all':!![]}];}_0x41f63d=_[_0x9e55('0x49')]({},_0x41f63d,_0x321862['options']);return db[_0x9e55('0x4d')][_0x9e55('0x54')](_0x41f63d)[_0x9e55('0x24')](handleEntityNotFound(_0x2cc8ab,null))[_0x9e55('0x24')](respondWithResult(_0x2cc8ab,null))[_0x9e55('0x55')](handleError(_0x2cc8ab,null));};exports[_0x9e55('0x56')]=function(_0x56521a,_0x52ee51){return db[_0x9e55('0x4d')][_0x9e55('0x56')](_0x56521a[_0x9e55('0x57')],{})[_0x9e55('0x24')](respondWithResult(_0x52ee51,0xc9))[_0x9e55('0x55')](handleError(_0x52ee51,null));};exports[_0x9e55('0x23')]=function(_0x4a836a,_0x313e60){if(_0x4a836a[_0x9e55('0x57')]['id']){delete _0x4a836a['body']['id'];}return db['CmHopper'][_0x9e55('0x54')]({'where':{'id':_0x4a836a[_0x9e55('0x50')]['id']}})[_0x9e55('0x24')](handleEntityNotFound(_0x313e60,null))['then'](saveUpdates(_0x4a836a[_0x9e55('0x57')],null))['then'](respondWithResult(_0x313e60,null))[_0x9e55('0x55')](handleError(_0x313e60,null));};exports[_0x9e55('0x58')]=function(_0x532f69,_0x1fb109){return db[_0x9e55('0x4d')][_0x9e55('0x58')]()[_0x9e55('0x24')](respondWithResult(_0x1fb109,null))[_0x9e55('0x55')](handleError(_0x1fb109,null));};exports['destroy']=function(_0x3838ed,_0x23950a){var _0xedb7c4;return db[_0x9e55('0x4d')][_0x9e55('0x54')]({'where':{'id':_0x3838ed[_0x9e55('0x50')]['id']}})[_0x9e55('0x24')](handleEntityNotFound(_0x23950a,null))[_0x9e55('0x24')](function(_0x466a3c){if(_0x466a3c){return _0x466a3c[_0x9e55('0x25')]()[_0x9e55('0x24')](function(_0x1b3088){return _0x1b3088;});}})[_0x9e55('0x24')](function(_0x1318c9){_0xedb7c4=_0x1318c9;if(_0x1318c9){if(_0x1318c9[_0x9e55('0x59')]||_0x1318c9[_0x9e55('0x5a')]){return db[_0x1318c9[_0x9e55('0x59')]?'VoiceQueue':_0x9e55('0x5b')][_0x9e55('0x54')]({'where':{'id':_0x1318c9[_0x9e55('0x59')]?_0x1318c9[_0x9e55('0x59')]:_0x1318c9[_0x9e55('0x5a')]},'attributes':['id',_0x9e55('0x27')],'raw':!![]});}}})['then'](function(_0x53a26f){var _0x37f21c={};if(_0x53a26f){_[_0x9e55('0x49')](_0x37f21c,_[_0x9e55('0x5c')](_0xedb7c4[_0x9e55('0x5d')],[_0x9e55('0x5e'),'updatedAt','id']));_0x37f21c['state']=0x15;_0x37f21c['statedesc']=_0x9e55('0x5f');_0x37f21c['campaign']=_0x53a26f[_0x9e55('0x27')];_0x37f21c[_0x9e55('0x60')]=_0x3838ed[_0x9e55('0x61')][_0x9e55('0x27')];_0x37f21c[_0x9e55('0x62')]=_0x3838ed['user']['id'];_0x37f21c[_0x9e55('0x5f')]=!![];_0x37f21c[_0x9e55('0x63')]=moment()[_0x9e55('0x64')](_0x9e55('0x65'));_0x37f21c[_0x9e55('0x66')]=_0xedb7c4['phone'];_0x37f21c[_0x9e55('0x67')]=_0xedb7c4['VoiceQueueId']?_0x9e55('0x68'):'ivr';return db['CmContact'][_0x9e55('0x54')]({'where':{'id':_0x37f21c[_0x9e55('0x69')]},'attributes':[_0x9e55('0x6a'),_0x9e55('0x6b')]})[_0x9e55('0x24')](function(_0xf92942){if(!_['isNil'](_0x23950a)&&!_[_0x9e55('0x6c')](_0xf92942[_0x9e55('0x6a')])){_0x37f21c[_0x9e55('0x6d')]=_0xf92942['firstName'];if(!_[_0x9e55('0x6c')](_0xf92942['lastName'])){_0x37f21c['calleridname']+='\x20'+_0xf92942['lastName'];}}})[_0x9e55('0x6e')](function(){return db['CmHopperFinal'][_0x9e55('0x56')](_0x37f21c);});}})['then'](function(){return _0x23950a[_0x9e55('0x18')](0xcc)[_0x9e55('0x19')]();})[_0x9e55('0x55')](handleError(_0x23950a,null));};exports['getPreview']=function(_0x43a255,_0x5ec770,_0xd96c69){var _0x1baba3=[];return db[_0x9e55('0x6f')][_0x9e55('0x58')]()[_0x9e55('0x24')](function(_0x41baca){_0x1baba3=_[_0x9e55('0x2e')](_0x41baca);return _0x43a255[_0x9e55('0x61')][_0x9e55('0x70')]({'where':{'type':_0x9e55('0x71'),'dialActive':!![],'dialMethod':_0x9e55('0x72')},'attributes':['id',_0x9e55('0x73'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x9e55('0x24')](function(_0x2d36e3){if(_0x2d36e3&&_0x2d36e3[_0x9e55('0x53')]){return db[_0x9e55('0x74')]['transaction'](function(_0x5ba1bb){var _0xb2ff64={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e55('0x64')](_0x9e55('0x65'))},'VoiceQueueId':{'$in':_[_0x9e55('0x28')](_0x2d36e3,'id')},'$or':[{'UserId':null},{'UserId':_0x43a255[_0x9e55('0x61')]['id']}]};var _0x247dd1={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d36e3)[_0x9e55('0x48')]([_0x9e55('0x75'),0x0])['map']('id')[_0x9e55('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x43a255[_0x9e55('0x61')]['id']}]};var _0x1261fa={'$or':[_0xb2ff64,_0x247dd1]};var _0x40dbf8=[];if(_0x43a255['body'][_0x9e55('0x77')]&&_0x43a255[_0x9e55('0x57')][_0x9e55('0x77')]===_0x9e55('0x78')){if(!_[_0x9e55('0x79')](_0x43a255['body'][_0x9e55('0x7a')])){_0x1261fa['id']={'$in':_0x43a255[_0x9e55('0x57')][_0x9e55('0x7a')]};}_0x40dbf8=[[_0x9e55('0x7b'),_0x9e55('0x7c')],[_0x9e55('0x7d'),_0x2d36e3[0x0][_0x9e55('0x73')]===_0x9e55('0x7c')?_0x9e55('0x7e'):_0x9e55('0x7c')],db[_0x9e55('0x74')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x9e55('0x79')](_0x43a255[_0x9e55('0x57')][_0x9e55('0x7a')])){_0x1261fa['id']={'$notIn':_0x43a255[_0x9e55('0x57')]['hopperIds']};}_0x40dbf8=[[_0x9e55('0x7b'),'DESC'],[_0x9e55('0x7d'),_0x2d36e3[0x0][_0x9e55('0x73')]],db[_0x9e55('0x74')][_0x9e55('0x7f')](_0x9e55('0x80')),['id',_0x9e55('0x7c')]];}return db[_0x9e55('0x4d')][_0x9e55('0x81')]({'attributes':['id',_0x9e55('0x82'),_0x9e55('0x83')],'where':_0x1261fa,'order':_0x40dbf8,'transaction':_0x5ba1bb,'lock':_0x5ba1bb[_0x9e55('0x84')]['UPDATE'],'include':[{'model':db[_0x9e55('0x6f')],'as':_0x9e55('0x85'),'attributes':_0x1baba3,'include':[{'model':db['CmCompany'],'as':_0x9e55('0x86'),'attributes':['id','name']}]},{'model':db[_0x9e55('0x87')],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x9e55('0x27'),'dialActive']}]})['then'](function(_0x7a69b8){if(_0x7a69b8){return _0x7a69b8[_0x9e55('0x23')]({'UserId':_0x43a255['user']['id']},{'transaction':_0x5ba1bb});}});});}})['then'](handleEntityNotFound(_0x5ec770,null))[_0x9e55('0x24')](respondWithResult(_0x5ec770,null))[_0x9e55('0x55')](handleError(_0x5ec770,null));};exports[_0x9e55('0x88')]=function(_0x118a73,_0x234b11,_0x51d39c){var _0x44f095=[];return db['CmContact'][_0x9e55('0x58')]()['then'](function(_0x56e1a9){_0x44f095=_[_0x9e55('0x2e')](_0x56e1a9);return _0x118a73[_0x9e55('0x61')][_0x9e55('0x70')]({'where':{'type':_0x9e55('0x71'),'dialActive':!![],'dialMethod':_0x9e55('0x72')},'attributes':['id',_0x9e55('0x73'),_0x9e55('0x75')],'raw':!![]});})[_0x9e55('0x24')](function(_0x405f66){if(_0x405f66&&_0x405f66[_0x9e55('0x53')]){return db[_0x9e55('0x74')]['transaction'](function(_0x7ad57b){var _0x241828={'active':![],'recallme':!![],'id':_0x118a73['body'][_0x9e55('0x89')]};return db[_0x9e55('0x4d')][_0x9e55('0x81')]({'attributes':['id','scheduledat','recallme'],'where':_0x241828,'transaction':_0x7ad57b,'lock':_0x7ad57b['LOCK'][_0x9e55('0x8a')],'include':[{'model':db[_0x9e55('0x6f')],'as':_0x9e55('0x85'),'attributes':_0x44f095,'include':[{'model':db[_0x9e55('0x8b')],'as':_0x9e55('0x86'),'attributes':['id',_0x9e55('0x27')]}]},{'model':db[_0x9e55('0x87')],'as':_0x9e55('0x8c'),'attributes':['id','name']},{'model':db[_0x9e55('0x8d')],'as':_0x9e55('0x8e'),'attributes':['id','name',_0x9e55('0x8f')]}]})['then'](function(_0x495aec){if(_0x495aec){return _0x495aec[_0x9e55('0x23')]({'UserId':_0x118a73[_0x9e55('0x61')]['id']},{'transaction':_0x7ad57b});}});});}})[_0x9e55('0x24')](handleEntityNotFound(_0x234b11,null))[_0x9e55('0x24')](respondWithResult(_0x234b11,null))[_0x9e55('0x55')](handleError(_0x234b11,null));};exports[_0x9e55('0x90')]=function(_0x4b70ce,_0x33762b,_0xca0dde){return _0x4b70ce[_0x9e55('0x61')]['getVoiceQueues']({'where':{'type':_0x9e55('0x71'),'dialActive':!![],'dialMethod':_0x9e55('0x72')},'attributes':['id'],'raw':!![]})['then'](function(_0x4fb0eb){if(_0x4fb0eb&&_0x4fb0eb[_0x9e55('0x53')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e55('0x64')](_0x9e55('0x65'))},'VoiceQueueId':{'$in':_[_0x9e55('0x28')](_0x4fb0eb,'id')},'$or':[{'UserId':null},{'UserId':_0x4b70ce['user']['id']}]}});}return 0x0;})[_0x9e55('0x24')](function(_0x2e15d7){if(!_[_0x9e55('0x6c')](_0x2e15d7)&&_['isNumber'](_0x2e15d7)){return _0x33762b[_0x9e55('0x18')](0xc8)[_0x9e55('0x1a')]({'contacts':_0x2e15d7});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x9e55('0x90'),0x194,'entity\x20not\x20found');_0x33762b[_0x9e55('0x17')](0x194);}})[_0x9e55('0x55')](handleError(_0x33762b,null));};exports[_0x9e55('0x91')]=function(_0x161a77,_0x5dbee3,_0x2bbd98){var _0x1a2a36=shared[_0x9e55('0x92')];var _0x26f1a3=[];_[_0x9e55('0x28')](_0x1a2a36,function(_0x4bc5aa){_0x26f1a3[_0x9e55('0x93')]({'id':_0x4bc5aa[_0x9e55('0x27')],'name':_0x4bc5aa[_0x9e55('0x27')],'utcOffset':_0x4bc5aa['utcOffset']});});return _0x5dbee3[_0x9e55('0x18')](0xc8)[_0x9e55('0x1a')]({'tz':_0x26f1a3});};exports[_0x9e55('0x94')]=function(_0xbe306d,_0x5cfba5,_0x4a924d){var _0x3841f2=shared[_0x9e55('0x92')];var _0x355bf8={};if(!_[_0x9e55('0x6c')](_0x3841f2[_0xbe306d[_0x9e55('0x57')]['id']]))_0x355bf8=_0x3841f2[_0xbe306d[_0x9e55('0x57')]['id']];return _0x5cfba5[_0x9e55('0x18')](0xc8)[_0x9e55('0x1a')](_0x355bf8);}; \ No newline at end of file +var _0x0427=['getOpenContacts','entity\x20not\x20found','getTimezones','timezones','utcOffset','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','filters','concat','$and','$or','$gte','$ne','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','filter','options','CmHopper','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmContact','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','priority','ASC','sequelize','literal','DESC','isEmpty','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','dialActive','getPreviewRecall','outbound','transaction','findOne','List','CmHopper,\x20%s,\x20%s,\x20%s'];(function(_0x30417c,_0x391505){var _0x10325e=function(_0x2169e9){while(--_0x2169e9){_0x30417c['push'](_0x30417c['shift']());}};_0x10325e(++_0x391505);}(_0x0427,0x137));var _0x7042=function(_0x15ee3c,_0x5d8699){_0x15ee3c=_0x15ee3c-0x0;var _0x4c962b=_0x0427[_0x15ee3c];return _0x4c962b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7042('0x0'));var jsonpatch=require(_0x7042('0x1'));var rp=require('request-promise');var moment=require(_0x7042('0x2'));var BPromise=require(_0x7042('0x3'));var Mustache=require(_0x7042('0x4'));var util=require(_0x7042('0x5'));var path=require(_0x7042('0x6'));var sox=require(_0x7042('0x7'));var csv=require(_0x7042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7042('0x9'));var _=require(_0x7042('0xa'));var squel=require(_0x7042('0xb'));var crypto=require(_0x7042('0xc'));var jsforce=require(_0x7042('0xd'));var deskjs=require(_0x7042('0xe'));var toCsv=require(_0x7042('0x8'));var querystring=require(_0x7042('0xf'));var Papa=require(_0x7042('0x10'));var Redis=require('ioredis');var authService=require(_0x7042('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7042('0x12'));var utils=require('../../config/utils');var config=require(_0x7042('0x13'));var shared=require(_0x7042('0x13'));var licenseUtil=require(_0x7042('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c06f0,_0x292c4a){_0x292c4a=_0x292c4a||0xcc;return function(_0x3f92eb){if(_0x3f92eb){return _0x5c06f0[_0x7042('0x15')](_0x292c4a);}return _0x5c06f0[_0x7042('0x16')](_0x292c4a)[_0x7042('0x17')]();};}function respondWithResult(_0xee4c2,_0x5def25){_0x5def25=_0x5def25||0xc8;return function(_0x3c8ecd){if(_0x3c8ecd){return _0xee4c2[_0x7042('0x16')](_0x5def25)[_0x7042('0x18')](_0x3c8ecd);}};}function respondWithFilteredResult(_0x5c1ef0,_0x4c68c4){return function(_0xc7e44e){if(_0xc7e44e){var _0x4de51e=typeof _0x4c68c4[_0x7042('0x19')]==='undefined'&&typeof _0x4c68c4['limit']===_0x7042('0x1a');var _0x313e08=_0xc7e44e[_0x7042('0x1b')];var _0x22d9a8=_0x4de51e?0x0:_0x4c68c4[_0x7042('0x19')];var _0x544c02=_0x4de51e?_0xc7e44e[_0x7042('0x1b')]:_0x4c68c4[_0x7042('0x19')]+_0x4c68c4[_0x7042('0x1c')];var _0x39cfbe;if(_0x544c02>=_0x313e08){_0x544c02=_0x313e08;_0x39cfbe=0xc8;}else{_0x39cfbe=0xce;}_0x5c1ef0[_0x7042('0x16')](_0x39cfbe);return _0x5c1ef0['set'](_0x7042('0x1d'),_0x22d9a8+'-'+_0x544c02+'/'+_0x313e08)['json'](_0xc7e44e);}return null;};}function patchUpdates(_0x363f3c){return function(_0x572ebe){try{jsonpatch[_0x7042('0x1e')](_0x572ebe,_0x363f3c,!![]);}catch(_0x472492){return BPromise[_0x7042('0x1f')](_0x472492);}return _0x572ebe[_0x7042('0x20')]();};}function saveUpdates(_0x484c82,_0x5a224b){return function(_0x5d1e14){if(_0x5d1e14){return _0x5d1e14[_0x7042('0x21')](_0x484c82)[_0x7042('0x22')](function(_0x3af8bc){return _0x3af8bc;});}return null;};}function removeEntity(_0x1949fe,_0x48d529){return function(_0x12d618){if(_0x12d618){return _0x12d618[_0x7042('0x23')]()[_0x7042('0x22')](function(){_0x1949fe[_0x7042('0x16')](0xcc)[_0x7042('0x17')]();});}};}function handleEntityNotFound(_0x54445b,_0xc5fed3){return function(_0x41dc11){if(!_0x41dc11){_0x54445b[_0x7042('0x15')](0x194);}return _0x41dc11;};}function handleError(_0x1a05d1,_0x2e4dbe){_0x2e4dbe=_0x2e4dbe||0x1f4;return function(_0x1cb194){logger[_0x7042('0x24')](_0x1cb194[_0x7042('0x25')]);if(_0x1cb194[_0x7042('0x26')]){delete _0x1cb194[_0x7042('0x26')];}_0x1a05d1[_0x7042('0x16')](_0x2e4dbe)[_0x7042('0x27')](_0x1cb194);};}exports[_0x7042('0x28')]=function(_0x1b6a29,_0x101b89){var _0x3203f3={},_0x477972={},_0xa7461d={'count':0x0,'rows':[]};var _0x370307=_['map'](db['CmHopper'][_0x7042('0x29')],function(_0x160af6){return{'name':_0x160af6[_0x7042('0x2a')],'type':_0x160af6[_0x7042('0x2b')][_0x7042('0x2c')]};});_0x477972[_0x7042('0x2d')]=_[_0x7042('0x2e')](_0x370307,'name');_0x477972['query']=_[_0x7042('0x2f')](_0x1b6a29[_0x7042('0x30')]);_0x477972['filters']=_[_0x7042('0x31')](_0x477972[_0x7042('0x2d')],_0x477972['query']);_0x477972[_0x7042('0x32')]=_[_0x7042('0x33')](_0x477972[_0x7042('0x32')],[_0x7042('0x34'),_0x7042('0x35'),'$gt',_0x7042('0x36'),'$lt','$lte',_0x7042('0x37'),'$eq',_0x7042('0x38'),_0x7042('0x39'),'$notBetween',_0x7042('0x3a'),'$notIn',_0x7042('0x3b'),_0x7042('0x3c'),_0x7042('0x3d'),_0x7042('0x3e'),_0x7042('0x3b'),_0x7042('0x3f'),_0x7042('0x40'),_0x7042('0x41'),_0x7042('0x42')]);_0x3203f3['attributes']=_[_0x7042('0x31')](_0x477972[_0x7042('0x2d')],qs[_0x7042('0x43')](_0x1b6a29['query']['fields']));_0x3203f3[_0x7042('0x44')]=_0x3203f3[_0x7042('0x44')]['length']?_0x3203f3[_0x7042('0x44')]:_0x477972[_0x7042('0x2d')];if(!_0x1b6a29[_0x7042('0x30')][_0x7042('0x45')](_0x7042('0x46'))){_0x3203f3[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x1b6a29[_0x7042('0x30')][_0x7042('0x1c')]);_0x3203f3[_0x7042('0x19')]=qs[_0x7042('0x19')](_0x1b6a29[_0x7042('0x30')][_0x7042('0x19')]);}_0x3203f3['order']=qs['sort'](_0x1b6a29[_0x7042('0x30')][_0x7042('0x47')]);_0x3203f3[_0x7042('0x48')]=qs[_0x7042('0x32')](_['pick'](_0x1b6a29[_0x7042('0x30')],_0x477972[_0x7042('0x32')]),_0x370307);if(_0x1b6a29['query']['filter']){_0x3203f3[_0x7042('0x48')]=_[_0x7042('0x49')](_0x3203f3[_0x7042('0x48')],{'$or':_[_0x7042('0x2e')](_0x370307,function(_0x35c7e3){if(_0x35c7e3['type']!=='VIRTUAL'){var _0x2c8d2a={};_0x2c8d2a[_0x35c7e3[_0x7042('0x26')]]={'$like':'%'+_0x1b6a29['query'][_0x7042('0x4a')]+'%'};return _0x2c8d2a;}})});}_0x3203f3=_[_0x7042('0x49')]({},_0x3203f3,_0x1b6a29[_0x7042('0x4b')]);var _0x59568d={'where':_0x3203f3['where']};return db[_0x7042('0x4c')][_0x7042('0x1b')](_0x59568d)[_0x7042('0x22')](function(_0x5316f6){_0xa7461d[_0x7042('0x1b')]=_0x5316f6;if(_0x1b6a29[_0x7042('0x30')]['includeAll']){_0x3203f3[_0x7042('0x4d')]=[{'all':!![]}];}return db[_0x7042('0x4c')][_0x7042('0x4e')](_0x3203f3);})[_0x7042('0x22')](function(_0x25adef){_0xa7461d[_0x7042('0x4f')]=_0x25adef;return _0xa7461d;})[_0x7042('0x22')](respondWithFilteredResult(_0x101b89,_0x3203f3))['catch'](handleError(_0x101b89,null));};exports[_0x7042('0x50')]=function(_0x18a7d5,_0x4cd0a0){var _0x292ebf={'raw':!![],'where':{'id':_0x18a7d5[_0x7042('0x51')]['id']}},_0xd0d738={};_0xd0d738[_0x7042('0x2d')]=_[_0x7042('0x2f')](db[_0x7042('0x4c')]['rawAttributes']);_0xd0d738['query']=_['keys'](_0x18a7d5[_0x7042('0x30')]);_0xd0d738['filters']=_['intersection'](_0xd0d738[_0x7042('0x2d')],_0xd0d738['query']);_0x292ebf[_0x7042('0x44')]=_[_0x7042('0x31')](_0xd0d738[_0x7042('0x2d')],qs[_0x7042('0x43')](_0x18a7d5[_0x7042('0x30')][_0x7042('0x43')]));_0x292ebf[_0x7042('0x44')]=_0x292ebf[_0x7042('0x44')][_0x7042('0x52')]?_0x292ebf[_0x7042('0x44')]:_0xd0d738[_0x7042('0x2d')];if(_0x18a7d5[_0x7042('0x30')][_0x7042('0x53')]){_0x292ebf['include']=[{'all':!![]}];}_0x292ebf=_[_0x7042('0x49')]({},_0x292ebf,_0x18a7d5[_0x7042('0x4b')]);return db[_0x7042('0x4c')][_0x7042('0x54')](_0x292ebf)[_0x7042('0x22')](handleEntityNotFound(_0x4cd0a0,null))[_0x7042('0x22')](respondWithResult(_0x4cd0a0,null))[_0x7042('0x55')](handleError(_0x4cd0a0,null));};exports[_0x7042('0x56')]=function(_0x3b258d,_0x936eeb){return db[_0x7042('0x4c')][_0x7042('0x56')](_0x3b258d[_0x7042('0x57')],{})['then'](respondWithResult(_0x936eeb,0xc9))[_0x7042('0x55')](handleError(_0x936eeb,null));};exports['update']=function(_0x2cb2da,_0x1a2b3a){if(_0x2cb2da[_0x7042('0x57')]['id']){delete _0x2cb2da['body']['id'];}return db['CmHopper'][_0x7042('0x54')]({'where':{'id':_0x2cb2da[_0x7042('0x51')]['id']}})[_0x7042('0x22')](handleEntityNotFound(_0x1a2b3a,null))[_0x7042('0x22')](saveUpdates(_0x2cb2da['body'],null))['then'](respondWithResult(_0x1a2b3a,null))[_0x7042('0x55')](handleError(_0x1a2b3a,null));};exports[_0x7042('0x58')]=function(_0x4a2b70,_0x382b74){return db[_0x7042('0x4c')]['describe']()[_0x7042('0x22')](respondWithResult(_0x382b74,null))[_0x7042('0x55')](handleError(_0x382b74,null));};exports['destroy']=function(_0x449de2,_0x266f7d){var _0x3a437b;return db['CmHopper'][_0x7042('0x54')]({'where':{'id':_0x449de2[_0x7042('0x51')]['id']}})[_0x7042('0x22')](handleEntityNotFound(_0x266f7d,null))[_0x7042('0x22')](function(_0x31fb4f){if(_0x31fb4f){return _0x31fb4f[_0x7042('0x23')]()[_0x7042('0x22')](function(_0x34995b){return _0x34995b;});}})[_0x7042('0x22')](function(_0x3a1e37){_0x3a437b=_0x3a1e37;if(_0x3a1e37){if(_0x3a1e37[_0x7042('0x59')]||_0x3a1e37[_0x7042('0x5a')]){return db[_0x3a1e37['VoiceQueueId']?_0x7042('0x5b'):_0x7042('0x5c')][_0x7042('0x54')]({'where':{'id':_0x3a1e37[_0x7042('0x59')]?_0x3a1e37[_0x7042('0x59')]:_0x3a1e37[_0x7042('0x5a')]},'attributes':['id','name'],'raw':!![]});}}})[_0x7042('0x22')](function(_0x17f5c9){var _0x205e82={};if(_0x17f5c9){_['merge'](_0x205e82,_[_0x7042('0x5d')](_0x3a437b[_0x7042('0x5e')],[_0x7042('0x5f'),_0x7042('0x60'),'id']));_0x205e82[_0x7042('0x61')]=0x15;_0x205e82[_0x7042('0x62')]=_0x7042('0x63');_0x205e82[_0x7042('0x64')]=_0x17f5c9['name'];_0x205e82[_0x7042('0x65')]=_0x449de2[_0x7042('0x66')][_0x7042('0x26')];_0x205e82[_0x7042('0x67')]=_0x449de2[_0x7042('0x66')]['id'];_0x205e82[_0x7042('0x63')]=!![];_0x205e82[_0x7042('0x68')]=moment()['format'](_0x7042('0x69'));_0x205e82['calleridnum']=_0x3a437b[_0x7042('0x6a')];_0x205e82[_0x7042('0x6b')]=_0x3a437b[_0x7042('0x59')]?_0x7042('0x6c'):'ivr';return db['CmContact'][_0x7042('0x54')]({'where':{'id':_0x205e82[_0x7042('0x6d')]},'attributes':['firstName',_0x7042('0x6e')]})[_0x7042('0x22')](function(_0x12df51){if(!_[_0x7042('0x6f')](_0x266f7d)&&!_[_0x7042('0x6f')](_0x12df51[_0x7042('0x70')])){_0x205e82[_0x7042('0x71')]=_0x12df51[_0x7042('0x70')];if(!_[_0x7042('0x6f')](_0x12df51['lastName'])){_0x205e82[_0x7042('0x71')]+='\x20'+_0x12df51[_0x7042('0x6e')];}}})[_0x7042('0x72')](function(){return db[_0x7042('0x73')]['create'](_0x205e82);});}})[_0x7042('0x22')](function(){return _0x266f7d['status'](0xcc)[_0x7042('0x17')]();})[_0x7042('0x55')](handleError(_0x266f7d,null));};exports['getPreview']=function(_0x5559dc,_0x3ca818,_0x5ba91e){var _0xc51212=[];return db[_0x7042('0x74')][_0x7042('0x58')]()['then'](function(_0x5ee669){_0xc51212=_['keys'](_0x5ee669);return _0x5559dc[_0x7042('0x66')][_0x7042('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7042('0x76')},'attributes':['id',_0x7042('0x77'),_0x7042('0x78')],'raw':!![]});})['then'](function(_0x245201){if(_0x245201&&_0x245201[_0x7042('0x52')]){return db['sequelize']['transaction'](function(_0x190ce7){var _0x5bbef4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7042('0x69'))},'VoiceQueueId':{'$in':_[_0x7042('0x2e')](_0x245201,'id')},'$or':[{'UserId':null},{'UserId':_0x5559dc[_0x7042('0x66')]['id']}]};var _0x88a357={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x245201)[_0x7042('0x4a')]([_0x7042('0x78'),0x0])[_0x7042('0x2e')]('id')[_0x7042('0x79')]()},'$or':[{'UserId':null},{'UserId':_0x5559dc['user']['id']}]};var _0x5ed59a={'$or':[_0x5bbef4,_0x88a357]};var _0x2e2747=[];if(_0x5559dc[_0x7042('0x57')][_0x7042('0x7a')]&&_0x5559dc['body']['direction']===_0x7042('0x7b')){if(!_['isEmpty'](_0x5559dc[_0x7042('0x57')][_0x7042('0x7c')])){_0x5ed59a['id']={'$in':_0x5559dc[_0x7042('0x57')]['hopperIds']};}_0x2e2747=[[_0x7042('0x7d'),_0x7042('0x7e')],['scheduledAt',_0x245201[0x0][_0x7042('0x77')]===_0x7042('0x7e')?'DESC':'ASC'],db[_0x7042('0x7f')][_0x7042('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7042('0x81')]];}else{if(!_[_0x7042('0x82')](_0x5559dc[_0x7042('0x57')][_0x7042('0x7c')])){_0x5ed59a['id']={'$notIn':_0x5559dc[_0x7042('0x57')][_0x7042('0x7c')]};}_0x2e2747=[[_0x7042('0x7d'),_0x7042('0x81')],[_0x7042('0x83'),_0x245201[0x0][_0x7042('0x77')]],db['sequelize'][_0x7042('0x80')](_0x7042('0x84')),['id',_0x7042('0x7e')]];}return db[_0x7042('0x4c')]['findOne']({'attributes':['id',_0x7042('0x85'),_0x7042('0x86')],'where':_0x5ed59a,'order':_0x2e2747,'transaction':_0x190ce7,'lock':_0x190ce7[_0x7042('0x87')][_0x7042('0x88')],'include':[{'model':db['CmContact'],'as':_0x7042('0x89'),'attributes':_0xc51212,'include':[{'model':db[_0x7042('0x8a')],'as':_0x7042('0x8b'),'attributes':['id',_0x7042('0x26')]}]},{'model':db[_0x7042('0x8c')],'as':'List','attributes':['id','name']},{'model':db[_0x7042('0x5b')],'as':'Queue','attributes':['id',_0x7042('0x26'),_0x7042('0x8d')]}]})[_0x7042('0x22')](function(_0x206afd){if(_0x206afd){return _0x206afd[_0x7042('0x21')]({'UserId':_0x5559dc[_0x7042('0x66')]['id']},{'transaction':_0x190ce7});}});});}})['then'](handleEntityNotFound(_0x3ca818,null))[_0x7042('0x22')](respondWithResult(_0x3ca818,null))['catch'](handleError(_0x3ca818,null));};exports[_0x7042('0x8e')]=function(_0x377f0a,_0x58878d,_0x20a996){var _0x400004=[];return db[_0x7042('0x74')][_0x7042('0x58')]()['then'](function(_0x2b3fb1){_0x400004=_[_0x7042('0x2f')](_0x2b3fb1);return _0x377f0a[_0x7042('0x66')][_0x7042('0x75')]({'where':{'type':_0x7042('0x8f'),'dialActive':!![],'dialMethod':_0x7042('0x76')},'attributes':['id',_0x7042('0x77'),_0x7042('0x78')],'raw':!![]});})[_0x7042('0x22')](function(_0x497380){if(_0x497380&&_0x497380[_0x7042('0x52')]){return db[_0x7042('0x7f')][_0x7042('0x90')](function(_0x5bb1c3){var _0x41fafb={'active':![],'recallme':!![],'id':_0x377f0a['body']['hopperId']};return db[_0x7042('0x4c')][_0x7042('0x91')]({'attributes':['id',_0x7042('0x85'),'recallme'],'where':_0x41fafb,'transaction':_0x5bb1c3,'lock':_0x5bb1c3[_0x7042('0x87')][_0x7042('0x88')],'include':[{'model':db[_0x7042('0x74')],'as':'Contact','attributes':_0x400004,'include':[{'model':db[_0x7042('0x8a')],'as':_0x7042('0x8b'),'attributes':['id',_0x7042('0x26')]}]},{'model':db[_0x7042('0x8c')],'as':_0x7042('0x92'),'attributes':['id',_0x7042('0x26')]},{'model':db[_0x7042('0x5b')],'as':'Queue','attributes':['id','name',_0x7042('0x8d')]}]})['then'](function(_0x106935){if(_0x106935){return _0x106935[_0x7042('0x21')]({'UserId':_0x377f0a['user']['id']},{'transaction':_0x5bb1c3});}});});}})['then'](handleEntityNotFound(_0x58878d,null))[_0x7042('0x22')](respondWithResult(_0x58878d,null))[_0x7042('0x55')](handleError(_0x58878d,null));};exports['getOpenContacts']=function(_0x1d9a4b,_0x236ba7,_0x39c5d5){return _0x1d9a4b[_0x7042('0x66')][_0x7042('0x75')]({'where':{'type':_0x7042('0x8f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x7042('0x22')](function(_0x3df8ac){if(_0x3df8ac&&_0x3df8ac['length']){return db['CmHopper'][_0x7042('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7042('0x69'))},'VoiceQueueId':{'$in':_[_0x7042('0x2e')](_0x3df8ac,'id')},'$or':[{'UserId':null},{'UserId':_0x1d9a4b[_0x7042('0x66')]['id']}]}});}return 0x0;})['then'](function(_0x5e8535){if(!_['isNil'](_0x5e8535)&&_['isNumber'](_0x5e8535)){return _0x236ba7[_0x7042('0x16')](0xc8)[_0x7042('0x18')]({'contacts':_0x5e8535});}else{logger[_0x7042('0x24')](_0x7042('0x93'),_0x7042('0x94'),0x194,_0x7042('0x95'));_0x236ba7[_0x7042('0x15')](0x194);}})['catch'](handleError(_0x236ba7,null));};exports[_0x7042('0x96')]=function(_0x2b5a3d,_0x59ebb0,_0x2b0e89){var _0x27e8ae=shared[_0x7042('0x97')];var _0xfc46ac=[];_['map'](_0x27e8ae,function(_0x4b87fc){_0xfc46ac['push']({'id':_0x4b87fc[_0x7042('0x26')],'name':_0x4b87fc['name'],'utcOffset':_0x4b87fc[_0x7042('0x98')]});});return _0x59ebb0[_0x7042('0x16')](0xc8)[_0x7042('0x18')]({'tz':_0xfc46ac});};exports['getTimezone']=function(_0x94ea96,_0x171823,_0x1e052d){var _0x17c1ab=shared['timezones'];var _0x805cd4={};if(!_[_0x7042('0x6f')](_0x17c1ab[_0x94ea96['body']['id']]))_0x805cd4=_0x17c1ab[_0x94ea96['body']['id']];return _0x171823[_0x7042('0x16')](0xc8)[_0x7042('0x18')](_0x805cd4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8604242..1c830c2 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 _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x542149,_0x5df180){var _0x36df57=function(_0x1f6e73){while(--_0x1f6e73){_0x542149['push'](_0x542149['shift']());}};_0x36df57(++_0x5df180);}(_0xba34,0x119));var _0x4ba3=function(_0x558190,_0x259e60){_0x558190=_0x558190-0x0;var _0x477125=_0xba34[_0x558190];return _0x477125;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9536=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x9536,0x179));var _0x6953=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x9536[_0x29e35f];return _0x266b74;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['scheduledat']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'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 1b6c66b..043f2f3 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 _0xbcf6=['User','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','`scheduledat`\x20>=\x20','YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','GetContactRecallMe','findAll','LOCK','UPDATE','GetCmHopperPreview','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','literal','\x20MINUTE','Agent','name','CmList','List','NOW()\x20+\x20INTERVAL\x20','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','GetCmHopper','CmHopper','options','raw','attributes','limit','include','map','model','then','stringify','ShowCmHopper','find','catch','create','body','CreateCmHopper','UpdateCmHopper','where','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','Contact','keys'];(function(_0xb00082,_0x4d60e5){var _0x19af20=function(_0x16d4a5){while(--_0x16d4a5){_0xb00082['push'](_0xb00082['shift']());}};_0x19af20(++_0x4d60e5);}(_0xbcf6,0x79));var _0x6bcf=function(_0x2f2cb8,_0x417d38){_0x2f2cb8=_0x2f2cb8-0x0;var _0x5a7add=_0xbcf6[_0x2f2cb8];return _0x5a7add;};'use strict';var _=require(_0x6bcf('0x0'));var util=require(_0x6bcf('0x1'));var moment=require(_0x6bcf('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bcf('0x3'));var fs=require('fs');var Redis=require(_0x6bcf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bcf('0x5'));var logger=require(_0x6bcf('0x6'))(_0x6bcf('0x7'));var config=require(_0x6bcf('0x8'));var jayson=require('jayson/promise');const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0x6bcf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x275ca9,_0x197bfa,_0x35d49d){return new BPromise(function(_0x2c4152,_0x30ca27){return client['request'](_0x275ca9,_0x35d49d)['then'](function(_0x4623de){logger['info'](_0x6bcf('0xa'),_0x197bfa,_0x6bcf('0xb'));logger[_0x6bcf('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x197bfa,_0x6bcf('0xb'),JSON['stringify'](_0x4623de));if(_0x4623de[_0x6bcf('0xd')]){if(_0x4623de[_0x6bcf('0xd')]['code']===0x1f4){logger[_0x6bcf('0xd')](_0x6bcf('0xa'),_0x197bfa,_0x4623de[_0x6bcf('0xd')][_0x6bcf('0xe')]);return _0x30ca27(_0x4623de['error'][_0x6bcf('0xe')]);}logger[_0x6bcf('0xd')](_0x6bcf('0xa'),_0x197bfa,_0x4623de['error'][_0x6bcf('0xe')]);return _0x2c4152(_0x4623de[_0x6bcf('0xd')][_0x6bcf('0xe')]);}else{logger[_0x6bcf('0xf')](_0x6bcf('0xa'),_0x197bfa,_0x6bcf('0xb'));_0x2c4152(_0x4623de[_0x6bcf('0x10')][_0x6bcf('0xe')]);}})['catch'](function(_0x29fc60){logger['error'](_0x6bcf('0xa'),_0x197bfa,_0x29fc60);_0x30ca27(_0x29fc60);});});}exports[_0x6bcf('0x11')]=function(_0x2e3521){var _0x332725=this;return new Promise(function(_0x327623,_0x4f757d){return db[_0x6bcf('0x12')]['findAll']({'raw':_0x2e3521[_0x6bcf('0x13')]?_0x2e3521[_0x6bcf('0x13')][_0x6bcf('0x14')]===undefined?!![]:![]:!![],'where':_0x2e3521[_0x6bcf('0x13')]?_0x2e3521[_0x6bcf('0x13')]['where']||null:null,'attributes':_0x2e3521[_0x6bcf('0x13')]?_0x2e3521[_0x6bcf('0x13')][_0x6bcf('0x15')]||null:null,'limit':_0x2e3521['options']?_0x2e3521['options'][_0x6bcf('0x16')]||null:null,'include':_0x2e3521[_0x6bcf('0x13')]?_0x2e3521[_0x6bcf('0x13')][_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x2e3521['options']['include'],function(_0x552ff8){return{'model':db[_0x552ff8[_0x6bcf('0x19')]],'as':_0x552ff8['as'],'attributes':_0x552ff8['attributes'],'include':_0x552ff8[_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x552ff8['include'],function(_0x50dd09){return{'model':db[_0x50dd09[_0x6bcf('0x19')]],'as':_0x50dd09['as'],'attributes':_0x50dd09[_0x6bcf('0x15')],'include':_0x50dd09[_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x50dd09[_0x6bcf('0x17')],function(_0x3c0d2a){return{'model':db[_0x3c0d2a['model']],'as':_0x3c0d2a['as'],'attributes':_0x3c0d2a[_0x6bcf('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6bcf('0x1a')](function(_0x592028){logger[_0x6bcf('0xf')](_0x6bcf('0x11'),_0x2e3521);logger[_0x6bcf('0xc')](_0x6bcf('0x11'),_0x2e3521,JSON[_0x6bcf('0x1b')](_0x592028));_0x327623(_0x592028);})['catch'](function(_0x1b76df){logger[_0x6bcf('0xd')](_0x6bcf('0x11'),_0x1b76df[_0x6bcf('0xe')],_0x2e3521);_0x4f757d(_0x332725[_0x6bcf('0xd')](0x1f4,_0x1b76df[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x1c')]=function(_0x3da7f4){var _0x409ecb=this;return new Promise(function(_0x93ec23,_0x52f867){return db[_0x6bcf('0x12')][_0x6bcf('0x1d')]({'raw':_0x3da7f4[_0x6bcf('0x13')]?_0x3da7f4[_0x6bcf('0x13')][_0x6bcf('0x14')]===undefined?!![]:![]:!![],'where':_0x3da7f4[_0x6bcf('0x13')]?_0x3da7f4['options']['where']||null:null,'attributes':_0x3da7f4[_0x6bcf('0x13')]?_0x3da7f4[_0x6bcf('0x13')]['attributes']||null:null,'include':_0x3da7f4[_0x6bcf('0x13')]?_0x3da7f4['options'][_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x3da7f4[_0x6bcf('0x13')][_0x6bcf('0x17')],function(_0x48e735){return{'model':db[_0x48e735['model']],'as':_0x48e735['as'],'attributes':_0x48e735['attributes'],'include':_0x48e735[_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x48e735[_0x6bcf('0x17')],function(_0x37f224){return{'model':db[_0x37f224[_0x6bcf('0x19')]],'as':_0x37f224['as'],'attributes':_0x37f224[_0x6bcf('0x15')],'include':_0x37f224[_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x37f224[_0x6bcf('0x17')],function(_0x352051){return{'model':db[_0x352051[_0x6bcf('0x19')]],'as':_0x352051['as'],'attributes':_0x352051['attributes']};}):[]};}):[]};}):[]:[]})[_0x6bcf('0x1a')](function(_0x398f78){logger[_0x6bcf('0xf')](_0x6bcf('0x1c'),_0x3da7f4);logger[_0x6bcf('0xc')](_0x6bcf('0x1c'),_0x3da7f4,JSON['stringify'](_0x398f78));_0x93ec23(_0x398f78);})[_0x6bcf('0x1e')](function(_0x2603ca){logger[_0x6bcf('0xd')](_0x6bcf('0x1c'),_0x2603ca[_0x6bcf('0xe')],_0x3da7f4);_0x52f867(_0x409ecb['error'](0x1f4,_0x2603ca[_0x6bcf('0xe')]));});});};exports['CreateCmHopper']=function(_0x5138fd){var _0xa1c707=this;return new Promise(function(_0x19483a,_0x814c36){return db[_0x6bcf('0x12')][_0x6bcf('0x1f')](_0x5138fd[_0x6bcf('0x20')],{'raw':_0x5138fd[_0x6bcf('0x13')]?_0x5138fd['options']['raw']===undefined?!![]:![]:!![]})[_0x6bcf('0x1a')](function(_0x145935){logger[_0x6bcf('0xf')](_0x6bcf('0x21'),_0x5138fd);logger[_0x6bcf('0xc')](_0x6bcf('0x21'),_0x5138fd,JSON[_0x6bcf('0x1b')](_0x145935));_0x19483a(_0x145935);})['catch'](function(_0x2eae4f){logger[_0x6bcf('0xd')](_0x6bcf('0x21'),_0x2eae4f[_0x6bcf('0xe')],_0x5138fd);_0x814c36(_0xa1c707[_0x6bcf('0xd')](0x1f4,_0x2eae4f[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x22')]=function(_0x86f423){var _0x30c913=this;return new Promise(function(_0x2ee81b,_0x2aa4d5){return db[_0x6bcf('0x12')]['update'](_0x86f423[_0x6bcf('0x20')],{'raw':_0x86f423[_0x6bcf('0x13')]?_0x86f423[_0x6bcf('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x86f423[_0x6bcf('0x13')]?_0x86f423[_0x6bcf('0x13')][_0x6bcf('0x23')]||null:null,'attributes':_0x86f423['options']?_0x86f423[_0x6bcf('0x13')][_0x6bcf('0x15')]||null:null,'limit':_0x86f423[_0x6bcf('0x13')]?_0x86f423[_0x6bcf('0x13')][_0x6bcf('0x16')]||null:null})[_0x6bcf('0x1a')](function(_0x246161){logger[_0x6bcf('0xf')]('UpdateCmHopper',_0x86f423);logger[_0x6bcf('0xf')](_0x6bcf('0x24'),JSON[_0x6bcf('0x1b')](_0x86f423[_0x6bcf('0x13')]['where']),_0x86f423[_0x6bcf('0x20')]['active']);logger[_0x6bcf('0xc')](_0x6bcf('0x22'),_0x86f423,JSON[_0x6bcf('0x1b')](_0x246161));_0x2ee81b(_0x246161);})[_0x6bcf('0x1e')](function(_0x466a9b){logger[_0x6bcf('0xd')]('UpdateCmHopper',_0x466a9b['message'],_0x86f423);_0x2aa4d5(_0x30c913[_0x6bcf('0xd')](0x1f4,_0x466a9b[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x25')]=function(_0x24e8b8){var _0xa25721=this;return new Promise(function(_0x2a0f34,_0x181743){return db[_0x6bcf('0x12')][_0x6bcf('0x26')]({'where':_0x24e8b8[_0x6bcf('0x13')]?_0x24e8b8['options'][_0x6bcf('0x23')]||null:null})['then'](function(_0x1c37a1){logger[_0x6bcf('0xf')]('DestroyCmHopper',_0x24e8b8);logger[_0x6bcf('0xc')]('DestroyCmHopper',_0x24e8b8,JSON[_0x6bcf('0x1b')](_0x1c37a1));_0x2a0f34(_0x1c37a1);})[_0x6bcf('0x1e')](function(_0x38ec2f){logger[_0x6bcf('0xd')](_0x6bcf('0x25'),_0x38ec2f['message'],_0x24e8b8);_0x181743(_0xa25721[_0x6bcf('0xd')](0x1f4,_0x38ec2f[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x27')]=function(_0x451f24){var _0x5d4e47=this;return new Promise(function(_0x5a97b4,_0x33b553){return db[_0x6bcf('0x28')][_0x6bcf('0x29')]()['then'](function(_0x31900a){return db['sequelize']['transaction'](function(_0x107b73){return db['CmHopper']['findAll']({'where':_0x451f24[_0x6bcf('0x13')]?_0x451f24['options'][_0x6bcf('0x23')]||null:null,'attributes':_0x451f24[_0x6bcf('0x13')]?_0x451f24[_0x6bcf('0x13')][_0x6bcf('0x15')]||null:null,'limit':_0x451f24[_0x6bcf('0x13')]?_0x451f24['options'][_0x6bcf('0x16')]||null:null,'order':_0x451f24[_0x6bcf('0x13')]?_0x451f24[_0x6bcf('0x13')][_0x6bcf('0x2a')]||null:null,'transaction':_0x107b73,'lock':_0x107b73['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x6bcf('0x2b'),'attributes':_[_0x6bcf('0x2c')](_0x31900a)},{'model':db[_0x6bcf('0x2d')],'as':'Agent','attributes':['id','name',_0x6bcf('0x2e')]}]})[_0x6bcf('0x1a')](function(_0x27b392){var _0x486ac6=[];var _0x5cc1f6=[];for(var _0x57f8b8=0x0;_0x57f8b8<_0x27b392[_0x6bcf('0x2f')];_0x57f8b8+=0x1){var _0x933c9f=_0x27b392[_0x57f8b8][_0x6bcf('0x30')];if(_0x933c9f===null){_0x486ac6[_0x6bcf('0x31')](_0x27b392[_0x57f8b8][_0x6bcf('0x32')](_0x451f24[_0x6bcf('0x20')],{'transaction':_0x107b73}));}else if(!_0x5cc1f6[_0x6bcf('0x33')](_0x933c9f)){_0x5cc1f6[_0x6bcf('0x31')](_0x933c9f);_0x486ac6['push'](_0x27b392[_0x57f8b8][_0x6bcf('0x32')](_0x451f24[_0x6bcf('0x20')],{'transaction':_0x107b73}));}}return BPromise[_0x6bcf('0x34')](_0x486ac6);});})['then'](function(_0xb175eb){logger[_0x6bcf('0xf')](_0x6bcf('0x27'),_0x451f24);if(_0xb175eb[_0x6bcf('0x2f')]>0x0){logger[_0x6bcf('0xf')](_0x6bcf('0x35'),_0xb175eb[0x0]['dataValues']['id'],_0xb175eb[0x0]['dataValues']['ContactId'],_0xb175eb[0x0][_0x6bcf('0x36')][_0x6bcf('0x37')]);}logger[_0x6bcf('0xc')](_0x6bcf('0x27'),_0x451f24,JSON[_0x6bcf('0x1b')](_0xb175eb));_0x5a97b4(_0xb175eb);})['catch'](function(_0x274597){logger[_0x6bcf('0xd')](_0x6bcf('0x27'),_0x274597[_0x6bcf('0xe')],_0x451f24);_0x33b553(_0x5d4e47[_0x6bcf('0xd')](0x1f4,_0x274597['message']));});});});};exports['MoveContactManagedDialer']=function(_0x19f91a){var _0x35db88=this;return new Promise(function(_0x593ce1,_0x4089e6){return db[_0x6bcf('0x38')][_0x6bcf('0x39')](function(_0x39f1ba){return db[_0x6bcf('0x3a')][_0x6bcf('0x1f')](_0x19f91a[_0x6bcf('0x20')],{'raw':_0x19f91a['options']?_0x19f91a[_0x6bcf('0x13')][_0x6bcf('0x14')]===undefined?!![]:![]:!![],'transaction':_0x39f1ba})['then'](function(){logger['info'](_0x6bcf('0x3b'),JSON['stringify'](_0x19f91a['options']['where']),_0x19f91a[_0x6bcf('0x13')]['where'][_0x6bcf('0x37')]);return db['CmHopper'][_0x6bcf('0x26')]({'where':_0x19f91a[_0x6bcf('0x13')]?_0x19f91a[_0x6bcf('0x13')][_0x6bcf('0x23')]||null:null,'transaction':_0x39f1ba});});})['then'](function(_0x2dd55b){logger[_0x6bcf('0xf')](_0x6bcf('0x3c'),_0x19f91a);logger[_0x6bcf('0xc')](_0x6bcf('0x3c'),_0x19f91a,JSON[_0x6bcf('0x1b')](_0x2dd55b));_0x593ce1(_0x2dd55b);})['catch'](function(_0x5f1d35){logger['error'](_0x6bcf('0x3c'),_0x5f1d35['message'],_0x19f91a);_0x4089e6(_0x35db88[_0x6bcf('0xd')](0x1f4,_0x5f1d35['message']));});});};exports['CountReScheduled']=function(_0x26b6e4){var _0x40826a=this;return new Promise(function(_0xb7c936,_0x3c178c){return db[_0x6bcf('0x12')]['findAll']({'raw':_0x26b6e4['options']?_0x26b6e4['options'][_0x6bcf('0x14')]===undefined?!![]:![]:!![],'where':_0x26b6e4[_0x6bcf('0x13')]?_0x26b6e4[_0x6bcf('0x13')][_0x6bcf('0x23')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6bcf('0x38')]['fn']('IF',db['sequelize']['literal'](_0x6bcf('0x3d')+util['format']('\x22%s\x22',moment()['format'](_0x6bcf('0x3e')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x372694){logger[_0x6bcf('0xf')](_0x6bcf('0x3f'),_0x26b6e4);logger[_0x6bcf('0xc')]('CountReScheduled',_0x26b6e4,JSON[_0x6bcf('0x1b')](_0x372694));_0xb7c936(_0x372694);})[_0x6bcf('0x1e')](function(_0x288f2f){logger['error'](_0x6bcf('0x3f'),_0x288f2f['message'],_0x26b6e4);_0x3c178c(_0x40826a[_0x6bcf('0xd')](0x1f4,_0x288f2f[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x40')]=function(_0x182274){var _0x4a5e4d=this;return new Promise(function(_0x5568b9,_0x518470){return db['CmContact'][_0x6bcf('0x29')]()[_0x6bcf('0x1a')](function(_0x204d16){return db[_0x6bcf('0x38')][_0x6bcf('0x39')](function(_0x118e5a){return db[_0x6bcf('0x12')][_0x6bcf('0x41')]({'where':_0x182274[_0x6bcf('0x13')]?_0x182274[_0x6bcf('0x13')][_0x6bcf('0x23')]||null:null,'attributes':_0x182274[_0x6bcf('0x13')]?_0x182274[_0x6bcf('0x13')]['attributes']||null:null,'limit':0x1,'order':_0x182274[_0x6bcf('0x13')]?_0x182274['options'][_0x6bcf('0x2a')]||null:null,'group':db[_0x6bcf('0x12')][_0x6bcf('0x30')],'transaction':_0x118e5a,'lock':_0x118e5a[_0x6bcf('0x42')][_0x6bcf('0x43')],'include':_0x182274['options']?_0x182274[_0x6bcf('0x13')][_0x6bcf('0x17')]?_['map'](_0x182274[_0x6bcf('0x13')][_0x6bcf('0x17')],function(_0x90ad6){return{'model':db[_0x90ad6[_0x6bcf('0x19')]],'as':_0x90ad6['as'],'attributes':_0x90ad6['attributes'],'include':_0x90ad6[_0x6bcf('0x17')]?_['map'](_0x90ad6[_0x6bcf('0x17')],function(_0x40a931){return{'model':db[_0x40a931[_0x6bcf('0x19')]],'as':_0x40a931['as'],'attributes':_0x40a931['attributes'],'include':_0x40a931['include']?_[_0x6bcf('0x18')](_0x40a931[_0x6bcf('0x17')],function(_0x111a31){return{'model':db[_0x111a31[_0x6bcf('0x19')]],'as':_0x111a31['as'],'attributes':_0x111a31[_0x6bcf('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6bcf('0x1a')](function(_0x177c40){var _0x21f78e=[];for(var _0x596449=0x0;_0x596449<_0x177c40[_0x6bcf('0x2f')];_0x596449+=0x1){_0x21f78e['push'](_0x177c40[_0x596449]['update'](_0x182274[_0x6bcf('0x20')],{'transaction':_0x118e5a}));}return BPromise[_0x6bcf('0x34')](_0x21f78e);});})['then'](function(_0x4aa50e){logger[_0x6bcf('0xf')](_0x6bcf('0x40'),_0x182274);logger[_0x6bcf('0xc')]('GetContactRecallMe',_0x182274,JSON[_0x6bcf('0x1b')](_0x4aa50e));_0x5568b9(_0x4aa50e);})[_0x6bcf('0x1e')](function(_0x4c05d3){logger[_0x6bcf('0xd')](_0x6bcf('0x40'),_0x4c05d3[_0x6bcf('0xe')],_0x182274);_0x518470(_0x4a5e4d[_0x6bcf('0xd')](0x1f4,_0x4c05d3[_0x6bcf('0xe')]));});});});};exports[_0x6bcf('0x44')]=function(_0x293852){var _0x3ceffc=this;return new Promise(function(_0x1b7f1c,_0x12ec24){db[_0x6bcf('0x28')][_0x6bcf('0x29')]()[_0x6bcf('0x1a')](function(_0x2885c2){return db[_0x6bcf('0x12')][_0x6bcf('0x41')]({'raw':_0x293852[_0x6bcf('0x13')]?_0x293852[_0x6bcf('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x293852['options']?_0x293852['options'][_0x6bcf('0x23')]||null:null,'attributes':_0x293852[_0x6bcf('0x13')]?_0x293852[_0x6bcf('0x13')]['attributes']||null:null,'limit':_0x293852['options']?_0x293852[_0x6bcf('0x13')][_0x6bcf('0x16')]||null:null,'include':_0x293852[_0x6bcf('0x13')]?_0x293852[_0x6bcf('0x13')][_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0x293852['options'][_0x6bcf('0x17')],function(_0xa41a9){return{'model':db[_0xa41a9[_0x6bcf('0x19')]],'as':_0xa41a9['as'],'attributes':_0xa41a9['as']===_0x6bcf('0x2b')?_['keys'](_0x2885c2):_0xa41a9[_0x6bcf('0x15')],'include':_0xa41a9[_0x6bcf('0x17')]?_[_0x6bcf('0x18')](_0xa41a9['include'],function(_0x26dab9){return{'model':db[_0x26dab9[_0x6bcf('0x19')]],'as':_0x26dab9['as'],'attributes':_0x26dab9[_0x6bcf('0x15')],'include':_0x26dab9[_0x6bcf('0x17')]?_['map'](_0x26dab9[_0x6bcf('0x17')],function(_0x5d79d6){return{'model':db[_0x5d79d6[_0x6bcf('0x19')]],'as':_0x5d79d6['as'],'attributes':_0x5d79d6[_0x6bcf('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c9560){logger[_0x6bcf('0xf')](_0x6bcf('0x11'),_0x293852);logger[_0x6bcf('0xc')](_0x6bcf('0x11'),_0x293852,JSON[_0x6bcf('0x1b')](_0x2c9560));_0x1b7f1c(_0x2c9560);})['catch'](function(_0x35d690){logger[_0x6bcf('0xd')]('GetCmHopper',_0x35d690['message'],_0x293852);_0x12ec24(_0x3ceffc[_0x6bcf('0xd')](0x1f4,_0x35d690['message']));});});});};exports[_0x6bcf('0x45')]=function(_0x2e6295){var _0x193f1f=this;return new Promise(function(_0xc87588,_0x3ba766){return db[_0x6bcf('0x28')][_0x6bcf('0x46')]({'raw':!![],'where':{'phone':_0x2e6295[_0x6bcf('0x13')][_0x6bcf('0x23')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x6bcf('0x47')]]})[_0x6bcf('0x1a')](function(_0x1a1d32){logger[_0x6bcf('0xf')]('getContactByPhone',_0x2e6295);logger[_0x6bcf('0xc')](_0x6bcf('0x48'),_0x2e6295,JSON[_0x6bcf('0x1b')](_0x1a1d32));_0xc87588(_0x1a1d32);})[_0x6bcf('0x1e')](function(_0x1f7b3d){logger['error'](_0x6bcf('0x48'),_0x1f7b3d[_0x6bcf('0xe')],_0x2e6295);_0x3ba766(_0x193f1f['error'](0x1f4,_0x1f7b3d[_0x6bcf('0xe')]));});});};exports[_0x6bcf('0x49')]=function(_0x23ddee){var _0x1b4518=this;return new Promise(function(_0x2af2e2,_0x101084){return db[_0x6bcf('0x38')]['transaction'](function(_0x1e1a85){return db['CmHopper'][_0x6bcf('0x32')]({'active':![]},{'where':{},'transaction':_0x1e1a85})['then'](function(_0x55d5d2){logger['info'](_0x6bcf('0x49'),_0x23ddee);logger[_0x6bcf('0xc')](_0x6bcf('0x49'),_0x23ddee,JSON['stringify'](_0x55d5d2));_0x2af2e2(_0x55d5d2);})[_0x6bcf('0x1e')](function(_0x34094f){logger[_0x6bcf('0xd')](_0x6bcf('0x49'),_0x34094f[_0x6bcf('0xe')],_0x23ddee);_0x101084(_0x1b4518[_0x6bcf('0xd')](0x1f4,_0x34094f[_0x6bcf('0xe')]));});});});};exports[_0x6bcf('0x4a')]=function(_0x377ca9){var _0x3ce75f=this;var _0x290076=_0x377ca9[_0x6bcf('0x20')][_0x6bcf('0x23')]['voiceQueueId'];var _0x50df75=_0x377ca9[_0x6bcf('0x20')]['where'][_0x6bcf('0x4b')];return new Promise(function(_0x108709,_0x2b479b){return db[_0x6bcf('0x12')]['findAll']({'where':{'voiceQueueId':_0x290076,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x6bcf('0x4c')]('NOW()\x20+\x20INTERVAL\x20'+_0x50df75+_0x6bcf('0x4d'))}},'include':[{'model':db[_0x6bcf('0x28')],'as':_0x6bcf('0x2b')},{'model':db[_0x6bcf('0x2d')],'as':_0x6bcf('0x4e'),'attributes':['id',_0x6bcf('0x4f'),_0x6bcf('0x2e')]},{'model':db[_0x6bcf('0x50')],'as':_0x6bcf('0x51')}]})[_0x6bcf('0x1a')](function(_0x1f4f8b){return db[_0x6bcf('0x38')][_0x6bcf('0x39')](function(_0x4cbccb){return db[_0x6bcf('0x12')][_0x6bcf('0x32')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x290076,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x6bcf('0x4c')](_0x6bcf('0x52')+_0x50df75+'\x20MINUTE')}},'transaction':_0x4cbccb})['then'](function(_0xaf5bc3){_0x108709(_0x1f4f8b);})[_0x6bcf('0x1e')](function(_0x2851fa){logger[_0x6bcf('0xd')](_0x6bcf('0x4a'),_0x2851fa['message'],_0x377ca9);_0x2b479b(validateExpressRequest);});});})['catch'](function(_0x464cc7){logger[_0x6bcf('0xd')](_0x6bcf('0x4a'),_0x464cc7[_0x6bcf('0xe')],_0x377ca9);_0x2b479b(_0x3ce75f[_0x6bcf('0xd')](0x1f4,_0x464cc7[_0x6bcf('0xe')]));});});}; \ No newline at end of file +var _0xa6b0=['length','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','sequelize','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','keys','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','\x20MINUTE','CmList','NOW()\x20+\x20INTERVAL\x20','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','attributes','include','model','map','debug','where','ShowCmHopper','CreateCmHopper','create','update','body','limit','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','CmContact','describe','findAll','order','LOCK','UPDATE','Contact','User','Agent','name','voicePause'];(function(_0x451e06,_0x579c2e){var _0x487b7b=function(_0x490e9a){while(--_0x490e9a){_0x451e06['push'](_0x451e06['shift']());}};_0x487b7b(++_0x579c2e);}(_0xa6b0,0x12d));var _0x0a6b=function(_0x5bf77b,_0xcb7e21){_0x5bf77b=_0x5bf77b-0x0;var _0x2557f1=_0xa6b0[_0x5bf77b];return _0x2557f1;};'use strict';var _=require(_0x0a6b('0x0'));var util=require('util');var moment=require(_0x0a6b('0x1'));var BPromise=require(_0x0a6b('0x2'));var rs=require(_0x0a6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a6b('0x4'))['db'];var utils=require(_0x0a6b('0x5'));var logger=require(_0x0a6b('0x6'))('rpc');var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));const {validateExpressRequest}=require(_0x0a6b('0x9'));var client=jayson[_0x0a6b('0xa')][_0x0a6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e0fe4,_0x20b43d,_0xcb2315){return new BPromise(function(_0x43739d,_0x7093f4){return client[_0x0a6b('0xc')](_0x1e0fe4,_0xcb2315)[_0x0a6b('0xd')](function(_0x5b6138){logger[_0x0a6b('0xe')](_0x0a6b('0xf'),_0x20b43d,_0x0a6b('0x10'));logger['debug'](_0x0a6b('0x11'),_0x20b43d,'request\x20sent',JSON[_0x0a6b('0x12')](_0x5b6138));if(_0x5b6138['error']){if(_0x5b6138[_0x0a6b('0x13')][_0x0a6b('0x14')]===0x1f4){logger[_0x0a6b('0x13')]('CmHopper,\x20%s,\x20%s',_0x20b43d,_0x5b6138[_0x0a6b('0x13')][_0x0a6b('0x15')]);return _0x7093f4(_0x5b6138[_0x0a6b('0x13')][_0x0a6b('0x15')]);}logger[_0x0a6b('0x13')](_0x0a6b('0xf'),_0x20b43d,_0x5b6138[_0x0a6b('0x13')][_0x0a6b('0x15')]);return _0x43739d(_0x5b6138[_0x0a6b('0x13')][_0x0a6b('0x15')]);}else{logger[_0x0a6b('0xe')](_0x0a6b('0xf'),_0x20b43d,'request\x20sent');_0x43739d(_0x5b6138[_0x0a6b('0x16')][_0x0a6b('0x15')]);}})[_0x0a6b('0x17')](function(_0x406324){logger[_0x0a6b('0x13')](_0x0a6b('0xf'),_0x20b43d,_0x406324);_0x7093f4(_0x406324);});});}exports[_0x0a6b('0x18')]=function(_0x3aea10){var _0x1abcca=this;return new Promise(function(_0x50f5e5,_0x2a890a){return db[_0x0a6b('0x19')]['findAll']({'raw':_0x3aea10[_0x0a6b('0x1a')]?_0x3aea10[_0x0a6b('0x1a')][_0x0a6b('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aea10[_0x0a6b('0x1a')]?_0x3aea10['options']['where']||null:null,'attributes':_0x3aea10[_0x0a6b('0x1a')]?_0x3aea10['options'][_0x0a6b('0x1c')]||null:null,'limit':_0x3aea10[_0x0a6b('0x1a')]?_0x3aea10[_0x0a6b('0x1a')]['limit']||null:null,'include':_0x3aea10[_0x0a6b('0x1a')]?_0x3aea10[_0x0a6b('0x1a')][_0x0a6b('0x1d')]?_['map'](_0x3aea10['options'][_0x0a6b('0x1d')],function(_0x510dfc){return{'model':db[_0x510dfc[_0x0a6b('0x1e')]],'as':_0x510dfc['as'],'attributes':_0x510dfc[_0x0a6b('0x1c')],'include':_0x510dfc['include']?_[_0x0a6b('0x1f')](_0x510dfc[_0x0a6b('0x1d')],function(_0x346a49){return{'model':db[_0x346a49['model']],'as':_0x346a49['as'],'attributes':_0x346a49['attributes'],'include':_0x346a49[_0x0a6b('0x1d')]?_[_0x0a6b('0x1f')](_0x346a49[_0x0a6b('0x1d')],function(_0x4307a1){return{'model':db[_0x4307a1[_0x0a6b('0x1e')]],'as':_0x4307a1['as'],'attributes':_0x4307a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a6b('0xd')](function(_0x1d8db5){logger[_0x0a6b('0xe')](_0x0a6b('0x18'),_0x3aea10);logger[_0x0a6b('0x20')](_0x0a6b('0x18'),_0x3aea10,JSON['stringify'](_0x1d8db5));_0x50f5e5(_0x1d8db5);})[_0x0a6b('0x17')](function(_0x2a51eb){logger[_0x0a6b('0x13')](_0x0a6b('0x18'),_0x2a51eb['message'],_0x3aea10);_0x2a890a(_0x1abcca[_0x0a6b('0x13')](0x1f4,_0x2a51eb[_0x0a6b('0x15')]));});});};exports['ShowCmHopper']=function(_0x491058){var _0x32e540=this;return new Promise(function(_0x5ca161,_0xcabbba){return db[_0x0a6b('0x19')]['find']({'raw':_0x491058[_0x0a6b('0x1a')]?_0x491058[_0x0a6b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x491058[_0x0a6b('0x1a')]?_0x491058[_0x0a6b('0x1a')][_0x0a6b('0x21')]||null:null,'attributes':_0x491058[_0x0a6b('0x1a')]?_0x491058[_0x0a6b('0x1a')][_0x0a6b('0x1c')]||null:null,'include':_0x491058[_0x0a6b('0x1a')]?_0x491058[_0x0a6b('0x1a')][_0x0a6b('0x1d')]?_[_0x0a6b('0x1f')](_0x491058[_0x0a6b('0x1a')][_0x0a6b('0x1d')],function(_0x4ff27a){return{'model':db[_0x4ff27a[_0x0a6b('0x1e')]],'as':_0x4ff27a['as'],'attributes':_0x4ff27a[_0x0a6b('0x1c')],'include':_0x4ff27a[_0x0a6b('0x1d')]?_[_0x0a6b('0x1f')](_0x4ff27a[_0x0a6b('0x1d')],function(_0x5e1765){return{'model':db[_0x5e1765[_0x0a6b('0x1e')]],'as':_0x5e1765['as'],'attributes':_0x5e1765[_0x0a6b('0x1c')],'include':_0x5e1765[_0x0a6b('0x1d')]?_['map'](_0x5e1765[_0x0a6b('0x1d')],function(_0x23e76){return{'model':db[_0x23e76[_0x0a6b('0x1e')]],'as':_0x23e76['as'],'attributes':_0x23e76[_0x0a6b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0a6b('0xd')](function(_0x5b7365){logger[_0x0a6b('0xe')](_0x0a6b('0x22'),_0x491058);logger['debug']('ShowCmHopper',_0x491058,JSON[_0x0a6b('0x12')](_0x5b7365));_0x5ca161(_0x5b7365);})[_0x0a6b('0x17')](function(_0x46f2c2){logger[_0x0a6b('0x13')]('ShowCmHopper',_0x46f2c2[_0x0a6b('0x15')],_0x491058);_0xcabbba(_0x32e540['error'](0x1f4,_0x46f2c2[_0x0a6b('0x15')]));});});};exports[_0x0a6b('0x23')]=function(_0x2f5aa8){var _0x1c7f63=this;return new Promise(function(_0x5c32e3,_0x17f7bf){return db[_0x0a6b('0x19')][_0x0a6b('0x24')](_0x2f5aa8['body'],{'raw':_0x2f5aa8[_0x0a6b('0x1a')]?_0x2f5aa8[_0x0a6b('0x1a')][_0x0a6b('0x1b')]===undefined?!![]:![]:!![]})[_0x0a6b('0xd')](function(_0x4b6d4b){logger['info'](_0x0a6b('0x23'),_0x2f5aa8);logger[_0x0a6b('0x20')](_0x0a6b('0x23'),_0x2f5aa8,JSON['stringify'](_0x4b6d4b));_0x5c32e3(_0x4b6d4b);})[_0x0a6b('0x17')](function(_0x5259f3){logger['error']('CreateCmHopper',_0x5259f3[_0x0a6b('0x15')],_0x2f5aa8);_0x17f7bf(_0x1c7f63[_0x0a6b('0x13')](0x1f4,_0x5259f3[_0x0a6b('0x15')]));});});};exports['UpdateCmHopper']=function(_0x236999){var _0x15bdfd=this;return new Promise(function(_0x5d0a4a,_0x3964e6){return db[_0x0a6b('0x19')][_0x0a6b('0x25')](_0x236999[_0x0a6b('0x26')],{'raw':_0x236999['options']?_0x236999['options'][_0x0a6b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236999[_0x0a6b('0x1a')]?_0x236999['options'][_0x0a6b('0x21')]||null:null,'attributes':_0x236999[_0x0a6b('0x1a')]?_0x236999['options'][_0x0a6b('0x1c')]||null:null,'limit':_0x236999['options']?_0x236999[_0x0a6b('0x1a')][_0x0a6b('0x27')]||null:null})['then'](function(_0x3a7185){logger[_0x0a6b('0xe')](_0x0a6b('0x28'),_0x236999);logger[_0x0a6b('0xe')](_0x0a6b('0x29'),JSON[_0x0a6b('0x12')](_0x236999[_0x0a6b('0x1a')][_0x0a6b('0x21')]),_0x236999['body']['active']);logger[_0x0a6b('0x20')](_0x0a6b('0x28'),_0x236999,JSON[_0x0a6b('0x12')](_0x3a7185));_0x5d0a4a(_0x3a7185);})[_0x0a6b('0x17')](function(_0x16761e){logger['error']('UpdateCmHopper',_0x16761e[_0x0a6b('0x15')],_0x236999);_0x3964e6(_0x15bdfd['error'](0x1f4,_0x16761e['message']));});});};exports[_0x0a6b('0x2a')]=function(_0x31aed3){var _0x1cb6a7=this;return new Promise(function(_0x34a2cc,_0x24acb1){return db[_0x0a6b('0x19')][_0x0a6b('0x2b')]({'where':_0x31aed3['options']?_0x31aed3['options'][_0x0a6b('0x21')]||null:null})[_0x0a6b('0xd')](function(_0x18e895){logger[_0x0a6b('0xe')](_0x0a6b('0x2a'),_0x31aed3);logger[_0x0a6b('0x20')](_0x0a6b('0x2a'),_0x31aed3,JSON['stringify'](_0x18e895));_0x34a2cc(_0x18e895);})[_0x0a6b('0x17')](function(_0x30f7ed){logger[_0x0a6b('0x13')](_0x0a6b('0x2a'),_0x30f7ed[_0x0a6b('0x15')],_0x31aed3);_0x24acb1(_0x1cb6a7[_0x0a6b('0x13')](0x1f4,_0x30f7ed[_0x0a6b('0x15')]));});});};exports['GetContactDialer']=function(_0x331f9e){var _0x26b411=this;return new Promise(function(_0x5ef5c9,_0x20983f){return db[_0x0a6b('0x2c')][_0x0a6b('0x2d')]()[_0x0a6b('0xd')](function(_0x168193){return db['sequelize']['transaction'](function(_0x19a356){return db[_0x0a6b('0x19')][_0x0a6b('0x2e')]({'where':_0x331f9e[_0x0a6b('0x1a')]?_0x331f9e[_0x0a6b('0x1a')]['where']||null:null,'attributes':_0x331f9e[_0x0a6b('0x1a')]?_0x331f9e['options'][_0x0a6b('0x1c')]||null:null,'limit':_0x331f9e['options']?_0x331f9e[_0x0a6b('0x1a')][_0x0a6b('0x27')]||null:null,'order':_0x331f9e[_0x0a6b('0x1a')]?_0x331f9e[_0x0a6b('0x1a')][_0x0a6b('0x2f')]||null:null,'transaction':_0x19a356,'lock':_0x19a356[_0x0a6b('0x30')][_0x0a6b('0x31')],'include':[{'model':db[_0x0a6b('0x2c')],'as':_0x0a6b('0x32'),'attributes':_['keys'](_0x168193)},{'model':db[_0x0a6b('0x33')],'as':_0x0a6b('0x34'),'attributes':['id',_0x0a6b('0x35'),_0x0a6b('0x36')]}]})['then'](function(_0x3a5095){var _0x258dfc=[];var _0x22f0a0=[];for(var _0x2fb9d7=0x0;_0x2fb9d7<_0x3a5095[_0x0a6b('0x37')];_0x2fb9d7+=0x1){var _0x1d6f72=_0x3a5095[_0x2fb9d7]['UserId'];if(_0x1d6f72===null){_0x258dfc[_0x0a6b('0x38')](_0x3a5095[_0x2fb9d7]['update'](_0x331f9e[_0x0a6b('0x26')],{'transaction':_0x19a356}));}else if(!_0x22f0a0[_0x0a6b('0x39')](_0x1d6f72)){_0x22f0a0['push'](_0x1d6f72);_0x258dfc[_0x0a6b('0x38')](_0x3a5095[_0x2fb9d7]['update'](_0x331f9e['body'],{'transaction':_0x19a356}));}}return BPromise[_0x0a6b('0x3a')](_0x258dfc);});})[_0x0a6b('0xd')](function(_0x200c33){logger[_0x0a6b('0xe')](_0x0a6b('0x3b'),_0x331f9e);if(_0x200c33[_0x0a6b('0x37')]>0x0){logger[_0x0a6b('0xe')](_0x0a6b('0x3c'),_0x200c33[0x0][_0x0a6b('0x3d')]['id'],_0x200c33[0x0][_0x0a6b('0x3d')][_0x0a6b('0x3e')],_0x200c33[0x0][_0x0a6b('0x3d')][_0x0a6b('0x3f')]);}logger[_0x0a6b('0x20')](_0x0a6b('0x3b'),_0x331f9e,JSON['stringify'](_0x200c33));_0x5ef5c9(_0x200c33);})[_0x0a6b('0x17')](function(_0x139a09){logger[_0x0a6b('0x13')](_0x0a6b('0x3b'),_0x139a09[_0x0a6b('0x15')],_0x331f9e);_0x20983f(_0x26b411[_0x0a6b('0x13')](0x1f4,_0x139a09[_0x0a6b('0x15')]));});});});};exports[_0x0a6b('0x40')]=function(_0xf69473){var _0x78fece=this;return new Promise(function(_0x275645,_0xc8c97c){return db[_0x0a6b('0x41')][_0x0a6b('0x42')](function(_0x215a28){return db['CmHopperFinal'][_0x0a6b('0x24')](_0xf69473[_0x0a6b('0x26')],{'raw':_0xf69473[_0x0a6b('0x1a')]?_0xf69473['options'][_0x0a6b('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x215a28})[_0x0a6b('0xd')](function(){logger[_0x0a6b('0xe')](_0x0a6b('0x43'),JSON['stringify'](_0xf69473[_0x0a6b('0x1a')][_0x0a6b('0x21')]),_0xf69473[_0x0a6b('0x1a')]['where'][_0x0a6b('0x3f')]);return db[_0x0a6b('0x19')]['destroy']({'where':_0xf69473[_0x0a6b('0x1a')]?_0xf69473[_0x0a6b('0x1a')][_0x0a6b('0x21')]||null:null,'transaction':_0x215a28});});})[_0x0a6b('0xd')](function(_0x51bcf1){logger[_0x0a6b('0xe')](_0x0a6b('0x40'),_0xf69473);logger[_0x0a6b('0x20')]('MoveContactManagedDialer',_0xf69473,JSON[_0x0a6b('0x12')](_0x51bcf1));_0x275645(_0x51bcf1);})[_0x0a6b('0x17')](function(_0x380021){logger[_0x0a6b('0x13')]('MoveContactManagedDialer',_0x380021[_0x0a6b('0x15')],_0xf69473);_0xc8c97c(_0x78fece['error'](0x1f4,_0x380021[_0x0a6b('0x15')]));});});};exports[_0x0a6b('0x44')]=function(_0x22b0ac){var _0x44f3c4=this;return new Promise(function(_0x3c720d,_0x31a165){return db[_0x0a6b('0x19')][_0x0a6b('0x2e')]({'raw':_0x22b0ac['options']?_0x22b0ac['options'][_0x0a6b('0x1b')]===undefined?!![]:![]:!![],'where':_0x22b0ac[_0x0a6b('0x1a')]?_0x22b0ac['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x0a6b('0x45'),db[_0x0a6b('0x41')]['fn']('IF',db['sequelize'][_0x0a6b('0x46')]('`scheduledat`\x20>=\x20'+util[_0x0a6b('0x47')](_0x0a6b('0x48'),moment()[_0x0a6b('0x47')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x0a6b('0x49')]]})[_0x0a6b('0xd')](function(_0x5bdeba){logger[_0x0a6b('0xe')](_0x0a6b('0x44'),_0x22b0ac);logger['debug'](_0x0a6b('0x44'),_0x22b0ac,JSON[_0x0a6b('0x12')](_0x5bdeba));_0x3c720d(_0x5bdeba);})['catch'](function(_0x30ed86){logger[_0x0a6b('0x13')](_0x0a6b('0x44'),_0x30ed86[_0x0a6b('0x15')],_0x22b0ac);_0x31a165(_0x44f3c4['error'](0x1f4,_0x30ed86[_0x0a6b('0x15')]));});});};exports[_0x0a6b('0x4a')]=function(_0x489b06){var _0x8ef626=this;return new Promise(function(_0x474888,_0x2d1ce1){return db[_0x0a6b('0x2c')][_0x0a6b('0x2d')]()[_0x0a6b('0xd')](function(_0x503535){return db[_0x0a6b('0x41')][_0x0a6b('0x42')](function(_0x4d7fb3){return db[_0x0a6b('0x19')]['findAll']({'where':_0x489b06[_0x0a6b('0x1a')]?_0x489b06[_0x0a6b('0x1a')]['where']||null:null,'attributes':_0x489b06[_0x0a6b('0x1a')]?_0x489b06[_0x0a6b('0x1a')][_0x0a6b('0x1c')]||null:null,'limit':0x1,'order':_0x489b06['options']?_0x489b06[_0x0a6b('0x1a')][_0x0a6b('0x2f')]||null:null,'group':db['CmHopper'][_0x0a6b('0x4b')],'transaction':_0x4d7fb3,'lock':_0x4d7fb3[_0x0a6b('0x30')][_0x0a6b('0x31')],'include':_0x489b06[_0x0a6b('0x1a')]?_0x489b06['options'][_0x0a6b('0x1d')]?_[_0x0a6b('0x1f')](_0x489b06[_0x0a6b('0x1a')][_0x0a6b('0x1d')],function(_0x4c36a1){return{'model':db[_0x4c36a1[_0x0a6b('0x1e')]],'as':_0x4c36a1['as'],'attributes':_0x4c36a1[_0x0a6b('0x1c')],'include':_0x4c36a1[_0x0a6b('0x1d')]?_[_0x0a6b('0x1f')](_0x4c36a1[_0x0a6b('0x1d')],function(_0x468701){return{'model':db[_0x468701[_0x0a6b('0x1e')]],'as':_0x468701['as'],'attributes':_0x468701[_0x0a6b('0x1c')],'include':_0x468701[_0x0a6b('0x1d')]?_['map'](_0x468701['include'],function(_0x4b3672){return{'model':db[_0x4b3672[_0x0a6b('0x1e')]],'as':_0x4b3672['as'],'attributes':_0x4b3672['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15f07b){var _0x4e6ed5=[];for(var _0x3fbfc4=0x0;_0x3fbfc4<_0x15f07b['length'];_0x3fbfc4+=0x1){_0x4e6ed5['push'](_0x15f07b[_0x3fbfc4][_0x0a6b('0x25')](_0x489b06['body'],{'transaction':_0x4d7fb3}));}return BPromise[_0x0a6b('0x3a')](_0x4e6ed5);});})[_0x0a6b('0xd')](function(_0x5b603b){logger[_0x0a6b('0xe')](_0x0a6b('0x4a'),_0x489b06);logger[_0x0a6b('0x20')](_0x0a6b('0x4a'),_0x489b06,JSON[_0x0a6b('0x12')](_0x5b603b));_0x474888(_0x5b603b);})['catch'](function(_0x45aef3){logger['error'](_0x0a6b('0x4a'),_0x45aef3[_0x0a6b('0x15')],_0x489b06);_0x2d1ce1(_0x8ef626[_0x0a6b('0x13')](0x1f4,_0x45aef3[_0x0a6b('0x15')]));});});});};exports[_0x0a6b('0x4c')]=function(_0x493155){var _0x28d3fb=this;return new Promise(function(_0x33d007,_0x498aa2){db['CmContact'][_0x0a6b('0x2d')]()[_0x0a6b('0xd')](function(_0x1515f6){return db[_0x0a6b('0x19')][_0x0a6b('0x2e')]({'raw':_0x493155[_0x0a6b('0x1a')]?_0x493155[_0x0a6b('0x1a')][_0x0a6b('0x1b')]===undefined?!![]:![]:!![],'where':_0x493155[_0x0a6b('0x1a')]?_0x493155['options']['where']||null:null,'attributes':_0x493155[_0x0a6b('0x1a')]?_0x493155['options'][_0x0a6b('0x1c')]||null:null,'limit':_0x493155[_0x0a6b('0x1a')]?_0x493155[_0x0a6b('0x1a')][_0x0a6b('0x27')]||null:null,'include':_0x493155[_0x0a6b('0x1a')]?_0x493155[_0x0a6b('0x1a')]['include']?_[_0x0a6b('0x1f')](_0x493155['options'][_0x0a6b('0x1d')],function(_0x1ac53e){return{'model':db[_0x1ac53e[_0x0a6b('0x1e')]],'as':_0x1ac53e['as'],'attributes':_0x1ac53e['as']===_0x0a6b('0x32')?_[_0x0a6b('0x4d')](_0x1515f6):_0x1ac53e['attributes'],'include':_0x1ac53e[_0x0a6b('0x1d')]?_['map'](_0x1ac53e['include'],function(_0x1a5dc9){return{'model':db[_0x1a5dc9[_0x0a6b('0x1e')]],'as':_0x1a5dc9['as'],'attributes':_0x1a5dc9[_0x0a6b('0x1c')],'include':_0x1a5dc9['include']?_[_0x0a6b('0x1f')](_0x1a5dc9[_0x0a6b('0x1d')],function(_0x45db2a){return{'model':db[_0x45db2a[_0x0a6b('0x1e')]],'as':_0x45db2a['as'],'attributes':_0x45db2a[_0x0a6b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0a6b('0xd')](function(_0x2f50e1){logger[_0x0a6b('0xe')](_0x0a6b('0x18'),_0x493155);logger['debug'](_0x0a6b('0x18'),_0x493155,JSON[_0x0a6b('0x12')](_0x2f50e1));_0x33d007(_0x2f50e1);})['catch'](function(_0x27dbf8){logger[_0x0a6b('0x13')](_0x0a6b('0x18'),_0x27dbf8[_0x0a6b('0x15')],_0x493155);_0x498aa2(_0x28d3fb[_0x0a6b('0x13')](0x1f4,_0x27dbf8[_0x0a6b('0x15')]));});});});};exports['GetContactByPhone']=function(_0x463200){var _0x22b3f9=this;return new Promise(function(_0x43cbcc,_0x486612){return db[_0x0a6b('0x2c')][_0x0a6b('0x4e')]({'raw':!![],'where':{'phone':_0x463200[_0x0a6b('0x1a')][_0x0a6b('0x21')][_0x0a6b('0x4f')]},'attributes':['id',_0x0a6b('0x50')],'order':[['id','DESC']]})[_0x0a6b('0xd')](function(_0x326ef4){logger[_0x0a6b('0xe')](_0x0a6b('0x51'),_0x463200);logger[_0x0a6b('0x20')](_0x0a6b('0x51'),_0x463200,JSON['stringify'](_0x326ef4));_0x43cbcc(_0x326ef4);})[_0x0a6b('0x17')](function(_0x365daa){logger[_0x0a6b('0x13')](_0x0a6b('0x51'),_0x365daa['message'],_0x463200);_0x486612(_0x22b3f9['error'](0x1f4,_0x365daa[_0x0a6b('0x15')]));});});};exports['ResetActiveCalls']=function(_0x1955dd){var _0x2def41=this;return new Promise(function(_0x110116,_0x4d2131){return db[_0x0a6b('0x41')][_0x0a6b('0x42')](function(_0x1e2036){return db['CmHopper']['update']({'active':![]},{'where':{},'transaction':_0x1e2036})[_0x0a6b('0xd')](function(_0x3f5d39){logger[_0x0a6b('0xe')](_0x0a6b('0x52'),_0x1955dd);logger[_0x0a6b('0x20')](_0x0a6b('0x52'),_0x1955dd,JSON[_0x0a6b('0x12')](_0x3f5d39));_0x110116(_0x3f5d39);})[_0x0a6b('0x17')](function(_0x3621a4){logger[_0x0a6b('0x13')]('ResetActiveCalls',_0x3621a4[_0x0a6b('0x15')],_0x1955dd);_0x4d2131(_0x2def41[_0x0a6b('0x13')](0x1f4,_0x3621a4[_0x0a6b('0x15')]));});});});};exports[_0x0a6b('0x53')]=function(_0x55cfb6){var _0x44f5b7=this;var _0x4c7b0e=_0x55cfb6[_0x0a6b('0x26')][_0x0a6b('0x21')][_0x0a6b('0x54')];var _0x5d3a55=_0x55cfb6[_0x0a6b('0x26')][_0x0a6b('0x21')][_0x0a6b('0x55')];return new Promise(function(_0x2cd1ef,_0x376380){return db[_0x0a6b('0x19')]['findAll']({'where':{'voiceQueueId':_0x4c7b0e,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x0a6b('0x41')][_0x0a6b('0x46')]('NOW()\x20+\x20INTERVAL\x20'+_0x5d3a55+_0x0a6b('0x56'))}},'include':[{'model':db[_0x0a6b('0x2c')],'as':_0x0a6b('0x32')},{'model':db[_0x0a6b('0x33')],'as':_0x0a6b('0x34'),'attributes':['id',_0x0a6b('0x35'),_0x0a6b('0x36')]},{'model':db[_0x0a6b('0x57')],'as':'List'}]})[_0x0a6b('0xd')](function(_0x85609b){return db[_0x0a6b('0x41')][_0x0a6b('0x42')](function(_0x1a6f6a){return db[_0x0a6b('0x19')][_0x0a6b('0x25')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4c7b0e,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x0a6b('0x41')][_0x0a6b('0x46')](_0x0a6b('0x58')+_0x5d3a55+'\x20MINUTE')}},'transaction':_0x1a6f6a})[_0x0a6b('0xd')](function(_0x29a9db){_0x2cd1ef(_0x85609b);})['catch'](function(_0x29fff8){logger[_0x0a6b('0x13')](_0x0a6b('0x53'),_0x29fff8[_0x0a6b('0x15')],_0x55cfb6);_0x376380(validateExpressRequest);});});})[_0x0a6b('0x17')](function(_0x5e689b){logger['error'](_0x0a6b('0x53'),_0x5e689b['message'],_0x55cfb6);_0x376380(_0x44f5b7[_0x0a6b('0x13')](0x1f4,_0x5e689b['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b296d19..bd3af5a 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 _0x14ca=['express','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','getTimezones','show','post','create','/preview','/timezone','getTimezone','/previewrecall','getPreviewRecall','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1f60d1,_0xaa73d2){var _0x24c066=function(_0x4ac80e){while(--_0x4ac80e){_0x1f60d1['push'](_0x1f60d1['shift']());}};_0x24c066(++_0xaa73d2);}(_0x14ca,0x158));var _0xa14c=function(_0x4665b8,_0x234a28){_0x4665b8=_0x4665b8-0x0;var _0x54ba4c=_0x14ca[_0x4665b8];return _0x54ba4c;};'use strict';var multer=require(_0xa14c('0x0'));var util=require(_0xa14c('0x1'));var path=require(_0xa14c('0x2'));var timeout=require(_0xa14c('0x3'));var express=require(_0xa14c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa14c('0x5'));var config=require(_0xa14c('0x6'));var controller=require(_0xa14c('0x7'));router[_0xa14c('0x8')]('/',auth[_0xa14c('0x9')](),controller[_0xa14c('0xa')]);router['get'](_0xa14c('0xb'),auth[_0xa14c('0x9')](),controller[_0xa14c('0xc')]);router['get'](_0xa14c('0xd'),auth[_0xa14c('0x9')](),controller['getOpenContacts']);router[_0xa14c('0x8')](_0xa14c('0xe'),auth[_0xa14c('0x9')](),controller[_0xa14c('0xf')]);router[_0xa14c('0x8')]('/:id',auth[_0xa14c('0x9')](),controller[_0xa14c('0x10')]);router[_0xa14c('0x11')]('/',auth[_0xa14c('0x9')](),controller[_0xa14c('0x12')]);router[_0xa14c('0x11')](_0xa14c('0x13'),auth[_0xa14c('0x9')](),controller['getPreview']);router[_0xa14c('0x11')](_0xa14c('0x14'),auth[_0xa14c('0x9')](),controller[_0xa14c('0x15')]);router[_0xa14c('0x11')](_0xa14c('0x16'),auth['isAuthenticated'](),controller[_0xa14c('0x17')]);router[_0xa14c('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa14c('0x19')](_0xa14c('0x1a'),auth['isAuthenticated'](),controller[_0xa14c('0x1b')]);module[_0xa14c('0x1c')]=router; \ No newline at end of file +var _0x4c2e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','getTimezones','show','post','/preview','/timezone','getTimezone','/previewrecall','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x19ef2b,_0x354f66){var _0x4df537=function(_0x576738){while(--_0x576738){_0x19ef2b['push'](_0x19ef2b['shift']());}};_0x4df537(++_0x354f66);}(_0x4c2e,0xfe));var _0xe4c2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4c2e[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xe4c2('0x0'));var util=require('util');var path=require(_0xe4c2('0x1'));var timeout=require(_0xe4c2('0x2'));var express=require(_0xe4c2('0x3'));var router=express[_0xe4c2('0x4')]();var fs_extra=require(_0xe4c2('0x5'));var auth=require(_0xe4c2('0x6'));var interaction=require(_0xe4c2('0x7'));var config=require(_0xe4c2('0x8'));var controller=require(_0xe4c2('0x9'));router[_0xe4c2('0xa')]('/',auth[_0xe4c2('0xb')](),controller['index']);router['get'](_0xe4c2('0xc'),auth[_0xe4c2('0xb')](),controller['describe']);router[_0xe4c2('0xa')](_0xe4c2('0xd'),auth[_0xe4c2('0xb')](),controller['getOpenContacts']);router[_0xe4c2('0xa')]('/timezones',auth['isAuthenticated'](),controller[_0xe4c2('0xe')]);router[_0xe4c2('0xa')]('/:id',auth[_0xe4c2('0xb')](),controller[_0xe4c2('0xf')]);router[_0xe4c2('0x10')]('/',auth[_0xe4c2('0xb')](),controller['create']);router[_0xe4c2('0x10')](_0xe4c2('0x11'),auth['isAuthenticated'](),controller['getPreview']);router[_0xe4c2('0x10')](_0xe4c2('0x12'),auth[_0xe4c2('0xb')](),controller[_0xe4c2('0x13')]);router[_0xe4c2('0x10')](_0xe4c2('0x14'),auth[_0xe4c2('0xb')](),controller['getPreviewRecall']);router['put'](_0xe4c2('0x15'),auth[_0xe4c2('0xb')](),controller[_0xe4c2('0x16')]);router[_0xe4c2('0x17')](_0xe4c2('0x15'),auth[_0xe4c2('0xb')](),controller[_0xe4c2('0x18')]);module[_0xe4c2('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 1758ef0..6a38a2d 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 _0x1560=['contactListQueue','moment','exports','STRING','INTEGER'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x1560,0x155));var _0x0156=function(_0x159e9a,_0x1953dd){_0x159e9a=_0x159e9a-0x0;var _0x5babf2=_0x1560[_0x159e9a];return _0x5babf2;};'use strict';var moment=require(_0x0156('0x0'));var Sequelize=require('sequelize');module[_0x0156('0x1')]={'phone':{'type':Sequelize[_0x0156('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0156('0x3')],'unique':_0x0156('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x0156('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0156('0x3')],'unique':_0x0156('0x4')}}; \ No newline at end of file +var _0xfa23=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0xfa23,0x1d5));var _0x3fa2=function(_0x196792,_0x5b9f89){_0x196792=_0x196792-0x0;var _0x2f8d8c=_0xfa23[_0x196792];return _0x2f8d8c;};'use strict';var moment=require(_0x3fa2('0x0'));var Sequelize=require('sequelize');module[_0x3fa2('0x1')]={'phone':{'type':Sequelize[_0x3fa2('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3fa2('0x3')],'unique':_0x3fa2('0x4')},'ListId':{'type':Sequelize[_0x3fa2('0x3')],'unique':_0x3fa2('0x4')},'VoiceQueueId':{'type':Sequelize[_0x3fa2('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 1cf1928..4bb71bd 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 _0x4817=['keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','options','includeAll','rows','catch','show','include','find','body','params','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','destroy','then','end','name','index','map','CmHopperBlack','rawAttributes','type','key','model','query'];(function(_0x1e4535,_0x37cf32){var _0x4d8658=function(_0x15509a){while(--_0x15509a){_0x1e4535['push'](_0x1e4535['shift']());}};_0x4d8658(++_0x37cf32);}(_0x4817,0x11b));var _0x7481=function(_0x5401e7,_0x399409){_0x5401e7=_0x5401e7-0x0;var _0x30ffca=_0x4817[_0x5401e7];return _0x30ffca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7481('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7481('0x1'));var moment=require('moment');var BPromise=require(_0x7481('0x2'));var Mustache=require('mustache');var util=require(_0x7481('0x3'));var path=require(_0x7481('0x4'));var sox=require(_0x7481('0x5'));var csv=require(_0x7481('0x6'));var ejs=require(_0x7481('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7481('0x8'));var squel=require(_0x7481('0x9'));var crypto=require(_0x7481('0xa'));var jsforce=require(_0x7481('0xb'));var deskjs=require(_0x7481('0xc'));var toCsv=require(_0x7481('0x6'));var querystring=require(_0x7481('0xd'));var Papa=require(_0x7481('0xe'));var Redis=require('ioredis');var authService=require(_0x7481('0xf'));var qs=require(_0x7481('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7481('0x11'));var logger=require(_0x7481('0x12'))(_0x7481('0x13'));var utils=require(_0x7481('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7481('0x15'));var db=require(_0x7481('0x16'))['db'];function respondWithStatusCode(_0x1581cf,_0x541a66){_0x541a66=_0x541a66||0xcc;return function(_0x2d35ba){if(_0x2d35ba){return _0x1581cf[_0x7481('0x17')](_0x541a66);}return _0x1581cf[_0x7481('0x18')](_0x541a66)['end']();};}function respondWithResult(_0x4c2a6f,_0x2023b2){_0x2023b2=_0x2023b2||0xc8;return function(_0x475869){if(_0x475869){return _0x4c2a6f[_0x7481('0x18')](_0x2023b2)[_0x7481('0x19')](_0x475869);}};}function respondWithFilteredResult(_0x5d0e10,_0x153803){return function(_0xf79ef4){if(_0xf79ef4){var _0x26cdf3=typeof _0x153803['offset']==='undefined'&&typeof _0x153803[_0x7481('0x1a')]===_0x7481('0x1b');var _0x152cdd=_0xf79ef4[_0x7481('0x1c')];var _0x351ef7=_0x26cdf3?0x0:_0x153803[_0x7481('0x1d')];var _0x35e64d=_0x26cdf3?_0xf79ef4[_0x7481('0x1c')]:_0x153803['offset']+_0x153803[_0x7481('0x1a')];var _0x41ec3c;if(_0x35e64d>=_0x152cdd){_0x35e64d=_0x152cdd;_0x41ec3c=0xc8;}else{_0x41ec3c=0xce;}_0x5d0e10[_0x7481('0x18')](_0x41ec3c);return _0x5d0e10[_0x7481('0x1e')]('Content-Range',_0x351ef7+'-'+_0x35e64d+'/'+_0x152cdd)[_0x7481('0x19')](_0xf79ef4);}return null;};}function patchUpdates(_0x3e0337){return function(_0x5df443){try{jsonpatch[_0x7481('0x1f')](_0x5df443,_0x3e0337,!![]);}catch(_0x143f87){return BPromise[_0x7481('0x20')](_0x143f87);}return _0x5df443[_0x7481('0x21')]();};}function saveUpdates(_0x3f8f44,_0x57fdc2){return function(_0x536000){if(_0x536000){return _0x536000[_0x7481('0x22')](_0x3f8f44)['then'](function(_0x33e490){return _0x33e490;});}return null;};}function removeEntity(_0x367e13,_0x6e65cf){return function(_0x358c53){if(_0x358c53){return _0x358c53[_0x7481('0x23')]()[_0x7481('0x24')](function(){_0x367e13[_0x7481('0x18')](0xcc)[_0x7481('0x25')]();});}};}function handleEntityNotFound(_0x46ecf0,_0x3eb364){return function(_0x39fa23){if(!_0x39fa23){_0x46ecf0[_0x7481('0x17')](0x194);}return _0x39fa23;};}function handleError(_0x17e5a7,_0x4cbf87){_0x4cbf87=_0x4cbf87||0x1f4;return function(_0x24de03){logger['error'](_0x24de03['stack']);if(_0x24de03[_0x7481('0x26')]){delete _0x24de03[_0x7481('0x26')];}_0x17e5a7[_0x7481('0x18')](_0x4cbf87)['send'](_0x24de03);};}exports[_0x7481('0x27')]=function(_0x175ff7,_0x3d3c75){var _0x3ebb01={},_0x3a816e={},_0x522399={'count':0x0,'rows':[]};var _0x178e7a=_[_0x7481('0x28')](db[_0x7481('0x29')][_0x7481('0x2a')],function(_0xb4a3e0){return{'name':_0xb4a3e0['fieldName'],'type':_0xb4a3e0[_0x7481('0x2b')][_0x7481('0x2c')]};});_0x3a816e[_0x7481('0x2d')]=_[_0x7481('0x28')](_0x178e7a,_0x7481('0x26'));_0x3a816e[_0x7481('0x2e')]=_[_0x7481('0x2f')](_0x175ff7['query']);_0x3a816e[_0x7481('0x30')]=_[_0x7481('0x31')](_0x3a816e['model'],_0x3a816e[_0x7481('0x2e')]);_0x3ebb01[_0x7481('0x32')]=_['intersection'](_0x3a816e['model'],qs['fields'](_0x175ff7[_0x7481('0x2e')][_0x7481('0x33')]));_0x3ebb01['attributes']=_0x3ebb01[_0x7481('0x32')][_0x7481('0x34')]?_0x3ebb01[_0x7481('0x32')]:_0x3a816e[_0x7481('0x2d')];if(!_0x175ff7['query']['hasOwnProperty'](_0x7481('0x35'))){_0x3ebb01['limit']=qs[_0x7481('0x1a')](_0x175ff7[_0x7481('0x2e')][_0x7481('0x1a')]);_0x3ebb01[_0x7481('0x1d')]=qs[_0x7481('0x1d')](_0x175ff7['query'][_0x7481('0x1d')]);}_0x3ebb01['order']=qs['sort'](_0x175ff7[_0x7481('0x2e')][_0x7481('0x36')]);_0x3ebb01[_0x7481('0x37')]=qs['filters'](_['pick'](_0x175ff7['query'],_0x3a816e[_0x7481('0x30')]),_0x178e7a);if(_0x175ff7[_0x7481('0x2e')][_0x7481('0x38')]){_0x3ebb01['where']=_['merge'](_0x3ebb01[_0x7481('0x37')],{'$or':_[_0x7481('0x28')](_0x178e7a,function(_0x167a03){if(_0x167a03[_0x7481('0x2b')]!=='VIRTUAL'){var _0x5d692b={};_0x5d692b[_0x167a03[_0x7481('0x26')]]={'$like':'%'+_0x175ff7[_0x7481('0x2e')]['filter']+'%'};return _0x5d692b;}})});}_0x3ebb01=_['merge']({},_0x3ebb01,_0x175ff7[_0x7481('0x39')]);var _0x1d846f={'where':_0x3ebb01['where']};return db[_0x7481('0x29')][_0x7481('0x1c')](_0x1d846f)[_0x7481('0x24')](function(_0x29272b){_0x522399[_0x7481('0x1c')]=_0x29272b;if(_0x175ff7[_0x7481('0x2e')][_0x7481('0x3a')]){_0x3ebb01['include']=[{'all':!![]}];}return db[_0x7481('0x29')]['findAll'](_0x3ebb01);})[_0x7481('0x24')](function(_0x472e18){_0x522399[_0x7481('0x3b')]=_0x472e18;return _0x522399;})[_0x7481('0x24')](respondWithFilteredResult(_0x3d3c75,_0x3ebb01))[_0x7481('0x3c')](handleError(_0x3d3c75,null));};exports[_0x7481('0x3d')]=function(_0x56552b,_0x3a9288){var _0xa7a613={'raw':!![],'where':{'id':_0x56552b['params']['id']}},_0x2bace3={};_0x2bace3[_0x7481('0x2d')]=_[_0x7481('0x2f')](db[_0x7481('0x29')][_0x7481('0x2a')]);_0x2bace3[_0x7481('0x2e')]=_[_0x7481('0x2f')](_0x56552b[_0x7481('0x2e')]);_0x2bace3[_0x7481('0x30')]=_[_0x7481('0x31')](_0x2bace3[_0x7481('0x2d')],_0x2bace3[_0x7481('0x2e')]);_0xa7a613[_0x7481('0x32')]=_[_0x7481('0x31')](_0x2bace3[_0x7481('0x2d')],qs[_0x7481('0x33')](_0x56552b[_0x7481('0x2e')][_0x7481('0x33')]));_0xa7a613['attributes']=_0xa7a613[_0x7481('0x32')][_0x7481('0x34')]?_0xa7a613[_0x7481('0x32')]:_0x2bace3[_0x7481('0x2d')];if(_0x56552b[_0x7481('0x2e')][_0x7481('0x3a')]){_0xa7a613[_0x7481('0x3e')]=[{'all':!![]}];}_0xa7a613=_['merge']({},_0xa7a613,_0x56552b[_0x7481('0x39')]);return db[_0x7481('0x29')][_0x7481('0x3f')](_0xa7a613)[_0x7481('0x24')](handleEntityNotFound(_0x3a9288,null))[_0x7481('0x24')](respondWithResult(_0x3a9288,null))[_0x7481('0x3c')](handleError(_0x3a9288,null));};exports[_0x7481('0x22')]=function(_0x1acf0a,_0x4f9d1b){if(_0x1acf0a[_0x7481('0x40')]['id']){delete _0x1acf0a['body']['id'];}return db[_0x7481('0x29')][_0x7481('0x3f')]({'where':{'id':_0x1acf0a[_0x7481('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f9d1b,null))['then'](saveUpdates(_0x1acf0a[_0x7481('0x40')],null))['then'](respondWithResult(_0x4f9d1b,null))['catch'](handleError(_0x4f9d1b,null));};exports['destroy']=function(_0x31d977,_0x291df6){return db[_0x7481('0x29')]['find']({'where':{'id':_0x31d977[_0x7481('0x41')]['id']}})[_0x7481('0x24')](handleEntityNotFound(_0x291df6,null))[_0x7481('0x24')](removeEntity(_0x291df6,null))[_0x7481('0x3c')](handleError(_0x291df6,null));};exports['describe']=function(_0xe573cc,_0x1755ca){return db['CmHopperBlack']['describe']()[_0x7481('0x24')](respondWithResult(_0x1755ca,null))[_0x7481('0x3c')](handleError(_0x1755ca,null));}; \ No newline at end of file +var _0xd5f7=['rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0xd5f7,0x13b));var _0x7d5f=function(_0x375494,_0x3a9886){_0x375494=_0x375494-0x0;var _0x57913d=_0xd5f7[_0x375494];return _0x57913d;};'use strict';var emlformat=require(_0x7d5f('0x0'));var rimraf=require(_0x7d5f('0x1'));var zipdir=require(_0x7d5f('0x2'));var jsonpatch=require(_0x7d5f('0x3'));var rp=require('request-promise');var moment=require(_0x7d5f('0x4'));var BPromise=require(_0x7d5f('0x5'));var Mustache=require(_0x7d5f('0x6'));var util=require(_0x7d5f('0x7'));var path=require(_0x7d5f('0x8'));var sox=require(_0x7d5f('0x9'));var csv=require(_0x7d5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d5f('0xb'));var _=require(_0x7d5f('0xc'));var squel=require(_0x7d5f('0xd'));var crypto=require('crypto');var jsforce=require(_0x7d5f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7d5f('0xa'));var querystring=require(_0x7d5f('0xf'));var Papa=require('papaparse');var Redis=require(_0x7d5f('0x10'));var authService=require(_0x7d5f('0x11'));var qs=require(_0x7d5f('0x12'));var as=require(_0x7d5f('0x13'));var hardwareService=require(_0x7d5f('0x14'));var logger=require('../../config/logger')(_0x7d5f('0x15'));var utils=require('../../config/utils');var config=require(_0x7d5f('0x16'));var licenseUtil=require(_0x7d5f('0x17'));var db=require(_0x7d5f('0x18'))['db'];function respondWithStatusCode(_0x56efdf,_0x56b900){_0x56b900=_0x56b900||0xcc;return function(_0x414c82){if(_0x414c82){return _0x56efdf[_0x7d5f('0x19')](_0x56b900);}return _0x56efdf[_0x7d5f('0x1a')](_0x56b900)['end']();};}function respondWithResult(_0x593f59,_0xd64d6a){_0xd64d6a=_0xd64d6a||0xc8;return function(_0x3139ab){if(_0x3139ab){return _0x593f59[_0x7d5f('0x1a')](_0xd64d6a)[_0x7d5f('0x1b')](_0x3139ab);}};}function respondWithFilteredResult(_0x2f067a,_0x151ec7){return function(_0x213d20){if(_0x213d20){var _0x5e54df=typeof _0x151ec7[_0x7d5f('0x1c')]===_0x7d5f('0x1d')&&typeof _0x151ec7[_0x7d5f('0x1e')]===_0x7d5f('0x1d');var _0x4f8473=_0x213d20[_0x7d5f('0x1f')];var _0x16ebd1=_0x5e54df?0x0:_0x151ec7['offset'];var _0x542d1f=_0x5e54df?_0x213d20['count']:_0x151ec7['offset']+_0x151ec7[_0x7d5f('0x1e')];var _0xadfa54;if(_0x542d1f>=_0x4f8473){_0x542d1f=_0x4f8473;_0xadfa54=0xc8;}else{_0xadfa54=0xce;}_0x2f067a['status'](_0xadfa54);return _0x2f067a[_0x7d5f('0x20')]('Content-Range',_0x16ebd1+'-'+_0x542d1f+'/'+_0x4f8473)[_0x7d5f('0x1b')](_0x213d20);}return null;};}function patchUpdates(_0x51c6b1){return function(_0x31befd){try{jsonpatch[_0x7d5f('0x21')](_0x31befd,_0x51c6b1,!![]);}catch(_0x3498ec){return BPromise[_0x7d5f('0x22')](_0x3498ec);}return _0x31befd[_0x7d5f('0x23')]();};}function saveUpdates(_0x30791a,_0x18d9dc){return function(_0x4f0351){if(_0x4f0351){return _0x4f0351[_0x7d5f('0x24')](_0x30791a)[_0x7d5f('0x25')](function(_0x47a491){return _0x47a491;});}return null;};}function removeEntity(_0x57aa06,_0x1e34b5){return function(_0xa08cec){if(_0xa08cec){return _0xa08cec[_0x7d5f('0x26')]()['then'](function(){_0x57aa06['status'](0xcc)[_0x7d5f('0x27')]();});}};}function handleEntityNotFound(_0x2632c5,_0x52d4dc){return function(_0x24ff80){if(!_0x24ff80){_0x2632c5[_0x7d5f('0x19')](0x194);}return _0x24ff80;};}function handleError(_0x4fd7d0,_0x127911){_0x127911=_0x127911||0x1f4;return function(_0x3099b3){logger[_0x7d5f('0x28')](_0x3099b3[_0x7d5f('0x29')]);if(_0x3099b3[_0x7d5f('0x2a')]){delete _0x3099b3[_0x7d5f('0x2a')];}_0x4fd7d0[_0x7d5f('0x1a')](_0x127911)[_0x7d5f('0x2b')](_0x3099b3);};}exports[_0x7d5f('0x2c')]=function(_0x1d2e86,_0x19dc86){var _0x3955fa={},_0x4f58e4={},_0x2d331d={'count':0x0,'rows':[]};var _0x316bf4=_[_0x7d5f('0x2d')](db[_0x7d5f('0x2e')][_0x7d5f('0x2f')],function(_0x5a3a33){return{'name':_0x5a3a33[_0x7d5f('0x30')],'type':_0x5a3a33[_0x7d5f('0x31')]['key']};});_0x4f58e4[_0x7d5f('0x32')]=_['map'](_0x316bf4,_0x7d5f('0x2a'));_0x4f58e4[_0x7d5f('0x33')]=_[_0x7d5f('0x34')](_0x1d2e86['query']);_0x4f58e4[_0x7d5f('0x35')]=_[_0x7d5f('0x36')](_0x4f58e4[_0x7d5f('0x32')],_0x4f58e4[_0x7d5f('0x33')]);_0x3955fa['attributes']=_[_0x7d5f('0x36')](_0x4f58e4['model'],qs[_0x7d5f('0x37')](_0x1d2e86['query'][_0x7d5f('0x37')]));_0x3955fa[_0x7d5f('0x38')]=_0x3955fa[_0x7d5f('0x38')][_0x7d5f('0x39')]?_0x3955fa[_0x7d5f('0x38')]:_0x4f58e4[_0x7d5f('0x32')];if(!_0x1d2e86[_0x7d5f('0x33')][_0x7d5f('0x3a')](_0x7d5f('0x3b'))){_0x3955fa['limit']=qs[_0x7d5f('0x1e')](_0x1d2e86[_0x7d5f('0x33')][_0x7d5f('0x1e')]);_0x3955fa[_0x7d5f('0x1c')]=qs['offset'](_0x1d2e86[_0x7d5f('0x33')][_0x7d5f('0x1c')]);}_0x3955fa[_0x7d5f('0x3c')]=qs[_0x7d5f('0x3d')](_0x1d2e86[_0x7d5f('0x33')][_0x7d5f('0x3d')]);_0x3955fa[_0x7d5f('0x3e')]=qs[_0x7d5f('0x35')](_[_0x7d5f('0x3f')](_0x1d2e86[_0x7d5f('0x33')],_0x4f58e4[_0x7d5f('0x35')]),_0x316bf4);if(_0x1d2e86[_0x7d5f('0x33')][_0x7d5f('0x40')]){_0x3955fa[_0x7d5f('0x3e')]=_[_0x7d5f('0x41')](_0x3955fa[_0x7d5f('0x3e')],{'$or':_[_0x7d5f('0x2d')](_0x316bf4,function(_0x233b5d){if(_0x233b5d['type']!==_0x7d5f('0x42')){var _0x1ce4fe={};_0x1ce4fe[_0x233b5d[_0x7d5f('0x2a')]]={'$like':'%'+_0x1d2e86[_0x7d5f('0x33')]['filter']+'%'};return _0x1ce4fe;}})});}_0x3955fa=_[_0x7d5f('0x41')]({},_0x3955fa,_0x1d2e86[_0x7d5f('0x43')]);var _0x17a740={'where':_0x3955fa['where']};return db[_0x7d5f('0x2e')]['count'](_0x17a740)[_0x7d5f('0x25')](function(_0x5120e6){_0x2d331d['count']=_0x5120e6;if(_0x1d2e86['query'][_0x7d5f('0x44')]){_0x3955fa['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x7d5f('0x45')](_0x3955fa);})[_0x7d5f('0x25')](function(_0x4a8ff1){_0x2d331d[_0x7d5f('0x46')]=_0x4a8ff1;return _0x2d331d;})[_0x7d5f('0x25')](respondWithFilteredResult(_0x19dc86,_0x3955fa))[_0x7d5f('0x47')](handleError(_0x19dc86,null));};exports[_0x7d5f('0x48')]=function(_0x1b8e1c,_0x465fd4){var _0x24a414={'raw':!![],'where':{'id':_0x1b8e1c['params']['id']}},_0x59e785={};_0x59e785['model']=_['keys'](db['CmHopperBlack'][_0x7d5f('0x2f')]);_0x59e785['query']=_[_0x7d5f('0x34')](_0x1b8e1c[_0x7d5f('0x33')]);_0x59e785[_0x7d5f('0x35')]=_[_0x7d5f('0x36')](_0x59e785[_0x7d5f('0x32')],_0x59e785['query']);_0x24a414[_0x7d5f('0x38')]=_['intersection'](_0x59e785[_0x7d5f('0x32')],qs[_0x7d5f('0x37')](_0x1b8e1c[_0x7d5f('0x33')][_0x7d5f('0x37')]));_0x24a414[_0x7d5f('0x38')]=_0x24a414[_0x7d5f('0x38')][_0x7d5f('0x39')]?_0x24a414['attributes']:_0x59e785[_0x7d5f('0x32')];if(_0x1b8e1c[_0x7d5f('0x33')]['includeAll']){_0x24a414['include']=[{'all':!![]}];}_0x24a414=_['merge']({},_0x24a414,_0x1b8e1c[_0x7d5f('0x43')]);return db[_0x7d5f('0x2e')][_0x7d5f('0x49')](_0x24a414)[_0x7d5f('0x25')](handleEntityNotFound(_0x465fd4,null))['then'](respondWithResult(_0x465fd4,null))[_0x7d5f('0x47')](handleError(_0x465fd4,null));};exports['update']=function(_0x2381de,_0x4f73af){if(_0x2381de[_0x7d5f('0x4a')]['id']){delete _0x2381de['body']['id'];}return db[_0x7d5f('0x2e')]['find']({'where':{'id':_0x2381de[_0x7d5f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f73af,null))[_0x7d5f('0x25')](saveUpdates(_0x2381de[_0x7d5f('0x4a')],null))['then'](respondWithResult(_0x4f73af,null))[_0x7d5f('0x47')](handleError(_0x4f73af,null));};exports['destroy']=function(_0x1d6c8b,_0x144b2a){return db[_0x7d5f('0x2e')][_0x7d5f('0x49')]({'where':{'id':_0x1d6c8b['params']['id']}})[_0x7d5f('0x25')](handleEntityNotFound(_0x144b2a,null))[_0x7d5f('0x25')](removeEntity(_0x144b2a,null))[_0x7d5f('0x47')](handleError(_0x144b2a,null));};exports[_0x7d5f('0x4c')]=function(_0xd7015e,_0x41d26b){return db['CmHopperBlack'][_0x7d5f('0x4c')]()[_0x7d5f('0x25')](respondWithResult(_0x41d26b,null))[_0x7d5f('0x47')](handleError(_0x41d26b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 934a4a2..ed8f40c 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 _0x753f=['../../config/logger','request-promise','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x13a3cb,_0x3373fc){var _0x293f42=function(_0x381779){while(--_0x381779){_0x13a3cb['push'](_0x13a3cb['shift']());}};_0x293f42(++_0x3373fc);}(_0x753f,0x10c));var _0xf753=function(_0x430c31,_0x1fd750){_0x430c31=_0x430c31-0x0;var _0x413fce=_0x753f[_0x430c31];return _0x413fce;};'use strict';var _=require(_0xf753('0x0'));var util=require(_0xf753('0x1'));var logger=require(_0xf753('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf753('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf753('0x4'));var attributes=require('./cmHopperBlack.attributes');module[_0xf753('0x5')]=function(_0x14ff00,_0x55dc21){return _0x14ff00[_0xf753('0x6')](_0xf753('0x7'),attributes,{'tableName':_0xf753('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7faa=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xb14011,_0x505c7a){var _0xb71e31=function(_0x5535bc){while(--_0x5535bc){_0xb14011['push'](_0xb14011['shift']());}};_0xb71e31(++_0x505c7a);}(_0x7faa,0x105));var _0xa7fa=function(_0x31cfcd,_0x5e813e){_0x31cfcd=_0x31cfcd-0x0;var _0xf6b0bb=_0x7faa[_0x31cfcd];return _0xf6b0bb;};'use strict';var _=require(_0xa7fa('0x0'));var util=require(_0xa7fa('0x1'));var logger=require(_0xa7fa('0x2'))(_0xa7fa('0x3'));var moment=require(_0xa7fa('0x4'));var BPromise=require(_0xa7fa('0x5'));var rp=require(_0xa7fa('0x6'));var fs=require('fs');var path=require(_0xa7fa('0x7'));var rimraf=require(_0xa7fa('0x8'));var config=require(_0xa7fa('0x9'));var attributes=require(_0xa7fa('0xa'));module[_0xa7fa('0xb')]=function(_0x562bd8,_0x58f4e5){return _0x562bd8[_0xa7fa('0xc')](_0xa7fa('0xd'),attributes,{'tableName':_0xa7fa('0xe'),'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 ddcbf91..a67c321 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 _0x66b2=['result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','model','attributes','include','then','catch','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x7af40d,_0x40a7c2){var _0x2f20a7=function(_0x25116b){while(--_0x25116b){_0x7af40d['push'](_0x7af40d['shift']());}};_0x2f20a7(++_0x40a7c2);}(_0x66b2,0x1d5));var _0x266b=function(_0x43bd62,_0x107420){_0x43bd62=_0x43bd62-0x0;var _0x22321c=_0x66b2[_0x43bd62];return _0x22321c;};'use strict';var _=require(_0x266b('0x0'));var util=require(_0x266b('0x1'));var moment=require(_0x266b('0x2'));var BPromise=require(_0x266b('0x3'));var rs=require(_0x266b('0x4'));var fs=require('fs');var Redis=require(_0x266b('0x5'));var db=require(_0x266b('0x6'))['db'];var utils=require(_0x266b('0x7'));var logger=require(_0x266b('0x8'))('rpc');var config=require(_0x266b('0x9'));var jayson=require(_0x266b('0xa'));var client=jayson[_0x266b('0xb')][_0x266b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33110c,_0x4a22bc,_0x2ee0c9){return new BPromise(function(_0x29ca16,_0x19e718){return client[_0x266b('0xd')](_0x33110c,_0x2ee0c9)['then'](function(_0x2c5d77){logger[_0x266b('0xe')](_0x266b('0xf'),_0x4a22bc,'request\x20sent');logger[_0x266b('0x10')](_0x266b('0x11'),_0x4a22bc,_0x266b('0x12'),JSON[_0x266b('0x13')](_0x2c5d77));if(_0x2c5d77['error']){if(_0x2c5d77[_0x266b('0x14')][_0x266b('0x15')]===0x1f4){logger[_0x266b('0x14')](_0x266b('0xf'),_0x4a22bc,_0x2c5d77[_0x266b('0x14')][_0x266b('0x16')]);return _0x19e718(_0x2c5d77['error'][_0x266b('0x16')]);}logger[_0x266b('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x4a22bc,_0x2c5d77[_0x266b('0x14')][_0x266b('0x16')]);return _0x29ca16(_0x2c5d77[_0x266b('0x14')][_0x266b('0x16')]);}else{logger['info'](_0x266b('0xf'),_0x4a22bc,_0x266b('0x12'));_0x29ca16(_0x2c5d77[_0x266b('0x17')][_0x266b('0x16')]);}})['catch'](function(_0x2fcaf3){logger[_0x266b('0x14')](_0x266b('0xf'),_0x4a22bc,_0x2fcaf3);_0x19e718(_0x2fcaf3);});});}exports[_0x266b('0x18')]=function(_0x2af44f){var _0x1aa4f4=this;return new Promise(function(_0x2733c0,_0x5c59ed){return db[_0x266b('0x19')][_0x266b('0x1a')]({'raw':_0x2af44f[_0x266b('0x1b')]?_0x2af44f['options'][_0x266b('0x1c')]===undefined?!![]:![]:!![],'where':_0x2af44f[_0x266b('0x1b')]?_0x2af44f[_0x266b('0x1b')][_0x266b('0x1d')]||null:null,'attributes':_0x2af44f[_0x266b('0x1b')]?_0x2af44f[_0x266b('0x1b')]['attributes']||null:null,'limit':_0x2af44f[_0x266b('0x1b')]?_0x2af44f[_0x266b('0x1b')][_0x266b('0x1e')]||null:null,'include':_0x2af44f['options']?_0x2af44f[_0x266b('0x1b')]['include']?_[_0x266b('0x1f')](_0x2af44f[_0x266b('0x1b')]['include'],function(_0x5ba0dc){return{'model':db[_0x5ba0dc[_0x266b('0x20')]],'as':_0x5ba0dc['as'],'attributes':_0x5ba0dc[_0x266b('0x21')],'include':_0x5ba0dc[_0x266b('0x22')]?_[_0x266b('0x1f')](_0x5ba0dc[_0x266b('0x22')],function(_0x3751dc){return{'model':db[_0x3751dc[_0x266b('0x20')]],'as':_0x3751dc['as'],'attributes':_0x3751dc[_0x266b('0x21')],'include':_0x3751dc[_0x266b('0x22')]?_[_0x266b('0x1f')](_0x3751dc[_0x266b('0x22')],function(_0x4c27e1){return{'model':db[_0x4c27e1[_0x266b('0x20')]],'as':_0x4c27e1['as'],'attributes':_0x4c27e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x266b('0x23')](function(_0x209ed4){logger['info'](_0x266b('0x18'),_0x2af44f);logger[_0x266b('0x10')](_0x266b('0x18'),_0x2af44f,JSON['stringify'](_0x209ed4));_0x2733c0(_0x209ed4);})[_0x266b('0x24')](function(_0x44e549){logger['error']('GetCmHopperBlack',_0x44e549[_0x266b('0x16')],_0x2af44f);_0x5c59ed(_0x1aa4f4[_0x266b('0x14')](0x1f4,_0x44e549['message']));});});};exports[_0x266b('0x25')]=function(_0x3f1776){var _0x332076=this;return new Promise(function(_0x3ba854,_0x3eec47){return db[_0x266b('0x19')][_0x266b('0x26')](_0x3f1776['body'],{'raw':_0x3f1776['options']?_0x3f1776[_0x266b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f1776[_0x266b('0x1b')]?_0x3f1776[_0x266b('0x1b')][_0x266b('0x1d')]||null:null,'attributes':_0x3f1776[_0x266b('0x1b')]?_0x3f1776[_0x266b('0x1b')]['attributes']||null:null,'limit':_0x3f1776[_0x266b('0x1b')]?_0x3f1776[_0x266b('0x1b')][_0x266b('0x1e')]||null:null})[_0x266b('0x23')](function(_0x10ae4d){logger[_0x266b('0xe')]('UpdateCmHopperBlack',_0x3f1776);logger[_0x266b('0x10')](_0x266b('0x25'),_0x3f1776,JSON[_0x266b('0x13')](_0x10ae4d));_0x3ba854(_0x10ae4d);})['catch'](function(_0x3948cf){logger[_0x266b('0x14')]('UpdateCmHopperBlack',_0x3948cf['message'],_0x3f1776);_0x3eec47(_0x332076[_0x266b('0x14')](0x1f4,_0x3948cf[_0x266b('0x16')]));});});};exports[_0x266b('0x27')]=function(_0x5e6a56){var _0x1bb850=this;return new Promise(function(_0x4b0686,_0x1b0df8){return db[_0x266b('0x19')][_0x266b('0x28')]({'where':_0x5e6a56[_0x266b('0x1b')]?_0x5e6a56[_0x266b('0x1b')]['where']||null:null})[_0x266b('0x23')](function(_0x210862){logger[_0x266b('0xe')](_0x266b('0x27'),_0x5e6a56);logger[_0x266b('0x10')]('DestroyCmHopperBlack',_0x5e6a56,JSON[_0x266b('0x13')](_0x210862));_0x4b0686(_0x210862);})[_0x266b('0x24')](function(_0x42d61c){logger[_0x266b('0x14')](_0x266b('0x27'),_0x42d61c[_0x266b('0x16')],_0x5e6a56);_0x1b0df8(_0x1bb850['error'](0x1f4,_0x42d61c['message']));});});}; \ No newline at end of file +var _0x221d=['DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','GetCmHopperBlack','update','body','UpdateCmHopperBlack'];(function(_0x3455da,_0x373a95){var _0x507759=function(_0x595153){while(--_0x595153){_0x3455da['push'](_0x3455da['shift']());}};_0x507759(++_0x373a95);}(_0x221d,0x158));var _0xd221=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x221d[_0x4ed1d4];return _0x28e363;};'use strict';var _=require(_0xd221('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd221('0x1'));var rs=require(_0xd221('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd221('0x3'))['db'];var utils=require(_0xd221('0x4'));var logger=require(_0xd221('0x5'))(_0xd221('0x6'));var config=require(_0xd221('0x7'));var jayson=require(_0xd221('0x8'));var client=jayson[_0xd221('0x9')][_0xd221('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58a307,_0x2bc878,_0x3bf5ef){return new BPromise(function(_0x25577d,_0x3b65b4){return client['request'](_0x58a307,_0x3bf5ef)[_0xd221('0xb')](function(_0x2458fd){logger[_0xd221('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x2bc878,_0xd221('0xd'));logger[_0xd221('0xe')](_0xd221('0xf'),_0x2bc878,'request\x20sent',JSON[_0xd221('0x10')](_0x2458fd));if(_0x2458fd[_0xd221('0x11')]){if(_0x2458fd[_0xd221('0x11')][_0xd221('0x12')]===0x1f4){logger[_0xd221('0x11')](_0xd221('0x13'),_0x2bc878,_0x2458fd[_0xd221('0x11')]['message']);return _0x3b65b4(_0x2458fd[_0xd221('0x11')][_0xd221('0x14')]);}logger['error'](_0xd221('0x13'),_0x2bc878,_0x2458fd[_0xd221('0x11')][_0xd221('0x14')]);return _0x25577d(_0x2458fd[_0xd221('0x11')][_0xd221('0x14')]);}else{logger[_0xd221('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x2bc878,_0xd221('0xd'));_0x25577d(_0x2458fd['result'][_0xd221('0x14')]);}})[_0xd221('0x15')](function(_0x44fd5e){logger[_0xd221('0x11')](_0xd221('0x13'),_0x2bc878,_0x44fd5e);_0x3b65b4(_0x44fd5e);});});}exports['GetCmHopperBlack']=function(_0x30239d){var _0xf456c5=this;return new Promise(function(_0x30eed0,_0x45836f){return db[_0xd221('0x16')][_0xd221('0x17')]({'raw':_0x30239d[_0xd221('0x18')]?_0x30239d[_0xd221('0x18')][_0xd221('0x19')]===undefined?!![]:![]:!![],'where':_0x30239d[_0xd221('0x18')]?_0x30239d['options'][_0xd221('0x1a')]||null:null,'attributes':_0x30239d[_0xd221('0x18')]?_0x30239d[_0xd221('0x18')][_0xd221('0x1b')]||null:null,'limit':_0x30239d['options']?_0x30239d[_0xd221('0x18')][_0xd221('0x1c')]||null:null,'include':_0x30239d[_0xd221('0x18')]?_0x30239d[_0xd221('0x18')][_0xd221('0x1d')]?_['map'](_0x30239d[_0xd221('0x18')]['include'],function(_0x3104ff){return{'model':db[_0x3104ff[_0xd221('0x1e')]],'as':_0x3104ff['as'],'attributes':_0x3104ff[_0xd221('0x1b')],'include':_0x3104ff[_0xd221('0x1d')]?_[_0xd221('0x1f')](_0x3104ff[_0xd221('0x1d')],function(_0x18262f){return{'model':db[_0x18262f['model']],'as':_0x18262f['as'],'attributes':_0x18262f[_0xd221('0x1b')],'include':_0x18262f[_0xd221('0x1d')]?_[_0xd221('0x1f')](_0x18262f['include'],function(_0x18db41){return{'model':db[_0x18db41[_0xd221('0x1e')]],'as':_0x18db41['as'],'attributes':_0x18db41[_0xd221('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd221('0xb')](function(_0x4ca2e3){logger[_0xd221('0xc')](_0xd221('0x20'),_0x30239d);logger[_0xd221('0xe')]('GetCmHopperBlack',_0x30239d,JSON[_0xd221('0x10')](_0x4ca2e3));_0x30eed0(_0x4ca2e3);})['catch'](function(_0x55f6ce){logger[_0xd221('0x11')](_0xd221('0x20'),_0x55f6ce[_0xd221('0x14')],_0x30239d);_0x45836f(_0xf456c5['error'](0x1f4,_0x55f6ce[_0xd221('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x48b20d){var _0x41fe33=this;return new Promise(function(_0x3cffff,_0x3acc24){return db['CmHopperBlack'][_0xd221('0x21')](_0x48b20d[_0xd221('0x22')],{'raw':_0x48b20d[_0xd221('0x18')]?_0x48b20d[_0xd221('0x18')][_0xd221('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48b20d[_0xd221('0x18')]?_0x48b20d['options'][_0xd221('0x1a')]||null:null,'attributes':_0x48b20d[_0xd221('0x18')]?_0x48b20d[_0xd221('0x18')][_0xd221('0x1b')]||null:null,'limit':_0x48b20d['options']?_0x48b20d[_0xd221('0x18')][_0xd221('0x1c')]||null:null})['then'](function(_0x442b77){logger[_0xd221('0xc')](_0xd221('0x23'),_0x48b20d);logger[_0xd221('0xe')](_0xd221('0x23'),_0x48b20d,JSON[_0xd221('0x10')](_0x442b77));_0x3cffff(_0x442b77);})['catch'](function(_0x2f15ad){logger['error'](_0xd221('0x23'),_0x2f15ad['message'],_0x48b20d);_0x3acc24(_0x41fe33[_0xd221('0x11')](0x1f4,_0x2f15ad[_0xd221('0x14')]));});});};exports[_0xd221('0x24')]=function(_0x26725c){var _0x453bda=this;return new Promise(function(_0x12f65e,_0x1ac5d9){return db['CmHopperBlack'][_0xd221('0x25')]({'where':_0x26725c['options']?_0x26725c[_0xd221('0x18')][_0xd221('0x1a')]||null:null})[_0xd221('0xb')](function(_0xc12426){logger[_0xd221('0xc')]('DestroyCmHopperBlack',_0x26725c);logger[_0xd221('0xe')](_0xd221('0x24'),_0x26725c,JSON['stringify'](_0xc12426));_0x12f65e(_0xc12426);})[_0xd221('0x15')](function(_0xa98c55){logger[_0xd221('0x11')](_0xd221('0x24'),_0xa98c55[_0xd221('0x14')],_0x26725c);_0x1ac5d9(_0x453bda['error'](0x1f4,_0xa98c55[_0xd221('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 3b9635d..3b3c52c 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 _0x6d38=['exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x55b3a3,_0x3fc2fc){var _0xb880d1=function(_0x4abc55){while(--_0x4abc55){_0x55b3a3['push'](_0x55b3a3['shift']());}};_0xb880d1(++_0x3fc2fc);}(_0x6d38,0x1ef));var _0x86d3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6d38[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['put'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['update']);router['delete'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['destroy']);module[_0x86d3('0xc')]=router; \ No newline at end of file +var _0x3d04=['show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id'];(function(_0x225460,_0x19f96d){var _0x14d050=function(_0x1e8609){while(--_0x1e8609){_0x225460['push'](_0x225460['shift']());}};_0x14d050(++_0x19f96d);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xf')]);module[_0x43d0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index be23f88..86e24a2 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 _0x04e2=['exports','INTEGER','STRING','DATE','getDataValue','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','sequelize'];(function(_0x22c093,_0x7f6ef3){var _0x3f6326=function(_0x48be55){while(--_0x48be55){_0x22c093['push'](_0x22c093['shift']());}};_0x3f6326(++_0x7f6ef3);}(_0x04e2,0x8f));var _0x204e=function(_0x1b551e,_0x2ab649){_0x1b551e=_0x1b551e-0x0;var _0x268ebc=_0x04e2[_0x1b551e];return _0x268ebc;};'use strict';var Sequelize=require(_0x204e('0x0'));var moment=require('moment');module[_0x204e('0x1')]={'state':{'type':Sequelize[_0x204e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x204e('0x3')]},'scheduledat':{'type':Sequelize[_0x204e('0x4')]},'countbusyretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x204e('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x204e('0x3')]},'originatecalleridname':{'type':Sequelize[_0x204e('0x3')]},'calleridnum':{'type':Sequelize[_0x204e('0x3')]},'calleridname':{'type':Sequelize[_0x204e('0x3')]},'starttime':{'type':Sequelize[_0x204e('0x4')]},'responsetime':{'type':Sequelize[_0x204e('0x4')]},'answertime':{'type':Sequelize[_0x204e('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x204e('0x4')]},'ringtime':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x204e('0x3')]},'campaign':{'type':Sequelize[_0x204e('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x204e('0x3')]},'disposition':{'type':Sequelize[_0x204e('0x3')]},'secondDisposition':{'type':Sequelize[_0x204e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x204e('0x3')]},'dispositionat':{'type':Sequelize[_0x204e('0x4')],'set':function(_0x2f79fa){var _0x46a9c2=this[_0x204e('0x5')]('endtime');if(_0x46a9c2&&_0x2f79fa){this['setDataValue'](_0x204e('0x6'),moment(_0x2f79fa)[_0x204e('0x7')](moment(_0x46a9c2),_0x204e('0x8')));}return this[_0x204e('0x9')](_0x204e('0xa'),_0x2f79fa);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x204e('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x204e('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x204e('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x204e('0x4')]},'callback':{'type':Sequelize[_0x204e('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x204e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x204e('0x4')]},'deleted':{'type':Sequelize[_0x204e('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x204e('0x4')]},'recallme':{'type':Sequelize[_0x204e('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x204e('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x204e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f6f=['diff','seconds','dispositionat','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','followuptime'];(function(_0x310861,_0x45c9ba){var _0xa1598e=function(_0x53ce2b){while(--_0x53ce2b){_0x310861['push'](_0x310861['shift']());}};_0xa1598e(++_0x45c9ba);}(_0x8f6f,0x1c7));var _0xf8f6=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x8f6f[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf8f6('0x0'));module[_0xf8f6('0x1')]={'state':{'type':Sequelize[_0xf8f6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xf8f6('0x3')]},'scheduledat':{'type':Sequelize[_0xf8f6('0x4')]},'countbusyretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf8f6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xf8f6('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf8f6('0x3')]},'starttime':{'type':Sequelize[_0xf8f6('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf8f6('0x4')]},'droptime':{'type':Sequelize[_0xf8f6('0x4')]},'endtime':{'type':Sequelize[_0xf8f6('0x4')]},'ringtime':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf8f6('0x3')]},'campaign':{'type':Sequelize[_0xf8f6('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf8f6('0x3')]},'reason':{'type':Sequelize[_0xf8f6('0x3')]},'disposition':{'type':Sequelize[_0xf8f6('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xf8f6('0x4')],'set':function(_0x3a5d4e){var _0x32b3a7=this[_0xf8f6('0x5')]('endtime');if(_0x32b3a7&&_0x3a5d4e){this['setDataValue'](_0xf8f6('0x6'),moment(_0x3a5d4e)[_0xf8f6('0x7')](moment(_0x32b3a7),_0xf8f6('0x8')));}return this['setDataValue'](_0xf8f6('0x9'),_0x3a5d4e);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xf8f6('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf8f6('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf8f6('0x4')]},'callback':{'type':Sequelize[_0xf8f6('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf8f6('0x4')]},'deleted':{'type':Sequelize[_0xf8f6('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf8f6('0x4')]},'recallme':{'type':Sequelize[_0xf8f6('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf8f6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index cf32d25..bf02ee0 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 _0xf61e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','describe','update','body','uniqueid','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery','ContactId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','findOne','eml-format'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf61e,0x191));var _0xef61=function(_0x368c13,_0x2eaba9){_0x368c13=_0x368c13-0x0;var _0x3095d2=_0xf61e[_0x368c13];return _0x3095d2;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['CmHopperFinal']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')]()['then'](respondWithResult(_0x47b09d,null))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x13d0f8,_0x2904e0){if(_0x13d0f8[_0xef61('0x4a')][_0xef61('0x4b')]){delete _0x13d0f8[_0xef61('0x4a')]['uniqueid'];}return db[_0xef61('0x30')]['find']({'where':{'uniqueid':_0x13d0f8[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x2904e0,null))[_0xef61('0x28')](saveUpdates(_0x13d0f8[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x2904e0,null))[_0xef61('0x45')](handleError(_0x2904e0,null));};exports[_0xef61('0x4d')]=function(_0x1565c7,_0x264877,_0x4af2f3){return db[_0xef61('0x30')][_0xef61('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x1565c7['params']['id']},'attributes':[[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xef61('0x53')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x55')))),_0xef61('0x56')],[db['sequelize']['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db['sequelize']['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})[_0xef61('0x28')](handleEntityNotFound(_0x264877,null))[_0xef61('0x28')](respondWithResult(_0x264877,null))[_0xef61('0x45')](handleError(_0x264877,null));};exports[_0xef61('0x5d')]=function(_0x5507ee,_0x15a8c5,_0x4b26e6){return db['CmHopperFinal'][_0xef61('0x44')]({'raw':![],'where':{'CampaignId':_0x5507ee[_0xef61('0x4c')]['id']},'attributes':[[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5e')))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x5f')))),'busyContacts'],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x60')))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xef61('0x56')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})['then'](handleEntityNotFound(_0x15a8c5,null))[_0xef61('0x28')](respondWithResult(_0x15a8c5,null))[_0xef61('0x45')](handleError(_0x15a8c5,null));};exports[_0xef61('0x61')]=function(_0x5ab4fe,_0x38117b,_0x346752){return db['VoiceQueue'][_0xef61('0x47')]({'where':{'id':_0x5ab4fe[_0xef61('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38117b,null))[_0xef61('0x28')](function(_0x54777a){var _0xe62ec2;if(_0x54777a){_0xe62ec2=squel[_0xef61('0x62')]()['into'](_0xef61('0x63'))['fromQuery']([_0xef61('0x64'),_0xef61('0x65'),'ContactId','ListId',_0xef61('0x66'),_0xef61('0x67'),_0xef61('0x68')],squel[_0xef61('0x69')]()[_0xef61('0x6a')]('ANY_VALUE(calleridnum)',_0xef61('0x64'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),'ContactId')[_0xef61('0x6a')]('ANY_VALUE(ListId)',_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x6e'),_0xef61('0x66'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x68'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5ab4fe['body'][_0xef61('0x73')]['toString']())['where'](_0xef61('0x74'))['where'](_0xef61('0x75'),squel['select']()['field'](_0xef61('0x64'))[_0xef61('0x6f')]('cm_hopper')[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]()))[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')]('calleridnum')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x76'),_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')]('ContactId'))[_0xef61('0x71')]();return db['sequelize'][_0xef61('0x34')](_0xe62ec2);}return[];})[_0xef61('0x28')](respondWithResult(_0x38117b,null))['catch'](handleError(_0x38117b,null));};exports[_0xef61('0x79')]=function(_0x5b86e4,_0x52f7c5,_0x465fb5){return db[_0xef61('0x7a')]['find']({'where':{'id':_0x5b86e4[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x52f7c5,null))['then'](function(_0x352633){var _0x2cb8a8;if(_0x352633){_0x2cb8a8=squel['insert']()[_0xef61('0x7b')]('cm_hopper')[_0xef61('0x7c')]([_0xef61('0x64'),_0xef61('0x65'),_0xef61('0x7d'),'ListId',_0xef61('0x7e'),_0xef61('0x67'),_0xef61('0x68')],squel['select']()[_0xef61('0x6a')](_0xef61('0x7f'),'phone')['field'](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),_0xef61('0x7d'))[_0xef61('0x6a')](_0xef61('0x80'),_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x81'),_0xef61('0x7e'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),'updatedAt')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x82'),_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5b86e4[_0xef61('0x4a')][_0xef61('0x73')][_0xef61('0x71')]())[_0xef61('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')](_0xef61('0x64'))[_0xef61('0x6f')](_0xef61('0x63'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id']['toString']()))[_0xef61('0x3d')](_0xef61('0x75'),squel[_0xef61('0x69')]()[_0xef61('0x6a')](_0xef61('0x83'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')](_0xef61('0x7d')))[_0xef61('0x71')]();return db[_0xef61('0x4f')][_0xef61('0x34')](_0x2cb8a8);}return[];})['then'](respondWithResult(_0x52f7c5,null))[_0xef61('0x45')](handleError(_0x52f7c5,null));};exports[_0xef61('0x84')]=function(_0x22006a,_0x317c4a,_0x5d8ee9){return db['CmHopper'][_0xef61('0x85')]({'where':{'VoiceQueueId':_0x22006a[_0xef61('0x4a')][_0xef61('0x66')],'CampaignId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7e')],'ContactId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7d')]}})['then'](handleEntityNotFound(_0x317c4a,null))[_0xef61('0x28')](function(_0x660c71){if(_0x660c71){return _0x660c71;}return null;})[_0xef61('0x28')](respondWithResult(_0x317c4a,null))[_0xef61('0x45')](handleError(_0x317c4a,null));}; \ No newline at end of file +var _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0xf18452,_0x1df28e){var _0x2d87c2=function(_0x261467){while(--_0x261467){_0xf18452['push'](_0xf18452['shift']());}};_0x2d87c2(++_0x1df28e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 75fbdf1..5c216f6 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 _0x5656=['CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x5656,0x92));var _0x6565=function(_0x49eb06,_0x47d2b6){_0x49eb06=_0x49eb06-0x0;var _0x4b8d67=_0x5656[_0x49eb06];return _0x4b8d67;};'use strict';var _=require(_0x6565('0x0'));var util=require(_0x6565('0x1'));var logger=require(_0x6565('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6565('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6565('0x4'));var rimraf=require(_0x6565('0x5'));var config=require(_0x6565('0x6'));var attributes=require(_0x6565('0x7'));module[_0x6565('0x8')]=function(_0x857058,_0x4f4b88){return _0x857058[_0x6565('0x9')](_0x6565('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x6565('0xb'),'fields':[_0x6565('0xb')]},{'name':'uniqueid','fields':[_0x6565('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a67=['moment','request-promise','rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api'];(function(_0x45806b,_0x53eeae){var _0x3e228e=function(_0x3ee031){while(--_0x3ee031){_0x45806b['push'](_0x45806b['shift']());}};_0x3e228e(++_0x53eeae);}(_0x5a67,0x75));var _0x75a6=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x5a67[_0x3f1710];return _0x528458;};'use strict';var _=require('lodash');var util=require(_0x75a6('0x0'));var logger=require(_0x75a6('0x1'))(_0x75a6('0x2'));var moment=require(_0x75a6('0x3'));var BPromise=require('bluebird');var rp=require(_0x75a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75a6('0x5'));var config=require('../../config/environment');var attributes=require(_0x75a6('0x6'));module[_0x75a6('0x7')]=function(_0x563bf6,_0x50fbe3){return _0x563bf6['define'](_0x75a6('0x8'),attributes,{'tableName':_0x75a6('0x9'),'paranoid':![],'indexes':[{'name':_0x75a6('0xa'),'fields':[_0x75a6('0xa')]},{'name':_0x75a6('0xb'),'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 efacbfc..9e03c8e 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x15cddd,_0x45cc17){var _0x41c603=function(_0x20a2c8){while(--_0x20a2c8){_0x15cddd['push'](_0x15cddd['shift']());}};_0x41c603(++_0x45cc17);}(_0x7a54,0x106));var _0x47a5=function(_0x293f45,_0x1523a1){_0x293f45=_0x293f45-0x0;var _0x370941=_0x7a54[_0x293f45];return _0x370941;};'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')]('CmHopperFinal,\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);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5810a1,_0x164ea7){var _0x50fdb5=function(_0x12b250){while(--_0x12b250){_0x5810a1['push'](_0x5810a1['shift']());}};_0x50fdb5(++_0x164ea7);}(_0xb10b,0x12a));var _0xbb10=function(_0x2980de,_0x1426a4){_0x2980de=_0x2980de-0x0;var _0x81a4ca=_0xb10b[_0x2980de];return _0x81a4ca;};'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?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index a625009..0c1986c 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 _0x6aba=['update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id'];(function(_0x309e25,_0x1ab9d6){var _0x3c1da7=function(_0x2d1a53){while(--_0x2d1a53){_0x309e25['push'](_0x309e25['shift']());}};_0x3c1da7(++_0x1ab9d6);}(_0x6aba,0x1e8));var _0xa6ab=function(_0x1ca384,_0x230529){_0x1ca384=_0x1ca384-0x0;var _0x1e909e=_0x6aba[_0x1ca384];return _0x1e909e;};'use strict';var multer=require(_0xa6ab('0x0'));var util=require('util');var path=require(_0xa6ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xa6ab('0x2'));var router=express[_0xa6ab('0x3')]();var fs_extra=require(_0xa6ab('0x4'));var auth=require(_0xa6ab('0x5'));var interaction=require(_0xa6ab('0x6'));var config=require(_0xa6ab('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xa6ab('0x8')]('/',auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xa')]);router[_0xa6ab('0x8')](_0xa6ab('0xb'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xc')]);router[_0xa6ab('0x8')]('/:id',auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xd')]);router[_0xa6ab('0x8')](_0xa6ab('0xe'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xf')]);router[_0xa6ab('0x8')](_0xa6ab('0x10'),auth['isAuthenticated'](),controller[_0xa6ab('0x11')]);router[_0xa6ab('0x12')](_0xa6ab('0x13'),auth[_0xa6ab('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0xa6ab('0x14'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0x15')]);router['post']('/checkContactHopper',auth[_0xa6ab('0x9')](),controller[_0xa6ab('0x16')]);router[_0xa6ab('0x17')](_0xa6ab('0x18'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0x19')]);module[_0xa6ab('0x1a')]=router; \ No newline at end of file +var _0x8b6c=['put','update','multer','util','connect-timeout','express','Router','fs-extra','./cmHopperFinal.controller','get','/describe','isAuthenticated','/:id','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x53ddbb,_0x1b76b9){var _0x32ab79=function(_0x2e74fb){while(--_0x2e74fb){_0x53ddbb['push'](_0x53ddbb['shift']());}};_0x32ab79(++_0x1b76b9);}(_0x8b6c,0x1b7));var _0xc8b6=function(_0xda2346,_0x186fd9){_0xda2346=_0xda2346-0x0;var _0x19e292=_0x8b6c[_0xda2346];return _0x19e292;};'use strict';var multer=require(_0xc8b6('0x0'));var util=require(_0xc8b6('0x1'));var path=require('path');var timeout=require(_0xc8b6('0x2'));var express=require(_0xc8b6('0x3'));var router=express[_0xc8b6('0x4')]();var fs_extra=require(_0xc8b6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8b6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc8b6('0x7')](_0xc8b6('0x8'),auth[_0xc8b6('0x9')](),controller['describe']);router['get'](_0xc8b6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc8b6('0x7')](_0xc8b6('0xb'),auth[_0xc8b6('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xc8b6('0x7')](_0xc8b6('0xc'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0xd')]);router[_0xc8b6('0xe')](_0xc8b6('0xf'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x10')]);router[_0xc8b6('0xe')](_0xc8b6('0x11'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x12')]);router[_0xc8b6('0xe')](_0xc8b6('0x13'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x14')]);router[_0xc8b6('0x15')](_0xc8b6('0xa'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 569a1e8..20063de 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 _0xec90=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0xec90,0x1ca));var _0x0ec9=function(_0x45ca66,_0x47f5d2){_0x45ca66=_0x45ca66-0x0;var _0x329bdc=_0xec90[_0x45ca66];return _0x329bdc;};'use strict';var Sequelize=require(_0x0ec9('0x0'));module[_0x0ec9('0x1')]={'state':{'type':Sequelize[_0x0ec9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0ec9('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0ec9('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0ec9('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0ec9('0x3')]},'calleridnum':{'type':Sequelize[_0x0ec9('0x3')]},'calleridname':{'type':Sequelize[_0x0ec9('0x3')]},'starttime':{'type':Sequelize[_0x0ec9('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0ec9('0x4')]},'droptime':{'type':Sequelize[_0x0ec9('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0ec9('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0ec9('0x3')]},'membername':{'type':Sequelize[_0x0ec9('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x0ec9('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0ec9('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0ec9('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ec9('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0ec9('0x4')]},'recallme':{'type':Sequelize[_0x0ec9('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0ec9('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ec9('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0ec9('0x3')]}}; \ No newline at end of file +var _0xeb82=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x551171,_0x3a8777){var _0x5bb909=function(_0x387a1f){while(--_0x387a1f){_0x551171['push'](_0x551171['shift']());}};_0x5bb909(++_0x3a8777);}(_0xeb82,0xdb));var _0x2eb8=function(_0x5f4e0e,_0x41f8cd){_0x5f4e0e=_0x5f4e0e-0x0;var _0x3c3355=_0xeb82[_0x5f4e0e];return _0x3c3355;};'use strict';var Sequelize=require(_0x2eb8('0x0'));module[_0x2eb8('0x1')]={'state':{'type':Sequelize[_0x2eb8('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2eb8('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2eb8('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2eb8('0x4')]},'responsetime':{'type':Sequelize[_0x2eb8('0x4')]},'answertime':{'type':Sequelize[_0x2eb8('0x4')]},'droptime':{'type':Sequelize[_0x2eb8('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2eb8('0x3')]},'campaign':{'type':Sequelize[_0x2eb8('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2eb8('0x3')]},'reason':{'type':Sequelize[_0x2eb8('0x3')]},'amd':{'type':Sequelize[_0x2eb8('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2eb8('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2eb8('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2eb8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2eb8('0x4')]},'recallme':{'type':Sequelize[_0x2eb8('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2eb8('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2eb8('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2eb8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 0b2b453..007c62b 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 _0x2d68=['options','includeAll','include','findAll','show','params','catch','create','describe','body','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','CmHopperHistory','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge'];(function(_0x27baaa,_0x184f23){var _0x372265=function(_0x3e835d){while(--_0x3e835d){_0x27baaa['push'](_0x27baaa['shift']());}};_0x372265(++_0x184f23);}(_0x2d68,0x99));var _0x82d6=function(_0x4ef8bc,_0x5eb00d){_0x4ef8bc=_0x4ef8bc-0x0;var _0x5d4d56=_0x2d68[_0x4ef8bc];return _0x5d4d56;};'use strict';var emlformat=require(_0x82d6('0x0'));var rimraf=require(_0x82d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82d6('0x2'));var rp=require(_0x82d6('0x3'));var moment=require(_0x82d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82d6('0x5'));var util=require(_0x82d6('0x6'));var path=require(_0x82d6('0x7'));var sox=require(_0x82d6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82d6('0x9'));var _=require('lodash');var squel=require(_0x82d6('0xa'));var crypto=require(_0x82d6('0xb'));var jsforce=require(_0x82d6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x82d6('0xd'));var querystring=require('querystring');var Papa=require(_0x82d6('0xe'));var Redis=require(_0x82d6('0xf'));var authService=require(_0x82d6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x82d6('0x11'));var hardwareService=require(_0x82d6('0x12'));var logger=require(_0x82d6('0x13'))(_0x82d6('0x14'));var utils=require(_0x82d6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x82d6('0x16'))['db'];function respondWithStatusCode(_0xb650e0,_0x4ff666){_0x4ff666=_0x4ff666||0xcc;return function(_0xe3d4ee){if(_0xe3d4ee){return _0xb650e0[_0x82d6('0x17')](_0x4ff666);}return _0xb650e0['status'](_0x4ff666)[_0x82d6('0x18')]();};}function respondWithResult(_0x2b8a21,_0x2dda7e){_0x2dda7e=_0x2dda7e||0xc8;return function(_0x43b34b){if(_0x43b34b){return _0x2b8a21[_0x82d6('0x19')](_0x2dda7e)[_0x82d6('0x1a')](_0x43b34b);}};}function respondWithFilteredResult(_0x3bad44,_0x396f14){return function(_0x411204){if(_0x411204){var _0x1f4d6b=typeof _0x396f14['offset']===_0x82d6('0x1b')&&typeof _0x396f14['limit']==='undefined';var _0x587529=_0x411204['count'];var _0x193e9c=_0x1f4d6b?0x0:_0x396f14[_0x82d6('0x1c')];var _0x15e98d=_0x1f4d6b?_0x411204[_0x82d6('0x1d')]:_0x396f14['offset']+_0x396f14[_0x82d6('0x1e')];var _0x22f4cb;if(_0x15e98d>=_0x587529){_0x15e98d=_0x587529;_0x22f4cb=0xc8;}else{_0x22f4cb=0xce;}_0x3bad44[_0x82d6('0x19')](_0x22f4cb);return _0x3bad44[_0x82d6('0x1f')](_0x82d6('0x20'),_0x193e9c+'-'+_0x15e98d+'/'+_0x587529)[_0x82d6('0x1a')](_0x411204);}return null;};}function patchUpdates(_0x2d8650){return function(_0x15d9ab){try{jsonpatch[_0x82d6('0x21')](_0x15d9ab,_0x2d8650,!![]);}catch(_0x53385b){return BPromise[_0x82d6('0x22')](_0x53385b);}return _0x15d9ab['save']();};}function saveUpdates(_0x3412e0,_0x228c8e){return function(_0x1934fa){if(_0x1934fa){return _0x1934fa[_0x82d6('0x23')](_0x3412e0)[_0x82d6('0x24')](function(_0x1f19b6){return _0x1f19b6;});}return null;};}function removeEntity(_0x5a38e0,_0x3ef73b){return function(_0x98e88c){if(_0x98e88c){return _0x98e88c['destroy']()[_0x82d6('0x24')](function(){_0x5a38e0[_0x82d6('0x19')](0xcc)[_0x82d6('0x18')]();});}};}function handleEntityNotFound(_0x566405,_0x2ccbc3){return function(_0x14c032){if(!_0x14c032){_0x566405['sendStatus'](0x194);}return _0x14c032;};}function handleError(_0x468072,_0xff6c63){_0xff6c63=_0xff6c63||0x1f4;return function(_0x63a216){logger[_0x82d6('0x25')](_0x63a216[_0x82d6('0x26')]);if(_0x63a216[_0x82d6('0x27')]){delete _0x63a216['name'];}_0x468072[_0x82d6('0x19')](_0xff6c63)['send'](_0x63a216);};}exports['index']=function(_0x27c73b,_0x299487){var _0x2c537a={},_0x1b343a={},_0x287083={'count':0x0,'rows':[]};var _0x943e41=_['map'](db[_0x82d6('0x28')][_0x82d6('0x29')],function(_0x355bb3){return{'name':_0x355bb3[_0x82d6('0x2a')],'type':_0x355bb3[_0x82d6('0x2b')][_0x82d6('0x2c')]};});_0x1b343a['model']=_[_0x82d6('0x2d')](_0x943e41,_0x82d6('0x27'));_0x1b343a[_0x82d6('0x2e')]=_[_0x82d6('0x2f')](_0x27c73b[_0x82d6('0x2e')]);_0x1b343a[_0x82d6('0x30')]=_['intersection'](_0x1b343a[_0x82d6('0x31')],_0x1b343a[_0x82d6('0x2e')]);_0x2c537a[_0x82d6('0x32')]=_[_0x82d6('0x33')](_0x1b343a[_0x82d6('0x31')],qs[_0x82d6('0x34')](_0x27c73b['query'][_0x82d6('0x34')]));_0x2c537a[_0x82d6('0x32')]=_0x2c537a[_0x82d6('0x32')]['length']?_0x2c537a[_0x82d6('0x32')]:_0x1b343a[_0x82d6('0x31')];if(!_0x27c73b[_0x82d6('0x2e')][_0x82d6('0x35')](_0x82d6('0x36'))){_0x2c537a[_0x82d6('0x1e')]=qs[_0x82d6('0x1e')](_0x27c73b['query'][_0x82d6('0x1e')]);_0x2c537a['offset']=qs[_0x82d6('0x1c')](_0x27c73b[_0x82d6('0x2e')][_0x82d6('0x1c')]);}_0x2c537a['order']=qs[_0x82d6('0x37')](_0x27c73b['query']['sort']);_0x2c537a[_0x82d6('0x38')]=qs[_0x82d6('0x30')](_[_0x82d6('0x39')](_0x27c73b[_0x82d6('0x2e')],_0x1b343a['filters']),_0x943e41);if(_0x27c73b[_0x82d6('0x2e')]['filter']){_0x2c537a['where']=_['merge'](_0x2c537a[_0x82d6('0x38')],{'$or':_[_0x82d6('0x2d')](_0x943e41,function(_0x41812c){if(_0x41812c[_0x82d6('0x2b')]!==_0x82d6('0x3a')){var _0x2c578a={};_0x2c578a[_0x41812c['name']]={'$like':'%'+_0x27c73b[_0x82d6('0x2e')]['filter']+'%'};return _0x2c578a;}})});}_0x2c537a=_[_0x82d6('0x3b')]({},_0x2c537a,_0x27c73b[_0x82d6('0x3c')]);var _0x322941={'where':_0x2c537a['where']};return db[_0x82d6('0x28')][_0x82d6('0x1d')](_0x322941)[_0x82d6('0x24')](function(_0x2b1e38){_0x287083[_0x82d6('0x1d')]=_0x2b1e38;if(_0x27c73b[_0x82d6('0x2e')][_0x82d6('0x3d')]){_0x2c537a[_0x82d6('0x3e')]=[{'all':!![]}];}return db[_0x82d6('0x28')][_0x82d6('0x3f')](_0x2c537a);})[_0x82d6('0x24')](function(_0x57f5ae){_0x287083['rows']=_0x57f5ae;return _0x287083;})[_0x82d6('0x24')](respondWithFilteredResult(_0x299487,_0x2c537a))['catch'](handleError(_0x299487,null));};exports[_0x82d6('0x40')]=function(_0x1d702a,_0x36f3bc){var _0x1e4702={'raw':!![],'where':{'id':_0x1d702a[_0x82d6('0x41')]['id']}},_0x239e63={};_0x239e63[_0x82d6('0x31')]=_[_0x82d6('0x2f')](db[_0x82d6('0x28')][_0x82d6('0x29')]);_0x239e63[_0x82d6('0x2e')]=_[_0x82d6('0x2f')](_0x1d702a[_0x82d6('0x2e')]);_0x239e63['filters']=_[_0x82d6('0x33')](_0x239e63[_0x82d6('0x31')],_0x239e63[_0x82d6('0x2e')]);_0x1e4702[_0x82d6('0x32')]=_[_0x82d6('0x33')](_0x239e63['model'],qs[_0x82d6('0x34')](_0x1d702a[_0x82d6('0x2e')]['fields']));_0x1e4702[_0x82d6('0x32')]=_0x1e4702[_0x82d6('0x32')]['length']?_0x1e4702[_0x82d6('0x32')]:_0x239e63[_0x82d6('0x31')];if(_0x1d702a['query'][_0x82d6('0x3d')]){_0x1e4702[_0x82d6('0x3e')]=[{'all':!![]}];}_0x1e4702=_[_0x82d6('0x3b')]({},_0x1e4702,_0x1d702a[_0x82d6('0x3c')]);return db[_0x82d6('0x28')]['find'](_0x1e4702)[_0x82d6('0x24')](handleEntityNotFound(_0x36f3bc,null))[_0x82d6('0x24')](respondWithResult(_0x36f3bc,null))[_0x82d6('0x42')](handleError(_0x36f3bc,null));};exports['create']=function(_0x3901ef,_0x2ae181){return db['CmHopperHistory'][_0x82d6('0x43')](_0x3901ef['body'],{})[_0x82d6('0x24')](respondWithResult(_0x2ae181,0xc9))[_0x82d6('0x42')](handleError(_0x2ae181,null));};exports[_0x82d6('0x44')]=function(_0x15ec5a,_0x4c7230){return db[_0x82d6('0x28')]['describe']()['then'](respondWithResult(_0x4c7230,null))[_0x82d6('0x42')](handleError(_0x4c7230,null));};exports[_0x82d6('0x23')]=function(_0x40ea5b,_0x23b87e){if(_0x40ea5b[_0x82d6('0x45')]['uniqueid']){delete _0x40ea5b['body'][_0x82d6('0x46')];}return db[_0x82d6('0x28')]['find']({'where':{'uniqueid':_0x40ea5b[_0x82d6('0x41')]['id']}})['then'](handleEntityNotFound(_0x23b87e,null))[_0x82d6('0x24')](saveUpdates(_0x40ea5b[_0x82d6('0x45')],null))['then'](respondWithResult(_0x23b87e,null))[_0x82d6('0x42')](handleError(_0x23b87e,null));}; \ No newline at end of file +var _0xc9ff=['index','map','CmHopperHistory','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send'];(function(_0x3b20c2,_0x888661){var _0x5b4482=function(_0x15b274){while(--_0x15b274){_0x3b20c2['push'](_0x3b20c2['shift']());}};_0x5b4482(++_0x888661);}(_0xc9ff,0x109));var _0xfc9f=function(_0x28404a,_0x374343){_0x28404a=_0x28404a-0x0;var _0x4003f2=_0xc9ff[_0x28404a];return _0x4003f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc9f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc9f('0x1'));var rp=require(_0xfc9f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfc9f('0x3'));var util=require('util');var path=require(_0xfc9f('0x4'));var sox=require(_0xfc9f('0x5'));var csv=require(_0xfc9f('0x6'));var ejs=require(_0xfc9f('0x7'));var fs=require('fs');var fs_extra=require(_0xfc9f('0x8'));var _=require(_0xfc9f('0x9'));var squel=require(_0xfc9f('0xa'));var crypto=require(_0xfc9f('0xb'));var jsforce=require(_0xfc9f('0xc'));var deskjs=require(_0xfc9f('0xd'));var toCsv=require(_0xfc9f('0x6'));var querystring=require(_0xfc9f('0xe'));var Papa=require(_0xfc9f('0xf'));var Redis=require(_0xfc9f('0x10'));var authService=require(_0xfc9f('0x11'));var qs=require(_0xfc9f('0x12'));var as=require(_0xfc9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc9f('0x14'))(_0xfc9f('0x15'));var utils=require(_0xfc9f('0x16'));var config=require(_0xfc9f('0x17'));var licenseUtil=require(_0xfc9f('0x18'));var db=require(_0xfc9f('0x19'))['db'];function respondWithStatusCode(_0x13329a,_0x472eab){_0x472eab=_0x472eab||0xcc;return function(_0x321019){if(_0x321019){return _0x13329a[_0xfc9f('0x1a')](_0x472eab);}return _0x13329a[_0xfc9f('0x1b')](_0x472eab)['end']();};}function respondWithResult(_0x419b3c,_0x4f3c42){_0x4f3c42=_0x4f3c42||0xc8;return function(_0x8c17e8){if(_0x8c17e8){return _0x419b3c[_0xfc9f('0x1b')](_0x4f3c42)[_0xfc9f('0x1c')](_0x8c17e8);}};}function respondWithFilteredResult(_0x21489b,_0x2da5ef){return function(_0x7a7bf0){if(_0x7a7bf0){var _0x3582ca=typeof _0x2da5ef[_0xfc9f('0x1d')]===_0xfc9f('0x1e')&&typeof _0x2da5ef[_0xfc9f('0x1f')]==='undefined';var _0x44cdc1=_0x7a7bf0[_0xfc9f('0x20')];var _0x30a3a6=_0x3582ca?0x0:_0x2da5ef[_0xfc9f('0x1d')];var _0x5884fc=_0x3582ca?_0x7a7bf0[_0xfc9f('0x20')]:_0x2da5ef[_0xfc9f('0x1d')]+_0x2da5ef[_0xfc9f('0x1f')];var _0x3801ec;if(_0x5884fc>=_0x44cdc1){_0x5884fc=_0x44cdc1;_0x3801ec=0xc8;}else{_0x3801ec=0xce;}_0x21489b[_0xfc9f('0x1b')](_0x3801ec);return _0x21489b[_0xfc9f('0x21')](_0xfc9f('0x22'),_0x30a3a6+'-'+_0x5884fc+'/'+_0x44cdc1)[_0xfc9f('0x1c')](_0x7a7bf0);}return null;};}function patchUpdates(_0x1dfa00){return function(_0x53dca6){try{jsonpatch['apply'](_0x53dca6,_0x1dfa00,!![]);}catch(_0x309ad9){return BPromise[_0xfc9f('0x23')](_0x309ad9);}return _0x53dca6[_0xfc9f('0x24')]();};}function saveUpdates(_0xd4178,_0x1305d4){return function(_0x1c1aa1){if(_0x1c1aa1){return _0x1c1aa1[_0xfc9f('0x25')](_0xd4178)[_0xfc9f('0x26')](function(_0x3f21a0){return _0x3f21a0;});}return null;};}function removeEntity(_0x122116,_0x26048b){return function(_0x58dee2){if(_0x58dee2){return _0x58dee2[_0xfc9f('0x27')]()['then'](function(){_0x122116['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d81e1,_0x1d9ea2){return function(_0x20efac){if(!_0x20efac){_0x3d81e1[_0xfc9f('0x1a')](0x194);}return _0x20efac;};}function handleError(_0x401a89,_0x198bf9){_0x198bf9=_0x198bf9||0x1f4;return function(_0x3cf52d){logger['error'](_0x3cf52d[_0xfc9f('0x28')]);if(_0x3cf52d[_0xfc9f('0x29')]){delete _0x3cf52d['name'];}_0x401a89[_0xfc9f('0x1b')](_0x198bf9)[_0xfc9f('0x2a')](_0x3cf52d);};}exports[_0xfc9f('0x2b')]=function(_0x5478e5,_0x218192){var _0x240e98={},_0x15292b={},_0x264fdc={'count':0x0,'rows':[]};var _0x2614ca=_[_0xfc9f('0x2c')](db[_0xfc9f('0x2d')]['rawAttributes'],function(_0x21980b){return{'name':_0x21980b['fieldName'],'type':_0x21980b['type'][_0xfc9f('0x2e')]};});_0x15292b['model']=_[_0xfc9f('0x2c')](_0x2614ca,'name');_0x15292b[_0xfc9f('0x2f')]=_[_0xfc9f('0x30')](_0x5478e5[_0xfc9f('0x2f')]);_0x15292b[_0xfc9f('0x31')]=_['intersection'](_0x15292b[_0xfc9f('0x32')],_0x15292b[_0xfc9f('0x2f')]);_0x240e98['attributes']=_[_0xfc9f('0x33')](_0x15292b['model'],qs[_0xfc9f('0x34')](_0x5478e5[_0xfc9f('0x2f')][_0xfc9f('0x34')]));_0x240e98[_0xfc9f('0x35')]=_0x240e98[_0xfc9f('0x35')][_0xfc9f('0x36')]?_0x240e98['attributes']:_0x15292b[_0xfc9f('0x32')];if(!_0x5478e5[_0xfc9f('0x2f')]['hasOwnProperty'](_0xfc9f('0x37'))){_0x240e98[_0xfc9f('0x1f')]=qs[_0xfc9f('0x1f')](_0x5478e5[_0xfc9f('0x2f')][_0xfc9f('0x1f')]);_0x240e98[_0xfc9f('0x1d')]=qs[_0xfc9f('0x1d')](_0x5478e5[_0xfc9f('0x2f')][_0xfc9f('0x1d')]);}_0x240e98[_0xfc9f('0x38')]=qs[_0xfc9f('0x39')](_0x5478e5[_0xfc9f('0x2f')][_0xfc9f('0x39')]);_0x240e98['where']=qs['filters'](_[_0xfc9f('0x3a')](_0x5478e5[_0xfc9f('0x2f')],_0x15292b[_0xfc9f('0x31')]),_0x2614ca);if(_0x5478e5[_0xfc9f('0x2f')][_0xfc9f('0x3b')]){_0x240e98[_0xfc9f('0x3c')]=_['merge'](_0x240e98[_0xfc9f('0x3c')],{'$or':_[_0xfc9f('0x2c')](_0x2614ca,function(_0x3121d5){if(_0x3121d5['type']!==_0xfc9f('0x3d')){var _0x4867e3={};_0x4867e3[_0x3121d5[_0xfc9f('0x29')]]={'$like':'%'+_0x5478e5['query'][_0xfc9f('0x3b')]+'%'};return _0x4867e3;}})});}_0x240e98=_[_0xfc9f('0x3e')]({},_0x240e98,_0x5478e5[_0xfc9f('0x3f')]);var _0x4eac64={'where':_0x240e98[_0xfc9f('0x3c')]};return db[_0xfc9f('0x2d')]['count'](_0x4eac64)[_0xfc9f('0x26')](function(_0x2be2a5){_0x264fdc[_0xfc9f('0x20')]=_0x2be2a5;if(_0x5478e5[_0xfc9f('0x2f')]['includeAll']){_0x240e98[_0xfc9f('0x40')]=[{'all':!![]}];}return db[_0xfc9f('0x2d')][_0xfc9f('0x41')](_0x240e98);})['then'](function(_0x26c822){_0x264fdc[_0xfc9f('0x42')]=_0x26c822;return _0x264fdc;})['then'](respondWithFilteredResult(_0x218192,_0x240e98))[_0xfc9f('0x43')](handleError(_0x218192,null));};exports[_0xfc9f('0x44')]=function(_0x59e7b0,_0x6bcfc1){var _0x5bac17={'raw':!![],'where':{'id':_0x59e7b0[_0xfc9f('0x45')]['id']}},_0x339039={};_0x339039['model']=_[_0xfc9f('0x30')](db['CmHopperHistory'][_0xfc9f('0x46')]);_0x339039[_0xfc9f('0x2f')]=_[_0xfc9f('0x30')](_0x59e7b0[_0xfc9f('0x2f')]);_0x339039[_0xfc9f('0x31')]=_[_0xfc9f('0x33')](_0x339039[_0xfc9f('0x32')],_0x339039[_0xfc9f('0x2f')]);_0x5bac17[_0xfc9f('0x35')]=_[_0xfc9f('0x33')](_0x339039['model'],qs['fields'](_0x59e7b0[_0xfc9f('0x2f')][_0xfc9f('0x34')]));_0x5bac17[_0xfc9f('0x35')]=_0x5bac17[_0xfc9f('0x35')]['length']?_0x5bac17['attributes']:_0x339039[_0xfc9f('0x32')];if(_0x59e7b0['query'][_0xfc9f('0x47')]){_0x5bac17['include']=[{'all':!![]}];}_0x5bac17=_[_0xfc9f('0x3e')]({},_0x5bac17,_0x59e7b0['options']);return db[_0xfc9f('0x2d')][_0xfc9f('0x48')](_0x5bac17)['then'](handleEntityNotFound(_0x6bcfc1,null))[_0xfc9f('0x26')](respondWithResult(_0x6bcfc1,null))[_0xfc9f('0x43')](handleError(_0x6bcfc1,null));};exports['create']=function(_0x40bdee,_0x2d154a){return db[_0xfc9f('0x2d')][_0xfc9f('0x49')](_0x40bdee[_0xfc9f('0x4a')],{})[_0xfc9f('0x26')](respondWithResult(_0x2d154a,0xc9))['catch'](handleError(_0x2d154a,null));};exports[_0xfc9f('0x4b')]=function(_0x3f7be3,_0x194ae4){return db[_0xfc9f('0x2d')][_0xfc9f('0x4b')]()[_0xfc9f('0x26')](respondWithResult(_0x194ae4,null))['catch'](handleError(_0x194ae4,null));};exports[_0xfc9f('0x25')]=function(_0x3774be,_0x17f19a){if(_0x3774be[_0xfc9f('0x4a')][_0xfc9f('0x4c')]){delete _0x3774be[_0xfc9f('0x4a')][_0xfc9f('0x4c')];}return db[_0xfc9f('0x2d')][_0xfc9f('0x48')]({'where':{'uniqueid':_0x3774be[_0xfc9f('0x45')]['id']}})[_0xfc9f('0x26')](handleEntityNotFound(_0x17f19a,null))[_0xfc9f('0x26')](saveUpdates(_0x3774be[_0xfc9f('0x4a')],null))[_0xfc9f('0x26')](respondWithResult(_0x17f19a,null))['catch'](handleError(_0x17f19a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index f608c0a..eb0d1e7 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 _0x505d=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x2e870b,_0x336e37){var _0x395ef6=function(_0x45832c){while(--_0x45832c){_0x2e870b['push'](_0x2e870b['shift']());}};_0x395ef6(++_0x336e37);}(_0x505d,0x93));var _0xd505=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x505d[_0x1e2321];return _0x1d346d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd505('0x0'))(_0xd505('0x1'));var moment=require(_0xd505('0x2'));var BPromise=require(_0xd505('0x3'));var rp=require(_0xd505('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd505('0x5'));var config=require(_0xd505('0x6'));var attributes=require(_0xd505('0x7'));module[_0xd505('0x8')]=function(_0x4ab634,_0x3a2863){return _0x4ab634['define'](_0xd505('0x9'),attributes,{'tableName':_0xd505('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xd505('0xb')]},{'name':_0xd505('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb0b=['define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','rimraf','./cmHopperHistory.attributes','exports'];(function(_0xc0213d,_0x4a3b1d){var _0x1a93c4=function(_0xc683f3){while(--_0xc683f3){_0xc0213d['push'](_0xc0213d['shift']());}};_0x1a93c4(++_0x4a3b1d);}(_0xfb0b,0x94));var _0xbfb0=function(_0x630263,_0x4b417a){_0x630263=_0x630263-0x0;var _0x1fd6f2=_0xfb0b[_0x630263];return _0x1fd6f2;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var logger=require(_0xbfb0('0x2'))('api');var moment=require(_0xbfb0('0x3'));var BPromise=require(_0xbfb0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbfb0('0x5'));var config=require('../../config/environment');var attributes=require(_0xbfb0('0x6'));module[_0xbfb0('0x7')]=function(_0x8c7fee,_0x35d657){return _0x8c7fee[_0xbfb0('0x8')](_0xbfb0('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xbfb0('0xa'),'fields':[_0xbfb0('0xa')]},{'name':_0xbfb0('0xb'),'fields':[_0xbfb0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d43a70f..b54ea4b 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 _0xa9e8=['client','http','request','then','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','options','info','debug','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','randomstring','../../config/utils','jayson/promise'];(function(_0x55598b,_0x317d37){var _0x49a70b=function(_0x3a050c){while(--_0x3a050c){_0x55598b['push'](_0x55598b['shift']());}};_0x49a70b(++_0x317d37);}(_0xa9e8,0x78));var _0x8a9e=function(_0xca4cf,_0x27f020){_0xca4cf=_0xca4cf-0x0;var _0x1152ac=_0xa9e8[_0xca4cf];return _0x1152ac;};'use strict';var _=require(_0x8a9e('0x0'));var util=require(_0x8a9e('0x1'));var moment=require(_0x8a9e('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a9e('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8a9e('0x5'));var client=jayson[_0x8a9e('0x6')][_0x8a9e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x254f8a,_0x55b987,_0x43835c){return new BPromise(function(_0x223d67,_0x5211f0){return client[_0x8a9e('0x8')](_0x254f8a,_0x43835c)[_0x8a9e('0x9')](function(_0x43342d){logger['info'](_0x8a9e('0xa'),_0x55b987,'request\x20sent');logger['debug'](_0x8a9e('0xb'),_0x55b987,_0x8a9e('0xc'),JSON[_0x8a9e('0xd')](_0x43342d));if(_0x43342d[_0x8a9e('0xe')]){if(_0x43342d[_0x8a9e('0xe')][_0x8a9e('0xf')]===0x1f4){logger[_0x8a9e('0xe')](_0x8a9e('0xa'),_0x55b987,_0x43342d[_0x8a9e('0xe')][_0x8a9e('0x10')]);return _0x5211f0(_0x43342d['error'][_0x8a9e('0x10')]);}logger['error'](_0x8a9e('0xa'),_0x55b987,_0x43342d[_0x8a9e('0xe')][_0x8a9e('0x10')]);return _0x223d67(_0x43342d[_0x8a9e('0xe')]['message']);}else{logger['info'](_0x8a9e('0xa'),_0x55b987,_0x8a9e('0xc'));_0x223d67(_0x43342d[_0x8a9e('0x11')]['message']);}})[_0x8a9e('0x12')](function(_0x35ca37){logger[_0x8a9e('0xe')](_0x8a9e('0xa'),_0x55b987,_0x35ca37);_0x5211f0(_0x35ca37);});});}exports[_0x8a9e('0x13')]=function(_0x5d2501){var _0x44c7ec=this;return new Promise(function(_0x276eab,_0x3bd6f5){return db[_0x8a9e('0x14')]['create'](_0x5d2501['body'],{'raw':_0x5d2501[_0x8a9e('0x15')]?_0x5d2501[_0x8a9e('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3b1897){logger[_0x8a9e('0x16')]('CreateCmHopperHistory',_0x5d2501);logger[_0x8a9e('0x17')](_0x8a9e('0x13'),_0x5d2501,JSON[_0x8a9e('0xd')](_0x3b1897));_0x276eab(_0x3b1897);})[_0x8a9e('0x12')](function(_0x43bd35){logger['error']('CreateCmHopperHistory',_0x43bd35[_0x8a9e('0x10')],_0x5d2501);_0x3bd6f5(_0x44c7ec[_0x8a9e('0xe')](0x1f4,_0x43bd35[_0x8a9e('0x10')]));});});};exports[_0x8a9e('0x18')]=function(_0x4a84e5){var _0x575761=this;return new Promise(function(_0x304c17,_0x4ba3cf){return db[_0x8a9e('0x14')]['findAll']({'raw':_0x4a84e5[_0x8a9e('0x15')]?_0x4a84e5['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a84e5[_0x8a9e('0x15')]?_0x4a84e5[_0x8a9e('0x15')][_0x8a9e('0x19')]||null:null,'attributes':[[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x8a9e('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x1d')))),_0x8a9e('0x1e')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x1f')))),_0x8a9e('0x20')],[db[_0x8a9e('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x21')))),_0x8a9e('0x22')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x23'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')]['literal'](_0x8a9e('0x24')))),_0x8a9e('0x25')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x23'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x26')))),_0x8a9e('0x27')]]})[_0x8a9e('0x9')](function(_0x176ac8){logger['info'](_0x8a9e('0x18'),_0x4a84e5);logger[_0x8a9e('0x17')](_0x8a9e('0x18'),_0x4a84e5,JSON[_0x8a9e('0xd')](_0x176ac8));_0x304c17(_0x176ac8);})[_0x8a9e('0x12')](function(_0xc72927){logger[_0x8a9e('0xe')](_0x8a9e('0x18'),_0xc72927[_0x8a9e('0x10')],_0x4a84e5);_0x4ba3cf(_0x575761[_0x8a9e('0xe')](0x1f4,_0xc72927[_0x8a9e('0x10')]));});});};exports[_0x8a9e('0x28')]=function(_0x31f96e){var _0x59a022=this;return new Promise(function(_0x39aa49,_0x280413){return db[_0x8a9e('0x14')][_0x8a9e('0x29')]({'raw':_0x31f96e[_0x8a9e('0x15')]?_0x31f96e[_0x8a9e('0x15')][_0x8a9e('0x2a')]===undefined?!![]:![]:!![],'where':_0x31f96e[_0x8a9e('0x15')]?_0x31f96e[_0x8a9e('0x15')]['where']||null:null,'attributes':[[_0x8a9e('0x2b'),_0x8a9e('0x2c')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db['sequelize']['fn']('IF',db[_0x8a9e('0x1a')]['literal'](_0x8a9e('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db['sequelize'][_0x8a9e('0x1c')](_0x8a9e('0x2e')))),_0x8a9e('0x2f')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')]('`state`\x20=\x204,\x201,\x20null'))),_0x8a9e('0x30')],[db['sequelize']['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x31')))),_0x8a9e('0x32')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x8a9e('0x33')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')]['literal'](_0x8a9e('0x34')))),_0x8a9e('0x35')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x8a9e('0x1c')](_0x8a9e('0x36')))),_0x8a9e('0x37')],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')]('`state`\x20=\x2013,\x201,\x20null'))),_0x8a9e('0x38')],[db['sequelize']['fn'](_0x8a9e('0x1b'),db['sequelize']['fn']('IF',db[_0x8a9e('0x1a')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x8a9e('0x39')],[db['sequelize']['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x3a')))),'outboundRejectCallsDay'],[db[_0x8a9e('0x1a')]['fn'](_0x8a9e('0x1b'),db['sequelize']['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')]('`state`\x20=\x2020,\x201,\x20null'))),_0x8a9e('0x3b')],[db[_0x8a9e('0x1a')]['fn']('COUNT',db[_0x8a9e('0x1a')]['fn']('IF',db[_0x8a9e('0x1a')][_0x8a9e('0x1c')](_0x8a9e('0x3c')))),'outboundReCallsDay']],'group':[_0x8a9e('0x2b')]})[_0x8a9e('0x9')](function(_0x3312b7){logger[_0x8a9e('0x16')](_0x8a9e('0x28'),_0x31f96e);logger[_0x8a9e('0x17')](_0x8a9e('0x28'),_0x31f96e,JSON[_0x8a9e('0xd')](_0x3312b7));_0x39aa49(_0x3312b7);})['catch'](function(_0x5551ea){logger[_0x8a9e('0xe')](_0x8a9e('0x28'),_0x5551ea[_0x8a9e('0x10')],_0x31f96e);_0x280413(_0x59a022['error'](0x1f4,_0x5551ea['message']));});});};exports[_0x8a9e('0x3d')]=function(_0x5d3c97){var _0x166970=this;return new Promise(function(_0x39d8d7,_0x68ac81){return db['CmHopperHistory']['findAll']({'raw':_0x5d3c97[_0x8a9e('0x15')]?_0x5d3c97[_0x8a9e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5d3c97[_0x8a9e('0x15')]?_0x5d3c97[_0x8a9e('0x15')][_0x8a9e('0x19')]||null:null,'attributes':[[_0x8a9e('0x2b'),_0x8a9e('0x2c')],[db['sequelize']['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['col']('id')),_0x8a9e('0x3e')],[db['sequelize']['fn'](_0x8a9e('0x1b'),db[_0x8a9e('0x1a')]['fn']('IF',db['sequelize'][_0x8a9e('0x1c')](_0x8a9e('0x1d')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x8a9e('0x9')](function(_0x2ceaa1){logger[_0x8a9e('0x16')](_0x8a9e('0x3d'),_0x5d3c97);logger[_0x8a9e('0x17')](_0x8a9e('0x3d'),_0x5d3c97,JSON['stringify'](_0x2ceaa1));_0x39d8d7(_0x2ceaa1);})[_0x8a9e('0x12')](function(_0x53d7ea){logger[_0x8a9e('0xe')](_0x8a9e('0x3d'),_0x53d7ea[_0x8a9e('0x10')],_0x5d3c97);_0x68ac81(_0x166970[_0x8a9e('0xe')](0x1f4,_0x53d7ea['message']));});});}; \ No newline at end of file +var _0xf2a6=['raw','AvgHandleTime','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x5312bc,_0x3435a0){_0x5312bc=_0x5312bc-0x0;var _0xe7e826=_0xf2a6[_0x5312bc];return _0xe7e826;};'use strict';var _=require(_0x6f2a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f2a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f2a('0x2'))['db'];var utils=require(_0x6f2a('0x3'));var logger=require(_0x6f2a('0x4'))(_0x6f2a('0x5'));var config=require(_0x6f2a('0x6'));var jayson=require(_0x6f2a('0x7'));var client=jayson[_0x6f2a('0x8')][_0x6f2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1efd8,_0x424ebd,_0x4b4fde){return new BPromise(function(_0x379b80,_0xda4179){return client[_0x6f2a('0xa')](_0x1efd8,_0x4b4fde)[_0x6f2a('0xb')](function(_0x5b1229){logger[_0x6f2a('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x424ebd,_0x6f2a('0xd'));logger[_0x6f2a('0xe')](_0x6f2a('0xf'),_0x424ebd,'request\x20sent',JSON[_0x6f2a('0x10')](_0x5b1229));if(_0x5b1229['error']){if(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x12')]===0x1f4){logger[_0x6f2a('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x424ebd,_0x5b1229[_0x6f2a('0x11')]['message']);return _0xda4179(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x13')]);}logger[_0x6f2a('0x11')](_0x6f2a('0x14'),_0x424ebd,_0x5b1229[_0x6f2a('0x11')]['message']);return _0x379b80(_0x5b1229[_0x6f2a('0x11')][_0x6f2a('0x13')]);}else{logger[_0x6f2a('0xc')](_0x6f2a('0x14'),_0x424ebd,_0x6f2a('0xd'));_0x379b80(_0x5b1229[_0x6f2a('0x15')][_0x6f2a('0x13')]);}})[_0x6f2a('0x16')](function(_0x2cf5de){logger[_0x6f2a('0x11')](_0x6f2a('0x14'),_0x424ebd,_0x2cf5de);_0xda4179(_0x2cf5de);});});}exports[_0x6f2a('0x17')]=function(_0x5c408b){var _0x46b25d=this;return new Promise(function(_0x3171b9,_0x55d117){return db[_0x6f2a('0x18')][_0x6f2a('0x19')](_0x5c408b[_0x6f2a('0x1a')],{'raw':_0x5c408b[_0x6f2a('0x1b')]?_0x5c408b[_0x6f2a('0x1b')][_0x6f2a('0x1c')]===undefined?!![]:![]:!![]})[_0x6f2a('0xb')](function(_0x33554f){logger['info'](_0x6f2a('0x17'),_0x5c408b);logger[_0x6f2a('0xe')](_0x6f2a('0x17'),_0x5c408b,JSON[_0x6f2a('0x10')](_0x33554f));_0x3171b9(_0x33554f);})[_0x6f2a('0x16')](function(_0x108b8b){logger[_0x6f2a('0x11')]('CreateCmHopperHistory',_0x108b8b[_0x6f2a('0x13')],_0x5c408b);_0x55d117(_0x46b25d['error'](0x1f4,_0x108b8b[_0x6f2a('0x13')]));});});};exports[_0x6f2a('0x1d')]=function(_0x148240){var _0x524b69=this;return new Promise(function(_0x8af4e5,_0xb7cd00){return db['CmHopperHistory']['findAll']({'raw':_0x148240[_0x6f2a('0x1b')]?_0x148240[_0x6f2a('0x1b')][_0x6f2a('0x1c')]===undefined?!![]:![]:!![],'where':_0x148240[_0x6f2a('0x1b')]?_0x148240[_0x6f2a('0x1b')]['where']||null:null,'attributes':[[db[_0x6f2a('0x1e')]['fn']('COUNT',db[_0x6f2a('0x1e')][_0x6f2a('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db['sequelize']['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x22')))),_0x6f2a('0x23')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x6f2a('0x24')],[db['sequelize']['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')]['literal'](_0x6f2a('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x26'),db['sequelize']['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x27')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x6f2a('0xb')](function(_0x277e8f){logger[_0x6f2a('0xc')](_0x6f2a('0x1d'),_0x148240);logger['debug'](_0x6f2a('0x1d'),_0x148240,JSON['stringify'](_0x277e8f));_0x8af4e5(_0x277e8f);})[_0x6f2a('0x16')](function(_0x28281f){logger[_0x6f2a('0x11')](_0x6f2a('0x1d'),_0x28281f[_0x6f2a('0x13')],_0x148240);_0xb7cd00(_0x524b69[_0x6f2a('0x11')](0x1f4,_0x28281f[_0x6f2a('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x99c894){var _0x2ce7ee=this;return new Promise(function(_0x1e0595,_0x1945ad){return db[_0x6f2a('0x18')][_0x6f2a('0x29')]({'raw':_0x99c894[_0x6f2a('0x1b')]?_0x99c894[_0x6f2a('0x1b')][_0x6f2a('0x1c')]===undefined?!![]:![]:!![],'where':_0x99c894[_0x6f2a('0x1b')]?_0x99c894[_0x6f2a('0x1b')]['where']||null:null,'attributes':[[_0x6f2a('0x2a'),_0x6f2a('0x2b')],[db[_0x6f2a('0x1e')]['fn']('COUNT',db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x2c')))),_0x6f2a('0x2d')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x22')))),_0x6f2a('0x2f')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x6f2a('0x30')],[db['sequelize']['fn']('COUNT',db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x31')))),'outboundCongestionCallsDay'],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x32')))),'outboundDropCallsDayTimeout'],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x33')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x6f2a('0x20'),db['sequelize']['fn']('IF',db[_0x6f2a('0x1e')]['literal'](_0x6f2a('0x34')))),_0x6f2a('0x35')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6f2a('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x6f2a('0x36')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x37')))),_0x6f2a('0x38')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x39')))),_0x6f2a('0x3a')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x3b')))),_0x6f2a('0x3c')],[db['sequelize']['fn']('COUNT',db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x3d')))),_0x6f2a('0x3a')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db[_0x6f2a('0x1e')][_0x6f2a('0x21')](_0x6f2a('0x3e')))),_0x6f2a('0x3f')]],'group':[_0x6f2a('0x2a')]})['then'](function(_0x2c26fc){logger['info'](_0x6f2a('0x40'),_0x99c894);logger['debug'](_0x6f2a('0x40'),_0x99c894,JSON['stringify'](_0x2c26fc));_0x1e0595(_0x2c26fc);})[_0x6f2a('0x16')](function(_0x1c1ad9){logger[_0x6f2a('0x11')]('GetVoiceQueueHopperHistory',_0x1c1ad9[_0x6f2a('0x13')],_0x99c894);_0x1945ad(_0x2ce7ee['error'](0x1f4,_0x1c1ad9[_0x6f2a('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x5add29){var _0x2e0078=this;return new Promise(function(_0x3a213c,_0x1a5afb){return db[_0x6f2a('0x18')][_0x6f2a('0x29')]({'raw':_0x5add29[_0x6f2a('0x1b')]?_0x5add29[_0x6f2a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5add29[_0x6f2a('0x1b')]?_0x5add29[_0x6f2a('0x1b')][_0x6f2a('0x41')]||null:null,'attributes':[[_0x6f2a('0x2a'),_0x6f2a('0x2b')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')][_0x6f2a('0x1f')]('id')),_0x6f2a('0x42')],[db[_0x6f2a('0x1e')]['fn'](_0x6f2a('0x20'),db[_0x6f2a('0x1e')]['fn']('IF',db['sequelize'][_0x6f2a('0x21')](_0x6f2a('0x22')))),_0x6f2a('0x43')]],'group':[_0x6f2a('0x2a')]})[_0x6f2a('0xb')](function(_0x307355){logger[_0x6f2a('0xc')](_0x6f2a('0x44'),_0x5add29);logger[_0x6f2a('0xe')]('GetCampaignHopperHistory',_0x5add29,JSON[_0x6f2a('0x10')](_0x307355));_0x3a213c(_0x307355);})[_0x6f2a('0x16')](function(_0xe5189d){logger[_0x6f2a('0x11')](_0x6f2a('0x44'),_0xe5189d[_0x6f2a('0x13')],_0x5add29);_0x1a5afb(_0x2e0078[_0x6f2a('0x11')](0x1f4,_0xe5189d[_0x6f2a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c3c021f..7972824 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 _0xccf9=['post','create','update','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','/:id'];(function(_0x53a48a,_0x1b2a7a){var _0x43ae24=function(_0x2f15e7){while(--_0x2f15e7){_0x53a48a['push'](_0x53a48a['shift']());}};_0x43ae24(++_0x1b2a7a);}(_0xccf9,0xb4));var _0x9ccf=function(_0xb8eed9,_0x154a9d){_0xb8eed9=_0xb8eed9-0x0;var _0x4ba03f=_0xccf9[_0xb8eed9];return _0x4ba03f;};'use strict';var multer=require('multer');var util=require(_0x9ccf('0x0'));var path=require(_0x9ccf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9ccf('0x2')]();var fs_extra=require(_0x9ccf('0x3'));var auth=require(_0x9ccf('0x4'));var interaction=require(_0x9ccf('0x5'));var config=require(_0x9ccf('0x6'));var controller=require(_0x9ccf('0x7'));router[_0x9ccf('0x8')]('/',auth[_0x9ccf('0x9')](),controller['index']);router['get'](_0x9ccf('0xa'),auth[_0x9ccf('0x9')](),controller['describe']);router[_0x9ccf('0x8')](_0x9ccf('0xb'),auth[_0x9ccf('0x9')](),controller['show']);router[_0x9ccf('0xc')]('/',auth['isAuthenticated'](),controller[_0x9ccf('0xd')]);router['put'](_0x9ccf('0xb'),auth[_0x9ccf('0x9')](),controller[_0x9ccf('0xe')]);module[_0x9ccf('0xf')]=router; \ No newline at end of file +var _0xdb41=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','exports','multer','util','path'];(function(_0x5c9495,_0x1ccc25){var _0x569ddf=function(_0x536b6a){while(--_0x536b6a){_0x5c9495['push'](_0x5c9495['shift']());}};_0x569ddf(++_0x1ccc25);}(_0xdb41,0x95));var _0x1db4=function(_0x426076,_0xfdf5d2){_0x426076=_0x426076-0x0;var _0x1e9565=_0xdb41[_0x426076];return _0x1e9565;};'use strict';var multer=require(_0x1db4('0x0'));var util=require(_0x1db4('0x1'));var path=require(_0x1db4('0x2'));var timeout=require(_0x1db4('0x3'));var express=require(_0x1db4('0x4'));var router=express[_0x1db4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1db4('0x6'));var interaction=require(_0x1db4('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x1db4('0x8')]('/',auth[_0x1db4('0x9')](),controller[_0x1db4('0xa')]);router[_0x1db4('0x8')](_0x1db4('0xb'),auth[_0x1db4('0x9')](),controller[_0x1db4('0xc')]);router[_0x1db4('0x8')](_0x1db4('0xd'),auth[_0x1db4('0x9')](),controller[_0x1db4('0xe')]);router[_0x1db4('0xf')]('/',auth['isAuthenticated'](),controller[_0x1db4('0x10')]);router['put'](_0x1db4('0xd'),auth[_0x1db4('0x9')](),controller[_0x1db4('0x11')]);module[_0x1db4('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index bd36370..5292422 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 _0x1928=['sequelize','exports','STRING'];(function(_0x39233a,_0x39f7e8){var _0x570189=function(_0x6b9eee){while(--_0x6b9eee){_0x39233a['push'](_0x39233a['shift']());}};_0x570189(++_0x39f7e8);}(_0x1928,0x138));var _0x8192=function(_0x3e8fd2,_0x524014){_0x3e8fd2=_0x3e8fd2-0x0;var _0x4a5e2c=_0x1928[_0x3e8fd2];return _0x4a5e2c;};'use strict';var Sequelize=require(_0x8192('0x0'));module[_0x8192('0x1')]={'name':{'type':Sequelize[_0x8192('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8192('0x2')]},'dialPrefix':{'type':Sequelize[_0x8192('0x2')]}}; \ No newline at end of file +var _0x616c=['exports','STRING'];(function(_0x240d75,_0x4850fd){var _0x438e90=function(_0x1ae2cd){while(--_0x1ae2cd){_0x240d75['push'](_0x240d75['shift']());}};_0x438e90(++_0x4850fd);}(_0x616c,0x1b6));var _0xc616=function(_0x57e043,_0x59e2bd){_0x57e043=_0x57e043-0x0;var _0x340a78=_0x616c[_0x57e043];return _0x340a78;};'use strict';var Sequelize=require('sequelize');module[_0xc616('0x0')]={'name':{'type':Sequelize[_0xc616('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc616('0x1')]},'dialPrefix':{'type':Sequelize[_0xc616('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e32976a..686e72a 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 _0x75f9=['order','ListId','includeAll','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','getContacts','CustomFields','concat','format','cf_%d','raw','CmCustomField','isEmpty','now','setHeader','attachment;\x20filename=','text/csv','/tmp/list_%d_%s.csv','sendStatus','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','Lists','error','stack','name','send','index','map','CmList','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty'];(function(_0x19f07d,_0xb52bdc){var _0x278b31=function(_0x454360){while(--_0x454360){_0x19f07d['push'](_0x19f07d['shift']());}};_0x278b31(++_0xb52bdc);}(_0x75f9,0xbf));var _0x975f=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x75f9[_0x1deb03];return _0x189fe7;};'use strict';var emlformat=require(_0x975f('0x0'));var rimraf=require(_0x975f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x975f('0x2'));var rp=require('request-promise');var moment=require(_0x975f('0x3'));var BPromise=require(_0x975f('0x4'));var Mustache=require(_0x975f('0x5'));var util=require(_0x975f('0x6'));var path=require(_0x975f('0x7'));var sox=require(_0x975f('0x8'));var csv=require(_0x975f('0x9'));var ejs=require(_0x975f('0xa'));var fs=require('fs');var fs_extra=require(_0x975f('0xb'));var _=require(_0x975f('0xc'));var squel=require(_0x975f('0xd'));var crypto=require(_0x975f('0xe'));var jsforce=require(_0x975f('0xf'));var deskjs=require(_0x975f('0x10'));var toCsv=require(_0x975f('0x9'));var querystring=require(_0x975f('0x11'));var Papa=require(_0x975f('0x12'));var Redis=require('ioredis');var authService=require(_0x975f('0x13'));var qs=require(_0x975f('0x14'));var as=require(_0x975f('0x15'));var hardwareService=require(_0x975f('0x16'));var logger=require(_0x975f('0x17'))(_0x975f('0x18'));var utils=require(_0x975f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x975f('0x1a'))['db'];config[_0x975f('0x1b')]=_[_0x975f('0x1c')](config['redis'],{'host':_0x975f('0x1d'),'port':0x18eb});var socket=require(_0x975f('0x1e'))(new Redis(config[_0x975f('0x1b')]));require(_0x975f('0x1f'))[_0x975f('0x20')](socket);function respondWithStatusCode(_0x4df479,_0x3e235f){_0x3e235f=_0x3e235f||0xcc;return function(_0x33a0ad){if(_0x33a0ad){return _0x4df479['sendStatus'](_0x3e235f);}return _0x4df479[_0x975f('0x21')](_0x3e235f)[_0x975f('0x22')]();};}function respondWithResult(_0x1c712e,_0x181d5b){_0x181d5b=_0x181d5b||0xc8;return function(_0x112241){if(_0x112241){return _0x1c712e[_0x975f('0x21')](_0x181d5b)[_0x975f('0x23')](_0x112241);}};}function respondWithFilteredResult(_0x123169,_0x25597e){return function(_0x48bcda){if(_0x48bcda){var _0x5b1fbe=typeof _0x25597e[_0x975f('0x24')]===_0x975f('0x25')&&typeof _0x25597e[_0x975f('0x26')]==='undefined';var _0x32f52d=_0x48bcda['count'];var _0x11c6d2=_0x5b1fbe?0x0:_0x25597e['offset'];var _0x272c65=_0x5b1fbe?_0x48bcda[_0x975f('0x27')]:_0x25597e[_0x975f('0x24')]+_0x25597e['limit'];var _0x5d4116;if(_0x272c65>=_0x32f52d){_0x272c65=_0x32f52d;_0x5d4116=0xc8;}else{_0x5d4116=0xce;}_0x123169[_0x975f('0x21')](_0x5d4116);return _0x123169['set']('Content-Range',_0x11c6d2+'-'+_0x272c65+'/'+_0x32f52d)['json'](_0x48bcda);}return null;};}function patchUpdates(_0x574ee4){return function(_0x53b6a2){try{jsonpatch[_0x975f('0x28')](_0x53b6a2,_0x574ee4,!![]);}catch(_0x2abb27){return BPromise[_0x975f('0x29')](_0x2abb27);}return _0x53b6a2['save']();};}function saveUpdates(_0x1dfc72,_0x203436){return function(_0x2a21ad){if(_0x2a21ad){return _0x2a21ad[_0x975f('0x2a')](_0x1dfc72)[_0x975f('0x2b')](function(_0x331555){return _0x331555;});}return null;};}function removeEntity(_0xe736cc,_0xd5045d){return function(_0x5ac434){if(_0x5ac434){return _0x5ac434[_0x975f('0x2c')]()[_0x975f('0x2b')](function(){var _0x424c03=_0x5ac434[_0x975f('0x2d')]({'plain':!![]});var _0x451d23=_0x975f('0x2e');return db['UserProfileResource'][_0x975f('0x2c')]({'where':{'type':_0x451d23,'resourceId':_0x424c03['id']}})[_0x975f('0x2b')](function(){return _0x5ac434;});})[_0x975f('0x2b')](function(){_0xe736cc['status'](0xcc)[_0x975f('0x22')]();});}};}function handleEntityNotFound(_0x511d1d,_0x24c6b7){return function(_0x574731){if(!_0x574731){_0x511d1d['sendStatus'](0x194);}return _0x574731;};}function handleError(_0x3f2fe1,_0x47fccf){_0x47fccf=_0x47fccf||0x1f4;return function(_0x1ed736){logger[_0x975f('0x2f')](_0x1ed736[_0x975f('0x30')]);if(_0x1ed736[_0x975f('0x31')]){delete _0x1ed736['name'];}_0x3f2fe1[_0x975f('0x21')](_0x47fccf)[_0x975f('0x32')](_0x1ed736);};}exports[_0x975f('0x33')]=function(_0x424ffc,_0x5f58cf){var _0x1b0f80={},_0x3ca0c5={},_0x4a8753={'count':0x0,'rows':[]};var _0xbe2d5e=_[_0x975f('0x34')](db[_0x975f('0x35')]['rawAttributes'],function(_0x583272){return{'name':_0x583272[_0x975f('0x36')],'type':_0x583272[_0x975f('0x37')]['key']};});_0x3ca0c5[_0x975f('0x38')]=_[_0x975f('0x34')](_0xbe2d5e,'name');_0x3ca0c5[_0x975f('0x39')]=_[_0x975f('0x3a')](_0x424ffc[_0x975f('0x39')]);_0x3ca0c5[_0x975f('0x3b')]=_['intersection'](_0x3ca0c5['model'],_0x3ca0c5['query']);_0x1b0f80[_0x975f('0x3c')]=_[_0x975f('0x3d')](_0x3ca0c5[_0x975f('0x38')],qs[_0x975f('0x3e')](_0x424ffc[_0x975f('0x39')]['fields']));_0x1b0f80['attributes']=_0x1b0f80['attributes']['length']?_0x1b0f80[_0x975f('0x3c')]:_0x3ca0c5['model'];if(!_0x424ffc['query']['hasOwnProperty'](_0x975f('0x3f'))){_0x1b0f80[_0x975f('0x26')]=qs[_0x975f('0x26')](_0x424ffc[_0x975f('0x39')]['limit']);_0x1b0f80['offset']=qs[_0x975f('0x24')](_0x424ffc[_0x975f('0x39')][_0x975f('0x24')]);}_0x1b0f80['order']=qs['sort'](_0x424ffc['query'][_0x975f('0x40')]);_0x1b0f80[_0x975f('0x41')]=qs['filters'](_[_0x975f('0x42')](_0x424ffc['query'],_0x3ca0c5['filters']),_0xbe2d5e);if(_0x424ffc[_0x975f('0x39')][_0x975f('0x43')]){_0x1b0f80['where']=_[_0x975f('0x44')](_0x1b0f80[_0x975f('0x41')],{'$or':_[_0x975f('0x34')](_0xbe2d5e,function(_0x4d259c){if(_0x4d259c[_0x975f('0x37')]!==_0x975f('0x45')){var _0x73c00d={};_0x73c00d[_0x4d259c[_0x975f('0x31')]]={'$like':'%'+_0x424ffc['query']['filter']+'%'};return _0x73c00d;}})});}_0x1b0f80=_[_0x975f('0x44')]({},_0x1b0f80,_0x424ffc[_0x975f('0x46')]);var _0x6ab7a2={'where':_0x1b0f80[_0x975f('0x41')]};return db[_0x975f('0x35')][_0x975f('0x27')](_0x6ab7a2)[_0x975f('0x2b')](function(_0x2a3405){_0x4a8753[_0x975f('0x27')]=_0x2a3405;if(_0x424ffc['query']['includeAll']){_0x1b0f80[_0x975f('0x47')]=[{'all':!![]}];}return db[_0x975f('0x35')][_0x975f('0x48')](_0x1b0f80);})[_0x975f('0x2b')](function(_0xb1410){_0x4a8753['rows']=_0xb1410;return _0x4a8753;})[_0x975f('0x2b')](respondWithFilteredResult(_0x5f58cf,_0x1b0f80))['catch'](handleError(_0x5f58cf,null));};exports[_0x975f('0x49')]=function(_0x4a2568,_0xb11700){var _0x471d75={'raw':![],'where':{'id':_0x4a2568[_0x975f('0x4a')]['id']}},_0x1179f6={};_0x1179f6[_0x975f('0x38')]=_[_0x975f('0x3a')](db['CmList'][_0x975f('0x4b')]);_0x1179f6[_0x975f('0x39')]=_['keys'](_0x4a2568[_0x975f('0x39')]);_0x1179f6[_0x975f('0x3b')]=_[_0x975f('0x3d')](_0x1179f6[_0x975f('0x38')],_0x1179f6['query']);_0x471d75[_0x975f('0x3c')]=_[_0x975f('0x3d')](_0x1179f6[_0x975f('0x38')],qs[_0x975f('0x3e')](_0x4a2568[_0x975f('0x39')][_0x975f('0x3e')]));_0x471d75[_0x975f('0x3c')]=_0x471d75['attributes'][_0x975f('0x4c')]?_0x471d75[_0x975f('0x3c')]:_0x1179f6[_0x975f('0x38')];if(_0x4a2568['query']['includeAll']){_0x471d75['include']=[{'all':!![]}];}_0x471d75=_[_0x975f('0x44')]({},_0x471d75,_0x4a2568[_0x975f('0x46')]);return db['CmList'][_0x975f('0x4d')](_0x471d75)['then'](handleEntityNotFound(_0xb11700,null))[_0x975f('0x2b')](respondWithResult(_0xb11700,null))['catch'](handleError(_0xb11700,null));};exports[_0x975f('0x4e')]=function(_0x1778d2,_0x2b567f){return db[_0x975f('0x35')][_0x975f('0x4e')](_0x1778d2[_0x975f('0x4f')],{})['then'](function(_0x1c0e38){var _0x2e51e6=_0x1778d2[_0x975f('0x50')][_0x975f('0x2d')]({'plain':!![]});if(!_0x2e51e6)throw new Error(_0x975f('0x51'));if(_0x2e51e6[_0x975f('0x52')]==='user'){var _0x344640=_0x1c0e38[_0x975f('0x2d')]({'plain':!![]});var _0x1be326=_0x975f('0x2e');return db[_0x975f('0x53')][_0x975f('0x4d')]({'where':{'name':_0x1be326,'userProfileId':_0x2e51e6[_0x975f('0x54')]},'raw':!![]})[_0x975f('0x2b')](function(_0x1ddfc3){if(_0x1ddfc3&&_0x1ddfc3['autoAssociation']===0x0){return db[_0x975f('0x55')][_0x975f('0x4e')]({'name':_0x344640[_0x975f('0x31')],'resourceId':_0x344640['id'],'type':_0x1ddfc3['name'],'sectionId':_0x1ddfc3['id']},{})[_0x975f('0x2b')](function(){return _0x1c0e38;});}else{return _0x1c0e38;}})[_0x975f('0x56')](function(_0x40e368){logger[_0x975f('0x2f')](_0x975f('0x57'),_0x40e368);throw _0x40e368;});}return _0x1c0e38;})['then'](respondWithResult(_0x2b567f,0xc9))[_0x975f('0x56')](handleError(_0x2b567f,null));};exports[_0x975f('0x2a')]=function(_0x63f0af,_0x41adc0){if(_0x63f0af[_0x975f('0x4f')]['id']){delete _0x63f0af['body']['id'];}return db[_0x975f('0x35')]['find']({'where':{'id':_0x63f0af['params']['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x41adc0,null))[_0x975f('0x2b')](saveUpdates(_0x63f0af[_0x975f('0x4f')],null))[_0x975f('0x2b')](respondWithResult(_0x41adc0,null))['catch'](handleError(_0x41adc0,null));};exports[_0x975f('0x2c')]=function(_0xa5eb1a,_0x45af12){return db[_0x975f('0x35')][_0x975f('0x4d')]({'where':{'id':_0xa5eb1a[_0x975f('0x4a')]['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x45af12,null))[_0x975f('0x2b')](removeEntity(_0x45af12,null))[_0x975f('0x56')](handleError(_0x45af12,null));};exports[_0x975f('0x58')]=function(_0x45731b,_0x2dd516){return db[_0x975f('0x35')]['describe']()[_0x975f('0x2b')](respondWithResult(_0x2dd516,null))['catch'](handleError(_0x2dd516,null));};exports[_0x975f('0x59')]=function(_0x3d605d,_0x4f7528,_0x5b4e9e){if(_0x3d605d[_0x975f('0x4f')]['id']){delete _0x3d605d['body']['id'];}return db['CmList'][_0x975f('0x4d')]({'where':{'id':_0x3d605d[_0x975f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7528,null))[_0x975f('0x2b')](function(_0x811f0d){if(_0x811f0d){_0x3d605d[_0x975f('0x4f')]['ListId']=_0x811f0d['id'];return db[_0x975f('0x5a')][_0x975f('0x4e')](_0x3d605d[_0x975f('0x4f')]);}})['then'](respondWithResult(_0x4f7528,null))[_0x975f('0x56')](handleError(_0x4f7528,null));};exports['getDispositions']=function(_0x260ac8,_0x15d252,_0x1fb8e7){var _0x5e8fc0={'raw':![],'where':{}};var _0xd9cd8c={};var _0x1c0d97={'count':0x0,'rows':[]};return db[_0x975f('0x35')][_0x975f('0x5b')]({'where':{'id':_0x260ac8[_0x975f('0x4a')]['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x15d252,null))[_0x975f('0x2b')](function(_0x353089){if(_0x353089){_0xd9cd8c['model']=_[_0x975f('0x3a')](db['Disposition'][_0x975f('0x4b')]);_0xd9cd8c[_0x975f('0x39')]=_[_0x975f('0x3a')](_0x260ac8['query']);_0xd9cd8c['filters']=_['intersection'](_0xd9cd8c['model'],_0xd9cd8c[_0x975f('0x39')]);_0x5e8fc0[_0x975f('0x3c')]=_[_0x975f('0x3d')](_0xd9cd8c[_0x975f('0x38')],qs['fields'](_0x260ac8[_0x975f('0x39')]['fields']));_0x5e8fc0[_0x975f('0x3c')]=_0x5e8fc0[_0x975f('0x3c')][_0x975f('0x4c')]?_0x5e8fc0['attributes']:_0xd9cd8c['model'];if(!_0x260ac8[_0x975f('0x39')][_0x975f('0x5c')](_0x975f('0x3f'))){_0x5e8fc0[_0x975f('0x26')]=qs[_0x975f('0x26')](_0x260ac8[_0x975f('0x39')]['limit']);_0x5e8fc0[_0x975f('0x24')]=qs[_0x975f('0x24')](_0x260ac8[_0x975f('0x39')][_0x975f('0x24')]);}_0x5e8fc0[_0x975f('0x5d')]=qs[_0x975f('0x40')](_0x260ac8['query']['sort']);_0x5e8fc0[_0x975f('0x41')]=qs['filters'](_[_0x975f('0x42')](_0x260ac8[_0x975f('0x39')],_0xd9cd8c[_0x975f('0x3b')]));_0x5e8fc0[_0x975f('0x41')][_0x975f('0x5e')]=_0x353089['id'];if(_0x260ac8['query'][_0x975f('0x43')]){_0x5e8fc0[_0x975f('0x41')]=_['merge'](_0x5e8fc0['where'],{'$or':_[_0x975f('0x34')](_0x5e8fc0[_0x975f('0x3c')],function(_0x15415d){var _0xcf7c95={};_0xcf7c95[_0x15415d]={'$like':'%'+_0x260ac8[_0x975f('0x39')][_0x975f('0x43')]+'%'};return _0xcf7c95;})});}_0x5e8fc0=_[_0x975f('0x44')]({},_0x5e8fc0,_0x260ac8['options']);return db['Disposition']['count']({'where':_0x5e8fc0[_0x975f('0x41')]})['then'](function(_0x2e574f){_0x1c0d97[_0x975f('0x27')]=_0x2e574f;if(_0x260ac8[_0x975f('0x39')][_0x975f('0x5f')]){_0x5e8fc0[_0x975f('0x47')]=[{'all':!![]}];}return db[_0x975f('0x5a')][_0x975f('0x48')](_0x5e8fc0);})['then'](function(_0x9e9984){_0x1c0d97[_0x975f('0x60')]=_0x9e9984;return _0x1c0d97;});}})[_0x975f('0x2b')](respondWithFilteredResult(_0x15d252,_0x5e8fc0))[_0x975f('0x56')](handleError(_0x15d252,null));};exports[_0x975f('0x61')]=function(_0x5792f2,_0x6a7097,_0x53020b){return db[_0x975f('0x35')][_0x975f('0x4d')]({'where':{'id':_0x5792f2[_0x975f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6a7097,null))[_0x975f('0x2b')](function(_0x35c684){if(_0x35c684){return _0x35c684['removeDispositions'](_0x5792f2[_0x975f('0x39')][_0x975f('0x62')]);}})[_0x975f('0x2b')](respondWithStatusCode(_0x6a7097,null))[_0x975f('0x56')](handleError(_0x6a7097,null));};exports[_0x975f('0x63')]=function(_0xcbc477,_0x2dfb3d,_0x387818){return db[_0x975f('0x35')]['find']({'where':{'id':_0xcbc477[_0x975f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2dfb3d,null))[_0x975f('0x2b')](function(_0x24aac2){if(_0x24aac2){var _0x599979=[];var _0x1a56da={'success':[],'errors':[]};return db[_0x975f('0x64')][_0x975f('0x58')]()['then'](function(_0x40a3eb){if(_0xcbc477['body'][_0x975f('0x65')]&&_[_0x975f('0x66')](_0xcbc477[_0x975f('0x4f')][_0x975f('0x65')])){if(_0xcbc477[_0x975f('0x4f')][_0x975f('0x65')][_0x975f('0x4c')]){_0xcbc477[_0x975f('0x4f')][_0x975f('0x65')]=_0xcbc477[_0x975f('0x4f')]['tags']['join'](';')+';';}else{_0xcbc477[_0x975f('0x4f')][_0x975f('0x65')]=null;}}else{_0xcbc477[_0x975f('0x4f')][_0x975f('0x65')]=null;}if(_0xcbc477[_0x975f('0x4f')]&&_[_0x975f('0x66')](_0xcbc477['body'])){for(var _0x88f07e=0x0;_0x88f07e<_0xcbc477[_0x975f('0x4f')]['length'];_0x88f07e+=0x1){_0xcbc477[_0x975f('0x4f')][_0x88f07e][_0x975f('0x5e')]=_0xcbc477[_0x975f('0x4a')]['id'];_0x599979[_0x975f('0x67')](_0xcbc477[_0x975f('0x4f')][_0x88f07e]);}return BPromise[_0x975f('0x68')](_0x599979,function(_0x5d534b){return db['CmContact'][_0x975f('0x4e')](_[_0x975f('0x69')](_0x5d534b,[_0x975f('0x62'),'id'])||{},{'fields':_['keys'](_0x40a3eb),'raw':!![]})[_0x975f('0x2b')](function(_0x2fcef7){_0x1a56da[_0x975f('0x6a')][_0x975f('0x67')](_0x2fcef7[_0x975f('0x6b')]);})[_0x975f('0x56')](function(_0x51b91c){_0x1a56da[_0x975f('0x6c')]['push']({'data':_0x5d534b,'error':_0x51b91c[_0x975f('0x6d')]});});})[_0x975f('0x2b')](function(_0x35eaf3){return _0x1a56da;})[_0x975f('0x56')](function(_0x3f67f1){return _0x3f67f1;});}else{_0x2dfb3d['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x975f('0x2b')](respondWithResult(_0x2dfb3d,null))[_0x975f('0x56')](handleError(_0x2dfb3d,null));};exports[_0x975f('0x6e')]=function(_0x3b328f,_0x47e12d,_0x516a1d){var _0x3db5a8;return db[_0x975f('0x35')][_0x975f('0x4d')]({'where':{'id':_0x3b328f[_0x975f('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x975f('0x6f')}]})[_0x975f('0x2b')](handleEntityNotFound(_0x47e12d,null))[_0x975f('0x2b')](function(_0x5cbd23){if(_0x5cbd23){_0x3db5a8=_0x5cbd23;return db[_0x975f('0x64')][_0x975f('0x4b')];}})[_0x975f('0x2b')](function(_0x2f6601){if(_0x2f6601){var _0x202e22={};var _0xa92e95={};_0xa92e95['model']=_[_0x975f('0x70')](_[_0x975f('0x3a')](_0x2f6601),_[_0x975f('0x34')](_0x3db5a8['CustomFields'],function(_0x1a9ae8){return util[_0x975f('0x71')](_0x975f('0x72'),_0x1a9ae8['id']);}));_0xa92e95[_0x975f('0x39')]=_['keys'](_0x3b328f[_0x975f('0x39')]);_0xa92e95[_0x975f('0x3b')]=_[_0x975f('0x3d')](_0xa92e95[_0x975f('0x38')],_0xa92e95['query']);_0x202e22[_0x975f('0x3c')]=_[_0x975f('0x3d')](_0xa92e95[_0x975f('0x38')],qs['fields'](_0x3b328f[_0x975f('0x39')]['fields']));_0x202e22[_0x975f('0x3c')]=_0x202e22[_0x975f('0x3c')]['length']?_0x202e22[_0x975f('0x3c')]:_0xa92e95['model'];if(!_0x3b328f['query'][_0x975f('0x5c')](_0x975f('0x3f'))){_0x202e22[_0x975f('0x26')]=qs[_0x975f('0x26')](_0x3b328f['query']['limit']);_0x202e22['offset']=qs[_0x975f('0x24')](_0x3b328f[_0x975f('0x39')][_0x975f('0x24')]);}_0x202e22[_0x975f('0x5d')]=qs[_0x975f('0x40')](_0x3b328f[_0x975f('0x39')][_0x975f('0x40')]);_0x202e22['where']=qs['filters'](_[_0x975f('0x42')](_0x3b328f[_0x975f('0x39')],_0xa92e95[_0x975f('0x3b')]));_0x202e22[_0x975f('0x73')]=!![];if(_0x3b328f[_0x975f('0x39')][_0x975f('0x43')]){_0x202e22[_0x975f('0x41')]=_['merge'](_0x202e22[_0x975f('0x41')],{'$or':_['map'](_0x202e22[_0x975f('0x3c')],function(_0x3d654a){var _0x2066af={};_0x2066af[_0x3d654a]={'$like':'%'+_0x3b328f['query']['filter']+'%'};return _0x2066af;})});}_0x202e22=_['merge']({},_0x202e22,_0x3b328f[_0x975f('0x46')]);return _0x3db5a8[_0x975f('0x6e')](_0x202e22);}})['then'](respondWithResult(_0x47e12d,null))[_0x975f('0x56')](handleError(_0x47e12d,null));};exports['getContactsCsv']=function(_0x4f9bf3,_0x56512e,_0x5eaa2e){var _0x31eb9;return db[_0x975f('0x35')]['find']({'where':{'id':_0x4f9bf3['params']['id']},'include':[{'model':db[_0x975f('0x74')],'as':_0x975f('0x6f')}]})[_0x975f('0x2b')](handleEntityNotFound(_0x56512e,null))[_0x975f('0x2b')](function(_0x250ba0){if(_0x250ba0){_0x31eb9=_0x250ba0;return db[_0x975f('0x64')][_0x975f('0x4b')];}})[_0x975f('0x2b')](function(_0x20017d){if(_0x20017d){var _0x25b7a3={};var _0x2e64b3={};_0x2e64b3['model']=_['concat'](_['keys'](_0x20017d),_['map'](_0x31eb9[_0x975f('0x6f')],function(_0x350a8d){return util[_0x975f('0x71')](_0x975f('0x72'),_0x350a8d['id']);}));_0x2e64b3[_0x975f('0x39')]=_[_0x975f('0x3a')](_0x4f9bf3[_0x975f('0x39')]);_0x2e64b3[_0x975f('0x3b')]=_['intersection'](_0x2e64b3['model'],_0x2e64b3['query']);_0x25b7a3[_0x975f('0x3c')]=_[_0x975f('0x3d')](_0x2e64b3[_0x975f('0x38')],qs[_0x975f('0x3e')](_0x4f9bf3['query'][_0x975f('0x3e')]));_0x25b7a3[_0x975f('0x3c')]=_0x25b7a3['attributes'][_0x975f('0x4c')]?_0x25b7a3[_0x975f('0x3c')]:_0x2e64b3[_0x975f('0x38')];if(!_0x4f9bf3[_0x975f('0x39')]['hasOwnProperty']('nolimit')){_0x25b7a3[_0x975f('0x26')]=qs[_0x975f('0x26')](_0x4f9bf3[_0x975f('0x39')][_0x975f('0x26')]);_0x25b7a3['offset']=qs[_0x975f('0x24')](_0x4f9bf3[_0x975f('0x39')][_0x975f('0x24')]);}_0x25b7a3[_0x975f('0x5d')]=qs['sort'](_0x4f9bf3['query'][_0x975f('0x40')]);_0x25b7a3['where']=qs[_0x975f('0x3b')](_['pick'](_0x4f9bf3['query'],_0x2e64b3[_0x975f('0x3b')]));_0x25b7a3[_0x975f('0x73')]=!![];if(_0x4f9bf3[_0x975f('0x39')][_0x975f('0x43')]){_0x25b7a3[_0x975f('0x41')]=_[_0x975f('0x44')](_0x25b7a3[_0x975f('0x41')],{'$or':_[_0x975f('0x34')](_0x25b7a3[_0x975f('0x3c')],function(_0x1a83d1){var _0xbd12b3={};_0xbd12b3[_0x1a83d1]={'$like':'%'+_0x4f9bf3[_0x975f('0x39')][_0x975f('0x43')]+'%'};return _0xbd12b3;})});}_0x25b7a3=_[_0x975f('0x44')]({},_0x25b7a3,_0x4f9bf3[_0x975f('0x46')]);return _0x31eb9[_0x975f('0x6e')](_0x25b7a3);}})[_0x975f('0x2b')](function(_0x442507){if(!_[_0x975f('0x75')](_0x442507)){var _0x459fa5=toCsv(_0x442507);var _0x42357d=Date[_0x975f('0x76')]();fs['writeFileSync'](util[_0x975f('0x71')]('/tmp/list_%d_%s.csv',_0x31eb9['id'],_0x42357d),_0x459fa5);_0x56512e[_0x975f('0x77')]('Content-disposition',_0x975f('0x78')+util['format']('list_%d_%s.csv',_0x31eb9['id'],_0x42357d));_0x56512e[_0x975f('0x77')]('Content-type',_0x975f('0x79'));return _0x56512e['download'](util[_0x975f('0x71')](_0x975f('0x7a'),_0x31eb9['id'],_0x42357d));}else{return _0x56512e[_0x975f('0x7b')](0xcc);}})[_0x975f('0x56')](handleError(_0x56512e,null));};exports[_0x975f('0x7c')]=function(_0x1021ec,_0x41db07,_0x1bcd19){var _0x2df778;delete _0x1021ec[_0x975f('0x4f')]['id'];return db[_0x975f('0x35')][_0x975f('0x5b')]({'where':{'id':_0x1021ec[_0x975f('0x4a')]['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x41db07,null))[_0x975f('0x2b')](function(_0x3a928c){if(_0x3a928c){return db[_0x975f('0x7d')]['transaction'](function(_0x5c0bde){return db[_0x975f('0x74')][_0x975f('0x4e')](_0x1021ec[_0x975f('0x4f')],{'transaction':_0x5c0bde})['then'](function(_0x13bef){_0x2df778=_0x13bef;return _0x3a928c[_0x975f('0x7e')](_0x13bef,{'transaction':_0x5c0bde});})[_0x975f('0x2b')](function(){var _0x2234a8={'type':db[_0x975f('0x7f')]['TEXT'],'transaction':_0x5c0bde};switch(_0x1021ec[_0x975f('0x4f')]['type']){case _0x975f('0x80'):_0x2234a8[_0x975f('0x37')]=db[_0x975f('0x7f')][_0x975f('0x81')];break;case _0x975f('0x82'):_0x2234a8[_0x975f('0x37')]=db['Sequelize']['INTEGER'];break;case'switch':_0x2234a8['type']=db[_0x975f('0x7f')]['BOOLEAN'];_0x2234a8[_0x975f('0x83')]=![];break;default:}return db[_0x975f('0x7d')][_0x975f('0x84')][_0x975f('0x85')]('cm_contacts',util[_0x975f('0x71')](_0x975f('0x86'),_0x2df778['id']),_0x2234a8);})[_0x975f('0x2b')](function(){return _0x2df778;});});}})[_0x975f('0x2b')](respondWithResult(_0x41db07,null))[_0x975f('0x56')](handleError(_0x41db07,null));};exports[_0x975f('0x87')]=function(_0x269c21,_0x522213,_0x23650e){var _0x3c5f6c={};var _0x3cf488={};var _0x5e4e5b;var _0x6116b8;return db[_0x975f('0x35')][_0x975f('0x5b')]({'where':{'id':_0x269c21['params']['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x522213,null))['then'](function(_0x1dfb00){if(_0x1dfb00){_0x5e4e5b=_0x1dfb00;_0x3cf488['model']=_[_0x975f('0x3a')](db[_0x975f('0x74')]['rawAttributes']);_0x3cf488[_0x975f('0x39')]=_[_0x975f('0x3a')](_0x269c21[_0x975f('0x39')]);_0x3cf488[_0x975f('0x3b')]=_[_0x975f('0x3d')](_0x3cf488['model'],_0x3cf488[_0x975f('0x39')]);_0x3c5f6c['attributes']=_[_0x975f('0x3d')](_0x3cf488['model'],qs['fields'](_0x269c21['query'][_0x975f('0x3e')]));_0x3c5f6c[_0x975f('0x3c')]=_0x3c5f6c[_0x975f('0x3c')][_0x975f('0x4c')]?_0x3c5f6c[_0x975f('0x3c')]:_0x3cf488[_0x975f('0x38')];_0x3c5f6c[_0x975f('0x5d')]=qs[_0x975f('0x40')](_0x269c21['query']['sort']);_0x3c5f6c[_0x975f('0x41')]=qs[_0x975f('0x3b')](_[_0x975f('0x42')](_0x269c21[_0x975f('0x39')],_0x3cf488[_0x975f('0x3b')]));_0x3c5f6c[_0x975f('0x41')]=_[_0x975f('0x44')](_0x3c5f6c[_0x975f('0x41')],{'$or':[{'ListId':_0x1dfb00['id']},{'ListId':null}]});if(_0x269c21[_0x975f('0x39')][_0x975f('0x43')]){_0x3c5f6c[_0x975f('0x41')]=_['merge'](_0x3c5f6c[_0x975f('0x41')],{'$or':_[_0x975f('0x34')](_0x3c5f6c[_0x975f('0x3c')],function(_0x494939){var _0x332197={};_0x332197[_0x494939]={'$like':'%'+_0x269c21[_0x975f('0x39')][_0x975f('0x43')]+'%'};return _0x332197;})});}_0x3c5f6c=_['merge']({},_0x3c5f6c,_0x269c21['options']);return db[_0x975f('0x74')][_0x975f('0x88')](_0x3c5f6c);}})[_0x975f('0x2b')](respondWithResult(_0x522213,null))[_0x975f('0x56')](handleError(_0x522213,null));};exports['addAgents']=function(_0xe7d1fb,_0x2f3900,_0x13a1bc){return db['CmList'][_0x975f('0x4d')]({'where':{'id':_0xe7d1fb[_0x975f('0x4a')]['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x2f3900,null))[_0x975f('0x2b')](function(_0x5600db){if(_0x5600db){return _0x5600db['addAgents'](_0xe7d1fb[_0x975f('0x4f')][_0x975f('0x62')],_[_0x975f('0x69')](_0xe7d1fb[_0x975f('0x4f')],['ids','id'])||{})[_0x975f('0x89')](function(_0x27290a){for(var _0x12185e=0x0;_0x12185e<_0xe7d1fb[_0x975f('0x4f')]['ids'][_0x975f('0x4c')];_0x12185e+=0x1){socket[_0x975f('0x8a')]('userCmList:save',{'UserId':Number(_0xe7d1fb['body'][_0x975f('0x62')][_0x12185e]),'CmListId':Number(_0xe7d1fb[_0x975f('0x4a')]['id'])});}return _0x27290a;});}})[_0x975f('0x2b')](respondWithResult(_0x2f3900,null))[_0x975f('0x56')](handleError(_0x2f3900,null));};exports[_0x975f('0x8b')]=function(_0x3e4b6a,_0x34c874,_0x9700ea){return db[_0x975f('0x35')][_0x975f('0x4d')]({'where':{'id':_0x3e4b6a[_0x975f('0x4a')]['id']}})[_0x975f('0x2b')](handleEntityNotFound(_0x34c874,null))[_0x975f('0x2b')](function(_0x17ef78){if(_0x17ef78){return _0x17ef78['removeAgents'](_0x3e4b6a[_0x975f('0x39')][_0x975f('0x62')])[_0x975f('0x2b')](function(){if(_[_0x975f('0x66')](_0x3e4b6a[_0x975f('0x39')][_0x975f('0x62')])){for(var _0x5a65ea=0x0;_0x5a65ea<_0x3e4b6a[_0x975f('0x39')]['ids'][_0x975f('0x4c')];_0x5a65ea+=0x1){socket[_0x975f('0x8a')](_0x975f('0x8c'),{'UserId':Number(_0x3e4b6a[_0x975f('0x39')]['ids'][_0x5a65ea]),'CmListId':Number(_0x3e4b6a[_0x975f('0x4a')]['id'])});}}else{socket[_0x975f('0x8a')]('userCmList:remove',{'UserId':Number(_0x3e4b6a['query'][_0x975f('0x62')]),'CmListId':Number(_0x3e4b6a['params']['id'])});}});}})[_0x975f('0x2b')](respondWithStatusCode(_0x34c874,null))[_0x975f('0x56')](handleError(_0x34c874,null));};exports[_0x975f('0x8d')]=function(_0x10b9f2,_0x53c933,_0x424853){var _0x1f8775={};var _0x3c5fae={};var _0x45418b;var _0x53a568;return db['CmList']['findOne']({'where':{'id':_0x10b9f2[_0x975f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53c933,null))[_0x975f('0x2b')](function(_0x1f795d){if(_0x1f795d){_0x45418b=_0x1f795d;_0x3c5fae[_0x975f('0x38')]=_[_0x975f('0x3a')](db['User'][_0x975f('0x4b')]);_0x3c5fae[_0x975f('0x39')]=_[_0x975f('0x3a')](_0x10b9f2[_0x975f('0x39')]);_0x3c5fae[_0x975f('0x3b')]=_[_0x975f('0x3d')](_0x3c5fae[_0x975f('0x38')],_0x3c5fae[_0x975f('0x39')]);_0x1f8775['attributes']=_[_0x975f('0x3d')](_0x3c5fae[_0x975f('0x38')],qs[_0x975f('0x3e')](_0x10b9f2[_0x975f('0x39')][_0x975f('0x3e')]));_0x1f8775[_0x975f('0x3c')]=_0x1f8775['attributes'][_0x975f('0x4c')]?_0x1f8775[_0x975f('0x3c')]:_0x3c5fae[_0x975f('0x38')];_0x1f8775[_0x975f('0x5d')]=qs[_0x975f('0x40')](_0x10b9f2[_0x975f('0x39')][_0x975f('0x40')]);_0x1f8775[_0x975f('0x41')]=qs[_0x975f('0x3b')](_[_0x975f('0x42')](_0x10b9f2['query'],_0x3c5fae[_0x975f('0x3b')]));if(_0x10b9f2['query'][_0x975f('0x43')]){_0x1f8775[_0x975f('0x41')]=_['merge'](_0x1f8775[_0x975f('0x41')],{'$or':_[_0x975f('0x34')](_0x1f8775[_0x975f('0x3c')],function(_0x49c273){var _0xe7e2f2={};_0xe7e2f2[_0x49c273]={'$like':'%'+_0x10b9f2[_0x975f('0x39')]['filter']+'%'};return _0xe7e2f2;})});}_0x1f8775=_[_0x975f('0x44')]({},_0x1f8775,_0x10b9f2[_0x975f('0x46')]);return _0x45418b[_0x975f('0x8d')](_0x1f8775);}})[_0x975f('0x2b')](function(_0x30fa77){if(_0x30fa77){_0x53a568=_0x30fa77['length'];if(!_0x10b9f2[_0x975f('0x39')][_0x975f('0x5c')](_0x975f('0x3f'))){_0x1f8775[_0x975f('0x26')]=qs[_0x975f('0x26')](_0x10b9f2['query']['limit']);_0x1f8775[_0x975f('0x24')]=qs['offset'](_0x10b9f2[_0x975f('0x39')][_0x975f('0x24')]);}return _0x45418b[_0x975f('0x8d')](_0x1f8775);}})[_0x975f('0x2b')](function(_0x25b8ca){if(_0x25b8ca){return _0x25b8ca?{'count':_0x53a568,'rows':_0x25b8ca}:null;}})[_0x975f('0x2b')](respondWithResult(_0x53c933,null))['catch'](handleError(_0x53c933,null));}; \ No newline at end of file +var _0x9063=['redis','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Lists','UserProfileResource','error','name','send','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','raw','getContactsCsv','concat','format','cf_%d','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9063,0x18f));var _0x3906=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x9063[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x3906('0x0'));var rimraf=require(_0x3906('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3906('0x2'));var rp=require(_0x3906('0x3'));var moment=require('moment');var BPromise=require(_0x3906('0x4'));var Mustache=require(_0x3906('0x5'));var util=require(_0x3906('0x6'));var path=require(_0x3906('0x7'));var sox=require(_0x3906('0x8'));var csv=require(_0x3906('0x9'));var ejs=require(_0x3906('0xa'));var fs=require('fs');var fs_extra=require(_0x3906('0xb'));var _=require(_0x3906('0xc'));var squel=require(_0x3906('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3906('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3906('0xe'));var authService=require(_0x3906('0xf'));var qs=require(_0x3906('0x10'));var as=require(_0x3906('0x11'));var hardwareService=require(_0x3906('0x12'));var logger=require(_0x3906('0x13'))(_0x3906('0x14'));var utils=require(_0x3906('0x15'));var config=require(_0x3906('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3906('0x17'))['db'];config['redis']=_['defaults'](config[_0x3906('0x18')],{'host':_0x3906('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x3906('0x1a')](socket);function respondWithStatusCode(_0xc1057c,_0x1f2af4){_0x1f2af4=_0x1f2af4||0xcc;return function(_0x48096c){if(_0x48096c){return _0xc1057c[_0x3906('0x1b')](_0x1f2af4);}return _0xc1057c[_0x3906('0x1c')](_0x1f2af4)[_0x3906('0x1d')]();};}function respondWithResult(_0x18cac4,_0x3d069d){_0x3d069d=_0x3d069d||0xc8;return function(_0x2ffce5){if(_0x2ffce5){return _0x18cac4[_0x3906('0x1c')](_0x3d069d)[_0x3906('0x1e')](_0x2ffce5);}};}function respondWithFilteredResult(_0x3149ed,_0x274ad3){return function(_0x2eeca4){if(_0x2eeca4){var _0xd557ef=typeof _0x274ad3['offset']===_0x3906('0x1f')&&typeof _0x274ad3[_0x3906('0x20')]===_0x3906('0x1f');var _0x3ed10c=_0x2eeca4[_0x3906('0x21')];var _0x4e1f59=_0xd557ef?0x0:_0x274ad3['offset'];var _0x5f2d15=_0xd557ef?_0x2eeca4['count']:_0x274ad3[_0x3906('0x22')]+_0x274ad3['limit'];var _0xc10e5e;if(_0x5f2d15>=_0x3ed10c){_0x5f2d15=_0x3ed10c;_0xc10e5e=0xc8;}else{_0xc10e5e=0xce;}_0x3149ed['status'](_0xc10e5e);return _0x3149ed[_0x3906('0x23')](_0x3906('0x24'),_0x4e1f59+'-'+_0x5f2d15+'/'+_0x3ed10c)[_0x3906('0x1e')](_0x2eeca4);}return null;};}function patchUpdates(_0x576298){return function(_0x2c469e){try{jsonpatch[_0x3906('0x25')](_0x2c469e,_0x576298,!![]);}catch(_0x4e11d4){return BPromise[_0x3906('0x26')](_0x4e11d4);}return _0x2c469e['save']();};}function saveUpdates(_0x216d5d,_0x54d074){return function(_0x109c3a){if(_0x109c3a){return _0x109c3a[_0x3906('0x27')](_0x216d5d)[_0x3906('0x28')](function(_0x22dc49){return _0x22dc49;});}return null;};}function removeEntity(_0x5da659,_0xe63d11){return function(_0x27ef86){if(_0x27ef86){return _0x27ef86[_0x3906('0x29')]()[_0x3906('0x28')](function(){var _0x2d1da3=_0x27ef86[_0x3906('0x2a')]({'plain':!![]});var _0x47fcc8=_0x3906('0x2b');return db[_0x3906('0x2c')]['destroy']({'where':{'type':_0x47fcc8,'resourceId':_0x2d1da3['id']}})[_0x3906('0x28')](function(){return _0x27ef86;});})[_0x3906('0x28')](function(){_0x5da659['status'](0xcc)[_0x3906('0x1d')]();});}};}function handleEntityNotFound(_0x1eace6,_0x478325){return function(_0x1396b7){if(!_0x1396b7){_0x1eace6['sendStatus'](0x194);}return _0x1396b7;};}function handleError(_0x25b6fd,_0x5b913a){_0x5b913a=_0x5b913a||0x1f4;return function(_0x55b545){logger[_0x3906('0x2d')](_0x55b545['stack']);if(_0x55b545[_0x3906('0x2e')]){delete _0x55b545['name'];}_0x25b6fd[_0x3906('0x1c')](_0x5b913a)[_0x3906('0x2f')](_0x55b545);};}exports['index']=function(_0x584194,_0x57dd44){var _0x5f15a9={},_0x4a4e26={},_0x23ccdf={'count':0x0,'rows':[]};var _0x4909c5=_[_0x3906('0x30')](db[_0x3906('0x31')][_0x3906('0x32')],function(_0x430ed3){return{'name':_0x430ed3[_0x3906('0x33')],'type':_0x430ed3[_0x3906('0x34')][_0x3906('0x35')]};});_0x4a4e26[_0x3906('0x36')]=_[_0x3906('0x30')](_0x4909c5,_0x3906('0x2e'));_0x4a4e26[_0x3906('0x37')]=_[_0x3906('0x38')](_0x584194[_0x3906('0x37')]);_0x4a4e26[_0x3906('0x39')]=_[_0x3906('0x3a')](_0x4a4e26[_0x3906('0x36')],_0x4a4e26[_0x3906('0x37')]);_0x5f15a9[_0x3906('0x3b')]=_[_0x3906('0x3a')](_0x4a4e26[_0x3906('0x36')],qs[_0x3906('0x3c')](_0x584194[_0x3906('0x37')]['fields']));_0x5f15a9['attributes']=_0x5f15a9[_0x3906('0x3b')][_0x3906('0x3d')]?_0x5f15a9[_0x3906('0x3b')]:_0x4a4e26[_0x3906('0x36')];if(!_0x584194[_0x3906('0x37')]['hasOwnProperty']('nolimit')){_0x5f15a9['limit']=qs[_0x3906('0x20')](_0x584194[_0x3906('0x37')][_0x3906('0x20')]);_0x5f15a9[_0x3906('0x22')]=qs[_0x3906('0x22')](_0x584194[_0x3906('0x37')][_0x3906('0x22')]);}_0x5f15a9[_0x3906('0x3e')]=qs[_0x3906('0x3f')](_0x584194[_0x3906('0x37')][_0x3906('0x3f')]);_0x5f15a9[_0x3906('0x40')]=qs[_0x3906('0x39')](_[_0x3906('0x41')](_0x584194[_0x3906('0x37')],_0x4a4e26[_0x3906('0x39')]),_0x4909c5);if(_0x584194[_0x3906('0x37')]['filter']){_0x5f15a9[_0x3906('0x40')]=_[_0x3906('0x42')](_0x5f15a9['where'],{'$or':_[_0x3906('0x30')](_0x4909c5,function(_0xf03210){if(_0xf03210[_0x3906('0x34')]!==_0x3906('0x43')){var _0x5a42d6={};_0x5a42d6[_0xf03210['name']]={'$like':'%'+_0x584194[_0x3906('0x37')][_0x3906('0x44')]+'%'};return _0x5a42d6;}})});}_0x5f15a9=_['merge']({},_0x5f15a9,_0x584194[_0x3906('0x45')]);var _0x54c2ae={'where':_0x5f15a9[_0x3906('0x40')]};return db['CmList']['count'](_0x54c2ae)[_0x3906('0x28')](function(_0xd4832b){_0x23ccdf[_0x3906('0x21')]=_0xd4832b;if(_0x584194['query'][_0x3906('0x46')]){_0x5f15a9[_0x3906('0x47')]=[{'all':!![]}];}return db[_0x3906('0x31')][_0x3906('0x48')](_0x5f15a9);})[_0x3906('0x28')](function(_0x113b1b){_0x23ccdf[_0x3906('0x49')]=_0x113b1b;return _0x23ccdf;})[_0x3906('0x28')](respondWithFilteredResult(_0x57dd44,_0x5f15a9))[_0x3906('0x4a')](handleError(_0x57dd44,null));};exports[_0x3906('0x4b')]=function(_0x3d68f5,_0x20d9fd){var _0x1f0ef7={'raw':![],'where':{'id':_0x3d68f5[_0x3906('0x4c')]['id']}},_0x932fa7={};_0x932fa7[_0x3906('0x36')]=_[_0x3906('0x38')](db[_0x3906('0x31')]['rawAttributes']);_0x932fa7[_0x3906('0x37')]=_[_0x3906('0x38')](_0x3d68f5['query']);_0x932fa7[_0x3906('0x39')]=_['intersection'](_0x932fa7[_0x3906('0x36')],_0x932fa7[_0x3906('0x37')]);_0x1f0ef7[_0x3906('0x3b')]=_[_0x3906('0x3a')](_0x932fa7[_0x3906('0x36')],qs[_0x3906('0x3c')](_0x3d68f5[_0x3906('0x37')]['fields']));_0x1f0ef7[_0x3906('0x3b')]=_0x1f0ef7[_0x3906('0x3b')][_0x3906('0x3d')]?_0x1f0ef7[_0x3906('0x3b')]:_0x932fa7['model'];if(_0x3d68f5['query'][_0x3906('0x46')]){_0x1f0ef7[_0x3906('0x47')]=[{'all':!![]}];}_0x1f0ef7=_[_0x3906('0x42')]({},_0x1f0ef7,_0x3d68f5[_0x3906('0x45')]);return db[_0x3906('0x31')][_0x3906('0x4d')](_0x1f0ef7)['then'](handleEntityNotFound(_0x20d9fd,null))['then'](respondWithResult(_0x20d9fd,null))['catch'](handleError(_0x20d9fd,null));};exports['create']=function(_0x17e388,_0x3cac78){return db[_0x3906('0x31')][_0x3906('0x4e')](_0x17e388['body'],{})['then'](function(_0x1c069b){var _0x76e3ee=_0x17e388[_0x3906('0x4f')]['get']({'plain':!![]});if(!_0x76e3ee)throw new Error(_0x3906('0x50'));if(_0x76e3ee['role']===_0x3906('0x4f')){var _0x6b040a=_0x1c069b[_0x3906('0x2a')]({'plain':!![]});var _0x396767='Lists';return db[_0x3906('0x51')][_0x3906('0x4d')]({'where':{'name':_0x396767,'userProfileId':_0x76e3ee['userProfileId']},'raw':!![]})[_0x3906('0x28')](function(_0xd22c8b){if(_0xd22c8b&&_0xd22c8b['autoAssociation']===0x0){return db[_0x3906('0x2c')][_0x3906('0x4e')]({'name':_0x6b040a[_0x3906('0x2e')],'resourceId':_0x6b040a['id'],'type':_0xd22c8b[_0x3906('0x2e')],'sectionId':_0xd22c8b['id']},{})[_0x3906('0x28')](function(){return _0x1c069b;});}else{return _0x1c069b;}})[_0x3906('0x4a')](function(_0x5e509f){logger['error'](_0x3906('0x52'),_0x5e509f);throw _0x5e509f;});}return _0x1c069b;})['then'](respondWithResult(_0x3cac78,0xc9))['catch'](handleError(_0x3cac78,null));};exports['update']=function(_0x48e1e0,_0x48873){if(_0x48e1e0[_0x3906('0x53')]['id']){delete _0x48e1e0[_0x3906('0x53')]['id'];}return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0x48e1e0[_0x3906('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48873,null))[_0x3906('0x28')](saveUpdates(_0x48e1e0[_0x3906('0x53')],null))[_0x3906('0x28')](respondWithResult(_0x48873,null))[_0x3906('0x4a')](handleError(_0x48873,null));};exports[_0x3906('0x29')]=function(_0x4dee26,_0x27087a){return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0x4dee26[_0x3906('0x4c')]['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x27087a,null))[_0x3906('0x28')](removeEntity(_0x27087a,null))[_0x3906('0x4a')](handleError(_0x27087a,null));};exports[_0x3906('0x54')]=function(_0x520533,_0x539eae){return db[_0x3906('0x31')][_0x3906('0x54')]()[_0x3906('0x28')](respondWithResult(_0x539eae,null))[_0x3906('0x4a')](handleError(_0x539eae,null));};exports[_0x3906('0x55')]=function(_0x495154,_0x364639,_0xc77839){if(_0x495154[_0x3906('0x53')]['id']){delete _0x495154['body']['id'];}return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0x495154['params']['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x364639,null))[_0x3906('0x28')](function(_0x137d40){if(_0x137d40){_0x495154['body'][_0x3906('0x56')]=_0x137d40['id'];return db[_0x3906('0x57')][_0x3906('0x4e')](_0x495154[_0x3906('0x53')]);}})[_0x3906('0x28')](respondWithResult(_0x364639,null))[_0x3906('0x4a')](handleError(_0x364639,null));};exports['getDispositions']=function(_0x3603eb,_0x3ea219,_0xc1155c){var _0x4e06df={'raw':![],'where':{}};var _0x1bb4f5={};var _0x37d641={'count':0x0,'rows':[]};return db[_0x3906('0x31')][_0x3906('0x58')]({'where':{'id':_0x3603eb[_0x3906('0x4c')]['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x3ea219,null))[_0x3906('0x28')](function(_0x53c7ac){if(_0x53c7ac){_0x1bb4f5[_0x3906('0x36')]=_[_0x3906('0x38')](db[_0x3906('0x57')][_0x3906('0x32')]);_0x1bb4f5[_0x3906('0x37')]=_['keys'](_0x3603eb[_0x3906('0x37')]);_0x1bb4f5[_0x3906('0x39')]=_[_0x3906('0x3a')](_0x1bb4f5['model'],_0x1bb4f5[_0x3906('0x37')]);_0x4e06df[_0x3906('0x3b')]=_[_0x3906('0x3a')](_0x1bb4f5[_0x3906('0x36')],qs[_0x3906('0x3c')](_0x3603eb['query'][_0x3906('0x3c')]));_0x4e06df[_0x3906('0x3b')]=_0x4e06df[_0x3906('0x3b')][_0x3906('0x3d')]?_0x4e06df['attributes']:_0x1bb4f5[_0x3906('0x36')];if(!_0x3603eb[_0x3906('0x37')][_0x3906('0x59')](_0x3906('0x5a'))){_0x4e06df[_0x3906('0x20')]=qs[_0x3906('0x20')](_0x3603eb[_0x3906('0x37')][_0x3906('0x20')]);_0x4e06df[_0x3906('0x22')]=qs[_0x3906('0x22')](_0x3603eb[_0x3906('0x37')][_0x3906('0x22')]);}_0x4e06df[_0x3906('0x3e')]=qs[_0x3906('0x3f')](_0x3603eb[_0x3906('0x37')][_0x3906('0x3f')]);_0x4e06df[_0x3906('0x40')]=qs[_0x3906('0x39')](_[_0x3906('0x41')](_0x3603eb['query'],_0x1bb4f5['filters']));_0x4e06df[_0x3906('0x40')]['ListId']=_0x53c7ac['id'];if(_0x3603eb[_0x3906('0x37')][_0x3906('0x44')]){_0x4e06df[_0x3906('0x40')]=_[_0x3906('0x42')](_0x4e06df[_0x3906('0x40')],{'$or':_['map'](_0x4e06df[_0x3906('0x3b')],function(_0x23cfbd){var _0xb98c07={};_0xb98c07[_0x23cfbd]={'$like':'%'+_0x3603eb[_0x3906('0x37')][_0x3906('0x44')]+'%'};return _0xb98c07;})});}_0x4e06df=_['merge']({},_0x4e06df,_0x3603eb[_0x3906('0x45')]);return db[_0x3906('0x57')][_0x3906('0x21')]({'where':_0x4e06df[_0x3906('0x40')]})['then'](function(_0x4db148){_0x37d641[_0x3906('0x21')]=_0x4db148;if(_0x3603eb[_0x3906('0x37')]['includeAll']){_0x4e06df[_0x3906('0x47')]=[{'all':!![]}];}return db[_0x3906('0x57')][_0x3906('0x48')](_0x4e06df);})['then'](function(_0x254785){_0x37d641[_0x3906('0x49')]=_0x254785;return _0x37d641;});}})['then'](respondWithFilteredResult(_0x3ea219,_0x4e06df))[_0x3906('0x4a')](handleError(_0x3ea219,null));};exports[_0x3906('0x5b')]=function(_0x38ac91,_0x35a9d0,_0x2f5359){return db[_0x3906('0x31')]['find']({'where':{'id':_0x38ac91[_0x3906('0x4c')]['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x35a9d0,null))['then'](function(_0x42e027){if(_0x42e027){return _0x42e027[_0x3906('0x5b')](_0x38ac91[_0x3906('0x37')][_0x3906('0x5c')]);}})[_0x3906('0x28')](respondWithStatusCode(_0x35a9d0,null))[_0x3906('0x4a')](handleError(_0x35a9d0,null));};exports[_0x3906('0x5d')]=function(_0x45687f,_0x13ad8e,_0xa0a077){return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0x45687f[_0x3906('0x4c')]['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x13ad8e,null))[_0x3906('0x28')](function(_0x4e91c8){if(_0x4e91c8){var _0x525f9b=[];var _0x2cba60={'success':[],'errors':[]};return db[_0x3906('0x5e')][_0x3906('0x54')]()[_0x3906('0x28')](function(_0x6bcf7){if(_0x45687f['body'][_0x3906('0x5f')]&&_[_0x3906('0x60')](_0x45687f[_0x3906('0x53')][_0x3906('0x5f')])){if(_0x45687f[_0x3906('0x53')][_0x3906('0x5f')]['length']){_0x45687f[_0x3906('0x53')][_0x3906('0x5f')]=_0x45687f[_0x3906('0x53')]['tags'][_0x3906('0x61')](';')+';';}else{_0x45687f[_0x3906('0x53')][_0x3906('0x5f')]=null;}}else{_0x45687f[_0x3906('0x53')]['tags']=null;}if(_0x45687f[_0x3906('0x53')]&&_[_0x3906('0x60')](_0x45687f[_0x3906('0x53')])){for(var _0x4823ab=0x0;_0x4823ab<_0x45687f[_0x3906('0x53')][_0x3906('0x3d')];_0x4823ab+=0x1){_0x45687f[_0x3906('0x53')][_0x4823ab][_0x3906('0x56')]=_0x45687f[_0x3906('0x4c')]['id'];_0x525f9b[_0x3906('0x62')](_0x45687f[_0x3906('0x53')][_0x4823ab]);}return BPromise[_0x3906('0x63')](_0x525f9b,function(_0x14a485){return db[_0x3906('0x5e')][_0x3906('0x4e')](_[_0x3906('0x64')](_0x14a485,[_0x3906('0x5c'),'id'])||{},{'fields':_[_0x3906('0x38')](_0x6bcf7),'raw':!![]})[_0x3906('0x28')](function(_0x5bf734){_0x2cba60['success'][_0x3906('0x62')](_0x5bf734[_0x3906('0x65')]);})[_0x3906('0x4a')](function(_0x360ed6){_0x2cba60['errors']['push']({'data':_0x14a485,'error':_0x360ed6['message']});});})[_0x3906('0x28')](function(_0x20eb4e){return _0x2cba60;})[_0x3906('0x4a')](function(_0xe142f7){return _0xe142f7;});}else{_0x13ad8e[_0x3906('0x1c')](0x190)[_0x3906('0x1e')]({'message':_0x3906('0x66')});}});}})[_0x3906('0x28')](respondWithResult(_0x13ad8e,null))[_0x3906('0x4a')](handleError(_0x13ad8e,null));};exports[_0x3906('0x67')]=function(_0x470bb9,_0xe1db85,_0x41e238){var _0x4ec4e5;return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0x470bb9['params']['id']},'include':[{'model':db[_0x3906('0x68')],'as':'CustomFields'}]})[_0x3906('0x28')](handleEntityNotFound(_0xe1db85,null))[_0x3906('0x28')](function(_0x691368){if(_0x691368){_0x4ec4e5=_0x691368;return db[_0x3906('0x5e')][_0x3906('0x32')];}})[_0x3906('0x28')](function(_0x5411f7){if(_0x5411f7){var _0x36615f={};var _0x232db7={};_0x232db7[_0x3906('0x36')]=_['concat'](_[_0x3906('0x38')](_0x5411f7),_[_0x3906('0x30')](_0x4ec4e5[_0x3906('0x69')],function(_0x4564b9){return util['format']('cf_%d',_0x4564b9['id']);}));_0x232db7[_0x3906('0x37')]=_[_0x3906('0x38')](_0x470bb9[_0x3906('0x37')]);_0x232db7[_0x3906('0x39')]=_[_0x3906('0x3a')](_0x232db7['model'],_0x232db7['query']);_0x36615f[_0x3906('0x3b')]=_['intersection'](_0x232db7[_0x3906('0x36')],qs[_0x3906('0x3c')](_0x470bb9['query']['fields']));_0x36615f[_0x3906('0x3b')]=_0x36615f['attributes'][_0x3906('0x3d')]?_0x36615f['attributes']:_0x232db7[_0x3906('0x36')];if(!_0x470bb9['query'][_0x3906('0x59')](_0x3906('0x5a'))){_0x36615f[_0x3906('0x20')]=qs['limit'](_0x470bb9[_0x3906('0x37')][_0x3906('0x20')]);_0x36615f[_0x3906('0x22')]=qs[_0x3906('0x22')](_0x470bb9[_0x3906('0x37')]['offset']);}_0x36615f[_0x3906('0x3e')]=qs[_0x3906('0x3f')](_0x470bb9[_0x3906('0x37')]['sort']);_0x36615f[_0x3906('0x40')]=qs[_0x3906('0x39')](_[_0x3906('0x41')](_0x470bb9[_0x3906('0x37')],_0x232db7[_0x3906('0x39')]));_0x36615f[_0x3906('0x6a')]=!![];if(_0x470bb9['query'][_0x3906('0x44')]){_0x36615f[_0x3906('0x40')]=_['merge'](_0x36615f[_0x3906('0x40')],{'$or':_['map'](_0x36615f['attributes'],function(_0x486335){var _0x2f0548={};_0x2f0548[_0x486335]={'$like':'%'+_0x470bb9[_0x3906('0x37')][_0x3906('0x44')]+'%'};return _0x2f0548;})});}_0x36615f=_['merge']({},_0x36615f,_0x470bb9[_0x3906('0x45')]);return _0x4ec4e5[_0x3906('0x67')](_0x36615f);}})[_0x3906('0x28')](respondWithResult(_0xe1db85,null))[_0x3906('0x4a')](handleError(_0xe1db85,null));};exports[_0x3906('0x6b')]=function(_0xd1d754,_0x1b253d,_0x49d65a){var _0x3d168f;return db[_0x3906('0x31')][_0x3906('0x4d')]({'where':{'id':_0xd1d754[_0x3906('0x4c')]['id']},'include':[{'model':db[_0x3906('0x68')],'as':_0x3906('0x69')}]})['then'](handleEntityNotFound(_0x1b253d,null))[_0x3906('0x28')](function(_0x5ea8bb){if(_0x5ea8bb){_0x3d168f=_0x5ea8bb;return db[_0x3906('0x5e')][_0x3906('0x32')];}})[_0x3906('0x28')](function(_0xed83d7){if(_0xed83d7){var _0x4d5bb8={};var _0x4f1d21={};_0x4f1d21[_0x3906('0x36')]=_[_0x3906('0x6c')](_[_0x3906('0x38')](_0xed83d7),_[_0x3906('0x30')](_0x3d168f[_0x3906('0x69')],function(_0x343cb9){return util[_0x3906('0x6d')](_0x3906('0x6e'),_0x343cb9['id']);}));_0x4f1d21[_0x3906('0x37')]=_[_0x3906('0x38')](_0xd1d754[_0x3906('0x37')]);_0x4f1d21['filters']=_[_0x3906('0x3a')](_0x4f1d21[_0x3906('0x36')],_0x4f1d21[_0x3906('0x37')]);_0x4d5bb8['attributes']=_[_0x3906('0x3a')](_0x4f1d21[_0x3906('0x36')],qs[_0x3906('0x3c')](_0xd1d754[_0x3906('0x37')][_0x3906('0x3c')]));_0x4d5bb8['attributes']=_0x4d5bb8['attributes'][_0x3906('0x3d')]?_0x4d5bb8['attributes']:_0x4f1d21['model'];if(!_0xd1d754[_0x3906('0x37')][_0x3906('0x59')](_0x3906('0x5a'))){_0x4d5bb8[_0x3906('0x20')]=qs[_0x3906('0x20')](_0xd1d754[_0x3906('0x37')][_0x3906('0x20')]);_0x4d5bb8['offset']=qs[_0x3906('0x22')](_0xd1d754['query']['offset']);}_0x4d5bb8[_0x3906('0x3e')]=qs[_0x3906('0x3f')](_0xd1d754[_0x3906('0x37')]['sort']);_0x4d5bb8[_0x3906('0x40')]=qs[_0x3906('0x39')](_[_0x3906('0x41')](_0xd1d754['query'],_0x4f1d21[_0x3906('0x39')]));_0x4d5bb8[_0x3906('0x6a')]=!![];if(_0xd1d754['query']['filter']){_0x4d5bb8[_0x3906('0x40')]=_[_0x3906('0x42')](_0x4d5bb8[_0x3906('0x40')],{'$or':_[_0x3906('0x30')](_0x4d5bb8[_0x3906('0x3b')],function(_0x54e002){var _0x3d2909={};_0x3d2909[_0x54e002]={'$like':'%'+_0xd1d754[_0x3906('0x37')][_0x3906('0x44')]+'%'};return _0x3d2909;})});}_0x4d5bb8=_[_0x3906('0x42')]({},_0x4d5bb8,_0xd1d754['options']);return _0x3d168f['getContacts'](_0x4d5bb8);}})['then'](function(_0x3259ad){if(!_[_0x3906('0x6f')](_0x3259ad)){var _0x1bccc2=toCsv(_0x3259ad);var _0x3f58a2=Date['now']();fs[_0x3906('0x70')](util[_0x3906('0x6d')](_0x3906('0x71'),_0x3d168f['id'],_0x3f58a2),_0x1bccc2);_0x1b253d[_0x3906('0x72')](_0x3906('0x73'),'attachment;\x20filename='+util[_0x3906('0x6d')](_0x3906('0x74'),_0x3d168f['id'],_0x3f58a2));_0x1b253d['setHeader'](_0x3906('0x75'),_0x3906('0x76'));return _0x1b253d[_0x3906('0x77')](util[_0x3906('0x6d')](_0x3906('0x71'),_0x3d168f['id'],_0x3f58a2));}else{return _0x1b253d[_0x3906('0x1b')](0xcc);}})[_0x3906('0x4a')](handleError(_0x1b253d,null));};exports['addCustomField']=function(_0x3ad828,_0x1acee1,_0x4e23a0){var _0x28b4af;delete _0x3ad828[_0x3906('0x53')]['id'];return db[_0x3906('0x31')]['findOne']({'where':{'id':_0x3ad828[_0x3906('0x4c')]['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x1acee1,null))[_0x3906('0x28')](function(_0x31f44d){if(_0x31f44d){return db[_0x3906('0x78')][_0x3906('0x79')](function(_0x499da3){return db[_0x3906('0x68')]['create'](_0x3ad828[_0x3906('0x53')],{'transaction':_0x499da3})['then'](function(_0x24d817){_0x28b4af=_0x24d817;return _0x31f44d['addCustomFields'](_0x24d817,{'transaction':_0x499da3});})[_0x3906('0x28')](function(){var _0x520294={'type':db[_0x3906('0x7a')]['TEXT'],'transaction':_0x499da3};switch(_0x3ad828[_0x3906('0x53')][_0x3906('0x34')]){case _0x3906('0x7b'):_0x520294[_0x3906('0x34')]=db['Sequelize'][_0x3906('0x7c')];break;case _0x3906('0x7d'):_0x520294['type']=db['Sequelize'][_0x3906('0x7e')];break;case'switch':_0x520294[_0x3906('0x34')]=db['Sequelize']['BOOLEAN'];_0x520294[_0x3906('0x7f')]=![];break;default:}return db[_0x3906('0x78')][_0x3906('0x80')][_0x3906('0x81')](_0x3906('0x82'),util[_0x3906('0x6d')](_0x3906('0x83'),_0x28b4af['id']),_0x520294);})['then'](function(){return _0x28b4af;});});}})[_0x3906('0x28')](respondWithResult(_0x1acee1,null))[_0x3906('0x4a')](handleError(_0x1acee1,null));};exports[_0x3906('0x84')]=function(_0x4cf92a,_0x3a9a27,_0x3eec8a){var _0x440d67={};var _0xfe3aa5={};var _0xfc86d2;var _0x4553f6;return db[_0x3906('0x31')][_0x3906('0x58')]({'where':{'id':_0x4cf92a[_0x3906('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a9a27,null))['then'](function(_0x46b763){if(_0x46b763){_0xfc86d2=_0x46b763;_0xfe3aa5['model']=_[_0x3906('0x38')](db[_0x3906('0x68')][_0x3906('0x32')]);_0xfe3aa5['query']=_[_0x3906('0x38')](_0x4cf92a[_0x3906('0x37')]);_0xfe3aa5[_0x3906('0x39')]=_[_0x3906('0x3a')](_0xfe3aa5[_0x3906('0x36')],_0xfe3aa5[_0x3906('0x37')]);_0x440d67['attributes']=_[_0x3906('0x3a')](_0xfe3aa5[_0x3906('0x36')],qs[_0x3906('0x3c')](_0x4cf92a['query'][_0x3906('0x3c')]));_0x440d67[_0x3906('0x3b')]=_0x440d67[_0x3906('0x3b')][_0x3906('0x3d')]?_0x440d67[_0x3906('0x3b')]:_0xfe3aa5[_0x3906('0x36')];_0x440d67[_0x3906('0x3e')]=qs['sort'](_0x4cf92a[_0x3906('0x37')][_0x3906('0x3f')]);_0x440d67[_0x3906('0x40')]=qs[_0x3906('0x39')](_['pick'](_0x4cf92a[_0x3906('0x37')],_0xfe3aa5[_0x3906('0x39')]));_0x440d67[_0x3906('0x40')]=_[_0x3906('0x42')](_0x440d67[_0x3906('0x40')],{'$or':[{'ListId':_0x46b763['id']},{'ListId':null}]});if(_0x4cf92a['query'][_0x3906('0x44')]){_0x440d67[_0x3906('0x40')]=_['merge'](_0x440d67['where'],{'$or':_[_0x3906('0x30')](_0x440d67[_0x3906('0x3b')],function(_0x5a0d0b){var _0x281c52={};_0x281c52[_0x5a0d0b]={'$like':'%'+_0x4cf92a[_0x3906('0x37')]['filter']+'%'};return _0x281c52;})});}_0x440d67=_[_0x3906('0x42')]({},_0x440d67,_0x4cf92a[_0x3906('0x45')]);return db['CmCustomField'][_0x3906('0x85')](_0x440d67);}})[_0x3906('0x28')](respondWithResult(_0x3a9a27,null))[_0x3906('0x4a')](handleError(_0x3a9a27,null));};exports[_0x3906('0x86')]=function(_0x47f595,_0x3e8854,_0x42bd0d){return db[_0x3906('0x31')]['find']({'where':{'id':_0x47f595['params']['id']}})['then'](handleEntityNotFound(_0x3e8854,null))[_0x3906('0x28')](function(_0x45e3c8){if(_0x45e3c8){return _0x45e3c8[_0x3906('0x86')](_0x47f595[_0x3906('0x53')][_0x3906('0x5c')],_[_0x3906('0x64')](_0x47f595[_0x3906('0x53')],[_0x3906('0x5c'),'id'])||{})['spread'](function(_0x45e098){for(var _0x11d891=0x0;_0x11d891<_0x47f595[_0x3906('0x53')][_0x3906('0x5c')][_0x3906('0x3d')];_0x11d891+=0x1){socket[_0x3906('0x87')](_0x3906('0x88'),{'UserId':Number(_0x47f595[_0x3906('0x53')][_0x3906('0x5c')][_0x11d891]),'CmListId':Number(_0x47f595[_0x3906('0x4c')]['id'])});}return _0x45e098;});}})[_0x3906('0x28')](respondWithResult(_0x3e8854,null))[_0x3906('0x4a')](handleError(_0x3e8854,null));};exports[_0x3906('0x89')]=function(_0x50a7ea,_0x2ac4ae,_0x3f44f8){return db[_0x3906('0x31')]['find']({'where':{'id':_0x50a7ea['params']['id']}})[_0x3906('0x28')](handleEntityNotFound(_0x2ac4ae,null))[_0x3906('0x28')](function(_0x52556b){if(_0x52556b){return _0x52556b[_0x3906('0x89')](_0x50a7ea[_0x3906('0x37')]['ids'])[_0x3906('0x28')](function(){if(_[_0x3906('0x60')](_0x50a7ea[_0x3906('0x37')]['ids'])){for(var _0x26d67c=0x0;_0x26d67c<_0x50a7ea[_0x3906('0x37')][_0x3906('0x5c')][_0x3906('0x3d')];_0x26d67c+=0x1){socket[_0x3906('0x87')](_0x3906('0x8a'),{'UserId':Number(_0x50a7ea[_0x3906('0x37')][_0x3906('0x5c')][_0x26d67c]),'CmListId':Number(_0x50a7ea[_0x3906('0x4c')]['id'])});}}else{socket[_0x3906('0x87')](_0x3906('0x8a'),{'UserId':Number(_0x50a7ea['query'][_0x3906('0x5c')]),'CmListId':Number(_0x50a7ea[_0x3906('0x4c')]['id'])});}});}})[_0x3906('0x28')](respondWithStatusCode(_0x2ac4ae,null))[_0x3906('0x4a')](handleError(_0x2ac4ae,null));};exports[_0x3906('0x8b')]=function(_0x2d2431,_0x247fbf,_0x1fb93f){var _0x42ee8b={};var _0x3a0e1e={};var _0x368468;var _0x3eed34;return db[_0x3906('0x31')][_0x3906('0x58')]({'where':{'id':_0x2d2431[_0x3906('0x4c')]['id']}})['then'](handleEntityNotFound(_0x247fbf,null))[_0x3906('0x28')](function(_0xe7e09b){if(_0xe7e09b){_0x368468=_0xe7e09b;_0x3a0e1e[_0x3906('0x36')]=_[_0x3906('0x38')](db[_0x3906('0x8c')][_0x3906('0x32')]);_0x3a0e1e[_0x3906('0x37')]=_[_0x3906('0x38')](_0x2d2431[_0x3906('0x37')]);_0x3a0e1e['filters']=_[_0x3906('0x3a')](_0x3a0e1e['model'],_0x3a0e1e[_0x3906('0x37')]);_0x42ee8b[_0x3906('0x3b')]=_[_0x3906('0x3a')](_0x3a0e1e[_0x3906('0x36')],qs['fields'](_0x2d2431[_0x3906('0x37')][_0x3906('0x3c')]));_0x42ee8b[_0x3906('0x3b')]=_0x42ee8b[_0x3906('0x3b')][_0x3906('0x3d')]?_0x42ee8b[_0x3906('0x3b')]:_0x3a0e1e[_0x3906('0x36')];_0x42ee8b[_0x3906('0x3e')]=qs[_0x3906('0x3f')](_0x2d2431['query'][_0x3906('0x3f')]);_0x42ee8b[_0x3906('0x40')]=qs[_0x3906('0x39')](_[_0x3906('0x41')](_0x2d2431[_0x3906('0x37')],_0x3a0e1e[_0x3906('0x39')]));if(_0x2d2431[_0x3906('0x37')][_0x3906('0x44')]){_0x42ee8b[_0x3906('0x40')]=_[_0x3906('0x42')](_0x42ee8b[_0x3906('0x40')],{'$or':_[_0x3906('0x30')](_0x42ee8b['attributes'],function(_0x3e071d){var _0x1a8e31={};_0x1a8e31[_0x3e071d]={'$like':'%'+_0x2d2431[_0x3906('0x37')][_0x3906('0x44')]+'%'};return _0x1a8e31;})});}_0x42ee8b=_[_0x3906('0x42')]({},_0x42ee8b,_0x2d2431['options']);return _0x368468['getAgents'](_0x42ee8b);}})[_0x3906('0x28')](function(_0x3cad89){if(_0x3cad89){_0x3eed34=_0x3cad89[_0x3906('0x3d')];if(!_0x2d2431['query'][_0x3906('0x59')](_0x3906('0x5a'))){_0x42ee8b['limit']=qs[_0x3906('0x20')](_0x2d2431[_0x3906('0x37')]['limit']);_0x42ee8b[_0x3906('0x22')]=qs['offset'](_0x2d2431['query'][_0x3906('0x22')]);}return _0x368468[_0x3906('0x8b')](_0x42ee8b);}})[_0x3906('0x28')](function(_0x25f53f){if(_0x25f53f){return _0x25f53f?{'count':_0x3eed34,'rows':_0x25f53f}:null;}})[_0x3906('0x28')](respondWithResult(_0x247fbf,null))[_0x3906('0x4a')](handleError(_0x247fbf,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index da010c3..7e865d0 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x63779f,_0x23c91b){_0x63779f=_0x63779f-0x0;var _0x224f6e=_0x3e74[_0x63779f];return _0x224f6e;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x35371f,_0x12cd72){var _0x303f0e=function(_0x5b220a){while(--_0x5b220a){_0x35371f['push'](_0x35371f['shift']());}};_0x303f0e(++_0x12cd72);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 502d68e..bb4e212 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 _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0xaf649a,_0x4620e2){var _0x23f165=function(_0x2a2296){while(--_0x2a2296){_0xaf649a['push'](_0xaf649a['shift']());}};_0x23f165(++_0x4620e2);}(_0x70e0,0x17b));var _0x070e=function(_0x4f3896,_0x4f96db){_0x4f3896=_0x4f3896-0x0;var _0x37e138=_0x70e0[_0x4f3896];return _0x37e138;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmList',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0x4a4b87,_0x1d7cd6){var _0xafd91a=function(_0xc0870a){while(--_0xc0870a){_0x4a4b87['push'](_0x4a4b87['shift']());}};_0xafd91a(++_0x1d7cd6);}(_0x70e0,0x17b));var _0x070e=function(_0x21ec18,_0x202d49){_0x21ec18=_0x21ec18-0x0;var _0xb40e34=_0x70e0[_0x21ec18];return _0xb40e34;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmList',attributes,{'tableName':_0x070e('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 c867344..5a3238b 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 _0x464a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x464a,0x8d));var _0xa464=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x464a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa464('0x0'));var util=require(_0xa464('0x1'));var moment=require(_0xa464('0x2'));var BPromise=require('bluebird');var rs=require(_0xa464('0x3'));var fs=require('fs');var Redis=require(_0xa464('0x4'));var db=require(_0xa464('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa464('0x6'))(_0xa464('0x7'));var config=require(_0xa464('0x8'));var jayson=require(_0xa464('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xa464('0xa')]=_[_0xa464('0xb')](config[_0xa464('0xa')],{'host':_0xa464('0xc'),'port':0x18eb});var socket=require(_0xa464('0xd'))(new Redis(config['redis']));require(_0xa464('0xe'))[_0xa464('0xf')](socket);function respondWithRpcPromise(_0x3521e1,_0x899ffb,_0x1d5928){return new BPromise(function(_0x3e0605,_0x28419d){return client[_0xa464('0x10')](_0x3521e1,_0x1d5928)[_0xa464('0x11')](function(_0x6ab116){logger[_0xa464('0x12')]('CmList,\x20%s,\x20%s',_0x899ffb,_0xa464('0x13'));logger[_0xa464('0x14')](_0xa464('0x15'),_0x899ffb,'request\x20sent',JSON[_0xa464('0x16')](_0x6ab116));if(_0x6ab116[_0xa464('0x17')]){if(_0x6ab116[_0xa464('0x17')][_0xa464('0x18')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x899ffb,_0x6ab116[_0xa464('0x17')][_0xa464('0x19')]);return _0x28419d(_0x6ab116[_0xa464('0x17')]['message']);}logger['error'](_0xa464('0x1a'),_0x899ffb,_0x6ab116[_0xa464('0x17')][_0xa464('0x19')]);return _0x3e0605(_0x6ab116[_0xa464('0x17')][_0xa464('0x19')]);}else{logger[_0xa464('0x12')]('CmList,\x20%s,\x20%s',_0x899ffb,_0xa464('0x13'));_0x3e0605(_0x6ab116[_0xa464('0x1b')][_0xa464('0x19')]);}})[_0xa464('0x1c')](function(_0x59d8e0){logger[_0xa464('0x17')](_0xa464('0x1a'),_0x899ffb,_0x59d8e0);_0x28419d(_0x59d8e0);});});} \ No newline at end of file +var _0x8528=['jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4dfb08,_0x1650ad){var _0xf00ce6=function(_0x2332e3){while(--_0x2332e3){_0x4dfb08['push'](_0x4dfb08['shift']());}};_0xf00ce6(++_0x1650ad);}(_0x8528,0x146));var _0x8852=function(_0x4cb24f,_0x2f64bd){_0x4cb24f=_0x4cb24f-0x0;var _0x3c73e3=_0x8528[_0x4cb24f];return _0x3c73e3;};'use strict';var _=require(_0x8852('0x0'));var util=require(_0x8852('0x1'));var moment=require(_0x8852('0x2'));var BPromise=require(_0x8852('0x3'));var rs=require(_0x8852('0x4'));var fs=require('fs');var Redis=require(_0x8852('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8852('0x6'));var logger=require(_0x8852('0x7'))(_0x8852('0x8'));var config=require(_0x8852('0x9'));var jayson=require(_0x8852('0xa'));var client=jayson[_0x8852('0xb')][_0x8852('0xc')]({'port':0x232a});config[_0x8852('0xd')]=_[_0x8852('0xe')](config['redis'],{'host':_0x8852('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8852('0x10'))[_0x8852('0x11')](socket);function respondWithRpcPromise(_0x1b3fa3,_0x15819e,_0x2b13a4){return new BPromise(function(_0x1c0ec5,_0x4a395b){return client['request'](_0x1b3fa3,_0x2b13a4)['then'](function(_0x561359){logger[_0x8852('0x12')](_0x8852('0x13'),_0x15819e,_0x8852('0x14'));logger[_0x8852('0x15')](_0x8852('0x16'),_0x15819e,_0x8852('0x14'),JSON[_0x8852('0x17')](_0x561359));if(_0x561359[_0x8852('0x18')]){if(_0x561359[_0x8852('0x18')][_0x8852('0x19')]===0x1f4){logger[_0x8852('0x18')](_0x8852('0x13'),_0x15819e,_0x561359[_0x8852('0x18')]['message']);return _0x4a395b(_0x561359[_0x8852('0x18')][_0x8852('0x1a')]);}logger[_0x8852('0x18')](_0x8852('0x13'),_0x15819e,_0x561359[_0x8852('0x18')][_0x8852('0x1a')]);return _0x1c0ec5(_0x561359[_0x8852('0x18')][_0x8852('0x1a')]);}else{logger[_0x8852('0x12')]('CmList,\x20%s,\x20%s',_0x15819e,_0x8852('0x14'));_0x1c0ec5(_0x561359['result'][_0x8852('0x1a')]);}})[_0x8852('0x1b')](function(_0x1ff147){logger[_0x8852('0x18')](_0x8852('0x13'),_0x15819e,_0x1ff147);_0x4a395b(_0x1ff147);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a2ce911..d7dc0e1 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 _0x43d8=['cmList:','./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x30afa1,_0x5734d1){var _0x4c83ee=function(_0x38ac84){while(--_0x38ac84){_0x30afa1['push'](_0x30afa1['shift']());}};_0x4c83ee(++_0x5734d1);}(_0x43d8,0x10f));var _0x843d=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0x43d8[_0x5442a5];return _0x130af0;};'use strict';var CmListEvents=require(_0x843d('0x0'));var events=[_0x843d('0x1'),_0x843d('0x2'),_0x843d('0x3')];function createListener(_0x1b9a20,_0x2e0414){return function(_0x4f9b36){_0x2e0414[_0x843d('0x4')](_0x1b9a20,_0x4f9b36);};}function removeListener(_0x31c270,_0x347ff2){return function(){CmListEvents[_0x843d('0x5')](_0x31c270,_0x347ff2);};}exports[_0x843d('0x6')]=function(_0x3406b3){for(var _0x342250=0x0,_0x1f13f4=events[_0x843d('0x7')];_0x342250<_0x1f13f4;_0x342250++){var _0x128ccc=events[_0x342250];var _0x53856c=createListener(_0x843d('0x8')+_0x128ccc,_0x3406b3);CmListEvents['on'](_0x128ccc,_0x53856c);}}; \ No newline at end of file +var _0xb785=['emit','removeListener','register','length','update'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb785,0x1df));var _0x5b78=function(_0x46bfde,_0x36d255){_0x46bfde=_0x46bfde-0x0;var _0x674ccb=_0xb785[_0x46bfde];return _0x674ccb;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove',_0x5b78('0x0')];function createListener(_0x5854e1,_0xdc562d){return function(_0x1bef10){_0xdc562d[_0x5b78('0x1')](_0x5854e1,_0x1bef10);};}function removeListener(_0x557df7,_0x34ed7c){return function(){CmListEvents[_0x5b78('0x2')](_0x557df7,_0x34ed7c);};}exports[_0x5b78('0x3')]=function(_0x56b65b){for(var _0x4613e3=0x0,_0x540ab2=events[_0x5b78('0x4')];_0x4613e3<_0x540ab2;_0x4613e3++){var _0x33d669=events[_0x4613e3];var _0x2a1b07=createListener('cmList:'+_0x33d669,_0x56b65b);CmListEvents['on'](_0x33d669,_0x2a1b07);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9cd68aa..9fdfef2 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 _0x93a0=['put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField'];(function(_0x5a40e8,_0x59e898){var _0xb56379=function(_0x368aa3){while(--_0x368aa3){_0x5a40e8['push'](_0x5a40e8['shift']());}};_0xb56379(++_0x59e898);}(_0x93a0,0xdf));var _0x093a=function(_0x1e68d2,_0x392c70){_0x1e68d2=_0x1e68d2-0x0;var _0x4a3d9b=_0x93a0[_0x1e68d2];return _0x4a3d9b;};'use strict';var multer=require(_0x093a('0x0'));var util=require(_0x093a('0x1'));var path=require('path');var timeout=require(_0x093a('0x2'));var express=require(_0x093a('0x3'));var router=express['Router']();var fs_extra=require(_0x093a('0x4'));var auth=require(_0x093a('0x5'));var interaction=require(_0x093a('0x6'));var config=require(_0x093a('0x7'));var controller=require(_0x093a('0x8'));router[_0x093a('0x9')]('/',auth[_0x093a('0xa')](),controller[_0x093a('0xb')]);router[_0x093a('0x9')](_0x093a('0xc'),auth[_0x093a('0xa')](),controller[_0x093a('0xd')]);router['get'](_0x093a('0xe'),auth[_0x093a('0xa')](),controller['show']);router[_0x093a('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x093a('0xf')]);router[_0x093a('0x9')](_0x093a('0x10'),auth[_0x093a('0xa')](),controller['getContacts']);router['get'](_0x093a('0x11'),auth[_0x093a('0xa')](),controller[_0x093a('0x12')]);router[_0x093a('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x093a('0x13')]);router[_0x093a('0x9')](_0x093a('0x14'),auth['isAuthenticated'](),controller[_0x093a('0x15')]);router[_0x093a('0x16')]('/',auth['isAuthenticated'](),controller[_0x093a('0x17')]);router[_0x093a('0x16')](_0x093a('0x18'),auth[_0x093a('0xa')](),controller[_0x093a('0x19')]);router['post']('/:id/contacts',auth[_0x093a('0xa')](),controller[_0x093a('0x1a')]);router[_0x093a('0x16')](_0x093a('0x1b'),auth['isAuthenticated'](),controller[_0x093a('0x1c')]);router['post']('/:id/users',auth[_0x093a('0xa')](),controller['addAgents']);router[_0x093a('0x1d')](_0x093a('0xe'),auth[_0x093a('0xa')](),controller[_0x093a('0x1e')]);router[_0x093a('0x1f')](_0x093a('0xe'),auth['isAuthenticated'](),controller[_0x093a('0x20')]);router[_0x093a('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x093a('0x21')]);router['delete'](_0x093a('0x14'),auth[_0x093a('0xa')](),controller[_0x093a('0x22')]);module[_0x093a('0x23')]=router; \ No newline at end of file +var _0x4297=['../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getAgents','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4297,0x13a));var _0x7429=function(_0x2d99b1,_0x40b1c8){_0x2d99b1=_0x2d99b1-0x0;var _0x5cab05=_0x4297[_0x2d99b1];return _0x5cab05;};'use strict';var multer=require(_0x7429('0x0'));var util=require('util');var path=require(_0x7429('0x1'));var timeout=require('connect-timeout');var express=require(_0x7429('0x2'));var router=express[_0x7429('0x3')]();var fs_extra=require(_0x7429('0x4'));var auth=require(_0x7429('0x5'));var interaction=require(_0x7429('0x6'));var config=require(_0x7429('0x7'));var controller=require(_0x7429('0x8'));router[_0x7429('0x9')]('/',auth[_0x7429('0xa')](),controller[_0x7429('0xb')]);router[_0x7429('0x9')]('/describe',auth[_0x7429('0xa')](),controller['describe']);router['get'](_0x7429('0xc'),auth[_0x7429('0xa')](),controller[_0x7429('0xd')]);router[_0x7429('0x9')](_0x7429('0xe'),auth[_0x7429('0xa')](),controller['getDispositions']);router[_0x7429('0x9')](_0x7429('0xf'),auth[_0x7429('0xa')](),controller[_0x7429('0x10')]);router[_0x7429('0x9')](_0x7429('0x11'),auth[_0x7429('0xa')](),controller[_0x7429('0x12')]);router['get']('/:id/fields',auth[_0x7429('0xa')](),controller['getCustomFields']);router[_0x7429('0x9')]('/:id/users',auth[_0x7429('0xa')](),controller[_0x7429('0x13')]);router[_0x7429('0x14')]('/',auth[_0x7429('0xa')](),controller['create']);router[_0x7429('0x14')](_0x7429('0xe'),auth[_0x7429('0xa')](),controller[_0x7429('0x15')]);router[_0x7429('0x14')](_0x7429('0xf'),auth['isAuthenticated'](),controller[_0x7429('0x16')]);router[_0x7429('0x14')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7429('0x17')]);router[_0x7429('0x14')](_0x7429('0x18'),auth[_0x7429('0xa')](),controller[_0x7429('0x19')]);router[_0x7429('0x1a')]('/:id',auth[_0x7429('0xa')](),controller[_0x7429('0x1b')]);router[_0x7429('0x1c')](_0x7429('0xc'),auth[_0x7429('0xa')](),controller[_0x7429('0x1d')]);router[_0x7429('0x1c')]('/:id/dispositions',auth[_0x7429('0xa')](),controller[_0x7429('0x1e')]);router[_0x7429('0x1c')](_0x7429('0x18'),auth[_0x7429('0xa')](),controller['removeAgents']);module[_0x7429('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0ddb529..a4c28b8 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 _0x88d8=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x88d8,0x16d));var _0x888d=function(_0x4667bd,_0xd39862){_0x4667bd=_0x4667bd-0x0;var _0x1a498f=_0x88d8[_0x4667bd];return _0x1a498f;};'use strict';var Sequelize=require(_0x888d('0x0'));module[_0x888d('0x1')]={'name':{'type':Sequelize[_0x888d('0x2')],'get':function(_0xcecd2c){return this[_0x888d('0x3')](_0x888d('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x888d('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x59b0=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x1188e8,_0x5b5373){var _0x29c84f=function(_0xde5ff8){while(--_0xde5ff8){_0x1188e8['push'](_0x1188e8['shift']());}};_0x29c84f(++_0x5b5373);}(_0x59b0,0x10d));var _0x059b=function(_0x3ad737,_0x300131){_0x3ad737=_0x3ad737-0x0;var _0x16c1e2=_0x59b0[_0x3ad737];return _0x16c1e2;};'use strict';var Sequelize=require(_0x059b('0x0'));module[_0x059b('0x1')]={'name':{'type':Sequelize[_0x059b('0x2')],'get':function(_0x9b0ce5){return this[_0x059b('0x3')](_0x059b('0x4'));}},'field':{'type':Sequelize[_0x059b('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x059b('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x059b('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index bdb90ac..cf01dbc 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x492a05,_0x5b29ba){var _0x167c29=function(_0x4837be){while(--_0x4837be){_0x492a05['push'](_0x492a05['shift']());}};_0x167c29(++_0x5b29ba);}(_0x7a54,0x106));var _0x47a5=function(_0x47a7e5,_0x459a46){_0x47a7e5=_0x47a7e5-0x0;var _0x170839=_0x7a54[_0x47a7e5];return _0x170839;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x552b0f,_0x3b88e2){var _0x275989=function(_0x31c63a){while(--_0x31c63a){_0x552b0f['push'](_0x552b0f['shift']());}};_0x275989(++_0x3b88e2);}(_0x7a54,0x106));var _0x47a5=function(_0x207736,_0x4dce74){_0x207736=_0x207736-0x0;var _0x106838=_0x7a54[_0x207736];return _0x106838;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index ff484bf..c9150ab 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 _0x58d8=['moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','api'];(function(_0x20181d,_0x4967f4){var _0x1fc5a2=function(_0x3e69dc){while(--_0x3e69dc){_0x20181d['push'](_0x20181d['shift']());}};_0x1fc5a2(++_0x4967f4);}(_0x58d8,0xc0));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x858d('0x0'));var util=require(_0x858d('0x1'));var logger=require('../../config/logger')(_0x858d('0x2'));var moment=require(_0x858d('0x3'));var BPromise=require(_0x858d('0x4'));var rp=require(_0x858d('0x5'));var fs=require('fs');var path=require(_0x858d('0x6'));var rimraf=require('rimraf');var config=require(_0x858d('0x7'));var attributes=require(_0x858d('0x8'));module[_0x858d('0x9')]=function(_0x2607a2,_0x578981){return _0x2607a2[_0x858d('0xa')](_0x858d('0xb'),attributes,{'tableName':_0x858d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1e5=['request-promise','../../config/environment','./condition.attributes','tools_conditions','util','../../config/logger','moment'];(function(_0x1cf7d1,_0x395d36){var _0x28f291=function(_0x3ad8bf){while(--_0x3ad8bf){_0x1cf7d1['push'](_0x1cf7d1['shift']());}};_0x28f291(++_0x395d36);}(_0xf1e5,0x1d9));var _0x5f1e=function(_0xbb9667,_0x36c9f0){_0xbb9667=_0xbb9667-0x0;var _0x347994=_0xf1e5[_0xbb9667];return _0x347994;};'use strict';var _=require('lodash');var util=require(_0x5f1e('0x0'));var logger=require(_0x5f1e('0x1'))('api');var moment=require(_0x5f1e('0x2'));var BPromise=require('bluebird');var rp=require(_0x5f1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f1e('0x4'));var attributes=require(_0x5f1e('0x5'));module['exports']=function(_0x522b67,_0x185b6b){return _0x522b67['define']('Condition',attributes,{'tableName':_0x5f1e('0x6'),'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 6314519..6b3d542 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 _0x35df=['../../config/logger','rpc','../../config/environment','client','http','request','info','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xc7a1f3,_0x49aefd){var _0x3d2bdb=function(_0x21c551){while(--_0x21c551){_0xc7a1f3['push'](_0xc7a1f3['shift']());}};_0x3d2bdb(++_0x49aefd);}(_0x35df,0x189));var _0xf35d=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x35df[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0xf35d('0x0'));var moment=require(_0xf35d('0x1'));var BPromise=require(_0xf35d('0x2'));var rs=require(_0xf35d('0x3'));var fs=require('fs');var Redis=require(_0xf35d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf35d('0x5'));var logger=require(_0xf35d('0x6'))(_0xf35d('0x7'));var config=require(_0xf35d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf35d('0x9')][_0xf35d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca7594,_0x548c88,_0x1b74ec){return new BPromise(function(_0x3bda3a,_0x37310e){return client[_0xf35d('0xb')](_0xca7594,_0x1b74ec)['then'](function(_0xd8b9d1){logger[_0xf35d('0xc')](_0xf35d('0xd'),_0x548c88,'request\x20sent');logger[_0xf35d('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x548c88,_0xf35d('0xf'),JSON[_0xf35d('0x10')](_0xd8b9d1));if(_0xd8b9d1[_0xf35d('0x11')]){if(_0xd8b9d1[_0xf35d('0x11')][_0xf35d('0x12')]===0x1f4){logger[_0xf35d('0x11')](_0xf35d('0xd'),_0x548c88,_0xd8b9d1[_0xf35d('0x11')]['message']);return _0x37310e(_0xd8b9d1[_0xf35d('0x11')][_0xf35d('0x13')]);}logger[_0xf35d('0x11')](_0xf35d('0xd'),_0x548c88,_0xd8b9d1['error'][_0xf35d('0x13')]);return _0x3bda3a(_0xd8b9d1[_0xf35d('0x11')][_0xf35d('0x13')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x548c88,_0xf35d('0xf'));_0x3bda3a(_0xd8b9d1[_0xf35d('0x14')]['message']);}})['catch'](function(_0x935e7){logger['error'](_0xf35d('0xd'),_0x548c88,_0x935e7);_0x37310e(_0x935e7);});});} \ No newline at end of file +var _0x27d1=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1842f1,_0xeb7b6){var _0x2b446a=function(_0x52e631){while(--_0x52e631){_0x1842f1['push'](_0x1842f1['shift']());}};_0x2b446a(++_0xeb7b6);}(_0x27d1,0x68));var _0x127d=function(_0x46632d,_0x1fb958){_0x46632d=_0x46632d-0x0;var _0xeff17a=_0x27d1[_0x46632d];return _0xeff17a;};'use strict';var _=require(_0x127d('0x0'));var util=require(_0x127d('0x1'));var moment=require('moment');var BPromise=require(_0x127d('0x2'));var rs=require(_0x127d('0x3'));var fs=require('fs');var Redis=require(_0x127d('0x4'));var db=require(_0x127d('0x5'))['db'];var utils=require(_0x127d('0x6'));var logger=require(_0x127d('0x7'))(_0x127d('0x8'));var config=require(_0x127d('0x9'));var jayson=require(_0x127d('0xa'));var client=jayson[_0x127d('0xb')][_0x127d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x183a40,_0x926459,_0x2c4389){return new BPromise(function(_0x2f9075,_0x2091c5){return client[_0x127d('0xd')](_0x183a40,_0x2c4389)[_0x127d('0xe')](function(_0x407aee){logger[_0x127d('0xf')](_0x127d('0x10'),_0x926459,_0x127d('0x11'));logger[_0x127d('0x12')]('Condition,\x20%s,\x20%s,\x20%s',_0x926459,_0x127d('0x11'),JSON[_0x127d('0x13')](_0x407aee));if(_0x407aee['error']){if(_0x407aee[_0x127d('0x14')][_0x127d('0x15')]===0x1f4){logger[_0x127d('0x14')](_0x127d('0x10'),_0x926459,_0x407aee[_0x127d('0x14')][_0x127d('0x16')]);return _0x2091c5(_0x407aee[_0x127d('0x14')][_0x127d('0x16')]);}logger[_0x127d('0x14')](_0x127d('0x10'),_0x926459,_0x407aee[_0x127d('0x14')][_0x127d('0x16')]);return _0x2f9075(_0x407aee['error']['message']);}else{logger[_0x127d('0xf')](_0x127d('0x10'),_0x926459,'request\x20sent');_0x2f9075(_0x407aee[_0x127d('0x17')][_0x127d('0x16')]);}})[_0x127d('0x18')](function(_0x30a2e9){logger[_0x127d('0x14')](_0x127d('0x10'),_0x926459,_0x30a2e9);_0x2091c5(_0x30a2e9);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6668e44..7849640 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 _0xa7ce=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','put','isAuthenticated','update','/:id','destroy','exports','util'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0xa7ce,0xbf));var _0xea7c=function(_0xd22cec,_0x329ce0){_0xd22cec=_0xd22cec-0x0;var _0x1cacee=_0xa7ce[_0xd22cec];return _0x1cacee;};'use strict';var multer=require('multer');var util=require(_0xea7c('0x0'));var path=require(_0xea7c('0x1'));var timeout=require(_0xea7c('0x2'));var express=require('express');var router=express[_0xea7c('0x3')]();var fs_extra=require(_0xea7c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea7c('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xea7c('0x6')]('/:id',auth[_0xea7c('0x7')](),controller[_0xea7c('0x8')]);router['delete'](_0xea7c('0x9'),auth[_0xea7c('0x7')](),controller[_0xea7c('0xa')]);module[_0xea7c('0xb')]=router; \ No newline at end of file +var _0x61ef=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','multer','path'];(function(_0x4f1dd0,_0x4b9eac){var _0x41ea2e=function(_0x397238){while(--_0x397238){_0x4f1dd0['push'](_0x4f1dd0['shift']());}};_0x41ea2e(++_0x4b9eac);}(_0x61ef,0xd0));var _0xf61e=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x61ef[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0xf61e('0x0'));var util=require('util');var path=require(_0xf61e('0x1'));var timeout=require(_0xf61e('0x2'));var express=require(_0xf61e('0x3'));var router=express[_0xf61e('0x4')]();var fs_extra=require(_0xf61e('0x5'));var auth=require(_0xf61e('0x6'));var interaction=require(_0xf61e('0x7'));var config=require(_0xf61e('0x8'));var controller=require(_0xf61e('0x9'));router[_0xf61e('0xa')](_0xf61e('0xb'),auth[_0xf61e('0xc')](),controller[_0xf61e('0xd')]);router['delete'](_0xf61e('0xb'),auth[_0xf61e('0xc')](),controller[_0xf61e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 80b9265..22abb75 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 _0xb7e7=['STRING','sequelize'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3bfef7,_0x264ab8){var _0x279a77=function(_0x199146){while(--_0x199146){_0x3bfef7['push'](_0x3bfef7['shift']());}};_0x279a77(++_0x264ab8);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index fb94ad2..f1bef00 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 _0x38c4=['attrRefresh','stringify','addItem','DashboardItem','findOne','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','end','error','stack','name','send','map','Dashboard','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','createdAt','updatedAt','omit','userProfileId','autoAssociation','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrReport','reportType'];(function(_0xef5e8c,_0x4deb70){var _0xc251c9=function(_0x5364cf){while(--_0x5364cf){_0xef5e8c['push'](_0xef5e8c['shift']());}};_0xc251c9(++_0x4deb70);}(_0x38c4,0x10d));var _0x438c=function(_0x3eeca0,_0x272af2){_0x3eeca0=_0x3eeca0-0x0;var _0x33e868=_0x38c4[_0x3eeca0];return _0x33e868;};'use strict';var emlformat=require(_0x438c('0x0'));var rimraf=require(_0x438c('0x1'));var zipdir=require(_0x438c('0x2'));var jsonpatch=require(_0x438c('0x3'));var rp=require(_0x438c('0x4'));var moment=require('moment');var BPromise=require(_0x438c('0x5'));var Mustache=require(_0x438c('0x6'));var util=require(_0x438c('0x7'));var path=require(_0x438c('0x8'));var sox=require(_0x438c('0x9'));var csv=require(_0x438c('0xa'));var ejs=require(_0x438c('0xb'));var fs=require('fs');var fs_extra=require(_0x438c('0xc'));var _=require(_0x438c('0xd'));var squel=require(_0x438c('0xe'));var crypto=require(_0x438c('0xf'));var jsforce=require(_0x438c('0x10'));var deskjs=require(_0x438c('0x11'));var toCsv=require(_0x438c('0xa'));var querystring=require(_0x438c('0x12'));var Papa=require(_0x438c('0x13'));var Redis=require('ioredis');var authService=require(_0x438c('0x14'));var qs=require(_0x438c('0x15'));var as=require(_0x438c('0x16'));var hardwareService=require(_0x438c('0x17'));var logger=require(_0x438c('0x18'))(_0x438c('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x438c('0x1a'));var db=require(_0x438c('0x1b'))['db'];config[_0x438c('0x1c')]=_['defaults'](config['redis'],{'host':_0x438c('0x1d'),'port':0x18eb});var socket=require(_0x438c('0x1e'))(new Redis(config['redis']));require('./dashboard.socket')[_0x438c('0x1f')](socket);function respondWithStatusCode(_0x525a34,_0x1e2557){_0x1e2557=_0x1e2557||0xcc;return function(_0x3e175d){if(_0x3e175d){return _0x525a34[_0x438c('0x20')](_0x1e2557);}return _0x525a34[_0x438c('0x21')](_0x1e2557)['end']();};}function respondWithResult(_0x5a16a0,_0x2bbd7c){_0x2bbd7c=_0x2bbd7c||0xc8;return function(_0x24d97e){if(_0x24d97e){return _0x5a16a0[_0x438c('0x21')](_0x2bbd7c)[_0x438c('0x22')](_0x24d97e);}};}function respondWithFilteredResult(_0x583232,_0x4f26ba){return function(_0x3360e0){if(_0x3360e0){var _0x278736=typeof _0x4f26ba[_0x438c('0x23')]==='undefined'&&typeof _0x4f26ba[_0x438c('0x24')]===_0x438c('0x25');var _0x2f2ce0=_0x3360e0[_0x438c('0x26')];var _0x5ea774=_0x278736?0x0:_0x4f26ba[_0x438c('0x23')];var _0x414b5d=_0x278736?_0x3360e0[_0x438c('0x26')]:_0x4f26ba[_0x438c('0x23')]+_0x4f26ba[_0x438c('0x24')];var _0x2f51ea;if(_0x414b5d>=_0x2f2ce0){_0x414b5d=_0x2f2ce0;_0x2f51ea=0xc8;}else{_0x2f51ea=0xce;}_0x583232[_0x438c('0x21')](_0x2f51ea);return _0x583232[_0x438c('0x27')](_0x438c('0x28'),_0x5ea774+'-'+_0x414b5d+'/'+_0x2f2ce0)[_0x438c('0x22')](_0x3360e0);}return null;};}function patchUpdates(_0x2eb24f){return function(_0x4987e5){try{jsonpatch[_0x438c('0x29')](_0x4987e5,_0x2eb24f,!![]);}catch(_0x4ca880){return BPromise[_0x438c('0x2a')](_0x4ca880);}return _0x4987e5[_0x438c('0x2b')]();};}function saveUpdates(_0x55ab65,_0x5c04d0){return function(_0x28a65a){if(_0x28a65a){return _0x28a65a[_0x438c('0x2c')](_0x55ab65)[_0x438c('0x2d')](function(_0x1875f2){return _0x1875f2;});}return null;};}function removeEntity(_0x2a0b84,_0xddeafe){return function(_0x292755){if(_0x292755){return _0x292755[_0x438c('0x2e')]()['then'](function(){var _0x515dce=_0x292755['get']({'plain':!![]});var _0x2cf445=_0x438c('0x2f');return db[_0x438c('0x30')][_0x438c('0x2e')]({'where':{'type':_0x2cf445,'resourceId':_0x515dce['id']}})[_0x438c('0x2d')](function(){return _0x292755;});})[_0x438c('0x2d')](function(){_0x2a0b84[_0x438c('0x21')](0xcc)[_0x438c('0x31')]();});}};}function handleEntityNotFound(_0x561287,_0x19b040){return function(_0x509b84){if(!_0x509b84){_0x561287[_0x438c('0x20')](0x194);}return _0x509b84;};}function handleError(_0x133db1,_0x5df5c8){_0x5df5c8=_0x5df5c8||0x1f4;return function(_0x1da30a){logger[_0x438c('0x32')](_0x1da30a[_0x438c('0x33')]);if(_0x1da30a[_0x438c('0x34')]){delete _0x1da30a[_0x438c('0x34')];}_0x133db1['status'](_0x5df5c8)[_0x438c('0x35')](_0x1da30a);};}exports['index']=function(_0x47ffb4,_0x59bc83){var _0x3488f0={},_0x29cc8c={},_0x4ae94d={'count':0x0,'rows':[]};var _0x2c4bd0=_[_0x438c('0x36')](db[_0x438c('0x37')]['rawAttributes'],function(_0x5e634f){return{'name':_0x5e634f[_0x438c('0x38')],'type':_0x5e634f[_0x438c('0x39')]['key']};});_0x29cc8c[_0x438c('0x3a')]=_['map'](_0x2c4bd0,_0x438c('0x34'));_0x29cc8c[_0x438c('0x3b')]=_[_0x438c('0x3c')](_0x47ffb4[_0x438c('0x3b')]);_0x29cc8c[_0x438c('0x3d')]=_['intersection'](_0x29cc8c[_0x438c('0x3a')],_0x29cc8c['query']);_0x3488f0[_0x438c('0x3e')]=_[_0x438c('0x3f')](_0x29cc8c['model'],qs[_0x438c('0x40')](_0x47ffb4[_0x438c('0x3b')][_0x438c('0x40')]));_0x3488f0['attributes']=_0x3488f0[_0x438c('0x3e')][_0x438c('0x41')]?_0x3488f0[_0x438c('0x3e')]:_0x29cc8c['model'];if(!_0x47ffb4[_0x438c('0x3b')][_0x438c('0x42')](_0x438c('0x43'))){_0x3488f0[_0x438c('0x24')]=qs[_0x438c('0x24')](_0x47ffb4[_0x438c('0x3b')][_0x438c('0x24')]);_0x3488f0[_0x438c('0x23')]=qs[_0x438c('0x23')](_0x47ffb4[_0x438c('0x3b')][_0x438c('0x23')]);}_0x3488f0[_0x438c('0x44')]=qs[_0x438c('0x45')](_0x47ffb4[_0x438c('0x3b')]['sort']);_0x3488f0['where']=qs[_0x438c('0x3d')](_['pick'](_0x47ffb4['query'],_0x29cc8c[_0x438c('0x3d')]),_0x2c4bd0);if(_0x47ffb4[_0x438c('0x3b')][_0x438c('0x46')]){_0x3488f0['where']=_[_0x438c('0x47')](_0x3488f0[_0x438c('0x48')],{'$or':_[_0x438c('0x36')](_0x2c4bd0,function(_0x53c556){if(_0x53c556[_0x438c('0x39')]!==_0x438c('0x49')){var _0x46111b={};_0x46111b[_0x53c556[_0x438c('0x34')]]={'$like':'%'+_0x47ffb4[_0x438c('0x3b')]['filter']+'%'};return _0x46111b;}})});}_0x3488f0=_[_0x438c('0x47')]({},_0x3488f0,_0x47ffb4[_0x438c('0x4a')]);var _0x2e3e02={'where':_0x3488f0[_0x438c('0x48')]};return db[_0x438c('0x37')][_0x438c('0x26')](_0x2e3e02)['then'](function(_0x21717a){_0x4ae94d[_0x438c('0x26')]=_0x21717a;if(_0x47ffb4[_0x438c('0x3b')][_0x438c('0x4b')]){_0x3488f0['include']=[{'all':!![]}];}return db['Dashboard'][_0x438c('0x4c')](_0x3488f0);})[_0x438c('0x2d')](function(_0x3c23ab){_0x4ae94d[_0x438c('0x4d')]=_0x3c23ab;return _0x4ae94d;})[_0x438c('0x2d')](respondWithFilteredResult(_0x59bc83,_0x3488f0))[_0x438c('0x4e')](handleError(_0x59bc83,null));};exports[_0x438c('0x4f')]=function(_0x419c00,_0x861d30){var _0x3b1739={'raw':![],'where':{'id':_0x419c00[_0x438c('0x50')]['id']}},_0x1fef2e={};_0x1fef2e['model']=_['keys'](db[_0x438c('0x37')]['rawAttributes']);_0x1fef2e[_0x438c('0x3b')]=_['keys'](_0x419c00['query']);_0x1fef2e[_0x438c('0x3d')]=_['intersection'](_0x1fef2e[_0x438c('0x3a')],_0x1fef2e[_0x438c('0x3b')]);_0x3b1739['attributes']=_[_0x438c('0x3f')](_0x1fef2e[_0x438c('0x3a')],qs[_0x438c('0x40')](_0x419c00['query'][_0x438c('0x40')]));_0x3b1739[_0x438c('0x3e')]=_0x3b1739['attributes']['length']?_0x3b1739[_0x438c('0x3e')]:_0x1fef2e[_0x438c('0x3a')];if(_0x419c00[_0x438c('0x3b')][_0x438c('0x4b')]){_0x3b1739[_0x438c('0x51')]=[{'all':!![]}];}_0x3b1739=_[_0x438c('0x47')]({},_0x3b1739,_0x419c00[_0x438c('0x4a')]);return db['Dashboard']['find'](_0x3b1739)[_0x438c('0x2d')](handleEntityNotFound(_0x861d30,null))[_0x438c('0x2d')](respondWithResult(_0x861d30,null))[_0x438c('0x4e')](handleError(_0x861d30,null));};exports[_0x438c('0x52')]=function(_0x51237f,_0x3afdf0){return db[_0x438c('0x37')][_0x438c('0x52')](_0x51237f[_0x438c('0x53')],{})['then'](function(_0x2bedf2){var _0x144c87=_0x51237f[_0x438c('0x54')][_0x438c('0x55')]({'plain':!![]});if(!_0x144c87)throw new Error(_0x438c('0x56'));if(_0x144c87[_0x438c('0x57')]===_0x438c('0x54')){var _0x4d80e0=_0x2bedf2[_0x438c('0x55')]({'plain':!![]});var _0x591cce=_0x438c('0x2f');return db[_0x438c('0x58')][_0x438c('0x59')]({'where':{'name':_0x591cce,'userProfileId':_0x144c87['userProfileId']},'raw':!![]})['then'](function(_0x2168c5){if(_0x2168c5&&_0x2168c5['autoAssociation']===0x0){return db[_0x438c('0x30')][_0x438c('0x52')]({'name':_0x4d80e0[_0x438c('0x34')],'resourceId':_0x4d80e0['id'],'type':_0x2168c5[_0x438c('0x34')],'sectionId':_0x2168c5['id']},{})[_0x438c('0x2d')](function(){return _0x2bedf2;});}else{return _0x2bedf2;}})[_0x438c('0x4e')](function(_0x2edb77){logger['error'](_0x438c('0x5a'),_0x2edb77);throw _0x2edb77;});}return _0x2bedf2;})[_0x438c('0x2d')](respondWithResult(_0x3afdf0,0xc9))[_0x438c('0x4e')](handleError(_0x3afdf0,null));};exports['clone']=function(_0x2a54f8,_0x1b8647){var _0x13e3cc={'where':{'id':_0x2a54f8[_0x438c('0x50')]['id']}},_0x1bb5c6={};_0x1bb5c6[_0x438c('0x3a')]=_[_0x438c('0x3c')](db[_0x438c('0x37')][_0x438c('0x5b')]);_0x13e3cc['attributes']=_[_0x438c('0x3f')](_0x1bb5c6[_0x438c('0x3a')],qs[_0x438c('0x40')](_0x2a54f8[_0x438c('0x3b')]['fields']));_0x13e3cc[_0x438c('0x3e')]=_0x13e3cc[_0x438c('0x3e')][_0x438c('0x41')]?_0x13e3cc[_0x438c('0x3e')]:_0x1bb5c6[_0x438c('0x3a')];if(_0x2a54f8[_0x438c('0x3b')][_0x438c('0x4b')]){_0x13e3cc['include']=[{'all':!![]}];}_0x13e3cc=_[_0x438c('0x47')]({},_0x13e3cc,_0x2a54f8['options']);return db['Dashboard']['find'](_0x13e3cc)[_0x438c('0x2d')](handleEntityNotFound(_0x1b8647,null))['then'](function(_0x58de63){if(_0x58de63){var _0x3bf3e9=_0x58de63[_0x438c('0x55')]({'plain':!![]});_0x3bf3e9=qs['omit'](_0x3bf3e9,['id',_0x438c('0x5c'),_0x438c('0x5d')]);_0x2a54f8[_0x438c('0x53')]=_[_0x438c('0x5e')](_0x2a54f8[_0x438c('0x53')],['id',_0x438c('0x5c'),'updatedAt']);return db['Dashboard']['create'](_[_0x438c('0x47')](_0x3bf3e9,_0x2a54f8[_0x438c('0x53')]),{'include':_0x2a54f8[_0x438c('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0x438c('0x2d')](function(_0x1112ef){var _0x29a384=_0x2a54f8[_0x438c('0x54')][_0x438c('0x55')]({'plain':!![]});if(!_0x29a384)throw new Error(_0x438c('0x56'));if(_0x29a384[_0x438c('0x57')]==='user'){var _0x2cb53c=_0x1112ef['get']({'plain':!![]});var _0x405cd6='CustomDashboards';return db[_0x438c('0x58')][_0x438c('0x59')]({'where':{'name':_0x405cd6,'userProfileId':_0x29a384[_0x438c('0x5f')]},'raw':!![]})[_0x438c('0x2d')](function(_0x42100d){if(_0x42100d&&_0x42100d[_0x438c('0x60')]===0x0){return db[_0x438c('0x30')][_0x438c('0x52')]({'name':_0x2cb53c['name'],'resourceId':_0x2cb53c['id'],'type':_0x42100d[_0x438c('0x34')],'sectionId':_0x42100d['id']},{})['then'](function(){return _0x1112ef;});}else{return _0x1112ef;}})[_0x438c('0x4e')](function(_0x3ff7a2){logger['error'](_0x438c('0x5a'),_0x3ff7a2);throw _0x3ff7a2;});}return _0x1112ef;});}})[_0x438c('0x2d')](respondWithResult(_0x1b8647,0xc9))[_0x438c('0x4e')](handleError(_0x1b8647,null));};exports['update']=function(_0x19f9bb,_0x4d6931){if(_0x19f9bb[_0x438c('0x53')]['id']){delete _0x19f9bb['body']['id'];}return db[_0x438c('0x37')]['find']({'where':{'id':_0x19f9bb[_0x438c('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d6931,null))[_0x438c('0x2d')](saveUpdates(_0x19f9bb['body'],null))[_0x438c('0x2d')](respondWithResult(_0x4d6931,null))[_0x438c('0x4e')](handleError(_0x4d6931,null));};exports['destroy']=function(_0x4e172b,_0x90ba60){return db[_0x438c('0x37')]['find']({'where':{'id':_0x4e172b['params']['id']}})[_0x438c('0x2d')](handleEntityNotFound(_0x90ba60,null))[_0x438c('0x2d')](removeEntity(_0x90ba60,null))['catch'](handleError(_0x90ba60,null));};function widgetAttributes(_0x2b15a1){try{switch(_0x2b15a1[_0x438c('0x39')]){case'iframe':return[{'name':'attrUrl','value':_0x2b15a1[_0x438c('0x61')]||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1[_0x438c('0x62')][0x0][_0x438c('0x63')]:undefined)||'https://'}];case _0x438c('0x64'):return[{'name':_0x438c('0x65'),'value':_0x2b15a1[_0x438c('0x65')]||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1[_0x438c('0x62')][0x0][_0x438c('0x63')]:undefined)||''}];case _0x438c('0x66'):return[{'name':'attrHourFormat','value':_0x2b15a1[_0x438c('0x67')]||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1['attrs'][0x0][_0x438c('0x63')]:undefined)||_0x438c('0x68')},{'name':_0x438c('0x69'),'value':_0x2b15a1['attrTimezone']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x1]?_0x2b15a1[_0x438c('0x62')][0x1][_0x438c('0x63')]:undefined)||_0x438c('0x6a')},{'name':'attrFontSize','value':_0x2b15a1[_0x438c('0x6b')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x2]?_0x2b15a1[_0x438c('0x62')][0x2][_0x438c('0x63')]:undefined)||0xc}];case'counter':return[{'name':_0x438c('0x6c'),'value':_0x2b15a1['attrMetric']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1['attrs'][0x0][_0x438c('0x63')]:undefined)||_0x438c('0x6d')},{'name':_0x438c('0x6e'),'value':_0x2b15a1['attrVoiceQueues']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x1]?_0x2b15a1[_0x438c('0x62')][0x1][_0x438c('0x63')]:undefined)||[]},{'name':_0x438c('0x6b'),'value':_0x2b15a1['attrFontSize']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x2]?_0x2b15a1[_0x438c('0x62')][0x2]['value']:undefined)||0x14},{'name':_0x438c('0x6f'),'value':_0x2b15a1[_0x438c('0x6f')]||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x3]?_0x2b15a1['attrs'][0x3][_0x438c('0x63')]:undefined)||'voice'},{'name':_0x438c('0x70'),'value':_0x2b15a1['attrEmailAccounts']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x4]?_0x2b15a1[_0x438c('0x62')][0x4][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x71'),'value':_0x2b15a1[_0x438c('0x71')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x5]?_0x2b15a1[_0x438c('0x62')][0x5][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x72'),'value':_0x2b15a1[_0x438c('0x72')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x6]?_0x2b15a1[_0x438c('0x62')][0x6][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x73'),'value':_0x2b15a1[_0x438c('0x73')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x7]?_0x2b15a1['attrs'][0x7][_0x438c('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2b15a1[_0x438c('0x74')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x8]?_0x2b15a1[_0x438c('0x62')][0x8][_0x438c('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2b15a1[_0x438c('0x75')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x9]?_0x2b15a1[_0x438c('0x62')][0x9][_0x438c('0x63')]:undefined)||''}];case _0x438c('0x76'):case _0x438c('0x77'):return[{'name':_0x438c('0x78'),'value':_0x2b15a1[_0x438c('0x78')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x0]?_0x2b15a1[_0x438c('0x62')][0x0][_0x438c('0x63')]:undefined)||_0x438c('0x6d')},{'name':'attrSerie2','value':_0x2b15a1['attrSerie2']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x1]?_0x2b15a1[_0x438c('0x62')][0x1][_0x438c('0x63')]:undefined)||null},{'name':_0x438c('0x79'),'value':_0x2b15a1['attrSerie3']||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x2]?_0x2b15a1[_0x438c('0x62')][0x2][_0x438c('0x63')]:undefined)||null},{'name':_0x438c('0x6e'),'value':_0x2b15a1[_0x438c('0x6e')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x3]?_0x2b15a1[_0x438c('0x62')][0x3][_0x438c('0x63')]:undefined)||[]},{'name':'attrChannel','value':_0x2b15a1[_0x438c('0x6f')]||(_0x2b15a1['attrs']&&_0x2b15a1[_0x438c('0x62')][0x4]?_0x2b15a1[_0x438c('0x62')][0x4][_0x438c('0x63')]:undefined)||'voice'},{'name':_0x438c('0x70'),'value':_0x2b15a1['attrEmailAccounts']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x5]?_0x2b15a1[_0x438c('0x62')][0x5]['value']:undefined)||''},{'name':_0x438c('0x71'),'value':_0x2b15a1['attrFaxAccounts']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x6]?_0x2b15a1[_0x438c('0x62')][0x6][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x72'),'value':_0x2b15a1[_0x438c('0x72')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x7]?_0x2b15a1[_0x438c('0x62')][0x7][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x73'),'value':_0x2b15a1[_0x438c('0x73')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x8]?_0x2b15a1[_0x438c('0x62')][0x8][_0x438c('0x63')]:undefined)||''},{'name':_0x438c('0x74'),'value':_0x2b15a1[_0x438c('0x74')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x9]?_0x2b15a1[_0x438c('0x62')][0x9][_0x438c('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2b15a1[_0x438c('0x75')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0xa]?_0x2b15a1['attrs'][0xa][_0x438c('0x63')]:undefined)||''}];case'web-report':return[{'name':_0x438c('0x7a'),'type':_0x2b15a1[_0x438c('0x7b')]||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1[_0x438c('0x62')][0x0][_0x438c('0x39')]:undefined)||null,'value':_0x2b15a1['attrReport']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1[_0x438c('0x62')][0x0]?_0x2b15a1[_0x438c('0x62')][0x0][_0x438c('0x63')]:undefined)||null},{'name':_0x438c('0x7c'),'value':_0x2b15a1['attrRefresh']||(_0x2b15a1[_0x438c('0x62')]&&_0x2b15a1['attrs'][0x1]?_0x2b15a1['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x401211){logger['error']('widgetAttributes:\x20%s',JSON[_0x438c('0x7d')](_0x401211));return[];}}exports[_0x438c('0x7e')]=function(_0xdd52c6,_0x51f9ae,_0x4f083d){if(_0xdd52c6[_0x438c('0x53')]['id']){delete _0xdd52c6[_0x438c('0x53')]['id'];}return db[_0x438c('0x37')][_0x438c('0x59')]({'where':{'id':_0xdd52c6[_0x438c('0x50')]['id']}})[_0x438c('0x2d')](handleEntityNotFound(_0x51f9ae,null))['then'](function(_0x2b4744){if(_0x2b4744){_0xdd52c6['body']['DashboardId']=_0x2b4744['id'];_0xdd52c6[_0x438c('0x53')][_0x438c('0x62')]=widgetAttributes(_0xdd52c6[_0x438c('0x53')]);return db[_0x438c('0x7f')][_0x438c('0x52')](_0xdd52c6[_0x438c('0x53')]);}})[_0x438c('0x2d')](respondWithResult(_0x51f9ae,null))[_0x438c('0x4e')](handleError(_0x51f9ae,null));};exports['getItems']=function(_0x51e28c,_0x3250a5,_0x39cc4c){var _0x4dc98f={};var _0x5df88b={};var _0x16db59;var _0x332f24;return db[_0x438c('0x37')][_0x438c('0x80')]({'where':{'id':_0x51e28c[_0x438c('0x50')]['id']}})['then'](handleEntityNotFound(_0x3250a5,null))[_0x438c('0x2d')](function(_0xb15c40){if(_0xb15c40){_0x16db59=_0xb15c40;_0x5df88b[_0x438c('0x3a')]=_['keys'](db[_0x438c('0x7f')]['rawAttributes']);_0x5df88b['query']=_[_0x438c('0x3c')](_0x51e28c['query']);_0x5df88b[_0x438c('0x3d')]=_[_0x438c('0x3f')](_0x5df88b[_0x438c('0x3a')],_0x5df88b[_0x438c('0x3b')]);_0x4dc98f[_0x438c('0x3e')]=_['intersection'](_0x5df88b[_0x438c('0x3a')],qs[_0x438c('0x40')](_0x51e28c['query'][_0x438c('0x40')]));_0x4dc98f['attributes']=_0x4dc98f[_0x438c('0x3e')][_0x438c('0x41')]?_0x4dc98f['attributes']:_0x5df88b[_0x438c('0x3a')];_0x4dc98f['order']=qs['sort'](_0x51e28c[_0x438c('0x3b')][_0x438c('0x45')]);_0x4dc98f[_0x438c('0x48')]=qs[_0x438c('0x3d')](_[_0x438c('0x81')](_0x51e28c['query'],_0x5df88b[_0x438c('0x3d')]));if(_0x51e28c[_0x438c('0x3b')][_0x438c('0x46')]){_0x4dc98f['where']=_['merge'](_0x4dc98f['where'],{'$or':_['map'](_0x4dc98f['attributes'],function(_0x430bef){var _0x228126={};_0x228126[_0x430bef]={'$like':'%'+_0x51e28c[_0x438c('0x3b')][_0x438c('0x46')]+'%'};return _0x228126;})});}_0x4dc98f=_[_0x438c('0x47')]({},_0x4dc98f,_0x51e28c[_0x438c('0x4a')]);return _0x16db59[_0x438c('0x82')](_0x4dc98f);}})[_0x438c('0x2d')](function(_0x4d27e2){if(_0x4d27e2){_0x332f24=_0x4d27e2['length'];if(!_0x51e28c[_0x438c('0x3b')][_0x438c('0x42')]('nolimit')){_0x4dc98f[_0x438c('0x24')]=qs[_0x438c('0x24')](_0x51e28c[_0x438c('0x3b')][_0x438c('0x24')]);_0x4dc98f['offset']=qs[_0x438c('0x23')](_0x51e28c[_0x438c('0x3b')][_0x438c('0x23')]);}return _0x16db59[_0x438c('0x82')](_0x4dc98f);}})['then'](function(_0x2e9175){if(_0x2e9175){return _0x2e9175?{'count':_0x332f24,'rows':_0x2e9175}:null;}})['then'](respondWithResult(_0x3250a5,null))[_0x438c('0x4e')](handleError(_0x3250a5,null));}; \ No newline at end of file +var _0x88a8=['type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','Dashboard','findAll','rows','catch','params','find','create','user','get','role','UserProfileSection','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../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','./dashboard.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName'];(function(_0x5b8c28,_0x219f5f){var _0x4a36ec=function(_0x297c4e){while(--_0x297c4e){_0x5b8c28['push'](_0x5b8c28['shift']());}};_0x4a36ec(++_0x219f5f);}(_0x88a8,0x159));var _0x888a=function(_0x24383c,_0xf93f31){_0x24383c=_0x24383c-0x0;var _0x31ddd2=_0x88a8[_0x24383c];return _0x31ddd2;};'use strict';var emlformat=require(_0x888a('0x0'));var rimraf=require(_0x888a('0x1'));var zipdir=require(_0x888a('0x2'));var jsonpatch=require(_0x888a('0x3'));var rp=require(_0x888a('0x4'));var moment=require(_0x888a('0x5'));var BPromise=require(_0x888a('0x6'));var Mustache=require(_0x888a('0x7'));var util=require('util');var path=require(_0x888a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x888a('0x9'));var fs=require('fs');var fs_extra=require(_0x888a('0xa'));var _=require(_0x888a('0xb'));var squel=require('squel');var crypto=require(_0x888a('0xc'));var jsforce=require(_0x888a('0xd'));var deskjs=require(_0x888a('0xe'));var toCsv=require(_0x888a('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x888a('0x10'));var qs=require(_0x888a('0x11'));var as=require(_0x888a('0x12'));var hardwareService=require(_0x888a('0x13'));var logger=require(_0x888a('0x14'))(_0x888a('0x15'));var utils=require(_0x888a('0x16'));var config=require(_0x888a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x888a('0x18'))['db'];config[_0x888a('0x19')]=_[_0x888a('0x1a')](config[_0x888a('0x19')],{'host':_0x888a('0x1b'),'port':0x18eb});var socket=require(_0x888a('0x1c'))(new Redis(config[_0x888a('0x19')]));require(_0x888a('0x1d'))['register'](socket);function respondWithStatusCode(_0x1183c1,_0x3def98){_0x3def98=_0x3def98||0xcc;return function(_0x318eeb){if(_0x318eeb){return _0x1183c1[_0x888a('0x1e')](_0x3def98);}return _0x1183c1[_0x888a('0x1f')](_0x3def98)[_0x888a('0x20')]();};}function respondWithResult(_0x9ac62d,_0x38df98){_0x38df98=_0x38df98||0xc8;return function(_0x989740){if(_0x989740){return _0x9ac62d[_0x888a('0x1f')](_0x38df98)[_0x888a('0x21')](_0x989740);}};}function respondWithFilteredResult(_0x54a2ee,_0x375f5c){return function(_0x465d67){if(_0x465d67){var _0x9ed3ed=typeof _0x375f5c[_0x888a('0x22')]===_0x888a('0x23')&&typeof _0x375f5c['limit']===_0x888a('0x23');var _0x52280f=_0x465d67[_0x888a('0x24')];var _0x2e9079=_0x9ed3ed?0x0:_0x375f5c['offset'];var _0x4aba60=_0x9ed3ed?_0x465d67['count']:_0x375f5c[_0x888a('0x22')]+_0x375f5c[_0x888a('0x25')];var _0x2eb373;if(_0x4aba60>=_0x52280f){_0x4aba60=_0x52280f;_0x2eb373=0xc8;}else{_0x2eb373=0xce;}_0x54a2ee[_0x888a('0x1f')](_0x2eb373);return _0x54a2ee[_0x888a('0x26')]('Content-Range',_0x2e9079+'-'+_0x4aba60+'/'+_0x52280f)[_0x888a('0x21')](_0x465d67);}return null;};}function patchUpdates(_0x3c37c9){return function(_0xb52fca){try{jsonpatch[_0x888a('0x27')](_0xb52fca,_0x3c37c9,!![]);}catch(_0x1d85b4){return BPromise[_0x888a('0x28')](_0x1d85b4);}return _0xb52fca[_0x888a('0x29')]();};}function saveUpdates(_0x1d7c14,_0x3704c3){return function(_0x2583af){if(_0x2583af){return _0x2583af[_0x888a('0x2a')](_0x1d7c14)[_0x888a('0x2b')](function(_0x4faf5c){return _0x4faf5c;});}return null;};}function removeEntity(_0x20c85a,_0x273b99){return function(_0x39bc4d){if(_0x39bc4d){return _0x39bc4d[_0x888a('0x2c')]()[_0x888a('0x2b')](function(){var _0x2aca68=_0x39bc4d['get']({'plain':!![]});var _0xaa5bb=_0x888a('0x2d');return db[_0x888a('0x2e')][_0x888a('0x2c')]({'where':{'type':_0xaa5bb,'resourceId':_0x2aca68['id']}})['then'](function(){return _0x39bc4d;});})[_0x888a('0x2b')](function(){_0x20c85a[_0x888a('0x1f')](0xcc)[_0x888a('0x20')]();});}};}function handleEntityNotFound(_0x16adac,_0x4cd1a2){return function(_0x3376a9){if(!_0x3376a9){_0x16adac['sendStatus'](0x194);}return _0x3376a9;};}function handleError(_0x262049,_0x1bc495){_0x1bc495=_0x1bc495||0x1f4;return function(_0x396c11){logger[_0x888a('0x2f')](_0x396c11[_0x888a('0x30')]);if(_0x396c11[_0x888a('0x31')]){delete _0x396c11[_0x888a('0x31')];}_0x262049[_0x888a('0x1f')](_0x1bc495)[_0x888a('0x32')](_0x396c11);};}exports[_0x888a('0x33')]=function(_0x23ef2c,_0x473a23){var _0x567fd1={},_0x1dc323={},_0x3bc854={'count':0x0,'rows':[]};var _0x71620=_['map'](db['Dashboard'][_0x888a('0x34')],function(_0x3ee512){return{'name':_0x3ee512[_0x888a('0x35')],'type':_0x3ee512[_0x888a('0x36')]['key']};});_0x1dc323[_0x888a('0x37')]=_['map'](_0x71620,_0x888a('0x31'));_0x1dc323['query']=_[_0x888a('0x38')](_0x23ef2c['query']);_0x1dc323['filters']=_[_0x888a('0x39')](_0x1dc323[_0x888a('0x37')],_0x1dc323[_0x888a('0x3a')]);_0x567fd1[_0x888a('0x3b')]=_['intersection'](_0x1dc323[_0x888a('0x37')],qs[_0x888a('0x3c')](_0x23ef2c[_0x888a('0x3a')]['fields']));_0x567fd1[_0x888a('0x3b')]=_0x567fd1[_0x888a('0x3b')][_0x888a('0x3d')]?_0x567fd1[_0x888a('0x3b')]:_0x1dc323[_0x888a('0x37')];if(!_0x23ef2c[_0x888a('0x3a')][_0x888a('0x3e')](_0x888a('0x3f'))){_0x567fd1[_0x888a('0x25')]=qs[_0x888a('0x25')](_0x23ef2c[_0x888a('0x3a')][_0x888a('0x25')]);_0x567fd1[_0x888a('0x22')]=qs['offset'](_0x23ef2c[_0x888a('0x3a')][_0x888a('0x22')]);}_0x567fd1[_0x888a('0x40')]=qs[_0x888a('0x41')](_0x23ef2c[_0x888a('0x3a')][_0x888a('0x41')]);_0x567fd1[_0x888a('0x42')]=qs[_0x888a('0x43')](_[_0x888a('0x44')](_0x23ef2c[_0x888a('0x3a')],_0x1dc323[_0x888a('0x43')]),_0x71620);if(_0x23ef2c[_0x888a('0x3a')][_0x888a('0x45')]){_0x567fd1[_0x888a('0x42')]=_[_0x888a('0x46')](_0x567fd1['where'],{'$or':_[_0x888a('0x47')](_0x71620,function(_0x333d45){if(_0x333d45[_0x888a('0x36')]!==_0x888a('0x48')){var _0x5b1bbf={};_0x5b1bbf[_0x333d45[_0x888a('0x31')]]={'$like':'%'+_0x23ef2c['query']['filter']+'%'};return _0x5b1bbf;}})});}_0x567fd1=_[_0x888a('0x46')]({},_0x567fd1,_0x23ef2c[_0x888a('0x49')]);var _0x220f7c={'where':_0x567fd1[_0x888a('0x42')]};return db['Dashboard'][_0x888a('0x24')](_0x220f7c)['then'](function(_0x27766d){_0x3bc854[_0x888a('0x24')]=_0x27766d;if(_0x23ef2c[_0x888a('0x3a')][_0x888a('0x4a')]){_0x567fd1[_0x888a('0x4b')]=[{'all':!![]}];}return db[_0x888a('0x4c')][_0x888a('0x4d')](_0x567fd1);})[_0x888a('0x2b')](function(_0x56c3e1){_0x3bc854[_0x888a('0x4e')]=_0x56c3e1;return _0x3bc854;})['then'](respondWithFilteredResult(_0x473a23,_0x567fd1))[_0x888a('0x4f')](handleError(_0x473a23,null));};exports['show']=function(_0x50ec90,_0x4d0909){var _0x30943a={'raw':![],'where':{'id':_0x50ec90[_0x888a('0x50')]['id']}},_0x3350a9={};_0x3350a9[_0x888a('0x37')]=_[_0x888a('0x38')](db[_0x888a('0x4c')][_0x888a('0x34')]);_0x3350a9[_0x888a('0x3a')]=_[_0x888a('0x38')](_0x50ec90[_0x888a('0x3a')]);_0x3350a9[_0x888a('0x43')]=_[_0x888a('0x39')](_0x3350a9[_0x888a('0x37')],_0x3350a9[_0x888a('0x3a')]);_0x30943a['attributes']=_[_0x888a('0x39')](_0x3350a9[_0x888a('0x37')],qs[_0x888a('0x3c')](_0x50ec90[_0x888a('0x3a')][_0x888a('0x3c')]));_0x30943a[_0x888a('0x3b')]=_0x30943a['attributes']['length']?_0x30943a[_0x888a('0x3b')]:_0x3350a9[_0x888a('0x37')];if(_0x50ec90[_0x888a('0x3a')][_0x888a('0x4a')]){_0x30943a['include']=[{'all':!![]}];}_0x30943a=_[_0x888a('0x46')]({},_0x30943a,_0x50ec90[_0x888a('0x49')]);return db[_0x888a('0x4c')][_0x888a('0x51')](_0x30943a)[_0x888a('0x2b')](handleEntityNotFound(_0x4d0909,null))[_0x888a('0x2b')](respondWithResult(_0x4d0909,null))[_0x888a('0x4f')](handleError(_0x4d0909,null));};exports[_0x888a('0x52')]=function(_0x407013,_0x334ada){return db['Dashboard'][_0x888a('0x52')](_0x407013['body'],{})['then'](function(_0x352c43){var _0x5e1e9f=_0x407013[_0x888a('0x53')][_0x888a('0x54')]({'plain':!![]});if(!_0x5e1e9f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e1e9f[_0x888a('0x55')]===_0x888a('0x53')){var _0x1aa7c1=_0x352c43[_0x888a('0x54')]({'plain':!![]});var _0xcc48f0=_0x888a('0x2d');return db[_0x888a('0x56')][_0x888a('0x51')]({'where':{'name':_0xcc48f0,'userProfileId':_0x5e1e9f['userProfileId']},'raw':!![]})['then'](function(_0x1e33f7){if(_0x1e33f7&&_0x1e33f7['autoAssociation']===0x0){return db[_0x888a('0x2e')][_0x888a('0x52')]({'name':_0x1aa7c1[_0x888a('0x31')],'resourceId':_0x1aa7c1['id'],'type':_0x1e33f7[_0x888a('0x31')],'sectionId':_0x1e33f7['id']},{})[_0x888a('0x2b')](function(){return _0x352c43;});}else{return _0x352c43;}})['catch'](function(_0x59ba17){logger[_0x888a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59ba17);throw _0x59ba17;});}return _0x352c43;})['then'](respondWithResult(_0x334ada,0xc9))[_0x888a('0x4f')](handleError(_0x334ada,null));};exports['clone']=function(_0x553250,_0x3b62af){var _0x553b47={'where':{'id':_0x553250[_0x888a('0x50')]['id']}},_0x1a8d1e={};_0x1a8d1e[_0x888a('0x37')]=_[_0x888a('0x38')](db[_0x888a('0x4c')][_0x888a('0x34')]);_0x553b47[_0x888a('0x3b')]=_[_0x888a('0x39')](_0x1a8d1e[_0x888a('0x37')],qs['fields'](_0x553250[_0x888a('0x3a')][_0x888a('0x3c')]));_0x553b47[_0x888a('0x3b')]=_0x553b47[_0x888a('0x3b')][_0x888a('0x3d')]?_0x553b47[_0x888a('0x3b')]:_0x1a8d1e[_0x888a('0x37')];if(_0x553250['query']['includeAll']){_0x553b47[_0x888a('0x4b')]=[{'all':!![]}];}_0x553b47=_['merge']({},_0x553b47,_0x553250['options']);return db['Dashboard'][_0x888a('0x51')](_0x553b47)[_0x888a('0x2b')](handleEntityNotFound(_0x3b62af,null))[_0x888a('0x2b')](function(_0x144bc2){if(_0x144bc2){var _0x1a1c5f=_0x144bc2['get']({'plain':!![]});_0x1a1c5f=qs[_0x888a('0x57')](_0x1a1c5f,['id',_0x888a('0x58'),_0x888a('0x59')]);_0x553250[_0x888a('0x5a')]=_[_0x888a('0x57')](_0x553250[_0x888a('0x5a')],['id',_0x888a('0x58'),'updatedAt']);return db['Dashboard'][_0x888a('0x52')](_[_0x888a('0x46')](_0x1a1c5f,_0x553250[_0x888a('0x5a')]),{'include':_0x553250[_0x888a('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x888a('0x2b')](function(_0x5d45f3){var _0x499d54=_0x553250[_0x888a('0x53')][_0x888a('0x54')]({'plain':!![]});if(!_0x499d54)throw new Error(_0x888a('0x5b'));if(_0x499d54['role']==='user'){var _0x4a9cee=_0x5d45f3[_0x888a('0x54')]({'plain':!![]});var _0x3d4719=_0x888a('0x2d');return db[_0x888a('0x56')]['find']({'where':{'name':_0x3d4719,'userProfileId':_0x499d54[_0x888a('0x5c')]},'raw':!![]})[_0x888a('0x2b')](function(_0x5c1e1f){if(_0x5c1e1f&&_0x5c1e1f[_0x888a('0x5d')]===0x0){return db[_0x888a('0x2e')][_0x888a('0x52')]({'name':_0x4a9cee[_0x888a('0x31')],'resourceId':_0x4a9cee['id'],'type':_0x5c1e1f[_0x888a('0x31')],'sectionId':_0x5c1e1f['id']},{})['then'](function(){return _0x5d45f3;});}else{return _0x5d45f3;}})[_0x888a('0x4f')](function(_0xfaf420){logger[_0x888a('0x2f')](_0x888a('0x5e'),_0xfaf420);throw _0xfaf420;});}return _0x5d45f3;});}})[_0x888a('0x2b')](respondWithResult(_0x3b62af,0xc9))['catch'](handleError(_0x3b62af,null));};exports[_0x888a('0x2a')]=function(_0x49e2bd,_0x3703d0){if(_0x49e2bd[_0x888a('0x5a')]['id']){delete _0x49e2bd[_0x888a('0x5a')]['id'];}return db[_0x888a('0x4c')][_0x888a('0x51')]({'where':{'id':_0x49e2bd[_0x888a('0x50')]['id']}})['then'](handleEntityNotFound(_0x3703d0,null))['then'](saveUpdates(_0x49e2bd['body'],null))[_0x888a('0x2b')](respondWithResult(_0x3703d0,null))['catch'](handleError(_0x3703d0,null));};exports[_0x888a('0x2c')]=function(_0x4a3544,_0xfa22c8){return db['Dashboard'][_0x888a('0x51')]({'where':{'id':_0x4a3544[_0x888a('0x50')]['id']}})[_0x888a('0x2b')](handleEntityNotFound(_0xfa22c8,null))[_0x888a('0x2b')](removeEntity(_0xfa22c8,null))[_0x888a('0x4f')](handleError(_0xfa22c8,null));};function widgetAttributes(_0x4a4920){try{switch(_0x4a4920[_0x888a('0x36')]){case'iframe':return[{'name':_0x888a('0x5f'),'value':_0x4a4920[_0x888a('0x5f')]||(_0x4a4920['attrs']&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0][_0x888a('0x61')]:undefined)||'https://'}];case _0x888a('0x62'):return[{'name':'attrPath','value':_0x4a4920[_0x888a('0x63')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0][_0x888a('0x61')]:undefined)||''}];case _0x888a('0x64'):return[{'name':'attrHourFormat','value':_0x4a4920[_0x888a('0x65')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0]['value']:undefined)||_0x888a('0x66')},{'name':_0x888a('0x67'),'value':_0x4a4920[_0x888a('0x67')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x1]?_0x4a4920[_0x888a('0x60')][0x1][_0x888a('0x61')]:undefined)||_0x888a('0x68')},{'name':_0x888a('0x69'),'value':_0x4a4920[_0x888a('0x69')]||(_0x4a4920['attrs']&&_0x4a4920[_0x888a('0x60')][0x2]?_0x4a4920[_0x888a('0x60')][0x2][_0x888a('0x61')]:undefined)||0xc}];case _0x888a('0x6a'):return[{'name':'attrMetric','value':_0x4a4920[_0x888a('0x6b')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0]['value']:undefined)||_0x888a('0x6c')},{'name':_0x888a('0x6d'),'value':_0x4a4920['attrVoiceQueues']||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x1]?_0x4a4920[_0x888a('0x60')][0x1]['value']:undefined)||[]},{'name':_0x888a('0x69'),'value':_0x4a4920[_0x888a('0x69')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x2]?_0x4a4920[_0x888a('0x60')][0x2][_0x888a('0x61')]:undefined)||0x14},{'name':_0x888a('0x6e'),'value':_0x4a4920[_0x888a('0x6e')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x3]?_0x4a4920[_0x888a('0x60')][0x3]['value']:undefined)||_0x888a('0x6f')},{'name':_0x888a('0x70'),'value':_0x4a4920[_0x888a('0x70')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x4]?_0x4a4920[_0x888a('0x60')][0x4][_0x888a('0x61')]:undefined)||''},{'name':_0x888a('0x71'),'value':_0x4a4920[_0x888a('0x71')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x5]?_0x4a4920[_0x888a('0x60')][0x5]['value']:undefined)||''},{'name':_0x888a('0x72'),'value':_0x4a4920[_0x888a('0x72')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x6]?_0x4a4920[_0x888a('0x60')][0x6]['value']:undefined)||''},{'name':_0x888a('0x73'),'value':_0x4a4920[_0x888a('0x73')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x7]?_0x4a4920[_0x888a('0x60')][0x7][_0x888a('0x61')]:undefined)||''},{'name':_0x888a('0x74'),'value':_0x4a4920[_0x888a('0x74')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x8]?_0x4a4920[_0x888a('0x60')][0x8][_0x888a('0x61')]:undefined)||''},{'name':_0x888a('0x75'),'value':_0x4a4920[_0x888a('0x75')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x9]?_0x4a4920['attrs'][0x9][_0x888a('0x61')]:undefined)||''}];case _0x888a('0x76'):case _0x888a('0x77'):return[{'name':_0x888a('0x78'),'value':_0x4a4920[_0x888a('0x78')]||(_0x4a4920['attrs']&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920['attrs'][0x0][_0x888a('0x61')]:undefined)||_0x888a('0x6c')},{'name':_0x888a('0x79'),'value':_0x4a4920['attrSerie2']||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x1]?_0x4a4920[_0x888a('0x60')][0x1][_0x888a('0x61')]:undefined)||null},{'name':_0x888a('0x7a'),'value':_0x4a4920[_0x888a('0x7a')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x2]?_0x4a4920[_0x888a('0x60')][0x2]['value']:undefined)||null},{'name':_0x888a('0x6d'),'value':_0x4a4920[_0x888a('0x6d')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x3]?_0x4a4920[_0x888a('0x60')][0x3][_0x888a('0x61')]:undefined)||[]},{'name':_0x888a('0x6e'),'value':_0x4a4920['attrChannel']||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x4]?_0x4a4920[_0x888a('0x60')][0x4]['value']:undefined)||_0x888a('0x6f')},{'name':_0x888a('0x70'),'value':_0x4a4920[_0x888a('0x70')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x5]?_0x4a4920[_0x888a('0x60')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4a4920[_0x888a('0x71')]||(_0x4a4920['attrs']&&_0x4a4920[_0x888a('0x60')][0x6]?_0x4a4920[_0x888a('0x60')][0x6][_0x888a('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4a4920[_0x888a('0x72')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x7]?_0x4a4920[_0x888a('0x60')][0x7][_0x888a('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4a4920[_0x888a('0x73')]||(_0x4a4920['attrs']&&_0x4a4920['attrs'][0x8]?_0x4a4920[_0x888a('0x60')][0x8][_0x888a('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4a4920['attrWhatsappAccounts']||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x9]?_0x4a4920['attrs'][0x9]['value']:undefined)||''},{'name':_0x888a('0x75'),'value':_0x4a4920[_0x888a('0x75')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0xa]?_0x4a4920[_0x888a('0x60')][0xa][_0x888a('0x61')]:undefined)||''}];case _0x888a('0x7b'):return[{'name':_0x888a('0x7c'),'type':_0x4a4920[_0x888a('0x7d')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0][_0x888a('0x36')]:undefined)||null,'value':_0x4a4920[_0x888a('0x7c')]||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920[_0x888a('0x60')][0x0]?_0x4a4920[_0x888a('0x60')][0x0][_0x888a('0x61')]:undefined)||null},{'name':_0x888a('0x7e'),'value':_0x4a4920['attrRefresh']||(_0x4a4920[_0x888a('0x60')]&&_0x4a4920['attrs'][0x1]?_0x4a4920[_0x888a('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5adffb){logger['error'](_0x888a('0x7f'),JSON['stringify'](_0x5adffb));return[];}}exports[_0x888a('0x80')]=function(_0x8f4f0d,_0x700fd6,_0x9e7c8b){if(_0x8f4f0d[_0x888a('0x5a')]['id']){delete _0x8f4f0d[_0x888a('0x5a')]['id'];}return db[_0x888a('0x4c')][_0x888a('0x51')]({'where':{'id':_0x8f4f0d[_0x888a('0x50')]['id']}})[_0x888a('0x2b')](handleEntityNotFound(_0x700fd6,null))[_0x888a('0x2b')](function(_0x41e8b3){if(_0x41e8b3){_0x8f4f0d['body'][_0x888a('0x81')]=_0x41e8b3['id'];_0x8f4f0d['body'][_0x888a('0x60')]=widgetAttributes(_0x8f4f0d[_0x888a('0x5a')]);return db[_0x888a('0x82')][_0x888a('0x52')](_0x8f4f0d[_0x888a('0x5a')]);}})['then'](respondWithResult(_0x700fd6,null))[_0x888a('0x4f')](handleError(_0x700fd6,null));};exports[_0x888a('0x83')]=function(_0x435f4d,_0x3f8d5c,_0x4bc6aa){var _0x50e02e={};var _0x51512d={};var _0x161793;var _0x341883;return db['Dashboard'][_0x888a('0x84')]({'where':{'id':_0x435f4d[_0x888a('0x50')]['id']}})[_0x888a('0x2b')](handleEntityNotFound(_0x3f8d5c,null))[_0x888a('0x2b')](function(_0x55f42f){if(_0x55f42f){_0x161793=_0x55f42f;_0x51512d['model']=_[_0x888a('0x38')](db[_0x888a('0x82')][_0x888a('0x34')]);_0x51512d['query']=_[_0x888a('0x38')](_0x435f4d[_0x888a('0x3a')]);_0x51512d[_0x888a('0x43')]=_[_0x888a('0x39')](_0x51512d[_0x888a('0x37')],_0x51512d[_0x888a('0x3a')]);_0x50e02e[_0x888a('0x3b')]=_[_0x888a('0x39')](_0x51512d['model'],qs[_0x888a('0x3c')](_0x435f4d[_0x888a('0x3a')][_0x888a('0x3c')]));_0x50e02e['attributes']=_0x50e02e[_0x888a('0x3b')][_0x888a('0x3d')]?_0x50e02e[_0x888a('0x3b')]:_0x51512d['model'];_0x50e02e[_0x888a('0x40')]=qs[_0x888a('0x41')](_0x435f4d[_0x888a('0x3a')]['sort']);_0x50e02e['where']=qs['filters'](_[_0x888a('0x44')](_0x435f4d[_0x888a('0x3a')],_0x51512d['filters']));if(_0x435f4d[_0x888a('0x3a')][_0x888a('0x45')]){_0x50e02e[_0x888a('0x42')]=_[_0x888a('0x46')](_0x50e02e[_0x888a('0x42')],{'$or':_['map'](_0x50e02e[_0x888a('0x3b')],function(_0x2d58b7){var _0x33a428={};_0x33a428[_0x2d58b7]={'$like':'%'+_0x435f4d[_0x888a('0x3a')][_0x888a('0x45')]+'%'};return _0x33a428;})});}_0x50e02e=_[_0x888a('0x46')]({},_0x50e02e,_0x435f4d[_0x888a('0x49')]);return _0x161793[_0x888a('0x83')](_0x50e02e);}})[_0x888a('0x2b')](function(_0x3af9e6){if(_0x3af9e6){_0x341883=_0x3af9e6['length'];if(!_0x435f4d[_0x888a('0x3a')]['hasOwnProperty'](_0x888a('0x3f'))){_0x50e02e['limit']=qs['limit'](_0x435f4d[_0x888a('0x3a')]['limit']);_0x50e02e[_0x888a('0x22')]=qs[_0x888a('0x22')](_0x435f4d[_0x888a('0x3a')]['offset']);}return _0x161793[_0x888a('0x83')](_0x50e02e);}})['then'](function(_0x538693){if(_0x538693){return _0x538693?{'count':_0x341883,'rows':_0x538693}:null;}})[_0x888a('0x2b')](respondWithResult(_0x3f8d5c,null))['catch'](handleError(_0x3f8d5c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4a9c4d2..a2b11d2 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 _0x4330=['emit','hasOwnProperty','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x4330,0x13d));var _0x0433=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4330[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require(_0x0433('0x0'));var Dashboard=require(_0x0433('0x1'))['db'][_0x0433('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0433('0x3')](0x0);var events={'afterCreate':_0x0433('0x4'),'afterUpdate':_0x0433('0x5'),'afterDestroy':_0x0433('0x6')};function emitEvent(_0xe87232){return function(_0xab47ec,_0x4d8b78,_0x19e58b){DashboardEvents[_0x0433('0x7')](_0xe87232+':'+_0xab47ec['id'],_0xab47ec);DashboardEvents[_0x0433('0x7')](_0xe87232,_0xab47ec);_0x19e58b(null);};}for(var e in events){if(events[_0x0433('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xcac3=['hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x174c2d,_0x20271f){var _0x4080e1=function(_0xf175c1){while(--_0xf175c1){_0x174c2d['push'](_0x174c2d['shift']());}};_0x4080e1(++_0x20271f);}(_0xcac3,0x193));var _0x3cac=function(_0x4230f4,_0x38625b){_0x4230f4=_0x4230f4-0x0;var _0x4a12ac=_0xcac3[_0x4230f4];return _0x4a12ac;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3cac('0x2')](0x0);var events={'afterCreate':_0x3cac('0x3'),'afterUpdate':_0x3cac('0x4'),'afterDestroy':_0x3cac('0x5')};function emitEvent(_0x40033c){return function(_0xce6bcd,_0x2d7790,_0x346c24){DashboardEvents[_0x3cac('0x6')](_0x40033c+':'+_0xce6bcd['id'],_0xce6bcd);DashboardEvents[_0x3cac('0x6')](_0x40033c,_0xce6bcd);_0x346c24(null);};}for(var e in events){if(events[_0x3cac('0x7')](e)){var event=events[e];Dashboard[_0x3cac('0x8')](e,emitEvent(event));}}module[_0x3cac('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index bcc8a5d..07fe880 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 _0xa3b7=['Dashboard','dashboards','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define'];(function(_0x31e67d,_0x507467){var _0xfc0ae5=function(_0x529d88){while(--_0x529d88){_0x31e67d['push'](_0x31e67d['shift']());}};_0xfc0ae5(++_0x507467);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0xa3b7[_0x29f80e];return _0x5c7eaa;};'use strict';var _=require(_0x7a3b('0x0'));var util=require('util');var logger=require(_0x7a3b('0x1'))('api');var moment=require(_0x7a3b('0x2'));var BPromise=require(_0x7a3b('0x3'));var rp=require(_0x7a3b('0x4'));var fs=require('fs');var path=require(_0x7a3b('0x5'));var rimraf=require(_0x7a3b('0x6'));var config=require(_0x7a3b('0x7'));var attributes=require(_0x7a3b('0x8'));module['exports']=function(_0x3343bb,_0x27dc3d){return _0x3343bb[_0x7a3b('0x9')](_0x7a3b('0xa'),attributes,{'tableName':_0x7a3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x128d=['./dashboard.attributes','define','dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x68c5b2,_0x3e923c){var _0x58fd07=function(_0x562da1){while(--_0x562da1){_0x68c5b2['push'](_0x68c5b2['shift']());}};_0x58fd07(++_0x3e923c);}(_0x128d,0x179));var _0xd128=function(_0x1f0642,_0xee8ed6){_0x1f0642=_0x1f0642-0x0;var _0x171d07=_0x128d[_0x1f0642];return _0x171d07;};'use strict';var _=require(_0xd128('0x0'));var util=require(_0xd128('0x1'));var logger=require(_0xd128('0x2'))(_0xd128('0x3'));var moment=require(_0xd128('0x4'));var BPromise=require(_0xd128('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd128('0x6'));var rimraf=require('rimraf');var config=require(_0xd128('0x7'));var attributes=require(_0xd128('0x8'));module['exports']=function(_0x327360,_0x6f2cd6){return _0x327360[_0xd128('0x9')]('Dashboard',attributes,{'tableName':_0xd128('0xa'),'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 7eff641..28604b8 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 _0xe443=['request','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','Dashboard,\x20%s,\x20%s','error','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register'];(function(_0x5f56de,_0x5c1006){var _0xa7eee0=function(_0x47c014){while(--_0x47c014){_0x5f56de['push'](_0x5f56de['shift']());}};_0xa7eee0(++_0x5c1006);}(_0xe443,0x134));var _0x3e44=function(_0xe5646c,_0x31907e){_0xe5646c=_0xe5646c-0x0;var _0x331991=_0xe443[_0xe5646c];return _0x331991;};'use strict';var _=require('lodash');var util=require(_0x3e44('0x0'));var moment=require(_0x3e44('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e44('0x2'));var db=require(_0x3e44('0x3'))['db'];var utils=require(_0x3e44('0x4'));var logger=require(_0x3e44('0x5'))(_0x3e44('0x6'));var config=require(_0x3e44('0x7'));var jayson=require(_0x3e44('0x8'));var client=jayson[_0x3e44('0x9')][_0x3e44('0xa')]({'port':0x232a});config[_0x3e44('0xb')]=_[_0x3e44('0xc')](config[_0x3e44('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e44('0xd'))(new Redis(config[_0x3e44('0xb')]));require(_0x3e44('0xe'))[_0x3e44('0xf')](socket);function respondWithRpcPromise(_0x70b14a,_0x347497,_0x1bfe90){return new BPromise(function(_0x353aad,_0x170d21){return client[_0x3e44('0x10')](_0x70b14a,_0x1bfe90)['then'](function(_0x205f54){logger['info']('Dashboard,\x20%s,\x20%s',_0x347497,_0x3e44('0x11'));logger[_0x3e44('0x12')](_0x3e44('0x13'),_0x347497,'request\x20sent',JSON[_0x3e44('0x14')](_0x205f54));if(_0x205f54['error']){if(_0x205f54['error']['code']===0x1f4){logger['error'](_0x3e44('0x15'),_0x347497,_0x205f54[_0x3e44('0x16')][_0x3e44('0x17')]);return _0x170d21(_0x205f54[_0x3e44('0x16')][_0x3e44('0x17')]);}logger[_0x3e44('0x16')]('Dashboard,\x20%s,\x20%s',_0x347497,_0x205f54[_0x3e44('0x16')][_0x3e44('0x17')]);return _0x353aad(_0x205f54[_0x3e44('0x16')][_0x3e44('0x17')]);}else{logger[_0x3e44('0x18')](_0x3e44('0x15'),_0x347497,'request\x20sent');_0x353aad(_0x205f54[_0x3e44('0x19')]['message']);}})[_0x3e44('0x1a')](function(_0x511109){logger[_0x3e44('0x16')](_0x3e44('0x15'),_0x347497,_0x511109);_0x170d21(_0x511109);});});} \ No newline at end of file +var _0x9c36=['http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2da9db,_0x16a3e4){var _0x306a99=function(_0x73f36f){while(--_0x73f36f){_0x2da9db['push'](_0x2da9db['shift']());}};_0x306a99(++_0x16a3e4);}(_0x9c36,0x163));var _0x69c3=function(_0x49937a,_0x4c6b72){_0x49937a=_0x49937a-0x0;var _0x3d040b=_0x9c36[_0x49937a];return _0x3d040b;};'use strict';var _=require(_0x69c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69c3('0x1'));var rs=require(_0x69c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69c3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x69c3('0x4'))(_0x69c3('0x5'));var config=require(_0x69c3('0x6'));var jayson=require(_0x69c3('0x7'));var client=jayson[_0x69c3('0x8')][_0x69c3('0x9')]({'port':0x232a});config[_0x69c3('0xa')]=_[_0x69c3('0xb')](config[_0x69c3('0xa')],{'host':_0x69c3('0xc'),'port':0x18eb});var socket=require(_0x69c3('0xd'))(new Redis(config[_0x69c3('0xa')]));require(_0x69c3('0xe'))[_0x69c3('0xf')](socket);function respondWithRpcPromise(_0x4d4638,_0x4cbd55,_0x57390f){return new BPromise(function(_0x51d27b,_0x47d038){return client[_0x69c3('0x10')](_0x4d4638,_0x57390f)[_0x69c3('0x11')](function(_0x3a3b99){logger[_0x69c3('0x12')]('Dashboard,\x20%s,\x20%s',_0x4cbd55,_0x69c3('0x13'));logger[_0x69c3('0x14')](_0x69c3('0x15'),_0x4cbd55,_0x69c3('0x13'),JSON[_0x69c3('0x16')](_0x3a3b99));if(_0x3a3b99[_0x69c3('0x17')]){if(_0x3a3b99[_0x69c3('0x17')][_0x69c3('0x18')]===0x1f4){logger['error'](_0x69c3('0x19'),_0x4cbd55,_0x3a3b99[_0x69c3('0x17')][_0x69c3('0x1a')]);return _0x47d038(_0x3a3b99[_0x69c3('0x17')]['message']);}logger[_0x69c3('0x17')](_0x69c3('0x19'),_0x4cbd55,_0x3a3b99['error'][_0x69c3('0x1a')]);return _0x51d27b(_0x3a3b99[_0x69c3('0x17')][_0x69c3('0x1a')]);}else{logger[_0x69c3('0x12')]('Dashboard,\x20%s,\x20%s',_0x4cbd55,_0x69c3('0x13'));_0x51d27b(_0x3a3b99[_0x69c3('0x1b')][_0x69c3('0x1a')]);}})['catch'](function(_0x20b5c3){logger[_0x69c3('0x17')]('Dashboard,\x20%s,\x20%s',_0x4cbd55,_0x20b5c3);_0x47d038(_0x20b5c3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 60ac2f4..5c16776 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 _0x449a=['removeListener','register','./dashboard.events','remove','update','emit'];(function(_0x48d1ab,_0x447e58){var _0x45d3aa=function(_0x52ecf2){while(--_0x52ecf2){_0x48d1ab['push'](_0x48d1ab['shift']());}};_0x45d3aa(++_0x447e58);}(_0x449a,0x1d0));var _0xa449=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x449a[_0x5f0089];return _0x193892;};'use strict';var DashboardEvents=require(_0xa449('0x0'));var events=['save',_0xa449('0x1'),_0xa449('0x2')];function createListener(_0x72c9c2,_0x50a286){return function(_0x54212b){_0x50a286[_0xa449('0x3')](_0x72c9c2,_0x54212b);};}function removeListener(_0x59793b,_0x4a1ead){return function(){DashboardEvents[_0xa449('0x4')](_0x59793b,_0x4a1ead);};}exports[_0xa449('0x5')]=function(_0x461c61){for(var _0x482ca9=0x0,_0x5a92b6=events['length'];_0x482ca9<_0x5a92b6;_0x482ca9++){var _0x55e222=events[_0x482ca9];var _0x3e084f=createListener('dashboard:'+_0x55e222,_0x461c61);DashboardEvents['on'](_0x55e222,_0x3e084f);}}; \ No newline at end of file +var _0x871a=['update','emit','removeListener','length','dashboard:','./dashboard.events','save','remove'];(function(_0x20629d,_0x1a6757){var _0x4ca950=function(_0x2c806c){while(--_0x2c806c){_0x20629d['push'](_0x20629d['shift']());}};_0x4ca950(++_0x1a6757);}(_0x871a,0x1e5));var _0xa871=function(_0x12da6c,_0x23ee55){_0x12da6c=_0x12da6c-0x0;var _0x3ef7b3=_0x871a[_0x12da6c];return _0x3ef7b3;};'use strict';var DashboardEvents=require(_0xa871('0x0'));var events=[_0xa871('0x1'),_0xa871('0x2'),_0xa871('0x3')];function createListener(_0x31ec6a,_0x1b386f){return function(_0x51509e){_0x1b386f[_0xa871('0x4')](_0x31ec6a,_0x51509e);};}function removeListener(_0x212a99,_0x1a7e01){return function(){DashboardEvents[_0xa871('0x5')](_0x212a99,_0x1a7e01);};}exports['register']=function(_0x164416){for(var _0x1b3979=0x0,_0x5685fd=events[_0xa871('0x6')];_0x1b3979<_0x5685fd;_0x1b3979++){var _0x940c6e=events[_0x1b3979];var _0x4a591b=createListener(_0xa871('0x7')+_0x940c6e,_0x164416);DashboardEvents['on'](_0x940c6e,_0x4a591b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index aa65f54..91e7d37 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 _0xb47b=['isAuthenticated','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2972cf,_0x343fde){var _0x4c173f=function(_0x30eb3a){while(--_0x30eb3a){_0x2972cf['push'](_0x2972cf['shift']());}};_0x4c173f(++_0x343fde);}(_0xb47b,0x19a));var _0xbb47=function(_0x3d3167,_0x2b50da){_0x3d3167=_0x3d3167-0x0;var _0x4a000e=_0xb47b[_0x3d3167];return _0x4a000e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbb47('0x0'));var timeout=require('connect-timeout');var express=require(_0xbb47('0x1'));var router=express[_0xbb47('0x2')]();var fs_extra=require(_0xbb47('0x3'));var auth=require(_0xbb47('0x4'));var interaction=require(_0xbb47('0x5'));var config=require(_0xbb47('0x6'));var controller=require('./dashboard.controller');router[_0xbb47('0x7')]('/',auth[_0xbb47('0x8')](),controller['index']);router[_0xbb47('0x7')](_0xbb47('0x9'),auth[_0xbb47('0x8')](),controller[_0xbb47('0xa')]);router['get'](_0xbb47('0xb'),auth[_0xbb47('0x8')](),controller[_0xbb47('0xc')]);router['post']('/',auth[_0xbb47('0x8')](),controller[_0xbb47('0xd')]);router[_0xbb47('0xe')](_0xbb47('0xf'),auth['isAuthenticated'](),controller[_0xbb47('0x10')]);router[_0xbb47('0xe')](_0xbb47('0xb'),auth[_0xbb47('0x8')](),controller[_0xbb47('0x11')]);router[_0xbb47('0x12')]('/:id',auth[_0xbb47('0x8')](),controller[_0xbb47('0x13')]);router[_0xbb47('0x14')](_0xbb47('0x9'),auth['isAuthenticated'](),controller[_0xbb47('0x15')]);module['exports']=router; \ No newline at end of file +var _0x900a=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','post','/:id/clone','addItem','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3987bf,_0x597b0f){var _0x2a05f0=function(_0x5253bb){while(--_0x5253bb){_0x3987bf['push'](_0x3987bf['shift']());}};_0x2a05f0(++_0x597b0f);}(_0x900a,0x151));var _0xa900=function(_0xa6604c,_0x198151){_0xa6604c=_0xa6604c-0x0;var _0x2bb2a1=_0x900a[_0xa6604c];return _0x2bb2a1;};'use strict';var multer=require(_0xa900('0x0'));var util=require(_0xa900('0x1'));var path=require(_0xa900('0x2'));var timeout=require(_0xa900('0x3'));var express=require(_0xa900('0x4'));var router=express[_0xa900('0x5')]();var fs_extra=require(_0xa900('0x6'));var auth=require(_0xa900('0x7'));var interaction=require(_0xa900('0x8'));var config=require(_0xa900('0x9'));var controller=require(_0xa900('0xa'));router[_0xa900('0xb')]('/',auth[_0xa900('0xc')](),controller[_0xa900('0xd')]);router[_0xa900('0xb')](_0xa900('0xe'),auth[_0xa900('0xc')](),controller['show']);router['get']('/:id/items',auth[_0xa900('0xc')](),controller[_0xa900('0xf')]);router[_0xa900('0x10')]('/',auth[_0xa900('0xc')](),controller['create']);router[_0xa900('0x10')](_0xa900('0x11'),auth[_0xa900('0xc')](),controller['clone']);router[_0xa900('0x10')]('/:id/items',auth[_0xa900('0xc')](),controller[_0xa900('0x12')]);router[_0xa900('0x13')](_0xa900('0xe'),auth[_0xa900('0xc')](),controller[_0xa900('0x14')]);router['delete'](_0xa900('0xe'),auth['isAuthenticated'](),controller[_0xa900('0x15')]);module[_0xa900('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index cc0efb3..a0763a0 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 _0x0295=['#ffffff','sequelize','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','STRING'];(function(_0xb5fc3e,_0x234703){var _0x2efc3c=function(_0x4e4e44){while(--_0x4e4e44){_0xb5fc3e['push'](_0xb5fc3e['shift']());}};_0x2efc3c(++_0x234703);}(_0x0295,0x1f0));var _0x5029=function(_0x2a4fa4,_0x20ff6c){_0x2a4fa4=_0x2a4fa4-0x0;var _0x20104a=_0x0295[_0x2a4fa4];return _0x20104a;};'use strict';var Sequelize=require(_0x5029('0x0'));var squel=require('squel');var _=require('lodash');module[_0x5029('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5029('0x2')](_0x5029('0x3')),'get':function(){try{return JSON[_0x5029('0x4')](this[_0x5029('0x5')](_0x5029('0x6')));}catch(_0x69a497){return[];}},'set':function(_0x200217){try{this[_0x5029('0x7')](_0x5029('0x6'),JSON['stringify'](_0x200217));}catch(_0x54978f){this['setDataValue'](_0x5029('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5029('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5029('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':_0x5029('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5029('0x9')]},'titleFontSize':{'type':Sequelize[_0x5029('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xfdbd[_0xf1af27];return _0x46b274;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 703bf21..9b3105c 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 _0x9120=['attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find','catch','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues'];(function(_0x384f7a,_0x2e140d){var _0x457073=function(_0x22c1d2){while(--_0x22c1d2){_0x384f7a['push'](_0x384f7a['shift']());}};_0x457073(++_0x2e140d);}(_0x9120,0x1b3));var _0x0912=function(_0x1a023e,_0x44e5ac){_0x1a023e=_0x1a023e-0x0;var _0x5c0e66=_0x9120[_0x1a023e];return _0x5c0e66;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];config[_0x0912('0x19')]=_[_0x0912('0x1a')](config[_0x0912('0x19')],{'host':_0x0912('0x1b'),'port':0x18eb});var socket=require(_0x0912('0x1c'))(new Redis(config[_0x0912('0x19')]));require(_0x0912('0x1d'))[_0x0912('0x1e')](socket);function respondWithStatusCode(_0x350d6b,_0x16bbae){_0x16bbae=_0x16bbae||0xcc;return function(_0x187508){if(_0x187508){return _0x350d6b[_0x0912('0x1f')](_0x16bbae);}return _0x350d6b['status'](_0x16bbae)['end']();};}function respondWithResult(_0x1ed3e8,_0x5acf62){_0x5acf62=_0x5acf62||0xc8;return function(_0x297fc6){if(_0x297fc6){return _0x1ed3e8['status'](_0x5acf62)[_0x0912('0x20')](_0x297fc6);}};}function respondWithFilteredResult(_0x49b581,_0x2052c9){return function(_0x5eace1){if(_0x5eace1){var _0x22befd=typeof _0x2052c9['offset']===_0x0912('0x21')&&typeof _0x2052c9['limit']==='undefined';var _0x3377af=_0x5eace1['count'];var _0x2ddcb7=_0x22befd?0x0:_0x2052c9[_0x0912('0x22')];var _0x4b1e07=_0x22befd?_0x5eace1[_0x0912('0x23')]:_0x2052c9[_0x0912('0x22')]+_0x2052c9[_0x0912('0x24')];var _0x5927d2;if(_0x4b1e07>=_0x3377af){_0x4b1e07=_0x3377af;_0x5927d2=0xc8;}else{_0x5927d2=0xce;}_0x49b581['status'](_0x5927d2);return _0x49b581[_0x0912('0x25')](_0x0912('0x26'),_0x2ddcb7+'-'+_0x4b1e07+'/'+_0x3377af)[_0x0912('0x20')](_0x5eace1);}return null;};}function patchUpdates(_0x30b7cc){return function(_0x191bfc){try{jsonpatch[_0x0912('0x27')](_0x191bfc,_0x30b7cc,!![]);}catch(_0x6c4902){return BPromise[_0x0912('0x28')](_0x6c4902);}return _0x191bfc[_0x0912('0x29')]();};}function saveUpdates(_0x572d12,_0xedaac4){return function(_0x384bae){if(_0x384bae){return _0x384bae[_0x0912('0x2a')](_0x572d12)['then'](function(_0x4a938e){return _0x4a938e;});}return null;};}function removeEntity(_0x21d65b,_0x53d673){return function(_0x49b441){if(_0x49b441){return _0x49b441[_0x0912('0x2b')]()[_0x0912('0x2c')](function(){_0x21d65b['status'](0xcc)[_0x0912('0x2d')]();});}};}function handleEntityNotFound(_0x305831,_0x1cdece){return function(_0x2c8e48){if(!_0x2c8e48){_0x305831[_0x0912('0x1f')](0x194);}return _0x2c8e48;};}function handleError(_0x4f46b4,_0x1e20db){_0x1e20db=_0x1e20db||0x1f4;return function(_0x1d6c87){logger['error'](_0x1d6c87[_0x0912('0x2e')]);if(_0x1d6c87[_0x0912('0x2f')]){delete _0x1d6c87[_0x0912('0x2f')];}_0x4f46b4['status'](_0x1e20db)[_0x0912('0x30')](_0x1d6c87);};}exports[_0x0912('0x31')]=function(_0x54d2f3,_0x176529){var _0x5a30d8={'raw':![],'where':{'id':_0x54d2f3[_0x0912('0x32')]['id']}},_0x448fa3={};_0x448fa3[_0x0912('0x33')]=_[_0x0912('0x34')](db[_0x0912('0x35')][_0x0912('0x36')]);_0x448fa3['query']=_['keys'](_0x54d2f3[_0x0912('0x37')]);_0x448fa3[_0x0912('0x38')]=_['intersection'](_0x448fa3['model'],_0x448fa3[_0x0912('0x37')]);_0x5a30d8[_0x0912('0x39')]=_[_0x0912('0x3a')](_0x448fa3[_0x0912('0x33')],qs[_0x0912('0x3b')](_0x54d2f3[_0x0912('0x37')][_0x0912('0x3b')]));_0x5a30d8[_0x0912('0x39')]=_0x5a30d8['attributes']['length']?_0x5a30d8[_0x0912('0x39')]:_0x448fa3[_0x0912('0x33')];if(_0x54d2f3['query'][_0x0912('0x3c')]){_0x5a30d8[_0x0912('0x3d')]=[{'all':!![]}];}_0x5a30d8=_[_0x0912('0x3e')]({},_0x5a30d8,_0x54d2f3[_0x0912('0x3f')]);return db[_0x0912('0x35')][_0x0912('0x40')](_0x5a30d8)[_0x0912('0x2c')](handleEntityNotFound(_0x176529,null))[_0x0912('0x2c')](respondWithResult(_0x176529,null))[_0x0912('0x41')](handleError(_0x176529,null));};exports['destroy']=function(_0x5c2984,_0x3cdce3){return db[_0x0912('0x35')][_0x0912('0x40')]({'where':{'id':_0x5c2984[_0x0912('0x32')]['id']}})[_0x0912('0x2c')](handleEntityNotFound(_0x3cdce3,null))[_0x0912('0x2c')](removeEntity(_0x3cdce3,null))['catch'](handleError(_0x3cdce3,null));};function widgetAttributes(_0x1d9be2){try{switch(_0x1d9be2['type']){case'iframe':return[{'name':'attrUrl','value':_0x1d9be2[_0x0912('0x42')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||_0x0912('0x45')}];case'custom':return[{'name':_0x0912('0x46'),'value':_0x1d9be2[_0x0912('0x46')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||''}];case _0x0912('0x47'):return[{'name':_0x0912('0x48'),'value':_0x1d9be2[_0x0912('0x48')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||_0x0912('0x49')},{'name':'attrTimezone','value':_0x1d9be2[_0x0912('0x4a')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x1]?_0x1d9be2['attrs'][0x1][_0x0912('0x44')]:undefined)||_0x0912('0x4b')},{'name':_0x0912('0x4c'),'value':_0x1d9be2[_0x0912('0x4c')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x2]?_0x1d9be2[_0x0912('0x43')][0x2][_0x0912('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0x0912('0x4d'),'value':_0x1d9be2['attrMetric']||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||_0x0912('0x4e')},{'name':_0x0912('0x4f'),'value':_0x1d9be2[_0x0912('0x4f')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x1]?_0x1d9be2[_0x0912('0x43')][0x1][_0x0912('0x44')]:undefined)||[]},{'name':_0x0912('0x4c'),'value':_0x1d9be2['attrFontSize']||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x2]?_0x1d9be2[_0x0912('0x43')][0x2][_0x0912('0x44')]:undefined)||0x14},{'name':_0x0912('0x50'),'value':_0x1d9be2[_0x0912('0x50')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x3]?_0x1d9be2[_0x0912('0x43')][0x3][_0x0912('0x44')]:undefined)||_0x0912('0x51')},{'name':_0x0912('0x52'),'value':_0x1d9be2[_0x0912('0x52')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x4]?_0x1d9be2[_0x0912('0x43')][0x4][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x53'),'value':_0x1d9be2[_0x0912('0x53')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x5]?_0x1d9be2[_0x0912('0x43')][0x5][_0x0912('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1d9be2[_0x0912('0x54')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x6]?_0x1d9be2[_0x0912('0x43')][0x6][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x55'),'value':_0x1d9be2[_0x0912('0x55')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x7]?_0x1d9be2['attrs'][0x7][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x56'),'value':_0x1d9be2[_0x0912('0x56')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0x8]?_0x1d9be2[_0x0912('0x43')][0x8][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x57'),'value':_0x1d9be2[_0x0912('0x57')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x9]?_0x1d9be2[_0x0912('0x43')][0x9]['value']:undefined)||''}];case _0x0912('0x58'):case _0x0912('0x59'):return[{'name':_0x0912('0x5a'),'value':_0x1d9be2[_0x0912('0x5a')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||'total'},{'name':_0x0912('0x5b'),'value':_0x1d9be2[_0x0912('0x5b')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x1]?_0x1d9be2['attrs'][0x1][_0x0912('0x44')]:undefined)||null},{'name':_0x0912('0x5c'),'value':_0x1d9be2['attrSerie3']||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x2]?_0x1d9be2[_0x0912('0x43')][0x2][_0x0912('0x44')]:undefined)||null},{'name':_0x0912('0x4f'),'value':_0x1d9be2[_0x0912('0x4f')]||(_0x1d9be2['attrs']&&_0x1d9be2['attrs'][0x3]?_0x1d9be2[_0x0912('0x43')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1d9be2[_0x0912('0x50')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x4]?_0x1d9be2[_0x0912('0x43')][0x4][_0x0912('0x44')]:undefined)||_0x0912('0x51')},{'name':_0x0912('0x52'),'value':_0x1d9be2[_0x0912('0x52')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0x5]?_0x1d9be2[_0x0912('0x43')][0x5][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x53'),'value':_0x1d9be2[_0x0912('0x53')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0x6]?_0x1d9be2['attrs'][0x6][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x54'),'value':_0x1d9be2[_0x0912('0x54')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x7]?_0x1d9be2[_0x0912('0x43')][0x7][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x55'),'value':_0x1d9be2['attrOpenchannelAccounts']||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x8]?_0x1d9be2[_0x0912('0x43')][0x8][_0x0912('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1d9be2[_0x0912('0x56')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x9]?_0x1d9be2[_0x0912('0x43')][0x9][_0x0912('0x44')]:undefined)||''},{'name':_0x0912('0x57'),'value':_0x1d9be2[_0x0912('0x57')]||(_0x1d9be2['attrs']&&_0x1d9be2[_0x0912('0x43')][0xa]?_0x1d9be2['attrs'][0xa][_0x0912('0x44')]:undefined)||''}];case _0x0912('0x5d'):return[{'name':_0x0912('0x5e'),'type':_0x1d9be2[_0x0912('0x5f')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2[_0x0912('0x43')][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x60')]:undefined)||null,'value':_0x1d9be2['attrReport']||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x0]?_0x1d9be2[_0x0912('0x43')][0x0][_0x0912('0x44')]:undefined)||null},{'name':_0x0912('0x61'),'value':_0x1d9be2[_0x0912('0x61')]||(_0x1d9be2[_0x0912('0x43')]&&_0x1d9be2['attrs'][0x1]?_0x1d9be2[_0x0912('0x43')][0x1][_0x0912('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x2e893d){logger[_0x0912('0x62')](_0x0912('0x63'),JSON[_0x0912('0x64')](_0x2e893d));return[];}}exports[_0x0912('0x65')]=function(_0x377e54,_0x4ee10e){if(_0x377e54[_0x0912('0x66')]){_0x377e54[_0x0912('0x66')]['attrs']=widgetAttributes(_0x377e54[_0x0912('0x66')]);}return db['DashboardItem'][_0x0912('0x65')](_0x377e54['body'],{})[_0x0912('0x2c')](respondWithResult(_0x4ee10e,0xc9))[_0x0912('0x41')](handleError(_0x4ee10e,null));};exports[_0x0912('0x2a')]=function(_0x27b56d,_0x3965ce){if(_0x27b56d['body']['id']){delete _0x27b56d[_0x0912('0x66')]['id'];}_0x27b56d[_0x0912('0x66')][_0x0912('0x43')]=widgetAttributes(_0x27b56d[_0x0912('0x66')]);return db[_0x0912('0x35')][_0x0912('0x40')]({'where':{'id':_0x27b56d[_0x0912('0x32')]['id']}})[_0x0912('0x2c')](handleEntityNotFound(_0x3965ce,null))[_0x0912('0x2c')](saveUpdates(_0x27b56d['body'],null))[_0x0912('0x2c')](respondWithResult(_0x3965ce,null))[_0x0912('0x41')](handleError(_0x3965ce,null));}; \ No newline at end of file +var _0x5226=['attrSerie1','total','attrSerie3','attrFaxAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','destroy','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart'];(function(_0x1e6eab,_0x216f5b){var _0x5f5517=function(_0x1acf8b){while(--_0x1acf8b){_0x1e6eab['push'](_0x1e6eab['shift']());}};_0x5f5517(++_0x216f5b);}(_0x5226,0x137));var _0x6522=function(_0x5ac407,_0x44a5fe){_0x5ac407=_0x5ac407-0x0;var _0x51d089=_0x5226[_0x5ac407];return _0x51d089;};'use strict';var emlformat=require(_0x6522('0x0'));var rimraf=require(_0x6522('0x1'));var zipdir=require(_0x6522('0x2'));var jsonpatch=require(_0x6522('0x3'));var rp=require(_0x6522('0x4'));var moment=require('moment');var BPromise=require(_0x6522('0x5'));var Mustache=require(_0x6522('0x6'));var util=require(_0x6522('0x7'));var path=require('path');var sox=require(_0x6522('0x8'));var csv=require('to-csv');var ejs=require(_0x6522('0x9'));var fs=require('fs');var fs_extra=require(_0x6522('0xa'));var _=require(_0x6522('0xb'));var squel=require(_0x6522('0xc'));var crypto=require(_0x6522('0xd'));var jsforce=require(_0x6522('0xe'));var deskjs=require(_0x6522('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6522('0x10'));var Redis=require(_0x6522('0x11'));var authService=require(_0x6522('0x12'));var qs=require(_0x6522('0x13'));var as=require(_0x6522('0x14'));var hardwareService=require(_0x6522('0x15'));var logger=require(_0x6522('0x16'))(_0x6522('0x17'));var utils=require(_0x6522('0x18'));var config=require(_0x6522('0x19'));var licenseUtil=require(_0x6522('0x1a'));var db=require(_0x6522('0x1b'))['db'];config[_0x6522('0x1c')]=_['defaults'](config[_0x6522('0x1c')],{'host':_0x6522('0x1d'),'port':0x18eb});var socket=require(_0x6522('0x1e'))(new Redis(config[_0x6522('0x1c')]));require(_0x6522('0x1f'))['register'](socket);function respondWithStatusCode(_0x3c855a,_0x2ab9a0){_0x2ab9a0=_0x2ab9a0||0xcc;return function(_0x26ed67){if(_0x26ed67){return _0x3c855a[_0x6522('0x20')](_0x2ab9a0);}return _0x3c855a[_0x6522('0x21')](_0x2ab9a0)[_0x6522('0x22')]();};}function respondWithResult(_0x31ddff,_0x1e12b7){_0x1e12b7=_0x1e12b7||0xc8;return function(_0x36a557){if(_0x36a557){return _0x31ddff[_0x6522('0x21')](_0x1e12b7)[_0x6522('0x23')](_0x36a557);}};}function respondWithFilteredResult(_0x434a84,_0x51a8e0){return function(_0x6f0909){if(_0x6f0909){var _0x1edcb6=typeof _0x51a8e0[_0x6522('0x24')]===_0x6522('0x25')&&typeof _0x51a8e0['limit']===_0x6522('0x25');var _0x9a5622=_0x6f0909['count'];var _0x38aae6=_0x1edcb6?0x0:_0x51a8e0['offset'];var _0x1bb7df=_0x1edcb6?_0x6f0909[_0x6522('0x26')]:_0x51a8e0[_0x6522('0x24')]+_0x51a8e0[_0x6522('0x27')];var _0x44bd23;if(_0x1bb7df>=_0x9a5622){_0x1bb7df=_0x9a5622;_0x44bd23=0xc8;}else{_0x44bd23=0xce;}_0x434a84[_0x6522('0x21')](_0x44bd23);return _0x434a84['set'](_0x6522('0x28'),_0x38aae6+'-'+_0x1bb7df+'/'+_0x9a5622)[_0x6522('0x23')](_0x6f0909);}return null;};}function patchUpdates(_0x13ec44){return function(_0x14ba8f){try{jsonpatch[_0x6522('0x29')](_0x14ba8f,_0x13ec44,!![]);}catch(_0x16c3cf){return BPromise['reject'](_0x16c3cf);}return _0x14ba8f[_0x6522('0x2a')]();};}function saveUpdates(_0x415f16,_0xcb377c){return function(_0x2c3269){if(_0x2c3269){return _0x2c3269['update'](_0x415f16)['then'](function(_0x263d7d){return _0x263d7d;});}return null;};}function removeEntity(_0x38045b,_0x2c20dc){return function(_0x29b7f4){if(_0x29b7f4){return _0x29b7f4['destroy']()[_0x6522('0x2b')](function(){_0x38045b[_0x6522('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375555,_0x2f6e86){return function(_0x23dc77){if(!_0x23dc77){_0x375555[_0x6522('0x20')](0x194);}return _0x23dc77;};}function handleError(_0x5db9bb,_0x204305){_0x204305=_0x204305||0x1f4;return function(_0x27bbc0){logger[_0x6522('0x2c')](_0x27bbc0[_0x6522('0x2d')]);if(_0x27bbc0[_0x6522('0x2e')]){delete _0x27bbc0[_0x6522('0x2e')];}_0x5db9bb[_0x6522('0x21')](_0x204305)[_0x6522('0x2f')](_0x27bbc0);};}exports[_0x6522('0x30')]=function(_0x2c57f7,_0x9e6606){var _0x2c2e97={'raw':![],'where':{'id':_0x2c57f7[_0x6522('0x31')]['id']}},_0x4c4d29={};_0x4c4d29[_0x6522('0x32')]=_[_0x6522('0x33')](db[_0x6522('0x34')][_0x6522('0x35')]);_0x4c4d29[_0x6522('0x36')]=_['keys'](_0x2c57f7[_0x6522('0x36')]);_0x4c4d29[_0x6522('0x37')]=_[_0x6522('0x38')](_0x4c4d29[_0x6522('0x32')],_0x4c4d29[_0x6522('0x36')]);_0x2c2e97[_0x6522('0x39')]=_[_0x6522('0x38')](_0x4c4d29[_0x6522('0x32')],qs[_0x6522('0x3a')](_0x2c57f7[_0x6522('0x36')][_0x6522('0x3a')]));_0x2c2e97[_0x6522('0x39')]=_0x2c2e97[_0x6522('0x39')]['length']?_0x2c2e97['attributes']:_0x4c4d29['model'];if(_0x2c57f7[_0x6522('0x36')][_0x6522('0x3b')]){_0x2c2e97[_0x6522('0x3c')]=[{'all':!![]}];}_0x2c2e97=_[_0x6522('0x3d')]({},_0x2c2e97,_0x2c57f7[_0x6522('0x3e')]);return db[_0x6522('0x34')]['find'](_0x2c2e97)[_0x6522('0x2b')](handleEntityNotFound(_0x9e6606,null))[_0x6522('0x2b')](respondWithResult(_0x9e6606,null))[_0x6522('0x3f')](handleError(_0x9e6606,null));};exports[_0x6522('0x40')]=function(_0x15d709,_0x4ec7ab){return db['DashboardItem']['find']({'where':{'id':_0x15d709[_0x6522('0x31')]['id']}})[_0x6522('0x2b')](handleEntityNotFound(_0x4ec7ab,null))['then'](removeEntity(_0x4ec7ab,null))['catch'](handleError(_0x4ec7ab,null));};function widgetAttributes(_0xed4641){try{switch(_0xed4641['type']){case'iframe':return[{'name':_0x6522('0x41'),'value':_0xed4641[_0x6522('0x41')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0]['value']:undefined)||_0x6522('0x43')}];case _0x6522('0x44'):return[{'name':_0x6522('0x45'),'value':_0xed4641[_0x6522('0x45')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0xed4641[_0x6522('0x47')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||'HH:mm:ss'},{'name':_0x6522('0x48'),'value':_0xed4641[_0x6522('0x48')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||'0.00'},{'name':_0x6522('0x49'),'value':_0xed4641['attrFontSize']||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||0xc}];case _0x6522('0x4a'):return[{'name':'attrMetric','value':_0xed4641[_0x6522('0x4b')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641['attrs'][0x0][_0x6522('0x46')]:undefined)||'total'},{'name':_0x6522('0x4c'),'value':_0xed4641[_0x6522('0x4c')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||[]},{'name':_0x6522('0x49'),'value':_0xed4641[_0x6522('0x49')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||0x14},{'name':_0x6522('0x4d'),'value':_0xed4641[_0x6522('0x4d')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x3]?_0xed4641[_0x6522('0x42')][0x3][_0x6522('0x46')]:undefined)||_0x6522('0x4e')},{'name':_0x6522('0x4f'),'value':_0xed4641[_0x6522('0x4f')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x4]?_0xed4641[_0x6522('0x42')][0x4][_0x6522('0x46')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xed4641['attrFaxAccounts']||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x5]?_0xed4641['attrs'][0x5][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x50'),'value':_0xed4641['attrSmsAccounts']||(_0xed4641['attrs']&&_0xed4641['attrs'][0x6]?_0xed4641['attrs'][0x6][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x51'),'value':_0xed4641[_0x6522('0x51')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x7]?_0xed4641[_0x6522('0x42')][0x7]['value']:undefined)||''},{'name':_0x6522('0x52'),'value':_0xed4641[_0x6522('0x52')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x8]?_0xed4641[_0x6522('0x42')][0x8][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x53'),'value':_0xed4641[_0x6522('0x53')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x9]?_0xed4641[_0x6522('0x42')][0x9][_0x6522('0x46')]:undefined)||''}];case'multibar-chart':case _0x6522('0x54'):return[{'name':_0x6522('0x55'),'value':_0xed4641[_0x6522('0x55')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0]['value']:undefined)||_0x6522('0x56')},{'name':'attrSerie2','value':_0xed4641['attrSerie2']||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641['attrs'][0x1]['value']:undefined)||null},{'name':_0x6522('0x57'),'value':_0xed4641['attrSerie3']||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x2]?_0xed4641[_0x6522('0x42')][0x2][_0x6522('0x46')]:undefined)||null},{'name':_0x6522('0x4c'),'value':_0xed4641[_0x6522('0x4c')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x3]?_0xed4641['attrs'][0x3][_0x6522('0x46')]:undefined)||[]},{'name':_0x6522('0x4d'),'value':_0xed4641[_0x6522('0x4d')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x4]?_0xed4641['attrs'][0x4][_0x6522('0x46')]:undefined)||_0x6522('0x4e')},{'name':_0x6522('0x4f'),'value':_0xed4641[_0x6522('0x4f')]||(_0xed4641['attrs']&&_0xed4641[_0x6522('0x42')][0x5]?_0xed4641[_0x6522('0x42')][0x5][_0x6522('0x46')]:undefined)||''},{'name':_0x6522('0x58'),'value':_0xed4641[_0x6522('0x58')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x6]?_0xed4641[_0x6522('0x42')][0x6][_0x6522('0x46')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xed4641[_0x6522('0x50')]||(_0xed4641['attrs']&&_0xed4641['attrs'][0x7]?_0xed4641[_0x6522('0x42')][0x7][_0x6522('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xed4641[_0x6522('0x51')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x8]?_0xed4641[_0x6522('0x42')][0x8][_0x6522('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xed4641[_0x6522('0x52')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x9]?_0xed4641[_0x6522('0x42')][0x9][_0x6522('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0xed4641[_0x6522('0x53')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641['attrs'][0xa]?_0xed4641['attrs'][0xa][_0x6522('0x46')]:undefined)||''}];case _0x6522('0x59'):return[{'name':_0x6522('0x5a'),'type':_0xed4641[_0x6522('0x5b')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x5c')]:undefined)||null,'value':_0xed4641[_0x6522('0x5a')]||(_0xed4641['attrs']&&_0xed4641['attrs'][0x0]?_0xed4641[_0x6522('0x42')][0x0][_0x6522('0x46')]:undefined)||null},{'name':_0x6522('0x5d'),'value':_0xed4641[_0x6522('0x5d')]||(_0xed4641[_0x6522('0x42')]&&_0xed4641[_0x6522('0x42')][0x1]?_0xed4641[_0x6522('0x42')][0x1][_0x6522('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x3e4686){logger[_0x6522('0x2c')](_0x6522('0x5e'),JSON[_0x6522('0x5f')](_0x3e4686));return[];}}exports['create']=function(_0x1cac9e,_0x24c8f8){if(_0x1cac9e[_0x6522('0x60')]){_0x1cac9e[_0x6522('0x60')]['attrs']=widgetAttributes(_0x1cac9e[_0x6522('0x60')]);}return db[_0x6522('0x34')]['create'](_0x1cac9e[_0x6522('0x60')],{})[_0x6522('0x2b')](respondWithResult(_0x24c8f8,0xc9))[_0x6522('0x3f')](handleError(_0x24c8f8,null));};exports[_0x6522('0x61')]=function(_0x1c0ede,_0x11f1e1){if(_0x1c0ede[_0x6522('0x60')]['id']){delete _0x1c0ede[_0x6522('0x60')]['id'];}_0x1c0ede[_0x6522('0x60')][_0x6522('0x42')]=widgetAttributes(_0x1c0ede[_0x6522('0x60')]);return db[_0x6522('0x34')][_0x6522('0x62')]({'where':{'id':_0x1c0ede['params']['id']}})['then'](handleEntityNotFound(_0x11f1e1,null))[_0x6522('0x2b')](saveUpdates(_0x1c0ede['body'],null))[_0x6522('0x2b')](respondWithResult(_0x11f1e1,null))['catch'](handleError(_0x11f1e1,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1e47aae..3c62e08 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 _0x7709=['hook','exports','events','../../mysqldb','DashboardItem','emit'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7709,0xa4));var _0x9770=function(_0x50b4ea,_0x3736e3){_0x50b4ea=_0x50b4ea-0x0;var _0x56f0f7=_0x7709[_0x50b4ea];return _0x56f0f7;};'use strict';var EventEmitter=require(_0x9770('0x0'));var DashboardItem=require(_0x9770('0x1'))['db'][_0x9770('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d76a7){return function(_0x20444b,_0x359a19,_0x4ef1e7){DashboardItemEvents[_0x9770('0x3')](_0x1d76a7+':'+_0x20444b['id'],_0x20444b);DashboardItemEvents[_0x9770('0x3')](_0x1d76a7,_0x20444b);_0x4ef1e7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x9770('0x4')](e,emitEvent(event));}}module[_0x9770('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x9185=['exports','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x9185,0x1de));var _0x5918=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0x9185[_0x27b423];return _0x5c11b8;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x5918('0x0'))['db'][_0x5918('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5918('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5918('0x3'),'afterDestroy':_0x5918('0x4')};function emitEvent(_0x30e872){return function(_0x24f47f,_0x227391,_0x4e5053){DashboardItemEvents['emit'](_0x30e872+':'+_0x24f47f['id'],_0x24f47f);DashboardItemEvents[_0x5918('0x5')](_0x30e872,_0x24f47f);_0x4e5053(null);};}for(var e in events){if(events[_0x5918('0x6')](e)){var event=events[e];DashboardItem[_0x5918('0x7')](e,emitEvent(event));}}module[_0x5918('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 8598aff..99bff52 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 _0xc719=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xc719,0x138));var _0x9c71=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xc719[_0x2bf466];return _0x856885;};'use strict';var _=require('lodash');var util=require(_0x9c71('0x0'));var logger=require(_0x9c71('0x1'))(_0x9c71('0x2'));var moment=require(_0x9c71('0x3'));var BPromise=require(_0x9c71('0x4'));var rp=require(_0x9c71('0x5'));var fs=require('fs');var path=require(_0x9c71('0x6'));var rimraf=require(_0x9c71('0x7'));var config=require(_0x9c71('0x8'));var attributes=require(_0x9c71('0x9'));module[_0x9c71('0xa')]=function(_0x1b17d4,_0x21d93e){return _0x1b17d4['define']('DashboardItem',attributes,{'tableName':_0x9c71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3351=['exports','define','DashboardItem','dashboard_items','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30f395,_0x3629b5){var _0x2ea0ee=function(_0x35a9af){while(--_0x35a9af){_0x30f395['push'](_0x30f395['shift']());}};_0x2ea0ee(++_0x3629b5);}(_0x3351,0x1b4));var _0x1335=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x3351[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x1335('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var fs=require('fs');var path=require(_0x1335('0x5'));var rimraf=require(_0x1335('0x6'));var config=require(_0x1335('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x1335('0x8')]=function(_0x1b951c,_0x2ee73b){return _0x1b951c[_0x1335('0x9')](_0x1335('0xa'),attributes,{'tableName':_0x1335('0xb'),'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 3344221..4a08d46 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 _0xdde8=['stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x4524ea,_0x546a87){var _0xda4582=function(_0x37df08){while(--_0x37df08){_0x4524ea['push'](_0x4524ea['shift']());}};_0xda4582(++_0x546a87);}(_0xdde8,0x173));var _0x8dde=function(_0x4da7a1,_0x328bb4){_0x4da7a1=_0x4da7a1-0x0;var _0x25f893=_0xdde8[_0x4da7a1];return _0x25f893;};'use strict';var _=require(_0x8dde('0x0'));var util=require(_0x8dde('0x1'));var moment=require(_0x8dde('0x2'));var BPromise=require(_0x8dde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dde('0x4'))['db'];var utils=require(_0x8dde('0x5'));var logger=require(_0x8dde('0x6'))(_0x8dde('0x7'));var config=require(_0x8dde('0x8'));var jayson=require(_0x8dde('0x9'));var client=jayson['client'][_0x8dde('0xa')]({'port':0x232a});config[_0x8dde('0xb')]=_[_0x8dde('0xc')](config[_0x8dde('0xb')],{'host':_0x8dde('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dde('0xb')]));require(_0x8dde('0xe'))[_0x8dde('0xf')](socket);function respondWithRpcPromise(_0x55eb46,_0x358138,_0xbc2563){return new BPromise(function(_0x3c912f,_0x2514eb){return client['request'](_0x55eb46,_0xbc2563)[_0x8dde('0x10')](function(_0xefbb16){logger[_0x8dde('0x11')]('DashboardItem,\x20%s,\x20%s',_0x358138,_0x8dde('0x12'));logger[_0x8dde('0x13')](_0x8dde('0x14'),_0x358138,_0x8dde('0x12'),JSON[_0x8dde('0x15')](_0xefbb16));if(_0xefbb16[_0x8dde('0x16')]){if(_0xefbb16[_0x8dde('0x16')][_0x8dde('0x17')]===0x1f4){logger[_0x8dde('0x16')](_0x8dde('0x18'),_0x358138,_0xefbb16[_0x8dde('0x16')][_0x8dde('0x19')]);return _0x2514eb(_0xefbb16[_0x8dde('0x16')][_0x8dde('0x19')]);}logger[_0x8dde('0x16')](_0x8dde('0x18'),_0x358138,_0xefbb16['error']['message']);return _0x3c912f(_0xefbb16[_0x8dde('0x16')][_0x8dde('0x19')]);}else{logger['info'](_0x8dde('0x18'),_0x358138,'request\x20sent');_0x3c912f(_0xefbb16[_0x8dde('0x1a')][_0x8dde('0x19')]);}})[_0x8dde('0x1b')](function(_0x54f4e1){logger[_0x8dde('0x16')](_0x8dde('0x18'),_0x358138,_0x54f4e1);_0x2514eb(_0x54f4e1);});});} \ No newline at end of file +var _0x299d=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','./dashboardItem.socket','then','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result'];(function(_0x284bfb,_0xc7941f){var _0x3c078d=function(_0x8d97a0){while(--_0x8d97a0){_0x284bfb['push'](_0x284bfb['shift']());}};_0x3c078d(++_0xc7941f);}(_0x299d,0x109));var _0xd299=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x299d[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0xd299('0x0'));var moment=require(_0xd299('0x1'));var BPromise=require(_0xd299('0x2'));var rs=require(_0xd299('0x3'));var fs=require('fs');var Redis=require(_0xd299('0x4'));var db=require(_0xd299('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd299('0x6'))(_0xd299('0x7'));var config=require(_0xd299('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd299('0x9')]({'port':0x232a});config[_0xd299('0xa')]=_['defaults'](config[_0xd299('0xa')],{'host':_0xd299('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd299('0xa')]));require(_0xd299('0xc'))['register'](socket);function respondWithRpcPromise(_0x944382,_0x2c429a,_0x1121de){return new BPromise(function(_0x129bdf,_0x5b1998){return client['request'](_0x944382,_0x1121de)[_0xd299('0xd')](function(_0x4a4155){logger[_0xd299('0xe')]('DashboardItem,\x20%s,\x20%s',_0x2c429a,_0xd299('0xf'));logger['debug'](_0xd299('0x10'),_0x2c429a,'request\x20sent',JSON[_0xd299('0x11')](_0x4a4155));if(_0x4a4155[_0xd299('0x12')]){if(_0x4a4155[_0xd299('0x12')][_0xd299('0x13')]===0x1f4){logger[_0xd299('0x12')](_0xd299('0x14'),_0x2c429a,_0x4a4155[_0xd299('0x12')][_0xd299('0x15')]);return _0x5b1998(_0x4a4155[_0xd299('0x12')][_0xd299('0x15')]);}logger[_0xd299('0x12')](_0xd299('0x14'),_0x2c429a,_0x4a4155[_0xd299('0x12')][_0xd299('0x15')]);return _0x129bdf(_0x4a4155[_0xd299('0x12')][_0xd299('0x15')]);}else{logger[_0xd299('0xe')](_0xd299('0x14'),_0x2c429a,_0xd299('0xf'));_0x129bdf(_0x4a4155[_0xd299('0x16')][_0xd299('0x15')]);}})[_0xd299('0x17')](function(_0x3835e7){logger[_0xd299('0x12')]('DashboardItem,\x20%s,\x20%s',_0x2c429a,_0x3835e7);_0x5b1998(_0x3835e7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index ea74b36..6eb922e 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 _0xfe94=['emit','register','length','dashboardItem:','save','update'];(function(_0xa68cb9,_0x5396be){var _0x5cb25=function(_0x2581b7){while(--_0x2581b7){_0xa68cb9['push'](_0xa68cb9['shift']());}};_0x5cb25(++_0x5396be);}(_0xfe94,0x130));var _0x4fe9=function(_0x3fe6f0,_0x1aaa23){_0x3fe6f0=_0x3fe6f0-0x0;var _0x1801d1=_0xfe94[_0x3fe6f0];return _0x1801d1;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x4fe9('0x0'),'remove',_0x4fe9('0x1')];function createListener(_0x3c2ce5,_0x201c0d){return function(_0x35b042){_0x201c0d[_0x4fe9('0x2')](_0x3c2ce5,_0x35b042);};}function removeListener(_0x30db05,_0x548977){return function(){DashboardItemEvents['removeListener'](_0x30db05,_0x548977);};}exports[_0x4fe9('0x3')]=function(_0x34dfa8){for(var _0x47becd=0x0,_0x3890a6=events[_0x4fe9('0x4')];_0x47becd<_0x3890a6;_0x47becd++){var _0xbfd353=events[_0x47becd];var _0x37e66f=createListener(_0x4fe9('0x5')+_0xbfd353,_0x34dfa8);DashboardItemEvents['on'](_0xbfd353,_0x37e66f);}}; \ No newline at end of file +var _0xcdba=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x3c9b33,_0x3eee6f){var _0x587a7f=function(_0x5a11af){while(--_0x5a11af){_0x3c9b33['push'](_0x3c9b33['shift']());}};_0x587a7f(++_0x3eee6f);}(_0xcdba,0xc6));var _0xacdb=function(_0x15f648,_0x179f7e){_0x15f648=_0x15f648-0x0;var _0x401602=_0xcdba[_0x15f648];return _0x401602;};'use strict';var DashboardItemEvents=require(_0xacdb('0x0'));var events=[_0xacdb('0x1'),'remove',_0xacdb('0x2')];function createListener(_0x586edf,_0x1cb00c){return function(_0x44d5d3){_0x1cb00c[_0xacdb('0x3')](_0x586edf,_0x44d5d3);};}function removeListener(_0x560ce8,_0xb3f690){return function(){DashboardItemEvents[_0xacdb('0x4')](_0x560ce8,_0xb3f690);};}exports[_0xacdb('0x5')]=function(_0x3dcb28){for(var _0x2a1d2c=0x0,_0x25c4a1=events[_0xacdb('0x6')];_0x2a1d2c<_0x25c4a1;_0x2a1d2c++){var _0x1ca137=events[_0x2a1d2c];var _0x1d0ef8=createListener(_0xacdb('0x7')+_0x1ca137,_0x3dcb28);DashboardItemEvents['on'](_0x1ca137,_0x1d0ef8);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4b2d28e..15c5740 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 _0xee36=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xee36,0x15e));var _0x6ee3=function(_0x4c22d6,_0x383512){_0x4c22d6=_0x4c22d6-0x0;var _0x35179b=_0xee36[_0x4c22d6];return _0x35179b;};'use strict';var multer=require(_0x6ee3('0x0'));var util=require(_0x6ee3('0x1'));var path=require(_0x6ee3('0x2'));var timeout=require(_0x6ee3('0x3'));var express=require(_0x6ee3('0x4'));var router=express[_0x6ee3('0x5')]();var fs_extra=require(_0x6ee3('0x6'));var auth=require(_0x6ee3('0x7'));var interaction=require(_0x6ee3('0x8'));var config=require(_0x6ee3('0x9'));var controller=require(_0x6ee3('0xa'));router[_0x6ee3('0xb')](_0x6ee3('0xc'),auth[_0x6ee3('0xd')](),controller['show']);router['post']('/',auth[_0x6ee3('0xd')](),controller['create']);router[_0x6ee3('0xe')](_0x6ee3('0xc'),auth[_0x6ee3('0xd')](),controller[_0x6ee3('0xf')]);router['delete'](_0x6ee3('0xc'),auth[_0x6ee3('0xd')](),controller['destroy']);module[_0x6ee3('0x10')]=router; \ No newline at end of file +var _0x9c51=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x20105a,_0x3a6271){var _0x3f783a=function(_0x34e22b){while(--_0x34e22b){_0x20105a['push'](_0x20105a['shift']());}};_0x3f783a(++_0x3a6271);}(_0x9c51,0x19b));var _0x19c5=function(_0x41adba,_0xafe971){_0x41adba=_0x41adba-0x0;var _0x2d2f3e=_0x9c51[_0x41adba];return _0x2d2f3e;};'use strict';var multer=require(_0x19c5('0x0'));var util=require(_0x19c5('0x1'));var path=require(_0x19c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x19c5('0x3'));var router=express[_0x19c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x19c5('0x5'));var interaction=require(_0x19c5('0x6'));var config=require(_0x19c5('0x7'));var controller=require(_0x19c5('0x8'));router['get'](_0x19c5('0x9'),auth[_0x19c5('0xa')](),controller['show']);router[_0x19c5('0xb')]('/',auth[_0x19c5('0xa')](),controller[_0x19c5('0xc')]);router[_0x19c5('0xd')]('/:id',auth[_0x19c5('0xa')](),controller[_0x19c5('0xe')]);router[_0x19c5('0xf')](_0x19c5('0x9'),auth[_0x19c5('0xa')](),controller[_0x19c5('0x10')]);module[_0x19c5('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 2e9b6c0..03e95fe 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 _0x6e27=['ENUM','first','third','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6e27,0x16b));var _0x76e2=function(_0x9524eb,_0x19e65d){_0x9524eb=_0x9524eb-0x0;var _0x39dea9=_0x6e27[_0x9524eb];return _0x39dea9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x76e2('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x76e2('0x1')](_0x76e2('0x2'),'second',_0x76e2('0x3')),'allowNull':![],'defaultValue':_0x76e2('0x2')},'description':{'type':Sequelize[_0x76e2('0x0')]}}; \ No newline at end of file +var _0xfb0b=['STRING','ENUM','first','third','exports'];(function(_0x5f4864,_0x48dd66){var _0xa73468=function(_0xcde800){while(--_0xcde800){_0x5f4864['push'](_0x5f4864['shift']());}};_0xa73468(++_0x48dd66);}(_0xfb0b,0xf4));var _0xbfb0=function(_0x2f53eb,_0x21b3a2){_0x2f53eb=_0x2f53eb-0x0;var _0xf5205b=_0xfb0b[_0x2f53eb];return _0xf5205b;};'use strict';var Sequelize=require('sequelize');module[_0xbfb0('0x0')]={'name':{'type':Sequelize[_0xbfb0('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xbfb0('0x2')](_0xbfb0('0x3'),'second',_0xbfb0('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xbfb0('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 25437dc..d2a5d10 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 _0x91c6=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','then','destroy','get','Dispositions','UserProfileResource','stack','name','index','map','Disposition','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x50f697,_0x11e9cf){var _0x46e0cb=function(_0xafeeb8){while(--_0xafeeb8){_0x50f697['push'](_0x50f697['shift']());}};_0x46e0cb(++_0x11e9cf);}(_0x91c6,0xf9));var _0x691c=function(_0x49d605,_0x22bf1e){_0x49d605=_0x49d605-0x0;var _0x3e54a6=_0x91c6[_0x49d605];return _0x3e54a6;};'use strict';var emlformat=require(_0x691c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x691c('0x1'));var rp=require(_0x691c('0x2'));var moment=require(_0x691c('0x3'));var BPromise=require(_0x691c('0x4'));var Mustache=require(_0x691c('0x5'));var util=require('util');var path=require(_0x691c('0x6'));var sox=require(_0x691c('0x7'));var csv=require(_0x691c('0x8'));var ejs=require(_0x691c('0x9'));var fs=require('fs');var fs_extra=require(_0x691c('0xa'));var _=require(_0x691c('0xb'));var squel=require('squel');var crypto=require(_0x691c('0xc'));var jsforce=require(_0x691c('0xd'));var deskjs=require(_0x691c('0xe'));var toCsv=require(_0x691c('0x8'));var querystring=require('querystring');var Papa=require(_0x691c('0xf'));var Redis=require(_0x691c('0x10'));var authService=require(_0x691c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x691c('0x12'))(_0x691c('0x13'));var utils=require(_0x691c('0x14'));var config=require(_0x691c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b69f5,_0x246a67){_0x246a67=_0x246a67||0xcc;return function(_0x20fd87){if(_0x20fd87){return _0x2b69f5[_0x691c('0x16')](_0x246a67);}return _0x2b69f5[_0x691c('0x17')](_0x246a67)[_0x691c('0x18')]();};}function respondWithResult(_0x337b64,_0x2678e7){_0x2678e7=_0x2678e7||0xc8;return function(_0x5416e4){if(_0x5416e4){return _0x337b64[_0x691c('0x17')](_0x2678e7)[_0x691c('0x19')](_0x5416e4);}};}function respondWithFilteredResult(_0x257d9c,_0xa99230){return function(_0x136747){if(_0x136747){var _0x13c97d=typeof _0xa99230[_0x691c('0x1a')]===_0x691c('0x1b')&&typeof _0xa99230['limit']===_0x691c('0x1b');var _0x1b4cf0=_0x136747[_0x691c('0x1c')];var _0x299653=_0x13c97d?0x0:_0xa99230[_0x691c('0x1a')];var _0x522ad0=_0x13c97d?_0x136747[_0x691c('0x1c')]:_0xa99230[_0x691c('0x1a')]+_0xa99230['limit'];var _0x5b23b0;if(_0x522ad0>=_0x1b4cf0){_0x522ad0=_0x1b4cf0;_0x5b23b0=0xc8;}else{_0x5b23b0=0xce;}_0x257d9c['status'](_0x5b23b0);return _0x257d9c[_0x691c('0x1d')]('Content-Range',_0x299653+'-'+_0x522ad0+'/'+_0x1b4cf0)[_0x691c('0x19')](_0x136747);}return null;};}function patchUpdates(_0x53a419){return function(_0x49d816){try{jsonpatch[_0x691c('0x1e')](_0x49d816,_0x53a419,!![]);}catch(_0x40317d){return BPromise[_0x691c('0x1f')](_0x40317d);}return _0x49d816[_0x691c('0x20')]();};}function saveUpdates(_0xc7de7f,_0x59d3de){return function(_0xd1e967){if(_0xd1e967){return _0xd1e967['update'](_0xc7de7f)[_0x691c('0x21')](function(_0x56bcf9){return _0x56bcf9;});}return null;};}function removeEntity(_0x14b26a,_0x52abf){return function(_0x63e21c){if(_0x63e21c){return _0x63e21c[_0x691c('0x22')]()[_0x691c('0x21')](function(){var _0x5c3dc5=_0x63e21c[_0x691c('0x23')]({'plain':!![]});var _0x5a1635=_0x691c('0x24');return db[_0x691c('0x25')][_0x691c('0x22')]({'where':{'type':_0x5a1635,'resourceId':_0x5c3dc5['id']}})[_0x691c('0x21')](function(){return _0x63e21c;});})[_0x691c('0x21')](function(){_0x14b26a[_0x691c('0x17')](0xcc)[_0x691c('0x18')]();});}};}function handleEntityNotFound(_0xccf826,_0x54a16d){return function(_0x7a07ec){if(!_0x7a07ec){_0xccf826[_0x691c('0x16')](0x194);}return _0x7a07ec;};}function handleError(_0x20b4aa,_0x498029){_0x498029=_0x498029||0x1f4;return function(_0x598ece){logger['error'](_0x598ece[_0x691c('0x26')]);if(_0x598ece[_0x691c('0x27')]){delete _0x598ece['name'];}_0x20b4aa[_0x691c('0x17')](_0x498029)['send'](_0x598ece);};}exports[_0x691c('0x28')]=function(_0x5071f9,_0x416c43){var _0x2cb3ab={},_0x21c531={},_0x5cebbd={'count':0x0,'rows':[]};var _0x547db9=_[_0x691c('0x29')](db[_0x691c('0x2a')][_0x691c('0x2b')],function(_0x1e3071){return{'name':_0x1e3071[_0x691c('0x2c')],'type':_0x1e3071[_0x691c('0x2d')][_0x691c('0x2e')]};});_0x21c531['model']=_[_0x691c('0x29')](_0x547db9,_0x691c('0x27'));_0x21c531['query']=_[_0x691c('0x2f')](_0x5071f9[_0x691c('0x30')]);_0x21c531[_0x691c('0x31')]=_[_0x691c('0x32')](_0x21c531['model'],_0x21c531[_0x691c('0x30')]);_0x2cb3ab[_0x691c('0x33')]=_[_0x691c('0x32')](_0x21c531['model'],qs[_0x691c('0x34')](_0x5071f9[_0x691c('0x30')][_0x691c('0x34')]));_0x2cb3ab[_0x691c('0x33')]=_0x2cb3ab[_0x691c('0x33')]['length']?_0x2cb3ab[_0x691c('0x33')]:_0x21c531[_0x691c('0x35')];if(!_0x5071f9[_0x691c('0x30')][_0x691c('0x36')](_0x691c('0x37'))){_0x2cb3ab[_0x691c('0x38')]=qs['limit'](_0x5071f9[_0x691c('0x30')]['limit']);_0x2cb3ab['offset']=qs[_0x691c('0x1a')](_0x5071f9[_0x691c('0x30')][_0x691c('0x1a')]);}_0x2cb3ab[_0x691c('0x39')]=qs['sort'](_0x5071f9[_0x691c('0x30')][_0x691c('0x3a')]);_0x2cb3ab[_0x691c('0x3b')]=qs[_0x691c('0x31')](_[_0x691c('0x3c')](_0x5071f9[_0x691c('0x30')],_0x21c531[_0x691c('0x31')]),_0x547db9);if(_0x5071f9[_0x691c('0x30')][_0x691c('0x3d')]){_0x2cb3ab[_0x691c('0x3b')]=_[_0x691c('0x3e')](_0x2cb3ab['where'],{'$or':_[_0x691c('0x29')](_0x547db9,function(_0x3c08ac){if(_0x3c08ac['type']!=='VIRTUAL'){var _0x116ef2={};_0x116ef2[_0x3c08ac[_0x691c('0x27')]]={'$like':'%'+_0x5071f9[_0x691c('0x30')][_0x691c('0x3d')]+'%'};return _0x116ef2;}})});}_0x2cb3ab=_[_0x691c('0x3e')]({},_0x2cb3ab,_0x5071f9[_0x691c('0x3f')]);var _0x19fa3f={'where':_0x2cb3ab[_0x691c('0x3b')]};return db[_0x691c('0x2a')][_0x691c('0x1c')](_0x19fa3f)['then'](function(_0x23a9a1){_0x5cebbd[_0x691c('0x1c')]=_0x23a9a1;if(_0x5071f9[_0x691c('0x30')][_0x691c('0x40')]){_0x2cb3ab[_0x691c('0x41')]=[{'all':!![]}];}return db[_0x691c('0x2a')][_0x691c('0x42')](_0x2cb3ab);})[_0x691c('0x21')](function(_0x317a0b){_0x5cebbd[_0x691c('0x43')]=_0x317a0b;return _0x5cebbd;})[_0x691c('0x21')](respondWithFilteredResult(_0x416c43,_0x2cb3ab))[_0x691c('0x44')](handleError(_0x416c43,null));};exports[_0x691c('0x45')]=function(_0xdc0573,_0x326537){var _0x14cfa2={'raw':!![],'where':{'id':_0xdc0573[_0x691c('0x46')]['id']}},_0x4aa751={};_0x4aa751[_0x691c('0x35')]=_['keys'](db[_0x691c('0x2a')][_0x691c('0x2b')]);_0x4aa751[_0x691c('0x30')]=_[_0x691c('0x2f')](_0xdc0573[_0x691c('0x30')]);_0x4aa751['filters']=_[_0x691c('0x32')](_0x4aa751[_0x691c('0x35')],_0x4aa751['query']);_0x14cfa2[_0x691c('0x33')]=_[_0x691c('0x32')](_0x4aa751[_0x691c('0x35')],qs['fields'](_0xdc0573[_0x691c('0x30')][_0x691c('0x34')]));_0x14cfa2[_0x691c('0x33')]=_0x14cfa2[_0x691c('0x33')][_0x691c('0x47')]?_0x14cfa2[_0x691c('0x33')]:_0x4aa751[_0x691c('0x35')];if(_0xdc0573['query'][_0x691c('0x40')]){_0x14cfa2[_0x691c('0x41')]=[{'all':!![]}];}_0x14cfa2=_[_0x691c('0x3e')]({},_0x14cfa2,_0xdc0573[_0x691c('0x3f')]);return db[_0x691c('0x2a')][_0x691c('0x48')](_0x14cfa2)[_0x691c('0x21')](handleEntityNotFound(_0x326537,null))[_0x691c('0x21')](respondWithResult(_0x326537,null))['catch'](handleError(_0x326537,null));};exports[_0x691c('0x49')]=function(_0x27feef,_0xd011ac){return db[_0x691c('0x2a')][_0x691c('0x49')](_0x27feef['body'],{})['then'](function(_0x19de40){var _0x5421fd=_0x27feef[_0x691c('0x4a')][_0x691c('0x23')]({'plain':!![]});if(!_0x5421fd)throw new Error(_0x691c('0x4b'));if(_0x5421fd[_0x691c('0x4c')]==='user'){var _0x4062f5=_0x19de40[_0x691c('0x23')]({'plain':!![]});var _0x864d1d=_0x691c('0x24');return db[_0x691c('0x4d')][_0x691c('0x48')]({'where':{'name':_0x864d1d,'userProfileId':_0x5421fd[_0x691c('0x4e')]},'raw':!![]})[_0x691c('0x21')](function(_0x5593ce){if(_0x5593ce&&_0x5593ce[_0x691c('0x4f')]===0x0){return db[_0x691c('0x25')]['create']({'name':_0x4062f5[_0x691c('0x27')],'resourceId':_0x4062f5['id'],'type':_0x5593ce[_0x691c('0x27')],'sectionId':_0x5593ce['id']},{})['then'](function(){return _0x19de40;});}else{return _0x19de40;}})[_0x691c('0x44')](function(_0x5efd64){logger[_0x691c('0x50')](_0x691c('0x51'),_0x5efd64);throw _0x5efd64;});}return _0x19de40;})[_0x691c('0x21')](respondWithResult(_0xd011ac,0xc9))[_0x691c('0x44')](handleError(_0xd011ac,null));};exports['update']=function(_0x4ca5d4,_0x4ff53d){if(_0x4ca5d4[_0x691c('0x52')]['id']){delete _0x4ca5d4['body']['id'];}return db[_0x691c('0x2a')][_0x691c('0x48')]({'where':{'id':_0x4ca5d4[_0x691c('0x46')]['id']}})[_0x691c('0x21')](handleEntityNotFound(_0x4ff53d,null))[_0x691c('0x21')](saveUpdates(_0x4ca5d4[_0x691c('0x52')],null))[_0x691c('0x21')](respondWithResult(_0x4ff53d,null))['catch'](handleError(_0x4ff53d,null));};exports[_0x691c('0x22')]=function(_0x177a92,_0x429881){return db[_0x691c('0x2a')][_0x691c('0x48')]({'where':{'id':_0x177a92[_0x691c('0x46')]['id']}})[_0x691c('0x21')](handleEntityNotFound(_0x429881,null))[_0x691c('0x21')](removeEntity(_0x429881,null))[_0x691c('0x44')](handleError(_0x429881,null));}; \ No newline at end of file +var _0x2c6f=['sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','show','params','rawAttributes','intersection','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x56d369,_0x435f7a){var _0x8379f5=function(_0x43e1f9){while(--_0x43e1f9){_0x56d369['push'](_0x56d369['shift']());}};_0x8379f5(++_0x435f7a);}(_0x2c6f,0x138));var _0xf2c6=function(_0x38d3f6,_0x711933){_0x38d3f6=_0x38d3f6-0x0;var _0x234a32=_0x2c6f[_0x38d3f6];return _0x234a32;};'use strict';var emlformat=require(_0xf2c6('0x0'));var rimraf=require(_0xf2c6('0x1'));var zipdir=require(_0xf2c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf2c6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf2c6('0x4'));var path=require(_0xf2c6('0x5'));var sox=require(_0xf2c6('0x6'));var csv=require('to-csv');var ejs=require(_0xf2c6('0x7'));var fs=require('fs');var fs_extra=require(_0xf2c6('0x8'));var _=require(_0xf2c6('0x9'));var squel=require(_0xf2c6('0xa'));var crypto=require('crypto');var jsforce=require(_0xf2c6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf2c6('0xc'));var querystring=require(_0xf2c6('0xd'));var Papa=require(_0xf2c6('0xe'));var Redis=require('ioredis');var authService=require(_0xf2c6('0xf'));var qs=require(_0xf2c6('0x10'));var as=require(_0xf2c6('0x11'));var hardwareService=require(_0xf2c6('0x12'));var logger=require(_0xf2c6('0x13'))('api');var utils=require(_0xf2c6('0x14'));var config=require(_0xf2c6('0x15'));var licenseUtil=require(_0xf2c6('0x16'));var db=require(_0xf2c6('0x17'))['db'];function respondWithStatusCode(_0x2b5236,_0x3dff21){_0x3dff21=_0x3dff21||0xcc;return function(_0x2aee72){if(_0x2aee72){return _0x2b5236[_0xf2c6('0x18')](_0x3dff21);}return _0x2b5236['status'](_0x3dff21)[_0xf2c6('0x19')]();};}function respondWithResult(_0x292898,_0x3c0b64){_0x3c0b64=_0x3c0b64||0xc8;return function(_0xc37d2){if(_0xc37d2){return _0x292898[_0xf2c6('0x1a')](_0x3c0b64)[_0xf2c6('0x1b')](_0xc37d2);}};}function respondWithFilteredResult(_0x187725,_0x237b69){return function(_0x36b958){if(_0x36b958){var _0x16cb6c=typeof _0x237b69['offset']===_0xf2c6('0x1c')&&typeof _0x237b69[_0xf2c6('0x1d')]===_0xf2c6('0x1c');var _0x567e87=_0x36b958[_0xf2c6('0x1e')];var _0x27253c=_0x16cb6c?0x0:_0x237b69['offset'];var _0x128387=_0x16cb6c?_0x36b958[_0xf2c6('0x1e')]:_0x237b69[_0xf2c6('0x1f')]+_0x237b69['limit'];var _0x30d88b;if(_0x128387>=_0x567e87){_0x128387=_0x567e87;_0x30d88b=0xc8;}else{_0x30d88b=0xce;}_0x187725[_0xf2c6('0x1a')](_0x30d88b);return _0x187725[_0xf2c6('0x20')](_0xf2c6('0x21'),_0x27253c+'-'+_0x128387+'/'+_0x567e87)[_0xf2c6('0x1b')](_0x36b958);}return null;};}function patchUpdates(_0x350760){return function(_0x664d4){try{jsonpatch['apply'](_0x664d4,_0x350760,!![]);}catch(_0x47482b){return BPromise[_0xf2c6('0x22')](_0x47482b);}return _0x664d4['save']();};}function saveUpdates(_0x54c0eb,_0x4e8693){return function(_0x50bdf4){if(_0x50bdf4){return _0x50bdf4[_0xf2c6('0x23')](_0x54c0eb)[_0xf2c6('0x24')](function(_0x2239db){return _0x2239db;});}return null;};}function removeEntity(_0x55426a,_0x4f3267){return function(_0x271812){if(_0x271812){return _0x271812[_0xf2c6('0x25')]()[_0xf2c6('0x24')](function(){var _0x2ad6c4=_0x271812[_0xf2c6('0x26')]({'plain':!![]});var _0xfe5ea0=_0xf2c6('0x27');return db[_0xf2c6('0x28')][_0xf2c6('0x25')]({'where':{'type':_0xfe5ea0,'resourceId':_0x2ad6c4['id']}})[_0xf2c6('0x24')](function(){return _0x271812;});})[_0xf2c6('0x24')](function(){_0x55426a['status'](0xcc)[_0xf2c6('0x19')]();});}};}function handleEntityNotFound(_0x5382aa,_0x1772e7){return function(_0xef5891){if(!_0xef5891){_0x5382aa[_0xf2c6('0x18')](0x194);}return _0xef5891;};}function handleError(_0x42c7a2,_0x3456f5){_0x3456f5=_0x3456f5||0x1f4;return function(_0x32b030){logger[_0xf2c6('0x29')](_0x32b030[_0xf2c6('0x2a')]);if(_0x32b030[_0xf2c6('0x2b')]){delete _0x32b030[_0xf2c6('0x2b')];}_0x42c7a2[_0xf2c6('0x1a')](_0x3456f5)[_0xf2c6('0x2c')](_0x32b030);};}exports[_0xf2c6('0x2d')]=function(_0x29a032,_0x5c6939){var _0x1b1f6e={},_0x2c241c={},_0x21f5c6={'count':0x0,'rows':[]};var _0x27b1e4=_[_0xf2c6('0x2e')](db['Disposition']['rawAttributes'],function(_0x5d4669){return{'name':_0x5d4669[_0xf2c6('0x2f')],'type':_0x5d4669[_0xf2c6('0x30')][_0xf2c6('0x31')]};});_0x2c241c['model']=_[_0xf2c6('0x2e')](_0x27b1e4,_0xf2c6('0x2b'));_0x2c241c[_0xf2c6('0x32')]=_[_0xf2c6('0x33')](_0x29a032[_0xf2c6('0x32')]);_0x2c241c[_0xf2c6('0x34')]=_['intersection'](_0x2c241c[_0xf2c6('0x35')],_0x2c241c[_0xf2c6('0x32')]);_0x1b1f6e[_0xf2c6('0x36')]=_['intersection'](_0x2c241c[_0xf2c6('0x35')],qs['fields'](_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x37')]));_0x1b1f6e['attributes']=_0x1b1f6e['attributes'][_0xf2c6('0x38')]?_0x1b1f6e[_0xf2c6('0x36')]:_0x2c241c[_0xf2c6('0x35')];if(!_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x39')](_0xf2c6('0x3a'))){_0x1b1f6e['limit']=qs[_0xf2c6('0x1d')](_0x29a032['query'][_0xf2c6('0x1d')]);_0x1b1f6e[_0xf2c6('0x1f')]=qs[_0xf2c6('0x1f')](_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x1f')]);}_0x1b1f6e[_0xf2c6('0x3b')]=qs[_0xf2c6('0x3c')](_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x3c')]);_0x1b1f6e[_0xf2c6('0x3d')]=qs[_0xf2c6('0x34')](_[_0xf2c6('0x3e')](_0x29a032['query'],_0x2c241c['filters']),_0x27b1e4);if(_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x3f')]){_0x1b1f6e[_0xf2c6('0x3d')]=_[_0xf2c6('0x40')](_0x1b1f6e[_0xf2c6('0x3d')],{'$or':_[_0xf2c6('0x2e')](_0x27b1e4,function(_0x423c1e){if(_0x423c1e[_0xf2c6('0x30')]!==_0xf2c6('0x41')){var _0x47fcf7={};_0x47fcf7[_0x423c1e['name']]={'$like':'%'+_0x29a032['query'][_0xf2c6('0x3f')]+'%'};return _0x47fcf7;}})});}_0x1b1f6e=_[_0xf2c6('0x40')]({},_0x1b1f6e,_0x29a032[_0xf2c6('0x42')]);var _0x1ff2f4={'where':_0x1b1f6e['where']};return db[_0xf2c6('0x43')][_0xf2c6('0x1e')](_0x1ff2f4)[_0xf2c6('0x24')](function(_0x3eb720){_0x21f5c6['count']=_0x3eb720;if(_0x29a032[_0xf2c6('0x32')][_0xf2c6('0x44')]){_0x1b1f6e[_0xf2c6('0x45')]=[{'all':!![]}];}return db[_0xf2c6('0x43')][_0xf2c6('0x46')](_0x1b1f6e);})[_0xf2c6('0x24')](function(_0x3ed285){_0x21f5c6['rows']=_0x3ed285;return _0x21f5c6;})[_0xf2c6('0x24')](respondWithFilteredResult(_0x5c6939,_0x1b1f6e))['catch'](handleError(_0x5c6939,null));};exports[_0xf2c6('0x47')]=function(_0xaa89bb,_0x2b7cea){var _0x1feffc={'raw':!![],'where':{'id':_0xaa89bb[_0xf2c6('0x48')]['id']}},_0x246737={};_0x246737[_0xf2c6('0x35')]=_[_0xf2c6('0x33')](db[_0xf2c6('0x43')][_0xf2c6('0x49')]);_0x246737[_0xf2c6('0x32')]=_[_0xf2c6('0x33')](_0xaa89bb['query']);_0x246737[_0xf2c6('0x34')]=_[_0xf2c6('0x4a')](_0x246737[_0xf2c6('0x35')],_0x246737['query']);_0x1feffc[_0xf2c6('0x36')]=_[_0xf2c6('0x4a')](_0x246737[_0xf2c6('0x35')],qs[_0xf2c6('0x37')](_0xaa89bb['query'][_0xf2c6('0x37')]));_0x1feffc['attributes']=_0x1feffc[_0xf2c6('0x36')]['length']?_0x1feffc[_0xf2c6('0x36')]:_0x246737[_0xf2c6('0x35')];if(_0xaa89bb[_0xf2c6('0x32')]['includeAll']){_0x1feffc[_0xf2c6('0x45')]=[{'all':!![]}];}_0x1feffc=_[_0xf2c6('0x40')]({},_0x1feffc,_0xaa89bb[_0xf2c6('0x42')]);return db['Disposition'][_0xf2c6('0x4b')](_0x1feffc)[_0xf2c6('0x24')](handleEntityNotFound(_0x2b7cea,null))['then'](respondWithResult(_0x2b7cea,null))[_0xf2c6('0x4c')](handleError(_0x2b7cea,null));};exports[_0xf2c6('0x4d')]=function(_0x37adc3,_0x372d27){return db[_0xf2c6('0x43')]['create'](_0x37adc3['body'],{})[_0xf2c6('0x24')](function(_0x5d4741){var _0x1beacd=_0x37adc3[_0xf2c6('0x4e')][_0xf2c6('0x26')]({'plain':!![]});if(!_0x1beacd)throw new Error(_0xf2c6('0x4f'));if(_0x1beacd[_0xf2c6('0x50')]===_0xf2c6('0x4e')){var _0x50e8fa=_0x5d4741[_0xf2c6('0x26')]({'plain':!![]});var _0x118a41=_0xf2c6('0x27');return db[_0xf2c6('0x51')][_0xf2c6('0x4b')]({'where':{'name':_0x118a41,'userProfileId':_0x1beacd[_0xf2c6('0x52')]},'raw':!![]})['then'](function(_0x23f7a8){if(_0x23f7a8&&_0x23f7a8['autoAssociation']===0x0){return db[_0xf2c6('0x28')]['create']({'name':_0x50e8fa[_0xf2c6('0x2b')],'resourceId':_0x50e8fa['id'],'type':_0x23f7a8[_0xf2c6('0x2b')],'sectionId':_0x23f7a8['id']},{})[_0xf2c6('0x24')](function(){return _0x5d4741;});}else{return _0x5d4741;}})[_0xf2c6('0x4c')](function(_0x710f8c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x710f8c);throw _0x710f8c;});}return _0x5d4741;})[_0xf2c6('0x24')](respondWithResult(_0x372d27,0xc9))[_0xf2c6('0x4c')](handleError(_0x372d27,null));};exports[_0xf2c6('0x23')]=function(_0x21a60f,_0x1608ce){if(_0x21a60f[_0xf2c6('0x53')]['id']){delete _0x21a60f[_0xf2c6('0x53')]['id'];}return db[_0xf2c6('0x43')][_0xf2c6('0x4b')]({'where':{'id':_0x21a60f[_0xf2c6('0x48')]['id']}})[_0xf2c6('0x24')](handleEntityNotFound(_0x1608ce,null))[_0xf2c6('0x24')](saveUpdates(_0x21a60f[_0xf2c6('0x53')],null))[_0xf2c6('0x24')](respondWithResult(_0x1608ce,null))[_0xf2c6('0x4c')](handleError(_0x1608ce,null));};exports['destroy']=function(_0x352c34,_0x1457ef){return db[_0xf2c6('0x43')][_0xf2c6('0x4b')]({'where':{'id':_0x352c34[_0xf2c6('0x48')]['id']}})['then'](handleEntityNotFound(_0x1457ef,null))[_0xf2c6('0x24')](removeEntity(_0x1457ef,null))['catch'](handleError(_0x1457ef,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d29ebeb..09c7d9e 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 _0xab42=['SmsAccountId','FaxAccountId','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','api','moment','request-promise','path','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_sms'];(function(_0x69ea92,_0x14506b){var _0x45b8ea=function(_0x2a33c0){while(--_0x2a33c0){_0x69ea92['push'](_0x69ea92['shift']());}};_0x45b8ea(++_0x14506b);}(_0xab42,0x15a));var _0x2ab4=function(_0x3e0836,_0x5f5da1){_0x3e0836=_0x3e0836-0x0;var _0xc6147a=_0xab42[_0x3e0836];return _0xc6147a;};'use strict';var _=require(_0x2ab4('0x0'));var util=require(_0x2ab4('0x1'));var logger=require(_0x2ab4('0x2'))(_0x2ab4('0x3'));var moment=require(_0x2ab4('0x4'));var BPromise=require('bluebird');var rp=require(_0x2ab4('0x5'));var fs=require('fs');var path=require(_0x2ab4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2ab4('0x7'));module['exports']=function(_0x5b9bba,_0x50e870){return _0x5b9bba[_0x2ab4('0x8')](_0x2ab4('0x9'),attributes,{'tableName':_0x2ab4('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2ab4('0xb'),'fields':[_0x2ab4('0xc'),'ListId']},{'unique':!![],'name':'name_chat','fields':['name',_0x2ab4('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x2ab4('0xc'),'MailAccountId']},{'unique':!![],'name':_0x2ab4('0xe'),'fields':[_0x2ab4('0xc'),_0x2ab4('0xf')]},{'unique':!![],'name':'name_fax','fields':['name',_0x2ab4('0x10')]},{'unique':!![],'name':'name_openchannel','fields':[_0x2ab4('0xc'),_0x2ab4('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x2ab4('0xc'),_0x2ab4('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6479=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x2ee1ed,_0x5d7786){var _0x3fe790=function(_0x2f388f){while(--_0x2f388f){_0x2ee1ed['push'](_0x2ee1ed['shift']());}};_0x3fe790(++_0x5d7786);}(_0x6479,0x1c8));var _0x9647=function(_0x1867e3,_0x589b2d){_0x1867e3=_0x1867e3-0x0;var _0x4b22aa=_0x6479[_0x1867e3];return _0x4b22aa;};'use strict';var _=require(_0x9647('0x0'));var util=require(_0x9647('0x1'));var logger=require(_0x9647('0x2'))(_0x9647('0x3'));var moment=require(_0x9647('0x4'));var BPromise=require(_0x9647('0x5'));var rp=require(_0x9647('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9647('0x7'));var attributes=require(_0x9647('0x8'));module[_0x9647('0x9')]=function(_0x37d3d1,_0xc0e8a5){return _0x37d3d1['define'](_0x9647('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x9647('0xb'),_0x9647('0xc')]},{'unique':!![],'name':_0x9647('0xd'),'fields':[_0x9647('0xb'),_0x9647('0xe')]},{'unique':!![],'name':_0x9647('0xf'),'fields':[_0x9647('0xb'),_0x9647('0x10')]},{'unique':!![],'name':_0x9647('0x11'),'fields':[_0x9647('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x9647('0x12'),'fields':['name',_0x9647('0x13')]},{'unique':!![],'name':_0x9647('0x14'),'fields':[_0x9647('0xb'),_0x9647('0x15')]},{'unique':!![],'name':_0x9647('0x16'),'fields':['name',_0x9647('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 22348d1..7e130d7 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 _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x4115b1,_0x979be5){var _0x24169d=function(_0x1d0e3a){while(--_0x1d0e3a){_0x4115b1['push'](_0x4115b1['shift']());}};_0x24169d(++_0x979be5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x3f9423,_0x5d24f1){var _0x32ddc4=function(_0x2afc04){while(--_0x2afc04){_0x3f9423['push'](_0x3f9423['shift']());}};_0x32ddc4(++_0x5d24f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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/disposition/index.js b/server/api/disposition/index.js index ca1a8b2..44eab02 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 _0xd706=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xd706,0x1db));var _0x6d70=function(_0xc48da6,_0x36b03d){_0xc48da6=_0xc48da6-0x0;var _0x74b92d=_0xd706[_0xc48da6];return _0x74b92d;};'use strict';var multer=require(_0x6d70('0x0'));var util=require(_0x6d70('0x1'));var path=require('path');var timeout=require(_0x6d70('0x2'));var express=require(_0x6d70('0x3'));var router=express[_0x6d70('0x4')]();var fs_extra=require(_0x6d70('0x5'));var auth=require(_0x6d70('0x6'));var interaction=require(_0x6d70('0x7'));var config=require(_0x6d70('0x8'));var controller=require(_0x6d70('0x9'));router[_0x6d70('0xa')]('/',auth[_0x6d70('0xb')](),controller[_0x6d70('0xc')]);router['get'](_0x6d70('0xd'),auth[_0x6d70('0xb')](),controller[_0x6d70('0xe')]);router[_0x6d70('0xf')]('/',auth[_0x6d70('0xb')](),controller[_0x6d70('0x10')]);router[_0x6d70('0x11')](_0x6d70('0xd'),auth[_0x6d70('0xb')](),controller[_0x6d70('0x12')]);router[_0x6d70('0x13')](_0x6d70('0xd'),auth[_0x6d70('0xb')](),controller[_0x6d70('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbd23=['../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbd23,0x9d));var _0x3bd2=function(_0x549c77,_0xb62a09){_0x549c77=_0x549c77-0x0;var _0x9725a2=_0xbd23[_0x549c77];return _0x9725a2;};'use strict';var multer=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var path=require('path');var timeout=require(_0x3bd2('0x2'));var express=require('express');var router=express[_0x3bd2('0x3')]();var fs_extra=require(_0x3bd2('0x4'));var auth=require(_0x3bd2('0x5'));var interaction=require(_0x3bd2('0x6'));var config=require(_0x3bd2('0x7'));var controller=require(_0x3bd2('0x8'));router[_0x3bd2('0x9')]('/',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xb')]);router[_0x3bd2('0x9')]('/:id',auth[_0x3bd2('0xa')](),controller['show']);router[_0x3bd2('0xc')]('/',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xd')]);router[_0x3bd2('0xe')](_0x3bd2('0xf'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x10')]);router[_0x3bd2('0x11')](_0x3bd2('0xf'),auth[_0x3bd2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 383c3da..b4cc4f2 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 _0x45e0=['SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','7200','12000','4800','9600','14400','v17,v27,v29','INTEGER'];(function(_0x315861,_0x735b4){var _0x3e2b76=function(_0x436457){while(--_0x436457){_0x315861['push'](_0x315861['shift']());}};_0x3e2b76(++_0x735b4);}(_0x45e0,0x66));var _0x045e=function(_0x487da7,_0x417893){_0x487da7=_0x487da7-0x0;var _0x25cf40=_0x45e0[_0x487da7];return _0x25cf40;};'use strict';var Sequelize=require('sequelize');module[_0x045e('0x0')]={'name':{'type':Sequelize[_0x045e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x045e('0x2')](_0x045e('0x3'),'no'),'defaultValue':_0x045e('0x3')},'headerinfo':{'type':Sequelize[_0x045e('0x1')],'defaultValue':_0x045e('0x4')},'localstationid':{'type':Sequelize[_0x045e('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x045e('0x2')](_0x045e('0x5'),'4800',_0x045e('0x6'),'9600',_0x045e('0x7'),'14400'),'defaultValue':_0x045e('0x8')},'maxrate':{'type':Sequelize[_0x045e('0x2')]('2400','4800','7200',_0x045e('0x9'),'12000',_0x045e('0xa')),'defaultValue':_0x045e('0xa')},'modem':{'type':Sequelize[_0x045e('0x1')],'defaultValue':_0x045e('0xb')},'gateway':{'type':Sequelize[_0x045e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x045e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x045e('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x045e('0x2')](_0x045e('0xd'),'IAX',_0x045e('0xe'),_0x045e('0xf')),'defaultValue':_0x045e('0xd')},'key':{'type':Sequelize[_0x045e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x045e('0x10')],'defaultValue':function(){return _0x045e('0x11');}},'notificationSound':{'type':Sequelize[_0x045e('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x045e('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x045e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x045e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x045e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x045e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x045e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x045e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x045e('0x12')],'defaultValue':![],'comment':_0x045e('0x14'),'set':function(_0x1ff152){if(!_0x1ff152)this[_0x045e('0x15')](_0x045e('0x16'),null);this[_0x045e('0x15')]('mandatoryDisposition',_0x1ff152);}}}; \ No newline at end of file +var _0xfb86=['localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x47186d,_0x2b166b){var _0x285bba=function(_0x1dd305){while(--_0x1dd305){_0x47186d['push'](_0x47186d['shift']());}};_0x285bba(++_0x2b166b);}(_0xfb86,0xeb));var _0x6fb8=function(_0x133020,_0x2f76aa){_0x133020=_0x133020-0x0;var _0x3257c9=_0xfb86[_0x133020];return _0x3257c9;};'use strict';var Sequelize=require('sequelize');module[_0x6fb8('0x0')]={'name':{'type':Sequelize[_0x6fb8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6fb8('0x1')]},'ecm':{'type':Sequelize[_0x6fb8('0x2')]('yes','no'),'defaultValue':_0x6fb8('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x6fb8('0x4')},'localstationid':{'type':Sequelize[_0x6fb8('0x1')],'unique':_0x6fb8('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x6fb8('0x6'),_0x6fb8('0x7'),_0x6fb8('0x8'),_0x6fb8('0x9'),_0x6fb8('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x6fb8('0x2')](_0x6fb8('0x6'),_0x6fb8('0x7'),_0x6fb8('0x8'),'9600','12000',_0x6fb8('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x6fb8('0xc')},'gateway':{'type':Sequelize[_0x6fb8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6fb8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6fb8('0x2')](_0x6fb8('0xd'),_0x6fb8('0xe'),'DADHI',_0x6fb8('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x6fb8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6fb8('0x10')],'defaultValue':function(){return _0x6fb8('0x11');}},'notificationSound':{'type':Sequelize[_0x6fb8('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6fb8('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6fb8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6fb8('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fb8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fb8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6fb8('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x6fb8('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5049cd){if(!_0x5049cd)this[_0x6fb8('0x15')](_0x6fb8('0x16'),null);this['setDataValue'](_0x6fb8('0x17'),_0x5049cd);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d926b2d..371aaf4 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 _0xbff3=['color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','minrate','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','root','basename','CheckAfterSend','path','isNil','from','fax','defaults','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','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','../../config/environment','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','update','params','describe','addDisposition','getDispositions','findOne','FaxAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tags'];(function(_0x28bc21,_0x26bb94){var _0x1d8569=function(_0x319677){while(--_0x319677){_0x28bc21['push'](_0x28bc21['shift']());}};_0x1d8569(++_0x26bb94);}(_0xbff3,0x104));var _0x3bff=function(_0x222bb9,_0x46b0f4){_0x222bb9=_0x222bb9-0x0;var _0x580ac8=_0xbff3[_0x222bb9];return _0x580ac8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3bff('0x0'));var jsonpatch=require(_0x3bff('0x1'));var rp=require('request-promise');var moment=require(_0x3bff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bff('0x3'));var util=require(_0x3bff('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x3bff('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bff('0x6'));var _=require(_0x3bff('0x7'));var squel=require(_0x3bff('0x8'));var crypto=require('crypto');var jsforce=require(_0x3bff('0x9'));var deskjs=require(_0x3bff('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3bff('0xb'));var Papa=require(_0x3bff('0xc'));var Redis=require(_0x3bff('0xd'));var authService=require(_0x3bff('0xe'));var qs=require(_0x3bff('0xf'));var as=require(_0x3bff('0x10'));var hardwareService=require(_0x3bff('0x11'));var logger=require(_0x3bff('0x12'))(_0x3bff('0x13'));var utils=require(_0x3bff('0x14'));var config=require(_0x3bff('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3bff('0x16')],{'host':_0x3bff('0x17'),'port':0x18eb});var socket=require(_0x3bff('0x18'))(new Redis(config[_0x3bff('0x16')]));require(_0x3bff('0x19'))[_0x3bff('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3bff('0x1b')][_0x3bff('0x1c')]({'port':0x232c});var client9002=jayson[_0x3bff('0x1b')][_0x3bff('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3d510e,_0xf1b20a,_0x23c710,_0x3fa188){return new BPromise(function(_0x4f80cd,_0x5f0bca){var _0x43a19f=_0x3fa188||client;return _0x43a19f[_0x3bff('0x1d')](_0x3d510e,_0x23c710)[_0x3bff('0x1e')](function(_0x12aeb5){logger[_0x3bff('0x1f')](_0x3bff('0x20'),_0xf1b20a,'request\x20sent');logger[_0x3bff('0x21')](_0x3bff('0x22'),_0xf1b20a,'request\x20sent',JSON['stringify'](_0x12aeb5));if(_0x12aeb5[_0x3bff('0x23')]){if(_0x12aeb5[_0x3bff('0x23')][_0x3bff('0x24')]===0x1f4){logger[_0x3bff('0x23')](_0x3bff('0x20'),_0xf1b20a,_0x12aeb5['error'][_0x3bff('0x25')]);return _0x5f0bca(_0x12aeb5[_0x3bff('0x23')][_0x3bff('0x25')]);}logger[_0x3bff('0x23')]('FaxAccount,\x20%s,\x20%s',_0xf1b20a,_0x12aeb5[_0x3bff('0x23')][_0x3bff('0x25')]);return _0x4f80cd(_0x12aeb5[_0x3bff('0x23')][_0x3bff('0x25')]);}else{logger['info'](_0x3bff('0x20'),_0xf1b20a,_0x3bff('0x26'));_0x4f80cd(_0x12aeb5[_0x3bff('0x27')][_0x3bff('0x25')]);}})['catch'](function(_0x34dcab){logger[_0x3bff('0x23')](_0x3bff('0x20'),_0xf1b20a,_0x34dcab);_0x5f0bca(_0x34dcab);});});}function respondWithStatusCode(_0x2b4e0e,_0x4f6328){_0x4f6328=_0x4f6328||0xcc;return function(_0x545340){if(_0x545340){return _0x2b4e0e[_0x3bff('0x28')](_0x4f6328);}return _0x2b4e0e[_0x3bff('0x29')](_0x4f6328)[_0x3bff('0x2a')]();};}function respondWithResult(_0x1c0087,_0x4d24f4){_0x4d24f4=_0x4d24f4||0xc8;return function(_0xc3217c){if(_0xc3217c){return _0x1c0087[_0x3bff('0x29')](_0x4d24f4)[_0x3bff('0x2b')](_0xc3217c);}};}function respondWithFilteredResult(_0x1c4f10,_0x5931eb){return function(_0xd3eff){if(_0xd3eff){var _0x3623af=typeof _0x5931eb[_0x3bff('0x2c')]===_0x3bff('0x2d')&&typeof _0x5931eb[_0x3bff('0x2e')]===_0x3bff('0x2d');var _0x4c9142=_0xd3eff[_0x3bff('0x2f')];var _0x56baa0=_0x3623af?0x0:_0x5931eb[_0x3bff('0x2c')];var _0x1a14cf=_0x3623af?_0xd3eff[_0x3bff('0x2f')]:_0x5931eb[_0x3bff('0x2c')]+_0x5931eb[_0x3bff('0x2e')];var _0x597eed;if(_0x1a14cf>=_0x4c9142){_0x1a14cf=_0x4c9142;_0x597eed=0xc8;}else{_0x597eed=0xce;}_0x1c4f10['status'](_0x597eed);return _0x1c4f10[_0x3bff('0x30')](_0x3bff('0x31'),_0x56baa0+'-'+_0x1a14cf+'/'+_0x4c9142)['json'](_0xd3eff);}return null;};}function patchUpdates(_0x1cd4b4){return function(_0x1dec2b){try{jsonpatch[_0x3bff('0x32')](_0x1dec2b,_0x1cd4b4,!![]);}catch(_0x5bc038){return BPromise[_0x3bff('0x33')](_0x5bc038);}return _0x1dec2b['save']();};}function saveUpdates(_0x40e36d,_0x8ea749){return function(_0x2c8f21){if(_0x2c8f21){return _0x2c8f21['update'](_0x40e36d)[_0x3bff('0x1e')](function(_0x51ffce){return _0x51ffce;});}return null;};}function removeEntity(_0x56344a,_0x5604c1){return function(_0x2a431c){if(_0x2a431c){return _0x2a431c[_0x3bff('0x34')]()[_0x3bff('0x1e')](function(){var _0x4a8b63=_0x2a431c[_0x3bff('0x35')]({'plain':!![]});var _0x5730c4=_0x3bff('0x36');return db[_0x3bff('0x37')][_0x3bff('0x34')]({'where':{'type':_0x5730c4,'resourceId':_0x4a8b63['id']}})[_0x3bff('0x1e')](function(){return _0x2a431c;});})[_0x3bff('0x1e')](function(){_0x56344a[_0x3bff('0x29')](0xcc)[_0x3bff('0x2a')]();});}};}function handleEntityNotFound(_0xa173cc,_0x310f25){return function(_0x1b6dc6){if(!_0x1b6dc6){_0xa173cc[_0x3bff('0x28')](0x194);}return _0x1b6dc6;};}function handleError(_0x3f2b9a,_0x44ae56){_0x44ae56=_0x44ae56||0x1f4;return function(_0x5c11cd){logger[_0x3bff('0x23')](_0x5c11cd[_0x3bff('0x38')]);if(_0x5c11cd[_0x3bff('0x39')]){delete _0x5c11cd[_0x3bff('0x39')];}_0x3f2b9a[_0x3bff('0x29')](_0x44ae56)[_0x3bff('0x3a')](_0x5c11cd);};}exports[_0x3bff('0x3b')]=function(_0x35584a,_0x35ce94){var _0x37efe3={'include':[{'model':db[_0x3bff('0x3c')],'as':_0x3bff('0x3d')}]},_0x3c389d={},_0x62707b={'count':0x0,'rows':[]};var _0x57b7c8=_[_0x3bff('0x3e')](db[_0x3bff('0x3f')][_0x3bff('0x40')],function(_0x2ed700){return{'name':_0x2ed700[_0x3bff('0x41')],'type':_0x2ed700[_0x3bff('0x42')][_0x3bff('0x43')]};});_0x3c389d[_0x3bff('0x44')]=_[_0x3bff('0x3e')](_0x57b7c8,_0x3bff('0x39'));_0x3c389d[_0x3bff('0x45')]=_[_0x3bff('0x46')](_0x35584a[_0x3bff('0x45')]);_0x3c389d[_0x3bff('0x47')]=_[_0x3bff('0x48')](_0x3c389d[_0x3bff('0x44')],_0x3c389d[_0x3bff('0x45')]);_0x37efe3[_0x3bff('0x49')]=_['intersection'](_0x3c389d[_0x3bff('0x44')],qs[_0x3bff('0x4a')](_0x35584a[_0x3bff('0x45')]['fields']));_0x37efe3[_0x3bff('0x49')]=_0x37efe3[_0x3bff('0x49')][_0x3bff('0x4b')]?_0x37efe3[_0x3bff('0x49')]:_0x3c389d[_0x3bff('0x44')];if(!_0x35584a[_0x3bff('0x45')][_0x3bff('0x4c')](_0x3bff('0x4d'))){_0x37efe3[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x35584a[_0x3bff('0x45')]['limit']);_0x37efe3[_0x3bff('0x2c')]=qs[_0x3bff('0x2c')](_0x35584a['query'][_0x3bff('0x2c')]);}_0x37efe3[_0x3bff('0x4e')]=qs['sort'](_0x35584a[_0x3bff('0x45')][_0x3bff('0x4f')]);_0x37efe3[_0x3bff('0x50')]=qs[_0x3bff('0x47')](_[_0x3bff('0x51')](_0x35584a[_0x3bff('0x45')],_0x3c389d['filters']),_0x57b7c8);if(_0x35584a[_0x3bff('0x45')]['filter']){_0x37efe3['where']=_[_0x3bff('0x52')](_0x37efe3[_0x3bff('0x50')],{'$or':_[_0x3bff('0x3e')](_0x57b7c8,function(_0x370c2e){if(_0x370c2e[_0x3bff('0x42')]!==_0x3bff('0x53')){var _0x4e41d6={};_0x4e41d6[_0x370c2e[_0x3bff('0x39')]]={'$like':'%'+_0x35584a['query'][_0x3bff('0x54')]+'%'};return _0x4e41d6;}})});}_0x37efe3=_[_0x3bff('0x52')]({},_0x37efe3,_0x35584a[_0x3bff('0x55')]);var _0x483cd5={'where':_0x37efe3[_0x3bff('0x50')]};return db[_0x3bff('0x3f')][_0x3bff('0x2f')](_0x483cd5)[_0x3bff('0x1e')](function(_0x2451a9){_0x62707b[_0x3bff('0x2f')]=_0x2451a9;if(_0x35584a[_0x3bff('0x45')][_0x3bff('0x56')]){_0x37efe3[_0x3bff('0x57')]=[{'all':!![]}];}return db[_0x3bff('0x3f')][_0x3bff('0x58')](_0x37efe3);})[_0x3bff('0x1e')](function(_0x4390d6){_0x62707b[_0x3bff('0x59')]=_0x4390d6;return _0x62707b;})[_0x3bff('0x1e')](respondWithFilteredResult(_0x35ce94,_0x37efe3))['catch'](handleError(_0x35ce94,null));};exports[_0x3bff('0x5a')]=function(_0x2198f9,_0x3cb96e){var _0x344f02={'raw':![],'where':{'id':_0x2198f9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1257d3={};_0x1257d3[_0x3bff('0x44')]=_[_0x3bff('0x46')](db['FaxAccount'][_0x3bff('0x40')]);_0x1257d3[_0x3bff('0x45')]=_['keys'](_0x2198f9[_0x3bff('0x45')]);_0x1257d3['filters']=_[_0x3bff('0x48')](_0x1257d3[_0x3bff('0x44')],_0x1257d3['query']);_0x344f02[_0x3bff('0x49')]=_[_0x3bff('0x48')](_0x1257d3['model'],qs[_0x3bff('0x4a')](_0x2198f9[_0x3bff('0x45')][_0x3bff('0x4a')]));_0x344f02['attributes']=_0x344f02['attributes']['length']?_0x344f02[_0x3bff('0x49')]:_0x1257d3[_0x3bff('0x44')];if(_0x2198f9[_0x3bff('0x45')][_0x3bff('0x56')]){_0x344f02[_0x3bff('0x57')]=[{'all':!![]}];}_0x344f02=_['merge']({},_0x344f02,_0x2198f9[_0x3bff('0x55')]);return db[_0x3bff('0x3f')][_0x3bff('0x5b')](_0x344f02)[_0x3bff('0x1e')](handleEntityNotFound(_0x3cb96e,null))[_0x3bff('0x1e')](respondWithResult(_0x3cb96e,null))['catch'](handleError(_0x3cb96e,null));};exports[_0x3bff('0x5c')]=function(_0xe64177,_0x42094d){return db['FaxAccount']['create'](_0xe64177[_0x3bff('0x5d')],{})[_0x3bff('0x1e')](function(_0x5a6e3e){var _0x190ff1=_0xe64177[_0x3bff('0x5e')][_0x3bff('0x35')]({'plain':!![]});if(!_0x190ff1)throw new Error(_0x3bff('0x5f'));if(_0x190ff1['role']===_0x3bff('0x5e')){var _0x35a030=_0x5a6e3e[_0x3bff('0x35')]({'plain':!![]});var _0x5a2378=_0x3bff('0x36');return db[_0x3bff('0x60')]['find']({'where':{'name':_0x5a2378,'userProfileId':_0x190ff1['userProfileId']},'raw':!![]})[_0x3bff('0x1e')](function(_0x5bfbe3){if(_0x5bfbe3&&_0x5bfbe3[_0x3bff('0x61')]===0x0){return db[_0x3bff('0x37')]['create']({'name':_0x35a030['name'],'resourceId':_0x35a030['id'],'type':_0x5bfbe3[_0x3bff('0x39')],'sectionId':_0x5bfbe3['id']},{})['then'](function(){return _0x5a6e3e;});}else{return _0x5a6e3e;}})[_0x3bff('0x62')](function(_0x1a02a4){logger[_0x3bff('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a02a4);throw _0x1a02a4;});}return _0x5a6e3e;})['then'](respondWithResult(_0x42094d,0xc9))['catch'](handleError(_0x42094d,null));};exports[_0x3bff('0x63')]=function(_0x4a76f7,_0x195e53){if(_0x4a76f7[_0x3bff('0x5d')]['id']){delete _0x4a76f7[_0x3bff('0x5d')]['id'];}return db[_0x3bff('0x3f')]['find']({'where':{'id':_0x4a76f7[_0x3bff('0x64')]['id']},'include':[{'model':db[_0x3bff('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x3bff('0x1e')](handleEntityNotFound(_0x195e53,null))[_0x3bff('0x1e')](saveUpdates(_0x4a76f7[_0x3bff('0x5d')],null))['then'](respondWithResult(_0x195e53,null))['catch'](handleError(_0x195e53,null));};exports[_0x3bff('0x34')]=function(_0x20fa43,_0x360f8f){return db[_0x3bff('0x3f')][_0x3bff('0x5b')]({'where':{'id':_0x20fa43[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x360f8f,null))[_0x3bff('0x1e')](removeEntity(_0x360f8f,null))[_0x3bff('0x62')](handleError(_0x360f8f,null));};exports[_0x3bff('0x65')]=function(_0x3c1622,_0x2ad7c6){return db[_0x3bff('0x3f')][_0x3bff('0x65')]()[_0x3bff('0x1e')](respondWithResult(_0x2ad7c6,null))[_0x3bff('0x62')](handleError(_0x2ad7c6,null));};exports[_0x3bff('0x66')]=function(_0x2771fd,_0x3e4515,_0x3b3f3e){if(_0x2771fd[_0x3bff('0x5d')]['id']){delete _0x2771fd[_0x3bff('0x5d')]['id'];}return db[_0x3bff('0x3f')][_0x3bff('0x5b')]({'where':{'id':_0x2771fd['params']['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x3e4515,null))[_0x3bff('0x1e')](function(_0x26ea60){if(_0x26ea60){_0x2771fd[_0x3bff('0x5d')]['FaxAccountId']=_0x26ea60['id'];return db['Disposition']['create'](_0x2771fd[_0x3bff('0x5d')]);}})[_0x3bff('0x1e')](respondWithResult(_0x3e4515,null))['catch'](handleError(_0x3e4515,null));};exports[_0x3bff('0x67')]=function(_0x4ba848,_0x33c8f4,_0xc7a203){var _0x54ce5a={'raw':![],'where':{}};var _0x2295f9={};var _0xef678={'count':0x0,'rows':[]};return db[_0x3bff('0x3f')][_0x3bff('0x68')]({'where':{'id':_0x4ba848['params']['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x33c8f4,null))[_0x3bff('0x1e')](function(_0x2ed2d3){if(_0x2ed2d3){_0x2295f9[_0x3bff('0x44')]=_['keys'](db['Disposition'][_0x3bff('0x40')]);_0x2295f9[_0x3bff('0x45')]=_[_0x3bff('0x46')](_0x4ba848['query']);_0x2295f9[_0x3bff('0x47')]=_[_0x3bff('0x48')](_0x2295f9['model'],_0x2295f9[_0x3bff('0x45')]);_0x54ce5a[_0x3bff('0x49')]=_['intersection'](_0x2295f9[_0x3bff('0x44')],qs['fields'](_0x4ba848[_0x3bff('0x45')]['fields']));_0x54ce5a[_0x3bff('0x49')]=_0x54ce5a[_0x3bff('0x49')][_0x3bff('0x4b')]?_0x54ce5a[_0x3bff('0x49')]:_0x2295f9[_0x3bff('0x44')];if(!_0x4ba848[_0x3bff('0x45')][_0x3bff('0x4c')](_0x3bff('0x4d'))){_0x54ce5a[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x4ba848[_0x3bff('0x45')][_0x3bff('0x2e')]);_0x54ce5a[_0x3bff('0x2c')]=qs[_0x3bff('0x2c')](_0x4ba848['query'][_0x3bff('0x2c')]);}_0x54ce5a[_0x3bff('0x4e')]=qs[_0x3bff('0x4f')](_0x4ba848[_0x3bff('0x45')][_0x3bff('0x4f')]);_0x54ce5a[_0x3bff('0x50')]=qs[_0x3bff('0x47')](_[_0x3bff('0x51')](_0x4ba848['query'],_0x2295f9['filters']));_0x54ce5a['where'][_0x3bff('0x69')]=_0x2ed2d3['id'];if(_0x4ba848[_0x3bff('0x45')][_0x3bff('0x54')]){_0x54ce5a['where']=_[_0x3bff('0x52')](_0x54ce5a[_0x3bff('0x50')],{'$or':_['map'](_0x54ce5a['attributes'],function(_0x5e43dd){var _0x19b681={};_0x19b681[_0x5e43dd]={'$like':'%'+_0x4ba848['query'][_0x3bff('0x54')]+'%'};return _0x19b681;})});}_0x54ce5a=_['merge']({},_0x54ce5a,_0x4ba848[_0x3bff('0x55')]);return db[_0x3bff('0x6a')][_0x3bff('0x2f')]({'where':_0x54ce5a[_0x3bff('0x50')]})[_0x3bff('0x1e')](function(_0x390d1d){_0xef678['count']=_0x390d1d;if(_0x4ba848[_0x3bff('0x45')]['includeAll']){_0x54ce5a[_0x3bff('0x57')]=[{'all':!![]}];}return db[_0x3bff('0x6a')][_0x3bff('0x58')](_0x54ce5a);})[_0x3bff('0x1e')](function(_0x3eb45f){_0xef678[_0x3bff('0x59')]=_0x3eb45f;return _0xef678;});}})[_0x3bff('0x1e')](respondWithFilteredResult(_0x33c8f4,_0x54ce5a))[_0x3bff('0x62')](handleError(_0x33c8f4,null));};exports[_0x3bff('0x6b')]=function(_0x17af0a,_0x10f1e7,_0x13f17f){return db[_0x3bff('0x3f')]['find']({'where':{'id':_0x17af0a[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x10f1e7,null))[_0x3bff('0x1e')](function(_0x54fcfa){if(_0x54fcfa){return _0x54fcfa['removeDispositions'](_0x17af0a[_0x3bff('0x45')][_0x3bff('0x6c')]);}})['then'](respondWithStatusCode(_0x10f1e7,null))[_0x3bff('0x62')](handleError(_0x10f1e7,null));};exports[_0x3bff('0x6d')]=function(_0x5cf18e,_0x3d18ce,_0x245674){if(_0x5cf18e['body']['id']){delete _0x5cf18e[_0x3bff('0x5d')]['id'];}return db[_0x3bff('0x3f')][_0x3bff('0x5b')]({'where':{'id':_0x5cf18e[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x3d18ce,null))[_0x3bff('0x1e')](function(_0x3ca97f){if(_0x3ca97f){_0x5cf18e[_0x3bff('0x5d')][_0x3bff('0x69')]=_0x3ca97f['id'];return db[_0x3bff('0x6e')][_0x3bff('0x5c')](_0x5cf18e[_0x3bff('0x5d')]);}})[_0x3bff('0x1e')](respondWithResult(_0x3d18ce,null))['catch'](handleError(_0x3d18ce,null));};exports['getAnswers']=function(_0x4792a4,_0xb27548,_0x5ce4d7){var _0x26ffde={'raw':![],'where':{}};var _0x231e0d={};var _0x1c8326={'count':0x0,'rows':[]};return db[_0x3bff('0x3f')][_0x3bff('0x68')]({'where':{'id':_0x4792a4[_0x3bff('0x64')]['id']}})['then'](handleEntityNotFound(_0xb27548,null))[_0x3bff('0x1e')](function(_0x187fad){if(_0x187fad){_0x231e0d['model']=_[_0x3bff('0x46')](db['CannedAnswer']['rawAttributes']);_0x231e0d['query']=_[_0x3bff('0x46')](_0x4792a4[_0x3bff('0x45')]);_0x231e0d['filters']=_['intersection'](_0x231e0d[_0x3bff('0x44')],_0x231e0d[_0x3bff('0x45')]);_0x26ffde['attributes']=_[_0x3bff('0x48')](_0x231e0d[_0x3bff('0x44')],qs['fields'](_0x4792a4[_0x3bff('0x45')]['fields']));_0x26ffde[_0x3bff('0x49')]=_0x26ffde[_0x3bff('0x49')][_0x3bff('0x4b')]?_0x26ffde[_0x3bff('0x49')]:_0x231e0d[_0x3bff('0x44')];if(!_0x4792a4[_0x3bff('0x45')][_0x3bff('0x4c')](_0x3bff('0x4d'))){_0x26ffde[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x4792a4['query'][_0x3bff('0x2e')]);_0x26ffde['offset']=qs[_0x3bff('0x2c')](_0x4792a4['query']['offset']);}_0x26ffde[_0x3bff('0x4e')]=qs[_0x3bff('0x4f')](_0x4792a4[_0x3bff('0x45')]['sort']);_0x26ffde[_0x3bff('0x50')]=qs['filters'](_[_0x3bff('0x51')](_0x4792a4[_0x3bff('0x45')],_0x231e0d['filters']));_0x26ffde[_0x3bff('0x50')][_0x3bff('0x69')]=_0x187fad['id'];if(_0x4792a4['query'][_0x3bff('0x54')]){_0x26ffde[_0x3bff('0x50')]=_['merge'](_0x26ffde[_0x3bff('0x50')],{'$or':_['map'](_0x26ffde[_0x3bff('0x49')],function(_0x3a086b){var _0x3761b0={};_0x3761b0[_0x3a086b]={'$like':'%'+_0x4792a4[_0x3bff('0x45')][_0x3bff('0x54')]+'%'};return _0x3761b0;})});}_0x26ffde=_['merge']({},_0x26ffde,_0x4792a4[_0x3bff('0x55')]);return db['CannedAnswer']['count']({'where':_0x26ffde[_0x3bff('0x50')]})[_0x3bff('0x1e')](function(_0x2f3363){_0x1c8326[_0x3bff('0x2f')]=_0x2f3363;if(_0x4792a4[_0x3bff('0x45')][_0x3bff('0x56')]){_0x26ffde['include']=[{'all':!![]}];}return db[_0x3bff('0x6e')][_0x3bff('0x58')](_0x26ffde);})['then'](function(_0x3922bf){_0x1c8326[_0x3bff('0x59')]=_0x3922bf;return _0x1c8326;});}})[_0x3bff('0x1e')](respondWithFilteredResult(_0xb27548,_0x26ffde))['catch'](handleError(_0xb27548,null));};exports[_0x3bff('0x6f')]=function(_0x34c2a2,_0x3bbe6b,_0x111b88){return db[_0x3bff('0x3f')]['find']({'where':{'id':_0x34c2a2['params']['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x3bbe6b,null))[_0x3bff('0x1e')](function(_0x4ef5a9){if(_0x4ef5a9){return _0x4ef5a9[_0x3bff('0x6f')](_0x34c2a2[_0x3bff('0x45')][_0x3bff('0x6c')]);}})[_0x3bff('0x1e')](respondWithStatusCode(_0x3bbe6b,null))[_0x3bff('0x62')](handleError(_0x3bbe6b,null));};exports[_0x3bff('0x70')]=function(_0xb4725,_0x53dbf4,_0x453223){return db['FaxInteraction'][_0x3bff('0x5b')]({'where':{'id':_0xb4725[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x53dbf4,null))[_0x3bff('0x1e')](function(_0x5e7913){if(_0x5e7913){return _0x5e7913[_0x3bff('0x70')](_0xb4725[_0x3bff('0x5d')][_0x3bff('0x6c')],_[_0x3bff('0x71')](_0xb4725[_0x3bff('0x5d')],[_0x3bff('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x53dbf4,null))[_0x3bff('0x62')](handleError(_0x53dbf4,null));};exports[_0x3bff('0x72')]=function(_0x3ec0cf,_0xb8a896,_0x3211d6){var _0x4a597e={'raw':![],'where':{}};var _0x169eaa={};var _0xb33c10={'count':0x0,'rows':[]};return db[_0x3bff('0x3f')][_0x3bff('0x68')]({'where':{'id':_0x3ec0cf[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0xb8a896,null))[_0x3bff('0x1e')](function(_0x763658){if(_0x763658){_0x169eaa['model']=_[_0x3bff('0x46')](db[_0x3bff('0x73')][_0x3bff('0x40')]);_0x169eaa[_0x3bff('0x45')]=_[_0x3bff('0x46')](_0x3ec0cf[_0x3bff('0x45')]);_0x169eaa[_0x3bff('0x47')]=_[_0x3bff('0x48')](_0x169eaa[_0x3bff('0x44')],_0x169eaa[_0x3bff('0x45')]);_0x4a597e[_0x3bff('0x49')]=_[_0x3bff('0x48')](_0x169eaa[_0x3bff('0x44')],qs['fields'](_0x3ec0cf[_0x3bff('0x45')][_0x3bff('0x4a')]));_0x4a597e[_0x3bff('0x49')]=_0x4a597e[_0x3bff('0x49')][_0x3bff('0x4b')]?_0x4a597e['attributes']:_0x169eaa[_0x3bff('0x44')];if(!_0x3ec0cf['query'][_0x3bff('0x4c')]('nolimit')){_0x4a597e[_0x3bff('0x2e')]=qs['limit'](_0x3ec0cf[_0x3bff('0x45')]['limit']);_0x4a597e[_0x3bff('0x2c')]=qs[_0x3bff('0x2c')](_0x3ec0cf[_0x3bff('0x45')]['offset']);}_0x4a597e['order']=qs['sort'](_0x3ec0cf['query'][_0x3bff('0x4f')]);_0x4a597e[_0x3bff('0x50')]=qs['filters'](_[_0x3bff('0x51')](_0x3ec0cf[_0x3bff('0x45')],_0x169eaa[_0x3bff('0x47')]));_0x4a597e['where']['FaxAccountId']=_0x763658['id'];if(_0x3ec0cf[_0x3bff('0x45')][_0x3bff('0x54')]){_0x4a597e[_0x3bff('0x50')]=_[_0x3bff('0x52')](_0x4a597e['where'],{'$or':_[_0x3bff('0x3e')](_0x4a597e[_0x3bff('0x49')],function(_0x53a858){var _0x14e284={};_0x14e284[_0x53a858]={'$like':'%'+_0x3ec0cf[_0x3bff('0x45')]['filter']+'%'};return _0x14e284;})});}_0x4a597e=_[_0x3bff('0x52')]({},_0x4a597e,_0x3ec0cf[_0x3bff('0x55')]);return db[_0x3bff('0x73')][_0x3bff('0x2f')]({'where':_0x4a597e['where']})[_0x3bff('0x1e')](function(_0x1ca321){_0xb33c10[_0x3bff('0x2f')]=_0x1ca321;if(_0x3ec0cf[_0x3bff('0x45')][_0x3bff('0x56')]){_0x4a597e[_0x3bff('0x57')]=[{'model':db[_0x3bff('0x74')],'as':_0x3bff('0x75'),'required':![]},{'model':db[_0x3bff('0x76')],'as':_0x3bff('0x77'),'attributes':[_0x3bff('0x39'),_0x3bff('0x78'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x3bff('0x79'),'attributes':['id',_0x3bff('0x39'),_0x3bff('0x7a')],'where':_0x3ec0cf['query'][_0x3bff('0x7b')]?{'id':_0x3ec0cf[_0x3bff('0x45')][_0x3bff('0x7b')]}:undefined,'required':_0x3ec0cf['query']['tag']?!![]:![]}];}return db[_0x3bff('0x73')][_0x3bff('0x58')](_0x4a597e);})[_0x3bff('0x1e')](function(_0x3077ca){_0xb33c10[_0x3bff('0x59')]=_0x3077ca;return _0xb33c10;});}})['then'](respondWithFilteredResult(_0xb8a896,_0x4a597e))['catch'](handleError(_0xb8a896,null));};exports['addApplications']=function(_0x434ed9,_0x4cd0ad){var _0x4b9cb8=_0x434ed9[_0x3bff('0x64')]['id'];var _0x294135=_0x434ed9[_0x3bff('0x5d')];var _0x5dc558=0xc8;var _0x37fc2c=null;return db[_0x3bff('0x7c')][_0x3bff('0x7d')]({'isolationLevel':db[_0x3bff('0x7c')][_0x3bff('0x7e')][_0x3bff('0x7f')][_0x3bff('0x80')]},function(_0x403b09){return db['FaxAccount']['findOne']({'where':{'id':_0x4b9cb8},'transaction':_0x403b09})[_0x3bff('0x1e')](function(_0x34563f){if(_0x34563f){return db[_0x3bff('0x81')][_0x3bff('0x34')]({'where':{'FaxAccountId':_0x4b9cb8},'transaction':_0x403b09})[_0x3bff('0x1e')](function(){var _0x864e65=_[_0x3bff('0x3e')](_0x294135,function(_0x4dc9d0){_0x4dc9d0['FaxAccountId']=_0x4b9cb8;return _0x4dc9d0;});return db[_0x3bff('0x81')][_0x3bff('0x82')](_0x864e65,{'transaction':_0x403b09});});}else{_0x5dc558=0x194;_0x37fc2c=[];}});})[_0x3bff('0x1e')](function(){if(_0x5dc558!==0x194){return db[_0x3bff('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x4b9cb8},'order':_0x3bff('0x83')})[_0x3bff('0x1e')](function(_0x3ab40b){_0x37fc2c=_0x3ab40b;});}})[_0x3bff('0x62')](function(_0x416417){_0x5dc558=0x1f4;logger[_0x3bff('0x23')](_0x416417[_0x3bff('0x38')]);if(_0x416417[_0x3bff('0x39')]){delete _0x416417[_0x3bff('0x39')];}_0x37fc2c=_0x416417;})[_0x3bff('0x84')](function(){if(_0x37fc2c===null){_0x4cd0ad[_0x3bff('0x28')](_0x5dc558);}else{if(_0x5dc558===0x1f4){_0x4cd0ad[_0x3bff('0x29')](_0x5dc558)[_0x3bff('0x3a')](_0x37fc2c);}else{_0x4cd0ad['status'](_0x5dc558)['json'](_0x37fc2c);}}});};exports[_0x3bff('0x85')]=function(_0x408abf,_0x2e9d98,_0x434636){var _0x399afa={};var _0x1737e7={};var _0x18c37a;var _0x692870;return db[_0x3bff('0x3f')][_0x3bff('0x68')]({'where':{'id':_0x408abf[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x2e9d98,null))['then'](function(_0x1d12db){if(_0x1d12db){_0x18c37a=_0x1d12db;_0x1737e7[_0x3bff('0x44')]=_[_0x3bff('0x46')](db[_0x3bff('0x81')][_0x3bff('0x40')]);_0x1737e7['query']=_['keys'](_0x408abf['query']);_0x1737e7['filters']=_['intersection'](_0x1737e7[_0x3bff('0x44')],_0x1737e7[_0x3bff('0x45')]);_0x399afa[_0x3bff('0x49')]=_[_0x3bff('0x48')](_0x1737e7[_0x3bff('0x44')],qs[_0x3bff('0x4a')](_0x408abf[_0x3bff('0x45')]['fields']));_0x399afa[_0x3bff('0x49')]=_0x399afa[_0x3bff('0x49')]['length']?_0x399afa[_0x3bff('0x49')]:_0x1737e7[_0x3bff('0x44')];_0x399afa['order']=qs[_0x3bff('0x4f')](_0x408abf[_0x3bff('0x45')]['sort']);_0x399afa[_0x3bff('0x50')]=qs['filters'](_['pick'](_0x408abf['query'],_0x1737e7['filters']));if(_0x408abf[_0x3bff('0x45')][_0x3bff('0x54')]){_0x399afa[_0x3bff('0x50')]=_[_0x3bff('0x52')](_0x399afa[_0x3bff('0x50')],{'$or':_[_0x3bff('0x3e')](_0x399afa[_0x3bff('0x49')],function(_0x336f91){var _0x4b89f6={};_0x4b89f6[_0x336f91]={'$like':'%'+_0x408abf[_0x3bff('0x45')]['filter']+'%'};return _0x4b89f6;})});}_0x399afa=_[_0x3bff('0x52')]({},_0x399afa,_0x408abf['options']);return _0x18c37a[_0x3bff('0x85')](_0x399afa);}})['then'](function(_0x1180a4){if(_0x1180a4){_0x692870=_0x1180a4['length'];if(!_0x408abf[_0x3bff('0x45')][_0x3bff('0x4c')](_0x3bff('0x4d'))){_0x399afa[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x408abf[_0x3bff('0x45')]['limit']);_0x399afa[_0x3bff('0x2c')]=qs['offset'](_0x408abf[_0x3bff('0x45')][_0x3bff('0x2c')]);}return _0x18c37a['getApplications'](_0x399afa);}})[_0x3bff('0x1e')](function(_0x5519fc){if(_0x5519fc){return _0x5519fc?{'count':_0x692870,'rows':_0x5519fc}:null;}})[_0x3bff('0x1e')](respondWithResult(_0x2e9d98,null))['catch'](handleError(_0x2e9d98,null));};function Extension(_0x5f4c53,_0x21072f,_0x59d011,_0xbc37c7){this['context']='from-voip-provider';this['exten']=_0x5f4c53[_0x3bff('0x86')];this['app']=_0xbc37c7;this[_0x3bff('0x42')]=_0x3bff('0x87');this[_0x3bff('0x88')]=_0x3bff('0x89');this['FaxAccountId']=_0x5f4c53['id'];this[_0x3bff('0x83')]=_0x21072f;this[_0x3bff('0x8a')]=_0x59d011;}function createExtensionsReciveFax(_0x4d0682){var _0x32faff=0x1;var _0x1aebd8=[];_0x1aebd8[_0x3bff('0x8b')](new Extension(_0x4d0682,_0x32faff,'',_0x3bff('0x8c')));_0x32faff+=0x1;_0x1aebd8[_0x3bff('0x8b')](new Extension(_0x4d0682,_0x32faff,_0x3bff('0x8d'),_0x3bff('0x8e')));_0x32faff+=0x1;for(var _0x10ded3 in _0x4d0682){if(_0x4d0682[_0x3bff('0x4c')](_0x10ded3)&&(_0x10ded3==='ecm'||_0x10ded3==='localstationid'||_0x10ded3===_0x3bff('0x8f')||_0x10ded3===_0x3bff('0x90')||_0x10ded3===_0x3bff('0x91')||_0x10ded3==='maxrate'||_0x10ded3===_0x3bff('0x92')||_0x10ded3==='modem'||_0x10ded3===_0x3bff('0x93'))){_0x1aebd8[_0x3bff('0x8b')](new Extension(_0x4d0682,_0x32faff,_0x3bff('0x94')+_0x10ded3+')='+_0x4d0682[_0x10ded3],_0x3bff('0x8e')));_0x32faff+=0x1;}}_0x1aebd8['push'](new Extension(_0x4d0682,_0x32faff,'6','Wait'));_0x32faff+=0x1;_0x1aebd8[_0x3bff('0x8b')](new Extension(_0x4d0682,_0x32faff,'/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',_0x3bff('0x95')));_0x32faff=0x0;return _0x1aebd8;}exports[_0x3bff('0x96')]=function(_0x1f9434,_0x1aae7e,_0x274f18){var _0x4e1ead;return db['sequelize'][_0x3bff('0x7d')](function(_0x352e1f){return db[_0x3bff('0x3f')][_0x3bff('0x5c')](_0x1f9434['body'],{'transaction':_0x352e1f})[_0x3bff('0x1e')](function(_0x423cd6){_0x4e1ead=_0x423cd6[_0x3bff('0x35')]({'plain':!![]});return db[_0x3bff('0x97')][_0x3bff('0x82')](createExtensionsReciveFax(_0x4e1ead),{'transaction':_0x352e1f});});})[_0x3bff('0x1e')](function(){return _0x4e1ead;})['then'](respondWithResult(_0x1aae7e,null))[_0x3bff('0x62')](handleError(_0x1aae7e,null));};exports[_0x3bff('0x98')]=function(_0x546520,_0x1ac973,_0x4f93a4){var _0x466d12;return db['sequelize'][_0x3bff('0x7d')](function(_0x183a76){return db[_0x3bff('0x3f')][_0x3bff('0x63')](_0x546520[_0x3bff('0x5d')],{'where':{'id':_0x546520[_0x3bff('0x5d')]['id']},'transaction':_0x183a76})[_0x3bff('0x1e')](function(_0x51151b){return db[_0x3bff('0x97')]['destroy']({'where':{'FaxAccountId':_0x546520['body']['id']},'transaction':_0x183a76})[_0x3bff('0x1e')](function(_0x143cff){return db['VoiceExtension'][_0x3bff('0x82')](createExtensionsReciveFax(_[_0x3bff('0x71')](_0x546520[_0x3bff('0x5d')],[_0x3bff('0x99'),_0x3bff('0x43'),'createdAt',_0x3bff('0x9a'),_0x3bff('0x9b'),_0x3bff('0x9c')])),{'transaction':_0x183a76});});});})[_0x3bff('0x1e')](function(){return db[_0x3bff('0x3f')][_0x3bff('0x9d')](_0x546520[_0x3bff('0x5d')]['id']);})[_0x3bff('0x1e')](respondWithResult(_0x1ac973,null))[_0x3bff('0x62')](handleError(_0x1ac973,null));};exports['getMessages']=function(_0x23a061,_0x30d91a,_0x524439){var _0x3f6604={'raw':!![],'where':{}};var _0x1f8636={};var _0x1de080={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3bff('0x68')]({'where':{'id':_0x23a061[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x30d91a,null))[_0x3bff('0x1e')](function(_0x10701d){if(_0x10701d){_0x1f8636[_0x3bff('0x44')]=_['keys'](db['FaxMessage'][_0x3bff('0x40')]);_0x1f8636[_0x3bff('0x45')]=_['keys'](_0x23a061['query']);_0x1f8636[_0x3bff('0x47')]=_['intersection'](_0x1f8636[_0x3bff('0x44')],_0x1f8636['query']);_0x3f6604[_0x3bff('0x49')]=_['intersection'](_0x1f8636['model'],qs[_0x3bff('0x4a')](_0x23a061['query']['fields']));_0x3f6604[_0x3bff('0x49')]=_0x3f6604[_0x3bff('0x49')][_0x3bff('0x4b')]?_0x3f6604[_0x3bff('0x49')]:_0x1f8636[_0x3bff('0x44')];if(!_0x23a061[_0x3bff('0x45')]['hasOwnProperty'](_0x3bff('0x4d'))){_0x3f6604[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x23a061[_0x3bff('0x45')][_0x3bff('0x2e')]);_0x3f6604[_0x3bff('0x2c')]=qs[_0x3bff('0x2c')](_0x23a061[_0x3bff('0x45')][_0x3bff('0x2c')]);}_0x3f6604[_0x3bff('0x4e')]=qs[_0x3bff('0x4f')](_0x23a061[_0x3bff('0x45')][_0x3bff('0x4f')]);_0x3f6604[_0x3bff('0x50')]=qs[_0x3bff('0x47')](_['pick'](_0x23a061[_0x3bff('0x45')],_0x1f8636[_0x3bff('0x47')]));_0x3f6604['where'][_0x3bff('0x69')]=_0x10701d['id'];if(_0x23a061[_0x3bff('0x45')][_0x3bff('0x54')]){_0x3f6604[_0x3bff('0x50')]=_['merge'](_0x3f6604['where'],{'$or':_[_0x3bff('0x3e')](_0x3f6604['attributes'],function(_0x15d3c0){var _0x3e6cd3={};_0x3e6cd3[_0x15d3c0]={'$like':'%'+_0x23a061[_0x3bff('0x45')][_0x3bff('0x54')]+'%'};return _0x3e6cd3;})});}if(_0x23a061[_0x3bff('0x45')]['$gte']){var _0x152867=_0x23a061['query']['$gte'][_0x3bff('0x9e')](',');var _0x5aade7={};_0x5aade7[_0x152867[0x0]]={'$gte':moment(_0x152867[0x1])[_0x3bff('0x9f')](_0x3bff('0xa0'))};_0x3f6604[_0x3bff('0x50')]=_[_0x3bff('0x52')](_0x3f6604[_0x3bff('0x50')],_0x5aade7);}_0x3f6604=_[_0x3bff('0x52')]({},_0x3f6604,_0x23a061[_0x3bff('0x55')]);return db[_0x3bff('0xa1')][_0x3bff('0x2f')]({'where':_0x3f6604[_0x3bff('0x50')]})[_0x3bff('0x1e')](function(_0x459586){_0x1de080[_0x3bff('0x2f')]=_0x459586;if(_0x23a061[_0x3bff('0x45')]['includeAll']){_0x3f6604[_0x3bff('0x57')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3f6604);})[_0x3bff('0x1e')](function(_0x2f11ea){_0x1de080[_0x3bff('0x59')]=_0x2f11ea;return _0x1de080;});}})[_0x3bff('0x1e')](respondWithFilteredResult(_0x30d91a,_0x3f6604))[_0x3bff('0x62')](handleError(_0x30d91a,null));};exports[_0x3bff('0x3a')]=function(_0x367f55,_0x157583,_0x5ba0ad){var _0xecbab3,_0x13e075={},_0x197d0c;if(_0x367f55[_0x3bff('0x5d')]['to']){_0x197d0c=_0x367f55[_0x3bff('0x5d')]['to'][0x0];}return db[_0x3bff('0x3f')]['find']({'where':{'id':_0x367f55[_0x3bff('0x64')]['id']},'include':[{'model':db[_0x3bff('0xa2')],'as':_0x3bff('0xa3'),'include':[{'model':db['CmContact'],'as':_0x3bff('0xa4'),'where':{'fax':_0x197d0c},'limit':0x1,'order':[[_0x3bff('0x9a'),'DESC']]}]}]})[_0x3bff('0x1e')](handleEntityNotFound(_0x157583,null))[_0x3bff('0x1e')](function(_0x2cc26e){_0xecbab3=_0x2cc26e;if(_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')]&&_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][_0x3bff('0x4b')]){for(var _0x23ebb4=0x0;_0x23ebb4<_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')]['length'];_0x23ebb4+=0x1){_0x367f55[_0x3bff('0x5d')]['attachments'][_0x23ebb4]={'filename':_0x367f55['body'][_0x3bff('0xa5')][_0x23ebb4][_0x3bff('0x39')],'id':_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][_0x23ebb4]['id'],'path':path['join'](config[_0x3bff('0xa6')],'server/files/attachments',_0x367f55[_0x3bff('0x5d')]['attachments'][_0x23ebb4][_0x3bff('0xa7')])};}}return respondWithRpcPromise(_0x3bff('0xa8'),_0x3bff('0xa8'),{'FaxAccountId':_['isNil'](_0x367f55[_0x3bff('0x64')]['id'])?undefined:_0x367f55[_0x3bff('0x64')]['id'],'path':_['isNil'](_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][0x0][_0x3bff('0xa9')])?undefined:_0x367f55[_0x3bff('0x5d')]['attachments'][0x0][_0x3bff('0xa9')],'fax':_['isNil'](_0x367f55[_0x3bff('0x5d')]['to'][0x0])?undefined:_0x367f55['body']['to'][0x0]},client9002);})['then'](function(){if(_0xecbab3){if(_[_0x3bff('0xaa')](_0x367f55['body'][_0x3bff('0xab')])){_0x367f55['body']['from']=util[_0x3bff('0x9f')]('\x22%s\x22\x20<%s>',_0xecbab3[_0x3bff('0x39')],_0xecbab3[_0x3bff('0xac')]);}if(_0xecbab3[_0x3bff('0xa3')]){if(_0xecbab3[_0x3bff('0xa3')][_0x3bff('0xa4')][_0x3bff('0x4b')]){return _0xecbab3[_0x3bff('0xa3')]['Contacts'][0x0];}else{return db[_0x3bff('0x74')]['create'](_[_0x3bff('0xad')](_0x367f55[_0x3bff('0x5d')],{'firstName':_0x367f55[_0x3bff('0x5d')]['to'][0x0],'phone':_0x367f55[_0x3bff('0x5d')]['to'][0x0],'fax':_0x367f55[_0x3bff('0x5d')]['to'][0x0],'ListId':_0xecbab3[_0x3bff('0x9c')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x3bff('0xae'));}})['then'](function(_0x1c467c){if(_0x1c467c){return db['FaxInteraction'][_0x3bff('0x5b')]({'where':{'ContactId':_0x1c467c['id'],'closed':![],'FaxAccountId':_0xecbab3['id']}})[_0x3bff('0x1e')](function(_0x346e30){if(_0x346e30){return[_0x346e30,![]];}return db['FaxInteraction']['create']({'UserId':_0x367f55[_0x3bff('0x5e')]['id'],'ContactId':_0x1c467c['id'],'FaxAccountId':_0xecbab3['id'],'fax':_0x367f55['body']['to'][0x0],'firstMsgDirection':_0x3bff('0xaf'),'Messages':[_[_0x3bff('0x52')](_0x367f55[_0x3bff('0x5d')],{'read':![],'body':_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][0x0]['filename'],'FaxAccountId':_0xecbab3['id'],'UserId':_0x367f55[_0x3bff('0x5e')]['id'],'ContactId':_0x1c467c['id'],'AttachmentId':_0x367f55['body'][_0x3bff('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3bff('0xb0')}]})[_0x3bff('0x1e')](function(_0x5a1a4c){return[_0x5a1a4c,!![]];});});}else{throw new Error(_0x3bff('0xb1'));}})[_0x3bff('0xb2')](function(_0x27c739,_0x132b72){if(_0x132b72){return _0x27c739;}return db[_0x3bff('0xa1')][_0x3bff('0x5c')]({'direction':'out','read':![],'body':_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][0x0][_0x3bff('0xb3')],'FaxAccountId':_0xecbab3['id'],'FaxInteractionId':_0x27c739['id'],'UserId':_0x367f55[_0x3bff('0x5e')]['id'],'ContactId':_0x27c739[_0x3bff('0xb4')],'AttachmentId':_0x367f55['body'][_0x3bff('0xa5')][0x0]['id']})['then'](function(_0x41289f){_0x27c739[_0x3bff('0xb5')]['Messages']=[];_0x27c739['dataValues'][_0x3bff('0xb0')][_0x3bff('0x8b')](_0x41289f['dataValues']);return _0x27c739;});})[_0x3bff('0x1e')](function(_0x3adfac){respondWithRpcPromise(_0x3bff('0xb6'),'SendFax',{'FaxAccountId':_[_0x3bff('0xaa')](_0x367f55[_0x3bff('0x64')]['id'])?undefined:_0x367f55[_0x3bff('0x64')]['id'],'path':_[_0x3bff('0xaa')](_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][0x0][_0x3bff('0xa9')])?undefined:_0x367f55[_0x3bff('0x5d')][_0x3bff('0xa5')][0x0][_0x3bff('0xa9')],'fax':_[_0x3bff('0xaa')](_0x367f55[_0x3bff('0x5d')]['to'][0x0])?undefined:_0x367f55[_0x3bff('0x5d')]['to'][0x0],'AttachmentId':_0x367f55['body'][_0x3bff('0xa5')][0x0]['id']},client9002)[_0x3bff('0x1e')](function(_0x3d3b9f){logger[_0x3bff('0x1f')](_0x3bff('0xb7'),_0x3d3b9f);})[_0x3bff('0x62')](function(_0x59a5c3){logger[_0x3bff('0x1f')](_0x3bff('0xb7'),_0x59a5c3);});return _0x3adfac;})[_0x3bff('0x1e')](respondWithResult(_0x157583,null))[_0x3bff('0x62')](handleError(_0x157583,null));};exports['addAgents']=function(_0x2fa3a5,_0x2979d5,_0x37aca5){return db[_0x3bff('0x3f')][_0x3bff('0x5b')]({'where':{'id':_0x2fa3a5[_0x3bff('0x64')]['id']}})['then'](handleEntityNotFound(_0x2979d5,null))[_0x3bff('0x1e')](function(_0x111233){if(_0x111233){return _0x111233[_0x3bff('0xb8')](_0x2fa3a5['body'][_0x3bff('0x6c')],_['omit'](_0x2fa3a5[_0x3bff('0x5d')],[_0x3bff('0x6c'),'id'])||{})[_0x3bff('0xb2')](function(_0x3e153c){for(var _0x3f48e7=0x0;_0x3f48e7<_0x2fa3a5[_0x3bff('0x5d')][_0x3bff('0x6c')][_0x3bff('0x4b')];_0x3f48e7+=0x1){socket[_0x3bff('0xb9')](_0x3bff('0xba'),{'UserId':Number(_0x2fa3a5[_0x3bff('0x5d')][_0x3bff('0x6c')][_0x3f48e7]),'FaxAccountId':Number(_0x2fa3a5[_0x3bff('0x64')]['id'])});}return _0x3e153c;});}})[_0x3bff('0x1e')](respondWithResult(_0x2979d5,null))['catch'](handleError(_0x2979d5,null));};exports[_0x3bff('0xbb')]=function(_0x31c84b,_0x837c67,_0x16f309){return db['FaxAccount'][_0x3bff('0x5b')]({'where':{'id':_0x31c84b[_0x3bff('0x64')]['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x837c67,null))[_0x3bff('0x1e')](function(_0x3ca5a9){if(_0x3ca5a9){return _0x3ca5a9[_0x3bff('0xbb')](_0x31c84b[_0x3bff('0x45')][_0x3bff('0x6c')])[_0x3bff('0x1e')](function(){if(_[_0x3bff('0xbc')](_0x31c84b[_0x3bff('0x45')][_0x3bff('0x6c')])){for(var _0x5d03b7=0x0;_0x5d03b7<_0x31c84b[_0x3bff('0x45')][_0x3bff('0x6c')][_0x3bff('0x4b')];_0x5d03b7+=0x1){socket['emit'](_0x3bff('0xbd'),{'UserId':Number(_0x31c84b['query']['ids'][_0x5d03b7]),'FaxAccountId':Number(_0x31c84b[_0x3bff('0x64')]['id'])});}}else{socket[_0x3bff('0xb9')](_0x3bff('0xbd'),{'UserId':Number(_0x31c84b['query'][_0x3bff('0x6c')]),'FaxAccountId':Number(_0x31c84b[_0x3bff('0x64')]['id'])});}});}})[_0x3bff('0x1e')](respondWithStatusCode(_0x837c67,null))[_0x3bff('0x62')](handleError(_0x837c67,null));};exports[_0x3bff('0xbe')]=function(_0x142ac2,_0x1a30a5,_0x15d2de){var _0x414e39={};var _0x2f6c91={};var _0x4f8fcc;var _0x18cc69;return db[_0x3bff('0x3f')][_0x3bff('0x68')]({'where':{'id':_0x142ac2['params']['id']}})[_0x3bff('0x1e')](handleEntityNotFound(_0x1a30a5,null))[_0x3bff('0x1e')](function(_0x25e39f){if(_0x25e39f){_0x4f8fcc=_0x25e39f;_0x2f6c91[_0x3bff('0x44')]=_[_0x3bff('0x46')](db[_0x3bff('0x76')]['rawAttributes']);_0x2f6c91[_0x3bff('0x45')]=_[_0x3bff('0x46')](_0x142ac2[_0x3bff('0x45')]);_0x2f6c91[_0x3bff('0x47')]=_['intersection'](_0x2f6c91[_0x3bff('0x44')],_0x2f6c91['query']);_0x414e39[_0x3bff('0x49')]=_[_0x3bff('0x48')](_0x2f6c91[_0x3bff('0x44')],qs[_0x3bff('0x4a')](_0x142ac2[_0x3bff('0x45')]['fields']));_0x414e39[_0x3bff('0x49')]=_0x414e39['attributes']['length']?_0x414e39[_0x3bff('0x49')]:_0x2f6c91['model'];_0x414e39['order']=qs['sort'](_0x142ac2[_0x3bff('0x45')][_0x3bff('0x4f')]);_0x414e39[_0x3bff('0x50')]=qs[_0x3bff('0x47')](_[_0x3bff('0x51')](_0x142ac2[_0x3bff('0x45')],_0x2f6c91[_0x3bff('0x47')]));if(_0x142ac2[_0x3bff('0x45')]['filter']){_0x414e39[_0x3bff('0x50')]=_[_0x3bff('0x52')](_0x414e39[_0x3bff('0x50')],{'$or':_[_0x3bff('0x3e')](_0x414e39[_0x3bff('0x49')],function(_0x1d1ac2){var _0x532077={};_0x532077[_0x1d1ac2]={'$like':'%'+_0x142ac2['query'][_0x3bff('0x54')]+'%'};return _0x532077;})});}_0x414e39=_[_0x3bff('0x52')]({},_0x414e39,_0x142ac2['options']);return _0x4f8fcc[_0x3bff('0xbe')](_0x414e39);}})[_0x3bff('0x1e')](function(_0x545377){if(_0x545377){_0x18cc69=_0x545377[_0x3bff('0x4b')];if(!_0x142ac2[_0x3bff('0x45')][_0x3bff('0x4c')]('nolimit')){_0x414e39[_0x3bff('0x2e')]=qs[_0x3bff('0x2e')](_0x142ac2[_0x3bff('0x45')]['limit']);_0x414e39[_0x3bff('0x2c')]=qs['offset'](_0x142ac2[_0x3bff('0x45')][_0x3bff('0x2c')]);}return _0x4f8fcc[_0x3bff('0xbe')](_0x414e39);}})[_0x3bff('0x1e')](function(_0x912afa){if(_0x912afa){return _0x912afa?{'count':_0x18cc69,'rows':_0x912afa}:null;}})[_0x3bff('0x1e')](respondWithResult(_0x1a30a5,null))[_0x3bff('0x62')](handleError(_0x1a30a5,null));}; \ No newline at end of file +var _0x155f=['register','jayson/promise','client','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','show','mandatoryDispositionPause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','maxrate','minrate','FAXOPT(','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','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','DESC','attachments','join','root','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','ListId','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','getAgents','eml-format','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0x43f748,_0x2afb5f){var _0x2b6349=function(_0x26c642){while(--_0x26c642){_0x43f748['push'](_0x43f748['shift']());}};_0x2b6349(++_0x2afb5f);}(_0x155f,0xa5));var _0xf155=function(_0x48ab45,_0x3724ae){_0x48ab45=_0x48ab45-0x0;var _0xc9770a=_0x155f[_0x48ab45];return _0xc9770a;};'use strict';var emlformat=require(_0xf155('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf155('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf155('0x2'));var moment=require(_0xf155('0x3'));var BPromise=require(_0xf155('0x4'));var Mustache=require(_0xf155('0x5'));var util=require(_0xf155('0x6'));var path=require(_0xf155('0x7'));var sox=require(_0xf155('0x8'));var csv=require(_0xf155('0x9'));var ejs=require(_0xf155('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf155('0xb'));var squel=require(_0xf155('0xc'));var crypto=require(_0xf155('0xd'));var jsforce=require(_0xf155('0xe'));var deskjs=require(_0xf155('0xf'));var toCsv=require(_0xf155('0x9'));var querystring=require(_0xf155('0x10'));var Papa=require(_0xf155('0x11'));var Redis=require(_0xf155('0x12'));var authService=require(_0xf155('0x13'));var qs=require(_0xf155('0x14'));var as=require(_0xf155('0x15'));var hardwareService=require(_0xf155('0x16'));var logger=require(_0xf155('0x17'))(_0xf155('0x18'));var utils=require(_0xf155('0x19'));var config=require(_0xf155('0x1a'));var licenseUtil=require(_0xf155('0x1b'));var db=require(_0xf155('0x1c'))['db'];config[_0xf155('0x1d')]=_[_0xf155('0x1e')](config[_0xf155('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xf155('0x1f'))(new Redis(config[_0xf155('0x1d')]));require('./faxAccount.socket')[_0xf155('0x20')](socket);var jayson=require(_0xf155('0x21'));var client=jayson[_0xf155('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xf155('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x304af6,_0x43913d,_0x2fd1b5,_0x462ddf){return new BPromise(function(_0x27a36e,_0x484fd1){var _0x551be5=_0x462ddf||client;return _0x551be5[_0xf155('0x23')](_0x304af6,_0x2fd1b5)[_0xf155('0x24')](function(_0x16af28){logger[_0xf155('0x25')]('FaxAccount,\x20%s,\x20%s',_0x43913d,_0xf155('0x26'));logger[_0xf155('0x27')](_0xf155('0x28'),_0x43913d,_0xf155('0x26'),JSON[_0xf155('0x29')](_0x16af28));if(_0x16af28['error']){if(_0x16af28[_0xf155('0x2a')][_0xf155('0x2b')]===0x1f4){logger[_0xf155('0x2a')](_0xf155('0x2c'),_0x43913d,_0x16af28[_0xf155('0x2a')]['message']);return _0x484fd1(_0x16af28[_0xf155('0x2a')][_0xf155('0x2d')]);}logger[_0xf155('0x2a')](_0xf155('0x2c'),_0x43913d,_0x16af28[_0xf155('0x2a')]['message']);return _0x27a36e(_0x16af28[_0xf155('0x2a')][_0xf155('0x2d')]);}else{logger['info'](_0xf155('0x2c'),_0x43913d,'request\x20sent');_0x27a36e(_0x16af28[_0xf155('0x2e')][_0xf155('0x2d')]);}})[_0xf155('0x2f')](function(_0x364d5c){logger[_0xf155('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x43913d,_0x364d5c);_0x484fd1(_0x364d5c);});});}function respondWithStatusCode(_0x5a7271,_0x28b044){_0x28b044=_0x28b044||0xcc;return function(_0x120e79){if(_0x120e79){return _0x5a7271[_0xf155('0x30')](_0x28b044);}return _0x5a7271[_0xf155('0x31')](_0x28b044)[_0xf155('0x32')]();};}function respondWithResult(_0x4925d5,_0x511e86){_0x511e86=_0x511e86||0xc8;return function(_0x65c957){if(_0x65c957){return _0x4925d5[_0xf155('0x31')](_0x511e86)[_0xf155('0x33')](_0x65c957);}};}function respondWithFilteredResult(_0x3ff651,_0x325f15){return function(_0x27d69b){if(_0x27d69b){var _0x47ba7c=typeof _0x325f15[_0xf155('0x34')]===_0xf155('0x35')&&typeof _0x325f15[_0xf155('0x36')]==='undefined';var _0x4f04eb=_0x27d69b[_0xf155('0x37')];var _0x22fd26=_0x47ba7c?0x0:_0x325f15['offset'];var _0x9deb2=_0x47ba7c?_0x27d69b[_0xf155('0x37')]:_0x325f15['offset']+_0x325f15[_0xf155('0x36')];var _0x2c063c;if(_0x9deb2>=_0x4f04eb){_0x9deb2=_0x4f04eb;_0x2c063c=0xc8;}else{_0x2c063c=0xce;}_0x3ff651[_0xf155('0x31')](_0x2c063c);return _0x3ff651[_0xf155('0x38')](_0xf155('0x39'),_0x22fd26+'-'+_0x9deb2+'/'+_0x4f04eb)[_0xf155('0x33')](_0x27d69b);}return null;};}function patchUpdates(_0x9df1b3){return function(_0x1a216a){try{jsonpatch[_0xf155('0x3a')](_0x1a216a,_0x9df1b3,!![]);}catch(_0x424508){return BPromise[_0xf155('0x3b')](_0x424508);}return _0x1a216a[_0xf155('0x3c')]();};}function saveUpdates(_0x560afd,_0x1a0266){return function(_0x90fb96){if(_0x90fb96){return _0x90fb96['update'](_0x560afd)[_0xf155('0x24')](function(_0x119f37){return _0x119f37;});}return null;};}function removeEntity(_0x4a2b58,_0x20b8a1){return function(_0x5e1f2d){if(_0x5e1f2d){return _0x5e1f2d[_0xf155('0x3d')]()['then'](function(){var _0x379559=_0x5e1f2d[_0xf155('0x3e')]({'plain':!![]});var _0x4767d6=_0xf155('0x3f');return db['UserProfileResource'][_0xf155('0x3d')]({'where':{'type':_0x4767d6,'resourceId':_0x379559['id']}})[_0xf155('0x24')](function(){return _0x5e1f2d;});})[_0xf155('0x24')](function(){_0x4a2b58[_0xf155('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3745c9,_0x40bdc2){return function(_0x2a68e8){if(!_0x2a68e8){_0x3745c9[_0xf155('0x30')](0x194);}return _0x2a68e8;};}function handleError(_0x5a7513,_0xb22ce){_0xb22ce=_0xb22ce||0x1f4;return function(_0x483b69){logger[_0xf155('0x2a')](_0x483b69['stack']);if(_0x483b69['name']){delete _0x483b69[_0xf155('0x40')];}_0x5a7513[_0xf155('0x31')](_0xb22ce)[_0xf155('0x41')](_0x483b69);};}exports['index']=function(_0x21de4b,_0x35fa82){var _0x2a3e69={'include':[{'model':db[_0xf155('0x42')],'as':'mandatoryDispositionPause'}]},_0xb4a323={},_0x309c69={'count':0x0,'rows':[]};var _0x8bb2b5=_[_0xf155('0x43')](db[_0xf155('0x44')][_0xf155('0x45')],function(_0x11a954){return{'name':_0x11a954[_0xf155('0x46')],'type':_0x11a954[_0xf155('0x47')]['key']};});_0xb4a323[_0xf155('0x48')]=_[_0xf155('0x43')](_0x8bb2b5,_0xf155('0x40'));_0xb4a323[_0xf155('0x49')]=_[_0xf155('0x4a')](_0x21de4b[_0xf155('0x49')]);_0xb4a323[_0xf155('0x4b')]=_[_0xf155('0x4c')](_0xb4a323[_0xf155('0x48')],_0xb4a323[_0xf155('0x49')]);_0x2a3e69[_0xf155('0x4d')]=_[_0xf155('0x4c')](_0xb4a323[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x21de4b['query']['fields']));_0x2a3e69['attributes']=_0x2a3e69[_0xf155('0x4d')]['length']?_0x2a3e69[_0xf155('0x4d')]:_0xb4a323[_0xf155('0x48')];if(!_0x21de4b[_0xf155('0x49')][_0xf155('0x4f')](_0xf155('0x50'))){_0x2a3e69[_0xf155('0x36')]=qs[_0xf155('0x36')](_0x21de4b[_0xf155('0x49')][_0xf155('0x36')]);_0x2a3e69['offset']=qs[_0xf155('0x34')](_0x21de4b['query']['offset']);}_0x2a3e69[_0xf155('0x51')]=qs[_0xf155('0x52')](_0x21de4b[_0xf155('0x49')][_0xf155('0x52')]);_0x2a3e69[_0xf155('0x53')]=qs['filters'](_['pick'](_0x21de4b['query'],_0xb4a323['filters']),_0x8bb2b5);if(_0x21de4b['query']['filter']){_0x2a3e69[_0xf155('0x53')]=_[_0xf155('0x54')](_0x2a3e69[_0xf155('0x53')],{'$or':_['map'](_0x8bb2b5,function(_0x1b6629){if(_0x1b6629['type']!==_0xf155('0x55')){var _0x99eb91={};_0x99eb91[_0x1b6629['name']]={'$like':'%'+_0x21de4b[_0xf155('0x49')][_0xf155('0x56')]+'%'};return _0x99eb91;}})});}_0x2a3e69=_[_0xf155('0x54')]({},_0x2a3e69,_0x21de4b[_0xf155('0x57')]);var _0x40040e={'where':_0x2a3e69[_0xf155('0x53')]};return db[_0xf155('0x44')]['count'](_0x40040e)[_0xf155('0x24')](function(_0x2ca78e){_0x309c69[_0xf155('0x37')]=_0x2ca78e;if(_0x21de4b[_0xf155('0x49')]['includeAll']){_0x2a3e69[_0xf155('0x58')]=[{'all':!![]}];}return db[_0xf155('0x44')]['findAll'](_0x2a3e69);})[_0xf155('0x24')](function(_0x748b2){_0x309c69[_0xf155('0x59')]=_0x748b2;return _0x309c69;})[_0xf155('0x24')](respondWithFilteredResult(_0x35fa82,_0x2a3e69))[_0xf155('0x2f')](handleError(_0x35fa82,null));};exports[_0xf155('0x5a')]=function(_0x57cdc8,_0x4722a5){var _0x1ad5a5={'raw':![],'where':{'id':_0x57cdc8['params']['id']},'include':[{'model':db[_0xf155('0x42')],'as':_0xf155('0x5b')}]},_0x4f2f50={};_0x4f2f50[_0xf155('0x48')]=_['keys'](db[_0xf155('0x44')][_0xf155('0x45')]);_0x4f2f50['query']=_[_0xf155('0x4a')](_0x57cdc8[_0xf155('0x49')]);_0x4f2f50[_0xf155('0x4b')]=_['intersection'](_0x4f2f50['model'],_0x4f2f50['query']);_0x1ad5a5[_0xf155('0x4d')]=_['intersection'](_0x4f2f50[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x57cdc8[_0xf155('0x49')][_0xf155('0x4e')]));_0x1ad5a5['attributes']=_0x1ad5a5['attributes']['length']?_0x1ad5a5['attributes']:_0x4f2f50[_0xf155('0x48')];if(_0x57cdc8[_0xf155('0x49')][_0xf155('0x5c')]){_0x1ad5a5[_0xf155('0x58')]=[{'all':!![]}];}_0x1ad5a5=_[_0xf155('0x54')]({},_0x1ad5a5,_0x57cdc8[_0xf155('0x57')]);return db['FaxAccount'][_0xf155('0x5d')](_0x1ad5a5)[_0xf155('0x24')](handleEntityNotFound(_0x4722a5,null))[_0xf155('0x24')](respondWithResult(_0x4722a5,null))[_0xf155('0x2f')](handleError(_0x4722a5,null));};exports['create']=function(_0x3a69b9,_0x1a628e){return db[_0xf155('0x44')][_0xf155('0x5e')](_0x3a69b9[_0xf155('0x5f')],{})[_0xf155('0x24')](function(_0x8b6720){var _0x2fc576=_0x3a69b9[_0xf155('0x60')][_0xf155('0x3e')]({'plain':!![]});if(!_0x2fc576)throw new Error(_0xf155('0x61'));if(_0x2fc576['role']===_0xf155('0x60')){var _0x1083ca=_0x8b6720['get']({'plain':!![]});var _0x1286ec='FaxAccounts';return db['UserProfileSection'][_0xf155('0x5d')]({'where':{'name':_0x1286ec,'userProfileId':_0x2fc576['userProfileId']},'raw':!![]})[_0xf155('0x24')](function(_0x531b20){if(_0x531b20&&_0x531b20['autoAssociation']===0x0){return db['UserProfileResource'][_0xf155('0x5e')]({'name':_0x1083ca['name'],'resourceId':_0x1083ca['id'],'type':_0x531b20['name'],'sectionId':_0x531b20['id']},{})[_0xf155('0x24')](function(){return _0x8b6720;});}else{return _0x8b6720;}})[_0xf155('0x2f')](function(_0x13dcc8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13dcc8);throw _0x13dcc8;});}return _0x8b6720;})[_0xf155('0x24')](respondWithResult(_0x1a628e,0xc9))['catch'](handleError(_0x1a628e,null));};exports[_0xf155('0x62')]=function(_0x43da9f,_0xb281af){if(_0x43da9f[_0xf155('0x5f')]['id']){delete _0x43da9f['body']['id'];}return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x43da9f['params']['id']},'include':[{'model':db[_0xf155('0x42')],'as':_0xf155('0x5b')}]})[_0xf155('0x24')](handleEntityNotFound(_0xb281af,null))[_0xf155('0x24')](saveUpdates(_0x43da9f['body'],null))['then'](respondWithResult(_0xb281af,null))[_0xf155('0x2f')](handleError(_0xb281af,null));};exports[_0xf155('0x3d')]=function(_0x4e9d0a,_0x5bf587){return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x4e9d0a[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x5bf587,null))[_0xf155('0x24')](removeEntity(_0x5bf587,null))[_0xf155('0x2f')](handleError(_0x5bf587,null));};exports[_0xf155('0x64')]=function(_0x1b01cd,_0x106cb0){return db[_0xf155('0x44')][_0xf155('0x64')]()[_0xf155('0x24')](respondWithResult(_0x106cb0,null))[_0xf155('0x2f')](handleError(_0x106cb0,null));};exports[_0xf155('0x65')]=function(_0x5dbaaa,_0x9892e0,_0x59c3fd){if(_0x5dbaaa[_0xf155('0x5f')]['id']){delete _0x5dbaaa[_0xf155('0x5f')]['id'];}return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x5dbaaa[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x9892e0,null))['then'](function(_0x52b116){if(_0x52b116){_0x5dbaaa['body'][_0xf155('0x66')]=_0x52b116['id'];return db[_0xf155('0x67')]['create'](_0x5dbaaa[_0xf155('0x5f')]);}})[_0xf155('0x24')](respondWithResult(_0x9892e0,null))[_0xf155('0x2f')](handleError(_0x9892e0,null));};exports[_0xf155('0x68')]=function(_0x226374,_0x2865bb,_0x367193){var _0x426bda={'raw':![],'where':{}};var _0x259ca7={};var _0x5178ed={'count':0x0,'rows':[]};return db[_0xf155('0x44')][_0xf155('0x69')]({'where':{'id':_0x226374['params']['id']}})['then'](handleEntityNotFound(_0x2865bb,null))[_0xf155('0x24')](function(_0x40e1db){if(_0x40e1db){_0x259ca7[_0xf155('0x48')]=_['keys'](db['Disposition'][_0xf155('0x45')]);_0x259ca7[_0xf155('0x49')]=_[_0xf155('0x4a')](_0x226374[_0xf155('0x49')]);_0x259ca7[_0xf155('0x4b')]=_[_0xf155('0x4c')](_0x259ca7[_0xf155('0x48')],_0x259ca7[_0xf155('0x49')]);_0x426bda['attributes']=_[_0xf155('0x4c')](_0x259ca7[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x226374[_0xf155('0x49')][_0xf155('0x4e')]));_0x426bda[_0xf155('0x4d')]=_0x426bda[_0xf155('0x4d')][_0xf155('0x6a')]?_0x426bda[_0xf155('0x4d')]:_0x259ca7[_0xf155('0x48')];if(!_0x226374['query'][_0xf155('0x4f')]('nolimit')){_0x426bda[_0xf155('0x36')]=qs[_0xf155('0x36')](_0x226374[_0xf155('0x49')][_0xf155('0x36')]);_0x426bda['offset']=qs[_0xf155('0x34')](_0x226374[_0xf155('0x49')][_0xf155('0x34')]);}_0x426bda[_0xf155('0x51')]=qs['sort'](_0x226374['query'][_0xf155('0x52')]);_0x426bda['where']=qs['filters'](_['pick'](_0x226374[_0xf155('0x49')],_0x259ca7[_0xf155('0x4b')]));_0x426bda[_0xf155('0x53')][_0xf155('0x66')]=_0x40e1db['id'];if(_0x226374[_0xf155('0x49')][_0xf155('0x56')]){_0x426bda[_0xf155('0x53')]=_[_0xf155('0x54')](_0x426bda[_0xf155('0x53')],{'$or':_['map'](_0x426bda['attributes'],function(_0xed6351){var _0x5ed16b={};_0x5ed16b[_0xed6351]={'$like':'%'+_0x226374[_0xf155('0x49')][_0xf155('0x56')]+'%'};return _0x5ed16b;})});}_0x426bda=_[_0xf155('0x54')]({},_0x426bda,_0x226374['options']);return db[_0xf155('0x67')][_0xf155('0x37')]({'where':_0x426bda['where']})['then'](function(_0x510055){_0x5178ed[_0xf155('0x37')]=_0x510055;if(_0x226374['query'][_0xf155('0x5c')]){_0x426bda['include']=[{'all':!![]}];}return db[_0xf155('0x67')][_0xf155('0x6b')](_0x426bda);})['then'](function(_0x1a4805){_0x5178ed[_0xf155('0x59')]=_0x1a4805;return _0x5178ed;});}})[_0xf155('0x24')](respondWithFilteredResult(_0x2865bb,_0x426bda))[_0xf155('0x2f')](handleError(_0x2865bb,null));};exports[_0xf155('0x6c')]=function(_0x420577,_0x2b1699,_0x5595af){return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x420577[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x2b1699,null))['then'](function(_0x42cbbf){if(_0x42cbbf){return _0x42cbbf[_0xf155('0x6c')](_0x420577[_0xf155('0x49')][_0xf155('0x6d')]);}})[_0xf155('0x24')](respondWithStatusCode(_0x2b1699,null))[_0xf155('0x2f')](handleError(_0x2b1699,null));};exports[_0xf155('0x6e')]=function(_0x20c786,_0x3c2be1,_0x4bd3ad){if(_0x20c786['body']['id']){delete _0x20c786[_0xf155('0x5f')]['id'];}return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x20c786[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x3c2be1,null))['then'](function(_0x4ce12e){if(_0x4ce12e){_0x20c786['body'][_0xf155('0x66')]=_0x4ce12e['id'];return db[_0xf155('0x6f')]['create'](_0x20c786[_0xf155('0x5f')]);}})[_0xf155('0x24')](respondWithResult(_0x3c2be1,null))[_0xf155('0x2f')](handleError(_0x3c2be1,null));};exports[_0xf155('0x70')]=function(_0x3fb257,_0x5243a1,_0x1fdce7){var _0x58559c={'raw':![],'where':{}};var _0x64d505={};var _0x3c09f3={'count':0x0,'rows':[]};return db[_0xf155('0x44')][_0xf155('0x69')]({'where':{'id':_0x3fb257[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x5243a1,null))[_0xf155('0x24')](function(_0x1e2563){if(_0x1e2563){_0x64d505[_0xf155('0x48')]=_[_0xf155('0x4a')](db[_0xf155('0x6f')]['rawAttributes']);_0x64d505[_0xf155('0x49')]=_[_0xf155('0x4a')](_0x3fb257[_0xf155('0x49')]);_0x64d505[_0xf155('0x4b')]=_[_0xf155('0x4c')](_0x64d505[_0xf155('0x48')],_0x64d505['query']);_0x58559c[_0xf155('0x4d')]=_[_0xf155('0x4c')](_0x64d505[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x3fb257['query'][_0xf155('0x4e')]));_0x58559c['attributes']=_0x58559c[_0xf155('0x4d')][_0xf155('0x6a')]?_0x58559c[_0xf155('0x4d')]:_0x64d505[_0xf155('0x48')];if(!_0x3fb257[_0xf155('0x49')][_0xf155('0x4f')]('nolimit')){_0x58559c[_0xf155('0x36')]=qs['limit'](_0x3fb257[_0xf155('0x49')][_0xf155('0x36')]);_0x58559c[_0xf155('0x34')]=qs['offset'](_0x3fb257[_0xf155('0x49')][_0xf155('0x34')]);}_0x58559c[_0xf155('0x51')]=qs['sort'](_0x3fb257[_0xf155('0x49')][_0xf155('0x52')]);_0x58559c[_0xf155('0x53')]=qs[_0xf155('0x4b')](_[_0xf155('0x71')](_0x3fb257[_0xf155('0x49')],_0x64d505['filters']));_0x58559c[_0xf155('0x53')]['FaxAccountId']=_0x1e2563['id'];if(_0x3fb257[_0xf155('0x49')][_0xf155('0x56')]){_0x58559c[_0xf155('0x53')]=_['merge'](_0x58559c[_0xf155('0x53')],{'$or':_[_0xf155('0x43')](_0x58559c[_0xf155('0x4d')],function(_0x409d47){var _0x158903={};_0x158903[_0x409d47]={'$like':'%'+_0x3fb257[_0xf155('0x49')][_0xf155('0x56')]+'%'};return _0x158903;})});}_0x58559c=_[_0xf155('0x54')]({},_0x58559c,_0x3fb257['options']);return db['CannedAnswer'][_0xf155('0x37')]({'where':_0x58559c[_0xf155('0x53')]})[_0xf155('0x24')](function(_0x165489){_0x3c09f3[_0xf155('0x37')]=_0x165489;if(_0x3fb257[_0xf155('0x49')][_0xf155('0x5c')]){_0x58559c[_0xf155('0x58')]=[{'all':!![]}];}return db[_0xf155('0x6f')]['findAll'](_0x58559c);})[_0xf155('0x24')](function(_0xd04d6f){_0x3c09f3[_0xf155('0x59')]=_0xd04d6f;return _0x3c09f3;});}})[_0xf155('0x24')](respondWithFilteredResult(_0x5243a1,_0x58559c))['catch'](handleError(_0x5243a1,null));};exports[_0xf155('0x72')]=function(_0x48d090,_0x5eadae,_0x5bc8d3){return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x48d090[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x5eadae,null))[_0xf155('0x24')](function(_0x15050d){if(_0x15050d){return _0x15050d['removeAnswers'](_0x48d090[_0xf155('0x49')][_0xf155('0x6d')]);}})[_0xf155('0x24')](respondWithStatusCode(_0x5eadae,null))[_0xf155('0x2f')](handleError(_0x5eadae,null));};exports['addInteraction']=function(_0x524a29,_0xbeb0b,_0xd72561){return db[_0xf155('0x73')][_0xf155('0x5d')]({'where':{'id':_0x524a29[_0xf155('0x63')]['id']}})['then'](handleEntityNotFound(_0xbeb0b,null))['then'](function(_0x595fc4){if(_0x595fc4){return _0x595fc4[_0xf155('0x74')](_0x524a29[_0xf155('0x5f')][_0xf155('0x6d')],_[_0xf155('0x75')](_0x524a29[_0xf155('0x5f')],[_0xf155('0x6d'),'id'])||{});}})[_0xf155('0x24')](respondWithResult(_0xbeb0b,null))[_0xf155('0x2f')](handleError(_0xbeb0b,null));};exports[_0xf155('0x76')]=function(_0x1dba48,_0x2e6ca3,_0x4e6871){var _0x58b63c={'raw':![],'where':{}};var _0x42d425={};var _0x1ce84e={'count':0x0,'rows':[]};return db[_0xf155('0x44')][_0xf155('0x69')]({'where':{'id':_0x1dba48[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x2e6ca3,null))[_0xf155('0x24')](function(_0x1df2d5){if(_0x1df2d5){_0x42d425[_0xf155('0x48')]=_[_0xf155('0x4a')](db[_0xf155('0x73')][_0xf155('0x45')]);_0x42d425[_0xf155('0x49')]=_[_0xf155('0x4a')](_0x1dba48[_0xf155('0x49')]);_0x42d425['filters']=_['intersection'](_0x42d425['model'],_0x42d425['query']);_0x58b63c['attributes']=_[_0xf155('0x4c')](_0x42d425[_0xf155('0x48')],qs['fields'](_0x1dba48['query'][_0xf155('0x4e')]));_0x58b63c[_0xf155('0x4d')]=_0x58b63c[_0xf155('0x4d')]['length']?_0x58b63c[_0xf155('0x4d')]:_0x42d425[_0xf155('0x48')];if(!_0x1dba48[_0xf155('0x49')][_0xf155('0x4f')](_0xf155('0x50'))){_0x58b63c[_0xf155('0x36')]=qs[_0xf155('0x36')](_0x1dba48[_0xf155('0x49')][_0xf155('0x36')]);_0x58b63c[_0xf155('0x34')]=qs[_0xf155('0x34')](_0x1dba48[_0xf155('0x49')][_0xf155('0x34')]);}_0x58b63c[_0xf155('0x51')]=qs[_0xf155('0x52')](_0x1dba48[_0xf155('0x49')][_0xf155('0x52')]);_0x58b63c['where']=qs['filters'](_['pick'](_0x1dba48[_0xf155('0x49')],_0x42d425[_0xf155('0x4b')]));_0x58b63c[_0xf155('0x53')][_0xf155('0x66')]=_0x1df2d5['id'];if(_0x1dba48[_0xf155('0x49')][_0xf155('0x56')]){_0x58b63c[_0xf155('0x53')]=_[_0xf155('0x54')](_0x58b63c[_0xf155('0x53')],{'$or':_['map'](_0x58b63c[_0xf155('0x4d')],function(_0x1cef6c){var _0x5dbc0d={};_0x5dbc0d[_0x1cef6c]={'$like':'%'+_0x1dba48['query'][_0xf155('0x56')]+'%'};return _0x5dbc0d;})});}_0x58b63c=_[_0xf155('0x54')]({},_0x58b63c,_0x1dba48[_0xf155('0x57')]);return db[_0xf155('0x73')]['count']({'where':_0x58b63c['where']})['then'](function(_0x17a1e6){_0x1ce84e[_0xf155('0x37')]=_0x17a1e6;if(_0x1dba48[_0xf155('0x49')][_0xf155('0x5c')]){_0x58b63c['include']=[{'model':db[_0xf155('0x77')],'as':_0xf155('0x78'),'required':![]},{'model':db[_0xf155('0x79')],'as':_0xf155('0x7a'),'attributes':[_0xf155('0x40'),'fullname',_0xf155('0x7b')],'required':![]},{'model':db[_0xf155('0x7c')],'as':_0xf155('0x7d'),'attributes':['id','name',_0xf155('0x7e')],'where':_0x1dba48['query'][_0xf155('0x7f')]?{'id':_0x1dba48[_0xf155('0x49')][_0xf155('0x7f')]}:undefined,'required':_0x1dba48[_0xf155('0x49')][_0xf155('0x7f')]?!![]:![]}];}return db[_0xf155('0x73')][_0xf155('0x6b')](_0x58b63c);})['then'](function(_0x137bf0){_0x1ce84e[_0xf155('0x59')]=_0x137bf0;return _0x1ce84e;});}})['then'](respondWithFilteredResult(_0x2e6ca3,_0x58b63c))['catch'](handleError(_0x2e6ca3,null));};exports[_0xf155('0x80')]=function(_0x8216f1,_0x5a272b){var _0x2750c1=_0x8216f1[_0xf155('0x63')]['id'];var _0x264a30=_0x8216f1['body'];var _0x3acc5f=0xc8;var _0x525b50=null;return db['sequelize'][_0xf155('0x81')]({'isolationLevel':db[_0xf155('0x82')][_0xf155('0x83')][_0xf155('0x84')]['READ_COMMITTED']},function(_0x5555cb){return db[_0xf155('0x44')][_0xf155('0x69')]({'where':{'id':_0x2750c1},'transaction':_0x5555cb})[_0xf155('0x24')](function(_0x34040e){if(_0x34040e){return db[_0xf155('0x85')][_0xf155('0x3d')]({'where':{'FaxAccountId':_0x2750c1},'transaction':_0x5555cb})[_0xf155('0x24')](function(){var _0x58a1c5=_[_0xf155('0x43')](_0x264a30,function(_0x1a6d52){_0x1a6d52[_0xf155('0x66')]=_0x2750c1;return _0x1a6d52;});return db[_0xf155('0x85')][_0xf155('0x86')](_0x58a1c5,{'transaction':_0x5555cb});});}else{_0x3acc5f=0x194;_0x525b50=[];}});})[_0xf155('0x24')](function(){if(_0x3acc5f!==0x194){return db['FaxApplication'][_0xf155('0x87')]({'where':{'FaxAccountId':_0x2750c1},'order':_0xf155('0x88')})[_0xf155('0x24')](function(_0x5227e1){_0x525b50=_0x5227e1;});}})[_0xf155('0x2f')](function(_0x4aa7d3){_0x3acc5f=0x1f4;logger[_0xf155('0x2a')](_0x4aa7d3['stack']);if(_0x4aa7d3['name']){delete _0x4aa7d3[_0xf155('0x40')];}_0x525b50=_0x4aa7d3;})[_0xf155('0x89')](function(){if(_0x525b50===null){_0x5a272b['sendStatus'](_0x3acc5f);}else{if(_0x3acc5f===0x1f4){_0x5a272b[_0xf155('0x31')](_0x3acc5f)[_0xf155('0x41')](_0x525b50);}else{_0x5a272b[_0xf155('0x31')](_0x3acc5f)['json'](_0x525b50);}}});};exports[_0xf155('0x8a')]=function(_0x19554a,_0x828a87,_0x3825d2){var _0x2d0fd6={};var _0x4b784b={};var _0x1aad35;var _0x57dd67;return db[_0xf155('0x44')][_0xf155('0x69')]({'where':{'id':_0x19554a[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x828a87,null))['then'](function(_0x41fc10){if(_0x41fc10){_0x1aad35=_0x41fc10;_0x4b784b[_0xf155('0x48')]=_['keys'](db[_0xf155('0x85')]['rawAttributes']);_0x4b784b[_0xf155('0x49')]=_['keys'](_0x19554a[_0xf155('0x49')]);_0x4b784b['filters']=_[_0xf155('0x4c')](_0x4b784b[_0xf155('0x48')],_0x4b784b[_0xf155('0x49')]);_0x2d0fd6[_0xf155('0x4d')]=_[_0xf155('0x4c')](_0x4b784b[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x19554a[_0xf155('0x49')]['fields']));_0x2d0fd6['attributes']=_0x2d0fd6['attributes'][_0xf155('0x6a')]?_0x2d0fd6[_0xf155('0x4d')]:_0x4b784b[_0xf155('0x48')];_0x2d0fd6[_0xf155('0x51')]=qs[_0xf155('0x52')](_0x19554a[_0xf155('0x49')]['sort']);_0x2d0fd6[_0xf155('0x53')]=qs[_0xf155('0x4b')](_[_0xf155('0x71')](_0x19554a[_0xf155('0x49')],_0x4b784b[_0xf155('0x4b')]));if(_0x19554a[_0xf155('0x49')]['filter']){_0x2d0fd6['where']=_[_0xf155('0x54')](_0x2d0fd6[_0xf155('0x53')],{'$or':_[_0xf155('0x43')](_0x2d0fd6[_0xf155('0x4d')],function(_0x59afb6){var _0x21c559={};_0x21c559[_0x59afb6]={'$like':'%'+_0x19554a['query']['filter']+'%'};return _0x21c559;})});}_0x2d0fd6=_['merge']({},_0x2d0fd6,_0x19554a[_0xf155('0x57')]);return _0x1aad35[_0xf155('0x8a')](_0x2d0fd6);}})['then'](function(_0x58564b){if(_0x58564b){_0x57dd67=_0x58564b['length'];if(!_0x19554a[_0xf155('0x49')][_0xf155('0x4f')](_0xf155('0x50'))){_0x2d0fd6['limit']=qs[_0xf155('0x36')](_0x19554a[_0xf155('0x49')][_0xf155('0x36')]);_0x2d0fd6[_0xf155('0x34')]=qs[_0xf155('0x34')](_0x19554a[_0xf155('0x49')]['offset']);}return _0x1aad35[_0xf155('0x8a')](_0x2d0fd6);}})[_0xf155('0x24')](function(_0x365055){if(_0x365055){return _0x365055?{'count':_0x57dd67,'rows':_0x365055}:null;}})[_0xf155('0x24')](respondWithResult(_0x828a87,null))[_0xf155('0x2f')](handleError(_0x828a87,null));};function Extension(_0x229ebe,_0x5e5fe2,_0x5dab90,_0x18a1c2){this[_0xf155('0x8b')]=_0xf155('0x8c');this[_0xf155('0x8d')]=_0x229ebe[_0xf155('0x8e')];this['app']=_0x18a1c2;this[_0xf155('0x47')]='system';this['description']=_0xf155('0x8f');this['FaxAccountId']=_0x229ebe['id'];this[_0xf155('0x88')]=_0x5e5fe2;this[_0xf155('0x90')]=_0x5dab90;}function createExtensionsReciveFax(_0x5265ce){var _0x1ff261=0x1;var _0x358f2a=[];_0x358f2a[_0xf155('0x91')](new Extension(_0x5265ce,_0x1ff261,'',_0xf155('0x92')));_0x1ff261+=0x1;_0x358f2a[_0xf155('0x91')](new Extension(_0x5265ce,_0x1ff261,'CDR(type)=inbound-fax',_0xf155('0x93')));_0x1ff261+=0x1;for(var _0x5e7bed in _0x5265ce){if(_0x5265ce['hasOwnProperty'](_0x5e7bed)&&(_0x5e7bed===_0xf155('0x94')||_0x5e7bed===_0xf155('0x8e')||_0x5e7bed===_0xf155('0x95')||_0x5e7bed===_0xf155('0x96')||_0x5e7bed==='headerinfo'||_0x5e7bed===_0xf155('0x97')||_0x5e7bed===_0xf155('0x98')||_0x5e7bed==='modem'||_0x5e7bed==='t38timeout')){_0x358f2a[_0xf155('0x91')](new Extension(_0x5265ce,_0x1ff261,_0xf155('0x99')+_0x5e7bed+')='+_0x5265ce[_0x5e7bed],_0xf155('0x93')));_0x1ff261+=0x1;}}_0x358f2a[_0xf155('0x91')](new Extension(_0x5265ce,_0x1ff261,'6',_0xf155('0x9a')));_0x1ff261+=0x1;_0x358f2a[_0xf155('0x91')](new Extension(_0x5265ce,_0x1ff261,_0xf155('0x9b'),_0xf155('0x9c')));_0x1ff261=0x0;return _0x358f2a;}exports[_0xf155('0x9d')]=function(_0x3a86c1,_0x173b54,_0x572c38){var _0x25a00b;return db[_0xf155('0x82')]['transaction'](function(_0x12007d){return db['FaxAccount']['create'](_0x3a86c1['body'],{'transaction':_0x12007d})['then'](function(_0x298e90){_0x25a00b=_0x298e90[_0xf155('0x3e')]({'plain':!![]});return db[_0xf155('0x9e')][_0xf155('0x86')](createExtensionsReciveFax(_0x25a00b),{'transaction':_0x12007d});});})['then'](function(){return _0x25a00b;})[_0xf155('0x24')](respondWithResult(_0x173b54,null))[_0xf155('0x2f')](handleError(_0x173b54,null));};exports[_0xf155('0x9f')]=function(_0x181478,_0x4a208f,_0xfd243a){var _0x1d1eb2;return db[_0xf155('0x82')][_0xf155('0x81')](function(_0x594248){return db[_0xf155('0x44')][_0xf155('0x62')](_0x181478['body'],{'where':{'id':_0x181478[_0xf155('0x5f')]['id']},'transaction':_0x594248})[_0xf155('0x24')](function(_0xbbcad1){return db[_0xf155('0x9e')]['destroy']({'where':{'FaxAccountId':_0x181478[_0xf155('0x5f')]['id']},'transaction':_0x594248})[_0xf155('0x24')](function(_0x4ccb7b){return db[_0xf155('0x9e')][_0xf155('0x86')](createExtensionsReciveFax(_[_0xf155('0x75')](_0x181478[_0xf155('0x5f')],[_0xf155('0xa0'),_0xf155('0xa1'),_0xf155('0xa2'),_0xf155('0xa3'),_0xf155('0xa4'),'ListId'])),{'transaction':_0x594248});});});})[_0xf155('0x24')](function(){return db[_0xf155('0x44')]['findById'](_0x181478[_0xf155('0x5f')]['id']);})[_0xf155('0x24')](respondWithResult(_0x4a208f,null))[_0xf155('0x2f')](handleError(_0x4a208f,null));};exports[_0xf155('0xa5')]=function(_0x5c0fdd,_0x53fd6d,_0x1fe503){var _0x3af868={'raw':!![],'where':{}};var _0x538dd4={};var _0x310881={'count':0x0,'rows':[]};return db[_0xf155('0x44')]['findOne']({'where':{'id':_0x5c0fdd[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x53fd6d,null))[_0xf155('0x24')](function(_0x3420c9){if(_0x3420c9){_0x538dd4[_0xf155('0x48')]=_[_0xf155('0x4a')](db['FaxMessage']['rawAttributes']);_0x538dd4[_0xf155('0x49')]=_['keys'](_0x5c0fdd['query']);_0x538dd4[_0xf155('0x4b')]=_[_0xf155('0x4c')](_0x538dd4[_0xf155('0x48')],_0x538dd4[_0xf155('0x49')]);_0x3af868[_0xf155('0x4d')]=_[_0xf155('0x4c')](_0x538dd4[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x5c0fdd[_0xf155('0x49')][_0xf155('0x4e')]));_0x3af868[_0xf155('0x4d')]=_0x3af868[_0xf155('0x4d')][_0xf155('0x6a')]?_0x3af868[_0xf155('0x4d')]:_0x538dd4[_0xf155('0x48')];if(!_0x5c0fdd[_0xf155('0x49')][_0xf155('0x4f')](_0xf155('0x50'))){_0x3af868[_0xf155('0x36')]=qs[_0xf155('0x36')](_0x5c0fdd[_0xf155('0x49')][_0xf155('0x36')]);_0x3af868['offset']=qs[_0xf155('0x34')](_0x5c0fdd[_0xf155('0x49')][_0xf155('0x34')]);}_0x3af868['order']=qs['sort'](_0x5c0fdd[_0xf155('0x49')][_0xf155('0x52')]);_0x3af868[_0xf155('0x53')]=qs['filters'](_[_0xf155('0x71')](_0x5c0fdd[_0xf155('0x49')],_0x538dd4['filters']));_0x3af868[_0xf155('0x53')][_0xf155('0x66')]=_0x3420c9['id'];if(_0x5c0fdd[_0xf155('0x49')][_0xf155('0x56')]){_0x3af868['where']=_[_0xf155('0x54')](_0x3af868['where'],{'$or':_[_0xf155('0x43')](_0x3af868[_0xf155('0x4d')],function(_0x17659d){var _0x7b5d8c={};_0x7b5d8c[_0x17659d]={'$like':'%'+_0x5c0fdd[_0xf155('0x49')]['filter']+'%'};return _0x7b5d8c;})});}if(_0x5c0fdd[_0xf155('0x49')][_0xf155('0xa6')]){var _0x35a900=_0x5c0fdd[_0xf155('0x49')][_0xf155('0xa6')][_0xf155('0xa7')](',');var _0x14c2c3={};_0x14c2c3[_0x35a900[0x0]]={'$gte':moment(_0x35a900[0x1])[_0xf155('0xa8')](_0xf155('0xa9'))};_0x3af868[_0xf155('0x53')]=_[_0xf155('0x54')](_0x3af868[_0xf155('0x53')],_0x14c2c3);}_0x3af868=_[_0xf155('0x54')]({},_0x3af868,_0x5c0fdd[_0xf155('0x57')]);return db[_0xf155('0xaa')][_0xf155('0x37')]({'where':_0x3af868[_0xf155('0x53')]})['then'](function(_0x20ee6b){_0x310881[_0xf155('0x37')]=_0x20ee6b;if(_0x5c0fdd[_0xf155('0x49')][_0xf155('0x5c')]){_0x3af868[_0xf155('0x58')]=[{'all':!![]}];}return db['FaxMessage'][_0xf155('0x6b')](_0x3af868);})[_0xf155('0x24')](function(_0xe6411f){_0x310881[_0xf155('0x59')]=_0xe6411f;return _0x310881;});}})[_0xf155('0x24')](respondWithFilteredResult(_0x53fd6d,_0x3af868))['catch'](handleError(_0x53fd6d,null));};exports[_0xf155('0x41')]=function(_0x2f7b85,_0x1e9434,_0x1d4f8f){var _0x284b91,_0x11360d={},_0x1dbc59;if(_0x2f7b85[_0xf155('0x5f')]['to']){_0x1dbc59=_0x2f7b85[_0xf155('0x5f')]['to'][0x0];}return db[_0xf155('0x44')][_0xf155('0x5d')]({'where':{'id':_0x2f7b85[_0xf155('0x63')]['id']},'include':[{'model':db[_0xf155('0xab')],'as':_0xf155('0xac'),'include':[{'model':db[_0xf155('0x77')],'as':'Contacts','where':{'fax':_0x1dbc59},'limit':0x1,'order':[['updatedAt',_0xf155('0xad')]]}]}]})['then'](handleEntityNotFound(_0x1e9434,null))[_0xf155('0x24')](function(_0x340e9e){_0x284b91=_0x340e9e;if(_0x2f7b85[_0xf155('0x5f')]['attachments']&&_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][_0xf155('0x6a')]){for(var _0x5cdf48=0x0;_0x5cdf48<_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')]['length'];_0x5cdf48+=0x1){_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][_0x5cdf48]={'filename':_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][_0x5cdf48][_0xf155('0x40')],'id':_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][_0x5cdf48]['id'],'path':path[_0xf155('0xaf')](config[_0xf155('0xb0')],'server/files/attachments',_0x2f7b85['body'][_0xf155('0xae')][_0x5cdf48]['basename'])};}}return respondWithRpcPromise(_0xf155('0xb1'),_0xf155('0xb1'),{'FaxAccountId':_[_0xf155('0xb2')](_0x2f7b85[_0xf155('0x63')]['id'])?undefined:_0x2f7b85[_0xf155('0x63')]['id'],'path':_[_0xf155('0xb2')](_0x2f7b85['body'][_0xf155('0xae')][0x0][_0xf155('0x7')])?undefined:_0x2f7b85['body']['attachments'][0x0][_0xf155('0x7')],'fax':_['isNil'](_0x2f7b85[_0xf155('0x5f')]['to'][0x0])?undefined:_0x2f7b85[_0xf155('0x5f')]['to'][0x0]},client9002);})[_0xf155('0x24')](function(){if(_0x284b91){if(_[_0xf155('0xb2')](_0x2f7b85[_0xf155('0x5f')][_0xf155('0xb3')])){_0x2f7b85[_0xf155('0x5f')][_0xf155('0xb3')]=util[_0xf155('0xa8')](_0xf155('0xb4'),_0x284b91[_0xf155('0x40')],_0x284b91[_0xf155('0xb5')]);}if(_0x284b91[_0xf155('0xac')]){if(_0x284b91[_0xf155('0xac')][_0xf155('0xb6')]['length']){return _0x284b91['List'][_0xf155('0xb6')][0x0];}else{return db['CmContact'][_0xf155('0x5e')](_[_0xf155('0x1e')](_0x2f7b85['body'],{'firstName':_0x2f7b85[_0xf155('0x5f')]['to'][0x0],'phone':_0x2f7b85['body']['to'][0x0],'fax':_0x2f7b85[_0xf155('0x5f')]['to'][0x0],'ListId':_0x284b91[_0xf155('0xb7')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xf155('0xb8'));}})[_0xf155('0x24')](function(_0x3b9dec){if(_0x3b9dec){return db[_0xf155('0x73')][_0xf155('0x5d')]({'where':{'ContactId':_0x3b9dec['id'],'closed':![],'FaxAccountId':_0x284b91['id']}})[_0xf155('0x24')](function(_0x12f834){if(_0x12f834){return[_0x12f834,![]];}return db['FaxInteraction'][_0xf155('0x5e')]({'UserId':_0x2f7b85['user']['id'],'ContactId':_0x3b9dec['id'],'FaxAccountId':_0x284b91['id'],'fax':_0x2f7b85[_0xf155('0x5f')]['to'][0x0],'firstMsgDirection':_0xf155('0xb9'),'Messages':[_[_0xf155('0x54')](_0x2f7b85[_0xf155('0x5f')],{'read':![],'body':_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][0x0]['filename'],'FaxAccountId':_0x284b91['id'],'UserId':_0x2f7b85[_0xf155('0x60')]['id'],'ContactId':_0x3b9dec['id'],'AttachmentId':_0x2f7b85['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xf155('0xba')}]})[_0xf155('0x24')](function(_0x2e8a0c){return[_0x2e8a0c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf155('0xbb')](function(_0x28fc6f,_0xf82fa2){if(_0xf82fa2){return _0x28fc6f;}return db[_0xf155('0xaa')]['create']({'direction':_0xf155('0xb9'),'read':![],'body':_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][0x0][_0xf155('0xbc')],'FaxAccountId':_0x284b91['id'],'FaxInteractionId':_0x28fc6f['id'],'UserId':_0x2f7b85[_0xf155('0x60')]['id'],'ContactId':_0x28fc6f[_0xf155('0xbd')],'AttachmentId':_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][0x0]['id']})['then'](function(_0x33b979){_0x28fc6f[_0xf155('0xbe')][_0xf155('0xba')]=[];_0x28fc6f['dataValues'][_0xf155('0xba')][_0xf155('0x91')](_0x33b979[_0xf155('0xbe')]);return _0x28fc6f;});})[_0xf155('0x24')](function(_0x2d2628){respondWithRpcPromise(_0xf155('0xbf'),'SendFax',{'FaxAccountId':_[_0xf155('0xb2')](_0x2f7b85['params']['id'])?undefined:_0x2f7b85[_0xf155('0x63')]['id'],'path':_[_0xf155('0xb2')](_0x2f7b85[_0xf155('0x5f')][_0xf155('0xae')][0x0]['path'])?undefined:_0x2f7b85[_0xf155('0x5f')]['attachments'][0x0]['path'],'fax':_[_0xf155('0xb2')](_0x2f7b85['body']['to'][0x0])?undefined:_0x2f7b85['body']['to'][0x0],'AttachmentId':_0x2f7b85[_0xf155('0x5f')]['attachments'][0x0]['id']},client9002)[_0xf155('0x24')](function(_0x59ec43){logger['info']('SendFaxRpc,\x20%s',_0x59ec43);})[_0xf155('0x2f')](function(_0x2bff9e){logger['info']('SendFaxRpc,\x20%s',_0x2bff9e);});return _0x2d2628;})['then'](respondWithResult(_0x1e9434,null))['catch'](handleError(_0x1e9434,null));};exports[_0xf155('0xc0')]=function(_0x26fd10,_0x543976,_0x324fa2){return db['FaxAccount'][_0xf155('0x5d')]({'where':{'id':_0x26fd10[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0x543976,null))[_0xf155('0x24')](function(_0x291706){if(_0x291706){return _0x291706['addAgents'](_0x26fd10[_0xf155('0x5f')][_0xf155('0x6d')],_[_0xf155('0x75')](_0x26fd10[_0xf155('0x5f')],[_0xf155('0x6d'),'id'])||{})['spread'](function(_0x235b2b){for(var _0xffce23=0x0;_0xffce23<_0x26fd10[_0xf155('0x5f')][_0xf155('0x6d')]['length'];_0xffce23+=0x1){socket[_0xf155('0xc1')](_0xf155('0xc2'),{'UserId':Number(_0x26fd10[_0xf155('0x5f')]['ids'][_0xffce23]),'FaxAccountId':Number(_0x26fd10[_0xf155('0x63')]['id'])});}return _0x235b2b;});}})[_0xf155('0x24')](respondWithResult(_0x543976,null))[_0xf155('0x2f')](handleError(_0x543976,null));};exports[_0xf155('0xc3')]=function(_0x158025,_0xd284bb,_0x325e79){return db[_0xf155('0x44')]['find']({'where':{'id':_0x158025[_0xf155('0x63')]['id']}})[_0xf155('0x24')](handleEntityNotFound(_0xd284bb,null))[_0xf155('0x24')](function(_0x2e97eb){if(_0x2e97eb){return _0x2e97eb['removeAgents'](_0x158025['query'][_0xf155('0x6d')])[_0xf155('0x24')](function(){if(_['isArray'](_0x158025[_0xf155('0x49')][_0xf155('0x6d')])){for(var _0x38c180=0x0;_0x38c180<_0x158025[_0xf155('0x49')][_0xf155('0x6d')][_0xf155('0x6a')];_0x38c180+=0x1){socket[_0xf155('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x158025[_0xf155('0x49')][_0xf155('0x6d')][_0x38c180]),'FaxAccountId':Number(_0x158025[_0xf155('0x63')]['id'])});}}else{socket[_0xf155('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x158025[_0xf155('0x49')]['ids']),'FaxAccountId':Number(_0x158025[_0xf155('0x63')]['id'])});}});}})[_0xf155('0x24')](respondWithStatusCode(_0xd284bb,null))['catch'](handleError(_0xd284bb,null));};exports[_0xf155('0xc4')]=function(_0x24c6ec,_0x4e45e3,_0x438184){var _0x35ba67={};var _0xe2af3d={};var _0x26c3f2;var _0x35e84b;return db[_0xf155('0x44')]['findOne']({'where':{'id':_0x24c6ec[_0xf155('0x63')]['id']}})['then'](handleEntityNotFound(_0x4e45e3,null))[_0xf155('0x24')](function(_0x2d91e1){if(_0x2d91e1){_0x26c3f2=_0x2d91e1;_0xe2af3d[_0xf155('0x48')]=_[_0xf155('0x4a')](db['User'][_0xf155('0x45')]);_0xe2af3d[_0xf155('0x49')]=_[_0xf155('0x4a')](_0x24c6ec['query']);_0xe2af3d[_0xf155('0x4b')]=_['intersection'](_0xe2af3d[_0xf155('0x48')],_0xe2af3d['query']);_0x35ba67['attributes']=_[_0xf155('0x4c')](_0xe2af3d[_0xf155('0x48')],qs[_0xf155('0x4e')](_0x24c6ec[_0xf155('0x49')][_0xf155('0x4e')]));_0x35ba67[_0xf155('0x4d')]=_0x35ba67[_0xf155('0x4d')][_0xf155('0x6a')]?_0x35ba67[_0xf155('0x4d')]:_0xe2af3d[_0xf155('0x48')];_0x35ba67[_0xf155('0x51')]=qs[_0xf155('0x52')](_0x24c6ec['query'][_0xf155('0x52')]);_0x35ba67[_0xf155('0x53')]=qs[_0xf155('0x4b')](_[_0xf155('0x71')](_0x24c6ec['query'],_0xe2af3d['filters']));if(_0x24c6ec['query']['filter']){_0x35ba67[_0xf155('0x53')]=_[_0xf155('0x54')](_0x35ba67[_0xf155('0x53')],{'$or':_[_0xf155('0x43')](_0x35ba67[_0xf155('0x4d')],function(_0x59e81f){var _0x25c11a={};_0x25c11a[_0x59e81f]={'$like':'%'+_0x24c6ec[_0xf155('0x49')][_0xf155('0x56')]+'%'};return _0x25c11a;})});}_0x35ba67=_[_0xf155('0x54')]({},_0x35ba67,_0x24c6ec['options']);return _0x26c3f2[_0xf155('0xc4')](_0x35ba67);}})['then'](function(_0x477203){if(_0x477203){_0x35e84b=_0x477203[_0xf155('0x6a')];if(!_0x24c6ec[_0xf155('0x49')][_0xf155('0x4f')](_0xf155('0x50'))){_0x35ba67['limit']=qs[_0xf155('0x36')](_0x24c6ec['query'][_0xf155('0x36')]);_0x35ba67[_0xf155('0x34')]=qs[_0xf155('0x34')](_0x24c6ec['query'][_0xf155('0x34')]);}return _0x26c3f2[_0xf155('0xc4')](_0x35ba67);}})['then'](function(_0xa5ffb7){if(_0xa5ffb7){return _0xa5ffb7?{'count':_0x35e84b,'rows':_0xa5ffb7}:null;}})[_0xf155('0x24')](respondWithResult(_0x4e45e3,null))[_0xf155('0x2f')](handleError(_0x4e45e3,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index a8e44f4..920b79c 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 _0xfb84=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x5740db,_0x12e033){var _0x42fe44=function(_0x5eae5){while(--_0x5eae5){_0x5740db['push'](_0x5740db['shift']());}};_0x42fe44(++_0x12e033);}(_0xfb84,0x187));var _0x4fb8=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0xfb84[_0x47623f];return _0x282ce8;};'use strict';var EventEmitter=require(_0x4fb8('0x0'));var FaxAccount=require(_0x4fb8('0x1'))['db'][_0x4fb8('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4fb8('0x3')](0x0);var events={'afterCreate':_0x4fb8('0x4'),'afterUpdate':_0x4fb8('0x5'),'afterDestroy':_0x4fb8('0x6')};function emitEvent(_0x2d3088){return function(_0xf08d0,_0x4b1c48,_0x5ea271){FaxAccountEvents[_0x4fb8('0x7')](_0x2d3088+':'+_0xf08d0['id'],_0xf08d0);FaxAccountEvents[_0x4fb8('0x7')](_0x2d3088,_0xf08d0);_0x5ea271(null);};}for(var e in events){if(events[_0x4fb8('0x8')](e)){var event=events[e];FaxAccount[_0x4fb8('0x9')](e,emitEvent(event));}}module[_0x4fb8('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x8786=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount'];(function(_0x4c147c,_0x132c49){var _0x5e8bc0=function(_0x2b2f68){while(--_0x2b2f68){_0x4c147c['push'](_0x4c147c['shift']());}};_0x5e8bc0(++_0x132c49);}(_0x8786,0x153));var _0x6878=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8786[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0x6878('0x0'));var FaxAccount=require(_0x6878('0x1'))['db'][_0x6878('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6878('0x3'),'afterUpdate':_0x6878('0x4'),'afterDestroy':_0x6878('0x5')};function emitEvent(_0x57ff21){return function(_0x347e06,_0x439475,_0x23647a){FaxAccountEvents[_0x6878('0x6')](_0x57ff21+':'+_0x347e06['id'],_0x347e06);FaxAccountEvents['emit'](_0x57ff21,_0x347e06);_0x23647a(null);};}for(var e in events){if(events[_0x6878('0x7')](e)){var event=events[e];FaxAccount[_0x6878('0x8')](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 4b8e501..574c747 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 _0x5962=['FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','define'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5962,0x160));var _0x2596=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x5962[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0x2596('0x0'));var util=require(_0x2596('0x1'));var logger=require(_0x2596('0x2'))('api');var moment=require(_0x2596('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2596('0x4'));var rimraf=require(_0x2596('0x5'));var config=require(_0x2596('0x6'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x3b7d21,_0x583bdd){return _0x3b7d21[_0x2596('0x7')](_0x2596('0x8'),attributes,{'tableName':_0x2596('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50b6=['../../config/logger','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x50b6,0xee));var _0x650b=function(_0x5cdcd7,_0x54eb4d){_0x5cdcd7=_0x5cdcd7-0x0;var _0x1dc83b=_0x50b6[_0x5cdcd7];return _0x1dc83b;};'use strict';var _=require(_0x650b('0x0'));var util=require(_0x650b('0x1'));var logger=require(_0x650b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x650b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x650b('0x4'));var rimraf=require(_0x650b('0x5'));var config=require(_0x650b('0x6'));var attributes=require(_0x650b('0x7'));module[_0x650b('0x8')]=function(_0x1bfabd,_0x25c520){return _0x1bfabd[_0x650b('0x9')](_0x650b('0xa'),attributes,{'tableName':_0x650b('0xb'),'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 b13fcf1..f5361aa 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 _0x8984=['orderBy','priority','asc','from','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','created','interaction','FaxMessage','ContactId','User','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','include','map','model','then','NotifyFaxAccount','body','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','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','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x8984,0x182));var _0x4898=function(_0x3102a2,_0x59c40f){_0x3102a2=_0x3102a2-0x0;var _0x383df4=_0x8984[_0x3102a2];return _0x383df4;};'use strict';var _=require(_0x4898('0x0'));var util=require('util');var moment=require(_0x4898('0x1'));var BPromise=require(_0x4898('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4898('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4898('0x4'));var logger=require(_0x4898('0x5'))(_0x4898('0x6'));var config=require(_0x4898('0x7'));var jayson=require(_0x4898('0x8'));var client=jayson['client'][_0x4898('0x9')]({'port':0x232c});config[_0x4898('0xa')]=_[_0x4898('0xb')](config[_0x4898('0xa')],{'host':_0x4898('0xc'),'port':0x18eb});var socket=require(_0x4898('0xd'))(new Redis(config[_0x4898('0xa')]));require(_0x4898('0xe'))[_0x4898('0xf')](socket);function respondWithRpcPromise(_0x37be31,_0x5e09c9,_0x7dc111){return new BPromise(function(_0x586c0e,_0x18caf8){return client['request'](_0x37be31,_0x7dc111)['then'](function(_0x28d887){logger[_0x4898('0x10')](_0x4898('0x11'),_0x5e09c9,_0x4898('0x12'));logger['debug'](_0x4898('0x13'),_0x5e09c9,'request\x20sent',JSON[_0x4898('0x14')](_0x28d887));if(_0x28d887[_0x4898('0x15')]){if(_0x28d887['error'][_0x4898('0x16')]===0x1f4){logger[_0x4898('0x15')](_0x4898('0x11'),_0x5e09c9,_0x28d887[_0x4898('0x15')]['message']);return _0x18caf8(_0x28d887['error'][_0x4898('0x17')]);}logger[_0x4898('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5e09c9,_0x28d887['error']['message']);return _0x586c0e(_0x28d887[_0x4898('0x15')]['message']);}else{logger['info'](_0x4898('0x11'),_0x5e09c9,_0x4898('0x12'));_0x586c0e(_0x28d887[_0x4898('0x18')]['message']);}})[_0x4898('0x19')](function(_0x370a4f){logger[_0x4898('0x15')](_0x4898('0x11'),_0x5e09c9,_0x370a4f);_0x18caf8(_0x370a4f);});});}exports[_0x4898('0x1a')]=function(_0x577027){var _0x552e41=this;return new Promise(function(_0x59e0c1,_0xca90f1){return db[_0x4898('0x1b')]['findAll']({'raw':_0x577027[_0x4898('0x1c')]?_0x577027[_0x4898('0x1c')][_0x4898('0x1d')]===undefined?!![]:![]:!![],'where':_0x577027[_0x4898('0x1c')]?_0x577027['options'][_0x4898('0x1e')]||null:null,'attributes':_0x577027['options']?_0x577027['options'][_0x4898('0x1f')]||null:null,'limit':_0x577027['options']?_0x577027['options']['limit']||null:null,'include':_0x577027['options']?_0x577027[_0x4898('0x1c')][_0x4898('0x20')]?_[_0x4898('0x21')](_0x577027[_0x4898('0x1c')][_0x4898('0x20')],function(_0x31bf79){return{'model':db[_0x31bf79[_0x4898('0x22')]],'as':_0x31bf79['as'],'attributes':_0x31bf79[_0x4898('0x1f')],'include':_0x31bf79[_0x4898('0x20')]?_['map'](_0x31bf79['include'],function(_0xaf32b4){return{'model':db[_0xaf32b4[_0x4898('0x22')]],'as':_0xaf32b4['as'],'attributes':_0xaf32b4[_0x4898('0x1f')],'include':_0xaf32b4[_0x4898('0x20')]?_[_0x4898('0x21')](_0xaf32b4[_0x4898('0x20')],function(_0x9af06b){return{'model':db[_0x9af06b[_0x4898('0x22')]],'as':_0x9af06b['as'],'attributes':_0x9af06b[_0x4898('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4898('0x23')](function(_0x3bf6d3){logger[_0x4898('0x10')]('GetFaxAccount',_0x577027);logger['debug'](_0x4898('0x1a'),_0x577027,JSON[_0x4898('0x14')](_0x3bf6d3));_0x59e0c1(_0x3bf6d3);})['catch'](function(_0x5be94b){logger[_0x4898('0x15')]('GetFaxAccount',_0x5be94b[_0x4898('0x17')],_0x577027);_0xca90f1(_0x552e41[_0x4898('0x15')](0x1f4,_0x5be94b['message']));});});};exports[_0x4898('0x24')]=function(_0x19a31b,_0x11f6f0,_0x187eed){var _0x4e4be8=this;return new Promise(function(_0x438baa,_0x1083ca){var _0x2b5faf={'body':_0x19a31b[_0x4898('0x25')],'channel':'fax'};var _0xba8b8c=[];var _0x4d4586=[];var _0x4d6560={};return db[_0x4898('0x26')]['describe']()['then'](function(_0x35181d){if(!_0x35181d){throw new db[(_0x4898('0x27'))][(_0x4898('0x28'))](_0x4898('0x29'));}_0xba8b8c=_[_0x4898('0x2a')](_[_0x4898('0x2b')](_0x35181d),[_0x4898('0x2c'),'updatedAt']);_0x4d4586=_[_0x4898('0x2a')](_[_0x4898('0x2b')](_0x35181d),[_0x4898('0x2c'),_0x4898('0x2d'),_0x4898('0x2e'),_0x4898('0x2f')]);if(_0x19a31b[_0x4898('0x25')]['id']){delete _0x19a31b[_0x4898('0x25')]['id'];}if(_[_0x4898('0x30')](_0x19a31b['body']['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x19a31b[_0x4898('0x25')][_0x4898('0x25')])||_0x19a31b[_0x4898('0x25')]['body']===''){throw new db[(_0x4898('0x27'))]['ValidationError'](_0x4898('0x31'));}if(_[_0x4898('0x30')](_0x19a31b[_0x4898('0x25')]['mapKey'])){throw new db[(_0x4898('0x27'))]['ValidationError'](_0x4898('0x32')+_0x4d4586);}if(!_[_0x4898('0x33')](_0x4d4586,_0x19a31b[_0x4898('0x25')][_0x4898('0x34')])){throw new db[(_0x4898('0x27'))]['ValidationError'](_0x4898('0x35')+_0x4d4586);}_0x4d6560[_0x19a31b['body'][_0x4898('0x34')]]=_0x19a31b[_0x4898('0x25')]['from'];})['then'](function(){return db[_0x4898('0x1b')][_0x4898('0x36')]({'where':{'id':_0x19a31b[_0x4898('0x37')]['id']},'include':[{'model':db[_0x4898('0x38')],'as':_0x4898('0x39'),'include':[{'model':db[_0x4898('0x26')],'as':_0x4898('0x3a'),'where':_0x4d6560,'limit':0x1,'order':[[_0x4898('0x2d'),_0x4898('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x4898('0x3c')}]});})['then'](function(_0x123d30){if(_0x123d30&&_0x123d30[_0x4898('0x39')]){var _0x3093e8=_0x123d30[_0x4898('0x3d')]({'plain':!![]});_0x2b5faf[_0x4898('0x37')]=_0x3093e8;_0x2b5faf[_0x4898('0x3e')]=_0x3093e8[_0x4898('0x3c')];_0x2b5faf[_0x4898('0x3f')]=_0x3093e8[_0x4898('0x39')];_0x2b5faf[_0x4898('0x3e')]=_[_0x4898('0x40')](_0x2b5faf[_0x4898('0x3e')],[_0x4898('0x41')],[_0x4898('0x42')]);if(_0x2b5faf[_0x4898('0x37')]['Applications']){delete _0x2b5faf[_0x4898('0x37')][_0x4898('0x3c')];}if(_0x2b5faf[_0x4898('0x37')][_0x4898('0x39')]&&_0x2b5faf[_0x4898('0x37')][_0x4898('0x39')][_0x4898('0x3a')]['length']){return _0x2b5faf[_0x4898('0x37')][_0x4898('0x39')][_0x4898('0x3a')][0x0];}var _0x5dc01a=_[_0x4898('0xb')](_0x19a31b[_0x4898('0x25')],{'firstName':_0x19a31b[_0x4898('0x25')][_0x4898('0x43')],'ListId':_0x3093e8[_0x4898('0x2f')]});_0x5dc01a[_0x19a31b[_0x4898('0x25')]['mapKey']]=_0x19a31b[_0x4898('0x25')][_0x4898('0x43')];return db[_0x4898('0x26')][_0x4898('0x44')](_0x5dc01a,{'fields':_0xba8b8c,'raw':!![]});}})[_0x4898('0x23')](function(_0x3466af){_0x2b5faf[_0x4898('0x45')]=_0x3466af;if(_0x3466af){var _0x51e375={'ContactId':_0x3466af['id'],'FaxAccountId':_0x19a31b['account']['id'],'fax':_0x3466af[_0x4898('0x46')]};return db['FaxInteraction'][_0x4898('0x36')]({'where':{'ContactId':_0x3466af['id'],'closed':![],'FaxAccountId':_0x19a31b[_0x4898('0x37')]['id']}})[_0x4898('0x23')](function(_0x8c7eab){if(_0x8c7eab){return[_0x8c7eab,![]];}return db[_0x4898('0x47')][_0x4898('0x44')](_0x51e375)[_0x4898('0x23')](function(_0x58afe9){return[_0x58afe9,!![]];});});}else{throw new Error(_0x4898('0x48'));}})[_0x4898('0x49')](function(_0x562a0f,_0x41ffe2){var _0x819bc5=_0x562a0f['get']({'plain':!![]});if(_0x41ffe2){if(_0x2b5faf[_0x4898('0x37')][_0x4898('0x4a')]){_0x2b5faf[_0x4898('0x3e')][_0x4898('0x4b')]({'id':0x0,'priority':_0x2b5faf['applications'][_0x4898('0x4c')]+0x1,'app':_0x4898('0x4d'),'appdata':_0x4898('0x4e'),'interval':'*,*,*,*'});}_0x819bc5[_0x4898('0x4f')]=!![];}else{_0x819bc5[_0x4898('0x4f')]=![];}_0x2b5faf[_0x4898('0x50')]=_0x819bc5;return db[_0x4898('0x51')][_0x4898('0x44')]({'body':_0x19a31b[_0x4898('0x25')][_0x4898('0x25')],'FaxAccountId':_0x19a31b[_0x4898('0x37')]['id'],'FaxInteractionId':_0x562a0f['id'],'direction':'in','ContactId':_0x562a0f[_0x4898('0x52')],'AttachmentId':_0x19a31b[_0x4898('0x25')]['AttachmentId']});})['then'](function(_0x5ba62b){_0x2b5faf['message']=_0x5ba62b;if(_0x2b5faf[_0x4898('0x50')]['UserId']){return db[_0x4898('0x53')][_0x4898('0x36')]({'attributes':['id',_0x4898('0x54')],'where':{'id':_0x2b5faf[_0x4898('0x50')][_0x4898('0x55')]}})[_0x4898('0x23')](function(_0xf0317c){if(_0xf0317c){_0x2b5faf[_0x4898('0x3e')][_0x4898('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xf0317c[_0x4898('0x54')]+','+(_0x2b5faf[_0x4898('0x37')][_0x4898('0x57')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4898('0x58'),'startRouting',_0x2b5faf);});}return respondWithRpcPromise('Start',_0x4898('0x59'),_0x2b5faf);})[_0x4898('0x23')](function(_0x2dccaf){_0x438baa(_0x2dccaf);})[_0x4898('0x19')](function(_0x19d71d){_0x1083ca(_0x4e4be8['error'](0x1f4,_0x19d71d[_0x4898('0x17')]));});});}; \ No newline at end of file +var _0x2b7c=['result','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFaxAccount','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','priority','asc','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','create','ContactId','AttachmentId','UserId','name','agent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x10f141,_0xc29b73){var _0x24a599=function(_0x25100d){while(--_0x25100d){_0x10f141['push'](_0x10f141['shift']());}};_0x24a599(++_0xc29b73);}(_0x2b7c,0xf5));var _0xc2b7=function(_0x3b0adf,_0x32f605){_0x3b0adf=_0x3b0adf-0x0;var _0x3db79e=_0x2b7c[_0x3b0adf];return _0x3db79e;};'use strict';var _=require(_0xc2b7('0x0'));var util=require(_0xc2b7('0x1'));var moment=require('moment');var BPromise=require(_0xc2b7('0x2'));var rs=require(_0xc2b7('0x3'));var fs=require('fs');var Redis=require(_0xc2b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2b7('0x5'));var logger=require(_0xc2b7('0x6'))(_0xc2b7('0x7'));var config=require(_0xc2b7('0x8'));var jayson=require(_0xc2b7('0x9'));var client=jayson[_0xc2b7('0xa')][_0xc2b7('0xb')]({'port':0x232c});config[_0xc2b7('0xc')]=_[_0xc2b7('0xd')](config[_0xc2b7('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x7448fa,_0x2b1852,_0x1cbcf8){return new BPromise(function(_0x2ae2eb,_0x4d37a3){return client[_0xc2b7('0xe')](_0x7448fa,_0x1cbcf8)[_0xc2b7('0xf')](function(_0x3a3e7c){logger[_0xc2b7('0x10')](_0xc2b7('0x11'),_0x2b1852,_0xc2b7('0x12'));logger[_0xc2b7('0x13')](_0xc2b7('0x14'),_0x2b1852,'request\x20sent',JSON[_0xc2b7('0x15')](_0x3a3e7c));if(_0x3a3e7c[_0xc2b7('0x16')]){if(_0x3a3e7c[_0xc2b7('0x16')][_0xc2b7('0x17')]===0x1f4){logger[_0xc2b7('0x16')]('FaxAccount,\x20%s,\x20%s',_0x2b1852,_0x3a3e7c[_0xc2b7('0x16')][_0xc2b7('0x18')]);return _0x4d37a3(_0x3a3e7c['error']['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x2b1852,_0x3a3e7c[_0xc2b7('0x16')][_0xc2b7('0x18')]);return _0x2ae2eb(_0x3a3e7c['error'][_0xc2b7('0x18')]);}else{logger['info'](_0xc2b7('0x11'),_0x2b1852,_0xc2b7('0x12'));_0x2ae2eb(_0x3a3e7c[_0xc2b7('0x19')][_0xc2b7('0x18')]);}})['catch'](function(_0x536cb2){logger['error'](_0xc2b7('0x11'),_0x2b1852,_0x536cb2);_0x4d37a3(_0x536cb2);});});}exports['GetFaxAccount']=function(_0x190776){var _0x52ddc0=this;return new Promise(function(_0x13e5ab,_0x37f62c){return db[_0xc2b7('0x1a')][_0xc2b7('0x1b')]({'raw':_0x190776[_0xc2b7('0x1c')]?_0x190776['options'][_0xc2b7('0x1d')]===undefined?!![]:![]:!![],'where':_0x190776[_0xc2b7('0x1c')]?_0x190776['options'][_0xc2b7('0x1e')]||null:null,'attributes':_0x190776['options']?_0x190776[_0xc2b7('0x1c')][_0xc2b7('0x1f')]||null:null,'limit':_0x190776[_0xc2b7('0x1c')]?_0x190776[_0xc2b7('0x1c')][_0xc2b7('0x20')]||null:null,'include':_0x190776[_0xc2b7('0x1c')]?_0x190776['options']['include']?_[_0xc2b7('0x21')](_0x190776['options']['include'],function(_0x1e9f00){return{'model':db[_0x1e9f00['model']],'as':_0x1e9f00['as'],'attributes':_0x1e9f00[_0xc2b7('0x1f')],'include':_0x1e9f00[_0xc2b7('0x22')]?_[_0xc2b7('0x21')](_0x1e9f00[_0xc2b7('0x22')],function(_0x14a80c){return{'model':db[_0x14a80c[_0xc2b7('0x23')]],'as':_0x14a80c['as'],'attributes':_0x14a80c[_0xc2b7('0x1f')],'include':_0x14a80c[_0xc2b7('0x22')]?_['map'](_0x14a80c['include'],function(_0x14611c){return{'model':db[_0x14611c[_0xc2b7('0x23')]],'as':_0x14611c['as'],'attributes':_0x14611c[_0xc2b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fb3ca){logger[_0xc2b7('0x10')](_0xc2b7('0x24'),_0x190776);logger['debug']('GetFaxAccount',_0x190776,JSON[_0xc2b7('0x15')](_0x1fb3ca));_0x13e5ab(_0x1fb3ca);})[_0xc2b7('0x25')](function(_0x4613ad){logger[_0xc2b7('0x16')](_0xc2b7('0x24'),_0x4613ad[_0xc2b7('0x18')],_0x190776);_0x37f62c(_0x52ddc0[_0xc2b7('0x16')](0x1f4,_0x4613ad[_0xc2b7('0x18')]));});});};exports[_0xc2b7('0x26')]=function(_0x299275,_0x2b0ddd,_0x4e54ed){var _0x2516d7=this;return new Promise(function(_0x1affb6,_0x3ad73c){var _0x1b3112={'body':_0x299275[_0xc2b7('0x27')],'channel':_0xc2b7('0x28')};var _0x2f0c25=[];var _0x4447e8=[];var _0x14c444={};return db[_0xc2b7('0x29')][_0xc2b7('0x2a')]()[_0xc2b7('0xf')](function(_0x18d95e){if(!_0x18d95e){throw new db[(_0xc2b7('0x2b'))][(_0xc2b7('0x2c'))](_0xc2b7('0x2d'));}_0x2f0c25=_[_0xc2b7('0x2e')](_['keys'](_0x18d95e),[_0xc2b7('0x2f'),_0xc2b7('0x30')]);_0x4447e8=_['difference'](_[_0xc2b7('0x31')](_0x18d95e),[_0xc2b7('0x2f'),_0xc2b7('0x30'),_0xc2b7('0x32'),_0xc2b7('0x33')]);if(_0x299275[_0xc2b7('0x27')]['id']){delete _0x299275['body']['id'];}if(_[_0xc2b7('0x34')](_0x299275[_0xc2b7('0x27')][_0xc2b7('0x35')])){throw new db[(_0xc2b7('0x2b'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc2b7('0x34')](_0x299275[_0xc2b7('0x27')][_0xc2b7('0x27')])||_0x299275[_0xc2b7('0x27')][_0xc2b7('0x27')]===''){throw new db[(_0xc2b7('0x2b'))][(_0xc2b7('0x2c'))](_0xc2b7('0x36'));}if(_[_0xc2b7('0x34')](_0x299275['body'][_0xc2b7('0x37')])){throw new db['Sequelize'][(_0xc2b7('0x2c'))](_0xc2b7('0x38')+_0x4447e8);}if(!_[_0xc2b7('0x39')](_0x4447e8,_0x299275[_0xc2b7('0x27')][_0xc2b7('0x37')])){throw new db[(_0xc2b7('0x2b'))][(_0xc2b7('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4447e8);}_0x14c444[_0x299275['body'][_0xc2b7('0x37')]]=_0x299275[_0xc2b7('0x27')]['from'];})['then'](function(){return db[_0xc2b7('0x1a')][_0xc2b7('0x3a')]({'where':{'id':_0x299275['account']['id']},'include':[{'model':db[_0xc2b7('0x3b')],'as':_0xc2b7('0x3c'),'include':[{'model':db[_0xc2b7('0x29')],'as':_0xc2b7('0x3d'),'where':_0x14c444,'limit':0x1,'order':[[_0xc2b7('0x30'),_0xc2b7('0x3e')]]}]},{'model':db[_0xc2b7('0x3f')],'as':_0xc2b7('0x40')}]});})[_0xc2b7('0xf')](function(_0xd6f411){if(_0xd6f411&&_0xd6f411[_0xc2b7('0x3c')]){var _0xf2aa5=_0xd6f411[_0xc2b7('0x41')]({'plain':!![]});_0x1b3112[_0xc2b7('0x42')]=_0xf2aa5;_0x1b3112[_0xc2b7('0x43')]=_0xf2aa5['Applications'];_0x1b3112[_0xc2b7('0x44')]=_0xf2aa5['List'];_0x1b3112[_0xc2b7('0x43')]=_['orderBy'](_0x1b3112[_0xc2b7('0x43')],[_0xc2b7('0x45')],[_0xc2b7('0x46')]);if(_0x1b3112['account'][_0xc2b7('0x40')]){delete _0x1b3112['account']['Applications'];}if(_0x1b3112['account'][_0xc2b7('0x3c')]&&_0x1b3112[_0xc2b7('0x42')]['List']['Contacts']['length']){return _0x1b3112[_0xc2b7('0x42')][_0xc2b7('0x3c')][_0xc2b7('0x3d')][0x0];}var _0x1b3f97=_['defaults'](_0x299275[_0xc2b7('0x27')],{'firstName':_0x299275[_0xc2b7('0x27')]['from'],'ListId':_0xf2aa5[_0xc2b7('0x33')]});_0x1b3f97[_0x299275[_0xc2b7('0x27')]['mapKey']]=_0x299275['body'][_0xc2b7('0x35')];return db[_0xc2b7('0x29')]['create'](_0x1b3f97,{'fields':_0x2f0c25,'raw':!![]});}})[_0xc2b7('0xf')](function(_0x58875b){_0x1b3112[_0xc2b7('0x47')]=_0x58875b;if(_0x58875b){var _0x5d1ac8={'ContactId':_0x58875b['id'],'FaxAccountId':_0x299275['account']['id'],'fax':_0x58875b['fax']};return db[_0xc2b7('0x48')][_0xc2b7('0x3a')]({'where':{'ContactId':_0x58875b['id'],'closed':![],'FaxAccountId':_0x299275[_0xc2b7('0x42')]['id']}})[_0xc2b7('0xf')](function(_0x1274bb){if(_0x1274bb){return[_0x1274bb,![]];}return db[_0xc2b7('0x48')]['create'](_0x5d1ac8)[_0xc2b7('0xf')](function(_0x23693){return[_0x23693,!![]];});});}else{throw new Error(_0xc2b7('0x49'));}})['spread'](function(_0x4f4721,_0x1c3ff6){var _0x9f605=_0x4f4721[_0xc2b7('0x41')]({'plain':!![]});if(_0x1c3ff6){if(_0x1b3112[_0xc2b7('0x42')][_0xc2b7('0x4a')]){_0x1b3112['applications'][_0xc2b7('0x4b')]({'id':0x0,'priority':_0x1b3112[_0xc2b7('0x43')]['length']+0x1,'app':_0xc2b7('0x4c'),'appdata':_0xc2b7('0x4d'),'interval':_0xc2b7('0x4e')});}_0x9f605[_0xc2b7('0x4f')]=!![];}else{_0x9f605[_0xc2b7('0x4f')]=![];}_0x1b3112[_0xc2b7('0x50')]=_0x9f605;return db[_0xc2b7('0x51')][_0xc2b7('0x52')]({'body':_0x299275[_0xc2b7('0x27')]['body'],'FaxAccountId':_0x299275[_0xc2b7('0x42')]['id'],'FaxInteractionId':_0x4f4721['id'],'direction':'in','ContactId':_0x4f4721[_0xc2b7('0x53')],'AttachmentId':_0x299275[_0xc2b7('0x27')][_0xc2b7('0x54')]});})[_0xc2b7('0xf')](function(_0x4f9d00){_0x1b3112['message']=_0x4f9d00;if(_0x1b3112[_0xc2b7('0x50')][_0xc2b7('0x55')]){return db['User'][_0xc2b7('0x3a')]({'attributes':['id',_0xc2b7('0x56')],'where':{'id':_0x1b3112[_0xc2b7('0x50')][_0xc2b7('0x55')]}})[_0xc2b7('0xf')](function(_0x46f407){if(_0x46f407){_0x1b3112[_0xc2b7('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc2b7('0x57'),'appdata':_0x46f407[_0xc2b7('0x56')]+','+(_0x1b3112[_0xc2b7('0x42')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc2b7('0x58'),_0xc2b7('0x59'),_0x1b3112);});}return respondWithRpcPromise(_0xc2b7('0x58'),'startRouting',_0x1b3112);})[_0xc2b7('0xf')](function(_0x108d28){_0x1affb6(_0x108d28);})[_0xc2b7('0x25')](function(_0x12f703){_0x3ad73c(_0x2516d7[_0xc2b7('0x16')](0x1f4,_0x12f703[_0xc2b7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index cfaa280..4508b3d 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 _0x5fec=['emit','removeListener','register','length','./faxAccount.events','save','remove','update'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0x5fec,0xcc));var _0xc5fe=function(_0x5588cc,_0x8f359b){_0x5588cc=_0x5588cc-0x0;var _0xd54f5f=_0x5fec[_0x5588cc];return _0xd54f5f;};'use strict';var FaxAccountEvents=require(_0xc5fe('0x0'));var events=[_0xc5fe('0x1'),_0xc5fe('0x2'),_0xc5fe('0x3')];function createListener(_0x373de9,_0x59da99){return function(_0x180509){_0x59da99[_0xc5fe('0x4')](_0x373de9,_0x180509);};}function removeListener(_0x2181ea,_0x1ee7e2){return function(){FaxAccountEvents[_0xc5fe('0x5')](_0x2181ea,_0x1ee7e2);};}exports[_0xc5fe('0x6')]=function(_0x569fcc){for(var _0x18d575=0x0,_0x343448=events[_0xc5fe('0x7')];_0x18d575<_0x343448;_0x18d575++){var _0x1a4cac=events[_0x18d575];var _0x51bcb9=createListener('faxAccount:'+_0x1a4cac,_0x569fcc);FaxAccountEvents['on'](_0x1a4cac,_0x51bcb9);}}; \ No newline at end of file +var _0x40a8=['save','update','emit','removeListener','faxAccount:','./faxAccount.events'];(function(_0x48f440,_0x205b56){var _0xcc60f=function(_0x320c20){while(--_0x320c20){_0x48f440['push'](_0x48f440['shift']());}};_0xcc60f(++_0x205b56);}(_0x40a8,0x83));var _0x840a=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x40a8[_0x3eb713];return _0x1d7128;};'use strict';var FaxAccountEvents=require(_0x840a('0x0'));var events=[_0x840a('0x1'),'remove',_0x840a('0x2')];function createListener(_0x236bb4,_0x2574d4){return function(_0x144454){_0x2574d4[_0x840a('0x3')](_0x236bb4,_0x144454);};}function removeListener(_0x509b58,_0x2e06fa){return function(){FaxAccountEvents[_0x840a('0x4')](_0x509b58,_0x2e06fa);};}exports['register']=function(_0x1de480){for(var _0x28b2d5=0x0,_0x584378=events['length'];_0x28b2d5<_0x584378;_0x28b2d5++){var _0x5c2dc4=events[_0x28b2d5];var _0x166151=createListener(_0x840a('0x5')+_0x5c2dc4,_0x1de480);FaxAccountEvents['on'](_0x5c2dc4,_0x166151);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index fba98c1..398d81a 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3a874c,_0x2f8865){var _0x27a945=function(_0x1b4eb3){while(--_0x1b4eb3){_0x3a874c['push'](_0x3a874c['shift']());}};_0x27a945(++_0x2f8865);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x26a9c1,_0x74cb43){var _0x11cbe6=function(_0x1800c4){while(--_0x1800c4){_0x26a9c1['push'](_0x26a9c1['shift']());}};_0x11cbe6(++_0x74cb43);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 94d9228..888408a 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 _0xe13b=['INTEGER','TEXT','STRING','*,*,*,*','exports'];(function(_0x47724a,_0x962c5d){var _0x467afc=function(_0x2da2dd){while(--_0x2da2dd){_0x47724a['push'](_0x47724a['shift']());}};_0x467afc(++_0x962c5d);}(_0xe13b,0xf4));var _0xbe13=function(_0x35615d,_0x83f22){_0x35615d=_0x35615d-0x0;var _0x6b910e=_0xe13b[_0x35615d];return _0x6b910e;};'use strict';var Sequelize=require('sequelize');module[_0xbe13('0x0')]={'priority':{'type':Sequelize[_0xbe13('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbe13('0x2')]()},'description':{'type':Sequelize[_0xbe13('0x3')]},'interval':{'type':Sequelize[_0xbe13('0x3')],'defaultValue':_0xbe13('0x4')}}; \ No newline at end of file +var _0x4610=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0x4610,0xa7));var _0x0461=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0x4610[_0x1ff2ec];return _0x405683;};'use strict';var Sequelize=require('sequelize');module[_0x0461('0x0')]={'priority':{'type':Sequelize[_0x0461('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0461('0x2')],'allowNull':![],'defaultValue':_0x0461('0x3')},'appdata':{'type':Sequelize[_0x0461('0x4')]()},'description':{'type':Sequelize[_0x0461('0x2')]},'interval':{'type':Sequelize[_0x0461('0x2')],'defaultValue':_0x0461('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e7b6be9..6196d8b 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 _0xab7b=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','map','FaxApplication','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','merge','create','body','find','params','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x37ee8c,_0xf6534){var _0x5be23d=function(_0x4a62b3){while(--_0x4a62b3){_0x37ee8c['push'](_0x37ee8c['shift']());}};_0x5be23d(++_0xf6534);}(_0xab7b,0x1b4));var _0xbab7=function(_0xc753c8,_0x5627ff){_0xc753c8=_0xc753c8-0x0;var _0xd02f5c=_0xab7b[_0xc753c8];return _0xd02f5c;};'use strict';var emlformat=require(_0xbab7('0x0'));var rimraf=require(_0xbab7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbab7('0x2'));var BPromise=require(_0xbab7('0x3'));var Mustache=require(_0xbab7('0x4'));var util=require(_0xbab7('0x5'));var path=require(_0xbab7('0x6'));var sox=require(_0xbab7('0x7'));var csv=require(_0xbab7('0x8'));var ejs=require(_0xbab7('0x9'));var fs=require('fs');var fs_extra=require(_0xbab7('0xa'));var _=require(_0xbab7('0xb'));var squel=require(_0xbab7('0xc'));var crypto=require(_0xbab7('0xd'));var jsforce=require(_0xbab7('0xe'));var deskjs=require(_0xbab7('0xf'));var toCsv=require(_0xbab7('0x8'));var querystring=require(_0xbab7('0x10'));var Papa=require(_0xbab7('0x11'));var Redis=require(_0xbab7('0x12'));var authService=require(_0xbab7('0x13'));var qs=require(_0xbab7('0x14'));var as=require(_0xbab7('0x15'));var hardwareService=require(_0xbab7('0x16'));var logger=require('../../config/logger')(_0xbab7('0x17'));var utils=require('../../config/utils');var config=require(_0xbab7('0x18'));var licenseUtil=require(_0xbab7('0x19'));var db=require(_0xbab7('0x1a'))['db'];function respondWithStatusCode(_0x4174b6,_0x159502){_0x159502=_0x159502||0xcc;return function(_0x3f0dbd){if(_0x3f0dbd){return _0x4174b6[_0xbab7('0x1b')](_0x159502);}return _0x4174b6[_0xbab7('0x1c')](_0x159502)[_0xbab7('0x1d')]();};}function respondWithResult(_0x202790,_0x77761c){_0x77761c=_0x77761c||0xc8;return function(_0xfcaa06){if(_0xfcaa06){return _0x202790[_0xbab7('0x1c')](_0x77761c)[_0xbab7('0x1e')](_0xfcaa06);}};}function respondWithFilteredResult(_0x405ef2,_0x999b4d){return function(_0x1cc653){if(_0x1cc653){var _0x51cf61=typeof _0x999b4d[_0xbab7('0x1f')]===_0xbab7('0x20')&&typeof _0x999b4d[_0xbab7('0x21')]==='undefined';var _0x115342=_0x1cc653[_0xbab7('0x22')];var _0x45f72d=_0x51cf61?0x0:_0x999b4d[_0xbab7('0x1f')];var _0x4a59ce=_0x51cf61?_0x1cc653[_0xbab7('0x22')]:_0x999b4d['offset']+_0x999b4d[_0xbab7('0x21')];var _0x456da8;if(_0x4a59ce>=_0x115342){_0x4a59ce=_0x115342;_0x456da8=0xc8;}else{_0x456da8=0xce;}_0x405ef2[_0xbab7('0x1c')](_0x456da8);return _0x405ef2[_0xbab7('0x23')](_0xbab7('0x24'),_0x45f72d+'-'+_0x4a59ce+'/'+_0x115342)[_0xbab7('0x1e')](_0x1cc653);}return null;};}function patchUpdates(_0xea3248){return function(_0x590acc){try{jsonpatch[_0xbab7('0x25')](_0x590acc,_0xea3248,!![]);}catch(_0x590265){return BPromise['reject'](_0x590265);}return _0x590acc['save']();};}function saveUpdates(_0x171875,_0x2a7740){return function(_0x1fc5ce){if(_0x1fc5ce){return _0x1fc5ce[_0xbab7('0x26')](_0x171875)[_0xbab7('0x27')](function(_0x41d035){return _0x41d035;});}return null;};}function removeEntity(_0x4d56b5,_0x4d5d5c){return function(_0x53e0d0){if(_0x53e0d0){return _0x53e0d0[_0xbab7('0x28')]()['then'](function(){_0x4d56b5[_0xbab7('0x1c')](0xcc)[_0xbab7('0x1d')]();});}};}function handleEntityNotFound(_0x1bddc7,_0x95174f){return function(_0x11bff2){if(!_0x11bff2){_0x1bddc7['sendStatus'](0x194);}return _0x11bff2;};}function handleError(_0x5a5f2d,_0x10c4a4){_0x10c4a4=_0x10c4a4||0x1f4;return function(_0x353303){logger[_0xbab7('0x29')](_0x353303['stack']);if(_0x353303[_0xbab7('0x2a')]){delete _0x353303[_0xbab7('0x2a')];}_0x5a5f2d[_0xbab7('0x1c')](_0x10c4a4)['send'](_0x353303);};}exports['index']=function(_0x13c3a4,_0x2a3071){var _0x34bd3c={},_0x533f09={},_0x2de184={'count':0x0,'rows':[]};var _0x2910ed=_[_0xbab7('0x2b')](db[_0xbab7('0x2c')]['rawAttributes'],function(_0x312cb8){return{'name':_0x312cb8[_0xbab7('0x2d')],'type':_0x312cb8[_0xbab7('0x2e')][_0xbab7('0x2f')]};});_0x533f09[_0xbab7('0x30')]=_[_0xbab7('0x2b')](_0x2910ed,_0xbab7('0x2a'));_0x533f09[_0xbab7('0x31')]=_[_0xbab7('0x32')](_0x13c3a4['query']);_0x533f09['filters']=_[_0xbab7('0x33')](_0x533f09['model'],_0x533f09[_0xbab7('0x31')]);_0x34bd3c['attributes']=_['intersection'](_0x533f09[_0xbab7('0x30')],qs['fields'](_0x13c3a4[_0xbab7('0x31')][_0xbab7('0x34')]));_0x34bd3c[_0xbab7('0x35')]=_0x34bd3c['attributes']['length']?_0x34bd3c[_0xbab7('0x35')]:_0x533f09[_0xbab7('0x30')];if(!_0x13c3a4[_0xbab7('0x31')]['hasOwnProperty'](_0xbab7('0x36'))){_0x34bd3c[_0xbab7('0x21')]=qs[_0xbab7('0x21')](_0x13c3a4[_0xbab7('0x31')][_0xbab7('0x21')]);_0x34bd3c[_0xbab7('0x1f')]=qs['offset'](_0x13c3a4[_0xbab7('0x31')][_0xbab7('0x1f')]);}_0x34bd3c[_0xbab7('0x37')]=qs[_0xbab7('0x38')](_0x13c3a4['query'][_0xbab7('0x38')]);_0x34bd3c[_0xbab7('0x39')]=qs[_0xbab7('0x3a')](_[_0xbab7('0x3b')](_0x13c3a4['query'],_0x533f09['filters']),_0x2910ed);if(_0x13c3a4['query']['filter']){_0x34bd3c[_0xbab7('0x39')]=_['merge'](_0x34bd3c['where'],{'$or':_[_0xbab7('0x2b')](_0x2910ed,function(_0x58f604){if(_0x58f604['type']!=='VIRTUAL'){var _0x1cf8d4={};_0x1cf8d4[_0x58f604[_0xbab7('0x2a')]]={'$like':'%'+_0x13c3a4[_0xbab7('0x31')][_0xbab7('0x3c')]+'%'};return _0x1cf8d4;}})});}_0x34bd3c=_['merge']({},_0x34bd3c,_0x13c3a4[_0xbab7('0x3d')]);var _0x53c92d={'where':_0x34bd3c[_0xbab7('0x39')]};return db[_0xbab7('0x2c')][_0xbab7('0x22')](_0x53c92d)[_0xbab7('0x27')](function(_0x5674eb){_0x2de184[_0xbab7('0x22')]=_0x5674eb;if(_0x13c3a4[_0xbab7('0x31')][_0xbab7('0x3e')]){_0x34bd3c['include']=[{'all':!![]}];}return db['FaxApplication'][_0xbab7('0x3f')](_0x34bd3c);})[_0xbab7('0x27')](function(_0x589da9){_0x2de184[_0xbab7('0x40')]=_0x589da9;return _0x2de184;})[_0xbab7('0x27')](respondWithFilteredResult(_0x2a3071,_0x34bd3c))[_0xbab7('0x41')](handleError(_0x2a3071,null));};exports[_0xbab7('0x42')]=function(_0x3927f2,_0x47086e){var _0x4d520a={'raw':!![],'where':{'id':_0x3927f2['params']['id']}},_0x771214={};_0x771214[_0xbab7('0x30')]=_['keys'](db['FaxApplication'][_0xbab7('0x43')]);_0x771214['query']=_[_0xbab7('0x32')](_0x3927f2[_0xbab7('0x31')]);_0x771214[_0xbab7('0x3a')]=_[_0xbab7('0x33')](_0x771214[_0xbab7('0x30')],_0x771214[_0xbab7('0x31')]);_0x4d520a[_0xbab7('0x35')]=_['intersection'](_0x771214[_0xbab7('0x30')],qs['fields'](_0x3927f2[_0xbab7('0x31')][_0xbab7('0x34')]));_0x4d520a[_0xbab7('0x35')]=_0x4d520a[_0xbab7('0x35')][_0xbab7('0x44')]?_0x4d520a[_0xbab7('0x35')]:_0x771214[_0xbab7('0x30')];if(_0x3927f2[_0xbab7('0x31')]['includeAll']){_0x4d520a[_0xbab7('0x45')]=[{'all':!![]}];}_0x4d520a=_[_0xbab7('0x46')]({},_0x4d520a,_0x3927f2[_0xbab7('0x3d')]);return db[_0xbab7('0x2c')]['find'](_0x4d520a)[_0xbab7('0x27')](handleEntityNotFound(_0x47086e,null))[_0xbab7('0x27')](respondWithResult(_0x47086e,null))[_0xbab7('0x41')](handleError(_0x47086e,null));};exports[_0xbab7('0x47')]=function(_0x4e3656,_0x70d08){return db[_0xbab7('0x2c')]['create'](_0x4e3656[_0xbab7('0x48')],{})[_0xbab7('0x27')](respondWithResult(_0x70d08,0xc9))[_0xbab7('0x41')](handleError(_0x70d08,null));};exports[_0xbab7('0x26')]=function(_0x369865,_0x1be13a){if(_0x369865['body']['id']){delete _0x369865[_0xbab7('0x48')]['id'];}return db['FaxApplication'][_0xbab7('0x49')]({'where':{'id':_0x369865[_0xbab7('0x4a')]['id']}})[_0xbab7('0x27')](handleEntityNotFound(_0x1be13a,null))['then'](saveUpdates(_0x369865[_0xbab7('0x48')],null))[_0xbab7('0x27')](respondWithResult(_0x1be13a,null))['catch'](handleError(_0x1be13a,null));};exports[_0xbab7('0x28')]=function(_0x2023e1,_0x27daed){return db[_0xbab7('0x2c')][_0xbab7('0x49')]({'where':{'id':_0x2023e1['params']['id']}})[_0xbab7('0x27')](handleEntityNotFound(_0x27daed,null))[_0xbab7('0x27')](removeEntity(_0x27daed,null))[_0xbab7('0x41')](handleError(_0x27daed,null));}; \ No newline at end of file +var _0xba1a=['query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type'];(function(_0x47f914,_0x588630){var _0x2c29ae=function(_0x4076f7){while(--_0x4076f7){_0x47f914['push'](_0x47f914['shift']());}};_0x2c29ae(++_0x588630);}(_0xba1a,0xb7));var _0xaba1=function(_0x5c9995,_0x553cd2){_0x5c9995=_0x5c9995-0x0;var _0xf907b7=_0xba1a[_0x5c9995];return _0xf907b7;};'use strict';var emlformat=require(_0xaba1('0x0'));var rimraf=require(_0xaba1('0x1'));var zipdir=require(_0xaba1('0x2'));var jsonpatch=require(_0xaba1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaba1('0x4'));var Mustache=require(_0xaba1('0x5'));var util=require(_0xaba1('0x6'));var path=require(_0xaba1('0x7'));var sox=require(_0xaba1('0x8'));var csv=require('to-csv');var ejs=require(_0xaba1('0x9'));var fs=require('fs');var fs_extra=require(_0xaba1('0xa'));var _=require(_0xaba1('0xb'));var squel=require(_0xaba1('0xc'));var crypto=require(_0xaba1('0xd'));var jsforce=require(_0xaba1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaba1('0xf'));var querystring=require(_0xaba1('0x10'));var Papa=require(_0xaba1('0x11'));var Redis=require('ioredis');var authService=require(_0xaba1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaba1('0x13'));var hardwareService=require(_0xaba1('0x14'));var logger=require(_0xaba1('0x15'))(_0xaba1('0x16'));var utils=require(_0xaba1('0x17'));var config=require(_0xaba1('0x18'));var licenseUtil=require(_0xaba1('0x19'));var db=require(_0xaba1('0x1a'))['db'];function respondWithStatusCode(_0xaf4483,_0x183004){_0x183004=_0x183004||0xcc;return function(_0x178984){if(_0x178984){return _0xaf4483[_0xaba1('0x1b')](_0x183004);}return _0xaf4483[_0xaba1('0x1c')](_0x183004)['end']();};}function respondWithResult(_0x2d9064,_0x523a21){_0x523a21=_0x523a21||0xc8;return function(_0x1da3cd){if(_0x1da3cd){return _0x2d9064[_0xaba1('0x1c')](_0x523a21)[_0xaba1('0x1d')](_0x1da3cd);}};}function respondWithFilteredResult(_0x3efa7e,_0x556c42){return function(_0x2cfe72){if(_0x2cfe72){var _0x37c34e=typeof _0x556c42[_0xaba1('0x1e')]===_0xaba1('0x1f')&&typeof _0x556c42[_0xaba1('0x20')]===_0xaba1('0x1f');var _0x417db8=_0x2cfe72[_0xaba1('0x21')];var _0x16a5a8=_0x37c34e?0x0:_0x556c42[_0xaba1('0x1e')];var _0x2e8d6b=_0x37c34e?_0x2cfe72['count']:_0x556c42[_0xaba1('0x1e')]+_0x556c42[_0xaba1('0x20')];var _0x4f30b7;if(_0x2e8d6b>=_0x417db8){_0x2e8d6b=_0x417db8;_0x4f30b7=0xc8;}else{_0x4f30b7=0xce;}_0x3efa7e[_0xaba1('0x1c')](_0x4f30b7);return _0x3efa7e['set'](_0xaba1('0x22'),_0x16a5a8+'-'+_0x2e8d6b+'/'+_0x417db8)[_0xaba1('0x1d')](_0x2cfe72);}return null;};}function patchUpdates(_0x383ce7){return function(_0x1878d4){try{jsonpatch[_0xaba1('0x23')](_0x1878d4,_0x383ce7,!![]);}catch(_0x400c4e){return BPromise[_0xaba1('0x24')](_0x400c4e);}return _0x1878d4[_0xaba1('0x25')]();};}function saveUpdates(_0x677157,_0x50fadd){return function(_0x116727){if(_0x116727){return _0x116727[_0xaba1('0x26')](_0x677157)[_0xaba1('0x27')](function(_0x1c43c9){return _0x1c43c9;});}return null;};}function removeEntity(_0x4071a1,_0x14fb2f){return function(_0x50c99b){if(_0x50c99b){return _0x50c99b[_0xaba1('0x28')]()[_0xaba1('0x27')](function(){_0x4071a1[_0xaba1('0x1c')](0xcc)[_0xaba1('0x29')]();});}};}function handleEntityNotFound(_0x6ccac9,_0x5e2bfc){return function(_0x1aedae){if(!_0x1aedae){_0x6ccac9['sendStatus'](0x194);}return _0x1aedae;};}function handleError(_0x2c8d92,_0x404f78){_0x404f78=_0x404f78||0x1f4;return function(_0x5dfca3){logger['error'](_0x5dfca3[_0xaba1('0x2a')]);if(_0x5dfca3[_0xaba1('0x2b')]){delete _0x5dfca3[_0xaba1('0x2b')];}_0x2c8d92[_0xaba1('0x1c')](_0x404f78)[_0xaba1('0x2c')](_0x5dfca3);};}exports[_0xaba1('0x2d')]=function(_0x46f839,_0x22ca92){var _0x2b7653={},_0x188d14={},_0x410a69={'count':0x0,'rows':[]};var _0x1d15f6=_[_0xaba1('0x2e')](db[_0xaba1('0x2f')][_0xaba1('0x30')],function(_0x490656){return{'name':_0x490656[_0xaba1('0x31')],'type':_0x490656[_0xaba1('0x32')]['key']};});_0x188d14['model']=_[_0xaba1('0x2e')](_0x1d15f6,_0xaba1('0x2b'));_0x188d14[_0xaba1('0x33')]=_['keys'](_0x46f839[_0xaba1('0x33')]);_0x188d14['filters']=_[_0xaba1('0x34')](_0x188d14['model'],_0x188d14[_0xaba1('0x33')]);_0x2b7653['attributes']=_['intersection'](_0x188d14[_0xaba1('0x35')],qs[_0xaba1('0x36')](_0x46f839['query']['fields']));_0x2b7653['attributes']=_0x2b7653[_0xaba1('0x37')]['length']?_0x2b7653[_0xaba1('0x37')]:_0x188d14['model'];if(!_0x46f839[_0xaba1('0x33')][_0xaba1('0x38')](_0xaba1('0x39'))){_0x2b7653[_0xaba1('0x20')]=qs[_0xaba1('0x20')](_0x46f839[_0xaba1('0x33')]['limit']);_0x2b7653[_0xaba1('0x1e')]=qs[_0xaba1('0x1e')](_0x46f839[_0xaba1('0x33')]['offset']);}_0x2b7653[_0xaba1('0x3a')]=qs['sort'](_0x46f839[_0xaba1('0x33')][_0xaba1('0x3b')]);_0x2b7653[_0xaba1('0x3c')]=qs[_0xaba1('0x3d')](_[_0xaba1('0x3e')](_0x46f839[_0xaba1('0x33')],_0x188d14[_0xaba1('0x3d')]),_0x1d15f6);if(_0x46f839[_0xaba1('0x33')][_0xaba1('0x3f')]){_0x2b7653[_0xaba1('0x3c')]=_['merge'](_0x2b7653['where'],{'$or':_['map'](_0x1d15f6,function(_0x13a490){if(_0x13a490['type']!==_0xaba1('0x40')){var _0x29b7c2={};_0x29b7c2[_0x13a490[_0xaba1('0x2b')]]={'$like':'%'+_0x46f839[_0xaba1('0x33')]['filter']+'%'};return _0x29b7c2;}})});}_0x2b7653=_['merge']({},_0x2b7653,_0x46f839[_0xaba1('0x41')]);var _0x338480={'where':_0x2b7653[_0xaba1('0x3c')]};return db[_0xaba1('0x2f')][_0xaba1('0x21')](_0x338480)['then'](function(_0x242029){_0x410a69[_0xaba1('0x21')]=_0x242029;if(_0x46f839[_0xaba1('0x33')][_0xaba1('0x42')]){_0x2b7653[_0xaba1('0x43')]=[{'all':!![]}];}return db['FaxApplication'][_0xaba1('0x44')](_0x2b7653);})['then'](function(_0xbbb98e){_0x410a69[_0xaba1('0x45')]=_0xbbb98e;return _0x410a69;})[_0xaba1('0x27')](respondWithFilteredResult(_0x22ca92,_0x2b7653))[_0xaba1('0x46')](handleError(_0x22ca92,null));};exports[_0xaba1('0x47')]=function(_0x161c8a,_0x313a2a){var _0x1825cb={'raw':!![],'where':{'id':_0x161c8a[_0xaba1('0x48')]['id']}},_0xb52ee5={};_0xb52ee5['model']=_[_0xaba1('0x49')](db[_0xaba1('0x2f')]['rawAttributes']);_0xb52ee5['query']=_[_0xaba1('0x49')](_0x161c8a[_0xaba1('0x33')]);_0xb52ee5[_0xaba1('0x3d')]=_[_0xaba1('0x34')](_0xb52ee5['model'],_0xb52ee5['query']);_0x1825cb[_0xaba1('0x37')]=_['intersection'](_0xb52ee5[_0xaba1('0x35')],qs[_0xaba1('0x36')](_0x161c8a[_0xaba1('0x33')][_0xaba1('0x36')]));_0x1825cb['attributes']=_0x1825cb[_0xaba1('0x37')][_0xaba1('0x4a')]?_0x1825cb['attributes']:_0xb52ee5[_0xaba1('0x35')];if(_0x161c8a[_0xaba1('0x33')][_0xaba1('0x42')]){_0x1825cb[_0xaba1('0x43')]=[{'all':!![]}];}_0x1825cb=_['merge']({},_0x1825cb,_0x161c8a[_0xaba1('0x41')]);return db[_0xaba1('0x2f')][_0xaba1('0x4b')](_0x1825cb)[_0xaba1('0x27')](handleEntityNotFound(_0x313a2a,null))['then'](respondWithResult(_0x313a2a,null))[_0xaba1('0x46')](handleError(_0x313a2a,null));};exports[_0xaba1('0x4c')]=function(_0x5d9bc2,_0x2c5c88){return db[_0xaba1('0x2f')]['create'](_0x5d9bc2[_0xaba1('0x4d')],{})[_0xaba1('0x27')](respondWithResult(_0x2c5c88,0xc9))[_0xaba1('0x46')](handleError(_0x2c5c88,null));};exports[_0xaba1('0x26')]=function(_0x500c69,_0x576a09){if(_0x500c69[_0xaba1('0x4d')]['id']){delete _0x500c69[_0xaba1('0x4d')]['id'];}return db[_0xaba1('0x2f')][_0xaba1('0x4b')]({'where':{'id':_0x500c69[_0xaba1('0x48')]['id']}})[_0xaba1('0x27')](handleEntityNotFound(_0x576a09,null))[_0xaba1('0x27')](saveUpdates(_0x500c69[_0xaba1('0x4d')],null))[_0xaba1('0x27')](respondWithResult(_0x576a09,null))['catch'](handleError(_0x576a09,null));};exports[_0xaba1('0x28')]=function(_0x436e08,_0x2854ad){return db[_0xaba1('0x2f')][_0xaba1('0x4b')]({'where':{'id':_0x436e08[_0xaba1('0x48')]['id']}})[_0xaba1('0x27')](handleEntityNotFound(_0x2854ad,null))[_0xaba1('0x27')](removeEntity(_0x2854ad,null))[_0xaba1('0x46')](handleError(_0x2854ad,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 78e96f3..8014371 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 _0x4a62=['rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5ab85a,_0x43275e){var _0x400d41=function(_0x5bf147){while(--_0x5bf147){_0x5ab85a['push'](_0x5ab85a['shift']());}};_0x400d41(++_0x43275e);}(_0x4a62,0x19d));var _0x24a6=function(_0x1eebab,_0x4d6420){_0x1eebab=_0x1eebab-0x0;var _0xdd799=_0x4a62[_0x1eebab];return _0xdd799;};'use strict';var _=require(_0x24a6('0x0'));var util=require(_0x24a6('0x1'));var logger=require('../../config/logger')(_0x24a6('0x2'));var moment=require(_0x24a6('0x3'));var BPromise=require(_0x24a6('0x4'));var rp=require(_0x24a6('0x5'));var fs=require('fs');var path=require(_0x24a6('0x6'));var rimraf=require(_0x24a6('0x7'));var config=require(_0x24a6('0x8'));var attributes=require(_0x24a6('0x9'));module['exports']=function(_0x3f7ab1,_0x30fcbc){return _0x3f7ab1[_0x24a6('0xa')](_0x24a6('0xb'),attributes,{'tableName':_0x24a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24a6('0xd'),'collate':_0x24a6('0xe')});}; \ No newline at end of file +var _0xd9dc=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x581f9a,_0x32f3c1){var _0x2c1b9d=function(_0x36a588){while(--_0x36a588){_0x581f9a['push'](_0x581f9a['shift']());}};_0x2c1b9d(++_0x32f3c1);}(_0xd9dc,0x16f));var _0xcd9d=function(_0x1d3ece,_0x556172){_0x1d3ece=_0x1d3ece-0x0;var _0x2feba1=_0xd9dc[_0x1d3ece];return _0x2feba1;};'use strict';var _=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var logger=require('../../config/logger')(_0xcd9d('0x2'));var moment=require('moment');var BPromise=require(_0xcd9d('0x3'));var rp=require(_0xcd9d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd9d('0x5'));var config=require(_0xcd9d('0x6'));var attributes=require(_0xcd9d('0x7'));module[_0xcd9d('0x8')]=function(_0x345803,_0xe4b7f9){return _0x345803[_0xcd9d('0x9')](_0xcd9d('0xa'),attributes,{'tableName':_0xcd9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd9d('0xc'),'collate':_0xcd9d('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d7c4326..c1fd412 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 _0x7485=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','body','options','raw','lodash','util','bluebird'];(function(_0x2a3035,_0x33a22f){var _0x1f99a6=function(_0x525388){while(--_0x525388){_0x2a3035['push'](_0x2a3035['shift']());}};_0x1f99a6(++_0x33a22f);}(_0x7485,0x135));var _0x5748=function(_0x5a4ce2,_0x2f4542){_0x5a4ce2=_0x5a4ce2-0x0;var _0x2dccf5=_0x7485[_0x5a4ce2];return _0x2dccf5;};'use strict';var _=require(_0x5748('0x0'));var util=require(_0x5748('0x1'));var moment=require('moment');var BPromise=require(_0x5748('0x2'));var rs=require(_0x5748('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5748('0x4'))['db'];var utils=require(_0x5748('0x5'));var logger=require(_0x5748('0x6'))(_0x5748('0x7'));var config=require('../../config/environment');var jayson=require(_0x5748('0x8'));var client=jayson[_0x5748('0x9')][_0x5748('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d8f3,_0x249a4e,_0x2e5b8b){return new BPromise(function(_0x5430fe,_0x5b046e){return client['request'](_0x16d8f3,_0x2e5b8b)[_0x5748('0xb')](function(_0x14abb6){logger[_0x5748('0xc')](_0x5748('0xd'),_0x249a4e,_0x5748('0xe'));logger[_0x5748('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x249a4e,_0x5748('0xe'),JSON[_0x5748('0x10')](_0x14abb6));if(_0x14abb6[_0x5748('0x11')]){if(_0x14abb6[_0x5748('0x11')][_0x5748('0x12')]===0x1f4){logger[_0x5748('0x11')](_0x5748('0xd'),_0x249a4e,_0x14abb6[_0x5748('0x11')][_0x5748('0x13')]);return _0x5b046e(_0x14abb6[_0x5748('0x11')][_0x5748('0x13')]);}logger['error'](_0x5748('0xd'),_0x249a4e,_0x14abb6['error']['message']);return _0x5430fe(_0x14abb6[_0x5748('0x11')][_0x5748('0x13')]);}else{logger[_0x5748('0xc')]('FaxApplication,\x20%s,\x20%s',_0x249a4e,'request\x20sent');_0x5430fe(_0x14abb6['result'][_0x5748('0x13')]);}})[_0x5748('0x14')](function(_0x516790){logger[_0x5748('0x11')]('FaxApplication,\x20%s,\x20%s',_0x249a4e,_0x516790);_0x5b046e(_0x516790);});});}exports[_0x5748('0x15')]=function(_0xda1936){var _0x21bc2f=this;return new Promise(function(_0x498b0d,_0x4c916e){return db[_0x5748('0x16')]['update'](_0xda1936[_0x5748('0x17')],{'raw':_0xda1936[_0x5748('0x18')]?_0xda1936[_0x5748('0x18')][_0x5748('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda1936[_0x5748('0x18')]?_0xda1936['options']['where']||null:null,'attributes':_0xda1936[_0x5748('0x18')]?_0xda1936[_0x5748('0x18')]['attributes']||null:null,'limit':_0xda1936[_0x5748('0x18')]?_0xda1936['options']['limit']||null:null})[_0x5748('0xb')](function(_0x33bc6c){logger[_0x5748('0xc')]('UpdateFaxApplication',_0xda1936);logger['debug'](_0x5748('0x15'),_0xda1936,JSON['stringify'](_0x33bc6c));_0x498b0d(_0x33bc6c);})[_0x5748('0x14')](function(_0x5063a4){logger[_0x5748('0x11')](_0x5748('0x15'),_0x5063a4['message'],_0xda1936);_0x4c916e(_0x21bc2f[_0x5748('0x11')](0x1f4,_0x5063a4['message']));});});}; \ No newline at end of file +var _0x3239=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','body','options','where','limit'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3239,0xcc));var _0x9323=function(_0x3f85ab,_0x4f5199){_0x3f85ab=_0x3f85ab-0x0;var _0x3cd439=_0x3239[_0x3f85ab];return _0x3cd439;};'use strict';var _=require(_0x9323('0x0'));var util=require(_0x9323('0x1'));var moment=require(_0x9323('0x2'));var BPromise=require(_0x9323('0x3'));var rs=require(_0x9323('0x4'));var fs=require('fs');var Redis=require(_0x9323('0x5'));var db=require(_0x9323('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9323('0x7'))(_0x9323('0x8'));var config=require(_0x9323('0x9'));var jayson=require(_0x9323('0xa'));var client=jayson[_0x9323('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1137be,_0x514982,_0x58ff8a){return new BPromise(function(_0x1b0dd4,_0x3cc9f3){return client['request'](_0x1137be,_0x58ff8a)[_0x9323('0xc')](function(_0x4f6857){logger[_0x9323('0xd')](_0x9323('0xe'),_0x514982,_0x9323('0xf'));logger[_0x9323('0x10')](_0x9323('0x11'),_0x514982,_0x9323('0xf'),JSON['stringify'](_0x4f6857));if(_0x4f6857['error']){if(_0x4f6857[_0x9323('0x12')][_0x9323('0x13')]===0x1f4){logger[_0x9323('0x12')](_0x9323('0xe'),_0x514982,_0x4f6857['error']['message']);return _0x3cc9f3(_0x4f6857[_0x9323('0x12')][_0x9323('0x14')]);}logger[_0x9323('0x12')](_0x9323('0xe'),_0x514982,_0x4f6857[_0x9323('0x12')][_0x9323('0x14')]);return _0x1b0dd4(_0x4f6857[_0x9323('0x12')][_0x9323('0x14')]);}else{logger[_0x9323('0xd')](_0x9323('0xe'),_0x514982,_0x9323('0xf'));_0x1b0dd4(_0x4f6857[_0x9323('0x15')][_0x9323('0x14')]);}})[_0x9323('0x16')](function(_0x1c79f6){logger['error'](_0x9323('0xe'),_0x514982,_0x1c79f6);_0x3cc9f3(_0x1c79f6);});});}exports[_0x9323('0x17')]=function(_0x341ea4){var _0x11ced2=this;return new Promise(function(_0x579bc4,_0x417bd2){return db['FaxApplication']['update'](_0x341ea4[_0x9323('0x18')],{'raw':_0x341ea4[_0x9323('0x19')]?_0x341ea4[_0x9323('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341ea4[_0x9323('0x19')]?_0x341ea4[_0x9323('0x19')][_0x9323('0x1a')]||null:null,'attributes':_0x341ea4[_0x9323('0x19')]?_0x341ea4[_0x9323('0x19')]['attributes']||null:null,'limit':_0x341ea4['options']?_0x341ea4[_0x9323('0x19')][_0x9323('0x1b')]||null:null})['then'](function(_0x3097c8){logger[_0x9323('0xd')](_0x9323('0x17'),_0x341ea4);logger[_0x9323('0x10')](_0x9323('0x17'),_0x341ea4,JSON[_0x9323('0x1c')](_0x3097c8));_0x579bc4(_0x3097c8);})[_0x9323('0x16')](function(_0x26061){logger[_0x9323('0x12')](_0x9323('0x17'),_0x26061['message'],_0x341ea4);_0x417bd2(_0x11ced2[_0x9323('0x12')](0x1f4,_0x26061[_0x9323('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1ed1707..29c7051 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 _0xef0f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0xef0f,0x168));var _0xfef0=function(_0x4a1735,_0x1cb7db){_0x4a1735=_0x4a1735-0x0;var _0x3b4929=_0xef0f[_0x4a1735];return _0x3b4929;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['post']('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xd')]);router[_0xfef0('0xe')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xf')]);router[_0xfef0('0x10')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x11')]);module[_0xfef0('0x12')]=router; \ No newline at end of file +var _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x12de45,_0x320962){_0x12de45=_0x12de45-0x0;var _0xf14ba5=_0xefda[_0x12de45];return _0xf14ba5;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index a0dff18..e16f6ef 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 _0xa638=['STRING','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x54d3bc,_0x237d35){var _0x116eb4=function(_0x267e48){while(--_0x267e48){_0x54d3bc['push'](_0x54d3bc['shift']());}};_0x116eb4(++_0x237d35);}(_0xa638,0x7a));var _0x8a63=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa638[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0x8a63('0x0'));module[_0x8a63('0x1')]={'closed':{'type':Sequelize[_0x8a63('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a63('0x3')]},'disposition':{'type':Sequelize[_0x8a63('0x4')]},'secondDisposition':{'type':Sequelize[_0x8a63('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8a63('0x4')]},'note':{'type':Sequelize[_0x8a63('0x4')]},'read1stAt':{'type':Sequelize[_0x8a63('0x3')]},'fax':{'type':Sequelize[_0x8a63('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8a63('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a63('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8a63('0x6')]('in',_0x8a63('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1822=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x55f190,_0x4235cd){var _0x27f517=function(_0xf70cbf){while(--_0xf70cbf){_0x55f190['push'](_0x55f190['shift']());}};_0x27f517(++_0x4235cd);}(_0x1822,0x11f));var _0x2182=function(_0x2d2d29,_0xe91ee7){_0x2d2d29=_0x2d2d29-0x0;var _0x19f7c5=_0x1822[_0x2d2d29];return _0x19f7c5;};'use strict';var Sequelize=require(_0x2182('0x0'));module[_0x2182('0x1')]={'closed':{'type':Sequelize[_0x2182('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2182('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2182('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2182('0x4')]},'note':{'type':Sequelize[_0x2182('0x4')]},'read1stAt':{'type':Sequelize[_0x2182('0x3')]},'fax':{'type':Sequelize[_0x2182('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2182('0x5')]('in',_0x2182('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 4dfa5d8..e659eda 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 _0x81fe=['Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','show','include','options','create','body','addMessage','FaxMessage','params','omit','ids','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','Tag','emit','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','push','catch','waiting','talking','unmanaged','total','UserId','closed','answered','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','sort','where','pick','select','field','color','tools_tags','u.fullname','from','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','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','length','keyBy','merge','FaxInteraction','fields','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax'];(function(_0x3a4435,_0x371b1f){var _0x5c05d2=function(_0x4938d1){while(--_0x4938d1){_0x3a4435['push'](_0x3a4435['shift']());}};_0x5c05d2(++_0x371b1f);}(_0x81fe,0x1e0));var _0xe81f=function(_0x51f69b,_0x3dd879){_0x51f69b=_0x51f69b-0x0;var _0x4996f2=_0x81fe[_0x51f69b];return _0x4996f2;};'use strict';var emlformat=require(_0xe81f('0x0'));var rimraf=require(_0xe81f('0x1'));var zipdir=require(_0xe81f('0x2'));var jsonpatch=require(_0xe81f('0x3'));var rp=require(_0xe81f('0x4'));var moment=require(_0xe81f('0x5'));var BPromise=require(_0xe81f('0x6'));var Mustache=require(_0xe81f('0x7'));var util=require(_0xe81f('0x8'));var path=require(_0xe81f('0x9'));var sox=require(_0xe81f('0xa'));var csv=require(_0xe81f('0xb'));var ejs=require(_0xe81f('0xc'));var fs=require('fs');var fs_extra=require(_0xe81f('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe81f('0xe'));var deskjs=require(_0xe81f('0xf'));var toCsv=require(_0xe81f('0xb'));var querystring=require('querystring');var Papa=require(_0xe81f('0x10'));var Redis=require(_0xe81f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe81f('0x12'));var as=require(_0xe81f('0x13'));var hardwareService=require(_0xe81f('0x14'));var logger=require(_0xe81f('0x15'))(_0xe81f('0x16'));var utils=require(_0xe81f('0x17'));var config=require(_0xe81f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe81f('0x19'))['db'];config[_0xe81f('0x1a')]=_['defaults'](config[_0xe81f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe81f('0x1b'))(new Redis(config[_0xe81f('0x1a')]));require(_0xe81f('0x1c'))['register'](socket);function respondWithStatusCode(_0x16baa2,_0x68cad9){_0x68cad9=_0x68cad9||0xcc;return function(_0x92fedd){if(_0x92fedd){return _0x16baa2[_0xe81f('0x1d')](_0x68cad9);}return _0x16baa2[_0xe81f('0x1e')](_0x68cad9)[_0xe81f('0x1f')]();};}function respondWithResult(_0x167244,_0x38bf05){_0x38bf05=_0x38bf05||0xc8;return function(_0x25f541){if(_0x25f541){return _0x167244[_0xe81f('0x1e')](_0x38bf05)[_0xe81f('0x20')](_0x25f541);}};}function respondWithFilteredResult(_0x2b8753,_0x4947ac){return function(_0x551364){if(_0x551364){var _0x398f17=typeof _0x4947ac[_0xe81f('0x21')]==='undefined'&&typeof _0x4947ac['limit']===_0xe81f('0x22');var _0x10cd34=_0x551364[_0xe81f('0x23')];var _0x503c64=_0x398f17?0x0:_0x4947ac[_0xe81f('0x21')];var _0x431bb5=_0x398f17?_0x551364[_0xe81f('0x23')]:_0x4947ac[_0xe81f('0x21')]+_0x4947ac[_0xe81f('0x24')];var _0x559c20;if(_0x431bb5>=_0x10cd34){_0x431bb5=_0x10cd34;_0x559c20=0xc8;}else{_0x559c20=0xce;}_0x2b8753[_0xe81f('0x1e')](_0x559c20);return _0x2b8753[_0xe81f('0x25')]('Content-Range',_0x503c64+'-'+_0x431bb5+'/'+_0x10cd34)['json'](_0x551364);}return null;};}function patchUpdates(_0x59bc41){return function(_0x43741b){try{jsonpatch[_0xe81f('0x26')](_0x43741b,_0x59bc41,!![]);}catch(_0x239e4c){return BPromise[_0xe81f('0x27')](_0x239e4c);}return _0x43741b[_0xe81f('0x28')]();};}function saveUpdates(_0x4c48d0,_0x323d90){return function(_0x15a165){if(_0x15a165){return _0x15a165[_0xe81f('0x29')](_0x4c48d0)['then'](function(_0x1ed8f8){return _0x1ed8f8;});}return null;};}function removeEntity(_0x257ecb,_0x7da5c7){return function(_0x31a544){if(_0x31a544){return _0x31a544[_0xe81f('0x2a')]()[_0xe81f('0x2b')](function(){_0x257ecb[_0xe81f('0x1e')](0xcc)[_0xe81f('0x1f')]();});}};}function handleEntityNotFound(_0x1d032d,_0x1a998e){return function(_0xc3c4d9){if(!_0xc3c4d9){_0x1d032d[_0xe81f('0x1d')](0x194);}return _0xc3c4d9;};}function handleError(_0x53a2d6,_0x1f3711){_0x1f3711=_0x1f3711||0x1f4;return function(_0x2f1fea){logger['error'](_0x2f1fea[_0xe81f('0x2c')]);if(_0x2f1fea['name']){delete _0x2f1fea[_0xe81f('0x2d')];}_0x53a2d6[_0xe81f('0x1e')](_0x1f3711)[_0xe81f('0x2e')](_0x2f1fea);};}function getInteractionUsers(_0x32473c,_0x36cef1){return new BPromise(function(_0x1ce61f,_0x106721){try{if(_0x36cef1[_0x32473c['id']]){_0x32473c[_0xe81f('0x2f')]=_[_0xe81f('0x30')](_0x36cef1[_0x32473c['id']],function(_0x98b5a6){return{'id':_0x98b5a6['id'],'fullname':_0x98b5a6[_0xe81f('0x31')]};});}}catch(_0x24f5e9){_0x106721(_0x24f5e9);}_0x1ce61f(_0x32473c);});}function getInteractionTags(_0x4e38e2,_0x3a4c71){return new BPromise(function(_0x30c6ec,_0x20ff3c){try{if(_0x4e38e2['TagIds']){_0x4e38e2[_0xe81f('0x32')]=[];_0x4e38e2[_0xe81f('0x33')]['split'](',')[_0xe81f('0x34')](function(_0x16d939){_0x4e38e2['Tags'][_0xe81f('0x35')](_0x3a4c71[_0x16d939]);});}delete _0x4e38e2[_0xe81f('0x33')];}catch(_0x3b756e){_0x20ff3c(_0x3b756e);}_0x30c6ec(_0x4e38e2);});}function updateFaxInteraction(_0x38634d,_0x145a1b,_0x427510){return new BPromise(function(_0x514321,_0x13abb4){return getInteractionUsers(_0x38634d,_0x427510)[_0xe81f('0x2b')](function(_0x4a6163){return getInteractionTags(_0x4a6163,_0x145a1b);})[_0xe81f('0x2b')](function(_0x3ce12b){return getStateInteraction(_0x3ce12b);})[_0xe81f('0x2b')](function(_0x39a9e2){_0x514321(_0x39a9e2);})[_0xe81f('0x36')](function(_0x14cf5e){_0x13abb4(_0x14cf5e);});});}function getStateInteraction(_0x39009e){return new BPromise(function(_0x3b7073){_0x39009e[_0xe81f('0x37')]=0x0;_0x39009e[_0xe81f('0x38')]=0x0;_0x39009e['answered']=0x0;_0x39009e[_0xe81f('0x39')]=0x0;_0x39009e[_0xe81f('0x3a')]=0x0;if(!_0x39009e['closed']&&!_0x39009e[_0xe81f('0x3b')]){_0x39009e[_0xe81f('0x37')]+=0x1;}if(!_0x39009e[_0xe81f('0x3c')]&&_0x39009e[_0xe81f('0x3b')]){_0x39009e[_0xe81f('0x38')]+=0x1;if(_0x39009e[_0xe81f('0x37')]){_0x39009e['waiting']-=0x1;}}if(_0x39009e[_0xe81f('0x3c')]&&_0x39009e[_0xe81f('0x3b')]){_0x39009e[_0xe81f('0x3d')]+=0x1;if(_0x39009e[_0xe81f('0x38')]){_0x39009e[_0xe81f('0x38')]-=0x1;}}if(_0x39009e[_0xe81f('0x3c')]&&!_0x39009e[_0xe81f('0x3b')]){_0x39009e[_0xe81f('0x39')]+=0x1;if(_0x39009e[_0xe81f('0x37')]){_0x39009e[_0xe81f('0x37')]-=0x1;}}_0x39009e[_0xe81f('0x3a')]+=0x1;_0x3b7073(_0x39009e);});}exports[_0xe81f('0x3e')]=function(_0x180af2,_0x44e920){var _0x2683e1={},_0x8531cb={},_0x4dc5e2={'count':0x0,'rows':[]};var _0x3973ac=_['map'](db['FaxInteraction'][_0xe81f('0x3f')],function(_0x25e3f2){return{'name':_0x25e3f2[_0xe81f('0x40')],'type':_0x25e3f2[_0xe81f('0x41')][_0xe81f('0x42')]};});_0x8531cb[_0xe81f('0x43')]=_[_0xe81f('0x30')](_0x3973ac,'name');_0x8531cb[_0xe81f('0x44')]=_['keys'](_0x180af2[_0xe81f('0x44')]);_0x8531cb[_0xe81f('0x45')]=_[_0xe81f('0x46')](_0x8531cb[_0xe81f('0x43')],_0x8531cb[_0xe81f('0x44')]);_0x2683e1['attributes']=_[_0xe81f('0x46')](_0x8531cb[_0xe81f('0x43')],qs['fields'](_0x180af2[_0xe81f('0x44')]['fields']));_0x2683e1[_0xe81f('0x47')]=_0x2683e1[_0xe81f('0x47')]['length']?_0x2683e1[_0xe81f('0x47')]:_0x8531cb[_0xe81f('0x43')];if(!_0x180af2[_0xe81f('0x44')]['hasOwnProperty']('nolimit')){_0x2683e1[_0xe81f('0x24')]=qs['limit'](_0x180af2[_0xe81f('0x44')][_0xe81f('0x24')]);_0x2683e1[_0xe81f('0x21')]=qs[_0xe81f('0x21')](_0x180af2[_0xe81f('0x44')][_0xe81f('0x21')]);}_0x2683e1['order']=qs[_0xe81f('0x48')](_0x180af2[_0xe81f('0x44')]['sort']);_0x2683e1[_0xe81f('0x49')]=qs[_0xe81f('0x45')](_[_0xe81f('0x4a')](_0x180af2[_0xe81f('0x44')],_0x8531cb['filters']),_0x3973ac);var _0x4d10cf=[];var _0x399b3e=squel[_0xe81f('0x4b')]()[_0xe81f('0x4c')]('id')['field'](_0xe81f('0x2d'))['field'](_0xe81f('0x4d'))['from'](_0xe81f('0x4e'));var _0x11ade6=squel[_0xe81f('0x4b')]()[_0xe81f('0x4c')]('u.id')[_0xe81f('0x4c')](_0xe81f('0x4f'))[_0xe81f('0x4c')]('ui.FaxInteractionId')[_0xe81f('0x50')](_0xe81f('0x51'),'ui')[_0xe81f('0x52')](_0xe81f('0x53'),'u',_0xe81f('0x54'));var _0xa5154e=squel['select']()[_0xe81f('0x50')](_0xe81f('0x55'),'i')[_0xe81f('0x52')](_0xe81f('0x56'),'c',_0xe81f('0x57'))[_0xe81f('0x52')]('users','o',_0xe81f('0x58'))[_0xe81f('0x52')](_0xe81f('0x59'),'a',_0xe81f('0x5a'))[_0xe81f('0x52')](_0xe81f('0x5b'),'me',_0xe81f('0x5c'))['left_join'](_0xe81f('0x5d'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join'](_0xe81f('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x246ae8=squel['expr']();var _0x2c3a44=[];var _0x417dcc=squel[_0xe81f('0x5e')]();var _0xddb2b9;if(_0x180af2[_0xe81f('0x44')][_0xe81f('0x5f')]){_0xddb2b9=as['parseSearch'](_0x180af2[_0xe81f('0x44')][_0xe81f('0x5f')]);var _0xb9366b=_0xddb2b9['sqlOperator'];for(var _0x45f57c=0x0;_0x45f57c<_0xddb2b9[_0xe81f('0x60')]['length'];_0x45f57c++){var _0x5b6a63=_0xddb2b9[_0xe81f('0x60')][_0x45f57c];var _0xed1b5f='i';var _0x25ee65=_[_0xe81f('0x61')](_0x3973ac,[_0xe81f('0x2d'),_0x5b6a63[_0xe81f('0x4c')]]);if(!_0x25ee65){switch(_0x5b6a63[_0xe81f('0x4c')]){case _0xe81f('0x62'):if(_0x5b6a63[_0xe81f('0x63')]==0x1){_0xa5154e[_0xe81f('0x64')]('`'+_0x5b6a63[_0xe81f('0x4c')]+_0xe81f('0x65'));}else{_0xa5154e[_0xe81f('0x64')]('`'+_0x5b6a63[_0xe81f('0x4c')]+_0xe81f('0x66'));}break;case _0xe81f('0x67'):if(_0x5b6a63['operator']==='$substring'){if(_0x5b6a63['value']['split']('\x20')['length']>0x1){_0x246ae8[_0xb9366b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe81f('0x68')](_0x5b6a63[_0xe81f('0x63')]),null);}else{var _0x529f4a='%'+_0x5b6a63[_0xe81f('0x63')]+'%';_0x246ae8[_0xb9366b](_0xe81f('0x69'),_0x529f4a,_0x529f4a,_0x529f4a);}}else{_0x25ee65=_[_0xe81f('0x61')](_0x3973ac,[_0xe81f('0x2d'),_0xe81f('0x6a')]);_0x5b6a63[_0xe81f('0x4c')]=_0xe81f('0x6a');_0xa68575=as[_0xe81f('0x6b')](_0xed1b5f,_0x25ee65[_0xe81f('0x41')],_0x5b6a63);_0x246ae8[_0xb9366b](_0xa68575[_0xe81f('0x6c')],_0xa68575[_0xe81f('0x63')][_0xe81f('0x6d')],_0xa68575[_0xe81f('0x63')]['end']);}break;case'Tag':var _0x258d41=_0x5b6a63['value'][_0xe81f('0x6e')](',')[_0xe81f('0x30')](function(_0x475fd2){return Number(_0x475fd2);});_0x258d41[_0xe81f('0x34')](function(_0x484250){_0x417dcc['or'](_0xe81f('0x6f'),'%,'+_0x484250+',%');});_0x2c3a44=_[_0xe81f('0x70')](_0x2c3a44,_0x258d41);break;case _0xe81f('0x71'):if(_0x5b6a63[_0xe81f('0x72')]===_0xe81f('0x73')){_0x246ae8[_0xb9366b](_0xe81f('0x74'),'%'+_0x5b6a63[_0xe81f('0x63')]+'%',null);}else{_0x25ee65=_[_0xe81f('0x61')](_0x3973ac,[_0xe81f('0x2d'),_0xe81f('0x3b')]);_0x5b6a63[_0xe81f('0x4c')]=_0xe81f('0x3b');_0xa68575=as[_0xe81f('0x6b')](_0xed1b5f,_0x25ee65['type'],_0x5b6a63);_0x246ae8[_0xb9366b](_0xa68575['text'],_0xa68575[_0xe81f('0x63')][_0xe81f('0x6d')],_0xa68575[_0xe81f('0x63')][_0xe81f('0x1f')]);}break;case'body':_0xa68575=as[_0xe81f('0x6b')]('me',null,_0x5b6a63);_0x246ae8[_0xb9366b](_0xa68575['text'],_0xa68575['value'][_0xe81f('0x6d')],_0xa68575[_0xe81f('0x63')]['end']);break;}}else{var _0xa68575=as[_0xe81f('0x6b')](_0xed1b5f,_0x25ee65[_0xe81f('0x41')],_0x5b6a63);_0x246ae8[_0xb9366b](_0xa68575[_0xe81f('0x6c')],_0xa68575['value'][_0xe81f('0x6d')],_0xa68575['value'][_0xe81f('0x1f')]);}}}else{var _0x2292f8=_(_0x180af2[_0xe81f('0x44')])[_0xe81f('0x75')]()[_0xe81f('0x30')](function(_0x9f0001){return _[_0xe81f('0x76')](_0x3973ac,['name',_0x9f0001])?_0x9f0001:undefined;})[_0xe81f('0x77')]()[_0xe81f('0x63')]();if(!_[_0xe81f('0x78')](_0x2292f8)){_0x2292f8[_0xe81f('0x34')](function(_0x22e3e5){if(_0x22e3e5===_0xe81f('0x79')){_0xa5154e['where'](_0xe81f('0x7a'),[]['concat'](_0x180af2[_0xe81f('0x44')][_0x22e3e5]));}else if(_0x22e3e5===_0xe81f('0x7b')){var _0xa50429=JSON[_0xe81f('0x7c')](_0x180af2[_0xe81f('0x44')][_0x22e3e5])['$gte'];var _0x21d49b=JSON['parse'](_0x180af2[_0xe81f('0x44')][_0x22e3e5])[_0xe81f('0x7d')];_0xa5154e[_0xe81f('0x49')](_0xe81f('0x7e'),_0xa50429,_0x21d49b);}else{if(_0x180af2[_0xe81f('0x44')][_0x22e3e5]===_0xe81f('0x7f')){_0xa5154e['where']('i.'+_0x22e3e5+_0xe81f('0x80'));}else{_0xa5154e[_0xe81f('0x49')]('i.'+_0x22e3e5+'\x20=\x20?',_0x180af2['query'][_0x22e3e5]);}}});}if(_0x180af2['query'][_0xe81f('0x81')]){if(_0x180af2[_0xe81f('0x44')]['read']==0x1){_0xa5154e[_0xe81f('0x64')](_0xe81f('0x82'));}else{_0xa5154e[_0xe81f('0x64')](_0xe81f('0x83'));}}if(_0x180af2[_0xe81f('0x44')][_0xe81f('0x84')]){_0x2c3a44=_[_0xe81f('0x85')](_0x180af2[_0xe81f('0x44')][_0xe81f('0x84')])?_0x180af2[_0xe81f('0x44')][_0xe81f('0x84')]:new Array(_0x180af2['query'][_0xe81f('0x84')]);_0x2c3a44[_0xe81f('0x34')](function(_0x3bc2f8){_0x417dcc['or'](_0xe81f('0x6f'),'%,'+_0x3bc2f8+',%');});}if(_0x180af2[_0xe81f('0x44')][_0xe81f('0x86')]){var _0x1194a7=_0x180af2[_0xe81f('0x44')][_0xe81f('0x86')][_0xe81f('0x87')]('\x5c','\x5c\x5c')[_0xe81f('0x87')](/'/g,'\x27\x27');if(qs[_0xe81f('0x88')](_0x1194a7)){_0x246ae8['or'](_0xe81f('0x89'),_0x1194a7+'%')['or'](_0xe81f('0x8a'),_0x1194a7+'%');}_0x246ae8['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1194a7+'%');}}_0xa5154e[_0xe81f('0x49')](_0x246ae8);_0xa5154e[_0xe81f('0x8b')]('i.id');var _0x57a051={'type':db['Sequelize'][_0xe81f('0x8c')]['SELECT'],'raw':!![]};var _0x494aae=_0xa5154e['clone']();_0x494aae[_0xe81f('0x4c')](_0xe81f('0x8d'));_0x494aae[_0xe81f('0x4c')](_0xe81f('0x8e'),'unreadMessages');if(_0x2683e1[_0xe81f('0x8f')]){_0x2683e1[_0xe81f('0x8f')][_0xe81f('0x34')](function(_0x1374d8){var _0x48cc86=_0x1374d8[0x0]===_0xe81f('0x90')?_0x1374d8[0x0]:'i.'+_0x1374d8[0x0];_0xa5154e[_0xe81f('0x8f')](_0x48cc86,_0x1374d8[0x1]===_0xe81f('0x91')?![]:!![]);});}if(!_[_0xe81f('0x78')](_0x2c3a44)){_0xa5154e['having'](_0x417dcc);_0x494aae[_0xe81f('0x49')](_0xe81f('0x92'),_0x2c3a44);}BPromise['resolve']()['then'](function(){if(!_0xddb2b9){if(_0x180af2[_0xe81f('0x44')][_0xe81f('0x79')])return;_0x494aae[_0xe81f('0x49')](_0xe81f('0x93'));_0xa5154e['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x180af2['user'][_0xe81f('0x94')]!==_0xe81f('0x95'))return;return _0x180af2[_0xe81f('0x96')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xe81f('0x2b')](function(_0x3a5141){if(_[_0xe81f('0x78')](_0x3a5141)){_0x494aae['where'](_0xe81f('0x97'));_0xa5154e[_0xe81f('0x49')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x494aae[_0xe81f('0x49')]('i.FaxAccountId\x20IN\x20?',_[_0xe81f('0x30')](_0x3a5141,'id'));_0xa5154e[_0xe81f('0x49')](_0xe81f('0x7a'),_[_0xe81f('0x30')](_0x3a5141,'id'));}});})[_0xe81f('0x2b')](function(){if(_0x180af2[_0xe81f('0x96')]['role']===_0xe81f('0x95')&&!_0xddb2b9&&!_0x180af2[_0xe81f('0x44')][_0xe81f('0x79')])return[];return db[_0xe81f('0x98')][_0xe81f('0x44')](_0x494aae[_0xe81f('0x99')](),_0x57a051);})[_0xe81f('0x2b')](function(_0x49e318){_0x4dc5e2[_0xe81f('0x23')]=_0x49e318[_0xe81f('0x9a')];if(_0x4dc5e2[_0xe81f('0x23')]===0x0)return[];return db[_0xe81f('0x98')][_0xe81f('0x44')](_0x399b3e[_0xe81f('0x99')](),_0x57a051)[_0xe81f('0x2b')](function(_0x32a1d4){_0x4d10cf=_[_0xe81f('0x9b')](_0x32a1d4,'id');_0x57a051=_[_0xe81f('0x9c')](_0x57a051,{'model':db[_0xe81f('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x180af2[_0xe81f('0x44')][_0xe81f('0x9e')]){_0x2683e1[_0xe81f('0x47')][_0xe81f('0x34')](function(_0x3ee544){_0xa5154e[_0xe81f('0x4c')]('i.'+_0x3ee544);});}else{_0xa5154e[_0xe81f('0x4c')](_0xe81f('0x8e'),_0xe81f('0x62'));_0xa5154e[_0xe81f('0x4c')](_0xe81f('0x9f'),'Account.key');_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xa0'),'Account.mandatoryDisposition');_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xa1'),_0xe81f('0x90'));_0xa5154e[_0xe81f('0x4c')]('i.*');_0xa5154e['field'](_0xe81f('0xa2'),_0xe81f('0xa3'));_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xa4'),_0xe81f('0xa5'));_0xa5154e[_0xe81f('0x4c')]('c.email',_0xe81f('0xa6'));_0xa5154e[_0xe81f('0x4c')]('c.phone',_0xe81f('0xa7'));_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xa8'),_0xe81f('0xa9'));_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xaa'),_0xe81f('0xab'));_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xac'),'Owner.fullname');_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xad'),'Owner.internal');_0xa5154e[_0xe81f('0x4c')](_0xe81f('0xae'),_0xe81f('0x33'));}if(_0x2683e1[_0xe81f('0x24')])_0xa5154e[_0xe81f('0x24')](_0x2683e1[_0xe81f('0x24')]);if(_0x2683e1[_0xe81f('0x21')])_0xa5154e[_0xe81f('0x21')](_0x2683e1['offset']);return db[_0xe81f('0x98')][_0xe81f('0x44')](_0xa5154e['toString'](),_0x57a051);})['then'](function(_0x9a9cea){if(_0x9a9cea[_0xe81f('0x9a')]>0x0)_0x11ade6[_0xe81f('0x49')](_0xe81f('0xaf'),_[_0xe81f('0x30')](_0x9a9cea,'id'));return db[_0xe81f('0x98')][_0xe81f('0x44')](_0x11ade6[_0xe81f('0x99')](),_0x57a051)[_0xe81f('0x2b')](function(_0x49079f){var _0x10b482=_['groupBy'](_0x49079f,_0xe81f('0xb0'));var _0x1f6e8d=[];_0x9a9cea['forEach'](function(_0x316a2e){_0x1f6e8d[_0xe81f('0x35')](updateFaxInteraction(_0x316a2e,_0x4d10cf,_0x10b482));});return BPromise['all'](_0x1f6e8d);});});})['then'](function(_0x547b43){_0x4dc5e2[_0xe81f('0xb1')]=_0x547b43;return _0x4dc5e2;})[_0xe81f('0x2b')](respondWithFilteredResult(_0x44e920,_0x2683e1))[_0xe81f('0x36')](handleError(_0x44e920,null));};exports[_0xe81f('0xb2')]=function(_0x401666,_0x22b8f4){var _0x2549a4={'raw':![],'where':{'id':_0x401666['params']['id']}},_0x5cfefa={};_0x5cfefa['model']=_[_0xe81f('0x75')](db[_0xe81f('0x9d')]['rawAttributes']);_0x5cfefa[_0xe81f('0x44')]=_[_0xe81f('0x75')](_0x401666[_0xe81f('0x44')]);_0x5cfefa[_0xe81f('0x45')]=_[_0xe81f('0x46')](_0x5cfefa[_0xe81f('0x43')],_0x5cfefa['query']);_0x2549a4['attributes']=_[_0xe81f('0x46')](_0x5cfefa[_0xe81f('0x43')],qs[_0xe81f('0x9e')](_0x401666[_0xe81f('0x44')]['fields']));_0x2549a4[_0xe81f('0x47')]=_0x2549a4['attributes'][_0xe81f('0x9a')]?_0x2549a4['attributes']:_0x5cfefa[_0xe81f('0x43')];if(_0x401666[_0xe81f('0x44')]['includeAll']){_0x2549a4[_0xe81f('0xb3')]=[{'all':!![]}];}_0x2549a4=_['merge']({},_0x2549a4,_0x401666[_0xe81f('0xb4')]);return db['FaxInteraction'][_0xe81f('0x61')](_0x2549a4)[_0xe81f('0x2b')](handleEntityNotFound(_0x22b8f4,null))[_0xe81f('0x2b')](respondWithResult(_0x22b8f4,null))[_0xe81f('0x36')](handleError(_0x22b8f4,null));};exports[_0xe81f('0xb5')]=function(_0x4695cd,_0x31d451){return db[_0xe81f('0x9d')][_0xe81f('0xb5')](_0x4695cd['body'],{})[_0xe81f('0x2b')](respondWithResult(_0x31d451,0xc9))['catch'](handleError(_0x31d451,null));};exports[_0xe81f('0x29')]=function(_0x1c3946,_0x5bca95){if(_0x1c3946[_0xe81f('0xb6')]['id']){delete _0x1c3946['body']['id'];}return db[_0xe81f('0x9d')][_0xe81f('0x61')]({'where':{'id':_0x1c3946['params']['id']}})[_0xe81f('0x2b')](handleEntityNotFound(_0x5bca95,null))[_0xe81f('0x2b')](saveUpdates(_0x1c3946[_0xe81f('0xb6')],null))['then'](respondWithResult(_0x5bca95,null))['catch'](handleError(_0x5bca95,null));};exports[_0xe81f('0x2a')]=function(_0x5ba31c,_0x9767f0){return db['FaxInteraction'][_0xe81f('0x61')]({'where':{'id':_0x5ba31c['params']['id']}})['then'](handleEntityNotFound(_0x9767f0,null))[_0xe81f('0x2b')](removeEntity(_0x9767f0,null))['catch'](handleError(_0x9767f0,null));};exports['describe']=function(_0x516d3d,_0x1610b0){return db[_0xe81f('0x9d')]['describe']()[_0xe81f('0x2b')](respondWithResult(_0x1610b0,null))[_0xe81f('0x36')](handleError(_0x1610b0,null));};exports[_0xe81f('0xb7')]=function(_0x26c1d1,_0x2b492,_0xe4f648){return db[_0xe81f('0xb8')]['find']({'where':{'id':_0x26c1d1[_0xe81f('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2b492,null))[_0xe81f('0x2b')](function(_0x1fe588){if(_0x1fe588){return _0x1fe588[_0xe81f('0xb7')](_0x26c1d1['body']['ids'],_[_0xe81f('0xba')](_0x26c1d1['body'],[_0xe81f('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x2b492,null))[_0xe81f('0x36')](handleError(_0x2b492,null));};exports['getMessages']=function(_0x3eb968,_0x5e8d6f,_0x93c4f){var _0x30b19d={'raw':![],'where':{}};var _0x291a2f={};var _0xcf3f0c={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xe81f('0xbc')]({'where':{'id':_0x3eb968['params']['id']}})['then'](handleEntityNotFound(_0x5e8d6f,null))[_0xe81f('0x2b')](function(_0x2f4e66){if(_0x2f4e66){_0x291a2f[_0xe81f('0x43')]=_[_0xe81f('0x75')](db['FaxMessage']['rawAttributes']);_0x291a2f[_0xe81f('0x44')]=_[_0xe81f('0x75')](_0x3eb968[_0xe81f('0x44')]);_0x291a2f[_0xe81f('0x45')]=_['intersection'](_0x291a2f[_0xe81f('0x43')],_0x291a2f[_0xe81f('0x44')]);_0x30b19d['attributes']=_['intersection'](_0x291a2f[_0xe81f('0x43')],qs[_0xe81f('0x9e')](_0x3eb968['query'][_0xe81f('0x9e')]));_0x30b19d[_0xe81f('0x47')]=_0x30b19d['attributes'][_0xe81f('0x9a')]?_0x30b19d[_0xe81f('0x47')]:_0x291a2f[_0xe81f('0x43')];if(!_0x3eb968[_0xe81f('0x44')]['hasOwnProperty']('nolimit')){_0x30b19d[_0xe81f('0x24')]=qs[_0xe81f('0x24')](_0x3eb968[_0xe81f('0x44')][_0xe81f('0x24')]);_0x30b19d[_0xe81f('0x21')]=qs[_0xe81f('0x21')](_0x3eb968['query'][_0xe81f('0x21')]);}_0x30b19d[_0xe81f('0x8f')]=qs[_0xe81f('0x48')](_0x3eb968[_0xe81f('0x44')]['sort']);_0x30b19d[_0xe81f('0x49')]=qs[_0xe81f('0x45')](_['pick'](_0x3eb968[_0xe81f('0x44')],_0x291a2f[_0xe81f('0x45')]));_0x30b19d['where'][_0xe81f('0xb0')]=_0x2f4e66['id'];if(_0x3eb968[_0xe81f('0x44')][_0xe81f('0x86')]){_0x30b19d[_0xe81f('0x49')]=_[_0xe81f('0x9c')](_0x30b19d[_0xe81f('0x49')],{'$or':_[_0xe81f('0x30')](_0x30b19d[_0xe81f('0x47')],function(_0x1514e7){var _0x4b55={};_0x4b55[_0x1514e7]={'$like':'%'+_0x3eb968['query']['filter']+'%'};return _0x4b55;})});}if(_0x3eb968['query'][_0xe81f('0xbd')]){var _0x3d02e8=_0x3eb968['query']['$gte']['split'](',');var _0x2aaa0a={};_0x2aaa0a[_0x3d02e8[0x0]]={'$gte':moment(_0x3d02e8[0x1])[_0xe81f('0xbe')](_0xe81f('0xbf'))};_0x30b19d[_0xe81f('0x49')]=_['merge'](_0x30b19d[_0xe81f('0x49')],_0x2aaa0a);}_0x30b19d=_[_0xe81f('0x9c')]({},_0x30b19d,_0x3eb968[_0xe81f('0xb4')]);return db[_0xe81f('0xb8')][_0xe81f('0x23')]({'where':_0x30b19d['where']})['then'](function(_0x58f713){_0xcf3f0c[_0xe81f('0x23')]=_0x58f713;if(_0x3eb968[_0xe81f('0x44')][_0xe81f('0xc0')]){_0x30b19d[_0xe81f('0xb3')]=[{'all':!![]}];}return db[_0xe81f('0xb8')][_0xe81f('0xc1')](_0x30b19d);})[_0xe81f('0x2b')](function(_0xfbb1f3){_0xcf3f0c[_0xe81f('0xb1')]=_0xfbb1f3;return _0xcf3f0c;});}})[_0xe81f('0x2b')](respondWithFilteredResult(_0x5e8d6f,_0x30b19d))[_0xe81f('0x36')](handleError(_0x5e8d6f,null));};exports[_0xe81f('0xc2')]=function(_0x5d819b,_0x44100b,_0x93bfa1){return db['FaxInteraction'][_0xe81f('0x61')]({'where':{'id':_0x5d819b[_0xe81f('0xb9')]['id']}})[_0xe81f('0x2b')](handleEntityNotFound(_0x44100b,null))['then'](function(_0x58845d){if(_0x58845d){return _0x58845d['setTags'](_0x5d819b[_0xe81f('0xb6')][_0xe81f('0xbb')],_['omit'](_0x5d819b['body'],[_0xe81f('0xbb'),'id'])||{})[_0xe81f('0xc3')](function(){return db[_0xe81f('0xc4')][_0xe81f('0xc1')]({'attributes':['id',_0xe81f('0x2d'),_0xe81f('0x4d')],'where':{'id':_0x5d819b[_0xe81f('0xb6')][_0xe81f('0xbb')]}});})[_0xe81f('0x2b')](function(_0x756fa6){socket[_0xe81f('0xc5')]('faxInteractionTags:save',{'id':Number(_0x5d819b[_0xe81f('0xb9')]['id']),'tags':_0x756fa6||[]});return{'id':Number(_0x5d819b['params']['id']),'tags':_0x756fa6||[]};});}})[_0xe81f('0x2b')](respondWithResult(_0x44100b,null))['catch'](handleError(_0x44100b,null));};exports[_0xe81f('0xc6')]=function(_0x3a9bc4,_0x110d09,_0x4eaec2){return db['FaxInteraction']['find']({'where':{'id':_0x3a9bc4[_0xe81f('0xb9')]['id']}})[_0xe81f('0x2b')](handleEntityNotFound(_0x110d09,null))[_0xe81f('0x2b')](function(_0x21c219){if(_0x21c219){return _0x21c219[_0xe81f('0xc6')](_0x3a9bc4[_0xe81f('0x44')]['ids']);}})[_0xe81f('0x2b')](respondWithStatusCode(_0x110d09,null))[_0xe81f('0x36')](handleError(_0x110d09,null));};exports[_0xe81f('0xc7')]=function(_0x51c888,_0x4c4286){var _0x5d867b=moment()[_0xe81f('0xc8')]()[_0xe81f('0x99')]();var _0x168876=path[_0xe81f('0xc9')](config[_0xe81f('0xca')],'server',_0xe81f('0xcb'),'tmp');var _0x3fa981=path[_0xe81f('0xc9')](config['root'],_0xe81f('0xcc'),_0xe81f('0xcb'),_0xe81f('0xcd'));var _0x1f900e=path['join'](_0x168876,_0x5d867b);var _0x1f2d04=util[_0xe81f('0xbe')](_0xe81f('0xce'),_0x51c888[_0xe81f('0xb9')]['id'],_0x5d867b);var _0x13823e=path[_0xe81f('0xc9')](_0x168876,_0x1f2d04);var _0x399b60=[];_0x399b60[_0xe81f('0x35')]({'model':db['Attachment'],'as':_0xe81f('0xcf'),'raw':!![]});var _0x43d88b=[{'model':db[_0xe81f('0xb8')],'as':_0xe81f('0xd0'),'attributes':['id','body',_0xe81f('0x7b')],'include':_0x399b60}];return db[_0xe81f('0x9d')][_0xe81f('0x61')]({'where':{'id':_0x51c888[_0xe81f('0xb9')]['id']},'include':_0x43d88b})[_0xe81f('0x2b')](handleEntityNotFound(_0x4c4286,null))[_0xe81f('0x2b')](function(_0x3d7f43){if(_0x3d7f43&&_0x3d7f43['Messages']){var _0x529379=_0x3d7f43['get']({'plain':!![]});fs['mkdirSync'](_0x1f900e);for(var _0x41b079=0x0;_0x41b079<_0x529379['Messages'][_0xe81f('0x9a')];_0x41b079++){var _0x49ced3=_0x529379[_0xe81f('0xd0')][_0x41b079]['Attachment'];if(_0x49ced3){var _0x42e50f=path[_0xe81f('0xc9')](_0x3fa981,_0x49ced3[_0xe81f('0xd1')]);if(fs[_0xe81f('0xd2')](_0x42e50f)){fs[_0xe81f('0xd3')](_0x42e50f)['pipe'](fs[_0xe81f('0xd4')](path['join'](_0x1f900e,_0x49ced3[_0xe81f('0xd1')])));}}}return BPromise[_0xe81f('0xd5')]()[_0xe81f('0x2b')](function(){return new BPromise(function(_0x48270e,_0x477b0d){zipdir(_0x1f900e,{'saveTo':_0x13823e},function(_0x5594d6,_0x1da702){if(_0x5594d6)return _0x477b0d(_0x5594d6);return _0x48270e(_0x1da702);});})[_0xe81f('0x2b')](function(){return new BPromise(function(_0x3ed3b5,_0x2e3b2a){rimraf(_0x1f900e,function(_0x2bec94){if(_0x2bec94)_0x2e3b2a(_0x2bec94);return _0x3ed3b5();});});})[_0xe81f('0x2b')](function(){return _0x4c4286[_0xe81f('0xc7')](_0x13823e,_0x1f2d04,function(_0x4d9e7f){if(_0x4d9e7f){console[_0xe81f('0xd6')](_0xe81f('0xd7'),_0x4d9e7f);}else{fs[_0xe81f('0xd8')](_0x13823e);}});});});}else{return _0x4c4286['sendStatus'](0xc8);}})[_0xe81f('0x36')](handleError(_0x4c4286,null));}; \ No newline at end of file +var _0xcab8=['split','forEach','push','catch','talking','answered','unmanaged','total','UserId','waiting','closed','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','type','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','FaxInteraction','a.key','Account.key','Account.mandatoryDisposition','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','merge','options','create','body','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','nolimit','format','includeAll','include','findAll','addTags','setTags','omit','spread','removeTags','download','unix','join','server','files','root','attachments','transcript-%d-%s.zip','Attachment','Messages','get','existsSync','createReadStream','pipe','createWriteStream','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcab8,0xa2));var _0x8cab=function(_0x6b819f,_0x2a4fb2){_0x6b819f=_0x6b819f-0x0;var _0x306000=_0xcab8[_0x6b819f];return _0x306000;};'use strict';var emlformat=require(_0x8cab('0x0'));var rimraf=require(_0x8cab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cab('0x2'));var rp=require(_0x8cab('0x3'));var moment=require(_0x8cab('0x4'));var BPromise=require(_0x8cab('0x5'));var Mustache=require(_0x8cab('0x6'));var util=require(_0x8cab('0x7'));var path=require(_0x8cab('0x8'));var sox=require(_0x8cab('0x9'));var csv=require(_0x8cab('0xa'));var ejs=require(_0x8cab('0xb'));var fs=require('fs');var fs_extra=require(_0x8cab('0xc'));var _=require(_0x8cab('0xd'));var squel=require(_0x8cab('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8cab('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8cab('0xf'));var authService=require(_0x8cab('0x10'));var qs=require(_0x8cab('0x11'));var as=require(_0x8cab('0x12'));var hardwareService=require(_0x8cab('0x13'));var logger=require('../../config/logger')(_0x8cab('0x14'));var utils=require(_0x8cab('0x15'));var config=require(_0x8cab('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cab('0x17'))['db'];config[_0x8cab('0x18')]=_[_0x8cab('0x19')](config[_0x8cab('0x18')],{'host':_0x8cab('0x1a'),'port':0x18eb});var socket=require(_0x8cab('0x1b'))(new Redis(config[_0x8cab('0x18')]));require(_0x8cab('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c13a4,_0x32a2ee){_0x32a2ee=_0x32a2ee||0xcc;return function(_0x2b0ff6){if(_0x2b0ff6){return _0x4c13a4[_0x8cab('0x1d')](_0x32a2ee);}return _0x4c13a4['status'](_0x32a2ee)[_0x8cab('0x1e')]();};}function respondWithResult(_0x5eb31d,_0x4fd757){_0x4fd757=_0x4fd757||0xc8;return function(_0x53d601){if(_0x53d601){return _0x5eb31d[_0x8cab('0x1f')](_0x4fd757)['json'](_0x53d601);}};}function respondWithFilteredResult(_0x353fd8,_0x1a032a){return function(_0x442d96){if(_0x442d96){var _0x23ea27=typeof _0x1a032a[_0x8cab('0x20')]===_0x8cab('0x21')&&typeof _0x1a032a[_0x8cab('0x22')]==='undefined';var _0x2e618d=_0x442d96[_0x8cab('0x23')];var _0x462748=_0x23ea27?0x0:_0x1a032a[_0x8cab('0x20')];var _0x1d142f=_0x23ea27?_0x442d96['count']:_0x1a032a[_0x8cab('0x20')]+_0x1a032a[_0x8cab('0x22')];var _0x4f04a2;if(_0x1d142f>=_0x2e618d){_0x1d142f=_0x2e618d;_0x4f04a2=0xc8;}else{_0x4f04a2=0xce;}_0x353fd8['status'](_0x4f04a2);return _0x353fd8[_0x8cab('0x24')](_0x8cab('0x25'),_0x462748+'-'+_0x1d142f+'/'+_0x2e618d)[_0x8cab('0x26')](_0x442d96);}return null;};}function patchUpdates(_0x5cfd32){return function(_0x18b72a){try{jsonpatch['apply'](_0x18b72a,_0x5cfd32,!![]);}catch(_0xb67576){return BPromise['reject'](_0xb67576);}return _0x18b72a['save']();};}function saveUpdates(_0x2d1cc4,_0x477aab){return function(_0x40fa3c){if(_0x40fa3c){return _0x40fa3c['update'](_0x2d1cc4)[_0x8cab('0x27')](function(_0x167536){return _0x167536;});}return null;};}function removeEntity(_0x1f997c,_0x5ce4dd){return function(_0x30dfc0){if(_0x30dfc0){return _0x30dfc0[_0x8cab('0x28')]()['then'](function(){_0x1f997c[_0x8cab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b90c5,_0x381d7b){return function(_0x4957bc){if(!_0x4957bc){_0x2b90c5[_0x8cab('0x1d')](0x194);}return _0x4957bc;};}function handleError(_0x30f964,_0x578c52){_0x578c52=_0x578c52||0x1f4;return function(_0xa23f44){logger[_0x8cab('0x29')](_0xa23f44[_0x8cab('0x2a')]);if(_0xa23f44[_0x8cab('0x2b')]){delete _0xa23f44[_0x8cab('0x2b')];}_0x30f964[_0x8cab('0x1f')](_0x578c52)[_0x8cab('0x2c')](_0xa23f44);};}function getInteractionUsers(_0x36f6fd,_0x166fac){return new BPromise(function(_0x53d874,_0x27bd6f){try{if(_0x166fac[_0x36f6fd['id']]){_0x36f6fd[_0x8cab('0x2d')]=_[_0x8cab('0x2e')](_0x166fac[_0x36f6fd['id']],function(_0x3e6fc6){return{'id':_0x3e6fc6['id'],'fullname':_0x3e6fc6[_0x8cab('0x2f')]};});}}catch(_0x7038bc){_0x27bd6f(_0x7038bc);}_0x53d874(_0x36f6fd);});}function getInteractionTags(_0x1a635a,_0x2d38e8){return new BPromise(function(_0x1a4bb4,_0xb606d4){try{if(_0x1a635a[_0x8cab('0x30')]){_0x1a635a[_0x8cab('0x31')]=[];_0x1a635a[_0x8cab('0x30')][_0x8cab('0x32')](',')[_0x8cab('0x33')](function(_0x310a6e){_0x1a635a[_0x8cab('0x31')][_0x8cab('0x34')](_0x2d38e8[_0x310a6e]);});}delete _0x1a635a[_0x8cab('0x30')];}catch(_0x2c71a6){_0xb606d4(_0x2c71a6);}_0x1a4bb4(_0x1a635a);});}function updateFaxInteraction(_0x5fd3e0,_0x33ad7c,_0x4960aa){return new BPromise(function(_0x461af0,_0x167d3c){return getInteractionUsers(_0x5fd3e0,_0x4960aa)[_0x8cab('0x27')](function(_0x3df813){return getInteractionTags(_0x3df813,_0x33ad7c);})['then'](function(_0x5de217){return getStateInteraction(_0x5de217);})['then'](function(_0x18d22c){_0x461af0(_0x18d22c);})[_0x8cab('0x35')](function(_0x17cd1b){_0x167d3c(_0x17cd1b);});});}function getStateInteraction(_0x537507){return new BPromise(function(_0x2ed807){_0x537507['waiting']=0x0;_0x537507[_0x8cab('0x36')]=0x0;_0x537507[_0x8cab('0x37')]=0x0;_0x537507[_0x8cab('0x38')]=0x0;_0x537507[_0x8cab('0x39')]=0x0;if(!_0x537507['closed']&&!_0x537507[_0x8cab('0x3a')]){_0x537507['waiting']+=0x1;}if(!_0x537507['closed']&&_0x537507[_0x8cab('0x3a')]){_0x537507['talking']+=0x1;if(_0x537507[_0x8cab('0x3b')]){_0x537507[_0x8cab('0x3b')]-=0x1;}}if(_0x537507[_0x8cab('0x3c')]&&_0x537507['UserId']){_0x537507['answered']+=0x1;if(_0x537507['talking']){_0x537507[_0x8cab('0x36')]-=0x1;}}if(_0x537507[_0x8cab('0x3c')]&&!_0x537507[_0x8cab('0x3a')]){_0x537507[_0x8cab('0x38')]+=0x1;if(_0x537507[_0x8cab('0x3b')]){_0x537507[_0x8cab('0x3b')]-=0x1;}}_0x537507[_0x8cab('0x39')]+=0x1;_0x2ed807(_0x537507);});}exports['index']=function(_0x7bdfe5,_0xa2c62){var _0x3510ac={},_0x49ef5e={},_0x29df51={'count':0x0,'rows':[]};var _0xa71277=_[_0x8cab('0x2e')](db['FaxInteraction'][_0x8cab('0x3d')],function(_0x367678){return{'name':_0x367678['fieldName'],'type':_0x367678['type'][_0x8cab('0x3e')]};});_0x49ef5e[_0x8cab('0x3f')]=_[_0x8cab('0x2e')](_0xa71277,'name');_0x49ef5e[_0x8cab('0x40')]=_[_0x8cab('0x41')](_0x7bdfe5[_0x8cab('0x40')]);_0x49ef5e[_0x8cab('0x42')]=_[_0x8cab('0x43')](_0x49ef5e['model'],_0x49ef5e['query']);_0x3510ac[_0x8cab('0x44')]=_['intersection'](_0x49ef5e[_0x8cab('0x3f')],qs[_0x8cab('0x45')](_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x45')]));_0x3510ac[_0x8cab('0x44')]=_0x3510ac['attributes'][_0x8cab('0x46')]?_0x3510ac[_0x8cab('0x44')]:_0x49ef5e[_0x8cab('0x3f')];if(!_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x47')]('nolimit')){_0x3510ac[_0x8cab('0x22')]=qs['limit'](_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x22')]);_0x3510ac[_0x8cab('0x20')]=qs[_0x8cab('0x20')](_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x20')]);}_0x3510ac[_0x8cab('0x48')]=qs[_0x8cab('0x49')](_0x7bdfe5['query'][_0x8cab('0x49')]);_0x3510ac[_0x8cab('0x4a')]=qs[_0x8cab('0x42')](_[_0x8cab('0x4b')](_0x7bdfe5[_0x8cab('0x40')],_0x49ef5e[_0x8cab('0x42')]),_0xa71277);var _0x47be9a=[];var _0x3cbcb3=squel['select']()['field']('id')[_0x8cab('0x4c')](_0x8cab('0x2b'))['field'](_0x8cab('0x4d'))[_0x8cab('0x4e')]('tools_tags');var _0x404b9a=squel[_0x8cab('0x4f')]()['field'](_0x8cab('0x50'))['field'](_0x8cab('0x51'))['field'](_0x8cab('0x52'))[_0x8cab('0x4e')](_0x8cab('0x53'),'ui')[_0x8cab('0x54')](_0x8cab('0x55'),'u','u.id\x20=\x20ui.UserId');var _0xf92986=squel['select']()[_0x8cab('0x4e')]('fax_interactions','i')[_0x8cab('0x54')](_0x8cab('0x56'),'c',_0x8cab('0x57'))[_0x8cab('0x54')](_0x8cab('0x55'),'o',_0x8cab('0x58'))[_0x8cab('0x54')]('fax_accounts','a',_0x8cab('0x59'))[_0x8cab('0x54')](_0x8cab('0x5a'),'me',_0x8cab('0x5b'))[_0x8cab('0x54')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x8cab('0x54')](_0x8cab('0x5c'),'t',_0x8cab('0x5d'));var _0x40ec18=squel[_0x8cab('0x5e')]();var _0x17f726=[];var _0x4250f7=squel[_0x8cab('0x5e')]();var _0x394d77;if(_0x7bdfe5[_0x8cab('0x40')]['search']){_0x394d77=as[_0x8cab('0x5f')](_0x7bdfe5[_0x8cab('0x40')]['search']);var _0x23bcb4=_0x394d77['sqlOperator'];for(var _0x18bd3e=0x0;_0x18bd3e<_0x394d77[_0x8cab('0x60')][_0x8cab('0x46')];_0x18bd3e++){var _0x4c4446=_0x394d77['conditions'][_0x18bd3e];var _0x5e11fe='i';var _0x1867be=_[_0x8cab('0x61')](_0xa71277,['name',_0x4c4446[_0x8cab('0x4c')]]);if(!_0x1867be){switch(_0x4c4446[_0x8cab('0x4c')]){case _0x8cab('0x62'):if(_0x4c4446[_0x8cab('0x63')]==0x1){_0xf92986['having']('`'+_0x4c4446[_0x8cab('0x4c')]+_0x8cab('0x64'));}else{_0xf92986[_0x8cab('0x65')]('`'+_0x4c4446[_0x8cab('0x4c')]+'`\x20>\x200');}break;case'Contact':if(_0x4c4446[_0x8cab('0x66')]===_0x8cab('0x67')){if(_0x4c4446[_0x8cab('0x63')][_0x8cab('0x32')]('\x20')[_0x8cab('0x46')]>0x1){_0x40ec18[_0x23bcb4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4c4446['value']),null);}else{var _0x35ee9e='%'+_0x4c4446[_0x8cab('0x63')]+'%';_0x40ec18[_0x23bcb4](_0x8cab('0x68'),_0x35ee9e,_0x35ee9e,_0x35ee9e);}}else{_0x1867be=_[_0x8cab('0x61')](_0xa71277,['name','ContactId']);_0x4c4446['field']=_0x8cab('0x69');_0x218e12=as[_0x8cab('0x6a')](_0x5e11fe,_0x1867be['type'],_0x4c4446);_0x40ec18[_0x23bcb4](_0x218e12[_0x8cab('0x6b')],_0x218e12[_0x8cab('0x63')][_0x8cab('0x6c')],_0x218e12['value'][_0x8cab('0x1e')]);}break;case _0x8cab('0x6d'):var _0x2640ee=_0x4c4446['value'][_0x8cab('0x32')](',')['map'](function(_0x1397c2){return Number(_0x1397c2);});_0x2640ee['forEach'](function(_0x3d5064){_0x4250f7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d5064+',%');});_0x17f726=_[_0x8cab('0x6e')](_0x17f726,_0x2640ee);break;case _0x8cab('0x6f'):if(_0x4c4446[_0x8cab('0x66')]===_0x8cab('0x67')){_0x40ec18[_0x23bcb4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c4446['value']+'%',null);}else{_0x1867be=_[_0x8cab('0x61')](_0xa71277,[_0x8cab('0x2b'),_0x8cab('0x3a')]);_0x4c4446[_0x8cab('0x4c')]=_0x8cab('0x3a');_0x218e12=as[_0x8cab('0x6a')](_0x5e11fe,_0x1867be[_0x8cab('0x70')],_0x4c4446);_0x40ec18[_0x23bcb4](_0x218e12['text'],_0x218e12[_0x8cab('0x63')][_0x8cab('0x6c')],_0x218e12[_0x8cab('0x63')][_0x8cab('0x1e')]);}break;case'body':_0x218e12=as[_0x8cab('0x6a')]('me',null,_0x4c4446);_0x40ec18[_0x23bcb4](_0x218e12[_0x8cab('0x6b')],_0x218e12['value'][_0x8cab('0x6c')],_0x218e12[_0x8cab('0x63')]['end']);break;}}else{var _0x218e12=as[_0x8cab('0x6a')](_0x5e11fe,_0x1867be[_0x8cab('0x70')],_0x4c4446);_0x40ec18[_0x23bcb4](_0x218e12[_0x8cab('0x6b')],_0x218e12[_0x8cab('0x63')]['start'],_0x218e12[_0x8cab('0x63')][_0x8cab('0x1e')]);}}}else{var _0xfa25d=_(_0x7bdfe5['query'])['keys']()[_0x8cab('0x2e')](function(_0x44cae3){return _[_0x8cab('0x71')](_0xa71277,[_0x8cab('0x2b'),_0x44cae3])?_0x44cae3:undefined;})['compact']()[_0x8cab('0x63')]();if(!_[_0x8cab('0x72')](_0xfa25d)){_0xfa25d[_0x8cab('0x33')](function(_0x2606a1){if(_0x2606a1===_0x8cab('0x73')){_0xf92986[_0x8cab('0x4a')](_0x8cab('0x74'),[][_0x8cab('0x75')](_0x7bdfe5['query'][_0x2606a1]));}else if(_0x2606a1===_0x8cab('0x76')){var _0x256640=JSON['parse'](_0x7bdfe5[_0x8cab('0x40')][_0x2606a1])[_0x8cab('0x77')];var _0x3cbc9a=JSON[_0x8cab('0x78')](_0x7bdfe5[_0x8cab('0x40')][_0x2606a1])[_0x8cab('0x79')];_0xf92986[_0x8cab('0x4a')](_0x8cab('0x7a'),_0x256640,_0x3cbc9a);}else{if(_0x7bdfe5['query'][_0x2606a1]===_0x8cab('0x7b')){_0xf92986[_0x8cab('0x4a')]('i.'+_0x2606a1+_0x8cab('0x7c'));}else{_0xf92986['where']('i.'+_0x2606a1+_0x8cab('0x7d'),_0x7bdfe5[_0x8cab('0x40')][_0x2606a1]);}}});}if(_0x7bdfe5[_0x8cab('0x40')]['read']){if(_0x7bdfe5['query'][_0x8cab('0x7e')]==0x1){_0xf92986[_0x8cab('0x65')]('`unreadMessages`\x20=\x200');}else{_0xf92986[_0x8cab('0x65')](_0x8cab('0x7f'));}}if(_0x7bdfe5[_0x8cab('0x40')]['tag']){_0x17f726=_['isArray'](_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x80')])?_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x80')]:new Array(_0x7bdfe5['query']['tag']);_0x17f726[_0x8cab('0x33')](function(_0x425565){_0x4250f7['or'](_0x8cab('0x81'),'%,'+_0x425565+',%');});}if(_0x7bdfe5['query'][_0x8cab('0x82')]){var _0x4b2849=_0x7bdfe5['query'][_0x8cab('0x82')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4b2849)){_0x40ec18['or']('i.id\x20LIKE\x20?',_0x4b2849+'%')['or'](_0x8cab('0x83'),_0x4b2849+'%');}_0x40ec18['or'](_0x8cab('0x84'),_0x4b2849+'%');}}_0xf92986[_0x8cab('0x4a')](_0x40ec18);_0xf92986[_0x8cab('0x85')](_0x8cab('0x86'));var _0x3b5239={'type':db[_0x8cab('0x87')][_0x8cab('0x88')][_0x8cab('0x89')],'raw':!![]};var _0x28a594=_0xf92986['clone']();_0x28a594['field'](_0x8cab('0x86'));_0x28a594[_0x8cab('0x4c')](_0x8cab('0x8a'),_0x8cab('0x62'));if(_0x3510ac[_0x8cab('0x48')]){_0x3510ac[_0x8cab('0x48')][_0x8cab('0x33')](function(_0x3a960f){var _0x1bf3af=_0x3a960f[0x0]==='contactName'?_0x3a960f[0x0]:'i.'+_0x3a960f[0x0];_0xf92986[_0x8cab('0x48')](_0x1bf3af,_0x3a960f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x17f726)){_0xf92986[_0x8cab('0x65')](_0x4250f7);_0x28a594['where'](_0x8cab('0x8b'),_0x17f726);}BPromise[_0x8cab('0x8c')]()[_0x8cab('0x27')](function(){if(!_0x394d77){if(_0x7bdfe5[_0x8cab('0x40')][_0x8cab('0x73')])return;_0x28a594[_0x8cab('0x4a')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0xf92986['where'](_0x8cab('0x8d'));return;}if(_0x7bdfe5[_0x8cab('0x8e')][_0x8cab('0x8f')]!==_0x8cab('0x90'))return;return _0x7bdfe5['user'][_0x8cab('0x91')]({'attributes':['id'],'raw':!![]})[_0x8cab('0x27')](function(_0x41404f){if(_['isEmpty'](_0x41404f)){_0x28a594[_0x8cab('0x4a')](_0x8cab('0x92'));_0xf92986[_0x8cab('0x4a')](_0x8cab('0x92'));}else{_0x28a594[_0x8cab('0x4a')]('i.FaxAccountId\x20IN\x20?',_[_0x8cab('0x2e')](_0x41404f,'id'));_0xf92986[_0x8cab('0x4a')]('i.FaxAccountId\x20IN\x20?',_[_0x8cab('0x2e')](_0x41404f,'id'));}});})[_0x8cab('0x27')](function(){if(_0x7bdfe5[_0x8cab('0x8e')][_0x8cab('0x8f')]===_0x8cab('0x90')&&!_0x394d77&&!_0x7bdfe5['query'][_0x8cab('0x73')])return[];return db[_0x8cab('0x93')]['query'](_0x28a594['toString'](),_0x3b5239);})[_0x8cab('0x27')](function(_0x3ef8ff){_0x29df51['count']=_0x3ef8ff[_0x8cab('0x46')];if(_0x29df51[_0x8cab('0x23')]===0x0)return[];return db[_0x8cab('0x93')][_0x8cab('0x40')](_0x3cbcb3[_0x8cab('0x94')](),_0x3b5239)['then'](function(_0x4e3fdd){_0x47be9a=_['keyBy'](_0x4e3fdd,'id');_0x3b5239=_['merge'](_0x3b5239,{'model':db[_0x8cab('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7bdfe5['query'][_0x8cab('0x45')]){_0x3510ac[_0x8cab('0x44')][_0x8cab('0x33')](function(_0x1d05e3){_0xf92986[_0x8cab('0x4c')]('i.'+_0x1d05e3);});}else{_0xf92986[_0x8cab('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8cab('0x62'));_0xf92986['field'](_0x8cab('0x96'),_0x8cab('0x97'));_0xf92986[_0x8cab('0x4c')]('a.mandatoryDisposition',_0x8cab('0x98'));_0xf92986[_0x8cab('0x4c')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x8cab('0x99'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0x9a'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0x9b'),'Contact.firstName');_0xf92986[_0x8cab('0x4c')](_0x8cab('0x9c'),_0x8cab('0x9d'));_0xf92986['field'](_0x8cab('0x9e'),'Contact.email');_0xf92986[_0x8cab('0x4c')](_0x8cab('0x9f'),_0x8cab('0xa0'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0xa1'),_0x8cab('0xa2'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0xa3'),_0x8cab('0xa4'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0xa5'),_0x8cab('0xa6'));_0xf92986['field'](_0x8cab('0xa7'),_0x8cab('0xa8'));_0xf92986[_0x8cab('0x4c')](_0x8cab('0xa9'),_0x8cab('0x30'));}if(_0x3510ac[_0x8cab('0x22')])_0xf92986[_0x8cab('0x22')](_0x3510ac[_0x8cab('0x22')]);if(_0x3510ac[_0x8cab('0x20')])_0xf92986['offset'](_0x3510ac[_0x8cab('0x20')]);return db[_0x8cab('0x93')][_0x8cab('0x40')](_0xf92986[_0x8cab('0x94')](),_0x3b5239);})[_0x8cab('0x27')](function(_0x538b83){if(_0x538b83['length']>0x0)_0x404b9a['where'](_0x8cab('0xaa'),_[_0x8cab('0x2e')](_0x538b83,'id'));return db[_0x8cab('0x93')][_0x8cab('0x40')](_0x404b9a['toString'](),_0x3b5239)[_0x8cab('0x27')](function(_0x277d9d){var _0x551daf=_[_0x8cab('0xab')](_0x277d9d,_0x8cab('0xac'));var _0x40f3f1=[];_0x538b83[_0x8cab('0x33')](function(_0x3ef684){_0x40f3f1[_0x8cab('0x34')](updateFaxInteraction(_0x3ef684,_0x47be9a,_0x551daf));});return BPromise[_0x8cab('0xad')](_0x40f3f1);});});})[_0x8cab('0x27')](function(_0x2c6bc7){_0x29df51[_0x8cab('0xae')]=_0x2c6bc7;return _0x29df51;})['then'](respondWithFilteredResult(_0xa2c62,_0x3510ac))[_0x8cab('0x35')](handleError(_0xa2c62,null));};exports['show']=function(_0x3b08b1,_0x25eb57){var _0x575755={'raw':![],'where':{'id':_0x3b08b1['params']['id']}},_0x1953a9={};_0x1953a9[_0x8cab('0x3f')]=_[_0x8cab('0x41')](db[_0x8cab('0x95')][_0x8cab('0x3d')]);_0x1953a9[_0x8cab('0x40')]=_[_0x8cab('0x41')](_0x3b08b1['query']);_0x1953a9[_0x8cab('0x42')]=_[_0x8cab('0x43')](_0x1953a9['model'],_0x1953a9[_0x8cab('0x40')]);_0x575755[_0x8cab('0x44')]=_[_0x8cab('0x43')](_0x1953a9[_0x8cab('0x3f')],qs[_0x8cab('0x45')](_0x3b08b1[_0x8cab('0x40')][_0x8cab('0x45')]));_0x575755['attributes']=_0x575755[_0x8cab('0x44')][_0x8cab('0x46')]?_0x575755['attributes']:_0x1953a9['model'];if(_0x3b08b1[_0x8cab('0x40')]['includeAll']){_0x575755['include']=[{'all':!![]}];}_0x575755=_[_0x8cab('0xaf')]({},_0x575755,_0x3b08b1[_0x8cab('0xb0')]);return db['FaxInteraction'][_0x8cab('0x61')](_0x575755)[_0x8cab('0x27')](handleEntityNotFound(_0x25eb57,null))['then'](respondWithResult(_0x25eb57,null))[_0x8cab('0x35')](handleError(_0x25eb57,null));};exports['create']=function(_0x4e273f,_0x4d16ff){return db[_0x8cab('0x95')][_0x8cab('0xb1')](_0x4e273f[_0x8cab('0xb2')],{})['then'](respondWithResult(_0x4d16ff,0xc9))[_0x8cab('0x35')](handleError(_0x4d16ff,null));};exports['update']=function(_0x41e6dd,_0x13ff4d){if(_0x41e6dd['body']['id']){delete _0x41e6dd[_0x8cab('0xb2')]['id'];}return db[_0x8cab('0x95')][_0x8cab('0x61')]({'where':{'id':_0x41e6dd['params']['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x13ff4d,null))[_0x8cab('0x27')](saveUpdates(_0x41e6dd[_0x8cab('0xb2')],null))[_0x8cab('0x27')](respondWithResult(_0x13ff4d,null))[_0x8cab('0x35')](handleError(_0x13ff4d,null));};exports[_0x8cab('0x28')]=function(_0x5810b6,_0x418e29){return db[_0x8cab('0x95')]['find']({'where':{'id':_0x5810b6[_0x8cab('0xb3')]['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x418e29,null))['then'](removeEntity(_0x418e29,null))[_0x8cab('0x35')](handleError(_0x418e29,null));};exports[_0x8cab('0xb4')]=function(_0x102b44,_0xba0a29){return db[_0x8cab('0x95')]['describe']()[_0x8cab('0x27')](respondWithResult(_0xba0a29,null))[_0x8cab('0x35')](handleError(_0xba0a29,null));};exports[_0x8cab('0xb5')]=function(_0x14443a,_0x2cfdc9,_0x1c36ef){return db[_0x8cab('0xb6')]['find']({'where':{'id':_0x14443a[_0x8cab('0xb3')]['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x2cfdc9,null))[_0x8cab('0x27')](function(_0x1bae69){if(_0x1bae69){return _0x1bae69['addMessage'](_0x14443a[_0x8cab('0xb2')][_0x8cab('0xb7')],_['omit'](_0x14443a[_0x8cab('0xb2')],[_0x8cab('0xb7'),'id'])||{});}})[_0x8cab('0x27')](respondWithResult(_0x2cfdc9,null))[_0x8cab('0x35')](handleError(_0x2cfdc9,null));};exports[_0x8cab('0xb8')]=function(_0x5f23f2,_0x496fb1,_0x556269){var _0x2568fb={'raw':![],'where':{}};var _0x584e48={};var _0x2c85ba={'count':0x0,'rows':[]};return db[_0x8cab('0x95')][_0x8cab('0xb9')]({'where':{'id':_0x5f23f2[_0x8cab('0xb3')]['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x496fb1,null))[_0x8cab('0x27')](function(_0x436bca){if(_0x436bca){_0x584e48[_0x8cab('0x3f')]=_[_0x8cab('0x41')](db[_0x8cab('0xb6')]['rawAttributes']);_0x584e48[_0x8cab('0x40')]=_[_0x8cab('0x41')](_0x5f23f2[_0x8cab('0x40')]);_0x584e48[_0x8cab('0x42')]=_['intersection'](_0x584e48['model'],_0x584e48[_0x8cab('0x40')]);_0x2568fb[_0x8cab('0x44')]=_[_0x8cab('0x43')](_0x584e48['model'],qs[_0x8cab('0x45')](_0x5f23f2[_0x8cab('0x40')]['fields']));_0x2568fb[_0x8cab('0x44')]=_0x2568fb[_0x8cab('0x44')][_0x8cab('0x46')]?_0x2568fb['attributes']:_0x584e48[_0x8cab('0x3f')];if(!_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x47')](_0x8cab('0xba'))){_0x2568fb[_0x8cab('0x22')]=qs['limit'](_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x22')]);_0x2568fb[_0x8cab('0x20')]=qs['offset'](_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x20')]);}_0x2568fb['order']=qs[_0x8cab('0x49')](_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x49')]);_0x2568fb[_0x8cab('0x4a')]=qs['filters'](_[_0x8cab('0x4b')](_0x5f23f2['query'],_0x584e48[_0x8cab('0x42')]));_0x2568fb[_0x8cab('0x4a')][_0x8cab('0xac')]=_0x436bca['id'];if(_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x82')]){_0x2568fb[_0x8cab('0x4a')]=_[_0x8cab('0xaf')](_0x2568fb[_0x8cab('0x4a')],{'$or':_[_0x8cab('0x2e')](_0x2568fb[_0x8cab('0x44')],function(_0x1a6767){var _0x1477b4={};_0x1477b4[_0x1a6767]={'$like':'%'+_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x82')]+'%'};return _0x1477b4;})});}if(_0x5f23f2[_0x8cab('0x40')][_0x8cab('0x77')]){var _0x487f7e=_0x5f23f2[_0x8cab('0x40')]['$gte'][_0x8cab('0x32')](',');var _0x580c9c={};_0x580c9c[_0x487f7e[0x0]]={'$gte':moment(_0x487f7e[0x1])[_0x8cab('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2568fb['where']=_['merge'](_0x2568fb[_0x8cab('0x4a')],_0x580c9c);}_0x2568fb=_[_0x8cab('0xaf')]({},_0x2568fb,_0x5f23f2[_0x8cab('0xb0')]);return db[_0x8cab('0xb6')]['count']({'where':_0x2568fb[_0x8cab('0x4a')]})[_0x8cab('0x27')](function(_0x470d70){_0x2c85ba[_0x8cab('0x23')]=_0x470d70;if(_0x5f23f2['query'][_0x8cab('0xbc')]){_0x2568fb[_0x8cab('0xbd')]=[{'all':!![]}];}return db[_0x8cab('0xb6')][_0x8cab('0xbe')](_0x2568fb);})[_0x8cab('0x27')](function(_0x14a766){_0x2c85ba[_0x8cab('0xae')]=_0x14a766;return _0x2c85ba;});}})[_0x8cab('0x27')](respondWithFilteredResult(_0x496fb1,_0x2568fb))['catch'](handleError(_0x496fb1,null));};exports[_0x8cab('0xbf')]=function(_0x2c3e27,_0x12f42f,_0x5c8d25){return db[_0x8cab('0x95')]['find']({'where':{'id':_0x2c3e27[_0x8cab('0xb3')]['id']}})[_0x8cab('0x27')](handleEntityNotFound(_0x12f42f,null))[_0x8cab('0x27')](function(_0x9cb604){if(_0x9cb604){return _0x9cb604[_0x8cab('0xc0')](_0x2c3e27[_0x8cab('0xb2')][_0x8cab('0xb7')],_[_0x8cab('0xc1')](_0x2c3e27[_0x8cab('0xb2')],[_0x8cab('0xb7'),'id'])||{})[_0x8cab('0xc2')](function(){return db['Tag'][_0x8cab('0xbe')]({'attributes':['id',_0x8cab('0x2b'),_0x8cab('0x4d')],'where':{'id':_0x2c3e27[_0x8cab('0xb2')][_0x8cab('0xb7')]}});})[_0x8cab('0x27')](function(_0x27e168){socket['emit']('faxInteractionTags:save',{'id':Number(_0x2c3e27[_0x8cab('0xb3')]['id']),'tags':_0x27e168||[]});return{'id':Number(_0x2c3e27[_0x8cab('0xb3')]['id']),'tags':_0x27e168||[]};});}})[_0x8cab('0x27')](respondWithResult(_0x12f42f,null))['catch'](handleError(_0x12f42f,null));};exports['removeTags']=function(_0x50c69b,_0x5bddc9,_0x257a8e){return db[_0x8cab('0x95')][_0x8cab('0x61')]({'where':{'id':_0x50c69b[_0x8cab('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5bddc9,null))[_0x8cab('0x27')](function(_0x2dbbee){if(_0x2dbbee){return _0x2dbbee[_0x8cab('0xc3')](_0x50c69b['query'][_0x8cab('0xb7')]);}})['then'](respondWithStatusCode(_0x5bddc9,null))[_0x8cab('0x35')](handleError(_0x5bddc9,null));};exports[_0x8cab('0xc4')]=function(_0x1f9c18,_0x1da537){var _0x58b2cd=moment()[_0x8cab('0xc5')]()[_0x8cab('0x94')]();var _0x39c44d=path[_0x8cab('0xc6')](config['root'],_0x8cab('0xc7'),_0x8cab('0xc8'),'tmp');var _0x4cf8f8=path['join'](config[_0x8cab('0xc9')],'server',_0x8cab('0xc8'),_0x8cab('0xca'));var _0x5d7795=path[_0x8cab('0xc6')](_0x39c44d,_0x58b2cd);var _0x391176=util[_0x8cab('0xbb')](_0x8cab('0xcb'),_0x1f9c18[_0x8cab('0xb3')]['id'],_0x58b2cd);var _0x2e332d=path[_0x8cab('0xc6')](_0x39c44d,_0x391176);var _0xab0c94=[];_0xab0c94[_0x8cab('0x34')]({'model':db[_0x8cab('0xcc')],'as':_0x8cab('0xcc'),'raw':!![]});var _0x5ca3ff=[{'model':db[_0x8cab('0xb6')],'as':_0x8cab('0xcd'),'attributes':['id',_0x8cab('0xb2'),_0x8cab('0x76')],'include':_0xab0c94}];return db['FaxInteraction'][_0x8cab('0x61')]({'where':{'id':_0x1f9c18[_0x8cab('0xb3')]['id']},'include':_0x5ca3ff})[_0x8cab('0x27')](handleEntityNotFound(_0x1da537,null))[_0x8cab('0x27')](function(_0x3c331e){if(_0x3c331e&&_0x3c331e[_0x8cab('0xcd')]){var _0x2e03b4=_0x3c331e[_0x8cab('0xce')]({'plain':!![]});fs['mkdirSync'](_0x5d7795);for(var _0x485531=0x0;_0x485531<_0x2e03b4[_0x8cab('0xcd')][_0x8cab('0x46')];_0x485531++){var _0x422ab7=_0x2e03b4['Messages'][_0x485531][_0x8cab('0xcc')];if(_0x422ab7){var _0x17b14a=path[_0x8cab('0xc6')](_0x4cf8f8,_0x422ab7['basename']);if(fs[_0x8cab('0xcf')](_0x17b14a)){fs[_0x8cab('0xd0')](_0x17b14a)[_0x8cab('0xd1')](fs[_0x8cab('0xd2')](path['join'](_0x5d7795,_0x422ab7[_0x8cab('0xd3')])));}}}return BPromise['resolve']()[_0x8cab('0x27')](function(){return new BPromise(function(_0x56202b,_0x3216a5){zipdir(_0x5d7795,{'saveTo':_0x2e332d},function(_0x36d841,_0x258ef6){if(_0x36d841)return _0x3216a5(_0x36d841);return _0x56202b(_0x258ef6);});})[_0x8cab('0x27')](function(){return new BPromise(function(_0x23870d,_0x4436d3){rimraf(_0x5d7795,function(_0x4691f8){if(_0x4691f8)_0x4436d3(_0x4691f8);return _0x23870d();});});})[_0x8cab('0x27')](function(){return _0x1da537[_0x8cab('0xc4')](_0x2e332d,_0x391176,function(_0xbbb09e){if(_0xbbb09e){console['log']('err',_0xbbb09e);}else{fs['unlinkSync'](_0x2e332d);}});});});}else{return _0x1da537[_0x8cab('0x1d')](0xc8);}})[_0x8cab('0x35')](handleError(_0x1da537,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b6f3d29..f0a7426 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 _0x11ec=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','findAll','setDataValue','unreadMessages'];(function(_0x1d18cb,_0x28a70a){var _0x1115d3=function(_0x34d77f){while(--_0x34d77f){_0x1d18cb['push'](_0x1d18cb['shift']());}};_0x1115d3(++_0x28a70a);}(_0x11ec,0x16f));var _0xc11e=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x11ec[_0x121886];return _0x20ca01;};'use strict';var EventEmitter=require(_0xc11e('0x0'));var FaxInteraction=require(_0xc11e('0x1'))['db'][_0xc11e('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xc11e('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc11e('0x4')](0x0);var events={'afterCreate':_0xc11e('0x5'),'afterUpdate':_0xc11e('0x6'),'afterDestroy':_0xc11e('0x7')};function emitEvent(_0x31cabc){return function(_0x56f3df,_0x3549ec,_0x3766ab){_0x56f3df[_0xc11e('0x8')]({'attributes':['id'],'raw':!![]})[_0xc11e('0x9')](function(_0x17c7c0){_0x56f3df['setDataValue']('Users',_0x17c7c0['map'](function(_0x4b4678){return{'id':_0x4b4678['id']};}));return FaxMessage[_0xc11e('0xa')]({'where':{'FaxInteractionId':_0x56f3df['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5191cc){_0x56f3df[_0xc11e('0xb')](_0xc11e('0xc'),_0x5191cc[_0xc11e('0xd')]);FaxInteractionEvents['emit'](_0x31cabc+':'+_0x56f3df['id'],_0x56f3df);FaxInteractionEvents[_0xc11e('0xe')](_0x31cabc,_0x56f3df);_0x3766ab(null);})[_0xc11e('0xf')](_0x3766ab(null));};}for(var e in events){if(events[_0xc11e('0x10')](e)){var event=events[e];FaxInteraction[_0xc11e('0x11')](e,emitEvent(event));}}module[_0xc11e('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xf36e=['exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xf36e,0x1bb));var _0xef36=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf36e[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xef36('0x0'));var FaxInteraction=require(_0xef36('0x1'))['db'][_0xef36('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xef36('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xef36('0x4')](0x0);var events={'afterCreate':_0xef36('0x5'),'afterUpdate':'update','afterDestroy':_0xef36('0x6')};function emitEvent(_0x4088b4){return function(_0x24a3ec,_0x3793b3,_0x299514){_0x24a3ec['getUsers']({'attributes':['id'],'raw':!![]})[_0xef36('0x7')](function(_0x296d9e){_0x24a3ec[_0xef36('0x8')]('Users',_0x296d9e['map'](function(_0x2646fa){return{'id':_0x2646fa['id']};}));return FaxMessage[_0xef36('0x9')]({'where':{'FaxInteractionId':_0x24a3ec['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef36('0x7')](function(_0xb8eaeb){_0x24a3ec[_0xef36('0x8')](_0xef36('0xa'),_0xb8eaeb[_0xef36('0xb')]);FaxInteractionEvents['emit'](_0x4088b4+':'+_0x24a3ec['id'],_0x24a3ec);FaxInteractionEvents[_0xef36('0xc')](_0x4088b4,_0x24a3ec);_0x299514(null);})[_0xef36('0xd')](_0x299514(null));};}for(var e in events){if(events[_0xef36('0xe')](e)){var event=events[e];FaxInteraction[_0xef36('0xf')](e,emitEvent(event));}}module[_0xef36('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 4f290be..d2b5582 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 _0x1792=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x1724cd,_0x3bd5b0){var _0x1c5348=function(_0x4ef8b3){while(--_0x4ef8b3){_0x1724cd['push'](_0x1724cd['shift']());}};_0x1c5348(++_0x3bd5b0);}(_0x1792,0x111));var _0x2179=function(_0x4ec805,_0x3b8515){_0x4ec805=_0x4ec805-0x0;var _0x386805=_0x1792[_0x4ec805];return _0x386805;};'use strict';var _=require(_0x2179('0x0'));var util=require(_0x2179('0x1'));var logger=require('../../config/logger')(_0x2179('0x2'));var moment=require(_0x2179('0x3'));var BPromise=require(_0x2179('0x4'));var rp=require(_0x2179('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2179('0x6'));var config=require(_0x2179('0x7'));var attributes=require(_0x2179('0x8'));module[_0x2179('0x9')]=function(_0x18ada4,_0x2e5361){return _0x18ada4[_0x2179('0xa')](_0x2179('0xb'),attributes,{'tableName':_0x2179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c4758,_0x4667fc,_0xb59a8c){if(_0x4c4758[_0x2179('0xd')](_0x2179('0xe'))){_0x4c4758[_0x2179('0xf')]=moment()['format'](_0x2179('0x10'));}_0xb59a8c(null,_0x4c4758);}}});}; \ No newline at end of file +var _0xbf6c=['closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions'];(function(_0x4ae0a2,_0x566c05){var _0x53889d=function(_0x206445){while(--_0x206445){_0x4ae0a2['push'](_0x4ae0a2['shift']());}};_0x53889d(++_0x566c05);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x4fe4d8,_0x27b6cb){_0x4fe4d8=_0x4fe4d8-0x0;var _0x576b22=_0xbf6c[_0x4fe4d8];return _0x576b22;};'use strict';var _=require(_0xcbf6('0x0'));var util=require(_0xcbf6('0x1'));var logger=require('../../config/logger')(_0xcbf6('0x2'));var moment=require(_0xcbf6('0x3'));var BPromise=require(_0xcbf6('0x4'));var rp=require(_0xcbf6('0x5'));var fs=require('fs');var path=require(_0xcbf6('0x6'));var rimraf=require(_0xcbf6('0x7'));var config=require(_0xcbf6('0x8'));var attributes=require(_0xcbf6('0x9'));module['exports']=function(_0x58be56,_0x5ad0ce){return _0x58be56[_0xcbf6('0xa')](_0xcbf6('0xb'),attributes,{'tableName':_0xcbf6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15800d,_0x40d87b,_0x33e4de){if(_0x15800d['changed'](_0xcbf6('0xd'))){_0x15800d['closedAt']=moment()['format'](_0xcbf6('0xe'));}_0x33e4de(null,_0x15800d);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7921fe9..feb1016 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 _0x867c=['FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','attributes','limit','find','where','then','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x5a9050,_0x33481f){var _0x58f261=function(_0x1c03f0){while(--_0x1c03f0){_0x5a9050['push'](_0x5a9050['shift']());}};_0x58f261(++_0x33481f);}(_0x867c,0xbd));var _0xc867=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x867c[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xc867('0x0'));var util=require(_0xc867('0x1'));var moment=require('moment');var BPromise=require(_0xc867('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc867('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc867('0x4'));var logger=require(_0xc867('0x5'))(_0xc867('0x6'));var config=require(_0xc867('0x7'));var jayson=require(_0xc867('0x8'));var client=jayson['client'][_0xc867('0x9')]({'port':0x232a});config[_0xc867('0xa')]=_[_0xc867('0xb')](config['redis'],{'host':_0xc867('0xc'),'port':0x18eb});var socket=require(_0xc867('0xd'))(new Redis(config[_0xc867('0xa')]));require('./faxInteraction.socket')[_0xc867('0xe')](socket);function respondWithRpcPromise(_0x1f4daa,_0x34e79e,_0x30b966){return new BPromise(function(_0x389608,_0x42111e){return client[_0xc867('0xf')](_0x1f4daa,_0x30b966)['then'](function(_0x277737){logger['info'](_0xc867('0x10'),_0x34e79e,_0xc867('0x11'));logger[_0xc867('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x34e79e,_0xc867('0x11'),JSON[_0xc867('0x13')](_0x277737));if(_0x277737[_0xc867('0x14')]){if(_0x277737[_0xc867('0x14')][_0xc867('0x15')]===0x1f4){logger[_0xc867('0x14')](_0xc867('0x10'),_0x34e79e,_0x277737[_0xc867('0x14')][_0xc867('0x16')]);return _0x42111e(_0x277737['error'][_0xc867('0x16')]);}logger[_0xc867('0x14')](_0xc867('0x10'),_0x34e79e,_0x277737[_0xc867('0x14')][_0xc867('0x16')]);return _0x389608(_0x277737['error']['message']);}else{logger[_0xc867('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34e79e,_0xc867('0x11'));_0x389608(_0x277737[_0xc867('0x18')][_0xc867('0x16')]);}})[_0xc867('0x19')](function(_0x5e0854){logger[_0xc867('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x34e79e,_0x5e0854);_0x42111e(_0x5e0854);});});}exports[_0xc867('0x1a')]=function(_0x5532b0){var _0x531f46=this;return new Promise(function(_0x1c912a,_0x42eaee){return db[_0xc867('0x1b')]['update'](_0x5532b0['body'],{'raw':_0x5532b0[_0xc867('0x1c')]?_0x5532b0[_0xc867('0x1c')][_0xc867('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5532b0[_0xc867('0x1c')]?_0x5532b0['options']['where']||null:null,'attributes':_0x5532b0[_0xc867('0x1c')]?_0x5532b0[_0xc867('0x1c')][_0xc867('0x1e')]||null:null,'limit':_0x5532b0[_0xc867('0x1c')]?_0x5532b0[_0xc867('0x1c')][_0xc867('0x1f')]||null:null})['then'](function(_0x4669b5){logger[_0xc867('0x17')](_0xc867('0x1a'),_0x5532b0);logger[_0xc867('0x12')](_0xc867('0x1a'),_0x5532b0,JSON[_0xc867('0x13')](_0x4669b5));_0x1c912a(_0x4669b5);})['catch'](function(_0x291db9){logger[_0xc867('0x14')](_0xc867('0x1a'),_0x291db9['message'],_0x5532b0);_0x42eaee(_0x531f46[_0xc867('0x14')](0x1f4,_0x291db9[_0xc867('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1aa0af){return new Promise(function(_0x528513,_0x4cf9d4){return db[_0xc867('0x1b')][_0xc867('0x20')]({'where':_0x1aa0af['options']?_0x1aa0af[_0xc867('0x1c')][_0xc867('0x21')]||null:null})[_0xc867('0x22')](function(_0x3bb322){if(_0x3bb322){return _0x3bb322[_0xc867('0x23')](_0x1aa0af[_0xc867('0x24')][_0xc867('0x25')],_[_0xc867('0x26')](_0x1aa0af[_0xc867('0x24')],[_0xc867('0x25'),'id'])||{});}})[_0xc867('0x27')](function(_0x27d705){logger[_0xc867('0x17')](_0xc867('0x28'),_0x1aa0af);logger[_0xc867('0x12')](_0xc867('0x28'),_0x1aa0af,JSON['stringify'](_0x27d705));_0x528513(_0x27d705);})[_0xc867('0x19')](function(_0xb614c3){logger[_0xc867('0x14')](_0xc867('0x28'),_0xb614c3[_0xc867('0x16')],_0x1aa0af);_0x4cf9d4(_this[_0xc867('0x14')](0x1f4,_0xb614c3[_0xc867('0x16')]));});});}; \ No newline at end of file +var _0x20d7=['debug','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','body','options','where','limit','UpdateFaxInteraction'];(function(_0x4a2e12,_0x8b172b){var _0x2b8506=function(_0x5b9d30){while(--_0x5b9d30){_0x4a2e12['push'](_0x4a2e12['shift']());}};_0x2b8506(++_0x8b172b);}(_0x20d7,0xe6));var _0x720d=function(_0x5f9a6,_0x268d42){_0x5f9a6=_0x5f9a6-0x0;var _0x1d24ac=_0x20d7[_0x5f9a6];return _0x1d24ac;};'use strict';var _=require(_0x720d('0x0'));var util=require(_0x720d('0x1'));var moment=require(_0x720d('0x2'));var BPromise=require(_0x720d('0x3'));var rs=require(_0x720d('0x4'));var fs=require('fs');var Redis=require(_0x720d('0x5'));var db=require(_0x720d('0x6'))['db'];var utils=require(_0x720d('0x7'));var logger=require(_0x720d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x720d('0x9'));var client=jayson[_0x720d('0xa')][_0x720d('0xb')]({'port':0x232a});config[_0x720d('0xc')]=_['defaults'](config[_0x720d('0xc')],{'host':_0x720d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x720d('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1f5236,_0x5486e4,_0x3f30e3){return new BPromise(function(_0x1d6e60,_0xffbfc7){return client[_0x720d('0xe')](_0x1f5236,_0x3f30e3)[_0x720d('0xf')](function(_0x30229c){logger[_0x720d('0x10')](_0x720d('0x11'),_0x5486e4,_0x720d('0x12'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5486e4,_0x720d('0x12'),JSON[_0x720d('0x13')](_0x30229c));if(_0x30229c['error']){if(_0x30229c['error'][_0x720d('0x14')]===0x1f4){logger[_0x720d('0x15')](_0x720d('0x11'),_0x5486e4,_0x30229c[_0x720d('0x15')][_0x720d('0x16')]);return _0xffbfc7(_0x30229c[_0x720d('0x15')]['message']);}logger[_0x720d('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x5486e4,_0x30229c['error']['message']);return _0x1d6e60(_0x30229c['error'][_0x720d('0x16')]);}else{logger['info'](_0x720d('0x11'),_0x5486e4,'request\x20sent');_0x1d6e60(_0x30229c['result'][_0x720d('0x16')]);}})[_0x720d('0x17')](function(_0x200337){logger['error'](_0x720d('0x11'),_0x5486e4,_0x200337);_0xffbfc7(_0x200337);});});}exports['UpdateFaxInteraction']=function(_0x22f6a7){var _0x442065=this;return new Promise(function(_0x1929b6,_0x54c00c){return db['FaxInteraction']['update'](_0x22f6a7[_0x720d('0x18')],{'raw':_0x22f6a7[_0x720d('0x19')]?_0x22f6a7[_0x720d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f6a7['options']?_0x22f6a7[_0x720d('0x19')][_0x720d('0x1a')]||null:null,'attributes':_0x22f6a7['options']?_0x22f6a7[_0x720d('0x19')]['attributes']||null:null,'limit':_0x22f6a7[_0x720d('0x19')]?_0x22f6a7[_0x720d('0x19')][_0x720d('0x1b')]||null:null})[_0x720d('0xf')](function(_0x3a68cc){logger['info'](_0x720d('0x1c'),_0x22f6a7);logger[_0x720d('0x1d')](_0x720d('0x1c'),_0x22f6a7,JSON[_0x720d('0x13')](_0x3a68cc));_0x1929b6(_0x3a68cc);})['catch'](function(_0x20b0bd){logger[_0x720d('0x15')](_0x720d('0x1c'),_0x20b0bd[_0x720d('0x16')],_0x22f6a7);_0x54c00c(_0x442065[_0x720d('0x15')](0x1f4,_0x20b0bd['message']));});});};exports[_0x720d('0x1e')]=function(_0x181b7d){return new Promise(function(_0x4b62f8,_0x5e6c6f){return db[_0x720d('0x1f')][_0x720d('0x20')]({'where':_0x181b7d[_0x720d('0x19')]?_0x181b7d['options']['where']||null:null})['then'](function(_0x2114dc){if(_0x2114dc){return _0x2114dc[_0x720d('0x21')](_0x181b7d[_0x720d('0x18')][_0x720d('0x22')],_['omit'](_0x181b7d[_0x720d('0x18')],['ids','id'])||{});}})[_0x720d('0x23')](function(_0x3f1e11){logger[_0x720d('0x10')](_0x720d('0x24'),_0x181b7d);logger[_0x720d('0x1d')](_0x720d('0x24'),_0x181b7d,JSON['stringify'](_0x3f1e11));_0x4b62f8(_0x3f1e11);})[_0x720d('0x17')](function(_0x177ab7){logger[_0x720d('0x15')](_0x720d('0x24'),_0x177ab7['message'],_0x181b7d);_0x5e6c6f(_this[_0x720d('0x15')](0x1f4,_0x177ab7[_0x720d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d3c9a69..0d67440 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 _0x7240=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x50740c,_0x223e9a){var _0x1d7c81=function(_0x18994f){while(--_0x18994f){_0x50740c['push'](_0x50740c['shift']());}};_0x1d7c81(++_0x223e9a);}(_0x7240,0x152));var _0x0724=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7240[_0x39096d];return _0x13da4f;};'use strict';var FaxInteractionEvents=require(_0x0724('0x0'));var events=[_0x0724('0x1'),_0x0724('0x2'),_0x0724('0x3')];function createListener(_0x198745,_0xeef6ac){return function(_0x13754b){_0xeef6ac[_0x0724('0x4')](_0x198745,_0x13754b);};}function removeListener(_0x2dd96c,_0x41f044){return function(){FaxInteractionEvents[_0x0724('0x5')](_0x2dd96c,_0x41f044);};}exports['register']=function(_0x3d6651){for(var _0x3048f1=0x0,_0x1d853a=events[_0x0724('0x6')];_0x3048f1<_0x1d853a;_0x3048f1++){var _0x47c962=events[_0x3048f1];var _0x5c6d68=createListener(_0x0724('0x7')+_0x47c962,_0x3d6651);FaxInteractionEvents['on'](_0x47c962,_0x5c6d68);}}; \ No newline at end of file +var _0x2327=['emit','removeListener','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2327,0x11c));var _0x7232=function(_0x577727,_0x5b41e7){_0x577727=_0x577727-0x0;var _0x4c4270=_0x2327[_0x577727];return _0x4c4270;};'use strict';var FaxInteractionEvents=require(_0x7232('0x0'));var events=[_0x7232('0x1'),_0x7232('0x2'),'update'];function createListener(_0x2aa68d,_0x1e6d93){return function(_0x190960){_0x1e6d93[_0x7232('0x3')](_0x2aa68d,_0x190960);};}function removeListener(_0x2fb659,_0x1e0e6b){return function(){FaxInteractionEvents[_0x7232('0x4')](_0x2fb659,_0x1e0e6b);};}exports[_0x7232('0x5')]=function(_0x1fc4b2){for(var _0x31a523=0x0,_0x5be525=events['length'];_0x31a523<_0x5be525;_0x31a523++){var _0x2ddef3=events[_0x31a523];var _0x1d349f=createListener(_0x7232('0x6')+_0x2ddef3,_0x1fc4b2);FaxInteractionEvents['on'](_0x2ddef3,_0x1d349f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index cc0d400..fd41d2b 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 _0x903b=['put','tracked','faxinteraction:update','delete','faxinteraction:destroy','destroy','/:id/tags','exports','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','fax','faxinteraction:addtags','addTags'];(function(_0xc8e36,_0x51adb3){var _0xec7c38=function(_0x55b52d){while(--_0x55b52d){_0xc8e36['push'](_0xc8e36['shift']());}};_0xec7c38(++_0x51adb3);}(_0x903b,0x104));var _0xb903=function(_0x1d1e99,_0x37a7a0){_0x1d1e99=_0x1d1e99-0x0;var _0x29b365=_0x903b[_0x1d1e99];return _0x29b365;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb903('0x0'));var router=express[_0xb903('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb903('0x2'));var config=require(_0xb903('0x3'));var controller=require('./faxInteraction.controller');router[_0xb903('0x4')]('/',auth[_0xb903('0x5')](),controller[_0xb903('0x6')]);router[_0xb903('0x4')]('/describe',auth['isAuthenticated'](),controller[_0xb903('0x7')]);router[_0xb903('0x4')](_0xb903('0x8'),auth[_0xb903('0x5')](),controller[_0xb903('0x9')]);router['get'](_0xb903('0xa'),auth[_0xb903('0x5')](),controller[_0xb903('0xb')]);router[_0xb903('0x4')](_0xb903('0xc'),auth[_0xb903('0x5')](),controller[_0xb903('0xd')]);router[_0xb903('0xe')]('/',auth['isAuthenticated'](),controller[_0xb903('0xf')]);router['post'](_0xb903('0xa'),auth['isAuthenticated'](),controller[_0xb903('0x10')]);router['post']('/:id/tags',auth[_0xb903('0x5')](),interaction['tracked'](_0xb903('0x11'),_0xb903('0x12')),controller[_0xb903('0x13')]);router[_0xb903('0x14')](_0xb903('0x8'),auth[_0xb903('0x5')](),interaction[_0xb903('0x15')]('fax',_0xb903('0x16')),controller['update']);router[_0xb903('0x17')](_0xb903('0x8'),auth['isAuthenticated'](),interaction[_0xb903('0x15')](_0xb903('0x11'),_0xb903('0x18')),controller[_0xb903('0x19')]);router[_0xb903('0x17')](_0xb903('0x1a'),auth[_0xb903('0x5')](),controller['removeTags']);module[_0xb903('0x1b')]=router; \ No newline at end of file +var _0x846e=['describe','/:id','show','getMessages','download','post','addMessage','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','get','/describe'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x846e,0x1a7));var _0xe846=function(_0x4067da,_0x59ff32){_0x4067da=_0x4067da-0x0;var _0x405111=_0x846e[_0x4067da];return _0x405111;};'use strict';var multer=require('multer');var util=require(_0xe846('0x0'));var path=require('path');var timeout=require(_0xe846('0x1'));var express=require(_0xe846('0x2'));var router=express['Router']();var fs_extra=require(_0xe846('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe846('0x4'));var config=require('../../config/environment');var controller=require(_0xe846('0x5'));router['get']('/',auth[_0xe846('0x6')](),controller['index']);router[_0xe846('0x7')](_0xe846('0x8'),auth[_0xe846('0x6')](),controller[_0xe846('0x9')]);router[_0xe846('0x7')](_0xe846('0xa'),auth[_0xe846('0x6')](),controller[_0xe846('0xb')]);router[_0xe846('0x7')]('/:id/messages',auth[_0xe846('0x6')](),controller[_0xe846('0xc')]);router['get']('/:id/download',auth[_0xe846('0x6')](),controller[_0xe846('0xd')]);router[_0xe846('0xe')]('/',auth[_0xe846('0x6')](),controller['create']);router[_0xe846('0xe')]('/:id/messages',auth[_0xe846('0x6')](),controller[_0xe846('0xf')]);router[_0xe846('0xe')]('/:id/tags',auth[_0xe846('0x6')](),interaction[_0xe846('0x10')]('fax',_0xe846('0x11')),controller[_0xe846('0x12')]);router['put'](_0xe846('0xa'),auth[_0xe846('0x6')](),interaction[_0xe846('0x10')](_0xe846('0x13'),_0xe846('0x14')),controller[_0xe846('0x15')]);router['delete'](_0xe846('0xa'),auth[_0xe846('0x6')](),interaction['tracked'](_0xe846('0x13'),_0xe846('0x16')),controller[_0xe846('0x17')]);router['delete'](_0xe846('0x18'),auth[_0xe846('0x6')](),controller[_0xe846('0x19')]);module[_0xe846('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 75095a5..3473560 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 _0x85b5=['ENUM','TEXT','sequelize','exports','medium'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0x85b5,0x7f));var _0x585b=function(_0x3fca9c,_0x65133c){_0x3fca9c=_0x3fca9c-0x0;var _0x226d29=_0x85b5[_0x3fca9c];return _0x226d29;};'use strict';var Sequelize=require(_0x585b('0x0'));module[_0x585b('0x1')]={'body':{'type':Sequelize['TEXT'](_0x585b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x585b('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x585b('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x54f3=['exports','TEXT','medium','BOOLEAN','ENUM','DATE'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0x54f3,0x120));var _0x354f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x54f3[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x354f('0x0')]={'body':{'type':Sequelize[_0x354f('0x1')](_0x354f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x354f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x354f('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x354f('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x354f('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 59211a1..ab6a0be 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 _0x467d=['message','result','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','internal','channel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ace5e,_0x362331){var _0x45374b=function(_0x2d1045){while(--_0x2d1045){_0x2ace5e['push'](_0x2ace5e['shift']());}};_0x45374b(++_0x362331);}(_0x467d,0x69));var _0xd467=function(_0x1b4c70,_0x2447b0){_0x1b4c70=_0x1b4c70-0x0;var _0x44f84a=_0x467d[_0x1b4c70];return _0x44f84a;};'use strict';var emlformat=require(_0xd467('0x0'));var rimraf=require(_0xd467('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd467('0x2'));var rp=require('request-promise');var moment=require(_0xd467('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd467('0x4'));var util=require(_0xd467('0x5'));var path=require(_0xd467('0x6'));var sox=require('sox');var csv=require(_0xd467('0x7'));var ejs=require(_0xd467('0x8'));var fs=require('fs');var fs_extra=require(_0xd467('0x9'));var _=require('lodash');var squel=require(_0xd467('0xa'));var crypto=require(_0xd467('0xb'));var jsforce=require(_0xd467('0xc'));var deskjs=require(_0xd467('0xd'));var toCsv=require(_0xd467('0x7'));var querystring=require(_0xd467('0xe'));var Papa=require('papaparse');var Redis=require(_0xd467('0xf'));var authService=require(_0xd467('0x10'));var qs=require(_0xd467('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd467('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd467('0x13'));var licenseUtil=require(_0xd467('0x14'));var db=require(_0xd467('0x15'))['db'];config[_0xd467('0x16')]=_[_0xd467('0x17')](config[_0xd467('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd467('0x18'))(new Redis(config[_0xd467('0x16')]));require(_0xd467('0x19'))['register'](socket);var jayson=require(_0xd467('0x1a'));var client=jayson[_0xd467('0x1b')][_0xd467('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42dd1e,_0x11d70e,_0x144018,_0x1ec91b){return new BPromise(function(_0x2f45ed,_0x21f093){var _0x294196=_0x1ec91b||client;return _0x294196[_0xd467('0x1d')](_0x42dd1e,_0x144018)['then'](function(_0x1a7595){logger[_0xd467('0x1e')](_0xd467('0x1f'),_0x11d70e,_0xd467('0x20'));logger[_0xd467('0x21')](_0xd467('0x22'),_0x11d70e,'request\x20sent',JSON[_0xd467('0x23')](_0x1a7595));if(_0x1a7595['error']){if(_0x1a7595[_0xd467('0x24')]['code']===0x1f4){logger['error'](_0xd467('0x1f'),_0x11d70e,_0x1a7595[_0xd467('0x24')][_0xd467('0x25')]);return _0x21f093(_0x1a7595[_0xd467('0x24')][_0xd467('0x25')]);}logger[_0xd467('0x24')](_0xd467('0x1f'),_0x11d70e,_0x1a7595[_0xd467('0x24')]['message']);return _0x2f45ed(_0x1a7595[_0xd467('0x24')][_0xd467('0x25')]);}else{logger[_0xd467('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x11d70e,_0xd467('0x20'));_0x2f45ed(_0x1a7595[_0xd467('0x26')][_0xd467('0x25')]);}})['catch'](function(_0x19b53b){logger[_0xd467('0x24')](_0xd467('0x1f'),_0x11d70e,_0x19b53b);_0x21f093(_0x19b53b);});});}function respondWithStatusCode(_0x55dfc6,_0xbd150c){_0xbd150c=_0xbd150c||0xcc;return function(_0x39a141){if(_0x39a141){return _0x55dfc6[_0xd467('0x27')](_0xbd150c);}return _0x55dfc6[_0xd467('0x28')](_0xbd150c)[_0xd467('0x29')]();};}function respondWithResult(_0x46b193,_0x2f0157){_0x2f0157=_0x2f0157||0xc8;return function(_0x878324){if(_0x878324){return _0x46b193[_0xd467('0x28')](_0x2f0157)[_0xd467('0x2a')](_0x878324);}};}function respondWithFilteredResult(_0x317b6f,_0x17f8a1){return function(_0x3dcde0){if(_0x3dcde0){var _0x2d4fc7=typeof _0x17f8a1[_0xd467('0x2b')]==='undefined'&&typeof _0x17f8a1[_0xd467('0x2c')]==='undefined';var _0x345dfc=_0x3dcde0[_0xd467('0x2d')];var _0x4e0720=_0x2d4fc7?0x0:_0x17f8a1[_0xd467('0x2b')];var _0x21905d=_0x2d4fc7?_0x3dcde0['count']:_0x17f8a1[_0xd467('0x2b')]+_0x17f8a1[_0xd467('0x2c')];var _0x3b8f9d;if(_0x21905d>=_0x345dfc){_0x21905d=_0x345dfc;_0x3b8f9d=0xc8;}else{_0x3b8f9d=0xce;}_0x317b6f[_0xd467('0x28')](_0x3b8f9d);return _0x317b6f['set'](_0xd467('0x2e'),_0x4e0720+'-'+_0x21905d+'/'+_0x345dfc)['json'](_0x3dcde0);}return null;};}function patchUpdates(_0x548de8){return function(_0x5ae4e0){try{jsonpatch[_0xd467('0x2f')](_0x5ae4e0,_0x548de8,!![]);}catch(_0x43c395){return BPromise[_0xd467('0x30')](_0x43c395);}return _0x5ae4e0[_0xd467('0x31')]();};}function saveUpdates(_0x2b6230,_0x460726){return function(_0x338d92){if(_0x338d92){return _0x338d92[_0xd467('0x32')](_0x2b6230)[_0xd467('0x33')](function(_0x48d19a){return _0x48d19a;});}return null;};}function removeEntity(_0x2b07b7,_0x2e2b09){return function(_0x4fda95){if(_0x4fda95){return _0x4fda95[_0xd467('0x34')]()[_0xd467('0x33')](function(){_0x2b07b7[_0xd467('0x28')](0xcc)[_0xd467('0x29')]();});}};}function handleEntityNotFound(_0x54d707,_0x3f98f4){return function(_0xf959d5){if(!_0xf959d5){_0x54d707['sendStatus'](0x194);}return _0xf959d5;};}function handleError(_0x446599,_0x221a26){_0x221a26=_0x221a26||0x1f4;return function(_0x3e42fb){logger[_0xd467('0x24')](_0x3e42fb['stack']);if(_0x3e42fb[_0xd467('0x35')]){delete _0x3e42fb[_0xd467('0x35')];}_0x446599[_0xd467('0x28')](_0x221a26)[_0xd467('0x36')](_0x3e42fb);};}exports[_0xd467('0x37')]=function(_0x421f16,_0x2551ba){var _0x13ee8f={},_0x3e3aec={},_0x34993a={'count':0x0,'rows':[]};var _0x8a3026=_['map'](db[_0xd467('0x38')][_0xd467('0x39')],function(_0x312126){return{'name':_0x312126['fieldName'],'type':_0x312126[_0xd467('0x3a')][_0xd467('0x3b')]};});_0x3e3aec[_0xd467('0x3c')]=_[_0xd467('0x3d')](_0x8a3026,_0xd467('0x35'));_0x3e3aec[_0xd467('0x3e')]=_[_0xd467('0x3f')](_0x421f16[_0xd467('0x3e')]);_0x3e3aec[_0xd467('0x40')]=_[_0xd467('0x41')](_0x3e3aec['model'],_0x3e3aec[_0xd467('0x3e')]);_0x13ee8f[_0xd467('0x42')]=_[_0xd467('0x41')](_0x3e3aec[_0xd467('0x3c')],qs[_0xd467('0x43')](_0x421f16[_0xd467('0x3e')][_0xd467('0x43')]));_0x13ee8f[_0xd467('0x42')]=_0x13ee8f[_0xd467('0x42')][_0xd467('0x44')]?_0x13ee8f[_0xd467('0x42')]:_0x3e3aec[_0xd467('0x3c')];if(!_0x421f16[_0xd467('0x3e')][_0xd467('0x45')](_0xd467('0x46'))){_0x13ee8f[_0xd467('0x2c')]=qs[_0xd467('0x2c')](_0x421f16['query'][_0xd467('0x2c')]);_0x13ee8f[_0xd467('0x2b')]=qs[_0xd467('0x2b')](_0x421f16['query'][_0xd467('0x2b')]);}_0x13ee8f[_0xd467('0x47')]=qs['sort'](_0x421f16[_0xd467('0x3e')]['sort']);_0x13ee8f[_0xd467('0x48')]=qs[_0xd467('0x40')](_[_0xd467('0x49')](_0x421f16[_0xd467('0x3e')],_0x3e3aec['filters']),_0x8a3026);if(_0x421f16[_0xd467('0x3e')][_0xd467('0x4a')]){_0x13ee8f['where']=_['merge'](_0x13ee8f[_0xd467('0x48')],{'$or':_[_0xd467('0x3d')](_0x8a3026,function(_0x50a4fa){if(_0x50a4fa[_0xd467('0x3a')]!==_0xd467('0x4b')){var _0x3dfa69={};_0x3dfa69[_0x50a4fa[_0xd467('0x35')]]={'$like':'%'+_0x421f16[_0xd467('0x3e')][_0xd467('0x4a')]+'%'};return _0x3dfa69;}})});}_0x13ee8f=_[_0xd467('0x4c')]({},_0x13ee8f,_0x421f16[_0xd467('0x4d')]);var _0x44da58={'where':_0x13ee8f['where']};return db[_0xd467('0x38')][_0xd467('0x2d')](_0x44da58)['then'](function(_0x229e11){_0x34993a['count']=_0x229e11;if(_0x421f16['query'][_0xd467('0x4e')]){_0x13ee8f[_0xd467('0x4f')]=[{'all':!![]}];}return db[_0xd467('0x38')]['findAll'](_0x13ee8f);})['then'](function(_0x4b8ab6){_0x34993a['rows']=_0x4b8ab6;return _0x34993a;})[_0xd467('0x33')](respondWithFilteredResult(_0x2551ba,_0x13ee8f))[_0xd467('0x50')](handleError(_0x2551ba,null));};exports[_0xd467('0x51')]=function(_0x547c52,_0x39fa38){var _0x44e219={'raw':!![],'where':{'id':_0x547c52[_0xd467('0x52')]['id']}},_0x5a9838={};_0x5a9838[_0xd467('0x3c')]=_['keys'](db[_0xd467('0x38')][_0xd467('0x39')]);_0x5a9838['query']=_[_0xd467('0x3f')](_0x547c52[_0xd467('0x3e')]);_0x5a9838['filters']=_[_0xd467('0x41')](_0x5a9838['model'],_0x5a9838['query']);_0x44e219[_0xd467('0x42')]=_[_0xd467('0x41')](_0x5a9838[_0xd467('0x3c')],qs['fields'](_0x547c52[_0xd467('0x3e')][_0xd467('0x43')]));_0x44e219[_0xd467('0x42')]=_0x44e219[_0xd467('0x42')][_0xd467('0x44')]?_0x44e219['attributes']:_0x5a9838[_0xd467('0x3c')];if(_0x547c52['query'][_0xd467('0x4e')]){_0x44e219[_0xd467('0x4f')]=[{'all':!![]}];}_0x44e219=_['merge']({},_0x44e219,_0x547c52[_0xd467('0x4d')]);return db['FaxMessage'][_0xd467('0x53')](_0x44e219)['then'](handleEntityNotFound(_0x39fa38,null))[_0xd467('0x33')](respondWithResult(_0x39fa38,null))['catch'](handleError(_0x39fa38,null));};exports[_0xd467('0x32')]=function(_0x1131ea,_0x49df31){if(_0x1131ea[_0xd467('0x54')]['id']){delete _0x1131ea['body']['id'];}return db[_0xd467('0x38')][_0xd467('0x53')]({'where':{'id':_0x1131ea[_0xd467('0x52')]['id']}})['then'](handleEntityNotFound(_0x49df31,null))[_0xd467('0x33')](saveUpdates(_0x1131ea[_0xd467('0x54')],null))[_0xd467('0x33')](respondWithResult(_0x49df31,null))[_0xd467('0x50')](handleError(_0x49df31,null));};exports[_0xd467('0x34')]=function(_0x52a289,_0x3ae4da){return db['FaxMessage'][_0xd467('0x53')]({'where':{'id':_0x52a289['params']['id']}})[_0xd467('0x33')](handleEntityNotFound(_0x3ae4da,null))['then'](removeEntity(_0x3ae4da,null))[_0xd467('0x50')](handleError(_0x3ae4da,null));};exports[_0xd467('0x55')]=function(_0x2f4e5,_0x5ded1b){return db[_0xd467('0x38')][_0xd467('0x55')]()[_0xd467('0x33')](respondWithResult(_0x5ded1b,null))[_0xd467('0x50')](handleError(_0x5ded1b,null));};var interaction_log=require('../../config/logger')(_0xd467('0x56'));exports['accept']=function(_0x1ce691,_0x2dadd8,_0x585902){var _0x4f2f77={'agent':{},'channel':_0xd467('0x57')};if(_0x1ce691['body']['id']){delete _0x1ce691[_0xd467('0x54')]['id'];}_0x1ce691[_0xd467('0x54')][_0xd467('0x58')]=!![];_0x1ce691[_0xd467('0x54')][_0xd467('0x59')]=moment()[_0xd467('0x5a')](_0xd467('0x5b'));_0x1ce691['body']['UserId']=_0x1ce691[_0xd467('0x54')][_0xd467('0x5c')]||_0x1ce691[_0xd467('0x5d')]['id'];_0x4f2f77[_0xd467('0x5e')]['id']=_0x1ce691[_0xd467('0x54')][_0xd467('0x5c')];return db[_0xd467('0x38')][_0xd467('0x53')]({'where':{'id':_0x1ce691[_0xd467('0x52')]['id'],'UserId':null}})[_0xd467('0x33')](handleEntityNotFound(_0x2dadd8,null))['then'](saveUpdates(_0x1ce691[_0xd467('0x54')],null))['then'](function(_0x3a71d4){if(_0x3a71d4){_0x4f2f77[_0xd467('0x25')]=_0x3a71d4[_0xd467('0x5f')]({'plain':!![]});return db[_0xd467('0x60')]['find']({'where':{'id':_0x3a71d4[_0xd467('0x61')]}});}return null;})[_0xd467('0x33')](handleEntityNotFound(_0x2dadd8,null))[_0xd467('0x33')](function(_0x1aa88e){if(_0x1aa88e){return _0x1aa88e[_0xd467('0x32')]({'UserId':_0x1ce691[_0xd467('0x54')][_0xd467('0x5c')],'read1stAt':_[_0xd467('0x62')](_0x1aa88e[_0xd467('0x63')])?moment()[_0xd467('0x5a')](_0xd467('0x5b')):undefined});}return null;})[_0xd467('0x33')](function(_0x21862c){if(_0x21862c){_0x4f2f77[_0xd467('0x64')]=_0x21862c[_0xd467('0x5f')]({'plain':!![]});interaction_log[_0xd467('0x1e')](_0xd467('0x65'),_0x1ce691[_0xd467('0x5d')]['id'],_0x1ce691[_0xd467('0x5d')][_0xd467('0x35')],_0x1ce691[_0xd467('0x5d')][_0xd467('0x66')],_0x4f2f77['interaction']['id'],_0x1ce691[_0xd467('0x54')]?JSON['stringify'](_0x1ce691[_0xd467('0x54')]):_0xd467('0x67'));return respondWithRpcPromise(_0xd467('0x68'),_0xd467('0x69'),_0x4f2f77);}return null;})[_0xd467('0x33')](function(_0x27f4ed){var _0xfb95=_0xd467('0x6a')+_0x27f4ed[_0xd467('0x25')][_0xd467('0x6b')];return db[_0xd467('0x6c')][_0xd467('0x3e')](_0xfb95,{'type':db['Sequelize'][_0xd467('0x6d')][_0xd467('0x6e')],'raw':!![]})['then'](function(_0x54a985){return _0x54a985;});})[_0xd467('0x33')](function(_0x1b41a9){if(_0x1b41a9){_0x4f2f77[_0xd467('0x25')][_0xd467('0x6f')]=_0x1b41a9[0x0];if(!_0x1ce691['body'][_0xd467('0x5c')])return;return db[_0xd467('0x70')]['find']({'where':{'id':_0x1ce691[_0xd467('0x54')][_0xd467('0x5c')],'role':'agent'},'attributes':['id',_0xd467('0x35'),_0xd467('0x71'),_0xd467('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x379c0d){if(!_0x379c0d)return null;_0x4f2f77['message']['agent']=_0x379c0d;return _0x4f2f77;})[_0xd467('0x33')](function(_0x101293){if(_0x101293){if(_0x1ce691['body']['manual']){_0x4f2f77[_0xd467('0x25')][_0xd467('0x73')]=util[_0xd467('0x5a')](_0xd467('0x74'),_0x1ce691[_0xd467('0x5d')][_0xd467('0x35')]);_0x4f2f77['message']['channel']=_0x4f2f77['channel'];_0x4f2f77[_0xd467('0x25')][_0xd467('0x75')]=_0x4f2f77['channel'];_0x4f2f77[_0xd467('0x25')][_0xd467('0x76')]=_0xd467('0x77');return respondWithRpcPromise(_0xd467('0x78'),_0xd467('0x78'),{'event':_0xd467('0x79'),'message':_0x4f2f77[_0xd467('0x25')]},client9002)[_0xd467('0x33')](function(){return _0x4f2f77;});}return _0x4f2f77;}return null;})['then'](respondWithResult(_0x2dadd8,null))[_0xd467('0x50')](handleError(_0x2dadd8,null));};var interaction_log=require(_0xd467('0x12'))('fax-interactions');exports[_0xd467('0x30')]=function(_0x27eb7e,_0xad59d9,_0xa576fa){var _0x3e741e={'agent':{},'channel':_0xd467('0x57')};if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0xd467('0x54')]['id'];}_0x27eb7e['body']['UserId']=_0x27eb7e['body'][_0xd467('0x5c')]||_0x27eb7e[_0xd467('0x5d')]['id'];_0x3e741e['agent']['id']=_0x27eb7e[_0xd467('0x54')][_0xd467('0x5c')];return db[_0xd467('0x38')][_0xd467('0x53')]({'where':{'id':_0x27eb7e[_0xd467('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xad59d9,null))[_0xd467('0x33')](function(_0x3dc452){if(_0x3dc452){_0x3e741e['message']=_0x3dc452[_0xd467('0x5f')]({'plain':!![]});return db[_0xd467('0x60')]['find']({'where':{'id':_0x3dc452['FaxInteractionId']}});}return null;})[_0xd467('0x33')](handleEntityNotFound(_0xad59d9,null))[_0xd467('0x33')](function(_0x1f796e){if(_0x1f796e){_0x3e741e[_0xd467('0x64')]=_0x1f796e[_0xd467('0x5f')]({'plain':!![]});interaction_log[_0xd467('0x1e')](_0xd467('0x7a'),_0x27eb7e[_0xd467('0x5d')]['id'],_0x27eb7e['user'][_0xd467('0x35')],_0x27eb7e[_0xd467('0x5d')][_0xd467('0x66')],_0x3e741e[_0xd467('0x64')]['id'],_0x27eb7e[_0xd467('0x54')]?JSON[_0xd467('0x23')](_0x27eb7e[_0xd467('0x54')]):_0xd467('0x67'));return respondWithRpcPromise('RejectMessage',_0xd467('0x7b'),_0x3e741e);}return null;})[_0xd467('0x33')](function(_0x2acc1f){var _0x5dab2e=_0xd467('0x6a')+_0x2acc1f['message'][_0xd467('0x6b')];return db[_0xd467('0x6c')]['query'](_0x5dab2e,{'type':db[_0xd467('0x7c')][_0xd467('0x6d')][_0xd467('0x6e')],'raw':!![]})['then'](function(_0x378aee){return _0x378aee;});})[_0xd467('0x33')](function(_0x598371){if(_0x598371){_0x3e741e['message'][_0xd467('0x6f')]=_0x598371[0x0];if(!_0x27eb7e[_0xd467('0x54')][_0xd467('0x5c')])return;return db[_0xd467('0x70')][_0xd467('0x53')]({'where':{'id':_0x27eb7e[_0xd467('0x54')][_0xd467('0x5c')],'role':_0xd467('0x5e')},'attributes':['id',_0xd467('0x35'),'fullname',_0xd467('0x72'),_0xd467('0x7d')],'raw':!![]});}return null;})[_0xd467('0x33')](function(_0x374872){if(!_0x374872)return null;_0x3e741e['message'][_0xd467('0x5e')]=_0x374872;return _0x3e741e;})[_0xd467('0x33')](function(_0x4f1b70){if(_0x4f1b70){_0x4f1b70[_0xd467('0x25')]['interface']=util['format']('SIP/%s',_0x27eb7e['user'][_0xd467('0x35')]);_0x4f1b70[_0xd467('0x25')][_0xd467('0x7e')]=_0x3e741e['channel'];_0x4f1b70[_0xd467('0x25')][_0xd467('0x75')]=_0x3e741e[_0xd467('0x7e')];_0x4f1b70[_0xd467('0x25')]['event']='reject';respondWithRpcPromise(_0xd467('0x78'),'EventManager',{'event':_0xd467('0x7f'),'message':_0x4f1b70[_0xd467('0x25')]},client9002);return _0x3e741e;}return null;})[_0xd467('0x33')](respondWithResult(_0xad59d9,null))[_0xd467('0x50')](handleError(_0xad59d9,null));};exports[_0xd467('0x80')]=function(_0x14e59b,_0x2c6c7e){var _0x28a0c6;return db['FaxMessage'][_0xd467('0x80')](_0x14e59b['body'],{})[_0xd467('0x33')](function(_0x34d70e){_0x28a0c6=_0x34d70e;return db[_0xd467('0x81')][_0xd467('0x82')]({'where':{'id':_0x28a0c6['ContactId']}});})['then'](function(_0x378a43){if(_[_0xd467('0x62')](_0x378a43)){return;}else{_0x28a0c6[_0xd467('0x57')]=_0x378a43[_0xd467('0x57')];return db[_0xd467('0x83')][_0xd467('0x82')]({'where':{'id':_0x28a0c6[_0xd467('0x84')]}});}})[_0xd467('0x33')](function(_0x4182b3){return respondWithRpcPromise('SendFax',_0xd467('0x85'),{'FaxAccountId':_[_0xd467('0x62')](_0x14e59b[_0xd467('0x54')])?undefined:_0x14e59b['body'][_0xd467('0x86')],'path':_[_0xd467('0x62')](_0x4182b3)?undefined:util['format'](_0xd467('0x87'),_0x4182b3[_0xd467('0x88')]),'fax':_[_0xd467('0x62')](_0x28a0c6['fax'])?undefined:_0x28a0c6['fax'],'AttachmentId':_0x28a0c6['AttachmentId']},client9002);})[_0xd467('0x33')](respondWithResult(_0x2c6c7e,0xc9))[_0xd467('0x50')](handleError(_0x2c6c7e,null));};exports[_0xd467('0x89')]=function(_0x15cafe,_0xf2a8ea){var _0x2bb48b=path[_0xd467('0x8a')](config['root'],_0xd467('0x8b'),_0xd467('0x8c'),_0xd467('0x8d'));return db[_0xd467('0x38')][_0xd467('0x53')]({'where':{'id':_0x15cafe['params']['id']},'include':[{'model':db[_0xd467('0x83')],'as':_0xd467('0x83')}]})[_0xd467('0x33')](handleEntityNotFound(_0xf2a8ea,null))[_0xd467('0x33')](function(_0x311990){if(_0x311990){return _0xf2a8ea['download'](path['join'](_0x2bb48b,_0x311990[_0xd467('0x83')][_0xd467('0x88')]));}})[_0xd467('0x50')](handleError(_0xf2a8ea,null));}; \ No newline at end of file +var _0x83a0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','update','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','fullname','email','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','download','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring'];(function(_0x4b2976,_0x11a553){var _0x43a714=function(_0x1c989a){while(--_0x1c989a){_0x4b2976['push'](_0x4b2976['shift']());}};_0x43a714(++_0x11a553);}(_0x83a0,0x111));var _0x083a=function(_0x6751fa,_0x410198){_0x6751fa=_0x6751fa-0x0;var _0x3f24c1=_0x83a0[_0x6751fa];return _0x3f24c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x083a('0x0'));var rp=require(_0x083a('0x1'));var moment=require('moment');var BPromise=require(_0x083a('0x2'));var Mustache=require(_0x083a('0x3'));var util=require(_0x083a('0x4'));var path=require(_0x083a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x083a('0x6'));var fs=require('fs');var fs_extra=require(_0x083a('0x7'));var _=require(_0x083a('0x8'));var squel=require('squel');var crypto=require(_0x083a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x083a('0xa'));var toCsv=require(_0x083a('0xb'));var querystring=require(_0x083a('0xc'));var Papa=require('papaparse');var Redis=require(_0x083a('0xd'));var authService=require(_0x083a('0xe'));var qs=require(_0x083a('0xf'));var as=require(_0x083a('0x10'));var hardwareService=require(_0x083a('0x11'));var logger=require(_0x083a('0x12'))('api');var utils=require(_0x083a('0x13'));var config=require(_0x083a('0x14'));var licenseUtil=require(_0x083a('0x15'));var db=require('../../mysqldb')['db'];config[_0x083a('0x16')]=_[_0x083a('0x17')](config[_0x083a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x083a('0x18'))(new Redis(config[_0x083a('0x16')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x083a('0x19'));var client=jayson['client'][_0x083a('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37987e,_0xa52ae9,_0x2a82da,_0x2c969f){return new BPromise(function(_0x372420,_0x58b030){var _0x271fed=_0x2c969f||client;return _0x271fed[_0x083a('0x1b')](_0x37987e,_0x2a82da)[_0x083a('0x1c')](function(_0x308f65){logger[_0x083a('0x1d')](_0x083a('0x1e'),_0xa52ae9,_0x083a('0x1f'));logger[_0x083a('0x20')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xa52ae9,_0x083a('0x1f'),JSON['stringify'](_0x308f65));if(_0x308f65[_0x083a('0x21')]){if(_0x308f65[_0x083a('0x21')][_0x083a('0x22')]===0x1f4){logger[_0x083a('0x21')](_0x083a('0x1e'),_0xa52ae9,_0x308f65['error'][_0x083a('0x23')]);return _0x58b030(_0x308f65[_0x083a('0x21')]['message']);}logger[_0x083a('0x21')](_0x083a('0x1e'),_0xa52ae9,_0x308f65[_0x083a('0x21')][_0x083a('0x23')]);return _0x372420(_0x308f65[_0x083a('0x21')][_0x083a('0x23')]);}else{logger[_0x083a('0x1d')]('FaxMessage,\x20%s,\x20%s',_0xa52ae9,_0x083a('0x1f'));_0x372420(_0x308f65[_0x083a('0x24')][_0x083a('0x23')]);}})['catch'](function(_0x723d1f){logger['error']('FaxMessage,\x20%s,\x20%s',_0xa52ae9,_0x723d1f);_0x58b030(_0x723d1f);});});}function respondWithStatusCode(_0x1cdf22,_0x11f986){_0x11f986=_0x11f986||0xcc;return function(_0xb7ba4){if(_0xb7ba4){return _0x1cdf22[_0x083a('0x25')](_0x11f986);}return _0x1cdf22[_0x083a('0x26')](_0x11f986)[_0x083a('0x27')]();};}function respondWithResult(_0x38776b,_0x24834d){_0x24834d=_0x24834d||0xc8;return function(_0x1cbe39){if(_0x1cbe39){return _0x38776b['status'](_0x24834d)['json'](_0x1cbe39);}};}function respondWithFilteredResult(_0x39b161,_0x99134){return function(_0x2541e7){if(_0x2541e7){var _0x277609=typeof _0x99134[_0x083a('0x28')]==='undefined'&&typeof _0x99134[_0x083a('0x29')]===_0x083a('0x2a');var _0x265a99=_0x2541e7[_0x083a('0x2b')];var _0x8ac9cc=_0x277609?0x0:_0x99134[_0x083a('0x28')];var _0x3387ec=_0x277609?_0x2541e7['count']:_0x99134[_0x083a('0x28')]+_0x99134[_0x083a('0x29')];var _0x3c0059;if(_0x3387ec>=_0x265a99){_0x3387ec=_0x265a99;_0x3c0059=0xc8;}else{_0x3c0059=0xce;}_0x39b161[_0x083a('0x26')](_0x3c0059);return _0x39b161[_0x083a('0x2c')](_0x083a('0x2d'),_0x8ac9cc+'-'+_0x3387ec+'/'+_0x265a99)['json'](_0x2541e7);}return null;};}function patchUpdates(_0x5fb667){return function(_0x4342fe){try{jsonpatch[_0x083a('0x2e')](_0x4342fe,_0x5fb667,!![]);}catch(_0x364874){return BPromise[_0x083a('0x2f')](_0x364874);}return _0x4342fe[_0x083a('0x30')]();};}function saveUpdates(_0x18775f,_0x56e3f4){return function(_0x1e74c0){if(_0x1e74c0){return _0x1e74c0['update'](_0x18775f)[_0x083a('0x1c')](function(_0x40b0e6){return _0x40b0e6;});}return null;};}function removeEntity(_0xeeeb98,_0x433637){return function(_0x55c32b){if(_0x55c32b){return _0x55c32b[_0x083a('0x31')]()[_0x083a('0x1c')](function(){_0xeeeb98[_0x083a('0x26')](0xcc)[_0x083a('0x27')]();});}};}function handleEntityNotFound(_0x5c814b,_0x4074dd){return function(_0x4af072){if(!_0x4af072){_0x5c814b['sendStatus'](0x194);}return _0x4af072;};}function handleError(_0x2ca552,_0xddabfe){_0xddabfe=_0xddabfe||0x1f4;return function(_0x3e56b6){logger['error'](_0x3e56b6['stack']);if(_0x3e56b6['name']){delete _0x3e56b6[_0x083a('0x32')];}_0x2ca552['status'](_0xddabfe)[_0x083a('0x33')](_0x3e56b6);};}exports[_0x083a('0x34')]=function(_0x1e7372,_0x1c2e21){var _0x110a0d={},_0x4718f4={},_0x221e20={'count':0x0,'rows':[]};var _0x55bf0e=_[_0x083a('0x35')](db[_0x083a('0x36')][_0x083a('0x37')],function(_0x5cc4c0){return{'name':_0x5cc4c0[_0x083a('0x38')],'type':_0x5cc4c0[_0x083a('0x39')][_0x083a('0x3a')]};});_0x4718f4[_0x083a('0x3b')]=_['map'](_0x55bf0e,_0x083a('0x32'));_0x4718f4['query']=_[_0x083a('0x3c')](_0x1e7372[_0x083a('0x3d')]);_0x4718f4[_0x083a('0x3e')]=_[_0x083a('0x3f')](_0x4718f4[_0x083a('0x3b')],_0x4718f4['query']);_0x110a0d['attributes']=_[_0x083a('0x3f')](_0x4718f4[_0x083a('0x3b')],qs[_0x083a('0x40')](_0x1e7372['query'][_0x083a('0x40')]));_0x110a0d['attributes']=_0x110a0d['attributes'][_0x083a('0x41')]?_0x110a0d[_0x083a('0x42')]:_0x4718f4[_0x083a('0x3b')];if(!_0x1e7372['query'][_0x083a('0x43')](_0x083a('0x44'))){_0x110a0d[_0x083a('0x29')]=qs['limit'](_0x1e7372['query'][_0x083a('0x29')]);_0x110a0d[_0x083a('0x28')]=qs[_0x083a('0x28')](_0x1e7372[_0x083a('0x3d')][_0x083a('0x28')]);}_0x110a0d['order']=qs[_0x083a('0x45')](_0x1e7372[_0x083a('0x3d')][_0x083a('0x45')]);_0x110a0d[_0x083a('0x46')]=qs[_0x083a('0x3e')](_['pick'](_0x1e7372[_0x083a('0x3d')],_0x4718f4['filters']),_0x55bf0e);if(_0x1e7372[_0x083a('0x3d')][_0x083a('0x47')]){_0x110a0d[_0x083a('0x46')]=_[_0x083a('0x48')](_0x110a0d['where'],{'$or':_[_0x083a('0x35')](_0x55bf0e,function(_0x29d142){if(_0x29d142['type']!==_0x083a('0x49')){var _0x1bdf3b={};_0x1bdf3b[_0x29d142[_0x083a('0x32')]]={'$like':'%'+_0x1e7372[_0x083a('0x3d')][_0x083a('0x47')]+'%'};return _0x1bdf3b;}})});}_0x110a0d=_['merge']({},_0x110a0d,_0x1e7372[_0x083a('0x4a')]);var _0xb7611f={'where':_0x110a0d['where']};return db['FaxMessage']['count'](_0xb7611f)[_0x083a('0x1c')](function(_0x5f145e){_0x221e20[_0x083a('0x2b')]=_0x5f145e;if(_0x1e7372['query'][_0x083a('0x4b')]){_0x110a0d[_0x083a('0x4c')]=[{'all':!![]}];}return db[_0x083a('0x36')][_0x083a('0x4d')](_0x110a0d);})[_0x083a('0x1c')](function(_0x1dff81){_0x221e20[_0x083a('0x4e')]=_0x1dff81;return _0x221e20;})['then'](respondWithFilteredResult(_0x1c2e21,_0x110a0d))[_0x083a('0x4f')](handleError(_0x1c2e21,null));};exports[_0x083a('0x50')]=function(_0x301210,_0x150faf){var _0x24a6d3={'raw':!![],'where':{'id':_0x301210[_0x083a('0x51')]['id']}},_0x37e139={};_0x37e139[_0x083a('0x3b')]=_[_0x083a('0x3c')](db[_0x083a('0x36')][_0x083a('0x37')]);_0x37e139[_0x083a('0x3d')]=_[_0x083a('0x3c')](_0x301210['query']);_0x37e139[_0x083a('0x3e')]=_['intersection'](_0x37e139[_0x083a('0x3b')],_0x37e139[_0x083a('0x3d')]);_0x24a6d3[_0x083a('0x42')]=_['intersection'](_0x37e139[_0x083a('0x3b')],qs[_0x083a('0x40')](_0x301210[_0x083a('0x3d')][_0x083a('0x40')]));_0x24a6d3[_0x083a('0x42')]=_0x24a6d3[_0x083a('0x42')][_0x083a('0x41')]?_0x24a6d3[_0x083a('0x42')]:_0x37e139[_0x083a('0x3b')];if(_0x301210['query'][_0x083a('0x4b')]){_0x24a6d3[_0x083a('0x4c')]=[{'all':!![]}];}_0x24a6d3=_[_0x083a('0x48')]({},_0x24a6d3,_0x301210['options']);return db[_0x083a('0x36')]['find'](_0x24a6d3)[_0x083a('0x1c')](handleEntityNotFound(_0x150faf,null))[_0x083a('0x1c')](respondWithResult(_0x150faf,null))['catch'](handleError(_0x150faf,null));};exports[_0x083a('0x52')]=function(_0x53692b,_0x159fd2){if(_0x53692b[_0x083a('0x53')]['id']){delete _0x53692b[_0x083a('0x53')]['id'];}return db[_0x083a('0x36')][_0x083a('0x54')]({'where':{'id':_0x53692b['params']['id']}})[_0x083a('0x1c')](handleEntityNotFound(_0x159fd2,null))['then'](saveUpdates(_0x53692b['body'],null))[_0x083a('0x1c')](respondWithResult(_0x159fd2,null))['catch'](handleError(_0x159fd2,null));};exports[_0x083a('0x31')]=function(_0xdd7125,_0x5d04be){return db[_0x083a('0x36')][_0x083a('0x54')]({'where':{'id':_0xdd7125[_0x083a('0x51')]['id']}})[_0x083a('0x1c')](handleEntityNotFound(_0x5d04be,null))[_0x083a('0x1c')](removeEntity(_0x5d04be,null))[_0x083a('0x4f')](handleError(_0x5d04be,null));};exports[_0x083a('0x55')]=function(_0x38b112,_0xdcca1){return db[_0x083a('0x36')]['describe']()['then'](respondWithResult(_0xdcca1,null))[_0x083a('0x4f')](handleError(_0xdcca1,null));};var interaction_log=require(_0x083a('0x12'))(_0x083a('0x56'));exports[_0x083a('0x57')]=function(_0x5dc6be,_0x2d024d,_0x2c7fa2){var _0x1f9935={'agent':{},'channel':_0x083a('0x58')};if(_0x5dc6be[_0x083a('0x53')]['id']){delete _0x5dc6be[_0x083a('0x53')]['id'];}_0x5dc6be[_0x083a('0x53')][_0x083a('0x59')]=!![];_0x5dc6be[_0x083a('0x53')][_0x083a('0x5a')]=moment()[_0x083a('0x5b')](_0x083a('0x5c'));_0x5dc6be[_0x083a('0x53')][_0x083a('0x5d')]=_0x5dc6be[_0x083a('0x53')]['UserId']||_0x5dc6be['user']['id'];_0x1f9935[_0x083a('0x5e')]['id']=_0x5dc6be[_0x083a('0x53')]['UserId'];return db['FaxMessage'][_0x083a('0x54')]({'where':{'id':_0x5dc6be[_0x083a('0x51')]['id'],'UserId':null}})[_0x083a('0x1c')](handleEntityNotFound(_0x2d024d,null))['then'](saveUpdates(_0x5dc6be['body'],null))['then'](function(_0xf2c5cc){if(_0xf2c5cc){_0x1f9935['message']=_0xf2c5cc[_0x083a('0x5f')]({'plain':!![]});return db[_0x083a('0x60')][_0x083a('0x54')]({'where':{'id':_0xf2c5cc[_0x083a('0x61')]}});}return null;})[_0x083a('0x1c')](handleEntityNotFound(_0x2d024d,null))[_0x083a('0x1c')](function(_0x469a46){if(_0x469a46){return _0x469a46[_0x083a('0x52')]({'UserId':_0x5dc6be[_0x083a('0x53')]['UserId'],'read1stAt':_[_0x083a('0x62')](_0x469a46[_0x083a('0x63')])?moment()[_0x083a('0x5b')](_0x083a('0x5c')):undefined});}return null;})[_0x083a('0x1c')](function(_0x3bd136){if(_0x3bd136){_0x1f9935['interaction']=_0x3bd136['get']({'plain':!![]});interaction_log[_0x083a('0x1d')](_0x083a('0x64'),_0x5dc6be[_0x083a('0x65')]['id'],_0x5dc6be[_0x083a('0x65')]['name'],_0x5dc6be[_0x083a('0x65')][_0x083a('0x66')],_0x1f9935[_0x083a('0x67')]['id'],_0x5dc6be[_0x083a('0x53')]?JSON[_0x083a('0x68')](_0x5dc6be[_0x083a('0x53')]):_0x083a('0x69'));return respondWithRpcPromise(_0x083a('0x6a'),_0x083a('0x6b'),_0x1f9935);}return null;})[_0x083a('0x1c')](function(_0x45168d){var _0x205f2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45168d[_0x083a('0x23')][_0x083a('0x6c')];return db['sequelize'][_0x083a('0x3d')](_0x205f2e,{'type':db[_0x083a('0x6d')][_0x083a('0x6e')][_0x083a('0x6f')],'raw':!![]})[_0x083a('0x1c')](function(_0x18a11d){return _0x18a11d;});})[_0x083a('0x1c')](function(_0x3acbb7){if(_0x3acbb7){_0x1f9935[_0x083a('0x23')][_0x083a('0x70')]=_0x3acbb7[0x0];if(!_0x5dc6be['body'][_0x083a('0x5d')])return;return db[_0x083a('0x71')][_0x083a('0x54')]({'where':{'id':_0x5dc6be[_0x083a('0x53')][_0x083a('0x5d')],'role':_0x083a('0x5e')},'attributes':['id',_0x083a('0x32'),'fullname','email',_0x083a('0x72')],'raw':!![]});}return null;})[_0x083a('0x1c')](function(_0x218503){if(!_0x218503)return null;_0x1f9935[_0x083a('0x23')][_0x083a('0x5e')]=_0x218503;return _0x1f9935;})['then'](function(_0x470639){if(_0x470639){if(_0x5dc6be['body'][_0x083a('0x73')]){_0x1f9935[_0x083a('0x23')][_0x083a('0x74')]=util[_0x083a('0x5b')](_0x083a('0x75'),_0x5dc6be[_0x083a('0x65')][_0x083a('0x32')]);_0x1f9935[_0x083a('0x23')][_0x083a('0x76')]=_0x1f9935['channel'];_0x1f9935[_0x083a('0x23')]['motionChannel']=_0x1f9935[_0x083a('0x76')];_0x1f9935[_0x083a('0x23')][_0x083a('0x77')]=_0x083a('0x57');return respondWithRpcPromise(_0x083a('0x78'),_0x083a('0x78'),{'event':'acceptmessage','message':_0x1f9935[_0x083a('0x23')]},client9002)['then'](function(){return _0x1f9935;});}return _0x1f9935;}return null;})[_0x083a('0x1c')](respondWithResult(_0x2d024d,null))[_0x083a('0x4f')](handleError(_0x2d024d,null));};var interaction_log=require(_0x083a('0x12'))(_0x083a('0x56'));exports['reject']=function(_0x13cf2a,_0x2fe1e1,_0x5b6f35){var _0x410d46={'agent':{},'channel':_0x083a('0x58')};if(_0x13cf2a[_0x083a('0x53')]['id']){delete _0x13cf2a['body']['id'];}_0x13cf2a[_0x083a('0x53')]['UserId']=_0x13cf2a[_0x083a('0x53')][_0x083a('0x5d')]||_0x13cf2a['user']['id'];_0x410d46[_0x083a('0x5e')]['id']=_0x13cf2a[_0x083a('0x53')][_0x083a('0x5d')];return db[_0x083a('0x36')][_0x083a('0x54')]({'where':{'id':_0x13cf2a[_0x083a('0x51')]['id'],'UserId':null}})[_0x083a('0x1c')](handleEntityNotFound(_0x2fe1e1,null))['then'](function(_0x560088){if(_0x560088){_0x410d46[_0x083a('0x23')]=_0x560088[_0x083a('0x5f')]({'plain':!![]});return db[_0x083a('0x60')][_0x083a('0x54')]({'where':{'id':_0x560088[_0x083a('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x2fe1e1,null))[_0x083a('0x1c')](function(_0x24b77a){if(_0x24b77a){_0x410d46[_0x083a('0x67')]=_0x24b77a[_0x083a('0x5f')]({'plain':!![]});interaction_log[_0x083a('0x1d')](_0x083a('0x79'),_0x13cf2a['user']['id'],_0x13cf2a[_0x083a('0x65')][_0x083a('0x32')],_0x13cf2a['user'][_0x083a('0x66')],_0x410d46['interaction']['id'],_0x13cf2a[_0x083a('0x53')]?JSON[_0x083a('0x68')](_0x13cf2a[_0x083a('0x53')]):_0x083a('0x69'));return respondWithRpcPromise(_0x083a('0x7a'),_0x083a('0x7b'),_0x410d46);}return null;})[_0x083a('0x1c')](function(_0x521662){var _0x2300b7=_0x083a('0x7c')+_0x521662[_0x083a('0x23')][_0x083a('0x6c')];return db[_0x083a('0x7d')][_0x083a('0x3d')](_0x2300b7,{'type':db[_0x083a('0x6d')][_0x083a('0x6e')][_0x083a('0x6f')],'raw':!![]})[_0x083a('0x1c')](function(_0x283fba){return _0x283fba;});})[_0x083a('0x1c')](function(_0x12cb81){if(_0x12cb81){_0x410d46[_0x083a('0x23')][_0x083a('0x70')]=_0x12cb81[0x0];if(!_0x13cf2a[_0x083a('0x53')][_0x083a('0x5d')])return;return db[_0x083a('0x71')]['find']({'where':{'id':_0x13cf2a[_0x083a('0x53')][_0x083a('0x5d')],'role':'agent'},'attributes':['id',_0x083a('0x32'),_0x083a('0x7e'),_0x083a('0x7f'),_0x083a('0x72')],'raw':!![]});}return null;})[_0x083a('0x1c')](function(_0x1f7941){if(!_0x1f7941)return null;_0x410d46['message'][_0x083a('0x5e')]=_0x1f7941;return _0x410d46;})[_0x083a('0x1c')](function(_0x2df396){if(_0x2df396){_0x2df396[_0x083a('0x23')][_0x083a('0x74')]=util[_0x083a('0x5b')](_0x083a('0x75'),_0x13cf2a[_0x083a('0x65')][_0x083a('0x32')]);_0x2df396[_0x083a('0x23')][_0x083a('0x76')]=_0x410d46[_0x083a('0x76')];_0x2df396['message']['motionChannel']=_0x410d46[_0x083a('0x76')];_0x2df396[_0x083a('0x23')]['event']=_0x083a('0x2f');respondWithRpcPromise(_0x083a('0x78'),_0x083a('0x78'),{'event':_0x083a('0x80'),'message':_0x2df396[_0x083a('0x23')]},client9002);return _0x410d46;}return null;})[_0x083a('0x1c')](respondWithResult(_0x2fe1e1,null))[_0x083a('0x4f')](handleError(_0x2fe1e1,null));};exports[_0x083a('0x81')]=function(_0x4ce958,_0x2078ef){var _0x13a5d1;return db[_0x083a('0x36')][_0x083a('0x81')](_0x4ce958[_0x083a('0x53')],{})[_0x083a('0x1c')](function(_0xc6add6){_0x13a5d1=_0xc6add6;return db['CmContact'][_0x083a('0x82')]({'where':{'id':_0x13a5d1[_0x083a('0x6c')]}});})[_0x083a('0x1c')](function(_0x1b62b2){if(_[_0x083a('0x62')](_0x1b62b2)){return;}else{_0x13a5d1['fax']=_0x1b62b2['fax'];return db[_0x083a('0x83')][_0x083a('0x82')]({'where':{'id':_0x13a5d1[_0x083a('0x84')]}});}})[_0x083a('0x1c')](function(_0x39734b){return respondWithRpcPromise(_0x083a('0x85'),_0x083a('0x85'),{'FaxAccountId':_[_0x083a('0x62')](_0x4ce958[_0x083a('0x53')])?undefined:_0x4ce958['body'][_0x083a('0x86')],'path':_['isNil'](_0x39734b)?undefined:util[_0x083a('0x5b')](_0x083a('0x87'),_0x39734b[_0x083a('0x88')]),'fax':_[_0x083a('0x62')](_0x13a5d1[_0x083a('0x58')])?undefined:_0x13a5d1[_0x083a('0x58')],'AttachmentId':_0x13a5d1[_0x083a('0x84')]},client9002);})[_0x083a('0x1c')](respondWithResult(_0x2078ef,0xc9))[_0x083a('0x4f')](handleError(_0x2078ef,null));};exports['download']=function(_0x2887ab,_0x61c891){var _0x39753f=path[_0x083a('0x89')](config[_0x083a('0x8a')],_0x083a('0x8b'),_0x083a('0x8c'),_0x083a('0x8d'));return db[_0x083a('0x36')][_0x083a('0x54')]({'where':{'id':_0x2887ab[_0x083a('0x51')]['id']},'include':[{'model':db[_0x083a('0x83')],'as':_0x083a('0x83')}]})[_0x083a('0x1c')](handleEntityNotFound(_0x61c891,null))[_0x083a('0x1c')](function(_0x228d7f){if(_0x228d7f){return _0x61c891[_0x083a('0x8e')](path[_0x083a('0x89')](_0x39753f,_0x228d7f[_0x083a('0x83')][_0x083a('0x88')]));}})[_0x083a('0x4f')](handleError(_0x61c891,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 545e3f4..542668e 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 _0xbd3c=['update','remove','emit','hook','exports','events','../../mysqldb','FaxMessage','save'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x4931c4,_0x31a6df){_0x4931c4=_0x4931c4-0x0;var _0x1e6f68=_0xbd3c[_0x4931c4];return _0x1e6f68;};'use strict';var EventEmitter=require(_0xcbd3('0x0'));var FaxMessage=require(_0xcbd3('0x1'))['db'][_0xcbd3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcbd3('0x3'),'afterUpdate':_0xcbd3('0x4'),'afterDestroy':_0xcbd3('0x5')};function emitEvent(_0x47ff9b){return function(_0x505967,_0x2b7178,_0x5c280d){FaxMessageEvents[_0xcbd3('0x6')](_0x47ff9b+':'+_0x505967['id'],_0x505967);FaxMessageEvents[_0xcbd3('0x6')](_0x47ff9b,_0x505967);_0x5c280d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xcbd3('0x7')](e,emitEvent(event));}}module[_0xcbd3('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xf811=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x467729,_0x235857){var _0x2017f7=function(_0x168a5b){while(--_0x168a5b){_0x467729['push'](_0x467729['shift']());}};_0x2017f7(++_0x235857);}(_0xf811,0x6f));var _0x1f81=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xf811[_0x2aecb2];return _0x3ebb80;};'use strict';var EventEmitter=require(_0x1f81('0x0'));var FaxMessage=require(_0x1f81('0x1'))['db'][_0x1f81('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1f81('0x3')](0x0);var events={'afterCreate':_0x1f81('0x4'),'afterUpdate':_0x1f81('0x5'),'afterDestroy':_0x1f81('0x6')};function emitEvent(_0x1650f4){return function(_0x18f178,_0x4281c3,_0x40b2b6){FaxMessageEvents[_0x1f81('0x7')](_0x1650f4+':'+_0x18f178['id'],_0x18f178);FaxMessageEvents[_0x1f81('0x7')](_0x1650f4,_0x18f178);_0x40b2b6(null);};}for(var e in events){if(events[_0x1f81('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1f81('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 cdcb9e3..221455a 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 _0x1761=['then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x3a8ae6,_0x4100ce){var _0xac3fa5=function(_0x364541){while(--_0x364541){_0x3a8ae6['push'](_0x3a8ae6['shift']());}};_0xac3fa5(++_0x4100ce);}(_0x1761,0xa6));var _0x1176=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1761[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1176('0x0'));var util=require(_0x1176('0x1'));var logger=require('../../config/logger')(_0x1176('0x2'));var moment=require(_0x1176('0x3'));var BPromise=require(_0x1176('0x4'));var rp=require(_0x1176('0x5'));var fs=require('fs');var path=require(_0x1176('0x6'));var rimraf=require(_0x1176('0x7'));var config=require('../../config/environment');var attributes=require(_0x1176('0x8'));module[_0x1176('0x9')]=function(_0x3eb988,_0x477051){return _0x3eb988[_0x1176('0xa')](_0x1176('0xb'),attributes,{'tableName':_0x1176('0xc'),'paranoid':![],'indexes':[{'name':_0x1176('0xd'),'fields':['body'],'type':_0x1176('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d09bb,_0x11e83b,_0x44f68f){var _0x1ad118=_0x3eb988[_0x1176('0xf')];var _0x34f5b6=_0x3d09bb[_0x1176('0x10')]({'plain':!![]});if(_0x34f5b6[_0x1176('0x11')]['toLowerCase']()==='in'||_0x34f5b6[_0x1176('0x11')][_0x1176('0x12')]()===_0x1176('0x13')&&!_0x34f5b6[_0x1176('0x14')]&&!_[_0x1176('0x15')](_0x34f5b6[_0x1176('0x16')])){_0x1ad118[_0x1176('0x17')][_0x1176('0x18')]({'where':{'id':_0x34f5b6[_0x1176('0x19')]}})[_0x1176('0x1a')](function(_0x42bccc){if(_0x42bccc){_0x42bccc[_0x1176('0x1b')]({'lastMsgAt':_0x34f5b6[_0x1176('0x1c')],'lastMsgDirection':_0x34f5b6['direction'][_0x1176('0x12')]()});}})[_0x1176('0x1d')](function(_0x2353e5){console[_0x1176('0x1e')](_0x2353e5);});}_0x44f68f();}},'charset':_0x1176('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6e18=['FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne'];(function(_0x4a6aeb,_0xb9e51c){var _0x389485=function(_0x285849){while(--_0x285849){_0x4a6aeb['push'](_0x4a6aeb['shift']());}};_0x389485(++_0xb9e51c);}(_0x6e18,0x11d));var _0x86e1=function(_0x50e9d7,_0x12b367){_0x50e9d7=_0x50e9d7-0x0;var _0xfe6ecc=_0x6e18[_0x50e9d7];return _0xfe6ecc;};'use strict';var _=require(_0x86e1('0x0'));var util=require('util');var logger=require(_0x86e1('0x1'))(_0x86e1('0x2'));var moment=require(_0x86e1('0x3'));var BPromise=require(_0x86e1('0x4'));var rp=require(_0x86e1('0x5'));var fs=require('fs');var path=require(_0x86e1('0x6'));var rimraf=require(_0x86e1('0x7'));var config=require(_0x86e1('0x8'));var attributes=require(_0x86e1('0x9'));module[_0x86e1('0xa')]=function(_0x2e3323,_0x293460){return _0x2e3323[_0x86e1('0xb')](_0x86e1('0xc'),attributes,{'tableName':_0x86e1('0xd'),'paranoid':![],'indexes':[{'name':_0x86e1('0xe'),'fields':[_0x86e1('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49b608,_0x290bb3,_0x534fe8){var _0x3565ff=_0x2e3323[_0x86e1('0x10')];var _0x2e4411=_0x49b608[_0x86e1('0x11')]({'plain':!![]});if(_0x2e4411[_0x86e1('0x12')]['toLowerCase']()==='in'||_0x2e4411['direction'][_0x86e1('0x13')]()===_0x86e1('0x14')&&!_0x2e4411[_0x86e1('0x15')]&&!_[_0x86e1('0x16')](_0x2e4411[_0x86e1('0x17')])){_0x3565ff['FaxInteraction'][_0x86e1('0x18')]({'where':{'id':_0x2e4411[_0x86e1('0x19')]}})[_0x86e1('0x1a')](function(_0x454988){if(_0x454988){_0x454988['update']({'lastMsgAt':_0x2e4411[_0x86e1('0x1b')],'lastMsgDirection':_0x2e4411[_0x86e1('0x12')][_0x86e1('0x13')]()});}})[_0x86e1('0x1c')](function(_0x3213ed){console[_0x86e1('0x1d')](_0x3213ed);});}_0x534fe8();}},'charset':'utf8mb4','collate':_0x86e1('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 1d33667..7524997 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 _0x207c=['result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0x35f7d6,_0x367cf0){var _0x53604e=function(_0x1b5dc6){while(--_0x1b5dc6){_0x35f7d6['push'](_0x35f7d6['shift']());}};_0x53604e(++_0x367cf0);}(_0x207c,0x1e8));var _0xc207=function(_0x21eacf,_0x1d1f5b){_0x21eacf=_0x21eacf-0x0;var _0xbae3e=_0x207c[_0x21eacf];return _0xbae3e;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./faxMessage.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('FaxMessage,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')](_0x461f6a[_0xc207('0x1b')],{'raw':_0x461f6a[_0xc207('0x1c')]?_0x461f6a[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x163b36){logger['info'](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x163b36));_0x2caec5(_0x163b36);})[_0xc207('0x17')](function(_0xd209ac){logger[_0xc207('0x12')](_0xc207('0x18'),_0xd209ac[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770[_0xc207('0x12')](0x1f4,_0xd209ac[_0xc207('0x15')]));});});};exports[_0xc207('0x1e')]=function(_0x3f738e){var _0x138970=this;return new Promise(function(_0x1445d3,_0x56a066){return db[_0xc207('0x19')]['update'](_0x3f738e['body'],{'raw':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')]['where']||null:null,'attributes':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1f')]||null:null,'limit':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x20')]||null:null})[_0xc207('0x21')](function(_0x27bc72){logger[_0xc207('0xe')](_0xc207('0x1e'),_0x3f738e);logger[_0xc207('0x10')](_0xc207('0x1e'),_0x3f738e,JSON[_0xc207('0x11')](_0x27bc72));_0x1445d3(_0x27bc72);})['catch'](function(_0x1cc799){logger[_0xc207('0x12')](_0xc207('0x1e'),_0x1cc799[_0xc207('0x15')],_0x3f738e);_0x56a066(_0x138970[_0xc207('0x12')](0x1f4,_0x1cc799[_0xc207('0x15')]));});});}; \ No newline at end of file +var _0x4bc3=['CreateFaxMessage','FaxMessage','create','body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4bc3,0x16e));var _0x34bc=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4bc3[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});config[_0x34bc('0xb')]=_['defaults'](config['redis'],{'host':_0x34bc('0xc'),'port':0x18eb});var socket=require(_0x34bc('0xd'))(new Redis(config[_0x34bc('0xb')]));require(_0x34bc('0xe'))[_0x34bc('0xf')](socket);function respondWithRpcPromise(_0x41b2ff,_0x5de8b5,_0x5a478d){return new BPromise(function(_0x2b8112,_0x33025c){return client[_0x34bc('0x10')](_0x41b2ff,_0x5a478d)['then'](function(_0x41960e){logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));logger[_0x34bc('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5de8b5,_0x34bc('0x12'),JSON['stringify'](_0x41960e));if(_0x41960e[_0x34bc('0x14')]){if(_0x41960e[_0x34bc('0x14')][_0x34bc('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x41960e[_0x34bc('0x14')]['message']);return _0x33025c(_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);}logger[_0x34bc('0x14')](_0x34bc('0x11'),_0x5de8b5,_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);return _0x2b8112(_0x41960e['error']['message']);}else{logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));_0x2b8112(_0x41960e[_0x34bc('0x17')][_0x34bc('0x16')]);}})['catch'](function(_0x46aa24){logger[_0x34bc('0x14')]('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x46aa24);_0x33025c(_0x46aa24);});});}exports[_0x34bc('0x18')]=function(_0x9e9f14){var _0x4d2d5e=this;return new Promise(function(_0x14cec8,_0x26cdec){return db[_0x34bc('0x19')][_0x34bc('0x1a')](_0x9e9f14[_0x34bc('0x1b')],{'raw':_0x9e9f14[_0x34bc('0x1c')]?_0x9e9f14['options'][_0x34bc('0x1d')]===undefined?!![]:![]:!![]})[_0x34bc('0x1e')](function(_0x38882c){logger['info']('CreateFaxMessage',_0x9e9f14);logger[_0x34bc('0x13')](_0x34bc('0x18'),_0x9e9f14,JSON[_0x34bc('0x1f')](_0x38882c));_0x14cec8(_0x38882c);})[_0x34bc('0x20')](function(_0x13094a){logger[_0x34bc('0x14')](_0x34bc('0x18'),_0x13094a[_0x34bc('0x16')],_0x9e9f14);_0x26cdec(_0x4d2d5e[_0x34bc('0x14')](0x1f4,_0x13094a[_0x34bc('0x16')]));});});};exports[_0x34bc('0x21')]=function(_0x1edcb0){var _0x4fd589=this;return new Promise(function(_0x43e527,_0x48ec13){return db['FaxMessage'][_0x34bc('0x22')](_0x1edcb0['body'],{'raw':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edcb0['options']?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x23')]||null:null,'attributes':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x24')]||null:null,'limit':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0['options'][_0x34bc('0x25')]||null:null})[_0x34bc('0x1e')](function(_0x22aacc){logger[_0x34bc('0x26')](_0x34bc('0x21'),_0x1edcb0);logger[_0x34bc('0x13')]('UpdateFaxMessage',_0x1edcb0,JSON[_0x34bc('0x1f')](_0x22aacc));_0x43e527(_0x22aacc);})['catch'](function(_0x530748){logger[_0x34bc('0x14')]('UpdateFaxMessage',_0x530748[_0x34bc('0x16')],_0x1edcb0);_0x48ec13(_0x4fd589[_0x34bc('0x14')](0x1f4,_0x530748[_0x34bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 4d2e7ef..85a8bfd 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 _0x4c69=['faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x4c69,0x169));var _0x94c6=function(_0x933ee8,_0x1ca984){_0x933ee8=_0x933ee8-0x0;var _0x929fd0=_0x4c69[_0x933ee8];return _0x929fd0;};'use strict';var FaxMessageEvents=require(_0x94c6('0x0'));var events=[_0x94c6('0x1'),_0x94c6('0x2'),_0x94c6('0x3')];function createListener(_0xac3c66,_0x3ab0ff){return function(_0x43fa80){_0x3ab0ff[_0x94c6('0x4')](_0xac3c66,_0x43fa80);};}function removeListener(_0x4a95c6,_0x5aa01c){return function(){FaxMessageEvents[_0x94c6('0x5')](_0x4a95c6,_0x5aa01c);};}exports[_0x94c6('0x6')]=function(_0x5727cb){for(var _0x5c3f3b=0x0,_0x4b7a30=events[_0x94c6('0x7')];_0x5c3f3b<_0x4b7a30;_0x5c3f3b++){var _0x1e5889=events[_0x5c3f3b];var _0x2eb340=createListener(_0x94c6('0x8')+_0x1e5889,_0x5727cb);FaxMessageEvents['on'](_0x1e5889,_0x2eb340);}}; \ No newline at end of file +var _0x15b6=['removeListener','register','length','./faxMessage.events','remove','update','emit'];(function(_0x31db79,_0x3f5037){var _0x2ff81e=function(_0x3580e3){while(--_0x3580e3){_0x31db79['push'](_0x31db79['shift']());}};_0x2ff81e(++_0x3f5037);}(_0x15b6,0x8f));var _0x615b=function(_0x5745e3,_0x2b3a14){_0x5745e3=_0x5745e3-0x0;var _0x65b84f=_0x15b6[_0x5745e3];return _0x65b84f;};'use strict';var FaxMessageEvents=require(_0x615b('0x0'));var events=['save',_0x615b('0x1'),_0x615b('0x2')];function createListener(_0x47ba5a,_0x4091db){return function(_0x594d7b){_0x4091db[_0x615b('0x3')](_0x47ba5a,_0x594d7b);};}function removeListener(_0x2ede9a,_0x24489d){return function(){FaxMessageEvents[_0x615b('0x4')](_0x2ede9a,_0x24489d);};}exports[_0x615b('0x5')]=function(_0x32f52a){for(var _0x12d8e2=0x0,_0x40a1ed=events[_0x615b('0x6')];_0x12d8e2<_0x40a1ed;_0x12d8e2++){var _0x10e470=events[_0x12d8e2];var _0x2238d9=createListener('faxMessage:'+_0x10e470,_0x32f52a);FaxMessageEvents['on'](_0x10e470,_0x2238d9);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 1452979..06ebad9 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 _0x39cb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['describe']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),interaction[_0xb39c('0xf')](_0xb39c('0x10'),_0xb39c('0x11')),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x14')]);router[_0xb39c('0x13')](_0xb39c('0x15'),auth['isAuthenticated'](),controller[_0xb39c('0x16')]);router[_0xb39c('0x13')](_0xb39c('0x17'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x18')]);router[_0xb39c('0x19')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x1a')]);module[_0xb39c('0x1b')]=router; \ No newline at end of file +var _0xae60=['/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','/:id/accept'];(function(_0x54a081,_0x1fda89){var _0x58a652=function(_0x5ad709){while(--_0x5ad709){_0x54a081['push'](_0x54a081['shift']());}};_0x58a652(++_0x1fda89);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xae60[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./faxMessage.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/:id',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x10')]('/',auth[_0x0ae6('0x9')](),interaction[_0x0ae6('0x11')](_0x0ae6('0x12'),_0x0ae6('0x13')),controller[_0x0ae6('0x14')]);router[_0x0ae6('0x15')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x17')]);router[_0x0ae6('0x15')](_0x0ae6('0x18'),auth[_0x0ae6('0x9')](),controller['accept']);router[_0x0ae6('0x15')](_0x0ae6('0x19'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1a')]);router[_0x0ae6('0x1b')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1c')]);module[_0x0ae6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 81addf5..fdf6111 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 _0x5522=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x485f40,_0x1e8e64){var _0x925530=function(_0x401b7b){while(--_0x401b7b){_0x485f40['push'](_0x485f40['shift']());}};_0x925530(++_0x1e8e64);}(_0x5522,0x156));var _0x2552=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5522[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x2552('0x0'));module[_0x2552('0x1')]={'name':{'type':Sequelize[_0x2552('0x2')],'unique':_0x2552('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2552('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2552('0x5')](_0x2552('0x6'),'beepall',_0x2552('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2552('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5de=['ENUM','roundrobin','STRING','INTEGER'];(function(_0x183c00,_0x5327b8){var _0x4a8361=function(_0x126739){while(--_0x126739){_0x183c00['push'](_0x183c00['shift']());}};_0x4a8361(++_0x5327b8);}(_0xe5de,0x1aa));var _0xee5d=function(_0xa9bfa6,_0x31423b){_0xa9bfa6=_0xa9bfa6-0x0;var _0x5a794a=_0xe5de[_0xa9bfa6];return _0x5a794a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee5d('0x0')]},'timeout':{'type':Sequelize[_0xee5d('0x1')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee5d('0x2')]('rrmemory','beepall',_0xee5d('0x3')),'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 0ab8ea6..f328dac 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 _0x2b64=['filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','fields','length','include','user','FaxQueues','UserProfileSection','find','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','tq.TeamId','from','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c7514,_0x2a5d5a){var _0x5f079e=function(_0x4b7d8b){while(--_0x4b7d8b){_0x1c7514['push'](_0x1c7514['shift']());}};_0x5f079e(++_0x2a5d5a);}(_0x2b64,0x1ec));var _0x42b6=function(_0xbbb987,_0x68b1f5){_0xbbb987=_0xbbb987-0x0;var _0x51e324=_0x2b64[_0xbbb987];return _0x51e324;};'use strict';var emlformat=require(_0x42b6('0x0'));var rimraf=require(_0x42b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42b6('0x2'));var rp=require(_0x42b6('0x3'));var moment=require('moment');var BPromise=require(_0x42b6('0x4'));var Mustache=require(_0x42b6('0x5'));var util=require(_0x42b6('0x6'));var path=require(_0x42b6('0x7'));var sox=require('sox');var csv=require(_0x42b6('0x8'));var ejs=require(_0x42b6('0x9'));var fs=require('fs');var fs_extra=require(_0x42b6('0xa'));var _=require(_0x42b6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x42b6('0xc'));var deskjs=require(_0x42b6('0xd'));var toCsv=require(_0x42b6('0x8'));var querystring=require(_0x42b6('0xe'));var Papa=require('papaparse');var Redis=require(_0x42b6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42b6('0x10'));var logger=require(_0x42b6('0x11'))(_0x42b6('0x12'));var utils=require('../../config/utils');var config=require(_0x42b6('0x13'));var licenseUtil=require(_0x42b6('0x14'));var db=require(_0x42b6('0x15'))['db'];config[_0x42b6('0x16')]=_[_0x42b6('0x17')](config['redis'],{'host':_0x42b6('0x18'),'port':0x18eb});var socket=require(_0x42b6('0x19'))(new Redis(config[_0x42b6('0x16')]));require(_0x42b6('0x1a'))[_0x42b6('0x1b')](socket);function respondWithStatusCode(_0x2c26c5,_0x3947a2){_0x3947a2=_0x3947a2||0xcc;return function(_0x14a81e){if(_0x14a81e){return _0x2c26c5[_0x42b6('0x1c')](_0x3947a2);}return _0x2c26c5[_0x42b6('0x1d')](_0x3947a2)[_0x42b6('0x1e')]();};}function respondWithResult(_0x4f5ed4,_0x4da0cb){_0x4da0cb=_0x4da0cb||0xc8;return function(_0x3e3e6a){if(_0x3e3e6a){return _0x4f5ed4[_0x42b6('0x1d')](_0x4da0cb)['json'](_0x3e3e6a);}};}function respondWithFilteredResult(_0x254dce,_0x622970){return function(_0x319e0f){if(_0x319e0f){var _0x27e932=typeof _0x622970['offset']==='undefined'&&typeof _0x622970[_0x42b6('0x1f')]===_0x42b6('0x20');var _0x3d1cca=_0x319e0f[_0x42b6('0x21')];var _0x1d7790=_0x27e932?0x0:_0x622970['offset'];var _0x410579=_0x27e932?_0x319e0f[_0x42b6('0x21')]:_0x622970[_0x42b6('0x22')]+_0x622970['limit'];var _0x19a9f4;if(_0x410579>=_0x3d1cca){_0x410579=_0x3d1cca;_0x19a9f4=0xc8;}else{_0x19a9f4=0xce;}_0x254dce[_0x42b6('0x1d')](_0x19a9f4);return _0x254dce[_0x42b6('0x23')](_0x42b6('0x24'),_0x1d7790+'-'+_0x410579+'/'+_0x3d1cca)[_0x42b6('0x25')](_0x319e0f);}return null;};}function patchUpdates(_0x4c62d5){return function(_0xf5c0a7){try{jsonpatch[_0x42b6('0x26')](_0xf5c0a7,_0x4c62d5,!![]);}catch(_0x494d8e){return BPromise[_0x42b6('0x27')](_0x494d8e);}return _0xf5c0a7[_0x42b6('0x28')]();};}function saveUpdates(_0x2e2e92,_0x128972){return function(_0x4409e5){if(_0x4409e5){return _0x4409e5[_0x42b6('0x29')](_0x2e2e92)['then'](function(_0x182645){return _0x182645;});}return null;};}function removeEntity(_0x437e1d,_0x3efb30){return function(_0x5ed642){if(_0x5ed642){return _0x5ed642['destroy']()[_0x42b6('0x2a')](function(){var _0x112bde=_0x5ed642[_0x42b6('0x2b')]({'plain':!![]});var _0x96cfc5='FaxQueues';return db[_0x42b6('0x2c')][_0x42b6('0x2d')]({'where':{'type':_0x96cfc5,'resourceId':_0x112bde['id']}})[_0x42b6('0x2a')](function(){return _0x5ed642;});})[_0x42b6('0x2a')](function(){_0x437e1d[_0x42b6('0x1d')](0xcc)[_0x42b6('0x1e')]();});}};}function handleEntityNotFound(_0x457a4e,_0x19d7a6){return function(_0x291c87){if(!_0x291c87){_0x457a4e[_0x42b6('0x1c')](0x194);}return _0x291c87;};}function handleError(_0x3df766,_0x2461cd){_0x2461cd=_0x2461cd||0x1f4;return function(_0x33e1cc){logger['error'](_0x33e1cc[_0x42b6('0x2e')]);if(_0x33e1cc['name']){delete _0x33e1cc[_0x42b6('0x2f')];}_0x3df766[_0x42b6('0x1d')](_0x2461cd)[_0x42b6('0x30')](_0x33e1cc);};}exports[_0x42b6('0x31')]=function(_0x171d97,_0x3f5538){var _0x49f417={},_0x5c0b06={},_0x29a83b={'count':0x0,'rows':[]};var _0x45ac7b=_[_0x42b6('0x32')](db[_0x42b6('0x33')][_0x42b6('0x34')],function(_0x1cc4cb){return{'name':_0x1cc4cb[_0x42b6('0x35')],'type':_0x1cc4cb[_0x42b6('0x36')][_0x42b6('0x37')]};});_0x5c0b06['model']=_[_0x42b6('0x32')](_0x45ac7b,_0x42b6('0x2f'));_0x5c0b06[_0x42b6('0x38')]=_[_0x42b6('0x39')](_0x171d97[_0x42b6('0x38')]);_0x5c0b06[_0x42b6('0x3a')]=_[_0x42b6('0x3b')](_0x5c0b06[_0x42b6('0x3c')],_0x5c0b06[_0x42b6('0x38')]);_0x49f417['attributes']=_['intersection'](_0x5c0b06[_0x42b6('0x3c')],qs['fields'](_0x171d97[_0x42b6('0x38')]['fields']));_0x49f417[_0x42b6('0x3d')]=_0x49f417[_0x42b6('0x3d')]['length']?_0x49f417[_0x42b6('0x3d')]:_0x5c0b06['model'];if(!_0x171d97[_0x42b6('0x38')][_0x42b6('0x3e')](_0x42b6('0x3f'))){_0x49f417[_0x42b6('0x1f')]=qs[_0x42b6('0x1f')](_0x171d97[_0x42b6('0x38')][_0x42b6('0x1f')]);_0x49f417['offset']=qs[_0x42b6('0x22')](_0x171d97[_0x42b6('0x38')][_0x42b6('0x22')]);}_0x49f417[_0x42b6('0x40')]=qs[_0x42b6('0x41')](_0x171d97[_0x42b6('0x38')][_0x42b6('0x41')]);_0x49f417[_0x42b6('0x42')]=qs[_0x42b6('0x3a')](_[_0x42b6('0x43')](_0x171d97[_0x42b6('0x38')],_0x5c0b06[_0x42b6('0x3a')]),_0x45ac7b);if(_0x171d97['query'][_0x42b6('0x44')]){_0x49f417[_0x42b6('0x42')]=_[_0x42b6('0x45')](_0x49f417[_0x42b6('0x42')],{'$or':_[_0x42b6('0x32')](_0x45ac7b,function(_0xeffd83){if(_0xeffd83[_0x42b6('0x36')]!==_0x42b6('0x46')){var _0x12a3c4={};_0x12a3c4[_0xeffd83[_0x42b6('0x2f')]]={'$like':'%'+_0x171d97[_0x42b6('0x38')][_0x42b6('0x44')]+'%'};return _0x12a3c4;}})});}_0x49f417=_[_0x42b6('0x45')]({},_0x49f417,_0x171d97[_0x42b6('0x47')]);var _0xfe84bf={'where':_0x49f417[_0x42b6('0x42')]};return db[_0x42b6('0x33')][_0x42b6('0x21')](_0xfe84bf)[_0x42b6('0x2a')](function(_0x592885){_0x29a83b[_0x42b6('0x21')]=_0x592885;if(_0x171d97['query']['includeAll']){_0x49f417['include']=[{'all':!![]}];}return db['FaxQueue'][_0x42b6('0x48')](_0x49f417);})[_0x42b6('0x2a')](function(_0x38c1c4){_0x29a83b[_0x42b6('0x49')]=_0x38c1c4;return _0x29a83b;})['then'](respondWithFilteredResult(_0x3f5538,_0x49f417))[_0x42b6('0x4a')](handleError(_0x3f5538,null));};exports[_0x42b6('0x4b')]=function(_0x34394a,_0x2e6cf4){var _0x3d2f47={'raw':!![],'where':{'id':_0x34394a[_0x42b6('0x4c')]['id']}},_0x427228={};_0x427228[_0x42b6('0x3c')]=_['keys'](db[_0x42b6('0x33')][_0x42b6('0x34')]);_0x427228[_0x42b6('0x38')]=_[_0x42b6('0x39')](_0x34394a['query']);_0x427228[_0x42b6('0x3a')]=_[_0x42b6('0x3b')](_0x427228[_0x42b6('0x3c')],_0x427228[_0x42b6('0x38')]);_0x3d2f47['attributes']=_[_0x42b6('0x3b')](_0x427228['model'],qs['fields'](_0x34394a[_0x42b6('0x38')][_0x42b6('0x4d')]));_0x3d2f47['attributes']=_0x3d2f47['attributes'][_0x42b6('0x4e')]?_0x3d2f47[_0x42b6('0x3d')]:_0x427228['model'];if(_0x34394a['query']['includeAll']){_0x3d2f47[_0x42b6('0x4f')]=[{'all':!![]}];}_0x3d2f47=_[_0x42b6('0x45')]({},_0x3d2f47,_0x34394a[_0x42b6('0x47')]);return db[_0x42b6('0x33')]['find'](_0x3d2f47)['then'](handleEntityNotFound(_0x2e6cf4,null))['then'](respondWithResult(_0x2e6cf4,null))[_0x42b6('0x4a')](handleError(_0x2e6cf4,null));};exports['create']=function(_0x24507e,_0x399b5e){return db['FaxQueue']['create'](_0x24507e['body'],{})['then'](function(_0x1ad17a){var _0x49346f=_0x24507e[_0x42b6('0x50')][_0x42b6('0x2b')]({'plain':!![]});if(!_0x49346f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49346f['role']===_0x42b6('0x50')){var _0x473dbc=_0x1ad17a[_0x42b6('0x2b')]({'plain':!![]});var _0x35acba=_0x42b6('0x51');return db[_0x42b6('0x52')][_0x42b6('0x53')]({'where':{'name':_0x35acba,'userProfileId':_0x49346f[_0x42b6('0x54')]},'raw':!![]})['then'](function(_0x5ef6ff){if(_0x5ef6ff&&_0x5ef6ff['autoAssociation']===0x0){return db[_0x42b6('0x2c')][_0x42b6('0x55')]({'name':_0x473dbc[_0x42b6('0x2f')],'resourceId':_0x473dbc['id'],'type':_0x5ef6ff[_0x42b6('0x2f')],'sectionId':_0x5ef6ff['id']},{})[_0x42b6('0x2a')](function(){return _0x1ad17a;});}else{return _0x1ad17a;}})[_0x42b6('0x4a')](function(_0x1d6771){logger[_0x42b6('0x56')](_0x42b6('0x57'),_0x1d6771);throw _0x1d6771;});}return _0x1ad17a;})[_0x42b6('0x2a')](respondWithResult(_0x399b5e,0xc9))[_0x42b6('0x4a')](handleError(_0x399b5e,null));};exports[_0x42b6('0x29')]=function(_0x1a0bdd,_0x53e414){if(_0x1a0bdd['body']['id']){delete _0x1a0bdd[_0x42b6('0x58')]['id'];}return db[_0x42b6('0x33')][_0x42b6('0x53')]({'where':{'id':_0x1a0bdd[_0x42b6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x53e414,null))['then'](saveUpdates(_0x1a0bdd[_0x42b6('0x58')],null))[_0x42b6('0x2a')](respondWithResult(_0x53e414,null))[_0x42b6('0x4a')](handleError(_0x53e414,null));};exports[_0x42b6('0x2d')]=function(_0x1e2639,_0x160520){return db['FaxQueue'][_0x42b6('0x53')]({'where':{'id':_0x1e2639['params']['id']}})['then'](handleEntityNotFound(_0x160520,null))[_0x42b6('0x2a')](removeEntity(_0x160520,null))['catch'](handleError(_0x160520,null));};exports['describe']=function(_0x258158,_0x5ac1b7){return db[_0x42b6('0x33')]['describe']()['then'](respondWithResult(_0x5ac1b7,null))[_0x42b6('0x4a')](handleError(_0x5ac1b7,null));};exports['getMembers']=function(_0x38fba3,_0x5b2c68,_0x5d57cc){var _0x6de25={'raw':!![],'where':{}},_0x55727d={},_0x52e250;return db[_0x42b6('0x33')][_0x42b6('0x59')]({'where':{'id':_0x38fba3[_0x42b6('0x4c')]['id']}})[_0x42b6('0x2a')](handleEntityNotFound(_0x5b2c68,null))[_0x42b6('0x2a')](function(_0x2c1f19){if(_0x2c1f19){_0x52e250=_0x2c1f19[_0x42b6('0x2b')]({'plain':!![]});_0x55727d[_0x42b6('0x3c')]=_[_0x42b6('0x39')](db[_0x42b6('0x5a')][_0x42b6('0x34')]);_0x55727d['query']=_[_0x42b6('0x39')](_0x38fba3[_0x42b6('0x38')]);_0x55727d[_0x42b6('0x3a')]=_[_0x42b6('0x3b')](_0x55727d[_0x42b6('0x3c')],_0x55727d[_0x42b6('0x38')]);_0x6de25[_0x42b6('0x3d')]=_[_0x42b6('0x3b')](_0x55727d[_0x42b6('0x3c')],qs[_0x42b6('0x4d')](_0x38fba3['query']['fields']));_0x6de25[_0x42b6('0x3d')]=_0x6de25[_0x42b6('0x3d')]['length']?_0x6de25[_0x42b6('0x3d')]:_0x55727d[_0x42b6('0x3c')];if(!_0x38fba3[_0x42b6('0x38')][_0x42b6('0x3e')](_0x42b6('0x3f'))){_0x6de25[_0x42b6('0x1f')]=qs[_0x42b6('0x1f')](_0x38fba3[_0x42b6('0x38')]['limit']);_0x6de25[_0x42b6('0x22')]=qs[_0x42b6('0x22')](_0x38fba3['query'][_0x42b6('0x22')]);}_0x6de25['order']=qs[_0x42b6('0x41')](_0x38fba3['query']['sort']);_0x6de25['where']=qs['filters'](_['pick'](_0x38fba3[_0x42b6('0x38')],_0x55727d['filters']));_0x6de25[_0x42b6('0x42')][_0x42b6('0x5b')]=_0x2c1f19['id'];if(_0x38fba3[_0x42b6('0x38')]['filter']){_0x6de25['where']=_['merge'](_0x6de25[_0x42b6('0x42')],{'$or':_['map'](_0x6de25[_0x42b6('0x3d')],function(_0x2c7640){var _0x4b5d48={};_0x4b5d48[_0x2c7640]={'$like':'%'+_0x38fba3[_0x42b6('0x38')][_0x42b6('0x44')]+'%'};return _0x4b5d48;})});}_0x6de25=_['merge']({},_0x6de25,_0x38fba3[_0x42b6('0x47')]);return db[_0x42b6('0x5a')][_0x42b6('0x48')](_0x6de25);}})[_0x42b6('0x2a')](function(_0x3cba67){if(_0x3cba67){return db[_0x42b6('0x5c')][_0x42b6('0x5d')]({'where':{'id':_[_0x42b6('0x32')](_0x3cba67,'UserId'),'role':_0x42b6('0x5e')},'attributes':['id','name',_0x42b6('0x5f'),_0x42b6('0x60'),'createdAt']});}})[_0x42b6('0x2a')](function(_0x2a9f69){if(_0x2a9f69){return{'count':_0x2a9f69[_0x42b6('0x21')],'rows':_['map'](_0x2a9f69['rows'],function(_0x5314fc){return{'membername':_0x5314fc[_0x42b6('0x2f')],'UserId':_0x5314fc['id'],'queue_name':_0x52e250[_0x42b6('0x2f')],'FaxQueueId':_0x52e250['id'],'interface':util['format'](_0x42b6('0x61'),_0x42b6('0x62'),_0x5314fc[_0x42b6('0x2f')]),'penalty':0x0,'paused':_0x5314fc[_0x42b6('0x5f')],'createdAt':_0x5314fc[_0x42b6('0x63')],'updatedAt':_0x5314fc[_0x42b6('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x42b6('0x2a')](respondWithFilteredResult(_0x5b2c68,_0x6de25))[_0x42b6('0x4a')](handleError(_0x5b2c68,null));};exports[_0x42b6('0x64')]=function(_0x2fda62,_0x1ad616,_0x2e8e6f){var _0x56891e={};var _0x1d0c30={};var _0x183680;var _0x2642d7;return db[_0x42b6('0x33')][_0x42b6('0x59')]({'where':{'id':_0x2fda62[_0x42b6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ad616,null))[_0x42b6('0x2a')](function(_0x4eea6f){if(_0x4eea6f){_0x183680=_0x4eea6f;_0x1d0c30[_0x42b6('0x3c')]=_[_0x42b6('0x39')](db[_0x42b6('0x65')][_0x42b6('0x34')]);_0x1d0c30[_0x42b6('0x38')]=_['keys'](_0x2fda62['query']);_0x1d0c30['filters']=_[_0x42b6('0x3b')](_0x1d0c30['model'],_0x1d0c30[_0x42b6('0x38')]);_0x56891e[_0x42b6('0x3d')]=_[_0x42b6('0x3b')](_0x1d0c30[_0x42b6('0x3c')],qs[_0x42b6('0x4d')](_0x2fda62[_0x42b6('0x38')][_0x42b6('0x4d')]));_0x56891e[_0x42b6('0x3d')]=_0x56891e[_0x42b6('0x3d')]['length']?_0x56891e[_0x42b6('0x3d')]:_0x1d0c30[_0x42b6('0x3c')];_0x56891e['order']=qs[_0x42b6('0x41')](_0x2fda62['query']['sort']);_0x56891e['where']=qs[_0x42b6('0x3a')](_[_0x42b6('0x43')](_0x2fda62[_0x42b6('0x38')],_0x1d0c30[_0x42b6('0x3a')]));if(_0x2fda62[_0x42b6('0x38')][_0x42b6('0x44')]){_0x56891e['where']=_[_0x42b6('0x45')](_0x56891e[_0x42b6('0x42')],{'$or':_[_0x42b6('0x32')](_0x56891e[_0x42b6('0x3d')],function(_0x241a3f){var _0x174f7b={};_0x174f7b[_0x241a3f]={'$like':'%'+_0x2fda62[_0x42b6('0x38')]['filter']+'%'};return _0x174f7b;})});}_0x56891e=_[_0x42b6('0x45')]({},_0x56891e,_0x2fda62[_0x42b6('0x47')]);return _0x183680[_0x42b6('0x64')](_0x56891e);}})['then'](function(_0x2f6630){if(_0x2f6630){_0x2642d7=_0x2f6630['length'];if(!_0x2fda62[_0x42b6('0x38')][_0x42b6('0x3e')]('nolimit')){_0x56891e['limit']=qs[_0x42b6('0x1f')](_0x2fda62[_0x42b6('0x38')][_0x42b6('0x1f')]);_0x56891e['offset']=qs[_0x42b6('0x22')](_0x2fda62[_0x42b6('0x38')][_0x42b6('0x22')]);}return _0x183680[_0x42b6('0x64')](_0x56891e);}})[_0x42b6('0x2a')](function(_0x1bf376){if(_0x1bf376){return _0x1bf376?{'count':_0x2642d7,'rows':_0x1bf376}:null;}})[_0x42b6('0x2a')](respondWithResult(_0x1ad616,null))['catch'](handleError(_0x1ad616,null));};exports[_0x42b6('0x66')]=function(_0x5920a5,_0x4c6291,_0xb62773){var _0xb06b1a=_0x5920a5[_0x42b6('0x58')][_0x42b6('0x67')];return db['Team'][_0x42b6('0x48')]({'where':{'id':_0xb06b1a},'attributes':['id'],'include':[{'model':db[_0x42b6('0x5c')],'as':'Agents','attributes':['id','name',_0x42b6('0x68'),_0x42b6('0x69'),_0x42b6('0x6a')],'raw':!![]}]})[_0x42b6('0x2a')](function(_0x33bfd0){if(_0x33bfd0){var _0x19e720=_[_0x42b6('0x6b')](_0x33bfd0,function(_0x572b7a){var _0x55dc64=_0x572b7a[_0x42b6('0x2b')]({'plain':!![]});return _0x55dc64[_0x42b6('0x6c')];});return db[_0x42b6('0x33')][_0x42b6('0x53')]({'where':{'id':_0x5920a5[_0x42b6('0x4c')]['id']}})[_0x42b6('0x2a')](function(_0x4047d6){return db[_0x42b6('0x6d')][_0x42b6('0x6e')](function(_0x5c5544){return _0x4047d6[_0x42b6('0x66')](_0xb06b1a,{'transaction':_0x5c5544})[_0x42b6('0x2a')](function(){return BPromise[_0x42b6('0x6f')](_0x19e720,function(_0x2e38ee){return db['UserFaxQueue'][_0x42b6('0x70')]({'where':{'UserId':_0x2e38ee['id'],'FaxQueueId':_0x5920a5['params']['id']},'transaction':_0x5c5544});});})['then'](function(){_0x19e720[_0x42b6('0x71')](function(_0x127354){socket[_0x42b6('0x72')](_0x42b6('0x73'),{'UserId':_0x127354['id'],'FaxQueueId':_0x4047d6['id']});});});});});}})[_0x42b6('0x2a')](respondWithStatusCode(_0x4c6291,null))[_0x42b6('0x4a')](handleError(_0x4c6291,null));};exports[_0x42b6('0x74')]=function(_0x494e6b,_0xab7688,_0x55ea7a){return db[_0x42b6('0x65')][_0x42b6('0x48')]({'where':{'id':_0x494e6b[_0x42b6('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x42b6('0x5c')],'as':_0x42b6('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xab7688,null))['then'](function(_0x214c8a){var _0x3a7fbd=_[_0x42b6('0x32')](_0x214c8a,'id');var _0x33d2c8=[];var _0x56b33d=[];var _0x4d7551=squel['select']();_0x4d7551['field'](_0x42b6('0x75'))[_0x42b6('0x76')](_0x42b6('0x77'),'tq')['join'](_0x42b6('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x42b6('0x42')](_0x42b6('0x79'),_0x494e6b[_0x42b6('0x4c')]['id']);for(var _0x1c19de=0x0;_0x1c19de<_0x214c8a[_0x42b6('0x4e')];_0x1c19de+=0x1){let _0x4e20a1=_0x214c8a[_0x1c19de];for(var _0x291f66=0x0;_0x291f66<_0x4e20a1['Agents']['length'];_0x291f66+=0x1){let _0x6c2850=_0x4e20a1[_0x42b6('0x6c')][_0x291f66];var _0x4e0b52=_0x4d7551['clone']();_0x4e0b52[_0x42b6('0x42')]('ut.UserId\x20=\x20?',_0x6c2850['id']);_0x56b33d[_0x42b6('0x7a')](db['sequelize'][_0x42b6('0x38')](_0x4e0b52[_0x42b6('0x7b')](),{'type':db[_0x42b6('0x6d')][_0x42b6('0x7c')]['SELECT']})[_0x42b6('0x2a')](function(_0x1defbf){if(_0x1defbf[_0x42b6('0x4e')]===0x1){return _0x6c2850['id'];}else{var _0x54c1f7=_[_0x42b6('0x7d')](_['map'](_0x1defbf,_0x42b6('0x7e')),function(_0x42ba2d){return _[_0x42b6('0x7f')](_0x3a7fbd,_0x42ba2d);});if(_0x54c1f7){return _0x6c2850['id'];}}}));}}return BPromise[_0x42b6('0x80')](_0x56b33d)[_0x42b6('0x2a')](function(_0x132835){_0x33d2c8=_(_0x33d2c8)[_0x42b6('0x81')](_0x132835)[_0x42b6('0x82')]()[_0x42b6('0x83')]();return db[_0x42b6('0x33')]['find']({'where':{'id':_0x494e6b['params']['id']}})[_0x42b6('0x2a')](function(_0x78d24f){return db[_0x42b6('0x6d')][_0x42b6('0x6e')](function(_0x443cfd){return _0x78d24f[_0x42b6('0x74')](_0x494e6b[_0x42b6('0x38')][_0x42b6('0x67')],{'transaction':_0x443cfd})['then'](function(){if(!_[_0x42b6('0x84')](_0x33d2c8)){return _0x78d24f[_0x42b6('0x85')](_0x33d2c8,{'transaction':_0x443cfd});}})[_0x42b6('0x2a')](function(){_0x33d2c8[_0x42b6('0x71')](function(_0x4ced14){socket['emit'](_0x42b6('0x86'),{'UserId':_0x4ced14,'FaxQueueId':_0x78d24f['id']});});});});});});})[_0x42b6('0x2a')](respondWithStatusCode(_0xab7688,null))['catch'](handleError(_0xab7688,null));};exports[_0x42b6('0x87')]=function(_0x49083c,_0x263fd2,_0x1c495c){return db[_0x42b6('0x33')][_0x42b6('0x53')]({'where':{'id':_0x49083c[_0x42b6('0x4c')]['id']}})[_0x42b6('0x2a')](handleEntityNotFound(_0x263fd2,null))['then'](function(_0x595eaa){if(_0x595eaa){return _0x595eaa[_0x42b6('0x87')](_0x49083c[_0x42b6('0x58')][_0x42b6('0x67')],_[_0x42b6('0x88')](_0x49083c[_0x42b6('0x58')],[_0x42b6('0x67'),'id'])||{})[_0x42b6('0x89')](function(_0x3a3358){for(var _0xd35a28=0x0;_0xd35a28<_0x49083c['body'][_0x42b6('0x67')][_0x42b6('0x4e')];_0xd35a28+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x49083c[_0x42b6('0x58')][_0x42b6('0x67')][_0xd35a28]),'FaxQueueId':Number(_0x49083c[_0x42b6('0x4c')]['id'])});}return _0x3a3358;});}})[_0x42b6('0x2a')](respondWithResult(_0x263fd2,null))[_0x42b6('0x4a')](handleError(_0x263fd2,null));};exports['removeAgents']=function(_0x1c45f3,_0x5d43da,_0x494955){return db['FaxQueue']['find']({'where':{'id':_0x1c45f3[_0x42b6('0x4c')]['id']}})[_0x42b6('0x2a')](handleEntityNotFound(_0x5d43da,null))[_0x42b6('0x2a')](function(_0x4325bc){if(_0x4325bc){return _0x4325bc[_0x42b6('0x85')](_0x1c45f3[_0x42b6('0x38')][_0x42b6('0x67')])[_0x42b6('0x2a')](function(){if(_[_0x42b6('0x8a')](_0x1c45f3[_0x42b6('0x38')][_0x42b6('0x67')])){for(var _0xd7da0=0x0;_0xd7da0<_0x1c45f3[_0x42b6('0x38')]['ids'][_0x42b6('0x4e')];_0xd7da0+=0x1){socket[_0x42b6('0x72')](_0x42b6('0x86'),{'UserId':Number(_0x1c45f3['query'][_0x42b6('0x67')][_0xd7da0]),'FaxQueueId':Number(_0x1c45f3['params']['id'])});}}else{socket[_0x42b6('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x1c45f3['query']['ids']),'FaxQueueId':Number(_0x1c45f3['params']['id'])});}});}})[_0x42b6('0x2a')](respondWithStatusCode(_0x5d43da,null))[_0x42b6('0x4a')](handleError(_0x5d43da,null));};exports[_0x42b6('0x8b')]=function(_0x1cbeac,_0x16c673,_0x288511){var _0x412bfb={};var _0x1371ce={};var _0x515361;var _0x24a8c1;return db[_0x42b6('0x33')][_0x42b6('0x59')]({'where':{'id':_0x1cbeac[_0x42b6('0x4c')]['id']}})[_0x42b6('0x2a')](handleEntityNotFound(_0x16c673,null))[_0x42b6('0x2a')](function(_0x215532){if(_0x215532){_0x515361=_0x215532;_0x1371ce[_0x42b6('0x3c')]=_[_0x42b6('0x39')](db[_0x42b6('0x5c')]['rawAttributes']);_0x1371ce[_0x42b6('0x38')]=_[_0x42b6('0x39')](_0x1cbeac['query']);_0x1371ce[_0x42b6('0x3a')]=_['intersection'](_0x1371ce[_0x42b6('0x3c')],_0x1371ce[_0x42b6('0x38')]);_0x412bfb[_0x42b6('0x3d')]=_['intersection'](_0x1371ce[_0x42b6('0x3c')],qs[_0x42b6('0x4d')](_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x4d')]));_0x412bfb['attributes']=_0x412bfb['attributes'][_0x42b6('0x4e')]?_0x412bfb[_0x42b6('0x3d')]:_0x1371ce[_0x42b6('0x3c')];_0x412bfb[_0x42b6('0x40')]=qs['sort'](_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x41')]);_0x412bfb['where']=qs['filters'](_[_0x42b6('0x43')](_0x1cbeac['query'],_0x1371ce[_0x42b6('0x3a')]));if(_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x44')]){_0x412bfb['where']=_[_0x42b6('0x45')](_0x412bfb[_0x42b6('0x42')],{'$or':_[_0x42b6('0x32')](_0x412bfb[_0x42b6('0x3d')],function(_0x34d4bf){var _0x51ef7b={};_0x51ef7b[_0x34d4bf]={'$like':'%'+_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x44')]+'%'};return _0x51ef7b;})});}_0x412bfb=_[_0x42b6('0x45')]({},_0x412bfb,_0x1cbeac['options']);return _0x515361[_0x42b6('0x8b')](_0x412bfb);}})[_0x42b6('0x2a')](function(_0x201a19){if(_0x201a19){_0x24a8c1=_0x201a19['length'];if(!_0x1cbeac['query'][_0x42b6('0x3e')](_0x42b6('0x3f'))){_0x412bfb[_0x42b6('0x1f')]=qs[_0x42b6('0x1f')](_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x1f')]);_0x412bfb['offset']=qs[_0x42b6('0x22')](_0x1cbeac[_0x42b6('0x38')][_0x42b6('0x22')]);}return _0x515361[_0x42b6('0x8b')](_0x412bfb);}})[_0x42b6('0x2a')](function(_0x48e16b){if(_0x48e16b){return _0x48e16b?{'count':_0x24a8c1,'rows':_0x48e16b}:null;}})[_0x42b6('0x2a')](respondWithResult(_0x16c673,null))[_0x42b6('0x4a')](handleError(_0x16c673,null));}; \ No newline at end of file +var _0x34ec=['map','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filters','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','order','sort','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','clone','push','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','spread','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','send','FaxQueue','fieldName','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ec,0x1ed));var _0xc34e=function(_0x51e108,_0x1dc4d8){_0x51e108=_0x51e108-0x0;var _0x383762=_0x34ec[_0x51e108];return _0x383762;};'use strict';var emlformat=require(_0xc34e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc34e('0x1'));var jsonpatch=require(_0xc34e('0x2'));var rp=require('request-promise');var moment=require(_0xc34e('0x3'));var BPromise=require(_0xc34e('0x4'));var Mustache=require('mustache');var util=require(_0xc34e('0x5'));var path=require(_0xc34e('0x6'));var sox=require(_0xc34e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc34e('0x8'));var squel=require(_0xc34e('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc34e('0xa'));var toCsv=require(_0xc34e('0xb'));var querystring=require(_0xc34e('0xc'));var Papa=require(_0xc34e('0xd'));var Redis=require(_0xc34e('0xe'));var authService=require(_0xc34e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc34e('0x10'));var hardwareService=require(_0xc34e('0x11'));var logger=require('../../config/logger')(_0xc34e('0x12'));var utils=require('../../config/utils');var config=require(_0xc34e('0x13'));var licenseUtil=require(_0xc34e('0x14'));var db=require(_0xc34e('0x15'))['db'];config[_0xc34e('0x16')]=_['defaults'](config[_0xc34e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc34e('0x17'))(new Redis(config['redis']));require(_0xc34e('0x18'))[_0xc34e('0x19')](socket);function respondWithStatusCode(_0xbc32da,_0x7c0a1d){_0x7c0a1d=_0x7c0a1d||0xcc;return function(_0x1ac481){if(_0x1ac481){return _0xbc32da[_0xc34e('0x1a')](_0x7c0a1d);}return _0xbc32da[_0xc34e('0x1b')](_0x7c0a1d)[_0xc34e('0x1c')]();};}function respondWithResult(_0x4181d6,_0x4fa61d){_0x4fa61d=_0x4fa61d||0xc8;return function(_0x15fea7){if(_0x15fea7){return _0x4181d6[_0xc34e('0x1b')](_0x4fa61d)[_0xc34e('0x1d')](_0x15fea7);}};}function respondWithFilteredResult(_0x23c801,_0x23b0a7){return function(_0x75dfad){if(_0x75dfad){var _0x14371e=typeof _0x23b0a7[_0xc34e('0x1e')]===_0xc34e('0x1f')&&typeof _0x23b0a7[_0xc34e('0x20')]==='undefined';var _0x45cd9f=_0x75dfad['count'];var _0x5ad37e=_0x14371e?0x0:_0x23b0a7['offset'];var _0x135651=_0x14371e?_0x75dfad['count']:_0x23b0a7[_0xc34e('0x1e')]+_0x23b0a7[_0xc34e('0x20')];var _0x2d8695;if(_0x135651>=_0x45cd9f){_0x135651=_0x45cd9f;_0x2d8695=0xc8;}else{_0x2d8695=0xce;}_0x23c801[_0xc34e('0x1b')](_0x2d8695);return _0x23c801[_0xc34e('0x21')]('Content-Range',_0x5ad37e+'-'+_0x135651+'/'+_0x45cd9f)[_0xc34e('0x1d')](_0x75dfad);}return null;};}function patchUpdates(_0x3f7bda){return function(_0x9a58ad){try{jsonpatch['apply'](_0x9a58ad,_0x3f7bda,!![]);}catch(_0x5b3e2a){return BPromise[_0xc34e('0x22')](_0x5b3e2a);}return _0x9a58ad[_0xc34e('0x23')]();};}function saveUpdates(_0xc5e1cb,_0x2c9210){return function(_0x4878c1){if(_0x4878c1){return _0x4878c1[_0xc34e('0x24')](_0xc5e1cb)[_0xc34e('0x25')](function(_0x240282){return _0x240282;});}return null;};}function removeEntity(_0x53b18d,_0x44cc0a){return function(_0x561367){if(_0x561367){return _0x561367[_0xc34e('0x26')]()[_0xc34e('0x25')](function(){var _0x489956=_0x561367[_0xc34e('0x27')]({'plain':!![]});var _0x494d60=_0xc34e('0x28');return db[_0xc34e('0x29')][_0xc34e('0x26')]({'where':{'type':_0x494d60,'resourceId':_0x489956['id']}})[_0xc34e('0x25')](function(){return _0x561367;});})[_0xc34e('0x25')](function(){_0x53b18d[_0xc34e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501099,_0x5084f1){return function(_0x1bfff3){if(!_0x1bfff3){_0x501099[_0xc34e('0x1a')](0x194);}return _0x1bfff3;};}function handleError(_0x1eb3db,_0x221e2f){_0x221e2f=_0x221e2f||0x1f4;return function(_0x276905){logger['error'](_0x276905['stack']);if(_0x276905['name']){delete _0x276905['name'];}_0x1eb3db['status'](_0x221e2f)[_0xc34e('0x2a')](_0x276905);};}exports['index']=function(_0x7f814c,_0x32539b){var _0x15cd56={},_0x444d88={},_0x211bcd={'count':0x0,'rows':[]};var _0x57e918=_['map'](db[_0xc34e('0x2b')]['rawAttributes'],function(_0xf66e36){return{'name':_0xf66e36[_0xc34e('0x2c')],'type':_0xf66e36['type'][_0xc34e('0x2d')]};});_0x444d88[_0xc34e('0x2e')]=_[_0xc34e('0x2f')](_0x57e918,_0xc34e('0x30'));_0x444d88[_0xc34e('0x31')]=_[_0xc34e('0x32')](_0x7f814c[_0xc34e('0x31')]);_0x444d88['filters']=_['intersection'](_0x444d88[_0xc34e('0x2e')],_0x444d88[_0xc34e('0x31')]);_0x15cd56[_0xc34e('0x33')]=_[_0xc34e('0x34')](_0x444d88[_0xc34e('0x2e')],qs[_0xc34e('0x35')](_0x7f814c[_0xc34e('0x31')]['fields']));_0x15cd56[_0xc34e('0x33')]=_0x15cd56['attributes'][_0xc34e('0x36')]?_0x15cd56[_0xc34e('0x33')]:_0x444d88[_0xc34e('0x2e')];if(!_0x7f814c[_0xc34e('0x31')][_0xc34e('0x37')](_0xc34e('0x38'))){_0x15cd56[_0xc34e('0x20')]=qs['limit'](_0x7f814c[_0xc34e('0x31')][_0xc34e('0x20')]);_0x15cd56['offset']=qs[_0xc34e('0x1e')](_0x7f814c[_0xc34e('0x31')][_0xc34e('0x1e')]);}_0x15cd56['order']=qs['sort'](_0x7f814c[_0xc34e('0x31')]['sort']);_0x15cd56[_0xc34e('0x39')]=qs['filters'](_[_0xc34e('0x3a')](_0x7f814c[_0xc34e('0x31')],_0x444d88[_0xc34e('0x3b')]),_0x57e918);if(_0x7f814c[_0xc34e('0x31')]['filter']){_0x15cd56[_0xc34e('0x39')]=_[_0xc34e('0x3c')](_0x15cd56[_0xc34e('0x39')],{'$or':_[_0xc34e('0x2f')](_0x57e918,function(_0xeba2f2){if(_0xeba2f2[_0xc34e('0x3d')]!==_0xc34e('0x3e')){var _0x1d1009={};_0x1d1009[_0xeba2f2['name']]={'$like':'%'+_0x7f814c[_0xc34e('0x31')][_0xc34e('0x3f')]+'%'};return _0x1d1009;}})});}_0x15cd56=_[_0xc34e('0x3c')]({},_0x15cd56,_0x7f814c[_0xc34e('0x40')]);var _0x1cebf8={'where':_0x15cd56[_0xc34e('0x39')]};return db['FaxQueue'][_0xc34e('0x41')](_0x1cebf8)[_0xc34e('0x25')](function(_0x4352fc){_0x211bcd[_0xc34e('0x41')]=_0x4352fc;if(_0x7f814c[_0xc34e('0x31')][_0xc34e('0x42')]){_0x15cd56[_0xc34e('0x43')]=[{'all':!![]}];}return db[_0xc34e('0x2b')][_0xc34e('0x44')](_0x15cd56);})[_0xc34e('0x25')](function(_0x2fb7df){_0x211bcd[_0xc34e('0x45')]=_0x2fb7df;return _0x211bcd;})[_0xc34e('0x25')](respondWithFilteredResult(_0x32539b,_0x15cd56))[_0xc34e('0x46')](handleError(_0x32539b,null));};exports['show']=function(_0x161de7,_0x1f4b20){var _0x41e57e={'raw':!![],'where':{'id':_0x161de7[_0xc34e('0x47')]['id']}},_0x1d3c2d={};_0x1d3c2d[_0xc34e('0x2e')]=_['keys'](db['FaxQueue'][_0xc34e('0x48')]);_0x1d3c2d[_0xc34e('0x31')]=_['keys'](_0x161de7[_0xc34e('0x31')]);_0x1d3c2d['filters']=_[_0xc34e('0x34')](_0x1d3c2d[_0xc34e('0x2e')],_0x1d3c2d[_0xc34e('0x31')]);_0x41e57e[_0xc34e('0x33')]=_[_0xc34e('0x34')](_0x1d3c2d[_0xc34e('0x2e')],qs[_0xc34e('0x35')](_0x161de7[_0xc34e('0x31')][_0xc34e('0x35')]));_0x41e57e[_0xc34e('0x33')]=_0x41e57e[_0xc34e('0x33')]['length']?_0x41e57e[_0xc34e('0x33')]:_0x1d3c2d[_0xc34e('0x2e')];if(_0x161de7[_0xc34e('0x31')]['includeAll']){_0x41e57e[_0xc34e('0x43')]=[{'all':!![]}];}_0x41e57e=_['merge']({},_0x41e57e,_0x161de7[_0xc34e('0x40')]);return db[_0xc34e('0x2b')]['find'](_0x41e57e)[_0xc34e('0x25')](handleEntityNotFound(_0x1f4b20,null))[_0xc34e('0x25')](respondWithResult(_0x1f4b20,null))[_0xc34e('0x46')](handleError(_0x1f4b20,null));};exports['create']=function(_0x535658,_0x39125a){return db[_0xc34e('0x2b')][_0xc34e('0x49')](_0x535658['body'],{})[_0xc34e('0x25')](function(_0x3dd4d1){var _0x394eae=_0x535658[_0xc34e('0x4a')]['get']({'plain':!![]});if(!_0x394eae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x394eae[_0xc34e('0x4b')]===_0xc34e('0x4a')){var _0x4af36e=_0x3dd4d1['get']({'plain':!![]});var _0x2656d5=_0xc34e('0x28');return db[_0xc34e('0x4c')][_0xc34e('0x4d')]({'where':{'name':_0x2656d5,'userProfileId':_0x394eae[_0xc34e('0x4e')]},'raw':!![]})['then'](function(_0x24d25f){if(_0x24d25f&&_0x24d25f[_0xc34e('0x4f')]===0x0){return db[_0xc34e('0x29')][_0xc34e('0x49')]({'name':_0x4af36e['name'],'resourceId':_0x4af36e['id'],'type':_0x24d25f[_0xc34e('0x30')],'sectionId':_0x24d25f['id']},{})[_0xc34e('0x25')](function(){return _0x3dd4d1;});}else{return _0x3dd4d1;}})[_0xc34e('0x46')](function(_0x3aacb3){logger['error'](_0xc34e('0x50'),_0x3aacb3);throw _0x3aacb3;});}return _0x3dd4d1;})[_0xc34e('0x25')](respondWithResult(_0x39125a,0xc9))[_0xc34e('0x46')](handleError(_0x39125a,null));};exports['update']=function(_0x411d0d,_0x495733){if(_0x411d0d[_0xc34e('0x51')]['id']){delete _0x411d0d[_0xc34e('0x51')]['id'];}return db['FaxQueue'][_0xc34e('0x4d')]({'where':{'id':_0x411d0d[_0xc34e('0x47')]['id']}})[_0xc34e('0x25')](handleEntityNotFound(_0x495733,null))[_0xc34e('0x25')](saveUpdates(_0x411d0d[_0xc34e('0x51')],null))['then'](respondWithResult(_0x495733,null))[_0xc34e('0x46')](handleError(_0x495733,null));};exports[_0xc34e('0x26')]=function(_0x273fdb,_0x1380fd){return db['FaxQueue'][_0xc34e('0x4d')]({'where':{'id':_0x273fdb['params']['id']}})[_0xc34e('0x25')](handleEntityNotFound(_0x1380fd,null))['then'](removeEntity(_0x1380fd,null))[_0xc34e('0x46')](handleError(_0x1380fd,null));};exports[_0xc34e('0x52')]=function(_0x55bafc,_0x12f2fe){return db[_0xc34e('0x2b')][_0xc34e('0x52')]()['then'](respondWithResult(_0x12f2fe,null))['catch'](handleError(_0x12f2fe,null));};exports[_0xc34e('0x53')]=function(_0x2bcd99,_0x189f51,_0x4dc164){var _0x1d146d={'raw':!![],'where':{}},_0x7fea0c={},_0x1c7eff;return db['FaxQueue'][_0xc34e('0x54')]({'where':{'id':_0x2bcd99[_0xc34e('0x47')]['id']}})[_0xc34e('0x25')](handleEntityNotFound(_0x189f51,null))['then'](function(_0x35f030){if(_0x35f030){_0x1c7eff=_0x35f030['get']({'plain':!![]});_0x7fea0c['model']=_[_0xc34e('0x32')](db[_0xc34e('0x55')][_0xc34e('0x48')]);_0x7fea0c[_0xc34e('0x31')]=_[_0xc34e('0x32')](_0x2bcd99[_0xc34e('0x31')]);_0x7fea0c[_0xc34e('0x3b')]=_[_0xc34e('0x34')](_0x7fea0c['model'],_0x7fea0c[_0xc34e('0x31')]);_0x1d146d['attributes']=_[_0xc34e('0x34')](_0x7fea0c['model'],qs[_0xc34e('0x35')](_0x2bcd99[_0xc34e('0x31')][_0xc34e('0x35')]));_0x1d146d[_0xc34e('0x33')]=_0x1d146d[_0xc34e('0x33')]['length']?_0x1d146d[_0xc34e('0x33')]:_0x7fea0c[_0xc34e('0x2e')];if(!_0x2bcd99['query'][_0xc34e('0x37')](_0xc34e('0x38'))){_0x1d146d['limit']=qs['limit'](_0x2bcd99[_0xc34e('0x31')]['limit']);_0x1d146d[_0xc34e('0x1e')]=qs[_0xc34e('0x1e')](_0x2bcd99['query'][_0xc34e('0x1e')]);}_0x1d146d[_0xc34e('0x56')]=qs[_0xc34e('0x57')](_0x2bcd99[_0xc34e('0x31')]['sort']);_0x1d146d[_0xc34e('0x39')]=qs[_0xc34e('0x3b')](_[_0xc34e('0x3a')](_0x2bcd99[_0xc34e('0x31')],_0x7fea0c['filters']));_0x1d146d[_0xc34e('0x39')][_0xc34e('0x58')]=_0x35f030['id'];if(_0x2bcd99[_0xc34e('0x31')][_0xc34e('0x3f')]){_0x1d146d[_0xc34e('0x39')]=_['merge'](_0x1d146d[_0xc34e('0x39')],{'$or':_[_0xc34e('0x2f')](_0x1d146d[_0xc34e('0x33')],function(_0x506111){var _0x45cfae={};_0x45cfae[_0x506111]={'$like':'%'+_0x2bcd99['query'][_0xc34e('0x3f')]+'%'};return _0x45cfae;})});}_0x1d146d=_[_0xc34e('0x3c')]({},_0x1d146d,_0x2bcd99['options']);return db['UserFaxQueue'][_0xc34e('0x44')](_0x1d146d);}})[_0xc34e('0x25')](function(_0x7e9b32){if(_0x7e9b32){return db[_0xc34e('0x59')][_0xc34e('0x5a')]({'where':{'id':_[_0xc34e('0x2f')](_0x7e9b32,'UserId'),'role':_0xc34e('0x5b')},'attributes':['id',_0xc34e('0x30'),_0xc34e('0x5c'),_0xc34e('0x5d'),'createdAt']});}})['then'](function(_0x2045f4){if(_0x2045f4){return{'count':_0x2045f4['count'],'rows':_[_0xc34e('0x2f')](_0x2045f4[_0xc34e('0x45')],function(_0x31133a){return{'membername':_0x31133a[_0xc34e('0x30')],'UserId':_0x31133a['id'],'queue_name':_0x1c7eff[_0xc34e('0x30')],'FaxQueueId':_0x1c7eff['id'],'interface':util[_0xc34e('0x5e')](_0xc34e('0x5f'),'SIP',_0x31133a[_0xc34e('0x30')]),'penalty':0x0,'paused':_0x31133a[_0xc34e('0x5c')],'createdAt':_0x31133a[_0xc34e('0x60')],'updatedAt':_0x31133a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x189f51,_0x1d146d))['catch'](handleError(_0x189f51,null));};exports[_0xc34e('0x61')]=function(_0x39bc40,_0x16708a,_0x36342c){var _0x3fa0a8={};var _0x141e3c={};var _0x3421e9;var _0x28e60e;return db['FaxQueue'][_0xc34e('0x54')]({'where':{'id':_0x39bc40['params']['id']}})['then'](handleEntityNotFound(_0x16708a,null))[_0xc34e('0x25')](function(_0x2d87af){if(_0x2d87af){_0x3421e9=_0x2d87af;_0x141e3c[_0xc34e('0x2e')]=_[_0xc34e('0x32')](db[_0xc34e('0x62')]['rawAttributes']);_0x141e3c['query']=_['keys'](_0x39bc40[_0xc34e('0x31')]);_0x141e3c[_0xc34e('0x3b')]=_[_0xc34e('0x34')](_0x141e3c['model'],_0x141e3c[_0xc34e('0x31')]);_0x3fa0a8[_0xc34e('0x33')]=_[_0xc34e('0x34')](_0x141e3c[_0xc34e('0x2e')],qs[_0xc34e('0x35')](_0x39bc40['query'][_0xc34e('0x35')]));_0x3fa0a8[_0xc34e('0x33')]=_0x3fa0a8[_0xc34e('0x33')]['length']?_0x3fa0a8[_0xc34e('0x33')]:_0x141e3c[_0xc34e('0x2e')];_0x3fa0a8[_0xc34e('0x56')]=qs['sort'](_0x39bc40['query'][_0xc34e('0x57')]);_0x3fa0a8[_0xc34e('0x39')]=qs['filters'](_[_0xc34e('0x3a')](_0x39bc40[_0xc34e('0x31')],_0x141e3c[_0xc34e('0x3b')]));if(_0x39bc40['query'][_0xc34e('0x3f')]){_0x3fa0a8['where']=_[_0xc34e('0x3c')](_0x3fa0a8[_0xc34e('0x39')],{'$or':_[_0xc34e('0x2f')](_0x3fa0a8['attributes'],function(_0x26600b){var _0x269cfa={};_0x269cfa[_0x26600b]={'$like':'%'+_0x39bc40[_0xc34e('0x31')][_0xc34e('0x3f')]+'%'};return _0x269cfa;})});}_0x3fa0a8=_['merge']({},_0x3fa0a8,_0x39bc40[_0xc34e('0x40')]);return _0x3421e9['getTeams'](_0x3fa0a8);}})['then'](function(_0x39cef1){if(_0x39cef1){_0x28e60e=_0x39cef1['length'];if(!_0x39bc40[_0xc34e('0x31')][_0xc34e('0x37')](_0xc34e('0x38'))){_0x3fa0a8[_0xc34e('0x20')]=qs[_0xc34e('0x20')](_0x39bc40[_0xc34e('0x31')][_0xc34e('0x20')]);_0x3fa0a8['offset']=qs['offset'](_0x39bc40['query'][_0xc34e('0x1e')]);}return _0x3421e9[_0xc34e('0x61')](_0x3fa0a8);}})[_0xc34e('0x25')](function(_0x9514ef){if(_0x9514ef){return _0x9514ef?{'count':_0x28e60e,'rows':_0x9514ef}:null;}})['then'](respondWithResult(_0x16708a,null))['catch'](handleError(_0x16708a,null));};exports[_0xc34e('0x63')]=function(_0x365e26,_0x325a67,_0x35df6b){var _0x43c7c6=_0x365e26[_0xc34e('0x51')][_0xc34e('0x64')];return db[_0xc34e('0x62')][_0xc34e('0x44')]({'where':{'id':_0x43c7c6},'attributes':['id'],'include':[{'model':db[_0xc34e('0x59')],'as':_0xc34e('0x65'),'attributes':['id',_0xc34e('0x30'),_0xc34e('0x66'),_0xc34e('0x67'),_0xc34e('0x68')],'raw':!![]}]})['then'](function(_0x3d2349){if(_0x3d2349){var _0x14c039=_[_0xc34e('0x69')](_0x3d2349,function(_0x41d035){var _0x25e49e=_0x41d035[_0xc34e('0x27')]({'plain':!![]});return _0x25e49e[_0xc34e('0x65')];});return db[_0xc34e('0x2b')][_0xc34e('0x4d')]({'where':{'id':_0x365e26['params']['id']}})[_0xc34e('0x25')](function(_0x40115b){return db[_0xc34e('0x6a')][_0xc34e('0x6b')](function(_0x1f0d75){return _0x40115b[_0xc34e('0x63')](_0x43c7c6,{'transaction':_0x1f0d75})['then'](function(){return BPromise[_0xc34e('0x6c')](_0x14c039,function(_0x5d3aa4){return db[_0xc34e('0x55')][_0xc34e('0x6d')]({'where':{'UserId':_0x5d3aa4['id'],'FaxQueueId':_0x365e26[_0xc34e('0x47')]['id']},'transaction':_0x1f0d75});});})[_0xc34e('0x25')](function(){_0x14c039['forEach'](function(_0x45cc20){socket['emit']('userFaxQueue:save',{'UserId':_0x45cc20['id'],'FaxQueueId':_0x40115b['id']});});});});});}})[_0xc34e('0x25')](respondWithStatusCode(_0x325a67,null))[_0xc34e('0x46')](handleError(_0x325a67,null));};exports['removeTeams']=function(_0x44bb24,_0x136387,_0x3a1299){return db[_0xc34e('0x62')][_0xc34e('0x44')]({'where':{'id':_0x44bb24[_0xc34e('0x31')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc34e('0x65'),'attributes':['id'],'raw':!![]}]})[_0xc34e('0x25')](handleEntityNotFound(_0x136387,null))[_0xc34e('0x25')](function(_0x48208d){var _0x211ee2=_[_0xc34e('0x2f')](_0x48208d,'id');var _0x4a8897=[];var _0x38bf7e=[];var _0xeb9969=squel['select']();_0xeb9969['field'](_0xc34e('0x6e'))[_0xc34e('0x6f')](_0xc34e('0x70'),'tq')[_0xc34e('0x71')](_0xc34e('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x44bb24['params']['id']);for(var _0x8bd4e5=0x0;_0x8bd4e5<_0x48208d[_0xc34e('0x36')];_0x8bd4e5+=0x1){let _0x12ff8b=_0x48208d[_0x8bd4e5];for(var _0x17fdb1=0x0;_0x17fdb1<_0x12ff8b[_0xc34e('0x65')][_0xc34e('0x36')];_0x17fdb1+=0x1){let _0x131943=_0x12ff8b[_0xc34e('0x65')][_0x17fdb1];var _0x2fc513=_0xeb9969[_0xc34e('0x73')]();_0x2fc513[_0xc34e('0x39')]('ut.UserId\x20=\x20?',_0x131943['id']);_0x38bf7e[_0xc34e('0x74')](db['sequelize']['query'](_0x2fc513['toString'](),{'type':db[_0xc34e('0x6a')][_0xc34e('0x75')]['SELECT']})['then'](function(_0x5dd82f){if(_0x5dd82f[_0xc34e('0x36')]===0x1){return _0x131943['id'];}else{var _0x4b6751=_[_0xc34e('0x76')](_['map'](_0x5dd82f,_0xc34e('0x77')),function(_0x5be80d){return _[_0xc34e('0x78')](_0x211ee2,_0x5be80d);});if(_0x4b6751){return _0x131943['id'];}}}));}}return BPromise[_0xc34e('0x79')](_0x38bf7e)[_0xc34e('0x25')](function(_0x4581d1){_0x4a8897=_(_0x4a8897)[_0xc34e('0x7a')](_0x4581d1)[_0xc34e('0x7b')]()[_0xc34e('0x7c')]();return db[_0xc34e('0x2b')][_0xc34e('0x4d')]({'where':{'id':_0x44bb24['params']['id']}})[_0xc34e('0x25')](function(_0x4d3086){return db[_0xc34e('0x6a')][_0xc34e('0x6b')](function(_0x149b66){return _0x4d3086['removeTeams'](_0x44bb24[_0xc34e('0x31')][_0xc34e('0x64')],{'transaction':_0x149b66})[_0xc34e('0x25')](function(){if(!_[_0xc34e('0x7d')](_0x4a8897)){return _0x4d3086[_0xc34e('0x7e')](_0x4a8897,{'transaction':_0x149b66});}})[_0xc34e('0x25')](function(){_0x4a8897[_0xc34e('0x7f')](function(_0xb9c3f8){socket[_0xc34e('0x80')]('userFaxQueue:remove',{'UserId':_0xb9c3f8,'FaxQueueId':_0x4d3086['id']});});});});});});})[_0xc34e('0x25')](respondWithStatusCode(_0x136387,null))[_0xc34e('0x46')](handleError(_0x136387,null));};exports['addAgents']=function(_0x290a93,_0x14ef6b,_0x4450da){return db[_0xc34e('0x2b')][_0xc34e('0x4d')]({'where':{'id':_0x290a93[_0xc34e('0x47')]['id']}})['then'](handleEntityNotFound(_0x14ef6b,null))[_0xc34e('0x25')](function(_0x560b5a){if(_0x560b5a){return _0x560b5a[_0xc34e('0x81')](_0x290a93['body'][_0xc34e('0x64')],_['omit'](_0x290a93[_0xc34e('0x51')],[_0xc34e('0x64'),'id'])||{})[_0xc34e('0x82')](function(_0x4ab144){for(var _0x1cf8f9=0x0;_0x1cf8f9<_0x290a93[_0xc34e('0x51')][_0xc34e('0x64')][_0xc34e('0x36')];_0x1cf8f9+=0x1){socket[_0xc34e('0x80')](_0xc34e('0x83'),{'UserId':Number(_0x290a93[_0xc34e('0x51')][_0xc34e('0x64')][_0x1cf8f9]),'FaxQueueId':Number(_0x290a93[_0xc34e('0x47')]['id'])});}return _0x4ab144;});}})[_0xc34e('0x25')](respondWithResult(_0x14ef6b,null))['catch'](handleError(_0x14ef6b,null));};exports[_0xc34e('0x7e')]=function(_0x7f827a,_0x58fa2d,_0xc65037){return db[_0xc34e('0x2b')][_0xc34e('0x4d')]({'where':{'id':_0x7f827a[_0xc34e('0x47')]['id']}})[_0xc34e('0x25')](handleEntityNotFound(_0x58fa2d,null))[_0xc34e('0x25')](function(_0x1a5ea3){if(_0x1a5ea3){return _0x1a5ea3[_0xc34e('0x7e')](_0x7f827a['query'][_0xc34e('0x64')])[_0xc34e('0x25')](function(){if(_[_0xc34e('0x84')](_0x7f827a[_0xc34e('0x31')][_0xc34e('0x64')])){for(var _0xe0c018=0x0;_0xe0c018<_0x7f827a['query']['ids'][_0xc34e('0x36')];_0xe0c018+=0x1){socket[_0xc34e('0x80')](_0xc34e('0x85'),{'UserId':Number(_0x7f827a[_0xc34e('0x31')][_0xc34e('0x64')][_0xe0c018]),'FaxQueueId':Number(_0x7f827a[_0xc34e('0x47')]['id'])});}}else{socket[_0xc34e('0x80')](_0xc34e('0x85'),{'UserId':Number(_0x7f827a[_0xc34e('0x31')][_0xc34e('0x64')]),'FaxQueueId':Number(_0x7f827a[_0xc34e('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x58fa2d,null))['catch'](handleError(_0x58fa2d,null));};exports[_0xc34e('0x86')]=function(_0x4f803b,_0x4b9435,_0x4b9530){var _0x214dee={};var _0x34c23a={};var _0x504059;var _0x2d3a1e;return db[_0xc34e('0x2b')][_0xc34e('0x54')]({'where':{'id':_0x4f803b['params']['id']}})[_0xc34e('0x25')](handleEntityNotFound(_0x4b9435,null))[_0xc34e('0x25')](function(_0x40030b){if(_0x40030b){_0x504059=_0x40030b;_0x34c23a['model']=_[_0xc34e('0x32')](db[_0xc34e('0x59')][_0xc34e('0x48')]);_0x34c23a[_0xc34e('0x31')]=_['keys'](_0x4f803b[_0xc34e('0x31')]);_0x34c23a[_0xc34e('0x3b')]=_[_0xc34e('0x34')](_0x34c23a[_0xc34e('0x2e')],_0x34c23a[_0xc34e('0x31')]);_0x214dee[_0xc34e('0x33')]=_[_0xc34e('0x34')](_0x34c23a[_0xc34e('0x2e')],qs['fields'](_0x4f803b[_0xc34e('0x31')][_0xc34e('0x35')]));_0x214dee[_0xc34e('0x33')]=_0x214dee[_0xc34e('0x33')]['length']?_0x214dee[_0xc34e('0x33')]:_0x34c23a[_0xc34e('0x2e')];_0x214dee[_0xc34e('0x56')]=qs[_0xc34e('0x57')](_0x4f803b[_0xc34e('0x31')][_0xc34e('0x57')]);_0x214dee['where']=qs['filters'](_['pick'](_0x4f803b[_0xc34e('0x31')],_0x34c23a[_0xc34e('0x3b')]));if(_0x4f803b['query'][_0xc34e('0x3f')]){_0x214dee[_0xc34e('0x39')]=_[_0xc34e('0x3c')](_0x214dee[_0xc34e('0x39')],{'$or':_[_0xc34e('0x2f')](_0x214dee[_0xc34e('0x33')],function(_0x1b73fd){var _0x1c40ef={};_0x1c40ef[_0x1b73fd]={'$like':'%'+_0x4f803b[_0xc34e('0x31')][_0xc34e('0x3f')]+'%'};return _0x1c40ef;})});}_0x214dee=_[_0xc34e('0x3c')]({},_0x214dee,_0x4f803b['options']);return _0x504059[_0xc34e('0x86')](_0x214dee);}})['then'](function(_0x1e38f1){if(_0x1e38f1){_0x2d3a1e=_0x1e38f1['length'];if(!_0x4f803b['query']['hasOwnProperty']('nolimit')){_0x214dee[_0xc34e('0x20')]=qs['limit'](_0x4f803b[_0xc34e('0x31')][_0xc34e('0x20')]);_0x214dee[_0xc34e('0x1e')]=qs[_0xc34e('0x1e')](_0x4f803b[_0xc34e('0x31')][_0xc34e('0x1e')]);}return _0x504059[_0xc34e('0x86')](_0x214dee);}})[_0xc34e('0x25')](function(_0x2d02f1){if(_0x2d02f1){return _0x2d02f1?{'count':_0x2d3a1e,'rows':_0x2d02f1}:null;}})['then'](respondWithResult(_0x4b9435,null))[_0xc34e('0x46')](handleError(_0x4b9435,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4fbd08e..4171cc1 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 _0x6fc9=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e19a2,_0x15fef7){var _0x22740e=function(_0x2be73a){while(--_0x2be73a){_0x3e19a2['push'](_0x3e19a2['shift']());}};_0x22740e(++_0x15fef7);}(_0x6fc9,0x8e));var _0x96fc=function(_0x416390,_0x5a7521){_0x416390=_0x416390-0x0;var _0x17c7d7=_0x6fc9[_0x416390];return _0x17c7d7;};'use strict';var EventEmitter=require(_0x96fc('0x0'));var FaxQueue=require(_0x96fc('0x1'))['db'][_0x96fc('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x96fc('0x3')](0x0);var events={'afterCreate':_0x96fc('0x4'),'afterUpdate':_0x96fc('0x5'),'afterDestroy':_0x96fc('0x6')};function emitEvent(_0x36222b){return function(_0x410b91,_0x216f7b,_0x59ca79){FaxQueueEvents[_0x96fc('0x7')](_0x36222b+':'+_0x410b91['id'],_0x410b91);FaxQueueEvents[_0x96fc('0x7')](_0x36222b,_0x410b91);_0x59ca79(null);};}for(var e in events){if(events[_0x96fc('0x8')](e)){var event=events[e];FaxQueue[_0x96fc('0x9')](e,emitEvent(event));}}module[_0x96fc('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0xec15=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','remove','emit'];(function(_0x2f85aa,_0x318140){var _0x1b4b95=function(_0x369f5e){while(--_0x369f5e){_0x2f85aa['push'](_0x2f85aa['shift']());}};_0x1b4b95(++_0x318140);}(_0xec15,0x158));var _0x5ec1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec15[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5ec1('0x0'));var FaxQueue=require(_0x5ec1('0x1'))['db'][_0x5ec1('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5ec1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5ec1('0x4')};function emitEvent(_0xa20583){return function(_0x50824a,_0x437e4a,_0x12a2ef){FaxQueueEvents[_0x5ec1('0x5')](_0xa20583+':'+_0x50824a['id'],_0x50824a);FaxQueueEvents[_0x5ec1('0x5')](_0xa20583,_0x50824a);_0x12a2ef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x5ec1('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 97679e4..522c7af 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 _0x4423=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4423,0x192));var _0x3442=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x4423[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var util=require(_0x3442('0x0'));var logger=require(_0x3442('0x1'))(_0x3442('0x2'));var moment=require('moment');var BPromise=require(_0x3442('0x3'));var rp=require(_0x3442('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3442('0x5'));var attributes=require(_0x3442('0x6'));module[_0x3442('0x7')]=function(_0x25f619,_0x3d89e6){return _0x25f619[_0x3442('0x8')](_0x3442('0x9'),attributes,{'tableName':_0x3442('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd2c=['rimraf','exports','define','FaxQueue','lodash','../../config/logger','api','bluebird','path'];(function(_0x2f6167,_0x432253){var _0x2e2548=function(_0x1da10){while(--_0x1da10){_0x2f6167['push'](_0x2f6167['shift']());}};_0x2e2548(++_0x432253);}(_0xdd2c,0x17e));var _0xcdd2=function(_0x298b14,_0x4c1749){_0x298b14=_0x298b14-0x0;var _0x1f7d7a=_0xdd2c[_0x298b14];return _0x1f7d7a;};'use strict';var _=require(_0xcdd2('0x0'));var util=require('util');var logger=require(_0xcdd2('0x1'))(_0xcdd2('0x2'));var moment=require('moment');var BPromise=require(_0xcdd2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd2('0x4'));var rimraf=require(_0xcdd2('0x5'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xcdd2('0x6')]=function(_0x2e382c,_0x7938a3){return _0x2e382c[_0xcdd2('0x7')](_0xcdd2('0x8'),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 e8cac7d..463ca41 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 _0xf012=['FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./faxQueue.socket','register','then'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xf012,0x158));var _0x2f01=function(_0x50d249,_0x564d13){_0x50d249=_0x50d249-0x0;var _0x267287=_0xf012[_0x50d249];return _0x267287;};'use strict';var _=require(_0x2f01('0x0'));var util=require(_0x2f01('0x1'));var moment=require(_0x2f01('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f01('0x3'));var fs=require('fs');var Redis=require(_0x2f01('0x4'));var db=require(_0x2f01('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f01('0x6'))('rpc');var config=require(_0x2f01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2f01('0x8')][_0x2f01('0x9')]({'port':0x232a});config[_0x2f01('0xa')]=_[_0x2f01('0xb')](config[_0x2f01('0xa')],{'host':_0x2f01('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f01('0xd'))[_0x2f01('0xe')](socket);function respondWithRpcPromise(_0x509203,_0x27db4d,_0x178b78){return new BPromise(function(_0x1be03a,_0x6a4407){return client['request'](_0x509203,_0x178b78)[_0x2f01('0xf')](function(_0x5cc171){logger['info'](_0x2f01('0x10'),_0x27db4d,_0x2f01('0x11'));logger[_0x2f01('0x12')](_0x2f01('0x13'),_0x27db4d,_0x2f01('0x11'),JSON[_0x2f01('0x14')](_0x5cc171));if(_0x5cc171[_0x2f01('0x15')]){if(_0x5cc171[_0x2f01('0x15')][_0x2f01('0x16')]===0x1f4){logger['error'](_0x2f01('0x10'),_0x27db4d,_0x5cc171[_0x2f01('0x15')][_0x2f01('0x17')]);return _0x6a4407(_0x5cc171[_0x2f01('0x15')][_0x2f01('0x17')]);}logger[_0x2f01('0x15')](_0x2f01('0x10'),_0x27db4d,_0x5cc171['error'][_0x2f01('0x17')]);return _0x1be03a(_0x5cc171[_0x2f01('0x15')][_0x2f01('0x17')]);}else{logger[_0x2f01('0x18')](_0x2f01('0x10'),_0x27db4d,_0x2f01('0x11'));_0x1be03a(_0x5cc171[_0x2f01('0x19')][_0x2f01('0x17')]);}})[_0x2f01('0x1a')](function(_0x2e3b63){logger[_0x2f01('0x15')](_0x2f01('0x10'),_0x27db4d,_0x2e3b63);_0x6a4407(_0x2e3b63);});});}exports[_0x2f01('0x1b')]=function(_0xbe3787){var _0x425581=this;return new Promise(function(_0x37e5b6,_0x6c2ac1){return db[_0x2f01('0x1c')][_0x2f01('0x1d')]({'raw':_0xbe3787['options']?_0xbe3787[_0x2f01('0x1e')][_0x2f01('0x1f')]===undefined?!![]:![]:!![],'where':_0xbe3787['options']?_0xbe3787['options']['where']||null:null,'attributes':_0xbe3787[_0x2f01('0x1e')]?_0xbe3787['options'][_0x2f01('0x20')]||null:null,'limit':_0xbe3787[_0x2f01('0x1e')]?_0xbe3787[_0x2f01('0x1e')][_0x2f01('0x21')]||null:null,'include':_0xbe3787['options']?_0xbe3787[_0x2f01('0x1e')][_0x2f01('0x22')]?_[_0x2f01('0x23')](_0xbe3787[_0x2f01('0x1e')][_0x2f01('0x22')],function(_0xe938bd){return{'model':db[_0xe938bd[_0x2f01('0x24')]],'as':_0xe938bd['as'],'attributes':_0xe938bd[_0x2f01('0x20')],'include':_0xe938bd[_0x2f01('0x22')]?_[_0x2f01('0x23')](_0xe938bd[_0x2f01('0x22')],function(_0x524655){return{'model':db[_0x524655[_0x2f01('0x24')]],'as':_0x524655['as'],'attributes':_0x524655['attributes'],'include':_0x524655[_0x2f01('0x22')]?_[_0x2f01('0x23')](_0x524655[_0x2f01('0x22')],function(_0x202fd5){return{'model':db[_0x202fd5[_0x2f01('0x24')]],'as':_0x202fd5['as'],'attributes':_0x202fd5[_0x2f01('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2f01('0xf')](function(_0x4bc466){logger[_0x2f01('0x18')](_0x2f01('0x1b'),_0xbe3787);logger[_0x2f01('0x12')](_0x2f01('0x1b'),_0xbe3787,JSON[_0x2f01('0x14')](_0x4bc466));_0x37e5b6(_0x4bc466);})['catch'](function(_0x57a326){logger['error']('GetFaxQueue',_0x57a326[_0x2f01('0x17')],_0xbe3787);_0x6c2ac1(_0x425581[_0x2f01('0x15')](0x1f4,_0x57a326['message']));});});};exports[_0x2f01('0x25')]=function(_0x98ef9a){var _0x2ce45b=this;return new Promise(function(_0x3f778b,_0x2ec3ec){return db[_0x2f01('0x1c')][_0x2f01('0x26')]({'raw':_0x98ef9a['options']?_0x98ef9a['options'][_0x2f01('0x1f')]===undefined?!![]:![]:!![],'where':_0x98ef9a[_0x2f01('0x1e')]?_0x98ef9a['options'][_0x2f01('0x27')]||null:null,'attributes':_0x98ef9a[_0x2f01('0x1e')]?_0x98ef9a[_0x2f01('0x1e')][_0x2f01('0x20')]||null:null,'include':_0x98ef9a[_0x2f01('0x1e')]?_0x98ef9a[_0x2f01('0x1e')]['include']?_[_0x2f01('0x23')](_0x98ef9a[_0x2f01('0x1e')][_0x2f01('0x22')],function(_0x2cad7f){return{'model':db[_0x2cad7f[_0x2f01('0x24')]],'as':_0x2cad7f['as'],'attributes':_0x2cad7f[_0x2f01('0x20')],'include':_0x2cad7f['include']?_[_0x2f01('0x23')](_0x2cad7f[_0x2f01('0x22')],function(_0x13527e){return{'model':db[_0x13527e[_0x2f01('0x24')]],'as':_0x13527e['as'],'attributes':_0x13527e[_0x2f01('0x20')],'include':_0x13527e[_0x2f01('0x22')]?_[_0x2f01('0x23')](_0x13527e[_0x2f01('0x22')],function(_0x31d1dc){return{'model':db[_0x31d1dc['model']],'as':_0x31d1dc['as'],'attributes':_0x31d1dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f01('0xf')](function(_0x47f607){logger[_0x2f01('0x18')](_0x2f01('0x25'),_0x98ef9a);logger['debug']('ShowFaxQueue',_0x98ef9a,JSON['stringify'](_0x47f607));_0x3f778b(_0x47f607);})[_0x2f01('0x1a')](function(_0x596c9){logger['error'](_0x2f01('0x25'),_0x596c9['message'],_0x98ef9a);_0x2ec3ec(_0x2ce45b[_0x2f01('0x15')](0x1f4,_0x596c9[_0x2f01('0x17')]));});});}; \ No newline at end of file +var _0x9808=['FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetFaxQueue','debug','catch','ShowFaxQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x306db6,_0x18a817){var _0x2046eb=function(_0x1ac67a){while(--_0x1ac67a){_0x306db6['push'](_0x306db6['shift']());}};_0x2046eb(++_0x18a817);}(_0x9808,0x1bc));var _0x8980=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x9808[_0x2a7b50];return _0x4224c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8980('0x0'));var BPromise=require(_0x8980('0x1'));var rs=require(_0x8980('0x2'));var fs=require('fs');var Redis=require(_0x8980('0x3'));var db=require(_0x8980('0x4'))['db'];var utils=require(_0x8980('0x5'));var logger=require('../../config/logger')(_0x8980('0x6'));var config=require(_0x8980('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8980('0x8')][_0x8980('0x9')]({'port':0x232a});config[_0x8980('0xa')]=_[_0x8980('0xb')](config[_0x8980('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8980('0xc'))(new Redis(config[_0x8980('0xa')]));require('./faxQueue.socket')[_0x8980('0xd')](socket);function respondWithRpcPromise(_0x4f2040,_0x4697e5,_0x4a6850){return new BPromise(function(_0x37e7e4,_0x39fe53){return client[_0x8980('0xe')](_0x4f2040,_0x4a6850)[_0x8980('0xf')](function(_0x579df2){logger[_0x8980('0x10')](_0x8980('0x11'),_0x4697e5,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4697e5,_0x8980('0x12'),JSON[_0x8980('0x13')](_0x579df2));if(_0x579df2[_0x8980('0x14')]){if(_0x579df2[_0x8980('0x14')][_0x8980('0x15')]===0x1f4){logger['error'](_0x8980('0x11'),_0x4697e5,_0x579df2[_0x8980('0x14')][_0x8980('0x16')]);return _0x39fe53(_0x579df2[_0x8980('0x14')]['message']);}logger[_0x8980('0x14')](_0x8980('0x11'),_0x4697e5,_0x579df2['error'][_0x8980('0x16')]);return _0x37e7e4(_0x579df2[_0x8980('0x14')][_0x8980('0x16')]);}else{logger[_0x8980('0x10')]('FaxQueue,\x20%s,\x20%s',_0x4697e5,'request\x20sent');_0x37e7e4(_0x579df2[_0x8980('0x17')][_0x8980('0x16')]);}})['catch'](function(_0xa0e605){logger[_0x8980('0x14')](_0x8980('0x11'),_0x4697e5,_0xa0e605);_0x39fe53(_0xa0e605);});});}exports['GetFaxQueue']=function(_0x18898b){var _0x1c1df2=this;return new Promise(function(_0x50f417,_0x22e242){return db[_0x8980('0x18')][_0x8980('0x19')]({'raw':_0x18898b[_0x8980('0x1a')]?_0x18898b['options'][_0x8980('0x1b')]===undefined?!![]:![]:!![],'where':_0x18898b[_0x8980('0x1a')]?_0x18898b[_0x8980('0x1a')][_0x8980('0x1c')]||null:null,'attributes':_0x18898b[_0x8980('0x1a')]?_0x18898b['options'][_0x8980('0x1d')]||null:null,'limit':_0x18898b[_0x8980('0x1a')]?_0x18898b[_0x8980('0x1a')][_0x8980('0x1e')]||null:null,'include':_0x18898b['options']?_0x18898b[_0x8980('0x1a')][_0x8980('0x1f')]?_['map'](_0x18898b[_0x8980('0x1a')][_0x8980('0x1f')],function(_0x3b1c72){return{'model':db[_0x3b1c72[_0x8980('0x20')]],'as':_0x3b1c72['as'],'attributes':_0x3b1c72[_0x8980('0x1d')],'include':_0x3b1c72[_0x8980('0x1f')]?_[_0x8980('0x21')](_0x3b1c72[_0x8980('0x1f')],function(_0x377632){return{'model':db[_0x377632[_0x8980('0x20')]],'as':_0x377632['as'],'attributes':_0x377632[_0x8980('0x1d')],'include':_0x377632[_0x8980('0x1f')]?_[_0x8980('0x21')](_0x377632['include'],function(_0x1e93bc){return{'model':db[_0x1e93bc[_0x8980('0x20')]],'as':_0x1e93bc['as'],'attributes':_0x1e93bc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec9ba){logger[_0x8980('0x10')](_0x8980('0x22'),_0x18898b);logger[_0x8980('0x23')](_0x8980('0x22'),_0x18898b,JSON['stringify'](_0x4ec9ba));_0x50f417(_0x4ec9ba);})[_0x8980('0x24')](function(_0x11138c){logger[_0x8980('0x14')]('GetFaxQueue',_0x11138c[_0x8980('0x16')],_0x18898b);_0x22e242(_0x1c1df2[_0x8980('0x14')](0x1f4,_0x11138c['message']));});});};exports[_0x8980('0x25')]=function(_0x501e9){var _0x2ecd4b=this;return new Promise(function(_0x393779,_0x367e7c){return db['FaxQueue'][_0x8980('0x26')]({'raw':_0x501e9[_0x8980('0x1a')]?_0x501e9[_0x8980('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x501e9[_0x8980('0x1a')]?_0x501e9['options']['where']||null:null,'attributes':_0x501e9[_0x8980('0x1a')]?_0x501e9[_0x8980('0x1a')][_0x8980('0x1d')]||null:null,'include':_0x501e9[_0x8980('0x1a')]?_0x501e9[_0x8980('0x1a')][_0x8980('0x1f')]?_[_0x8980('0x21')](_0x501e9[_0x8980('0x1a')][_0x8980('0x1f')],function(_0x399ad6){return{'model':db[_0x399ad6['model']],'as':_0x399ad6['as'],'attributes':_0x399ad6[_0x8980('0x1d')],'include':_0x399ad6['include']?_[_0x8980('0x21')](_0x399ad6[_0x8980('0x1f')],function(_0x1f1e92){return{'model':db[_0x1f1e92[_0x8980('0x20')]],'as':_0x1f1e92['as'],'attributes':_0x1f1e92['attributes'],'include':_0x1f1e92[_0x8980('0x1f')]?_['map'](_0x1f1e92[_0x8980('0x1f')],function(_0x28617f){return{'model':db[_0x28617f[_0x8980('0x20')]],'as':_0x28617f['as'],'attributes':_0x28617f[_0x8980('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8980('0xf')](function(_0x4b8841){logger[_0x8980('0x10')]('ShowFaxQueue',_0x501e9);logger['debug'](_0x8980('0x25'),_0x501e9,JSON[_0x8980('0x13')](_0x4b8841));_0x393779(_0x4b8841);})[_0x8980('0x24')](function(_0x4d5661){logger['error'](_0x8980('0x25'),_0x4d5661[_0x8980('0x16')],_0x501e9);_0x367e7c(_0x2ecd4b[_0x8980('0x14')](0x1f4,_0x4d5661[_0x8980('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e73c1f9..13b2fe6 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 _0xc6bd=['remove','emit','removeListener','register','length','faxQueue:','save'];(function(_0x599d96,_0x180850){var _0x49a35c=function(_0x5f39f9){while(--_0x5f39f9){_0x599d96['push'](_0x599d96['shift']());}};_0x49a35c(++_0x180850);}(_0xc6bd,0x1e9));var _0xdc6b=function(_0x57aa1a,_0x450bea){_0x57aa1a=_0x57aa1a-0x0;var _0x73ce1f=_0xc6bd[_0x57aa1a];return _0x73ce1f;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xdc6b('0x0'),_0xdc6b('0x1'),'update'];function createListener(_0x57ca57,_0x16f897){return function(_0x52ec98){_0x16f897[_0xdc6b('0x2')](_0x57ca57,_0x52ec98);};}function removeListener(_0x97d6a3,_0x106d9d){return function(){FaxQueueEvents[_0xdc6b('0x3')](_0x97d6a3,_0x106d9d);};}exports[_0xdc6b('0x4')]=function(_0x3f052d){for(var _0x468c29=0x0,_0x355ce6=events[_0xdc6b('0x5')];_0x468c29<_0x355ce6;_0x468c29++){var _0x38404c=events[_0x468c29];var _0x529ad2=createListener(_0xdc6b('0x6')+_0x38404c,_0x3f052d);FaxQueueEvents['on'](_0x38404c,_0x529ad2);}}; \ No newline at end of file +var _0x9f72=['removeListener','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x22000f,_0x4c17fa){var _0x5144fe=function(_0xe94101){while(--_0xe94101){_0x22000f['push'](_0x22000f['shift']());}};_0x5144fe(++_0x4c17fa);}(_0x9f72,0x114));var _0x29f7=function(_0xe0ff52,_0x26b714){_0xe0ff52=_0xe0ff52-0x0;var _0x3a864f=_0x9f72[_0xe0ff52];return _0x3a864f;};'use strict';var FaxQueueEvents=require(_0x29f7('0x0'));var events=[_0x29f7('0x1'),_0x29f7('0x2'),_0x29f7('0x3')];function createListener(_0x3233f1,_0x34812b){return function(_0x49bc04){_0x34812b['emit'](_0x3233f1,_0x49bc04);};}function removeListener(_0x141b78,_0x3bd2aa){return function(){FaxQueueEvents[_0x29f7('0x4')](_0x141b78,_0x3bd2aa);};}exports['register']=function(_0x4ae5e0){for(var _0x4c0537=0x0,_0x41399d=events[_0x29f7('0x5')];_0x4c0537<_0x41399d;_0x4c0537++){var _0xc52148=events[_0x4c0537];var _0x44e83e=createListener(_0x29f7('0x6')+_0xc52148,_0x4ae5e0);FaxQueueEvents['on'](_0xc52148,_0x44e83e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7128ef8..fc15064 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 _0xe785=['/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe785,0x128));var _0x5e78=function(_0x36ed4b,_0x3269d5){_0x36ed4b=_0x36ed4b-0x0;var _0x391dc4=_0xe785[_0x36ed4b];return _0x391dc4;};'use strict';var multer=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var path=require('path');var timeout=require(_0x5e78('0x2'));var express=require(_0x5e78('0x3'));var router=express[_0x5e78('0x4')]();var fs_extra=require(_0x5e78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e78('0x6'));var controller=require(_0x5e78('0x7'));router[_0x5e78('0x8')]('/',auth[_0x5e78('0x9')](),controller['index']);router['get'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xb')]);router['get'](_0x5e78('0xc'),auth['isAuthenticated'](),controller[_0x5e78('0xd')]);router['get'](_0x5e78('0xe'),auth[_0x5e78('0x9')](),controller['getMembers']);router[_0x5e78('0x8')](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x10')]);router[_0x5e78('0x8')](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller['getAgents']);router[_0x5e78('0x12')]('/',auth[_0x5e78('0x9')](),controller[_0x5e78('0x13')]);router['post'](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x14')]);router[_0x5e78('0x12')]('/:id/users',auth[_0x5e78('0x9')](),controller[_0x5e78('0x15')]);router[_0x5e78('0x16')](_0x5e78('0xc'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x17')]);router['delete']('/:id',auth[_0x5e78('0x9')](),controller[_0x5e78('0x18')]);router[_0x5e78('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x1a')]);module[_0x5e78('0x1b')]=router; \ No newline at end of file +var _0xc2c7=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x42e988,_0xd8abe0){var _0x5ce1fb=function(_0x2531bc){while(--_0x2531bc){_0x42e988['push'](_0x42e988['shift']());}};_0x5ce1fb(++_0xd8abe0);}(_0xc2c7,0x134));var _0x7c2c=function(_0x16b246,_0x36119f){_0x16b246=_0x16b246-0x0;var _0xc81ac0=_0xc2c7[_0x16b246];return _0xc81ac0;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['get'](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x8')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x8')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);router[_0x7c2c('0x14')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x15')]);router[_0x7c2c('0x14')](_0x7c2c('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x7c2c('0x14')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller['addAgents']);router[_0x7c2c('0x16')](_0x7c2c('0xc'),auth['isAuthenticated'](),controller[_0x7c2c('0x17')]);router['delete'](_0x7c2c('0xc'),auth['isAuthenticated'](),controller[_0x7c2c('0x18')]);router[_0x7c2c('0x19')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1a')]);router[_0x7c2c('0x19')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1b')]);module[_0x7c2c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index bd32806..59b01dd 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 _0xd17f=['moment','sequelize','exports','STRING','DATE'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xd17f,0xe6));var _0xfd17=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd17f[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0xfd17('0x0'));var Sequelize=require(_0xfd17('0x1'));module[_0xfd17('0x2')]={'uniqueid':{'type':Sequelize[_0xfd17('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfd17('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x35b5=['moment','exports','STRING','DATE'];(function(_0x4409db,_0x230498){var _0x2b3a7d=function(_0x4a6fcb){while(--_0x4a6fcb){_0x4409db['push'](_0x4409db['shift']());}};_0x2b3a7d(++_0x230498);}(_0x35b5,0x1c4));var _0x535b=function(_0x24ece3,_0xb9402d){_0x24ece3=_0x24ece3-0x0;var _0x453542=_0x35b5[_0x24ece3];return _0x453542;};'use strict';var moment=require(_0x535b('0x0'));var Sequelize=require('sequelize');module[_0x535b('0x1')]={'uniqueid':{'type':Sequelize[_0x535b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x535b('0x2')]},'joinAt':{'type':Sequelize[_0x535b('0x3')]},'leaveAt':{'type':Sequelize[_0x535b('0x3')]},'acceptAt':{'type':Sequelize[_0x535b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x535b('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 763ce7b..178db27 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 _0xf290=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','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/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','send','index','map','rawAttributes','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','name','filter','FaxQueueReport','includeAll','findAll','catch','show','params','include','options','find','create','body','update','destroy','describe'];(function(_0x70624e,_0x5c4617){var _0x5c703e=function(_0x5e9039){while(--_0x5e9039){_0x70624e['push'](_0x70624e['shift']());}};_0x5c703e(++_0x5c4617);}(_0xf290,0xde));var _0x0f29=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0xf290[_0x393500];return _0x120d3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x26f46f,_0x23c09e){return function(_0x28cfaa){if(!_0x28cfaa){_0x26f46f['sendStatus'](0x194);}return _0x28cfaa;};}function handleError(_0x13a2c7,_0x540d72){_0x540d72=_0x540d72||0x1f4;return function(_0x58b201){logger[_0x0f29('0x25')](_0x58b201['stack']);if(_0x58b201['name']){delete _0x58b201['name'];}_0x13a2c7['status'](_0x540d72)[_0x0f29('0x26')](_0x58b201);};}exports[_0x0f29('0x27')]=function(_0x4cc5a0,_0x1fc4fd){var _0x2ab528={},_0x274c9d={},_0x51e7dc={'count':0x0,'rows':[]};var _0x56e729=_[_0x0f29('0x28')](db['FaxQueueReport'][_0x0f29('0x29')],function(_0x561c31){return{'name':_0x561c31['fieldName'],'type':_0x561c31[_0x0f29('0x2a')][_0x0f29('0x2b')]};});_0x274c9d[_0x0f29('0x2c')]=_[_0x0f29('0x28')](_0x56e729,'name');_0x274c9d['query']=_[_0x0f29('0x2d')](_0x4cc5a0['query']);_0x274c9d['filters']=_[_0x0f29('0x2e')](_0x274c9d['model'],_0x274c9d[_0x0f29('0x2f')]);_0x2ab528['attributes']=_['intersection'](_0x274c9d[_0x0f29('0x2c')],qs[_0x0f29('0x30')](_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x30')]));_0x2ab528[_0x0f29('0x31')]=_0x2ab528['attributes'][_0x0f29('0x32')]?_0x2ab528['attributes']:_0x274c9d[_0x0f29('0x2c')];if(!_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x33')](_0x0f29('0x34'))){_0x2ab528['limit']=qs[_0x0f29('0x1f')](_0x4cc5a0[_0x0f29('0x2f')]['limit']);_0x2ab528[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x4cc5a0['query']['offset']);}_0x2ab528[_0x0f29('0x35')]=qs[_0x0f29('0x36')](_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x36')]);_0x2ab528[_0x0f29('0x37')]=qs[_0x0f29('0x38')](_['pick'](_0x4cc5a0[_0x0f29('0x2f')],_0x274c9d['filters']),_0x56e729);if(_0x4cc5a0[_0x0f29('0x2f')]['filter']){_0x2ab528[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x2ab528[_0x0f29('0x37')],{'$or':_['map'](_0x56e729,function(_0x5f0d26){if(_0x5f0d26[_0x0f29('0x2a')]!=='VIRTUAL'){var _0x312c07={};_0x312c07[_0x5f0d26[_0x0f29('0x3a')]]={'$like':'%'+_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x3b')]+'%'};return _0x312c07;}})});}_0x2ab528=_[_0x0f29('0x39')]({},_0x2ab528,_0x4cc5a0['options']);var _0x13c05c={'where':_0x2ab528[_0x0f29('0x37')]};return db[_0x0f29('0x3c')][_0x0f29('0x20')](_0x13c05c)[_0x0f29('0x24')](function(_0x4043d9){_0x51e7dc[_0x0f29('0x20')]=_0x4043d9;if(_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x3d')]){_0x2ab528['include']=[{'all':!![]}];}return db[_0x0f29('0x3c')][_0x0f29('0x3e')](_0x2ab528);})[_0x0f29('0x24')](function(_0x11b1dc){_0x51e7dc['rows']=_0x11b1dc;return _0x51e7dc;})[_0x0f29('0x24')](respondWithFilteredResult(_0x1fc4fd,_0x2ab528))[_0x0f29('0x3f')](handleError(_0x1fc4fd,null));};exports[_0x0f29('0x40')]=function(_0x5c2282,_0x185493){var _0x56062d={'raw':!![],'where':{'id':_0x5c2282[_0x0f29('0x41')]['id']}},_0x410c59={};_0x410c59[_0x0f29('0x2c')]=_['keys'](db[_0x0f29('0x3c')][_0x0f29('0x29')]);_0x410c59[_0x0f29('0x2f')]=_[_0x0f29('0x2d')](_0x5c2282[_0x0f29('0x2f')]);_0x410c59[_0x0f29('0x38')]=_[_0x0f29('0x2e')](_0x410c59[_0x0f29('0x2c')],_0x410c59['query']);_0x56062d['attributes']=_['intersection'](_0x410c59[_0x0f29('0x2c')],qs[_0x0f29('0x30')](_0x5c2282[_0x0f29('0x2f')][_0x0f29('0x30')]));_0x56062d[_0x0f29('0x31')]=_0x56062d[_0x0f29('0x31')]['length']?_0x56062d[_0x0f29('0x31')]:_0x410c59['model'];if(_0x5c2282[_0x0f29('0x2f')]['includeAll']){_0x56062d[_0x0f29('0x42')]=[{'all':!![]}];}_0x56062d=_[_0x0f29('0x39')]({},_0x56062d,_0x5c2282[_0x0f29('0x43')]);return db[_0x0f29('0x3c')][_0x0f29('0x44')](_0x56062d)['then'](handleEntityNotFound(_0x185493,null))[_0x0f29('0x24')](respondWithResult(_0x185493,null))[_0x0f29('0x3f')](handleError(_0x185493,null));};exports[_0x0f29('0x45')]=function(_0x5a05b6,_0x14b747){return db['FaxQueueReport']['create'](_0x5a05b6[_0x0f29('0x46')],{})[_0x0f29('0x24')](respondWithResult(_0x14b747,0xc9))[_0x0f29('0x3f')](handleError(_0x14b747,null));};exports[_0x0f29('0x47')]=function(_0x20aa53,_0x335435){if(_0x20aa53['body']['id']){delete _0x20aa53[_0x0f29('0x46')]['id'];}return db[_0x0f29('0x3c')][_0x0f29('0x44')]({'where':{'id':_0x20aa53[_0x0f29('0x41')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x335435,null))[_0x0f29('0x24')](saveUpdates(_0x20aa53[_0x0f29('0x46')],null))[_0x0f29('0x24')](respondWithResult(_0x335435,null))[_0x0f29('0x3f')](handleError(_0x335435,null));};exports[_0x0f29('0x48')]=function(_0x5cd4a9,_0x5e4479){return db[_0x0f29('0x3c')][_0x0f29('0x44')]({'where':{'id':_0x5cd4a9[_0x0f29('0x41')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x5e4479,null))['then'](removeEntity(_0x5e4479,null))[_0x0f29('0x3f')](handleError(_0x5e4479,null));};exports[_0x0f29('0x49')]=function(_0x32102f,_0x30387c){return db[_0x0f29('0x3c')][_0x0f29('0x49')]()[_0x0f29('0x24')](respondWithResult(_0x30387c,null))['catch'](handleError(_0x30387c,null));}; \ No newline at end of file +var _0xf109=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FaxQueueReport','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0xf4d05,_0x5e601f){var _0x47c971=function(_0x17aae3){while(--_0x17aae3){_0xf4d05['push'](_0xf4d05['shift']());}};_0x47c971(++_0x5e601f);}(_0xf109,0xce));var _0x9f10=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf109[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){_0x3dde2e[_0x9f10('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(!_0x11cae7){_0x2ec07d[_0x9f10('0x26')](0x194);}return _0x11cae7;};}function handleError(_0x5e80de,_0x57539b){_0x57539b=_0x57539b||0x1f4;return function(_0x5c1800){logger[_0x9f10('0x27')](_0x5c1800['stack']);if(_0x5c1800[_0x9f10('0x28')]){delete _0x5c1800[_0x9f10('0x28')];}_0x5e80de[_0x9f10('0x18')](_0x57539b)[_0x9f10('0x29')](_0x5c1800);};}exports[_0x9f10('0x2a')]=function(_0x4f6b0c,_0x522805){var _0x22814f={},_0x40f96b={},_0xfbb37f={'count':0x0,'rows':[]};var _0x181aec=_[_0x9f10('0x2b')](db['FaxQueueReport'][_0x9f10('0x2c')],function(_0x501ee){return{'name':_0x501ee[_0x9f10('0x2d')],'type':_0x501ee[_0x9f10('0x2e')]['key']};});_0x40f96b[_0x9f10('0x2f')]=_[_0x9f10('0x2b')](_0x181aec,_0x9f10('0x28'));_0x40f96b['query']=_[_0x9f10('0x30')](_0x4f6b0c['query']);_0x40f96b[_0x9f10('0x31')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],_0x40f96b['query']);_0x22814f[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],qs[_0x9f10('0x34')](_0x4f6b0c[_0x9f10('0x35')]['fields']));_0x22814f[_0x9f10('0x33')]=_0x22814f['attributes'][_0x9f10('0x36')]?_0x22814f[_0x9f10('0x33')]:_0x40f96b[_0x9f10('0x2f')];if(!_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x37')](_0x9f10('0x38'))){_0x22814f['limit']=qs[_0x9f10('0x1b')](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x1b')]);_0x22814f['offset']=qs[_0x9f10('0x1d')](_0x4f6b0c[_0x9f10('0x35')]['offset']);}_0x22814f[_0x9f10('0x39')]=qs['sort'](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x3a')]);_0x22814f[_0x9f10('0x3b')]=qs[_0x9f10('0x31')](_[_0x9f10('0x3c')](_0x4f6b0c[_0x9f10('0x35')],_0x40f96b[_0x9f10('0x31')]),_0x181aec);if(_0x4f6b0c[_0x9f10('0x35')]['filter']){_0x22814f[_0x9f10('0x3b')]=_[_0x9f10('0x3d')](_0x22814f[_0x9f10('0x3b')],{'$or':_['map'](_0x181aec,function(_0x233bab){if(_0x233bab[_0x9f10('0x2e')]!=='VIRTUAL'){var _0x30b04b={};_0x30b04b[_0x233bab[_0x9f10('0x28')]]={'$like':'%'+_0x4f6b0c[_0x9f10('0x35')]['filter']+'%'};return _0x30b04b;}})});}_0x22814f=_['merge']({},_0x22814f,_0x4f6b0c[_0x9f10('0x3e')]);var _0x2ff98d={'where':_0x22814f[_0x9f10('0x3b')]};return db[_0x9f10('0x3f')][_0x9f10('0x1c')](_0x2ff98d)[_0x9f10('0x25')](function(_0x15929f){_0xfbb37f[_0x9f10('0x1c')]=_0x15929f;if(_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x40')]){_0x22814f[_0x9f10('0x41')]=[{'all':!![]}];}return db[_0x9f10('0x3f')]['findAll'](_0x22814f);})['then'](function(_0x4bb805){_0xfbb37f[_0x9f10('0x42')]=_0x4bb805;return _0xfbb37f;})['then'](respondWithFilteredResult(_0x522805,_0x22814f))[_0x9f10('0x43')](handleError(_0x522805,null));};exports[_0x9f10('0x44')]=function(_0x426d30,_0x47d25c){var _0x3cfce6={'raw':!![],'where':{'id':_0x426d30[_0x9f10('0x45')]['id']}},_0xf1164={};_0xf1164[_0x9f10('0x2f')]=_[_0x9f10('0x30')](db['FaxQueueReport']['rawAttributes']);_0xf1164['query']=_[_0x9f10('0x30')](_0x426d30['query']);_0xf1164[_0x9f10('0x31')]=_['intersection'](_0xf1164[_0x9f10('0x2f')],_0xf1164[_0x9f10('0x35')]);_0x3cfce6[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0xf1164['model'],qs[_0x9f10('0x34')](_0x426d30[_0x9f10('0x35')]['fields']));_0x3cfce6[_0x9f10('0x33')]=_0x3cfce6[_0x9f10('0x33')][_0x9f10('0x36')]?_0x3cfce6[_0x9f10('0x33')]:_0xf1164[_0x9f10('0x2f')];if(_0x426d30[_0x9f10('0x35')][_0x9f10('0x40')]){_0x3cfce6[_0x9f10('0x41')]=[{'all':!![]}];}_0x3cfce6=_[_0x9f10('0x3d')]({},_0x3cfce6,_0x426d30[_0x9f10('0x3e')]);return db['FaxQueueReport'][_0x9f10('0x46')](_0x3cfce6)[_0x9f10('0x25')](handleEntityNotFound(_0x47d25c,null))['then'](respondWithResult(_0x47d25c,null))[_0x9f10('0x43')](handleError(_0x47d25c,null));};exports[_0x9f10('0x47')]=function(_0x1cf3eb,_0x1807b3){return db['FaxQueueReport'][_0x9f10('0x47')](_0x1cf3eb[_0x9f10('0x48')],{})[_0x9f10('0x25')](respondWithResult(_0x1807b3,0xc9))[_0x9f10('0x43')](handleError(_0x1807b3,null));};exports[_0x9f10('0x23')]=function(_0x43cb31,_0x479b46){if(_0x43cb31[_0x9f10('0x48')]['id']){delete _0x43cb31[_0x9f10('0x48')]['id'];}return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x43cb31[_0x9f10('0x45')]['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x479b46,null))['then'](saveUpdates(_0x43cb31[_0x9f10('0x48')],null))[_0x9f10('0x25')](respondWithResult(_0x479b46,null))[_0x9f10('0x43')](handleError(_0x479b46,null));};exports[_0x9f10('0x24')]=function(_0x39dae3,_0x15d676){return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x39dae3['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x15d676,null))['then'](removeEntity(_0x15d676,null))[_0x9f10('0x43')](handleError(_0x15d676,null));};exports['describe']=function(_0x2c9eb3,_0x2d06b2){return db[_0x9f10('0x3f')][_0x9f10('0x49')]()[_0x9f10('0x25')](respondWithResult(_0x2d06b2,null))['catch'](handleError(_0x2d06b2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c9c339d..8b17219 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x814b,0x1a2));var _0xb814=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x814b[_0x516ffb];return _0x319667;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x234fc1,_0x3ba1bf){var _0x4eba54=function(_0x50accb){while(--_0x50accb){_0x234fc1['push'](_0x234fc1['shift']());}};_0x4eba54(++_0x3ba1bf);}(_0xe14b,0x93));var _0xbe14=function(_0x45a825,_0x6df36b){_0x45a825=_0x45a825-0x0;var _0x30a8a8=_0xe14b[_0x45a825];return _0x30a8a8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8253438..d453c25 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 _0xeb2a=['error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','stringify','UpdateFaxQueueReport','update','raw','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x189057,_0x1b7853){var _0x4e7fe0=function(_0x9fc96b){while(--_0x9fc96b){_0x189057['push'](_0x189057['shift']());}};_0x4e7fe0(++_0x1b7853);}(_0xeb2a,0x193));var _0xaeb2=function(_0x2be90e,_0x34af31){_0x2be90e=_0x2be90e-0x0;var _0x2366a5=_0xeb2a[_0x2be90e];return _0x2366a5;};'use strict';var _=require(_0xaeb2('0x0'));var util=require(_0xaeb2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaeb2('0x2'));var fs=require('fs');var Redis=require(_0xaeb2('0x3'));var db=require(_0xaeb2('0x4'))['db'];var utils=require(_0xaeb2('0x5'));var logger=require(_0xaeb2('0x6'))(_0xaeb2('0x7'));var config=require(_0xaeb2('0x8'));var jayson=require(_0xaeb2('0x9'));var client=jayson[_0xaeb2('0xa')][_0xaeb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ac2d1,_0x25fa23,_0x22a9ae){return new BPromise(function(_0x1cd9d0,_0x22fe63){return client[_0xaeb2('0xc')](_0x5ac2d1,_0x22a9ae)[_0xaeb2('0xd')](function(_0x4fbed8){logger['info'](_0xaeb2('0xe'),_0x25fa23,_0xaeb2('0xf'));logger['debug'](_0xaeb2('0x10'),_0x25fa23,'request\x20sent',JSON['stringify'](_0x4fbed8));if(_0x4fbed8[_0xaeb2('0x11')]){if(_0x4fbed8['error'][_0xaeb2('0x12')]===0x1f4){logger['error'](_0xaeb2('0xe'),_0x25fa23,_0x4fbed8['error'][_0xaeb2('0x13')]);return _0x22fe63(_0x4fbed8[_0xaeb2('0x11')][_0xaeb2('0x13')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x25fa23,_0x4fbed8[_0xaeb2('0x11')][_0xaeb2('0x13')]);return _0x1cd9d0(_0x4fbed8[_0xaeb2('0x11')][_0xaeb2('0x13')]);}else{logger[_0xaeb2('0x14')](_0xaeb2('0xe'),_0x25fa23,_0xaeb2('0xf'));_0x1cd9d0(_0x4fbed8[_0xaeb2('0x15')][_0xaeb2('0x13')]);}})[_0xaeb2('0x16')](function(_0x43a10c){logger[_0xaeb2('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x25fa23,_0x43a10c);_0x22fe63(_0x43a10c);});});}exports[_0xaeb2('0x17')]=function(_0x3265f6){var _0x28bc38=this;return new Promise(function(_0x3839ab,_0x4ed9c1){return db[_0xaeb2('0x18')][_0xaeb2('0x19')](_0x3265f6[_0xaeb2('0x1a')],{'raw':_0x3265f6['options']?_0x3265f6[_0xaeb2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xaeb2('0xd')](function(_0x3f2756){logger['info'](_0xaeb2('0x17'),_0x3265f6);logger[_0xaeb2('0x1c')](_0xaeb2('0x17'),_0x3265f6,JSON[_0xaeb2('0x1d')](_0x3f2756));_0x3839ab(_0x3f2756);})[_0xaeb2('0x16')](function(_0x2bfd1e){logger[_0xaeb2('0x11')](_0xaeb2('0x17'),_0x2bfd1e[_0xaeb2('0x13')],_0x3265f6);_0x4ed9c1(_0x28bc38[_0xaeb2('0x11')](0x1f4,_0x2bfd1e[_0xaeb2('0x13')]));});});};exports[_0xaeb2('0x1e')]=function(_0x3b7d76){var _0x120fe5=this;return new Promise(function(_0x46e07f,_0x525fa3){return db[_0xaeb2('0x18')][_0xaeb2('0x1f')](_0x3b7d76[_0xaeb2('0x1a')],{'raw':_0x3b7d76[_0xaeb2('0x1b')]?_0x3b7d76[_0xaeb2('0x1b')][_0xaeb2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b7d76[_0xaeb2('0x1b')]?_0x3b7d76[_0xaeb2('0x1b')][_0xaeb2('0x21')]||null:null,'attributes':_0x3b7d76[_0xaeb2('0x1b')]?_0x3b7d76[_0xaeb2('0x1b')][_0xaeb2('0x22')]||null:null,'limit':_0x3b7d76[_0xaeb2('0x1b')]?_0x3b7d76[_0xaeb2('0x1b')]['limit']||null:null})[_0xaeb2('0xd')](function(_0x527a70){logger[_0xaeb2('0x14')]('UpdateFaxQueueReport',_0x3b7d76);logger['debug'](_0xaeb2('0x1e'),_0x3b7d76,JSON[_0xaeb2('0x1d')](_0x527a70));_0x46e07f(_0x527a70);})[_0xaeb2('0x16')](function(_0x3349ce){logger[_0xaeb2('0x11')](_0xaeb2('0x1e'),_0x3349ce['message'],_0x3b7d76);_0x525fa3(_0x120fe5[_0xaeb2('0x11')](0x1f4,_0x3349ce[_0xaeb2('0x13')]));});});}; \ No newline at end of file +var _0xfbea=['CreateFaxQueueReport','FaxQueueReport','create','body','options','then','debug','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x2fd70d,_0x304a6d){var _0x19d2e2=function(_0x4934ea){while(--_0x4934ea){_0x2fd70d['push'](_0x2fd70d['shift']());}};_0x19d2e2(++_0x304a6d);}(_0xfbea,0x1ec));var _0xafbe=function(_0xed47d7,_0x18ce1b){_0xed47d7=_0xed47d7-0x0;var _0x140d37=_0xfbea[_0xed47d7];return _0x140d37;};'use strict';var _=require(_0xafbe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafbe('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xafbe('0x2'));var logger=require(_0xafbe('0x3'))(_0xafbe('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xafbe('0x5')][_0xafbe('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1133d2,_0x2f7741,_0x3d0dcd){return new BPromise(function(_0x4105ce,_0x5ce37f){return client[_0xafbe('0x7')](_0x1133d2,_0x3d0dcd)['then'](function(_0x66c58e){logger[_0xafbe('0x8')](_0xafbe('0x9'),_0x2f7741,_0xafbe('0xa'));logger['debug'](_0xafbe('0xb'),_0x2f7741,_0xafbe('0xa'),JSON[_0xafbe('0xc')](_0x66c58e));if(_0x66c58e['error']){if(_0x66c58e['error'][_0xafbe('0xd')]===0x1f4){logger[_0xafbe('0xe')](_0xafbe('0x9'),_0x2f7741,_0x66c58e[_0xafbe('0xe')][_0xafbe('0xf')]);return _0x5ce37f(_0x66c58e[_0xafbe('0xe')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2f7741,_0x66c58e[_0xafbe('0xe')][_0xafbe('0xf')]);return _0x4105ce(_0x66c58e[_0xafbe('0xe')][_0xafbe('0xf')]);}else{logger[_0xafbe('0x8')](_0xafbe('0x9'),_0x2f7741,_0xafbe('0xa'));_0x4105ce(_0x66c58e[_0xafbe('0x10')][_0xafbe('0xf')]);}})[_0xafbe('0x11')](function(_0x166f68){logger[_0xafbe('0xe')](_0xafbe('0x9'),_0x2f7741,_0x166f68);_0x5ce37f(_0x166f68);});});}exports[_0xafbe('0x12')]=function(_0x27cb72){var _0x4d8eee=this;return new Promise(function(_0x5f2cdb,_0x48208d){return db[_0xafbe('0x13')][_0xafbe('0x14')](_0x27cb72[_0xafbe('0x15')],{'raw':_0x27cb72['options']?_0x27cb72[_0xafbe('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xafbe('0x17')](function(_0x17294c){logger['info']('CreateFaxQueueReport',_0x27cb72);logger[_0xafbe('0x18')]('CreateFaxQueueReport',_0x27cb72,JSON[_0xafbe('0xc')](_0x17294c));_0x5f2cdb(_0x17294c);})[_0xafbe('0x11')](function(_0x12876b){logger[_0xafbe('0xe')]('CreateFaxQueueReport',_0x12876b[_0xafbe('0xf')],_0x27cb72);_0x48208d(_0x4d8eee['error'](0x1f4,_0x12876b['message']));});});};exports['UpdateFaxQueueReport']=function(_0xcab1d5){var _0x5c9f5c=this;return new Promise(function(_0x584344,_0x2c99f1){return db[_0xafbe('0x13')]['update'](_0xcab1d5[_0xafbe('0x15')],{'raw':_0xcab1d5['options']?_0xcab1d5['options'][_0xafbe('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcab1d5[_0xafbe('0x16')]?_0xcab1d5[_0xafbe('0x16')][_0xafbe('0x1a')]||null:null,'attributes':_0xcab1d5[_0xafbe('0x16')]?_0xcab1d5['options'][_0xafbe('0x1b')]||null:null,'limit':_0xcab1d5[_0xafbe('0x16')]?_0xcab1d5['options'][_0xafbe('0x1c')]||null:null})[_0xafbe('0x17')](function(_0x400753){logger[_0xafbe('0x8')](_0xafbe('0x1d'),_0xcab1d5);logger[_0xafbe('0x18')](_0xafbe('0x1d'),_0xcab1d5,JSON[_0xafbe('0xc')](_0x400753));_0x584344(_0x400753);})[_0xafbe('0x11')](function(_0x48d917){logger['error'](_0xafbe('0x1d'),_0x48d917['message'],_0xcab1d5);_0x2c99f1(_0x5c9f5c['error'](0x1f4,_0x48d917[_0xafbe('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4cdd899..e7c4173 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 _0xc58a=['post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show'];(function(_0x1d9e40,_0x1c44db){var _0x2ee94f=function(_0x37a330){while(--_0x37a330){_0x1d9e40['push'](_0x1d9e40['shift']());}};_0x2ee94f(++_0x1c44db);}(_0xc58a,0x7e));var _0xac58=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xc58a[_0x817d9b];return _0x2752e1;};'use strict';var multer=require(_0xac58('0x0'));var util=require(_0xac58('0x1'));var path=require(_0xac58('0x2'));var timeout=require('connect-timeout');var express=require(_0xac58('0x3'));var router=express[_0xac58('0x4')]();var fs_extra=require(_0xac58('0x5'));var auth=require(_0xac58('0x6'));var interaction=require(_0xac58('0x7'));var config=require(_0xac58('0x8'));var controller=require('./faxQueueReport.controller');router[_0xac58('0x9')]('/',auth[_0xac58('0xa')](),controller['index']);router[_0xac58('0x9')](_0xac58('0xb'),auth[_0xac58('0xa')](),controller['describe']);router[_0xac58('0x9')](_0xac58('0xc'),auth[_0xac58('0xa')](),controller[_0xac58('0xd')]);router[_0xac58('0xe')]('/',auth[_0xac58('0xa')](),controller[_0xac58('0xf')]);router['put'](_0xac58('0xc'),auth['isAuthenticated'](),controller[_0xac58('0x10')]);router[_0xac58('0x11')]('/:id',auth[_0xac58('0xa')](),controller[_0xac58('0x12')]);module[_0xac58('0x13')]=router; \ No newline at end of file +var _0x4542=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','destroy','multer','util','path','connect-timeout'];(function(_0x293bfc,_0x9af21f){var _0x20ccec=function(_0x2d7611){while(--_0x2d7611){_0x293bfc['push'](_0x293bfc['shift']());}};_0x20ccec(++_0x9af21f);}(_0x4542,0x164));var _0x2454=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4542[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x2454('0x0'));var util=require(_0x2454('0x1'));var path=require(_0x2454('0x2'));var timeout=require(_0x2454('0x3'));var express=require('express');var router=express[_0x2454('0x4')]();var fs_extra=require(_0x2454('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2454('0x6'));var config=require(_0x2454('0x7'));var controller=require(_0x2454('0x8'));router[_0x2454('0x9')]('/',auth[_0x2454('0xa')](),controller[_0x2454('0xb')]);router[_0x2454('0x9')](_0x2454('0xc'),auth[_0x2454('0xa')](),controller[_0x2454('0xd')]);router['get'](_0x2454('0xe'),auth[_0x2454('0xa')](),controller['show']);router[_0x2454('0xf')]('/',auth[_0x2454('0xa')](),controller[_0x2454('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2454('0xe'),auth[_0x2454('0xa')](),controller[_0x2454('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index f01e7f8..426fc17 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x34e8,0x12c));var _0x834e=function(_0x20c3b0,_0x388156){_0x20c3b0=_0x20c3b0-0x0;var _0xd21910=_0x34e8[_0x20c3b0];return _0xd21910;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x406b75,_0x2aa72b){var _0x198625=function(_0x312a54){while(--_0x312a54){_0x406b75['push'](_0x406b75['shift']());}};_0x198625(++_0x2aa72b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x7a42d9,_0x5a0c72){_0x7a42d9=_0x7a42d9-0x0;var _0x278b78=_0xf3cd[_0x7a42d9];return _0x278b78;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0017a8f..6cd0eb1 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 _0xafe5=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','FaxTransferReport','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xafe5,0xfa));var _0x5afe=function(_0x4c990b,_0x8de7aa){_0x4c990b=_0x4c990b-0x0;var _0x5662be=_0xafe5[_0x4c990b];return _0x5662be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5afe('0x0'));var zipdir=require(_0x5afe('0x1'));var jsonpatch=require(_0x5afe('0x2'));var rp=require(_0x5afe('0x3'));var moment=require(_0x5afe('0x4'));var BPromise=require(_0x5afe('0x5'));var Mustache=require(_0x5afe('0x6'));var util=require(_0x5afe('0x7'));var path=require('path');var sox=require(_0x5afe('0x8'));var csv=require(_0x5afe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5afe('0xa'));var squel=require(_0x5afe('0xb'));var crypto=require(_0x5afe('0xc'));var jsforce=require(_0x5afe('0xd'));var deskjs=require(_0x5afe('0xe'));var toCsv=require(_0x5afe('0x9'));var querystring=require('querystring');var Papa=require(_0x5afe('0xf'));var Redis=require(_0x5afe('0x10'));var authService=require(_0x5afe('0x11'));var qs=require(_0x5afe('0x12'));var as=require(_0x5afe('0x13'));var hardwareService=require(_0x5afe('0x14'));var logger=require(_0x5afe('0x15'))(_0x5afe('0x16'));var utils=require(_0x5afe('0x17'));var config=require(_0x5afe('0x18'));var licenseUtil=require(_0x5afe('0x19'));var db=require(_0x5afe('0x1a'))['db'];function respondWithStatusCode(_0x1859c3,_0x202880){_0x202880=_0x202880||0xcc;return function(_0x20df6f){if(_0x20df6f){return _0x1859c3[_0x5afe('0x1b')](_0x202880);}return _0x1859c3[_0x5afe('0x1c')](_0x202880)[_0x5afe('0x1d')]();};}function respondWithResult(_0x527050,_0x2bf9bf){_0x2bf9bf=_0x2bf9bf||0xc8;return function(_0x69e299){if(_0x69e299){return _0x527050['status'](_0x2bf9bf)[_0x5afe('0x1e')](_0x69e299);}};}function respondWithFilteredResult(_0x23b0ac,_0x488bc2){return function(_0x53d76e){if(_0x53d76e){var _0x5a1ea2=typeof _0x488bc2[_0x5afe('0x1f')]===_0x5afe('0x20')&&typeof _0x488bc2[_0x5afe('0x21')]===_0x5afe('0x20');var _0x117500=_0x53d76e[_0x5afe('0x22')];var _0x745666=_0x5a1ea2?0x0:_0x488bc2[_0x5afe('0x1f')];var _0x2f4c17=_0x5a1ea2?_0x53d76e['count']:_0x488bc2[_0x5afe('0x1f')]+_0x488bc2[_0x5afe('0x21')];var _0xef4ab6;if(_0x2f4c17>=_0x117500){_0x2f4c17=_0x117500;_0xef4ab6=0xc8;}else{_0xef4ab6=0xce;}_0x23b0ac['status'](_0xef4ab6);return _0x23b0ac['set'](_0x5afe('0x23'),_0x745666+'-'+_0x2f4c17+'/'+_0x117500)[_0x5afe('0x1e')](_0x53d76e);}return null;};}function patchUpdates(_0x41e7d1){return function(_0xcdc5c6){try{jsonpatch[_0x5afe('0x24')](_0xcdc5c6,_0x41e7d1,!![]);}catch(_0x48a1b2){return BPromise['reject'](_0x48a1b2);}return _0xcdc5c6[_0x5afe('0x25')]();};}function saveUpdates(_0x4c02e7,_0x708707){return function(_0x3b1e6e){if(_0x3b1e6e){return _0x3b1e6e[_0x5afe('0x26')](_0x4c02e7)[_0x5afe('0x27')](function(_0x422929){return _0x422929;});}return null;};}function removeEntity(_0x1774ad,_0x427d8f){return function(_0x17fb78){if(_0x17fb78){return _0x17fb78[_0x5afe('0x28')]()['then'](function(){_0x1774ad[_0x5afe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a2c1d,_0x43cc81){return function(_0x51d722){if(!_0x51d722){_0x2a2c1d[_0x5afe('0x1b')](0x194);}return _0x51d722;};}function handleError(_0x2ff8a9,_0x4af2a9){_0x4af2a9=_0x4af2a9||0x1f4;return function(_0x2aef0d){logger[_0x5afe('0x29')](_0x2aef0d[_0x5afe('0x2a')]);if(_0x2aef0d[_0x5afe('0x2b')]){delete _0x2aef0d[_0x5afe('0x2b')];}_0x2ff8a9['status'](_0x4af2a9)['send'](_0x2aef0d);};}exports[_0x5afe('0x2c')]=function(_0x16725c,_0x21352e){var _0x3e4523={},_0x48a3ea={},_0x295832={'count':0x0,'rows':[]};var _0x372eb6=_[_0x5afe('0x2d')](db['FaxTransferReport'][_0x5afe('0x2e')],function(_0x564a68){return{'name':_0x564a68[_0x5afe('0x2f')],'type':_0x564a68['type'][_0x5afe('0x30')]};});_0x48a3ea[_0x5afe('0x31')]=_[_0x5afe('0x2d')](_0x372eb6,'name');_0x48a3ea[_0x5afe('0x32')]=_[_0x5afe('0x33')](_0x16725c[_0x5afe('0x32')]);_0x48a3ea[_0x5afe('0x34')]=_['intersection'](_0x48a3ea[_0x5afe('0x31')],_0x48a3ea[_0x5afe('0x32')]);_0x3e4523[_0x5afe('0x35')]=_[_0x5afe('0x36')](_0x48a3ea['model'],qs['fields'](_0x16725c[_0x5afe('0x32')][_0x5afe('0x37')]));_0x3e4523['attributes']=_0x3e4523[_0x5afe('0x35')]['length']?_0x3e4523[_0x5afe('0x35')]:_0x48a3ea[_0x5afe('0x31')];if(!_0x16725c[_0x5afe('0x32')][_0x5afe('0x38')](_0x5afe('0x39'))){_0x3e4523[_0x5afe('0x21')]=qs[_0x5afe('0x21')](_0x16725c[_0x5afe('0x32')][_0x5afe('0x21')]);_0x3e4523[_0x5afe('0x1f')]=qs[_0x5afe('0x1f')](_0x16725c['query']['offset']);}_0x3e4523[_0x5afe('0x3a')]=qs[_0x5afe('0x3b')](_0x16725c['query'][_0x5afe('0x3b')]);_0x3e4523[_0x5afe('0x3c')]=qs['filters'](_['pick'](_0x16725c[_0x5afe('0x32')],_0x48a3ea[_0x5afe('0x34')]),_0x372eb6);if(_0x16725c['query'][_0x5afe('0x3d')]){_0x3e4523[_0x5afe('0x3c')]=_[_0x5afe('0x3e')](_0x3e4523[_0x5afe('0x3c')],{'$or':_[_0x5afe('0x2d')](_0x372eb6,function(_0x12c186){if(_0x12c186['type']!=='VIRTUAL'){var _0x870040={};_0x870040[_0x12c186[_0x5afe('0x2b')]]={'$like':'%'+_0x16725c[_0x5afe('0x32')][_0x5afe('0x3d')]+'%'};return _0x870040;}})});}_0x3e4523=_[_0x5afe('0x3e')]({},_0x3e4523,_0x16725c[_0x5afe('0x3f')]);var _0x42e7dc={'where':_0x3e4523[_0x5afe('0x3c')]};return db[_0x5afe('0x40')][_0x5afe('0x22')](_0x42e7dc)[_0x5afe('0x27')](function(_0x1c54ee){_0x295832['count']=_0x1c54ee;if(_0x16725c['query']['includeAll']){_0x3e4523[_0x5afe('0x41')]=[{'all':!![]}];}return db[_0x5afe('0x40')][_0x5afe('0x42')](_0x3e4523);})[_0x5afe('0x27')](function(_0x5c86c0){_0x295832[_0x5afe('0x43')]=_0x5c86c0;return _0x295832;})[_0x5afe('0x27')](respondWithFilteredResult(_0x21352e,_0x3e4523))[_0x5afe('0x44')](handleError(_0x21352e,null));};exports[_0x5afe('0x45')]=function(_0x1ab066,_0x171cfc){var _0xe41749={'raw':!![],'where':{'id':_0x1ab066[_0x5afe('0x46')]['id']}},_0x916dcf={};_0x916dcf[_0x5afe('0x31')]=_['keys'](db['FaxTransferReport'][_0x5afe('0x2e')]);_0x916dcf['query']=_[_0x5afe('0x33')](_0x1ab066[_0x5afe('0x32')]);_0x916dcf['filters']=_['intersection'](_0x916dcf[_0x5afe('0x31')],_0x916dcf[_0x5afe('0x32')]);_0xe41749[_0x5afe('0x35')]=_['intersection'](_0x916dcf['model'],qs[_0x5afe('0x37')](_0x1ab066['query']['fields']));_0xe41749['attributes']=_0xe41749[_0x5afe('0x35')]['length']?_0xe41749[_0x5afe('0x35')]:_0x916dcf[_0x5afe('0x31')];if(_0x1ab066['query']['includeAll']){_0xe41749['include']=[{'all':!![]}];}_0xe41749=_[_0x5afe('0x3e')]({},_0xe41749,_0x1ab066['options']);return db[_0x5afe('0x40')][_0x5afe('0x47')](_0xe41749)['then'](handleEntityNotFound(_0x171cfc,null))['then'](respondWithResult(_0x171cfc,null))[_0x5afe('0x44')](handleError(_0x171cfc,null));};exports[_0x5afe('0x48')]=function(_0x1d9905,_0x23d6e0){return db[_0x5afe('0x40')][_0x5afe('0x48')](_0x1d9905['body'],{})['then'](respondWithResult(_0x23d6e0,0xc9))[_0x5afe('0x44')](handleError(_0x23d6e0,null));};exports['update']=function(_0x53dc4d,_0x23f37d){if(_0x53dc4d[_0x5afe('0x49')]['id']){delete _0x53dc4d[_0x5afe('0x49')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x53dc4d[_0x5afe('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f37d,null))[_0x5afe('0x27')](saveUpdates(_0x53dc4d['body'],null))[_0x5afe('0x27')](respondWithResult(_0x23f37d,null))[_0x5afe('0x44')](handleError(_0x23f37d,null));};exports[_0x5afe('0x28')]=function(_0x262f03,_0x96b440){return db[_0x5afe('0x40')][_0x5afe('0x47')]({'where':{'id':_0x262f03[_0x5afe('0x46')]['id']}})[_0x5afe('0x27')](handleEntityNotFound(_0x96b440,null))[_0x5afe('0x27')](removeEntity(_0x96b440,null))['catch'](handleError(_0x96b440,null));};exports[_0x5afe('0x4a')]=function(_0x20a646,_0x52f42e){return db[_0x5afe('0x40')][_0x5afe('0x4a')]()['then'](respondWithResult(_0x52f42e,null))[_0x5afe('0x44')](handleError(_0x52f42e,null));}; \ No newline at end of file +var _0x6ac7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','end','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxTransferReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x3813ad,_0x2eff01){var _0x16ed55=function(_0x406204){while(--_0x406204){_0x3813ad['push'](_0x3813ad['shift']());}};_0x16ed55(++_0x2eff01);}(_0x6ac7,0xd2));var _0x76ac=function(_0x45dad3,_0x2f1239){_0x45dad3=_0x45dad3-0x0;var _0x1b4594=_0x6ac7[_0x45dad3];return _0x1b4594;};'use strict';var emlformat=require(_0x76ac('0x0'));var rimraf=require(_0x76ac('0x1'));var zipdir=require(_0x76ac('0x2'));var jsonpatch=require(_0x76ac('0x3'));var rp=require(_0x76ac('0x4'));var moment=require('moment');var BPromise=require(_0x76ac('0x5'));var Mustache=require(_0x76ac('0x6'));var util=require('util');var path=require(_0x76ac('0x7'));var sox=require(_0x76ac('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76ac('0x9'));var _=require(_0x76ac('0xa'));var squel=require(_0x76ac('0xb'));var crypto=require('crypto');var jsforce=require(_0x76ac('0xc'));var deskjs=require(_0x76ac('0xd'));var toCsv=require(_0x76ac('0xe'));var querystring=require(_0x76ac('0xf'));var Papa=require(_0x76ac('0x10'));var Redis=require('ioredis');var authService=require(_0x76ac('0x11'));var qs=require(_0x76ac('0x12'));var as=require(_0x76ac('0x13'));var hardwareService=require(_0x76ac('0x14'));var logger=require(_0x76ac('0x15'))(_0x76ac('0x16'));var utils=require(_0x76ac('0x17'));var config=require(_0x76ac('0x18'));var licenseUtil=require(_0x76ac('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d522c,_0xcd9e93){_0xcd9e93=_0xcd9e93||0xcc;return function(_0x16f45d){if(_0x16f45d){return _0x1d522c['sendStatus'](_0xcd9e93);}return _0x1d522c['status'](_0xcd9e93)['end']();};}function respondWithResult(_0x5e6213,_0x31f839){_0x31f839=_0x31f839||0xc8;return function(_0x48bdd8){if(_0x48bdd8){return _0x5e6213['status'](_0x31f839)[_0x76ac('0x1a')](_0x48bdd8);}};}function respondWithFilteredResult(_0x4102b9,_0x26d423){return function(_0x4365f8){if(_0x4365f8){var _0x123d20=typeof _0x26d423[_0x76ac('0x1b')]===_0x76ac('0x1c')&&typeof _0x26d423[_0x76ac('0x1d')]==='undefined';var _0x16e530=_0x4365f8[_0x76ac('0x1e')];var _0x42c39f=_0x123d20?0x0:_0x26d423[_0x76ac('0x1b')];var _0x451fdc=_0x123d20?_0x4365f8[_0x76ac('0x1e')]:_0x26d423[_0x76ac('0x1b')]+_0x26d423[_0x76ac('0x1d')];var _0x436ebb;if(_0x451fdc>=_0x16e530){_0x451fdc=_0x16e530;_0x436ebb=0xc8;}else{_0x436ebb=0xce;}_0x4102b9[_0x76ac('0x1f')](_0x436ebb);return _0x4102b9[_0x76ac('0x20')](_0x76ac('0x21'),_0x42c39f+'-'+_0x451fdc+'/'+_0x16e530)[_0x76ac('0x1a')](_0x4365f8);}return null;};}function patchUpdates(_0x1fc9ad){return function(_0x1a2779){try{jsonpatch[_0x76ac('0x22')](_0x1a2779,_0x1fc9ad,!![]);}catch(_0x20f942){return BPromise['reject'](_0x20f942);}return _0x1a2779[_0x76ac('0x23')]();};}function saveUpdates(_0x93f589,_0x3790b0){return function(_0x3610cc){if(_0x3610cc){return _0x3610cc[_0x76ac('0x24')](_0x93f589)['then'](function(_0x2514c3){return _0x2514c3;});}return null;};}function removeEntity(_0x4be681,_0x127074){return function(_0x11885b){if(_0x11885b){return _0x11885b['destroy']()[_0x76ac('0x25')](function(){_0x4be681[_0x76ac('0x1f')](0xcc)[_0x76ac('0x26')]();});}};}function handleEntityNotFound(_0x4b148d,_0x1fd69e){return function(_0x7847e0){if(!_0x7847e0){_0x4b148d['sendStatus'](0x194);}return _0x7847e0;};}function handleError(_0x4a1694,_0x1dcf8b){_0x1dcf8b=_0x1dcf8b||0x1f4;return function(_0x1558b1){logger['error'](_0x1558b1[_0x76ac('0x27')]);if(_0x1558b1[_0x76ac('0x28')]){delete _0x1558b1[_0x76ac('0x28')];}_0x4a1694['status'](_0x1dcf8b)[_0x76ac('0x29')](_0x1558b1);};}exports[_0x76ac('0x2a')]=function(_0x5a7ba4,_0x533e54){var _0x23bfe8={},_0x4554c9={},_0x37883d={'count':0x0,'rows':[]};var _0x5e4650=_[_0x76ac('0x2b')](db['FaxTransferReport']['rawAttributes'],function(_0x157a50){return{'name':_0x157a50[_0x76ac('0x2c')],'type':_0x157a50[_0x76ac('0x2d')]['key']};});_0x4554c9[_0x76ac('0x2e')]=_[_0x76ac('0x2b')](_0x5e4650,_0x76ac('0x28'));_0x4554c9[_0x76ac('0x2f')]=_[_0x76ac('0x30')](_0x5a7ba4[_0x76ac('0x2f')]);_0x4554c9[_0x76ac('0x31')]=_[_0x76ac('0x32')](_0x4554c9[_0x76ac('0x2e')],_0x4554c9['query']);_0x23bfe8[_0x76ac('0x33')]=_[_0x76ac('0x32')](_0x4554c9[_0x76ac('0x2e')],qs['fields'](_0x5a7ba4[_0x76ac('0x2f')][_0x76ac('0x34')]));_0x23bfe8[_0x76ac('0x33')]=_0x23bfe8[_0x76ac('0x33')]['length']?_0x23bfe8[_0x76ac('0x33')]:_0x4554c9['model'];if(!_0x5a7ba4[_0x76ac('0x2f')]['hasOwnProperty'](_0x76ac('0x35'))){_0x23bfe8[_0x76ac('0x1d')]=qs[_0x76ac('0x1d')](_0x5a7ba4[_0x76ac('0x2f')][_0x76ac('0x1d')]);_0x23bfe8[_0x76ac('0x1b')]=qs['offset'](_0x5a7ba4['query']['offset']);}_0x23bfe8[_0x76ac('0x36')]=qs['sort'](_0x5a7ba4[_0x76ac('0x2f')][_0x76ac('0x37')]);_0x23bfe8[_0x76ac('0x38')]=qs[_0x76ac('0x31')](_[_0x76ac('0x39')](_0x5a7ba4[_0x76ac('0x2f')],_0x4554c9[_0x76ac('0x31')]),_0x5e4650);if(_0x5a7ba4[_0x76ac('0x2f')][_0x76ac('0x3a')]){_0x23bfe8[_0x76ac('0x38')]=_[_0x76ac('0x3b')](_0x23bfe8[_0x76ac('0x38')],{'$or':_[_0x76ac('0x2b')](_0x5e4650,function(_0x45b64d){if(_0x45b64d[_0x76ac('0x2d')]!==_0x76ac('0x3c')){var _0x425ca1={};_0x425ca1[_0x45b64d[_0x76ac('0x28')]]={'$like':'%'+_0x5a7ba4['query']['filter']+'%'};return _0x425ca1;}})});}_0x23bfe8=_['merge']({},_0x23bfe8,_0x5a7ba4[_0x76ac('0x3d')]);var _0x41068e={'where':_0x23bfe8[_0x76ac('0x38')]};return db['FaxTransferReport'][_0x76ac('0x1e')](_0x41068e)[_0x76ac('0x25')](function(_0xb9d9ab){_0x37883d[_0x76ac('0x1e')]=_0xb9d9ab;if(_0x5a7ba4[_0x76ac('0x2f')][_0x76ac('0x3e')]){_0x23bfe8[_0x76ac('0x3f')]=[{'all':!![]}];}return db[_0x76ac('0x40')][_0x76ac('0x41')](_0x23bfe8);})[_0x76ac('0x25')](function(_0x52192f){_0x37883d[_0x76ac('0x42')]=_0x52192f;return _0x37883d;})[_0x76ac('0x25')](respondWithFilteredResult(_0x533e54,_0x23bfe8))[_0x76ac('0x43')](handleError(_0x533e54,null));};exports[_0x76ac('0x44')]=function(_0x4c6946,_0x16737d){var _0xd8c887={'raw':!![],'where':{'id':_0x4c6946[_0x76ac('0x45')]['id']}},_0x2bc5c9={};_0x2bc5c9[_0x76ac('0x2e')]=_[_0x76ac('0x30')](db[_0x76ac('0x40')][_0x76ac('0x46')]);_0x2bc5c9['query']=_[_0x76ac('0x30')](_0x4c6946[_0x76ac('0x2f')]);_0x2bc5c9[_0x76ac('0x31')]=_[_0x76ac('0x32')](_0x2bc5c9[_0x76ac('0x2e')],_0x2bc5c9[_0x76ac('0x2f')]);_0xd8c887[_0x76ac('0x33')]=_[_0x76ac('0x32')](_0x2bc5c9[_0x76ac('0x2e')],qs[_0x76ac('0x34')](_0x4c6946[_0x76ac('0x2f')]['fields']));_0xd8c887[_0x76ac('0x33')]=_0xd8c887['attributes']['length']?_0xd8c887['attributes']:_0x2bc5c9[_0x76ac('0x2e')];if(_0x4c6946[_0x76ac('0x2f')][_0x76ac('0x3e')]){_0xd8c887[_0x76ac('0x3f')]=[{'all':!![]}];}_0xd8c887=_[_0x76ac('0x3b')]({},_0xd8c887,_0x4c6946[_0x76ac('0x3d')]);return db['FaxTransferReport'][_0x76ac('0x47')](_0xd8c887)['then'](handleEntityNotFound(_0x16737d,null))[_0x76ac('0x25')](respondWithResult(_0x16737d,null))['catch'](handleError(_0x16737d,null));};exports[_0x76ac('0x48')]=function(_0xdf9ca8,_0x3d1f96){return db[_0x76ac('0x40')][_0x76ac('0x48')](_0xdf9ca8[_0x76ac('0x49')],{})[_0x76ac('0x25')](respondWithResult(_0x3d1f96,0xc9))[_0x76ac('0x43')](handleError(_0x3d1f96,null));};exports[_0x76ac('0x24')]=function(_0x6f20ca,_0x221599){if(_0x6f20ca[_0x76ac('0x49')]['id']){delete _0x6f20ca['body']['id'];}return db[_0x76ac('0x40')][_0x76ac('0x47')]({'where':{'id':_0x6f20ca[_0x76ac('0x45')]['id']}})[_0x76ac('0x25')](handleEntityNotFound(_0x221599,null))['then'](saveUpdates(_0x6f20ca[_0x76ac('0x49')],null))['then'](respondWithResult(_0x221599,null))[_0x76ac('0x43')](handleError(_0x221599,null));};exports[_0x76ac('0x4a')]=function(_0x575db,_0x4a35e7){return db[_0x76ac('0x40')][_0x76ac('0x47')]({'where':{'id':_0x575db[_0x76ac('0x45')]['id']}})[_0x76ac('0x25')](handleEntityNotFound(_0x4a35e7,null))[_0x76ac('0x25')](removeEntity(_0x4a35e7,null))[_0x76ac('0x43')](handleError(_0x4a35e7,null));};exports[_0x76ac('0x4b')]=function(_0x393a2f,_0x47053f){return db['FaxTransferReport'][_0x76ac('0x4b')]()[_0x76ac('0x25')](respondWithResult(_0x47053f,null))[_0x76ac('0x43')](handleError(_0x47053f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a003439..c3cbf7e 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 _0xca8a=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xca8a,0xa3));var _0xaca8=function(_0x30e8a9,_0x3e2724){_0x30e8a9=_0x30e8a9-0x0;var _0x196db3=_0xca8a[_0x30e8a9];return _0x196db3;};'use strict';var _=require(_0xaca8('0x0'));var util=require('util');var logger=require(_0xaca8('0x1'))(_0xaca8('0x2'));var moment=require('moment');var BPromise=require(_0xaca8('0x3'));var rp=require(_0xaca8('0x4'));var fs=require('fs');var path=require(_0xaca8('0x5'));var rimraf=require('rimraf');var config=require(_0xaca8('0x6'));var attributes=require(_0xaca8('0x7'));module[_0xaca8('0x8')]=function(_0x4bef6d,_0x394872){return _0x4bef6d[_0xaca8('0x9')](_0xaca8('0xa'),attributes,{'tableName':_0xaca8('0xb'),'paranoid':![],'indexes':[{'name':_0xaca8('0xc'),'fields':[_0xaca8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd501=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0xd501,0x135));var _0x1d50=function(_0x5cf7af,_0x272d9e){_0x5cf7af=_0x5cf7af-0x0;var _0x413a00=_0xd501[_0x5cf7af];return _0x413a00;};'use strict';var _=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var logger=require(_0x1d50('0x2'))(_0x1d50('0x3'));var moment=require(_0x1d50('0x4'));var BPromise=require(_0x1d50('0x5'));var rp=require(_0x1d50('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d50('0x7'));var config=require(_0x1d50('0x8'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x2a5088,_0x1129df){return _0x2a5088[_0x1d50('0x9')]('FaxTransferReport',attributes,{'tableName':_0x1d50('0xa'),'paranoid':![],'indexes':[{'name':_0x1d50('0xb'),'fields':[_0x1d50('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2d1cffe..4a66a33 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 _0xc9c0=['../../config/environment','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2e5a1f,_0x17ed81){var _0x4b10ce=function(_0x12cd89){while(--_0x12cd89){_0x2e5a1f['push'](_0x2e5a1f['shift']());}};_0x4b10ce(++_0x17ed81);}(_0xc9c0,0xab));var _0x0c9c=function(_0x479285,_0x1aebf8){_0x479285=_0x479285-0x0;var _0x4963fa=_0xc9c0[_0x479285];return _0x4963fa;};'use strict';var _=require('lodash');var util=require(_0x0c9c('0x0'));var moment=require(_0x0c9c('0x1'));var BPromise=require(_0x0c9c('0x2'));var rs=require(_0x0c9c('0x3'));var fs=require('fs');var Redis=require(_0x0c9c('0x4'));var db=require(_0x0c9c('0x5'))['db'];var utils=require(_0x0c9c('0x6'));var logger=require(_0x0c9c('0x7'))(_0x0c9c('0x8'));var config=require(_0x0c9c('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1e73,_0xc4d3b2,_0x2f25e6){return new BPromise(function(_0x52420d,_0x9d19d1){return client['request'](_0x4f1e73,_0x2f25e6)[_0x0c9c('0xa')](function(_0x347021){logger['info'](_0x0c9c('0xb'),_0xc4d3b2,_0x0c9c('0xc'));logger[_0x0c9c('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xc4d3b2,_0x0c9c('0xc'),JSON['stringify'](_0x347021));if(_0x347021['error']){if(_0x347021[_0x0c9c('0xe')][_0x0c9c('0xf')]===0x1f4){logger['error'](_0x0c9c('0xb'),_0xc4d3b2,_0x347021['error'][_0x0c9c('0x10')]);return _0x9d19d1(_0x347021[_0x0c9c('0xe')][_0x0c9c('0x10')]);}logger[_0x0c9c('0xe')](_0x0c9c('0xb'),_0xc4d3b2,_0x347021[_0x0c9c('0xe')][_0x0c9c('0x10')]);return _0x52420d(_0x347021[_0x0c9c('0xe')][_0x0c9c('0x10')]);}else{logger[_0x0c9c('0x11')](_0x0c9c('0xb'),_0xc4d3b2,_0x0c9c('0xc'));_0x52420d(_0x347021['result'][_0x0c9c('0x10')]);}})['catch'](function(_0x928b36){logger['error'](_0x0c9c('0xb'),_0xc4d3b2,_0x928b36);_0x9d19d1(_0x928b36);});});} \ No newline at end of file +var _0x0770=['code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x0770,0x12a));var _0x0077=function(_0x53d816,_0x1d1594){_0x53d816=_0x53d816-0x0;var _0x17c9ed=_0x0770[_0x53d816];return _0x17c9ed;};'use strict';var _=require('lodash');var util=require(_0x0077('0x0'));var moment=require(_0x0077('0x1'));var BPromise=require(_0x0077('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0077('0x3'))['db'];var utils=require(_0x0077('0x4'));var logger=require('../../config/logger')(_0x0077('0x5'));var config=require(_0x0077('0x6'));var jayson=require(_0x0077('0x7'));var client=jayson[_0x0077('0x8')][_0x0077('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c131b,_0x1351a6,_0x2b8181){return new BPromise(function(_0x211da3,_0x1f4695){return client[_0x0077('0xa')](_0x3c131b,_0x2b8181)['then'](function(_0x1ba618){logger[_0x0077('0xb')](_0x0077('0xc'),_0x1351a6,_0x0077('0xd'));logger['debug'](_0x0077('0xe'),_0x1351a6,_0x0077('0xd'),JSON[_0x0077('0xf')](_0x1ba618));if(_0x1ba618[_0x0077('0x10')]){if(_0x1ba618[_0x0077('0x10')][_0x0077('0x11')]===0x1f4){logger['error'](_0x0077('0xc'),_0x1351a6,_0x1ba618[_0x0077('0x10')][_0x0077('0x12')]);return _0x1f4695(_0x1ba618[_0x0077('0x10')][_0x0077('0x12')]);}logger[_0x0077('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1351a6,_0x1ba618[_0x0077('0x10')]['message']);return _0x211da3(_0x1ba618[_0x0077('0x10')]['message']);}else{logger[_0x0077('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x1351a6,'request\x20sent');_0x211da3(_0x1ba618[_0x0077('0x13')][_0x0077('0x12')]);}})[_0x0077('0x14')](function(_0xe8779f){logger[_0x0077('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1351a6,_0xe8779f);_0x1f4695(_0xe8779f);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 9e2eaed..e8b6e54 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 _0x5591=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','show','post','create','put'];(function(_0x182086,_0x37b729){var _0x44b4ce=function(_0x20310d){while(--_0x20310d){_0x182086['push'](_0x182086['shift']());}};_0x44b4ce(++_0x37b729);}(_0x5591,0x194));var _0x1559=function(_0x9c08ca,_0x4d3960){_0x9c08ca=_0x9c08ca-0x0;var _0x26541e=_0x5591[_0x9c08ca];return _0x26541e;};'use strict';var multer=require(_0x1559('0x0'));var util=require(_0x1559('0x1'));var path=require(_0x1559('0x2'));var timeout=require(_0x1559('0x3'));var express=require(_0x1559('0x4'));var router=express['Router']();var fs_extra=require(_0x1559('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1559('0x6'));var config=require(_0x1559('0x7'));var controller=require(_0x1559('0x8'));router[_0x1559('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1559('0x9')]('/describe',auth[_0x1559('0xa')](),controller[_0x1559('0xb')]);router[_0x1559('0x9')]('/:id',auth[_0x1559('0xa')](),controller[_0x1559('0xc')]);router[_0x1559('0xd')]('/',auth[_0x1559('0xa')](),controller[_0x1559('0xe')]);router[_0x1559('0xf')](_0x1559('0x10'),auth[_0x1559('0xa')](),controller[_0x1559('0x11')]);router[_0x1559('0x12')](_0x1559('0x10'),auth[_0x1559('0xa')](),controller[_0x1559('0x13')]);module[_0x1559('0x14')]=router; \ No newline at end of file +var _0x9e86=['create','put','update','delete','destroy','util','path','Router','fs-extra','../../components/interaction/service','get','index','describe','/:id','isAuthenticated','post'];(function(_0x1dd528,_0x393eea){var _0x5aeb47=function(_0x284f2d){while(--_0x284f2d){_0x1dd528['push'](_0x1dd528['shift']());}};_0x5aeb47(++_0x393eea);}(_0x9e86,0x185));var _0x69e8=function(_0x87797,_0x4f8d31){_0x87797=_0x87797-0x0;var _0x5285ee=_0x9e86[_0x87797];return _0x5285ee;};'use strict';var multer=require('multer');var util=require(_0x69e8('0x0'));var path=require(_0x69e8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x69e8('0x2')]();var fs_extra=require(_0x69e8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x69e8('0x4'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x69e8('0x5')]('/',auth['isAuthenticated'](),controller[_0x69e8('0x6')]);router[_0x69e8('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x69e8('0x7')]);router[_0x69e8('0x5')](_0x69e8('0x8'),auth[_0x69e8('0x9')](),controller['show']);router[_0x69e8('0xa')]('/',auth[_0x69e8('0x9')](),controller[_0x69e8('0xb')]);router[_0x69e8('0xc')](_0x69e8('0x8'),auth[_0x69e8('0x9')](),controller[_0x69e8('0xd')]);router[_0x69e8('0xe')]('/:id',auth[_0x69e8('0x9')](),controller[_0x69e8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2593f20..794f65d 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 _0x2276=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','/:id','delete'];(function(_0x4ee090,_0x2c620b){var _0x51c91c=function(_0x4c9697){while(--_0x4c9697){_0x4ee090['push'](_0x4ee090['shift']());}};_0x51c91c(++_0x2c620b);}(_0x2276,0x16a));var _0x6227=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0x2276[_0x1cfc39];return _0x957a28;};'use strict';var multer=require(_0x6227('0x0'));var util=require(_0x6227('0x1'));var path=require(_0x6227('0x2'));var timeout=require(_0x6227('0x3'));var express=require(_0x6227('0x4'));var router=express[_0x6227('0x5')]();var fs_extra=require(_0x6227('0x6'));var auth=require(_0x6227('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6227('0x8'));var controller=require(_0x6227('0x9'));router[_0x6227('0xa')]('/',auth['isAuthenticated'](),controller[_0x6227('0xb')]);router['get']('/:id',auth[_0x6227('0xc')](),controller[_0x6227('0xd')]);router[_0x6227('0xa')](_0x6227('0xe'),auth[_0x6227('0xc')](),controller[_0x6227('0xf')]);router['get']('/:id/fields',auth[_0x6227('0xc')](),controller[_0x6227('0x10')]);router['post']('/',auth[_0x6227('0xc')](),controller[_0x6227('0x11')]);router[_0x6227('0x12')](_0x6227('0xe'),auth[_0x6227('0xc')](),controller[_0x6227('0x13')]);router['put'](_0x6227('0x14'),auth[_0x6227('0xc')](),controller['update']);router[_0x6227('0x15')](_0x6227('0x14'),auth[_0x6227('0xc')](),controller[_0x6227('0x16')]);module[_0x6227('0x17')]=router; \ No newline at end of file +var _0x2aef=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x14f07a,_0x4d21be){var _0x5c80b7=function(_0x39ce49){while(--_0x39ce49){_0x14f07a['push'](_0x14f07a['shift']());}};_0x5c80b7(++_0x4d21be);}(_0x2aef,0x1f1));var _0xf2ae=function(_0x1a0901,_0x39bcf4){_0x1a0901=_0x1a0901-0x0;var _0x52e9cd=_0x2aef[_0x1a0901];return _0x52e9cd;};'use strict';var multer=require(_0xf2ae('0x0'));var util=require('util');var path=require(_0xf2ae('0x1'));var timeout=require(_0xf2ae('0x2'));var express=require(_0xf2ae('0x3'));var router=express['Router']();var fs_extra=require(_0xf2ae('0x4'));var auth=require(_0xf2ae('0x5'));var interaction=require(_0xf2ae('0x6'));var config=require(_0xf2ae('0x7'));var controller=require(_0xf2ae('0x8'));router['get']('/',auth[_0xf2ae('0x9')](),controller[_0xf2ae('0xa')]);router[_0xf2ae('0xb')](_0xf2ae('0xc'),auth[_0xf2ae('0x9')](),controller[_0xf2ae('0xd')]);router[_0xf2ae('0xb')](_0xf2ae('0xe'),auth[_0xf2ae('0x9')](),controller[_0xf2ae('0xf')]);router['get'](_0xf2ae('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0xf2ae('0x11')]('/',auth[_0xf2ae('0x9')](),controller[_0xf2ae('0x12')]);router[_0xf2ae('0x11')](_0xf2ae('0xe'),auth[_0xf2ae('0x9')](),controller[_0xf2ae('0x13')]);router['put'](_0xf2ae('0xc'),auth[_0xf2ae('0x9')](),controller[_0xf2ae('0x14')]);router[_0xf2ae('0x15')](_0xf2ae('0xc'),auth[_0xf2ae('0x9')](),controller['destroy']);module[_0xf2ae('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index a22fa97..09df388 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 _0x9b3e=['basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x573dfb,_0x27d49d){var _0x5cdb59=function(_0x4b09ce){while(--_0x4b09ce){_0x573dfb['push'](_0x573dfb['shift']());}};_0x5cdb59(++_0x27d49d);}(_0x9b3e,0x177));var _0xe9b3=function(_0x433c04,_0x26a3bf){_0x433c04=_0x433c04-0x0;var _0x1a07a3=_0x9b3e[_0x433c04];return _0x1a07a3;};'use strict';var Sequelize=require(_0xe9b3('0x0'));module[_0xe9b3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9b3('0x2')]},'username':{'type':Sequelize[_0xe9b3('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xe9b3('0x3')},'password':{'type':Sequelize[_0xe9b3('0x2')]},'consumerKey':{'type':Sequelize[_0xe9b3('0x2')]},'consumerSecret':{'type':Sequelize[_0xe9b3('0x2')]},'token':{'type':Sequelize[_0xe9b3('0x2')]},'tokenSecret':{'type':Sequelize[_0xe9b3('0x2')]},'serverUrl':{'type':Sequelize[_0xe9b3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9b3('0x4'),_0xe9b3('0x5')),'defaultValue':_0xe9b3('0x4')}}; \ No newline at end of file +var _0x4587=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x557b0e,_0x4cb914){var _0x437a9f=function(_0x7b93e0){while(--_0x7b93e0){_0x557b0e['push'](_0x557b0e['shift']());}};_0x437a9f(++_0x4cb914);}(_0x4587,0x10e));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7458('0x0'));module[_0x7458('0x1')]={'name':{'type':Sequelize[_0x7458('0x2')]},'description':{'type':Sequelize[_0x7458('0x2')]},'username':{'type':Sequelize[_0x7458('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x7458('0x3')),'defaultValue':_0x7458('0x3')},'password':{'type':Sequelize[_0x7458('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x7458('0x2')]},'serverUrl':{'type':Sequelize[_0x7458('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7458('0x4')](_0x7458('0x5'),_0x7458('0x6')),'defaultValue':_0x7458('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index cbb49bd..9568028 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 _0x6c19=['zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','Content-Range','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','DeskAccount','includeAll','catch','show','params','keys','include','create','body','find','getConfigurations','findOne','DeskConfiguration','pick','limit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf'];(function(_0x4372f9,_0x1c8338){var _0x2e57b8=function(_0x5e4991){while(--_0x5e4991){_0x4372f9['push'](_0x4372f9['shift']());}};_0x2e57b8(++_0x1c8338);}(_0x6c19,0xe6));var _0x96c1=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x6c19[_0x57975f];return _0x4793b8;};'use strict';var emlformat=require(_0x96c1('0x0'));var rimraf=require(_0x96c1('0x1'));var zipdir=require(_0x96c1('0x2'));var jsonpatch=require(_0x96c1('0x3'));var rp=require(_0x96c1('0x4'));var moment=require(_0x96c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x96c1('0x6'));var util=require('util');var path=require(_0x96c1('0x7'));var sox=require(_0x96c1('0x8'));var csv=require(_0x96c1('0x9'));var ejs=require(_0x96c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96c1('0xb'));var squel=require('squel');var crypto=require(_0x96c1('0xc'));var jsforce=require(_0x96c1('0xd'));var deskjs=require(_0x96c1('0xe'));var toCsv=require(_0x96c1('0x9'));var querystring=require(_0x96c1('0xf'));var Papa=require('papaparse');var Redis=require(_0x96c1('0x10'));var authService=require(_0x96c1('0x11'));var qs=require(_0x96c1('0x12'));var as=require(_0x96c1('0x13'));var hardwareService=require(_0x96c1('0x14'));var logger=require(_0x96c1('0x15'))('api');var utils=require(_0x96c1('0x16'));var config=require(_0x96c1('0x17'));var licenseUtil=require(_0x96c1('0x18'));var db=require(_0x96c1('0x19'))['db'];var integrations=require(_0x96c1('0x1a'));function respondWithStatusCode(_0x240e19,_0x4d21b1){_0x4d21b1=_0x4d21b1||0xcc;return function(_0x1fac16){if(_0x1fac16){return _0x240e19[_0x96c1('0x1b')](_0x4d21b1);}return _0x240e19[_0x96c1('0x1c')](_0x4d21b1)['end']();};}function respondWithResult(_0xd180d2,_0xe184d){_0xe184d=_0xe184d||0xc8;return function(_0x3a0d1d){if(_0x3a0d1d){return _0xd180d2['status'](_0xe184d)[_0x96c1('0x1d')](_0x3a0d1d);}};}function respondWithFilteredResult(_0x3dc4e2,_0x430ff2){return function(_0x836bfe){if(_0x836bfe){var _0x20f645=typeof _0x430ff2[_0x96c1('0x1e')]===_0x96c1('0x1f')&&typeof _0x430ff2['limit']===_0x96c1('0x1f');var _0x4f39a3=_0x836bfe[_0x96c1('0x20')];var _0x44aa94=_0x20f645?0x0:_0x430ff2[_0x96c1('0x1e')];var _0x4432c9=_0x20f645?_0x836bfe[_0x96c1('0x20')]:_0x430ff2[_0x96c1('0x1e')]+_0x430ff2['limit'];var _0x59c832;if(_0x4432c9>=_0x4f39a3){_0x4432c9=_0x4f39a3;_0x59c832=0xc8;}else{_0x59c832=0xce;}_0x3dc4e2[_0x96c1('0x1c')](_0x59c832);return _0x3dc4e2['set'](_0x96c1('0x21'),_0x44aa94+'-'+_0x4432c9+'/'+_0x4f39a3)['json'](_0x836bfe);}return null;};}function patchUpdates(_0x2e831e){return function(_0x417d07){try{jsonpatch['apply'](_0x417d07,_0x2e831e,!![]);}catch(_0x557df8){return BPromise['reject'](_0x557df8);}return _0x417d07[_0x96c1('0x22')]();};}function saveUpdates(_0xd20659,_0xfd8141){return function(_0x4e8cb6){if(_0x4e8cb6){return _0x4e8cb6[_0x96c1('0x23')](_0xd20659)[_0x96c1('0x24')](function(_0x23221c){return _0x23221c;});}return null;};}function removeEntity(_0x3f644d,_0x2df368){return function(_0x3cf032){if(_0x3cf032){return _0x3cf032[_0x96c1('0x25')]()[_0x96c1('0x24')](function(){_0x3f644d[_0x96c1('0x1c')](0xcc)[_0x96c1('0x26')]();});}};}function handleEntityNotFound(_0x53d7ee,_0x302275){return function(_0x5a9a69){if(!_0x5a9a69){_0x53d7ee[_0x96c1('0x1b')](0x194);}return _0x5a9a69;};}function handleError(_0x51bc96,_0x3e1a4b){_0x3e1a4b=_0x3e1a4b||0x1f4;return function(_0x3af401){logger[_0x96c1('0x27')](_0x3af401[_0x96c1('0x28')]);if(_0x3af401[_0x96c1('0x29')]){delete _0x3af401['name'];}_0x51bc96[_0x96c1('0x1c')](_0x3e1a4b)['send'](_0x3af401);};}exports[_0x96c1('0x2a')]=function(_0x578243,_0x194dc7){var _0x2c73b9={},_0x41cb1c={},_0x482b45={'count':0x0,'rows':[]};var _0x56ead0=_[_0x96c1('0x2b')](db['DeskAccount'][_0x96c1('0x2c')],function(_0x597d18){return{'name':_0x597d18[_0x96c1('0x2d')],'type':_0x597d18['type']['key']};});_0x41cb1c['model']=_[_0x96c1('0x2b')](_0x56ead0,_0x96c1('0x29'));_0x41cb1c[_0x96c1('0x2e')]=_['keys'](_0x578243[_0x96c1('0x2e')]);_0x41cb1c[_0x96c1('0x2f')]=_['intersection'](_0x41cb1c['model'],_0x41cb1c[_0x96c1('0x2e')]);_0x2c73b9['attributes']=_[_0x96c1('0x30')](_0x41cb1c[_0x96c1('0x31')],qs[_0x96c1('0x32')](_0x578243['query'][_0x96c1('0x32')]));_0x2c73b9[_0x96c1('0x33')]=_0x2c73b9[_0x96c1('0x33')][_0x96c1('0x34')]?_0x2c73b9[_0x96c1('0x33')]:_0x41cb1c[_0x96c1('0x31')];if(!_0x578243[_0x96c1('0x2e')][_0x96c1('0x35')](_0x96c1('0x36'))){_0x2c73b9['limit']=qs['limit'](_0x578243[_0x96c1('0x2e')]['limit']);_0x2c73b9[_0x96c1('0x1e')]=qs['offset'](_0x578243[_0x96c1('0x2e')]['offset']);}_0x2c73b9[_0x96c1('0x37')]=qs[_0x96c1('0x38')](_0x578243[_0x96c1('0x2e')][_0x96c1('0x38')]);_0x2c73b9[_0x96c1('0x39')]=qs['filters'](_['pick'](_0x578243['query'],_0x41cb1c['filters']),_0x56ead0);if(_0x578243[_0x96c1('0x2e')]['filter']){_0x2c73b9['where']=_[_0x96c1('0x3a')](_0x2c73b9[_0x96c1('0x39')],{'$or':_[_0x96c1('0x2b')](_0x56ead0,function(_0x3e82c5){if(_0x3e82c5[_0x96c1('0x3b')]!==_0x96c1('0x3c')){var _0x480bff={};_0x480bff[_0x3e82c5[_0x96c1('0x29')]]={'$like':'%'+_0x578243[_0x96c1('0x2e')][_0x96c1('0x3d')]+'%'};return _0x480bff;}})});}_0x2c73b9=_[_0x96c1('0x3a')]({},_0x2c73b9,_0x578243['options']);var _0x16a2ca={'where':_0x2c73b9['where']};return db[_0x96c1('0x3e')]['count'](_0x16a2ca)['then'](function(_0x2ebeb1){_0x482b45[_0x96c1('0x20')]=_0x2ebeb1;if(_0x578243[_0x96c1('0x2e')][_0x96c1('0x3f')]){_0x2c73b9['include']=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2c73b9);})[_0x96c1('0x24')](function(_0x137fc4){_0x482b45['rows']=_0x137fc4;return _0x482b45;})['then'](respondWithFilteredResult(_0x194dc7,_0x2c73b9))[_0x96c1('0x40')](handleError(_0x194dc7,null));};exports[_0x96c1('0x41')]=function(_0xf5d709,_0xc1831b){var _0x274dba={'raw':![],'where':{'id':_0xf5d709[_0x96c1('0x42')]['id']}},_0x525ad0={};_0x525ad0[_0x96c1('0x31')]=_[_0x96c1('0x43')](db[_0x96c1('0x3e')][_0x96c1('0x2c')]);_0x525ad0[_0x96c1('0x2e')]=_['keys'](_0xf5d709['query']);_0x525ad0[_0x96c1('0x2f')]=_[_0x96c1('0x30')](_0x525ad0[_0x96c1('0x31')],_0x525ad0['query']);_0x274dba[_0x96c1('0x33')]=_[_0x96c1('0x30')](_0x525ad0['model'],qs[_0x96c1('0x32')](_0xf5d709[_0x96c1('0x2e')][_0x96c1('0x32')]));_0x274dba[_0x96c1('0x33')]=_0x274dba[_0x96c1('0x33')]['length']?_0x274dba['attributes']:_0x525ad0[_0x96c1('0x31')];if(_0xf5d709[_0x96c1('0x2e')]['includeAll']){_0x274dba[_0x96c1('0x44')]=[{'all':!![]}];}_0x274dba=_[_0x96c1('0x3a')]({},_0x274dba,_0xf5d709['options']);return db[_0x96c1('0x3e')]['find'](_0x274dba)[_0x96c1('0x24')](handleEntityNotFound(_0xc1831b,null))['then'](respondWithResult(_0xc1831b,null))[_0x96c1('0x40')](handleError(_0xc1831b,null));};exports[_0x96c1('0x45')]=function(_0x503ee2,_0x2699db){return db[_0x96c1('0x3e')][_0x96c1('0x45')](_0x503ee2['body'],{})['then'](respondWithResult(_0x2699db,0xc9))[_0x96c1('0x40')](handleError(_0x2699db,null));};exports[_0x96c1('0x23')]=function(_0x490069,_0x448efc){if(_0x490069['body']['id']){delete _0x490069[_0x96c1('0x46')]['id'];}return db['DeskAccount'][_0x96c1('0x47')]({'where':{'id':_0x490069['params']['id']}})[_0x96c1('0x24')](handleEntityNotFound(_0x448efc,null))[_0x96c1('0x24')](saveUpdates(_0x490069[_0x96c1('0x46')],null))[_0x96c1('0x24')](respondWithResult(_0x448efc,null))['catch'](handleError(_0x448efc,null));};exports[_0x96c1('0x25')]=function(_0x56cebc,_0x5b24ff){return db[_0x96c1('0x3e')][_0x96c1('0x47')]({'where':{'id':_0x56cebc[_0x96c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b24ff,null))['then'](removeEntity(_0x5b24ff,null))['catch'](handleError(_0x5b24ff,null));};exports[_0x96c1('0x48')]=function(_0x3ff014,_0x3991b4,_0xaf50bf){var _0xbdaa42={};var _0x34e8f1={};var _0x2be424;var _0x323baa;return db[_0x96c1('0x3e')][_0x96c1('0x49')]({'where':{'id':_0x3ff014[_0x96c1('0x42')]['id']}})[_0x96c1('0x24')](handleEntityNotFound(_0x3991b4,null))['then'](function(_0xdfe90a){if(_0xdfe90a){_0x2be424=_0xdfe90a;_0x34e8f1['model']=_[_0x96c1('0x43')](db[_0x96c1('0x4a')][_0x96c1('0x2c')]);_0x34e8f1[_0x96c1('0x2e')]=_[_0x96c1('0x43')](_0x3ff014[_0x96c1('0x2e')]);_0x34e8f1[_0x96c1('0x2f')]=_['intersection'](_0x34e8f1[_0x96c1('0x31')],_0x34e8f1[_0x96c1('0x2e')]);_0xbdaa42['attributes']=_[_0x96c1('0x30')](_0x34e8f1[_0x96c1('0x31')],qs[_0x96c1('0x32')](_0x3ff014['query'][_0x96c1('0x32')]));_0xbdaa42[_0x96c1('0x33')]=_0xbdaa42[_0x96c1('0x33')][_0x96c1('0x34')]?_0xbdaa42[_0x96c1('0x33')]:_0x34e8f1[_0x96c1('0x31')];_0xbdaa42[_0x96c1('0x37')]=qs[_0x96c1('0x38')](_0x3ff014['query'][_0x96c1('0x38')]);_0xbdaa42['where']=qs[_0x96c1('0x2f')](_[_0x96c1('0x4b')](_0x3ff014[_0x96c1('0x2e')],_0x34e8f1[_0x96c1('0x2f')]));if(_0x3ff014[_0x96c1('0x2e')][_0x96c1('0x3d')]){_0xbdaa42[_0x96c1('0x39')]=_['merge'](_0xbdaa42[_0x96c1('0x39')],{'$or':_['map'](_0xbdaa42[_0x96c1('0x33')],function(_0x3d5bc1){var _0x15c29b={};_0x15c29b[_0x3d5bc1]={'$like':'%'+_0x3ff014[_0x96c1('0x2e')]['filter']+'%'};return _0x15c29b;})});}_0xbdaa42=_[_0x96c1('0x3a')]({},_0xbdaa42,_0x3ff014['options']);return _0x2be424[_0x96c1('0x48')](_0xbdaa42);}})[_0x96c1('0x24')](function(_0x10fea9){if(_0x10fea9){_0x323baa=_0x10fea9[_0x96c1('0x34')];if(!_0x3ff014[_0x96c1('0x2e')][_0x96c1('0x35')](_0x96c1('0x36'))){_0xbdaa42[_0x96c1('0x4c')]=qs['limit'](_0x3ff014[_0x96c1('0x2e')]['limit']);_0xbdaa42[_0x96c1('0x1e')]=qs['offset'](_0x3ff014['query'][_0x96c1('0x1e')]);}return _0x2be424[_0x96c1('0x48')](_0xbdaa42);}})['then'](function(_0xea5652){if(_0xea5652){return _0xea5652?{'count':_0x323baa,'rows':_0xea5652}:null;}})[_0x96c1('0x24')](respondWithResult(_0x3991b4,null))[_0x96c1('0x40')](handleError(_0x3991b4,null));};exports[_0x96c1('0x4d')]=function(_0x37e5c7,_0x5d67d3,_0x50a00b){if(_0x37e5c7[_0x96c1('0x46')]['id']){delete _0x37e5c7[_0x96c1('0x46')]['id'];}return db[_0x96c1('0x3e')][_0x96c1('0x49')]({'where':{'id':_0x37e5c7[_0x96c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d67d3,null))[_0x96c1('0x24')](function(_0x403300){if(_0x403300){_0x37e5c7[_0x96c1('0x46')][_0x96c1('0x4e')]=_0x403300['id'];_0x37e5c7['body'][_0x96c1('0x4f')]=integrations[_0x96c1('0x50')](_0x37e5c7[_0x96c1('0x46')]['channel'],_0x37e5c7[_0x96c1('0x46')][_0x96c1('0x3b')]);_0x37e5c7[_0x96c1('0x46')][_0x96c1('0x51')]=integrations['getDescriptions'](_0x37e5c7[_0x96c1('0x46')][_0x96c1('0x52')],_0x37e5c7[_0x96c1('0x46')][_0x96c1('0x3b')]);return db[_0x96c1('0x4a')]['create'](_0x37e5c7[_0x96c1('0x46')],{'include':[{'model':db[_0x96c1('0x53')],'as':_0x96c1('0x4f')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5d67d3,null))[_0x96c1('0x40')](handleError(_0x5d67d3,null));};exports[_0x96c1('0x54')]=function(_0x2a8da5,_0x4e664b,_0x1f24dc){var _0x54a4d5=[{'name':_0x96c1('0x55'),'label':_0x96c1('0x55'),'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 _0x3ea35c='';return db[_0x96c1('0x3e')][_0x96c1('0x49')]({'where':{'id':_0x2a8da5['params']['id']},'attributes':['id','remoteUri',_0x96c1('0x56'),_0x96c1('0x57'),_0x96c1('0x58'),_0x96c1('0x59'),_0x96c1('0x5a'),'token',_0x96c1('0x5b')]})[_0x96c1('0x24')](handleEntityNotFound(_0x4e664b,null))[_0x96c1('0x24')](function(_0x32e9fb){if(_0x32e9fb){_0x3ea35c=_0x32e9fb['remoteUri'];var _0x2cbce7=_0x3ea35c[_0x96c1('0x5c')](-0x1);if(_0x2cbce7==='/'){_0x3ea35c=_0x3ea35c[_0x96c1('0x5d')](0x0,_0x3ea35c[_0x96c1('0x5e')](_0x2cbce7));}var _0x134486={'method':_0x96c1('0x5f'),'uri':util[_0x96c1('0x60')](_0x96c1('0x61'),_0x3ea35c),'headers':{'Content-Type':_0x96c1('0x62'),'Accept':_0x96c1('0x62')},'json':!![]};if(_0x32e9fb[_0x96c1('0x56')]===_0x96c1('0x63')){_0x134486[_0x96c1('0x64')]['Authorization']=util[_0x96c1('0x60')](_0x96c1('0x65'),new Buffer(util[_0x96c1('0x60')](_0x96c1('0x66'),_0x32e9fb[_0x96c1('0x57')],_0x32e9fb[_0x96c1('0x58')]))[_0x96c1('0x67')](_0x96c1('0x68')));}return rp(_0x134486)[_0x96c1('0x24')](function(_0x3d3c4e){return _0x54a4d5[_0x96c1('0x69')](_[_0x96c1('0x2b')](_0x3d3c4e[_0x96c1('0x6a')][_0x96c1('0x6b')],function(_0x982c1f){return{'id':_0x982c1f[_0x96c1('0x29')],'name':_0x982c1f[_0x96c1('0x29')],'type':_0x982c1f[_0x96c1('0x3b')],'active':_0x982c1f[_0x96c1('0x6c')],'label':_0x982c1f[_0x96c1('0x6d')],'custom':!![]};}));});}})[_0x96c1('0x24')](function(_0x3aa7f4){return{'count':_0x3aa7f4['length'],'rows':_0x3aa7f4};})[_0x96c1('0x24')](respondWithResult(_0x4e664b,null))[_0x96c1('0x40')](function(_0x56a5e6){var _0x3c88ce=_0x2a8da5[_0x96c1('0x2e')][_0x96c1('0x6e')]?0x1f4:_0x56a5e6[_0x96c1('0x6f')]||0x1f4;logger[_0x96c1('0x27')](_0x96c1('0x70'),_0x96c1('0x54'),_0x3c88ce,JSON[_0x96c1('0x71')](_0x56a5e6));delete _0x56a5e6[_0x96c1('0x29')];if(_0x3c88ce===0x191){_0x3c88ce=0x190;}_0x4e664b[_0x96c1('0x1c')](_0x3c88ce)[_0x96c1('0x72')](_0x2a8da5[_0x96c1('0x2e')]['test']?{'message':_0x96c1('0x73'),'statusCode':_0x56a5e6[_0x96c1('0x6f')]}:_0x56a5e6);});}; \ No newline at end of file +var _0x75b2=['basic','headers','%s:%s','toString','base64','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','channel','Descriptions','DeskConfiguration','DeskField','Subjects','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json'];(function(_0x385865,_0x39b9fb){var _0x4e8d5d=function(_0x44da43){while(--_0x44da43){_0x385865['push'](_0x385865['shift']());}};_0x4e8d5d(++_0x39b9fb);}(_0x75b2,0x1ce));var _0x275b=function(_0x143ea6,_0x3c9999){_0x143ea6=_0x143ea6-0x0;var _0xfb14d=_0x75b2[_0x143ea6];return _0xfb14d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x275b('0x0'));var jsonpatch=require(_0x275b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x275b('0x2'));var path=require(_0x275b('0x3'));var sox=require(_0x275b('0x4'));var csv=require(_0x275b('0x5'));var ejs=require(_0x275b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x275b('0x7'));var squel=require('squel');var crypto=require(_0x275b('0x8'));var jsforce=require(_0x275b('0x9'));var deskjs=require(_0x275b('0xa'));var toCsv=require(_0x275b('0x5'));var querystring=require(_0x275b('0xb'));var Papa=require(_0x275b('0xc'));var Redis=require(_0x275b('0xd'));var authService=require(_0x275b('0xe'));var qs=require(_0x275b('0xf'));var as=require(_0x275b('0x10'));var hardwareService=require(_0x275b('0x11'));var logger=require(_0x275b('0x12'))(_0x275b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x275b('0x14'));var db=require(_0x275b('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2184d1,_0x2e3e75){_0x2e3e75=_0x2e3e75||0xcc;return function(_0xc6345f){if(_0xc6345f){return _0x2184d1[_0x275b('0x16')](_0x2e3e75);}return _0x2184d1[_0x275b('0x17')](_0x2e3e75)[_0x275b('0x18')]();};}function respondWithResult(_0x31c32e,_0x197d34){_0x197d34=_0x197d34||0xc8;return function(_0x3e60cd){if(_0x3e60cd){return _0x31c32e[_0x275b('0x17')](_0x197d34)[_0x275b('0x19')](_0x3e60cd);}};}function respondWithFilteredResult(_0xa84f24,_0x26fa1f){return function(_0x12f2df){if(_0x12f2df){var _0x54889b=typeof _0x26fa1f[_0x275b('0x1a')]===_0x275b('0x1b')&&typeof _0x26fa1f[_0x275b('0x1c')]===_0x275b('0x1b');var _0x569049=_0x12f2df['count'];var _0x3b78b1=_0x54889b?0x0:_0x26fa1f[_0x275b('0x1a')];var _0x4da809=_0x54889b?_0x12f2df[_0x275b('0x1d')]:_0x26fa1f[_0x275b('0x1a')]+_0x26fa1f[_0x275b('0x1c')];var _0x37b432;if(_0x4da809>=_0x569049){_0x4da809=_0x569049;_0x37b432=0xc8;}else{_0x37b432=0xce;}_0xa84f24[_0x275b('0x17')](_0x37b432);return _0xa84f24[_0x275b('0x1e')](_0x275b('0x1f'),_0x3b78b1+'-'+_0x4da809+'/'+_0x569049)[_0x275b('0x19')](_0x12f2df);}return null;};}function patchUpdates(_0x291963){return function(_0x3b1426){try{jsonpatch[_0x275b('0x20')](_0x3b1426,_0x291963,!![]);}catch(_0x2a6258){return BPromise[_0x275b('0x21')](_0x2a6258);}return _0x3b1426['save']();};}function saveUpdates(_0x381e67,_0x436c73){return function(_0x5a40eb){if(_0x5a40eb){return _0x5a40eb[_0x275b('0x22')](_0x381e67)[_0x275b('0x23')](function(_0x1251ae){return _0x1251ae;});}return null;};}function removeEntity(_0x181510,_0xc7b8d7){return function(_0x324298){if(_0x324298){return _0x324298[_0x275b('0x24')]()[_0x275b('0x23')](function(){_0x181510[_0x275b('0x17')](0xcc)[_0x275b('0x18')]();});}};}function handleEntityNotFound(_0x1532b4,_0x2935df){return function(_0xa3c94c){if(!_0xa3c94c){_0x1532b4['sendStatus'](0x194);}return _0xa3c94c;};}function handleError(_0x23d571,_0x51939e){_0x51939e=_0x51939e||0x1f4;return function(_0xfe7ddc){logger[_0x275b('0x25')](_0xfe7ddc[_0x275b('0x26')]);if(_0xfe7ddc[_0x275b('0x27')]){delete _0xfe7ddc[_0x275b('0x27')];}_0x23d571[_0x275b('0x17')](_0x51939e)[_0x275b('0x28')](_0xfe7ddc);};}exports[_0x275b('0x29')]=function(_0x5e8e03,_0x5c4cad){var _0x1f8e33={},_0x5e6a39={},_0x516107={'count':0x0,'rows':[]};var _0x2f39e0=_[_0x275b('0x2a')](db[_0x275b('0x2b')][_0x275b('0x2c')],function(_0x4e1501){return{'name':_0x4e1501[_0x275b('0x2d')],'type':_0x4e1501[_0x275b('0x2e')]['key']};});_0x5e6a39[_0x275b('0x2f')]=_[_0x275b('0x2a')](_0x2f39e0,_0x275b('0x27'));_0x5e6a39[_0x275b('0x30')]=_[_0x275b('0x31')](_0x5e8e03['query']);_0x5e6a39['filters']=_[_0x275b('0x32')](_0x5e6a39[_0x275b('0x2f')],_0x5e6a39['query']);_0x1f8e33[_0x275b('0x33')]=_[_0x275b('0x32')](_0x5e6a39['model'],qs[_0x275b('0x34')](_0x5e8e03['query']['fields']));_0x1f8e33['attributes']=_0x1f8e33[_0x275b('0x33')]['length']?_0x1f8e33[_0x275b('0x33')]:_0x5e6a39['model'];if(!_0x5e8e03[_0x275b('0x30')][_0x275b('0x35')](_0x275b('0x36'))){_0x1f8e33[_0x275b('0x1c')]=qs['limit'](_0x5e8e03['query'][_0x275b('0x1c')]);_0x1f8e33[_0x275b('0x1a')]=qs[_0x275b('0x1a')](_0x5e8e03[_0x275b('0x30')][_0x275b('0x1a')]);}_0x1f8e33[_0x275b('0x37')]=qs[_0x275b('0x38')](_0x5e8e03[_0x275b('0x30')][_0x275b('0x38')]);_0x1f8e33[_0x275b('0x39')]=qs['filters'](_[_0x275b('0x3a')](_0x5e8e03[_0x275b('0x30')],_0x5e6a39[_0x275b('0x3b')]),_0x2f39e0);if(_0x5e8e03['query'][_0x275b('0x3c')]){_0x1f8e33[_0x275b('0x39')]=_[_0x275b('0x3d')](_0x1f8e33['where'],{'$or':_[_0x275b('0x2a')](_0x2f39e0,function(_0x5ab6a8){if(_0x5ab6a8[_0x275b('0x2e')]!==_0x275b('0x3e')){var _0x57dc0b={};_0x57dc0b[_0x5ab6a8[_0x275b('0x27')]]={'$like':'%'+_0x5e8e03[_0x275b('0x30')][_0x275b('0x3c')]+'%'};return _0x57dc0b;}})});}_0x1f8e33=_['merge']({},_0x1f8e33,_0x5e8e03[_0x275b('0x3f')]);var _0x1b8670={'where':_0x1f8e33[_0x275b('0x39')]};return db['DeskAccount'][_0x275b('0x1d')](_0x1b8670)['then'](function(_0x431dc6){_0x516107[_0x275b('0x1d')]=_0x431dc6;if(_0x5e8e03['query'][_0x275b('0x40')]){_0x1f8e33[_0x275b('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0x275b('0x42')](_0x1f8e33);})[_0x275b('0x23')](function(_0xd36ba6){_0x516107[_0x275b('0x43')]=_0xd36ba6;return _0x516107;})[_0x275b('0x23')](respondWithFilteredResult(_0x5c4cad,_0x1f8e33))[_0x275b('0x44')](handleError(_0x5c4cad,null));};exports['show']=function(_0x282267,_0x5b25f1){var _0x46486c={'raw':![],'where':{'id':_0x282267[_0x275b('0x45')]['id']}},_0x13efda={};_0x13efda[_0x275b('0x2f')]=_['keys'](db[_0x275b('0x2b')][_0x275b('0x2c')]);_0x13efda['query']=_[_0x275b('0x31')](_0x282267[_0x275b('0x30')]);_0x13efda[_0x275b('0x3b')]=_['intersection'](_0x13efda[_0x275b('0x2f')],_0x13efda[_0x275b('0x30')]);_0x46486c[_0x275b('0x33')]=_[_0x275b('0x32')](_0x13efda[_0x275b('0x2f')],qs[_0x275b('0x34')](_0x282267[_0x275b('0x30')][_0x275b('0x34')]));_0x46486c[_0x275b('0x33')]=_0x46486c[_0x275b('0x33')][_0x275b('0x46')]?_0x46486c[_0x275b('0x33')]:_0x13efda['model'];if(_0x282267[_0x275b('0x30')][_0x275b('0x40')]){_0x46486c[_0x275b('0x41')]=[{'all':!![]}];}_0x46486c=_[_0x275b('0x3d')]({},_0x46486c,_0x282267[_0x275b('0x3f')]);return db['DeskAccount'][_0x275b('0x47')](_0x46486c)[_0x275b('0x23')](handleEntityNotFound(_0x5b25f1,null))['then'](respondWithResult(_0x5b25f1,null))[_0x275b('0x44')](handleError(_0x5b25f1,null));};exports[_0x275b('0x48')]=function(_0x519622,_0x41917e){return db[_0x275b('0x2b')][_0x275b('0x48')](_0x519622[_0x275b('0x49')],{})['then'](respondWithResult(_0x41917e,0xc9))[_0x275b('0x44')](handleError(_0x41917e,null));};exports[_0x275b('0x22')]=function(_0x24100a,_0x24f5ef){if(_0x24100a['body']['id']){delete _0x24100a[_0x275b('0x49')]['id'];}return db[_0x275b('0x2b')]['find']({'where':{'id':_0x24100a[_0x275b('0x45')]['id']}})[_0x275b('0x23')](handleEntityNotFound(_0x24f5ef,null))['then'](saveUpdates(_0x24100a['body'],null))[_0x275b('0x23')](respondWithResult(_0x24f5ef,null))[_0x275b('0x44')](handleError(_0x24f5ef,null));};exports[_0x275b('0x24')]=function(_0x455cea,_0x5ba23d){return db['DeskAccount']['find']({'where':{'id':_0x455cea[_0x275b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ba23d,null))[_0x275b('0x23')](removeEntity(_0x5ba23d,null))[_0x275b('0x44')](handleError(_0x5ba23d,null));};exports[_0x275b('0x4a')]=function(_0x2592da,_0x5d3719,_0x3dde1f){var _0x28df40={};var _0x5895d2={};var _0x5adbf8;var _0x281d94;return db[_0x275b('0x2b')][_0x275b('0x4b')]({'where':{'id':_0x2592da[_0x275b('0x45')]['id']}})[_0x275b('0x23')](handleEntityNotFound(_0x5d3719,null))[_0x275b('0x23')](function(_0x2a7b10){if(_0x2a7b10){_0x5adbf8=_0x2a7b10;_0x5895d2[_0x275b('0x2f')]=_[_0x275b('0x31')](db['DeskConfiguration'][_0x275b('0x2c')]);_0x5895d2[_0x275b('0x30')]=_[_0x275b('0x31')](_0x2592da[_0x275b('0x30')]);_0x5895d2['filters']=_[_0x275b('0x32')](_0x5895d2[_0x275b('0x2f')],_0x5895d2[_0x275b('0x30')]);_0x28df40[_0x275b('0x33')]=_[_0x275b('0x32')](_0x5895d2[_0x275b('0x2f')],qs['fields'](_0x2592da[_0x275b('0x30')]['fields']));_0x28df40[_0x275b('0x33')]=_0x28df40[_0x275b('0x33')][_0x275b('0x46')]?_0x28df40['attributes']:_0x5895d2[_0x275b('0x2f')];_0x28df40['order']=qs['sort'](_0x2592da[_0x275b('0x30')]['sort']);_0x28df40[_0x275b('0x39')]=qs['filters'](_[_0x275b('0x3a')](_0x2592da['query'],_0x5895d2[_0x275b('0x3b')]));if(_0x2592da[_0x275b('0x30')]['filter']){_0x28df40[_0x275b('0x39')]=_['merge'](_0x28df40['where'],{'$or':_[_0x275b('0x2a')](_0x28df40[_0x275b('0x33')],function(_0x5af010){var _0x2081ea={};_0x2081ea[_0x5af010]={'$like':'%'+_0x2592da[_0x275b('0x30')][_0x275b('0x3c')]+'%'};return _0x2081ea;})});}_0x28df40=_[_0x275b('0x3d')]({},_0x28df40,_0x2592da[_0x275b('0x3f')]);return _0x5adbf8[_0x275b('0x4a')](_0x28df40);}})[_0x275b('0x23')](function(_0x31114d){if(_0x31114d){_0x281d94=_0x31114d[_0x275b('0x46')];if(!_0x2592da[_0x275b('0x30')][_0x275b('0x35')](_0x275b('0x36'))){_0x28df40[_0x275b('0x1c')]=qs[_0x275b('0x1c')](_0x2592da['query']['limit']);_0x28df40['offset']=qs[_0x275b('0x1a')](_0x2592da[_0x275b('0x30')][_0x275b('0x1a')]);}return _0x5adbf8['getConfigurations'](_0x28df40);}})[_0x275b('0x23')](function(_0x160841){if(_0x160841){return _0x160841?{'count':_0x281d94,'rows':_0x160841}:null;}})[_0x275b('0x23')](respondWithResult(_0x5d3719,null))[_0x275b('0x44')](handleError(_0x5d3719,null));};exports[_0x275b('0x4c')]=function(_0x38b7ed,_0x52a4f8,_0x3e5c3d){if(_0x38b7ed[_0x275b('0x49')]['id']){delete _0x38b7ed[_0x275b('0x49')]['id'];}return db[_0x275b('0x2b')]['findOne']({'where':{'id':_0x38b7ed['params']['id']}})[_0x275b('0x23')](handleEntityNotFound(_0x52a4f8,null))[_0x275b('0x23')](function(_0x3bf175){if(_0x3bf175){_0x38b7ed['body'][_0x275b('0x4d')]=_0x3bf175['id'];_0x38b7ed['body']['Subjects']=integrations['getSubjects'](_0x38b7ed['body'][_0x275b('0x4e')],_0x38b7ed[_0x275b('0x49')][_0x275b('0x2e')]);_0x38b7ed[_0x275b('0x49')][_0x275b('0x4f')]=integrations['getDescriptions'](_0x38b7ed['body'][_0x275b('0x4e')],_0x38b7ed[_0x275b('0x49')][_0x275b('0x2e')]);return db[_0x275b('0x50')]['create'](_0x38b7ed[_0x275b('0x49')],{'include':[{'model':db[_0x275b('0x51')],'as':_0x275b('0x52')},{'model':db[_0x275b('0x51')],'as':_0x275b('0x4f')}]});}return null;})['then'](respondWithResult(_0x52a4f8,null))[_0x275b('0x44')](handleError(_0x52a4f8,null));};exports['getFields']=function(_0x173a2f,_0x448eb8,_0x154729){var _0x470219=[{'name':'priority','label':_0x275b('0x53'),'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 _0x27273d='';return db[_0x275b('0x2b')][_0x275b('0x4b')]({'where':{'id':_0x173a2f['params']['id']},'attributes':['id','remoteUri',_0x275b('0x54'),_0x275b('0x55'),_0x275b('0x56'),_0x275b('0x57'),_0x275b('0x58'),_0x275b('0x59'),_0x275b('0x5a')]})[_0x275b('0x23')](handleEntityNotFound(_0x448eb8,null))[_0x275b('0x23')](function(_0x16dbc7){if(_0x16dbc7){_0x27273d=_0x16dbc7['remoteUri'];var _0xa41e8a=_0x27273d[_0x275b('0x5b')](-0x1);if(_0xa41e8a==='/'){_0x27273d=_0x27273d[_0x275b('0x5c')](0x0,_0x27273d[_0x275b('0x5d')](_0xa41e8a));}var _0x47dd2e={'method':_0x275b('0x5e'),'uri':util[_0x275b('0x5f')](_0x275b('0x60'),_0x27273d),'headers':{'Content-Type':_0x275b('0x61'),'Accept':'application/json'},'json':!![]};if(_0x16dbc7[_0x275b('0x54')]===_0x275b('0x62')){_0x47dd2e[_0x275b('0x63')]['Authorization']=util[_0x275b('0x5f')]('Basic\x20%s',new Buffer(util['format'](_0x275b('0x64'),_0x16dbc7[_0x275b('0x55')],_0x16dbc7[_0x275b('0x56')]))[_0x275b('0x65')](_0x275b('0x66')));}return rp(_0x47dd2e)[_0x275b('0x23')](function(_0x35a125){return _0x470219['concat'](_[_0x275b('0x2a')](_0x35a125[_0x275b('0x67')][_0x275b('0x68')],function(_0x15bd45){return{'id':_0x15bd45[_0x275b('0x27')],'name':_0x15bd45[_0x275b('0x27')],'type':_0x15bd45['type'],'active':_0x15bd45[_0x275b('0x69')],'label':_0x15bd45['label'],'custom':!![]};}));});}})['then'](function(_0x1d7709){return{'count':_0x1d7709['length'],'rows':_0x1d7709};})[_0x275b('0x23')](respondWithResult(_0x448eb8,null))[_0x275b('0x44')](function(_0x234d5f){var _0x5a8737=_0x173a2f['query'][_0x275b('0x6a')]?0x1f4:_0x234d5f[_0x275b('0x6b')]||0x1f4;logger['error'](_0x275b('0x6c'),_0x275b('0x6d'),_0x5a8737,JSON[_0x275b('0x6e')](_0x234d5f));delete _0x234d5f[_0x275b('0x27')];if(_0x5a8737===0x191){_0x5a8737=0x190;}_0x448eb8['status'](_0x5a8737)[_0x275b('0x28')](_0x173a2f['query'][_0x275b('0x6a')]?{'message':_0x275b('0x6f'),'statusCode':_0x234d5f[_0x275b('0x6b')]}:_0x234d5f);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 653e2f0..72dde96 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 _0xd965=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xd965,0x149));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d96('0x0'));var util=require(_0x5d96('0x1'));var logger=require(_0x5d96('0x2'))(_0x5d96('0x3'));var moment=require(_0x5d96('0x4'));var BPromise=require(_0x5d96('0x5'));var rp=require(_0x5d96('0x6'));var fs=require('fs');var path=require(_0x5d96('0x7'));var rimraf=require(_0x5d96('0x8'));var config=require('../../config/environment');var attributes=require(_0x5d96('0x9'));var integrations=require(_0x5d96('0xa'));module[_0x5d96('0xb')]=function(_0xdcabc5,_0x5e3904){return _0xdcabc5[_0x5d96('0xc')](_0x5d96('0xd'),attributes,{'tableName':_0x5d96('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x798f=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x5c4990,_0x48c934){var _0x414a8e=function(_0x2bea0c){while(--_0x2bea0c){_0x5c4990['push'](_0x5c4990['shift']());}};_0x414a8e(++_0x48c934);}(_0x798f,0x96));var _0xf798=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x798f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf798('0x0'));var util=require(_0xf798('0x1'));var logger=require(_0xf798('0x2'))('api');var moment=require(_0xf798('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf798('0x4'));var rimraf=require(_0xf798('0x5'));var config=require(_0xf798('0x6'));var attributes=require(_0xf798('0x7'));var integrations=require(_0xf798('0x8'));module[_0xf798('0x9')]=function(_0x29d86f,_0x23496e){return _0x29d86f[_0xf798('0xa')](_0xf798('0xb'),attributes,{'tableName':'int_desk_accounts','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 fe471be..e00b1f8 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 _0xef32=['GetDeskAccount','stringify','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x5cd3f2,_0x1537a){var _0x3508cc=function(_0x31d9c9){while(--_0x31d9c9){_0x5cd3f2['push'](_0x5cd3f2['shift']());}};_0x3508cc(++_0x1537a);}(_0xef32,0xb4));var _0x2ef3=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xef32[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x2ef3('0x0'));var util=require(_0x2ef3('0x1'));var moment=require(_0x2ef3('0x2'));var BPromise=require(_0x2ef3('0x3'));var rs=require(_0x2ef3('0x4'));var fs=require('fs');var Redis=require(_0x2ef3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ef3('0x6'));var logger=require(_0x2ef3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2ef3('0x8'));var client=jayson[_0x2ef3('0x9')][_0x2ef3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x164b06,_0x196780,_0x527757){return new BPromise(function(_0x5a277f,_0x2774ae){return client['request'](_0x164b06,_0x527757)['then'](function(_0x2b8830){logger[_0x2ef3('0xb')](_0x2ef3('0xc'),_0x196780,_0x2ef3('0xd'));logger[_0x2ef3('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x196780,_0x2ef3('0xd'),JSON['stringify'](_0x2b8830));if(_0x2b8830[_0x2ef3('0xf')]){if(_0x2b8830['error'][_0x2ef3('0x10')]===0x1f4){logger['error'](_0x2ef3('0xc'),_0x196780,_0x2b8830[_0x2ef3('0xf')][_0x2ef3('0x11')]);return _0x2774ae(_0x2b8830['error'][_0x2ef3('0x11')]);}logger[_0x2ef3('0xf')]('DeskAccount,\x20%s,\x20%s',_0x196780,_0x2b8830[_0x2ef3('0xf')]['message']);return _0x5a277f(_0x2b8830[_0x2ef3('0xf')][_0x2ef3('0x11')]);}else{logger['info'](_0x2ef3('0xc'),_0x196780,_0x2ef3('0xd'));_0x5a277f(_0x2b8830[_0x2ef3('0x12')]['message']);}})[_0x2ef3('0x13')](function(_0x21edb0){logger[_0x2ef3('0xf')](_0x2ef3('0xc'),_0x196780,_0x21edb0);_0x2774ae(_0x21edb0);});});}exports['GetDeskAccount']=function(_0x4ea3f4){var _0x4c02f0=this;return new Promise(function(_0x1dc42e,_0x56fa19){return db['DeskAccount'][_0x2ef3('0x14')]({'raw':_0x4ea3f4[_0x2ef3('0x15')]?_0x4ea3f4['options'][_0x2ef3('0x16')]===undefined?!![]:![]:!![],'where':_0x4ea3f4['options']?_0x4ea3f4[_0x2ef3('0x15')][_0x2ef3('0x17')]||null:null,'attributes':_0x4ea3f4[_0x2ef3('0x15')]?_0x4ea3f4[_0x2ef3('0x15')][_0x2ef3('0x18')]||null:null,'limit':_0x4ea3f4[_0x2ef3('0x15')]?_0x4ea3f4[_0x2ef3('0x15')][_0x2ef3('0x19')]||null:null,'include':_0x4ea3f4[_0x2ef3('0x15')]?_0x4ea3f4[_0x2ef3('0x15')][_0x2ef3('0x1a')]?_[_0x2ef3('0x1b')](_0x4ea3f4[_0x2ef3('0x15')][_0x2ef3('0x1a')],function(_0x2eed49){return{'model':db[_0x2eed49[_0x2ef3('0x1c')]],'as':_0x2eed49['as'],'attributes':_0x2eed49[_0x2ef3('0x18')],'include':_0x2eed49[_0x2ef3('0x1a')]?_[_0x2ef3('0x1b')](_0x2eed49[_0x2ef3('0x1a')],function(_0x4aac41){return{'model':db[_0x4aac41[_0x2ef3('0x1c')]],'as':_0x4aac41['as'],'attributes':_0x4aac41[_0x2ef3('0x18')],'include':_0x4aac41[_0x2ef3('0x1a')]?_[_0x2ef3('0x1b')](_0x4aac41[_0x2ef3('0x1a')],function(_0x5e8e72){return{'model':db[_0x5e8e72[_0x2ef3('0x1c')]],'as':_0x5e8e72['as'],'attributes':_0x5e8e72[_0x2ef3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2ef3('0x1d')](function(_0x46a641){logger['info'](_0x2ef3('0x1e'),_0x4ea3f4);logger[_0x2ef3('0xe')](_0x2ef3('0x1e'),_0x4ea3f4,JSON[_0x2ef3('0x1f')](_0x46a641));_0x1dc42e(_0x46a641);})[_0x2ef3('0x13')](function(_0x220948){logger['error'](_0x2ef3('0x1e'),_0x220948[_0x2ef3('0x11')],_0x4ea3f4);_0x56fa19(_0x4c02f0['error'](0x1f4,_0x220948[_0x2ef3('0x11')]));});});};exports[_0x2ef3('0x20')]=function(_0x4dad2b){var _0x3fe743=this;return new Promise(function(_0x1f6d91,_0x5c9a4f){return db[_0x2ef3('0x21')][_0x2ef3('0x22')]({'raw':_0x4dad2b[_0x2ef3('0x15')]?_0x4dad2b[_0x2ef3('0x15')][_0x2ef3('0x16')]===undefined?!![]:![]:!![],'where':_0x4dad2b[_0x2ef3('0x15')]?_0x4dad2b[_0x2ef3('0x15')][_0x2ef3('0x17')]||null:null,'attributes':_0x4dad2b['options']?_0x4dad2b['options']['attributes']||null:null,'include':_0x4dad2b['options']?_0x4dad2b[_0x2ef3('0x15')]['include']?_[_0x2ef3('0x1b')](_0x4dad2b[_0x2ef3('0x15')]['include'],function(_0x40cc50){return{'model':db[_0x40cc50[_0x2ef3('0x1c')]],'as':_0x40cc50['as'],'attributes':_0x40cc50[_0x2ef3('0x18')],'include':_0x40cc50['include']?_['map'](_0x40cc50['include'],function(_0x44377c){return{'model':db[_0x44377c[_0x2ef3('0x1c')]],'as':_0x44377c['as'],'attributes':_0x44377c[_0x2ef3('0x18')],'include':_0x44377c[_0x2ef3('0x1a')]?_['map'](_0x44377c[_0x2ef3('0x1a')],function(_0x292fde){return{'model':db[_0x292fde[_0x2ef3('0x1c')]],'as':_0x292fde['as'],'attributes':_0x292fde['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a4dc0){logger[_0x2ef3('0xb')](_0x2ef3('0x20'),_0x4dad2b);logger['debug'](_0x2ef3('0x20'),_0x4dad2b,JSON[_0x2ef3('0x1f')](_0x3a4dc0));_0x1f6d91(_0x3a4dc0);})[_0x2ef3('0x13')](function(_0x4b2158){logger[_0x2ef3('0xf')]('ShowDeskAccount',_0x4b2158[_0x2ef3('0x11')],_0x4dad2b);_0x5c9a4f(_0x3fe743[_0x2ef3('0xf')](0x1f4,_0x4b2158[_0x2ef3('0x11')]));});});}; \ No newline at end of file +var _0x001e=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetDeskAccount','ShowDeskAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1be71b,_0x478a01){var _0x2d7a6c=function(_0x1a907a){while(--_0x1a907a){_0x1be71b['push'](_0x1be71b['shift']());}};_0x2d7a6c(++_0x478a01);}(_0x001e,0x195));var _0xe001=function(_0xa51ba0,_0x3bf58d){_0xa51ba0=_0xa51ba0-0x0;var _0x17f343=_0x001e[_0xa51ba0];return _0x17f343;};'use strict';var _=require('lodash');var util=require(_0xe001('0x0'));var moment=require(_0xe001('0x1'));var BPromise=require('bluebird');var rs=require(_0xe001('0x2'));var fs=require('fs');var Redis=require(_0xe001('0x3'));var db=require(_0xe001('0x4'))['db'];var utils=require(_0xe001('0x5'));var logger=require(_0xe001('0x6'))(_0xe001('0x7'));var config=require(_0xe001('0x8'));var jayson=require(_0xe001('0x9'));var client=jayson['client'][_0xe001('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41151c,_0x2ee503,_0x1abae1){return new BPromise(function(_0x1fdd97,_0x45d2d0){return client['request'](_0x41151c,_0x1abae1)[_0xe001('0xb')](function(_0x49f347){logger[_0xe001('0xc')](_0xe001('0xd'),_0x2ee503,_0xe001('0xe'));logger[_0xe001('0xf')](_0xe001('0x10'),_0x2ee503,_0xe001('0xe'),JSON[_0xe001('0x11')](_0x49f347));if(_0x49f347[_0xe001('0x12')]){if(_0x49f347['error']['code']===0x1f4){logger[_0xe001('0x12')](_0xe001('0xd'),_0x2ee503,_0x49f347[_0xe001('0x12')][_0xe001('0x13')]);return _0x45d2d0(_0x49f347[_0xe001('0x12')][_0xe001('0x13')]);}logger[_0xe001('0x12')](_0xe001('0xd'),_0x2ee503,_0x49f347[_0xe001('0x12')]['message']);return _0x1fdd97(_0x49f347['error'][_0xe001('0x13')]);}else{logger[_0xe001('0xc')](_0xe001('0xd'),_0x2ee503,'request\x20sent');_0x1fdd97(_0x49f347[_0xe001('0x14')][_0xe001('0x13')]);}})[_0xe001('0x15')](function(_0x1b95a5){logger[_0xe001('0x12')](_0xe001('0xd'),_0x2ee503,_0x1b95a5);_0x45d2d0(_0x1b95a5);});});}exports['GetDeskAccount']=function(_0x47da88){var _0x345c91=this;return new Promise(function(_0x8bdde0,_0x154513){return db[_0xe001('0x16')][_0xe001('0x17')]({'raw':_0x47da88[_0xe001('0x18')]?_0x47da88[_0xe001('0x18')][_0xe001('0x19')]===undefined?!![]:![]:!![],'where':_0x47da88[_0xe001('0x18')]?_0x47da88[_0xe001('0x18')][_0xe001('0x1a')]||null:null,'attributes':_0x47da88[_0xe001('0x18')]?_0x47da88['options'][_0xe001('0x1b')]||null:null,'limit':_0x47da88[_0xe001('0x18')]?_0x47da88[_0xe001('0x18')][_0xe001('0x1c')]||null:null,'include':_0x47da88['options']?_0x47da88[_0xe001('0x18')]['include']?_[_0xe001('0x1d')](_0x47da88[_0xe001('0x18')][_0xe001('0x1e')],function(_0x14e96a){return{'model':db[_0x14e96a[_0xe001('0x1f')]],'as':_0x14e96a['as'],'attributes':_0x14e96a[_0xe001('0x1b')],'include':_0x14e96a[_0xe001('0x1e')]?_[_0xe001('0x1d')](_0x14e96a[_0xe001('0x1e')],function(_0x13f95b){return{'model':db[_0x13f95b[_0xe001('0x1f')]],'as':_0x13f95b['as'],'attributes':_0x13f95b['attributes'],'include':_0x13f95b['include']?_['map'](_0x13f95b['include'],function(_0x128f29){return{'model':db[_0x128f29[_0xe001('0x1f')]],'as':_0x128f29['as'],'attributes':_0x128f29[_0xe001('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe001('0xb')](function(_0x19cac5){logger['info'](_0xe001('0x20'),_0x47da88);logger['debug']('GetDeskAccount',_0x47da88,JSON[_0xe001('0x11')](_0x19cac5));_0x8bdde0(_0x19cac5);})[_0xe001('0x15')](function(_0x2cb8cb){logger[_0xe001('0x12')](_0xe001('0x20'),_0x2cb8cb['message'],_0x47da88);_0x154513(_0x345c91[_0xe001('0x12')](0x1f4,_0x2cb8cb[_0xe001('0x13')]));});});};exports[_0xe001('0x21')]=function(_0x5464ce){var _0x40a924=this;return new Promise(function(_0x2588f3,_0x520faf){return db['DeskAccount'][_0xe001('0x22')]({'raw':_0x5464ce[_0xe001('0x18')]?_0x5464ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x5464ce['options']?_0x5464ce['options'][_0xe001('0x1a')]||null:null,'attributes':_0x5464ce[_0xe001('0x18')]?_0x5464ce[_0xe001('0x18')][_0xe001('0x1b')]||null:null,'include':_0x5464ce['options']?_0x5464ce[_0xe001('0x18')][_0xe001('0x1e')]?_[_0xe001('0x1d')](_0x5464ce[_0xe001('0x18')]['include'],function(_0x30d47e){return{'model':db[_0x30d47e[_0xe001('0x1f')]],'as':_0x30d47e['as'],'attributes':_0x30d47e['attributes'],'include':_0x30d47e['include']?_[_0xe001('0x1d')](_0x30d47e[_0xe001('0x1e')],function(_0x536fce){return{'model':db[_0x536fce[_0xe001('0x1f')]],'as':_0x536fce['as'],'attributes':_0x536fce[_0xe001('0x1b')],'include':_0x536fce[_0xe001('0x1e')]?_[_0xe001('0x1d')](_0x536fce[_0xe001('0x1e')],function(_0x52af5b){return{'model':db[_0x52af5b[_0xe001('0x1f')]],'as':_0x52af5b['as'],'attributes':_0x52af5b[_0xe001('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe001('0xb')](function(_0x462612){logger['info'](_0xe001('0x21'),_0x5464ce);logger[_0xe001('0xf')](_0xe001('0x21'),_0x5464ce,JSON['stringify'](_0x462612));_0x2588f3(_0x462612);})[_0xe001('0x15')](function(_0x34b38b){logger[_0xe001('0x12')]('ShowDeskAccount',_0x34b38b[_0xe001('0x13')],_0x5464ce);_0x520faf(_0x40a924[_0xe001('0x12')](0x1f4,_0x34b38b[_0xe001('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4902feb..50f155c 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x2617f5,_0x4881f3){var _0x248284=function(_0xe3c02f){while(--_0xe3c02f){_0x2617f5['push'](_0x2617f5['shift']());}};_0x248284(++_0x4881f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x497413,_0x5caeb4){_0x497413=_0x497413-0x0;var _0x591d53=_0xedd9[_0x497413];return _0x591d53;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x55ca,0x126));var _0xa55c=function(_0x59ee9c,_0x43f62d){_0x59ee9c=_0x59ee9c-0x0;var _0x44a2a8=_0x55ca[_0x59ee9c];return _0x44a2a8;};'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 fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 5c531ad..de42a5d 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 _0xfc41=['STRING'];(function(_0x37473e,_0x4a1aa8){var _0x2635f7=function(_0x2a2b6f){while(--_0x2a2b6f){_0x37473e['push'](_0x37473e['shift']());}};_0x2635f7(++_0x4a1aa8);}(_0xfc41,0xdc));var _0x1fc4=function(_0x1c933b,_0x9d02b){_0x1c933b=_0x1c933b-0x0;var _0x33b586=_0xfc41[_0x1c933b];return _0x33b586;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1fc4('0x0')]},'description':{'type':Sequelize[_0x1fc4('0x0')]}}; \ No newline at end of file +var _0x2a67=['exports','STRING','sequelize'];(function(_0x22d772,_0x2e509e){var _0x2a60d9=function(_0xa6024b){while(--_0xa6024b){_0x22d772['push'](_0x22d772['shift']());}};_0x2a60d9(++_0x2e509e);}(_0x2a67,0x194));var _0x72a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x72a6('0x0'));module[_0x72a6('0x1')]={'name':{'type':Sequelize[_0x72a6('0x2')]},'description':{'type':Sequelize[_0x72a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index e3b5a53..0597258 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 _0x07da=['getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','map','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','DeskConfiguration','create','body','catch','find','getFields','findOne','getSubjects','nolimit','DeskField','getDescriptions'];(function(_0x58a006,_0xe8636b){var _0x5a42f1=function(_0x561445){while(--_0x561445){_0x58a006['push'](_0x58a006['shift']());}};_0x5a42f1(++_0xe8636b);}(_0x07da,0x1c0));var _0xa07d=function(_0x2ff71e,_0x33622c){_0x2ff71e=_0x2ff71e-0x0;var _0x2d1053=_0x07da[_0x2ff71e];return _0x2d1053;};'use strict';var emlformat=require(_0xa07d('0x0'));var rimraf=require(_0xa07d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa07d('0x2'));var rp=require(_0xa07d('0x3'));var moment=require(_0xa07d('0x4'));var BPromise=require(_0xa07d('0x5'));var Mustache=require(_0xa07d('0x6'));var util=require(_0xa07d('0x7'));var path=require(_0xa07d('0x8'));var sox=require('sox');var csv=require(_0xa07d('0x9'));var ejs=require(_0xa07d('0xa'));var fs=require('fs');var fs_extra=require(_0xa07d('0xb'));var _=require(_0xa07d('0xc'));var squel=require(_0xa07d('0xd'));var crypto=require('crypto');var jsforce=require(_0xa07d('0xe'));var deskjs=require(_0xa07d('0xf'));var toCsv=require(_0xa07d('0x9'));var querystring=require(_0xa07d('0x10'));var Papa=require(_0xa07d('0x11'));var Redis=require(_0xa07d('0x12'));var authService=require(_0xa07d('0x13'));var qs=require(_0xa07d('0x14'));var as=require(_0xa07d('0x15'));var hardwareService=require(_0xa07d('0x16'));var logger=require(_0xa07d('0x17'))(_0xa07d('0x18'));var utils=require(_0xa07d('0x19'));var config=require(_0xa07d('0x1a'));var licenseUtil=require(_0xa07d('0x1b'));var db=require(_0xa07d('0x1c'))['db'];function respondWithStatusCode(_0x21dff8,_0x5415af){_0x5415af=_0x5415af||0xcc;return function(_0x58610f){if(_0x58610f){return _0x21dff8[_0xa07d('0x1d')](_0x5415af);}return _0x21dff8[_0xa07d('0x1e')](_0x5415af)[_0xa07d('0x1f')]();};}function respondWithResult(_0x3f849a,_0x1e8bf4){_0x1e8bf4=_0x1e8bf4||0xc8;return function(_0x358024){if(_0x358024){return _0x3f849a['status'](_0x1e8bf4)[_0xa07d('0x20')](_0x358024);}};}function respondWithFilteredResult(_0x27f007,_0x5f379d){return function(_0x9b4d8){if(_0x9b4d8){var _0x1f5078=typeof _0x5f379d[_0xa07d('0x21')]===_0xa07d('0x22')&&typeof _0x5f379d[_0xa07d('0x23')]==='undefined';var _0x21aae8=_0x9b4d8[_0xa07d('0x24')];var _0xd8b910=_0x1f5078?0x0:_0x5f379d['offset'];var _0x4995d4=_0x1f5078?_0x9b4d8[_0xa07d('0x24')]:_0x5f379d[_0xa07d('0x21')]+_0x5f379d[_0xa07d('0x23')];var _0x1720f7;if(_0x4995d4>=_0x21aae8){_0x4995d4=_0x21aae8;_0x1720f7=0xc8;}else{_0x1720f7=0xce;}_0x27f007[_0xa07d('0x1e')](_0x1720f7);return _0x27f007[_0xa07d('0x25')](_0xa07d('0x26'),_0xd8b910+'-'+_0x4995d4+'/'+_0x21aae8)['json'](_0x9b4d8);}return null;};}function patchUpdates(_0x101b2b){return function(_0x3799f0){try{jsonpatch[_0xa07d('0x27')](_0x3799f0,_0x101b2b,!![]);}catch(_0x4f201d){return BPromise[_0xa07d('0x28')](_0x4f201d);}return _0x3799f0[_0xa07d('0x29')]();};}function saveUpdates(_0x298273,_0x4ff955){return function(_0x52fc9f){if(_0x52fc9f){return _0x52fc9f[_0xa07d('0x2a')](_0x298273)['then'](function(_0x27e27c){return _0x27e27c;});}return null;};}function removeEntity(_0x5c5eaa,_0x2c6f1d){return function(_0x1c11d7){if(_0x1c11d7){return _0x1c11d7[_0xa07d('0x2b')]()[_0xa07d('0x2c')](function(){_0x5c5eaa[_0xa07d('0x1e')](0xcc)[_0xa07d('0x1f')]();});}};}function handleEntityNotFound(_0x497af8,_0x3738d4){return function(_0x2e1e5d){if(!_0x2e1e5d){_0x497af8['sendStatus'](0x194);}return _0x2e1e5d;};}function handleError(_0x4e067c,_0x5d5a08){_0x5d5a08=_0x5d5a08||0x1f4;return function(_0x1816d7){logger[_0xa07d('0x2d')](_0x1816d7[_0xa07d('0x2e')]);if(_0x1816d7['name']){delete _0x1816d7['name'];}_0x4e067c[_0xa07d('0x1e')](_0x5d5a08)['send'](_0x1816d7);};}exports[_0xa07d('0x2f')]=function(_0x2f9dc3,_0x4324b6){var _0x49cd45={},_0x2aaa76={},_0x482c49={'count':0x0,'rows':[]};var _0x1e76ad=_[_0xa07d('0x30')](db['DeskConfiguration']['rawAttributes'],function(_0x2cd12e){return{'name':_0x2cd12e['fieldName'],'type':_0x2cd12e[_0xa07d('0x31')][_0xa07d('0x32')]};});_0x2aaa76[_0xa07d('0x33')]=_[_0xa07d('0x30')](_0x1e76ad,_0xa07d('0x34'));_0x2aaa76[_0xa07d('0x35')]=_[_0xa07d('0x36')](_0x2f9dc3['query']);_0x2aaa76['filters']=_[_0xa07d('0x37')](_0x2aaa76[_0xa07d('0x33')],_0x2aaa76[_0xa07d('0x35')]);_0x49cd45[_0xa07d('0x38')]=_[_0xa07d('0x37')](_0x2aaa76[_0xa07d('0x33')],qs[_0xa07d('0x39')](_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x39')]));_0x49cd45[_0xa07d('0x38')]=_0x49cd45[_0xa07d('0x38')][_0xa07d('0x3a')]?_0x49cd45[_0xa07d('0x38')]:_0x2aaa76['model'];if(!_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x3b')]('nolimit')){_0x49cd45[_0xa07d('0x23')]=qs['limit'](_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x23')]);_0x49cd45[_0xa07d('0x21')]=qs[_0xa07d('0x21')](_0x2f9dc3['query'][_0xa07d('0x21')]);}_0x49cd45[_0xa07d('0x3c')]=qs[_0xa07d('0x3d')](_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x3d')]);_0x49cd45[_0xa07d('0x3e')]=qs[_0xa07d('0x3f')](_[_0xa07d('0x40')](_0x2f9dc3[_0xa07d('0x35')],_0x2aaa76[_0xa07d('0x3f')]),_0x1e76ad);if(_0x2f9dc3[_0xa07d('0x35')]['filter']){_0x49cd45[_0xa07d('0x3e')]=_[_0xa07d('0x41')](_0x49cd45[_0xa07d('0x3e')],{'$or':_[_0xa07d('0x30')](_0x1e76ad,function(_0x74fa72){if(_0x74fa72[_0xa07d('0x31')]!=='VIRTUAL'){var _0x5be23d={};_0x5be23d[_0x74fa72[_0xa07d('0x34')]]={'$like':'%'+_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x42')]+'%'};return _0x5be23d;}})});}_0x49cd45=_[_0xa07d('0x41')]({},_0x49cd45,_0x2f9dc3[_0xa07d('0x43')]);var _0x12620a={'where':_0x49cd45[_0xa07d('0x3e')]};return db['DeskConfiguration'][_0xa07d('0x24')](_0x12620a)[_0xa07d('0x2c')](function(_0x472cb9){_0x482c49['count']=_0x472cb9;if(_0x2f9dc3[_0xa07d('0x35')][_0xa07d('0x44')]){_0x49cd45[_0xa07d('0x45')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xa07d('0x46')](_0x49cd45);})[_0xa07d('0x2c')](function(_0x5824cd){_0x482c49[_0xa07d('0x47')]=_0x5824cd;return _0x482c49;})['then'](respondWithFilteredResult(_0x4324b6,_0x49cd45))['catch'](handleError(_0x4324b6,null));};exports[_0xa07d('0x48')]=function(_0x1470fb,_0x55bf33){var _0x4cd3fe={'raw':![],'where':{'id':_0x1470fb[_0xa07d('0x49')]['id']}},_0x302013={};_0x302013['model']=_[_0xa07d('0x36')](db['DeskConfiguration'][_0xa07d('0x4a')]);_0x302013[_0xa07d('0x35')]=_['keys'](_0x1470fb[_0xa07d('0x35')]);_0x302013['filters']=_[_0xa07d('0x37')](_0x302013[_0xa07d('0x33')],_0x302013[_0xa07d('0x35')]);_0x4cd3fe[_0xa07d('0x38')]=_['intersection'](_0x302013[_0xa07d('0x33')],qs[_0xa07d('0x39')](_0x1470fb['query']['fields']));_0x4cd3fe['attributes']=_0x4cd3fe[_0xa07d('0x38')][_0xa07d('0x3a')]?_0x4cd3fe[_0xa07d('0x38')]:_0x302013[_0xa07d('0x33')];if(_0x1470fb[_0xa07d('0x35')]['includeAll']){_0x4cd3fe[_0xa07d('0x45')]=[{'all':!![]}];}_0x4cd3fe=_[_0xa07d('0x41')]({},_0x4cd3fe,_0x1470fb[_0xa07d('0x43')]);return db[_0xa07d('0x4b')]['find'](_0x4cd3fe)[_0xa07d('0x2c')](handleEntityNotFound(_0x55bf33,null))[_0xa07d('0x2c')](respondWithResult(_0x55bf33,null))['catch'](handleError(_0x55bf33,null));};exports['create']=function(_0x4ba4b3,_0x5980a0){return db[_0xa07d('0x4b')][_0xa07d('0x4c')](_0x4ba4b3[_0xa07d('0x4d')],{})['then'](respondWithResult(_0x5980a0,0xc9))[_0xa07d('0x4e')](handleError(_0x5980a0,null));};exports['update']=function(_0x5bbf42,_0x4948c1){if(_0x5bbf42[_0xa07d('0x4d')]['id']){delete _0x5bbf42[_0xa07d('0x4d')]['id'];}return db['DeskConfiguration'][_0xa07d('0x4f')]({'where':{'id':_0x5bbf42[_0xa07d('0x49')]['id']}})[_0xa07d('0x2c')](handleEntityNotFound(_0x4948c1,null))[_0xa07d('0x2c')](saveUpdates(_0x5bbf42[_0xa07d('0x4d')],null))[_0xa07d('0x2c')](respondWithResult(_0x4948c1,null))['catch'](handleError(_0x4948c1,null));};exports[_0xa07d('0x2b')]=function(_0x964e4b,_0x330b09){return db[_0xa07d('0x4b')][_0xa07d('0x4f')]({'where':{'id':_0x964e4b[_0xa07d('0x49')]['id']}})[_0xa07d('0x2c')](handleEntityNotFound(_0x330b09,null))[_0xa07d('0x2c')](removeEntity(_0x330b09,null))[_0xa07d('0x4e')](handleError(_0x330b09,null));};exports[_0xa07d('0x50')]=function(_0x1a3308,_0x33a99f,_0x39b6f4){var _0x308d77={};var _0x588351={};var _0x27c09e;var _0x41616a;return db['DeskConfiguration'][_0xa07d('0x51')]({'where':{'id':_0x1a3308['params']['id']}})['then'](handleEntityNotFound(_0x33a99f,null))[_0xa07d('0x2c')](function(_0x2c1a34){if(_0x2c1a34){_0x27c09e=_0x2c1a34;_0x588351['model']=_[_0xa07d('0x36')](db['DeskField'][_0xa07d('0x4a')]);_0x588351[_0xa07d('0x35')]=_[_0xa07d('0x36')](_0x1a3308['query']);_0x588351[_0xa07d('0x3f')]=_['intersection'](_0x588351[_0xa07d('0x33')],_0x588351[_0xa07d('0x35')]);_0x308d77[_0xa07d('0x38')]=_[_0xa07d('0x37')](_0x588351['model'],qs['fields'](_0x1a3308[_0xa07d('0x35')]['fields']));_0x308d77[_0xa07d('0x38')]=_0x308d77[_0xa07d('0x38')][_0xa07d('0x3a')]?_0x308d77[_0xa07d('0x38')]:_0x588351[_0xa07d('0x33')];_0x308d77[_0xa07d('0x3c')]=qs[_0xa07d('0x3d')](_0x1a3308[_0xa07d('0x35')][_0xa07d('0x3d')]);_0x308d77[_0xa07d('0x3e')]=qs['filters'](_[_0xa07d('0x40')](_0x1a3308[_0xa07d('0x35')],_0x588351[_0xa07d('0x3f')]));if(_0x1a3308[_0xa07d('0x35')][_0xa07d('0x42')]){_0x308d77['where']=_['merge'](_0x308d77[_0xa07d('0x3e')],{'$or':_[_0xa07d('0x30')](_0x308d77[_0xa07d('0x38')],function(_0x2c51fe){var _0x236abb={};_0x236abb[_0x2c51fe]={'$like':'%'+_0x1a3308[_0xa07d('0x35')][_0xa07d('0x42')]+'%'};return _0x236abb;})});}_0x308d77=_['merge']({},_0x308d77,_0x1a3308[_0xa07d('0x43')]);return _0x27c09e[_0xa07d('0x50')](_0x308d77);}})[_0xa07d('0x2c')](function(_0x133c5a){if(_0x133c5a){_0x41616a=_0x133c5a[_0xa07d('0x3a')];if(!_0x1a3308[_0xa07d('0x35')][_0xa07d('0x3b')]('nolimit')){_0x308d77[_0xa07d('0x23')]=qs['limit'](_0x1a3308[_0xa07d('0x35')]['limit']);_0x308d77[_0xa07d('0x21')]=qs[_0xa07d('0x21')](_0x1a3308[_0xa07d('0x35')][_0xa07d('0x21')]);}return _0x27c09e[_0xa07d('0x50')](_0x308d77);}})[_0xa07d('0x2c')](function(_0x284499){if(_0x284499){return _0x284499?{'count':_0x41616a,'rows':_0x284499}:null;}})['then'](respondWithResult(_0x33a99f,null))['catch'](handleError(_0x33a99f,null));};exports[_0xa07d('0x52')]=function(_0x2f1047,_0x1af00e,_0xa8e333){var _0x289f0f={};var _0x3d5e96={};var _0x1a3d83;var _0x4ef022;return db[_0xa07d('0x4b')]['findOne']({'where':{'id':_0x2f1047['params']['id']}})['then'](handleEntityNotFound(_0x1af00e,null))[_0xa07d('0x2c')](function(_0x1a51b2){if(_0x1a51b2){_0x1a3d83=_0x1a51b2;_0x3d5e96[_0xa07d('0x33')]=_[_0xa07d('0x36')](db['DeskField']['rawAttributes']);_0x3d5e96[_0xa07d('0x35')]=_[_0xa07d('0x36')](_0x2f1047[_0xa07d('0x35')]);_0x3d5e96[_0xa07d('0x3f')]=_[_0xa07d('0x37')](_0x3d5e96[_0xa07d('0x33')],_0x3d5e96[_0xa07d('0x35')]);_0x289f0f[_0xa07d('0x38')]=_[_0xa07d('0x37')](_0x3d5e96['model'],qs[_0xa07d('0x39')](_0x2f1047[_0xa07d('0x35')][_0xa07d('0x39')]));_0x289f0f[_0xa07d('0x38')]=_0x289f0f['attributes'][_0xa07d('0x3a')]?_0x289f0f[_0xa07d('0x38')]:_0x3d5e96[_0xa07d('0x33')];_0x289f0f[_0xa07d('0x3c')]=qs['sort'](_0x2f1047[_0xa07d('0x35')][_0xa07d('0x3d')]);_0x289f0f[_0xa07d('0x3e')]=qs['filters'](_[_0xa07d('0x40')](_0x2f1047[_0xa07d('0x35')],_0x3d5e96[_0xa07d('0x3f')]));if(_0x2f1047[_0xa07d('0x35')][_0xa07d('0x42')]){_0x289f0f[_0xa07d('0x3e')]=_[_0xa07d('0x41')](_0x289f0f[_0xa07d('0x3e')],{'$or':_[_0xa07d('0x30')](_0x289f0f[_0xa07d('0x38')],function(_0x4b0faa){var _0x3129cc={};_0x3129cc[_0x4b0faa]={'$like':'%'+_0x2f1047[_0xa07d('0x35')][_0xa07d('0x42')]+'%'};return _0x3129cc;})});}_0x289f0f=_['merge']({},_0x289f0f,_0x2f1047[_0xa07d('0x43')]);return _0x1a3d83[_0xa07d('0x52')](_0x289f0f);}})[_0xa07d('0x2c')](function(_0x50d3bd){if(_0x50d3bd){_0x4ef022=_0x50d3bd[_0xa07d('0x3a')];if(!_0x2f1047[_0xa07d('0x35')]['hasOwnProperty'](_0xa07d('0x53'))){_0x289f0f[_0xa07d('0x23')]=qs[_0xa07d('0x23')](_0x2f1047[_0xa07d('0x35')][_0xa07d('0x23')]);_0x289f0f['offset']=qs[_0xa07d('0x21')](_0x2f1047[_0xa07d('0x35')][_0xa07d('0x21')]);}return _0x1a3d83[_0xa07d('0x52')](_0x289f0f);}})['then'](function(_0xcb531f){if(_0xcb531f){return _0xcb531f?{'count':_0x4ef022,'rows':_0xcb531f}:null;}})['then'](respondWithResult(_0x1af00e,null))[_0xa07d('0x4e')](handleError(_0x1af00e,null));};exports['getDescriptions']=function(_0x5e3346,_0x24a77c,_0x3aa52a){var _0x46e198={};var _0x226fc8={};var _0x23a1ed;var _0x52558c;return db[_0xa07d('0x4b')][_0xa07d('0x51')]({'where':{'id':_0x5e3346['params']['id']}})[_0xa07d('0x2c')](handleEntityNotFound(_0x24a77c,null))['then'](function(_0xa512f1){if(_0xa512f1){_0x23a1ed=_0xa512f1;_0x226fc8[_0xa07d('0x33')]=_[_0xa07d('0x36')](db[_0xa07d('0x54')][_0xa07d('0x4a')]);_0x226fc8[_0xa07d('0x35')]=_[_0xa07d('0x36')](_0x5e3346[_0xa07d('0x35')]);_0x226fc8[_0xa07d('0x3f')]=_[_0xa07d('0x37')](_0x226fc8[_0xa07d('0x33')],_0x226fc8[_0xa07d('0x35')]);_0x46e198[_0xa07d('0x38')]=_[_0xa07d('0x37')](_0x226fc8[_0xa07d('0x33')],qs[_0xa07d('0x39')](_0x5e3346['query'][_0xa07d('0x39')]));_0x46e198[_0xa07d('0x38')]=_0x46e198['attributes'][_0xa07d('0x3a')]?_0x46e198[_0xa07d('0x38')]:_0x226fc8[_0xa07d('0x33')];_0x46e198['order']=qs[_0xa07d('0x3d')](_0x5e3346[_0xa07d('0x35')][_0xa07d('0x3d')]);_0x46e198[_0xa07d('0x3e')]=qs[_0xa07d('0x3f')](_['pick'](_0x5e3346['query'],_0x226fc8[_0xa07d('0x3f')]));if(_0x5e3346[_0xa07d('0x35')][_0xa07d('0x42')]){_0x46e198[_0xa07d('0x3e')]=_['merge'](_0x46e198[_0xa07d('0x3e')],{'$or':_[_0xa07d('0x30')](_0x46e198[_0xa07d('0x38')],function(_0x3efe19){var _0x52a731={};_0x52a731[_0x3efe19]={'$like':'%'+_0x5e3346['query'][_0xa07d('0x42')]+'%'};return _0x52a731;})});}_0x46e198=_[_0xa07d('0x41')]({},_0x46e198,_0x5e3346[_0xa07d('0x43')]);return _0x23a1ed[_0xa07d('0x55')](_0x46e198);}})['then'](function(_0x3ace46){if(_0x3ace46){_0x52558c=_0x3ace46[_0xa07d('0x3a')];if(!_0x5e3346[_0xa07d('0x35')]['hasOwnProperty']('nolimit')){_0x46e198[_0xa07d('0x23')]=qs[_0xa07d('0x23')](_0x5e3346[_0xa07d('0x35')][_0xa07d('0x23')]);_0x46e198[_0xa07d('0x21')]=qs[_0xa07d('0x21')](_0x5e3346[_0xa07d('0x35')][_0xa07d('0x21')]);}return _0x23a1ed[_0xa07d('0x55')](_0x46e198);}})[_0xa07d('0x2c')](function(_0x5b8980){if(_0x5b8980){return _0x5b8980?{'count':_0x52558c,'rows':_0x5b8980}:null;}})[_0xa07d('0x2c')](respondWithResult(_0x24a77c,null))['catch'](handleError(_0x24a77c,null));};exports[_0xa07d('0x56')]=function(_0x500bcd,_0x5a1df7,_0x57b930){var _0x116b1f={};var _0x4b2196={};var _0x45117b;var _0x46d4ab;return db[_0xa07d('0x4b')]['findOne']({'where':{'id':_0x500bcd[_0xa07d('0x49')]['id']}})[_0xa07d('0x2c')](handleEntityNotFound(_0x5a1df7,null))[_0xa07d('0x2c')](function(_0x1f4c5e){if(_0x1f4c5e){_0x45117b=_0x1f4c5e;_0x4b2196[_0xa07d('0x33')]=_[_0xa07d('0x36')](db['Tag']['rawAttributes']);_0x4b2196[_0xa07d('0x35')]=_[_0xa07d('0x36')](_0x500bcd[_0xa07d('0x35')]);_0x4b2196[_0xa07d('0x3f')]=_[_0xa07d('0x37')](_0x4b2196[_0xa07d('0x33')],_0x4b2196[_0xa07d('0x35')]);_0x116b1f['attributes']=_[_0xa07d('0x37')](_0x4b2196[_0xa07d('0x33')],qs[_0xa07d('0x39')](_0x500bcd[_0xa07d('0x35')]['fields']));_0x116b1f[_0xa07d('0x38')]=_0x116b1f[_0xa07d('0x38')][_0xa07d('0x3a')]?_0x116b1f[_0xa07d('0x38')]:_0x4b2196[_0xa07d('0x33')];_0x116b1f[_0xa07d('0x3c')]=qs[_0xa07d('0x3d')](_0x500bcd[_0xa07d('0x35')]['sort']);_0x116b1f[_0xa07d('0x3e')]=qs[_0xa07d('0x3f')](_[_0xa07d('0x40')](_0x500bcd[_0xa07d('0x35')],_0x4b2196[_0xa07d('0x3f')]));if(_0x500bcd[_0xa07d('0x35')][_0xa07d('0x42')]){_0x116b1f[_0xa07d('0x3e')]=_[_0xa07d('0x41')](_0x116b1f['where'],{'$or':_[_0xa07d('0x30')](_0x116b1f[_0xa07d('0x38')],function(_0x38618b){var _0x2575bd={};_0x2575bd[_0x38618b]={'$like':'%'+_0x500bcd[_0xa07d('0x35')][_0xa07d('0x42')]+'%'};return _0x2575bd;})});}_0x116b1f=_[_0xa07d('0x41')]({},_0x116b1f,_0x500bcd[_0xa07d('0x43')]);return _0x45117b['getTags'](_0x116b1f);}})[_0xa07d('0x2c')](function(_0x587549){if(_0x587549){_0x46d4ab=_0x587549[_0xa07d('0x3a')];if(!_0x500bcd[_0xa07d('0x35')]['hasOwnProperty'](_0xa07d('0x53'))){_0x116b1f['limit']=qs['limit'](_0x500bcd[_0xa07d('0x35')][_0xa07d('0x23')]);_0x116b1f['offset']=qs[_0xa07d('0x21')](_0x500bcd[_0xa07d('0x35')][_0xa07d('0x21')]);}return _0x45117b[_0xa07d('0x56')](_0x116b1f);}})[_0xa07d('0x2c')](function(_0x1524d5){if(_0x1524d5){return _0x1524d5?{'count':_0x46d4ab,'rows':_0x1524d5}:null;}})[_0xa07d('0x2c')](respondWithResult(_0x5a1df7,null))[_0xa07d('0x4e')](handleError(_0x5a1df7,null));};exports['setTags']=function(_0x37eee5,_0x52e6fc,_0x12ef59){if(_0x37eee5['body']['id']){delete _0x37eee5['body']['id'];}return db[_0xa07d('0x4b')]['findOne']({'where':{'id':_0x37eee5[_0xa07d('0x49')]['id']}})[_0xa07d('0x2c')](handleEntityNotFound(_0x52e6fc,null))[_0xa07d('0x2c')](function(_0x432a38){if(_0x432a38){return _0x432a38[_0xa07d('0x57')](_0x37eee5[_0xa07d('0x4d')][_0xa07d('0x58')]||[]);}return null;})['then'](respondWithResult(_0x52e6fc,null))['catch'](handleError(_0x52e6fc,null));}; \ No newline at end of file +var _0xb16f=['rows','show','params','intersection','includeAll','find','create','catch','update','body','destroy','findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','end','sendStatus','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','DeskConfiguration'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xb16f,0x150));var _0xfb16=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb16f[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0xfb16('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb16('0x1'));var rp=require(_0xfb16('0x2'));var moment=require('moment');var BPromise=require(_0xfb16('0x3'));var Mustache=require(_0xfb16('0x4'));var util=require(_0xfb16('0x5'));var path=require('path');var sox=require(_0xfb16('0x6'));var csv=require(_0xfb16('0x7'));var ejs=require(_0xfb16('0x8'));var fs=require('fs');var fs_extra=require(_0xfb16('0x9'));var _=require('lodash');var squel=require(_0xfb16('0xa'));var crypto=require('crypto');var jsforce=require(_0xfb16('0xb'));var deskjs=require(_0xfb16('0xc'));var toCsv=require(_0xfb16('0x7'));var querystring=require('querystring');var Papa=require(_0xfb16('0xd'));var Redis=require('ioredis');var authService=require(_0xfb16('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb16('0xf'));var logger=require(_0xfb16('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xfb16('0x11'));var licenseUtil=require(_0xfb16('0x12'));var db=require(_0xfb16('0x13'))['db'];function respondWithStatusCode(_0x422758,_0x3d25c5){_0x3d25c5=_0x3d25c5||0xcc;return function(_0x10e5fe){if(_0x10e5fe){return _0x422758['sendStatus'](_0x3d25c5);}return _0x422758[_0xfb16('0x14')](_0x3d25c5)['end']();};}function respondWithResult(_0x3500f4,_0x517b4e){_0x517b4e=_0x517b4e||0xc8;return function(_0x24ef51){if(_0x24ef51){return _0x3500f4[_0xfb16('0x14')](_0x517b4e)[_0xfb16('0x15')](_0x24ef51);}};}function respondWithFilteredResult(_0x429b43,_0x3f08c7){return function(_0x52f3b8){if(_0x52f3b8){var _0x25f113=typeof _0x3f08c7[_0xfb16('0x16')]===_0xfb16('0x17')&&typeof _0x3f08c7[_0xfb16('0x18')]==='undefined';var _0x4a62f3=_0x52f3b8[_0xfb16('0x19')];var _0x5c6456=_0x25f113?0x0:_0x3f08c7[_0xfb16('0x16')];var _0x16010f=_0x25f113?_0x52f3b8[_0xfb16('0x19')]:_0x3f08c7[_0xfb16('0x16')]+_0x3f08c7['limit'];var _0x55364f;if(_0x16010f>=_0x4a62f3){_0x16010f=_0x4a62f3;_0x55364f=0xc8;}else{_0x55364f=0xce;}_0x429b43['status'](_0x55364f);return _0x429b43[_0xfb16('0x1a')](_0xfb16('0x1b'),_0x5c6456+'-'+_0x16010f+'/'+_0x4a62f3)[_0xfb16('0x15')](_0x52f3b8);}return null;};}function patchUpdates(_0x55512b){return function(_0x162b94){try{jsonpatch[_0xfb16('0x1c')](_0x162b94,_0x55512b,!![]);}catch(_0xe8de24){return BPromise['reject'](_0xe8de24);}return _0x162b94[_0xfb16('0x1d')]();};}function saveUpdates(_0x4ea658,_0x4991e9){return function(_0x4362f6){if(_0x4362f6){return _0x4362f6['update'](_0x4ea658)[_0xfb16('0x1e')](function(_0x571c58){return _0x571c58;});}return null;};}function removeEntity(_0x2486ba,_0x2499cf){return function(_0x1b8a52){if(_0x1b8a52){return _0x1b8a52['destroy']()[_0xfb16('0x1e')](function(){_0x2486ba['status'](0xcc)[_0xfb16('0x1f')]();});}};}function handleEntityNotFound(_0x46735d,_0x36dad9){return function(_0x2defe8){if(!_0x2defe8){_0x46735d[_0xfb16('0x20')](0x194);}return _0x2defe8;};}function handleError(_0x6eaf83,_0x2a9dc6){_0x2a9dc6=_0x2a9dc6||0x1f4;return function(_0x3a1f97){logger[_0xfb16('0x21')](_0x3a1f97[_0xfb16('0x22')]);if(_0x3a1f97[_0xfb16('0x23')]){delete _0x3a1f97[_0xfb16('0x23')];}_0x6eaf83[_0xfb16('0x14')](_0x2a9dc6)['send'](_0x3a1f97);};}exports['index']=function(_0x56995b,_0x4dd0bd){var _0x82265d={},_0x3dccb7={},_0x37ae2a={'count':0x0,'rows':[]};var _0x4f1ec4=_['map'](db['DeskConfiguration'][_0xfb16('0x24')],function(_0x2b2238){return{'name':_0x2b2238[_0xfb16('0x25')],'type':_0x2b2238[_0xfb16('0x26')][_0xfb16('0x27')]};});_0x3dccb7[_0xfb16('0x28')]=_['map'](_0x4f1ec4,_0xfb16('0x23'));_0x3dccb7[_0xfb16('0x29')]=_[_0xfb16('0x2a')](_0x56995b[_0xfb16('0x29')]);_0x3dccb7['filters']=_['intersection'](_0x3dccb7['model'],_0x3dccb7[_0xfb16('0x29')]);_0x82265d[_0xfb16('0x2b')]=_['intersection'](_0x3dccb7[_0xfb16('0x28')],qs[_0xfb16('0x2c')](_0x56995b[_0xfb16('0x29')][_0xfb16('0x2c')]));_0x82265d[_0xfb16('0x2b')]=_0x82265d[_0xfb16('0x2b')][_0xfb16('0x2d')]?_0x82265d[_0xfb16('0x2b')]:_0x3dccb7['model'];if(!_0x56995b[_0xfb16('0x29')]['hasOwnProperty'](_0xfb16('0x2e'))){_0x82265d[_0xfb16('0x18')]=qs[_0xfb16('0x18')](_0x56995b[_0xfb16('0x29')][_0xfb16('0x18')]);_0x82265d[_0xfb16('0x16')]=qs[_0xfb16('0x16')](_0x56995b[_0xfb16('0x29')]['offset']);}_0x82265d[_0xfb16('0x2f')]=qs[_0xfb16('0x30')](_0x56995b['query'][_0xfb16('0x30')]);_0x82265d[_0xfb16('0x31')]=qs[_0xfb16('0x32')](_[_0xfb16('0x33')](_0x56995b[_0xfb16('0x29')],_0x3dccb7[_0xfb16('0x32')]),_0x4f1ec4);if(_0x56995b[_0xfb16('0x29')][_0xfb16('0x34')]){_0x82265d[_0xfb16('0x31')]=_[_0xfb16('0x35')](_0x82265d[_0xfb16('0x31')],{'$or':_[_0xfb16('0x36')](_0x4f1ec4,function(_0xa2cc8c){if(_0xa2cc8c[_0xfb16('0x26')]!==_0xfb16('0x37')){var _0x352762={};_0x352762[_0xa2cc8c[_0xfb16('0x23')]]={'$like':'%'+_0x56995b[_0xfb16('0x29')][_0xfb16('0x34')]+'%'};return _0x352762;}})});}_0x82265d=_['merge']({},_0x82265d,_0x56995b[_0xfb16('0x38')]);var _0x40bdc2={'where':_0x82265d[_0xfb16('0x31')]};return db['DeskConfiguration'][_0xfb16('0x19')](_0x40bdc2)[_0xfb16('0x1e')](function(_0x129275){_0x37ae2a[_0xfb16('0x19')]=_0x129275;if(_0x56995b[_0xfb16('0x29')]['includeAll']){_0x82265d[_0xfb16('0x39')]=[{'all':!![]}];}return db[_0xfb16('0x3a')]['findAll'](_0x82265d);})[_0xfb16('0x1e')](function(_0x1f1f0b){_0x37ae2a[_0xfb16('0x3b')]=_0x1f1f0b;return _0x37ae2a;})['then'](respondWithFilteredResult(_0x4dd0bd,_0x82265d))['catch'](handleError(_0x4dd0bd,null));};exports[_0xfb16('0x3c')]=function(_0x3590fc,_0x973bd2){var _0x661302={'raw':![],'where':{'id':_0x3590fc[_0xfb16('0x3d')]['id']}},_0x2a0d0b={};_0x2a0d0b['model']=_[_0xfb16('0x2a')](db[_0xfb16('0x3a')]['rawAttributes']);_0x2a0d0b[_0xfb16('0x29')]=_[_0xfb16('0x2a')](_0x3590fc['query']);_0x2a0d0b['filters']=_[_0xfb16('0x3e')](_0x2a0d0b['model'],_0x2a0d0b[_0xfb16('0x29')]);_0x661302[_0xfb16('0x2b')]=_['intersection'](_0x2a0d0b['model'],qs[_0xfb16('0x2c')](_0x3590fc[_0xfb16('0x29')][_0xfb16('0x2c')]));_0x661302[_0xfb16('0x2b')]=_0x661302[_0xfb16('0x2b')]['length']?_0x661302[_0xfb16('0x2b')]:_0x2a0d0b[_0xfb16('0x28')];if(_0x3590fc['query'][_0xfb16('0x3f')]){_0x661302[_0xfb16('0x39')]=[{'all':!![]}];}_0x661302=_[_0xfb16('0x35')]({},_0x661302,_0x3590fc['options']);return db[_0xfb16('0x3a')][_0xfb16('0x40')](_0x661302)['then'](handleEntityNotFound(_0x973bd2,null))[_0xfb16('0x1e')](respondWithResult(_0x973bd2,null))['catch'](handleError(_0x973bd2,null));};exports[_0xfb16('0x41')]=function(_0x2d88b3,_0x325255){return db[_0xfb16('0x3a')]['create'](_0x2d88b3['body'],{})[_0xfb16('0x1e')](respondWithResult(_0x325255,0xc9))[_0xfb16('0x42')](handleError(_0x325255,null));};exports[_0xfb16('0x43')]=function(_0x11be1a,_0x21af96){if(_0x11be1a['body']['id']){delete _0x11be1a['body']['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x40')]({'where':{'id':_0x11be1a[_0xfb16('0x3d')]['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x21af96,null))[_0xfb16('0x1e')](saveUpdates(_0x11be1a[_0xfb16('0x44')],null))[_0xfb16('0x1e')](respondWithResult(_0x21af96,null))[_0xfb16('0x42')](handleError(_0x21af96,null));};exports[_0xfb16('0x45')]=function(_0x29bacb,_0x10dc4e){return db['DeskConfiguration']['find']({'where':{'id':_0x29bacb[_0xfb16('0x3d')]['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x10dc4e,null))[_0xfb16('0x1e')](removeEntity(_0x10dc4e,null))[_0xfb16('0x42')](handleError(_0x10dc4e,null));};exports['getFields']=function(_0x4116f2,_0x22f6f1,_0x1e8040){var _0x99b1d8={};var _0x4d32a3={};var _0x95772d;var _0x86b95;return db['DeskConfiguration'][_0xfb16('0x46')]({'where':{'id':_0x4116f2[_0xfb16('0x3d')]['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x22f6f1,null))[_0xfb16('0x1e')](function(_0x405534){if(_0x405534){_0x95772d=_0x405534;_0x4d32a3[_0xfb16('0x28')]=_[_0xfb16('0x2a')](db[_0xfb16('0x47')][_0xfb16('0x24')]);_0x4d32a3[_0xfb16('0x29')]=_[_0xfb16('0x2a')](_0x4116f2[_0xfb16('0x29')]);_0x4d32a3[_0xfb16('0x32')]=_[_0xfb16('0x3e')](_0x4d32a3[_0xfb16('0x28')],_0x4d32a3[_0xfb16('0x29')]);_0x99b1d8[_0xfb16('0x2b')]=_[_0xfb16('0x3e')](_0x4d32a3[_0xfb16('0x28')],qs[_0xfb16('0x2c')](_0x4116f2[_0xfb16('0x29')]['fields']));_0x99b1d8[_0xfb16('0x2b')]=_0x99b1d8[_0xfb16('0x2b')][_0xfb16('0x2d')]?_0x99b1d8[_0xfb16('0x2b')]:_0x4d32a3[_0xfb16('0x28')];_0x99b1d8[_0xfb16('0x2f')]=qs[_0xfb16('0x30')](_0x4116f2['query']['sort']);_0x99b1d8[_0xfb16('0x31')]=qs[_0xfb16('0x32')](_[_0xfb16('0x33')](_0x4116f2[_0xfb16('0x29')],_0x4d32a3[_0xfb16('0x32')]));if(_0x4116f2[_0xfb16('0x29')][_0xfb16('0x34')]){_0x99b1d8[_0xfb16('0x31')]=_['merge'](_0x99b1d8['where'],{'$or':_[_0xfb16('0x36')](_0x99b1d8['attributes'],function(_0x5cc638){var _0xbfe8ab={};_0xbfe8ab[_0x5cc638]={'$like':'%'+_0x4116f2[_0xfb16('0x29')][_0xfb16('0x34')]+'%'};return _0xbfe8ab;})});}_0x99b1d8=_[_0xfb16('0x35')]({},_0x99b1d8,_0x4116f2[_0xfb16('0x38')]);return _0x95772d['getFields'](_0x99b1d8);}})['then'](function(_0x446aa8){if(_0x446aa8){_0x86b95=_0x446aa8[_0xfb16('0x2d')];if(!_0x4116f2['query'][_0xfb16('0x48')](_0xfb16('0x2e'))){_0x99b1d8[_0xfb16('0x18')]=qs[_0xfb16('0x18')](_0x4116f2[_0xfb16('0x29')][_0xfb16('0x18')]);_0x99b1d8[_0xfb16('0x16')]=qs['offset'](_0x4116f2['query'][_0xfb16('0x16')]);}return _0x95772d['getFields'](_0x99b1d8);}})[_0xfb16('0x1e')](function(_0xd0fa33){if(_0xd0fa33){return _0xd0fa33?{'count':_0x86b95,'rows':_0xd0fa33}:null;}})['then'](respondWithResult(_0x22f6f1,null))[_0xfb16('0x42')](handleError(_0x22f6f1,null));};exports[_0xfb16('0x49')]=function(_0x1a64aa,_0x4aab28,_0x48fe80){var _0x54a470={};var _0x4f50a0={};var _0x15e96e;var _0x121fc4;return db['DeskConfiguration'][_0xfb16('0x46')]({'where':{'id':_0x1a64aa['params']['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x4aab28,null))['then'](function(_0x5c7023){if(_0x5c7023){_0x15e96e=_0x5c7023;_0x4f50a0['model']=_[_0xfb16('0x2a')](db[_0xfb16('0x47')][_0xfb16('0x24')]);_0x4f50a0[_0xfb16('0x29')]=_['keys'](_0x1a64aa[_0xfb16('0x29')]);_0x4f50a0['filters']=_[_0xfb16('0x3e')](_0x4f50a0['model'],_0x4f50a0[_0xfb16('0x29')]);_0x54a470[_0xfb16('0x2b')]=_[_0xfb16('0x3e')](_0x4f50a0[_0xfb16('0x28')],qs[_0xfb16('0x2c')](_0x1a64aa[_0xfb16('0x29')][_0xfb16('0x2c')]));_0x54a470[_0xfb16('0x2b')]=_0x54a470['attributes'][_0xfb16('0x2d')]?_0x54a470[_0xfb16('0x2b')]:_0x4f50a0[_0xfb16('0x28')];_0x54a470[_0xfb16('0x2f')]=qs['sort'](_0x1a64aa[_0xfb16('0x29')][_0xfb16('0x30')]);_0x54a470[_0xfb16('0x31')]=qs[_0xfb16('0x32')](_['pick'](_0x1a64aa[_0xfb16('0x29')],_0x4f50a0[_0xfb16('0x32')]));if(_0x1a64aa[_0xfb16('0x29')]['filter']){_0x54a470[_0xfb16('0x31')]=_[_0xfb16('0x35')](_0x54a470[_0xfb16('0x31')],{'$or':_['map'](_0x54a470[_0xfb16('0x2b')],function(_0x58f5bd){var _0x407a1e={};_0x407a1e[_0x58f5bd]={'$like':'%'+_0x1a64aa[_0xfb16('0x29')][_0xfb16('0x34')]+'%'};return _0x407a1e;})});}_0x54a470=_[_0xfb16('0x35')]({},_0x54a470,_0x1a64aa['options']);return _0x15e96e[_0xfb16('0x49')](_0x54a470);}})[_0xfb16('0x1e')](function(_0x10d1d9){if(_0x10d1d9){_0x121fc4=_0x10d1d9[_0xfb16('0x2d')];if(!_0x1a64aa[_0xfb16('0x29')]['hasOwnProperty'](_0xfb16('0x2e'))){_0x54a470[_0xfb16('0x18')]=qs[_0xfb16('0x18')](_0x1a64aa[_0xfb16('0x29')]['limit']);_0x54a470[_0xfb16('0x16')]=qs['offset'](_0x1a64aa[_0xfb16('0x29')][_0xfb16('0x16')]);}return _0x15e96e['getSubjects'](_0x54a470);}})[_0xfb16('0x1e')](function(_0x3cc65f){if(_0x3cc65f){return _0x3cc65f?{'count':_0x121fc4,'rows':_0x3cc65f}:null;}})[_0xfb16('0x1e')](respondWithResult(_0x4aab28,null))[_0xfb16('0x42')](handleError(_0x4aab28,null));};exports['getDescriptions']=function(_0x5eb3a5,_0x4cbf1d,_0x5cbd00){var _0x19e3ef={};var _0x5c0095={};var _0x1a3b3c;var _0x3d0f31;return db[_0xfb16('0x3a')][_0xfb16('0x46')]({'where':{'id':_0x5eb3a5[_0xfb16('0x3d')]['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x4cbf1d,null))[_0xfb16('0x1e')](function(_0x50d606){if(_0x50d606){_0x1a3b3c=_0x50d606;_0x5c0095[_0xfb16('0x28')]=_[_0xfb16('0x2a')](db[_0xfb16('0x47')][_0xfb16('0x24')]);_0x5c0095['query']=_[_0xfb16('0x2a')](_0x5eb3a5['query']);_0x5c0095[_0xfb16('0x32')]=_[_0xfb16('0x3e')](_0x5c0095[_0xfb16('0x28')],_0x5c0095[_0xfb16('0x29')]);_0x19e3ef[_0xfb16('0x2b')]=_['intersection'](_0x5c0095[_0xfb16('0x28')],qs[_0xfb16('0x2c')](_0x5eb3a5[_0xfb16('0x29')][_0xfb16('0x2c')]));_0x19e3ef[_0xfb16('0x2b')]=_0x19e3ef[_0xfb16('0x2b')][_0xfb16('0x2d')]?_0x19e3ef[_0xfb16('0x2b')]:_0x5c0095[_0xfb16('0x28')];_0x19e3ef[_0xfb16('0x2f')]=qs[_0xfb16('0x30')](_0x5eb3a5[_0xfb16('0x29')][_0xfb16('0x30')]);_0x19e3ef[_0xfb16('0x31')]=qs[_0xfb16('0x32')](_[_0xfb16('0x33')](_0x5eb3a5[_0xfb16('0x29')],_0x5c0095[_0xfb16('0x32')]));if(_0x5eb3a5[_0xfb16('0x29')][_0xfb16('0x34')]){_0x19e3ef[_0xfb16('0x31')]=_[_0xfb16('0x35')](_0x19e3ef[_0xfb16('0x31')],{'$or':_[_0xfb16('0x36')](_0x19e3ef[_0xfb16('0x2b')],function(_0x53bfb3){var _0x35de81={};_0x35de81[_0x53bfb3]={'$like':'%'+_0x5eb3a5[_0xfb16('0x29')]['filter']+'%'};return _0x35de81;})});}_0x19e3ef=_['merge']({},_0x19e3ef,_0x5eb3a5['options']);return _0x1a3b3c[_0xfb16('0x4a')](_0x19e3ef);}})[_0xfb16('0x1e')](function(_0x5d1430){if(_0x5d1430){_0x3d0f31=_0x5d1430[_0xfb16('0x2d')];if(!_0x5eb3a5['query'][_0xfb16('0x48')](_0xfb16('0x2e'))){_0x19e3ef[_0xfb16('0x18')]=qs[_0xfb16('0x18')](_0x5eb3a5[_0xfb16('0x29')]['limit']);_0x19e3ef['offset']=qs['offset'](_0x5eb3a5[_0xfb16('0x29')]['offset']);}return _0x1a3b3c[_0xfb16('0x4a')](_0x19e3ef);}})[_0xfb16('0x1e')](function(_0x2a3c6a){if(_0x2a3c6a){return _0x2a3c6a?{'count':_0x3d0f31,'rows':_0x2a3c6a}:null;}})[_0xfb16('0x1e')](respondWithResult(_0x4cbf1d,null))['catch'](handleError(_0x4cbf1d,null));};exports[_0xfb16('0x4b')]=function(_0x391094,_0x260808,_0x1cf0a3){var _0xc9cc46={};var _0x2c6d9f={};var _0x76e9dc;var _0x3e61af;return db['DeskConfiguration']['findOne']({'where':{'id':_0x391094['params']['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x260808,null))[_0xfb16('0x1e')](function(_0x2f7c8e){if(_0x2f7c8e){_0x76e9dc=_0x2f7c8e;_0x2c6d9f['model']=_['keys'](db[_0xfb16('0x4c')]['rawAttributes']);_0x2c6d9f[_0xfb16('0x29')]=_['keys'](_0x391094[_0xfb16('0x29')]);_0x2c6d9f[_0xfb16('0x32')]=_[_0xfb16('0x3e')](_0x2c6d9f[_0xfb16('0x28')],_0x2c6d9f[_0xfb16('0x29')]);_0xc9cc46[_0xfb16('0x2b')]=_[_0xfb16('0x3e')](_0x2c6d9f[_0xfb16('0x28')],qs[_0xfb16('0x2c')](_0x391094[_0xfb16('0x29')]['fields']));_0xc9cc46[_0xfb16('0x2b')]=_0xc9cc46[_0xfb16('0x2b')]['length']?_0xc9cc46['attributes']:_0x2c6d9f[_0xfb16('0x28')];_0xc9cc46[_0xfb16('0x2f')]=qs[_0xfb16('0x30')](_0x391094['query']['sort']);_0xc9cc46['where']=qs['filters'](_[_0xfb16('0x33')](_0x391094[_0xfb16('0x29')],_0x2c6d9f[_0xfb16('0x32')]));if(_0x391094[_0xfb16('0x29')][_0xfb16('0x34')]){_0xc9cc46[_0xfb16('0x31')]=_[_0xfb16('0x35')](_0xc9cc46[_0xfb16('0x31')],{'$or':_[_0xfb16('0x36')](_0xc9cc46[_0xfb16('0x2b')],function(_0x4e7832){var _0x388fe3={};_0x388fe3[_0x4e7832]={'$like':'%'+_0x391094[_0xfb16('0x29')][_0xfb16('0x34')]+'%'};return _0x388fe3;})});}_0xc9cc46=_[_0xfb16('0x35')]({},_0xc9cc46,_0x391094[_0xfb16('0x38')]);return _0x76e9dc['getTags'](_0xc9cc46);}})[_0xfb16('0x1e')](function(_0x152902){if(_0x152902){_0x3e61af=_0x152902['length'];if(!_0x391094[_0xfb16('0x29')][_0xfb16('0x48')](_0xfb16('0x2e'))){_0xc9cc46[_0xfb16('0x18')]=qs[_0xfb16('0x18')](_0x391094[_0xfb16('0x29')][_0xfb16('0x18')]);_0xc9cc46[_0xfb16('0x16')]=qs[_0xfb16('0x16')](_0x391094['query'][_0xfb16('0x16')]);}return _0x76e9dc[_0xfb16('0x4b')](_0xc9cc46);}})['then'](function(_0x429e91){if(_0x429e91){return _0x429e91?{'count':_0x3e61af,'rows':_0x429e91}:null;}})[_0xfb16('0x1e')](respondWithResult(_0x260808,null))[_0xfb16('0x42')](handleError(_0x260808,null));};exports['setTags']=function(_0x1c6bc1,_0x4fe52a,_0x7408bc){if(_0x1c6bc1[_0xfb16('0x44')]['id']){delete _0x1c6bc1[_0xfb16('0x44')]['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x46')]({'where':{'id':_0x1c6bc1['params']['id']}})[_0xfb16('0x1e')](handleEntityNotFound(_0x4fe52a,null))['then'](function(_0xbf1722){if(_0xbf1722){return _0xbf1722[_0xfb16('0x4d')](_0x1c6bc1[_0xfb16('0x44')][_0xfb16('0x4e')]||[]);}return null;})[_0xfb16('0x1e')](respondWithResult(_0x4fe52a,null))[_0xfb16('0x42')](handleError(_0x4fe52a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 1eeb9fb..e8aec12 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 _0xe43e=['./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x38b92b,_0x2239e3){var _0x1fd2a8=function(_0x265a27){while(--_0x265a27){_0x38b92b['push'](_0x38b92b['shift']());}};_0x1fd2a8(++_0x2239e3);}(_0xe43e,0x18a));var _0xee43=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0xe43e[_0x35b87c];return _0x24795b;};'use strict';var _=require(_0xee43('0x0'));var util=require(_0xee43('0x1'));var logger=require(_0xee43('0x2'))(_0xee43('0x3'));var moment=require(_0xee43('0x4'));var BPromise=require(_0xee43('0x5'));var rp=require(_0xee43('0x6'));var fs=require('fs');var path=require(_0xee43('0x7'));var rimraf=require(_0xee43('0x8'));var config=require('../../config/environment');var attributes=require(_0xee43('0x9'));module[_0xee43('0xa')]=function(_0x267ace,_0x27cd63){return _0x267ace[_0xee43('0xb')]('DeskConfiguration',attributes,{'tableName':_0xee43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','util'];(function(_0x1978fc,_0x398da2){var _0x1da73a=function(_0x8f23c2){while(--_0x8f23c2){_0x1978fc['push'](_0x1978fc['shift']());}};_0x1da73a(++_0x398da2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'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 d1ace72..ff771ba 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 _0xeec6=['jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xeec6,0x125));var _0x6eec=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0xeec6[_0x32f05c];return _0x4307ed;};'use strict';var _=require(_0x6eec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6eec('0x1'));var rs=require(_0x6eec('0x2'));var fs=require('fs');var Redis=require(_0x6eec('0x3'));var db=require(_0x6eec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eec('0x5'))(_0x6eec('0x6'));var config=require('../../config/environment');var jayson=require(_0x6eec('0x7'));var client=jayson[_0x6eec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174706,_0x34192c,_0x244491){return new BPromise(function(_0x1d30e1,_0x58a966){return client[_0x6eec('0x9')](_0x174706,_0x244491)[_0x6eec('0xa')](function(_0x422d71){logger['info'](_0x6eec('0xb'),_0x34192c,'request\x20sent');logger[_0x6eec('0xc')](_0x6eec('0xd'),_0x34192c,_0x6eec('0xe'),JSON['stringify'](_0x422d71));if(_0x422d71['error']){if(_0x422d71['error'][_0x6eec('0xf')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x34192c,_0x422d71['error'][_0x6eec('0x10')]);return _0x58a966(_0x422d71[_0x6eec('0x11')][_0x6eec('0x10')]);}logger['error'](_0x6eec('0xb'),_0x34192c,_0x422d71[_0x6eec('0x11')][_0x6eec('0x10')]);return _0x1d30e1(_0x422d71[_0x6eec('0x11')]['message']);}else{logger['info'](_0x6eec('0xb'),_0x34192c,_0x6eec('0xe'));_0x1d30e1(_0x422d71[_0x6eec('0x12')][_0x6eec('0x10')]);}})[_0x6eec('0x13')](function(_0x36135e){logger[_0x6eec('0x11')](_0x6eec('0xb'),_0x34192c,_0x36135e);_0x58a966(_0x36135e);});});} \ No newline at end of file +var _0x9bc7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','lodash'];(function(_0x526ffc,_0x2548d7){var _0x36ef31=function(_0x313f48){while(--_0x313f48){_0x526ffc['push'](_0x526ffc['shift']());}};_0x36ef31(++_0x2548d7);}(_0x9bc7,0x1cd));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x79bc('0x0'));var util=require(_0x79bc('0x1'));var moment=require(_0x79bc('0x2'));var BPromise=require(_0x79bc('0x3'));var rs=require(_0x79bc('0x4'));var fs=require('fs');var Redis=require(_0x79bc('0x5'));var db=require(_0x79bc('0x6'))['db'];var utils=require(_0x79bc('0x7'));var logger=require(_0x79bc('0x8'))(_0x79bc('0x9'));var config=require('../../config/environment');var jayson=require(_0x79bc('0xa'));var client=jayson[_0x79bc('0xb')][_0x79bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x559f38,_0xf0aefd,_0x4da6a3){return new BPromise(function(_0x450c79,_0x17b1cc){return client[_0x79bc('0xd')](_0x559f38,_0x4da6a3)[_0x79bc('0xe')](function(_0x6f370e){logger['info'](_0x79bc('0xf'),_0xf0aefd,'request\x20sent');logger[_0x79bc('0x10')](_0x79bc('0x11'),_0xf0aefd,'request\x20sent',JSON['stringify'](_0x6f370e));if(_0x6f370e[_0x79bc('0x12')]){if(_0x6f370e[_0x79bc('0x12')][_0x79bc('0x13')]===0x1f4){logger[_0x79bc('0x12')](_0x79bc('0xf'),_0xf0aefd,_0x6f370e[_0x79bc('0x12')][_0x79bc('0x14')]);return _0x17b1cc(_0x6f370e[_0x79bc('0x12')]['message']);}logger[_0x79bc('0x12')](_0x79bc('0xf'),_0xf0aefd,_0x6f370e[_0x79bc('0x12')][_0x79bc('0x14')]);return _0x450c79(_0x6f370e[_0x79bc('0x12')][_0x79bc('0x14')]);}else{logger['info'](_0x79bc('0xf'),_0xf0aefd,_0x79bc('0x15'));_0x450c79(_0x6f370e['result'][_0x79bc('0x14')]);}})['catch'](function(_0x403ebe){logger[_0x79bc('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xf0aefd,_0x403ebe);_0x17b1cc(_0x403ebe);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index beb560a..3acea56 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 _0xc4b2=['../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','update','delete','multer','util','path','connect-timeout','express'];(function(_0x18ac4a,_0x3970f0){var _0x48cb7a=function(_0x48ad44){while(--_0x48ad44){_0x18ac4a['push'](_0x18ac4a['shift']());}};_0x48cb7a(++_0x3970f0);}(_0xc4b2,0x113));var _0x2c4b=function(_0x3895b7,_0xd4796b){_0x3895b7=_0x3895b7-0x0;var _0x3f3b8c=_0xc4b2[_0x3895b7];return _0x3f3b8c;};'use strict';var multer=require(_0x2c4b('0x0'));var util=require(_0x2c4b('0x1'));var path=require(_0x2c4b('0x2'));var timeout=require(_0x2c4b('0x3'));var express=require(_0x2c4b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c4b('0x5'));var controller=require(_0x2c4b('0x6'));router[_0x2c4b('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c4b('0x8')]);router[_0x2c4b('0x7')](_0x2c4b('0x9'),auth[_0x2c4b('0xa')](),controller['show']);router[_0x2c4b('0xb')]('/',auth[_0x2c4b('0xa')](),controller['create']);router['put'](_0x2c4b('0x9'),auth[_0x2c4b('0xa')](),controller[_0x2c4b('0xc')]);router[_0x2c4b('0xd')](_0x2c4b('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8c2d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x312e17,_0x356a7d){var _0x1ca136=function(_0x54b683){while(--_0x54b683){_0x312e17['push'](_0x312e17['shift']());}};_0x1ca136(++_0x356a7d);}(_0x8c2d,0x1cb));var _0xd8c2=function(_0x3d6606,_0x1e9ed3){_0x3d6606=_0x3d6606-0x0;var _0x241e05=_0x8c2d[_0x3d6606];return _0x241e05;};'use strict';var multer=require(_0xd8c2('0x0'));var util=require(_0xd8c2('0x1'));var path=require(_0xd8c2('0x2'));var timeout=require(_0xd8c2('0x3'));var express=require(_0xd8c2('0x4'));var router=express[_0xd8c2('0x5')]();var fs_extra=require(_0xd8c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd8c2('0x7'));var config=require('../../config/environment');var controller=require(_0xd8c2('0x8'));router['get']('/',auth[_0xd8c2('0x9')](),controller[_0xd8c2('0xa')]);router['get'](_0xd8c2('0xb'),auth['isAuthenticated'](),controller[_0xd8c2('0xc')]);router[_0xd8c2('0xd')]('/',auth['isAuthenticated'](),controller[_0xd8c2('0xe')]);router[_0xd8c2('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd8c2('0x10')](_0xd8c2('0xb'),auth[_0xd8c2('0x9')](),controller[_0xd8c2('0x11')]);module[_0xd8c2('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 7b54c54..9e2daa7 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 _0x972c=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x972c,0x160));var _0xc972=function(_0x796f9a,_0x3fea8f){_0x796f9a=_0x796f9a-0x0;var _0x1b08da=_0x972c[_0x796f9a];return _0x1b08da;};'use strict';var Sequelize=require(_0xc972('0x0'));module[_0xc972('0x1')]={'type':{'type':Sequelize[_0xc972('0x2')](_0xc972('0x3'),_0xc972('0x4'),_0xc972('0x5'),_0xc972('0x6'),_0xc972('0x7')),'defaultValue':_0xc972('0x3')},'content':{'type':Sequelize[_0xc972('0x8')]},'key':{'type':Sequelize[_0xc972('0x8')]},'keyType':{'type':Sequelize[_0xc972('0x2')](_0xc972('0x3'),_0xc972('0x4'),_0xc972('0x5'))},'keyContent':{'type':Sequelize[_0xc972('0x8')]},'idField':{'type':Sequelize[_0xc972('0x8')]},'nameField':{'type':Sequelize[_0xc972('0x8')]},'customField':{'type':Sequelize[_0xc972('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe31a=['picklist','STRING','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x3dc620,_0x4b3171){var _0x361690=function(_0x435608){while(--_0x435608){_0x3dc620['push'](_0x3dc620['shift']());}};_0x361690(++_0x4b3171);}(_0xe31a,0x15b));var _0xae31=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xe31a[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xae31('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xae31('0x1'),_0xae31('0x2'),_0xae31('0x3'),_0xae31('0x4'),_0xae31('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xae31('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xae31('0x1'),_0xae31('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xae31('0x6')]},'idField':{'type':Sequelize[_0xae31('0x6')]},'nameField':{'type':Sequelize[_0xae31('0x6')]},'customField':{'type':Sequelize[_0xae31('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae31('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6f3cffd..c20ef1e 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 _0x2d06=['count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x2d06,0x157));var _0x62d0=function(_0x3a83d0,_0x1a155b){_0x3a83d0=_0x3a83d0-0x0;var _0x192fb0=_0x2d06[_0x3a83d0];return _0x192fb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62d0('0x0'));var zipdir=require(_0x62d0('0x1'));var jsonpatch=require(_0x62d0('0x2'));var rp=require(_0x62d0('0x3'));var moment=require('moment');var BPromise=require(_0x62d0('0x4'));var Mustache=require(_0x62d0('0x5'));var util=require(_0x62d0('0x6'));var path=require(_0x62d0('0x7'));var sox=require('sox');var csv=require(_0x62d0('0x8'));var ejs=require(_0x62d0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62d0('0xa'));var squel=require(_0x62d0('0xb'));var crypto=require('crypto');var jsforce=require(_0x62d0('0xc'));var deskjs=require(_0x62d0('0xd'));var toCsv=require(_0x62d0('0x8'));var querystring=require(_0x62d0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x62d0('0xf'));var qs=require(_0x62d0('0x10'));var as=require(_0x62d0('0x11'));var hardwareService=require(_0x62d0('0x12'));var logger=require(_0x62d0('0x13'))(_0x62d0('0x14'));var utils=require(_0x62d0('0x15'));var config=require(_0x62d0('0x16'));var licenseUtil=require(_0x62d0('0x17'));var db=require(_0x62d0('0x18'))['db'];function respondWithStatusCode(_0x1670ca,_0x1ff948){_0x1ff948=_0x1ff948||0xcc;return function(_0x3a5678){if(_0x3a5678){return _0x1670ca[_0x62d0('0x19')](_0x1ff948);}return _0x1670ca['status'](_0x1ff948)[_0x62d0('0x1a')]();};}function respondWithResult(_0x23376e,_0x603b69){_0x603b69=_0x603b69||0xc8;return function(_0x59d179){if(_0x59d179){return _0x23376e[_0x62d0('0x1b')](_0x603b69)[_0x62d0('0x1c')](_0x59d179);}};}function respondWithFilteredResult(_0x579780,_0x1a6e41){return function(_0x23161d){if(_0x23161d){var _0x2591dc=typeof _0x1a6e41[_0x62d0('0x1d')]==='undefined'&&typeof _0x1a6e41[_0x62d0('0x1e')]===_0x62d0('0x1f');var _0x5b4006=_0x23161d[_0x62d0('0x20')];var _0x12036c=_0x2591dc?0x0:_0x1a6e41['offset'];var _0x1e7076=_0x2591dc?_0x23161d['count']:_0x1a6e41[_0x62d0('0x1d')]+_0x1a6e41[_0x62d0('0x1e')];var _0xf168e9;if(_0x1e7076>=_0x5b4006){_0x1e7076=_0x5b4006;_0xf168e9=0xc8;}else{_0xf168e9=0xce;}_0x579780['status'](_0xf168e9);return _0x579780[_0x62d0('0x21')](_0x62d0('0x22'),_0x12036c+'-'+_0x1e7076+'/'+_0x5b4006)[_0x62d0('0x1c')](_0x23161d);}return null;};}function patchUpdates(_0x5503dc){return function(_0x3a39cb){try{jsonpatch['apply'](_0x3a39cb,_0x5503dc,!![]);}catch(_0x186860){return BPromise['reject'](_0x186860);}return _0x3a39cb[_0x62d0('0x23')]();};}function saveUpdates(_0x522bd6,_0x200d3f){return function(_0x211fc7){if(_0x211fc7){return _0x211fc7['update'](_0x522bd6)[_0x62d0('0x24')](function(_0x5dd319){return _0x5dd319;});}return null;};}function removeEntity(_0xb1ceae,_0x495aba){return function(_0x3253be){if(_0x3253be){return _0x3253be[_0x62d0('0x25')]()[_0x62d0('0x24')](function(){_0xb1ceae['status'](0xcc)[_0x62d0('0x1a')]();});}};}function handleEntityNotFound(_0x130bc6,_0x4979f6){return function(_0x479dd1){if(!_0x479dd1){_0x130bc6['sendStatus'](0x194);}return _0x479dd1;};}function handleError(_0x48bc12,_0x6846b4){_0x6846b4=_0x6846b4||0x1f4;return function(_0x15de54){logger[_0x62d0('0x26')](_0x15de54[_0x62d0('0x27')]);if(_0x15de54[_0x62d0('0x28')]){delete _0x15de54['name'];}_0x48bc12['status'](_0x6846b4)[_0x62d0('0x29')](_0x15de54);};}exports[_0x62d0('0x2a')]=function(_0xeac742,_0x2472cd){var _0x502620={},_0x44e51b={},_0x5e8cd2={'count':0x0,'rows':[]};var _0xb9f97c=_[_0x62d0('0x2b')](db[_0x62d0('0x2c')][_0x62d0('0x2d')],function(_0x35dd07){return{'name':_0x35dd07[_0x62d0('0x2e')],'type':_0x35dd07[_0x62d0('0x2f')][_0x62d0('0x30')]};});_0x44e51b[_0x62d0('0x31')]=_[_0x62d0('0x2b')](_0xb9f97c,_0x62d0('0x28'));_0x44e51b[_0x62d0('0x32')]=_['keys'](_0xeac742['query']);_0x44e51b['filters']=_[_0x62d0('0x33')](_0x44e51b[_0x62d0('0x31')],_0x44e51b['query']);_0x502620[_0x62d0('0x34')]=_[_0x62d0('0x33')](_0x44e51b['model'],qs[_0x62d0('0x35')](_0xeac742[_0x62d0('0x32')][_0x62d0('0x35')]));_0x502620['attributes']=_0x502620[_0x62d0('0x34')]['length']?_0x502620['attributes']:_0x44e51b[_0x62d0('0x31')];if(!_0xeac742[_0x62d0('0x32')]['hasOwnProperty'](_0x62d0('0x36'))){_0x502620[_0x62d0('0x1e')]=qs[_0x62d0('0x1e')](_0xeac742['query'][_0x62d0('0x1e')]);_0x502620[_0x62d0('0x1d')]=qs[_0x62d0('0x1d')](_0xeac742[_0x62d0('0x32')]['offset']);}_0x502620['order']=qs[_0x62d0('0x37')](_0xeac742[_0x62d0('0x32')][_0x62d0('0x37')]);_0x502620[_0x62d0('0x38')]=qs[_0x62d0('0x39')](_[_0x62d0('0x3a')](_0xeac742[_0x62d0('0x32')],_0x44e51b['filters']),_0xb9f97c);if(_0xeac742[_0x62d0('0x32')]['filter']){_0x502620['where']=_[_0x62d0('0x3b')](_0x502620[_0x62d0('0x38')],{'$or':_[_0x62d0('0x2b')](_0xb9f97c,function(_0x371417){if(_0x371417[_0x62d0('0x2f')]!==_0x62d0('0x3c')){var _0x447984={};_0x447984[_0x371417['name']]={'$like':'%'+_0xeac742['query'][_0x62d0('0x3d')]+'%'};return _0x447984;}})});}_0x502620=_[_0x62d0('0x3b')]({},_0x502620,_0xeac742[_0x62d0('0x3e')]);var _0x4c3d8c={'where':_0x502620[_0x62d0('0x38')]};return db[_0x62d0('0x2c')]['count'](_0x4c3d8c)['then'](function(_0x374753){_0x5e8cd2['count']=_0x374753;if(_0xeac742[_0x62d0('0x32')][_0x62d0('0x3f')]){_0x502620['include']=[{'all':!![]}];}return db[_0x62d0('0x2c')][_0x62d0('0x40')](_0x502620);})[_0x62d0('0x24')](function(_0x2c20f7){_0x5e8cd2[_0x62d0('0x41')]=_0x2c20f7;return _0x5e8cd2;})[_0x62d0('0x24')](respondWithFilteredResult(_0x2472cd,_0x502620))[_0x62d0('0x42')](handleError(_0x2472cd,null));};exports[_0x62d0('0x43')]=function(_0xf25730,_0x40ccad){var _0x56417c={'raw':!![],'where':{'id':_0xf25730[_0x62d0('0x44')]['id']}},_0x3f9f34={};_0x3f9f34['model']=_[_0x62d0('0x45')](db[_0x62d0('0x2c')][_0x62d0('0x2d')]);_0x3f9f34[_0x62d0('0x32')]=_[_0x62d0('0x45')](_0xf25730[_0x62d0('0x32')]);_0x3f9f34[_0x62d0('0x39')]=_[_0x62d0('0x33')](_0x3f9f34['model'],_0x3f9f34[_0x62d0('0x32')]);_0x56417c[_0x62d0('0x34')]=_[_0x62d0('0x33')](_0x3f9f34[_0x62d0('0x31')],qs[_0x62d0('0x35')](_0xf25730[_0x62d0('0x32')]['fields']));_0x56417c[_0x62d0('0x34')]=_0x56417c[_0x62d0('0x34')][_0x62d0('0x46')]?_0x56417c['attributes']:_0x3f9f34[_0x62d0('0x31')];if(_0xf25730[_0x62d0('0x32')][_0x62d0('0x3f')]){_0x56417c[_0x62d0('0x47')]=[{'all':!![]}];}_0x56417c=_[_0x62d0('0x3b')]({},_0x56417c,_0xf25730[_0x62d0('0x3e')]);return db[_0x62d0('0x2c')][_0x62d0('0x48')](_0x56417c)[_0x62d0('0x24')](handleEntityNotFound(_0x40ccad,null))[_0x62d0('0x24')](respondWithResult(_0x40ccad,null))['catch'](handleError(_0x40ccad,null));};exports[_0x62d0('0x49')]=function(_0x11cb13,_0x5219dd){return db['DeskField'][_0x62d0('0x49')](_0x11cb13[_0x62d0('0x4a')],{})['then'](respondWithResult(_0x5219dd,0xc9))[_0x62d0('0x42')](handleError(_0x5219dd,null));};exports['update']=function(_0x48aa62,_0x3f92b8){if(_0x48aa62[_0x62d0('0x4a')]['id']){delete _0x48aa62[_0x62d0('0x4a')]['id'];}return db[_0x62d0('0x2c')]['find']({'where':{'id':_0x48aa62[_0x62d0('0x44')]['id']}})[_0x62d0('0x24')](handleEntityNotFound(_0x3f92b8,null))['then'](saveUpdates(_0x48aa62[_0x62d0('0x4a')],null))[_0x62d0('0x24')](respondWithResult(_0x3f92b8,null))[_0x62d0('0x42')](handleError(_0x3f92b8,null));};exports[_0x62d0('0x25')]=function(_0x1a35c3,_0x180667){return db[_0x62d0('0x2c')][_0x62d0('0x48')]({'where':{'id':_0x1a35c3[_0x62d0('0x44')]['id']}})[_0x62d0('0x24')](handleEntityNotFound(_0x180667,null))[_0x62d0('0x24')](removeEntity(_0x180667,null))[_0x62d0('0x42')](handleError(_0x180667,null));}; \ No newline at end of file +var _0x6299=['keys','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','then','destroy','error','stack','name','send','index','map','DeskField','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params'];(function(_0x417b1e,_0xd72636){var _0x46526f=function(_0x2b9506){while(--_0x2b9506){_0x417b1e['push'](_0x417b1e['shift']());}};_0x46526f(++_0xd72636);}(_0x6299,0x169));var _0x9629=function(_0x36f340,_0x4838d0){_0x36f340=_0x36f340-0x0;var _0x277e50=_0x6299[_0x36f340];return _0x277e50;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9629('0x0'));var jsonpatch=require(_0x9629('0x1'));var rp=require(_0x9629('0x2'));var moment=require(_0x9629('0x3'));var BPromise=require(_0x9629('0x4'));var Mustache=require(_0x9629('0x5'));var util=require('util');var path=require(_0x9629('0x6'));var sox=require(_0x9629('0x7'));var csv=require(_0x9629('0x8'));var ejs=require(_0x9629('0x9'));var fs=require('fs');var fs_extra=require(_0x9629('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9629('0xb'));var jsforce=require(_0x9629('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9629('0xd'));var Redis=require(_0x9629('0xe'));var authService=require(_0x9629('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9629('0x10'));var hardwareService=require(_0x9629('0x11'));var logger=require(_0x9629('0x12'))('api');var utils=require(_0x9629('0x13'));var config=require(_0x9629('0x14'));var licenseUtil=require(_0x9629('0x15'));var db=require(_0x9629('0x16'))['db'];function respondWithStatusCode(_0x37a60e,_0x4e7334){_0x4e7334=_0x4e7334||0xcc;return function(_0x2e2964){if(_0x2e2964){return _0x37a60e[_0x9629('0x17')](_0x4e7334);}return _0x37a60e[_0x9629('0x18')](_0x4e7334)[_0x9629('0x19')]();};}function respondWithResult(_0x216adc,_0x196eef){_0x196eef=_0x196eef||0xc8;return function(_0x5358c5){if(_0x5358c5){return _0x216adc[_0x9629('0x18')](_0x196eef)[_0x9629('0x1a')](_0x5358c5);}};}function respondWithFilteredResult(_0x73793b,_0x1fdf53){return function(_0xa4b554){if(_0xa4b554){var _0x365c6d=typeof _0x1fdf53['offset']===_0x9629('0x1b')&&typeof _0x1fdf53[_0x9629('0x1c')]===_0x9629('0x1b');var _0x33c7f3=_0xa4b554[_0x9629('0x1d')];var _0x3f777a=_0x365c6d?0x0:_0x1fdf53[_0x9629('0x1e')];var _0x447f28=_0x365c6d?_0xa4b554[_0x9629('0x1d')]:_0x1fdf53['offset']+_0x1fdf53[_0x9629('0x1c')];var _0x57ce58;if(_0x447f28>=_0x33c7f3){_0x447f28=_0x33c7f3;_0x57ce58=0xc8;}else{_0x57ce58=0xce;}_0x73793b[_0x9629('0x18')](_0x57ce58);return _0x73793b[_0x9629('0x1f')]('Content-Range',_0x3f777a+'-'+_0x447f28+'/'+_0x33c7f3)[_0x9629('0x1a')](_0xa4b554);}return null;};}function patchUpdates(_0x4ab24f){return function(_0x3a4c7a){try{jsonpatch[_0x9629('0x20')](_0x3a4c7a,_0x4ab24f,!![]);}catch(_0x1746cd){return BPromise['reject'](_0x1746cd);}return _0x3a4c7a['save']();};}function saveUpdates(_0x248d17,_0x169576){return function(_0x2956ed){if(_0x2956ed){return _0x2956ed['update'](_0x248d17)[_0x9629('0x21')](function(_0x7a93de){return _0x7a93de;});}return null;};}function removeEntity(_0xfc1c2c,_0x4ae0c7){return function(_0x5caac4){if(_0x5caac4){return _0x5caac4[_0x9629('0x22')]()[_0x9629('0x21')](function(){_0xfc1c2c[_0x9629('0x18')](0xcc)[_0x9629('0x19')]();});}};}function handleEntityNotFound(_0x1232ec,_0xaa1b76){return function(_0x4ae694){if(!_0x4ae694){_0x1232ec[_0x9629('0x17')](0x194);}return _0x4ae694;};}function handleError(_0x499bb3,_0x25ae31){_0x25ae31=_0x25ae31||0x1f4;return function(_0x1db0d9){logger[_0x9629('0x23')](_0x1db0d9[_0x9629('0x24')]);if(_0x1db0d9[_0x9629('0x25')]){delete _0x1db0d9[_0x9629('0x25')];}_0x499bb3[_0x9629('0x18')](_0x25ae31)[_0x9629('0x26')](_0x1db0d9);};}exports[_0x9629('0x27')]=function(_0x52f5cd,_0x9adda2){var _0x33b1cd={},_0x596376={},_0x2426e9={'count':0x0,'rows':[]};var _0x27cf36=_[_0x9629('0x28')](db[_0x9629('0x29')]['rawAttributes'],function(_0x3d6859){return{'name':_0x3d6859[_0x9629('0x2a')],'type':_0x3d6859['type'][_0x9629('0x2b')]};});_0x596376['model']=_[_0x9629('0x28')](_0x27cf36,_0x9629('0x25'));_0x596376['query']=_['keys'](_0x52f5cd[_0x9629('0x2c')]);_0x596376[_0x9629('0x2d')]=_[_0x9629('0x2e')](_0x596376[_0x9629('0x2f')],_0x596376[_0x9629('0x2c')]);_0x33b1cd[_0x9629('0x30')]=_[_0x9629('0x2e')](_0x596376[_0x9629('0x2f')],qs[_0x9629('0x31')](_0x52f5cd[_0x9629('0x2c')][_0x9629('0x31')]));_0x33b1cd['attributes']=_0x33b1cd[_0x9629('0x30')]['length']?_0x33b1cd[_0x9629('0x30')]:_0x596376[_0x9629('0x2f')];if(!_0x52f5cd[_0x9629('0x2c')][_0x9629('0x32')](_0x9629('0x33'))){_0x33b1cd['limit']=qs[_0x9629('0x1c')](_0x52f5cd[_0x9629('0x2c')][_0x9629('0x1c')]);_0x33b1cd[_0x9629('0x1e')]=qs[_0x9629('0x1e')](_0x52f5cd[_0x9629('0x2c')]['offset']);}_0x33b1cd[_0x9629('0x34')]=qs[_0x9629('0x35')](_0x52f5cd['query']['sort']);_0x33b1cd[_0x9629('0x36')]=qs[_0x9629('0x2d')](_[_0x9629('0x37')](_0x52f5cd['query'],_0x596376[_0x9629('0x2d')]),_0x27cf36);if(_0x52f5cd[_0x9629('0x2c')][_0x9629('0x38')]){_0x33b1cd[_0x9629('0x36')]=_[_0x9629('0x39')](_0x33b1cd[_0x9629('0x36')],{'$or':_[_0x9629('0x28')](_0x27cf36,function(_0x182a38){if(_0x182a38[_0x9629('0x3a')]!==_0x9629('0x3b')){var _0x29c189={};_0x29c189[_0x182a38['name']]={'$like':'%'+_0x52f5cd[_0x9629('0x2c')][_0x9629('0x38')]+'%'};return _0x29c189;}})});}_0x33b1cd=_[_0x9629('0x39')]({},_0x33b1cd,_0x52f5cd['options']);var _0x2d7c09={'where':_0x33b1cd[_0x9629('0x36')]};return db['DeskField'][_0x9629('0x1d')](_0x2d7c09)[_0x9629('0x21')](function(_0x5538fb){_0x2426e9['count']=_0x5538fb;if(_0x52f5cd[_0x9629('0x2c')][_0x9629('0x3c')]){_0x33b1cd[_0x9629('0x3d')]=[{'all':!![]}];}return db[_0x9629('0x29')]['findAll'](_0x33b1cd);})[_0x9629('0x21')](function(_0x16734a){_0x2426e9[_0x9629('0x3e')]=_0x16734a;return _0x2426e9;})[_0x9629('0x21')](respondWithFilteredResult(_0x9adda2,_0x33b1cd))['catch'](handleError(_0x9adda2,null));};exports[_0x9629('0x3f')]=function(_0x423dc6,_0x127dab){var _0x5052c1={'raw':!![],'where':{'id':_0x423dc6[_0x9629('0x40')]['id']}},_0x59efb8={};_0x59efb8[_0x9629('0x2f')]=_[_0x9629('0x41')](db['DeskField']['rawAttributes']);_0x59efb8[_0x9629('0x2c')]=_[_0x9629('0x41')](_0x423dc6[_0x9629('0x2c')]);_0x59efb8[_0x9629('0x2d')]=_[_0x9629('0x2e')](_0x59efb8[_0x9629('0x2f')],_0x59efb8['query']);_0x5052c1[_0x9629('0x30')]=_[_0x9629('0x2e')](_0x59efb8[_0x9629('0x2f')],qs[_0x9629('0x31')](_0x423dc6[_0x9629('0x2c')][_0x9629('0x31')]));_0x5052c1[_0x9629('0x30')]=_0x5052c1['attributes']['length']?_0x5052c1[_0x9629('0x30')]:_0x59efb8[_0x9629('0x2f')];if(_0x423dc6[_0x9629('0x2c')][_0x9629('0x3c')]){_0x5052c1[_0x9629('0x3d')]=[{'all':!![]}];}_0x5052c1=_['merge']({},_0x5052c1,_0x423dc6['options']);return db[_0x9629('0x29')][_0x9629('0x42')](_0x5052c1)[_0x9629('0x21')](handleEntityNotFound(_0x127dab,null))['then'](respondWithResult(_0x127dab,null))[_0x9629('0x43')](handleError(_0x127dab,null));};exports['create']=function(_0x32d979,_0x3cc5ee){return db[_0x9629('0x29')][_0x9629('0x44')](_0x32d979[_0x9629('0x45')],{})['then'](respondWithResult(_0x3cc5ee,0xc9))[_0x9629('0x43')](handleError(_0x3cc5ee,null));};exports[_0x9629('0x46')]=function(_0x553cf9,_0x315b73){if(_0x553cf9['body']['id']){delete _0x553cf9[_0x9629('0x45')]['id'];}return db['DeskField'][_0x9629('0x42')]({'where':{'id':_0x553cf9[_0x9629('0x40')]['id']}})[_0x9629('0x21')](handleEntityNotFound(_0x315b73,null))[_0x9629('0x21')](saveUpdates(_0x553cf9[_0x9629('0x45')],null))[_0x9629('0x21')](respondWithResult(_0x315b73,null))[_0x9629('0x43')](handleError(_0x315b73,null));};exports[_0x9629('0x22')]=function(_0x4dc231,_0x4388cf){return db[_0x9629('0x29')][_0x9629('0x42')]({'where':{'id':_0x4dc231[_0x9629('0x40')]['id']}})[_0x9629('0x21')](handleEntityNotFound(_0x4388cf,null))[_0x9629('0x21')](removeEntity(_0x4388cf,null))[_0x9629('0x43')](handleError(_0x4388cf,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1c6d49b..f691ced 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 _0x4688=['../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xf47317,_0x1a3568){var _0x1e449d=function(_0x5ee4a4){while(--_0x5ee4a4){_0xf47317['push'](_0xf47317['shift']());}};_0x1e449d(++_0x1a3568);}(_0x4688,0x1e8));var _0x8468=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x4688[_0x3e6729];return _0x535bcd;};'use strict';var _=require(_0x8468('0x0'));var util=require(_0x8468('0x1'));var logger=require(_0x8468('0x2'))(_0x8468('0x3'));var moment=require('moment');var BPromise=require(_0x8468('0x4'));var rp=require(_0x8468('0x5'));var fs=require('fs');var path=require(_0x8468('0x6'));var rimraf=require('rimraf');var config=require(_0x8468('0x7'));var attributes=require(_0x8468('0x8'));module[_0x8468('0x9')]=function(_0x38ea1e,_0x38d224){return _0x38ea1e['define'](_0x8468('0xa'),attributes,{'tableName':_0x8468('0xb'),'paranoid':![],'indexes':[{'name':_0x8468('0xc'),'fields':[_0x8468('0xd'),_0x8468('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8744=['FieldId','lodash','util','api','moment','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField','desk_unique_index'];(function(_0x2145c0,_0x549319){var _0x4c613a=function(_0x4e7350){while(--_0x4e7350){_0x2145c0['push'](_0x2145c0['shift']());}};_0x4c613a(++_0x549319);}(_0x8744,0x79));var _0x4874=function(_0x3b52e8,_0x3ef0d5){_0x3b52e8=_0x3b52e8-0x0;var _0x3fb4eb=_0x8744[_0x3b52e8];return _0x3fb4eb;};'use strict';var _=require(_0x4874('0x0'));var util=require(_0x4874('0x1'));var logger=require('../../config/logger')(_0x4874('0x2'));var moment=require(_0x4874('0x3'));var BPromise=require('bluebird');var rp=require(_0x4874('0x4'));var fs=require('fs');var path=require(_0x4874('0x5'));var rimraf=require('rimraf');var config=require(_0x4874('0x6'));var attributes=require(_0x4874('0x7'));module[_0x4874('0x8')]=function(_0x1e2cb1,_0x271c3d){return _0x1e2cb1['define'](_0x4874('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x4874('0xa'),'fields':['idField',_0x4874('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 2ce4e98..37b1f76 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 _0x0f4d=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0f4d,0xcd));var _0xd0f4=function(_0x476c0b,_0x493a36){_0x476c0b=_0x476c0b-0x0;var _0x31606d=_0x0f4d[_0x476c0b];return _0x31606d;};'use strict';var _=require(_0xd0f4('0x0'));var util=require(_0xd0f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd0f4('0x2'));var fs=require('fs');var Redis=require(_0xd0f4('0x3'));var db=require(_0xd0f4('0x4'))['db'];var utils=require(_0xd0f4('0x5'));var logger=require(_0xd0f4('0x6'))(_0xd0f4('0x7'));var config=require('../../config/environment');var jayson=require(_0xd0f4('0x8'));var client=jayson[_0xd0f4('0x9')][_0xd0f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16835,_0x45509f,_0x5c8f2d){return new BPromise(function(_0x129449,_0x14a4f0){return client[_0xd0f4('0xb')](_0x16835,_0x5c8f2d)['then'](function(_0x3ed49d){logger['info'](_0xd0f4('0xc'),_0x45509f,'request\x20sent');logger[_0xd0f4('0xd')](_0xd0f4('0xe'),_0x45509f,_0xd0f4('0xf'),JSON[_0xd0f4('0x10')](_0x3ed49d));if(_0x3ed49d[_0xd0f4('0x11')]){if(_0x3ed49d[_0xd0f4('0x11')][_0xd0f4('0x12')]===0x1f4){logger['error'](_0xd0f4('0xc'),_0x45509f,_0x3ed49d[_0xd0f4('0x11')]['message']);return _0x14a4f0(_0x3ed49d[_0xd0f4('0x11')][_0xd0f4('0x13')]);}logger[_0xd0f4('0x11')](_0xd0f4('0xc'),_0x45509f,_0x3ed49d[_0xd0f4('0x11')]['message']);return _0x129449(_0x3ed49d['error'][_0xd0f4('0x13')]);}else{logger['info'](_0xd0f4('0xc'),_0x45509f,_0xd0f4('0xf'));_0x129449(_0x3ed49d[_0xd0f4('0x14')][_0xd0f4('0x13')]);}})[_0xd0f4('0x15')](function(_0x460e9e){logger[_0xd0f4('0x11')]('DeskField,\x20%s,\x20%s',_0x45509f,_0x460e9e);_0x14a4f0(_0x460e9e);});});} \ No newline at end of file +var _0x0f71=['then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x27448d,_0x217fe5){var _0x9b5718=function(_0x2a7a38){while(--_0x2a7a38){_0x27448d['push'](_0x27448d['shift']());}};_0x9b5718(++_0x217fe5);}(_0x0f71,0x164));var _0x10f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f71[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x10f7('0x0'));var util=require(_0x10f7('0x1'));var moment=require(_0x10f7('0x2'));var BPromise=require('bluebird');var rs=require(_0x10f7('0x3'));var fs=require('fs');var Redis=require(_0x10f7('0x4'));var db=require(_0x10f7('0x5'))['db'];var utils=require(_0x10f7('0x6'));var logger=require(_0x10f7('0x7'))(_0x10f7('0x8'));var config=require(_0x10f7('0x9'));var jayson=require(_0x10f7('0xa'));var client=jayson['client'][_0x10f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2421a,_0x192f12,_0x1bb07f){return new BPromise(function(_0x4d881c,_0x13fb8b){return client['request'](_0xa2421a,_0x1bb07f)[_0x10f7('0xc')](function(_0x39f935){logger[_0x10f7('0xd')](_0x10f7('0xe'),_0x192f12,'request\x20sent');logger[_0x10f7('0xf')](_0x10f7('0x10'),_0x192f12,_0x10f7('0x11'),JSON[_0x10f7('0x12')](_0x39f935));if(_0x39f935['error']){if(_0x39f935['error']['code']===0x1f4){logger[_0x10f7('0x13')](_0x10f7('0xe'),_0x192f12,_0x39f935[_0x10f7('0x13')]['message']);return _0x13fb8b(_0x39f935['error'][_0x10f7('0x14')]);}logger[_0x10f7('0x13')](_0x10f7('0xe'),_0x192f12,_0x39f935['error'][_0x10f7('0x14')]);return _0x4d881c(_0x39f935['error'][_0x10f7('0x14')]);}else{logger[_0x10f7('0xd')](_0x10f7('0xe'),_0x192f12,'request\x20sent');_0x4d881c(_0x39f935[_0x10f7('0x15')][_0x10f7('0x14')]);}})[_0x10f7('0x16')](function(_0x2af9b7){logger[_0x10f7('0x13')](_0x10f7('0xe'),_0x192f12,_0x2af9b7);_0x13fb8b(_0x2af9b7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ba14bfa..423fa69 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 _0x7ddf=['get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller'];(function(_0x14caf6,_0x23de34){var _0x3b0248=function(_0x13aa8d){while(--_0x13aa8d){_0x14caf6['push'](_0x14caf6['shift']());}};_0x3b0248(++_0x23de34);}(_0x7ddf,0x139));var _0xf7dd=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7ddf[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xf7dd('0x0'));var util=require(_0xf7dd('0x1'));var path=require(_0xf7dd('0x2'));var timeout=require(_0xf7dd('0x3'));var express=require('express');var router=express[_0xf7dd('0x4')]();var fs_extra=require(_0xf7dd('0x5'));var auth=require(_0xf7dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7dd('0x7'));var controller=require(_0xf7dd('0x8'));router[_0xf7dd('0x9')]('/',auth[_0xf7dd('0xa')](),controller[_0xf7dd('0xb')]);router[_0xf7dd('0x9')](_0xf7dd('0xc'),auth[_0xf7dd('0xa')](),controller[_0xf7dd('0xd')]);router[_0xf7dd('0x9')]('/:id/configurations',auth[_0xf7dd('0xa')](),controller[_0xf7dd('0xe')]);router[_0xf7dd('0x9')](_0xf7dd('0xf'),auth[_0xf7dd('0xa')](),controller[_0xf7dd('0x10')]);router['post']('/',auth[_0xf7dd('0xa')](),controller[_0xf7dd('0x11')]);router[_0xf7dd('0x12')](_0xf7dd('0x13'),auth[_0xf7dd('0xa')](),controller[_0xf7dd('0x14')]);router[_0xf7dd('0x15')]('/:id',auth[_0xf7dd('0xa')](),controller['update']);router[_0xf7dd('0x16')]('/:id',auth[_0xf7dd('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6286=['put','update','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x419a58,_0x5f9e86){var _0x2e0158=function(_0x3a10de){while(--_0x3a10de){_0x419a58['push'](_0x419a58['shift']());}};_0x2e0158(++_0x5f9e86);}(_0x6286,0xd2));var _0x6628=function(_0x31e649,_0xb74ea1){_0x31e649=_0x31e649-0x0;var _0x2925ae=_0x6286[_0x31e649];return _0x2925ae;};'use strict';var multer=require('multer');var util=require(_0x6628('0x0'));var path=require(_0x6628('0x1'));var timeout=require(_0x6628('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6628('0x3'));var auth=require(_0x6628('0x4'));var interaction=require(_0x6628('0x5'));var config=require(_0x6628('0x6'));var controller=require(_0x6628('0x7'));router[_0x6628('0x8')]('/',auth[_0x6628('0x9')](),controller[_0x6628('0xa')]);router[_0x6628('0x8')](_0x6628('0xb'),auth[_0x6628('0x9')](),controller[_0x6628('0xc')]);router[_0x6628('0x8')](_0x6628('0xd'),auth[_0x6628('0x9')](),controller[_0x6628('0xe')]);router['get'](_0x6628('0xf'),auth[_0x6628('0x9')](),controller[_0x6628('0x10')]);router[_0x6628('0x11')]('/',auth[_0x6628('0x9')](),controller[_0x6628('0x12')]);router[_0x6628('0x11')]('/:id/configurations',auth[_0x6628('0x9')](),controller[_0x6628('0x13')]);router[_0x6628('0x14')]('/:id',auth[_0x6628('0x9')](),controller[_0x6628('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6628('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f094728..7b8f2ac 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 _0x3b74=['sequelize','exports','STRING','BOOLEAN'];(function(_0x25e323,_0x20e141){var _0xb39acf=function(_0x5e8bd2){while(--_0x5e8bd2){_0x25e323['push'](_0x25e323['shift']());}};_0xb39acf(++_0x20e141);}(_0x3b74,0x80));var _0x43b7=function(_0x2c169e,_0x554de0){_0x2c169e=_0x2c169e-0x0;var _0x1c5914=_0x3b74[_0x2c169e];return _0x1c5914;};'use strict';var Sequelize=require(_0x43b7('0x0'));module[_0x43b7('0x1')]={'name':{'type':Sequelize[_0x43b7('0x2')]},'username':{'type':Sequelize[_0x43b7('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x43b7('0x2')]},'tenantId':{'type':Sequelize[_0x43b7('0x2')]},'clientId':{'type':Sequelize[_0x43b7('0x2')]},'clientSecret':{'type':Sequelize[_0x43b7('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x43b7('0x2')]},'modernAuthentication':{'type':Sequelize[_0x43b7('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x02a7=['exports','STRING'];(function(_0x5730e1,_0x2d934d){var _0x4638e7=function(_0x22ddfa){while(--_0x22ddfa){_0x5730e1['push'](_0x5730e1['shift']());}};_0x4638e7(++_0x2d934d);}(_0x02a7,0x7a));var _0x702a=function(_0x2580bc,_0x3d7907){_0x2580bc=_0x2580bc-0x0;var _0x4d0855=_0x02a7[_0x2580bc];return _0x4d0855;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x702a('0x1')]},'remoteUri':{'type':Sequelize[_0x702a('0x1')]},'tenantId':{'type':Sequelize[_0x702a('0x1')]},'clientId':{'type':Sequelize[_0x702a('0x1')]},'clientSecret':{'type':Sequelize[_0x702a('0x1')]},'serverUrl':{'type':Sequelize[_0x702a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x702a('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 3104ea3..ff24cfd 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 _0x9809=['directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','LogicalName','forEach','@odata.type','substring','push','all','isNil','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','concat','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','count','limit','status','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','find','catch','create','body','params','findOne','Dynamics365Configuration','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','ticketType','incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x9809,0x1da));var _0x9980=function(_0x470494,_0x283fe2){_0x470494=_0x470494-0x0;var _0xf4e6b4=_0x9809[_0x470494];return _0xf4e6b4;};'use strict';var rp=require(_0x9980('0x0'));var util=require(_0x9980('0x1'));var _=require(_0x9980('0x2'));var qs=require(_0x9980('0x3'));var logger=require(_0x9980('0x4'))(_0x9980('0x5'));var db=require(_0x9980('0x6'))['db'];var integrations=require(_0x9980('0x7'));function respondWithResult(_0x64b7ec,_0xa65852){_0xa65852=_0xa65852||0xc8;return function(_0x27d888){if(_0x27d888){return _0x64b7ec['status'](_0xa65852)[_0x9980('0x8')](_0x27d888);}};}function respondWithFilteredResult(_0x477af4,_0x55914b){return function(_0x3e150d){if(_0x3e150d){var _0x483a59=typeof _0x55914b[_0x9980('0x9')]===_0x9980('0xa')&&typeof _0x55914b['limit']===_0x9980('0xa');var _0x2553c0=_0x3e150d[_0x9980('0xb')];var _0x29ec92=_0x483a59?0x0:_0x55914b[_0x9980('0x9')];var _0x3b118c=_0x483a59?_0x3e150d[_0x9980('0xb')]:_0x55914b[_0x9980('0x9')]+_0x55914b[_0x9980('0xc')];var _0x2d933b;if(_0x3b118c>=_0x2553c0){_0x3b118c=_0x2553c0;_0x2d933b=0xc8;}else{_0x2d933b=0xce;}_0x477af4[_0x9980('0xd')](_0x2d933b);return _0x477af4['set'](_0x9980('0xe'),_0x29ec92+'-'+_0x3b118c+'/'+_0x2553c0)[_0x9980('0x8')](_0x3e150d);}return null;};}function saveUpdates(_0x10f94d){return function(_0x4891f2){if(_0x4891f2){return _0x4891f2[_0x9980('0xf')](_0x10f94d)[_0x9980('0x10')](function(_0x175fe7){return _0x175fe7;});}return null;};}function removeEntity(_0x1a18e5){return function(_0x2beb72){if(_0x2beb72){return _0x2beb72[_0x9980('0x11')]()['then'](function(){_0x1a18e5['status'](0xcc)[_0x9980('0x12')]();});}};}function handleEntityNotFound(_0x41211b){return function(_0x141fb3){if(!_0x141fb3){_0x41211b[_0x9980('0x13')](0x194);}return _0x141fb3;};}function handleError(_0x24036f,_0x54cbd2){_0x54cbd2=_0x54cbd2||0x1f4;return function(_0x275288){logger['error'](_0x275288[_0x9980('0x14')]);if(_0x275288[_0x9980('0x15')]){delete _0x275288[_0x9980('0x15')];}_0x24036f[_0x9980('0xd')](_0x54cbd2)[_0x9980('0x16')](_0x275288);};}exports[_0x9980('0x17')]=function(_0x1f4225,_0x5029a6){var _0x59629a={},_0x32a7c3={},_0x1877f5={'count':0x0,'rows':[]};var _0x59b7a1=_[_0x9980('0x18')](db[_0x9980('0x19')][_0x9980('0x1a')],function(_0x2a39cc){return{'name':_0x2a39cc['fieldName'],'type':_0x2a39cc[_0x9980('0x1b')][_0x9980('0x1c')]};});_0x32a7c3['model']=_['map'](_0x59b7a1,'name');_0x32a7c3['query']=_['keys'](_0x1f4225[_0x9980('0x1d')]);_0x32a7c3['filters']=_['intersection'](_0x32a7c3['model'],_0x32a7c3['query']);_0x59629a[_0x9980('0x1e')]=_[_0x9980('0x1f')](_0x32a7c3[_0x9980('0x20')],qs['fields'](_0x1f4225[_0x9980('0x1d')][_0x9980('0x21')]));_0x59629a[_0x9980('0x1e')]=_0x59629a[_0x9980('0x1e')][_0x9980('0x22')]?_0x59629a[_0x9980('0x1e')]:_0x32a7c3[_0x9980('0x20')];if(!_0x1f4225[_0x9980('0x1d')][_0x9980('0x23')](_0x9980('0x24'))){_0x59629a[_0x9980('0xc')]=qs[_0x9980('0xc')](_0x1f4225[_0x9980('0x1d')][_0x9980('0xc')]);_0x59629a[_0x9980('0x9')]=qs[_0x9980('0x9')](_0x1f4225[_0x9980('0x1d')]['offset']);}_0x59629a['order']=qs[_0x9980('0x25')](_0x1f4225[_0x9980('0x1d')][_0x9980('0x25')]);_0x59629a[_0x9980('0x26')]=qs[_0x9980('0x27')](_['pick'](_0x1f4225[_0x9980('0x1d')],_0x32a7c3['filters']),_0x59b7a1);if(_0x1f4225[_0x9980('0x1d')][_0x9980('0x28')]){_0x59629a['where']=_[_0x9980('0x29')](_0x59629a[_0x9980('0x26')],{'$or':_[_0x9980('0x18')](_0x59b7a1,function(_0xaff328){if(_0xaff328[_0x9980('0x1b')]!==_0x9980('0x2a')){var _0x231cb0={};_0x231cb0[_0xaff328[_0x9980('0x15')]]={'$like':'%'+_0x1f4225[_0x9980('0x1d')][_0x9980('0x28')]+'%'};return _0x231cb0;}})});}_0x59629a=_[_0x9980('0x29')]({},_0x59629a,_0x1f4225[_0x9980('0x2b')]);var _0x4d8fa0={'where':_0x59629a['where']};return db[_0x9980('0x19')][_0x9980('0xb')](_0x4d8fa0)[_0x9980('0x10')](function(_0x2aef47){_0x1877f5[_0x9980('0xb')]=_0x2aef47;if(_0x1f4225['query'][_0x9980('0x2c')]){_0x59629a[_0x9980('0x2d')]=[{'all':!![]}];}return db[_0x9980('0x19')][_0x9980('0x2e')](_0x59629a);})[_0x9980('0x10')](function(_0x56985f){_0x1877f5['rows']=_0x56985f;return _0x1877f5;})[_0x9980('0x10')](respondWithFilteredResult(_0x5029a6,_0x59629a))['catch'](handleError(_0x5029a6,null));};exports[_0x9980('0x2f')]=function(_0x31bbdf,_0x301e04){var _0x36555c={'raw':![],'where':{'id':_0x31bbdf['params']['id']}},_0x32ed84={};_0x32ed84[_0x9980('0x20')]=_[_0x9980('0x30')](db[_0x9980('0x19')][_0x9980('0x1a')]);_0x32ed84[_0x9980('0x1d')]=_[_0x9980('0x30')](_0x31bbdf[_0x9980('0x1d')]);_0x32ed84[_0x9980('0x27')]=_[_0x9980('0x1f')](_0x32ed84[_0x9980('0x20')],_0x32ed84[_0x9980('0x1d')]);_0x36555c[_0x9980('0x1e')]=_[_0x9980('0x1f')](_0x32ed84[_0x9980('0x20')],qs[_0x9980('0x21')](_0x31bbdf['query'][_0x9980('0x21')]));_0x36555c['attributes']=_0x36555c[_0x9980('0x1e')][_0x9980('0x22')]?_0x36555c[_0x9980('0x1e')]:_0x32ed84['model'];if(_0x31bbdf[_0x9980('0x1d')][_0x9980('0x2c')]){_0x36555c[_0x9980('0x2d')]=[{'all':!![]}];}_0x36555c=_[_0x9980('0x29')]({},_0x36555c,_0x31bbdf['options']);return db[_0x9980('0x19')][_0x9980('0x31')](_0x36555c)[_0x9980('0x10')](handleEntityNotFound(_0x301e04,null))[_0x9980('0x10')](respondWithResult(_0x301e04,null))[_0x9980('0x32')](handleError(_0x301e04,null));};exports[_0x9980('0x33')]=function(_0x39889d,_0xd173da){return db[_0x9980('0x19')][_0x9980('0x33')](_0x39889d[_0x9980('0x34')],{})[_0x9980('0x10')](respondWithResult(_0xd173da,0xc9))[_0x9980('0x32')](handleError(_0xd173da,null));};exports[_0x9980('0xf')]=function(_0x37570f,_0xbd05b8){if(_0x37570f[_0x9980('0x34')]['id']){delete _0x37570f[_0x9980('0x34')]['id'];}return db[_0x9980('0x19')][_0x9980('0x31')]({'where':{'id':_0x37570f[_0x9980('0x35')]['id']}})[_0x9980('0x10')](handleEntityNotFound(_0xbd05b8,null))[_0x9980('0x10')](saveUpdates(_0x37570f[_0x9980('0x34')],null))[_0x9980('0x10')](respondWithResult(_0xbd05b8,null))[_0x9980('0x32')](handleError(_0xbd05b8,null));};exports['destroy']=function(_0x23905c,_0x2b9e2a){return db[_0x9980('0x19')][_0x9980('0x31')]({'where':{'id':_0x23905c[_0x9980('0x35')]['id']}})[_0x9980('0x10')](handleEntityNotFound(_0x2b9e2a,null))[_0x9980('0x10')](removeEntity(_0x2b9e2a,null))[_0x9980('0x32')](handleError(_0x2b9e2a,null));};exports['getConfigurations']=function(_0x419688,_0x1a137a){var _0x1c16b5={};var _0xa3da77={};var _0x7e6e05;var _0x1238a7;return db[_0x9980('0x19')][_0x9980('0x36')]({'where':{'id':_0x419688[_0x9980('0x35')]['id']}})[_0x9980('0x10')](handleEntityNotFound(_0x1a137a,null))[_0x9980('0x10')](function(_0x239536){if(_0x239536){_0x7e6e05=_0x239536;_0xa3da77[_0x9980('0x20')]=_[_0x9980('0x30')](db[_0x9980('0x37')]['rawAttributes']);_0xa3da77[_0x9980('0x1d')]=_[_0x9980('0x30')](_0x419688['query']);_0xa3da77[_0x9980('0x27')]=_['intersection'](_0xa3da77[_0x9980('0x20')],_0xa3da77[_0x9980('0x1d')]);_0x1c16b5['attributes']=_[_0x9980('0x1f')](_0xa3da77[_0x9980('0x20')],qs['fields'](_0x419688[_0x9980('0x1d')][_0x9980('0x21')]));_0x1c16b5[_0x9980('0x1e')]=_0x1c16b5['attributes'][_0x9980('0x22')]?_0x1c16b5[_0x9980('0x1e')]:_0xa3da77['model'];_0x1c16b5[_0x9980('0x38')]=qs[_0x9980('0x25')](_0x419688['query'][_0x9980('0x25')]);_0x1c16b5[_0x9980('0x26')]=qs[_0x9980('0x27')](_['pick'](_0x419688[_0x9980('0x1d')],_0xa3da77[_0x9980('0x27')]));if(_0x419688[_0x9980('0x1d')][_0x9980('0x28')]){_0x1c16b5[_0x9980('0x26')]=_[_0x9980('0x29')](_0x1c16b5[_0x9980('0x26')],{'$or':_[_0x9980('0x18')](_0x1c16b5[_0x9980('0x1e')],function(_0x430262){var _0x54d729={};_0x54d729[_0x430262]={'$like':'%'+_0x419688['query'][_0x9980('0x28')]+'%'};return _0x54d729;})});}_0x1c16b5=_[_0x9980('0x29')]({},_0x1c16b5,_0x419688[_0x9980('0x2b')]);return _0x7e6e05[_0x9980('0x39')](_0x1c16b5);}})[_0x9980('0x10')](function(_0x5bd1bf){if(_0x5bd1bf){_0x1238a7=_0x5bd1bf[_0x9980('0x22')];if(!_0x419688[_0x9980('0x1d')]['hasOwnProperty'](_0x9980('0x24'))){_0x1c16b5['limit']=qs[_0x9980('0xc')](_0x419688[_0x9980('0x1d')][_0x9980('0xc')]);_0x1c16b5['offset']=qs['offset'](_0x419688[_0x9980('0x1d')][_0x9980('0x9')]);}return _0x7e6e05[_0x9980('0x39')](_0x1c16b5);}})[_0x9980('0x10')](function(_0x158c1c){if(_0x158c1c){return _0x158c1c?{'count':_0x1238a7,'rows':_0x158c1c}:null;}})[_0x9980('0x10')](respondWithResult(_0x1a137a,null))['catch'](handleError(_0x1a137a,null));};exports[_0x9980('0x3a')]=function(_0x137f04,_0x50bb8c){if(_0x137f04[_0x9980('0x34')]['id']){delete _0x137f04[_0x9980('0x34')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x137f04['params']['id']}})[_0x9980('0x10')](handleEntityNotFound(_0x50bb8c,null))[_0x9980('0x10')](function(_0x117997){if(_0x117997){_0x137f04[_0x9980('0x34')][_0x9980('0x3b')]=_0x117997['id'];_0x137f04[_0x9980('0x34')][_0x9980('0x3c')]=integrations[_0x9980('0x3d')](_0x137f04[_0x9980('0x34')][_0x9980('0x3e')],_0x137f04[_0x9980('0x34')][_0x9980('0x1b')]);_0x137f04['body'][_0x9980('0x3f')]=integrations[_0x9980('0x40')](_0x137f04[_0x9980('0x34')][_0x9980('0x3e')],_0x137f04[_0x9980('0x34')][_0x9980('0x1b')]);return db[_0x9980('0x37')][_0x9980('0x33')](_0x137f04[_0x9980('0x34')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x9980('0x41')],'as':_0x9980('0x3f')}]});}return null;})[_0x9980('0x10')](respondWithResult(_0x50bb8c,null))[_0x9980('0x32')](handleError(_0x50bb8c,null));};function sanitizeRemoteUri(_0x43532c){var _0x6d3646=_0x43532c[_0x9980('0x42')](-0x1);if(_0x6d3646==='/')return _0x43532c['substring'](0x0,_0x43532c[_0x9980('0x43')](_0x6d3646));return _0x43532c;}function getWebApiUrl(_0x316edc){return util[_0x9980('0x44')]('%s/api/data/v9.0/',_0x316edc);}exports['getFields']=function(_0x541ead,_0x4d865e){var _0x3160f0=_0x541ead['query'][_0x9980('0x45')];var _0x516190=_0x3160f0===_0x9980('0x46')?'Incident':_0x9980('0x47');var _0x359694='';var _0x273de5='';var _0x2307d1='';var _0x4e4ee5='';var _0x3d9b01='';var _0x307572='';var _0x46f50f='';var _0xe399c6='';var _0x55cb0f=[_0x9980('0x48'),'description',_0x9980('0x49'),_0x9980('0x4a'),_0x9980('0x4b'),_0x9980('0x4c'),'phonenumber',_0x9980('0x4d'),_0x9980('0x4e'),_0x9980('0x4f')];var _0x5008c4=['accountidname',_0x9980('0x50'),_0x9980('0x51'),_0x9980('0x52'),_0x9980('0x53'),_0x9980('0x54'),_0x9980('0x55'),_0x9980('0x56'),_0x9980('0x57'),_0x9980('0x58'),_0x9980('0x59'),_0x9980('0x5a'),_0x9980('0x5b'),'createdonbehalfbyname',_0x9980('0x5c'),'customeridname','customeridtype',_0x9980('0x5d'),_0x9980('0x5e'),'entitlementidname',_0x9980('0x5f'),_0x9980('0x60'),'escalatedon',_0x9980('0x61'),_0x9980('0x62'),_0x9980('0x63'),'importsequencenumber',_0x9980('0x64'),_0x9980('0x65'),_0x9980('0x66'),_0x9980('0x67'),_0x9980('0x68'),'modifiedbyexternalpartyyominame',_0x9980('0x69'),_0x9980('0x6a'),'modifiedon',_0x9980('0x6b'),_0x9980('0x6c'),_0x9980('0x6d'),_0x9980('0x6e'),_0x9980('0x6f'),_0x9980('0x70'),'overriddencreatedon',_0x9980('0x71'),_0x9980('0x72'),_0x9980('0x73'),_0x9980('0x74'),_0x9980('0x75'),'primarycontactidyominame',_0x9980('0x76'),_0x9980('0x77'),_0x9980('0x78'),'resolveby',_0x9980('0x79'),_0x9980('0x7a'),_0x9980('0x7b'),_0x9980('0x7c'),'sentimentvalue',_0x9980('0x7d'),_0x9980('0x7e'),_0x9980('0x7f'),_0x9980('0x80'),_0x9980('0x81'),_0x9980('0x82'),_0x9980('0x83'),'timezoneruleversionnumber',_0x9980('0x84'),'traversedpath',_0x9980('0x85'),'versionnumber'];var _0x1be84b=_0x55cb0f['concat'](_0x5008c4);return db[_0x9980('0x19')][_0x9980('0x36')]({'where':{'id':_0x541ead[_0x9980('0x35')]['id']},'attributes':['id',_0x9980('0x86'),_0x9980('0x87'),_0x9980('0x88'),_0x9980('0x89'),_0x9980('0x8a'),_0x9980('0x8b'),_0x9980('0x8c')],'include':[{'model':db[_0x9980('0x8d')],'as':_0x9980('0x8d'),'attributes':['id',_0x9980('0x8e'),_0x9980('0x8f')]}]})[_0x9980('0x10')](handleEntityNotFound(_0x4d865e,null))[_0x9980('0x10')](function(_0x563d37){if(_0x563d37){if(_0x563d37[_0x9980('0x8c')]){_0x563d37['access_token']=_0x563d37[_0x9980('0x8d')][_0x9980('0x8e')];_0xe399c6=sanitizeRemoteUri(_0x563d37['CloudProvider'][_0x9980('0x8f')]);_0x46f50f=getWebApiUrl(_0xe399c6);return _0x563d37;}_0xe399c6=sanitizeRemoteUri(_0x563d37['remoteUri']);_0x46f50f=getWebApiUrl(_0xe399c6);var _0x558228={'method':_0x9980('0x90'),'uri':'https://login.microsoftonline.com/'+_0x563d37[_0x9980('0x89')]+_0x9980('0x91'),'form':{'client_id':_0x563d37[_0x9980('0x8a')],'resource':_0xe399c6,'username':_0x563d37[_0x9980('0x86')],'password':_0x563d37['password'],'grant_type':'password','client_secret':_0x563d37[_0x9980('0x8b')]},'json':!![]};return rp(_0x558228);}})['then'](function(_0x37cae5){_0x307572=_0x37cae5[_0x9980('0x92')];var _0x43ab8a={'method':_0x9980('0x93'),'uri':encodeURI(_0x46f50f+_0x9980('0x94')+_0x516190+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x307572,'If-None-Match':null,'OData-Version':_0x9980('0x95')},'json':!![]};return rp(_0x43ab8a);})[_0x9980('0x10')](function(_0x1d402e){var _0xefea71=_0x1d402e[_0x9980('0x96')][0x0];var _0x1b76cb=_0xefea71[_0x9980('0x97')];var _0x5aafed={'method':_0x9980('0x93'),'uri':_0x46f50f+'EntityDefinitions('+_0x1b76cb+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x307572,'If-None-Match':null,'OData-Version':_0x9980('0x95')},'json':!![]};return rp(_0x5aafed);})[_0x9980('0x10')](function(_0x1288c8){_0x359694=_0x1288c8;_0x273de5=_0x359694['Attributes'];_0x273de5=_['remove'](_0x273de5,function(_0x362c9b){return!_0x1be84b['includes'](_0x362c9b[_0x9980('0x98')]);});var _0x1f23c8=[];var _0x31354a=[];_0x273de5[_0x9980('0x99')](function(_0x19238f){if(_0x19238f[_0x9980('0x9a')]){var _0x4703dc=_0x19238f['@odata.type'][_0x9980('0x9b')](_0x19238f[_0x9980('0x9a')][_0x9980('0x43')]('.')+0x1);if(_0x4703dc==='PicklistAttributeMetadata'){_0x1f23c8[_0x9980('0x9c')](getSelectList(_0x46f50f,_0x3160f0,_0x31354a,_0x359694[_0x9980('0x97')],_0x19238f['MetadataId'],_0x307572));}}});return Promise[_0x9980('0x9d')](_0x1f23c8);})['then'](function(_0x2017e1){_0x2307d1=_0x2017e1[0x0];var _0x5841c2=[];var _0x223ac2=[];_0x273de5[_0x9980('0x99')](function(_0x59244d){if(!_[_0x9980('0x9e')](_0x59244d[_0x9980('0x9a')])){var _0x557066=_0x59244d[_0x9980('0x9a')][_0x9980('0x9b')](_0x59244d[_0x9980('0x9a')][_0x9980('0x43')]('.')+0x1);if(_0x557066==='BooleanAttributeMetadata'){_0x5841c2[_0x9980('0x9c')](getBooleanList(_0x46f50f,_0x3160f0,_0x223ac2,_0x359694['MetadataId'],_0x59244d[_0x9980('0x97')],_0x307572));}}});return Promise['all'](_0x5841c2);})[_0x9980('0x10')](function(_0x23de1a){_0x4e4ee5=_0x23de1a[0x0];var _0x334687=[];var _0x7bef4d=[];_0x273de5[_0x9980('0x99')](function(_0x3001f8){if(_0x3001f8['@odata.type']){var _0x48b50c=_0x3001f8['@odata.type'][_0x9980('0x9b')](_0x3001f8[_0x9980('0x9a')][_0x9980('0x43')]('.')+0x1);if(_0x48b50c==='StringAttributeMetadata'||_0x48b50c===_0x9980('0x9f')||_0x48b50c==='BigIntAttributeMetadata'||_0x48b50c===_0x9980('0xa0')||_0x48b50c==='MemoAttributeMetadata'||_0x48b50c===_0x9980('0xa1')||_0x48b50c===_0x9980('0xa2')||_0x48b50c===_0x9980('0xa3')||_0x48b50c==='StateAttributeMetadata'||_0x48b50c==='DecimalAttributeMetadata'){_0x334687[_0x9980('0x9c')](getInputList(_0x46f50f,_0x3160f0,_0x48b50c,_0x7bef4d,_0x359694[_0x9980('0x97')],_0x3001f8[_0x9980('0x97')],_0x307572));}}});return Promise[_0x9980('0x9d')](_0x334687);})[_0x9980('0x10')](function(_0x4f3a31){_0x3d9b01=_0x4f3a31[0x0];var _0x5a1656=_0x2307d1[_0x9980('0xa4')](_0x4e4ee5)[_0x9980('0xa4')](_0x3d9b01);var _0xe52bff={'count':_0x5a1656[_0x9980('0x22')],'rows':_0x5a1656};return _0xe52bff;})[_0x9980('0x10')](respondWithResult(_0x4d865e,null))[_0x9980('0x32')](function(_0x4dd103){var _0x308c97=_0x541ead['query'][_0x9980('0xa5')]?0x1f4:_0x4dd103[_0x9980('0xa6')]||0x1f4;logger[_0x9980('0xa7')](_0x4dd103[_0x9980('0x14')]);delete _0x4dd103[_0x9980('0x15')];if(_0x308c97===0x191){_0x308c97=0x190;}_0x4d865e['status'](_0x308c97)[_0x9980('0x16')](_0x541ead[_0x9980('0x1d')][_0x9980('0xa5')]?{'message':_0x9980('0xa8'),'statusCode':_0x4dd103[_0x9980('0xa6')]}:_0x4dd103);});};function getSelectList(_0x64cd,_0x1a85ed,_0x515387,_0x298147,_0x11e7db,_0x148716){var _0x39c48b={'method':_0x9980('0x93'),'uri':_0x64cd+_0x9980('0xa9')+_0x298147+_0x9980('0xaa')+_0x11e7db+_0x9980('0xab')+_0x9980('0xac'),'headers':{'Authorization':_0x9980('0xad')+_0x148716,'If-None-Match':null,'OData-Version':_0x9980('0x95')},'json':!![]};return rp(_0x39c48b)['then'](function(_0x3ba0a0){var _0x37e635=[];var _0x5552d4=_0x3ba0a0['OptionSet'][_0x9980('0xae')];_0x5552d4[_0x9980('0x99')](function(_0x5deee6){_0x37e635[_0x9980('0x9c')]({'name':_0x5deee6[_0x9980('0xaf')][_0x9980('0xb0')][_0x9980('0xaf')],'value':String(_0x5deee6[_0x9980('0xb1')])});});var _0x99edfb={'id':_0x1a85ed+'_'+_0x3ba0a0[_0x9980('0x98')],'name':_0x3ba0a0[_0x9980('0xb2')][_0x9980('0xb0')][_0x9980('0xaf')],'custom':![],'options':_0x37e635};_0x515387['push'](_0x99edfb);return _0x515387;});}function getBooleanList(_0x15df7a,_0x4bb94d,_0x573d8e,_0x251622,_0x330fa3,_0x233b42){var _0x4600b1={'method':'GET','uri':_0x15df7a+_0x9980('0xa9')+_0x251622+_0x9980('0xaa')+_0x330fa3+_0x9980('0xb3'),'headers':{'Authorization':_0x9980('0xad')+_0x233b42,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4600b1)[_0x9980('0x10')](function(_0x4ebc5a){var _0x58bf0a=[];_0x58bf0a[_0x9980('0x9c')]({'name':_0x4ebc5a[_0x9980('0xb4')]['TrueOption']['Label'][_0x9980('0xb0')][_0x9980('0xaf')],'value':_0x9980('0xb5')},{'name':_0x4ebc5a['OptionSet'][_0x9980('0xb6')][_0x9980('0xaf')][_0x9980('0xb0')][_0x9980('0xaf')],'value':_0x9980('0xb7')});var _0x5eba52={'id':_0x4bb94d+'_'+_0x4ebc5a[_0x9980('0x98')],'name':_0x4ebc5a['DisplayName']['UserLocalizedLabel'][_0x9980('0xaf')],'custom':![],'options':_0x58bf0a};_0x573d8e[_0x9980('0x9c')](_0x5eba52);return _0x573d8e;});}function getInputList(_0x73aae3,_0x4f897b,_0x105c59,_0x4b7ceb,_0x5a58f5,_0x369a51,_0x55552e){var _0x3905fd={'method':_0x9980('0x93'),'uri':_0x73aae3+_0x9980('0xa9')+_0x5a58f5+_0x9980('0xaa')+_0x369a51+')/Microsoft.Dynamics.CRM.'+_0x105c59+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x9980('0xad')+_0x55552e,'If-None-Match':null,'OData-Version':_0x9980('0x95')},'json':!![]};return rp(_0x3905fd)[_0x9980('0x10')](function(_0xe5b7c8){var _0x13407c={'id':_0x4f897b+'_'+_0xe5b7c8['LogicalName'],'name':_0xe5b7c8[_0x9980('0xb2')]['UserLocalizedLabel']?_0xe5b7c8[_0x9980('0xb2')][_0x9980('0xb0')][_0x9980('0xaf')]:_0xe5b7c8[_0x9980('0x98')],'custom':![],'options':[]};_0x4b7ceb[_0x9980('0x9c')](_0x13407c);return _0x4b7ceb;});} \ No newline at end of file +var _0xa45c=['customerid','ownerid','caseorigincode','subject','regardingobjectid','accountidyominame','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','clientId','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','tenantId','clientSecret','GET','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','forEach','@odata.type','PicklistAttributeMetadata','all','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','UserLocalizedLabel','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','options','includeAll','include','rows','params','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','order','pick','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description'];(function(_0x1422a9,_0x4d21a6){var _0x3baa66=function(_0x32f8c7){while(--_0x32f8c7){_0x1422a9['push'](_0x1422a9['shift']());}};_0x3baa66(++_0x4d21a6);}(_0xa45c,0x6d));var _0xca45=function(_0x39f024,_0x5cfb18){_0x39f024=_0x39f024-0x0;var _0x31bcee=_0xa45c[_0x39f024];return _0x31bcee;};'use strict';var rp=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xca45('0x2'))('api');var db=require(_0xca45('0x3'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x16a36c,_0x47d8b9){_0x47d8b9=_0x47d8b9||0xc8;return function(_0x4d45e6){if(_0x4d45e6){return _0x16a36c[_0xca45('0x4')](_0x47d8b9)[_0xca45('0x5')](_0x4d45e6);}};}function respondWithFilteredResult(_0x18d789,_0x15628b){return function(_0x578a7b){if(_0x578a7b){var _0x1a8b9c=typeof _0x15628b[_0xca45('0x6')]===_0xca45('0x7')&&typeof _0x15628b[_0xca45('0x8')]===_0xca45('0x7');var _0x5c18b9=_0x578a7b[_0xca45('0x9')];var _0x342542=_0x1a8b9c?0x0:_0x15628b[_0xca45('0x6')];var _0x151691=_0x1a8b9c?_0x578a7b[_0xca45('0x9')]:_0x15628b[_0xca45('0x6')]+_0x15628b[_0xca45('0x8')];var _0x4a8692;if(_0x151691>=_0x5c18b9){_0x151691=_0x5c18b9;_0x4a8692=0xc8;}else{_0x4a8692=0xce;}_0x18d789[_0xca45('0x4')](_0x4a8692);return _0x18d789[_0xca45('0xa')](_0xca45('0xb'),_0x342542+'-'+_0x151691+'/'+_0x5c18b9)[_0xca45('0x5')](_0x578a7b);}return null;};}function saveUpdates(_0x580c43){return function(_0x3044b1){if(_0x3044b1){return _0x3044b1[_0xca45('0xc')](_0x580c43)[_0xca45('0xd')](function(_0x59b6de){return _0x59b6de;});}return null;};}function removeEntity(_0x214939){return function(_0x569ba6){if(_0x569ba6){return _0x569ba6[_0xca45('0xe')]()[_0xca45('0xd')](function(){_0x214939[_0xca45('0x4')](0xcc)[_0xca45('0xf')]();});}};}function handleEntityNotFound(_0x35b130){return function(_0x323b19){if(!_0x323b19){_0x35b130[_0xca45('0x10')](0x194);}return _0x323b19;};}function handleError(_0x570784,_0x571baa){_0x571baa=_0x571baa||0x1f4;return function(_0x5b4e29){logger['error'](_0x5b4e29[_0xca45('0x11')]);if(_0x5b4e29[_0xca45('0x12')]){delete _0x5b4e29['name'];}_0x570784[_0xca45('0x4')](_0x571baa)[_0xca45('0x13')](_0x5b4e29);};}exports['index']=function(_0x40540f,_0x3f0c23){var _0x446243={},_0x11cbf0={},_0x5a231d={'count':0x0,'rows':[]};var _0x3e396b=_[_0xca45('0x14')](db[_0xca45('0x15')][_0xca45('0x16')],function(_0x548d0c){return{'name':_0x548d0c[_0xca45('0x17')],'type':_0x548d0c[_0xca45('0x18')][_0xca45('0x19')]};});_0x11cbf0[_0xca45('0x1a')]=_[_0xca45('0x14')](_0x3e396b,_0xca45('0x12'));_0x11cbf0[_0xca45('0x1b')]=_[_0xca45('0x1c')](_0x40540f[_0xca45('0x1b')]);_0x11cbf0['filters']=_[_0xca45('0x1d')](_0x11cbf0[_0xca45('0x1a')],_0x11cbf0[_0xca45('0x1b')]);_0x446243[_0xca45('0x1e')]=_[_0xca45('0x1d')](_0x11cbf0['model'],qs['fields'](_0x40540f['query'][_0xca45('0x1f')]));_0x446243['attributes']=_0x446243['attributes'][_0xca45('0x20')]?_0x446243[_0xca45('0x1e')]:_0x11cbf0[_0xca45('0x1a')];if(!_0x40540f[_0xca45('0x1b')][_0xca45('0x21')]('nolimit')){_0x446243[_0xca45('0x8')]=qs[_0xca45('0x8')](_0x40540f[_0xca45('0x1b')]['limit']);_0x446243['offset']=qs['offset'](_0x40540f[_0xca45('0x1b')][_0xca45('0x6')]);}_0x446243['order']=qs[_0xca45('0x22')](_0x40540f[_0xca45('0x1b')][_0xca45('0x22')]);_0x446243[_0xca45('0x23')]=qs['filters'](_['pick'](_0x40540f['query'],_0x11cbf0[_0xca45('0x24')]),_0x3e396b);if(_0x40540f['query']['filter']){_0x446243['where']=_[_0xca45('0x25')](_0x446243['where'],{'$or':_['map'](_0x3e396b,function(_0x119244){if(_0x119244[_0xca45('0x18')]!==_0xca45('0x26')){var _0x535ae0={};_0x535ae0[_0x119244[_0xca45('0x12')]]={'$like':'%'+_0x40540f[_0xca45('0x1b')]['filter']+'%'};return _0x535ae0;}})});}_0x446243=_[_0xca45('0x25')]({},_0x446243,_0x40540f[_0xca45('0x27')]);var _0x3a47a2={'where':_0x446243[_0xca45('0x23')]};return db[_0xca45('0x15')][_0xca45('0x9')](_0x3a47a2)[_0xca45('0xd')](function(_0x291dd6){_0x5a231d[_0xca45('0x9')]=_0x291dd6;if(_0x40540f[_0xca45('0x1b')][_0xca45('0x28')]){_0x446243[_0xca45('0x29')]=[{'all':!![]}];}return db[_0xca45('0x15')]['findAll'](_0x446243);})['then'](function(_0x53c4f7){_0x5a231d[_0xca45('0x2a')]=_0x53c4f7;return _0x5a231d;})[_0xca45('0xd')](respondWithFilteredResult(_0x3f0c23,_0x446243))['catch'](handleError(_0x3f0c23,null));};exports['show']=function(_0x366390,_0x4a3eb9){var _0x34cfae={'raw':![],'where':{'id':_0x366390[_0xca45('0x2b')]['id']}},_0x53202c={};_0x53202c[_0xca45('0x1a')]=_[_0xca45('0x1c')](db[_0xca45('0x15')][_0xca45('0x16')]);_0x53202c['query']=_[_0xca45('0x1c')](_0x366390['query']);_0x53202c[_0xca45('0x24')]=_[_0xca45('0x1d')](_0x53202c[_0xca45('0x1a')],_0x53202c[_0xca45('0x1b')]);_0x34cfae['attributes']=_[_0xca45('0x1d')](_0x53202c[_0xca45('0x1a')],qs[_0xca45('0x1f')](_0x366390['query']['fields']));_0x34cfae[_0xca45('0x1e')]=_0x34cfae[_0xca45('0x1e')][_0xca45('0x20')]?_0x34cfae[_0xca45('0x1e')]:_0x53202c[_0xca45('0x1a')];if(_0x366390[_0xca45('0x1b')][_0xca45('0x28')]){_0x34cfae[_0xca45('0x29')]=[{'all':!![]}];}_0x34cfae=_[_0xca45('0x25')]({},_0x34cfae,_0x366390[_0xca45('0x27')]);return db[_0xca45('0x15')][_0xca45('0x2c')](_0x34cfae)[_0xca45('0xd')](handleEntityNotFound(_0x4a3eb9,null))[_0xca45('0xd')](respondWithResult(_0x4a3eb9,null))[_0xca45('0x2d')](handleError(_0x4a3eb9,null));};exports[_0xca45('0x2e')]=function(_0x288d8c,_0x190ea6){return db['Dynamics365Account'][_0xca45('0x2e')](_0x288d8c[_0xca45('0x2f')],{})[_0xca45('0xd')](respondWithResult(_0x190ea6,0xc9))['catch'](handleError(_0x190ea6,null));};exports[_0xca45('0xc')]=function(_0x4e7539,_0x1dba0e){if(_0x4e7539[_0xca45('0x2f')]['id']){delete _0x4e7539['body']['id'];}return db[_0xca45('0x15')][_0xca45('0x2c')]({'where':{'id':_0x4e7539[_0xca45('0x2b')]['id']}})[_0xca45('0xd')](handleEntityNotFound(_0x1dba0e,null))[_0xca45('0xd')](saveUpdates(_0x4e7539[_0xca45('0x2f')],null))[_0xca45('0xd')](respondWithResult(_0x1dba0e,null))[_0xca45('0x2d')](handleError(_0x1dba0e,null));};exports[_0xca45('0xe')]=function(_0x195a9a,_0x310d75){return db[_0xca45('0x15')][_0xca45('0x2c')]({'where':{'id':_0x195a9a[_0xca45('0x2b')]['id']}})[_0xca45('0xd')](handleEntityNotFound(_0x310d75,null))[_0xca45('0xd')](removeEntity(_0x310d75,null))[_0xca45('0x2d')](handleError(_0x310d75,null));};exports[_0xca45('0x30')]=function(_0x465b71,_0x4bbe9e){var _0x1a0c5e={};var _0x2c78e8={};var _0x1f224d;var _0x3fc876;return db[_0xca45('0x15')][_0xca45('0x31')]({'where':{'id':_0x465b71[_0xca45('0x2b')]['id']}})[_0xca45('0xd')](handleEntityNotFound(_0x4bbe9e,null))[_0xca45('0xd')](function(_0x427bf5){if(_0x427bf5){_0x1f224d=_0x427bf5;_0x2c78e8[_0xca45('0x1a')]=_[_0xca45('0x1c')](db[_0xca45('0x32')][_0xca45('0x16')]);_0x2c78e8['query']=_[_0xca45('0x1c')](_0x465b71[_0xca45('0x1b')]);_0x2c78e8[_0xca45('0x24')]=_[_0xca45('0x1d')](_0x2c78e8[_0xca45('0x1a')],_0x2c78e8[_0xca45('0x1b')]);_0x1a0c5e[_0xca45('0x1e')]=_[_0xca45('0x1d')](_0x2c78e8[_0xca45('0x1a')],qs[_0xca45('0x1f')](_0x465b71[_0xca45('0x1b')]['fields']));_0x1a0c5e['attributes']=_0x1a0c5e[_0xca45('0x1e')][_0xca45('0x20')]?_0x1a0c5e['attributes']:_0x2c78e8[_0xca45('0x1a')];_0x1a0c5e[_0xca45('0x33')]=qs[_0xca45('0x22')](_0x465b71[_0xca45('0x1b')][_0xca45('0x22')]);_0x1a0c5e[_0xca45('0x23')]=qs[_0xca45('0x24')](_[_0xca45('0x34')](_0x465b71[_0xca45('0x1b')],_0x2c78e8[_0xca45('0x24')]));if(_0x465b71[_0xca45('0x1b')][_0xca45('0x35')]){_0x1a0c5e[_0xca45('0x23')]=_['merge'](_0x1a0c5e[_0xca45('0x23')],{'$or':_[_0xca45('0x14')](_0x1a0c5e[_0xca45('0x1e')],function(_0x3820b2){var _0x44b7e1={};_0x44b7e1[_0x3820b2]={'$like':'%'+_0x465b71[_0xca45('0x1b')][_0xca45('0x35')]+'%'};return _0x44b7e1;})});}_0x1a0c5e=_[_0xca45('0x25')]({},_0x1a0c5e,_0x465b71[_0xca45('0x27')]);return _0x1f224d['getConfigurations'](_0x1a0c5e);}})['then'](function(_0x4cb20b){if(_0x4cb20b){_0x3fc876=_0x4cb20b['length'];if(!_0x465b71[_0xca45('0x1b')][_0xca45('0x21')](_0xca45('0x36'))){_0x1a0c5e[_0xca45('0x8')]=qs['limit'](_0x465b71[_0xca45('0x1b')][_0xca45('0x8')]);_0x1a0c5e['offset']=qs[_0xca45('0x6')](_0x465b71[_0xca45('0x1b')]['offset']);}return _0x1f224d[_0xca45('0x30')](_0x1a0c5e);}})['then'](function(_0xf29cbc){if(_0xf29cbc){return _0xf29cbc?{'count':_0x3fc876,'rows':_0xf29cbc}:null;}})['then'](respondWithResult(_0x4bbe9e,null))[_0xca45('0x2d')](handleError(_0x4bbe9e,null));};exports[_0xca45('0x37')]=function(_0x4c66e4,_0x4c878a){if(_0x4c66e4[_0xca45('0x2f')]['id']){delete _0x4c66e4[_0xca45('0x2f')]['id'];}return db['Dynamics365Account'][_0xca45('0x31')]({'where':{'id':_0x4c66e4[_0xca45('0x2b')]['id']}})[_0xca45('0xd')](handleEntityNotFound(_0x4c878a,null))['then'](function(_0x12d6da){if(_0x12d6da){_0x4c66e4[_0xca45('0x2f')][_0xca45('0x38')]=_0x12d6da['id'];_0x4c66e4[_0xca45('0x2f')][_0xca45('0x39')]=integrations[_0xca45('0x3a')](_0x4c66e4[_0xca45('0x2f')][_0xca45('0x3b')],_0x4c66e4[_0xca45('0x2f')]['type']);_0x4c66e4[_0xca45('0x2f')][_0xca45('0x3c')]=integrations[_0xca45('0x3d')](_0x4c66e4[_0xca45('0x2f')][_0xca45('0x3b')],_0x4c66e4['body'][_0xca45('0x18')]);return db['Dynamics365Configuration']['create'](_0x4c66e4[_0xca45('0x2f')],{'include':[{'model':db['Dynamics365Field'],'as':_0xca45('0x39')},{'model':db[_0xca45('0x3e')],'as':_0xca45('0x3c')}]});}return null;})[_0xca45('0xd')](respondWithResult(_0x4c878a,null))[_0xca45('0x2d')](handleError(_0x4c878a,null));};function sanitizeRemoteUri(_0x5e8505){var _0x41e17a=_0x5e8505[_0xca45('0x3f')](-0x1);if(_0x41e17a==='/')return _0x5e8505[_0xca45('0x40')](0x0,_0x5e8505[_0xca45('0x41')](_0x41e17a));return _0x5e8505;}function getWebApiUrl(_0x1dd3bc){return util[_0xca45('0x42')](_0xca45('0x43'),_0x1dd3bc);}exports[_0xca45('0x44')]=function(_0x1995de,_0x5bb442){var _0x16c7ee=_0x1995de[_0xca45('0x1b')][_0xca45('0x45')];var _0x4732ad=_0x16c7ee===_0xca45('0x46')?_0xca45('0x47'):_0xca45('0x48');var _0x58411c='';var _0x37dd71='';var _0x2d11a1='';var _0x304126='';var _0x5346f8='';var _0x13f088='';var _0xc455c1='';var _0x50a812='';var _0x46dff7=[_0xca45('0x49'),_0xca45('0x4a'),_0xca45('0x4b'),_0xca45('0x4c'),_0xca45('0x4d'),_0xca45('0x4e'),'phonenumber',_0xca45('0x4f'),'directioncode','phonecall_activity_parties'];var _0x15529a=['accountidname',_0xca45('0x50'),'actualserviceunits','billedserviceunits',_0xca45('0x51'),'contactidyominame',_0xca45('0x52'),_0xca45('0x53'),_0xca45('0x54'),_0xca45('0x55'),'createdbyname','createdbyyominame','createdon','createdonbehalfbyname',_0xca45('0x56'),'customeridname',_0xca45('0x57'),_0xca45('0x58'),'emailaddress',_0xca45('0x59'),_0xca45('0x5a'),_0xca45('0x5b'),'escalatedon',_0xca45('0x5c'),_0xca45('0x5d'),_0xca45('0x5e'),_0xca45('0x5f'),'influencescore',_0xca45('0x60'),'lastonholdtime',_0xca45('0x61'),_0xca45('0x62'),_0xca45('0x63'),_0xca45('0x64'),_0xca45('0x65'),_0xca45('0x66'),_0xca45('0x67'),'modifiedonbehalfbyyominame',_0xca45('0x68'),_0xca45('0x69'),_0xca45('0x6a'),'onholdtime',_0xca45('0x6b'),'owneridname',_0xca45('0x6c'),_0xca45('0x6d'),_0xca45('0x6e'),'primarycontactidname',_0xca45('0x6f'),_0xca45('0x70'),_0xca45('0x71'),_0xca45('0x72'),_0xca45('0x73'),'resolvebykpiidname',_0xca45('0x74'),_0xca45('0x75'),_0xca45('0x76'),_0xca45('0x77'),_0xca45('0x78'),_0xca45('0x79'),_0xca45('0x7a'),_0xca45('0x7b'),'statuscode',_0xca45('0x7c'),_0xca45('0x7d'),_0xca45('0x7e'),_0xca45('0x7f'),_0xca45('0x80'),_0xca45('0x81'),'versionnumber'];var _0x4cbd02=_0x46dff7[_0xca45('0x82')](_0x15529a);return db[_0xca45('0x15')][_0xca45('0x31')]({'where':{'id':_0x1995de['params']['id']},'attributes':['id',_0xca45('0x83'),_0xca45('0x84'),_0xca45('0x85'),'tenantId',_0xca45('0x86'),'clientSecret',_0xca45('0x87')],'include':[{'model':db[_0xca45('0x88')],'as':'CloudProvider','attributes':['id',_0xca45('0x89'),'data7']}]})['then'](handleEntityNotFound(_0x5bb442,null))['then'](function(_0x209784){if(_0x209784){if(_0x209784[_0xca45('0x87')]){_0x209784[_0xca45('0x8a')]=_0x209784[_0xca45('0x88')][_0xca45('0x89')];_0x50a812=sanitizeRemoteUri(_0x209784[_0xca45('0x88')][_0xca45('0x8b')]);_0xc455c1=getWebApiUrl(_0x50a812);return _0x209784;}_0x50a812=sanitizeRemoteUri(_0x209784['remoteUri']);_0xc455c1=getWebApiUrl(_0x50a812);var _0x45a833={'method':_0xca45('0x8c'),'uri':_0xca45('0x8d')+_0x209784[_0xca45('0x8e')]+'/oauth2/token','form':{'client_id':_0x209784[_0xca45('0x86')],'resource':_0x50a812,'username':_0x209784['username'],'password':_0x209784[_0xca45('0x84')],'grant_type':_0xca45('0x84'),'client_secret':_0x209784[_0xca45('0x8f')]},'json':!![]};return rp(_0x45a833);}})[_0xca45('0xd')](function(_0x4fd5dc){_0x13f088=_0x4fd5dc[_0xca45('0x8a')];var _0x566e6b={'method':_0xca45('0x90'),'uri':encodeURI(_0xc455c1+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4732ad+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x13f088,'If-None-Match':null,'OData-Version':_0xca45('0x91')},'json':!![]};return rp(_0x566e6b);})['then'](function(_0x560e17){var _0x3ad72f=_0x560e17['value'][0x0];var _0x11fbe9=_0x3ad72f[_0xca45('0x92')];var _0x325380={'method':_0xca45('0x90'),'uri':_0xc455c1+_0xca45('0x93')+_0x11fbe9+_0xca45('0x94'),'headers':{'Authorization':'Bearer\x20'+_0x13f088,'If-None-Match':null,'OData-Version':_0xca45('0x91')},'json':!![]};return rp(_0x325380);})['then'](function(_0x4a141a){_0x58411c=_0x4a141a;_0x37dd71=_0x58411c['Attributes'];_0x37dd71=_['remove'](_0x37dd71,function(_0x5959d5){return!_0x4cbd02[_0xca45('0x95')](_0x5959d5['LogicalName']);});var _0x1275e9=[];var _0x15a797=[];_0x37dd71[_0xca45('0x96')](function(_0x21e558){if(_0x21e558['@odata.type']){var _0x4bee4f=_0x21e558[_0xca45('0x97')][_0xca45('0x40')](_0x21e558[_0xca45('0x97')][_0xca45('0x41')]('.')+0x1);if(_0x4bee4f===_0xca45('0x98')){_0x1275e9['push'](getSelectList(_0xc455c1,_0x16c7ee,_0x15a797,_0x58411c[_0xca45('0x92')],_0x21e558[_0xca45('0x92')],_0x13f088));}}});return Promise[_0xca45('0x99')](_0x1275e9);})[_0xca45('0xd')](function(_0x4fa1f9){_0x2d11a1=_0x4fa1f9[0x0];var _0xdf4f81=[];var _0x4de8d1=[];_0x37dd71[_0xca45('0x96')](function(_0x31ca64){if(!_['isNil'](_0x31ca64[_0xca45('0x97')])){var _0x5f19a6=_0x31ca64[_0xca45('0x97')][_0xca45('0x40')](_0x31ca64[_0xca45('0x97')][_0xca45('0x41')]('.')+0x1);if(_0x5f19a6===_0xca45('0x9a')){_0xdf4f81[_0xca45('0x9b')](getBooleanList(_0xc455c1,_0x16c7ee,_0x4de8d1,_0x58411c[_0xca45('0x92')],_0x31ca64[_0xca45('0x92')],_0x13f088));}}});return Promise[_0xca45('0x99')](_0xdf4f81);})[_0xca45('0xd')](function(_0x518b32){_0x304126=_0x518b32[0x0];var _0x20f055=[];var _0x46649f=[];_0x37dd71['forEach'](function(_0x41a0d5){if(_0x41a0d5[_0xca45('0x97')]){var _0x571cde=_0x41a0d5[_0xca45('0x97')][_0xca45('0x40')](_0x41a0d5[_0xca45('0x97')][_0xca45('0x41')]('.')+0x1);if(_0x571cde===_0xca45('0x9c')||_0x571cde===_0xca45('0x9d')||_0x571cde===_0xca45('0x9e')||_0x571cde==='IntegerAttributeMetadata'||_0x571cde==='MemoAttributeMetadata'||_0x571cde===_0xca45('0x9f')||_0x571cde===_0xca45('0xa0')||_0x571cde===_0xca45('0xa1')||_0x571cde===_0xca45('0xa2')||_0x571cde===_0xca45('0xa3')){_0x20f055['push'](getInputList(_0xc455c1,_0x16c7ee,_0x571cde,_0x46649f,_0x58411c[_0xca45('0x92')],_0x41a0d5[_0xca45('0x92')],_0x13f088));}}});return Promise[_0xca45('0x99')](_0x20f055);})[_0xca45('0xd')](function(_0x598488){_0x5346f8=_0x598488[0x0];var _0x11c4be=_0x2d11a1[_0xca45('0x82')](_0x304126)[_0xca45('0x82')](_0x5346f8);var _0x28b119={'count':_0x11c4be[_0xca45('0x20')],'rows':_0x11c4be};return _0x28b119;})[_0xca45('0xd')](respondWithResult(_0x5bb442,null))[_0xca45('0x2d')](function(_0x191101){var _0x887e16=_0x1995de[_0xca45('0x1b')][_0xca45('0xa4')]?0x1f4:_0x191101[_0xca45('0xa5')]||0x1f4;logger['error'](_0x191101[_0xca45('0x11')]);delete _0x191101[_0xca45('0x12')];if(_0x887e16===0x191){_0x887e16=0x190;}_0x5bb442[_0xca45('0x4')](_0x887e16)[_0xca45('0x13')](_0x1995de[_0xca45('0x1b')][_0xca45('0xa4')]?{'message':_0xca45('0xa6'),'statusCode':_0x191101['statusCode']}:_0x191101);});};function getSelectList(_0x5f5a5a,_0x4ee2f7,_0x15249f,_0x4b2ea4,_0x444f5b,_0x1a76ee){var _0x1949cc={'method':_0xca45('0x90'),'uri':_0x5f5a5a+_0xca45('0x93')+_0x4b2ea4+_0xca45('0xa7')+_0x444f5b+_0xca45('0xa8')+_0xca45('0xa9'),'headers':{'Authorization':_0xca45('0xaa')+_0x1a76ee,'If-None-Match':null,'OData-Version':_0xca45('0x91')},'json':!![]};return rp(_0x1949cc)['then'](function(_0x275404){var _0xfc818=[];var _0x33eb47=_0x275404[_0xca45('0xab')][_0xca45('0xac')];_0x33eb47['forEach'](function(_0xc3de51){_0xfc818[_0xca45('0x9b')]({'name':_0xc3de51['Label'][_0xca45('0xad')][_0xca45('0xae')],'value':String(_0xc3de51[_0xca45('0xaf')])});});var _0x414563={'id':_0x4ee2f7+'_'+_0x275404[_0xca45('0xb0')],'name':_0x275404[_0xca45('0xb1')][_0xca45('0xad')][_0xca45('0xae')],'custom':![],'options':_0xfc818};_0x15249f['push'](_0x414563);return _0x15249f;});}function getBooleanList(_0x3c763e,_0x2071f6,_0x5421b8,_0x2c8e11,_0x374d58,_0xc9d56b){var _0x127806={'method':_0xca45('0x90'),'uri':_0x3c763e+'EntityDefinitions('+_0x2c8e11+_0xca45('0xa7')+_0x374d58+_0xca45('0xb2'),'headers':{'Authorization':_0xca45('0xaa')+_0xc9d56b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x127806)[_0xca45('0xd')](function(_0x1d4782){var _0x2afef2=[];_0x2afef2[_0xca45('0x9b')]({'name':_0x1d4782[_0xca45('0xab')][_0xca45('0xb3')][_0xca45('0xae')][_0xca45('0xad')]['Label'],'value':_0xca45('0xb4')},{'name':_0x1d4782['OptionSet']['FalseOption'][_0xca45('0xae')]['UserLocalizedLabel'][_0xca45('0xae')],'value':_0xca45('0xb5')});var _0x554d36={'id':_0x2071f6+'_'+_0x1d4782[_0xca45('0xb0')],'name':_0x1d4782['DisplayName'][_0xca45('0xad')][_0xca45('0xae')],'custom':![],'options':_0x2afef2};_0x5421b8[_0xca45('0x9b')](_0x554d36);return _0x5421b8;});}function getInputList(_0x160c6a,_0x2338ea,_0x174c1e,_0x3208ff,_0x110e26,_0x47fbfd,_0x3ac81f){var _0x31ec27={'method':'GET','uri':_0x160c6a+_0xca45('0x93')+_0x110e26+_0xca45('0xa7')+_0x47fbfd+_0xca45('0xb6')+_0x174c1e+_0xca45('0xb7'),'headers':{'Authorization':_0xca45('0xaa')+_0x3ac81f,'If-None-Match':null,'OData-Version':_0xca45('0x91')},'json':!![]};return rp(_0x31ec27)[_0xca45('0xd')](function(_0x1a8d82){var _0x21c5a6={'id':_0x2338ea+'_'+_0x1a8d82[_0xca45('0xb0')],'name':_0x1a8d82[_0xca45('0xb1')][_0xca45('0xad')]?_0x1a8d82[_0xca45('0xb1')][_0xca45('0xad')][_0xca45('0xae')]:_0x1a8d82[_0xca45('0xb0')],'custom':![],'options':[]};_0x3208ff['push'](_0x21c5a6);return _0x3208ff;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index fbf3131..abd3cd8 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3837ce,_0x338dfc){var _0x2e130b=function(_0x1cc4e2){while(--_0x1cc4e2){_0x3837ce['push'](_0x3837ce['shift']());}};_0x2e130b(++_0x338dfc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x114470,_0xc29200){var _0x2f5e14=function(_0x434a61){while(--_0x434a61){_0x114470['push'](_0x114470['shift']());}};_0x2f5e14(++_0xc29200);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('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 77c89d6..1db52d3 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 _0xbd6c=['client','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','map','include','model','attributes','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xbd6c,0x139));var _0xcbd6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbd6c[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xcbd6('0x0'));var util=require(_0xcbd6('0x1'));var moment=require(_0xcbd6('0x2'));var BPromise=require(_0xcbd6('0x3'));var rs=require(_0xcbd6('0x4'));var fs=require('fs');var Redis=require(_0xcbd6('0x5'));var db=require(_0xcbd6('0x6'))['db'];var utils=require(_0xcbd6('0x7'));var logger=require(_0xcbd6('0x8'))(_0xcbd6('0x9'));var config=require(_0xcbd6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcbd6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314405,_0x5d8d78,_0x2c80ca){return new BPromise(function(_0x1e3215,_0x37c88b){return client[_0xcbd6('0xc')](_0x314405,_0x2c80ca)[_0xcbd6('0xd')](function(_0xdf7d2e){logger[_0xcbd6('0xe')](_0xcbd6('0xf'),_0x5d8d78,'request\x20sent');logger[_0xcbd6('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5d8d78,'request\x20sent',JSON[_0xcbd6('0x11')](_0xdf7d2e));if(_0xdf7d2e[_0xcbd6('0x12')]){if(_0xdf7d2e['error'][_0xcbd6('0x13')]===0x1f4){logger[_0xcbd6('0x12')](_0xcbd6('0xf'),_0x5d8d78,_0xdf7d2e[_0xcbd6('0x12')][_0xcbd6('0x14')]);return _0x37c88b(_0xdf7d2e[_0xcbd6('0x12')][_0xcbd6('0x14')]);}logger[_0xcbd6('0x12')](_0xcbd6('0xf'),_0x5d8d78,_0xdf7d2e[_0xcbd6('0x12')][_0xcbd6('0x14')]);return _0x1e3215(_0xdf7d2e[_0xcbd6('0x12')][_0xcbd6('0x14')]);}else{logger[_0xcbd6('0xe')](_0xcbd6('0xf'),_0x5d8d78,_0xcbd6('0x15'));_0x1e3215(_0xdf7d2e['result']['message']);}})[_0xcbd6('0x16')](function(_0xe2efd4){logger[_0xcbd6('0x12')](_0xcbd6('0xf'),_0x5d8d78,_0xe2efd4);_0x37c88b(_0xe2efd4);});});}exports[_0xcbd6('0x17')]=function(_0x107e9c){var _0x4f5628=this;return new Promise(function(_0x284c2b,_0x594797){return db[_0xcbd6('0x18')][_0xcbd6('0x19')]({'raw':_0x107e9c['options']?_0x107e9c[_0xcbd6('0x1a')][_0xcbd6('0x1b')]===undefined?!![]:![]:!![],'where':_0x107e9c[_0xcbd6('0x1a')]?_0x107e9c['options'][_0xcbd6('0x1c')]||null:null,'attributes':_0x107e9c['options']?_0x107e9c[_0xcbd6('0x1a')]['attributes']||null:null,'limit':_0x107e9c[_0xcbd6('0x1a')]?_0x107e9c[_0xcbd6('0x1a')][_0xcbd6('0x1d')]||null:null,'include':_0x107e9c['options']?_0x107e9c['options']['include']?_[_0xcbd6('0x1e')](_0x107e9c['options'][_0xcbd6('0x1f')],function(_0x1e785f){return{'model':db[_0x1e785f[_0xcbd6('0x20')]],'as':_0x1e785f['as'],'attributes':_0x1e785f['attributes'],'include':_0x1e785f[_0xcbd6('0x1f')]?_[_0xcbd6('0x1e')](_0x1e785f[_0xcbd6('0x1f')],function(_0x3c1607){return{'model':db[_0x3c1607[_0xcbd6('0x20')]],'as':_0x3c1607['as'],'attributes':_0x3c1607[_0xcbd6('0x21')],'include':_0x3c1607[_0xcbd6('0x1f')]?_[_0xcbd6('0x1e')](_0x3c1607[_0xcbd6('0x1f')],function(_0xe5dc28){return{'model':db[_0xe5dc28[_0xcbd6('0x20')]],'as':_0xe5dc28['as'],'attributes':_0xe5dc28[_0xcbd6('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcbd6('0xd')](function(_0x157249){logger[_0xcbd6('0xe')](_0xcbd6('0x17'),_0x107e9c);logger['debug'](_0xcbd6('0x17'),_0x107e9c,JSON[_0xcbd6('0x11')](_0x157249));_0x284c2b(_0x157249);})[_0xcbd6('0x16')](function(_0x2e51d7){logger[_0xcbd6('0x12')]('GetDynamics365Account',_0x2e51d7[_0xcbd6('0x14')],_0x107e9c);_0x594797(_0x4f5628['error'](0x1f4,_0x2e51d7[_0xcbd6('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x40def7){var _0x5eab18=this;return new Promise(function(_0x1d480a,_0x2f5484){return db[_0xcbd6('0x18')][_0xcbd6('0x22')]({'raw':_0x40def7[_0xcbd6('0x1a')]?_0x40def7[_0xcbd6('0x1a')][_0xcbd6('0x1b')]===undefined?!![]:![]:!![],'where':_0x40def7[_0xcbd6('0x1a')]?_0x40def7['options'][_0xcbd6('0x1c')]||null:null,'attributes':_0x40def7[_0xcbd6('0x1a')]?_0x40def7[_0xcbd6('0x1a')][_0xcbd6('0x21')]||null:null,'include':_0x40def7[_0xcbd6('0x1a')]?_0x40def7[_0xcbd6('0x1a')][_0xcbd6('0x1f')]?_[_0xcbd6('0x1e')](_0x40def7['options'][_0xcbd6('0x1f')],function(_0x1fd3d0){return{'model':db[_0x1fd3d0[_0xcbd6('0x20')]],'as':_0x1fd3d0['as'],'attributes':_0x1fd3d0[_0xcbd6('0x21')],'include':_0x1fd3d0[_0xcbd6('0x1f')]?_[_0xcbd6('0x1e')](_0x1fd3d0['include'],function(_0x42af8a){return{'model':db[_0x42af8a[_0xcbd6('0x20')]],'as':_0x42af8a['as'],'attributes':_0x42af8a[_0xcbd6('0x21')],'include':_0x42af8a[_0xcbd6('0x1f')]?_[_0xcbd6('0x1e')](_0x42af8a[_0xcbd6('0x1f')],function(_0x4bd681){return{'model':db[_0x4bd681[_0xcbd6('0x20')]],'as':_0x4bd681['as'],'attributes':_0x4bd681[_0xcbd6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a05bb){logger['info']('ShowDynamics365Account',_0x40def7);logger['debug']('ShowDynamics365Account',_0x40def7,JSON[_0xcbd6('0x11')](_0x2a05bb));_0x1d480a(_0x2a05bb);})[_0xcbd6('0x16')](function(_0x745e3b){logger[_0xcbd6('0x12')](_0xcbd6('0x23'),_0x745e3b[_0xcbd6('0x14')],_0x40def7);_0x2f5484(_0x5eab18[_0xcbd6('0x12')](0x1f4,_0x745e3b['message']));});});}; \ No newline at end of file +var _0xc199=['code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','include','model','map','then','ShowDynamics365Account','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x364310,_0x266247){var _0x5a438b=function(_0x4b15a3){while(--_0x4b15a3){_0x364310['push'](_0x364310['shift']());}};_0x5a438b(++_0x266247);}(_0xc199,0x192));var _0x9c19=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xc199[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x9c19('0x0'));var util=require(_0x9c19('0x1'));var moment=require('moment');var BPromise=require(_0x9c19('0x2'));var rs=require(_0x9c19('0x3'));var fs=require('fs');var Redis=require(_0x9c19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c19('0x5'));var logger=require(_0x9c19('0x6'))('rpc');var config=require(_0x9c19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9c19('0x8')][_0x9c19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x314015,_0x319140,_0x5a0a54){return new BPromise(function(_0x2f003f,_0x28fa92){return client[_0x9c19('0xa')](_0x314015,_0x5a0a54)['then'](function(_0x54afa7){logger[_0x9c19('0xb')](_0x9c19('0xc'),_0x319140,_0x9c19('0xd'));logger[_0x9c19('0xe')](_0x9c19('0xf'),_0x319140,_0x9c19('0xd'),JSON[_0x9c19('0x10')](_0x54afa7));if(_0x54afa7[_0x9c19('0x11')]){if(_0x54afa7[_0x9c19('0x11')][_0x9c19('0x12')]===0x1f4){logger[_0x9c19('0x11')](_0x9c19('0xc'),_0x319140,_0x54afa7['error'][_0x9c19('0x13')]);return _0x28fa92(_0x54afa7[_0x9c19('0x11')][_0x9c19('0x13')]);}logger['error'](_0x9c19('0xc'),_0x319140,_0x54afa7[_0x9c19('0x11')][_0x9c19('0x13')]);return _0x2f003f(_0x54afa7[_0x9c19('0x11')][_0x9c19('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x319140,_0x9c19('0xd'));_0x2f003f(_0x54afa7[_0x9c19('0x14')][_0x9c19('0x13')]);}})[_0x9c19('0x15')](function(_0x4d9507){logger[_0x9c19('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x319140,_0x4d9507);_0x28fa92(_0x4d9507);});});}exports[_0x9c19('0x16')]=function(_0x20cad7){var _0x5bcbf8=this;return new Promise(function(_0x1581ba,_0x23d38e){return db[_0x9c19('0x17')][_0x9c19('0x18')]({'raw':_0x20cad7[_0x9c19('0x19')]?_0x20cad7[_0x9c19('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20cad7[_0x9c19('0x19')]?_0x20cad7[_0x9c19('0x19')][_0x9c19('0x1a')]||null:null,'attributes':_0x20cad7['options']?_0x20cad7[_0x9c19('0x19')][_0x9c19('0x1b')]||null:null,'limit':_0x20cad7[_0x9c19('0x19')]?_0x20cad7[_0x9c19('0x19')]['limit']||null:null,'include':_0x20cad7['options']?_0x20cad7[_0x9c19('0x19')][_0x9c19('0x1c')]?_['map'](_0x20cad7[_0x9c19('0x19')][_0x9c19('0x1c')],function(_0x218e61){return{'model':db[_0x218e61[_0x9c19('0x1d')]],'as':_0x218e61['as'],'attributes':_0x218e61[_0x9c19('0x1b')],'include':_0x218e61[_0x9c19('0x1c')]?_[_0x9c19('0x1e')](_0x218e61[_0x9c19('0x1c')],function(_0x30fd00){return{'model':db[_0x30fd00['model']],'as':_0x30fd00['as'],'attributes':_0x30fd00[_0x9c19('0x1b')],'include':_0x30fd00[_0x9c19('0x1c')]?_[_0x9c19('0x1e')](_0x30fd00[_0x9c19('0x1c')],function(_0x2ac7d5){return{'model':db[_0x2ac7d5[_0x9c19('0x1d')]],'as':_0x2ac7d5['as'],'attributes':_0x2ac7d5[_0x9c19('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9c19('0x1f')](function(_0x19512b){logger[_0x9c19('0xb')](_0x9c19('0x16'),_0x20cad7);logger['debug'](_0x9c19('0x16'),_0x20cad7,JSON[_0x9c19('0x10')](_0x19512b));_0x1581ba(_0x19512b);})[_0x9c19('0x15')](function(_0x363226){logger[_0x9c19('0x11')]('GetDynamics365Account',_0x363226['message'],_0x20cad7);_0x23d38e(_0x5bcbf8['error'](0x1f4,_0x363226[_0x9c19('0x13')]));});});};exports[_0x9c19('0x20')]=function(_0x17dc08){var _0x24412b=this;return new Promise(function(_0x297620,_0x162fda){return db[_0x9c19('0x17')][_0x9c19('0x21')]({'raw':_0x17dc08[_0x9c19('0x19')]?_0x17dc08[_0x9c19('0x19')][_0x9c19('0x22')]===undefined?!![]:![]:!![],'where':_0x17dc08['options']?_0x17dc08['options'][_0x9c19('0x1a')]||null:null,'attributes':_0x17dc08[_0x9c19('0x19')]?_0x17dc08[_0x9c19('0x19')][_0x9c19('0x1b')]||null:null,'include':_0x17dc08[_0x9c19('0x19')]?_0x17dc08['options']['include']?_['map'](_0x17dc08['options'][_0x9c19('0x1c')],function(_0x1c6e04){return{'model':db[_0x1c6e04['model']],'as':_0x1c6e04['as'],'attributes':_0x1c6e04[_0x9c19('0x1b')],'include':_0x1c6e04[_0x9c19('0x1c')]?_[_0x9c19('0x1e')](_0x1c6e04[_0x9c19('0x1c')],function(_0x36b604){return{'model':db[_0x36b604[_0x9c19('0x1d')]],'as':_0x36b604['as'],'attributes':_0x36b604[_0x9c19('0x1b')],'include':_0x36b604['include']?_[_0x9c19('0x1e')](_0x36b604[_0x9c19('0x1c')],function(_0x11ded0){return{'model':db[_0x11ded0[_0x9c19('0x1d')]],'as':_0x11ded0['as'],'attributes':_0x11ded0[_0x9c19('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x313f33){logger[_0x9c19('0xb')](_0x9c19('0x20'),_0x17dc08);logger['debug'](_0x9c19('0x20'),_0x17dc08,JSON[_0x9c19('0x10')](_0x313f33));_0x297620(_0x313f33);})[_0x9c19('0x15')](function(_0x90cbfe){logger['error']('ShowDynamics365Account',_0x90cbfe[_0x9c19('0x13')],_0x17dc08);_0x162fda(_0x24412b[_0x9c19('0x11')](0x1f4,_0x90cbfe[_0x9c19('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8d95949..0a95b28 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 _0x416b=['../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','post','create','put','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e3e96,_0xb2004a){var _0x12ef29=function(_0x136db5){while(--_0x136db5){_0x2e3e96['push'](_0x2e3e96['shift']());}};_0x12ef29(++_0xb2004a);}(_0x416b,0x1c8));var _0xb416=function(_0xb25c71,_0x184611){_0xb25c71=_0xb25c71-0x0;var _0x4ad3a4=_0x416b[_0xb25c71];return _0x4ad3a4;};'use strict';var multer=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb416('0x2'));var router=express['Router']();var fs_extra=require(_0xb416('0x3'));var auth=require(_0xb416('0x4'));var interaction=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var controller=require(_0xb416('0x7'));router[_0xb416('0x8')]('/',auth[_0xb416('0x9')](),controller[_0xb416('0xa')]);router[_0xb416('0x8')](_0xb416('0xb'),auth[_0xb416('0x9')](),controller['show']);router[_0xb416('0x8')](_0xb416('0xc'),auth[_0xb416('0x9')](),controller['getFields']);router[_0xb416('0x8')](_0xb416('0xd'),auth[_0xb416('0x9')](),controller[_0xb416('0xe')]);router[_0xb416('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xb416('0xf')]('/',auth[_0xb416('0x9')](),controller[_0xb416('0x10')]);router[_0xb416('0x11')]('/:id',auth[_0xb416('0x9')](),controller[_0xb416('0x12')]);router['delete'](_0xb416('0xb'),auth['isAuthenticated'](),controller[_0xb416('0x13')]);module[_0xb416('0x14')]=router; \ No newline at end of file +var _0x51c5=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','exports','multer'];(function(_0x455f19,_0x4f8f3a){var _0x422f21=function(_0x4537cd){while(--_0x4537cd){_0x455f19['push'](_0x455f19['shift']());}};_0x422f21(++_0x4f8f3a);}(_0x51c5,0x8f));var _0x551c=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x51c5[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var path=require(_0x551c('0x2'));var timeout=require(_0x551c('0x3'));var express=require(_0x551c('0x4'));var router=express[_0x551c('0x5')]();var fs_extra=require(_0x551c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x551c('0x7'));var config=require(_0x551c('0x8'));var controller=require(_0x551c('0x9'));router[_0x551c('0xa')]('/',auth[_0x551c('0xb')](),controller[_0x551c('0xc')]);router[_0x551c('0xa')](_0x551c('0xd'),auth['isAuthenticated'](),controller[_0x551c('0xe')]);router[_0x551c('0xa')](_0x551c('0xf'),auth['isAuthenticated'](),controller[_0x551c('0x10')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x551c('0x11')]);router['get'](_0x551c('0x12'),auth[_0x551c('0xb')](),controller[_0x551c('0x13')]);router[_0x551c('0x14')]('/',auth[_0x551c('0xb')](),controller[_0x551c('0x15')]);router['put'](_0x551c('0xd'),auth[_0x551c('0xb')](),controller[_0x551c('0x16')]);router['delete'](_0x551c('0xd'),auth[_0x551c('0xb')](),controller['destroy']);module[_0x551c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2ef11d2..8506a4e 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 _0xdbfb=['contact','sequelize','STRING','ENUM','phonecall','incident'];(function(_0x14046a,_0x422ae4){var _0x48a36b=function(_0x708eed){while(--_0x708eed){_0x14046a['push'](_0x14046a['shift']());}};_0x48a36b(++_0x422ae4);}(_0xdbfb,0xf7));var _0xbdbf=function(_0x4de836,_0x3a1592){_0x4de836=_0x4de836-0x0;var _0x3a118f=_0xdbfb[_0x4de836];return _0x3a118f;};'use strict';var Sequelize=require(_0xbdbf('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdbf('0x1')]},'description':{'type':Sequelize[_0xbdbf('0x1')]},'ticketType':{'type':Sequelize[_0xbdbf('0x2')]('incident',_0xbdbf('0x3')),'defaultValue':_0xbdbf('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xbdbf('0x5'),'nothing'),'defaultValue':_0xbdbf('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xbd2d=['sequelize','exports','STRING','ENUM','incident','phonecall','nothing','contact'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xbd2d,0xa0));var _0xdbd2=function(_0x1a3398,_0x487a06){_0x1a3398=_0x1a3398-0x0;var _0x37af24=_0xbd2d[_0x1a3398];return _0x37af24;};'use strict';var Sequelize=require(_0xdbd2('0x0'));module[_0xdbd2('0x1')]={'name':{'type':Sequelize[_0xdbd2('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xdbd2('0x3')](_0xdbd2('0x4'),_0xdbd2('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xdbd2('0x3')]('contact',_0xdbd2('0x6')),'defaultValue':_0xdbd2('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5d4cce2..6c168df 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 _0xf738=['length','find','create','update','body','getFields','pick','hasOwnProperty','nolimit','getSubjects','Dynamics365Field','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','json','apply','save','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf738,0x100));var _0x8f73=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xf738[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require(_0x8f73('0x0'));var rimraf=require(_0x8f73('0x1'));var zipdir=require(_0x8f73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f73('0x3'));var moment=require('moment');var BPromise=require(_0x8f73('0x4'));var Mustache=require(_0x8f73('0x5'));var util=require('util');var path=require(_0x8f73('0x6'));var sox=require(_0x8f73('0x7'));var csv=require('to-csv');var ejs=require(_0x8f73('0x8'));var fs=require('fs');var fs_extra=require(_0x8f73('0x9'));var _=require('lodash');var squel=require(_0x8f73('0xa'));var crypto=require(_0x8f73('0xb'));var jsforce=require(_0x8f73('0xc'));var deskjs=require(_0x8f73('0xd'));var toCsv=require(_0x8f73('0xe'));var querystring=require(_0x8f73('0xf'));var Papa=require(_0x8f73('0x10'));var Redis=require('ioredis');var authService=require(_0x8f73('0x11'));var qs=require(_0x8f73('0x12'));var as=require(_0x8f73('0x13'));var hardwareService=require(_0x8f73('0x14'));var logger=require(_0x8f73('0x15'))(_0x8f73('0x16'));var utils=require('../../config/utils');var config=require(_0x8f73('0x17'));var licenseUtil=require(_0x8f73('0x18'));var db=require(_0x8f73('0x19'))['db'];function respondWithStatusCode(_0x2b25b9,_0x32e144){_0x32e144=_0x32e144||0xcc;return function(_0x17157a){if(_0x17157a){return _0x2b25b9[_0x8f73('0x1a')](_0x32e144);}return _0x2b25b9['status'](_0x32e144)[_0x8f73('0x1b')]();};}function respondWithResult(_0x5e9f00,_0xc8b19c){_0xc8b19c=_0xc8b19c||0xc8;return function(_0x64ba5f){if(_0x64ba5f){return _0x5e9f00['status'](_0xc8b19c)['json'](_0x64ba5f);}};}function respondWithFilteredResult(_0x46923c,_0x166b4b){return function(_0x3d7a71){if(_0x3d7a71){var _0x2e9c57=typeof _0x166b4b[_0x8f73('0x1c')]==='undefined'&&typeof _0x166b4b[_0x8f73('0x1d')]===_0x8f73('0x1e');var _0x46c56b=_0x3d7a71['count'];var _0x1754d6=_0x2e9c57?0x0:_0x166b4b['offset'];var _0x43e79b=_0x2e9c57?_0x3d7a71[_0x8f73('0x1f')]:_0x166b4b['offset']+_0x166b4b[_0x8f73('0x1d')];var _0x275111;if(_0x43e79b>=_0x46c56b){_0x43e79b=_0x46c56b;_0x275111=0xc8;}else{_0x275111=0xce;}_0x46923c[_0x8f73('0x20')](_0x275111);return _0x46923c[_0x8f73('0x21')]('Content-Range',_0x1754d6+'-'+_0x43e79b+'/'+_0x46c56b)[_0x8f73('0x22')](_0x3d7a71);}return null;};}function patchUpdates(_0x1c0ad7){return function(_0xfacbff){try{jsonpatch[_0x8f73('0x23')](_0xfacbff,_0x1c0ad7,!![]);}catch(_0x16c576){return BPromise['reject'](_0x16c576);}return _0xfacbff[_0x8f73('0x24')]();};}function saveUpdates(_0x430142,_0x1b0059){return function(_0x3cf098){if(_0x3cf098){return _0x3cf098['update'](_0x430142)[_0x8f73('0x25')](function(_0x5b0679){return _0x5b0679;});}return null;};}function removeEntity(_0x227d82,_0xfb3afe){return function(_0x3a91e9){if(_0x3a91e9){return _0x3a91e9[_0x8f73('0x26')]()['then'](function(){_0x227d82[_0x8f73('0x20')](0xcc)[_0x8f73('0x1b')]();});}};}function handleEntityNotFound(_0x38e090,_0x34554c){return function(_0x4f6cb0){if(!_0x4f6cb0){_0x38e090['sendStatus'](0x194);}return _0x4f6cb0;};}function handleError(_0x19495e,_0x4c04a1){_0x4c04a1=_0x4c04a1||0x1f4;return function(_0x226b07){logger[_0x8f73('0x27')](_0x226b07['stack']);if(_0x226b07[_0x8f73('0x28')]){delete _0x226b07['name'];}_0x19495e[_0x8f73('0x20')](_0x4c04a1)[_0x8f73('0x29')](_0x226b07);};}exports[_0x8f73('0x2a')]=function(_0x1af674,_0x3dc0e5){var _0x1c6e46={},_0x22516e={},_0x85fe38={'count':0x0,'rows':[]};var _0x2a4d91=_[_0x8f73('0x2b')](db[_0x8f73('0x2c')][_0x8f73('0x2d')],function(_0x48b393){return{'name':_0x48b393[_0x8f73('0x2e')],'type':_0x48b393['type'][_0x8f73('0x2f')]};});_0x22516e[_0x8f73('0x30')]=_[_0x8f73('0x2b')](_0x2a4d91,_0x8f73('0x28'));_0x22516e[_0x8f73('0x31')]=_[_0x8f73('0x32')](_0x1af674[_0x8f73('0x31')]);_0x22516e[_0x8f73('0x33')]=_[_0x8f73('0x34')](_0x22516e[_0x8f73('0x30')],_0x22516e[_0x8f73('0x31')]);_0x1c6e46[_0x8f73('0x35')]=_[_0x8f73('0x34')](_0x22516e['model'],qs[_0x8f73('0x36')](_0x1af674[_0x8f73('0x31')][_0x8f73('0x36')]));_0x1c6e46['attributes']=_0x1c6e46[_0x8f73('0x35')]['length']?_0x1c6e46[_0x8f73('0x35')]:_0x22516e['model'];if(!_0x1af674[_0x8f73('0x31')]['hasOwnProperty']('nolimit')){_0x1c6e46['limit']=qs[_0x8f73('0x1d')](_0x1af674[_0x8f73('0x31')]['limit']);_0x1c6e46[_0x8f73('0x1c')]=qs[_0x8f73('0x1c')](_0x1af674['query']['offset']);}_0x1c6e46[_0x8f73('0x37')]=qs[_0x8f73('0x38')](_0x1af674[_0x8f73('0x31')]['sort']);_0x1c6e46[_0x8f73('0x39')]=qs[_0x8f73('0x33')](_['pick'](_0x1af674['query'],_0x22516e[_0x8f73('0x33')]),_0x2a4d91);if(_0x1af674['query'][_0x8f73('0x3a')]){_0x1c6e46[_0x8f73('0x39')]=_[_0x8f73('0x3b')](_0x1c6e46[_0x8f73('0x39')],{'$or':_['map'](_0x2a4d91,function(_0x38a297){if(_0x38a297[_0x8f73('0x3c')]!==_0x8f73('0x3d')){var _0x45ea23={};_0x45ea23[_0x38a297[_0x8f73('0x28')]]={'$like':'%'+_0x1af674['query'][_0x8f73('0x3a')]+'%'};return _0x45ea23;}})});}_0x1c6e46=_[_0x8f73('0x3b')]({},_0x1c6e46,_0x1af674[_0x8f73('0x3e')]);var _0x4efd84={'where':_0x1c6e46[_0x8f73('0x39')]};return db[_0x8f73('0x2c')][_0x8f73('0x1f')](_0x4efd84)['then'](function(_0x3b1260){_0x85fe38[_0x8f73('0x1f')]=_0x3b1260;if(_0x1af674[_0x8f73('0x31')][_0x8f73('0x3f')]){_0x1c6e46[_0x8f73('0x40')]=[{'all':!![]}];}return db[_0x8f73('0x2c')][_0x8f73('0x41')](_0x1c6e46);})['then'](function(_0x17977f){_0x85fe38['rows']=_0x17977f;return _0x85fe38;})[_0x8f73('0x25')](respondWithFilteredResult(_0x3dc0e5,_0x1c6e46))[_0x8f73('0x42')](handleError(_0x3dc0e5,null));};exports['show']=function(_0x3b2265,_0x420a27){var _0x2d1716={'raw':![],'where':{'id':_0x3b2265[_0x8f73('0x43')]['id']}},_0x42216b={};_0x42216b[_0x8f73('0x30')]=_[_0x8f73('0x32')](db['Dynamics365Configuration'][_0x8f73('0x2d')]);_0x42216b[_0x8f73('0x31')]=_[_0x8f73('0x32')](_0x3b2265[_0x8f73('0x31')]);_0x42216b[_0x8f73('0x33')]=_['intersection'](_0x42216b[_0x8f73('0x30')],_0x42216b[_0x8f73('0x31')]);_0x2d1716['attributes']=_[_0x8f73('0x34')](_0x42216b[_0x8f73('0x30')],qs['fields'](_0x3b2265[_0x8f73('0x31')][_0x8f73('0x36')]));_0x2d1716[_0x8f73('0x35')]=_0x2d1716[_0x8f73('0x35')][_0x8f73('0x44')]?_0x2d1716['attributes']:_0x42216b[_0x8f73('0x30')];if(_0x3b2265[_0x8f73('0x31')]['includeAll']){_0x2d1716[_0x8f73('0x40')]=[{'all':!![]}];}_0x2d1716=_[_0x8f73('0x3b')]({},_0x2d1716,_0x3b2265[_0x8f73('0x3e')]);return db[_0x8f73('0x2c')][_0x8f73('0x45')](_0x2d1716)[_0x8f73('0x25')](handleEntityNotFound(_0x420a27,null))['then'](respondWithResult(_0x420a27,null))[_0x8f73('0x42')](handleError(_0x420a27,null));};exports['create']=function(_0x332254,_0x4f03c7){return db[_0x8f73('0x2c')][_0x8f73('0x46')](_0x332254['body'],{})[_0x8f73('0x25')](respondWithResult(_0x4f03c7,0xc9))['catch'](handleError(_0x4f03c7,null));};exports[_0x8f73('0x47')]=function(_0x31ecb8,_0x28c99f){if(_0x31ecb8[_0x8f73('0x48')]['id']){delete _0x31ecb8[_0x8f73('0x48')]['id'];}return db['Dynamics365Configuration'][_0x8f73('0x45')]({'where':{'id':_0x31ecb8['params']['id']}})[_0x8f73('0x25')](handleEntityNotFound(_0x28c99f,null))[_0x8f73('0x25')](saveUpdates(_0x31ecb8[_0x8f73('0x48')],null))['then'](respondWithResult(_0x28c99f,null))['catch'](handleError(_0x28c99f,null));};exports[_0x8f73('0x26')]=function(_0x466ac2,_0x1e2ca9){return db[_0x8f73('0x2c')][_0x8f73('0x45')]({'where':{'id':_0x466ac2[_0x8f73('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e2ca9,null))[_0x8f73('0x25')](removeEntity(_0x1e2ca9,null))[_0x8f73('0x42')](handleError(_0x1e2ca9,null));};exports[_0x8f73('0x49')]=function(_0x465388,_0x370183,_0x319458){var _0x42154d={};var _0x214a08={};var _0x1a3455;var _0x5a61a6;return db[_0x8f73('0x2c')]['findOne']({'where':{'id':_0x465388[_0x8f73('0x43')]['id']}})[_0x8f73('0x25')](handleEntityNotFound(_0x370183,null))[_0x8f73('0x25')](function(_0x28687b){if(_0x28687b){_0x1a3455=_0x28687b;_0x214a08[_0x8f73('0x30')]=_[_0x8f73('0x32')](db['Dynamics365Field'][_0x8f73('0x2d')]);_0x214a08[_0x8f73('0x31')]=_['keys'](_0x465388[_0x8f73('0x31')]);_0x214a08[_0x8f73('0x33')]=_[_0x8f73('0x34')](_0x214a08['model'],_0x214a08[_0x8f73('0x31')]);_0x42154d[_0x8f73('0x35')]=_[_0x8f73('0x34')](_0x214a08[_0x8f73('0x30')],qs[_0x8f73('0x36')](_0x465388['query']['fields']));_0x42154d[_0x8f73('0x35')]=_0x42154d[_0x8f73('0x35')][_0x8f73('0x44')]?_0x42154d[_0x8f73('0x35')]:_0x214a08[_0x8f73('0x30')];_0x42154d[_0x8f73('0x37')]=qs[_0x8f73('0x38')](_0x465388[_0x8f73('0x31')][_0x8f73('0x38')]);_0x42154d[_0x8f73('0x39')]=qs[_0x8f73('0x33')](_[_0x8f73('0x4a')](_0x465388[_0x8f73('0x31')],_0x214a08['filters']));if(_0x465388['query'][_0x8f73('0x3a')]){_0x42154d[_0x8f73('0x39')]=_[_0x8f73('0x3b')](_0x42154d[_0x8f73('0x39')],{'$or':_[_0x8f73('0x2b')](_0x42154d['attributes'],function(_0x38ef14){var _0xf7eab4={};_0xf7eab4[_0x38ef14]={'$like':'%'+_0x465388[_0x8f73('0x31')][_0x8f73('0x3a')]+'%'};return _0xf7eab4;})});}_0x42154d=_[_0x8f73('0x3b')]({},_0x42154d,_0x465388[_0x8f73('0x3e')]);return _0x1a3455[_0x8f73('0x49')](_0x42154d);}})['then'](function(_0x1d9258){if(_0x1d9258){_0x5a61a6=_0x1d9258['length'];if(!_0x465388[_0x8f73('0x31')][_0x8f73('0x4b')](_0x8f73('0x4c'))){_0x42154d[_0x8f73('0x1d')]=qs[_0x8f73('0x1d')](_0x465388['query'][_0x8f73('0x1d')]);_0x42154d[_0x8f73('0x1c')]=qs[_0x8f73('0x1c')](_0x465388[_0x8f73('0x31')]['offset']);}return _0x1a3455[_0x8f73('0x49')](_0x42154d);}})[_0x8f73('0x25')](function(_0x3aebb1){if(_0x3aebb1){return _0x3aebb1?{'count':_0x5a61a6,'rows':_0x3aebb1}:null;}})[_0x8f73('0x25')](respondWithResult(_0x370183,null))[_0x8f73('0x42')](handleError(_0x370183,null));};exports[_0x8f73('0x4d')]=function(_0x250db2,_0xb6b215,_0x5b1f5e){var _0x3c958c={};var _0x5490b4={};var _0x337e33;var _0x4559b7;return db[_0x8f73('0x2c')]['findOne']({'where':{'id':_0x250db2[_0x8f73('0x43')]['id']}})[_0x8f73('0x25')](handleEntityNotFound(_0xb6b215,null))['then'](function(_0x372be8){if(_0x372be8){_0x337e33=_0x372be8;_0x5490b4['model']=_[_0x8f73('0x32')](db[_0x8f73('0x4e')][_0x8f73('0x2d')]);_0x5490b4['query']=_['keys'](_0x250db2[_0x8f73('0x31')]);_0x5490b4[_0x8f73('0x33')]=_[_0x8f73('0x34')](_0x5490b4[_0x8f73('0x30')],_0x5490b4[_0x8f73('0x31')]);_0x3c958c[_0x8f73('0x35')]=_[_0x8f73('0x34')](_0x5490b4[_0x8f73('0x30')],qs['fields'](_0x250db2[_0x8f73('0x31')]['fields']));_0x3c958c[_0x8f73('0x35')]=_0x3c958c[_0x8f73('0x35')][_0x8f73('0x44')]?_0x3c958c[_0x8f73('0x35')]:_0x5490b4[_0x8f73('0x30')];_0x3c958c[_0x8f73('0x37')]=qs['sort'](_0x250db2[_0x8f73('0x31')]['sort']);_0x3c958c[_0x8f73('0x39')]=qs[_0x8f73('0x33')](_[_0x8f73('0x4a')](_0x250db2[_0x8f73('0x31')],_0x5490b4[_0x8f73('0x33')]));if(_0x250db2[_0x8f73('0x31')][_0x8f73('0x3a')]){_0x3c958c['where']=_[_0x8f73('0x3b')](_0x3c958c['where'],{'$or':_[_0x8f73('0x2b')](_0x3c958c[_0x8f73('0x35')],function(_0x5ccabd){var _0x37473d={};_0x37473d[_0x5ccabd]={'$like':'%'+_0x250db2['query'][_0x8f73('0x3a')]+'%'};return _0x37473d;})});}_0x3c958c=_['merge']({},_0x3c958c,_0x250db2[_0x8f73('0x3e')]);return _0x337e33[_0x8f73('0x4d')](_0x3c958c);}})['then'](function(_0x8e0e57){if(_0x8e0e57){_0x4559b7=_0x8e0e57[_0x8f73('0x44')];if(!_0x250db2[_0x8f73('0x31')][_0x8f73('0x4b')](_0x8f73('0x4c'))){_0x3c958c[_0x8f73('0x1d')]=qs[_0x8f73('0x1d')](_0x250db2[_0x8f73('0x31')][_0x8f73('0x1d')]);_0x3c958c[_0x8f73('0x1c')]=qs[_0x8f73('0x1c')](_0x250db2[_0x8f73('0x31')][_0x8f73('0x1c')]);}return _0x337e33['getSubjects'](_0x3c958c);}})[_0x8f73('0x25')](function(_0xe440e1){if(_0xe440e1){return _0xe440e1?{'count':_0x4559b7,'rows':_0xe440e1}:null;}})[_0x8f73('0x25')](respondWithResult(_0xb6b215,null))[_0x8f73('0x42')](handleError(_0xb6b215,null));};exports['getDescriptions']=function(_0x20fb74,_0x5e565a,_0x119248){var _0x2a3737={};var _0x5cba31={};var _0x4ebb14;var _0x146ffd;return db['Dynamics365Configuration'][_0x8f73('0x4f')]({'where':{'id':_0x20fb74[_0x8f73('0x43')]['id']}})[_0x8f73('0x25')](handleEntityNotFound(_0x5e565a,null))[_0x8f73('0x25')](function(_0x1f29da){if(_0x1f29da){_0x4ebb14=_0x1f29da;_0x5cba31[_0x8f73('0x30')]=_[_0x8f73('0x32')](db[_0x8f73('0x4e')][_0x8f73('0x2d')]);_0x5cba31['query']=_['keys'](_0x20fb74[_0x8f73('0x31')]);_0x5cba31[_0x8f73('0x33')]=_[_0x8f73('0x34')](_0x5cba31[_0x8f73('0x30')],_0x5cba31[_0x8f73('0x31')]);_0x2a3737[_0x8f73('0x35')]=_[_0x8f73('0x34')](_0x5cba31['model'],qs[_0x8f73('0x36')](_0x20fb74[_0x8f73('0x31')]['fields']));_0x2a3737[_0x8f73('0x35')]=_0x2a3737[_0x8f73('0x35')][_0x8f73('0x44')]?_0x2a3737['attributes']:_0x5cba31['model'];_0x2a3737['order']=qs['sort'](_0x20fb74['query'][_0x8f73('0x38')]);_0x2a3737['where']=qs['filters'](_[_0x8f73('0x4a')](_0x20fb74[_0x8f73('0x31')],_0x5cba31[_0x8f73('0x33')]));if(_0x20fb74['query'][_0x8f73('0x3a')]){_0x2a3737[_0x8f73('0x39')]=_[_0x8f73('0x3b')](_0x2a3737['where'],{'$or':_[_0x8f73('0x2b')](_0x2a3737['attributes'],function(_0x436983){var _0x351941={};_0x351941[_0x436983]={'$like':'%'+_0x20fb74[_0x8f73('0x31')][_0x8f73('0x3a')]+'%'};return _0x351941;})});}_0x2a3737=_[_0x8f73('0x3b')]({},_0x2a3737,_0x20fb74[_0x8f73('0x3e')]);return _0x4ebb14['getDescriptions'](_0x2a3737);}})['then'](function(_0x175b89){if(_0x175b89){_0x146ffd=_0x175b89['length'];if(!_0x20fb74[_0x8f73('0x31')][_0x8f73('0x4b')](_0x8f73('0x4c'))){_0x2a3737[_0x8f73('0x1d')]=qs[_0x8f73('0x1d')](_0x20fb74[_0x8f73('0x31')][_0x8f73('0x1d')]);_0x2a3737[_0x8f73('0x1c')]=qs[_0x8f73('0x1c')](_0x20fb74[_0x8f73('0x31')]['offset']);}return _0x4ebb14[_0x8f73('0x50')](_0x2a3737);}})['then'](function(_0x5d82b5){if(_0x5d82b5){return _0x5d82b5?{'count':_0x146ffd,'rows':_0x5d82b5}:null;}})['then'](respondWithResult(_0x5e565a,null))[_0x8f73('0x42')](handleError(_0x5e565a,null));}; \ No newline at end of file +var _0xe355=['status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','Dynamics365Configuration','findAll','rows','catch','show','find','create','body','params','findOne','Dynamics365Field','order','pick','getFields','getSubjects','getDescriptions','zip-dir','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5e4fb9,_0x45caf4){var _0x4189b4=function(_0x486bfa){while(--_0x486bfa){_0x5e4fb9['push'](_0x5e4fb9['shift']());}};_0x4189b4(++_0x45caf4);}(_0xe355,0x87));var _0x5e35=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0xe355[_0xfdf7a4];return _0x59ec89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e35('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e35('0x1'));var moment=require('moment');var BPromise=require(_0x5e35('0x2'));var Mustache=require(_0x5e35('0x3'));var util=require(_0x5e35('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5e35('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e35('0x6'));var squel=require(_0x5e35('0x7'));var crypto=require(_0x5e35('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5e35('0x9'));var toCsv=require(_0x5e35('0xa'));var querystring=require('querystring');var Papa=require(_0x5e35('0xb'));var Redis=require(_0x5e35('0xc'));var authService=require(_0x5e35('0xd'));var qs=require(_0x5e35('0xe'));var as=require(_0x5e35('0xf'));var hardwareService=require(_0x5e35('0x10'));var logger=require(_0x5e35('0x11'))('api');var utils=require(_0x5e35('0x12'));var config=require(_0x5e35('0x13'));var licenseUtil=require(_0x5e35('0x14'));var db=require(_0x5e35('0x15'))['db'];function respondWithStatusCode(_0x126ba8,_0x201baf){_0x201baf=_0x201baf||0xcc;return function(_0x25e2bc){if(_0x25e2bc){return _0x126ba8[_0x5e35('0x16')](_0x201baf);}return _0x126ba8[_0x5e35('0x17')](_0x201baf)[_0x5e35('0x18')]();};}function respondWithResult(_0x410af8,_0x4b2dde){_0x4b2dde=_0x4b2dde||0xc8;return function(_0x566f8c){if(_0x566f8c){return _0x410af8[_0x5e35('0x17')](_0x4b2dde)[_0x5e35('0x19')](_0x566f8c);}};}function respondWithFilteredResult(_0x1d5d8d,_0x578717){return function(_0x3c8fb1){if(_0x3c8fb1){var _0x1e5e24=typeof _0x578717['offset']===_0x5e35('0x1a')&&typeof _0x578717[_0x5e35('0x1b')]===_0x5e35('0x1a');var _0x4b21d5=_0x3c8fb1[_0x5e35('0x1c')];var _0x27aabc=_0x1e5e24?0x0:_0x578717['offset'];var _0x4b390d=_0x1e5e24?_0x3c8fb1[_0x5e35('0x1c')]:_0x578717[_0x5e35('0x1d')]+_0x578717['limit'];var _0x1e416d;if(_0x4b390d>=_0x4b21d5){_0x4b390d=_0x4b21d5;_0x1e416d=0xc8;}else{_0x1e416d=0xce;}_0x1d5d8d[_0x5e35('0x17')](_0x1e416d);return _0x1d5d8d['set'](_0x5e35('0x1e'),_0x27aabc+'-'+_0x4b390d+'/'+_0x4b21d5)[_0x5e35('0x19')](_0x3c8fb1);}return null;};}function patchUpdates(_0xcf409f){return function(_0x454724){try{jsonpatch['apply'](_0x454724,_0xcf409f,!![]);}catch(_0x29844f){return BPromise[_0x5e35('0x1f')](_0x29844f);}return _0x454724[_0x5e35('0x20')]();};}function saveUpdates(_0x5394e7,_0x576e9a){return function(_0x453239){if(_0x453239){return _0x453239[_0x5e35('0x21')](_0x5394e7)[_0x5e35('0x22')](function(_0x26311e){return _0x26311e;});}return null;};}function removeEntity(_0x1e2ff8,_0xeb2603){return function(_0x1c95f4){if(_0x1c95f4){return _0x1c95f4[_0x5e35('0x23')]()[_0x5e35('0x22')](function(){_0x1e2ff8['status'](0xcc)[_0x5e35('0x18')]();});}};}function handleEntityNotFound(_0x2e350e,_0x302022){return function(_0x132f9f){if(!_0x132f9f){_0x2e350e[_0x5e35('0x16')](0x194);}return _0x132f9f;};}function handleError(_0x181007,_0x5177cd){_0x5177cd=_0x5177cd||0x1f4;return function(_0x4fc9f4){logger[_0x5e35('0x24')](_0x4fc9f4[_0x5e35('0x25')]);if(_0x4fc9f4[_0x5e35('0x26')]){delete _0x4fc9f4['name'];}_0x181007[_0x5e35('0x17')](_0x5177cd)[_0x5e35('0x27')](_0x4fc9f4);};}exports[_0x5e35('0x28')]=function(_0x5afcf6,_0x1d6326){var _0x376d25={},_0x278ebc={},_0x3b4bba={'count':0x0,'rows':[]};var _0x2ce3f4=_[_0x5e35('0x29')](db['Dynamics365Configuration'][_0x5e35('0x2a')],function(_0x26795d){return{'name':_0x26795d[_0x5e35('0x2b')],'type':_0x26795d[_0x5e35('0x2c')][_0x5e35('0x2d')]};});_0x278ebc[_0x5e35('0x2e')]=_[_0x5e35('0x29')](_0x2ce3f4,_0x5e35('0x26'));_0x278ebc[_0x5e35('0x2f')]=_[_0x5e35('0x30')](_0x5afcf6[_0x5e35('0x2f')]);_0x278ebc[_0x5e35('0x31')]=_[_0x5e35('0x32')](_0x278ebc['model'],_0x278ebc[_0x5e35('0x2f')]);_0x376d25['attributes']=_[_0x5e35('0x32')](_0x278ebc[_0x5e35('0x2e')],qs[_0x5e35('0x33')](_0x5afcf6[_0x5e35('0x2f')][_0x5e35('0x33')]));_0x376d25[_0x5e35('0x34')]=_0x376d25[_0x5e35('0x34')][_0x5e35('0x35')]?_0x376d25['attributes']:_0x278ebc['model'];if(!_0x5afcf6['query'][_0x5e35('0x36')](_0x5e35('0x37'))){_0x376d25['limit']=qs[_0x5e35('0x1b')](_0x5afcf6[_0x5e35('0x2f')]['limit']);_0x376d25['offset']=qs[_0x5e35('0x1d')](_0x5afcf6[_0x5e35('0x2f')]['offset']);}_0x376d25['order']=qs[_0x5e35('0x38')](_0x5afcf6['query'][_0x5e35('0x38')]);_0x376d25[_0x5e35('0x39')]=qs[_0x5e35('0x31')](_['pick'](_0x5afcf6[_0x5e35('0x2f')],_0x278ebc[_0x5e35('0x31')]),_0x2ce3f4);if(_0x5afcf6[_0x5e35('0x2f')][_0x5e35('0x3a')]){_0x376d25['where']=_[_0x5e35('0x3b')](_0x376d25[_0x5e35('0x39')],{'$or':_['map'](_0x2ce3f4,function(_0x1ad7cd){if(_0x1ad7cd[_0x5e35('0x2c')]!==_0x5e35('0x3c')){var _0xb6dfce={};_0xb6dfce[_0x1ad7cd[_0x5e35('0x26')]]={'$like':'%'+_0x5afcf6[_0x5e35('0x2f')]['filter']+'%'};return _0xb6dfce;}})});}_0x376d25=_['merge']({},_0x376d25,_0x5afcf6[_0x5e35('0x3d')]);var _0x4ed260={'where':_0x376d25[_0x5e35('0x39')]};return db['Dynamics365Configuration']['count'](_0x4ed260)[_0x5e35('0x22')](function(_0x623086){_0x3b4bba['count']=_0x623086;if(_0x5afcf6['query']['includeAll']){_0x376d25[_0x5e35('0x3e')]=[{'all':!![]}];}return db[_0x5e35('0x3f')][_0x5e35('0x40')](_0x376d25);})['then'](function(_0x5c24a7){_0x3b4bba[_0x5e35('0x41')]=_0x5c24a7;return _0x3b4bba;})[_0x5e35('0x22')](respondWithFilteredResult(_0x1d6326,_0x376d25))[_0x5e35('0x42')](handleError(_0x1d6326,null));};exports[_0x5e35('0x43')]=function(_0x58515,_0x54cf4c){var _0x4121af={'raw':![],'where':{'id':_0x58515['params']['id']}},_0x4ec67a={};_0x4ec67a[_0x5e35('0x2e')]=_[_0x5e35('0x30')](db[_0x5e35('0x3f')][_0x5e35('0x2a')]);_0x4ec67a['query']=_[_0x5e35('0x30')](_0x58515[_0x5e35('0x2f')]);_0x4ec67a[_0x5e35('0x31')]=_[_0x5e35('0x32')](_0x4ec67a[_0x5e35('0x2e')],_0x4ec67a[_0x5e35('0x2f')]);_0x4121af['attributes']=_[_0x5e35('0x32')](_0x4ec67a[_0x5e35('0x2e')],qs[_0x5e35('0x33')](_0x58515[_0x5e35('0x2f')][_0x5e35('0x33')]));_0x4121af[_0x5e35('0x34')]=_0x4121af[_0x5e35('0x34')]['length']?_0x4121af[_0x5e35('0x34')]:_0x4ec67a[_0x5e35('0x2e')];if(_0x58515[_0x5e35('0x2f')]['includeAll']){_0x4121af[_0x5e35('0x3e')]=[{'all':!![]}];}_0x4121af=_['merge']({},_0x4121af,_0x58515[_0x5e35('0x3d')]);return db[_0x5e35('0x3f')][_0x5e35('0x44')](_0x4121af)[_0x5e35('0x22')](handleEntityNotFound(_0x54cf4c,null))[_0x5e35('0x22')](respondWithResult(_0x54cf4c,null))[_0x5e35('0x42')](handleError(_0x54cf4c,null));};exports['create']=function(_0x56ba06,_0x1167da){return db[_0x5e35('0x3f')][_0x5e35('0x45')](_0x56ba06['body'],{})[_0x5e35('0x22')](respondWithResult(_0x1167da,0xc9))['catch'](handleError(_0x1167da,null));};exports['update']=function(_0x250356,_0x566dca){if(_0x250356[_0x5e35('0x46')]['id']){delete _0x250356[_0x5e35('0x46')]['id'];}return db[_0x5e35('0x3f')]['find']({'where':{'id':_0x250356['params']['id']}})['then'](handleEntityNotFound(_0x566dca,null))['then'](saveUpdates(_0x250356[_0x5e35('0x46')],null))[_0x5e35('0x22')](respondWithResult(_0x566dca,null))[_0x5e35('0x42')](handleError(_0x566dca,null));};exports['destroy']=function(_0x1168bd,_0x1e41d0){return db['Dynamics365Configuration'][_0x5e35('0x44')]({'where':{'id':_0x1168bd[_0x5e35('0x47')]['id']}})[_0x5e35('0x22')](handleEntityNotFound(_0x1e41d0,null))[_0x5e35('0x22')](removeEntity(_0x1e41d0,null))[_0x5e35('0x42')](handleError(_0x1e41d0,null));};exports['getFields']=function(_0x5f4780,_0x1a4b44,_0x15825e){var _0xd5bd59={};var _0x47aba2={};var _0xcba984;var _0x5e5606;return db[_0x5e35('0x3f')][_0x5e35('0x48')]({'where':{'id':_0x5f4780[_0x5e35('0x47')]['id']}})[_0x5e35('0x22')](handleEntityNotFound(_0x1a4b44,null))[_0x5e35('0x22')](function(_0x32880c){if(_0x32880c){_0xcba984=_0x32880c;_0x47aba2[_0x5e35('0x2e')]=_[_0x5e35('0x30')](db[_0x5e35('0x49')]['rawAttributes']);_0x47aba2['query']=_[_0x5e35('0x30')](_0x5f4780['query']);_0x47aba2[_0x5e35('0x31')]=_['intersection'](_0x47aba2[_0x5e35('0x2e')],_0x47aba2['query']);_0xd5bd59[_0x5e35('0x34')]=_['intersection'](_0x47aba2['model'],qs[_0x5e35('0x33')](_0x5f4780[_0x5e35('0x2f')][_0x5e35('0x33')]));_0xd5bd59[_0x5e35('0x34')]=_0xd5bd59[_0x5e35('0x34')][_0x5e35('0x35')]?_0xd5bd59['attributes']:_0x47aba2[_0x5e35('0x2e')];_0xd5bd59[_0x5e35('0x4a')]=qs['sort'](_0x5f4780[_0x5e35('0x2f')][_0x5e35('0x38')]);_0xd5bd59[_0x5e35('0x39')]=qs[_0x5e35('0x31')](_[_0x5e35('0x4b')](_0x5f4780[_0x5e35('0x2f')],_0x47aba2[_0x5e35('0x31')]));if(_0x5f4780[_0x5e35('0x2f')]['filter']){_0xd5bd59[_0x5e35('0x39')]=_[_0x5e35('0x3b')](_0xd5bd59[_0x5e35('0x39')],{'$or':_['map'](_0xd5bd59[_0x5e35('0x34')],function(_0x5c761e){var _0x2807dd={};_0x2807dd[_0x5c761e]={'$like':'%'+_0x5f4780[_0x5e35('0x2f')][_0x5e35('0x3a')]+'%'};return _0x2807dd;})});}_0xd5bd59=_[_0x5e35('0x3b')]({},_0xd5bd59,_0x5f4780[_0x5e35('0x3d')]);return _0xcba984[_0x5e35('0x4c')](_0xd5bd59);}})[_0x5e35('0x22')](function(_0x7b5241){if(_0x7b5241){_0x5e5606=_0x7b5241[_0x5e35('0x35')];if(!_0x5f4780[_0x5e35('0x2f')][_0x5e35('0x36')](_0x5e35('0x37'))){_0xd5bd59['limit']=qs[_0x5e35('0x1b')](_0x5f4780[_0x5e35('0x2f')]['limit']);_0xd5bd59['offset']=qs['offset'](_0x5f4780[_0x5e35('0x2f')][_0x5e35('0x1d')]);}return _0xcba984[_0x5e35('0x4c')](_0xd5bd59);}})[_0x5e35('0x22')](function(_0x2a55da){if(_0x2a55da){return _0x2a55da?{'count':_0x5e5606,'rows':_0x2a55da}:null;}})[_0x5e35('0x22')](respondWithResult(_0x1a4b44,null))[_0x5e35('0x42')](handleError(_0x1a4b44,null));};exports['getSubjects']=function(_0x2b38b5,_0x56a1e5,_0x38fcab){var _0x5d339e={};var _0x567529={};var _0x477f58;var _0xbb0700;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2b38b5[_0x5e35('0x47')]['id']}})['then'](handleEntityNotFound(_0x56a1e5,null))[_0x5e35('0x22')](function(_0x1e0446){if(_0x1e0446){_0x477f58=_0x1e0446;_0x567529[_0x5e35('0x2e')]=_[_0x5e35('0x30')](db[_0x5e35('0x49')][_0x5e35('0x2a')]);_0x567529['query']=_[_0x5e35('0x30')](_0x2b38b5['query']);_0x567529[_0x5e35('0x31')]=_['intersection'](_0x567529['model'],_0x567529[_0x5e35('0x2f')]);_0x5d339e[_0x5e35('0x34')]=_[_0x5e35('0x32')](_0x567529[_0x5e35('0x2e')],qs[_0x5e35('0x33')](_0x2b38b5['query'][_0x5e35('0x33')]));_0x5d339e[_0x5e35('0x34')]=_0x5d339e[_0x5e35('0x34')][_0x5e35('0x35')]?_0x5d339e['attributes']:_0x567529[_0x5e35('0x2e')];_0x5d339e[_0x5e35('0x4a')]=qs[_0x5e35('0x38')](_0x2b38b5[_0x5e35('0x2f')][_0x5e35('0x38')]);_0x5d339e['where']=qs[_0x5e35('0x31')](_['pick'](_0x2b38b5[_0x5e35('0x2f')],_0x567529['filters']));if(_0x2b38b5['query'][_0x5e35('0x3a')]){_0x5d339e[_0x5e35('0x39')]=_[_0x5e35('0x3b')](_0x5d339e[_0x5e35('0x39')],{'$or':_[_0x5e35('0x29')](_0x5d339e['attributes'],function(_0x16d010){var _0x59e1a3={};_0x59e1a3[_0x16d010]={'$like':'%'+_0x2b38b5['query']['filter']+'%'};return _0x59e1a3;})});}_0x5d339e=_[_0x5e35('0x3b')]({},_0x5d339e,_0x2b38b5['options']);return _0x477f58[_0x5e35('0x4d')](_0x5d339e);}})[_0x5e35('0x22')](function(_0x59e723){if(_0x59e723){_0xbb0700=_0x59e723[_0x5e35('0x35')];if(!_0x2b38b5[_0x5e35('0x2f')]['hasOwnProperty']('nolimit')){_0x5d339e[_0x5e35('0x1b')]=qs[_0x5e35('0x1b')](_0x2b38b5[_0x5e35('0x2f')][_0x5e35('0x1b')]);_0x5d339e[_0x5e35('0x1d')]=qs[_0x5e35('0x1d')](_0x2b38b5[_0x5e35('0x2f')]['offset']);}return _0x477f58[_0x5e35('0x4d')](_0x5d339e);}})[_0x5e35('0x22')](function(_0x5b3c80){if(_0x5b3c80){return _0x5b3c80?{'count':_0xbb0700,'rows':_0x5b3c80}:null;}})['then'](respondWithResult(_0x56a1e5,null))[_0x5e35('0x42')](handleError(_0x56a1e5,null));};exports[_0x5e35('0x4e')]=function(_0xf6e9f5,_0x555e72,_0x2cee17){var _0xbed905={};var _0x1c4c59={};var _0x34b54d;var _0x280129;return db[_0x5e35('0x3f')][_0x5e35('0x48')]({'where':{'id':_0xf6e9f5[_0x5e35('0x47')]['id']}})[_0x5e35('0x22')](handleEntityNotFound(_0x555e72,null))[_0x5e35('0x22')](function(_0xc49cb1){if(_0xc49cb1){_0x34b54d=_0xc49cb1;_0x1c4c59[_0x5e35('0x2e')]=_['keys'](db[_0x5e35('0x49')][_0x5e35('0x2a')]);_0x1c4c59[_0x5e35('0x2f')]=_[_0x5e35('0x30')](_0xf6e9f5['query']);_0x1c4c59[_0x5e35('0x31')]=_[_0x5e35('0x32')](_0x1c4c59[_0x5e35('0x2e')],_0x1c4c59['query']);_0xbed905[_0x5e35('0x34')]=_['intersection'](_0x1c4c59['model'],qs[_0x5e35('0x33')](_0xf6e9f5[_0x5e35('0x2f')]['fields']));_0xbed905[_0x5e35('0x34')]=_0xbed905[_0x5e35('0x34')]['length']?_0xbed905[_0x5e35('0x34')]:_0x1c4c59[_0x5e35('0x2e')];_0xbed905[_0x5e35('0x4a')]=qs['sort'](_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x38')]);_0xbed905[_0x5e35('0x39')]=qs['filters'](_[_0x5e35('0x4b')](_0xf6e9f5['query'],_0x1c4c59['filters']));if(_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x3a')]){_0xbed905[_0x5e35('0x39')]=_[_0x5e35('0x3b')](_0xbed905[_0x5e35('0x39')],{'$or':_[_0x5e35('0x29')](_0xbed905['attributes'],function(_0x29222c){var _0x2b4470={};_0x2b4470[_0x29222c]={'$like':'%'+_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x3a')]+'%'};return _0x2b4470;})});}_0xbed905=_[_0x5e35('0x3b')]({},_0xbed905,_0xf6e9f5['options']);return _0x34b54d[_0x5e35('0x4e')](_0xbed905);}})[_0x5e35('0x22')](function(_0x5325c9){if(_0x5325c9){_0x280129=_0x5325c9[_0x5e35('0x35')];if(!_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x36')](_0x5e35('0x37'))){_0xbed905[_0x5e35('0x1b')]=qs[_0x5e35('0x1b')](_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x1b')]);_0xbed905[_0x5e35('0x1d')]=qs[_0x5e35('0x1d')](_0xf6e9f5[_0x5e35('0x2f')][_0x5e35('0x1d')]);}return _0x34b54d[_0x5e35('0x4e')](_0xbed905);}})[_0x5e35('0x22')](function(_0x3df4ca){if(_0x3df4ca){return _0x3df4ca?{'count':_0x280129,'rows':_0x3df4ca}:null;}})[_0x5e35('0x22')](respondWithResult(_0x555e72,null))[_0x5e35('0x42')](handleError(_0x555e72,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index dd1daf4..8ef65d1 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 _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xe14d,0x1ee));var _0xde14=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xe14d[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x5914a3,_0x22e240){var _0x25af13=function(_0x33c161){while(--_0x33c161){_0x5914a3['push'](_0x5914a3['shift']());}};_0x25af13(++_0x22e240);}(_0x3e74,0x175));var _0x43e7=function(_0x2eb883,_0x5b5b7b){_0x2eb883=_0x2eb883-0x0;var _0x2ec3d5=_0x3e74[_0x2eb883];return _0x2ec3d5;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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 b5c9b55..5a504fc 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 _0x2c97=['http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x46d5e5,_0xa0d1bd){var _0x2e70f5=function(_0x1c1baa){while(--_0x1c1baa){_0x46d5e5['push'](_0x46d5e5['shift']());}};_0x2e70f5(++_0xa0d1bd);}(_0x2c97,0x15d));var _0x72c9=function(_0x4b736c,_0x18d185){_0x4b736c=_0x4b736c-0x0;var _0x236b90=_0x2c97[_0x4b736c];return _0x236b90;};'use strict';var _=require(_0x72c9('0x0'));var util=require(_0x72c9('0x1'));var moment=require(_0x72c9('0x2'));var BPromise=require(_0x72c9('0x3'));var rs=require(_0x72c9('0x4'));var fs=require('fs');var Redis=require(_0x72c9('0x5'));var db=require(_0x72c9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72c9('0x7'));var config=require(_0x72c9('0x8'));var jayson=require(_0x72c9('0x9'));var client=jayson[_0x72c9('0xa')][_0x72c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdee8e3,_0x5bf0dc,_0x50c7b8){return new BPromise(function(_0x5db7a1,_0x3dcf9d){return client[_0x72c9('0xc')](_0xdee8e3,_0x50c7b8)[_0x72c9('0xd')](function(_0xc44e65){logger[_0x72c9('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5bf0dc,_0x72c9('0xf'));logger[_0x72c9('0x10')](_0x72c9('0x11'),_0x5bf0dc,_0x72c9('0xf'),JSON[_0x72c9('0x12')](_0xc44e65));if(_0xc44e65[_0x72c9('0x13')]){if(_0xc44e65[_0x72c9('0x13')][_0x72c9('0x14')]===0x1f4){logger[_0x72c9('0x13')](_0x72c9('0x15'),_0x5bf0dc,_0xc44e65[_0x72c9('0x13')][_0x72c9('0x16')]);return _0x3dcf9d(_0xc44e65['error'][_0x72c9('0x16')]);}logger[_0x72c9('0x13')](_0x72c9('0x15'),_0x5bf0dc,_0xc44e65[_0x72c9('0x13')][_0x72c9('0x16')]);return _0x5db7a1(_0xc44e65[_0x72c9('0x13')][_0x72c9('0x16')]);}else{logger[_0x72c9('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5bf0dc,_0x72c9('0xf'));_0x5db7a1(_0xc44e65['result'][_0x72c9('0x16')]);}})[_0x72c9('0x17')](function(_0x1b15c8){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5bf0dc,_0x1b15c8);_0x3dcf9d(_0x1b15c8);});});} \ No newline at end of file +var _0xbf5d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb'];(function(_0x4dacfb,_0x3628f6){var _0x316580=function(_0x49004c){while(--_0x49004c){_0x4dacfb['push'](_0x4dacfb['shift']());}};_0x316580(++_0x3628f6);}(_0xbf5d,0x8f));var _0xdbf5=function(_0x4f91d9,_0x3fba2f){_0x4f91d9=_0x4f91d9-0x0;var _0x4e3492=_0xbf5d[_0x4f91d9];return _0x4e3492;};'use strict';var _=require('lodash');var util=require(_0xdbf5('0x0'));var moment=require('moment');var BPromise=require(_0xdbf5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbf5('0x2'));var db=require(_0xdbf5('0x3'))['db'];var utils=require(_0xdbf5('0x4'));var logger=require(_0xdbf5('0x5'))(_0xdbf5('0x6'));var config=require(_0xdbf5('0x7'));var jayson=require(_0xdbf5('0x8'));var client=jayson['client'][_0xdbf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59453e,_0x5b3155,_0x20f942){return new BPromise(function(_0x6d1daa,_0x2af952){return client[_0xdbf5('0xa')](_0x59453e,_0x20f942)[_0xdbf5('0xb')](function(_0x2271a8){logger[_0xdbf5('0xc')](_0xdbf5('0xd'),_0x5b3155,'request\x20sent');logger[_0xdbf5('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5b3155,'request\x20sent',JSON[_0xdbf5('0xf')](_0x2271a8));if(_0x2271a8[_0xdbf5('0x10')]){if(_0x2271a8[_0xdbf5('0x10')][_0xdbf5('0x11')]===0x1f4){logger['error'](_0xdbf5('0xd'),_0x5b3155,_0x2271a8[_0xdbf5('0x10')][_0xdbf5('0x12')]);return _0x2af952(_0x2271a8[_0xdbf5('0x10')][_0xdbf5('0x12')]);}logger[_0xdbf5('0x10')](_0xdbf5('0xd'),_0x5b3155,_0x2271a8[_0xdbf5('0x10')][_0xdbf5('0x12')]);return _0x6d1daa(_0x2271a8[_0xdbf5('0x10')][_0xdbf5('0x12')]);}else{logger['info'](_0xdbf5('0xd'),_0x5b3155,'request\x20sent');_0x6d1daa(_0x2271a8[_0xdbf5('0x13')]['message']);}})[_0xdbf5('0x14')](function(_0xc56416){logger['error'](_0xdbf5('0xd'),_0x5b3155,_0xc56416);_0x2af952(_0xc56416);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 75c3f3e..5c98955 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 _0xf756=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3d34a2,_0x17cb47){var _0x1a85ed=function(_0x5e0c99){while(--_0x5e0c99){_0x3d34a2['push'](_0x3d34a2['shift']());}};_0x1a85ed(++_0x17cb47);}(_0xf756,0x86));var _0x6f75=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf756[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0x6f75('0x0'));var util=require(_0x6f75('0x1'));var path=require(_0x6f75('0x2'));var timeout=require(_0x6f75('0x3'));var express=require(_0x6f75('0x4'));var router=express[_0x6f75('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6f75('0x6'));var interaction=require(_0x6f75('0x7'));var config=require(_0x6f75('0x8'));var controller=require(_0x6f75('0x9'));router[_0x6f75('0xa')]('/',auth[_0x6f75('0xb')](),controller[_0x6f75('0xc')]);router[_0x6f75('0xa')](_0x6f75('0xd'),auth[_0x6f75('0xb')](),controller[_0x6f75('0xe')]);router['post']('/',auth[_0x6f75('0xb')](),controller[_0x6f75('0xf')]);router[_0x6f75('0x10')](_0x6f75('0xd'),auth[_0x6f75('0xb')](),controller[_0x6f75('0x11')]);router[_0x6f75('0x12')](_0x6f75('0xd'),auth[_0x6f75('0xb')](),controller[_0x6f75('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfb47=['delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','./intDynamics365Field.controller','index','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x1b576d,_0x2ce437){var _0xa33e9b=function(_0x47b2da){while(--_0x47b2da){_0x1b576d['push'](_0x1b576d['shift']());}};_0xa33e9b(++_0x2ce437);}(_0xfb47,0x19a));var _0x7fb4=function(_0x492336,_0x2af56a){_0x492336=_0x492336-0x0;var _0xcb5fd7=_0xfb47[_0x492336];return _0xcb5fd7;};'use strict';var multer=require(_0x7fb4('0x0'));var util=require(_0x7fb4('0x1'));var path=require(_0x7fb4('0x2'));var timeout=require('connect-timeout');var express=require(_0x7fb4('0x3'));var router=express['Router']();var fs_extra=require(_0x7fb4('0x4'));var auth=require(_0x7fb4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7fb4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7fb4('0x7')]);router[_0x7fb4('0x8')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xb')]);router[_0x7fb4('0xc')]('/',auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xd')]);router['put']('/:id',auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xe')]);router[_0x7fb4('0xf')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller['destroy']);module[_0x7fb4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a837c7a..a8a1db0 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 _0x9dc2=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1b69a4,_0x3e9f5f){var _0x4ab6a6=function(_0x33697){while(--_0x33697){_0x1b69a4['push'](_0x1b69a4['shift']());}};_0x4ab6a6(++_0x3e9f5f);}(_0x9dc2,0x151));var _0x29dc=function(_0x3ab2d1,_0x13b436){_0x3ab2d1=_0x3ab2d1-0x0;var _0x5d9495=_0x9dc2[_0x3ab2d1];return _0x5d9495;};'use strict';var Sequelize=require(_0x29dc('0x0'));module['exports']={'type':{'type':Sequelize[_0x29dc('0x1')](_0x29dc('0x2'),_0x29dc('0x3'),_0x29dc('0x4'),_0x29dc('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x29dc('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x29dc('0x3'),_0x29dc('0x4'))},'keyContent':{'type':Sequelize[_0x29dc('0x6')]},'idField':{'type':Sequelize[_0x29dc('0x6')]},'nameField':{'type':Sequelize[_0x29dc('0x6')]},'customField':{'type':Sequelize[_0x29dc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x662d=['sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN'];(function(_0x243a2a,_0x35a7a6){var _0x38cdec=function(_0x4e85c3){while(--_0x4e85c3){_0x243a2a['push'](_0x243a2a['shift']());}};_0x38cdec(++_0x35a7a6);}(_0x662d,0xfc));var _0xd662=function(_0x2afcf7,_0x189ad8){_0x2afcf7=_0x2afcf7-0x0;var _0x5e9ffc=_0x662d[_0x2afcf7];return _0x5e9ffc;};'use strict';var Sequelize=require(_0xd662('0x0'));module[_0xd662('0x1')]={'type':{'type':Sequelize[_0xd662('0x2')](_0xd662('0x3'),_0xd662('0x4'),'customVariable',_0xd662('0x5'),'picklist'),'defaultValue':_0xd662('0x3')},'content':{'type':Sequelize[_0xd662('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd662('0x2')](_0xd662('0x3'),_0xd662('0x4'),_0xd662('0x7'))},'keyContent':{'type':Sequelize[_0xd662('0x6')]},'idField':{'type':Sequelize[_0xd662('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd662('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd662('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 4c3f896..37c07cd 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 _0xdce5=['key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','fields','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type'];(function(_0x53e933,_0x4ad705){var _0x12eed2=function(_0x3f1f8a){while(--_0x3f1f8a){_0x53e933['push'](_0x53e933['shift']());}};_0x12eed2(++_0x4ad705);}(_0xdce5,0xad));var _0x5dce=function(_0x37655d,_0x1a301e){_0x37655d=_0x37655d-0x0;var _0x20dd92=_0xdce5[_0x37655d];return _0x20dd92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dce('0x0'));var zipdir=require(_0x5dce('0x1'));var jsonpatch=require(_0x5dce('0x2'));var rp=require('request-promise');var moment=require(_0x5dce('0x3'));var BPromise=require(_0x5dce('0x4'));var Mustache=require(_0x5dce('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5dce('0x6'));var csv=require(_0x5dce('0x7'));var ejs=require(_0x5dce('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5dce('0x9'));var squel=require('squel');var crypto=require(_0x5dce('0xa'));var jsforce=require(_0x5dce('0xb'));var deskjs=require(_0x5dce('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5dce('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5dce('0xe'));var hardwareService=require(_0x5dce('0xf'));var logger=require(_0x5dce('0x10'))(_0x5dce('0x11'));var utils=require(_0x5dce('0x12'));var config=require(_0x5dce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5dce('0x14'))['db'];function respondWithStatusCode(_0x319caf,_0x262c06){_0x262c06=_0x262c06||0xcc;return function(_0x26b5a3){if(_0x26b5a3){return _0x319caf[_0x5dce('0x15')](_0x262c06);}return _0x319caf['status'](_0x262c06)[_0x5dce('0x16')]();};}function respondWithResult(_0x517bb0,_0x43d333){_0x43d333=_0x43d333||0xc8;return function(_0x3ec85c){if(_0x3ec85c){return _0x517bb0[_0x5dce('0x17')](_0x43d333)[_0x5dce('0x18')](_0x3ec85c);}};}function respondWithFilteredResult(_0x4985c1,_0x3d9210){return function(_0x3c3729){if(_0x3c3729){var _0x2d5298=typeof _0x3d9210[_0x5dce('0x19')]===_0x5dce('0x1a')&&typeof _0x3d9210[_0x5dce('0x1b')]==='undefined';var _0x31a6a8=_0x3c3729['count'];var _0x5c390d=_0x2d5298?0x0:_0x3d9210['offset'];var _0x53e20f=_0x2d5298?_0x3c3729['count']:_0x3d9210[_0x5dce('0x19')]+_0x3d9210[_0x5dce('0x1b')];var _0x2b6049;if(_0x53e20f>=_0x31a6a8){_0x53e20f=_0x31a6a8;_0x2b6049=0xc8;}else{_0x2b6049=0xce;}_0x4985c1['status'](_0x2b6049);return _0x4985c1[_0x5dce('0x1c')]('Content-Range',_0x5c390d+'-'+_0x53e20f+'/'+_0x31a6a8)[_0x5dce('0x18')](_0x3c3729);}return null;};}function patchUpdates(_0x100a99){return function(_0xa60961){try{jsonpatch[_0x5dce('0x1d')](_0xa60961,_0x100a99,!![]);}catch(_0x529f8c){return BPromise[_0x5dce('0x1e')](_0x529f8c);}return _0xa60961[_0x5dce('0x1f')]();};}function saveUpdates(_0x44d5a9,_0x5a7bc2){return function(_0x26dc2a){if(_0x26dc2a){return _0x26dc2a[_0x5dce('0x20')](_0x44d5a9)['then'](function(_0x31ac90){return _0x31ac90;});}return null;};}function removeEntity(_0x2cd4bc,_0x3ad1e2){return function(_0x581f2b){if(_0x581f2b){return _0x581f2b['destroy']()[_0x5dce('0x21')](function(){_0x2cd4bc['status'](0xcc)[_0x5dce('0x16')]();});}};}function handleEntityNotFound(_0x5e1ac4,_0x1b74fb){return function(_0xa1c8db){if(!_0xa1c8db){_0x5e1ac4['sendStatus'](0x194);}return _0xa1c8db;};}function handleError(_0x2c4d93,_0x574b01){_0x574b01=_0x574b01||0x1f4;return function(_0x8712bf){logger[_0x5dce('0x22')](_0x8712bf[_0x5dce('0x23')]);if(_0x8712bf[_0x5dce('0x24')]){delete _0x8712bf[_0x5dce('0x24')];}_0x2c4d93['status'](_0x574b01)[_0x5dce('0x25')](_0x8712bf);};}exports[_0x5dce('0x26')]=function(_0x47f1e1,_0x45bbdb){var _0xe939bc={},_0x47c3da={},_0x46d08f={'count':0x0,'rows':[]};var _0x47955c=_[_0x5dce('0x27')](db[_0x5dce('0x28')][_0x5dce('0x29')],function(_0x15ef28){return{'name':_0x15ef28['fieldName'],'type':_0x15ef28[_0x5dce('0x2a')][_0x5dce('0x2b')]};});_0x47c3da[_0x5dce('0x2c')]=_[_0x5dce('0x27')](_0x47955c,'name');_0x47c3da['query']=_[_0x5dce('0x2d')](_0x47f1e1[_0x5dce('0x2e')]);_0x47c3da['filters']=_[_0x5dce('0x2f')](_0x47c3da[_0x5dce('0x2c')],_0x47c3da['query']);_0xe939bc[_0x5dce('0x30')]=_[_0x5dce('0x2f')](_0x47c3da[_0x5dce('0x2c')],qs['fields'](_0x47f1e1[_0x5dce('0x2e')]['fields']));_0xe939bc[_0x5dce('0x30')]=_0xe939bc[_0x5dce('0x30')][_0x5dce('0x31')]?_0xe939bc[_0x5dce('0x30')]:_0x47c3da[_0x5dce('0x2c')];if(!_0x47f1e1[_0x5dce('0x2e')][_0x5dce('0x32')](_0x5dce('0x33'))){_0xe939bc[_0x5dce('0x1b')]=qs[_0x5dce('0x1b')](_0x47f1e1[_0x5dce('0x2e')]['limit']);_0xe939bc['offset']=qs['offset'](_0x47f1e1[_0x5dce('0x2e')][_0x5dce('0x19')]);}_0xe939bc['order']=qs[_0x5dce('0x34')](_0x47f1e1['query'][_0x5dce('0x34')]);_0xe939bc[_0x5dce('0x35')]=qs[_0x5dce('0x36')](_[_0x5dce('0x37')](_0x47f1e1[_0x5dce('0x2e')],_0x47c3da[_0x5dce('0x36')]),_0x47955c);if(_0x47f1e1['query'][_0x5dce('0x38')]){_0xe939bc[_0x5dce('0x35')]=_[_0x5dce('0x39')](_0xe939bc[_0x5dce('0x35')],{'$or':_[_0x5dce('0x27')](_0x47955c,function(_0x33b030){if(_0x33b030['type']!==_0x5dce('0x3a')){var _0x2b93a8={};_0x2b93a8[_0x33b030[_0x5dce('0x24')]]={'$like':'%'+_0x47f1e1['query'][_0x5dce('0x38')]+'%'};return _0x2b93a8;}})});}_0xe939bc=_[_0x5dce('0x39')]({},_0xe939bc,_0x47f1e1[_0x5dce('0x3b')]);var _0x7a6a82={'where':_0xe939bc[_0x5dce('0x35')]};return db[_0x5dce('0x28')][_0x5dce('0x3c')](_0x7a6a82)['then'](function(_0x2721d1){_0x46d08f[_0x5dce('0x3c')]=_0x2721d1;if(_0x47f1e1['query']['includeAll']){_0xe939bc[_0x5dce('0x3d')]=[{'all':!![]}];}return db[_0x5dce('0x28')][_0x5dce('0x3e')](_0xe939bc);})[_0x5dce('0x21')](function(_0x53389a){_0x46d08f[_0x5dce('0x3f')]=_0x53389a;return _0x46d08f;})[_0x5dce('0x21')](respondWithFilteredResult(_0x45bbdb,_0xe939bc))['catch'](handleError(_0x45bbdb,null));};exports[_0x5dce('0x40')]=function(_0x2b297d,_0x13b1ca){var _0x67d6e2={'raw':!![],'where':{'id':_0x2b297d[_0x5dce('0x41')]['id']}},_0x48d84b={};_0x48d84b[_0x5dce('0x2c')]=_[_0x5dce('0x2d')](db['Dynamics365Field'][_0x5dce('0x29')]);_0x48d84b[_0x5dce('0x2e')]=_[_0x5dce('0x2d')](_0x2b297d[_0x5dce('0x2e')]);_0x48d84b[_0x5dce('0x36')]=_['intersection'](_0x48d84b[_0x5dce('0x2c')],_0x48d84b[_0x5dce('0x2e')]);_0x67d6e2[_0x5dce('0x30')]=_[_0x5dce('0x2f')](_0x48d84b['model'],qs['fields'](_0x2b297d[_0x5dce('0x2e')][_0x5dce('0x42')]));_0x67d6e2[_0x5dce('0x30')]=_0x67d6e2[_0x5dce('0x30')][_0x5dce('0x31')]?_0x67d6e2[_0x5dce('0x30')]:_0x48d84b[_0x5dce('0x2c')];if(_0x2b297d[_0x5dce('0x2e')]['includeAll']){_0x67d6e2[_0x5dce('0x3d')]=[{'all':!![]}];}_0x67d6e2=_[_0x5dce('0x39')]({},_0x67d6e2,_0x2b297d['options']);return db[_0x5dce('0x28')][_0x5dce('0x43')](_0x67d6e2)[_0x5dce('0x21')](handleEntityNotFound(_0x13b1ca,null))[_0x5dce('0x21')](respondWithResult(_0x13b1ca,null))[_0x5dce('0x44')](handleError(_0x13b1ca,null));};exports[_0x5dce('0x45')]=function(_0x597c70,_0x3e567f){return db[_0x5dce('0x28')]['create'](_0x597c70['body'],{})[_0x5dce('0x21')](respondWithResult(_0x3e567f,0xc9))[_0x5dce('0x44')](handleError(_0x3e567f,null));};exports[_0x5dce('0x20')]=function(_0x1d1e18,_0x39b4d7){if(_0x1d1e18['body']['id']){delete _0x1d1e18[_0x5dce('0x46')]['id'];}return db[_0x5dce('0x28')][_0x5dce('0x43')]({'where':{'id':_0x1d1e18['params']['id']}})[_0x5dce('0x21')](handleEntityNotFound(_0x39b4d7,null))['then'](saveUpdates(_0x1d1e18['body'],null))['then'](respondWithResult(_0x39b4d7,null))[_0x5dce('0x44')](handleError(_0x39b4d7,null));};exports[_0x5dce('0x47')]=function(_0x55ee3a,_0x220f2a){return db[_0x5dce('0x28')][_0x5dce('0x43')]({'where':{'id':_0x55ee3a[_0x5dce('0x41')]['id']}})[_0x5dce('0x21')](handleEntityNotFound(_0x220f2a,null))[_0x5dce('0x21')](removeEntity(_0x220f2a,null))[_0x5dce('0x44')](handleError(_0x220f2a,null));}; \ No newline at end of file +var _0xf07d=['limit','undefined','count','offset','set','json','apply','reject','save','then','destroy','error','name','send','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xf07d,0x149));var _0xdf07=function(_0x1494f8,_0xa35f49){_0x1494f8=_0x1494f8-0x0;var _0x435dee=_0xf07d[_0x1494f8];return _0x435dee;};'use strict';var emlformat=require(_0xdf07('0x0'));var rimraf=require(_0xdf07('0x1'));var zipdir=require(_0xdf07('0x2'));var jsonpatch=require(_0xdf07('0x3'));var rp=require(_0xdf07('0x4'));var moment=require('moment');var BPromise=require(_0xdf07('0x5'));var Mustache=require('mustache');var util=require(_0xdf07('0x6'));var path=require(_0xdf07('0x7'));var sox=require('sox');var csv=require(_0xdf07('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf07('0x9'));var _=require(_0xdf07('0xa'));var squel=require(_0xdf07('0xb'));var crypto=require(_0xdf07('0xc'));var jsforce=require(_0xdf07('0xd'));var deskjs=require(_0xdf07('0xe'));var toCsv=require(_0xdf07('0x8'));var querystring=require('querystring');var Papa=require(_0xdf07('0xf'));var Redis=require(_0xdf07('0x10'));var authService=require(_0xdf07('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf07('0x12'));var logger=require('../../config/logger')(_0xdf07('0x13'));var utils=require('../../config/utils');var config=require(_0xdf07('0x14'));var licenseUtil=require(_0xdf07('0x15'));var db=require(_0xdf07('0x16'))['db'];function respondWithStatusCode(_0x3f70d1,_0x186b27){_0x186b27=_0x186b27||0xcc;return function(_0x4b3756){if(_0x4b3756){return _0x3f70d1[_0xdf07('0x17')](_0x186b27);}return _0x3f70d1[_0xdf07('0x18')](_0x186b27)[_0xdf07('0x19')]();};}function respondWithResult(_0x542cab,_0x324d25){_0x324d25=_0x324d25||0xc8;return function(_0x1b8798){if(_0x1b8798){return _0x542cab['status'](_0x324d25)['json'](_0x1b8798);}};}function respondWithFilteredResult(_0x563246,_0x2fb624){return function(_0x50438f){if(_0x50438f){var _0x5a982c=typeof _0x2fb624['offset']==='undefined'&&typeof _0x2fb624[_0xdf07('0x1a')]===_0xdf07('0x1b');var _0x557586=_0x50438f[_0xdf07('0x1c')];var _0x4509e7=_0x5a982c?0x0:_0x2fb624[_0xdf07('0x1d')];var _0x3ac9a3=_0x5a982c?_0x50438f[_0xdf07('0x1c')]:_0x2fb624[_0xdf07('0x1d')]+_0x2fb624[_0xdf07('0x1a')];var _0x3f32e2;if(_0x3ac9a3>=_0x557586){_0x3ac9a3=_0x557586;_0x3f32e2=0xc8;}else{_0x3f32e2=0xce;}_0x563246[_0xdf07('0x18')](_0x3f32e2);return _0x563246[_0xdf07('0x1e')]('Content-Range',_0x4509e7+'-'+_0x3ac9a3+'/'+_0x557586)[_0xdf07('0x1f')](_0x50438f);}return null;};}function patchUpdates(_0x5fba36){return function(_0x3db18b){try{jsonpatch[_0xdf07('0x20')](_0x3db18b,_0x5fba36,!![]);}catch(_0x1cd580){return BPromise[_0xdf07('0x21')](_0x1cd580);}return _0x3db18b[_0xdf07('0x22')]();};}function saveUpdates(_0x4aff49,_0x57277f){return function(_0xa4b949){if(_0xa4b949){return _0xa4b949['update'](_0x4aff49)[_0xdf07('0x23')](function(_0x1d8aeb){return _0x1d8aeb;});}return null;};}function removeEntity(_0x52cfc9,_0x5bb324){return function(_0x94356f){if(_0x94356f){return _0x94356f[_0xdf07('0x24')]()[_0xdf07('0x23')](function(){_0x52cfc9['status'](0xcc)[_0xdf07('0x19')]();});}};}function handleEntityNotFound(_0x1b930d,_0x2d4b84){return function(_0x150efd){if(!_0x150efd){_0x1b930d[_0xdf07('0x17')](0x194);}return _0x150efd;};}function handleError(_0x45dda3,_0x48f8c6){_0x48f8c6=_0x48f8c6||0x1f4;return function(_0x3e9fa2){logger[_0xdf07('0x25')](_0x3e9fa2['stack']);if(_0x3e9fa2[_0xdf07('0x26')]){delete _0x3e9fa2['name'];}_0x45dda3['status'](_0x48f8c6)[_0xdf07('0x27')](_0x3e9fa2);};}exports['index']=function(_0x153a6e,_0x34990a){var _0xea2a47={},_0x1fa37a={},_0x7e89b8={'count':0x0,'rows':[]};var _0x5bf3d7=_[_0xdf07('0x28')](db['Dynamics365Field'][_0xdf07('0x29')],function(_0x30baa4){return{'name':_0x30baa4['fieldName'],'type':_0x30baa4[_0xdf07('0x2a')]['key']};});_0x1fa37a[_0xdf07('0x2b')]=_[_0xdf07('0x28')](_0x5bf3d7,_0xdf07('0x26'));_0x1fa37a[_0xdf07('0x2c')]=_['keys'](_0x153a6e['query']);_0x1fa37a[_0xdf07('0x2d')]=_[_0xdf07('0x2e')](_0x1fa37a[_0xdf07('0x2b')],_0x1fa37a[_0xdf07('0x2c')]);_0xea2a47[_0xdf07('0x2f')]=_[_0xdf07('0x2e')](_0x1fa37a[_0xdf07('0x2b')],qs[_0xdf07('0x30')](_0x153a6e[_0xdf07('0x2c')]['fields']));_0xea2a47['attributes']=_0xea2a47[_0xdf07('0x2f')][_0xdf07('0x31')]?_0xea2a47[_0xdf07('0x2f')]:_0x1fa37a[_0xdf07('0x2b')];if(!_0x153a6e[_0xdf07('0x2c')]['hasOwnProperty'](_0xdf07('0x32'))){_0xea2a47[_0xdf07('0x1a')]=qs['limit'](_0x153a6e['query'][_0xdf07('0x1a')]);_0xea2a47[_0xdf07('0x1d')]=qs[_0xdf07('0x1d')](_0x153a6e[_0xdf07('0x2c')]['offset']);}_0xea2a47[_0xdf07('0x33')]=qs[_0xdf07('0x34')](_0x153a6e['query']['sort']);_0xea2a47[_0xdf07('0x35')]=qs['filters'](_[_0xdf07('0x36')](_0x153a6e[_0xdf07('0x2c')],_0x1fa37a[_0xdf07('0x2d')]),_0x5bf3d7);if(_0x153a6e[_0xdf07('0x2c')][_0xdf07('0x37')]){_0xea2a47[_0xdf07('0x35')]=_[_0xdf07('0x38')](_0xea2a47[_0xdf07('0x35')],{'$or':_['map'](_0x5bf3d7,function(_0x54dba8){if(_0x54dba8[_0xdf07('0x2a')]!==_0xdf07('0x39')){var _0x10f42c={};_0x10f42c[_0x54dba8[_0xdf07('0x26')]]={'$like':'%'+_0x153a6e[_0xdf07('0x2c')]['filter']+'%'};return _0x10f42c;}})});}_0xea2a47=_[_0xdf07('0x38')]({},_0xea2a47,_0x153a6e[_0xdf07('0x3a')]);var _0x1c88d8={'where':_0xea2a47[_0xdf07('0x35')]};return db[_0xdf07('0x3b')]['count'](_0x1c88d8)[_0xdf07('0x23')](function(_0x5080be){_0x7e89b8[_0xdf07('0x1c')]=_0x5080be;if(_0x153a6e[_0xdf07('0x2c')][_0xdf07('0x3c')]){_0xea2a47[_0xdf07('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xdf07('0x3e')](_0xea2a47);})[_0xdf07('0x23')](function(_0x285835){_0x7e89b8['rows']=_0x285835;return _0x7e89b8;})[_0xdf07('0x23')](respondWithFilteredResult(_0x34990a,_0xea2a47))[_0xdf07('0x3f')](handleError(_0x34990a,null));};exports[_0xdf07('0x40')]=function(_0x2eab61,_0x2fb912){var _0xe4dcfa={'raw':!![],'where':{'id':_0x2eab61[_0xdf07('0x41')]['id']}},_0x57b15e={};_0x57b15e['model']=_[_0xdf07('0x42')](db[_0xdf07('0x3b')][_0xdf07('0x29')]);_0x57b15e[_0xdf07('0x2c')]=_[_0xdf07('0x42')](_0x2eab61[_0xdf07('0x2c')]);_0x57b15e[_0xdf07('0x2d')]=_['intersection'](_0x57b15e['model'],_0x57b15e[_0xdf07('0x2c')]);_0xe4dcfa[_0xdf07('0x2f')]=_[_0xdf07('0x2e')](_0x57b15e[_0xdf07('0x2b')],qs[_0xdf07('0x30')](_0x2eab61['query'][_0xdf07('0x30')]));_0xe4dcfa[_0xdf07('0x2f')]=_0xe4dcfa['attributes']['length']?_0xe4dcfa[_0xdf07('0x2f')]:_0x57b15e['model'];if(_0x2eab61[_0xdf07('0x2c')][_0xdf07('0x3c')]){_0xe4dcfa[_0xdf07('0x3d')]=[{'all':!![]}];}_0xe4dcfa=_[_0xdf07('0x38')]({},_0xe4dcfa,_0x2eab61[_0xdf07('0x3a')]);return db[_0xdf07('0x3b')][_0xdf07('0x43')](_0xe4dcfa)['then'](handleEntityNotFound(_0x2fb912,null))[_0xdf07('0x23')](respondWithResult(_0x2fb912,null))['catch'](handleError(_0x2fb912,null));};exports[_0xdf07('0x44')]=function(_0x526427,_0xd5a433){return db['Dynamics365Field'][_0xdf07('0x44')](_0x526427[_0xdf07('0x45')],{})['then'](respondWithResult(_0xd5a433,0xc9))[_0xdf07('0x3f')](handleError(_0xd5a433,null));};exports[_0xdf07('0x46')]=function(_0x271fbe,_0x5ddb9d){if(_0x271fbe[_0xdf07('0x45')]['id']){delete _0x271fbe[_0xdf07('0x45')]['id'];}return db[_0xdf07('0x3b')]['find']({'where':{'id':_0x271fbe[_0xdf07('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ddb9d,null))[_0xdf07('0x23')](saveUpdates(_0x271fbe[_0xdf07('0x45')],null))[_0xdf07('0x23')](respondWithResult(_0x5ddb9d,null))['catch'](handleError(_0x5ddb9d,null));};exports[_0xdf07('0x24')]=function(_0xe25d59,_0x37a485){return db['Dynamics365Field'][_0xdf07('0x43')]({'where':{'id':_0xe25d59[_0xdf07('0x41')]['id']}})[_0xdf07('0x23')](handleEntityNotFound(_0x37a485,null))[_0xdf07('0x23')](removeEntity(_0x37a485,null))[_0xdf07('0x3f')](handleError(_0x37a485,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 37e57fc..d471a05 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 _0x9d55=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','../../config/logger','api','moment'];(function(_0x47e455,_0x52c590){var _0x5af166=function(_0xbc2694){while(--_0xbc2694){_0x47e455['push'](_0x47e455['shift']());}};_0x5af166(++_0x52c590);}(_0x9d55,0x184));var _0x59d5=function(_0x41e631,_0x2e7b36){_0x41e631=_0x41e631-0x0;var _0x1fb92a=_0x9d55[_0x41e631];return _0x1fb92a;};'use strict';var _=require(_0x59d5('0x0'));var util=require('util');var logger=require(_0x59d5('0x1'))(_0x59d5('0x2'));var moment=require(_0x59d5('0x3'));var BPromise=require(_0x59d5('0x4'));var rp=require(_0x59d5('0x5'));var fs=require('fs');var path=require(_0x59d5('0x6'));var rimraf=require(_0x59d5('0x7'));var config=require(_0x59d5('0x8'));var attributes=require(_0x59d5('0x9'));module['exports']=function(_0x2538fc,_0x5abee4){return _0x2538fc['define'](_0x59d5('0xa'),attributes,{'tableName':_0x59d5('0xb'),'paranoid':![],'indexes':[{'name':_0x59d5('0xc'),'fields':[_0x59d5('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2abc=['api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x19a86f,_0x99163c){var _0x5eb911=function(_0x588076){while(--_0x588076){_0x19a86f['push'](_0x19a86f['shift']());}};_0x5eb911(++_0x99163c);}(_0x2abc,0x1a1));var _0xc2ab=function(_0x4d2a0e,_0x394ac4){_0x4d2a0e=_0x4d2a0e-0x0;var _0x363cb6=_0x2abc[_0x4d2a0e];return _0x363cb6;};'use strict';var _=require(_0xc2ab('0x0'));var util=require(_0xc2ab('0x1'));var logger=require(_0xc2ab('0x2'))(_0xc2ab('0x3'));var moment=require(_0xc2ab('0x4'));var BPromise=require(_0xc2ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2ab('0x6'));var rimraf=require(_0xc2ab('0x7'));var config=require(_0xc2ab('0x8'));var attributes=require(_0xc2ab('0x9'));module['exports']=function(_0x551f87,_0x4feaf2){return _0x551f87[_0xc2ab('0xa')](_0xc2ab('0xb'),attributes,{'tableName':_0xc2ab('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xc2ab('0xd'),_0xc2ab('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 c677619..fedc43a 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 _0x7303=['request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x7303,0xac));var _0x3730=function(_0x4afb4e,_0x3ae0d3){_0x4afb4e=_0x4afb4e-0x0;var _0x2885c1=_0x7303[_0x4afb4e];return _0x2885c1;};'use strict';var _=require(_0x3730('0x0'));var util=require(_0x3730('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3730('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3730('0x3'))['db'];var utils=require(_0x3730('0x4'));var logger=require(_0x3730('0x5'))('rpc');var config=require(_0x3730('0x6'));var jayson=require(_0x3730('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b602b,_0x25b9e8,_0x1489b2){return new BPromise(function(_0x8f396a,_0x1d11b9){return client[_0x3730('0x8')](_0x4b602b,_0x1489b2)[_0x3730('0x9')](function(_0x433a17){logger[_0x3730('0xa')](_0x3730('0xb'),_0x25b9e8,_0x3730('0xc'));logger[_0x3730('0xd')](_0x3730('0xe'),_0x25b9e8,_0x3730('0xc'),JSON['stringify'](_0x433a17));if(_0x433a17[_0x3730('0xf')]){if(_0x433a17[_0x3730('0xf')][_0x3730('0x10')]===0x1f4){logger[_0x3730('0xf')](_0x3730('0xb'),_0x25b9e8,_0x433a17[_0x3730('0xf')]['message']);return _0x1d11b9(_0x433a17[_0x3730('0xf')]['message']);}logger[_0x3730('0xf')](_0x3730('0xb'),_0x25b9e8,_0x433a17[_0x3730('0xf')][_0x3730('0x11')]);return _0x8f396a(_0x433a17[_0x3730('0xf')]['message']);}else{logger[_0x3730('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x25b9e8,'request\x20sent');_0x8f396a(_0x433a17[_0x3730('0x12')]['message']);}})[_0x3730('0x13')](function(_0x390020){logger[_0x3730('0xf')](_0x3730('0xb'),_0x25b9e8,_0x390020);_0x1d11b9(_0x390020);});});} \ No newline at end of file +var _0xab8e=['then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1e8c4e,_0x4b6ba5){var _0x19088a=function(_0x33116a){while(--_0x33116a){_0x1e8c4e['push'](_0x1e8c4e['shift']());}};_0x19088a(++_0x4b6ba5);}(_0xab8e,0xcb));var _0xeab8=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xab8e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xeab8('0x0'));var util=require(_0xeab8('0x1'));var moment=require('moment');var BPromise=require(_0xeab8('0x2'));var rs=require(_0xeab8('0x3'));var fs=require('fs');var Redis=require(_0xeab8('0x4'));var db=require(_0xeab8('0x5'))['db'];var utils=require(_0xeab8('0x6'));var logger=require(_0xeab8('0x7'))(_0xeab8('0x8'));var config=require('../../config/environment');var jayson=require(_0xeab8('0x9'));var client=jayson[_0xeab8('0xa')][_0xeab8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1771ff,_0x442ada,_0x126c9a){return new BPromise(function(_0x109356,_0x20b249){return client[_0xeab8('0xc')](_0x1771ff,_0x126c9a)[_0xeab8('0xd')](function(_0x2aad2f){logger[_0xeab8('0xe')](_0xeab8('0xf'),_0x442ada,_0xeab8('0x10'));logger[_0xeab8('0x11')](_0xeab8('0x12'),_0x442ada,_0xeab8('0x10'),JSON[_0xeab8('0x13')](_0x2aad2f));if(_0x2aad2f[_0xeab8('0x14')]){if(_0x2aad2f[_0xeab8('0x14')][_0xeab8('0x15')]===0x1f4){logger['error'](_0xeab8('0xf'),_0x442ada,_0x2aad2f[_0xeab8('0x14')][_0xeab8('0x16')]);return _0x20b249(_0x2aad2f[_0xeab8('0x14')][_0xeab8('0x16')]);}logger[_0xeab8('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x442ada,_0x2aad2f[_0xeab8('0x14')]['message']);return _0x109356(_0x2aad2f[_0xeab8('0x14')][_0xeab8('0x16')]);}else{logger[_0xeab8('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x442ada,_0xeab8('0x10'));_0x109356(_0x2aad2f[_0xeab8('0x17')][_0xeab8('0x16')]);}})['catch'](function(_0x3a662a){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x442ada,_0x3a662a);_0x20b249(_0x3a662a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 23e145d..00f8fea 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 _0xc295=['isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshdeskAccount.controller','get'];(function(_0x57ff85,_0x55d999){var _0x2a3034=function(_0x103207){while(--_0x103207){_0x57ff85['push'](_0x57ff85['shift']());}};_0x2a3034(++_0x55d999);}(_0xc295,0x1b2));var _0x5c29=function(_0x37fe9b,_0x535567){_0x37fe9b=_0x37fe9b-0x0;var _0x47456e=_0xc295[_0x37fe9b];return _0x47456e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c29('0x0'));var timeout=require(_0x5c29('0x1'));var express=require(_0x5c29('0x2'));var router=express[_0x5c29('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5c29('0x4'));var config=require('../../config/environment');var controller=require(_0x5c29('0x5'));router[_0x5c29('0x6')]('/',auth[_0x5c29('0x7')](),controller[_0x5c29('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5c29('0x9')]);router['get'](_0x5c29('0xa'),auth[_0x5c29('0x7')](),controller['getConfigurations']);router[_0x5c29('0x6')](_0x5c29('0xb'),auth[_0x5c29('0x7')](),controller[_0x5c29('0xc')]);router[_0x5c29('0xd')]('/',auth[_0x5c29('0x7')](),controller[_0x5c29('0xe')]);router['post'](_0x5c29('0xa'),auth[_0x5c29('0x7')](),controller[_0x5c29('0xf')]);router[_0x5c29('0x10')](_0x5c29('0x11'),auth[_0x5c29('0x7')](),controller[_0x5c29('0x12')]);router[_0x5c29('0x13')](_0x5c29('0x11'),auth[_0x5c29('0x7')](),controller[_0x5c29('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7168=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id'];(function(_0x206455,_0x326169){var _0x346f8b=function(_0x57075d){while(--_0x57075d){_0x206455['push'](_0x206455['shift']());}};_0x346f8b(++_0x326169);}(_0x7168,0x194));var _0x8716=function(_0x203682,_0x1e8073){_0x203682=_0x203682-0x0;var _0x22a7fc=_0x7168[_0x203682];return _0x22a7fc;};'use strict';var multer=require('multer');var util=require(_0x8716('0x0'));var path=require('path');var timeout=require(_0x8716('0x1'));var express=require(_0x8716('0x2'));var router=express['Router']();var fs_extra=require(_0x8716('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8716('0x4'));var controller=require(_0x8716('0x5'));router['get']('/',auth[_0x8716('0x6')](),controller[_0x8716('0x7')]);router[_0x8716('0x8')](_0x8716('0x9'),auth[_0x8716('0x6')](),controller[_0x8716('0xa')]);router[_0x8716('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8716('0xb')]);router[_0x8716('0x8')](_0x8716('0xc'),auth[_0x8716('0x6')](),controller[_0x8716('0xd')]);router[_0x8716('0xe')]('/',auth[_0x8716('0x6')](),controller[_0x8716('0xf')]);router[_0x8716('0xe')](_0x8716('0x10'),auth['isAuthenticated'](),controller[_0x8716('0x11')]);router[_0x8716('0x12')](_0x8716('0x9'),auth['isAuthenticated'](),controller[_0x8716('0x13')]);router[_0x8716('0x14')]('/:id',auth[_0x8716('0x6')](),controller[_0x8716('0x15')]);module[_0x8716('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 c0320ac..47931a7 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x330ea6,_0x2dcfd1){var _0x5d1210=function(_0x1dcd53){while(--_0x1dcd53){_0x330ea6['push'](_0x330ea6['shift']());}};_0x5d1210(++_0x2dcfd1);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x249ea3,_0x1fdb5d){_0x249ea3=_0x249ea3-0x0;var _0x413b55=_0x4e2e[_0x249ea3];return _0x413b55;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0xda9247,_0x59ca79){var _0x2dc126=function(_0xf974a1){while(--_0xf974a1){_0xda9247['push'](_0xda9247['shift']());}};_0x2dc126(++_0x59ca79);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 62a7faa..3f22cc3 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 _0x1572=['company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','reject','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','count','includeAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','Subjects','channel','getDescriptions','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','agent','description','group','source'];(function(_0x400322,_0x4353a8){var _0xfdd597=function(_0xd914b6){while(--_0xd914b6){_0x400322['push'](_0x400322['shift']());}};_0xfdd597(++_0x4353a8);}(_0x1572,0xf5));var _0x2157=function(_0x16aed8,_0x47d3bd){_0x16aed8=_0x16aed8-0x0;var _0x57a9e1=_0x1572[_0x16aed8];return _0x57a9e1;};'use strict';var emlformat=require(_0x2157('0x0'));var rimraf=require(_0x2157('0x1'));var zipdir=require(_0x2157('0x2'));var jsonpatch=require(_0x2157('0x3'));var rp=require(_0x2157('0x4'));var moment=require(_0x2157('0x5'));var BPromise=require(_0x2157('0x6'));var Mustache=require(_0x2157('0x7'));var util=require(_0x2157('0x8'));var path=require(_0x2157('0x9'));var sox=require(_0x2157('0xa'));var csv=require(_0x2157('0xb'));var ejs=require(_0x2157('0xc'));var fs=require('fs');var fs_extra=require(_0x2157('0xd'));var _=require(_0x2157('0xe'));var squel=require(_0x2157('0xf'));var crypto=require(_0x2157('0x10'));var jsforce=require(_0x2157('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x2157('0xb'));var querystring=require('querystring');var Papa=require(_0x2157('0x12'));var Redis=require(_0x2157('0x13'));var authService=require(_0x2157('0x14'));var qs=require(_0x2157('0x15'));var as=require(_0x2157('0x16'));var hardwareService=require(_0x2157('0x17'));var logger=require(_0x2157('0x18'))(_0x2157('0x19'));var utils=require('../../config/utils');var config=require(_0x2157('0x1a'));var licenseUtil=require(_0x2157('0x1b'));var db=require(_0x2157('0x1c'))['db'];var integrations=require(_0x2157('0x1d'));function respondWithStatusCode(_0x5d64d3,_0x32683b){_0x32683b=_0x32683b||0xcc;return function(_0x418d29){if(_0x418d29){return _0x5d64d3[_0x2157('0x1e')](_0x32683b);}return _0x5d64d3[_0x2157('0x1f')](_0x32683b)[_0x2157('0x20')]();};}function respondWithResult(_0xd85b14,_0x1ed7c2){_0x1ed7c2=_0x1ed7c2||0xc8;return function(_0x5e977c){if(_0x5e977c){return _0xd85b14['status'](_0x1ed7c2)['json'](_0x5e977c);}};}function respondWithFilteredResult(_0x22e273,_0x2ce8e1){return function(_0x371461){if(_0x371461){var _0x20de83=typeof _0x2ce8e1[_0x2157('0x21')]===_0x2157('0x22')&&typeof _0x2ce8e1[_0x2157('0x23')]===_0x2157('0x22');var _0x42e67e=_0x371461['count'];var _0x25a147=_0x20de83?0x0:_0x2ce8e1[_0x2157('0x21')];var _0x23aba1=_0x20de83?_0x371461['count']:_0x2ce8e1[_0x2157('0x21')]+_0x2ce8e1[_0x2157('0x23')];var _0x19a67a;if(_0x23aba1>=_0x42e67e){_0x23aba1=_0x42e67e;_0x19a67a=0xc8;}else{_0x19a67a=0xce;}_0x22e273[_0x2157('0x1f')](_0x19a67a);return _0x22e273[_0x2157('0x24')]('Content-Range',_0x25a147+'-'+_0x23aba1+'/'+_0x42e67e)['json'](_0x371461);}return null;};}function patchUpdates(_0x5910f8){return function(_0x963ccc){try{jsonpatch['apply'](_0x963ccc,_0x5910f8,!![]);}catch(_0x44c485){return BPromise[_0x2157('0x25')](_0x44c485);}return _0x963ccc['save']();};}function saveUpdates(_0x5b4435,_0x306bcd){return function(_0x45f14b){if(_0x45f14b){return _0x45f14b[_0x2157('0x26')](_0x5b4435)[_0x2157('0x27')](function(_0x5244a9){return _0x5244a9;});}return null;};}function removeEntity(_0xe0bfe2,_0x4601ce){return function(_0x495598){if(_0x495598){return _0x495598['destroy']()[_0x2157('0x27')](function(){_0xe0bfe2[_0x2157('0x1f')](0xcc)[_0x2157('0x20')]();});}};}function handleEntityNotFound(_0xbd5885,_0x2f621d){return function(_0x192a97){if(!_0x192a97){_0xbd5885['sendStatus'](0x194);}return _0x192a97;};}function handleError(_0x1258de,_0x3c0e01){_0x3c0e01=_0x3c0e01||0x1f4;return function(_0x381dc7){logger[_0x2157('0x28')](_0x381dc7[_0x2157('0x29')]);if(_0x381dc7[_0x2157('0x2a')]){delete _0x381dc7['name'];}_0x1258de[_0x2157('0x1f')](_0x3c0e01)[_0x2157('0x2b')](_0x381dc7);};}exports[_0x2157('0x2c')]=function(_0x3c92dd,_0x580d3e){var _0x25b1d8={},_0x2f0557={},_0x362ad2={'count':0x0,'rows':[]};var _0x3785d3=_[_0x2157('0x2d')](db[_0x2157('0x2e')][_0x2157('0x2f')],function(_0x30a8fd){return{'name':_0x30a8fd[_0x2157('0x30')],'type':_0x30a8fd[_0x2157('0x31')][_0x2157('0x32')]};});_0x2f0557[_0x2157('0x33')]=_[_0x2157('0x2d')](_0x3785d3,_0x2157('0x2a'));_0x2f0557[_0x2157('0x34')]=_[_0x2157('0x35')](_0x3c92dd['query']);_0x2f0557[_0x2157('0x36')]=_[_0x2157('0x37')](_0x2f0557[_0x2157('0x33')],_0x2f0557[_0x2157('0x34')]);_0x25b1d8[_0x2157('0x38')]=_[_0x2157('0x37')](_0x2f0557[_0x2157('0x33')],qs[_0x2157('0x39')](_0x3c92dd[_0x2157('0x34')]['fields']));_0x25b1d8['attributes']=_0x25b1d8[_0x2157('0x38')][_0x2157('0x3a')]?_0x25b1d8['attributes']:_0x2f0557[_0x2157('0x33')];if(!_0x3c92dd[_0x2157('0x34')][_0x2157('0x3b')]('nolimit')){_0x25b1d8[_0x2157('0x23')]=qs[_0x2157('0x23')](_0x3c92dd[_0x2157('0x34')]['limit']);_0x25b1d8[_0x2157('0x21')]=qs['offset'](_0x3c92dd[_0x2157('0x34')][_0x2157('0x21')]);}_0x25b1d8[_0x2157('0x3c')]=qs['sort'](_0x3c92dd[_0x2157('0x34')][_0x2157('0x3d')]);_0x25b1d8['where']=qs['filters'](_[_0x2157('0x3e')](_0x3c92dd[_0x2157('0x34')],_0x2f0557['filters']),_0x3785d3);if(_0x3c92dd[_0x2157('0x34')][_0x2157('0x3f')]){_0x25b1d8['where']=_[_0x2157('0x40')](_0x25b1d8['where'],{'$or':_['map'](_0x3785d3,function(_0x1d3452){if(_0x1d3452[_0x2157('0x31')]!=='VIRTUAL'){var _0x558031={};_0x558031[_0x1d3452[_0x2157('0x2a')]]={'$like':'%'+_0x3c92dd[_0x2157('0x34')][_0x2157('0x3f')]+'%'};return _0x558031;}})});}_0x25b1d8=_[_0x2157('0x40')]({},_0x25b1d8,_0x3c92dd[_0x2157('0x41')]);var _0xad41a7={'where':_0x25b1d8[_0x2157('0x42')]};return db['FreshdeskAccount'][_0x2157('0x43')](_0xad41a7)[_0x2157('0x27')](function(_0x25fb55){_0x362ad2[_0x2157('0x43')]=_0x25fb55;if(_0x3c92dd[_0x2157('0x34')][_0x2157('0x44')]){_0x25b1d8['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x25b1d8);})[_0x2157('0x27')](function(_0x51c1c9){_0x362ad2[_0x2157('0x45')]=_0x51c1c9;return _0x362ad2;})[_0x2157('0x27')](respondWithFilteredResult(_0x580d3e,_0x25b1d8))[_0x2157('0x46')](handleError(_0x580d3e,null));};exports[_0x2157('0x47')]=function(_0x5e08e6,_0x42a7ce){var _0x282a68={'raw':![],'where':{'id':_0x5e08e6[_0x2157('0x48')]['id']}},_0xe01828={};_0xe01828[_0x2157('0x33')]=_[_0x2157('0x35')](db[_0x2157('0x2e')]['rawAttributes']);_0xe01828[_0x2157('0x34')]=_[_0x2157('0x35')](_0x5e08e6['query']);_0xe01828[_0x2157('0x36')]=_[_0x2157('0x37')](_0xe01828[_0x2157('0x33')],_0xe01828['query']);_0x282a68[_0x2157('0x38')]=_[_0x2157('0x37')](_0xe01828[_0x2157('0x33')],qs[_0x2157('0x39')](_0x5e08e6[_0x2157('0x34')]['fields']));_0x282a68[_0x2157('0x38')]=_0x282a68['attributes'][_0x2157('0x3a')]?_0x282a68[_0x2157('0x38')]:_0xe01828[_0x2157('0x33')];if(_0x5e08e6[_0x2157('0x34')][_0x2157('0x44')]){_0x282a68[_0x2157('0x49')]=[{'all':!![]}];}_0x282a68=_['merge']({},_0x282a68,_0x5e08e6[_0x2157('0x41')]);return db[_0x2157('0x2e')][_0x2157('0x4a')](_0x282a68)[_0x2157('0x27')](handleEntityNotFound(_0x42a7ce,null))['then'](respondWithResult(_0x42a7ce,null))[_0x2157('0x46')](handleError(_0x42a7ce,null));};exports[_0x2157('0x4b')]=function(_0x57b33a,_0x2f2792){return db[_0x2157('0x2e')][_0x2157('0x4b')](_0x57b33a['body'],{})[_0x2157('0x27')](respondWithResult(_0x2f2792,0xc9))['catch'](handleError(_0x2f2792,null));};exports[_0x2157('0x26')]=function(_0x3075d6,_0x4bc7f2){if(_0x3075d6[_0x2157('0x4c')]['id']){delete _0x3075d6[_0x2157('0x4c')]['id'];}return db[_0x2157('0x2e')][_0x2157('0x4a')]({'where':{'id':_0x3075d6[_0x2157('0x48')]['id']}})[_0x2157('0x27')](handleEntityNotFound(_0x4bc7f2,null))[_0x2157('0x27')](saveUpdates(_0x3075d6[_0x2157('0x4c')],null))[_0x2157('0x27')](respondWithResult(_0x4bc7f2,null))['catch'](handleError(_0x4bc7f2,null));};exports[_0x2157('0x4d')]=function(_0x243d12,_0x99124a){return db[_0x2157('0x2e')][_0x2157('0x4a')]({'where':{'id':_0x243d12['params']['id']}})[_0x2157('0x27')](handleEntityNotFound(_0x99124a,null))['then'](removeEntity(_0x99124a,null))['catch'](handleError(_0x99124a,null));};exports[_0x2157('0x4e')]=function(_0x5a750f,_0x3397c4,_0x2476af){var _0x29e363={};var _0x58bd00={};var _0x2b2964;var _0x2aba0a;return db[_0x2157('0x2e')][_0x2157('0x4f')]({'where':{'id':_0x5a750f['params']['id']}})[_0x2157('0x27')](handleEntityNotFound(_0x3397c4,null))[_0x2157('0x27')](function(_0x4c9d6f){if(_0x4c9d6f){_0x2b2964=_0x4c9d6f;_0x58bd00[_0x2157('0x33')]=_[_0x2157('0x35')](db[_0x2157('0x50')][_0x2157('0x2f')]);_0x58bd00[_0x2157('0x34')]=_[_0x2157('0x35')](_0x5a750f[_0x2157('0x34')]);_0x58bd00[_0x2157('0x36')]=_['intersection'](_0x58bd00[_0x2157('0x33')],_0x58bd00[_0x2157('0x34')]);_0x29e363[_0x2157('0x38')]=_[_0x2157('0x37')](_0x58bd00[_0x2157('0x33')],qs['fields'](_0x5a750f[_0x2157('0x34')][_0x2157('0x39')]));_0x29e363[_0x2157('0x38')]=_0x29e363[_0x2157('0x38')][_0x2157('0x3a')]?_0x29e363['attributes']:_0x58bd00[_0x2157('0x33')];_0x29e363['order']=qs[_0x2157('0x3d')](_0x5a750f[_0x2157('0x34')][_0x2157('0x3d')]);_0x29e363[_0x2157('0x42')]=qs[_0x2157('0x36')](_['pick'](_0x5a750f['query'],_0x58bd00[_0x2157('0x36')]));if(_0x5a750f['query'][_0x2157('0x3f')]){_0x29e363[_0x2157('0x42')]=_[_0x2157('0x40')](_0x29e363[_0x2157('0x42')],{'$or':_[_0x2157('0x2d')](_0x29e363[_0x2157('0x38')],function(_0x1d64dd){var _0x120f78={};_0x120f78[_0x1d64dd]={'$like':'%'+_0x5a750f[_0x2157('0x34')]['filter']+'%'};return _0x120f78;})});}_0x29e363=_[_0x2157('0x40')]({},_0x29e363,_0x5a750f[_0x2157('0x41')]);return _0x2b2964[_0x2157('0x4e')](_0x29e363);}})['then'](function(_0x169ed7){if(_0x169ed7){_0x2aba0a=_0x169ed7['length'];if(!_0x5a750f[_0x2157('0x34')][_0x2157('0x3b')](_0x2157('0x51'))){_0x29e363['limit']=qs[_0x2157('0x23')](_0x5a750f[_0x2157('0x34')][_0x2157('0x23')]);_0x29e363[_0x2157('0x21')]=qs[_0x2157('0x21')](_0x5a750f[_0x2157('0x34')][_0x2157('0x21')]);}return _0x2b2964[_0x2157('0x4e')](_0x29e363);}})['then'](function(_0x1593bc){if(_0x1593bc){return _0x1593bc?{'count':_0x2aba0a,'rows':_0x1593bc}:null;}})[_0x2157('0x27')](respondWithResult(_0x3397c4,null))['catch'](handleError(_0x3397c4,null));};exports['addConfiguration']=function(_0x47a88d,_0x148abe,_0x2b7cd0){if(_0x47a88d['body']['id']){delete _0x47a88d[_0x2157('0x4c')]['id'];}return db[_0x2157('0x2e')][_0x2157('0x4f')]({'where':{'id':_0x47a88d[_0x2157('0x48')]['id']}})['then'](handleEntityNotFound(_0x148abe,null))[_0x2157('0x27')](function(_0x581ee4){if(_0x581ee4){_0x47a88d[_0x2157('0x4c')]['AccountId']=_0x581ee4['id'];_0x47a88d[_0x2157('0x4c')][_0x2157('0x52')]=integrations['getSubjects'](_0x47a88d[_0x2157('0x4c')][_0x2157('0x53')],_0x47a88d[_0x2157('0x4c')][_0x2157('0x31')]);_0x47a88d[_0x2157('0x4c')]['Descriptions']=integrations[_0x2157('0x54')](_0x47a88d[_0x2157('0x4c')][_0x2157('0x53')],_0x47a88d[_0x2157('0x4c')][_0x2157('0x31')]);return db[_0x2157('0x50')][_0x2157('0x4b')](_0x47a88d[_0x2157('0x4c')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x2157('0x55')}]});}return null;})[_0x2157('0x27')](respondWithResult(_0x148abe,null))[_0x2157('0x46')](handleError(_0x148abe,null));};exports[_0x2157('0x56')]=function(_0x504ea4,_0x4f5b97,_0x5313a9){var _0x3f58fc='';return db['FreshdeskAccount'][_0x2157('0x4f')]({'where':{'id':_0x504ea4[_0x2157('0x48')]['id']},'attributes':['id',_0x2157('0x57'),_0x2157('0x58')]})[_0x2157('0x27')](handleEntityNotFound(_0x4f5b97,null))['then'](function(_0x5ce04b){if(_0x5ce04b){_0x3f58fc=_0x5ce04b[_0x2157('0x57')];var _0x3797c9=_0x3f58fc[_0x2157('0x59')](-0x1);if(_0x3797c9==='/'){_0x3f58fc=_0x3f58fc['substring'](0x0,_0x3f58fc[_0x2157('0x5a')](_0x3797c9));}return rp({'method':_0x2157('0x5b'),'uri':util[_0x2157('0x5c')](_0x2157('0x5d'),_0x3f58fc,_0x2157('0x5e')),'headers':{'Authorization':util[_0x2157('0x5c')](_0x2157('0x5f'),new Buffer(util[_0x2157('0x5c')](_0x2157('0x60'),_0x5ce04b[_0x2157('0x58')]))['toString'](_0x2157('0x61')))},'json':!![]});}})[_0x2157('0x27')](function(_0x4f05f6){if(_0x4f05f6){var _0x1d0dc7=[_0x2157('0x62'),'subject',_0x2157('0x63'),_0x2157('0x64'),_0x2157('0x1f'),'priority',_0x2157('0x65'),_0x2157('0x66'),'ticket_type',_0x2157('0x65'),_0x2157('0x67')];_[_0x2157('0x68')](_0x4f05f6,function(_0x29754b){return _0x1d0dc7[_0x2157('0x69')](_0x29754b[_0x2157('0x2a')])||!_0x29754b[_0x2157('0x6a')]&&_0x29754b[_0x2157('0x31')]!==_0x2157('0x6b')&&_0x29754b['type']!==_0x2157('0x6c');});return{'count':_0x4f05f6[_0x2157('0x3a')],'rows':_[_0x2157('0x2d')](_0x4f05f6,function(_0x56eb59){return{'id':_0x56eb59[_0x2157('0x2a')],'name':_0x56eb59[_0x2157('0x6d')],'custom':!_0x56eb59['default'],'options':_0x56eb59[_0x2157('0x6e')]?_[_0x2157('0x2d')](_0x56eb59[_0x2157('0x6e')],function(_0x334683){return{'name':_[_0x2157('0x6f')](_0x334683),'value':_0x334683};}):[]};})};}})['then'](respondWithResult(_0x4f5b97,null))[_0x2157('0x46')](function(_0xdffe92){var _0x354f18=_0x504ea4[_0x2157('0x34')][_0x2157('0x70')]?0x1f4:_0xdffe92[_0x2157('0x71')]||0x1f4;logger[_0x2157('0x28')](_0x2157('0x72'),_0x2157('0x56'),_0x354f18,JSON[_0x2157('0x73')](_0xdffe92));delete _0xdffe92[_0x2157('0x2a')];if(_0x354f18===0x191){_0x354f18=0x190;}_0x4f5b97['status'](_0x354f18)[_0x2157('0x2b')](_0x504ea4[_0x2157('0x34')][_0x2157('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0xdffe92[_0x2157('0x71')]}:_0xdffe92);});}; \ No newline at end of file +var _0x4627=['findOne','FreshdeskConfiguration','fields','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','custom_dropdown','label','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','then','show','params','includeAll','include','catch','create','body','getConfigurations'];(function(_0x19edb7,_0x5cfb59){var _0x4cc6f8=function(_0x2fcef6){while(--_0x2fcef6){_0x19edb7['push'](_0x19edb7['shift']());}};_0x4cc6f8(++_0x5cfb59);}(_0x4627,0x115));var _0x7462=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x4627[_0x56fe98];return _0x212f4f;};'use strict';var emlformat=require(_0x7462('0x0'));var rimraf=require(_0x7462('0x1'));var zipdir=require(_0x7462('0x2'));var jsonpatch=require(_0x7462('0x3'));var rp=require(_0x7462('0x4'));var moment=require(_0x7462('0x5'));var BPromise=require(_0x7462('0x6'));var Mustache=require(_0x7462('0x7'));var util=require(_0x7462('0x8'));var path=require(_0x7462('0x9'));var sox=require(_0x7462('0xa'));var csv=require(_0x7462('0xb'));var ejs=require(_0x7462('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7462('0xd'));var squel=require(_0x7462('0xe'));var crypto=require(_0x7462('0xf'));var jsforce=require(_0x7462('0x10'));var deskjs=require(_0x7462('0x11'));var toCsv=require(_0x7462('0xb'));var querystring=require(_0x7462('0x12'));var Papa=require(_0x7462('0x13'));var Redis=require(_0x7462('0x14'));var authService=require(_0x7462('0x15'));var qs=require(_0x7462('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7462('0x17'))(_0x7462('0x18'));var utils=require(_0x7462('0x19'));var config=require(_0x7462('0x1a'));var licenseUtil=require(_0x7462('0x1b'));var db=require(_0x7462('0x1c'))['db'];var integrations=require(_0x7462('0x1d'));function respondWithStatusCode(_0x4e313a,_0x5cb363){_0x5cb363=_0x5cb363||0xcc;return function(_0x4e6e42){if(_0x4e6e42){return _0x4e313a[_0x7462('0x1e')](_0x5cb363);}return _0x4e313a['status'](_0x5cb363)[_0x7462('0x1f')]();};}function respondWithResult(_0x461bd2,_0x368f45){_0x368f45=_0x368f45||0xc8;return function(_0x1ac398){if(_0x1ac398){return _0x461bd2['status'](_0x368f45)[_0x7462('0x20')](_0x1ac398);}};}function respondWithFilteredResult(_0x4913ff,_0x36b008){return function(_0x42ed50){if(_0x42ed50){var _0x1ebbe8=typeof _0x36b008[_0x7462('0x21')]==='undefined'&&typeof _0x36b008[_0x7462('0x22')]==='undefined';var _0x2f0201=_0x42ed50[_0x7462('0x23')];var _0xca0bdf=_0x1ebbe8?0x0:_0x36b008[_0x7462('0x21')];var _0x49378e=_0x1ebbe8?_0x42ed50[_0x7462('0x23')]:_0x36b008['offset']+_0x36b008[_0x7462('0x22')];var _0x3e5596;if(_0x49378e>=_0x2f0201){_0x49378e=_0x2f0201;_0x3e5596=0xc8;}else{_0x3e5596=0xce;}_0x4913ff['status'](_0x3e5596);return _0x4913ff[_0x7462('0x24')](_0x7462('0x25'),_0xca0bdf+'-'+_0x49378e+'/'+_0x2f0201)['json'](_0x42ed50);}return null;};}function patchUpdates(_0x25a44a){return function(_0x33c605){try{jsonpatch[_0x7462('0x26')](_0x33c605,_0x25a44a,!![]);}catch(_0xac7eae){return BPromise[_0x7462('0x27')](_0xac7eae);}return _0x33c605[_0x7462('0x28')]();};}function saveUpdates(_0x32da06,_0x3c9616){return function(_0x556c0a){if(_0x556c0a){return _0x556c0a[_0x7462('0x29')](_0x32da06)['then'](function(_0x185934){return _0x185934;});}return null;};}function removeEntity(_0x11caf5,_0x290715){return function(_0x51b9fc){if(_0x51b9fc){return _0x51b9fc[_0x7462('0x2a')]()['then'](function(){_0x11caf5[_0x7462('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5759fa,_0x29992b){return function(_0x3a6cab){if(!_0x3a6cab){_0x5759fa['sendStatus'](0x194);}return _0x3a6cab;};}function handleError(_0x5575fc,_0x554d21){_0x554d21=_0x554d21||0x1f4;return function(_0x488d59){logger['error'](_0x488d59[_0x7462('0x2c')]);if(_0x488d59[_0x7462('0x2d')]){delete _0x488d59['name'];}_0x5575fc[_0x7462('0x2b')](_0x554d21)[_0x7462('0x2e')](_0x488d59);};}exports[_0x7462('0x2f')]=function(_0x10a673,_0x4948c9){var _0x1f279b={},_0x3523c={},_0x30cb61={'count':0x0,'rows':[]};var _0x288736=_[_0x7462('0x30')](db[_0x7462('0x31')][_0x7462('0x32')],function(_0x77cf43){return{'name':_0x77cf43[_0x7462('0x33')],'type':_0x77cf43[_0x7462('0x34')]['key']};});_0x3523c[_0x7462('0x35')]=_['map'](_0x288736,_0x7462('0x2d'));_0x3523c[_0x7462('0x36')]=_[_0x7462('0x37')](_0x10a673[_0x7462('0x36')]);_0x3523c['filters']=_[_0x7462('0x38')](_0x3523c[_0x7462('0x35')],_0x3523c[_0x7462('0x36')]);_0x1f279b[_0x7462('0x39')]=_[_0x7462('0x38')](_0x3523c[_0x7462('0x35')],qs['fields'](_0x10a673[_0x7462('0x36')]['fields']));_0x1f279b[_0x7462('0x39')]=_0x1f279b['attributes'][_0x7462('0x3a')]?_0x1f279b[_0x7462('0x39')]:_0x3523c['model'];if(!_0x10a673[_0x7462('0x36')][_0x7462('0x3b')](_0x7462('0x3c'))){_0x1f279b[_0x7462('0x22')]=qs[_0x7462('0x22')](_0x10a673[_0x7462('0x36')][_0x7462('0x22')]);_0x1f279b[_0x7462('0x21')]=qs[_0x7462('0x21')](_0x10a673[_0x7462('0x36')][_0x7462('0x21')]);}_0x1f279b[_0x7462('0x3d')]=qs[_0x7462('0x3e')](_0x10a673[_0x7462('0x36')]['sort']);_0x1f279b[_0x7462('0x3f')]=qs[_0x7462('0x40')](_[_0x7462('0x41')](_0x10a673[_0x7462('0x36')],_0x3523c['filters']),_0x288736);if(_0x10a673[_0x7462('0x36')][_0x7462('0x42')]){_0x1f279b[_0x7462('0x3f')]=_[_0x7462('0x43')](_0x1f279b[_0x7462('0x3f')],{'$or':_[_0x7462('0x30')](_0x288736,function(_0x5c46c8){if(_0x5c46c8[_0x7462('0x34')]!==_0x7462('0x44')){var _0x2f50c1={};_0x2f50c1[_0x5c46c8[_0x7462('0x2d')]]={'$like':'%'+_0x10a673['query'][_0x7462('0x42')]+'%'};return _0x2f50c1;}})});}_0x1f279b=_[_0x7462('0x43')]({},_0x1f279b,_0x10a673[_0x7462('0x45')]);var _0x4ecd45={'where':_0x1f279b[_0x7462('0x3f')]};return db[_0x7462('0x31')][_0x7462('0x23')](_0x4ecd45)['then'](function(_0x1b4059){_0x30cb61['count']=_0x1b4059;if(_0x10a673[_0x7462('0x36')]['includeAll']){_0x1f279b['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7462('0x46')](_0x1f279b);})[_0x7462('0x47')](function(_0x2317eb){_0x30cb61['rows']=_0x2317eb;return _0x30cb61;})['then'](respondWithFilteredResult(_0x4948c9,_0x1f279b))['catch'](handleError(_0x4948c9,null));};exports[_0x7462('0x48')]=function(_0x8aa7cd,_0x57e0ae){var _0x5e50c7={'raw':![],'where':{'id':_0x8aa7cd[_0x7462('0x49')]['id']}},_0x20c576={};_0x20c576[_0x7462('0x35')]=_[_0x7462('0x37')](db['FreshdeskAccount']['rawAttributes']);_0x20c576[_0x7462('0x36')]=_[_0x7462('0x37')](_0x8aa7cd[_0x7462('0x36')]);_0x20c576[_0x7462('0x40')]=_['intersection'](_0x20c576[_0x7462('0x35')],_0x20c576[_0x7462('0x36')]);_0x5e50c7[_0x7462('0x39')]=_['intersection'](_0x20c576[_0x7462('0x35')],qs['fields'](_0x8aa7cd[_0x7462('0x36')]['fields']));_0x5e50c7['attributes']=_0x5e50c7[_0x7462('0x39')][_0x7462('0x3a')]?_0x5e50c7[_0x7462('0x39')]:_0x20c576[_0x7462('0x35')];if(_0x8aa7cd[_0x7462('0x36')][_0x7462('0x4a')]){_0x5e50c7[_0x7462('0x4b')]=[{'all':!![]}];}_0x5e50c7=_[_0x7462('0x43')]({},_0x5e50c7,_0x8aa7cd[_0x7462('0x45')]);return db['FreshdeskAccount']['find'](_0x5e50c7)[_0x7462('0x47')](handleEntityNotFound(_0x57e0ae,null))['then'](respondWithResult(_0x57e0ae,null))[_0x7462('0x4c')](handleError(_0x57e0ae,null));};exports['create']=function(_0x331459,_0x2cec83){return db[_0x7462('0x31')][_0x7462('0x4d')](_0x331459[_0x7462('0x4e')],{})['then'](respondWithResult(_0x2cec83,0xc9))['catch'](handleError(_0x2cec83,null));};exports[_0x7462('0x29')]=function(_0x37fc97,_0x354e81){if(_0x37fc97[_0x7462('0x4e')]['id']){delete _0x37fc97[_0x7462('0x4e')]['id'];}return db[_0x7462('0x31')]['find']({'where':{'id':_0x37fc97[_0x7462('0x49')]['id']}})[_0x7462('0x47')](handleEntityNotFound(_0x354e81,null))[_0x7462('0x47')](saveUpdates(_0x37fc97[_0x7462('0x4e')],null))['then'](respondWithResult(_0x354e81,null))[_0x7462('0x4c')](handleError(_0x354e81,null));};exports[_0x7462('0x2a')]=function(_0x4429da,_0x4a631e){return db[_0x7462('0x31')]['find']({'where':{'id':_0x4429da[_0x7462('0x49')]['id']}})[_0x7462('0x47')](handleEntityNotFound(_0x4a631e,null))['then'](removeEntity(_0x4a631e,null))['catch'](handleError(_0x4a631e,null));};exports[_0x7462('0x4f')]=function(_0x3c82fa,_0x3da9ce,_0x3aa514){var _0x664d7a={};var _0x5cd5cc={};var _0x45447b;var _0x5862a9;return db[_0x7462('0x31')][_0x7462('0x50')]({'where':{'id':_0x3c82fa[_0x7462('0x49')]['id']}})[_0x7462('0x47')](handleEntityNotFound(_0x3da9ce,null))[_0x7462('0x47')](function(_0x76d533){if(_0x76d533){_0x45447b=_0x76d533;_0x5cd5cc[_0x7462('0x35')]=_[_0x7462('0x37')](db[_0x7462('0x51')][_0x7462('0x32')]);_0x5cd5cc['query']=_[_0x7462('0x37')](_0x3c82fa[_0x7462('0x36')]);_0x5cd5cc[_0x7462('0x40')]=_[_0x7462('0x38')](_0x5cd5cc['model'],_0x5cd5cc[_0x7462('0x36')]);_0x664d7a[_0x7462('0x39')]=_[_0x7462('0x38')](_0x5cd5cc[_0x7462('0x35')],qs['fields'](_0x3c82fa[_0x7462('0x36')][_0x7462('0x52')]));_0x664d7a[_0x7462('0x39')]=_0x664d7a[_0x7462('0x39')][_0x7462('0x3a')]?_0x664d7a[_0x7462('0x39')]:_0x5cd5cc[_0x7462('0x35')];_0x664d7a['order']=qs[_0x7462('0x3e')](_0x3c82fa[_0x7462('0x36')]['sort']);_0x664d7a[_0x7462('0x3f')]=qs[_0x7462('0x40')](_[_0x7462('0x41')](_0x3c82fa[_0x7462('0x36')],_0x5cd5cc['filters']));if(_0x3c82fa['query'][_0x7462('0x42')]){_0x664d7a[_0x7462('0x3f')]=_[_0x7462('0x43')](_0x664d7a['where'],{'$or':_[_0x7462('0x30')](_0x664d7a[_0x7462('0x39')],function(_0x2cca57){var _0x30e5e6={};_0x30e5e6[_0x2cca57]={'$like':'%'+_0x3c82fa['query'][_0x7462('0x42')]+'%'};return _0x30e5e6;})});}_0x664d7a=_[_0x7462('0x43')]({},_0x664d7a,_0x3c82fa[_0x7462('0x45')]);return _0x45447b['getConfigurations'](_0x664d7a);}})[_0x7462('0x47')](function(_0x27240d){if(_0x27240d){_0x5862a9=_0x27240d[_0x7462('0x3a')];if(!_0x3c82fa[_0x7462('0x36')]['hasOwnProperty'](_0x7462('0x3c'))){_0x664d7a['limit']=qs[_0x7462('0x22')](_0x3c82fa[_0x7462('0x36')]['limit']);_0x664d7a[_0x7462('0x21')]=qs['offset'](_0x3c82fa[_0x7462('0x36')][_0x7462('0x21')]);}return _0x45447b['getConfigurations'](_0x664d7a);}})[_0x7462('0x47')](function(_0x97d91a){if(_0x97d91a){return _0x97d91a?{'count':_0x5862a9,'rows':_0x97d91a}:null;}})[_0x7462('0x47')](respondWithResult(_0x3da9ce,null))[_0x7462('0x4c')](handleError(_0x3da9ce,null));};exports[_0x7462('0x53')]=function(_0x4b4215,_0x2828e9,_0x4c30f0){if(_0x4b4215[_0x7462('0x4e')]['id']){delete _0x4b4215[_0x7462('0x4e')]['id'];}return db[_0x7462('0x31')][_0x7462('0x50')]({'where':{'id':_0x4b4215[_0x7462('0x49')]['id']}})[_0x7462('0x47')](handleEntityNotFound(_0x2828e9,null))[_0x7462('0x47')](function(_0xcb38cd){if(_0xcb38cd){_0x4b4215['body'][_0x7462('0x54')]=_0xcb38cd['id'];_0x4b4215['body'][_0x7462('0x55')]=integrations['getSubjects'](_0x4b4215[_0x7462('0x4e')][_0x7462('0x56')],_0x4b4215[_0x7462('0x4e')][_0x7462('0x34')]);_0x4b4215[_0x7462('0x4e')][_0x7462('0x57')]=integrations[_0x7462('0x58')](_0x4b4215['body'][_0x7462('0x56')],_0x4b4215['body'][_0x7462('0x34')]);return db[_0x7462('0x51')][_0x7462('0x4d')](_0x4b4215[_0x7462('0x4e')],{'include':[{'model':db['FreshdeskField'],'as':_0x7462('0x55')},{'model':db['FreshdeskField'],'as':_0x7462('0x57')}]});}return null;})[_0x7462('0x47')](respondWithResult(_0x2828e9,null))['catch'](handleError(_0x2828e9,null));};exports[_0x7462('0x59')]=function(_0x5bd7fa,_0x47c3a8,_0x5ea90d){var _0x576371='';return db[_0x7462('0x31')]['findOne']({'where':{'id':_0x5bd7fa[_0x7462('0x49')]['id']},'attributes':['id',_0x7462('0x5a'),'apiKey']})['then'](handleEntityNotFound(_0x47c3a8,null))[_0x7462('0x47')](function(_0x76819e){if(_0x76819e){_0x576371=_0x76819e[_0x7462('0x5a')];var _0x4dcebf=_0x576371[_0x7462('0x5b')](-0x1);if(_0x4dcebf==='/'){_0x576371=_0x576371[_0x7462('0x5c')](0x0,_0x576371['lastIndexOf'](_0x4dcebf));}return rp({'method':_0x7462('0x5d'),'uri':util[_0x7462('0x5e')](_0x7462('0x5f'),_0x576371,_0x7462('0x60')),'headers':{'Authorization':util[_0x7462('0x5e')](_0x7462('0x61'),new Buffer(util[_0x7462('0x5e')](_0x7462('0x62'),_0x76819e[_0x7462('0x63')]))[_0x7462('0x64')](_0x7462('0x65')))},'json':!![]});}})[_0x7462('0x47')](function(_0x4671fe){if(_0x4671fe){var _0x2dc1d1=[_0x7462('0x66'),_0x7462('0x67'),_0x7462('0x68'),'description','status',_0x7462('0x69'),_0x7462('0x6a'),_0x7462('0x6b'),_0x7462('0x6c'),'group',_0x7462('0x6d')];_[_0x7462('0x6e')](_0x4671fe,function(_0x8b26d0){return _0x2dc1d1['includes'](_0x8b26d0[_0x7462('0x2d')])||!_0x8b26d0['default']&&_0x8b26d0[_0x7462('0x34')]!=='custom_text'&&_0x8b26d0[_0x7462('0x34')]!==_0x7462('0x6f');});return{'count':_0x4671fe[_0x7462('0x3a')],'rows':_[_0x7462('0x30')](_0x4671fe,function(_0x16581c){return{'id':_0x16581c[_0x7462('0x2d')],'name':_0x16581c[_0x7462('0x70')],'custom':!_0x16581c[_0x7462('0x71')],'options':_0x16581c[_0x7462('0x72')]?_['map'](_0x16581c[_0x7462('0x72')],function(_0x7d68e8){return{'name':_['capitalize'](_0x7d68e8),'value':_0x7d68e8};}):[]};})};}})[_0x7462('0x47')](respondWithResult(_0x47c3a8,null))[_0x7462('0x4c')](function(_0x3d2a1a){var _0x310b56=_0x5bd7fa[_0x7462('0x36')][_0x7462('0x73')]?0x1f4:_0x3d2a1a[_0x7462('0x74')]||0x1f4;logger['error'](_0x7462('0x75'),_0x7462('0x59'),_0x310b56,JSON['stringify'](_0x3d2a1a));delete _0x3d2a1a[_0x7462('0x2d')];if(_0x310b56===0x191){_0x310b56=0x190;}_0x47c3a8[_0x7462('0x2b')](_0x310b56)[_0x7462('0x2e')](_0x5bd7fa[_0x7462('0x36')][_0x7462('0x73')]?{'message':_0x7462('0x76'),'statusCode':_0x3d2a1a[_0x7462('0x74')]}:_0x3d2a1a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 76ce654..1819da1 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 _0x0547=['rimraf','../../config/environment','../../components/integrations/configuration','exports','lodash','../../config/logger','api','request-promise'];(function(_0x53cfaf,_0x4c7416){var _0x3389ab=function(_0x50980d){while(--_0x50980d){_0x53cfaf['push'](_0x53cfaf['shift']());}};_0x3389ab(++_0x4c7416);}(_0x0547,0x9c));var _0x7054=function(_0x849ce4,_0x4bfa86){_0x849ce4=_0x849ce4-0x0;var _0x16c392=_0x0547[_0x849ce4];return _0x16c392;};'use strict';var _=require(_0x7054('0x0'));var util=require('util');var logger=require(_0x7054('0x1'))(_0x7054('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7054('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7054('0x4'));var config=require(_0x7054('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x7054('0x6'));module[_0x7054('0x7')]=function(_0x1f09dd,_0x3175bd){return _0x1f09dd['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf64=['bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util','../../config/logger','api','moment'];(function(_0x5200c8,_0x42b5b5){var _0x3aca1d=function(_0x8e9554){while(--_0x8e9554){_0x5200c8['push'](_0x5200c8['shift']());}};_0x3aca1d(++_0x42b5b5);}(_0xcf64,0x1c3));var _0x4cf6=function(_0x27d9f1,_0x340511){_0x27d9f1=_0x27d9f1-0x0;var _0x5a17d1=_0xcf64[_0x27d9f1];return _0x5a17d1;};'use strict';var _=require('lodash');var util=require(_0x4cf6('0x0'));var logger=require(_0x4cf6('0x1'))(_0x4cf6('0x2'));var moment=require(_0x4cf6('0x3'));var BPromise=require(_0x4cf6('0x4'));var rp=require(_0x4cf6('0x5'));var fs=require('fs');var path=require(_0x4cf6('0x6'));var rimraf=require('rimraf');var config=require(_0x4cf6('0x7'));var attributes=require(_0x4cf6('0x8'));var integrations=require(_0x4cf6('0x9'));module[_0x4cf6('0xa')]=function(_0x1d45b9,_0x1283d4){return _0x1d45b9[_0x4cf6('0xb')]('FreshdeskAccount',attributes,{'tableName':_0x4cf6('0xc'),'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 23d59ac..73254d8 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 _0xe859=['model','info','debug','ShowFreshdeskAccount','find','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','attributes','map','include'];(function(_0x1f1266,_0x241957){var _0x691914=function(_0x178bdf){while(--_0x178bdf){_0x1f1266['push'](_0x1f1266['shift']());}};_0x691914(++_0x241957);}(_0xe859,0x199));var _0x9e85=function(_0x2c9695,_0x4c9738){_0x2c9695=_0x2c9695-0x0;var _0x5d9806=_0xe859[_0x2c9695];return _0x5d9806;};'use strict';var _=require(_0x9e85('0x0'));var util=require(_0x9e85('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9e85('0x2'));var fs=require('fs');var Redis=require(_0x9e85('0x3'));var db=require(_0x9e85('0x4'))['db'];var utils=require(_0x9e85('0x5'));var logger=require(_0x9e85('0x6'))(_0x9e85('0x7'));var config=require('../../config/environment');var jayson=require(_0x9e85('0x8'));var client=jayson['client'][_0x9e85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58eb91,_0x33386b,_0x5428e3){return new BPromise(function(_0x37b86a,_0x5be232){return client[_0x9e85('0xa')](_0x58eb91,_0x5428e3)['then'](function(_0x149ad0){logger['info'](_0x9e85('0xb'),_0x33386b,'request\x20sent');logger['debug'](_0x9e85('0xc'),_0x33386b,_0x9e85('0xd'),JSON[_0x9e85('0xe')](_0x149ad0));if(_0x149ad0['error']){if(_0x149ad0[_0x9e85('0xf')]['code']===0x1f4){logger[_0x9e85('0xf')](_0x9e85('0xb'),_0x33386b,_0x149ad0[_0x9e85('0xf')]['message']);return _0x5be232(_0x149ad0[_0x9e85('0xf')][_0x9e85('0x10')]);}logger[_0x9e85('0xf')](_0x9e85('0xb'),_0x33386b,_0x149ad0['error'][_0x9e85('0x10')]);return _0x37b86a(_0x149ad0['error'][_0x9e85('0x10')]);}else{logger['info'](_0x9e85('0xb'),_0x33386b,_0x9e85('0xd'));_0x37b86a(_0x149ad0['result']['message']);}})[_0x9e85('0x11')](function(_0x33152e){logger[_0x9e85('0xf')](_0x9e85('0xb'),_0x33386b,_0x33152e);_0x5be232(_0x33152e);});});}exports[_0x9e85('0x12')]=function(_0x41ffd1){var _0x5d0ae2=this;return new Promise(function(_0x44636d,_0x1d97aa){return db[_0x9e85('0x13')]['findAll']({'raw':_0x41ffd1['options']?_0x41ffd1[_0x9e85('0x14')][_0x9e85('0x15')]===undefined?!![]:![]:!![],'where':_0x41ffd1[_0x9e85('0x14')]?_0x41ffd1[_0x9e85('0x14')]['where']||null:null,'attributes':_0x41ffd1[_0x9e85('0x14')]?_0x41ffd1[_0x9e85('0x14')][_0x9e85('0x16')]||null:null,'limit':_0x41ffd1[_0x9e85('0x14')]?_0x41ffd1[_0x9e85('0x14')]['limit']||null:null,'include':_0x41ffd1[_0x9e85('0x14')]?_0x41ffd1[_0x9e85('0x14')]['include']?_[_0x9e85('0x17')](_0x41ffd1[_0x9e85('0x14')][_0x9e85('0x18')],function(_0x27e940){return{'model':db[_0x27e940[_0x9e85('0x19')]],'as':_0x27e940['as'],'attributes':_0x27e940['attributes'],'include':_0x27e940[_0x9e85('0x18')]?_[_0x9e85('0x17')](_0x27e940[_0x9e85('0x18')],function(_0x527449){return{'model':db[_0x527449[_0x9e85('0x19')]],'as':_0x527449['as'],'attributes':_0x527449['attributes'],'include':_0x527449[_0x9e85('0x18')]?_[_0x9e85('0x17')](_0x527449[_0x9e85('0x18')],function(_0x1452a3){return{'model':db[_0x1452a3[_0x9e85('0x19')]],'as':_0x1452a3['as'],'attributes':_0x1452a3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf082){logger[_0x9e85('0x1a')](_0x9e85('0x12'),_0x41ffd1);logger[_0x9e85('0x1b')](_0x9e85('0x12'),_0x41ffd1,JSON[_0x9e85('0xe')](_0x5bf082));_0x44636d(_0x5bf082);})['catch'](function(_0x7f0501){logger[_0x9e85('0xf')](_0x9e85('0x12'),_0x7f0501[_0x9e85('0x10')],_0x41ffd1);_0x1d97aa(_0x5d0ae2[_0x9e85('0xf')](0x1f4,_0x7f0501[_0x9e85('0x10')]));});});};exports[_0x9e85('0x1c')]=function(_0x4cbf90){var _0xee2a5e=this;return new Promise(function(_0x11c999,_0x75f67a){return db[_0x9e85('0x13')][_0x9e85('0x1d')]({'raw':_0x4cbf90[_0x9e85('0x14')]?_0x4cbf90[_0x9e85('0x14')][_0x9e85('0x15')]===undefined?!![]:![]:!![],'where':_0x4cbf90['options']?_0x4cbf90['options'][_0x9e85('0x1e')]||null:null,'attributes':_0x4cbf90['options']?_0x4cbf90['options']['attributes']||null:null,'include':_0x4cbf90['options']?_0x4cbf90[_0x9e85('0x14')][_0x9e85('0x18')]?_[_0x9e85('0x17')](_0x4cbf90[_0x9e85('0x14')][_0x9e85('0x18')],function(_0x3f2957){return{'model':db[_0x3f2957['model']],'as':_0x3f2957['as'],'attributes':_0x3f2957[_0x9e85('0x16')],'include':_0x3f2957[_0x9e85('0x18')]?_['map'](_0x3f2957[_0x9e85('0x18')],function(_0x25de51){return{'model':db[_0x25de51[_0x9e85('0x19')]],'as':_0x25de51['as'],'attributes':_0x25de51[_0x9e85('0x16')],'include':_0x25de51[_0x9e85('0x18')]?_[_0x9e85('0x17')](_0x25de51['include'],function(_0x7c0d1a){return{'model':db[_0x7c0d1a[_0x9e85('0x19')]],'as':_0x7c0d1a['as'],'attributes':_0x7c0d1a[_0x9e85('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd858b9){logger['info']('ShowFreshdeskAccount',_0x4cbf90);logger['debug'](_0x9e85('0x1c'),_0x4cbf90,JSON['stringify'](_0xd858b9));_0x11c999(_0xd858b9);})[_0x9e85('0x11')](function(_0x1c807a){logger[_0x9e85('0xf')](_0x9e85('0x1c'),_0x1c807a[_0x9e85('0x10')],_0x4cbf90);_0x75f67a(_0xee2a5e[_0x9e85('0xf')](0x1f4,_0x1c807a[_0x9e85('0x10')]));});});}; \ No newline at end of file +var _0xde39=['raw','where','include','map','model','attributes','then','stringify','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','catch','FreshdeskAccount','findAll','options'];(function(_0x461c2c,_0x13f720){var _0x34ce82=function(_0x44f0f5){while(--_0x44f0f5){_0x461c2c['push'](_0x461c2c['shift']());}};_0x34ce82(++_0x13f720);}(_0xde39,0x15e));var _0x9de3=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xde39[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0x9de3('0x0'));var util=require(_0x9de3('0x1'));var moment=require('moment');var BPromise=require(_0x9de3('0x2'));var rs=require(_0x9de3('0x3'));var fs=require('fs');var Redis=require(_0x9de3('0x4'));var db=require(_0x9de3('0x5'))['db'];var utils=require(_0x9de3('0x6'));var logger=require(_0x9de3('0x7'))('rpc');var config=require(_0x9de3('0x8'));var jayson=require(_0x9de3('0x9'));var client=jayson[_0x9de3('0xa')][_0x9de3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e6096,_0x26f9f6,_0x3eb46b){return new BPromise(function(_0xd8741a,_0xeead2e){return client[_0x9de3('0xc')](_0x4e6096,_0x3eb46b)['then'](function(_0x197faa){logger[_0x9de3('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x26f9f6,_0x9de3('0xe'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x26f9f6,'request\x20sent',JSON['stringify'](_0x197faa));if(_0x197faa[_0x9de3('0xf')]){if(_0x197faa[_0x9de3('0xf')][_0x9de3('0x10')]===0x1f4){logger[_0x9de3('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x26f9f6,_0x197faa[_0x9de3('0xf')][_0x9de3('0x11')]);return _0xeead2e(_0x197faa[_0x9de3('0xf')][_0x9de3('0x11')]);}logger[_0x9de3('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x26f9f6,_0x197faa['error'][_0x9de3('0x11')]);return _0xd8741a(_0x197faa[_0x9de3('0xf')][_0x9de3('0x11')]);}else{logger[_0x9de3('0xd')](_0x9de3('0x12'),_0x26f9f6,_0x9de3('0xe'));_0xd8741a(_0x197faa[_0x9de3('0x13')][_0x9de3('0x11')]);}})[_0x9de3('0x14')](function(_0x138167){logger['error'](_0x9de3('0x12'),_0x26f9f6,_0x138167);_0xeead2e(_0x138167);});});}exports['GetFreshdeskAccount']=function(_0x29efbf){var _0x553db4=this;return new Promise(function(_0x302ecf,_0x5401c8){return db[_0x9de3('0x15')][_0x9de3('0x16')]({'raw':_0x29efbf[_0x9de3('0x17')]?_0x29efbf[_0x9de3('0x17')][_0x9de3('0x18')]===undefined?!![]:![]:!![],'where':_0x29efbf[_0x9de3('0x17')]?_0x29efbf[_0x9de3('0x17')][_0x9de3('0x19')]||null:null,'attributes':_0x29efbf[_0x9de3('0x17')]?_0x29efbf[_0x9de3('0x17')]['attributes']||null:null,'limit':_0x29efbf[_0x9de3('0x17')]?_0x29efbf[_0x9de3('0x17')]['limit']||null:null,'include':_0x29efbf['options']?_0x29efbf[_0x9de3('0x17')][_0x9de3('0x1a')]?_[_0x9de3('0x1b')](_0x29efbf[_0x9de3('0x17')][_0x9de3('0x1a')],function(_0x56459e){return{'model':db[_0x56459e[_0x9de3('0x1c')]],'as':_0x56459e['as'],'attributes':_0x56459e[_0x9de3('0x1d')],'include':_0x56459e['include']?_['map'](_0x56459e['include'],function(_0x5570f2){return{'model':db[_0x5570f2[_0x9de3('0x1c')]],'as':_0x5570f2['as'],'attributes':_0x5570f2[_0x9de3('0x1d')],'include':_0x5570f2['include']?_[_0x9de3('0x1b')](_0x5570f2[_0x9de3('0x1a')],function(_0x4beccb){return{'model':db[_0x4beccb[_0x9de3('0x1c')]],'as':_0x4beccb['as'],'attributes':_0x4beccb[_0x9de3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9de3('0x1e')](function(_0x4baea9){logger['info']('GetFreshdeskAccount',_0x29efbf);logger['debug']('GetFreshdeskAccount',_0x29efbf,JSON[_0x9de3('0x1f')](_0x4baea9));_0x302ecf(_0x4baea9);})[_0x9de3('0x14')](function(_0x2a0c0f){logger[_0x9de3('0xf')](_0x9de3('0x20'),_0x2a0c0f[_0x9de3('0x11')],_0x29efbf);_0x5401c8(_0x553db4['error'](0x1f4,_0x2a0c0f[_0x9de3('0x11')]));});});};exports[_0x9de3('0x21')]=function(_0x4a427d){var _0x520f9e=this;return new Promise(function(_0x51d309,_0x31bbd3){return db[_0x9de3('0x15')]['find']({'raw':_0x4a427d[_0x9de3('0x17')]?_0x4a427d['options'][_0x9de3('0x18')]===undefined?!![]:![]:!![],'where':_0x4a427d['options']?_0x4a427d[_0x9de3('0x17')]['where']||null:null,'attributes':_0x4a427d[_0x9de3('0x17')]?_0x4a427d['options'][_0x9de3('0x1d')]||null:null,'include':_0x4a427d[_0x9de3('0x17')]?_0x4a427d[_0x9de3('0x17')][_0x9de3('0x1a')]?_['map'](_0x4a427d[_0x9de3('0x17')][_0x9de3('0x1a')],function(_0x1e03de){return{'model':db[_0x1e03de[_0x9de3('0x1c')]],'as':_0x1e03de['as'],'attributes':_0x1e03de[_0x9de3('0x1d')],'include':_0x1e03de[_0x9de3('0x1a')]?_[_0x9de3('0x1b')](_0x1e03de[_0x9de3('0x1a')],function(_0x4b0720){return{'model':db[_0x4b0720[_0x9de3('0x1c')]],'as':_0x4b0720['as'],'attributes':_0x4b0720[_0x9de3('0x1d')],'include':_0x4b0720[_0x9de3('0x1a')]?_[_0x9de3('0x1b')](_0x4b0720[_0x9de3('0x1a')],function(_0x4d2f35){return{'model':db[_0x4d2f35[_0x9de3('0x1c')]],'as':_0x4d2f35['as'],'attributes':_0x4d2f35[_0x9de3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9de3('0x1e')](function(_0x46d670){logger['info'](_0x9de3('0x21'),_0x4a427d);logger['debug'](_0x9de3('0x21'),_0x4a427d,JSON[_0x9de3('0x1f')](_0x46d670));_0x51d309(_0x46d670);})['catch'](function(_0x897dea){logger[_0x9de3('0xf')]('ShowFreshdeskAccount',_0x897dea[_0x9de3('0x11')],_0x4a427d);_0x31bbd3(_0x520f9e[_0x9de3('0xf')](0x1f4,_0x897dea[_0x9de3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8ce4ce6..0f7b149 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 _0xc497=['../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x43af17,_0x1bca1e){var _0x2d3752=function(_0x1bfc30){while(--_0x1bfc30){_0x43af17['push'](_0x43af17['shift']());}};_0x2d3752(++_0x1bca1e);}(_0xc497,0xb7));var _0x7c49=function(_0x3d4ac9,_0x360f8b){_0x3d4ac9=_0x3d4ac9-0x0;var _0x5c946f=_0xc497[_0x3d4ac9];return _0x5c946f;};'use strict';var multer=require(_0x7c49('0x0'));var util=require(_0x7c49('0x1'));var path=require(_0x7c49('0x2'));var timeout=require(_0x7c49('0x3'));var express=require('express');var router=express[_0x7c49('0x4')]();var fs_extra=require(_0x7c49('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c49('0x6'));var config=require('../../config/environment');var controller=require(_0x7c49('0x7'));router[_0x7c49('0x8')]('/',auth[_0x7c49('0x9')](),controller[_0x7c49('0xa')]);router[_0x7c49('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7c49('0xb')]);router[_0x7c49('0x8')](_0x7c49('0xc'),auth[_0x7c49('0x9')](),controller[_0x7c49('0xd')]);router[_0x7c49('0x8')](_0x7c49('0xe'),auth[_0x7c49('0x9')](),controller[_0x7c49('0xf')]);router[_0x7c49('0x8')](_0x7c49('0x10'),auth[_0x7c49('0x9')](),controller[_0x7c49('0x11')]);router[_0x7c49('0x8')](_0x7c49('0x12'),auth[_0x7c49('0x9')](),controller[_0x7c49('0x13')]);router[_0x7c49('0x14')]('/',auth[_0x7c49('0x9')](),controller['create']);router[_0x7c49('0x14')](_0x7c49('0x12'),auth[_0x7c49('0x9')](),controller[_0x7c49('0x15')]);router[_0x7c49('0x16')](_0x7c49('0x17'),auth[_0x7c49('0x9')](),controller[_0x7c49('0x18')]);router[_0x7c49('0x19')](_0x7c49('0x17'),auth[_0x7c49('0x9')](),controller[_0x7c49('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xfbd8=['create','setTags','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post'];(function(_0x342db9,_0x50c6f0){var _0x47ee40=function(_0x38a400){while(--_0x38a400){_0x342db9['push'](_0x342db9['shift']());}};_0x47ee40(++_0x50c6f0);}(_0xfbd8,0x1f3));var _0x8fbd=function(_0x17d703,_0x2266eb){_0x17d703=_0x17d703-0x0;var _0x4fd652=_0xfbd8[_0x17d703];return _0x4fd652;};'use strict';var multer=require(_0x8fbd('0x0'));var util=require(_0x8fbd('0x1'));var path=require(_0x8fbd('0x2'));var timeout=require(_0x8fbd('0x3'));var express=require('express');var router=express[_0x8fbd('0x4')]();var fs_extra=require(_0x8fbd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fbd('0x6'));var config=require(_0x8fbd('0x7'));var controller=require(_0x8fbd('0x8'));router[_0x8fbd('0x9')]('/',auth[_0x8fbd('0xa')](),controller[_0x8fbd('0xb')]);router[_0x8fbd('0x9')](_0x8fbd('0xc'),auth[_0x8fbd('0xa')](),controller[_0x8fbd('0xd')]);router[_0x8fbd('0x9')](_0x8fbd('0xe'),auth[_0x8fbd('0xa')](),controller[_0x8fbd('0xf')]);router['get'](_0x8fbd('0x10'),auth[_0x8fbd('0xa')](),controller[_0x8fbd('0x11')]);router[_0x8fbd('0x9')]('/:id/descriptions',auth[_0x8fbd('0xa')](),controller[_0x8fbd('0x12')]);router['get'](_0x8fbd('0x13'),auth[_0x8fbd('0xa')](),controller['getTags']);router[_0x8fbd('0x14')]('/',auth[_0x8fbd('0xa')](),controller[_0x8fbd('0x15')]);router[_0x8fbd('0x14')]('/:id/tags',auth[_0x8fbd('0xa')](),controller[_0x8fbd('0x16')]);router[_0x8fbd('0x17')](_0x8fbd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8fbd('0x18')](_0x8fbd('0xc'),auth['isAuthenticated'](),controller[_0x8fbd('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c550ed7..0da00e3 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 _0x2b99=['exports','sequelize'];(function(_0x1cdbcc,_0x675104){var _0x1ff94d=function(_0x51f863){while(--_0x51f863){_0x1cdbcc['push'](_0x1cdbcc['shift']());}};_0x1ff94d(++_0x675104);}(_0x2b99,0x89));var _0x92b9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2b99[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x92b9('0x0'));module[_0x92b9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0a0e=['STRING','sequelize'];(function(_0x14dc7d,_0x13ff80){var _0x2a94df=function(_0x524a4f){while(--_0x524a4f){_0x14dc7d['push'](_0x14dc7d['shift']());}};_0x2a94df(++_0x13ff80);}(_0x0a0e,0xb1));var _0xe0a0=function(_0x34ea22,_0x1270b3){_0x34ea22=_0x34ea22-0x0;var _0x1ca470=_0x0a0e[_0x34ea22];return _0x1ca470;};'use strict';var Sequelize=require(_0xe0a0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0a0('0x1')]},'description':{'type':Sequelize[_0xe0a0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index dbd66af..016333d 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 _0x6f91=['findAll','rows','catch','show','find','create','body','update','params','destroy','findOne','FreshdeskField','length','nolimit','getFields','getSubjects','getDescriptions','hasOwnProperty','Tag','getTags','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','status','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x2c7e51,_0x561e94){var _0x5c69fb=function(_0x5e4e54){while(--_0x5e4e54){_0x2c7e51['push'](_0x2c7e51['shift']());}};_0x5c69fb(++_0x561e94);}(_0x6f91,0x1c3));var _0x16f9=function(_0x49748c,_0x3d2005){_0x49748c=_0x49748c-0x0;var _0xedf6b6=_0x6f91[_0x49748c];return _0xedf6b6;};'use strict';var emlformat=require(_0x16f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16f9('0x1'));var jsonpatch=require(_0x16f9('0x2'));var rp=require(_0x16f9('0x3'));var moment=require('moment');var BPromise=require(_0x16f9('0x4'));var Mustache=require(_0x16f9('0x5'));var util=require(_0x16f9('0x6'));var path=require(_0x16f9('0x7'));var sox=require(_0x16f9('0x8'));var csv=require('to-csv');var ejs=require(_0x16f9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16f9('0xa'));var squel=require(_0x16f9('0xb'));var crypto=require(_0x16f9('0xc'));var jsforce=require(_0x16f9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x16f9('0xe'));var querystring=require(_0x16f9('0xf'));var Papa=require('papaparse');var Redis=require(_0x16f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x16f9('0x11'));var as=require(_0x16f9('0x12'));var hardwareService=require(_0x16f9('0x13'));var logger=require(_0x16f9('0x14'))(_0x16f9('0x15'));var utils=require('../../config/utils');var config=require(_0x16f9('0x16'));var licenseUtil=require(_0x16f9('0x17'));var db=require(_0x16f9('0x18'))['db'];function respondWithStatusCode(_0x38f565,_0x2f8f0f){_0x2f8f0f=_0x2f8f0f||0xcc;return function(_0x142cbf){if(_0x142cbf){return _0x38f565[_0x16f9('0x19')](_0x2f8f0f);}return _0x38f565['status'](_0x2f8f0f)[_0x16f9('0x1a')]();};}function respondWithResult(_0x33b61b,_0x4a0d01){_0x4a0d01=_0x4a0d01||0xc8;return function(_0x4f6c41){if(_0x4f6c41){return _0x33b61b['status'](_0x4a0d01)['json'](_0x4f6c41);}};}function respondWithFilteredResult(_0x38d156,_0x154c11){return function(_0x928e90){if(_0x928e90){var _0x299e6e=typeof _0x154c11[_0x16f9('0x1b')]===_0x16f9('0x1c')&&typeof _0x154c11[_0x16f9('0x1d')]===_0x16f9('0x1c');var _0x3b03b7=_0x928e90['count'];var _0x579ad5=_0x299e6e?0x0:_0x154c11['offset'];var _0x2c6716=_0x299e6e?_0x928e90[_0x16f9('0x1e')]:_0x154c11[_0x16f9('0x1b')]+_0x154c11[_0x16f9('0x1d')];var _0x501d06;if(_0x2c6716>=_0x3b03b7){_0x2c6716=_0x3b03b7;_0x501d06=0xc8;}else{_0x501d06=0xce;}_0x38d156['status'](_0x501d06);return _0x38d156[_0x16f9('0x1f')](_0x16f9('0x20'),_0x579ad5+'-'+_0x2c6716+'/'+_0x3b03b7)['json'](_0x928e90);}return null;};}function patchUpdates(_0x55a265){return function(_0xd06b63){try{jsonpatch[_0x16f9('0x21')](_0xd06b63,_0x55a265,!![]);}catch(_0x5c8f8b){return BPromise[_0x16f9('0x22')](_0x5c8f8b);}return _0xd06b63['save']();};}function saveUpdates(_0x407c30,_0x3453b0){return function(_0x14d4ab){if(_0x14d4ab){return _0x14d4ab['update'](_0x407c30)[_0x16f9('0x23')](function(_0x27a78){return _0x27a78;});}return null;};}function removeEntity(_0x13fe04,_0x159ba6){return function(_0x26beae){if(_0x26beae){return _0x26beae['destroy']()['then'](function(){_0x13fe04[_0x16f9('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c7f2,_0x143989){return function(_0x44f01f){if(!_0x44f01f){_0x20c7f2[_0x16f9('0x19')](0x194);}return _0x44f01f;};}function handleError(_0x6fd9e9,_0x212f02){_0x212f02=_0x212f02||0x1f4;return function(_0x2498f1){logger[_0x16f9('0x25')](_0x2498f1[_0x16f9('0x26')]);if(_0x2498f1[_0x16f9('0x27')]){delete _0x2498f1['name'];}_0x6fd9e9[_0x16f9('0x24')](_0x212f02)[_0x16f9('0x28')](_0x2498f1);};}exports[_0x16f9('0x29')]=function(_0x44704a,_0x5cc1f4){var _0x8244f0={},_0x4eeebe={},_0x1c1120={'count':0x0,'rows':[]};var _0x274ec0=_['map'](db[_0x16f9('0x2a')][_0x16f9('0x2b')],function(_0x4362b2){return{'name':_0x4362b2[_0x16f9('0x2c')],'type':_0x4362b2[_0x16f9('0x2d')][_0x16f9('0x2e')]};});_0x4eeebe[_0x16f9('0x2f')]=_[_0x16f9('0x30')](_0x274ec0,_0x16f9('0x27'));_0x4eeebe[_0x16f9('0x31')]=_[_0x16f9('0x32')](_0x44704a[_0x16f9('0x31')]);_0x4eeebe['filters']=_['intersection'](_0x4eeebe[_0x16f9('0x2f')],_0x4eeebe[_0x16f9('0x31')]);_0x8244f0[_0x16f9('0x33')]=_[_0x16f9('0x34')](_0x4eeebe['model'],qs[_0x16f9('0x35')](_0x44704a[_0x16f9('0x31')][_0x16f9('0x35')]));_0x8244f0[_0x16f9('0x33')]=_0x8244f0[_0x16f9('0x33')]['length']?_0x8244f0[_0x16f9('0x33')]:_0x4eeebe[_0x16f9('0x2f')];if(!_0x44704a[_0x16f9('0x31')]['hasOwnProperty']('nolimit')){_0x8244f0[_0x16f9('0x1d')]=qs[_0x16f9('0x1d')](_0x44704a[_0x16f9('0x31')]['limit']);_0x8244f0[_0x16f9('0x1b')]=qs[_0x16f9('0x1b')](_0x44704a[_0x16f9('0x31')][_0x16f9('0x1b')]);}_0x8244f0[_0x16f9('0x36')]=qs['sort'](_0x44704a[_0x16f9('0x31')][_0x16f9('0x37')]);_0x8244f0[_0x16f9('0x38')]=qs[_0x16f9('0x39')](_[_0x16f9('0x3a')](_0x44704a[_0x16f9('0x31')],_0x4eeebe['filters']),_0x274ec0);if(_0x44704a[_0x16f9('0x31')][_0x16f9('0x3b')]){_0x8244f0['where']=_[_0x16f9('0x3c')](_0x8244f0[_0x16f9('0x38')],{'$or':_[_0x16f9('0x30')](_0x274ec0,function(_0x569967){if(_0x569967['type']!==_0x16f9('0x3d')){var _0x11874b={};_0x11874b[_0x569967[_0x16f9('0x27')]]={'$like':'%'+_0x44704a[_0x16f9('0x31')][_0x16f9('0x3b')]+'%'};return _0x11874b;}})});}_0x8244f0=_['merge']({},_0x8244f0,_0x44704a[_0x16f9('0x3e')]);var _0x48a24b={'where':_0x8244f0[_0x16f9('0x38')]};return db[_0x16f9('0x2a')][_0x16f9('0x1e')](_0x48a24b)[_0x16f9('0x23')](function(_0x34fe78){_0x1c1120['count']=_0x34fe78;if(_0x44704a[_0x16f9('0x31')][_0x16f9('0x3f')]){_0x8244f0[_0x16f9('0x40')]=[{'all':!![]}];}return db[_0x16f9('0x2a')][_0x16f9('0x41')](_0x8244f0);})['then'](function(_0x27139a){_0x1c1120[_0x16f9('0x42')]=_0x27139a;return _0x1c1120;})[_0x16f9('0x23')](respondWithFilteredResult(_0x5cc1f4,_0x8244f0))[_0x16f9('0x43')](handleError(_0x5cc1f4,null));};exports[_0x16f9('0x44')]=function(_0x344438,_0xb9da69){var _0x21983d={'raw':![],'where':{'id':_0x344438['params']['id']}},_0x1fe09e={};_0x1fe09e['model']=_[_0x16f9('0x32')](db[_0x16f9('0x2a')][_0x16f9('0x2b')]);_0x1fe09e['query']=_[_0x16f9('0x32')](_0x344438['query']);_0x1fe09e[_0x16f9('0x39')]=_['intersection'](_0x1fe09e['model'],_0x1fe09e['query']);_0x21983d[_0x16f9('0x33')]=_[_0x16f9('0x34')](_0x1fe09e[_0x16f9('0x2f')],qs[_0x16f9('0x35')](_0x344438[_0x16f9('0x31')][_0x16f9('0x35')]));_0x21983d[_0x16f9('0x33')]=_0x21983d[_0x16f9('0x33')]['length']?_0x21983d['attributes']:_0x1fe09e[_0x16f9('0x2f')];if(_0x344438['query'][_0x16f9('0x3f')]){_0x21983d[_0x16f9('0x40')]=[{'all':!![]}];}_0x21983d=_[_0x16f9('0x3c')]({},_0x21983d,_0x344438['options']);return db['FreshdeskConfiguration'][_0x16f9('0x45')](_0x21983d)[_0x16f9('0x23')](handleEntityNotFound(_0xb9da69,null))[_0x16f9('0x23')](respondWithResult(_0xb9da69,null))[_0x16f9('0x43')](handleError(_0xb9da69,null));};exports[_0x16f9('0x46')]=function(_0x5c6e30,_0x21d536){return db[_0x16f9('0x2a')][_0x16f9('0x46')](_0x5c6e30[_0x16f9('0x47')],{})[_0x16f9('0x23')](respondWithResult(_0x21d536,0xc9))['catch'](handleError(_0x21d536,null));};exports[_0x16f9('0x48')]=function(_0x343505,_0x8fe4d){if(_0x343505[_0x16f9('0x47')]['id']){delete _0x343505[_0x16f9('0x47')]['id'];}return db[_0x16f9('0x2a')][_0x16f9('0x45')]({'where':{'id':_0x343505[_0x16f9('0x49')]['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x8fe4d,null))[_0x16f9('0x23')](saveUpdates(_0x343505[_0x16f9('0x47')],null))[_0x16f9('0x23')](respondWithResult(_0x8fe4d,null))[_0x16f9('0x43')](handleError(_0x8fe4d,null));};exports[_0x16f9('0x4a')]=function(_0x3dd7df,_0x2f3cea){return db['FreshdeskConfiguration'][_0x16f9('0x45')]({'where':{'id':_0x3dd7df[_0x16f9('0x49')]['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x2f3cea,null))[_0x16f9('0x23')](removeEntity(_0x2f3cea,null))[_0x16f9('0x43')](handleError(_0x2f3cea,null));};exports['getFields']=function(_0x232a61,_0x33cf01,_0x21c329){var _0xe601c2={};var _0x51f029={};var _0x15c078;var _0x507f50;return db['FreshdeskConfiguration'][_0x16f9('0x4b')]({'where':{'id':_0x232a61[_0x16f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x33cf01,null))['then'](function(_0x45d33e){if(_0x45d33e){_0x15c078=_0x45d33e;_0x51f029[_0x16f9('0x2f')]=_[_0x16f9('0x32')](db[_0x16f9('0x4c')][_0x16f9('0x2b')]);_0x51f029[_0x16f9('0x31')]=_[_0x16f9('0x32')](_0x232a61['query']);_0x51f029[_0x16f9('0x39')]=_[_0x16f9('0x34')](_0x51f029['model'],_0x51f029[_0x16f9('0x31')]);_0xe601c2['attributes']=_['intersection'](_0x51f029[_0x16f9('0x2f')],qs[_0x16f9('0x35')](_0x232a61[_0x16f9('0x31')]['fields']));_0xe601c2['attributes']=_0xe601c2['attributes']['length']?_0xe601c2['attributes']:_0x51f029[_0x16f9('0x2f')];_0xe601c2[_0x16f9('0x36')]=qs[_0x16f9('0x37')](_0x232a61['query'][_0x16f9('0x37')]);_0xe601c2[_0x16f9('0x38')]=qs[_0x16f9('0x39')](_[_0x16f9('0x3a')](_0x232a61[_0x16f9('0x31')],_0x51f029[_0x16f9('0x39')]));if(_0x232a61['query'][_0x16f9('0x3b')]){_0xe601c2['where']=_['merge'](_0xe601c2[_0x16f9('0x38')],{'$or':_['map'](_0xe601c2['attributes'],function(_0x2eb8db){var _0x340a96={};_0x340a96[_0x2eb8db]={'$like':'%'+_0x232a61[_0x16f9('0x31')][_0x16f9('0x3b')]+'%'};return _0x340a96;})});}_0xe601c2=_[_0x16f9('0x3c')]({},_0xe601c2,_0x232a61['options']);return _0x15c078['getFields'](_0xe601c2);}})[_0x16f9('0x23')](function(_0x40fbd6){if(_0x40fbd6){_0x507f50=_0x40fbd6[_0x16f9('0x4d')];if(!_0x232a61[_0x16f9('0x31')]['hasOwnProperty'](_0x16f9('0x4e'))){_0xe601c2[_0x16f9('0x1d')]=qs[_0x16f9('0x1d')](_0x232a61['query']['limit']);_0xe601c2[_0x16f9('0x1b')]=qs[_0x16f9('0x1b')](_0x232a61[_0x16f9('0x31')][_0x16f9('0x1b')]);}return _0x15c078[_0x16f9('0x4f')](_0xe601c2);}})[_0x16f9('0x23')](function(_0x29f87a){if(_0x29f87a){return _0x29f87a?{'count':_0x507f50,'rows':_0x29f87a}:null;}})[_0x16f9('0x23')](respondWithResult(_0x33cf01,null))[_0x16f9('0x43')](handleError(_0x33cf01,null));};exports[_0x16f9('0x50')]=function(_0x2a6070,_0x1fac22,_0x4b1c99){var _0x1a368b={};var _0x5af05b={};var _0x516de1;var _0xbda704;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2a6070['params']['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x1fac22,null))[_0x16f9('0x23')](function(_0x121a82){if(_0x121a82){_0x516de1=_0x121a82;_0x5af05b[_0x16f9('0x2f')]=_[_0x16f9('0x32')](db[_0x16f9('0x4c')]['rawAttributes']);_0x5af05b[_0x16f9('0x31')]=_['keys'](_0x2a6070[_0x16f9('0x31')]);_0x5af05b[_0x16f9('0x39')]=_['intersection'](_0x5af05b[_0x16f9('0x2f')],_0x5af05b[_0x16f9('0x31')]);_0x1a368b[_0x16f9('0x33')]=_[_0x16f9('0x34')](_0x5af05b['model'],qs[_0x16f9('0x35')](_0x2a6070['query']['fields']));_0x1a368b['attributes']=_0x1a368b[_0x16f9('0x33')][_0x16f9('0x4d')]?_0x1a368b[_0x16f9('0x33')]:_0x5af05b['model'];_0x1a368b[_0x16f9('0x36')]=qs['sort'](_0x2a6070[_0x16f9('0x31')][_0x16f9('0x37')]);_0x1a368b[_0x16f9('0x38')]=qs[_0x16f9('0x39')](_['pick'](_0x2a6070[_0x16f9('0x31')],_0x5af05b[_0x16f9('0x39')]));if(_0x2a6070[_0x16f9('0x31')][_0x16f9('0x3b')]){_0x1a368b[_0x16f9('0x38')]=_['merge'](_0x1a368b[_0x16f9('0x38')],{'$or':_[_0x16f9('0x30')](_0x1a368b['attributes'],function(_0x3b940c){var _0x387b8b={};_0x387b8b[_0x3b940c]={'$like':'%'+_0x2a6070[_0x16f9('0x31')][_0x16f9('0x3b')]+'%'};return _0x387b8b;})});}_0x1a368b=_[_0x16f9('0x3c')]({},_0x1a368b,_0x2a6070['options']);return _0x516de1[_0x16f9('0x50')](_0x1a368b);}})[_0x16f9('0x23')](function(_0x48189b){if(_0x48189b){_0xbda704=_0x48189b[_0x16f9('0x4d')];if(!_0x2a6070[_0x16f9('0x31')]['hasOwnProperty'](_0x16f9('0x4e'))){_0x1a368b[_0x16f9('0x1d')]=qs[_0x16f9('0x1d')](_0x2a6070[_0x16f9('0x31')][_0x16f9('0x1d')]);_0x1a368b[_0x16f9('0x1b')]=qs['offset'](_0x2a6070[_0x16f9('0x31')][_0x16f9('0x1b')]);}return _0x516de1['getSubjects'](_0x1a368b);}})[_0x16f9('0x23')](function(_0x2e4518){if(_0x2e4518){return _0x2e4518?{'count':_0xbda704,'rows':_0x2e4518}:null;}})[_0x16f9('0x23')](respondWithResult(_0x1fac22,null))[_0x16f9('0x43')](handleError(_0x1fac22,null));};exports[_0x16f9('0x51')]=function(_0x22f4b0,_0x5809cd,_0x2461c3){var _0x574b42={};var _0x58b4bc={};var _0x5038f3;var _0x45fd2c;return db[_0x16f9('0x2a')]['findOne']({'where':{'id':_0x22f4b0[_0x16f9('0x49')]['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x5809cd,null))[_0x16f9('0x23')](function(_0x20daf4){if(_0x20daf4){_0x5038f3=_0x20daf4;_0x58b4bc[_0x16f9('0x2f')]=_[_0x16f9('0x32')](db[_0x16f9('0x4c')]['rawAttributes']);_0x58b4bc['query']=_[_0x16f9('0x32')](_0x22f4b0[_0x16f9('0x31')]);_0x58b4bc[_0x16f9('0x39')]=_['intersection'](_0x58b4bc[_0x16f9('0x2f')],_0x58b4bc[_0x16f9('0x31')]);_0x574b42[_0x16f9('0x33')]=_[_0x16f9('0x34')](_0x58b4bc[_0x16f9('0x2f')],qs[_0x16f9('0x35')](_0x22f4b0['query'][_0x16f9('0x35')]));_0x574b42['attributes']=_0x574b42['attributes'][_0x16f9('0x4d')]?_0x574b42[_0x16f9('0x33')]:_0x58b4bc[_0x16f9('0x2f')];_0x574b42[_0x16f9('0x36')]=qs[_0x16f9('0x37')](_0x22f4b0[_0x16f9('0x31')]['sort']);_0x574b42[_0x16f9('0x38')]=qs[_0x16f9('0x39')](_[_0x16f9('0x3a')](_0x22f4b0[_0x16f9('0x31')],_0x58b4bc['filters']));if(_0x22f4b0[_0x16f9('0x31')]['filter']){_0x574b42[_0x16f9('0x38')]=_[_0x16f9('0x3c')](_0x574b42['where'],{'$or':_['map'](_0x574b42[_0x16f9('0x33')],function(_0x184f1f){var _0x3d6cde={};_0x3d6cde[_0x184f1f]={'$like':'%'+_0x22f4b0['query']['filter']+'%'};return _0x3d6cde;})});}_0x574b42=_['merge']({},_0x574b42,_0x22f4b0[_0x16f9('0x3e')]);return _0x5038f3[_0x16f9('0x51')](_0x574b42);}})[_0x16f9('0x23')](function(_0x118dfb){if(_0x118dfb){_0x45fd2c=_0x118dfb[_0x16f9('0x4d')];if(!_0x22f4b0[_0x16f9('0x31')][_0x16f9('0x52')]('nolimit')){_0x574b42[_0x16f9('0x1d')]=qs[_0x16f9('0x1d')](_0x22f4b0[_0x16f9('0x31')][_0x16f9('0x1d')]);_0x574b42[_0x16f9('0x1b')]=qs['offset'](_0x22f4b0['query'][_0x16f9('0x1b')]);}return _0x5038f3[_0x16f9('0x51')](_0x574b42);}})[_0x16f9('0x23')](function(_0x53d4c6){if(_0x53d4c6){return _0x53d4c6?{'count':_0x45fd2c,'rows':_0x53d4c6}:null;}})[_0x16f9('0x23')](respondWithResult(_0x5809cd,null))[_0x16f9('0x43')](handleError(_0x5809cd,null));};exports['getTags']=function(_0x172596,_0x39f440,_0x5e97e1){var _0xbcd136={};var _0x406571={};var _0x273af8;var _0x274658;return db['FreshdeskConfiguration'][_0x16f9('0x4b')]({'where':{'id':_0x172596['params']['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x39f440,null))[_0x16f9('0x23')](function(_0x4c81ff){if(_0x4c81ff){_0x273af8=_0x4c81ff;_0x406571[_0x16f9('0x2f')]=_[_0x16f9('0x32')](db[_0x16f9('0x53')][_0x16f9('0x2b')]);_0x406571[_0x16f9('0x31')]=_[_0x16f9('0x32')](_0x172596[_0x16f9('0x31')]);_0x406571['filters']=_['intersection'](_0x406571[_0x16f9('0x2f')],_0x406571[_0x16f9('0x31')]);_0xbcd136[_0x16f9('0x33')]=_[_0x16f9('0x34')](_0x406571[_0x16f9('0x2f')],qs[_0x16f9('0x35')](_0x172596[_0x16f9('0x31')]['fields']));_0xbcd136[_0x16f9('0x33')]=_0xbcd136[_0x16f9('0x33')][_0x16f9('0x4d')]?_0xbcd136[_0x16f9('0x33')]:_0x406571['model'];_0xbcd136['order']=qs['sort'](_0x172596[_0x16f9('0x31')][_0x16f9('0x37')]);_0xbcd136[_0x16f9('0x38')]=qs[_0x16f9('0x39')](_[_0x16f9('0x3a')](_0x172596[_0x16f9('0x31')],_0x406571[_0x16f9('0x39')]));if(_0x172596['query'][_0x16f9('0x3b')]){_0xbcd136[_0x16f9('0x38')]=_['merge'](_0xbcd136[_0x16f9('0x38')],{'$or':_[_0x16f9('0x30')](_0xbcd136[_0x16f9('0x33')],function(_0x1022cc){var _0x1ff6f2={};_0x1ff6f2[_0x1022cc]={'$like':'%'+_0x172596[_0x16f9('0x31')][_0x16f9('0x3b')]+'%'};return _0x1ff6f2;})});}_0xbcd136=_[_0x16f9('0x3c')]({},_0xbcd136,_0x172596[_0x16f9('0x3e')]);return _0x273af8[_0x16f9('0x54')](_0xbcd136);}})['then'](function(_0x299035){if(_0x299035){_0x274658=_0x299035['length'];if(!_0x172596[_0x16f9('0x31')][_0x16f9('0x52')](_0x16f9('0x4e'))){_0xbcd136['limit']=qs[_0x16f9('0x1d')](_0x172596['query'][_0x16f9('0x1d')]);_0xbcd136[_0x16f9('0x1b')]=qs[_0x16f9('0x1b')](_0x172596[_0x16f9('0x31')][_0x16f9('0x1b')]);}return _0x273af8[_0x16f9('0x54')](_0xbcd136);}})[_0x16f9('0x23')](function(_0x226188){if(_0x226188){return _0x226188?{'count':_0x274658,'rows':_0x226188}:null;}})[_0x16f9('0x23')](respondWithResult(_0x39f440,null))['catch'](handleError(_0x39f440,null));};exports[_0x16f9('0x55')]=function(_0x37da01,_0x5eebec,_0x508b33){if(_0x37da01[_0x16f9('0x47')]['id']){delete _0x37da01[_0x16f9('0x47')]['id'];}return db[_0x16f9('0x2a')][_0x16f9('0x4b')]({'where':{'id':_0x37da01[_0x16f9('0x49')]['id']}})[_0x16f9('0x23')](handleEntityNotFound(_0x5eebec,null))[_0x16f9('0x23')](function(_0x4dbe7b){if(_0x4dbe7b){return _0x4dbe7b['setTags'](_0x37da01['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x5eebec,null))[_0x16f9('0x43')](handleError(_0x5eebec,null));}; \ No newline at end of file +var _0x7718=['lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','name','send','index','FreshdeskConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','length','include','find','create','body','params','getFields','FreshdeskField','nolimit','getSubjects','findOne','pick','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs'];(function(_0x26ac27,_0x574b86){var _0x44a599=function(_0x130e2c){while(--_0x130e2c){_0x26ac27['push'](_0x26ac27['shift']());}};_0x44a599(++_0x574b86);}(_0x7718,0xe4));var _0x8771=function(_0x3b15f4,_0x30faec){_0x3b15f4=_0x3b15f4-0x0;var _0x2a8dbf=_0x7718[_0x3b15f4];return _0x2a8dbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8771('0x0'));var zipdir=require(_0x8771('0x1'));var jsonpatch=require(_0x8771('0x2'));var rp=require(_0x8771('0x3'));var moment=require('moment');var BPromise=require(_0x8771('0x4'));var Mustache=require('mustache');var util=require(_0x8771('0x5'));var path=require(_0x8771('0x6'));var sox=require(_0x8771('0x7'));var csv=require('to-csv');var ejs=require(_0x8771('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8771('0x9'));var squel=require(_0x8771('0xa'));var crypto=require('crypto');var jsforce=require(_0x8771('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8771('0xc'));var querystring=require(_0x8771('0xd'));var Papa=require('papaparse');var Redis=require(_0x8771('0xe'));var authService=require(_0x8771('0xf'));var qs=require(_0x8771('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8771('0x11'));var logger=require(_0x8771('0x12'))(_0x8771('0x13'));var utils=require(_0x8771('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8771('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x593d01,_0x420538){_0x420538=_0x420538||0xcc;return function(_0x1f7139){if(_0x1f7139){return _0x593d01[_0x8771('0x16')](_0x420538);}return _0x593d01[_0x8771('0x17')](_0x420538)['end']();};}function respondWithResult(_0x15b00e,_0x24f0c0){_0x24f0c0=_0x24f0c0||0xc8;return function(_0x4e9ece){if(_0x4e9ece){return _0x15b00e['status'](_0x24f0c0)[_0x8771('0x18')](_0x4e9ece);}};}function respondWithFilteredResult(_0x178f76,_0x7f992a){return function(_0xf12284){if(_0xf12284){var _0x339e50=typeof _0x7f992a[_0x8771('0x19')]===_0x8771('0x1a')&&typeof _0x7f992a[_0x8771('0x1b')]==='undefined';var _0xaeddc4=_0xf12284[_0x8771('0x1c')];var _0x4d648b=_0x339e50?0x0:_0x7f992a[_0x8771('0x19')];var _0x1f3904=_0x339e50?_0xf12284['count']:_0x7f992a[_0x8771('0x19')]+_0x7f992a[_0x8771('0x1b')];var _0x5eee4b;if(_0x1f3904>=_0xaeddc4){_0x1f3904=_0xaeddc4;_0x5eee4b=0xc8;}else{_0x5eee4b=0xce;}_0x178f76[_0x8771('0x17')](_0x5eee4b);return _0x178f76[_0x8771('0x1d')](_0x8771('0x1e'),_0x4d648b+'-'+_0x1f3904+'/'+_0xaeddc4)[_0x8771('0x18')](_0xf12284);}return null;};}function patchUpdates(_0x20771f){return function(_0x1305cf){try{jsonpatch[_0x8771('0x1f')](_0x1305cf,_0x20771f,!![]);}catch(_0x149bf2){return BPromise['reject'](_0x149bf2);}return _0x1305cf['save']();};}function saveUpdates(_0x7baa23,_0x64ab3e){return function(_0x3a6594){if(_0x3a6594){return _0x3a6594[_0x8771('0x20')](_0x7baa23)['then'](function(_0x425460){return _0x425460;});}return null;};}function removeEntity(_0x182e79,_0x44f2c0){return function(_0x43992d){if(_0x43992d){return _0x43992d[_0x8771('0x21')]()[_0x8771('0x22')](function(){_0x182e79['status'](0xcc)[_0x8771('0x23')]();});}};}function handleEntityNotFound(_0x291fcd,_0x1bfda7){return function(_0x381580){if(!_0x381580){_0x291fcd[_0x8771('0x16')](0x194);}return _0x381580;};}function handleError(_0xf6515,_0x2d827f){_0x2d827f=_0x2d827f||0x1f4;return function(_0x412b5b){logger['error'](_0x412b5b['stack']);if(_0x412b5b[_0x8771('0x24')]){delete _0x412b5b[_0x8771('0x24')];}_0xf6515[_0x8771('0x17')](_0x2d827f)[_0x8771('0x25')](_0x412b5b);};}exports[_0x8771('0x26')]=function(_0x4bc631,_0x32049d){var _0x1d0243={},_0x59b347={},_0xf96601={'count':0x0,'rows':[]};var _0x1cd787=_['map'](db[_0x8771('0x27')]['rawAttributes'],function(_0x4c687c){return{'name':_0x4c687c[_0x8771('0x28')],'type':_0x4c687c[_0x8771('0x29')]['key']};});_0x59b347[_0x8771('0x2a')]=_[_0x8771('0x2b')](_0x1cd787,_0x8771('0x24'));_0x59b347[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x4bc631['query']);_0x59b347[_0x8771('0x2e')]=_[_0x8771('0x2f')](_0x59b347[_0x8771('0x2a')],_0x59b347['query']);_0x1d0243[_0x8771('0x30')]=_[_0x8771('0x2f')](_0x59b347[_0x8771('0x2a')],qs[_0x8771('0x31')](_0x4bc631['query'][_0x8771('0x31')]));_0x1d0243[_0x8771('0x30')]=_0x1d0243['attributes']['length']?_0x1d0243[_0x8771('0x30')]:_0x59b347[_0x8771('0x2a')];if(!_0x4bc631[_0x8771('0x2c')][_0x8771('0x32')]('nolimit')){_0x1d0243['limit']=qs['limit'](_0x4bc631[_0x8771('0x2c')]['limit']);_0x1d0243[_0x8771('0x19')]=qs[_0x8771('0x19')](_0x4bc631[_0x8771('0x2c')]['offset']);}_0x1d0243[_0x8771('0x33')]=qs[_0x8771('0x34')](_0x4bc631[_0x8771('0x2c')][_0x8771('0x34')]);_0x1d0243[_0x8771('0x35')]=qs[_0x8771('0x2e')](_['pick'](_0x4bc631[_0x8771('0x2c')],_0x59b347[_0x8771('0x2e')]),_0x1cd787);if(_0x4bc631['query'][_0x8771('0x36')]){_0x1d0243[_0x8771('0x35')]=_[_0x8771('0x37')](_0x1d0243[_0x8771('0x35')],{'$or':_['map'](_0x1cd787,function(_0x4fa255){if(_0x4fa255['type']!=='VIRTUAL'){var _0x31c9c2={};_0x31c9c2[_0x4fa255['name']]={'$like':'%'+_0x4bc631[_0x8771('0x2c')][_0x8771('0x36')]+'%'};return _0x31c9c2;}})});}_0x1d0243=_[_0x8771('0x37')]({},_0x1d0243,_0x4bc631[_0x8771('0x38')]);var _0x102ac6={'where':_0x1d0243[_0x8771('0x35')]};return db['FreshdeskConfiguration'][_0x8771('0x1c')](_0x102ac6)[_0x8771('0x22')](function(_0x31ead3){_0xf96601[_0x8771('0x1c')]=_0x31ead3;if(_0x4bc631['query'][_0x8771('0x39')]){_0x1d0243['include']=[{'all':!![]}];}return db[_0x8771('0x27')][_0x8771('0x3a')](_0x1d0243);})['then'](function(_0x348fc5){_0xf96601['rows']=_0x348fc5;return _0xf96601;})[_0x8771('0x22')](respondWithFilteredResult(_0x32049d,_0x1d0243))[_0x8771('0x3b')](handleError(_0x32049d,null));};exports[_0x8771('0x3c')]=function(_0x2004f4,_0x49dfaf){var _0x3cc7be={'raw':![],'where':{'id':_0x2004f4['params']['id']}},_0x4bc10a={};_0x4bc10a[_0x8771('0x2a')]=_[_0x8771('0x2d')](db[_0x8771('0x27')][_0x8771('0x3d')]);_0x4bc10a[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x2004f4['query']);_0x4bc10a[_0x8771('0x2e')]=_[_0x8771('0x2f')](_0x4bc10a[_0x8771('0x2a')],_0x4bc10a['query']);_0x3cc7be[_0x8771('0x30')]=_[_0x8771('0x2f')](_0x4bc10a[_0x8771('0x2a')],qs['fields'](_0x2004f4['query']['fields']));_0x3cc7be['attributes']=_0x3cc7be[_0x8771('0x30')][_0x8771('0x3e')]?_0x3cc7be[_0x8771('0x30')]:_0x4bc10a[_0x8771('0x2a')];if(_0x2004f4[_0x8771('0x2c')][_0x8771('0x39')]){_0x3cc7be[_0x8771('0x3f')]=[{'all':!![]}];}_0x3cc7be=_[_0x8771('0x37')]({},_0x3cc7be,_0x2004f4[_0x8771('0x38')]);return db[_0x8771('0x27')][_0x8771('0x40')](_0x3cc7be)[_0x8771('0x22')](handleEntityNotFound(_0x49dfaf,null))['then'](respondWithResult(_0x49dfaf,null))[_0x8771('0x3b')](handleError(_0x49dfaf,null));};exports[_0x8771('0x41')]=function(_0x139742,_0x224afd){return db[_0x8771('0x27')][_0x8771('0x41')](_0x139742['body'],{})[_0x8771('0x22')](respondWithResult(_0x224afd,0xc9))[_0x8771('0x3b')](handleError(_0x224afd,null));};exports['update']=function(_0x58ca35,_0x2c2add){if(_0x58ca35[_0x8771('0x42')]['id']){delete _0x58ca35[_0x8771('0x42')]['id'];}return db['FreshdeskConfiguration'][_0x8771('0x40')]({'where':{'id':_0x58ca35['params']['id']}})[_0x8771('0x22')](handleEntityNotFound(_0x2c2add,null))['then'](saveUpdates(_0x58ca35['body'],null))[_0x8771('0x22')](respondWithResult(_0x2c2add,null))[_0x8771('0x3b')](handleError(_0x2c2add,null));};exports[_0x8771('0x21')]=function(_0x12102f,_0x14043a){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x12102f[_0x8771('0x43')]['id']}})['then'](handleEntityNotFound(_0x14043a,null))[_0x8771('0x22')](removeEntity(_0x14043a,null))[_0x8771('0x3b')](handleError(_0x14043a,null));};exports[_0x8771('0x44')]=function(_0x43f570,_0x247dcf,_0x41d03b){var _0x26a10a={};var _0x233444={};var _0x4013dd;var _0x14cf78;return db[_0x8771('0x27')]['findOne']({'where':{'id':_0x43f570[_0x8771('0x43')]['id']}})[_0x8771('0x22')](handleEntityNotFound(_0x247dcf,null))[_0x8771('0x22')](function(_0x400944){if(_0x400944){_0x4013dd=_0x400944;_0x233444['model']=_[_0x8771('0x2d')](db[_0x8771('0x45')][_0x8771('0x3d')]);_0x233444[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x43f570[_0x8771('0x2c')]);_0x233444[_0x8771('0x2e')]=_['intersection'](_0x233444[_0x8771('0x2a')],_0x233444[_0x8771('0x2c')]);_0x26a10a[_0x8771('0x30')]=_[_0x8771('0x2f')](_0x233444[_0x8771('0x2a')],qs['fields'](_0x43f570['query'][_0x8771('0x31')]));_0x26a10a[_0x8771('0x30')]=_0x26a10a[_0x8771('0x30')][_0x8771('0x3e')]?_0x26a10a['attributes']:_0x233444[_0x8771('0x2a')];_0x26a10a[_0x8771('0x33')]=qs['sort'](_0x43f570['query'][_0x8771('0x34')]);_0x26a10a[_0x8771('0x35')]=qs[_0x8771('0x2e')](_['pick'](_0x43f570[_0x8771('0x2c')],_0x233444[_0x8771('0x2e')]));if(_0x43f570['query'][_0x8771('0x36')]){_0x26a10a[_0x8771('0x35')]=_[_0x8771('0x37')](_0x26a10a[_0x8771('0x35')],{'$or':_['map'](_0x26a10a[_0x8771('0x30')],function(_0x5bd6cf){var _0x2d8959={};_0x2d8959[_0x5bd6cf]={'$like':'%'+_0x43f570[_0x8771('0x2c')][_0x8771('0x36')]+'%'};return _0x2d8959;})});}_0x26a10a=_[_0x8771('0x37')]({},_0x26a10a,_0x43f570[_0x8771('0x38')]);return _0x4013dd[_0x8771('0x44')](_0x26a10a);}})[_0x8771('0x22')](function(_0x3707a1){if(_0x3707a1){_0x14cf78=_0x3707a1[_0x8771('0x3e')];if(!_0x43f570['query'][_0x8771('0x32')](_0x8771('0x46'))){_0x26a10a['limit']=qs[_0x8771('0x1b')](_0x43f570[_0x8771('0x2c')][_0x8771('0x1b')]);_0x26a10a[_0x8771('0x19')]=qs[_0x8771('0x19')](_0x43f570['query'][_0x8771('0x19')]);}return _0x4013dd['getFields'](_0x26a10a);}})[_0x8771('0x22')](function(_0x5b3ec7){if(_0x5b3ec7){return _0x5b3ec7?{'count':_0x14cf78,'rows':_0x5b3ec7}:null;}})['then'](respondWithResult(_0x247dcf,null))[_0x8771('0x3b')](handleError(_0x247dcf,null));};exports[_0x8771('0x47')]=function(_0x66d911,_0x2d3217,_0x2b7e4b){var _0x4dd925={};var _0x4aa710={};var _0x4e5e7d;var _0x221815;return db[_0x8771('0x27')][_0x8771('0x48')]({'where':{'id':_0x66d911[_0x8771('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d3217,null))[_0x8771('0x22')](function(_0x20f9d1){if(_0x20f9d1){_0x4e5e7d=_0x20f9d1;_0x4aa710[_0x8771('0x2a')]=_[_0x8771('0x2d')](db['FreshdeskField'][_0x8771('0x3d')]);_0x4aa710[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x66d911[_0x8771('0x2c')]);_0x4aa710[_0x8771('0x2e')]=_['intersection'](_0x4aa710[_0x8771('0x2a')],_0x4aa710['query']);_0x4dd925[_0x8771('0x30')]=_['intersection'](_0x4aa710[_0x8771('0x2a')],qs['fields'](_0x66d911['query'][_0x8771('0x31')]));_0x4dd925['attributes']=_0x4dd925[_0x8771('0x30')]['length']?_0x4dd925['attributes']:_0x4aa710[_0x8771('0x2a')];_0x4dd925[_0x8771('0x33')]=qs['sort'](_0x66d911['query'][_0x8771('0x34')]);_0x4dd925[_0x8771('0x35')]=qs[_0x8771('0x2e')](_[_0x8771('0x49')](_0x66d911[_0x8771('0x2c')],_0x4aa710[_0x8771('0x2e')]));if(_0x66d911[_0x8771('0x2c')][_0x8771('0x36')]){_0x4dd925['where']=_['merge'](_0x4dd925[_0x8771('0x35')],{'$or':_[_0x8771('0x2b')](_0x4dd925[_0x8771('0x30')],function(_0x1c5da5){var _0x511db1={};_0x511db1[_0x1c5da5]={'$like':'%'+_0x66d911[_0x8771('0x2c')][_0x8771('0x36')]+'%'};return _0x511db1;})});}_0x4dd925=_['merge']({},_0x4dd925,_0x66d911[_0x8771('0x38')]);return _0x4e5e7d[_0x8771('0x47')](_0x4dd925);}})['then'](function(_0x21d570){if(_0x21d570){_0x221815=_0x21d570['length'];if(!_0x66d911[_0x8771('0x2c')][_0x8771('0x32')]('nolimit')){_0x4dd925[_0x8771('0x1b')]=qs[_0x8771('0x1b')](_0x66d911[_0x8771('0x2c')]['limit']);_0x4dd925[_0x8771('0x19')]=qs[_0x8771('0x19')](_0x66d911[_0x8771('0x2c')][_0x8771('0x19')]);}return _0x4e5e7d['getSubjects'](_0x4dd925);}})[_0x8771('0x22')](function(_0x2292a1){if(_0x2292a1){return _0x2292a1?{'count':_0x221815,'rows':_0x2292a1}:null;}})[_0x8771('0x22')](respondWithResult(_0x2d3217,null))[_0x8771('0x3b')](handleError(_0x2d3217,null));};exports[_0x8771('0x4a')]=function(_0x592155,_0x955eae,_0x33d6eb){var _0x364542={};var _0xa0db00={};var _0x4bc217;var _0x42a1e1;return db[_0x8771('0x27')][_0x8771('0x48')]({'where':{'id':_0x592155[_0x8771('0x43')]['id']}})[_0x8771('0x22')](handleEntityNotFound(_0x955eae,null))[_0x8771('0x22')](function(_0x2ad00a){if(_0x2ad00a){_0x4bc217=_0x2ad00a;_0xa0db00[_0x8771('0x2a')]=_[_0x8771('0x2d')](db[_0x8771('0x45')][_0x8771('0x3d')]);_0xa0db00[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x592155[_0x8771('0x2c')]);_0xa0db00[_0x8771('0x2e')]=_['intersection'](_0xa0db00[_0x8771('0x2a')],_0xa0db00[_0x8771('0x2c')]);_0x364542[_0x8771('0x30')]=_[_0x8771('0x2f')](_0xa0db00[_0x8771('0x2a')],qs[_0x8771('0x31')](_0x592155[_0x8771('0x2c')]['fields']));_0x364542['attributes']=_0x364542[_0x8771('0x30')][_0x8771('0x3e')]?_0x364542[_0x8771('0x30')]:_0xa0db00[_0x8771('0x2a')];_0x364542['order']=qs[_0x8771('0x34')](_0x592155[_0x8771('0x2c')][_0x8771('0x34')]);_0x364542['where']=qs[_0x8771('0x2e')](_[_0x8771('0x49')](_0x592155['query'],_0xa0db00[_0x8771('0x2e')]));if(_0x592155[_0x8771('0x2c')][_0x8771('0x36')]){_0x364542[_0x8771('0x35')]=_[_0x8771('0x37')](_0x364542[_0x8771('0x35')],{'$or':_[_0x8771('0x2b')](_0x364542['attributes'],function(_0x4bb04c){var _0x5ec6b2={};_0x5ec6b2[_0x4bb04c]={'$like':'%'+_0x592155['query']['filter']+'%'};return _0x5ec6b2;})});}_0x364542=_[_0x8771('0x37')]({},_0x364542,_0x592155[_0x8771('0x38')]);return _0x4bc217['getDescriptions'](_0x364542);}})['then'](function(_0x3620bc){if(_0x3620bc){_0x42a1e1=_0x3620bc[_0x8771('0x3e')];if(!_0x592155[_0x8771('0x2c')][_0x8771('0x32')](_0x8771('0x46'))){_0x364542[_0x8771('0x1b')]=qs[_0x8771('0x1b')](_0x592155['query'][_0x8771('0x1b')]);_0x364542[_0x8771('0x19')]=qs[_0x8771('0x19')](_0x592155[_0x8771('0x2c')]['offset']);}return _0x4bc217[_0x8771('0x4a')](_0x364542);}})[_0x8771('0x22')](function(_0x1170a2){if(_0x1170a2){return _0x1170a2?{'count':_0x42a1e1,'rows':_0x1170a2}:null;}})[_0x8771('0x22')](respondWithResult(_0x955eae,null))['catch'](handleError(_0x955eae,null));};exports[_0x8771('0x4b')]=function(_0x102374,_0x3c8b88,_0x542e7e){var _0x43afdf={};var _0xa9c066={};var _0x389158;var _0x2f3779;return db['FreshdeskConfiguration'][_0x8771('0x48')]({'where':{'id':_0x102374[_0x8771('0x43')]['id']}})[_0x8771('0x22')](handleEntityNotFound(_0x3c8b88,null))[_0x8771('0x22')](function(_0x4caf5d){if(_0x4caf5d){_0x389158=_0x4caf5d;_0xa9c066[_0x8771('0x2a')]=_['keys'](db[_0x8771('0x4c')]['rawAttributes']);_0xa9c066[_0x8771('0x2c')]=_[_0x8771('0x2d')](_0x102374[_0x8771('0x2c')]);_0xa9c066[_0x8771('0x2e')]=_[_0x8771('0x2f')](_0xa9c066[_0x8771('0x2a')],_0xa9c066[_0x8771('0x2c')]);_0x43afdf[_0x8771('0x30')]=_['intersection'](_0xa9c066['model'],qs[_0x8771('0x31')](_0x102374[_0x8771('0x2c')][_0x8771('0x31')]));_0x43afdf['attributes']=_0x43afdf[_0x8771('0x30')][_0x8771('0x3e')]?_0x43afdf[_0x8771('0x30')]:_0xa9c066['model'];_0x43afdf['order']=qs[_0x8771('0x34')](_0x102374[_0x8771('0x2c')][_0x8771('0x34')]);_0x43afdf[_0x8771('0x35')]=qs[_0x8771('0x2e')](_[_0x8771('0x49')](_0x102374[_0x8771('0x2c')],_0xa9c066[_0x8771('0x2e')]));if(_0x102374['query'][_0x8771('0x36')]){_0x43afdf[_0x8771('0x35')]=_[_0x8771('0x37')](_0x43afdf[_0x8771('0x35')],{'$or':_[_0x8771('0x2b')](_0x43afdf[_0x8771('0x30')],function(_0x326625){var _0x473e32={};_0x473e32[_0x326625]={'$like':'%'+_0x102374[_0x8771('0x2c')][_0x8771('0x36')]+'%'};return _0x473e32;})});}_0x43afdf=_['merge']({},_0x43afdf,_0x102374[_0x8771('0x38')]);return _0x389158[_0x8771('0x4b')](_0x43afdf);}})['then'](function(_0x3cb7db){if(_0x3cb7db){_0x2f3779=_0x3cb7db['length'];if(!_0x102374[_0x8771('0x2c')]['hasOwnProperty'](_0x8771('0x46'))){_0x43afdf[_0x8771('0x1b')]=qs[_0x8771('0x1b')](_0x102374[_0x8771('0x2c')]['limit']);_0x43afdf[_0x8771('0x19')]=qs[_0x8771('0x19')](_0x102374[_0x8771('0x2c')]['offset']);}return _0x389158['getTags'](_0x43afdf);}})[_0x8771('0x22')](function(_0x580f24){if(_0x580f24){return _0x580f24?{'count':_0x2f3779,'rows':_0x580f24}:null;}})['then'](respondWithResult(_0x3c8b88,null))['catch'](handleError(_0x3c8b88,null));};exports[_0x8771('0x4d')]=function(_0x16fcf,_0x5377d5,_0x512714){if(_0x16fcf['body']['id']){delete _0x16fcf[_0x8771('0x42')]['id'];}return db[_0x8771('0x27')][_0x8771('0x48')]({'where':{'id':_0x16fcf['params']['id']}})[_0x8771('0x22')](handleEntityNotFound(_0x5377d5,null))['then'](function(_0x24baed){if(_0x24baed){return _0x24baed[_0x8771('0x4d')](_0x16fcf[_0x8771('0x42')][_0x8771('0x4e')]||[]);}return null;})[_0x8771('0x22')](respondWithResult(_0x5377d5,null))['catch'](handleError(_0x5377d5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 330ee42..cd2e51f 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 _0x9f83=['rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','api','moment','bluebird','path'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x9f83,0x1df));var _0x39f8=function(_0x17f039,_0x247e87){_0x17f039=_0x17f039-0x0;var _0x4feb30=_0x9f83[_0x17f039];return _0x4feb30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x39f8('0x0'))(_0x39f8('0x1'));var moment=require(_0x39f8('0x2'));var BPromise=require(_0x39f8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39f8('0x4'));var rimraf=require(_0x39f8('0x5'));var config=require('../../config/environment');var attributes=require(_0x39f8('0x6'));module[_0x39f8('0x7')]=function(_0x36da7f,_0x168766){return _0x36da7f[_0x39f8('0x8')](_0x39f8('0x9'),attributes,{'tableName':_0x39f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe491=['util','../../config/logger','api','moment','bluebird','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x26e69b,_0xcdb05a){var _0x3648a1=function(_0x32bd22){while(--_0x32bd22){_0x26e69b['push'](_0x26e69b['shift']());}};_0x3648a1(++_0xcdb05a);}(_0xe491,0x197));var _0x1e49=function(_0xed8148,_0x54464d){_0xed8148=_0xed8148-0x0;var _0x16bbcc=_0xe491[_0xed8148];return _0x16bbcc;};'use strict';var _=require(_0x1e49('0x0'));var util=require(_0x1e49('0x1'));var logger=require(_0x1e49('0x2'))(_0x1e49('0x3'));var moment=require(_0x1e49('0x4'));var BPromise=require(_0x1e49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e49('0x6'));var config=require('../../config/environment');var attributes=require(_0x1e49('0x7'));module[_0x1e49('0x8')]=function(_0x5d631b,_0x5b8433){return _0x5d631b[_0x1e49('0x9')](_0x1e49('0xa'),attributes,{'tableName':_0x1e49('0xb'),'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 2ddf5db..8735c59 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 _0xda47=['FreshdeskConfiguration,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x5e2fa5,_0x2e9a38){var _0xc04184=function(_0x49813c){while(--_0x49813c){_0x5e2fa5['push'](_0x5e2fa5['shift']());}};_0xc04184(++_0x2e9a38);}(_0xda47,0x6b));var _0x7da4=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0xda47[_0x9b7a64];return _0x33fd98;};'use strict';var _=require(_0x7da4('0x0'));var util=require(_0x7da4('0x1'));var moment=require(_0x7da4('0x2'));var BPromise=require(_0x7da4('0x3'));var rs=require(_0x7da4('0x4'));var fs=require('fs');var Redis=require(_0x7da4('0x5'));var db=require(_0x7da4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7da4('0x7'))('rpc');var config=require(_0x7da4('0x8'));var jayson=require(_0x7da4('0x9'));var client=jayson[_0x7da4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d122a,_0x3f8dc9,_0x266144){return new BPromise(function(_0x5b3862,_0x5bd6b2){return client[_0x7da4('0xb')](_0x1d122a,_0x266144)[_0x7da4('0xc')](function(_0x5f3331){logger['info'](_0x7da4('0xd'),_0x3f8dc9,'request\x20sent');logger[_0x7da4('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3f8dc9,'request\x20sent',JSON['stringify'](_0x5f3331));if(_0x5f3331[_0x7da4('0xf')]){if(_0x5f3331[_0x7da4('0xf')]['code']===0x1f4){logger['error'](_0x7da4('0xd'),_0x3f8dc9,_0x5f3331[_0x7da4('0xf')][_0x7da4('0x10')]);return _0x5bd6b2(_0x5f3331[_0x7da4('0xf')][_0x7da4('0x10')]);}logger[_0x7da4('0xf')](_0x7da4('0xd'),_0x3f8dc9,_0x5f3331[_0x7da4('0xf')][_0x7da4('0x10')]);return _0x5b3862(_0x5f3331['error']['message']);}else{logger['info'](_0x7da4('0xd'),_0x3f8dc9,_0x7da4('0x11'));_0x5b3862(_0x5f3331[_0x7da4('0x12')][_0x7da4('0x10')]);}})[_0x7da4('0x13')](function(_0x2a282f){logger[_0x7da4('0xf')](_0x7da4('0xd'),_0x3f8dc9,_0x2a282f);_0x5bd6b2(_0x2a282f);});});} \ No newline at end of file +var _0x2fdd=['moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0xce77c8,_0x41931d){var _0x5bfc85=function(_0xa8753a){while(--_0xa8753a){_0xce77c8['push'](_0xce77c8['shift']());}};_0x5bfc85(++_0x41931d);}(_0x2fdd,0x1a2));var _0xd2fd=function(_0x127996,_0x1a85f3){_0x127996=_0x127996-0x0;var _0x3ea21e=_0x2fdd[_0x127996];return _0x3ea21e;};'use strict';var _=require(_0xd2fd('0x0'));var util=require(_0xd2fd('0x1'));var moment=require(_0xd2fd('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2fd('0x3'));var fs=require('fs');var Redis=require(_0xd2fd('0x4'));var db=require(_0xd2fd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd2fd('0x6'));var jayson=require(_0xd2fd('0x7'));var client=jayson[_0xd2fd('0x8')][_0xd2fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x102a1e,_0x4a5ad1,_0x436723){return new BPromise(function(_0x5d99ca,_0x440d11){return client['request'](_0x102a1e,_0x436723)[_0xd2fd('0xa')](function(_0x35a545){logger['info'](_0xd2fd('0xb'),_0x4a5ad1,_0xd2fd('0xc'));logger['debug'](_0xd2fd('0xd'),_0x4a5ad1,_0xd2fd('0xc'),JSON[_0xd2fd('0xe')](_0x35a545));if(_0x35a545[_0xd2fd('0xf')]){if(_0x35a545[_0xd2fd('0xf')]['code']===0x1f4){logger[_0xd2fd('0xf')](_0xd2fd('0xb'),_0x4a5ad1,_0x35a545[_0xd2fd('0xf')][_0xd2fd('0x10')]);return _0x440d11(_0x35a545[_0xd2fd('0xf')]['message']);}logger[_0xd2fd('0xf')](_0xd2fd('0xb'),_0x4a5ad1,_0x35a545[_0xd2fd('0xf')][_0xd2fd('0x10')]);return _0x5d99ca(_0x35a545[_0xd2fd('0xf')][_0xd2fd('0x10')]);}else{logger[_0xd2fd('0x11')](_0xd2fd('0xb'),_0x4a5ad1,_0xd2fd('0xc'));_0x5d99ca(_0x35a545[_0xd2fd('0x12')][_0xd2fd('0x10')]);}})[_0xd2fd('0x13')](function(_0x54010b){logger[_0xd2fd('0xf')](_0xd2fd('0xb'),_0x4a5ad1,_0x54010b);_0x440d11(_0x54010b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c1f897e..ca269c2 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 _0x5cf2=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5cf2,0x18f));var _0x25cf=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0x5cf2[_0x1b5a5a];return _0x42b32d;};'use strict';var multer=require('multer');var util=require(_0x25cf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x25cf('0x1'));var router=express['Router']();var fs_extra=require(_0x25cf('0x2'));var auth=require(_0x25cf('0x3'));var interaction=require(_0x25cf('0x4'));var config=require(_0x25cf('0x5'));var controller=require(_0x25cf('0x6'));router[_0x25cf('0x7')]('/',auth[_0x25cf('0x8')](),controller[_0x25cf('0x9')]);router[_0x25cf('0x7')](_0x25cf('0xa'),auth[_0x25cf('0x8')](),controller[_0x25cf('0xb')]);router[_0x25cf('0xc')]('/',auth[_0x25cf('0x8')](),controller[_0x25cf('0xd')]);router[_0x25cf('0xe')](_0x25cf('0xa'),auth[_0x25cf('0x8')](),controller[_0x25cf('0xf')]);router[_0x25cf('0x10')](_0x25cf('0xa'),auth[_0x25cf('0x8')](),controller[_0x25cf('0x11')]);module[_0x25cf('0x12')]=router; \ No newline at end of file +var _0xfba9=['create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x36b72d,_0x589e01){var _0x16d057=function(_0x49e194){while(--_0x49e194){_0x36b72d['push'](_0x36b72d['shift']());}};_0x16d057(++_0x589e01);}(_0xfba9,0x1d2));var _0x9fba=function(_0x4fbd61,_0x4d0605){_0x4fbd61=_0x4fbd61-0x0;var _0x579ea5=_0xfba9[_0x4fbd61];return _0x579ea5;};'use strict';var multer=require('multer');var util=require(_0x9fba('0x0'));var path=require(_0x9fba('0x1'));var timeout=require(_0x9fba('0x2'));var express=require(_0x9fba('0x3'));var router=express[_0x9fba('0x4')]();var fs_extra=require(_0x9fba('0x5'));var auth=require(_0x9fba('0x6'));var interaction=require(_0x9fba('0x7'));var config=require('../../config/environment');var controller=require(_0x9fba('0x8'));router[_0x9fba('0x9')]('/',auth[_0x9fba('0xa')](),controller[_0x9fba('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9fba('0xc')]);router[_0x9fba('0xd')]('/',auth[_0x9fba('0xa')](),controller[_0x9fba('0xe')]);router[_0x9fba('0xf')](_0x9fba('0x10'),auth[_0x9fba('0xa')](),controller[_0x9fba('0x11')]);router[_0x9fba('0x12')]('/:id',auth[_0x9fba('0xa')](),controller[_0x9fba('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index a81be0a..a8c8838 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 _0xcfb5=['exports','string','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0xcfb5,0xa7));var _0x5cfb=function(_0x38580d,_0x3854aa){_0x38580d=_0x38580d-0x0;var _0x2391bc=_0xcfb5[_0x38580d];return _0x2391bc;};'use strict';var Sequelize=require(_0x5cfb('0x0'));module[_0x5cfb('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5cfb('0x2'),'variable',_0x5cfb('0x3'),'keyValue',_0x5cfb('0x4')),'defaultValue':_0x5cfb('0x2')},'content':{'type':Sequelize[_0x5cfb('0x5')]},'key':{'type':Sequelize[_0x5cfb('0x5')]},'keyType':{'type':Sequelize[_0x5cfb('0x6')]('string','variable',_0x5cfb('0x3'))},'keyContent':{'type':Sequelize[_0x5cfb('0x5')]},'idField':{'type':Sequelize[_0x5cfb('0x5')]},'nameField':{'type':Sequelize[_0x5cfb('0x5')]},'customField':{'type':Sequelize[_0x5cfb('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5cfb('0x5')]}}; \ No newline at end of file +var _0xc99c=['picklist','STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x5e3bb1,_0x3cfe7c){var _0x4c1278=function(_0x124955){while(--_0x124955){_0x5e3bb1['push'](_0x5e3bb1['shift']());}};_0x4c1278(++_0x3cfe7c);}(_0xc99c,0x174));var _0xcc99=function(_0x4550a0,_0x3abd86){_0x4550a0=_0x4550a0-0x0;var _0x42246b=_0xc99c[_0x4550a0];return _0x42246b;};'use strict';var Sequelize=require(_0xcc99('0x0'));module[_0xcc99('0x1')]={'type':{'type':Sequelize[_0xcc99('0x2')](_0xcc99('0x3'),'variable',_0xcc99('0x4'),_0xcc99('0x5'),_0xcc99('0x6')),'defaultValue':_0xcc99('0x3')},'content':{'type':Sequelize[_0xcc99('0x7')]},'key':{'type':Sequelize[_0xcc99('0x7')]},'keyType':{'type':Sequelize[_0xcc99('0x2')](_0xcc99('0x3'),_0xcc99('0x8'),_0xcc99('0x4'))},'keyContent':{'type':Sequelize[_0xcc99('0x7')]},'idField':{'type':Sequelize[_0xcc99('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcc99('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6649fc5..e20326b 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 _0xe605=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x44b8fb,_0x2b6512){var _0x4952d6=function(_0x1db20e){while(--_0x1db20e){_0x44b8fb['push'](_0x44b8fb['shift']());}};_0x4952d6(++_0x2b6512);}(_0xe605,0x92));var _0x5e60=function(_0x302844,_0x373c97){_0x302844=_0x302844-0x0;var _0x5e171e=_0xe605[_0x302844];return _0x5e171e;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2a499e[_0x5e60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x19')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x1a')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=_[_0x5e60('0x2c')](db[_0x5e60('0x2d')][_0x5e60('0x2e')],function(_0x558197){return{'name':_0x558197[_0x5e60('0x2f')],'type':_0x558197[_0x5e60('0x30')]['key']};});_0x52f668[_0x5e60('0x31')]=_['map'](_0x235cc7,'name');_0x52f668[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0xac9c7a[_0x5e60('0x32')]);_0x52f668[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],_0x52f668[_0x5e60('0x32')]);_0x5431a8[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],qs['fields'](_0xac9c7a[_0x5e60('0x32')]['fields']));_0x5431a8['attributes']=_0x5431a8[_0x5e60('0x36')][_0x5e60('0x37')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x31')];if(!_0xac9c7a['query'][_0x5e60('0x38')](_0x5e60('0x39'))){_0x5431a8[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x1e')]);_0x5431a8[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0xac9c7a['query'][_0x5e60('0x1d')]);}_0x5431a8[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3b')]);_0x5431a8[_0x5e60('0x3c')]=qs[_0x5e60('0x34')](_['pick'](_0xac9c7a[_0x5e60('0x32')],_0x52f668[_0x5e60('0x34')]),_0x235cc7);if(_0xac9c7a['query']['filter']){_0x5431a8[_0x5e60('0x3c')]=_[_0x5e60('0x3d')](_0x5431a8[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2c')](_0x235cc7,function(_0x31b900){if(_0x31b900['type']!==_0x5e60('0x3e')){var _0x413bf0={};_0x413bf0[_0x31b900[_0x5e60('0x2a')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3f')]+'%'};return _0x413bf0;}})});}_0x5431a8=_[_0x5e60('0x3d')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x40')]);var _0x54022a={'where':_0x5431a8[_0x5e60('0x3c')]};return db[_0x5e60('0x2d')]['count'](_0x54022a)['then'](function(_0x47a6df){_0xf25956[_0x5e60('0x20')]=_0x47a6df;if(_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x41')]){_0x5431a8[_0x5e60('0x42')]=[{'all':!![]}];}return db['FreshdeskField'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x26')](function(_0x4b6192){_0xf25956['rows']=_0x4b6192;return _0xf25956;})[_0x5e60('0x26')](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x44')](handleError(_0x52c97c,null));};exports[_0x5e60('0x45')]=function(_0x38ff1d,_0x39ab09){var _0x3899ae={'raw':!![],'where':{'id':_0x38ff1d[_0x5e60('0x46')]['id']}},_0x2522d2={};_0x2522d2[_0x5e60('0x31')]=_['keys'](db[_0x5e60('0x2d')][_0x5e60('0x2e')]);_0x2522d2['query']=_[_0x5e60('0x33')](_0x38ff1d[_0x5e60('0x32')]);_0x2522d2[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],_0x2522d2['query']);_0x3899ae[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],qs[_0x5e60('0x47')](_0x38ff1d['query']['fields']));_0x3899ae['attributes']=_0x3899ae[_0x5e60('0x36')][_0x5e60('0x37')]?_0x3899ae[_0x5e60('0x36')]:_0x2522d2[_0x5e60('0x31')];if(_0x38ff1d[_0x5e60('0x32')][_0x5e60('0x41')]){_0x3899ae['include']=[{'all':!![]}];}_0x3899ae=_[_0x5e60('0x3d')]({},_0x3899ae,_0x38ff1d[_0x5e60('0x40')]);return db[_0x5e60('0x2d')][_0x5e60('0x48')](_0x3899ae)[_0x5e60('0x26')](handleEntityNotFound(_0x39ab09,null))[_0x5e60('0x26')](respondWithResult(_0x39ab09,null))[_0x5e60('0x44')](handleError(_0x39ab09,null));};exports['create']=function(_0x24c757,_0x3ed45d){return db[_0x5e60('0x2d')][_0x5e60('0x49')](_0x24c757[_0x5e60('0x4a')],{})[_0x5e60('0x26')](respondWithResult(_0x3ed45d,0xc9))[_0x5e60('0x44')](handleError(_0x3ed45d,null));};exports[_0x5e60('0x25')]=function(_0x1518bd,_0x350d6d){if(_0x1518bd[_0x5e60('0x4a')]['id']){delete _0x1518bd[_0x5e60('0x4a')]['id'];}return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x1518bd[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x350d6d,null))[_0x5e60('0x26')](saveUpdates(_0x1518bd[_0x5e60('0x4a')],null))['then'](respondWithResult(_0x350d6d,null))['catch'](handleError(_0x350d6d,null));};exports[_0x5e60('0x27')]=function(_0x4d3588,_0x3525d){return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x4d3588[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x3525d,null))[_0x5e60('0x26')](removeEntity(_0x3525d,null))['catch'](handleError(_0x3525d,null));}; \ No newline at end of file +var _0xd87e=['request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch'];(function(_0x549d5b,_0x52d808){var _0x2f9cc6=function(_0x115d2f){while(--_0x115d2f){_0x549d5b['push'](_0x549d5b['shift']());}};_0x2f9cc6(++_0x52d808);}(_0xd87e,0x1bf));var _0xed87=function(_0x3132c4,_0x321a8d){_0x3132c4=_0x3132c4-0x0;var _0xb0d3c=_0xd87e[_0x3132c4];return _0xb0d3c;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['index']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={},_0x3dff74={},_0x33c367={'count':0x0,'rows':[]};var _0x21c93b=_['map'](db['FreshdeskField'][_0xed87('0x29')],function(_0x428b75){return{'name':_0x428b75[_0xed87('0x2a')],'type':_0x428b75['type'][_0xed87('0x2b')]};});_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0x21c93b,_0xed87('0x27'));_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0xb32b1c[_0xed87('0x2e')]);_0x3dff74[_0xed87('0x30')]=_[_0xed87('0x31')](_0x3dff74['model'],_0x3dff74[_0xed87('0x2e')]);_0x4eaa44[_0xed87('0x32')]=_['intersection'](_0x3dff74[_0xed87('0x2c')],qs['fields'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x4eaa44[_0xed87('0x32')]=_0x4eaa44[_0xed87('0x32')][_0xed87('0x34')]?_0x4eaa44[_0xed87('0x32')]:_0x3dff74[_0xed87('0x2c')];if(!_0xb32b1c[_0xed87('0x2e')][_0xed87('0x35')](_0xed87('0x36'))){_0x4eaa44[_0xed87('0x1e')]=qs['limit'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x1e')]);_0x4eaa44['offset']=qs[_0xed87('0x1c')](_0xb32b1c['query'][_0xed87('0x1c')]);}_0x4eaa44[_0xed87('0x37')]=qs['sort'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x38')]);_0x4eaa44[_0xed87('0x39')]=qs[_0xed87('0x30')](_[_0xed87('0x3a')](_0xb32b1c['query'],_0x3dff74[_0xed87('0x30')]),_0x21c93b);if(_0xb32b1c['query'][_0xed87('0x3b')]){_0x4eaa44['where']=_[_0xed87('0x3c')](_0x4eaa44[_0xed87('0x39')],{'$or':_[_0xed87('0x2d')](_0x21c93b,function(_0x217435){if(_0x217435[_0xed87('0x3d')]!==_0xed87('0x3e')){var _0x9e3356={};_0x9e3356[_0x217435[_0xed87('0x27')]]={'$like':'%'+_0xb32b1c[_0xed87('0x2e')]['filter']+'%'};return _0x9e3356;}})});}_0x4eaa44=_['merge']({},_0x4eaa44,_0xb32b1c[_0xed87('0x3f')]);var _0x206544={'where':_0x4eaa44[_0xed87('0x39')]};return db[_0xed87('0x40')][_0xed87('0x1f')](_0x206544)[_0xed87('0x23')](function(_0x5d1bd0){_0x33c367[_0xed87('0x1f')]=_0x5d1bd0;if(_0xb32b1c[_0xed87('0x2e')][_0xed87('0x41')]){_0x4eaa44['include']=[{'all':!![]}];}return db[_0xed87('0x40')][_0xed87('0x42')](_0x4eaa44);})[_0xed87('0x23')](function(_0x1b0092){_0x33c367[_0xed87('0x43')]=_0x1b0092;return _0x33c367;})[_0xed87('0x23')](respondWithFilteredResult(_0x1c4a65,_0x4eaa44))[_0xed87('0x44')](handleError(_0x1c4a65,null));};exports[_0xed87('0x45')]=function(_0x35bd1c,_0x406b73){var _0x5c6925={'raw':!![],'where':{'id':_0x35bd1c[_0xed87('0x46')]['id']}},_0x7e6cbb={};_0x7e6cbb[_0xed87('0x2c')]=_['keys'](db['FreshdeskField'][_0xed87('0x29')]);_0x7e6cbb[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x35bd1c[_0xed87('0x2e')]);_0x7e6cbb['filters']=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],_0x7e6cbb['query']);_0x5c6925[_0xed87('0x32')]=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],qs[_0xed87('0x33')](_0x35bd1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x5c6925[_0xed87('0x32')]=_0x5c6925[_0xed87('0x32')][_0xed87('0x34')]?_0x5c6925[_0xed87('0x32')]:_0x7e6cbb[_0xed87('0x2c')];if(_0x35bd1c['query'][_0xed87('0x41')]){_0x5c6925[_0xed87('0x47')]=[{'all':!![]}];}_0x5c6925=_[_0xed87('0x3c')]({},_0x5c6925,_0x35bd1c[_0xed87('0x3f')]);return db[_0xed87('0x40')][_0xed87('0x48')](_0x5c6925)[_0xed87('0x23')](handleEntityNotFound(_0x406b73,null))[_0xed87('0x23')](respondWithResult(_0x406b73,null))[_0xed87('0x44')](handleError(_0x406b73,null));};exports[_0xed87('0x49')]=function(_0x8aa499,_0x26c8f4){return db[_0xed87('0x40')][_0xed87('0x49')](_0x8aa499[_0xed87('0x4a')],{})[_0xed87('0x23')](respondWithResult(_0x26c8f4,0xc9))[_0xed87('0x44')](handleError(_0x26c8f4,null));};exports['update']=function(_0x2c7bef,_0x1a68a7){if(_0x2c7bef[_0xed87('0x4a')]['id']){delete _0x2c7bef['body']['id'];}return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x2c7bef['params']['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x1a68a7,null))[_0xed87('0x23')](saveUpdates(_0x2c7bef[_0xed87('0x4a')],null))[_0xed87('0x23')](respondWithResult(_0x1a68a7,null))['catch'](handleError(_0x1a68a7,null));};exports[_0xed87('0x24')]=function(_0x436e15,_0x3ca34c){return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x436e15[_0xed87('0x46')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3ca34c,null))[_0xed87('0x23')](removeEntity(_0x3ca34c,null))[_0xed87('0x44')](handleError(_0x3ca34c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 96a1ba0..5fbad0c 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 _0x5223=['../../config/logger','api','bluebird','request-promise','path','./intFreshdeskField.attributes','exports','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util'];(function(_0x433a9e,_0x296664){var _0x2f50bf=function(_0x9e7b5f){while(--_0x9e7b5f){_0x433a9e['push'](_0x433a9e['shift']());}};_0x2f50bf(++_0x296664);}(_0x5223,0x11f));var _0x3522=function(_0x2ed33d,_0x5c65c2){_0x2ed33d=_0x2ed33d-0x0;var _0x581b44=_0x5223[_0x2ed33d];return _0x581b44;};'use strict';var _=require('lodash');var util=require(_0x3522('0x0'));var logger=require(_0x3522('0x1'))(_0x3522('0x2'));var moment=require('moment');var BPromise=require(_0x3522('0x3'));var rp=require(_0x3522('0x4'));var fs=require('fs');var path=require(_0x3522('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3522('0x6'));module[_0x3522('0x7')]=function(_0xe3f37,_0x2ae8cb){return _0xe3f37['define']('FreshdeskField',attributes,{'tableName':_0x3522('0x8'),'paranoid':![],'indexes':[{'name':_0x3522('0x9'),'fields':[_0x3522('0xa'),_0x3522('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93e9=['api','moment','bluebird','request-promise','path','./intFreshdeskField.attributes','exports','define','FreshdeskField','idField','FieldId','lodash','util','../../config/logger'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x93e9,0x7b));var _0x993e=function(_0x4fcb48,_0x2bce5a){_0x4fcb48=_0x4fcb48-0x0;var _0x3316a2=_0x93e9[_0x4fcb48];return _0x3316a2;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require(_0x993e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x16d10c,_0x438e51){return _0x16d10c[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x993e('0xc'),_0x993e('0xd')],'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 e0b829c..05ae5b6 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 _0xba26=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x27d957,_0x2988bb){var _0x3e611f=function(_0x288792){while(--_0x288792){_0x27d957['push'](_0x27d957['shift']());}};_0x3e611f(++_0x2988bb);}(_0xba26,0x161));var _0x6ba2=function(_0x3b364c,_0x2d2137){_0x3b364c=_0x3b364c-0x0;var _0x35d512=_0xba26[_0x3b364c];return _0x35d512;};'use strict';var _=require(_0x6ba2('0x0'));var util=require('util');var moment=require(_0x6ba2('0x1'));var BPromise=require('bluebird');var rs=require(_0x6ba2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ba2('0x3'))['db'];var utils=require(_0x6ba2('0x4'));var logger=require(_0x6ba2('0x5'))('rpc');var config=require(_0x6ba2('0x6'));var jayson=require(_0x6ba2('0x7'));var client=jayson[_0x6ba2('0x8')][_0x6ba2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x832f45,_0x16291d,_0xbac43a){return new BPromise(function(_0x484937,_0x2004fb){return client[_0x6ba2('0xa')](_0x832f45,_0xbac43a)[_0x6ba2('0xb')](function(_0x3cf57b){logger[_0x6ba2('0xc')](_0x6ba2('0xd'),_0x16291d,_0x6ba2('0xe'));logger[_0x6ba2('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x16291d,_0x6ba2('0xe'),JSON[_0x6ba2('0x10')](_0x3cf57b));if(_0x3cf57b[_0x6ba2('0x11')]){if(_0x3cf57b['error'][_0x6ba2('0x12')]===0x1f4){logger[_0x6ba2('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x16291d,_0x3cf57b[_0x6ba2('0x11')][_0x6ba2('0x13')]);return _0x2004fb(_0x3cf57b['error']['message']);}logger[_0x6ba2('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x16291d,_0x3cf57b['error'][_0x6ba2('0x13')]);return _0x484937(_0x3cf57b[_0x6ba2('0x11')]['message']);}else{logger[_0x6ba2('0xc')](_0x6ba2('0xd'),_0x16291d,'request\x20sent');_0x484937(_0x3cf57b[_0x6ba2('0x14')][_0x6ba2('0x13')]);}})[_0x6ba2('0x15')](function(_0x48975c){logger[_0x6ba2('0x11')](_0x6ba2('0xd'),_0x16291d,_0x48975c);_0x2004fb(_0x48975c);});});} \ No newline at end of file +var _0x7e7b=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e7b,0x95));var _0xb7e7=function(_0x2b58f2,_0x1171bc){_0x2b58f2=_0x2b58f2-0x0;var _0x445144=_0x7e7b[_0x2b58f2];return _0x445144;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var moment=require(_0xb7e7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7e7('0x3'));var db=require(_0xb7e7('0x4'))['db'];var utils=require(_0xb7e7('0x5'));var logger=require(_0xb7e7('0x6'))('rpc');var config=require(_0xb7e7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb7e7('0x8')][_0xb7e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x465ae1,_0x282c2f,_0x5998b7){return new BPromise(function(_0x129b03,_0x4d3e12){return client[_0xb7e7('0xa')](_0x465ae1,_0x5998b7)[_0xb7e7('0xb')](function(_0x4c7819){logger[_0xb7e7('0xc')](_0xb7e7('0xd'),_0x282c2f,_0xb7e7('0xe'));logger[_0xb7e7('0xf')](_0xb7e7('0x10'),_0x282c2f,_0xb7e7('0xe'),JSON['stringify'](_0x4c7819));if(_0x4c7819[_0xb7e7('0x11')]){if(_0x4c7819[_0xb7e7('0x11')]['code']===0x1f4){logger[_0xb7e7('0x11')](_0xb7e7('0xd'),_0x282c2f,_0x4c7819[_0xb7e7('0x11')][_0xb7e7('0x12')]);return _0x4d3e12(_0x4c7819[_0xb7e7('0x11')]['message']);}logger[_0xb7e7('0x11')](_0xb7e7('0xd'),_0x282c2f,_0x4c7819[_0xb7e7('0x11')]['message']);return _0x129b03(_0x4c7819[_0xb7e7('0x11')][_0xb7e7('0x12')]);}else{logger[_0xb7e7('0xc')](_0xb7e7('0xd'),_0x282c2f,_0xb7e7('0xe'));_0x129b03(_0x4c7819['result'][_0xb7e7('0x12')]);}})[_0xb7e7('0x13')](function(_0x1afa84){logger[_0xb7e7('0x11')](_0xb7e7('0xd'),_0x282c2f,_0x1afa84);_0x4d3e12(_0x1afa84);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index c43feeb..9c38150 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 _0x9c00=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x342ea7,_0x5088d3){var _0x4344ef=function(_0x3b0cf1){while(--_0x3b0cf1){_0x342ea7['push'](_0x342ea7['shift']());}};_0x4344ef(++_0x5088d3);}(_0x9c00,0x1a0));var _0x09c0=function(_0x455fea,_0x51f808){_0x455fea=_0x455fea-0x0;var _0x32f39b=_0x9c00[_0x455fea];return _0x32f39b;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id/configurations',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0x11'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x13')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x14')]);router[_0x09c0('0x15')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);module[_0x09c0('0x17')]=router; \ No newline at end of file +var _0x0102=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','destroy','exports','util','path','connect-timeout','express','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0x0102,0x186));var _0x2010=function(_0x51cdc7,_0xd43e13){_0x51cdc7=_0x51cdc7-0x0;var _0x4a754c=_0x0102[_0x51cdc7];return _0x4a754c;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id/configurations',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0xe')]);router[_0x2010('0xd')](_0x2010('0xf'),auth[_0x2010('0x6')](),controller[_0x2010('0x10')]);router[_0x2010('0x11')](_0x2010('0x8'),auth[_0x2010('0x6')](),controller['update']);router['delete'](_0x2010('0x8'),auth[_0x2010('0x6')](),controller[_0x2010('0x12')]);module[_0x2010('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 ff8aa18..9111e24 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 _0xb44a=['STRING'];(function(_0x333159,_0x68262e){var _0x2e29ac=function(_0xf4f1f){while(--_0xf4f1f){_0x333159['push'](_0x333159['shift']());}};_0x2e29ac(++_0x68262e);}(_0xb44a,0x1c2));var _0xab44=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0xb44a[_0x589248];return _0x486750;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x583c=['exports','STRING','username','sequelize'];(function(_0x5b2247,_0x2c12fe){var _0x165675=function(_0x484e68){while(--_0x484e68){_0x5b2247['push'](_0x5b2247['shift']());}};_0x165675(++_0x2c12fe);}(_0x583c,0x12b));var _0xc583=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x583c[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 657c918..86790d2 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 _0xb725=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','then','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','destroy','findOne','FreshsalesConfiguration','order','options','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce'];(function(_0x21a36a,_0x24487a){var _0x255162=function(_0x21a3df){while(--_0x21a3df){_0x21a36a['push'](_0x21a36a['shift']());}};_0x255162(++_0x24487a);}(_0xb725,0xb6));var _0x5b72=function(_0x105470,_0x3fa1c2){_0x105470=_0x105470-0x0;var _0x5686ef=_0xb725[_0x105470];return _0x5686ef;};'use strict';var emlformat=require(_0x5b72('0x0'));var rimraf=require(_0x5b72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b72('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b72('0x3'));var Mustache=require(_0x5b72('0x4'));var util=require(_0x5b72('0x5'));var path=require(_0x5b72('0x6'));var sox=require(_0x5b72('0x7'));var csv=require(_0x5b72('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b72('0x9'));var _=require(_0x5b72('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b72('0xb'));var deskjs=require(_0x5b72('0xc'));var toCsv=require(_0x5b72('0x8'));var querystring=require('querystring');var Papa=require(_0x5b72('0xd'));var Redis=require(_0x5b72('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5b72('0xf'));var hardwareService=require(_0x5b72('0x10'));var logger=require(_0x5b72('0x11'))(_0x5b72('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b72('0x13'));var db=require(_0x5b72('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ac8b9,_0x352867){_0x352867=_0x352867||0xcc;return function(_0x47e607){if(_0x47e607){return _0x2ac8b9[_0x5b72('0x15')](_0x352867);}return _0x2ac8b9[_0x5b72('0x16')](_0x352867)[_0x5b72('0x17')]();};}function respondWithResult(_0x5ac88f,_0x588da5){_0x588da5=_0x588da5||0xc8;return function(_0x4c0aeb){if(_0x4c0aeb){return _0x5ac88f[_0x5b72('0x16')](_0x588da5)['json'](_0x4c0aeb);}};}function respondWithFilteredResult(_0x58a733,_0x54670d){return function(_0x3a3111){if(_0x3a3111){var _0x425d1a=typeof _0x54670d[_0x5b72('0x18')]===_0x5b72('0x19')&&typeof _0x54670d[_0x5b72('0x1a')]===_0x5b72('0x19');var _0x1389a1=_0x3a3111['count'];var _0x7f3c99=_0x425d1a?0x0:_0x54670d['offset'];var _0x14111f=_0x425d1a?_0x3a3111[_0x5b72('0x1b')]:_0x54670d['offset']+_0x54670d[_0x5b72('0x1a')];var _0x12e2a0;if(_0x14111f>=_0x1389a1){_0x14111f=_0x1389a1;_0x12e2a0=0xc8;}else{_0x12e2a0=0xce;}_0x58a733[_0x5b72('0x16')](_0x12e2a0);return _0x58a733['set']('Content-Range',_0x7f3c99+'-'+_0x14111f+'/'+_0x1389a1)[_0x5b72('0x1c')](_0x3a3111);}return null;};}function patchUpdates(_0x394543){return function(_0x210e90){try{jsonpatch['apply'](_0x210e90,_0x394543,!![]);}catch(_0x5ad3fd){return BPromise[_0x5b72('0x1d')](_0x5ad3fd);}return _0x210e90['save']();};}function saveUpdates(_0x487ddd,_0x2f471d){return function(_0x57b774){if(_0x57b774){return _0x57b774[_0x5b72('0x1e')](_0x487ddd)[_0x5b72('0x1f')](function(_0x3e5075){return _0x3e5075;});}return null;};}function removeEntity(_0x4bf621,_0xb86186){return function(_0x29b17b){if(_0x29b17b){return _0x29b17b['destroy']()['then'](function(){_0x4bf621[_0x5b72('0x16')](0xcc)[_0x5b72('0x17')]();});}};}function handleEntityNotFound(_0x272d57,_0x1908b6){return function(_0x2d69a7){if(!_0x2d69a7){_0x272d57[_0x5b72('0x15')](0x194);}return _0x2d69a7;};}function handleError(_0xad3d9e,_0xc0e669){_0xc0e669=_0xc0e669||0x1f4;return function(_0x1bfdf){logger[_0x5b72('0x20')](_0x1bfdf[_0x5b72('0x21')]);if(_0x1bfdf[_0x5b72('0x22')]){delete _0x1bfdf[_0x5b72('0x22')];}_0xad3d9e[_0x5b72('0x16')](_0xc0e669)[_0x5b72('0x23')](_0x1bfdf);};}exports[_0x5b72('0x24')]=function(_0x461c15,_0x9ba625){var _0x3c1323={},_0x3d3022={},_0x18f13e={'count':0x0,'rows':[]};var _0x4f0020=_[_0x5b72('0x25')](db[_0x5b72('0x26')][_0x5b72('0x27')],function(_0x392e41){return{'name':_0x392e41[_0x5b72('0x28')],'type':_0x392e41['type'][_0x5b72('0x29')]};});_0x3d3022[_0x5b72('0x2a')]=_[_0x5b72('0x25')](_0x4f0020,_0x5b72('0x22'));_0x3d3022['query']=_[_0x5b72('0x2b')](_0x461c15[_0x5b72('0x2c')]);_0x3d3022['filters']=_['intersection'](_0x3d3022[_0x5b72('0x2a')],_0x3d3022['query']);_0x3c1323[_0x5b72('0x2d')]=_[_0x5b72('0x2e')](_0x3d3022['model'],qs[_0x5b72('0x2f')](_0x461c15['query'][_0x5b72('0x2f')]));_0x3c1323[_0x5b72('0x2d')]=_0x3c1323[_0x5b72('0x2d')][_0x5b72('0x30')]?_0x3c1323[_0x5b72('0x2d')]:_0x3d3022[_0x5b72('0x2a')];if(!_0x461c15['query']['hasOwnProperty'](_0x5b72('0x31'))){_0x3c1323[_0x5b72('0x1a')]=qs['limit'](_0x461c15[_0x5b72('0x2c')]['limit']);_0x3c1323[_0x5b72('0x18')]=qs[_0x5b72('0x18')](_0x461c15[_0x5b72('0x2c')][_0x5b72('0x18')]);}_0x3c1323['order']=qs[_0x5b72('0x32')](_0x461c15[_0x5b72('0x2c')][_0x5b72('0x32')]);_0x3c1323[_0x5b72('0x33')]=qs[_0x5b72('0x34')](_[_0x5b72('0x35')](_0x461c15['query'],_0x3d3022[_0x5b72('0x34')]),_0x4f0020);if(_0x461c15[_0x5b72('0x2c')][_0x5b72('0x36')]){_0x3c1323['where']=_['merge'](_0x3c1323['where'],{'$or':_[_0x5b72('0x25')](_0x4f0020,function(_0x364945){if(_0x364945[_0x5b72('0x37')]!==_0x5b72('0x38')){var _0x3277ed={};_0x3277ed[_0x364945[_0x5b72('0x22')]]={'$like':'%'+_0x461c15['query'][_0x5b72('0x36')]+'%'};return _0x3277ed;}})});}_0x3c1323=_['merge']({},_0x3c1323,_0x461c15['options']);var _0xd7a74={'where':_0x3c1323['where']};return db['FreshsalesAccount'][_0x5b72('0x1b')](_0xd7a74)[_0x5b72('0x1f')](function(_0x121098){_0x18f13e[_0x5b72('0x1b')]=_0x121098;if(_0x461c15[_0x5b72('0x2c')][_0x5b72('0x39')]){_0x3c1323[_0x5b72('0x3a')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x5b72('0x3b')](_0x3c1323);})[_0x5b72('0x1f')](function(_0xe171cb){_0x18f13e[_0x5b72('0x3c')]=_0xe171cb;return _0x18f13e;})[_0x5b72('0x1f')](respondWithFilteredResult(_0x9ba625,_0x3c1323))[_0x5b72('0x3d')](handleError(_0x9ba625,null));};exports[_0x5b72('0x3e')]=function(_0x532dba,_0x5ae5f0){var _0x30434f={'raw':![],'where':{'id':_0x532dba[_0x5b72('0x3f')]['id']}},_0x39baf9={};_0x39baf9[_0x5b72('0x2a')]=_[_0x5b72('0x2b')](db[_0x5b72('0x26')][_0x5b72('0x27')]);_0x39baf9[_0x5b72('0x2c')]=_['keys'](_0x532dba['query']);_0x39baf9['filters']=_[_0x5b72('0x2e')](_0x39baf9[_0x5b72('0x2a')],_0x39baf9[_0x5b72('0x2c')]);_0x30434f[_0x5b72('0x2d')]=_['intersection'](_0x39baf9[_0x5b72('0x2a')],qs['fields'](_0x532dba[_0x5b72('0x2c')][_0x5b72('0x2f')]));_0x30434f[_0x5b72('0x2d')]=_0x30434f[_0x5b72('0x2d')]['length']?_0x30434f[_0x5b72('0x2d')]:_0x39baf9[_0x5b72('0x2a')];if(_0x532dba[_0x5b72('0x2c')]['includeAll']){_0x30434f[_0x5b72('0x3a')]=[{'all':!![]}];}_0x30434f=_[_0x5b72('0x40')]({},_0x30434f,_0x532dba['options']);return db['FreshsalesAccount'][_0x5b72('0x41')](_0x30434f)[_0x5b72('0x1f')](handleEntityNotFound(_0x5ae5f0,null))[_0x5b72('0x1f')](respondWithResult(_0x5ae5f0,null))['catch'](handleError(_0x5ae5f0,null));};exports[_0x5b72('0x42')]=function(_0x485ee1,_0x448a80){return db[_0x5b72('0x26')][_0x5b72('0x42')](_0x485ee1[_0x5b72('0x43')],{})[_0x5b72('0x1f')](respondWithResult(_0x448a80,0xc9))[_0x5b72('0x3d')](handleError(_0x448a80,null));};exports[_0x5b72('0x1e')]=function(_0x17da85,_0x1e775f){if(_0x17da85[_0x5b72('0x43')]['id']){delete _0x17da85[_0x5b72('0x43')]['id'];}return db[_0x5b72('0x26')]['find']({'where':{'id':_0x17da85[_0x5b72('0x3f')]['id']}})[_0x5b72('0x1f')](handleEntityNotFound(_0x1e775f,null))['then'](saveUpdates(_0x17da85[_0x5b72('0x43')],null))[_0x5b72('0x1f')](respondWithResult(_0x1e775f,null))[_0x5b72('0x3d')](handleError(_0x1e775f,null));};exports[_0x5b72('0x44')]=function(_0x267169,_0x22d509){return db['FreshsalesAccount'][_0x5b72('0x41')]({'where':{'id':_0x267169[_0x5b72('0x3f')]['id']}})[_0x5b72('0x1f')](handleEntityNotFound(_0x22d509,null))[_0x5b72('0x1f')](removeEntity(_0x22d509,null))[_0x5b72('0x3d')](handleError(_0x22d509,null));};exports['getConfigurations']=function(_0x3557f8,_0x183fca,_0x24f1e2){var _0x36a5ea={};var _0x282f2b={};var _0x18a0f6;var _0x149ef1;return db[_0x5b72('0x26')][_0x5b72('0x45')]({'where':{'id':_0x3557f8[_0x5b72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x183fca,null))[_0x5b72('0x1f')](function(_0x2ed089){if(_0x2ed089){_0x18a0f6=_0x2ed089;_0x282f2b[_0x5b72('0x2a')]=_['keys'](db[_0x5b72('0x46')][_0x5b72('0x27')]);_0x282f2b[_0x5b72('0x2c')]=_[_0x5b72('0x2b')](_0x3557f8[_0x5b72('0x2c')]);_0x282f2b['filters']=_['intersection'](_0x282f2b[_0x5b72('0x2a')],_0x282f2b['query']);_0x36a5ea[_0x5b72('0x2d')]=_[_0x5b72('0x2e')](_0x282f2b[_0x5b72('0x2a')],qs[_0x5b72('0x2f')](_0x3557f8[_0x5b72('0x2c')][_0x5b72('0x2f')]));_0x36a5ea['attributes']=_0x36a5ea[_0x5b72('0x2d')][_0x5b72('0x30')]?_0x36a5ea['attributes']:_0x282f2b[_0x5b72('0x2a')];_0x36a5ea[_0x5b72('0x47')]=qs[_0x5b72('0x32')](_0x3557f8[_0x5b72('0x2c')][_0x5b72('0x32')]);_0x36a5ea[_0x5b72('0x33')]=qs[_0x5b72('0x34')](_[_0x5b72('0x35')](_0x3557f8[_0x5b72('0x2c')],_0x282f2b[_0x5b72('0x34')]));if(_0x3557f8['query'][_0x5b72('0x36')]){_0x36a5ea[_0x5b72('0x33')]=_[_0x5b72('0x40')](_0x36a5ea[_0x5b72('0x33')],{'$or':_[_0x5b72('0x25')](_0x36a5ea[_0x5b72('0x2d')],function(_0x52efff){var _0x340585={};_0x340585[_0x52efff]={'$like':'%'+_0x3557f8[_0x5b72('0x2c')][_0x5b72('0x36')]+'%'};return _0x340585;})});}_0x36a5ea=_[_0x5b72('0x40')]({},_0x36a5ea,_0x3557f8[_0x5b72('0x48')]);return _0x18a0f6[_0x5b72('0x49')](_0x36a5ea);}})[_0x5b72('0x1f')](function(_0x25fd92){if(_0x25fd92){_0x149ef1=_0x25fd92[_0x5b72('0x30')];if(!_0x3557f8['query']['hasOwnProperty'](_0x5b72('0x31'))){_0x36a5ea['limit']=qs['limit'](_0x3557f8[_0x5b72('0x2c')][_0x5b72('0x1a')]);_0x36a5ea[_0x5b72('0x18')]=qs[_0x5b72('0x18')](_0x3557f8['query'][_0x5b72('0x18')]);}return _0x18a0f6['getConfigurations'](_0x36a5ea);}})['then'](function(_0x289518){if(_0x289518){return _0x289518?{'count':_0x149ef1,'rows':_0x289518}:null;}})['then'](respondWithResult(_0x183fca,null))[_0x5b72('0x3d')](handleError(_0x183fca,null));};exports[_0x5b72('0x4a')]=function(_0x314cf7,_0x5ddb40,_0x591042){if(_0x314cf7[_0x5b72('0x43')]['id']){delete _0x314cf7[_0x5b72('0x43')]['id'];}return db[_0x5b72('0x26')][_0x5b72('0x45')]({'where':{'id':_0x314cf7['params']['id']}})['then'](handleEntityNotFound(_0x5ddb40,null))[_0x5b72('0x1f')](function(_0x82f9fc){if(_0x82f9fc){_0x314cf7['body'][_0x5b72('0x4b')]=_0x82f9fc['id'];_0x314cf7[_0x5b72('0x43')][_0x5b72('0x4c')]=integrations['getSubjects'](_0x314cf7[_0x5b72('0x43')][_0x5b72('0x4d')],_0x314cf7['body'][_0x5b72('0x37')]);_0x314cf7[_0x5b72('0x43')][_0x5b72('0x4e')]=integrations[_0x5b72('0x4f')](_0x314cf7['body']['channel'],_0x314cf7[_0x5b72('0x43')][_0x5b72('0x37')]);return db[_0x5b72('0x46')][_0x5b72('0x42')](_0x314cf7[_0x5b72('0x43')],{'include':[{'model':db[_0x5b72('0x50')],'as':'Subjects'},{'model':db[_0x5b72('0x50')],'as':_0x5b72('0x4e')}]});}return null;})['then'](respondWithResult(_0x5ddb40,null))[_0x5b72('0x3d')](handleError(_0x5ddb40,null));};exports[_0x5b72('0x51')]=function(_0x3e340b,_0x335fbf,_0x18717f){var _0x4cf4f1='';var _0x1f6b60='';return db[_0x5b72('0x26')][_0x5b72('0x45')]({'where':{'id':_0x3e340b[_0x5b72('0x3f')]['id']},'attributes':['id',_0x5b72('0x52'),'remoteUri',_0x5b72('0x53')]})[_0x5b72('0x1f')](handleEntityNotFound(_0x335fbf,null))['then'](function(_0x232299){if(_0x232299){_0x1f6b60=_0x232299[_0x5b72('0x52')];_0x4cf4f1=_0x232299['remoteUri'];var _0x1db24a=_0x232299['remoteUri'][_0x5b72('0x54')](-0x1);if(_0x1db24a==='/'){_0x4cf4f1=_0x4cf4f1[_0x5b72('0x55')](0x0,_0x4cf4f1[_0x5b72('0x56')](_0x1db24a));}return rp({'method':_0x5b72('0x57'),'uri':util[_0x5b72('0x58')](_0x5b72('0x59'),_0x4cf4f1,_0x5b72('0x5a')),'headers':{'Authorization':'Token\x20token='+_0x232299['apiKey']},'json':!![]});}})[_0x5b72('0x1f')](function(_0x1ca591){if(_0x1ca591){var _0x5dad62=_0x1ca591[_0x5b72('0x5b')];var _0x50f2c5=![];var _0x1ad870=null;for(_0x1ad870=0x0;_0x1ad870<_0x5dad62[_0x5b72('0x30')];_0x1ad870++){if(_0x5dad62[_0x1ad870]['email']===_0x1f6b60){_0x50f2c5=!![];}}if(_0x50f2c5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5b72('0x5c')});}}})[_0x5b72('0x1f')](respondWithResult(_0x335fbf,null))[_0x5b72('0x3d')](function(_0x197940){var _0xf6db3=_0x3e340b[_0x5b72('0x2c')][_0x5b72('0x5d')]?0x1f4:_0x197940[_0x5b72('0x5e')]||0x1f4;logger[_0x5b72('0x20')](_0x5b72('0x5f'),_0x5b72('0x51'),_0xf6db3,JSON['stringify'](_0x197940));delete _0x197940[_0x5b72('0x22')];if(_0xf6db3===0x191){_0xf6db3=0x190;}_0x335fbf[_0x5b72('0x16')](_0xf6db3)[_0x5b72('0x23')](_0x3e340b['query'][_0x5b72('0x5d')]?{'message':_0x5b72('0x60'),'statusCode':_0x197940[_0x5b72('0x5e')]}:_0x197940);});}; \ No newline at end of file +var _0xa13c=['findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','pick','filter','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','send','index','FreshsalesAccount','rawAttributes','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x6f9891,_0x1c993a){var _0x3f950a=function(_0x14ad61){while(--_0x14ad61){_0x6f9891['push'](_0x6f9891['shift']());}};_0x3f950a(++_0x1c993a);}(_0xa13c,0x14e));var _0xca13=function(_0xa42ac1,_0x5241f6){_0xa42ac1=_0xa42ac1-0x0;var _0x481f10=_0xa13c[_0xa42ac1];return _0x481f10;};'use strict';var emlformat=require(_0xca13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca13('0x2'));var moment=require(_0xca13('0x3'));var BPromise=require(_0xca13('0x4'));var Mustache=require('mustache');var util=require(_0xca13('0x5'));var path=require(_0xca13('0x6'));var sox=require(_0xca13('0x7'));var csv=require('to-csv');var ejs=require(_0xca13('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca13('0x9'));var squel=require(_0xca13('0xa'));var crypto=require(_0xca13('0xb'));var jsforce=require(_0xca13('0xc'));var deskjs=require(_0xca13('0xd'));var toCsv=require(_0xca13('0xe'));var querystring=require(_0xca13('0xf'));var Papa=require(_0xca13('0x10'));var Redis=require(_0xca13('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xca13('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xca13('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xca13('0x14'));function respondWithStatusCode(_0x425af5,_0xb18085){_0xb18085=_0xb18085||0xcc;return function(_0x499d9f){if(_0x499d9f){return _0x425af5[_0xca13('0x15')](_0xb18085);}return _0x425af5['status'](_0xb18085)[_0xca13('0x16')]();};}function respondWithResult(_0x1a3dc9,_0xf459df){_0xf459df=_0xf459df||0xc8;return function(_0x7888a8){if(_0x7888a8){return _0x1a3dc9[_0xca13('0x17')](_0xf459df)['json'](_0x7888a8);}};}function respondWithFilteredResult(_0x1e5510,_0x18ce33){return function(_0x1843f1){if(_0x1843f1){var _0x4cf473=typeof _0x18ce33[_0xca13('0x18')]===_0xca13('0x19')&&typeof _0x18ce33[_0xca13('0x1a')]===_0xca13('0x19');var _0x110174=_0x1843f1['count'];var _0xaa5d92=_0x4cf473?0x0:_0x18ce33[_0xca13('0x18')];var _0x49fc5a=_0x4cf473?_0x1843f1[_0xca13('0x1b')]:_0x18ce33[_0xca13('0x18')]+_0x18ce33[_0xca13('0x1a')];var _0x21501b;if(_0x49fc5a>=_0x110174){_0x49fc5a=_0x110174;_0x21501b=0xc8;}else{_0x21501b=0xce;}_0x1e5510[_0xca13('0x17')](_0x21501b);return _0x1e5510[_0xca13('0x1c')](_0xca13('0x1d'),_0xaa5d92+'-'+_0x49fc5a+'/'+_0x110174)['json'](_0x1843f1);}return null;};}function patchUpdates(_0x3b413e){return function(_0x3eb762){try{jsonpatch[_0xca13('0x1e')](_0x3eb762,_0x3b413e,!![]);}catch(_0x3e3a1a){return BPromise['reject'](_0x3e3a1a);}return _0x3eb762[_0xca13('0x1f')]();};}function saveUpdates(_0x14b255,_0x205f27){return function(_0x34b30a){if(_0x34b30a){return _0x34b30a[_0xca13('0x20')](_0x14b255)[_0xca13('0x21')](function(_0x4d8674){return _0x4d8674;});}return null;};}function removeEntity(_0x47d988,_0x3264b1){return function(_0x3ac9c5){if(_0x3ac9c5){return _0x3ac9c5['destroy']()[_0xca13('0x21')](function(){_0x47d988[_0xca13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dfc27,_0x31a7a8){return function(_0x4364bb){if(!_0x4364bb){_0x2dfc27[_0xca13('0x15')](0x194);}return _0x4364bb;};}function handleError(_0xa295f6,_0x5cc2d0){_0x5cc2d0=_0x5cc2d0||0x1f4;return function(_0x30665c){logger[_0xca13('0x22')](_0x30665c[_0xca13('0x23')]);if(_0x30665c['name']){delete _0x30665c['name'];}_0xa295f6['status'](_0x5cc2d0)[_0xca13('0x24')](_0x30665c);};}exports[_0xca13('0x25')]=function(_0x11d650,_0x3d3781){var _0x311dba={},_0x3447ca={},_0x444707={'count':0x0,'rows':[]};var _0x53034b=_['map'](db[_0xca13('0x26')][_0xca13('0x27')],function(_0x335f15){return{'name':_0x335f15['fieldName'],'type':_0x335f15[_0xca13('0x28')][_0xca13('0x29')]};});_0x3447ca['model']=_[_0xca13('0x2a')](_0x53034b,_0xca13('0x2b'));_0x3447ca[_0xca13('0x2c')]=_[_0xca13('0x2d')](_0x11d650[_0xca13('0x2c')]);_0x3447ca[_0xca13('0x2e')]=_[_0xca13('0x2f')](_0x3447ca[_0xca13('0x30')],_0x3447ca['query']);_0x311dba[_0xca13('0x31')]=_[_0xca13('0x2f')](_0x3447ca[_0xca13('0x30')],qs['fields'](_0x11d650[_0xca13('0x2c')][_0xca13('0x32')]));_0x311dba[_0xca13('0x31')]=_0x311dba['attributes'][_0xca13('0x33')]?_0x311dba[_0xca13('0x31')]:_0x3447ca[_0xca13('0x30')];if(!_0x11d650[_0xca13('0x2c')][_0xca13('0x34')](_0xca13('0x35'))){_0x311dba[_0xca13('0x1a')]=qs['limit'](_0x11d650[_0xca13('0x2c')][_0xca13('0x1a')]);_0x311dba['offset']=qs[_0xca13('0x18')](_0x11d650[_0xca13('0x2c')]['offset']);}_0x311dba[_0xca13('0x36')]=qs[_0xca13('0x37')](_0x11d650[_0xca13('0x2c')][_0xca13('0x37')]);_0x311dba[_0xca13('0x38')]=qs[_0xca13('0x2e')](_['pick'](_0x11d650['query'],_0x3447ca['filters']),_0x53034b);if(_0x11d650['query']['filter']){_0x311dba['where']=_[_0xca13('0x39')](_0x311dba[_0xca13('0x38')],{'$or':_[_0xca13('0x2a')](_0x53034b,function(_0xc1a752){if(_0xc1a752[_0xca13('0x28')]!==_0xca13('0x3a')){var _0x444869={};_0x444869[_0xc1a752['name']]={'$like':'%'+_0x11d650[_0xca13('0x2c')]['filter']+'%'};return _0x444869;}})});}_0x311dba=_[_0xca13('0x39')]({},_0x311dba,_0x11d650[_0xca13('0x3b')]);var _0x33f163={'where':_0x311dba[_0xca13('0x38')]};return db[_0xca13('0x26')][_0xca13('0x1b')](_0x33f163)[_0xca13('0x21')](function(_0xca7030){_0x444707['count']=_0xca7030;if(_0x11d650[_0xca13('0x2c')][_0xca13('0x3c')]){_0x311dba[_0xca13('0x3d')]=[{'all':!![]}];}return db[_0xca13('0x26')][_0xca13('0x3e')](_0x311dba);})[_0xca13('0x21')](function(_0x210e49){_0x444707[_0xca13('0x3f')]=_0x210e49;return _0x444707;})['then'](respondWithFilteredResult(_0x3d3781,_0x311dba))[_0xca13('0x40')](handleError(_0x3d3781,null));};exports[_0xca13('0x41')]=function(_0x18513b,_0x1ceca3){var _0xfe896e={'raw':![],'where':{'id':_0x18513b[_0xca13('0x42')]['id']}},_0x122649={};_0x122649[_0xca13('0x30')]=_[_0xca13('0x2d')](db[_0xca13('0x26')]['rawAttributes']);_0x122649[_0xca13('0x2c')]=_[_0xca13('0x2d')](_0x18513b[_0xca13('0x2c')]);_0x122649[_0xca13('0x2e')]=_[_0xca13('0x2f')](_0x122649[_0xca13('0x30')],_0x122649[_0xca13('0x2c')]);_0xfe896e['attributes']=_[_0xca13('0x2f')](_0x122649['model'],qs[_0xca13('0x32')](_0x18513b[_0xca13('0x2c')][_0xca13('0x32')]));_0xfe896e['attributes']=_0xfe896e[_0xca13('0x31')][_0xca13('0x33')]?_0xfe896e['attributes']:_0x122649['model'];if(_0x18513b[_0xca13('0x2c')]['includeAll']){_0xfe896e[_0xca13('0x3d')]=[{'all':!![]}];}_0xfe896e=_[_0xca13('0x39')]({},_0xfe896e,_0x18513b['options']);return db['FreshsalesAccount'][_0xca13('0x43')](_0xfe896e)[_0xca13('0x21')](handleEntityNotFound(_0x1ceca3,null))[_0xca13('0x21')](respondWithResult(_0x1ceca3,null))[_0xca13('0x40')](handleError(_0x1ceca3,null));};exports[_0xca13('0x44')]=function(_0x359e79,_0x34c97c){return db[_0xca13('0x26')][_0xca13('0x44')](_0x359e79[_0xca13('0x45')],{})[_0xca13('0x21')](respondWithResult(_0x34c97c,0xc9))[_0xca13('0x40')](handleError(_0x34c97c,null));};exports[_0xca13('0x20')]=function(_0x492813,_0x33c2dc){if(_0x492813[_0xca13('0x45')]['id']){delete _0x492813[_0xca13('0x45')]['id'];}return db[_0xca13('0x26')][_0xca13('0x43')]({'where':{'id':_0x492813[_0xca13('0x42')]['id']}})[_0xca13('0x21')](handleEntityNotFound(_0x33c2dc,null))[_0xca13('0x21')](saveUpdates(_0x492813[_0xca13('0x45')],null))[_0xca13('0x21')](respondWithResult(_0x33c2dc,null))[_0xca13('0x40')](handleError(_0x33c2dc,null));};exports[_0xca13('0x46')]=function(_0x13ed54,_0x2cf79a){return db[_0xca13('0x26')][_0xca13('0x43')]({'where':{'id':_0x13ed54[_0xca13('0x42')]['id']}})[_0xca13('0x21')](handleEntityNotFound(_0x2cf79a,null))[_0xca13('0x21')](removeEntity(_0x2cf79a,null))[_0xca13('0x40')](handleError(_0x2cf79a,null));};exports[_0xca13('0x47')]=function(_0x1253a2,_0x320483,_0x4c8507){var _0x35a8c7={};var _0x179c82={};var _0x35d1ec;var _0x9163fe;return db[_0xca13('0x26')][_0xca13('0x48')]({'where':{'id':_0x1253a2['params']['id']}})['then'](handleEntityNotFound(_0x320483,null))[_0xca13('0x21')](function(_0x76764){if(_0x76764){_0x35d1ec=_0x76764;_0x179c82[_0xca13('0x30')]=_[_0xca13('0x2d')](db[_0xca13('0x49')]['rawAttributes']);_0x179c82['query']=_['keys'](_0x1253a2[_0xca13('0x2c')]);_0x179c82[_0xca13('0x2e')]=_['intersection'](_0x179c82[_0xca13('0x30')],_0x179c82[_0xca13('0x2c')]);_0x35a8c7[_0xca13('0x31')]=_['intersection'](_0x179c82['model'],qs[_0xca13('0x32')](_0x1253a2[_0xca13('0x2c')][_0xca13('0x32')]));_0x35a8c7[_0xca13('0x31')]=_0x35a8c7[_0xca13('0x31')][_0xca13('0x33')]?_0x35a8c7[_0xca13('0x31')]:_0x179c82[_0xca13('0x30')];_0x35a8c7[_0xca13('0x36')]=qs[_0xca13('0x37')](_0x1253a2[_0xca13('0x2c')][_0xca13('0x37')]);_0x35a8c7['where']=qs[_0xca13('0x2e')](_[_0xca13('0x4a')](_0x1253a2[_0xca13('0x2c')],_0x179c82[_0xca13('0x2e')]));if(_0x1253a2[_0xca13('0x2c')][_0xca13('0x4b')]){_0x35a8c7['where']=_[_0xca13('0x39')](_0x35a8c7[_0xca13('0x38')],{'$or':_[_0xca13('0x2a')](_0x35a8c7[_0xca13('0x31')],function(_0x5f3277){var _0x23f36a={};_0x23f36a[_0x5f3277]={'$like':'%'+_0x1253a2[_0xca13('0x2c')][_0xca13('0x4b')]+'%'};return _0x23f36a;})});}_0x35a8c7=_['merge']({},_0x35a8c7,_0x1253a2[_0xca13('0x3b')]);return _0x35d1ec[_0xca13('0x47')](_0x35a8c7);}})[_0xca13('0x21')](function(_0x931145){if(_0x931145){_0x9163fe=_0x931145[_0xca13('0x33')];if(!_0x1253a2[_0xca13('0x2c')][_0xca13('0x34')](_0xca13('0x35'))){_0x35a8c7[_0xca13('0x1a')]=qs[_0xca13('0x1a')](_0x1253a2['query'][_0xca13('0x1a')]);_0x35a8c7[_0xca13('0x18')]=qs[_0xca13('0x18')](_0x1253a2[_0xca13('0x2c')][_0xca13('0x18')]);}return _0x35d1ec[_0xca13('0x47')](_0x35a8c7);}})[_0xca13('0x21')](function(_0x58b30f){if(_0x58b30f){return _0x58b30f?{'count':_0x9163fe,'rows':_0x58b30f}:null;}})[_0xca13('0x21')](respondWithResult(_0x320483,null))['catch'](handleError(_0x320483,null));};exports[_0xca13('0x4c')]=function(_0x254ded,_0x1fea4e,_0x20b9f5){if(_0x254ded['body']['id']){delete _0x254ded[_0xca13('0x45')]['id'];}return db[_0xca13('0x26')][_0xca13('0x48')]({'where':{'id':_0x254ded[_0xca13('0x42')]['id']}})[_0xca13('0x21')](handleEntityNotFound(_0x1fea4e,null))['then'](function(_0x188e2e){if(_0x188e2e){_0x254ded[_0xca13('0x45')][_0xca13('0x4d')]=_0x188e2e['id'];_0x254ded[_0xca13('0x45')]['Subjects']=integrations[_0xca13('0x4e')](_0x254ded[_0xca13('0x45')][_0xca13('0x4f')],_0x254ded[_0xca13('0x45')][_0xca13('0x28')]);_0x254ded[_0xca13('0x45')][_0xca13('0x50')]=integrations['getDescriptions'](_0x254ded[_0xca13('0x45')]['channel'],_0x254ded[_0xca13('0x45')][_0xca13('0x28')]);return db[_0xca13('0x49')][_0xca13('0x44')](_0x254ded[_0xca13('0x45')],{'include':[{'model':db[_0xca13('0x51')],'as':_0xca13('0x52')},{'model':db[_0xca13('0x51')],'as':_0xca13('0x50')}]});}return null;})[_0xca13('0x21')](respondWithResult(_0x1fea4e,null))[_0xca13('0x40')](handleError(_0x1fea4e,null));};exports[_0xca13('0x53')]=function(_0x13092b,_0x4af7c4,_0x3a9467){var _0x3de3a2='';var _0x1221d0='';return db['FreshsalesAccount'][_0xca13('0x48')]({'where':{'id':_0x13092b['params']['id']},'attributes':['id',_0xca13('0x54'),_0xca13('0x55'),_0xca13('0x56')]})['then'](handleEntityNotFound(_0x4af7c4,null))[_0xca13('0x21')](function(_0x1aeb39){if(_0x1aeb39){_0x1221d0=_0x1aeb39[_0xca13('0x54')];_0x3de3a2=_0x1aeb39[_0xca13('0x55')];var _0x43764a=_0x1aeb39[_0xca13('0x55')][_0xca13('0x57')](-0x1);if(_0x43764a==='/'){_0x3de3a2=_0x3de3a2[_0xca13('0x58')](0x0,_0x3de3a2[_0xca13('0x59')](_0x43764a));}return rp({'method':'GET','uri':util[_0xca13('0x5a')]('%s%s',_0x3de3a2,_0xca13('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x1aeb39[_0xca13('0x56')]},'json':!![]});}})[_0xca13('0x21')](function(_0x23a9c2){if(_0x23a9c2){var _0x4a146c=_0x23a9c2['users'];var _0xaa5da5=![];var _0x1a443f=null;for(_0x1a443f=0x0;_0x1a443f<_0x4a146c['length'];_0x1a443f++){if(_0x4a146c[_0x1a443f][_0xca13('0x5c')]===_0x1221d0){_0xaa5da5=!![];}}if(_0xaa5da5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xca13('0x5d')});}}})[_0xca13('0x21')](respondWithResult(_0x4af7c4,null))['catch'](function(_0xa93611){var _0x5bbf06=_0x13092b[_0xca13('0x2c')][_0xca13('0x5e')]?0x1f4:_0xa93611[_0xca13('0x5f')]||0x1f4;logger[_0xca13('0x22')](_0xca13('0x60'),_0xca13('0x53'),_0x5bbf06,JSON[_0xca13('0x61')](_0xa93611));delete _0xa93611['name'];if(_0x5bbf06===0x191){_0x5bbf06=0x190;}_0x4af7c4['status'](_0x5bbf06)[_0xca13('0x24')](_0x13092b[_0xca13('0x2c')]['test']?{'message':_0xca13('0x62'),'statusCode':_0xa93611[_0xca13('0x5f')]}:_0xa93611);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 299384b..3658e8f 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 _0xd117=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x5aeeeb,_0x1b1595){var _0x5363d4=function(_0x3b59a4){while(--_0x3b59a4){_0x5aeeeb['push'](_0x5aeeeb['shift']());}};_0x5363d4(++_0x1b1595);}(_0xd117,0x182));var _0x7d11=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xd117[_0x3640e2];return _0x277415;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));var integrations=require(_0x7d11('0xb'));module[_0x7d11('0xc')]=function(_0x40c3c4,_0x345602){return _0x40c3c4[_0x7d11('0xd')]('FreshsalesAccount',attributes,{'tableName':_0x7d11('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0424=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','../../config/logger','api','moment','bluebird','path'];(function(_0x7e087c,_0x52d4f2){var _0xa86caa=function(_0x4897c6){while(--_0x4897c6){_0x7e087c['push'](_0x7e087c['shift']());}};_0xa86caa(++_0x52d4f2);}(_0x0424,0x159));var _0x4042=function(_0x41a457,_0x4a8e30){_0x41a457=_0x41a457-0x0;var _0x84b15f=_0x0424[_0x41a457];return _0x84b15f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));var integrations=require(_0x4042('0x6'));module[_0x4042('0x7')]=function(_0xc0fba0,_0x3abaf1){return _0xc0fba0[_0x4042('0x8')](_0x4042('0x9'),attributes,{'tableName':'int_freshsales_accounts','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 52a8f84..e9f5f90 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 _0x4888=['FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshsalesAccount'];(function(_0x79578a,_0x2e1938){var _0x326a23=function(_0x12cb1d){while(--_0x12cb1d){_0x79578a['push'](_0x79578a['shift']());}};_0x326a23(++_0x2e1938);}(_0x4888,0x198));var _0x8488=function(_0x40cacb,_0x2d291f){_0x40cacb=_0x40cacb-0x0;var _0x57491f=_0x4888[_0x40cacb];return _0x57491f;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')]({'raw':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x60ae2f['options']?_0x60ae2f['options'][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1e')]||null:null,'include':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')]['include']?_[_0x8488('0x1f')](_0x60ae2f[_0x8488('0x1a')][_0x8488('0x20')],function(_0x1361a6){return{'model':db[_0x1361a6[_0x8488('0x21')]],'as':_0x1361a6['as'],'attributes':_0x1361a6['attributes'],'include':_0x1361a6['include']?_['map'](_0x1361a6['include'],function(_0x472624){return{'model':db[_0x472624['model']],'as':_0x472624['as'],'attributes':_0x472624['attributes'],'include':_0x472624[_0x8488('0x20')]?_[_0x8488('0x1f')](_0x472624[_0x8488('0x20')],function(_0x6ebee0){return{'model':db[_0x6ebee0[_0x8488('0x21')]],'as':_0x6ebee0['as'],'attributes':_0x6ebee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x38c137){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x38c137));_0x1aedb1(_0x38c137);})[_0x8488('0x22')](function(_0x368f9c){logger[_0x8488('0x13')](_0x8488('0x17'),_0x368f9c['message'],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x368f9c['message']));});});};exports[_0x8488('0x23')]=function(_0x408c36){var _0x19cf42=this;return new Promise(function(_0x121dcc,_0x117321){return db[_0x8488('0x18')]['find']({'raw':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['where']||null:null,'attributes':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['attributes']||null:null,'include':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x20')]?_[_0x8488('0x1f')](_0x408c36[_0x8488('0x1a')]['include'],function(_0x44c8f3){return{'model':db[_0x44c8f3[_0x8488('0x21')]],'as':_0x44c8f3['as'],'attributes':_0x44c8f3[_0x8488('0x1d')],'include':_0x44c8f3['include']?_[_0x8488('0x1f')](_0x44c8f3['include'],function(_0x205ccc){return{'model':db[_0x205ccc[_0x8488('0x21')]],'as':_0x205ccc['as'],'attributes':_0x205ccc[_0x8488('0x1d')],'include':_0x205ccc[_0x8488('0x20')]?_['map'](_0x205ccc[_0x8488('0x20')],function(_0xe71bd9){return{'model':db[_0xe71bd9[_0x8488('0x21')]],'as':_0xe71bd9['as'],'attributes':_0xe71bd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x17bfea){logger[_0x8488('0xe')](_0x8488('0x23'),_0x408c36);logger[_0x8488('0x11')](_0x8488('0x23'),_0x408c36,JSON[_0x8488('0x12')](_0x17bfea));_0x121dcc(_0x17bfea);})[_0x8488('0x22')](function(_0x1a8235){logger[_0x8488('0x13')](_0x8488('0x23'),_0x1a8235['message'],_0x408c36);_0x117321(_0x19cf42['error'](0x1f4,_0x1a8235[_0x8488('0x15')]));});});}; \ No newline at end of file +var _0x0adf=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','GetFreshsalesAccount','find','raw','ShowFreshsalesAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x3b94eb,_0x5e690d){var _0x14e15d=function(_0x49e963){while(--_0x49e963){_0x3b94eb['push'](_0x3b94eb['shift']());}};_0x14e15d(++_0x5e690d);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x5d5fcc,_0x13ccca){_0x5d5fcc=_0x5d5fcc-0x0;var _0x5afcaa=_0x0adf[_0x5d5fcc];return _0x5afcaa;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eca0e,_0x44cf37,_0x170574){return new BPromise(function(_0x41c99d,_0xa9a315){return client[_0xf0ad('0xb')](_0x2eca0e,_0x170574)[_0xf0ad('0xc')](function(_0x5bdf69){logger[_0xf0ad('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x44cf37,_0xf0ad('0xe'));logger[_0xf0ad('0xf')](_0xf0ad('0x10'),_0x44cf37,_0xf0ad('0xe'),JSON[_0xf0ad('0x11')](_0x5bdf69));if(_0x5bdf69['error']){if(_0x5bdf69['error'][_0xf0ad('0x12')]===0x1f4){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x5bdf69[_0xf0ad('0x13')]['message']);return _0xa9a315(_0x5bdf69[_0xf0ad('0x13')][_0xf0ad('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x44cf37,_0x5bdf69['error'][_0xf0ad('0x15')]);return _0x41c99d(_0x5bdf69['error'][_0xf0ad('0x15')]);}else{logger[_0xf0ad('0xd')](_0xf0ad('0x14'),_0x44cf37,_0xf0ad('0xe'));_0x41c99d(_0x5bdf69[_0xf0ad('0x16')]['message']);}})[_0xf0ad('0x17')](function(_0x285ab0){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x285ab0);_0xa9a315(_0x285ab0);});});}exports['GetFreshsalesAccount']=function(_0x4e9970){var _0x2466e8=this;return new Promise(function(_0x46fb20,_0x49f2ec){return db[_0xf0ad('0x18')][_0xf0ad('0x19')]({'raw':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4e9970['options']?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1b')]||null:null,'attributes':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1c')]||null:null,'limit':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970['options'][_0xf0ad('0x1d')]||null:null,'include':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1e')],function(_0x276322){return{'model':db[_0x276322[_0xf0ad('0x20')]],'as':_0x276322['as'],'attributes':_0x276322[_0xf0ad('0x1c')],'include':_0x276322[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x276322[_0xf0ad('0x1e')],function(_0x456f81){return{'model':db[_0x456f81[_0xf0ad('0x20')]],'as':_0x456f81['as'],'attributes':_0x456f81['attributes'],'include':_0x456f81[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x456f81[_0xf0ad('0x1e')],function(_0x7377d7){return{'model':db[_0x7377d7[_0xf0ad('0x20')]],'as':_0x7377d7['as'],'attributes':_0x7377d7[_0xf0ad('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cbe00){logger[_0xf0ad('0xd')](_0xf0ad('0x21'),_0x4e9970);logger[_0xf0ad('0xf')](_0xf0ad('0x21'),_0x4e9970,JSON[_0xf0ad('0x11')](_0x2cbe00));_0x46fb20(_0x2cbe00);})[_0xf0ad('0x17')](function(_0x1bee71){logger[_0xf0ad('0x13')](_0xf0ad('0x21'),_0x1bee71[_0xf0ad('0x15')],_0x4e9970);_0x49f2ec(_0x2466e8['error'](0x1f4,_0x1bee71[_0xf0ad('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x83f211){var _0x57a1f3=this;return new Promise(function(_0x25ed0b,_0x320174){return db[_0xf0ad('0x18')][_0xf0ad('0x22')]({'raw':_0x83f211[_0xf0ad('0x1a')]?_0x83f211[_0xf0ad('0x1a')][_0xf0ad('0x23')]===undefined?!![]:![]:!![],'where':_0x83f211[_0xf0ad('0x1a')]?_0x83f211['options']['where']||null:null,'attributes':_0x83f211[_0xf0ad('0x1a')]?_0x83f211[_0xf0ad('0x1a')][_0xf0ad('0x1c')]||null:null,'include':_0x83f211[_0xf0ad('0x1a')]?_0x83f211['options'][_0xf0ad('0x1e')]?_['map'](_0x83f211[_0xf0ad('0x1a')]['include'],function(_0x4136b9){return{'model':db[_0x4136b9['model']],'as':_0x4136b9['as'],'attributes':_0x4136b9[_0xf0ad('0x1c')],'include':_0x4136b9[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x4136b9[_0xf0ad('0x1e')],function(_0x42f87f){return{'model':db[_0x42f87f[_0xf0ad('0x20')]],'as':_0x42f87f['as'],'attributes':_0x42f87f[_0xf0ad('0x1c')],'include':_0x42f87f[_0xf0ad('0x1e')]?_['map'](_0x42f87f[_0xf0ad('0x1e')],function(_0x54b59d){return{'model':db[_0x54b59d[_0xf0ad('0x20')]],'as':_0x54b59d['as'],'attributes':_0x54b59d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0ad('0xc')](function(_0x25246b){logger[_0xf0ad('0xd')](_0xf0ad('0x24'),_0x83f211);logger[_0xf0ad('0xf')]('ShowFreshsalesAccount',_0x83f211,JSON[_0xf0ad('0x11')](_0x25246b));_0x25ed0b(_0x25246b);})[_0xf0ad('0x17')](function(_0x1d57d1){logger[_0xf0ad('0x13')](_0xf0ad('0x24'),_0x1d57d1[_0xf0ad('0x15')],_0x83f211);_0x320174(_0x57a1f3[_0xf0ad('0x13')](0x1f4,_0x1d57d1['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e55343a..126bd8d 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 _0xf452=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x233286,_0x596485){var _0x28abe6=function(_0x4d00ec){while(--_0x4d00ec){_0x233286['push'](_0x233286['shift']());}};_0x28abe6(++_0x596485);}(_0xf452,0x1a5));var _0x2f45=function(_0x3d4744,_0x3c0151){_0x3d4744=_0x3d4744-0x0;var _0x1cc115=_0xf452[_0x3d4744];return _0x1cc115;};'use strict';var multer=require(_0x2f45('0x0'));var util=require('util');var path=require(_0x2f45('0x1'));var timeout=require(_0x2f45('0x2'));var express=require(_0x2f45('0x3'));var router=express[_0x2f45('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f45('0x5'));var interaction=require(_0x2f45('0x6'));var config=require(_0x2f45('0x7'));var controller=require(_0x2f45('0x8'));router['get']('/',auth[_0x2f45('0x9')](),controller[_0x2f45('0xa')]);router['get'](_0x2f45('0xb'),auth['isAuthenticated'](),controller[_0x2f45('0xc')]);router[_0x2f45('0xd')](_0x2f45('0xe'),auth['isAuthenticated'](),controller[_0x2f45('0xf')]);router[_0x2f45('0xd')](_0x2f45('0x10'),auth['isAuthenticated'](),controller[_0x2f45('0x11')]);router[_0x2f45('0xd')](_0x2f45('0x12'),auth[_0x2f45('0x9')](),controller[_0x2f45('0x13')]);router['post']('/',auth[_0x2f45('0x9')](),controller[_0x2f45('0x14')]);router[_0x2f45('0x15')]('/:id',auth[_0x2f45('0x9')](),controller[_0x2f45('0x16')]);router[_0x2f45('0x17')](_0x2f45('0xb'),auth[_0x2f45('0x9')](),controller[_0x2f45('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc57e=['get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','delete','exports','multer','util','path','express','Router','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x37b22d,_0x16a6ad){var _0xc3c038=function(_0x362e00){while(--_0x362e00){_0x37b22d['push'](_0x37b22d['shift']());}};_0xc3c038(++_0x16a6ad);}(_0xc57e,0x129));var _0xec57=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc57e[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xec57('0x0'));var util=require(_0xec57('0x1'));var path=require(_0xec57('0x2'));var timeout=require('connect-timeout');var express=require(_0xec57('0x3'));var router=express[_0xec57('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec57('0x5'));var controller=require(_0xec57('0x6'));router[_0xec57('0x7')]('/',auth[_0xec57('0x8')](),controller[_0xec57('0x9')]);router[_0xec57('0x7')](_0xec57('0xa'),auth[_0xec57('0x8')](),controller['show']);router['get'](_0xec57('0xb'),auth[_0xec57('0x8')](),controller['getSubjects']);router[_0xec57('0x7')](_0xec57('0xc'),auth[_0xec57('0x8')](),controller[_0xec57('0xd')]);router['get'](_0xec57('0xe'),auth[_0xec57('0x8')](),controller[_0xec57('0xf')]);router[_0xec57('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xec57('0xa'),auth[_0xec57('0x8')](),controller['update']);router[_0xec57('0x11')](_0xec57('0xa'),auth[_0xec57('0x8')](),controller['destroy']);module[_0xec57('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a6f358b..77ac348 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 _0x58d9=['sequelize','exports','STRING'];(function(_0xa80d4f,_0x1359b9){var _0xb24216=function(_0x23545f){while(--_0x23545f){_0xa80d4f['push'](_0xa80d4f['shift']());}};_0xb24216(++_0x1359b9);}(_0x58d9,0xcf));var _0x958d=function(_0x35a9a7,_0x2129d2){_0x35a9a7=_0x35a9a7-0x0;var _0x38d34b=_0x58d9[_0x35a9a7];return _0x38d34b;};'use strict';var Sequelize=require(_0x958d('0x0'));module[_0x958d('0x1')]={'name':{'type':Sequelize[_0x958d('0x2')]},'description':{'type':Sequelize[_0x958d('0x2')]}}; \ No newline at end of file +var _0xabed=['exports','STRING','sequelize'];(function(_0x5cbfc3,_0x230cd7){var _0x16878d=function(_0x2c612a){while(--_0x2c612a){_0x5cbfc3['push'](_0x5cbfc3['shift']());}};_0x16878d(++_0x230cd7);}(_0xabed,0xe3));var _0xdabe=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xabed[_0x10dfdf];return _0x4d857d;};'use strict';var Sequelize=require(_0xdabe('0x0'));module[_0xdabe('0x1')]={'name':{'type':Sequelize[_0xdabe('0x2')]},'description':{'type':Sequelize[_0xdabe('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d995a28..42db592 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 _0xc0af=['key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','count','limit','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName'];(function(_0x2edd3b,_0x297c1a){var _0x486d29=function(_0x1893cd){while(--_0x1893cd){_0x2edd3b['push'](_0x2edd3b['shift']());}};_0x486d29(++_0x297c1a);}(_0xc0af,0x6f));var _0xfc0a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0af[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfc0a('0x0'));var rimraf=require(_0xfc0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfc0a('0x2'));var moment=require(_0xfc0a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfc0a('0x4'));var util=require(_0xfc0a('0x5'));var path=require(_0xfc0a('0x6'));var sox=require('sox');var csv=require(_0xfc0a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc0a('0x8'));var _=require(_0xfc0a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfc0a('0xa'));var deskjs=require(_0xfc0a('0xb'));var toCsv=require(_0xfc0a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc0a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfc0a('0xd'));var as=require(_0xfc0a('0xe'));var hardwareService=require(_0xfc0a('0xf'));var logger=require(_0xfc0a('0x10'))(_0xfc0a('0x11'));var utils=require(_0xfc0a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfc0a('0x13'));var db=require(_0xfc0a('0x14'))['db'];function respondWithStatusCode(_0x5e9a82,_0x530a2f){_0x530a2f=_0x530a2f||0xcc;return function(_0x20ff27){if(_0x20ff27){return _0x5e9a82['sendStatus'](_0x530a2f);}return _0x5e9a82['status'](_0x530a2f)['end']();};}function respondWithResult(_0x3ec259,_0x463c21){_0x463c21=_0x463c21||0xc8;return function(_0x5f1542){if(_0x5f1542){return _0x3ec259[_0xfc0a('0x15')](_0x463c21)['json'](_0x5f1542);}};}function respondWithFilteredResult(_0x187fc3,_0x1958f7){return function(_0x16bee8){if(_0x16bee8){var _0xbaa7c7=typeof _0x1958f7[_0xfc0a('0x16')]==='undefined'&&typeof _0x1958f7['limit']==='undefined';var _0x3043c1=_0x16bee8[_0xfc0a('0x17')];var _0x549332=_0xbaa7c7?0x0:_0x1958f7[_0xfc0a('0x16')];var _0x16651d=_0xbaa7c7?_0x16bee8[_0xfc0a('0x17')]:_0x1958f7[_0xfc0a('0x16')]+_0x1958f7[_0xfc0a('0x18')];var _0x5842fb;if(_0x16651d>=_0x3043c1){_0x16651d=_0x3043c1;_0x5842fb=0xc8;}else{_0x5842fb=0xce;}_0x187fc3['status'](_0x5842fb);return _0x187fc3[_0xfc0a('0x19')]('Content-Range',_0x549332+'-'+_0x16651d+'/'+_0x3043c1)[_0xfc0a('0x1a')](_0x16bee8);}return null;};}function patchUpdates(_0x2e1fd1){return function(_0x2c0bbd){try{jsonpatch[_0xfc0a('0x1b')](_0x2c0bbd,_0x2e1fd1,!![]);}catch(_0x5618f9){return BPromise[_0xfc0a('0x1c')](_0x5618f9);}return _0x2c0bbd[_0xfc0a('0x1d')]();};}function saveUpdates(_0x2a6447,_0x19dee0){return function(_0x5b120e){if(_0x5b120e){return _0x5b120e['update'](_0x2a6447)[_0xfc0a('0x1e')](function(_0x5537e5){return _0x5537e5;});}return null;};}function removeEntity(_0x469f1,_0x354a34){return function(_0x2528fa){if(_0x2528fa){return _0x2528fa[_0xfc0a('0x1f')]()[_0xfc0a('0x1e')](function(){_0x469f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de1a7,_0x22339b){return function(_0x352a5b){if(!_0x352a5b){_0x1de1a7[_0xfc0a('0x20')](0x194);}return _0x352a5b;};}function handleError(_0x18acd6,_0x19f09b){_0x19f09b=_0x19f09b||0x1f4;return function(_0x2e3189){logger[_0xfc0a('0x21')](_0x2e3189[_0xfc0a('0x22')]);if(_0x2e3189[_0xfc0a('0x23')]){delete _0x2e3189[_0xfc0a('0x23')];}_0x18acd6['status'](_0x19f09b)['send'](_0x2e3189);};}exports[_0xfc0a('0x24')]=function(_0x36753a,_0x2110cd){var _0x4f895a={},_0x5d8b53={},_0x1be176={'count':0x0,'rows':[]};var _0x46d5ab=_[_0xfc0a('0x25')](db[_0xfc0a('0x26')][_0xfc0a('0x27')],function(_0x1a1cee){return{'name':_0x1a1cee[_0xfc0a('0x28')],'type':_0x1a1cee['type'][_0xfc0a('0x29')]};});_0x5d8b53[_0xfc0a('0x2a')]=_[_0xfc0a('0x25')](_0x46d5ab,_0xfc0a('0x23'));_0x5d8b53[_0xfc0a('0x2b')]=_[_0xfc0a('0x2c')](_0x36753a[_0xfc0a('0x2b')]);_0x5d8b53['filters']=_[_0xfc0a('0x2d')](_0x5d8b53[_0xfc0a('0x2a')],_0x5d8b53[_0xfc0a('0x2b')]);_0x4f895a[_0xfc0a('0x2e')]=_[_0xfc0a('0x2d')](_0x5d8b53[_0xfc0a('0x2a')],qs[_0xfc0a('0x2f')](_0x36753a['query'][_0xfc0a('0x2f')]));_0x4f895a[_0xfc0a('0x2e')]=_0x4f895a[_0xfc0a('0x2e')]['length']?_0x4f895a['attributes']:_0x5d8b53[_0xfc0a('0x2a')];if(!_0x36753a[_0xfc0a('0x2b')]['hasOwnProperty'](_0xfc0a('0x30'))){_0x4f895a['limit']=qs[_0xfc0a('0x18')](_0x36753a[_0xfc0a('0x2b')][_0xfc0a('0x18')]);_0x4f895a[_0xfc0a('0x16')]=qs[_0xfc0a('0x16')](_0x36753a[_0xfc0a('0x2b')][_0xfc0a('0x16')]);}_0x4f895a[_0xfc0a('0x31')]=qs['sort'](_0x36753a[_0xfc0a('0x2b')][_0xfc0a('0x32')]);_0x4f895a[_0xfc0a('0x33')]=qs[_0xfc0a('0x34')](_[_0xfc0a('0x35')](_0x36753a[_0xfc0a('0x2b')],_0x5d8b53['filters']),_0x46d5ab);if(_0x36753a[_0xfc0a('0x2b')][_0xfc0a('0x36')]){_0x4f895a['where']=_[_0xfc0a('0x37')](_0x4f895a[_0xfc0a('0x33')],{'$or':_[_0xfc0a('0x25')](_0x46d5ab,function(_0x470766){if(_0x470766[_0xfc0a('0x38')]!=='VIRTUAL'){var _0x18bde4={};_0x18bde4[_0x470766[_0xfc0a('0x23')]]={'$like':'%'+_0x36753a[_0xfc0a('0x2b')]['filter']+'%'};return _0x18bde4;}})});}_0x4f895a=_[_0xfc0a('0x37')]({},_0x4f895a,_0x36753a[_0xfc0a('0x39')]);var _0x26ff5c={'where':_0x4f895a['where']};return db['FreshsalesConfiguration'][_0xfc0a('0x17')](_0x26ff5c)['then'](function(_0x5ae730){_0x1be176[_0xfc0a('0x17')]=_0x5ae730;if(_0x36753a[_0xfc0a('0x2b')][_0xfc0a('0x3a')]){_0x4f895a[_0xfc0a('0x3b')]=[{'all':!![]}];}return db[_0xfc0a('0x26')][_0xfc0a('0x3c')](_0x4f895a);})[_0xfc0a('0x1e')](function(_0x1c7da9){_0x1be176[_0xfc0a('0x3d')]=_0x1c7da9;return _0x1be176;})['then'](respondWithFilteredResult(_0x2110cd,_0x4f895a))[_0xfc0a('0x3e')](handleError(_0x2110cd,null));};exports[_0xfc0a('0x3f')]=function(_0x4e3429,_0x3ecc9c){var _0x5901a9={'raw':![],'where':{'id':_0x4e3429[_0xfc0a('0x40')]['id']}},_0x40b24a={};_0x40b24a[_0xfc0a('0x2a')]=_['keys'](db[_0xfc0a('0x26')][_0xfc0a('0x27')]);_0x40b24a[_0xfc0a('0x2b')]=_[_0xfc0a('0x2c')](_0x4e3429[_0xfc0a('0x2b')]);_0x40b24a['filters']=_['intersection'](_0x40b24a['model'],_0x40b24a[_0xfc0a('0x2b')]);_0x5901a9[_0xfc0a('0x2e')]=_[_0xfc0a('0x2d')](_0x40b24a[_0xfc0a('0x2a')],qs[_0xfc0a('0x2f')](_0x4e3429[_0xfc0a('0x2b')][_0xfc0a('0x2f')]));_0x5901a9[_0xfc0a('0x2e')]=_0x5901a9['attributes'][_0xfc0a('0x41')]?_0x5901a9['attributes']:_0x40b24a['model'];if(_0x4e3429[_0xfc0a('0x2b')]['includeAll']){_0x5901a9[_0xfc0a('0x3b')]=[{'all':!![]}];}_0x5901a9=_[_0xfc0a('0x37')]({},_0x5901a9,_0x4e3429['options']);return db[_0xfc0a('0x26')]['find'](_0x5901a9)['then'](handleEntityNotFound(_0x3ecc9c,null))[_0xfc0a('0x1e')](respondWithResult(_0x3ecc9c,null))[_0xfc0a('0x3e')](handleError(_0x3ecc9c,null));};exports[_0xfc0a('0x42')]=function(_0x3c7392,_0x32279f){return db['FreshsalesConfiguration'][_0xfc0a('0x42')](_0x3c7392[_0xfc0a('0x43')],{})[_0xfc0a('0x1e')](respondWithResult(_0x32279f,0xc9))[_0xfc0a('0x3e')](handleError(_0x32279f,null));};exports[_0xfc0a('0x44')]=function(_0xd63ffd,_0x237e71){if(_0xd63ffd['body']['id']){delete _0xd63ffd[_0xfc0a('0x43')]['id'];}return db[_0xfc0a('0x26')][_0xfc0a('0x45')]({'where':{'id':_0xd63ffd[_0xfc0a('0x40')]['id']}})[_0xfc0a('0x1e')](handleEntityNotFound(_0x237e71,null))[_0xfc0a('0x1e')](saveUpdates(_0xd63ffd['body'],null))['then'](respondWithResult(_0x237e71,null))['catch'](handleError(_0x237e71,null));};exports[_0xfc0a('0x1f')]=function(_0x4b6fd5,_0x3ababd){return db[_0xfc0a('0x26')][_0xfc0a('0x45')]({'where':{'id':_0x4b6fd5[_0xfc0a('0x40')]['id']}})['then'](handleEntityNotFound(_0x3ababd,null))['then'](removeEntity(_0x3ababd,null))[_0xfc0a('0x3e')](handleError(_0x3ababd,null));};exports[_0xfc0a('0x46')]=function(_0x2b096a,_0x4f1371,_0x130712){var _0x3d6cca={};var _0x50e6f9={};var _0x3d7e50;var _0x207ab1;return db[_0xfc0a('0x26')][_0xfc0a('0x47')]({'where':{'id':_0x2b096a[_0xfc0a('0x40')]['id']}})[_0xfc0a('0x1e')](handleEntityNotFound(_0x4f1371,null))['then'](function(_0x259efd){if(_0x259efd){_0x3d7e50=_0x259efd;_0x50e6f9[_0xfc0a('0x2a')]=_['keys'](db[_0xfc0a('0x48')][_0xfc0a('0x27')]);_0x50e6f9['query']=_[_0xfc0a('0x2c')](_0x2b096a[_0xfc0a('0x2b')]);_0x50e6f9[_0xfc0a('0x34')]=_[_0xfc0a('0x2d')](_0x50e6f9[_0xfc0a('0x2a')],_0x50e6f9['query']);_0x3d6cca[_0xfc0a('0x2e')]=_['intersection'](_0x50e6f9[_0xfc0a('0x2a')],qs[_0xfc0a('0x2f')](_0x2b096a[_0xfc0a('0x2b')][_0xfc0a('0x2f')]));_0x3d6cca[_0xfc0a('0x2e')]=_0x3d6cca[_0xfc0a('0x2e')][_0xfc0a('0x41')]?_0x3d6cca[_0xfc0a('0x2e')]:_0x50e6f9['model'];_0x3d6cca[_0xfc0a('0x31')]=qs[_0xfc0a('0x32')](_0x2b096a[_0xfc0a('0x2b')][_0xfc0a('0x32')]);_0x3d6cca[_0xfc0a('0x33')]=qs[_0xfc0a('0x34')](_[_0xfc0a('0x35')](_0x2b096a[_0xfc0a('0x2b')],_0x50e6f9['filters']));if(_0x2b096a[_0xfc0a('0x2b')]['filter']){_0x3d6cca[_0xfc0a('0x33')]=_[_0xfc0a('0x37')](_0x3d6cca['where'],{'$or':_['map'](_0x3d6cca[_0xfc0a('0x2e')],function(_0x840027){var _0x22ac49={};_0x22ac49[_0x840027]={'$like':'%'+_0x2b096a[_0xfc0a('0x2b')][_0xfc0a('0x36')]+'%'};return _0x22ac49;})});}_0x3d6cca=_[_0xfc0a('0x37')]({},_0x3d6cca,_0x2b096a[_0xfc0a('0x39')]);return _0x3d7e50[_0xfc0a('0x46')](_0x3d6cca);}})[_0xfc0a('0x1e')](function(_0x1293c4){if(_0x1293c4){_0x207ab1=_0x1293c4[_0xfc0a('0x41')];if(!_0x2b096a[_0xfc0a('0x2b')][_0xfc0a('0x49')](_0xfc0a('0x30'))){_0x3d6cca[_0xfc0a('0x18')]=qs[_0xfc0a('0x18')](_0x2b096a['query'][_0xfc0a('0x18')]);_0x3d6cca[_0xfc0a('0x16')]=qs[_0xfc0a('0x16')](_0x2b096a[_0xfc0a('0x2b')][_0xfc0a('0x16')]);}return _0x3d7e50[_0xfc0a('0x46')](_0x3d6cca);}})[_0xfc0a('0x1e')](function(_0x57af5e){if(_0x57af5e){return _0x57af5e?{'count':_0x207ab1,'rows':_0x57af5e}:null;}})[_0xfc0a('0x1e')](respondWithResult(_0x4f1371,null))[_0xfc0a('0x3e')](handleError(_0x4f1371,null));};exports['getDescriptions']=function(_0x4be197,_0x5c634e,_0x1f01fc){var _0x5b6748={};var _0x444712={};var _0x471a32;var _0x2a02fa;return db['FreshsalesConfiguration'][_0xfc0a('0x47')]({'where':{'id':_0x4be197['params']['id']}})[_0xfc0a('0x1e')](handleEntityNotFound(_0x5c634e,null))['then'](function(_0x339d7d){if(_0x339d7d){_0x471a32=_0x339d7d;_0x444712['model']=_[_0xfc0a('0x2c')](db[_0xfc0a('0x48')]['rawAttributes']);_0x444712[_0xfc0a('0x2b')]=_['keys'](_0x4be197['query']);_0x444712[_0xfc0a('0x34')]=_[_0xfc0a('0x2d')](_0x444712[_0xfc0a('0x2a')],_0x444712[_0xfc0a('0x2b')]);_0x5b6748[_0xfc0a('0x2e')]=_[_0xfc0a('0x2d')](_0x444712[_0xfc0a('0x2a')],qs[_0xfc0a('0x2f')](_0x4be197['query'][_0xfc0a('0x2f')]));_0x5b6748[_0xfc0a('0x2e')]=_0x5b6748[_0xfc0a('0x2e')][_0xfc0a('0x41')]?_0x5b6748[_0xfc0a('0x2e')]:_0x444712['model'];_0x5b6748[_0xfc0a('0x31')]=qs['sort'](_0x4be197[_0xfc0a('0x2b')][_0xfc0a('0x32')]);_0x5b6748['where']=qs[_0xfc0a('0x34')](_[_0xfc0a('0x35')](_0x4be197[_0xfc0a('0x2b')],_0x444712['filters']));if(_0x4be197[_0xfc0a('0x2b')][_0xfc0a('0x36')]){_0x5b6748[_0xfc0a('0x33')]=_[_0xfc0a('0x37')](_0x5b6748[_0xfc0a('0x33')],{'$or':_['map'](_0x5b6748[_0xfc0a('0x2e')],function(_0x97f5e2){var _0x42fb19={};_0x42fb19[_0x97f5e2]={'$like':'%'+_0x4be197[_0xfc0a('0x2b')][_0xfc0a('0x36')]+'%'};return _0x42fb19;})});}_0x5b6748=_['merge']({},_0x5b6748,_0x4be197[_0xfc0a('0x39')]);return _0x471a32[_0xfc0a('0x4a')](_0x5b6748);}})[_0xfc0a('0x1e')](function(_0x3be2e8){if(_0x3be2e8){_0x2a02fa=_0x3be2e8[_0xfc0a('0x41')];if(!_0x4be197[_0xfc0a('0x2b')][_0xfc0a('0x49')](_0xfc0a('0x30'))){_0x5b6748['limit']=qs[_0xfc0a('0x18')](_0x4be197[_0xfc0a('0x2b')]['limit']);_0x5b6748[_0xfc0a('0x16')]=qs[_0xfc0a('0x16')](_0x4be197[_0xfc0a('0x2b')][_0xfc0a('0x16')]);}return _0x471a32['getDescriptions'](_0x5b6748);}})[_0xfc0a('0x1e')](function(_0x4c8217){if(_0x4c8217){return _0x4c8217?{'count':_0x2a02fa,'rows':_0x4c8217}:null;}})[_0xfc0a('0x1e')](respondWithResult(_0x5c634e,null))['catch'](handleError(_0x5c634e,null));};exports['getFields']=function(_0x212700,_0x2c5af1,_0x3fc367){var _0x2f8561={};var _0x270f0c={};var _0x2c00d2;var _0x5a9de9;return db[_0xfc0a('0x26')]['findOne']({'where':{'id':_0x212700[_0xfc0a('0x40')]['id']}})[_0xfc0a('0x1e')](handleEntityNotFound(_0x2c5af1,null))[_0xfc0a('0x1e')](function(_0x144f58){if(_0x144f58){_0x2c00d2=_0x144f58;_0x270f0c[_0xfc0a('0x2a')]=_[_0xfc0a('0x2c')](db[_0xfc0a('0x48')]['rawAttributes']);_0x270f0c[_0xfc0a('0x2b')]=_['keys'](_0x212700[_0xfc0a('0x2b')]);_0x270f0c[_0xfc0a('0x34')]=_[_0xfc0a('0x2d')](_0x270f0c[_0xfc0a('0x2a')],_0x270f0c['query']);_0x2f8561['attributes']=_[_0xfc0a('0x2d')](_0x270f0c[_0xfc0a('0x2a')],qs[_0xfc0a('0x2f')](_0x212700[_0xfc0a('0x2b')]['fields']));_0x2f8561['attributes']=_0x2f8561['attributes'][_0xfc0a('0x41')]?_0x2f8561[_0xfc0a('0x2e')]:_0x270f0c[_0xfc0a('0x2a')];_0x2f8561[_0xfc0a('0x31')]=qs[_0xfc0a('0x32')](_0x212700[_0xfc0a('0x2b')][_0xfc0a('0x32')]);_0x2f8561[_0xfc0a('0x33')]=qs[_0xfc0a('0x34')](_[_0xfc0a('0x35')](_0x212700[_0xfc0a('0x2b')],_0x270f0c[_0xfc0a('0x34')]));if(_0x212700['query'][_0xfc0a('0x36')]){_0x2f8561['where']=_[_0xfc0a('0x37')](_0x2f8561[_0xfc0a('0x33')],{'$or':_[_0xfc0a('0x25')](_0x2f8561[_0xfc0a('0x2e')],function(_0x2f8457){var _0xbd04dc={};_0xbd04dc[_0x2f8457]={'$like':'%'+_0x212700['query'][_0xfc0a('0x36')]+'%'};return _0xbd04dc;})});}_0x2f8561=_[_0xfc0a('0x37')]({},_0x2f8561,_0x212700[_0xfc0a('0x39')]);return _0x2c00d2['getFields'](_0x2f8561);}})[_0xfc0a('0x1e')](function(_0x1a07f8){if(_0x1a07f8){_0x5a9de9=_0x1a07f8['length'];if(!_0x212700[_0xfc0a('0x2b')][_0xfc0a('0x49')]('nolimit')){_0x2f8561[_0xfc0a('0x18')]=qs[_0xfc0a('0x18')](_0x212700[_0xfc0a('0x2b')][_0xfc0a('0x18')]);_0x2f8561[_0xfc0a('0x16')]=qs[_0xfc0a('0x16')](_0x212700[_0xfc0a('0x2b')][_0xfc0a('0x16')]);}return _0x2c00d2[_0xfc0a('0x4b')](_0x2f8561);}})[_0xfc0a('0x1e')](function(_0x4acb17){if(_0x4acb17){return _0x4acb17?{'count':_0x5a9de9,'rows':_0x4acb17}:null;}})[_0xfc0a('0x1e')](respondWithResult(_0x2c5af1,null))[_0xfc0a('0x3e')](handleError(_0x2c5af1,null));}; \ No newline at end of file +var _0x9004=['intersection','fields','length','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','catch','show','params','merge','find','create','body','update','findOne','order','pick','hasOwnProperty','getSubjects','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','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','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','reject','then','destroy','sendStatus','stack','name','map','FreshsalesConfiguration','rawAttributes','fieldName','type','query','keys','filters','model','attributes'];(function(_0x49945e,_0x161d29){var _0x3b825a=function(_0x3a913b){while(--_0x3a913b){_0x49945e['push'](_0x49945e['shift']());}};_0x3b825a(++_0x161d29);}(_0x9004,0x6a));var _0x4900=function(_0x36e4ce,_0x576858){_0x36e4ce=_0x36e4ce-0x0;var _0x2a9753=_0x9004[_0x36e4ce];return _0x2a9753;};'use strict';var emlformat=require(_0x4900('0x0'));var rimraf=require(_0x4900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4900('0x2'));var rp=require(_0x4900('0x3'));var moment=require(_0x4900('0x4'));var BPromise=require(_0x4900('0x5'));var Mustache=require(_0x4900('0x6'));var util=require('util');var path=require(_0x4900('0x7'));var sox=require(_0x4900('0x8'));var csv=require('to-csv');var ejs=require(_0x4900('0x9'));var fs=require('fs');var fs_extra=require(_0x4900('0xa'));var _=require(_0x4900('0xb'));var squel=require('squel');var crypto=require(_0x4900('0xc'));var jsforce=require(_0x4900('0xd'));var deskjs=require(_0x4900('0xe'));var toCsv=require(_0x4900('0xf'));var querystring=require(_0x4900('0x10'));var Papa=require(_0x4900('0x11'));var Redis=require(_0x4900('0x12'));var authService=require(_0x4900('0x13'));var qs=require(_0x4900('0x14'));var as=require(_0x4900('0x15'));var hardwareService=require(_0x4900('0x16'));var logger=require(_0x4900('0x17'))(_0x4900('0x18'));var utils=require(_0x4900('0x19'));var config=require(_0x4900('0x1a'));var licenseUtil=require(_0x4900('0x1b'));var db=require(_0x4900('0x1c'))['db'];function respondWithStatusCode(_0x5d95c5,_0x2a5b12){_0x2a5b12=_0x2a5b12||0xcc;return function(_0x4057ea){if(_0x4057ea){return _0x5d95c5['sendStatus'](_0x2a5b12);}return _0x5d95c5[_0x4900('0x1d')](_0x2a5b12)[_0x4900('0x1e')]();};}function respondWithResult(_0x48b932,_0x1646f0){_0x1646f0=_0x1646f0||0xc8;return function(_0x1994c1){if(_0x1994c1){return _0x48b932['status'](_0x1646f0)['json'](_0x1994c1);}};}function respondWithFilteredResult(_0x2c1d5c,_0x137706){return function(_0x7dafea){if(_0x7dafea){var _0x5c1cd1=typeof _0x137706[_0x4900('0x1f')]===_0x4900('0x20')&&typeof _0x137706[_0x4900('0x21')]===_0x4900('0x20');var _0x236e19=_0x7dafea[_0x4900('0x22')];var _0x1d1baf=_0x5c1cd1?0x0:_0x137706[_0x4900('0x1f')];var _0x203bbc=_0x5c1cd1?_0x7dafea[_0x4900('0x22')]:_0x137706[_0x4900('0x1f')]+_0x137706[_0x4900('0x21')];var _0x45650b;if(_0x203bbc>=_0x236e19){_0x203bbc=_0x236e19;_0x45650b=0xc8;}else{_0x45650b=0xce;}_0x2c1d5c[_0x4900('0x1d')](_0x45650b);return _0x2c1d5c['set'](_0x4900('0x23'),_0x1d1baf+'-'+_0x203bbc+'/'+_0x236e19)['json'](_0x7dafea);}return null;};}function patchUpdates(_0x46ac55){return function(_0x16a4b4){try{jsonpatch['apply'](_0x16a4b4,_0x46ac55,!![]);}catch(_0x163b38){return BPromise[_0x4900('0x24')](_0x163b38);}return _0x16a4b4['save']();};}function saveUpdates(_0x2642a7,_0x4cda24){return function(_0x1b595d){if(_0x1b595d){return _0x1b595d['update'](_0x2642a7)[_0x4900('0x25')](function(_0x322760){return _0x322760;});}return null;};}function removeEntity(_0x217fe8,_0x5e8f0a){return function(_0x203751){if(_0x203751){return _0x203751[_0x4900('0x26')]()[_0x4900('0x25')](function(){_0x217fe8[_0x4900('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb816,_0x1964e0){return function(_0x2c37e9){if(!_0x2c37e9){_0x4fb816[_0x4900('0x27')](0x194);}return _0x2c37e9;};}function handleError(_0x1256fe,_0x4aaf54){_0x4aaf54=_0x4aaf54||0x1f4;return function(_0x177973){logger['error'](_0x177973[_0x4900('0x28')]);if(_0x177973['name']){delete _0x177973[_0x4900('0x29')];}_0x1256fe['status'](_0x4aaf54)['send'](_0x177973);};}exports['index']=function(_0x3e8a6b,_0x473799){var _0x2abf8d={},_0x5eb2fd={},_0x15e172={'count':0x0,'rows':[]};var _0x241b8a=_[_0x4900('0x2a')](db[_0x4900('0x2b')][_0x4900('0x2c')],function(_0x3f3dfa){return{'name':_0x3f3dfa[_0x4900('0x2d')],'type':_0x3f3dfa[_0x4900('0x2e')]['key']};});_0x5eb2fd['model']=_['map'](_0x241b8a,_0x4900('0x29'));_0x5eb2fd[_0x4900('0x2f')]=_[_0x4900('0x30')](_0x3e8a6b[_0x4900('0x2f')]);_0x5eb2fd[_0x4900('0x31')]=_['intersection'](_0x5eb2fd[_0x4900('0x32')],_0x5eb2fd[_0x4900('0x2f')]);_0x2abf8d[_0x4900('0x33')]=_[_0x4900('0x34')](_0x5eb2fd[_0x4900('0x32')],qs['fields'](_0x3e8a6b['query'][_0x4900('0x35')]));_0x2abf8d['attributes']=_0x2abf8d['attributes'][_0x4900('0x36')]?_0x2abf8d[_0x4900('0x33')]:_0x5eb2fd[_0x4900('0x32')];if(!_0x3e8a6b[_0x4900('0x2f')]['hasOwnProperty'](_0x4900('0x37'))){_0x2abf8d['limit']=qs[_0x4900('0x21')](_0x3e8a6b['query'][_0x4900('0x21')]);_0x2abf8d[_0x4900('0x1f')]=qs[_0x4900('0x1f')](_0x3e8a6b[_0x4900('0x2f')][_0x4900('0x1f')]);}_0x2abf8d['order']=qs['sort'](_0x3e8a6b[_0x4900('0x2f')][_0x4900('0x38')]);_0x2abf8d[_0x4900('0x39')]=qs[_0x4900('0x31')](_['pick'](_0x3e8a6b[_0x4900('0x2f')],_0x5eb2fd['filters']),_0x241b8a);if(_0x3e8a6b[_0x4900('0x2f')][_0x4900('0x3a')]){_0x2abf8d[_0x4900('0x39')]=_['merge'](_0x2abf8d[_0x4900('0x39')],{'$or':_['map'](_0x241b8a,function(_0xa9cbf8){if(_0xa9cbf8[_0x4900('0x2e')]!==_0x4900('0x3b')){var _0x1e83ec={};_0x1e83ec[_0xa9cbf8[_0x4900('0x29')]]={'$like':'%'+_0x3e8a6b[_0x4900('0x2f')][_0x4900('0x3a')]+'%'};return _0x1e83ec;}})});}_0x2abf8d=_['merge']({},_0x2abf8d,_0x3e8a6b[_0x4900('0x3c')]);var _0xcde65={'where':_0x2abf8d[_0x4900('0x39')]};return db[_0x4900('0x2b')][_0x4900('0x22')](_0xcde65)[_0x4900('0x25')](function(_0x440b0e){_0x15e172[_0x4900('0x22')]=_0x440b0e;if(_0x3e8a6b['query'][_0x4900('0x3d')]){_0x2abf8d[_0x4900('0x3e')]=[{'all':!![]}];}return db[_0x4900('0x2b')]['findAll'](_0x2abf8d);})[_0x4900('0x25')](function(_0x24f4b0){_0x15e172['rows']=_0x24f4b0;return _0x15e172;})[_0x4900('0x25')](respondWithFilteredResult(_0x473799,_0x2abf8d))[_0x4900('0x3f')](handleError(_0x473799,null));};exports[_0x4900('0x40')]=function(_0x5df812,_0x1d099d){var _0x4116bc={'raw':![],'where':{'id':_0x5df812[_0x4900('0x41')]['id']}},_0x4ac086={};_0x4ac086[_0x4900('0x32')]=_[_0x4900('0x30')](db[_0x4900('0x2b')][_0x4900('0x2c')]);_0x4ac086[_0x4900('0x2f')]=_['keys'](_0x5df812[_0x4900('0x2f')]);_0x4ac086[_0x4900('0x31')]=_[_0x4900('0x34')](_0x4ac086[_0x4900('0x32')],_0x4ac086[_0x4900('0x2f')]);_0x4116bc[_0x4900('0x33')]=_[_0x4900('0x34')](_0x4ac086['model'],qs[_0x4900('0x35')](_0x5df812['query'][_0x4900('0x35')]));_0x4116bc['attributes']=_0x4116bc[_0x4900('0x33')][_0x4900('0x36')]?_0x4116bc[_0x4900('0x33')]:_0x4ac086[_0x4900('0x32')];if(_0x5df812['query'][_0x4900('0x3d')]){_0x4116bc[_0x4900('0x3e')]=[{'all':!![]}];}_0x4116bc=_[_0x4900('0x42')]({},_0x4116bc,_0x5df812[_0x4900('0x3c')]);return db[_0x4900('0x2b')][_0x4900('0x43')](_0x4116bc)['then'](handleEntityNotFound(_0x1d099d,null))[_0x4900('0x25')](respondWithResult(_0x1d099d,null))[_0x4900('0x3f')](handleError(_0x1d099d,null));};exports[_0x4900('0x44')]=function(_0x2c96fc,_0x20d8ac){return db[_0x4900('0x2b')][_0x4900('0x44')](_0x2c96fc[_0x4900('0x45')],{})[_0x4900('0x25')](respondWithResult(_0x20d8ac,0xc9))['catch'](handleError(_0x20d8ac,null));};exports[_0x4900('0x46')]=function(_0x2c1adc,_0x2a3f9a){if(_0x2c1adc['body']['id']){delete _0x2c1adc[_0x4900('0x45')]['id'];}return db[_0x4900('0x2b')][_0x4900('0x43')]({'where':{'id':_0x2c1adc[_0x4900('0x41')]['id']}})[_0x4900('0x25')](handleEntityNotFound(_0x2a3f9a,null))['then'](saveUpdates(_0x2c1adc[_0x4900('0x45')],null))['then'](respondWithResult(_0x2a3f9a,null))[_0x4900('0x3f')](handleError(_0x2a3f9a,null));};exports['destroy']=function(_0x1c0e6c,_0x4fcc6f){return db[_0x4900('0x2b')]['find']({'where':{'id':_0x1c0e6c[_0x4900('0x41')]['id']}})[_0x4900('0x25')](handleEntityNotFound(_0x4fcc6f,null))[_0x4900('0x25')](removeEntity(_0x4fcc6f,null))[_0x4900('0x3f')](handleError(_0x4fcc6f,null));};exports['getSubjects']=function(_0x190c23,_0x58ca0e,_0x47d27b){var _0x5b1b3a={};var _0x2b0be0={};var _0xea036;var _0x19a8d9;return db['FreshsalesConfiguration'][_0x4900('0x47')]({'where':{'id':_0x190c23['params']['id']}})[_0x4900('0x25')](handleEntityNotFound(_0x58ca0e,null))['then'](function(_0x196d6f){if(_0x196d6f){_0xea036=_0x196d6f;_0x2b0be0['model']=_[_0x4900('0x30')](db['FreshsalesField'][_0x4900('0x2c')]);_0x2b0be0['query']=_[_0x4900('0x30')](_0x190c23[_0x4900('0x2f')]);_0x2b0be0[_0x4900('0x31')]=_['intersection'](_0x2b0be0[_0x4900('0x32')],_0x2b0be0['query']);_0x5b1b3a[_0x4900('0x33')]=_[_0x4900('0x34')](_0x2b0be0['model'],qs[_0x4900('0x35')](_0x190c23['query'][_0x4900('0x35')]));_0x5b1b3a[_0x4900('0x33')]=_0x5b1b3a[_0x4900('0x33')][_0x4900('0x36')]?_0x5b1b3a['attributes']:_0x2b0be0[_0x4900('0x32')];_0x5b1b3a[_0x4900('0x48')]=qs[_0x4900('0x38')](_0x190c23[_0x4900('0x2f')][_0x4900('0x38')]);_0x5b1b3a['where']=qs[_0x4900('0x31')](_[_0x4900('0x49')](_0x190c23[_0x4900('0x2f')],_0x2b0be0[_0x4900('0x31')]));if(_0x190c23[_0x4900('0x2f')][_0x4900('0x3a')]){_0x5b1b3a['where']=_['merge'](_0x5b1b3a[_0x4900('0x39')],{'$or':_['map'](_0x5b1b3a[_0x4900('0x33')],function(_0x3f5a60){var _0x8ea5c3={};_0x8ea5c3[_0x3f5a60]={'$like':'%'+_0x190c23[_0x4900('0x2f')][_0x4900('0x3a')]+'%'};return _0x8ea5c3;})});}_0x5b1b3a=_[_0x4900('0x42')]({},_0x5b1b3a,_0x190c23[_0x4900('0x3c')]);return _0xea036['getSubjects'](_0x5b1b3a);}})[_0x4900('0x25')](function(_0x366e73){if(_0x366e73){_0x19a8d9=_0x366e73['length'];if(!_0x190c23[_0x4900('0x2f')][_0x4900('0x4a')](_0x4900('0x37'))){_0x5b1b3a['limit']=qs[_0x4900('0x21')](_0x190c23['query'][_0x4900('0x21')]);_0x5b1b3a[_0x4900('0x1f')]=qs[_0x4900('0x1f')](_0x190c23[_0x4900('0x2f')][_0x4900('0x1f')]);}return _0xea036[_0x4900('0x4b')](_0x5b1b3a);}})[_0x4900('0x25')](function(_0x53d676){if(_0x53d676){return _0x53d676?{'count':_0x19a8d9,'rows':_0x53d676}:null;}})[_0x4900('0x25')](respondWithResult(_0x58ca0e,null))[_0x4900('0x3f')](handleError(_0x58ca0e,null));};exports[_0x4900('0x4c')]=function(_0x49c712,_0x11543e,_0x2130bf){var _0x4f2e9c={};var _0x1c36a7={};var _0x59257f;var _0x4e351b;return db[_0x4900('0x2b')][_0x4900('0x47')]({'where':{'id':_0x49c712[_0x4900('0x41')]['id']}})['then'](handleEntityNotFound(_0x11543e,null))[_0x4900('0x25')](function(_0x215471){if(_0x215471){_0x59257f=_0x215471;_0x1c36a7['model']=_[_0x4900('0x30')](db[_0x4900('0x4d')][_0x4900('0x2c')]);_0x1c36a7[_0x4900('0x2f')]=_[_0x4900('0x30')](_0x49c712[_0x4900('0x2f')]);_0x1c36a7[_0x4900('0x31')]=_[_0x4900('0x34')](_0x1c36a7[_0x4900('0x32')],_0x1c36a7['query']);_0x4f2e9c[_0x4900('0x33')]=_[_0x4900('0x34')](_0x1c36a7['model'],qs[_0x4900('0x35')](_0x49c712[_0x4900('0x2f')][_0x4900('0x35')]));_0x4f2e9c[_0x4900('0x33')]=_0x4f2e9c['attributes'][_0x4900('0x36')]?_0x4f2e9c['attributes']:_0x1c36a7[_0x4900('0x32')];_0x4f2e9c[_0x4900('0x48')]=qs[_0x4900('0x38')](_0x49c712['query'][_0x4900('0x38')]);_0x4f2e9c[_0x4900('0x39')]=qs[_0x4900('0x31')](_['pick'](_0x49c712[_0x4900('0x2f')],_0x1c36a7[_0x4900('0x31')]));if(_0x49c712[_0x4900('0x2f')][_0x4900('0x3a')]){_0x4f2e9c[_0x4900('0x39')]=_[_0x4900('0x42')](_0x4f2e9c[_0x4900('0x39')],{'$or':_[_0x4900('0x2a')](_0x4f2e9c[_0x4900('0x33')],function(_0xb72c77){var _0x151fe5={};_0x151fe5[_0xb72c77]={'$like':'%'+_0x49c712['query']['filter']+'%'};return _0x151fe5;})});}_0x4f2e9c=_['merge']({},_0x4f2e9c,_0x49c712[_0x4900('0x3c')]);return _0x59257f['getDescriptions'](_0x4f2e9c);}})['then'](function(_0x164cd2){if(_0x164cd2){_0x4e351b=_0x164cd2[_0x4900('0x36')];if(!_0x49c712[_0x4900('0x2f')][_0x4900('0x4a')](_0x4900('0x37'))){_0x4f2e9c[_0x4900('0x21')]=qs[_0x4900('0x21')](_0x49c712[_0x4900('0x2f')]['limit']);_0x4f2e9c['offset']=qs[_0x4900('0x1f')](_0x49c712[_0x4900('0x2f')][_0x4900('0x1f')]);}return _0x59257f[_0x4900('0x4c')](_0x4f2e9c);}})[_0x4900('0x25')](function(_0x4016d3){if(_0x4016d3){return _0x4016d3?{'count':_0x4e351b,'rows':_0x4016d3}:null;}})[_0x4900('0x25')](respondWithResult(_0x11543e,null))[_0x4900('0x3f')](handleError(_0x11543e,null));};exports[_0x4900('0x4e')]=function(_0x1daa50,_0x208cbd,_0x3f93c1){var _0x223bda={};var _0x1c4ad9={};var _0x5181b3;var _0x1967bd;return db[_0x4900('0x2b')][_0x4900('0x47')]({'where':{'id':_0x1daa50[_0x4900('0x41')]['id']}})['then'](handleEntityNotFound(_0x208cbd,null))[_0x4900('0x25')](function(_0x539a62){if(_0x539a62){_0x5181b3=_0x539a62;_0x1c4ad9[_0x4900('0x32')]=_[_0x4900('0x30')](db[_0x4900('0x4d')][_0x4900('0x2c')]);_0x1c4ad9['query']=_[_0x4900('0x30')](_0x1daa50[_0x4900('0x2f')]);_0x1c4ad9[_0x4900('0x31')]=_[_0x4900('0x34')](_0x1c4ad9[_0x4900('0x32')],_0x1c4ad9[_0x4900('0x2f')]);_0x223bda[_0x4900('0x33')]=_[_0x4900('0x34')](_0x1c4ad9[_0x4900('0x32')],qs[_0x4900('0x35')](_0x1daa50[_0x4900('0x2f')][_0x4900('0x35')]));_0x223bda[_0x4900('0x33')]=_0x223bda[_0x4900('0x33')][_0x4900('0x36')]?_0x223bda[_0x4900('0x33')]:_0x1c4ad9['model'];_0x223bda[_0x4900('0x48')]=qs[_0x4900('0x38')](_0x1daa50[_0x4900('0x2f')][_0x4900('0x38')]);_0x223bda[_0x4900('0x39')]=qs[_0x4900('0x31')](_['pick'](_0x1daa50[_0x4900('0x2f')],_0x1c4ad9['filters']));if(_0x1daa50[_0x4900('0x2f')][_0x4900('0x3a')]){_0x223bda[_0x4900('0x39')]=_[_0x4900('0x42')](_0x223bda[_0x4900('0x39')],{'$or':_['map'](_0x223bda[_0x4900('0x33')],function(_0x581bfb){var _0x5ccd9d={};_0x5ccd9d[_0x581bfb]={'$like':'%'+_0x1daa50[_0x4900('0x2f')][_0x4900('0x3a')]+'%'};return _0x5ccd9d;})});}_0x223bda=_[_0x4900('0x42')]({},_0x223bda,_0x1daa50['options']);return _0x5181b3['getFields'](_0x223bda);}})[_0x4900('0x25')](function(_0x3ffad5){if(_0x3ffad5){_0x1967bd=_0x3ffad5[_0x4900('0x36')];if(!_0x1daa50[_0x4900('0x2f')][_0x4900('0x4a')]('nolimit')){_0x223bda[_0x4900('0x21')]=qs[_0x4900('0x21')](_0x1daa50[_0x4900('0x2f')][_0x4900('0x21')]);_0x223bda[_0x4900('0x1f')]=qs[_0x4900('0x1f')](_0x1daa50[_0x4900('0x2f')]['offset']);}return _0x5181b3[_0x4900('0x4e')](_0x223bda);}})['then'](function(_0x269ad0){if(_0x269ad0){return _0x269ad0?{'count':_0x1967bd,'rows':_0x269ad0}:null;}})[_0x4900('0x25')](respondWithResult(_0x208cbd,null))['catch'](handleError(_0x208cbd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 810013e..54c5831 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 _0x4de0=['./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3f6402,_0x257f45){var _0x4d1f57=function(_0x3dcc76){while(--_0x3dcc76){_0x3f6402['push'](_0x3f6402['shift']());}};_0x4d1f57(++_0x257f45);}(_0x4de0,0x17d));var _0x04de=function(_0x1ebd1d,_0x372ff6){_0x1ebd1d=_0x1ebd1d-0x0;var _0x1054aa=_0x4de0[_0x1ebd1d];return _0x1054aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04de('0x0'))(_0x04de('0x1'));var moment=require(_0x04de('0x2'));var BPromise=require(_0x04de('0x3'));var rp=require(_0x04de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x04de('0x5'));var attributes=require(_0x04de('0x6'));module['exports']=function(_0x48cfe7,_0x175a60){return _0x48cfe7[_0x04de('0x7')](_0x04de('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb935=['exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x8d4b94,_0xd7112e){var _0x8913a=function(_0x536fff){while(--_0x536fff){_0x8d4b94['push'](_0x8d4b94['shift']());}};_0x8913a(++_0xd7112e);}(_0xb935,0xac));var _0x5b93=function(_0x4fdcb2,_0x44a823){_0x4fdcb2=_0x4fdcb2-0x0;var _0x30614b=_0xb935[_0x4fdcb2];return _0x30614b;};'use strict';var _=require(_0x5b93('0x0'));var util=require(_0x5b93('0x1'));var logger=require(_0x5b93('0x2'))(_0x5b93('0x3'));var moment=require(_0x5b93('0x4'));var BPromise=require(_0x5b93('0x5'));var rp=require(_0x5b93('0x6'));var fs=require('fs');var path=require(_0x5b93('0x7'));var rimraf=require('rimraf');var config=require(_0x5b93('0x8'));var attributes=require(_0x5b93('0x9'));module[_0x5b93('0xa')]=function(_0x3d92e4,_0xf49105){return _0x3d92e4['define'](_0x5b93('0xb'),attributes,{'tableName':_0x5b93('0xc'),'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 34a4a14..f5abf8e 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 _0xec39=['../../config/logger','rpc','jayson/promise','request','then','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19c993,_0x435e48){var _0x4f5385=function(_0x1d8ba9){while(--_0x1d8ba9){_0x19c993['push'](_0x19c993['shift']());}};_0x4f5385(++_0x435e48);}(_0xec39,0xe0));var _0x9ec3=function(_0x22a944,_0x21bc13){_0x22a944=_0x22a944-0x0;var _0x132254=_0xec39[_0x22a944];return _0x132254;};'use strict';var _=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var moment=require(_0x9ec3('0x2'));var BPromise=require(_0x9ec3('0x3'));var rs=require(_0x9ec3('0x4'));var fs=require('fs');var Redis=require(_0x9ec3('0x5'));var db=require(_0x9ec3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ec3('0x7'))(_0x9ec3('0x8'));var config=require('../../config/environment');var jayson=require(_0x9ec3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17ec76,_0x2ddfb0,_0x224f57){return new BPromise(function(_0x4cff64,_0x2c4aa4){return client[_0x9ec3('0xa')](_0x17ec76,_0x224f57)[_0x9ec3('0xb')](function(_0xcbb108){logger['info'](_0x9ec3('0xc'),_0x2ddfb0,'request\x20sent');logger['debug'](_0x9ec3('0xd'),_0x2ddfb0,_0x9ec3('0xe'),JSON[_0x9ec3('0xf')](_0xcbb108));if(_0xcbb108[_0x9ec3('0x10')]){if(_0xcbb108[_0x9ec3('0x10')][_0x9ec3('0x11')]===0x1f4){logger[_0x9ec3('0x10')](_0x9ec3('0xc'),_0x2ddfb0,_0xcbb108[_0x9ec3('0x10')][_0x9ec3('0x12')]);return _0x2c4aa4(_0xcbb108['error'][_0x9ec3('0x12')]);}logger[_0x9ec3('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2ddfb0,_0xcbb108['error'][_0x9ec3('0x12')]);return _0x4cff64(_0xcbb108[_0x9ec3('0x10')][_0x9ec3('0x12')]);}else{logger[_0x9ec3('0x13')](_0x9ec3('0xc'),_0x2ddfb0,'request\x20sent');_0x4cff64(_0xcbb108[_0x9ec3('0x14')][_0x9ec3('0x12')]);}})['catch'](function(_0x57c3f2){logger[_0x9ec3('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2ddfb0,_0x57c3f2);_0x2c4aa4(_0x57c3f2);});});} \ No newline at end of file +var _0x8e0e=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_0x8e0e,0x64));var _0xe8e0=function(_0x3a09e5,_0x22b07d){_0x3a09e5=_0x3a09e5-0x0;var _0x47f87d=_0x8e0e[_0x3a09e5];return _0x47f87d;};'use strict';var _=require(_0xe8e0('0x0'));var util=require(_0xe8e0('0x1'));var moment=require(_0xe8e0('0x2'));var BPromise=require(_0xe8e0('0x3'));var rs=require(_0xe8e0('0x4'));var fs=require('fs');var Redis=require(_0xe8e0('0x5'));var db=require(_0xe8e0('0x6'))['db'];var utils=require(_0xe8e0('0x7'));var logger=require(_0xe8e0('0x8'))(_0xe8e0('0x9'));var config=require(_0xe8e0('0xa'));var jayson=require(_0xe8e0('0xb'));var client=jayson[_0xe8e0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x317d12,_0x5b114c,_0x38a0f5){return new BPromise(function(_0x4028a6,_0x22d9a5){return client[_0xe8e0('0xd')](_0x317d12,_0x38a0f5)[_0xe8e0('0xe')](function(_0x2b2e2e){logger[_0xe8e0('0xf')](_0xe8e0('0x10'),_0x5b114c,_0xe8e0('0x11'));logger['debug'](_0xe8e0('0x12'),_0x5b114c,_0xe8e0('0x11'),JSON['stringify'](_0x2b2e2e));if(_0x2b2e2e[_0xe8e0('0x13')]){if(_0x2b2e2e[_0xe8e0('0x13')][_0xe8e0('0x14')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b114c,_0x2b2e2e[_0xe8e0('0x13')][_0xe8e0('0x15')]);return _0x22d9a5(_0x2b2e2e[_0xe8e0('0x13')][_0xe8e0('0x15')]);}logger[_0xe8e0('0x13')](_0xe8e0('0x10'),_0x5b114c,_0x2b2e2e[_0xe8e0('0x13')]['message']);return _0x4028a6(_0x2b2e2e[_0xe8e0('0x13')][_0xe8e0('0x15')]);}else{logger['info'](_0xe8e0('0x10'),_0x5b114c,_0xe8e0('0x11'));_0x4028a6(_0x2b2e2e[_0xe8e0('0x16')][_0xe8e0('0x15')]);}})['catch'](function(_0x2ad21b){logger[_0xe8e0('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b114c,_0x2ad21b);_0x22d9a5(_0x2ad21b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 7ead45e..004ac58 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 _0x0b78=['express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x358249,_0x38ecbb){var _0xce1f93=function(_0x38e10a){while(--_0x38e10a){_0x358249['push'](_0x358249['shift']());}};_0xce1f93(++_0x38ecbb);}(_0x0b78,0x1ad));var _0x80b7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0b78[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var path=require('path');var timeout=require(_0x80b7('0x2'));var express=require(_0x80b7('0x3'));var router=express['Router']();var fs_extra=require(_0x80b7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var controller=require(_0x80b7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x80b7('0x8')]);router['get'](_0x80b7('0x9'),auth[_0x80b7('0xa')](),controller[_0x80b7('0xb')]);router[_0x80b7('0xc')]('/',auth['isAuthenticated'](),controller[_0x80b7('0xd')]);router[_0x80b7('0xe')](_0x80b7('0x9'),auth['isAuthenticated'](),controller[_0x80b7('0xf')]);router['delete'](_0x80b7('0x9'),auth[_0x80b7('0xa')](),controller[_0x80b7('0x10')]);module[_0x80b7('0x11')]=router; \ No newline at end of file +var _0x8868=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','isAuthenticated','post','create','put','/:id','delete','destroy','multer','util'];(function(_0x55447a,_0x3220be){var _0x33a38b=function(_0x1b4e2b){while(--_0x1b4e2b){_0x55447a['push'](_0x55447a['shift']());}};_0x33a38b(++_0x3220be);}(_0x8868,0x1ca));var _0x8886=function(_0x5d611d,_0x18af65){_0x5d611d=_0x5d611d-0x0;var _0x5a1308=_0x8868[_0x5d611d];return _0x5a1308;};'use strict';var multer=require(_0x8886('0x0'));var util=require(_0x8886('0x1'));var path=require(_0x8886('0x2'));var timeout=require(_0x8886('0x3'));var express=require(_0x8886('0x4'));var router=express[_0x8886('0x5')]();var fs_extra=require(_0x8886('0x6'));var auth=require(_0x8886('0x7'));var interaction=require(_0x8886('0x8'));var config=require(_0x8886('0x9'));var controller=require(_0x8886('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x8886('0xb')]);router[_0x8886('0xc')]('/:id',auth[_0x8886('0xd')](),controller['show']);router[_0x8886('0xe')]('/',auth[_0x8886('0xd')](),controller[_0x8886('0xf')]);router[_0x8886('0x10')](_0x8886('0x11'),auth[_0x8886('0xd')](),controller['update']);router[_0x8886('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8886('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 e9bc0d9..2cbf88a 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 _0xb355=['STRING','string','sequelize','exports','ENUM','variable','customVariable','picklist'];(function(_0x39c78a,_0x3bf678){var _0x209e0f=function(_0x33fd59){while(--_0x33fd59){_0x39c78a['push'](_0x39c78a['shift']());}};_0x209e0f(++_0x3bf678);}(_0xb355,0xf2));var _0x5b35=function(_0x266328,_0x140b79){_0x266328=_0x266328-0x0;var _0x3aa9bc=_0xb355[_0x266328];return _0x3aa9bc;};'use strict';var Sequelize=require(_0x5b35('0x0'));module[_0x5b35('0x1')]={'type':{'type':Sequelize[_0x5b35('0x2')]('string',_0x5b35('0x3'),_0x5b35('0x4'),'keyValue',_0x5b35('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5b35('0x6')]},'key':{'type':Sequelize[_0x5b35('0x6')]},'keyType':{'type':Sequelize[_0x5b35('0x2')](_0x5b35('0x7'),_0x5b35('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5b35('0x6')]},'idField':{'type':Sequelize[_0x5b35('0x6')]},'nameField':{'type':Sequelize[_0x5b35('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5b35('0x6')]}}; \ No newline at end of file +var _0x50bd=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x50bd,0x1d9));var _0xd50b=function(_0x2f603a,_0x56dcbb){_0x2f603a=_0x2f603a-0x0;var _0x37db08=_0x50bd[_0x2f603a];return _0x37db08;};'use strict';var Sequelize=require('sequelize');module[_0xd50b('0x0')]={'type':{'type':Sequelize[_0xd50b('0x1')](_0xd50b('0x2'),_0xd50b('0x3'),_0xd50b('0x4'),_0xd50b('0x5'),_0xd50b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd50b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd50b('0x1')](_0xd50b('0x2'),_0xd50b('0x3'),_0xd50b('0x4'))},'keyContent':{'type':Sequelize[_0xd50b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd50b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd50b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index bf8b7fe..03016b7 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 _0x902c=['body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','fieldName','key','model','query','keys','attributes','fields','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','rows','params','intersection','length','include','options','catch','create'];(function(_0x140dcd,_0xe99058){var _0x346705=function(_0x38a521){while(--_0x38a521){_0x140dcd['push'](_0x140dcd['shift']());}};_0x346705(++_0xe99058);}(_0x902c,0x8e));var _0xc902=function(_0x30ee41,_0x37b05f){_0x30ee41=_0x30ee41-0x0;var _0x40bc2e=_0x902c[_0x30ee41];return _0x40bc2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc902('0x0'));var zipdir=require(_0xc902('0x1'));var jsonpatch=require(_0xc902('0x2'));var rp=require(_0xc902('0x3'));var moment=require('moment');var BPromise=require(_0xc902('0x4'));var Mustache=require(_0xc902('0x5'));var util=require(_0xc902('0x6'));var path=require(_0xc902('0x7'));var sox=require(_0xc902('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc902('0x9'));var _=require(_0xc902('0xa'));var squel=require(_0xc902('0xb'));var crypto=require('crypto');var jsforce=require(_0xc902('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc902('0xd'));var querystring=require('querystring');var Papa=require(_0xc902('0xe'));var Redis=require(_0xc902('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc902('0x10'));var hardwareService=require(_0xc902('0x11'));var logger=require(_0xc902('0x12'))(_0xc902('0x13'));var utils=require(_0xc902('0x14'));var config=require(_0xc902('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc902('0x16'))['db'];function respondWithStatusCode(_0x1efe98,_0x516099){_0x516099=_0x516099||0xcc;return function(_0x2a2ea0){if(_0x2a2ea0){return _0x1efe98[_0xc902('0x17')](_0x516099);}return _0x1efe98[_0xc902('0x18')](_0x516099)[_0xc902('0x19')]();};}function respondWithResult(_0x456f11,_0x54b710){_0x54b710=_0x54b710||0xc8;return function(_0xadd0cb){if(_0xadd0cb){return _0x456f11[_0xc902('0x18')](_0x54b710)[_0xc902('0x1a')](_0xadd0cb);}};}function respondWithFilteredResult(_0x3e71af,_0x4500d0){return function(_0x56cb89){if(_0x56cb89){var _0x378dff=typeof _0x4500d0[_0xc902('0x1b')]===_0xc902('0x1c')&&typeof _0x4500d0[_0xc902('0x1d')]===_0xc902('0x1c');var _0x5a7060=_0x56cb89['count'];var _0x16bb87=_0x378dff?0x0:_0x4500d0[_0xc902('0x1b')];var _0x2e368d=_0x378dff?_0x56cb89[_0xc902('0x1e')]:_0x4500d0[_0xc902('0x1b')]+_0x4500d0[_0xc902('0x1d')];var _0x4f3140;if(_0x2e368d>=_0x5a7060){_0x2e368d=_0x5a7060;_0x4f3140=0xc8;}else{_0x4f3140=0xce;}_0x3e71af[_0xc902('0x18')](_0x4f3140);return _0x3e71af['set'](_0xc902('0x1f'),_0x16bb87+'-'+_0x2e368d+'/'+_0x5a7060)[_0xc902('0x1a')](_0x56cb89);}return null;};}function patchUpdates(_0x11de61){return function(_0x5d3f7b){try{jsonpatch['apply'](_0x5d3f7b,_0x11de61,!![]);}catch(_0xe8de20){return BPromise['reject'](_0xe8de20);}return _0x5d3f7b[_0xc902('0x20')]();};}function saveUpdates(_0x50d26c,_0x25c959){return function(_0x531133){if(_0x531133){return _0x531133[_0xc902('0x21')](_0x50d26c)[_0xc902('0x22')](function(_0x1ab5b5){return _0x1ab5b5;});}return null;};}function removeEntity(_0x20fa91,_0x4f7605){return function(_0x306100){if(_0x306100){return _0x306100[_0xc902('0x23')]()[_0xc902('0x22')](function(){_0x20fa91[_0xc902('0x18')](0xcc)[_0xc902('0x19')]();});}};}function handleEntityNotFound(_0x17165d,_0x349255){return function(_0x1ababc){if(!_0x1ababc){_0x17165d[_0xc902('0x17')](0x194);}return _0x1ababc;};}function handleError(_0x238ef8,_0x51aec2){_0x51aec2=_0x51aec2||0x1f4;return function(_0x1e33d9){logger[_0xc902('0x24')](_0x1e33d9[_0xc902('0x25')]);if(_0x1e33d9['name']){delete _0x1e33d9[_0xc902('0x26')];}_0x238ef8[_0xc902('0x18')](_0x51aec2)[_0xc902('0x27')](_0x1e33d9);};}exports[_0xc902('0x28')]=function(_0x32f581,_0x3e87eb){var _0x1a38bd={},_0xb24a8e={},_0x5f7d7a={'count':0x0,'rows':[]};var _0x3c7340=_[_0xc902('0x29')](db[_0xc902('0x2a')]['rawAttributes'],function(_0x10c660){return{'name':_0x10c660[_0xc902('0x2b')],'type':_0x10c660['type'][_0xc902('0x2c')]};});_0xb24a8e[_0xc902('0x2d')]=_[_0xc902('0x29')](_0x3c7340,_0xc902('0x26'));_0xb24a8e[_0xc902('0x2e')]=_[_0xc902('0x2f')](_0x32f581[_0xc902('0x2e')]);_0xb24a8e['filters']=_['intersection'](_0xb24a8e[_0xc902('0x2d')],_0xb24a8e[_0xc902('0x2e')]);_0x1a38bd[_0xc902('0x30')]=_['intersection'](_0xb24a8e[_0xc902('0x2d')],qs['fields'](_0x32f581[_0xc902('0x2e')][_0xc902('0x31')]));_0x1a38bd[_0xc902('0x30')]=_0x1a38bd[_0xc902('0x30')]['length']?_0x1a38bd[_0xc902('0x30')]:_0xb24a8e[_0xc902('0x2d')];if(!_0x32f581[_0xc902('0x2e')]['hasOwnProperty']('nolimit')){_0x1a38bd[_0xc902('0x1d')]=qs[_0xc902('0x1d')](_0x32f581[_0xc902('0x2e')][_0xc902('0x1d')]);_0x1a38bd[_0xc902('0x1b')]=qs[_0xc902('0x1b')](_0x32f581[_0xc902('0x2e')][_0xc902('0x1b')]);}_0x1a38bd[_0xc902('0x32')]=qs[_0xc902('0x33')](_0x32f581[_0xc902('0x2e')][_0xc902('0x33')]);_0x1a38bd[_0xc902('0x34')]=qs[_0xc902('0x35')](_[_0xc902('0x36')](_0x32f581[_0xc902('0x2e')],_0xb24a8e[_0xc902('0x35')]),_0x3c7340);if(_0x32f581[_0xc902('0x2e')][_0xc902('0x37')]){_0x1a38bd[_0xc902('0x34')]=_[_0xc902('0x38')](_0x1a38bd['where'],{'$or':_[_0xc902('0x29')](_0x3c7340,function(_0x59cf2a){if(_0x59cf2a[_0xc902('0x39')]!==_0xc902('0x3a')){var _0x1546b5={};_0x1546b5[_0x59cf2a[_0xc902('0x26')]]={'$like':'%'+_0x32f581[_0xc902('0x2e')][_0xc902('0x37')]+'%'};return _0x1546b5;}})});}_0x1a38bd=_[_0xc902('0x38')]({},_0x1a38bd,_0x32f581['options']);var _0x4c7d09={'where':_0x1a38bd[_0xc902('0x34')]};return db[_0xc902('0x2a')][_0xc902('0x1e')](_0x4c7d09)[_0xc902('0x22')](function(_0x3d353b){_0x5f7d7a[_0xc902('0x1e')]=_0x3d353b;if(_0x32f581[_0xc902('0x2e')][_0xc902('0x3b')]){_0x1a38bd['include']=[{'all':!![]}];}return db[_0xc902('0x2a')]['findAll'](_0x1a38bd);})['then'](function(_0x341c58){_0x5f7d7a[_0xc902('0x3c')]=_0x341c58;return _0x5f7d7a;})[_0xc902('0x22')](respondWithFilteredResult(_0x3e87eb,_0x1a38bd))['catch'](handleError(_0x3e87eb,null));};exports['show']=function(_0x96602d,_0x35812e){var _0x151eb0={'raw':!![],'where':{'id':_0x96602d[_0xc902('0x3d')]['id']}},_0x5d0ff7={};_0x5d0ff7['model']=_[_0xc902('0x2f')](db[_0xc902('0x2a')]['rawAttributes']);_0x5d0ff7[_0xc902('0x2e')]=_[_0xc902('0x2f')](_0x96602d[_0xc902('0x2e')]);_0x5d0ff7[_0xc902('0x35')]=_[_0xc902('0x3e')](_0x5d0ff7[_0xc902('0x2d')],_0x5d0ff7[_0xc902('0x2e')]);_0x151eb0[_0xc902('0x30')]=_[_0xc902('0x3e')](_0x5d0ff7[_0xc902('0x2d')],qs[_0xc902('0x31')](_0x96602d['query'][_0xc902('0x31')]));_0x151eb0[_0xc902('0x30')]=_0x151eb0[_0xc902('0x30')][_0xc902('0x3f')]?_0x151eb0['attributes']:_0x5d0ff7[_0xc902('0x2d')];if(_0x96602d['query']['includeAll']){_0x151eb0[_0xc902('0x40')]=[{'all':!![]}];}_0x151eb0=_[_0xc902('0x38')]({},_0x151eb0,_0x96602d[_0xc902('0x41')]);return db['FreshsalesField']['find'](_0x151eb0)['then'](handleEntityNotFound(_0x35812e,null))[_0xc902('0x22')](respondWithResult(_0x35812e,null))[_0xc902('0x42')](handleError(_0x35812e,null));};exports[_0xc902('0x43')]=function(_0x15403a,_0x14b369){return db[_0xc902('0x2a')]['create'](_0x15403a[_0xc902('0x44')],{})[_0xc902('0x22')](respondWithResult(_0x14b369,0xc9))[_0xc902('0x42')](handleError(_0x14b369,null));};exports[_0xc902('0x21')]=function(_0x4969a2,_0x55a267){if(_0x4969a2['body']['id']){delete _0x4969a2['body']['id'];}return db['FreshsalesField'][_0xc902('0x45')]({'where':{'id':_0x4969a2[_0xc902('0x3d')]['id']}})['then'](handleEntityNotFound(_0x55a267,null))[_0xc902('0x22')](saveUpdates(_0x4969a2['body'],null))[_0xc902('0x22')](respondWithResult(_0x55a267,null))[_0xc902('0x42')](handleError(_0x55a267,null));};exports[_0xc902('0x23')]=function(_0x2f1e52,_0x1ee5ff){return db[_0xc902('0x2a')]['find']({'where':{'id':_0x2f1e52[_0xc902('0x3d')]['id']}})[_0xc902('0x22')](handleEntityNotFound(_0x1ee5ff,null))[_0xc902('0x22')](removeEntity(_0x1ee5ff,null))[_0xc902('0x42')](handleError(_0x1ee5ff,null));}; \ No newline at end of file +var _0x6cc3=['eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','undefined','count','offset','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','options','FreshsalesField','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x26a490,_0x1d54cf){var _0x4f14c1=function(_0x47922f){while(--_0x47922f){_0x26a490['push'](_0x26a490['shift']());}};_0x4f14c1(++_0x1d54cf);}(_0x6cc3,0x11c));var _0x36cc=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0x6cc3[_0x509c83];return _0x534626;};'use strict';var emlformat=require(_0x36cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36cc('0x1'));var jsonpatch=require(_0x36cc('0x2'));var rp=require(_0x36cc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36cc('0x4'));var util=require(_0x36cc('0x5'));var path=require(_0x36cc('0x6'));var sox=require(_0x36cc('0x7'));var csv=require(_0x36cc('0x8'));var ejs=require(_0x36cc('0x9'));var fs=require('fs');var fs_extra=require(_0x36cc('0xa'));var _=require(_0x36cc('0xb'));var squel=require(_0x36cc('0xc'));var crypto=require(_0x36cc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x36cc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x36cc('0xe'));var authService=require(_0x36cc('0xf'));var qs=require(_0x36cc('0x10'));var as=require(_0x36cc('0x11'));var hardwareService=require(_0x36cc('0x12'));var logger=require(_0x36cc('0x13'))(_0x36cc('0x14'));var utils=require(_0x36cc('0x15'));var config=require(_0x36cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x36cc('0x17'))['db'];function respondWithStatusCode(_0x39ebd9,_0x2065ae){_0x2065ae=_0x2065ae||0xcc;return function(_0x3f0446){if(_0x3f0446){return _0x39ebd9[_0x36cc('0x18')](_0x2065ae);}return _0x39ebd9[_0x36cc('0x19')](_0x2065ae)[_0x36cc('0x1a')]();};}function respondWithResult(_0x44e672,_0x5473a0){_0x5473a0=_0x5473a0||0xc8;return function(_0x52f005){if(_0x52f005){return _0x44e672[_0x36cc('0x19')](_0x5473a0)[_0x36cc('0x1b')](_0x52f005);}};}function respondWithFilteredResult(_0x16b909,_0xf0e55){return function(_0x1d30e7){if(_0x1d30e7){var _0x181eb7=typeof _0xf0e55['offset']==='undefined'&&typeof _0xf0e55[_0x36cc('0x1c')]===_0x36cc('0x1d');var _0x30905a=_0x1d30e7[_0x36cc('0x1e')];var _0x806e34=_0x181eb7?0x0:_0xf0e55[_0x36cc('0x1f')];var _0x35588a=_0x181eb7?_0x1d30e7[_0x36cc('0x1e')]:_0xf0e55[_0x36cc('0x1f')]+_0xf0e55[_0x36cc('0x1c')];var _0x177eb2;if(_0x35588a>=_0x30905a){_0x35588a=_0x30905a;_0x177eb2=0xc8;}else{_0x177eb2=0xce;}_0x16b909[_0x36cc('0x19')](_0x177eb2);return _0x16b909['set']('Content-Range',_0x806e34+'-'+_0x35588a+'/'+_0x30905a)[_0x36cc('0x1b')](_0x1d30e7);}return null;};}function patchUpdates(_0x8bcd87){return function(_0x2d1640){try{jsonpatch[_0x36cc('0x20')](_0x2d1640,_0x8bcd87,!![]);}catch(_0x66918c){return BPromise[_0x36cc('0x21')](_0x66918c);}return _0x2d1640['save']();};}function saveUpdates(_0x5cafe0,_0x1e2314){return function(_0x5407f9){if(_0x5407f9){return _0x5407f9[_0x36cc('0x22')](_0x5cafe0)[_0x36cc('0x23')](function(_0x3b43f1){return _0x3b43f1;});}return null;};}function removeEntity(_0x53d14e,_0x17bd93){return function(_0x4244a0){if(_0x4244a0){return _0x4244a0[_0x36cc('0x24')]()[_0x36cc('0x23')](function(){_0x53d14e[_0x36cc('0x19')](0xcc)[_0x36cc('0x1a')]();});}};}function handleEntityNotFound(_0x13b98d,_0xb4f47f){return function(_0x4477bd){if(!_0x4477bd){_0x13b98d[_0x36cc('0x18')](0x194);}return _0x4477bd;};}function handleError(_0x730578,_0xd36a0e){_0xd36a0e=_0xd36a0e||0x1f4;return function(_0x53eba5){logger[_0x36cc('0x25')](_0x53eba5['stack']);if(_0x53eba5[_0x36cc('0x26')]){delete _0x53eba5[_0x36cc('0x26')];}_0x730578[_0x36cc('0x19')](_0xd36a0e)[_0x36cc('0x27')](_0x53eba5);};}exports[_0x36cc('0x28')]=function(_0xec0c33,_0x103ed8){var _0x5e1bff={},_0x4d5cf9={},_0x1e7431={'count':0x0,'rows':[]};var _0x1244d3=_['map'](db['FreshsalesField'][_0x36cc('0x29')],function(_0x6cdb2){return{'name':_0x6cdb2[_0x36cc('0x2a')],'type':_0x6cdb2[_0x36cc('0x2b')][_0x36cc('0x2c')]};});_0x4d5cf9[_0x36cc('0x2d')]=_[_0x36cc('0x2e')](_0x1244d3,_0x36cc('0x26'));_0x4d5cf9[_0x36cc('0x2f')]=_['keys'](_0xec0c33['query']);_0x4d5cf9['filters']=_[_0x36cc('0x30')](_0x4d5cf9[_0x36cc('0x2d')],_0x4d5cf9[_0x36cc('0x2f')]);_0x5e1bff[_0x36cc('0x31')]=_['intersection'](_0x4d5cf9[_0x36cc('0x2d')],qs[_0x36cc('0x32')](_0xec0c33[_0x36cc('0x2f')][_0x36cc('0x32')]));_0x5e1bff[_0x36cc('0x31')]=_0x5e1bff[_0x36cc('0x31')][_0x36cc('0x33')]?_0x5e1bff[_0x36cc('0x31')]:_0x4d5cf9[_0x36cc('0x2d')];if(!_0xec0c33['query']['hasOwnProperty']('nolimit')){_0x5e1bff[_0x36cc('0x1c')]=qs[_0x36cc('0x1c')](_0xec0c33[_0x36cc('0x2f')]['limit']);_0x5e1bff[_0x36cc('0x1f')]=qs[_0x36cc('0x1f')](_0xec0c33[_0x36cc('0x2f')]['offset']);}_0x5e1bff[_0x36cc('0x34')]=qs[_0x36cc('0x35')](_0xec0c33['query'][_0x36cc('0x35')]);_0x5e1bff[_0x36cc('0x36')]=qs['filters'](_['pick'](_0xec0c33[_0x36cc('0x2f')],_0x4d5cf9[_0x36cc('0x37')]),_0x1244d3);if(_0xec0c33['query'][_0x36cc('0x38')]){_0x5e1bff[_0x36cc('0x36')]=_[_0x36cc('0x39')](_0x5e1bff[_0x36cc('0x36')],{'$or':_[_0x36cc('0x2e')](_0x1244d3,function(_0x1eb9f4){if(_0x1eb9f4[_0x36cc('0x2b')]!=='VIRTUAL'){var _0x52e13d={};_0x52e13d[_0x1eb9f4[_0x36cc('0x26')]]={'$like':'%'+_0xec0c33[_0x36cc('0x2f')]['filter']+'%'};return _0x52e13d;}})});}_0x5e1bff=_[_0x36cc('0x39')]({},_0x5e1bff,_0xec0c33[_0x36cc('0x3a')]);var _0x4a5d71={'where':_0x5e1bff[_0x36cc('0x36')]};return db[_0x36cc('0x3b')][_0x36cc('0x1e')](_0x4a5d71)[_0x36cc('0x23')](function(_0x5684a2){_0x1e7431['count']=_0x5684a2;if(_0xec0c33[_0x36cc('0x2f')][_0x36cc('0x3c')]){_0x5e1bff[_0x36cc('0x3d')]=[{'all':!![]}];}return db[_0x36cc('0x3b')][_0x36cc('0x3e')](_0x5e1bff);})[_0x36cc('0x23')](function(_0x5a68db){_0x1e7431[_0x36cc('0x3f')]=_0x5a68db;return _0x1e7431;})[_0x36cc('0x23')](respondWithFilteredResult(_0x103ed8,_0x5e1bff))['catch'](handleError(_0x103ed8,null));};exports[_0x36cc('0x40')]=function(_0x46cd6e,_0x1828f6){var _0x9337bb={'raw':!![],'where':{'id':_0x46cd6e[_0x36cc('0x41')]['id']}},_0x5686b3={};_0x5686b3[_0x36cc('0x2d')]=_[_0x36cc('0x42')](db['FreshsalesField'][_0x36cc('0x29')]);_0x5686b3[_0x36cc('0x2f')]=_['keys'](_0x46cd6e['query']);_0x5686b3[_0x36cc('0x37')]=_[_0x36cc('0x30')](_0x5686b3[_0x36cc('0x2d')],_0x5686b3['query']);_0x9337bb['attributes']=_['intersection'](_0x5686b3['model'],qs[_0x36cc('0x32')](_0x46cd6e[_0x36cc('0x2f')][_0x36cc('0x32')]));_0x9337bb[_0x36cc('0x31')]=_0x9337bb['attributes']['length']?_0x9337bb[_0x36cc('0x31')]:_0x5686b3[_0x36cc('0x2d')];if(_0x46cd6e[_0x36cc('0x2f')][_0x36cc('0x3c')]){_0x9337bb[_0x36cc('0x3d')]=[{'all':!![]}];}_0x9337bb=_[_0x36cc('0x39')]({},_0x9337bb,_0x46cd6e[_0x36cc('0x3a')]);return db['FreshsalesField'][_0x36cc('0x43')](_0x9337bb)[_0x36cc('0x23')](handleEntityNotFound(_0x1828f6,null))[_0x36cc('0x23')](respondWithResult(_0x1828f6,null))[_0x36cc('0x44')](handleError(_0x1828f6,null));};exports['create']=function(_0x32507e,_0x24ae3a){return db[_0x36cc('0x3b')][_0x36cc('0x45')](_0x32507e[_0x36cc('0x46')],{})['then'](respondWithResult(_0x24ae3a,0xc9))['catch'](handleError(_0x24ae3a,null));};exports[_0x36cc('0x22')]=function(_0x59e205,_0x38bc24){if(_0x59e205[_0x36cc('0x46')]['id']){delete _0x59e205[_0x36cc('0x46')]['id'];}return db['FreshsalesField'][_0x36cc('0x43')]({'where':{'id':_0x59e205[_0x36cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x38bc24,null))[_0x36cc('0x23')](saveUpdates(_0x59e205['body'],null))[_0x36cc('0x23')](respondWithResult(_0x38bc24,null))[_0x36cc('0x44')](handleError(_0x38bc24,null));};exports[_0x36cc('0x24')]=function(_0x4cc89e,_0x3ced50){return db[_0x36cc('0x3b')]['find']({'where':{'id':_0x4cc89e[_0x36cc('0x41')]['id']}})[_0x36cc('0x23')](handleEntityNotFound(_0x3ced50,null))['then'](removeEntity(_0x3ced50,null))['catch'](handleError(_0x3ced50,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index eb1f78c..3c99b62 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 _0x2ebd=['rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ebd,0x1c8));var _0xd2eb=function(_0x44232b,_0x13fc1b){_0x44232b=_0x44232b-0x0;var _0x3fe401=_0x2ebd[_0x44232b];return _0x3fe401;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var logger=require(_0xd2eb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd2eb('0x3'));var rp=require(_0xd2eb('0x4'));var fs=require('fs');var path=require(_0xd2eb('0x5'));var rimraf=require(_0xd2eb('0x6'));var config=require(_0xd2eb('0x7'));var attributes=require(_0xd2eb('0x8'));module['exports']=function(_0x553617,_0x2c08e5){return _0x553617[_0xd2eb('0x9')](_0xd2eb('0xa'),attributes,{'tableName':_0xd2eb('0xb'),'paranoid':![],'indexes':[{'name':_0xd2eb('0xc'),'fields':['idField',_0xd2eb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fa=['define','int_freshsales_fields','freshsales_unique_index','FieldId','../../config/logger','moment','./intFreshsalesField.attributes'];(function(_0x52f7ca,_0x8009c3){var _0x1bc7da=function(_0x1d4fcd){while(--_0x1d4fcd){_0x52f7ca['push'](_0x52f7ca['shift']());}};_0x1bc7da(++_0x8009c3);}(_0xb1fa,0x9e));var _0xab1f=function(_0x23195c,_0xf7abc3){_0x23195c=_0x23195c-0x0;var _0x107e93=_0xb1fa[_0x23195c];return _0x107e93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('FreshsalesField',attributes,{'tableName':_0xab1f('0x4'),'paranoid':![],'indexes':[{'name':_0xab1f('0x5'),'fields':['idField',_0xab1f('0x6')],'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 f5904ae..258ab54 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 _0x038b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis'];(function(_0x4c4342,_0x5cad48){var _0x144627=function(_0x1c4432){while(--_0x1c4432){_0x4c4342['push'](_0x4c4342['shift']());}};_0x144627(++_0x5cad48);}(_0x038b,0x114));var _0xb038=function(_0x30bdc0,_0x1c55df){_0x30bdc0=_0x30bdc0-0x0;var _0x1ce2de=_0x038b[_0x30bdc0];return _0x1ce2de;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var BPromise=require(_0xb038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb038('0x4'));var logger=require(_0xb038('0x5'))('rpc');var config=require(_0xb038('0x6'));var jayson=require(_0xb038('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){return client[_0xb038('0x8')](_0x2e3e64,_0x1534a9)[_0xb038('0x9')](function(_0x4d85b4){logger['info'](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));logger['debug'](_0xb038('0xc'),_0x1b077a,_0xb038('0xb'),JSON[_0xb038('0xd')](_0x4d85b4));if(_0x4d85b4[_0xb038('0xe')]){if(_0x4d85b4[_0xb038('0xe')][_0xb038('0xf')]===0x1f4){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x48a4d7(_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);}logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x4b4085(_0x4d85b4[_0xb038('0xe')]['message']);}else{logger[_0xb038('0x11')](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));_0x4b4085(_0x4d85b4[_0xb038('0x12')][_0xb038('0x10')]);}})[_0xb038('0x13')](function(_0x5246c3){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x5246c3);_0x48a4d7(_0x5246c3);});});} \ No newline at end of file +var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2634b1,_0x2cd01c){var _0x3fd7ae=function(_0xb3e5cc){while(--_0xb3e5cc){_0x2634b1['push'](_0x2634b1['shift']());}};_0x3fd7ae(++_0x2cd01c);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2905c7b..a84fafc 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3f7330,_0x38f0e4){var _0x3038ea=function(_0x1f86be){while(--_0x1f86be){_0x3f7330['push'](_0x3f7330['shift']());}};_0x3038ea(++_0x38f0e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x190172,_0x28a398){var _0x52a723=function(_0x2dc671){while(--_0x2dc671){_0x190172['push'](_0x190172['shift']());}};_0x52a723(++_0x28a398);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e7868c4..299d382 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 _0x18f3=['STRING','integrationTab','newTab','exports'];(function(_0x3964e2,_0x3c60c2){var _0x187524=function(_0x3e5832){while(--_0x3e5832){_0x3964e2['push'](_0x3964e2['shift']());}};_0x187524(++_0x3c60c2);}(_0x18f3,0x19f));var _0x318f=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x18f3[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require('sequelize');module[_0x318f('0x0')]={'name':{'type':Sequelize[_0x318f('0x1')]},'description':{'type':Sequelize[_0x318f('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x318f('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x318f('0x1')]},'clientSecret':{'type':Sequelize[_0x318f('0x1')]},'securityToken':{'type':Sequelize[_0x318f('0x1')]},'serverUrl':{'type':Sequelize[_0x318f('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x318f('0x2'),_0x318f('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x3e2a=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x4fed73,_0x24ee00){var _0x4285e7=function(_0x5c48df){while(--_0x5c48df){_0x4fed73['push'](_0x4fed73['shift']());}};_0x4285e7(++_0x24ee00);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x26e16c,_0x2d7790){_0x26e16c=_0x26e16c-0x0;var _0x45973f=_0x3e2a[_0x26e16c];return _0x45973f;};'use strict';var Sequelize=require(_0xa3e2('0x0'));module[_0xa3e2('0x1')]={'name':{'type':Sequelize[_0xa3e2('0x2')]},'description':{'type':Sequelize[_0xa3e2('0x2')]},'username':{'type':Sequelize[_0xa3e2('0x2')],'unique':_0xa3e2('0x3')},'remoteUri':{'type':Sequelize[_0xa3e2('0x2')]},'password':{'type':Sequelize[_0xa3e2('0x2')]},'clientId':{'type':Sequelize[_0xa3e2('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xa3e2('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3e2('0x4')](_0xa3e2('0x5'),_0xa3e2('0x6')),'defaultValue':_0xa3e2('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b5187eb..e60dc36 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 _0xcc66=['params','getConfigurations','SalesforceConfiguration','pick','filter','merge','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','SalesforceField','Task','remoteUri','password','securityToken','substring','lastIndexOf','Connection','clientId','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','options','SalesforceAccount','include','findAll','rows','catch','show','find','create','body'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0xcc66,0x136));var _0x6cc6=function(_0x2e8d01,_0x12fe7a){_0x2e8d01=_0x2e8d01-0x0;var _0x92efe5=_0xcc66[_0x2e8d01];return _0x92efe5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6cc6('0x0'));var jsonpatch=require(_0x6cc6('0x1'));var rp=require(_0x6cc6('0x2'));var moment=require('moment');var BPromise=require(_0x6cc6('0x3'));var Mustache=require(_0x6cc6('0x4'));var util=require(_0x6cc6('0x5'));var path=require(_0x6cc6('0x6'));var sox=require(_0x6cc6('0x7'));var csv=require(_0x6cc6('0x8'));var ejs=require(_0x6cc6('0x9'));var fs=require('fs');var fs_extra=require(_0x6cc6('0xa'));var _=require('lodash');var squel=require(_0x6cc6('0xb'));var crypto=require(_0x6cc6('0xc'));var jsforce=require(_0x6cc6('0xd'));var deskjs=require(_0x6cc6('0xe'));var toCsv=require(_0x6cc6('0x8'));var querystring=require(_0x6cc6('0xf'));var Papa=require(_0x6cc6('0x10'));var Redis=require(_0x6cc6('0x11'));var authService=require(_0x6cc6('0x12'));var qs=require(_0x6cc6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cc6('0x14'));var logger=require(_0x6cc6('0x15'))(_0x6cc6('0x16'));var utils=require(_0x6cc6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6cc6('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xc6d0cd,_0x81c0e4){_0x81c0e4=_0x81c0e4||0xcc;return function(_0x5e2b35){if(_0x5e2b35){return _0xc6d0cd[_0x6cc6('0x19')](_0x81c0e4);}return _0xc6d0cd[_0x6cc6('0x1a')](_0x81c0e4)[_0x6cc6('0x1b')]();};}function respondWithResult(_0x39a9b0,_0x97cbe1){_0x97cbe1=_0x97cbe1||0xc8;return function(_0xc146ea){if(_0xc146ea){return _0x39a9b0['status'](_0x97cbe1)['json'](_0xc146ea);}};}function respondWithFilteredResult(_0x50ce97,_0x1ec7df){return function(_0x5f25da){if(_0x5f25da){var _0x37540e=typeof _0x1ec7df[_0x6cc6('0x1c')]===_0x6cc6('0x1d')&&typeof _0x1ec7df[_0x6cc6('0x1e')]==='undefined';var _0x5e3b91=_0x5f25da['count'];var _0x123104=_0x37540e?0x0:_0x1ec7df[_0x6cc6('0x1c')];var _0x3e8553=_0x37540e?_0x5f25da[_0x6cc6('0x1f')]:_0x1ec7df[_0x6cc6('0x1c')]+_0x1ec7df[_0x6cc6('0x1e')];var _0x566e2f;if(_0x3e8553>=_0x5e3b91){_0x3e8553=_0x5e3b91;_0x566e2f=0xc8;}else{_0x566e2f=0xce;}_0x50ce97['status'](_0x566e2f);return _0x50ce97[_0x6cc6('0x20')](_0x6cc6('0x21'),_0x123104+'-'+_0x3e8553+'/'+_0x5e3b91)[_0x6cc6('0x22')](_0x5f25da);}return null;};}function patchUpdates(_0x1216a9){return function(_0xa2873b){try{jsonpatch[_0x6cc6('0x23')](_0xa2873b,_0x1216a9,!![]);}catch(_0x5ba7ee){return BPromise['reject'](_0x5ba7ee);}return _0xa2873b[_0x6cc6('0x24')]();};}function saveUpdates(_0x250cd8,_0x53a2da){return function(_0x9d62f6){if(_0x9d62f6){return _0x9d62f6[_0x6cc6('0x25')](_0x250cd8)[_0x6cc6('0x26')](function(_0x215a2c){return _0x215a2c;});}return null;};}function removeEntity(_0x95edfa,_0x14e4ef){return function(_0x356dbe){if(_0x356dbe){return _0x356dbe[_0x6cc6('0x27')]()[_0x6cc6('0x26')](function(){_0x95edfa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x326251,_0x25d135){return function(_0x3e227b){if(!_0x3e227b){_0x326251[_0x6cc6('0x19')](0x194);}return _0x3e227b;};}function handleError(_0x131b47,_0x3762ae){_0x3762ae=_0x3762ae||0x1f4;return function(_0x5e9d2b){logger[_0x6cc6('0x28')](_0x5e9d2b[_0x6cc6('0x29')]);if(_0x5e9d2b[_0x6cc6('0x2a')]){delete _0x5e9d2b[_0x6cc6('0x2a')];}_0x131b47[_0x6cc6('0x1a')](_0x3762ae)['send'](_0x5e9d2b);};}exports[_0x6cc6('0x2b')]=function(_0x4e325f,_0x1f0ff2){var _0x2c7bbc={},_0x2a817f={},_0x39c735={'count':0x0,'rows':[]};var _0x42bf3d=_['map'](db['SalesforceAccount'][_0x6cc6('0x2c')],function(_0x376bfd){return{'name':_0x376bfd['fieldName'],'type':_0x376bfd[_0x6cc6('0x2d')]['key']};});_0x2a817f['model']=_[_0x6cc6('0x2e')](_0x42bf3d,'name');_0x2a817f[_0x6cc6('0x2f')]=_[_0x6cc6('0x30')](_0x4e325f[_0x6cc6('0x2f')]);_0x2a817f['filters']=_[_0x6cc6('0x31')](_0x2a817f[_0x6cc6('0x32')],_0x2a817f[_0x6cc6('0x2f')]);_0x2c7bbc[_0x6cc6('0x33')]=_[_0x6cc6('0x31')](_0x2a817f[_0x6cc6('0x32')],qs[_0x6cc6('0x34')](_0x4e325f['query'][_0x6cc6('0x34')]));_0x2c7bbc[_0x6cc6('0x33')]=_0x2c7bbc[_0x6cc6('0x33')][_0x6cc6('0x35')]?_0x2c7bbc[_0x6cc6('0x33')]:_0x2a817f['model'];if(!_0x4e325f[_0x6cc6('0x2f')][_0x6cc6('0x36')](_0x6cc6('0x37'))){_0x2c7bbc[_0x6cc6('0x1e')]=qs[_0x6cc6('0x1e')](_0x4e325f[_0x6cc6('0x2f')][_0x6cc6('0x1e')]);_0x2c7bbc[_0x6cc6('0x1c')]=qs[_0x6cc6('0x1c')](_0x4e325f[_0x6cc6('0x2f')][_0x6cc6('0x1c')]);}_0x2c7bbc[_0x6cc6('0x38')]=qs['sort'](_0x4e325f['query'][_0x6cc6('0x39')]);_0x2c7bbc[_0x6cc6('0x3a')]=qs[_0x6cc6('0x3b')](_['pick'](_0x4e325f[_0x6cc6('0x2f')],_0x2a817f[_0x6cc6('0x3b')]),_0x42bf3d);if(_0x4e325f[_0x6cc6('0x2f')]['filter']){_0x2c7bbc['where']=_['merge'](_0x2c7bbc[_0x6cc6('0x3a')],{'$or':_['map'](_0x42bf3d,function(_0x2cad83){if(_0x2cad83[_0x6cc6('0x2d')]!==_0x6cc6('0x3c')){var _0x461e3c={};_0x461e3c[_0x2cad83[_0x6cc6('0x2a')]]={'$like':'%'+_0x4e325f[_0x6cc6('0x2f')]['filter']+'%'};return _0x461e3c;}})});}_0x2c7bbc=_['merge']({},_0x2c7bbc,_0x4e325f[_0x6cc6('0x3d')]);var _0x3cb3ea={'where':_0x2c7bbc['where']};return db[_0x6cc6('0x3e')]['count'](_0x3cb3ea)[_0x6cc6('0x26')](function(_0xeebff0){_0x39c735['count']=_0xeebff0;if(_0x4e325f['query']['includeAll']){_0x2c7bbc[_0x6cc6('0x3f')]=[{'all':!![]}];}return db[_0x6cc6('0x3e')][_0x6cc6('0x40')](_0x2c7bbc);})['then'](function(_0x3ba8af){_0x39c735[_0x6cc6('0x41')]=_0x3ba8af;return _0x39c735;})['then'](respondWithFilteredResult(_0x1f0ff2,_0x2c7bbc))[_0x6cc6('0x42')](handleError(_0x1f0ff2,null));};exports[_0x6cc6('0x43')]=function(_0x81d2b8,_0x581c3b){var _0x59e6a0={'raw':![],'where':{'id':_0x81d2b8['params']['id']}},_0x36c324={};_0x36c324[_0x6cc6('0x32')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x36c324[_0x6cc6('0x2f')]=_[_0x6cc6('0x30')](_0x81d2b8[_0x6cc6('0x2f')]);_0x36c324[_0x6cc6('0x3b')]=_[_0x6cc6('0x31')](_0x36c324[_0x6cc6('0x32')],_0x36c324[_0x6cc6('0x2f')]);_0x59e6a0[_0x6cc6('0x33')]=_[_0x6cc6('0x31')](_0x36c324['model'],qs['fields'](_0x81d2b8[_0x6cc6('0x2f')][_0x6cc6('0x34')]));_0x59e6a0[_0x6cc6('0x33')]=_0x59e6a0['attributes'][_0x6cc6('0x35')]?_0x59e6a0[_0x6cc6('0x33')]:_0x36c324[_0x6cc6('0x32')];if(_0x81d2b8[_0x6cc6('0x2f')]['includeAll']){_0x59e6a0[_0x6cc6('0x3f')]=[{'all':!![]}];}_0x59e6a0=_['merge']({},_0x59e6a0,_0x81d2b8['options']);return db['SalesforceAccount'][_0x6cc6('0x44')](_0x59e6a0)['then'](handleEntityNotFound(_0x581c3b,null))[_0x6cc6('0x26')](respondWithResult(_0x581c3b,null))['catch'](handleError(_0x581c3b,null));};exports[_0x6cc6('0x45')]=function(_0x3680ab,_0x10746c){return db['SalesforceAccount']['create'](_0x3680ab[_0x6cc6('0x46')],{})['then'](respondWithResult(_0x10746c,0xc9))[_0x6cc6('0x42')](handleError(_0x10746c,null));};exports[_0x6cc6('0x25')]=function(_0x1c0baf,_0x1c83b3){if(_0x1c0baf[_0x6cc6('0x46')]['id']){delete _0x1c0baf[_0x6cc6('0x46')]['id'];}return db[_0x6cc6('0x3e')][_0x6cc6('0x44')]({'where':{'id':_0x1c0baf[_0x6cc6('0x47')]['id']}})[_0x6cc6('0x26')](handleEntityNotFound(_0x1c83b3,null))['then'](saveUpdates(_0x1c0baf[_0x6cc6('0x46')],null))[_0x6cc6('0x26')](respondWithResult(_0x1c83b3,null))['catch'](handleError(_0x1c83b3,null));};exports[_0x6cc6('0x27')]=function(_0x5673a2,_0x186e66){return db['SalesforceAccount']['find']({'where':{'id':_0x5673a2[_0x6cc6('0x47')]['id']}})['then'](handleEntityNotFound(_0x186e66,null))['then'](removeEntity(_0x186e66,null))[_0x6cc6('0x42')](handleError(_0x186e66,null));};exports[_0x6cc6('0x48')]=function(_0x338420,_0xcfcf29,_0x458371){var _0x2ef4e1={};var _0x12683a={};var _0x5c714d;var _0x40effb;return db[_0x6cc6('0x3e')]['findOne']({'where':{'id':_0x338420['params']['id']}})[_0x6cc6('0x26')](handleEntityNotFound(_0xcfcf29,null))[_0x6cc6('0x26')](function(_0x32f7e6){if(_0x32f7e6){_0x5c714d=_0x32f7e6;_0x12683a['model']=_[_0x6cc6('0x30')](db[_0x6cc6('0x49')][_0x6cc6('0x2c')]);_0x12683a[_0x6cc6('0x2f')]=_['keys'](_0x338420['query']);_0x12683a[_0x6cc6('0x3b')]=_[_0x6cc6('0x31')](_0x12683a[_0x6cc6('0x32')],_0x12683a['query']);_0x2ef4e1[_0x6cc6('0x33')]=_[_0x6cc6('0x31')](_0x12683a[_0x6cc6('0x32')],qs[_0x6cc6('0x34')](_0x338420[_0x6cc6('0x2f')][_0x6cc6('0x34')]));_0x2ef4e1['attributes']=_0x2ef4e1['attributes'][_0x6cc6('0x35')]?_0x2ef4e1[_0x6cc6('0x33')]:_0x12683a['model'];_0x2ef4e1[_0x6cc6('0x38')]=qs[_0x6cc6('0x39')](_0x338420[_0x6cc6('0x2f')][_0x6cc6('0x39')]);_0x2ef4e1[_0x6cc6('0x3a')]=qs[_0x6cc6('0x3b')](_[_0x6cc6('0x4a')](_0x338420[_0x6cc6('0x2f')],_0x12683a[_0x6cc6('0x3b')]));if(_0x338420[_0x6cc6('0x2f')][_0x6cc6('0x4b')]){_0x2ef4e1['where']=_[_0x6cc6('0x4c')](_0x2ef4e1[_0x6cc6('0x3a')],{'$or':_['map'](_0x2ef4e1[_0x6cc6('0x33')],function(_0x5e4d47){var _0x195e82={};_0x195e82[_0x5e4d47]={'$like':'%'+_0x338420['query'][_0x6cc6('0x4b')]+'%'};return _0x195e82;})});}_0x2ef4e1=_[_0x6cc6('0x4c')]({},_0x2ef4e1,_0x338420['options']);return _0x5c714d[_0x6cc6('0x48')](_0x2ef4e1);}})[_0x6cc6('0x26')](function(_0x1c61dc){if(_0x1c61dc){_0x40effb=_0x1c61dc['length'];if(!_0x338420[_0x6cc6('0x2f')][_0x6cc6('0x36')](_0x6cc6('0x37'))){_0x2ef4e1[_0x6cc6('0x1e')]=qs['limit'](_0x338420['query'][_0x6cc6('0x1e')]);_0x2ef4e1['offset']=qs[_0x6cc6('0x1c')](_0x338420[_0x6cc6('0x2f')][_0x6cc6('0x1c')]);}return _0x5c714d[_0x6cc6('0x48')](_0x2ef4e1);}})[_0x6cc6('0x26')](function(_0x4cbcaa){if(_0x4cbcaa){return _0x4cbcaa?{'count':_0x40effb,'rows':_0x4cbcaa}:null;}})[_0x6cc6('0x26')](respondWithResult(_0xcfcf29,null))['catch'](handleError(_0xcfcf29,null));};exports[_0x6cc6('0x4d')]=function(_0x245b70,_0x3198d0,_0x3c69ba){if(_0x245b70['body']['id']){delete _0x245b70['body']['id'];}return db[_0x6cc6('0x3e')][_0x6cc6('0x4e')]({'where':{'id':_0x245b70['params']['id']}})[_0x6cc6('0x26')](handleEntityNotFound(_0x3198d0,null))[_0x6cc6('0x26')](function(_0x57b5b4){if(_0x57b5b4){_0x245b70['body'][_0x6cc6('0x4f')]=_0x57b5b4['id'];_0x245b70['body'][_0x6cc6('0x50')]=integrations['getSubjects'](_0x245b70['body']['channel'],_0x245b70['body'][_0x6cc6('0x2d')]);_0x245b70[_0x6cc6('0x46')][_0x6cc6('0x51')]=integrations[_0x6cc6('0x52')](_0x245b70[_0x6cc6('0x46')][_0x6cc6('0x53')],_0x245b70[_0x6cc6('0x46')][_0x6cc6('0x2d')]);return db[_0x6cc6('0x49')]['create'](_0x245b70[_0x6cc6('0x46')],{'include':[{'model':db[_0x6cc6('0x54')],'as':_0x6cc6('0x50')},{'model':db[_0x6cc6('0x54')],'as':_0x6cc6('0x51')}]});}return null;})['then'](respondWithResult(_0x3198d0,null))[_0x6cc6('0x42')](handleError(_0x3198d0,null));};exports['getFields']=function(_0x240484,_0x121482,_0x344f7a){var _0x30d77e;var _0x50b6ee='';var _0x4bfc59=_0x6cc6('0x55');return db['SalesforceAccount']['findOne']({'where':{'id':_0x240484[_0x6cc6('0x47')]['id']},'attributes':['id',_0x6cc6('0x56'),'clientId','clientSecret','username',_0x6cc6('0x57'),_0x6cc6('0x58')]})[_0x6cc6('0x26')](handleEntityNotFound(_0x121482,null))['then'](function(_0x3d5daa){if(_0x3d5daa){_0x50b6ee=_0x3d5daa[_0x6cc6('0x56')];var _0x3a903c=_0x50b6ee['slice'](-0x1);if(_0x3a903c==='/'){_0x50b6ee=_0x50b6ee[_0x6cc6('0x59')](0x0,_0x50b6ee[_0x6cc6('0x5a')](_0x3a903c));}_0x30d77e=new jsforce[(_0x6cc6('0x5b'))]({'oauth2':{'loginUrl':_0x50b6ee,'clientId':_0x3d5daa[_0x6cc6('0x5c')],'clientSecret':_0x3d5daa[_0x6cc6('0x5d')]}});return _0x30d77e[_0x6cc6('0x5e')](_0x3d5daa[_0x6cc6('0x5f')],_0x3d5daa[_0x6cc6('0x57')][_0x6cc6('0x60')](_0x3d5daa['securityToken']));}})[_0x6cc6('0x26')](function(_0x395922){if(_0x395922){if(!_[_0x6cc6('0x61')](_0x240484[_0x6cc6('0x2f')][_0x6cc6('0x62')])){_0x4bfc59=_0x240484['query']['ticketType'];}return _0x30d77e[_0x6cc6('0x63')](_0x4bfc59)[_0x6cc6('0x64')]();}})['then'](function(_0x36f7c2){var _0x3e7cf5=[_0x6cc6('0x65'),_0x6cc6('0x66'),_0x6cc6('0x67'),_0x6cc6('0x68'),'Subject','Description'];var _0x28c050=[_0x6cc6('0x69'),_0x6cc6('0x6a'),_0x6cc6('0x6b'),_0x6cc6('0x6c'),_0x6cc6('0x6d'),_0x6cc6('0x6e'),_0x6cc6('0x6f')];if(_0x36f7c2){_[_0x6cc6('0x70')](_0x36f7c2['fields'],function(_0x6fca6a){return _0x3e7cf5[_0x6cc6('0x71')](_0x6fca6a[_0x6cc6('0x2a')])||!_0x28c050['includes'](_0x6fca6a[_0x6cc6('0x2d')]);});return{'count':_0x36f7c2[_0x6cc6('0x34')]['length'],'rows':_[_0x6cc6('0x2e')](_0x36f7c2[_0x6cc6('0x34')],function(_0x394755){return{'id':_0x394755['name'],'name':_0x394755[_0x6cc6('0x72')],'custom':_0x394755[_0x6cc6('0x73')],'options':_0x394755[_0x6cc6('0x74')][_0x6cc6('0x35')]>0x0?_[_0x6cc6('0x2e')](_0x394755[_0x6cc6('0x74')],function(_0x1fca53){return{'name':_0x1fca53[_0x6cc6('0x72')],'value':_0x1fca53[_0x6cc6('0x75')]};}):_0x394755['type']==_0x6cc6('0x6c')?[{'name':'True','value':_0x6cc6('0x76')},{'name':_0x6cc6('0x77'),'value':_0x6cc6('0x78')}]:[]};})};}})[_0x6cc6('0x26')](respondWithResult(_0x121482,null))['catch'](function(_0x19d695){var _0x399454=_0x240484[_0x6cc6('0x2f')][_0x6cc6('0x79')]?0x1f4:_0x19d695[_0x6cc6('0x7a')]||0x1f4;logger[_0x6cc6('0x28')](_0x6cc6('0x7b'),'getFields',_0x399454,JSON[_0x6cc6('0x7c')](_0x19d695));delete _0x19d695[_0x6cc6('0x2a')];if(_0x399454===0x191){_0x399454=0x190;}_0x121482[_0x6cc6('0x1a')](_0x399454)[_0x6cc6('0x7d')](_0x240484[_0x6cc6('0x2f')][_0x6cc6('0x79')]?{'message':_0x6cc6('0x7e'),'statusCode':_0x19d695[_0x6cc6('0x7a')]}:_0x19d695);});}; \ No newline at end of file +var _0x6d66=['channel','SalesforceField','getFields','Task','findOne','remoteUri','clientId','clientSecret','password','slice','substring','lastIndexOf','Connection','username','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','findAll','show','params','length','includeAll','include','find','catch','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x6d66,0x12c));var _0x66d6=function(_0x546037,_0x4e7876){_0x546037=_0x546037-0x0;var _0x122caf=_0x6d66[_0x546037];return _0x122caf;};'use strict';var emlformat=require(_0x66d6('0x0'));var rimraf=require(_0x66d6('0x1'));var zipdir=require(_0x66d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66d6('0x3'));var moment=require(_0x66d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x66d6('0x5'));var util=require(_0x66d6('0x6'));var path=require(_0x66d6('0x7'));var sox=require(_0x66d6('0x8'));var csv=require(_0x66d6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66d6('0xa'));var squel=require('squel');var crypto=require(_0x66d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x66d6('0xc'));var toCsv=require(_0x66d6('0x9'));var querystring=require(_0x66d6('0xd'));var Papa=require('papaparse');var Redis=require(_0x66d6('0xe'));var authService=require(_0x66d6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x66d6('0x10'));var hardwareService=require(_0x66d6('0x11'));var logger=require(_0x66d6('0x12'))(_0x66d6('0x13'));var utils=require(_0x66d6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x66d6('0x15'));var db=require(_0x66d6('0x16'))['db'];var integrations=require(_0x66d6('0x17'));function respondWithStatusCode(_0x15bab2,_0x3b767e){_0x3b767e=_0x3b767e||0xcc;return function(_0x1fa7a){if(_0x1fa7a){return _0x15bab2['sendStatus'](_0x3b767e);}return _0x15bab2[_0x66d6('0x18')](_0x3b767e)[_0x66d6('0x19')]();};}function respondWithResult(_0x48f75e,_0x22d223){_0x22d223=_0x22d223||0xc8;return function(_0x537f86){if(_0x537f86){return _0x48f75e[_0x66d6('0x18')](_0x22d223)[_0x66d6('0x1a')](_0x537f86);}};}function respondWithFilteredResult(_0x43ece2,_0x512dfe){return function(_0x4d4761){if(_0x4d4761){var _0x555f0c=typeof _0x512dfe[_0x66d6('0x1b')]===_0x66d6('0x1c')&&typeof _0x512dfe[_0x66d6('0x1d')]==='undefined';var _0x402d6e=_0x4d4761['count'];var _0x5c1a89=_0x555f0c?0x0:_0x512dfe[_0x66d6('0x1b')];var _0x20c9b6=_0x555f0c?_0x4d4761[_0x66d6('0x1e')]:_0x512dfe[_0x66d6('0x1b')]+_0x512dfe[_0x66d6('0x1d')];var _0x589ba5;if(_0x20c9b6>=_0x402d6e){_0x20c9b6=_0x402d6e;_0x589ba5=0xc8;}else{_0x589ba5=0xce;}_0x43ece2[_0x66d6('0x18')](_0x589ba5);return _0x43ece2[_0x66d6('0x1f')](_0x66d6('0x20'),_0x5c1a89+'-'+_0x20c9b6+'/'+_0x402d6e)[_0x66d6('0x1a')](_0x4d4761);}return null;};}function patchUpdates(_0x369121){return function(_0x44f7cb){try{jsonpatch['apply'](_0x44f7cb,_0x369121,!![]);}catch(_0x17b9ee){return BPromise['reject'](_0x17b9ee);}return _0x44f7cb[_0x66d6('0x21')]();};}function saveUpdates(_0x39a73c,_0x378cdf){return function(_0x33bcae){if(_0x33bcae){return _0x33bcae['update'](_0x39a73c)[_0x66d6('0x22')](function(_0x49fde0){return _0x49fde0;});}return null;};}function removeEntity(_0x47be5d,_0x636026){return function(_0x452fa2){if(_0x452fa2){return _0x452fa2[_0x66d6('0x23')]()[_0x66d6('0x22')](function(){_0x47be5d[_0x66d6('0x18')](0xcc)[_0x66d6('0x19')]();});}};}function handleEntityNotFound(_0x10e61a,_0x1c7e7b){return function(_0x296892){if(!_0x296892){_0x10e61a[_0x66d6('0x24')](0x194);}return _0x296892;};}function handleError(_0xc969ed,_0x35c876){_0x35c876=_0x35c876||0x1f4;return function(_0xe3e590){logger[_0x66d6('0x25')](_0xe3e590['stack']);if(_0xe3e590[_0x66d6('0x26')]){delete _0xe3e590[_0x66d6('0x26')];}_0xc969ed[_0x66d6('0x18')](_0x35c876)[_0x66d6('0x27')](_0xe3e590);};}exports[_0x66d6('0x28')]=function(_0x25d048,_0x3bf569){var _0x713126={},_0x324450={},_0x1ed744={'count':0x0,'rows':[]};var _0x5f0eb5=_[_0x66d6('0x29')](db['SalesforceAccount'][_0x66d6('0x2a')],function(_0x3139cf){return{'name':_0x3139cf[_0x66d6('0x2b')],'type':_0x3139cf[_0x66d6('0x2c')][_0x66d6('0x2d')]};});_0x324450[_0x66d6('0x2e')]=_[_0x66d6('0x29')](_0x5f0eb5,_0x66d6('0x26'));_0x324450[_0x66d6('0x2f')]=_[_0x66d6('0x30')](_0x25d048[_0x66d6('0x2f')]);_0x324450[_0x66d6('0x31')]=_['intersection'](_0x324450[_0x66d6('0x2e')],_0x324450[_0x66d6('0x2f')]);_0x713126['attributes']=_[_0x66d6('0x32')](_0x324450[_0x66d6('0x2e')],qs[_0x66d6('0x33')](_0x25d048[_0x66d6('0x2f')][_0x66d6('0x33')]));_0x713126[_0x66d6('0x34')]=_0x713126[_0x66d6('0x34')]['length']?_0x713126[_0x66d6('0x34')]:_0x324450[_0x66d6('0x2e')];if(!_0x25d048[_0x66d6('0x2f')][_0x66d6('0x35')](_0x66d6('0x36'))){_0x713126['limit']=qs[_0x66d6('0x1d')](_0x25d048[_0x66d6('0x2f')]['limit']);_0x713126[_0x66d6('0x1b')]=qs[_0x66d6('0x1b')](_0x25d048['query'][_0x66d6('0x1b')]);}_0x713126[_0x66d6('0x37')]=qs[_0x66d6('0x38')](_0x25d048['query'][_0x66d6('0x38')]);_0x713126[_0x66d6('0x39')]=qs[_0x66d6('0x31')](_[_0x66d6('0x3a')](_0x25d048[_0x66d6('0x2f')],_0x324450[_0x66d6('0x31')]),_0x5f0eb5);if(_0x25d048[_0x66d6('0x2f')][_0x66d6('0x3b')]){_0x713126[_0x66d6('0x39')]=_['merge'](_0x713126[_0x66d6('0x39')],{'$or':_['map'](_0x5f0eb5,function(_0x57ad91){if(_0x57ad91[_0x66d6('0x2c')]!=='VIRTUAL'){var _0x176aa1={};_0x176aa1[_0x57ad91[_0x66d6('0x26')]]={'$like':'%'+_0x25d048[_0x66d6('0x2f')]['filter']+'%'};return _0x176aa1;}})});}_0x713126=_[_0x66d6('0x3c')]({},_0x713126,_0x25d048[_0x66d6('0x3d')]);var _0x21ec05={'where':_0x713126['where']};return db[_0x66d6('0x3e')][_0x66d6('0x1e')](_0x21ec05)[_0x66d6('0x22')](function(_0xf1f919){_0x1ed744[_0x66d6('0x1e')]=_0xf1f919;if(_0x25d048[_0x66d6('0x2f')]['includeAll']){_0x713126['include']=[{'all':!![]}];}return db[_0x66d6('0x3e')][_0x66d6('0x3f')](_0x713126);})[_0x66d6('0x22')](function(_0xacf362){_0x1ed744['rows']=_0xacf362;return _0x1ed744;})[_0x66d6('0x22')](respondWithFilteredResult(_0x3bf569,_0x713126))['catch'](handleError(_0x3bf569,null));};exports[_0x66d6('0x40')]=function(_0x49f599,_0x2b237d){var _0x4450c1={'raw':![],'where':{'id':_0x49f599[_0x66d6('0x41')]['id']}},_0x3a24ec={};_0x3a24ec[_0x66d6('0x2e')]=_[_0x66d6('0x30')](db[_0x66d6('0x3e')][_0x66d6('0x2a')]);_0x3a24ec[_0x66d6('0x2f')]=_[_0x66d6('0x30')](_0x49f599[_0x66d6('0x2f')]);_0x3a24ec[_0x66d6('0x31')]=_[_0x66d6('0x32')](_0x3a24ec['model'],_0x3a24ec[_0x66d6('0x2f')]);_0x4450c1['attributes']=_['intersection'](_0x3a24ec[_0x66d6('0x2e')],qs[_0x66d6('0x33')](_0x49f599[_0x66d6('0x2f')][_0x66d6('0x33')]));_0x4450c1[_0x66d6('0x34')]=_0x4450c1['attributes'][_0x66d6('0x42')]?_0x4450c1[_0x66d6('0x34')]:_0x3a24ec[_0x66d6('0x2e')];if(_0x49f599['query'][_0x66d6('0x43')]){_0x4450c1[_0x66d6('0x44')]=[{'all':!![]}];}_0x4450c1=_[_0x66d6('0x3c')]({},_0x4450c1,_0x49f599['options']);return db[_0x66d6('0x3e')][_0x66d6('0x45')](_0x4450c1)[_0x66d6('0x22')](handleEntityNotFound(_0x2b237d,null))['then'](respondWithResult(_0x2b237d,null))[_0x66d6('0x46')](handleError(_0x2b237d,null));};exports[_0x66d6('0x47')]=function(_0x5061bd,_0x399ca4){return db[_0x66d6('0x3e')][_0x66d6('0x47')](_0x5061bd[_0x66d6('0x48')],{})[_0x66d6('0x22')](respondWithResult(_0x399ca4,0xc9))[_0x66d6('0x46')](handleError(_0x399ca4,null));};exports['update']=function(_0x1df173,_0x4a0018){if(_0x1df173[_0x66d6('0x48')]['id']){delete _0x1df173['body']['id'];}return db[_0x66d6('0x3e')][_0x66d6('0x45')]({'where':{'id':_0x1df173[_0x66d6('0x41')]['id']}})[_0x66d6('0x22')](handleEntityNotFound(_0x4a0018,null))['then'](saveUpdates(_0x1df173[_0x66d6('0x48')],null))[_0x66d6('0x22')](respondWithResult(_0x4a0018,null))[_0x66d6('0x46')](handleError(_0x4a0018,null));};exports[_0x66d6('0x23')]=function(_0x24701a,_0x4b89e0){return db[_0x66d6('0x3e')][_0x66d6('0x45')]({'where':{'id':_0x24701a[_0x66d6('0x41')]['id']}})[_0x66d6('0x22')](handleEntityNotFound(_0x4b89e0,null))[_0x66d6('0x22')](removeEntity(_0x4b89e0,null))[_0x66d6('0x46')](handleError(_0x4b89e0,null));};exports[_0x66d6('0x49')]=function(_0x9cd381,_0x4174ab,_0x10ec82){var _0x4fdfe8={};var _0x48e38a={};var _0x3aa6ec;var _0x218c28;return db[_0x66d6('0x3e')]['findOne']({'where':{'id':_0x9cd381[_0x66d6('0x41')]['id']}})[_0x66d6('0x22')](handleEntityNotFound(_0x4174ab,null))['then'](function(_0x545ac5){if(_0x545ac5){_0x3aa6ec=_0x545ac5;_0x48e38a[_0x66d6('0x2e')]=_[_0x66d6('0x30')](db[_0x66d6('0x4a')][_0x66d6('0x2a')]);_0x48e38a['query']=_[_0x66d6('0x30')](_0x9cd381[_0x66d6('0x2f')]);_0x48e38a['filters']=_[_0x66d6('0x32')](_0x48e38a['model'],_0x48e38a[_0x66d6('0x2f')]);_0x4fdfe8[_0x66d6('0x34')]=_['intersection'](_0x48e38a[_0x66d6('0x2e')],qs[_0x66d6('0x33')](_0x9cd381[_0x66d6('0x2f')][_0x66d6('0x33')]));_0x4fdfe8[_0x66d6('0x34')]=_0x4fdfe8['attributes'][_0x66d6('0x42')]?_0x4fdfe8['attributes']:_0x48e38a[_0x66d6('0x2e')];_0x4fdfe8[_0x66d6('0x37')]=qs['sort'](_0x9cd381[_0x66d6('0x2f')][_0x66d6('0x38')]);_0x4fdfe8[_0x66d6('0x39')]=qs[_0x66d6('0x31')](_[_0x66d6('0x3a')](_0x9cd381[_0x66d6('0x2f')],_0x48e38a[_0x66d6('0x31')]));if(_0x9cd381[_0x66d6('0x2f')]['filter']){_0x4fdfe8[_0x66d6('0x39')]=_[_0x66d6('0x3c')](_0x4fdfe8[_0x66d6('0x39')],{'$or':_[_0x66d6('0x29')](_0x4fdfe8['attributes'],function(_0x35c0bf){var _0x4ddd70={};_0x4ddd70[_0x35c0bf]={'$like':'%'+_0x9cd381[_0x66d6('0x2f')][_0x66d6('0x3b')]+'%'};return _0x4ddd70;})});}_0x4fdfe8=_['merge']({},_0x4fdfe8,_0x9cd381[_0x66d6('0x3d')]);return _0x3aa6ec['getConfigurations'](_0x4fdfe8);}})['then'](function(_0x5c1395){if(_0x5c1395){_0x218c28=_0x5c1395[_0x66d6('0x42')];if(!_0x9cd381[_0x66d6('0x2f')]['hasOwnProperty'](_0x66d6('0x36'))){_0x4fdfe8[_0x66d6('0x1d')]=qs[_0x66d6('0x1d')](_0x9cd381[_0x66d6('0x2f')]['limit']);_0x4fdfe8[_0x66d6('0x1b')]=qs[_0x66d6('0x1b')](_0x9cd381[_0x66d6('0x2f')][_0x66d6('0x1b')]);}return _0x3aa6ec[_0x66d6('0x49')](_0x4fdfe8);}})[_0x66d6('0x22')](function(_0x20a0f2){if(_0x20a0f2){return _0x20a0f2?{'count':_0x218c28,'rows':_0x20a0f2}:null;}})['then'](respondWithResult(_0x4174ab,null))[_0x66d6('0x46')](handleError(_0x4174ab,null));};exports[_0x66d6('0x4b')]=function(_0xf11fc8,_0xef2e83,_0x2110aa){if(_0xf11fc8[_0x66d6('0x48')]['id']){delete _0xf11fc8[_0x66d6('0x48')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0xf11fc8[_0x66d6('0x41')]['id']}})[_0x66d6('0x22')](handleEntityNotFound(_0xef2e83,null))[_0x66d6('0x22')](function(_0x182c7d){if(_0x182c7d){_0xf11fc8[_0x66d6('0x48')][_0x66d6('0x4c')]=_0x182c7d['id'];_0xf11fc8[_0x66d6('0x48')][_0x66d6('0x4d')]=integrations[_0x66d6('0x4e')](_0xf11fc8[_0x66d6('0x48')]['channel'],_0xf11fc8['body']['type']);_0xf11fc8['body'][_0x66d6('0x4f')]=integrations[_0x66d6('0x50')](_0xf11fc8['body'][_0x66d6('0x51')],_0xf11fc8[_0x66d6('0x48')][_0x66d6('0x2c')]);return db[_0x66d6('0x4a')]['create'](_0xf11fc8[_0x66d6('0x48')],{'include':[{'model':db[_0x66d6('0x52')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x66d6('0x4f')}]});}return null;})[_0x66d6('0x22')](respondWithResult(_0xef2e83,null))[_0x66d6('0x46')](handleError(_0xef2e83,null));};exports[_0x66d6('0x53')]=function(_0x55f222,_0x37057d,_0x228cf3){var _0x8c13ee;var _0x55e562='';var _0x54de84=_0x66d6('0x54');return db[_0x66d6('0x3e')][_0x66d6('0x55')]({'where':{'id':_0x55f222[_0x66d6('0x41')]['id']},'attributes':['id',_0x66d6('0x56'),_0x66d6('0x57'),_0x66d6('0x58'),'username',_0x66d6('0x59'),'securityToken']})[_0x66d6('0x22')](handleEntityNotFound(_0x37057d,null))[_0x66d6('0x22')](function(_0x2a29d5){if(_0x2a29d5){_0x55e562=_0x2a29d5['remoteUri'];var _0x3cc375=_0x55e562[_0x66d6('0x5a')](-0x1);if(_0x3cc375==='/'){_0x55e562=_0x55e562[_0x66d6('0x5b')](0x0,_0x55e562[_0x66d6('0x5c')](_0x3cc375));}_0x8c13ee=new jsforce[(_0x66d6('0x5d'))]({'oauth2':{'loginUrl':_0x55e562,'clientId':_0x2a29d5['clientId'],'clientSecret':_0x2a29d5[_0x66d6('0x58')]}});return _0x8c13ee['login'](_0x2a29d5[_0x66d6('0x5e')],_0x2a29d5[_0x66d6('0x59')]['concat'](_0x2a29d5[_0x66d6('0x5f')]));}})[_0x66d6('0x22')](function(_0x138ffe){if(_0x138ffe){if(!_[_0x66d6('0x60')](_0x55f222[_0x66d6('0x2f')][_0x66d6('0x61')])){_0x54de84=_0x55f222[_0x66d6('0x2f')][_0x66d6('0x61')];}return _0x8c13ee[_0x66d6('0x62')](_0x54de84)[_0x66d6('0x63')]();}})[_0x66d6('0x22')](function(_0xac65b){var _0x762bd=[_0x66d6('0x64'),_0x66d6('0x65'),_0x66d6('0x66'),_0x66d6('0x67'),_0x66d6('0x68'),_0x66d6('0x69')];var _0x1d450f=[_0x66d6('0x6a'),_0x66d6('0x6b'),_0x66d6('0x6c'),_0x66d6('0x6d'),'email',_0x66d6('0x6e'),_0x66d6('0x6f')];if(_0xac65b){_[_0x66d6('0x70')](_0xac65b['fields'],function(_0x2022f4){return _0x762bd[_0x66d6('0x71')](_0x2022f4[_0x66d6('0x26')])||!_0x1d450f[_0x66d6('0x71')](_0x2022f4[_0x66d6('0x2c')]);});return{'count':_0xac65b[_0x66d6('0x33')][_0x66d6('0x42')],'rows':_[_0x66d6('0x29')](_0xac65b[_0x66d6('0x33')],function(_0x526d4c){return{'id':_0x526d4c[_0x66d6('0x26')],'name':_0x526d4c['label'],'custom':_0x526d4c[_0x66d6('0x72')],'options':_0x526d4c[_0x66d6('0x73')][_0x66d6('0x42')]>0x0?_[_0x66d6('0x29')](_0x526d4c[_0x66d6('0x73')],function(_0x116026){return{'name':_0x116026[_0x66d6('0x74')],'value':_0x116026[_0x66d6('0x75')]};}):_0x526d4c[_0x66d6('0x2c')]=='boolean'?[{'name':_0x66d6('0x76'),'value':_0x66d6('0x77')},{'name':_0x66d6('0x78'),'value':_0x66d6('0x79')}]:[]};})};}})['then'](respondWithResult(_0x37057d,null))['catch'](function(_0x14c607){var _0xfc2cae=_0x55f222[_0x66d6('0x2f')][_0x66d6('0x7a')]?0x1f4:_0x14c607[_0x66d6('0x7b')]||0x1f4;logger[_0x66d6('0x25')](_0x66d6('0x7c'),'getFields',_0xfc2cae,JSON[_0x66d6('0x7d')](_0x14c607));delete _0x14c607['name'];if(_0xfc2cae===0x191){_0xfc2cae=0x190;}_0x37057d['status'](_0xfc2cae)[_0x66d6('0x27')](_0x55f222['query'][_0x66d6('0x7a')]?{'message':_0x66d6('0x7e'),'statusCode':_0x14c607[_0x66d6('0x7b')]}:_0x14c607);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 87ee5f9..32ad124 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 _0xb09d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','SalesforceAccount','int_salesforce_accounts','util'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xb09d,0x171));var _0xdb09=function(_0x3c0aea,_0x35538f){_0x3c0aea=_0x3c0aea-0x0;var _0x5918f1=_0xb09d[_0x3c0aea];return _0x5918f1;};'use strict';var _=require('lodash');var util=require(_0xdb09('0x0'));var logger=require(_0xdb09('0x1'))(_0xdb09('0x2'));var moment=require(_0xdb09('0x3'));var BPromise=require(_0xdb09('0x4'));var rp=require(_0xdb09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb09('0x6'));var config=require(_0xdb09('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x50ae5a,_0x29d58b){return _0x50ae5a['define'](_0xdb09('0x8'),attributes,{'tableName':_0xdb09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x428b=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x428b,0x180));var _0xb428=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x428b[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require(_0xb428('0x0'));var logger=require(_0xb428('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb428('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb428('0x3'));var rimraf=require(_0xb428('0x4'));var config=require(_0xb428('0x5'));var attributes=require(_0xb428('0x6'));var integrations=require(_0xb428('0x7'));module[_0xb428('0x8')]=function(_0x53528f,_0x27bfe6){return _0x53528f[_0xb428('0x9')](_0xb428('0xa'),attributes,{'tableName':_0xb428('0xb'),'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 a20d8dd..068dc71 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 _0xa201=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','request\x20sent','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x38e75d,_0x554fc4){var _0x254f86=function(_0x52e5ba){while(--_0x52e5ba){_0x38e75d['push'](_0x38e75d['shift']());}};_0x254f86(++_0x554fc4);}(_0xa201,0x1eb));var _0x1a20=function(_0x2aac51,_0x2dbc51){_0x2aac51=_0x2aac51-0x0;var _0x4ba79b=_0xa201[_0x2aac51];return _0x4ba79b;};'use strict';var _=require(_0x1a20('0x0'));var util=require(_0x1a20('0x1'));var moment=require(_0x1a20('0x2'));var BPromise=require(_0x1a20('0x3'));var rs=require(_0x1a20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a20('0x5'))['db'];var utils=require(_0x1a20('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1a20('0x7'));var jayson=require(_0x1a20('0x8'));var client=jayson[_0x1a20('0x9')][_0x1a20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4542db,_0x3c7c12,_0x49d337){return new BPromise(function(_0x4062da,_0x15ba6a){return client[_0x1a20('0xb')](_0x4542db,_0x49d337)['then'](function(_0x287671){logger[_0x1a20('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x3c7c12,'request\x20sent');logger[_0x1a20('0xd')](_0x1a20('0xe'),_0x3c7c12,'request\x20sent',JSON[_0x1a20('0xf')](_0x287671));if(_0x287671[_0x1a20('0x10')]){if(_0x287671[_0x1a20('0x10')][_0x1a20('0x11')]===0x1f4){logger[_0x1a20('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3c7c12,_0x287671[_0x1a20('0x10')][_0x1a20('0x12')]);return _0x15ba6a(_0x287671['error']['message']);}logger[_0x1a20('0x10')](_0x1a20('0x13'),_0x3c7c12,_0x287671[_0x1a20('0x10')][_0x1a20('0x12')]);return _0x4062da(_0x287671['error'][_0x1a20('0x12')]);}else{logger[_0x1a20('0xc')](_0x1a20('0x13'),_0x3c7c12,_0x1a20('0x14'));_0x4062da(_0x287671[_0x1a20('0x15')][_0x1a20('0x12')]);}})['catch'](function(_0x339368){logger[_0x1a20('0x10')](_0x1a20('0x13'),_0x3c7c12,_0x339368);_0x15ba6a(_0x339368);});});}exports[_0x1a20('0x16')]=function(_0x490c8d){var _0x18204f=this;return new Promise(function(_0x3b2ea0,_0x40f88b){return db[_0x1a20('0x17')][_0x1a20('0x18')]({'raw':_0x490c8d[_0x1a20('0x19')]?_0x490c8d[_0x1a20('0x19')][_0x1a20('0x1a')]===undefined?!![]:![]:!![],'where':_0x490c8d['options']?_0x490c8d[_0x1a20('0x19')][_0x1a20('0x1b')]||null:null,'attributes':_0x490c8d[_0x1a20('0x19')]?_0x490c8d['options'][_0x1a20('0x1c')]||null:null,'limit':_0x490c8d[_0x1a20('0x19')]?_0x490c8d[_0x1a20('0x19')][_0x1a20('0x1d')]||null:null,'include':_0x490c8d[_0x1a20('0x19')]?_0x490c8d[_0x1a20('0x19')][_0x1a20('0x1e')]?_[_0x1a20('0x1f')](_0x490c8d[_0x1a20('0x19')][_0x1a20('0x1e')],function(_0xa43b9c){return{'model':db[_0xa43b9c[_0x1a20('0x20')]],'as':_0xa43b9c['as'],'attributes':_0xa43b9c[_0x1a20('0x1c')],'include':_0xa43b9c[_0x1a20('0x1e')]?_['map'](_0xa43b9c['include'],function(_0x548a52){return{'model':db[_0x548a52[_0x1a20('0x20')]],'as':_0x548a52['as'],'attributes':_0x548a52['attributes'],'include':_0x548a52[_0x1a20('0x1e')]?_[_0x1a20('0x1f')](_0x548a52[_0x1a20('0x1e')],function(_0x897e71){return{'model':db[_0x897e71[_0x1a20('0x20')]],'as':_0x897e71['as'],'attributes':_0x897e71[_0x1a20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a20('0x21')](function(_0xe513cb){logger[_0x1a20('0xc')]('GetSalesforceAccount',_0x490c8d);logger[_0x1a20('0xd')](_0x1a20('0x16'),_0x490c8d,JSON[_0x1a20('0xf')](_0xe513cb));_0x3b2ea0(_0xe513cb);})[_0x1a20('0x22')](function(_0x426977){logger['error'](_0x1a20('0x16'),_0x426977[_0x1a20('0x12')],_0x490c8d);_0x40f88b(_0x18204f[_0x1a20('0x10')](0x1f4,_0x426977[_0x1a20('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x57a999){var _0x2069af=this;return new Promise(function(_0x3e1f89,_0x16d045){return db['SalesforceAccount']['find']({'raw':_0x57a999[_0x1a20('0x19')]?_0x57a999[_0x1a20('0x19')][_0x1a20('0x1a')]===undefined?!![]:![]:!![],'where':_0x57a999['options']?_0x57a999[_0x1a20('0x19')][_0x1a20('0x1b')]||null:null,'attributes':_0x57a999['options']?_0x57a999[_0x1a20('0x19')][_0x1a20('0x1c')]||null:null,'include':_0x57a999[_0x1a20('0x19')]?_0x57a999['options'][_0x1a20('0x1e')]?_[_0x1a20('0x1f')](_0x57a999['options'][_0x1a20('0x1e')],function(_0x4405e1){return{'model':db[_0x4405e1['model']],'as':_0x4405e1['as'],'attributes':_0x4405e1[_0x1a20('0x1c')],'include':_0x4405e1[_0x1a20('0x1e')]?_[_0x1a20('0x1f')](_0x4405e1[_0x1a20('0x1e')],function(_0x2dd360){return{'model':db[_0x2dd360[_0x1a20('0x20')]],'as':_0x2dd360['as'],'attributes':_0x2dd360[_0x1a20('0x1c')],'include':_0x2dd360[_0x1a20('0x1e')]?_[_0x1a20('0x1f')](_0x2dd360['include'],function(_0x2e747d){return{'model':db[_0x2e747d['model']],'as':_0x2e747d['as'],'attributes':_0x2e747d[_0x1a20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a20('0x21')](function(_0x5cee70){logger[_0x1a20('0xc')](_0x1a20('0x23'),_0x57a999);logger[_0x1a20('0xd')](_0x1a20('0x23'),_0x57a999,JSON[_0x1a20('0xf')](_0x5cee70));_0x3e1f89(_0x5cee70);})[_0x1a20('0x22')](function(_0x39cb22){logger[_0x1a20('0x10')]('ShowSalesforceAccount',_0x39cb22[_0x1a20('0x12')],_0x57a999);_0x16d045(_0x2069af[_0x1a20('0x10')](0x1f4,_0x39cb22[_0x1a20('0x12')]));});});}; \ No newline at end of file +var _0xb282=['options','where','attributes','limit','map','include','model','then','GetSalesforceAccount','catch','ShowSalesforceAccount','find','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SalesforceAccount'];(function(_0x3cfe76,_0x1d9d61){var _0x1f6f12=function(_0x1f2148){while(--_0x1f2148){_0x3cfe76['push'](_0x3cfe76['shift']());}};_0x1f6f12(++_0x1d9d61);}(_0xb282,0xad));var _0x2b28=function(_0x4d0810,_0x13e15f){_0x4d0810=_0x4d0810-0x0;var _0x3e47e0=_0xb282[_0x4d0810];return _0x3e47e0;};'use strict';var _=require(_0x2b28('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2b28('0x1'));var rs=require(_0x2b28('0x2'));var fs=require('fs');var Redis=require(_0x2b28('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b28('0x4'));var logger=require(_0x2b28('0x5'))(_0x2b28('0x6'));var config=require('../../config/environment');var jayson=require(_0x2b28('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51d80a,_0x44181f,_0x406760){return new BPromise(function(_0x4a681b,_0x2bd543){return client['request'](_0x51d80a,_0x406760)['then'](function(_0x153509){logger[_0x2b28('0x8')](_0x2b28('0x9'),_0x44181f,_0x2b28('0xa'));logger[_0x2b28('0xb')](_0x2b28('0xc'),_0x44181f,'request\x20sent',JSON[_0x2b28('0xd')](_0x153509));if(_0x153509[_0x2b28('0xe')]){if(_0x153509[_0x2b28('0xe')][_0x2b28('0xf')]===0x1f4){logger[_0x2b28('0xe')](_0x2b28('0x9'),_0x44181f,_0x153509[_0x2b28('0xe')][_0x2b28('0x10')]);return _0x2bd543(_0x153509['error']['message']);}logger[_0x2b28('0xe')](_0x2b28('0x9'),_0x44181f,_0x153509[_0x2b28('0xe')]['message']);return _0x4a681b(_0x153509[_0x2b28('0xe')][_0x2b28('0x10')]);}else{logger[_0x2b28('0x8')]('SalesforceAccount,\x20%s,\x20%s',_0x44181f,_0x2b28('0xa'));_0x4a681b(_0x153509[_0x2b28('0x11')][_0x2b28('0x10')]);}})['catch'](function(_0x519ec8){logger['error'](_0x2b28('0x9'),_0x44181f,_0x519ec8);_0x2bd543(_0x519ec8);});});}exports['GetSalesforceAccount']=function(_0x10e674){var _0xa68f21=this;return new Promise(function(_0x29dd8c,_0x4b8736){return db[_0x2b28('0x12')]['findAll']({'raw':_0x10e674[_0x2b28('0x13')]?_0x10e674[_0x2b28('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x10e674[_0x2b28('0x13')]?_0x10e674['options'][_0x2b28('0x14')]||null:null,'attributes':_0x10e674['options']?_0x10e674['options'][_0x2b28('0x15')]||null:null,'limit':_0x10e674[_0x2b28('0x13')]?_0x10e674['options'][_0x2b28('0x16')]||null:null,'include':_0x10e674[_0x2b28('0x13')]?_0x10e674[_0x2b28('0x13')]['include']?_[_0x2b28('0x17')](_0x10e674[_0x2b28('0x13')][_0x2b28('0x18')],function(_0x39ca6d){return{'model':db[_0x39ca6d['model']],'as':_0x39ca6d['as'],'attributes':_0x39ca6d[_0x2b28('0x15')],'include':_0x39ca6d[_0x2b28('0x18')]?_[_0x2b28('0x17')](_0x39ca6d[_0x2b28('0x18')],function(_0x3d3d3e){return{'model':db[_0x3d3d3e[_0x2b28('0x19')]],'as':_0x3d3d3e['as'],'attributes':_0x3d3d3e[_0x2b28('0x15')],'include':_0x3d3d3e['include']?_['map'](_0x3d3d3e[_0x2b28('0x18')],function(_0x102a56){return{'model':db[_0x102a56[_0x2b28('0x19')]],'as':_0x102a56['as'],'attributes':_0x102a56[_0x2b28('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2b28('0x1a')](function(_0x263dbe){logger['info'](_0x2b28('0x1b'),_0x10e674);logger[_0x2b28('0xb')]('GetSalesforceAccount',_0x10e674,JSON[_0x2b28('0xd')](_0x263dbe));_0x29dd8c(_0x263dbe);})[_0x2b28('0x1c')](function(_0x40613a){logger['error'](_0x2b28('0x1b'),_0x40613a['message'],_0x10e674);_0x4b8736(_0xa68f21[_0x2b28('0xe')](0x1f4,_0x40613a[_0x2b28('0x10')]));});});};exports[_0x2b28('0x1d')]=function(_0x1822ac){var _0xc7b5f=this;return new Promise(function(_0x2b4233,_0xebea2a){return db[_0x2b28('0x12')][_0x2b28('0x1e')]({'raw':_0x1822ac[_0x2b28('0x13')]?_0x1822ac[_0x2b28('0x13')][_0x2b28('0x1f')]===undefined?!![]:![]:!![],'where':_0x1822ac[_0x2b28('0x13')]?_0x1822ac[_0x2b28('0x13')]['where']||null:null,'attributes':_0x1822ac[_0x2b28('0x13')]?_0x1822ac['options'][_0x2b28('0x15')]||null:null,'include':_0x1822ac[_0x2b28('0x13')]?_0x1822ac['options'][_0x2b28('0x18')]?_[_0x2b28('0x17')](_0x1822ac[_0x2b28('0x13')][_0x2b28('0x18')],function(_0x4425dd){return{'model':db[_0x4425dd[_0x2b28('0x19')]],'as':_0x4425dd['as'],'attributes':_0x4425dd[_0x2b28('0x15')],'include':_0x4425dd['include']?_[_0x2b28('0x17')](_0x4425dd[_0x2b28('0x18')],function(_0x4d03a5){return{'model':db[_0x4d03a5[_0x2b28('0x19')]],'as':_0x4d03a5['as'],'attributes':_0x4d03a5[_0x2b28('0x15')],'include':_0x4d03a5[_0x2b28('0x18')]?_[_0x2b28('0x17')](_0x4d03a5['include'],function(_0x350a88){return{'model':db[_0x350a88['model']],'as':_0x350a88['as'],'attributes':_0x350a88[_0x2b28('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2b28('0x1a')](function(_0xcd3288){logger[_0x2b28('0x8')](_0x2b28('0x1d'),_0x1822ac);logger[_0x2b28('0xb')](_0x2b28('0x1d'),_0x1822ac,JSON[_0x2b28('0xd')](_0xcd3288));_0x2b4233(_0xcd3288);})[_0x2b28('0x1c')](function(_0x59369c){logger[_0x2b28('0xe')](_0x2b28('0x1d'),_0x59369c[_0x2b28('0x10')],_0x1822ac);_0xebea2a(_0xc7b5f[_0x2b28('0xe')](0x1f4,_0x59369c[_0x2b28('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2a9b0a8..61beaf4 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x37435c,_0x409780){var _0x2c26f0=function(_0x57c932){while(--_0x57c932){_0x37435c['push'](_0x37435c['shift']());}};_0x2c26f0(++_0x409780);}(_0x5f2f,0x73));var _0xf5f2=function(_0x322741,_0x2efe99){_0x322741=_0x322741-0x0;var _0x4a1c67=_0x5f2f[_0x322741];return _0x4a1c67;};'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 fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xdb28,0x106));var _0x8db2=function(_0x72429e,_0x23d2e1){_0x72429e=_0x72429e-0x0;var _0x1768b9=_0xdb28[_0x72429e];return _0x1768b9;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4076ec4..b12a0a5 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 _0xf28f=['account_contact_lead','account','nothing','sequelize','STRING','Task','Case','contact_lead','lead'];(function(_0x2bdaa7,_0x3d393b){var _0x37d65d=function(_0x24e272){while(--_0x24e272){_0x2bdaa7['push'](_0x2bdaa7['shift']());}};_0x37d65d(++_0x3d393b);}(_0xf28f,0x6f));var _0xff28=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xf28f[_0x166d93];return _0xba708;};'use strict';var Sequelize=require(_0xff28('0x0'));module['exports']={'name':{'type':Sequelize[_0xff28('0x1')]},'description':{'type':Sequelize[_0xff28('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xff28('0x2'),_0xff28('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xff28('0x4'),'contact',_0xff28('0x5'),_0xff28('0x6'),_0xff28('0x7')),'defaultValue':_0xff28('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xff28('0x8'),'contact',_0xff28('0x5'),_0xff28('0x7')),'defaultValue':_0xff28('0x5')},'leadId':{'type':Sequelize[_0xff28('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xff28('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8f72=['STRING','ENUM','Case','Task','contact_lead','contact','lead','account','nothing','sequelize','exports'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x8f72,0xfb));var _0x28f7=function(_0x415fe0,_0x5730b7){_0x415fe0=_0x415fe0-0x0;var _0x4c0f5d=_0x8f72[_0x415fe0];return _0x4c0f5d;};'use strict';var Sequelize=require(_0x28f7('0x0'));module[_0x28f7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x28f7('0x2')]},'ticketType':{'type':Sequelize[_0x28f7('0x3')]('Task',_0x28f7('0x4')),'defaultValue':_0x28f7('0x5')},'moduleSearch':{'type':Sequelize[_0x28f7('0x3')](_0x28f7('0x6'),_0x28f7('0x7'),_0x28f7('0x8'),'account_contact_lead',_0x28f7('0x9')),'defaultValue':_0x28f7('0x6')},'moduleCreate':{'type':Sequelize[_0x28f7('0x3')](_0x28f7('0xa'),'contact','lead','account'),'defaultValue':_0x28f7('0x8')},'leadId':{'type':Sequelize[_0x28f7('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x28f7('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x28f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 919ac2f..9ae9bcb 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 _0x1529=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','json','apply','reject','update','then','end','sendStatus','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','length','create','body','find','destroy','findOne','order','pick','hasOwnProperty','nolimit','getFields','getSubjects','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis'];(function(_0x8d68ce,_0x135a7f){var _0x2e1f64=function(_0x1e8aed){while(--_0x1e8aed){_0x8d68ce['push'](_0x8d68ce['shift']());}};_0x2e1f64(++_0x135a7f);}(_0x1529,0x1d4));var _0x9152=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0x1529[_0x23d0a1];return _0x1ef866;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9152('0x0'));var zipdir=require(_0x9152('0x1'));var jsonpatch=require(_0x9152('0x2'));var rp=require(_0x9152('0x3'));var moment=require(_0x9152('0x4'));var BPromise=require(_0x9152('0x5'));var Mustache=require(_0x9152('0x6'));var util=require(_0x9152('0x7'));var path=require(_0x9152('0x8'));var sox=require('sox');var csv=require(_0x9152('0x9'));var ejs=require(_0x9152('0xa'));var fs=require('fs');var fs_extra=require(_0x9152('0xb'));var _=require(_0x9152('0xc'));var squel=require(_0x9152('0xd'));var crypto=require(_0x9152('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9152('0xf'));var Papa=require(_0x9152('0x10'));var Redis=require(_0x9152('0x11'));var authService=require(_0x9152('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9152('0x13'));var hardwareService=require(_0x9152('0x14'));var logger=require(_0x9152('0x15'))(_0x9152('0x16'));var utils=require(_0x9152('0x17'));var config=require(_0x9152('0x18'));var licenseUtil=require(_0x9152('0x19'));var db=require(_0x9152('0x1a'))['db'];function respondWithStatusCode(_0x46e14c,_0x1873fc){_0x1873fc=_0x1873fc||0xcc;return function(_0x13f419){if(_0x13f419){return _0x46e14c['sendStatus'](_0x1873fc);}return _0x46e14c['status'](_0x1873fc)['end']();};}function respondWithResult(_0x14a47a,_0x11e2e1){_0x11e2e1=_0x11e2e1||0xc8;return function(_0x16db32){if(_0x16db32){return _0x14a47a[_0x9152('0x1b')](_0x11e2e1)['json'](_0x16db32);}};}function respondWithFilteredResult(_0x2cc3d3,_0xb3d929){return function(_0x5ea1de){if(_0x5ea1de){var _0x1a3b81=typeof _0xb3d929['offset']==='undefined'&&typeof _0xb3d929[_0x9152('0x1c')]===_0x9152('0x1d');var _0x4a5aca=_0x5ea1de[_0x9152('0x1e')];var _0x1515d7=_0x1a3b81?0x0:_0xb3d929[_0x9152('0x1f')];var _0x4ab7d2=_0x1a3b81?_0x5ea1de[_0x9152('0x1e')]:_0xb3d929[_0x9152('0x1f')]+_0xb3d929['limit'];var _0x5c377a;if(_0x4ab7d2>=_0x4a5aca){_0x4ab7d2=_0x4a5aca;_0x5c377a=0xc8;}else{_0x5c377a=0xce;}_0x2cc3d3['status'](_0x5c377a);return _0x2cc3d3[_0x9152('0x20')]('Content-Range',_0x1515d7+'-'+_0x4ab7d2+'/'+_0x4a5aca)[_0x9152('0x21')](_0x5ea1de);}return null;};}function patchUpdates(_0x1f4060){return function(_0x1771dc){try{jsonpatch[_0x9152('0x22')](_0x1771dc,_0x1f4060,!![]);}catch(_0xb39b2f){return BPromise[_0x9152('0x23')](_0xb39b2f);}return _0x1771dc['save']();};}function saveUpdates(_0x5d2faa,_0x2493f2){return function(_0x49116d){if(_0x49116d){return _0x49116d[_0x9152('0x24')](_0x5d2faa)['then'](function(_0x2e04da){return _0x2e04da;});}return null;};}function removeEntity(_0x1c0801,_0x2a9d68){return function(_0x7bc633){if(_0x7bc633){return _0x7bc633['destroy']()[_0x9152('0x25')](function(){_0x1c0801[_0x9152('0x1b')](0xcc)[_0x9152('0x26')]();});}};}function handleEntityNotFound(_0x537737,_0x38b9e1){return function(_0x2df71d){if(!_0x2df71d){_0x537737[_0x9152('0x27')](0x194);}return _0x2df71d;};}function handleError(_0x47ebb7,_0xcda23e){_0xcda23e=_0xcda23e||0x1f4;return function(_0x249875){logger[_0x9152('0x28')](_0x249875[_0x9152('0x29')]);if(_0x249875[_0x9152('0x2a')]){delete _0x249875[_0x9152('0x2a')];}_0x47ebb7[_0x9152('0x1b')](_0xcda23e)[_0x9152('0x2b')](_0x249875);};}exports['index']=function(_0x1cb27c,_0x4f388f){var _0x2df71f={},_0x275322={},_0x516d7d={'count':0x0,'rows':[]};var _0x1b9f3f=_[_0x9152('0x2c')](db[_0x9152('0x2d')][_0x9152('0x2e')],function(_0x5d277e){return{'name':_0x5d277e['fieldName'],'type':_0x5d277e[_0x9152('0x2f')][_0x9152('0x30')]};});_0x275322[_0x9152('0x31')]=_['map'](_0x1b9f3f,_0x9152('0x2a'));_0x275322['query']=_[_0x9152('0x32')](_0x1cb27c[_0x9152('0x33')]);_0x275322[_0x9152('0x34')]=_[_0x9152('0x35')](_0x275322[_0x9152('0x31')],_0x275322['query']);_0x2df71f[_0x9152('0x36')]=_[_0x9152('0x35')](_0x275322[_0x9152('0x31')],qs[_0x9152('0x37')](_0x1cb27c[_0x9152('0x33')][_0x9152('0x37')]));_0x2df71f['attributes']=_0x2df71f[_0x9152('0x36')]['length']?_0x2df71f[_0x9152('0x36')]:_0x275322[_0x9152('0x31')];if(!_0x1cb27c[_0x9152('0x33')]['hasOwnProperty']('nolimit')){_0x2df71f[_0x9152('0x1c')]=qs[_0x9152('0x1c')](_0x1cb27c['query'][_0x9152('0x1c')]);_0x2df71f[_0x9152('0x1f')]=qs[_0x9152('0x1f')](_0x1cb27c['query'][_0x9152('0x1f')]);}_0x2df71f['order']=qs[_0x9152('0x38')](_0x1cb27c[_0x9152('0x33')][_0x9152('0x38')]);_0x2df71f[_0x9152('0x39')]=qs[_0x9152('0x34')](_['pick'](_0x1cb27c[_0x9152('0x33')],_0x275322[_0x9152('0x34')]),_0x1b9f3f);if(_0x1cb27c[_0x9152('0x33')]['filter']){_0x2df71f[_0x9152('0x39')]=_[_0x9152('0x3a')](_0x2df71f[_0x9152('0x39')],{'$or':_['map'](_0x1b9f3f,function(_0x4e8bd1){if(_0x4e8bd1[_0x9152('0x2f')]!=='VIRTUAL'){var _0x479340={};_0x479340[_0x4e8bd1[_0x9152('0x2a')]]={'$like':'%'+_0x1cb27c[_0x9152('0x33')][_0x9152('0x3b')]+'%'};return _0x479340;}})});}_0x2df71f=_[_0x9152('0x3a')]({},_0x2df71f,_0x1cb27c[_0x9152('0x3c')]);var _0x5be50f={'where':_0x2df71f[_0x9152('0x39')]};return db['SalesforceConfiguration'][_0x9152('0x1e')](_0x5be50f)[_0x9152('0x25')](function(_0x24e18b){_0x516d7d[_0x9152('0x1e')]=_0x24e18b;if(_0x1cb27c[_0x9152('0x33')][_0x9152('0x3d')]){_0x2df71f[_0x9152('0x3e')]=[{'all':!![]}];}return db[_0x9152('0x2d')][_0x9152('0x3f')](_0x2df71f);})[_0x9152('0x25')](function(_0x20a728){_0x516d7d['rows']=_0x20a728;return _0x516d7d;})[_0x9152('0x25')](respondWithFilteredResult(_0x4f388f,_0x2df71f))[_0x9152('0x40')](handleError(_0x4f388f,null));};exports[_0x9152('0x41')]=function(_0x168315,_0x24eeb1){var _0x16721b={'raw':![],'where':{'id':_0x168315[_0x9152('0x42')]['id']}},_0x203d8c={};_0x203d8c[_0x9152('0x31')]=_[_0x9152('0x32')](db[_0x9152('0x2d')][_0x9152('0x2e')]);_0x203d8c[_0x9152('0x33')]=_['keys'](_0x168315['query']);_0x203d8c['filters']=_[_0x9152('0x35')](_0x203d8c['model'],_0x203d8c[_0x9152('0x33')]);_0x16721b[_0x9152('0x36')]=_['intersection'](_0x203d8c['model'],qs[_0x9152('0x37')](_0x168315[_0x9152('0x33')]['fields']));_0x16721b[_0x9152('0x36')]=_0x16721b[_0x9152('0x36')][_0x9152('0x43')]?_0x16721b[_0x9152('0x36')]:_0x203d8c[_0x9152('0x31')];if(_0x168315[_0x9152('0x33')][_0x9152('0x3d')]){_0x16721b[_0x9152('0x3e')]=[{'all':!![]}];}_0x16721b=_[_0x9152('0x3a')]({},_0x16721b,_0x168315[_0x9152('0x3c')]);return db[_0x9152('0x2d')]['find'](_0x16721b)['then'](handleEntityNotFound(_0x24eeb1,null))[_0x9152('0x25')](respondWithResult(_0x24eeb1,null))[_0x9152('0x40')](handleError(_0x24eeb1,null));};exports[_0x9152('0x44')]=function(_0x3dca97,_0x2def29){return db[_0x9152('0x2d')]['create'](_0x3dca97[_0x9152('0x45')],{})[_0x9152('0x25')](respondWithResult(_0x2def29,0xc9))['catch'](handleError(_0x2def29,null));};exports['update']=function(_0x646871,_0x4f84be){if(_0x646871[_0x9152('0x45')]['id']){delete _0x646871[_0x9152('0x45')]['id'];}return db[_0x9152('0x2d')][_0x9152('0x46')]({'where':{'id':_0x646871[_0x9152('0x42')]['id']}})[_0x9152('0x25')](handleEntityNotFound(_0x4f84be,null))['then'](saveUpdates(_0x646871[_0x9152('0x45')],null))[_0x9152('0x25')](respondWithResult(_0x4f84be,null))[_0x9152('0x40')](handleError(_0x4f84be,null));};exports[_0x9152('0x47')]=function(_0x3d80bb,_0x2be232){return db[_0x9152('0x2d')][_0x9152('0x46')]({'where':{'id':_0x3d80bb[_0x9152('0x42')]['id']}})[_0x9152('0x25')](handleEntityNotFound(_0x2be232,null))[_0x9152('0x25')](removeEntity(_0x2be232,null))[_0x9152('0x40')](handleError(_0x2be232,null));};exports['getFields']=function(_0x3cee9a,_0x35effa,_0x1050a6){var _0x82e58a={};var _0x50ea29={};var _0x576291;var _0x4f3845;return db[_0x9152('0x2d')][_0x9152('0x48')]({'where':{'id':_0x3cee9a[_0x9152('0x42')]['id']}})[_0x9152('0x25')](handleEntityNotFound(_0x35effa,null))['then'](function(_0x441abf){if(_0x441abf){_0x576291=_0x441abf;_0x50ea29[_0x9152('0x31')]=_[_0x9152('0x32')](db['SalesforceField'][_0x9152('0x2e')]);_0x50ea29[_0x9152('0x33')]=_[_0x9152('0x32')](_0x3cee9a[_0x9152('0x33')]);_0x50ea29[_0x9152('0x34')]=_['intersection'](_0x50ea29[_0x9152('0x31')],_0x50ea29[_0x9152('0x33')]);_0x82e58a[_0x9152('0x36')]=_['intersection'](_0x50ea29[_0x9152('0x31')],qs['fields'](_0x3cee9a['query'][_0x9152('0x37')]));_0x82e58a[_0x9152('0x36')]=_0x82e58a[_0x9152('0x36')]['length']?_0x82e58a['attributes']:_0x50ea29['model'];_0x82e58a[_0x9152('0x49')]=qs['sort'](_0x3cee9a[_0x9152('0x33')][_0x9152('0x38')]);_0x82e58a[_0x9152('0x39')]=qs[_0x9152('0x34')](_[_0x9152('0x4a')](_0x3cee9a['query'],_0x50ea29[_0x9152('0x34')]));if(_0x3cee9a['query'][_0x9152('0x3b')]){_0x82e58a['where']=_[_0x9152('0x3a')](_0x82e58a[_0x9152('0x39')],{'$or':_[_0x9152('0x2c')](_0x82e58a[_0x9152('0x36')],function(_0x23636f){var _0x14d5c6={};_0x14d5c6[_0x23636f]={'$like':'%'+_0x3cee9a['query'][_0x9152('0x3b')]+'%'};return _0x14d5c6;})});}_0x82e58a=_[_0x9152('0x3a')]({},_0x82e58a,_0x3cee9a[_0x9152('0x3c')]);return _0x576291['getFields'](_0x82e58a);}})[_0x9152('0x25')](function(_0x34e9e3){if(_0x34e9e3){_0x4f3845=_0x34e9e3[_0x9152('0x43')];if(!_0x3cee9a[_0x9152('0x33')][_0x9152('0x4b')](_0x9152('0x4c'))){_0x82e58a['limit']=qs['limit'](_0x3cee9a[_0x9152('0x33')][_0x9152('0x1c')]);_0x82e58a['offset']=qs[_0x9152('0x1f')](_0x3cee9a['query']['offset']);}return _0x576291[_0x9152('0x4d')](_0x82e58a);}})[_0x9152('0x25')](function(_0xdf74a0){if(_0xdf74a0){return _0xdf74a0?{'count':_0x4f3845,'rows':_0xdf74a0}:null;}})[_0x9152('0x25')](respondWithResult(_0x35effa,null))[_0x9152('0x40')](handleError(_0x35effa,null));};exports[_0x9152('0x4e')]=function(_0x272af9,_0x157c3b,_0x5a83be){var _0x52bbbd={};var _0x15e684={};var _0x4baa6f;var _0x2d0946;return db[_0x9152('0x2d')]['findOne']({'where':{'id':_0x272af9[_0x9152('0x42')]['id']}})[_0x9152('0x25')](handleEntityNotFound(_0x157c3b,null))[_0x9152('0x25')](function(_0xefbd88){if(_0xefbd88){_0x4baa6f=_0xefbd88;_0x15e684['model']=_['keys'](db[_0x9152('0x4f')][_0x9152('0x2e')]);_0x15e684[_0x9152('0x33')]=_[_0x9152('0x32')](_0x272af9['query']);_0x15e684[_0x9152('0x34')]=_[_0x9152('0x35')](_0x15e684[_0x9152('0x31')],_0x15e684['query']);_0x52bbbd['attributes']=_['intersection'](_0x15e684[_0x9152('0x31')],qs[_0x9152('0x37')](_0x272af9[_0x9152('0x33')][_0x9152('0x37')]));_0x52bbbd[_0x9152('0x36')]=_0x52bbbd[_0x9152('0x36')][_0x9152('0x43')]?_0x52bbbd[_0x9152('0x36')]:_0x15e684[_0x9152('0x31')];_0x52bbbd[_0x9152('0x49')]=qs[_0x9152('0x38')](_0x272af9[_0x9152('0x33')]['sort']);_0x52bbbd[_0x9152('0x39')]=qs[_0x9152('0x34')](_[_0x9152('0x4a')](_0x272af9[_0x9152('0x33')],_0x15e684['filters']));if(_0x272af9[_0x9152('0x33')][_0x9152('0x3b')]){_0x52bbbd['where']=_[_0x9152('0x3a')](_0x52bbbd['where'],{'$or':_[_0x9152('0x2c')](_0x52bbbd['attributes'],function(_0x32622e){var _0x1e529b={};_0x1e529b[_0x32622e]={'$like':'%'+_0x272af9[_0x9152('0x33')][_0x9152('0x3b')]+'%'};return _0x1e529b;})});}_0x52bbbd=_[_0x9152('0x3a')]({},_0x52bbbd,_0x272af9[_0x9152('0x3c')]);return _0x4baa6f[_0x9152('0x4e')](_0x52bbbd);}})[_0x9152('0x25')](function(_0xad149f){if(_0xad149f){_0x2d0946=_0xad149f['length'];if(!_0x272af9[_0x9152('0x33')][_0x9152('0x4b')]('nolimit')){_0x52bbbd[_0x9152('0x1c')]=qs[_0x9152('0x1c')](_0x272af9[_0x9152('0x33')][_0x9152('0x1c')]);_0x52bbbd['offset']=qs[_0x9152('0x1f')](_0x272af9[_0x9152('0x33')][_0x9152('0x1f')]);}return _0x4baa6f[_0x9152('0x4e')](_0x52bbbd);}})[_0x9152('0x25')](function(_0x23d21f){if(_0x23d21f){return _0x23d21f?{'count':_0x2d0946,'rows':_0x23d21f}:null;}})[_0x9152('0x25')](respondWithResult(_0x157c3b,null))[_0x9152('0x40')](handleError(_0x157c3b,null));};exports[_0x9152('0x50')]=function(_0x20cd45,_0x928cbc,_0x266fc7){var _0x538a81={};var _0x11990f={};var _0x3498e5;var _0x55cdb5;return db[_0x9152('0x2d')][_0x9152('0x48')]({'where':{'id':_0x20cd45[_0x9152('0x42')]['id']}})[_0x9152('0x25')](handleEntityNotFound(_0x928cbc,null))['then'](function(_0x29ab93){if(_0x29ab93){_0x3498e5=_0x29ab93;_0x11990f['model']=_[_0x9152('0x32')](db[_0x9152('0x4f')]['rawAttributes']);_0x11990f['query']=_[_0x9152('0x32')](_0x20cd45[_0x9152('0x33')]);_0x11990f[_0x9152('0x34')]=_['intersection'](_0x11990f[_0x9152('0x31')],_0x11990f['query']);_0x538a81['attributes']=_[_0x9152('0x35')](_0x11990f[_0x9152('0x31')],qs['fields'](_0x20cd45[_0x9152('0x33')][_0x9152('0x37')]));_0x538a81[_0x9152('0x36')]=_0x538a81[_0x9152('0x36')][_0x9152('0x43')]?_0x538a81[_0x9152('0x36')]:_0x11990f[_0x9152('0x31')];_0x538a81[_0x9152('0x49')]=qs[_0x9152('0x38')](_0x20cd45[_0x9152('0x33')][_0x9152('0x38')]);_0x538a81[_0x9152('0x39')]=qs[_0x9152('0x34')](_[_0x9152('0x4a')](_0x20cd45['query'],_0x11990f['filters']));if(_0x20cd45[_0x9152('0x33')]['filter']){_0x538a81[_0x9152('0x39')]=_[_0x9152('0x3a')](_0x538a81[_0x9152('0x39')],{'$or':_[_0x9152('0x2c')](_0x538a81[_0x9152('0x36')],function(_0xd346e9){var _0x5a82b9={};_0x5a82b9[_0xd346e9]={'$like':'%'+_0x20cd45[_0x9152('0x33')][_0x9152('0x3b')]+'%'};return _0x5a82b9;})});}_0x538a81=_['merge']({},_0x538a81,_0x20cd45[_0x9152('0x3c')]);return _0x3498e5[_0x9152('0x50')](_0x538a81);}})[_0x9152('0x25')](function(_0x13ba39){if(_0x13ba39){_0x55cdb5=_0x13ba39[_0x9152('0x43')];if(!_0x20cd45[_0x9152('0x33')][_0x9152('0x4b')](_0x9152('0x4c'))){_0x538a81['limit']=qs[_0x9152('0x1c')](_0x20cd45[_0x9152('0x33')][_0x9152('0x1c')]);_0x538a81[_0x9152('0x1f')]=qs[_0x9152('0x1f')](_0x20cd45[_0x9152('0x33')]['offset']);}return _0x3498e5[_0x9152('0x50')](_0x538a81);}})[_0x9152('0x25')](function(_0x1de62b){if(_0x1de62b){return _0x1de62b?{'count':_0x55cdb5,'rows':_0x1de62b}:null;}})[_0x9152('0x25')](respondWithResult(_0x928cbc,null))['catch'](handleError(_0x928cbc,null));}; \ No newline at end of file +var _0xc474=['params','find','catch','body','destroy','findOne','map','getFields','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc474,0xfc));var _0x4c47=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xc474[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x4c47('0x0'));var rimraf=require(_0x4c47('0x1'));var zipdir=require(_0x4c47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c47('0x3'));var moment=require(_0x4c47('0x4'));var BPromise=require(_0x4c47('0x5'));var Mustache=require(_0x4c47('0x6'));var util=require(_0x4c47('0x7'));var path=require(_0x4c47('0x8'));var sox=require(_0x4c47('0x9'));var csv=require(_0x4c47('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c47('0xb'));var squel=require(_0x4c47('0xc'));var crypto=require(_0x4c47('0xd'));var jsforce=require(_0x4c47('0xe'));var deskjs=require(_0x4c47('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4c47('0x10'));var Papa=require(_0x4c47('0x11'));var Redis=require('ioredis');var authService=require(_0x4c47('0x12'));var qs=require(_0x4c47('0x13'));var as=require(_0x4c47('0x14'));var hardwareService=require(_0x4c47('0x15'));var logger=require('../../config/logger')(_0x4c47('0x16'));var utils=require('../../config/utils');var config=require(_0x4c47('0x17'));var licenseUtil=require(_0x4c47('0x18'));var db=require(_0x4c47('0x19'))['db'];function respondWithStatusCode(_0x496e7b,_0x429553){_0x429553=_0x429553||0xcc;return function(_0x16a4fd){if(_0x16a4fd){return _0x496e7b['sendStatus'](_0x429553);}return _0x496e7b[_0x4c47('0x1a')](_0x429553)['end']();};}function respondWithResult(_0x3d1b6a,_0x121f9e){_0x121f9e=_0x121f9e||0xc8;return function(_0x25d4dc){if(_0x25d4dc){return _0x3d1b6a[_0x4c47('0x1a')](_0x121f9e)['json'](_0x25d4dc);}};}function respondWithFilteredResult(_0xb53c24,_0x78f26b){return function(_0x16c7a9){if(_0x16c7a9){var _0xd162cc=typeof _0x78f26b['offset']==='undefined'&&typeof _0x78f26b['limit']===_0x4c47('0x1b');var _0x92a444=_0x16c7a9[_0x4c47('0x1c')];var _0x5727cf=_0xd162cc?0x0:_0x78f26b[_0x4c47('0x1d')];var _0x254dfc=_0xd162cc?_0x16c7a9[_0x4c47('0x1c')]:_0x78f26b[_0x4c47('0x1d')]+_0x78f26b['limit'];var _0x4cc984;if(_0x254dfc>=_0x92a444){_0x254dfc=_0x92a444;_0x4cc984=0xc8;}else{_0x4cc984=0xce;}_0xb53c24['status'](_0x4cc984);return _0xb53c24[_0x4c47('0x1e')](_0x4c47('0x1f'),_0x5727cf+'-'+_0x254dfc+'/'+_0x92a444)[_0x4c47('0x20')](_0x16c7a9);}return null;};}function patchUpdates(_0x3b156f){return function(_0x52de60){try{jsonpatch[_0x4c47('0x21')](_0x52de60,_0x3b156f,!![]);}catch(_0x27b61a){return BPromise[_0x4c47('0x22')](_0x27b61a);}return _0x52de60[_0x4c47('0x23')]();};}function saveUpdates(_0x20950c,_0x40a984){return function(_0x4d56eb){if(_0x4d56eb){return _0x4d56eb['update'](_0x20950c)['then'](function(_0x1a575a){return _0x1a575a;});}return null;};}function removeEntity(_0x275a10,_0x4d110d){return function(_0x3037a2){if(_0x3037a2){return _0x3037a2['destroy']()[_0x4c47('0x24')](function(){_0x275a10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592469,_0x3bacc9){return function(_0x3bd199){if(!_0x3bd199){_0x592469[_0x4c47('0x25')](0x194);}return _0x3bd199;};}function handleError(_0x4eff26,_0x33f440){_0x33f440=_0x33f440||0x1f4;return function(_0x2c0367){logger[_0x4c47('0x26')](_0x2c0367[_0x4c47('0x27')]);if(_0x2c0367[_0x4c47('0x28')]){delete _0x2c0367[_0x4c47('0x28')];}_0x4eff26[_0x4c47('0x1a')](_0x33f440)[_0x4c47('0x29')](_0x2c0367);};}exports['index']=function(_0x36e82b,_0x344a7d){var _0x590b56={},_0x491638={},_0x3b977d={'count':0x0,'rows':[]};var _0x56c130=_['map'](db[_0x4c47('0x2a')][_0x4c47('0x2b')],function(_0x12462a){return{'name':_0x12462a[_0x4c47('0x2c')],'type':_0x12462a[_0x4c47('0x2d')]['key']};});_0x491638[_0x4c47('0x2e')]=_['map'](_0x56c130,_0x4c47('0x28'));_0x491638[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x36e82b['query']);_0x491638['filters']=_['intersection'](_0x491638['model'],_0x491638[_0x4c47('0x2f')]);_0x590b56[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x491638['model'],qs[_0x4c47('0x33')](_0x36e82b['query'][_0x4c47('0x33')]));_0x590b56[_0x4c47('0x31')]=_0x590b56[_0x4c47('0x31')][_0x4c47('0x34')]?_0x590b56[_0x4c47('0x31')]:_0x491638[_0x4c47('0x2e')];if(!_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x35')]('nolimit')){_0x590b56[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x36')]);_0x590b56['offset']=qs['offset'](_0x36e82b['query'][_0x4c47('0x1d')]);}_0x590b56[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x36e82b['query']['sort']);_0x590b56['where']=qs['filters'](_[_0x4c47('0x39')](_0x36e82b[_0x4c47('0x2f')],_0x491638[_0x4c47('0x3a')]),_0x56c130);if(_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x3b')]){_0x590b56['where']=_[_0x4c47('0x3c')](_0x590b56[_0x4c47('0x3d')],{'$or':_['map'](_0x56c130,function(_0x1c309b){if(_0x1c309b[_0x4c47('0x2d')]!==_0x4c47('0x3e')){var _0x418098={};_0x418098[_0x1c309b[_0x4c47('0x28')]]={'$like':'%'+_0x36e82b['query'][_0x4c47('0x3b')]+'%'};return _0x418098;}})});}_0x590b56=_[_0x4c47('0x3c')]({},_0x590b56,_0x36e82b[_0x4c47('0x3f')]);var _0x291666={'where':_0x590b56[_0x4c47('0x3d')]};return db['SalesforceConfiguration'][_0x4c47('0x1c')](_0x291666)[_0x4c47('0x24')](function(_0x5a7135){_0x3b977d[_0x4c47('0x1c')]=_0x5a7135;if(_0x36e82b['query'][_0x4c47('0x40')]){_0x590b56[_0x4c47('0x41')]=[{'all':!![]}];}return db[_0x4c47('0x2a')]['findAll'](_0x590b56);})['then'](function(_0x164105){_0x3b977d[_0x4c47('0x42')]=_0x164105;return _0x3b977d;})[_0x4c47('0x24')](respondWithFilteredResult(_0x344a7d,_0x590b56))['catch'](handleError(_0x344a7d,null));};exports[_0x4c47('0x43')]=function(_0x10669d,_0x40057e){var _0x5a0b1f={'raw':![],'where':{'id':_0x10669d[_0x4c47('0x44')]['id']}},_0x274596={};_0x274596[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db[_0x4c47('0x2a')][_0x4c47('0x2b')]);_0x274596[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x10669d[_0x4c47('0x2f')]);_0x274596[_0x4c47('0x3a')]=_['intersection'](_0x274596[_0x4c47('0x2e')],_0x274596[_0x4c47('0x2f')]);_0x5a0b1f['attributes']=_['intersection'](_0x274596[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x10669d['query'][_0x4c47('0x33')]));_0x5a0b1f[_0x4c47('0x31')]=_0x5a0b1f[_0x4c47('0x31')][_0x4c47('0x34')]?_0x5a0b1f[_0x4c47('0x31')]:_0x274596['model'];if(_0x10669d['query'][_0x4c47('0x40')]){_0x5a0b1f[_0x4c47('0x41')]=[{'all':!![]}];}_0x5a0b1f=_[_0x4c47('0x3c')]({},_0x5a0b1f,_0x10669d[_0x4c47('0x3f')]);return db[_0x4c47('0x2a')][_0x4c47('0x45')](_0x5a0b1f)[_0x4c47('0x24')](handleEntityNotFound(_0x40057e,null))['then'](respondWithResult(_0x40057e,null))[_0x4c47('0x46')](handleError(_0x40057e,null));};exports['create']=function(_0x40bbec,_0x460fef){return db[_0x4c47('0x2a')]['create'](_0x40bbec[_0x4c47('0x47')],{})[_0x4c47('0x24')](respondWithResult(_0x460fef,0xc9))[_0x4c47('0x46')](handleError(_0x460fef,null));};exports['update']=function(_0x125b18,_0x4ccb67){if(_0x125b18[_0x4c47('0x47')]['id']){delete _0x125b18['body']['id'];}return db[_0x4c47('0x2a')]['find']({'where':{'id':_0x125b18[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x4ccb67,null))[_0x4c47('0x24')](saveUpdates(_0x125b18[_0x4c47('0x47')],null))['then'](respondWithResult(_0x4ccb67,null))['catch'](handleError(_0x4ccb67,null));};exports[_0x4c47('0x48')]=function(_0x48ba62,_0x419ee3){return db[_0x4c47('0x2a')][_0x4c47('0x45')]({'where':{'id':_0x48ba62['params']['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x419ee3,null))[_0x4c47('0x24')](removeEntity(_0x419ee3,null))['catch'](handleError(_0x419ee3,null));};exports['getFields']=function(_0x59d746,_0x479332,_0x23aff5){var _0x3f403b={};var _0x4048e7={};var _0x386af4;var _0x5d2618;return db[_0x4c47('0x2a')][_0x4c47('0x49')]({'where':{'id':_0x59d746[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x479332,null))[_0x4c47('0x24')](function(_0x345289){if(_0x345289){_0x386af4=_0x345289;_0x4048e7[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db['SalesforceField'][_0x4c47('0x2b')]);_0x4048e7[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x59d746['query']);_0x4048e7['filters']=_['intersection'](_0x4048e7[_0x4c47('0x2e')],_0x4048e7[_0x4c47('0x2f')]);_0x3f403b[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x4048e7[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x59d746[_0x4c47('0x2f')][_0x4c47('0x33')]));_0x3f403b[_0x4c47('0x31')]=_0x3f403b[_0x4c47('0x31')]['length']?_0x3f403b['attributes']:_0x4048e7[_0x4c47('0x2e')];_0x3f403b[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x59d746[_0x4c47('0x2f')][_0x4c47('0x38')]);_0x3f403b[_0x4c47('0x3d')]=qs['filters'](_[_0x4c47('0x39')](_0x59d746['query'],_0x4048e7['filters']));if(_0x59d746['query'][_0x4c47('0x3b')]){_0x3f403b[_0x4c47('0x3d')]=_[_0x4c47('0x3c')](_0x3f403b[_0x4c47('0x3d')],{'$or':_[_0x4c47('0x4a')](_0x3f403b[_0x4c47('0x31')],function(_0x36f2d8){var _0x4790f9={};_0x4790f9[_0x36f2d8]={'$like':'%'+_0x59d746['query'][_0x4c47('0x3b')]+'%'};return _0x4790f9;})});}_0x3f403b=_['merge']({},_0x3f403b,_0x59d746[_0x4c47('0x3f')]);return _0x386af4[_0x4c47('0x4b')](_0x3f403b);}})[_0x4c47('0x24')](function(_0x4b3009){if(_0x4b3009){_0x5d2618=_0x4b3009[_0x4c47('0x34')];if(!_0x59d746[_0x4c47('0x2f')][_0x4c47('0x35')](_0x4c47('0x4c'))){_0x3f403b[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x59d746[_0x4c47('0x2f')]['limit']);_0x3f403b[_0x4c47('0x1d')]=qs[_0x4c47('0x1d')](_0x59d746[_0x4c47('0x2f')][_0x4c47('0x1d')]);}return _0x386af4[_0x4c47('0x4b')](_0x3f403b);}})[_0x4c47('0x24')](function(_0x38339f){if(_0x38339f){return _0x38339f?{'count':_0x5d2618,'rows':_0x38339f}:null;}})[_0x4c47('0x24')](respondWithResult(_0x479332,null))[_0x4c47('0x46')](handleError(_0x479332,null));};exports[_0x4c47('0x4d')]=function(_0x19e8fd,_0x21808c,_0x4d6b7f){var _0xc436f7={};var _0x46bf82={};var _0x15a4b8;var _0x20316a;return db['SalesforceConfiguration'][_0x4c47('0x49')]({'where':{'id':_0x19e8fd[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x21808c,null))['then'](function(_0x27bb34){if(_0x27bb34){_0x15a4b8=_0x27bb34;_0x46bf82[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db[_0x4c47('0x4e')][_0x4c47('0x2b')]);_0x46bf82[_0x4c47('0x2f')]=_['keys'](_0x19e8fd[_0x4c47('0x2f')]);_0x46bf82['filters']=_[_0x4c47('0x32')](_0x46bf82['model'],_0x46bf82['query']);_0xc436f7['attributes']=_[_0x4c47('0x32')](_0x46bf82[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x19e8fd['query'][_0x4c47('0x33')]));_0xc436f7[_0x4c47('0x31')]=_0xc436f7['attributes'][_0x4c47('0x34')]?_0xc436f7[_0x4c47('0x31')]:_0x46bf82[_0x4c47('0x2e')];_0xc436f7[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x19e8fd[_0x4c47('0x2f')]['sort']);_0xc436f7[_0x4c47('0x3d')]=qs[_0x4c47('0x3a')](_[_0x4c47('0x39')](_0x19e8fd[_0x4c47('0x2f')],_0x46bf82[_0x4c47('0x3a')]));if(_0x19e8fd[_0x4c47('0x2f')][_0x4c47('0x3b')]){_0xc436f7[_0x4c47('0x3d')]=_['merge'](_0xc436f7[_0x4c47('0x3d')],{'$or':_[_0x4c47('0x4a')](_0xc436f7[_0x4c47('0x31')],function(_0x21df76){var _0x1dde40={};_0x1dde40[_0x21df76]={'$like':'%'+_0x19e8fd[_0x4c47('0x2f')]['filter']+'%'};return _0x1dde40;})});}_0xc436f7=_[_0x4c47('0x3c')]({},_0xc436f7,_0x19e8fd[_0x4c47('0x3f')]);return _0x15a4b8[_0x4c47('0x4d')](_0xc436f7);}})[_0x4c47('0x24')](function(_0x56eade){if(_0x56eade){_0x20316a=_0x56eade[_0x4c47('0x34')];if(!_0x19e8fd[_0x4c47('0x2f')]['hasOwnProperty'](_0x4c47('0x4c'))){_0xc436f7[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x19e8fd[_0x4c47('0x2f')][_0x4c47('0x36')]);_0xc436f7[_0x4c47('0x1d')]=qs[_0x4c47('0x1d')](_0x19e8fd[_0x4c47('0x2f')][_0x4c47('0x1d')]);}return _0x15a4b8[_0x4c47('0x4d')](_0xc436f7);}})[_0x4c47('0x24')](function(_0x2ee540){if(_0x2ee540){return _0x2ee540?{'count':_0x20316a,'rows':_0x2ee540}:null;}})[_0x4c47('0x24')](respondWithResult(_0x21808c,null))['catch'](handleError(_0x21808c,null));};exports[_0x4c47('0x4f')]=function(_0x3f5b10,_0x39f7c9,_0x589eac){var _0x3f34f7={};var _0x59935b={};var _0x3461f4;var _0x4d3bf7;return db[_0x4c47('0x2a')]['findOne']({'where':{'id':_0x3f5b10[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x39f7c9,null))[_0x4c47('0x24')](function(_0xf33d8b){if(_0xf33d8b){_0x3461f4=_0xf33d8b;_0x59935b[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db[_0x4c47('0x4e')][_0x4c47('0x2b')]);_0x59935b['query']=_[_0x4c47('0x30')](_0x3f5b10[_0x4c47('0x2f')]);_0x59935b[_0x4c47('0x3a')]=_[_0x4c47('0x32')](_0x59935b['model'],_0x59935b[_0x4c47('0x2f')]);_0x3f34f7[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x59935b[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x3f5b10[_0x4c47('0x2f')][_0x4c47('0x33')]));_0x3f34f7[_0x4c47('0x31')]=_0x3f34f7[_0x4c47('0x31')][_0x4c47('0x34')]?_0x3f34f7['attributes']:_0x59935b[_0x4c47('0x2e')];_0x3f34f7[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x3f5b10[_0x4c47('0x2f')]['sort']);_0x3f34f7[_0x4c47('0x3d')]=qs[_0x4c47('0x3a')](_[_0x4c47('0x39')](_0x3f5b10[_0x4c47('0x2f')],_0x59935b[_0x4c47('0x3a')]));if(_0x3f5b10[_0x4c47('0x2f')]['filter']){_0x3f34f7[_0x4c47('0x3d')]=_[_0x4c47('0x3c')](_0x3f34f7[_0x4c47('0x3d')],{'$or':_[_0x4c47('0x4a')](_0x3f34f7['attributes'],function(_0x2481d6){var _0x7b1d3c={};_0x7b1d3c[_0x2481d6]={'$like':'%'+_0x3f5b10[_0x4c47('0x2f')][_0x4c47('0x3b')]+'%'};return _0x7b1d3c;})});}_0x3f34f7=_['merge']({},_0x3f34f7,_0x3f5b10[_0x4c47('0x3f')]);return _0x3461f4[_0x4c47('0x4f')](_0x3f34f7);}})[_0x4c47('0x24')](function(_0x173088){if(_0x173088){_0x4d3bf7=_0x173088[_0x4c47('0x34')];if(!_0x3f5b10[_0x4c47('0x2f')]['hasOwnProperty']('nolimit')){_0x3f34f7[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x3f5b10[_0x4c47('0x2f')][_0x4c47('0x36')]);_0x3f34f7[_0x4c47('0x1d')]=qs[_0x4c47('0x1d')](_0x3f5b10[_0x4c47('0x2f')][_0x4c47('0x1d')]);}return _0x3461f4[_0x4c47('0x4f')](_0x3f34f7);}})[_0x4c47('0x24')](function(_0x28fed5){if(_0x28fed5){return _0x28fed5?{'count':_0x4d3bf7,'rows':_0x28fed5}:null;}})[_0x4c47('0x24')](respondWithResult(_0x39f7c9,null))[_0x4c47('0x46')](handleError(_0x39f7c9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 83970c3..9fa2f51 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 _0xc813=['util','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc813,0xfb));var _0x3c81=function(_0xf9cdbe,_0x1a692c){_0xf9cdbe=_0xf9cdbe-0x0;var _0x47b102=_0xc813[_0xf9cdbe];return _0x47b102;};'use strict';var _=require(_0x3c81('0x0'));var util=require(_0x3c81('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3c81('0x2'));var BPromise=require('bluebird');var rp=require(_0x3c81('0x3'));var fs=require('fs');var path=require(_0x3c81('0x4'));var rimraf=require(_0x3c81('0x5'));var config=require(_0x3c81('0x6'));var attributes=require(_0x3c81('0x7'));module[_0x3c81('0x8')]=function(_0x44fa92,_0xdeaa94){return _0x44fa92[_0x3c81('0x9')](_0x3c81('0xa'),attributes,{'tableName':_0x3c81('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb018=['moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0xb018,0x1dd));var _0x8b01=function(_0x8c515f,_0x51b744){_0x8c515f=_0x8c515f-0x0;var _0x1c8b2f=_0xb018[_0x8c515f];return _0x1c8b2f;};'use strict';var _=require(_0x8b01('0x0'));var util=require('util');var logger=require(_0x8b01('0x1'))(_0x8b01('0x2'));var moment=require(_0x8b01('0x3'));var BPromise=require(_0x8b01('0x4'));var rp=require(_0x8b01('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b01('0x6'));var attributes=require(_0x8b01('0x7'));module[_0x8b01('0x8')]=function(_0x58328e,_0x18c7ca){return _0x58328e[_0x8b01('0x9')](_0x8b01('0xa'),attributes,{'tableName':_0x8b01('0xb'),'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 af9c40c..abb563d 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 _0x5c0e=['error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x5623a3,_0x2b9845){var _0x4e00e1=function(_0x3c75eb){while(--_0x3c75eb){_0x5623a3['push'](_0x5623a3['shift']());}};_0x4e00e1(++_0x2b9845);}(_0x5c0e,0x180));var _0xe5c0=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x5c0e[_0x9c3c56];return _0x2dd782;};'use strict';var _=require('lodash');var util=require(_0xe5c0('0x0'));var moment=require('moment');var BPromise=require(_0xe5c0('0x1'));var rs=require(_0xe5c0('0x2'));var fs=require('fs');var Redis=require(_0xe5c0('0x3'));var db=require(_0xe5c0('0x4'))['db'];var utils=require(_0xe5c0('0x5'));var logger=require(_0xe5c0('0x6'))(_0xe5c0('0x7'));var config=require(_0xe5c0('0x8'));var jayson=require(_0xe5c0('0x9'));var client=jayson['client'][_0xe5c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15513e,_0x353c46,_0x2b35f2){return new BPromise(function(_0x431ab8,_0x36d21e){return client[_0xe5c0('0xb')](_0x15513e,_0x2b35f2)[_0xe5c0('0xc')](function(_0x289f9b){logger[_0xe5c0('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353c46,_0xe5c0('0xe'));logger[_0xe5c0('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x353c46,_0xe5c0('0xe'),JSON['stringify'](_0x289f9b));if(_0x289f9b['error']){if(_0x289f9b[_0xe5c0('0x10')]['code']===0x1f4){logger[_0xe5c0('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353c46,_0x289f9b[_0xe5c0('0x10')][_0xe5c0('0x11')]);return _0x36d21e(_0x289f9b[_0xe5c0('0x10')][_0xe5c0('0x11')]);}logger[_0xe5c0('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353c46,_0x289f9b[_0xe5c0('0x10')]['message']);return _0x431ab8(_0x289f9b['error'][_0xe5c0('0x11')]);}else{logger[_0xe5c0('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353c46,_0xe5c0('0xe'));_0x431ab8(_0x289f9b[_0xe5c0('0x12')][_0xe5c0('0x11')]);}})[_0xe5c0('0x13')](function(_0x28a8bf){logger[_0xe5c0('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353c46,_0x28a8bf);_0x36d21e(_0x28a8bf);});});} \ No newline at end of file +var _0xbfd0=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3c0689,_0x59a1a3){var _0x441a65=function(_0x5d0245){while(--_0x5d0245){_0x3c0689['push'](_0x3c0689['shift']());}};_0x441a65(++_0x59a1a3);}(_0xbfd0,0x1ef));var _0x0bfd=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xbfd0[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x0bfd('0x0'));var util=require(_0x0bfd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0bfd('0x2'));var fs=require('fs');var Redis=require(_0x0bfd('0x3'));var db=require(_0x0bfd('0x4'))['db'];var utils=require(_0x0bfd('0x5'));var logger=require('../../config/logger')(_0x0bfd('0x6'));var config=require(_0x0bfd('0x7'));var jayson=require(_0x0bfd('0x8'));var client=jayson[_0x0bfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ac4c,_0x1a0d6b,_0x267a94){return new BPromise(function(_0x2fd08d,_0x1e8cf3){return client[_0x0bfd('0xa')](_0x29ac4c,_0x267a94)[_0x0bfd('0xb')](function(_0x275004){logger[_0x0bfd('0xc')](_0x0bfd('0xd'),_0x1a0d6b,_0x0bfd('0xe'));logger[_0x0bfd('0xf')](_0x0bfd('0x10'),_0x1a0d6b,_0x0bfd('0xe'),JSON[_0x0bfd('0x11')](_0x275004));if(_0x275004[_0x0bfd('0x12')]){if(_0x275004['error'][_0x0bfd('0x13')]===0x1f4){logger['error'](_0x0bfd('0xd'),_0x1a0d6b,_0x275004[_0x0bfd('0x12')]['message']);return _0x1e8cf3(_0x275004[_0x0bfd('0x12')][_0x0bfd('0x14')]);}logger[_0x0bfd('0x12')](_0x0bfd('0xd'),_0x1a0d6b,_0x275004[_0x0bfd('0x12')][_0x0bfd('0x14')]);return _0x2fd08d(_0x275004[_0x0bfd('0x12')][_0x0bfd('0x14')]);}else{logger[_0x0bfd('0xc')](_0x0bfd('0xd'),_0x1a0d6b,'request\x20sent');_0x2fd08d(_0x275004[_0x0bfd('0x15')]['message']);}})['catch'](function(_0x1ebb81){logger['error'](_0x0bfd('0xd'),_0x1a0d6b,_0x1ebb81);_0x1e8cf3(_0x1ebb81);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 0e260c8..24adca3 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 _0xc420=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller'];(function(_0x5d205f,_0x1bfd90){var _0x2c61ce=function(_0x5b7748){while(--_0x5b7748){_0x5d205f['push'](_0x5d205f['shift']());}};_0x2c61ce(++_0x1bfd90);}(_0xc420,0x1aa));var _0x0c42=function(_0x533d01,_0xbf9b37){_0x533d01=_0x533d01-0x0;var _0x9e22b9=_0xc420[_0x533d01];return _0x9e22b9;};'use strict';var multer=require('multer');var util=require(_0x0c42('0x0'));var path=require(_0x0c42('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c42('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0c42('0x3'));var interaction=require(_0x0c42('0x4'));var config=require('../../config/environment');var controller=require(_0x0c42('0x5'));router[_0x0c42('0x6')]('/',auth[_0x0c42('0x7')](),controller[_0x0c42('0x8')]);router[_0x0c42('0x6')](_0x0c42('0x9'),auth[_0x0c42('0x7')](),controller[_0x0c42('0xa')]);router[_0x0c42('0xb')]('/',auth[_0x0c42('0x7')](),controller[_0x0c42('0xc')]);router[_0x0c42('0xd')](_0x0c42('0x9'),auth[_0x0c42('0x7')](),controller[_0x0c42('0xe')]);router['delete'](_0x0c42('0x9'),auth[_0x0c42('0x7')](),controller[_0x0c42('0xf')]);module['exports']=router; \ No newline at end of file +var _0xfada=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4f9f78,_0x14c6a3){var _0x328fb7=function(_0xa4ec1d){while(--_0xa4ec1d){_0x4f9f78['push'](_0x4f9f78['shift']());}};_0x328fb7(++_0x14c6a3);}(_0xfada,0x119));var _0xafad=function(_0x4fadfa,_0x15796d){_0x4fadfa=_0x4fadfa-0x0;var _0x2dc4f7=_0xfada[_0x4fadfa];return _0x2dc4f7;};'use strict';var multer=require(_0xafad('0x0'));var util=require(_0xafad('0x1'));var path=require(_0xafad('0x2'));var timeout=require('connect-timeout');var express=require(_0xafad('0x3'));var router=express[_0xafad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xafad('0x5'));var interaction=require(_0xafad('0x6'));var config=require(_0xafad('0x7'));var controller=require(_0xafad('0x8'));router[_0xafad('0x9')]('/',auth[_0xafad('0xa')](),controller['index']);router[_0xafad('0x9')]('/:id',auth[_0xafad('0xa')](),controller[_0xafad('0xb')]);router['post']('/',auth[_0xafad('0xa')](),controller['create']);router[_0xafad('0xc')]('/:id',auth[_0xafad('0xa')](),controller[_0xafad('0xd')]);router[_0xafad('0xe')](_0xafad('0xf'),auth[_0xafad('0xa')](),controller[_0xafad('0x10')]);module[_0xafad('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index a68343c..c638b51 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 _0xa579=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa579,0xc2));var _0x9a57=function(_0x3a99a5,_0x58a0f5){_0x3a99a5=_0x3a99a5-0x0;var _0xafea3a=_0xa579[_0x3a99a5];return _0xafea3a;};'use strict';var Sequelize=require(_0x9a57('0x0'));module[_0x9a57('0x1')]={'type':{'type':Sequelize[_0x9a57('0x2')](_0x9a57('0x3'),_0x9a57('0x4'),_0x9a57('0x5'),'keyValue',_0x9a57('0x6')),'defaultValue':_0x9a57('0x3')},'content':{'type':Sequelize[_0x9a57('0x7')]},'key':{'type':Sequelize[_0x9a57('0x7')]},'keyType':{'type':Sequelize[_0x9a57('0x2')]('string',_0x9a57('0x4'),_0x9a57('0x5'))},'keyContent':{'type':Sequelize[_0x9a57('0x7')]},'idField':{'type':Sequelize[_0x9a57('0x7')]},'variableName':{'type':Sequelize[_0x9a57('0x7')]}}; \ No newline at end of file +var _0xb041=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0xbf2c8f,_0x5623ae){var _0x47a45a=function(_0x231b63){while(--_0x231b63){_0xbf2c8f['push'](_0xbf2c8f['shift']());}};_0x47a45a(++_0x5623ae);}(_0xb041,0x1e5));var _0x1b04=function(_0x401bdc,_0x34b20e){_0x401bdc=_0x401bdc-0x0;var _0x31c9c5=_0xb041[_0x401bdc];return _0x31c9c5;};'use strict';var Sequelize=require(_0x1b04('0x0'));module[_0x1b04('0x1')]={'type':{'type':Sequelize[_0x1b04('0x2')](_0x1b04('0x3'),_0x1b04('0x4'),_0x1b04('0x5'),'keyValue',_0x1b04('0x6')),'defaultValue':_0x1b04('0x3')},'content':{'type':Sequelize[_0x1b04('0x7')]},'key':{'type':Sequelize[_0x1b04('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x1b04('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1b04('0x7')]},'variableName':{'type':Sequelize[_0x1b04('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6f63405..183868a 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 _0x23f9=['apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','show','params','include','catch','create','body','find','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','../../config/license/util','status','json','offset','undefined','limit','count','set'];(function(_0x2fd844,_0x4520c2){var _0x423dc7=function(_0x351d5e){while(--_0x351d5e){_0x2fd844['push'](_0x2fd844['shift']());}};_0x423dc7(++_0x4520c2);}(_0x23f9,0x1b2));var _0x923f=function(_0x1bf88b,_0x3237dd){_0x1bf88b=_0x1bf88b-0x0;var _0x4cb9b6=_0x23f9[_0x1bf88b];return _0x4cb9b6;};'use strict';var emlformat=require(_0x923f('0x0'));var rimraf=require(_0x923f('0x1'));var zipdir=require(_0x923f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x923f('0x3'));var Mustache=require(_0x923f('0x4'));var util=require(_0x923f('0x5'));var path=require('path');var sox=require(_0x923f('0x6'));var csv=require(_0x923f('0x7'));var ejs=require(_0x923f('0x8'));var fs=require('fs');var fs_extra=require(_0x923f('0x9'));var _=require(_0x923f('0xa'));var squel=require(_0x923f('0xb'));var crypto=require(_0x923f('0xc'));var jsforce=require(_0x923f('0xd'));var deskjs=require(_0x923f('0xe'));var toCsv=require(_0x923f('0x7'));var querystring=require(_0x923f('0xf'));var Papa=require(_0x923f('0x10'));var Redis=require(_0x923f('0x11'));var authService=require(_0x923f('0x12'));var qs=require(_0x923f('0x13'));var as=require(_0x923f('0x14'));var hardwareService=require(_0x923f('0x15'));var logger=require(_0x923f('0x16'))(_0x923f('0x17'));var utils=require(_0x923f('0x18'));var config=require(_0x923f('0x19'));var licenseUtil=require(_0x923f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58c443,_0x5926e4){_0x5926e4=_0x5926e4||0xcc;return function(_0x316853){if(_0x316853){return _0x58c443['sendStatus'](_0x5926e4);}return _0x58c443[_0x923f('0x1b')](_0x5926e4)['end']();};}function respondWithResult(_0x42c6f4,_0x16e7b0){_0x16e7b0=_0x16e7b0||0xc8;return function(_0x1cc540){if(_0x1cc540){return _0x42c6f4[_0x923f('0x1b')](_0x16e7b0)[_0x923f('0x1c')](_0x1cc540);}};}function respondWithFilteredResult(_0x19459e,_0x1ed25e){return function(_0x3aa51b){if(_0x3aa51b){var _0x32daec=typeof _0x1ed25e[_0x923f('0x1d')]===_0x923f('0x1e')&&typeof _0x1ed25e[_0x923f('0x1f')]===_0x923f('0x1e');var _0x3a9eb9=_0x3aa51b[_0x923f('0x20')];var _0x3ddea0=_0x32daec?0x0:_0x1ed25e[_0x923f('0x1d')];var _0x3af8ec=_0x32daec?_0x3aa51b[_0x923f('0x20')]:_0x1ed25e[_0x923f('0x1d')]+_0x1ed25e[_0x923f('0x1f')];var _0x412dda;if(_0x3af8ec>=_0x3a9eb9){_0x3af8ec=_0x3a9eb9;_0x412dda=0xc8;}else{_0x412dda=0xce;}_0x19459e['status'](_0x412dda);return _0x19459e[_0x923f('0x21')]('Content-Range',_0x3ddea0+'-'+_0x3af8ec+'/'+_0x3a9eb9)[_0x923f('0x1c')](_0x3aa51b);}return null;};}function patchUpdates(_0x45895a){return function(_0x4b7aed){try{jsonpatch[_0x923f('0x22')](_0x4b7aed,_0x45895a,!![]);}catch(_0x323e95){return BPromise[_0x923f('0x23')](_0x323e95);}return _0x4b7aed[_0x923f('0x24')]();};}function saveUpdates(_0x463629,_0x388924){return function(_0x300240){if(_0x300240){return _0x300240[_0x923f('0x25')](_0x463629)['then'](function(_0x58703a){return _0x58703a;});}return null;};}function removeEntity(_0x51e7b3,_0x33b6ad){return function(_0x68776e){if(_0x68776e){return _0x68776e[_0x923f('0x26')]()['then'](function(){_0x51e7b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2430ba,_0x31ea31){return function(_0x1eb007){if(!_0x1eb007){_0x2430ba[_0x923f('0x27')](0x194);}return _0x1eb007;};}function handleError(_0x3f3f23,_0x5db3ed){_0x5db3ed=_0x5db3ed||0x1f4;return function(_0x4ab615){logger[_0x923f('0x28')](_0x4ab615[_0x923f('0x29')]);if(_0x4ab615[_0x923f('0x2a')]){delete _0x4ab615[_0x923f('0x2a')];}_0x3f3f23[_0x923f('0x1b')](_0x5db3ed)[_0x923f('0x2b')](_0x4ab615);};}exports[_0x923f('0x2c')]=function(_0x495f38,_0xc3f96d){var _0x586fdb={},_0x431a2f={},_0x5c97e1={'count':0x0,'rows':[]};var _0x532860=_[_0x923f('0x2d')](db[_0x923f('0x2e')][_0x923f('0x2f')],function(_0xbdc9b2){return{'name':_0xbdc9b2[_0x923f('0x30')],'type':_0xbdc9b2['type'][_0x923f('0x31')]};});_0x431a2f[_0x923f('0x32')]=_[_0x923f('0x2d')](_0x532860,_0x923f('0x2a'));_0x431a2f[_0x923f('0x33')]=_[_0x923f('0x34')](_0x495f38[_0x923f('0x33')]);_0x431a2f[_0x923f('0x35')]=_[_0x923f('0x36')](_0x431a2f[_0x923f('0x32')],_0x431a2f[_0x923f('0x33')]);_0x586fdb[_0x923f('0x37')]=_[_0x923f('0x36')](_0x431a2f['model'],qs[_0x923f('0x38')](_0x495f38[_0x923f('0x33')][_0x923f('0x38')]));_0x586fdb[_0x923f('0x37')]=_0x586fdb[_0x923f('0x37')][_0x923f('0x39')]?_0x586fdb[_0x923f('0x37')]:_0x431a2f['model'];if(!_0x495f38[_0x923f('0x33')][_0x923f('0x3a')]('nolimit')){_0x586fdb[_0x923f('0x1f')]=qs[_0x923f('0x1f')](_0x495f38[_0x923f('0x33')][_0x923f('0x1f')]);_0x586fdb[_0x923f('0x1d')]=qs['offset'](_0x495f38[_0x923f('0x33')][_0x923f('0x1d')]);}_0x586fdb[_0x923f('0x3b')]=qs['sort'](_0x495f38[_0x923f('0x33')][_0x923f('0x3c')]);_0x586fdb[_0x923f('0x3d')]=qs[_0x923f('0x35')](_['pick'](_0x495f38[_0x923f('0x33')],_0x431a2f[_0x923f('0x35')]),_0x532860);if(_0x495f38[_0x923f('0x33')][_0x923f('0x3e')]){_0x586fdb['where']=_[_0x923f('0x3f')](_0x586fdb[_0x923f('0x3d')],{'$or':_[_0x923f('0x2d')](_0x532860,function(_0x281f94){if(_0x281f94[_0x923f('0x40')]!==_0x923f('0x41')){var _0xdc4290={};_0xdc4290[_0x281f94[_0x923f('0x2a')]]={'$like':'%'+_0x495f38[_0x923f('0x33')][_0x923f('0x3e')]+'%'};return _0xdc4290;}})});}_0x586fdb=_[_0x923f('0x3f')]({},_0x586fdb,_0x495f38[_0x923f('0x42')]);var _0x269805={'where':_0x586fdb[_0x923f('0x3d')]};return db[_0x923f('0x2e')][_0x923f('0x20')](_0x269805)[_0x923f('0x43')](function(_0x16b794){_0x5c97e1[_0x923f('0x20')]=_0x16b794;if(_0x495f38[_0x923f('0x33')][_0x923f('0x44')]){_0x586fdb['include']=[{'all':!![]}];}return db[_0x923f('0x2e')][_0x923f('0x45')](_0x586fdb);})[_0x923f('0x43')](function(_0x5c05db){_0x5c97e1[_0x923f('0x46')]=_0x5c05db;return _0x5c97e1;})[_0x923f('0x43')](respondWithFilteredResult(_0xc3f96d,_0x586fdb))['catch'](handleError(_0xc3f96d,null));};exports[_0x923f('0x47')]=function(_0x21a0a0,_0x2914b7){var _0x51ed4a={'raw':!![],'where':{'id':_0x21a0a0[_0x923f('0x48')]['id']}},_0x237120={};_0x237120[_0x923f('0x32')]=_['keys'](db['SalesforceField'][_0x923f('0x2f')]);_0x237120[_0x923f('0x33')]=_['keys'](_0x21a0a0[_0x923f('0x33')]);_0x237120[_0x923f('0x35')]=_['intersection'](_0x237120[_0x923f('0x32')],_0x237120[_0x923f('0x33')]);_0x51ed4a['attributes']=_[_0x923f('0x36')](_0x237120[_0x923f('0x32')],qs['fields'](_0x21a0a0['query'][_0x923f('0x38')]));_0x51ed4a['attributes']=_0x51ed4a[_0x923f('0x37')][_0x923f('0x39')]?_0x51ed4a[_0x923f('0x37')]:_0x237120[_0x923f('0x32')];if(_0x21a0a0['query']['includeAll']){_0x51ed4a[_0x923f('0x49')]=[{'all':!![]}];}_0x51ed4a=_['merge']({},_0x51ed4a,_0x21a0a0[_0x923f('0x42')]);return db[_0x923f('0x2e')]['find'](_0x51ed4a)['then'](handleEntityNotFound(_0x2914b7,null))[_0x923f('0x43')](respondWithResult(_0x2914b7,null))[_0x923f('0x4a')](handleError(_0x2914b7,null));};exports[_0x923f('0x4b')]=function(_0x41c5b2,_0x3cc2a6){return db[_0x923f('0x2e')][_0x923f('0x4b')](_0x41c5b2[_0x923f('0x4c')],{})['then'](respondWithResult(_0x3cc2a6,0xc9))[_0x923f('0x4a')](handleError(_0x3cc2a6,null));};exports[_0x923f('0x25')]=function(_0x2c21e0,_0x2794d3){if(_0x2c21e0[_0x923f('0x4c')]['id']){delete _0x2c21e0[_0x923f('0x4c')]['id'];}return db[_0x923f('0x2e')][_0x923f('0x4d')]({'where':{'id':_0x2c21e0[_0x923f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2794d3,null))['then'](saveUpdates(_0x2c21e0[_0x923f('0x4c')],null))[_0x923f('0x43')](respondWithResult(_0x2794d3,null))[_0x923f('0x4a')](handleError(_0x2794d3,null));};exports[_0x923f('0x26')]=function(_0xc2b71f,_0x275118){return db[_0x923f('0x2e')][_0x923f('0x4d')]({'where':{'id':_0xc2b71f[_0x923f('0x48')]['id']}})[_0x923f('0x43')](handleEntityNotFound(_0x275118,null))[_0x923f('0x43')](removeEntity(_0x275118,null))[_0x923f('0x4a')](handleError(_0x275118,null));}; \ No newline at end of file +var _0x8b7a=['index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','options','rows','params','length','includeAll','include','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../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','undefined','count','set','Content-Range','reject','update','destroy','then','stack','name','send'];(function(_0x14f55f,_0x353846){var _0x3ca2a7=function(_0x3069f4){while(--_0x3069f4){_0x14f55f['push'](_0x14f55f['shift']());}};_0x3ca2a7(++_0x353846);}(_0x8b7a,0x177));var _0xa8b7=function(_0x4c002d,_0x5a07d1){_0x4c002d=_0x4c002d-0x0;var _0x7af2f0=_0x8b7a[_0x4c002d];return _0x7af2f0;};'use strict';var emlformat=require(_0xa8b7('0x0'));var rimraf=require(_0xa8b7('0x1'));var zipdir=require(_0xa8b7('0x2'));var jsonpatch=require(_0xa8b7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa8b7('0x4'));var util=require('util');var path=require(_0xa8b7('0x5'));var sox=require(_0xa8b7('0x6'));var csv=require(_0xa8b7('0x7'));var ejs=require(_0xa8b7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8b7('0x9'));var squel=require('squel');var crypto=require(_0xa8b7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8b7('0x7'));var querystring=require(_0xa8b7('0xb'));var Papa=require(_0xa8b7('0xc'));var Redis=require(_0xa8b7('0xd'));var authService=require(_0xa8b7('0xe'));var qs=require(_0xa8b7('0xf'));var as=require(_0xa8b7('0x10'));var hardwareService=require(_0xa8b7('0x11'));var logger=require(_0xa8b7('0x12'))(_0xa8b7('0x13'));var utils=require(_0xa8b7('0x14'));var config=require(_0xa8b7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xff6e76,_0x1a0f1c){_0x1a0f1c=_0x1a0f1c||0xcc;return function(_0x384d9a){if(_0x384d9a){return _0xff6e76[_0xa8b7('0x16')](_0x1a0f1c);}return _0xff6e76[_0xa8b7('0x17')](_0x1a0f1c)[_0xa8b7('0x18')]();};}function respondWithResult(_0x36bfaa,_0x1291e0){_0x1291e0=_0x1291e0||0xc8;return function(_0x3ec840){if(_0x3ec840){return _0x36bfaa[_0xa8b7('0x17')](_0x1291e0)[_0xa8b7('0x19')](_0x3ec840);}};}function respondWithFilteredResult(_0x62b829,_0x59fdde){return function(_0x539d54){if(_0x539d54){var _0x560fec=typeof _0x59fdde[_0xa8b7('0x1a')]==='undefined'&&typeof _0x59fdde[_0xa8b7('0x1b')]===_0xa8b7('0x1c');var _0x67ec8=_0x539d54['count'];var _0x14fc7c=_0x560fec?0x0:_0x59fdde[_0xa8b7('0x1a')];var _0x14119b=_0x560fec?_0x539d54[_0xa8b7('0x1d')]:_0x59fdde[_0xa8b7('0x1a')]+_0x59fdde[_0xa8b7('0x1b')];var _0x12886b;if(_0x14119b>=_0x67ec8){_0x14119b=_0x67ec8;_0x12886b=0xc8;}else{_0x12886b=0xce;}_0x62b829[_0xa8b7('0x17')](_0x12886b);return _0x62b829[_0xa8b7('0x1e')](_0xa8b7('0x1f'),_0x14fc7c+'-'+_0x14119b+'/'+_0x67ec8)[_0xa8b7('0x19')](_0x539d54);}return null;};}function patchUpdates(_0x3be074){return function(_0x9d8880){try{jsonpatch['apply'](_0x9d8880,_0x3be074,!![]);}catch(_0x42b2c1){return BPromise[_0xa8b7('0x20')](_0x42b2c1);}return _0x9d8880['save']();};}function saveUpdates(_0x1f7c4d,_0x25398a){return function(_0x5b9a3f){if(_0x5b9a3f){return _0x5b9a3f[_0xa8b7('0x21')](_0x1f7c4d)['then'](function(_0x2f91e9){return _0x2f91e9;});}return null;};}function removeEntity(_0x9a09b3,_0x26403d){return function(_0x2ee07d){if(_0x2ee07d){return _0x2ee07d[_0xa8b7('0x22')]()[_0xa8b7('0x23')](function(){_0x9a09b3['status'](0xcc)[_0xa8b7('0x18')]();});}};}function handleEntityNotFound(_0x2ac253,_0x8dea73){return function(_0x20769d){if(!_0x20769d){_0x2ac253[_0xa8b7('0x16')](0x194);}return _0x20769d;};}function handleError(_0x2fe9e5,_0x45b808){_0x45b808=_0x45b808||0x1f4;return function(_0x33958e){logger['error'](_0x33958e[_0xa8b7('0x24')]);if(_0x33958e[_0xa8b7('0x25')]){delete _0x33958e[_0xa8b7('0x25')];}_0x2fe9e5[_0xa8b7('0x17')](_0x45b808)[_0xa8b7('0x26')](_0x33958e);};}exports[_0xa8b7('0x27')]=function(_0x4dd42e,_0x4d5bc9){var _0x5258c5={},_0x5c1d65={},_0x36843e={'count':0x0,'rows':[]};var _0x29705d=_[_0xa8b7('0x28')](db[_0xa8b7('0x29')][_0xa8b7('0x2a')],function(_0x5d974b){return{'name':_0x5d974b[_0xa8b7('0x2b')],'type':_0x5d974b[_0xa8b7('0x2c')][_0xa8b7('0x2d')]};});_0x5c1d65[_0xa8b7('0x2e')]=_['map'](_0x29705d,_0xa8b7('0x25'));_0x5c1d65[_0xa8b7('0x2f')]=_[_0xa8b7('0x30')](_0x4dd42e[_0xa8b7('0x2f')]);_0x5c1d65[_0xa8b7('0x31')]=_[_0xa8b7('0x32')](_0x5c1d65['model'],_0x5c1d65[_0xa8b7('0x2f')]);_0x5258c5[_0xa8b7('0x33')]=_[_0xa8b7('0x32')](_0x5c1d65[_0xa8b7('0x2e')],qs[_0xa8b7('0x34')](_0x4dd42e[_0xa8b7('0x2f')][_0xa8b7('0x34')]));_0x5258c5[_0xa8b7('0x33')]=_0x5258c5['attributes']['length']?_0x5258c5[_0xa8b7('0x33')]:_0x5c1d65[_0xa8b7('0x2e')];if(!_0x4dd42e['query']['hasOwnProperty'](_0xa8b7('0x35'))){_0x5258c5['limit']=qs[_0xa8b7('0x1b')](_0x4dd42e[_0xa8b7('0x2f')][_0xa8b7('0x1b')]);_0x5258c5[_0xa8b7('0x1a')]=qs['offset'](_0x4dd42e['query'][_0xa8b7('0x1a')]);}_0x5258c5['order']=qs[_0xa8b7('0x36')](_0x4dd42e['query'][_0xa8b7('0x36')]);_0x5258c5[_0xa8b7('0x37')]=qs[_0xa8b7('0x31')](_[_0xa8b7('0x38')](_0x4dd42e[_0xa8b7('0x2f')],_0x5c1d65[_0xa8b7('0x31')]),_0x29705d);if(_0x4dd42e[_0xa8b7('0x2f')]['filter']){_0x5258c5[_0xa8b7('0x37')]=_[_0xa8b7('0x39')](_0x5258c5[_0xa8b7('0x37')],{'$or':_[_0xa8b7('0x28')](_0x29705d,function(_0x5e355f){if(_0x5e355f['type']!==_0xa8b7('0x3a')){var _0x584b43={};_0x584b43[_0x5e355f[_0xa8b7('0x25')]]={'$like':'%'+_0x4dd42e[_0xa8b7('0x2f')]['filter']+'%'};return _0x584b43;}})});}_0x5258c5=_[_0xa8b7('0x39')]({},_0x5258c5,_0x4dd42e[_0xa8b7('0x3b')]);var _0x2aa5a0={'where':_0x5258c5[_0xa8b7('0x37')]};return db['SalesforceField']['count'](_0x2aa5a0)['then'](function(_0x196638){_0x36843e['count']=_0x196638;if(_0x4dd42e[_0xa8b7('0x2f')]['includeAll']){_0x5258c5['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x5258c5);})[_0xa8b7('0x23')](function(_0x4c020d){_0x36843e[_0xa8b7('0x3c')]=_0x4c020d;return _0x36843e;})[_0xa8b7('0x23')](respondWithFilteredResult(_0x4d5bc9,_0x5258c5))['catch'](handleError(_0x4d5bc9,null));};exports['show']=function(_0x99fd16,_0x48ceec){var _0x1c2493={'raw':!![],'where':{'id':_0x99fd16[_0xa8b7('0x3d')]['id']}},_0xc61101={};_0xc61101[_0xa8b7('0x2e')]=_['keys'](db[_0xa8b7('0x29')][_0xa8b7('0x2a')]);_0xc61101[_0xa8b7('0x2f')]=_[_0xa8b7('0x30')](_0x99fd16[_0xa8b7('0x2f')]);_0xc61101[_0xa8b7('0x31')]=_[_0xa8b7('0x32')](_0xc61101[_0xa8b7('0x2e')],_0xc61101['query']);_0x1c2493[_0xa8b7('0x33')]=_['intersection'](_0xc61101[_0xa8b7('0x2e')],qs['fields'](_0x99fd16[_0xa8b7('0x2f')][_0xa8b7('0x34')]));_0x1c2493[_0xa8b7('0x33')]=_0x1c2493[_0xa8b7('0x33')][_0xa8b7('0x3e')]?_0x1c2493[_0xa8b7('0x33')]:_0xc61101[_0xa8b7('0x2e')];if(_0x99fd16[_0xa8b7('0x2f')][_0xa8b7('0x3f')]){_0x1c2493[_0xa8b7('0x40')]=[{'all':!![]}];}_0x1c2493=_[_0xa8b7('0x39')]({},_0x1c2493,_0x99fd16[_0xa8b7('0x3b')]);return db[_0xa8b7('0x29')][_0xa8b7('0x41')](_0x1c2493)[_0xa8b7('0x23')](handleEntityNotFound(_0x48ceec,null))[_0xa8b7('0x23')](respondWithResult(_0x48ceec,null))['catch'](handleError(_0x48ceec,null));};exports[_0xa8b7('0x42')]=function(_0x520314,_0x362306){return db['SalesforceField'][_0xa8b7('0x42')](_0x520314[_0xa8b7('0x43')],{})['then'](respondWithResult(_0x362306,0xc9))[_0xa8b7('0x44')](handleError(_0x362306,null));};exports[_0xa8b7('0x21')]=function(_0x2cff45,_0x4bea9a){if(_0x2cff45['body']['id']){delete _0x2cff45['body']['id'];}return db[_0xa8b7('0x29')][_0xa8b7('0x41')]({'where':{'id':_0x2cff45[_0xa8b7('0x3d')]['id']}})[_0xa8b7('0x23')](handleEntityNotFound(_0x4bea9a,null))[_0xa8b7('0x23')](saveUpdates(_0x2cff45[_0xa8b7('0x43')],null))[_0xa8b7('0x23')](respondWithResult(_0x4bea9a,null))[_0xa8b7('0x44')](handleError(_0x4bea9a,null));};exports[_0xa8b7('0x22')]=function(_0x137d40,_0x8c2708){return db['SalesforceField'][_0xa8b7('0x41')]({'where':{'id':_0x137d40['params']['id']}})[_0xa8b7('0x23')](handleEntityNotFound(_0x8c2708,null))['then'](removeEntity(_0x8c2708,null))[_0xa8b7('0x44')](handleError(_0x8c2708,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b9e5901..e08a108 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 _0xf51d=['request-promise','path','../../config/environment','exports','SalesforceField','salesforce_unique_index','FieldId','lodash','util','api','moment','bluebird'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xf51d,0x1cf));var _0xdf51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf51('0x0'));var util=require(_0xdf51('0x1'));var logger=require('../../config/logger')(_0xdf51('0x2'));var moment=require(_0xdf51('0x3'));var BPromise=require(_0xdf51('0x4'));var rp=require(_0xdf51('0x5'));var fs=require('fs');var path=require(_0xdf51('0x6'));var rimraf=require('rimraf');var config=require(_0xdf51('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xdf51('0x8')]=function(_0x20c5c1,_0x47dae8){return _0x20c5c1['define'](_0xdf51('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xdf51('0xa'),'fields':['idField',_0xdf51('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4247=['int_salesforce_fields','lodash','util','moment','bluebird','request-promise','path','rimraf','exports','define','SalesforceField'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x4247,0x114));var _0x7424=function(_0x21a886,_0x4f8d13){_0x21a886=_0x21a886-0x0;var _0x2bcf26=_0x4247[_0x21a886];return _0x2bcf26;};'use strict';var _=require(_0x7424('0x0'));var util=require(_0x7424('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7424('0x2'));var BPromise=require(_0x7424('0x3'));var rp=require(_0x7424('0x4'));var fs=require('fs');var path=require(_0x7424('0x5'));var rimraf=require(_0x7424('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x7424('0x7')]=function(_0x555a0a,_0x1f2185){return _0x555a0a[_0x7424('0x8')](_0x7424('0x9'),attributes,{'tableName':_0x7424('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField','FieldId'],'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 d47e694..44728d9 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 _0xabe5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xabe5,0x1b6));var _0x5abe=function(_0x43b850,_0x33f599){_0x43b850=_0x43b850-0x0;var _0xd61f56=_0xabe5[_0x43b850];return _0xd61f56;};'use strict';var _=require(_0x5abe('0x0'));var util=require(_0x5abe('0x1'));var moment=require('moment');var BPromise=require(_0x5abe('0x2'));var rs=require(_0x5abe('0x3'));var fs=require('fs');var Redis=require(_0x5abe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5abe('0x5'));var logger=require(_0x5abe('0x6'))('rpc');var config=require(_0x5abe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5abe('0x8')][_0x5abe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32c660,_0x53e241,_0x45ab1f){return new BPromise(function(_0x163359,_0x2c9288){return client[_0x5abe('0xa')](_0x32c660,_0x45ab1f)['then'](function(_0x4de0ec){logger[_0x5abe('0xb')](_0x5abe('0xc'),_0x53e241,_0x5abe('0xd'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x53e241,_0x5abe('0xd'),JSON[_0x5abe('0xe')](_0x4de0ec));if(_0x4de0ec[_0x5abe('0xf')]){if(_0x4de0ec['error'][_0x5abe('0x10')]===0x1f4){logger[_0x5abe('0xf')](_0x5abe('0xc'),_0x53e241,_0x4de0ec['error'][_0x5abe('0x11')]);return _0x2c9288(_0x4de0ec[_0x5abe('0xf')]['message']);}logger['error'](_0x5abe('0xc'),_0x53e241,_0x4de0ec['error'][_0x5abe('0x11')]);return _0x163359(_0x4de0ec['error'][_0x5abe('0x11')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x53e241,'request\x20sent');_0x163359(_0x4de0ec[_0x5abe('0x12')]['message']);}})[_0x5abe('0x13')](function(_0x3009d3){logger[_0x5abe('0xf')](_0x5abe('0xc'),_0x53e241,_0x3009d3);_0x2c9288(_0x3009d3);});});} \ No newline at end of file +var _0x0ea9=['error','code','message','request\x20sent','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x3425c9,_0x26083d){var _0x2b0fb8=function(_0x5e8643){while(--_0x5e8643){_0x3425c9['push'](_0x3425c9['shift']());}};_0x2b0fb8(++_0x26083d);}(_0x0ea9,0xaf));var _0x90ea=function(_0x2d2a32,_0x1abc3c){_0x2d2a32=_0x2d2a32-0x0;var _0x535e3d=_0x0ea9[_0x2d2a32];return _0x535e3d;};'use strict';var _=require(_0x90ea('0x0'));var util=require(_0x90ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90ea('0x3'));var logger=require(_0x90ea('0x4'))('rpc');var config=require(_0x90ea('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90ea('0x6')][_0x90ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x39d716,_0x240234,_0x178fb2){return new BPromise(function(_0x16c172,_0x2166b8){return client[_0x90ea('0x8')](_0x39d716,_0x178fb2)[_0x90ea('0x9')](function(_0x38a707){logger[_0x90ea('0xa')](_0x90ea('0xb'),_0x240234,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x240234,'request\x20sent',JSON['stringify'](_0x38a707));if(_0x38a707['error']){if(_0x38a707[_0x90ea('0xc')][_0x90ea('0xd')]===0x1f4){logger[_0x90ea('0xc')]('SalesforceField,\x20%s,\x20%s',_0x240234,_0x38a707[_0x90ea('0xc')][_0x90ea('0xe')]);return _0x2166b8(_0x38a707[_0x90ea('0xc')][_0x90ea('0xe')]);}logger[_0x90ea('0xc')](_0x90ea('0xb'),_0x240234,_0x38a707['error'][_0x90ea('0xe')]);return _0x16c172(_0x38a707[_0x90ea('0xc')][_0x90ea('0xe')]);}else{logger[_0x90ea('0xa')](_0x90ea('0xb'),_0x240234,_0x90ea('0xf'));_0x16c172(_0x38a707['result'][_0x90ea('0xe')]);}})[_0x90ea('0x10')](function(_0x2ec29d){logger[_0x90ea('0xc')](_0x90ea('0xb'),_0x240234,_0x2ec29d);_0x2166b8(_0x2ec29d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8f66eab..e057ed9 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 _0x7235=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x30836d,_0x360509){var _0x941caa=function(_0x47881d){while(--_0x47881d){_0x30836d['push'](_0x30836d['shift']());}};_0x941caa(++_0x360509);}(_0x7235,0x77));var _0x5723=function(_0x146698,_0x5e30a0){_0x146698=_0x146698-0x0;var _0xb73a40=_0x7235[_0x146698];return _0xb73a40;};'use strict';var multer=require(_0x5723('0x0'));var util=require(_0x5723('0x1'));var path=require(_0x5723('0x2'));var timeout=require(_0x5723('0x3'));var express=require('express');var router=express[_0x5723('0x4')]();var fs_extra=require(_0x5723('0x5'));var auth=require(_0x5723('0x6'));var interaction=require(_0x5723('0x7'));var config=require(_0x5723('0x8'));var controller=require(_0x5723('0x9'));router[_0x5723('0xa')]('/',auth[_0x5723('0xb')](),controller[_0x5723('0xc')]);router[_0x5723('0xa')](_0x5723('0xd'),auth[_0x5723('0xb')](),controller[_0x5723('0xe')]);router[_0x5723('0xa')](_0x5723('0xf'),auth[_0x5723('0xb')](),controller[_0x5723('0x10')]);router['get'](_0x5723('0x11'),auth[_0x5723('0xb')](),controller[_0x5723('0x12')]);router['post']('/',auth[_0x5723('0xb')](),controller[_0x5723('0x13')]);router[_0x5723('0x14')](_0x5723('0xf'),auth[_0x5723('0xb')](),controller[_0x5723('0x15')]);router[_0x5723('0x16')](_0x5723('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5723('0x17')](_0x5723('0xd'),auth[_0x5723('0xb')](),controller['destroy']);module[_0x5723('0x18')]=router; \ No newline at end of file +var _0x7c5e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c25e2,_0x54d1b9){var _0x19f8c7=function(_0x53bed1){while(--_0x53bed1){_0x5c25e2['push'](_0x5c25e2['shift']());}};_0x19f8c7(++_0x54d1b9);}(_0x7c5e,0x11d));var _0xe7c5=function(_0x2788b8,_0x595fe1){_0x2788b8=_0x2788b8-0x0;var _0x1da099=_0x7c5e[_0x2788b8];return _0x1da099;};'use strict';var multer=require(_0xe7c5('0x0'));var util=require(_0xe7c5('0x1'));var path=require(_0xe7c5('0x2'));var timeout=require(_0xe7c5('0x3'));var express=require(_0xe7c5('0x4'));var router=express[_0xe7c5('0x5')]();var fs_extra=require(_0xe7c5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7c5('0x7'));var config=require(_0xe7c5('0x8'));var controller=require(_0xe7c5('0x9'));router[_0xe7c5('0xa')]('/',auth[_0xe7c5('0xb')](),controller[_0xe7c5('0xc')]);router[_0xe7c5('0xa')](_0xe7c5('0xd'),auth[_0xe7c5('0xb')](),controller[_0xe7c5('0xe')]);router[_0xe7c5('0xa')](_0xe7c5('0xf'),auth[_0xe7c5('0xb')](),controller[_0xe7c5('0x10')]);router[_0xe7c5('0xa')]('/:id/fields',auth[_0xe7c5('0xb')](),controller['getFields']);router[_0xe7c5('0x11')]('/',auth[_0xe7c5('0xb')](),controller[_0xe7c5('0x12')]);router[_0xe7c5('0x11')]('/:id/configurations',auth[_0xe7c5('0xb')](),controller[_0xe7c5('0x13')]);router[_0xe7c5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe7c5('0x15')]);router['delete'](_0xe7c5('0xd'),auth[_0xe7c5('0xb')](),controller[_0xe7c5('0x16')]);module[_0xe7c5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 470b04f..bf8c62c 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 _0xa6be=['username','remoteUri','sequelize','exports','STRING'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xa6be,0x15b));var _0xea6b=function(_0x46f656,_0x2a4e63){_0x46f656=_0x46f656-0x0;var _0x47afcc=_0xa6be[_0x46f656];return _0x47afcc;};'use strict';var Sequelize=require(_0xea6b('0x0'));module[_0xea6b('0x1')]={'name':{'type':Sequelize[_0xea6b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xea6b('0x2')],'unique':_0xea6b('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xea6b('0x2')]},'remoteUri':{'type':Sequelize[_0xea6b('0x2')],'unique':_0xea6b('0x4')},'serverUrl':{'type':Sequelize[_0xea6b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8c71=['exports','STRING','remoteUri','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8c71,0x1cf));var _0x18c7=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x8c71[_0x12d6c2];return _0x1c9825;};'use strict';var Sequelize=require(_0x18c7('0x0'));module[_0x18c7('0x1')]={'name':{'type':Sequelize[_0x18c7('0x2')]},'description':{'type':Sequelize[_0x18c7('0x2')]},'username':{'type':Sequelize[_0x18c7('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x18c7('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x18c7('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 09e332b..10b3108 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 _0x71b3=['attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','findAll','show','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','subcategory','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','company','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','False','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','status','error','stack','name','send','map','ServicenowAccount','rawAttributes','type','key','model','query','intersection','fields'];(function(_0x5216e0,_0x23f543){var _0x1a3754=function(_0x5438f8){while(--_0x5438f8){_0x5216e0['push'](_0x5216e0['shift']());}};_0x1a3754(++_0x23f543);}(_0x71b3,0x89));var _0x371b=function(_0x146c50,_0x3a35c6){_0x146c50=_0x146c50-0x0;var _0x436146=_0x71b3[_0x146c50];return _0x436146;};'use strict';var emlformat=require(_0x371b('0x0'));var rimraf=require(_0x371b('0x1'));var zipdir=require(_0x371b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x371b('0x3'));var moment=require(_0x371b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x371b('0x5'));var csv=require(_0x371b('0x6'));var ejs=require(_0x371b('0x7'));var fs=require('fs');var fs_extra=require(_0x371b('0x8'));var _=require(_0x371b('0x9'));var squel=require(_0x371b('0xa'));var crypto=require(_0x371b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x371b('0x6'));var querystring=require(_0x371b('0xc'));var Papa=require(_0x371b('0xd'));var Redis=require(_0x371b('0xe'));var authService=require(_0x371b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x371b('0x10'));var hardwareService=require(_0x371b('0x11'));var logger=require(_0x371b('0x12'))(_0x371b('0x13'));var utils=require('../../config/utils');var config=require(_0x371b('0x14'));var licenseUtil=require(_0x371b('0x15'));var db=require(_0x371b('0x16'))['db'];var integrations=require(_0x371b('0x17'));function respondWithStatusCode(_0xab4189,_0x192608){_0x192608=_0x192608||0xcc;return function(_0x561b77){if(_0x561b77){return _0xab4189[_0x371b('0x18')](_0x192608);}return _0xab4189['status'](_0x192608)[_0x371b('0x19')]();};}function respondWithResult(_0x481743,_0x5a2a13){_0x5a2a13=_0x5a2a13||0xc8;return function(_0x156d44){if(_0x156d44){return _0x481743['status'](_0x5a2a13)[_0x371b('0x1a')](_0x156d44);}};}function respondWithFilteredResult(_0x5c38f1,_0x11e682){return function(_0x5ae98c){if(_0x5ae98c){var _0x4f02b0=typeof _0x11e682[_0x371b('0x1b')]===_0x371b('0x1c')&&typeof _0x11e682[_0x371b('0x1d')]===_0x371b('0x1c');var _0x1c9c2d=_0x5ae98c[_0x371b('0x1e')];var _0x566e23=_0x4f02b0?0x0:_0x11e682[_0x371b('0x1b')];var _0x4a3f00=_0x4f02b0?_0x5ae98c['count']:_0x11e682[_0x371b('0x1b')]+_0x11e682[_0x371b('0x1d')];var _0x4df543;if(_0x4a3f00>=_0x1c9c2d){_0x4a3f00=_0x1c9c2d;_0x4df543=0xc8;}else{_0x4df543=0xce;}_0x5c38f1['status'](_0x4df543);return _0x5c38f1[_0x371b('0x1f')](_0x371b('0x20'),_0x566e23+'-'+_0x4a3f00+'/'+_0x1c9c2d)[_0x371b('0x1a')](_0x5ae98c);}return null;};}function patchUpdates(_0x27c705){return function(_0x182fbe){try{jsonpatch[_0x371b('0x21')](_0x182fbe,_0x27c705,!![]);}catch(_0x5925c0){return BPromise[_0x371b('0x22')](_0x5925c0);}return _0x182fbe[_0x371b('0x23')]();};}function saveUpdates(_0x2f7f2f,_0x4dd506){return function(_0x5aaec1){if(_0x5aaec1){return _0x5aaec1[_0x371b('0x24')](_0x2f7f2f)['then'](function(_0xf1202c){return _0xf1202c;});}return null;};}function removeEntity(_0x5c5062,_0x1fbbf2){return function(_0x2f7227){if(_0x2f7227){return _0x2f7227['destroy']()['then'](function(){_0x5c5062[_0x371b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17beee,_0x306948){return function(_0x4bdfde){if(!_0x4bdfde){_0x17beee[_0x371b('0x18')](0x194);}return _0x4bdfde;};}function handleError(_0x3c7a2e,_0x28ca07){_0x28ca07=_0x28ca07||0x1f4;return function(_0x3734ac){logger[_0x371b('0x26')](_0x3734ac[_0x371b('0x27')]);if(_0x3734ac[_0x371b('0x28')]){delete _0x3734ac[_0x371b('0x28')];}_0x3c7a2e['status'](_0x28ca07)[_0x371b('0x29')](_0x3734ac);};}exports['index']=function(_0xe85c1,_0x3f4fc3){var _0x4a49d1={},_0x584066={},_0x143625={'count':0x0,'rows':[]};var _0x2b6900=_[_0x371b('0x2a')](db[_0x371b('0x2b')][_0x371b('0x2c')],function(_0x18f4f2){return{'name':_0x18f4f2['fieldName'],'type':_0x18f4f2[_0x371b('0x2d')][_0x371b('0x2e')]};});_0x584066[_0x371b('0x2f')]=_['map'](_0x2b6900,_0x371b('0x28'));_0x584066[_0x371b('0x30')]=_['keys'](_0xe85c1[_0x371b('0x30')]);_0x584066['filters']=_[_0x371b('0x31')](_0x584066[_0x371b('0x2f')],_0x584066[_0x371b('0x30')]);_0x4a49d1['attributes']=_[_0x371b('0x31')](_0x584066['model'],qs[_0x371b('0x32')](_0xe85c1[_0x371b('0x30')]['fields']));_0x4a49d1['attributes']=_0x4a49d1[_0x371b('0x33')][_0x371b('0x34')]?_0x4a49d1[_0x371b('0x33')]:_0x584066[_0x371b('0x2f')];if(!_0xe85c1[_0x371b('0x30')]['hasOwnProperty'](_0x371b('0x35'))){_0x4a49d1[_0x371b('0x1d')]=qs[_0x371b('0x1d')](_0xe85c1[_0x371b('0x30')][_0x371b('0x1d')]);_0x4a49d1[_0x371b('0x1b')]=qs[_0x371b('0x1b')](_0xe85c1[_0x371b('0x30')][_0x371b('0x1b')]);}_0x4a49d1[_0x371b('0x36')]=qs[_0x371b('0x37')](_0xe85c1[_0x371b('0x30')][_0x371b('0x37')]);_0x4a49d1[_0x371b('0x38')]=qs[_0x371b('0x39')](_[_0x371b('0x3a')](_0xe85c1['query'],_0x584066['filters']),_0x2b6900);if(_0xe85c1['query'][_0x371b('0x3b')]){_0x4a49d1[_0x371b('0x38')]=_[_0x371b('0x3c')](_0x4a49d1[_0x371b('0x38')],{'$or':_['map'](_0x2b6900,function(_0xb6634){if(_0xb6634[_0x371b('0x2d')]!==_0x371b('0x3d')){var _0xcf7f8a={};_0xcf7f8a[_0xb6634['name']]={'$like':'%'+_0xe85c1['query'][_0x371b('0x3b')]+'%'};return _0xcf7f8a;}})});}_0x4a49d1=_[_0x371b('0x3c')]({},_0x4a49d1,_0xe85c1[_0x371b('0x3e')]);var _0x5d0062={'where':_0x4a49d1[_0x371b('0x38')]};return db[_0x371b('0x2b')]['count'](_0x5d0062)[_0x371b('0x3f')](function(_0x61926e){_0x143625['count']=_0x61926e;if(_0xe85c1[_0x371b('0x30')]['includeAll']){_0x4a49d1[_0x371b('0x40')]=[{'all':!![]}];}return db[_0x371b('0x2b')][_0x371b('0x41')](_0x4a49d1);})[_0x371b('0x3f')](function(_0x31c4a6){_0x143625['rows']=_0x31c4a6;return _0x143625;})[_0x371b('0x3f')](respondWithFilteredResult(_0x3f4fc3,_0x4a49d1))['catch'](handleError(_0x3f4fc3,null));};exports[_0x371b('0x42')]=function(_0xa337eb,_0x1230bd){var _0x1b7c7e={'raw':![],'where':{'id':_0xa337eb[_0x371b('0x43')]['id']}},_0x383968={};_0x383968[_0x371b('0x2f')]=_['keys'](db[_0x371b('0x2b')][_0x371b('0x2c')]);_0x383968['query']=_[_0x371b('0x44')](_0xa337eb[_0x371b('0x30')]);_0x383968[_0x371b('0x39')]=_[_0x371b('0x31')](_0x383968[_0x371b('0x2f')],_0x383968[_0x371b('0x30')]);_0x1b7c7e[_0x371b('0x33')]=_[_0x371b('0x31')](_0x383968[_0x371b('0x2f')],qs['fields'](_0xa337eb['query']['fields']));_0x1b7c7e['attributes']=_0x1b7c7e[_0x371b('0x33')][_0x371b('0x34')]?_0x1b7c7e[_0x371b('0x33')]:_0x383968[_0x371b('0x2f')];if(_0xa337eb[_0x371b('0x30')][_0x371b('0x45')]){_0x1b7c7e[_0x371b('0x40')]=[{'all':!![]}];}_0x1b7c7e=_[_0x371b('0x3c')]({},_0x1b7c7e,_0xa337eb[_0x371b('0x3e')]);return db[_0x371b('0x2b')][_0x371b('0x46')](_0x1b7c7e)[_0x371b('0x3f')](handleEntityNotFound(_0x1230bd,null))[_0x371b('0x3f')](respondWithResult(_0x1230bd,null))[_0x371b('0x47')](handleError(_0x1230bd,null));};exports[_0x371b('0x48')]=function(_0x116efb,_0x4ed94b){return db['ServicenowAccount'][_0x371b('0x48')](_0x116efb[_0x371b('0x49')],{})['then'](respondWithResult(_0x4ed94b,0xc9))['catch'](handleError(_0x4ed94b,null));};exports['update']=function(_0x201c7d,_0x5226d1){if(_0x201c7d[_0x371b('0x49')]['id']){delete _0x201c7d[_0x371b('0x49')]['id'];}return db[_0x371b('0x2b')][_0x371b('0x46')]({'where':{'id':_0x201c7d[_0x371b('0x43')]['id']}})[_0x371b('0x3f')](handleEntityNotFound(_0x5226d1,null))[_0x371b('0x3f')](saveUpdates(_0x201c7d[_0x371b('0x49')],null))[_0x371b('0x3f')](respondWithResult(_0x5226d1,null))['catch'](handleError(_0x5226d1,null));};exports[_0x371b('0x4a')]=function(_0x197d5b,_0x51cdf5){return db[_0x371b('0x2b')]['find']({'where':{'id':_0x197d5b[_0x371b('0x43')]['id']}})[_0x371b('0x3f')](handleEntityNotFound(_0x51cdf5,null))[_0x371b('0x3f')](removeEntity(_0x51cdf5,null))['catch'](handleError(_0x51cdf5,null));};exports[_0x371b('0x4b')]=function(_0xcfa52,_0x4cef36,_0x4b6f2a){var _0x29c693={};var _0x128f7b={};var _0x4174bd;var _0x4f3423;return db[_0x371b('0x2b')][_0x371b('0x4c')]({'where':{'id':_0xcfa52[_0x371b('0x43')]['id']}})[_0x371b('0x3f')](handleEntityNotFound(_0x4cef36,null))[_0x371b('0x3f')](function(_0x5c2bd0){if(_0x5c2bd0){_0x4174bd=_0x5c2bd0;_0x128f7b[_0x371b('0x2f')]=_['keys'](db[_0x371b('0x4d')][_0x371b('0x2c')]);_0x128f7b[_0x371b('0x30')]=_[_0x371b('0x44')](_0xcfa52['query']);_0x128f7b['filters']=_[_0x371b('0x31')](_0x128f7b[_0x371b('0x2f')],_0x128f7b[_0x371b('0x30')]);_0x29c693[_0x371b('0x33')]=_[_0x371b('0x31')](_0x128f7b['model'],qs[_0x371b('0x32')](_0xcfa52[_0x371b('0x30')][_0x371b('0x32')]));_0x29c693[_0x371b('0x33')]=_0x29c693['attributes'][_0x371b('0x34')]?_0x29c693[_0x371b('0x33')]:_0x128f7b['model'];_0x29c693[_0x371b('0x36')]=qs['sort'](_0xcfa52['query']['sort']);_0x29c693['where']=qs[_0x371b('0x39')](_['pick'](_0xcfa52[_0x371b('0x30')],_0x128f7b[_0x371b('0x39')]));if(_0xcfa52['query'][_0x371b('0x3b')]){_0x29c693[_0x371b('0x38')]=_[_0x371b('0x3c')](_0x29c693['where'],{'$or':_['map'](_0x29c693[_0x371b('0x33')],function(_0x4d906c){var _0x207fc4={};_0x207fc4[_0x4d906c]={'$like':'%'+_0xcfa52[_0x371b('0x30')]['filter']+'%'};return _0x207fc4;})});}_0x29c693=_['merge']({},_0x29c693,_0xcfa52[_0x371b('0x3e')]);return _0x4174bd[_0x371b('0x4b')](_0x29c693);}})[_0x371b('0x3f')](function(_0xa75864){if(_0xa75864){_0x4f3423=_0xa75864[_0x371b('0x34')];if(!_0xcfa52[_0x371b('0x30')][_0x371b('0x4e')](_0x371b('0x35'))){_0x29c693[_0x371b('0x1d')]=qs[_0x371b('0x1d')](_0xcfa52[_0x371b('0x30')][_0x371b('0x1d')]);_0x29c693[_0x371b('0x1b')]=qs[_0x371b('0x1b')](_0xcfa52[_0x371b('0x30')]['offset']);}return _0x4174bd['getConfigurations'](_0x29c693);}})[_0x371b('0x3f')](function(_0x2f63f9){if(_0x2f63f9){return _0x2f63f9?{'count':_0x4f3423,'rows':_0x2f63f9}:null;}})['then'](respondWithResult(_0x4cef36,null))[_0x371b('0x47')](handleError(_0x4cef36,null));};exports[_0x371b('0x4f')]=function(_0x398faa,_0x3ff968,_0x4b2218){if(_0x398faa[_0x371b('0x49')]['id']){delete _0x398faa['body']['id'];}return db[_0x371b('0x2b')][_0x371b('0x4c')]({'where':{'id':_0x398faa['params']['id']}})[_0x371b('0x3f')](handleEntityNotFound(_0x3ff968,null))[_0x371b('0x3f')](function(_0x506009){if(_0x506009){_0x398faa[_0x371b('0x49')][_0x371b('0x50')]=_0x506009['id'];_0x398faa[_0x371b('0x49')][_0x371b('0x51')]=integrations[_0x371b('0x52')](_0x398faa['body'][_0x371b('0x53')],_0x398faa[_0x371b('0x49')][_0x371b('0x2d')]);_0x398faa['body'][_0x371b('0x54')]=integrations[_0x371b('0x55')](_0x398faa[_0x371b('0x49')][_0x371b('0x53')],_0x398faa[_0x371b('0x49')]['type']);return db[_0x371b('0x4d')][_0x371b('0x48')](_0x398faa[_0x371b('0x49')],{'include':[{'model':db[_0x371b('0x56')],'as':_0x371b('0x51')},{'model':db['ServicenowField'],'as':_0x371b('0x54')}]});}return null;})[_0x371b('0x3f')](respondWithResult(_0x3ff968,null))[_0x371b('0x47')](handleError(_0x3ff968,null));};exports[_0x371b('0x57')]=function(_0x34f3d9,_0x20a975,_0x49bf0d){var _0x51db1b=[_0x371b('0x58'),'hold_reason',_0x371b('0x59'),'subcategory',_0x371b('0x5a'),_0x371b('0x5b'),_0x371b('0x5c'),_0x371b('0x5d'),_0x371b('0x5e')];var _0x2ede0b=[_0x371b('0x5f'),_0x371b('0x58'),_0x371b('0x60'),_0x371b('0x61'),_0x371b('0x62'),'sys_updated_on',_0x371b('0x63'),_0x371b('0x64'),_0x371b('0x65'),'number',_0x371b('0x66'),'sys_updated_by',_0x371b('0x67'),_0x371b('0x68'),_0x371b('0x69'),_0x371b('0x6a'),_0x371b('0x6b'),_0x371b('0x6c'),'knowledge',_0x371b('0x36'),_0x371b('0x6d'),_0x371b('0x6e'),'cmdb_ci',_0x371b('0x6f'),_0x371b('0x70'),_0x371b('0x71'),_0x371b('0x72'),'business_service',_0x371b('0x73'),_0x371b('0x74'),_0x371b('0x75'),_0x371b('0x76'),_0x371b('0x77'),'opened_at',_0x371b('0x78'),_0x371b('0x79'),_0x371b('0x7a'),_0x371b('0x7b'),'resolved_at',_0x371b('0x7c'),_0x371b('0x7d'),_0x371b('0x7e'),'work_notes',_0x371b('0x7f'),_0x371b('0x5a'),_0x371b('0x80'),_0x371b('0x81'),_0x371b('0x82'),_0x371b('0x83'),_0x371b('0x84'),_0x371b('0x85'),_0x371b('0x86'),_0x371b('0x87'),_0x371b('0x5b'),'sys_class_name',_0x371b('0x88'),_0x371b('0x89'),_0x371b('0x8a'),_0x371b('0x8b'),_0x371b('0x8c'),'contact_type',_0x371b('0x8d'),_0x371b('0x5c'),_0x371b('0x8e'),'problem_id',_0x371b('0x8f'),'reassignment_count',_0x371b('0x90'),'assigned_to',_0x371b('0x5d'),_0x371b('0x91'),_0x371b('0x92'),_0x371b('0x93'),_0x371b('0x94'),'due_date',_0x371b('0x95'),_0x371b('0x96'),_0x371b('0x97'),'escalation',_0x371b('0x98'),_0x371b('0x99'),_0x371b('0x9a'),_0x371b('0x5e')];var _0x1aa746='';var _0x1b2609='';var _0x12345b=[];var _0x2fae3c='';var _0x8f54c8='';var _0x511378=[];var _0x3e5ecd='';var _0x562918='';var _0x35510a={};var _0x562dc8='';return db[_0x371b('0x2b')][_0x371b('0x4c')]({'where':{'id':_0x34f3d9[_0x371b('0x43')]['id']},'attributes':['id',_0x371b('0x9b'),_0x371b('0x9c'),_0x371b('0x9d'),'remoteUri','serverUrl']})[_0x371b('0x3f')](handleEntityNotFound(_0x20a975,null))[_0x371b('0x3f')](function(_0x2ad71c){if(_0x2ad71c){_0x562dc8=_0x2ad71c[_0x371b('0x9e')];var _0x5f3956=_0x562dc8[_0x371b('0x9f')](-0x1);if(_0x5f3956==='/'){_0x562dc8=_0x562dc8[_0x371b('0xa0')](0x0,_0x562dc8[_0x371b('0xa1')](_0x5f3956));}_0x562918=util[_0x371b('0xa2')](_0x371b('0xa3'),_0x562dc8);_0x3e5ecd=util['format']('%s/api/now/table/',_0x562dc8);_0x35510a={'user':_0x2ad71c[_0x371b('0x9b')],'pass':_0x2ad71c[_0x371b('0x9c')]};var _0x19f56a={'method':_0x371b('0xa4'),'uri':_0x562918+_0x371b('0xa5'),'auth':_0x35510a,'json':!![]};return rp(_0x19f56a);}})[_0x371b('0x3f')](function(_0x2cbea2){if(_0x2cbea2[_0x371b('0xa6')][_0x371b('0x34')]>0x0){_0x1aa746=_0x2cbea2[_0x371b('0xa6')];}console['log'](_0x371b('0xa7'),_0x1aa746);_0x511378=[];_0x1b2609=Object[_0x371b('0xa8')]([],_0x1aa746);_[_0x371b('0xa9')](_0x1b2609,function(_0x7fd2be){return!_0x51db1b[_0x371b('0xaa')](_0x7fd2be['name']);});_0x1b2609[_0x371b('0xab')](function(_0x281074){var _0x2e9265=createFieldObject(_0x3e5ecd,_0x35510a,_0x281074[_0x371b('0xac')],_0x281074[_0x371b('0x28')],_0x281074[_0x371b('0xad')],![]);_0x511378[_0x371b('0xae')](_0x2e9265);});return Promise['all'](_0x511378);})[_0x371b('0x3f')](function(_0x49e320){_0x12345b=_0x49e320;_0x2fae3c=Object[_0x371b('0xa8')]([],_0x1aa746);console['log'](_0x371b('0xaf'),_0x1aa746);_['remove'](_0x2fae3c,function(_0x27d00e){return _0x2ede0b[_0x371b('0xaa')](_0x27d00e[_0x371b('0x28')]);});console[_0x371b('0xb0')](_0x371b('0xb1'),_0x2fae3c);_0x511378=[];_0x2fae3c['forEach'](function(_0x3e322c){var _0xd1434e=createFieldObject(_0x3e5ecd,_0x35510a,_0x3e322c[_0x371b('0xac')],_0x3e322c[_0x371b('0x28')],_0x3e322c[_0x371b('0xad')],!![]);_0x511378[_0x371b('0xae')](_0xd1434e);});return Promise['all'](_0x511378);})[_0x371b('0x3f')](function(_0x323fad){_0x8f54c8=_0x323fad;var _0x1e711c=_0x12345b['concat'](_0x8f54c8);return{'count':_0x1e711c[_0x371b('0x34')],'rows':_0x1e711c};})[_0x371b('0x3f')](respondWithResult(_0x20a975,null))[_0x371b('0x47')](function(_0x58ff95){console['log'](_0x371b('0xb2')+_0x58ff95);var _0x2b148d=_0x34f3d9[_0x371b('0x30')][_0x371b('0xb3')]?0x1f4:_0x58ff95[_0x371b('0xb4')]||0x1f4;logger[_0x371b('0x26')](_0x58ff95[_0x371b('0x27')]);delete _0x58ff95[_0x371b('0x28')];if(_0x2b148d===0x191){_0x2b148d=0x190;}_0x20a975[_0x371b('0x25')](_0x2b148d)['send'](_0x34f3d9[_0x371b('0x30')]['test']?{'message':_0x371b('0xb5'),'statusCode':_0x58ff95[_0x371b('0xb4')]}:_0x58ff95);});};function createFieldObject(_0x5bc0d2,_0x4b21b9,_0x56c34e,_0x5a783e,_0x87d214,_0x486d10){return new Promise(function(_0x16c490,_0x3ede9c){var _0x54c030={'id':_0x5a783e,'name':_0x87d214,'custom':_0x486d10};if(_0x56c34e==='boolean'){_0x54c030[_0x371b('0x3e')]=[{'name':_0x371b('0xb6'),'value':_0x371b('0xb7')},{'name':_0x371b('0xb8'),'value':_0x371b('0xb9')}];_0x16c490(_0x54c030);}else{var _0x249099={'method':_0x371b('0xa4'),'uri':_0x5bc0d2+'sys_choice?sysparm_query=name=incident^element='+_0x5a783e,'auth':_0x4b21b9,'json':!![]};return rp(_0x249099)[_0x371b('0x3f')](function(_0x34dae2){var _0x4b9f52=[];if(_0x34dae2[_0x371b('0xa6')]['length']>0x0){_0x34dae2['result']['forEach'](function(_0x49dcb2){if(_0x49dcb2[_0x371b('0xba')]===_0x371b('0xb9')){var _0x1d0c41={'name':_0x49dcb2[_0x371b('0xad')],'value':_0x49dcb2[_0x371b('0xbb')]};_0x4b9f52[_0x371b('0xae')](_0x1d0c41);}});}_0x54c030[_0x371b('0x3e')]=_0x4b9f52;if(_0x54c030[_0x371b('0x3e')][_0x371b('0x34')]>0x0){_0x16c490(_0x54c030);}else{if(_0x486d10==![]){_0x16c490();}else{_0x16c490(_0x54c030);}}});}});} \ No newline at end of file +var _0x45c8=['value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','find','catch','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','sort','options','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','push','concat','ServiceNow\x20error:\x20','test','statusCode','True','true','false'];(function(_0x3b875f,_0x456f92){var _0x26d6a4=function(_0x5ace03){while(--_0x5ace03){_0x3b875f['push'](_0x3b875f['shift']());}};_0x26d6a4(++_0x456f92);}(_0x45c8,0xc0));var _0x845c=function(_0x13d6bd,_0x216a7b){_0x13d6bd=_0x13d6bd-0x0;var _0x2736cb=_0x45c8[_0x13d6bd];return _0x2736cb;};'use strict';var emlformat=require(_0x845c('0x0'));var rimraf=require(_0x845c('0x1'));var zipdir=require(_0x845c('0x2'));var jsonpatch=require(_0x845c('0x3'));var rp=require('request-promise');var moment=require(_0x845c('0x4'));var BPromise=require(_0x845c('0x5'));var Mustache=require(_0x845c('0x6'));var util=require(_0x845c('0x7'));var path=require(_0x845c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x845c('0x9'));var fs=require('fs');var fs_extra=require(_0x845c('0xa'));var _=require(_0x845c('0xb'));var squel=require('squel');var crypto=require(_0x845c('0xc'));var jsforce=require(_0x845c('0xd'));var deskjs=require(_0x845c('0xe'));var toCsv=require(_0x845c('0xf'));var querystring=require('querystring');var Papa=require(_0x845c('0x10'));var Redis=require(_0x845c('0x11'));var authService=require(_0x845c('0x12'));var qs=require(_0x845c('0x13'));var as=require(_0x845c('0x14'));var hardwareService=require(_0x845c('0x15'));var logger=require(_0x845c('0x16'))(_0x845c('0x17'));var utils=require(_0x845c('0x18'));var config=require(_0x845c('0x19'));var licenseUtil=require(_0x845c('0x1a'));var db=require(_0x845c('0x1b'))['db'];var integrations=require(_0x845c('0x1c'));function respondWithStatusCode(_0x30f632,_0x3ffd26){_0x3ffd26=_0x3ffd26||0xcc;return function(_0x1bee57){if(_0x1bee57){return _0x30f632[_0x845c('0x1d')](_0x3ffd26);}return _0x30f632[_0x845c('0x1e')](_0x3ffd26)[_0x845c('0x1f')]();};}function respondWithResult(_0x2ed9a7,_0x284694){_0x284694=_0x284694||0xc8;return function(_0x394e1e){if(_0x394e1e){return _0x2ed9a7['status'](_0x284694)[_0x845c('0x20')](_0x394e1e);}};}function respondWithFilteredResult(_0x339914,_0x24bf01){return function(_0x30b7a3){if(_0x30b7a3){var _0x12b483=typeof _0x24bf01[_0x845c('0x21')]===_0x845c('0x22')&&typeof _0x24bf01[_0x845c('0x23')]===_0x845c('0x22');var _0x1b4904=_0x30b7a3[_0x845c('0x24')];var _0x41397b=_0x12b483?0x0:_0x24bf01[_0x845c('0x21')];var _0x2bb0c1=_0x12b483?_0x30b7a3[_0x845c('0x24')]:_0x24bf01['offset']+_0x24bf01[_0x845c('0x23')];var _0x3fc1dd;if(_0x2bb0c1>=_0x1b4904){_0x2bb0c1=_0x1b4904;_0x3fc1dd=0xc8;}else{_0x3fc1dd=0xce;}_0x339914['status'](_0x3fc1dd);return _0x339914['set'](_0x845c('0x25'),_0x41397b+'-'+_0x2bb0c1+'/'+_0x1b4904)['json'](_0x30b7a3);}return null;};}function patchUpdates(_0x28cc1b){return function(_0x1905a2){try{jsonpatch[_0x845c('0x26')](_0x1905a2,_0x28cc1b,!![]);}catch(_0x1e0a0f){return BPromise[_0x845c('0x27')](_0x1e0a0f);}return _0x1905a2['save']();};}function saveUpdates(_0x22242c,_0x4f64d3){return function(_0x256842){if(_0x256842){return _0x256842[_0x845c('0x28')](_0x22242c)[_0x845c('0x29')](function(_0x53ff14){return _0x53ff14;});}return null;};}function removeEntity(_0x494431,_0x4a3799){return function(_0x2e52dd){if(_0x2e52dd){return _0x2e52dd['destroy']()[_0x845c('0x29')](function(){_0x494431['status'](0xcc)[_0x845c('0x1f')]();});}};}function handleEntityNotFound(_0x349393,_0x21b5b3){return function(_0x5317e2){if(!_0x5317e2){_0x349393[_0x845c('0x1d')](0x194);}return _0x5317e2;};}function handleError(_0x178903,_0x432809){_0x432809=_0x432809||0x1f4;return function(_0x2c1f0c){logger[_0x845c('0x2a')](_0x2c1f0c[_0x845c('0x2b')]);if(_0x2c1f0c[_0x845c('0x2c')]){delete _0x2c1f0c['name'];}_0x178903[_0x845c('0x1e')](_0x432809)[_0x845c('0x2d')](_0x2c1f0c);};}exports[_0x845c('0x2e')]=function(_0x1d88b3,_0x15251c){var _0x41bb6d={},_0xcb1af4={},_0x58c02c={'count':0x0,'rows':[]};var _0x78b601=_['map'](db[_0x845c('0x2f')][_0x845c('0x30')],function(_0x4450db){return{'name':_0x4450db[_0x845c('0x31')],'type':_0x4450db[_0x845c('0x32')][_0x845c('0x33')]};});_0xcb1af4[_0x845c('0x34')]=_[_0x845c('0x35')](_0x78b601,'name');_0xcb1af4[_0x845c('0x36')]=_[_0x845c('0x37')](_0x1d88b3[_0x845c('0x36')]);_0xcb1af4[_0x845c('0x38')]=_['intersection'](_0xcb1af4[_0x845c('0x34')],_0xcb1af4[_0x845c('0x36')]);_0x41bb6d[_0x845c('0x39')]=_[_0x845c('0x3a')](_0xcb1af4[_0x845c('0x34')],qs[_0x845c('0x3b')](_0x1d88b3['query']['fields']));_0x41bb6d[_0x845c('0x39')]=_0x41bb6d[_0x845c('0x39')][_0x845c('0x3c')]?_0x41bb6d[_0x845c('0x39')]:_0xcb1af4[_0x845c('0x34')];if(!_0x1d88b3[_0x845c('0x36')][_0x845c('0x3d')](_0x845c('0x3e'))){_0x41bb6d[_0x845c('0x23')]=qs['limit'](_0x1d88b3['query'][_0x845c('0x23')]);_0x41bb6d[_0x845c('0x21')]=qs['offset'](_0x1d88b3['query'][_0x845c('0x21')]);}_0x41bb6d[_0x845c('0x3f')]=qs['sort'](_0x1d88b3[_0x845c('0x36')]['sort']);_0x41bb6d[_0x845c('0x40')]=qs[_0x845c('0x38')](_[_0x845c('0x41')](_0x1d88b3[_0x845c('0x36')],_0xcb1af4[_0x845c('0x38')]),_0x78b601);if(_0x1d88b3['query'][_0x845c('0x42')]){_0x41bb6d['where']=_[_0x845c('0x43')](_0x41bb6d['where'],{'$or':_[_0x845c('0x35')](_0x78b601,function(_0x579f48){if(_0x579f48['type']!==_0x845c('0x44')){var _0x44e0e7={};_0x44e0e7[_0x579f48[_0x845c('0x2c')]]={'$like':'%'+_0x1d88b3[_0x845c('0x36')][_0x845c('0x42')]+'%'};return _0x44e0e7;}})});}_0x41bb6d=_[_0x845c('0x43')]({},_0x41bb6d,_0x1d88b3['options']);var _0x3a6ab1={'where':_0x41bb6d[_0x845c('0x40')]};return db['ServicenowAccount'][_0x845c('0x24')](_0x3a6ab1)['then'](function(_0x20990b){_0x58c02c[_0x845c('0x24')]=_0x20990b;if(_0x1d88b3[_0x845c('0x36')][_0x845c('0x45')]){_0x41bb6d[_0x845c('0x46')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x845c('0x47')](_0x41bb6d);})['then'](function(_0x34f98a){_0x58c02c['rows']=_0x34f98a;return _0x58c02c;})[_0x845c('0x29')](respondWithFilteredResult(_0x15251c,_0x41bb6d))['catch'](handleError(_0x15251c,null));};exports['show']=function(_0x4ae93c,_0x24cb6a){var _0x2ceaf6={'raw':![],'where':{'id':_0x4ae93c[_0x845c('0x48')]['id']}},_0x5d3da2={};_0x5d3da2['model']=_[_0x845c('0x37')](db[_0x845c('0x2f')][_0x845c('0x30')]);_0x5d3da2[_0x845c('0x36')]=_[_0x845c('0x37')](_0x4ae93c[_0x845c('0x36')]);_0x5d3da2['filters']=_['intersection'](_0x5d3da2[_0x845c('0x34')],_0x5d3da2[_0x845c('0x36')]);_0x2ceaf6[_0x845c('0x39')]=_[_0x845c('0x3a')](_0x5d3da2[_0x845c('0x34')],qs['fields'](_0x4ae93c[_0x845c('0x36')][_0x845c('0x3b')]));_0x2ceaf6[_0x845c('0x39')]=_0x2ceaf6[_0x845c('0x39')]['length']?_0x2ceaf6[_0x845c('0x39')]:_0x5d3da2[_0x845c('0x34')];if(_0x4ae93c[_0x845c('0x36')]['includeAll']){_0x2ceaf6[_0x845c('0x46')]=[{'all':!![]}];}_0x2ceaf6=_[_0x845c('0x43')]({},_0x2ceaf6,_0x4ae93c['options']);return db[_0x845c('0x2f')][_0x845c('0x49')](_0x2ceaf6)[_0x845c('0x29')](handleEntityNotFound(_0x24cb6a,null))[_0x845c('0x29')](respondWithResult(_0x24cb6a,null))[_0x845c('0x4a')](handleError(_0x24cb6a,null));};exports[_0x845c('0x4b')]=function(_0x234390,_0x307b56){return db[_0x845c('0x2f')][_0x845c('0x4b')](_0x234390['body'],{})[_0x845c('0x29')](respondWithResult(_0x307b56,0xc9))[_0x845c('0x4a')](handleError(_0x307b56,null));};exports[_0x845c('0x28')]=function(_0x3f7a98,_0x2654ac){if(_0x3f7a98[_0x845c('0x4c')]['id']){delete _0x3f7a98[_0x845c('0x4c')]['id'];}return db[_0x845c('0x2f')]['find']({'where':{'id':_0x3f7a98[_0x845c('0x48')]['id']}})[_0x845c('0x29')](handleEntityNotFound(_0x2654ac,null))[_0x845c('0x29')](saveUpdates(_0x3f7a98['body'],null))['then'](respondWithResult(_0x2654ac,null))[_0x845c('0x4a')](handleError(_0x2654ac,null));};exports[_0x845c('0x4d')]=function(_0x2e14c9,_0x2b6a8d){return db[_0x845c('0x2f')][_0x845c('0x49')]({'where':{'id':_0x2e14c9[_0x845c('0x48')]['id']}})[_0x845c('0x29')](handleEntityNotFound(_0x2b6a8d,null))[_0x845c('0x29')](removeEntity(_0x2b6a8d,null))[_0x845c('0x4a')](handleError(_0x2b6a8d,null));};exports[_0x845c('0x4e')]=function(_0x1726c4,_0x23cd85,_0x19372b){var _0x3212be={};var _0x5d30b5={};var _0x2980bc;var _0x458964;return db['ServicenowAccount'][_0x845c('0x4f')]({'where':{'id':_0x1726c4[_0x845c('0x48')]['id']}})[_0x845c('0x29')](handleEntityNotFound(_0x23cd85,null))[_0x845c('0x29')](function(_0x4fb102){if(_0x4fb102){_0x2980bc=_0x4fb102;_0x5d30b5[_0x845c('0x34')]=_['keys'](db[_0x845c('0x50')][_0x845c('0x30')]);_0x5d30b5[_0x845c('0x36')]=_[_0x845c('0x37')](_0x1726c4[_0x845c('0x36')]);_0x5d30b5[_0x845c('0x38')]=_[_0x845c('0x3a')](_0x5d30b5[_0x845c('0x34')],_0x5d30b5[_0x845c('0x36')]);_0x3212be['attributes']=_['intersection'](_0x5d30b5[_0x845c('0x34')],qs[_0x845c('0x3b')](_0x1726c4[_0x845c('0x36')][_0x845c('0x3b')]));_0x3212be['attributes']=_0x3212be[_0x845c('0x39')][_0x845c('0x3c')]?_0x3212be[_0x845c('0x39')]:_0x5d30b5[_0x845c('0x34')];_0x3212be[_0x845c('0x3f')]=qs[_0x845c('0x51')](_0x1726c4[_0x845c('0x36')]['sort']);_0x3212be[_0x845c('0x40')]=qs[_0x845c('0x38')](_[_0x845c('0x41')](_0x1726c4[_0x845c('0x36')],_0x5d30b5[_0x845c('0x38')]));if(_0x1726c4[_0x845c('0x36')][_0x845c('0x42')]){_0x3212be[_0x845c('0x40')]=_[_0x845c('0x43')](_0x3212be[_0x845c('0x40')],{'$or':_[_0x845c('0x35')](_0x3212be['attributes'],function(_0x319eca){var _0x4a83ec={};_0x4a83ec[_0x319eca]={'$like':'%'+_0x1726c4[_0x845c('0x36')][_0x845c('0x42')]+'%'};return _0x4a83ec;})});}_0x3212be=_[_0x845c('0x43')]({},_0x3212be,_0x1726c4[_0x845c('0x52')]);return _0x2980bc['getConfigurations'](_0x3212be);}})[_0x845c('0x29')](function(_0x134eea){if(_0x134eea){_0x458964=_0x134eea[_0x845c('0x3c')];if(!_0x1726c4[_0x845c('0x36')][_0x845c('0x3d')]('nolimit')){_0x3212be['limit']=qs[_0x845c('0x23')](_0x1726c4['query'][_0x845c('0x23')]);_0x3212be[_0x845c('0x21')]=qs[_0x845c('0x21')](_0x1726c4['query']['offset']);}return _0x2980bc[_0x845c('0x4e')](_0x3212be);}})[_0x845c('0x29')](function(_0xe1e79b){if(_0xe1e79b){return _0xe1e79b?{'count':_0x458964,'rows':_0xe1e79b}:null;}})[_0x845c('0x29')](respondWithResult(_0x23cd85,null))[_0x845c('0x4a')](handleError(_0x23cd85,null));};exports['addConfiguration']=function(_0x306a95,_0x44281c,_0x486810){if(_0x306a95['body']['id']){delete _0x306a95[_0x845c('0x4c')]['id'];}return db['ServicenowAccount'][_0x845c('0x4f')]({'where':{'id':_0x306a95[_0x845c('0x48')]['id']}})['then'](handleEntityNotFound(_0x44281c,null))['then'](function(_0x55c5b3){if(_0x55c5b3){_0x306a95[_0x845c('0x4c')][_0x845c('0x53')]=_0x55c5b3['id'];_0x306a95[_0x845c('0x4c')][_0x845c('0x54')]=integrations[_0x845c('0x55')](_0x306a95[_0x845c('0x4c')]['channel'],_0x306a95[_0x845c('0x4c')][_0x845c('0x32')]);_0x306a95['body'][_0x845c('0x56')]=integrations[_0x845c('0x57')](_0x306a95[_0x845c('0x4c')][_0x845c('0x58')],_0x306a95[_0x845c('0x4c')][_0x845c('0x32')]);return db[_0x845c('0x50')]['create'](_0x306a95[_0x845c('0x4c')],{'include':[{'model':db[_0x845c('0x59')],'as':_0x845c('0x54')},{'model':db[_0x845c('0x59')],'as':_0x845c('0x56')}]});}return null;})[_0x845c('0x29')](respondWithResult(_0x44281c,null))['catch'](handleError(_0x44281c,null));};exports[_0x845c('0x5a')]=function(_0x43b4a7,_0x3f3cea,_0x4dab86){var _0x24128b=[_0x845c('0x5b'),_0x845c('0x5c'),_0x845c('0x5d'),'subcategory','close_code','notify',_0x845c('0x5e'),_0x845c('0x5f'),_0x845c('0x60')];var _0x575279=[_0x845c('0x61'),_0x845c('0x5b'),'caused_by',_0x845c('0x62'),_0x845c('0x63'),_0x845c('0x64'),_0x845c('0x65'),_0x845c('0x5c'),'approval_history',_0x845c('0x66'),_0x845c('0x67'),_0x845c('0x68'),_0x845c('0x69'),'user_input',_0x845c('0x6a'),_0x845c('0x6b'),_0x845c('0x6c'),_0x845c('0x6d'),_0x845c('0x5d'),'order',_0x845c('0x6e'),_0x845c('0x6f'),_0x845c('0x70'),_0x845c('0x71'),_0x845c('0x72'),_0x845c('0x73'),_0x845c('0x74'),'business_service',_0x845c('0x75'),_0x845c('0x76'),_0x845c('0x77'),'time_worked','expected_start','opened_at','business_duration',_0x845c('0x78'),_0x845c('0x79'),_0x845c('0x7a'),_0x845c('0x7b'),_0x845c('0x7c'),_0x845c('0x7d'),_0x845c('0x7e'),_0x845c('0x7f'),_0x845c('0x80'),_0x845c('0x81'),_0x845c('0x82'),_0x845c('0x83'),_0x845c('0x84'),_0x845c('0x85'),'business_stc',_0x845c('0x86'),_0x845c('0x87'),_0x845c('0x88'),_0x845c('0x89'),_0x845c('0x8a'),'close_notes',_0x845c('0x8b'),_0x845c('0x8c'),_0x845c('0x8d'),_0x845c('0x8e'),_0x845c('0x8f'),_0x845c('0x90'),_0x845c('0x5e'),_0x845c('0x91'),_0x845c('0x92'),_0x845c('0x93'),_0x845c('0x94'),_0x845c('0x95'),_0x845c('0x96'),_0x845c('0x5f'),'comments',_0x845c('0x97'),_0x845c('0x98'),_0x845c('0x99'),'due_date',_0x845c('0x9a'),'reopen_count',_0x845c('0x9b'),'escalation',_0x845c('0x9c'),_0x845c('0x9d'),_0x845c('0x9e'),'category'];var _0x2e2390='';var _0x40cea4='';var _0x4df03e=[];var _0x81f0ff='';var _0x7768da='';var _0x4fee97=[];var _0x38eacc='';var _0x50727c='';var _0x40a490={};var _0x1b6daf='';return db[_0x845c('0x2f')][_0x845c('0x4f')]({'where':{'id':_0x43b4a7[_0x845c('0x48')]['id']},'attributes':['id',_0x845c('0x9f'),_0x845c('0xa0'),_0x845c('0xa1'),_0x845c('0xa2'),_0x845c('0xa3')]})[_0x845c('0x29')](handleEntityNotFound(_0x3f3cea,null))[_0x845c('0x29')](function(_0x341879){if(_0x341879){_0x1b6daf=_0x341879[_0x845c('0xa2')];var _0x555f48=_0x1b6daf[_0x845c('0xa4')](-0x1);if(_0x555f48==='/'){_0x1b6daf=_0x1b6daf[_0x845c('0xa5')](0x0,_0x1b6daf['lastIndexOf'](_0x555f48));}_0x50727c=util['format'](_0x845c('0xa6'),_0x1b6daf);_0x38eacc=util[_0x845c('0xa7')](_0x845c('0xa8'),_0x1b6daf);_0x40a490={'user':_0x341879[_0x845c('0x9f')],'pass':_0x341879[_0x845c('0xa0')]};var _0x2e93dc={'method':_0x845c('0xa9'),'uri':_0x50727c+'incident?sysparm_display_value=all','auth':_0x40a490,'json':!![]};return rp(_0x2e93dc);}})['then'](function(_0x496c48){if(_0x496c48[_0x845c('0xaa')][_0x845c('0x3c')]>0x0){_0x2e2390=_0x496c48[_0x845c('0xaa')];}console['log'](_0x845c('0xab'),_0x2e2390);_0x4fee97=[];_0x40cea4=Object[_0x845c('0xac')]([],_0x2e2390);_[_0x845c('0xad')](_0x40cea4,function(_0x518805){return!_0x24128b[_0x845c('0xae')](_0x518805[_0x845c('0x2c')]);});_0x40cea4['forEach'](function(_0x586e65){var _0x3ca641=createFieldObject(_0x38eacc,_0x40a490,_0x586e65[_0x845c('0xaf')],_0x586e65[_0x845c('0x2c')],_0x586e65[_0x845c('0xb0')],![]);_0x4fee97['push'](_0x3ca641);});return Promise[_0x845c('0xb1')](_0x4fee97);})[_0x845c('0x29')](function(_0x1a2663){_0x4df03e=_0x1a2663;_0x81f0ff=Object[_0x845c('0xac')]([],_0x2e2390);console[_0x845c('0xb2')](_0x845c('0xb3'),_0x2e2390);_[_0x845c('0xad')](_0x81f0ff,function(_0x254726){return _0x575279['includes'](_0x254726[_0x845c('0x2c')]);});console[_0x845c('0xb2')](_0x845c('0xb4'),_0x81f0ff);_0x4fee97=[];_0x81f0ff[_0x845c('0xb5')](function(_0x37ca02){var _0x2f1171=createFieldObject(_0x38eacc,_0x40a490,_0x37ca02[_0x845c('0xaf')],_0x37ca02[_0x845c('0x2c')],_0x37ca02[_0x845c('0xb0')],!![]);_0x4fee97[_0x845c('0xb6')](_0x2f1171);});return Promise[_0x845c('0xb1')](_0x4fee97);})[_0x845c('0x29')](function(_0x3538e8){_0x7768da=_0x3538e8;var _0xf5632b=_0x4df03e[_0x845c('0xb7')](_0x7768da);return{'count':_0xf5632b['length'],'rows':_0xf5632b};})[_0x845c('0x29')](respondWithResult(_0x3f3cea,null))[_0x845c('0x4a')](function(_0x324f1d){console[_0x845c('0xb2')](_0x845c('0xb8')+_0x324f1d);var _0x3aaac5=_0x43b4a7[_0x845c('0x36')][_0x845c('0xb9')]?0x1f4:_0x324f1d[_0x845c('0xba')]||0x1f4;logger[_0x845c('0x2a')](_0x324f1d[_0x845c('0x2b')]);delete _0x324f1d[_0x845c('0x2c')];if(_0x3aaac5===0x191){_0x3aaac5=0x190;}_0x3f3cea[_0x845c('0x1e')](_0x3aaac5)[_0x845c('0x2d')](_0x43b4a7['query'][_0x845c('0xb9')]?{'message':'Wrong\x20credentials','statusCode':_0x324f1d['statusCode']}:_0x324f1d);});};function createFieldObject(_0x402bea,_0x4dacbb,_0x2900a8,_0x27589e,_0x1f5cc0,_0x4ad611){return new Promise(function(_0x1f3ec2,_0x881c56){var _0x364ca8={'id':_0x27589e,'name':_0x1f5cc0,'custom':_0x4ad611};if(_0x2900a8==='boolean'){_0x364ca8[_0x845c('0x52')]=[{'name':_0x845c('0xbb'),'value':_0x845c('0xbc')},{'name':'False','value':_0x845c('0xbd')}];_0x1f3ec2(_0x364ca8);}else{var _0x40d85e={'method':_0x845c('0xa9'),'uri':_0x402bea+'sys_choice?sysparm_query=name=incident^element='+_0x27589e,'auth':_0x4dacbb,'json':!![]};return rp(_0x40d85e)['then'](function(_0x2a23a1){var _0x1ab412=[];if(_0x2a23a1['result'][_0x845c('0x3c')]>0x0){_0x2a23a1[_0x845c('0xaa')]['forEach'](function(_0x5d7ca6){if(_0x5d7ca6['inactive']==='false'){var _0x292b88={'name':_0x5d7ca6['label'],'value':_0x5d7ca6[_0x845c('0xbe')]};_0x1ab412['push'](_0x292b88);}});}_0x364ca8[_0x845c('0x52')]=_0x1ab412;if(_0x364ca8[_0x845c('0x52')][_0x845c('0x3c')]>0x0){_0x1f3ec2(_0x364ca8);}else{if(_0x4ad611==![]){_0x1f3ec2();}else{_0x1f3ec2(_0x364ca8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c36e4b5..5a3333e 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x7a54,0x106));var _0x47a5=function(_0x1f4b41,_0x3aadc5){_0x1f4b41=_0x1f4b41-0x0;var _0x191924=_0x7a54[_0x1f4b41];return _0x191924;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc97=['request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','util','../../config/logger','moment'];(function(_0x2f1cf8,_0x45b3fa){var _0x58d3f0=function(_0x16934f){while(--_0x16934f){_0x2f1cf8['push'](_0x2f1cf8['shift']());}};_0x58d3f0(++_0x45b3fa);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5244f,_0x364747){_0x5244f=_0x5244f-0x0;var _0x364623=_0xdc97[_0x5244f];return _0x364623;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));var integrations=require(_0x7dc9('0x8'));module[_0x7dc9('0x9')]=function(_0x589f02,_0x2636ef){return _0x589f02['define']('ServicenowAccount',attributes,{'tableName':_0x7dc9('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 fed254f..b14a86d 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 _0xbe72=['model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ServicenowAccount','findAll','options','where','attributes','limit','include','GetServicenowAccount','ShowServicenowAccount','find','map'];(function(_0x350ade,_0x405713){var _0x3eb8bf=function(_0x3db7c1){while(--_0x3db7c1){_0x350ade['push'](_0x350ade['shift']());}};_0x3eb8bf(++_0x405713);}(_0xbe72,0x13d));var _0x2be7=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xbe72[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x2be7('0x0'));var util=require(_0x2be7('0x1'));var moment=require(_0x2be7('0x2'));var BPromise=require(_0x2be7('0x3'));var rs=require(_0x2be7('0x4'));var fs=require('fs');var Redis=require(_0x2be7('0x5'));var db=require(_0x2be7('0x6'))['db'];var utils=require(_0x2be7('0x7'));var logger=require(_0x2be7('0x8'))(_0x2be7('0x9'));var config=require('../../config/environment');var jayson=require(_0x2be7('0xa'));var client=jayson[_0x2be7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cb6f2,_0x4c7966,_0xfa8c1a){return new BPromise(function(_0x4a8549,_0x3be39b){return client[_0x2be7('0xc')](_0x4cb6f2,_0xfa8c1a)['then'](function(_0x7d69e4){logger[_0x2be7('0xd')](_0x2be7('0xe'),_0x4c7966,_0x2be7('0xf'));logger[_0x2be7('0x10')](_0x2be7('0x11'),_0x4c7966,_0x2be7('0xf'),JSON[_0x2be7('0x12')](_0x7d69e4));if(_0x7d69e4[_0x2be7('0x13')]){if(_0x7d69e4[_0x2be7('0x13')]['code']===0x1f4){logger[_0x2be7('0x13')](_0x2be7('0xe'),_0x4c7966,_0x7d69e4[_0x2be7('0x13')][_0x2be7('0x14')]);return _0x3be39b(_0x7d69e4[_0x2be7('0x13')][_0x2be7('0x14')]);}logger[_0x2be7('0x13')](_0x2be7('0xe'),_0x4c7966,_0x7d69e4[_0x2be7('0x13')][_0x2be7('0x14')]);return _0x4a8549(_0x7d69e4[_0x2be7('0x13')][_0x2be7('0x14')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4c7966,_0x2be7('0xf'));_0x4a8549(_0x7d69e4['result'][_0x2be7('0x14')]);}})[_0x2be7('0x15')](function(_0x3cc4ec){logger[_0x2be7('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x4c7966,_0x3cc4ec);_0x3be39b(_0x3cc4ec);});});}exports['GetServicenowAccount']=function(_0x3998fc){var _0x510acc=this;return new Promise(function(_0x63ecf4,_0x41a546){return db[_0x2be7('0x16')][_0x2be7('0x17')]({'raw':_0x3998fc[_0x2be7('0x18')]?_0x3998fc[_0x2be7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3998fc['options']?_0x3998fc[_0x2be7('0x18')][_0x2be7('0x19')]||null:null,'attributes':_0x3998fc[_0x2be7('0x18')]?_0x3998fc[_0x2be7('0x18')][_0x2be7('0x1a')]||null:null,'limit':_0x3998fc[_0x2be7('0x18')]?_0x3998fc[_0x2be7('0x18')][_0x2be7('0x1b')]||null:null,'include':_0x3998fc[_0x2be7('0x18')]?_0x3998fc['options'][_0x2be7('0x1c')]?_['map'](_0x3998fc[_0x2be7('0x18')]['include'],function(_0x5951d0){return{'model':db[_0x5951d0['model']],'as':_0x5951d0['as'],'attributes':_0x5951d0[_0x2be7('0x1a')],'include':_0x5951d0[_0x2be7('0x1c')]?_['map'](_0x5951d0[_0x2be7('0x1c')],function(_0x217dfc){return{'model':db[_0x217dfc['model']],'as':_0x217dfc['as'],'attributes':_0x217dfc[_0x2be7('0x1a')],'include':_0x217dfc[_0x2be7('0x1c')]?_['map'](_0x217dfc[_0x2be7('0x1c')],function(_0x3016ef){return{'model':db[_0x3016ef['model']],'as':_0x3016ef['as'],'attributes':_0x3016ef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1586df){logger['info'](_0x2be7('0x1d'),_0x3998fc);logger[_0x2be7('0x10')](_0x2be7('0x1d'),_0x3998fc,JSON[_0x2be7('0x12')](_0x1586df));_0x63ecf4(_0x1586df);})[_0x2be7('0x15')](function(_0x3d32b9){logger[_0x2be7('0x13')](_0x2be7('0x1d'),_0x3d32b9[_0x2be7('0x14')],_0x3998fc);_0x41a546(_0x510acc[_0x2be7('0x13')](0x1f4,_0x3d32b9[_0x2be7('0x14')]));});});};exports[_0x2be7('0x1e')]=function(_0x20f21){var _0x334e73=this;return new Promise(function(_0x148f63,_0x5713bf){return db[_0x2be7('0x16')][_0x2be7('0x1f')]({'raw':_0x20f21[_0x2be7('0x18')]?_0x20f21[_0x2be7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x20f21[_0x2be7('0x18')]?_0x20f21[_0x2be7('0x18')]['where']||null:null,'attributes':_0x20f21[_0x2be7('0x18')]?_0x20f21[_0x2be7('0x18')]['attributes']||null:null,'include':_0x20f21['options']?_0x20f21[_0x2be7('0x18')]['include']?_[_0x2be7('0x20')](_0x20f21[_0x2be7('0x18')][_0x2be7('0x1c')],function(_0x1c2b07){return{'model':db[_0x1c2b07[_0x2be7('0x21')]],'as':_0x1c2b07['as'],'attributes':_0x1c2b07[_0x2be7('0x1a')],'include':_0x1c2b07[_0x2be7('0x1c')]?_[_0x2be7('0x20')](_0x1c2b07[_0x2be7('0x1c')],function(_0x299150){return{'model':db[_0x299150['model']],'as':_0x299150['as'],'attributes':_0x299150[_0x2be7('0x1a')],'include':_0x299150[_0x2be7('0x1c')]?_[_0x2be7('0x20')](_0x299150[_0x2be7('0x1c')],function(_0x499e55){return{'model':db[_0x499e55[_0x2be7('0x21')]],'as':_0x499e55['as'],'attributes':_0x499e55[_0x2be7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2be7('0x22')](function(_0x3a0f35){logger['info'](_0x2be7('0x1e'),_0x20f21);logger[_0x2be7('0x10')](_0x2be7('0x1e'),_0x20f21,JSON[_0x2be7('0x12')](_0x3a0f35));_0x148f63(_0x3a0f35);})[_0x2be7('0x15')](function(_0x3fa49f){logger['error'](_0x2be7('0x1e'),_0x3fa49f[_0x2be7('0x14')],_0x20f21);_0x5713bf(_0x334e73['error'](0x1f4,_0x3fa49f[_0x2be7('0x14')]));});});}; \ No newline at end of file +var _0xd7f5=['jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','include','map','model','attributes','debug','find','where','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x290638,_0x13ba4d){var _0xff8f4f=function(_0x21a548){while(--_0x21a548){_0x290638['push'](_0x290638['shift']());}};_0xff8f4f(++_0x13ba4d);}(_0xd7f5,0x15f));var _0x5d7f=function(_0x4cd22f,_0x57c3ea){_0x4cd22f=_0x4cd22f-0x0;var _0x2342d3=_0xd7f5[_0x4cd22f];return _0x2342d3;};'use strict';var _=require(_0x5d7f('0x0'));var util=require('util');var moment=require(_0x5d7f('0x1'));var BPromise=require(_0x5d7f('0x2'));var rs=require(_0x5d7f('0x3'));var fs=require('fs');var Redis=require(_0x5d7f('0x4'));var db=require(_0x5d7f('0x5'))['db'];var utils=require(_0x5d7f('0x6'));var logger=require('../../config/logger')(_0x5d7f('0x7'));var config=require(_0x5d7f('0x8'));var jayson=require(_0x5d7f('0x9'));var client=jayson['client'][_0x5d7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fefd1,_0x41ff12,_0x163b9a){return new BPromise(function(_0x164982,_0x4ab826){return client[_0x5d7f('0xb')](_0x1fefd1,_0x163b9a)[_0x5d7f('0xc')](function(_0x5cd8ad){logger[_0x5d7f('0xd')](_0x5d7f('0xe'),_0x41ff12,_0x5d7f('0xf'));logger['debug'](_0x5d7f('0x10'),_0x41ff12,'request\x20sent',JSON[_0x5d7f('0x11')](_0x5cd8ad));if(_0x5cd8ad[_0x5d7f('0x12')]){if(_0x5cd8ad[_0x5d7f('0x12')][_0x5d7f('0x13')]===0x1f4){logger[_0x5d7f('0x12')](_0x5d7f('0xe'),_0x41ff12,_0x5cd8ad['error']['message']);return _0x4ab826(_0x5cd8ad[_0x5d7f('0x12')][_0x5d7f('0x14')]);}logger['error'](_0x5d7f('0xe'),_0x41ff12,_0x5cd8ad[_0x5d7f('0x12')][_0x5d7f('0x14')]);return _0x164982(_0x5cd8ad[_0x5d7f('0x12')][_0x5d7f('0x14')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x41ff12,_0x5d7f('0xf'));_0x164982(_0x5cd8ad[_0x5d7f('0x15')][_0x5d7f('0x14')]);}})[_0x5d7f('0x16')](function(_0x3e3783){logger[_0x5d7f('0x12')](_0x5d7f('0xe'),_0x41ff12,_0x3e3783);_0x4ab826(_0x3e3783);});});}exports[_0x5d7f('0x17')]=function(_0x27894a){var _0x517db0=this;return new Promise(function(_0x2dfb56,_0x3a3184){return db[_0x5d7f('0x18')][_0x5d7f('0x19')]({'raw':_0x27894a[_0x5d7f('0x1a')]?_0x27894a[_0x5d7f('0x1a')][_0x5d7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x27894a[_0x5d7f('0x1a')]?_0x27894a['options']['where']||null:null,'attributes':_0x27894a[_0x5d7f('0x1a')]?_0x27894a[_0x5d7f('0x1a')]['attributes']||null:null,'limit':_0x27894a[_0x5d7f('0x1a')]?_0x27894a[_0x5d7f('0x1a')]['limit']||null:null,'include':_0x27894a[_0x5d7f('0x1a')]?_0x27894a['options'][_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x27894a[_0x5d7f('0x1a')][_0x5d7f('0x1c')],function(_0x4d0f78){return{'model':db[_0x4d0f78[_0x5d7f('0x1e')]],'as':_0x4d0f78['as'],'attributes':_0x4d0f78[_0x5d7f('0x1f')],'include':_0x4d0f78[_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x4d0f78['include'],function(_0x48c665){return{'model':db[_0x48c665[_0x5d7f('0x1e')]],'as':_0x48c665['as'],'attributes':_0x48c665[_0x5d7f('0x1f')],'include':_0x48c665[_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x48c665[_0x5d7f('0x1c')],function(_0x50a2ed){return{'model':db[_0x50a2ed[_0x5d7f('0x1e')]],'as':_0x50a2ed['as'],'attributes':_0x50a2ed[_0x5d7f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b214e){logger[_0x5d7f('0xd')](_0x5d7f('0x17'),_0x27894a);logger[_0x5d7f('0x20')](_0x5d7f('0x17'),_0x27894a,JSON[_0x5d7f('0x11')](_0x3b214e));_0x2dfb56(_0x3b214e);})['catch'](function(_0x56e561){logger[_0x5d7f('0x12')](_0x5d7f('0x17'),_0x56e561[_0x5d7f('0x14')],_0x27894a);_0x3a3184(_0x517db0[_0x5d7f('0x12')](0x1f4,_0x56e561['message']));});});};exports['ShowServicenowAccount']=function(_0x28d555){var _0x395796=this;return new Promise(function(_0x5a09b4,_0x528594){return db[_0x5d7f('0x18')][_0x5d7f('0x21')]({'raw':_0x28d555[_0x5d7f('0x1a')]?_0x28d555['options'][_0x5d7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x28d555['options']?_0x28d555['options'][_0x5d7f('0x22')]||null:null,'attributes':_0x28d555[_0x5d7f('0x1a')]?_0x28d555['options']['attributes']||null:null,'include':_0x28d555[_0x5d7f('0x1a')]?_0x28d555[_0x5d7f('0x1a')][_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x28d555[_0x5d7f('0x1a')]['include'],function(_0x4c3a4a){return{'model':db[_0x4c3a4a[_0x5d7f('0x1e')]],'as':_0x4c3a4a['as'],'attributes':_0x4c3a4a[_0x5d7f('0x1f')],'include':_0x4c3a4a[_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x4c3a4a[_0x5d7f('0x1c')],function(_0x197f5b){return{'model':db[_0x197f5b[_0x5d7f('0x1e')]],'as':_0x197f5b['as'],'attributes':_0x197f5b[_0x5d7f('0x1f')],'include':_0x197f5b[_0x5d7f('0x1c')]?_[_0x5d7f('0x1d')](_0x197f5b['include'],function(_0x4f0345){return{'model':db[_0x4f0345[_0x5d7f('0x1e')]],'as':_0x4f0345['as'],'attributes':_0x4f0345['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d7f('0xc')](function(_0x22dcd6){logger[_0x5d7f('0xd')](_0x5d7f('0x23'),_0x28d555);logger[_0x5d7f('0x20')](_0x5d7f('0x23'),_0x28d555,JSON[_0x5d7f('0x11')](_0x22dcd6));_0x5a09b4(_0x22dcd6);})[_0x5d7f('0x16')](function(_0x540bc2){logger[_0x5d7f('0x12')](_0x5d7f('0x23'),_0x540bc2[_0x5d7f('0x14')],_0x28d555);_0x528594(_0x395796['error'](0x1f4,_0x540bc2[_0x5d7f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c6ddb7b..13d9945 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 _0xd377=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x162ec3,_0x57b556){var _0x450b66=function(_0x5b5502){while(--_0x5b5502){_0x162ec3['push'](_0x162ec3['shift']());}};_0x450b66(++_0x57b556);}(_0xd377,0x147));var _0x7d37=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd377[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x7d37('0x0'));var path=require(_0x7d37('0x1'));var timeout=require(_0x7d37('0x2'));var express=require(_0x7d37('0x3'));var router=express[_0x7d37('0x4')]();var fs_extra=require(_0x7d37('0x5'));var auth=require(_0x7d37('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x7d37('0x7')]('/',auth[_0x7d37('0x8')](),controller[_0x7d37('0x9')]);router[_0x7d37('0x7')](_0x7d37('0xa'),auth[_0x7d37('0x8')](),controller[_0x7d37('0xb')]);router['get'](_0x7d37('0xc'),auth[_0x7d37('0x8')](),controller['getFields']);router['get'](_0x7d37('0xd'),auth[_0x7d37('0x8')](),controller[_0x7d37('0xe')]);router['get'](_0x7d37('0xf'),auth['isAuthenticated'](),controller[_0x7d37('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7d37('0x11')]);router['put']('/:id',auth[_0x7d37('0x8')](),controller[_0x7d37('0x12')]);router[_0x7d37('0x13')](_0x7d37('0xa'),auth['isAuthenticated'](),controller[_0x7d37('0x14')]);module[_0x7d37('0x15')]=router; \ No newline at end of file +var _0xb585=['../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0xb585,0xfe));var _0x5b58=function(_0x3c20e2,_0x562f86){_0x3c20e2=_0x3c20e2-0x0;var _0x5005cd=_0xb585[_0x3c20e2];return _0x5005cd;};'use strict';var multer=require('multer');var util=require(_0x5b58('0x0'));var path=require(_0x5b58('0x1'));var timeout=require(_0x5b58('0x2'));var express=require(_0x5b58('0x3'));var router=express[_0x5b58('0x4')]();var fs_extra=require(_0x5b58('0x5'));var auth=require(_0x5b58('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5b58('0x7'));router[_0x5b58('0x8')]('/',auth[_0x5b58('0x9')](),controller['index']);router['get'](_0x5b58('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5b58('0x8')]('/:id/fields',auth[_0x5b58('0x9')](),controller['getFields']);router['get'](_0x5b58('0xb'),auth[_0x5b58('0x9')](),controller[_0x5b58('0xc')]);router[_0x5b58('0x8')](_0x5b58('0xd'),auth[_0x5b58('0x9')](),controller['getDescriptions']);router[_0x5b58('0xe')]('/',auth[_0x5b58('0x9')](),controller[_0x5b58('0xf')]);router[_0x5b58('0x10')](_0x5b58('0xa'),auth[_0x5b58('0x9')](),controller[_0x5b58('0x11')]);router[_0x5b58('0x12')](_0x5b58('0xa'),auth[_0x5b58('0x9')](),controller[_0x5b58('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 64b6020..796ab2c 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 _0x1133=['STRING','sequelize','exports'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x1133,0xdf));var _0x3113=function(_0x36a875,_0x122167){_0x36a875=_0x36a875-0x0;var _0x457e26=_0x1133[_0x36a875];return _0x457e26;};'use strict';var Sequelize=require(_0x3113('0x0'));module[_0x3113('0x1')]={'name':{'type':Sequelize[_0x3113('0x2')]},'description':{'type':Sequelize[_0x3113('0x2')]}}; \ No newline at end of file +var _0x6e25=['exports','STRING','sequelize'];(function(_0xa25039,_0x2bf601){var _0x3b0776=function(_0x1efc65){while(--_0x1efc65){_0xa25039['push'](_0xa25039['shift']());}};_0x3b0776(++_0x2bf601);}(_0x6e25,0xda));var _0x56e2=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x6e25[_0x438fe1];return _0x3c8e1b;};'use strict';var Sequelize=require(_0x56e2('0x0'));module[_0x56e2('0x1')]={'name':{'type':Sequelize[_0x56e2('0x2')]},'description':{'type':Sequelize[_0x56e2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d295aa4..2799595 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 _0x3873=['rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','findOne','getFields','getSubjects','ServicenowField','nolimit','getDescriptions','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration'];(function(_0x5f3132,_0x1ae3ee){var _0x399950=function(_0x1a7fdc){while(--_0x1a7fdc){_0x5f3132['push'](_0x5f3132['shift']());}};_0x399950(++_0x1ae3ee);}(_0x3873,0x161));var _0x3387=function(_0x15d35c,_0x5ad523){_0x15d35c=_0x15d35c-0x0;var _0x1913fa=_0x3873[_0x15d35c];return _0x1913fa;};'use strict';var emlformat=require(_0x3387('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3387('0x1'));var rp=require('request-promise');var moment=require(_0x3387('0x2'));var BPromise=require(_0x3387('0x3'));var Mustache=require(_0x3387('0x4'));var util=require('util');var path=require(_0x3387('0x5'));var sox=require(_0x3387('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3387('0x7'));var _=require(_0x3387('0x8'));var squel=require('squel');var crypto=require(_0x3387('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3387('0xa'));var toCsv=require(_0x3387('0xb'));var querystring=require(_0x3387('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3387('0xd'));var qs=require(_0x3387('0xe'));var as=require(_0x3387('0xf'));var hardwareService=require(_0x3387('0x10'));var logger=require(_0x3387('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3387('0x12'));var licenseUtil=require(_0x3387('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3263fb,_0x307d7c){_0x307d7c=_0x307d7c||0xcc;return function(_0x3ef876){if(_0x3ef876){return _0x3263fb[_0x3387('0x14')](_0x307d7c);}return _0x3263fb[_0x3387('0x15')](_0x307d7c)[_0x3387('0x16')]();};}function respondWithResult(_0x1cdb84,_0x1627a6){_0x1627a6=_0x1627a6||0xc8;return function(_0x5a84bc){if(_0x5a84bc){return _0x1cdb84[_0x3387('0x15')](_0x1627a6)['json'](_0x5a84bc);}};}function respondWithFilteredResult(_0x654c32,_0x2f58de){return function(_0x43f9f8){if(_0x43f9f8){var _0x122c1c=typeof _0x2f58de[_0x3387('0x17')]==='undefined'&&typeof _0x2f58de['limit']===_0x3387('0x18');var _0x503830=_0x43f9f8['count'];var _0xe79367=_0x122c1c?0x0:_0x2f58de[_0x3387('0x17')];var _0x23dfa2=_0x122c1c?_0x43f9f8[_0x3387('0x19')]:_0x2f58de[_0x3387('0x17')]+_0x2f58de[_0x3387('0x1a')];var _0x16d856;if(_0x23dfa2>=_0x503830){_0x23dfa2=_0x503830;_0x16d856=0xc8;}else{_0x16d856=0xce;}_0x654c32['status'](_0x16d856);return _0x654c32[_0x3387('0x1b')]('Content-Range',_0xe79367+'-'+_0x23dfa2+'/'+_0x503830)[_0x3387('0x1c')](_0x43f9f8);}return null;};}function patchUpdates(_0x2a5a41){return function(_0x3d2a08){try{jsonpatch[_0x3387('0x1d')](_0x3d2a08,_0x2a5a41,!![]);}catch(_0x2657da){return BPromise[_0x3387('0x1e')](_0x2657da);}return _0x3d2a08[_0x3387('0x1f')]();};}function saveUpdates(_0x5dcf79,_0x19ad2d){return function(_0x1084cc){if(_0x1084cc){return _0x1084cc[_0x3387('0x20')](_0x5dcf79)[_0x3387('0x21')](function(_0x41ba71){return _0x41ba71;});}return null;};}function removeEntity(_0x2756cb,_0x3de741){return function(_0x384370){if(_0x384370){return _0x384370[_0x3387('0x22')]()[_0x3387('0x21')](function(){_0x2756cb[_0x3387('0x15')](0xcc)[_0x3387('0x16')]();});}};}function handleEntityNotFound(_0x4322d9,_0x552fef){return function(_0xc5866a){if(!_0xc5866a){_0x4322d9[_0x3387('0x14')](0x194);}return _0xc5866a;};}function handleError(_0x1a2aee,_0x32ed98){_0x32ed98=_0x32ed98||0x1f4;return function(_0x119c67){logger[_0x3387('0x23')](_0x119c67[_0x3387('0x24')]);if(_0x119c67[_0x3387('0x25')]){delete _0x119c67['name'];}_0x1a2aee[_0x3387('0x15')](_0x32ed98)[_0x3387('0x26')](_0x119c67);};}exports[_0x3387('0x27')]=function(_0x58b5a6,_0x22a096){var _0x588697={},_0x53bbe3={},_0xbefae5={'count':0x0,'rows':[]};var _0x56b1f9=_[_0x3387('0x28')](db[_0x3387('0x29')][_0x3387('0x2a')],function(_0x3cd11f){return{'name':_0x3cd11f[_0x3387('0x2b')],'type':_0x3cd11f['type'][_0x3387('0x2c')]};});_0x53bbe3[_0x3387('0x2d')]=_['map'](_0x56b1f9,_0x3387('0x25'));_0x53bbe3[_0x3387('0x2e')]=_[_0x3387('0x2f')](_0x58b5a6[_0x3387('0x2e')]);_0x53bbe3['filters']=_['intersection'](_0x53bbe3[_0x3387('0x2d')],_0x53bbe3['query']);_0x588697[_0x3387('0x30')]=_[_0x3387('0x31')](_0x53bbe3[_0x3387('0x2d')],qs['fields'](_0x58b5a6[_0x3387('0x2e')][_0x3387('0x32')]));_0x588697[_0x3387('0x30')]=_0x588697[_0x3387('0x30')][_0x3387('0x33')]?_0x588697['attributes']:_0x53bbe3[_0x3387('0x2d')];if(!_0x58b5a6['query'][_0x3387('0x34')]('nolimit')){_0x588697[_0x3387('0x1a')]=qs['limit'](_0x58b5a6['query'][_0x3387('0x1a')]);_0x588697[_0x3387('0x17')]=qs[_0x3387('0x17')](_0x58b5a6[_0x3387('0x2e')]['offset']);}_0x588697[_0x3387('0x35')]=qs[_0x3387('0x36')](_0x58b5a6['query']['sort']);_0x588697[_0x3387('0x37')]=qs[_0x3387('0x38')](_[_0x3387('0x39')](_0x58b5a6[_0x3387('0x2e')],_0x53bbe3[_0x3387('0x38')]),_0x56b1f9);if(_0x58b5a6[_0x3387('0x2e')]['filter']){_0x588697[_0x3387('0x37')]=_[_0x3387('0x3a')](_0x588697[_0x3387('0x37')],{'$or':_[_0x3387('0x28')](_0x56b1f9,function(_0x3b5d61){if(_0x3b5d61[_0x3387('0x3b')]!==_0x3387('0x3c')){var _0x5b8ba2={};_0x5b8ba2[_0x3b5d61['name']]={'$like':'%'+_0x58b5a6[_0x3387('0x2e')][_0x3387('0x3d')]+'%'};return _0x5b8ba2;}})});}_0x588697=_[_0x3387('0x3a')]({},_0x588697,_0x58b5a6[_0x3387('0x3e')]);var _0x55a27e={'where':_0x588697['where']};return db['ServicenowConfiguration'][_0x3387('0x19')](_0x55a27e)[_0x3387('0x21')](function(_0x4cfdcd){_0xbefae5[_0x3387('0x19')]=_0x4cfdcd;if(_0x58b5a6[_0x3387('0x2e')]['includeAll']){_0x588697[_0x3387('0x3f')]=[{'all':!![]}];}return db[_0x3387('0x29')][_0x3387('0x40')](_0x588697);})[_0x3387('0x21')](function(_0x4cbb81){_0xbefae5[_0x3387('0x41')]=_0x4cbb81;return _0xbefae5;})['then'](respondWithFilteredResult(_0x22a096,_0x588697))['catch'](handleError(_0x22a096,null));};exports[_0x3387('0x42')]=function(_0x3bfe82,_0xf8953){var _0x22211b={'raw':![],'where':{'id':_0x3bfe82['params']['id']}},_0x2102a5={};_0x2102a5[_0x3387('0x2d')]=_[_0x3387('0x2f')](db[_0x3387('0x29')]['rawAttributes']);_0x2102a5[_0x3387('0x2e')]=_['keys'](_0x3bfe82[_0x3387('0x2e')]);_0x2102a5['filters']=_[_0x3387('0x31')](_0x2102a5[_0x3387('0x2d')],_0x2102a5['query']);_0x22211b['attributes']=_[_0x3387('0x31')](_0x2102a5[_0x3387('0x2d')],qs['fields'](_0x3bfe82['query'][_0x3387('0x32')]));_0x22211b[_0x3387('0x30')]=_0x22211b[_0x3387('0x30')][_0x3387('0x33')]?_0x22211b[_0x3387('0x30')]:_0x2102a5[_0x3387('0x2d')];if(_0x3bfe82[_0x3387('0x2e')][_0x3387('0x43')]){_0x22211b[_0x3387('0x3f')]=[{'all':!![]}];}_0x22211b=_[_0x3387('0x3a')]({},_0x22211b,_0x3bfe82[_0x3387('0x3e')]);return db['ServicenowConfiguration'][_0x3387('0x44')](_0x22211b)[_0x3387('0x21')](handleEntityNotFound(_0xf8953,null))[_0x3387('0x21')](respondWithResult(_0xf8953,null))[_0x3387('0x45')](handleError(_0xf8953,null));};exports[_0x3387('0x46')]=function(_0x44ed65,_0x550cc5){return db['ServicenowConfiguration'][_0x3387('0x46')](_0x44ed65[_0x3387('0x47')],{})[_0x3387('0x21')](respondWithResult(_0x550cc5,0xc9))[_0x3387('0x45')](handleError(_0x550cc5,null));};exports[_0x3387('0x20')]=function(_0x301d9e,_0x3665b7){if(_0x301d9e[_0x3387('0x47')]['id']){delete _0x301d9e['body']['id'];}return db['ServicenowConfiguration'][_0x3387('0x44')]({'where':{'id':_0x301d9e[_0x3387('0x48')]['id']}})[_0x3387('0x21')](handleEntityNotFound(_0x3665b7,null))[_0x3387('0x21')](saveUpdates(_0x301d9e[_0x3387('0x47')],null))[_0x3387('0x21')](respondWithResult(_0x3665b7,null))[_0x3387('0x45')](handleError(_0x3665b7,null));};exports[_0x3387('0x22')]=function(_0x580129,_0x4a90d9){return db[_0x3387('0x29')][_0x3387('0x44')]({'where':{'id':_0x580129[_0x3387('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a90d9,null))[_0x3387('0x21')](removeEntity(_0x4a90d9,null))[_0x3387('0x45')](handleError(_0x4a90d9,null));};exports['getFields']=function(_0xb97aee,_0x5572a3,_0x4fefb9){var _0x50f558={};var _0x516a8a={};var _0x5f2d09;var _0x59ccb1;return db[_0x3387('0x29')][_0x3387('0x49')]({'where':{'id':_0xb97aee[_0x3387('0x48')]['id']}})[_0x3387('0x21')](handleEntityNotFound(_0x5572a3,null))[_0x3387('0x21')](function(_0x50cd5b){if(_0x50cd5b){_0x5f2d09=_0x50cd5b;_0x516a8a[_0x3387('0x2d')]=_['keys'](db['ServicenowField'][_0x3387('0x2a')]);_0x516a8a[_0x3387('0x2e')]=_['keys'](_0xb97aee[_0x3387('0x2e')]);_0x516a8a[_0x3387('0x38')]=_['intersection'](_0x516a8a['model'],_0x516a8a['query']);_0x50f558[_0x3387('0x30')]=_[_0x3387('0x31')](_0x516a8a['model'],qs[_0x3387('0x32')](_0xb97aee[_0x3387('0x2e')][_0x3387('0x32')]));_0x50f558[_0x3387('0x30')]=_0x50f558['attributes'][_0x3387('0x33')]?_0x50f558[_0x3387('0x30')]:_0x516a8a[_0x3387('0x2d')];_0x50f558[_0x3387('0x35')]=qs[_0x3387('0x36')](_0xb97aee[_0x3387('0x2e')][_0x3387('0x36')]);_0x50f558[_0x3387('0x37')]=qs[_0x3387('0x38')](_['pick'](_0xb97aee[_0x3387('0x2e')],_0x516a8a['filters']));if(_0xb97aee[_0x3387('0x2e')][_0x3387('0x3d')]){_0x50f558[_0x3387('0x37')]=_['merge'](_0x50f558[_0x3387('0x37')],{'$or':_[_0x3387('0x28')](_0x50f558['attributes'],function(_0x13f4a3){var _0x3402f6={};_0x3402f6[_0x13f4a3]={'$like':'%'+_0xb97aee[_0x3387('0x2e')][_0x3387('0x3d')]+'%'};return _0x3402f6;})});}_0x50f558=_[_0x3387('0x3a')]({},_0x50f558,_0xb97aee[_0x3387('0x3e')]);return _0x5f2d09[_0x3387('0x4a')](_0x50f558);}})[_0x3387('0x21')](function(_0x44e02d){if(_0x44e02d){_0x59ccb1=_0x44e02d[_0x3387('0x33')];if(!_0xb97aee[_0x3387('0x2e')]['hasOwnProperty']('nolimit')){_0x50f558[_0x3387('0x1a')]=qs[_0x3387('0x1a')](_0xb97aee[_0x3387('0x2e')]['limit']);_0x50f558[_0x3387('0x17')]=qs[_0x3387('0x17')](_0xb97aee[_0x3387('0x2e')][_0x3387('0x17')]);}return _0x5f2d09['getFields'](_0x50f558);}})['then'](function(_0xfd3319){if(_0xfd3319){return _0xfd3319?{'count':_0x59ccb1,'rows':_0xfd3319}:null;}})[_0x3387('0x21')](respondWithResult(_0x5572a3,null))[_0x3387('0x45')](handleError(_0x5572a3,null));};exports[_0x3387('0x4b')]=function(_0x5ca34f,_0x376b69,_0x361c5b){var _0xa9b02b={};var _0x5a74db={};var _0x1708d4;var _0x3231c0;return db[_0x3387('0x29')]['findOne']({'where':{'id':_0x5ca34f[_0x3387('0x48')]['id']}})['then'](handleEntityNotFound(_0x376b69,null))[_0x3387('0x21')](function(_0x15e280){if(_0x15e280){_0x1708d4=_0x15e280;_0x5a74db[_0x3387('0x2d')]=_['keys'](db[_0x3387('0x4c')][_0x3387('0x2a')]);_0x5a74db[_0x3387('0x2e')]=_[_0x3387('0x2f')](_0x5ca34f[_0x3387('0x2e')]);_0x5a74db[_0x3387('0x38')]=_[_0x3387('0x31')](_0x5a74db[_0x3387('0x2d')],_0x5a74db[_0x3387('0x2e')]);_0xa9b02b[_0x3387('0x30')]=_[_0x3387('0x31')](_0x5a74db['model'],qs[_0x3387('0x32')](_0x5ca34f[_0x3387('0x2e')]['fields']));_0xa9b02b['attributes']=_0xa9b02b[_0x3387('0x30')][_0x3387('0x33')]?_0xa9b02b['attributes']:_0x5a74db[_0x3387('0x2d')];_0xa9b02b[_0x3387('0x35')]=qs[_0x3387('0x36')](_0x5ca34f[_0x3387('0x2e')][_0x3387('0x36')]);_0xa9b02b[_0x3387('0x37')]=qs[_0x3387('0x38')](_[_0x3387('0x39')](_0x5ca34f[_0x3387('0x2e')],_0x5a74db[_0x3387('0x38')]));if(_0x5ca34f['query'][_0x3387('0x3d')]){_0xa9b02b['where']=_[_0x3387('0x3a')](_0xa9b02b[_0x3387('0x37')],{'$or':_[_0x3387('0x28')](_0xa9b02b[_0x3387('0x30')],function(_0xa79252){var _0x39ee2d={};_0x39ee2d[_0xa79252]={'$like':'%'+_0x5ca34f[_0x3387('0x2e')]['filter']+'%'};return _0x39ee2d;})});}_0xa9b02b=_[_0x3387('0x3a')]({},_0xa9b02b,_0x5ca34f['options']);return _0x1708d4[_0x3387('0x4b')](_0xa9b02b);}})[_0x3387('0x21')](function(_0x5d2bb9){if(_0x5d2bb9){_0x3231c0=_0x5d2bb9[_0x3387('0x33')];if(!_0x5ca34f['query']['hasOwnProperty'](_0x3387('0x4d'))){_0xa9b02b[_0x3387('0x1a')]=qs[_0x3387('0x1a')](_0x5ca34f[_0x3387('0x2e')][_0x3387('0x1a')]);_0xa9b02b[_0x3387('0x17')]=qs[_0x3387('0x17')](_0x5ca34f['query']['offset']);}return _0x1708d4['getSubjects'](_0xa9b02b);}})[_0x3387('0x21')](function(_0x23bbb7){if(_0x23bbb7){return _0x23bbb7?{'count':_0x3231c0,'rows':_0x23bbb7}:null;}})[_0x3387('0x21')](respondWithResult(_0x376b69,null))[_0x3387('0x45')](handleError(_0x376b69,null));};exports['getDescriptions']=function(_0x3de4d6,_0x4a5999,_0x43c142){var _0x5a2c4b={};var _0x13eeda={};var _0x1e7999;var _0x33c8de;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3de4d6[_0x3387('0x48')]['id']}})[_0x3387('0x21')](handleEntityNotFound(_0x4a5999,null))['then'](function(_0x1a8844){if(_0x1a8844){_0x1e7999=_0x1a8844;_0x13eeda[_0x3387('0x2d')]=_['keys'](db[_0x3387('0x4c')][_0x3387('0x2a')]);_0x13eeda[_0x3387('0x2e')]=_[_0x3387('0x2f')](_0x3de4d6['query']);_0x13eeda[_0x3387('0x38')]=_['intersection'](_0x13eeda['model'],_0x13eeda[_0x3387('0x2e')]);_0x5a2c4b[_0x3387('0x30')]=_[_0x3387('0x31')](_0x13eeda[_0x3387('0x2d')],qs[_0x3387('0x32')](_0x3de4d6['query'][_0x3387('0x32')]));_0x5a2c4b[_0x3387('0x30')]=_0x5a2c4b[_0x3387('0x30')]['length']?_0x5a2c4b[_0x3387('0x30')]:_0x13eeda[_0x3387('0x2d')];_0x5a2c4b['order']=qs[_0x3387('0x36')](_0x3de4d6[_0x3387('0x2e')]['sort']);_0x5a2c4b[_0x3387('0x37')]=qs['filters'](_[_0x3387('0x39')](_0x3de4d6[_0x3387('0x2e')],_0x13eeda[_0x3387('0x38')]));if(_0x3de4d6['query'][_0x3387('0x3d')]){_0x5a2c4b[_0x3387('0x37')]=_[_0x3387('0x3a')](_0x5a2c4b[_0x3387('0x37')],{'$or':_['map'](_0x5a2c4b['attributes'],function(_0x2409f0){var _0x25a555={};_0x25a555[_0x2409f0]={'$like':'%'+_0x3de4d6[_0x3387('0x2e')][_0x3387('0x3d')]+'%'};return _0x25a555;})});}_0x5a2c4b=_[_0x3387('0x3a')]({},_0x5a2c4b,_0x3de4d6[_0x3387('0x3e')]);return _0x1e7999[_0x3387('0x4e')](_0x5a2c4b);}})[_0x3387('0x21')](function(_0x692790){if(_0x692790){_0x33c8de=_0x692790[_0x3387('0x33')];if(!_0x3de4d6[_0x3387('0x2e')]['hasOwnProperty']('nolimit')){_0x5a2c4b[_0x3387('0x1a')]=qs['limit'](_0x3de4d6[_0x3387('0x2e')]['limit']);_0x5a2c4b['offset']=qs[_0x3387('0x17')](_0x3de4d6[_0x3387('0x2e')]['offset']);}return _0x1e7999[_0x3387('0x4e')](_0x5a2c4b);}})[_0x3387('0x21')](function(_0x272aeb){if(_0x272aeb){return _0x272aeb?{'count':_0x33c8de,'rows':_0x272aeb}:null;}})[_0x3387('0x21')](respondWithResult(_0x4a5999,null))[_0x3387('0x45')](handleError(_0x4a5999,null));}; \ No newline at end of file +var _0x9ccc=['keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','update','body','destroy','getFields','ServicenowField','pick','nolimit','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','then','end','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x9ccc,0x107));var _0xc9cc=function(_0x4bd063,_0x5d09e9){_0x4bd063=_0x4bd063-0x0;var _0x363c3b=_0x9ccc[_0x4bd063];return _0x363c3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9cc('0x0'));var zipdir=require(_0xc9cc('0x1'));var jsonpatch=require(_0xc9cc('0x2'));var rp=require(_0xc9cc('0x3'));var moment=require('moment');var BPromise=require(_0xc9cc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc9cc('0x5'));var ejs=require(_0xc9cc('0x6'));var fs=require('fs');var fs_extra=require(_0xc9cc('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc9cc('0x8'));var jsforce=require(_0xc9cc('0x9'));var deskjs=require(_0xc9cc('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc9cc('0xb'));var Papa=require(_0xc9cc('0xc'));var Redis=require(_0xc9cc('0xd'));var authService=require(_0xc9cc('0xe'));var qs=require(_0xc9cc('0xf'));var as=require(_0xc9cc('0x10'));var hardwareService=require(_0xc9cc('0x11'));var logger=require('../../config/logger')(_0xc9cc('0x12'));var utils=require(_0xc9cc('0x13'));var config=require(_0xc9cc('0x14'));var licenseUtil=require(_0xc9cc('0x15'));var db=require(_0xc9cc('0x16'))['db'];function respondWithStatusCode(_0x3a2697,_0x36d66d){_0x36d66d=_0x36d66d||0xcc;return function(_0x1853d1){if(_0x1853d1){return _0x3a2697[_0xc9cc('0x17')](_0x36d66d);}return _0x3a2697[_0xc9cc('0x18')](_0x36d66d)['end']();};}function respondWithResult(_0x387dc6,_0x143e00){_0x143e00=_0x143e00||0xc8;return function(_0x30f2d0){if(_0x30f2d0){return _0x387dc6[_0xc9cc('0x18')](_0x143e00)[_0xc9cc('0x19')](_0x30f2d0);}};}function respondWithFilteredResult(_0x261eef,_0x5d574a){return function(_0x37f55c){if(_0x37f55c){var _0x637ad8=typeof _0x5d574a[_0xc9cc('0x1a')]===_0xc9cc('0x1b')&&typeof _0x5d574a[_0xc9cc('0x1c')]===_0xc9cc('0x1b');var _0x1b1aaf=_0x37f55c[_0xc9cc('0x1d')];var _0x3dcac0=_0x637ad8?0x0:_0x5d574a[_0xc9cc('0x1a')];var _0x4f675a=_0x637ad8?_0x37f55c['count']:_0x5d574a['offset']+_0x5d574a[_0xc9cc('0x1c')];var _0x4a74ad;if(_0x4f675a>=_0x1b1aaf){_0x4f675a=_0x1b1aaf;_0x4a74ad=0xc8;}else{_0x4a74ad=0xce;}_0x261eef[_0xc9cc('0x18')](_0x4a74ad);return _0x261eef['set']('Content-Range',_0x3dcac0+'-'+_0x4f675a+'/'+_0x1b1aaf)[_0xc9cc('0x19')](_0x37f55c);}return null;};}function patchUpdates(_0x29c346){return function(_0x535939){try{jsonpatch[_0xc9cc('0x1e')](_0x535939,_0x29c346,!![]);}catch(_0x18fd28){return BPromise['reject'](_0x18fd28);}return _0x535939['save']();};}function saveUpdates(_0x2a31b2,_0x577d2c){return function(_0x463d69){if(_0x463d69){return _0x463d69['update'](_0x2a31b2)[_0xc9cc('0x1f')](function(_0x4590ed){return _0x4590ed;});}return null;};}function removeEntity(_0x220529,_0x8ae7e3){return function(_0x5e497f){if(_0x5e497f){return _0x5e497f['destroy']()[_0xc9cc('0x1f')](function(){_0x220529[_0xc9cc('0x18')](0xcc)[_0xc9cc('0x20')]();});}};}function handleEntityNotFound(_0x6de4f7,_0x481b3e){return function(_0x568c22){if(!_0x568c22){_0x6de4f7[_0xc9cc('0x17')](0x194);}return _0x568c22;};}function handleError(_0x412001,_0x3b78d9){_0x3b78d9=_0x3b78d9||0x1f4;return function(_0x18c80c){logger[_0xc9cc('0x21')](_0x18c80c[_0xc9cc('0x22')]);if(_0x18c80c[_0xc9cc('0x23')]){delete _0x18c80c[_0xc9cc('0x23')];}_0x412001['status'](_0x3b78d9)[_0xc9cc('0x24')](_0x18c80c);};}exports[_0xc9cc('0x25')]=function(_0x18df8e,_0x495ac8){var _0x22ef85={},_0x72b38e={},_0x1155a0={'count':0x0,'rows':[]};var _0x5e0293=_[_0xc9cc('0x26')](db[_0xc9cc('0x27')]['rawAttributes'],function(_0x28cf2d){return{'name':_0x28cf2d[_0xc9cc('0x28')],'type':_0x28cf2d[_0xc9cc('0x29')][_0xc9cc('0x2a')]};});_0x72b38e[_0xc9cc('0x2b')]=_[_0xc9cc('0x26')](_0x5e0293,_0xc9cc('0x23'));_0x72b38e[_0xc9cc('0x2c')]=_[_0xc9cc('0x2d')](_0x18df8e[_0xc9cc('0x2c')]);_0x72b38e[_0xc9cc('0x2e')]=_[_0xc9cc('0x2f')](_0x72b38e[_0xc9cc('0x2b')],_0x72b38e[_0xc9cc('0x2c')]);_0x22ef85['attributes']=_[_0xc9cc('0x2f')](_0x72b38e['model'],qs['fields'](_0x18df8e[_0xc9cc('0x2c')][_0xc9cc('0x30')]));_0x22ef85[_0xc9cc('0x31')]=_0x22ef85[_0xc9cc('0x31')]['length']?_0x22ef85[_0xc9cc('0x31')]:_0x72b38e[_0xc9cc('0x2b')];if(!_0x18df8e[_0xc9cc('0x2c')][_0xc9cc('0x32')]('nolimit')){_0x22ef85['limit']=qs[_0xc9cc('0x1c')](_0x18df8e['query'][_0xc9cc('0x1c')]);_0x22ef85[_0xc9cc('0x1a')]=qs[_0xc9cc('0x1a')](_0x18df8e[_0xc9cc('0x2c')]['offset']);}_0x22ef85[_0xc9cc('0x33')]=qs['sort'](_0x18df8e['query'][_0xc9cc('0x34')]);_0x22ef85['where']=qs['filters'](_['pick'](_0x18df8e['query'],_0x72b38e[_0xc9cc('0x2e')]),_0x5e0293);if(_0x18df8e['query'][_0xc9cc('0x35')]){_0x22ef85[_0xc9cc('0x36')]=_[_0xc9cc('0x37')](_0x22ef85[_0xc9cc('0x36')],{'$or':_[_0xc9cc('0x26')](_0x5e0293,function(_0xa2cac1){if(_0xa2cac1['type']!=='VIRTUAL'){var _0x41848b={};_0x41848b[_0xa2cac1[_0xc9cc('0x23')]]={'$like':'%'+_0x18df8e[_0xc9cc('0x2c')][_0xc9cc('0x35')]+'%'};return _0x41848b;}})});}_0x22ef85=_[_0xc9cc('0x37')]({},_0x22ef85,_0x18df8e['options']);var _0x2feef6={'where':_0x22ef85[_0xc9cc('0x36')]};return db[_0xc9cc('0x27')][_0xc9cc('0x1d')](_0x2feef6)[_0xc9cc('0x1f')](function(_0x4e6195){_0x1155a0['count']=_0x4e6195;if(_0x18df8e['query'][_0xc9cc('0x38')]){_0x22ef85[_0xc9cc('0x39')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xc9cc('0x3a')](_0x22ef85);})[_0xc9cc('0x1f')](function(_0x2ec721){_0x1155a0['rows']=_0x2ec721;return _0x1155a0;})['then'](respondWithFilteredResult(_0x495ac8,_0x22ef85))[_0xc9cc('0x3b')](handleError(_0x495ac8,null));};exports[_0xc9cc('0x3c')]=function(_0x3724bc,_0x18c802){var _0x598a3b={'raw':![],'where':{'id':_0x3724bc[_0xc9cc('0x3d')]['id']}},_0x31ab73={};_0x31ab73[_0xc9cc('0x2b')]=_[_0xc9cc('0x2d')](db[_0xc9cc('0x27')][_0xc9cc('0x3e')]);_0x31ab73[_0xc9cc('0x2c')]=_[_0xc9cc('0x2d')](_0x3724bc[_0xc9cc('0x2c')]);_0x31ab73[_0xc9cc('0x2e')]=_['intersection'](_0x31ab73[_0xc9cc('0x2b')],_0x31ab73[_0xc9cc('0x2c')]);_0x598a3b[_0xc9cc('0x31')]=_[_0xc9cc('0x2f')](_0x31ab73['model'],qs[_0xc9cc('0x30')](_0x3724bc[_0xc9cc('0x2c')][_0xc9cc('0x30')]));_0x598a3b['attributes']=_0x598a3b['attributes'][_0xc9cc('0x3f')]?_0x598a3b['attributes']:_0x31ab73[_0xc9cc('0x2b')];if(_0x3724bc[_0xc9cc('0x2c')]['includeAll']){_0x598a3b[_0xc9cc('0x39')]=[{'all':!![]}];}_0x598a3b=_[_0xc9cc('0x37')]({},_0x598a3b,_0x3724bc[_0xc9cc('0x40')]);return db[_0xc9cc('0x27')][_0xc9cc('0x41')](_0x598a3b)[_0xc9cc('0x1f')](handleEntityNotFound(_0x18c802,null))['then'](respondWithResult(_0x18c802,null))[_0xc9cc('0x3b')](handleError(_0x18c802,null));};exports[_0xc9cc('0x42')]=function(_0x27ec81,_0x3d0f03){return db[_0xc9cc('0x27')][_0xc9cc('0x42')](_0x27ec81['body'],{})[_0xc9cc('0x1f')](respondWithResult(_0x3d0f03,0xc9))[_0xc9cc('0x3b')](handleError(_0x3d0f03,null));};exports[_0xc9cc('0x43')]=function(_0x550121,_0x3b1f18){if(_0x550121[_0xc9cc('0x44')]['id']){delete _0x550121['body']['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x550121['params']['id']}})[_0xc9cc('0x1f')](handleEntityNotFound(_0x3b1f18,null))['then'](saveUpdates(_0x550121[_0xc9cc('0x44')],null))[_0xc9cc('0x1f')](respondWithResult(_0x3b1f18,null))['catch'](handleError(_0x3b1f18,null));};exports[_0xc9cc('0x45')]=function(_0x8daa88,_0x122954){return db[_0xc9cc('0x27')][_0xc9cc('0x41')]({'where':{'id':_0x8daa88[_0xc9cc('0x3d')]['id']}})[_0xc9cc('0x1f')](handleEntityNotFound(_0x122954,null))[_0xc9cc('0x1f')](removeEntity(_0x122954,null))[_0xc9cc('0x3b')](handleError(_0x122954,null));};exports[_0xc9cc('0x46')]=function(_0x33ee41,_0x304616,_0x57c273){var _0x5521ca={};var _0x13522d={};var _0x3df0bf;var _0x4c95d4;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x33ee41['params']['id']}})[_0xc9cc('0x1f')](handleEntityNotFound(_0x304616,null))[_0xc9cc('0x1f')](function(_0x4acfde){if(_0x4acfde){_0x3df0bf=_0x4acfde;_0x13522d[_0xc9cc('0x2b')]=_[_0xc9cc('0x2d')](db[_0xc9cc('0x47')][_0xc9cc('0x3e')]);_0x13522d[_0xc9cc('0x2c')]=_[_0xc9cc('0x2d')](_0x33ee41[_0xc9cc('0x2c')]);_0x13522d[_0xc9cc('0x2e')]=_[_0xc9cc('0x2f')](_0x13522d[_0xc9cc('0x2b')],_0x13522d[_0xc9cc('0x2c')]);_0x5521ca[_0xc9cc('0x31')]=_[_0xc9cc('0x2f')](_0x13522d[_0xc9cc('0x2b')],qs[_0xc9cc('0x30')](_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x30')]));_0x5521ca[_0xc9cc('0x31')]=_0x5521ca[_0xc9cc('0x31')]['length']?_0x5521ca[_0xc9cc('0x31')]:_0x13522d['model'];_0x5521ca['order']=qs[_0xc9cc('0x34')](_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x34')]);_0x5521ca[_0xc9cc('0x36')]=qs['filters'](_[_0xc9cc('0x48')](_0x33ee41[_0xc9cc('0x2c')],_0x13522d['filters']));if(_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x35')]){_0x5521ca[_0xc9cc('0x36')]=_[_0xc9cc('0x37')](_0x5521ca[_0xc9cc('0x36')],{'$or':_[_0xc9cc('0x26')](_0x5521ca['attributes'],function(_0x27dfbf){var _0x1a6e6e={};_0x1a6e6e[_0x27dfbf]={'$like':'%'+_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x35')]+'%'};return _0x1a6e6e;})});}_0x5521ca=_[_0xc9cc('0x37')]({},_0x5521ca,_0x33ee41[_0xc9cc('0x40')]);return _0x3df0bf[_0xc9cc('0x46')](_0x5521ca);}})[_0xc9cc('0x1f')](function(_0x24bdf8){if(_0x24bdf8){_0x4c95d4=_0x24bdf8[_0xc9cc('0x3f')];if(!_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x32')](_0xc9cc('0x49'))){_0x5521ca[_0xc9cc('0x1c')]=qs[_0xc9cc('0x1c')](_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x1c')]);_0x5521ca['offset']=qs[_0xc9cc('0x1a')](_0x33ee41[_0xc9cc('0x2c')][_0xc9cc('0x1a')]);}return _0x3df0bf[_0xc9cc('0x46')](_0x5521ca);}})['then'](function(_0x4dd3ad){if(_0x4dd3ad){return _0x4dd3ad?{'count':_0x4c95d4,'rows':_0x4dd3ad}:null;}})[_0xc9cc('0x1f')](respondWithResult(_0x304616,null))[_0xc9cc('0x3b')](handleError(_0x304616,null));};exports[_0xc9cc('0x4a')]=function(_0x8c61b1,_0x325e45,_0x4733b6){var _0x3202f2={};var _0x49658d={};var _0x4a1d29;var _0x36e93c;return db[_0xc9cc('0x27')][_0xc9cc('0x4b')]({'where':{'id':_0x8c61b1[_0xc9cc('0x3d')]['id']}})[_0xc9cc('0x1f')](handleEntityNotFound(_0x325e45,null))[_0xc9cc('0x1f')](function(_0x151123){if(_0x151123){_0x4a1d29=_0x151123;_0x49658d['model']=_['keys'](db[_0xc9cc('0x47')][_0xc9cc('0x3e')]);_0x49658d[_0xc9cc('0x2c')]=_[_0xc9cc('0x2d')](_0x8c61b1[_0xc9cc('0x2c')]);_0x49658d[_0xc9cc('0x2e')]=_[_0xc9cc('0x2f')](_0x49658d[_0xc9cc('0x2b')],_0x49658d[_0xc9cc('0x2c')]);_0x3202f2[_0xc9cc('0x31')]=_[_0xc9cc('0x2f')](_0x49658d[_0xc9cc('0x2b')],qs[_0xc9cc('0x30')](_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x30')]));_0x3202f2[_0xc9cc('0x31')]=_0x3202f2[_0xc9cc('0x31')]['length']?_0x3202f2[_0xc9cc('0x31')]:_0x49658d['model'];_0x3202f2[_0xc9cc('0x33')]=qs['sort'](_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x34')]);_0x3202f2[_0xc9cc('0x36')]=qs[_0xc9cc('0x2e')](_[_0xc9cc('0x48')](_0x8c61b1['query'],_0x49658d[_0xc9cc('0x2e')]));if(_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x35')]){_0x3202f2[_0xc9cc('0x36')]=_['merge'](_0x3202f2[_0xc9cc('0x36')],{'$or':_[_0xc9cc('0x26')](_0x3202f2[_0xc9cc('0x31')],function(_0x106db9){var _0x39219b={};_0x39219b[_0x106db9]={'$like':'%'+_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x35')]+'%'};return _0x39219b;})});}_0x3202f2=_[_0xc9cc('0x37')]({},_0x3202f2,_0x8c61b1[_0xc9cc('0x40')]);return _0x4a1d29['getSubjects'](_0x3202f2);}})[_0xc9cc('0x1f')](function(_0x4ddd39){if(_0x4ddd39){_0x36e93c=_0x4ddd39[_0xc9cc('0x3f')];if(!_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x32')](_0xc9cc('0x49'))){_0x3202f2[_0xc9cc('0x1c')]=qs[_0xc9cc('0x1c')](_0x8c61b1[_0xc9cc('0x2c')][_0xc9cc('0x1c')]);_0x3202f2[_0xc9cc('0x1a')]=qs[_0xc9cc('0x1a')](_0x8c61b1['query'][_0xc9cc('0x1a')]);}return _0x4a1d29[_0xc9cc('0x4a')](_0x3202f2);}})[_0xc9cc('0x1f')](function(_0x49cdfb){if(_0x49cdfb){return _0x49cdfb?{'count':_0x36e93c,'rows':_0x49cdfb}:null;}})[_0xc9cc('0x1f')](respondWithResult(_0x325e45,null))[_0xc9cc('0x3b')](handleError(_0x325e45,null));};exports[_0xc9cc('0x4c')]=function(_0x27ea43,_0x43d238,_0x1ea63b){var _0x2e8b7f={};var _0x562163={};var _0x5c7abb;var _0x536489;return db[_0xc9cc('0x27')]['findOne']({'where':{'id':_0x27ea43[_0xc9cc('0x3d')]['id']}})['then'](handleEntityNotFound(_0x43d238,null))[_0xc9cc('0x1f')](function(_0x528f93){if(_0x528f93){_0x5c7abb=_0x528f93;_0x562163[_0xc9cc('0x2b')]=_[_0xc9cc('0x2d')](db['ServicenowField'][_0xc9cc('0x3e')]);_0x562163[_0xc9cc('0x2c')]=_[_0xc9cc('0x2d')](_0x27ea43['query']);_0x562163[_0xc9cc('0x2e')]=_[_0xc9cc('0x2f')](_0x562163[_0xc9cc('0x2b')],_0x562163[_0xc9cc('0x2c')]);_0x2e8b7f[_0xc9cc('0x31')]=_[_0xc9cc('0x2f')](_0x562163[_0xc9cc('0x2b')],qs[_0xc9cc('0x30')](_0x27ea43[_0xc9cc('0x2c')][_0xc9cc('0x30')]));_0x2e8b7f[_0xc9cc('0x31')]=_0x2e8b7f[_0xc9cc('0x31')]['length']?_0x2e8b7f[_0xc9cc('0x31')]:_0x562163[_0xc9cc('0x2b')];_0x2e8b7f['order']=qs[_0xc9cc('0x34')](_0x27ea43['query']['sort']);_0x2e8b7f['where']=qs[_0xc9cc('0x2e')](_[_0xc9cc('0x48')](_0x27ea43[_0xc9cc('0x2c')],_0x562163[_0xc9cc('0x2e')]));if(_0x27ea43[_0xc9cc('0x2c')]['filter']){_0x2e8b7f[_0xc9cc('0x36')]=_['merge'](_0x2e8b7f['where'],{'$or':_['map'](_0x2e8b7f['attributes'],function(_0x23aee8){var _0x5f26bc={};_0x5f26bc[_0x23aee8]={'$like':'%'+_0x27ea43[_0xc9cc('0x2c')]['filter']+'%'};return _0x5f26bc;})});}_0x2e8b7f=_[_0xc9cc('0x37')]({},_0x2e8b7f,_0x27ea43[_0xc9cc('0x40')]);return _0x5c7abb[_0xc9cc('0x4c')](_0x2e8b7f);}})[_0xc9cc('0x1f')](function(_0x182a25){if(_0x182a25){_0x536489=_0x182a25['length'];if(!_0x27ea43[_0xc9cc('0x2c')][_0xc9cc('0x32')](_0xc9cc('0x49'))){_0x2e8b7f['limit']=qs[_0xc9cc('0x1c')](_0x27ea43['query'][_0xc9cc('0x1c')]);_0x2e8b7f[_0xc9cc('0x1a')]=qs[_0xc9cc('0x1a')](_0x27ea43[_0xc9cc('0x2c')][_0xc9cc('0x1a')]);}return _0x5c7abb[_0xc9cc('0x4c')](_0x2e8b7f);}})['then'](function(_0x3e324d){if(_0x3e324d){return _0x3e324d?{'count':_0x536489,'rows':_0x3e324d}:null;}})[_0xc9cc('0x1f')](respondWithResult(_0x43d238,null))['catch'](handleError(_0x43d238,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ad40ba1..9570351 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 _0x02ce=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','lodash'];(function(_0x2e722c,_0x20119b){var _0x507cac=function(_0x1ccc37){while(--_0x1ccc37){_0x2e722c['push'](_0x2e722c['shift']());}};_0x507cac(++_0x20119b);}(_0x02ce,0x1ac));var _0xe02c=function(_0x488efe,_0x37b327){_0x488efe=_0x488efe-0x0;var _0x497d3e=_0x02ce[_0x488efe];return _0x497d3e;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var logger=require(_0xe02c('0x2'))('api');var moment=require(_0xe02c('0x3'));var BPromise=require('bluebird');var rp=require(_0xe02c('0x4'));var fs=require('fs');var path=require(_0xe02c('0x5'));var rimraf=require(_0xe02c('0x6'));var config=require(_0xe02c('0x7'));var attributes=require(_0xe02c('0x8'));module[_0xe02c('0x9')]=function(_0x3f7436,_0x2b804f){return _0x3f7436[_0xe02c('0xa')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f40=['path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0x23858d,_0x50db66){var _0xda4fd6=function(_0x544772){while(--_0x544772){_0x23858d['push'](_0x23858d['shift']());}};_0xda4fd6(++_0x50db66);}(_0x3f40,0xbb));var _0x03f4=function(_0x1f38e1,_0x35ec04){_0x1f38e1=_0x1f38e1-0x0;var _0x742ee1=_0x3f40[_0x1f38e1];return _0x742ee1;};'use strict';var _=require(_0x03f4('0x0'));var util=require(_0x03f4('0x1'));var logger=require(_0x03f4('0x2'))('api');var moment=require(_0x03f4('0x3'));var BPromise=require('bluebird');var rp=require(_0x03f4('0x4'));var fs=require('fs');var path=require(_0x03f4('0x5'));var rimraf=require(_0x03f4('0x6'));var config=require(_0x03f4('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x03f4('0x8')]=function(_0x3b42bb,_0x196b64){return _0x3b42bb[_0x03f4('0x9')](_0x03f4('0xa'),attributes,{'tableName':_0x03f4('0xb'),'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 a2d9a01..ba4347b 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 _0xac60=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xac60,0x86));var _0x0ac6=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xac60[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0ac6('0x0'));var util=require(_0x0ac6('0x1'));var moment=require(_0x0ac6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ac6('0x3'));var fs=require('fs');var Redis=require(_0x0ac6('0x4'));var db=require(_0x0ac6('0x5'))['db'];var utils=require(_0x0ac6('0x6'));var logger=require('../../config/logger')(_0x0ac6('0x7'));var config=require(_0x0ac6('0x8'));var jayson=require(_0x0ac6('0x9'));var client=jayson['client'][_0x0ac6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ac4,_0x440769,_0x3c1c72){return new BPromise(function(_0x549ad7,_0x289c22){return client[_0x0ac6('0xb')](_0x2b1ac4,_0x3c1c72)['then'](function(_0x51ac07){logger[_0x0ac6('0xc')](_0x0ac6('0xd'),_0x440769,_0x0ac6('0xe'));logger[_0x0ac6('0xf')](_0x0ac6('0x10'),_0x440769,_0x0ac6('0xe'),JSON[_0x0ac6('0x11')](_0x51ac07));if(_0x51ac07[_0x0ac6('0x12')]){if(_0x51ac07['error'][_0x0ac6('0x13')]===0x1f4){logger[_0x0ac6('0x12')](_0x0ac6('0xd'),_0x440769,_0x51ac07[_0x0ac6('0x12')]['message']);return _0x289c22(_0x51ac07[_0x0ac6('0x12')][_0x0ac6('0x14')]);}logger[_0x0ac6('0x12')](_0x0ac6('0xd'),_0x440769,_0x51ac07[_0x0ac6('0x12')][_0x0ac6('0x14')]);return _0x549ad7(_0x51ac07[_0x0ac6('0x12')][_0x0ac6('0x14')]);}else{logger[_0x0ac6('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x440769,'request\x20sent');_0x549ad7(_0x51ac07[_0x0ac6('0x15')][_0x0ac6('0x14')]);}})['catch'](function(_0x20d84c){logger[_0x0ac6('0x12')](_0x0ac6('0xd'),_0x440769,_0x20d84c);_0x289c22(_0x20d84c);});});} \ No newline at end of file +var _0xc130=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xc130,0x7c));var _0x0c13=function(_0x1a2e2e,_0x507045){_0x1a2e2e=_0x1a2e2e-0x0;var _0x41666b=_0xc130[_0x1a2e2e];return _0x41666b;};'use strict';var _=require(_0x0c13('0x0'));var util=require(_0x0c13('0x1'));var moment=require(_0x0c13('0x2'));var BPromise=require(_0x0c13('0x3'));var rs=require(_0x0c13('0x4'));var fs=require('fs');var Redis=require(_0x0c13('0x5'));var db=require(_0x0c13('0x6'))['db'];var utils=require(_0x0c13('0x7'));var logger=require(_0x0c13('0x8'))(_0x0c13('0x9'));var config=require(_0x0c13('0xa'));var jayson=require(_0x0c13('0xb'));var client=jayson[_0x0c13('0xc')][_0x0c13('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2eaff3,_0x14bc49,_0x36104f){return new BPromise(function(_0x400c1f,_0x4ba593){return client[_0x0c13('0xe')](_0x2eaff3,_0x36104f)[_0x0c13('0xf')](function(_0x582c1f){logger[_0x0c13('0x10')](_0x0c13('0x11'),_0x14bc49,_0x0c13('0x12'));logger['debug'](_0x0c13('0x13'),_0x14bc49,'request\x20sent',JSON[_0x0c13('0x14')](_0x582c1f));if(_0x582c1f[_0x0c13('0x15')]){if(_0x582c1f[_0x0c13('0x15')][_0x0c13('0x16')]===0x1f4){logger[_0x0c13('0x15')](_0x0c13('0x11'),_0x14bc49,_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);return _0x4ba593(_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x14bc49,_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);return _0x400c1f(_0x582c1f[_0x0c13('0x15')]['message']);}else{logger[_0x0c13('0x10')](_0x0c13('0x11'),_0x14bc49,_0x0c13('0x12'));_0x400c1f(_0x582c1f['result'][_0x0c13('0x17')]);}})[_0x0c13('0x18')](function(_0x2e5791){logger[_0x0c13('0x15')](_0x0c13('0x11'),_0x14bc49,_0x2e5791);_0x4ba593(_0x2e5791);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c721e67..97ea0eb 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 _0xd4dd=['express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0xce9cf5,_0x4c3727){var _0x297f0b=function(_0x7e7548){while(--_0x7e7548){_0xce9cf5['push'](_0xce9cf5['shift']());}};_0x297f0b(++_0x4c3727);}(_0xd4dd,0x185));var _0xdd4d=function(_0x1360eb,_0x6a0248){_0x1360eb=_0x1360eb-0x0;var _0x472a41=_0xd4dd[_0x1360eb];return _0x472a41;};'use strict';var multer=require(_0xdd4d('0x0'));var util=require(_0xdd4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdd4d('0x2'));var router=express[_0xdd4d('0x3')]();var fs_extra=require(_0xdd4d('0x4'));var auth=require(_0xdd4d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0xdd4d('0x6')]('/',auth['isAuthenticated'](),controller[_0xdd4d('0x7')]);router['get']('/:id',auth[_0xdd4d('0x8')](),controller[_0xdd4d('0x9')]);router[_0xdd4d('0xa')]('/',auth['isAuthenticated'](),controller[_0xdd4d('0xb')]);router['put'](_0xdd4d('0xc'),auth[_0xdd4d('0x8')](),controller[_0xdd4d('0xd')]);router[_0xdd4d('0xe')](_0xdd4d('0xc'),auth[_0xdd4d('0x8')](),controller[_0xdd4d('0xf')]);module[_0xdd4d('0x10')]=router; \ No newline at end of file +var _0x7d09=['get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x539866,_0x3f84e3){var _0x435137=function(_0x10666d){while(--_0x10666d){_0x539866['push'](_0x539866['shift']());}};_0x435137(++_0x3f84e3);}(_0x7d09,0x1e5));var _0x97d0=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x7d09[_0x1b5aea];return _0x51cae9;};'use strict';var multer=require(_0x97d0('0x0'));var util=require(_0x97d0('0x1'));var path=require(_0x97d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x97d0('0x3'));var router=express['Router']();var fs_extra=require(_0x97d0('0x4'));var auth=require(_0x97d0('0x5'));var interaction=require(_0x97d0('0x6'));var config=require(_0x97d0('0x7'));var controller=require(_0x97d0('0x8'));router[_0x97d0('0x9')]('/',auth[_0x97d0('0xa')](),controller[_0x97d0('0xb')]);router['get'](_0x97d0('0xc'),auth[_0x97d0('0xa')](),controller[_0x97d0('0xd')]);router[_0x97d0('0xe')]('/',auth[_0x97d0('0xa')](),controller[_0x97d0('0xf')]);router[_0x97d0('0x10')]('/:id',auth[_0x97d0('0xa')](),controller['update']);router[_0x97d0('0x11')](_0x97d0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x97d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 79d740b..93d8ccd 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 _0xfa57=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x542254,_0xb8197d){var _0x13d2ef=function(_0x560edf){while(--_0x560edf){_0x542254['push'](_0x542254['shift']());}};_0x13d2ef(++_0xb8197d);}(_0xfa57,0x119));var _0x7fa5=function(_0x41f68c,_0x266a58){_0x41f68c=_0x41f68c-0x0;var _0x2c7a4a=_0xfa57[_0x41f68c];return _0x2c7a4a;};'use strict';var Sequelize=require('sequelize');module[_0x7fa5('0x0')]={'type':{'type':Sequelize[_0x7fa5('0x1')](_0x7fa5('0x2'),_0x7fa5('0x3'),_0x7fa5('0x4'),_0x7fa5('0x5'),_0x7fa5('0x6')),'defaultValue':_0x7fa5('0x2')},'content':{'type':Sequelize[_0x7fa5('0x7')]},'key':{'type':Sequelize[_0x7fa5('0x7')]},'keyType':{'type':Sequelize[_0x7fa5('0x1')](_0x7fa5('0x2'),'variable',_0x7fa5('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7fa5('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7fa5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7fa5('0x7')]}}; \ No newline at end of file +var _0x8c53=['ENUM','sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x3c2a0d,_0x1d352d){var _0x30b0e7=function(_0x5f3b0d){while(--_0x5f3b0d){_0x3c2a0d['push'](_0x3c2a0d['shift']());}};_0x30b0e7(++_0x1d352d);}(_0x8c53,0x172));var _0x38c5=function(_0x4f8b6a,_0x2ead69){_0x4f8b6a=_0x4f8b6a-0x0;var _0x192d31=_0x8c53[_0x4f8b6a];return _0x192d31;};'use strict';var Sequelize=require(_0x38c5('0x0'));module[_0x38c5('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x38c5('0x2'),_0x38c5('0x3'),_0x38c5('0x4'),_0x38c5('0x5')),'defaultValue':_0x38c5('0x6')},'content':{'type':Sequelize[_0x38c5('0x7')]},'key':{'type':Sequelize[_0x38c5('0x7')]},'keyType':{'type':Sequelize[_0x38c5('0x8')](_0x38c5('0x6'),_0x38c5('0x2'),_0x38c5('0x3'))},'keyContent':{'type':Sequelize[_0x38c5('0x7')]},'idField':{'type':Sequelize[_0x38c5('0x7')]},'nameField':{'type':Sequelize[_0x38c5('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38c5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 290fc5c..a10c79e 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 _0xd576=['reject','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','destroy','rimraf','zip-dir','request-promise','mustache','util','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0xd576,0x195));var _0x6d57=function(_0x112388,_0x568a14){_0x112388=_0x112388-0x0;var _0x5732b9=_0xd576[_0x112388];return _0x5732b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d57('0x0'));var zipdir=require(_0x6d57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d57('0x3'));var util=require(_0x6d57('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6d57('0x5'));var fs=require('fs');var fs_extra=require(_0x6d57('0x6'));var _=require(_0x6d57('0x7'));var squel=require(_0x6d57('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d57('0x9'));var toCsv=require(_0x6d57('0xa'));var querystring=require(_0x6d57('0xb'));var Papa=require(_0x6d57('0xc'));var Redis=require(_0x6d57('0xd'));var authService=require(_0x6d57('0xe'));var qs=require(_0x6d57('0xf'));var as=require(_0x6d57('0x10'));var hardwareService=require(_0x6d57('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6d57('0x12'));var config=require(_0x6d57('0x13'));var licenseUtil=require(_0x6d57('0x14'));var db=require(_0x6d57('0x15'))['db'];function respondWithStatusCode(_0x275216,_0x3b9602){_0x3b9602=_0x3b9602||0xcc;return function(_0x43276f){if(_0x43276f){return _0x275216[_0x6d57('0x16')](_0x3b9602);}return _0x275216[_0x6d57('0x17')](_0x3b9602)[_0x6d57('0x18')]();};}function respondWithResult(_0x3bcb78,_0xcd4506){_0xcd4506=_0xcd4506||0xc8;return function(_0x1ddbef){if(_0x1ddbef){return _0x3bcb78[_0x6d57('0x17')](_0xcd4506)[_0x6d57('0x19')](_0x1ddbef);}};}function respondWithFilteredResult(_0x4f36b4,_0x375026){return function(_0x3cbb6d){if(_0x3cbb6d){var _0x10ff64=typeof _0x375026['offset']===_0x6d57('0x1a')&&typeof _0x375026[_0x6d57('0x1b')]===_0x6d57('0x1a');var _0x32cbff=_0x3cbb6d[_0x6d57('0x1c')];var _0x3f04fb=_0x10ff64?0x0:_0x375026['offset'];var _0x229bab=_0x10ff64?_0x3cbb6d['count']:_0x375026[_0x6d57('0x1d')]+_0x375026[_0x6d57('0x1b')];var _0x3324b6;if(_0x229bab>=_0x32cbff){_0x229bab=_0x32cbff;_0x3324b6=0xc8;}else{_0x3324b6=0xce;}_0x4f36b4[_0x6d57('0x17')](_0x3324b6);return _0x4f36b4[_0x6d57('0x1e')](_0x6d57('0x1f'),_0x3f04fb+'-'+_0x229bab+'/'+_0x32cbff)[_0x6d57('0x19')](_0x3cbb6d);}return null;};}function patchUpdates(_0x2ff2f5){return function(_0x359ef5){try{jsonpatch[_0x6d57('0x20')](_0x359ef5,_0x2ff2f5,!![]);}catch(_0x2acfac){return BPromise[_0x6d57('0x21')](_0x2acfac);}return _0x359ef5[_0x6d57('0x22')]();};}function saveUpdates(_0x34e162,_0x59def6){return function(_0x3c3a38){if(_0x3c3a38){return _0x3c3a38[_0x6d57('0x23')](_0x34e162)[_0x6d57('0x24')](function(_0x20e4c5){return _0x20e4c5;});}return null;};}function removeEntity(_0x2e1afd,_0x37ea15){return function(_0x836d7e){if(_0x836d7e){return _0x836d7e['destroy']()[_0x6d57('0x24')](function(){_0x2e1afd[_0x6d57('0x17')](0xcc)[_0x6d57('0x18')]();});}};}function handleEntityNotFound(_0x1806ce,_0x785874){return function(_0x9b1e45){if(!_0x9b1e45){_0x1806ce[_0x6d57('0x16')](0x194);}return _0x9b1e45;};}function handleError(_0xcce6c1,_0x7da089){_0x7da089=_0x7da089||0x1f4;return function(_0x32b647){logger[_0x6d57('0x25')](_0x32b647[_0x6d57('0x26')]);if(_0x32b647['name']){delete _0x32b647[_0x6d57('0x27')];}_0xcce6c1[_0x6d57('0x17')](_0x7da089)[_0x6d57('0x28')](_0x32b647);};}exports[_0x6d57('0x29')]=function(_0x1ed5b5,_0x3394f3){var _0x3a0404={},_0x4eb2c8={},_0x34907e={'count':0x0,'rows':[]};var _0x14e62f=_[_0x6d57('0x2a')](db[_0x6d57('0x2b')][_0x6d57('0x2c')],function(_0x2b6d50){return{'name':_0x2b6d50[_0x6d57('0x2d')],'type':_0x2b6d50[_0x6d57('0x2e')][_0x6d57('0x2f')]};});_0x4eb2c8[_0x6d57('0x30')]=_['map'](_0x14e62f,_0x6d57('0x27'));_0x4eb2c8[_0x6d57('0x31')]=_['keys'](_0x1ed5b5['query']);_0x4eb2c8[_0x6d57('0x32')]=_['intersection'](_0x4eb2c8['model'],_0x4eb2c8[_0x6d57('0x31')]);_0x3a0404[_0x6d57('0x33')]=_[_0x6d57('0x34')](_0x4eb2c8[_0x6d57('0x30')],qs[_0x6d57('0x35')](_0x1ed5b5[_0x6d57('0x31')][_0x6d57('0x35')]));_0x3a0404['attributes']=_0x3a0404[_0x6d57('0x33')]['length']?_0x3a0404[_0x6d57('0x33')]:_0x4eb2c8[_0x6d57('0x30')];if(!_0x1ed5b5[_0x6d57('0x31')][_0x6d57('0x36')]('nolimit')){_0x3a0404[_0x6d57('0x1b')]=qs[_0x6d57('0x1b')](_0x1ed5b5[_0x6d57('0x31')][_0x6d57('0x1b')]);_0x3a0404[_0x6d57('0x1d')]=qs[_0x6d57('0x1d')](_0x1ed5b5[_0x6d57('0x31')][_0x6d57('0x1d')]);}_0x3a0404['order']=qs[_0x6d57('0x37')](_0x1ed5b5['query']['sort']);_0x3a0404[_0x6d57('0x38')]=qs[_0x6d57('0x32')](_[_0x6d57('0x39')](_0x1ed5b5['query'],_0x4eb2c8['filters']),_0x14e62f);if(_0x1ed5b5['query'][_0x6d57('0x3a')]){_0x3a0404[_0x6d57('0x38')]=_[_0x6d57('0x3b')](_0x3a0404['where'],{'$or':_['map'](_0x14e62f,function(_0x209049){if(_0x209049['type']!=='VIRTUAL'){var _0x2396c1={};_0x2396c1[_0x209049[_0x6d57('0x27')]]={'$like':'%'+_0x1ed5b5['query']['filter']+'%'};return _0x2396c1;}})});}_0x3a0404=_[_0x6d57('0x3b')]({},_0x3a0404,_0x1ed5b5[_0x6d57('0x3c')]);var _0x3d28fb={'where':_0x3a0404[_0x6d57('0x38')]};return db[_0x6d57('0x2b')][_0x6d57('0x1c')](_0x3d28fb)[_0x6d57('0x24')](function(_0x234b74){_0x34907e['count']=_0x234b74;if(_0x1ed5b5[_0x6d57('0x31')][_0x6d57('0x3d')]){_0x3a0404[_0x6d57('0x3e')]=[{'all':!![]}];}return db[_0x6d57('0x2b')][_0x6d57('0x3f')](_0x3a0404);})[_0x6d57('0x24')](function(_0x2debd3){_0x34907e[_0x6d57('0x40')]=_0x2debd3;return _0x34907e;})[_0x6d57('0x24')](respondWithFilteredResult(_0x3394f3,_0x3a0404))[_0x6d57('0x41')](handleError(_0x3394f3,null));};exports[_0x6d57('0x42')]=function(_0x11f464,_0x1529a2){var _0x4d6812={'raw':!![],'where':{'id':_0x11f464['params']['id']}},_0x55f711={};_0x55f711[_0x6d57('0x30')]=_[_0x6d57('0x43')](db['ServicenowField'][_0x6d57('0x2c')]);_0x55f711[_0x6d57('0x31')]=_[_0x6d57('0x43')](_0x11f464['query']);_0x55f711[_0x6d57('0x32')]=_[_0x6d57('0x34')](_0x55f711[_0x6d57('0x30')],_0x55f711[_0x6d57('0x31')]);_0x4d6812[_0x6d57('0x33')]=_[_0x6d57('0x34')](_0x55f711[_0x6d57('0x30')],qs[_0x6d57('0x35')](_0x11f464[_0x6d57('0x31')]['fields']));_0x4d6812[_0x6d57('0x33')]=_0x4d6812[_0x6d57('0x33')][_0x6d57('0x44')]?_0x4d6812[_0x6d57('0x33')]:_0x55f711[_0x6d57('0x30')];if(_0x11f464[_0x6d57('0x31')][_0x6d57('0x3d')]){_0x4d6812[_0x6d57('0x3e')]=[{'all':!![]}];}_0x4d6812=_[_0x6d57('0x3b')]({},_0x4d6812,_0x11f464[_0x6d57('0x3c')]);return db[_0x6d57('0x2b')][_0x6d57('0x45')](_0x4d6812)[_0x6d57('0x24')](handleEntityNotFound(_0x1529a2,null))[_0x6d57('0x24')](respondWithResult(_0x1529a2,null))[_0x6d57('0x41')](handleError(_0x1529a2,null));};exports['create']=function(_0x19e4c3,_0x421fe3){return db[_0x6d57('0x2b')]['create'](_0x19e4c3[_0x6d57('0x46')],{})[_0x6d57('0x24')](respondWithResult(_0x421fe3,0xc9))[_0x6d57('0x41')](handleError(_0x421fe3,null));};exports[_0x6d57('0x23')]=function(_0x508465,_0x4f8500){if(_0x508465[_0x6d57('0x46')]['id']){delete _0x508465[_0x6d57('0x46')]['id'];}return db[_0x6d57('0x2b')]['find']({'where':{'id':_0x508465[_0x6d57('0x47')]['id']}})[_0x6d57('0x24')](handleEntityNotFound(_0x4f8500,null))['then'](saveUpdates(_0x508465[_0x6d57('0x46')],null))[_0x6d57('0x24')](respondWithResult(_0x4f8500,null))[_0x6d57('0x41')](handleError(_0x4f8500,null));};exports[_0x6d57('0x48')]=function(_0x4a7bde,_0x15637f){return db['ServicenowField']['find']({'where':{'id':_0x4a7bde[_0x6d57('0x47')]['id']}})[_0x6d57('0x24')](handleEntityNotFound(_0x15637f,null))['then'](removeEntity(_0x15637f,null))['catch'](handleError(_0x15637f,null));}; \ No newline at end of file +var _0x97e8=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','ServicenowField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x16e2f6,_0xc1c6ec){var _0x295f79=function(_0x1eb279){while(--_0x1eb279){_0x16e2f6['push'](_0x16e2f6['shift']());}};_0x295f79(++_0xc1c6ec);}(_0x97e8,0xc0));var _0x897e=function(_0x5ad011,_0x191a65){_0x5ad011=_0x5ad011-0x0;var _0x178367=_0x97e8[_0x5ad011];return _0x178367;};'use strict';var emlformat=require(_0x897e('0x0'));var rimraf=require(_0x897e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x897e('0x2'));var rp=require(_0x897e('0x3'));var moment=require(_0x897e('0x4'));var BPromise=require(_0x897e('0x5'));var Mustache=require(_0x897e('0x6'));var util=require(_0x897e('0x7'));var path=require(_0x897e('0x8'));var sox=require(_0x897e('0x9'));var csv=require(_0x897e('0xa'));var ejs=require(_0x897e('0xb'));var fs=require('fs');var fs_extra=require(_0x897e('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x897e('0xd'));var jsforce=require(_0x897e('0xe'));var deskjs=require(_0x897e('0xf'));var toCsv=require(_0x897e('0xa'));var querystring=require('querystring');var Papa=require(_0x897e('0x10'));var Redis=require(_0x897e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x897e('0x12'));var as=require(_0x897e('0x13'));var hardwareService=require(_0x897e('0x14'));var logger=require(_0x897e('0x15'))('api');var utils=require(_0x897e('0x16'));var config=require(_0x897e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6c60,_0x3c0f03){_0x3c0f03=_0x3c0f03||0xcc;return function(_0x34799c){if(_0x34799c){return _0x1d6c60['sendStatus'](_0x3c0f03);}return _0x1d6c60[_0x897e('0x18')](_0x3c0f03)[_0x897e('0x19')]();};}function respondWithResult(_0x7a14c,_0x4c2be7){_0x4c2be7=_0x4c2be7||0xc8;return function(_0x5a8e1f){if(_0x5a8e1f){return _0x7a14c[_0x897e('0x18')](_0x4c2be7)[_0x897e('0x1a')](_0x5a8e1f);}};}function respondWithFilteredResult(_0x54c5be,_0x266ba1){return function(_0x51742e){if(_0x51742e){var _0x1a57fc=typeof _0x266ba1[_0x897e('0x1b')]===_0x897e('0x1c')&&typeof _0x266ba1[_0x897e('0x1d')]===_0x897e('0x1c');var _0x265ead=_0x51742e[_0x897e('0x1e')];var _0x4c8b5d=_0x1a57fc?0x0:_0x266ba1[_0x897e('0x1b')];var _0x18d4c9=_0x1a57fc?_0x51742e[_0x897e('0x1e')]:_0x266ba1['offset']+_0x266ba1[_0x897e('0x1d')];var _0x322776;if(_0x18d4c9>=_0x265ead){_0x18d4c9=_0x265ead;_0x322776=0xc8;}else{_0x322776=0xce;}_0x54c5be['status'](_0x322776);return _0x54c5be[_0x897e('0x1f')](_0x897e('0x20'),_0x4c8b5d+'-'+_0x18d4c9+'/'+_0x265ead)[_0x897e('0x1a')](_0x51742e);}return null;};}function patchUpdates(_0x49095d){return function(_0x25f0a1){try{jsonpatch[_0x897e('0x21')](_0x25f0a1,_0x49095d,!![]);}catch(_0x5c7646){return BPromise['reject'](_0x5c7646);}return _0x25f0a1['save']();};}function saveUpdates(_0x2cfadc,_0x40344d){return function(_0x5aa1fd){if(_0x5aa1fd){return _0x5aa1fd[_0x897e('0x22')](_0x2cfadc)[_0x897e('0x23')](function(_0x582f73){return _0x582f73;});}return null;};}function removeEntity(_0x40ec8d,_0x3a8101){return function(_0x2402a8){if(_0x2402a8){return _0x2402a8[_0x897e('0x24')]()[_0x897e('0x23')](function(){_0x40ec8d['status'](0xcc)[_0x897e('0x19')]();});}};}function handleEntityNotFound(_0x104005,_0xf0044f){return function(_0xb7323c){if(!_0xb7323c){_0x104005['sendStatus'](0x194);}return _0xb7323c;};}function handleError(_0x5566d1,_0x54edbf){_0x54edbf=_0x54edbf||0x1f4;return function(_0x5c5b10){logger[_0x897e('0x25')](_0x5c5b10[_0x897e('0x26')]);if(_0x5c5b10['name']){delete _0x5c5b10[_0x897e('0x27')];}_0x5566d1[_0x897e('0x18')](_0x54edbf)['send'](_0x5c5b10);};}exports[_0x897e('0x28')]=function(_0xd73733,_0x4e208b){var _0xf62494={},_0x20e015={},_0x2de124={'count':0x0,'rows':[]};var _0x1bd3e6=_[_0x897e('0x29')](db[_0x897e('0x2a')]['rawAttributes'],function(_0x2dc276){return{'name':_0x2dc276[_0x897e('0x2b')],'type':_0x2dc276[_0x897e('0x2c')]['key']};});_0x20e015[_0x897e('0x2d')]=_[_0x897e('0x29')](_0x1bd3e6,_0x897e('0x27'));_0x20e015[_0x897e('0x2e')]=_[_0x897e('0x2f')](_0xd73733[_0x897e('0x2e')]);_0x20e015[_0x897e('0x30')]=_[_0x897e('0x31')](_0x20e015[_0x897e('0x2d')],_0x20e015[_0x897e('0x2e')]);_0xf62494[_0x897e('0x32')]=_[_0x897e('0x31')](_0x20e015[_0x897e('0x2d')],qs[_0x897e('0x33')](_0xd73733[_0x897e('0x2e')][_0x897e('0x33')]));_0xf62494[_0x897e('0x32')]=_0xf62494[_0x897e('0x32')]['length']?_0xf62494[_0x897e('0x32')]:_0x20e015['model'];if(!_0xd73733[_0x897e('0x2e')]['hasOwnProperty'](_0x897e('0x34'))){_0xf62494[_0x897e('0x1d')]=qs[_0x897e('0x1d')](_0xd73733[_0x897e('0x2e')][_0x897e('0x1d')]);_0xf62494[_0x897e('0x1b')]=qs[_0x897e('0x1b')](_0xd73733[_0x897e('0x2e')]['offset']);}_0xf62494[_0x897e('0x35')]=qs[_0x897e('0x36')](_0xd73733['query'][_0x897e('0x36')]);_0xf62494[_0x897e('0x37')]=qs[_0x897e('0x30')](_[_0x897e('0x38')](_0xd73733[_0x897e('0x2e')],_0x20e015[_0x897e('0x30')]),_0x1bd3e6);if(_0xd73733[_0x897e('0x2e')]['filter']){_0xf62494[_0x897e('0x37')]=_['merge'](_0xf62494[_0x897e('0x37')],{'$or':_['map'](_0x1bd3e6,function(_0x112fad){if(_0x112fad[_0x897e('0x2c')]!==_0x897e('0x39')){var _0x3674e7={};_0x3674e7[_0x112fad[_0x897e('0x27')]]={'$like':'%'+_0xd73733[_0x897e('0x2e')][_0x897e('0x3a')]+'%'};return _0x3674e7;}})});}_0xf62494=_['merge']({},_0xf62494,_0xd73733['options']);var _0x40189d={'where':_0xf62494[_0x897e('0x37')]};return db[_0x897e('0x2a')][_0x897e('0x1e')](_0x40189d)[_0x897e('0x23')](function(_0x3a00d7){_0x2de124[_0x897e('0x1e')]=_0x3a00d7;if(_0xd73733['query'][_0x897e('0x3b')]){_0xf62494[_0x897e('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0x897e('0x3d')](_0xf62494);})[_0x897e('0x23')](function(_0x38a7be){_0x2de124[_0x897e('0x3e')]=_0x38a7be;return _0x2de124;})[_0x897e('0x23')](respondWithFilteredResult(_0x4e208b,_0xf62494))[_0x897e('0x3f')](handleError(_0x4e208b,null));};exports[_0x897e('0x40')]=function(_0x48b585,_0x31251a){var _0x1beafe={'raw':!![],'where':{'id':_0x48b585[_0x897e('0x41')]['id']}},_0x26afef={};_0x26afef[_0x897e('0x2d')]=_[_0x897e('0x2f')](db[_0x897e('0x2a')][_0x897e('0x42')]);_0x26afef[_0x897e('0x2e')]=_['keys'](_0x48b585['query']);_0x26afef['filters']=_[_0x897e('0x31')](_0x26afef[_0x897e('0x2d')],_0x26afef[_0x897e('0x2e')]);_0x1beafe[_0x897e('0x32')]=_['intersection'](_0x26afef[_0x897e('0x2d')],qs[_0x897e('0x33')](_0x48b585[_0x897e('0x2e')][_0x897e('0x33')]));_0x1beafe[_0x897e('0x32')]=_0x1beafe[_0x897e('0x32')]['length']?_0x1beafe[_0x897e('0x32')]:_0x26afef[_0x897e('0x2d')];if(_0x48b585[_0x897e('0x2e')]['includeAll']){_0x1beafe['include']=[{'all':!![]}];}_0x1beafe=_[_0x897e('0x43')]({},_0x1beafe,_0x48b585[_0x897e('0x44')]);return db[_0x897e('0x2a')]['find'](_0x1beafe)[_0x897e('0x23')](handleEntityNotFound(_0x31251a,null))[_0x897e('0x23')](respondWithResult(_0x31251a,null))[_0x897e('0x3f')](handleError(_0x31251a,null));};exports['create']=function(_0x5e5074,_0x6cd297){return db[_0x897e('0x2a')][_0x897e('0x45')](_0x5e5074['body'],{})[_0x897e('0x23')](respondWithResult(_0x6cd297,0xc9))[_0x897e('0x3f')](handleError(_0x6cd297,null));};exports[_0x897e('0x22')]=function(_0x577a3b,_0xa40fcf){if(_0x577a3b['body']['id']){delete _0x577a3b[_0x897e('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x577a3b[_0x897e('0x41')]['id']}})[_0x897e('0x23')](handleEntityNotFound(_0xa40fcf,null))[_0x897e('0x23')](saveUpdates(_0x577a3b[_0x897e('0x46')],null))[_0x897e('0x23')](respondWithResult(_0xa40fcf,null))[_0x897e('0x3f')](handleError(_0xa40fcf,null));};exports[_0x897e('0x24')]=function(_0x528a05,_0x1e35c3){return db[_0x897e('0x2a')][_0x897e('0x47')]({'where':{'id':_0x528a05['params']['id']}})['then'](handleEntityNotFound(_0x1e35c3,null))[_0x897e('0x23')](removeEntity(_0x1e35c3,null))[_0x897e('0x3f')](handleError(_0x1e35c3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 054c53f..230cd45 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 _0x89ed=['./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x481469,_0x5292fb){var _0x3879f5=function(_0x32a439){while(--_0x32a439){_0x481469['push'](_0x481469['shift']());}};_0x3879f5(++_0x5292fb);}(_0x89ed,0xbd));var _0xd89e=function(_0x5602bf,_0x36c12e){_0x5602bf=_0x5602bf-0x0;var _0x21345d=_0x89ed[_0x5602bf];return _0x21345d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd89e('0x0'))(_0xd89e('0x1'));var moment=require(_0xd89e('0x2'));var BPromise=require(_0xd89e('0x3'));var rp=require(_0xd89e('0x4'));var fs=require('fs');var path=require(_0xd89e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd89e('0x6'));module['exports']=function(_0x55676e,_0xb4f154){return _0x55676e[_0xd89e('0x7')](_0xd89e('0x8'),attributes,{'tableName':_0xd89e('0x9'),'paranoid':![],'indexes':[{'name':_0xd89e('0xa'),'fields':[_0xd89e('0xb'),_0xd89e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6e4=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField','lodash','util','../../config/logger'];(function(_0x49f30e,_0xf28439){var _0x2cafd5=function(_0x581d4c){while(--_0x581d4c){_0x49f30e['push'](_0x49f30e['shift']());}};_0x2cafd5(++_0xf28439);}(_0xf6e4,0x1a1));var _0x4f6e=function(_0x2f582b,_0x4fc550){_0x2f582b=_0x2f582b-0x0;var _0x594706=_0xf6e4[_0x2f582b];return _0x594706;};'use strict';var _=require(_0x4f6e('0x0'));var util=require(_0x4f6e('0x1'));var logger=require(_0x4f6e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f6e('0x3'));var fs=require('fs');var path=require(_0x4f6e('0x4'));var rimraf=require(_0x4f6e('0x5'));var config=require(_0x4f6e('0x6'));var attributes=require(_0x4f6e('0x7'));module[_0x4f6e('0x8')]=function(_0x3de06d,_0xed81){return _0x3de06d[_0x4f6e('0x9')]('ServicenowField',attributes,{'tableName':_0x4f6e('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x4f6e('0xb'),'FieldId'],'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 6b504a9..cf2d408 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xac4a,0x13f));var _0xaac4=function(_0x1544f2,_0x58a26a){_0x1544f2=_0x1544f2-0x0;var _0x5863a5=_0xac4a[_0x1544f2];return _0x5863a5;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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')]('ServicenowField,\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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e2bb4c0..23ccbdd 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x57dccf,_0x3f4ef9){var _0x240d58=function(_0x2134e8){while(--_0x2134e8){_0x57dccf['push'](_0x57dccf['shift']());}};_0x240d58(++_0x3f4ef9);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xe651bc,_0x20f7f1){var _0x1876f5=function(_0x24a1fa){while(--_0x24a1fa){_0xe651bc['push'](_0xe651bc['shift']());}};_0x1876f5(++_0x20f7f1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index da27739..668f4c2 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 _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3b087e,_0x11f2fe){var _0x3b8e4c=function(_0x536f0f){while(--_0x536f0f){_0x3b087e['push'](_0x3b087e['shift']());}};_0x3b8e4c(++_0x11f2fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2eb2ee,_0x1bd381){var _0x59e579=function(_0x16bd1b){while(--_0x16bd1b){_0x2eb2ee['push'](_0x2eb2ee['shift']());}};_0x59e579(++_0x1bd381);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 5733538..fa7e863 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 _0x8e56=['index','SugarcrmAccount','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','keys','includeAll','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name'];(function(_0x1d2520,_0x105606){var _0x22fd54=function(_0x2c3123){while(--_0x2c3123){_0x1d2520['push'](_0x1d2520['shift']());}};_0x22fd54(++_0x105606);}(_0x8e56,0xc7));var _0x68e5=function(_0x3a108c,_0x11a79c){_0x3a108c=_0x3a108c-0x0;var _0x1c34fd=_0x8e56[_0x3a108c];return _0x1c34fd;};'use strict';var emlformat=require(_0x68e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68e5('0x2'));var moment=require(_0x68e5('0x3'));var BPromise=require(_0x68e5('0x4'));var Mustache=require(_0x68e5('0x5'));var util=require(_0x68e5('0x6'));var path=require('path');var sox=require(_0x68e5('0x7'));var csv=require(_0x68e5('0x8'));var ejs=require(_0x68e5('0x9'));var fs=require('fs');var fs_extra=require(_0x68e5('0xa'));var _=require(_0x68e5('0xb'));var squel=require('squel');var crypto=require(_0x68e5('0xc'));var jsforce=require(_0x68e5('0xd'));var deskjs=require(_0x68e5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x68e5('0xf'));var Redis=require(_0x68e5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x68e5('0x11'));var as=require(_0x68e5('0x12'));var hardwareService=require(_0x68e5('0x13'));var logger=require(_0x68e5('0x14'))(_0x68e5('0x15'));var utils=require(_0x68e5('0x16'));var config=require(_0x68e5('0x17'));var licenseUtil=require(_0x68e5('0x18'));var db=require(_0x68e5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x410da4,_0x2441ba){_0x2441ba=_0x2441ba||0xcc;return function(_0x448aac){if(_0x448aac){return _0x410da4[_0x68e5('0x1a')](_0x2441ba);}return _0x410da4[_0x68e5('0x1b')](_0x2441ba)[_0x68e5('0x1c')]();};}function respondWithResult(_0x289e16,_0x273296){_0x273296=_0x273296||0xc8;return function(_0x4c97bf){if(_0x4c97bf){return _0x289e16[_0x68e5('0x1b')](_0x273296)[_0x68e5('0x1d')](_0x4c97bf);}};}function respondWithFilteredResult(_0xa9f1c4,_0x561588){return function(_0x1fe150){if(_0x1fe150){var _0x1270fa=typeof _0x561588[_0x68e5('0x1e')]===_0x68e5('0x1f')&&typeof _0x561588[_0x68e5('0x20')]===_0x68e5('0x1f');var _0x509598=_0x1fe150[_0x68e5('0x21')];var _0x4a5536=_0x1270fa?0x0:_0x561588[_0x68e5('0x1e')];var _0xb3200a=_0x1270fa?_0x1fe150[_0x68e5('0x21')]:_0x561588[_0x68e5('0x1e')]+_0x561588[_0x68e5('0x20')];var _0x509f5f;if(_0xb3200a>=_0x509598){_0xb3200a=_0x509598;_0x509f5f=0xc8;}else{_0x509f5f=0xce;}_0xa9f1c4[_0x68e5('0x1b')](_0x509f5f);return _0xa9f1c4[_0x68e5('0x22')](_0x68e5('0x23'),_0x4a5536+'-'+_0xb3200a+'/'+_0x509598)['json'](_0x1fe150);}return null;};}function patchUpdates(_0x45211e){return function(_0xf54307){try{jsonpatch[_0x68e5('0x24')](_0xf54307,_0x45211e,!![]);}catch(_0x60f296){return BPromise['reject'](_0x60f296);}return _0xf54307['save']();};}function saveUpdates(_0x47e41d,_0x28ad7e){return function(_0x2c1fa3){if(_0x2c1fa3){return _0x2c1fa3[_0x68e5('0x25')](_0x47e41d)[_0x68e5('0x26')](function(_0x1eb3d9){return _0x1eb3d9;});}return null;};}function removeEntity(_0xb36d18,_0xa7ea8c){return function(_0x247eb1){if(_0x247eb1){return _0x247eb1[_0x68e5('0x27')]()[_0x68e5('0x26')](function(){_0xb36d18[_0x68e5('0x1b')](0xcc)[_0x68e5('0x1c')]();});}};}function handleEntityNotFound(_0x150f98,_0x4e92f6){return function(_0x232477){if(!_0x232477){_0x150f98[_0x68e5('0x1a')](0x194);}return _0x232477;};}function handleError(_0x21898e,_0x2bb84b){_0x2bb84b=_0x2bb84b||0x1f4;return function(_0x3c6be0){logger[_0x68e5('0x28')](_0x3c6be0[_0x68e5('0x29')]);if(_0x3c6be0[_0x68e5('0x2a')]){delete _0x3c6be0[_0x68e5('0x2a')];}_0x21898e[_0x68e5('0x1b')](_0x2bb84b)['send'](_0x3c6be0);};}exports[_0x68e5('0x2b')]=function(_0xf2cfb2,_0x4d53eb){var _0x2b0b84={},_0x31bebd={},_0x445c9d={'count':0x0,'rows':[]};var _0xaf5200=_['map'](db[_0x68e5('0x2c')][_0x68e5('0x2d')],function(_0x812ff3){return{'name':_0x812ff3['fieldName'],'type':_0x812ff3[_0x68e5('0x2e')][_0x68e5('0x2f')]};});_0x31bebd[_0x68e5('0x30')]=_[_0x68e5('0x31')](_0xaf5200,_0x68e5('0x2a'));_0x31bebd[_0x68e5('0x32')]=_['keys'](_0xf2cfb2['query']);_0x31bebd['filters']=_[_0x68e5('0x33')](_0x31bebd[_0x68e5('0x30')],_0x31bebd[_0x68e5('0x32')]);_0x2b0b84[_0x68e5('0x34')]=_[_0x68e5('0x33')](_0x31bebd[_0x68e5('0x30')],qs[_0x68e5('0x35')](_0xf2cfb2[_0x68e5('0x32')][_0x68e5('0x35')]));_0x2b0b84[_0x68e5('0x34')]=_0x2b0b84[_0x68e5('0x34')][_0x68e5('0x36')]?_0x2b0b84[_0x68e5('0x34')]:_0x31bebd[_0x68e5('0x30')];if(!_0xf2cfb2[_0x68e5('0x32')][_0x68e5('0x37')](_0x68e5('0x38'))){_0x2b0b84[_0x68e5('0x20')]=qs[_0x68e5('0x20')](_0xf2cfb2['query'][_0x68e5('0x20')]);_0x2b0b84[_0x68e5('0x1e')]=qs[_0x68e5('0x1e')](_0xf2cfb2[_0x68e5('0x32')][_0x68e5('0x1e')]);}_0x2b0b84[_0x68e5('0x39')]=qs[_0x68e5('0x3a')](_0xf2cfb2[_0x68e5('0x32')]['sort']);_0x2b0b84[_0x68e5('0x3b')]=qs[_0x68e5('0x3c')](_[_0x68e5('0x3d')](_0xf2cfb2[_0x68e5('0x32')],_0x31bebd[_0x68e5('0x3c')]),_0xaf5200);if(_0xf2cfb2[_0x68e5('0x32')][_0x68e5('0x3e')]){_0x2b0b84[_0x68e5('0x3b')]=_[_0x68e5('0x3f')](_0x2b0b84[_0x68e5('0x3b')],{'$or':_['map'](_0xaf5200,function(_0x1c2f12){if(_0x1c2f12['type']!==_0x68e5('0x40')){var _0x502e96={};_0x502e96[_0x1c2f12[_0x68e5('0x2a')]]={'$like':'%'+_0xf2cfb2['query'][_0x68e5('0x3e')]+'%'};return _0x502e96;}})});}_0x2b0b84=_[_0x68e5('0x3f')]({},_0x2b0b84,_0xf2cfb2[_0x68e5('0x41')]);var _0x1b0b70={'where':_0x2b0b84[_0x68e5('0x3b')]};return db[_0x68e5('0x2c')][_0x68e5('0x21')](_0x1b0b70)[_0x68e5('0x26')](function(_0x16f10a){_0x445c9d[_0x68e5('0x21')]=_0x16f10a;if(_0xf2cfb2['query']['includeAll']){_0x2b0b84[_0x68e5('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x2b0b84);})[_0x68e5('0x26')](function(_0x4569da){_0x445c9d['rows']=_0x4569da;return _0x445c9d;})[_0x68e5('0x26')](respondWithFilteredResult(_0x4d53eb,_0x2b0b84))[_0x68e5('0x43')](handleError(_0x4d53eb,null));};exports[_0x68e5('0x44')]=function(_0x1f2f70,_0x5244bf){var _0x42abc3={'raw':![],'where':{'id':_0x1f2f70['params']['id']}},_0x505fe4={};_0x505fe4[_0x68e5('0x30')]=_[_0x68e5('0x45')](db[_0x68e5('0x2c')][_0x68e5('0x2d')]);_0x505fe4[_0x68e5('0x32')]=_[_0x68e5('0x45')](_0x1f2f70[_0x68e5('0x32')]);_0x505fe4[_0x68e5('0x3c')]=_[_0x68e5('0x33')](_0x505fe4['model'],_0x505fe4[_0x68e5('0x32')]);_0x42abc3['attributes']=_[_0x68e5('0x33')](_0x505fe4[_0x68e5('0x30')],qs['fields'](_0x1f2f70[_0x68e5('0x32')]['fields']));_0x42abc3[_0x68e5('0x34')]=_0x42abc3[_0x68e5('0x34')]['length']?_0x42abc3[_0x68e5('0x34')]:_0x505fe4[_0x68e5('0x30')];if(_0x1f2f70[_0x68e5('0x32')][_0x68e5('0x46')]){_0x42abc3[_0x68e5('0x42')]=[{'all':!![]}];}_0x42abc3=_['merge']({},_0x42abc3,_0x1f2f70[_0x68e5('0x41')]);return db[_0x68e5('0x2c')]['find'](_0x42abc3)['then'](handleEntityNotFound(_0x5244bf,null))[_0x68e5('0x26')](respondWithResult(_0x5244bf,null))[_0x68e5('0x43')](handleError(_0x5244bf,null));};exports[_0x68e5('0x47')]=function(_0x2cbe9d,_0x289fd8){return db['SugarcrmAccount'][_0x68e5('0x47')](_0x2cbe9d[_0x68e5('0x48')],{})['then'](respondWithResult(_0x289fd8,0xc9))[_0x68e5('0x43')](handleError(_0x289fd8,null));};exports[_0x68e5('0x25')]=function(_0x4900ff,_0x1d6bbe){if(_0x4900ff['body']['id']){delete _0x4900ff[_0x68e5('0x48')]['id'];}return db[_0x68e5('0x2c')][_0x68e5('0x49')]({'where':{'id':_0x4900ff[_0x68e5('0x4a')]['id']}})[_0x68e5('0x26')](handleEntityNotFound(_0x1d6bbe,null))[_0x68e5('0x26')](saveUpdates(_0x4900ff[_0x68e5('0x48')],null))[_0x68e5('0x26')](respondWithResult(_0x1d6bbe,null))[_0x68e5('0x43')](handleError(_0x1d6bbe,null));};exports[_0x68e5('0x27')]=function(_0x4fb0c0,_0x435b4f){return db['SugarcrmAccount']['find']({'where':{'id':_0x4fb0c0[_0x68e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x435b4f,null))[_0x68e5('0x26')](removeEntity(_0x435b4f,null))[_0x68e5('0x43')](handleError(_0x435b4f,null));};exports[_0x68e5('0x4b')]=function(_0x26fdce,_0x4f9a16,_0x12702e){var _0x16373d={};var _0x13e7c7={};var _0x25d6ef;var _0x34500f;return db['SugarcrmAccount'][_0x68e5('0x4c')]({'where':{'id':_0x26fdce[_0x68e5('0x4a')]['id']}})[_0x68e5('0x26')](handleEntityNotFound(_0x4f9a16,null))[_0x68e5('0x26')](function(_0x5bef88){if(_0x5bef88){_0x25d6ef=_0x5bef88;_0x13e7c7[_0x68e5('0x30')]=_[_0x68e5('0x45')](db[_0x68e5('0x4d')]['rawAttributes']);_0x13e7c7[_0x68e5('0x32')]=_[_0x68e5('0x45')](_0x26fdce[_0x68e5('0x32')]);_0x13e7c7[_0x68e5('0x3c')]=_[_0x68e5('0x33')](_0x13e7c7[_0x68e5('0x30')],_0x13e7c7[_0x68e5('0x32')]);_0x16373d[_0x68e5('0x34')]=_[_0x68e5('0x33')](_0x13e7c7[_0x68e5('0x30')],qs[_0x68e5('0x35')](_0x26fdce[_0x68e5('0x32')][_0x68e5('0x35')]));_0x16373d[_0x68e5('0x34')]=_0x16373d[_0x68e5('0x34')][_0x68e5('0x36')]?_0x16373d[_0x68e5('0x34')]:_0x13e7c7[_0x68e5('0x30')];_0x16373d[_0x68e5('0x39')]=qs[_0x68e5('0x3a')](_0x26fdce[_0x68e5('0x32')]['sort']);_0x16373d[_0x68e5('0x3b')]=qs[_0x68e5('0x3c')](_[_0x68e5('0x3d')](_0x26fdce[_0x68e5('0x32')],_0x13e7c7[_0x68e5('0x3c')]));if(_0x26fdce[_0x68e5('0x32')][_0x68e5('0x3e')]){_0x16373d['where']=_[_0x68e5('0x3f')](_0x16373d['where'],{'$or':_[_0x68e5('0x31')](_0x16373d['attributes'],function(_0x55485a){var _0x3ab034={};_0x3ab034[_0x55485a]={'$like':'%'+_0x26fdce[_0x68e5('0x32')][_0x68e5('0x3e')]+'%'};return _0x3ab034;})});}_0x16373d=_[_0x68e5('0x3f')]({},_0x16373d,_0x26fdce[_0x68e5('0x41')]);return _0x25d6ef['getConfigurations'](_0x16373d);}})[_0x68e5('0x26')](function(_0x304190){if(_0x304190){_0x34500f=_0x304190[_0x68e5('0x36')];if(!_0x26fdce['query'][_0x68e5('0x37')]('nolimit')){_0x16373d[_0x68e5('0x20')]=qs[_0x68e5('0x20')](_0x26fdce[_0x68e5('0x32')]['limit']);_0x16373d[_0x68e5('0x1e')]=qs['offset'](_0x26fdce['query']['offset']);}return _0x25d6ef['getConfigurations'](_0x16373d);}})[_0x68e5('0x26')](function(_0x54bf6d){if(_0x54bf6d){return _0x54bf6d?{'count':_0x34500f,'rows':_0x54bf6d}:null;}})[_0x68e5('0x26')](respondWithResult(_0x4f9a16,null))[_0x68e5('0x43')](handleError(_0x4f9a16,null));};exports['addConfiguration']=function(_0x242939,_0x4046a5,_0x46bc77){if(_0x242939[_0x68e5('0x48')]['id']){delete _0x242939[_0x68e5('0x48')]['id'];}return db[_0x68e5('0x2c')][_0x68e5('0x4c')]({'where':{'id':_0x242939[_0x68e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4046a5,null))[_0x68e5('0x26')](function(_0x15bef1){if(_0x15bef1){_0x242939[_0x68e5('0x48')]['AccountId']=_0x15bef1['id'];_0x242939[_0x68e5('0x48')][_0x68e5('0x4e')]=integrations[_0x68e5('0x4f')](_0x242939[_0x68e5('0x48')][_0x68e5('0x50')],_0x242939[_0x68e5('0x48')][_0x68e5('0x2e')]);_0x242939[_0x68e5('0x48')]['Descriptions']=integrations[_0x68e5('0x51')](_0x242939[_0x68e5('0x48')]['channel'],_0x242939[_0x68e5('0x48')][_0x68e5('0x2e')]);return db['SugarcrmConfiguration']['create'](_0x242939['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x68e5('0x4e')},{'model':db[_0x68e5('0x52')],'as':_0x68e5('0x53')}]});}return null;})[_0x68e5('0x26')](respondWithResult(_0x4046a5,null))['catch'](handleError(_0x4046a5,null));};exports[_0x68e5('0x54')]=function(_0x211a52,_0x1c2146,_0xb9adbb){var _0x594a85='';var _0x38a977=['id','name',_0x68e5('0x55'),_0x68e5('0x56'),_0x68e5('0x57'),_0x68e5('0x58'),_0x68e5('0x59'),_0x68e5('0x5a'),_0x68e5('0x5b'),'parent_type',_0x68e5('0x5c'),_0x68e5('0x5d')];return db[_0x68e5('0x2c')][_0x68e5('0x4c')]({'where':{'id':_0x211a52[_0x68e5('0x4a')]['id']},'attributes':['id',_0x68e5('0x5e'),_0x68e5('0x5f'),_0x68e5('0x60')]})[_0x68e5('0x26')](handleEntityNotFound(_0x1c2146,null))[_0x68e5('0x26')](function(_0x4c19a4){if(_0x4c19a4){_0x594a85=_0x4c19a4[_0x68e5('0x60')];var _0x9d5988=_0x594a85[_0x68e5('0x61')](-0x1);if(_0x9d5988==='/'){_0x594a85=_0x594a85[_0x68e5('0x62')](0x0,_0x594a85['lastIndexOf'](_0x9d5988));}return rp({'method':'POST','uri':util['format']('%s%s',_0x594a85,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x68e5('0x63'),'input_type':_0x68e5('0x64'),'response_type':_0x68e5('0x64'),'rest_data':JSON[_0x68e5('0x65')]({'user_auth':{'user_name':_0x4c19a4[_0x68e5('0x5e')],'password':_0x4c19a4[_0x68e5('0x5f')],'encryption':'PLAIN'},'application':_0x68e5('0x66')})}});}})[_0x68e5('0x26')](function(_0x8b3dc8){if(_0x8b3dc8&&_0x8b3dc8[_0x68e5('0x2a')]!==_0x68e5('0x67')&&_0x8b3dc8[_0x68e5('0x2a')]!==_0x68e5('0x68')){return rp({'method':_0x68e5('0x69'),'uri':util[_0x68e5('0x6a')](_0x68e5('0x6b'),_0x594a85,_0x68e5('0x6c')),'json':!![],'form':{'method':_0x68e5('0x6d'),'input_type':_0x68e5('0x64'),'response_type':_0x68e5('0x64'),'rest_data':JSON[_0x68e5('0x65')]({'session':_0x8b3dc8['id'],'module_name':_0x68e5('0x6e')})}})['then'](function(_0x2b1882){if(_0x2b1882){var _0x2c89f3=_[_0x68e5('0x6f')](_0x2b1882['module_fields']);_[_0x68e5('0x70')](_0x2c89f3,function(_0xf8ac3b){return _0x38a977[_0x68e5('0x71')](_0xf8ac3b[_0x68e5('0x2a')]);});return{'count':_0x2c89f3[_0x68e5('0x36')],'rows':_[_0x68e5('0x31')](_0x2c89f3,function(_0x3e5c72){return{'id':_0x3e5c72[_0x68e5('0x2a')],'name':_0x3e5c72[_0x68e5('0x72')],'custom':_['endsWith'](_0x3e5c72[_0x68e5('0x2a')],'_c')?!![]:![],'options':_0x3e5c72['options']?_['map'](_[_0x68e5('0x6f')](_0x3e5c72[_0x68e5('0x41')]),function(_0x164857){return{'name':_0x164857[_0x68e5('0x73')],'value':_0x164857[_0x68e5('0x2a')]};}):[]};})};}})[_0x68e5('0x26')](respondWithResult(_0x1c2146,null))[_0x68e5('0x43')](function(_0x7751cf){var _0x20fce0=_0x211a52[_0x68e5('0x32')][_0x68e5('0x74')]?0x1f4:_0x7751cf[_0x68e5('0x75')]||0x1f4;logger[_0x68e5('0x28')](_0x68e5('0x76'),_0x68e5('0x54'),_0x20fce0,JSON['stringify'](_0x7751cf));delete _0x7751cf[_0x68e5('0x2a')];if(_0x20fce0===0x191){_0x20fce0=0x190;}_0x1c2146[_0x68e5('0x1b')](_0x20fce0)['send'](_0x211a52[_0x68e5('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x7751cf[_0x68e5('0x75')]}:_0x7751cf);});}else{var _0x51fac5=0x1f4;_0x1c2146[_0x68e5('0x1b')](_0x51fac5)[_0x68e5('0x77')]({'message':_0x68e5('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8869=['description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','substring','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','Password\x20Expired','POST','format','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SugarcrmAccount','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','getSubjects','channel','Descriptions','Subjects','assigned_user_id'];(function(_0x4ec46b,_0x47fdd6){var _0x297775=function(_0xc2e7a1){while(--_0xc2e7a1){_0x4ec46b['push'](_0x4ec46b['shift']());}};_0x297775(++_0x47fdd6);}(_0x8869,0x94));var _0x9886=function(_0x3200d2,_0x1f0325){_0x3200d2=_0x3200d2-0x0;var _0x81041c=_0x8869[_0x3200d2];return _0x81041c;};'use strict';var emlformat=require(_0x9886('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9886('0x1'));var jsonpatch=require(_0x9886('0x2'));var rp=require('request-promise');var moment=require(_0x9886('0x3'));var BPromise=require(_0x9886('0x4'));var Mustache=require(_0x9886('0x5'));var util=require(_0x9886('0x6'));var path=require(_0x9886('0x7'));var sox=require(_0x9886('0x8'));var csv=require('to-csv');var ejs=require(_0x9886('0x9'));var fs=require('fs');var fs_extra=require(_0x9886('0xa'));var _=require('lodash');var squel=require(_0x9886('0xb'));var crypto=require('crypto');var jsforce=require(_0x9886('0xc'));var deskjs=require(_0x9886('0xd'));var toCsv=require(_0x9886('0xe'));var querystring=require(_0x9886('0xf'));var Papa=require(_0x9886('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9886('0x11'));var as=require(_0x9886('0x12'));var hardwareService=require(_0x9886('0x13'));var logger=require(_0x9886('0x14'))(_0x9886('0x15'));var utils=require(_0x9886('0x16'));var config=require(_0x9886('0x17'));var licenseUtil=require(_0x9886('0x18'));var db=require(_0x9886('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14dc2c,_0x25f4de){_0x25f4de=_0x25f4de||0xcc;return function(_0x157ea2){if(_0x157ea2){return _0x14dc2c[_0x9886('0x1a')](_0x25f4de);}return _0x14dc2c[_0x9886('0x1b')](_0x25f4de)[_0x9886('0x1c')]();};}function respondWithResult(_0x3ee199,_0x154902){_0x154902=_0x154902||0xc8;return function(_0x592d16){if(_0x592d16){return _0x3ee199[_0x9886('0x1b')](_0x154902)[_0x9886('0x1d')](_0x592d16);}};}function respondWithFilteredResult(_0x5a80e7,_0x4d7be8){return function(_0x35cfd3){if(_0x35cfd3){var _0x23eccc=typeof _0x4d7be8[_0x9886('0x1e')]==='undefined'&&typeof _0x4d7be8[_0x9886('0x1f')]===_0x9886('0x20');var _0x4e2f8d=_0x35cfd3[_0x9886('0x21')];var _0x47a40c=_0x23eccc?0x0:_0x4d7be8[_0x9886('0x1e')];var _0x31693d=_0x23eccc?_0x35cfd3['count']:_0x4d7be8[_0x9886('0x1e')]+_0x4d7be8[_0x9886('0x1f')];var _0x310dfc;if(_0x31693d>=_0x4e2f8d){_0x31693d=_0x4e2f8d;_0x310dfc=0xc8;}else{_0x310dfc=0xce;}_0x5a80e7[_0x9886('0x1b')](_0x310dfc);return _0x5a80e7['set'](_0x9886('0x22'),_0x47a40c+'-'+_0x31693d+'/'+_0x4e2f8d)[_0x9886('0x1d')](_0x35cfd3);}return null;};}function patchUpdates(_0x8440ac){return function(_0xd2f557){try{jsonpatch['apply'](_0xd2f557,_0x8440ac,!![]);}catch(_0x277254){return BPromise[_0x9886('0x23')](_0x277254);}return _0xd2f557[_0x9886('0x24')]();};}function saveUpdates(_0x2bebde,_0x5e5862){return function(_0x217e53){if(_0x217e53){return _0x217e53['update'](_0x2bebde)[_0x9886('0x25')](function(_0x5c0515){return _0x5c0515;});}return null;};}function removeEntity(_0xa57b88,_0x291ab3){return function(_0xe6b6f7){if(_0xe6b6f7){return _0xe6b6f7[_0x9886('0x26')]()['then'](function(){_0xa57b88['status'](0xcc)[_0x9886('0x1c')]();});}};}function handleEntityNotFound(_0x57fe9c,_0x25136f){return function(_0x4cd295){if(!_0x4cd295){_0x57fe9c[_0x9886('0x1a')](0x194);}return _0x4cd295;};}function handleError(_0xdc4340,_0x3ab8df){_0x3ab8df=_0x3ab8df||0x1f4;return function(_0x5b380){logger[_0x9886('0x27')](_0x5b380[_0x9886('0x28')]);if(_0x5b380[_0x9886('0x29')]){delete _0x5b380[_0x9886('0x29')];}_0xdc4340[_0x9886('0x1b')](_0x3ab8df)[_0x9886('0x2a')](_0x5b380);};}exports['index']=function(_0x410002,_0x3aa06a){var _0x2d035e={},_0x262f8f={},_0x303c87={'count':0x0,'rows':[]};var _0x20247d=_[_0x9886('0x2b')](db['SugarcrmAccount'][_0x9886('0x2c')],function(_0x3f88f3){return{'name':_0x3f88f3[_0x9886('0x2d')],'type':_0x3f88f3[_0x9886('0x2e')][_0x9886('0x2f')]};});_0x262f8f[_0x9886('0x30')]=_[_0x9886('0x2b')](_0x20247d,_0x9886('0x29'));_0x262f8f['query']=_[_0x9886('0x31')](_0x410002[_0x9886('0x32')]);_0x262f8f['filters']=_['intersection'](_0x262f8f[_0x9886('0x30')],_0x262f8f[_0x9886('0x32')]);_0x2d035e[_0x9886('0x33')]=_[_0x9886('0x34')](_0x262f8f[_0x9886('0x30')],qs['fields'](_0x410002['query'][_0x9886('0x35')]));_0x2d035e[_0x9886('0x33')]=_0x2d035e['attributes'][_0x9886('0x36')]?_0x2d035e[_0x9886('0x33')]:_0x262f8f[_0x9886('0x30')];if(!_0x410002['query'][_0x9886('0x37')](_0x9886('0x38'))){_0x2d035e[_0x9886('0x1f')]=qs[_0x9886('0x1f')](_0x410002[_0x9886('0x32')][_0x9886('0x1f')]);_0x2d035e['offset']=qs['offset'](_0x410002[_0x9886('0x32')]['offset']);}_0x2d035e[_0x9886('0x39')]=qs['sort'](_0x410002[_0x9886('0x32')][_0x9886('0x3a')]);_0x2d035e[_0x9886('0x3b')]=qs[_0x9886('0x3c')](_[_0x9886('0x3d')](_0x410002['query'],_0x262f8f['filters']),_0x20247d);if(_0x410002[_0x9886('0x32')][_0x9886('0x3e')]){_0x2d035e[_0x9886('0x3b')]=_[_0x9886('0x3f')](_0x2d035e[_0x9886('0x3b')],{'$or':_[_0x9886('0x2b')](_0x20247d,function(_0x344fca){if(_0x344fca[_0x9886('0x2e')]!=='VIRTUAL'){var _0x4cb2e0={};_0x4cb2e0[_0x344fca[_0x9886('0x29')]]={'$like':'%'+_0x410002['query'][_0x9886('0x3e')]+'%'};return _0x4cb2e0;}})});}_0x2d035e=_[_0x9886('0x3f')]({},_0x2d035e,_0x410002[_0x9886('0x40')]);var _0x5db349={'where':_0x2d035e[_0x9886('0x3b')]};return db[_0x9886('0x41')][_0x9886('0x21')](_0x5db349)[_0x9886('0x25')](function(_0xd9825){_0x303c87[_0x9886('0x21')]=_0xd9825;if(_0x410002[_0x9886('0x32')][_0x9886('0x42')]){_0x2d035e[_0x9886('0x43')]=[{'all':!![]}];}return db[_0x9886('0x41')][_0x9886('0x44')](_0x2d035e);})[_0x9886('0x25')](function(_0x24eab3){_0x303c87[_0x9886('0x45')]=_0x24eab3;return _0x303c87;})[_0x9886('0x25')](respondWithFilteredResult(_0x3aa06a,_0x2d035e))['catch'](handleError(_0x3aa06a,null));};exports[_0x9886('0x46')]=function(_0x333d5b,_0x3ddad2){var _0x5611dd={'raw':![],'where':{'id':_0x333d5b[_0x9886('0x47')]['id']}},_0x300814={};_0x300814[_0x9886('0x30')]=_[_0x9886('0x31')](db[_0x9886('0x41')][_0x9886('0x2c')]);_0x300814[_0x9886('0x32')]=_['keys'](_0x333d5b['query']);_0x300814['filters']=_[_0x9886('0x34')](_0x300814['model'],_0x300814[_0x9886('0x32')]);_0x5611dd[_0x9886('0x33')]=_['intersection'](_0x300814[_0x9886('0x30')],qs[_0x9886('0x35')](_0x333d5b['query'][_0x9886('0x35')]));_0x5611dd[_0x9886('0x33')]=_0x5611dd[_0x9886('0x33')][_0x9886('0x36')]?_0x5611dd[_0x9886('0x33')]:_0x300814['model'];if(_0x333d5b[_0x9886('0x32')]['includeAll']){_0x5611dd['include']=[{'all':!![]}];}_0x5611dd=_[_0x9886('0x3f')]({},_0x5611dd,_0x333d5b['options']);return db[_0x9886('0x41')][_0x9886('0x48')](_0x5611dd)[_0x9886('0x25')](handleEntityNotFound(_0x3ddad2,null))[_0x9886('0x25')](respondWithResult(_0x3ddad2,null))[_0x9886('0x49')](handleError(_0x3ddad2,null));};exports[_0x9886('0x4a')]=function(_0xac8d60,_0x155b64){return db['SugarcrmAccount']['create'](_0xac8d60[_0x9886('0x4b')],{})[_0x9886('0x25')](respondWithResult(_0x155b64,0xc9))[_0x9886('0x49')](handleError(_0x155b64,null));};exports[_0x9886('0x4c')]=function(_0x32f565,_0x52e3e9){if(_0x32f565[_0x9886('0x4b')]['id']){delete _0x32f565[_0x9886('0x4b')]['id'];}return db[_0x9886('0x41')][_0x9886('0x48')]({'where':{'id':_0x32f565[_0x9886('0x47')]['id']}})['then'](handleEntityNotFound(_0x52e3e9,null))[_0x9886('0x25')](saveUpdates(_0x32f565['body'],null))[_0x9886('0x25')](respondWithResult(_0x52e3e9,null))[_0x9886('0x49')](handleError(_0x52e3e9,null));};exports[_0x9886('0x26')]=function(_0x250ee3,_0x5a2559){return db[_0x9886('0x41')]['find']({'where':{'id':_0x250ee3['params']['id']}})['then'](handleEntityNotFound(_0x5a2559,null))[_0x9886('0x25')](removeEntity(_0x5a2559,null))[_0x9886('0x49')](handleError(_0x5a2559,null));};exports[_0x9886('0x4d')]=function(_0x4454c0,_0x3534aa,_0x31b331){var _0x426ce1={};var _0x39f34c={};var _0x5a8f07;var _0xa4b498;return db[_0x9886('0x41')][_0x9886('0x4e')]({'where':{'id':_0x4454c0['params']['id']}})['then'](handleEntityNotFound(_0x3534aa,null))['then'](function(_0x17ec14){if(_0x17ec14){_0x5a8f07=_0x17ec14;_0x39f34c[_0x9886('0x30')]=_[_0x9886('0x31')](db[_0x9886('0x4f')]['rawAttributes']);_0x39f34c[_0x9886('0x32')]=_[_0x9886('0x31')](_0x4454c0[_0x9886('0x32')]);_0x39f34c['filters']=_[_0x9886('0x34')](_0x39f34c[_0x9886('0x30')],_0x39f34c[_0x9886('0x32')]);_0x426ce1[_0x9886('0x33')]=_[_0x9886('0x34')](_0x39f34c['model'],qs[_0x9886('0x35')](_0x4454c0[_0x9886('0x32')]['fields']));_0x426ce1[_0x9886('0x33')]=_0x426ce1[_0x9886('0x33')][_0x9886('0x36')]?_0x426ce1['attributes']:_0x39f34c[_0x9886('0x30')];_0x426ce1['order']=qs[_0x9886('0x3a')](_0x4454c0['query'][_0x9886('0x3a')]);_0x426ce1[_0x9886('0x3b')]=qs[_0x9886('0x3c')](_[_0x9886('0x3d')](_0x4454c0[_0x9886('0x32')],_0x39f34c[_0x9886('0x3c')]));if(_0x4454c0[_0x9886('0x32')][_0x9886('0x3e')]){_0x426ce1[_0x9886('0x3b')]=_[_0x9886('0x3f')](_0x426ce1[_0x9886('0x3b')],{'$or':_[_0x9886('0x2b')](_0x426ce1[_0x9886('0x33')],function(_0x2ff17a){var _0x29af7d={};_0x29af7d[_0x2ff17a]={'$like':'%'+_0x4454c0['query'][_0x9886('0x3e')]+'%'};return _0x29af7d;})});}_0x426ce1=_[_0x9886('0x3f')]({},_0x426ce1,_0x4454c0[_0x9886('0x40')]);return _0x5a8f07['getConfigurations'](_0x426ce1);}})[_0x9886('0x25')](function(_0x25d38b){if(_0x25d38b){_0xa4b498=_0x25d38b[_0x9886('0x36')];if(!_0x4454c0[_0x9886('0x32')]['hasOwnProperty'](_0x9886('0x38'))){_0x426ce1[_0x9886('0x1f')]=qs[_0x9886('0x1f')](_0x4454c0[_0x9886('0x32')][_0x9886('0x1f')]);_0x426ce1[_0x9886('0x1e')]=qs['offset'](_0x4454c0[_0x9886('0x32')][_0x9886('0x1e')]);}return _0x5a8f07[_0x9886('0x4d')](_0x426ce1);}})[_0x9886('0x25')](function(_0x5af28d){if(_0x5af28d){return _0x5af28d?{'count':_0xa4b498,'rows':_0x5af28d}:null;}})['then'](respondWithResult(_0x3534aa,null))['catch'](handleError(_0x3534aa,null));};exports[_0x9886('0x50')]=function(_0xcd2e0f,_0x3a6a4f,_0x1c2717){if(_0xcd2e0f[_0x9886('0x4b')]['id']){delete _0xcd2e0f[_0x9886('0x4b')]['id'];}return db[_0x9886('0x41')][_0x9886('0x4e')]({'where':{'id':_0xcd2e0f[_0x9886('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a6a4f,null))[_0x9886('0x25')](function(_0x9cf262){if(_0x9cf262){_0xcd2e0f['body']['AccountId']=_0x9cf262['id'];_0xcd2e0f['body']['Subjects']=integrations[_0x9886('0x51')](_0xcd2e0f[_0x9886('0x4b')][_0x9886('0x52')],_0xcd2e0f[_0x9886('0x4b')][_0x9886('0x2e')]);_0xcd2e0f[_0x9886('0x4b')][_0x9886('0x53')]=integrations['getDescriptions'](_0xcd2e0f['body'][_0x9886('0x52')],_0xcd2e0f['body'][_0x9886('0x2e')]);return db['SugarcrmConfiguration'][_0x9886('0x4a')](_0xcd2e0f[_0x9886('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':_0x9886('0x54')},{'model':db['SugarcrmField'],'as':_0x9886('0x53')}]});}return null;})[_0x9886('0x25')](respondWithResult(_0x3a6a4f,null))['catch'](handleError(_0x3a6a4f,null));};exports['getFields']=function(_0x34dc0f,_0x35d798,_0x564582){var _0x59e31f='';var _0x3d945f=['id',_0x9886('0x29'),_0x9886('0x55'),'created_by',_0x9886('0x56'),_0x9886('0x57'),_0x9886('0x58'),_0x9886('0x59'),_0x9886('0x5a'),_0x9886('0x5b'),'parent_name',_0x9886('0x5c')];return db[_0x9886('0x41')][_0x9886('0x4e')]({'where':{'id':_0x34dc0f[_0x9886('0x47')]['id']},'attributes':['id',_0x9886('0x5d'),_0x9886('0x5e'),_0x9886('0x5f')]})['then'](handleEntityNotFound(_0x35d798,null))[_0x9886('0x25')](function(_0x2ec414){if(_0x2ec414){_0x59e31f=_0x2ec414[_0x9886('0x5f')];var _0x512567=_0x59e31f['slice'](-0x1);if(_0x512567==='/'){_0x59e31f=_0x59e31f[_0x9886('0x60')](0x0,_0x59e31f['lastIndexOf'](_0x512567));}return rp({'method':'POST','uri':util['format'](_0x9886('0x61'),_0x59e31f,_0x9886('0x62')),'json':!![],'form':{'method':'login','input_type':_0x9886('0x63'),'response_type':_0x9886('0x63'),'rest_data':JSON[_0x9886('0x64')]({'user_auth':{'user_name':_0x2ec414['username'],'password':_0x2ec414[_0x9886('0x5e')],'encryption':_0x9886('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x9886('0x25')](function(_0x21ab31){if(_0x21ab31&&_0x21ab31['name']!=='Invalid\x20Login'&&_0x21ab31[_0x9886('0x29')]!==_0x9886('0x66')){return rp({'method':_0x9886('0x67'),'uri':util[_0x9886('0x68')](_0x9886('0x61'),_0x59e31f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x9886('0x63'),'response_type':_0x9886('0x63'),'rest_data':JSON['stringify']({'session':_0x21ab31['id'],'module_name':_0x9886('0x69')})}})['then'](function(_0x4915ad){if(_0x4915ad){var _0x3c9bbd=_[_0x9886('0x6a')](_0x4915ad[_0x9886('0x6b')]);_[_0x9886('0x6c')](_0x3c9bbd,function(_0x4b0f2d){return _0x3d945f['includes'](_0x4b0f2d[_0x9886('0x29')]);});return{'count':_0x3c9bbd[_0x9886('0x36')],'rows':_[_0x9886('0x2b')](_0x3c9bbd,function(_0x3a18b7){return{'id':_0x3a18b7[_0x9886('0x29')],'name':_0x3a18b7[_0x9886('0x6d')],'custom':_[_0x9886('0x6e')](_0x3a18b7[_0x9886('0x29')],'_c')?!![]:![],'options':_0x3a18b7['options']?_['map'](_[_0x9886('0x6a')](_0x3a18b7[_0x9886('0x40')]),function(_0x42efb4){return{'name':_0x42efb4[_0x9886('0x6f')],'value':_0x42efb4[_0x9886('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x35d798,null))[_0x9886('0x49')](function(_0x5ed0c0){var _0x2f432a=_0x34dc0f[_0x9886('0x32')][_0x9886('0x70')]?0x1f4:_0x5ed0c0[_0x9886('0x71')]||0x1f4;logger[_0x9886('0x27')](_0x9886('0x72'),_0x9886('0x73'),_0x2f432a,JSON['stringify'](_0x5ed0c0));delete _0x5ed0c0[_0x9886('0x29')];if(_0x2f432a===0x191){_0x2f432a=0x190;}_0x35d798[_0x9886('0x1b')](_0x2f432a)[_0x9886('0x2a')](_0x34dc0f[_0x9886('0x32')][_0x9886('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x5ed0c0['statusCode']}:_0x5ed0c0);});}else{var _0x2f75d5=0x1f4;_0x35d798[_0x9886('0x1b')](_0x2f75d5)[_0x9886('0x2a')]({'message':_0x9886('0x74'),'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 8380179..a3c1f1f 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 _0xf269=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x43e1f1,_0x4f7388){var _0x3fa354=function(_0x23d79a){while(--_0x23d79a){_0x43e1f1['push'](_0x43e1f1['shift']());}};_0x3fa354(++_0x4f7388);}(_0xf269,0xd2));var _0x9f26=function(_0xc03fac,_0x5e8753){_0xc03fac=_0xc03fac-0x0;var _0xa1af02=_0xf269[_0xc03fac];return _0xa1af02;};'use strict';var _=require('lodash');var util=require(_0x9f26('0x0'));var logger=require(_0x9f26('0x1'))('api');var moment=require(_0x9f26('0x2'));var BPromise=require(_0x9f26('0x3'));var rp=require(_0x9f26('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f26('0x5'));var config=require('../../config/environment');var attributes=require(_0x9f26('0x6'));var integrations=require(_0x9f26('0x7'));module[_0x9f26('0x8')]=function(_0x2f3bb6,_0xfa0f44){return _0x2f3bb6[_0x9f26('0x9')](_0x9f26('0xa'),attributes,{'tableName':_0x9f26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3059=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','util'];(function(_0x13970d,_0x3cf42e){var _0x176fc3=function(_0x4d5e66){while(--_0x4d5e66){_0x13970d['push'](_0x13970d['shift']());}};_0x176fc3(++_0x3cf42e);}(_0x3059,0x1df));var _0x9305=function(_0x4c15e3,_0x31a156){_0x4c15e3=_0x4c15e3-0x0;var _0x3f7012=_0x3059[_0x4c15e3];return _0x3f7012;};'use strict';var _=require('lodash');var util=require(_0x9305('0x0'));var logger=require(_0x9305('0x1'))(_0x9305('0x2'));var moment=require(_0x9305('0x3'));var BPromise=require('bluebird');var rp=require(_0x9305('0x4'));var fs=require('fs');var path=require(_0x9305('0x5'));var rimraf=require('rimraf');var config=require(_0x9305('0x6'));var attributes=require(_0x9305('0x7'));var integrations=require(_0x9305('0x8'));module[_0x9305('0x9')]=function(_0x184ec3,_0x519402){return _0x184ec3['define'](_0x9305('0xa'),attributes,{'tableName':_0x9305('0xb'),'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 6ad9a66..e4c83e5 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 _0x21fd=['SugarcrmAccount','options','where','attributes','limit','include','model','map','then','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x21fd,0x1ed));var _0xd21f=function(_0x4bfafb,_0x30a865){_0x4bfafb=_0x4bfafb-0x0;var _0x4df0e1=_0x21fd[_0x4bfafb];return _0x4df0e1;};'use strict';var _=require(_0xd21f('0x0'));var util=require(_0xd21f('0x1'));var moment=require(_0xd21f('0x2'));var BPromise=require(_0xd21f('0x3'));var rs=require(_0xd21f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd21f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd21f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd21f('0x7'));var client=jayson[_0xd21f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342757,_0x1bb37d,_0x239920){return new BPromise(function(_0x364599,_0x31d234){return client[_0xd21f('0x9')](_0x342757,_0x239920)['then'](function(_0x2a0b71){logger[_0xd21f('0xa')](_0xd21f('0xb'),_0x1bb37d,_0xd21f('0xc'));logger[_0xd21f('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1bb37d,_0xd21f('0xc'),JSON['stringify'](_0x2a0b71));if(_0x2a0b71[_0xd21f('0xe')]){if(_0x2a0b71[_0xd21f('0xe')][_0xd21f('0xf')]===0x1f4){logger[_0xd21f('0xe')](_0xd21f('0xb'),_0x1bb37d,_0x2a0b71[_0xd21f('0xe')][_0xd21f('0x10')]);return _0x31d234(_0x2a0b71['error'][_0xd21f('0x10')]);}logger[_0xd21f('0xe')](_0xd21f('0xb'),_0x1bb37d,_0x2a0b71[_0xd21f('0xe')][_0xd21f('0x10')]);return _0x364599(_0x2a0b71['error']['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x1bb37d,_0xd21f('0xc'));_0x364599(_0x2a0b71[_0xd21f('0x11')][_0xd21f('0x10')]);}})[_0xd21f('0x12')](function(_0x48bda9){logger[_0xd21f('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x1bb37d,_0x48bda9);_0x31d234(_0x48bda9);});});}exports['GetSugarcrmAccount']=function(_0x585a8d){var _0x25b704=this;return new Promise(function(_0x49fe72,_0x36e1a5){return db[_0xd21f('0x13')]['findAll']({'raw':_0x585a8d['options']?_0x585a8d['options']['raw']===undefined?!![]:![]:!![],'where':_0x585a8d['options']?_0x585a8d[_0xd21f('0x14')][_0xd21f('0x15')]||null:null,'attributes':_0x585a8d[_0xd21f('0x14')]?_0x585a8d[_0xd21f('0x14')][_0xd21f('0x16')]||null:null,'limit':_0x585a8d['options']?_0x585a8d[_0xd21f('0x14')][_0xd21f('0x17')]||null:null,'include':_0x585a8d[_0xd21f('0x14')]?_0x585a8d[_0xd21f('0x14')][_0xd21f('0x18')]?_['map'](_0x585a8d[_0xd21f('0x14')][_0xd21f('0x18')],function(_0x1c4f07){return{'model':db[_0x1c4f07[_0xd21f('0x19')]],'as':_0x1c4f07['as'],'attributes':_0x1c4f07[_0xd21f('0x16')],'include':_0x1c4f07['include']?_[_0xd21f('0x1a')](_0x1c4f07[_0xd21f('0x18')],function(_0x4b9c6c){return{'model':db[_0x4b9c6c[_0xd21f('0x19')]],'as':_0x4b9c6c['as'],'attributes':_0x4b9c6c[_0xd21f('0x16')],'include':_0x4b9c6c[_0xd21f('0x18')]?_['map'](_0x4b9c6c['include'],function(_0x57c6a1){return{'model':db[_0x57c6a1[_0xd21f('0x19')]],'as':_0x57c6a1['as'],'attributes':_0x57c6a1[_0xd21f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd21f('0x1b')](function(_0x32c0bf){logger[_0xd21f('0xa')](_0xd21f('0x1c'),_0x585a8d);logger[_0xd21f('0xd')](_0xd21f('0x1c'),_0x585a8d,JSON[_0xd21f('0x1d')](_0x32c0bf));_0x49fe72(_0x32c0bf);})[_0xd21f('0x12')](function(_0x18e123){logger[_0xd21f('0xe')](_0xd21f('0x1c'),_0x18e123[_0xd21f('0x10')],_0x585a8d);_0x36e1a5(_0x25b704[_0xd21f('0xe')](0x1f4,_0x18e123[_0xd21f('0x10')]));});});};exports[_0xd21f('0x1e')]=function(_0x5740d4){var _0xa8da7b=this;return new Promise(function(_0x13b0af,_0x1dd501){return db[_0xd21f('0x13')]['find']({'raw':_0x5740d4[_0xd21f('0x14')]?_0x5740d4[_0xd21f('0x14')][_0xd21f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5740d4[_0xd21f('0x14')]?_0x5740d4[_0xd21f('0x14')]['where']||null:null,'attributes':_0x5740d4[_0xd21f('0x14')]?_0x5740d4['options']['attributes']||null:null,'include':_0x5740d4[_0xd21f('0x14')]?_0x5740d4[_0xd21f('0x14')][_0xd21f('0x18')]?_[_0xd21f('0x1a')](_0x5740d4[_0xd21f('0x14')][_0xd21f('0x18')],function(_0x55ae6f){return{'model':db[_0x55ae6f[_0xd21f('0x19')]],'as':_0x55ae6f['as'],'attributes':_0x55ae6f[_0xd21f('0x16')],'include':_0x55ae6f[_0xd21f('0x18')]?_[_0xd21f('0x1a')](_0x55ae6f[_0xd21f('0x18')],function(_0x22bed0){return{'model':db[_0x22bed0[_0xd21f('0x19')]],'as':_0x22bed0['as'],'attributes':_0x22bed0[_0xd21f('0x16')],'include':_0x22bed0[_0xd21f('0x18')]?_[_0xd21f('0x1a')](_0x22bed0[_0xd21f('0x18')],function(_0x133cc5){return{'model':db[_0x133cc5[_0xd21f('0x19')]],'as':_0x133cc5['as'],'attributes':_0x133cc5[_0xd21f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd21f('0x1b')](function(_0x193b11){logger['info'](_0xd21f('0x1e'),_0x5740d4);logger[_0xd21f('0xd')](_0xd21f('0x1e'),_0x5740d4,JSON[_0xd21f('0x1d')](_0x193b11));_0x13b0af(_0x193b11);})[_0xd21f('0x12')](function(_0x5e50e3){logger[_0xd21f('0xe')](_0xd21f('0x1e'),_0x5e50e3['message'],_0x5740d4);_0x1dd501(_0xa8da7b[_0xd21f('0xe')](0x1f4,_0x5e50e3['message']));});});}; \ No newline at end of file +var _0xe819=['GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowSugarcrmAccount','find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x4f89fa,_0x39546d){var _0x338542=function(_0x4cfe9d){while(--_0x4cfe9d){_0x4f89fa['push'](_0x4f89fa['shift']());}};_0x338542(++_0x39546d);}(_0xe819,0x96));var _0x9e81=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe819[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9e81('0x0'));var util=require(_0x9e81('0x1'));var moment=require(_0x9e81('0x2'));var BPromise=require(_0x9e81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e81('0x4'));var db=require(_0x9e81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e81('0x6'))(_0x9e81('0x7'));var config=require('../../config/environment');var jayson=require(_0x9e81('0x8'));var client=jayson[_0x9e81('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f59a3,_0x2d8761,_0x584d74){return new BPromise(function(_0x5d2012,_0xf5cfb9){return client[_0x9e81('0xa')](_0x4f59a3,_0x584d74)[_0x9e81('0xb')](function(_0x14bf90){logger[_0x9e81('0xc')](_0x9e81('0xd'),_0x2d8761,'request\x20sent');logger['debug'](_0x9e81('0xe'),_0x2d8761,_0x9e81('0xf'),JSON[_0x9e81('0x10')](_0x14bf90));if(_0x14bf90[_0x9e81('0x11')]){if(_0x14bf90[_0x9e81('0x11')]['code']===0x1f4){logger[_0x9e81('0x11')](_0x9e81('0xd'),_0x2d8761,_0x14bf90['error']['message']);return _0xf5cfb9(_0x14bf90[_0x9e81('0x11')][_0x9e81('0x12')]);}logger['error'](_0x9e81('0xd'),_0x2d8761,_0x14bf90[_0x9e81('0x11')][_0x9e81('0x12')]);return _0x5d2012(_0x14bf90['error'][_0x9e81('0x12')]);}else{logger['info'](_0x9e81('0xd'),_0x2d8761,_0x9e81('0xf'));_0x5d2012(_0x14bf90[_0x9e81('0x13')][_0x9e81('0x12')]);}})['catch'](function(_0x1ad662){logger[_0x9e81('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x2d8761,_0x1ad662);_0xf5cfb9(_0x1ad662);});});}exports[_0x9e81('0x14')]=function(_0x5a38e4){var _0x915dae=this;return new Promise(function(_0x10ec42,_0xbb8402){return db[_0x9e81('0x15')][_0x9e81('0x16')]({'raw':_0x5a38e4[_0x9e81('0x17')]?_0x5a38e4[_0x9e81('0x17')][_0x9e81('0x18')]===undefined?!![]:![]:!![],'where':_0x5a38e4[_0x9e81('0x17')]?_0x5a38e4[_0x9e81('0x17')][_0x9e81('0x19')]||null:null,'attributes':_0x5a38e4[_0x9e81('0x17')]?_0x5a38e4[_0x9e81('0x17')]['attributes']||null:null,'limit':_0x5a38e4[_0x9e81('0x17')]?_0x5a38e4[_0x9e81('0x17')][_0x9e81('0x1a')]||null:null,'include':_0x5a38e4['options']?_0x5a38e4['options'][_0x9e81('0x1b')]?_[_0x9e81('0x1c')](_0x5a38e4['options'][_0x9e81('0x1b')],function(_0x5dbd01){return{'model':db[_0x5dbd01[_0x9e81('0x1d')]],'as':_0x5dbd01['as'],'attributes':_0x5dbd01[_0x9e81('0x1e')],'include':_0x5dbd01[_0x9e81('0x1b')]?_[_0x9e81('0x1c')](_0x5dbd01[_0x9e81('0x1b')],function(_0x34ff40){return{'model':db[_0x34ff40['model']],'as':_0x34ff40['as'],'attributes':_0x34ff40[_0x9e81('0x1e')],'include':_0x34ff40['include']?_[_0x9e81('0x1c')](_0x34ff40[_0x9e81('0x1b')],function(_0x2e721e){return{'model':db[_0x2e721e[_0x9e81('0x1d')]],'as':_0x2e721e['as'],'attributes':_0x2e721e[_0x9e81('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2da22d){logger['info']('GetSugarcrmAccount',_0x5a38e4);logger['debug'](_0x9e81('0x14'),_0x5a38e4,JSON['stringify'](_0x2da22d));_0x10ec42(_0x2da22d);})['catch'](function(_0x4f0f7f){logger[_0x9e81('0x11')](_0x9e81('0x14'),_0x4f0f7f[_0x9e81('0x12')],_0x5a38e4);_0xbb8402(_0x915dae[_0x9e81('0x11')](0x1f4,_0x4f0f7f[_0x9e81('0x12')]));});});};exports[_0x9e81('0x1f')]=function(_0x6b95f){var _0x26efd4=this;return new Promise(function(_0x4b61a0,_0x477cf9){return db[_0x9e81('0x15')][_0x9e81('0x20')]({'raw':_0x6b95f[_0x9e81('0x17')]?_0x6b95f[_0x9e81('0x17')][_0x9e81('0x18')]===undefined?!![]:![]:!![],'where':_0x6b95f[_0x9e81('0x17')]?_0x6b95f['options'][_0x9e81('0x19')]||null:null,'attributes':_0x6b95f[_0x9e81('0x17')]?_0x6b95f[_0x9e81('0x17')][_0x9e81('0x1e')]||null:null,'include':_0x6b95f[_0x9e81('0x17')]?_0x6b95f[_0x9e81('0x17')]['include']?_[_0x9e81('0x1c')](_0x6b95f[_0x9e81('0x17')][_0x9e81('0x1b')],function(_0x4544d8){return{'model':db[_0x4544d8[_0x9e81('0x1d')]],'as':_0x4544d8['as'],'attributes':_0x4544d8[_0x9e81('0x1e')],'include':_0x4544d8[_0x9e81('0x1b')]?_[_0x9e81('0x1c')](_0x4544d8[_0x9e81('0x1b')],function(_0x406c07){return{'model':db[_0x406c07['model']],'as':_0x406c07['as'],'attributes':_0x406c07[_0x9e81('0x1e')],'include':_0x406c07[_0x9e81('0x1b')]?_[_0x9e81('0x1c')](_0x406c07[_0x9e81('0x1b')],function(_0x2c0978){return{'model':db[_0x2c0978[_0x9e81('0x1d')]],'as':_0x2c0978['as'],'attributes':_0x2c0978[_0x9e81('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9e81('0xb')](function(_0x27f23b){logger[_0x9e81('0xc')](_0x9e81('0x1f'),_0x6b95f);logger[_0x9e81('0x21')]('ShowSugarcrmAccount',_0x6b95f,JSON[_0x9e81('0x10')](_0x27f23b));_0x4b61a0(_0x27f23b);})['catch'](function(_0x2209ea){logger[_0x9e81('0x11')]('ShowSugarcrmAccount',_0x2209ea[_0x9e81('0x12')],_0x6b95f);_0x477cf9(_0x26efd4[_0x9e81('0x11')](0x1f4,_0x2209ea[_0x9e81('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a9d3094..d2c43f3 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 _0x6ea6=['put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x21a6d3,_0x71e3e){var _0x2c7674=function(_0x35a1db){while(--_0x35a1db){_0x21a6d3['push'](_0x21a6d3['shift']());}};_0x2c7674(++_0x71e3e);}(_0x6ea6,0x163));var _0x66ea=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0x6ea6[_0x54de5d];return _0x1b349e;};'use strict';var multer=require(_0x66ea('0x0'));var util=require(_0x66ea('0x1'));var path=require('path');var timeout=require(_0x66ea('0x2'));var express=require(_0x66ea('0x3'));var router=express['Router']();var fs_extra=require(_0x66ea('0x4'));var auth=require(_0x66ea('0x5'));var interaction=require(_0x66ea('0x6'));var config=require(_0x66ea('0x7'));var controller=require(_0x66ea('0x8'));router[_0x66ea('0x9')]('/',auth[_0x66ea('0xa')](),controller['index']);router[_0x66ea('0x9')](_0x66ea('0xb'),auth[_0x66ea('0xa')](),controller[_0x66ea('0xc')]);router[_0x66ea('0x9')](_0x66ea('0xd'),auth[_0x66ea('0xa')](),controller[_0x66ea('0xe')]);router['get'](_0x66ea('0xf'),auth[_0x66ea('0xa')](),controller[_0x66ea('0x10')]);router[_0x66ea('0x9')](_0x66ea('0x11'),auth[_0x66ea('0xa')](),controller[_0x66ea('0x12')]);router['post']('/',auth[_0x66ea('0xa')](),controller['create']);router[_0x66ea('0x13')]('/:id',auth[_0x66ea('0xa')](),controller['update']);router[_0x66ea('0x14')](_0x66ea('0xb'),auth[_0x66ea('0xa')](),controller['destroy']);module[_0x66ea('0x15')]=router; \ No newline at end of file +var _0x9b0c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getSubjects','/:id/descriptions','getDescriptions','post','update','/:id','destroy','exports'];(function(_0x4509cd,_0x43c125){var _0x1ab912=function(_0x91c4de){while(--_0x91c4de){_0x4509cd['push'](_0x4509cd['shift']());}};_0x1ab912(++_0x43c125);}(_0x9b0c,0x12b));var _0xc9b0=function(_0x1b3f75,_0x35d1b6){_0x1b3f75=_0x1b3f75-0x0;var _0x435741=_0x9b0c[_0x1b3f75];return _0x435741;};'use strict';var multer=require(_0xc9b0('0x0'));var util=require(_0xc9b0('0x1'));var path=require(_0xc9b0('0x2'));var timeout=require(_0xc9b0('0x3'));var express=require(_0xc9b0('0x4'));var router=express[_0xc9b0('0x5')]();var fs_extra=require(_0xc9b0('0x6'));var auth=require(_0xc9b0('0x7'));var interaction=require(_0xc9b0('0x8'));var config=require(_0xc9b0('0x9'));var controller=require(_0xc9b0('0xa'));router[_0xc9b0('0xb')]('/',auth[_0xc9b0('0xc')](),controller[_0xc9b0('0xd')]);router['get']('/:id',auth[_0xc9b0('0xc')](),controller[_0xc9b0('0xe')]);router[_0xc9b0('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc9b0('0xb')]('/:id/subjects',auth[_0xc9b0('0xc')](),controller[_0xc9b0('0xf')]);router[_0xc9b0('0xb')](_0xc9b0('0x10'),auth['isAuthenticated'](),controller[_0xc9b0('0x11')]);router[_0xc9b0('0x12')]('/',auth[_0xc9b0('0xc')](),controller['create']);router['put']('/:id',auth[_0xc9b0('0xc')](),controller[_0xc9b0('0x13')]);router['delete'](_0xc9b0('0x14'),auth[_0xc9b0('0xc')](),controller[_0xc9b0('0x15')]);module[_0xc9b0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 3d71d14..c852880 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 _0xd5e4=['sequelize','exports'];(function(_0x267ecc,_0x21fc77){var _0x565e6b=function(_0xd40b7){while(--_0xd40b7){_0x267ecc['push'](_0x267ecc['shift']());}};_0x565e6b(++_0x21fc77);}(_0xd5e4,0x19c));var _0x4d5e=function(_0x33aa2e,_0x5bb27a){_0x33aa2e=_0x33aa2e-0x0;var _0x14fec0=_0xd5e4[_0x33aa2e];return _0x14fec0;};'use strict';var Sequelize=require(_0x4d5e('0x0'));module[_0x4d5e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3671=['STRING','exports'];(function(_0x1d1f35,_0x51bbee){var _0x50d1d8=function(_0x245ec9){while(--_0x245ec9){_0x1d1f35['push'](_0x1d1f35['shift']());}};_0x50d1d8(++_0x51bbee);}(_0x3671,0x183));var _0x1367=function(_0xde639e,_0x508b44){_0xde639e=_0xde639e-0x0;var _0x105a83=_0x3671[_0xde639e];return _0x105a83;};'use strict';var Sequelize=require('sequelize');module[_0x1367('0x0')]={'name':{'type':Sequelize[_0x1367('0x1')]},'description':{'type':Sequelize[_0x1367('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3266a25..3d3dd00 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 _0x6a0f=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','rows','catch','show','params','include','find','create','body','getFields','findOne','SugarcrmField','filter','getSubjects','pick','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model'];(function(_0x354a52,_0x122ff1){var _0x4f96c5=function(_0x3a9240){while(--_0x3a9240){_0x354a52['push'](_0x354a52['shift']());}};_0x4f96c5(++_0x122ff1);}(_0x6a0f,0x6f));var _0xf6a0=function(_0x2c1d82,_0x50d3f3){_0x2c1d82=_0x2c1d82-0x0;var _0x55e2e3=_0x6a0f[_0x2c1d82];return _0x55e2e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6a0('0x0'));var zipdir=require(_0xf6a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6a0('0x2'));var moment=require(_0xf6a0('0x3'));var BPromise=require(_0xf6a0('0x4'));var Mustache=require(_0xf6a0('0x5'));var util=require(_0xf6a0('0x6'));var path=require('path');var sox=require(_0xf6a0('0x7'));var csv=require(_0xf6a0('0x8'));var ejs=require(_0xf6a0('0x9'));var fs=require('fs');var fs_extra=require(_0xf6a0('0xa'));var _=require(_0xf6a0('0xb'));var squel=require('squel');var crypto=require(_0xf6a0('0xc'));var jsforce=require(_0xf6a0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf6a0('0x8'));var querystring=require(_0xf6a0('0xe'));var Papa=require('papaparse');var Redis=require(_0xf6a0('0xf'));var authService=require(_0xf6a0('0x10'));var qs=require(_0xf6a0('0x11'));var as=require(_0xf6a0('0x12'));var hardwareService=require(_0xf6a0('0x13'));var logger=require('../../config/logger')(_0xf6a0('0x14'));var utils=require('../../config/utils');var config=require(_0xf6a0('0x15'));var licenseUtil=require(_0xf6a0('0x16'));var db=require(_0xf6a0('0x17'))['db'];function respondWithStatusCode(_0x4c3a3d,_0x17459d){_0x17459d=_0x17459d||0xcc;return function(_0x299171){if(_0x299171){return _0x4c3a3d[_0xf6a0('0x18')](_0x17459d);}return _0x4c3a3d['status'](_0x17459d)[_0xf6a0('0x19')]();};}function respondWithResult(_0x5ee081,_0x3a6ae4){_0x3a6ae4=_0x3a6ae4||0xc8;return function(_0x1db93b){if(_0x1db93b){return _0x5ee081[_0xf6a0('0x1a')](_0x3a6ae4)[_0xf6a0('0x1b')](_0x1db93b);}};}function respondWithFilteredResult(_0x2241bf,_0x3bff44){return function(_0x299bc8){if(_0x299bc8){var _0x2827f8=typeof _0x3bff44['offset']===_0xf6a0('0x1c')&&typeof _0x3bff44[_0xf6a0('0x1d')]==='undefined';var _0x214563=_0x299bc8[_0xf6a0('0x1e')];var _0x3dea0f=_0x2827f8?0x0:_0x3bff44[_0xf6a0('0x1f')];var _0x429c94=_0x2827f8?_0x299bc8['count']:_0x3bff44['offset']+_0x3bff44[_0xf6a0('0x1d')];var _0x41d234;if(_0x429c94>=_0x214563){_0x429c94=_0x214563;_0x41d234=0xc8;}else{_0x41d234=0xce;}_0x2241bf[_0xf6a0('0x1a')](_0x41d234);return _0x2241bf[_0xf6a0('0x20')](_0xf6a0('0x21'),_0x3dea0f+'-'+_0x429c94+'/'+_0x214563)[_0xf6a0('0x1b')](_0x299bc8);}return null;};}function patchUpdates(_0x27480b){return function(_0x176e08){try{jsonpatch['apply'](_0x176e08,_0x27480b,!![]);}catch(_0x4ce7b4){return BPromise[_0xf6a0('0x22')](_0x4ce7b4);}return _0x176e08['save']();};}function saveUpdates(_0x5e2e44,_0x20db7d){return function(_0x216ae1){if(_0x216ae1){return _0x216ae1[_0xf6a0('0x23')](_0x5e2e44)[_0xf6a0('0x24')](function(_0x380406){return _0x380406;});}return null;};}function removeEntity(_0x4ae978,_0x4675de){return function(_0x325a82){if(_0x325a82){return _0x325a82[_0xf6a0('0x25')]()['then'](function(){_0x4ae978[_0xf6a0('0x1a')](0xcc)[_0xf6a0('0x19')]();});}};}function handleEntityNotFound(_0x487a8f,_0x252c76){return function(_0x281365){if(!_0x281365){_0x487a8f[_0xf6a0('0x18')](0x194);}return _0x281365;};}function handleError(_0x230270,_0x500d08){_0x500d08=_0x500d08||0x1f4;return function(_0x1277cc){logger[_0xf6a0('0x26')](_0x1277cc[_0xf6a0('0x27')]);if(_0x1277cc[_0xf6a0('0x28')]){delete _0x1277cc[_0xf6a0('0x28')];}_0x230270['status'](_0x500d08)[_0xf6a0('0x29')](_0x1277cc);};}exports['index']=function(_0xb76aa3,_0x2f3d07){var _0x4c1998={},_0x3d517e={},_0x909e6e={'count':0x0,'rows':[]};var _0x3e0dca=_[_0xf6a0('0x2a')](db['SugarcrmConfiguration'][_0xf6a0('0x2b')],function(_0x55c57f){return{'name':_0x55c57f['fieldName'],'type':_0x55c57f[_0xf6a0('0x2c')][_0xf6a0('0x2d')]};});_0x3d517e[_0xf6a0('0x2e')]=_[_0xf6a0('0x2a')](_0x3e0dca,_0xf6a0('0x28'));_0x3d517e['query']=_[_0xf6a0('0x2f')](_0xb76aa3[_0xf6a0('0x30')]);_0x3d517e[_0xf6a0('0x31')]=_[_0xf6a0('0x32')](_0x3d517e['model'],_0x3d517e[_0xf6a0('0x30')]);_0x4c1998['attributes']=_[_0xf6a0('0x32')](_0x3d517e[_0xf6a0('0x2e')],qs[_0xf6a0('0x33')](_0xb76aa3['query'][_0xf6a0('0x33')]));_0x4c1998[_0xf6a0('0x34')]=_0x4c1998[_0xf6a0('0x34')][_0xf6a0('0x35')]?_0x4c1998[_0xf6a0('0x34')]:_0x3d517e[_0xf6a0('0x2e')];if(!_0xb76aa3[_0xf6a0('0x30')][_0xf6a0('0x36')](_0xf6a0('0x37'))){_0x4c1998[_0xf6a0('0x1d')]=qs[_0xf6a0('0x1d')](_0xb76aa3[_0xf6a0('0x30')][_0xf6a0('0x1d')]);_0x4c1998['offset']=qs[_0xf6a0('0x1f')](_0xb76aa3[_0xf6a0('0x30')][_0xf6a0('0x1f')]);}_0x4c1998[_0xf6a0('0x38')]=qs['sort'](_0xb76aa3['query'][_0xf6a0('0x39')]);_0x4c1998[_0xf6a0('0x3a')]=qs[_0xf6a0('0x31')](_['pick'](_0xb76aa3['query'],_0x3d517e[_0xf6a0('0x31')]),_0x3e0dca);if(_0xb76aa3[_0xf6a0('0x30')]['filter']){_0x4c1998['where']=_[_0xf6a0('0x3b')](_0x4c1998['where'],{'$or':_[_0xf6a0('0x2a')](_0x3e0dca,function(_0x495e88){if(_0x495e88[_0xf6a0('0x2c')]!==_0xf6a0('0x3c')){var _0x24d64c={};_0x24d64c[_0x495e88[_0xf6a0('0x28')]]={'$like':'%'+_0xb76aa3[_0xf6a0('0x30')]['filter']+'%'};return _0x24d64c;}})});}_0x4c1998=_[_0xf6a0('0x3b')]({},_0x4c1998,_0xb76aa3[_0xf6a0('0x3d')]);var _0x1c028a={'where':_0x4c1998[_0xf6a0('0x3a')]};return db[_0xf6a0('0x3e')][_0xf6a0('0x1e')](_0x1c028a)['then'](function(_0x96ab60){_0x909e6e['count']=_0x96ab60;if(_0xb76aa3[_0xf6a0('0x30')][_0xf6a0('0x3f')]){_0x4c1998['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x4c1998);})['then'](function(_0x5c1057){_0x909e6e[_0xf6a0('0x40')]=_0x5c1057;return _0x909e6e;})['then'](respondWithFilteredResult(_0x2f3d07,_0x4c1998))[_0xf6a0('0x41')](handleError(_0x2f3d07,null));};exports[_0xf6a0('0x42')]=function(_0x303bc8,_0x1a4246){var _0x3fe086={'raw':![],'where':{'id':_0x303bc8[_0xf6a0('0x43')]['id']}},_0x14a67b={};_0x14a67b[_0xf6a0('0x2e')]=_[_0xf6a0('0x2f')](db[_0xf6a0('0x3e')]['rawAttributes']);_0x14a67b['query']=_['keys'](_0x303bc8[_0xf6a0('0x30')]);_0x14a67b[_0xf6a0('0x31')]=_[_0xf6a0('0x32')](_0x14a67b[_0xf6a0('0x2e')],_0x14a67b[_0xf6a0('0x30')]);_0x3fe086[_0xf6a0('0x34')]=_[_0xf6a0('0x32')](_0x14a67b[_0xf6a0('0x2e')],qs[_0xf6a0('0x33')](_0x303bc8[_0xf6a0('0x30')]['fields']));_0x3fe086[_0xf6a0('0x34')]=_0x3fe086[_0xf6a0('0x34')][_0xf6a0('0x35')]?_0x3fe086[_0xf6a0('0x34')]:_0x14a67b[_0xf6a0('0x2e')];if(_0x303bc8[_0xf6a0('0x30')][_0xf6a0('0x3f')]){_0x3fe086[_0xf6a0('0x44')]=[{'all':!![]}];}_0x3fe086=_['merge']({},_0x3fe086,_0x303bc8[_0xf6a0('0x3d')]);return db[_0xf6a0('0x3e')][_0xf6a0('0x45')](_0x3fe086)[_0xf6a0('0x24')](handleEntityNotFound(_0x1a4246,null))[_0xf6a0('0x24')](respondWithResult(_0x1a4246,null))[_0xf6a0('0x41')](handleError(_0x1a4246,null));};exports[_0xf6a0('0x46')]=function(_0x2f2891,_0xb0a785){return db[_0xf6a0('0x3e')][_0xf6a0('0x46')](_0x2f2891['body'],{})[_0xf6a0('0x24')](respondWithResult(_0xb0a785,0xc9))[_0xf6a0('0x41')](handleError(_0xb0a785,null));};exports[_0xf6a0('0x23')]=function(_0x203882,_0x596f66){if(_0x203882[_0xf6a0('0x47')]['id']){delete _0x203882['body']['id'];}return db[_0xf6a0('0x3e')][_0xf6a0('0x45')]({'where':{'id':_0x203882[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x24')](handleEntityNotFound(_0x596f66,null))[_0xf6a0('0x24')](saveUpdates(_0x203882[_0xf6a0('0x47')],null))[_0xf6a0('0x24')](respondWithResult(_0x596f66,null))[_0xf6a0('0x41')](handleError(_0x596f66,null));};exports[_0xf6a0('0x25')]=function(_0x13fda6,_0x59f464){return db['SugarcrmConfiguration'][_0xf6a0('0x45')]({'where':{'id':_0x13fda6[_0xf6a0('0x43')]['id']}})[_0xf6a0('0x24')](handleEntityNotFound(_0x59f464,null))['then'](removeEntity(_0x59f464,null))['catch'](handleError(_0x59f464,null));};exports[_0xf6a0('0x48')]=function(_0x2c3bd2,_0x30d577,_0x262502){var _0x48c634={};var _0x56b66f={};var _0x530359;var _0x4a3762;return db['SugarcrmConfiguration'][_0xf6a0('0x49')]({'where':{'id':_0x2c3bd2[_0xf6a0('0x43')]['id']}})['then'](handleEntityNotFound(_0x30d577,null))[_0xf6a0('0x24')](function(_0x56b398){if(_0x56b398){_0x530359=_0x56b398;_0x56b66f[_0xf6a0('0x2e')]=_['keys'](db[_0xf6a0('0x4a')][_0xf6a0('0x2b')]);_0x56b66f[_0xf6a0('0x30')]=_['keys'](_0x2c3bd2[_0xf6a0('0x30')]);_0x56b66f[_0xf6a0('0x31')]=_[_0xf6a0('0x32')](_0x56b66f[_0xf6a0('0x2e')],_0x56b66f[_0xf6a0('0x30')]);_0x48c634[_0xf6a0('0x34')]=_['intersection'](_0x56b66f[_0xf6a0('0x2e')],qs[_0xf6a0('0x33')](_0x2c3bd2[_0xf6a0('0x30')][_0xf6a0('0x33')]));_0x48c634[_0xf6a0('0x34')]=_0x48c634[_0xf6a0('0x34')][_0xf6a0('0x35')]?_0x48c634[_0xf6a0('0x34')]:_0x56b66f['model'];_0x48c634[_0xf6a0('0x38')]=qs['sort'](_0x2c3bd2['query'][_0xf6a0('0x39')]);_0x48c634[_0xf6a0('0x3a')]=qs[_0xf6a0('0x31')](_['pick'](_0x2c3bd2[_0xf6a0('0x30')],_0x56b66f[_0xf6a0('0x31')]));if(_0x2c3bd2[_0xf6a0('0x30')][_0xf6a0('0x4b')]){_0x48c634[_0xf6a0('0x3a')]=_[_0xf6a0('0x3b')](_0x48c634[_0xf6a0('0x3a')],{'$or':_[_0xf6a0('0x2a')](_0x48c634[_0xf6a0('0x34')],function(_0xc14875){var _0x5b7c7c={};_0x5b7c7c[_0xc14875]={'$like':'%'+_0x2c3bd2[_0xf6a0('0x30')][_0xf6a0('0x4b')]+'%'};return _0x5b7c7c;})});}_0x48c634=_[_0xf6a0('0x3b')]({},_0x48c634,_0x2c3bd2['options']);return _0x530359['getFields'](_0x48c634);}})[_0xf6a0('0x24')](function(_0x3d93bf){if(_0x3d93bf){_0x4a3762=_0x3d93bf['length'];if(!_0x2c3bd2[_0xf6a0('0x30')]['hasOwnProperty'](_0xf6a0('0x37'))){_0x48c634[_0xf6a0('0x1d')]=qs[_0xf6a0('0x1d')](_0x2c3bd2[_0xf6a0('0x30')]['limit']);_0x48c634[_0xf6a0('0x1f')]=qs[_0xf6a0('0x1f')](_0x2c3bd2[_0xf6a0('0x30')][_0xf6a0('0x1f')]);}return _0x530359['getFields'](_0x48c634);}})['then'](function(_0x6e310f){if(_0x6e310f){return _0x6e310f?{'count':_0x4a3762,'rows':_0x6e310f}:null;}})['then'](respondWithResult(_0x30d577,null))[_0xf6a0('0x41')](handleError(_0x30d577,null));};exports[_0xf6a0('0x4c')]=function(_0x2b9cda,_0x2c914c,_0x6b4bf){var _0x12e88b={};var _0x37d1dd={};var _0x37aa7c;var _0x2ba286;return db[_0xf6a0('0x3e')][_0xf6a0('0x49')]({'where':{'id':_0x2b9cda['params']['id']}})[_0xf6a0('0x24')](handleEntityNotFound(_0x2c914c,null))[_0xf6a0('0x24')](function(_0x5d690e){if(_0x5d690e){_0x37aa7c=_0x5d690e;_0x37d1dd['model']=_[_0xf6a0('0x2f')](db['SugarcrmField']['rawAttributes']);_0x37d1dd[_0xf6a0('0x30')]=_[_0xf6a0('0x2f')](_0x2b9cda[_0xf6a0('0x30')]);_0x37d1dd['filters']=_[_0xf6a0('0x32')](_0x37d1dd['model'],_0x37d1dd[_0xf6a0('0x30')]);_0x12e88b['attributes']=_[_0xf6a0('0x32')](_0x37d1dd[_0xf6a0('0x2e')],qs['fields'](_0x2b9cda['query']['fields']));_0x12e88b[_0xf6a0('0x34')]=_0x12e88b[_0xf6a0('0x34')][_0xf6a0('0x35')]?_0x12e88b[_0xf6a0('0x34')]:_0x37d1dd['model'];_0x12e88b[_0xf6a0('0x38')]=qs['sort'](_0x2b9cda[_0xf6a0('0x30')][_0xf6a0('0x39')]);_0x12e88b['where']=qs['filters'](_[_0xf6a0('0x4d')](_0x2b9cda[_0xf6a0('0x30')],_0x37d1dd['filters']));if(_0x2b9cda[_0xf6a0('0x30')]['filter']){_0x12e88b[_0xf6a0('0x3a')]=_[_0xf6a0('0x3b')](_0x12e88b[_0xf6a0('0x3a')],{'$or':_[_0xf6a0('0x2a')](_0x12e88b['attributes'],function(_0x3ed016){var _0x5ecd71={};_0x5ecd71[_0x3ed016]={'$like':'%'+_0x2b9cda[_0xf6a0('0x30')][_0xf6a0('0x4b')]+'%'};return _0x5ecd71;})});}_0x12e88b=_[_0xf6a0('0x3b')]({},_0x12e88b,_0x2b9cda[_0xf6a0('0x3d')]);return _0x37aa7c[_0xf6a0('0x4c')](_0x12e88b);}})[_0xf6a0('0x24')](function(_0x2a718a){if(_0x2a718a){_0x2ba286=_0x2a718a['length'];if(!_0x2b9cda[_0xf6a0('0x30')][_0xf6a0('0x36')](_0xf6a0('0x37'))){_0x12e88b[_0xf6a0('0x1d')]=qs[_0xf6a0('0x1d')](_0x2b9cda[_0xf6a0('0x30')][_0xf6a0('0x1d')]);_0x12e88b[_0xf6a0('0x1f')]=qs['offset'](_0x2b9cda[_0xf6a0('0x30')][_0xf6a0('0x1f')]);}return _0x37aa7c[_0xf6a0('0x4c')](_0x12e88b);}})[_0xf6a0('0x24')](function(_0x535177){if(_0x535177){return _0x535177?{'count':_0x2ba286,'rows':_0x535177}:null;}})[_0xf6a0('0x24')](respondWithResult(_0x2c914c,null))['catch'](handleError(_0x2c914c,null));};exports[_0xf6a0('0x4e')]=function(_0x5676b2,_0x298d46,_0x1748a7){var _0x41e9a6={};var _0x5d4482={};var _0x1ecbc2;var _0x3a5c07;return db[_0xf6a0('0x3e')][_0xf6a0('0x49')]({'where':{'id':_0x5676b2['params']['id']}})['then'](handleEntityNotFound(_0x298d46,null))[_0xf6a0('0x24')](function(_0x336981){if(_0x336981){_0x1ecbc2=_0x336981;_0x5d4482[_0xf6a0('0x2e')]=_[_0xf6a0('0x2f')](db[_0xf6a0('0x4a')][_0xf6a0('0x2b')]);_0x5d4482[_0xf6a0('0x30')]=_[_0xf6a0('0x2f')](_0x5676b2[_0xf6a0('0x30')]);_0x5d4482[_0xf6a0('0x31')]=_[_0xf6a0('0x32')](_0x5d4482[_0xf6a0('0x2e')],_0x5d4482[_0xf6a0('0x30')]);_0x41e9a6[_0xf6a0('0x34')]=_[_0xf6a0('0x32')](_0x5d4482[_0xf6a0('0x2e')],qs[_0xf6a0('0x33')](_0x5676b2[_0xf6a0('0x30')][_0xf6a0('0x33')]));_0x41e9a6['attributes']=_0x41e9a6[_0xf6a0('0x34')][_0xf6a0('0x35')]?_0x41e9a6[_0xf6a0('0x34')]:_0x5d4482[_0xf6a0('0x2e')];_0x41e9a6[_0xf6a0('0x38')]=qs[_0xf6a0('0x39')](_0x5676b2[_0xf6a0('0x30')]['sort']);_0x41e9a6[_0xf6a0('0x3a')]=qs[_0xf6a0('0x31')](_['pick'](_0x5676b2[_0xf6a0('0x30')],_0x5d4482[_0xf6a0('0x31')]));if(_0x5676b2[_0xf6a0('0x30')][_0xf6a0('0x4b')]){_0x41e9a6['where']=_['merge'](_0x41e9a6[_0xf6a0('0x3a')],{'$or':_[_0xf6a0('0x2a')](_0x41e9a6[_0xf6a0('0x34')],function(_0x5f4a59){var _0xe70954={};_0xe70954[_0x5f4a59]={'$like':'%'+_0x5676b2[_0xf6a0('0x30')][_0xf6a0('0x4b')]+'%'};return _0xe70954;})});}_0x41e9a6=_[_0xf6a0('0x3b')]({},_0x41e9a6,_0x5676b2[_0xf6a0('0x3d')]);return _0x1ecbc2[_0xf6a0('0x4e')](_0x41e9a6);}})[_0xf6a0('0x24')](function(_0x33143a){if(_0x33143a){_0x3a5c07=_0x33143a[_0xf6a0('0x35')];if(!_0x5676b2[_0xf6a0('0x30')][_0xf6a0('0x36')]('nolimit')){_0x41e9a6[_0xf6a0('0x1d')]=qs[_0xf6a0('0x1d')](_0x5676b2['query'][_0xf6a0('0x1d')]);_0x41e9a6[_0xf6a0('0x1f')]=qs[_0xf6a0('0x1f')](_0x5676b2[_0xf6a0('0x30')]['offset']);}return _0x1ecbc2[_0xf6a0('0x4e')](_0x41e9a6);}})[_0xf6a0('0x24')](function(_0x274430){if(_0x274430){return _0x274430?{'count':_0x3a5c07,'rows':_0x274430}:null;}})[_0xf6a0('0x24')](respondWithResult(_0x298d46,null))[_0xf6a0('0x41')](handleError(_0x298d46,null));}; \ No newline at end of file +var _0x00a4=['pick','getFields','nolimit','SugarcrmField','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','filter','merge','options','include','findAll','show','length','includeAll','find','catch','create','body','params','findOne','order'];(function(_0x228ece,_0x1a7d1e){var _0x591db6=function(_0x1f8961){while(--_0x1f8961){_0x228ece['push'](_0x228ece['shift']());}};_0x591db6(++_0x1a7d1e);}(_0x00a4,0x191));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x400a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x400a('0x1'));var moment=require(_0x400a('0x2'));var BPromise=require(_0x400a('0x3'));var Mustache=require(_0x400a('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x400a('0x5'));var fs=require('fs');var fs_extra=require(_0x400a('0x6'));var _=require(_0x400a('0x7'));var squel=require(_0x400a('0x8'));var crypto=require(_0x400a('0x9'));var jsforce=require(_0x400a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x400a('0xb'));var querystring=require(_0x400a('0xc'));var Papa=require(_0x400a('0xd'));var Redis=require(_0x400a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x400a('0xf'));var as=require(_0x400a('0x10'));var hardwareService=require(_0x400a('0x11'));var logger=require(_0x400a('0x12'))('api');var utils=require(_0x400a('0x13'));var config=require(_0x400a('0x14'));var licenseUtil=require(_0x400a('0x15'));var db=require(_0x400a('0x16'))['db'];function respondWithStatusCode(_0x5786fd,_0x42206c){_0x42206c=_0x42206c||0xcc;return function(_0x2e70ed){if(_0x2e70ed){return _0x5786fd[_0x400a('0x17')](_0x42206c);}return _0x5786fd[_0x400a('0x18')](_0x42206c)[_0x400a('0x19')]();};}function respondWithResult(_0x2bb1d3,_0x2ef54d){_0x2ef54d=_0x2ef54d||0xc8;return function(_0x1144a0){if(_0x1144a0){return _0x2bb1d3[_0x400a('0x18')](_0x2ef54d)[_0x400a('0x1a')](_0x1144a0);}};}function respondWithFilteredResult(_0x6d5a9f,_0x366e1d){return function(_0x54910e){if(_0x54910e){var _0x1af1a8=typeof _0x366e1d[_0x400a('0x1b')]===_0x400a('0x1c')&&typeof _0x366e1d[_0x400a('0x1d')]==='undefined';var _0x53be31=_0x54910e[_0x400a('0x1e')];var _0x21cc9b=_0x1af1a8?0x0:_0x366e1d[_0x400a('0x1b')];var _0x4dc1b7=_0x1af1a8?_0x54910e[_0x400a('0x1e')]:_0x366e1d[_0x400a('0x1b')]+_0x366e1d[_0x400a('0x1d')];var _0x3bc1b0;if(_0x4dc1b7>=_0x53be31){_0x4dc1b7=_0x53be31;_0x3bc1b0=0xc8;}else{_0x3bc1b0=0xce;}_0x6d5a9f[_0x400a('0x18')](_0x3bc1b0);return _0x6d5a9f[_0x400a('0x1f')](_0x400a('0x20'),_0x21cc9b+'-'+_0x4dc1b7+'/'+_0x53be31)['json'](_0x54910e);}return null;};}function patchUpdates(_0x51d3bf){return function(_0x32f782){try{jsonpatch['apply'](_0x32f782,_0x51d3bf,!![]);}catch(_0x229cb1){return BPromise[_0x400a('0x21')](_0x229cb1);}return _0x32f782[_0x400a('0x22')]();};}function saveUpdates(_0x551062,_0x48ce75){return function(_0x31fbf2){if(_0x31fbf2){return _0x31fbf2[_0x400a('0x23')](_0x551062)[_0x400a('0x24')](function(_0xe69f8f){return _0xe69f8f;});}return null;};}function removeEntity(_0x573adc,_0x7e6434){return function(_0x2ea7c3){if(_0x2ea7c3){return _0x2ea7c3[_0x400a('0x25')]()[_0x400a('0x24')](function(){_0x573adc['status'](0xcc)[_0x400a('0x19')]();});}};}function handleEntityNotFound(_0x1b7219,_0x14f992){return function(_0x3e7d23){if(!_0x3e7d23){_0x1b7219[_0x400a('0x17')](0x194);}return _0x3e7d23;};}function handleError(_0x3a58c7,_0x3d0103){_0x3d0103=_0x3d0103||0x1f4;return function(_0x38c0dd){logger[_0x400a('0x26')](_0x38c0dd[_0x400a('0x27')]);if(_0x38c0dd[_0x400a('0x28')]){delete _0x38c0dd[_0x400a('0x28')];}_0x3a58c7[_0x400a('0x18')](_0x3d0103)[_0x400a('0x29')](_0x38c0dd);};}exports[_0x400a('0x2a')]=function(_0x328646,_0x3860dc){var _0xd7fa75={},_0x5df6c1={},_0x34a80e={'count':0x0,'rows':[]};var _0x2246d8=_['map'](db[_0x400a('0x2b')][_0x400a('0x2c')],function(_0x3917ce){return{'name':_0x3917ce['fieldName'],'type':_0x3917ce[_0x400a('0x2d')][_0x400a('0x2e')]};});_0x5df6c1['model']=_[_0x400a('0x2f')](_0x2246d8,'name');_0x5df6c1[_0x400a('0x30')]=_[_0x400a('0x31')](_0x328646['query']);_0x5df6c1[_0x400a('0x32')]=_[_0x400a('0x33')](_0x5df6c1['model'],_0x5df6c1[_0x400a('0x30')]);_0xd7fa75[_0x400a('0x34')]=_['intersection'](_0x5df6c1[_0x400a('0x35')],qs[_0x400a('0x36')](_0x328646[_0x400a('0x30')][_0x400a('0x36')]));_0xd7fa75[_0x400a('0x34')]=_0xd7fa75[_0x400a('0x34')]['length']?_0xd7fa75[_0x400a('0x34')]:_0x5df6c1['model'];if(!_0x328646[_0x400a('0x30')][_0x400a('0x37')]('nolimit')){_0xd7fa75['limit']=qs['limit'](_0x328646[_0x400a('0x30')]['limit']);_0xd7fa75[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x328646[_0x400a('0x30')]['offset']);}_0xd7fa75['order']=qs['sort'](_0x328646[_0x400a('0x30')][_0x400a('0x38')]);_0xd7fa75[_0x400a('0x39')]=qs[_0x400a('0x32')](_['pick'](_0x328646[_0x400a('0x30')],_0x5df6c1['filters']),_0x2246d8);if(_0x328646[_0x400a('0x30')][_0x400a('0x3a')]){_0xd7fa75['where']=_[_0x400a('0x3b')](_0xd7fa75['where'],{'$or':_['map'](_0x2246d8,function(_0xadbb41){if(_0xadbb41[_0x400a('0x2d')]!=='VIRTUAL'){var _0x1674c5={};_0x1674c5[_0xadbb41[_0x400a('0x28')]]={'$like':'%'+_0x328646[_0x400a('0x30')][_0x400a('0x3a')]+'%'};return _0x1674c5;}})});}_0xd7fa75=_[_0x400a('0x3b')]({},_0xd7fa75,_0x328646[_0x400a('0x3c')]);var _0xf6bd64={'where':_0xd7fa75[_0x400a('0x39')]};return db[_0x400a('0x2b')]['count'](_0xf6bd64)[_0x400a('0x24')](function(_0x3f38e2){_0x34a80e[_0x400a('0x1e')]=_0x3f38e2;if(_0x328646['query']['includeAll']){_0xd7fa75[_0x400a('0x3d')]=[{'all':!![]}];}return db[_0x400a('0x2b')][_0x400a('0x3e')](_0xd7fa75);})[_0x400a('0x24')](function(_0x168388){_0x34a80e['rows']=_0x168388;return _0x34a80e;})['then'](respondWithFilteredResult(_0x3860dc,_0xd7fa75))['catch'](handleError(_0x3860dc,null));};exports[_0x400a('0x3f')]=function(_0x37bfb0,_0xf5ed63){var _0x10cefb={'raw':![],'where':{'id':_0x37bfb0['params']['id']}},_0x5555f1={};_0x5555f1['model']=_['keys'](db[_0x400a('0x2b')][_0x400a('0x2c')]);_0x5555f1['query']=_[_0x400a('0x31')](_0x37bfb0[_0x400a('0x30')]);_0x5555f1[_0x400a('0x32')]=_[_0x400a('0x33')](_0x5555f1[_0x400a('0x35')],_0x5555f1[_0x400a('0x30')]);_0x10cefb[_0x400a('0x34')]=_[_0x400a('0x33')](_0x5555f1[_0x400a('0x35')],qs[_0x400a('0x36')](_0x37bfb0[_0x400a('0x30')][_0x400a('0x36')]));_0x10cefb[_0x400a('0x34')]=_0x10cefb[_0x400a('0x34')][_0x400a('0x40')]?_0x10cefb[_0x400a('0x34')]:_0x5555f1[_0x400a('0x35')];if(_0x37bfb0[_0x400a('0x30')][_0x400a('0x41')]){_0x10cefb['include']=[{'all':!![]}];}_0x10cefb=_[_0x400a('0x3b')]({},_0x10cefb,_0x37bfb0[_0x400a('0x3c')]);return db[_0x400a('0x2b')][_0x400a('0x42')](_0x10cefb)[_0x400a('0x24')](handleEntityNotFound(_0xf5ed63,null))['then'](respondWithResult(_0xf5ed63,null))[_0x400a('0x43')](handleError(_0xf5ed63,null));};exports['create']=function(_0x4c95d1,_0x2e526e){return db[_0x400a('0x2b')][_0x400a('0x44')](_0x4c95d1[_0x400a('0x45')],{})[_0x400a('0x24')](respondWithResult(_0x2e526e,0xc9))[_0x400a('0x43')](handleError(_0x2e526e,null));};exports[_0x400a('0x23')]=function(_0x4db15c,_0x5b2557){if(_0x4db15c['body']['id']){delete _0x4db15c[_0x400a('0x45')]['id'];}return db[_0x400a('0x2b')]['find']({'where':{'id':_0x4db15c['params']['id']}})[_0x400a('0x24')](handleEntityNotFound(_0x5b2557,null))[_0x400a('0x24')](saveUpdates(_0x4db15c[_0x400a('0x45')],null))[_0x400a('0x24')](respondWithResult(_0x5b2557,null))['catch'](handleError(_0x5b2557,null));};exports[_0x400a('0x25')]=function(_0xe5d048,_0xf15d82){return db[_0x400a('0x2b')]['find']({'where':{'id':_0xe5d048[_0x400a('0x46')]['id']}})[_0x400a('0x24')](handleEntityNotFound(_0xf15d82,null))[_0x400a('0x24')](removeEntity(_0xf15d82,null))[_0x400a('0x43')](handleError(_0xf15d82,null));};exports['getFields']=function(_0x477745,_0x25f29a,_0x3f7392){var _0x421c5={};var _0x21741d={};var _0x38a0a7;var _0x332513;return db[_0x400a('0x2b')][_0x400a('0x47')]({'where':{'id':_0x477745['params']['id']}})[_0x400a('0x24')](handleEntityNotFound(_0x25f29a,null))[_0x400a('0x24')](function(_0x47b4ce){if(_0x47b4ce){_0x38a0a7=_0x47b4ce;_0x21741d['model']=_[_0x400a('0x31')](db['SugarcrmField']['rawAttributes']);_0x21741d[_0x400a('0x30')]=_[_0x400a('0x31')](_0x477745[_0x400a('0x30')]);_0x21741d['filters']=_[_0x400a('0x33')](_0x21741d['model'],_0x21741d[_0x400a('0x30')]);_0x421c5[_0x400a('0x34')]=_[_0x400a('0x33')](_0x21741d[_0x400a('0x35')],qs[_0x400a('0x36')](_0x477745[_0x400a('0x30')]['fields']));_0x421c5[_0x400a('0x34')]=_0x421c5[_0x400a('0x34')][_0x400a('0x40')]?_0x421c5[_0x400a('0x34')]:_0x21741d[_0x400a('0x35')];_0x421c5[_0x400a('0x48')]=qs['sort'](_0x477745[_0x400a('0x30')][_0x400a('0x38')]);_0x421c5[_0x400a('0x39')]=qs[_0x400a('0x32')](_[_0x400a('0x49')](_0x477745[_0x400a('0x30')],_0x21741d['filters']));if(_0x477745[_0x400a('0x30')]['filter']){_0x421c5[_0x400a('0x39')]=_[_0x400a('0x3b')](_0x421c5[_0x400a('0x39')],{'$or':_['map'](_0x421c5['attributes'],function(_0x3468b3){var _0x4a7171={};_0x4a7171[_0x3468b3]={'$like':'%'+_0x477745['query']['filter']+'%'};return _0x4a7171;})});}_0x421c5=_[_0x400a('0x3b')]({},_0x421c5,_0x477745[_0x400a('0x3c')]);return _0x38a0a7[_0x400a('0x4a')](_0x421c5);}})[_0x400a('0x24')](function(_0x357ea6){if(_0x357ea6){_0x332513=_0x357ea6[_0x400a('0x40')];if(!_0x477745[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x4b'))){_0x421c5['limit']=qs[_0x400a('0x1d')](_0x477745[_0x400a('0x30')][_0x400a('0x1d')]);_0x421c5[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x477745[_0x400a('0x30')][_0x400a('0x1b')]);}return _0x38a0a7['getFields'](_0x421c5);}})['then'](function(_0x4b8b45){if(_0x4b8b45){return _0x4b8b45?{'count':_0x332513,'rows':_0x4b8b45}:null;}})[_0x400a('0x24')](respondWithResult(_0x25f29a,null))[_0x400a('0x43')](handleError(_0x25f29a,null));};exports['getSubjects']=function(_0x38b993,_0x5425c5,_0x52674a){var _0x430e66={};var _0x51464c={};var _0x678369;var _0x59548c;return db[_0x400a('0x2b')][_0x400a('0x47')]({'where':{'id':_0x38b993['params']['id']}})[_0x400a('0x24')](handleEntityNotFound(_0x5425c5,null))[_0x400a('0x24')](function(_0x553c90){if(_0x553c90){_0x678369=_0x553c90;_0x51464c[_0x400a('0x35')]=_['keys'](db[_0x400a('0x4c')]['rawAttributes']);_0x51464c['query']=_[_0x400a('0x31')](_0x38b993[_0x400a('0x30')]);_0x51464c[_0x400a('0x32')]=_[_0x400a('0x33')](_0x51464c['model'],_0x51464c[_0x400a('0x30')]);_0x430e66[_0x400a('0x34')]=_[_0x400a('0x33')](_0x51464c[_0x400a('0x35')],qs['fields'](_0x38b993['query'][_0x400a('0x36')]));_0x430e66['attributes']=_0x430e66[_0x400a('0x34')][_0x400a('0x40')]?_0x430e66[_0x400a('0x34')]:_0x51464c[_0x400a('0x35')];_0x430e66[_0x400a('0x48')]=qs[_0x400a('0x38')](_0x38b993['query'][_0x400a('0x38')]);_0x430e66[_0x400a('0x39')]=qs[_0x400a('0x32')](_[_0x400a('0x49')](_0x38b993['query'],_0x51464c[_0x400a('0x32')]));if(_0x38b993['query'][_0x400a('0x3a')]){_0x430e66[_0x400a('0x39')]=_[_0x400a('0x3b')](_0x430e66[_0x400a('0x39')],{'$or':_[_0x400a('0x2f')](_0x430e66['attributes'],function(_0xa4319e){var _0x428b4a={};_0x428b4a[_0xa4319e]={'$like':'%'+_0x38b993[_0x400a('0x30')][_0x400a('0x3a')]+'%'};return _0x428b4a;})});}_0x430e66=_[_0x400a('0x3b')]({},_0x430e66,_0x38b993[_0x400a('0x3c')]);return _0x678369[_0x400a('0x4d')](_0x430e66);}})[_0x400a('0x24')](function(_0x2d42f5){if(_0x2d42f5){_0x59548c=_0x2d42f5[_0x400a('0x40')];if(!_0x38b993[_0x400a('0x30')]['hasOwnProperty'](_0x400a('0x4b'))){_0x430e66[_0x400a('0x1d')]=qs[_0x400a('0x1d')](_0x38b993[_0x400a('0x30')][_0x400a('0x1d')]);_0x430e66[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x38b993[_0x400a('0x30')]['offset']);}return _0x678369[_0x400a('0x4d')](_0x430e66);}})[_0x400a('0x24')](function(_0x2aa3df){if(_0x2aa3df){return _0x2aa3df?{'count':_0x59548c,'rows':_0x2aa3df}:null;}})[_0x400a('0x24')](respondWithResult(_0x5425c5,null))[_0x400a('0x43')](handleError(_0x5425c5,null));};exports['getDescriptions']=function(_0x1654a1,_0x1a6ba0,_0x1821d0){var _0x19f913={};var _0xb95d77={};var _0x4e1514;var _0xaa9fe9;return db[_0x400a('0x2b')][_0x400a('0x47')]({'where':{'id':_0x1654a1[_0x400a('0x46')]['id']}})[_0x400a('0x24')](handleEntityNotFound(_0x1a6ba0,null))['then'](function(_0x2869e3){if(_0x2869e3){_0x4e1514=_0x2869e3;_0xb95d77[_0x400a('0x35')]=_[_0x400a('0x31')](db[_0x400a('0x4c')][_0x400a('0x2c')]);_0xb95d77[_0x400a('0x30')]=_[_0x400a('0x31')](_0x1654a1[_0x400a('0x30')]);_0xb95d77['filters']=_[_0x400a('0x33')](_0xb95d77[_0x400a('0x35')],_0xb95d77['query']);_0x19f913['attributes']=_[_0x400a('0x33')](_0xb95d77[_0x400a('0x35')],qs['fields'](_0x1654a1['query'][_0x400a('0x36')]));_0x19f913[_0x400a('0x34')]=_0x19f913[_0x400a('0x34')]['length']?_0x19f913[_0x400a('0x34')]:_0xb95d77[_0x400a('0x35')];_0x19f913[_0x400a('0x48')]=qs[_0x400a('0x38')](_0x1654a1[_0x400a('0x30')]['sort']);_0x19f913[_0x400a('0x39')]=qs[_0x400a('0x32')](_[_0x400a('0x49')](_0x1654a1[_0x400a('0x30')],_0xb95d77[_0x400a('0x32')]));if(_0x1654a1['query'][_0x400a('0x3a')]){_0x19f913[_0x400a('0x39')]=_['merge'](_0x19f913[_0x400a('0x39')],{'$or':_['map'](_0x19f913[_0x400a('0x34')],function(_0x6c2aca){var _0x1396bc={};_0x1396bc[_0x6c2aca]={'$like':'%'+_0x1654a1['query'][_0x400a('0x3a')]+'%'};return _0x1396bc;})});}_0x19f913=_[_0x400a('0x3b')]({},_0x19f913,_0x1654a1['options']);return _0x4e1514[_0x400a('0x4e')](_0x19f913);}})[_0x400a('0x24')](function(_0x118a82){if(_0x118a82){_0xaa9fe9=_0x118a82[_0x400a('0x40')];if(!_0x1654a1['query'][_0x400a('0x37')]('nolimit')){_0x19f913['limit']=qs[_0x400a('0x1d')](_0x1654a1[_0x400a('0x30')]['limit']);_0x19f913[_0x400a('0x1b')]=qs['offset'](_0x1654a1[_0x400a('0x30')][_0x400a('0x1b')]);}return _0x4e1514[_0x400a('0x4e')](_0x19f913);}})[_0x400a('0x24')](function(_0x3c60c4){if(_0x3c60c4){return _0x3c60c4?{'count':_0xaa9fe9,'rows':_0x3c60c4}:null;}})['then'](respondWithResult(_0x1a6ba0,null))[_0x400a('0x43')](handleError(_0x1a6ba0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 43260a2..6d34b26 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 _0x1991=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1991,0xb0));var _0x1199=function(_0x2be188,_0xa293f3){_0x2be188=_0x2be188-0x0;var _0x25ecd1=_0x1991[_0x2be188];return _0x25ecd1;};'use strict';var _=require(_0x1199('0x0'));var util=require('util');var logger=require(_0x1199('0x1'))(_0x1199('0x2'));var moment=require(_0x1199('0x3'));var BPromise=require('bluebird');var rp=require(_0x1199('0x4'));var fs=require('fs');var path=require(_0x1199('0x5'));var rimraf=require(_0x1199('0x6'));var config=require(_0x1199('0x7'));var attributes=require(_0x1199('0x8'));module[_0x1199('0x9')]=function(_0x1f0c59,_0x44caed){return _0x1f0c59[_0x1199('0xa')](_0x1199('0xb'),attributes,{'tableName':_0x1199('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9d8=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4ddbc9,_0xe7290){var _0x20d5da=function(_0x53fc98){while(--_0x53fc98){_0x4ddbc9['push'](_0x4ddbc9['shift']());}};_0x20d5da(++_0xe7290);}(_0xd9d8,0x1e8));var _0x8d9d=function(_0x24092d,_0x5ce107){_0x24092d=_0x24092d-0x0;var _0x4d434f=_0xd9d8[_0x24092d];return _0x4d434f;};'use strict';var _=require(_0x8d9d('0x0'));var util=require(_0x8d9d('0x1'));var logger=require(_0x8d9d('0x2'))(_0x8d9d('0x3'));var moment=require('moment');var BPromise=require(_0x8d9d('0x4'));var rp=require(_0x8d9d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d9d('0x6'));var config=require(_0x8d9d('0x7'));var attributes=require(_0x8d9d('0x8'));module[_0x8d9d('0x9')]=function(_0x4a3616,_0xda8b73){return _0x4a3616[_0x8d9d('0xa')](_0x8d9d('0xb'),attributes,{'tableName':_0x8d9d('0xc'),'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 c564505..3013578 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 _0x279b=['http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1ca599,_0x2dc752){var _0x4682a4=function(_0x55249b){while(--_0x55249b){_0x1ca599['push'](_0x1ca599['shift']());}};_0x4682a4(++_0x2dc752);}(_0x279b,0x68));var _0xb279=function(_0x50fe9f,_0xaf05b2){_0x50fe9f=_0x50fe9f-0x0;var _0x5dcb37=_0x279b[_0x50fe9f];return _0x5dcb37;};'use strict';var _=require(_0xb279('0x0'));var util=require(_0xb279('0x1'));var moment=require(_0xb279('0x2'));var BPromise=require(_0xb279('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb279('0x4'));var db=require(_0xb279('0x5'))['db'];var utils=require(_0xb279('0x6'));var logger=require(_0xb279('0x7'))('rpc');var config=require(_0xb279('0x8'));var jayson=require(_0xb279('0x9'));var client=jayson[_0xb279('0xa')][_0xb279('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x174cce,_0x46d0dc,_0x5b73b2){return new BPromise(function(_0x1643c1,_0x256d43){return client['request'](_0x174cce,_0x5b73b2)[_0xb279('0xc')](function(_0x5a387c){logger[_0xb279('0xd')](_0xb279('0xe'),_0x46d0dc,_0xb279('0xf'));logger[_0xb279('0x10')](_0xb279('0x11'),_0x46d0dc,'request\x20sent',JSON[_0xb279('0x12')](_0x5a387c));if(_0x5a387c[_0xb279('0x13')]){if(_0x5a387c[_0xb279('0x13')]['code']===0x1f4){logger[_0xb279('0x13')](_0xb279('0xe'),_0x46d0dc,_0x5a387c[_0xb279('0x13')][_0xb279('0x14')]);return _0x256d43(_0x5a387c[_0xb279('0x13')]['message']);}logger[_0xb279('0x13')](_0xb279('0xe'),_0x46d0dc,_0x5a387c[_0xb279('0x13')][_0xb279('0x14')]);return _0x1643c1(_0x5a387c[_0xb279('0x13')][_0xb279('0x14')]);}else{logger[_0xb279('0xd')](_0xb279('0xe'),_0x46d0dc,_0xb279('0xf'));_0x1643c1(_0x5a387c[_0xb279('0x15')][_0xb279('0x14')]);}})[_0xb279('0x16')](function(_0x39f638){logger[_0xb279('0x13')](_0xb279('0xe'),_0x46d0dc,_0x39f638);_0x256d43(_0x39f638);});});} \ No newline at end of file +var _0x0363=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0363,0xe7));var _0x3036=function(_0xd94791,_0x1e1c23){_0xd94791=_0xd94791-0x0;var _0x21494d=_0x0363[_0xd94791];return _0x21494d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3036('0x0'));var BPromise=require(_0x3036('0x1'));var rs=require(_0x3036('0x2'));var fs=require('fs');var Redis=require(_0x3036('0x3'));var db=require(_0x3036('0x4'))['db'];var utils=require(_0x3036('0x5'));var logger=require(_0x3036('0x6'))(_0x3036('0x7'));var config=require(_0x3036('0x8'));var jayson=require(_0x3036('0x9'));var client=jayson[_0x3036('0xa')][_0x3036('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b041d,_0xaace4c,_0x43f56c){return new BPromise(function(_0x47db02,_0x17d1b4){return client[_0x3036('0xc')](_0x5b041d,_0x43f56c)['then'](function(_0x5da5e6){logger['info'](_0x3036('0xd'),_0xaace4c,'request\x20sent');logger[_0x3036('0xe')](_0x3036('0xf'),_0xaace4c,_0x3036('0x10'),JSON[_0x3036('0x11')](_0x5da5e6));if(_0x5da5e6[_0x3036('0x12')]){if(_0x5da5e6[_0x3036('0x12')][_0x3036('0x13')]===0x1f4){logger[_0x3036('0x12')](_0x3036('0xd'),_0xaace4c,_0x5da5e6[_0x3036('0x12')][_0x3036('0x14')]);return _0x17d1b4(_0x5da5e6['error'][_0x3036('0x14')]);}logger[_0x3036('0x12')](_0x3036('0xd'),_0xaace4c,_0x5da5e6[_0x3036('0x12')][_0x3036('0x14')]);return _0x47db02(_0x5da5e6[_0x3036('0x12')]['message']);}else{logger['info'](_0x3036('0xd'),_0xaace4c,_0x3036('0x10'));_0x47db02(_0x5da5e6[_0x3036('0x15')]['message']);}})[_0x3036('0x16')](function(_0x499d98){logger[_0x3036('0x12')](_0x3036('0xd'),_0xaace4c,_0x499d98);_0x17d1b4(_0x499d98);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8277552..695ccf7 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 _0x489d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x489d,0xa8));var _0xd489=function(_0x1881d6,_0x4daf89){_0x1881d6=_0x1881d6-0x0;var _0x5b481e=_0x489d[_0x1881d6];return _0x5b481e;};'use strict';var multer=require(_0xd489('0x0'));var util=require(_0xd489('0x1'));var path=require('path');var timeout=require(_0xd489('0x2'));var express=require(_0xd489('0x3'));var router=express[_0xd489('0x4')]();var fs_extra=require(_0xd489('0x5'));var auth=require(_0xd489('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd489('0x7'));var controller=require(_0xd489('0x8'));router[_0xd489('0x9')]('/',auth[_0xd489('0xa')](),controller['index']);router['get'](_0xd489('0xb'),auth[_0xd489('0xa')](),controller[_0xd489('0xc')]);router[_0xd489('0xd')]('/',auth[_0xd489('0xa')](),controller[_0xd489('0xe')]);router[_0xd489('0xf')](_0xd489('0xb'),auth[_0xd489('0xa')](),controller[_0xd489('0x10')]);router[_0xd489('0x11')]('/:id',auth[_0xd489('0xa')](),controller['destroy']);module[_0xd489('0x12')]=router; \ No newline at end of file +var _0x9371=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x33a781,_0x4acbe6){var _0x6a341e=function(_0x15d684){while(--_0x15d684){_0x33a781['push'](_0x33a781['shift']());}};_0x6a341e(++_0x4acbe6);}(_0x9371,0x154));var _0x1937=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9371[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1937('0x0'));var util=require(_0x1937('0x1'));var path=require(_0x1937('0x2'));var timeout=require(_0x1937('0x3'));var express=require(_0x1937('0x4'));var router=express[_0x1937('0x5')]();var fs_extra=require(_0x1937('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1937('0x7'));var config=require(_0x1937('0x8'));var controller=require(_0x1937('0x9'));router[_0x1937('0xa')]('/',auth[_0x1937('0xb')](),controller[_0x1937('0xc')]);router[_0x1937('0xa')](_0x1937('0xd'),auth[_0x1937('0xb')](),controller[_0x1937('0xe')]);router[_0x1937('0xf')]('/',auth[_0x1937('0xb')](),controller[_0x1937('0x10')]);router[_0x1937('0x11')](_0x1937('0xd'),auth[_0x1937('0xb')](),controller[_0x1937('0x12')]);router[_0x1937('0x13')](_0x1937('0xd'),auth['isAuthenticated'](),controller[_0x1937('0x14')]);module[_0x1937('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2ffa987..b0ea911 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 _0xa86b=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x4c0e86,_0x47e59d){var _0x6b9a5d=function(_0x318025){while(--_0x318025){_0x4c0e86['push'](_0x4c0e86['shift']());}};_0x6b9a5d(++_0x47e59d);}(_0xa86b,0x64));var _0xba86=function(_0x2fdf85,_0x38a092){_0x2fdf85=_0x2fdf85-0x0;var _0x5b37de=_0xa86b[_0x2fdf85];return _0x5b37de;};'use strict';var Sequelize=require(_0xba86('0x0'));module[_0xba86('0x1')]={'type':{'type':Sequelize[_0xba86('0x2')]('string',_0xba86('0x3'),_0xba86('0x4'),_0xba86('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xba86('0x6')]},'key':{'type':Sequelize[_0xba86('0x6')]},'keyType':{'type':Sequelize[_0xba86('0x2')]('string',_0xba86('0x3'),_0xba86('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xba86('0x6')]},'nameField':{'type':Sequelize[_0xba86('0x6')]},'customField':{'type':Sequelize[_0xba86('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa6c1=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa6c1,0xa5));var _0x1a6c=function(_0x3adb8e,_0x247ca2){_0x3adb8e=_0x3adb8e-0x0;var _0x3eacdb=_0xa6c1[_0x3adb8e];return _0x3eacdb;};'use strict';var Sequelize=require(_0x1a6c('0x0'));module[_0x1a6c('0x1')]={'type':{'type':Sequelize[_0x1a6c('0x2')](_0x1a6c('0x3'),_0x1a6c('0x4'),_0x1a6c('0x5'),_0x1a6c('0x6'),_0x1a6c('0x7')),'defaultValue':_0x1a6c('0x3')},'content':{'type':Sequelize[_0x1a6c('0x8')]},'key':{'type':Sequelize[_0x1a6c('0x8')]},'keyType':{'type':Sequelize[_0x1a6c('0x2')]('string',_0x1a6c('0x4'),_0x1a6c('0x5'))},'keyContent':{'type':Sequelize[_0x1a6c('0x8')]},'idField':{'type':Sequelize[_0x1a6c('0x8')]},'nameField':{'type':Sequelize[_0x1a6c('0x8')]},'customField':{'type':Sequelize[_0x1a6c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a6c('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fe39957..31a6fc7 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 _0x9620=['to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','end','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','then','include','findAll','rows','show','params','rawAttributes','length','includeAll','options','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9620,0x96));var _0x0962=function(_0xad4335,_0x290ae3){_0xad4335=_0xad4335-0x0;var _0x370989=_0x9620[_0xad4335];return _0x370989;};'use strict';var emlformat=require(_0x0962('0x0'));var rimraf=require(_0x0962('0x1'));var zipdir=require(_0x0962('0x2'));var jsonpatch=require(_0x0962('0x3'));var rp=require(_0x0962('0x4'));var moment=require(_0x0962('0x5'));var BPromise=require(_0x0962('0x6'));var Mustache=require(_0x0962('0x7'));var util=require('util');var path=require(_0x0962('0x8'));var sox=require(_0x0962('0x9'));var csv=require(_0x0962('0xa'));var ejs=require(_0x0962('0xb'));var fs=require('fs');var fs_extra=require(_0x0962('0xc'));var _=require('lodash');var squel=require(_0x0962('0xd'));var crypto=require(_0x0962('0xe'));var jsforce=require(_0x0962('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0962('0xa'));var querystring=require(_0x0962('0x10'));var Papa=require(_0x0962('0x11'));var Redis=require(_0x0962('0x12'));var authService=require(_0x0962('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0962('0x14'));var hardwareService=require(_0x0962('0x15'));var logger=require(_0x0962('0x16'))(_0x0962('0x17'));var utils=require(_0x0962('0x18'));var config=require(_0x0962('0x19'));var licenseUtil=require(_0x0962('0x1a'));var db=require(_0x0962('0x1b'))['db'];function respondWithStatusCode(_0x1e8994,_0x3f58b2){_0x3f58b2=_0x3f58b2||0xcc;return function(_0x1ef644){if(_0x1ef644){return _0x1e8994[_0x0962('0x1c')](_0x3f58b2);}return _0x1e8994['status'](_0x3f58b2)['end']();};}function respondWithResult(_0x3149d8,_0x136990){_0x136990=_0x136990||0xc8;return function(_0x4491c0){if(_0x4491c0){return _0x3149d8[_0x0962('0x1d')](_0x136990)[_0x0962('0x1e')](_0x4491c0);}};}function respondWithFilteredResult(_0x1d9167,_0x227c5d){return function(_0x1e9116){if(_0x1e9116){var _0x3ec4d4=typeof _0x227c5d['offset']===_0x0962('0x1f')&&typeof _0x227c5d[_0x0962('0x20')]===_0x0962('0x1f');var _0x4f06b7=_0x1e9116[_0x0962('0x21')];var _0x3f4201=_0x3ec4d4?0x0:_0x227c5d[_0x0962('0x22')];var _0x334567=_0x3ec4d4?_0x1e9116[_0x0962('0x21')]:_0x227c5d['offset']+_0x227c5d[_0x0962('0x20')];var _0x55d524;if(_0x334567>=_0x4f06b7){_0x334567=_0x4f06b7;_0x55d524=0xc8;}else{_0x55d524=0xce;}_0x1d9167[_0x0962('0x1d')](_0x55d524);return _0x1d9167['set'](_0x0962('0x23'),_0x3f4201+'-'+_0x334567+'/'+_0x4f06b7)['json'](_0x1e9116);}return null;};}function patchUpdates(_0x535fbe){return function(_0x295943){try{jsonpatch[_0x0962('0x24')](_0x295943,_0x535fbe,!![]);}catch(_0x4dac96){return BPromise[_0x0962('0x25')](_0x4dac96);}return _0x295943[_0x0962('0x26')]();};}function saveUpdates(_0x4476bb,_0x567b05){return function(_0x377483){if(_0x377483){return _0x377483[_0x0962('0x27')](_0x4476bb)['then'](function(_0x6970b4){return _0x6970b4;});}return null;};}function removeEntity(_0x195c59,_0x9b7c5b){return function(_0xebd8b5){if(_0xebd8b5){return _0xebd8b5['destroy']()['then'](function(){_0x195c59[_0x0962('0x1d')](0xcc)[_0x0962('0x28')]();});}};}function handleEntityNotFound(_0x43ace6,_0x2cffbc){return function(_0x24d321){if(!_0x24d321){_0x43ace6[_0x0962('0x1c')](0x194);}return _0x24d321;};}function handleError(_0x3cc0f9,_0x10ad46){_0x10ad46=_0x10ad46||0x1f4;return function(_0x52bd4d){logger[_0x0962('0x29')](_0x52bd4d[_0x0962('0x2a')]);if(_0x52bd4d['name']){delete _0x52bd4d[_0x0962('0x2b')];}_0x3cc0f9[_0x0962('0x1d')](_0x10ad46)[_0x0962('0x2c')](_0x52bd4d);};}exports[_0x0962('0x2d')]=function(_0x584290,_0x5b0fc1){var _0x16100b={},_0x53fd97={},_0xb520e5={'count':0x0,'rows':[]};var _0x50e7e0=_[_0x0962('0x2e')](db[_0x0962('0x2f')]['rawAttributes'],function(_0x1bc31a){return{'name':_0x1bc31a[_0x0962('0x30')],'type':_0x1bc31a[_0x0962('0x31')][_0x0962('0x32')]};});_0x53fd97[_0x0962('0x33')]=_[_0x0962('0x2e')](_0x50e7e0,_0x0962('0x2b'));_0x53fd97['query']=_['keys'](_0x584290[_0x0962('0x34')]);_0x53fd97[_0x0962('0x35')]=_['intersection'](_0x53fd97[_0x0962('0x33')],_0x53fd97[_0x0962('0x34')]);_0x16100b[_0x0962('0x36')]=_[_0x0962('0x37')](_0x53fd97['model'],qs[_0x0962('0x38')](_0x584290[_0x0962('0x34')][_0x0962('0x38')]));_0x16100b[_0x0962('0x36')]=_0x16100b[_0x0962('0x36')]['length']?_0x16100b[_0x0962('0x36')]:_0x53fd97[_0x0962('0x33')];if(!_0x584290[_0x0962('0x34')][_0x0962('0x39')]('nolimit')){_0x16100b[_0x0962('0x20')]=qs[_0x0962('0x20')](_0x584290['query'][_0x0962('0x20')]);_0x16100b[_0x0962('0x22')]=qs[_0x0962('0x22')](_0x584290[_0x0962('0x34')][_0x0962('0x22')]);}_0x16100b[_0x0962('0x3a')]=qs[_0x0962('0x3b')](_0x584290[_0x0962('0x34')][_0x0962('0x3b')]);_0x16100b['where']=qs[_0x0962('0x35')](_[_0x0962('0x3c')](_0x584290['query'],_0x53fd97[_0x0962('0x35')]),_0x50e7e0);if(_0x584290[_0x0962('0x34')][_0x0962('0x3d')]){_0x16100b[_0x0962('0x3e')]=_['merge'](_0x16100b[_0x0962('0x3e')],{'$or':_[_0x0962('0x2e')](_0x50e7e0,function(_0x50b6e1){if(_0x50b6e1['type']!==_0x0962('0x3f')){var _0x1295a9={};_0x1295a9[_0x50b6e1[_0x0962('0x2b')]]={'$like':'%'+_0x584290[_0x0962('0x34')][_0x0962('0x3d')]+'%'};return _0x1295a9;}})});}_0x16100b=_[_0x0962('0x40')]({},_0x16100b,_0x584290['options']);var _0x21236c={'where':_0x16100b[_0x0962('0x3e')]};return db[_0x0962('0x2f')][_0x0962('0x21')](_0x21236c)[_0x0962('0x41')](function(_0x2cc14c){_0xb520e5[_0x0962('0x21')]=_0x2cc14c;if(_0x584290[_0x0962('0x34')]['includeAll']){_0x16100b[_0x0962('0x42')]=[{'all':!![]}];}return db[_0x0962('0x2f')][_0x0962('0x43')](_0x16100b);})['then'](function(_0x4b7c9a){_0xb520e5[_0x0962('0x44')]=_0x4b7c9a;return _0xb520e5;})['then'](respondWithFilteredResult(_0x5b0fc1,_0x16100b))['catch'](handleError(_0x5b0fc1,null));};exports[_0x0962('0x45')]=function(_0x449132,_0x40375f){var _0x3aa297={'raw':!![],'where':{'id':_0x449132[_0x0962('0x46')]['id']}},_0x1e5cf5={};_0x1e5cf5[_0x0962('0x33')]=_['keys'](db[_0x0962('0x2f')][_0x0962('0x47')]);_0x1e5cf5[_0x0962('0x34')]=_['keys'](_0x449132['query']);_0x1e5cf5[_0x0962('0x35')]=_[_0x0962('0x37')](_0x1e5cf5['model'],_0x1e5cf5['query']);_0x3aa297[_0x0962('0x36')]=_[_0x0962('0x37')](_0x1e5cf5['model'],qs['fields'](_0x449132[_0x0962('0x34')][_0x0962('0x38')]));_0x3aa297[_0x0962('0x36')]=_0x3aa297[_0x0962('0x36')][_0x0962('0x48')]?_0x3aa297[_0x0962('0x36')]:_0x1e5cf5['model'];if(_0x449132[_0x0962('0x34')][_0x0962('0x49')]){_0x3aa297[_0x0962('0x42')]=[{'all':!![]}];}_0x3aa297=_[_0x0962('0x40')]({},_0x3aa297,_0x449132[_0x0962('0x4a')]);return db[_0x0962('0x2f')][_0x0962('0x4b')](_0x3aa297)[_0x0962('0x41')](handleEntityNotFound(_0x40375f,null))[_0x0962('0x41')](respondWithResult(_0x40375f,null))['catch'](handleError(_0x40375f,null));};exports['create']=function(_0x65daa,_0x2634eb){return db[_0x0962('0x2f')][_0x0962('0x4c')](_0x65daa['body'],{})[_0x0962('0x41')](respondWithResult(_0x2634eb,0xc9))['catch'](handleError(_0x2634eb,null));};exports['update']=function(_0x1eaffa,_0x3daafe){if(_0x1eaffa[_0x0962('0x4d')]['id']){delete _0x1eaffa['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x1eaffa[_0x0962('0x46')]['id']}})['then'](handleEntityNotFound(_0x3daafe,null))['then'](saveUpdates(_0x1eaffa[_0x0962('0x4d')],null))['then'](respondWithResult(_0x3daafe,null))[_0x0962('0x4e')](handleError(_0x3daafe,null));};exports[_0x0962('0x4f')]=function(_0x294f85,_0xe5f6e2){return db[_0x0962('0x2f')][_0x0962('0x4b')]({'where':{'id':_0x294f85[_0x0962('0x46')]['id']}})[_0x0962('0x41')](handleEntityNotFound(_0xe5f6e2,null))['then'](removeEntity(_0xe5f6e2,null))['catch'](handleError(_0xe5f6e2,null));}; \ No newline at end of file +var _0x0423=['includeAll','include','find','create','body','destroy','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','SugarcrmField','findAll','catch','params'];(function(_0x2e7d49,_0x26ae35){var _0x1b7bf6=function(_0x3a354f){while(--_0x3a354f){_0x2e7d49['push'](_0x2e7d49['shift']());}};_0x1b7bf6(++_0x26ae35);}(_0x0423,0x1c8));var _0x3042=function(_0x5a15fc,_0x55f7a5){_0x5a15fc=_0x5a15fc-0x0;var _0xc4f77e=_0x0423[_0x5a15fc];return _0xc4f77e;};'use strict';var emlformat=require(_0x3042('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3042('0x1'));var rp=require(_0x3042('0x2'));var moment=require('moment');var BPromise=require(_0x3042('0x3'));var Mustache=require(_0x3042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3042('0x5'));var csv=require(_0x3042('0x6'));var ejs=require(_0x3042('0x7'));var fs=require('fs');var fs_extra=require(_0x3042('0x8'));var _=require(_0x3042('0x9'));var squel=require(_0x3042('0xa'));var crypto=require(_0x3042('0xb'));var jsforce=require(_0x3042('0xc'));var deskjs=require(_0x3042('0xd'));var toCsv=require(_0x3042('0x6'));var querystring=require(_0x3042('0xe'));var Papa=require(_0x3042('0xf'));var Redis=require(_0x3042('0x10'));var authService=require(_0x3042('0x11'));var qs=require(_0x3042('0x12'));var as=require(_0x3042('0x13'));var hardwareService=require(_0x3042('0x14'));var logger=require(_0x3042('0x15'))(_0x3042('0x16'));var utils=require(_0x3042('0x17'));var config=require(_0x3042('0x18'));var licenseUtil=require(_0x3042('0x19'));var db=require(_0x3042('0x1a'))['db'];function respondWithStatusCode(_0x56db18,_0x18c157){_0x18c157=_0x18c157||0xcc;return function(_0x3f6444){if(_0x3f6444){return _0x56db18[_0x3042('0x1b')](_0x18c157);}return _0x56db18[_0x3042('0x1c')](_0x18c157)['end']();};}function respondWithResult(_0x2b6463,_0x3a26f9){_0x3a26f9=_0x3a26f9||0xc8;return function(_0x5df9db){if(_0x5df9db){return _0x2b6463[_0x3042('0x1c')](_0x3a26f9)[_0x3042('0x1d')](_0x5df9db);}};}function respondWithFilteredResult(_0x346af0,_0x34d52e){return function(_0x22982d){if(_0x22982d){var _0x11dcf7=typeof _0x34d52e['offset']==='undefined'&&typeof _0x34d52e[_0x3042('0x1e')]===_0x3042('0x1f');var _0x404e13=_0x22982d[_0x3042('0x20')];var _0x4c62f9=_0x11dcf7?0x0:_0x34d52e[_0x3042('0x21')];var _0x536426=_0x11dcf7?_0x22982d[_0x3042('0x20')]:_0x34d52e[_0x3042('0x21')]+_0x34d52e[_0x3042('0x1e')];var _0x1dac36;if(_0x536426>=_0x404e13){_0x536426=_0x404e13;_0x1dac36=0xc8;}else{_0x1dac36=0xce;}_0x346af0['status'](_0x1dac36);return _0x346af0[_0x3042('0x22')](_0x3042('0x23'),_0x4c62f9+'-'+_0x536426+'/'+_0x404e13)['json'](_0x22982d);}return null;};}function patchUpdates(_0x198ada){return function(_0x4d09f9){try{jsonpatch[_0x3042('0x24')](_0x4d09f9,_0x198ada,!![]);}catch(_0x3a57bb){return BPromise[_0x3042('0x25')](_0x3a57bb);}return _0x4d09f9['save']();};}function saveUpdates(_0x1ec678,_0x4c4ffd){return function(_0x200872){if(_0x200872){return _0x200872[_0x3042('0x26')](_0x1ec678)[_0x3042('0x27')](function(_0x3bb2c2){return _0x3bb2c2;});}return null;};}function removeEntity(_0x15d845,_0x2010f2){return function(_0x90a648){if(_0x90a648){return _0x90a648['destroy']()['then'](function(){_0x15d845[_0x3042('0x1c')](0xcc)[_0x3042('0x28')]();});}};}function handleEntityNotFound(_0x23c666,_0x2f51cb){return function(_0x5e31cd){if(!_0x5e31cd){_0x23c666[_0x3042('0x1b')](0x194);}return _0x5e31cd;};}function handleError(_0x3eb3a2,_0x56a336){_0x56a336=_0x56a336||0x1f4;return function(_0x42b6f7){logger[_0x3042('0x29')](_0x42b6f7[_0x3042('0x2a')]);if(_0x42b6f7[_0x3042('0x2b')]){delete _0x42b6f7['name'];}_0x3eb3a2[_0x3042('0x1c')](_0x56a336)[_0x3042('0x2c')](_0x42b6f7);};}exports['index']=function(_0x531184,_0x49662a){var _0x150abe={},_0x4619ec={},_0x21ad8e={'count':0x0,'rows':[]};var _0x49a829=_[_0x3042('0x2d')](db['SugarcrmField'][_0x3042('0x2e')],function(_0x4decfd){return{'name':_0x4decfd[_0x3042('0x2f')],'type':_0x4decfd[_0x3042('0x30')]['key']};});_0x4619ec[_0x3042('0x31')]=_['map'](_0x49a829,_0x3042('0x2b'));_0x4619ec['query']=_[_0x3042('0x32')](_0x531184[_0x3042('0x33')]);_0x4619ec['filters']=_['intersection'](_0x4619ec['model'],_0x4619ec[_0x3042('0x33')]);_0x150abe['attributes']=_[_0x3042('0x34')](_0x4619ec[_0x3042('0x31')],qs[_0x3042('0x35')](_0x531184[_0x3042('0x33')][_0x3042('0x35')]));_0x150abe[_0x3042('0x36')]=_0x150abe[_0x3042('0x36')][_0x3042('0x37')]?_0x150abe[_0x3042('0x36')]:_0x4619ec[_0x3042('0x31')];if(!_0x531184[_0x3042('0x33')][_0x3042('0x38')](_0x3042('0x39'))){_0x150abe[_0x3042('0x1e')]=qs[_0x3042('0x1e')](_0x531184['query'][_0x3042('0x1e')]);_0x150abe['offset']=qs['offset'](_0x531184['query'][_0x3042('0x21')]);}_0x150abe[_0x3042('0x3a')]=qs['sort'](_0x531184[_0x3042('0x33')]['sort']);_0x150abe[_0x3042('0x3b')]=qs[_0x3042('0x3c')](_['pick'](_0x531184[_0x3042('0x33')],_0x4619ec[_0x3042('0x3c')]),_0x49a829);if(_0x531184['query'][_0x3042('0x3d')]){_0x150abe['where']=_['merge'](_0x150abe[_0x3042('0x3b')],{'$or':_[_0x3042('0x2d')](_0x49a829,function(_0x45a79c){if(_0x45a79c[_0x3042('0x30')]!==_0x3042('0x3e')){var _0x250e0c={};_0x250e0c[_0x45a79c[_0x3042('0x2b')]]={'$like':'%'+_0x531184[_0x3042('0x33')][_0x3042('0x3d')]+'%'};return _0x250e0c;}})});}_0x150abe=_[_0x3042('0x3f')]({},_0x150abe,_0x531184[_0x3042('0x40')]);var _0x449de9={'where':_0x150abe[_0x3042('0x3b')]};return db['SugarcrmField']['count'](_0x449de9)[_0x3042('0x27')](function(_0xf628ab){_0x21ad8e[_0x3042('0x20')]=_0xf628ab;if(_0x531184[_0x3042('0x33')]['includeAll']){_0x150abe['include']=[{'all':!![]}];}return db[_0x3042('0x41')][_0x3042('0x42')](_0x150abe);})[_0x3042('0x27')](function(_0x1f6204){_0x21ad8e['rows']=_0x1f6204;return _0x21ad8e;})['then'](respondWithFilteredResult(_0x49662a,_0x150abe))[_0x3042('0x43')](handleError(_0x49662a,null));};exports['show']=function(_0x430442,_0x5e69d4){var _0x5272f8={'raw':!![],'where':{'id':_0x430442[_0x3042('0x44')]['id']}},_0x4ee573={};_0x4ee573[_0x3042('0x31')]=_[_0x3042('0x32')](db['SugarcrmField']['rawAttributes']);_0x4ee573['query']=_[_0x3042('0x32')](_0x430442[_0x3042('0x33')]);_0x4ee573[_0x3042('0x3c')]=_[_0x3042('0x34')](_0x4ee573[_0x3042('0x31')],_0x4ee573[_0x3042('0x33')]);_0x5272f8[_0x3042('0x36')]=_['intersection'](_0x4ee573['model'],qs[_0x3042('0x35')](_0x430442[_0x3042('0x33')][_0x3042('0x35')]));_0x5272f8[_0x3042('0x36')]=_0x5272f8[_0x3042('0x36')][_0x3042('0x37')]?_0x5272f8['attributes']:_0x4ee573[_0x3042('0x31')];if(_0x430442[_0x3042('0x33')][_0x3042('0x45')]){_0x5272f8[_0x3042('0x46')]=[{'all':!![]}];}_0x5272f8=_[_0x3042('0x3f')]({},_0x5272f8,_0x430442[_0x3042('0x40')]);return db[_0x3042('0x41')][_0x3042('0x47')](_0x5272f8)[_0x3042('0x27')](handleEntityNotFound(_0x5e69d4,null))[_0x3042('0x27')](respondWithResult(_0x5e69d4,null))[_0x3042('0x43')](handleError(_0x5e69d4,null));};exports['create']=function(_0x1a0f3f,_0x12c2e2){return db[_0x3042('0x41')][_0x3042('0x48')](_0x1a0f3f[_0x3042('0x49')],{})[_0x3042('0x27')](respondWithResult(_0x12c2e2,0xc9))[_0x3042('0x43')](handleError(_0x12c2e2,null));};exports['update']=function(_0x21dadb,_0x23b111){if(_0x21dadb[_0x3042('0x49')]['id']){delete _0x21dadb['body']['id'];}return db['SugarcrmField'][_0x3042('0x47')]({'where':{'id':_0x21dadb['params']['id']}})[_0x3042('0x27')](handleEntityNotFound(_0x23b111,null))[_0x3042('0x27')](saveUpdates(_0x21dadb['body'],null))[_0x3042('0x27')](respondWithResult(_0x23b111,null))[_0x3042('0x43')](handleError(_0x23b111,null));};exports[_0x3042('0x4a')]=function(_0x570467,_0x1d7c8a){return db['SugarcrmField']['find']({'where':{'id':_0x570467[_0x3042('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d7c8a,null))[_0x3042('0x27')](removeEntity(_0x1d7c8a,null))[_0x3042('0x43')](handleError(_0x1d7c8a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index e7d6239..7a4e6f1 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 _0xa0db=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x38b586,_0x14c240){var _0x146637=function(_0x15da94){while(--_0x15da94){_0x38b586['push'](_0x38b586['shift']());}};_0x146637(++_0x14c240);}(_0xa0db,0x126));var _0xba0d=function(_0xd90bbe,_0x5812bb){_0xd90bbe=_0xd90bbe-0x0;var _0x479e04=_0xa0db[_0xd90bbe];return _0x479e04;};'use strict';var _=require(_0xba0d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba0d('0x1'));var moment=require(_0xba0d('0x2'));var BPromise=require(_0xba0d('0x3'));var rp=require(_0xba0d('0x4'));var fs=require('fs');var path=require(_0xba0d('0x5'));var rimraf=require(_0xba0d('0x6'));var config=require(_0xba0d('0x7'));var attributes=require(_0xba0d('0x8'));module['exports']=function(_0x3a7831,_0x273dbf){return _0x3a7831[_0xba0d('0x9')](_0xba0d('0xa'),attributes,{'tableName':_0xba0d('0xb'),'paranoid':![],'indexes':[{'name':_0xba0d('0xc'),'fields':[_0xba0d('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe93=['sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x4b1b76,_0x79c949){var _0x4f4638=function(_0x200d90){while(--_0x200d90){_0x4b1b76['push'](_0x4b1b76['shift']());}};_0x4f4638(++_0x79c949);}(_0xfe93,0xf1));var _0x3fe9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xfe93[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x3fe9('0x0'));var logger=require(_0x3fe9('0x1'))(_0x3fe9('0x2'));var moment=require(_0x3fe9('0x3'));var BPromise=require(_0x3fe9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3fe9('0x5'));var config=require(_0x3fe9('0x6'));var attributes=require(_0x3fe9('0x7'));module[_0x3fe9('0x8')]=function(_0x97c1bc,_0x1035d8){return _0x97c1bc[_0x3fe9('0x9')](_0x3fe9('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x3fe9('0xb'),'fields':[_0x3fe9('0xc'),_0x3fe9('0xd')],'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 7f23d0e..7c7b6e2 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 _0xf434=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x4f99df,_0x3aff47){var _0x1811bc=function(_0x3c3bf1){while(--_0x3c3bf1){_0x4f99df['push'](_0x4f99df['shift']());}};_0x1811bc(++_0x3aff47);}(_0xf434,0x83));var _0x4f43=function(_0x4ac832,_0x4d3130){_0x4ac832=_0x4ac832-0x0;var _0x10e03d=_0xf434[_0x4ac832];return _0x10e03d;};'use strict';var _=require(_0x4f43('0x0'));var util=require(_0x4f43('0x1'));var moment=require(_0x4f43('0x2'));var BPromise=require(_0x4f43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f43('0x4'));var db=require(_0x4f43('0x5'))['db'];var utils=require(_0x4f43('0x6'));var logger=require(_0x4f43('0x7'))(_0x4f43('0x8'));var config=require(_0x4f43('0x9'));var jayson=require(_0x4f43('0xa'));var client=jayson[_0x4f43('0xb')][_0x4f43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54ed79,_0x12c2b6,_0x43cf7c){return new BPromise(function(_0x5427c4,_0xc21a72){return client[_0x4f43('0xd')](_0x54ed79,_0x43cf7c)[_0x4f43('0xe')](function(_0x381627){logger[_0x4f43('0xf')](_0x4f43('0x10'),_0x12c2b6,'request\x20sent');logger[_0x4f43('0x11')](_0x4f43('0x12'),_0x12c2b6,_0x4f43('0x13'),JSON[_0x4f43('0x14')](_0x381627));if(_0x381627[_0x4f43('0x15')]){if(_0x381627[_0x4f43('0x15')][_0x4f43('0x16')]===0x1f4){logger['error'](_0x4f43('0x10'),_0x12c2b6,_0x381627[_0x4f43('0x15')][_0x4f43('0x17')]);return _0xc21a72(_0x381627[_0x4f43('0x15')][_0x4f43('0x17')]);}logger[_0x4f43('0x15')](_0x4f43('0x10'),_0x12c2b6,_0x381627['error'][_0x4f43('0x17')]);return _0x5427c4(_0x381627['error'][_0x4f43('0x17')]);}else{logger[_0x4f43('0xf')](_0x4f43('0x10'),_0x12c2b6,_0x4f43('0x13'));_0x5427c4(_0x381627[_0x4f43('0x18')]['message']);}})['catch'](function(_0x593a2d){logger[_0x4f43('0x15')](_0x4f43('0x10'),_0x12c2b6,_0x593a2d);_0xc21a72(_0x593a2d);});});} \ No newline at end of file +var _0xf3c9=['request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x44d146,_0x5ab748){var _0xead22=function(_0x274ce3){while(--_0x274ce3){_0x44d146['push'](_0x44d146['shift']());}};_0xead22(++_0x5ab748);}(_0xf3c9,0x17e));var _0x9f3c=function(_0x39533c,_0x29ff60){_0x39533c=_0x39533c-0x0;var _0x4b984e=_0xf3c9[_0x39533c];return _0x4b984e;};'use strict';var _=require(_0x9f3c('0x0'));var util=require(_0x9f3c('0x1'));var moment=require(_0x9f3c('0x2'));var BPromise=require(_0x9f3c('0x3'));var rs=require(_0x9f3c('0x4'));var fs=require('fs');var Redis=require(_0x9f3c('0x5'));var db=require(_0x9f3c('0x6'))['db'];var utils=require(_0x9f3c('0x7'));var logger=require(_0x9f3c('0x8'))(_0x9f3c('0x9'));var config=require(_0x9f3c('0xa'));var jayson=require(_0x9f3c('0xb'));var client=jayson[_0x9f3c('0xc')][_0x9f3c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x594464,_0x1be5ee,_0x516b20){return new BPromise(function(_0x486321,_0x58f152){return client[_0x9f3c('0xe')](_0x594464,_0x516b20)[_0x9f3c('0xf')](function(_0x1148b4){logger[_0x9f3c('0x10')](_0x9f3c('0x11'),_0x1be5ee,_0x9f3c('0x12'));logger['debug'](_0x9f3c('0x13'),_0x1be5ee,_0x9f3c('0x12'),JSON[_0x9f3c('0x14')](_0x1148b4));if(_0x1148b4['error']){if(_0x1148b4[_0x9f3c('0x15')][_0x9f3c('0x16')]===0x1f4){logger[_0x9f3c('0x15')](_0x9f3c('0x11'),_0x1be5ee,_0x1148b4[_0x9f3c('0x15')]['message']);return _0x58f152(_0x1148b4[_0x9f3c('0x15')]['message']);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1be5ee,_0x1148b4[_0x9f3c('0x15')][_0x9f3c('0x17')]);return _0x486321(_0x1148b4[_0x9f3c('0x15')][_0x9f3c('0x17')]);}else{logger['info'](_0x9f3c('0x11'),_0x1be5ee,_0x9f3c('0x12'));_0x486321(_0x1148b4['result'][_0x9f3c('0x17')]);}})[_0x9f3c('0x18')](function(_0x5804ba){logger[_0x9f3c('0x15')](_0x9f3c('0x11'),_0x1be5ee,_0x5804ba);_0x58f152(_0x5804ba);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 41cc05a..b29c5e3 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 _0x37f8=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','fs-extra','isAuthenticated','index','get','/:id','show'];(function(_0x5aa023,_0x1cf1d2){var _0x31ceb5=function(_0x40f643){while(--_0x40f643){_0x5aa023['push'](_0x5aa023['shift']());}};_0x31ceb5(++_0x1cf1d2);}(_0x37f8,0xd2));var _0x837f=function(_0x5aa5f5,_0x472392){_0x5aa5f5=_0x5aa5f5-0x0;var _0x211e38=_0x37f8[_0x5aa5f5];return _0x211e38;};'use strict';var multer=require('multer');var util=require(_0x837f('0x0'));var path=require(_0x837f('0x1'));var timeout=require(_0x837f('0x2'));var express=require(_0x837f('0x3'));var router=express['Router']();var fs_extra=require(_0x837f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x837f('0x5')](),controller[_0x837f('0x6')]);router[_0x837f('0x7')](_0x837f('0x8'),auth[_0x837f('0x5')](),controller[_0x837f('0x9')]);router[_0x837f('0x7')](_0x837f('0xa'),auth[_0x837f('0x5')](),controller[_0x837f('0xb')]);router[_0x837f('0x7')](_0x837f('0xc'),auth[_0x837f('0x5')](),controller[_0x837f('0xd')]);router[_0x837f('0xe')]('/',auth['isAuthenticated'](),controller[_0x837f('0xf')]);router[_0x837f('0xe')](_0x837f('0xa'),auth[_0x837f('0x5')](),controller[_0x837f('0x10')]);router['put']('/:id',auth[_0x837f('0x5')](),controller[_0x837f('0x11')]);router[_0x837f('0x12')](_0x837f('0x8'),auth[_0x837f('0x5')](),controller['destroy']);module[_0x837f('0x13')]=router; \ No newline at end of file +var _0xaaea=['get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index'];(function(_0x27eec4,_0x2c12b5){var _0x5a6571=function(_0xbd193b){while(--_0xbd193b){_0x27eec4['push'](_0x27eec4['shift']());}};_0x5a6571(++_0x2c12b5);}(_0xaaea,0x183));var _0xaaae=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xaaea[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require(_0xaaae('0x0'));var path=require('path');var timeout=require(_0xaaae('0x1'));var express=require(_0xaaae('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaaae('0x3'));var interaction=require(_0xaaae('0x4'));var config=require(_0xaaae('0x5'));var controller=require(_0xaaae('0x6'));router['get']('/',auth[_0xaaae('0x7')](),controller[_0xaaae('0x8')]);router[_0xaaae('0x9')](_0xaaae('0xa'),auth['isAuthenticated'](),controller[_0xaaae('0xb')]);router[_0xaaae('0x9')]('/:id/configurations',auth[_0xaaae('0x7')](),controller[_0xaaae('0xc')]);router['get'](_0xaaae('0xd'),auth[_0xaaae('0x7')](),controller[_0xaaae('0xe')]);router[_0xaaae('0xf')]('/',auth[_0xaaae('0x7')](),controller[_0xaaae('0x10')]);router[_0xaaae('0xf')](_0xaaae('0x11'),auth[_0xaaae('0x7')](),controller[_0xaaae('0x12')]);router['put'](_0xaaae('0xa'),auth['isAuthenticated'](),controller[_0xaaae('0x13')]);router[_0xaaae('0x14')](_0xaaae('0xa'),auth[_0xaaae('0x7')](),controller[_0xaaae('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 345c280..0f41693 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 _0x1a26=['sequelize','exports','STRING','HelpDesk'];(function(_0x425f39,_0x31bb62){var _0x5a3ce5=function(_0x4e1975){while(--_0x4e1975){_0x425f39['push'](_0x425f39['shift']());}};_0x5a3ce5(++_0x31bb62);}(_0x1a26,0x88));var _0x61a2=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1a26[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0x61a2('0x0'));module[_0x61a2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x61a2('0x2')]},'username':{'type':Sequelize[_0x61a2('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x61a2('0x2')],'allowNull':![],'defaultValue':_0x61a2('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x61a2('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x61a2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0108=['STRING','HelpDesk','sequelize','exports'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x0108,0x142));var _0x8010=function(_0x148c1d,_0x537052){_0x148c1d=_0x148c1d-0x0;var _0xed1bda=_0x0108[_0x148c1d];return _0xed1bda;};'use strict';var Sequelize=require(_0x8010('0x0'));module[_0x8010('0x1')]={'name':{'type':Sequelize[_0x8010('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8010('0x2')]},'username':{'type':Sequelize[_0x8010('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8010('0x2')],'allowNull':![],'defaultValue':_0x8010('0x3')},'remoteUri':{'type':Sequelize[_0x8010('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8010('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8010('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 fc3085b..a6d39a3 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 _0xd0a1=['Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','keys','filters','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','intersection','include','options','find','body','update','params','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','md5','getFields','description','moduleName','remoteUri','serverUrl','username','accessKey','%s/webservice.php','success','login','token','GET','describe','sessionName','autogenerated','reference','owner','result','remove','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','eml-format','rimraf','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xd0a1,0x1a9));var _0x1d0a=function(_0x47529f,_0x6c7061){_0x47529f=_0x47529f-0x0;var _0x4505a9=_0xd0a1[_0x47529f];return _0x4505a9;};'use strict';var emlformat=require(_0x1d0a('0x0'));var rimraf=require(_0x1d0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d0a('0x2'));var moment=require(_0x1d0a('0x3'));var BPromise=require(_0x1d0a('0x4'));var Mustache=require(_0x1d0a('0x5'));var util=require(_0x1d0a('0x6'));var path=require(_0x1d0a('0x7'));var sox=require(_0x1d0a('0x8'));var csv=require(_0x1d0a('0x9'));var ejs=require(_0x1d0a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d0a('0xb'));var squel=require(_0x1d0a('0xc'));var crypto=require(_0x1d0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d0a('0xe'));var toCsv=require(_0x1d0a('0x9'));var querystring=require(_0x1d0a('0xf'));var Papa=require('papaparse');var Redis=require(_0x1d0a('0x10'));var authService=require(_0x1d0a('0x11'));var qs=require(_0x1d0a('0x12'));var as=require(_0x1d0a('0x13'));var hardwareService=require(_0x1d0a('0x14'));var logger=require(_0x1d0a('0x15'))('api');var utils=require(_0x1d0a('0x16'));var config=require(_0x1d0a('0x17'));var licenseUtil=require(_0x1d0a('0x18'));var db=require(_0x1d0a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x389664,_0x22aee1){_0x22aee1=_0x22aee1||0xcc;return function(_0x1d11e6){if(_0x1d11e6){return _0x389664[_0x1d0a('0x1a')](_0x22aee1);}return _0x389664[_0x1d0a('0x1b')](_0x22aee1)[_0x1d0a('0x1c')]();};}function respondWithResult(_0x5cb301,_0x40c861){_0x40c861=_0x40c861||0xc8;return function(_0x43b210){if(_0x43b210){return _0x5cb301[_0x1d0a('0x1b')](_0x40c861)[_0x1d0a('0x1d')](_0x43b210);}};}function respondWithFilteredResult(_0x4ad932,_0x5b8f4b){return function(_0x5a5f8f){if(_0x5a5f8f){var _0x25cfc8=typeof _0x5b8f4b[_0x1d0a('0x1e')]===_0x1d0a('0x1f')&&typeof _0x5b8f4b[_0x1d0a('0x20')]===_0x1d0a('0x1f');var _0x1667c3=_0x5a5f8f[_0x1d0a('0x21')];var _0x1656d2=_0x25cfc8?0x0:_0x5b8f4b[_0x1d0a('0x1e')];var _0x4a45da=_0x25cfc8?_0x5a5f8f[_0x1d0a('0x21')]:_0x5b8f4b[_0x1d0a('0x1e')]+_0x5b8f4b[_0x1d0a('0x20')];var _0x20e7c4;if(_0x4a45da>=_0x1667c3){_0x4a45da=_0x1667c3;_0x20e7c4=0xc8;}else{_0x20e7c4=0xce;}_0x4ad932[_0x1d0a('0x1b')](_0x20e7c4);return _0x4ad932[_0x1d0a('0x22')](_0x1d0a('0x23'),_0x1656d2+'-'+_0x4a45da+'/'+_0x1667c3)[_0x1d0a('0x1d')](_0x5a5f8f);}return null;};}function patchUpdates(_0x2bfaa4){return function(_0x353cca){try{jsonpatch[_0x1d0a('0x24')](_0x353cca,_0x2bfaa4,!![]);}catch(_0xe8da32){return BPromise['reject'](_0xe8da32);}return _0x353cca[_0x1d0a('0x25')]();};}function saveUpdates(_0x1c0e9d,_0x3ba905){return function(_0x541440){if(_0x541440){return _0x541440['update'](_0x1c0e9d)[_0x1d0a('0x26')](function(_0x395fb6){return _0x395fb6;});}return null;};}function removeEntity(_0x1ad7a8,_0x9ba13e){return function(_0x2a8c27){if(_0x2a8c27){return _0x2a8c27[_0x1d0a('0x27')]()[_0x1d0a('0x26')](function(){_0x1ad7a8[_0x1d0a('0x1b')](0xcc)[_0x1d0a('0x1c')]();});}};}function handleEntityNotFound(_0x435a90,_0x1927c4){return function(_0x34ab92){if(!_0x34ab92){_0x435a90[_0x1d0a('0x1a')](0x194);}return _0x34ab92;};}function handleError(_0x24aff1,_0x2adf79){_0x2adf79=_0x2adf79||0x1f4;return function(_0x11c746){logger[_0x1d0a('0x28')](_0x11c746[_0x1d0a('0x29')]);if(_0x11c746[_0x1d0a('0x2a')]){delete _0x11c746[_0x1d0a('0x2a')];}_0x24aff1[_0x1d0a('0x1b')](_0x2adf79)[_0x1d0a('0x2b')](_0x11c746);};}exports[_0x1d0a('0x2c')]=function(_0xd8e5ae,_0x582619){var _0x7a365e={},_0x4a9aba={},_0x291d78={'count':0x0,'rows':[]};var _0xb45b1e=_[_0x1d0a('0x2d')](db[_0x1d0a('0x2e')][_0x1d0a('0x2f')],function(_0x2a6178){return{'name':_0x2a6178[_0x1d0a('0x30')],'type':_0x2a6178[_0x1d0a('0x31')][_0x1d0a('0x32')]};});_0x4a9aba['model']=_[_0x1d0a('0x2d')](_0xb45b1e,_0x1d0a('0x2a'));_0x4a9aba['query']=_[_0x1d0a('0x33')](_0xd8e5ae['query']);_0x4a9aba[_0x1d0a('0x34')]=_['intersection'](_0x4a9aba[_0x1d0a('0x35')],_0x4a9aba['query']);_0x7a365e[_0x1d0a('0x36')]=_['intersection'](_0x4a9aba['model'],qs[_0x1d0a('0x37')](_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x37')]));_0x7a365e['attributes']=_0x7a365e[_0x1d0a('0x36')][_0x1d0a('0x39')]?_0x7a365e[_0x1d0a('0x36')]:_0x4a9aba[_0x1d0a('0x35')];if(!_0xd8e5ae['query'][_0x1d0a('0x3a')](_0x1d0a('0x3b'))){_0x7a365e[_0x1d0a('0x20')]=qs[_0x1d0a('0x20')](_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x20')]);_0x7a365e[_0x1d0a('0x1e')]=qs[_0x1d0a('0x1e')](_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x1e')]);}_0x7a365e['order']=qs['sort'](_0xd8e5ae['query'][_0x1d0a('0x3c')]);_0x7a365e['where']=qs['filters'](_[_0x1d0a('0x3d')](_0xd8e5ae['query'],_0x4a9aba[_0x1d0a('0x34')]),_0xb45b1e);if(_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x3e')]){_0x7a365e[_0x1d0a('0x3f')]=_[_0x1d0a('0x40')](_0x7a365e[_0x1d0a('0x3f')],{'$or':_['map'](_0xb45b1e,function(_0x3fced4){if(_0x3fced4['type']!==_0x1d0a('0x41')){var _0x1e728c={};_0x1e728c[_0x3fced4['name']]={'$like':'%'+_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x3e')]+'%'};return _0x1e728c;}})});}_0x7a365e=_[_0x1d0a('0x40')]({},_0x7a365e,_0xd8e5ae['options']);var _0x5f0742={'where':_0x7a365e[_0x1d0a('0x3f')]};return db['VtigerAccount'][_0x1d0a('0x21')](_0x5f0742)['then'](function(_0x1f596c){_0x291d78[_0x1d0a('0x21')]=_0x1f596c;if(_0xd8e5ae[_0x1d0a('0x38')][_0x1d0a('0x42')]){_0x7a365e['include']=[{'all':!![]}];}return db[_0x1d0a('0x2e')][_0x1d0a('0x43')](_0x7a365e);})[_0x1d0a('0x26')](function(_0x3c1723){_0x291d78['rows']=_0x3c1723;return _0x291d78;})[_0x1d0a('0x26')](respondWithFilteredResult(_0x582619,_0x7a365e))[_0x1d0a('0x44')](handleError(_0x582619,null));};exports[_0x1d0a('0x45')]=function(_0x143755,_0x35c4c5){var _0x5342f8={'raw':![],'where':{'id':_0x143755['params']['id']}},_0x1bfcc3={};_0x1bfcc3['model']=_[_0x1d0a('0x33')](db[_0x1d0a('0x2e')][_0x1d0a('0x2f')]);_0x1bfcc3[_0x1d0a('0x38')]=_['keys'](_0x143755[_0x1d0a('0x38')]);_0x1bfcc3[_0x1d0a('0x34')]=_[_0x1d0a('0x46')](_0x1bfcc3['model'],_0x1bfcc3[_0x1d0a('0x38')]);_0x5342f8[_0x1d0a('0x36')]=_[_0x1d0a('0x46')](_0x1bfcc3[_0x1d0a('0x35')],qs[_0x1d0a('0x37')](_0x143755[_0x1d0a('0x38')]['fields']));_0x5342f8['attributes']=_0x5342f8[_0x1d0a('0x36')][_0x1d0a('0x39')]?_0x5342f8[_0x1d0a('0x36')]:_0x1bfcc3[_0x1d0a('0x35')];if(_0x143755[_0x1d0a('0x38')][_0x1d0a('0x42')]){_0x5342f8[_0x1d0a('0x47')]=[{'all':!![]}];}_0x5342f8=_[_0x1d0a('0x40')]({},_0x5342f8,_0x143755[_0x1d0a('0x48')]);return db[_0x1d0a('0x2e')][_0x1d0a('0x49')](_0x5342f8)[_0x1d0a('0x26')](handleEntityNotFound(_0x35c4c5,null))['then'](respondWithResult(_0x35c4c5,null))[_0x1d0a('0x44')](handleError(_0x35c4c5,null));};exports['create']=function(_0x4138d8,_0x30969d){return db[_0x1d0a('0x2e')]['create'](_0x4138d8[_0x1d0a('0x4a')],{})[_0x1d0a('0x26')](respondWithResult(_0x30969d,0xc9))[_0x1d0a('0x44')](handleError(_0x30969d,null));};exports[_0x1d0a('0x4b')]=function(_0x468ae2,_0xda2160){if(_0x468ae2[_0x1d0a('0x4a')]['id']){delete _0x468ae2[_0x1d0a('0x4a')]['id'];}return db[_0x1d0a('0x2e')]['find']({'where':{'id':_0x468ae2[_0x1d0a('0x4c')]['id']}})[_0x1d0a('0x26')](handleEntityNotFound(_0xda2160,null))[_0x1d0a('0x26')](saveUpdates(_0x468ae2[_0x1d0a('0x4a')],null))[_0x1d0a('0x26')](respondWithResult(_0xda2160,null))[_0x1d0a('0x44')](handleError(_0xda2160,null));};exports[_0x1d0a('0x27')]=function(_0x55d2a3,_0x195608){return db[_0x1d0a('0x2e')][_0x1d0a('0x49')]({'where':{'id':_0x55d2a3[_0x1d0a('0x4c')]['id']}})[_0x1d0a('0x26')](handleEntityNotFound(_0x195608,null))[_0x1d0a('0x26')](removeEntity(_0x195608,null))['catch'](handleError(_0x195608,null));};exports['getConfigurations']=function(_0x102ee1,_0x42b26a,_0x19646b){var _0x181b89={};var _0x3f38c3={};var _0x270cc2;var _0x53413f;return db[_0x1d0a('0x2e')][_0x1d0a('0x4d')]({'where':{'id':_0x102ee1[_0x1d0a('0x4c')]['id']}})[_0x1d0a('0x26')](handleEntityNotFound(_0x42b26a,null))['then'](function(_0x1e1699){if(_0x1e1699){_0x270cc2=_0x1e1699;_0x3f38c3[_0x1d0a('0x35')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x3f38c3['query']=_[_0x1d0a('0x33')](_0x102ee1['query']);_0x3f38c3['filters']=_[_0x1d0a('0x46')](_0x3f38c3[_0x1d0a('0x35')],_0x3f38c3[_0x1d0a('0x38')]);_0x181b89['attributes']=_[_0x1d0a('0x46')](_0x3f38c3[_0x1d0a('0x35')],qs[_0x1d0a('0x37')](_0x102ee1[_0x1d0a('0x38')][_0x1d0a('0x37')]));_0x181b89[_0x1d0a('0x36')]=_0x181b89[_0x1d0a('0x36')]['length']?_0x181b89[_0x1d0a('0x36')]:_0x3f38c3[_0x1d0a('0x35')];_0x181b89['order']=qs['sort'](_0x102ee1['query']['sort']);_0x181b89[_0x1d0a('0x3f')]=qs[_0x1d0a('0x34')](_[_0x1d0a('0x3d')](_0x102ee1[_0x1d0a('0x38')],_0x3f38c3[_0x1d0a('0x34')]));if(_0x102ee1[_0x1d0a('0x38')][_0x1d0a('0x3e')]){_0x181b89['where']=_[_0x1d0a('0x40')](_0x181b89['where'],{'$or':_[_0x1d0a('0x2d')](_0x181b89[_0x1d0a('0x36')],function(_0x5d4750){var _0x18d5f3={};_0x18d5f3[_0x5d4750]={'$like':'%'+_0x102ee1['query'][_0x1d0a('0x3e')]+'%'};return _0x18d5f3;})});}_0x181b89=_[_0x1d0a('0x40')]({},_0x181b89,_0x102ee1[_0x1d0a('0x48')]);return _0x270cc2[_0x1d0a('0x4e')](_0x181b89);}})[_0x1d0a('0x26')](function(_0x49d79d){if(_0x49d79d){_0x53413f=_0x49d79d[_0x1d0a('0x39')];if(!_0x102ee1[_0x1d0a('0x38')][_0x1d0a('0x3a')]('nolimit')){_0x181b89['limit']=qs['limit'](_0x102ee1[_0x1d0a('0x38')][_0x1d0a('0x20')]);_0x181b89['offset']=qs['offset'](_0x102ee1[_0x1d0a('0x38')][_0x1d0a('0x1e')]);}return _0x270cc2['getConfigurations'](_0x181b89);}})[_0x1d0a('0x26')](function(_0x1068a2){if(_0x1068a2){return _0x1068a2?{'count':_0x53413f,'rows':_0x1068a2}:null;}})[_0x1d0a('0x26')](respondWithResult(_0x42b26a,null))['catch'](handleError(_0x42b26a,null));};exports[_0x1d0a('0x4f')]=function(_0x316d53,_0x51802a,_0x11f82b){if(_0x316d53[_0x1d0a('0x4a')]['id']){delete _0x316d53['body']['id'];}return db[_0x1d0a('0x2e')][_0x1d0a('0x4d')]({'where':{'id':_0x316d53[_0x1d0a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51802a,null))[_0x1d0a('0x26')](function(_0x3d7569){if(_0x3d7569){_0x316d53['body'][_0x1d0a('0x50')]=_0x3d7569['id'];_0x316d53[_0x1d0a('0x4a')][_0x1d0a('0x51')]=integrations[_0x1d0a('0x52')](_0x316d53[_0x1d0a('0x4a')][_0x1d0a('0x53')],_0x316d53[_0x1d0a('0x4a')][_0x1d0a('0x31')]);_0x316d53[_0x1d0a('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x316d53[_0x1d0a('0x4a')][_0x1d0a('0x53')],_0x316d53[_0x1d0a('0x4a')][_0x1d0a('0x31')]);return db['VtigerConfiguration']['create'](_0x316d53[_0x1d0a('0x4a')],{'include':[{'model':db[_0x1d0a('0x54')],'as':_0x1d0a('0x51')},{'model':db['VtigerField'],'as':_0x1d0a('0x55')}]});}return null;})['then'](respondWithResult(_0x51802a,null))['catch'](handleError(_0x51802a,null));};var md5=require(_0x1d0a('0x56'));exports[_0x1d0a('0x57')]=function(_0x173760,_0x33cfec,_0x34e71b){var _0x402b69=null;var _0x3a30cc=null;var _0x4d8d45=null;var _0x17319d=null;var _0x3379a8='';return db[_0x1d0a('0x2e')][_0x1d0a('0x4d')]({'where':{'id':_0x173760[_0x1d0a('0x4c')]['id']},'attributes':['id',_0x1d0a('0x2a'),'username',_0x1d0a('0x58'),_0x1d0a('0x59'),_0x1d0a('0x5a'),_0x1d0a('0x5b'),'accessKey']})['then'](handleEntityNotFound(_0x33cfec,null))[_0x1d0a('0x26')](function(_0x2d02cf){if(_0x2d02cf){_0x402b69=_0x2d02cf[_0x1d0a('0x5c')];_0x3a30cc=_0x2d02cf[_0x1d0a('0x5d')];_0x4d8d45=_0x2d02cf[_0x1d0a('0x59')];_0x3379a8=_0x2d02cf[_0x1d0a('0x5a')];var _0x2e42fc=_0x3379a8['slice'](-0x1);if(_0x2e42fc==='/'){_0x3379a8=_0x3379a8['substring'](0x0,_0x3379a8['lastIndexOf'](_0x2e42fc));}_0x17319d=util['format'](_0x1d0a('0x5e'),_0x3379a8);var _0x474f11={'method':'GET','uri':_0x17319d,'qs':{'operation':'getchallenge','username':_0x2d02cf[_0x1d0a('0x5c')]},'json':!![]};return rp(_0x474f11);}})[_0x1d0a('0x26')](function(_0x37b73e){if(_0x37b73e[_0x1d0a('0x5f')]){var _0xbbf5e9={'method':'POST','uri':_0x17319d,'form':{'operation':_0x1d0a('0x60'),'username':_0x402b69,'accessKey':md5(_0x37b73e['result'][_0x1d0a('0x61')]+_0x3a30cc)},'json':!![]};return rp(_0xbbf5e9);}})[_0x1d0a('0x26')](function(_0x1aa44f){if(_0x1aa44f[_0x1d0a('0x5f')]){var _0x194e9a={'method':_0x1d0a('0x62'),'uri':_0x17319d,'qs':{'operation':_0x1d0a('0x63'),'username':_0x402b69,'sessionName':_0x1aa44f['result'][_0x1d0a('0x64')],'elementType':_0x4d8d45},'json':!![]};return rp(_0x194e9a);}})[_0x1d0a('0x26')](function(_0x2cd7b9){if(_0x2cd7b9[_0x1d0a('0x5f')]){var _0x4cbc0b=[_0x1d0a('0x65'),_0x1d0a('0x66'),_0x1d0a('0x67')];_['remove'](_0x2cd7b9[_0x1d0a('0x68')][_0x1d0a('0x37')],function(_0x24f5d5){return _0x4cbc0b['includes'](_0x24f5d5[_0x1d0a('0x31')][_0x1d0a('0x2a')]);});_[_0x1d0a('0x69')](_0x2cd7b9['result'][_0x1d0a('0x37')],function(_0x3e871c){return _0x3e871c['editable']==='false';});return{'count':_0x2cd7b9['result'][_0x1d0a('0x37')]['length'],'rows':_[_0x1d0a('0x2d')](_0x2cd7b9['result'][_0x1d0a('0x37')],function(_0x59dfee){return{'id':_0x59dfee[_0x1d0a('0x2a')],'name':_0x59dfee[_0x1d0a('0x6a')],'custom':_[_0x1d0a('0x6b')](_0x59dfee[_0x1d0a('0x2a')],_0x1d0a('0x6c'))?!![]:![],'options':_0x59dfee[_0x1d0a('0x31')][_0x1d0a('0x2a')]===_0x1d0a('0x6d')&&_0x59dfee[_0x1d0a('0x31')]['picklistValues'][_0x1d0a('0x39')]>0x0?_[_0x1d0a('0x2d')](_0x59dfee[_0x1d0a('0x31')][_0x1d0a('0x6e')],function(_0x14aad2){return{'name':_0x14aad2[_0x1d0a('0x6a')],'value':_0x14aad2[_0x1d0a('0x6f')]};}):[]};})};}})[_0x1d0a('0x26')](respondWithResult(_0x33cfec,null))['catch'](function(_0x574b8d){console[_0x1d0a('0x70')](_0x1d0a('0x71')+_0x574b8d);var _0x55165b=_0x173760[_0x1d0a('0x38')]['test']?0x1f4:_0x574b8d[_0x1d0a('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x55165b,JSON['stringify'](_0x574b8d));delete _0x574b8d['name'];if(_0x55165b===0x191){_0x55165b=0x190;}_0x33cfec[_0x1d0a('0x1b')](_0x55165b)[_0x1d0a('0x2b')](_0x173760['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x574b8d[_0x1d0a('0x72')]}:_0x574b8d);});}; \ No newline at end of file +var _0x0458=['length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','success','POST','login','result','token','describe','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x299214,_0x2bab88){var _0x4d89c1=function(_0x34a13b){while(--_0x34a13b){_0x299214['push'](_0x299214['shift']());}};_0x4d89c1(++_0x2bab88);}(_0x0458,0x13a));var _0x8045=function(_0x5a0208,_0x3512f0){_0x5a0208=_0x5a0208-0x0;var _0x285a6e=_0x0458[_0x5a0208];return _0x285a6e;};'use strict';var emlformat=require(_0x8045('0x0'));var rimraf=require(_0x8045('0x1'));var zipdir=require(_0x8045('0x2'));var jsonpatch=require(_0x8045('0x3'));var rp=require(_0x8045('0x4'));var moment=require(_0x8045('0x5'));var BPromise=require(_0x8045('0x6'));var Mustache=require(_0x8045('0x7'));var util=require(_0x8045('0x8'));var path=require('path');var sox=require(_0x8045('0x9'));var csv=require(_0x8045('0xa'));var ejs=require(_0x8045('0xb'));var fs=require('fs');var fs_extra=require(_0x8045('0xc'));var _=require(_0x8045('0xd'));var squel=require('squel');var crypto=require(_0x8045('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8045('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8045('0x10'));var Papa=require(_0x8045('0x11'));var Redis=require(_0x8045('0x12'));var authService=require(_0x8045('0x13'));var qs=require(_0x8045('0x14'));var as=require(_0x8045('0x15'));var hardwareService=require(_0x8045('0x16'));var logger=require('../../config/logger')(_0x8045('0x17'));var utils=require(_0x8045('0x18'));var config=require(_0x8045('0x19'));var licenseUtil=require(_0x8045('0x1a'));var db=require(_0x8045('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xa272f0,_0x33a96d){_0x33a96d=_0x33a96d||0xcc;return function(_0x34b7fc){if(_0x34b7fc){return _0xa272f0[_0x8045('0x1c')](_0x33a96d);}return _0xa272f0[_0x8045('0x1d')](_0x33a96d)[_0x8045('0x1e')]();};}function respondWithResult(_0x294fdf,_0x599281){_0x599281=_0x599281||0xc8;return function(_0x1aac0d){if(_0x1aac0d){return _0x294fdf['status'](_0x599281)[_0x8045('0x1f')](_0x1aac0d);}};}function respondWithFilteredResult(_0x7e9409,_0x1a7e4e){return function(_0x2e8f5e){if(_0x2e8f5e){var _0x560f2a=typeof _0x1a7e4e[_0x8045('0x20')]===_0x8045('0x21')&&typeof _0x1a7e4e[_0x8045('0x22')]==='undefined';var _0x2d45f8=_0x2e8f5e[_0x8045('0x23')];var _0x352dcd=_0x560f2a?0x0:_0x1a7e4e[_0x8045('0x20')];var _0xcb0b51=_0x560f2a?_0x2e8f5e[_0x8045('0x23')]:_0x1a7e4e['offset']+_0x1a7e4e['limit'];var _0x359f74;if(_0xcb0b51>=_0x2d45f8){_0xcb0b51=_0x2d45f8;_0x359f74=0xc8;}else{_0x359f74=0xce;}_0x7e9409[_0x8045('0x1d')](_0x359f74);return _0x7e9409['set']('Content-Range',_0x352dcd+'-'+_0xcb0b51+'/'+_0x2d45f8)[_0x8045('0x1f')](_0x2e8f5e);}return null;};}function patchUpdates(_0x1af3d1){return function(_0x3e5e8f){try{jsonpatch[_0x8045('0x24')](_0x3e5e8f,_0x1af3d1,!![]);}catch(_0x22a422){return BPromise[_0x8045('0x25')](_0x22a422);}return _0x3e5e8f['save']();};}function saveUpdates(_0x3d56c1,_0x3cc38c){return function(_0x2d4e01){if(_0x2d4e01){return _0x2d4e01[_0x8045('0x26')](_0x3d56c1)['then'](function(_0x2f95a6){return _0x2f95a6;});}return null;};}function removeEntity(_0x46922f,_0x6af527){return function(_0x43f0d2){if(_0x43f0d2){return _0x43f0d2[_0x8045('0x27')]()[_0x8045('0x28')](function(){_0x46922f[_0x8045('0x1d')](0xcc)[_0x8045('0x1e')]();});}};}function handleEntityNotFound(_0x1e63d2,_0x3fede9){return function(_0x1bb983){if(!_0x1bb983){_0x1e63d2[_0x8045('0x1c')](0x194);}return _0x1bb983;};}function handleError(_0x4eccbb,_0x26b13a){_0x26b13a=_0x26b13a||0x1f4;return function(_0x3b7c04){logger[_0x8045('0x29')](_0x3b7c04[_0x8045('0x2a')]);if(_0x3b7c04[_0x8045('0x2b')]){delete _0x3b7c04[_0x8045('0x2b')];}_0x4eccbb['status'](_0x26b13a)[_0x8045('0x2c')](_0x3b7c04);};}exports[_0x8045('0x2d')]=function(_0x1071a8,_0x4316f0){var _0x3cbe74={},_0x4c953f={},_0x348c47={'count':0x0,'rows':[]};var _0x5d7368=_[_0x8045('0x2e')](db[_0x8045('0x2f')][_0x8045('0x30')],function(_0x178db0){return{'name':_0x178db0[_0x8045('0x31')],'type':_0x178db0[_0x8045('0x32')]['key']};});_0x4c953f[_0x8045('0x33')]=_[_0x8045('0x2e')](_0x5d7368,'name');_0x4c953f[_0x8045('0x34')]=_[_0x8045('0x35')](_0x1071a8[_0x8045('0x34')]);_0x4c953f[_0x8045('0x36')]=_[_0x8045('0x37')](_0x4c953f['model'],_0x4c953f[_0x8045('0x34')]);_0x3cbe74['attributes']=_[_0x8045('0x37')](_0x4c953f[_0x8045('0x33')],qs[_0x8045('0x38')](_0x1071a8[_0x8045('0x34')][_0x8045('0x38')]));_0x3cbe74['attributes']=_0x3cbe74[_0x8045('0x39')][_0x8045('0x3a')]?_0x3cbe74[_0x8045('0x39')]:_0x4c953f[_0x8045('0x33')];if(!_0x1071a8[_0x8045('0x34')]['hasOwnProperty'](_0x8045('0x3b'))){_0x3cbe74[_0x8045('0x22')]=qs[_0x8045('0x22')](_0x1071a8[_0x8045('0x34')][_0x8045('0x22')]);_0x3cbe74[_0x8045('0x20')]=qs[_0x8045('0x20')](_0x1071a8['query']['offset']);}_0x3cbe74[_0x8045('0x3c')]=qs[_0x8045('0x3d')](_0x1071a8[_0x8045('0x34')]['sort']);_0x3cbe74[_0x8045('0x3e')]=qs[_0x8045('0x36')](_[_0x8045('0x3f')](_0x1071a8['query'],_0x4c953f['filters']),_0x5d7368);if(_0x1071a8['query'][_0x8045('0x40')]){_0x3cbe74[_0x8045('0x3e')]=_[_0x8045('0x41')](_0x3cbe74['where'],{'$or':_['map'](_0x5d7368,function(_0x53a813){if(_0x53a813[_0x8045('0x32')]!==_0x8045('0x42')){var _0x3fc4a6={};_0x3fc4a6[_0x53a813[_0x8045('0x2b')]]={'$like':'%'+_0x1071a8[_0x8045('0x34')][_0x8045('0x40')]+'%'};return _0x3fc4a6;}})});}_0x3cbe74=_['merge']({},_0x3cbe74,_0x1071a8[_0x8045('0x43')]);var _0x433b86={'where':_0x3cbe74[_0x8045('0x3e')]};return db['VtigerAccount'][_0x8045('0x23')](_0x433b86)[_0x8045('0x28')](function(_0x3f30d2){_0x348c47[_0x8045('0x23')]=_0x3f30d2;if(_0x1071a8[_0x8045('0x34')]['includeAll']){_0x3cbe74['include']=[{'all':!![]}];}return db[_0x8045('0x2f')][_0x8045('0x44')](_0x3cbe74);})[_0x8045('0x28')](function(_0x4e30e8){_0x348c47[_0x8045('0x45')]=_0x4e30e8;return _0x348c47;})[_0x8045('0x28')](respondWithFilteredResult(_0x4316f0,_0x3cbe74))[_0x8045('0x46')](handleError(_0x4316f0,null));};exports[_0x8045('0x47')]=function(_0xe3ffc7,_0x53d8b0){var _0x19bf84={'raw':![],'where':{'id':_0xe3ffc7[_0x8045('0x48')]['id']}},_0x778aa3={};_0x778aa3[_0x8045('0x33')]=_[_0x8045('0x35')](db[_0x8045('0x2f')][_0x8045('0x30')]);_0x778aa3['query']=_['keys'](_0xe3ffc7[_0x8045('0x34')]);_0x778aa3['filters']=_[_0x8045('0x37')](_0x778aa3['model'],_0x778aa3[_0x8045('0x34')]);_0x19bf84['attributes']=_[_0x8045('0x37')](_0x778aa3[_0x8045('0x33')],qs['fields'](_0xe3ffc7[_0x8045('0x34')]['fields']));_0x19bf84[_0x8045('0x39')]=_0x19bf84['attributes'][_0x8045('0x3a')]?_0x19bf84[_0x8045('0x39')]:_0x778aa3[_0x8045('0x33')];if(_0xe3ffc7['query'][_0x8045('0x49')]){_0x19bf84['include']=[{'all':!![]}];}_0x19bf84=_[_0x8045('0x41')]({},_0x19bf84,_0xe3ffc7['options']);return db[_0x8045('0x2f')][_0x8045('0x4a')](_0x19bf84)[_0x8045('0x28')](handleEntityNotFound(_0x53d8b0,null))[_0x8045('0x28')](respondWithResult(_0x53d8b0,null))[_0x8045('0x46')](handleError(_0x53d8b0,null));};exports[_0x8045('0x4b')]=function(_0x13a8cd,_0x196f1d){return db['VtigerAccount']['create'](_0x13a8cd[_0x8045('0x4c')],{})[_0x8045('0x28')](respondWithResult(_0x196f1d,0xc9))[_0x8045('0x46')](handleError(_0x196f1d,null));};exports[_0x8045('0x26')]=function(_0x58bdbb,_0x362e5b){if(_0x58bdbb[_0x8045('0x4c')]['id']){delete _0x58bdbb[_0x8045('0x4c')]['id'];}return db[_0x8045('0x2f')][_0x8045('0x4a')]({'where':{'id':_0x58bdbb[_0x8045('0x48')]['id']}})[_0x8045('0x28')](handleEntityNotFound(_0x362e5b,null))[_0x8045('0x28')](saveUpdates(_0x58bdbb['body'],null))[_0x8045('0x28')](respondWithResult(_0x362e5b,null))[_0x8045('0x46')](handleError(_0x362e5b,null));};exports[_0x8045('0x27')]=function(_0x3dcf5c,_0x289579){return db[_0x8045('0x2f')]['find']({'where':{'id':_0x3dcf5c[_0x8045('0x48')]['id']}})[_0x8045('0x28')](handleEntityNotFound(_0x289579,null))[_0x8045('0x28')](removeEntity(_0x289579,null))[_0x8045('0x46')](handleError(_0x289579,null));};exports[_0x8045('0x4d')]=function(_0x165dc9,_0x364c63,_0x5a2b84){var _0x4ed06d={};var _0x2c7827={};var _0x14c4a5;var _0xd25ae9;return db['VtigerAccount']['findOne']({'where':{'id':_0x165dc9[_0x8045('0x48')]['id']}})[_0x8045('0x28')](handleEntityNotFound(_0x364c63,null))['then'](function(_0x298838){if(_0x298838){_0x14c4a5=_0x298838;_0x2c7827[_0x8045('0x33')]=_[_0x8045('0x35')](db[_0x8045('0x4e')][_0x8045('0x30')]);_0x2c7827[_0x8045('0x34')]=_[_0x8045('0x35')](_0x165dc9[_0x8045('0x34')]);_0x2c7827['filters']=_[_0x8045('0x37')](_0x2c7827[_0x8045('0x33')],_0x2c7827[_0x8045('0x34')]);_0x4ed06d[_0x8045('0x39')]=_[_0x8045('0x37')](_0x2c7827['model'],qs[_0x8045('0x38')](_0x165dc9[_0x8045('0x34')][_0x8045('0x38')]));_0x4ed06d[_0x8045('0x39')]=_0x4ed06d[_0x8045('0x39')][_0x8045('0x3a')]?_0x4ed06d['attributes']:_0x2c7827[_0x8045('0x33')];_0x4ed06d[_0x8045('0x3c')]=qs[_0x8045('0x3d')](_0x165dc9[_0x8045('0x34')][_0x8045('0x3d')]);_0x4ed06d[_0x8045('0x3e')]=qs[_0x8045('0x36')](_[_0x8045('0x3f')](_0x165dc9[_0x8045('0x34')],_0x2c7827[_0x8045('0x36')]));if(_0x165dc9[_0x8045('0x34')][_0x8045('0x40')]){_0x4ed06d[_0x8045('0x3e')]=_[_0x8045('0x41')](_0x4ed06d[_0x8045('0x3e')],{'$or':_[_0x8045('0x2e')](_0x4ed06d[_0x8045('0x39')],function(_0x25a576){var _0x192f1d={};_0x192f1d[_0x25a576]={'$like':'%'+_0x165dc9[_0x8045('0x34')][_0x8045('0x40')]+'%'};return _0x192f1d;})});}_0x4ed06d=_[_0x8045('0x41')]({},_0x4ed06d,_0x165dc9[_0x8045('0x43')]);return _0x14c4a5[_0x8045('0x4d')](_0x4ed06d);}})['then'](function(_0x3a4c36){if(_0x3a4c36){_0xd25ae9=_0x3a4c36[_0x8045('0x3a')];if(!_0x165dc9['query'][_0x8045('0x4f')](_0x8045('0x3b'))){_0x4ed06d['limit']=qs[_0x8045('0x22')](_0x165dc9[_0x8045('0x34')][_0x8045('0x22')]);_0x4ed06d[_0x8045('0x20')]=qs[_0x8045('0x20')](_0x165dc9[_0x8045('0x34')][_0x8045('0x20')]);}return _0x14c4a5[_0x8045('0x4d')](_0x4ed06d);}})['then'](function(_0x232fc1){if(_0x232fc1){return _0x232fc1?{'count':_0xd25ae9,'rows':_0x232fc1}:null;}})['then'](respondWithResult(_0x364c63,null))[_0x8045('0x46')](handleError(_0x364c63,null));};exports[_0x8045('0x50')]=function(_0x4ae67c,_0xa14a37,_0x44227b){if(_0x4ae67c[_0x8045('0x4c')]['id']){delete _0x4ae67c[_0x8045('0x4c')]['id'];}return db['VtigerAccount'][_0x8045('0x51')]({'where':{'id':_0x4ae67c['params']['id']}})[_0x8045('0x28')](handleEntityNotFound(_0xa14a37,null))[_0x8045('0x28')](function(_0x4d2f6e){if(_0x4d2f6e){_0x4ae67c['body'][_0x8045('0x52')]=_0x4d2f6e['id'];_0x4ae67c['body'][_0x8045('0x53')]=integrations['getSubjects'](_0x4ae67c[_0x8045('0x4c')][_0x8045('0x54')],_0x4ae67c[_0x8045('0x4c')][_0x8045('0x32')]);_0x4ae67c[_0x8045('0x4c')][_0x8045('0x55')]=integrations[_0x8045('0x56')](_0x4ae67c[_0x8045('0x4c')][_0x8045('0x54')],_0x4ae67c[_0x8045('0x4c')][_0x8045('0x32')]);return db[_0x8045('0x4e')][_0x8045('0x4b')](_0x4ae67c[_0x8045('0x4c')],{'include':[{'model':db[_0x8045('0x57')],'as':'Subjects'},{'model':db[_0x8045('0x57')],'as':_0x8045('0x55')}]});}return null;})[_0x8045('0x28')](respondWithResult(_0xa14a37,null))[_0x8045('0x46')](handleError(_0xa14a37,null));};var md5=require(_0x8045('0x58'));exports[_0x8045('0x59')]=function(_0x2baf69,_0x2cacba,_0x4dd485){var _0xdb810b=null;var _0x2d07b1=null;var _0x441b4f=null;var _0x5412c3=null;var _0x85567f='';return db[_0x8045('0x2f')][_0x8045('0x51')]({'where':{'id':_0x2baf69[_0x8045('0x48')]['id']},'attributes':['id',_0x8045('0x2b'),_0x8045('0x5a'),_0x8045('0x5b'),_0x8045('0x5c'),_0x8045('0x5d'),'serverUrl',_0x8045('0x5e')]})[_0x8045('0x28')](handleEntityNotFound(_0x2cacba,null))[_0x8045('0x28')](function(_0x509ca0){if(_0x509ca0){_0xdb810b=_0x509ca0[_0x8045('0x5a')];_0x2d07b1=_0x509ca0['accessKey'];_0x441b4f=_0x509ca0['moduleName'];_0x85567f=_0x509ca0[_0x8045('0x5d')];var _0x318f99=_0x85567f[_0x8045('0x5f')](-0x1);if(_0x318f99==='/'){_0x85567f=_0x85567f[_0x8045('0x60')](0x0,_0x85567f[_0x8045('0x61')](_0x318f99));}_0x5412c3=util[_0x8045('0x62')]('%s/webservice.php',_0x85567f);var _0x377ad3={'method':'GET','uri':_0x5412c3,'qs':{'operation':'getchallenge','username':_0x509ca0[_0x8045('0x5a')]},'json':!![]};return rp(_0x377ad3);}})[_0x8045('0x28')](function(_0x7a591d){if(_0x7a591d[_0x8045('0x63')]){var _0xbdd1f7={'method':_0x8045('0x64'),'uri':_0x5412c3,'form':{'operation':_0x8045('0x65'),'username':_0xdb810b,'accessKey':md5(_0x7a591d[_0x8045('0x66')][_0x8045('0x67')]+_0x2d07b1)},'json':!![]};return rp(_0xbdd1f7);}})[_0x8045('0x28')](function(_0xd3b144){if(_0xd3b144['success']){var _0x2e1846={'method':'GET','uri':_0x5412c3,'qs':{'operation':_0x8045('0x68'),'username':_0xdb810b,'sessionName':_0xd3b144[_0x8045('0x66')][_0x8045('0x69')],'elementType':_0x441b4f},'json':!![]};return rp(_0x2e1846);}})[_0x8045('0x28')](function(_0x498395){if(_0x498395[_0x8045('0x63')]){var _0x279f0a=['autogenerated',_0x8045('0x6a'),_0x8045('0x6b')];_[_0x8045('0x6c')](_0x498395[_0x8045('0x66')][_0x8045('0x38')],function(_0x2e0294){return _0x279f0a[_0x8045('0x6d')](_0x2e0294['type']['name']);});_[_0x8045('0x6c')](_0x498395[_0x8045('0x66')][_0x8045('0x38')],function(_0xd6056a){return _0xd6056a[_0x8045('0x6e')]===_0x8045('0x6f');});return{'count':_0x498395[_0x8045('0x66')]['fields'][_0x8045('0x3a')],'rows':_['map'](_0x498395[_0x8045('0x66')][_0x8045('0x38')],function(_0x1c1f01){return{'id':_0x1c1f01[_0x8045('0x2b')],'name':_0x1c1f01[_0x8045('0x70')],'custom':_[_0x8045('0x71')](_0x1c1f01['name'],_0x8045('0x72'))?!![]:![],'options':_0x1c1f01[_0x8045('0x32')][_0x8045('0x2b')]===_0x8045('0x73')&&_0x1c1f01[_0x8045('0x32')][_0x8045('0x74')][_0x8045('0x3a')]>0x0?_[_0x8045('0x2e')](_0x1c1f01[_0x8045('0x32')]['picklistValues'],function(_0x1eef1e){return{'name':_0x1eef1e[_0x8045('0x70')],'value':_0x1eef1e[_0x8045('0x75')]};}):[]};})};}})[_0x8045('0x28')](respondWithResult(_0x2cacba,null))[_0x8045('0x46')](function(_0x4088ef){console[_0x8045('0x76')](_0x8045('0x77')+_0x4088ef);var _0xb8adf2=_0x2baf69[_0x8045('0x34')]['test']?0x1f4:_0x4088ef['statusCode']||0x1f4;logger['error'](_0x8045('0x78'),'getFields',_0xb8adf2,JSON[_0x8045('0x79')](_0x4088ef));delete _0x4088ef[_0x8045('0x2b')];if(_0xb8adf2===0x191){_0xb8adf2=0x190;}_0x2cacba[_0x8045('0x1d')](_0xb8adf2)[_0x8045('0x2c')](_0x2baf69['query'][_0x8045('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x4088ef[_0x8045('0x7b')]}:_0x4088ef);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 046ffc5..91ebe1c 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 _0xad3c=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad3c,0x1ee));var _0xcad3=function(_0x117b9e,_0x5aea28){_0x117b9e=_0x117b9e-0x0;var _0x191ae9=_0xad3c[_0x117b9e];return _0x191ae9;};'use strict';var _=require(_0xcad3('0x0'));var util=require(_0xcad3('0x1'));var logger=require(_0xcad3('0x2'))('api');var moment=require(_0xcad3('0x3'));var BPromise=require(_0xcad3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcad3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xcad3('0x6'));module[_0xcad3('0x7')]=function(_0x181dbc,_0x3e6752){return _0x181dbc[_0xcad3('0x8')]('VtigerAccount',attributes,{'tableName':_0xcad3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd22=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xbd22,0xf7));var _0x2bd2=function(_0x56bb23,_0x1d5b23){_0x56bb23=_0x56bb23-0x0;var _0x34e77f=_0xbd22[_0x56bb23];return _0x34e77f;};'use strict';var _=require(_0x2bd2('0x0'));var util=require(_0x2bd2('0x1'));var logger=require(_0x2bd2('0x2'))(_0x2bd2('0x3'));var moment=require(_0x2bd2('0x4'));var BPromise=require(_0x2bd2('0x5'));var rp=require(_0x2bd2('0x6'));var fs=require('fs');var path=require(_0x2bd2('0x7'));var rimraf=require(_0x2bd2('0x8'));var config=require(_0x2bd2('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2bd2('0xa'));module[_0x2bd2('0xb')]=function(_0x2f3872,_0x4bff6d){return _0x2f3872[_0x2bd2('0xc')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','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 7776f03..0e02033 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 _0x9354=['catch','GetVtigerAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowVtigerAccount','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x11a496,_0x357350){var _0x2682be=function(_0x3541ab){while(--_0x3541ab){_0x11a496['push'](_0x11a496['shift']());}};_0x2682be(++_0x357350);}(_0x9354,0x96));var _0x4935=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x9354[_0x451735];return _0x41d1e2;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['VtigerAccount'][_0x4935('0x16')]({'raw':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x18')]||null:null,'attributes':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x19')]||null:null,'limit':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x1a')]||null:null,'include':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')],function(_0x53530f){return{'model':db[_0x53530f['model']],'as':_0x53530f['as'],'attributes':_0x53530f[_0x4935('0x19')],'include':_0x53530f[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x53530f[_0x4935('0x1b')],function(_0x344e51){return{'model':db[_0x344e51[_0x4935('0x1d')]],'as':_0x344e51['as'],'attributes':_0x344e51[_0x4935('0x19')],'include':_0x344e51[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x344e51[_0x4935('0x1b')],function(_0x1d08b5){return{'model':db[_0x1d08b5[_0x4935('0x1d')]],'as':_0x1d08b5['as'],'attributes':_0x1d08b5[_0x4935('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x359522){logger['info']('GetVtigerAccount',_0x429ef3);logger['debug'](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1f')](_0x359522));_0xd70eff(_0x359522);})['catch'](function(_0x3f0707){logger[_0x4935('0x11')](_0x4935('0x15'),_0x3f0707[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x3f0707[_0x4935('0x12')]));});});};exports[_0x4935('0x20')]=function(_0x2fe6da){var _0x5b3c8e=this;return new Promise(function(_0xb7fe2a,_0x2dcb0b){return db['VtigerAccount']['find']({'raw':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da['options'][_0x4935('0x21')]===undefined?!![]:![]:!![],'where':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da[_0x4935('0x17')]['where']||null:null,'attributes':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x19')]||null:null,'include':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')],function(_0x4a69bc){return{'model':db[_0x4a69bc['model']],'as':_0x4a69bc['as'],'attributes':_0x4a69bc[_0x4935('0x19')],'include':_0x4a69bc[_0x4935('0x1b')]?_['map'](_0x4a69bc['include'],function(_0xb3d934){return{'model':db[_0xb3d934['model']],'as':_0xb3d934['as'],'attributes':_0xb3d934[_0x4935('0x19')],'include':_0xb3d934[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0xb3d934[_0x4935('0x1b')],function(_0x1d77b8){return{'model':db[_0x1d77b8[_0x4935('0x1d')]],'as':_0x1d77b8['as'],'attributes':_0x1d77b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x51b7ac){logger[_0x4935('0xc')]('ShowVtigerAccount',_0x2fe6da);logger[_0x4935('0xf')]('ShowVtigerAccount',_0x2fe6da,JSON[_0x4935('0x1f')](_0x51b7ac));_0xb7fe2a(_0x51b7ac);})[_0x4935('0x14')](function(_0x352679){logger[_0x4935('0x11')](_0x4935('0x20'),_0x352679[_0x4935('0x12')],_0x2fe6da);_0x2dcb0b(_0x5b3c8e[_0x4935('0x11')](0x1f4,_0x352679['message']));});});}; \ No newline at end of file +var _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x326cc8,_0x58d7d0){var _0x4dac8d=function(_0x56563f){while(--_0x56563f){_0x326cc8['push'](_0x326cc8['shift']());}};_0x4dac8d(++_0x58d7d0);}(_0x6c76,0x184));var _0x66c7=function(_0x353f0e,_0x51adf3){_0x353f0e=_0x353f0e-0x0;var _0x1f0654=_0x6c76[_0x353f0e];return _0x1f0654;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 356162e..6f78447 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 _0x53d0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x53d0,0x120));var _0x053d=function(_0xcd647d,_0x4bad56){_0xcd647d=_0xcd647d-0x0;var _0x22206d=_0x53d0[_0xcd647d];return _0x22206d;};'use strict';var multer=require('multer');var util=require(_0x053d('0x0'));var path=require(_0x053d('0x1'));var timeout=require(_0x053d('0x2'));var express=require(_0x053d('0x3'));var router=express[_0x053d('0x4')]();var fs_extra=require(_0x053d('0x5'));var auth=require(_0x053d('0x6'));var interaction=require(_0x053d('0x7'));var config=require(_0x053d('0x8'));var controller=require(_0x053d('0x9'));router[_0x053d('0xa')]('/',auth[_0x053d('0xb')](),controller[_0x053d('0xc')]);router[_0x053d('0xa')]('/:id',auth[_0x053d('0xb')](),controller[_0x053d('0xd')]);router['get'](_0x053d('0xe'),auth[_0x053d('0xb')](),controller[_0x053d('0xf')]);router[_0x053d('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x053d('0xa')](_0x053d('0x10'),auth[_0x053d('0xb')](),controller[_0x053d('0x11')]);router[_0x053d('0x12')]('/',auth[_0x053d('0xb')](),controller[_0x053d('0x13')]);router[_0x053d('0x14')](_0x053d('0x15'),auth[_0x053d('0xb')](),controller[_0x053d('0x16')]);router['delete'](_0x053d('0x15'),auth['isAuthenticated'](),controller[_0x053d('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7360=['create','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7360,0xd4));var _0x0736=function(_0x1f050a,_0x2cbd15){_0x1f050a=_0x1f050a-0x0;var _0x4d459b=_0x7360[_0x1f050a];return _0x4d459b;};'use strict';var multer=require('multer');var util=require(_0x0736('0x0'));var path=require(_0x0736('0x1'));var timeout=require(_0x0736('0x2'));var express=require(_0x0736('0x3'));var router=express[_0x0736('0x4')]();var fs_extra=require(_0x0736('0x5'));var auth=require(_0x0736('0x6'));var interaction=require(_0x0736('0x7'));var config=require(_0x0736('0x8'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x0736('0x9')](),controller[_0x0736('0xa')]);router[_0x0736('0xb')](_0x0736('0xc'),auth['isAuthenticated'](),controller[_0x0736('0xd')]);router[_0x0736('0xb')]('/:id/fields',auth[_0x0736('0x9')](),controller[_0x0736('0xe')]);router['get'](_0x0736('0xf'),auth[_0x0736('0x9')](),controller[_0x0736('0x10')]);router[_0x0736('0xb')](_0x0736('0x11'),auth[_0x0736('0x9')](),controller['getDescriptions']);router[_0x0736('0x12')]('/',auth[_0x0736('0x9')](),controller[_0x0736('0x13')]);router['put'](_0x0736('0xc'),auth[_0x0736('0x9')](),controller[_0x0736('0x14')]);router['delete'](_0x0736('0xc'),auth[_0x0736('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index b4f9608..d9f36a3 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 _0xfe33=['sequelize','exports','STRING'];(function(_0x1c25d8,_0x16d972){var _0x537518=function(_0x52982f){while(--_0x52982f){_0x1c25d8['push'](_0x1c25d8['shift']());}};_0x537518(++_0x16d972);}(_0xfe33,0x96));var _0x3fe3=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0xfe33[_0x1726e1];return _0x44eccc;};'use strict';var Sequelize=require(_0x3fe3('0x0'));module[_0x3fe3('0x1')]={'name':{'type':Sequelize[_0x3fe3('0x2')]},'description':{'type':Sequelize[_0x3fe3('0x2')]}}; \ No newline at end of file +var _0x61da=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61da,0xa7));var _0xa61d=function(_0x5b1567,_0x33a4f4){_0x5b1567=_0x5b1567-0x0;var _0xfe7b4d=_0x61da[_0x5b1567];return _0xfe7b4d;};'use strict';var Sequelize=require('sequelize');module[_0xa61d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa61d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 5aa7cc7..32bc720 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 _0x252f=['apply','reject','save','update','then','end','error','stack','name','send','index','fieldName','type','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','VtigerConfiguration','rawAttributes','fields','find','create','body','destroy','findOne','getSubjects','VtigerField','hasOwnProperty','getDescriptions','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x1851ce,_0x241ade){var _0x4020ed=function(_0x74427d){while(--_0x74427d){_0x1851ce['push'](_0x1851ce['shift']());}};_0x4020ed(++_0x241ade);}(_0x252f,0xd0));var _0xf252=function(_0x125397,_0x3337db){_0x125397=_0x125397-0x0;var _0x1e503b=_0x252f[_0x125397];return _0x1e503b;};'use strict';var emlformat=require(_0xf252('0x0'));var rimraf=require(_0xf252('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf252('0x2'));var moment=require(_0xf252('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf252('0x4'));var path=require(_0xf252('0x5'));var sox=require(_0xf252('0x6'));var csv=require(_0xf252('0x7'));var ejs=require(_0xf252('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf252('0x9'));var squel=require(_0xf252('0xa'));var crypto=require(_0xf252('0xb'));var jsforce=require(_0xf252('0xc'));var deskjs=require(_0xf252('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf252('0xe'));var Papa=require(_0xf252('0xf'));var Redis=require('ioredis');var authService=require(_0xf252('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf252('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf252('0x12'))(_0xf252('0x13'));var utils=require(_0xf252('0x14'));var config=require(_0xf252('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf252('0x16'))['db'];function respondWithStatusCode(_0xf54ee9,_0x2fc7d3){_0x2fc7d3=_0x2fc7d3||0xcc;return function(_0x10d4e1){if(_0x10d4e1){return _0xf54ee9[_0xf252('0x17')](_0x2fc7d3);}return _0xf54ee9[_0xf252('0x18')](_0x2fc7d3)['end']();};}function respondWithResult(_0x36da86,_0x18fa76){_0x18fa76=_0x18fa76||0xc8;return function(_0xbdb67a){if(_0xbdb67a){return _0x36da86['status'](_0x18fa76)[_0xf252('0x19')](_0xbdb67a);}};}function respondWithFilteredResult(_0xf7285f,_0x33c420){return function(_0x25affc){if(_0x25affc){var _0x486254=typeof _0x33c420[_0xf252('0x1a')]==='undefined'&&typeof _0x33c420[_0xf252('0x1b')]===_0xf252('0x1c');var _0x331bd6=_0x25affc['count'];var _0x4f6bd5=_0x486254?0x0:_0x33c420[_0xf252('0x1a')];var _0x34ce46=_0x486254?_0x25affc[_0xf252('0x1d')]:_0x33c420['offset']+_0x33c420[_0xf252('0x1b')];var _0x4f063c;if(_0x34ce46>=_0x331bd6){_0x34ce46=_0x331bd6;_0x4f063c=0xc8;}else{_0x4f063c=0xce;}_0xf7285f['status'](_0x4f063c);return _0xf7285f[_0xf252('0x1e')](_0xf252('0x1f'),_0x4f6bd5+'-'+_0x34ce46+'/'+_0x331bd6)[_0xf252('0x19')](_0x25affc);}return null;};}function patchUpdates(_0x2ab64c){return function(_0x4c86fb){try{jsonpatch[_0xf252('0x20')](_0x4c86fb,_0x2ab64c,!![]);}catch(_0x43a9f0){return BPromise[_0xf252('0x21')](_0x43a9f0);}return _0x4c86fb[_0xf252('0x22')]();};}function saveUpdates(_0x574614,_0x579022){return function(_0x12d287){if(_0x12d287){return _0x12d287[_0xf252('0x23')](_0x574614)[_0xf252('0x24')](function(_0x524683){return _0x524683;});}return null;};}function removeEntity(_0x18c14d,_0x2ba040){return function(_0x284dca){if(_0x284dca){return _0x284dca['destroy']()[_0xf252('0x24')](function(){_0x18c14d[_0xf252('0x18')](0xcc)[_0xf252('0x25')]();});}};}function handleEntityNotFound(_0x36f8a5,_0x74ad3c){return function(_0x165ff4){if(!_0x165ff4){_0x36f8a5['sendStatus'](0x194);}return _0x165ff4;};}function handleError(_0x4dd530,_0xdd0977){_0xdd0977=_0xdd0977||0x1f4;return function(_0x2c6073){logger[_0xf252('0x26')](_0x2c6073[_0xf252('0x27')]);if(_0x2c6073[_0xf252('0x28')]){delete _0x2c6073[_0xf252('0x28')];}_0x4dd530[_0xf252('0x18')](_0xdd0977)[_0xf252('0x29')](_0x2c6073);};}exports[_0xf252('0x2a')]=function(_0x4bc687,_0x234af2){var _0x5aedad={},_0x534c98={},_0x418fc5={'count':0x0,'rows':[]};var _0x311f51=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0x3b1f6d){return{'name':_0x3b1f6d[_0xf252('0x2b')],'type':_0x3b1f6d[_0xf252('0x2c')]['key']};});_0x534c98[_0xf252('0x2d')]=_['map'](_0x311f51,_0xf252('0x28'));_0x534c98['query']=_[_0xf252('0x2e')](_0x4bc687[_0xf252('0x2f')]);_0x534c98[_0xf252('0x30')]=_[_0xf252('0x31')](_0x534c98[_0xf252('0x2d')],_0x534c98[_0xf252('0x2f')]);_0x5aedad[_0xf252('0x32')]=_[_0xf252('0x31')](_0x534c98[_0xf252('0x2d')],qs['fields'](_0x4bc687[_0xf252('0x2f')]['fields']));_0x5aedad['attributes']=_0x5aedad[_0xf252('0x32')][_0xf252('0x33')]?_0x5aedad[_0xf252('0x32')]:_0x534c98[_0xf252('0x2d')];if(!_0x4bc687['query']['hasOwnProperty'](_0xf252('0x34'))){_0x5aedad[_0xf252('0x1b')]=qs[_0xf252('0x1b')](_0x4bc687[_0xf252('0x2f')][_0xf252('0x1b')]);_0x5aedad[_0xf252('0x1a')]=qs['offset'](_0x4bc687[_0xf252('0x2f')]['offset']);}_0x5aedad[_0xf252('0x35')]=qs['sort'](_0x4bc687[_0xf252('0x2f')][_0xf252('0x36')]);_0x5aedad[_0xf252('0x37')]=qs[_0xf252('0x30')](_[_0xf252('0x38')](_0x4bc687['query'],_0x534c98[_0xf252('0x30')]),_0x311f51);if(_0x4bc687[_0xf252('0x2f')][_0xf252('0x39')]){_0x5aedad[_0xf252('0x37')]=_[_0xf252('0x3a')](_0x5aedad[_0xf252('0x37')],{'$or':_[_0xf252('0x3b')](_0x311f51,function(_0xf00e98){if(_0xf00e98['type']!==_0xf252('0x3c')){var _0x51ce70={};_0x51ce70[_0xf00e98[_0xf252('0x28')]]={'$like':'%'+_0x4bc687[_0xf252('0x2f')][_0xf252('0x39')]+'%'};return _0x51ce70;}})});}_0x5aedad=_[_0xf252('0x3a')]({},_0x5aedad,_0x4bc687[_0xf252('0x3d')]);var _0x2d6325={'where':_0x5aedad[_0xf252('0x37')]};return db['VtigerConfiguration'][_0xf252('0x1d')](_0x2d6325)[_0xf252('0x24')](function(_0x3ee88e){_0x418fc5['count']=_0x3ee88e;if(_0x4bc687[_0xf252('0x2f')][_0xf252('0x3e')]){_0x5aedad[_0xf252('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xf252('0x40')](_0x5aedad);})[_0xf252('0x24')](function(_0x47b13e){_0x418fc5['rows']=_0x47b13e;return _0x418fc5;})['then'](respondWithFilteredResult(_0x234af2,_0x5aedad))[_0xf252('0x41')](handleError(_0x234af2,null));};exports[_0xf252('0x42')]=function(_0x30cbee,_0x56b7c2){var _0x2252e7={'raw':![],'where':{'id':_0x30cbee[_0xf252('0x43')]['id']}},_0x574968={};_0x574968[_0xf252('0x2d')]=_[_0xf252('0x2e')](db[_0xf252('0x44')][_0xf252('0x45')]);_0x574968[_0xf252('0x2f')]=_[_0xf252('0x2e')](_0x30cbee[_0xf252('0x2f')]);_0x574968[_0xf252('0x30')]=_[_0xf252('0x31')](_0x574968[_0xf252('0x2d')],_0x574968[_0xf252('0x2f')]);_0x2252e7[_0xf252('0x32')]=_[_0xf252('0x31')](_0x574968[_0xf252('0x2d')],qs[_0xf252('0x46')](_0x30cbee['query'][_0xf252('0x46')]));_0x2252e7[_0xf252('0x32')]=_0x2252e7[_0xf252('0x32')]['length']?_0x2252e7[_0xf252('0x32')]:_0x574968[_0xf252('0x2d')];if(_0x30cbee[_0xf252('0x2f')]['includeAll']){_0x2252e7['include']=[{'all':!![]}];}_0x2252e7=_[_0xf252('0x3a')]({},_0x2252e7,_0x30cbee[_0xf252('0x3d')]);return db[_0xf252('0x44')][_0xf252('0x47')](_0x2252e7)[_0xf252('0x24')](handleEntityNotFound(_0x56b7c2,null))[_0xf252('0x24')](respondWithResult(_0x56b7c2,null))[_0xf252('0x41')](handleError(_0x56b7c2,null));};exports[_0xf252('0x48')]=function(_0xd3a513,_0x5bd1a7){return db['VtigerConfiguration']['create'](_0xd3a513[_0xf252('0x49')],{})[_0xf252('0x24')](respondWithResult(_0x5bd1a7,0xc9))['catch'](handleError(_0x5bd1a7,null));};exports[_0xf252('0x23')]=function(_0x48d8b2,_0x1f8674){if(_0x48d8b2[_0xf252('0x49')]['id']){delete _0x48d8b2['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x48d8b2[_0xf252('0x43')]['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x1f8674,null))[_0xf252('0x24')](saveUpdates(_0x48d8b2['body'],null))[_0xf252('0x24')](respondWithResult(_0x1f8674,null))[_0xf252('0x41')](handleError(_0x1f8674,null));};exports[_0xf252('0x4a')]=function(_0x5a7a72,_0x3c7190){return db['VtigerConfiguration'][_0xf252('0x47')]({'where':{'id':_0x5a7a72[_0xf252('0x43')]['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x3c7190,null))[_0xf252('0x24')](removeEntity(_0x3c7190,null))['catch'](handleError(_0x3c7190,null));};exports['getFields']=function(_0x20350b,_0x2e4f1,_0x53cc93){var _0x52be84={};var _0x222a5a={};var _0xc1d9c7;var _0xa4c618;return db[_0xf252('0x44')][_0xf252('0x4b')]({'where':{'id':_0x20350b[_0xf252('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e4f1,null))[_0xf252('0x24')](function(_0x376c86){if(_0x376c86){_0xc1d9c7=_0x376c86;_0x222a5a[_0xf252('0x2d')]=_['keys'](db['VtigerField']['rawAttributes']);_0x222a5a['query']=_[_0xf252('0x2e')](_0x20350b['query']);_0x222a5a['filters']=_[_0xf252('0x31')](_0x222a5a[_0xf252('0x2d')],_0x222a5a[_0xf252('0x2f')]);_0x52be84[_0xf252('0x32')]=_[_0xf252('0x31')](_0x222a5a['model'],qs['fields'](_0x20350b['query'][_0xf252('0x46')]));_0x52be84[_0xf252('0x32')]=_0x52be84[_0xf252('0x32')]['length']?_0x52be84[_0xf252('0x32')]:_0x222a5a[_0xf252('0x2d')];_0x52be84[_0xf252('0x35')]=qs[_0xf252('0x36')](_0x20350b['query'][_0xf252('0x36')]);_0x52be84['where']=qs[_0xf252('0x30')](_[_0xf252('0x38')](_0x20350b[_0xf252('0x2f')],_0x222a5a['filters']));if(_0x20350b[_0xf252('0x2f')][_0xf252('0x39')]){_0x52be84[_0xf252('0x37')]=_[_0xf252('0x3a')](_0x52be84[_0xf252('0x37')],{'$or':_['map'](_0x52be84['attributes'],function(_0x56a492){var _0x4339f0={};_0x4339f0[_0x56a492]={'$like':'%'+_0x20350b['query'][_0xf252('0x39')]+'%'};return _0x4339f0;})});}_0x52be84=_[_0xf252('0x3a')]({},_0x52be84,_0x20350b[_0xf252('0x3d')]);return _0xc1d9c7['getFields'](_0x52be84);}})[_0xf252('0x24')](function(_0xaa7a2d){if(_0xaa7a2d){_0xa4c618=_0xaa7a2d['length'];if(!_0x20350b[_0xf252('0x2f')]['hasOwnProperty']('nolimit')){_0x52be84[_0xf252('0x1b')]=qs[_0xf252('0x1b')](_0x20350b[_0xf252('0x2f')][_0xf252('0x1b')]);_0x52be84[_0xf252('0x1a')]=qs['offset'](_0x20350b[_0xf252('0x2f')][_0xf252('0x1a')]);}return _0xc1d9c7['getFields'](_0x52be84);}})['then'](function(_0x530937){if(_0x530937){return _0x530937?{'count':_0xa4c618,'rows':_0x530937}:null;}})[_0xf252('0x24')](respondWithResult(_0x2e4f1,null))[_0xf252('0x41')](handleError(_0x2e4f1,null));};exports[_0xf252('0x4c')]=function(_0x2e2f4,_0x1cfb27,_0x37468d){var _0x39e43e={};var _0x183fba={};var _0x4699e2;var _0x1ea6b9;return db[_0xf252('0x44')]['findOne']({'where':{'id':_0x2e2f4[_0xf252('0x43')]['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x1cfb27,null))[_0xf252('0x24')](function(_0x1b24d4){if(_0x1b24d4){_0x4699e2=_0x1b24d4;_0x183fba['model']=_[_0xf252('0x2e')](db[_0xf252('0x4d')][_0xf252('0x45')]);_0x183fba['query']=_['keys'](_0x2e2f4['query']);_0x183fba[_0xf252('0x30')]=_[_0xf252('0x31')](_0x183fba[_0xf252('0x2d')],_0x183fba[_0xf252('0x2f')]);_0x39e43e[_0xf252('0x32')]=_[_0xf252('0x31')](_0x183fba[_0xf252('0x2d')],qs[_0xf252('0x46')](_0x2e2f4[_0xf252('0x2f')]['fields']));_0x39e43e[_0xf252('0x32')]=_0x39e43e[_0xf252('0x32')]['length']?_0x39e43e[_0xf252('0x32')]:_0x183fba['model'];_0x39e43e[_0xf252('0x35')]=qs['sort'](_0x2e2f4['query'][_0xf252('0x36')]);_0x39e43e[_0xf252('0x37')]=qs[_0xf252('0x30')](_['pick'](_0x2e2f4[_0xf252('0x2f')],_0x183fba[_0xf252('0x30')]));if(_0x2e2f4['query'][_0xf252('0x39')]){_0x39e43e[_0xf252('0x37')]=_[_0xf252('0x3a')](_0x39e43e['where'],{'$or':_['map'](_0x39e43e[_0xf252('0x32')],function(_0x5eaee2){var _0x5a8b3c={};_0x5a8b3c[_0x5eaee2]={'$like':'%'+_0x2e2f4[_0xf252('0x2f')]['filter']+'%'};return _0x5a8b3c;})});}_0x39e43e=_[_0xf252('0x3a')]({},_0x39e43e,_0x2e2f4[_0xf252('0x3d')]);return _0x4699e2['getSubjects'](_0x39e43e);}})[_0xf252('0x24')](function(_0x49dedb){if(_0x49dedb){_0x1ea6b9=_0x49dedb[_0xf252('0x33')];if(!_0x2e2f4[_0xf252('0x2f')][_0xf252('0x4e')](_0xf252('0x34'))){_0x39e43e[_0xf252('0x1b')]=qs[_0xf252('0x1b')](_0x2e2f4['query'][_0xf252('0x1b')]);_0x39e43e[_0xf252('0x1a')]=qs[_0xf252('0x1a')](_0x2e2f4['query'][_0xf252('0x1a')]);}return _0x4699e2[_0xf252('0x4c')](_0x39e43e);}})[_0xf252('0x24')](function(_0xc94a15){if(_0xc94a15){return _0xc94a15?{'count':_0x1ea6b9,'rows':_0xc94a15}:null;}})['then'](respondWithResult(_0x1cfb27,null))[_0xf252('0x41')](handleError(_0x1cfb27,null));};exports['getDescriptions']=function(_0x429edd,_0x59f497,_0x4337b3){var _0x535fb5={};var _0x43c415={};var _0x5e60cb;var _0x47614a;return db[_0xf252('0x44')][_0xf252('0x4b')]({'where':{'id':_0x429edd['params']['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x59f497,null))[_0xf252('0x24')](function(_0x5e49de){if(_0x5e49de){_0x5e60cb=_0x5e49de;_0x43c415[_0xf252('0x2d')]=_[_0xf252('0x2e')](db[_0xf252('0x4d')][_0xf252('0x45')]);_0x43c415[_0xf252('0x2f')]=_['keys'](_0x429edd[_0xf252('0x2f')]);_0x43c415[_0xf252('0x30')]=_['intersection'](_0x43c415[_0xf252('0x2d')],_0x43c415['query']);_0x535fb5[_0xf252('0x32')]=_[_0xf252('0x31')](_0x43c415[_0xf252('0x2d')],qs[_0xf252('0x46')](_0x429edd[_0xf252('0x2f')][_0xf252('0x46')]));_0x535fb5[_0xf252('0x32')]=_0x535fb5[_0xf252('0x32')][_0xf252('0x33')]?_0x535fb5[_0xf252('0x32')]:_0x43c415[_0xf252('0x2d')];_0x535fb5['order']=qs[_0xf252('0x36')](_0x429edd['query'][_0xf252('0x36')]);_0x535fb5[_0xf252('0x37')]=qs[_0xf252('0x30')](_['pick'](_0x429edd[_0xf252('0x2f')],_0x43c415[_0xf252('0x30')]));if(_0x429edd[_0xf252('0x2f')][_0xf252('0x39')]){_0x535fb5[_0xf252('0x37')]=_[_0xf252('0x3a')](_0x535fb5[_0xf252('0x37')],{'$or':_[_0xf252('0x3b')](_0x535fb5[_0xf252('0x32')],function(_0x14b112){var _0x3a3539={};_0x3a3539[_0x14b112]={'$like':'%'+_0x429edd['query'][_0xf252('0x39')]+'%'};return _0x3a3539;})});}_0x535fb5=_[_0xf252('0x3a')]({},_0x535fb5,_0x429edd[_0xf252('0x3d')]);return _0x5e60cb[_0xf252('0x4f')](_0x535fb5);}})['then'](function(_0xb63664){if(_0xb63664){_0x47614a=_0xb63664[_0xf252('0x33')];if(!_0x429edd[_0xf252('0x2f')]['hasOwnProperty'](_0xf252('0x34'))){_0x535fb5[_0xf252('0x1b')]=qs[_0xf252('0x1b')](_0x429edd[_0xf252('0x2f')][_0xf252('0x1b')]);_0x535fb5[_0xf252('0x1a')]=qs[_0xf252('0x1a')](_0x429edd[_0xf252('0x2f')][_0xf252('0x1a')]);}return _0x5e60cb['getDescriptions'](_0x535fb5);}})['then'](function(_0x1b22e6){if(_0x1b22e6){return _0x1b22e6?{'count':_0x47614a,'rows':_0x1b22e6}:null;}})[_0xf252('0x24')](respondWithResult(_0x59f497,null))[_0xf252('0x41')](handleError(_0x59f497,null));}; \ No newline at end of file +var _0x7689=['end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','intersection','includeAll','find','create','body','params','findOne','length','getFields','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7689,0x17e));var _0x9768=function(_0x2ae12a,_0x5e3e70){_0x2ae12a=_0x2ae12a-0x0;var _0x529cf6=_0x7689[_0x2ae12a];return _0x529cf6;};'use strict';var emlformat=require(_0x9768('0x0'));var rimraf=require(_0x9768('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9768('0x2'));var rp=require(_0x9768('0x3'));var moment=require(_0x9768('0x4'));var BPromise=require(_0x9768('0x5'));var Mustache=require(_0x9768('0x6'));var util=require('util');var path=require(_0x9768('0x7'));var sox=require(_0x9768('0x8'));var csv=require('to-csv');var ejs=require(_0x9768('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9768('0xa'));var squel=require(_0x9768('0xb'));var crypto=require(_0x9768('0xc'));var jsforce=require(_0x9768('0xd'));var deskjs=require(_0x9768('0xe'));var toCsv=require(_0x9768('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9768('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9768('0x11'));var as=require(_0x9768('0x12'));var hardwareService=require(_0x9768('0x13'));var logger=require(_0x9768('0x14'))(_0x9768('0x15'));var utils=require(_0x9768('0x16'));var config=require(_0x9768('0x17'));var licenseUtil=require(_0x9768('0x18'));var db=require(_0x9768('0x19'))['db'];function respondWithStatusCode(_0x10747d,_0x9c9449){_0x9c9449=_0x9c9449||0xcc;return function(_0x27ced5){if(_0x27ced5){return _0x10747d[_0x9768('0x1a')](_0x9c9449);}return _0x10747d[_0x9768('0x1b')](_0x9c9449)[_0x9768('0x1c')]();};}function respondWithResult(_0x396f49,_0x35701a){_0x35701a=_0x35701a||0xc8;return function(_0x12f627){if(_0x12f627){return _0x396f49[_0x9768('0x1b')](_0x35701a)['json'](_0x12f627);}};}function respondWithFilteredResult(_0x2e2ea4,_0x24e91e){return function(_0x42e756){if(_0x42e756){var _0x45ff4a=typeof _0x24e91e[_0x9768('0x1d')]===_0x9768('0x1e')&&typeof _0x24e91e[_0x9768('0x1f')]===_0x9768('0x1e');var _0x4377c=_0x42e756[_0x9768('0x20')];var _0x19c12b=_0x45ff4a?0x0:_0x24e91e[_0x9768('0x1d')];var _0x7b239c=_0x45ff4a?_0x42e756[_0x9768('0x20')]:_0x24e91e['offset']+_0x24e91e[_0x9768('0x1f')];var _0x2da50f;if(_0x7b239c>=_0x4377c){_0x7b239c=_0x4377c;_0x2da50f=0xc8;}else{_0x2da50f=0xce;}_0x2e2ea4['status'](_0x2da50f);return _0x2e2ea4[_0x9768('0x21')](_0x9768('0x22'),_0x19c12b+'-'+_0x7b239c+'/'+_0x4377c)[_0x9768('0x23')](_0x42e756);}return null;};}function patchUpdates(_0x4ae73a){return function(_0x18b3b7){try{jsonpatch['apply'](_0x18b3b7,_0x4ae73a,!![]);}catch(_0x54cf12){return BPromise[_0x9768('0x24')](_0x54cf12);}return _0x18b3b7[_0x9768('0x25')]();};}function saveUpdates(_0x47e49e,_0x198b94){return function(_0x70aa4a){if(_0x70aa4a){return _0x70aa4a[_0x9768('0x26')](_0x47e49e)[_0x9768('0x27')](function(_0x539d21){return _0x539d21;});}return null;};}function removeEntity(_0x360b94,_0x478ff7){return function(_0xcf2a21){if(_0xcf2a21){return _0xcf2a21[_0x9768('0x28')]()[_0x9768('0x27')](function(){_0x360b94[_0x9768('0x1b')](0xcc)[_0x9768('0x1c')]();});}};}function handleEntityNotFound(_0x87c6ce,_0x32d5e1){return function(_0x212e27){if(!_0x212e27){_0x87c6ce[_0x9768('0x1a')](0x194);}return _0x212e27;};}function handleError(_0x9fff8f,_0x21bf3d){_0x21bf3d=_0x21bf3d||0x1f4;return function(_0x5596ef){logger[_0x9768('0x29')](_0x5596ef['stack']);if(_0x5596ef['name']){delete _0x5596ef[_0x9768('0x2a')];}_0x9fff8f[_0x9768('0x1b')](_0x21bf3d)[_0x9768('0x2b')](_0x5596ef);};}exports[_0x9768('0x2c')]=function(_0x4f421c,_0x661437){var _0x2e1583={},_0x56961b={},_0x286d6f={'count':0x0,'rows':[]};var _0x58e3f3=_['map'](db[_0x9768('0x2d')][_0x9768('0x2e')],function(_0x402923){return{'name':_0x402923[_0x9768('0x2f')],'type':_0x402923[_0x9768('0x30')][_0x9768('0x31')]};});_0x56961b[_0x9768('0x32')]=_[_0x9768('0x33')](_0x58e3f3,_0x9768('0x2a'));_0x56961b[_0x9768('0x34')]=_[_0x9768('0x35')](_0x4f421c[_0x9768('0x34')]);_0x56961b[_0x9768('0x36')]=_['intersection'](_0x56961b[_0x9768('0x32')],_0x56961b[_0x9768('0x34')]);_0x2e1583[_0x9768('0x37')]=_['intersection'](_0x56961b[_0x9768('0x32')],qs[_0x9768('0x38')](_0x4f421c[_0x9768('0x34')][_0x9768('0x38')]));_0x2e1583['attributes']=_0x2e1583[_0x9768('0x37')]['length']?_0x2e1583['attributes']:_0x56961b[_0x9768('0x32')];if(!_0x4f421c[_0x9768('0x34')][_0x9768('0x39')](_0x9768('0x3a'))){_0x2e1583['limit']=qs['limit'](_0x4f421c[_0x9768('0x34')][_0x9768('0x1f')]);_0x2e1583[_0x9768('0x1d')]=qs['offset'](_0x4f421c[_0x9768('0x34')]['offset']);}_0x2e1583[_0x9768('0x3b')]=qs[_0x9768('0x3c')](_0x4f421c['query'][_0x9768('0x3c')]);_0x2e1583[_0x9768('0x3d')]=qs[_0x9768('0x36')](_[_0x9768('0x3e')](_0x4f421c['query'],_0x56961b['filters']),_0x58e3f3);if(_0x4f421c[_0x9768('0x34')][_0x9768('0x3f')]){_0x2e1583['where']=_[_0x9768('0x40')](_0x2e1583[_0x9768('0x3d')],{'$or':_[_0x9768('0x33')](_0x58e3f3,function(_0x29989a){if(_0x29989a['type']!=='VIRTUAL'){var _0x3237ec={};_0x3237ec[_0x29989a[_0x9768('0x2a')]]={'$like':'%'+_0x4f421c[_0x9768('0x34')][_0x9768('0x3f')]+'%'};return _0x3237ec;}})});}_0x2e1583=_[_0x9768('0x40')]({},_0x2e1583,_0x4f421c[_0x9768('0x41')]);var _0x1e0062={'where':_0x2e1583['where']};return db['VtigerConfiguration']['count'](_0x1e0062)[_0x9768('0x27')](function(_0x4321be){_0x286d6f[_0x9768('0x20')]=_0x4321be;if(_0x4f421c[_0x9768('0x34')]['includeAll']){_0x2e1583[_0x9768('0x42')]=[{'all':!![]}];}return db[_0x9768('0x2d')][_0x9768('0x43')](_0x2e1583);})[_0x9768('0x27')](function(_0x5b14c6){_0x286d6f[_0x9768('0x44')]=_0x5b14c6;return _0x286d6f;})[_0x9768('0x27')](respondWithFilteredResult(_0x661437,_0x2e1583))[_0x9768('0x45')](handleError(_0x661437,null));};exports['show']=function(_0x538546,_0x3d3b5c){var _0x238728={'raw':![],'where':{'id':_0x538546['params']['id']}},_0xc3d31e={};_0xc3d31e[_0x9768('0x32')]=_[_0x9768('0x35')](db['VtigerConfiguration']['rawAttributes']);_0xc3d31e[_0x9768('0x34')]=_['keys'](_0x538546[_0x9768('0x34')]);_0xc3d31e['filters']=_[_0x9768('0x46')](_0xc3d31e[_0x9768('0x32')],_0xc3d31e[_0x9768('0x34')]);_0x238728[_0x9768('0x37')]=_['intersection'](_0xc3d31e[_0x9768('0x32')],qs[_0x9768('0x38')](_0x538546[_0x9768('0x34')][_0x9768('0x38')]));_0x238728[_0x9768('0x37')]=_0x238728[_0x9768('0x37')]['length']?_0x238728[_0x9768('0x37')]:_0xc3d31e[_0x9768('0x32')];if(_0x538546[_0x9768('0x34')][_0x9768('0x47')]){_0x238728[_0x9768('0x42')]=[{'all':!![]}];}_0x238728=_[_0x9768('0x40')]({},_0x238728,_0x538546['options']);return db[_0x9768('0x2d')][_0x9768('0x48')](_0x238728)[_0x9768('0x27')](handleEntityNotFound(_0x3d3b5c,null))[_0x9768('0x27')](respondWithResult(_0x3d3b5c,null))[_0x9768('0x45')](handleError(_0x3d3b5c,null));};exports[_0x9768('0x49')]=function(_0x2a2efc,_0x51f888){return db[_0x9768('0x2d')]['create'](_0x2a2efc[_0x9768('0x4a')],{})[_0x9768('0x27')](respondWithResult(_0x51f888,0xc9))[_0x9768('0x45')](handleError(_0x51f888,null));};exports['update']=function(_0xb32308,_0x558a64){if(_0xb32308[_0x9768('0x4a')]['id']){delete _0xb32308[_0x9768('0x4a')]['id'];}return db['VtigerConfiguration'][_0x9768('0x48')]({'where':{'id':_0xb32308[_0x9768('0x4b')]['id']}})[_0x9768('0x27')](handleEntityNotFound(_0x558a64,null))[_0x9768('0x27')](saveUpdates(_0xb32308[_0x9768('0x4a')],null))[_0x9768('0x27')](respondWithResult(_0x558a64,null))['catch'](handleError(_0x558a64,null));};exports[_0x9768('0x28')]=function(_0x10fe2a,_0x35c8a4){return db[_0x9768('0x2d')][_0x9768('0x48')]({'where':{'id':_0x10fe2a['params']['id']}})['then'](handleEntityNotFound(_0x35c8a4,null))[_0x9768('0x27')](removeEntity(_0x35c8a4,null))[_0x9768('0x45')](handleError(_0x35c8a4,null));};exports['getFields']=function(_0x18fcde,_0x1e195d,_0x5e555a){var _0x2a722d={};var _0x382e2f={};var _0x147dc6;var _0x1a4eb2;return db['VtigerConfiguration'][_0x9768('0x4c')]({'where':{'id':_0x18fcde['params']['id']}})[_0x9768('0x27')](handleEntityNotFound(_0x1e195d,null))[_0x9768('0x27')](function(_0x347c94){if(_0x347c94){_0x147dc6=_0x347c94;_0x382e2f[_0x9768('0x32')]=_[_0x9768('0x35')](db['VtigerField'][_0x9768('0x2e')]);_0x382e2f[_0x9768('0x34')]=_[_0x9768('0x35')](_0x18fcde[_0x9768('0x34')]);_0x382e2f[_0x9768('0x36')]=_[_0x9768('0x46')](_0x382e2f['model'],_0x382e2f['query']);_0x2a722d[_0x9768('0x37')]=_[_0x9768('0x46')](_0x382e2f[_0x9768('0x32')],qs[_0x9768('0x38')](_0x18fcde[_0x9768('0x34')][_0x9768('0x38')]));_0x2a722d[_0x9768('0x37')]=_0x2a722d[_0x9768('0x37')][_0x9768('0x4d')]?_0x2a722d[_0x9768('0x37')]:_0x382e2f[_0x9768('0x32')];_0x2a722d['order']=qs['sort'](_0x18fcde[_0x9768('0x34')][_0x9768('0x3c')]);_0x2a722d[_0x9768('0x3d')]=qs['filters'](_[_0x9768('0x3e')](_0x18fcde[_0x9768('0x34')],_0x382e2f[_0x9768('0x36')]));if(_0x18fcde['query'][_0x9768('0x3f')]){_0x2a722d[_0x9768('0x3d')]=_[_0x9768('0x40')](_0x2a722d[_0x9768('0x3d')],{'$or':_[_0x9768('0x33')](_0x2a722d['attributes'],function(_0x13aef0){var _0x3ab5b7={};_0x3ab5b7[_0x13aef0]={'$like':'%'+_0x18fcde[_0x9768('0x34')]['filter']+'%'};return _0x3ab5b7;})});}_0x2a722d=_[_0x9768('0x40')]({},_0x2a722d,_0x18fcde[_0x9768('0x41')]);return _0x147dc6[_0x9768('0x4e')](_0x2a722d);}})[_0x9768('0x27')](function(_0x20076a){if(_0x20076a){_0x1a4eb2=_0x20076a[_0x9768('0x4d')];if(!_0x18fcde['query'][_0x9768('0x39')]('nolimit')){_0x2a722d[_0x9768('0x1f')]=qs[_0x9768('0x1f')](_0x18fcde['query'][_0x9768('0x1f')]);_0x2a722d[_0x9768('0x1d')]=qs[_0x9768('0x1d')](_0x18fcde['query'][_0x9768('0x1d')]);}return _0x147dc6[_0x9768('0x4e')](_0x2a722d);}})[_0x9768('0x27')](function(_0x102120){if(_0x102120){return _0x102120?{'count':_0x1a4eb2,'rows':_0x102120}:null;}})[_0x9768('0x27')](respondWithResult(_0x1e195d,null))['catch'](handleError(_0x1e195d,null));};exports['getSubjects']=function(_0x3502b4,_0xbb3def,_0x2db957){var _0x20d270={};var _0x575769={};var _0x2930c9;var _0x211a3c;return db[_0x9768('0x2d')][_0x9768('0x4c')]({'where':{'id':_0x3502b4['params']['id']}})[_0x9768('0x27')](handleEntityNotFound(_0xbb3def,null))[_0x9768('0x27')](function(_0x206838){if(_0x206838){_0x2930c9=_0x206838;_0x575769[_0x9768('0x32')]=_['keys'](db[_0x9768('0x4f')][_0x9768('0x2e')]);_0x575769['query']=_[_0x9768('0x35')](_0x3502b4[_0x9768('0x34')]);_0x575769['filters']=_['intersection'](_0x575769[_0x9768('0x32')],_0x575769[_0x9768('0x34')]);_0x20d270[_0x9768('0x37')]=_[_0x9768('0x46')](_0x575769[_0x9768('0x32')],qs[_0x9768('0x38')](_0x3502b4[_0x9768('0x34')][_0x9768('0x38')]));_0x20d270[_0x9768('0x37')]=_0x20d270[_0x9768('0x37')][_0x9768('0x4d')]?_0x20d270['attributes']:_0x575769[_0x9768('0x32')];_0x20d270[_0x9768('0x3b')]=qs[_0x9768('0x3c')](_0x3502b4[_0x9768('0x34')][_0x9768('0x3c')]);_0x20d270['where']=qs[_0x9768('0x36')](_[_0x9768('0x3e')](_0x3502b4[_0x9768('0x34')],_0x575769[_0x9768('0x36')]));if(_0x3502b4[_0x9768('0x34')][_0x9768('0x3f')]){_0x20d270[_0x9768('0x3d')]=_['merge'](_0x20d270[_0x9768('0x3d')],{'$or':_['map'](_0x20d270[_0x9768('0x37')],function(_0x4c24d2){var _0x1903f6={};_0x1903f6[_0x4c24d2]={'$like':'%'+_0x3502b4[_0x9768('0x34')][_0x9768('0x3f')]+'%'};return _0x1903f6;})});}_0x20d270=_[_0x9768('0x40')]({},_0x20d270,_0x3502b4[_0x9768('0x41')]);return _0x2930c9[_0x9768('0x50')](_0x20d270);}})[_0x9768('0x27')](function(_0x1999ea){if(_0x1999ea){_0x211a3c=_0x1999ea[_0x9768('0x4d')];if(!_0x3502b4[_0x9768('0x34')][_0x9768('0x39')](_0x9768('0x3a'))){_0x20d270['limit']=qs[_0x9768('0x1f')](_0x3502b4[_0x9768('0x34')][_0x9768('0x1f')]);_0x20d270[_0x9768('0x1d')]=qs['offset'](_0x3502b4[_0x9768('0x34')][_0x9768('0x1d')]);}return _0x2930c9[_0x9768('0x50')](_0x20d270);}})[_0x9768('0x27')](function(_0x25f129){if(_0x25f129){return _0x25f129?{'count':_0x211a3c,'rows':_0x25f129}:null;}})[_0x9768('0x27')](respondWithResult(_0xbb3def,null))[_0x9768('0x45')](handleError(_0xbb3def,null));};exports[_0x9768('0x51')]=function(_0x5bbba1,_0x163b53,_0x5c7349){var _0x252829={};var _0x4a3c29={};var _0x74f0de;var _0x32b258;return db[_0x9768('0x2d')][_0x9768('0x4c')]({'where':{'id':_0x5bbba1[_0x9768('0x4b')]['id']}})[_0x9768('0x27')](handleEntityNotFound(_0x163b53,null))[_0x9768('0x27')](function(_0x57e892){if(_0x57e892){_0x74f0de=_0x57e892;_0x4a3c29[_0x9768('0x32')]=_[_0x9768('0x35')](db[_0x9768('0x4f')]['rawAttributes']);_0x4a3c29[_0x9768('0x34')]=_[_0x9768('0x35')](_0x5bbba1['query']);_0x4a3c29[_0x9768('0x36')]=_[_0x9768('0x46')](_0x4a3c29[_0x9768('0x32')],_0x4a3c29[_0x9768('0x34')]);_0x252829['attributes']=_['intersection'](_0x4a3c29[_0x9768('0x32')],qs[_0x9768('0x38')](_0x5bbba1['query'][_0x9768('0x38')]));_0x252829[_0x9768('0x37')]=_0x252829[_0x9768('0x37')][_0x9768('0x4d')]?_0x252829[_0x9768('0x37')]:_0x4a3c29[_0x9768('0x32')];_0x252829[_0x9768('0x3b')]=qs[_0x9768('0x3c')](_0x5bbba1[_0x9768('0x34')]['sort']);_0x252829[_0x9768('0x3d')]=qs[_0x9768('0x36')](_[_0x9768('0x3e')](_0x5bbba1[_0x9768('0x34')],_0x4a3c29[_0x9768('0x36')]));if(_0x5bbba1[_0x9768('0x34')][_0x9768('0x3f')]){_0x252829['where']=_['merge'](_0x252829['where'],{'$or':_[_0x9768('0x33')](_0x252829['attributes'],function(_0x40704a){var _0x46c6be={};_0x46c6be[_0x40704a]={'$like':'%'+_0x5bbba1[_0x9768('0x34')]['filter']+'%'};return _0x46c6be;})});}_0x252829=_[_0x9768('0x40')]({},_0x252829,_0x5bbba1[_0x9768('0x41')]);return _0x74f0de[_0x9768('0x51')](_0x252829);}})[_0x9768('0x27')](function(_0x417e49){if(_0x417e49){_0x32b258=_0x417e49[_0x9768('0x4d')];if(!_0x5bbba1[_0x9768('0x34')][_0x9768('0x39')](_0x9768('0x3a'))){_0x252829[_0x9768('0x1f')]=qs[_0x9768('0x1f')](_0x5bbba1[_0x9768('0x34')][_0x9768('0x1f')]);_0x252829[_0x9768('0x1d')]=qs[_0x9768('0x1d')](_0x5bbba1['query']['offset']);}return _0x74f0de[_0x9768('0x51')](_0x252829);}})[_0x9768('0x27')](function(_0x5380e4){if(_0x5380e4){return _0x5380e4?{'count':_0x32b258,'rows':_0x5380e4}:null;}})[_0x9768('0x27')](respondWithResult(_0x163b53,null))[_0x9768('0x45')](handleError(_0x163b53,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b6cea3c..4d102d6 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 _0xc809=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','request-promise'];(function(_0xafcf00,_0x4429a3){var _0x513af4=function(_0x59554d){while(--_0x59554d){_0xafcf00['push'](_0xafcf00['shift']());}};_0x513af4(++_0x4429a3);}(_0xc809,0x74));var _0x9c80=function(_0x443639,_0x5a0db4){_0x443639=_0x443639-0x0;var _0x5e10ab=_0xc809[_0x443639];return _0x5e10ab;};'use strict';var _=require('lodash');var util=require(_0x9c80('0x0'));var logger=require(_0x9c80('0x1'))(_0x9c80('0x2'));var moment=require(_0x9c80('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c80('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c80('0x5'));var config=require(_0x9c80('0x6'));var attributes=require(_0x9c80('0x7'));module[_0x9c80('0x8')]=function(_0x50a866,_0x1b446c){return _0x50a866['define'](_0x9c80('0x9'),attributes,{'tableName':_0x9c80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd702=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','./intVtigerConfiguration.attributes'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0xd702,0x100));var _0x2d70=function(_0x29deb7,_0x286041){_0x29deb7=_0x29deb7-0x0;var _0x2e4d8f=_0xd702[_0x29deb7];return _0x2e4d8f;};'use strict';var _=require(_0x2d70('0x0'));var util=require(_0x2d70('0x1'));var logger=require('../../config/logger')(_0x2d70('0x2'));var moment=require(_0x2d70('0x3'));var BPromise=require(_0x2d70('0x4'));var rp=require(_0x2d70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d70('0x6'));var config=require('../../config/environment');var attributes=require(_0x2d70('0x7'));module[_0x2d70('0x8')]=function(_0xa04372,_0x3bf7a6){return _0xa04372[_0x2d70('0x9')](_0x2d70('0xa'),attributes,{'tableName':_0x2d70('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 9824aef..bbfb0ac 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 _0x876f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x290000,_0x25a79d){var _0x1a1f73=function(_0x3aa49a){while(--_0x3aa49a){_0x290000['push'](_0x290000['shift']());}};_0x1a1f73(++_0x25a79d);}(_0x876f,0xc9));var _0xf876=function(_0x9417c2,_0x129d71){_0x9417c2=_0x9417c2-0x0;var _0x58d321=_0x876f[_0x9417c2];return _0x58d321;};'use strict';var _=require(_0xf876('0x0'));var util=require(_0xf876('0x1'));var moment=require(_0xf876('0x2'));var BPromise=require(_0xf876('0x3'));var rs=require(_0xf876('0x4'));var fs=require('fs');var Redis=require(_0xf876('0x5'));var db=require(_0xf876('0x6'))['db'];var utils=require(_0xf876('0x7'));var logger=require(_0xf876('0x8'))(_0xf876('0x9'));var config=require(_0xf876('0xa'));var jayson=require(_0xf876('0xb'));var client=jayson['client'][_0xf876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ef58f,_0x545578,_0x355083){return new BPromise(function(_0x22955f,_0x577ec9){return client[_0xf876('0xd')](_0x4ef58f,_0x355083)[_0xf876('0xe')](function(_0x2dba03){logger[_0xf876('0xf')](_0xf876('0x10'),_0x545578,_0xf876('0x11'));logger[_0xf876('0x12')](_0xf876('0x13'),_0x545578,_0xf876('0x11'),JSON['stringify'](_0x2dba03));if(_0x2dba03[_0xf876('0x14')]){if(_0x2dba03[_0xf876('0x14')][_0xf876('0x15')]===0x1f4){logger[_0xf876('0x14')](_0xf876('0x10'),_0x545578,_0x2dba03['error'][_0xf876('0x16')]);return _0x577ec9(_0x2dba03[_0xf876('0x14')]['message']);}logger[_0xf876('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x545578,_0x2dba03['error'][_0xf876('0x16')]);return _0x22955f(_0x2dba03['error']['message']);}else{logger[_0xf876('0xf')](_0xf876('0x10'),_0x545578,_0xf876('0x11'));_0x22955f(_0x2dba03[_0xf876('0x17')][_0xf876('0x16')]);}})[_0xf876('0x18')](function(_0x54305d){logger[_0xf876('0x14')](_0xf876('0x10'),_0x545578,_0x54305d);_0x577ec9(_0x54305d);});});} \ No newline at end of file +var _0xdf1c=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d0b89,_0x14126c){var _0x38dcdf=function(_0x30a867){while(--_0x30a867){_0x2d0b89['push'](_0x2d0b89['shift']());}};_0x38dcdf(++_0x14126c);}(_0xdf1c,0xcc));var _0xcdf1=function(_0x40d798,_0x5d07cf){_0x40d798=_0x40d798-0x0;var _0x41d0e0=_0xdf1c[_0x40d798];return _0x41d0e0;};'use strict';var _=require(_0xcdf1('0x0'));var util=require('util');var moment=require(_0xcdf1('0x1'));var BPromise=require(_0xcdf1('0x2'));var rs=require(_0xcdf1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcdf1('0x4'));var logger=require('../../config/logger')(_0xcdf1('0x5'));var config=require(_0xcdf1('0x6'));var jayson=require(_0xcdf1('0x7'));var client=jayson['client'][_0xcdf1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x451dc5,_0x50c5d0,_0xe1d3ca){return new BPromise(function(_0x50cc42,_0x48b1f0){return client[_0xcdf1('0x9')](_0x451dc5,_0xe1d3ca)['then'](function(_0x530897){logger[_0xcdf1('0xa')](_0xcdf1('0xb'),_0x50c5d0,_0xcdf1('0xc'));logger[_0xcdf1('0xd')](_0xcdf1('0xe'),_0x50c5d0,'request\x20sent',JSON['stringify'](_0x530897));if(_0x530897[_0xcdf1('0xf')]){if(_0x530897[_0xcdf1('0xf')][_0xcdf1('0x10')]===0x1f4){logger['error'](_0xcdf1('0xb'),_0x50c5d0,_0x530897[_0xcdf1('0xf')][_0xcdf1('0x11')]);return _0x48b1f0(_0x530897['error'][_0xcdf1('0x11')]);}logger['error'](_0xcdf1('0xb'),_0x50c5d0,_0x530897[_0xcdf1('0xf')]['message']);return _0x50cc42(_0x530897[_0xcdf1('0xf')][_0xcdf1('0x11')]);}else{logger[_0xcdf1('0xa')](_0xcdf1('0xb'),_0x50c5d0,_0xcdf1('0xc'));_0x50cc42(_0x530897[_0xcdf1('0x12')][_0xcdf1('0x11')]);}})[_0xcdf1('0x13')](function(_0x56be2b){logger[_0xcdf1('0xf')](_0xcdf1('0xb'),_0x50c5d0,_0x56be2b);_0x48b1f0(_0x56be2b);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 7f41910..e8c3993 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 _0xdc13=['index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated'];(function(_0x1f9570,_0x101972){var _0x25dd05=function(_0x46d09f){while(--_0x46d09f){_0x1f9570['push'](_0x1f9570['shift']());}};_0x25dd05(++_0x101972);}(_0xdc13,0xe4));var _0x3dc1=function(_0x1bb122,_0x365779){_0x1bb122=_0x1bb122-0x0;var _0x4c17fe=_0xdc13[_0x1bb122];return _0x4c17fe;};'use strict';var multer=require(_0x3dc1('0x0'));var util=require(_0x3dc1('0x1'));var path=require(_0x3dc1('0x2'));var timeout=require(_0x3dc1('0x3'));var express=require(_0x3dc1('0x4'));var router=express[_0x3dc1('0x5')]();var fs_extra=require(_0x3dc1('0x6'));var auth=require(_0x3dc1('0x7'));var interaction=require(_0x3dc1('0x8'));var config=require('../../config/environment');var controller=require(_0x3dc1('0x9'));router[_0x3dc1('0xa')]('/',auth[_0x3dc1('0xb')](),controller[_0x3dc1('0xc')]);router[_0x3dc1('0xa')](_0x3dc1('0xd'),auth[_0x3dc1('0xb')](),controller['show']);router[_0x3dc1('0xe')]('/',auth['isAuthenticated'](),controller[_0x3dc1('0xf')]);router[_0x3dc1('0x10')](_0x3dc1('0xd'),auth[_0x3dc1('0xb')](),controller['update']);router[_0x3dc1('0x11')]('/:id',auth[_0x3dc1('0xb')](),controller[_0x3dc1('0x12')]);module[_0x3dc1('0x13')]=router; \ No newline at end of file +var _0x5a99=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','post','create','put','update'];(function(_0x397149,_0xb3d7dc){var _0xb42332=function(_0x2a54fd){while(--_0x2a54fd){_0x397149['push'](_0x397149['shift']());}};_0xb42332(++_0xb3d7dc);}(_0x5a99,0x1d2));var _0x95a9=function(_0x57c088,_0xc39721){_0x57c088=_0x57c088-0x0;var _0x59b5c3=_0x5a99[_0x57c088];return _0x59b5c3;};'use strict';var multer=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var path=require(_0x95a9('0x2'));var timeout=require('connect-timeout');var express=require(_0x95a9('0x3'));var router=express[_0x95a9('0x4')]();var fs_extra=require(_0x95a9('0x5'));var auth=require(_0x95a9('0x6'));var interaction=require(_0x95a9('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x95a9('0x8')](),controller['index']);router['get'](_0x95a9('0x9'),auth[_0x95a9('0x8')](),controller['show']);router[_0x95a9('0xa')]('/',auth[_0x95a9('0x8')](),controller[_0x95a9('0xb')]);router[_0x95a9('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x95a9('0xd')]);router[_0x95a9('0xe')]('/:id',auth[_0x95a9('0x8')](),controller[_0x95a9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index f159a70..759080b 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 _0x4c8e=['string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x7fc03b,_0x114ca2){var _0x23e949=function(_0x3840a5){while(--_0x3840a5){_0x7fc03b['push'](_0x7fc03b['shift']());}};_0x23e949(++_0x114ca2);}(_0x4c8e,0x15b));var _0xe4c8=function(_0x31d849,_0x3db9bc){_0x31d849=_0x31d849-0x0;var _0x1c55b3=_0x4c8e[_0x31d849];return _0x1c55b3;};'use strict';var Sequelize=require(_0xe4c8('0x0'));module[_0xe4c8('0x1')]={'type':{'type':Sequelize[_0xe4c8('0x2')](_0xe4c8('0x3'),_0xe4c8('0x4'),'customVariable',_0xe4c8('0x5'),_0xe4c8('0x6')),'defaultValue':_0xe4c8('0x3')},'content':{'type':Sequelize[_0xe4c8('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe4c8('0x2')]('string',_0xe4c8('0x4'),_0xe4c8('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe4c8('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe4c8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1bc7=['STRING','customVariable','exports','ENUM','string','variable','picklist'];(function(_0x5bebb0,_0x44ba9c){var _0x233936=function(_0x124cce){while(--_0x124cce){_0x5bebb0['push'](_0x5bebb0['shift']());}};_0x233936(++_0x44ba9c);}(_0x1bc7,0x160));var _0x71bc=function(_0x3f0a3c,_0x5f4c63){_0x3f0a3c=_0x3f0a3c-0x0;var _0x5e8f6e=_0x1bc7[_0x3f0a3c];return _0x5e8f6e;};'use strict';var Sequelize=require('sequelize');module[_0x71bc('0x0')]={'type':{'type':Sequelize[_0x71bc('0x1')](_0x71bc('0x2'),_0x71bc('0x3'),'customVariable','keyValue',_0x71bc('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x71bc('0x5')]},'key':{'type':Sequelize[_0x71bc('0x5')]},'keyType':{'type':Sequelize[_0x71bc('0x1')](_0x71bc('0x2'),_0x71bc('0x3'),_0x71bc('0x6'))},'keyContent':{'type':Sequelize[_0x71bc('0x5')]},'idField':{'type':Sequelize[_0x71bc('0x5')]},'nameField':{'type':Sequelize[_0x71bc('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 fbbee45..5dae332 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 _0x53b1=['params','include','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x53b1,0xf2));var _0x153b=function(_0x523d58,_0x4e07f4){_0x523d58=_0x523d58-0x0;var _0x311f28=_0x53b1[_0x523d58];return _0x311f28;};'use strict';var emlformat=require(_0x153b('0x0'));var rimraf=require(_0x153b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x153b('0x2'));var BPromise=require(_0x153b('0x3'));var Mustache=require(_0x153b('0x4'));var util=require(_0x153b('0x5'));var path=require(_0x153b('0x6'));var sox=require(_0x153b('0x7'));var csv=require(_0x153b('0x8'));var ejs=require(_0x153b('0x9'));var fs=require('fs');var fs_extra=require(_0x153b('0xa'));var _=require('lodash');var squel=require(_0x153b('0xb'));var crypto=require(_0x153b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x153b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x153b('0xe'));var Papa=require(_0x153b('0xf'));var Redis=require('ioredis');var authService=require(_0x153b('0x10'));var qs=require(_0x153b('0x11'));var as=require(_0x153b('0x12'));var hardwareService=require(_0x153b('0x13'));var logger=require(_0x153b('0x14'))(_0x153b('0x15'));var utils=require(_0x153b('0x16'));var config=require(_0x153b('0x17'));var licenseUtil=require(_0x153b('0x18'));var db=require(_0x153b('0x19'))['db'];function respondWithStatusCode(_0x171080,_0x49c573){_0x49c573=_0x49c573||0xcc;return function(_0x30f287){if(_0x30f287){return _0x171080['sendStatus'](_0x49c573);}return _0x171080[_0x153b('0x1a')](_0x49c573)[_0x153b('0x1b')]();};}function respondWithResult(_0x403c28,_0x41d838){_0x41d838=_0x41d838||0xc8;return function(_0x1c49cd){if(_0x1c49cd){return _0x403c28[_0x153b('0x1a')](_0x41d838)[_0x153b('0x1c')](_0x1c49cd);}};}function respondWithFilteredResult(_0x25f82f,_0x27b0ef){return function(_0x40365f){if(_0x40365f){var _0x2a1823=typeof _0x27b0ef[_0x153b('0x1d')]===_0x153b('0x1e')&&typeof _0x27b0ef[_0x153b('0x1f')]==='undefined';var _0x5dc599=_0x40365f[_0x153b('0x20')];var _0x250048=_0x2a1823?0x0:_0x27b0ef['offset'];var _0xce02fa=_0x2a1823?_0x40365f[_0x153b('0x20')]:_0x27b0ef[_0x153b('0x1d')]+_0x27b0ef[_0x153b('0x1f')];var _0x4bd335;if(_0xce02fa>=_0x5dc599){_0xce02fa=_0x5dc599;_0x4bd335=0xc8;}else{_0x4bd335=0xce;}_0x25f82f[_0x153b('0x1a')](_0x4bd335);return _0x25f82f[_0x153b('0x21')](_0x153b('0x22'),_0x250048+'-'+_0xce02fa+'/'+_0x5dc599)['json'](_0x40365f);}return null;};}function patchUpdates(_0x4fb24a){return function(_0x261a41){try{jsonpatch[_0x153b('0x23')](_0x261a41,_0x4fb24a,!![]);}catch(_0x53b521){return BPromise[_0x153b('0x24')](_0x53b521);}return _0x261a41[_0x153b('0x25')]();};}function saveUpdates(_0x34254f,_0x163674){return function(_0x3228de){if(_0x3228de){return _0x3228de[_0x153b('0x26')](_0x34254f)[_0x153b('0x27')](function(_0x4f1c59){return _0x4f1c59;});}return null;};}function removeEntity(_0x37b8d8,_0x3cecb1){return function(_0x352316){if(_0x352316){return _0x352316[_0x153b('0x28')]()['then'](function(){_0x37b8d8[_0x153b('0x1a')](0xcc)[_0x153b('0x1b')]();});}};}function handleEntityNotFound(_0x4a593c,_0x4aef99){return function(_0x3c5fbc){if(!_0x3c5fbc){_0x4a593c[_0x153b('0x29')](0x194);}return _0x3c5fbc;};}function handleError(_0x25ece7,_0x2de1c5){_0x2de1c5=_0x2de1c5||0x1f4;return function(_0x25ce1e){logger[_0x153b('0x2a')](_0x25ce1e['stack']);if(_0x25ce1e[_0x153b('0x2b')]){delete _0x25ce1e['name'];}_0x25ece7[_0x153b('0x1a')](_0x2de1c5)[_0x153b('0x2c')](_0x25ce1e);};}exports[_0x153b('0x2d')]=function(_0x2db718,_0x586da1){var _0x5a86bc={},_0x2135ca={},_0x58742f={'count':0x0,'rows':[]};var _0x119b7d=_[_0x153b('0x2e')](db[_0x153b('0x2f')][_0x153b('0x30')],function(_0x2ed63c){return{'name':_0x2ed63c[_0x153b('0x31')],'type':_0x2ed63c[_0x153b('0x32')]['key']};});_0x2135ca[_0x153b('0x33')]=_[_0x153b('0x2e')](_0x119b7d,'name');_0x2135ca[_0x153b('0x34')]=_[_0x153b('0x35')](_0x2db718[_0x153b('0x34')]);_0x2135ca[_0x153b('0x36')]=_[_0x153b('0x37')](_0x2135ca[_0x153b('0x33')],_0x2135ca['query']);_0x5a86bc[_0x153b('0x38')]=_[_0x153b('0x37')](_0x2135ca[_0x153b('0x33')],qs[_0x153b('0x39')](_0x2db718[_0x153b('0x34')][_0x153b('0x39')]));_0x5a86bc[_0x153b('0x38')]=_0x5a86bc[_0x153b('0x38')][_0x153b('0x3a')]?_0x5a86bc['attributes']:_0x2135ca[_0x153b('0x33')];if(!_0x2db718[_0x153b('0x34')][_0x153b('0x3b')](_0x153b('0x3c'))){_0x5a86bc[_0x153b('0x1f')]=qs[_0x153b('0x1f')](_0x2db718[_0x153b('0x34')]['limit']);_0x5a86bc['offset']=qs[_0x153b('0x1d')](_0x2db718[_0x153b('0x34')]['offset']);}_0x5a86bc[_0x153b('0x3d')]=qs[_0x153b('0x3e')](_0x2db718[_0x153b('0x34')][_0x153b('0x3e')]);_0x5a86bc[_0x153b('0x3f')]=qs[_0x153b('0x36')](_[_0x153b('0x40')](_0x2db718[_0x153b('0x34')],_0x2135ca[_0x153b('0x36')]),_0x119b7d);if(_0x2db718[_0x153b('0x34')][_0x153b('0x41')]){_0x5a86bc[_0x153b('0x3f')]=_['merge'](_0x5a86bc['where'],{'$or':_['map'](_0x119b7d,function(_0x5efbae){if(_0x5efbae[_0x153b('0x32')]!==_0x153b('0x42')){var _0x263b9f={};_0x263b9f[_0x5efbae[_0x153b('0x2b')]]={'$like':'%'+_0x2db718['query'][_0x153b('0x41')]+'%'};return _0x263b9f;}})});}_0x5a86bc=_[_0x153b('0x43')]({},_0x5a86bc,_0x2db718[_0x153b('0x44')]);var _0x44c23b={'where':_0x5a86bc[_0x153b('0x3f')]};return db['VtigerField']['count'](_0x44c23b)[_0x153b('0x27')](function(_0x2f4b5a){_0x58742f['count']=_0x2f4b5a;if(_0x2db718[_0x153b('0x34')][_0x153b('0x45')]){_0x5a86bc['include']=[{'all':!![]}];}return db[_0x153b('0x2f')][_0x153b('0x46')](_0x5a86bc);})['then'](function(_0x3e3d2f){_0x58742f[_0x153b('0x47')]=_0x3e3d2f;return _0x58742f;})[_0x153b('0x27')](respondWithFilteredResult(_0x586da1,_0x5a86bc))[_0x153b('0x48')](handleError(_0x586da1,null));};exports[_0x153b('0x49')]=function(_0x5eb951,_0x3acdfa){var _0x148d22={'raw':!![],'where':{'id':_0x5eb951[_0x153b('0x4a')]['id']}},_0x2e8b69={};_0x2e8b69[_0x153b('0x33')]=_['keys'](db[_0x153b('0x2f')][_0x153b('0x30')]);_0x2e8b69[_0x153b('0x34')]=_[_0x153b('0x35')](_0x5eb951[_0x153b('0x34')]);_0x2e8b69[_0x153b('0x36')]=_[_0x153b('0x37')](_0x2e8b69[_0x153b('0x33')],_0x2e8b69[_0x153b('0x34')]);_0x148d22[_0x153b('0x38')]=_[_0x153b('0x37')](_0x2e8b69['model'],qs[_0x153b('0x39')](_0x5eb951[_0x153b('0x34')][_0x153b('0x39')]));_0x148d22[_0x153b('0x38')]=_0x148d22[_0x153b('0x38')][_0x153b('0x3a')]?_0x148d22[_0x153b('0x38')]:_0x2e8b69[_0x153b('0x33')];if(_0x5eb951[_0x153b('0x34')][_0x153b('0x45')]){_0x148d22[_0x153b('0x4b')]=[{'all':!![]}];}_0x148d22=_['merge']({},_0x148d22,_0x5eb951['options']);return db[_0x153b('0x2f')][_0x153b('0x4c')](_0x148d22)[_0x153b('0x27')](handleEntityNotFound(_0x3acdfa,null))[_0x153b('0x27')](respondWithResult(_0x3acdfa,null))[_0x153b('0x48')](handleError(_0x3acdfa,null));};exports[_0x153b('0x4d')]=function(_0x6d2949,_0x5bbefd){return db[_0x153b('0x2f')][_0x153b('0x4d')](_0x6d2949[_0x153b('0x4e')],{})[_0x153b('0x27')](respondWithResult(_0x5bbefd,0xc9))[_0x153b('0x48')](handleError(_0x5bbefd,null));};exports[_0x153b('0x26')]=function(_0xf25471,_0x3fab27){if(_0xf25471[_0x153b('0x4e')]['id']){delete _0xf25471['body']['id'];}return db['VtigerField'][_0x153b('0x4c')]({'where':{'id':_0xf25471[_0x153b('0x4a')]['id']}})[_0x153b('0x27')](handleEntityNotFound(_0x3fab27,null))[_0x153b('0x27')](saveUpdates(_0xf25471[_0x153b('0x4e')],null))[_0x153b('0x27')](respondWithResult(_0x3fab27,null))['catch'](handleError(_0x3fab27,null));};exports[_0x153b('0x28')]=function(_0x1b73e7,_0x57e054){return db[_0x153b('0x2f')]['find']({'where':{'id':_0x1b73e7[_0x153b('0x4a')]['id']}})[_0x153b('0x27')](handleEntityNotFound(_0x57e054,null))[_0x153b('0x27')](removeEntity(_0x57e054,null))[_0x153b('0x48')](handleError(_0x57e054,null));}; \ No newline at end of file +var _0x2fa8=['intersection','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','fields','length','find','create','body','catch','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','attributes'];(function(_0x12ac2e,_0x57afe9){var _0x5b21b9=function(_0x1f655e){while(--_0x1f655e){_0x12ac2e['push'](_0x12ac2e['shift']());}};_0x5b21b9(++_0x57afe9);}(_0x2fa8,0x142));var _0x82fa=function(_0x3c864c,_0x4b8b7f){_0x3c864c=_0x3c864c-0x0;var _0xdfbb71=_0x2fa8[_0x3c864c];return _0xdfbb71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82fa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82fa('0x1'));var moment=require(_0x82fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x82fa('0x3'));var util=require('util');var path=require(_0x82fa('0x4'));var sox=require(_0x82fa('0x5'));var csv=require(_0x82fa('0x6'));var ejs=require(_0x82fa('0x7'));var fs=require('fs');var fs_extra=require(_0x82fa('0x8'));var _=require('lodash');var squel=require(_0x82fa('0x9'));var crypto=require(_0x82fa('0xa'));var jsforce=require(_0x82fa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x82fa('0x6'));var querystring=require(_0x82fa('0xc'));var Papa=require(_0x82fa('0xd'));var Redis=require(_0x82fa('0xe'));var authService=require(_0x82fa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x82fa('0x10'));var hardwareService=require(_0x82fa('0x11'));var logger=require(_0x82fa('0x12'))(_0x82fa('0x13'));var utils=require(_0x82fa('0x14'));var config=require(_0x82fa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x82fa('0x16'))['db'];function respondWithStatusCode(_0x5ab6ab,_0xf6f5f6){_0xf6f5f6=_0xf6f5f6||0xcc;return function(_0x49af56){if(_0x49af56){return _0x5ab6ab[_0x82fa('0x17')](_0xf6f5f6);}return _0x5ab6ab[_0x82fa('0x18')](_0xf6f5f6)['end']();};}function respondWithResult(_0x15da61,_0x2a3467){_0x2a3467=_0x2a3467||0xc8;return function(_0x260ef8){if(_0x260ef8){return _0x15da61[_0x82fa('0x18')](_0x2a3467)[_0x82fa('0x19')](_0x260ef8);}};}function respondWithFilteredResult(_0x22d57d,_0x42dc96){return function(_0x4fee38){if(_0x4fee38){var _0xae94e2=typeof _0x42dc96[_0x82fa('0x1a')]===_0x82fa('0x1b')&&typeof _0x42dc96[_0x82fa('0x1c')]==='undefined';var _0x4d3453=_0x4fee38['count'];var _0x1c8327=_0xae94e2?0x0:_0x42dc96[_0x82fa('0x1a')];var _0x107d53=_0xae94e2?_0x4fee38[_0x82fa('0x1d')]:_0x42dc96['offset']+_0x42dc96[_0x82fa('0x1c')];var _0x23bcb5;if(_0x107d53>=_0x4d3453){_0x107d53=_0x4d3453;_0x23bcb5=0xc8;}else{_0x23bcb5=0xce;}_0x22d57d[_0x82fa('0x18')](_0x23bcb5);return _0x22d57d[_0x82fa('0x1e')](_0x82fa('0x1f'),_0x1c8327+'-'+_0x107d53+'/'+_0x4d3453)[_0x82fa('0x19')](_0x4fee38);}return null;};}function patchUpdates(_0x6747da){return function(_0x359d5c){try{jsonpatch[_0x82fa('0x20')](_0x359d5c,_0x6747da,!![]);}catch(_0x30b6fd){return BPromise[_0x82fa('0x21')](_0x30b6fd);}return _0x359d5c[_0x82fa('0x22')]();};}function saveUpdates(_0x33f423,_0x2ddc55){return function(_0x4274b5){if(_0x4274b5){return _0x4274b5[_0x82fa('0x23')](_0x33f423)[_0x82fa('0x24')](function(_0x312dc2){return _0x312dc2;});}return null;};}function removeEntity(_0x314600,_0x8669e9){return function(_0x102dab){if(_0x102dab){return _0x102dab[_0x82fa('0x25')]()[_0x82fa('0x24')](function(){_0x314600[_0x82fa('0x18')](0xcc)[_0x82fa('0x26')]();});}};}function handleEntityNotFound(_0x4300e9,_0x283d6b){return function(_0x1b2e1f){if(!_0x1b2e1f){_0x4300e9['sendStatus'](0x194);}return _0x1b2e1f;};}function handleError(_0x152fe9,_0x4bfd5b){_0x4bfd5b=_0x4bfd5b||0x1f4;return function(_0x25c2ef){logger[_0x82fa('0x27')](_0x25c2ef[_0x82fa('0x28')]);if(_0x25c2ef[_0x82fa('0x29')]){delete _0x25c2ef[_0x82fa('0x29')];}_0x152fe9[_0x82fa('0x18')](_0x4bfd5b)['send'](_0x25c2ef);};}exports[_0x82fa('0x2a')]=function(_0x3a305b,_0x923125){var _0xfe4274={},_0x50b468={},_0x5b078d={'count':0x0,'rows':[]};var _0x11de58=_[_0x82fa('0x2b')](db[_0x82fa('0x2c')][_0x82fa('0x2d')],function(_0x574d98){return{'name':_0x574d98[_0x82fa('0x2e')],'type':_0x574d98[_0x82fa('0x2f')][_0x82fa('0x30')]};});_0x50b468[_0x82fa('0x31')]=_[_0x82fa('0x2b')](_0x11de58,_0x82fa('0x29'));_0x50b468[_0x82fa('0x32')]=_[_0x82fa('0x33')](_0x3a305b['query']);_0x50b468['filters']=_['intersection'](_0x50b468[_0x82fa('0x31')],_0x50b468[_0x82fa('0x32')]);_0xfe4274[_0x82fa('0x34')]=_[_0x82fa('0x35')](_0x50b468['model'],qs['fields'](_0x3a305b[_0x82fa('0x32')]['fields']));_0xfe4274[_0x82fa('0x34')]=_0xfe4274[_0x82fa('0x34')]['length']?_0xfe4274[_0x82fa('0x34')]:_0x50b468[_0x82fa('0x31')];if(!_0x3a305b[_0x82fa('0x32')]['hasOwnProperty'](_0x82fa('0x36'))){_0xfe4274[_0x82fa('0x1c')]=qs[_0x82fa('0x1c')](_0x3a305b[_0x82fa('0x32')][_0x82fa('0x1c')]);_0xfe4274[_0x82fa('0x1a')]=qs[_0x82fa('0x1a')](_0x3a305b[_0x82fa('0x32')][_0x82fa('0x1a')]);}_0xfe4274[_0x82fa('0x37')]=qs['sort'](_0x3a305b[_0x82fa('0x32')][_0x82fa('0x38')]);_0xfe4274[_0x82fa('0x39')]=qs[_0x82fa('0x3a')](_[_0x82fa('0x3b')](_0x3a305b[_0x82fa('0x32')],_0x50b468[_0x82fa('0x3a')]),_0x11de58);if(_0x3a305b[_0x82fa('0x32')][_0x82fa('0x3c')]){_0xfe4274[_0x82fa('0x39')]=_[_0x82fa('0x3d')](_0xfe4274['where'],{'$or':_['map'](_0x11de58,function(_0x5c873e){if(_0x5c873e[_0x82fa('0x2f')]!==_0x82fa('0x3e')){var _0x32fba0={};_0x32fba0[_0x5c873e['name']]={'$like':'%'+_0x3a305b['query']['filter']+'%'};return _0x32fba0;}})});}_0xfe4274=_[_0x82fa('0x3d')]({},_0xfe4274,_0x3a305b[_0x82fa('0x3f')]);var _0x44856c={'where':_0xfe4274[_0x82fa('0x39')]};return db[_0x82fa('0x2c')][_0x82fa('0x1d')](_0x44856c)[_0x82fa('0x24')](function(_0x21972b){_0x5b078d[_0x82fa('0x1d')]=_0x21972b;if(_0x3a305b[_0x82fa('0x32')][_0x82fa('0x40')]){_0xfe4274[_0x82fa('0x41')]=[{'all':!![]}];}return db[_0x82fa('0x2c')][_0x82fa('0x42')](_0xfe4274);})['then'](function(_0x37ee41){_0x5b078d[_0x82fa('0x43')]=_0x37ee41;return _0x5b078d;})[_0x82fa('0x24')](respondWithFilteredResult(_0x923125,_0xfe4274))['catch'](handleError(_0x923125,null));};exports['show']=function(_0x151769,_0x3b4168){var _0x44290d={'raw':!![],'where':{'id':_0x151769[_0x82fa('0x44')]['id']}},_0x10479c={};_0x10479c[_0x82fa('0x31')]=_[_0x82fa('0x33')](db[_0x82fa('0x2c')][_0x82fa('0x2d')]);_0x10479c[_0x82fa('0x32')]=_[_0x82fa('0x33')](_0x151769[_0x82fa('0x32')]);_0x10479c['filters']=_[_0x82fa('0x35')](_0x10479c[_0x82fa('0x31')],_0x10479c[_0x82fa('0x32')]);_0x44290d[_0x82fa('0x34')]=_[_0x82fa('0x35')](_0x10479c[_0x82fa('0x31')],qs[_0x82fa('0x45')](_0x151769[_0x82fa('0x32')][_0x82fa('0x45')]));_0x44290d[_0x82fa('0x34')]=_0x44290d[_0x82fa('0x34')][_0x82fa('0x46')]?_0x44290d[_0x82fa('0x34')]:_0x10479c[_0x82fa('0x31')];if(_0x151769[_0x82fa('0x32')][_0x82fa('0x40')]){_0x44290d['include']=[{'all':!![]}];}_0x44290d=_[_0x82fa('0x3d')]({},_0x44290d,_0x151769[_0x82fa('0x3f')]);return db[_0x82fa('0x2c')][_0x82fa('0x47')](_0x44290d)[_0x82fa('0x24')](handleEntityNotFound(_0x3b4168,null))[_0x82fa('0x24')](respondWithResult(_0x3b4168,null))['catch'](handleError(_0x3b4168,null));};exports[_0x82fa('0x48')]=function(_0x14cf62,_0x2967a0){return db[_0x82fa('0x2c')][_0x82fa('0x48')](_0x14cf62[_0x82fa('0x49')],{})['then'](respondWithResult(_0x2967a0,0xc9))['catch'](handleError(_0x2967a0,null));};exports['update']=function(_0x18b463,_0x5f3654){if(_0x18b463[_0x82fa('0x49')]['id']){delete _0x18b463[_0x82fa('0x49')]['id'];}return db[_0x82fa('0x2c')][_0x82fa('0x47')]({'where':{'id':_0x18b463[_0x82fa('0x44')]['id']}})[_0x82fa('0x24')](handleEntityNotFound(_0x5f3654,null))[_0x82fa('0x24')](saveUpdates(_0x18b463[_0x82fa('0x49')],null))[_0x82fa('0x24')](respondWithResult(_0x5f3654,null))[_0x82fa('0x4a')](handleError(_0x5f3654,null));};exports[_0x82fa('0x25')]=function(_0xb8636d,_0x230b3e){return db[_0x82fa('0x2c')][_0x82fa('0x47')]({'where':{'id':_0xb8636d['params']['id']}})[_0x82fa('0x24')](handleEntityNotFound(_0x230b3e,null))[_0x82fa('0x24')](removeEntity(_0x230b3e,null))[_0x82fa('0x4a')](handleError(_0x230b3e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 02d14b1..391a029 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 _0x5d70=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intVtigerField.attributes','define','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x261cfc,_0x3fe3d3){var _0x5cb3eb=function(_0x3cb4f3){while(--_0x3cb4f3){_0x261cfc['push'](_0x261cfc['shift']());}};_0x5cb3eb(++_0x3fe3d3);}(_0x5d70,0x84));var _0x05d7=function(_0x46c4c0,_0x4c952e){_0x46c4c0=_0x46c4c0-0x0;var _0x2b608c=_0x5d70[_0x46c4c0];return _0x2b608c;};'use strict';var _=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var logger=require(_0x05d7('0x2'))(_0x05d7('0x3'));var moment=require('moment');var BPromise=require(_0x05d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05d7('0x5'));var config=require(_0x05d7('0x6'));var attributes=require(_0x05d7('0x7'));module['exports']=function(_0x3d8de7,_0x31aaaf){return _0x3d8de7[_0x05d7('0x8')]('VtigerField',attributes,{'tableName':_0x05d7('0x9'),'paranoid':![],'indexes':[{'name':_0x05d7('0xa'),'fields':[_0x05d7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a66=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x3c0f09,_0x379235){var _0x28ced9=function(_0x1b41cf){while(--_0x1b41cf){_0x3c0f09['push'](_0x3c0f09['shift']());}};_0x28ced9(++_0x379235);}(_0x3a66,0x174));var _0x63a6=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x3a66[_0x214a25];return _0x405988;};'use strict';var _=require(_0x63a6('0x0'));var util=require(_0x63a6('0x1'));var logger=require(_0x63a6('0x2'))(_0x63a6('0x3'));var moment=require(_0x63a6('0x4'));var BPromise=require(_0x63a6('0x5'));var rp=require(_0x63a6('0x6'));var fs=require('fs');var path=require(_0x63a6('0x7'));var rimraf=require(_0x63a6('0x8'));var config=require(_0x63a6('0x9'));var attributes=require(_0x63a6('0xa'));module['exports']=function(_0x386c3b,_0x1b0ed4){return _0x386c3b[_0x63a6('0xb')](_0x63a6('0xc'),attributes,{'tableName':_0x63a6('0xd'),'paranoid':![],'indexes':[{'name':_0x63a6('0xe'),'fields':[_0x63a6('0xf'),_0x63a6('0x10')],'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 95d5f2b..a7c9095 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 _0xa1e1=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x6b4aa7,_0x4df51f){var _0x42f755=function(_0x1ae88a){while(--_0x1ae88a){_0x6b4aa7['push'](_0x6b4aa7['shift']());}};_0x42f755(++_0x4df51f);}(_0xa1e1,0x1b7));var _0x1a1e=function(_0x1c0cf7,_0x341833){_0x1c0cf7=_0x1c0cf7-0x0;var _0x1fcd63=_0xa1e1[_0x1c0cf7];return _0x1fcd63;};'use strict';var _=require(_0x1a1e('0x0'));var util=require(_0x1a1e('0x1'));var moment=require(_0x1a1e('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a1e('0x3'));var fs=require('fs');var Redis=require(_0x1a1e('0x4'));var db=require(_0x1a1e('0x5'))['db'];var utils=require(_0x1a1e('0x6'));var logger=require(_0x1a1e('0x7'))(_0x1a1e('0x8'));var config=require(_0x1a1e('0x9'));var jayson=require(_0x1a1e('0xa'));var client=jayson['client'][_0x1a1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15e72c,_0x3cef99,_0x218f66){return new BPromise(function(_0x4d1a34,_0x2f492f){return client[_0x1a1e('0xc')](_0x15e72c,_0x218f66)[_0x1a1e('0xd')](function(_0x4ba7aa){logger[_0x1a1e('0xe')](_0x1a1e('0xf'),_0x3cef99,_0x1a1e('0x10'));logger[_0x1a1e('0x11')](_0x1a1e('0x12'),_0x3cef99,_0x1a1e('0x10'),JSON[_0x1a1e('0x13')](_0x4ba7aa));if(_0x4ba7aa['error']){if(_0x4ba7aa[_0x1a1e('0x14')][_0x1a1e('0x15')]===0x1f4){logger[_0x1a1e('0x14')](_0x1a1e('0xf'),_0x3cef99,_0x4ba7aa[_0x1a1e('0x14')][_0x1a1e('0x16')]);return _0x2f492f(_0x4ba7aa[_0x1a1e('0x14')][_0x1a1e('0x16')]);}logger[_0x1a1e('0x14')](_0x1a1e('0xf'),_0x3cef99,_0x4ba7aa[_0x1a1e('0x14')][_0x1a1e('0x16')]);return _0x4d1a34(_0x4ba7aa[_0x1a1e('0x14')][_0x1a1e('0x16')]);}else{logger[_0x1a1e('0xe')](_0x1a1e('0xf'),_0x3cef99,_0x1a1e('0x10'));_0x4d1a34(_0x4ba7aa['result'][_0x1a1e('0x16')]);}})[_0x1a1e('0x17')](function(_0x45ca1a){logger[_0x1a1e('0x14')]('VtigerField,\x20%s,\x20%s',_0x3cef99,_0x45ca1a);_0x2f492f(_0x45ca1a);});});} \ No newline at end of file +var _0x5692=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','request\x20sent','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x37d514,_0xa1701b){var _0x56349c=function(_0x14230b){while(--_0x14230b){_0x37d514['push'](_0x37d514['shift']());}};_0x56349c(++_0xa1701b);}(_0x5692,0x158));var _0x2569=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5692[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2569('0x0'));var util=require('util');var moment=require(_0x2569('0x1'));var BPromise=require(_0x2569('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2569('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2569('0x4'));var logger=require('../../config/logger')(_0x2569('0x5'));var config=require(_0x2569('0x6'));var jayson=require(_0x2569('0x7'));var client=jayson[_0x2569('0x8')][_0x2569('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x228124,_0x35114d,_0x4d4b57){return new BPromise(function(_0x452e15,_0x53505e){return client[_0x2569('0xa')](_0x228124,_0x4d4b57)[_0x2569('0xb')](function(_0x51a533){logger['info']('VtigerField,\x20%s,\x20%s',_0x35114d,'request\x20sent');logger[_0x2569('0xc')](_0x2569('0xd'),_0x35114d,'request\x20sent',JSON[_0x2569('0xe')](_0x51a533));if(_0x51a533[_0x2569('0xf')]){if(_0x51a533[_0x2569('0xf')][_0x2569('0x10')]===0x1f4){logger[_0x2569('0xf')](_0x2569('0x11'),_0x35114d,_0x51a533[_0x2569('0xf')][_0x2569('0x12')]);return _0x53505e(_0x51a533[_0x2569('0xf')][_0x2569('0x12')]);}logger[_0x2569('0xf')](_0x2569('0x11'),_0x35114d,_0x51a533[_0x2569('0xf')]['message']);return _0x452e15(_0x51a533[_0x2569('0xf')][_0x2569('0x12')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x35114d,_0x2569('0x13'));_0x452e15(_0x51a533['result'][_0x2569('0x12')]);}})[_0x2569('0x14')](function(_0x43b0fb){logger['error'](_0x2569('0x11'),_0x35114d,_0x43b0fb);_0x53505e(_0x43b0fb);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5168af7..18ca3e2 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 _0xe90c=['/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','get'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe90c,0xbc));var _0xce90=function(_0xee2847,_0x5e5235){_0xee2847=_0xee2847-0x0;var _0x29bb86=_0xe90c[_0xee2847];return _0x29bb86;};'use strict';var multer=require(_0xce90('0x0'));var util=require(_0xce90('0x1'));var path=require(_0xce90('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xce90('0x3'));var auth=require(_0xce90('0x4'));var interaction=require(_0xce90('0x5'));var config=require(_0xce90('0x6'));var controller=require(_0xce90('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xce90('0x8')]);router[_0xce90('0x9')](_0xce90('0xa'),auth[_0xce90('0xb')](),controller['show']);router['get'](_0xce90('0xc'),auth[_0xce90('0xb')](),controller['getConfigurations']);router[_0xce90('0x9')](_0xce90('0xd'),auth[_0xce90('0xb')](),controller[_0xce90('0xe')]);router['post']('/',auth[_0xce90('0xb')](),controller['create']);router[_0xce90('0xf')](_0xce90('0xc'),auth[_0xce90('0xb')](),controller[_0xce90('0x10')]);router[_0xce90('0x11')]('/:id',auth[_0xce90('0xb')](),controller[_0xce90('0x12')]);router[_0xce90('0x13')](_0xce90('0xa'),auth[_0xce90('0xb')](),controller[_0xce90('0x14')]);module[_0xce90('0x15')]=router; \ No newline at end of file +var _0xf8c8=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x50dcff,_0x3d80fe){var _0x1e1861=function(_0x395c74){while(--_0x395c74){_0x50dcff['push'](_0x50dcff['shift']());}};_0x1e1861(++_0x3d80fe);}(_0xf8c8,0x118));var _0x8f8c=function(_0x1cbd12,_0x576c7f){_0x1cbd12=_0x1cbd12-0x0;var _0xaa0bd6=_0xf8c8[_0x1cbd12];return _0xaa0bd6;};'use strict';var multer=require(_0x8f8c('0x0'));var util=require(_0x8f8c('0x1'));var path=require('path');var timeout=require(_0x8f8c('0x2'));var express=require(_0x8f8c('0x3'));var router=express['Router']();var fs_extra=require(_0x8f8c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8f8c('0x5'));var config=require(_0x8f8c('0x6'));var controller=require(_0x8f8c('0x7'));router[_0x8f8c('0x8')]('/',auth[_0x8f8c('0x9')](),controller[_0x8f8c('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8f8c('0xb')]);router[_0x8f8c('0x8')](_0x8f8c('0xc'),auth[_0x8f8c('0x9')](),controller[_0x8f8c('0xd')]);router[_0x8f8c('0x8')](_0x8f8c('0xe'),auth[_0x8f8c('0x9')](),controller[_0x8f8c('0xf')]);router[_0x8f8c('0x10')]('/',auth['isAuthenticated'](),controller[_0x8f8c('0x11')]);router[_0x8f8c('0x10')](_0x8f8c('0xc'),auth['isAuthenticated'](),controller[_0x8f8c('0x12')]);router[_0x8f8c('0x13')](_0x8f8c('0x14'),auth[_0x8f8c('0x9')](),controller[_0x8f8c('0x15')]);router[_0x8f8c('0x16')]('/:id',auth[_0x8f8c('0x9')](),controller[_0x8f8c('0x17')]);module[_0x8f8c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index bd5ec3c..986f6e5 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 _0xd6f9=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xd6f9[_0x3932eb];return _0x5316e5;};'use strict';var Sequelize=require(_0x9d6f('0x0'));module[_0x9d6f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d6f('0x2')],'unique':_0x9d6f('0x3')},'password':{'type':Sequelize[_0x9d6f('0x2')]},'token':{'type':Sequelize[_0x9d6f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9d6f('0x4')},'authType':{'type':Sequelize[_0x9d6f('0x5')](_0x9d6f('0x6'),'token'),'defaultValue':_0x9d6f('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9d6f('0x7'),'newTab'),'defaultValue':_0x9d6f('0x7')}}; \ No newline at end of file +var _0xcedf=['STRING','username','remoteUri','password','ENUM','integrationTab','sequelize','exports'];(function(_0x403454,_0x4688ad){var _0x535214=function(_0x11b380){while(--_0x11b380){_0x403454['push'](_0x403454['shift']());}};_0x535214(++_0x4688ad);}(_0xcedf,0x1b6));var _0xfced=function(_0x4b1b19,_0x39b595){_0x4b1b19=_0x4b1b19-0x0;var _0x3de67d=_0xcedf[_0x4b1b19];return _0x3de67d;};'use strict';var Sequelize=require(_0xfced('0x0'));module[_0xfced('0x1')]={'name':{'type':Sequelize[_0xfced('0x2')]},'description':{'type':Sequelize[_0xfced('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xfced('0x3')},'password':{'type':Sequelize[_0xfced('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfced('0x4')},'authType':{'type':Sequelize['ENUM'](_0xfced('0x5'),'token'),'defaultValue':_0xfced('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfced('0x6')]('integrationTab','newTab'),'defaultValue':_0xfced('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 344b1f6..2ba0726 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 _0x0102=['VIRTUAL','options','ZendeskAccount','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','includes','title','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','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','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','json','apply','reject','then','sendStatus','error','stack','name','send','index','map','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','pick','filters','filter','merge'];(function(_0x2f7db3,_0x16cffe){var _0x57c2bd=function(_0x40b402){while(--_0x40b402){_0x2f7db3['push'](_0x2f7db3['shift']());}};_0x57c2bd(++_0x16cffe);}(_0x0102,0x186));var _0x2010=function(_0x29be0a,_0xa5ffd0){_0x29be0a=_0x29be0a-0x0;var _0x457bb2=_0x0102[_0x29be0a];return _0x457bb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];var integrations=require(_0x2010('0x18'));function respondWithStatusCode(_0x3e8624,_0x388991){_0x388991=_0x388991||0xcc;return function(_0x528a38){if(_0x528a38){return _0x3e8624['sendStatus'](_0x388991);}return _0x3e8624[_0x2010('0x19')](_0x388991)[_0x2010('0x1a')]();};}function respondWithResult(_0x2e8ec2,_0x10b587){_0x10b587=_0x10b587||0xc8;return function(_0x32d791){if(_0x32d791){return _0x2e8ec2[_0x2010('0x19')](_0x10b587)['json'](_0x32d791);}};}function respondWithFilteredResult(_0x3195fa,_0x136418){return function(_0x5ad412){if(_0x5ad412){var _0x41e267=typeof _0x136418[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x136418[_0x2010('0x1d')]===_0x2010('0x1c');var _0x11bd28=_0x5ad412[_0x2010('0x1e')];var _0x1476c0=_0x41e267?0x0:_0x136418[_0x2010('0x1b')];var _0x569de2=_0x41e267?_0x5ad412['count']:_0x136418[_0x2010('0x1b')]+_0x136418[_0x2010('0x1d')];var _0x3f9d62;if(_0x569de2>=_0x11bd28){_0x569de2=_0x11bd28;_0x3f9d62=0xc8;}else{_0x3f9d62=0xce;}_0x3195fa[_0x2010('0x19')](_0x3f9d62);return _0x3195fa['set']('Content-Range',_0x1476c0+'-'+_0x569de2+'/'+_0x11bd28)[_0x2010('0x1f')](_0x5ad412);}return null;};}function patchUpdates(_0x171e45){return function(_0x37b51b){try{jsonpatch[_0x2010('0x20')](_0x37b51b,_0x171e45,!![]);}catch(_0x103bbc){return BPromise[_0x2010('0x21')](_0x103bbc);}return _0x37b51b['save']();};}function saveUpdates(_0x3db13d,_0x1cfa57){return function(_0x58ff30){if(_0x58ff30){return _0x58ff30['update'](_0x3db13d)['then'](function(_0x424453){return _0x424453;});}return null;};}function removeEntity(_0x574719,_0x277dcc){return function(_0x5f4233){if(_0x5f4233){return _0x5f4233['destroy']()[_0x2010('0x22')](function(){_0x574719[_0x2010('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x99ebe0,_0x4cff59){return function(_0x2a12ee){if(!_0x2a12ee){_0x99ebe0[_0x2010('0x23')](0x194);}return _0x2a12ee;};}function handleError(_0x3929d9,_0x3dcea4){_0x3dcea4=_0x3dcea4||0x1f4;return function(_0x3c5862){logger[_0x2010('0x24')](_0x3c5862[_0x2010('0x25')]);if(_0x3c5862[_0x2010('0x26')]){delete _0x3c5862[_0x2010('0x26')];}_0x3929d9[_0x2010('0x19')](_0x3dcea4)[_0x2010('0x27')](_0x3c5862);};}exports[_0x2010('0x28')]=function(_0x499cbe,_0x2a4691){var _0x52fe5e={},_0x5b52fb={},_0x147a5a={'count':0x0,'rows':[]};var _0xd16c04=_[_0x2010('0x29')](db['ZendeskAccount']['rawAttributes'],function(_0x136d5f){return{'name':_0x136d5f['fieldName'],'type':_0x136d5f[_0x2010('0x2a')][_0x2010('0x2b')]};});_0x5b52fb['model']=_[_0x2010('0x29')](_0xd16c04,_0x2010('0x26'));_0x5b52fb[_0x2010('0x2c')]=_[_0x2010('0x2d')](_0x499cbe[_0x2010('0x2c')]);_0x5b52fb['filters']=_[_0x2010('0x2e')](_0x5b52fb[_0x2010('0x2f')],_0x5b52fb[_0x2010('0x2c')]);_0x52fe5e['attributes']=_['intersection'](_0x5b52fb[_0x2010('0x2f')],qs[_0x2010('0x30')](_0x499cbe[_0x2010('0x2c')]['fields']));_0x52fe5e['attributes']=_0x52fe5e[_0x2010('0x31')][_0x2010('0x32')]?_0x52fe5e[_0x2010('0x31')]:_0x5b52fb[_0x2010('0x2f')];if(!_0x499cbe[_0x2010('0x2c')]['hasOwnProperty']('nolimit')){_0x52fe5e['limit']=qs[_0x2010('0x1d')](_0x499cbe[_0x2010('0x2c')][_0x2010('0x1d')]);_0x52fe5e['offset']=qs[_0x2010('0x1b')](_0x499cbe[_0x2010('0x2c')][_0x2010('0x1b')]);}_0x52fe5e[_0x2010('0x33')]=qs['sort'](_0x499cbe[_0x2010('0x2c')][_0x2010('0x34')]);_0x52fe5e[_0x2010('0x35')]=qs['filters'](_[_0x2010('0x36')](_0x499cbe['query'],_0x5b52fb[_0x2010('0x37')]),_0xd16c04);if(_0x499cbe[_0x2010('0x2c')][_0x2010('0x38')]){_0x52fe5e[_0x2010('0x35')]=_[_0x2010('0x39')](_0x52fe5e[_0x2010('0x35')],{'$or':_['map'](_0xd16c04,function(_0x1e4460){if(_0x1e4460['type']!==_0x2010('0x3a')){var _0x157c73={};_0x157c73[_0x1e4460[_0x2010('0x26')]]={'$like':'%'+_0x499cbe[_0x2010('0x2c')][_0x2010('0x38')]+'%'};return _0x157c73;}})});}_0x52fe5e=_[_0x2010('0x39')]({},_0x52fe5e,_0x499cbe[_0x2010('0x3b')]);var _0x36ff3e={'where':_0x52fe5e[_0x2010('0x35')]};return db[_0x2010('0x3c')][_0x2010('0x1e')](_0x36ff3e)[_0x2010('0x22')](function(_0x1c2b13){_0x147a5a[_0x2010('0x1e')]=_0x1c2b13;if(_0x499cbe['query']['includeAll']){_0x52fe5e[_0x2010('0x3d')]=[{'all':!![]}];}return db[_0x2010('0x3c')][_0x2010('0x3e')](_0x52fe5e);})[_0x2010('0x22')](function(_0x3d5906){_0x147a5a[_0x2010('0x3f')]=_0x3d5906;return _0x147a5a;})[_0x2010('0x22')](respondWithFilteredResult(_0x2a4691,_0x52fe5e))['catch'](handleError(_0x2a4691,null));};exports[_0x2010('0x40')]=function(_0x578645,_0x27fd64){var _0x3ff496={'raw':![],'where':{'id':_0x578645[_0x2010('0x41')]['id']}},_0x16db82={};_0x16db82[_0x2010('0x2f')]=_['keys'](db[_0x2010('0x3c')][_0x2010('0x42')]);_0x16db82[_0x2010('0x2c')]=_[_0x2010('0x2d')](_0x578645['query']);_0x16db82[_0x2010('0x37')]=_['intersection'](_0x16db82['model'],_0x16db82['query']);_0x3ff496[_0x2010('0x31')]=_[_0x2010('0x2e')](_0x16db82[_0x2010('0x2f')],qs[_0x2010('0x30')](_0x578645[_0x2010('0x2c')][_0x2010('0x30')]));_0x3ff496['attributes']=_0x3ff496[_0x2010('0x31')][_0x2010('0x32')]?_0x3ff496[_0x2010('0x31')]:_0x16db82['model'];if(_0x578645['query'][_0x2010('0x43')]){_0x3ff496['include']=[{'all':!![]}];}_0x3ff496=_[_0x2010('0x39')]({},_0x3ff496,_0x578645[_0x2010('0x3b')]);return db[_0x2010('0x3c')][_0x2010('0x44')](_0x3ff496)['then'](handleEntityNotFound(_0x27fd64,null))[_0x2010('0x22')](respondWithResult(_0x27fd64,null))[_0x2010('0x45')](handleError(_0x27fd64,null));};exports[_0x2010('0x46')]=function(_0x231db7,_0x3ec24c){return db[_0x2010('0x3c')]['create'](_0x231db7[_0x2010('0x47')],{})[_0x2010('0x22')](respondWithResult(_0x3ec24c,0xc9))[_0x2010('0x45')](handleError(_0x3ec24c,null));};exports['update']=function(_0x30e5d0,_0x1dd027){if(_0x30e5d0['body']['id']){delete _0x30e5d0[_0x2010('0x47')]['id'];}return db[_0x2010('0x3c')][_0x2010('0x44')]({'where':{'id':_0x30e5d0[_0x2010('0x41')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x1dd027,null))[_0x2010('0x22')](saveUpdates(_0x30e5d0[_0x2010('0x47')],null))[_0x2010('0x22')](respondWithResult(_0x1dd027,null))['catch'](handleError(_0x1dd027,null));};exports['destroy']=function(_0xc9f070,_0xe1721f){return db['ZendeskAccount'][_0x2010('0x44')]({'where':{'id':_0xc9f070[_0x2010('0x41')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0xe1721f,null))[_0x2010('0x22')](removeEntity(_0xe1721f,null))[_0x2010('0x45')](handleError(_0xe1721f,null));};exports['getConfigurations']=function(_0x5f4e98,_0x3fca06,_0x137452){var _0x4694e7={};var _0x3b89de={};var _0x38e596;var _0x2d8164;return db[_0x2010('0x3c')][_0x2010('0x48')]({'where':{'id':_0x5f4e98[_0x2010('0x41')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x3fca06,null))[_0x2010('0x22')](function(_0x5313b5){if(_0x5313b5){_0x38e596=_0x5313b5;_0x3b89de[_0x2010('0x2f')]=_[_0x2010('0x2d')](db['ZendeskConfiguration'][_0x2010('0x42')]);_0x3b89de[_0x2010('0x2c')]=_[_0x2010('0x2d')](_0x5f4e98[_0x2010('0x2c')]);_0x3b89de[_0x2010('0x37')]=_[_0x2010('0x2e')](_0x3b89de[_0x2010('0x2f')],_0x3b89de[_0x2010('0x2c')]);_0x4694e7[_0x2010('0x31')]=_[_0x2010('0x2e')](_0x3b89de[_0x2010('0x2f')],qs[_0x2010('0x30')](_0x5f4e98[_0x2010('0x2c')][_0x2010('0x30')]));_0x4694e7[_0x2010('0x31')]=_0x4694e7[_0x2010('0x31')][_0x2010('0x32')]?_0x4694e7[_0x2010('0x31')]:_0x3b89de[_0x2010('0x2f')];_0x4694e7[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x5f4e98[_0x2010('0x2c')][_0x2010('0x34')]);_0x4694e7['where']=qs[_0x2010('0x37')](_['pick'](_0x5f4e98['query'],_0x3b89de[_0x2010('0x37')]));if(_0x5f4e98[_0x2010('0x2c')]['filter']){_0x4694e7[_0x2010('0x35')]=_[_0x2010('0x39')](_0x4694e7[_0x2010('0x35')],{'$or':_[_0x2010('0x29')](_0x4694e7['attributes'],function(_0x3c6484){var _0x44816e={};_0x44816e[_0x3c6484]={'$like':'%'+_0x5f4e98[_0x2010('0x2c')][_0x2010('0x38')]+'%'};return _0x44816e;})});}_0x4694e7=_['merge']({},_0x4694e7,_0x5f4e98[_0x2010('0x3b')]);return _0x38e596['getConfigurations'](_0x4694e7);}})[_0x2010('0x22')](function(_0x2bc708){if(_0x2bc708){_0x2d8164=_0x2bc708[_0x2010('0x32')];if(!_0x5f4e98[_0x2010('0x2c')]['hasOwnProperty']('nolimit')){_0x4694e7[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x5f4e98['query']['limit']);_0x4694e7[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x5f4e98[_0x2010('0x2c')][_0x2010('0x1b')]);}return _0x38e596['getConfigurations'](_0x4694e7);}})[_0x2010('0x22')](function(_0x5a2c7e){if(_0x5a2c7e){return _0x5a2c7e?{'count':_0x2d8164,'rows':_0x5a2c7e}:null;}})[_0x2010('0x22')](respondWithResult(_0x3fca06,null))[_0x2010('0x45')](handleError(_0x3fca06,null));};exports[_0x2010('0x49')]=function(_0x1d81e1,_0x4bde43,_0x340882){if(_0x1d81e1[_0x2010('0x47')]['id']){delete _0x1d81e1['body']['id'];}return db[_0x2010('0x3c')][_0x2010('0x48')]({'where':{'id':_0x1d81e1[_0x2010('0x41')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x4bde43,null))[_0x2010('0x22')](function(_0x8df400){if(_0x8df400){_0x1d81e1[_0x2010('0x47')][_0x2010('0x4a')]=_0x8df400['id'];_0x1d81e1[_0x2010('0x47')][_0x2010('0x4b')]=integrations[_0x2010('0x4c')](_0x1d81e1[_0x2010('0x47')]['channel'],_0x1d81e1[_0x2010('0x47')][_0x2010('0x2a')]);_0x1d81e1[_0x2010('0x47')]['Descriptions']=integrations['getDescriptions'](_0x1d81e1[_0x2010('0x47')][_0x2010('0x4d')],_0x1d81e1[_0x2010('0x47')][_0x2010('0x2a')]);return db[_0x2010('0x4e')][_0x2010('0x46')](_0x1d81e1['body'],{'include':[{'model':db[_0x2010('0x4f')],'as':_0x2010('0x4b')},{'model':db[_0x2010('0x4f')],'as':'Descriptions'}]});}return null;})[_0x2010('0x22')](respondWithResult(_0x4bde43,null))[_0x2010('0x45')](handleError(_0x4bde43,null));};exports[_0x2010('0x50')]=function(_0x5182b2,_0x20dea1,_0x22f654){var _0x4adc1c='';return db['ZendeskAccount'][_0x2010('0x48')]({'where':{'id':_0x5182b2['params']['id']},'attributes':['id','username',_0x2010('0x51'),_0x2010('0x52'),_0x2010('0x53'),_0x2010('0x54')]})[_0x2010('0x22')](handleEntityNotFound(_0x20dea1,null))[_0x2010('0x22')](function(_0xdf6767){if(_0xdf6767){_0x4adc1c=_0xdf6767[_0x2010('0x54')];var _0xee7084=_0x4adc1c[_0x2010('0x55')](-0x1);if(_0xee7084==='/'){_0x4adc1c=_0x4adc1c['substring'](0x0,_0x4adc1c[_0x2010('0x56')](_0xee7084));}var _0x1c1373={'method':'GET','uri':util[_0x2010('0x57')](_0x2010('0x58'),_0x4adc1c,_0x2010('0x59')),'json':!![]};switch(_0xdf6767[_0x2010('0x53')]){case'password':_0x1c1373[_0x2010('0x5a')]={'Authorization':util[_0x2010('0x57')]('Basic\x20%s',new Buffer(util['format'](_0x2010('0x5b'),_0xdf6767['username'],_0xdf6767[_0x2010('0x51')]))[_0x2010('0x5c')](_0x2010('0x5d')))};break;case _0x2010('0x52'):_0x1c1373[_0x2010('0x5a')]={'Authorization':util[_0x2010('0x57')](_0x2010('0x5e'),new Buffer(util['format'](_0x2010('0x5f'),_0xdf6767[_0x2010('0x60')],_0xdf6767[_0x2010('0x52')]))['toString'](_0x2010('0x5d')))};break;default:throw new db[(_0x2010('0x61'))][(_0x2010('0x62'))](_0x2010('0x63'));}return rp(_0x1c1373);}})[_0x2010('0x22')](function(_0x41c3cc){if(_0x41c3cc){var _0x40885b=[_0x2010('0x64'),'description',_0x2010('0x65'),_0x2010('0x66')];_[_0x2010('0x67')](_0x41c3cc['ticket_fields'],function(_0xb6ba3f){return _0x40885b[_0x2010('0x68')](_0xb6ba3f['type']);});return{'count':_0x41c3cc[_0x2010('0x59')][_0x2010('0x32')],'rows':_[_0x2010('0x29')](_0x41c3cc[_0x2010('0x59')],function(_0x38e733){return{'id':_0x38e733['id'],'name':_0x38e733['position']>0x7?_0x38e733[_0x2010('0x69')]:_0x38e733[_0x2010('0x2a')],'custom':_0x38e733['position']>0x7?!![]:![],'options':_0x38e733[_0x2010('0x6a')]?_0x38e733[_0x2010('0x6a')]:_0x38e733['custom_field_options']?_0x38e733[_0x2010('0x6b')]:[]};})};}})['then'](respondWithResult(_0x20dea1,null))['catch'](function(_0x44e47e){var _0x17f7c5=_0x5182b2[_0x2010('0x2c')][_0x2010('0x6c')]?0x1f4:_0x44e47e[_0x2010('0x6d')]||0x1f4;logger[_0x2010('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x2010('0x50'),_0x17f7c5,JSON[_0x2010('0x6e')](_0x44e47e));delete _0x44e47e[_0x2010('0x26')];if(_0x17f7c5===0x191){_0x17f7c5=0x190;}_0x20dea1[_0x2010('0x19')](_0x17f7c5)['send'](_0x5182b2[_0x2010('0x2c')]['test']?{'message':_0x2010('0x6f'),'statusCode':_0x44e47e[_0x2010('0x6d')]}:_0x44e47e);});}; \ No newline at end of file +var _0x04b8=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x11d610,_0x33a30b){var _0x529e47=function(_0x14e926){while(--_0x14e926){_0x11d610['push'](_0x11d610['shift']());}};_0x529e47(++_0x33a30b);}(_0x04b8,0x159));var _0x804b=function(_0x55311c,_0x4c6a2d){_0x55311c=_0x55311c-0x0;var _0x220908=_0x04b8[_0x55311c];return _0x220908;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['ZendeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['ZendeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['ZendeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['ZendeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['ZendeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['ZendeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['ZendeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58'),_0x804b('0x59'),'authType',_0x804b('0x5a')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x2541cd){if(_0x2541cd){_0x39ed3c=_0x2541cd[_0x804b('0x5a')];var _0x549504=_0x39ed3c[_0x804b('0x5b')](-0x1);if(_0x549504==='/'){_0x39ed3c=_0x39ed3c['substring'](0x0,_0x39ed3c[_0x804b('0x5c')](_0x549504));}var _0x3e2813={'method':_0x804b('0x5d'),'uri':util[_0x804b('0x5e')](_0x804b('0x5f'),_0x39ed3c,_0x804b('0x60')),'json':!![]};switch(_0x2541cd[_0x804b('0x61')]){case'password':_0x3e2813[_0x804b('0x62')]={'Authorization':util['format'](_0x804b('0x63'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x64'),_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x58')]))[_0x804b('0x65')](_0x804b('0x66')))};break;case _0x804b('0x59'):_0x3e2813[_0x804b('0x62')]={'Authorization':util[_0x804b('0x5e')](_0x804b('0x63'),new Buffer(util['format']('%s/token:%s',_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x59')]))[_0x804b('0x65')](_0x804b('0x66')))};break;default:throw new db['Sequelize'][(_0x804b('0x67'))](_0x804b('0x68'));}return rp(_0x3e2813);}})[_0x804b('0x26')](function(_0x3dda89){if(_0x3dda89){var _0x260419=[_0x804b('0x69'),_0x804b('0x6a'),_0x804b('0x6b'),_0x804b('0x6c')];_[_0x804b('0x6d')](_0x3dda89['ticket_fields'],function(_0x5a6661){return _0x260419[_0x804b('0x6e')](_0x5a6661[_0x804b('0x2e')]);});return{'count':_0x3dda89['ticket_fields'][_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x3dda89['ticket_fields'],function(_0x345bf7){return{'id':_0x345bf7['id'],'name':_0x345bf7['position']>0x7?_0x345bf7['title']:_0x345bf7[_0x804b('0x2e')],'custom':_0x345bf7[_0x804b('0x6f')]>0x7?!![]:![],'options':_0x345bf7['system_field_options']?_0x345bf7['system_field_options']:_0x345bf7[_0x804b('0x70')]?_0x345bf7[_0x804b('0x70')]:[]};})};}})['then'](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x5e2756){var _0x42dfc3=_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?0x1f4:_0x5e2756['statusCode']||0x1f4;logger[_0x804b('0x72')](_0x804b('0x73'),_0x804b('0x56'),_0x42dfc3,JSON[_0x804b('0x74')](_0x5e2756));delete _0x5e2756[_0x804b('0x2a')];if(_0x42dfc3===0x191){_0x42dfc3=0x190;}_0x1bb4ec[_0x804b('0x1a')](_0x42dfc3)[_0x804b('0x2b')](_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?{'message':_0x804b('0x75'),'statusCode':_0x5e2756['statusCode']}:_0x5e2756);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index c23af01..98fee17 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 _0xa049=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x1c5dfc,_0x44c83a){var _0x15b3f9=function(_0x4b38b0){while(--_0x4b38b0){_0x1c5dfc['push'](_0x1c5dfc['shift']());}};_0x15b3f9(++_0x44c83a);}(_0xa049,0x94));var _0x9a04=function(_0x15b33d,_0x3a17b0){_0x15b33d=_0x15b33d-0x0;var _0x3b09b6=_0xa049[_0x15b33d];return _0x3b09b6;};'use strict';var _=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var logger=require(_0x9a04('0x2'))(_0x9a04('0x3'));var moment=require(_0x9a04('0x4'));var BPromise=require(_0x9a04('0x5'));var rp=require(_0x9a04('0x6'));var fs=require('fs');var path=require(_0x9a04('0x7'));var rimraf=require('rimraf');var config=require(_0x9a04('0x8'));var attributes=require(_0x9a04('0x9'));var integrations=require(_0x9a04('0xa'));module[_0x9a04('0xb')]=function(_0x3e52be,_0x408f43){return _0x3e52be[_0x9a04('0xc')](_0x9a04('0xd'),attributes,{'tableName':_0x9a04('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9798=['bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','../../config/logger','api','moment'];(function(_0x42c35f,_0x57ca0a){var _0x178b1c=function(_0x1e7c6d){while(--_0x1e7c6d){_0x42c35f['push'](_0x42c35f['shift']());}};_0x178b1c(++_0x57ca0a);}(_0x9798,0xff));var _0x8979=function(_0x3faa39,_0x51bc03){_0x3faa39=_0x3faa39-0x0;var _0x4821f4=_0x9798[_0x3faa39];return _0x4821f4;};'use strict';var _=require(_0x8979('0x0'));var util=require(_0x8979('0x1'));var logger=require(_0x8979('0x2'))(_0x8979('0x3'));var moment=require(_0x8979('0x4'));var BPromise=require(_0x8979('0x5'));var rp=require(_0x8979('0x6'));var fs=require('fs');var path=require(_0x8979('0x7'));var rimraf=require(_0x8979('0x8'));var config=require('../../config/environment');var attributes=require(_0x8979('0x9'));var integrations=require(_0x8979('0xa'));module[_0x8979('0xb')]=function(_0x118934,_0x15771b){return _0x118934['define'](_0x8979('0xc'),attributes,{'tableName':'int_zendesk_accounts','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 dff77b7..919d16d 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 _0x8d5d=['code','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','attributes','limit','model','include','ShowZendeskAccount','find','raw','where','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c7df8,_0x206ef7){var _0x2df075=function(_0x25a710){while(--_0x25a710){_0x3c7df8['push'](_0x3c7df8['shift']());}};_0x2df075(++_0x206ef7);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x20cbd7,_0x198c65){_0x20cbd7=_0x20cbd7-0x0;var _0x587a2b=_0x8d5d[_0x20cbd7];return _0x587a2b;};'use strict';var _=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var moment=require(_0xd8d5('0x2'));var BPromise=require(_0xd8d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8d5('0x4'));var db=require(_0xd8d5('0x5'))['db'];var utils=require(_0xd8d5('0x6'));var logger=require('../../config/logger')(_0xd8d5('0x7'));var config=require(_0xd8d5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8d5('0x9')][_0xd8d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d620,_0x5ad550,_0xe4c252){return new BPromise(function(_0x292a82,_0x48353e){return client[_0xd8d5('0xb')](_0x56d620,_0xe4c252)[_0xd8d5('0xc')](function(_0x161ef0){logger['info'](_0xd8d5('0xd'),_0x5ad550,'request\x20sent');logger[_0xd8d5('0xe')](_0xd8d5('0xf'),_0x5ad550,'request\x20sent',JSON[_0xd8d5('0x10')](_0x161ef0));if(_0x161ef0[_0xd8d5('0x11')]){if(_0x161ef0[_0xd8d5('0x11')][_0xd8d5('0x12')]===0x1f4){logger[_0xd8d5('0x11')](_0xd8d5('0xd'),_0x5ad550,_0x161ef0[_0xd8d5('0x11')][_0xd8d5('0x13')]);return _0x48353e(_0x161ef0[_0xd8d5('0x11')][_0xd8d5('0x13')]);}logger[_0xd8d5('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5ad550,_0x161ef0['error']['message']);return _0x292a82(_0x161ef0[_0xd8d5('0x11')][_0xd8d5('0x13')]);}else{logger[_0xd8d5('0x14')](_0xd8d5('0xd'),_0x5ad550,'request\x20sent');_0x292a82(_0x161ef0[_0xd8d5('0x15')][_0xd8d5('0x13')]);}})[_0xd8d5('0x16')](function(_0x8a88b1){logger['error'](_0xd8d5('0xd'),_0x5ad550,_0x8a88b1);_0x48353e(_0x8a88b1);});});}exports[_0xd8d5('0x17')]=function(_0x4d28ae){var _0xd46a9=this;return new Promise(function(_0x4629a6,_0x993b3c){return db[_0xd8d5('0x18')][_0xd8d5('0x19')]({'raw':_0x4d28ae['options']?_0x4d28ae[_0xd8d5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4d28ae[_0xd8d5('0x1a')]?_0x4d28ae[_0xd8d5('0x1a')]['where']||null:null,'attributes':_0x4d28ae[_0xd8d5('0x1a')]?_0x4d28ae[_0xd8d5('0x1a')][_0xd8d5('0x1b')]||null:null,'limit':_0x4d28ae[_0xd8d5('0x1a')]?_0x4d28ae[_0xd8d5('0x1a')][_0xd8d5('0x1c')]||null:null,'include':_0x4d28ae[_0xd8d5('0x1a')]?_0x4d28ae['options']['include']?_['map'](_0x4d28ae['options']['include'],function(_0x57e1a2){return{'model':db[_0x57e1a2[_0xd8d5('0x1d')]],'as':_0x57e1a2['as'],'attributes':_0x57e1a2[_0xd8d5('0x1b')],'include':_0x57e1a2[_0xd8d5('0x1e')]?_['map'](_0x57e1a2['include'],function(_0x4b3556){return{'model':db[_0x4b3556[_0xd8d5('0x1d')]],'as':_0x4b3556['as'],'attributes':_0x4b3556[_0xd8d5('0x1b')],'include':_0x4b3556[_0xd8d5('0x1e')]?_['map'](_0x4b3556[_0xd8d5('0x1e')],function(_0x1e5188){return{'model':db[_0x1e5188[_0xd8d5('0x1d')]],'as':_0x1e5188['as'],'attributes':_0x1e5188[_0xd8d5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd8d5('0xc')](function(_0x44d6d3){logger['info']('GetZendeskAccount',_0x4d28ae);logger[_0xd8d5('0xe')]('GetZendeskAccount',_0x4d28ae,JSON[_0xd8d5('0x10')](_0x44d6d3));_0x4629a6(_0x44d6d3);})['catch'](function(_0x444f5b){logger[_0xd8d5('0x11')]('GetZendeskAccount',_0x444f5b[_0xd8d5('0x13')],_0x4d28ae);_0x993b3c(_0xd46a9['error'](0x1f4,_0x444f5b[_0xd8d5('0x13')]));});});};exports[_0xd8d5('0x1f')]=function(_0x5a5335){var _0x2daee2=this;return new Promise(function(_0x379737,_0x1bc07b){return db[_0xd8d5('0x18')][_0xd8d5('0x20')]({'raw':_0x5a5335['options']?_0x5a5335[_0xd8d5('0x1a')][_0xd8d5('0x21')]===undefined?!![]:![]:!![],'where':_0x5a5335[_0xd8d5('0x1a')]?_0x5a5335[_0xd8d5('0x1a')][_0xd8d5('0x22')]||null:null,'attributes':_0x5a5335['options']?_0x5a5335[_0xd8d5('0x1a')][_0xd8d5('0x1b')]||null:null,'include':_0x5a5335[_0xd8d5('0x1a')]?_0x5a5335[_0xd8d5('0x1a')][_0xd8d5('0x1e')]?_['map'](_0x5a5335[_0xd8d5('0x1a')][_0xd8d5('0x1e')],function(_0x2c2c50){return{'model':db[_0x2c2c50['model']],'as':_0x2c2c50['as'],'attributes':_0x2c2c50[_0xd8d5('0x1b')],'include':_0x2c2c50[_0xd8d5('0x1e')]?_[_0xd8d5('0x23')](_0x2c2c50[_0xd8d5('0x1e')],function(_0xe90c7b){return{'model':db[_0xe90c7b[_0xd8d5('0x1d')]],'as':_0xe90c7b['as'],'attributes':_0xe90c7b[_0xd8d5('0x1b')],'include':_0xe90c7b['include']?_[_0xd8d5('0x23')](_0xe90c7b[_0xd8d5('0x1e')],function(_0x451e7d){return{'model':db[_0x451e7d[_0xd8d5('0x1d')]],'as':_0x451e7d['as'],'attributes':_0x451e7d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8d5('0xc')](function(_0x3ac005){logger[_0xd8d5('0x14')]('ShowZendeskAccount',_0x5a5335);logger[_0xd8d5('0xe')](_0xd8d5('0x1f'),_0x5a5335,JSON[_0xd8d5('0x10')](_0x3ac005));_0x379737(_0x3ac005);})[_0xd8d5('0x16')](function(_0x360c1c){logger['error'](_0xd8d5('0x1f'),_0x360c1c['message'],_0x5a5335);_0x1bc07b(_0x2daee2['error'](0x1f4,_0x360c1c[_0xd8d5('0x13')]));});});}; \ No newline at end of file +var _0x8f77=['info','result','catch','ZendeskAccount','options','raw','where','attributes','limit','map','include','model','then','GetZendeskAccount','ShowZendeskAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x243155,_0x5ad66d){var _0x4e05a1=function(_0x400098){while(--_0x400098){_0x243155['push'](_0x243155['shift']());}};_0x4e05a1(++_0x5ad66d);}(_0x8f77,0x98));var _0x78f7=function(_0x39d7ce,_0x4317a9){_0x39d7ce=_0x39d7ce-0x0;var _0x13010f=_0x8f77[_0x39d7ce];return _0x13010f;};'use strict';var _=require(_0x78f7('0x0'));var util=require('util');var moment=require(_0x78f7('0x1'));var BPromise=require(_0x78f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f7('0x3'));var db=require(_0x78f7('0x4'))['db'];var utils=require(_0x78f7('0x5'));var logger=require(_0x78f7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78f7('0x7'));var client=jayson['client'][_0x78f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x405b41,_0x224869,_0x5e2863){return new BPromise(function(_0x38457b,_0x25ee5d){return client[_0x78f7('0x9')](_0x405b41,_0x5e2863)['then'](function(_0x5b0f65){logger['info'](_0x78f7('0xa'),_0x224869,_0x78f7('0xb'));logger[_0x78f7('0xc')](_0x78f7('0xd'),_0x224869,_0x78f7('0xb'),JSON[_0x78f7('0xe')](_0x5b0f65));if(_0x5b0f65[_0x78f7('0xf')]){if(_0x5b0f65[_0x78f7('0xf')][_0x78f7('0x10')]===0x1f4){logger[_0x78f7('0xf')](_0x78f7('0xa'),_0x224869,_0x5b0f65[_0x78f7('0xf')][_0x78f7('0x11')]);return _0x25ee5d(_0x5b0f65[_0x78f7('0xf')][_0x78f7('0x11')]);}logger[_0x78f7('0xf')](_0x78f7('0xa'),_0x224869,_0x5b0f65[_0x78f7('0xf')][_0x78f7('0x11')]);return _0x38457b(_0x5b0f65[_0x78f7('0xf')]['message']);}else{logger[_0x78f7('0x12')](_0x78f7('0xa'),_0x224869,'request\x20sent');_0x38457b(_0x5b0f65[_0x78f7('0x13')][_0x78f7('0x11')]);}})[_0x78f7('0x14')](function(_0x2645fb){logger[_0x78f7('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x224869,_0x2645fb);_0x25ee5d(_0x2645fb);});});}exports['GetZendeskAccount']=function(_0xba187d){var _0x50e01c=this;return new Promise(function(_0x407f40,_0x518809){return db[_0x78f7('0x15')]['findAll']({'raw':_0xba187d[_0x78f7('0x16')]?_0xba187d['options'][_0x78f7('0x17')]===undefined?!![]:![]:!![],'where':_0xba187d['options']?_0xba187d[_0x78f7('0x16')][_0x78f7('0x18')]||null:null,'attributes':_0xba187d[_0x78f7('0x16')]?_0xba187d[_0x78f7('0x16')][_0x78f7('0x19')]||null:null,'limit':_0xba187d[_0x78f7('0x16')]?_0xba187d[_0x78f7('0x16')][_0x78f7('0x1a')]||null:null,'include':_0xba187d[_0x78f7('0x16')]?_0xba187d['options']['include']?_[_0x78f7('0x1b')](_0xba187d[_0x78f7('0x16')]['include'],function(_0x27d7f8){return{'model':db[_0x27d7f8['model']],'as':_0x27d7f8['as'],'attributes':_0x27d7f8[_0x78f7('0x19')],'include':_0x27d7f8['include']?_[_0x78f7('0x1b')](_0x27d7f8[_0x78f7('0x1c')],function(_0x10d2f0){return{'model':db[_0x10d2f0['model']],'as':_0x10d2f0['as'],'attributes':_0x10d2f0['attributes'],'include':_0x10d2f0[_0x78f7('0x1c')]?_['map'](_0x10d2f0[_0x78f7('0x1c')],function(_0x54976e){return{'model':db[_0x54976e[_0x78f7('0x1d')]],'as':_0x54976e['as'],'attributes':_0x54976e[_0x78f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x78f7('0x1e')](function(_0x3c905c){logger[_0x78f7('0x12')]('GetZendeskAccount',_0xba187d);logger['debug'](_0x78f7('0x1f'),_0xba187d,JSON[_0x78f7('0xe')](_0x3c905c));_0x407f40(_0x3c905c);})[_0x78f7('0x14')](function(_0x59762b){logger[_0x78f7('0xf')](_0x78f7('0x1f'),_0x59762b[_0x78f7('0x11')],_0xba187d);_0x518809(_0x50e01c[_0x78f7('0xf')](0x1f4,_0x59762b['message']));});});};exports[_0x78f7('0x20')]=function(_0x2a0fbb){var _0x24bef4=this;return new Promise(function(_0x566055,_0x14f84f){return db[_0x78f7('0x15')][_0x78f7('0x21')]({'raw':_0x2a0fbb['options']?_0x2a0fbb[_0x78f7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2a0fbb[_0x78f7('0x16')]?_0x2a0fbb[_0x78f7('0x16')][_0x78f7('0x18')]||null:null,'attributes':_0x2a0fbb[_0x78f7('0x16')]?_0x2a0fbb[_0x78f7('0x16')]['attributes']||null:null,'include':_0x2a0fbb[_0x78f7('0x16')]?_0x2a0fbb['options'][_0x78f7('0x1c')]?_[_0x78f7('0x1b')](_0x2a0fbb['options'][_0x78f7('0x1c')],function(_0x41a509){return{'model':db[_0x41a509[_0x78f7('0x1d')]],'as':_0x41a509['as'],'attributes':_0x41a509[_0x78f7('0x19')],'include':_0x41a509[_0x78f7('0x1c')]?_[_0x78f7('0x1b')](_0x41a509['include'],function(_0x11bfcc){return{'model':db[_0x11bfcc[_0x78f7('0x1d')]],'as':_0x11bfcc['as'],'attributes':_0x11bfcc[_0x78f7('0x19')],'include':_0x11bfcc['include']?_['map'](_0x11bfcc[_0x78f7('0x1c')],function(_0x491147){return{'model':db[_0x491147[_0x78f7('0x1d')]],'as':_0x491147['as'],'attributes':_0x491147[_0x78f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x78f7('0x1e')](function(_0x547f78){logger['info']('ShowZendeskAccount',_0x2a0fbb);logger[_0x78f7('0xc')](_0x78f7('0x20'),_0x2a0fbb,JSON['stringify'](_0x547f78));_0x566055(_0x547f78);})['catch'](function(_0x651ad7){logger[_0x78f7('0xf')](_0x78f7('0x20'),_0x651ad7['message'],_0x2a0fbb);_0x14f84f(_0x24bef4[_0x78f7('0xf')](0x1f4,_0x651ad7[_0x78f7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 888c808..18847b1 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 _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x568650,_0xc61449){var _0x55414e=function(_0x3a22f7){while(--_0x3a22f7){_0x568650['push'](_0x568650['shift']());}};_0x55414e(++_0xc61449);}(_0x750a,0x140));var _0xa750=function(_0x475a43,_0x10e510){_0x475a43=_0x475a43-0x0;var _0x358b07=_0x750a[_0x475a43];return _0x358b07;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0xb688,0xcf));var _0x8b68=function(_0x144d90,_0xb56d47){_0x144d90=_0x144d90-0x0;var _0x35587d=_0xb688[_0x144d90];return _0x35587d;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6949288..b11077f 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 _0xf730=['STRING','sequelize','exports'];(function(_0x58980f,_0x332302){var _0x1fdbb8=function(_0x1cb9af){while(--_0x1cb9af){_0x58980f['push'](_0x58980f['shift']());}};_0x1fdbb8(++_0x332302);}(_0xf730,0xa9));var _0x0f73=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0xf730[_0x4dcac4];return _0x2a238d;};'use strict';var Sequelize=require(_0x0f73('0x0'));module[_0x0f73('0x1')]={'name':{'type':Sequelize[_0x0f73('0x2')]},'description':{'type':Sequelize[_0x0f73('0x2')]}}; \ No newline at end of file +var _0xdf68=['sequelize','exports','STRING'];(function(_0x25efb1,_0x34fa50){var _0x59d64d=function(_0x491192){while(--_0x491192){_0x25efb1['push'](_0x25efb1['shift']());}};_0x59d64d(++_0x34fa50);}(_0xdf68,0xc0));var _0x8df6=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0xdf68[_0x3da707];return _0x342ee7;};'use strict';var Sequelize=require(_0x8df6('0x0'));module[_0x8df6('0x1')]={'name':{'type':Sequelize[_0x8df6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6f267c3..8197035 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 _0xfdf6=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','length','ZendeskConfiguration','find','create','body','params','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','Content-Range','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfdf6,0x1b7));var _0x6fdf=function(_0x34580d,_0x27d01a){_0x34580d=_0x34580d-0x0;var _0x5d7580=_0xfdf6[_0x34580d];return _0x5d7580;};'use strict';var emlformat=require(_0x6fdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fdf('0x1'));var jsonpatch=require(_0x6fdf('0x2'));var rp=require('request-promise');var moment=require(_0x6fdf('0x3'));var BPromise=require(_0x6fdf('0x4'));var Mustache=require(_0x6fdf('0x5'));var util=require(_0x6fdf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6fdf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6fdf('0x8'));var crypto=require('crypto');var jsforce=require(_0x6fdf('0x9'));var deskjs=require(_0x6fdf('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6fdf('0xb'));var Papa=require(_0x6fdf('0xc'));var Redis=require(_0x6fdf('0xd'));var authService=require(_0x6fdf('0xe'));var qs=require(_0x6fdf('0xf'));var as=require(_0x6fdf('0x10'));var hardwareService=require(_0x6fdf('0x11'));var logger=require(_0x6fdf('0x12'))(_0x6fdf('0x13'));var utils=require(_0x6fdf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6fdf('0x15'));var db=require(_0x6fdf('0x16'))['db'];function respondWithStatusCode(_0x3786e5,_0x4fc49e){_0x4fc49e=_0x4fc49e||0xcc;return function(_0x5af653){if(_0x5af653){return _0x3786e5[_0x6fdf('0x17')](_0x4fc49e);}return _0x3786e5[_0x6fdf('0x18')](_0x4fc49e)[_0x6fdf('0x19')]();};}function respondWithResult(_0x5a04e7,_0x56b97d){_0x56b97d=_0x56b97d||0xc8;return function(_0x107496){if(_0x107496){return _0x5a04e7[_0x6fdf('0x18')](_0x56b97d)[_0x6fdf('0x1a')](_0x107496);}};}function respondWithFilteredResult(_0x85aff9,_0x5709a5){return function(_0x33b601){if(_0x33b601){var _0x4da63a=typeof _0x5709a5['offset']===_0x6fdf('0x1b')&&typeof _0x5709a5['limit']==='undefined';var _0x137fb8=_0x33b601['count'];var _0x534471=_0x4da63a?0x0:_0x5709a5[_0x6fdf('0x1c')];var _0x434593=_0x4da63a?_0x33b601['count']:_0x5709a5[_0x6fdf('0x1c')]+_0x5709a5[_0x6fdf('0x1d')];var _0x34c969;if(_0x434593>=_0x137fb8){_0x434593=_0x137fb8;_0x34c969=0xc8;}else{_0x34c969=0xce;}_0x85aff9[_0x6fdf('0x18')](_0x34c969);return _0x85aff9['set'](_0x6fdf('0x1e'),_0x534471+'-'+_0x434593+'/'+_0x137fb8)[_0x6fdf('0x1a')](_0x33b601);}return null;};}function patchUpdates(_0x48a2e7){return function(_0x37ad9a){try{jsonpatch['apply'](_0x37ad9a,_0x48a2e7,!![]);}catch(_0x1016b5){return BPromise['reject'](_0x1016b5);}return _0x37ad9a[_0x6fdf('0x1f')]();};}function saveUpdates(_0x17ff9b,_0x5400f6){return function(_0x1a66a7){if(_0x1a66a7){return _0x1a66a7[_0x6fdf('0x20')](_0x17ff9b)[_0x6fdf('0x21')](function(_0x2d29fb){return _0x2d29fb;});}return null;};}function removeEntity(_0x1a8ba8,_0x517c6d){return function(_0x2de060){if(_0x2de060){return _0x2de060['destroy']()[_0x6fdf('0x21')](function(){_0x1a8ba8[_0x6fdf('0x18')](0xcc)[_0x6fdf('0x19')]();});}};}function handleEntityNotFound(_0x281e6c,_0x1f7ae9){return function(_0x11d411){if(!_0x11d411){_0x281e6c[_0x6fdf('0x17')](0x194);}return _0x11d411;};}function handleError(_0x1693f8,_0x13a09c){_0x13a09c=_0x13a09c||0x1f4;return function(_0x217620){logger[_0x6fdf('0x22')](_0x217620[_0x6fdf('0x23')]);if(_0x217620[_0x6fdf('0x24')]){delete _0x217620[_0x6fdf('0x24')];}_0x1693f8['status'](_0x13a09c)['send'](_0x217620);};}exports[_0x6fdf('0x25')]=function(_0x1b93b6,_0xaeec9e){var _0x208813={},_0x14f61a={},_0x4d076c={'count':0x0,'rows':[]};var _0x1ac397=_[_0x6fdf('0x26')](db['ZendeskConfiguration'][_0x6fdf('0x27')],function(_0x5b7b5d){return{'name':_0x5b7b5d[_0x6fdf('0x28')],'type':_0x5b7b5d[_0x6fdf('0x29')]['key']};});_0x14f61a[_0x6fdf('0x2a')]=_['map'](_0x1ac397,_0x6fdf('0x24'));_0x14f61a[_0x6fdf('0x2b')]=_[_0x6fdf('0x2c')](_0x1b93b6['query']);_0x14f61a[_0x6fdf('0x2d')]=_[_0x6fdf('0x2e')](_0x14f61a[_0x6fdf('0x2a')],_0x14f61a[_0x6fdf('0x2b')]);_0x208813[_0x6fdf('0x2f')]=_[_0x6fdf('0x2e')](_0x14f61a[_0x6fdf('0x2a')],qs['fields'](_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x30')]));_0x208813[_0x6fdf('0x2f')]=_0x208813['attributes']['length']?_0x208813['attributes']:_0x14f61a['model'];if(!_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x31')](_0x6fdf('0x32'))){_0x208813[_0x6fdf('0x1d')]=qs['limit'](_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x1d')]);_0x208813[_0x6fdf('0x1c')]=qs[_0x6fdf('0x1c')](_0x1b93b6[_0x6fdf('0x2b')]['offset']);}_0x208813[_0x6fdf('0x33')]=qs[_0x6fdf('0x34')](_0x1b93b6[_0x6fdf('0x2b')]['sort']);_0x208813[_0x6fdf('0x35')]=qs['filters'](_[_0x6fdf('0x36')](_0x1b93b6[_0x6fdf('0x2b')],_0x14f61a[_0x6fdf('0x2d')]),_0x1ac397);if(_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x37')]){_0x208813['where']=_[_0x6fdf('0x38')](_0x208813[_0x6fdf('0x35')],{'$or':_[_0x6fdf('0x26')](_0x1ac397,function(_0x564ed4){if(_0x564ed4[_0x6fdf('0x29')]!==_0x6fdf('0x39')){var _0x2aa49a={};_0x2aa49a[_0x564ed4[_0x6fdf('0x24')]]={'$like':'%'+_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x37')]+'%'};return _0x2aa49a;}})});}_0x208813=_[_0x6fdf('0x38')]({},_0x208813,_0x1b93b6[_0x6fdf('0x3a')]);var _0x498c40={'where':_0x208813[_0x6fdf('0x35')]};return db['ZendeskConfiguration'][_0x6fdf('0x3b')](_0x498c40)[_0x6fdf('0x21')](function(_0x5e6cae){_0x4d076c[_0x6fdf('0x3b')]=_0x5e6cae;if(_0x1b93b6[_0x6fdf('0x2b')][_0x6fdf('0x3c')]){_0x208813[_0x6fdf('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x6fdf('0x3e')](_0x208813);})[_0x6fdf('0x21')](function(_0x5d3f35){_0x4d076c['rows']=_0x5d3f35;return _0x4d076c;})['then'](respondWithFilteredResult(_0xaeec9e,_0x208813))[_0x6fdf('0x3f')](handleError(_0xaeec9e,null));};exports[_0x6fdf('0x40')]=function(_0x950cb6,_0xf49ccb){var _0xcb7364={'raw':![],'where':{'id':_0x950cb6['params']['id']}},_0x3e226a={};_0x3e226a[_0x6fdf('0x2a')]=_[_0x6fdf('0x2c')](db['ZendeskConfiguration'][_0x6fdf('0x27')]);_0x3e226a[_0x6fdf('0x2b')]=_[_0x6fdf('0x2c')](_0x950cb6['query']);_0x3e226a[_0x6fdf('0x2d')]=_[_0x6fdf('0x2e')](_0x3e226a[_0x6fdf('0x2a')],_0x3e226a[_0x6fdf('0x2b')]);_0xcb7364[_0x6fdf('0x2f')]=_[_0x6fdf('0x2e')](_0x3e226a[_0x6fdf('0x2a')],qs['fields'](_0x950cb6[_0x6fdf('0x2b')]['fields']));_0xcb7364[_0x6fdf('0x2f')]=_0xcb7364[_0x6fdf('0x2f')][_0x6fdf('0x41')]?_0xcb7364[_0x6fdf('0x2f')]:_0x3e226a[_0x6fdf('0x2a')];if(_0x950cb6[_0x6fdf('0x2b')][_0x6fdf('0x3c')]){_0xcb7364[_0x6fdf('0x3d')]=[{'all':!![]}];}_0xcb7364=_['merge']({},_0xcb7364,_0x950cb6['options']);return db[_0x6fdf('0x42')][_0x6fdf('0x43')](_0xcb7364)[_0x6fdf('0x21')](handleEntityNotFound(_0xf49ccb,null))['then'](respondWithResult(_0xf49ccb,null))[_0x6fdf('0x3f')](handleError(_0xf49ccb,null));};exports[_0x6fdf('0x44')]=function(_0x298359,_0x2f2ad4){return db[_0x6fdf('0x42')][_0x6fdf('0x44')](_0x298359['body'],{})['then'](respondWithResult(_0x2f2ad4,0xc9))['catch'](handleError(_0x2f2ad4,null));};exports[_0x6fdf('0x20')]=function(_0xa15fdf,_0x23a5e3){if(_0xa15fdf['body']['id']){delete _0xa15fdf[_0x6fdf('0x45')]['id'];}return db['ZendeskConfiguration'][_0x6fdf('0x43')]({'where':{'id':_0xa15fdf[_0x6fdf('0x46')]['id']}})['then'](handleEntityNotFound(_0x23a5e3,null))[_0x6fdf('0x21')](saveUpdates(_0xa15fdf[_0x6fdf('0x45')],null))['then'](respondWithResult(_0x23a5e3,null))['catch'](handleError(_0x23a5e3,null));};exports[_0x6fdf('0x47')]=function(_0x23a869,_0x541874){return db['ZendeskConfiguration']['find']({'where':{'id':_0x23a869[_0x6fdf('0x46')]['id']}})[_0x6fdf('0x21')](handleEntityNotFound(_0x541874,null))['then'](removeEntity(_0x541874,null))[_0x6fdf('0x3f')](handleError(_0x541874,null));};exports[_0x6fdf('0x48')]=function(_0x3e6eec,_0x143e3a,_0x171b0a){var _0x1c730c={};var _0xf3b9a={};var _0x3c6d6a;var _0x2f147a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3e6eec['params']['id']}})[_0x6fdf('0x21')](handleEntityNotFound(_0x143e3a,null))['then'](function(_0x49b48f){if(_0x49b48f){_0x3c6d6a=_0x49b48f;_0xf3b9a['model']=_[_0x6fdf('0x2c')](db['ZendeskField'][_0x6fdf('0x27')]);_0xf3b9a['query']=_[_0x6fdf('0x2c')](_0x3e6eec[_0x6fdf('0x2b')]);_0xf3b9a['filters']=_[_0x6fdf('0x2e')](_0xf3b9a[_0x6fdf('0x2a')],_0xf3b9a[_0x6fdf('0x2b')]);_0x1c730c['attributes']=_[_0x6fdf('0x2e')](_0xf3b9a[_0x6fdf('0x2a')],qs[_0x6fdf('0x30')](_0x3e6eec[_0x6fdf('0x2b')][_0x6fdf('0x30')]));_0x1c730c[_0x6fdf('0x2f')]=_0x1c730c['attributes'][_0x6fdf('0x41')]?_0x1c730c[_0x6fdf('0x2f')]:_0xf3b9a[_0x6fdf('0x2a')];_0x1c730c[_0x6fdf('0x33')]=qs['sort'](_0x3e6eec[_0x6fdf('0x2b')]['sort']);_0x1c730c['where']=qs[_0x6fdf('0x2d')](_[_0x6fdf('0x36')](_0x3e6eec[_0x6fdf('0x2b')],_0xf3b9a['filters']));if(_0x3e6eec[_0x6fdf('0x2b')][_0x6fdf('0x37')]){_0x1c730c[_0x6fdf('0x35')]=_[_0x6fdf('0x38')](_0x1c730c[_0x6fdf('0x35')],{'$or':_['map'](_0x1c730c[_0x6fdf('0x2f')],function(_0x102523){var _0x38bff5={};_0x38bff5[_0x102523]={'$like':'%'+_0x3e6eec[_0x6fdf('0x2b')][_0x6fdf('0x37')]+'%'};return _0x38bff5;})});}_0x1c730c=_[_0x6fdf('0x38')]({},_0x1c730c,_0x3e6eec[_0x6fdf('0x3a')]);return _0x3c6d6a[_0x6fdf('0x48')](_0x1c730c);}})[_0x6fdf('0x21')](function(_0xae4e37){if(_0xae4e37){_0x2f147a=_0xae4e37[_0x6fdf('0x41')];if(!_0x3e6eec[_0x6fdf('0x2b')][_0x6fdf('0x31')](_0x6fdf('0x32'))){_0x1c730c['limit']=qs[_0x6fdf('0x1d')](_0x3e6eec['query'][_0x6fdf('0x1d')]);_0x1c730c[_0x6fdf('0x1c')]=qs['offset'](_0x3e6eec['query'][_0x6fdf('0x1c')]);}return _0x3c6d6a[_0x6fdf('0x48')](_0x1c730c);}})[_0x6fdf('0x21')](function(_0xff9d1a){if(_0xff9d1a){return _0xff9d1a?{'count':_0x2f147a,'rows':_0xff9d1a}:null;}})['then'](respondWithResult(_0x143e3a,null))[_0x6fdf('0x3f')](handleError(_0x143e3a,null));};exports['getSubjects']=function(_0x4b8cf0,_0x5b62b0,_0x4fe057){var _0x2d9f79={};var _0x468f25={};var _0x294ab5;var _0x273801;return db[_0x6fdf('0x42')][_0x6fdf('0x49')]({'where':{'id':_0x4b8cf0['params']['id']}})[_0x6fdf('0x21')](handleEntityNotFound(_0x5b62b0,null))[_0x6fdf('0x21')](function(_0x4b5e2f){if(_0x4b5e2f){_0x294ab5=_0x4b5e2f;_0x468f25[_0x6fdf('0x2a')]=_[_0x6fdf('0x2c')](db[_0x6fdf('0x4a')][_0x6fdf('0x27')]);_0x468f25[_0x6fdf('0x2b')]=_[_0x6fdf('0x2c')](_0x4b8cf0[_0x6fdf('0x2b')]);_0x468f25[_0x6fdf('0x2d')]=_['intersection'](_0x468f25[_0x6fdf('0x2a')],_0x468f25[_0x6fdf('0x2b')]);_0x2d9f79[_0x6fdf('0x2f')]=_[_0x6fdf('0x2e')](_0x468f25[_0x6fdf('0x2a')],qs['fields'](_0x4b8cf0['query'][_0x6fdf('0x30')]));_0x2d9f79['attributes']=_0x2d9f79[_0x6fdf('0x2f')][_0x6fdf('0x41')]?_0x2d9f79[_0x6fdf('0x2f')]:_0x468f25[_0x6fdf('0x2a')];_0x2d9f79['order']=qs['sort'](_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x34')]);_0x2d9f79[_0x6fdf('0x35')]=qs[_0x6fdf('0x2d')](_['pick'](_0x4b8cf0[_0x6fdf('0x2b')],_0x468f25['filters']));if(_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x37')]){_0x2d9f79[_0x6fdf('0x35')]=_['merge'](_0x2d9f79[_0x6fdf('0x35')],{'$or':_[_0x6fdf('0x26')](_0x2d9f79[_0x6fdf('0x2f')],function(_0x38b152){var _0x23c1d5={};_0x23c1d5[_0x38b152]={'$like':'%'+_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x37')]+'%'};return _0x23c1d5;})});}_0x2d9f79=_[_0x6fdf('0x38')]({},_0x2d9f79,_0x4b8cf0['options']);return _0x294ab5[_0x6fdf('0x4b')](_0x2d9f79);}})['then'](function(_0x25c39c){if(_0x25c39c){_0x273801=_0x25c39c[_0x6fdf('0x41')];if(!_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x31')](_0x6fdf('0x32'))){_0x2d9f79[_0x6fdf('0x1d')]=qs[_0x6fdf('0x1d')](_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x1d')]);_0x2d9f79[_0x6fdf('0x1c')]=qs['offset'](_0x4b8cf0[_0x6fdf('0x2b')][_0x6fdf('0x1c')]);}return _0x294ab5[_0x6fdf('0x4b')](_0x2d9f79);}})[_0x6fdf('0x21')](function(_0xd61e89){if(_0xd61e89){return _0xd61e89?{'count':_0x273801,'rows':_0xd61e89}:null;}})[_0x6fdf('0x21')](respondWithResult(_0x5b62b0,null))['catch'](handleError(_0x5b62b0,null));};exports['getDescriptions']=function(_0x5dd457,_0x505ca4,_0x495c2b){var _0x834885={};var _0x893cbe={};var _0x4a725e;var _0x47a551;return db['ZendeskConfiguration'][_0x6fdf('0x49')]({'where':{'id':_0x5dd457[_0x6fdf('0x46')]['id']}})[_0x6fdf('0x21')](handleEntityNotFound(_0x505ca4,null))[_0x6fdf('0x21')](function(_0x1afe53){if(_0x1afe53){_0x4a725e=_0x1afe53;_0x893cbe[_0x6fdf('0x2a')]=_[_0x6fdf('0x2c')](db[_0x6fdf('0x4a')][_0x6fdf('0x27')]);_0x893cbe[_0x6fdf('0x2b')]=_[_0x6fdf('0x2c')](_0x5dd457[_0x6fdf('0x2b')]);_0x893cbe[_0x6fdf('0x2d')]=_['intersection'](_0x893cbe[_0x6fdf('0x2a')],_0x893cbe[_0x6fdf('0x2b')]);_0x834885[_0x6fdf('0x2f')]=_['intersection'](_0x893cbe['model'],qs[_0x6fdf('0x30')](_0x5dd457['query']['fields']));_0x834885['attributes']=_0x834885[_0x6fdf('0x2f')][_0x6fdf('0x41')]?_0x834885[_0x6fdf('0x2f')]:_0x893cbe[_0x6fdf('0x2a')];_0x834885[_0x6fdf('0x33')]=qs['sort'](_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x34')]);_0x834885[_0x6fdf('0x35')]=qs[_0x6fdf('0x2d')](_['pick'](_0x5dd457['query'],_0x893cbe[_0x6fdf('0x2d')]));if(_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x37')]){_0x834885[_0x6fdf('0x35')]=_['merge'](_0x834885[_0x6fdf('0x35')],{'$or':_['map'](_0x834885[_0x6fdf('0x2f')],function(_0x4601b1){var _0x191b83={};_0x191b83[_0x4601b1]={'$like':'%'+_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x37')]+'%'};return _0x191b83;})});}_0x834885=_[_0x6fdf('0x38')]({},_0x834885,_0x5dd457['options']);return _0x4a725e[_0x6fdf('0x4c')](_0x834885);}})[_0x6fdf('0x21')](function(_0x5dd8b3){if(_0x5dd8b3){_0x47a551=_0x5dd8b3[_0x6fdf('0x41')];if(!_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x31')](_0x6fdf('0x32'))){_0x834885['limit']=qs[_0x6fdf('0x1d')](_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x1d')]);_0x834885[_0x6fdf('0x1c')]=qs['offset'](_0x5dd457[_0x6fdf('0x2b')][_0x6fdf('0x1c')]);}return _0x4a725e['getDescriptions'](_0x834885);}})[_0x6fdf('0x21')](function(_0xca9405){if(_0xca9405){return _0xca9405?{'count':_0x47a551,'rows':_0xca9405}:null;}})[_0x6fdf('0x21')](respondWithResult(_0x505ca4,null))[_0x6fdf('0x3f')](handleError(_0x505ca4,null));};exports[_0x6fdf('0x4d')]=function(_0x342b41,_0x410491,_0x3983e4){var _0x1535d1={};var _0x2ba8cd={};var _0xd0d4d2;var _0x3059f4;return db[_0x6fdf('0x42')][_0x6fdf('0x49')]({'where':{'id':_0x342b41[_0x6fdf('0x46')]['id']}})['then'](handleEntityNotFound(_0x410491,null))[_0x6fdf('0x21')](function(_0x1c160a){if(_0x1c160a){_0xd0d4d2=_0x1c160a;_0x2ba8cd['model']=_[_0x6fdf('0x2c')](db[_0x6fdf('0x4e')][_0x6fdf('0x27')]);_0x2ba8cd[_0x6fdf('0x2b')]=_[_0x6fdf('0x2c')](_0x342b41[_0x6fdf('0x2b')]);_0x2ba8cd[_0x6fdf('0x2d')]=_[_0x6fdf('0x2e')](_0x2ba8cd['model'],_0x2ba8cd[_0x6fdf('0x2b')]);_0x1535d1[_0x6fdf('0x2f')]=_[_0x6fdf('0x2e')](_0x2ba8cd[_0x6fdf('0x2a')],qs[_0x6fdf('0x30')](_0x342b41[_0x6fdf('0x2b')][_0x6fdf('0x30')]));_0x1535d1[_0x6fdf('0x2f')]=_0x1535d1[_0x6fdf('0x2f')][_0x6fdf('0x41')]?_0x1535d1[_0x6fdf('0x2f')]:_0x2ba8cd['model'];_0x1535d1[_0x6fdf('0x33')]=qs[_0x6fdf('0x34')](_0x342b41[_0x6fdf('0x2b')]['sort']);_0x1535d1['where']=qs[_0x6fdf('0x2d')](_['pick'](_0x342b41[_0x6fdf('0x2b')],_0x2ba8cd[_0x6fdf('0x2d')]));if(_0x342b41['query']['filter']){_0x1535d1['where']=_[_0x6fdf('0x38')](_0x1535d1[_0x6fdf('0x35')],{'$or':_[_0x6fdf('0x26')](_0x1535d1[_0x6fdf('0x2f')],function(_0x3f1d2c){var _0x218df9={};_0x218df9[_0x3f1d2c]={'$like':'%'+_0x342b41[_0x6fdf('0x2b')]['filter']+'%'};return _0x218df9;})});}_0x1535d1=_[_0x6fdf('0x38')]({},_0x1535d1,_0x342b41[_0x6fdf('0x3a')]);return _0xd0d4d2[_0x6fdf('0x4d')](_0x1535d1);}})['then'](function(_0x3f4b38){if(_0x3f4b38){_0x3059f4=_0x3f4b38[_0x6fdf('0x41')];if(!_0x342b41[_0x6fdf('0x2b')]['hasOwnProperty']('nolimit')){_0x1535d1['limit']=qs[_0x6fdf('0x1d')](_0x342b41[_0x6fdf('0x2b')][_0x6fdf('0x1d')]);_0x1535d1[_0x6fdf('0x1c')]=qs[_0x6fdf('0x1c')](_0x342b41[_0x6fdf('0x2b')]['offset']);}return _0xd0d4d2[_0x6fdf('0x4d')](_0x1535d1);}})['then'](function(_0x2c143d){if(_0x2c143d){return _0x2c143d?{'count':_0x3059f4,'rows':_0x2c143d}:null;}})[_0x6fdf('0x21')](respondWithResult(_0x410491,null))[_0x6fdf('0x3f')](handleError(_0x410491,null));};exports[_0x6fdf('0x4f')]=function(_0x1926eb,_0x14f27c,_0x6972c5){if(_0x1926eb[_0x6fdf('0x45')]['id']){delete _0x1926eb[_0x6fdf('0x45')]['id'];}return db['ZendeskConfiguration'][_0x6fdf('0x49')]({'where':{'id':_0x1926eb[_0x6fdf('0x46')]['id']}})[_0x6fdf('0x21')](handleEntityNotFound(_0x14f27c,null))[_0x6fdf('0x21')](function(_0x37572c){if(_0x37572c){return _0x37572c[_0x6fdf('0x4f')](_0x1926eb[_0x6fdf('0x45')][_0x6fdf('0x50')]||[]);}return null;})[_0x6fdf('0x21')](respondWithResult(_0x14f27c,null))['catch'](handleError(_0x14f27c,null));}; \ No newline at end of file +var _0x01c8=['getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','ZendeskField','getFields','findOne','getSubjects','getDescriptions','Tag'];(function(_0x388ac9,_0x32a4fa){var _0x4cd151=function(_0x503ad4){while(--_0x503ad4){_0x388ac9['push'](_0x388ac9['shift']());}};_0x4cd151(++_0x32a4fa);}(_0x01c8,0x153));var _0x801c=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x01c8[_0x43d11d];return _0x38cd08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x801c('0x0'));var jsonpatch=require(_0x801c('0x1'));var rp=require(_0x801c('0x2'));var moment=require('moment');var BPromise=require(_0x801c('0x3'));var Mustache=require(_0x801c('0x4'));var util=require(_0x801c('0x5'));var path=require(_0x801c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x801c('0x7'));var fs=require('fs');var fs_extra=require(_0x801c('0x8'));var _=require(_0x801c('0x9'));var squel=require(_0x801c('0xa'));var crypto=require('crypto');var jsforce=require(_0x801c('0xb'));var deskjs=require(_0x801c('0xc'));var toCsv=require(_0x801c('0xd'));var querystring=require(_0x801c('0xe'));var Papa=require('papaparse');var Redis=require(_0x801c('0xf'));var authService=require(_0x801c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x801c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x801c('0x12'))(_0x801c('0x13'));var utils=require(_0x801c('0x14'));var config=require(_0x801c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x801c('0x16'))['db'];function respondWithStatusCode(_0x2647d3,_0x3988fe){_0x3988fe=_0x3988fe||0xcc;return function(_0x113edb){if(_0x113edb){return _0x2647d3[_0x801c('0x17')](_0x3988fe);}return _0x2647d3[_0x801c('0x18')](_0x3988fe)['end']();};}function respondWithResult(_0x23d91e,_0xa76d32){_0xa76d32=_0xa76d32||0xc8;return function(_0x3b8f61){if(_0x3b8f61){return _0x23d91e[_0x801c('0x18')](_0xa76d32)[_0x801c('0x19')](_0x3b8f61);}};}function respondWithFilteredResult(_0x19ff68,_0x3c2366){return function(_0x9142ac){if(_0x9142ac){var _0x15aa34=typeof _0x3c2366[_0x801c('0x1a')]===_0x801c('0x1b')&&typeof _0x3c2366[_0x801c('0x1c')]==='undefined';var _0x403227=_0x9142ac[_0x801c('0x1d')];var _0x58f149=_0x15aa34?0x0:_0x3c2366[_0x801c('0x1a')];var _0x73149f=_0x15aa34?_0x9142ac[_0x801c('0x1d')]:_0x3c2366[_0x801c('0x1a')]+_0x3c2366['limit'];var _0x8510be;if(_0x73149f>=_0x403227){_0x73149f=_0x403227;_0x8510be=0xc8;}else{_0x8510be=0xce;}_0x19ff68[_0x801c('0x18')](_0x8510be);return _0x19ff68['set']('Content-Range',_0x58f149+'-'+_0x73149f+'/'+_0x403227)[_0x801c('0x19')](_0x9142ac);}return null;};}function patchUpdates(_0x47af8e){return function(_0xf3648e){try{jsonpatch[_0x801c('0x1e')](_0xf3648e,_0x47af8e,!![]);}catch(_0x46aa4f){return BPromise[_0x801c('0x1f')](_0x46aa4f);}return _0xf3648e[_0x801c('0x20')]();};}function saveUpdates(_0x3eb3dc,_0x2bf659){return function(_0x493887){if(_0x493887){return _0x493887[_0x801c('0x21')](_0x3eb3dc)['then'](function(_0x236ceb){return _0x236ceb;});}return null;};}function removeEntity(_0x21a144,_0x55e7b4){return function(_0x1a517b){if(_0x1a517b){return _0x1a517b[_0x801c('0x22')]()[_0x801c('0x23')](function(){_0x21a144['status'](0xcc)[_0x801c('0x24')]();});}};}function handleEntityNotFound(_0x235397,_0x29bead){return function(_0xe6620d){if(!_0xe6620d){_0x235397[_0x801c('0x17')](0x194);}return _0xe6620d;};}function handleError(_0x3c99bc,_0xf79c9a){_0xf79c9a=_0xf79c9a||0x1f4;return function(_0x462efb){logger[_0x801c('0x25')](_0x462efb[_0x801c('0x26')]);if(_0x462efb[_0x801c('0x27')]){delete _0x462efb['name'];}_0x3c99bc[_0x801c('0x18')](_0xf79c9a)[_0x801c('0x28')](_0x462efb);};}exports[_0x801c('0x29')]=function(_0x6f1165,_0x2441ac){var _0x5d7d7d={},_0x182060={},_0x5dbefe={'count':0x0,'rows':[]};var _0x447ee2=_['map'](db[_0x801c('0x2a')][_0x801c('0x2b')],function(_0x313b3c){return{'name':_0x313b3c['fieldName'],'type':_0x313b3c[_0x801c('0x2c')][_0x801c('0x2d')]};});_0x182060[_0x801c('0x2e')]=_[_0x801c('0x2f')](_0x447ee2,'name');_0x182060[_0x801c('0x30')]=_[_0x801c('0x31')](_0x6f1165[_0x801c('0x30')]);_0x182060['filters']=_[_0x801c('0x32')](_0x182060[_0x801c('0x2e')],_0x182060[_0x801c('0x30')]);_0x5d7d7d[_0x801c('0x33')]=_['intersection'](_0x182060[_0x801c('0x2e')],qs[_0x801c('0x34')](_0x6f1165[_0x801c('0x30')][_0x801c('0x34')]));_0x5d7d7d[_0x801c('0x33')]=_0x5d7d7d[_0x801c('0x33')][_0x801c('0x35')]?_0x5d7d7d[_0x801c('0x33')]:_0x182060[_0x801c('0x2e')];if(!_0x6f1165['query'][_0x801c('0x36')](_0x801c('0x37'))){_0x5d7d7d[_0x801c('0x1c')]=qs[_0x801c('0x1c')](_0x6f1165[_0x801c('0x30')]['limit']);_0x5d7d7d['offset']=qs[_0x801c('0x1a')](_0x6f1165['query']['offset']);}_0x5d7d7d[_0x801c('0x38')]=qs[_0x801c('0x39')](_0x6f1165[_0x801c('0x30')][_0x801c('0x39')]);_0x5d7d7d['where']=qs['filters'](_[_0x801c('0x3a')](_0x6f1165['query'],_0x182060[_0x801c('0x3b')]),_0x447ee2);if(_0x6f1165[_0x801c('0x30')][_0x801c('0x3c')]){_0x5d7d7d[_0x801c('0x3d')]=_[_0x801c('0x3e')](_0x5d7d7d[_0x801c('0x3d')],{'$or':_['map'](_0x447ee2,function(_0x54101e){if(_0x54101e[_0x801c('0x2c')]!==_0x801c('0x3f')){var _0x4aa16d={};_0x4aa16d[_0x54101e[_0x801c('0x27')]]={'$like':'%'+_0x6f1165[_0x801c('0x30')][_0x801c('0x3c')]+'%'};return _0x4aa16d;}})});}_0x5d7d7d=_[_0x801c('0x3e')]({},_0x5d7d7d,_0x6f1165[_0x801c('0x40')]);var _0x248e87={'where':_0x5d7d7d[_0x801c('0x3d')]};return db['ZendeskConfiguration'][_0x801c('0x1d')](_0x248e87)[_0x801c('0x23')](function(_0x430b15){_0x5dbefe[_0x801c('0x1d')]=_0x430b15;if(_0x6f1165[_0x801c('0x30')][_0x801c('0x41')]){_0x5d7d7d['include']=[{'all':!![]}];}return db[_0x801c('0x2a')][_0x801c('0x42')](_0x5d7d7d);})[_0x801c('0x23')](function(_0x4b718b){_0x5dbefe[_0x801c('0x43')]=_0x4b718b;return _0x5dbefe;})[_0x801c('0x23')](respondWithFilteredResult(_0x2441ac,_0x5d7d7d))[_0x801c('0x44')](handleError(_0x2441ac,null));};exports[_0x801c('0x45')]=function(_0x5528d3,_0x2c292b){var _0x360f67={'raw':![],'where':{'id':_0x5528d3[_0x801c('0x46')]['id']}},_0x3f16bc={};_0x3f16bc[_0x801c('0x2e')]=_[_0x801c('0x31')](db[_0x801c('0x2a')][_0x801c('0x2b')]);_0x3f16bc[_0x801c('0x30')]=_[_0x801c('0x31')](_0x5528d3['query']);_0x3f16bc[_0x801c('0x3b')]=_[_0x801c('0x32')](_0x3f16bc[_0x801c('0x2e')],_0x3f16bc[_0x801c('0x30')]);_0x360f67[_0x801c('0x33')]=_[_0x801c('0x32')](_0x3f16bc[_0x801c('0x2e')],qs[_0x801c('0x34')](_0x5528d3['query'][_0x801c('0x34')]));_0x360f67['attributes']=_0x360f67[_0x801c('0x33')][_0x801c('0x35')]?_0x360f67[_0x801c('0x33')]:_0x3f16bc['model'];if(_0x5528d3[_0x801c('0x30')][_0x801c('0x41')]){_0x360f67[_0x801c('0x47')]=[{'all':!![]}];}_0x360f67=_['merge']({},_0x360f67,_0x5528d3[_0x801c('0x40')]);return db[_0x801c('0x2a')]['find'](_0x360f67)[_0x801c('0x23')](handleEntityNotFound(_0x2c292b,null))[_0x801c('0x23')](respondWithResult(_0x2c292b,null))[_0x801c('0x44')](handleError(_0x2c292b,null));};exports[_0x801c('0x48')]=function(_0x4cff2c,_0x10b99b){return db[_0x801c('0x2a')][_0x801c('0x48')](_0x4cff2c[_0x801c('0x49')],{})[_0x801c('0x23')](respondWithResult(_0x10b99b,0xc9))[_0x801c('0x44')](handleError(_0x10b99b,null));};exports[_0x801c('0x21')]=function(_0x40130d,_0x5a53db){if(_0x40130d[_0x801c('0x49')]['id']){delete _0x40130d[_0x801c('0x49')]['id'];}return db['ZendeskConfiguration'][_0x801c('0x4a')]({'where':{'id':_0x40130d[_0x801c('0x46')]['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x5a53db,null))[_0x801c('0x23')](saveUpdates(_0x40130d[_0x801c('0x49')],null))[_0x801c('0x23')](respondWithResult(_0x5a53db,null))['catch'](handleError(_0x5a53db,null));};exports[_0x801c('0x22')]=function(_0x3ae93d,_0x370aa9){return db[_0x801c('0x2a')][_0x801c('0x4a')]({'where':{'id':_0x3ae93d[_0x801c('0x46')]['id']}})['then'](handleEntityNotFound(_0x370aa9,null))['then'](removeEntity(_0x370aa9,null))['catch'](handleError(_0x370aa9,null));};exports['getFields']=function(_0x5456e0,_0x4071b1,_0x1d168a){var _0x54bf23={};var _0x2790e5={};var _0x2118c1;var _0x2a8db9;return db[_0x801c('0x2a')]['findOne']({'where':{'id':_0x5456e0['params']['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x4071b1,null))[_0x801c('0x23')](function(_0x378aeb){if(_0x378aeb){_0x2118c1=_0x378aeb;_0x2790e5['model']=_[_0x801c('0x31')](db[_0x801c('0x4b')][_0x801c('0x2b')]);_0x2790e5[_0x801c('0x30')]=_['keys'](_0x5456e0[_0x801c('0x30')]);_0x2790e5[_0x801c('0x3b')]=_['intersection'](_0x2790e5[_0x801c('0x2e')],_0x2790e5[_0x801c('0x30')]);_0x54bf23[_0x801c('0x33')]=_[_0x801c('0x32')](_0x2790e5[_0x801c('0x2e')],qs[_0x801c('0x34')](_0x5456e0[_0x801c('0x30')][_0x801c('0x34')]));_0x54bf23[_0x801c('0x33')]=_0x54bf23[_0x801c('0x33')][_0x801c('0x35')]?_0x54bf23[_0x801c('0x33')]:_0x2790e5[_0x801c('0x2e')];_0x54bf23['order']=qs[_0x801c('0x39')](_0x5456e0[_0x801c('0x30')]['sort']);_0x54bf23[_0x801c('0x3d')]=qs[_0x801c('0x3b')](_[_0x801c('0x3a')](_0x5456e0[_0x801c('0x30')],_0x2790e5[_0x801c('0x3b')]));if(_0x5456e0[_0x801c('0x30')][_0x801c('0x3c')]){_0x54bf23[_0x801c('0x3d')]=_['merge'](_0x54bf23[_0x801c('0x3d')],{'$or':_[_0x801c('0x2f')](_0x54bf23[_0x801c('0x33')],function(_0x31972d){var _0x3882d6={};_0x3882d6[_0x31972d]={'$like':'%'+_0x5456e0[_0x801c('0x30')][_0x801c('0x3c')]+'%'};return _0x3882d6;})});}_0x54bf23=_[_0x801c('0x3e')]({},_0x54bf23,_0x5456e0[_0x801c('0x40')]);return _0x2118c1['getFields'](_0x54bf23);}})[_0x801c('0x23')](function(_0x3e5e7e){if(_0x3e5e7e){_0x2a8db9=_0x3e5e7e[_0x801c('0x35')];if(!_0x5456e0['query'][_0x801c('0x36')](_0x801c('0x37'))){_0x54bf23[_0x801c('0x1c')]=qs['limit'](_0x5456e0[_0x801c('0x30')]['limit']);_0x54bf23[_0x801c('0x1a')]=qs[_0x801c('0x1a')](_0x5456e0['query']['offset']);}return _0x2118c1[_0x801c('0x4c')](_0x54bf23);}})[_0x801c('0x23')](function(_0x1722ca){if(_0x1722ca){return _0x1722ca?{'count':_0x2a8db9,'rows':_0x1722ca}:null;}})[_0x801c('0x23')](respondWithResult(_0x4071b1,null))[_0x801c('0x44')](handleError(_0x4071b1,null));};exports['getSubjects']=function(_0x55161f,_0x339b83,_0x321078){var _0x22766b={};var _0x1db070={};var _0x54124a;var _0x29c1f9;return db[_0x801c('0x2a')][_0x801c('0x4d')]({'where':{'id':_0x55161f[_0x801c('0x46')]['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x339b83,null))['then'](function(_0x3c58cb){if(_0x3c58cb){_0x54124a=_0x3c58cb;_0x1db070[_0x801c('0x2e')]=_[_0x801c('0x31')](db[_0x801c('0x4b')][_0x801c('0x2b')]);_0x1db070[_0x801c('0x30')]=_[_0x801c('0x31')](_0x55161f[_0x801c('0x30')]);_0x1db070[_0x801c('0x3b')]=_[_0x801c('0x32')](_0x1db070[_0x801c('0x2e')],_0x1db070[_0x801c('0x30')]);_0x22766b[_0x801c('0x33')]=_[_0x801c('0x32')](_0x1db070[_0x801c('0x2e')],qs[_0x801c('0x34')](_0x55161f[_0x801c('0x30')][_0x801c('0x34')]));_0x22766b['attributes']=_0x22766b[_0x801c('0x33')][_0x801c('0x35')]?_0x22766b[_0x801c('0x33')]:_0x1db070['model'];_0x22766b[_0x801c('0x38')]=qs[_0x801c('0x39')](_0x55161f['query']['sort']);_0x22766b[_0x801c('0x3d')]=qs['filters'](_[_0x801c('0x3a')](_0x55161f[_0x801c('0x30')],_0x1db070['filters']));if(_0x55161f[_0x801c('0x30')][_0x801c('0x3c')]){_0x22766b[_0x801c('0x3d')]=_[_0x801c('0x3e')](_0x22766b['where'],{'$or':_[_0x801c('0x2f')](_0x22766b[_0x801c('0x33')],function(_0x4e5186){var _0x378186={};_0x378186[_0x4e5186]={'$like':'%'+_0x55161f[_0x801c('0x30')]['filter']+'%'};return _0x378186;})});}_0x22766b=_['merge']({},_0x22766b,_0x55161f[_0x801c('0x40')]);return _0x54124a[_0x801c('0x4e')](_0x22766b);}})[_0x801c('0x23')](function(_0x3a6d2b){if(_0x3a6d2b){_0x29c1f9=_0x3a6d2b[_0x801c('0x35')];if(!_0x55161f['query']['hasOwnProperty'](_0x801c('0x37'))){_0x22766b[_0x801c('0x1c')]=qs[_0x801c('0x1c')](_0x55161f[_0x801c('0x30')][_0x801c('0x1c')]);_0x22766b[_0x801c('0x1a')]=qs[_0x801c('0x1a')](_0x55161f[_0x801c('0x30')][_0x801c('0x1a')]);}return _0x54124a[_0x801c('0x4e')](_0x22766b);}})[_0x801c('0x23')](function(_0x50582c){if(_0x50582c){return _0x50582c?{'count':_0x29c1f9,'rows':_0x50582c}:null;}})[_0x801c('0x23')](respondWithResult(_0x339b83,null))[_0x801c('0x44')](handleError(_0x339b83,null));};exports['getDescriptions']=function(_0x3763e9,_0x3713a5,_0x43b34a){var _0x51af08={};var _0x397194={};var _0x45c629;var _0x22db3d;return db[_0x801c('0x2a')][_0x801c('0x4d')]({'where':{'id':_0x3763e9[_0x801c('0x46')]['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x3713a5,null))[_0x801c('0x23')](function(_0x46a672){if(_0x46a672){_0x45c629=_0x46a672;_0x397194[_0x801c('0x2e')]=_[_0x801c('0x31')](db[_0x801c('0x4b')][_0x801c('0x2b')]);_0x397194['query']=_['keys'](_0x3763e9[_0x801c('0x30')]);_0x397194[_0x801c('0x3b')]=_[_0x801c('0x32')](_0x397194['model'],_0x397194[_0x801c('0x30')]);_0x51af08['attributes']=_[_0x801c('0x32')](_0x397194[_0x801c('0x2e')],qs['fields'](_0x3763e9[_0x801c('0x30')][_0x801c('0x34')]));_0x51af08[_0x801c('0x33')]=_0x51af08[_0x801c('0x33')][_0x801c('0x35')]?_0x51af08['attributes']:_0x397194[_0x801c('0x2e')];_0x51af08[_0x801c('0x38')]=qs[_0x801c('0x39')](_0x3763e9[_0x801c('0x30')][_0x801c('0x39')]);_0x51af08['where']=qs['filters'](_[_0x801c('0x3a')](_0x3763e9[_0x801c('0x30')],_0x397194[_0x801c('0x3b')]));if(_0x3763e9[_0x801c('0x30')][_0x801c('0x3c')]){_0x51af08[_0x801c('0x3d')]=_[_0x801c('0x3e')](_0x51af08['where'],{'$or':_[_0x801c('0x2f')](_0x51af08[_0x801c('0x33')],function(_0x4178fa){var _0x465127={};_0x465127[_0x4178fa]={'$like':'%'+_0x3763e9[_0x801c('0x30')][_0x801c('0x3c')]+'%'};return _0x465127;})});}_0x51af08=_[_0x801c('0x3e')]({},_0x51af08,_0x3763e9['options']);return _0x45c629[_0x801c('0x4f')](_0x51af08);}})['then'](function(_0x45eb14){if(_0x45eb14){_0x22db3d=_0x45eb14[_0x801c('0x35')];if(!_0x3763e9[_0x801c('0x30')][_0x801c('0x36')](_0x801c('0x37'))){_0x51af08['limit']=qs[_0x801c('0x1c')](_0x3763e9[_0x801c('0x30')][_0x801c('0x1c')]);_0x51af08[_0x801c('0x1a')]=qs[_0x801c('0x1a')](_0x3763e9[_0x801c('0x30')][_0x801c('0x1a')]);}return _0x45c629[_0x801c('0x4f')](_0x51af08);}})['then'](function(_0x5b2886){if(_0x5b2886){return _0x5b2886?{'count':_0x22db3d,'rows':_0x5b2886}:null;}})[_0x801c('0x23')](respondWithResult(_0x3713a5,null))[_0x801c('0x44')](handleError(_0x3713a5,null));};exports['getTags']=function(_0x3b433d,_0x570645,_0xdbef30){var _0x31613f={};var _0x3ab54f={};var _0x151dea;var _0x1bd764;return db[_0x801c('0x2a')][_0x801c('0x4d')]({'where':{'id':_0x3b433d['params']['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x570645,null))[_0x801c('0x23')](function(_0x5f4143){if(_0x5f4143){_0x151dea=_0x5f4143;_0x3ab54f[_0x801c('0x2e')]=_[_0x801c('0x31')](db[_0x801c('0x50')][_0x801c('0x2b')]);_0x3ab54f[_0x801c('0x30')]=_['keys'](_0x3b433d[_0x801c('0x30')]);_0x3ab54f[_0x801c('0x3b')]=_[_0x801c('0x32')](_0x3ab54f['model'],_0x3ab54f[_0x801c('0x30')]);_0x31613f['attributes']=_[_0x801c('0x32')](_0x3ab54f[_0x801c('0x2e')],qs[_0x801c('0x34')](_0x3b433d['query'][_0x801c('0x34')]));_0x31613f[_0x801c('0x33')]=_0x31613f['attributes'][_0x801c('0x35')]?_0x31613f[_0x801c('0x33')]:_0x3ab54f[_0x801c('0x2e')];_0x31613f[_0x801c('0x38')]=qs['sort'](_0x3b433d[_0x801c('0x30')]['sort']);_0x31613f[_0x801c('0x3d')]=qs['filters'](_[_0x801c('0x3a')](_0x3b433d[_0x801c('0x30')],_0x3ab54f[_0x801c('0x3b')]));if(_0x3b433d['query'][_0x801c('0x3c')]){_0x31613f['where']=_[_0x801c('0x3e')](_0x31613f['where'],{'$or':_[_0x801c('0x2f')](_0x31613f['attributes'],function(_0x45bb03){var _0x10977b={};_0x10977b[_0x45bb03]={'$like':'%'+_0x3b433d[_0x801c('0x30')][_0x801c('0x3c')]+'%'};return _0x10977b;})});}_0x31613f=_['merge']({},_0x31613f,_0x3b433d[_0x801c('0x40')]);return _0x151dea[_0x801c('0x51')](_0x31613f);}})['then'](function(_0x1b2e31){if(_0x1b2e31){_0x1bd764=_0x1b2e31[_0x801c('0x35')];if(!_0x3b433d[_0x801c('0x30')][_0x801c('0x36')](_0x801c('0x37'))){_0x31613f[_0x801c('0x1c')]=qs['limit'](_0x3b433d[_0x801c('0x30')]['limit']);_0x31613f[_0x801c('0x1a')]=qs[_0x801c('0x1a')](_0x3b433d[_0x801c('0x30')]['offset']);}return _0x151dea[_0x801c('0x51')](_0x31613f);}})[_0x801c('0x23')](function(_0x549fcf){if(_0x549fcf){return _0x549fcf?{'count':_0x1bd764,'rows':_0x549fcf}:null;}})[_0x801c('0x23')](respondWithResult(_0x570645,null))[_0x801c('0x44')](handleError(_0x570645,null));};exports['setTags']=function(_0x1ff250,_0x13c453,_0x426ab8){if(_0x1ff250[_0x801c('0x49')]['id']){delete _0x1ff250[_0x801c('0x49')]['id'];}return db[_0x801c('0x2a')][_0x801c('0x4d')]({'where':{'id':_0x1ff250[_0x801c('0x46')]['id']}})[_0x801c('0x23')](handleEntityNotFound(_0x13c453,null))[_0x801c('0x23')](function(_0x24e98e){if(_0x24e98e){return _0x24e98e[_0x801c('0x52')](_0x1ff250['body'][_0x801c('0x53')]||[]);}return null;})['then'](respondWithResult(_0x13c453,null))['catch'](handleError(_0x13c453,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 851fc6a..efb51b1 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 _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x5d1ca7,_0x40be3c){var _0x1448f6=function(_0x1189b5){while(--_0x1189b5){_0x5d1ca7['push'](_0x5d1ca7['shift']());}};_0x1448f6(++_0x40be3c);}(_0x056b,0xb6));var _0xb056=function(_0x3c0b76,_0x170065){_0x3c0b76=_0x3c0b76-0x0;var _0x51906d=_0x056b[_0x3c0b76];return _0x51906d;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x51f9a2,_0x19086b){var _0x49998c=function(_0x323d54){while(--_0x323d54){_0x51f9a2['push'](_0x51f9a2['shift']());}};_0x49998c(++_0x19086b);}(_0x80ed,0x11c));var _0xd80e=function(_0x397545,_0x2fedc5){_0x397545=_0x397545-0x0;var _0x397f52=_0x80ed[_0x397545];return _0x397f52;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('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 91617a8..ae9f40c 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 _0x1723=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x1723,0xff));var _0x3172=function(_0x242359,_0x47a22a){_0x242359=_0x242359-0x0;var _0x2da7a1=_0x1723[_0x242359];return _0x2da7a1;};'use strict';var _=require(_0x3172('0x0'));var util=require(_0x3172('0x1'));var moment=require(_0x3172('0x2'));var BPromise=require(_0x3172('0x3'));var rs=require(_0x3172('0x4'));var fs=require('fs');var Redis=require(_0x3172('0x5'));var db=require(_0x3172('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3172('0x7'))(_0x3172('0x8'));var config=require(_0x3172('0x9'));var jayson=require(_0x3172('0xa'));var client=jayson[_0x3172('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf3bd,_0x123c2d,_0x5d25fe){return new BPromise(function(_0x1b6d33,_0x503be8){return client[_0x3172('0xc')](_0x2cf3bd,_0x5d25fe)[_0x3172('0xd')](function(_0xa366e6){logger['info'](_0x3172('0xe'),_0x123c2d,_0x3172('0xf'));logger['debug'](_0x3172('0x10'),_0x123c2d,_0x3172('0xf'),JSON[_0x3172('0x11')](_0xa366e6));if(_0xa366e6[_0x3172('0x12')]){if(_0xa366e6[_0x3172('0x12')][_0x3172('0x13')]===0x1f4){logger[_0x3172('0x12')](_0x3172('0xe'),_0x123c2d,_0xa366e6[_0x3172('0x12')][_0x3172('0x14')]);return _0x503be8(_0xa366e6[_0x3172('0x12')][_0x3172('0x14')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x123c2d,_0xa366e6['error'][_0x3172('0x14')]);return _0x1b6d33(_0xa366e6[_0x3172('0x12')][_0x3172('0x14')]);}else{logger[_0x3172('0x15')](_0x3172('0xe'),_0x123c2d,_0x3172('0xf'));_0x1b6d33(_0xa366e6[_0x3172('0x16')][_0x3172('0x14')]);}})['catch'](function(_0x38a56b){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x123c2d,_0x38a56b);_0x503be8(_0x38a56b);});});} \ No newline at end of file +var _0x8f4a=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x53b900,_0x39e38d){var _0x4ce320=function(_0x45a756){while(--_0x45a756){_0x53b900['push'](_0x53b900['shift']());}};_0x4ce320(++_0x39e38d);}(_0x8f4a,0x102));var _0xa8f4=function(_0x17c585,_0x2893fb){_0x17c585=_0x17c585-0x0;var _0x157fb9=_0x8f4a[_0x17c585];return _0x157fb9;};'use strict';var _=require(_0xa8f4('0x0'));var util=require(_0xa8f4('0x1'));var moment=require('moment');var BPromise=require(_0xa8f4('0x2'));var rs=require(_0xa8f4('0x3'));var fs=require('fs');var Redis=require(_0xa8f4('0x4'));var db=require(_0xa8f4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8f4('0x6'))(_0xa8f4('0x7'));var config=require(_0xa8f4('0x8'));var jayson=require(_0xa8f4('0x9'));var client=jayson[_0xa8f4('0xa')][_0xa8f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x243d86,_0x4aedc3,_0x41da9d){return new BPromise(function(_0x53b88b,_0x48f94b){return client[_0xa8f4('0xc')](_0x243d86,_0x41da9d)[_0xa8f4('0xd')](function(_0x358438){logger[_0xa8f4('0xe')](_0xa8f4('0xf'),_0x4aedc3,_0xa8f4('0x10'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4aedc3,'request\x20sent',JSON['stringify'](_0x358438));if(_0x358438[_0xa8f4('0x11')]){if(_0x358438[_0xa8f4('0x11')]['code']===0x1f4){logger['error'](_0xa8f4('0xf'),_0x4aedc3,_0x358438[_0xa8f4('0x11')][_0xa8f4('0x12')]);return _0x48f94b(_0x358438[_0xa8f4('0x11')][_0xa8f4('0x12')]);}logger[_0xa8f4('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4aedc3,_0x358438[_0xa8f4('0x11')]['message']);return _0x53b88b(_0x358438[_0xa8f4('0x11')]['message']);}else{logger[_0xa8f4('0xe')](_0xa8f4('0xf'),_0x4aedc3,_0xa8f4('0x10'));_0x53b88b(_0x358438[_0xa8f4('0x13')][_0xa8f4('0x12')]);}})[_0xa8f4('0x14')](function(_0x351fef){logger[_0xa8f4('0x11')](_0xa8f4('0xf'),_0x4aedc3,_0x351fef);_0x48f94b(_0x351fef);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 9361fcd..f618fac 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 _0x33f4=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0x33f4,0x11e));var _0x433f=function(_0x28c4e0,_0x52c9b0){_0x28c4e0=_0x28c4e0-0x0;var _0x233b1a=_0x33f4[_0x28c4e0];return _0x233b1a;};'use strict';var multer=require(_0x433f('0x0'));var util=require(_0x433f('0x1'));var path=require(_0x433f('0x2'));var timeout=require(_0x433f('0x3'));var express=require(_0x433f('0x4'));var router=express[_0x433f('0x5')]();var fs_extra=require(_0x433f('0x6'));var auth=require(_0x433f('0x7'));var interaction=require(_0x433f('0x8'));var config=require(_0x433f('0x9'));var controller=require(_0x433f('0xa'));router[_0x433f('0xb')]('/',auth[_0x433f('0xc')](),controller[_0x433f('0xd')]);router[_0x433f('0xb')](_0x433f('0xe'),auth[_0x433f('0xc')](),controller[_0x433f('0xf')]);router[_0x433f('0x10')]('/',auth[_0x433f('0xc')](),controller[_0x433f('0x11')]);router[_0x433f('0x12')](_0x433f('0xe'),auth[_0x433f('0xc')](),controller['update']);router[_0x433f('0x13')](_0x433f('0xe'),auth[_0x433f('0xc')](),controller[_0x433f('0x14')]);module[_0x433f('0x15')]=router; \ No newline at end of file +var _0xa3ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','show','create','put','update','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x463255,_0x579491){var _0x4cb0a7=function(_0x4fd385){while(--_0x4fd385){_0x463255['push'](_0x463255['shift']());}};_0x4cb0a7(++_0x579491);}(_0xa3ca,0x152));var _0xaa3c=function(_0x7afae5,_0x555945){_0x7afae5=_0x7afae5-0x0;var _0x2a76e7=_0xa3ca[_0x7afae5];return _0x2a76e7;};'use strict';var multer=require('multer');var util=require(_0xaa3c('0x0'));var path=require(_0xaa3c('0x1'));var timeout=require(_0xaa3c('0x2'));var express=require(_0xaa3c('0x3'));var router=express[_0xaa3c('0x4')]();var fs_extra=require(_0xaa3c('0x5'));var auth=require(_0xaa3c('0x6'));var interaction=require(_0xaa3c('0x7'));var config=require(_0xaa3c('0x8'));var controller=require(_0xaa3c('0x9'));router['get']('/',auth[_0xaa3c('0xa')](),controller[_0xaa3c('0xb')]);router['get']('/:id',auth[_0xaa3c('0xa')](),controller[_0xaa3c('0xc')]);router['post']('/',auth[_0xaa3c('0xa')](),controller[_0xaa3c('0xd')]);router[_0xaa3c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xaa3c('0xf')]);router['delete'](_0xaa3c('0x10'),auth[_0xaa3c('0xa')](),controller[_0xaa3c('0x11')]);module[_0xaa3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5d4fdf8..71632c6 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 _0x3c82=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c82,0x1be));var _0x23c8=function(_0xb49cb8,_0x39474b){_0xb49cb8=_0xb49cb8-0x0;var _0x879ead=_0x3c82[_0xb49cb8];return _0x879ead;};'use strict';var Sequelize=require(_0x23c8('0x0'));module[_0x23c8('0x1')]={'type':{'type':Sequelize[_0x23c8('0x2')](_0x23c8('0x3'),_0x23c8('0x4'),_0x23c8('0x5'),_0x23c8('0x6'),_0x23c8('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23c8('0x8')]},'key':{'type':Sequelize[_0x23c8('0x8')]},'keyType':{'type':Sequelize[_0x23c8('0x2')]('string','variable',_0x23c8('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x23c8('0x8')]},'nameField':{'type':Sequelize[_0x23c8('0x8')]},'customField':{'type':Sequelize[_0x23c8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23c8('0x8')]}}; \ No newline at end of file +var _0xffdd=['variable','BOOLEAN','ENUM','string','customVariable','STRING'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xffdd,0x152));var _0xdffd=function(_0x1ad148,_0x3d6142){_0x1ad148=_0x1ad148-0x0;var _0x1d62ba=_0xffdd[_0x1ad148];return _0x1d62ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xdffd('0x0')](_0xdffd('0x1'),'variable',_0xdffd('0x2'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdffd('0x3')]},'key':{'type':Sequelize[_0xdffd('0x3')]},'keyType':{'type':Sequelize[_0xdffd('0x0')](_0xdffd('0x1'),_0xdffd('0x4'),_0xdffd('0x2'))},'keyContent':{'type':Sequelize[_0xdffd('0x3')]},'idField':{'type':Sequelize[_0xdffd('0x3')]},'nameField':{'type':Sequelize[_0xdffd('0x3')]},'customField':{'type':Sequelize[_0xdffd('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b881c49..314577c 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 _0x0bc1=['jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x45d64a,_0x15dc71){_0x45d64a=_0x45d64a-0x0;var _0xfbcb1=_0x0bc1[_0x45d64a];return _0xfbcb1;};'use strict';var emlformat=require(_0x10bc('0x0'));var rimraf=require(_0x10bc('0x1'));var zipdir=require(_0x10bc('0x2'));var jsonpatch=require(_0x10bc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x10bc('0x4'));var Mustache=require(_0x10bc('0x5'));var util=require(_0x10bc('0x6'));var path=require(_0x10bc('0x7'));var sox=require(_0x10bc('0x8'));var csv=require('to-csv');var ejs=require(_0x10bc('0x9'));var fs=require('fs');var fs_extra=require(_0x10bc('0xa'));var _=require(_0x10bc('0xb'));var squel=require(_0x10bc('0xc'));var crypto=require(_0x10bc('0xd'));var jsforce=require(_0x10bc('0xe'));var deskjs=require(_0x10bc('0xf'));var toCsv=require(_0x10bc('0x10'));var querystring=require('querystring');var Papa=require(_0x10bc('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x10bc('0x12'));var as=require(_0x10bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10bc('0x14'))(_0x10bc('0x15'));var utils=require(_0x10bc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x10bc('0x17'));var db=require(_0x10bc('0x18'))['db'];function respondWithStatusCode(_0x38eca8,_0x131d7f){_0x131d7f=_0x131d7f||0xcc;return function(_0x448c6d){if(_0x448c6d){return _0x38eca8[_0x10bc('0x19')](_0x131d7f);}return _0x38eca8[_0x10bc('0x1a')](_0x131d7f)[_0x10bc('0x1b')]();};}function respondWithResult(_0x93b9bd,_0x1355cc){_0x1355cc=_0x1355cc||0xc8;return function(_0x1eab9f){if(_0x1eab9f){return _0x93b9bd[_0x10bc('0x1a')](_0x1355cc)[_0x10bc('0x1c')](_0x1eab9f);}};}function respondWithFilteredResult(_0x6f5d1c,_0x3ba14f){return function(_0xf82b30){if(_0xf82b30){var _0xfe8702=typeof _0x3ba14f[_0x10bc('0x1d')]===_0x10bc('0x1e')&&typeof _0x3ba14f['limit']===_0x10bc('0x1e');var _0x4838cc=_0xf82b30[_0x10bc('0x1f')];var _0x5dbc05=_0xfe8702?0x0:_0x3ba14f['offset'];var _0x14e9db=_0xfe8702?_0xf82b30[_0x10bc('0x1f')]:_0x3ba14f[_0x10bc('0x1d')]+_0x3ba14f['limit'];var _0xa82d37;if(_0x14e9db>=_0x4838cc){_0x14e9db=_0x4838cc;_0xa82d37=0xc8;}else{_0xa82d37=0xce;}_0x6f5d1c['status'](_0xa82d37);return _0x6f5d1c[_0x10bc('0x20')]('Content-Range',_0x5dbc05+'-'+_0x14e9db+'/'+_0x4838cc)[_0x10bc('0x1c')](_0xf82b30);}return null;};}function patchUpdates(_0x106233){return function(_0x587793){try{jsonpatch[_0x10bc('0x21')](_0x587793,_0x106233,!![]);}catch(_0xc15dcc){return BPromise['reject'](_0xc15dcc);}return _0x587793[_0x10bc('0x22')]();};}function saveUpdates(_0x177620,_0x34a947){return function(_0x279cf8){if(_0x279cf8){return _0x279cf8[_0x10bc('0x23')](_0x177620)[_0x10bc('0x24')](function(_0x5dd52b){return _0x5dd52b;});}return null;};}function removeEntity(_0x534a34,_0x18d4d1){return function(_0x158efc){if(_0x158efc){return _0x158efc['destroy']()[_0x10bc('0x24')](function(){_0x534a34[_0x10bc('0x1a')](0xcc)[_0x10bc('0x1b')]();});}};}function handleEntityNotFound(_0x385a2e,_0x44dc51){return function(_0x38b1e9){if(!_0x38b1e9){_0x385a2e[_0x10bc('0x19')](0x194);}return _0x38b1e9;};}function handleError(_0x1e9b11,_0x1d4ff9){_0x1d4ff9=_0x1d4ff9||0x1f4;return function(_0x1dca59){logger[_0x10bc('0x25')](_0x1dca59[_0x10bc('0x26')]);if(_0x1dca59[_0x10bc('0x27')]){delete _0x1dca59['name'];}_0x1e9b11[_0x10bc('0x1a')](_0x1d4ff9)['send'](_0x1dca59);};}exports[_0x10bc('0x28')]=function(_0x1f5b2c,_0x547fe9){var _0x42d69c={},_0x4154e6={},_0x11d2eb={'count':0x0,'rows':[]};var _0x1c655d=_[_0x10bc('0x29')](db[_0x10bc('0x2a')][_0x10bc('0x2b')],function(_0x72e124){return{'name':_0x72e124[_0x10bc('0x2c')],'type':_0x72e124['type'][_0x10bc('0x2d')]};});_0x4154e6[_0x10bc('0x2e')]=_[_0x10bc('0x29')](_0x1c655d,_0x10bc('0x27'));_0x4154e6[_0x10bc('0x2f')]=_[_0x10bc('0x30')](_0x1f5b2c['query']);_0x4154e6['filters']=_['intersection'](_0x4154e6[_0x10bc('0x2e')],_0x4154e6[_0x10bc('0x2f')]);_0x42d69c[_0x10bc('0x31')]=_[_0x10bc('0x32')](_0x4154e6[_0x10bc('0x2e')],qs['fields'](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x33')]));_0x42d69c[_0x10bc('0x31')]=_0x42d69c[_0x10bc('0x31')][_0x10bc('0x34')]?_0x42d69c[_0x10bc('0x31')]:_0x4154e6[_0x10bc('0x2e')];if(!_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x35')]('nolimit')){_0x42d69c[_0x10bc('0x36')]=qs[_0x10bc('0x36')](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x36')]);_0x42d69c[_0x10bc('0x1d')]=qs['offset'](_0x1f5b2c['query']['offset']);}_0x42d69c[_0x10bc('0x37')]=qs[_0x10bc('0x38')](_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x38')]);_0x42d69c[_0x10bc('0x39')]=qs[_0x10bc('0x3a')](_['pick'](_0x1f5b2c[_0x10bc('0x2f')],_0x4154e6[_0x10bc('0x3a')]),_0x1c655d);if(_0x1f5b2c[_0x10bc('0x2f')][_0x10bc('0x3b')]){_0x42d69c[_0x10bc('0x39')]=_[_0x10bc('0x3c')](_0x42d69c[_0x10bc('0x39')],{'$or':_['map'](_0x1c655d,function(_0x367e81){if(_0x367e81[_0x10bc('0x3d')]!==_0x10bc('0x3e')){var _0x1a6400={};_0x1a6400[_0x367e81[_0x10bc('0x27')]]={'$like':'%'+_0x1f5b2c[_0x10bc('0x2f')]['filter']+'%'};return _0x1a6400;}})});}_0x42d69c=_[_0x10bc('0x3c')]({},_0x42d69c,_0x1f5b2c[_0x10bc('0x3f')]);var _0x3bfcdd={'where':_0x42d69c[_0x10bc('0x39')]};return db[_0x10bc('0x2a')][_0x10bc('0x1f')](_0x3bfcdd)[_0x10bc('0x24')](function(_0x187db3){_0x11d2eb[_0x10bc('0x1f')]=_0x187db3;if(_0x1f5b2c['query']['includeAll']){_0x42d69c[_0x10bc('0x40')]=[{'all':!![]}];}return db[_0x10bc('0x2a')][_0x10bc('0x41')](_0x42d69c);})[_0x10bc('0x24')](function(_0x249def){_0x11d2eb['rows']=_0x249def;return _0x11d2eb;})[_0x10bc('0x24')](respondWithFilteredResult(_0x547fe9,_0x42d69c))[_0x10bc('0x42')](handleError(_0x547fe9,null));};exports[_0x10bc('0x43')]=function(_0x50c60f,_0x5b7d93){var _0x650bce={'raw':!![],'where':{'id':_0x50c60f[_0x10bc('0x44')]['id']}},_0x455c62={};_0x455c62[_0x10bc('0x2e')]=_[_0x10bc('0x30')](db[_0x10bc('0x2a')][_0x10bc('0x2b')]);_0x455c62[_0x10bc('0x2f')]=_['keys'](_0x50c60f[_0x10bc('0x2f')]);_0x455c62[_0x10bc('0x3a')]=_[_0x10bc('0x32')](_0x455c62[_0x10bc('0x2e')],_0x455c62[_0x10bc('0x2f')]);_0x650bce[_0x10bc('0x31')]=_[_0x10bc('0x32')](_0x455c62['model'],qs[_0x10bc('0x33')](_0x50c60f[_0x10bc('0x2f')][_0x10bc('0x33')]));_0x650bce[_0x10bc('0x31')]=_0x650bce['attributes'][_0x10bc('0x34')]?_0x650bce[_0x10bc('0x31')]:_0x455c62[_0x10bc('0x2e')];if(_0x50c60f[_0x10bc('0x2f')][_0x10bc('0x45')]){_0x650bce[_0x10bc('0x40')]=[{'all':!![]}];}_0x650bce=_[_0x10bc('0x3c')]({},_0x650bce,_0x50c60f['options']);return db[_0x10bc('0x2a')]['find'](_0x650bce)[_0x10bc('0x24')](handleEntityNotFound(_0x5b7d93,null))[_0x10bc('0x24')](respondWithResult(_0x5b7d93,null))[_0x10bc('0x42')](handleError(_0x5b7d93,null));};exports['create']=function(_0x128919,_0xa629ce){return db[_0x10bc('0x2a')][_0x10bc('0x46')](_0x128919[_0x10bc('0x47')],{})['then'](respondWithResult(_0xa629ce,0xc9))[_0x10bc('0x42')](handleError(_0xa629ce,null));};exports[_0x10bc('0x23')]=function(_0x108bc6,_0x36a3ca){if(_0x108bc6[_0x10bc('0x47')]['id']){delete _0x108bc6[_0x10bc('0x47')]['id'];}return db[_0x10bc('0x2a')][_0x10bc('0x48')]({'where':{'id':_0x108bc6[_0x10bc('0x44')]['id']}})[_0x10bc('0x24')](handleEntityNotFound(_0x36a3ca,null))['then'](saveUpdates(_0x108bc6[_0x10bc('0x47')],null))[_0x10bc('0x24')](respondWithResult(_0x36a3ca,null))[_0x10bc('0x42')](handleError(_0x36a3ca,null));};exports[_0x10bc('0x49')]=function(_0x1f224f,_0x408702){return db[_0x10bc('0x2a')]['find']({'where':{'id':_0x1f224f['params']['id']}})[_0x10bc('0x24')](handleEntityNotFound(_0x408702,null))[_0x10bc('0x24')](removeEntity(_0x408702,null))[_0x10bc('0x42')](handleError(_0x408702,null));}; \ No newline at end of file +var _0xec6b=['map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','merge','filter','ZendeskField','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','squel','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/license/util','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xec6b,0x129));var _0xbec6=function(_0x30afd2,_0x4c51ad){_0x30afd2=_0x30afd2-0x0;var _0x4803d3=_0xec6b[_0x30afd2];return _0x4803d3;};'use strict';var emlformat=require(_0xbec6('0x0'));var rimraf=require(_0xbec6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbec6('0x2'));var rp=require('request-promise');var moment=require(_0xbec6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbec6('0x4'));var util=require(_0xbec6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbec6('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbec6('0x7'));var toCsv=require(_0xbec6('0x8'));var querystring=require(_0xbec6('0x9'));var Papa=require(_0xbec6('0xa'));var Redis=require(_0xbec6('0xb'));var authService=require(_0xbec6('0xc'));var qs=require(_0xbec6('0xd'));var as=require(_0xbec6('0xe'));var hardwareService=require(_0xbec6('0xf'));var logger=require(_0xbec6('0x10'))(_0xbec6('0x11'));var utils=require(_0xbec6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbec6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27cb5c,_0x204245){_0x204245=_0x204245||0xcc;return function(_0x50b4b1){if(_0x50b4b1){return _0x27cb5c[_0xbec6('0x14')](_0x204245);}return _0x27cb5c['status'](_0x204245)[_0xbec6('0x15')]();};}function respondWithResult(_0x5b88b4,_0x335972){_0x335972=_0x335972||0xc8;return function(_0x4a674d){if(_0x4a674d){return _0x5b88b4[_0xbec6('0x16')](_0x335972)[_0xbec6('0x17')](_0x4a674d);}};}function respondWithFilteredResult(_0x276e74,_0x169cee){return function(_0x52b5f3){if(_0x52b5f3){var _0x15461c=typeof _0x169cee['offset']===_0xbec6('0x18')&&typeof _0x169cee[_0xbec6('0x19')]===_0xbec6('0x18');var _0xd9cf32=_0x52b5f3[_0xbec6('0x1a')];var _0x4a18bd=_0x15461c?0x0:_0x169cee[_0xbec6('0x1b')];var _0x98a9f3=_0x15461c?_0x52b5f3['count']:_0x169cee[_0xbec6('0x1b')]+_0x169cee[_0xbec6('0x19')];var _0x36b570;if(_0x98a9f3>=_0xd9cf32){_0x98a9f3=_0xd9cf32;_0x36b570=0xc8;}else{_0x36b570=0xce;}_0x276e74[_0xbec6('0x16')](_0x36b570);return _0x276e74['set'](_0xbec6('0x1c'),_0x4a18bd+'-'+_0x98a9f3+'/'+_0xd9cf32)[_0xbec6('0x17')](_0x52b5f3);}return null;};}function patchUpdates(_0x1ee928){return function(_0x26529c){try{jsonpatch['apply'](_0x26529c,_0x1ee928,!![]);}catch(_0x34a83e){return BPromise[_0xbec6('0x1d')](_0x34a83e);}return _0x26529c[_0xbec6('0x1e')]();};}function saveUpdates(_0x5835db,_0x3163c0){return function(_0x5bead7){if(_0x5bead7){return _0x5bead7[_0xbec6('0x1f')](_0x5835db)[_0xbec6('0x20')](function(_0x1fb151){return _0x1fb151;});}return null;};}function removeEntity(_0x404d91,_0x1d882a){return function(_0x44574e){if(_0x44574e){return _0x44574e[_0xbec6('0x21')]()[_0xbec6('0x20')](function(){_0x404d91[_0xbec6('0x16')](0xcc)[_0xbec6('0x15')]();});}};}function handleEntityNotFound(_0x59dea8,_0x1e9b41){return function(_0x2f5887){if(!_0x2f5887){_0x59dea8['sendStatus'](0x194);}return _0x2f5887;};}function handleError(_0x3c347b,_0x48c1ea){_0x48c1ea=_0x48c1ea||0x1f4;return function(_0x17b98d){logger[_0xbec6('0x22')](_0x17b98d[_0xbec6('0x23')]);if(_0x17b98d[_0xbec6('0x24')]){delete _0x17b98d[_0xbec6('0x24')];}_0x3c347b[_0xbec6('0x16')](_0x48c1ea)[_0xbec6('0x25')](_0x17b98d);};}exports['index']=function(_0x43729e,_0x7682e7){var _0x3ef4da={},_0x1e5bc0={},_0x5ce667={'count':0x0,'rows':[]};var _0x3cd4dd=_[_0xbec6('0x26')](db['ZendeskField'][_0xbec6('0x27')],function(_0x25132e){return{'name':_0x25132e[_0xbec6('0x28')],'type':_0x25132e[_0xbec6('0x29')]['key']};});_0x1e5bc0[_0xbec6('0x2a')]=_['map'](_0x3cd4dd,_0xbec6('0x24'));_0x1e5bc0['query']=_['keys'](_0x43729e[_0xbec6('0x2b')]);_0x1e5bc0[_0xbec6('0x2c')]=_['intersection'](_0x1e5bc0['model'],_0x1e5bc0[_0xbec6('0x2b')]);_0x3ef4da[_0xbec6('0x2d')]=_[_0xbec6('0x2e')](_0x1e5bc0[_0xbec6('0x2a')],qs[_0xbec6('0x2f')](_0x43729e['query'][_0xbec6('0x2f')]));_0x3ef4da[_0xbec6('0x2d')]=_0x3ef4da[_0xbec6('0x2d')]['length']?_0x3ef4da[_0xbec6('0x2d')]:_0x1e5bc0[_0xbec6('0x2a')];if(!_0x43729e[_0xbec6('0x2b')][_0xbec6('0x30')]('nolimit')){_0x3ef4da[_0xbec6('0x19')]=qs[_0xbec6('0x19')](_0x43729e[_0xbec6('0x2b')][_0xbec6('0x19')]);_0x3ef4da[_0xbec6('0x1b')]=qs['offset'](_0x43729e[_0xbec6('0x2b')][_0xbec6('0x1b')]);}_0x3ef4da['order']=qs[_0xbec6('0x31')](_0x43729e['query'][_0xbec6('0x31')]);_0x3ef4da[_0xbec6('0x32')]=qs['filters'](_[_0xbec6('0x33')](_0x43729e[_0xbec6('0x2b')],_0x1e5bc0[_0xbec6('0x2c')]),_0x3cd4dd);if(_0x43729e[_0xbec6('0x2b')]['filter']){_0x3ef4da['where']=_[_0xbec6('0x34')](_0x3ef4da[_0xbec6('0x32')],{'$or':_[_0xbec6('0x26')](_0x3cd4dd,function(_0x24a6c3){if(_0x24a6c3[_0xbec6('0x29')]!=='VIRTUAL'){var _0xaf1182={};_0xaf1182[_0x24a6c3[_0xbec6('0x24')]]={'$like':'%'+_0x43729e[_0xbec6('0x2b')][_0xbec6('0x35')]+'%'};return _0xaf1182;}})});}_0x3ef4da=_[_0xbec6('0x34')]({},_0x3ef4da,_0x43729e['options']);var _0x2a998b={'where':_0x3ef4da['where']};return db[_0xbec6('0x36')][_0xbec6('0x1a')](_0x2a998b)[_0xbec6('0x20')](function(_0x2614ae){_0x5ce667[_0xbec6('0x1a')]=_0x2614ae;if(_0x43729e['query'][_0xbec6('0x37')]){_0x3ef4da[_0xbec6('0x38')]=[{'all':!![]}];}return db[_0xbec6('0x36')][_0xbec6('0x39')](_0x3ef4da);})[_0xbec6('0x20')](function(_0x102c47){_0x5ce667[_0xbec6('0x3a')]=_0x102c47;return _0x5ce667;})[_0xbec6('0x20')](respondWithFilteredResult(_0x7682e7,_0x3ef4da))[_0xbec6('0x3b')](handleError(_0x7682e7,null));};exports[_0xbec6('0x3c')]=function(_0x3889e6,_0x4f04ab){var _0x2f6fac={'raw':!![],'where':{'id':_0x3889e6[_0xbec6('0x3d')]['id']}},_0x24d1d4={};_0x24d1d4[_0xbec6('0x2a')]=_[_0xbec6('0x3e')](db['ZendeskField']['rawAttributes']);_0x24d1d4['query']=_[_0xbec6('0x3e')](_0x3889e6['query']);_0x24d1d4['filters']=_[_0xbec6('0x2e')](_0x24d1d4[_0xbec6('0x2a')],_0x24d1d4[_0xbec6('0x2b')]);_0x2f6fac[_0xbec6('0x2d')]=_['intersection'](_0x24d1d4[_0xbec6('0x2a')],qs[_0xbec6('0x2f')](_0x3889e6['query']['fields']));_0x2f6fac['attributes']=_0x2f6fac[_0xbec6('0x2d')][_0xbec6('0x3f')]?_0x2f6fac[_0xbec6('0x2d')]:_0x24d1d4[_0xbec6('0x2a')];if(_0x3889e6['query']['includeAll']){_0x2f6fac[_0xbec6('0x38')]=[{'all':!![]}];}_0x2f6fac=_[_0xbec6('0x34')]({},_0x2f6fac,_0x3889e6[_0xbec6('0x40')]);return db[_0xbec6('0x36')][_0xbec6('0x41')](_0x2f6fac)[_0xbec6('0x20')](handleEntityNotFound(_0x4f04ab,null))[_0xbec6('0x20')](respondWithResult(_0x4f04ab,null))['catch'](handleError(_0x4f04ab,null));};exports['create']=function(_0x3ec213,_0x239a23){return db[_0xbec6('0x36')]['create'](_0x3ec213[_0xbec6('0x42')],{})[_0xbec6('0x20')](respondWithResult(_0x239a23,0xc9))[_0xbec6('0x3b')](handleError(_0x239a23,null));};exports[_0xbec6('0x1f')]=function(_0x1ef24a,_0x5c686f){if(_0x1ef24a['body']['id']){delete _0x1ef24a['body']['id'];}return db['ZendeskField'][_0xbec6('0x41')]({'where':{'id':_0x1ef24a[_0xbec6('0x3d')]['id']}})[_0xbec6('0x20')](handleEntityNotFound(_0x5c686f,null))[_0xbec6('0x20')](saveUpdates(_0x1ef24a[_0xbec6('0x42')],null))['then'](respondWithResult(_0x5c686f,null))[_0xbec6('0x3b')](handleError(_0x5c686f,null));};exports[_0xbec6('0x21')]=function(_0x4dedc7,_0x23590b){return db[_0xbec6('0x36')][_0xbec6('0x41')]({'where':{'id':_0x4dedc7['params']['id']}})[_0xbec6('0x20')](handleEntityNotFound(_0x23590b,null))['then'](removeEntity(_0x23590b,null))[_0xbec6('0x3b')](handleError(_0x23590b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index ba3a04e..7c131bd 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 _0xb18e=['lodash','util','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0xa521cb,_0x274e3e){var _0x159b3d=function(_0x5424d6){while(--_0x5424d6){_0xa521cb['push'](_0xa521cb['shift']());}};_0x159b3d(++_0x274e3e);}(_0xb18e,0x159));var _0xeb18=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xb18e[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb18('0x2'));var BPromise=require(_0xeb18('0x3'));var rp=require(_0xeb18('0x4'));var fs=require('fs');var path=require(_0xeb18('0x5'));var rimraf=require(_0xeb18('0x6'));var config=require('../../config/environment');var attributes=require(_0xeb18('0x7'));module[_0xeb18('0x8')]=function(_0x3a5e98,_0x56de02){return _0x3a5e98[_0xeb18('0x9')](_0xeb18('0xa'),attributes,{'tableName':_0xeb18('0xb'),'paranoid':![],'indexes':[{'name':_0xeb18('0xc'),'fields':[_0xeb18('0xd'),_0xeb18('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd77e=['./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3511b0,_0x5261b0){var _0x3184ca=function(_0x3be926){while(--_0x3be926){_0x3511b0['push'](_0x3511b0['shift']());}};_0x3184ca(++_0x5261b0);}(_0xd77e,0x151));var _0xed77=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd77e[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed77('0x0'))(_0xed77('0x1'));var moment=require(_0xed77('0x2'));var BPromise=require(_0xed77('0x3'));var rp=require(_0xed77('0x4'));var fs=require('fs');var path=require(_0xed77('0x5'));var rimraf=require(_0xed77('0x6'));var config=require(_0xed77('0x7'));var attributes=require(_0xed77('0x8'));module[_0xed77('0x9')]=function(_0x442c72,_0xef8aca){return _0x442c72['define'](_0xed77('0xa'),attributes,{'tableName':_0xed77('0xb'),'paranoid':![],'indexes':[{'name':_0xed77('0xc'),'fields':[_0xed77('0xd'),_0xed77('0xe')],'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 42092e5..040eedd 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 _0xee2a=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xee2a,0xf8));var _0xaee2=function(_0x5c616f,_0x2a6d47){_0x5c616f=_0x5c616f-0x0;var _0x158513=_0xee2a[_0x5c616f];return _0x158513;};'use strict';var _=require(_0xaee2('0x0'));var util=require(_0xaee2('0x1'));var moment=require(_0xaee2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaee2('0x3'));var db=require(_0xaee2('0x4'))['db'];var utils=require(_0xaee2('0x5'));var logger=require('../../config/logger')(_0xaee2('0x6'));var config=require(_0xaee2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaee2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13ec0d,_0xe32b76,_0x3454b2){return new BPromise(function(_0x245144,_0x409619){return client['request'](_0x13ec0d,_0x3454b2)['then'](function(_0x508820){logger[_0xaee2('0x9')]('ZendeskField,\x20%s,\x20%s',_0xe32b76,_0xaee2('0xa'));logger[_0xaee2('0xb')](_0xaee2('0xc'),_0xe32b76,_0xaee2('0xa'),JSON['stringify'](_0x508820));if(_0x508820[_0xaee2('0xd')]){if(_0x508820[_0xaee2('0xd')][_0xaee2('0xe')]===0x1f4){logger[_0xaee2('0xd')](_0xaee2('0xf'),_0xe32b76,_0x508820[_0xaee2('0xd')]['message']);return _0x409619(_0x508820[_0xaee2('0xd')][_0xaee2('0x10')]);}logger[_0xaee2('0xd')]('ZendeskField,\x20%s,\x20%s',_0xe32b76,_0x508820[_0xaee2('0xd')][_0xaee2('0x10')]);return _0x245144(_0x508820['error'][_0xaee2('0x10')]);}else{logger[_0xaee2('0x9')](_0xaee2('0xf'),_0xe32b76,'request\x20sent');_0x245144(_0x508820[_0xaee2('0x11')]['message']);}})[_0xaee2('0x12')](function(_0x1e93c3){logger[_0xaee2('0xd')](_0xaee2('0xf'),_0xe32b76,_0x1e93c3);_0x409619(_0x1e93c3);});});} \ No newline at end of file +var _0xe514=['jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe514,0x119));var _0x4e51=function(_0x58bccd,_0x440125){_0x58bccd=_0x58bccd-0x0;var _0x2c22f6=_0xe514[_0x58bccd];return _0x2c22f6;};'use strict';var _=require(_0x4e51('0x0'));var util=require('util');var moment=require(_0x4e51('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e51('0x2'));var db=require(_0x4e51('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e51('0x4'))(_0x4e51('0x5'));var config=require(_0x4e51('0x6'));var jayson=require(_0x4e51('0x7'));var client=jayson['client'][_0x4e51('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xceb28c,_0x1395b3,_0x4d6663){return new BPromise(function(_0x4d9e85,_0x3cdad2){return client[_0x4e51('0x9')](_0xceb28c,_0x4d6663)[_0x4e51('0xa')](function(_0x2ae89e){logger[_0x4e51('0xb')](_0x4e51('0xc'),_0x1395b3,_0x4e51('0xd'));logger['debug'](_0x4e51('0xe'),_0x1395b3,_0x4e51('0xd'),JSON['stringify'](_0x2ae89e));if(_0x2ae89e['error']){if(_0x2ae89e[_0x4e51('0xf')][_0x4e51('0x10')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1395b3,_0x2ae89e[_0x4e51('0xf')]['message']);return _0x3cdad2(_0x2ae89e[_0x4e51('0xf')][_0x4e51('0x11')]);}logger[_0x4e51('0xf')](_0x4e51('0xc'),_0x1395b3,_0x2ae89e['error'][_0x4e51('0x11')]);return _0x4d9e85(_0x2ae89e['error'][_0x4e51('0x11')]);}else{logger[_0x4e51('0xb')](_0x4e51('0xc'),_0x1395b3,'request\x20sent');_0x4d9e85(_0x2ae89e['result'][_0x4e51('0x11')]);}})['catch'](function(_0x13b8ab){logger['error'](_0x4e51('0xc'),_0x1395b3,_0x13b8ab);_0x3cdad2(_0x13b8ab);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 7e5b86f..50003c5 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 _0x21ab=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','multer','util','path','connect-timeout','express'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x21ab,0x85));var _0xb21a=function(_0x520f7e,_0x67518d){_0x520f7e=_0x520f7e-0x0;var _0x587f49=_0x21ab[_0x520f7e];return _0x587f49;};'use strict';var multer=require(_0xb21a('0x0'));var util=require(_0xb21a('0x1'));var path=require(_0xb21a('0x2'));var timeout=require(_0xb21a('0x3'));var express=require(_0xb21a('0x4'));var router=express[_0xb21a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb21a('0x6'));var interaction=require(_0xb21a('0x7'));var config=require(_0xb21a('0x8'));var controller=require(_0xb21a('0x9'));router[_0xb21a('0xa')]('/',auth[_0xb21a('0xb')](),controller[_0xb21a('0xc')]);router[_0xb21a('0xa')](_0xb21a('0xd'),auth['isAuthenticated'](),controller[_0xb21a('0xe')]);router[_0xb21a('0xa')](_0xb21a('0xf'),auth[_0xb21a('0xb')](),controller['getConfigurations']);router[_0xb21a('0xa')](_0xb21a('0x10'),auth['isAuthenticated'](),controller[_0xb21a('0x11')]);router[_0xb21a('0x12')]('/',auth[_0xb21a('0xb')](),controller[_0xb21a('0x13')]);router[_0xb21a('0x12')](_0xb21a('0xf'),auth[_0xb21a('0xb')](),controller[_0xb21a('0x14')]);router[_0xb21a('0x15')]('/:id',auth[_0xb21a('0xb')](),controller[_0xb21a('0x16')]);router['delete'](_0xb21a('0xd'),auth[_0xb21a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6571=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete','destroy','exports','multer','util','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6571,0x81));var _0x1657=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6571[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x1657('0x0'));var util=require(_0x1657('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1657('0x2'));var router=express['Router']();var fs_extra=require(_0x1657('0x3'));var auth=require(_0x1657('0x4'));var interaction=require(_0x1657('0x5'));var config=require(_0x1657('0x6'));var controller=require(_0x1657('0x7'));router[_0x1657('0x8')]('/',auth[_0x1657('0x9')](),controller[_0x1657('0xa')]);router['get'](_0x1657('0xb'),auth[_0x1657('0x9')](),controller[_0x1657('0xc')]);router['get'](_0x1657('0xd'),auth[_0x1657('0x9')](),controller['getConfigurations']);router[_0x1657('0x8')](_0x1657('0xe'),auth[_0x1657('0x9')](),controller[_0x1657('0xf')]);router[_0x1657('0x10')]('/',auth[_0x1657('0x9')](),controller[_0x1657('0x11')]);router[_0x1657('0x10')](_0x1657('0xd'),auth[_0x1657('0x9')](),controller[_0x1657('0x12')]);router['put'](_0x1657('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1657('0x13')](_0x1657('0xb'),auth[_0x1657('0x9')](),controller[_0x1657('0x14')]);module[_0x1657('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a4657c4..b770646 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 _0x6c76=['STRING','sequelize','exports'];(function(_0x2d938d,_0x4e041e){var _0x366231=function(_0x4177de){while(--_0x4177de){_0x2d938d['push'](_0x2d938d['shift']());}};_0x366231(++_0x4e041e);}(_0x6c76,0x184));var _0x66c7=function(_0x1674de,_0x3ba2e7){_0x1674de=_0x1674de-0x0;var _0x455f6a=_0x6c76[_0x1674de];return _0x455f6a;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'name':{'type':Sequelize[_0x66c7('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x66c7('0x2')]},'zone':{'type':Sequelize[_0x66c7('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x66c7('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x66c7('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x17ba=['sequelize','exports','STRING'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x17ba,0xab));var _0xa17b=function(_0x207e1e,_0x2ff9ed){_0x207e1e=_0x207e1e-0x0;var _0x41e948=_0x17ba[_0x207e1e];return _0x41e948;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa17b('0x2')]},'host':{'type':Sequelize[_0xa17b('0x2')]},'zone':{'type':Sequelize[_0xa17b('0x2')]},'clientId':{'type':Sequelize[_0xa17b('0x2')]},'clientSecret':{'type':Sequelize[_0xa17b('0x2')]},'serverUrl':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xa17b('0x2')]},'refreshToken':{'type':Sequelize[_0xa17b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7f55550..d9840f1 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 _0xf343=['Call_Type','system_mandatory','push','display_label','custom_field','data_type','picklist','test','statusCode','getFields','stringify','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','ZohoAccount','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','ZohoConfiguration','pick','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','findOne','host','code','refreshToken','zoho.eu','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time'];(function(_0x343ae7,_0x115528){var _0x4df502=function(_0x4ddb35){while(--_0x4ddb35){_0x343ae7['push'](_0x343ae7['shift']());}};_0x4df502(++_0x115528);}(_0xf343,0x10d));var _0x3f34=function(_0x1c3541,_0x1866ec){_0x1c3541=_0x1c3541-0x0;var _0x539b39=_0xf343[_0x1c3541];return _0x539b39;};'use strict';var emlformat=require(_0x3f34('0x0'));var rimraf=require(_0x3f34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f34('0x2'));var rp=require(_0x3f34('0x3'));var moment=require('moment');var BPromise=require(_0x3f34('0x4'));var Mustache=require(_0x3f34('0x5'));var util=require(_0x3f34('0x6'));var path=require(_0x3f34('0x7'));var sox=require(_0x3f34('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f34('0x9'));var _=require('lodash');var squel=require(_0x3f34('0xa'));var crypto=require(_0x3f34('0xb'));var jsforce=require(_0x3f34('0xc'));var deskjs=require(_0x3f34('0xd'));var toCsv=require(_0x3f34('0xe'));var querystring=require('querystring');var Papa=require(_0x3f34('0xf'));var Redis=require('ioredis');var authService=require(_0x3f34('0x10'));var qs=require(_0x3f34('0x11'));var as=require(_0x3f34('0x12'));var hardwareService=require(_0x3f34('0x13'));var logger=require(_0x3f34('0x14'))('api');var utils=require(_0x3f34('0x15'));var config=require(_0x3f34('0x16'));var licenseUtil=require(_0x3f34('0x17'));var db=require(_0x3f34('0x18'))['db'];var integrations=require(_0x3f34('0x19'));function respondWithStatusCode(_0x563b07,_0x690198){_0x690198=_0x690198||0xcc;return function(_0x36ecef){if(_0x36ecef){return _0x563b07[_0x3f34('0x1a')](_0x690198);}return _0x563b07[_0x3f34('0x1b')](_0x690198)[_0x3f34('0x1c')]();};}function respondWithResult(_0x4cfcb1,_0xd22f73){_0xd22f73=_0xd22f73||0xc8;return function(_0xf5cbea){if(_0xf5cbea){return _0x4cfcb1[_0x3f34('0x1b')](_0xd22f73)[_0x3f34('0x1d')](_0xf5cbea);}};}function respondWithFilteredResult(_0x5d1e6a,_0x1d02b4){return function(_0x32a9a7){if(_0x32a9a7){var _0x3f0fb9=typeof _0x1d02b4[_0x3f34('0x1e')]===_0x3f34('0x1f')&&typeof _0x1d02b4['limit']==='undefined';var _0x1acc3c=_0x32a9a7[_0x3f34('0x20')];var _0x2b5219=_0x3f0fb9?0x0:_0x1d02b4[_0x3f34('0x1e')];var _0x367b46=_0x3f0fb9?_0x32a9a7[_0x3f34('0x20')]:_0x1d02b4[_0x3f34('0x1e')]+_0x1d02b4['limit'];var _0x422a8a;if(_0x367b46>=_0x1acc3c){_0x367b46=_0x1acc3c;_0x422a8a=0xc8;}else{_0x422a8a=0xce;}_0x5d1e6a['status'](_0x422a8a);return _0x5d1e6a[_0x3f34('0x21')](_0x3f34('0x22'),_0x2b5219+'-'+_0x367b46+'/'+_0x1acc3c)[_0x3f34('0x1d')](_0x32a9a7);}return null;};}function patchUpdates(_0x1c2b9d){return function(_0x4e6115){try{jsonpatch[_0x3f34('0x23')](_0x4e6115,_0x1c2b9d,!![]);}catch(_0x9c7c53){return BPromise[_0x3f34('0x24')](_0x9c7c53);}return _0x4e6115[_0x3f34('0x25')]();};}function saveUpdates(_0x14c33d,_0x8d9176){return function(_0x2708b4){if(_0x2708b4){return _0x2708b4[_0x3f34('0x26')](_0x14c33d)[_0x3f34('0x27')](function(_0x21be1d){return _0x21be1d;});}return null;};}function removeEntity(_0x3dc6ae,_0x39c7bb){return function(_0x581864){if(_0x581864){return _0x581864[_0x3f34('0x28')]()[_0x3f34('0x27')](function(){_0x3dc6ae[_0x3f34('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x487239,_0x19c694){return function(_0x250c37){if(!_0x250c37){_0x487239[_0x3f34('0x1a')](0x194);}return _0x250c37;};}function handleError(_0x39641d,_0x48c5af){_0x48c5af=_0x48c5af||0x1f4;return function(_0x148791){logger[_0x3f34('0x29')](_0x148791['stack']);if(_0x148791[_0x3f34('0x2a')]){delete _0x148791[_0x3f34('0x2a')];}_0x39641d[_0x3f34('0x1b')](_0x48c5af)[_0x3f34('0x2b')](_0x148791);};}exports[_0x3f34('0x2c')]=function(_0x559bc3,_0x4c1e63){var _0x1b36b4={},_0x230b38={},_0x229969={'count':0x0,'rows':[]};var _0xe03422=_[_0x3f34('0x2d')](db['ZohoAccount']['rawAttributes'],function(_0x439d51){return{'name':_0x439d51[_0x3f34('0x2e')],'type':_0x439d51[_0x3f34('0x2f')]['key']};});_0x230b38[_0x3f34('0x30')]=_['map'](_0xe03422,_0x3f34('0x2a'));_0x230b38[_0x3f34('0x31')]=_[_0x3f34('0x32')](_0x559bc3[_0x3f34('0x31')]);_0x230b38[_0x3f34('0x33')]=_[_0x3f34('0x34')](_0x230b38[_0x3f34('0x30')],_0x230b38[_0x3f34('0x31')]);_0x1b36b4[_0x3f34('0x35')]=_[_0x3f34('0x34')](_0x230b38[_0x3f34('0x30')],qs['fields'](_0x559bc3[_0x3f34('0x31')][_0x3f34('0x36')]));_0x1b36b4[_0x3f34('0x35')]=_0x1b36b4[_0x3f34('0x35')][_0x3f34('0x37')]?_0x1b36b4[_0x3f34('0x35')]:_0x230b38[_0x3f34('0x30')];if(!_0x559bc3[_0x3f34('0x31')][_0x3f34('0x38')](_0x3f34('0x39'))){_0x1b36b4['limit']=qs[_0x3f34('0x3a')](_0x559bc3[_0x3f34('0x31')][_0x3f34('0x3a')]);_0x1b36b4[_0x3f34('0x1e')]=qs[_0x3f34('0x1e')](_0x559bc3[_0x3f34('0x31')][_0x3f34('0x1e')]);}_0x1b36b4[_0x3f34('0x3b')]=qs[_0x3f34('0x3c')](_0x559bc3[_0x3f34('0x31')][_0x3f34('0x3c')]);_0x1b36b4[_0x3f34('0x3d')]=qs[_0x3f34('0x33')](_['pick'](_0x559bc3[_0x3f34('0x31')],_0x230b38['filters']),_0xe03422);if(_0x559bc3[_0x3f34('0x31')][_0x3f34('0x3e')]){_0x1b36b4[_0x3f34('0x3d')]=_[_0x3f34('0x3f')](_0x1b36b4[_0x3f34('0x3d')],{'$or':_[_0x3f34('0x2d')](_0xe03422,function(_0x1d989f){if(_0x1d989f[_0x3f34('0x2f')]!==_0x3f34('0x40')){var _0x279dae={};_0x279dae[_0x1d989f[_0x3f34('0x2a')]]={'$like':'%'+_0x559bc3[_0x3f34('0x31')][_0x3f34('0x3e')]+'%'};return _0x279dae;}})});}_0x1b36b4=_[_0x3f34('0x3f')]({},_0x1b36b4,_0x559bc3[_0x3f34('0x41')]);var _0x2b267e={'where':_0x1b36b4['where']};return db['ZohoAccount']['count'](_0x2b267e)[_0x3f34('0x27')](function(_0x3a2934){_0x229969[_0x3f34('0x20')]=_0x3a2934;if(_0x559bc3['query'][_0x3f34('0x42')]){_0x1b36b4[_0x3f34('0x43')]=[{'all':!![]}];}return db[_0x3f34('0x44')][_0x3f34('0x45')](_0x1b36b4);})[_0x3f34('0x27')](function(_0x13ba6e){_0x229969[_0x3f34('0x46')]=_0x13ba6e;return _0x229969;})['then'](respondWithFilteredResult(_0x4c1e63,_0x1b36b4))[_0x3f34('0x47')](handleError(_0x4c1e63,null));};exports[_0x3f34('0x48')]=function(_0x504316,_0x530eed){var _0x38aff6={'raw':![],'where':{'id':_0x504316[_0x3f34('0x49')]['id']}},_0x4c3f7e={};_0x4c3f7e[_0x3f34('0x30')]=_[_0x3f34('0x32')](db[_0x3f34('0x44')][_0x3f34('0x4a')]);_0x4c3f7e[_0x3f34('0x31')]=_[_0x3f34('0x32')](_0x504316['query']);_0x4c3f7e[_0x3f34('0x33')]=_[_0x3f34('0x34')](_0x4c3f7e['model'],_0x4c3f7e[_0x3f34('0x31')]);_0x38aff6['attributes']=_[_0x3f34('0x34')](_0x4c3f7e[_0x3f34('0x30')],qs[_0x3f34('0x36')](_0x504316[_0x3f34('0x31')]['fields']));_0x38aff6[_0x3f34('0x35')]=_0x38aff6[_0x3f34('0x35')]['length']?_0x38aff6[_0x3f34('0x35')]:_0x4c3f7e['model'];if(_0x504316[_0x3f34('0x31')][_0x3f34('0x42')]){_0x38aff6['include']=[{'all':!![]}];}_0x38aff6=_[_0x3f34('0x3f')]({},_0x38aff6,_0x504316[_0x3f34('0x41')]);return db[_0x3f34('0x44')][_0x3f34('0x4b')](_0x38aff6)[_0x3f34('0x27')](handleEntityNotFound(_0x530eed,null))[_0x3f34('0x27')](respondWithResult(_0x530eed,null))[_0x3f34('0x47')](handleError(_0x530eed,null));};exports[_0x3f34('0x4c')]=function(_0xb5054b,_0x364456){return db[_0x3f34('0x44')][_0x3f34('0x4c')](_0xb5054b[_0x3f34('0x4d')],{})[_0x3f34('0x27')](respondWithResult(_0x364456,0xc9))[_0x3f34('0x47')](handleError(_0x364456,null));};exports[_0x3f34('0x26')]=function(_0xdf2b82,_0x581e07){if(_0xdf2b82['body']['id']){delete _0xdf2b82[_0x3f34('0x4d')]['id'];}return db[_0x3f34('0x44')][_0x3f34('0x4b')]({'where':{'id':_0xdf2b82[_0x3f34('0x49')]['id']}})['then'](handleEntityNotFound(_0x581e07,null))[_0x3f34('0x27')](saveUpdates(_0xdf2b82[_0x3f34('0x4d')],null))['then'](respondWithResult(_0x581e07,null))['catch'](handleError(_0x581e07,null));};exports['destroy']=function(_0x522ca9,_0x3eeca9){return db[_0x3f34('0x44')]['find']({'where':{'id':_0x522ca9[_0x3f34('0x49')]['id']}})['then'](handleEntityNotFound(_0x3eeca9,null))['then'](removeEntity(_0x3eeca9,null))['catch'](handleError(_0x3eeca9,null));};exports[_0x3f34('0x4e')]=function(_0x33376e,_0x7bae67,_0x118208){var _0x7af91d={};var _0x339e15={};var _0x52d6ed;var _0x1bb5de;return db['ZohoAccount']['findOne']({'where':{'id':_0x33376e[_0x3f34('0x49')]['id']}})['then'](handleEntityNotFound(_0x7bae67,null))[_0x3f34('0x27')](function(_0x4d99bd){if(_0x4d99bd){_0x52d6ed=_0x4d99bd;_0x339e15['model']=_['keys'](db[_0x3f34('0x4f')][_0x3f34('0x4a')]);_0x339e15['query']=_[_0x3f34('0x32')](_0x33376e[_0x3f34('0x31')]);_0x339e15[_0x3f34('0x33')]=_[_0x3f34('0x34')](_0x339e15[_0x3f34('0x30')],_0x339e15[_0x3f34('0x31')]);_0x7af91d[_0x3f34('0x35')]=_['intersection'](_0x339e15[_0x3f34('0x30')],qs[_0x3f34('0x36')](_0x33376e[_0x3f34('0x31')][_0x3f34('0x36')]));_0x7af91d[_0x3f34('0x35')]=_0x7af91d[_0x3f34('0x35')][_0x3f34('0x37')]?_0x7af91d[_0x3f34('0x35')]:_0x339e15[_0x3f34('0x30')];_0x7af91d[_0x3f34('0x3b')]=qs['sort'](_0x33376e[_0x3f34('0x31')]['sort']);_0x7af91d[_0x3f34('0x3d')]=qs[_0x3f34('0x33')](_[_0x3f34('0x50')](_0x33376e[_0x3f34('0x31')],_0x339e15['filters']));if(_0x33376e[_0x3f34('0x31')][_0x3f34('0x3e')]){_0x7af91d[_0x3f34('0x3d')]=_['merge'](_0x7af91d['where'],{'$or':_['map'](_0x7af91d[_0x3f34('0x35')],function(_0x33d64c){var _0x1f29dc={};_0x1f29dc[_0x33d64c]={'$like':'%'+_0x33376e[_0x3f34('0x31')][_0x3f34('0x3e')]+'%'};return _0x1f29dc;})});}_0x7af91d=_[_0x3f34('0x3f')]({},_0x7af91d,_0x33376e[_0x3f34('0x41')]);return _0x52d6ed['getConfigurations'](_0x7af91d);}})[_0x3f34('0x27')](function(_0x24726c){if(_0x24726c){_0x1bb5de=_0x24726c['length'];if(!_0x33376e[_0x3f34('0x31')][_0x3f34('0x38')]('nolimit')){_0x7af91d[_0x3f34('0x3a')]=qs[_0x3f34('0x3a')](_0x33376e[_0x3f34('0x31')]['limit']);_0x7af91d[_0x3f34('0x1e')]=qs[_0x3f34('0x1e')](_0x33376e[_0x3f34('0x31')][_0x3f34('0x1e')]);}return _0x52d6ed[_0x3f34('0x4e')](_0x7af91d);}})['then'](function(_0x89597e){if(_0x89597e){return _0x89597e?{'count':_0x1bb5de,'rows':_0x89597e}:null;}})['then'](respondWithResult(_0x7bae67,null))[_0x3f34('0x47')](handleError(_0x7bae67,null));};exports['addConfiguration']=function(_0x44557d,_0x2fb868,_0x24afc0){if(_0x44557d[_0x3f34('0x4d')]['id']){delete _0x44557d[_0x3f34('0x4d')]['id'];}return db[_0x3f34('0x44')]['findOne']({'where':{'id':_0x44557d[_0x3f34('0x49')]['id']}})[_0x3f34('0x27')](handleEntityNotFound(_0x2fb868,null))[_0x3f34('0x27')](function(_0x38354e){if(_0x38354e){_0x44557d[_0x3f34('0x4d')][_0x3f34('0x51')]=_0x38354e['id'];_0x44557d[_0x3f34('0x4d')][_0x3f34('0x52')]=integrations['getSubjects'](_0x44557d[_0x3f34('0x4d')][_0x3f34('0x53')],_0x44557d[_0x3f34('0x4d')][_0x3f34('0x2f')]);_0x44557d['body'][_0x3f34('0x54')]=integrations[_0x3f34('0x55')](_0x44557d[_0x3f34('0x4d')][_0x3f34('0x53')],_0x44557d['body'][_0x3f34('0x2f')]);return db[_0x3f34('0x4f')][_0x3f34('0x4c')](_0x44557d['body'],{'include':[{'model':db[_0x3f34('0x56')],'as':_0x3f34('0x52')},{'model':db[_0x3f34('0x56')],'as':_0x3f34('0x54')}]});}return null;})['then'](respondWithResult(_0x2fb868,null))[_0x3f34('0x47')](handleError(_0x2fb868,null));};function getAccessToken(_0x3e85f0){return new Promise(function(_0x564863,_0x3a9c7e){var _0x311d9c;switch(_0x3e85f0[_0x3f34('0x57')]){case'US':_0x311d9c=_0x3f34('0x58');break;case'AU':_0x311d9c=_0x3f34('0x59');break;case'EU':_0x311d9c=_0x3f34('0x5a');break;case'IN':_0x311d9c=_0x3f34('0x5b');break;case'CN':_0x311d9c=_0x3f34('0x5c');break;default:_0x311d9c=_0x3f34('0x5a');break;}var _0x4cbf3f={'method':_0x3f34('0x5d'),'uri':_0x311d9c+'/oauth/v2/token','qs':{'refresh_token':_0x3e85f0['refreshToken'],'client_id':_0x3e85f0[_0x3f34('0x5e')],'client_secret':_0x3e85f0[_0x3f34('0x5f')],'grant_type':_0x3f34('0x60')},'json':!![]};return rp(_0x4cbf3f)[_0x3f34('0x27')](function(_0x176aec){if(_0x176aec[_0x3f34('0x61')]){_0x564863(_0x176aec[_0x3f34('0x61')]);}else{_0x3a9c7e(_0x3f34('0x62'));}})['catch'](function(_0x4260b6){_0x3a9c7e(_0x4260b6);});});}exports['getFields']=function(_0x4f0d65,_0x3c0545,_0x3ca9f3){var _0x5c8fc9,_0x1cfa94,_0x4eb599,_0x5b8fa6,_0x5dfe50;return db['ZohoAccount'][_0x3f34('0x63')]({'where':{'id':_0x4f0d65[_0x3f34('0x49')]['id']},'attributes':['id',_0x3f34('0x64'),'zone',_0x3f34('0x5e'),_0x3f34('0x5f'),'serverUrl',_0x3f34('0x65'),_0x3f34('0x66')]})[_0x3f34('0x27')](handleEntityNotFound(_0x3c0545,null))[_0x3f34('0x27')](function(_0x2bcb1c){_0x5dfe50=_0x2bcb1c;_0x5c8fc9=_0x5dfe50[_0x3f34('0x64')];_0x1cfa94=_0x5c8fc9===_0x3f34('0x67')?'eu':'com';_0x4eb599=_0x5dfe50['serverUrl'];var _0x8003d2=_0x4eb599['slice'](-0x1);if(_0x8003d2==='/'||_0x8003d2==='\x5c'||_0x8003d2===':'){_0x4eb599=_0x4eb599[_0x3f34('0x68')](0x0,_0x4eb599[_0x3f34('0x69')](_0x8003d2));}if(!_0x5dfe50[_0x3f34('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5dfe50);})[_0x3f34('0x27')](function(_0x126d35){if(_0x126d35){return rp({'method':'GET','uri':util[_0x3f34('0x6a')](_0x3f34('0x6b'),_0x1cfa94),'qs':{'module':'Calls'},'headers':{'Authorization':_0x3f34('0x6c')+_0x126d35},'json':!![]});}})[_0x3f34('0x27')](function(_0x492c5a){if(_0x492c5a){if(_0x492c5a[_0x3f34('0x6d')]&&_0x492c5a[_0x3f34('0x6d')][_0x3f34('0x29')]){throw new Error(_0x492c5a[_0x3f34('0x6d')][_0x3f34('0x29')][_0x3f34('0x6e')]);}var _0x41a5b8=[];var _0x1a4285=[];var _0x4864e6=[_0x3f34('0x6f'),_0x3f34('0x70'),_0x3f34('0x71'),_0x3f34('0x72'),_0x3f34('0x73'),_0x3f34('0x74'),_0x3f34('0x75'),_0x3f34('0x76')];_0x1a4285=_['remove'](_0x492c5a['fields'],function(_0x44dbb3){return _0x4864e6['includes'](_0x44dbb3['api_name']);});for(var _0x555dc3=0x0;_0x555dc3<_0x1a4285['length'];_0x555dc3++){if(_0x1a4285[_0x555dc3][_0x3f34('0x77')]===![]){_0x41a5b8[_0x3f34('0x78')]({'id':_0x1a4285[_0x555dc3]['id'],'name':_0x1a4285[_0x555dc3][_0x3f34('0x79')],'custom':_0x1a4285[_0x555dc3][_0x3f34('0x7a')],'options':_0x1a4285[_0x555dc3][_0x3f34('0x7b')]===_0x3f34('0x7c')&&_0x1a4285[_0x555dc3]['pick_list_values'][_0x3f34('0x37')]>-0x1?_[_0x3f34('0x2d')](_0x1a4285[_0x555dc3]['pick_list_values'],function(_0x253d6c){return{'name':_0x253d6c,'value':_0x253d6c};}):[]});}}return{'count':_0x41a5b8[_0x3f34('0x37')],'rows':_0x41a5b8};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3c0545,null))[_0x3f34('0x47')](function(_0x184873){var _0x21259a=_0x4f0d65[_0x3f34('0x31')][_0x3f34('0x7d')]?0x1f4:_0x184873[_0x3f34('0x7e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x3f34('0x7f'),_0x21259a,JSON[_0x3f34('0x80')](_0x184873));delete _0x184873[_0x3f34('0x2a')];if(_0x21259a===0x191){_0x21259a=0x190;}_0x3c0545[_0x3f34('0x1b')](_0x21259a)[_0x3f34('0x2b')](_0x4f0d65[_0x3f34('0x31')][_0x3f34('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x184873[_0x3f34('0x7e')]}:_0x184873);});}; \ No newline at end of file +var _0x8b99=['lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','filter','includeAll','include','then','rows','show','params','catch','body','getConfigurations','findOne','ZohoConfiguration','pick','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','create','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','response','message','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','remove','includes','api_name','system_mandatory','push','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra'];(function(_0x42e459,_0xb13ae2){var _0x425062=function(_0x31fcdf){while(--_0x31fcdf){_0x42e459['push'](_0x42e459['shift']());}};_0x425062(++_0xb13ae2);}(_0x8b99,0x156));var _0x98b9=function(_0x2ca10e,_0xf44f7a){_0x2ca10e=_0x2ca10e-0x0;var _0x2b4d51=_0x8b99[_0x2ca10e];return _0x2b4d51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98b9('0x0'));var zipdir=require(_0x98b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98b9('0x2'));var moment=require(_0x98b9('0x3'));var BPromise=require(_0x98b9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x98b9('0x5'));var sox=require('sox');var csv=require(_0x98b9('0x6'));var ejs=require(_0x98b9('0x7'));var fs=require('fs');var fs_extra=require(_0x98b9('0x8'));var _=require(_0x98b9('0x9'));var squel=require(_0x98b9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98b9('0x6'));var querystring=require('querystring');var Papa=require(_0x98b9('0xb'));var Redis=require(_0x98b9('0xc'));var authService=require(_0x98b9('0xd'));var qs=require(_0x98b9('0xe'));var as=require(_0x98b9('0xf'));var hardwareService=require(_0x98b9('0x10'));var logger=require(_0x98b9('0x11'))('api');var utils=require(_0x98b9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x98b9('0x13'));var db=require(_0x98b9('0x14'))['db'];var integrations=require(_0x98b9('0x15'));function respondWithStatusCode(_0x2d38a7,_0x98383b){_0x98383b=_0x98383b||0xcc;return function(_0x20eb6a){if(_0x20eb6a){return _0x2d38a7['sendStatus'](_0x98383b);}return _0x2d38a7[_0x98b9('0x16')](_0x98383b)['end']();};}function respondWithResult(_0x127c35,_0x4ef5a9){_0x4ef5a9=_0x4ef5a9||0xc8;return function(_0x11921a){if(_0x11921a){return _0x127c35[_0x98b9('0x16')](_0x4ef5a9)[_0x98b9('0x17')](_0x11921a);}};}function respondWithFilteredResult(_0x572dc1,_0x226f1b){return function(_0x54fcbb){if(_0x54fcbb){var _0x4a47b5=typeof _0x226f1b['offset']===_0x98b9('0x18')&&typeof _0x226f1b[_0x98b9('0x19')]===_0x98b9('0x18');var _0xe579c5=_0x54fcbb[_0x98b9('0x1a')];var _0x14c2e1=_0x4a47b5?0x0:_0x226f1b[_0x98b9('0x1b')];var _0x3607a5=_0x4a47b5?_0x54fcbb[_0x98b9('0x1a')]:_0x226f1b[_0x98b9('0x1b')]+_0x226f1b['limit'];var _0x39160b;if(_0x3607a5>=_0xe579c5){_0x3607a5=_0xe579c5;_0x39160b=0xc8;}else{_0x39160b=0xce;}_0x572dc1[_0x98b9('0x16')](_0x39160b);return _0x572dc1[_0x98b9('0x1c')](_0x98b9('0x1d'),_0x14c2e1+'-'+_0x3607a5+'/'+_0xe579c5)[_0x98b9('0x17')](_0x54fcbb);}return null;};}function patchUpdates(_0x1c1f80){return function(_0x40f87e){try{jsonpatch['apply'](_0x40f87e,_0x1c1f80,!![]);}catch(_0x26ac76){return BPromise[_0x98b9('0x1e')](_0x26ac76);}return _0x40f87e[_0x98b9('0x1f')]();};}function saveUpdates(_0x5a621a,_0x5d4e36){return function(_0x5f2cca){if(_0x5f2cca){return _0x5f2cca[_0x98b9('0x20')](_0x5a621a)['then'](function(_0xa64632){return _0xa64632;});}return null;};}function removeEntity(_0x2329a7,_0x1914f4){return function(_0x6af7){if(_0x6af7){return _0x6af7[_0x98b9('0x21')]()['then'](function(){_0x2329a7['status'](0xcc)[_0x98b9('0x22')]();});}};}function handleEntityNotFound(_0x189f3d,_0x136c59){return function(_0x36408d){if(!_0x36408d){_0x189f3d['sendStatus'](0x194);}return _0x36408d;};}function handleError(_0x4e8b23,_0x8f3d10){_0x8f3d10=_0x8f3d10||0x1f4;return function(_0x215a24){logger[_0x98b9('0x23')](_0x215a24[_0x98b9('0x24')]);if(_0x215a24[_0x98b9('0x25')]){delete _0x215a24[_0x98b9('0x25')];}_0x4e8b23[_0x98b9('0x16')](_0x8f3d10)[_0x98b9('0x26')](_0x215a24);};}exports[_0x98b9('0x27')]=function(_0xb3f4b0,_0x8f72d7){var _0x17d88c={},_0x24182f={},_0x353624={'count':0x0,'rows':[]};var _0x35206e=_[_0x98b9('0x28')](db[_0x98b9('0x29')][_0x98b9('0x2a')],function(_0x176076){return{'name':_0x176076[_0x98b9('0x2b')],'type':_0x176076[_0x98b9('0x2c')]['key']};});_0x24182f[_0x98b9('0x2d')]=_[_0x98b9('0x28')](_0x35206e,'name');_0x24182f[_0x98b9('0x2e')]=_[_0x98b9('0x2f')](_0xb3f4b0[_0x98b9('0x2e')]);_0x24182f['filters']=_[_0x98b9('0x30')](_0x24182f[_0x98b9('0x2d')],_0x24182f['query']);_0x17d88c[_0x98b9('0x31')]=_[_0x98b9('0x30')](_0x24182f['model'],qs[_0x98b9('0x32')](_0xb3f4b0['query'][_0x98b9('0x32')]));_0x17d88c[_0x98b9('0x31')]=_0x17d88c[_0x98b9('0x31')][_0x98b9('0x33')]?_0x17d88c[_0x98b9('0x31')]:_0x24182f[_0x98b9('0x2d')];if(!_0xb3f4b0[_0x98b9('0x2e')][_0x98b9('0x34')]('nolimit')){_0x17d88c[_0x98b9('0x19')]=qs[_0x98b9('0x19')](_0xb3f4b0[_0x98b9('0x2e')][_0x98b9('0x19')]);_0x17d88c[_0x98b9('0x1b')]=qs[_0x98b9('0x1b')](_0xb3f4b0['query']['offset']);}_0x17d88c[_0x98b9('0x35')]=qs[_0x98b9('0x36')](_0xb3f4b0['query']['sort']);_0x17d88c[_0x98b9('0x37')]=qs['filters'](_['pick'](_0xb3f4b0[_0x98b9('0x2e')],_0x24182f[_0x98b9('0x38')]),_0x35206e);if(_0xb3f4b0[_0x98b9('0x2e')]['filter']){_0x17d88c[_0x98b9('0x37')]=_[_0x98b9('0x39')](_0x17d88c[_0x98b9('0x37')],{'$or':_[_0x98b9('0x28')](_0x35206e,function(_0x43a990){if(_0x43a990[_0x98b9('0x2c')]!=='VIRTUAL'){var _0x16b20b={};_0x16b20b[_0x43a990[_0x98b9('0x25')]]={'$like':'%'+_0xb3f4b0[_0x98b9('0x2e')][_0x98b9('0x3a')]+'%'};return _0x16b20b;}})});}_0x17d88c=_[_0x98b9('0x39')]({},_0x17d88c,_0xb3f4b0['options']);var _0x31ce96={'where':_0x17d88c[_0x98b9('0x37')]};return db[_0x98b9('0x29')][_0x98b9('0x1a')](_0x31ce96)['then'](function(_0x525146){_0x353624['count']=_0x525146;if(_0xb3f4b0[_0x98b9('0x2e')][_0x98b9('0x3b')]){_0x17d88c[_0x98b9('0x3c')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x17d88c);})[_0x98b9('0x3d')](function(_0x1c68ba){_0x353624[_0x98b9('0x3e')]=_0x1c68ba;return _0x353624;})[_0x98b9('0x3d')](respondWithFilteredResult(_0x8f72d7,_0x17d88c))['catch'](handleError(_0x8f72d7,null));};exports[_0x98b9('0x3f')]=function(_0x5ea992,_0x177192){var _0x541519={'raw':![],'where':{'id':_0x5ea992[_0x98b9('0x40')]['id']}},_0x597ee9={};_0x597ee9[_0x98b9('0x2d')]=_['keys'](db[_0x98b9('0x29')]['rawAttributes']);_0x597ee9[_0x98b9('0x2e')]=_[_0x98b9('0x2f')](_0x5ea992[_0x98b9('0x2e')]);_0x597ee9[_0x98b9('0x38')]=_[_0x98b9('0x30')](_0x597ee9[_0x98b9('0x2d')],_0x597ee9[_0x98b9('0x2e')]);_0x541519[_0x98b9('0x31')]=_['intersection'](_0x597ee9[_0x98b9('0x2d')],qs['fields'](_0x5ea992[_0x98b9('0x2e')][_0x98b9('0x32')]));_0x541519['attributes']=_0x541519['attributes'][_0x98b9('0x33')]?_0x541519[_0x98b9('0x31')]:_0x597ee9[_0x98b9('0x2d')];if(_0x5ea992[_0x98b9('0x2e')][_0x98b9('0x3b')]){_0x541519[_0x98b9('0x3c')]=[{'all':!![]}];}_0x541519=_['merge']({},_0x541519,_0x5ea992['options']);return db[_0x98b9('0x29')]['find'](_0x541519)['then'](handleEntityNotFound(_0x177192,null))[_0x98b9('0x3d')](respondWithResult(_0x177192,null))[_0x98b9('0x41')](handleError(_0x177192,null));};exports['create']=function(_0x22cf0b,_0x407a4d){return db[_0x98b9('0x29')]['create'](_0x22cf0b[_0x98b9('0x42')],{})[_0x98b9('0x3d')](respondWithResult(_0x407a4d,0xc9))['catch'](handleError(_0x407a4d,null));};exports[_0x98b9('0x20')]=function(_0x2c1481,_0x2d3266){if(_0x2c1481[_0x98b9('0x42')]['id']){delete _0x2c1481['body']['id'];}return db[_0x98b9('0x29')]['find']({'where':{'id':_0x2c1481['params']['id']}})['then'](handleEntityNotFound(_0x2d3266,null))[_0x98b9('0x3d')](saveUpdates(_0x2c1481[_0x98b9('0x42')],null))[_0x98b9('0x3d')](respondWithResult(_0x2d3266,null))[_0x98b9('0x41')](handleError(_0x2d3266,null));};exports[_0x98b9('0x21')]=function(_0x53fa74,_0x351410){return db[_0x98b9('0x29')]['find']({'where':{'id':_0x53fa74['params']['id']}})[_0x98b9('0x3d')](handleEntityNotFound(_0x351410,null))[_0x98b9('0x3d')](removeEntity(_0x351410,null))['catch'](handleError(_0x351410,null));};exports[_0x98b9('0x43')]=function(_0xaaf03a,_0x322252,_0x2d0f36){var _0x39994b={};var _0x534ef4={};var _0x4c5974;var _0x200eaa;return db[_0x98b9('0x29')][_0x98b9('0x44')]({'where':{'id':_0xaaf03a[_0x98b9('0x40')]['id']}})[_0x98b9('0x3d')](handleEntityNotFound(_0x322252,null))['then'](function(_0x364166){if(_0x364166){_0x4c5974=_0x364166;_0x534ef4['model']=_[_0x98b9('0x2f')](db[_0x98b9('0x45')][_0x98b9('0x2a')]);_0x534ef4['query']=_[_0x98b9('0x2f')](_0xaaf03a[_0x98b9('0x2e')]);_0x534ef4['filters']=_[_0x98b9('0x30')](_0x534ef4[_0x98b9('0x2d')],_0x534ef4['query']);_0x39994b[_0x98b9('0x31')]=_[_0x98b9('0x30')](_0x534ef4[_0x98b9('0x2d')],qs[_0x98b9('0x32')](_0xaaf03a['query']['fields']));_0x39994b['attributes']=_0x39994b[_0x98b9('0x31')][_0x98b9('0x33')]?_0x39994b[_0x98b9('0x31')]:_0x534ef4[_0x98b9('0x2d')];_0x39994b[_0x98b9('0x35')]=qs['sort'](_0xaaf03a[_0x98b9('0x2e')]['sort']);_0x39994b[_0x98b9('0x37')]=qs[_0x98b9('0x38')](_[_0x98b9('0x46')](_0xaaf03a[_0x98b9('0x2e')],_0x534ef4['filters']));if(_0xaaf03a[_0x98b9('0x2e')]['filter']){_0x39994b[_0x98b9('0x37')]=_[_0x98b9('0x39')](_0x39994b[_0x98b9('0x37')],{'$or':_[_0x98b9('0x28')](_0x39994b[_0x98b9('0x31')],function(_0xf077db){var _0x2fa278={};_0x2fa278[_0xf077db]={'$like':'%'+_0xaaf03a['query'][_0x98b9('0x3a')]+'%'};return _0x2fa278;})});}_0x39994b=_[_0x98b9('0x39')]({},_0x39994b,_0xaaf03a[_0x98b9('0x47')]);return _0x4c5974[_0x98b9('0x43')](_0x39994b);}})[_0x98b9('0x3d')](function(_0x22da36){if(_0x22da36){_0x200eaa=_0x22da36[_0x98b9('0x33')];if(!_0xaaf03a[_0x98b9('0x2e')][_0x98b9('0x34')]('nolimit')){_0x39994b[_0x98b9('0x19')]=qs[_0x98b9('0x19')](_0xaaf03a[_0x98b9('0x2e')]['limit']);_0x39994b['offset']=qs['offset'](_0xaaf03a[_0x98b9('0x2e')][_0x98b9('0x1b')]);}return _0x4c5974['getConfigurations'](_0x39994b);}})[_0x98b9('0x3d')](function(_0x563293){if(_0x563293){return _0x563293?{'count':_0x200eaa,'rows':_0x563293}:null;}})[_0x98b9('0x3d')](respondWithResult(_0x322252,null))[_0x98b9('0x41')](handleError(_0x322252,null));};exports[_0x98b9('0x48')]=function(_0x471a55,_0x3e3019,_0x173a79){if(_0x471a55['body']['id']){delete _0x471a55[_0x98b9('0x42')]['id'];}return db[_0x98b9('0x29')]['findOne']({'where':{'id':_0x471a55['params']['id']}})[_0x98b9('0x3d')](handleEntityNotFound(_0x3e3019,null))[_0x98b9('0x3d')](function(_0x43e1bc){if(_0x43e1bc){_0x471a55[_0x98b9('0x42')][_0x98b9('0x49')]=_0x43e1bc['id'];_0x471a55[_0x98b9('0x42')][_0x98b9('0x4a')]=integrations[_0x98b9('0x4b')](_0x471a55[_0x98b9('0x42')][_0x98b9('0x4c')],_0x471a55['body'][_0x98b9('0x2c')]);_0x471a55[_0x98b9('0x42')][_0x98b9('0x4d')]=integrations['getDescriptions'](_0x471a55['body'][_0x98b9('0x4c')],_0x471a55['body'][_0x98b9('0x2c')]);return db[_0x98b9('0x45')][_0x98b9('0x4e')](_0x471a55['body'],{'include':[{'model':db['ZohoField'],'as':_0x98b9('0x4a')},{'model':db[_0x98b9('0x4f')],'as':_0x98b9('0x4d')}]});}return null;})['then'](respondWithResult(_0x3e3019,null))['catch'](handleError(_0x3e3019,null));};function getAccessToken(_0x2d9fd8){return new Promise(function(_0x370547,_0x2893a4){var _0x289e73;switch(_0x2d9fd8[_0x98b9('0x50')]){case'US':_0x289e73='https://accounts.zoho.com';break;case'AU':_0x289e73=_0x98b9('0x51');break;case'EU':_0x289e73=_0x98b9('0x52');break;case'IN':_0x289e73=_0x98b9('0x53');break;case'CN':_0x289e73='https://accounts.zoho.com.cn';break;default:_0x289e73=_0x98b9('0x52');break;}var _0x3c35c0={'method':_0x98b9('0x54'),'uri':_0x289e73+'/oauth/v2/token','qs':{'refresh_token':_0x2d9fd8[_0x98b9('0x55')],'client_id':_0x2d9fd8[_0x98b9('0x56')],'client_secret':_0x2d9fd8[_0x98b9('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3c35c0)[_0x98b9('0x3d')](function(_0x488344){if(_0x488344['access_token']){_0x370547(_0x488344[_0x98b9('0x58')]);}else{_0x2893a4(_0x98b9('0x59'));}})[_0x98b9('0x41')](function(_0xb78a07){_0x2893a4(_0xb78a07);});});}exports[_0x98b9('0x5a')]=function(_0x5bbf5f,_0x574833,_0x56d064){var _0x5f5500,_0x3d1eb6,_0x39654b,_0x16b43a,_0x4cffb3;return db[_0x98b9('0x29')][_0x98b9('0x44')]({'where':{'id':_0x5bbf5f[_0x98b9('0x40')]['id']},'attributes':['id','host',_0x98b9('0x50'),'clientId',_0x98b9('0x57'),_0x98b9('0x5b'),_0x98b9('0x5c'),_0x98b9('0x55')]})['then'](handleEntityNotFound(_0x574833,null))[_0x98b9('0x3d')](function(_0x2d9990){_0x4cffb3=_0x2d9990;_0x5f5500=_0x4cffb3[_0x98b9('0x5d')];_0x3d1eb6=_0x5f5500==='zoho.eu'?'eu':'com';_0x39654b=_0x4cffb3[_0x98b9('0x5b')];var _0x3a39dc=_0x39654b['slice'](-0x1);if(_0x3a39dc==='/'||_0x3a39dc==='\x5c'||_0x3a39dc===':'){_0x39654b=_0x39654b['substring'](0x0,_0x39654b['lastIndexOf'](_0x3a39dc));}if(!_0x4cffb3['refreshToken']){throw new Error(_0x98b9('0x5e'));}return getAccessToken(_0x4cffb3);})[_0x98b9('0x3d')](function(_0x107674){if(_0x107674){return rp({'method':_0x98b9('0x5f'),'uri':util[_0x98b9('0x60')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3d1eb6),'qs':{'module':_0x98b9('0x61')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x107674},'json':!![]});}})[_0x98b9('0x3d')](function(_0x1378a2){if(_0x1378a2){if(_0x1378a2['response']&&_0x1378a2[_0x98b9('0x62')][_0x98b9('0x23')]){throw new Error(_0x1378a2[_0x98b9('0x62')][_0x98b9('0x23')][_0x98b9('0x63')]);}var _0x2afcd5=[];var _0x4ce2ac=[];var _0x40022c=[_0x98b9('0x64'),_0x98b9('0x65'),'Description',_0x98b9('0x66'),_0x98b9('0x67'),'Call_Result',_0x98b9('0x68'),'Call_Type'];_0x4ce2ac=_[_0x98b9('0x69')](_0x1378a2[_0x98b9('0x32')],function(_0x205875){return _0x40022c[_0x98b9('0x6a')](_0x205875[_0x98b9('0x6b')]);});for(var _0x146a0e=0x0;_0x146a0e<_0x4ce2ac[_0x98b9('0x33')];_0x146a0e++){if(_0x4ce2ac[_0x146a0e][_0x98b9('0x6c')]===![]){_0x2afcd5[_0x98b9('0x6d')]({'id':_0x4ce2ac[_0x146a0e]['id'],'name':_0x4ce2ac[_0x146a0e]['display_label'],'custom':_0x4ce2ac[_0x146a0e]['custom_field'],'options':_0x4ce2ac[_0x146a0e][_0x98b9('0x6e')]===_0x98b9('0x6f')&&_0x4ce2ac[_0x146a0e][_0x98b9('0x70')][_0x98b9('0x33')]>-0x1?_[_0x98b9('0x28')](_0x4ce2ac[_0x146a0e][_0x98b9('0x70')],function(_0x323d27){return{'name':_0x323d27,'value':_0x323d27};}):[]});}}return{'count':_0x2afcd5['length'],'rows':_0x2afcd5};}else{return{'count':0x0,'rows':[]};}})[_0x98b9('0x3d')](respondWithResult(_0x574833,null))['catch'](function(_0x465c78){var _0x40b0ba=_0x5bbf5f[_0x98b9('0x2e')][_0x98b9('0x71')]?0x1f4:_0x465c78[_0x98b9('0x72')]||0x1f4;logger[_0x98b9('0x23')](_0x98b9('0x73'),_0x98b9('0x5a'),_0x40b0ba,JSON[_0x98b9('0x74')](_0x465c78));delete _0x465c78['name'];if(_0x40b0ba===0x191){_0x40b0ba=0x190;}_0x574833[_0x98b9('0x16')](_0x40b0ba)[_0x98b9('0x26')](_0x5bbf5f[_0x98b9('0x2e')][_0x98b9('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x465c78['statusCode']}:_0x465c78);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index bf469a5..208dd22 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 _0xade7=['name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','https://accounts.zoho.in','inspect','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x48e568,_0x1df774){var _0x1970e0=function(_0x434a81){while(--_0x434a81){_0x48e568['push'](_0x48e568['shift']());}};_0x1970e0(++_0x1df774);}(_0xade7,0x133));var _0x7ade=function(_0x9e05d1,_0x3cef4a){_0x9e05d1=_0x9e05d1-0x0;var _0x4f7e97=_0xade7[_0x9e05d1];return _0x4f7e97;};'use strict';var _=require(_0x7ade('0x0'));var util=require(_0x7ade('0x1'));var logger=require('../../config/logger')(_0x7ade('0x2'));var moment=require(_0x7ade('0x3'));var BPromise=require(_0x7ade('0x4'));var rp=require(_0x7ade('0x5'));var fs=require('fs');var path=require(_0x7ade('0x6'));var rimraf=require(_0x7ade('0x7'));var config=require('../../config/environment');var attributes=require(_0x7ade('0x8'));var integrations=require(_0x7ade('0x9'));module[_0x7ade('0xa')]=function(_0x281f20,_0x1b8685){return _0x281f20[_0x7ade('0xb')](_0x7ade('0xc'),attributes,{'tableName':_0x7ade('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38fc7b,_0x3e0401,_0x396124){if(_0x38fc7b['changed'](_0x7ade('0xe'))||_0x38fc7b[_0x7ade('0xf')](_0x7ade('0x10'))||_0x38fc7b[_0x7ade('0xf')](_0x7ade('0x11'))||_0x38fc7b[_0x7ade('0xf')](_0x7ade('0x12'))||_0x38fc7b[_0x7ade('0xf')](_0x7ade('0x13'))||_0x38fc7b['changed'](_0x7ade('0x14'))){var _0x598c03,_0x555786;_0x598c03=_0x38fc7b[_0x7ade('0x10')];var _0x59ba9f=_0x598c03[_0x7ade('0x15')](-0x1);if(_0x59ba9f==='/'||_0x59ba9f==='\x5c'||_0x59ba9f===':'){_0x598c03=_0x598c03[_0x7ade('0x16')](0x0,_0x598c03[_0x7ade('0x17')](_0x59ba9f));}switch(_0x38fc7b[_0x7ade('0xe')]){case'US':_0x555786=_0x7ade('0x18');break;case'AU':_0x555786=_0x7ade('0x19');break;case'IN':_0x555786='https://accounts.zoho.in';break;case'CN':_0x555786=_0x7ade('0x1a');break;default:_0x555786='https://accounts.zoho.eu';break;}var _0x5072c1={'method':_0x7ade('0x1b'),'uri':_0x555786+'/oauth/v2/token','form':{'grant_type':_0x7ade('0x1c'),'client_id':_0x38fc7b['clientId'],'client_secret':_0x38fc7b[_0x7ade('0x12')],'redirect_uri':_0x38fc7b[_0x7ade('0x10')],'code':_0x38fc7b[_0x7ade('0x13')]},'headers':{'Content-Type':_0x7ade('0x1d')}};return rp(_0x5072c1)[_0x7ade('0x1e')](function(_0x122849){var _0x493742=JSON[_0x7ade('0x1f')](_0x122849);if(_0x493742[_0x7ade('0x20')]){_0x38fc7b[_0x7ade('0x21')]=_0x493742[_0x7ade('0x20')];logger[_0x7ade('0x22')](util[_0x7ade('0x23')](_0x7ade('0x24'),_0x38fc7b[_0x7ade('0x25')],_0x38fc7b['id']));}else{logger[_0x7ade('0x26')](util[_0x7ade('0x23')](_0x7ade('0x27'),_0x38fc7b['name'],_0x38fc7b['id']),util['inspect'](_0x493742,{'showHidden':![],'depth':null}));}return _0x396124(null,_0x3e0401);})[_0x7ade('0x28')](function(_0x1e48f9){logger[_0x7ade('0x26')](util[_0x7ade('0x23')](_0x7ade('0x27'),_0x38fc7b['name'],_0x38fc7b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x396124(_0x1e48f9);});}else{return _0x396124(null,_0x3e0401);}},'beforeUpdate':function(_0x2b414a,_0x38b31f,_0x385816){if(_0x2b414a[_0x7ade('0xf')](_0x7ade('0xe'))||_0x2b414a['changed']('serverUrl')||_0x2b414a[_0x7ade('0xf')](_0x7ade('0x11'))||_0x2b414a['changed'](_0x7ade('0x12'))||_0x2b414a['changed'](_0x7ade('0x13'))||_0x2b414a[_0x7ade('0xf')](_0x7ade('0x14'))){var _0x43b381,_0x48826a;_0x43b381=_0x2b414a['serverUrl'];var _0x837afa=_0x43b381[_0x7ade('0x15')](-0x1);if(_0x837afa==='/'||_0x837afa==='\x5c'||_0x837afa===':'){_0x43b381=_0x43b381['substring'](0x0,_0x43b381[_0x7ade('0x17')](_0x837afa));}switch(_0x2b414a[_0x7ade('0xe')]){case'US':_0x48826a=_0x7ade('0x18');break;case'AU':_0x48826a=_0x7ade('0x19');break;case'IN':_0x48826a=_0x7ade('0x29');break;case'CN':_0x48826a=_0x7ade('0x1a');break;default:_0x48826a='https://accounts.zoho.eu';break;}var _0x7de225={'method':'POST','uri':_0x48826a+'/oauth/v2/token','form':{'grant_type':_0x7ade('0x1c'),'client_id':_0x2b414a[_0x7ade('0x11')],'client_secret':_0x2b414a[_0x7ade('0x12')],'redirect_uri':_0x2b414a['serverUrl'],'code':_0x2b414a[_0x7ade('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x7de225)['then'](function(_0x34d867){var _0x1eadae=JSON['parse'](_0x34d867);if(_0x1eadae[_0x7ade('0x20')]){_0x2b414a[_0x7ade('0x21')]=_0x1eadae[_0x7ade('0x20')];logger[_0x7ade('0x22')](util[_0x7ade('0x23')](_0x7ade('0x24'),_0x2b414a['name'],_0x2b414a['id']));}else{logger['error'](util[_0x7ade('0x23')](_0x7ade('0x27'),_0x2b414a[_0x7ade('0x25')],_0x2b414a['id']),util[_0x7ade('0x2a')](_0x1eadae,{'showHidden':![],'depth':null}));}return _0x385816(null,_0x38b31f);})[_0x7ade('0x28')](function(_0x43bc14){logger[_0x7ade('0x26')](util[_0x7ade('0x23')](_0x7ade('0x27'),_0x2b414a[_0x7ade('0x25')],_0x2b414a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x385816(_0x43bc14);});}else{return _0x385816(null,_0x38b31f);}}}});}; \ No newline at end of file +var _0x0bb0=['error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','authorization_code','application/x-www-form-urlencoded','lodash','../../config/logger','api','moment','bluebird','request-promise','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name'];(function(_0xb625f8,_0x1765df){var _0x3779f6=function(_0xcfa125){while(--_0xcfa125){_0xb625f8['push'](_0xb625f8['shift']());}};_0x3779f6(++_0x1765df);}(_0x0bb0,0x11e));var _0x00bb=function(_0x2d9d50,_0x42bfc0){_0x2d9d50=_0x2d9d50-0x0;var _0x393a78=_0x0bb0[_0x2d9d50];return _0x393a78;};'use strict';var _=require(_0x00bb('0x0'));var util=require('util');var logger=require(_0x00bb('0x1'))(_0x00bb('0x2'));var moment=require(_0x00bb('0x3'));var BPromise=require(_0x00bb('0x4'));var rp=require(_0x00bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x00bb('0x6'));module[_0x00bb('0x7')]=function(_0x2cbaa5,_0x237e7c){return _0x2cbaa5[_0x00bb('0x8')](_0x00bb('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x102a16,_0x5a534e,_0x452857){if(_0x102a16[_0x00bb('0xa')](_0x00bb('0xb'))||_0x102a16[_0x00bb('0xa')](_0x00bb('0xc'))||_0x102a16[_0x00bb('0xa')](_0x00bb('0xd'))||_0x102a16[_0x00bb('0xa')](_0x00bb('0xe'))||_0x102a16['changed']('code')||_0x102a16[_0x00bb('0xa')](_0x00bb('0xf'))){var _0x25222,_0x1e8db8;_0x25222=_0x102a16['serverUrl'];var _0x463d1e=_0x25222[_0x00bb('0x10')](-0x1);if(_0x463d1e==='/'||_0x463d1e==='\x5c'||_0x463d1e===':'){_0x25222=_0x25222[_0x00bb('0x11')](0x0,_0x25222[_0x00bb('0x12')](_0x463d1e));}switch(_0x102a16[_0x00bb('0xb')]){case'US':_0x1e8db8=_0x00bb('0x13');break;case'AU':_0x1e8db8=_0x00bb('0x14');break;case'IN':_0x1e8db8=_0x00bb('0x15');break;case'CN':_0x1e8db8=_0x00bb('0x16');break;default:_0x1e8db8=_0x00bb('0x17');break;}var _0x1c70f6={'method':'POST','uri':_0x1e8db8+_0x00bb('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x102a16[_0x00bb('0xd')],'client_secret':_0x102a16['clientSecret'],'redirect_uri':_0x102a16[_0x00bb('0xc')],'code':_0x102a16[_0x00bb('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1c70f6)[_0x00bb('0x1a')](function(_0x13c31e){var _0x3f84dc=JSON[_0x00bb('0x1b')](_0x13c31e);if(_0x3f84dc[_0x00bb('0x1c')]){_0x102a16[_0x00bb('0x1d')]=_0x3f84dc[_0x00bb('0x1c')];logger[_0x00bb('0x1e')](util[_0x00bb('0x1f')](_0x00bb('0x20'),_0x102a16[_0x00bb('0x21')],_0x102a16['id']));}else{logger[_0x00bb('0x22')](util[_0x00bb('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x102a16[_0x00bb('0x21')],_0x102a16['id']),util[_0x00bb('0x23')](_0x3f84dc,{'showHidden':![],'depth':null}));}return _0x452857(null,_0x5a534e);})[_0x00bb('0x24')](function(_0x23c44d){logger[_0x00bb('0x22')](util[_0x00bb('0x1f')](_0x00bb('0x25'),_0x102a16[_0x00bb('0x21')],_0x102a16['id']),util[_0x00bb('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x452857(_0x23c44d);});}else{return _0x452857(null,_0x5a534e);}},'beforeUpdate':function(_0x2b1070,_0x1a1fff,_0x3b85dd){if(_0x2b1070[_0x00bb('0xa')]('zone')||_0x2b1070[_0x00bb('0xa')](_0x00bb('0xc'))||_0x2b1070[_0x00bb('0xa')](_0x00bb('0xd'))||_0x2b1070[_0x00bb('0xa')](_0x00bb('0xe'))||_0x2b1070[_0x00bb('0xa')](_0x00bb('0x19'))||_0x2b1070[_0x00bb('0xa')](_0x00bb('0xf'))){var _0x4d2e79,_0x42d4e2;_0x4d2e79=_0x2b1070['serverUrl'];var _0x1e7376=_0x4d2e79[_0x00bb('0x10')](-0x1);if(_0x1e7376==='/'||_0x1e7376==='\x5c'||_0x1e7376===':'){_0x4d2e79=_0x4d2e79[_0x00bb('0x11')](0x0,_0x4d2e79[_0x00bb('0x12')](_0x1e7376));}switch(_0x2b1070[_0x00bb('0xb')]){case'US':_0x42d4e2='https://accounts.zoho.com';break;case'AU':_0x42d4e2=_0x00bb('0x14');break;case'IN':_0x42d4e2=_0x00bb('0x15');break;case'CN':_0x42d4e2=_0x00bb('0x16');break;default:_0x42d4e2=_0x00bb('0x17');break;}var _0xffab86={'method':'POST','uri':_0x42d4e2+'/oauth/v2/token','form':{'grant_type':_0x00bb('0x26'),'client_id':_0x2b1070[_0x00bb('0xd')],'client_secret':_0x2b1070[_0x00bb('0xe')],'redirect_uri':_0x2b1070[_0x00bb('0xc')],'code':_0x2b1070[_0x00bb('0x19')]},'headers':{'Content-Type':_0x00bb('0x27')}};return rp(_0xffab86)[_0x00bb('0x1a')](function(_0x3d0660){var _0x2e5a6a=JSON['parse'](_0x3d0660);if(_0x2e5a6a['refresh_token']){_0x2b1070['refreshToken']=_0x2e5a6a[_0x00bb('0x1c')];logger[_0x00bb('0x1e')](util[_0x00bb('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b1070[_0x00bb('0x21')],_0x2b1070['id']));}else{logger[_0x00bb('0x22')](util[_0x00bb('0x1f')](_0x00bb('0x25'),_0x2b1070[_0x00bb('0x21')],_0x2b1070['id']),util['inspect'](_0x2e5a6a,{'showHidden':![],'depth':null}));}return _0x3b85dd(null,_0x1a1fff);})[_0x00bb('0x24')](function(_0x3ee626){logger[_0x00bb('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b1070[_0x00bb('0x21')],_0x2b1070['id']),util[_0x00bb('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b85dd(_0x3ee626);});}else{return _0x3b85dd(null,_0x1a1fff);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f9f8e9b..88de28b 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 _0x7804=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetZohoAccount','ZohoAccount','options','where','attributes','limit','include','model','map','then','debug','find','raw','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7804,0xc3));var _0x4780=function(_0x1fe52e,_0x1940f6){_0x1fe52e=_0x1fe52e-0x0;var _0x29ba33=_0x7804[_0x1fe52e];return _0x29ba33;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36df6b,_0x9cd1a1,_0x19356d){return new BPromise(function(_0x5dbc26,_0x2ba140){return client['request'](_0x36df6b,_0x19356d)['then'](function(_0x299992){logger[_0x4780('0x8')](_0x4780('0x9'),_0x9cd1a1,_0x4780('0xa'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'),JSON[_0x4780('0xb')](_0x299992));if(_0x299992[_0x4780('0xc')]){if(_0x299992['error']['code']===0x1f4){logger[_0x4780('0xc')](_0x4780('0x9'),_0x9cd1a1,_0x299992[_0x4780('0xc')][_0x4780('0xd')]);return _0x2ba140(_0x299992[_0x4780('0xc')]['message']);}logger['error'](_0x4780('0x9'),_0x9cd1a1,_0x299992['error'][_0x4780('0xd')]);return _0x5dbc26(_0x299992[_0x4780('0xc')][_0x4780('0xd')]);}else{logger[_0x4780('0x8')]('ZohoAccount,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'));_0x5dbc26(_0x299992['result'][_0x4780('0xd')]);}})[_0x4780('0xe')](function(_0x522b0f){logger[_0x4780('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x9cd1a1,_0x522b0f);_0x2ba140(_0x522b0f);});});}exports[_0x4780('0xf')]=function(_0x55a5f3){var _0x143588=this;return new Promise(function(_0x31e76b,_0x3bb2e9){return db[_0x4780('0x10')]['findAll']({'raw':_0x55a5f3[_0x4780('0x11')]?_0x55a5f3[_0x4780('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x55a5f3[_0x4780('0x11')]?_0x55a5f3[_0x4780('0x11')][_0x4780('0x12')]||null:null,'attributes':_0x55a5f3[_0x4780('0x11')]?_0x55a5f3[_0x4780('0x11')][_0x4780('0x13')]||null:null,'limit':_0x55a5f3[_0x4780('0x11')]?_0x55a5f3[_0x4780('0x11')][_0x4780('0x14')]||null:null,'include':_0x55a5f3[_0x4780('0x11')]?_0x55a5f3[_0x4780('0x11')][_0x4780('0x15')]?_['map'](_0x55a5f3['options'][_0x4780('0x15')],function(_0xc896ac){return{'model':db[_0xc896ac[_0x4780('0x16')]],'as':_0xc896ac['as'],'attributes':_0xc896ac[_0x4780('0x13')],'include':_0xc896ac[_0x4780('0x15')]?_[_0x4780('0x17')](_0xc896ac[_0x4780('0x15')],function(_0x3436f1){return{'model':db[_0x3436f1[_0x4780('0x16')]],'as':_0x3436f1['as'],'attributes':_0x3436f1[_0x4780('0x13')],'include':_0x3436f1[_0x4780('0x15')]?_['map'](_0x3436f1[_0x4780('0x15')],function(_0x4ac396){return{'model':db[_0x4ac396[_0x4780('0x16')]],'as':_0x4ac396['as'],'attributes':_0x4ac396[_0x4780('0x13')]};}):[]};}):[]};}):[]:[]})[_0x4780('0x18')](function(_0x57d230){logger[_0x4780('0x8')](_0x4780('0xf'),_0x55a5f3);logger[_0x4780('0x19')](_0x4780('0xf'),_0x55a5f3,JSON[_0x4780('0xb')](_0x57d230));_0x31e76b(_0x57d230);})[_0x4780('0xe')](function(_0x15d692){logger['error'](_0x4780('0xf'),_0x15d692['message'],_0x55a5f3);_0x3bb2e9(_0x143588[_0x4780('0xc')](0x1f4,_0x15d692[_0x4780('0xd')]));});});};exports['ShowZohoAccount']=function(_0x3c56f0){var _0x2ea303=this;return new Promise(function(_0x503a89,_0x1fc453){return db[_0x4780('0x10')][_0x4780('0x1a')]({'raw':_0x3c56f0[_0x4780('0x11')]?_0x3c56f0[_0x4780('0x11')][_0x4780('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c56f0[_0x4780('0x11')]?_0x3c56f0[_0x4780('0x11')][_0x4780('0x12')]||null:null,'attributes':_0x3c56f0['options']?_0x3c56f0[_0x4780('0x11')][_0x4780('0x13')]||null:null,'include':_0x3c56f0['options']?_0x3c56f0[_0x4780('0x11')]['include']?_[_0x4780('0x17')](_0x3c56f0[_0x4780('0x11')][_0x4780('0x15')],function(_0x302e88){return{'model':db[_0x302e88[_0x4780('0x16')]],'as':_0x302e88['as'],'attributes':_0x302e88[_0x4780('0x13')],'include':_0x302e88[_0x4780('0x15')]?_[_0x4780('0x17')](_0x302e88[_0x4780('0x15')],function(_0x5da809){return{'model':db[_0x5da809['model']],'as':_0x5da809['as'],'attributes':_0x5da809[_0x4780('0x13')],'include':_0x5da809[_0x4780('0x15')]?_[_0x4780('0x17')](_0x5da809['include'],function(_0x317a18){return{'model':db[_0x317a18[_0x4780('0x16')]],'as':_0x317a18['as'],'attributes':_0x317a18[_0x4780('0x13')]};}):[]};}):[]};}):[]:[]})[_0x4780('0x18')](function(_0x1ebe6f){logger[_0x4780('0x8')](_0x4780('0x1c'),_0x3c56f0);logger[_0x4780('0x19')](_0x4780('0x1c'),_0x3c56f0,JSON[_0x4780('0xb')](_0x1ebe6f));_0x503a89(_0x1ebe6f);})['catch'](function(_0x560228){logger[_0x4780('0xc')](_0x4780('0x1c'),_0x560228[_0x4780('0xd')],_0x3c56f0);_0x1fc453(_0x2ea303[_0x4780('0xc')](0x1f4,_0x560228[_0x4780('0xd')]));});});}; \ No newline at end of file +var _0x9666=['error','message','result','catch','GetZohoAccount','findAll','where','options','limit','include','map','model','attributes','then','ShowZohoAccount','ZohoAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa2db74,_0x31cb5e){var _0x181fa0=function(_0x362537){while(--_0x362537){_0xa2db74['push'](_0xa2db74['shift']());}};_0x181fa0(++_0x31cb5e);}(_0x9666,0x17a));var _0x6966=function(_0x24f39b,_0x299ee2){_0x24f39b=_0x24f39b-0x0;var _0x4252af=_0x9666[_0x24f39b];return _0x4252af;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var moment=require(_0x6966('0x2'));var BPromise=require(_0x6966('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6966('0x4'));var db=require(_0x6966('0x5'))['db'];var utils=require(_0x6966('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6966('0x7'));var jayson=require(_0x6966('0x8'));var client=jayson[_0x6966('0x9')][_0x6966('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363f5f,_0x18fa4c,_0x484a87){return new BPromise(function(_0xb381c4,_0x3d08bf){return client[_0x6966('0xb')](_0x363f5f,_0x484a87)['then'](function(_0x38aed6){logger[_0x6966('0xc')](_0x6966('0xd'),_0x18fa4c,_0x6966('0xe'));logger[_0x6966('0xf')](_0x6966('0x10'),_0x18fa4c,_0x6966('0xe'),JSON[_0x6966('0x11')](_0x38aed6));if(_0x38aed6[_0x6966('0x12')]){if(_0x38aed6[_0x6966('0x12')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x18fa4c,_0x38aed6[_0x6966('0x12')][_0x6966('0x13')]);return _0x3d08bf(_0x38aed6[_0x6966('0x12')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x18fa4c,_0x38aed6[_0x6966('0x12')][_0x6966('0x13')]);return _0xb381c4(_0x38aed6[_0x6966('0x12')][_0x6966('0x13')]);}else{logger[_0x6966('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x18fa4c,_0x6966('0xe'));_0xb381c4(_0x38aed6[_0x6966('0x14')]['message']);}})[_0x6966('0x15')](function(_0x30f650){logger[_0x6966('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x18fa4c,_0x30f650);_0x3d08bf(_0x30f650);});});}exports[_0x6966('0x16')]=function(_0x4bf5b8){var _0x43e2e9=this;return new Promise(function(_0x519049,_0x5a4ea7){return db['ZohoAccount'][_0x6966('0x17')]({'raw':_0x4bf5b8['options']?_0x4bf5b8['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bf5b8['options']?_0x4bf5b8['options'][_0x6966('0x18')]||null:null,'attributes':_0x4bf5b8[_0x6966('0x19')]?_0x4bf5b8[_0x6966('0x19')]['attributes']||null:null,'limit':_0x4bf5b8[_0x6966('0x19')]?_0x4bf5b8[_0x6966('0x19')][_0x6966('0x1a')]||null:null,'include':_0x4bf5b8[_0x6966('0x19')]?_0x4bf5b8[_0x6966('0x19')][_0x6966('0x1b')]?_[_0x6966('0x1c')](_0x4bf5b8[_0x6966('0x19')][_0x6966('0x1b')],function(_0x509631){return{'model':db[_0x509631[_0x6966('0x1d')]],'as':_0x509631['as'],'attributes':_0x509631[_0x6966('0x1e')],'include':_0x509631[_0x6966('0x1b')]?_[_0x6966('0x1c')](_0x509631[_0x6966('0x1b')],function(_0x27db0e){return{'model':db[_0x27db0e[_0x6966('0x1d')]],'as':_0x27db0e['as'],'attributes':_0x27db0e['attributes'],'include':_0x27db0e[_0x6966('0x1b')]?_['map'](_0x27db0e[_0x6966('0x1b')],function(_0x4f7aa2){return{'model':db[_0x4f7aa2[_0x6966('0x1d')]],'as':_0x4f7aa2['as'],'attributes':_0x4f7aa2[_0x6966('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6966('0x1f')](function(_0x85106d){logger[_0x6966('0xc')](_0x6966('0x16'),_0x4bf5b8);logger[_0x6966('0xf')](_0x6966('0x16'),_0x4bf5b8,JSON[_0x6966('0x11')](_0x85106d));_0x519049(_0x85106d);})['catch'](function(_0x270919){logger[_0x6966('0x12')]('GetZohoAccount',_0x270919[_0x6966('0x13')],_0x4bf5b8);_0x5a4ea7(_0x43e2e9['error'](0x1f4,_0x270919[_0x6966('0x13')]));});});};exports[_0x6966('0x20')]=function(_0x171f19){var _0x452721=this;return new Promise(function(_0x40a50d,_0x472d75){return db[_0x6966('0x21')][_0x6966('0x22')]({'raw':_0x171f19[_0x6966('0x19')]?_0x171f19[_0x6966('0x19')][_0x6966('0x23')]===undefined?!![]:![]:!![],'where':_0x171f19[_0x6966('0x19')]?_0x171f19[_0x6966('0x19')][_0x6966('0x18')]||null:null,'attributes':_0x171f19[_0x6966('0x19')]?_0x171f19[_0x6966('0x19')]['attributes']||null:null,'include':_0x171f19[_0x6966('0x19')]?_0x171f19['options'][_0x6966('0x1b')]?_[_0x6966('0x1c')](_0x171f19[_0x6966('0x19')][_0x6966('0x1b')],function(_0x45a6ba){return{'model':db[_0x45a6ba[_0x6966('0x1d')]],'as':_0x45a6ba['as'],'attributes':_0x45a6ba[_0x6966('0x1e')],'include':_0x45a6ba[_0x6966('0x1b')]?_[_0x6966('0x1c')](_0x45a6ba[_0x6966('0x1b')],function(_0x5d9cb0){return{'model':db[_0x5d9cb0[_0x6966('0x1d')]],'as':_0x5d9cb0['as'],'attributes':_0x5d9cb0[_0x6966('0x1e')],'include':_0x5d9cb0[_0x6966('0x1b')]?_['map'](_0x5d9cb0['include'],function(_0xcfea9f){return{'model':db[_0xcfea9f[_0x6966('0x1d')]],'as':_0xcfea9f['as'],'attributes':_0xcfea9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6966('0x1f')](function(_0x54cd6a){logger['info'](_0x6966('0x20'),_0x171f19);logger[_0x6966('0xf')](_0x6966('0x20'),_0x171f19,JSON[_0x6966('0x11')](_0x54cd6a));_0x40a50d(_0x54cd6a);})['catch'](function(_0x40667f){logger[_0x6966('0x12')](_0x6966('0x20'),_0x40667f[_0x6966('0x13')],_0x171f19);_0x472d75(_0x452721[_0x6966('0x12')](0x1f4,_0x40667f[_0x6966('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 45e7b54..af3de9c 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 _0x5ab6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5ab6,0x1df));var _0x65ab=function(_0x13b9ca,_0x1860d9){_0x13b9ca=_0x13b9ca-0x0;var _0x59177f=_0x5ab6[_0x13b9ca];return _0x59177f;};'use strict';var multer=require(_0x65ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x65ab('0x1'));var express=require(_0x65ab('0x2'));var router=express[_0x65ab('0x3')]();var fs_extra=require(_0x65ab('0x4'));var auth=require(_0x65ab('0x5'));var interaction=require(_0x65ab('0x6'));var config=require('../../config/environment');var controller=require(_0x65ab('0x7'));router[_0x65ab('0x8')]('/',auth[_0x65ab('0x9')](),controller[_0x65ab('0xa')]);router[_0x65ab('0x8')]('/:id',auth[_0x65ab('0x9')](),controller[_0x65ab('0xb')]);router[_0x65ab('0x8')]('/:id/fields',auth[_0x65ab('0x9')](),controller[_0x65ab('0xc')]);router['get'](_0x65ab('0xd'),auth['isAuthenticated'](),controller[_0x65ab('0xe')]);router[_0x65ab('0x8')](_0x65ab('0xf'),auth[_0x65ab('0x9')](),controller['getDescriptions']);router[_0x65ab('0x10')]('/',auth['isAuthenticated'](),controller[_0x65ab('0x11')]);router[_0x65ab('0x12')](_0x65ab('0x13'),auth[_0x65ab('0x9')](),controller[_0x65ab('0x14')]);router[_0x65ab('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x65ab('0x16')]);module[_0x65ab('0x17')]=router; \ No newline at end of file +var _0x6834=['../../config/environment','get','isAuthenticated','index','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1da3e6,_0x231168){var _0xb746fa=function(_0x29759c){while(--_0x29759c){_0x1da3e6['push'](_0x1da3e6['shift']());}};_0xb746fa(++_0x231168);}(_0x6834,0x121));var _0x4683=function(_0x34460d,_0x35410a){_0x34460d=_0x34460d-0x0;var _0x367b61=_0x6834[_0x34460d];return _0x367b61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4683('0x0'));var timeout=require('connect-timeout');var express=require(_0x4683('0x1'));var router=express['Router']();var fs_extra=require(_0x4683('0x2'));var auth=require(_0x4683('0x3'));var interaction=require(_0x4683('0x4'));var config=require(_0x4683('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x4683('0x6')]('/',auth[_0x4683('0x7')](),controller[_0x4683('0x8')]);router[_0x4683('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x4683('0x9'),auth[_0x4683('0x7')](),controller['getFields']);router[_0x4683('0x6')](_0x4683('0xa'),auth[_0x4683('0x7')](),controller['getSubjects']);router[_0x4683('0x6')](_0x4683('0xb'),auth[_0x4683('0x7')](),controller[_0x4683('0xc')]);router[_0x4683('0xd')]('/',auth[_0x4683('0x7')](),controller[_0x4683('0xe')]);router[_0x4683('0xf')]('/:id',auth[_0x4683('0x7')](),controller[_0x4683('0x10')]);router[_0x4683('0x11')](_0x4683('0x12'),auth[_0x4683('0x7')](),controller[_0x4683('0x13')]);module[_0x4683('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index ed6c377..9d79f03 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 _0x372b=['contact_lead','STRING','sequelize','exports','ENUM','lead','contact','nothing'];(function(_0x23a7aa,_0x51647e){var _0x5a6172=function(_0x21b1d9){while(--_0x21b1d9){_0x23a7aa['push'](_0x23a7aa['shift']());}};_0x5a6172(++_0x51647e);}(_0x372b,0x18a));var _0xb372=function(_0x3e8c33,_0x498e48){_0x3e8c33=_0x3e8c33-0x0;var _0x57416c=_0x372b[_0x3e8c33];return _0x57416c;};'use strict';var Sequelize=require(_0xb372('0x0'));module[_0xb372('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xb372('0x2')](_0xb372('0x3'),_0xb372('0x4'),_0xb372('0x5')),'defaultValue':_0xb372('0x3')},'moduleSearch':{'type':Sequelize[_0xb372('0x2')]('contact_lead',_0xb372('0x4'),_0xb372('0x3')),'defaultValue':_0xb372('0x6')},'description':{'type':Sequelize[_0xb372('0x7')]}}; \ No newline at end of file +var _0x2e10=['lead','ENUM','contact_lead','sequelize','exports','STRING'];(function(_0x2e60c4,_0x1f06c6){var _0xd92e53=function(_0x59586c){while(--_0x59586c){_0x2e60c4['push'](_0x2e60c4['shift']());}};_0xd92e53(++_0x1f06c6);}(_0x2e10,0xe7));var _0x02e1=function(_0x375a22,_0x2377a0){_0x375a22=_0x375a22-0x0;var _0x11729f=_0x2e10[_0x375a22];return _0x11729f;};'use strict';var Sequelize=require(_0x02e1('0x0'));module[_0x02e1('0x1')]={'name':{'type':Sequelize[_0x02e1('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x02e1('0x3'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x02e1('0x4')](_0x02e1('0x5'),'contact',_0x02e1('0x3')),'defaultValue':_0x02e1('0x5')},'description':{'type':Sequelize[_0x02e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c6d83a6..2b8f4b2 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 _0xc851=['reject','then','sendStatus','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','ZohoConfiguration','rows','catch','params','keys','rawAttributes','fields','options','find','create','body','update','destroy','ZohoField','order','pick','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x518834,_0x3c2147){var _0x42695e=function(_0x1a82aa){while(--_0x1a82aa){_0x518834['push'](_0x518834['shift']());}};_0x42695e(++_0x3c2147);}(_0xc851,0x113));var _0x1c85=function(_0x25de87,_0x2cdb3c){_0x25de87=_0x25de87-0x0;var _0x40b48a=_0xc851[_0x25de87];return _0x40b48a;};'use strict';var emlformat=require(_0x1c85('0x0'));var rimraf=require(_0x1c85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c85('0x2'));var moment=require(_0x1c85('0x3'));var BPromise=require(_0x1c85('0x4'));var Mustache=require('mustache');var util=require(_0x1c85('0x5'));var path=require(_0x1c85('0x6'));var sox=require(_0x1c85('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c85('0x8'));var _=require('lodash');var squel=require(_0x1c85('0x9'));var crypto=require('crypto');var jsforce=require(_0x1c85('0xa'));var deskjs=require(_0x1c85('0xb'));var toCsv=require(_0x1c85('0xc'));var querystring=require(_0x1c85('0xd'));var Papa=require(_0x1c85('0xe'));var Redis=require(_0x1c85('0xf'));var authService=require(_0x1c85('0x10'));var qs=require(_0x1c85('0x11'));var as=require(_0x1c85('0x12'));var hardwareService=require(_0x1c85('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1c85('0x14'));var licenseUtil=require(_0x1c85('0x15'));var db=require(_0x1c85('0x16'))['db'];function respondWithStatusCode(_0x104a44,_0x41bf62){_0x41bf62=_0x41bf62||0xcc;return function(_0xae6ac6){if(_0xae6ac6){return _0x104a44['sendStatus'](_0x41bf62);}return _0x104a44[_0x1c85('0x17')](_0x41bf62)[_0x1c85('0x18')]();};}function respondWithResult(_0xee60f,_0x3ca853){_0x3ca853=_0x3ca853||0xc8;return function(_0x557fd5){if(_0x557fd5){return _0xee60f[_0x1c85('0x17')](_0x3ca853)['json'](_0x557fd5);}};}function respondWithFilteredResult(_0x3bdaa4,_0x43d48f){return function(_0x404c6f){if(_0x404c6f){var _0x15a745=typeof _0x43d48f[_0x1c85('0x19')]===_0x1c85('0x1a')&&typeof _0x43d48f[_0x1c85('0x1b')]===_0x1c85('0x1a');var _0x2e9b6b=_0x404c6f[_0x1c85('0x1c')];var _0x496b32=_0x15a745?0x0:_0x43d48f[_0x1c85('0x19')];var _0x51b756=_0x15a745?_0x404c6f[_0x1c85('0x1c')]:_0x43d48f[_0x1c85('0x19')]+_0x43d48f[_0x1c85('0x1b')];var _0x4a99b4;if(_0x51b756>=_0x2e9b6b){_0x51b756=_0x2e9b6b;_0x4a99b4=0xc8;}else{_0x4a99b4=0xce;}_0x3bdaa4['status'](_0x4a99b4);return _0x3bdaa4[_0x1c85('0x1d')](_0x1c85('0x1e'),_0x496b32+'-'+_0x51b756+'/'+_0x2e9b6b)[_0x1c85('0x1f')](_0x404c6f);}return null;};}function patchUpdates(_0x18bf41){return function(_0x1b070a){try{jsonpatch[_0x1c85('0x20')](_0x1b070a,_0x18bf41,!![]);}catch(_0x56cac0){return BPromise[_0x1c85('0x21')](_0x56cac0);}return _0x1b070a['save']();};}function saveUpdates(_0x54f9d3,_0x52deb8){return function(_0x27f70a){if(_0x27f70a){return _0x27f70a['update'](_0x54f9d3)[_0x1c85('0x22')](function(_0x41192b){return _0x41192b;});}return null;};}function removeEntity(_0x44ccf0,_0x35103d){return function(_0x378611){if(_0x378611){return _0x378611['destroy']()[_0x1c85('0x22')](function(){_0x44ccf0[_0x1c85('0x17')](0xcc)[_0x1c85('0x18')]();});}};}function handleEntityNotFound(_0x2cefdc,_0x3a141b){return function(_0x5cc87d){if(!_0x5cc87d){_0x2cefdc[_0x1c85('0x23')](0x194);}return _0x5cc87d;};}function handleError(_0x3b99aa,_0x30af96){_0x30af96=_0x30af96||0x1f4;return function(_0x1a82e3){logger['error'](_0x1a82e3[_0x1c85('0x24')]);if(_0x1a82e3[_0x1c85('0x25')]){delete _0x1a82e3[_0x1c85('0x25')];}_0x3b99aa[_0x1c85('0x17')](_0x30af96)[_0x1c85('0x26')](_0x1a82e3);};}exports['index']=function(_0x281100,_0x2e18c2){var _0x3251b6={},_0x13e3bb={},_0x9f19df={'count':0x0,'rows':[]};var _0x201929=_[_0x1c85('0x27')](db['ZohoConfiguration']['rawAttributes'],function(_0x46c514){return{'name':_0x46c514[_0x1c85('0x28')],'type':_0x46c514[_0x1c85('0x29')][_0x1c85('0x2a')]};});_0x13e3bb[_0x1c85('0x2b')]=_[_0x1c85('0x27')](_0x201929,_0x1c85('0x25'));_0x13e3bb[_0x1c85('0x2c')]=_['keys'](_0x281100[_0x1c85('0x2c')]);_0x13e3bb[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x13e3bb['model'],_0x13e3bb[_0x1c85('0x2c')]);_0x3251b6[_0x1c85('0x2f')]=_['intersection'](_0x13e3bb[_0x1c85('0x2b')],qs['fields'](_0x281100['query']['fields']));_0x3251b6['attributes']=_0x3251b6[_0x1c85('0x2f')][_0x1c85('0x30')]?_0x3251b6['attributes']:_0x13e3bb[_0x1c85('0x2b')];if(!_0x281100[_0x1c85('0x2c')][_0x1c85('0x31')](_0x1c85('0x32'))){_0x3251b6[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x281100['query'][_0x1c85('0x1b')]);_0x3251b6[_0x1c85('0x19')]=qs[_0x1c85('0x19')](_0x281100[_0x1c85('0x2c')][_0x1c85('0x19')]);}_0x3251b6['order']=qs[_0x1c85('0x33')](_0x281100[_0x1c85('0x2c')][_0x1c85('0x33')]);_0x3251b6[_0x1c85('0x34')]=qs[_0x1c85('0x2d')](_['pick'](_0x281100[_0x1c85('0x2c')],_0x13e3bb['filters']),_0x201929);if(_0x281100[_0x1c85('0x2c')][_0x1c85('0x35')]){_0x3251b6[_0x1c85('0x34')]=_[_0x1c85('0x36')](_0x3251b6[_0x1c85('0x34')],{'$or':_[_0x1c85('0x27')](_0x201929,function(_0x39adbc){if(_0x39adbc[_0x1c85('0x29')]!=='VIRTUAL'){var _0x2d3705={};_0x2d3705[_0x39adbc[_0x1c85('0x25')]]={'$like':'%'+_0x281100['query'][_0x1c85('0x35')]+'%'};return _0x2d3705;}})});}_0x3251b6=_['merge']({},_0x3251b6,_0x281100['options']);var _0x4a2d61={'where':_0x3251b6['where']};return db['ZohoConfiguration']['count'](_0x4a2d61)['then'](function(_0x1295e6){_0x9f19df['count']=_0x1295e6;if(_0x281100[_0x1c85('0x2c')][_0x1c85('0x37')]){_0x3251b6[_0x1c85('0x38')]=[{'all':!![]}];}return db[_0x1c85('0x39')]['findAll'](_0x3251b6);})[_0x1c85('0x22')](function(_0xa2f54d){_0x9f19df[_0x1c85('0x3a')]=_0xa2f54d;return _0x9f19df;})[_0x1c85('0x22')](respondWithFilteredResult(_0x2e18c2,_0x3251b6))[_0x1c85('0x3b')](handleError(_0x2e18c2,null));};exports['show']=function(_0x1d14d1,_0x4a275e){var _0x5bd816={'raw':![],'where':{'id':_0x1d14d1[_0x1c85('0x3c')]['id']}},_0x2e48a5={};_0x2e48a5[_0x1c85('0x2b')]=_[_0x1c85('0x3d')](db[_0x1c85('0x39')][_0x1c85('0x3e')]);_0x2e48a5[_0x1c85('0x2c')]=_[_0x1c85('0x3d')](_0x1d14d1[_0x1c85('0x2c')]);_0x2e48a5['filters']=_['intersection'](_0x2e48a5[_0x1c85('0x2b')],_0x2e48a5[_0x1c85('0x2c')]);_0x5bd816['attributes']=_['intersection'](_0x2e48a5[_0x1c85('0x2b')],qs['fields'](_0x1d14d1[_0x1c85('0x2c')][_0x1c85('0x3f')]));_0x5bd816[_0x1c85('0x2f')]=_0x5bd816[_0x1c85('0x2f')]['length']?_0x5bd816[_0x1c85('0x2f')]:_0x2e48a5[_0x1c85('0x2b')];if(_0x1d14d1[_0x1c85('0x2c')][_0x1c85('0x37')]){_0x5bd816[_0x1c85('0x38')]=[{'all':!![]}];}_0x5bd816=_['merge']({},_0x5bd816,_0x1d14d1[_0x1c85('0x40')]);return db[_0x1c85('0x39')][_0x1c85('0x41')](_0x5bd816)['then'](handleEntityNotFound(_0x4a275e,null))[_0x1c85('0x22')](respondWithResult(_0x4a275e,null))[_0x1c85('0x3b')](handleError(_0x4a275e,null));};exports[_0x1c85('0x42')]=function(_0x18fb26,_0x25e8e0){return db[_0x1c85('0x39')][_0x1c85('0x42')](_0x18fb26[_0x1c85('0x43')],{})['then'](respondWithResult(_0x25e8e0,0xc9))[_0x1c85('0x3b')](handleError(_0x25e8e0,null));};exports[_0x1c85('0x44')]=function(_0x5a2a6f,_0x2954d9){if(_0x5a2a6f[_0x1c85('0x43')]['id']){delete _0x5a2a6f[_0x1c85('0x43')]['id'];}return db[_0x1c85('0x39')][_0x1c85('0x41')]({'where':{'id':_0x5a2a6f[_0x1c85('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2954d9,null))['then'](saveUpdates(_0x5a2a6f[_0x1c85('0x43')],null))['then'](respondWithResult(_0x2954d9,null))[_0x1c85('0x3b')](handleError(_0x2954d9,null));};exports[_0x1c85('0x45')]=function(_0x27c35b,_0x4e6da6){return db[_0x1c85('0x39')][_0x1c85('0x41')]({'where':{'id':_0x27c35b['params']['id']}})['then'](handleEntityNotFound(_0x4e6da6,null))['then'](removeEntity(_0x4e6da6,null))[_0x1c85('0x3b')](handleError(_0x4e6da6,null));};exports['getFields']=function(_0x186195,_0x1dcec5,_0x34e42f){var _0x317c28={};var _0x2f001a={};var _0x4564e5;var _0x5f2142;return db[_0x1c85('0x39')]['findOne']({'where':{'id':_0x186195[_0x1c85('0x3c')]['id']}})[_0x1c85('0x22')](handleEntityNotFound(_0x1dcec5,null))[_0x1c85('0x22')](function(_0x5ea74d){if(_0x5ea74d){_0x4564e5=_0x5ea74d;_0x2f001a[_0x1c85('0x2b')]=_['keys'](db[_0x1c85('0x46')][_0x1c85('0x3e')]);_0x2f001a[_0x1c85('0x2c')]=_[_0x1c85('0x3d')](_0x186195['query']);_0x2f001a['filters']=_['intersection'](_0x2f001a[_0x1c85('0x2b')],_0x2f001a[_0x1c85('0x2c')]);_0x317c28[_0x1c85('0x2f')]=_['intersection'](_0x2f001a[_0x1c85('0x2b')],qs[_0x1c85('0x3f')](_0x186195[_0x1c85('0x2c')]['fields']));_0x317c28[_0x1c85('0x2f')]=_0x317c28[_0x1c85('0x2f')][_0x1c85('0x30')]?_0x317c28['attributes']:_0x2f001a['model'];_0x317c28[_0x1c85('0x47')]=qs[_0x1c85('0x33')](_0x186195[_0x1c85('0x2c')]['sort']);_0x317c28['where']=qs['filters'](_[_0x1c85('0x48')](_0x186195['query'],_0x2f001a[_0x1c85('0x2d')]));if(_0x186195['query'][_0x1c85('0x35')]){_0x317c28[_0x1c85('0x34')]=_[_0x1c85('0x36')](_0x317c28[_0x1c85('0x34')],{'$or':_[_0x1c85('0x27')](_0x317c28[_0x1c85('0x2f')],function(_0x3b8f4e){var _0x56df7d={};_0x56df7d[_0x3b8f4e]={'$like':'%'+_0x186195[_0x1c85('0x2c')][_0x1c85('0x35')]+'%'};return _0x56df7d;})});}_0x317c28=_['merge']({},_0x317c28,_0x186195['options']);return _0x4564e5[_0x1c85('0x49')](_0x317c28);}})[_0x1c85('0x22')](function(_0x516b2e){if(_0x516b2e){_0x5f2142=_0x516b2e[_0x1c85('0x30')];if(!_0x186195['query']['hasOwnProperty'](_0x1c85('0x32'))){_0x317c28[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x186195[_0x1c85('0x2c')]['limit']);_0x317c28[_0x1c85('0x19')]=qs[_0x1c85('0x19')](_0x186195[_0x1c85('0x2c')][_0x1c85('0x19')]);}return _0x4564e5[_0x1c85('0x49')](_0x317c28);}})[_0x1c85('0x22')](function(_0x13d6fb){if(_0x13d6fb){return _0x13d6fb?{'count':_0x5f2142,'rows':_0x13d6fb}:null;}})['then'](respondWithResult(_0x1dcec5,null))['catch'](handleError(_0x1dcec5,null));};exports[_0x1c85('0x4a')]=function(_0x2d8443,_0x18dda5,_0x41bedd){var _0x55c4ad={};var _0x13e523={};var _0x43493b;var _0x4a87e4;return db[_0x1c85('0x39')][_0x1c85('0x4b')]({'where':{'id':_0x2d8443[_0x1c85('0x3c')]['id']}})[_0x1c85('0x22')](handleEntityNotFound(_0x18dda5,null))[_0x1c85('0x22')](function(_0x3ff226){if(_0x3ff226){_0x43493b=_0x3ff226;_0x13e523[_0x1c85('0x2b')]=_[_0x1c85('0x3d')](db['ZohoField'][_0x1c85('0x3e')]);_0x13e523['query']=_[_0x1c85('0x3d')](_0x2d8443[_0x1c85('0x2c')]);_0x13e523[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x13e523['model'],_0x13e523[_0x1c85('0x2c')]);_0x55c4ad[_0x1c85('0x2f')]=_[_0x1c85('0x2e')](_0x13e523[_0x1c85('0x2b')],qs[_0x1c85('0x3f')](_0x2d8443[_0x1c85('0x2c')][_0x1c85('0x3f')]));_0x55c4ad[_0x1c85('0x2f')]=_0x55c4ad['attributes'][_0x1c85('0x30')]?_0x55c4ad[_0x1c85('0x2f')]:_0x13e523[_0x1c85('0x2b')];_0x55c4ad['order']=qs[_0x1c85('0x33')](_0x2d8443['query'][_0x1c85('0x33')]);_0x55c4ad['where']=qs['filters'](_['pick'](_0x2d8443[_0x1c85('0x2c')],_0x13e523[_0x1c85('0x2d')]));if(_0x2d8443['query']['filter']){_0x55c4ad['where']=_[_0x1c85('0x36')](_0x55c4ad[_0x1c85('0x34')],{'$or':_[_0x1c85('0x27')](_0x55c4ad[_0x1c85('0x2f')],function(_0x3551f5){var _0x2d2c52={};_0x2d2c52[_0x3551f5]={'$like':'%'+_0x2d8443[_0x1c85('0x2c')]['filter']+'%'};return _0x2d2c52;})});}_0x55c4ad=_[_0x1c85('0x36')]({},_0x55c4ad,_0x2d8443[_0x1c85('0x40')]);return _0x43493b[_0x1c85('0x4a')](_0x55c4ad);}})[_0x1c85('0x22')](function(_0x3407e7){if(_0x3407e7){_0x4a87e4=_0x3407e7[_0x1c85('0x30')];if(!_0x2d8443['query'][_0x1c85('0x31')](_0x1c85('0x32'))){_0x55c4ad['limit']=qs['limit'](_0x2d8443[_0x1c85('0x2c')][_0x1c85('0x1b')]);_0x55c4ad['offset']=qs[_0x1c85('0x19')](_0x2d8443[_0x1c85('0x2c')][_0x1c85('0x19')]);}return _0x43493b[_0x1c85('0x4a')](_0x55c4ad);}})[_0x1c85('0x22')](function(_0x562244){if(_0x562244){return _0x562244?{'count':_0x4a87e4,'rows':_0x562244}:null;}})[_0x1c85('0x22')](respondWithResult(_0x18dda5,null))[_0x1c85('0x3b')](handleError(_0x18dda5,null));};exports[_0x1c85('0x4c')]=function(_0x46f864,_0x4ffd39,_0x518e0b){var _0x2155fe={};var _0x464f2e={};var _0x1e272c;var _0x2b79b6;return db[_0x1c85('0x39')][_0x1c85('0x4b')]({'where':{'id':_0x46f864[_0x1c85('0x3c')]['id']}})[_0x1c85('0x22')](handleEntityNotFound(_0x4ffd39,null))[_0x1c85('0x22')](function(_0x3be87f){if(_0x3be87f){_0x1e272c=_0x3be87f;_0x464f2e[_0x1c85('0x2b')]=_['keys'](db['ZohoField'][_0x1c85('0x3e')]);_0x464f2e['query']=_['keys'](_0x46f864['query']);_0x464f2e[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x464f2e[_0x1c85('0x2b')],_0x464f2e[_0x1c85('0x2c')]);_0x2155fe[_0x1c85('0x2f')]=_['intersection'](_0x464f2e[_0x1c85('0x2b')],qs[_0x1c85('0x3f')](_0x46f864[_0x1c85('0x2c')][_0x1c85('0x3f')]));_0x2155fe[_0x1c85('0x2f')]=_0x2155fe[_0x1c85('0x2f')][_0x1c85('0x30')]?_0x2155fe[_0x1c85('0x2f')]:_0x464f2e['model'];_0x2155fe[_0x1c85('0x47')]=qs[_0x1c85('0x33')](_0x46f864[_0x1c85('0x2c')][_0x1c85('0x33')]);_0x2155fe[_0x1c85('0x34')]=qs[_0x1c85('0x2d')](_[_0x1c85('0x48')](_0x46f864[_0x1c85('0x2c')],_0x464f2e[_0x1c85('0x2d')]));if(_0x46f864[_0x1c85('0x2c')][_0x1c85('0x35')]){_0x2155fe[_0x1c85('0x34')]=_['merge'](_0x2155fe['where'],{'$or':_['map'](_0x2155fe['attributes'],function(_0x57db0c){var _0x8ba533={};_0x8ba533[_0x57db0c]={'$like':'%'+_0x46f864['query']['filter']+'%'};return _0x8ba533;})});}_0x2155fe=_[_0x1c85('0x36')]({},_0x2155fe,_0x46f864[_0x1c85('0x40')]);return _0x1e272c[_0x1c85('0x4c')](_0x2155fe);}})[_0x1c85('0x22')](function(_0xb49a32){if(_0xb49a32){_0x2b79b6=_0xb49a32['length'];if(!_0x46f864[_0x1c85('0x2c')]['hasOwnProperty'](_0x1c85('0x32'))){_0x2155fe[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x46f864[_0x1c85('0x2c')]['limit']);_0x2155fe[_0x1c85('0x19')]=qs[_0x1c85('0x19')](_0x46f864[_0x1c85('0x2c')][_0x1c85('0x19')]);}return _0x1e272c[_0x1c85('0x4c')](_0x2155fe);}})['then'](function(_0x26bafc){if(_0x26bafc){return _0x26bafc?{'count':_0x2b79b6,'rows':_0x26bafc}:null;}})[_0x1c85('0x22')](respondWithResult(_0x4ffd39,null))[_0x1c85('0x3b')](handleError(_0x4ffd39,null));}; \ No newline at end of file +var _0xdc94=['findOne','ZohoField','pick','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','params','keys','include','find','create','body','catch'];(function(_0x225e85,_0x2fd3b6){var _0x476964=function(_0x3389e7){while(--_0x3389e7){_0x225e85['push'](_0x225e85['shift']());}};_0x476964(++_0x2fd3b6);}(_0xdc94,0xaa));var _0x4dc9=function(_0x3bc1c4,_0x543c2a){_0x3bc1c4=_0x3bc1c4-0x0;var _0x1e65c4=_0xdc94[_0x3bc1c4];return _0x1e65c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4dc9('0x0'));var zipdir=require(_0x4dc9('0x1'));var jsonpatch=require(_0x4dc9('0x2'));var rp=require('request-promise');var moment=require(_0x4dc9('0x3'));var BPromise=require(_0x4dc9('0x4'));var Mustache=require(_0x4dc9('0x5'));var util=require(_0x4dc9('0x6'));var path=require(_0x4dc9('0x7'));var sox=require(_0x4dc9('0x8'));var csv=require(_0x4dc9('0x9'));var ejs=require(_0x4dc9('0xa'));var fs=require('fs');var fs_extra=require(_0x4dc9('0xb'));var _=require(_0x4dc9('0xc'));var squel=require(_0x4dc9('0xd'));var crypto=require(_0x4dc9('0xe'));var jsforce=require(_0x4dc9('0xf'));var deskjs=require(_0x4dc9('0x10'));var toCsv=require(_0x4dc9('0x9'));var querystring=require(_0x4dc9('0x11'));var Papa=require('papaparse');var Redis=require(_0x4dc9('0x12'));var authService=require(_0x4dc9('0x13'));var qs=require(_0x4dc9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dc9('0x15'));var logger=require(_0x4dc9('0x16'))(_0x4dc9('0x17'));var utils=require('../../config/utils');var config=require(_0x4dc9('0x18'));var licenseUtil=require(_0x4dc9('0x19'));var db=require(_0x4dc9('0x1a'))['db'];function respondWithStatusCode(_0x3e9ce9,_0x19f1ab){_0x19f1ab=_0x19f1ab||0xcc;return function(_0xe1faa4){if(_0xe1faa4){return _0x3e9ce9[_0x4dc9('0x1b')](_0x19f1ab);}return _0x3e9ce9[_0x4dc9('0x1c')](_0x19f1ab)[_0x4dc9('0x1d')]();};}function respondWithResult(_0x184be0,_0x26dacb){_0x26dacb=_0x26dacb||0xc8;return function(_0x5575a6){if(_0x5575a6){return _0x184be0['status'](_0x26dacb)[_0x4dc9('0x1e')](_0x5575a6);}};}function respondWithFilteredResult(_0x34d63d,_0x46f9ee){return function(_0x35ee2a){if(_0x35ee2a){var _0x3f123a=typeof _0x46f9ee[_0x4dc9('0x1f')]===_0x4dc9('0x20')&&typeof _0x46f9ee['limit']===_0x4dc9('0x20');var _0x163097=_0x35ee2a['count'];var _0x4944ce=_0x3f123a?0x0:_0x46f9ee[_0x4dc9('0x1f')];var _0x4ca2ba=_0x3f123a?_0x35ee2a[_0x4dc9('0x21')]:_0x46f9ee[_0x4dc9('0x1f')]+_0x46f9ee[_0x4dc9('0x22')];var _0x530613;if(_0x4ca2ba>=_0x163097){_0x4ca2ba=_0x163097;_0x530613=0xc8;}else{_0x530613=0xce;}_0x34d63d[_0x4dc9('0x1c')](_0x530613);return _0x34d63d[_0x4dc9('0x23')]('Content-Range',_0x4944ce+'-'+_0x4ca2ba+'/'+_0x163097)[_0x4dc9('0x1e')](_0x35ee2a);}return null;};}function patchUpdates(_0x5b9b90){return function(_0x286cb3){try{jsonpatch[_0x4dc9('0x24')](_0x286cb3,_0x5b9b90,!![]);}catch(_0x14e341){return BPromise[_0x4dc9('0x25')](_0x14e341);}return _0x286cb3[_0x4dc9('0x26')]();};}function saveUpdates(_0xde6513,_0x4b3b5c){return function(_0x4a4d77){if(_0x4a4d77){return _0x4a4d77[_0x4dc9('0x27')](_0xde6513)['then'](function(_0x1aee4f){return _0x1aee4f;});}return null;};}function removeEntity(_0x47f670,_0x599e78){return function(_0x427f1e){if(_0x427f1e){return _0x427f1e[_0x4dc9('0x28')]()[_0x4dc9('0x29')](function(){_0x47f670[_0x4dc9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fb53,_0x4bf458){return function(_0x37c3a9){if(!_0x37c3a9){_0x10fb53[_0x4dc9('0x1b')](0x194);}return _0x37c3a9;};}function handleError(_0x320d5f,_0x4a482d){_0x4a482d=_0x4a482d||0x1f4;return function(_0x37cb66){logger[_0x4dc9('0x2a')](_0x37cb66['stack']);if(_0x37cb66['name']){delete _0x37cb66[_0x4dc9('0x2b')];}_0x320d5f[_0x4dc9('0x1c')](_0x4a482d)['send'](_0x37cb66);};}exports[_0x4dc9('0x2c')]=function(_0x1dab92,_0x329b28){var _0x11873f={},_0x1e721f={},_0x1ddf7b={'count':0x0,'rows':[]};var _0x5aa8c8=_[_0x4dc9('0x2d')](db[_0x4dc9('0x2e')][_0x4dc9('0x2f')],function(_0x471325){return{'name':_0x471325[_0x4dc9('0x30')],'type':_0x471325[_0x4dc9('0x31')][_0x4dc9('0x32')]};});_0x1e721f[_0x4dc9('0x33')]=_[_0x4dc9('0x2d')](_0x5aa8c8,_0x4dc9('0x2b'));_0x1e721f[_0x4dc9('0x34')]=_['keys'](_0x1dab92[_0x4dc9('0x34')]);_0x1e721f[_0x4dc9('0x35')]=_[_0x4dc9('0x36')](_0x1e721f['model'],_0x1e721f[_0x4dc9('0x34')]);_0x11873f[_0x4dc9('0x37')]=_[_0x4dc9('0x36')](_0x1e721f['model'],qs[_0x4dc9('0x38')](_0x1dab92[_0x4dc9('0x34')][_0x4dc9('0x38')]));_0x11873f['attributes']=_0x11873f[_0x4dc9('0x37')][_0x4dc9('0x39')]?_0x11873f[_0x4dc9('0x37')]:_0x1e721f[_0x4dc9('0x33')];if(!_0x1dab92[_0x4dc9('0x34')][_0x4dc9('0x3a')](_0x4dc9('0x3b'))){_0x11873f[_0x4dc9('0x22')]=qs[_0x4dc9('0x22')](_0x1dab92['query'][_0x4dc9('0x22')]);_0x11873f['offset']=qs['offset'](_0x1dab92[_0x4dc9('0x34')]['offset']);}_0x11873f[_0x4dc9('0x3c')]=qs['sort'](_0x1dab92[_0x4dc9('0x34')][_0x4dc9('0x3d')]);_0x11873f['where']=qs[_0x4dc9('0x35')](_['pick'](_0x1dab92['query'],_0x1e721f[_0x4dc9('0x35')]),_0x5aa8c8);if(_0x1dab92[_0x4dc9('0x34')][_0x4dc9('0x3e')]){_0x11873f[_0x4dc9('0x3f')]=_[_0x4dc9('0x40')](_0x11873f['where'],{'$or':_[_0x4dc9('0x2d')](_0x5aa8c8,function(_0x405c77){if(_0x405c77[_0x4dc9('0x31')]!==_0x4dc9('0x41')){var _0x5dae03={};_0x5dae03[_0x405c77[_0x4dc9('0x2b')]]={'$like':'%'+_0x1dab92['query'][_0x4dc9('0x3e')]+'%'};return _0x5dae03;}})});}_0x11873f=_['merge']({},_0x11873f,_0x1dab92[_0x4dc9('0x42')]);var _0x1cdb24={'where':_0x11873f[_0x4dc9('0x3f')]};return db[_0x4dc9('0x2e')][_0x4dc9('0x21')](_0x1cdb24)[_0x4dc9('0x29')](function(_0x14f304){_0x1ddf7b['count']=_0x14f304;if(_0x1dab92[_0x4dc9('0x34')][_0x4dc9('0x43')]){_0x11873f['include']=[{'all':!![]}];}return db[_0x4dc9('0x2e')][_0x4dc9('0x44')](_0x11873f);})[_0x4dc9('0x29')](function(_0x2d270a){_0x1ddf7b['rows']=_0x2d270a;return _0x1ddf7b;})[_0x4dc9('0x29')](respondWithFilteredResult(_0x329b28,_0x11873f))['catch'](handleError(_0x329b28,null));};exports['show']=function(_0x2f2ade,_0x47113f){var _0x2d24f2={'raw':![],'where':{'id':_0x2f2ade[_0x4dc9('0x45')]['id']}},_0x2ac653={};_0x2ac653[_0x4dc9('0x33')]=_[_0x4dc9('0x46')](db['ZohoConfiguration'][_0x4dc9('0x2f')]);_0x2ac653[_0x4dc9('0x34')]=_[_0x4dc9('0x46')](_0x2f2ade[_0x4dc9('0x34')]);_0x2ac653[_0x4dc9('0x35')]=_[_0x4dc9('0x36')](_0x2ac653[_0x4dc9('0x33')],_0x2ac653['query']);_0x2d24f2[_0x4dc9('0x37')]=_[_0x4dc9('0x36')](_0x2ac653['model'],qs[_0x4dc9('0x38')](_0x2f2ade[_0x4dc9('0x34')][_0x4dc9('0x38')]));_0x2d24f2[_0x4dc9('0x37')]=_0x2d24f2[_0x4dc9('0x37')][_0x4dc9('0x39')]?_0x2d24f2[_0x4dc9('0x37')]:_0x2ac653[_0x4dc9('0x33')];if(_0x2f2ade[_0x4dc9('0x34')]['includeAll']){_0x2d24f2[_0x4dc9('0x47')]=[{'all':!![]}];}_0x2d24f2=_[_0x4dc9('0x40')]({},_0x2d24f2,_0x2f2ade[_0x4dc9('0x42')]);return db[_0x4dc9('0x2e')][_0x4dc9('0x48')](_0x2d24f2)['then'](handleEntityNotFound(_0x47113f,null))[_0x4dc9('0x29')](respondWithResult(_0x47113f,null))['catch'](handleError(_0x47113f,null));};exports[_0x4dc9('0x49')]=function(_0x23d4e5,_0x2c50c3){return db['ZohoConfiguration'][_0x4dc9('0x49')](_0x23d4e5[_0x4dc9('0x4a')],{})[_0x4dc9('0x29')](respondWithResult(_0x2c50c3,0xc9))[_0x4dc9('0x4b')](handleError(_0x2c50c3,null));};exports[_0x4dc9('0x27')]=function(_0x26b314,_0x412760){if(_0x26b314['body']['id']){delete _0x26b314[_0x4dc9('0x4a')]['id'];}return db['ZohoConfiguration'][_0x4dc9('0x48')]({'where':{'id':_0x26b314['params']['id']}})[_0x4dc9('0x29')](handleEntityNotFound(_0x412760,null))[_0x4dc9('0x29')](saveUpdates(_0x26b314[_0x4dc9('0x4a')],null))[_0x4dc9('0x29')](respondWithResult(_0x412760,null))[_0x4dc9('0x4b')](handleError(_0x412760,null));};exports[_0x4dc9('0x28')]=function(_0x41c978,_0x2f89be){return db[_0x4dc9('0x2e')][_0x4dc9('0x48')]({'where':{'id':_0x41c978['params']['id']}})['then'](handleEntityNotFound(_0x2f89be,null))['then'](removeEntity(_0x2f89be,null))[_0x4dc9('0x4b')](handleError(_0x2f89be,null));};exports['getFields']=function(_0x313cfb,_0x411da1,_0x2a9cc1){var _0x56a01d={};var _0x16aca3={};var _0x30098d;var _0x58e8c4;return db[_0x4dc9('0x2e')][_0x4dc9('0x4c')]({'where':{'id':_0x313cfb[_0x4dc9('0x45')]['id']}})[_0x4dc9('0x29')](handleEntityNotFound(_0x411da1,null))[_0x4dc9('0x29')](function(_0x579226){if(_0x579226){_0x30098d=_0x579226;_0x16aca3['model']=_[_0x4dc9('0x46')](db[_0x4dc9('0x4d')]['rawAttributes']);_0x16aca3['query']=_[_0x4dc9('0x46')](_0x313cfb[_0x4dc9('0x34')]);_0x16aca3[_0x4dc9('0x35')]=_['intersection'](_0x16aca3['model'],_0x16aca3[_0x4dc9('0x34')]);_0x56a01d['attributes']=_[_0x4dc9('0x36')](_0x16aca3[_0x4dc9('0x33')],qs['fields'](_0x313cfb[_0x4dc9('0x34')][_0x4dc9('0x38')]));_0x56a01d[_0x4dc9('0x37')]=_0x56a01d['attributes']['length']?_0x56a01d['attributes']:_0x16aca3[_0x4dc9('0x33')];_0x56a01d[_0x4dc9('0x3c')]=qs[_0x4dc9('0x3d')](_0x313cfb['query'][_0x4dc9('0x3d')]);_0x56a01d[_0x4dc9('0x3f')]=qs['filters'](_[_0x4dc9('0x4e')](_0x313cfb['query'],_0x16aca3[_0x4dc9('0x35')]));if(_0x313cfb['query'][_0x4dc9('0x3e')]){_0x56a01d['where']=_[_0x4dc9('0x40')](_0x56a01d['where'],{'$or':_[_0x4dc9('0x2d')](_0x56a01d[_0x4dc9('0x37')],function(_0x4ea21b){var _0x2c0731={};_0x2c0731[_0x4ea21b]={'$like':'%'+_0x313cfb['query'][_0x4dc9('0x3e')]+'%'};return _0x2c0731;})});}_0x56a01d=_['merge']({},_0x56a01d,_0x313cfb[_0x4dc9('0x42')]);return _0x30098d[_0x4dc9('0x4f')](_0x56a01d);}})[_0x4dc9('0x29')](function(_0xa7148b){if(_0xa7148b){_0x58e8c4=_0xa7148b[_0x4dc9('0x39')];if(!_0x313cfb[_0x4dc9('0x34')]['hasOwnProperty'](_0x4dc9('0x3b'))){_0x56a01d['limit']=qs[_0x4dc9('0x22')](_0x313cfb[_0x4dc9('0x34')]['limit']);_0x56a01d['offset']=qs[_0x4dc9('0x1f')](_0x313cfb[_0x4dc9('0x34')]['offset']);}return _0x30098d[_0x4dc9('0x4f')](_0x56a01d);}})['then'](function(_0x1f008c){if(_0x1f008c){return _0x1f008c?{'count':_0x58e8c4,'rows':_0x1f008c}:null;}})[_0x4dc9('0x29')](respondWithResult(_0x411da1,null))['catch'](handleError(_0x411da1,null));};exports[_0x4dc9('0x50')]=function(_0x580b51,_0x120b0d,_0x1aee7a){var _0x5e4ffc={};var _0xbff9f0={};var _0x188fcc;var _0x362f7;return db[_0x4dc9('0x2e')]['findOne']({'where':{'id':_0x580b51['params']['id']}})[_0x4dc9('0x29')](handleEntityNotFound(_0x120b0d,null))[_0x4dc9('0x29')](function(_0x2e6725){if(_0x2e6725){_0x188fcc=_0x2e6725;_0xbff9f0['model']=_[_0x4dc9('0x46')](db[_0x4dc9('0x4d')][_0x4dc9('0x2f')]);_0xbff9f0[_0x4dc9('0x34')]=_['keys'](_0x580b51[_0x4dc9('0x34')]);_0xbff9f0[_0x4dc9('0x35')]=_[_0x4dc9('0x36')](_0xbff9f0[_0x4dc9('0x33')],_0xbff9f0['query']);_0x5e4ffc[_0x4dc9('0x37')]=_[_0x4dc9('0x36')](_0xbff9f0[_0x4dc9('0x33')],qs['fields'](_0x580b51['query'][_0x4dc9('0x38')]));_0x5e4ffc[_0x4dc9('0x37')]=_0x5e4ffc[_0x4dc9('0x37')][_0x4dc9('0x39')]?_0x5e4ffc[_0x4dc9('0x37')]:_0xbff9f0['model'];_0x5e4ffc[_0x4dc9('0x3c')]=qs[_0x4dc9('0x3d')](_0x580b51[_0x4dc9('0x34')]['sort']);_0x5e4ffc[_0x4dc9('0x3f')]=qs['filters'](_[_0x4dc9('0x4e')](_0x580b51[_0x4dc9('0x34')],_0xbff9f0[_0x4dc9('0x35')]));if(_0x580b51[_0x4dc9('0x34')][_0x4dc9('0x3e')]){_0x5e4ffc[_0x4dc9('0x3f')]=_[_0x4dc9('0x40')](_0x5e4ffc[_0x4dc9('0x3f')],{'$or':_[_0x4dc9('0x2d')](_0x5e4ffc[_0x4dc9('0x37')],function(_0x1de9af){var _0x46918a={};_0x46918a[_0x1de9af]={'$like':'%'+_0x580b51['query'][_0x4dc9('0x3e')]+'%'};return _0x46918a;})});}_0x5e4ffc=_[_0x4dc9('0x40')]({},_0x5e4ffc,_0x580b51[_0x4dc9('0x42')]);return _0x188fcc[_0x4dc9('0x50')](_0x5e4ffc);}})['then'](function(_0x111df6){if(_0x111df6){_0x362f7=_0x111df6['length'];if(!_0x580b51[_0x4dc9('0x34')][_0x4dc9('0x3a')]('nolimit')){_0x5e4ffc[_0x4dc9('0x22')]=qs[_0x4dc9('0x22')](_0x580b51[_0x4dc9('0x34')]['limit']);_0x5e4ffc[_0x4dc9('0x1f')]=qs[_0x4dc9('0x1f')](_0x580b51[_0x4dc9('0x34')][_0x4dc9('0x1f')]);}return _0x188fcc['getSubjects'](_0x5e4ffc);}})[_0x4dc9('0x29')](function(_0x3941ab){if(_0x3941ab){return _0x3941ab?{'count':_0x362f7,'rows':_0x3941ab}:null;}})[_0x4dc9('0x29')](respondWithResult(_0x120b0d,null))[_0x4dc9('0x4b')](handleError(_0x120b0d,null));};exports[_0x4dc9('0x51')]=function(_0x1f5578,_0x20fd40,_0x2ff175){var _0x5af369={};var _0x307642={};var _0x3a715b;var _0x9e41d1;return db[_0x4dc9('0x2e')][_0x4dc9('0x4c')]({'where':{'id':_0x1f5578[_0x4dc9('0x45')]['id']}})['then'](handleEntityNotFound(_0x20fd40,null))[_0x4dc9('0x29')](function(_0x5e98e5){if(_0x5e98e5){_0x3a715b=_0x5e98e5;_0x307642[_0x4dc9('0x33')]=_[_0x4dc9('0x46')](db[_0x4dc9('0x4d')][_0x4dc9('0x2f')]);_0x307642[_0x4dc9('0x34')]=_[_0x4dc9('0x46')](_0x1f5578[_0x4dc9('0x34')]);_0x307642['filters']=_[_0x4dc9('0x36')](_0x307642['model'],_0x307642[_0x4dc9('0x34')]);_0x5af369[_0x4dc9('0x37')]=_[_0x4dc9('0x36')](_0x307642['model'],qs[_0x4dc9('0x38')](_0x1f5578[_0x4dc9('0x34')]['fields']));_0x5af369[_0x4dc9('0x37')]=_0x5af369[_0x4dc9('0x37')][_0x4dc9('0x39')]?_0x5af369[_0x4dc9('0x37')]:_0x307642[_0x4dc9('0x33')];_0x5af369['order']=qs['sort'](_0x1f5578['query'][_0x4dc9('0x3d')]);_0x5af369['where']=qs[_0x4dc9('0x35')](_['pick'](_0x1f5578[_0x4dc9('0x34')],_0x307642[_0x4dc9('0x35')]));if(_0x1f5578[_0x4dc9('0x34')]['filter']){_0x5af369[_0x4dc9('0x3f')]=_[_0x4dc9('0x40')](_0x5af369[_0x4dc9('0x3f')],{'$or':_[_0x4dc9('0x2d')](_0x5af369[_0x4dc9('0x37')],function(_0x480853){var _0x59bc23={};_0x59bc23[_0x480853]={'$like':'%'+_0x1f5578[_0x4dc9('0x34')][_0x4dc9('0x3e')]+'%'};return _0x59bc23;})});}_0x5af369=_[_0x4dc9('0x40')]({},_0x5af369,_0x1f5578[_0x4dc9('0x42')]);return _0x3a715b['getDescriptions'](_0x5af369);}})[_0x4dc9('0x29')](function(_0x4fd8bd){if(_0x4fd8bd){_0x9e41d1=_0x4fd8bd[_0x4dc9('0x39')];if(!_0x1f5578[_0x4dc9('0x34')][_0x4dc9('0x3a')](_0x4dc9('0x3b'))){_0x5af369['limit']=qs[_0x4dc9('0x22')](_0x1f5578[_0x4dc9('0x34')][_0x4dc9('0x22')]);_0x5af369[_0x4dc9('0x1f')]=qs[_0x4dc9('0x1f')](_0x1f5578[_0x4dc9('0x34')][_0x4dc9('0x1f')]);}return _0x3a715b['getDescriptions'](_0x5af369);}})[_0x4dc9('0x29')](function(_0x33fdea){if(_0x33fdea){return _0x33fdea?{'count':_0x9e41d1,'rows':_0x33fdea}:null;}})[_0x4dc9('0x29')](respondWithResult(_0x20fd40,null))[_0x4dc9('0x4b')](handleError(_0x20fd40,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 732b01a..15ac745 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 _0x76f3=['api','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x1b62d6,_0x57e79d){var _0x4d9fd8=function(_0xc1fcf8){while(--_0xc1fcf8){_0x1b62d6['push'](_0x1b62d6['shift']());}};_0x4d9fd8(++_0x57e79d);}(_0x76f3,0x14d));var _0x376f=function(_0x201d2f,_0x576bed){_0x201d2f=_0x201d2f-0x0;var _0x3c48d5=_0x76f3[_0x201d2f];return _0x3c48d5;};'use strict';var _=require(_0x376f('0x0'));var util=require(_0x376f('0x1'));var logger=require(_0x376f('0x2'))(_0x376f('0x3'));var moment=require(_0x376f('0x4'));var BPromise=require(_0x376f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x376f('0x6'));var rimraf=require(_0x376f('0x7'));var config=require('../../config/environment');var attributes=require(_0x376f('0x8'));module['exports']=function(_0x24c3f6,_0x5b0c49){return _0x24c3f6[_0x376f('0x9')](_0x376f('0xa'),attributes,{'tableName':_0x376f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f40=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0x3f40,0xb4));var _0x03f4=function(_0x213bf1,_0x15ad38){_0x213bf1=_0x213bf1-0x0;var _0x3dad58=_0x3f40[_0x213bf1];return _0x3dad58;};'use strict';var _=require(_0x03f4('0x0'));var util=require(_0x03f4('0x1'));var logger=require('../../config/logger')(_0x03f4('0x2'));var moment=require(_0x03f4('0x3'));var BPromise=require(_0x03f4('0x4'));var rp=require(_0x03f4('0x5'));var fs=require('fs');var path=require(_0x03f4('0x6'));var rimraf=require(_0x03f4('0x7'));var config=require('../../config/environment');var attributes=require(_0x03f4('0x8'));module[_0x03f4('0x9')]=function(_0x57c1a9,_0x15a1d4){return _0x57c1a9[_0x03f4('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x03f4('0xb'),'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 ddd0efa..a65042b 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 _0x9a5d=['../../config/utils','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x563bc4,_0x366bb8){var _0x145b45=function(_0x1d3b9f){while(--_0x1d3b9f){_0x563bc4['push'](_0x563bc4['shift']());}};_0x145b45(++_0x366bb8);}(_0x9a5d,0x160));var _0xd9a5=function(_0x5acaf0,_0x17a779){_0x5acaf0=_0x5acaf0-0x0;var _0x1bd9c3=_0x9a5d[_0x5acaf0];return _0x1bd9c3;};'use strict';var _=require(_0xd9a5('0x0'));var util=require(_0xd9a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd9a5('0x2'));var fs=require('fs');var Redis=require(_0xd9a5('0x3'));var db=require(_0xd9a5('0x4'))['db'];var utils=require(_0xd9a5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd9a5('0x6'));var client=jayson[_0xd9a5('0x7')][_0xd9a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a54a0,_0x34a402,_0x2b978c){return new BPromise(function(_0x4a2c50,_0x23cba5){return client[_0xd9a5('0x9')](_0x4a54a0,_0x2b978c)[_0xd9a5('0xa')](function(_0x5d12e3){logger[_0xd9a5('0xb')](_0xd9a5('0xc'),_0x34a402,'request\x20sent');logger['debug'](_0xd9a5('0xd'),_0x34a402,_0xd9a5('0xe'),JSON[_0xd9a5('0xf')](_0x5d12e3));if(_0x5d12e3[_0xd9a5('0x10')]){if(_0x5d12e3['error'][_0xd9a5('0x11')]===0x1f4){logger[_0xd9a5('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x34a402,_0x5d12e3[_0xd9a5('0x10')]['message']);return _0x23cba5(_0x5d12e3[_0xd9a5('0x10')][_0xd9a5('0x12')]);}logger[_0xd9a5('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x34a402,_0x5d12e3[_0xd9a5('0x10')][_0xd9a5('0x12')]);return _0x4a2c50(_0x5d12e3[_0xd9a5('0x10')][_0xd9a5('0x12')]);}else{logger[_0xd9a5('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x34a402,_0xd9a5('0xe'));_0x4a2c50(_0x5d12e3[_0xd9a5('0x13')]['message']);}})[_0xd9a5('0x14')](function(_0x43a51e){logger['error'](_0xd9a5('0xc'),_0x34a402,_0x43a51e);_0x23cba5(_0x43a51e);});});} \ No newline at end of file +var _0x1bfc=['stringify','code','message','error','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x405f48,_0x2a3f51){var _0xc6368c=function(_0x34f5e4){while(--_0x34f5e4){_0x405f48['push'](_0x405f48['shift']());}};_0xc6368c(++_0x2a3f51);}(_0x1bfc,0x125));var _0xc1bf=function(_0x8a4d1b,_0x2240ed){_0x8a4d1b=_0x8a4d1b-0x0;var _0x1d1ad9=_0x1bfc[_0x8a4d1b];return _0x1d1ad9;};'use strict';var _=require(_0xc1bf('0x0'));var util=require(_0xc1bf('0x1'));var moment=require(_0xc1bf('0x2'));var BPromise=require(_0xc1bf('0x3'));var rs=require(_0xc1bf('0x4'));var fs=require('fs');var Redis=require(_0xc1bf('0x5'));var db=require(_0xc1bf('0x6'))['db'];var utils=require(_0xc1bf('0x7'));var logger=require(_0xc1bf('0x8'))(_0xc1bf('0x9'));var config=require(_0xc1bf('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc1bf('0xb')][_0xc1bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33d7f6,_0x557fe0,_0x314a70){return new BPromise(function(_0x569441,_0xb94bbe){return client['request'](_0x33d7f6,_0x314a70)[_0xc1bf('0xd')](function(_0x2bb814){logger[_0xc1bf('0xe')](_0xc1bf('0xf'),_0x557fe0,_0xc1bf('0x10'));logger[_0xc1bf('0x11')](_0xc1bf('0x12'),_0x557fe0,_0xc1bf('0x10'),JSON[_0xc1bf('0x13')](_0x2bb814));if(_0x2bb814['error']){if(_0x2bb814['error'][_0xc1bf('0x14')]===0x1f4){logger['error'](_0xc1bf('0xf'),_0x557fe0,_0x2bb814['error'][_0xc1bf('0x15')]);return _0xb94bbe(_0x2bb814['error'][_0xc1bf('0x15')]);}logger[_0xc1bf('0x16')]('ZohoConfiguration,\x20%s,\x20%s',_0x557fe0,_0x2bb814[_0xc1bf('0x16')]['message']);return _0x569441(_0x2bb814[_0xc1bf('0x16')]['message']);}else{logger[_0xc1bf('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x557fe0,_0xc1bf('0x10'));_0x569441(_0x2bb814[_0xc1bf('0x17')][_0xc1bf('0x15')]);}})['catch'](function(_0x2d46f5){logger[_0xc1bf('0x16')]('ZohoConfiguration,\x20%s,\x20%s',_0x557fe0,_0x2d46f5);_0xb94bbe(_0x2d46f5);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 24fad9f..eee3571 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 _0xd98a=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xd98a,0x156));var _0xad98=function(_0x119512,_0x5ae5a7){_0x119512=_0x119512-0x0;var _0x251bfc=_0xd98a[_0x119512];return _0x251bfc;};'use strict';var multer=require(_0xad98('0x0'));var util=require(_0xad98('0x1'));var path=require(_0xad98('0x2'));var timeout=require(_0xad98('0x3'));var express=require(_0xad98('0x4'));var router=express['Router']();var fs_extra=require(_0xad98('0x5'));var auth=require(_0xad98('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad98('0x7'));var controller=require(_0xad98('0x8'));router[_0xad98('0x9')]('/',auth[_0xad98('0xa')](),controller[_0xad98('0xb')]);router[_0xad98('0x9')](_0xad98('0xc'),auth[_0xad98('0xa')](),controller['show']);router[_0xad98('0xd')]('/',auth[_0xad98('0xa')](),controller[_0xad98('0xe')]);router[_0xad98('0xf')]('/:id',auth[_0xad98('0xa')](),controller['update']);router[_0xad98('0x10')](_0xad98('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xad98('0x11')]=router; \ No newline at end of file +var _0x981b=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4cfa86,_0x1d0945){var _0x5c5fe0=function(_0x3b45ad){while(--_0x3b45ad){_0x4cfa86['push'](_0x4cfa86['shift']());}};_0x5c5fe0(++_0x1d0945);}(_0x981b,0xfd));var _0xb981=function(_0x1a900b,_0x22eefc){_0x1a900b=_0x1a900b-0x0;var _0x16dbbd=_0x981b[_0x1a900b];return _0x16dbbd;};'use strict';var multer=require(_0xb981('0x0'));var util=require(_0xb981('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb981('0x2'));var router=express[_0xb981('0x3')]();var fs_extra=require(_0xb981('0x4'));var auth=require(_0xb981('0x5'));var interaction=require(_0xb981('0x6'));var config=require(_0xb981('0x7'));var controller=require(_0xb981('0x8'));router[_0xb981('0x9')]('/',auth[_0xb981('0xa')](),controller[_0xb981('0xb')]);router['get'](_0xb981('0xc'),auth[_0xb981('0xa')](),controller[_0xb981('0xd')]);router[_0xb981('0xe')]('/',auth[_0xb981('0xa')](),controller[_0xb981('0xf')]);router[_0xb981('0x10')](_0xb981('0xc'),auth[_0xb981('0xa')](),controller['update']);router[_0xb981('0x11')](_0xb981('0xc'),auth[_0xb981('0xa')](),controller[_0xb981('0x12')]);module[_0xb981('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 69e0146..27fdbc6 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 _0xf136=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string'];(function(_0x5ee748,_0x552a2b){var _0x36da37=function(_0x22cc48){while(--_0x22cc48){_0x5ee748['push'](_0x5ee748['shift']());}};_0x36da37(++_0x552a2b);}(_0xf136,0x6e));var _0x6f13=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xf136[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0x6f13('0x0'));module[_0x6f13('0x1')]={'type':{'type':Sequelize[_0x6f13('0x2')]('string',_0x6f13('0x3'),_0x6f13('0x4'),'keyValue',_0x6f13('0x5')),'defaultValue':_0x6f13('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6f13('0x7')]},'keyType':{'type':Sequelize[_0x6f13('0x2')](_0x6f13('0x6'),_0x6f13('0x3'),_0x6f13('0x4'))},'keyContent':{'type':Sequelize[_0x6f13('0x7')]},'idField':{'type':Sequelize[_0x6f13('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6f13('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f13('0x7')]}}; \ No newline at end of file +var _0xe60a=['variable','BOOLEAN','sequelize','ENUM','string','customVariable','STRING'];(function(_0x444257,_0x125819){var _0x564feb=function(_0xf7eb98){while(--_0xf7eb98){_0x444257['push'](_0x444257['shift']());}};_0x564feb(++_0x125819);}(_0xe60a,0x191));var _0xae60=function(_0x4c7557,_0x49c195){_0x4c7557=_0x4c7557-0x0;var _0x22128f=_0xe60a[_0x4c7557];return _0x22128f;};'use strict';var Sequelize=require(_0xae60('0x0'));module['exports']={'type':{'type':Sequelize[_0xae60('0x1')](_0xae60('0x2'),'variable',_0xae60('0x3'),'keyValue','picklist'),'defaultValue':_0xae60('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xae60('0x4')]},'keyType':{'type':Sequelize[_0xae60('0x1')](_0xae60('0x2'),_0xae60('0x5'),_0xae60('0x3'))},'keyContent':{'type':Sequelize[_0xae60('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xae60('0x4')]},'customField':{'type':Sequelize[_0xae60('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae60('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 47ef624..1c57256 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 _0x9785=['intersection','attributes','fields','nolimit','limit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','show','params','keys','rawAttributes','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','ZohoField','fieldName','type','model','query'];(function(_0x2cc8fd,_0x255668){var _0x4de825=function(_0xe36873){while(--_0xe36873){_0x2cc8fd['push'](_0x2cc8fd['shift']());}};_0x4de825(++_0x255668);}(_0x9785,0x133));var _0x5978=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9785[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0x5978('0x0'));var rimraf=require(_0x5978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5978('0x2'));var rp=require(_0x5978('0x3'));var moment=require(_0x5978('0x4'));var BPromise=require(_0x5978('0x5'));var Mustache=require(_0x5978('0x6'));var util=require(_0x5978('0x7'));var path=require('path');var sox=require(_0x5978('0x8'));var csv=require(_0x5978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5978('0xa'));var crypto=require(_0x5978('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5978('0x9'));var querystring=require(_0x5978('0xc'));var Papa=require(_0x5978('0xd'));var Redis=require('ioredis');var authService=require(_0x5978('0xe'));var qs=require(_0x5978('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5978('0x10'));var logger=require(_0x5978('0x11'))(_0x5978('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5978('0x13'));var db=require(_0x5978('0x14'))['db'];function respondWithStatusCode(_0x4a7a20,_0xbebbd9){_0xbebbd9=_0xbebbd9||0xcc;return function(_0x49a7bb){if(_0x49a7bb){return _0x4a7a20['sendStatus'](_0xbebbd9);}return _0x4a7a20['status'](_0xbebbd9)[_0x5978('0x15')]();};}function respondWithResult(_0x3c3b3a,_0x1089ea){_0x1089ea=_0x1089ea||0xc8;return function(_0x133f79){if(_0x133f79){return _0x3c3b3a[_0x5978('0x16')](_0x1089ea)['json'](_0x133f79);}};}function respondWithFilteredResult(_0x5d820a,_0x3607be){return function(_0x6795c8){if(_0x6795c8){var _0x138c13=typeof _0x3607be[_0x5978('0x17')]==='undefined'&&typeof _0x3607be['limit']===_0x5978('0x18');var _0x1b5b8b=_0x6795c8[_0x5978('0x19')];var _0x56286c=_0x138c13?0x0:_0x3607be[_0x5978('0x17')];var _0x1cba78=_0x138c13?_0x6795c8[_0x5978('0x19')]:_0x3607be[_0x5978('0x17')]+_0x3607be['limit'];var _0x41efb0;if(_0x1cba78>=_0x1b5b8b){_0x1cba78=_0x1b5b8b;_0x41efb0=0xc8;}else{_0x41efb0=0xce;}_0x5d820a['status'](_0x41efb0);return _0x5d820a[_0x5978('0x1a')]('Content-Range',_0x56286c+'-'+_0x1cba78+'/'+_0x1b5b8b)[_0x5978('0x1b')](_0x6795c8);}return null;};}function patchUpdates(_0x5085dd){return function(_0x1b21eb){try{jsonpatch[_0x5978('0x1c')](_0x1b21eb,_0x5085dd,!![]);}catch(_0x2daf22){return BPromise[_0x5978('0x1d')](_0x2daf22);}return _0x1b21eb[_0x5978('0x1e')]();};}function saveUpdates(_0x416582,_0x50e299){return function(_0x1e2e1a){if(_0x1e2e1a){return _0x1e2e1a[_0x5978('0x1f')](_0x416582)['then'](function(_0x384cd4){return _0x384cd4;});}return null;};}function removeEntity(_0x547703,_0x4f5c76){return function(_0x5ea79c){if(_0x5ea79c){return _0x5ea79c[_0x5978('0x20')]()['then'](function(){_0x547703[_0x5978('0x16')](0xcc)[_0x5978('0x15')]();});}};}function handleEntityNotFound(_0x17f5dd,_0x459d97){return function(_0x496595){if(!_0x496595){_0x17f5dd[_0x5978('0x21')](0x194);}return _0x496595;};}function handleError(_0x366ab1,_0xf872ac){_0xf872ac=_0xf872ac||0x1f4;return function(_0xe03c41){logger['error'](_0xe03c41[_0x5978('0x22')]);if(_0xe03c41[_0x5978('0x23')]){delete _0xe03c41[_0x5978('0x23')];}_0x366ab1[_0x5978('0x16')](_0xf872ac)[_0x5978('0x24')](_0xe03c41);};}exports['index']=function(_0x90d075,_0x303f57){var _0x528126={},_0x41426f={},_0x4402c0={'count':0x0,'rows':[]};var _0x1f2847=_[_0x5978('0x25')](db[_0x5978('0x26')]['rawAttributes'],function(_0x1b29bd){return{'name':_0x1b29bd[_0x5978('0x27')],'type':_0x1b29bd[_0x5978('0x28')]['key']};});_0x41426f[_0x5978('0x29')]=_['map'](_0x1f2847,_0x5978('0x23'));_0x41426f[_0x5978('0x2a')]=_['keys'](_0x90d075[_0x5978('0x2a')]);_0x41426f['filters']=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],_0x41426f['query']);_0x528126[_0x5978('0x2c')]=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],qs[_0x5978('0x2d')](_0x90d075[_0x5978('0x2a')]['fields']));_0x528126['attributes']=_0x528126[_0x5978('0x2c')]['length']?_0x528126['attributes']:_0x41426f[_0x5978('0x29')];if(!_0x90d075['query']['hasOwnProperty'](_0x5978('0x2e'))){_0x528126[_0x5978('0x2f')]=qs[_0x5978('0x2f')](_0x90d075[_0x5978('0x2a')][_0x5978('0x2f')]);_0x528126[_0x5978('0x17')]=qs[_0x5978('0x17')](_0x90d075[_0x5978('0x2a')][_0x5978('0x17')]);}_0x528126[_0x5978('0x30')]=qs['sort'](_0x90d075[_0x5978('0x2a')]['sort']);_0x528126['where']=qs[_0x5978('0x31')](_[_0x5978('0x32')](_0x90d075['query'],_0x41426f[_0x5978('0x31')]),_0x1f2847);if(_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]){_0x528126[_0x5978('0x34')]=_[_0x5978('0x35')](_0x528126[_0x5978('0x34')],{'$or':_[_0x5978('0x25')](_0x1f2847,function(_0x41f8de){if(_0x41f8de[_0x5978('0x28')]!==_0x5978('0x36')){var _0x1d3414={};_0x1d3414[_0x41f8de['name']]={'$like':'%'+_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]+'%'};return _0x1d3414;}})});}_0x528126=_['merge']({},_0x528126,_0x90d075[_0x5978('0x37')]);var _0x3cf252={'where':_0x528126['where']};return db[_0x5978('0x26')][_0x5978('0x19')](_0x3cf252)['then'](function(_0x189134){_0x4402c0[_0x5978('0x19')]=_0x189134;if(_0x90d075[_0x5978('0x2a')][_0x5978('0x38')]){_0x528126[_0x5978('0x39')]=[{'all':!![]}];}return db[_0x5978('0x26')][_0x5978('0x3a')](_0x528126);})['then'](function(_0x3b2dce){_0x4402c0[_0x5978('0x3b')]=_0x3b2dce;return _0x4402c0;})[_0x5978('0x3c')](respondWithFilteredResult(_0x303f57,_0x528126))['catch'](handleError(_0x303f57,null));};exports[_0x5978('0x3d')]=function(_0x552ae1,_0x35472f){var _0x1bb298={'raw':!![],'where':{'id':_0x552ae1[_0x5978('0x3e')]['id']}},_0x36f7ee={};_0x36f7ee[_0x5978('0x29')]=_[_0x5978('0x3f')](db[_0x5978('0x26')][_0x5978('0x40')]);_0x36f7ee[_0x5978('0x2a')]=_[_0x5978('0x3f')](_0x552ae1[_0x5978('0x2a')]);_0x36f7ee[_0x5978('0x31')]=_[_0x5978('0x2b')](_0x36f7ee['model'],_0x36f7ee[_0x5978('0x2a')]);_0x1bb298['attributes']=_[_0x5978('0x2b')](_0x36f7ee['model'],qs[_0x5978('0x2d')](_0x552ae1[_0x5978('0x2a')]['fields']));_0x1bb298[_0x5978('0x2c')]=_0x1bb298[_0x5978('0x2c')][_0x5978('0x41')]?_0x1bb298[_0x5978('0x2c')]:_0x36f7ee[_0x5978('0x29')];if(_0x552ae1['query']['includeAll']){_0x1bb298[_0x5978('0x39')]=[{'all':!![]}];}_0x1bb298=_[_0x5978('0x35')]({},_0x1bb298,_0x552ae1[_0x5978('0x37')]);return db[_0x5978('0x26')][_0x5978('0x42')](_0x1bb298)[_0x5978('0x3c')](handleEntityNotFound(_0x35472f,null))[_0x5978('0x3c')](respondWithResult(_0x35472f,null))[_0x5978('0x43')](handleError(_0x35472f,null));};exports[_0x5978('0x44')]=function(_0x278a0a,_0x297ac1){return db['ZohoField'][_0x5978('0x44')](_0x278a0a[_0x5978('0x45')],{})['then'](respondWithResult(_0x297ac1,0xc9))[_0x5978('0x43')](handleError(_0x297ac1,null));};exports[_0x5978('0x1f')]=function(_0x388134,_0x2a1528){if(_0x388134['body']['id']){delete _0x388134['body']['id'];}return db[_0x5978('0x26')][_0x5978('0x42')]({'where':{'id':_0x388134[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x2a1528,null))['then'](saveUpdates(_0x388134['body'],null))[_0x5978('0x3c')](respondWithResult(_0x2a1528,null))[_0x5978('0x43')](handleError(_0x2a1528,null));};exports[_0x5978('0x20')]=function(_0x3208a2,_0x5edd9f){return db[_0x5978('0x26')][_0x5978('0x42')]({'where':{'id':_0x3208a2[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x5edd9f,null))[_0x5978('0x3c')](removeEntity(_0x5edd9f,null))[_0x5978('0x43')](handleError(_0x5edd9f,null));}; \ No newline at end of file +var _0xf0be=['undefined','limit','count','set','Content-Range','reject','save','then','error','name','send','index','ZohoField','rawAttributes','fieldName','model','map','query','attributes','intersection','fields','length','order','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','update','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x28285b,_0x9ca61a){var _0x137f9a=function(_0x4ec1e1){while(--_0x4ec1e1){_0x28285b['push'](_0x28285b['shift']());}};_0x137f9a(++_0x9ca61a);}(_0xf0be,0x1cf));var _0xef0b=function(_0x53dc95,_0x56f5e8){_0x53dc95=_0x53dc95-0x0;var _0x19ef04=_0xf0be[_0x53dc95];return _0x19ef04;};'use strict';var emlformat=require(_0xef0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef0b('0x1'));var jsonpatch=require(_0xef0b('0x2'));var rp=require(_0xef0b('0x3'));var moment=require(_0xef0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef0b('0x5'));var util=require('util');var path=require(_0xef0b('0x6'));var sox=require(_0xef0b('0x7'));var csv=require(_0xef0b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef0b('0x9'));var _=require(_0xef0b('0xa'));var squel=require(_0xef0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xef0b('0xc'));var deskjs=require(_0xef0b('0xd'));var toCsv=require(_0xef0b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef0b('0xe'));var qs=require(_0xef0b('0xf'));var as=require(_0xef0b('0x10'));var hardwareService=require(_0xef0b('0x11'));var logger=require(_0xef0b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xef0b('0x13'));var licenseUtil=require(_0xef0b('0x14'));var db=require(_0xef0b('0x15'))['db'];function respondWithStatusCode(_0x2d3fa5,_0x5519f6){_0x5519f6=_0x5519f6||0xcc;return function(_0x15b833){if(_0x15b833){return _0x2d3fa5[_0xef0b('0x16')](_0x5519f6);}return _0x2d3fa5[_0xef0b('0x17')](_0x5519f6)[_0xef0b('0x18')]();};}function respondWithResult(_0x4b8770,_0x5529b5){_0x5529b5=_0x5529b5||0xc8;return function(_0x2dcca1){if(_0x2dcca1){return _0x4b8770[_0xef0b('0x17')](_0x5529b5)[_0xef0b('0x19')](_0x2dcca1);}};}function respondWithFilteredResult(_0x306012,_0x190307){return function(_0x4fd66e){if(_0x4fd66e){var _0x7b841d=typeof _0x190307[_0xef0b('0x1a')]===_0xef0b('0x1b')&&typeof _0x190307[_0xef0b('0x1c')]===_0xef0b('0x1b');var _0x301932=_0x4fd66e['count'];var _0x5550a5=_0x7b841d?0x0:_0x190307['offset'];var _0x58d347=_0x7b841d?_0x4fd66e[_0xef0b('0x1d')]:_0x190307[_0xef0b('0x1a')]+_0x190307[_0xef0b('0x1c')];var _0x44bf41;if(_0x58d347>=_0x301932){_0x58d347=_0x301932;_0x44bf41=0xc8;}else{_0x44bf41=0xce;}_0x306012['status'](_0x44bf41);return _0x306012[_0xef0b('0x1e')](_0xef0b('0x1f'),_0x5550a5+'-'+_0x58d347+'/'+_0x301932)[_0xef0b('0x19')](_0x4fd66e);}return null;};}function patchUpdates(_0x57d0dc){return function(_0xf035d0){try{jsonpatch['apply'](_0xf035d0,_0x57d0dc,!![]);}catch(_0x3ba3fc){return BPromise[_0xef0b('0x20')](_0x3ba3fc);}return _0xf035d0[_0xef0b('0x21')]();};}function saveUpdates(_0x5e0842,_0xa87926){return function(_0x34623f){if(_0x34623f){return _0x34623f['update'](_0x5e0842)['then'](function(_0x389c27){return _0x389c27;});}return null;};}function removeEntity(_0x4e8919,_0x403612){return function(_0x5bf1d3){if(_0x5bf1d3){return _0x5bf1d3['destroy']()[_0xef0b('0x22')](function(){_0x4e8919[_0xef0b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a5a81,_0x497f5c){return function(_0x23ca2e){if(!_0x23ca2e){_0x5a5a81['sendStatus'](0x194);}return _0x23ca2e;};}function handleError(_0x1f036e,_0x290945){_0x290945=_0x290945||0x1f4;return function(_0x3ec0c5){logger[_0xef0b('0x23')](_0x3ec0c5['stack']);if(_0x3ec0c5[_0xef0b('0x24')]){delete _0x3ec0c5[_0xef0b('0x24')];}_0x1f036e[_0xef0b('0x17')](_0x290945)[_0xef0b('0x25')](_0x3ec0c5);};}exports[_0xef0b('0x26')]=function(_0x3f4eee,_0x572093){var _0x28ee08={},_0x6a5187={},_0x5ee29a={'count':0x0,'rows':[]};var _0x5324cc=_['map'](db[_0xef0b('0x27')][_0xef0b('0x28')],function(_0x2e29f1){return{'name':_0x2e29f1[_0xef0b('0x29')],'type':_0x2e29f1['type']['key']};});_0x6a5187[_0xef0b('0x2a')]=_[_0xef0b('0x2b')](_0x5324cc,'name');_0x6a5187[_0xef0b('0x2c')]=_['keys'](_0x3f4eee[_0xef0b('0x2c')]);_0x6a5187['filters']=_['intersection'](_0x6a5187[_0xef0b('0x2a')],_0x6a5187['query']);_0x28ee08[_0xef0b('0x2d')]=_[_0xef0b('0x2e')](_0x6a5187[_0xef0b('0x2a')],qs['fields'](_0x3f4eee['query'][_0xef0b('0x2f')]));_0x28ee08['attributes']=_0x28ee08[_0xef0b('0x2d')][_0xef0b('0x30')]?_0x28ee08['attributes']:_0x6a5187[_0xef0b('0x2a')];if(!_0x3f4eee[_0xef0b('0x2c')]['hasOwnProperty']('nolimit')){_0x28ee08[_0xef0b('0x1c')]=qs[_0xef0b('0x1c')](_0x3f4eee['query'][_0xef0b('0x1c')]);_0x28ee08[_0xef0b('0x1a')]=qs['offset'](_0x3f4eee['query'][_0xef0b('0x1a')]);}_0x28ee08[_0xef0b('0x31')]=qs['sort'](_0x3f4eee['query']['sort']);_0x28ee08['where']=qs[_0xef0b('0x32')](_[_0xef0b('0x33')](_0x3f4eee[_0xef0b('0x2c')],_0x6a5187[_0xef0b('0x32')]),_0x5324cc);if(_0x3f4eee[_0xef0b('0x2c')][_0xef0b('0x34')]){_0x28ee08[_0xef0b('0x35')]=_[_0xef0b('0x36')](_0x28ee08[_0xef0b('0x35')],{'$or':_[_0xef0b('0x2b')](_0x5324cc,function(_0x13278a){if(_0x13278a[_0xef0b('0x37')]!==_0xef0b('0x38')){var _0x160553={};_0x160553[_0x13278a[_0xef0b('0x24')]]={'$like':'%'+_0x3f4eee[_0xef0b('0x2c')][_0xef0b('0x34')]+'%'};return _0x160553;}})});}_0x28ee08=_['merge']({},_0x28ee08,_0x3f4eee[_0xef0b('0x39')]);var _0x5c220b={'where':_0x28ee08[_0xef0b('0x35')]};return db['ZohoField'][_0xef0b('0x1d')](_0x5c220b)[_0xef0b('0x22')](function(_0x2bb84d){_0x5ee29a['count']=_0x2bb84d;if(_0x3f4eee[_0xef0b('0x2c')][_0xef0b('0x3a')]){_0x28ee08[_0xef0b('0x3b')]=[{'all':!![]}];}return db[_0xef0b('0x27')]['findAll'](_0x28ee08);})['then'](function(_0x52bdd4){_0x5ee29a[_0xef0b('0x3c')]=_0x52bdd4;return _0x5ee29a;})[_0xef0b('0x22')](respondWithFilteredResult(_0x572093,_0x28ee08))[_0xef0b('0x3d')](handleError(_0x572093,null));};exports[_0xef0b('0x3e')]=function(_0xee2c7,_0x523f10){var _0xa33e27={'raw':!![],'where':{'id':_0xee2c7[_0xef0b('0x3f')]['id']}},_0x2ddfe1={};_0x2ddfe1[_0xef0b('0x2a')]=_['keys'](db[_0xef0b('0x27')]['rawAttributes']);_0x2ddfe1['query']=_[_0xef0b('0x40')](_0xee2c7[_0xef0b('0x2c')]);_0x2ddfe1[_0xef0b('0x32')]=_[_0xef0b('0x2e')](_0x2ddfe1[_0xef0b('0x2a')],_0x2ddfe1[_0xef0b('0x2c')]);_0xa33e27[_0xef0b('0x2d')]=_['intersection'](_0x2ddfe1[_0xef0b('0x2a')],qs[_0xef0b('0x2f')](_0xee2c7['query'][_0xef0b('0x2f')]));_0xa33e27[_0xef0b('0x2d')]=_0xa33e27[_0xef0b('0x2d')][_0xef0b('0x30')]?_0xa33e27[_0xef0b('0x2d')]:_0x2ddfe1[_0xef0b('0x2a')];if(_0xee2c7['query'][_0xef0b('0x3a')]){_0xa33e27[_0xef0b('0x3b')]=[{'all':!![]}];}_0xa33e27=_['merge']({},_0xa33e27,_0xee2c7[_0xef0b('0x39')]);return db[_0xef0b('0x27')]['find'](_0xa33e27)[_0xef0b('0x22')](handleEntityNotFound(_0x523f10,null))[_0xef0b('0x22')](respondWithResult(_0x523f10,null))[_0xef0b('0x3d')](handleError(_0x523f10,null));};exports[_0xef0b('0x41')]=function(_0x2e03fc,_0x230e25){return db['ZohoField'][_0xef0b('0x41')](_0x2e03fc[_0xef0b('0x42')],{})['then'](respondWithResult(_0x230e25,0xc9))[_0xef0b('0x3d')](handleError(_0x230e25,null));};exports[_0xef0b('0x43')]=function(_0x315891,_0x2eaf8c){if(_0x315891[_0xef0b('0x42')]['id']){delete _0x315891[_0xef0b('0x42')]['id'];}return db[_0xef0b('0x27')]['find']({'where':{'id':_0x315891[_0xef0b('0x3f')]['id']}})[_0xef0b('0x22')](handleEntityNotFound(_0x2eaf8c,null))['then'](saveUpdates(_0x315891[_0xef0b('0x42')],null))[_0xef0b('0x22')](respondWithResult(_0x2eaf8c,null))[_0xef0b('0x3d')](handleError(_0x2eaf8c,null));};exports[_0xef0b('0x44')]=function(_0x5a979c,_0x481a50){return db[_0xef0b('0x27')][_0xef0b('0x45')]({'where':{'id':_0x5a979c[_0xef0b('0x3f')]['id']}})[_0xef0b('0x22')](handleEntityNotFound(_0x481a50,null))[_0xef0b('0x22')](removeEntity(_0x481a50,null))[_0xef0b('0x3d')](handleError(_0x481a50,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 32f9580..f2b7924 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 _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoField','int_zoho_fields','lodash','util'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x1a37,0xb4));var _0x71a3=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1a37[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intZohoField.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['path','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1261,0x144));var _0x1126=function(_0x4f6f04,_0x59c6ba){_0x4f6f04=_0x4f6f04-0x0;var _0x606b2c=_0x1261[_0x4f6f04];return _0x606b2c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('ZohoField',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xd'),_0x1126('0xe')],'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 8ab2357..b8a79ed 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 _0xac5c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x587f0a,_0x23e41e){var _0x37b8cc=function(_0x4845ed){while(--_0x4845ed){_0x587f0a['push'](_0x587f0a['shift']());}};_0x37b8cc(++_0x23e41e);}(_0xac5c,0x142));var _0xcac5=function(_0x5a7d38,_0x485323){_0x5a7d38=_0x5a7d38-0x0;var _0x4142b5=_0xac5c[_0x5a7d38];return _0x4142b5;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require(_0xcac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcac5('0x4'));var db=require(_0xcac5('0x5'))['db'];var utils=require(_0xcac5('0x6'));var logger=require(_0xcac5('0x7'))(_0xcac5('0x8'));var config=require('../../config/environment');var jayson=require(_0xcac5('0x9'));var client=jayson['client'][_0xcac5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36000d,_0x5843c1,_0x121386){return new BPromise(function(_0x2983d8,_0x190ff1){return client[_0xcac5('0xb')](_0x36000d,_0x121386)[_0xcac5('0xc')](function(_0xe257fc){logger['info'](_0xcac5('0xd'),_0x5843c1,_0xcac5('0xe'));logger[_0xcac5('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x5843c1,_0xcac5('0xe'),JSON[_0xcac5('0x10')](_0xe257fc));if(_0xe257fc['error']){if(_0xe257fc[_0xcac5('0x11')][_0xcac5('0x12')]===0x1f4){logger[_0xcac5('0x11')](_0xcac5('0xd'),_0x5843c1,_0xe257fc[_0xcac5('0x11')][_0xcac5('0x13')]);return _0x190ff1(_0xe257fc[_0xcac5('0x11')]['message']);}logger[_0xcac5('0x11')](_0xcac5('0xd'),_0x5843c1,_0xe257fc[_0xcac5('0x11')][_0xcac5('0x13')]);return _0x2983d8(_0xe257fc[_0xcac5('0x11')]['message']);}else{logger[_0xcac5('0x14')](_0xcac5('0xd'),_0x5843c1,_0xcac5('0xe'));_0x2983d8(_0xe257fc[_0xcac5('0x15')][_0xcac5('0x13')]);}})[_0xcac5('0x16')](function(_0x155d3f){logger[_0xcac5('0x11')](_0xcac5('0xd'),_0x5843c1,_0x155d3f);_0x190ff1(_0x155d3f);});});} \ No newline at end of file +var _0xb0e6=['info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x5e465a,_0x3e0f32){var _0x52c7db=function(_0x2c9dea){while(--_0x2c9dea){_0x5e465a['push'](_0x5e465a['shift']());}};_0x52c7db(++_0x3e0f32);}(_0xb0e6,0x13f));var _0x6b0e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb0e6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6b0e('0x0'));var util=require(_0x6b0e('0x1'));var moment=require('moment');var BPromise=require(_0x6b0e('0x2'));var rs=require(_0x6b0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b0e('0x5'))('rpc');var config=require(_0x6b0e('0x6'));var jayson=require(_0x6b0e('0x7'));var client=jayson[_0x6b0e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50c8d4,_0x466eb7,_0x5b0bc6){return new BPromise(function(_0x18ada1,_0x554ff8){return client[_0x6b0e('0x9')](_0x50c8d4,_0x5b0bc6)[_0x6b0e('0xa')](function(_0xf5ecd3){logger[_0x6b0e('0xb')]('ZohoField,\x20%s,\x20%s',_0x466eb7,'request\x20sent');logger[_0x6b0e('0xc')](_0x6b0e('0xd'),_0x466eb7,_0x6b0e('0xe'),JSON[_0x6b0e('0xf')](_0xf5ecd3));if(_0xf5ecd3[_0x6b0e('0x10')]){if(_0xf5ecd3[_0x6b0e('0x10')][_0x6b0e('0x11')]===0x1f4){logger[_0x6b0e('0x10')](_0x6b0e('0x12'),_0x466eb7,_0xf5ecd3['error'][_0x6b0e('0x13')]);return _0x554ff8(_0xf5ecd3[_0x6b0e('0x10')][_0x6b0e('0x13')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x466eb7,_0xf5ecd3['error'][_0x6b0e('0x13')]);return _0x18ada1(_0xf5ecd3[_0x6b0e('0x10')]['message']);}else{logger[_0x6b0e('0xb')](_0x6b0e('0x12'),_0x466eb7,_0x6b0e('0xe'));_0x18ada1(_0xf5ecd3[_0x6b0e('0x14')][_0x6b0e('0x13')]);}})[_0x6b0e('0x15')](function(_0x2195c2){logger['error'](_0x6b0e('0x12'),_0x466eb7,_0x2195c2);_0x554ff8(_0x2195c2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 405d405..fb73e23 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ddc16,_0x3895b5){var _0x41f84e=function(_0x13b210){while(--_0x13b210){_0x3ddc16['push'](_0x3ddc16['shift']());}};_0x41f84e(++_0x3895b5);}(_0xe706,0xa3));var _0x6e70=function(_0x19a4ae,_0x21054a){_0x19a4ae=_0x19a4ae-0x0;var _0x13b6c3=_0xe706[_0x19a4ae];return _0x13b6c3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x30c598,_0x5b5435){var _0x2f2066=function(_0x3c6dd9){while(--_0x3c6dd9){_0x30c598['push'](_0x30c598['shift']());}};_0x2f2066(++_0x5b5435);}(_0xedd9,0xfc));var _0x9edd=function(_0x232bdb,_0x4283d0){_0x232bdb=_0x232bdb-0x0;var _0x55d557=_0xedd9[_0x232bdb];return _0x55d557;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 1c4a005..c182c8d 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 _0x5974=['sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5974,0x1d8));var _0x4597=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x5974[_0x197185];return _0x2c8af1;};'use strict';var Sequelize=require(_0x4597('0x0'));module[_0x4597('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4597('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4597('0x2')},'main':{'type':Sequelize[_0x4597('0x3')],'defaultValue':_0x4597('0x4')},'filename':{'type':Sequelize[_0x4597('0x3')]},'path':{'type':Sequelize[_0x4597('0x3')]},'type':{'type':Sequelize[_0x4597('0x3')]},'size':{'type':Sequelize[_0x4597('0x5')]},'active':{'type':Sequelize[_0x4597('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x4597('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4597('0x3')],'unique':_0x4597('0x7')},'description':{'type':Sequelize[_0x4597('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x4597('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x9b7e=['BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0x9b7e,0x12e));var _0xe9b7=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x9b7e[_0x4a6979];return _0x226f93;};'use strict';var Sequelize=require('sequelize');module[_0xe9b7('0x0')]={'name':{'type':Sequelize[_0xe9b7('0x1')],'allowNull':![],'unique':_0xe9b7('0x2')},'version':{'type':Sequelize[_0xe9b7('0x1')],'allowNull':![],'unique':_0xe9b7('0x2')},'main':{'type':Sequelize[_0xe9b7('0x1')],'defaultValue':_0xe9b7('0x3')},'filename':{'type':Sequelize[_0xe9b7('0x1')]},'path':{'type':Sequelize[_0xe9b7('0x1')]},'type':{'type':Sequelize[_0xe9b7('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xe9b7('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xe9b7('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xe9b7('0x5')},'description':{'type':Sequelize[_0xe9b7('0x1')]},'title':{'type':Sequelize[_0xe9b7('0x1')]},'remoteUri':{'type':Sequelize[_0xe9b7('0x1')]},'link':{'type':Sequelize[_0xe9b7('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index eb9de03..c7d402c 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 _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2e058e,_0x15b00a){_0x2e058e=_0x2e058e-0x0;var _0x1746a7=_0xc2c7[_0x2e058e];return _0x1746a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['Integration'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['Integration'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file +var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4819,0xcd));var _0x9481=function(_0x9e1d73,_0xcf6479){_0x9e1d73=_0x9e1d73-0x0;var _0x1ba603=_0x4819[_0x9e1d73];return _0x1ba603;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5c772c2..8ce7558 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 _0xd597=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Integration','lodash'];(function(_0x4c627f,_0x5c593e){var _0x33334b=function(_0x36f9b3){while(--_0x36f9b3){_0x4c627f['push'](_0x4c627f['shift']());}};_0x33334b(++_0x5c593e);}(_0xd597,0x95));var _0x7d59=function(_0x1c49a0,_0x4f6f1c){_0x1c49a0=_0x1c49a0-0x0;var _0x3e3389=_0xd597[_0x1c49a0];return _0x3e3389;};'use strict';var _=require(_0x7d59('0x0'));var util=require('util');var logger=require(_0x7d59('0x1'))(_0x7d59('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d59('0x3'));var fs=require('fs');var path=require(_0x7d59('0x4'));var rimraf=require(_0x7d59('0x5'));var config=require(_0x7d59('0x6'));var attributes=require('./integration.attributes');module[_0x7d59('0x7')]=function(_0x239a2e,_0x7af55b){return _0x239a2e[_0x7d59('0x8')](_0x7d59('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d0e=['path','../../config/environment','./integration.attributes','exports','define','integrations','util','api','bluebird','request-promise'];(function(_0x487939,_0x562e0e){var _0x165d57=function(_0x5af7e8){while(--_0x5af7e8){_0x487939['push'](_0x487939['shift']());}};_0x165d57(++_0x562e0e);}(_0x0d0e,0x6a));var _0xe0d0=function(_0x1463a1,_0x5a28ff){_0x1463a1=_0x1463a1-0x0;var _0x4b24a5=_0x0d0e[_0x1463a1];return _0x4b24a5;};'use strict';var _=require('lodash');var util=require(_0xe0d0('0x0'));var logger=require('../../config/logger')(_0xe0d0('0x1'));var moment=require('moment');var BPromise=require(_0xe0d0('0x2'));var rp=require(_0xe0d0('0x3'));var fs=require('fs');var path=require(_0xe0d0('0x4'));var rimraf=require('rimraf');var config=require(_0xe0d0('0x5'));var attributes=require(_0xe0d0('0x6'));module[_0xe0d0('0x7')]=function(_0x246f78,_0x2e945f){return _0x246f78[_0xe0d0('0x8')]('Integration',attributes,{'tableName':_0xe0d0('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 446b1d1..2f7a0cb 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x4c8702,_0x18dfbd){var _0x4e335f=function(_0x3057fa){while(--_0x3057fa){_0x4c8702['push'](_0x4c8702['shift']());}};_0x4e335f(++_0x18dfbd);}(_0xdb28,0x106));var _0x8db2=function(_0x369206,_0xd94e1d){_0x369206=_0x369206-0x0;var _0x44f6bf=_0xdb28[_0x369206];return _0x44f6bf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Integration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5227ab,_0x514da4){var _0x3dc702=function(_0x592b15){while(--_0x592b15){_0x5227ab['push'](_0x5227ab['shift']());}};_0x3dc702(++_0x514da4);}(_0x14a0,0x8e));var _0x014a=function(_0x530ea0,_0x35360f){_0x530ea0=_0x530ea0-0x0;var _0x231715=_0x14a0[_0x530ea0];return _0x231715;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Integration,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Integration,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Integration,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8352d7b..e9b6149 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x1e28a1,_0x4fb2e0){var _0x408d2d=function(_0x4f2120){while(--_0x4f2120){_0x1e28a1['push'](_0x1e28a1['shift']());}};_0x408d2d(++_0x4fb2e0);}(_0x1a85,0x178));var _0x51a8=function(_0x28e27c,_0x2216ff){_0x28e27c=_0x28e27c-0x0;var _0x45ae93=_0x1a85[_0x28e27c];return _0x45ae93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x4f3e36,_0x570044){var _0x321c33=function(_0x461efd){while(--_0x461efd){_0x4f3e36['push'](_0x4f3e36['shift']());}};_0x321c33(++_0x570044);}(_0x1261,0x144));var _0x1126=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x1261[_0x2431d6];return _0x4d0f9b;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 48d1ef7..09fde20 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 _0x3ca0=['BOOLEAN','DATE','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x3835bb,_0x3443df){var _0x10085e=function(_0x541d71){while(--_0x541d71){_0x3835bb['push'](_0x3835bb['shift']());}};_0x10085e(++_0x3443df);}(_0x3ca0,0x1e0));var _0x03ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x03ca('0x0'));module[_0x03ca('0x1')]={'integration':{'type':Sequelize[_0x03ca('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x03ca('0x2')]},'ticketId':{'type':Sequelize[_0x03ca('0x2')]},'integrationId':{'type':Sequelize[_0x03ca('0x3')]},'contacts':{'type':Sequelize[_0x03ca('0x2')]},'uniqueid':{'type':Sequelize[_0x03ca('0x2')]},'calleridnum':{'type':Sequelize[_0x03ca('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x03ca('0x2')]},'membername':{'type':Sequelize[_0x03ca('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x03ca('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x03ca('0x5')]},'talktime':{'type':Sequelize[_0x03ca('0x3')]},'agentacw':{'type':Sequelize[_0x03ca('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x03ca('0x3')]},'reason':{'type':Sequelize[_0x03ca('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x03ca('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x03ca('0x5')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x03ca('0x5')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x03ca('0x2')]},'channelstate':{'type':Sequelize[_0x03ca('0x3')]},'channelstatedesc':{'type':Sequelize[_0x03ca('0x2')]},'connectedlinenum':{'type':Sequelize[_0x03ca('0x2')]},'connectedlinename':{'type':Sequelize[_0x03ca('0x2')]},'language':{'type':Sequelize[_0x03ca('0x2')]},'accountcode':{'type':Sequelize[_0x03ca('0x2')]},'context':{'type':Sequelize[_0x03ca('0x2')]},'exten':{'type':Sequelize[_0x03ca('0x2')]},'priority':{'type':Sequelize[_0x03ca('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x03ca('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x03ca('0x2')]},'destcalleridnum':{'type':Sequelize[_0x03ca('0x2')]},'destcalleridname':{'type':Sequelize[_0x03ca('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x03ca('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x03ca('0x2')]},'destlanguage':{'type':Sequelize[_0x03ca('0x2')]},'destaccountcode':{'type':Sequelize[_0x03ca('0x2')]},'destcontext':{'type':Sequelize[_0x03ca('0x2')]},'destexten':{'type':Sequelize[_0x03ca('0x2')]},'destpriority':{'type':Sequelize[_0x03ca('0x2')]},'destuniqueid':{'type':Sequelize[_0x03ca('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x03ca('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x03ca('0x2')]},'to':{'type':Sequelize[_0x03ca('0x2')]},'cc':{'type':Sequelize[_0x03ca('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x03ca('0x6')]},'text':{'type':Sequelize[_0x03ca('0x6')]},'status':{'type':Sequelize[_0x03ca('0x7')](_0x03ca('0x8'),'SENDING',_0x03ca('0x9'),_0x03ca('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb23d=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x5454e2,_0x576f66){var _0x5b9409=function(_0x52b3dd){while(--_0x52b3dd){_0x5454e2['push'](_0x5454e2['shift']());}};_0x5b9409(++_0x576f66);}(_0xb23d,0xc7));var _0xdb23=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xb23d[_0x2c9b79];return _0x265032;};'use strict';var Sequelize=require('sequelize');module[_0xdb23('0x0')]={'integration':{'type':Sequelize[_0xdb23('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xdb23('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xdb23('0x2')]},'contacts':{'type':Sequelize[_0xdb23('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdb23('0x1')]},'calleridname':{'type':Sequelize[_0xdb23('0x1')]},'queue':{'type':Sequelize[_0xdb23('0x1')]},'interface':{'type':Sequelize[_0xdb23('0x1')]},'membername':{'type':Sequelize[_0xdb23('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xdb23('0x3')]},'holdtime':{'type':Sequelize[_0xdb23('0x2')]},'agentcomplete':{'type':Sequelize[_0xdb23('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdb23('0x3')]},'talktime':{'type':Sequelize[_0xdb23('0x2')]},'agentacw':{'type':Sequelize[_0xdb23('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xdb23('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xdb23('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdb23('0x3')]},'lastevent':{'type':Sequelize[_0xdb23('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdb23('0x2')]},'channelstatedesc':{'type':Sequelize[_0xdb23('0x1')]},'connectedlinenum':{'type':Sequelize[_0xdb23('0x1')]},'connectedlinename':{'type':Sequelize[_0xdb23('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdb23('0x1')]},'exten':{'type':Sequelize[_0xdb23('0x1')]},'priority':{'type':Sequelize[_0xdb23('0x1')]},'destchannel':{'type':Sequelize[_0xdb23('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xdb23('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdb23('0x1')]},'destcalleridname':{'type':Sequelize[_0xdb23('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdb23('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdb23('0x1')]},'destlanguage':{'type':Sequelize[_0xdb23('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xdb23('0x1')]},'destexten':{'type':Sequelize[_0xdb23('0x1')]},'destpriority':{'type':Sequelize[_0xdb23('0x1')]},'destuniqueid':{'type':Sequelize[_0xdb23('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xdb23('0x1')]},'from':{'type':Sequelize[_0xdb23('0x1')]},'to':{'type':Sequelize[_0xdb23('0x1')]},'cc':{'type':Sequelize[_0xdb23('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xdb23('0x5')]},'text':{'type':Sequelize[_0xdb23('0x5')]},'status':{'type':Sequelize[_0xdb23('0x6')](_0xdb23('0x7'),_0xdb23('0x8'),_0xdb23('0x9'),_0xdb23('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xdb23('0x1')]},'appdata':{'type':Sequelize[_0xdb23('0x1')]},'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 024f007..0aa41c6 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 _0xda38=['key','model','map','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','IntegrationReport','rawAttributes','fieldName','type'];(function(_0x4c9f99,_0x2609de){var _0xafb005=function(_0x20c89b){while(--_0x20c89b){_0x4c9f99['push'](_0x4c9f99['shift']());}};_0xafb005(++_0x2609de);}(_0xda38,0x65));var _0x8da3=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xda38[_0x4ed32d];return _0xf624df;};'use strict';var emlformat=require(_0x8da3('0x0'));var rimraf=require(_0x8da3('0x1'));var zipdir=require(_0x8da3('0x2'));var jsonpatch=require(_0x8da3('0x3'));var rp=require(_0x8da3('0x4'));var moment=require(_0x8da3('0x5'));var BPromise=require(_0x8da3('0x6'));var Mustache=require(_0x8da3('0x7'));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 fs_extra=require(_0x8da3('0x8'));var _=require(_0x8da3('0x9'));var squel=require(_0x8da3('0xa'));var crypto=require('crypto');var jsforce=require(_0x8da3('0xb'));var deskjs=require(_0x8da3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8da3('0xd'));var Papa=require('papaparse');var Redis=require(_0x8da3('0xe'));var authService=require(_0x8da3('0xf'));var qs=require(_0x8da3('0x10'));var as=require(_0x8da3('0x11'));var hardwareService=require(_0x8da3('0x12'));var logger=require(_0x8da3('0x13'))(_0x8da3('0x14'));var utils=require(_0x8da3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8da3('0x16'));var db=require(_0x8da3('0x17'))['db'];function respondWithStatusCode(_0x26afeb,_0x267f63){_0x267f63=_0x267f63||0xcc;return function(_0x311af2){if(_0x311af2){return _0x26afeb['sendStatus'](_0x267f63);}return _0x26afeb[_0x8da3('0x18')](_0x267f63)['end']();};}function respondWithResult(_0x4957e2,_0x7678e7){_0x7678e7=_0x7678e7||0xc8;return function(_0x153552){if(_0x153552){return _0x4957e2['status'](_0x7678e7)['json'](_0x153552);}};}function respondWithFilteredResult(_0x4a62c7,_0x4001ca){return function(_0x5c3b58){if(_0x5c3b58){var _0x2fda1e=typeof _0x4001ca['offset']===_0x8da3('0x19')&&typeof _0x4001ca[_0x8da3('0x1a')]===_0x8da3('0x19');var _0x1d7bf0=_0x5c3b58[_0x8da3('0x1b')];var _0x571a0d=_0x2fda1e?0x0:_0x4001ca[_0x8da3('0x1c')];var _0x55ce21=_0x2fda1e?_0x5c3b58['count']:_0x4001ca['offset']+_0x4001ca[_0x8da3('0x1a')];var _0x5906af;if(_0x55ce21>=_0x1d7bf0){_0x55ce21=_0x1d7bf0;_0x5906af=0xc8;}else{_0x5906af=0xce;}_0x4a62c7['status'](_0x5906af);return _0x4a62c7[_0x8da3('0x1d')](_0x8da3('0x1e'),_0x571a0d+'-'+_0x55ce21+'/'+_0x1d7bf0)['json'](_0x5c3b58);}return null;};}function patchUpdates(_0x1a2736){return function(_0x10d136){try{jsonpatch[_0x8da3('0x1f')](_0x10d136,_0x1a2736,!![]);}catch(_0x548579){return BPromise[_0x8da3('0x20')](_0x548579);}return _0x10d136[_0x8da3('0x21')]();};}function saveUpdates(_0x1adf16,_0x431c8c){return function(_0xf27d2b){if(_0xf27d2b){return _0xf27d2b[_0x8da3('0x22')](_0x1adf16)['then'](function(_0x3ed90b){return _0x3ed90b;});}return null;};}function removeEntity(_0x388599,_0x5650a3){return function(_0x3ac1bc){if(_0x3ac1bc){return _0x3ac1bc[_0x8da3('0x23')]()[_0x8da3('0x24')](function(){_0x388599['status'](0xcc)[_0x8da3('0x25')]();});}};}function handleEntityNotFound(_0x549364,_0x2a2938){return function(_0x2ccd19){if(!_0x2ccd19){_0x549364[_0x8da3('0x26')](0x194);}return _0x2ccd19;};}function handleError(_0x161040,_0x3c16a2){_0x3c16a2=_0x3c16a2||0x1f4;return function(_0x123fd9){logger[_0x8da3('0x27')](_0x123fd9[_0x8da3('0x28')]);if(_0x123fd9[_0x8da3('0x29')]){delete _0x123fd9['name'];}_0x161040[_0x8da3('0x18')](_0x3c16a2)['send'](_0x123fd9);};}exports[_0x8da3('0x2a')]=function(_0x10da6f,_0x397210){var _0x4b022f={},_0x4ab3bf={},_0x71fad8={'count':0x0,'rows':[]};var _0x5abcc7=_['map'](db[_0x8da3('0x2b')][_0x8da3('0x2c')],function(_0x52e87c){return{'name':_0x52e87c[_0x8da3('0x2d')],'type':_0x52e87c[_0x8da3('0x2e')][_0x8da3('0x2f')]};});_0x4ab3bf[_0x8da3('0x30')]=_[_0x8da3('0x31')](_0x5abcc7,_0x8da3('0x29'));_0x4ab3bf[_0x8da3('0x32')]=_[_0x8da3('0x33')](_0x10da6f[_0x8da3('0x32')]);_0x4ab3bf['filters']=_[_0x8da3('0x34')](_0x4ab3bf[_0x8da3('0x30')],_0x4ab3bf[_0x8da3('0x32')]);_0x4b022f[_0x8da3('0x35')]=_[_0x8da3('0x34')](_0x4ab3bf[_0x8da3('0x30')],qs['fields'](_0x10da6f[_0x8da3('0x32')][_0x8da3('0x36')]));_0x4b022f[_0x8da3('0x35')]=_0x4b022f[_0x8da3('0x35')][_0x8da3('0x37')]?_0x4b022f[_0x8da3('0x35')]:_0x4ab3bf[_0x8da3('0x30')];if(!_0x10da6f[_0x8da3('0x32')]['hasOwnProperty']('nolimit')){_0x4b022f[_0x8da3('0x1a')]=qs[_0x8da3('0x1a')](_0x10da6f[_0x8da3('0x32')][_0x8da3('0x1a')]);_0x4b022f[_0x8da3('0x1c')]=qs[_0x8da3('0x1c')](_0x10da6f[_0x8da3('0x32')][_0x8da3('0x1c')]);}_0x4b022f['order']=qs[_0x8da3('0x38')](_0x10da6f['query'][_0x8da3('0x38')]);_0x4b022f[_0x8da3('0x39')]=qs[_0x8da3('0x3a')](_[_0x8da3('0x3b')](_0x10da6f[_0x8da3('0x32')],_0x4ab3bf['filters']),_0x5abcc7);if(_0x10da6f[_0x8da3('0x32')][_0x8da3('0x3c')]){_0x4b022f[_0x8da3('0x39')]=_[_0x8da3('0x3d')](_0x4b022f[_0x8da3('0x39')],{'$or':_[_0x8da3('0x31')](_0x5abcc7,function(_0x48bd0c){if(_0x48bd0c[_0x8da3('0x2e')]!==_0x8da3('0x3e')){var _0x215161={};_0x215161[_0x48bd0c[_0x8da3('0x29')]]={'$like':'%'+_0x10da6f[_0x8da3('0x32')][_0x8da3('0x3c')]+'%'};return _0x215161;}})});}_0x4b022f=_[_0x8da3('0x3d')]({},_0x4b022f,_0x10da6f['options']);var _0x2d1726={'where':_0x4b022f[_0x8da3('0x39')]};return db[_0x8da3('0x2b')]['count'](_0x2d1726)['then'](function(_0x2115db){_0x71fad8[_0x8da3('0x1b')]=_0x2115db;if(_0x10da6f[_0x8da3('0x32')][_0x8da3('0x3f')]){_0x4b022f[_0x8da3('0x40')]=[{'all':!![]}];}return db[_0x8da3('0x2b')]['findAll'](_0x4b022f);})[_0x8da3('0x24')](function(_0x7228c9){_0x71fad8[_0x8da3('0x41')]=_0x7228c9;return _0x71fad8;})[_0x8da3('0x24')](respondWithFilteredResult(_0x397210,_0x4b022f))[_0x8da3('0x42')](handleError(_0x397210,null));};exports[_0x8da3('0x43')]=function(_0x470f72,_0x792836){var _0x1632dd={'raw':![],'where':{'id':_0x470f72[_0x8da3('0x44')]['id']}},_0x3af133={};_0x3af133[_0x8da3('0x30')]=_[_0x8da3('0x33')](db[_0x8da3('0x2b')][_0x8da3('0x2c')]);_0x3af133[_0x8da3('0x32')]=_[_0x8da3('0x33')](_0x470f72[_0x8da3('0x32')]);_0x3af133[_0x8da3('0x3a')]=_[_0x8da3('0x34')](_0x3af133[_0x8da3('0x30')],_0x3af133[_0x8da3('0x32')]);_0x1632dd[_0x8da3('0x35')]=_[_0x8da3('0x34')](_0x3af133[_0x8da3('0x30')],qs[_0x8da3('0x36')](_0x470f72['query']['fields']));_0x1632dd[_0x8da3('0x35')]=_0x1632dd[_0x8da3('0x35')][_0x8da3('0x37')]?_0x1632dd[_0x8da3('0x35')]:_0x3af133[_0x8da3('0x30')];if(_0x470f72[_0x8da3('0x32')][_0x8da3('0x3f')]){_0x1632dd[_0x8da3('0x40')]=[{'all':!![]}];}_0x1632dd=_['merge']({},_0x1632dd,_0x470f72[_0x8da3('0x45')]);return db['IntegrationReport'][_0x8da3('0x46')](_0x1632dd)[_0x8da3('0x24')](handleEntityNotFound(_0x792836,null))[_0x8da3('0x24')](respondWithResult(_0x792836,null))['catch'](handleError(_0x792836,null));};exports['create']=function(_0x20df4f,_0x25fd2d){return db['IntegrationReport'][_0x8da3('0x47')](_0x20df4f['body'],{})[_0x8da3('0x24')](respondWithResult(_0x25fd2d,0xc9))[_0x8da3('0x42')](handleError(_0x25fd2d,null));};exports[_0x8da3('0x22')]=function(_0x559f12,_0x24fafb){if(_0x559f12['body']['id']){delete _0x559f12[_0x8da3('0x48')]['id'];}return db[_0x8da3('0x2b')][_0x8da3('0x46')]({'where':{'id':_0x559f12[_0x8da3('0x44')]['id']}})[_0x8da3('0x24')](handleEntityNotFound(_0x24fafb,null))[_0x8da3('0x24')](saveUpdates(_0x559f12['body'],null))[_0x8da3('0x24')](respondWithResult(_0x24fafb,null))[_0x8da3('0x42')](handleError(_0x24fafb,null));};exports['destroy']=function(_0x30d4b3,_0x2e38f8){return db['IntegrationReport'][_0x8da3('0x46')]({'where':{'id':_0x30d4b3['params']['id']}})[_0x8da3('0x24')](handleEntityNotFound(_0x2e38f8,null))['then'](removeEntity(_0x2e38f8,null))['catch'](handleError(_0x2e38f8,null));};exports[_0x8da3('0x49')]=function(_0x1c8d39,_0x16554b){return db['IntegrationReport']['describe']()[_0x8da3('0x24')](respondWithResult(_0x16554b,null))[_0x8da3('0x42')](handleError(_0x16554b,null));}; \ No newline at end of file +var _0xdfbd=['sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','end','error','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','filter','merge','includeAll','findAll','catch','params','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x41f6b2,_0x32047b){var _0x570c61=function(_0x328117){while(--_0x328117){_0x41f6b2['push'](_0x41f6b2['shift']());}};_0x570c61(++_0x32047b);}(_0xdfbd,0xf5));var _0xddfb=function(_0x27ec0b,_0x10c1d5){_0x27ec0b=_0x27ec0b-0x0;var _0x529792=_0xdfbd[_0x27ec0b];return _0x529792;};'use strict';var emlformat=require(_0xddfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddfb('0x1'));var jsonpatch=require(_0xddfb('0x2'));var rp=require('request-promise');var moment=require(_0xddfb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xddfb('0x4'));var util=require('util');var path=require(_0xddfb('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddfb('0x6'));var _=require(_0xddfb('0x7'));var squel=require(_0xddfb('0x8'));var crypto=require(_0xddfb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xddfb('0xa'));var toCsv=require(_0xddfb('0xb'));var querystring=require(_0xddfb('0xc'));var Papa=require(_0xddfb('0xd'));var Redis=require('ioredis');var authService=require(_0xddfb('0xe'));var qs=require(_0xddfb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddfb('0x10'));var logger=require(_0xddfb('0x11'))(_0xddfb('0x12'));var utils=require(_0xddfb('0x13'));var config=require(_0xddfb('0x14'));var licenseUtil=require(_0xddfb('0x15'));var db=require(_0xddfb('0x16'))['db'];function respondWithStatusCode(_0x3f5cfa,_0x5ac3d5){_0x5ac3d5=_0x5ac3d5||0xcc;return function(_0x174003){if(_0x174003){return _0x3f5cfa[_0xddfb('0x17')](_0x5ac3d5);}return _0x3f5cfa[_0xddfb('0x18')](_0x5ac3d5)['end']();};}function respondWithResult(_0x35e891,_0x5b3777){_0x5b3777=_0x5b3777||0xc8;return function(_0x2bce5e){if(_0x2bce5e){return _0x35e891[_0xddfb('0x18')](_0x5b3777)['json'](_0x2bce5e);}};}function respondWithFilteredResult(_0xbb1674,_0x394808){return function(_0x17b018){if(_0x17b018){var _0x4f1fcf=typeof _0x394808[_0xddfb('0x19')]==='undefined'&&typeof _0x394808[_0xddfb('0x1a')]===_0xddfb('0x1b');var _0x2e0c67=_0x17b018[_0xddfb('0x1c')];var _0x4255dc=_0x4f1fcf?0x0:_0x394808[_0xddfb('0x19')];var _0x12fda1=_0x4f1fcf?_0x17b018['count']:_0x394808[_0xddfb('0x19')]+_0x394808[_0xddfb('0x1a')];var _0x4c4aaa;if(_0x12fda1>=_0x2e0c67){_0x12fda1=_0x2e0c67;_0x4c4aaa=0xc8;}else{_0x4c4aaa=0xce;}_0xbb1674[_0xddfb('0x18')](_0x4c4aaa);return _0xbb1674[_0xddfb('0x1d')](_0xddfb('0x1e'),_0x4255dc+'-'+_0x12fda1+'/'+_0x2e0c67)['json'](_0x17b018);}return null;};}function patchUpdates(_0x434d05){return function(_0xca6452){try{jsonpatch['apply'](_0xca6452,_0x434d05,!![]);}catch(_0x3c911e){return BPromise[_0xddfb('0x1f')](_0x3c911e);}return _0xca6452[_0xddfb('0x20')]();};}function saveUpdates(_0x468597,_0x1f277d){return function(_0x1edd4d){if(_0x1edd4d){return _0x1edd4d['update'](_0x468597)[_0xddfb('0x21')](function(_0x55c974){return _0x55c974;});}return null;};}function removeEntity(_0x40a097,_0x5a890c){return function(_0x250dfc){if(_0x250dfc){return _0x250dfc[_0xddfb('0x22')]()[_0xddfb('0x21')](function(){_0x40a097['status'](0xcc)[_0xddfb('0x23')]();});}};}function handleEntityNotFound(_0x4a2640,_0x1263e6){return function(_0x549028){if(!_0x549028){_0x4a2640['sendStatus'](0x194);}return _0x549028;};}function handleError(_0x26bb8d,_0xce7f67){_0xce7f67=_0xce7f67||0x1f4;return function(_0x187e8f){logger[_0xddfb('0x24')](_0x187e8f['stack']);if(_0x187e8f[_0xddfb('0x25')]){delete _0x187e8f[_0xddfb('0x25')];}_0x26bb8d[_0xddfb('0x18')](_0xce7f67)[_0xddfb('0x26')](_0x187e8f);};}exports['index']=function(_0x48a1d9,_0x595329){var _0x47c4cc={},_0x170ee4={},_0x52589b={'count':0x0,'rows':[]};var _0xd21ed5=_[_0xddfb('0x27')](db[_0xddfb('0x28')][_0xddfb('0x29')],function(_0x225843){return{'name':_0x225843[_0xddfb('0x2a')],'type':_0x225843[_0xddfb('0x2b')][_0xddfb('0x2c')]};});_0x170ee4[_0xddfb('0x2d')]=_[_0xddfb('0x27')](_0xd21ed5,_0xddfb('0x25'));_0x170ee4[_0xddfb('0x2e')]=_[_0xddfb('0x2f')](_0x48a1d9['query']);_0x170ee4[_0xddfb('0x30')]=_[_0xddfb('0x31')](_0x170ee4[_0xddfb('0x2d')],_0x170ee4[_0xddfb('0x2e')]);_0x47c4cc[_0xddfb('0x32')]=_[_0xddfb('0x31')](_0x170ee4[_0xddfb('0x2d')],qs[_0xddfb('0x33')](_0x48a1d9[_0xddfb('0x2e')][_0xddfb('0x33')]));_0x47c4cc[_0xddfb('0x32')]=_0x47c4cc[_0xddfb('0x32')][_0xddfb('0x34')]?_0x47c4cc['attributes']:_0x170ee4[_0xddfb('0x2d')];if(!_0x48a1d9[_0xddfb('0x2e')][_0xddfb('0x35')]('nolimit')){_0x47c4cc[_0xddfb('0x1a')]=qs['limit'](_0x48a1d9['query'][_0xddfb('0x1a')]);_0x47c4cc[_0xddfb('0x19')]=qs[_0xddfb('0x19')](_0x48a1d9['query'][_0xddfb('0x19')]);}_0x47c4cc['order']=qs['sort'](_0x48a1d9[_0xddfb('0x2e')]['sort']);_0x47c4cc[_0xddfb('0x36')]=qs['filters'](_['pick'](_0x48a1d9[_0xddfb('0x2e')],_0x170ee4[_0xddfb('0x30')]),_0xd21ed5);if(_0x48a1d9[_0xddfb('0x2e')][_0xddfb('0x37')]){_0x47c4cc[_0xddfb('0x36')]=_[_0xddfb('0x38')](_0x47c4cc['where'],{'$or':_[_0xddfb('0x27')](_0xd21ed5,function(_0x3380db){if(_0x3380db[_0xddfb('0x2b')]!=='VIRTUAL'){var _0x4628c6={};_0x4628c6[_0x3380db[_0xddfb('0x25')]]={'$like':'%'+_0x48a1d9[_0xddfb('0x2e')]['filter']+'%'};return _0x4628c6;}})});}_0x47c4cc=_['merge']({},_0x47c4cc,_0x48a1d9['options']);var _0x56ed7f={'where':_0x47c4cc[_0xddfb('0x36')]};return db[_0xddfb('0x28')][_0xddfb('0x1c')](_0x56ed7f)[_0xddfb('0x21')](function(_0x3aaaad){_0x52589b[_0xddfb('0x1c')]=_0x3aaaad;if(_0x48a1d9[_0xddfb('0x2e')][_0xddfb('0x39')]){_0x47c4cc['include']=[{'all':!![]}];}return db[_0xddfb('0x28')][_0xddfb('0x3a')](_0x47c4cc);})[_0xddfb('0x21')](function(_0x342b34){_0x52589b['rows']=_0x342b34;return _0x52589b;})[_0xddfb('0x21')](respondWithFilteredResult(_0x595329,_0x47c4cc))[_0xddfb('0x3b')](handleError(_0x595329,null));};exports['show']=function(_0x233378,_0x3c5078){var _0x510dcc={'raw':![],'where':{'id':_0x233378[_0xddfb('0x3c')]['id']}},_0x1b4184={};_0x1b4184['model']=_['keys'](db['IntegrationReport'][_0xddfb('0x29')]);_0x1b4184['query']=_[_0xddfb('0x2f')](_0x233378['query']);_0x1b4184[_0xddfb('0x30')]=_['intersection'](_0x1b4184[_0xddfb('0x2d')],_0x1b4184[_0xddfb('0x2e')]);_0x510dcc[_0xddfb('0x32')]=_['intersection'](_0x1b4184[_0xddfb('0x2d')],qs[_0xddfb('0x33')](_0x233378['query'][_0xddfb('0x33')]));_0x510dcc[_0xddfb('0x32')]=_0x510dcc[_0xddfb('0x32')]['length']?_0x510dcc[_0xddfb('0x32')]:_0x1b4184[_0xddfb('0x2d')];if(_0x233378['query'][_0xddfb('0x39')]){_0x510dcc['include']=[{'all':!![]}];}_0x510dcc=_['merge']({},_0x510dcc,_0x233378[_0xddfb('0x3d')]);return db['IntegrationReport'][_0xddfb('0x3e')](_0x510dcc)['then'](handleEntityNotFound(_0x3c5078,null))[_0xddfb('0x21')](respondWithResult(_0x3c5078,null))[_0xddfb('0x3b')](handleError(_0x3c5078,null));};exports['create']=function(_0x2e36cb,_0x7b1dda){return db['IntegrationReport'][_0xddfb('0x3f')](_0x2e36cb[_0xddfb('0x40')],{})[_0xddfb('0x21')](respondWithResult(_0x7b1dda,0xc9))[_0xddfb('0x3b')](handleError(_0x7b1dda,null));};exports[_0xddfb('0x41')]=function(_0x2fefda,_0x48ba08){if(_0x2fefda['body']['id']){delete _0x2fefda[_0xddfb('0x40')]['id'];}return db[_0xddfb('0x28')][_0xddfb('0x3e')]({'where':{'id':_0x2fefda['params']['id']}})[_0xddfb('0x21')](handleEntityNotFound(_0x48ba08,null))[_0xddfb('0x21')](saveUpdates(_0x2fefda[_0xddfb('0x40')],null))[_0xddfb('0x21')](respondWithResult(_0x48ba08,null))[_0xddfb('0x3b')](handleError(_0x48ba08,null));};exports[_0xddfb('0x22')]=function(_0x6b8963,_0x4f8000){return db[_0xddfb('0x28')]['find']({'where':{'id':_0x6b8963[_0xddfb('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4f8000,null))[_0xddfb('0x21')](removeEntity(_0x4f8000,null))[_0xddfb('0x3b')](handleError(_0x4f8000,null));};exports['describe']=function(_0x107899,_0x460b65){return db[_0xddfb('0x28')][_0xddfb('0x42')]()[_0xddfb('0x21')](respondWithResult(_0x460b65,null))[_0xddfb('0x3b')](handleError(_0x460b65,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4f36c3d..ab9646d 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 _0x4a4b=['request-promise','path','./integrationReport.attributes','IntegrationReport','report_integration','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a4b,0x1db));var _0xb4a4=function(_0x558666,_0x2ebcda){_0x558666=_0x558666-0x0;var _0x416de0=_0x4a4b[_0x558666];return _0x416de0;};'use strict';var _=require(_0xb4a4('0x0'));var util=require(_0xb4a4('0x1'));var logger=require('../../config/logger')(_0xb4a4('0x2'));var moment=require(_0xb4a4('0x3'));var BPromise=require(_0xb4a4('0x4'));var rp=require(_0xb4a4('0x5'));var fs=require('fs');var path=require(_0xb4a4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb4a4('0x7'));module['exports']=function(_0x4079f5,_0xcc0cbf){return _0x4079f5['define'](_0xb4a4('0x8'),attributes,{'tableName':_0xb4a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x185a=['moment','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x185a,0x127));var _0xa185=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x185a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xa185('0x0'));var logger=require('../../config/logger')(_0xa185('0x1'));var moment=require(_0xa185('0x2'));var BPromise=require('bluebird');var rp=require(_0xa185('0x3'));var fs=require('fs');var path=require(_0xa185('0x4'));var rimraf=require('rimraf');var config=require(_0xa185('0x5'));var attributes=require(_0xa185('0x6'));module[_0xa185('0x7')]=function(_0x11520c,_0x4dd53f){return _0x11520c[_0xa185('0x8')](_0xa185('0x9'),attributes,{'tableName':_0xa185('0xa'),'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 6ab7c8b..daea39c 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x31f0,0xb7));var _0x031f=function(_0x490d16,_0x59c3bb){_0x490d16=_0x490d16-0x0;var _0x11e091=_0x31f0[_0x490d16];return _0x11e091;};'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});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x814b,0x1a2));var _0xb814=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x814b[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 45637fe..e80f032 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 _0x9ea3=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','/:id','show','get','/:id/sub_intervals','getIntervals','addInterval','post','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer'];(function(_0x456c2c,_0x5e41e9){var _0x305690=function(_0x111d20){while(--_0x111d20){_0x456c2c['push'](_0x456c2c['shift']());}};_0x305690(++_0x5e41e9);}(_0x9ea3,0x12b));var _0x39ea=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x9ea3[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x39ea('0x0'));var util=require(_0x39ea('0x1'));var path=require(_0x39ea('0x2'));var timeout=require(_0x39ea('0x3'));var express=require(_0x39ea('0x4'));var router=express[_0x39ea('0x5')]();var fs_extra=require(_0x39ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x39ea('0x7'));var config=require(_0x39ea('0x8'));var controller=require(_0x39ea('0x9'));router['get']('/',auth[_0x39ea('0xa')](),controller['index']);router['get'](_0x39ea('0xb'),auth[_0x39ea('0xa')](),controller[_0x39ea('0xc')]);router[_0x39ea('0xd')](_0x39ea('0xe'),auth[_0x39ea('0xa')](),controller[_0x39ea('0xf')]);router['post']('/',auth[_0x39ea('0xa')](),controller['create']);router['post'](_0x39ea('0xe'),auth[_0x39ea('0xa')](),controller[_0x39ea('0x10')]);router[_0x39ea('0x11')](_0x39ea('0x12'),auth[_0x39ea('0xa')](),controller[_0x39ea('0x13')]);router[_0x39ea('0x14')]('/:id',auth[_0x39ea('0xa')](),controller[_0x39ea('0x15')]);router[_0x39ea('0x16')](_0x39ea('0xb'),auth[_0x39ea('0xa')](),controller[_0x39ea('0x17')]);module[_0x39ea('0x18')]=router; \ No newline at end of file +var _0x5f71=['show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x1f91f1,_0xdbc1a1){var _0x1df196=function(_0x470b0d){while(--_0x470b0d){_0x1f91f1['push'](_0x1f91f1['shift']());}};_0x1df196(++_0xdbc1a1);}(_0x5f71,0xc9));var _0x15f7=function(_0x46bd17,_0x196280){_0x46bd17=_0x46bd17-0x0;var _0x476b6e=_0x5f71[_0x46bd17];return _0x476b6e;};'use strict';var multer=require(_0x15f7('0x0'));var util=require('util');var path=require(_0x15f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x15f7('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x15f7('0x3'));var config=require(_0x15f7('0x4'));var controller=require('./interval.controller');router[_0x15f7('0x5')]('/',auth[_0x15f7('0x6')](),controller[_0x15f7('0x7')]);router[_0x15f7('0x5')](_0x15f7('0x8'),auth[_0x15f7('0x6')](),controller[_0x15f7('0x9')]);router[_0x15f7('0x5')](_0x15f7('0xa'),auth[_0x15f7('0x6')](),controller[_0x15f7('0xb')]);router[_0x15f7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x15f7('0xc')](_0x15f7('0xa'),auth['isAuthenticated'](),controller[_0x15f7('0xd')]);router[_0x15f7('0xc')](_0x15f7('0xe'),auth[_0x15f7('0x6')](),controller[_0x15f7('0xf')]);router[_0x15f7('0x10')](_0x15f7('0x8'),auth['isAuthenticated'](),controller[_0x15f7('0x11')]);router[_0x15f7('0x12')](_0x15f7('0x8'),auth['isAuthenticated'](),controller[_0x15f7('0x13')]);module[_0x15f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ece9656..f0a57a7 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 _0x7ca5=['STRING'];(function(_0x4ff176,_0x46b20d){var _0x152715=function(_0x586065){while(--_0x586065){_0x4ff176['push'](_0x4ff176['shift']());}};_0x152715(++_0x46b20d);}(_0x7ca5,0x157));var _0x57ca=function(_0x380042,_0x29e974){_0x380042=_0x380042-0x0;var _0x163edc=_0x7ca5[_0x380042];return _0x163edc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x57ca('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0xe768=['STRING','sequelize','exports'];(function(_0x12b43a,_0x7cb540){var _0x4fdef3=function(_0x33df5a){while(--_0x33df5a){_0x12b43a['push'](_0x12b43a['shift']());}};_0x4fdef3(++_0x7cb540);}(_0xe768,0x196));var _0x8e76=function(_0x3e8a27,_0x38f6e5){_0x3e8a27=_0x3e8a27-0x0;var _0x2e4b50=_0xe768[_0x3e8a27];return _0x2e4b50;};'use strict';var Sequelize=require(_0x8e76('0x0'));module[_0x8e76('0x1')]={'name':{'type':Sequelize[_0x8e76('0x2')]},'description':{'type':Sequelize[_0x8e76('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index a830b53..859d2ad 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 _0x2140=['status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','error','name','send','map','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','Interval','includeAll','include','findAll','rows','catch','params','length','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','addInterval','IntervalId','getIntervals','findOne','rawAttributes','options','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','end'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x2140,0x15b));var _0x0214=function(_0x4f1a69,_0x88be26){_0x4f1a69=_0x4f1a69-0x0;var _0x269f35=_0x2140[_0x4f1a69];return _0x269f35;};'use strict';var emlformat=require(_0x0214('0x0'));var rimraf=require(_0x0214('0x1'));var zipdir=require(_0x0214('0x2'));var jsonpatch=require(_0x0214('0x3'));var rp=require(_0x0214('0x4'));var moment=require('moment');var BPromise=require(_0x0214('0x5'));var Mustache=require(_0x0214('0x6'));var util=require(_0x0214('0x7'));var path=require(_0x0214('0x8'));var sox=require(_0x0214('0x9'));var csv=require(_0x0214('0xa'));var ejs=require(_0x0214('0xb'));var fs=require('fs');var fs_extra=require(_0x0214('0xc'));var _=require(_0x0214('0xd'));var squel=require('squel');var crypto=require(_0x0214('0xe'));var jsforce=require(_0x0214('0xf'));var deskjs=require(_0x0214('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0214('0x11'));var Redis=require(_0x0214('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0214('0x13'));var as=require(_0x0214('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0214('0x15'))(_0x0214('0x16'));var utils=require(_0x0214('0x17'));var config=require(_0x0214('0x18'));var licenseUtil=require(_0x0214('0x19'));var db=require(_0x0214('0x1a'))['db'];var extensions=require(_0x0214('0x1b'));function respondWithStatusCode(_0x51ba21,_0x478175){_0x478175=_0x478175||0xcc;return function(_0x5f0a7d){if(_0x5f0a7d){return _0x51ba21['sendStatus'](_0x478175);}return _0x51ba21['status'](_0x478175)[_0x0214('0x1c')]();};}function respondWithResult(_0x54201a,_0x249ae9){_0x249ae9=_0x249ae9||0xc8;return function(_0x5cf9ea){if(_0x5cf9ea){return _0x54201a[_0x0214('0x1d')](_0x249ae9)['json'](_0x5cf9ea);}};}function respondWithFilteredResult(_0x33537f,_0x2b6f05){return function(_0x2579cf){if(_0x2579cf){var _0x4b3e38=typeof _0x2b6f05[_0x0214('0x1e')]===_0x0214('0x1f')&&typeof _0x2b6f05[_0x0214('0x20')]===_0x0214('0x1f');var _0x31a977=_0x2579cf['count'];var _0x5d091a=_0x4b3e38?0x0:_0x2b6f05[_0x0214('0x1e')];var _0x124821=_0x4b3e38?_0x2579cf[_0x0214('0x21')]:_0x2b6f05['offset']+_0x2b6f05[_0x0214('0x20')];var _0x4ba490;if(_0x124821>=_0x31a977){_0x124821=_0x31a977;_0x4ba490=0xc8;}else{_0x4ba490=0xce;}_0x33537f[_0x0214('0x1d')](_0x4ba490);return _0x33537f[_0x0214('0x22')](_0x0214('0x23'),_0x5d091a+'-'+_0x124821+'/'+_0x31a977)[_0x0214('0x24')](_0x2579cf);}return null;};}function patchUpdates(_0x32c3a5){return function(_0x2c4a1f){try{jsonpatch['apply'](_0x2c4a1f,_0x32c3a5,!![]);}catch(_0x1ab291){return BPromise['reject'](_0x1ab291);}return _0x2c4a1f[_0x0214('0x25')]();};}function saveUpdates(_0xb586ca,_0x4037d9){return function(_0x3a32eb){if(_0x3a32eb){return _0x3a32eb[_0x0214('0x26')](_0xb586ca)[_0x0214('0x27')](function(_0x5dc3e5){return _0x5dc3e5;});}return null;};}function removeEntity(_0x1c335d,_0x353ee0){return function(_0x1f42da){if(_0x1f42da){return _0x1f42da[_0x0214('0x28')]()[_0x0214('0x27')](function(){var _0x180a2a=_0x1f42da[_0x0214('0x29')]({'plain':!![]});var _0x2c0a30=_0x0214('0x2a');return db[_0x0214('0x2b')]['destroy']({'where':{'type':_0x2c0a30,'resourceId':_0x180a2a['id']}})[_0x0214('0x27')](function(){return _0x1f42da;});})[_0x0214('0x27')](function(){_0x1c335d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1324f8,_0x3d4ad3){return function(_0x39a18c){if(!_0x39a18c){_0x1324f8[_0x0214('0x2c')](0x194);}return _0x39a18c;};}function handleError(_0x504a38,_0x4d996f){_0x4d996f=_0x4d996f||0x1f4;return function(_0x524638){logger[_0x0214('0x2d')](_0x524638['stack']);if(_0x524638[_0x0214('0x2e')]){delete _0x524638['name'];}_0x504a38[_0x0214('0x1d')](_0x4d996f)[_0x0214('0x2f')](_0x524638);};}exports['index']=function(_0x2f5203,_0x1ad5e6){var _0xccd8dc={},_0x1b8373={},_0xbbb40b={'count':0x0,'rows':[]};var _0x256b40=_[_0x0214('0x30')](db['Interval']['rawAttributes'],function(_0x3cf2ca){return{'name':_0x3cf2ca['fieldName'],'type':_0x3cf2ca['type']['key']};});_0x1b8373[_0x0214('0x31')]=_['map'](_0x256b40,_0x0214('0x2e'));_0x1b8373['query']=_[_0x0214('0x32')](_0x2f5203[_0x0214('0x33')]);_0x1b8373[_0x0214('0x34')]=_[_0x0214('0x35')](_0x1b8373['model'],_0x1b8373[_0x0214('0x33')]);_0xccd8dc[_0x0214('0x36')]=_[_0x0214('0x35')](_0x1b8373[_0x0214('0x31')],qs[_0x0214('0x37')](_0x2f5203['query'][_0x0214('0x37')]));_0xccd8dc[_0x0214('0x36')]=_0xccd8dc[_0x0214('0x36')]['length']?_0xccd8dc[_0x0214('0x36')]:_0x1b8373[_0x0214('0x31')];if(!_0x2f5203[_0x0214('0x33')][_0x0214('0x38')](_0x0214('0x39'))){_0xccd8dc[_0x0214('0x20')]=qs[_0x0214('0x20')](_0x2f5203[_0x0214('0x33')]['limit']);_0xccd8dc[_0x0214('0x1e')]=qs[_0x0214('0x1e')](_0x2f5203['query'][_0x0214('0x1e')]);}_0xccd8dc[_0x0214('0x3a')]=qs['sort'](_0x2f5203[_0x0214('0x33')][_0x0214('0x3b')]);_0xccd8dc[_0x0214('0x3c')]=qs[_0x0214('0x34')](_[_0x0214('0x3d')](_0x2f5203[_0x0214('0x33')],_0x1b8373['filters']),_0x256b40);if(_0x2f5203[_0x0214('0x33')]['filter']){_0xccd8dc[_0x0214('0x3c')]=_[_0x0214('0x3e')](_0xccd8dc['where'],{'$or':_[_0x0214('0x30')](_0x256b40,function(_0xbb1dea){if(_0xbb1dea[_0x0214('0x3f')]!==_0x0214('0x40')){var _0x58bdd6={};_0x58bdd6[_0xbb1dea[_0x0214('0x2e')]]={'$like':'%'+_0x2f5203['query'][_0x0214('0x41')]+'%'};return _0x58bdd6;}})});}_0xccd8dc=_['merge']({},_0xccd8dc,_0x2f5203['options']);var _0xfd35eb={'where':_0xccd8dc[_0x0214('0x3c')]};return db[_0x0214('0x42')]['count'](_0xfd35eb)['then'](function(_0x3b52a0){_0xbbb40b['count']=_0x3b52a0;if(_0x2f5203['query'][_0x0214('0x43')]){_0xccd8dc[_0x0214('0x44')]=[{'all':!![]}];}return db[_0x0214('0x42')][_0x0214('0x45')](_0xccd8dc);})[_0x0214('0x27')](function(_0x586df6){_0xbbb40b[_0x0214('0x46')]=_0x586df6;return _0xbbb40b;})['then'](respondWithFilteredResult(_0x1ad5e6,_0xccd8dc))[_0x0214('0x47')](handleError(_0x1ad5e6,null));};exports['show']=function(_0x4cca15,_0x415204){var _0x25d685={'raw':!![],'where':{'id':_0x4cca15[_0x0214('0x48')]['id']}},_0x294b36={};_0x294b36[_0x0214('0x31')]=_[_0x0214('0x32')](db[_0x0214('0x42')]['rawAttributes']);_0x294b36[_0x0214('0x33')]=_[_0x0214('0x32')](_0x4cca15[_0x0214('0x33')]);_0x294b36['filters']=_[_0x0214('0x35')](_0x294b36[_0x0214('0x31')],_0x294b36['query']);_0x25d685[_0x0214('0x36')]=_[_0x0214('0x35')](_0x294b36['model'],qs[_0x0214('0x37')](_0x4cca15[_0x0214('0x33')]['fields']));_0x25d685['attributes']=_0x25d685['attributes'][_0x0214('0x49')]?_0x25d685[_0x0214('0x36')]:_0x294b36[_0x0214('0x31')];if(_0x4cca15[_0x0214('0x33')]['includeAll']){_0x25d685[_0x0214('0x44')]=[{'all':!![]}];}_0x25d685=_[_0x0214('0x3e')]({},_0x25d685,_0x4cca15['options']);return db[_0x0214('0x42')][_0x0214('0x4a')](_0x25d685)[_0x0214('0x27')](handleEntityNotFound(_0x415204,null))[_0x0214('0x27')](respondWithResult(_0x415204,null))[_0x0214('0x47')](handleError(_0x415204,null));};exports[_0x0214('0x4b')]=function(_0x5d182f,_0x55aaa4){return db[_0x0214('0x42')]['create'](_0x5d182f[_0x0214('0x4c')],{})[_0x0214('0x27')](function(_0x197e04){var _0x3833f7=_0x5d182f[_0x0214('0x4d')][_0x0214('0x29')]({'plain':!![]});if(!_0x3833f7)throw new Error(_0x0214('0x4e'));if(_0x3833f7[_0x0214('0x4f')]===_0x0214('0x4d')){var _0x416750=_0x197e04[_0x0214('0x29')]({'plain':!![]});var _0x5b2e98='Intervals';return db[_0x0214('0x50')][_0x0214('0x4a')]({'where':{'name':_0x5b2e98,'userProfileId':_0x3833f7[_0x0214('0x51')]},'raw':!![]})['then'](function(_0x2e2ab7){if(_0x2e2ab7&&_0x2e2ab7[_0x0214('0x52')]===0x0){return db[_0x0214('0x2b')][_0x0214('0x4b')]({'name':_0x416750[_0x0214('0x2e')],'resourceId':_0x416750['id'],'type':_0x2e2ab7[_0x0214('0x2e')],'sectionId':_0x2e2ab7['id']},{})[_0x0214('0x27')](function(){return _0x197e04;});}else{return _0x197e04;}})[_0x0214('0x47')](function(_0x31040c){logger[_0x0214('0x2d')](_0x0214('0x53'),_0x31040c);throw _0x31040c;});}return _0x197e04;})[_0x0214('0x27')](respondWithResult(_0x55aaa4,0xc9))[_0x0214('0x47')](handleError(_0x55aaa4,null));};exports['update']=function(_0x326ebb,_0x104f53){if(_0x326ebb['body']['id']){delete _0x326ebb['body']['id'];}return db[_0x0214('0x42')][_0x0214('0x4a')]({'where':{'id':_0x326ebb['params']['id']}})[_0x0214('0x27')](handleEntityNotFound(_0x104f53,null))[_0x0214('0x27')](saveUpdates(_0x326ebb['body'],null))[_0x0214('0x27')](respondWithResult(_0x104f53,null))[_0x0214('0x47')](handleError(_0x104f53,null));};exports[_0x0214('0x28')]=function(_0x1a23b6,_0x5884be){return db[_0x0214('0x42')][_0x0214('0x4a')]({'where':{'id':_0x1a23b6[_0x0214('0x48')]['id']}})[_0x0214('0x27')](handleEntityNotFound(_0x5884be,null))[_0x0214('0x27')](removeEntity(_0x5884be,null))[_0x0214('0x47')](handleError(_0x5884be,null));};exports[_0x0214('0x54')]=function(_0x50a05f,_0x5821c9,_0x1a27e3){if(_0x50a05f[_0x0214('0x4c')]['id']){delete _0x50a05f[_0x0214('0x4c')]['id'];}return db['Interval'][_0x0214('0x4a')]({'where':{'id':_0x50a05f[_0x0214('0x48')]['id']}})[_0x0214('0x27')](handleEntityNotFound(_0x5821c9,null))[_0x0214('0x27')](function(_0x351d99){if(_0x351d99){_0x50a05f[_0x0214('0x4c')][_0x0214('0x55')]=_0x351d99['id'];return db[_0x0214('0x42')][_0x0214('0x4b')](_0x50a05f['body']);}})[_0x0214('0x27')](respondWithResult(_0x5821c9,null))[_0x0214('0x47')](handleError(_0x5821c9,null));};exports[_0x0214('0x56')]=function(_0x5c25c3,_0x9f960f,_0x57d56b){var _0x9f29ce={};var _0x56505c={};var _0x4c6d6d;var _0x3a32a4;return db[_0x0214('0x42')][_0x0214('0x57')]({'where':{'id':_0x5c25c3[_0x0214('0x48')]['id']}})[_0x0214('0x27')](handleEntityNotFound(_0x9f960f,null))[_0x0214('0x27')](function(_0x30add2){if(_0x30add2){_0x4c6d6d=_0x30add2;_0x56505c[_0x0214('0x31')]=_[_0x0214('0x32')](db['Interval'][_0x0214('0x58')]);_0x56505c[_0x0214('0x33')]=_[_0x0214('0x32')](_0x5c25c3[_0x0214('0x33')]);_0x56505c[_0x0214('0x34')]=_[_0x0214('0x35')](_0x56505c[_0x0214('0x31')],_0x56505c[_0x0214('0x33')]);_0x9f29ce[_0x0214('0x36')]=_[_0x0214('0x35')](_0x56505c[_0x0214('0x31')],qs[_0x0214('0x37')](_0x5c25c3['query']['fields']));_0x9f29ce[_0x0214('0x36')]=_0x9f29ce[_0x0214('0x36')]['length']?_0x9f29ce['attributes']:_0x56505c[_0x0214('0x31')];_0x9f29ce[_0x0214('0x3a')]=qs[_0x0214('0x3b')](_0x5c25c3['query']['sort']);_0x9f29ce['where']=qs[_0x0214('0x34')](_[_0x0214('0x3d')](_0x5c25c3[_0x0214('0x33')],_0x56505c['filters']));if(_0x5c25c3[_0x0214('0x33')][_0x0214('0x41')]){_0x9f29ce[_0x0214('0x3c')]=_['merge'](_0x9f29ce[_0x0214('0x3c')],{'$or':_[_0x0214('0x30')](_0x9f29ce[_0x0214('0x36')],function(_0x1c1eb0){var _0x21a3ac={};_0x21a3ac[_0x1c1eb0]={'$like':'%'+_0x5c25c3[_0x0214('0x33')][_0x0214('0x41')]+'%'};return _0x21a3ac;})});}_0x9f29ce=_['merge']({},_0x9f29ce,_0x5c25c3[_0x0214('0x59')]);return _0x4c6d6d[_0x0214('0x56')](_0x9f29ce);}})[_0x0214('0x27')](function(_0x480d23){if(_0x480d23){_0x3a32a4=_0x480d23[_0x0214('0x49')];if(!_0x5c25c3[_0x0214('0x33')]['hasOwnProperty'](_0x0214('0x39'))){_0x9f29ce['limit']=qs[_0x0214('0x20')](_0x5c25c3[_0x0214('0x33')][_0x0214('0x20')]);_0x9f29ce[_0x0214('0x1e')]=qs[_0x0214('0x1e')](_0x5c25c3['query'][_0x0214('0x1e')]);}return _0x4c6d6d[_0x0214('0x56')](_0x9f29ce);}})[_0x0214('0x27')](function(_0x11925b){if(_0x11925b){return _0x11925b?{'count':_0x3a32a4,'rows':_0x11925b}:null;}})[_0x0214('0x27')](respondWithResult(_0x9f960f,null))['catch'](handleError(_0x9f960f,null));};exports[_0x0214('0x5a')]=function(_0x9c639,_0x3817c7,_0x2b2a99){return db['Interval']['findOne']({'where':{'id':_0x9c639['params']['id']}})[_0x0214('0x27')](handleEntityNotFound(_0x3817c7,null))[_0x0214('0x27')](function(_0x35db57){if(_0x35db57){return db[_0x0214('0x5b')][_0x0214('0x5c')](function(_0x2509f7){return db['Interval'][_0x0214('0x28')]({'where':{'IntervalId':_0x9c639[_0x0214('0x48')]['id']},'transaction':_0x2509f7})['then'](function(_0xd7db87){var _0x333403=_[_0x0214('0x30')](_0x9c639['body'],function(_0x5b8d7c){delete _0x5b8d7c['id'];_0x5b8d7c[_0x0214('0x55')]=_0x9c639['params']['id'];return _0x5b8d7c;});return db[_0x0214('0x42')][_0x0214('0x5d')](_0x333403,{'transaction':_0x2509f7});});})[_0x0214('0x27')](function(){return db['Interval'][_0x0214('0x45')]({'where':{'IntervalId':_0x9c639[_0x0214('0x48')]['id']}});});}})[_0x0214('0x27')](respondWithResult(_0x3817c7,null))[_0x0214('0x47')](handleError(_0x3817c7,null));}; \ No newline at end of file +var _0x76a9=['addIntervals','sequelize','transaction','bulkCreate','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','apply','reject','update','destroy','then','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','rawAttributes','order','options'];(function(_0x1122ee,_0x316237){var _0x291622=function(_0x1ac419){while(--_0x1ac419){_0x1122ee['push'](_0x1122ee['shift']());}};_0x291622(++_0x316237);}(_0x76a9,0x160));var _0x976a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x76a9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x976a('0x0'));var jsonpatch=require(_0x976a('0x1'));var rp=require('request-promise');var moment=require(_0x976a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x976a('0x3'));var util=require('util');var path=require('path');var sox=require(_0x976a('0x4'));var csv=require(_0x976a('0x5'));var ejs=require(_0x976a('0x6'));var fs=require('fs');var fs_extra=require(_0x976a('0x7'));var _=require(_0x976a('0x8'));var squel=require('squel');var crypto=require(_0x976a('0x9'));var jsforce=require(_0x976a('0xa'));var deskjs=require(_0x976a('0xb'));var toCsv=require(_0x976a('0x5'));var querystring=require(_0x976a('0xc'));var Papa=require(_0x976a('0xd'));var Redis=require(_0x976a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x976a('0xf'));var hardwareService=require(_0x976a('0x10'));var logger=require(_0x976a('0x11'))(_0x976a('0x12'));var utils=require('../../config/utils');var config=require(_0x976a('0x13'));var licenseUtil=require(_0x976a('0x14'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x503a2b,_0x12984f){_0x12984f=_0x12984f||0xcc;return function(_0x5b37ee){if(_0x5b37ee){return _0x503a2b[_0x976a('0x15')](_0x12984f);}return _0x503a2b[_0x976a('0x16')](_0x12984f)[_0x976a('0x17')]();};}function respondWithResult(_0x658d87,_0x5c839f){_0x5c839f=_0x5c839f||0xc8;return function(_0x55ac6d){if(_0x55ac6d){return _0x658d87['status'](_0x5c839f)[_0x976a('0x18')](_0x55ac6d);}};}function respondWithFilteredResult(_0x31b09a,_0x54ac2e){return function(_0x41b6b1){if(_0x41b6b1){var _0x1f4c2f=typeof _0x54ac2e['offset']===_0x976a('0x19')&&typeof _0x54ac2e[_0x976a('0x1a')]===_0x976a('0x19');var _0x34f29a=_0x41b6b1['count'];var _0x251d23=_0x1f4c2f?0x0:_0x54ac2e[_0x976a('0x1b')];var _0x502135=_0x1f4c2f?_0x41b6b1['count']:_0x54ac2e[_0x976a('0x1b')]+_0x54ac2e[_0x976a('0x1a')];var _0x34bc09;if(_0x502135>=_0x34f29a){_0x502135=_0x34f29a;_0x34bc09=0xc8;}else{_0x34bc09=0xce;}_0x31b09a['status'](_0x34bc09);return _0x31b09a[_0x976a('0x1c')]('Content-Range',_0x251d23+'-'+_0x502135+'/'+_0x34f29a)['json'](_0x41b6b1);}return null;};}function patchUpdates(_0x33a467){return function(_0x2d18fc){try{jsonpatch[_0x976a('0x1d')](_0x2d18fc,_0x33a467,!![]);}catch(_0x505d2d){return BPromise[_0x976a('0x1e')](_0x505d2d);}return _0x2d18fc['save']();};}function saveUpdates(_0x56de0d,_0x34cdaa){return function(_0x29fee6){if(_0x29fee6){return _0x29fee6[_0x976a('0x1f')](_0x56de0d)['then'](function(_0x4dbb45){return _0x4dbb45;});}return null;};}function removeEntity(_0x12aafe,_0x5c83d4){return function(_0x521101){if(_0x521101){return _0x521101[_0x976a('0x20')]()[_0x976a('0x21')](function(){var _0x5d6a52=_0x521101[_0x976a('0x22')]({'plain':!![]});var _0x3168e7=_0x976a('0x23');return db[_0x976a('0x24')][_0x976a('0x20')]({'where':{'type':_0x3168e7,'resourceId':_0x5d6a52['id']}})[_0x976a('0x21')](function(){return _0x521101;});})['then'](function(){_0x12aafe[_0x976a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56bdff,_0x532b79){return function(_0x4e9158){if(!_0x4e9158){_0x56bdff[_0x976a('0x15')](0x194);}return _0x4e9158;};}function handleError(_0xc6acb2,_0x208f01){_0x208f01=_0x208f01||0x1f4;return function(_0x6398eb){logger['error'](_0x6398eb[_0x976a('0x25')]);if(_0x6398eb[_0x976a('0x26')]){delete _0x6398eb['name'];}_0xc6acb2['status'](_0x208f01)[_0x976a('0x27')](_0x6398eb);};}exports[_0x976a('0x28')]=function(_0x3c6b0b,_0x3c06e8){var _0x23065d={},_0x3f15b8={},_0x35da34={'count':0x0,'rows':[]};var _0x248069=_[_0x976a('0x29')](db[_0x976a('0x2a')]['rawAttributes'],function(_0x14fb25){return{'name':_0x14fb25[_0x976a('0x2b')],'type':_0x14fb25[_0x976a('0x2c')]['key']};});_0x3f15b8[_0x976a('0x2d')]=_['map'](_0x248069,'name');_0x3f15b8[_0x976a('0x2e')]=_['keys'](_0x3c6b0b[_0x976a('0x2e')]);_0x3f15b8[_0x976a('0x2f')]=_[_0x976a('0x30')](_0x3f15b8[_0x976a('0x2d')],_0x3f15b8['query']);_0x23065d[_0x976a('0x31')]=_['intersection'](_0x3f15b8[_0x976a('0x2d')],qs[_0x976a('0x32')](_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x32')]));_0x23065d[_0x976a('0x31')]=_0x23065d[_0x976a('0x31')][_0x976a('0x33')]?_0x23065d['attributes']:_0x3f15b8[_0x976a('0x2d')];if(!_0x3c6b0b['query'][_0x976a('0x34')](_0x976a('0x35'))){_0x23065d['limit']=qs[_0x976a('0x1a')](_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x1a')]);_0x23065d[_0x976a('0x1b')]=qs[_0x976a('0x1b')](_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x1b')]);}_0x23065d['order']=qs['sort'](_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x36')]);_0x23065d['where']=qs[_0x976a('0x2f')](_[_0x976a('0x37')](_0x3c6b0b['query'],_0x3f15b8[_0x976a('0x2f')]),_0x248069);if(_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x38')]){_0x23065d[_0x976a('0x39')]=_[_0x976a('0x3a')](_0x23065d[_0x976a('0x39')],{'$or':_['map'](_0x248069,function(_0x3f1aee){if(_0x3f1aee['type']!==_0x976a('0x3b')){var _0x4771bb={};_0x4771bb[_0x3f1aee[_0x976a('0x26')]]={'$like':'%'+_0x3c6b0b['query']['filter']+'%'};return _0x4771bb;}})});}_0x23065d=_[_0x976a('0x3a')]({},_0x23065d,_0x3c6b0b['options']);var _0x888411={'where':_0x23065d[_0x976a('0x39')]};return db['Interval'][_0x976a('0x3c')](_0x888411)[_0x976a('0x21')](function(_0x3873ca){_0x35da34[_0x976a('0x3c')]=_0x3873ca;if(_0x3c6b0b[_0x976a('0x2e')][_0x976a('0x3d')]){_0x23065d[_0x976a('0x3e')]=[{'all':!![]}];}return db[_0x976a('0x2a')][_0x976a('0x3f')](_0x23065d);})[_0x976a('0x21')](function(_0x481320){_0x35da34['rows']=_0x481320;return _0x35da34;})[_0x976a('0x21')](respondWithFilteredResult(_0x3c06e8,_0x23065d))[_0x976a('0x40')](handleError(_0x3c06e8,null));};exports['show']=function(_0x382f93,_0x105ca5){var _0x4a6894={'raw':!![],'where':{'id':_0x382f93[_0x976a('0x41')]['id']}},_0x333b92={};_0x333b92[_0x976a('0x2d')]=_[_0x976a('0x42')](db['Interval']['rawAttributes']);_0x333b92[_0x976a('0x2e')]=_[_0x976a('0x42')](_0x382f93['query']);_0x333b92['filters']=_[_0x976a('0x30')](_0x333b92['model'],_0x333b92['query']);_0x4a6894['attributes']=_[_0x976a('0x30')](_0x333b92[_0x976a('0x2d')],qs[_0x976a('0x32')](_0x382f93[_0x976a('0x2e')]['fields']));_0x4a6894[_0x976a('0x31')]=_0x4a6894['attributes']['length']?_0x4a6894[_0x976a('0x31')]:_0x333b92[_0x976a('0x2d')];if(_0x382f93[_0x976a('0x2e')]['includeAll']){_0x4a6894[_0x976a('0x3e')]=[{'all':!![]}];}_0x4a6894=_['merge']({},_0x4a6894,_0x382f93['options']);return db['Interval']['find'](_0x4a6894)[_0x976a('0x21')](handleEntityNotFound(_0x105ca5,null))[_0x976a('0x21')](respondWithResult(_0x105ca5,null))[_0x976a('0x40')](handleError(_0x105ca5,null));};exports[_0x976a('0x43')]=function(_0x3938e3,_0x418237){return db[_0x976a('0x2a')][_0x976a('0x43')](_0x3938e3[_0x976a('0x44')],{})[_0x976a('0x21')](function(_0x2ccacc){var _0x5c11da=_0x3938e3['user'][_0x976a('0x22')]({'plain':!![]});if(!_0x5c11da)throw new Error(_0x976a('0x45'));if(_0x5c11da[_0x976a('0x46')]===_0x976a('0x47')){var _0xd6a8f7=_0x2ccacc[_0x976a('0x22')]({'plain':!![]});var _0x127dbb='Intervals';return db[_0x976a('0x48')][_0x976a('0x49')]({'where':{'name':_0x127dbb,'userProfileId':_0x5c11da[_0x976a('0x4a')]},'raw':!![]})[_0x976a('0x21')](function(_0x30f622){if(_0x30f622&&_0x30f622[_0x976a('0x4b')]===0x0){return db[_0x976a('0x24')][_0x976a('0x43')]({'name':_0xd6a8f7[_0x976a('0x26')],'resourceId':_0xd6a8f7['id'],'type':_0x30f622[_0x976a('0x26')],'sectionId':_0x30f622['id']},{})[_0x976a('0x21')](function(){return _0x2ccacc;});}else{return _0x2ccacc;}})['catch'](function(_0x12f093){logger['error'](_0x976a('0x4c'),_0x12f093);throw _0x12f093;});}return _0x2ccacc;})[_0x976a('0x21')](respondWithResult(_0x418237,0xc9))['catch'](handleError(_0x418237,null));};exports[_0x976a('0x1f')]=function(_0x4d135b,_0x139915){if(_0x4d135b[_0x976a('0x44')]['id']){delete _0x4d135b[_0x976a('0x44')]['id'];}return db[_0x976a('0x2a')][_0x976a('0x49')]({'where':{'id':_0x4d135b['params']['id']}})[_0x976a('0x21')](handleEntityNotFound(_0x139915,null))['then'](saveUpdates(_0x4d135b[_0x976a('0x44')],null))[_0x976a('0x21')](respondWithResult(_0x139915,null))['catch'](handleError(_0x139915,null));};exports[_0x976a('0x20')]=function(_0x3e11ac,_0x1bc534){return db[_0x976a('0x2a')]['find']({'where':{'id':_0x3e11ac[_0x976a('0x41')]['id']}})[_0x976a('0x21')](handleEntityNotFound(_0x1bc534,null))[_0x976a('0x21')](removeEntity(_0x1bc534,null))[_0x976a('0x40')](handleError(_0x1bc534,null));};exports['addInterval']=function(_0x18ff83,_0x507c45,_0x5d2fff){if(_0x18ff83[_0x976a('0x44')]['id']){delete _0x18ff83[_0x976a('0x44')]['id'];}return db[_0x976a('0x2a')]['find']({'where':{'id':_0x18ff83[_0x976a('0x41')]['id']}})['then'](handleEntityNotFound(_0x507c45,null))[_0x976a('0x21')](function(_0xb55043){if(_0xb55043){_0x18ff83['body'][_0x976a('0x4d')]=_0xb55043['id'];return db[_0x976a('0x2a')]['create'](_0x18ff83[_0x976a('0x44')]);}})[_0x976a('0x21')](respondWithResult(_0x507c45,null))[_0x976a('0x40')](handleError(_0x507c45,null));};exports[_0x976a('0x4e')]=function(_0x2c22e0,_0x24166e,_0x2afa69){var _0x338328={};var _0x232a29={};var _0x286f2e;var _0x5a1c4d;return db[_0x976a('0x2a')][_0x976a('0x4f')]({'where':{'id':_0x2c22e0[_0x976a('0x41')]['id']}})[_0x976a('0x21')](handleEntityNotFound(_0x24166e,null))[_0x976a('0x21')](function(_0x554d49){if(_0x554d49){_0x286f2e=_0x554d49;_0x232a29[_0x976a('0x2d')]=_[_0x976a('0x42')](db[_0x976a('0x2a')][_0x976a('0x50')]);_0x232a29['query']=_[_0x976a('0x42')](_0x2c22e0['query']);_0x232a29[_0x976a('0x2f')]=_[_0x976a('0x30')](_0x232a29[_0x976a('0x2d')],_0x232a29[_0x976a('0x2e')]);_0x338328[_0x976a('0x31')]=_[_0x976a('0x30')](_0x232a29[_0x976a('0x2d')],qs[_0x976a('0x32')](_0x2c22e0['query']['fields']));_0x338328[_0x976a('0x31')]=_0x338328[_0x976a('0x31')][_0x976a('0x33')]?_0x338328['attributes']:_0x232a29[_0x976a('0x2d')];_0x338328[_0x976a('0x51')]=qs[_0x976a('0x36')](_0x2c22e0[_0x976a('0x2e')][_0x976a('0x36')]);_0x338328['where']=qs[_0x976a('0x2f')](_['pick'](_0x2c22e0[_0x976a('0x2e')],_0x232a29[_0x976a('0x2f')]));if(_0x2c22e0[_0x976a('0x2e')]['filter']){_0x338328[_0x976a('0x39')]=_['merge'](_0x338328['where'],{'$or':_[_0x976a('0x29')](_0x338328['attributes'],function(_0x1e1456){var _0x48d8b3={};_0x48d8b3[_0x1e1456]={'$like':'%'+_0x2c22e0[_0x976a('0x2e')]['filter']+'%'};return _0x48d8b3;})});}_0x338328=_['merge']({},_0x338328,_0x2c22e0[_0x976a('0x52')]);return _0x286f2e[_0x976a('0x4e')](_0x338328);}})['then'](function(_0x436aba){if(_0x436aba){_0x5a1c4d=_0x436aba[_0x976a('0x33')];if(!_0x2c22e0[_0x976a('0x2e')]['hasOwnProperty'](_0x976a('0x35'))){_0x338328[_0x976a('0x1a')]=qs[_0x976a('0x1a')](_0x2c22e0['query'][_0x976a('0x1a')]);_0x338328['offset']=qs['offset'](_0x2c22e0[_0x976a('0x2e')]['offset']);}return _0x286f2e[_0x976a('0x4e')](_0x338328);}})[_0x976a('0x21')](function(_0x9cd58f){if(_0x9cd58f){return _0x9cd58f?{'count':_0x5a1c4d,'rows':_0x9cd58f}:null;}})[_0x976a('0x21')](respondWithResult(_0x24166e,null))[_0x976a('0x40')](handleError(_0x24166e,null));};exports[_0x976a('0x53')]=function(_0x2f0332,_0x2fe180,_0x42f25e){return db['Interval'][_0x976a('0x4f')]({'where':{'id':_0x2f0332['params']['id']}})[_0x976a('0x21')](handleEntityNotFound(_0x2fe180,null))[_0x976a('0x21')](function(_0x19ec21){if(_0x19ec21){return db[_0x976a('0x54')][_0x976a('0x55')](function(_0x2de631){return db['Interval'][_0x976a('0x20')]({'where':{'IntervalId':_0x2f0332[_0x976a('0x41')]['id']},'transaction':_0x2de631})[_0x976a('0x21')](function(_0x4584c8){var _0x1c0698=_['map'](_0x2f0332['body'],function(_0x484cf7){delete _0x484cf7['id'];_0x484cf7[_0x976a('0x4d')]=_0x2f0332[_0x976a('0x41')]['id'];return _0x484cf7;});return db['Interval'][_0x976a('0x56')](_0x1c0698,{'transaction':_0x2de631});});})[_0x976a('0x21')](function(){return db[_0x976a('0x2a')][_0x976a('0x3f')]({'where':{'IntervalId':_0x2f0332[_0x976a('0x41')]['id']}});});}})[_0x976a('0x21')](respondWithResult(_0x2fe180,null))['catch'](handleError(_0x2fe180,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 64a6937..ecc2a8d 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 _0xb1b2=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x252a55,_0x560198){var _0xa76a7e=function(_0xe1ac6f){while(--_0xe1ac6f){_0x252a55['push'](_0x252a55['shift']());}};_0xa76a7e(++_0x560198);}(_0xb1b2,0x12d));var _0x2b1b=function(_0x288beb,_0x3c0acf){_0x288beb=_0x288beb-0x0;var _0x24b0cf=_0xb1b2[_0x288beb];return _0x24b0cf;};'use strict';var _=require(_0x2b1b('0x0'));var util=require(_0x2b1b('0x1'));var logger=require(_0x2b1b('0x2'))(_0x2b1b('0x3'));var moment=require(_0x2b1b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b1b('0x5'));var fs=require('fs');var path=require(_0x2b1b('0x6'));var rimraf=require(_0x2b1b('0x7'));var config=require(_0x2b1b('0x8'));var attributes=require(_0x2b1b('0x9'));var extensions=require(_0x2b1b('0xa'));module[_0x2b1b('0xb')]=function(_0x4b4baa,_0x50797f){return _0x4b4baa['define'](_0x2b1b('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x500b06,_0x15a5f5){extensions[_0x2b1b('0xd')](_0x4b4baa,_0x500b06);},'afterBulkCreate':function(_0x2ad647,_0x577a4a,_0x14820a){_0x14820a();extensions['rewrite'](_0x4b4baa,_0x2ad647[0x0]);},'afterUpdate':function(_0x4790b7,_0x549812){extensions[_0x2b1b('0xd')](_0x4b4baa,_0x4790b7);},'afterDestroy':function(_0x408a9c,_0x28991a){extensions[_0x2b1b('0xd')](_0x4b4baa,_0x408a9c);}}});}; \ No newline at end of file +var _0xffd9=['./interval.attributes','define','rewrite','lodash','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x3ac3e7,_0x334531){var _0x4703ee=function(_0x507c5b){while(--_0x507c5b){_0x3ac3e7['push'](_0x3ac3e7['shift']());}};_0x4703ee(++_0x334531);}(_0xffd9,0x1db));var _0x9ffd=function(_0xb0ec22,_0x113fab){_0xb0ec22=_0xb0ec22-0x0;var _0x3a6733=_0xffd9[_0xb0ec22];return _0x3a6733;};'use strict';var _=require(_0x9ffd('0x0'));var util=require('util');var logger=require(_0x9ffd('0x1'))('api');var moment=require(_0x9ffd('0x2'));var BPromise=require(_0x9ffd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ffd('0x4'));var attributes=require(_0x9ffd('0x5'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x2525f5,_0x578e74){return _0x2525f5[_0x9ffd('0x6')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e51ec,_0x455678){extensions[_0x9ffd('0x7')](_0x2525f5,_0x4e51ec);},'afterBulkCreate':function(_0x59f2c9,_0x5bfbc5,_0x46f0a2){_0x46f0a2();extensions[_0x9ffd('0x7')](_0x2525f5,_0x59f2c9[0x0]);},'afterUpdate':function(_0x38780f,_0x2c2fdf){extensions['rewrite'](_0x2525f5,_0x38780f);},'afterDestroy':function(_0x513941,_0x2dd745){extensions[_0x9ffd('0x7')](_0x2525f5,_0x513941);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 742cb67..a0a40e7 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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['GetInterval']=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']('ShowInterval',_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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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['GetInterval']=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']('ShowInterval',_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 diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 7b79e92..92fd63d 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x123838,_0x499e3d){var _0x4b891a=function(_0x36a5a9){while(--_0x36a5a9){_0x123838['push'](_0x123838['shift']());}};_0x4b891a(++_0x499e3d);}(_0xadb5,0xad));var _0x5adb=function(_0x3bf441,_0x482490){_0x3bf441=_0x3bf441-0x0;var _0x133ad3=_0xadb5[_0x3bf441];return _0x133ad3;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x151dee,_0x3f620f){var _0x36879b=function(_0x5a7c23){while(--_0x5a7c23){_0x151dee['push'](_0x151dee['shift']());}};_0x36879b(++_0x3f620f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x283784,_0x2cca85){_0x283784=_0x283784-0x0;var _0x155b2b=_0x5f2f[_0x283784];return _0x155b2b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5a3aadc..45e5054 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 _0xaab8=['api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','reason','customfield_10102','/rest/api/2/issue','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error'];(function(_0x1c4b44,_0x2377de){var _0x10d72b=function(_0x2bd31e){while(--_0x2bd31e){_0x1c4b44['push'](_0x1c4b44['shift']());}};_0x10d72b(++_0x2377de);}(_0xaab8,0xae));var _0x8aab=function(_0x5d74e5,_0x4a797f){_0x5d74e5=_0x5d74e5-0x0;var _0x3e743f=_0xaab8[_0x5d74e5];return _0x3e743f;};'use strict';var BPromise=require(_0x8aab('0x0'));var https=require('https');var logger=require(_0x8aab('0x1'))(_0x8aab('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0xc8281a,_0xec6398){var _0xb4102b={'fields':{'project':{'key':_0xc8281a['key']||'MOTGUI'},'summary':(_0xc8281a[_0x8aab('0x3')]||_0x8aab('0x4'))+'\x20from\x20'+_0xc8281a['ip'],'description':_0xc8281a[_0x8aab('0x5')]||JSON[_0x8aab('0x6')](_0xc8281a),'issuetype':{'name':_0xc8281a[_0x8aab('0x7')]||_0x8aab('0x8')}}};_0xb4102b[_0x8aab('0x9')][_0x8aab('0xa')]=_0xc8281a[_0x8aab('0xb')];_0xb4102b[_0x8aab('0x9')][_0x8aab('0xc')]=_0xc8281a[_0x8aab('0xd')];_0xb4102b[_0x8aab('0x9')][_0x8aab('0xe')]=_0xc8281a['newToken'];_0xb4102b[_0x8aab('0x9')][_0x8aab('0xf')]=_0xc8281a['name'];_0xb4102b[_0x8aab('0x9')]['customfield_11504']=_0xc8281a[_0x8aab('0x10')];_0xb4102b[_0x8aab('0x9')][_0x8aab('0x11')]=_0xc8281a['ip'];var _0x16eab8={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x8aab('0x12'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x8aab('0x13')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x8aab('0x14'))}};var _0x4f9f0d=JSON[_0x8aab('0x6')](_0xb4102b);var _0x4a8e18=https[_0x8aab('0x15')](_0x16eab8,function(_0x443259){_0x443259[_0x8aab('0x16')](_0x8aab('0x17'));var _0x14d1df='';_0x443259['on'](_0x8aab('0x18'),function(_0x5905f0){_0x14d1df+=_0x5905f0;});_0x443259['on'](_0x8aab('0x19'),function(){if(_0xec6398){return _0xec6398[_0x8aab('0x1a')](_0x443259[_0x8aab('0x1b')])[_0x8aab('0x1c')](JSON[_0x8aab('0x1d')](_0x14d1df));}});});_0x4a8e18['on'](_0x8aab('0x1e'),function(_0x4c45af){if(_0xec6398){return _0xec6398[_0x8aab('0x1a')](0x1f4)[_0x8aab('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x8aab('0x1f')}]});}});_0x4a8e18[_0x8aab('0x20')](_0x4f9f0d);_0x4a8e18['end']();}exports[_0x8aab('0x21')]=openIssue;exports[_0x8aab('0x22')]=function(_0x5aaed2,_0x5d48c5){_0x5aaed2[_0x8aab('0x23')]['ip']=_0x5aaed2[_0x8aab('0x24')][_0x8aab('0x25')]||_0x5aaed2[_0x8aab('0x26')][_0x8aab('0x27')]||_0x5aaed2[_0x8aab('0x28')][_0x8aab('0x27')]||_0x5aaed2[_0x8aab('0x26')][_0x8aab('0x28')]['remoteAddress'];return openIssue(_0x5aaed2[_0x8aab('0x23')],_0x5d48c5);}; \ No newline at end of file +var _0x4b6f=['customfield_11502','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','base64','setEncoding','utf8','end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','support','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','customfield_11500','email','fields','customfield_11501','oldToken'];(function(_0x1d19fc,_0x182425){var _0x5667d0=function(_0x2dbd0d){while(--_0x2dbd0d){_0x1d19fc['push'](_0x1d19fc['shift']());}};_0x5667d0(++_0x182425);}(_0x4b6f,0x19e));var _0xf4b6=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4b6f[_0x618414];return _0x21c19a;};'use strict';var BPromise=require(_0xf4b6('0x0'));var https=require(_0xf4b6('0x1'));var logger=require(_0xf4b6('0x2'))('api');var USERNAME=_0xf4b6('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x53bff7,_0x384ab4){var _0x1e815a={'fields':{'project':{'key':_0x53bff7[_0xf4b6('0x4')]||_0xf4b6('0x5')},'summary':(_0x53bff7[_0xf4b6('0x6')]||_0xf4b6('0x7'))+_0xf4b6('0x8')+_0x53bff7['ip'],'description':_0x53bff7['description']||JSON[_0xf4b6('0x9')](_0x53bff7),'issuetype':{'name':_0x53bff7[_0xf4b6('0xa')]||'Bug'}}};_0x1e815a['fields'][_0xf4b6('0xb')]=_0x53bff7[_0xf4b6('0xc')];_0x1e815a[_0xf4b6('0xd')][_0xf4b6('0xe')]=_0x53bff7[_0xf4b6('0xf')];_0x1e815a[_0xf4b6('0xd')][_0xf4b6('0x10')]=_0x53bff7['newToken'];_0x1e815a[_0xf4b6('0xd')][_0xf4b6('0x11')]=_0x53bff7[_0xf4b6('0x12')];_0x1e815a['fields']['customfield_11504']=_0x53bff7[_0xf4b6('0x13')];_0x1e815a[_0xf4b6('0xd')][_0xf4b6('0x14')]=_0x53bff7['ip'];var _0x3b62e2={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xf4b6('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xf4b6('0x16'),'Authorization':_0xf4b6('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xf4b6('0x18')](_0xf4b6('0x19'))}};var _0x65824b=JSON['stringify'](_0x1e815a);var _0x4ebd8b=https['request'](_0x3b62e2,function(_0x562020){_0x562020[_0xf4b6('0x1a')](_0xf4b6('0x1b'));var _0x315e65='';_0x562020['on']('data',function(_0x235c6b){_0x315e65+=_0x235c6b;});_0x562020['on'](_0xf4b6('0x1c'),function(){if(_0x384ab4){return _0x384ab4[_0xf4b6('0x1d')](_0x562020['statusCode'])[_0xf4b6('0x1e')](JSON[_0xf4b6('0x1f')](_0x315e65));}});});_0x4ebd8b['on']('error',function(_0x415cca){if(_0x384ab4){return _0x384ab4[_0xf4b6('0x1d')](0x1f4)[_0xf4b6('0x1e')]({'errors':[{'message':_0xf4b6('0x20'),'type':_0xf4b6('0x21')}]});}});_0x4ebd8b[_0xf4b6('0x22')](_0x65824b);_0x4ebd8b[_0xf4b6('0x1c')]();}exports[_0xf4b6('0x23')]=openIssue;exports[_0xf4b6('0x24')]=function(_0x199bf2,_0x243ee8){_0x199bf2[_0xf4b6('0x25')]['ip']=_0x199bf2[_0xf4b6('0x26')][_0xf4b6('0x27')]||_0x199bf2[_0xf4b6('0x28')]['remoteAddress']||_0x199bf2[_0xf4b6('0x29')][_0xf4b6('0x2a')]||_0x199bf2[_0xf4b6('0x28')][_0xf4b6('0x29')][_0xf4b6('0x2a')];return openIssue(_0x199bf2[_0xf4b6('0x25')],_0x243ee8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 96ffec8..b866a5f 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 _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x2dc245,_0x2c46c9){var _0x3c6f8f=function(_0x1c3c05){while(--_0x1c3c05){_0x2dc245['push'](_0x2dc245['shift']());}};_0x3c6f8f(++_0x2c46c9);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2dae,0xc3));var _0xe2da=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x2dae[_0x2dc343];return _0x51eac5;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);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 1a9f7d4..e6edf7b 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x33cd02,_0x4813b8){_0x33cd02=_0x33cd02-0x0;var _0x44afec=_0x7a54[_0x33cd02];return _0x44afec;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x30b98c,_0x2335e9){_0x30b98c=_0x30b98c-0x0;var _0x444cb6=_0x7a54[_0x30b98c];return _0x444cb6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index ced31ab..fdabfaa 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 _0x42b0=['update','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save'];(function(_0x172e5f,_0x43e7e3){var _0x4ceea0=function(_0x37e417){while(--_0x37e417){_0x172e5f['push'](_0x172e5f['shift']());}};_0x4ceea0(++_0x43e7e3);}(_0x42b0,0xbc));var _0x042b=function(_0x1f37d5,_0x102bb8){_0x1f37d5=_0x1f37d5-0x0;var _0x3bbd99=_0x42b0[_0x1f37d5];return _0x3bbd99;};'use strict';var emlformat=require(_0x042b('0x0'));var rimraf=require(_0x042b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x042b('0x2'));var rp=require('request-promise');var moment=require(_0x042b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x042b('0x4'));var path=require(_0x042b('0x5'));var sox=require(_0x042b('0x6'));var csv=require(_0x042b('0x7'));var ejs=require(_0x042b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x042b('0x9'));var crypto=require(_0x042b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x042b('0x7'));var querystring=require('querystring');var Papa=require(_0x042b('0xb'));var Redis=require('ioredis');var authService=require(_0x042b('0xc'));var qs=require(_0x042b('0xd'));var as=require(_0x042b('0xe'));var hardwareService=require(_0x042b('0xf'));var logger=require(_0x042b('0x10'))(_0x042b('0x11'));var utils=require(_0x042b('0x12'));var config=require(_0x042b('0x13'));var licenseUtil=require(_0x042b('0x14'));var db=require(_0x042b('0x15'))['db'];function respondWithStatusCode(_0x2c0a6f,_0x35414e){_0x35414e=_0x35414e||0xcc;return function(_0x950ed9){if(_0x950ed9){return _0x2c0a6f['sendStatus'](_0x35414e);}return _0x2c0a6f[_0x042b('0x16')](_0x35414e)['end']();};}function respondWithResult(_0x1e5626,_0x5681bd){_0x5681bd=_0x5681bd||0xc8;return function(_0x31c22e){if(_0x31c22e){return _0x1e5626[_0x042b('0x16')](_0x5681bd)[_0x042b('0x17')](_0x31c22e);}};}function respondWithFilteredResult(_0xf9f4f3,_0x30c86f){return function(_0x183225){if(_0x183225){var _0x4dc4a6=typeof _0x30c86f[_0x042b('0x18')]===_0x042b('0x19')&&typeof _0x30c86f[_0x042b('0x1a')]===_0x042b('0x19');var _0x1e4eee=_0x183225['count'];var _0x2e2cb6=_0x4dc4a6?0x0:_0x30c86f[_0x042b('0x18')];var _0x4b5c25=_0x4dc4a6?_0x183225['count']:_0x30c86f[_0x042b('0x18')]+_0x30c86f[_0x042b('0x1a')];var _0x561d06;if(_0x4b5c25>=_0x1e4eee){_0x4b5c25=_0x1e4eee;_0x561d06=0xc8;}else{_0x561d06=0xce;}_0xf9f4f3[_0x042b('0x16')](_0x561d06);return _0xf9f4f3[_0x042b('0x1b')]('Content-Range',_0x2e2cb6+'-'+_0x4b5c25+'/'+_0x1e4eee)['json'](_0x183225);}return null;};}function patchUpdates(_0x5e6d8a){return function(_0x4eec67){try{jsonpatch[_0x042b('0x1c')](_0x4eec67,_0x5e6d8a,!![]);}catch(_0x23c915){return BPromise[_0x042b('0x1d')](_0x23c915);}return _0x4eec67[_0x042b('0x1e')]();};}function saveUpdates(_0x336c40,_0x50be84){return function(_0x36fabf){if(_0x36fabf){return _0x36fabf[_0x042b('0x1f')](_0x336c40)['then'](function(_0x5bc416){return _0x5bc416;});}return null;};}function removeEntity(_0x434d21,_0x59af51){return function(_0x558889){if(_0x558889){return _0x558889[_0x042b('0x20')]()[_0x042b('0x21')](function(){_0x434d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3204fc,_0x2f6e67){return function(_0x3c5491){if(!_0x3c5491){_0x3204fc['sendStatus'](0x194);}return _0x3c5491;};}function handleError(_0xda0462,_0x45d2c6){_0x45d2c6=_0x45d2c6||0x1f4;return function(_0x1b1250){logger['error'](_0x1b1250[_0x042b('0x22')]);if(_0x1b1250[_0x042b('0x23')]){delete _0x1b1250['name'];}_0xda0462[_0x042b('0x16')](_0x45d2c6)[_0x042b('0x24')](_0x1b1250);};}exports[_0x042b('0x25')]=function(_0x39596c,_0x52e467){var _0x5b5fe7={},_0x572d6a={},_0x5c0c41={'count':0x0,'rows':[]};var _0x34bb9e=_['map'](db[_0x042b('0x26')][_0x042b('0x27')],function(_0xddc276){return{'name':_0xddc276[_0x042b('0x28')],'type':_0xddc276[_0x042b('0x29')][_0x042b('0x2a')]};});_0x572d6a[_0x042b('0x2b')]=_[_0x042b('0x2c')](_0x34bb9e,_0x042b('0x23'));_0x572d6a[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x39596c[_0x042b('0x2d')]);_0x572d6a[_0x042b('0x2f')]=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],_0x572d6a[_0x042b('0x2d')]);_0x5b5fe7['attributes']=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],qs[_0x042b('0x31')](_0x39596c[_0x042b('0x2d')][_0x042b('0x31')]));_0x5b5fe7[_0x042b('0x32')]=_0x5b5fe7['attributes'][_0x042b('0x33')]?_0x5b5fe7[_0x042b('0x32')]:_0x572d6a['model'];if(!_0x39596c[_0x042b('0x2d')][_0x042b('0x34')](_0x042b('0x35'))){_0x5b5fe7[_0x042b('0x1a')]=qs['limit'](_0x39596c[_0x042b('0x2d')][_0x042b('0x1a')]);_0x5b5fe7[_0x042b('0x18')]=qs[_0x042b('0x18')](_0x39596c[_0x042b('0x2d')]['offset']);}_0x5b5fe7[_0x042b('0x36')]=qs[_0x042b('0x37')](_0x39596c[_0x042b('0x2d')]['sort']);_0x5b5fe7[_0x042b('0x38')]=qs['filters'](_[_0x042b('0x39')](_0x39596c[_0x042b('0x2d')],_0x572d6a['filters']),_0x34bb9e);if(_0x39596c[_0x042b('0x2d')][_0x042b('0x3a')]){_0x5b5fe7['where']=_['merge'](_0x5b5fe7[_0x042b('0x38')],{'$or':_[_0x042b('0x2c')](_0x34bb9e,function(_0x4aa81d){if(_0x4aa81d[_0x042b('0x29')]!==_0x042b('0x3b')){var _0x1f38c2={};_0x1f38c2[_0x4aa81d['name']]={'$like':'%'+_0x39596c['query'][_0x042b('0x3a')]+'%'};return _0x1f38c2;}})});}_0x5b5fe7=_[_0x042b('0x3c')]({},_0x5b5fe7,_0x39596c[_0x042b('0x3d')]);var _0x296b35={'where':_0x5b5fe7['where']};return db['JscriptyAnswerReport'][_0x042b('0x3e')](_0x296b35)['then'](function(_0x220653){_0x5c0c41['count']=_0x220653;if(_0x39596c[_0x042b('0x2d')]['includeAll']){_0x5b5fe7[_0x042b('0x3f')]=[{'all':!![]}];}return db[_0x042b('0x26')]['findAll'](_0x5b5fe7);})[_0x042b('0x21')](function(_0x5471fa){_0x5c0c41[_0x042b('0x40')]=_0x5471fa;return _0x5c0c41;})['then'](respondWithFilteredResult(_0x52e467,_0x5b5fe7))[_0x042b('0x41')](handleError(_0x52e467,null));};exports[_0x042b('0x42')]=function(_0x1a9245,_0x4ee3a4){var _0x527f49={'raw':!![],'where':{'id':_0x1a9245[_0x042b('0x43')]['id']}},_0x1fb824={};_0x1fb824[_0x042b('0x2b')]=_[_0x042b('0x2e')](db[_0x042b('0x26')][_0x042b('0x27')]);_0x1fb824[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x1a9245[_0x042b('0x2d')]);_0x1fb824[_0x042b('0x2f')]=_['intersection'](_0x1fb824[_0x042b('0x2b')],_0x1fb824[_0x042b('0x2d')]);_0x527f49[_0x042b('0x32')]=_[_0x042b('0x30')](_0x1fb824['model'],qs['fields'](_0x1a9245[_0x042b('0x2d')]['fields']));_0x527f49[_0x042b('0x32')]=_0x527f49[_0x042b('0x32')][_0x042b('0x33')]?_0x527f49['attributes']:_0x1fb824[_0x042b('0x2b')];if(_0x1a9245[_0x042b('0x2d')][_0x042b('0x44')]){_0x527f49[_0x042b('0x3f')]=[{'all':!![]}];}_0x527f49=_[_0x042b('0x3c')]({},_0x527f49,_0x1a9245[_0x042b('0x3d')]);return db[_0x042b('0x26')]['find'](_0x527f49)[_0x042b('0x21')](handleEntityNotFound(_0x4ee3a4,null))['then'](respondWithResult(_0x4ee3a4,null))[_0x042b('0x41')](handleError(_0x4ee3a4,null));};exports[_0x042b('0x45')]=function(_0x533862,_0x37488a){return db[_0x042b('0x26')][_0x042b('0x45')](_0x533862[_0x042b('0x46')],{})[_0x042b('0x21')](respondWithResult(_0x37488a,0xc9))[_0x042b('0x41')](handleError(_0x37488a,null));};exports[_0x042b('0x1f')]=function(_0x476eda,_0x48fe3e){if(_0x476eda[_0x042b('0x46')]['id']){delete _0x476eda[_0x042b('0x46')]['id'];}return db[_0x042b('0x26')][_0x042b('0x47')]({'where':{'id':_0x476eda[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x48fe3e,null))['then'](saveUpdates(_0x476eda['body'],null))[_0x042b('0x21')](respondWithResult(_0x48fe3e,null))[_0x042b('0x41')](handleError(_0x48fe3e,null));};exports[_0x042b('0x20')]=function(_0x396da4,_0x261c87){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x396da4[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x261c87,null))['then'](removeEntity(_0x261c87,null))[_0x042b('0x41')](handleError(_0x261c87,null));};exports['describe']=function(_0x15e46f,_0x170056){return db[_0x042b('0x26')][_0x042b('0x48')]()['then'](respondWithResult(_0x170056,null))[_0x042b('0x41')](handleError(_0x170056,null));}; \ No newline at end of file +var _0x0bde=['end','json','offset','undefined','count','set','Content-Range','reject','save','then','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','JscriptyAnswerReport','include','findAll','rows','catch','params','length','includeAll','merge','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x36b474,_0x57d2e9){var _0x510f44=function(_0x251824){while(--_0x251824){_0x36b474['push'](_0x36b474['shift']());}};_0x510f44(++_0x57d2e9);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require('request-promise');var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var Redis=require('ioredis');var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bd('0x14'));var logger=require('../../config/logger')(_0xe0bd('0x15'));var utils=require(_0xe0bd('0x16'));var config=require(_0xe0bd('0x17'));var licenseUtil=require(_0xe0bd('0x18'));var db=require(_0xe0bd('0x19'))['db'];function respondWithStatusCode(_0x16c3a9,_0x1905b2){_0x1905b2=_0x1905b2||0xcc;return function(_0x500a9e){if(_0x500a9e){return _0x16c3a9[_0xe0bd('0x1a')](_0x1905b2);}return _0x16c3a9[_0xe0bd('0x1b')](_0x1905b2)[_0xe0bd('0x1c')]();};}function respondWithResult(_0x5c76f1,_0x479438){_0x479438=_0x479438||0xc8;return function(_0x48afde){if(_0x48afde){return _0x5c76f1[_0xe0bd('0x1b')](_0x479438)[_0xe0bd('0x1d')](_0x48afde);}};}function respondWithFilteredResult(_0x3f5ef7,_0x3042e1){return function(_0x361429){if(_0x361429){var _0x302f5f=typeof _0x3042e1[_0xe0bd('0x1e')]===_0xe0bd('0x1f')&&typeof _0x3042e1['limit']==='undefined';var _0x2d2ba3=_0x361429[_0xe0bd('0x20')];var _0x1c4533=_0x302f5f?0x0:_0x3042e1[_0xe0bd('0x1e')];var _0xa6be32=_0x302f5f?_0x361429[_0xe0bd('0x20')]:_0x3042e1['offset']+_0x3042e1['limit'];var _0x29bd21;if(_0xa6be32>=_0x2d2ba3){_0xa6be32=_0x2d2ba3;_0x29bd21=0xc8;}else{_0x29bd21=0xce;}_0x3f5ef7[_0xe0bd('0x1b')](_0x29bd21);return _0x3f5ef7[_0xe0bd('0x21')](_0xe0bd('0x22'),_0x1c4533+'-'+_0xa6be32+'/'+_0x2d2ba3)[_0xe0bd('0x1d')](_0x361429);}return null;};}function patchUpdates(_0x154480){return function(_0x3dbd98){try{jsonpatch['apply'](_0x3dbd98,_0x154480,!![]);}catch(_0x5ad8bf){return BPromise[_0xe0bd('0x23')](_0x5ad8bf);}return _0x3dbd98[_0xe0bd('0x24')]();};}function saveUpdates(_0x3927ab,_0xdcb789){return function(_0x290c1e){if(_0x290c1e){return _0x290c1e['update'](_0x3927ab)[_0xe0bd('0x25')](function(_0x4795ac){return _0x4795ac;});}return null;};}function removeEntity(_0x242cbe,_0x296f64){return function(_0x3f24b6){if(_0x3f24b6){return _0x3f24b6['destroy']()[_0xe0bd('0x25')](function(){_0x242cbe[_0xe0bd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ca10,_0x5e6496){return function(_0x2debcb){if(!_0x2debcb){_0x41ca10['sendStatus'](0x194);}return _0x2debcb;};}function handleError(_0x198a1c,_0x72e284){_0x72e284=_0x72e284||0x1f4;return function(_0x3c851d){logger['error'](_0x3c851d[_0xe0bd('0x26')]);if(_0x3c851d['name']){delete _0x3c851d[_0xe0bd('0x27')];}_0x198a1c[_0xe0bd('0x1b')](_0x72e284)['send'](_0x3c851d);};}exports['index']=function(_0x273b95,_0x3789a1){var _0x441475={},_0x23a317={},_0x2d7f2f={'count':0x0,'rows':[]};var _0x17e614=_[_0xe0bd('0x28')](db['JscriptyAnswerReport'][_0xe0bd('0x29')],function(_0x137206){return{'name':_0x137206[_0xe0bd('0x2a')],'type':_0x137206[_0xe0bd('0x2b')][_0xe0bd('0x2c')]};});_0x23a317[_0xe0bd('0x2d')]=_['map'](_0x17e614,_0xe0bd('0x27'));_0x23a317[_0xe0bd('0x2e')]=_[_0xe0bd('0x2f')](_0x273b95[_0xe0bd('0x2e')]);_0x23a317[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x23a317[_0xe0bd('0x2d')],_0x23a317[_0xe0bd('0x2e')]);_0x441475['attributes']=_['intersection'](_0x23a317[_0xe0bd('0x2d')],qs[_0xe0bd('0x32')](_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x32')]));_0x441475[_0xe0bd('0x33')]=_0x441475['attributes']['length']?_0x441475['attributes']:_0x23a317[_0xe0bd('0x2d')];if(!_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x34')](_0xe0bd('0x35'))){_0x441475[_0xe0bd('0x36')]=qs[_0xe0bd('0x36')](_0x273b95['query'][_0xe0bd('0x36')]);_0x441475[_0xe0bd('0x1e')]=qs[_0xe0bd('0x1e')](_0x273b95['query'][_0xe0bd('0x1e')]);}_0x441475[_0xe0bd('0x37')]=qs['sort'](_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x38')]);_0x441475[_0xe0bd('0x39')]=qs['filters'](_[_0xe0bd('0x3a')](_0x273b95['query'],_0x23a317[_0xe0bd('0x30')]),_0x17e614);if(_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x3b')]){_0x441475[_0xe0bd('0x39')]=_['merge'](_0x441475[_0xe0bd('0x39')],{'$or':_[_0xe0bd('0x28')](_0x17e614,function(_0x7f9272){if(_0x7f9272['type']!=='VIRTUAL'){var _0x23064a={};_0x23064a[_0x7f9272[_0xe0bd('0x27')]]={'$like':'%'+_0x273b95[_0xe0bd('0x2e')]['filter']+'%'};return _0x23064a;}})});}_0x441475=_['merge']({},_0x441475,_0x273b95[_0xe0bd('0x3c')]);var _0x383b08={'where':_0x441475[_0xe0bd('0x39')]};return db[_0xe0bd('0x3d')]['count'](_0x383b08)[_0xe0bd('0x25')](function(_0x23b596){_0x2d7f2f[_0xe0bd('0x20')]=_0x23b596;if(_0x273b95['query']['includeAll']){_0x441475[_0xe0bd('0x3e')]=[{'all':!![]}];}return db[_0xe0bd('0x3d')][_0xe0bd('0x3f')](_0x441475);})[_0xe0bd('0x25')](function(_0x5ada76){_0x2d7f2f[_0xe0bd('0x40')]=_0x5ada76;return _0x2d7f2f;})[_0xe0bd('0x25')](respondWithFilteredResult(_0x3789a1,_0x441475))[_0xe0bd('0x41')](handleError(_0x3789a1,null));};exports['show']=function(_0x499e16,_0x27a582){var _0x52a0af={'raw':!![],'where':{'id':_0x499e16[_0xe0bd('0x42')]['id']}},_0x24be53={};_0x24be53['model']=_[_0xe0bd('0x2f')](db[_0xe0bd('0x3d')][_0xe0bd('0x29')]);_0x24be53['query']=_[_0xe0bd('0x2f')](_0x499e16[_0xe0bd('0x2e')]);_0x24be53[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x24be53[_0xe0bd('0x2d')],_0x24be53[_0xe0bd('0x2e')]);_0x52a0af[_0xe0bd('0x33')]=_[_0xe0bd('0x31')](_0x24be53['model'],qs[_0xe0bd('0x32')](_0x499e16[_0xe0bd('0x2e')][_0xe0bd('0x32')]));_0x52a0af[_0xe0bd('0x33')]=_0x52a0af[_0xe0bd('0x33')][_0xe0bd('0x43')]?_0x52a0af[_0xe0bd('0x33')]:_0x24be53[_0xe0bd('0x2d')];if(_0x499e16['query'][_0xe0bd('0x44')]){_0x52a0af[_0xe0bd('0x3e')]=[{'all':!![]}];}_0x52a0af=_[_0xe0bd('0x45')]({},_0x52a0af,_0x499e16[_0xe0bd('0x3c')]);return db[_0xe0bd('0x3d')]['find'](_0x52a0af)[_0xe0bd('0x25')](handleEntityNotFound(_0x27a582,null))['then'](respondWithResult(_0x27a582,null))['catch'](handleError(_0x27a582,null));};exports['create']=function(_0x2d7e00,_0x55dd83){return db['JscriptyAnswerReport'][_0xe0bd('0x46')](_0x2d7e00[_0xe0bd('0x47')],{})[_0xe0bd('0x25')](respondWithResult(_0x55dd83,0xc9))[_0xe0bd('0x41')](handleError(_0x55dd83,null));};exports[_0xe0bd('0x48')]=function(_0x220147,_0xe2b989){if(_0x220147[_0xe0bd('0x47')]['id']){delete _0x220147[_0xe0bd('0x47')]['id'];}return db[_0xe0bd('0x3d')]['find']({'where':{'id':_0x220147[_0xe0bd('0x42')]['id']}})['then'](handleEntityNotFound(_0xe2b989,null))['then'](saveUpdates(_0x220147[_0xe0bd('0x47')],null))[_0xe0bd('0x25')](respondWithResult(_0xe2b989,null))[_0xe0bd('0x41')](handleError(_0xe2b989,null));};exports['destroy']=function(_0x281a60,_0x3fe076){return db[_0xe0bd('0x3d')][_0xe0bd('0x49')]({'where':{'id':_0x281a60[_0xe0bd('0x42')]['id']}})[_0xe0bd('0x25')](handleEntityNotFound(_0x3fe076,null))[_0xe0bd('0x25')](removeEntity(_0x3fe076,null))[_0xe0bd('0x41')](handleError(_0x3fe076,null));};exports[_0xe0bd('0x4a')]=function(_0x1f85ef,_0x29c7f8){return db[_0xe0bd('0x3d')]['describe']()[_0xe0bd('0x25')](respondWithResult(_0x29c7f8,null))[_0xe0bd('0x41')](handleError(_0x29c7f8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index f73cebd..591c566 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 _0xf902=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x6dfc9a,_0x200246){var _0x2eb4cd=function(_0x4ebbbb){while(--_0x4ebbbb){_0x6dfc9a['push'](_0x6dfc9a['shift']());}};_0x2eb4cd(++_0x200246);}(_0xf902,0x9f));var _0x2f90=function(_0x1325c2,_0xce30a3){_0x1325c2=_0x1325c2-0x0;var _0x348c89=_0xf902[_0x1325c2];return _0x348c89;};'use strict';var _=require(_0x2f90('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2f90('0x1'));var moment=require(_0x2f90('0x2'));var BPromise=require(_0x2f90('0x3'));var rp=require(_0x2f90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f90('0x5'));var config=require(_0x2f90('0x6'));var attributes=require(_0x2f90('0x7'));module[_0x2f90('0x8')]=function(_0x5c5a19,_0x32634f){return _0x5c5a19[_0x2f90('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x2f90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x236f=['./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd0edc7,_0x13ffd6){var _0x3daeed=function(_0x27118){while(--_0x27118){_0xd0edc7['push'](_0xd0edc7['shift']());}};_0x3daeed(++_0x13ffd6);}(_0x236f,0xad));var _0xf236=function(_0x5b9020,_0x59a581){_0x5b9020=_0x5b9020-0x0;var _0x56e303=_0x236f[_0x5b9020];return _0x56e303;};'use strict';var _=require(_0xf236('0x0'));var util=require(_0xf236('0x1'));var logger=require(_0xf236('0x2'))(_0xf236('0x3'));var moment=require('moment');var BPromise=require(_0xf236('0x4'));var rp=require(_0xf236('0x5'));var fs=require('fs');var path=require(_0xf236('0x6'));var rimraf=require(_0xf236('0x7'));var config=require(_0xf236('0x8'));var attributes=require(_0xf236('0x9'));module[_0xf236('0xa')]=function(_0x4b5b79,_0x247a35){return _0x4b5b79[_0xf236('0xb')]('JscriptyAnswerReport',attributes,{'tableName':_0xf236('0xc'),'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 1acadb5..926974f 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 _0x8e5e=['request\x20sent','stringify','error','message','JscriptyAnswerReport,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x34a37d,_0x3a0ad9){var _0x210067=function(_0x507f80){while(--_0x507f80){_0x34a37d['push'](_0x34a37d['shift']());}};_0x210067(++_0x3a0ad9);}(_0x8e5e,0xdf));var _0xe8e5=function(_0x3ba5a4,_0x1ab3a2){_0x3ba5a4=_0x3ba5a4-0x0;var _0x361851=_0x8e5e[_0x3ba5a4];return _0x361851;};'use strict';var _=require(_0xe8e5('0x0'));var util=require(_0xe8e5('0x1'));var moment=require(_0xe8e5('0x2'));var BPromise=require(_0xe8e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8e5('0x4'))['db'];var utils=require(_0xe8e5('0x5'));var logger=require(_0xe8e5('0x6'))('rpc');var config=require(_0xe8e5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x292109,_0x321389,_0x47a2f6){return new BPromise(function(_0x5851f8,_0x534df7){return client['request'](_0x292109,_0x47a2f6)['then'](function(_0x246d0b){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x321389,'request\x20sent');logger[_0xe8e5('0x9')](_0xe8e5('0xa'),_0x321389,_0xe8e5('0xb'),JSON[_0xe8e5('0xc')](_0x246d0b));if(_0x246d0b['error']){if(_0x246d0b[_0xe8e5('0xd')]['code']===0x1f4){logger[_0xe8e5('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x321389,_0x246d0b[_0xe8e5('0xd')][_0xe8e5('0xe')]);return _0x534df7(_0x246d0b[_0xe8e5('0xd')][_0xe8e5('0xe')]);}logger[_0xe8e5('0xd')](_0xe8e5('0xf'),_0x321389,_0x246d0b[_0xe8e5('0xd')][_0xe8e5('0xe')]);return _0x5851f8(_0x246d0b[_0xe8e5('0xd')][_0xe8e5('0xe')]);}else{logger[_0xe8e5('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x321389,_0xe8e5('0xb'));_0x5851f8(_0x246d0b[_0xe8e5('0x11')][_0xe8e5('0xe')]);}})['catch'](function(_0x36daae){logger[_0xe8e5('0xd')](_0xe8e5('0xf'),_0x321389,_0x36daae);_0x534df7(_0x36daae);});});} \ No newline at end of file +var _0x300b=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','debug'];(function(_0x307938,_0x199b8d){var _0x35f6b5=function(_0x5bf390){while(--_0x5bf390){_0x307938['push'](_0x307938['shift']());}};_0x35f6b5(++_0x199b8d);}(_0x300b,0x1a9));var _0xb300=function(_0x6195d5,_0x229f91){_0x6195d5=_0x6195d5-0x0;var _0xe64eda=_0x300b[_0x6195d5];return _0xe64eda;};'use strict';var _=require(_0xb300('0x0'));var util=require(_0xb300('0x1'));var moment=require(_0xb300('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb300('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb300('0x4'));var logger=require('../../config/logger')(_0xb300('0x5'));var config=require('../../config/environment');var jayson=require(_0xb300('0x6'));var client=jayson[_0xb300('0x7')][_0xb300('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b7b80,_0x4f1b2b,_0xbe5f8e){return new BPromise(function(_0x3a9cdf,_0x4de410){return client['request'](_0x4b7b80,_0xbe5f8e)[_0xb300('0x9')](function(_0x3a588b){logger[_0xb300('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f1b2b,'request\x20sent');logger[_0xb300('0xb')](_0xb300('0xc'),_0x4f1b2b,_0xb300('0xd'),JSON['stringify'](_0x3a588b));if(_0x3a588b[_0xb300('0xe')]){if(_0x3a588b[_0xb300('0xe')][_0xb300('0xf')]===0x1f4){logger[_0xb300('0xe')](_0xb300('0x10'),_0x4f1b2b,_0x3a588b[_0xb300('0xe')]['message']);return _0x4de410(_0x3a588b['error'][_0xb300('0x11')]);}logger[_0xb300('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f1b2b,_0x3a588b[_0xb300('0xe')][_0xb300('0x11')]);return _0x3a9cdf(_0x3a588b['error']['message']);}else{logger[_0xb300('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f1b2b,'request\x20sent');_0x3a9cdf(_0x3a588b[_0xb300('0x12')][_0xb300('0x11')]);}})['catch'](function(_0xa31f4f){logger[_0xb300('0xe')](_0xb300('0x10'),_0x4f1b2b,_0xa31f4f);_0x4de410(_0xa31f4f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b2cbe23..bd7b624 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 _0x0cfc=['update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','/:id','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put'];(function(_0x3271c7,_0x3bd8ff){var _0x1514ff=function(_0x3f710d){while(--_0x3f710d){_0x3271c7['push'](_0x3271c7['shift']());}};_0x1514ff(++_0x3bd8ff);}(_0x0cfc,0xc7));var _0xc0cf=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0cfc[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xc0cf('0x0'));var util=require(_0xc0cf('0x1'));var path=require(_0xc0cf('0x2'));var timeout=require(_0xc0cf('0x3'));var express=require('express');var router=express[_0xc0cf('0x4')]();var fs_extra=require(_0xc0cf('0x5'));var auth=require(_0xc0cf('0x6'));var interaction=require(_0xc0cf('0x7'));var config=require(_0xc0cf('0x8'));var controller=require(_0xc0cf('0x9'));router['get']('/',auth[_0xc0cf('0xa')](),controller[_0xc0cf('0xb')]);router['get'](_0xc0cf('0xc'),auth[_0xc0cf('0xa')](),controller['show']);router[_0xc0cf('0xd')](_0xc0cf('0xe'),auth['isAuthenticated'](),controller[_0xc0cf('0xf')]);router['get'](_0xc0cf('0x10'),auth['isAuthenticated'](),controller[_0xc0cf('0x11')]);router[_0xc0cf('0xd')](_0xc0cf('0x12'),auth[_0xc0cf('0xa')](),timeout(_0xc0cf('0x13')),controller['getSummary']);router[_0xc0cf('0x14')]('/',auth['isAuthenticated'](),controller[_0xc0cf('0x15')]);router[_0xc0cf('0x14')](_0xc0cf('0x16'),auth[_0xc0cf('0xa')](),controller[_0xc0cf('0x17')]);router[_0xc0cf('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xc0cf('0x19')]);router[_0xc0cf('0x1a')](_0xc0cf('0xc'),auth[_0xc0cf('0xa')](),controller[_0xc0cf('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2931=['/:id/summary','getSummary','create','post','clone','put','update','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','show','getSessions','/:id/answers','getAnswers'];(function(_0x43318b,_0x259c69){var _0x5d13b9=function(_0xd85545){while(--_0xd85545){_0x43318b['push'](_0x43318b['shift']());}};_0x5d13b9(++_0x259c69);}(_0x2931,0x66));var _0x1293=function(_0x242bca,_0x450a13){_0x242bca=_0x242bca-0x0;var _0x4a96bd=_0x2931[_0x242bca];return _0x4a96bd;};'use strict';var multer=require(_0x1293('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1293('0x1'));var express=require(_0x1293('0x2'));var router=express[_0x1293('0x3')]();var fs_extra=require(_0x1293('0x4'));var auth=require(_0x1293('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1293('0x6'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x1293('0x7')](),controller['index']);router[_0x1293('0x8')]('/:id',auth[_0x1293('0x7')](),controller[_0x1293('0x9')]);router[_0x1293('0x8')]('/:id/sessions',auth[_0x1293('0x7')](),controller[_0x1293('0xa')]);router[_0x1293('0x8')](_0x1293('0xb'),auth[_0x1293('0x7')](),controller[_0x1293('0xc')]);router[_0x1293('0x8')](_0x1293('0xd'),auth[_0x1293('0x7')](),timeout('30s'),controller[_0x1293('0xe')]);router['post']('/',auth[_0x1293('0x7')](),controller[_0x1293('0xf')]);router[_0x1293('0x10')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1293('0x11')]);router[_0x1293('0x12')]('/:id',auth[_0x1293('0x7')](),controller[_0x1293('0x13')]);router['delete'](_0x1293('0x14'),auth['isAuthenticated'](),controller[_0x1293('0x15')]);module[_0x1293('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 86948ac..73221cb 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 _0xb51f=['description','BOOLEAN','sequelize','lodash','util','exports','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue'];(function(_0x4b7c65,_0x48df1d){var _0x16a07f=function(_0x120abf){while(--_0x120abf){_0x4b7c65['push'](_0x4b7c65['shift']());}};_0x16a07f(++_0x48df1d);}(_0xb51f,0x188));var _0xfb51=function(_0x40b241,_0x2ce6cc){_0x40b241=_0x40b241-0x0;var _0x22b4b1=_0xb51f[_0x40b241];return _0x22b4b1;};'use strict';var Sequelize=require(_0xfb51('0x0'));var _=require(_0xfb51('0x1'));var util=require(_0xfb51('0x2'));module[_0xfb51('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb51('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xfb51('0x5')),'set':function(_0x32d6ec){if(_[_0xfb51('0x6')](_0x32d6ec)){this[_0xfb51('0x7')](_0xfb51('0x8'),JSON[_0xfb51('0x9')](_0x32d6ec));}else if(_[_0xfb51('0xa')](_0x32d6ec)){this[_0xfb51('0x7')](_0xfb51('0x8'),_0x32d6ec);}else{this[_0xfb51('0x7')](_0xfb51('0x8'),util[_0xfb51('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xfb51('0xc')]('name')||'',this[_0xfb51('0xc')](_0xfb51('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xfb51('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xfb51('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xcea2=['BOOLEAN','sequelize','lodash','util','exports','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x371eb1,_0x39b49e){var _0x44c2a1=function(_0x594b7c){while(--_0x594b7c){_0x371eb1['push'](_0x371eb1['shift']());}};_0x44c2a1(++_0x39b49e);}(_0xcea2,0x141));var _0x2cea=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcea2[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x2cea('0x0'));var _=require(_0x2cea('0x1'));var util=require(_0x2cea('0x2'));module[_0x2cea('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x2cea('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2cea('0x5')](_0x2cea('0x6')),'set':function(_0x491e88){if(_[_0x2cea('0x7')](_0x491e88)){this[_0x2cea('0x8')](_0x2cea('0x9'),JSON[_0x2cea('0xa')](_0x491e88));}else if(_[_0x2cea('0xb')](_0x491e88)){this['setDataValue'](_0x2cea('0x9'),_0x491e88);}else{this[_0x2cea('0x8')](_0x2cea('0x9'),util['format'](_0x2cea('0xc'),this[_0x2cea('0xd')](_0x2cea('0x4'))||'',this[_0x2cea('0xd')](_0x2cea('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2cea('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2cea('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 3e7f57e..46251b6 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 _0xc264=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','JscriptyProject','include','rows','catch','show','params','includeAll','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','omit','createdAt','updatedAt','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','findAll','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xc264,0x1a6));var _0x4c26=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0xc264[_0x531607];return _0x1b1fbb;};'use strict';var emlformat=require(_0x4c26('0x0'));var rimraf=require(_0x4c26('0x1'));var zipdir=require(_0x4c26('0x2'));var jsonpatch=require(_0x4c26('0x3'));var rp=require(_0x4c26('0x4'));var moment=require(_0x4c26('0x5'));var BPromise=require(_0x4c26('0x6'));var Mustache=require(_0x4c26('0x7'));var util=require(_0x4c26('0x8'));var path=require('path');var sox=require(_0x4c26('0x9'));var csv=require(_0x4c26('0xa'));var ejs=require(_0x4c26('0xb'));var fs=require('fs');var fs_extra=require(_0x4c26('0xc'));var _=require(_0x4c26('0xd'));var squel=require('squel');var crypto=require(_0x4c26('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4c26('0xf'));var toCsv=require(_0x4c26('0xa'));var querystring=require(_0x4c26('0x10'));var Papa=require(_0x4c26('0x11'));var Redis=require(_0x4c26('0x12'));var authService=require(_0x4c26('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4c26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c26('0x15'));var utils=require(_0x4c26('0x16'));var config=require(_0x4c26('0x17'));var licenseUtil=require(_0x4c26('0x18'));var db=require(_0x4c26('0x19'))['db'];function respondWithStatusCode(_0x2e819d,_0x49a9a5){_0x49a9a5=_0x49a9a5||0xcc;return function(_0xd6e9dc){if(_0xd6e9dc){return _0x2e819d[_0x4c26('0x1a')](_0x49a9a5);}return _0x2e819d[_0x4c26('0x1b')](_0x49a9a5)[_0x4c26('0x1c')]();};}function respondWithResult(_0x9477e7,_0x2183cd){_0x2183cd=_0x2183cd||0xc8;return function(_0x2013dd){if(_0x2013dd){return _0x9477e7['status'](_0x2183cd)[_0x4c26('0x1d')](_0x2013dd);}};}function respondWithFilteredResult(_0x565772,_0x26cf4d){return function(_0x57c8a2){if(_0x57c8a2){var _0x6cb9c3=typeof _0x26cf4d[_0x4c26('0x1e')]===_0x4c26('0x1f')&&typeof _0x26cf4d[_0x4c26('0x20')]===_0x4c26('0x1f');var _0x5c9511=_0x57c8a2['count'];var _0x4bc348=_0x6cb9c3?0x0:_0x26cf4d['offset'];var _0x368cde=_0x6cb9c3?_0x57c8a2[_0x4c26('0x21')]:_0x26cf4d[_0x4c26('0x1e')]+_0x26cf4d[_0x4c26('0x20')];var _0x5183bc;if(_0x368cde>=_0x5c9511){_0x368cde=_0x5c9511;_0x5183bc=0xc8;}else{_0x5183bc=0xce;}_0x565772[_0x4c26('0x1b')](_0x5183bc);return _0x565772[_0x4c26('0x22')]('Content-Range',_0x4bc348+'-'+_0x368cde+'/'+_0x5c9511)[_0x4c26('0x1d')](_0x57c8a2);}return null;};}function patchUpdates(_0x2fca53){return function(_0x561a4c){try{jsonpatch[_0x4c26('0x23')](_0x561a4c,_0x2fca53,!![]);}catch(_0x4e39a2){return BPromise['reject'](_0x4e39a2);}return _0x561a4c[_0x4c26('0x24')]();};}function saveUpdates(_0x2f8e0e,_0x16eca3){return function(_0x3031f1){if(_0x3031f1){return _0x3031f1[_0x4c26('0x25')](_0x2f8e0e)[_0x4c26('0x26')](function(_0x5d5d5d){return _0x5d5d5d;});}return null;};}function removeEntity(_0xf90f8f,_0x3bb44c){return function(_0x64efe4){if(_0x64efe4){return _0x64efe4[_0x4c26('0x27')]()[_0x4c26('0x26')](function(){var _0x14b198=_0x64efe4[_0x4c26('0x28')]({'plain':!![]});var _0xf081d0=_0x4c26('0x29');return db[_0x4c26('0x2a')][_0x4c26('0x27')]({'where':{'type':_0xf081d0,'resourceId':_0x14b198['id']}})[_0x4c26('0x26')](function(){return _0x64efe4;});})['then'](function(){_0xf90f8f[_0x4c26('0x1b')](0xcc)[_0x4c26('0x1c')]();});}};}function handleEntityNotFound(_0x42d357,_0x3f0bf9){return function(_0x5cb4a8){if(!_0x5cb4a8){_0x42d357[_0x4c26('0x1a')](0x194);}return _0x5cb4a8;};}function handleError(_0x37eec9,_0x5e960b){_0x5e960b=_0x5e960b||0x1f4;return function(_0x580ef7){logger[_0x4c26('0x2b')](_0x580ef7[_0x4c26('0x2c')]);if(_0x580ef7['name']){delete _0x580ef7['name'];}_0x37eec9[_0x4c26('0x1b')](_0x5e960b)[_0x4c26('0x2d')](_0x580ef7);};}exports[_0x4c26('0x2e')]=function(_0x5eb349,_0x7ae97c){var _0x3d8bf3={},_0x6ebe28={},_0x47cfe3={'count':0x0,'rows':[]};var _0x47c530=_[_0x4c26('0x2f')](db['JscriptyProject'][_0x4c26('0x30')],function(_0x325d14){return{'name':_0x325d14[_0x4c26('0x31')],'type':_0x325d14[_0x4c26('0x32')][_0x4c26('0x33')]};});_0x6ebe28[_0x4c26('0x34')]=_['map'](_0x47c530,_0x4c26('0x35'));_0x6ebe28[_0x4c26('0x36')]=_[_0x4c26('0x37')](_0x5eb349[_0x4c26('0x36')]);_0x6ebe28['filters']=_[_0x4c26('0x38')](_0x6ebe28[_0x4c26('0x34')],_0x6ebe28['query']);_0x3d8bf3['attributes']=_[_0x4c26('0x38')](_0x6ebe28[_0x4c26('0x34')],qs[_0x4c26('0x39')](_0x5eb349['query'][_0x4c26('0x39')]));_0x3d8bf3[_0x4c26('0x3a')]=_0x3d8bf3['attributes'][_0x4c26('0x3b')]?_0x3d8bf3[_0x4c26('0x3a')]:_0x6ebe28[_0x4c26('0x34')];if(!_0x5eb349['query'][_0x4c26('0x3c')](_0x4c26('0x3d'))){_0x3d8bf3[_0x4c26('0x20')]=qs[_0x4c26('0x20')](_0x5eb349[_0x4c26('0x36')][_0x4c26('0x20')]);_0x3d8bf3[_0x4c26('0x1e')]=qs[_0x4c26('0x1e')](_0x5eb349[_0x4c26('0x36')]['offset']);}_0x3d8bf3[_0x4c26('0x3e')]=qs[_0x4c26('0x3f')](_0x5eb349[_0x4c26('0x36')][_0x4c26('0x3f')]);_0x3d8bf3[_0x4c26('0x40')]=qs[_0x4c26('0x41')](_[_0x4c26('0x42')](_0x5eb349[_0x4c26('0x36')],_0x6ebe28[_0x4c26('0x41')]),_0x47c530);if(_0x5eb349[_0x4c26('0x36')][_0x4c26('0x43')]){_0x3d8bf3[_0x4c26('0x40')]=_[_0x4c26('0x44')](_0x3d8bf3[_0x4c26('0x40')],{'$or':_['map'](_0x47c530,function(_0x11c99c){if(_0x11c99c['type']!=='VIRTUAL'){var _0x4c181e={};_0x4c181e[_0x11c99c[_0x4c26('0x35')]]={'$like':'%'+_0x5eb349[_0x4c26('0x36')][_0x4c26('0x43')]+'%'};return _0x4c181e;}})});}_0x3d8bf3=_[_0x4c26('0x44')]({},_0x3d8bf3,_0x5eb349[_0x4c26('0x45')]);var _0x5e4897={'where':_0x3d8bf3[_0x4c26('0x40')]};return db[_0x4c26('0x46')][_0x4c26('0x21')](_0x5e4897)['then'](function(_0x563426){_0x47cfe3['count']=_0x563426;if(_0x5eb349[_0x4c26('0x36')]['includeAll']){_0x3d8bf3[_0x4c26('0x47')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x3d8bf3);})[_0x4c26('0x26')](function(_0x3b96f2){_0x47cfe3[_0x4c26('0x48')]=_0x3b96f2;return _0x47cfe3;})[_0x4c26('0x26')](respondWithFilteredResult(_0x7ae97c,_0x3d8bf3))[_0x4c26('0x49')](handleError(_0x7ae97c,null));};exports[_0x4c26('0x4a')]=function(_0x347b66,_0x596c7b){var _0x4a7b08={'raw':![],'where':{'id':_0x347b66[_0x4c26('0x4b')]['id']}},_0x701139={};_0x701139[_0x4c26('0x34')]=_['keys'](db[_0x4c26('0x46')][_0x4c26('0x30')]);_0x701139[_0x4c26('0x36')]=_[_0x4c26('0x37')](_0x347b66[_0x4c26('0x36')]);_0x701139[_0x4c26('0x41')]=_[_0x4c26('0x38')](_0x701139[_0x4c26('0x34')],_0x701139['query']);_0x4a7b08[_0x4c26('0x3a')]=_[_0x4c26('0x38')](_0x701139['model'],qs[_0x4c26('0x39')](_0x347b66[_0x4c26('0x36')][_0x4c26('0x39')]));_0x4a7b08[_0x4c26('0x3a')]=_0x4a7b08[_0x4c26('0x3a')][_0x4c26('0x3b')]?_0x4a7b08[_0x4c26('0x3a')]:_0x701139[_0x4c26('0x34')];if(_0x347b66[_0x4c26('0x36')][_0x4c26('0x4c')]){_0x4a7b08[_0x4c26('0x47')]=[{'all':!![]}];}_0x4a7b08=_[_0x4c26('0x44')]({},_0x4a7b08,_0x347b66[_0x4c26('0x45')]);return db[_0x4c26('0x46')][_0x4c26('0x4d')](_0x4a7b08)[_0x4c26('0x26')](handleEntityNotFound(_0x596c7b,null))['then'](respondWithResult(_0x596c7b,null))['catch'](handleError(_0x596c7b,null));};exports[_0x4c26('0x4e')]=function(_0x1db1da,_0x1b192b){return db[_0x4c26('0x46')]['create'](_0x1db1da[_0x4c26('0x4f')],{})[_0x4c26('0x26')](function(_0x5acdca){var _0x18209b=_0x1db1da[_0x4c26('0x50')][_0x4c26('0x28')]({'plain':!![]});if(!_0x18209b)throw new Error(_0x4c26('0x51'));if(_0x18209b[_0x4c26('0x52')]===_0x4c26('0x50')){var _0x2116eb=_0x5acdca[_0x4c26('0x28')]({'plain':!![]});var _0x3185e6=_0x4c26('0x29');return db[_0x4c26('0x53')][_0x4c26('0x4d')]({'where':{'name':_0x3185e6,'userProfileId':_0x18209b[_0x4c26('0x54')]},'raw':!![]})[_0x4c26('0x26')](function(_0x2e87c2){if(_0x2e87c2&&_0x2e87c2[_0x4c26('0x55')]===0x0){return db[_0x4c26('0x2a')][_0x4c26('0x4e')]({'name':_0x2116eb['name'],'resourceId':_0x2116eb['id'],'type':_0x2e87c2[_0x4c26('0x35')],'sectionId':_0x2e87c2['id']},{})[_0x4c26('0x26')](function(){return _0x5acdca;});}else{return _0x5acdca;}})[_0x4c26('0x49')](function(_0x168560){logger[_0x4c26('0x2b')](_0x4c26('0x56'),_0x168560);throw _0x168560;});}return _0x5acdca;})['then'](respondWithResult(_0x1b192b,0xc9))[_0x4c26('0x49')](handleError(_0x1b192b,null));};exports[_0x4c26('0x57')]=function(_0x2e46f4,_0x1485ea){var _0x1c0e8c={'where':{'id':_0x2e46f4[_0x4c26('0x4b')]['id']}},_0x3bf130={};_0x3bf130[_0x4c26('0x34')]=_[_0x4c26('0x37')](db[_0x4c26('0x46')][_0x4c26('0x30')]);_0x1c0e8c[_0x4c26('0x3a')]=_[_0x4c26('0x38')](_0x3bf130[_0x4c26('0x34')],qs[_0x4c26('0x39')](_0x2e46f4['query'][_0x4c26('0x39')]));_0x1c0e8c['attributes']=_0x1c0e8c[_0x4c26('0x3a')][_0x4c26('0x3b')]?_0x1c0e8c[_0x4c26('0x3a')]:_0x3bf130[_0x4c26('0x34')];if(_0x2e46f4[_0x4c26('0x36')][_0x4c26('0x4c')]){_0x1c0e8c[_0x4c26('0x47')]=[{'all':!![]}];}_0x1c0e8c=_[_0x4c26('0x44')]({},_0x1c0e8c,_0x2e46f4[_0x4c26('0x45')]);return db[_0x4c26('0x46')]['find'](_0x1c0e8c)['then'](handleEntityNotFound(_0x1485ea,null))[_0x4c26('0x26')](function(_0xdcb515){if(_0xdcb515){var _0x3b4586=_0xdcb515['get']({'plain':!![]});_0x3b4586=qs[_0x4c26('0x58')](_0x3b4586,['id',_0x4c26('0x59'),_0x4c26('0x5a')]);_0x2e46f4['body']=_[_0x4c26('0x58')](_0x2e46f4['body'],['id','createdAt','updatedAt']);return db[_0x4c26('0x46')][_0x4c26('0x4e')](_['merge'](_0x3b4586,_0x2e46f4['body']),{'include':_0x2e46f4[_0x4c26('0x36')][_0x4c26('0x4c')]?[{'all':!![]}]:undefined})[_0x4c26('0x26')](function(_0x51d92f){var _0x214c3c=_0x2e46f4[_0x4c26('0x50')][_0x4c26('0x28')]({'plain':!![]});if(!_0x214c3c)throw new Error(_0x4c26('0x51'));if(_0x214c3c[_0x4c26('0x52')]===_0x4c26('0x50')){var _0x5984a8=_0x51d92f[_0x4c26('0x28')]({'plain':!![]});var _0xbbd603=_0x4c26('0x29');return db[_0x4c26('0x53')]['find']({'where':{'name':_0xbbd603,'userProfileId':_0x214c3c[_0x4c26('0x54')]},'raw':!![]})[_0x4c26('0x26')](function(_0xaa0959){if(_0xaa0959&&_0xaa0959[_0x4c26('0x55')]===0x0){return db[_0x4c26('0x2a')][_0x4c26('0x4e')]({'name':_0x5984a8[_0x4c26('0x35')],'resourceId':_0x5984a8['id'],'type':_0xaa0959['name'],'sectionId':_0xaa0959['id']},{})[_0x4c26('0x26')](function(){return _0x51d92f;});}else{return _0x51d92f;}})[_0x4c26('0x49')](function(_0x454d65){logger[_0x4c26('0x2b')](_0x4c26('0x56'),_0x454d65);throw _0x454d65;});}return _0x51d92f;});}})[_0x4c26('0x26')](respondWithResult(_0x1485ea,0xc9))[_0x4c26('0x49')](handleError(_0x1485ea,null));};exports[_0x4c26('0x25')]=function(_0x195488,_0x52f26b){if(_0x195488[_0x4c26('0x4f')]['id']){delete _0x195488['body']['id'];}return db[_0x4c26('0x46')][_0x4c26('0x4d')]({'where':{'id':_0x195488[_0x4c26('0x4b')]['id']}})[_0x4c26('0x26')](handleEntityNotFound(_0x52f26b,null))[_0x4c26('0x26')](saveUpdates(_0x195488[_0x4c26('0x4f')],null))[_0x4c26('0x26')](respondWithResult(_0x52f26b,null))[_0x4c26('0x49')](handleError(_0x52f26b,null));};exports[_0x4c26('0x27')]=function(_0x40c609,_0xbd2eb0){return db[_0x4c26('0x46')]['find']({'where':{'id':_0x40c609[_0x4c26('0x4b')]['id']}})[_0x4c26('0x26')](handleEntityNotFound(_0xbd2eb0,null))[_0x4c26('0x26')](removeEntity(_0xbd2eb0,null))['catch'](handleError(_0xbd2eb0,null));};exports['getSessions']=function(_0x141872,_0x502ac8,_0x3e6f3b){var _0x8530bd={'raw':!![],'where':{}};var _0x1c24f3={};var _0x350789={'count':0x0,'rows':[]};return db[_0x4c26('0x46')][_0x4c26('0x5b')]({'where':{'id':_0x141872[_0x4c26('0x4b')]['id']}})[_0x4c26('0x26')](handleEntityNotFound(_0x502ac8,null))[_0x4c26('0x26')](function(_0x2011a5){if(_0x2011a5){_0x1c24f3[_0x4c26('0x34')]=_[_0x4c26('0x37')](db[_0x4c26('0x5c')]['rawAttributes']);_0x1c24f3[_0x4c26('0x36')]=_[_0x4c26('0x37')](_0x141872[_0x4c26('0x36')]);_0x1c24f3[_0x4c26('0x41')]=_[_0x4c26('0x38')](_0x1c24f3[_0x4c26('0x34')],_0x1c24f3[_0x4c26('0x36')]);_0x8530bd[_0x4c26('0x3a')]=_['intersection'](_0x1c24f3['model'],qs[_0x4c26('0x39')](_0x141872[_0x4c26('0x36')][_0x4c26('0x39')]));_0x8530bd[_0x4c26('0x3a')]=_0x8530bd[_0x4c26('0x3a')][_0x4c26('0x3b')]?_0x8530bd[_0x4c26('0x3a')]:_0x1c24f3[_0x4c26('0x34')];if(!_0x141872[_0x4c26('0x36')][_0x4c26('0x3c')]('nolimit')){_0x8530bd[_0x4c26('0x20')]=qs[_0x4c26('0x20')](_0x141872[_0x4c26('0x36')]['limit']);_0x8530bd[_0x4c26('0x1e')]=qs[_0x4c26('0x1e')](_0x141872[_0x4c26('0x36')]['offset']);}_0x8530bd[_0x4c26('0x3e')]=qs[_0x4c26('0x3f')](_0x141872[_0x4c26('0x36')][_0x4c26('0x3f')]);_0x8530bd['where']=qs['filters'](_[_0x4c26('0x42')](_0x141872[_0x4c26('0x36')],_0x1c24f3['filters']));_0x8530bd['where'][_0x4c26('0x5d')]=_0x2011a5['id'];if(_0x141872['query'][_0x4c26('0x43')]){_0x8530bd['where']=_['merge'](_0x8530bd[_0x4c26('0x40')],{'$or':_[_0x4c26('0x2f')](_0x8530bd['attributes'],function(_0x310116){var _0x263fb2={};_0x263fb2[_0x310116]={'$like':'%'+_0x141872[_0x4c26('0x36')][_0x4c26('0x43')]+'%'};return _0x263fb2;})});}_0x8530bd=_[_0x4c26('0x44')]({},_0x8530bd,_0x141872[_0x4c26('0x45')]);return db['JscriptySessionReport'][_0x4c26('0x21')]({'where':_0x8530bd[_0x4c26('0x40')]})[_0x4c26('0x26')](function(_0x11ce24){_0x350789[_0x4c26('0x21')]=_0x11ce24;if(_0x141872[_0x4c26('0x36')][_0x4c26('0x4c')]){_0x8530bd[_0x4c26('0x47')]=[{'all':!![]}];}return db[_0x4c26('0x5c')]['findAll'](_0x8530bd);})[_0x4c26('0x26')](function(_0x45b875){_0x350789['rows']=_0x45b875;return _0x350789;});}})[_0x4c26('0x26')](respondWithFilteredResult(_0x502ac8,_0x8530bd))[_0x4c26('0x49')](handleError(_0x502ac8,null));};exports[_0x4c26('0x5e')]=function(_0xf300d5,_0xce7a9f,_0x3b1d35){var _0x5a6302={'raw':!![],'where':{}};var _0x2d2d6d={};var _0x537df6={'count':0x0,'rows':[]};return db[_0x4c26('0x46')][_0x4c26('0x5b')]({'where':{'id':_0xf300d5[_0x4c26('0x4b')]['id']}})[_0x4c26('0x26')](handleEntityNotFound(_0xce7a9f,null))[_0x4c26('0x26')](function(_0x4080cb){if(_0x4080cb){_0x2d2d6d[_0x4c26('0x34')]=_[_0x4c26('0x37')](db[_0x4c26('0x5f')][_0x4c26('0x30')]);_0x2d2d6d['query']=_[_0x4c26('0x37')](_0xf300d5[_0x4c26('0x36')]);_0x2d2d6d['filters']=_[_0x4c26('0x38')](_0x2d2d6d[_0x4c26('0x34')],_0x2d2d6d[_0x4c26('0x36')]);_0x5a6302[_0x4c26('0x3a')]=_[_0x4c26('0x38')](_0x2d2d6d[_0x4c26('0x34')],qs[_0x4c26('0x39')](_0xf300d5[_0x4c26('0x36')][_0x4c26('0x39')]));_0x5a6302[_0x4c26('0x3a')]=_0x5a6302[_0x4c26('0x3a')]['length']?_0x5a6302[_0x4c26('0x3a')]:_0x2d2d6d[_0x4c26('0x34')];if(!_0xf300d5['query']['hasOwnProperty'](_0x4c26('0x3d'))){_0x5a6302[_0x4c26('0x20')]=qs['limit'](_0xf300d5['query'][_0x4c26('0x20')]);_0x5a6302[_0x4c26('0x1e')]=qs[_0x4c26('0x1e')](_0xf300d5[_0x4c26('0x36')][_0x4c26('0x1e')]);}_0x5a6302[_0x4c26('0x3e')]=qs[_0x4c26('0x3f')](_0xf300d5[_0x4c26('0x36')][_0x4c26('0x3f')]);_0x5a6302[_0x4c26('0x40')]=qs[_0x4c26('0x41')](_['pick'](_0xf300d5[_0x4c26('0x36')],_0x2d2d6d[_0x4c26('0x41')]));_0x5a6302[_0x4c26('0x40')]['ProjectId']=_0x4080cb['id'];if(_0xf300d5['query']['filter']){_0x5a6302['where']=_[_0x4c26('0x44')](_0x5a6302['where'],{'$or':_['map'](_0x5a6302[_0x4c26('0x3a')],function(_0x1d076f){var _0x4ab62a={};_0x4ab62a[_0x1d076f]={'$like':'%'+_0xf300d5[_0x4c26('0x36')][_0x4c26('0x43')]+'%'};return _0x4ab62a;})});}_0x5a6302=_[_0x4c26('0x44')]({},_0x5a6302,_0xf300d5[_0x4c26('0x45')]);return db[_0x4c26('0x5f')][_0x4c26('0x21')]({'where':_0x5a6302[_0x4c26('0x40')]})[_0x4c26('0x26')](function(_0x8c8333){_0x537df6[_0x4c26('0x21')]=_0x8c8333;if(_0xf300d5[_0x4c26('0x36')][_0x4c26('0x4c')]){_0x5a6302[_0x4c26('0x47')]=[{'all':!![]}];}return db[_0x4c26('0x5f')][_0x4c26('0x60')](_0x5a6302);})[_0x4c26('0x26')](function(_0x12290e){_0x537df6[_0x4c26('0x48')]=_0x12290e;return _0x537df6;});}})[_0x4c26('0x26')](respondWithFilteredResult(_0xce7a9f,_0x5a6302))[_0x4c26('0x49')](handleError(_0xce7a9f,null));};function char(_0x2c0d84){return'number'===typeof _0x2c0d84?String['fromCharCode'][_0x4c26('0x23')](null,arguments):_0x2c0d84;}function needsEncapsulation(_0x467344){return!!_0x467344&&(_0x467344[_0x4c26('0x61')]()[_0x4c26('0x62')](char(0xd))>=0x0||_0x467344[_0x4c26('0x61')]()[_0x4c26('0x62')](char(0xa))>=0x0||_0x467344['toString']()['indexOf'](char(0x2c))>=0x0||_0x467344['toString']()[_0x4c26('0x62')](char(0x22))>=0x0);}function encapsulate(_0x1528d8){var _0x50f4df=char(0x22),_0x829b25='\x5c'+char(0x22),_0xedad7=_0x1528d8[_0x4c26('0x61')]()['replace'](new RegExp(_0x50f4df,'g'),_0x829b25);return _0x50f4df+_0xedad7+_0x50f4df;}exports[_0x4c26('0x63')]=function(_0x1a8def,_0x3f72c5,_0x22f123){var _0x1205e6,_0x5a0d17;var _0x369ee4={'where':{'ProjectId':_0x1a8def[_0x4c26('0x4b')]['id']}};if(_0x1a8def[_0x4c26('0x36')][_0x4c26('0x64')]){_0x369ee4['where'][_0x4c26('0x65')]=JSON[_0x4c26('0x66')](_0x1a8def[_0x4c26('0x36')][_0x4c26('0x64')]);}return db[_0x4c26('0x5c')]['findAll'](_0x369ee4)[_0x4c26('0x26')](handleEntityNotFound(_0x3f72c5,null))['then'](function(_0x35a39c){if(_0x35a39c){_0x1205e6=_0x35a39c;return db[_0x4c26('0x67')]['findAll']({'where':{'SessionId':{'$in':_[_0x4c26('0x2f')](_0x1205e6,'id')},'ProjectId':_0x1a8def[_0x4c26('0x4b')]['id']},'order':'-createdAt'});}})[_0x4c26('0x26')](handleEntityNotFound(_0x3f72c5,null))[_0x4c26('0x26')](function(_0x36c346){if(_0x36c346){_0x5a0d17=_0x36c346;var _0x16a900={};for(var _0x1fd6ff=0x0,_0x3f0898=_0x5a0d17['length'];_0x1fd6ff<_0x3f0898;_0x1fd6ff++){if(!_0x16a900[_0x4c26('0x3c')](_0x5a0d17[_0x1fd6ff]['questionId'])){_0x16a900[_0x5a0d17[_0x1fd6ff][_0x4c26('0x68')]]=needsEncapsulation(_0x5a0d17[_0x1fd6ff][_0x4c26('0x69')])?encapsulate(_0x5a0d17[_0x1fd6ff][_0x4c26('0x69')]):_0x5a0d17[_0x1fd6ff][_0x4c26('0x69')];}}var _0x2b1d0d=[],_0x3eee6a={};for(var _0x31ea4d=0x0,_0x1ba6dd=_0x1205e6[_0x4c26('0x3b')];_0x31ea4d<_0x1ba6dd;_0x31ea4d++){_0x3eee6a={'ProjectId':_0x1a8def[_0x4c26('0x4b')]['id'],'SessionId':_0x1205e6[_0x31ea4d]['id'],'StartTime':moment(_0x1205e6[_0x31ea4d][_0x4c26('0x65')])[_0x4c26('0x6a')](_0x4c26('0x6b'))};for(var _0x621efd=0x0,_0xceef1f=_0x5a0d17[_0x4c26('0x3b')];_0x621efd<_0xceef1f;_0x621efd++){if(_0x5a0d17[_0x621efd][_0x4c26('0x6c')]==_0x1205e6[_0x31ea4d]['id']&&_0x16a900['hasOwnProperty'](_0x5a0d17[_0x621efd]['questionId'])){_0x3eee6a[_0x16a900[_0x5a0d17[_0x621efd][_0x4c26('0x68')]]]=_0x5a0d17[_0x621efd][_0x4c26('0x6d')];}}for(var _0x21ea70 in _0x16a900){if(!_0x3eee6a[_0x4c26('0x3c')](_0x16a900[_0x21ea70])){_0x3eee6a[_0x16a900[_0x21ea70]]=null;}}_0x2b1d0d['push'](_0x3eee6a);}return _0x2b1d0d;}})[_0x4c26('0x26')](function(_0x44dbb){if(!_[_0x4c26('0x6e')](_0x44dbb)){var _0x4b723d=toCsv(_0x44dbb);var _0x2161f0=Date[_0x4c26('0x6f')]();fs[_0x4c26('0x70')](util[_0x4c26('0x6a')](_0x4c26('0x71'),_0x1a8def[_0x4c26('0x4b')]['id'],_0x2161f0),_0x4b723d);_0x3f72c5[_0x4c26('0x72')]('Content-disposition',_0x4c26('0x73')+util['format'](_0x4c26('0x74'),_0x1a8def[_0x4c26('0x4b')]['id'],_0x2161f0));_0x3f72c5[_0x4c26('0x72')](_0x4c26('0x75'),_0x4c26('0x76'));return _0x3f72c5[_0x4c26('0x77')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1a8def[_0x4c26('0x4b')]['id'],_0x2161f0));}else{return _0x3f72c5[_0x4c26('0x1a')](0xcc);}})[_0x4c26('0x49')](handleError(_0x3f72c5,null));}; \ No newline at end of file +var _0x6f54=['set','Content-Range','apply','reject','save','update','then','Projects','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','number','toString','indexOf','replace','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','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','bluebird','mustache','util','sox','fs-extra','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x3d70a6,_0x2c5730){var _0x33fe0c=function(_0x1eda0e){while(--_0x1eda0e){_0x3d70a6['push'](_0x3d70a6['shift']());}};_0x33fe0c(++_0x2c5730);}(_0x6f54,0xcf));var _0x46f5=function(_0x48a902,_0x262345){_0x48a902=_0x48a902-0x0;var _0x29ab3b=_0x6f54[_0x48a902];return _0x29ab3b;};'use strict';var emlformat=require(_0x46f5('0x0'));var rimraf=require(_0x46f5('0x1'));var zipdir=require(_0x46f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x46f5('0x3'));var BPromise=require(_0x46f5('0x4'));var Mustache=require(_0x46f5('0x5'));var util=require(_0x46f5('0x6'));var path=require('path');var sox=require(_0x46f5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f5('0x8'));var _=require('lodash');var squel=require(_0x46f5('0x9'));var crypto=require(_0x46f5('0xa'));var jsforce=require(_0x46f5('0xb'));var deskjs=require(_0x46f5('0xc'));var toCsv=require(_0x46f5('0xd'));var querystring=require(_0x46f5('0xe'));var Papa=require(_0x46f5('0xf'));var Redis=require(_0x46f5('0x10'));var authService=require(_0x46f5('0x11'));var qs=require(_0x46f5('0x12'));var as=require(_0x46f5('0x13'));var hardwareService=require(_0x46f5('0x14'));var logger=require(_0x46f5('0x15'))(_0x46f5('0x16'));var utils=require('../../config/utils');var config=require(_0x46f5('0x17'));var licenseUtil=require(_0x46f5('0x18'));var db=require(_0x46f5('0x19'))['db'];function respondWithStatusCode(_0x5c6df5,_0x138e02){_0x138e02=_0x138e02||0xcc;return function(_0x9741d5){if(_0x9741d5){return _0x5c6df5['sendStatus'](_0x138e02);}return _0x5c6df5[_0x46f5('0x1a')](_0x138e02)[_0x46f5('0x1b')]();};}function respondWithResult(_0x1b1d34,_0x1190fc){_0x1190fc=_0x1190fc||0xc8;return function(_0x51a90a){if(_0x51a90a){return _0x1b1d34['status'](_0x1190fc)[_0x46f5('0x1c')](_0x51a90a);}};}function respondWithFilteredResult(_0x40a47e,_0x52674d){return function(_0xd57cc6){if(_0xd57cc6){var _0x3960e6=typeof _0x52674d[_0x46f5('0x1d')]===_0x46f5('0x1e')&&typeof _0x52674d[_0x46f5('0x1f')]===_0x46f5('0x1e');var _0x1adbb1=_0xd57cc6[_0x46f5('0x20')];var _0x551ee0=_0x3960e6?0x0:_0x52674d[_0x46f5('0x1d')];var _0x1b910b=_0x3960e6?_0xd57cc6[_0x46f5('0x20')]:_0x52674d[_0x46f5('0x1d')]+_0x52674d['limit'];var _0x389831;if(_0x1b910b>=_0x1adbb1){_0x1b910b=_0x1adbb1;_0x389831=0xc8;}else{_0x389831=0xce;}_0x40a47e[_0x46f5('0x1a')](_0x389831);return _0x40a47e[_0x46f5('0x21')](_0x46f5('0x22'),_0x551ee0+'-'+_0x1b910b+'/'+_0x1adbb1)[_0x46f5('0x1c')](_0xd57cc6);}return null;};}function patchUpdates(_0x425a2e){return function(_0x58195a){try{jsonpatch[_0x46f5('0x23')](_0x58195a,_0x425a2e,!![]);}catch(_0x3ed408){return BPromise[_0x46f5('0x24')](_0x3ed408);}return _0x58195a[_0x46f5('0x25')]();};}function saveUpdates(_0x49556c,_0x5d52bf){return function(_0x362033){if(_0x362033){return _0x362033[_0x46f5('0x26')](_0x49556c)[_0x46f5('0x27')](function(_0x2a004d){return _0x2a004d;});}return null;};}function removeEntity(_0x52e610,_0x4c6e30){return function(_0x2993f6){if(_0x2993f6){return _0x2993f6['destroy']()[_0x46f5('0x27')](function(){var _0xc096c6=_0x2993f6['get']({'plain':!![]});var _0x3aa949=_0x46f5('0x28');return db[_0x46f5('0x29')][_0x46f5('0x2a')]({'where':{'type':_0x3aa949,'resourceId':_0xc096c6['id']}})['then'](function(){return _0x2993f6;});})['then'](function(){_0x52e610[_0x46f5('0x1a')](0xcc)[_0x46f5('0x1b')]();});}};}function handleEntityNotFound(_0x4b2769,_0x4a2fe1){return function(_0x3156d5){if(!_0x3156d5){_0x4b2769[_0x46f5('0x2b')](0x194);}return _0x3156d5;};}function handleError(_0x6f3b1d,_0x548310){_0x548310=_0x548310||0x1f4;return function(_0x48b761){logger['error'](_0x48b761[_0x46f5('0x2c')]);if(_0x48b761[_0x46f5('0x2d')]){delete _0x48b761[_0x46f5('0x2d')];}_0x6f3b1d['status'](_0x548310)[_0x46f5('0x2e')](_0x48b761);};}exports[_0x46f5('0x2f')]=function(_0x47aab6,_0x48281a){var _0x36a4bb={},_0x456c02={},_0x1c8f58={'count':0x0,'rows':[]};var _0x317af7=_[_0x46f5('0x30')](db['JscriptyProject'][_0x46f5('0x31')],function(_0x413360){return{'name':_0x413360[_0x46f5('0x32')],'type':_0x413360['type']['key']};});_0x456c02['model']=_[_0x46f5('0x30')](_0x317af7,_0x46f5('0x2d'));_0x456c02[_0x46f5('0x33')]=_['keys'](_0x47aab6[_0x46f5('0x33')]);_0x456c02[_0x46f5('0x34')]=_['intersection'](_0x456c02[_0x46f5('0x35')],_0x456c02[_0x46f5('0x33')]);_0x36a4bb[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x456c02['model'],qs[_0x46f5('0x38')](_0x47aab6['query'][_0x46f5('0x38')]));_0x36a4bb['attributes']=_0x36a4bb[_0x46f5('0x36')][_0x46f5('0x39')]?_0x36a4bb[_0x46f5('0x36')]:_0x456c02['model'];if(!_0x47aab6[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x36a4bb[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x47aab6['query'][_0x46f5('0x1f')]);_0x36a4bb[_0x46f5('0x1d')]=qs[_0x46f5('0x1d')](_0x47aab6[_0x46f5('0x33')]['offset']);}_0x36a4bb[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x47aab6[_0x46f5('0x33')]['sort']);_0x36a4bb[_0x46f5('0x3e')]=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x47aab6[_0x46f5('0x33')],_0x456c02[_0x46f5('0x34')]),_0x317af7);if(_0x47aab6['query'][_0x46f5('0x40')]){_0x36a4bb[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x36a4bb[_0x46f5('0x3e')],{'$or':_[_0x46f5('0x30')](_0x317af7,function(_0x3a5980){if(_0x3a5980[_0x46f5('0x42')]!==_0x46f5('0x43')){var _0x4a31d0={};_0x4a31d0[_0x3a5980[_0x46f5('0x2d')]]={'$like':'%'+_0x47aab6[_0x46f5('0x33')]['filter']+'%'};return _0x4a31d0;}})});}_0x36a4bb=_[_0x46f5('0x41')]({},_0x36a4bb,_0x47aab6[_0x46f5('0x44')]);var _0xe79100={'where':_0x36a4bb[_0x46f5('0x3e')]};return db[_0x46f5('0x45')][_0x46f5('0x20')](_0xe79100)['then'](function(_0x29c47d){_0x1c8f58['count']=_0x29c47d;if(_0x47aab6[_0x46f5('0x33')]['includeAll']){_0x36a4bb[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x45')][_0x46f5('0x47')](_0x36a4bb);})[_0x46f5('0x27')](function(_0x53cb12){_0x1c8f58[_0x46f5('0x48')]=_0x53cb12;return _0x1c8f58;})[_0x46f5('0x27')](respondWithFilteredResult(_0x48281a,_0x36a4bb))[_0x46f5('0x49')](handleError(_0x48281a,null));};exports[_0x46f5('0x4a')]=function(_0x9f4676,_0x51c34e){var _0x20c69e={'raw':![],'where':{'id':_0x9f4676[_0x46f5('0x4b')]['id']}},_0x1a8f57={};_0x1a8f57['model']=_['keys'](db['JscriptyProject'][_0x46f5('0x31')]);_0x1a8f57[_0x46f5('0x33')]=_[_0x46f5('0x4c')](_0x9f4676[_0x46f5('0x33')]);_0x1a8f57[_0x46f5('0x34')]=_[_0x46f5('0x37')](_0x1a8f57[_0x46f5('0x35')],_0x1a8f57[_0x46f5('0x33')]);_0x20c69e[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x1a8f57['model'],qs[_0x46f5('0x38')](_0x9f4676['query'][_0x46f5('0x38')]));_0x20c69e['attributes']=_0x20c69e['attributes'][_0x46f5('0x39')]?_0x20c69e[_0x46f5('0x36')]:_0x1a8f57[_0x46f5('0x35')];if(_0x9f4676['query'][_0x46f5('0x4d')]){_0x20c69e[_0x46f5('0x46')]=[{'all':!![]}];}_0x20c69e=_[_0x46f5('0x41')]({},_0x20c69e,_0x9f4676[_0x46f5('0x44')]);return db['JscriptyProject'][_0x46f5('0x4e')](_0x20c69e)[_0x46f5('0x27')](handleEntityNotFound(_0x51c34e,null))[_0x46f5('0x27')](respondWithResult(_0x51c34e,null))['catch'](handleError(_0x51c34e,null));};exports[_0x46f5('0x4f')]=function(_0x236409,_0x276192){return db[_0x46f5('0x45')][_0x46f5('0x4f')](_0x236409[_0x46f5('0x50')],{})[_0x46f5('0x27')](function(_0x1216de){var _0x15594e=_0x236409[_0x46f5('0x51')]['get']({'plain':!![]});if(!_0x15594e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15594e[_0x46f5('0x52')]==='user'){var _0xbd2189=_0x1216de[_0x46f5('0x53')]({'plain':!![]});var _0x5305e9=_0x46f5('0x28');return db[_0x46f5('0x54')][_0x46f5('0x4e')]({'where':{'name':_0x5305e9,'userProfileId':_0x15594e[_0x46f5('0x55')]},'raw':!![]})[_0x46f5('0x27')](function(_0x302d29){if(_0x302d29&&_0x302d29['autoAssociation']===0x0){return db[_0x46f5('0x29')][_0x46f5('0x4f')]({'name':_0xbd2189[_0x46f5('0x2d')],'resourceId':_0xbd2189['id'],'type':_0x302d29[_0x46f5('0x2d')],'sectionId':_0x302d29['id']},{})[_0x46f5('0x27')](function(){return _0x1216de;});}else{return _0x1216de;}})[_0x46f5('0x49')](function(_0x5e26c6){logger['error'](_0x46f5('0x56'),_0x5e26c6);throw _0x5e26c6;});}return _0x1216de;})[_0x46f5('0x27')](respondWithResult(_0x276192,0xc9))[_0x46f5('0x49')](handleError(_0x276192,null));};exports['clone']=function(_0x4e3932,_0xf21b38){var _0x518a81={'where':{'id':_0x4e3932[_0x46f5('0x4b')]['id']}},_0x376006={};_0x376006[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db[_0x46f5('0x45')]['rawAttributes']);_0x518a81[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x376006['model'],qs[_0x46f5('0x38')](_0x4e3932[_0x46f5('0x33')][_0x46f5('0x38')]));_0x518a81[_0x46f5('0x36')]=_0x518a81['attributes'][_0x46f5('0x39')]?_0x518a81[_0x46f5('0x36')]:_0x376006[_0x46f5('0x35')];if(_0x4e3932[_0x46f5('0x33')][_0x46f5('0x4d')]){_0x518a81[_0x46f5('0x46')]=[{'all':!![]}];}_0x518a81=_[_0x46f5('0x41')]({},_0x518a81,_0x4e3932['options']);return db[_0x46f5('0x45')]['find'](_0x518a81)['then'](handleEntityNotFound(_0xf21b38,null))['then'](function(_0x3c1c1a){if(_0x3c1c1a){var _0xcbe605=_0x3c1c1a['get']({'plain':!![]});_0xcbe605=qs[_0x46f5('0x57')](_0xcbe605,['id','createdAt',_0x46f5('0x58')]);_0x4e3932['body']=_[_0x46f5('0x57')](_0x4e3932[_0x46f5('0x50')],['id',_0x46f5('0x59'),_0x46f5('0x58')]);return db[_0x46f5('0x45')]['create'](_[_0x46f5('0x41')](_0xcbe605,_0x4e3932['body']),{'include':_0x4e3932[_0x46f5('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1ea05e){var _0x513ee2=_0x4e3932['user'][_0x46f5('0x53')]({'plain':!![]});if(!_0x513ee2)throw new Error(_0x46f5('0x5a'));if(_0x513ee2['role']==='user'){var _0x59b3bc=_0x1ea05e[_0x46f5('0x53')]({'plain':!![]});var _0x1487dd=_0x46f5('0x28');return db[_0x46f5('0x54')][_0x46f5('0x4e')]({'where':{'name':_0x1487dd,'userProfileId':_0x513ee2[_0x46f5('0x55')]},'raw':!![]})['then'](function(_0x12964b){if(_0x12964b&&_0x12964b[_0x46f5('0x5b')]===0x0){return db[_0x46f5('0x29')][_0x46f5('0x4f')]({'name':_0x59b3bc['name'],'resourceId':_0x59b3bc['id'],'type':_0x12964b[_0x46f5('0x2d')],'sectionId':_0x12964b['id']},{})['then'](function(){return _0x1ea05e;});}else{return _0x1ea05e;}})[_0x46f5('0x49')](function(_0x2054e1){logger[_0x46f5('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2054e1);throw _0x2054e1;});}return _0x1ea05e;});}})[_0x46f5('0x27')](respondWithResult(_0xf21b38,0xc9))['catch'](handleError(_0xf21b38,null));};exports['update']=function(_0x1e0bbb,_0x54e179){if(_0x1e0bbb[_0x46f5('0x50')]['id']){delete _0x1e0bbb[_0x46f5('0x50')]['id'];}return db['JscriptyProject'][_0x46f5('0x4e')]({'where':{'id':_0x1e0bbb[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x54e179,null))[_0x46f5('0x27')](saveUpdates(_0x1e0bbb[_0x46f5('0x50')],null))[_0x46f5('0x27')](respondWithResult(_0x54e179,null))[_0x46f5('0x49')](handleError(_0x54e179,null));};exports[_0x46f5('0x2a')]=function(_0x46acb3,_0xbe7698){return db[_0x46f5('0x45')][_0x46f5('0x4e')]({'where':{'id':_0x46acb3['params']['id']}})['then'](handleEntityNotFound(_0xbe7698,null))[_0x46f5('0x27')](removeEntity(_0xbe7698,null))['catch'](handleError(_0xbe7698,null));};exports[_0x46f5('0x5d')]=function(_0x24108a,_0x3bb638,_0xf370f8){var _0x58ef6d={'raw':!![],'where':{}};var _0x5286ff={};var _0x3629f7={'count':0x0,'rows':[]};return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x24108a[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x3bb638,null))['then'](function(_0x490b25){if(_0x490b25){_0x5286ff['model']=_[_0x46f5('0x4c')](db[_0x46f5('0x5f')][_0x46f5('0x31')]);_0x5286ff[_0x46f5('0x33')]=_[_0x46f5('0x4c')](_0x24108a[_0x46f5('0x33')]);_0x5286ff['filters']=_['intersection'](_0x5286ff['model'],_0x5286ff[_0x46f5('0x33')]);_0x58ef6d[_0x46f5('0x36')]=_['intersection'](_0x5286ff['model'],qs['fields'](_0x24108a['query'][_0x46f5('0x38')]));_0x58ef6d[_0x46f5('0x36')]=_0x58ef6d[_0x46f5('0x36')][_0x46f5('0x39')]?_0x58ef6d[_0x46f5('0x36')]:_0x5286ff[_0x46f5('0x35')];if(!_0x24108a[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x58ef6d[_0x46f5('0x1f')]=qs['limit'](_0x24108a[_0x46f5('0x33')]['limit']);_0x58ef6d[_0x46f5('0x1d')]=qs[_0x46f5('0x1d')](_0x24108a[_0x46f5('0x33')]['offset']);}_0x58ef6d['order']=qs[_0x46f5('0x3d')](_0x24108a[_0x46f5('0x33')]['sort']);_0x58ef6d['where']=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x24108a[_0x46f5('0x33')],_0x5286ff[_0x46f5('0x34')]));_0x58ef6d['where'][_0x46f5('0x60')]=_0x490b25['id'];if(_0x24108a[_0x46f5('0x33')][_0x46f5('0x40')]){_0x58ef6d[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x58ef6d[_0x46f5('0x3e')],{'$or':_[_0x46f5('0x30')](_0x58ef6d[_0x46f5('0x36')],function(_0x13853f){var _0x3d888c={};_0x3d888c[_0x13853f]={'$like':'%'+_0x24108a[_0x46f5('0x33')][_0x46f5('0x40')]+'%'};return _0x3d888c;})});}_0x58ef6d=_[_0x46f5('0x41')]({},_0x58ef6d,_0x24108a[_0x46f5('0x44')]);return db[_0x46f5('0x5f')][_0x46f5('0x20')]({'where':_0x58ef6d[_0x46f5('0x3e')]})[_0x46f5('0x27')](function(_0x159faa){_0x3629f7[_0x46f5('0x20')]=_0x159faa;if(_0x24108a[_0x46f5('0x33')][_0x46f5('0x4d')]){_0x58ef6d[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x5f')][_0x46f5('0x47')](_0x58ef6d);})[_0x46f5('0x27')](function(_0x5c3eef){_0x3629f7[_0x46f5('0x48')]=_0x5c3eef;return _0x3629f7;});}})[_0x46f5('0x27')](respondWithFilteredResult(_0x3bb638,_0x58ef6d))[_0x46f5('0x49')](handleError(_0x3bb638,null));};exports['getAnswers']=function(_0x2b4f7f,_0x4068df,_0x3fac1e){var _0x1a83ea={'raw':!![],'where':{}};var _0x27389d={};var _0x3c4467={'count':0x0,'rows':[]};return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x2b4f7f[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x4068df,null))['then'](function(_0x371ed2){if(_0x371ed2){_0x27389d['model']=_['keys'](db[_0x46f5('0x61')][_0x46f5('0x31')]);_0x27389d[_0x46f5('0x33')]=_['keys'](_0x2b4f7f[_0x46f5('0x33')]);_0x27389d['filters']=_[_0x46f5('0x37')](_0x27389d[_0x46f5('0x35')],_0x27389d[_0x46f5('0x33')]);_0x1a83ea[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x27389d['model'],qs[_0x46f5('0x38')](_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x38')]));_0x1a83ea[_0x46f5('0x36')]=_0x1a83ea[_0x46f5('0x36')][_0x46f5('0x39')]?_0x1a83ea['attributes']:_0x27389d[_0x46f5('0x35')];if(!_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x1a83ea[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x2b4f7f['query'][_0x46f5('0x1f')]);_0x1a83ea['offset']=qs[_0x46f5('0x1d')](_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x1d')]);}_0x1a83ea[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x2b4f7f['query'][_0x46f5('0x3d')]);_0x1a83ea['where']=qs['filters'](_[_0x46f5('0x3f')](_0x2b4f7f['query'],_0x27389d['filters']));_0x1a83ea[_0x46f5('0x3e')][_0x46f5('0x60')]=_0x371ed2['id'];if(_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x40')]){_0x1a83ea[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x1a83ea[_0x46f5('0x3e')],{'$or':_['map'](_0x1a83ea[_0x46f5('0x36')],function(_0x188fa5){var _0x14dc1e={};_0x14dc1e[_0x188fa5]={'$like':'%'+_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x40')]+'%'};return _0x14dc1e;})});}_0x1a83ea=_['merge']({},_0x1a83ea,_0x2b4f7f['options']);return db['JscriptyAnswerReport'][_0x46f5('0x20')]({'where':_0x1a83ea[_0x46f5('0x3e')]})['then'](function(_0xabacc8){_0x3c4467['count']=_0xabacc8;if(_0x2b4f7f['query'][_0x46f5('0x4d')]){_0x1a83ea['include']=[{'all':!![]}];}return db[_0x46f5('0x61')]['findAll'](_0x1a83ea);})['then'](function(_0x23f81e){_0x3c4467[_0x46f5('0x48')]=_0x23f81e;return _0x3c4467;});}})[_0x46f5('0x27')](respondWithFilteredResult(_0x4068df,_0x1a83ea))['catch'](handleError(_0x4068df,null));};function char(_0xb55b31){return _0x46f5('0x62')===typeof _0xb55b31?String['fromCharCode']['apply'](null,arguments):_0xb55b31;}function needsEncapsulation(_0x447e09){return!!_0x447e09&&(_0x447e09['toString']()['indexOf'](char(0xd))>=0x0||_0x447e09[_0x46f5('0x63')]()[_0x46f5('0x64')](char(0xa))>=0x0||_0x447e09[_0x46f5('0x63')]()[_0x46f5('0x64')](char(0x2c))>=0x0||_0x447e09[_0x46f5('0x63')]()[_0x46f5('0x64')](char(0x22))>=0x0);}function encapsulate(_0x2aa4e3){var _0x128e44=char(0x22),_0x435403='\x5c'+char(0x22),_0x541f63=_0x2aa4e3[_0x46f5('0x63')]()[_0x46f5('0x65')](new RegExp(_0x128e44,'g'),_0x435403);return _0x128e44+_0x541f63+_0x128e44;}exports['getSummary']=function(_0x2fe69b,_0x5e30d2,_0x3bd6f9){var _0x56143d,_0x1af1d2;var _0x7c0307={'where':{'ProjectId':_0x2fe69b[_0x46f5('0x4b')]['id']}};if(_0x2fe69b[_0x46f5('0x33')]['startTime']){_0x7c0307['where'][_0x46f5('0x66')]=JSON[_0x46f5('0x67')](_0x2fe69b[_0x46f5('0x33')]['startTime']);}return db[_0x46f5('0x5f')]['findAll'](_0x7c0307)[_0x46f5('0x27')](handleEntityNotFound(_0x5e30d2,null))['then'](function(_0x4faaa0){if(_0x4faaa0){_0x56143d=_0x4faaa0;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x46f5('0x30')](_0x56143d,'id')},'ProjectId':_0x2fe69b[_0x46f5('0x4b')]['id']},'order':_0x46f5('0x68')});}})['then'](handleEntityNotFound(_0x5e30d2,null))['then'](function(_0x34f832){if(_0x34f832){_0x1af1d2=_0x34f832;var _0x308b95={};for(var _0x3c821f=0x0,_0x28710f=_0x1af1d2[_0x46f5('0x39')];_0x3c821f<_0x28710f;_0x3c821f++){if(!_0x308b95[_0x46f5('0x3a')](_0x1af1d2[_0x3c821f][_0x46f5('0x69')])){_0x308b95[_0x1af1d2[_0x3c821f][_0x46f5('0x69')]]=needsEncapsulation(_0x1af1d2[_0x3c821f][_0x46f5('0x6a')])?encapsulate(_0x1af1d2[_0x3c821f]['question']):_0x1af1d2[_0x3c821f]['question'];}}var _0x3c85c2=[],_0x23d53e={};for(var _0x13ec0b=0x0,_0x41c4f2=_0x56143d[_0x46f5('0x39')];_0x13ec0b<_0x41c4f2;_0x13ec0b++){_0x23d53e={'ProjectId':_0x2fe69b[_0x46f5('0x4b')]['id'],'SessionId':_0x56143d[_0x13ec0b]['id'],'StartTime':moment(_0x56143d[_0x13ec0b][_0x46f5('0x66')])[_0x46f5('0x6b')](_0x46f5('0x6c'))};for(var _0x481e5b=0x0,_0x45d617=_0x1af1d2[_0x46f5('0x39')];_0x481e5b<_0x45d617;_0x481e5b++){if(_0x1af1d2[_0x481e5b][_0x46f5('0x6d')]==_0x56143d[_0x13ec0b]['id']&&_0x308b95[_0x46f5('0x3a')](_0x1af1d2[_0x481e5b][_0x46f5('0x69')])){_0x23d53e[_0x308b95[_0x1af1d2[_0x481e5b][_0x46f5('0x69')]]]=_0x1af1d2[_0x481e5b][_0x46f5('0x6e')];}}for(var _0x3f48f0 in _0x308b95){if(!_0x23d53e['hasOwnProperty'](_0x308b95[_0x3f48f0])){_0x23d53e[_0x308b95[_0x3f48f0]]=null;}}_0x3c85c2[_0x46f5('0x6f')](_0x23d53e);}return _0x3c85c2;}})[_0x46f5('0x27')](function(_0x4f7e0){if(!_[_0x46f5('0x70')](_0x4f7e0)){var _0x1500cf=toCsv(_0x4f7e0);var _0x3109e2=Date['now']();fs[_0x46f5('0x71')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2fe69b[_0x46f5('0x4b')]['id'],_0x3109e2),_0x1500cf);_0x5e30d2[_0x46f5('0x72')]('Content-disposition',_0x46f5('0x73')+util[_0x46f5('0x6b')](_0x46f5('0x74'),_0x2fe69b[_0x46f5('0x4b')]['id'],_0x3109e2));_0x5e30d2[_0x46f5('0x72')]('Content-type',_0x46f5('0x75'));return _0x5e30d2[_0x46f5('0x76')](util[_0x46f5('0x6b')](_0x46f5('0x77'),_0x2fe69b[_0x46f5('0x4b')]['id'],_0x3109e2));}else{return _0x5e30d2[_0x46f5('0x2b')](0xcc);}})[_0x46f5('0x49')](handleError(_0x5e30d2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 05bbc96..402846b 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 _0xdcf6=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','util','../../config/logger','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x565de9,_0x114287){_0x565de9=_0x565de9-0x0;var _0x5f5dab=_0xdcf6[_0x565de9];return _0x5f5dab;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var logger=require(_0x6dcf('0x1'))(_0x6dcf('0x2'));var moment=require(_0x6dcf('0x3'));var BPromise=require(_0x6dcf('0x4'));var rp=require(_0x6dcf('0x5'));var fs=require('fs');var path=require(_0x6dcf('0x6'));var rimraf=require('rimraf');var config=require(_0x6dcf('0x7'));var attributes=require(_0x6dcf('0x8'));module['exports']=function(_0x1ff8b6,_0x3364bd){return _0x1ff8b6['define']('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f75=['path','rimraf','../../config/environment','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','request-promise'];(function(_0x158e4b,_0x3071bb){var _0x3c3469=function(_0x54b238){while(--_0x54b238){_0x158e4b['push'](_0x158e4b['shift']());}};_0x3c3469(++_0x3071bb);}(_0x9f75,0x15a));var _0x59f7=function(_0x21c952,_0x709758){_0x21c952=_0x21c952-0x0;var _0x554104=_0x9f75[_0x21c952];return _0x554104;};'use strict';var _=require(_0x59f7('0x0'));var util=require('util');var logger=require(_0x59f7('0x1'))(_0x59f7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x59f7('0x3'));var fs=require('fs');var path=require(_0x59f7('0x4'));var rimraf=require(_0x59f7('0x5'));var config=require(_0x59f7('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x59f7('0x7')]=function(_0x278f11,_0x5485fa){return _0x278f11['define'](_0x59f7('0x8'),attributes,{'tableName':_0x59f7('0x9'),'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 a18d74e..4ab5621 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0xaac246,_0x42ec51){var _0x6c8a75=function(_0x16a04e){while(--_0x16a04e){_0xaac246['push'](_0xaac246['shift']());}};_0x6c8a75(++_0x42ec51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x250f9c,_0x247ebe){var _0x55066b=function(_0x3649e6){while(--_0x3649e6){_0x250f9c['push'](_0x250f9c['shift']());}};_0x55066b(++_0x247ebe);}(_0xe706,0xa3));var _0x6e70=function(_0x59db34,_0x593726){_0x59db34=_0x59db34-0x0;var _0x568a53=_0xe706[_0x59db34];return _0x568a53;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index eefe7e1..5703f6b 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 _0x38db=['create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show'];(function(_0x4d29b7,_0x5bdd4f){var _0x4b38cc=function(_0x4835bb){while(--_0x4835bb){_0x4d29b7['push'](_0x4d29b7['shift']());}};_0x4b38cc(++_0x5bdd4f);}(_0x38db,0x9c));var _0xb38d=function(_0x1dae7d,_0x263cbd){_0x1dae7d=_0x1dae7d-0x0;var _0x164045=_0x38db[_0x1dae7d];return _0x164045;};'use strict';var multer=require(_0xb38d('0x0'));var util=require(_0xb38d('0x1'));var path=require('path');var timeout=require(_0xb38d('0x2'));var express=require(_0xb38d('0x3'));var router=express[_0xb38d('0x4')]();var fs_extra=require(_0xb38d('0x5'));var auth=require(_0xb38d('0x6'));var interaction=require(_0xb38d('0x7'));var config=require(_0xb38d('0x8'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0xb38d('0x9')](),controller[_0xb38d('0xa')]);router[_0xb38d('0xb')]('/describe',auth[_0xb38d('0x9')](),controller[_0xb38d('0xc')]);router['get'](_0xb38d('0xd'),auth['isAuthenticated'](),controller[_0xb38d('0xe')]);router['post']('/',auth[_0xb38d('0x9')](),controller[_0xb38d('0xf')]);router['put'](_0xb38d('0xd'),auth[_0xb38d('0x9')](),controller[_0xb38d('0x10')]);router[_0xb38d('0x11')](_0xb38d('0xd'),auth[_0xb38d('0x9')](),controller[_0xb38d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe0a8=['describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x582965,_0x58da5a){var _0x361185=function(_0x416939){while(--_0x416939){_0x582965['push'](_0x582965['shift']());}};_0x361185(++_0x58da5a);}(_0xe0a8,0x14d));var _0x8e0a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe0a8[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x8e0a('0x0'));var path=require('path');var timeout=require(_0x8e0a('0x1'));var express=require('express');var router=express[_0x8e0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8e0a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8e0a('0x4'));var controller=require('./jscriptyQuestionReport.controller');router[_0x8e0a('0x5')]('/',auth[_0x8e0a('0x6')](),controller[_0x8e0a('0x7')]);router['get'](_0x8e0a('0x8'),auth[_0x8e0a('0x6')](),controller[_0x8e0a('0x9')]);router[_0x8e0a('0x5')](_0x8e0a('0xa'),auth[_0x8e0a('0x6')](),controller[_0x8e0a('0xb')]);router[_0x8e0a('0xc')]('/',auth[_0x8e0a('0x6')](),controller[_0x8e0a('0xd')]);router[_0x8e0a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8e0a('0xf')]);router['delete']('/:id',auth[_0x8e0a('0x6')](),controller[_0x8e0a('0x10')]);module[_0x8e0a('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 0add3f2..3cc0f74 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x31aadc,_0x240efc){_0x31aadc=_0x31aadc-0x0;var _0x3505d4=_0x7a54[_0x31aadc];return _0x3505d4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x46544d,_0x28dbfc){_0x46544d=_0x46544d-0x0;var _0x2d8f55=_0x7a54[_0x46544d];return _0x2d8f55;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 53b4094..b730c10 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 _0x0578=['options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','keys'];(function(_0x128ebe,_0x1dc0f9){var _0x31eed4=function(_0x53673b){while(--_0x53673b){_0x128ebe['push'](_0x128ebe['shift']());}};_0x31eed4(++_0x1dc0f9);}(_0x0578,0xe7));var _0x8057=function(_0x163bd1,_0x5bc9fe){_0x163bd1=_0x163bd1-0x0;var _0x352227=_0x0578[_0x163bd1];return _0x352227;};'use strict';var emlformat=require(_0x8057('0x0'));var rimraf=require(_0x8057('0x1'));var zipdir=require(_0x8057('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8057('0x3'));var moment=require(_0x8057('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8057('0x5'));var util=require(_0x8057('0x6'));var path=require('path');var sox=require(_0x8057('0x7'));var csv=require(_0x8057('0x8'));var ejs=require(_0x8057('0x9'));var fs=require('fs');var fs_extra=require(_0x8057('0xa'));var _=require(_0x8057('0xb'));var squel=require(_0x8057('0xc'));var crypto=require('crypto');var jsforce=require(_0x8057('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8057('0x8'));var querystring=require(_0x8057('0xe'));var Papa=require(_0x8057('0xf'));var Redis=require(_0x8057('0x10'));var authService=require(_0x8057('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8057('0x12'));var hardwareService=require(_0x8057('0x13'));var logger=require(_0x8057('0x14'))(_0x8057('0x15'));var utils=require(_0x8057('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8057('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf422ec,_0x55fc3f){_0x55fc3f=_0x55fc3f||0xcc;return function(_0x4a1b59){if(_0x4a1b59){return _0xf422ec[_0x8057('0x18')](_0x55fc3f);}return _0xf422ec[_0x8057('0x19')](_0x55fc3f)[_0x8057('0x1a')]();};}function respondWithResult(_0x22e1b3,_0x527c95){_0x527c95=_0x527c95||0xc8;return function(_0x368ae9){if(_0x368ae9){return _0x22e1b3[_0x8057('0x19')](_0x527c95)[_0x8057('0x1b')](_0x368ae9);}};}function respondWithFilteredResult(_0x2dd4db,_0x4642b1){return function(_0x336b8e){if(_0x336b8e){var _0x349b73=typeof _0x4642b1[_0x8057('0x1c')]===_0x8057('0x1d')&&typeof _0x4642b1[_0x8057('0x1e')]===_0x8057('0x1d');var _0x5e4977=_0x336b8e[_0x8057('0x1f')];var _0x5e10f9=_0x349b73?0x0:_0x4642b1[_0x8057('0x1c')];var _0x47bb87=_0x349b73?_0x336b8e[_0x8057('0x1f')]:_0x4642b1[_0x8057('0x1c')]+_0x4642b1['limit'];var _0x3a7406;if(_0x47bb87>=_0x5e4977){_0x47bb87=_0x5e4977;_0x3a7406=0xc8;}else{_0x3a7406=0xce;}_0x2dd4db['status'](_0x3a7406);return _0x2dd4db['set'](_0x8057('0x20'),_0x5e10f9+'-'+_0x47bb87+'/'+_0x5e4977)[_0x8057('0x1b')](_0x336b8e);}return null;};}function patchUpdates(_0x5e2dcc){return function(_0x2ce77b){try{jsonpatch[_0x8057('0x21')](_0x2ce77b,_0x5e2dcc,!![]);}catch(_0x26567f){return BPromise[_0x8057('0x22')](_0x26567f);}return _0x2ce77b[_0x8057('0x23')]();};}function saveUpdates(_0x103e4a,_0x48b270){return function(_0x413cc1){if(_0x413cc1){return _0x413cc1['update'](_0x103e4a)['then'](function(_0x164945){return _0x164945;});}return null;};}function removeEntity(_0xe0a058,_0x231611){return function(_0x9ff997){if(_0x9ff997){return _0x9ff997[_0x8057('0x24')]()[_0x8057('0x25')](function(){_0xe0a058[_0x8057('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5542,_0x1b23ec){return function(_0x508ddb){if(!_0x508ddb){_0x5e5542['sendStatus'](0x194);}return _0x508ddb;};}function handleError(_0x49e87c,_0x5608f1){_0x5608f1=_0x5608f1||0x1f4;return function(_0xc59d8b){logger[_0x8057('0x26')](_0xc59d8b[_0x8057('0x27')]);if(_0xc59d8b[_0x8057('0x28')]){delete _0xc59d8b[_0x8057('0x28')];}_0x49e87c[_0x8057('0x19')](_0x5608f1)[_0x8057('0x29')](_0xc59d8b);};}exports['index']=function(_0x4aaa75,_0x559ac5){var _0x4dc173={},_0x48ad76={},_0x2e7b46={'count':0x0,'rows':[]};var _0x2b780e=_[_0x8057('0x2a')](db[_0x8057('0x2b')][_0x8057('0x2c')],function(_0x5b9000){return{'name':_0x5b9000['fieldName'],'type':_0x5b9000[_0x8057('0x2d')][_0x8057('0x2e')]};});_0x48ad76['model']=_[_0x8057('0x2a')](_0x2b780e,_0x8057('0x28'));_0x48ad76[_0x8057('0x2f')]=_['keys'](_0x4aaa75[_0x8057('0x2f')]);_0x48ad76[_0x8057('0x30')]=_['intersection'](_0x48ad76[_0x8057('0x31')],_0x48ad76[_0x8057('0x2f')]);_0x4dc173[_0x8057('0x32')]=_[_0x8057('0x33')](_0x48ad76[_0x8057('0x31')],qs[_0x8057('0x34')](_0x4aaa75[_0x8057('0x2f')][_0x8057('0x34')]));_0x4dc173[_0x8057('0x32')]=_0x4dc173[_0x8057('0x32')][_0x8057('0x35')]?_0x4dc173[_0x8057('0x32')]:_0x48ad76[_0x8057('0x31')];if(!_0x4aaa75['query'][_0x8057('0x36')](_0x8057('0x37'))){_0x4dc173[_0x8057('0x1e')]=qs[_0x8057('0x1e')](_0x4aaa75[_0x8057('0x2f')][_0x8057('0x1e')]);_0x4dc173['offset']=qs['offset'](_0x4aaa75[_0x8057('0x2f')]['offset']);}_0x4dc173[_0x8057('0x38')]=qs[_0x8057('0x39')](_0x4aaa75[_0x8057('0x2f')][_0x8057('0x39')]);_0x4dc173[_0x8057('0x3a')]=qs[_0x8057('0x30')](_[_0x8057('0x3b')](_0x4aaa75[_0x8057('0x2f')],_0x48ad76['filters']),_0x2b780e);if(_0x4aaa75['query']['filter']){_0x4dc173['where']=_[_0x8057('0x3c')](_0x4dc173['where'],{'$or':_[_0x8057('0x2a')](_0x2b780e,function(_0x30f505){if(_0x30f505[_0x8057('0x2d')]!==_0x8057('0x3d')){var _0xd9aa2={};_0xd9aa2[_0x30f505[_0x8057('0x28')]]={'$like':'%'+_0x4aaa75[_0x8057('0x2f')][_0x8057('0x3e')]+'%'};return _0xd9aa2;}})});}_0x4dc173=_[_0x8057('0x3c')]({},_0x4dc173,_0x4aaa75['options']);var _0x12608c={'where':_0x4dc173[_0x8057('0x3a')]};return db[_0x8057('0x2b')][_0x8057('0x1f')](_0x12608c)['then'](function(_0x2b7277){_0x2e7b46[_0x8057('0x1f')]=_0x2b7277;if(_0x4aaa75[_0x8057('0x2f')][_0x8057('0x3f')]){_0x4dc173[_0x8057('0x40')]=[{'all':!![]}];}return db[_0x8057('0x2b')]['findAll'](_0x4dc173);})[_0x8057('0x25')](function(_0x48bdb8){_0x2e7b46['rows']=_0x48bdb8;return _0x2e7b46;})['then'](respondWithFilteredResult(_0x559ac5,_0x4dc173))[_0x8057('0x41')](handleError(_0x559ac5,null));};exports[_0x8057('0x42')]=function(_0x4aa257,_0xa5d560){var _0xdc4c38={'raw':!![],'where':{'id':_0x4aa257[_0x8057('0x43')]['id']}},_0x47e91f={};_0x47e91f[_0x8057('0x31')]=_[_0x8057('0x44')](db['JscriptyQuestionReport'][_0x8057('0x2c')]);_0x47e91f[_0x8057('0x2f')]=_[_0x8057('0x44')](_0x4aa257['query']);_0x47e91f[_0x8057('0x30')]=_[_0x8057('0x33')](_0x47e91f['model'],_0x47e91f['query']);_0xdc4c38[_0x8057('0x32')]=_[_0x8057('0x33')](_0x47e91f[_0x8057('0x31')],qs['fields'](_0x4aa257[_0x8057('0x2f')][_0x8057('0x34')]));_0xdc4c38[_0x8057('0x32')]=_0xdc4c38['attributes']['length']?_0xdc4c38[_0x8057('0x32')]:_0x47e91f[_0x8057('0x31')];if(_0x4aa257[_0x8057('0x2f')]['includeAll']){_0xdc4c38[_0x8057('0x40')]=[{'all':!![]}];}_0xdc4c38=_[_0x8057('0x3c')]({},_0xdc4c38,_0x4aa257[_0x8057('0x45')]);return db[_0x8057('0x2b')][_0x8057('0x46')](_0xdc4c38)[_0x8057('0x25')](handleEntityNotFound(_0xa5d560,null))[_0x8057('0x25')](respondWithResult(_0xa5d560,null))[_0x8057('0x41')](handleError(_0xa5d560,null));};exports[_0x8057('0x47')]=function(_0x2b9d57,_0x15058e){return db[_0x8057('0x2b')][_0x8057('0x47')](_0x2b9d57[_0x8057('0x48')],{})['then'](respondWithResult(_0x15058e,0xc9))['catch'](handleError(_0x15058e,null));};exports[_0x8057('0x49')]=function(_0x159d7c,_0x5bd7d9){if(_0x159d7c['body']['id']){delete _0x159d7c[_0x8057('0x48')]['id'];}return db[_0x8057('0x2b')]['find']({'where':{'id':_0x159d7c[_0x8057('0x43')]['id']}})[_0x8057('0x25')](handleEntityNotFound(_0x5bd7d9,null))['then'](saveUpdates(_0x159d7c[_0x8057('0x48')],null))['then'](respondWithResult(_0x5bd7d9,null))['catch'](handleError(_0x5bd7d9,null));};exports[_0x8057('0x24')]=function(_0x548c81,_0x19732e){return db[_0x8057('0x2b')]['find']({'where':{'id':_0x548c81[_0x8057('0x43')]['id']}})[_0x8057('0x25')](handleEntityNotFound(_0x19732e,null))[_0x8057('0x25')](removeEntity(_0x19732e,null))[_0x8057('0x41')](handleError(_0x19732e,null));};exports['describe']=function(_0x18eb6f,_0x26cc97){return db['JscriptyQuestionReport'][_0x8057('0x4a')]()[_0x8057('0x25')](respondWithResult(_0x26cc97,null))[_0x8057('0x41')](handleError(_0x26cc97,null));}; \ No newline at end of file +var _0x3a1b=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','update','destroy','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','then','include','findAll','catch','show','params','length','includeAll','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x11a90,_0x5c53ce){var _0x1ce044=function(_0x51115f){while(--_0x51115f){_0x11a90['push'](_0x11a90['shift']());}};_0x1ce044(++_0x5c53ce);}(_0x3a1b,0x8b));var _0xb3a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a1b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb3a1('0x0'));var rimraf=require(_0xb3a1('0x1'));var zipdir=require(_0xb3a1('0x2'));var jsonpatch=require(_0xb3a1('0x3'));var rp=require(_0xb3a1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb3a1('0x5'));var util=require(_0xb3a1('0x6'));var path=require('path');var sox=require(_0xb3a1('0x7'));var csv=require(_0xb3a1('0x8'));var ejs=require(_0xb3a1('0x9'));var fs=require('fs');var fs_extra=require(_0xb3a1('0xa'));var _=require(_0xb3a1('0xb'));var squel=require(_0xb3a1('0xc'));var crypto=require('crypto');var jsforce=require(_0xb3a1('0xd'));var deskjs=require(_0xb3a1('0xe'));var toCsv=require(_0xb3a1('0x8'));var querystring=require(_0xb3a1('0xf'));var Papa=require(_0xb3a1('0x10'));var Redis=require(_0xb3a1('0x11'));var authService=require(_0xb3a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb3a1('0x13'));var hardwareService=require(_0xb3a1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb3a1('0x15'));var config=require(_0xb3a1('0x16'));var licenseUtil=require(_0xb3a1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352c7c,_0x158211){_0x158211=_0x158211||0xcc;return function(_0xcf3386){if(_0xcf3386){return _0x352c7c[_0xb3a1('0x18')](_0x158211);}return _0x352c7c[_0xb3a1('0x19')](_0x158211)[_0xb3a1('0x1a')]();};}function respondWithResult(_0x305da0,_0x4e824f){_0x4e824f=_0x4e824f||0xc8;return function(_0x55c619){if(_0x55c619){return _0x305da0['status'](_0x4e824f)[_0xb3a1('0x1b')](_0x55c619);}};}function respondWithFilteredResult(_0x536dfd,_0x1891ab){return function(_0x2423fd){if(_0x2423fd){var _0x2beb60=typeof _0x1891ab['offset']===_0xb3a1('0x1c')&&typeof _0x1891ab[_0xb3a1('0x1d')]===_0xb3a1('0x1c');var _0x490210=_0x2423fd[_0xb3a1('0x1e')];var _0x12e2b3=_0x2beb60?0x0:_0x1891ab['offset'];var _0x3dd923=_0x2beb60?_0x2423fd[_0xb3a1('0x1e')]:_0x1891ab['offset']+_0x1891ab[_0xb3a1('0x1d')];var _0x36dac4;if(_0x3dd923>=_0x490210){_0x3dd923=_0x490210;_0x36dac4=0xc8;}else{_0x36dac4=0xce;}_0x536dfd[_0xb3a1('0x19')](_0x36dac4);return _0x536dfd[_0xb3a1('0x1f')](_0xb3a1('0x20'),_0x12e2b3+'-'+_0x3dd923+'/'+_0x490210)['json'](_0x2423fd);}return null;};}function patchUpdates(_0x34ee5b){return function(_0x113122){try{jsonpatch['apply'](_0x113122,_0x34ee5b,!![]);}catch(_0x2a4615){return BPromise['reject'](_0x2a4615);}return _0x113122[_0xb3a1('0x21')]();};}function saveUpdates(_0xb7c130,_0x6e5cb8){return function(_0x4a22bb){if(_0x4a22bb){return _0x4a22bb[_0xb3a1('0x22')](_0xb7c130)['then'](function(_0x2d6c01){return _0x2d6c01;});}return null;};}function removeEntity(_0x5d5fb5,_0x11acd0){return function(_0x244da9){if(_0x244da9){return _0x244da9[_0xb3a1('0x23')]()['then'](function(){_0x5d5fb5[_0xb3a1('0x19')](0xcc)[_0xb3a1('0x1a')]();});}};}function handleEntityNotFound(_0x375726,_0x21e43e){return function(_0x4938c7){if(!_0x4938c7){_0x375726['sendStatus'](0x194);}return _0x4938c7;};}function handleError(_0x5a4dcb,_0x54f2b9){_0x54f2b9=_0x54f2b9||0x1f4;return function(_0x2d090e){logger['error'](_0x2d090e[_0xb3a1('0x24')]);if(_0x2d090e[_0xb3a1('0x25')]){delete _0x2d090e[_0xb3a1('0x25')];}_0x5a4dcb['status'](_0x54f2b9)[_0xb3a1('0x26')](_0x2d090e);};}exports[_0xb3a1('0x27')]=function(_0xed518e,_0xcd1bb9){var _0x64b8a8={},_0x4dd654={},_0x26ffef={'count':0x0,'rows':[]};var _0x44c2b5=_['map'](db[_0xb3a1('0x28')][_0xb3a1('0x29')],function(_0x10887e){return{'name':_0x10887e[_0xb3a1('0x2a')],'type':_0x10887e[_0xb3a1('0x2b')][_0xb3a1('0x2c')]};});_0x4dd654[_0xb3a1('0x2d')]=_[_0xb3a1('0x2e')](_0x44c2b5,_0xb3a1('0x25'));_0x4dd654[_0xb3a1('0x2f')]=_[_0xb3a1('0x30')](_0xed518e[_0xb3a1('0x2f')]);_0x4dd654[_0xb3a1('0x31')]=_[_0xb3a1('0x32')](_0x4dd654[_0xb3a1('0x2d')],_0x4dd654[_0xb3a1('0x2f')]);_0x64b8a8[_0xb3a1('0x33')]=_[_0xb3a1('0x32')](_0x4dd654['model'],qs[_0xb3a1('0x34')](_0xed518e[_0xb3a1('0x2f')]['fields']));_0x64b8a8[_0xb3a1('0x33')]=_0x64b8a8['attributes']['length']?_0x64b8a8[_0xb3a1('0x33')]:_0x4dd654[_0xb3a1('0x2d')];if(!_0xed518e[_0xb3a1('0x2f')][_0xb3a1('0x35')](_0xb3a1('0x36'))){_0x64b8a8[_0xb3a1('0x1d')]=qs[_0xb3a1('0x1d')](_0xed518e[_0xb3a1('0x2f')][_0xb3a1('0x1d')]);_0x64b8a8[_0xb3a1('0x37')]=qs[_0xb3a1('0x37')](_0xed518e[_0xb3a1('0x2f')]['offset']);}_0x64b8a8[_0xb3a1('0x38')]=qs[_0xb3a1('0x39')](_0xed518e['query']['sort']);_0x64b8a8['where']=qs[_0xb3a1('0x31')](_[_0xb3a1('0x3a')](_0xed518e[_0xb3a1('0x2f')],_0x4dd654['filters']),_0x44c2b5);if(_0xed518e[_0xb3a1('0x2f')][_0xb3a1('0x3b')]){_0x64b8a8[_0xb3a1('0x3c')]=_[_0xb3a1('0x3d')](_0x64b8a8[_0xb3a1('0x3c')],{'$or':_['map'](_0x44c2b5,function(_0x5a4d5c){if(_0x5a4d5c['type']!==_0xb3a1('0x3e')){var _0x3c46ba={};_0x3c46ba[_0x5a4d5c[_0xb3a1('0x25')]]={'$like':'%'+_0xed518e[_0xb3a1('0x2f')][_0xb3a1('0x3b')]+'%'};return _0x3c46ba;}})});}_0x64b8a8=_[_0xb3a1('0x3d')]({},_0x64b8a8,_0xed518e['options']);var _0x5476af={'where':_0x64b8a8[_0xb3a1('0x3c')]};return db[_0xb3a1('0x28')]['count'](_0x5476af)[_0xb3a1('0x3f')](function(_0x49e6ec){_0x26ffef['count']=_0x49e6ec;if(_0xed518e[_0xb3a1('0x2f')]['includeAll']){_0x64b8a8[_0xb3a1('0x40')]=[{'all':!![]}];}return db[_0xb3a1('0x28')][_0xb3a1('0x41')](_0x64b8a8);})[_0xb3a1('0x3f')](function(_0x22aef1){_0x26ffef['rows']=_0x22aef1;return _0x26ffef;})[_0xb3a1('0x3f')](respondWithFilteredResult(_0xcd1bb9,_0x64b8a8))[_0xb3a1('0x42')](handleError(_0xcd1bb9,null));};exports[_0xb3a1('0x43')]=function(_0x3b1412,_0x27f642){var _0x2eed6c={'raw':!![],'where':{'id':_0x3b1412[_0xb3a1('0x44')]['id']}},_0x5b2169={};_0x5b2169[_0xb3a1('0x2d')]=_['keys'](db['JscriptyQuestionReport'][_0xb3a1('0x29')]);_0x5b2169[_0xb3a1('0x2f')]=_[_0xb3a1('0x30')](_0x3b1412[_0xb3a1('0x2f')]);_0x5b2169['filters']=_['intersection'](_0x5b2169[_0xb3a1('0x2d')],_0x5b2169[_0xb3a1('0x2f')]);_0x2eed6c[_0xb3a1('0x33')]=_[_0xb3a1('0x32')](_0x5b2169[_0xb3a1('0x2d')],qs[_0xb3a1('0x34')](_0x3b1412[_0xb3a1('0x2f')]['fields']));_0x2eed6c[_0xb3a1('0x33')]=_0x2eed6c[_0xb3a1('0x33')][_0xb3a1('0x45')]?_0x2eed6c[_0xb3a1('0x33')]:_0x5b2169['model'];if(_0x3b1412[_0xb3a1('0x2f')][_0xb3a1('0x46')]){_0x2eed6c[_0xb3a1('0x40')]=[{'all':!![]}];}_0x2eed6c=_[_0xb3a1('0x3d')]({},_0x2eed6c,_0x3b1412[_0xb3a1('0x47')]);return db[_0xb3a1('0x28')][_0xb3a1('0x48')](_0x2eed6c)[_0xb3a1('0x3f')](handleEntityNotFound(_0x27f642,null))[_0xb3a1('0x3f')](respondWithResult(_0x27f642,null))[_0xb3a1('0x42')](handleError(_0x27f642,null));};exports['create']=function(_0x2ea8c0,_0x528f4e){return db['JscriptyQuestionReport']['create'](_0x2ea8c0[_0xb3a1('0x49')],{})[_0xb3a1('0x3f')](respondWithResult(_0x528f4e,0xc9))[_0xb3a1('0x42')](handleError(_0x528f4e,null));};exports[_0xb3a1('0x22')]=function(_0x2e3d1d,_0x49cb56){if(_0x2e3d1d['body']['id']){delete _0x2e3d1d[_0xb3a1('0x49')]['id'];}return db[_0xb3a1('0x28')]['find']({'where':{'id':_0x2e3d1d[_0xb3a1('0x44')]['id']}})[_0xb3a1('0x3f')](handleEntityNotFound(_0x49cb56,null))[_0xb3a1('0x3f')](saveUpdates(_0x2e3d1d[_0xb3a1('0x49')],null))[_0xb3a1('0x3f')](respondWithResult(_0x49cb56,null))[_0xb3a1('0x42')](handleError(_0x49cb56,null));};exports[_0xb3a1('0x23')]=function(_0x53649c,_0x1b26cf){return db[_0xb3a1('0x28')][_0xb3a1('0x48')]({'where':{'id':_0x53649c[_0xb3a1('0x44')]['id']}})[_0xb3a1('0x3f')](handleEntityNotFound(_0x1b26cf,null))['then'](removeEntity(_0x1b26cf,null))[_0xb3a1('0x42')](handleError(_0x1b26cf,null));};exports['describe']=function(_0x17748a,_0x120595){return db[_0xb3a1('0x28')][_0xb3a1('0x4a')]()['then'](respondWithResult(_0x120595,null))[_0xb3a1('0x42')](handleError(_0x120595,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index be04db1..024d15e 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 _0xaf67=['../../config/logger','api','moment','request-promise','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x3d8878,_0x1f7e62){var _0x580b89=function(_0x4da0f5){while(--_0x4da0f5){_0x3d8878['push'](_0x3d8878['shift']());}};_0x580b89(++_0x1f7e62);}(_0xaf67,0x121));var _0x7af6=function(_0x50e871,_0x2cd6a8){_0x50e871=_0x50e871-0x0;var _0x87941b=_0xaf67[_0x50e871];return _0x87941b;};'use strict';var _=require(_0x7af6('0x0'));var util=require('util');var logger=require(_0x7af6('0x1'))(_0x7af6('0x2'));var moment=require(_0x7af6('0x3'));var BPromise=require('bluebird');var rp=require(_0x7af6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7af6('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x7af6('0x6')]=function(_0x4761e1,_0x220cc2){return _0x4761e1[_0x7af6('0x7')](_0x7af6('0x8'),attributes,{'tableName':_0x7af6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd36e=['report_jscripty_questions','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','JscriptyQuestionReport'];(function(_0x1aa4fd,_0x265057){var _0x289290=function(_0x2ab300){while(--_0x2ab300){_0x1aa4fd['push'](_0x1aa4fd['shift']());}};_0x289290(++_0x265057);}(_0xd36e,0x9b));var _0xed36=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd36e[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xed36('0x0'));var util=require(_0xed36('0x1'));var logger=require(_0xed36('0x2'))('api');var moment=require(_0xed36('0x3'));var BPromise=require('bluebird');var rp=require(_0xed36('0x4'));var fs=require('fs');var path=require(_0xed36('0x5'));var rimraf=require(_0xed36('0x6'));var config=require(_0xed36('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x438d02,_0x27699c){return _0x438d02[_0xed36('0x8')](_0xed36('0x9'),attributes,{'tableName':_0xed36('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 1fb5b3d..f21e3e4 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 _0xe32f=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0xe32f,0x194));var _0xfe32=function(_0x1b5644,_0x2ab919){_0x1b5644=_0x1b5644-0x0;var _0x232328=_0xe32f[_0x1b5644];return _0x232328;};'use strict';var _=require(_0xfe32('0x0'));var util=require('util');var moment=require(_0xfe32('0x1'));var BPromise=require(_0xfe32('0x2'));var rs=require(_0xfe32('0x3'));var fs=require('fs');var Redis=require(_0xfe32('0x4'));var db=require(_0xfe32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe32('0x6'))(_0xfe32('0x7'));var config=require(_0xfe32('0x8'));var jayson=require(_0xfe32('0x9'));var client=jayson[_0xfe32('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1588ba,_0x274b96,_0x1668d0){return new BPromise(function(_0x476228,_0x21b71d){return client[_0xfe32('0xb')](_0x1588ba,_0x1668d0)[_0xfe32('0xc')](function(_0x5f1c0b){logger[_0xfe32('0xd')](_0xfe32('0xe'),_0x274b96,_0xfe32('0xf'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x274b96,_0xfe32('0xf'),JSON[_0xfe32('0x10')](_0x5f1c0b));if(_0x5f1c0b[_0xfe32('0x11')]){if(_0x5f1c0b['error'][_0xfe32('0x12')]===0x1f4){logger['error'](_0xfe32('0xe'),_0x274b96,_0x5f1c0b['error'][_0xfe32('0x13')]);return _0x21b71d(_0x5f1c0b[_0xfe32('0x11')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x274b96,_0x5f1c0b[_0xfe32('0x11')][_0xfe32('0x13')]);return _0x476228(_0x5f1c0b['error'][_0xfe32('0x13')]);}else{logger[_0xfe32('0xd')](_0xfe32('0xe'),_0x274b96,_0xfe32('0xf'));_0x476228(_0x5f1c0b[_0xfe32('0x14')][_0xfe32('0x13')]);}})[_0xfe32('0x15')](function(_0x4577cf){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x274b96,_0x4577cf);_0x21b71d(_0x4577cf);});});} \ No newline at end of file +var _0x280d=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0x280d,0x85));var _0xd280=function(_0x318d46,_0x106e5a){_0x318d46=_0x318d46-0x0;var _0x229f18=_0x280d[_0x318d46];return _0x229f18;};'use strict';var _=require(_0xd280('0x0'));var util=require(_0xd280('0x1'));var moment=require(_0xd280('0x2'));var BPromise=require('bluebird');var rs=require(_0xd280('0x3'));var fs=require('fs');var Redis=require(_0xd280('0x4'));var db=require(_0xd280('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd280('0x6'));var config=require(_0xd280('0x7'));var jayson=require(_0xd280('0x8'));var client=jayson[_0xd280('0x9')][_0xd280('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3654,_0x3d612,_0x4684a7){return new BPromise(function(_0x38e232,_0x2280ff){return client[_0xd280('0xb')](_0x3e3654,_0x4684a7)[_0xd280('0xc')](function(_0x571a9a){logger['info'](_0xd280('0xd'),_0x3d612,_0xd280('0xe'));logger[_0xd280('0xf')](_0xd280('0x10'),_0x3d612,'request\x20sent',JSON['stringify'](_0x571a9a));if(_0x571a9a['error']){if(_0x571a9a[_0xd280('0x11')]['code']===0x1f4){logger[_0xd280('0x11')](_0xd280('0xd'),_0x3d612,_0x571a9a['error']['message']);return _0x2280ff(_0x571a9a['error'][_0xd280('0x12')]);}logger[_0xd280('0x11')](_0xd280('0xd'),_0x3d612,_0x571a9a[_0xd280('0x11')][_0xd280('0x12')]);return _0x38e232(_0x571a9a[_0xd280('0x11')][_0xd280('0x12')]);}else{logger[_0xd280('0x13')](_0xd280('0xd'),_0x3d612,_0xd280('0xe'));_0x38e232(_0x571a9a[_0xd280('0x14')]['message']);}})[_0xd280('0x15')](function(_0x5d8468){logger[_0xd280('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3d612,_0x5d8468);_0x2280ff(_0x5d8468);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index dce3579..ccd9721 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 _0x60a9=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2f4f40,_0x1c9e44){var _0x184ccf=function(_0x2ae48b){while(--_0x2ae48b){_0x2f4f40['push'](_0x2f4f40['shift']());}};_0x184ccf(++_0x1c9e44);}(_0x60a9,0xc7));var _0x960a=function(_0x1ed852,_0xa9fa2b){_0x1ed852=_0x1ed852-0x0;var _0x3f2060=_0x60a9[_0x1ed852];return _0x3f2060;};'use strict';var multer=require(_0x960a('0x0'));var util=require(_0x960a('0x1'));var path=require(_0x960a('0x2'));var timeout=require(_0x960a('0x3'));var express=require(_0x960a('0x4'));var router=express[_0x960a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x960a('0x6'));var interaction=require(_0x960a('0x7'));var config=require(_0x960a('0x8'));var controller=require(_0x960a('0x9'));router[_0x960a('0xa')]('/',auth[_0x960a('0xb')](),controller[_0x960a('0xc')]);router[_0x960a('0xa')](_0x960a('0xd'),auth[_0x960a('0xb')](),controller[_0x960a('0xe')]);router[_0x960a('0xa')](_0x960a('0xf'),auth[_0x960a('0xb')](),controller[_0x960a('0x10')]);router['get']('/:id/questions',auth[_0x960a('0xb')](),controller['getQuestions']);router[_0x960a('0x11')]('/',auth[_0x960a('0xb')](),controller[_0x960a('0x12')]);router[_0x960a('0x13')](_0x960a('0xf'),auth[_0x960a('0xb')](),controller[_0x960a('0x14')]);router['delete']('/:id',auth[_0x960a('0xb')](),controller[_0x960a('0x15')]);module[_0x960a('0x16')]=router; \ No newline at end of file +var _0x15c5=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/questions','getQuestions','post','create','put','update','destroy','exports','multer','util'];(function(_0x395f83,_0x564700){var _0x7ed58f=function(_0x150e19){while(--_0x150e19){_0x395f83['push'](_0x395f83['shift']());}};_0x7ed58f(++_0x564700);}(_0x15c5,0x1ca));var _0x515c=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x15c5[_0x2136d5];return _0x3bee2e;};'use strict';var multer=require(_0x515c('0x0'));var util=require(_0x515c('0x1'));var path=require('path');var timeout=require(_0x515c('0x2'));var express=require('express');var router=express[_0x515c('0x3')]();var fs_extra=require(_0x515c('0x4'));var auth=require(_0x515c('0x5'));var interaction=require(_0x515c('0x6'));var config=require(_0x515c('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x515c('0x8')]('/',auth[_0x515c('0x9')](),controller['index']);router[_0x515c('0x8')](_0x515c('0xa'),auth[_0x515c('0x9')](),controller['describe']);router[_0x515c('0x8')](_0x515c('0xb'),auth[_0x515c('0x9')](),controller['show']);router[_0x515c('0x8')](_0x515c('0xc'),auth['isAuthenticated'](),controller[_0x515c('0xd')]);router[_0x515c('0xe')]('/',auth['isAuthenticated'](),controller[_0x515c('0xf')]);router[_0x515c('0x10')](_0x515c('0xb'),auth[_0x515c('0x9')](),controller[_0x515c('0x11')]);router['delete'](_0x515c('0xb'),auth[_0x515c('0x9')](),controller[_0x515c('0x12')]);module[_0x515c('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d29ecea..c544e5f 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 _0x280d=['BOOLEAN','moment','sequelize','DATE','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2e6cc7,_0x582db5){var _0x39c788=function(_0x369ff0){while(--_0x369ff0){_0x2e6cc7['push'](_0x2e6cc7['shift']());}};_0x39c788(++_0x582db5);}(_0x280d,0x189));var _0xd280=function(_0x22f3ea,_0x217654){_0x22f3ea=_0x22f3ea-0x0;var _0x360ad4=_0x280d[_0x22f3ea];return _0x360ad4;};'use strict';var moment=require(_0xd280('0x0'));var Sequelize=require(_0xd280('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xd280('0x2')],'set':function(_0x3abee2){this['setDataValue']('starttime',_0x3abee2);this[_0xd280('0x3')]('endtime',moment()['format'](_0xd280('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xd280('0x5')]},'projectname':{'type':Sequelize[_0xd280('0x5')]},'queue':{'type':Sequelize[_0xd280('0x5')]},'uniqueid':{'type':Sequelize[_0xd280('0x5')]},'calleridname':{'type':Sequelize[_0xd280('0x5')]},'calleridnum':{'type':Sequelize[_0xd280('0x5')]},'completed':{'type':Sequelize[_0xd280('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x76c1=['DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x137211,_0x59045c){var _0x3d3842=function(_0x331d87){while(--_0x331d87){_0x137211['push'](_0x137211['shift']());}};_0x3d3842(++_0x59045c);}(_0x76c1,0x15b));var _0x176c=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x76c1[_0xa45395];return _0x3c83d2;};'use strict';var moment=require(_0x176c('0x0'));var Sequelize=require(_0x176c('0x1'));module[_0x176c('0x2')]={'starttime':{'type':Sequelize[_0x176c('0x3')],'set':function(_0x131f72){this[_0x176c('0x4')]('starttime',_0x131f72);this['setDataValue'](_0x176c('0x5'),moment()[_0x176c('0x6')](_0x176c('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x176c('0x8')]},'queue':{'type':Sequelize[_0x176c('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x176c('0x8')]},'calleridnum':{'type':Sequelize[_0x176c('0x8')]},'completed':{'type':Sequelize[_0x176c('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 3ddee0a..160c25c 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 _0xda31=['apply','reject','update','then','destroy','error','name','send','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json'];(function(_0x271dae,_0x2ec278){var _0x1b9689=function(_0x839766){while(--_0x839766){_0x271dae['push'](_0x271dae['shift']());}};_0x1b9689(++_0x2ec278);}(_0xda31,0x165));var _0x1da3=function(_0x2bd0dd,_0x167fb0){_0x2bd0dd=_0x2bd0dd-0x0;var _0x4637bb=_0xda31[_0x2bd0dd];return _0x4637bb;};'use strict';var emlformat=require(_0x1da3('0x0'));var rimraf=require(_0x1da3('0x1'));var zipdir=require(_0x1da3('0x2'));var jsonpatch=require(_0x1da3('0x3'));var rp=require(_0x1da3('0x4'));var moment=require(_0x1da3('0x5'));var BPromise=require(_0x1da3('0x6'));var Mustache=require('mustache');var util=require(_0x1da3('0x7'));var path=require(_0x1da3('0x8'));var sox=require(_0x1da3('0x9'));var csv=require(_0x1da3('0xa'));var ejs=require(_0x1da3('0xb'));var fs=require('fs');var fs_extra=require(_0x1da3('0xc'));var _=require('lodash');var squel=require(_0x1da3('0xd'));var crypto=require(_0x1da3('0xe'));var jsforce=require(_0x1da3('0xf'));var deskjs=require(_0x1da3('0x10'));var toCsv=require(_0x1da3('0xa'));var querystring=require(_0x1da3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1da3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1da3('0x13'));var logger=require(_0x1da3('0x14'))('api');var utils=require(_0x1da3('0x15'));var config=require(_0x1da3('0x16'));var licenseUtil=require(_0x1da3('0x17'));var db=require(_0x1da3('0x18'))['db'];function respondWithStatusCode(_0x5be5a0,_0x2dee22){_0x2dee22=_0x2dee22||0xcc;return function(_0x5568b8){if(_0x5568b8){return _0x5be5a0[_0x1da3('0x19')](_0x2dee22);}return _0x5be5a0[_0x1da3('0x1a')](_0x2dee22)[_0x1da3('0x1b')]();};}function respondWithResult(_0x1e0c3a,_0x3ca285){_0x3ca285=_0x3ca285||0xc8;return function(_0x2ab158){if(_0x2ab158){return _0x1e0c3a[_0x1da3('0x1a')](_0x3ca285)['json'](_0x2ab158);}};}function respondWithFilteredResult(_0x47ff4f,_0x3680bf){return function(_0x34add7){if(_0x34add7){var _0x5cb303=typeof _0x3680bf[_0x1da3('0x1c')]===_0x1da3('0x1d')&&typeof _0x3680bf[_0x1da3('0x1e')]===_0x1da3('0x1d');var _0x4141d0=_0x34add7[_0x1da3('0x1f')];var _0x469cfb=_0x5cb303?0x0:_0x3680bf[_0x1da3('0x1c')];var _0x5c809e=_0x5cb303?_0x34add7[_0x1da3('0x1f')]:_0x3680bf[_0x1da3('0x1c')]+_0x3680bf['limit'];var _0x23062b;if(_0x5c809e>=_0x4141d0){_0x5c809e=_0x4141d0;_0x23062b=0xc8;}else{_0x23062b=0xce;}_0x47ff4f['status'](_0x23062b);return _0x47ff4f['set']('Content-Range',_0x469cfb+'-'+_0x5c809e+'/'+_0x4141d0)[_0x1da3('0x20')](_0x34add7);}return null;};}function patchUpdates(_0x12352b){return function(_0x4b64d7){try{jsonpatch[_0x1da3('0x21')](_0x4b64d7,_0x12352b,!![]);}catch(_0x29627b){return BPromise[_0x1da3('0x22')](_0x29627b);}return _0x4b64d7['save']();};}function saveUpdates(_0x340325,_0x553402){return function(_0x2bb147){if(_0x2bb147){return _0x2bb147[_0x1da3('0x23')](_0x340325)[_0x1da3('0x24')](function(_0x2b5232){return _0x2b5232;});}return null;};}function removeEntity(_0x3866b2,_0x2d27e0){return function(_0x38cc93){if(_0x38cc93){return _0x38cc93[_0x1da3('0x25')]()[_0x1da3('0x24')](function(){_0x3866b2['status'](0xcc)[_0x1da3('0x1b')]();});}};}function handleEntityNotFound(_0x26cdb7,_0x419cdb){return function(_0x570f2a){if(!_0x570f2a){_0x26cdb7[_0x1da3('0x19')](0x194);}return _0x570f2a;};}function handleError(_0x135664,_0x4a8a16){_0x4a8a16=_0x4a8a16||0x1f4;return function(_0x5baed1){logger[_0x1da3('0x26')](_0x5baed1['stack']);if(_0x5baed1[_0x1da3('0x27')]){delete _0x5baed1[_0x1da3('0x27')];}_0x135664[_0x1da3('0x1a')](_0x4a8a16)[_0x1da3('0x28')](_0x5baed1);};}exports['index']=function(_0x395ca4,_0x2a93b5){var _0x20fef4={},_0xe43c6={},_0x3ba944={'count':0x0,'rows':[]};var _0x4fba04=_['map'](db[_0x1da3('0x29')][_0x1da3('0x2a')],function(_0x53b486){return{'name':_0x53b486[_0x1da3('0x2b')],'type':_0x53b486['type'][_0x1da3('0x2c')]};});_0xe43c6[_0x1da3('0x2d')]=_['map'](_0x4fba04,'name');_0xe43c6['query']=_['keys'](_0x395ca4[_0x1da3('0x2e')]);_0xe43c6[_0x1da3('0x2f')]=_[_0x1da3('0x30')](_0xe43c6[_0x1da3('0x2d')],_0xe43c6[_0x1da3('0x2e')]);_0x20fef4[_0x1da3('0x31')]=_['intersection'](_0xe43c6['model'],qs[_0x1da3('0x32')](_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x32')]));_0x20fef4[_0x1da3('0x31')]=_0x20fef4[_0x1da3('0x31')][_0x1da3('0x33')]?_0x20fef4[_0x1da3('0x31')]:_0xe43c6[_0x1da3('0x2d')];if(!_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x34')](_0x1da3('0x35'))){_0x20fef4[_0x1da3('0x1e')]=qs[_0x1da3('0x1e')](_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x1e')]);_0x20fef4[_0x1da3('0x1c')]=qs[_0x1da3('0x1c')](_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x1c')]);}_0x20fef4[_0x1da3('0x36')]=qs[_0x1da3('0x37')](_0x395ca4[_0x1da3('0x2e')]['sort']);_0x20fef4[_0x1da3('0x38')]=qs['filters'](_[_0x1da3('0x39')](_0x395ca4[_0x1da3('0x2e')],_0xe43c6[_0x1da3('0x2f')]),_0x4fba04);if(_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x3a')]){_0x20fef4[_0x1da3('0x38')]=_[_0x1da3('0x3b')](_0x20fef4['where'],{'$or':_[_0x1da3('0x3c')](_0x4fba04,function(_0x2573c2){if(_0x2573c2['type']!==_0x1da3('0x3d')){var _0x1b4886={};_0x1b4886[_0x2573c2[_0x1da3('0x27')]]={'$like':'%'+_0x395ca4[_0x1da3('0x2e')][_0x1da3('0x3a')]+'%'};return _0x1b4886;}})});}_0x20fef4=_[_0x1da3('0x3b')]({},_0x20fef4,_0x395ca4['options']);var _0x44a7ae={'where':_0x20fef4[_0x1da3('0x38')]};return db[_0x1da3('0x29')][_0x1da3('0x1f')](_0x44a7ae)['then'](function(_0x2ade9f){_0x3ba944[_0x1da3('0x1f')]=_0x2ade9f;if(_0x395ca4['query'][_0x1da3('0x3e')]){_0x20fef4[_0x1da3('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1da3('0x40')](_0x20fef4);})[_0x1da3('0x24')](function(_0x1621b9){_0x3ba944['rows']=_0x1621b9;return _0x3ba944;})['then'](respondWithFilteredResult(_0x2a93b5,_0x20fef4))[_0x1da3('0x41')](handleError(_0x2a93b5,null));};exports[_0x1da3('0x42')]=function(_0x5e5f16,_0x347394){var _0x2d5ae3={'raw':!![],'where':{'id':_0x5e5f16[_0x1da3('0x43')]['id']}},_0x202aa3={};_0x202aa3[_0x1da3('0x2d')]=_[_0x1da3('0x44')](db[_0x1da3('0x29')]['rawAttributes']);_0x202aa3[_0x1da3('0x2e')]=_[_0x1da3('0x44')](_0x5e5f16['query']);_0x202aa3[_0x1da3('0x2f')]=_[_0x1da3('0x30')](_0x202aa3[_0x1da3('0x2d')],_0x202aa3['query']);_0x2d5ae3['attributes']=_['intersection'](_0x202aa3[_0x1da3('0x2d')],qs[_0x1da3('0x32')](_0x5e5f16[_0x1da3('0x2e')][_0x1da3('0x32')]));_0x2d5ae3[_0x1da3('0x31')]=_0x2d5ae3['attributes'][_0x1da3('0x33')]?_0x2d5ae3['attributes']:_0x202aa3['model'];if(_0x5e5f16[_0x1da3('0x2e')]['includeAll']){_0x2d5ae3['include']=[{'all':!![]}];}_0x2d5ae3=_[_0x1da3('0x3b')]({},_0x2d5ae3,_0x5e5f16[_0x1da3('0x45')]);return db[_0x1da3('0x29')]['find'](_0x2d5ae3)[_0x1da3('0x24')](handleEntityNotFound(_0x347394,null))[_0x1da3('0x24')](respondWithResult(_0x347394,null))[_0x1da3('0x41')](handleError(_0x347394,null));};exports[_0x1da3('0x46')]=function(_0x3d87c7,_0x528aba){return db[_0x1da3('0x29')]['create'](_0x3d87c7['body'],{})[_0x1da3('0x24')](respondWithResult(_0x528aba,0xc9))[_0x1da3('0x41')](handleError(_0x528aba,null));};exports[_0x1da3('0x23')]=function(_0x151cd8,_0x64159){if(_0x151cd8['body']['id']){delete _0x151cd8[_0x1da3('0x47')]['id'];}return db[_0x1da3('0x29')][_0x1da3('0x48')]({'where':{'id':_0x151cd8[_0x1da3('0x43')]['id']}})[_0x1da3('0x24')](handleEntityNotFound(_0x64159,null))[_0x1da3('0x24')](saveUpdates(_0x151cd8[_0x1da3('0x47')],null))[_0x1da3('0x24')](respondWithResult(_0x64159,null))[_0x1da3('0x41')](handleError(_0x64159,null));};exports[_0x1da3('0x25')]=function(_0x280423,_0x4cddd2){return db[_0x1da3('0x29')][_0x1da3('0x48')]({'where':{'id':_0x280423['params']['id']}})[_0x1da3('0x24')](handleEntityNotFound(_0x4cddd2,null))['then'](removeEntity(_0x4cddd2,null))['catch'](handleError(_0x4cddd2,null));};exports['describe']=function(_0x15879e,_0x441459){return db['JscriptySessionReport'][_0x1da3('0x49')]()[_0x1da3('0x24')](respondWithResult(_0x441459,null))[_0x1da3('0x41')](handleError(_0x441459,null));};exports[_0x1da3('0x4a')]=function(_0x42f5af,_0x23b917,_0x1f8678){var _0x2f5e6a={'raw':!![],'where':{}};var _0x3cb89c={};var _0x3fd1cd={'count':0x0,'rows':[]};return db[_0x1da3('0x29')][_0x1da3('0x4b')]({'where':{'id':_0x42f5af['params']['id']}})[_0x1da3('0x24')](handleEntityNotFound(_0x23b917,null))[_0x1da3('0x24')](function(_0x3654b4){if(_0x3654b4){_0x3cb89c[_0x1da3('0x2d')]=_[_0x1da3('0x44')](db[_0x1da3('0x4c')]['rawAttributes']);_0x3cb89c['query']=_[_0x1da3('0x44')](_0x42f5af['query']);_0x3cb89c[_0x1da3('0x2f')]=_['intersection'](_0x3cb89c[_0x1da3('0x2d')],_0x3cb89c[_0x1da3('0x2e')]);_0x2f5e6a[_0x1da3('0x31')]=_[_0x1da3('0x30')](_0x3cb89c[_0x1da3('0x2d')],qs[_0x1da3('0x32')](_0x42f5af[_0x1da3('0x2e')]['fields']));_0x2f5e6a['attributes']=_0x2f5e6a[_0x1da3('0x31')][_0x1da3('0x33')]?_0x2f5e6a['attributes']:_0x3cb89c[_0x1da3('0x2d')];if(!_0x42f5af[_0x1da3('0x2e')]['hasOwnProperty'](_0x1da3('0x35'))){_0x2f5e6a[_0x1da3('0x1e')]=qs[_0x1da3('0x1e')](_0x42f5af[_0x1da3('0x2e')]['limit']);_0x2f5e6a[_0x1da3('0x1c')]=qs[_0x1da3('0x1c')](_0x42f5af[_0x1da3('0x2e')][_0x1da3('0x1c')]);}_0x2f5e6a['order']=qs[_0x1da3('0x37')](_0x42f5af[_0x1da3('0x2e')][_0x1da3('0x37')]);_0x2f5e6a[_0x1da3('0x38')]=qs[_0x1da3('0x2f')](_[_0x1da3('0x39')](_0x42f5af['query'],_0x3cb89c[_0x1da3('0x2f')]));_0x2f5e6a[_0x1da3('0x38')]['SessionId']=_0x3654b4['id'];if(_0x42f5af[_0x1da3('0x2e')][_0x1da3('0x3a')]){_0x2f5e6a[_0x1da3('0x38')]=_[_0x1da3('0x3b')](_0x2f5e6a['where'],{'$or':_['map'](_0x2f5e6a[_0x1da3('0x31')],function(_0x179245){var _0x5ef6cc={};_0x5ef6cc[_0x179245]={'$like':'%'+_0x42f5af[_0x1da3('0x2e')]['filter']+'%'};return _0x5ef6cc;})});}_0x2f5e6a=_[_0x1da3('0x3b')]({},_0x2f5e6a,_0x42f5af[_0x1da3('0x45')]);return db[_0x1da3('0x4c')][_0x1da3('0x1f')]({'where':_0x2f5e6a[_0x1da3('0x38')]})[_0x1da3('0x24')](function(_0x560261){_0x3fd1cd[_0x1da3('0x1f')]=_0x560261;if(_0x42f5af[_0x1da3('0x2e')][_0x1da3('0x3e')]){_0x2f5e6a[_0x1da3('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x1da3('0x40')](_0x2f5e6a);})[_0x1da3('0x24')](function(_0x3a51aa){_0x3fd1cd[_0x1da3('0x4d')]=_0x3a51aa;return _0x3fd1cd;});}})[_0x1da3('0x24')](respondWithFilteredResult(_0x23b917,_0x2f5e6a))[_0x1da3('0x41')](handleError(_0x23b917,null));}; \ No newline at end of file +var _0x1599=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','filter','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x237dc3,_0x13c775){var _0x2654a0=function(_0x38ad26){while(--_0x38ad26){_0x237dc3['push'](_0x237dc3['shift']());}};_0x2654a0(++_0x13c775);}(_0x1599,0x138));var _0x9159=function(_0x1f8cb3,_0x5b81d8){_0x1f8cb3=_0x1f8cb3-0x0;var _0x2428e2=_0x1599[_0x1f8cb3];return _0x2428e2;};'use strict';var emlformat=require(_0x9159('0x0'));var rimraf=require(_0x9159('0x1'));var zipdir=require(_0x9159('0x2'));var jsonpatch=require(_0x9159('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9159('0x4'));var Mustache=require(_0x9159('0x5'));var util=require(_0x9159('0x6'));var path=require(_0x9159('0x7'));var sox=require(_0x9159('0x8'));var csv=require(_0x9159('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9159('0xa'));var _=require('lodash');var squel=require(_0x9159('0xb'));var crypto=require(_0x9159('0xc'));var jsforce=require(_0x9159('0xd'));var deskjs=require(_0x9159('0xe'));var toCsv=require(_0x9159('0x9'));var querystring=require('querystring');var Papa=require(_0x9159('0xf'));var Redis=require(_0x9159('0x10'));var authService=require(_0x9159('0x11'));var qs=require(_0x9159('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9159('0x13'));var logger=require(_0x9159('0x14'))(_0x9159('0x15'));var utils=require(_0x9159('0x16'));var config=require(_0x9159('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9159('0x18'))['db'];function respondWithStatusCode(_0xcc5168,_0x5f000f){_0x5f000f=_0x5f000f||0xcc;return function(_0x37173e){if(_0x37173e){return _0xcc5168[_0x9159('0x19')](_0x5f000f);}return _0xcc5168[_0x9159('0x1a')](_0x5f000f)['end']();};}function respondWithResult(_0x26a73a,_0x12c72b){_0x12c72b=_0x12c72b||0xc8;return function(_0x4ba13f){if(_0x4ba13f){return _0x26a73a[_0x9159('0x1a')](_0x12c72b)[_0x9159('0x1b')](_0x4ba13f);}};}function respondWithFilteredResult(_0x3e4870,_0x3a58cc){return function(_0xf30e43){if(_0xf30e43){var _0x5a56d5=typeof _0x3a58cc[_0x9159('0x1c')]===_0x9159('0x1d')&&typeof _0x3a58cc[_0x9159('0x1e')]===_0x9159('0x1d');var _0x4513e9=_0xf30e43[_0x9159('0x1f')];var _0x5af88d=_0x5a56d5?0x0:_0x3a58cc[_0x9159('0x1c')];var _0x259988=_0x5a56d5?_0xf30e43[_0x9159('0x1f')]:_0x3a58cc[_0x9159('0x1c')]+_0x3a58cc[_0x9159('0x1e')];var _0x2afc45;if(_0x259988>=_0x4513e9){_0x259988=_0x4513e9;_0x2afc45=0xc8;}else{_0x2afc45=0xce;}_0x3e4870['status'](_0x2afc45);return _0x3e4870[_0x9159('0x20')](_0x9159('0x21'),_0x5af88d+'-'+_0x259988+'/'+_0x4513e9)[_0x9159('0x1b')](_0xf30e43);}return null;};}function patchUpdates(_0x1ba346){return function(_0x23efbe){try{jsonpatch['apply'](_0x23efbe,_0x1ba346,!![]);}catch(_0x5c5cf9){return BPromise[_0x9159('0x22')](_0x5c5cf9);}return _0x23efbe['save']();};}function saveUpdates(_0x1e2e88,_0x43670f){return function(_0x2594bc){if(_0x2594bc){return _0x2594bc[_0x9159('0x23')](_0x1e2e88)[_0x9159('0x24')](function(_0x5627ab){return _0x5627ab;});}return null;};}function removeEntity(_0x3b20f5,_0x42094a){return function(_0x2ba428){if(_0x2ba428){return _0x2ba428[_0x9159('0x25')]()[_0x9159('0x24')](function(){_0x3b20f5['status'](0xcc)[_0x9159('0x26')]();});}};}function handleEntityNotFound(_0xc0b363,_0x1794c8){return function(_0x32af2f){if(!_0x32af2f){_0xc0b363[_0x9159('0x19')](0x194);}return _0x32af2f;};}function handleError(_0x57644d,_0x1e762b){_0x1e762b=_0x1e762b||0x1f4;return function(_0x1b5018){logger[_0x9159('0x27')](_0x1b5018[_0x9159('0x28')]);if(_0x1b5018[_0x9159('0x29')]){delete _0x1b5018[_0x9159('0x29')];}_0x57644d[_0x9159('0x1a')](_0x1e762b)[_0x9159('0x2a')](_0x1b5018);};}exports[_0x9159('0x2b')]=function(_0xef86d3,_0x557819){var _0x958b64={},_0xf81af1={},_0x5860db={'count':0x0,'rows':[]};var _0x141a1d=_[_0x9159('0x2c')](db[_0x9159('0x2d')][_0x9159('0x2e')],function(_0x12cdf9){return{'name':_0x12cdf9[_0x9159('0x2f')],'type':_0x12cdf9[_0x9159('0x30')][_0x9159('0x31')]};});_0xf81af1[_0x9159('0x32')]=_[_0x9159('0x2c')](_0x141a1d,'name');_0xf81af1[_0x9159('0x33')]=_[_0x9159('0x34')](_0xef86d3[_0x9159('0x33')]);_0xf81af1['filters']=_['intersection'](_0xf81af1['model'],_0xf81af1[_0x9159('0x33')]);_0x958b64[_0x9159('0x35')]=_[_0x9159('0x36')](_0xf81af1[_0x9159('0x32')],qs[_0x9159('0x37')](_0xef86d3[_0x9159('0x33')][_0x9159('0x37')]));_0x958b64[_0x9159('0x35')]=_0x958b64['attributes'][_0x9159('0x38')]?_0x958b64[_0x9159('0x35')]:_0xf81af1[_0x9159('0x32')];if(!_0xef86d3[_0x9159('0x33')][_0x9159('0x39')](_0x9159('0x3a'))){_0x958b64['limit']=qs[_0x9159('0x1e')](_0xef86d3['query'][_0x9159('0x1e')]);_0x958b64['offset']=qs[_0x9159('0x1c')](_0xef86d3[_0x9159('0x33')][_0x9159('0x1c')]);}_0x958b64['order']=qs[_0x9159('0x3b')](_0xef86d3['query'][_0x9159('0x3b')]);_0x958b64['where']=qs[_0x9159('0x3c')](_[_0x9159('0x3d')](_0xef86d3[_0x9159('0x33')],_0xf81af1[_0x9159('0x3c')]),_0x141a1d);if(_0xef86d3[_0x9159('0x33')]['filter']){_0x958b64[_0x9159('0x3e')]=_[_0x9159('0x3f')](_0x958b64[_0x9159('0x3e')],{'$or':_['map'](_0x141a1d,function(_0x174fd0){if(_0x174fd0['type']!==_0x9159('0x40')){var _0x44c49f={};_0x44c49f[_0x174fd0['name']]={'$like':'%'+_0xef86d3[_0x9159('0x33')]['filter']+'%'};return _0x44c49f;}})});}_0x958b64=_[_0x9159('0x3f')]({},_0x958b64,_0xef86d3[_0x9159('0x41')]);var _0x1cbebe={'where':_0x958b64['where']};return db['JscriptySessionReport'][_0x9159('0x1f')](_0x1cbebe)[_0x9159('0x24')](function(_0x2915ff){_0x5860db[_0x9159('0x1f')]=_0x2915ff;if(_0xef86d3['query'][_0x9159('0x42')]){_0x958b64['include']=[{'all':!![]}];}return db[_0x9159('0x2d')][_0x9159('0x43')](_0x958b64);})[_0x9159('0x24')](function(_0x254014){_0x5860db[_0x9159('0x44')]=_0x254014;return _0x5860db;})[_0x9159('0x24')](respondWithFilteredResult(_0x557819,_0x958b64))[_0x9159('0x45')](handleError(_0x557819,null));};exports['show']=function(_0x38d4c6,_0x410dd1){var _0x4c3523={'raw':!![],'where':{'id':_0x38d4c6[_0x9159('0x46')]['id']}},_0x43a532={};_0x43a532[_0x9159('0x32')]=_[_0x9159('0x34')](db[_0x9159('0x2d')]['rawAttributes']);_0x43a532[_0x9159('0x33')]=_[_0x9159('0x34')](_0x38d4c6[_0x9159('0x33')]);_0x43a532[_0x9159('0x3c')]=_['intersection'](_0x43a532[_0x9159('0x32')],_0x43a532[_0x9159('0x33')]);_0x4c3523[_0x9159('0x35')]=_[_0x9159('0x36')](_0x43a532[_0x9159('0x32')],qs[_0x9159('0x37')](_0x38d4c6[_0x9159('0x33')][_0x9159('0x37')]));_0x4c3523[_0x9159('0x35')]=_0x4c3523[_0x9159('0x35')][_0x9159('0x38')]?_0x4c3523[_0x9159('0x35')]:_0x43a532['model'];if(_0x38d4c6['query'][_0x9159('0x42')]){_0x4c3523[_0x9159('0x47')]=[{'all':!![]}];}_0x4c3523=_[_0x9159('0x3f')]({},_0x4c3523,_0x38d4c6['options']);return db[_0x9159('0x2d')][_0x9159('0x48')](_0x4c3523)[_0x9159('0x24')](handleEntityNotFound(_0x410dd1,null))[_0x9159('0x24')](respondWithResult(_0x410dd1,null))['catch'](handleError(_0x410dd1,null));};exports[_0x9159('0x49')]=function(_0x49a2d8,_0x1ab9a4){return db[_0x9159('0x2d')]['create'](_0x49a2d8[_0x9159('0x4a')],{})[_0x9159('0x24')](respondWithResult(_0x1ab9a4,0xc9))[_0x9159('0x45')](handleError(_0x1ab9a4,null));};exports[_0x9159('0x23')]=function(_0x328ff9,_0x31e485){if(_0x328ff9[_0x9159('0x4a')]['id']){delete _0x328ff9['body']['id'];}return db[_0x9159('0x2d')][_0x9159('0x48')]({'where':{'id':_0x328ff9[_0x9159('0x46')]['id']}})[_0x9159('0x24')](handleEntityNotFound(_0x31e485,null))['then'](saveUpdates(_0x328ff9[_0x9159('0x4a')],null))['then'](respondWithResult(_0x31e485,null))['catch'](handleError(_0x31e485,null));};exports[_0x9159('0x25')]=function(_0x1cc469,_0x150fee){return db[_0x9159('0x2d')][_0x9159('0x48')]({'where':{'id':_0x1cc469[_0x9159('0x46')]['id']}})[_0x9159('0x24')](handleEntityNotFound(_0x150fee,null))[_0x9159('0x24')](removeEntity(_0x150fee,null))[_0x9159('0x45')](handleError(_0x150fee,null));};exports[_0x9159('0x4b')]=function(_0x4ff63e,_0xb6c518){return db[_0x9159('0x2d')][_0x9159('0x4b')]()[_0x9159('0x24')](respondWithResult(_0xb6c518,null))[_0x9159('0x45')](handleError(_0xb6c518,null));};exports[_0x9159('0x4c')]=function(_0x520f81,_0x32c317,_0x180ed6){var _0x160c0e={'raw':!![],'where':{}};var _0x1a8ee3={};var _0x286341={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x9159('0x4d')]({'where':{'id':_0x520f81[_0x9159('0x46')]['id']}})['then'](handleEntityNotFound(_0x32c317,null))[_0x9159('0x24')](function(_0x4ba884){if(_0x4ba884){_0x1a8ee3[_0x9159('0x32')]=_[_0x9159('0x34')](db[_0x9159('0x4e')][_0x9159('0x2e')]);_0x1a8ee3[_0x9159('0x33')]=_[_0x9159('0x34')](_0x520f81[_0x9159('0x33')]);_0x1a8ee3[_0x9159('0x3c')]=_[_0x9159('0x36')](_0x1a8ee3[_0x9159('0x32')],_0x1a8ee3[_0x9159('0x33')]);_0x160c0e['attributes']=_[_0x9159('0x36')](_0x1a8ee3[_0x9159('0x32')],qs['fields'](_0x520f81[_0x9159('0x33')]['fields']));_0x160c0e[_0x9159('0x35')]=_0x160c0e['attributes'][_0x9159('0x38')]?_0x160c0e['attributes']:_0x1a8ee3[_0x9159('0x32')];if(!_0x520f81[_0x9159('0x33')][_0x9159('0x39')]('nolimit')){_0x160c0e[_0x9159('0x1e')]=qs['limit'](_0x520f81[_0x9159('0x33')][_0x9159('0x1e')]);_0x160c0e[_0x9159('0x1c')]=qs['offset'](_0x520f81[_0x9159('0x33')][_0x9159('0x1c')]);}_0x160c0e[_0x9159('0x4f')]=qs['sort'](_0x520f81[_0x9159('0x33')][_0x9159('0x3b')]);_0x160c0e[_0x9159('0x3e')]=qs[_0x9159('0x3c')](_['pick'](_0x520f81[_0x9159('0x33')],_0x1a8ee3[_0x9159('0x3c')]));_0x160c0e['where']['SessionId']=_0x4ba884['id'];if(_0x520f81[_0x9159('0x33')][_0x9159('0x50')]){_0x160c0e[_0x9159('0x3e')]=_[_0x9159('0x3f')](_0x160c0e[_0x9159('0x3e')],{'$or':_['map'](_0x160c0e[_0x9159('0x35')],function(_0x99bb5a){var _0x3a6e52={};_0x3a6e52[_0x99bb5a]={'$like':'%'+_0x520f81['query'][_0x9159('0x50')]+'%'};return _0x3a6e52;})});}_0x160c0e=_[_0x9159('0x3f')]({},_0x160c0e,_0x520f81[_0x9159('0x41')]);return db[_0x9159('0x4e')][_0x9159('0x1f')]({'where':_0x160c0e[_0x9159('0x3e')]})[_0x9159('0x24')](function(_0x2d6b21){_0x286341[_0x9159('0x1f')]=_0x2d6b21;if(_0x520f81[_0x9159('0x33')][_0x9159('0x42')]){_0x160c0e['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x9159('0x43')](_0x160c0e);})[_0x9159('0x24')](function(_0x754f7d){_0x286341['rows']=_0x754f7d;return _0x286341;});}})[_0x9159('0x24')](respondWithFilteredResult(_0x32c317,_0x160c0e))['catch'](handleError(_0x32c317,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a4f86a0..378cd46 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 _0x6b8f=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','api','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x348edd,_0x56c03a){var _0x35c371=function(_0x54269b){while(--_0x54269b){_0x348edd['push'](_0x348edd['shift']());}};_0x35c371(++_0x56c03a);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x146a04,_0x4be860){_0x146a04=_0x146a04-0x0;var _0x5c59d8=_0x6b8f[_0x146a04];return _0x5c59d8;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));module[_0xf6b8('0x6')]=function(_0x549eac,_0x2d035e){return _0x549eac[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':_0xf6b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['report_jscripty_sessions','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5c9830,_0x30841d){var _0x407512=function(_0x9b5f18){while(--_0x9b5f18){_0x5c9830['push'](_0x5c9830['shift']());}};_0x407512(++_0x30841d);}(_0x326f,0xd1));var _0xf326=function(_0x40db5b,_0x23dcc5){_0x40db5b=_0x40db5b-0x0;var _0x39625b=_0x326f[_0x40db5b];return _0x39625b;};'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/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e4e84a0..a931a0a 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 _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ce338,_0x5986f6){var _0x33122f=function(_0x34a1f9){while(--_0x34a1f9){_0x4ce338['push'](_0x4ce338['shift']());}};_0x33122f(++_0x5986f6);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x517c4c,_0x5ee263){var _0x5a403e=function(_0x35f80d){while(--_0x35f80d){_0x517c4c['push'](_0x517c4c['shift']());}};_0x5a403e(++_0x5ee263);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc90640,_0xde1f30){_0xc90640=_0xc90640-0x0;var _0x35ae81=_0x5f2f[_0xc90640];return _0x35ae81;};'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')]('JscriptySessionReport,\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);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5a8ee9a..abe269d 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 _0x16a0=['/:id','isAuthenticated','downloadLogFile','exports','multer','util','express','Router','fs-extra','../../config/environment','./license.controller','get','index'];(function(_0x29e72b,_0x1c04c3){var _0x5ce4d6=function(_0x15b13d){while(--_0x15b13d){_0x29e72b['push'](_0x29e72b['shift']());}};_0x5ce4d6(++_0x1c04c3);}(_0x16a0,0x156));var _0x016a=function(_0xe90990,_0x539ad6){_0xe90990=_0xe90990-0x0;var _0x3d7171=_0x16a0[_0xe90990];return _0x3d7171;};'use strict';var multer=require(_0x016a('0x0'));var util=require(_0x016a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x016a('0x2'));var router=express[_0x016a('0x3')]();var fs_extra=require(_0x016a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x016a('0x5'));var controller=require(_0x016a('0x6'));router[_0x016a('0x7')]('/',controller[_0x016a('0x8')]);router['put'](_0x016a('0x9'),auth[_0x016a('0xa')](),controller['update']);router[_0x016a('0x7')]('/download_log_file',auth[_0x016a('0xa')](),controller[_0x016a('0xb')]);module[_0x016a('0xc')]=router; \ No newline at end of file +var _0xda59=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file'];(function(_0xb45498,_0x50295a){var _0x4e1885=function(_0x11c1f6){while(--_0x11c1f6){_0xb45498['push'](_0xb45498['shift']());}};_0x4e1885(++_0x50295a);}(_0xda59,0x1e0));var _0x9da5=function(_0x183481,_0x20511a){_0x183481=_0x183481-0x0;var _0x2b102d=_0xda59[_0x183481];return _0x2b102d;};'use strict';var multer=require(_0x9da5('0x0'));var util=require(_0x9da5('0x1'));var path=require(_0x9da5('0x2'));var timeout=require(_0x9da5('0x3'));var express=require(_0x9da5('0x4'));var router=express[_0x9da5('0x5')]();var fs_extra=require(_0x9da5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9da5('0x7'));var controller=require(_0x9da5('0x8'));router[_0x9da5('0x9')]('/',controller[_0x9da5('0xa')]);router[_0x9da5('0xb')](_0x9da5('0xc'),auth[_0x9da5('0xd')](),controller[_0x9da5('0xe')]);router['get'](_0x9da5('0xf'),auth[_0x9da5('0xd')](),controller['downloadLogFile']);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 fac4c7c..253e7ce 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 _0x87fe=['INTEGER','exports','TEXT'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x87fe,0x10f));var _0xe87f=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0x87fe[_0x37fcda];return _0xf5ed91;};'use strict';var Sequelize=require('sequelize');module[_0xe87f('0x0')]={'license':{'type':Sequelize[_0xe87f('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe87f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ed5=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x441db3,_0x10f359){var _0x16c05d=function(_0x4c0d4e){while(--_0x4c0d4e){_0x441db3['push'](_0x441db3['shift']());}};_0x16c05d(++_0x10f359);}(_0x7ed5,0x143));var _0x57ed=function(_0x553451,_0x4a3c70){_0x553451=_0x553451-0x0;var _0x37d836=_0x7ed5[_0x553451];return _0x37d836;};'use strict';var Sequelize=require(_0x57ed('0x0'));module[_0x57ed('0x1')]={'license':{'type':Sequelize[_0x57ed('0x2')]},'data1':{'type':Sequelize[_0x57ed('0x3')]},'data2':{'type':Sequelize[_0x57ed('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x57ed('0x4')],'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 43525f6..a253436 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 _0x6a5f=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','Content-Type','download','eml-format'];(function(_0x28c7ea,_0x40df9b){var _0x1a1801=function(_0xdd357d){while(--_0xdd357d){_0x28c7ea['push'](_0x28c7ea['shift']());}};_0x1a1801(++_0x40df9b);}(_0x6a5f,0x1db));var _0xf6a5=function(_0x2e8860,_0x5de6db){_0x2e8860=_0x2e8860-0x0;var _0x449410=_0x6a5f[_0x2e8860];return _0x449410;};'use strict';var emlformat=require(_0xf6a5('0x0'));var rimraf=require(_0xf6a5('0x1'));var zipdir=require(_0xf6a5('0x2'));var jsonpatch=require(_0xf6a5('0x3'));var rp=require(_0xf6a5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf6a5('0x5'));var util=require(_0xf6a5('0x6'));var path=require('path');var sox=require(_0xf6a5('0x7'));var csv=require(_0xf6a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6a5('0x9'));var _=require(_0xf6a5('0xa'));var squel=require('squel');var crypto=require(_0xf6a5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6a5('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf6a5('0xc'));var authService=require(_0xf6a5('0xd'));var qs=require(_0xf6a5('0xe'));var as=require(_0xf6a5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6a5('0x10'))(_0xf6a5('0x11'));var utils=require(_0xf6a5('0x12'));var config=require(_0xf6a5('0x13'));var licenseUtil=require(_0xf6a5('0x14'));var db=require(_0xf6a5('0x15'))['db'];function respondWithStatusCode(_0x50eb9d,_0x4719dc){_0x4719dc=_0x4719dc||0xcc;return function(_0x1a9f7b){if(_0x1a9f7b){return _0x50eb9d[_0xf6a5('0x16')](_0x4719dc);}return _0x50eb9d[_0xf6a5('0x17')](_0x4719dc)[_0xf6a5('0x18')]();};}function respondWithResult(_0x14e790,_0x497c83){_0x497c83=_0x497c83||0xc8;return function(_0x10a93e){if(_0x10a93e){return _0x14e790['status'](_0x497c83)[_0xf6a5('0x19')](_0x10a93e);}};}function respondWithFilteredResult(_0x39425c,_0x2e283c){return function(_0x20b60e){if(_0x20b60e){var _0xdda117=typeof _0x2e283c[_0xf6a5('0x1a')]===_0xf6a5('0x1b')&&typeof _0x2e283c[_0xf6a5('0x1c')]===_0xf6a5('0x1b');var _0x172f3b=_0x20b60e['count'];var _0x222e28=_0xdda117?0x0:_0x2e283c[_0xf6a5('0x1a')];var _0x547159=_0xdda117?_0x20b60e[_0xf6a5('0x1d')]:_0x2e283c[_0xf6a5('0x1a')]+_0x2e283c[_0xf6a5('0x1c')];var _0x3abf88;if(_0x547159>=_0x172f3b){_0x547159=_0x172f3b;_0x3abf88=0xc8;}else{_0x3abf88=0xce;}_0x39425c[_0xf6a5('0x17')](_0x3abf88);return _0x39425c[_0xf6a5('0x1e')](_0xf6a5('0x1f'),_0x222e28+'-'+_0x547159+'/'+_0x172f3b)['json'](_0x20b60e);}return null;};}function patchUpdates(_0x11f674){return function(_0x446be3){try{jsonpatch[_0xf6a5('0x20')](_0x446be3,_0x11f674,!![]);}catch(_0x277269){return BPromise[_0xf6a5('0x21')](_0x277269);}return _0x446be3['save']();};}function saveUpdates(_0x3c16e7,_0x336784){return function(_0x53c349){if(_0x53c349){return _0x53c349[_0xf6a5('0x22')](_0x3c16e7)[_0xf6a5('0x23')](function(_0x51af2a){return _0x51af2a;});}return null;};}function removeEntity(_0x29767a,_0x471482){return function(_0x1c6105){if(_0x1c6105){return _0x1c6105['destroy']()[_0xf6a5('0x23')](function(){_0x29767a[_0xf6a5('0x17')](0xcc)[_0xf6a5('0x18')]();});}};}function handleEntityNotFound(_0x20dba2,_0x16c824){return function(_0x4881bf){if(!_0x4881bf){_0x20dba2[_0xf6a5('0x16')](0x194);}return _0x4881bf;};}function handleError(_0x278398,_0x5cf125){_0x5cf125=_0x5cf125||0x1f4;return function(_0x10d41e){logger['error'](_0x10d41e[_0xf6a5('0x24')]);if(_0x10d41e['name']){delete _0x10d41e['name'];}_0x278398[_0xf6a5('0x17')](_0x5cf125)[_0xf6a5('0x25')](_0x10d41e);};}var utilLicense=require(_0xf6a5('0x14'));exports[_0xf6a5('0x26')]=function(_0x5d5adb,_0xc17345){var _0x12e2de={'raw':!![],'where':{'id':0x1}},_0x572ad8={};_0x572ad8[_0xf6a5('0x27')]=_[_0xf6a5('0x28')](db[_0xf6a5('0x29')][_0xf6a5('0x2a')]);_0x572ad8[_0xf6a5('0x2b')]=_['keys'](_0x5d5adb[_0xf6a5('0x2b')]);_0x572ad8[_0xf6a5('0x2c')]=_[_0xf6a5('0x2d')](_0x572ad8[_0xf6a5('0x27')],_0x572ad8[_0xf6a5('0x2b')]);_0x12e2de[_0xf6a5('0x2e')]=_['intersection'](_0x572ad8[_0xf6a5('0x27')],qs[_0xf6a5('0x2f')](_0x5d5adb[_0xf6a5('0x2b')][_0xf6a5('0x2f')]));_0x12e2de[_0xf6a5('0x2e')]=_0x12e2de['attributes'][_0xf6a5('0x30')]?_0x12e2de[_0xf6a5('0x2e')]:_0x572ad8[_0xf6a5('0x27')];_0x12e2de=_[_0xf6a5('0x31')]({},_0x12e2de,_0x5d5adb['options']);return utilLicense[_0xf6a5('0x32')](_0x12e2de)[_0xf6a5('0x23')](respondWithResult(_0xc17345,null))[_0xf6a5('0x33')](handleError(_0xc17345,null));};exports['update']=function(_0x3a9ab0,_0x465438){if(_0x3a9ab0['body']['id']){delete _0x3a9ab0[_0xf6a5('0x34')]['id'];}return db[_0xf6a5('0x29')][_0xf6a5('0x35')]({'where':{'id':_0x3a9ab0[_0xf6a5('0x36')]['id']}})[_0xf6a5('0x23')](handleEntityNotFound(_0x465438,null))[_0xf6a5('0x23')](function(_0x465ca6){var _0x2310fd=_0x465ca6[_0xf6a5('0x37')]({'plain':!![]});return utilLicense[_0xf6a5('0x38')](_0x2310fd,_0x3a9ab0['body']['key']);})[_0xf6a5('0x23')](function(_0x48ef56){if(!_0x48ef56[_0xf6a5('0x39')]){return saveUpdates(_0x3a9ab0['body'],null);}return _0x48ef56;})[_0xf6a5('0x23')](respondWithResult(_0x465438,null))[_0xf6a5('0x33')](handleError(_0x465438,null));};exports[_0xf6a5('0x3a')]=function(_0x16469d,_0x260400){var _0x50a8e1=_0xf6a5('0x3b');var _0x5f01ed=path[_0xf6a5('0x3c')](_0xf6a5('0x3d'),_0xf6a5('0x3e'),_0xf6a5('0x3f'),_0x50a8e1);_0x260400[_0xf6a5('0x40')](_0xf6a5('0x41'),'attachment;\x20filename='+_0x50a8e1);_0x260400[_0xf6a5('0x1e')](_0xf6a5('0x42'),'text/plain');_0x260400[_0xf6a5('0x43')](_0x5f01ed);}; \ No newline at end of file +var _0xe82d=['/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','keys','License','rawAttributes','query','filters','model','attributes','intersection','fields','merge','options','getLicense','catch','body','find','params','get','key','downloadLogFile','license-info.log','join'];(function(_0x532329,_0x4fdea2){var _0x3e1b20=function(_0x10b325){while(--_0x10b325){_0x532329['push'](_0x532329['shift']());}};_0x3e1b20(++_0x4fdea2);}(_0xe82d,0x1be));var _0xde82=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xe82d[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0xde82('0x0'));var rimraf=require(_0xde82('0x1'));var zipdir=require(_0xde82('0x2'));var jsonpatch=require(_0xde82('0x3'));var rp=require(_0xde82('0x4'));var moment=require(_0xde82('0x5'));var BPromise=require(_0xde82('0x6'));var Mustache=require(_0xde82('0x7'));var util=require(_0xde82('0x8'));var path=require(_0xde82('0x9'));var sox=require(_0xde82('0xa'));var csv=require(_0xde82('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde82('0xc'));var _=require(_0xde82('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde82('0xe'));var deskjs=require(_0xde82('0xf'));var toCsv=require(_0xde82('0xb'));var querystring=require('querystring');var Papa=require(_0xde82('0x10'));var Redis=require(_0xde82('0x11'));var authService=require(_0xde82('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde82('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde82('0x14'))(_0xde82('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde82('0x16'));var db=require(_0xde82('0x17'))['db'];function respondWithStatusCode(_0x8aa91a,_0x3b92cd){_0x3b92cd=_0x3b92cd||0xcc;return function(_0x5e0b66){if(_0x5e0b66){return _0x8aa91a[_0xde82('0x18')](_0x3b92cd);}return _0x8aa91a[_0xde82('0x19')](_0x3b92cd)[_0xde82('0x1a')]();};}function respondWithResult(_0x2b83a4,_0x479fda){_0x479fda=_0x479fda||0xc8;return function(_0x19a918){if(_0x19a918){return _0x2b83a4[_0xde82('0x19')](_0x479fda)[_0xde82('0x1b')](_0x19a918);}};}function respondWithFilteredResult(_0x297c93,_0x426f29){return function(_0x137261){if(_0x137261){var _0x2254f1=typeof _0x426f29['offset']==='undefined'&&typeof _0x426f29[_0xde82('0x1c')]===_0xde82('0x1d');var _0x3037fa=_0x137261[_0xde82('0x1e')];var _0xe142bd=_0x2254f1?0x0:_0x426f29[_0xde82('0x1f')];var _0xe75374=_0x2254f1?_0x137261[_0xde82('0x1e')]:_0x426f29[_0xde82('0x1f')]+_0x426f29['limit'];var _0x515a73;if(_0xe75374>=_0x3037fa){_0xe75374=_0x3037fa;_0x515a73=0xc8;}else{_0x515a73=0xce;}_0x297c93['status'](_0x515a73);return _0x297c93[_0xde82('0x20')](_0xde82('0x21'),_0xe142bd+'-'+_0xe75374+'/'+_0x3037fa)[_0xde82('0x1b')](_0x137261);}return null;};}function patchUpdates(_0x395a2b){return function(_0x2c346f){try{jsonpatch[_0xde82('0x22')](_0x2c346f,_0x395a2b,!![]);}catch(_0x98604e){return BPromise['reject'](_0x98604e);}return _0x2c346f[_0xde82('0x23')]();};}function saveUpdates(_0x2d8399,_0x232d28){return function(_0x2d588a){if(_0x2d588a){return _0x2d588a[_0xde82('0x24')](_0x2d8399)[_0xde82('0x25')](function(_0x9fbf6d){return _0x9fbf6d;});}return null;};}function removeEntity(_0xc2193f,_0x162044){return function(_0x4bf33f){if(_0x4bf33f){return _0x4bf33f[_0xde82('0x26')]()[_0xde82('0x25')](function(){_0xc2193f[_0xde82('0x19')](0xcc)[_0xde82('0x1a')]();});}};}function handleEntityNotFound(_0x47cee0,_0x15f0d4){return function(_0x135e27){if(!_0x135e27){_0x47cee0[_0xde82('0x18')](0x194);}return _0x135e27;};}function handleError(_0xa157b1,_0x25aaa5){_0x25aaa5=_0x25aaa5||0x1f4;return function(_0x1ff068){logger[_0xde82('0x27')](_0x1ff068[_0xde82('0x28')]);if(_0x1ff068[_0xde82('0x29')]){delete _0x1ff068[_0xde82('0x29')];}_0xa157b1[_0xde82('0x19')](_0x25aaa5)[_0xde82('0x2a')](_0x1ff068);};}var utilLicense=require(_0xde82('0x16'));exports[_0xde82('0x2b')]=function(_0x4e8d7a,_0x1fff0e){var _0x4a9c1b={'raw':!![],'where':{'id':0x1}},_0x31e727={};_0x31e727['model']=_[_0xde82('0x2c')](db[_0xde82('0x2d')][_0xde82('0x2e')]);_0x31e727['query']=_['keys'](_0x4e8d7a[_0xde82('0x2f')]);_0x31e727[_0xde82('0x30')]=_['intersection'](_0x31e727[_0xde82('0x31')],_0x31e727[_0xde82('0x2f')]);_0x4a9c1b[_0xde82('0x32')]=_[_0xde82('0x33')](_0x31e727[_0xde82('0x31')],qs[_0xde82('0x34')](_0x4e8d7a[_0xde82('0x2f')][_0xde82('0x34')]));_0x4a9c1b[_0xde82('0x32')]=_0x4a9c1b[_0xde82('0x32')]['length']?_0x4a9c1b[_0xde82('0x32')]:_0x31e727[_0xde82('0x31')];_0x4a9c1b=_[_0xde82('0x35')]({},_0x4a9c1b,_0x4e8d7a[_0xde82('0x36')]);return utilLicense[_0xde82('0x37')](_0x4a9c1b)[_0xde82('0x25')](respondWithResult(_0x1fff0e,null))[_0xde82('0x38')](handleError(_0x1fff0e,null));};exports[_0xde82('0x24')]=function(_0x24de22,_0x5e2a15){if(_0x24de22[_0xde82('0x39')]['id']){delete _0x24de22[_0xde82('0x39')]['id'];}return db['License'][_0xde82('0x3a')]({'where':{'id':_0x24de22[_0xde82('0x3b')]['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x5e2a15,null))['then'](function(_0x2c5166){var _0xa23589=_0x2c5166[_0xde82('0x3c')]({'plain':!![]});return utilLicense['checkLicense'](_0xa23589,_0x24de22[_0xde82('0x39')][_0xde82('0x3d')]);})[_0xde82('0x25')](function(_0x15eb03){if(!_0x15eb03['demo']){return saveUpdates(_0x24de22['body'],null);}return _0x15eb03;})['then'](respondWithResult(_0x5e2a15,null))[_0xde82('0x38')](handleError(_0x5e2a15,null));};exports[_0xde82('0x3e')]=function(_0x467ea6,_0x27466d){var _0x1ba724=_0xde82('0x3f');var _0x2a050f=path[_0xde82('0x40')](_0xde82('0x41'),'log',_0xde82('0x42'),_0x1ba724);_0x27466d[_0xde82('0x43')](_0xde82('0x44'),_0xde82('0x45')+_0x1ba724);_0x27466d[_0xde82('0x20')](_0xde82('0x46'),_0xde82('0x47'));_0x27466d[_0xde82('0x48')](_0x2a050f);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3b66e0c..bd03b0a 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 _0x7958=['path','rimraf','../../config/environment','./license.attributes','define','license','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5c3e5d,_0x473376){var _0x2e375b=function(_0x5d41c0){while(--_0x5d41c0){_0x5c3e5d['push'](_0x5c3e5d['shift']());}};_0x2e375b(++_0x473376);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8795('0x0'));var util=require(_0x8795('0x1'));var logger=require('../../config/logger')(_0x8795('0x2'));var moment=require(_0x8795('0x3'));var BPromise=require(_0x8795('0x4'));var rp=require(_0x8795('0x5'));var fs=require('fs');var path=require(_0x8795('0x6'));var rimraf=require(_0x8795('0x7'));var config=require(_0x8795('0x8'));var attributes=require(_0x8795('0x9'));module['exports']=function(_0xed1860,_0x456403){return _0xed1860[_0x8795('0xa')]('License',attributes,{'tableName':_0x8795('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4634=['moment','request-promise','path','rimraf','./license.attributes','exports','define','License','license','lodash','util','api'];(function(_0x53e4e9,_0x42fef9){var _0x4fffc1=function(_0x1a5ccc){while(--_0x1a5ccc){_0x53e4e9['push'](_0x53e4e9['shift']());}};_0x4fffc1(++_0x42fef9);}(_0x4634,0x81));var _0x4463=function(_0x2e272d,_0x5ec8f7){_0x2e272d=_0x2e272d-0x0;var _0x1a9ea9=_0x4634[_0x2e272d];return _0x1a9ea9;};'use strict';var _=require(_0x4463('0x0'));var util=require(_0x4463('0x1'));var logger=require('../../config/logger')(_0x4463('0x2'));var moment=require(_0x4463('0x3'));var BPromise=require('bluebird');var rp=require(_0x4463('0x4'));var fs=require('fs');var path=require(_0x4463('0x5'));var rimraf=require(_0x4463('0x6'));var config=require('../../config/environment');var attributes=require(_0x4463('0x7'));module[_0x4463('0x8')]=function(_0x3e81ba,_0x27a4a0){return _0x3e81ba[_0x4463('0x9')](_0x4463('0xa'),attributes,{'tableName':_0x4463('0xb'),'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 930c106..e34b4f3 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 _0x28f3=['error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x12ac41,_0x416f99){var _0x41f4f2=function(_0x2bfc5b){while(--_0x2bfc5b){_0x12ac41['push'](_0x12ac41['shift']());}};_0x41f4f2(++_0x416f99);}(_0x28f3,0xd6));var _0x328f=function(_0x232a47,_0x36498e){_0x232a47=_0x232a47-0x0;var _0x1ba6ee=_0x28f3[_0x232a47];return _0x1ba6ee;};'use strict';var _=require(_0x328f('0x0'));var util=require(_0x328f('0x1'));var moment=require('moment');var BPromise=require(_0x328f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328f('0x3'));var db=require(_0x328f('0x4'))['db'];var utils=require(_0x328f('0x5'));var logger=require(_0x328f('0x6'))(_0x328f('0x7'));var config=require(_0x328f('0x8'));var jayson=require(_0x328f('0x9'));var client=jayson['client'][_0x328f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x293fe1,_0xc1d28a,_0x63fe1e){return new BPromise(function(_0x2e244d,_0x2aff18){return client[_0x328f('0xb')](_0x293fe1,_0x63fe1e)[_0x328f('0xc')](function(_0xf13c8e){logger['info'](_0x328f('0xd'),_0xc1d28a,_0x328f('0xe'));logger[_0x328f('0xf')]('License,\x20%s,\x20%s,\x20%s',_0xc1d28a,'request\x20sent',JSON[_0x328f('0x10')](_0xf13c8e));if(_0xf13c8e[_0x328f('0x11')]){if(_0xf13c8e[_0x328f('0x11')][_0x328f('0x12')]===0x1f4){logger[_0x328f('0x11')]('License,\x20%s,\x20%s',_0xc1d28a,_0xf13c8e[_0x328f('0x11')][_0x328f('0x13')]);return _0x2aff18(_0xf13c8e[_0x328f('0x11')][_0x328f('0x13')]);}logger[_0x328f('0x11')](_0x328f('0xd'),_0xc1d28a,_0xf13c8e[_0x328f('0x11')][_0x328f('0x13')]);return _0x2e244d(_0xf13c8e[_0x328f('0x11')][_0x328f('0x13')]);}else{logger['info'](_0x328f('0xd'),_0xc1d28a,_0x328f('0xe'));_0x2e244d(_0xf13c8e['result'][_0x328f('0x13')]);}})[_0x328f('0x14')](function(_0x255148){logger[_0x328f('0x11')](_0x328f('0xd'),_0xc1d28a,_0x255148);_0x2aff18(_0x255148);});});} \ No newline at end of file +var _0x45b3=['request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x179ad2,_0x586860){var _0xa8c1c=function(_0x1d483f){while(--_0x1d483f){_0x179ad2['push'](_0x179ad2['shift']());}};_0xa8c1c(++_0x586860);}(_0x45b3,0x1e1));var _0x345b=function(_0x53af8d,_0x577e1a){_0x53af8d=_0x53af8d-0x0;var _0x5548cc=_0x45b3[_0x53af8d];return _0x5548cc;};'use strict';var _=require(_0x345b('0x0'));var util=require(_0x345b('0x1'));var moment=require(_0x345b('0x2'));var BPromise=require(_0x345b('0x3'));var rs=require(_0x345b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x345b('0x5'))['db'];var utils=require(_0x345b('0x6'));var logger=require(_0x345b('0x7'))(_0x345b('0x8'));var config=require(_0x345b('0x9'));var jayson=require(_0x345b('0xa'));var client=jayson[_0x345b('0xb')][_0x345b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3048d1,_0xf7689e,_0x48e803){return new BPromise(function(_0x1c113e,_0xb372e3){return client[_0x345b('0xd')](_0x3048d1,_0x48e803)[_0x345b('0xe')](function(_0x16d9ea){logger[_0x345b('0xf')]('License,\x20%s,\x20%s',_0xf7689e,_0x345b('0x10'));logger[_0x345b('0x11')](_0x345b('0x12'),_0xf7689e,_0x345b('0x10'),JSON[_0x345b('0x13')](_0x16d9ea));if(_0x16d9ea[_0x345b('0x14')]){if(_0x16d9ea[_0x345b('0x14')][_0x345b('0x15')]===0x1f4){logger['error'](_0x345b('0x16'),_0xf7689e,_0x16d9ea[_0x345b('0x14')][_0x345b('0x17')]);return _0xb372e3(_0x16d9ea['error'][_0x345b('0x17')]);}logger['error']('License,\x20%s,\x20%s',_0xf7689e,_0x16d9ea['error'][_0x345b('0x17')]);return _0x1c113e(_0x16d9ea[_0x345b('0x14')][_0x345b('0x17')]);}else{logger[_0x345b('0xf')](_0x345b('0x16'),_0xf7689e,'request\x20sent');_0x1c113e(_0x16d9ea[_0x345b('0x18')]['message']);}})[_0x345b('0x19')](function(_0x13ab16){logger[_0x345b('0x14')]('License,\x20%s,\x20%s',_0xf7689e,_0x13ab16);_0xb372e3(_0x13ab16);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 8425e1f..a66059f 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 _0x118c=['getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','addImap','addInteraction','/:id/applications','addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions'];(function(_0x1cb0cb,_0x228958){var _0x100da8=function(_0x430259){while(--_0x430259){_0x1cb0cb['push'](_0x1cb0cb['shift']());}};_0x100da8(++_0x228958);}(_0x118c,0x132));var _0xc118=function(_0x91ae2,_0x43bbf5){_0x91ae2=_0x91ae2-0x0;var _0x9c07da=_0x118c[_0x91ae2];return _0x9c07da;};'use strict';var multer=require(_0xc118('0x0'));var util=require('util');var path=require(_0xc118('0x1'));var timeout=require(_0xc118('0x2'));var express=require(_0xc118('0x3'));var router=express[_0xc118('0x4')]();var fs_extra=require(_0xc118('0x5'));var auth=require(_0xc118('0x6'));var interaction=require(_0xc118('0x7'));var config=require(_0xc118('0x8'));var controller=require(_0xc118('0x9'));router[_0xc118('0xa')]('/',auth[_0xc118('0xb')](),controller['index']);router[_0xc118('0xa')](_0xc118('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc118('0xd'),auth[_0xc118('0xb')](),controller[_0xc118('0xe')]);router['get'](_0xc118('0xf'),auth[_0xc118('0xb')](),controller[_0xc118('0x10')]);router['get'](_0xc118('0x11'),auth[_0xc118('0xb')](),controller[_0xc118('0x12')]);router[_0xc118('0xa')](_0xc118('0x13'),auth[_0xc118('0xb')](),controller[_0xc118('0x14')]);router['get'](_0xc118('0x15'),auth[_0xc118('0xb')](),controller[_0xc118('0x16')]);router[_0xc118('0xa')](_0xc118('0x17'),auth['isAuthenticated'](),controller[_0xc118('0x18')]);router['get']('/:id/applications',auth[_0xc118('0xb')](),controller['getApplications']);router['get'](_0xc118('0x19'),auth[_0xc118('0xb')](),controller['getMessages']);router[_0xc118('0xa')](_0xc118('0x1a'),auth[_0xc118('0xb')](),controller['verifySmtp']);router[_0xc118('0xa')](_0xc118('0x1b'),auth[_0xc118('0xb')](),controller[_0xc118('0x1c')]);router['post'](_0xc118('0xf'),auth[_0xc118('0xb')](),controller[_0xc118('0x1d')]);router[_0xc118('0x1e')](_0xc118('0x11'),auth[_0xc118('0xb')](),controller[_0xc118('0x1f')]);router[_0xc118('0x1e')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc118('0x1e')](_0xc118('0x13'),auth[_0xc118('0xb')](),controller[_0xc118('0x20')]);router['post'](_0xc118('0x15'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xc118('0x1e')](_0xc118('0x17'),auth[_0xc118('0xb')](),controller[_0xc118('0x21')]);router['post'](_0xc118('0x22'),auth[_0xc118('0xb')](),controller[_0xc118('0x23')]);router['post'](_0xc118('0x24'),auth[_0xc118('0xb')](),controller['send']);router['post']('/:id/users',auth[_0xc118('0xb')](),controller[_0xc118('0x25')]);router[_0xc118('0x26')](_0xc118('0xd'),auth[_0xc118('0xb')](),controller['update']);router[_0xc118('0x27')](_0xc118('0xf'),auth['isAuthenticated'](),controller[_0xc118('0x28')]);router[_0xc118('0x27')](_0xc118('0x11'),auth[_0xc118('0xb')](),controller[_0xc118('0x29')]);router[_0xc118('0x27')](_0xc118('0x13'),auth[_0xc118('0xb')](),controller['removeImap']);router[_0xc118('0x27')](_0xc118('0x15'),auth[_0xc118('0xb')](),controller[_0xc118('0x2a')]);router[_0xc118('0x27')]('/:id',auth[_0xc118('0xb')](),controller[_0xc118('0x2b')]);router[_0xc118('0x27')](_0xc118('0x1b'),auth['isAuthenticated'](),controller[_0xc118('0x2c')]);module[_0xc118('0x2d')]=router; \ No newline at end of file +var _0x3eb1=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addDisposition','addAnswer','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout'];(function(_0x26aa24,_0xcd5d8c){var _0xf90f88=function(_0x113459){while(--_0x113459){_0x26aa24['push'](_0x26aa24['shift']());}};_0xf90f88(++_0xcd5d8c);}(_0x3eb1,0x101));var _0x13eb=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x3eb1[_0x22bdd3];return _0x44d9d9;};'use strict';var multer=require(_0x13eb('0x0'));var util=require(_0x13eb('0x1'));var path=require('path');var timeout=require(_0x13eb('0x2'));var express=require(_0x13eb('0x3'));var router=express['Router']();var fs_extra=require(_0x13eb('0x4'));var auth=require(_0x13eb('0x5'));var interaction=require(_0x13eb('0x6'));var config=require(_0x13eb('0x7'));var controller=require(_0x13eb('0x8'));router['get']('/',auth[_0x13eb('0x9')](),controller[_0x13eb('0xa')]);router[_0x13eb('0xb')](_0x13eb('0xc'),auth[_0x13eb('0x9')](),controller[_0x13eb('0xd')]);router[_0x13eb('0xb')](_0x13eb('0xe'),auth[_0x13eb('0x9')](),controller[_0x13eb('0xf')]);router['get'](_0x13eb('0x10'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x11')]);router[_0x13eb('0xb')](_0x13eb('0x12'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x13')]);router['get'](_0x13eb('0x14'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x15')]);router['get']('/:id/out_servers',auth[_0x13eb('0x9')](),controller[_0x13eb('0x16')]);router[_0x13eb('0xb')](_0x13eb('0x17'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x18')]);router[_0x13eb('0xb')](_0x13eb('0x19'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x1a')]);router[_0x13eb('0xb')](_0x13eb('0x1b'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x1c')]);router[_0x13eb('0xb')](_0x13eb('0x1d'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x13eb('0xb')](_0x13eb('0x1e'),auth[_0x13eb('0x9')](),controller['getAgents']);router[_0x13eb('0x1f')](_0x13eb('0x10'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x20')]);router['post'](_0x13eb('0x12'),auth['isAuthenticated'](),controller[_0x13eb('0x21')]);router['post']('/',auth[_0x13eb('0x9')](),controller['create']);router['post'](_0x13eb('0x14'),auth['isAuthenticated'](),controller[_0x13eb('0x22')]);router[_0x13eb('0x1f')](_0x13eb('0x23'),auth['isAuthenticated'](),controller[_0x13eb('0x24')]);router[_0x13eb('0x1f')](_0x13eb('0x17'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x25')]);router[_0x13eb('0x1f')](_0x13eb('0x19'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x26')]);router[_0x13eb('0x1f')](_0x13eb('0x27'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x28')]);router[_0x13eb('0x1f')]('/:id/users',auth[_0x13eb('0x9')](),controller[_0x13eb('0x29')]);router[_0x13eb('0x2a')](_0x13eb('0xe'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x2b')]);router[_0x13eb('0x2c')](_0x13eb('0x10'),auth['isAuthenticated'](),controller[_0x13eb('0x2d')]);router[_0x13eb('0x2c')](_0x13eb('0x12'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x2e')]);router[_0x13eb('0x2c')](_0x13eb('0x14'),auth['isAuthenticated'](),controller[_0x13eb('0x2f')]);router[_0x13eb('0x2c')](_0x13eb('0x23'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x30')]);router[_0x13eb('0x2c')](_0x13eb('0xe'),auth['isAuthenticated'](),controller[_0x13eb('0x31')]);router[_0x13eb('0x2c')](_0x13eb('0x1e'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x32')]);module[_0x13eb('0x33')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 792c596..640282e 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 _0xdc34=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','hotmail','yahoo','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x13326f,_0x5c7383){var _0x213f16=function(_0x5dc309){while(--_0x5dc309){_0x13326f['push'](_0x13326f['shift']());}};_0x213f16(++_0x5c7383);}(_0xdc34,0x108));var _0x4dc3=function(_0x9f73c8,_0x3d010b){_0x9f73c8=_0x9f73c8-0x0;var _0x3809a0=_0xdc34[_0x9f73c8];return _0x3809a0;};'use strict';var Sequelize=require(_0x4dc3('0x0'));module[_0x4dc3('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4dc3('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x4dc3('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4dc3('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x4dc3('0x4')]},'markAsUnread':{'type':Sequelize[_0x4dc3('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4dc3('0x5')},'fontSize':{'type':Sequelize[_0x4dc3('0x6')](0x2)[_0x4dc3('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4dc3('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x4dc3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4dc3('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4dc3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4dc3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4dc3('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x4dc3('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x43bd81){if(!_0x43bd81)this[_0x4dc3('0x9')](_0x4dc3('0xa'),null);this[_0x4dc3('0x9')](_0x4dc3('0xb'),_0x43bd81);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x4dc3('0xc'),_0x4dc3('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x4dc3('0xe')]('provider'))return _0x4dc3('0xf');return this['getDataValue'](_0x4dc3('0x10'));},'set':function(_0xa9d4de){if(_0xa9d4de==='custom')_0xa9d4de=null;return this[_0x4dc3('0x9')](_0x4dc3('0x10'),_0xa9d4de);}}}; \ No newline at end of file +var _0x0933=['INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','hotmail','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif'];(function(_0x4f8722,_0x47e4ae){var _0x1430eb=function(_0x2c8812){while(--_0x2c8812){_0x4f8722['push'](_0x4f8722['shift']());}};_0x1430eb(++_0x47e4ae);}(_0x0933,0xc7));var _0x3093=function(_0x41706f,_0x4ef0dc){_0x41706f=_0x41706f-0x0;var _0x59b26d=_0x0933[_0x41706f];return _0x59b26d;};'use strict';var Sequelize=require(_0x3093('0x0'));module[_0x3093('0x1')]={'description':{'type':Sequelize[_0x3093('0x2')]},'name':{'type':Sequelize[_0x3093('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3093('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3093('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x3093('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3093('0x4')},'fontSize':{'type':Sequelize[_0x3093('0x5')](0x2)[_0x3093('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3093('0x7')],'defaultValue':function(){return _0x3093('0x8');}},'notificationSound':{'type':Sequelize[_0x3093('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3093('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3093('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3093('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3093('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3093('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3093('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3093('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2bfe8a){if(!_0x2bfe8a)this[_0x3093('0x9')](_0x3093('0xa'),null);this[_0x3093('0x9')](_0x3093('0xb'),_0x2bfe8a);}},'provider':{'type':Sequelize[_0x3093('0xc')]('gmail',_0x3093('0xd'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3093('0xe')]('provider'))return'custom';return this[_0x3093('0xe')](_0x3093('0xf'));},'set':function(_0x1d82e9){if(_0x1d82e9===_0x3093('0x10'))_0x1d82e9=null;return this[_0x3093('0x9')](_0x3093('0xf'),_0x1d82e9);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 67fdf4d..f3cbc5f 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 _0x0a4f=['params','Imap','MailServerOut','Pause','rawAttributes','include','find','body','modernAuthentication','CloudProviderId','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','length','hasOwnProperty','findAll','removeDispositions','ids','CannedAnswer','removeAnswers','provider','custom','email','ListId','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','util','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','MailAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','MailServerIn','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','rows','show'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x0a4f,0x123));var _0xf0a4=function(_0x5e8b40,_0x24c111){_0x5e8b40=_0x5e8b40-0x0;var _0x279c53=_0x0a4f[_0x5e8b40];return _0x279c53;};'use strict';var moment=require(_0xf0a4('0x0'));var BPromise=require('bluebird');var util=require(_0xf0a4('0x1'));var path=require('path');var _=require(_0xf0a4('0x2'));var juice=require(_0xf0a4('0x3'));var Redis=require('ioredis');var qs=require(_0xf0a4('0x4'));var logger=require(_0xf0a4('0x5'))(_0xf0a4('0x6'));var config=require(_0xf0a4('0x7'));var db=require('../../mysqldb')['db'];config[_0xf0a4('0x8')]=_[_0xf0a4('0x9')](config[_0xf0a4('0x8')],{'host':_0xf0a4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')[_0xf0a4('0xb')](socket);var jayson=require(_0xf0a4('0xc'));var client=jayson[_0xf0a4('0xd')][_0xf0a4('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x3c7ca,_0x2f5232,_0x31c967,_0x51a5cd){return new BPromise(function(_0x1bcc44,_0x3e0ff6){var _0x44017f=_0x51a5cd||client;return _0x44017f[_0xf0a4('0xf')](_0x3c7ca,_0x31c967)[_0xf0a4('0x10')](function(_0x3528c7){logger[_0xf0a4('0x11')](_0xf0a4('0x12'),_0x2f5232,_0xf0a4('0x13'));logger['debug'](_0xf0a4('0x14'),_0x2f5232,'request\x20sent',JSON[_0xf0a4('0x15')](_0x3528c7));if(_0x3528c7[_0xf0a4('0x16')]){if(_0x3528c7[_0xf0a4('0x16')][_0xf0a4('0x17')]===0x1f4){logger[_0xf0a4('0x16')](_0xf0a4('0x12'),_0x2f5232,_0x3528c7['error'][_0xf0a4('0x18')]);return _0x3e0ff6(_0x3528c7['error']['message']);}logger['error'](_0xf0a4('0x12'),_0x2f5232,_0x3528c7['error']['message']);return _0x1bcc44(_0x3528c7['error']['message']);}else{logger[_0xf0a4('0x11')](_0xf0a4('0x12'),_0x2f5232,_0xf0a4('0x13'));_0x1bcc44(_0x3528c7[_0xf0a4('0x19')][_0xf0a4('0x18')]);}})[_0xf0a4('0x1a')](function(_0x3ad618){logger['error'](_0xf0a4('0x12'),_0x2f5232,_0x3ad618);_0x3e0ff6(_0x3ad618);});});}function respondWithStatusCode(_0x328ab4,_0x50714e){_0x50714e=_0x50714e||0xcc;return function(_0x4e7349){if(_0x4e7349){return _0x328ab4['sendStatus'](_0x50714e);}return _0x328ab4[_0xf0a4('0x1b')](_0x50714e)[_0xf0a4('0x1c')]();};}function respondWithResult(_0x479788,_0x3da386){_0x3da386=_0x3da386||0xc8;return function(_0x4486af){if(_0x4486af){return _0x479788['status'](_0x3da386)[_0xf0a4('0x1d')](_0x4486af);}};}function respondWithFilteredResult(_0x79e597,_0x1d2d7b){return function(_0x572425){if(_0x572425){var _0x28cd06=typeof _0x1d2d7b[_0xf0a4('0x1e')]===_0xf0a4('0x1f')&&typeof _0x1d2d7b[_0xf0a4('0x20')]==='undefined';var _0x1755a2=_0x572425['count'];var _0xfea3c8=_0x28cd06?0x0:_0x1d2d7b[_0xf0a4('0x1e')];var _0x5d48a8=_0x28cd06?_0x572425[_0xf0a4('0x21')]:_0x1d2d7b[_0xf0a4('0x1e')]+_0x1d2d7b[_0xf0a4('0x20')];var _0x6a3fea;if(_0x5d48a8>=_0x1755a2){_0x5d48a8=_0x1755a2;_0x6a3fea=0xc8;}else{_0x6a3fea=0xce;}_0x79e597[_0xf0a4('0x1b')](_0x6a3fea);return _0x79e597[_0xf0a4('0x22')](_0xf0a4('0x23'),_0xfea3c8+'-'+_0x5d48a8+'/'+_0x1755a2)[_0xf0a4('0x1d')](_0x572425);}return null;};}function saveUpdates(_0x1cee53){return function(_0x23446f){if(_0x23446f){return _0x23446f[_0xf0a4('0x24')](_0x1cee53)['then'](function(_0x41bd87){return _0x41bd87;});}return null;};}function removeEntity(_0x32e25d){return function(_0x24f22b){if(_0x24f22b){return _0x24f22b['destroy']()[_0xf0a4('0x10')](function(){var _0x3589eb=_0x24f22b[_0xf0a4('0x25')]({'plain':!![]});var _0x3e15e2=_0xf0a4('0x26');return db[_0xf0a4('0x27')][_0xf0a4('0x28')]({'where':{'type':_0x3e15e2,'resourceId':_0x3589eb['id']}})[_0xf0a4('0x10')](function(){return _0x24f22b;});})[_0xf0a4('0x10')](function(){_0x32e25d[_0xf0a4('0x1b')](0xcc)[_0xf0a4('0x1c')]();});}};}function handleEntityNotFound(_0x12bd81){return function(_0x617bf9){if(!_0x617bf9){_0x12bd81[_0xf0a4('0x29')](0x194);}return _0x617bf9;};}function handleError(_0x190bf1,_0x52eebe){_0x52eebe=_0x52eebe||0x1f4;return function(_0x4f973c){logger[_0xf0a4('0x16')](_0x4f973c[_0xf0a4('0x2a')]);if(_0x4f973c['name']){delete _0x4f973c[_0xf0a4('0x2b')];}_0x190bf1[_0xf0a4('0x1b')](_0x52eebe)[_0xf0a4('0x2c')](_0x4f973c);};}exports[_0xf0a4('0x2d')]=function(_0x166c0b,_0x3084c4){var _0x33a470={'include':[{'model':db[_0xf0a4('0x2e')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xf0a4('0x2f')},{'model':db['Pause'],'as':_0xf0a4('0x30')}]},_0x34194b={},_0x53f960={'count':0x0,'rows':[]};var _0x358287=_[_0xf0a4('0x31')](db[_0xf0a4('0x32')]['rawAttributes'],function(_0x272b13){return{'name':_0x272b13[_0xf0a4('0x33')],'type':_0x272b13['type']['key']};});_0x34194b[_0xf0a4('0x34')]=_[_0xf0a4('0x31')](_0x358287,_0xf0a4('0x2b'));_0x34194b[_0xf0a4('0x35')]=_[_0xf0a4('0x36')](_0x166c0b['query']);_0x34194b[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0x34194b['model'],_0x34194b[_0xf0a4('0x35')]);_0x33a470['attributes']=_[_0xf0a4('0x38')](_0x34194b[_0xf0a4('0x34')],qs[_0xf0a4('0x39')](_0x166c0b[_0xf0a4('0x35')][_0xf0a4('0x39')]));_0x33a470[_0xf0a4('0x3a')]=_0x33a470[_0xf0a4('0x3a')]['length']?_0x33a470[_0xf0a4('0x3a')]:_0x34194b[_0xf0a4('0x34')];if(!_0x166c0b[_0xf0a4('0x35')]['hasOwnProperty'](_0xf0a4('0x3b'))){_0x33a470[_0xf0a4('0x20')]=qs['limit'](_0x166c0b[_0xf0a4('0x35')][_0xf0a4('0x20')]);_0x33a470['offset']=qs[_0xf0a4('0x1e')](_0x166c0b['query'][_0xf0a4('0x1e')]);}_0x33a470[_0xf0a4('0x3c')]=qs[_0xf0a4('0x3d')](_0x166c0b[_0xf0a4('0x35')]['sort']);_0x33a470[_0xf0a4('0x3e')]=qs['filters'](_[_0xf0a4('0x3f')](_0x166c0b['query'],_0x34194b[_0xf0a4('0x37')]),_0x358287);if(_0x166c0b[_0xf0a4('0x35')][_0xf0a4('0x40')]){_0x33a470[_0xf0a4('0x3e')]=_[_0xf0a4('0x41')](_0x33a470[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x358287,function(_0x4eac23){if(_0x4eac23[_0xf0a4('0x42')]!=='VIRTUAL'){var _0x22ffd0={};_0x22ffd0[_0x4eac23[_0xf0a4('0x2b')]]={'$like':'%'+_0x166c0b['query'][_0xf0a4('0x40')]+'%'};return _0x22ffd0;}})});}_0x33a470=_['merge']({},_0x33a470,_0x166c0b[_0xf0a4('0x43')]);var _0x582194={'where':_0x33a470[_0xf0a4('0x3e')]};return db[_0xf0a4('0x32')][_0xf0a4('0x21')](_0x582194)['then'](function(_0x8bb94c){_0x53f960[_0xf0a4('0x21')]=_0x8bb94c;if(_0x166c0b[_0xf0a4('0x35')][_0xf0a4('0x44')]){_0x33a470['include']=[{'all':!![]}];}return db[_0xf0a4('0x32')]['findAll'](_0x33a470);})[_0xf0a4('0x10')](function(_0x35cabb){_0x53f960[_0xf0a4('0x45')]=_0x35cabb;return _0x53f960;})[_0xf0a4('0x10')](respondWithFilteredResult(_0x3084c4,_0x33a470))[_0xf0a4('0x1a')](handleError(_0x3084c4,null));};exports[_0xf0a4('0x46')]=function(_0x294d15,_0x1eb4f1){var _0x1b79f9={'raw':![],'where':{'id':_0x294d15[_0xf0a4('0x47')]['id']},'include':[{'model':db[_0xf0a4('0x2e')],'as':_0xf0a4('0x48')},{'model':db[_0xf0a4('0x49')],'as':_0xf0a4('0x2f')},{'model':db[_0xf0a4('0x4a')],'as':_0xf0a4('0x30')}]},_0x1c695c={};_0x1c695c[_0xf0a4('0x34')]=_[_0xf0a4('0x36')](db[_0xf0a4('0x32')][_0xf0a4('0x4b')]);_0x1c695c['query']=_[_0xf0a4('0x36')](_0x294d15[_0xf0a4('0x35')]);_0x1c695c[_0xf0a4('0x37')]=_['intersection'](_0x1c695c[_0xf0a4('0x34')],_0x1c695c[_0xf0a4('0x35')]);_0x1b79f9[_0xf0a4('0x3a')]=_[_0xf0a4('0x38')](_0x1c695c[_0xf0a4('0x34')],qs[_0xf0a4('0x39')](_0x294d15['query'][_0xf0a4('0x39')]));_0x1b79f9['attributes']=_0x1b79f9[_0xf0a4('0x3a')]['length']?_0x1b79f9[_0xf0a4('0x3a')]:_0x1c695c['model'];if(_0x294d15[_0xf0a4('0x35')]['includeAll']){_0x1b79f9[_0xf0a4('0x4c')]=[{'all':!![]}];}_0x1b79f9=_[_0xf0a4('0x41')]({},_0x1b79f9,_0x294d15[_0xf0a4('0x43')]);return db['MailAccount'][_0xf0a4('0x4d')](_0x1b79f9)[_0xf0a4('0x10')](handleEntityNotFound(_0x1eb4f1,null))[_0xf0a4('0x10')](respondWithResult(_0x1eb4f1,null))[_0xf0a4('0x1a')](handleError(_0x1eb4f1,null));};exports[_0xf0a4('0x24')]=function(_0x3b06d3,_0x31ac0b){if(_0x3b06d3[_0xf0a4('0x4e')]['id']){delete _0x3b06d3['body']['id'];}if(_0x3b06d3['body']['Imap']){if(!_0x3b06d3['body'][_0xf0a4('0x48')][_0xf0a4('0x4f')]){_0x3b06d3[_0xf0a4('0x4e')][_0xf0a4('0x48')][_0xf0a4('0x50')]=null;}}if(_0x3b06d3[_0xf0a4('0x4e')][_0xf0a4('0x2f')]){if(!_0x3b06d3['body'][_0xf0a4('0x2f')][_0xf0a4('0x4f')]){_0x3b06d3[_0xf0a4('0x4e')][_0xf0a4('0x2f')][_0xf0a4('0x50')]=null;}}return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x3b06d3['params']['id']},'include':[{'model':db[_0xf0a4('0x2e')],'as':_0xf0a4('0x48')},{'model':db[_0xf0a4('0x49')],'as':_0xf0a4('0x2f')},{'model':db[_0xf0a4('0x4a')],'as':_0xf0a4('0x30')}]})[_0xf0a4('0x10')](handleEntityNotFound(_0x31ac0b,null))[_0xf0a4('0x10')](saveUpdates(_0x3b06d3[_0xf0a4('0x4e')],null))[_0xf0a4('0x10')](function(_0x48aa89){if(_0x48aa89&&_0x3b06d3[_0xf0a4('0x4e')][_0xf0a4('0x48')]){return db[_0xf0a4('0x2e')][_0xf0a4('0x24')](_0x3b06d3[_0xf0a4('0x4e')][_0xf0a4('0x48')],{'where':{'MailAccountId':_0x48aa89['id']}})[_0xf0a4('0x10')](function(){return _0x48aa89;});}return _0x48aa89;})['then'](function(_0x53421e){if(_0x53421e&&_0x3b06d3[_0xf0a4('0x4e')]['Smtp']){return db['MailServerOut'][_0xf0a4('0x24')](_0x3b06d3['body'][_0xf0a4('0x2f')],{'where':{'MailAccountId':_0x53421e['id']}})['then'](function(){return _0x53421e;});}return _0x53421e;})[_0xf0a4('0x10')](respondWithResult(_0x31ac0b,null))[_0xf0a4('0x1a')](handleError(_0x31ac0b,null));};exports['describe']=function(_0x4c47bd,_0x4000f5){return db[_0xf0a4('0x32')][_0xf0a4('0x51')]()[_0xf0a4('0x10')](respondWithResult(_0x4000f5,null))[_0xf0a4('0x1a')](handleError(_0x4000f5,null));};exports[_0xf0a4('0x52')]=function(_0x1e59c2,_0x53e35b){if(_0x1e59c2[_0xf0a4('0x4e')]['id']){delete _0x1e59c2[_0xf0a4('0x4e')]['id'];}return db[_0xf0a4('0x32')]['find']({'where':{'id':_0x1e59c2[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x53e35b,null))[_0xf0a4('0x10')](function(_0x48bcaa){if(_0x48bcaa){_0x1e59c2[_0xf0a4('0x4e')][_0xf0a4('0x53')]=_0x48bcaa['id'];return db[_0xf0a4('0x54')][_0xf0a4('0x55')](_0x1e59c2[_0xf0a4('0x4e')]);}})['then'](respondWithResult(_0x53e35b,null))[_0xf0a4('0x1a')](handleError(_0x53e35b,null));};exports[_0xf0a4('0x56')]=function(_0x68fbb8,_0x28f9b0){var _0x1414cd={'raw':![],'where':{}};var _0x30a057={};var _0x59c845={'count':0x0,'rows':[]};return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x68fbb8[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x28f9b0,null))[_0xf0a4('0x10')](function(_0x2ddf47){if(_0x2ddf47){_0x30a057[_0xf0a4('0x34')]=_[_0xf0a4('0x36')](db[_0xf0a4('0x54')]['rawAttributes']);_0x30a057['query']=_[_0xf0a4('0x36')](_0x68fbb8['query']);_0x30a057[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0x30a057[_0xf0a4('0x34')],_0x30a057['query']);_0x1414cd['attributes']=_[_0xf0a4('0x38')](_0x30a057[_0xf0a4('0x34')],qs['fields'](_0x68fbb8[_0xf0a4('0x35')][_0xf0a4('0x39')]));_0x1414cd[_0xf0a4('0x3a')]=_0x1414cd[_0xf0a4('0x3a')][_0xf0a4('0x58')]?_0x1414cd['attributes']:_0x30a057[_0xf0a4('0x34')];if(!_0x68fbb8['query'][_0xf0a4('0x59')](_0xf0a4('0x3b'))){_0x1414cd[_0xf0a4('0x20')]=qs['limit'](_0x68fbb8['query'][_0xf0a4('0x20')]);_0x1414cd[_0xf0a4('0x1e')]=qs[_0xf0a4('0x1e')](_0x68fbb8['query']['offset']);}_0x1414cd['order']=qs[_0xf0a4('0x3d')](_0x68fbb8[_0xf0a4('0x35')][_0xf0a4('0x3d')]);_0x1414cd['where']=qs[_0xf0a4('0x37')](_['pick'](_0x68fbb8[_0xf0a4('0x35')],_0x30a057['filters']));_0x1414cd[_0xf0a4('0x3e')][_0xf0a4('0x53')]=_0x2ddf47['id'];if(_0x68fbb8[_0xf0a4('0x35')][_0xf0a4('0x40')]){_0x1414cd['where']=_['merge'](_0x1414cd[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x1414cd[_0xf0a4('0x3a')],function(_0x4d714e){var _0x19f164={};_0x19f164[_0x4d714e]={'$like':'%'+_0x68fbb8[_0xf0a4('0x35')][_0xf0a4('0x40')]+'%'};return _0x19f164;})});}_0x1414cd=_[_0xf0a4('0x41')]({},_0x1414cd,_0x68fbb8[_0xf0a4('0x43')]);return db[_0xf0a4('0x54')][_0xf0a4('0x21')]({'where':_0x1414cd['where']})[_0xf0a4('0x10')](function(_0x290896){_0x59c845[_0xf0a4('0x21')]=_0x290896;if(_0x68fbb8[_0xf0a4('0x35')][_0xf0a4('0x44')]){_0x1414cd[_0xf0a4('0x4c')]=[{'all':!![]}];}return db[_0xf0a4('0x54')][_0xf0a4('0x5a')](_0x1414cd);})['then'](function(_0xa03063){_0x59c845['rows']=_0xa03063;return _0x59c845;});}})['then'](respondWithFilteredResult(_0x28f9b0,_0x1414cd))[_0xf0a4('0x1a')](handleError(_0x28f9b0,null));};exports[_0xf0a4('0x5b')]=function(_0x469c6f,_0x2b2877){return db['MailAccount']['find']({'where':{'id':_0x469c6f[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x2b2877,null))[_0xf0a4('0x10')](function(_0x211d6b){if(_0x211d6b){return _0x211d6b[_0xf0a4('0x5b')](_0x469c6f[_0xf0a4('0x35')][_0xf0a4('0x5c')]);}})[_0xf0a4('0x10')](respondWithStatusCode(_0x2b2877,null))[_0xf0a4('0x1a')](handleError(_0x2b2877,null));};exports['addAnswer']=function(_0x2670a1,_0x15bcbc){if(_0x2670a1[_0xf0a4('0x4e')]['id']){delete _0x2670a1[_0xf0a4('0x4e')]['id'];}return db['MailAccount'][_0xf0a4('0x4d')]({'where':{'id':_0x2670a1[_0xf0a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x15bcbc,null))[_0xf0a4('0x10')](function(_0x24b55c){if(_0x24b55c){_0x2670a1[_0xf0a4('0x4e')][_0xf0a4('0x53')]=_0x24b55c['id'];return db[_0xf0a4('0x5d')][_0xf0a4('0x55')](_0x2670a1['body']);}})[_0xf0a4('0x10')](respondWithResult(_0x15bcbc,null))['catch'](handleError(_0x15bcbc,null));};exports['getAnswers']=function(_0x1f3019,_0x2c71e2){var _0x393889={'raw':![],'where':{}};var _0x188a6d={};var _0x193495={'count':0x0,'rows':[]};return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x1f3019[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x2c71e2,null))[_0xf0a4('0x10')](function(_0x2a5c1c){if(_0x2a5c1c){_0x188a6d[_0xf0a4('0x34')]=_['keys'](db[_0xf0a4('0x5d')][_0xf0a4('0x4b')]);_0x188a6d[_0xf0a4('0x35')]=_[_0xf0a4('0x36')](_0x1f3019[_0xf0a4('0x35')]);_0x188a6d[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0x188a6d[_0xf0a4('0x34')],_0x188a6d[_0xf0a4('0x35')]);_0x393889[_0xf0a4('0x3a')]=_[_0xf0a4('0x38')](_0x188a6d['model'],qs['fields'](_0x1f3019[_0xf0a4('0x35')][_0xf0a4('0x39')]));_0x393889[_0xf0a4('0x3a')]=_0x393889['attributes'][_0xf0a4('0x58')]?_0x393889[_0xf0a4('0x3a')]:_0x188a6d[_0xf0a4('0x34')];if(!_0x1f3019[_0xf0a4('0x35')][_0xf0a4('0x59')](_0xf0a4('0x3b'))){_0x393889[_0xf0a4('0x20')]=qs[_0xf0a4('0x20')](_0x1f3019[_0xf0a4('0x35')]['limit']);_0x393889['offset']=qs['offset'](_0x1f3019[_0xf0a4('0x35')]['offset']);}_0x393889[_0xf0a4('0x3c')]=qs[_0xf0a4('0x3d')](_0x1f3019[_0xf0a4('0x35')]['sort']);_0x393889['where']=qs[_0xf0a4('0x37')](_['pick'](_0x1f3019[_0xf0a4('0x35')],_0x188a6d[_0xf0a4('0x37')]));_0x393889['where'][_0xf0a4('0x53')]=_0x2a5c1c['id'];if(_0x1f3019[_0xf0a4('0x35')][_0xf0a4('0x40')]){_0x393889[_0xf0a4('0x3e')]=_[_0xf0a4('0x41')](_0x393889[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x393889[_0xf0a4('0x3a')],function(_0x278ecf){var _0x335b80={};_0x335b80[_0x278ecf]={'$like':'%'+_0x1f3019['query'][_0xf0a4('0x40')]+'%'};return _0x335b80;})});}_0x393889=_['merge']({},_0x393889,_0x1f3019[_0xf0a4('0x43')]);return db[_0xf0a4('0x5d')]['count']({'where':_0x393889[_0xf0a4('0x3e')]})['then'](function(_0x402554){_0x193495[_0xf0a4('0x21')]=_0x402554;if(_0x1f3019[_0xf0a4('0x35')][_0xf0a4('0x44')]){_0x393889['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x393889);})['then'](function(_0x3854f8){_0x193495[_0xf0a4('0x45')]=_0x3854f8;return _0x193495;});}})[_0xf0a4('0x10')](respondWithFilteredResult(_0x2c71e2,_0x393889))['catch'](handleError(_0x2c71e2,null));};exports[_0xf0a4('0x5e')]=function(_0x875dd,_0x28b0d4){return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x875dd['params']['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x28b0d4,null))[_0xf0a4('0x10')](function(_0x48e99b){if(_0x48e99b){return _0x48e99b[_0xf0a4('0x5e')](_0x875dd[_0xf0a4('0x35')][_0xf0a4('0x5c')]);}})[_0xf0a4('0x10')](respondWithStatusCode(_0x28b0d4,null))['catch'](handleError(_0x28b0d4,null));};exports[_0xf0a4('0x55')]=function(_0x33e522,_0x26076a){var _0x38c87b={'name':_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x2b')],'key':_0x33e522[_0xf0a4('0x4e')]['key'],'provider':_0x33e522['body'][_0xf0a4('0x5f')]===_0xf0a4('0x60')?null:_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x5f')],'email':_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x61')],'ListId':_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x62')],'active':!_[_0xf0a4('0x63')](_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x64')])?_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x64')]:!![],'description':_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x65')]||null,'Imap':{},'Smtp':{}};if(_0x38c87b[_0xf0a4('0x5f')]){_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x66')]=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x66')]=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x67')];_0x38c87b['Imap'][_0xf0a4('0x68')]=_0x38c87b['Smtp']['pass']=_0x33e522['body'][_0xf0a4('0x68')];if(_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x4f')]){_0x38c87b['Imap'][_0xf0a4('0x4f')]=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x4f')]=!![];_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x50')]=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x50')]=_0x33e522[_0xf0a4('0x4e')]['CloudProviderId'];_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x68')]=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x69')]=null;}else{_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x50')]=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x50')]=null;}_0x38c87b[_0xf0a4('0x48')]['service']=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x6a')]=null;_0x38c87b[_0xf0a4('0x48')]['host']=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x6b')]=null;_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x6c')]=_0x38c87b['Smtp'][_0xf0a4('0x6c')]=null;}else{if(_0x33e522['body'][_0xf0a4('0x6d')]){_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x66')]=_0x38c87b['Smtp'][_0xf0a4('0x66')]=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x67')];_0x38c87b[_0xf0a4('0x48')]['password']=_0x38c87b['Smtp']['pass']=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x68')];}else{_0x38c87b[_0xf0a4('0x48')]['authentication']=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x6d')]=![];_0x38c87b[_0xf0a4('0x48')]['user']=_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x66')]=null;_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x68')]=_0x38c87b['Smtp'][_0xf0a4('0x69')]=null;}_0x38c87b['Imap'][_0xf0a4('0x6b')]=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x48')][_0xf0a4('0x6b')];_0x38c87b[_0xf0a4('0x48')][_0xf0a4('0x6c')]=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x48')][_0xf0a4('0x6c')];_0x38c87b[_0xf0a4('0x2f')][_0xf0a4('0x6b')]=_0x33e522[_0xf0a4('0x4e')]['Smtp'][_0xf0a4('0x6b')];_0x38c87b['Smtp'][_0xf0a4('0x6c')]=_0x33e522[_0xf0a4('0x4e')][_0xf0a4('0x2f')]['port'];}return db[_0xf0a4('0x32')][_0xf0a4('0x55')](_0x38c87b,{'include':[{'model':db[_0xf0a4('0x49')],'as':_0xf0a4('0x2f')},{'model':db[_0xf0a4('0x2e')],'as':_0xf0a4('0x48')}]})[_0xf0a4('0x10')](function(_0x14c61a){var _0x296b5d=_0x33e522[_0xf0a4('0x66')]['get']({'plain':!![]});if(!_0x296b5d)throw new Error(_0xf0a4('0x6e'));if(_0x296b5d[_0xf0a4('0x6f')]===_0xf0a4('0x66')){var _0x37b655=_0x14c61a[_0xf0a4('0x25')]({'plain':!![]});return db[_0xf0a4('0x70')][_0xf0a4('0x4d')]({'where':{'name':_0xf0a4('0x26'),'userProfileId':_0x296b5d[_0xf0a4('0x71')]},'raw':!![]})[_0xf0a4('0x10')](function(_0x237f57){if(_0x237f57&&_0x237f57[_0xf0a4('0x72')]===0x0){return db[_0xf0a4('0x27')][_0xf0a4('0x55')]({'name':_0x37b655[_0xf0a4('0x2b')],'resourceId':_0x37b655['id'],'type':_0x237f57[_0xf0a4('0x2b')],'sectionId':_0x237f57['id']},{})[_0xf0a4('0x10')](function(){return _0x14c61a;});}else{return _0x14c61a;}})[_0xf0a4('0x1a')](function(_0x4bec79){logger[_0xf0a4('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bec79);throw _0x4bec79;});}return _0x14c61a;})['then'](respondWithResult(_0x26076a,0xc9))[_0xf0a4('0x1a')](handleError(_0x26076a,null));};exports['getImap']=function(_0x171907,_0x5eee90){return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x171907['params']['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x5eee90,null))[_0xf0a4('0x10')](function(_0x5188d2){if(_0x5188d2){return _0x5188d2[_0xf0a4('0x73')]();}return null;})[_0xf0a4('0x10')](respondWithResult(_0x5eee90,null))[_0xf0a4('0x1a')](handleError(_0x5eee90,null));};exports[_0xf0a4('0x74')]=function(_0x555ef3,_0x384b5f){if(_0x555ef3[_0xf0a4('0x4e')]['id']){delete _0x555ef3['body']['id'];}return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x555ef3[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x384b5f,null))[_0xf0a4('0x10')](function(_0x3d8666){if(_0x3d8666){_0x555ef3[_0xf0a4('0x4e')][_0xf0a4('0x53')]=_0x3d8666['id'];return db[_0xf0a4('0x2e')][_0xf0a4('0x55')](_0x555ef3['body']);}})['then'](respondWithResult(_0x384b5f,null))['catch'](handleError(_0x384b5f,null));};exports[_0xf0a4('0x75')]=function(_0x471596,_0x54c2de){return db['MailAccount']['findOne']({'where':{'id':_0x471596['params']['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x54c2de,null))[_0xf0a4('0x10')](function(_0x2a0f2e){if(_0x2a0f2e){return _0x2a0f2e[_0xf0a4('0x76')](null);}return null;})[_0xf0a4('0x10')](respondWithStatusCode(_0x54c2de,null))[_0xf0a4('0x1a')](handleError(_0x54c2de,null));};exports[_0xf0a4('0x77')]=function(_0xe7f880,_0x414f77){return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0xe7f880[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x414f77,null))[_0xf0a4('0x10')](function(_0x573284){if(_0x573284){return _0x573284[_0xf0a4('0x77')]();}return null;})[_0xf0a4('0x10')](respondWithResult(_0x414f77,null))[_0xf0a4('0x1a')](handleError(_0x414f77,null));};exports[_0xf0a4('0x78')]=function(_0x5abc51,_0x4d1550){if(_0x5abc51['body']['id']){delete _0x5abc51['body']['id'];}return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x5abc51[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x4d1550,null))[_0xf0a4('0x10')](function(_0x4d9d14){if(_0x4d9d14){_0x5abc51[_0xf0a4('0x4e')]['MailAccountId']=_0x4d9d14['id'];return db['MailServerOut']['create'](_0x5abc51[_0xf0a4('0x4e')]);}})['then'](respondWithResult(_0x4d1550,null))[_0xf0a4('0x1a')](handleError(_0x4d1550,null));};exports[_0xf0a4('0x79')]=function(_0x55329b,_0x30987c){return db['MailAccount']['findOne']({'where':{'id':_0x55329b['params']['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x30987c,null))[_0xf0a4('0x10')](function(_0x580f7e){if(_0x580f7e){return _0x580f7e[_0xf0a4('0x7a')](null);}return null;})['then'](respondWithStatusCode(_0x30987c,null))[_0xf0a4('0x1a')](handleError(_0x30987c,null));};exports[_0xf0a4('0x7b')]=function(_0x1c57eb,_0x22576b){return db[_0xf0a4('0x7c')][_0xf0a4('0x4d')]({'where':{'id':_0x1c57eb[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x22576b,null))[_0xf0a4('0x10')](function(_0x22962f){if(_0x22962f){return _0x22962f['addInteraction'](_0x1c57eb['body']['ids'],_['omit'](_0x1c57eb[_0xf0a4('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x22576b,null))[_0xf0a4('0x1a')](handleError(_0x22576b,null));};exports[_0xf0a4('0x7d')]=function(_0x58c35c,_0x13e754){var _0x38e089={'raw':![],'where':{}};var _0x449ce5={};var _0x5bc805={'count':0x0,'rows':[]};return db['MailAccount'][_0xf0a4('0x57')]({'where':{'id':_0x58c35c[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x13e754,null))[_0xf0a4('0x10')](function(_0x34682e){if(_0x34682e){_0x449ce5[_0xf0a4('0x34')]=_[_0xf0a4('0x36')](db[_0xf0a4('0x7c')]['rawAttributes']);_0x449ce5[_0xf0a4('0x35')]=_[_0xf0a4('0x36')](_0x58c35c[_0xf0a4('0x35')]);_0x449ce5['filters']=_[_0xf0a4('0x38')](_0x449ce5[_0xf0a4('0x34')],_0x449ce5[_0xf0a4('0x35')]);_0x38e089[_0xf0a4('0x3a')]=_[_0xf0a4('0x38')](_0x449ce5[_0xf0a4('0x34')],qs[_0xf0a4('0x39')](_0x58c35c[_0xf0a4('0x35')]['fields']));_0x38e089[_0xf0a4('0x3a')]=_0x38e089[_0xf0a4('0x3a')][_0xf0a4('0x58')]?_0x38e089[_0xf0a4('0x3a')]:_0x449ce5[_0xf0a4('0x34')];if(!_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x59')]('nolimit')){_0x38e089[_0xf0a4('0x20')]=qs['limit'](_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x20')]);_0x38e089[_0xf0a4('0x1e')]=qs[_0xf0a4('0x1e')](_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x1e')]);}_0x38e089[_0xf0a4('0x3c')]=qs['sort'](_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x3d')]);_0x38e089[_0xf0a4('0x3e')]=qs[_0xf0a4('0x37')](_[_0xf0a4('0x3f')](_0x58c35c[_0xf0a4('0x35')],_0x449ce5['filters']));_0x38e089[_0xf0a4('0x3e')][_0xf0a4('0x53')]=_0x34682e['id'];if(_0x58c35c['query']['filter']){_0x38e089[_0xf0a4('0x3e')]=_[_0xf0a4('0x41')](_0x38e089[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x38e089['attributes'],function(_0x2384b0){var _0x25df70={};_0x25df70[_0x2384b0]={'$like':'%'+_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x40')]+'%'};return _0x25df70;})});}_0x38e089=_[_0xf0a4('0x41')]({},_0x38e089,_0x58c35c['options']);return db[_0xf0a4('0x7c')][_0xf0a4('0x21')]({'where':_0x38e089[_0xf0a4('0x3e')]})['then'](function(_0x4cd374){_0x5bc805['count']=_0x4cd374;if(_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x44')]){_0x38e089[_0xf0a4('0x4c')]=[{'model':db[_0xf0a4('0x7e')],'as':'Contact','required':![]},{'model':db[_0xf0a4('0x7f')],'as':_0xf0a4('0x80'),'attributes':[_0xf0a4('0x2b'),_0xf0a4('0x81'),_0xf0a4('0x82')],'required':![]},{'model':db[_0xf0a4('0x83')],'as':'Tags','attributes':['id',_0xf0a4('0x2b'),'color'],'where':_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x84')]?{'id':_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x84')]}:undefined,'required':_0x58c35c[_0xf0a4('0x35')][_0xf0a4('0x84')]?!![]:![]}];}return db[_0xf0a4('0x7c')][_0xf0a4('0x5a')](_0x38e089);})['then'](function(_0x155203){_0x5bc805[_0xf0a4('0x45')]=_0x155203;return _0x5bc805;});}})['then'](respondWithFilteredResult(_0x13e754,_0x38e089))[_0xf0a4('0x1a')](handleError(_0x13e754,null));};exports[_0xf0a4('0x85')]=function addApplications(_0x284e6,_0x270fad){var _0x2a19ab=_0x284e6[_0xf0a4('0x47')]['id'];var _0x1da1b7=_0x284e6[_0xf0a4('0x4e')];var _0x37e338=0xc8;var _0x6e167f=null;return db[_0xf0a4('0x86')][_0xf0a4('0x87')]({'isolationLevel':db[_0xf0a4('0x86')]['Transaction']['ISOLATION_LEVELS'][_0xf0a4('0x88')]},function(_0x1095bd){return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x2a19ab},'transaction':_0x1095bd})[_0xf0a4('0x10')](function(_0x104cd8){if(_0x104cd8){return db[_0xf0a4('0x89')][_0xf0a4('0x28')]({'where':{'MailAccountId':_0x2a19ab},'transaction':_0x1095bd})[_0xf0a4('0x10')](function(){var _0x5908db=_[_0xf0a4('0x31')](_0x1da1b7,function(_0x5c4cee){_0x5c4cee['MailAccountId']=_0x2a19ab;return _0x5c4cee;});return db[_0xf0a4('0x89')]['bulkCreate'](_0x5908db,{'transaction':_0x1095bd});});}else{_0x37e338=0x194;_0x6e167f=[];}});})[_0xf0a4('0x10')](function(){if(_0x37e338!==0x194){return db[_0xf0a4('0x89')][_0xf0a4('0x8a')]({'where':{'MailAccountId':_0x2a19ab},'order':'priority'})[_0xf0a4('0x10')](function(_0x282b35){_0x6e167f=_0x282b35;});}})[_0xf0a4('0x1a')](function(_0x48d459){_0x37e338=0x1f4;logger[_0xf0a4('0x16')](_0x48d459[_0xf0a4('0x2a')]);if(_0x48d459[_0xf0a4('0x2b')]){delete _0x48d459[_0xf0a4('0x2b')];}_0x6e167f=_0x48d459;})[_0xf0a4('0x8b')](function(){if(_0x6e167f===null){_0x270fad[_0xf0a4('0x29')](_0x37e338);}else{if(_0x37e338===0x1f4){_0x270fad[_0xf0a4('0x1b')](_0x37e338)['send'](_0x6e167f);}else{_0x270fad['status'](_0x37e338)[_0xf0a4('0x1d')](_0x6e167f);}}});};exports[_0xf0a4('0x8c')]=function(_0x966629,_0x585a90){var _0x336fa0={};var _0x4f0ba8={};var _0x8f5297;var _0x5b30c2;return db[_0xf0a4('0x32')]['findOne']({'where':{'id':_0x966629[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x585a90,null))[_0xf0a4('0x10')](function(_0x34a0ed){if(_0x34a0ed){_0x8f5297=_0x34a0ed;_0x4f0ba8[_0xf0a4('0x34')]=_['keys'](db[_0xf0a4('0x89')]['rawAttributes']);_0x4f0ba8['query']=_[_0xf0a4('0x36')](_0x966629[_0xf0a4('0x35')]);_0x4f0ba8[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0x4f0ba8[_0xf0a4('0x34')],_0x4f0ba8[_0xf0a4('0x35')]);_0x336fa0[_0xf0a4('0x3a')]=_[_0xf0a4('0x38')](_0x4f0ba8[_0xf0a4('0x34')],qs[_0xf0a4('0x39')](_0x966629[_0xf0a4('0x35')]['fields']));_0x336fa0[_0xf0a4('0x3a')]=_0x336fa0[_0xf0a4('0x3a')]['length']?_0x336fa0[_0xf0a4('0x3a')]:_0x4f0ba8[_0xf0a4('0x34')];_0x336fa0[_0xf0a4('0x3c')]=qs[_0xf0a4('0x3d')](_0x966629[_0xf0a4('0x35')][_0xf0a4('0x3d')]);_0x336fa0[_0xf0a4('0x3e')]=qs[_0xf0a4('0x37')](_['pick'](_0x966629[_0xf0a4('0x35')],_0x4f0ba8[_0xf0a4('0x37')]));if(_0x966629[_0xf0a4('0x35')]['filter']){_0x336fa0['where']=_[_0xf0a4('0x41')](_0x336fa0['where'],{'$or':_['map'](_0x336fa0['attributes'],function(_0x45a60e){var _0x11963e={};_0x11963e[_0x45a60e]={'$like':'%'+_0x966629['query']['filter']+'%'};return _0x11963e;})});}_0x336fa0=_[_0xf0a4('0x41')]({},_0x336fa0,_0x966629[_0xf0a4('0x43')]);return _0x8f5297[_0xf0a4('0x8c')](_0x336fa0);}})[_0xf0a4('0x10')](function(_0x6ef178){if(_0x6ef178){_0x5b30c2=_0x6ef178[_0xf0a4('0x58')];if(!_0x966629[_0xf0a4('0x35')]['hasOwnProperty'](_0xf0a4('0x3b'))){_0x336fa0[_0xf0a4('0x20')]=qs[_0xf0a4('0x20')](_0x966629['query'][_0xf0a4('0x20')]);_0x336fa0['offset']=qs[_0xf0a4('0x1e')](_0x966629[_0xf0a4('0x35')][_0xf0a4('0x1e')]);}return _0x8f5297['getApplications'](_0x336fa0);}})[_0xf0a4('0x10')](function(_0x112378){if(_0x112378){return _0x112378?{'count':_0x5b30c2,'rows':_0x112378}:null;}})[_0xf0a4('0x10')](respondWithResult(_0x585a90,null))[_0xf0a4('0x1a')](handleError(_0x585a90,null));};exports[_0xf0a4('0x8d')]=function(_0x537e3c,_0x1f89a6){var _0x58469b={'raw':!![],'where':{}};var _0xd86eb5={};var _0x1f8782={'count':0x0,'rows':[]};return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x537e3c[_0xf0a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f89a6,null))[_0xf0a4('0x10')](function(_0x4033e8){if(_0x4033e8){_0xd86eb5['model']=_['keys'](db[_0xf0a4('0x8e')][_0xf0a4('0x4b')]);_0xd86eb5[_0xf0a4('0x35')]=_[_0xf0a4('0x36')](_0x537e3c[_0xf0a4('0x35')]);_0xd86eb5[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0xd86eb5['model'],_0xd86eb5[_0xf0a4('0x35')]);_0x58469b['attributes']=_[_0xf0a4('0x38')](_0xd86eb5[_0xf0a4('0x34')],qs['fields'](_0x537e3c[_0xf0a4('0x35')][_0xf0a4('0x39')]));_0x58469b[_0xf0a4('0x3a')]=_0x58469b[_0xf0a4('0x3a')]['length']?_0x58469b[_0xf0a4('0x3a')]:_0xd86eb5[_0xf0a4('0x34')];if(!_0x537e3c[_0xf0a4('0x35')]['hasOwnProperty']('nolimit')){_0x58469b[_0xf0a4('0x20')]=qs['limit'](_0x537e3c[_0xf0a4('0x35')][_0xf0a4('0x20')]);_0x58469b['offset']=qs[_0xf0a4('0x1e')](_0x537e3c[_0xf0a4('0x35')][_0xf0a4('0x1e')]);}_0x58469b[_0xf0a4('0x3c')]=qs[_0xf0a4('0x3d')](_0x537e3c[_0xf0a4('0x35')]['sort']);_0x58469b[_0xf0a4('0x3e')]=qs[_0xf0a4('0x37')](_['pick'](_0x537e3c[_0xf0a4('0x35')],_0xd86eb5['filters']));_0x58469b['where'][_0xf0a4('0x53')]=_0x4033e8['id'];if(_0x537e3c['query'][_0xf0a4('0x40')]){_0x58469b[_0xf0a4('0x3e')]=_[_0xf0a4('0x41')](_0x58469b[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x58469b['attributes'],function(_0x2ed2e8){var _0xc2b42={};_0xc2b42[_0x2ed2e8]={'$like':'%'+_0x537e3c[_0xf0a4('0x35')][_0xf0a4('0x40')]+'%'};return _0xc2b42;})});}if(_0x537e3c['query'][_0xf0a4('0x8f')]){var _0x5e5f59=_0x537e3c['query']['$gte'][_0xf0a4('0x90')](',');var _0x517caa={};_0x517caa[_0x5e5f59[0x0]]={'$gte':moment(_0x5e5f59[0x1])[_0xf0a4('0x91')](_0xf0a4('0x92'))};_0x58469b[_0xf0a4('0x3e')]=_['merge'](_0x58469b[_0xf0a4('0x3e')],_0x517caa);}_0x58469b=_['merge']({},_0x58469b,_0x537e3c[_0xf0a4('0x43')]);return db[_0xf0a4('0x8e')][_0xf0a4('0x21')]({'where':_0x58469b[_0xf0a4('0x3e')]})['then'](function(_0xe114ba){_0x1f8782['count']=_0xe114ba;if(_0x537e3c[_0xf0a4('0x35')][_0xf0a4('0x44')]){_0x58469b[_0xf0a4('0x4c')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x58469b);})[_0xf0a4('0x10')](function(_0x459c44){if(_0x537e3c[_0xf0a4('0x35')]['inlineCss']==='true'){for(var _0x5e00b2=0x0;_0x5e00b2<_0x459c44[_0xf0a4('0x58')];_0x5e00b2++){_0x459c44[_0x5e00b2]['body']=juice(_0x459c44[_0x5e00b2][_0xf0a4('0x4e')]);}}_0x1f8782[_0xf0a4('0x45')]=_0x459c44;return _0x1f8782;});}})[_0xf0a4('0x10')](respondWithFilteredResult(_0x1f89a6,_0x58469b))['catch'](handleError(_0x1f89a6,null));};exports[_0xf0a4('0x2c')]=function(_0x5080cd,_0x183a89){var _0x5b44cd,_0x4853de={},_0x57a335;if(_0x5080cd['body']['to']){_0x57a335=_0x5080cd[_0xf0a4('0x4e')]['to'][_0xf0a4('0x90')](',')[0x0];}return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x5080cd[_0xf0a4('0x47')]['id']},'include':[{'model':db[_0xf0a4('0x93')],'as':_0xf0a4('0x94'),'include':[{'model':db[_0xf0a4('0x7e')],'as':_0xf0a4('0x95'),'where':{'email':_0x57a335},'limit':0x1,'order':[[_0xf0a4('0x96'),_0xf0a4('0x97')]]}]},{'model':db[_0xf0a4('0x49')],'as':_0xf0a4('0x2f'),'raw':!![],'include':[{'model':db[_0xf0a4('0x98')],'as':_0xf0a4('0x98'),'raw':!![]}]}]})[_0xf0a4('0x10')](handleEntityNotFound(_0x183a89,null))[_0xf0a4('0x10')](function(_0x1978d5){if(!_0x1978d5)return;_0x5b44cd=_0x1978d5;if(!_0x1978d5['Smtp'])throw new Error(_0xf0a4('0x99'));if(_['isNil'](_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9a')])){_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9a')]=util[_0xf0a4('0x91')](_0xf0a4('0x9b'),_0x1978d5[_0xf0a4('0x2b')],_0x1978d5[_0xf0a4('0x61')]||_0x1978d5[_0xf0a4('0x2f')][_0xf0a4('0x66')]);}if(_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9c')]&&_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9c')]['length']){for(var _0x51790f=0x0;_0x51790f<_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9c')]['length'];_0x51790f+=0x1){_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9c')][_0x51790f]={'filename':_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0x9c')][_0x51790f][_0xf0a4('0x2b')],'path':path['join'](config[_0xf0a4('0x9d')],_0xf0a4('0x9e'),_0x5080cd[_0xf0a4('0x4e')]['attachments'][_0x51790f][_0xf0a4('0x9f')])};}}var _0xb739b4=_0x1978d5[_0xf0a4('0xa0')]();return respondWithRpcPromise(_0xf0a4('0xa1'),'sendMail',{'account':_0xb739b4,'message':_0x5080cd['body']});})[_0xf0a4('0x10')](function(_0x237408){if(!_0x237408)return;_0x4853de=_0x237408;if(!_0x5b44cd['List'])throw new Error(_0xf0a4('0xa2'));if(_0x5b44cd[_0xf0a4('0x94')][_0xf0a4('0x95')][_0xf0a4('0x58')])return _0x5b44cd['List'][_0xf0a4('0x95')][0x0];return db[_0xf0a4('0x7e')]['create'](_['defaults'](_0x5080cd[_0xf0a4('0x4e')],{'firstName':_0x5080cd['body']['to'],'email':_0x5080cd[_0xf0a4('0x4e')]['to'],'phone':_0x5080cd[_0xf0a4('0x4e')]['to'],'ListId':_0x5b44cd[_0xf0a4('0x62')]}));})['then'](function(_0x4b6541){if(!_0x4b6541)return;var _0xf6103c={'UserId':_0x5080cd[_0xf0a4('0x66')]['id'],'ContactId':_0x4b6541['id'],'MailAccountId':_0x5b44cd['id'],'inReplyTo':_0x4853de[_0xf0a4('0xa3')],'to':_0x5080cd['body']['from'],'cc':_0x5080cd[_0xf0a4('0x4e')]['cc'],'subject':_0x5080cd['body']['subject'],'attach':_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0xa4')],'firstMsgDirection':_0xf0a4('0xa5'),'lastMsgAt':moment()[_0xf0a4('0x91')](_0xf0a4('0x92')),'lastMsgDirection':'out','Messages':[_[_0xf0a4('0x41')](_0x5080cd[_0xf0a4('0x4e')],{'messageId':_0x4853de[_0xf0a4('0xa3')],'sentAt':moment()[_0xf0a4('0x91')](_0xf0a4('0x92')),'read':!![],'MailAccountId':_0x5b44cd['id'],'UserId':_0x5080cd['user']['id'],'ContactId':_0x4b6541['id']})]};if(_0x5080cd[_0xf0a4('0x4e')]['Interaction']){_0xf6103c=_[_0xf0a4('0x41')](_0xf6103c,_0x5080cd[_0xf0a4('0x4e')][_0xf0a4('0xa6')]);}return db[_0xf0a4('0x7c')][_0xf0a4('0x55')](_0xf6103c,{'include':[{'model':db[_0xf0a4('0x8e')],'as':_0xf0a4('0xa7')}]});})[_0xf0a4('0x10')](respondWithResult(_0x183a89,null))[_0xf0a4('0x1a')](handleError(_0x183a89,null));};exports[_0xf0a4('0xa8')]=function(_0xc06d59,_0x1efefb){return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0xc06d59['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0xf0a4('0x2f'),'raw':!![],'include':[{'model':db[_0xf0a4('0x98')],'as':_0xf0a4('0x98'),'raw':!![]}]}]})[_0xf0a4('0x10')](handleEntityNotFound(_0x1efefb,null))[_0xf0a4('0x10')](function(_0x4294d0){if(!_0x4294d0['Smtp'])return;var _0x1d152b=_0x4294d0[_0xf0a4('0xa0')]();return respondWithRpcPromise(_0xf0a4('0xa9'),_0xf0a4('0xa8'),{'account':_0x1d152b});})[_0xf0a4('0x10')](respondWithResult(_0x1efefb,null))['catch'](handleError(_0x1efefb,null));};exports[_0xf0a4('0x28')]=function(_0x181095,_0x53d103){return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x181095[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x53d103,null))[_0xf0a4('0x10')](function(_0x14fe3e){if(_0x14fe3e&&_0x14fe3e[_0xf0a4('0x6a')]){throw new db[(_0xf0a4('0xaa'))][(_0xf0a4('0xab'))](_0xf0a4('0xac'));}return _0x14fe3e;})[_0xf0a4('0x10')](removeEntity(_0x53d103,null))[_0xf0a4('0x1a')](handleError(_0x53d103,null));};exports[_0xf0a4('0xad')]=function(_0x2dd8aa,_0x555cd6){return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x2dd8aa['params']['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x555cd6,null))[_0xf0a4('0x10')](function(_0x125bf1){if(_0x125bf1){return _0x125bf1[_0xf0a4('0xad')](_0x2dd8aa[_0xf0a4('0x4e')][_0xf0a4('0x5c')],_['omit'](_0x2dd8aa[_0xf0a4('0x4e')],[_0xf0a4('0x5c'),'id'])||{})[_0xf0a4('0xae')](function(_0x313b3b){for(var _0x24cfcb=0x0;_0x24cfcb<_0x2dd8aa[_0xf0a4('0x4e')][_0xf0a4('0x5c')][_0xf0a4('0x58')];_0x24cfcb+=0x1){socket['emit'](_0xf0a4('0xaf'),{'UserId':Number(_0x2dd8aa[_0xf0a4('0x4e')][_0xf0a4('0x5c')][_0x24cfcb]),'MailAccountId':Number(_0x2dd8aa[_0xf0a4('0x47')]['id'])});}return _0x313b3b;});}})['then'](respondWithResult(_0x555cd6,null))['catch'](handleError(_0x555cd6,null));};exports[_0xf0a4('0xb0')]=function(_0x2ac45b,_0x4bc1a0){return db[_0xf0a4('0x32')][_0xf0a4('0x4d')]({'where':{'id':_0x2ac45b[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x4bc1a0,null))[_0xf0a4('0x10')](function(_0xdf13c9){if(_0xdf13c9){return _0xdf13c9[_0xf0a4('0xb0')](_0x2ac45b['query']['ids'])[_0xf0a4('0x10')](function(){if(_[_0xf0a4('0xb1')](_0x2ac45b[_0xf0a4('0x35')][_0xf0a4('0x5c')])){for(var _0x3abea4=0x0;_0x3abea4<_0x2ac45b[_0xf0a4('0x35')]['ids']['length'];_0x3abea4+=0x1){socket[_0xf0a4('0xb2')](_0xf0a4('0xb3'),{'UserId':Number(_0x2ac45b['query'][_0xf0a4('0x5c')][_0x3abea4]),'MailAccountId':Number(_0x2ac45b[_0xf0a4('0x47')]['id'])});}}else{socket[_0xf0a4('0xb2')]('userMailAccount:remove',{'UserId':Number(_0x2ac45b[_0xf0a4('0x35')][_0xf0a4('0x5c')]),'MailAccountId':Number(_0x2ac45b[_0xf0a4('0x47')]['id'])});}});}})[_0xf0a4('0x10')](respondWithStatusCode(_0x4bc1a0,null))[_0xf0a4('0x1a')](handleError(_0x4bc1a0,null));};exports['getAgents']=function(_0x18a085,_0x49c8dc){var _0x2eeb3b={};var _0x3360d5={};var _0x301728;var _0xbe57e0;return db[_0xf0a4('0x32')][_0xf0a4('0x57')]({'where':{'id':_0x18a085[_0xf0a4('0x47')]['id']}})[_0xf0a4('0x10')](handleEntityNotFound(_0x49c8dc,null))[_0xf0a4('0x10')](function(_0x931d8a){if(_0x931d8a){_0x301728=_0x931d8a;_0x3360d5[_0xf0a4('0x34')]=_[_0xf0a4('0x36')](db[_0xf0a4('0x7f')]['rawAttributes']);_0x3360d5[_0xf0a4('0x35')]=_[_0xf0a4('0x36')](_0x18a085[_0xf0a4('0x35')]);_0x3360d5[_0xf0a4('0x37')]=_[_0xf0a4('0x38')](_0x3360d5[_0xf0a4('0x34')],_0x3360d5[_0xf0a4('0x35')]);_0x2eeb3b[_0xf0a4('0x3a')]=_['intersection'](_0x3360d5[_0xf0a4('0x34')],qs[_0xf0a4('0x39')](_0x18a085['query'][_0xf0a4('0x39')]));_0x2eeb3b[_0xf0a4('0x3a')]=_0x2eeb3b[_0xf0a4('0x3a')][_0xf0a4('0x58')]?_0x2eeb3b[_0xf0a4('0x3a')]:_0x3360d5[_0xf0a4('0x34')];_0x2eeb3b[_0xf0a4('0x3c')]=qs[_0xf0a4('0x3d')](_0x18a085['query'][_0xf0a4('0x3d')]);_0x2eeb3b[_0xf0a4('0x3e')]=qs[_0xf0a4('0x37')](_[_0xf0a4('0x3f')](_0x18a085[_0xf0a4('0x35')],_0x3360d5[_0xf0a4('0x37')]));if(_0x18a085[_0xf0a4('0x35')][_0xf0a4('0x40')]){_0x2eeb3b[_0xf0a4('0x3e')]=_[_0xf0a4('0x41')](_0x2eeb3b[_0xf0a4('0x3e')],{'$or':_[_0xf0a4('0x31')](_0x2eeb3b[_0xf0a4('0x3a')],function(_0x3cabb7){var _0x38a6f8={};_0x38a6f8[_0x3cabb7]={'$like':'%'+_0x18a085['query'][_0xf0a4('0x40')]+'%'};return _0x38a6f8;})});}_0x2eeb3b=_[_0xf0a4('0x41')]({},_0x2eeb3b,_0x18a085['options']);return _0x301728[_0xf0a4('0xb4')](_0x2eeb3b);}})[_0xf0a4('0x10')](function(_0x490189){if(_0x490189){_0xbe57e0=_0x490189['length'];if(!_0x18a085[_0xf0a4('0x35')][_0xf0a4('0x59')]('nolimit')){_0x2eeb3b[_0xf0a4('0x20')]=qs[_0xf0a4('0x20')](_0x18a085['query'][_0xf0a4('0x20')]);_0x2eeb3b[_0xf0a4('0x1e')]=qs[_0xf0a4('0x1e')](_0x18a085[_0xf0a4('0x35')][_0xf0a4('0x1e')]);}return _0x301728[_0xf0a4('0xb4')](_0x2eeb3b);}})[_0xf0a4('0x10')](function(_0x136784){if(_0x136784){return _0x136784?{'count':_0xbe57e0,'rows':_0x136784}:null;}})[_0xf0a4('0x10')](respondWithResult(_0x49c8dc,null))['catch'](handleError(_0x49c8dc,null));}; \ No newline at end of file +var _0x069a=['then','info','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','end','name','send','MailServerIn','Imap','MailServerOut','Smtp','Pause','map','MailAccount','fieldName','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','body','modernAuthentication','CloudProviderId','mandatoryDispositionPause','update','describe','MailAccountId','create','getDispositions','findOne','Disposition','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','key','provider','custom','email','ListId','active','description','user','password','pass','service','port','username','authentication','host','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x069a,0x162));var _0xa069=function(_0x1fa1a9,_0x3bf729){_0x1fa1a9=_0x1fa1a9-0x0;var _0xed15f3=_0x069a[_0x1fa1a9];return _0xed15f3;};'use strict';var moment=require('moment');var BPromise=require(_0xa069('0x0'));var util=require(_0xa069('0x1'));var path=require(_0xa069('0x2'));var _=require(_0xa069('0x3'));var juice=require(_0xa069('0x4'));var Redis=require(_0xa069('0x5'));var qs=require(_0xa069('0x6'));var logger=require(_0xa069('0x7'))('api');var config=require(_0xa069('0x8'));var db=require(_0xa069('0x9'))['db'];config[_0xa069('0xa')]=_[_0xa069('0xb')](config['redis'],{'host':_0xa069('0xc'),'port':0x18eb});var socket=require(_0xa069('0xd'))(new Redis(config[_0xa069('0xa')]));require(_0xa069('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa069('0xf')][_0xa069('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x23ba01,_0x7ad6e5,_0x277594,_0x32b4aa){return new BPromise(function(_0x299564,_0x372f4b){var _0x3e62c1=_0x32b4aa||client;return _0x3e62c1[_0xa069('0x11')](_0x23ba01,_0x277594)[_0xa069('0x12')](function(_0xdbd8b){logger[_0xa069('0x13')]('MailAccount,\x20%s,\x20%s',_0x7ad6e5,'request\x20sent');logger['debug'](_0xa069('0x14'),_0x7ad6e5,'request\x20sent',JSON[_0xa069('0x15')](_0xdbd8b));if(_0xdbd8b[_0xa069('0x16')]){if(_0xdbd8b[_0xa069('0x16')][_0xa069('0x17')]===0x1f4){logger[_0xa069('0x16')](_0xa069('0x18'),_0x7ad6e5,_0xdbd8b['error'][_0xa069('0x19')]);return _0x372f4b(_0xdbd8b[_0xa069('0x16')][_0xa069('0x19')]);}logger[_0xa069('0x16')](_0xa069('0x18'),_0x7ad6e5,_0xdbd8b[_0xa069('0x16')][_0xa069('0x19')]);return _0x299564(_0xdbd8b[_0xa069('0x16')][_0xa069('0x19')]);}else{logger[_0xa069('0x13')]('MailAccount,\x20%s,\x20%s',_0x7ad6e5,_0xa069('0x1a'));_0x299564(_0xdbd8b[_0xa069('0x1b')][_0xa069('0x19')]);}})[_0xa069('0x1c')](function(_0x507489){logger[_0xa069('0x16')](_0xa069('0x18'),_0x7ad6e5,_0x507489);_0x372f4b(_0x507489);});});}function respondWithStatusCode(_0x475292,_0x464cdc){_0x464cdc=_0x464cdc||0xcc;return function(_0x309c1b){if(_0x309c1b){return _0x475292[_0xa069('0x1d')](_0x464cdc);}return _0x475292['status'](_0x464cdc)['end']();};}function respondWithResult(_0x4ffad6,_0x5ebfaf){_0x5ebfaf=_0x5ebfaf||0xc8;return function(_0xfaae62){if(_0xfaae62){return _0x4ffad6[_0xa069('0x1e')](_0x5ebfaf)[_0xa069('0x1f')](_0xfaae62);}};}function respondWithFilteredResult(_0x48b395,_0x2c705d){return function(_0x23fbe6){if(_0x23fbe6){var _0x4ebb12=typeof _0x2c705d[_0xa069('0x20')]===_0xa069('0x21')&&typeof _0x2c705d[_0xa069('0x22')]===_0xa069('0x21');var _0x3c1f8b=_0x23fbe6['count'];var _0x3712d0=_0x4ebb12?0x0:_0x2c705d['offset'];var _0x55a0a0=_0x4ebb12?_0x23fbe6[_0xa069('0x23')]:_0x2c705d[_0xa069('0x20')]+_0x2c705d['limit'];var _0x37e733;if(_0x55a0a0>=_0x3c1f8b){_0x55a0a0=_0x3c1f8b;_0x37e733=0xc8;}else{_0x37e733=0xce;}_0x48b395[_0xa069('0x1e')](_0x37e733);return _0x48b395[_0xa069('0x24')](_0xa069('0x25'),_0x3712d0+'-'+_0x55a0a0+'/'+_0x3c1f8b)[_0xa069('0x1f')](_0x23fbe6);}return null;};}function saveUpdates(_0x536467){return function(_0x59b8ed){if(_0x59b8ed){return _0x59b8ed['update'](_0x536467)[_0xa069('0x12')](function(_0x1cc1ad){return _0x1cc1ad;});}return null;};}function removeEntity(_0x266515){return function(_0x587dd7){if(_0x587dd7){return _0x587dd7[_0xa069('0x26')]()[_0xa069('0x12')](function(){var _0x4c9e8a=_0x587dd7[_0xa069('0x27')]({'plain':!![]});var _0x3f24ad=_0xa069('0x28');return db[_0xa069('0x29')][_0xa069('0x26')]({'where':{'type':_0x3f24ad,'resourceId':_0x4c9e8a['id']}})[_0xa069('0x12')](function(){return _0x587dd7;});})[_0xa069('0x12')](function(){_0x266515[_0xa069('0x1e')](0xcc)[_0xa069('0x2a')]();});}};}function handleEntityNotFound(_0x52ab66){return function(_0x4fdb74){if(!_0x4fdb74){_0x52ab66[_0xa069('0x1d')](0x194);}return _0x4fdb74;};}function handleError(_0xa6d61d,_0x3c3dd0){_0x3c3dd0=_0x3c3dd0||0x1f4;return function(_0x13a788){logger[_0xa069('0x16')](_0x13a788['stack']);if(_0x13a788[_0xa069('0x2b')]){delete _0x13a788[_0xa069('0x2b')];}_0xa6d61d['status'](_0x3c3dd0)[_0xa069('0x2c')](_0x13a788);};}exports['index']=function(_0xd51cc,_0x1671d1){var _0x238230={'include':[{'model':db[_0xa069('0x2d')],'as':_0xa069('0x2e')},{'model':db[_0xa069('0x2f')],'as':_0xa069('0x30')},{'model':db[_0xa069('0x31')],'as':'mandatoryDispositionPause'}]},_0x57da95={},_0x2c318f={'count':0x0,'rows':[]};var _0x5184a9=_[_0xa069('0x32')](db[_0xa069('0x33')]['rawAttributes'],function(_0x34eee0){return{'name':_0x34eee0[_0xa069('0x34')],'type':_0x34eee0['type']['key']};});_0x57da95['model']=_[_0xa069('0x32')](_0x5184a9,_0xa069('0x2b'));_0x57da95[_0xa069('0x35')]=_[_0xa069('0x36')](_0xd51cc['query']);_0x57da95[_0xa069('0x37')]=_[_0xa069('0x38')](_0x57da95['model'],_0x57da95[_0xa069('0x35')]);_0x238230[_0xa069('0x39')]=_[_0xa069('0x38')](_0x57da95[_0xa069('0x3a')],qs['fields'](_0xd51cc[_0xa069('0x35')][_0xa069('0x3b')]));_0x238230[_0xa069('0x39')]=_0x238230[_0xa069('0x39')][_0xa069('0x3c')]?_0x238230[_0xa069('0x39')]:_0x57da95[_0xa069('0x3a')];if(!_0xd51cc['query']['hasOwnProperty'](_0xa069('0x3d'))){_0x238230[_0xa069('0x22')]=qs[_0xa069('0x22')](_0xd51cc['query'][_0xa069('0x22')]);_0x238230[_0xa069('0x20')]=qs[_0xa069('0x20')](_0xd51cc[_0xa069('0x35')][_0xa069('0x20')]);}_0x238230[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0xd51cc[_0xa069('0x35')][_0xa069('0x3f')]);_0x238230[_0xa069('0x40')]=qs[_0xa069('0x37')](_[_0xa069('0x41')](_0xd51cc[_0xa069('0x35')],_0x57da95[_0xa069('0x37')]),_0x5184a9);if(_0xd51cc[_0xa069('0x35')][_0xa069('0x42')]){_0x238230['where']=_['merge'](_0x238230[_0xa069('0x40')],{'$or':_['map'](_0x5184a9,function(_0x4c1fa6){if(_0x4c1fa6[_0xa069('0x43')]!==_0xa069('0x44')){var _0x1ecec0={};_0x1ecec0[_0x4c1fa6[_0xa069('0x2b')]]={'$like':'%'+_0xd51cc[_0xa069('0x35')][_0xa069('0x42')]+'%'};return _0x1ecec0;}})});}_0x238230=_[_0xa069('0x45')]({},_0x238230,_0xd51cc[_0xa069('0x46')]);var _0x4f391a={'where':_0x238230[_0xa069('0x40')]};return db['MailAccount'][_0xa069('0x23')](_0x4f391a)['then'](function(_0x4a7bf5){_0x2c318f[_0xa069('0x23')]=_0x4a7bf5;if(_0xd51cc[_0xa069('0x35')][_0xa069('0x47')]){_0x238230[_0xa069('0x48')]=[{'all':!![]}];}return db[_0xa069('0x33')][_0xa069('0x49')](_0x238230);})[_0xa069('0x12')](function(_0x1e4be4){_0x2c318f['rows']=_0x1e4be4;return _0x2c318f;})[_0xa069('0x12')](respondWithFilteredResult(_0x1671d1,_0x238230))[_0xa069('0x1c')](handleError(_0x1671d1,null));};exports[_0xa069('0x4a')]=function(_0x4894b7,_0x1a8f5f){var _0x5557a6={'raw':![],'where':{'id':_0x4894b7[_0xa069('0x4b')]['id']},'include':[{'model':db[_0xa069('0x2d')],'as':_0xa069('0x2e')},{'model':db[_0xa069('0x2f')],'as':_0xa069('0x30')},{'model':db[_0xa069('0x31')],'as':'mandatoryDispositionPause'}]},_0x5d5839={};_0x5d5839['model']=_[_0xa069('0x36')](db[_0xa069('0x33')][_0xa069('0x4c')]);_0x5d5839[_0xa069('0x35')]=_[_0xa069('0x36')](_0x4894b7[_0xa069('0x35')]);_0x5d5839[_0xa069('0x37')]=_[_0xa069('0x38')](_0x5d5839[_0xa069('0x3a')],_0x5d5839['query']);_0x5557a6[_0xa069('0x39')]=_[_0xa069('0x38')](_0x5d5839[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x4894b7[_0xa069('0x35')][_0xa069('0x3b')]));_0x5557a6[_0xa069('0x39')]=_0x5557a6[_0xa069('0x39')]['length']?_0x5557a6[_0xa069('0x39')]:_0x5d5839['model'];if(_0x4894b7[_0xa069('0x35')][_0xa069('0x47')]){_0x5557a6[_0xa069('0x48')]=[{'all':!![]}];}_0x5557a6=_[_0xa069('0x45')]({},_0x5557a6,_0x4894b7[_0xa069('0x46')]);return db[_0xa069('0x33')][_0xa069('0x4d')](_0x5557a6)[_0xa069('0x12')](handleEntityNotFound(_0x1a8f5f,null))[_0xa069('0x12')](respondWithResult(_0x1a8f5f,null))[_0xa069('0x1c')](handleError(_0x1a8f5f,null));};exports['update']=function(_0xa625f,_0x1dfca4){if(_0xa625f[_0xa069('0x4e')]['id']){delete _0xa625f[_0xa069('0x4e')]['id'];}if(_0xa625f[_0xa069('0x4e')][_0xa069('0x2e')]){if(!_0xa625f[_0xa069('0x4e')][_0xa069('0x2e')][_0xa069('0x4f')]){_0xa625f['body'][_0xa069('0x2e')][_0xa069('0x50')]=null;}}if(_0xa625f['body'][_0xa069('0x30')]){if(!_0xa625f[_0xa069('0x4e')]['Smtp'][_0xa069('0x4f')]){_0xa625f['body'][_0xa069('0x30')][_0xa069('0x50')]=null;}}return db['MailAccount'][_0xa069('0x4d')]({'where':{'id':_0xa625f[_0xa069('0x4b')]['id']},'include':[{'model':db[_0xa069('0x2d')],'as':'Imap'},{'model':db[_0xa069('0x2f')],'as':_0xa069('0x30')},{'model':db[_0xa069('0x31')],'as':_0xa069('0x51')}]})[_0xa069('0x12')](handleEntityNotFound(_0x1dfca4,null))['then'](saveUpdates(_0xa625f[_0xa069('0x4e')],null))[_0xa069('0x12')](function(_0x41f5ba){if(_0x41f5ba&&_0xa625f[_0xa069('0x4e')][_0xa069('0x2e')]){return db[_0xa069('0x2d')][_0xa069('0x52')](_0xa625f['body'][_0xa069('0x2e')],{'where':{'MailAccountId':_0x41f5ba['id']}})['then'](function(){return _0x41f5ba;});}return _0x41f5ba;})[_0xa069('0x12')](function(_0x399671){if(_0x399671&&_0xa625f[_0xa069('0x4e')][_0xa069('0x30')]){return db[_0xa069('0x2f')]['update'](_0xa625f[_0xa069('0x4e')][_0xa069('0x30')],{'where':{'MailAccountId':_0x399671['id']}})[_0xa069('0x12')](function(){return _0x399671;});}return _0x399671;})[_0xa069('0x12')](respondWithResult(_0x1dfca4,null))[_0xa069('0x1c')](handleError(_0x1dfca4,null));};exports[_0xa069('0x53')]=function(_0x2d1ae9,_0x16e4ae){return db[_0xa069('0x33')]['describe']()['then'](respondWithResult(_0x16e4ae,null))[_0xa069('0x1c')](handleError(_0x16e4ae,null));};exports['addDisposition']=function(_0x2b59f0,_0x246dff){if(_0x2b59f0[_0xa069('0x4e')]['id']){delete _0x2b59f0[_0xa069('0x4e')]['id'];}return db['MailAccount'][_0xa069('0x4d')]({'where':{'id':_0x2b59f0['params']['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x246dff,null))[_0xa069('0x12')](function(_0x140fd0){if(_0x140fd0){_0x2b59f0[_0xa069('0x4e')][_0xa069('0x54')]=_0x140fd0['id'];return db['Disposition'][_0xa069('0x55')](_0x2b59f0[_0xa069('0x4e')]);}})[_0xa069('0x12')](respondWithResult(_0x246dff,null))[_0xa069('0x1c')](handleError(_0x246dff,null));};exports[_0xa069('0x56')]=function(_0x53d800,_0x203f2f){var _0x1be0ee={'raw':![],'where':{}};var _0x14b3d3={};var _0x1d86d6={'count':0x0,'rows':[]};return db['MailAccount'][_0xa069('0x57')]({'where':{'id':_0x53d800[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x203f2f,null))[_0xa069('0x12')](function(_0x8a2f15){if(_0x8a2f15){_0x14b3d3[_0xa069('0x3a')]=_[_0xa069('0x36')](db[_0xa069('0x58')]['rawAttributes']);_0x14b3d3[_0xa069('0x35')]=_[_0xa069('0x36')](_0x53d800[_0xa069('0x35')]);_0x14b3d3['filters']=_[_0xa069('0x38')](_0x14b3d3[_0xa069('0x3a')],_0x14b3d3[_0xa069('0x35')]);_0x1be0ee[_0xa069('0x39')]=_[_0xa069('0x38')](_0x14b3d3[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x53d800['query']['fields']));_0x1be0ee[_0xa069('0x39')]=_0x1be0ee[_0xa069('0x39')]['length']?_0x1be0ee[_0xa069('0x39')]:_0x14b3d3['model'];if(!_0x53d800[_0xa069('0x35')][_0xa069('0x59')](_0xa069('0x3d'))){_0x1be0ee[_0xa069('0x22')]=qs['limit'](_0x53d800[_0xa069('0x35')]['limit']);_0x1be0ee[_0xa069('0x20')]=qs[_0xa069('0x20')](_0x53d800['query'][_0xa069('0x20')]);}_0x1be0ee[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x53d800[_0xa069('0x35')][_0xa069('0x3f')]);_0x1be0ee[_0xa069('0x40')]=qs[_0xa069('0x37')](_['pick'](_0x53d800[_0xa069('0x35')],_0x14b3d3[_0xa069('0x37')]));_0x1be0ee['where'][_0xa069('0x54')]=_0x8a2f15['id'];if(_0x53d800[_0xa069('0x35')]['filter']){_0x1be0ee[_0xa069('0x40')]=_[_0xa069('0x45')](_0x1be0ee[_0xa069('0x40')],{'$or':_['map'](_0x1be0ee[_0xa069('0x39')],function(_0x44eb6a){var _0x893fff={};_0x893fff[_0x44eb6a]={'$like':'%'+_0x53d800[_0xa069('0x35')][_0xa069('0x42')]+'%'};return _0x893fff;})});}_0x1be0ee=_[_0xa069('0x45')]({},_0x1be0ee,_0x53d800[_0xa069('0x46')]);return db['Disposition'][_0xa069('0x23')]({'where':_0x1be0ee[_0xa069('0x40')]})[_0xa069('0x12')](function(_0x4b8f01){_0x1d86d6[_0xa069('0x23')]=_0x4b8f01;if(_0x53d800['query'][_0xa069('0x47')]){_0x1be0ee[_0xa069('0x48')]=[{'all':!![]}];}return db[_0xa069('0x58')][_0xa069('0x49')](_0x1be0ee);})[_0xa069('0x12')](function(_0x511d9e){_0x1d86d6[_0xa069('0x5a')]=_0x511d9e;return _0x1d86d6;});}})[_0xa069('0x12')](respondWithFilteredResult(_0x203f2f,_0x1be0ee))[_0xa069('0x1c')](handleError(_0x203f2f,null));};exports[_0xa069('0x5b')]=function(_0x4bcf09,_0xa28004){return db[_0xa069('0x33')]['find']({'where':{'id':_0x4bcf09[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0xa28004,null))[_0xa069('0x12')](function(_0x3679e3){if(_0x3679e3){return _0x3679e3['removeDispositions'](_0x4bcf09[_0xa069('0x35')][_0xa069('0x5c')]);}})[_0xa069('0x12')](respondWithStatusCode(_0xa28004,null))['catch'](handleError(_0xa28004,null));};exports[_0xa069('0x5d')]=function(_0x26d3bc,_0x1d6d3c){if(_0x26d3bc[_0xa069('0x4e')]['id']){delete _0x26d3bc['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x26d3bc[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x1d6d3c,null))['then'](function(_0x5b71b6){if(_0x5b71b6){_0x26d3bc[_0xa069('0x4e')][_0xa069('0x54')]=_0x5b71b6['id'];return db[_0xa069('0x5e')]['create'](_0x26d3bc[_0xa069('0x4e')]);}})[_0xa069('0x12')](respondWithResult(_0x1d6d3c,null))[_0xa069('0x1c')](handleError(_0x1d6d3c,null));};exports['getAnswers']=function(_0x4a3565,_0x732d99){var _0x45f7af={'raw':![],'where':{}};var _0x1a61cd={};var _0x5e8833={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4a3565[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x732d99,null))[_0xa069('0x12')](function(_0xd8a56b){if(_0xd8a56b){_0x1a61cd[_0xa069('0x3a')]=_[_0xa069('0x36')](db['CannedAnswer'][_0xa069('0x4c')]);_0x1a61cd[_0xa069('0x35')]=_[_0xa069('0x36')](_0x4a3565[_0xa069('0x35')]);_0x1a61cd[_0xa069('0x37')]=_['intersection'](_0x1a61cd[_0xa069('0x3a')],_0x1a61cd['query']);_0x45f7af['attributes']=_[_0xa069('0x38')](_0x1a61cd[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x4a3565[_0xa069('0x35')][_0xa069('0x3b')]));_0x45f7af[_0xa069('0x39')]=_0x45f7af['attributes'][_0xa069('0x3c')]?_0x45f7af['attributes']:_0x1a61cd[_0xa069('0x3a')];if(!_0x4a3565[_0xa069('0x35')][_0xa069('0x59')](_0xa069('0x3d'))){_0x45f7af['limit']=qs[_0xa069('0x22')](_0x4a3565[_0xa069('0x35')][_0xa069('0x22')]);_0x45f7af[_0xa069('0x20')]=qs[_0xa069('0x20')](_0x4a3565['query'][_0xa069('0x20')]);}_0x45f7af[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x4a3565['query'][_0xa069('0x3f')]);_0x45f7af[_0xa069('0x40')]=qs[_0xa069('0x37')](_[_0xa069('0x41')](_0x4a3565['query'],_0x1a61cd[_0xa069('0x37')]));_0x45f7af[_0xa069('0x40')]['MailAccountId']=_0xd8a56b['id'];if(_0x4a3565[_0xa069('0x35')][_0xa069('0x42')]){_0x45f7af[_0xa069('0x40')]=_['merge'](_0x45f7af[_0xa069('0x40')],{'$or':_['map'](_0x45f7af['attributes'],function(_0x377c73){var _0x5b9964={};_0x5b9964[_0x377c73]={'$like':'%'+_0x4a3565['query']['filter']+'%'};return _0x5b9964;})});}_0x45f7af=_[_0xa069('0x45')]({},_0x45f7af,_0x4a3565[_0xa069('0x46')]);return db['CannedAnswer'][_0xa069('0x23')]({'where':_0x45f7af[_0xa069('0x40')]})[_0xa069('0x12')](function(_0x5d0f11){_0x5e8833[_0xa069('0x23')]=_0x5d0f11;if(_0x4a3565['query']['includeAll']){_0x45f7af[_0xa069('0x48')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x45f7af);})[_0xa069('0x12')](function(_0x1e9316){_0x5e8833[_0xa069('0x5a')]=_0x1e9316;return _0x5e8833;});}})['then'](respondWithFilteredResult(_0x732d99,_0x45f7af))[_0xa069('0x1c')](handleError(_0x732d99,null));};exports[_0xa069('0x5f')]=function(_0x1aab78,_0x3dfd58){return db['MailAccount'][_0xa069('0x4d')]({'where':{'id':_0x1aab78[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3dfd58,null))[_0xa069('0x12')](function(_0x27f456){if(_0x27f456){return _0x27f456[_0xa069('0x5f')](_0x1aab78[_0xa069('0x35')][_0xa069('0x5c')]);}})[_0xa069('0x12')](respondWithStatusCode(_0x3dfd58,null))[_0xa069('0x1c')](handleError(_0x3dfd58,null));};exports[_0xa069('0x55')]=function(_0x1a2bd3,_0x362e3b){var _0x3d912a={'name':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x2b')],'key':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x60')],'provider':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x61')]===_0xa069('0x62')?null:_0x1a2bd3['body']['provider'],'email':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x63')],'ListId':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x64')],'active':!_['isNil'](_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x65')])?_0x1a2bd3[_0xa069('0x4e')]['active']:!![],'description':_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x66')]||null,'Imap':{},'Smtp':{}};if(_0x3d912a[_0xa069('0x61')]){_0x3d912a[_0xa069('0x2e')][_0xa069('0x67')]=_0x3d912a[_0xa069('0x30')]['user']=_0x1a2bd3[_0xa069('0x4e')]['username'];_0x3d912a[_0xa069('0x2e')][_0xa069('0x68')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x69')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x68')];if(_0x1a2bd3[_0xa069('0x4e')]['modernAuthentication']){_0x3d912a[_0xa069('0x2e')]['modernAuthentication']=_0x3d912a[_0xa069('0x30')][_0xa069('0x4f')]=!![];_0x3d912a['Imap'][_0xa069('0x50')]=_0x3d912a['Smtp'][_0xa069('0x50')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x50')];_0x3d912a[_0xa069('0x2e')][_0xa069('0x68')]=_0x3d912a['Smtp'][_0xa069('0x69')]=null;}else{_0x3d912a[_0xa069('0x2e')]['CloudProviderId']=_0x3d912a[_0xa069('0x30')][_0xa069('0x50')]=null;}_0x3d912a['Imap'][_0xa069('0x6a')]=_0x3d912a['Smtp']['service']=null;_0x3d912a['Imap']['host']=_0x3d912a['Smtp']['host']=null;_0x3d912a[_0xa069('0x2e')][_0xa069('0x6b')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x6b')]=null;}else{if(_0x1a2bd3[_0xa069('0x4e')]['authentication']){_0x3d912a[_0xa069('0x2e')][_0xa069('0x67')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x67')]=_0x1a2bd3['body'][_0xa069('0x6c')];_0x3d912a['Imap'][_0xa069('0x68')]=_0x3d912a['Smtp'][_0xa069('0x69')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x68')];}else{_0x3d912a['Imap'][_0xa069('0x6d')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x6d')]=![];_0x3d912a[_0xa069('0x2e')][_0xa069('0x67')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x67')]=null;_0x3d912a['Imap'][_0xa069('0x68')]=_0x3d912a[_0xa069('0x30')][_0xa069('0x69')]=null;}_0x3d912a['Imap'][_0xa069('0x6e')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x2e')][_0xa069('0x6e')];_0x3d912a[_0xa069('0x2e')][_0xa069('0x6b')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x2e')][_0xa069('0x6b')];_0x3d912a[_0xa069('0x30')][_0xa069('0x6e')]=_0x1a2bd3[_0xa069('0x4e')][_0xa069('0x30')]['host'];_0x3d912a[_0xa069('0x30')][_0xa069('0x6b')]=_0x1a2bd3['body'][_0xa069('0x30')][_0xa069('0x6b')];}return db['MailAccount'][_0xa069('0x55')](_0x3d912a,{'include':[{'model':db[_0xa069('0x2f')],'as':_0xa069('0x30')},{'model':db[_0xa069('0x2d')],'as':_0xa069('0x2e')}]})[_0xa069('0x12')](function(_0x42e3fc){var _0x24ea98=_0x1a2bd3['user'][_0xa069('0x27')]({'plain':!![]});if(!_0x24ea98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24ea98[_0xa069('0x6f')]==='user'){var _0x137307=_0x42e3fc['get']({'plain':!![]});return db[_0xa069('0x70')][_0xa069('0x4d')]({'where':{'name':_0xa069('0x28'),'userProfileId':_0x24ea98[_0xa069('0x71')]},'raw':!![]})['then'](function(_0x46719a){if(_0x46719a&&_0x46719a[_0xa069('0x72')]===0x0){return db['UserProfileResource']['create']({'name':_0x137307[_0xa069('0x2b')],'resourceId':_0x137307['id'],'type':_0x46719a[_0xa069('0x2b')],'sectionId':_0x46719a['id']},{})[_0xa069('0x12')](function(){return _0x42e3fc;});}else{return _0x42e3fc;}})['catch'](function(_0x4dc936){logger[_0xa069('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dc936);throw _0x4dc936;});}return _0x42e3fc;})[_0xa069('0x12')](respondWithResult(_0x362e3b,0xc9))[_0xa069('0x1c')](handleError(_0x362e3b,null));};exports['getImap']=function(_0x348500,_0x2b8146){return db['MailAccount'][_0xa069('0x57')]({'where':{'id':_0x348500[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x2b8146,null))[_0xa069('0x12')](function(_0x8ebfca){if(_0x8ebfca){return _0x8ebfca[_0xa069('0x73')]();}return null;})[_0xa069('0x12')](respondWithResult(_0x2b8146,null))[_0xa069('0x1c')](handleError(_0x2b8146,null));};exports[_0xa069('0x74')]=function(_0x3b8f1a,_0x4aa04a){if(_0x3b8f1a[_0xa069('0x4e')]['id']){delete _0x3b8f1a[_0xa069('0x4e')]['id'];}return db[_0xa069('0x33')][_0xa069('0x4d')]({'where':{'id':_0x3b8f1a[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4aa04a,null))[_0xa069('0x12')](function(_0x4c1a90){if(_0x4c1a90){_0x3b8f1a[_0xa069('0x4e')][_0xa069('0x54')]=_0x4c1a90['id'];return db[_0xa069('0x2d')][_0xa069('0x55')](_0x3b8f1a['body']);}})[_0xa069('0x12')](respondWithResult(_0x4aa04a,null))[_0xa069('0x1c')](handleError(_0x4aa04a,null));};exports[_0xa069('0x75')]=function(_0x13beb1,_0x596d93){return db[_0xa069('0x33')]['findOne']({'where':{'id':_0x13beb1['params']['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x596d93,null))[_0xa069('0x12')](function(_0x2c19e8){if(_0x2c19e8){return _0x2c19e8[_0xa069('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x596d93,null))['catch'](handleError(_0x596d93,null));};exports[_0xa069('0x77')]=function(_0x5d249f,_0x5a2dd9){return db[_0xa069('0x33')][_0xa069('0x57')]({'where':{'id':_0x5d249f['params']['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x5a2dd9,null))[_0xa069('0x12')](function(_0x41fb41){if(_0x41fb41){return _0x41fb41[_0xa069('0x77')]();}return null;})[_0xa069('0x12')](respondWithResult(_0x5a2dd9,null))[_0xa069('0x1c')](handleError(_0x5a2dd9,null));};exports['addSmtp']=function(_0x451175,_0x236cc0){if(_0x451175[_0xa069('0x4e')]['id']){delete _0x451175[_0xa069('0x4e')]['id'];}return db[_0xa069('0x33')]['find']({'where':{'id':_0x451175[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x236cc0,null))[_0xa069('0x12')](function(_0x48fc1c){if(_0x48fc1c){_0x451175[_0xa069('0x4e')][_0xa069('0x54')]=_0x48fc1c['id'];return db[_0xa069('0x2f')][_0xa069('0x55')](_0x451175[_0xa069('0x4e')]);}})[_0xa069('0x12')](respondWithResult(_0x236cc0,null))[_0xa069('0x1c')](handleError(_0x236cc0,null));};exports[_0xa069('0x78')]=function(_0x8a5fb4,_0x3acd41){return db['MailAccount']['findOne']({'where':{'id':_0x8a5fb4[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3acd41,null))[_0xa069('0x12')](function(_0x5d4163){if(_0x5d4163){return _0x5d4163['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3acd41,null))['catch'](handleError(_0x3acd41,null));};exports[_0xa069('0x79')]=function(_0xe9c9b6,_0x30c70a){return db[_0xa069('0x7a')][_0xa069('0x4d')]({'where':{'id':_0xe9c9b6[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30c70a,null))[_0xa069('0x12')](function(_0x374d5f){if(_0x374d5f){return _0x374d5f[_0xa069('0x79')](_0xe9c9b6[_0xa069('0x4e')][_0xa069('0x5c')],_['omit'](_0xe9c9b6['body'],[_0xa069('0x5c'),'id'])||{});}})[_0xa069('0x12')](respondWithResult(_0x30c70a,null))[_0xa069('0x1c')](handleError(_0x30c70a,null));};exports['getInteractions']=function(_0x283463,_0x7a4f8b){var _0x67cba3={'raw':![],'where':{}};var _0x146e55={};var _0x51c707={'count':0x0,'rows':[]};return db['MailAccount'][_0xa069('0x57')]({'where':{'id':_0x283463[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x7a4f8b,null))[_0xa069('0x12')](function(_0xf984c6){if(_0xf984c6){_0x146e55['model']=_[_0xa069('0x36')](db[_0xa069('0x7a')]['rawAttributes']);_0x146e55[_0xa069('0x35')]=_[_0xa069('0x36')](_0x283463[_0xa069('0x35')]);_0x146e55[_0xa069('0x37')]=_[_0xa069('0x38')](_0x146e55[_0xa069('0x3a')],_0x146e55[_0xa069('0x35')]);_0x67cba3[_0xa069('0x39')]=_[_0xa069('0x38')](_0x146e55[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x283463[_0xa069('0x35')][_0xa069('0x3b')]));_0x67cba3[_0xa069('0x39')]=_0x67cba3[_0xa069('0x39')]['length']?_0x67cba3[_0xa069('0x39')]:_0x146e55['model'];if(!_0x283463[_0xa069('0x35')][_0xa069('0x59')](_0xa069('0x3d'))){_0x67cba3[_0xa069('0x22')]=qs['limit'](_0x283463[_0xa069('0x35')][_0xa069('0x22')]);_0x67cba3[_0xa069('0x20')]=qs[_0xa069('0x20')](_0x283463[_0xa069('0x35')]['offset']);}_0x67cba3[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x283463[_0xa069('0x35')][_0xa069('0x3f')]);_0x67cba3[_0xa069('0x40')]=qs[_0xa069('0x37')](_['pick'](_0x283463[_0xa069('0x35')],_0x146e55[_0xa069('0x37')]));_0x67cba3[_0xa069('0x40')][_0xa069('0x54')]=_0xf984c6['id'];if(_0x283463[_0xa069('0x35')][_0xa069('0x42')]){_0x67cba3[_0xa069('0x40')]=_['merge'](_0x67cba3[_0xa069('0x40')],{'$or':_['map'](_0x67cba3[_0xa069('0x39')],function(_0x8225f0){var _0x2e78df={};_0x2e78df[_0x8225f0]={'$like':'%'+_0x283463[_0xa069('0x35')][_0xa069('0x42')]+'%'};return _0x2e78df;})});}_0x67cba3=_[_0xa069('0x45')]({},_0x67cba3,_0x283463[_0xa069('0x46')]);return db[_0xa069('0x7a')][_0xa069('0x23')]({'where':_0x67cba3[_0xa069('0x40')]})[_0xa069('0x12')](function(_0x23c399){_0x51c707[_0xa069('0x23')]=_0x23c399;if(_0x283463[_0xa069('0x35')][_0xa069('0x47')]){_0x67cba3[_0xa069('0x48')]=[{'model':db[_0xa069('0x7b')],'as':_0xa069('0x7c'),'required':![]},{'model':db[_0xa069('0x7d')],'as':_0xa069('0x7e'),'attributes':[_0xa069('0x2b'),'fullname',_0xa069('0x7f')],'required':![]},{'model':db[_0xa069('0x80')],'as':_0xa069('0x81'),'attributes':['id','name',_0xa069('0x82')],'where':_0x283463[_0xa069('0x35')][_0xa069('0x83')]?{'id':_0x283463[_0xa069('0x35')][_0xa069('0x83')]}:undefined,'required':_0x283463[_0xa069('0x35')][_0xa069('0x83')]?!![]:![]}];}return db[_0xa069('0x7a')][_0xa069('0x49')](_0x67cba3);})[_0xa069('0x12')](function(_0x4b78d5){_0x51c707[_0xa069('0x5a')]=_0x4b78d5;return _0x51c707;});}})[_0xa069('0x12')](respondWithFilteredResult(_0x7a4f8b,_0x67cba3))['catch'](handleError(_0x7a4f8b,null));};exports['addApplications']=function addApplications(_0x4e502d,_0x3f9a01){var _0x346e6e=_0x4e502d['params']['id'];var _0x517605=_0x4e502d['body'];var _0x437ecc=0xc8;var _0xcf5648=null;return db[_0xa069('0x84')][_0xa069('0x85')]({'isolationLevel':db[_0xa069('0x84')][_0xa069('0x86')][_0xa069('0x87')][_0xa069('0x88')]},function(_0x40c17b){return db[_0xa069('0x33')]['findOne']({'where':{'id':_0x346e6e},'transaction':_0x40c17b})[_0xa069('0x12')](function(_0x3760a2){if(_0x3760a2){return db[_0xa069('0x89')][_0xa069('0x26')]({'where':{'MailAccountId':_0x346e6e},'transaction':_0x40c17b})['then'](function(){var _0x3e01de=_[_0xa069('0x32')](_0x517605,function(_0x33e4e2){_0x33e4e2[_0xa069('0x54')]=_0x346e6e;return _0x33e4e2;});return db[_0xa069('0x89')]['bulkCreate'](_0x3e01de,{'transaction':_0x40c17b});});}else{_0x437ecc=0x194;_0xcf5648=[];}});})[_0xa069('0x12')](function(){if(_0x437ecc!==0x194){return db[_0xa069('0x89')][_0xa069('0x8a')]({'where':{'MailAccountId':_0x346e6e},'order':'priority'})[_0xa069('0x12')](function(_0x1436cc){_0xcf5648=_0x1436cc;});}})[_0xa069('0x1c')](function(_0x235aab){_0x437ecc=0x1f4;logger[_0xa069('0x16')](_0x235aab[_0xa069('0x8b')]);if(_0x235aab[_0xa069('0x2b')]){delete _0x235aab[_0xa069('0x2b')];}_0xcf5648=_0x235aab;})[_0xa069('0x8c')](function(){if(_0xcf5648===null){_0x3f9a01[_0xa069('0x1d')](_0x437ecc);}else{if(_0x437ecc===0x1f4){_0x3f9a01[_0xa069('0x1e')](_0x437ecc)[_0xa069('0x2c')](_0xcf5648);}else{_0x3f9a01['status'](_0x437ecc)[_0xa069('0x1f')](_0xcf5648);}}});};exports[_0xa069('0x8d')]=function(_0x290c4a,_0x1ab64e){var _0xb28804={};var _0x3f1c8e={};var _0x139f70;var _0x1df4c0;return db[_0xa069('0x33')][_0xa069('0x57')]({'where':{'id':_0x290c4a[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x1ab64e,null))[_0xa069('0x12')](function(_0x27d294){if(_0x27d294){_0x139f70=_0x27d294;_0x3f1c8e[_0xa069('0x3a')]=_[_0xa069('0x36')](db[_0xa069('0x89')]['rawAttributes']);_0x3f1c8e['query']=_[_0xa069('0x36')](_0x290c4a[_0xa069('0x35')]);_0x3f1c8e[_0xa069('0x37')]=_['intersection'](_0x3f1c8e[_0xa069('0x3a')],_0x3f1c8e[_0xa069('0x35')]);_0xb28804[_0xa069('0x39')]=_['intersection'](_0x3f1c8e[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x290c4a['query'][_0xa069('0x3b')]));_0xb28804[_0xa069('0x39')]=_0xb28804[_0xa069('0x39')]['length']?_0xb28804[_0xa069('0x39')]:_0x3f1c8e[_0xa069('0x3a')];_0xb28804[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x290c4a['query'][_0xa069('0x3f')]);_0xb28804[_0xa069('0x40')]=qs[_0xa069('0x37')](_[_0xa069('0x41')](_0x290c4a[_0xa069('0x35')],_0x3f1c8e['filters']));if(_0x290c4a[_0xa069('0x35')][_0xa069('0x42')]){_0xb28804[_0xa069('0x40')]=_[_0xa069('0x45')](_0xb28804[_0xa069('0x40')],{'$or':_[_0xa069('0x32')](_0xb28804[_0xa069('0x39')],function(_0x1064de){var _0x373391={};_0x373391[_0x1064de]={'$like':'%'+_0x290c4a[_0xa069('0x35')]['filter']+'%'};return _0x373391;})});}_0xb28804=_[_0xa069('0x45')]({},_0xb28804,_0x290c4a[_0xa069('0x46')]);return _0x139f70[_0xa069('0x8d')](_0xb28804);}})[_0xa069('0x12')](function(_0x11cffa){if(_0x11cffa){_0x1df4c0=_0x11cffa[_0xa069('0x3c')];if(!_0x290c4a[_0xa069('0x35')][_0xa069('0x59')](_0xa069('0x3d'))){_0xb28804['limit']=qs[_0xa069('0x22')](_0x290c4a[_0xa069('0x35')][_0xa069('0x22')]);_0xb28804[_0xa069('0x20')]=qs['offset'](_0x290c4a[_0xa069('0x35')]['offset']);}return _0x139f70[_0xa069('0x8d')](_0xb28804);}})['then'](function(_0x5abea3){if(_0x5abea3){return _0x5abea3?{'count':_0x1df4c0,'rows':_0x5abea3}:null;}})[_0xa069('0x12')](respondWithResult(_0x1ab64e,null))['catch'](handleError(_0x1ab64e,null));};exports[_0xa069('0x8e')]=function(_0x485661,_0x5b5872){var _0x488fc5={'raw':!![],'where':{}};var _0x38de2c={};var _0x1f33b5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x485661[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b5872,null))[_0xa069('0x12')](function(_0x16fa42){if(_0x16fa42){_0x38de2c['model']=_[_0xa069('0x36')](db[_0xa069('0x8f')][_0xa069('0x4c')]);_0x38de2c[_0xa069('0x35')]=_[_0xa069('0x36')](_0x485661[_0xa069('0x35')]);_0x38de2c[_0xa069('0x37')]=_[_0xa069('0x38')](_0x38de2c[_0xa069('0x3a')],_0x38de2c['query']);_0x488fc5[_0xa069('0x39')]=_[_0xa069('0x38')](_0x38de2c['model'],qs[_0xa069('0x3b')](_0x485661[_0xa069('0x35')][_0xa069('0x3b')]));_0x488fc5[_0xa069('0x39')]=_0x488fc5[_0xa069('0x39')][_0xa069('0x3c')]?_0x488fc5[_0xa069('0x39')]:_0x38de2c['model'];if(!_0x485661[_0xa069('0x35')]['hasOwnProperty'](_0xa069('0x3d'))){_0x488fc5[_0xa069('0x22')]=qs[_0xa069('0x22')](_0x485661['query'][_0xa069('0x22')]);_0x488fc5[_0xa069('0x20')]=qs[_0xa069('0x20')](_0x485661[_0xa069('0x35')][_0xa069('0x20')]);}_0x488fc5[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x485661[_0xa069('0x35')][_0xa069('0x3f')]);_0x488fc5['where']=qs[_0xa069('0x37')](_[_0xa069('0x41')](_0x485661['query'],_0x38de2c[_0xa069('0x37')]));_0x488fc5[_0xa069('0x40')][_0xa069('0x54')]=_0x16fa42['id'];if(_0x485661['query']['filter']){_0x488fc5[_0xa069('0x40')]=_['merge'](_0x488fc5[_0xa069('0x40')],{'$or':_[_0xa069('0x32')](_0x488fc5[_0xa069('0x39')],function(_0x2b3fc0){var _0x14924d={};_0x14924d[_0x2b3fc0]={'$like':'%'+_0x485661['query'][_0xa069('0x42')]+'%'};return _0x14924d;})});}if(_0x485661[_0xa069('0x35')][_0xa069('0x90')]){var _0x3ad036=_0x485661[_0xa069('0x35')][_0xa069('0x90')][_0xa069('0x91')](',');var _0x1fb57a={};_0x1fb57a[_0x3ad036[0x0]]={'$gte':moment(_0x3ad036[0x1])[_0xa069('0x92')](_0xa069('0x93'))};_0x488fc5[_0xa069('0x40')]=_['merge'](_0x488fc5[_0xa069('0x40')],_0x1fb57a);}_0x488fc5=_[_0xa069('0x45')]({},_0x488fc5,_0x485661[_0xa069('0x46')]);return db['MailMessage'][_0xa069('0x23')]({'where':_0x488fc5['where']})[_0xa069('0x12')](function(_0x17b87f){_0x1f33b5['count']=_0x17b87f;if(_0x485661[_0xa069('0x35')]['includeAll']){_0x488fc5[_0xa069('0x48')]=[{'all':!![]}];}return db['MailMessage'][_0xa069('0x49')](_0x488fc5);})[_0xa069('0x12')](function(_0x50a6e5){if(_0x485661['query'][_0xa069('0x94')]===_0xa069('0x95')){for(var _0x141fa1=0x0;_0x141fa1<_0x50a6e5[_0xa069('0x3c')];_0x141fa1++){_0x50a6e5[_0x141fa1][_0xa069('0x4e')]=juice(_0x50a6e5[_0x141fa1][_0xa069('0x4e')]);}}_0x1f33b5[_0xa069('0x5a')]=_0x50a6e5;return _0x1f33b5;});}})['then'](respondWithFilteredResult(_0x5b5872,_0x488fc5))[_0xa069('0x1c')](handleError(_0x5b5872,null));};exports['send']=function(_0x1d8adc,_0x9b9b35){var _0x5f1c99,_0x55dc9f={},_0x254ebe;if(_0x1d8adc[_0xa069('0x4e')]['to']){_0x254ebe=_0x1d8adc[_0xa069('0x4e')]['to'][_0xa069('0x91')](',')[0x0];}return db[_0xa069('0x33')][_0xa069('0x4d')]({'where':{'id':_0x1d8adc[_0xa069('0x4b')]['id']},'include':[{'model':db[_0xa069('0x96')],'as':_0xa069('0x97'),'include':[{'model':db[_0xa069('0x7b')],'as':_0xa069('0x98'),'where':{'email':_0x254ebe},'limit':0x1,'order':[[_0xa069('0x99'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xa069('0x30'),'raw':!![],'include':[{'model':db[_0xa069('0x9a')],'as':_0xa069('0x9a'),'raw':!![]}]}]})[_0xa069('0x12')](handleEntityNotFound(_0x9b9b35,null))[_0xa069('0x12')](function(_0x5c0c60){if(!_0x5c0c60)return;_0x5f1c99=_0x5c0c60;if(!_0x5c0c60[_0xa069('0x30')])throw new Error(_0xa069('0x9b'));if(_['isNil'](_0x1d8adc[_0xa069('0x4e')][_0xa069('0x9c')])){_0x1d8adc[_0xa069('0x4e')]['from']=util[_0xa069('0x92')](_0xa069('0x9d'),_0x5c0c60[_0xa069('0x2b')],_0x5c0c60['email']||_0x5c0c60[_0xa069('0x30')][_0xa069('0x67')]);}if(_0x1d8adc['body'][_0xa069('0x9e')]&&_0x1d8adc['body']['attachments']['length']){for(var _0x50c5de=0x0;_0x50c5de<_0x1d8adc['body'][_0xa069('0x9e')][_0xa069('0x3c')];_0x50c5de+=0x1){_0x1d8adc['body'][_0xa069('0x9e')][_0x50c5de]={'filename':_0x1d8adc['body'][_0xa069('0x9e')][_0x50c5de][_0xa069('0x2b')],'path':path[_0xa069('0x9f')](config[_0xa069('0xa0')],_0xa069('0xa1'),_0x1d8adc[_0xa069('0x4e')]['attachments'][_0x50c5de][_0xa069('0xa2')])};}}var _0x1ecab6=_0x5c0c60[_0xa069('0xa3')]();return respondWithRpcPromise(_0xa069('0xa4'),_0xa069('0xa5'),{'account':_0x1ecab6,'message':_0x1d8adc[_0xa069('0x4e')]});})[_0xa069('0x12')](function(_0x1b9361){if(!_0x1b9361)return;_0x55dc9f=_0x1b9361;if(!_0x5f1c99[_0xa069('0x97')])throw new Error(_0xa069('0xa6'));if(_0x5f1c99[_0xa069('0x97')][_0xa069('0x98')]['length'])return _0x5f1c99[_0xa069('0x97')]['Contacts'][0x0];return db['CmContact']['create'](_[_0xa069('0xb')](_0x1d8adc['body'],{'firstName':_0x1d8adc[_0xa069('0x4e')]['to'],'email':_0x1d8adc[_0xa069('0x4e')]['to'],'phone':_0x1d8adc[_0xa069('0x4e')]['to'],'ListId':_0x5f1c99[_0xa069('0x64')]}));})[_0xa069('0x12')](function(_0x18c7d0){if(!_0x18c7d0)return;var _0x172756={'UserId':_0x1d8adc[_0xa069('0x67')]['id'],'ContactId':_0x18c7d0['id'],'MailAccountId':_0x5f1c99['id'],'inReplyTo':_0x55dc9f[_0xa069('0xa7')],'to':_0x1d8adc[_0xa069('0x4e')]['from'],'cc':_0x1d8adc[_0xa069('0x4e')]['cc'],'subject':_0x1d8adc['body'][_0xa069('0xa8')],'attach':_0x1d8adc[_0xa069('0x4e')][_0xa069('0xa9')],'firstMsgDirection':_0xa069('0xaa'),'lastMsgAt':moment()[_0xa069('0x92')](_0xa069('0x93')),'lastMsgDirection':_0xa069('0xaa'),'Messages':[_[_0xa069('0x45')](_0x1d8adc[_0xa069('0x4e')],{'messageId':_0x55dc9f[_0xa069('0xa7')],'sentAt':moment()[_0xa069('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5f1c99['id'],'UserId':_0x1d8adc[_0xa069('0x67')]['id'],'ContactId':_0x18c7d0['id']})]};if(_0x1d8adc[_0xa069('0x4e')][_0xa069('0xab')]){_0x172756=_[_0xa069('0x45')](_0x172756,_0x1d8adc[_0xa069('0x4e')][_0xa069('0xab')]);}return db[_0xa069('0x7a')][_0xa069('0x55')](_0x172756,{'include':[{'model':db[_0xa069('0x8f')],'as':_0xa069('0xac')}]});})[_0xa069('0x12')](respondWithResult(_0x9b9b35,null))[_0xa069('0x1c')](handleError(_0x9b9b35,null));};exports['verifySmtp']=function(_0x4d7778,_0x25ffa){return db['MailAccount'][_0xa069('0x4d')]({'where':{'id':_0x4d7778[_0xa069('0x4b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xa069('0x30'),'raw':!![],'include':[{'model':db[_0xa069('0x9a')],'as':_0xa069('0x9a'),'raw':!![]}]}]})[_0xa069('0x12')](handleEntityNotFound(_0x25ffa,null))['then'](function(_0xd8369b){if(!_0xd8369b[_0xa069('0x30')])return;var _0x4caa53=_0xd8369b[_0xa069('0xa3')]();return respondWithRpcPromise(_0xa069('0xad'),'verifySmtp',{'account':_0x4caa53});})[_0xa069('0x12')](respondWithResult(_0x25ffa,null))[_0xa069('0x1c')](handleError(_0x25ffa,null));};exports['destroy']=function(_0x3729e6,_0x5f0ae3){return db[_0xa069('0x33')]['find']({'where':{'id':_0x3729e6[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x5f0ae3,null))[_0xa069('0x12')](function(_0x37503b){if(_0x37503b&&_0x37503b[_0xa069('0x6a')]){throw new db[(_0xa069('0xae'))][(_0xa069('0xaf'))](_0xa069('0xb0'));}return _0x37503b;})[_0xa069('0x12')](removeEntity(_0x5f0ae3,null))[_0xa069('0x1c')](handleError(_0x5f0ae3,null));};exports['addAgents']=function(_0x57ab01,_0x183a94){return db[_0xa069('0x33')][_0xa069('0x4d')]({'where':{'id':_0x57ab01[_0xa069('0x4b')]['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x183a94,null))[_0xa069('0x12')](function(_0xe79f8){if(_0xe79f8){return _0xe79f8[_0xa069('0xb1')](_0x57ab01[_0xa069('0x4e')][_0xa069('0x5c')],_[_0xa069('0xb2')](_0x57ab01[_0xa069('0x4e')],[_0xa069('0x5c'),'id'])||{})[_0xa069('0xb3')](function(_0x2993bc){for(var _0x2e3bb1=0x0;_0x2e3bb1<_0x57ab01[_0xa069('0x4e')]['ids'][_0xa069('0x3c')];_0x2e3bb1+=0x1){socket[_0xa069('0xb4')](_0xa069('0xb5'),{'UserId':Number(_0x57ab01[_0xa069('0x4e')][_0xa069('0x5c')][_0x2e3bb1]),'MailAccountId':Number(_0x57ab01[_0xa069('0x4b')]['id'])});}return _0x2993bc;});}})[_0xa069('0x12')](respondWithResult(_0x183a94,null))['catch'](handleError(_0x183a94,null));};exports[_0xa069('0xb6')]=function(_0x3c60e6,_0x1b6963){return db['MailAccount']['find']({'where':{'id':_0x3c60e6['params']['id']}})[_0xa069('0x12')](handleEntityNotFound(_0x1b6963,null))[_0xa069('0x12')](function(_0x42ba03){if(_0x42ba03){return _0x42ba03[_0xa069('0xb6')](_0x3c60e6['query'][_0xa069('0x5c')])[_0xa069('0x12')](function(){if(_[_0xa069('0xb7')](_0x3c60e6[_0xa069('0x35')]['ids'])){for(var _0x37ec6f=0x0;_0x37ec6f<_0x3c60e6[_0xa069('0x35')][_0xa069('0x5c')]['length'];_0x37ec6f+=0x1){socket[_0xa069('0xb4')](_0xa069('0xb8'),{'UserId':Number(_0x3c60e6[_0xa069('0x35')]['ids'][_0x37ec6f]),'MailAccountId':Number(_0x3c60e6['params']['id'])});}}else{socket[_0xa069('0xb4')](_0xa069('0xb8'),{'UserId':Number(_0x3c60e6[_0xa069('0x35')][_0xa069('0x5c')]),'MailAccountId':Number(_0x3c60e6[_0xa069('0x4b')]['id'])});}});}})[_0xa069('0x12')](respondWithStatusCode(_0x1b6963,null))['catch'](handleError(_0x1b6963,null));};exports[_0xa069('0xb9')]=function(_0x1ae02e,_0x1b34ff){var _0x92d69={};var _0x356641={};var _0x5ad3a9;var _0xbf126e;return db[_0xa069('0x33')]['findOne']({'where':{'id':_0x1ae02e[_0xa069('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b34ff,null))[_0xa069('0x12')](function(_0x5f2183){if(_0x5f2183){_0x5ad3a9=_0x5f2183;_0x356641['model']=_['keys'](db['User']['rawAttributes']);_0x356641['query']=_['keys'](_0x1ae02e[_0xa069('0x35')]);_0x356641[_0xa069('0x37')]=_['intersection'](_0x356641[_0xa069('0x3a')],_0x356641[_0xa069('0x35')]);_0x92d69[_0xa069('0x39')]=_['intersection'](_0x356641[_0xa069('0x3a')],qs[_0xa069('0x3b')](_0x1ae02e[_0xa069('0x35')][_0xa069('0x3b')]));_0x92d69[_0xa069('0x39')]=_0x92d69[_0xa069('0x39')][_0xa069('0x3c')]?_0x92d69['attributes']:_0x356641[_0xa069('0x3a')];_0x92d69[_0xa069('0x3e')]=qs[_0xa069('0x3f')](_0x1ae02e[_0xa069('0x35')][_0xa069('0x3f')]);_0x92d69[_0xa069('0x40')]=qs['filters'](_[_0xa069('0x41')](_0x1ae02e[_0xa069('0x35')],_0x356641[_0xa069('0x37')]));if(_0x1ae02e[_0xa069('0x35')][_0xa069('0x42')]){_0x92d69[_0xa069('0x40')]=_['merge'](_0x92d69[_0xa069('0x40')],{'$or':_[_0xa069('0x32')](_0x92d69[_0xa069('0x39')],function(_0x43b86a){var _0x1a2776={};_0x1a2776[_0x43b86a]={'$like':'%'+_0x1ae02e['query'][_0xa069('0x42')]+'%'};return _0x1a2776;})});}_0x92d69=_[_0xa069('0x45')]({},_0x92d69,_0x1ae02e['options']);return _0x5ad3a9[_0xa069('0xb9')](_0x92d69);}})[_0xa069('0x12')](function(_0x2599e7){if(_0x2599e7){_0xbf126e=_0x2599e7['length'];if(!_0x1ae02e[_0xa069('0x35')][_0xa069('0x59')](_0xa069('0x3d'))){_0x92d69[_0xa069('0x22')]=qs['limit'](_0x1ae02e['query']['limit']);_0x92d69['offset']=qs[_0xa069('0x20')](_0x1ae02e[_0xa069('0x35')][_0xa069('0x20')]);}return _0x5ad3a9[_0xa069('0xb9')](_0x92d69);}})[_0xa069('0x12')](function(_0x36d70f){if(_0x36d70f){return _0x36d70f?{'count':_0xbf126e,'rows':_0x36d70f}:null;}})[_0xa069('0x12')](respondWithResult(_0x1b34ff,null))[_0xa069('0x1c')](handleError(_0x1b34ff,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 7369162..f878ce9 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 _0x1f2d=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2130ce,_0x3e261c){var _0x36fd35=function(_0x2e3e86){while(--_0x2e3e86){_0x2130ce['push'](_0x2130ce['shift']());}};_0x36fd35(++_0x3e261c);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x30b145,_0x5b1406){_0x30b145=_0x30b145-0x0;var _0x5acce4=_0x1f2d[_0x30b145];return _0x5acce4;};'use strict';var EventEmitter=require(_0xd1f2('0x0'));var MailAccount=require(_0xd1f2('0x1'))['db'][_0xd1f2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd1f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1f2('0x4'),'afterDestroy':_0xd1f2('0x5')};function emitEvent(_0x13626e){return function(_0xd4f928,_0x21f154,_0x194b49){MailAccountEvents[_0xd1f2('0x6')](_0x13626e+':'+_0xd4f928['id'],_0xd4f928);MailAccountEvents[_0xd1f2('0x6')](_0x13626e,_0xd4f928);_0x194b49(null);};}for(var e in events){if(events[_0xd1f2('0x7')](e)){var event=events[e];MailAccount[_0xd1f2('0x8')](e,emitEvent(event));}}module[_0xd1f2('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xece5=['hook','exports','events','../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x1bf8b1,_0x1b11cd){var _0x37fb94=function(_0x33a62c){while(--_0x33a62c){_0x1bf8b1['push'](_0x1bf8b1['shift']());}};_0x37fb94(++_0x1b11cd);}(_0xece5,0x12e));var _0x5ece=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xece5[_0x68c979];return _0x4f0001;};'use strict';var EventEmitter=require(_0x5ece('0x0'));var MailAccount=require(_0x5ece('0x1'))['db'][_0x5ece('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ece('0x3'),'afterUpdate':_0x5ece('0x4'),'afterDestroy':_0x5ece('0x5')};function emitEvent(_0x3bb8c9){return function(_0x1f254c,_0xb4c64c,_0x435818){MailAccountEvents['emit'](_0x3bb8c9+':'+_0x1f254c['id'],_0x1f254c);MailAccountEvents[_0x5ece('0x6')](_0x3bb8c9,_0x1f254c);_0x435818(null);};}for(var e in events){if(events[_0x5ece('0x7')](e)){var event=events[e];MailAccount[_0x5ece('0x8')](e,emitEvent(event));}}module[_0x5ece('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index fed5541..eaf3920 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 _0x9f0f=['mail_accounts','provider','service','host','port','secure','Smtp','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','define','MailAccount'];(function(_0x5da958,_0x257264){var _0x1ed48d=function(_0x4af5d8){while(--_0x4af5d8){_0x5da958['push'](_0x5da958['shift']());}};_0x1ed48d(++_0x257264);}(_0x9f0f,0xce));var _0xf9f0=function(_0x411b14,_0x3f9e36){_0x411b14=_0x411b14-0x0;var _0x402736=_0x9f0f[_0x411b14];return _0x402736;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x4d27e3){return _0x4d27e3[_0xf9f0('0x0')](_0xf9f0('0x1'),attributes,{'tableName':_0xf9f0('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x15302b=this;var _0x3da627={'id':_0x15302b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x15302b[_0xf9f0('0x3')]!=='custom'){_0x3da627[_0xf9f0('0x4')]=_0x15302b[_0xf9f0('0x3')];}else{_0x3da627[_0xf9f0('0x5')]=_0x15302b['Smtp'][_0xf9f0('0x5')];_0x3da627[_0xf9f0('0x6')]=_0x15302b['Smtp']['port'];_0x3da627[_0xf9f0('0x7')]=_0x15302b[_0xf9f0('0x8')][_0xf9f0('0x7')];}if(_0x15302b[_0xf9f0('0x8')][_0xf9f0('0x9')]){if(_0x15302b['Smtp'][_0xf9f0('0xa')]){if(!_0x15302b[_0xf9f0('0x8')]['CloudProvider'])throw new Error(_0xf9f0('0xb'));_0x3da627[_0xf9f0('0xc')]={'type':_0xf9f0('0xd'),'user':_0x15302b['Smtp']['user'],'accessToken':_0x15302b[_0xf9f0('0x8')]['CloudProvider']['data5']};}else{_0x3da627[_0xf9f0('0xc')]={'user':_0x15302b[_0xf9f0('0x8')][_0xf9f0('0xe')],'pass':_0x15302b[_0xf9f0('0x8')][_0xf9f0('0xf')]};}}return _0x3da627;}}});}; \ No newline at end of file +var _0x543a=['provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','pass','./mailAccount.attributes','define','MailAccount'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x543a,0xce));var _0xa543=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x543a[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xa543('0x0'));module['exports']=function(_0x1f8f7a){return _0x1f8f7a[_0xa543('0x1')](_0xa543('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x553218=this;var _0x5cd9a3={'id':_0x553218['id'],'tls':{'rejectUnauthorized':![]}};if(_0x553218[_0xa543('0x3')]!==_0xa543('0x4')){_0x5cd9a3[_0xa543('0x5')]=_0x553218[_0xa543('0x3')];}else{_0x5cd9a3[_0xa543('0x6')]=_0x553218[_0xa543('0x7')][_0xa543('0x6')];_0x5cd9a3[_0xa543('0x8')]=_0x553218[_0xa543('0x7')][_0xa543('0x8')];_0x5cd9a3[_0xa543('0x9')]=_0x553218[_0xa543('0x7')][_0xa543('0x9')];}if(_0x553218[_0xa543('0x7')][_0xa543('0xa')]){if(_0x553218[_0xa543('0x7')][_0xa543('0xb')]){if(!_0x553218[_0xa543('0x7')][_0xa543('0xc')])throw new Error(_0xa543('0xd'));_0x5cd9a3[_0xa543('0xe')]={'type':_0xa543('0xf'),'user':_0x553218['Smtp']['user'],'accessToken':_0x553218[_0xa543('0x7')][_0xa543('0xc')][_0xa543('0x10')]};}else{_0x5cd9a3[_0xa543('0xe')]={'user':_0x553218[_0xa543('0x7')][_0xa543('0x11')],'pass':_0x553218['Smtp'][_0xa543('0x12')]};}}return _0x5cd9a3;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7e8cf6b..4daed4a 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 _0xbcb8=['where','limit','include','model','map','attributes','ShowMailAccount','find','mail','keys','CmContact','rawAttributes','updatedAt','CompanyId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','Applications','Smtp','CloudProvider','List','get','smtpOptions','getSmtpOptions','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','from','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','create','Contact\x20not\x20found','spread','interaction','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','ioredis','../../mysqldb','jayson/promise','client','defaults','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','result','catch','GetMailAccount','MailAccount','findAll','options','raw'];(function(_0x51dd8f,_0x82f4a0){var _0x2e00af=function(_0x46f2a1){while(--_0x46f2a1){_0x51dd8f['push'](_0x51dd8f['shift']());}};_0x2e00af(++_0x82f4a0);}(_0xbcb8,0x17b));var _0x8bcb=function(_0x3c2dfe,_0x5a2445){_0x3c2dfe=_0x3c2dfe-0x0;var _0x542d61=_0xbcb8[_0x3c2dfe];return _0x542d61;};'use strict';var _=require(_0x8bcb('0x0'));var moment=require(_0x8bcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x8bcb('0x2'));var db=require(_0x8bcb('0x3'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8bcb('0x4'));var client=jayson[_0x8bcb('0x5')]['http']({'port':0x232c});config['redis']=_[_0x8bcb('0x6')](config[_0x8bcb('0x7')],{'host':_0x8bcb('0x8'),'port':0x18eb});var socket=require(_0x8bcb('0x9'))(new Redis(config[_0x8bcb('0x7')]));require('./mailAccount.socket')[_0x8bcb('0xa')](socket);function respondWithRpcPromise(_0x2a0cc4,_0x4de139,_0x471e48){return new BPromise(function(_0xb32ab6,_0x287ed4){return client[_0x8bcb('0xb')](_0x2a0cc4,_0x471e48)[_0x8bcb('0xc')](function(_0x1b49da){logger[_0x8bcb('0xd')](_0x8bcb('0xe'),_0x4de139,_0x8bcb('0xf'));logger[_0x8bcb('0x10')](_0x8bcb('0x11'),_0x4de139,_0x8bcb('0xf'),JSON[_0x8bcb('0x12')](_0x1b49da));if(_0x1b49da[_0x8bcb('0x13')]){if(_0x1b49da[_0x8bcb('0x13')][_0x8bcb('0x14')]===0x1f4){logger[_0x8bcb('0x13')](_0x8bcb('0xe'),_0x4de139,_0x1b49da['error'][_0x8bcb('0x15')]);return _0x287ed4(_0x1b49da[_0x8bcb('0x13')]['message']);}logger['error'](_0x8bcb('0xe'),_0x4de139,_0x1b49da[_0x8bcb('0x13')][_0x8bcb('0x15')]);return _0xb32ab6(_0x1b49da[_0x8bcb('0x13')][_0x8bcb('0x15')]);}else{logger[_0x8bcb('0xd')]('MailAccount,\x20%s,\x20%s',_0x4de139,'request\x20sent');_0xb32ab6(_0x1b49da[_0x8bcb('0x16')][_0x8bcb('0x15')]);}})[_0x8bcb('0x17')](function(_0x11c593){logger['error'](_0x8bcb('0xe'),_0x4de139,_0x11c593);_0x287ed4(_0x11c593);});});}exports[_0x8bcb('0x18')]=function(_0x30976d){var _0x167502=this;return new Promise(function(_0x1b1b52,_0x8df35c){return db[_0x8bcb('0x19')][_0x8bcb('0x1a')]({'raw':_0x30976d[_0x8bcb('0x1b')]?_0x30976d[_0x8bcb('0x1b')][_0x8bcb('0x1c')]===undefined?!![]:![]:!![],'where':_0x30976d[_0x8bcb('0x1b')]?_0x30976d[_0x8bcb('0x1b')][_0x8bcb('0x1d')]||null:null,'attributes':_0x30976d[_0x8bcb('0x1b')]?_0x30976d[_0x8bcb('0x1b')]['attributes']||null:null,'limit':_0x30976d[_0x8bcb('0x1b')]?_0x30976d['options'][_0x8bcb('0x1e')]||null:null,'include':_0x30976d[_0x8bcb('0x1b')]?_0x30976d[_0x8bcb('0x1b')][_0x8bcb('0x1f')]?_['map'](_0x30976d[_0x8bcb('0x1b')][_0x8bcb('0x1f')],function(_0x1bc21a){return{'model':db[_0x1bc21a[_0x8bcb('0x20')]],'as':_0x1bc21a['as'],'attributes':_0x1bc21a['attributes'],'include':_0x1bc21a[_0x8bcb('0x1f')]?_[_0x8bcb('0x21')](_0x1bc21a[_0x8bcb('0x1f')],function(_0x145a11){return{'model':db[_0x145a11[_0x8bcb('0x20')]],'as':_0x145a11['as'],'attributes':_0x145a11[_0x8bcb('0x22')],'include':_0x145a11[_0x8bcb('0x1f')]?_[_0x8bcb('0x21')](_0x145a11['include'],function(_0x3f3af4){return{'model':db[_0x3f3af4[_0x8bcb('0x20')]],'as':_0x3f3af4['as'],'attributes':_0x3f3af4['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bcb('0xc')](function(_0x1402e9){logger[_0x8bcb('0xd')](_0x8bcb('0x18'),_0x30976d);logger[_0x8bcb('0x10')](_0x8bcb('0x18'),_0x30976d,JSON['stringify'](_0x1402e9));_0x1b1b52(_0x1402e9);})[_0x8bcb('0x17')](function(_0x5e37c7){logger[_0x8bcb('0x13')](_0x8bcb('0x18'),_0x5e37c7[_0x8bcb('0x15')],_0x30976d);_0x8df35c(_0x167502[_0x8bcb('0x13')](0x1f4,_0x5e37c7[_0x8bcb('0x15')]));});});};exports[_0x8bcb('0x23')]=function(_0x3ba84a){var _0x3eb8fa=this;return new Promise(function(_0x28a058,_0x37b9b3){return db[_0x8bcb('0x19')][_0x8bcb('0x24')]({'raw':_0x3ba84a[_0x8bcb('0x1b')]?_0x3ba84a['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ba84a['options']?_0x3ba84a[_0x8bcb('0x1b')][_0x8bcb('0x1d')]||null:null,'attributes':_0x3ba84a[_0x8bcb('0x1b')]?_0x3ba84a[_0x8bcb('0x1b')][_0x8bcb('0x22')]||null:null,'include':_0x3ba84a[_0x8bcb('0x1b')]?_0x3ba84a[_0x8bcb('0x1b')][_0x8bcb('0x1f')]?_['map'](_0x3ba84a[_0x8bcb('0x1b')][_0x8bcb('0x1f')],function(_0x58c62e){return{'model':db[_0x58c62e[_0x8bcb('0x20')]],'as':_0x58c62e['as'],'attributes':_0x58c62e[_0x8bcb('0x22')],'include':_0x58c62e[_0x8bcb('0x1f')]?_[_0x8bcb('0x21')](_0x58c62e[_0x8bcb('0x1f')],function(_0x59a8b2){return{'model':db[_0x59a8b2[_0x8bcb('0x20')]],'as':_0x59a8b2['as'],'attributes':_0x59a8b2['attributes'],'include':_0x59a8b2[_0x8bcb('0x1f')]?_[_0x8bcb('0x21')](_0x59a8b2[_0x8bcb('0x1f')],function(_0x5e176a){return{'model':db[_0x5e176a[_0x8bcb('0x20')]],'as':_0x5e176a['as'],'attributes':_0x5e176a[_0x8bcb('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8bcb('0xc')](function(_0x1b1de9){logger['info'](_0x8bcb('0x23'),_0x3ba84a);logger[_0x8bcb('0x10')]('ShowMailAccount',_0x3ba84a,JSON[_0x8bcb('0x12')](_0x1b1de9));_0x28a058(_0x1b1de9);})[_0x8bcb('0x17')](function(_0x1bda73){logger[_0x8bcb('0x13')](_0x8bcb('0x23'),_0x1bda73['message'],_0x3ba84a);_0x37b9b3(_0x3eb8fa[_0x8bcb('0x13')](0x1f4,_0x1bda73['message']));});});};exports['NotifyMailAccount']=function(_0x3efe6c){var _0x8dd914=this;return new Promise(function(_0x2d8fe4,_0x1ba0d5){var _0x1257e7={'body':_0x3efe6c['body'],'channel':_0x8bcb('0x25')};var _0x3a83b9=_['difference'](_[_0x8bcb('0x26')](db[_0x8bcb('0x27')][_0x8bcb('0x28')]),['createdAt',_0x8bcb('0x29'),_0x8bcb('0x2a'),'ListId']);var _0x109a38=![];if(_0x3efe6c[_0x8bcb('0x2b')]['id']){delete _0x3efe6c[_0x8bcb('0x2b')]['id'];}if(_[_0x8bcb('0x2c')](_0x3efe6c[_0x8bcb('0x2b')]['from'])){return _0x1ba0d5(_0x8dd914[_0x8bcb('0x13')](0x1f4,_0x8bcb('0x2d')));}if(_[_0x8bcb('0x2c')](_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2b')])||_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2b')]===''){return _0x1ba0d5(_0x8dd914[_0x8bcb('0x13')](0x1f4,_0x8bcb('0x2e')));}if(_['isNil'](_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2f')])){return _0x1ba0d5(_0x8dd914[_0x8bcb('0x13')](0x1f4,_0x8bcb('0x30')+_0x3a83b9));}if(!_['includes'](_0x3a83b9,_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2f')])){return _0x1ba0d5(_0x8dd914['error'](0x1f4,_0x8bcb('0x31')+_0x3a83b9));}var _0x2693c3={};_0x2693c3[_0x3efe6c[_0x8bcb('0x2b')]['mapKey']]=_0x3efe6c['body']['from'];return db[_0x8bcb('0x19')][_0x8bcb('0x24')]({'where':{'id':_0x3efe6c[_0x8bcb('0x32')]['id']},'include':[{'model':db[_0x8bcb('0x33')],'as':'List','include':[{'model':db[_0x8bcb('0x27')],'as':_0x8bcb('0x34'),'where':_0x2693c3,'limit':0x1,'order':[[_0x8bcb('0x29'),_0x8bcb('0x35')]]}]},{'model':db[_0x8bcb('0x36')],'as':_0x8bcb('0x37')},{'model':db['MailServerOut'],'as':_0x8bcb('0x38'),'include':[{'model':db['CloudProvider'],'as':_0x8bcb('0x39')}]}]})[_0x8bcb('0xc')](function(_0x5f6360){if(_0x5f6360&&_0x5f6360[_0x8bcb('0x3a')]){var _0x132e88=_0x5f6360[_0x8bcb('0x3b')]({'plain':!![]});_0x1257e7[_0x8bcb('0x32')]=_['omit'](_0x132e88,[_0x8bcb('0x37'),_0x8bcb('0x3a')]);_0x1257e7[_0x8bcb('0x32')][_0x8bcb('0x3c')]=_0x5f6360[_0x8bcb('0x3d')]();_0x1257e7[_0x8bcb('0x3e')]=_0x132e88[_0x8bcb('0x37')];_0x1257e7[_0x8bcb('0x3f')]=_0x132e88[_0x8bcb('0x3a')];_0x1257e7[_0x8bcb('0x3e')]=_[_0x8bcb('0x40')](_0x1257e7['applications'],[_0x8bcb('0x41')],[_0x8bcb('0x42')]);if(_0x1257e7[_0x8bcb('0x32')]&&_0x1257e7['account'][_0x8bcb('0x43')]){_0x1257e7[_0x8bcb('0x3e')][_0x8bcb('0x44')]({'id':0x0,'priority':_0x1257e7[_0x8bcb('0x3e')][_0x8bcb('0x45')]+0x1,'app':_0x8bcb('0x46'),'appdata':_0x8bcb('0x43'),'interval':_0x8bcb('0x47')});}if(_0x1257e7[_0x8bcb('0x32')][_0x8bcb('0x37')]){delete _0x1257e7['account'][_0x8bcb('0x37')];}if(_0x1257e7[_0x8bcb('0x32')][_0x8bcb('0x3a')]){delete _0x1257e7[_0x8bcb('0x32')]['List'];}if(_0x132e88[_0x8bcb('0x3a')][_0x8bcb('0x34')]['length']){return _0x132e88[_0x8bcb('0x3a')][_0x8bcb('0x34')][0x0];}var _0x28738c=_['defaults'](_0x3efe6c[_0x8bcb('0x2b')],{'firstName':_0x3efe6c[_0x8bcb('0x2b')]['from'],'ListId':_0x132e88['ListId']});_0x28738c[_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2f')]]=_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x48')];return db['CmContact']['create'](_0x28738c);}else{throw new Error(_0x8bcb('0x49'));}})['then'](function(_0x49df65){_0x1257e7['contact']=_0x49df65;if(_0x49df65){if(!_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x4a')]){_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['messageId']=rs['generate']()+'\x20'+_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x48')];}var _0x3f324b={'ContactId':_0x49df65['id'],'MailAccountId':_0x3efe6c[_0x8bcb('0x32')]['id'],'inReplyTo':_0x3efe6c[_0x8bcb('0x2b')]['message'][_0x8bcb('0x4a')],'to':_0x3efe6c[_0x8bcb('0x2b')]['message'][_0x8bcb('0x48')],'cc':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['cc'],'subject':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x4b')],'attach':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x4c')],'lastMsgAt':moment()[_0x8bcb('0x4d')](_0x8bcb('0x4e')),'lastMsgDirection':'in'};return db[_0x8bcb('0x4f')][_0x8bcb('0x24')]({'where':{'closed':![],'MailAccountId':_0x3efe6c[_0x8bcb('0x32')]['id']},'include':[{'model':db[_0x8bcb('0x50')],'as':_0x8bcb('0x51'),'attributes':[_0x8bcb('0x4a')],'where':{'messageId':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['inReplyTo']}}]})[_0x8bcb('0xc')](function(_0x173e5a){if(_0x173e5a){return[_0x173e5a,![]];}return db['MailInteraction'][_0x8bcb('0x52')](_0x3f324b)[_0x8bcb('0xc')](function(_0x55caf4){return[_0x55caf4,!![]];});});}else{throw new Error(_0x8bcb('0x53'));}})[_0x8bcb('0x54')](function(_0xcb1369,_0x1dee8b){if(_0xcb1369){_0x109a38=_0x1dee8b;if(!_0x1dee8b){return _0xcb1369['update']({'inReplyTo':_0x3efe6c[_0x8bcb('0x2b')]['message']['messageId'],'to':_0x3efe6c['body'][_0x8bcb('0x15')][_0x8bcb('0x48')],'cc':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['cc'],'subject':_0x3efe6c['body'][_0x8bcb('0x15')][_0x8bcb('0x4b')],'attach':_0xcb1369['attach']?_0xcb1369[_0x8bcb('0x4c')]:_0x3efe6c[_0x8bcb('0x2b')]['message'][_0x8bcb('0x4c')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x8bcb('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0xcb1369;}}})[_0x8bcb('0xc')](function(_0x2b81c8){_0x1257e7[_0x8bcb('0x55')]=_0x2b81c8[_0x8bcb('0x3b')]({'plain':!![]});_0x1257e7['interaction']['created']=_0x109a38;return db['MailMessage']['create']({'body':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x2b')],'MailAccountId':_0x3efe6c[_0x8bcb('0x32')]['id'],'MailInteractionId':_0x2b81c8['id'],'direction':'in','ContactId':_0x1257e7['contact']['id'],'messageId':_0x3efe6c['body'][_0x8bcb('0x15')][_0x8bcb('0x4a')],'from':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['from'],'to':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')]['to'],'cc':_0x3efe6c[_0x8bcb('0x2b')]['message']['cc'],'subject':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x4b')],'attach':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x4c')],'Attachments':_0x3efe6c['body']['message'][_0x8bcb('0x56')],'originTo':_0x3efe6c[_0x8bcb('0x2b')]['message'][_0x8bcb('0x57')],'originCc':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x58')],'bcc':_0x3efe6c['body']['message']['bcc'],'ChatWebsiteId':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x59')]||null,'originChannel':_0x3efe6c[_0x8bcb('0x2b')]['message'][_0x8bcb('0x5a')]||_0x8bcb('0x5b'),'ChatOfflineMessageId':_0x3efe6c[_0x8bcb('0x2b')][_0x8bcb('0x15')][_0x8bcb('0x5c')]||null},{'include':[{'model':db[_0x8bcb('0x5d')],'as':'Attachments'}]});})[_0x8bcb('0xc')](function(_0x3a5fdf){_0x1257e7[_0x8bcb('0x15')]=_0x3a5fdf;if(_0x1257e7[_0x8bcb('0x55')]['UserId']){return db[_0x8bcb('0x5e')][_0x8bcb('0x24')]({'attributes':['id',_0x8bcb('0x5f')],'where':{'id':_0x1257e7['interaction'][_0x8bcb('0x60')]}})[_0x8bcb('0xc')](function(_0x313002){if(_0x313002){_0x1257e7[_0x8bcb('0x3e')][_0x8bcb('0x61')]({'id':0x0,'priority':0x0,'app':_0x8bcb('0x62'),'appdata':_0x313002[_0x8bcb('0x5f')]+','+(_0x1257e7[_0x8bcb('0x32')][_0x8bcb('0x63')]||0xa),'interval':_0x8bcb('0x47')});}return respondWithRpcPromise(_0x8bcb('0x64'),_0x8bcb('0x65'),_0x1257e7);});}return respondWithRpcPromise(_0x8bcb('0x64'),_0x8bcb('0x65'),_0x1257e7);})[_0x8bcb('0xc')](function(_0x31e23f){_0x2d8fe4(_0x31e23f);})['catch'](function(_0x1686e1){_0x1ba0d5(_0x8dd914['error'](0x1f4,_0x1686e1[_0x8bcb('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['find','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','CloudProvider','get','smtpOptions','getSmtpOptions','applications','list','priority','asc','autoclose','length','close','*,*,*,*','List\x20not\x20found','messageId','subject','format','MailInteraction','MailMessage','Messages','create','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','MailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x28e23e,_0x3731fb){var _0x4160bd=function(_0x1bd6bc){while(--_0x1bd6bc){_0x28e23e['push'](_0x28e23e['shift']());}};_0x4160bd(++_0x3731fb);}(_0x7a54,0x106));var _0x47a5=function(_0x3cd36a,_0x1442c6){_0x3cd36a=_0x3cd36a-0x0;var _0x2a55f8=_0x7a54[_0x3cd36a];return _0x2a55f8;};'use strict';var _=require(_0x47a5('0x0'));var moment=require(_0x47a5('0x1'));var BPromise=require(_0x47a5('0x2'));var rs=require('randomstring');var Redis=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var client=jayson[_0x47a5('0x8')][_0x47a5('0x9')]({'port':0x232c});config['redis']=_[_0x47a5('0xa')](config['redis'],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require(_0x47a5('0xc'))(new Redis(config['redis']));require(_0x47a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d90b3,_0x582352,_0x2a0e98){return new BPromise(function(_0x2baee7,_0x5e31dd){return client[_0x47a5('0xe')](_0x5d90b3,_0x2a0e98)['then'](function(_0x5de6d7){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x582352,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x582352,_0x47a5('0x11'),JSON[_0x47a5('0x14')](_0x5de6d7));if(_0x5de6d7['error']){if(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x5e31dd(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}logger['error'](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2baee7(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x582352,_0x47a5('0x11'));_0x2baee7(_0x5de6d7['result']['message']);}})[_0x47a5('0x18')](function(_0xaf70a6){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0xaf70a6);_0x5e31dd(_0xaf70a6);});});}exports[_0x47a5('0x19')]=function(_0x12b98e){var _0x2763d6=this;return new Promise(function(_0xe3c618,_0x3aed38){return db['MailAccount'][_0x47a5('0x1a')]({'raw':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1d')]||null:null,'limit':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1e')]||null:null,'include':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1f')]?_['map'](_0x3abd6a[_0x47a5('0x1f')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x21')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1d')],'include':_0x5b6c4e[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x5b6c4e[_0x47a5('0x1f')],function(_0x3ba0b7){return{'model':db[_0x3ba0b7[_0x47a5('0x21')]],'as':_0x3ba0b7['as'],'attributes':_0x3ba0b7[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x361bfa){logger[_0x47a5('0xf')](_0x47a5('0x19'),_0x12b98e);logger[_0x47a5('0x12')]('GetMailAccount',_0x12b98e,JSON[_0x47a5('0x14')](_0x361bfa));_0xe3c618(_0x361bfa);})['catch'](function(_0x2ef875){logger[_0x47a5('0x15')](_0x47a5('0x19'),_0x2ef875['message'],_0x12b98e);_0x3aed38(_0x2763d6[_0x47a5('0x15')](0x1f4,_0x2ef875[_0x47a5('0x17')]));});});};exports[_0x47a5('0x23')]=function(_0x1f1c68){var _0x51cc81=this;return new Promise(function(_0x50d875,_0x6f9a12){return db[_0x47a5('0x24')]['find']({'raw':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x1f1c68[_0x47a5('0x1b')]?_0x1f1c68[_0x47a5('0x1b')]['attributes']||null:null,'include':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['include']?_[_0x47a5('0x20')](_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x21')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x20')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1d')],'include':_0x25cce0[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x25cce0[_0x47a5('0x1f')],function(_0x36add5){return{'model':db[_0x36add5[_0x47a5('0x21')]],'as':_0x36add5['as'],'attributes':_0x36add5[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x1a0d23){logger['info'](_0x47a5('0x23'),_0x1f1c68);logger[_0x47a5('0x12')]('ShowMailAccount',_0x1f1c68,JSON[_0x47a5('0x14')](_0x1a0d23));_0x50d875(_0x1a0d23);})[_0x47a5('0x18')](function(_0x1d4348){logger['error'](_0x47a5('0x23'),_0x1d4348[_0x47a5('0x17')],_0x1f1c68);_0x6f9a12(_0x51cc81['error'](0x1f4,_0x1d4348[_0x47a5('0x17')]));});});};exports[_0x47a5('0x25')]=function(_0x54ae35){var _0x55c5eb=this;return new Promise(function(_0x5ebd8c,_0x12d9f2){var _0x5c569e={'body':_0x54ae35[_0x47a5('0x26')],'channel':_0x47a5('0x27')};var _0x301a85=_[_0x47a5('0x28')](_[_0x47a5('0x29')](db[_0x47a5('0x2a')][_0x47a5('0x2b')]),[_0x47a5('0x2c'),_0x47a5('0x2d'),_0x47a5('0x2e'),_0x47a5('0x2f')]);var _0x1658e8=![];if(_0x54ae35[_0x47a5('0x26')]['id']){delete _0x54ae35['body']['id'];}if(_[_0x47a5('0x30')](_0x54ae35[_0x47a5('0x26')][_0x47a5('0x31')])){return _0x12d9f2(_0x55c5eb[_0x47a5('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x47a5('0x30')](_0x54ae35['body']['body'])||_0x54ae35['body']['body']===''){return _0x12d9f2(_0x55c5eb[_0x47a5('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x47a5('0x30')](_0x54ae35[_0x47a5('0x26')][_0x47a5('0x32')])){return _0x12d9f2(_0x55c5eb['error'](0x1f4,_0x47a5('0x33')+_0x301a85));}if(!_[_0x47a5('0x34')](_0x301a85,_0x54ae35['body']['mapKey'])){return _0x12d9f2(_0x55c5eb[_0x47a5('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x301a85));}var _0x1609dc={};_0x1609dc[_0x54ae35[_0x47a5('0x26')][_0x47a5('0x32')]]=_0x54ae35[_0x47a5('0x26')][_0x47a5('0x31')];return db[_0x47a5('0x24')][_0x47a5('0x35')]({'where':{'id':_0x54ae35[_0x47a5('0x36')]['id']},'include':[{'model':db[_0x47a5('0x37')],'as':_0x47a5('0x38'),'include':[{'model':db[_0x47a5('0x2a')],'as':_0x47a5('0x39'),'where':_0x1609dc,'limit':0x1,'order':[[_0x47a5('0x2d'),_0x47a5('0x3a')]]}]},{'model':db[_0x47a5('0x3b')],'as':_0x47a5('0x3c')},{'model':db['MailServerOut'],'as':_0x47a5('0x3d'),'include':[{'model':db[_0x47a5('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x3d0a88){if(_0x3d0a88&&_0x3d0a88['List']){var _0x13750d=_0x3d0a88[_0x47a5('0x3f')]({'plain':!![]});_0x5c569e['account']=_['omit'](_0x13750d,[_0x47a5('0x3c'),'List']);_0x5c569e[_0x47a5('0x36')][_0x47a5('0x40')]=_0x3d0a88[_0x47a5('0x41')]();_0x5c569e[_0x47a5('0x42')]=_0x13750d[_0x47a5('0x3c')];_0x5c569e[_0x47a5('0x43')]=_0x13750d[_0x47a5('0x38')];_0x5c569e['applications']=_['orderBy'](_0x5c569e[_0x47a5('0x42')],[_0x47a5('0x44')],[_0x47a5('0x45')]);if(_0x5c569e[_0x47a5('0x36')]&&_0x5c569e[_0x47a5('0x36')][_0x47a5('0x46')]){_0x5c569e[_0x47a5('0x42')]['push']({'id':0x0,'priority':_0x5c569e[_0x47a5('0x42')][_0x47a5('0x47')]+0x1,'app':_0x47a5('0x48'),'appdata':'autoclose','interval':_0x47a5('0x49')});}if(_0x5c569e['account'][_0x47a5('0x3c')]){delete _0x5c569e[_0x47a5('0x36')][_0x47a5('0x3c')];}if(_0x5c569e[_0x47a5('0x36')]['List']){delete _0x5c569e[_0x47a5('0x36')][_0x47a5('0x38')];}if(_0x13750d[_0x47a5('0x38')][_0x47a5('0x39')][_0x47a5('0x47')]){return _0x13750d[_0x47a5('0x38')][_0x47a5('0x39')][0x0];}var _0x481089=_[_0x47a5('0xa')](_0x54ae35[_0x47a5('0x26')],{'firstName':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x31')],'ListId':_0x13750d[_0x47a5('0x2f')]});_0x481089[_0x54ae35[_0x47a5('0x26')]['mapKey']]=_0x54ae35[_0x47a5('0x26')][_0x47a5('0x31')];return db[_0x47a5('0x2a')]['create'](_0x481089);}else{throw new Error(_0x47a5('0x4a'));}})[_0x47a5('0x22')](function(_0x183b3c){_0x5c569e['contact']=_0x183b3c;if(_0x183b3c){if(!_0x54ae35['body'][_0x47a5('0x17')][_0x47a5('0x4b')]){_0x54ae35['body']['message'][_0x47a5('0x4b')]=rs['generate']()+'\x20'+_0x54ae35[_0x47a5('0x26')]['message']['from'];}var _0x389ed9={'ContactId':_0x183b3c['id'],'MailAccountId':_0x54ae35[_0x47a5('0x36')]['id'],'inReplyTo':_0x54ae35['body'][_0x47a5('0x17')][_0x47a5('0x4b')],'to':_0x54ae35['body']['message'][_0x47a5('0x31')],'cc':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['cc'],'subject':_0x54ae35[_0x47a5('0x26')]['message'][_0x47a5('0x4c')],'attach':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['attach'],'lastMsgAt':moment()[_0x47a5('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x47a5('0x4e')][_0x47a5('0x35')]({'where':{'closed':![],'MailAccountId':_0x54ae35[_0x47a5('0x36')]['id']},'include':[{'model':db[_0x47a5('0x4f')],'as':_0x47a5('0x50'),'attributes':['messageId'],'where':{'messageId':_0x54ae35[_0x47a5('0x26')]['message']['inReplyTo']}}]})['then'](function(_0x4f8564){if(_0x4f8564){return[_0x4f8564,![]];}return db[_0x47a5('0x4e')][_0x47a5('0x51')](_0x389ed9)[_0x47a5('0x22')](function(_0x52e3ee){return[_0x52e3ee,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x47a5('0x52')](function(_0x23020b,_0x45d4b6){if(_0x23020b){_0x1658e8=_0x45d4b6;if(!_0x45d4b6){return _0x23020b[_0x47a5('0x53')]({'inReplyTo':_0x54ae35[_0x47a5('0x26')]['message'][_0x47a5('0x4b')],'to':_0x54ae35['body'][_0x47a5('0x17')][_0x47a5('0x31')],'cc':_0x54ae35['body'][_0x47a5('0x17')]['cc'],'subject':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')][_0x47a5('0x4c')],'attach':_0x23020b[_0x47a5('0x54')]?_0x23020b[_0x47a5('0x54')]:_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0x47a5('0x4d')](_0x47a5('0x55')),'lastMsgAt':moment()[_0x47a5('0x4d')](_0x47a5('0x55')),'lastMsgDirection':'in'});}else{return _0x23020b;}}})[_0x47a5('0x22')](function(_0x4bbe14){_0x5c569e[_0x47a5('0x56')]=_0x4bbe14[_0x47a5('0x3f')]({'plain':!![]});_0x5c569e[_0x47a5('0x56')][_0x47a5('0x57')]=_0x1658e8;return db[_0x47a5('0x4f')][_0x47a5('0x51')]({'body':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x26')],'MailAccountId':_0x54ae35[_0x47a5('0x36')]['id'],'MailInteractionId':_0x4bbe14['id'],'direction':'in','ContactId':_0x5c569e[_0x47a5('0x58')]['id'],'messageId':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')][_0x47a5('0x4b')],'from':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['from'],'to':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['to'],'cc':_0x54ae35[_0x47a5('0x26')]['message']['cc'],'subject':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')][_0x47a5('0x4c')],'attach':_0x54ae35[_0x47a5('0x26')]['message'][_0x47a5('0x54')],'Attachments':_0x54ae35['body'][_0x47a5('0x17')]['attachments'],'originTo':_0x54ae35[_0x47a5('0x26')]['message'][_0x47a5('0x59')],'originCc':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')]['originCc'],'bcc':_0x54ae35['body']['message'][_0x47a5('0x5a')],'ChatWebsiteId':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')][_0x47a5('0x5b')]||null,'originChannel':_0x54ae35['body'][_0x47a5('0x17')][_0x47a5('0x5c')]||_0x47a5('0x5d'),'ChatOfflineMessageId':_0x54ae35[_0x47a5('0x26')][_0x47a5('0x17')][_0x47a5('0x5e')]||null},{'include':[{'model':db[_0x47a5('0x5f')],'as':_0x47a5('0x60')}]});})[_0x47a5('0x22')](function(_0xc69a68){_0x5c569e[_0x47a5('0x17')]=_0xc69a68;if(_0x5c569e[_0x47a5('0x56')]['UserId']){return db[_0x47a5('0x61')]['find']({'attributes':['id',_0x47a5('0x62')],'where':{'id':_0x5c569e[_0x47a5('0x56')][_0x47a5('0x63')]}})[_0x47a5('0x22')](function(_0x40e584){if(_0x40e584){_0x5c569e[_0x47a5('0x42')][_0x47a5('0x64')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x65'),'appdata':_0x40e584[_0x47a5('0x62')]+','+(_0x5c569e[_0x47a5('0x36')][_0x47a5('0x66')]||0xa),'interval':_0x47a5('0x49')});}return respondWithRpcPromise(_0x47a5('0x67'),_0x47a5('0x68'),_0x5c569e);});}return respondWithRpcPromise(_0x47a5('0x67'),'startRouting',_0x5c569e);})['then'](function(_0x5ccc89){_0x5ebd8c(_0x5ccc89);})['catch'](function(_0x490e28){_0x12d9f2(_0x55c5eb[_0x47a5('0x15')](0x1f4,_0x490e28['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 25d26ae..32fd7ab 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 _0x6519=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0xe4c70f,_0x327318){var _0x38f948=function(_0x234362){while(--_0x234362){_0xe4c70f['push'](_0xe4c70f['shift']());}};_0x38f948(++_0x327318);}(_0x6519,0x163));var _0x9651=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0x6519[_0x552c27];return _0x2a0922;};'use strict';var MailAccountEvents=require(_0x9651('0x0'));var events=[_0x9651('0x1'),_0x9651('0x2'),_0x9651('0x3')];function createListener(_0x348e93,_0x4d17e5){return function(_0x157e1d){_0x4d17e5[_0x9651('0x4')](_0x348e93,_0x157e1d);};}function removeListener(_0x3ff639,_0x3e07a0){return function(){MailAccountEvents['removeListener'](_0x3ff639,_0x3e07a0);};}exports[_0x9651('0x5')]=function(_0x54891a){for(var _0x298278=0x0,_0x2d6c41=events[_0x9651('0x6')];_0x298278<_0x2d6c41;_0x298278++){var _0x4eff9f=events[_0x298278];var _0x2626a8=createListener(_0x9651('0x7')+_0x4eff9f,_0x54891a);MailAccountEvents['on'](_0x4eff9f,_0x2626a8);}}; \ No newline at end of file +var _0xd140=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x57b802,_0x2ca255){var _0x346577=function(_0x25470b){while(--_0x25470b){_0x57b802['push'](_0x57b802['shift']());}};_0x346577(++_0x2ca255);}(_0xd140,0x1d4));var _0x0d14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd140[_0x20a584];return _0x4b41a8;};'use strict';var MailAccountEvents=require(_0x0d14('0x0'));var events=['save',_0x0d14('0x1'),_0x0d14('0x2')];function createListener(_0x243f0e,_0x37d5f8){return function(_0x1cce01){_0x37d5f8[_0x0d14('0x3')](_0x243f0e,_0x1cce01);};}function removeListener(_0x51569e,_0x235195){return function(){MailAccountEvents[_0x0d14('0x4')](_0x51569e,_0x235195);};}exports[_0x0d14('0x5')]=function(_0x4e6dfe){for(var _0xf33b6c=0x0,_0x237d70=events[_0x0d14('0x6')];_0xf33b6c<_0x237d70;_0xf33b6c++){var _0xfc2770=events[_0xf33b6c];var _0x3080a9=createListener(_0x0d14('0x7')+_0xfc2770,_0x4e6dfe);MailAccountEvents['on'](_0xfc2770,_0x3080a9);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 92417f3..33dbc92 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 _0x423e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x2009c8,_0x407d34){var _0x2560c4=function(_0x547135){while(--_0x547135){_0x2009c8['push'](_0x2009c8['shift']());}};_0x2560c4(++_0x407d34);}(_0x423e,0x1c6));var _0xe423=function(_0x3f9f9d,_0x923a36){_0x3f9f9d=_0x3f9f9d-0x0;var _0x3f9fc9=_0x423e[_0x3f9f9d];return _0x3f9fc9;};'use strict';var multer=require(_0xe423('0x0'));var util=require(_0xe423('0x1'));var path=require(_0xe423('0x2'));var timeout=require(_0xe423('0x3'));var express=require(_0xe423('0x4'));var router=express[_0xe423('0x5')]();var fs_extra=require(_0xe423('0x6'));var auth=require(_0xe423('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe423('0x8'));var controller=require(_0xe423('0x9'));router[_0xe423('0xa')](_0xe423('0xb'),auth['isAuthenticated'](),controller[_0xe423('0xc')]);router[_0xe423('0xd')]('/:id',auth[_0xe423('0xe')](),controller[_0xe423('0xf')]);router[_0xe423('0x10')]('/:id',auth[_0xe423('0xe')](),controller[_0xe423('0x11')]);module[_0xe423('0x12')]=router; \ No newline at end of file +var _0xa727=['fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','util','path','connect-timeout','express','Router'];(function(_0x319c95,_0x1e73a9){var _0x39d768=function(_0x4cf1ed){while(--_0x4cf1ed){_0x319c95['push'](_0x319c95['shift']());}};_0x39d768(++_0x1e73a9);}(_0xa727,0xa0));var _0x7a72=function(_0x461470,_0x4906d0){_0x461470=_0x461470-0x0;var _0x152dfa=_0xa727[_0x461470];return _0x152dfa;};'use strict';var multer=require('multer');var util=require(_0x7a72('0x0'));var path=require(_0x7a72('0x1'));var timeout=require(_0x7a72('0x2'));var express=require(_0x7a72('0x3'));var router=express[_0x7a72('0x4')]();var fs_extra=require(_0x7a72('0x5'));var auth=require(_0x7a72('0x6'));var interaction=require(_0x7a72('0x7'));var config=require('../../config/environment');var controller=require(_0x7a72('0x8'));router[_0x7a72('0x9')](_0x7a72('0xa'),auth[_0x7a72('0xb')](),controller[_0x7a72('0xc')]);router['put'](_0x7a72('0xa'),auth[_0x7a72('0xb')](),controller[_0x7a72('0xd')]);router[_0x7a72('0xe')](_0x7a72('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ca49b2d..62b6be1 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 _0x0e68=['sequelize','INTEGER','STRING','noop'];(function(_0x44cfdb,_0x2d7b28){var _0xeea421=function(_0x5a159a){while(--_0x5a159a){_0x44cfdb['push'](_0x44cfdb['shift']());}};_0xeea421(++_0x2d7b28);}(_0x0e68,0xf8));var _0x80e6=function(_0x432039,_0x4cdd48){_0x432039=_0x432039-0x0;var _0x18d5ae=_0x0e68[_0x432039];return _0x18d5ae;};'use strict';var Sequelize=require(_0x80e6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x80e6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x80e6('0x2')],'allowNull':![],'defaultValue':_0x80e6('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x80e6('0x2')]},'interval':{'type':Sequelize[_0x80e6('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xff94=['*,*,*,*','exports','STRING','noop'];(function(_0x16d937,_0x650453){var _0x25e106=function(_0x31811f){while(--_0x31811f){_0x16d937['push'](_0x16d937['shift']());}};_0x25e106(++_0x650453);}(_0xff94,0x145));var _0x4ff9=function(_0x36728b,_0x4a7ef3){_0x36728b=_0x36728b-0x0;var _0x5eb187=_0xff94[_0x36728b];return _0x5eb187;};'use strict';var Sequelize=require('sequelize');module[_0x4ff9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4ff9('0x1')],'allowNull':![],'defaultValue':_0x4ff9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4ff9('0x1')]},'interval':{'type':Sequelize[_0x4ff9('0x1')],'defaultValue':_0x4ff9('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ee00943..6766e79 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','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','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xaa88[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x531e85,_0x4c5f38){var _0x197b70=function(_0x3feb49){while(--_0x3feb49){_0x531e85['push'](_0x531e85['shift']());}};_0x197b70(++_0x4c5f38);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2be7ac,_0x44e653){_0x2be7ac=_0x2be7ac-0x0;var _0x45c73f=_0x9bde[_0x2be7ac];return _0x45c73f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index af36170..9f1542a 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 _0x212a=['api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','util'];(function(_0x4f6b05,_0x555696){var _0x1414cf=function(_0x41ff0c){while(--_0x41ff0c){_0x4f6b05['push'](_0x4f6b05['shift']());}};_0x1414cf(++_0x555696);}(_0x212a,0x185));var _0xa212=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x212a[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xa212('0x0'));var logger=require('../../config/logger')(_0xa212('0x1'));var moment=require(_0xa212('0x2'));var BPromise=require('bluebird');var rp=require(_0xa212('0x3'));var fs=require('fs');var path=require(_0xa212('0x4'));var rimraf=require(_0xa212('0x5'));var config=require(_0xa212('0x6'));var attributes=require(_0xa212('0x7'));module[_0xa212('0x8')]=function(_0x2ecf88,_0x4a8337){return _0x2ecf88[_0xa212('0x9')](_0xa212('0xa'),attributes,{'tableName':_0xa212('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa212('0xc')});}; \ No newline at end of file +var _0xd521=['path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird'];(function(_0xe5ad35,_0x36b160){var _0x1f1d7a=function(_0x4d06b6){while(--_0x4d06b6){_0xe5ad35['push'](_0xe5ad35['shift']());}};_0x1f1d7a(++_0x36b160);}(_0xd521,0x168));var _0x1d52=function(_0x13453e,_0x409732){_0x13453e=_0x13453e-0x0;var _0x19d7ce=_0xd521[_0x13453e];return _0x19d7ce;};'use strict';var _=require(_0x1d52('0x0'));var util=require('util');var logger=require(_0x1d52('0x1'))(_0x1d52('0x2'));var moment=require('moment');var BPromise=require(_0x1d52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d52('0x4'));var rimraf=require('rimraf');var config=require(_0x1d52('0x5'));var attributes=require(_0x1d52('0x6'));module[_0x1d52('0x7')]=function(_0x522283,_0x3f0874){return _0x522283[_0x1d52('0x8')](_0x1d52('0x9'),attributes,{'tableName':_0x1d52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d52('0xb'),'collate':_0x1d52('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3136eb4..e6af346 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 _0x03e5=['body','options','raw','where','attributes','limit','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailApplication','MailApplication','update'];(function(_0x457458,_0x4856b5){var _0x263cf6=function(_0x2b7469){while(--_0x2b7469){_0x457458['push'](_0x457458['shift']());}};_0x263cf6(++_0x4856b5);}(_0x03e5,0x64));var _0x503e=function(_0x37154f,_0x40fad7){_0x37154f=_0x37154f-0x0;var _0x91a557=_0x03e5[_0x37154f];return _0x91a557;};'use strict';var _=require(_0x503e('0x0'));var util=require('util');var moment=require(_0x503e('0x1'));var BPromise=require('bluebird');var rs=require(_0x503e('0x2'));var fs=require('fs');var Redis=require(_0x503e('0x3'));var db=require(_0x503e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x503e('0x5'))(_0x503e('0x6'));var config=require(_0x503e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x503e('0x8')][_0x503e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a725a,_0x282bf0,_0x3da120){return new BPromise(function(_0x2e66a3,_0x211c80){return client[_0x503e('0xa')](_0x3a725a,_0x3da120)['then'](function(_0xdf463c){logger[_0x503e('0xb')](_0x503e('0xc'),_0x282bf0,'request\x20sent');logger[_0x503e('0xd')](_0x503e('0xe'),_0x282bf0,_0x503e('0xf'),JSON['stringify'](_0xdf463c));if(_0xdf463c[_0x503e('0x10')]){if(_0xdf463c[_0x503e('0x10')][_0x503e('0x11')]===0x1f4){logger[_0x503e('0x10')](_0x503e('0xc'),_0x282bf0,_0xdf463c[_0x503e('0x10')][_0x503e('0x12')]);return _0x211c80(_0xdf463c['error']['message']);}logger[_0x503e('0x10')](_0x503e('0xc'),_0x282bf0,_0xdf463c['error'][_0x503e('0x12')]);return _0x2e66a3(_0xdf463c[_0x503e('0x10')][_0x503e('0x12')]);}else{logger[_0x503e('0xb')]('MailApplication,\x20%s,\x20%s',_0x282bf0,_0x503e('0xf'));_0x2e66a3(_0xdf463c[_0x503e('0x13')][_0x503e('0x12')]);}})[_0x503e('0x14')](function(_0x1ca4c2){logger[_0x503e('0x10')](_0x503e('0xc'),_0x282bf0,_0x1ca4c2);_0x211c80(_0x1ca4c2);});});}exports[_0x503e('0x15')]=function(_0x3c27a4){var _0x346787=this;return new Promise(function(_0x583b54,_0x26f0bd){return db[_0x503e('0x16')][_0x503e('0x17')](_0x3c27a4[_0x503e('0x18')],{'raw':_0x3c27a4[_0x503e('0x19')]?_0x3c27a4['options'][_0x503e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c27a4[_0x503e('0x19')]?_0x3c27a4[_0x503e('0x19')][_0x503e('0x1b')]||null:null,'attributes':_0x3c27a4[_0x503e('0x19')]?_0x3c27a4[_0x503e('0x19')][_0x503e('0x1c')]||null:null,'limit':_0x3c27a4[_0x503e('0x19')]?_0x3c27a4['options'][_0x503e('0x1d')]||null:null})[_0x503e('0x1e')](function(_0x4afbbd){logger['info'](_0x503e('0x15'),_0x3c27a4);logger['debug'](_0x503e('0x15'),_0x3c27a4,JSON['stringify'](_0x4afbbd));_0x583b54(_0x4afbbd);})[_0x503e('0x14')](function(_0x16c72e){logger[_0x503e('0x10')](_0x503e('0x15'),_0x16c72e['message'],_0x3c27a4);_0x26f0bd(_0x346787[_0x503e('0x10')](0x1f4,_0x16c72e[_0x503e('0x12')]));});});}; \ No newline at end of file +var _0xbef7=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','MailApplication','update','body','options','raw','where','attributes','limit','UpdateMailApplication','lodash'];(function(_0x37d109,_0x56897d){var _0x5aec12=function(_0x445be7){while(--_0x445be7){_0x37d109['push'](_0x37d109['shift']());}};_0x5aec12(++_0x56897d);}(_0xbef7,0x10d));var _0x7bef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbef7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7bef('0x0'));var util=require('util');var moment=require(_0x7bef('0x1'));var BPromise=require('bluebird');var rs=require(_0x7bef('0x2'));var fs=require('fs');var Redis=require(_0x7bef('0x3'));var db=require(_0x7bef('0x4'))['db'];var utils=require(_0x7bef('0x5'));var logger=require(_0x7bef('0x6'))(_0x7bef('0x7'));var config=require(_0x7bef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7bef('0x9')][_0x7bef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52a343,_0x3dc0ed,_0x95b336){return new BPromise(function(_0x56c3ec,_0x1c8933){return client[_0x7bef('0xb')](_0x52a343,_0x95b336)[_0x7bef('0xc')](function(_0x65a09b){logger[_0x7bef('0xd')](_0x7bef('0xe'),_0x3dc0ed,_0x7bef('0xf'));logger[_0x7bef('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3dc0ed,_0x7bef('0xf'),JSON[_0x7bef('0x11')](_0x65a09b));if(_0x65a09b['error']){if(_0x65a09b[_0x7bef('0x12')]['code']===0x1f4){logger[_0x7bef('0x12')](_0x7bef('0xe'),_0x3dc0ed,_0x65a09b[_0x7bef('0x12')][_0x7bef('0x13')]);return _0x1c8933(_0x65a09b[_0x7bef('0x12')][_0x7bef('0x13')]);}logger[_0x7bef('0x12')](_0x7bef('0xe'),_0x3dc0ed,_0x65a09b[_0x7bef('0x12')]['message']);return _0x56c3ec(_0x65a09b[_0x7bef('0x12')][_0x7bef('0x13')]);}else{logger[_0x7bef('0xd')](_0x7bef('0xe'),_0x3dc0ed,_0x7bef('0xf'));_0x56c3ec(_0x65a09b['result'][_0x7bef('0x13')]);}})[_0x7bef('0x14')](function(_0x133370){logger[_0x7bef('0x12')]('MailApplication,\x20%s,\x20%s',_0x3dc0ed,_0x133370);_0x1c8933(_0x133370);});});}exports['UpdateMailApplication']=function(_0x595cbc){var _0x31a6e3=this;return new Promise(function(_0x5d3192,_0x3ec256){return db[_0x7bef('0x15')][_0x7bef('0x16')](_0x595cbc[_0x7bef('0x17')],{'raw':_0x595cbc['options']?_0x595cbc[_0x7bef('0x18')][_0x7bef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x595cbc[_0x7bef('0x18')]?_0x595cbc[_0x7bef('0x18')][_0x7bef('0x1a')]||null:null,'attributes':_0x595cbc[_0x7bef('0x18')]?_0x595cbc['options'][_0x7bef('0x1b')]||null:null,'limit':_0x595cbc[_0x7bef('0x18')]?_0x595cbc[_0x7bef('0x18')][_0x7bef('0x1c')]||null:null})['then'](function(_0x1df621){logger[_0x7bef('0xd')](_0x7bef('0x1d'),_0x595cbc);logger['debug'](_0x7bef('0x1d'),_0x595cbc,JSON[_0x7bef('0x11')](_0x1df621));_0x5d3192(_0x1df621);})[_0x7bef('0x14')](function(_0x424ff3){logger['error'](_0x7bef('0x1d'),_0x424ff3['message'],_0x595cbc);_0x3ec256(_0x31a6e3['error'](0x1f4,_0x424ff3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6b5fe01..1454805 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 _0x88e7=['mail','mailinteraction:addtags','addTags','put','tracked','update','delete','mailinteraction:destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','download','post','create','/:id/messages','addMessage'];(function(_0x1ddbee,_0x974294){var _0x428c7f=function(_0x54f9e8){while(--_0x54f9e8){_0x1ddbee['push'](_0x1ddbee['shift']());}};_0x428c7f(++_0x974294);}(_0x88e7,0xc1));var _0x788e=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x88e7[_0x47aa64];return _0x549c7a;};'use strict';var express=require(_0x788e('0x0'));var router=express[_0x788e('0x1')]();var auth=require(_0x788e('0x2'));var interaction=require(_0x788e('0x3'));var controller=require('./mailInteraction.controller');router[_0x788e('0x4')]('/',auth[_0x788e('0x5')](),controller[_0x788e('0x6')]);router[_0x788e('0x4')](_0x788e('0x7'),auth[_0x788e('0x5')](),controller[_0x788e('0x8')]);router[_0x788e('0x4')](_0x788e('0x9'),auth[_0x788e('0x5')](),controller['show']);router[_0x788e('0x4')]('/:id/messages',auth[_0x788e('0x5')](),controller['getMessages']);router['get']('/:id/download',auth[_0x788e('0x5')](),controller[_0x788e('0xa')]);router[_0x788e('0xb')]('/',auth[_0x788e('0x5')](),controller[_0x788e('0xc')]);router[_0x788e('0xb')](_0x788e('0xd'),auth[_0x788e('0x5')](),controller[_0x788e('0xe')]);router['post']('/:id/tags',auth[_0x788e('0x5')](),interaction['tracked'](_0x788e('0xf'),_0x788e('0x10')),controller[_0x788e('0x11')]);router[_0x788e('0x12')]('/:id',auth[_0x788e('0x5')](),interaction[_0x788e('0x13')](_0x788e('0xf'),'mailinteraction:update'),controller[_0x788e('0x14')]);router[_0x788e('0x15')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x788e('0xf'),_0x788e('0x16')),controller['destroy']);router[_0x788e('0x15')](_0x788e('0x17'),auth[_0x788e('0x5')](),controller[_0x788e('0x18')]);module[_0x788e('0x19')]=router; \ No newline at end of file +var _0xd175=['../../components/interaction/service','./mailInteraction.controller','get','index','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','mail','addTags','put','/:id','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service'];(function(_0xfeed4f,_0x287cab){var _0x2c404a=function(_0x275147){while(--_0x275147){_0xfeed4f['push'](_0xfeed4f['shift']());}};_0x2c404a(++_0x287cab);}(_0xd175,0x1d2));var _0x5d17=function(_0x164aa5,_0x36a515){_0x164aa5=_0x164aa5-0x0;var _0x2c9123=_0xd175[_0x164aa5];return _0x2c9123;};'use strict';var express=require('express');var router=express[_0x5d17('0x0')]();var auth=require(_0x5d17('0x1'));var interaction=require(_0x5d17('0x2'));var controller=require(_0x5d17('0x3'));router[_0x5d17('0x4')]('/',auth['isAuthenticated'](),controller[_0x5d17('0x5')]);router[_0x5d17('0x4')]('/describe',auth[_0x5d17('0x6')](),controller[_0x5d17('0x7')]);router['get']('/:id',auth[_0x5d17('0x6')](),controller[_0x5d17('0x8')]);router[_0x5d17('0x4')](_0x5d17('0x9'),auth[_0x5d17('0x6')](),controller[_0x5d17('0xa')]);router[_0x5d17('0x4')](_0x5d17('0xb'),auth[_0x5d17('0x6')](),controller['download']);router[_0x5d17('0xc')]('/',auth[_0x5d17('0x6')](),controller['create']);router[_0x5d17('0xc')](_0x5d17('0x9'),auth['isAuthenticated'](),controller[_0x5d17('0xd')]);router[_0x5d17('0xc')](_0x5d17('0xe'),auth['isAuthenticated'](),interaction[_0x5d17('0xf')](_0x5d17('0x10'),'mailinteraction:addtags'),controller[_0x5d17('0x11')]);router[_0x5d17('0x12')](_0x5d17('0x13'),auth[_0x5d17('0x6')](),interaction[_0x5d17('0xf')](_0x5d17('0x10'),_0x5d17('0x14')),controller['update']);router[_0x5d17('0x15')]('/:id',auth[_0x5d17('0x6')](),interaction[_0x5d17('0xf')](_0x5d17('0x10'),_0x5d17('0x16')),controller[_0x5d17('0x17')]);router[_0x5d17('0x15')](_0x5d17('0xe'),auth[_0x5d17('0x6')](),controller[_0x5d17('0x18')]);module[_0x5d17('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index cfdf557..30538c6 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 _0x291c=['long','DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x291c,0xe0));var _0xc291=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x291c[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xc291('0x0'));var iconv=require(_0xc291('0x1'));module[_0xc291('0x2')]={'closed':{'type':Sequelize[_0xc291('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc291('0x4')]},'secondDisposition':{'type':Sequelize[_0xc291('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc291('0x4')]},'note':{'type':Sequelize[_0xc291('0x4')]},'inReplyTo':{'type':Sequelize[_0xc291('0x4')](0x1fe)},'to':{'type':Sequelize[_0xc291('0x4')]},'cc':{'type':Sequelize[_0xc291('0x5')](_0xc291('0x6'))},'subject':{'type':Sequelize[_0xc291('0x5')]()},'attach':{'type':Sequelize[_0xc291('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xc291('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xc291('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xc291('0x8')]('in',_0xc291('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc291('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xc291('0x8')]('in',_0xc291('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc291('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f02=['out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0xf2532a,_0x1a3d34){var _0x22891f=function(_0x1081a6){while(--_0x1081a6){_0xf2532a['push'](_0xf2532a['shift']());}};_0x22891f(++_0x1a3d34);}(_0x5f02,0x160));var _0x25f0=function(_0x4bf758,_0x355686){_0x4bf758=_0x4bf758-0x0;var _0x490fce=_0x5f02[_0x4bf758];return _0x490fce;};'use strict';var Sequelize=require(_0x25f0('0x0'));var iconv=require('iconv');module[_0x25f0('0x1')]={'closed':{'type':Sequelize[_0x25f0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x25f0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x25f0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x25f0('0x4')]},'inReplyTo':{'type':Sequelize[_0x25f0('0x4')](0x1fe)},'to':{'type':Sequelize[_0x25f0('0x4')]},'cc':{'type':Sequelize[_0x25f0('0x5')](_0x25f0('0x6'))},'subject':{'type':Sequelize[_0x25f0('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x25f0('0x3')]},'substatus':{'type':Sequelize[_0x25f0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x25f0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x25f0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x25f0('0x7')]('in',_0x25f0('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x25f0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index c10f6c8..02e3e12 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 _0xacd6=['message%d.eml','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','end','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','error','name','Users','fullname','Tags','TagIds','forEach','MailMessage','findOne','plainBody','-id','lastMsgText','catch','waiting','talking','answered','unmanaged','total','closed','UserId','map','MailInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','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','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','user','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.MailAccountId','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','push','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','spread','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','createdAt','get','mkdirSync','each','subject','decode','headers','Attachments','basename','existsSync','readFileSync','build','writeFileSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacd6,0xef));var _0x6acd=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0xacd6[_0x3a0863];return _0x85c557;};'use strict';var emlformat=require(_0x6acd('0x0'));var rimraf=require(_0x6acd('0x1'));var zipdir=require(_0x6acd('0x2'));var moment=require(_0x6acd('0x3'));var BPromise=require(_0x6acd('0x4'));var util=require(_0x6acd('0x5'));var path=require(_0x6acd('0x6'));var fs=require('fs');var _=require(_0x6acd('0x7'));var squel=require(_0x6acd('0x8'));var juice=require(_0x6acd('0x9'));var Redis=require(_0x6acd('0xa'));var qs=require(_0x6acd('0xb'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x6acd('0xc'))(_0x6acd('0xd'));var config=require(_0x6acd('0xe'));var db=require(_0x6acd('0xf'))['db'];var htmlEntities=require(_0x6acd('0x10'));config[_0x6acd('0x11')]=_[_0x6acd('0x12')](config[_0x6acd('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x6acd('0x13'))(new Redis(config[_0x6acd('0x11')]));require(_0x6acd('0x14'))[_0x6acd('0x15')](socket);function respondWithStatusCode(_0x1352cb,_0x24393c){_0x24393c=_0x24393c||0xcc;return function(_0x4088fc){if(_0x4088fc){return _0x1352cb['sendStatus'](_0x24393c);}return _0x1352cb['status'](_0x24393c)[_0x6acd('0x16')]();};}function respondWithResult(_0xba49b4,_0x29204d){_0x29204d=_0x29204d||0xc8;return function(_0x48bb0b){if(_0x48bb0b){return _0xba49b4[_0x6acd('0x17')](_0x29204d)[_0x6acd('0x18')](_0x48bb0b);}};}function respondWithFilteredResult(_0xc0b97e,_0xab9785){return function(_0x113884){if(_0x113884){var _0x40ad48=typeof _0xab9785[_0x6acd('0x19')]===_0x6acd('0x1a')&&typeof _0xab9785['limit']===_0x6acd('0x1a');var _0x6f0d63=_0x113884[_0x6acd('0x1b')];var _0x34da42=_0x40ad48?0x0:_0xab9785[_0x6acd('0x19')];var _0x5d0a63=_0x40ad48?_0x113884['count']:_0xab9785[_0x6acd('0x19')]+_0xab9785[_0x6acd('0x1c')];var _0x55a0b9;if(_0x5d0a63>=_0x6f0d63){_0x5d0a63=_0x6f0d63;_0x55a0b9=0xc8;}else{_0x55a0b9=0xce;}_0xc0b97e[_0x6acd('0x17')](_0x55a0b9);return _0xc0b97e['set'](_0x6acd('0x1d'),_0x34da42+'-'+_0x5d0a63+'/'+_0x6f0d63)[_0x6acd('0x18')](_0x113884);}return null;};}function saveUpdates(_0x21192e){return function(_0x1590e0){if(_0x1590e0){return _0x1590e0[_0x6acd('0x1e')](_0x21192e)[_0x6acd('0x1f')](function(_0x2c53b8){return _0x2c53b8;});}return null;};}function removeEntity(_0x3b5ab2){return function(_0x595592){if(_0x595592){return _0x595592[_0x6acd('0x20')]()['then'](function(){_0x3b5ab2[_0x6acd('0x17')](0xcc)[_0x6acd('0x16')]();});}};}function handleEntityNotFound(_0x334c5c){return function(_0x5b3e1f){if(!_0x5b3e1f){_0x334c5c['sendStatus'](0x194);}return _0x5b3e1f;};}function handleError(_0x42fd36,_0x2d3e2d){_0x2d3e2d=_0x2d3e2d||0x1f4;return function(_0x48dbee){logger[_0x6acd('0x21')](_0x48dbee['stack']);if(_0x48dbee['name']){delete _0x48dbee[_0x6acd('0x22')];}_0x42fd36[_0x6acd('0x17')](_0x2d3e2d)['send'](_0x48dbee);};}function getInteractionUsers(_0x3c8bd7,_0x56d8be){return new BPromise(function(_0x3fb927,_0xa57e4d){try{if(_0x56d8be[_0x3c8bd7['id']]){_0x3c8bd7[_0x6acd('0x23')]=_['map'](_0x56d8be[_0x3c8bd7['id']],function(_0xd16837){return{'id':_0xd16837['id'],'fullname':_0xd16837[_0x6acd('0x24')]};});}}catch(_0x97fa14){_0xa57e4d(_0x97fa14);}_0x3fb927(_0x3c8bd7);});}function getInteractionTags(_0x67289e,_0x3d074c){return new BPromise(function(_0x29a6d9,_0x400380){try{if(_0x67289e['TagIds']){_0x67289e[_0x6acd('0x25')]=[];_0x67289e[_0x6acd('0x26')]['split'](',')[_0x6acd('0x27')](function(_0x5bc3cb){_0x67289e['Tags']['push'](_0x3d074c[_0x5bc3cb]);});}delete _0x67289e[_0x6acd('0x26')];}catch(_0x3556c4){_0x400380(_0x3556c4);}_0x29a6d9(_0x67289e);});}function getLastMessageText(_0xc8c99c){return new BPromise(function(_0x599787,_0x58e3ef){return db[_0x6acd('0x28')][_0x6acd('0x29')]({'where':{'$and':[{'MailInteractionId':_0xc8c99c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x6acd('0x2a')],'order':_0x6acd('0x2b'),'raw':!![]})['then'](function(_0x6a7f28){if(_0x6a7f28&&_0x6a7f28[_0x6acd('0x2a')]){_0xc8c99c[_0x6acd('0x2c')]=_['trimStart'](_0x6a7f28[_0x6acd('0x2a')]);}_0x599787(_0xc8c99c);})[_0x6acd('0x2d')](function(_0xd39a69){_0x58e3ef(_0xd39a69);});});}function updateMailInteraction(_0x270eb3,_0x5e546e,_0x579930,_0x559a47){return new BPromise(function(_0x1be617,_0x47d89d){return getInteractionUsers(_0x270eb3,_0x579930)[_0x6acd('0x1f')](function(_0x591614){return getInteractionTags(_0x591614,_0x5e546e);})['then'](function(_0x5aeabd){return getStateInteraction(_0x5aeabd);})[_0x6acd('0x1f')](function(_0x348dc0){if(_0x559a47){_0x1be617(getLastMessageText(_0x348dc0));}else{_0x1be617(_0x348dc0);}})['catch'](function(_0xbbdd9f){_0x47d89d(_0xbbdd9f);});});}function getStateInteraction(_0x496eb9){return new BPromise(function(_0x2688cb){_0x496eb9[_0x6acd('0x2e')]=0x0;_0x496eb9[_0x6acd('0x2f')]=0x0;_0x496eb9[_0x6acd('0x30')]=0x0;_0x496eb9[_0x6acd('0x31')]=0x0;_0x496eb9[_0x6acd('0x32')]=0x0;if(!_0x496eb9[_0x6acd('0x33')]&&!_0x496eb9[_0x6acd('0x34')]){_0x496eb9[_0x6acd('0x2e')]+=0x1;}if(!_0x496eb9[_0x6acd('0x33')]&&_0x496eb9[_0x6acd('0x34')]){_0x496eb9[_0x6acd('0x2f')]+=0x1;if(_0x496eb9[_0x6acd('0x2e')]){_0x496eb9['waiting']-=0x1;}}if(_0x496eb9[_0x6acd('0x33')]&&_0x496eb9[_0x6acd('0x34')]){_0x496eb9[_0x6acd('0x30')]+=0x1;if(_0x496eb9['talking']){_0x496eb9[_0x6acd('0x2f')]-=0x1;}}if(_0x496eb9[_0x6acd('0x33')]&&!_0x496eb9[_0x6acd('0x34')]){_0x496eb9[_0x6acd('0x31')]+=0x1;if(_0x496eb9[_0x6acd('0x2e')]){_0x496eb9[_0x6acd('0x2e')]-=0x1;}}_0x496eb9[_0x6acd('0x32')]+=0x1;_0x2688cb(_0x496eb9);});}exports['index']=function(_0x2a309e,_0x24e9a4){var _0x2dc5dc={},_0x57e532={},_0x9c2cb6={'count':0x0,'rows':[]};var _0x26b8a0=_[_0x6acd('0x35')](db[_0x6acd('0x36')][_0x6acd('0x37')],function(_0x10b634){return{'name':_0x10b634[_0x6acd('0x38')],'type':_0x10b634[_0x6acd('0x39')][_0x6acd('0x3a')]};});_0x57e532[_0x6acd('0x3b')]=_[_0x6acd('0x35')](_0x26b8a0,'name');_0x57e532['query']=_[_0x6acd('0x3c')](_0x2a309e[_0x6acd('0x3d')]);_0x57e532[_0x6acd('0x3e')]=_['intersection'](_0x57e532[_0x6acd('0x3b')],_0x57e532[_0x6acd('0x3d')]);_0x2dc5dc[_0x6acd('0x3f')]=_[_0x6acd('0x40')](_0x57e532[_0x6acd('0x3b')],qs['fields'](_0x2a309e['query'][_0x6acd('0x41')]));_0x2dc5dc[_0x6acd('0x3f')]=_0x2dc5dc[_0x6acd('0x3f')][_0x6acd('0x42')]?_0x2dc5dc[_0x6acd('0x3f')]:_0x57e532['model'];if(!_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x43')](_0x6acd('0x44'))){_0x2dc5dc[_0x6acd('0x1c')]=qs['limit'](_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x1c')]);_0x2dc5dc[_0x6acd('0x19')]=qs[_0x6acd('0x19')](_0x2a309e[_0x6acd('0x3d')]['offset']);}_0x2dc5dc[_0x6acd('0x45')]=qs['sort'](_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x46')]);_0x2dc5dc[_0x6acd('0x47')]=qs[_0x6acd('0x3e')](_['pick'](_0x2a309e[_0x6acd('0x3d')],_0x57e532[_0x6acd('0x3e')]),_0x26b8a0);var _0x3fe020=[];var _0x2c87e6=squel[_0x6acd('0x48')]()[_0x6acd('0x49')]('id')['field'](_0x6acd('0x22'))[_0x6acd('0x49')](_0x6acd('0x4a'))['from'](_0x6acd('0x4b'));var _0xb0100b=squel[_0x6acd('0x48')]()[_0x6acd('0x49')]('u.id')[_0x6acd('0x49')]('u.fullname')[_0x6acd('0x49')](_0x6acd('0x4c'))[_0x6acd('0x4d')](_0x6acd('0x4e'),'ui')[_0x6acd('0x4f')](_0x6acd('0x50'),'u',_0x6acd('0x51'));var _0x4e0b8b=squel[_0x6acd('0x48')]()[_0x6acd('0x4d')]('mail_interactions','i')[_0x6acd('0x4f')](_0x6acd('0x52'),'c',_0x6acd('0x53'))[_0x6acd('0x4f')]('users','o',_0x6acd('0x54'))[_0x6acd('0x4f')](_0x6acd('0x55'),'a',_0x6acd('0x56'))[_0x6acd('0x4f')](_0x6acd('0x57'),'me',_0x6acd('0x58'))[_0x6acd('0x4f')](_0x6acd('0x59'),'it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x6acd('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x4c9581=squel[_0x6acd('0x5a')]();var _0x42aea4=[];var _0x2622a7=squel[_0x6acd('0x5a')]();var _0x1027aa;if(_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x5b')]){_0x1027aa=as[_0x6acd('0x5c')](_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x5b')]);var _0x31f9c1=_0x1027aa['sqlOperator'];for(var _0x585f63=0x0;_0x585f63<_0x1027aa['conditions'][_0x6acd('0x42')];_0x585f63++){var _0x435617=_0x1027aa[_0x6acd('0x5d')][_0x585f63];var _0x59baa2='i';var _0x268bc0=_[_0x6acd('0x5e')](_0x26b8a0,[_0x6acd('0x22'),_0x435617['field']]);if(!_0x268bc0){switch(_0x435617['field']){case _0x6acd('0x5f'):if(_0x435617[_0x6acd('0x60')]==0x1){_0x4e0b8b['having']('`'+_0x435617[_0x6acd('0x49')]+_0x6acd('0x61'));}else{_0x4e0b8b[_0x6acd('0x62')]('`'+_0x435617[_0x6acd('0x49')]+_0x6acd('0x63'));}break;case _0x6acd('0x64'):if(_0x435617[_0x6acd('0x65')]===_0x6acd('0x66')){if(_0x435617[_0x6acd('0x60')][_0x6acd('0x67')]('\x20')['length']>0x1){_0x4c9581[_0x31f9c1](_0x6acd('0x68'),qs[_0x6acd('0x69')](_0x435617[_0x6acd('0x60')]),null);}else{var _0x8a4ba8='%'+_0x435617[_0x6acd('0x60')]+'%';_0x4c9581[_0x31f9c1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x8a4ba8,_0x8a4ba8,_0x8a4ba8);}}else{_0x268bc0=_[_0x6acd('0x5e')](_0x26b8a0,[_0x6acd('0x22'),_0x6acd('0x6a')]);_0x435617[_0x6acd('0x49')]='ContactId';_0x44d9f4=as[_0x6acd('0x6b')](_0x59baa2,_0x268bc0[_0x6acd('0x39')],_0x435617);_0x4c9581[_0x31f9c1](_0x44d9f4[_0x6acd('0x6c')],_0x44d9f4[_0x6acd('0x60')][_0x6acd('0x6d')],_0x44d9f4['value'][_0x6acd('0x16')]);}break;case _0x6acd('0x6e'):var _0x3243b8=_0x435617[_0x6acd('0x60')][_0x6acd('0x67')](',')[_0x6acd('0x35')](function(_0x9a185a){return Number(_0x9a185a);});_0x3243b8[_0x6acd('0x27')](function(_0x5edcc0){_0x2622a7['or'](_0x6acd('0x6f'),'%,'+_0x5edcc0+',%');});_0x42aea4=_[_0x6acd('0x70')](_0x42aea4,_0x3243b8);break;case'User':if(_0x435617[_0x6acd('0x65')]==='$substring'){_0x4c9581[_0x31f9c1](_0x6acd('0x71'),'%'+_0x435617[_0x6acd('0x60')]+'%',null);}else{_0x268bc0=_[_0x6acd('0x5e')](_0x26b8a0,['name',_0x6acd('0x34')]);_0x435617[_0x6acd('0x49')]='UserId';_0x44d9f4=as[_0x6acd('0x6b')](_0x59baa2,_0x268bc0[_0x6acd('0x39')],_0x435617);_0x4c9581[_0x31f9c1](_0x44d9f4[_0x6acd('0x6c')],_0x44d9f4[_0x6acd('0x60')][_0x6acd('0x6d')],_0x44d9f4['value'][_0x6acd('0x16')]);}break;case _0x6acd('0x2a'):_0x44d9f4=as[_0x6acd('0x6b')]('me',null,_0x435617);_0x4c9581[_0x31f9c1](_0x44d9f4[_0x6acd('0x6c')],_0x44d9f4[_0x6acd('0x60')][_0x6acd('0x6d')],_0x44d9f4['value'][_0x6acd('0x16')]);break;}}else{var _0x44d9f4=as[_0x6acd('0x6b')](_0x59baa2,_0x268bc0[_0x6acd('0x39')],_0x435617);_0x4c9581[_0x31f9c1](_0x44d9f4[_0x6acd('0x6c')],_0x44d9f4[_0x6acd('0x60')][_0x6acd('0x6d')],_0x44d9f4[_0x6acd('0x60')][_0x6acd('0x16')]);}}}else{var _0x5c02d6=_(_0x2a309e[_0x6acd('0x3d')])[_0x6acd('0x3c')]()[_0x6acd('0x35')](function(_0x7add67){return _[_0x6acd('0x72')](_0x26b8a0,[_0x6acd('0x22'),_0x7add67])?_0x7add67:undefined;})[_0x6acd('0x73')]()['value']();if(!_[_0x6acd('0x74')](_0x5c02d6)){_0x5c02d6[_0x6acd('0x27')](function(_0x557720){if(_0x557720===_0x6acd('0x75')){_0x4e0b8b[_0x6acd('0x47')](_0x6acd('0x76'),[][_0x6acd('0x77')](_0x2a309e[_0x6acd('0x3d')][_0x557720]));}else if(_0x557720==='createdAt'){var _0x5db345=JSON[_0x6acd('0x78')](_0x2a309e[_0x6acd('0x3d')][_0x557720])[_0x6acd('0x79')];var _0x17b132=JSON[_0x6acd('0x78')](_0x2a309e[_0x6acd('0x3d')][_0x557720])[_0x6acd('0x7a')];_0x4e0b8b['where'](_0x6acd('0x7b'),_0x5db345,_0x17b132);}else{if(_0x2a309e[_0x6acd('0x3d')][_0x557720]===_0x6acd('0x7c')){_0x4e0b8b[_0x6acd('0x47')]('i.'+_0x557720+_0x6acd('0x7d'));}else{_0x4e0b8b['where']('i.'+_0x557720+'\x20=\x20?',_0x2a309e['query'][_0x557720]);}}});}if(_0x2a309e['query'][_0x6acd('0x7e')]){if(_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x7e')]==0x1){_0x4e0b8b[_0x6acd('0x62')]('`unreadMessages`\x20=\x200');}else{_0x4e0b8b[_0x6acd('0x62')](_0x6acd('0x7f'));}}if(_0x2a309e[_0x6acd('0x3d')]['tag']){_0x42aea4=_['isArray'](_0x2a309e['query']['tag'])?_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x80')]:new Array(_0x2a309e[_0x6acd('0x3d')]['tag']);_0x42aea4['forEach'](function(_0x2a2b7b){_0x2622a7['or'](_0x6acd('0x6f'),'%,'+_0x2a2b7b+',%');});}if(_0x2a309e[_0x6acd('0x3d')]['filter']){var _0x32f4b5=_0x2a309e[_0x6acd('0x3d')][_0x6acd('0x81')][_0x6acd('0x82')]('\x5c','\x5c\x5c')[_0x6acd('0x82')](/'/g,'\x27\x27');if(qs[_0x6acd('0x83')](_0x32f4b5)){_0x4c9581['or'](_0x6acd('0x84'),_0x32f4b5+'%');}else if(qs['isEmail'](_0x32f4b5)){_0x4c9581['or'](_0x6acd('0x85'),_0x32f4b5+'%');}else{_0x4c9581['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6acd('0x69')](_0x32f4b5))['or'](_0x6acd('0x86'),qs[_0x6acd('0x69')](_0x32f4b5));}}}_0x4e0b8b[_0x6acd('0x47')](_0x4c9581);_0x4e0b8b[_0x6acd('0x87')](_0x6acd('0x88'));var _0x5e9c0f={'type':db[_0x6acd('0x89')][_0x6acd('0x8a')][_0x6acd('0x8b')],'raw':!![]};var _0x10dc9f=_0x4e0b8b[_0x6acd('0x8c')]();_0x10dc9f[_0x6acd('0x49')](_0x6acd('0x88'));_0x10dc9f['field'](_0x6acd('0x8d'),'unreadMessages');if(_0x2dc5dc['order']){_0x2dc5dc[_0x6acd('0x45')][_0x6acd('0x27')](function(_0x2bde59){var _0xfd81fe=_0x2bde59[0x0]===_0x6acd('0x8e')?_0x2bde59[0x0]:'i.'+_0x2bde59[0x0];_0x4e0b8b['order'](_0xfd81fe,_0x2bde59[0x1]===_0x6acd('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x42aea4)){_0x4e0b8b[_0x6acd('0x62')](_0x2622a7);_0x10dc9f[_0x6acd('0x47')](_0x6acd('0x90'),_0x42aea4);}BPromise[_0x6acd('0x91')]()[_0x6acd('0x1f')](function(){if(!_0x1027aa){if(_0x2a309e['query'][_0x6acd('0x75')])return;_0x10dc9f[_0x6acd('0x47')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x4e0b8b[_0x6acd('0x47')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2a309e[_0x6acd('0x92')]['role']!==_0x6acd('0x93'))return;return _0x2a309e[_0x6acd('0x92')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x6acd('0x1f')](function(_0x9fd480){if(_['isEmpty'](_0x9fd480)){_0x10dc9f[_0x6acd('0x47')](_0x6acd('0x94'));_0x4e0b8b[_0x6acd('0x47')](_0x6acd('0x94'));}else{_0x10dc9f[_0x6acd('0x47')](_0x6acd('0x76'),_[_0x6acd('0x35')](_0x9fd480,'id'));_0x4e0b8b['where']('i.MailAccountId\x20IN\x20?',_['map'](_0x9fd480,'id'));}});})[_0x6acd('0x1f')](function(){if(_0x2a309e['user']['role']==='agent'&&!_0x1027aa&&!_0x2a309e[_0x6acd('0x3d')]['MailAccountId'])return[];return db[_0x6acd('0x95')][_0x6acd('0x3d')](_0x10dc9f[_0x6acd('0x96')](),_0x5e9c0f);})[_0x6acd('0x1f')](function(_0x1567b5){_0x9c2cb6[_0x6acd('0x1b')]=_0x1567b5[_0x6acd('0x42')];if(_0x9c2cb6[_0x6acd('0x1b')]===0x0)return[];return db[_0x6acd('0x95')][_0x6acd('0x3d')](_0x2c87e6['toString'](),_0x5e9c0f)[_0x6acd('0x1f')](function(_0xa0dab6){_0x3fe020=_['keyBy'](_0xa0dab6,'id');_0x5e9c0f=_['merge'](_0x5e9c0f,{'model':db[_0x6acd('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a309e[_0x6acd('0x3d')]['fields']){_0x2dc5dc[_0x6acd('0x3f')][_0x6acd('0x27')](function(_0x16b895){_0x4e0b8b[_0x6acd('0x49')]('i.'+_0x16b895);});}else{_0x4e0b8b['field'](_0x6acd('0x8d'),_0x6acd('0x5f'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x97'),_0x6acd('0x98'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x99'),_0x6acd('0x9a'));_0x4e0b8b[_0x6acd('0x49')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x6acd('0x8e'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x88'));_0x4e0b8b[_0x6acd('0x49')]('i.createdAt');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x9b'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x9c'));_0x4e0b8b['field'](_0x6acd('0x9d'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x9e'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0x9f'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa0'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa1'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa2'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa3'));_0x4e0b8b['field']('i.thirdDisposition');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa4'));_0x4e0b8b['field'](_0x6acd('0xa5'));_0x4e0b8b[_0x6acd('0x49')]('i.ContactId');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa6'));_0x4e0b8b[_0x6acd('0x49')]('i.UserId');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa7'),'Contact.firstName');_0x4e0b8b[_0x6acd('0x49')]('c.lastName','Contact.lastName');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xa8'),_0x6acd('0xa9'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xaa'),_0x6acd('0xab'));_0x4e0b8b['field'](_0x6acd('0xac'),'Contact.mobile');_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xad'),_0x6acd('0xae'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xaf'),_0x6acd('0xb0'));_0x4e0b8b[_0x6acd('0x49')]('o.internal',_0x6acd('0xb1'));_0x4e0b8b[_0x6acd('0x49')](_0x6acd('0xb2'),_0x6acd('0x26'));}if(_0x2dc5dc[_0x6acd('0x1c')])_0x4e0b8b['limit'](_0x2dc5dc[_0x6acd('0x1c')]);if(_0x2dc5dc[_0x6acd('0x19')])_0x4e0b8b['offset'](_0x2dc5dc[_0x6acd('0x19')]);return db[_0x6acd('0x95')][_0x6acd('0x3d')](_0x4e0b8b[_0x6acd('0x96')](),_0x5e9c0f);})[_0x6acd('0x1f')](function(_0x3d1078){if(_0x3d1078['length']>0x0)_0xb0100b[_0x6acd('0x47')](_0x6acd('0xb3'),_['map'](_0x3d1078,'id'));return db[_0x6acd('0x95')][_0x6acd('0x3d')](_0xb0100b[_0x6acd('0x96')](),_0x5e9c0f)['then'](function(_0x500721){var _0x175d6e=_['groupBy'](_0x500721,'MailInteractionId');var _0x2ae4ec=[];return db[_0x6acd('0xb4')][_0x6acd('0x29')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x6acd('0x1f')](function(_0x3b1cad){var _0x5466f0=_0x3b1cad[_0x6acd('0xb5')];_0x3d1078['forEach'](function(_0x4cca6c){_0x2ae4ec[_0x6acd('0xb6')](updateMailInteraction(_0x4cca6c,_0x3fe020,_0x175d6e,_0x5466f0));});return BPromise[_0x6acd('0xb7')](_0x2ae4ec);});});});})[_0x6acd('0x1f')](function(_0x1d46e5){_0x9c2cb6[_0x6acd('0xb8')]=_0x1d46e5;return _0x9c2cb6;})['then'](respondWithFilteredResult(_0x24e9a4,_0x2dc5dc))[_0x6acd('0x2d')](handleError(_0x24e9a4,null));};exports[_0x6acd('0xb9')]=function(_0x22f8da,_0x3292a3){var _0x477d96={'raw':![],'where':{'id':_0x22f8da[_0x6acd('0xba')]['id']}},_0x35f319={};_0x35f319[_0x6acd('0x3b')]=_[_0x6acd('0x3c')](db[_0x6acd('0x36')][_0x6acd('0x37')]);_0x35f319[_0x6acd('0x3d')]=_[_0x6acd('0x3c')](_0x22f8da[_0x6acd('0x3d')]);_0x35f319[_0x6acd('0x3e')]=_[_0x6acd('0x40')](_0x35f319[_0x6acd('0x3b')],_0x35f319[_0x6acd('0x3d')]);_0x477d96[_0x6acd('0x3f')]=_[_0x6acd('0x40')](_0x35f319[_0x6acd('0x3b')],qs[_0x6acd('0x41')](_0x22f8da[_0x6acd('0x3d')][_0x6acd('0x41')]));_0x477d96[_0x6acd('0x3f')]=_0x477d96[_0x6acd('0x3f')]['length']?_0x477d96['attributes']:_0x35f319[_0x6acd('0x3b')];if(_0x22f8da[_0x6acd('0x3d')][_0x6acd('0xbb')]){_0x477d96[_0x6acd('0xbc')]=[{'all':!![]}];}_0x477d96=_[_0x6acd('0xbd')]({},_0x477d96,_0x22f8da[_0x6acd('0xbe')]);return db[_0x6acd('0x36')][_0x6acd('0x5e')](_0x477d96)[_0x6acd('0x1f')](handleEntityNotFound(_0x3292a3,null))[_0x6acd('0x1f')](respondWithResult(_0x3292a3,null))[_0x6acd('0x2d')](handleError(_0x3292a3,null));};exports[_0x6acd('0xbf')]=function(_0x23ebbf,_0x4098df){return db[_0x6acd('0x36')][_0x6acd('0xbf')](_0x23ebbf[_0x6acd('0xc0')],{})[_0x6acd('0x1f')](respondWithResult(_0x4098df,0xc9))['catch'](handleError(_0x4098df,null));};exports[_0x6acd('0x1e')]=function(_0x86a59a,_0x48511d){if(_0x86a59a[_0x6acd('0xc0')]['id']){delete _0x86a59a[_0x6acd('0xc0')]['id'];}return db[_0x6acd('0x36')][_0x6acd('0x5e')]({'where':{'id':_0x86a59a['params']['id']}})['then'](handleEntityNotFound(_0x48511d,null))[_0x6acd('0x1f')](saveUpdates(_0x86a59a[_0x6acd('0xc0')],null))['then'](respondWithResult(_0x48511d,null))[_0x6acd('0x2d')](handleError(_0x48511d,null));};exports[_0x6acd('0x20')]=function(_0x1e6912,_0x15c419){return db[_0x6acd('0x36')][_0x6acd('0x5e')]({'where':{'id':_0x1e6912[_0x6acd('0xba')]['id']}})['then'](handleEntityNotFound(_0x15c419,null))[_0x6acd('0x1f')](removeEntity(_0x15c419,null))[_0x6acd('0x2d')](handleError(_0x15c419,null));};exports[_0x6acd('0xc1')]=function(_0x460131,_0x597513){return db[_0x6acd('0x36')][_0x6acd('0xc1')]()['then'](respondWithResult(_0x597513,null))[_0x6acd('0x2d')](handleError(_0x597513,null));};exports[_0x6acd('0xc2')]=function(_0x3622d6,_0x713d76){return db[_0x6acd('0x28')][_0x6acd('0x5e')]({'where':{'id':_0x3622d6['params']['id']}})[_0x6acd('0x1f')](handleEntityNotFound(_0x713d76,null))['then'](function(_0x1e659f){if(_0x1e659f){return _0x1e659f[_0x6acd('0xc2')](_0x3622d6[_0x6acd('0xc0')][_0x6acd('0xc3')],_[_0x6acd('0xc4')](_0x3622d6[_0x6acd('0xc0')],[_0x6acd('0xc3'),'id'])||{});}})[_0x6acd('0x1f')](respondWithResult(_0x713d76,null))[_0x6acd('0x2d')](handleError(_0x713d76,null));};exports[_0x6acd('0xc5')]=function(_0x238003,_0x32861e){var _0x158849={'raw':![],'where':{}};var _0x4643d2={};var _0x3ee761={'count':0x0,'rows':[]};return db[_0x6acd('0x36')][_0x6acd('0x29')]({'where':{'id':_0x238003['params']['id']}})[_0x6acd('0x1f')](handleEntityNotFound(_0x32861e,null))[_0x6acd('0x1f')](function(_0x1bbaf9){if(_0x1bbaf9){_0x4643d2['model']=_[_0x6acd('0x3c')](db[_0x6acd('0x28')][_0x6acd('0x37')]);_0x4643d2[_0x6acd('0x3d')]=_[_0x6acd('0x3c')](_0x238003[_0x6acd('0x3d')]);_0x4643d2[_0x6acd('0x3e')]=_[_0x6acd('0x40')](_0x4643d2[_0x6acd('0x3b')],_0x4643d2['query']);_0x158849['attributes']=_[_0x6acd('0x40')](_0x4643d2[_0x6acd('0x3b')],qs[_0x6acd('0x41')](_0x238003[_0x6acd('0x3d')][_0x6acd('0x41')]));_0x158849['attributes']=_0x158849['attributes']['length']?_0x158849[_0x6acd('0x3f')]:_0x4643d2['model'];if(!_0x238003['query'][_0x6acd('0x43')](_0x6acd('0x44'))){_0x158849['limit']=qs[_0x6acd('0x1c')](_0x238003[_0x6acd('0x3d')]['limit']);_0x158849[_0x6acd('0x19')]=qs[_0x6acd('0x19')](_0x238003[_0x6acd('0x3d')][_0x6acd('0x19')]);}_0x158849['order']=qs[_0x6acd('0x46')](_0x238003[_0x6acd('0x3d')][_0x6acd('0x46')]);_0x158849[_0x6acd('0x47')]=qs[_0x6acd('0x3e')](_[_0x6acd('0xc6')](_0x238003[_0x6acd('0x3d')],_0x4643d2[_0x6acd('0x3e')]));_0x158849['where'][_0x6acd('0xc7')]=_0x1bbaf9['id'];if(_0x238003['query'][_0x6acd('0x81')]){_0x158849[_0x6acd('0x47')]=_[_0x6acd('0xbd')](_0x158849[_0x6acd('0x47')],{'$or':_[_0x6acd('0x35')](_0x158849[_0x6acd('0x3f')],function(_0x784911){var _0x191ec9={};_0x191ec9[_0x784911]={'$like':'%'+_0x238003[_0x6acd('0x3d')][_0x6acd('0x81')]+'%'};return _0x191ec9;})});}if(_0x238003['query'][_0x6acd('0x79')]){var _0x243c06=_0x238003[_0x6acd('0x3d')][_0x6acd('0x79')]['split'](',');var _0x20cf8a={};_0x20cf8a[_0x243c06[0x0]]={'$gte':moment(_0x243c06[0x1])[_0x6acd('0xc8')](_0x6acd('0xc9'))};_0x158849[_0x6acd('0x47')]=_[_0x6acd('0xbd')](_0x158849[_0x6acd('0x47')],_0x20cf8a);}_0x158849=_[_0x6acd('0xbd')]({},_0x158849,_0x238003[_0x6acd('0xbe')]);return db[_0x6acd('0x28')][_0x6acd('0x1b')]({'where':_0x158849[_0x6acd('0x47')]})[_0x6acd('0x1f')](function(_0x53c40e){_0x3ee761['count']=_0x53c40e;if(_0x238003[_0x6acd('0x3d')]['includeAll']){_0x158849[_0x6acd('0xbc')]=[{'all':!![]}];}return db['MailMessage'][_0x6acd('0xca')](_0x158849);})[_0x6acd('0x1f')](function(_0x134177){if(_0x238003['query'][_0x6acd('0xcb')]===_0x6acd('0xcc')){for(var _0x51df28=0x0;_0x51df28<_0x134177[_0x6acd('0x42')];_0x51df28++){_0x134177[_0x51df28]['body']=juice(_0x134177[_0x51df28][_0x6acd('0xc0')]);}}_0x3ee761[_0x6acd('0xb8')]=_0x134177;return _0x3ee761;});}})['then'](respondWithFilteredResult(_0x32861e,_0x158849))[_0x6acd('0x2d')](handleError(_0x32861e,null));};exports[_0x6acd('0xcd')]=function(_0x179903,_0x2aa19a){return db[_0x6acd('0x36')]['find']({'where':{'id':_0x179903['params']['id']}})[_0x6acd('0x1f')](handleEntityNotFound(_0x2aa19a,null))['then'](function(_0x24f3a6){if(_0x24f3a6){return _0x24f3a6[_0x6acd('0xce')](_0x179903[_0x6acd('0xc0')][_0x6acd('0xc3')],_[_0x6acd('0xc4')](_0x179903[_0x6acd('0xc0')],[_0x6acd('0xc3'),'id'])||{})[_0x6acd('0xcf')](function(){return db[_0x6acd('0x6e')][_0x6acd('0xca')]({'attributes':['id',_0x6acd('0x22'),_0x6acd('0x4a')],'where':{'id':_0x179903[_0x6acd('0xc0')][_0x6acd('0xc3')]}});})['then'](function(_0x548ec2){socket['emit']('mailInteractionTags:save',{'id':Number(_0x179903[_0x6acd('0xba')]['id']),'tags':_0x548ec2||[]});return{'id':Number(_0x179903['params']['id']),'tags':_0x548ec2||[]};});}})[_0x6acd('0x1f')](respondWithResult(_0x2aa19a,null))[_0x6acd('0x2d')](handleError(_0x2aa19a,null));};exports['removeTags']=function(_0x5b7208,_0x342a43){return db['MailInteraction'][_0x6acd('0x5e')]({'where':{'id':_0x5b7208[_0x6acd('0xba')]['id']}})[_0x6acd('0x1f')](handleEntityNotFound(_0x342a43,null))['then'](function(_0x323688){if(_0x323688){return _0x323688[_0x6acd('0xd0')](_0x5b7208[_0x6acd('0x3d')][_0x6acd('0xc3')]);}})[_0x6acd('0x1f')](respondWithStatusCode(_0x342a43,null))['catch'](handleError(_0x342a43,null));};exports[_0x6acd('0xd1')]=function(_0x20f88,_0x1028f9){var _0x54f591=moment()['unix']()[_0x6acd('0x96')]();var _0x2ab08e=path[_0x6acd('0xd2')](config[_0x6acd('0xd3')],_0x6acd('0xd4'),_0x6acd('0xd5'),_0x6acd('0xd6'));var _0x1c046a=path[_0x6acd('0xd2')](config[_0x6acd('0xd3')],_0x6acd('0xd4'),_0x6acd('0xd5'),_0x6acd('0xd7'));var _0x58ae7e=path['join'](_0x2ab08e,_0x54f591);var _0x29d8cf=util[_0x6acd('0xc8')](_0x6acd('0xd8'),_0x20f88[_0x6acd('0xba')]['id'],_0x54f591);var _0x24f53d=path[_0x6acd('0xd2')](_0x2ab08e,_0x29d8cf);var _0x33be1d=[];if(_0x20f88[_0x6acd('0x3d')]['attachments']){_0x33be1d[_0x6acd('0xb6')]({'model':db[_0x6acd('0xd9')],'as':'Attachments','raw':!![]});}var _0x3bd391=[{'model':db[_0x6acd('0x28')],'as':_0x6acd('0xda'),'attributes':['id',_0x6acd('0xc0'),_0x6acd('0x4d'),'to','cc',_0x6acd('0xdb'),'subject',_0x6acd('0xdc')],'where':{'secret':![]},'order':qs[_0x6acd('0x46')]('id'),'include':_0x33be1d}];return db[_0x6acd('0x36')][_0x6acd('0x5e')]({'where':{'id':_0x20f88['params']['id']},'include':_0x3bd391})[_0x6acd('0x1f')](handleEntityNotFound(_0x1028f9,null))[_0x6acd('0x1f')](function(_0x425b6c){if(_0x425b6c&&_0x425b6c['Messages']){var _0x4e9525=_0x425b6c[_0x6acd('0xdd')]({'plain':!![]});fs[_0x6acd('0xde')](_0x58ae7e);return BPromise[_0x6acd('0xdf')](_0x4e9525[_0x6acd('0xda')],function(_0x5553af,_0x482a8c){var _0x567acb={'from':_0x5553af['from'],'to':_0x5553af['to'],'subject':_0x5553af[_0x6acd('0xe0')],'html':htmlEntities[_0x6acd('0xe1')](_0x5553af[_0x6acd('0xc0')]),'headers':{'Date':moment(_0x5553af[_0x6acd('0xdc')])[_0x6acd('0xc8')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5553af['cc']){_0x567acb[_0x6acd('0xe2')]['Cc']=_0x5553af['cc'];}if(_0x5553af['bcc']){_0x567acb[_0x6acd('0xe2')]['Bcc']=_0x5553af[_0x6acd('0xdb')];}return new BPromise(function(_0x468d4c,_0x124e59){if(_0x5553af[_0x6acd('0xe3')]){for(var _0x248456=0x0;_0x248456<_0x5553af[_0x6acd('0xe3')][_0x6acd('0x42')];_0x248456++){var _0x3f7a3a=_0x5553af[_0x6acd('0xe3')][_0x248456];var _0x431d2a=path[_0x6acd('0xd2')](_0x1c046a,_0x3f7a3a[_0x6acd('0xe4')]);if(fs[_0x6acd('0xe5')](_0x431d2a)){_0x567acb[_0x6acd('0xd7')][_0x6acd('0xb6')]({'name':_0x3f7a3a[_0x6acd('0x22')],'contentType':_0x3f7a3a[_0x6acd('0x39')],'data':fs[_0x6acd('0xe6')](_0x431d2a)});}}}emlformat[_0x6acd('0xe7')](_0x567acb,function(_0x5927e3,_0x1a374b){if(_0x5927e3)return _0x124e59(_0x5927e3);fs[_0x6acd('0xe8')](path[_0x6acd('0xd2')](_0x58ae7e,util[_0x6acd('0xc8')](_0x6acd('0xe9'),_0x482a8c)),_0x1a374b);return _0x468d4c(_0x1a374b);});});})[_0x6acd('0x1f')](function(){return new BPromise(function(_0x3934d8,_0x2c31c0){zipdir(_0x58ae7e,{'saveTo':_0x24f53d},function(_0x4cd0d8,_0x277981){if(_0x4cd0d8)return _0x2c31c0(_0x4cd0d8);return _0x3934d8(_0x277981);});})[_0x6acd('0x1f')](function(){return new BPromise(function(_0x24eebf,_0x135b04){rimraf(_0x58ae7e,function(_0x1d6166){if(_0x1d6166)_0x135b04(_0x1d6166);return _0x24eebf();});});})[_0x6acd('0x1f')](function(){return _0x1028f9['download'](_0x24f53d,_0x29d8cf,function(_0x3a69fa){if(!_0x3a69fa)fs[_0x6acd('0xea')](_0x24f53d);});});});}else{return _0x1028f9[_0x6acd('0xeb')](0xc8);}})[_0x6acd('0x2d')](handleError(_0x1028f9,null));}; \ No newline at end of file +var _0xb470=['MailAccountId','where','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','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','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','merge','Account.key','i.id','i.createdAt','i.updatedAt','i.closedAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','push','all','rows','params','includeAll','options','create','body','describe','addMessage','ids','getMessages','hasOwnProperty','sort','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','true','addTags','setTags','omit','spread','findAll','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','attachments','Attachment','Messages','bcc','subject','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','fullname','TagIds','Tags','split','forEach','MailMessage','findOne','out','-id','lastMsgText','trimStart','plainBody','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','MailInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','pick','select','field','color','tools_tags','u.id','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','from','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','getFullTextValue','find','ContactId','buildExpression','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?','some','compact','isEmpty'];(function(_0xa250da,_0x56509d){var _0x34fa9a=function(_0x5d9a0b){while(--_0x5d9a0b){_0xa250da['push'](_0xa250da['shift']());}};_0x34fa9a(++_0x56509d);}(_0xb470,0x75));var _0x0b47=function(_0x5040f3,_0xbc7043){_0x5040f3=_0x5040f3-0x0;var _0x43f1b1=_0xb470[_0x5040f3];return _0x43f1b1;};'use strict';var emlformat=require(_0x0b47('0x0'));var rimraf=require(_0x0b47('0x1'));var zipdir=require(_0x0b47('0x2'));var moment=require(_0x0b47('0x3'));var BPromise=require('bluebird');var util=require(_0x0b47('0x4'));var path=require(_0x0b47('0x5'));var fs=require('fs');var _=require(_0x0b47('0x6'));var squel=require('squel');var juice=require(_0x0b47('0x7'));var Redis=require(_0x0b47('0x8'));var qs=require(_0x0b47('0x9'));var as=require(_0x0b47('0xa'));var logger=require(_0x0b47('0xb'))(_0x0b47('0xc'));var config=require(_0x0b47('0xd'));var db=require(_0x0b47('0xe'))['db'];var htmlEntities=require('html-entities');config['redis']=_['defaults'](config['redis'],{'host':_0x0b47('0xf'),'port':0x18eb});var socket=require(_0x0b47('0x10'))(new Redis(config['redis']));require(_0x0b47('0x11'))[_0x0b47('0x12')](socket);function respondWithStatusCode(_0x243f01,_0x7ba653){_0x7ba653=_0x7ba653||0xcc;return function(_0x3a7c83){if(_0x3a7c83){return _0x243f01[_0x0b47('0x13')](_0x7ba653);}return _0x243f01[_0x0b47('0x14')](_0x7ba653)[_0x0b47('0x15')]();};}function respondWithResult(_0x58b8d,_0x3d8949){_0x3d8949=_0x3d8949||0xc8;return function(_0x53ce05){if(_0x53ce05){return _0x58b8d['status'](_0x3d8949)[_0x0b47('0x16')](_0x53ce05);}};}function respondWithFilteredResult(_0x511b6e,_0x1e58a5){return function(_0x1e4988){if(_0x1e4988){var _0x4d427b=typeof _0x1e58a5[_0x0b47('0x17')]===_0x0b47('0x18')&&typeof _0x1e58a5[_0x0b47('0x19')]===_0x0b47('0x18');var _0x387084=_0x1e4988[_0x0b47('0x1a')];var _0x1e9588=_0x4d427b?0x0:_0x1e58a5[_0x0b47('0x17')];var _0x130a13=_0x4d427b?_0x1e4988[_0x0b47('0x1a')]:_0x1e58a5['offset']+_0x1e58a5[_0x0b47('0x19')];var _0x4e5f56;if(_0x130a13>=_0x387084){_0x130a13=_0x387084;_0x4e5f56=0xc8;}else{_0x4e5f56=0xce;}_0x511b6e[_0x0b47('0x14')](_0x4e5f56);return _0x511b6e[_0x0b47('0x1b')](_0x0b47('0x1c'),_0x1e9588+'-'+_0x130a13+'/'+_0x387084)['json'](_0x1e4988);}return null;};}function saveUpdates(_0x5cf426){return function(_0x5aee61){if(_0x5aee61){return _0x5aee61['update'](_0x5cf426)[_0x0b47('0x1d')](function(_0x395591){return _0x395591;});}return null;};}function removeEntity(_0x52071c){return function(_0x3f1c9c){if(_0x3f1c9c){return _0x3f1c9c['destroy']()[_0x0b47('0x1d')](function(){_0x52071c[_0x0b47('0x14')](0xcc)[_0x0b47('0x15')]();});}};}function handleEntityNotFound(_0x1b8f26){return function(_0x13180b){if(!_0x13180b){_0x1b8f26[_0x0b47('0x13')](0x194);}return _0x13180b;};}function handleError(_0x3bd7f1,_0x2dfdb4){_0x2dfdb4=_0x2dfdb4||0x1f4;return function(_0x3bff28){logger[_0x0b47('0x1e')](_0x3bff28[_0x0b47('0x1f')]);if(_0x3bff28['name']){delete _0x3bff28[_0x0b47('0x20')];}_0x3bd7f1[_0x0b47('0x14')](_0x2dfdb4)['send'](_0x3bff28);};}function getInteractionUsers(_0x32559d,_0x2a2287){return new BPromise(function(_0x27518e,_0xd9c35c){try{if(_0x2a2287[_0x32559d['id']]){_0x32559d['Users']=_['map'](_0x2a2287[_0x32559d['id']],function(_0x375983){return{'id':_0x375983['id'],'fullname':_0x375983[_0x0b47('0x21')]};});}}catch(_0x5950fa){_0xd9c35c(_0x5950fa);}_0x27518e(_0x32559d);});}function getInteractionTags(_0x138a03,_0x4509fc){return new BPromise(function(_0x3f0ab4,_0x195d5a){try{if(_0x138a03[_0x0b47('0x22')]){_0x138a03[_0x0b47('0x23')]=[];_0x138a03[_0x0b47('0x22')][_0x0b47('0x24')](',')[_0x0b47('0x25')](function(_0x15d877){_0x138a03[_0x0b47('0x23')]['push'](_0x4509fc[_0x15d877]);});}delete _0x138a03['TagIds'];}catch(_0x10c966){_0x195d5a(_0x10c966);}_0x3f0ab4(_0x138a03);});}function getLastMessageText(_0x4a446e){return new BPromise(function(_0x66f8cf,_0x9a2cc1){return db[_0x0b47('0x26')][_0x0b47('0x27')]({'where':{'$and':[{'MailInteractionId':_0x4a446e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0b47('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0b47('0x29'),'raw':!![]})[_0x0b47('0x1d')](function(_0x374589){if(_0x374589&&_0x374589['plainBody']){_0x4a446e[_0x0b47('0x2a')]=_[_0x0b47('0x2b')](_0x374589[_0x0b47('0x2c')]);}_0x66f8cf(_0x4a446e);})[_0x0b47('0x2d')](function(_0x417915){_0x9a2cc1(_0x417915);});});}function updateMailInteraction(_0x31942a,_0x5cdd7b,_0x56eeac,_0x2a8a9f){return new BPromise(function(_0x20a2d6,_0x125508){return getInteractionUsers(_0x31942a,_0x56eeac)[_0x0b47('0x1d')](function(_0xa631ff){return getInteractionTags(_0xa631ff,_0x5cdd7b);})[_0x0b47('0x1d')](function(_0x42fa6c){return getStateInteraction(_0x42fa6c);})[_0x0b47('0x1d')](function(_0x44131f){if(_0x2a8a9f){_0x20a2d6(getLastMessageText(_0x44131f));}else{_0x20a2d6(_0x44131f);}})[_0x0b47('0x2d')](function(_0x39a74a){_0x125508(_0x39a74a);});});}function getStateInteraction(_0x4bf8cb){return new BPromise(function(_0x50fd74){_0x4bf8cb[_0x0b47('0x2e')]=0x0;_0x4bf8cb['talking']=0x0;_0x4bf8cb[_0x0b47('0x2f')]=0x0;_0x4bf8cb[_0x0b47('0x30')]=0x0;_0x4bf8cb[_0x0b47('0x31')]=0x0;if(!_0x4bf8cb[_0x0b47('0x32')]&&!_0x4bf8cb[_0x0b47('0x33')]){_0x4bf8cb[_0x0b47('0x2e')]+=0x1;}if(!_0x4bf8cb['closed']&&_0x4bf8cb['UserId']){_0x4bf8cb['talking']+=0x1;if(_0x4bf8cb[_0x0b47('0x2e')]){_0x4bf8cb[_0x0b47('0x2e')]-=0x1;}}if(_0x4bf8cb[_0x0b47('0x32')]&&_0x4bf8cb[_0x0b47('0x33')]){_0x4bf8cb[_0x0b47('0x2f')]+=0x1;if(_0x4bf8cb[_0x0b47('0x34')]){_0x4bf8cb['talking']-=0x1;}}if(_0x4bf8cb[_0x0b47('0x32')]&&!_0x4bf8cb[_0x0b47('0x33')]){_0x4bf8cb[_0x0b47('0x30')]+=0x1;if(_0x4bf8cb[_0x0b47('0x2e')]){_0x4bf8cb['waiting']-=0x1;}}_0x4bf8cb['total']+=0x1;_0x50fd74(_0x4bf8cb);});}exports[_0x0b47('0x35')]=function(_0x46f0cf,_0x50b5a2){var _0x417db0={},_0x10e52b={},_0xa332b7={'count':0x0,'rows':[]};var _0x5cc3b6=_['map'](db[_0x0b47('0x36')][_0x0b47('0x37')],function(_0x139a16){return{'name':_0x139a16[_0x0b47('0x38')],'type':_0x139a16[_0x0b47('0x39')][_0x0b47('0x3a')]};});_0x10e52b[_0x0b47('0x3b')]=_[_0x0b47('0x3c')](_0x5cc3b6,_0x0b47('0x20'));_0x10e52b[_0x0b47('0x3d')]=_[_0x0b47('0x3e')](_0x46f0cf[_0x0b47('0x3d')]);_0x10e52b[_0x0b47('0x3f')]=_['intersection'](_0x10e52b['model'],_0x10e52b[_0x0b47('0x3d')]);_0x417db0['attributes']=_[_0x0b47('0x40')](_0x10e52b['model'],qs[_0x0b47('0x41')](_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x41')]));_0x417db0[_0x0b47('0x42')]=_0x417db0['attributes'][_0x0b47('0x43')]?_0x417db0[_0x0b47('0x42')]:_0x10e52b['model'];if(!_0x46f0cf[_0x0b47('0x3d')]['hasOwnProperty'](_0x0b47('0x44'))){_0x417db0[_0x0b47('0x19')]=qs[_0x0b47('0x19')](_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x19')]);_0x417db0[_0x0b47('0x17')]=qs[_0x0b47('0x17')](_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x17')]);}_0x417db0[_0x0b47('0x45')]=qs['sort'](_0x46f0cf['query']['sort']);_0x417db0['where']=qs[_0x0b47('0x3f')](_[_0x0b47('0x46')](_0x46f0cf['query'],_0x10e52b[_0x0b47('0x3f')]),_0x5cc3b6);var _0x540137=[];var _0x3e5b44=squel[_0x0b47('0x47')]()['field']('id')[_0x0b47('0x48')](_0x0b47('0x20'))[_0x0b47('0x48')](_0x0b47('0x49'))['from'](_0x0b47('0x4a'));var _0x209363=squel[_0x0b47('0x47')]()['field'](_0x0b47('0x4b'))[_0x0b47('0x48')]('u.fullname')[_0x0b47('0x48')]('ui.MailInteractionId')['from'](_0x0b47('0x4c'),'ui')[_0x0b47('0x4d')]('users','u',_0x0b47('0x4e'));var _0x53cefe=squel[_0x0b47('0x47')]()[_0x0b47('0x4f')](_0x0b47('0x50'),'i')['left_join']('cm_contacts','c',_0x0b47('0x51'))[_0x0b47('0x4d')](_0x0b47('0x52'),'o',_0x0b47('0x53'))[_0x0b47('0x4d')](_0x0b47('0x54'),'a',_0x0b47('0x55'))[_0x0b47('0x4d')](_0x0b47('0x56'),'me',_0x0b47('0x57'))[_0x0b47('0x4d')]('mail_interaction_has_tags','it',_0x0b47('0x58'))[_0x0b47('0x4d')](_0x0b47('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x57533e=squel['expr']();var _0x491ecf=[];var _0x3007bc=squel[_0x0b47('0x59')]();var _0x1e1ca1;if(_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x5a')]){_0x1e1ca1=as[_0x0b47('0x5b')](_0x46f0cf['query'][_0x0b47('0x5a')]);var _0x77b78c=_0x1e1ca1[_0x0b47('0x5c')];for(var _0x5e68a2=0x0;_0x5e68a2<_0x1e1ca1[_0x0b47('0x5d')][_0x0b47('0x43')];_0x5e68a2++){var _0x40b60f=_0x1e1ca1[_0x0b47('0x5d')][_0x5e68a2];var _0x2029c9='i';var _0x53050b=_['find'](_0x5cc3b6,[_0x0b47('0x20'),_0x40b60f[_0x0b47('0x48')]]);if(!_0x53050b){switch(_0x40b60f['field']){case _0x0b47('0x5e'):if(_0x40b60f[_0x0b47('0x5f')]==0x1){_0x53cefe[_0x0b47('0x60')]('`'+_0x40b60f[_0x0b47('0x48')]+_0x0b47('0x61'));}else{_0x53cefe[_0x0b47('0x60')]('`'+_0x40b60f[_0x0b47('0x48')]+_0x0b47('0x62'));}break;case'Contact':if(_0x40b60f[_0x0b47('0x63')]==='$substring'){if(_0x40b60f[_0x0b47('0x5f')][_0x0b47('0x24')]('\x20')[_0x0b47('0x43')]>0x1){_0x57533e[_0x77b78c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0b47('0x64')](_0x40b60f[_0x0b47('0x5f')]),null);}else{var _0x1c8516='%'+_0x40b60f[_0x0b47('0x5f')]+'%';_0x57533e[_0x77b78c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1c8516,_0x1c8516,_0x1c8516);}}else{_0x53050b=_[_0x0b47('0x65')](_0x5cc3b6,['name',_0x0b47('0x66')]);_0x40b60f[_0x0b47('0x48')]=_0x0b47('0x66');_0x430dce=as[_0x0b47('0x67')](_0x2029c9,_0x53050b[_0x0b47('0x39')],_0x40b60f);_0x57533e[_0x77b78c](_0x430dce[_0x0b47('0x68')],_0x430dce[_0x0b47('0x5f')][_0x0b47('0x69')],_0x430dce[_0x0b47('0x5f')][_0x0b47('0x15')]);}break;case _0x0b47('0x6a'):var _0x3ded91=_0x40b60f[_0x0b47('0x5f')][_0x0b47('0x24')](',')['map'](function(_0x46d973){return Number(_0x46d973);});_0x3ded91[_0x0b47('0x25')](function(_0x4d30b6){_0x3007bc['or'](_0x0b47('0x6b'),'%,'+_0x4d30b6+',%');});_0x491ecf=_[_0x0b47('0x6c')](_0x491ecf,_0x3ded91);break;case _0x0b47('0x6d'):if(_0x40b60f[_0x0b47('0x63')]===_0x0b47('0x6e')){_0x57533e[_0x77b78c](_0x0b47('0x6f'),'%'+_0x40b60f['value']+'%',null);}else{_0x53050b=_[_0x0b47('0x65')](_0x5cc3b6,[_0x0b47('0x20'),_0x0b47('0x33')]);_0x40b60f[_0x0b47('0x48')]='UserId';_0x430dce=as[_0x0b47('0x67')](_0x2029c9,_0x53050b[_0x0b47('0x39')],_0x40b60f);_0x57533e[_0x77b78c](_0x430dce[_0x0b47('0x68')],_0x430dce['value']['start'],_0x430dce[_0x0b47('0x5f')]['end']);}break;case _0x0b47('0x2c'):_0x430dce=as[_0x0b47('0x67')]('me',null,_0x40b60f);_0x57533e[_0x77b78c](_0x430dce[_0x0b47('0x68')],_0x430dce[_0x0b47('0x5f')]['start'],_0x430dce[_0x0b47('0x5f')][_0x0b47('0x15')]);break;}}else{var _0x430dce=as[_0x0b47('0x67')](_0x2029c9,_0x53050b[_0x0b47('0x39')],_0x40b60f);_0x57533e[_0x77b78c](_0x430dce['text'],_0x430dce['value'][_0x0b47('0x69')],_0x430dce[_0x0b47('0x5f')][_0x0b47('0x15')]);}}}else{var _0x5e34d0=_(_0x46f0cf[_0x0b47('0x3d')])['keys']()[_0x0b47('0x3c')](function(_0x3dd993){return _[_0x0b47('0x70')](_0x5cc3b6,[_0x0b47('0x20'),_0x3dd993])?_0x3dd993:undefined;})[_0x0b47('0x71')]()[_0x0b47('0x5f')]();if(!_[_0x0b47('0x72')](_0x5e34d0)){_0x5e34d0[_0x0b47('0x25')](function(_0x3a475a){if(_0x3a475a===_0x0b47('0x73')){_0x53cefe[_0x0b47('0x74')](_0x0b47('0x75'),[]['concat'](_0x46f0cf[_0x0b47('0x3d')][_0x3a475a]));}else if(_0x3a475a===_0x0b47('0x76')){var _0x110f99=JSON[_0x0b47('0x77')](_0x46f0cf[_0x0b47('0x3d')][_0x3a475a])[_0x0b47('0x78')];var _0x356189=JSON['parse'](_0x46f0cf[_0x0b47('0x3d')][_0x3a475a])[_0x0b47('0x79')];_0x53cefe['where'](_0x0b47('0x7a'),_0x110f99,_0x356189);}else{if(_0x46f0cf[_0x0b47('0x3d')][_0x3a475a]==='null'){_0x53cefe[_0x0b47('0x74')]('i.'+_0x3a475a+_0x0b47('0x7b'));}else{_0x53cefe[_0x0b47('0x74')]('i.'+_0x3a475a+_0x0b47('0x7c'),_0x46f0cf[_0x0b47('0x3d')][_0x3a475a]);}}});}if(_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x7d')]){if(_0x46f0cf[_0x0b47('0x3d')]['read']==0x1){_0x53cefe['having'](_0x0b47('0x7e'));}else{_0x53cefe[_0x0b47('0x60')](_0x0b47('0x7f'));}}if(_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x80')]){_0x491ecf=_[_0x0b47('0x81')](_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x80')])?_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x80')]:new Array(_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x80')]);_0x491ecf['forEach'](function(_0x2eeeff){_0x3007bc['or'](_0x0b47('0x6b'),'%,'+_0x2eeeff+',%');});}if(_0x46f0cf['query'][_0x0b47('0x82')]){var _0x1bdb6e=_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x82')][_0x0b47('0x83')]('\x5c','\x5c\x5c')[_0x0b47('0x83')](/'/g,'\x27\x27');if(qs[_0x0b47('0x84')](_0x1bdb6e)){_0x57533e['or'](_0x0b47('0x85'),_0x1bdb6e+'%');}else if(qs[_0x0b47('0x86')](_0x1bdb6e)){_0x57533e['or'](_0x0b47('0x87'),_0x1bdb6e+'%');}else{_0x57533e['or'](_0x0b47('0x88'),qs[_0x0b47('0x64')](_0x1bdb6e))['or'](_0x0b47('0x89'),qs[_0x0b47('0x64')](_0x1bdb6e));}}}_0x53cefe[_0x0b47('0x74')](_0x57533e);_0x53cefe[_0x0b47('0x8a')]('i.id');var _0x1f4238={'type':db[_0x0b47('0x8b')][_0x0b47('0x8c')][_0x0b47('0x8d')],'raw':!![]};var _0x466685=_0x53cefe['clone']();_0x466685[_0x0b47('0x48')]('i.id');_0x466685[_0x0b47('0x48')](_0x0b47('0x8e'),_0x0b47('0x5e'));if(_0x417db0[_0x0b47('0x45')]){_0x417db0['order'][_0x0b47('0x25')](function(_0x117518){var _0xf54f1a=_0x117518[0x0]===_0x0b47('0x8f')?_0x117518[0x0]:'i.'+_0x117518[0x0];_0x53cefe[_0x0b47('0x45')](_0xf54f1a,_0x117518[0x1]===_0x0b47('0x90')?![]:!![]);});}if(!_[_0x0b47('0x72')](_0x491ecf)){_0x53cefe[_0x0b47('0x60')](_0x3007bc);_0x466685['where'](_0x0b47('0x91'),_0x491ecf);}BPromise['resolve']()[_0x0b47('0x1d')](function(){if(!_0x1e1ca1){if(_0x46f0cf['query']['MailAccountId'])return;_0x466685[_0x0b47('0x74')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x53cefe[_0x0b47('0x74')](_0x0b47('0x92'));return;}if(_0x46f0cf[_0x0b47('0x93')][_0x0b47('0x94')]!==_0x0b47('0x95'))return;return _0x46f0cf[_0x0b47('0x93')][_0x0b47('0x96')]({'attributes':['id'],'raw':!![]})[_0x0b47('0x1d')](function(_0x2afe32){if(_[_0x0b47('0x72')](_0x2afe32)){_0x466685[_0x0b47('0x74')](_0x0b47('0x97'));_0x53cefe['where'](_0x0b47('0x97'));}else{_0x466685[_0x0b47('0x74')](_0x0b47('0x75'),_[_0x0b47('0x3c')](_0x2afe32,'id'));_0x53cefe['where'](_0x0b47('0x75'),_[_0x0b47('0x3c')](_0x2afe32,'id'));}});})[_0x0b47('0x1d')](function(){if(_0x46f0cf['user'][_0x0b47('0x94')]===_0x0b47('0x95')&&!_0x1e1ca1&&!_0x46f0cf[_0x0b47('0x3d')]['MailAccountId'])return[];return db['sequelize'][_0x0b47('0x3d')](_0x466685[_0x0b47('0x98')](),_0x1f4238);})[_0x0b47('0x1d')](function(_0x1e14af){_0xa332b7[_0x0b47('0x1a')]=_0x1e14af[_0x0b47('0x43')];if(_0xa332b7[_0x0b47('0x1a')]===0x0)return[];return db['sequelize']['query'](_0x3e5b44[_0x0b47('0x98')](),_0x1f4238)[_0x0b47('0x1d')](function(_0x3ef612){_0x540137=_['keyBy'](_0x3ef612,'id');_0x1f4238=_[_0x0b47('0x99')](_0x1f4238,{'model':db[_0x0b47('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46f0cf[_0x0b47('0x3d')][_0x0b47('0x41')]){_0x417db0[_0x0b47('0x42')][_0x0b47('0x25')](function(_0x31e1c4){_0x53cefe[_0x0b47('0x48')]('i.'+_0x31e1c4);});}else{_0x53cefe['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0b47('0x5e'));_0x53cefe[_0x0b47('0x48')]('a.key',_0x0b47('0x9a'));_0x53cefe['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x53cefe['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x0b47('0x8f'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0x9b'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0x9c'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0x9d'));_0x53cefe[_0x0b47('0x48')]('i.closed');_0x53cefe[_0x0b47('0x48')](_0x0b47('0x9e'));_0x53cefe[_0x0b47('0x48')]('i.attach');_0x53cefe[_0x0b47('0x48')]('i.lastMsgAt');_0x53cefe[_0x0b47('0x48')](_0x0b47('0x9f'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xa0'));_0x53cefe[_0x0b47('0x48')]('i.disposition');_0x53cefe['field'](_0x0b47('0xa1'));_0x53cefe['field'](_0x0b47('0xa2'));_0x53cefe['field'](_0x0b47('0xa3'));_0x53cefe['field'](_0x0b47('0xa4'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xa5'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xa6'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xa7'));_0x53cefe[_0x0b47('0x48')]('c.firstName','Contact.firstName');_0x53cefe[_0x0b47('0x48')]('c.lastName',_0x0b47('0xa8'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xa9'),_0x0b47('0xaa'));_0x53cefe['field'](_0x0b47('0xab'),'Contact.phone');_0x53cefe[_0x0b47('0x48')](_0x0b47('0xac'),'Contact.mobile');_0x53cefe[_0x0b47('0x48')]('c.fax',_0x0b47('0xad'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xae'),_0x0b47('0xaf'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xb0'),_0x0b47('0xb1'));_0x53cefe[_0x0b47('0x48')](_0x0b47('0xb2'),_0x0b47('0x22'));}if(_0x417db0[_0x0b47('0x19')])_0x53cefe['limit'](_0x417db0['limit']);if(_0x417db0[_0x0b47('0x17')])_0x53cefe[_0x0b47('0x17')](_0x417db0[_0x0b47('0x17')]);return db[_0x0b47('0xb3')][_0x0b47('0x3d')](_0x53cefe[_0x0b47('0x98')](),_0x1f4238);})[_0x0b47('0x1d')](function(_0x3a137c){if(_0x3a137c[_0x0b47('0x43')]>0x0)_0x209363[_0x0b47('0x74')](_0x0b47('0xb4'),_[_0x0b47('0x3c')](_0x3a137c,'id'));return db['sequelize'][_0x0b47('0x3d')](_0x209363[_0x0b47('0x98')](),_0x1f4238)[_0x0b47('0x1d')](function(_0x191395){var _0x129e0d=_['groupBy'](_0x191395,_0x0b47('0xb5'));var _0x409399=[];return db[_0x0b47('0xb6')][_0x0b47('0x27')]({'attributes':[_0x0b47('0xb7')],'raw':!![]})['then'](function(_0x45f808){var _0x26926a=_0x45f808[_0x0b47('0xb7')];_0x3a137c[_0x0b47('0x25')](function(_0x4ee2f1){_0x409399[_0x0b47('0xb8')](updateMailInteraction(_0x4ee2f1,_0x540137,_0x129e0d,_0x26926a));});return BPromise[_0x0b47('0xb9')](_0x409399);});});});})[_0x0b47('0x1d')](function(_0x2cff35){_0xa332b7[_0x0b47('0xba')]=_0x2cff35;return _0xa332b7;})[_0x0b47('0x1d')](respondWithFilteredResult(_0x50b5a2,_0x417db0))[_0x0b47('0x2d')](handleError(_0x50b5a2,null));};exports['show']=function(_0x14a0c0,_0xf12ee4){var _0x113baa={'raw':![],'where':{'id':_0x14a0c0[_0x0b47('0xbb')]['id']}},_0x408243={};_0x408243['model']=_[_0x0b47('0x3e')](db['MailInteraction'][_0x0b47('0x37')]);_0x408243[_0x0b47('0x3d')]=_['keys'](_0x14a0c0[_0x0b47('0x3d')]);_0x408243[_0x0b47('0x3f')]=_['intersection'](_0x408243['model'],_0x408243[_0x0b47('0x3d')]);_0x113baa[_0x0b47('0x42')]=_['intersection'](_0x408243['model'],qs[_0x0b47('0x41')](_0x14a0c0[_0x0b47('0x3d')][_0x0b47('0x41')]));_0x113baa[_0x0b47('0x42')]=_0x113baa['attributes']['length']?_0x113baa[_0x0b47('0x42')]:_0x408243[_0x0b47('0x3b')];if(_0x14a0c0[_0x0b47('0x3d')][_0x0b47('0xbc')]){_0x113baa['include']=[{'all':!![]}];}_0x113baa=_[_0x0b47('0x99')]({},_0x113baa,_0x14a0c0[_0x0b47('0xbd')]);return db['MailInteraction'][_0x0b47('0x65')](_0x113baa)[_0x0b47('0x1d')](handleEntityNotFound(_0xf12ee4,null))[_0x0b47('0x1d')](respondWithResult(_0xf12ee4,null))[_0x0b47('0x2d')](handleError(_0xf12ee4,null));};exports[_0x0b47('0xbe')]=function(_0x553dde,_0x35a224){return db[_0x0b47('0x36')]['create'](_0x553dde[_0x0b47('0xbf')],{})['then'](respondWithResult(_0x35a224,0xc9))[_0x0b47('0x2d')](handleError(_0x35a224,null));};exports['update']=function(_0x12ba90,_0x4ec955){if(_0x12ba90[_0x0b47('0xbf')]['id']){delete _0x12ba90[_0x0b47('0xbf')]['id'];}return db[_0x0b47('0x36')]['find']({'where':{'id':_0x12ba90[_0x0b47('0xbb')]['id']}})['then'](handleEntityNotFound(_0x4ec955,null))[_0x0b47('0x1d')](saveUpdates(_0x12ba90['body'],null))[_0x0b47('0x1d')](respondWithResult(_0x4ec955,null))['catch'](handleError(_0x4ec955,null));};exports['destroy']=function(_0x175a9e,_0x5ab9e2){return db['MailInteraction'][_0x0b47('0x65')]({'where':{'id':_0x175a9e[_0x0b47('0xbb')]['id']}})[_0x0b47('0x1d')](handleEntityNotFound(_0x5ab9e2,null))[_0x0b47('0x1d')](removeEntity(_0x5ab9e2,null))[_0x0b47('0x2d')](handleError(_0x5ab9e2,null));};exports[_0x0b47('0xc0')]=function(_0x2cb6a1,_0x2d7394){return db[_0x0b47('0x36')][_0x0b47('0xc0')]()[_0x0b47('0x1d')](respondWithResult(_0x2d7394,null))[_0x0b47('0x2d')](handleError(_0x2d7394,null));};exports[_0x0b47('0xc1')]=function(_0x23cd4b,_0x4a76a0){return db[_0x0b47('0x26')][_0x0b47('0x65')]({'where':{'id':_0x23cd4b[_0x0b47('0xbb')]['id']}})[_0x0b47('0x1d')](handleEntityNotFound(_0x4a76a0,null))['then'](function(_0x5cdccd){if(_0x5cdccd){return _0x5cdccd['addMessage'](_0x23cd4b[_0x0b47('0xbf')][_0x0b47('0xc2')],_['omit'](_0x23cd4b[_0x0b47('0xbf')],[_0x0b47('0xc2'),'id'])||{});}})[_0x0b47('0x1d')](respondWithResult(_0x4a76a0,null))[_0x0b47('0x2d')](handleError(_0x4a76a0,null));};exports[_0x0b47('0xc3')]=function(_0x1c66a4,_0xef10e6){var _0x52d838={'raw':![],'where':{}};var _0x2d311b={};var _0x2d8377={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x1c66a4[_0x0b47('0xbb')]['id']}})[_0x0b47('0x1d')](handleEntityNotFound(_0xef10e6,null))[_0x0b47('0x1d')](function(_0x4a4982){if(_0x4a4982){_0x2d311b['model']=_['keys'](db[_0x0b47('0x26')]['rawAttributes']);_0x2d311b[_0x0b47('0x3d')]=_[_0x0b47('0x3e')](_0x1c66a4[_0x0b47('0x3d')]);_0x2d311b[_0x0b47('0x3f')]=_[_0x0b47('0x40')](_0x2d311b['model'],_0x2d311b[_0x0b47('0x3d')]);_0x52d838[_0x0b47('0x42')]=_[_0x0b47('0x40')](_0x2d311b['model'],qs[_0x0b47('0x41')](_0x1c66a4['query'][_0x0b47('0x41')]));_0x52d838['attributes']=_0x52d838[_0x0b47('0x42')][_0x0b47('0x43')]?_0x52d838[_0x0b47('0x42')]:_0x2d311b[_0x0b47('0x3b')];if(!_0x1c66a4[_0x0b47('0x3d')][_0x0b47('0xc4')]('nolimit')){_0x52d838[_0x0b47('0x19')]=qs['limit'](_0x1c66a4[_0x0b47('0x3d')]['limit']);_0x52d838[_0x0b47('0x17')]=qs[_0x0b47('0x17')](_0x1c66a4['query'][_0x0b47('0x17')]);}_0x52d838[_0x0b47('0x45')]=qs[_0x0b47('0xc5')](_0x1c66a4[_0x0b47('0x3d')][_0x0b47('0xc5')]);_0x52d838[_0x0b47('0x74')]=qs[_0x0b47('0x3f')](_[_0x0b47('0x46')](_0x1c66a4[_0x0b47('0x3d')],_0x2d311b[_0x0b47('0x3f')]));_0x52d838[_0x0b47('0x74')]['MailInteractionId']=_0x4a4982['id'];if(_0x1c66a4[_0x0b47('0x3d')][_0x0b47('0x82')]){_0x52d838['where']=_[_0x0b47('0x99')](_0x52d838[_0x0b47('0x74')],{'$or':_['map'](_0x52d838[_0x0b47('0x42')],function(_0x5abb3f){var _0x2fc2cb={};_0x2fc2cb[_0x5abb3f]={'$like':'%'+_0x1c66a4[_0x0b47('0x3d')][_0x0b47('0x82')]+'%'};return _0x2fc2cb;})});}if(_0x1c66a4[_0x0b47('0x3d')]['$gte']){var _0x3c847b=_0x1c66a4[_0x0b47('0x3d')]['$gte'][_0x0b47('0x24')](',');var _0x33f4b8={};_0x33f4b8[_0x3c847b[0x0]]={'$gte':moment(_0x3c847b[0x1])[_0x0b47('0xc6')](_0x0b47('0xc7'))};_0x52d838[_0x0b47('0x74')]=_[_0x0b47('0x99')](_0x52d838[_0x0b47('0x74')],_0x33f4b8);}_0x52d838=_[_0x0b47('0x99')]({},_0x52d838,_0x1c66a4[_0x0b47('0xbd')]);return db[_0x0b47('0x26')][_0x0b47('0x1a')]({'where':_0x52d838['where']})[_0x0b47('0x1d')](function(_0x4ac809){_0x2d8377['count']=_0x4ac809;if(_0x1c66a4[_0x0b47('0x3d')][_0x0b47('0xbc')]){_0x52d838[_0x0b47('0xc8')]=[{'all':!![]}];}return db[_0x0b47('0x26')]['findAll'](_0x52d838);})[_0x0b47('0x1d')](function(_0x39dec2){if(_0x1c66a4['query'][_0x0b47('0xc9')]===_0x0b47('0xca')){for(var _0xf001c5=0x0;_0xf001c5<_0x39dec2[_0x0b47('0x43')];_0xf001c5++){_0x39dec2[_0xf001c5][_0x0b47('0xbf')]=juice(_0x39dec2[_0xf001c5][_0x0b47('0xbf')]);}}_0x2d8377[_0x0b47('0xba')]=_0x39dec2;return _0x2d8377;});}})['then'](respondWithFilteredResult(_0xef10e6,_0x52d838))['catch'](handleError(_0xef10e6,null));};exports[_0x0b47('0xcb')]=function(_0x572f18,_0x2267db){return db[_0x0b47('0x36')][_0x0b47('0x65')]({'where':{'id':_0x572f18['params']['id']}})[_0x0b47('0x1d')](handleEntityNotFound(_0x2267db,null))[_0x0b47('0x1d')](function(_0x1da7f1){if(_0x1da7f1){return _0x1da7f1[_0x0b47('0xcc')](_0x572f18['body'][_0x0b47('0xc2')],_[_0x0b47('0xcd')](_0x572f18[_0x0b47('0xbf')],['ids','id'])||{})[_0x0b47('0xce')](function(){return db['Tag'][_0x0b47('0xcf')]({'attributes':['id',_0x0b47('0x20'),_0x0b47('0x49')],'where':{'id':_0x572f18[_0x0b47('0xbf')]['ids']}});})[_0x0b47('0x1d')](function(_0x4c6d5e){socket[_0x0b47('0xd0')](_0x0b47('0xd1'),{'id':Number(_0x572f18[_0x0b47('0xbb')]['id']),'tags':_0x4c6d5e||[]});return{'id':Number(_0x572f18[_0x0b47('0xbb')]['id']),'tags':_0x4c6d5e||[]};});}})[_0x0b47('0x1d')](respondWithResult(_0x2267db,null))[_0x0b47('0x2d')](handleError(_0x2267db,null));};exports[_0x0b47('0xd2')]=function(_0x468e4f,_0x45e198){return db[_0x0b47('0x36')][_0x0b47('0x65')]({'where':{'id':_0x468e4f[_0x0b47('0xbb')]['id']}})[_0x0b47('0x1d')](handleEntityNotFound(_0x45e198,null))[_0x0b47('0x1d')](function(_0x4ccb19){if(_0x4ccb19){return _0x4ccb19[_0x0b47('0xd2')](_0x468e4f[_0x0b47('0x3d')][_0x0b47('0xc2')]);}})[_0x0b47('0x1d')](respondWithStatusCode(_0x45e198,null))[_0x0b47('0x2d')](handleError(_0x45e198,null));};exports[_0x0b47('0xd3')]=function(_0x3f486d,_0x2f33c6){var _0x2ec8b7=moment()[_0x0b47('0xd4')]()[_0x0b47('0x98')]();var _0x1471b4=path[_0x0b47('0xd5')](config[_0x0b47('0xd6')],'server',_0x0b47('0xd7'),'tmp');var _0x265073=path[_0x0b47('0xd5')](config[_0x0b47('0xd6')],'server',_0x0b47('0xd7'),_0x0b47('0xd8'));var _0x1f1b69=path['join'](_0x1471b4,_0x2ec8b7);var _0x1d67e6=util['format']('transcript-%d-%s.zip',_0x3f486d[_0x0b47('0xbb')]['id'],_0x2ec8b7);var _0x521586=path[_0x0b47('0xd5')](_0x1471b4,_0x1d67e6);var _0x4476f9=[];if(_0x3f486d[_0x0b47('0x3d')][_0x0b47('0xd8')]){_0x4476f9[_0x0b47('0xb8')]({'model':db[_0x0b47('0xd9')],'as':'Attachments','raw':!![]});}var _0x5d6a41=[{'model':db[_0x0b47('0x26')],'as':_0x0b47('0xda'),'attributes':['id',_0x0b47('0xbf'),_0x0b47('0x4f'),'to','cc',_0x0b47('0xdb'),_0x0b47('0xdc'),_0x0b47('0x76')],'where':{'secret':![]},'order':qs[_0x0b47('0xc5')]('id'),'include':_0x4476f9}];return db[_0x0b47('0x36')][_0x0b47('0x65')]({'where':{'id':_0x3f486d[_0x0b47('0xbb')]['id']},'include':_0x5d6a41})[_0x0b47('0x1d')](handleEntityNotFound(_0x2f33c6,null))[_0x0b47('0x1d')](function(_0xc20434){if(_0xc20434&&_0xc20434[_0x0b47('0xda')]){var _0x416578=_0xc20434[_0x0b47('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x1f1b69);return BPromise[_0x0b47('0xde')](_0x416578[_0x0b47('0xda')],function(_0x2092e0,_0x462142){var _0x363bf0={'from':_0x2092e0[_0x0b47('0x4f')],'to':_0x2092e0['to'],'subject':_0x2092e0[_0x0b47('0xdc')],'html':htmlEntities[_0x0b47('0xdf')](_0x2092e0[_0x0b47('0xbf')]),'headers':{'Date':moment(_0x2092e0['createdAt'])['format'](_0x0b47('0xe0'))},'attachments':[]};if(_0x2092e0['cc']){_0x363bf0[_0x0b47('0xe1')]['Cc']=_0x2092e0['cc'];}if(_0x2092e0[_0x0b47('0xdb')]){_0x363bf0['headers']['Bcc']=_0x2092e0[_0x0b47('0xdb')];}return new BPromise(function(_0x7ca0c7,_0x213ac1){if(_0x2092e0[_0x0b47('0xe2')]){for(var _0x70b833=0x0;_0x70b833<_0x2092e0[_0x0b47('0xe2')][_0x0b47('0x43')];_0x70b833++){var _0x4afe12=_0x2092e0[_0x0b47('0xe2')][_0x70b833];var _0x1ccfb5=path[_0x0b47('0xd5')](_0x265073,_0x4afe12[_0x0b47('0xe3')]);if(fs[_0x0b47('0xe4')](_0x1ccfb5)){_0x363bf0[_0x0b47('0xd8')][_0x0b47('0xb8')]({'name':_0x4afe12['name'],'contentType':_0x4afe12[_0x0b47('0x39')],'data':fs['readFileSync'](_0x1ccfb5)});}}}emlformat[_0x0b47('0xe5')](_0x363bf0,function(_0x12cd22,_0xbba407){if(_0x12cd22)return _0x213ac1(_0x12cd22);fs['writeFileSync'](path['join'](_0x1f1b69,util['format'](_0x0b47('0xe6'),_0x462142)),_0xbba407);return _0x7ca0c7(_0xbba407);});});})[_0x0b47('0x1d')](function(){return new BPromise(function(_0x2cfb53,_0x598958){zipdir(_0x1f1b69,{'saveTo':_0x521586},function(_0x10d45b,_0x182355){if(_0x10d45b)return _0x598958(_0x10d45b);return _0x2cfb53(_0x182355);});})['then'](function(){return new BPromise(function(_0x448f52,_0x2dae9d){rimraf(_0x1f1b69,function(_0x628df6){if(_0x628df6)_0x2dae9d(_0x628df6);return _0x448f52();});});})['then'](function(){return _0x2f33c6[_0x0b47('0xd3')](_0x521586,_0x1d67e6,function(_0xc3feef){if(!_0xc3feef)fs[_0x0b47('0xe7')](_0x521586);});});});}else{return _0x2f33c6[_0x0b47('0x13')](0xc8);}})[_0x0b47('0x2d')](handleError(_0x2f33c6,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a879bc0..67a4021 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 _0x0592=['map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then'];(function(_0x5926d2,_0x1f718a){var _0xd427c4=function(_0x22d31e){while(--_0x22d31e){_0x5926d2['push'](_0x5926d2['shift']());}};_0xd427c4(++_0x1f718a);}(_0x0592,0x117));var _0x2059=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0592[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x2059('0x0'));var MailInteraction=require(_0x2059('0x1'))['db'][_0x2059('0x2')];var MailMessage=require(_0x2059('0x1'))['db'][_0x2059('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2059('0x4')](0x0);var events={'afterCreate':_0x2059('0x5'),'afterUpdate':_0x2059('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2a444a){return function(_0x5b40d3,_0x5252f7,_0x154e5a){_0x5b40d3[_0x2059('0x7')]({'attributes':['id'],'raw':!![]})[_0x2059('0x8')](function(_0x29be61){_0x5b40d3['setDataValue']('Users',_0x29be61[_0x2059('0x9')](function(_0xbab80d){return{'id':_0xbab80d['id']};}));return MailMessage[_0x2059('0xa')]({'where':{'MailInteractionId':_0x5b40d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2059('0x8')](function(_0x2d1473){_0x5b40d3[_0x2059('0xb')](_0x2059('0xc'),_0x2d1473[_0x2059('0xd')]);MailInteractionEvents[_0x2059('0xe')](_0x2a444a+':'+_0x5b40d3['id'],_0x5b40d3);MailInteractionEvents[_0x2059('0xe')](_0x2a444a,_0x5b40d3);_0x154e5a(null);})[_0x2059('0xf')](_0x154e5a(null));};}for(var e in events){if(events[_0x2059('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x2059('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xe282=['exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','then','length','emit','catch','hasOwnProperty'];(function(_0x5d5d25,_0x3b8c9d){var _0x4b25ca=function(_0x5ea089){while(--_0x5ea089){_0x5d5d25['push'](_0x5d5d25['shift']());}};_0x4b25ca(++_0x3b8c9d);}(_0xe282,0xde));var _0x2e28=function(_0x211704,_0x1b3329){_0x211704=_0x211704-0x0;var _0x4c65f7=_0xe282[_0x211704];return _0x4c65f7;};'use strict';var EventEmitter=require(_0x2e28('0x0'));var MailInteraction=require(_0x2e28('0x1'))['db'][_0x2e28('0x2')];var MailMessage=require(_0x2e28('0x1'))['db'][_0x2e28('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2e28('0x4')](0x0);var events={'afterCreate':_0x2e28('0x5'),'afterUpdate':_0x2e28('0x6'),'afterDestroy':_0x2e28('0x7')};function emitEvent(_0x47b22f){return function(_0x22790b,_0x190eeb,_0x591574){_0x22790b['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5281ba){_0x22790b[_0x2e28('0x8')](_0x2e28('0x9'),_0x5281ba[_0x2e28('0xa')](function(_0x4efcef){return{'id':_0x4efcef['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x22790b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e28('0xb')](function(_0x5500ec){_0x22790b[_0x2e28('0x8')]('unreadMessages',_0x5500ec[_0x2e28('0xc')]);MailInteractionEvents[_0x2e28('0xd')](_0x47b22f+':'+_0x22790b['id'],_0x22790b);MailInteractionEvents['emit'](_0x47b22f,_0x22790b);_0x591574(null);})[_0x2e28('0xe')](_0x591574(null));};}for(var e in events){if(events[_0x2e28('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x2e28('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 97fa235..e9e8f46 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 _0x9a22=['bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x55c6d6,_0x1a3947){var _0xfc3d86=function(_0x502db2){while(--_0x502db2){_0x55c6d6['push'](_0x55c6d6['shift']());}};_0xfc3d86(++_0x1a3947);}(_0x9a22,0x7e));var _0x29a2=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x9a22[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require(_0x29a2('0x0'));var logger=require(_0x29a2('0x1'))(_0x29a2('0x2'));var moment=require(_0x29a2('0x3'));var BPromise=require(_0x29a2('0x4'));var rp=require(_0x29a2('0x5'));var fs=require('fs');var path=require(_0x29a2('0x6'));var rimraf=require('rimraf');var config=require(_0x29a2('0x7'));var attributes=require(_0x29a2('0x8'));module['exports']=function(_0x332f88,_0x10412d){return _0x332f88[_0x29a2('0x9')](_0x29a2('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x29a2('0xb'),'fields':[_0x29a2('0xc'),'to'],'type':_0x29a2('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50d54c,_0x1736d7,_0x2f34bb){if(_0x50d54c[_0x29a2('0xe')]){_0x50d54c[_0x29a2('0xf')]=moment()[_0x29a2('0x10')](_0x29a2('0x11'));}if(_0x50d54c[_0x29a2('0x12')]){_0x50d54c[_0x29a2('0x13')]=moment()[_0x29a2('0x10')](_0x29a2('0x11'));}_0x2f34bb(null,_0x1736d7);},'beforeUpdate':function(_0x2002ed,_0x5a506c,_0x2477a7){if(_0x2002ed[_0x29a2('0x14')](_0x29a2('0xe'))){_0x2002ed[_0x29a2('0xf')]=_0x2002ed[_0x29a2('0xe')]?moment()[_0x29a2('0x10')](_0x29a2('0x11')):null;}if(_0x2002ed[_0x29a2('0x14')](_0x29a2('0x12'))){_0x2002ed[_0x29a2('0x13')]=moment()['format'](_0x29a2('0x11'));_0x2002ed[_0x29a2('0xe')]=null;_0x2002ed[_0x29a2('0xf')]=null;}_0x2477a7(null,_0x2002ed);},'afterUpdate':function(_0x4ac587,_0x36fe29,_0x414d8c){var _0x36935c=_0x332f88[_0x29a2('0x15')];var _0x124589=_0x4ac587['get']({'plain':!![]});if(_0x124589[_0x29a2('0x12')]){return _0x36935c[_0x29a2('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x124589['id']}})[_0x29a2('0x17')](function(){_0x414d8c();})[_0x29a2('0x18')](function(_0x20886d){_0x414d8c(_0x20886d);});}else{_0x414d8c();}}},'charset':'utf8mb4','collate':_0x29a2('0x19')});}; \ No newline at end of file +var _0x3c51=['closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','closed','substatusAt','models','get','MailMessage','then','catch','util','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','format'];(function(_0x1bc912,_0x719941){var _0x41a9aa=function(_0x1ad3ba){while(--_0x1ad3ba){_0x1bc912['push'](_0x1bc912['shift']());}};_0x41a9aa(++_0x719941);}(_0x3c51,0x82));var _0x13c5=function(_0x475042,_0x5eb445){_0x475042=_0x475042-0x0;var _0x5e38a2=_0x3c51[_0x475042];return _0x5e38a2;};'use strict';var _=require('lodash');var util=require(_0x13c5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x13c5('0x1'));var rp=require(_0x13c5('0x2'));var fs=require('fs');var path=require(_0x13c5('0x3'));var rimraf=require(_0x13c5('0x4'));var config=require(_0x13c5('0x5'));var attributes=require(_0x13c5('0x6'));module[_0x13c5('0x7')]=function(_0x513a4a,_0x12a5b9){return _0x513a4a['define'](_0x13c5('0x8'),attributes,{'tableName':_0x13c5('0x9'),'paranoid':![],'indexes':[{'name':_0x13c5('0xa'),'fields':['subject','to'],'type':_0x13c5('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x544202,_0x161d7f,_0x42fd25){if(_0x544202[_0x13c5('0xc')]){_0x544202['substatusAt']=moment()[_0x13c5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x544202['closed']){_0x544202[_0x13c5('0xe')]=moment()[_0x13c5('0xd')](_0x13c5('0xf'));}_0x42fd25(null,_0x161d7f);},'beforeUpdate':function(_0x22d7c2,_0x376271,_0xf651f1){if(_0x22d7c2['changed'](_0x13c5('0xc'))){_0x22d7c2['substatusAt']=_0x22d7c2[_0x13c5('0xc')]?moment()[_0x13c5('0xd')](_0x13c5('0xf')):null;}if(_0x22d7c2[_0x13c5('0x10')](_0x13c5('0x11'))){_0x22d7c2[_0x13c5('0xe')]=moment()[_0x13c5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x22d7c2[_0x13c5('0xc')]=null;_0x22d7c2[_0x13c5('0x12')]=null;}_0xf651f1(null,_0x22d7c2);},'afterUpdate':function(_0x35f43d,_0x3aa66d,_0x3ae3c9){var _0x42a0b6=_0x513a4a[_0x13c5('0x13')];var _0x12c46a=_0x35f43d[_0x13c5('0x14')]({'plain':!![]});if(_0x12c46a['closed']){return _0x42a0b6[_0x13c5('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x12c46a['id']}})[_0x13c5('0x16')](function(){_0x3ae3c9();})[_0x13c5('0x17')](function(_0x33ec33){_0x3ae3c9(_0x33ec33);});}else{_0x3ae3c9();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8200b9d..c283e18 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 _0x103f=['result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','then','debug','AddTagsToMailInteraction','where','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','info','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message'];(function(_0x13f0f2,_0x2b3566){var _0xe733ed=function(_0x2c64e4){while(--_0x2c64e4){_0x13f0f2['push'](_0x13f0f2['shift']());}};_0xe733ed(++_0x2b3566);}(_0x103f,0x13e));var _0xf103=function(_0xd807c6,_0x31a900){_0xd807c6=_0xd807c6-0x0;var _0x2decc9=_0x103f[_0xd807c6];return _0x2decc9;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});config[_0xf103('0xd')]=_[_0xf103('0xe')](config[_0xf103('0xd')],{'host':_0xf103('0xf'),'port':0x18eb});var socket=require(_0xf103('0x10'))(new Redis(config[_0xf103('0xd')]));require(_0xf103('0x11'))[_0xf103('0x12')](socket);function respondWithRpcPromise(_0x267ec4,_0x47b71b,_0x228805){return new BPromise(function(_0x532559,_0x2aa8fd){return client['request'](_0x267ec4,_0x228805)['then'](function(_0xb3a849){logger[_0xf103('0x13')]('MailInteraction,\x20%s,\x20%s',_0x47b71b,_0xf103('0x14'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x47b71b,'request\x20sent',JSON[_0xf103('0x15')](_0xb3a849));if(_0xb3a849['error']){if(_0xb3a849[_0xf103('0x16')][_0xf103('0x17')]===0x1f4){logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849[_0xf103('0x16')]['message']);return _0x2aa8fd(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849['error']['message']);return _0x532559(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}else{logger[_0xf103('0x13')](_0xf103('0x18'),_0x47b71b,_0xf103('0x14'));_0x532559(_0xb3a849[_0xf103('0x1a')]['message']);}})[_0xf103('0x1b')](function(_0x338a44){logger['error'](_0xf103('0x18'),_0x47b71b,_0x338a44);_0x2aa8fd(_0x338a44);});});}exports[_0xf103('0x1c')]=function(_0x280aeb){var _0x40418e=this;return new Promise(function(_0xebb4ae,_0x5d28e9){return db[_0xf103('0x1d')][_0xf103('0x1e')](_0x280aeb[_0xf103('0x1f')],{'raw':_0x280aeb[_0xf103('0x20')]?_0x280aeb[_0xf103('0x20')][_0xf103('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x280aeb[_0xf103('0x20')]?_0x280aeb[_0xf103('0x20')]['where']||null:null,'attributes':_0x280aeb[_0xf103('0x20')]?_0x280aeb['options'][_0xf103('0x22')]||null:null,'limit':_0x280aeb['options']?_0x280aeb[_0xf103('0x20')][_0xf103('0x23')]||null:null})[_0xf103('0x24')](function(_0x27d98){logger[_0xf103('0x13')](_0xf103('0x1c'),_0x280aeb);logger[_0xf103('0x25')](_0xf103('0x1c'),_0x280aeb,JSON['stringify'](_0x27d98));_0xebb4ae(_0x27d98);})[_0xf103('0x1b')](function(_0x4bdc52){logger[_0xf103('0x16')]('UpdateMailInteraction',_0x4bdc52[_0xf103('0x19')],_0x280aeb);_0x5d28e9(_0x40418e[_0xf103('0x16')](0x1f4,_0x4bdc52[_0xf103('0x19')]));});});};exports[_0xf103('0x26')]=function(_0x54d590){return new Promise(function(_0x43b9b5,_0x1d3cdd){return db[_0xf103('0x1d')]['find']({'where':_0x54d590['options']?_0x54d590[_0xf103('0x20')][_0xf103('0x27')]||null:null})['then'](function(_0x23681a){if(_0x23681a){return _0x23681a[_0xf103('0x28')](_0x54d590[_0xf103('0x1f')][_0xf103('0x29')],_['omit'](_0x54d590['body'],['ids','id'])||{});}})['spread'](function(_0x28cf1e){logger['info'](_0xf103('0x2a'),_0x54d590);logger[_0xf103('0x25')](_0xf103('0x2a'),_0x54d590,JSON['stringify'](_0x28cf1e));_0x43b9b5(_0x28cf1e);})['catch'](function(_0x1f8709){logger[_0xf103('0x16')]('AddTags',_0x1f8709[_0xf103('0x19')],_0x54d590);_0x1d3cdd(_this[_0xf103('0x16')](0x1f4,_0x1f8709[_0xf103('0x19')]));});});}; \ No newline at end of file +var _0xa777=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','then','stringify','addTags','ids','omit','util'];(function(_0x299507,_0x353b53){var _0x1869ca=function(_0xe4a556){while(--_0xe4a556){_0x299507['push'](_0x299507['shift']());}};_0x1869ca(++_0x353b53);}(_0xa777,0x102));var _0x7a77=function(_0x3e14a8,_0xb21f66){_0x3e14a8=_0x3e14a8-0x0;var _0x222614=_0xa777[_0x3e14a8];return _0x222614;};'use strict';var _=require('lodash');var util=require(_0x7a77('0x0'));var moment=require(_0x7a77('0x1'));var BPromise=require(_0x7a77('0x2'));var rs=require(_0x7a77('0x3'));var fs=require('fs');var Redis=require(_0x7a77('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a77('0x5'));var logger=require(_0x7a77('0x6'))(_0x7a77('0x7'));var config=require(_0x7a77('0x8'));var jayson=require(_0x7a77('0x9'));var client=jayson['client'][_0x7a77('0xa')]({'port':0x232a});config[_0x7a77('0xb')]=_['defaults'](config['redis'],{'host':_0x7a77('0xc'),'port':0x18eb});var socket=require(_0x7a77('0xd'))(new Redis(config['redis']));require(_0x7a77('0xe'))[_0x7a77('0xf')](socket);function respondWithRpcPromise(_0x1065e8,_0x1acc0a,_0x453772){return new BPromise(function(_0x21b370,_0x25c1fd){return client[_0x7a77('0x10')](_0x1065e8,_0x453772)['then'](function(_0x164dad){logger[_0x7a77('0x11')](_0x7a77('0x12'),_0x1acc0a,_0x7a77('0x13'));logger[_0x7a77('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1acc0a,_0x7a77('0x13'),JSON['stringify'](_0x164dad));if(_0x164dad[_0x7a77('0x15')]){if(_0x164dad[_0x7a77('0x15')]['code']===0x1f4){logger[_0x7a77('0x15')](_0x7a77('0x12'),_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x25c1fd(_0x164dad[_0x7a77('0x15')][_0x7a77('0x16')]);}logger[_0x7a77('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x21b370(_0x164dad['error']['message']);}else{logger['info'](_0x7a77('0x12'),_0x1acc0a,'request\x20sent');_0x21b370(_0x164dad[_0x7a77('0x17')]['message']);}})[_0x7a77('0x18')](function(_0x22d04b){logger[_0x7a77('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1acc0a,_0x22d04b);_0x25c1fd(_0x22d04b);});});}exports[_0x7a77('0x19')]=function(_0xe5f0db){var _0x9e81f4=this;return new Promise(function(_0x104688,_0x15b568){return db[_0x7a77('0x1a')][_0x7a77('0x1b')](_0xe5f0db[_0x7a77('0x1c')],{'raw':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db[_0x7a77('0x1d')][_0x7a77('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db[_0x7a77('0x1d')][_0x7a77('0x1f')]||null:null,'attributes':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db['options']['attributes']||null:null,'limit':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db['options']['limit']||null:null})[_0x7a77('0x20')](function(_0x1c927e){logger[_0x7a77('0x11')]('UpdateMailInteraction',_0xe5f0db);logger['debug'](_0x7a77('0x19'),_0xe5f0db,JSON[_0x7a77('0x21')](_0x1c927e));_0x104688(_0x1c927e);})[_0x7a77('0x18')](function(_0x24a532){logger[_0x7a77('0x15')](_0x7a77('0x19'),_0x24a532[_0x7a77('0x16')],_0xe5f0db);_0x15b568(_0x9e81f4[_0x7a77('0x15')](0x1f4,_0x24a532['message']));});});};exports['AddTagsToMailInteraction']=function(_0x47a65d){return new Promise(function(_0x33e4b6,_0x36a7c8){return db[_0x7a77('0x1a')]['find']({'where':_0x47a65d[_0x7a77('0x1d')]?_0x47a65d['options'][_0x7a77('0x1f')]||null:null})[_0x7a77('0x20')](function(_0x3fe3f8){if(_0x3fe3f8){return _0x3fe3f8[_0x7a77('0x22')](_0x47a65d[_0x7a77('0x1c')][_0x7a77('0x23')],_[_0x7a77('0x24')](_0x47a65d[_0x7a77('0x1c')],[_0x7a77('0x23'),'id'])||{});}})['spread'](function(_0x2d2db6){logger[_0x7a77('0x11')]('AddTags',_0x47a65d);logger[_0x7a77('0x14')]('AddTags',_0x47a65d,JSON[_0x7a77('0x21')](_0x2d2db6));_0x33e4b6(_0x2d2db6);})[_0x7a77('0x18')](function(_0x3b5e7e){logger['error']('AddTags',_0x3b5e7e['message'],_0x47a65d);_0x36a7c8(_this['error'](0x1f4,_0x3b5e7e[_0x7a77('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bef46fb..9b483d8 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 _0x3222=['update','emit','removeListener','length','mailInteraction:','save','remove'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x3222,0x19b));var _0x2322=function(_0x4a1ee9,_0xb24d16){_0x4a1ee9=_0x4a1ee9-0x0;var _0x515d18=_0x3222[_0x4a1ee9];return _0x515d18;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2322('0x0'),_0x2322('0x1'),_0x2322('0x2')];function createListener(_0x1dcb85,_0x10302b){return function(_0x529ecb){_0x10302b[_0x2322('0x3')](_0x1dcb85,_0x529ecb);};}function removeListener(_0x360a08,_0x2789ed){return function(){MailInteractionEvents[_0x2322('0x4')](_0x360a08,_0x2789ed);};}exports['register']=function(_0x147613){for(var _0x149cfd=0x0,_0xf655d1=events[_0x2322('0x5')];_0x149cfd<_0xf655d1;_0x149cfd++){var _0x3c65ed=events[_0x149cfd];var _0x54e7f4=createListener(_0x2322('0x6')+_0x3c65ed,_0x147613);MailInteractionEvents['on'](_0x3c65ed,_0x54e7f4);}}; \ No newline at end of file +var _0x3376=['remove','update','emit','removeListener','length','mailInteraction:','save'];(function(_0x1975c4,_0x6ba45e){var _0x4852ce=function(_0x43509e){while(--_0x43509e){_0x1975c4['push'](_0x1975c4['shift']());}};_0x4852ce(++_0x6ba45e);}(_0x3376,0x102));var _0x6337=function(_0x344570,_0x1eb4f9){_0x344570=_0x344570-0x0;var _0x1bb006=_0x3376[_0x344570];return _0x1bb006;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x6337('0x0'),_0x6337('0x1'),_0x6337('0x2')];function createListener(_0x36f3b5,_0x342def){return function(_0x54a555){_0x342def[_0x6337('0x3')](_0x36f3b5,_0x54a555);};}function removeListener(_0x2e74ec,_0x24c744){return function(){MailInteractionEvents[_0x6337('0x4')](_0x2e74ec,_0x24c744);};}exports['register']=function(_0x91b782){for(var _0x30357a=0x0,_0x40ecd5=events[_0x6337('0x5')];_0x30357a<_0x40ecd5;_0x30357a++){var _0x53b57d=events[_0x30357a];var _0x8a1e42=createListener(_0x6337('0x6')+_0x53b57d,_0x91b782);MailInteractionEvents['on'](_0x53b57d,_0x8a1e42);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2de3857..71bfd96 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 _0x0b0d=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x28ac22,_0x115385){var _0x142ad2=function(_0x2512e1){while(--_0x2512e1){_0x28ac22['push'](_0x28ac22['shift']());}};_0x142ad2(++_0x115385);}(_0x0b0d,0x117));var _0xd0b0=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0b0d[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xd0b0('0x0'));var util=require(_0xd0b0('0x1'));var path=require(_0xd0b0('0x2'));var timeout=require(_0xd0b0('0x3'));var express=require(_0xd0b0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0b0('0x5'));var interaction=require(_0xd0b0('0x6'));var config=require(_0xd0b0('0x7'));var controller=require(_0xd0b0('0x8'));router[_0xd0b0('0x9')]('/',auth[_0xd0b0('0xa')](),controller[_0xd0b0('0xb')]);router['get'](_0xd0b0('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd0b0('0x9')](_0xd0b0('0xd'),auth['isAuthenticated'](),controller[_0xd0b0('0xe')]);router[_0xd0b0('0x9')](_0xd0b0('0xf'),auth[_0xd0b0('0xa')](),controller[_0xd0b0('0x10')]);router[_0xd0b0('0x11')]('/',auth[_0xd0b0('0xa')](),interaction[_0xd0b0('0x12')](_0xd0b0('0x13'),_0xd0b0('0x14')),controller[_0xd0b0('0x15')]);router[_0xd0b0('0x16')](_0xd0b0('0xd'),auth[_0xd0b0('0xa')](),controller[_0xd0b0('0x17')]);router[_0xd0b0('0x16')](_0xd0b0('0x18'),auth[_0xd0b0('0xa')](),controller[_0xd0b0('0x19')]);router['put'](_0xd0b0('0x1a'),auth[_0xd0b0('0xa')](),controller[_0xd0b0('0x1b')]);router[_0xd0b0('0x1c')](_0xd0b0('0xd'),auth[_0xd0b0('0xa')](),controller[_0xd0b0('0x1d')]);module[_0xd0b0('0x1e')]=router; \ No newline at end of file +var _0x7fce=['describe','download','post','mail','mailmessage:create','/:id','update','accept','put','/:id/reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe'];(function(_0x35fb7c,_0x4ee512){var _0x3b319e=function(_0x381eaa){while(--_0x381eaa){_0x35fb7c['push'](_0x35fb7c['shift']());}};_0x3b319e(++_0x4ee512);}(_0x7fce,0xdc));var _0xe7fc=function(_0x5ab586,_0x4c3f87){_0x5ab586=_0x5ab586-0x0;var _0x589356=_0x7fce[_0x5ab586];return _0x589356;};'use strict';var multer=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var path=require(_0xe7fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7fc('0x3'));var router=express['Router']();var fs_extra=require(_0xe7fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7fc('0x5'));var config=require(_0xe7fc('0x6'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0xe7fc('0x7')](),controller['index']);router[_0xe7fc('0x8')](_0xe7fc('0x9'),auth[_0xe7fc('0x7')](),controller[_0xe7fc('0xa')]);router[_0xe7fc('0x8')]('/:id',auth[_0xe7fc('0x7')](),controller['show']);router[_0xe7fc('0x8')]('/:id/download',auth[_0xe7fc('0x7')](),controller[_0xe7fc('0xb')]);router[_0xe7fc('0xc')]('/',auth[_0xe7fc('0x7')](),interaction['tracked'](_0xe7fc('0xd'),_0xe7fc('0xe')),controller['create']);router['put'](_0xe7fc('0xf'),auth['isAuthenticated'](),controller[_0xe7fc('0x10')]);router['put']('/:id/accept',auth[_0xe7fc('0x7')](),controller[_0xe7fc('0x11')]);router[_0xe7fc('0x12')](_0xe7fc('0x13'),auth[_0xe7fc('0x7')](),controller['reject']);router[_0xe7fc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe7fc('0x15')]);module[_0xe7fc('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index db7e92d..570ce70 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 _0x9b35=['Email','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x37644a,_0x1a223a){var _0x48c516=function(_0x1fa32c){while(--_0x1fa32c){_0x37644a['push'](_0x37644a['shift']());}};_0x48c516(++_0x1a223a);}(_0x9b35,0x17b));var _0x59b3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9b35[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');var _=require(_0x59b3('0x0'));module[_0x59b3('0x1')]={'body':{'type':Sequelize[_0x59b3('0x2')](_0x59b3('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x59b3('0x2')](_0x59b3('0x4'))},'read':{'type':Sequelize[_0x59b3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x59b3('0x6')]('in',_0x59b3('0x7')),'defaultValue':_0x59b3('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x59b3('0x8')]},'to':{'type':Sequelize[_0x59b3('0x2')](_0x59b3('0x3'))},'cc':{'type':Sequelize[_0x59b3('0x2')](_0x59b3('0x3'))},'bcc':{'type':Sequelize[_0x59b3('0x2')](_0x59b3('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x59b3('0x9')]},'attach':{'type':Sequelize[_0x59b3('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x59b3('0x9')]},'originTo':{'type':Sequelize[_0x59b3('0x2')]('long')},'originCc':{'type':Sequelize[_0x59b3('0x2')]('long')},'originChannel':{'type':Sequelize[_0x59b3('0x6')](_0x59b3('0xb'),_0x59b3('0xc')),'defaultValue':_0x59b3('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xb068=['INTEGER','Email','exports','TEXT','long','BOOLEAN','ENUM','out','DATE'];(function(_0x3941df,_0x1492cb){var _0xe2da73=function(_0x1dcdf6){while(--_0x1dcdf6){_0x3941df['push'](_0x3941df['shift']());}};_0xe2da73(++_0x1492cb);}(_0xb068,0x18e));var _0x8b06=function(_0x50efb2,_0x3419dc){_0x50efb2=_0x50efb2-0x0;var _0x36feae=_0xb068[_0x50efb2];return _0x36feae;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x8b06('0x0')]={'body':{'type':Sequelize[_0x8b06('0x1')](_0x8b06('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8b06('0x1')]('medium')},'read':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b06('0x4')]('in','out'),'defaultValue':_0x8b06('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x8b06('0x2'))},'cc':{'type':Sequelize[_0x8b06('0x1')](_0x8b06('0x2'))},'bcc':{'type':Sequelize[_0x8b06('0x1')](_0x8b06('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x8b06('0x6')]},'attach':{'type':Sequelize[_0x8b06('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8b06('0x6')]},'originTo':{'type':Sequelize['TEXT'](_0x8b06('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x8b06('0x2'))},'originChannel':{'type':Sequelize[_0x8b06('0x4')](_0x8b06('0x8'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 593b2b4..0be613e 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 _0xdb28=['params','keys','include','options','body','find','describe','create','direction','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','fromString','rejectmessage','download','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','end','stack','send','map','MailMessage','rawAttributes','fieldName','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','rows','show'];(function(_0x2a895b,_0x1a8d2e){var _0x43db8a=function(_0x1212ba){while(--_0x1212ba){_0x2a895b['push'](_0x2a895b['shift']());}};_0x43db8a(++_0x1a8d2e);}(_0xdb28,0x106));var _0x8db2=function(_0xc73d49,_0x2364e5){_0xc73d49=_0xc73d49-0x0;var _0x1f7f3b=_0xdb28[_0xc73d49];return _0x1f7f3b;};'use strict';var emlformat=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var BPromise=require(_0x8db2('0x2'));var util=require(_0x8db2('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x8db2('0x4'));var Redis=require(_0x8db2('0x5'));var htmlToText=require(_0x8db2('0x6'));var qs=require(_0x8db2('0x7'));var logger=require(_0x8db2('0x8'))('api');var interaction_log=require(_0x8db2('0x8'))(_0x8db2('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x8db2('0xa')]=_[_0x8db2('0xb')](config[_0x8db2('0xa')],{'host':_0x8db2('0xc'),'port':0x18eb});var socket=require(_0x8db2('0xd'))(new Redis(config[_0x8db2('0xa')]));var htmlEntities=require(_0x8db2('0xe'));require('./mailMessage.socket')[_0x8db2('0xf')](socket);var jayson=require(_0x8db2('0x10'));var client=jayson[_0x8db2('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x8db2('0x11')][_0x8db2('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x8db2('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3b2faa,_0x1349f6,_0x204f49,_0x37d017){return new BPromise(function(_0x559fb1,_0x49fadc){var _0x15070d=_0x37d017||client;return _0x15070d[_0x8db2('0x13')](_0x3b2faa,_0x204f49)[_0x8db2('0x14')](function(_0x1d6a15){logger[_0x8db2('0x15')](_0x8db2('0x16'),_0x1349f6,_0x8db2('0x17'));logger[_0x8db2('0x18')](_0x8db2('0x19'),_0x1349f6,_0x8db2('0x17'),JSON['stringify'](_0x1d6a15));if(_0x1d6a15[_0x8db2('0x1a')]){if(_0x1d6a15[_0x8db2('0x1a')]['code']===0x1f4){logger[_0x8db2('0x1a')](_0x8db2('0x16'),_0x1349f6,_0x1d6a15[_0x8db2('0x1a')][_0x8db2('0x1b')]);return _0x49fadc(_0x1d6a15[_0x8db2('0x1a')][_0x8db2('0x1b')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x1349f6,_0x1d6a15[_0x8db2('0x1a')][_0x8db2('0x1b')]);return _0x559fb1(_0x1d6a15[_0x8db2('0x1a')][_0x8db2('0x1b')]);}else{logger['info'](_0x8db2('0x16'),_0x1349f6,_0x8db2('0x17'));_0x559fb1(_0x1d6a15[_0x8db2('0x1c')][_0x8db2('0x1b')]);}})[_0x8db2('0x1d')](function(_0x597260){logger[_0x8db2('0x1a')](_0x8db2('0x16'),_0x1349f6,_0x597260);_0x49fadc(_0x597260);});});}function respondWithResult(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0xc8;return function(_0x2260d8){if(_0x2260d8){return _0x18f69c[_0x8db2('0x1e')](_0x125be2)[_0x8db2('0x1f')](_0x2260d8);}};}function respondWithFilteredResult(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){var _0x5725f0=typeof _0x256202['offset']==='undefined'&&typeof _0x256202[_0x8db2('0x20')]===_0x8db2('0x21');var _0x3be281=_0x4f6516[_0x8db2('0x22')];var _0x145328=_0x5725f0?0x0:_0x256202[_0x8db2('0x23')];var _0x58cd9d=_0x5725f0?_0x4f6516[_0x8db2('0x22')]:_0x256202[_0x8db2('0x23')]+_0x256202[_0x8db2('0x20')];var _0x8b7cec;if(_0x58cd9d>=_0x3be281){_0x58cd9d=_0x3be281;_0x8b7cec=0xc8;}else{_0x8b7cec=0xce;}_0x5c6614['status'](_0x8b7cec);return _0x5c6614[_0x8db2('0x24')](_0x8db2('0x25'),_0x145328+'-'+_0x58cd9d+'/'+_0x3be281)[_0x8db2('0x1f')](_0x4f6516);}return null;};}function saveUpdates(_0x1687ed){return function(_0xbe5ece){if(_0xbe5ece){return _0xbe5ece[_0x8db2('0x26')](_0x1687ed)[_0x8db2('0x14')](function(_0x3124d5){return _0x3124d5;});}return null;};}function removeEntity(_0xbc5366){return function(_0x493cab){if(_0x493cab){return _0x493cab[_0x8db2('0x27')]()['then'](function(){_0xbc5366['status'](0xcc)[_0x8db2('0x28')]();});}};}function handleEntityNotFound(_0x25ed2c){return function(_0xcc8a66){if(!_0xcc8a66){_0x25ed2c['sendStatus'](0x194);}return _0xcc8a66;};}function handleError(_0x42b272,_0x56b71a){_0x56b71a=_0x56b71a||0x1f4;return function(_0x3f7aac){logger[_0x8db2('0x1a')](_0x3f7aac[_0x8db2('0x29')]);if(_0x3f7aac['name']){delete _0x3f7aac['name'];}_0x42b272[_0x8db2('0x1e')](_0x56b71a)[_0x8db2('0x2a')](_0x3f7aac);};}exports['index']=function(_0x516dcb,_0x173989){var _0x5178f3={},_0xc884a={},_0x2a2d65={'count':0x0,'rows':[]};var _0x17ad44=_[_0x8db2('0x2b')](db[_0x8db2('0x2c')][_0x8db2('0x2d')],function(_0x46e0c8){return{'name':_0x46e0c8[_0x8db2('0x2e')],'type':_0x46e0c8['type'][_0x8db2('0x2f')]};});_0xc884a[_0x8db2('0x30')]=_['map'](_0x17ad44,_0x8db2('0x31'));_0xc884a[_0x8db2('0x32')]=_['keys'](_0x516dcb['query']);_0xc884a[_0x8db2('0x33')]=_['intersection'](_0xc884a[_0x8db2('0x30')],_0xc884a[_0x8db2('0x32')]);_0x5178f3[_0x8db2('0x34')]=_[_0x8db2('0x35')](_0xc884a['model'],qs[_0x8db2('0x36')](_0x516dcb['query'][_0x8db2('0x36')]));_0x5178f3[_0x8db2('0x34')]=_0x5178f3[_0x8db2('0x34')][_0x8db2('0x37')]?_0x5178f3['attributes']:_0xc884a['model'];if(!_0x516dcb[_0x8db2('0x32')][_0x8db2('0x38')]('nolimit')){_0x5178f3[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x516dcb[_0x8db2('0x32')]['limit']);_0x5178f3[_0x8db2('0x23')]=qs[_0x8db2('0x23')](_0x516dcb[_0x8db2('0x32')][_0x8db2('0x23')]);}_0x5178f3[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x516dcb[_0x8db2('0x32')][_0x8db2('0x3a')]);_0x5178f3[_0x8db2('0x3b')]=qs[_0x8db2('0x33')](_[_0x8db2('0x3c')](_0x516dcb[_0x8db2('0x32')],_0xc884a[_0x8db2('0x33')]),_0x17ad44);if(_0x516dcb['query'][_0x8db2('0x3d')]){_0x5178f3[_0x8db2('0x3b')]=_['merge'](_0x5178f3['where'],{'$or':_[_0x8db2('0x2b')](_0x17ad44,function(_0x4f1a49){if(_0x4f1a49[_0x8db2('0x3e')]!==_0x8db2('0x3f')){var _0x313130={};_0x313130[_0x4f1a49[_0x8db2('0x31')]]={'$like':'%'+_0x516dcb[_0x8db2('0x32')][_0x8db2('0x3d')]+'%'};return _0x313130;}})});}_0x5178f3=_[_0x8db2('0x40')]({},_0x5178f3,_0x516dcb['options']);var _0x2f86b1={'where':_0x5178f3[_0x8db2('0x3b')]};return db[_0x8db2('0x2c')][_0x8db2('0x22')](_0x2f86b1)['then'](function(_0x424c27){_0x2a2d65[_0x8db2('0x22')]=_0x424c27;if(_0x516dcb[_0x8db2('0x32')][_0x8db2('0x41')]){_0x5178f3['include']=[{'all':!![]}];}return db[_0x8db2('0x2c')]['findAll'](_0x5178f3);})[_0x8db2('0x14')](function(_0x116b69){_0x2a2d65[_0x8db2('0x42')]=_0x116b69;return _0x2a2d65;})['then'](respondWithFilteredResult(_0x173989,_0x5178f3))['catch'](handleError(_0x173989,null));};exports[_0x8db2('0x43')]=function(_0x47c556,_0x173cc7){var _0x467866={'raw':!![],'where':{'id':_0x47c556[_0x8db2('0x44')]['id']}},_0x27b8eb={};_0x27b8eb[_0x8db2('0x30')]=_[_0x8db2('0x45')](db[_0x8db2('0x2c')][_0x8db2('0x2d')]);_0x27b8eb[_0x8db2('0x32')]=_[_0x8db2('0x45')](_0x47c556[_0x8db2('0x32')]);_0x27b8eb[_0x8db2('0x33')]=_['intersection'](_0x27b8eb[_0x8db2('0x30')],_0x27b8eb[_0x8db2('0x32')]);_0x467866[_0x8db2('0x34')]=_[_0x8db2('0x35')](_0x27b8eb['model'],qs['fields'](_0x47c556[_0x8db2('0x32')][_0x8db2('0x36')]));_0x467866[_0x8db2('0x34')]=_0x467866['attributes']['length']?_0x467866['attributes']:_0x27b8eb[_0x8db2('0x30')];if(_0x47c556[_0x8db2('0x32')][_0x8db2('0x41')]){_0x467866[_0x8db2('0x46')]=[{'all':!![]}];}_0x467866=_[_0x8db2('0x40')]({},_0x467866,_0x47c556[_0x8db2('0x47')]);return db[_0x8db2('0x2c')]['find'](_0x467866)['then'](handleEntityNotFound(_0x173cc7,null))[_0x8db2('0x14')](respondWithResult(_0x173cc7,null))[_0x8db2('0x1d')](handleError(_0x173cc7,null));};exports[_0x8db2('0x26')]=function(_0x2f0bd0,_0x3daed6){if(_0x2f0bd0[_0x8db2('0x48')]['id']){delete _0x2f0bd0[_0x8db2('0x48')]['id'];}return db[_0x8db2('0x2c')][_0x8db2('0x49')]({'where':{'id':_0x2f0bd0[_0x8db2('0x44')]['id']}})[_0x8db2('0x14')](handleEntityNotFound(_0x3daed6,null))[_0x8db2('0x14')](saveUpdates(_0x2f0bd0[_0x8db2('0x48')],null))[_0x8db2('0x14')](respondWithResult(_0x3daed6,null))[_0x8db2('0x1d')](handleError(_0x3daed6,null));};exports['destroy']=function(_0x2ded23,_0xb4b0a){return db['MailMessage'][_0x8db2('0x49')]({'where':{'id':_0x2ded23[_0x8db2('0x44')]['id']}})[_0x8db2('0x14')](handleEntityNotFound(_0xb4b0a,null))['then'](removeEntity(_0xb4b0a,null))[_0x8db2('0x1d')](handleError(_0xb4b0a,null));};exports[_0x8db2('0x4a')]=function(_0x1872fa,_0x1f41f2){return db[_0x8db2('0x2c')]['describe']()[_0x8db2('0x14')](respondWithResult(_0x1f41f2,null))[_0x8db2('0x1d')](handleError(_0x1f41f2,null));};exports[_0x8db2('0x4b')]=function(_0x58bb60,_0x1e7d1a){return db[_0x8db2('0x2c')][_0x8db2('0x4b')](_0x58bb60[_0x8db2('0x48')])[_0x8db2('0x14')](function(_0x16d897){if(_0x16d897){if(_0x16d897[_0x8db2('0x4c')]==='out'&&!_0x16d897[_0x8db2('0x4d')]){var _0x4033c0,_0x4d3c19,_0x1eeafe;if(_0x58bb60[_0x8db2('0x48')]['to']){_0x4d3c19=_0x58bb60['body']['to'][_0x8db2('0x4e')](',')[0x0];}return db[_0x8db2('0x4f')][_0x8db2('0x50')]({'where':{'id':_0x16d897[_0x8db2('0x51')]},'include':[{'model':db[_0x8db2('0x52')],'as':_0x8db2('0x53'),'include':[{'model':db[_0x8db2('0x54')],'as':_0x8db2('0x55'),'where':{'email':_0x4d3c19},'limit':0x1,'order':[[_0x8db2('0x56'),_0x8db2('0x57')]]}]},{'model':db[_0x8db2('0x58')],'as':_0x8db2('0x59'),'raw':!![],'include':[{'model':db[_0x8db2('0x5a')],'as':_0x8db2('0x5a'),'raw':!![]}]}]})[_0x8db2('0x14')](function(_0x105a53){_0x4033c0=_0x105a53;if(!_0x4033c0||!_0x4033c0['Smtp'])return;var _0xe0c3e=_0x4033c0[_0x8db2('0x5b')]();if(_0x58bb60[_0x8db2('0x48')][_0x8db2('0x5c')]&&_0x58bb60[_0x8db2('0x48')]['attachments'][_0x8db2('0x37')]){for(var _0x2c3087=0x0;_0x2c3087<_0x58bb60[_0x8db2('0x48')][_0x8db2('0x5c')][_0x8db2('0x37')];_0x2c3087+=0x1){_0x58bb60[_0x8db2('0x48')][_0x8db2('0x5c')][_0x2c3087]={'filename':_0x58bb60[_0x8db2('0x48')][_0x8db2('0x5c')][_0x2c3087][_0x8db2('0x31')],'path':path[_0x8db2('0x5d')](config[_0x8db2('0x5e')],_0x8db2('0x5f'),_0x58bb60[_0x8db2('0x48')][_0x8db2('0x5c')][_0x2c3087][_0x8db2('0x60')])};}}_0x1eeafe={'account':_0xe0c3e,'message':_0x58bb60[_0x8db2('0x48')]};return;})[_0x8db2('0x14')](function(){if(_0x4033c0['List']){if(_0x4033c0[_0x8db2('0x53')]['Contacts'][_0x8db2('0x37')]){return _0x4033c0['List'][_0x8db2('0x55')][0x0];}else{return db[_0x8db2('0x54')][_0x8db2('0x4b')](_[_0x8db2('0xb')](_0x58bb60[_0x8db2('0x48')],{'firstName':_0x58bb60['body']['to'],'email':_0x58bb60['body']['to'],'phone':_0x58bb60[_0x8db2('0x48')]['to'],'ListId':_0x4033c0[_0x8db2('0x61')]}));}}else{throw new Error(_0x8db2('0x62'));}})[_0x8db2('0x14')](function(){if(_0x1eeafe){return respondWithRpcPromise(_0x8db2('0x63'),_0x8db2('0x64'),_0x1eeafe,client9003)[_0x8db2('0x14')](function(_0x79eabc){return _0x16d897['update']({'read':!![],'messageId':_0x79eabc[_0x8db2('0x65')],'sentAt':moment()[_0x8db2('0x66')](_0x8db2('0x67'))});})[_0x8db2('0x1d')](function(_0x250150){logger[_0x8db2('0x1a')]('%s',JSON[_0x8db2('0x68')](_0x250150));return _0x16d897;});}return _0x16d897;});}return _0x16d897;}})[_0x8db2('0x14')](respondWithResult(_0x1e7d1a,0xc9))['catch'](handleError(_0x1e7d1a,null));};exports['accept']=function(_0x358009,_0x2f8beb){var _0x1d2dfc={'agent':{},'channel':_0x8db2('0x69')};if(_0x358009[_0x8db2('0x48')]['id']){delete _0x358009['body']['id'];}_0x358009['body'][_0x8db2('0x6a')]=!![];_0x358009[_0x8db2('0x48')]['readAt']=moment()[_0x8db2('0x66')](_0x8db2('0x67'));_0x358009[_0x8db2('0x48')]['UserId']=_0x358009[_0x8db2('0x48')][_0x8db2('0x6b')]||_0x358009[_0x8db2('0x6c')]['id'];_0x1d2dfc['agent']['id']=_0x358009[_0x8db2('0x48')][_0x8db2('0x6b')];return db[_0x8db2('0x2c')][_0x8db2('0x49')]({'where':{'id':_0x358009[_0x8db2('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f8beb,null))[_0x8db2('0x14')](saveUpdates(_0x358009[_0x8db2('0x48')],null))[_0x8db2('0x14')](function(_0x4b79e7){if(_0x4b79e7){_0x1d2dfc['message']=_0x4b79e7[_0x8db2('0x6d')]({'plain':!![]});return db[_0x8db2('0x6e')]['find']({'where':{'id':_0x4b79e7[_0x8db2('0x6f')]}});}return null;})[_0x8db2('0x14')](handleEntityNotFound(_0x2f8beb,null))[_0x8db2('0x14')](function(_0x3416de){if(_0x3416de){return _0x3416de[_0x8db2('0x26')]({'UserId':_0x358009[_0x8db2('0x48')][_0x8db2('0x6b')],'read1stAt':_[_0x8db2('0x70')](_0x3416de[_0x8db2('0x71')])?moment()[_0x8db2('0x66')](_0x8db2('0x67')):undefined});}return null;})[_0x8db2('0x14')](function(_0x24a52d){if(_0x24a52d){_0x1d2dfc['interaction']=_0x24a52d[_0x8db2('0x6d')]({'plain':!![]});interaction_log['info'](_0x8db2('0x72'),_0x358009[_0x8db2('0x6c')]['id'],_0x358009['user'][_0x8db2('0x31')],_0x358009[_0x8db2('0x6c')]['role'],_0x1d2dfc[_0x8db2('0x73')]['id'],_0x358009[_0x8db2('0x48')]?JSON[_0x8db2('0x68')](_0x358009[_0x8db2('0x48')]):_0x8db2('0x74'));return respondWithRpcPromise(_0x8db2('0x75'),_0x8db2('0x76'),_0x1d2dfc);}return null;})[_0x8db2('0x14')](function(_0x1afd36){var _0x5dd92b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1afd36[_0x8db2('0x1b')]['ContactId'];return db[_0x8db2('0x77')][_0x8db2('0x32')](_0x5dd92b,{'type':db[_0x8db2('0x78')]['QueryTypes'][_0x8db2('0x79')],'raw':!![]})[_0x8db2('0x14')](function(_0x3e37e7){return _0x3e37e7;});})['then'](function(_0x3ae18c){if(_0x3ae18c){_0x1d2dfc[_0x8db2('0x1b')][_0x8db2('0x7a')]=_0x3ae18c[0x0];if(!_0x358009[_0x8db2('0x48')]['UserId'])return;return db[_0x8db2('0x7b')][_0x8db2('0x49')]({'where':{'id':_0x358009[_0x8db2('0x48')][_0x8db2('0x6b')],'role':_0x8db2('0x7c')},'attributes':['id',_0x8db2('0x31'),_0x8db2('0x7d'),_0x8db2('0x7e'),_0x8db2('0x7f')],'raw':!![]});}return null;})[_0x8db2('0x14')](function(_0x3ad3c7){if(!_0x3ad3c7)return null;_0x1d2dfc['message'][_0x8db2('0x7c')]=_0x3ad3c7;return _0x1d2dfc;})[_0x8db2('0x14')](function(_0x377fb4){if(_0x377fb4){if(_0x358009['body']['manual']){_0x1d2dfc['message'][_0x8db2('0x80')]=util[_0x8db2('0x66')](_0x8db2('0x81'),_0x358009[_0x8db2('0x6c')][_0x8db2('0x31')]);_0x1d2dfc[_0x8db2('0x1b')][_0x8db2('0x82')]=_0x1d2dfc[_0x8db2('0x82')];_0x1d2dfc[_0x8db2('0x1b')][_0x8db2('0x83')]=_0x1d2dfc[_0x8db2('0x82')];_0x1d2dfc['message'][_0x8db2('0x84')]=_0x8db2('0x85');_0x1d2dfc[_0x8db2('0x1b')][_0x8db2('0x48')]=htmlToText['fromString'](_0x1d2dfc['message'][_0x8db2('0x48')]);return respondWithRpcPromise(_0x8db2('0x86'),'EventManager',{'event':_0x8db2('0x87'),'message':_0x1d2dfc[_0x8db2('0x1b')]},client9002)[_0x8db2('0x14')](function(){return _0x1d2dfc;});}return _0x1d2dfc;}return null;})['then'](respondWithResult(_0x2f8beb,null))['catch'](handleError(_0x2f8beb,null));};exports['reject']=function(_0x468f90,_0x18b4a6){var _0x281e48={'agent':{},'channel':_0x8db2('0x69')};if(_0x468f90[_0x8db2('0x48')]['id']){delete _0x468f90['body']['id'];}_0x468f90[_0x8db2('0x48')]['UserId']=_0x468f90[_0x8db2('0x48')][_0x8db2('0x6b')]||_0x468f90[_0x8db2('0x6c')]['id'];_0x281e48[_0x8db2('0x7c')]['id']=_0x468f90[_0x8db2('0x48')]['UserId'];return db['MailMessage'][_0x8db2('0x49')]({'where':{'id':_0x468f90['params']['id'],'UserId':null}})[_0x8db2('0x14')](handleEntityNotFound(_0x18b4a6,null))[_0x8db2('0x14')](function(_0x3fb621){if(_0x3fb621){_0x281e48[_0x8db2('0x1b')]=_0x3fb621[_0x8db2('0x6d')]({'plain':!![]});return db[_0x8db2('0x6e')]['find']({'where':{'id':_0x3fb621[_0x8db2('0x6f')]}});}return null;})[_0x8db2('0x14')](handleEntityNotFound(_0x18b4a6,null))[_0x8db2('0x14')](function(_0x549725){if(_0x549725){_0x281e48[_0x8db2('0x73')]=_0x549725[_0x8db2('0x6d')]({'plain':!![]});interaction_log['info'](_0x8db2('0x88'),_0x468f90[_0x8db2('0x6c')]['id'],_0x468f90[_0x8db2('0x6c')][_0x8db2('0x31')],_0x468f90[_0x8db2('0x6c')][_0x8db2('0x89')],_0x281e48[_0x8db2('0x73')]['id'],_0x468f90[_0x8db2('0x48')]?JSON[_0x8db2('0x68')](_0x468f90['body']):_0x8db2('0x74'));return respondWithRpcPromise(_0x8db2('0x8a'),_0x8db2('0x8b'),_0x281e48);}return null;})[_0x8db2('0x14')](function(_0x84e15){var _0x345ff9=_0x8db2('0x8c')+_0x84e15[_0x8db2('0x1b')][_0x8db2('0x8d')];return db[_0x8db2('0x77')]['query'](_0x345ff9,{'type':db[_0x8db2('0x78')][_0x8db2('0x8e')][_0x8db2('0x79')],'raw':!![]})[_0x8db2('0x14')](function(_0x5d371b){return _0x5d371b;});})[_0x8db2('0x14')](function(_0x6d97b9){if(_0x6d97b9){_0x281e48[_0x8db2('0x1b')]['contact']=_0x6d97b9[0x0];if(!_0x468f90['body'][_0x8db2('0x6b')])return;return db[_0x8db2('0x7b')][_0x8db2('0x49')]({'where':{'id':_0x468f90[_0x8db2('0x48')]['UserId'],'role':_0x8db2('0x7c')},'attributes':['id',_0x8db2('0x31'),_0x8db2('0x7d'),_0x8db2('0x7e'),'internal'],'raw':!![]});}return null;})[_0x8db2('0x14')](function(_0x1d6eef){if(!_0x1d6eef)return null;_0x281e48[_0x8db2('0x1b')]['agent']=_0x1d6eef;return _0x281e48;})['then'](function(_0x54a645){if(_0x54a645){_0x54a645[_0x8db2('0x1b')][_0x8db2('0x80')]=util[_0x8db2('0x66')](_0x8db2('0x81'),_0x468f90['user']['name']);_0x54a645[_0x8db2('0x1b')][_0x8db2('0x82')]=_0x281e48[_0x8db2('0x82')];_0x54a645[_0x8db2('0x1b')][_0x8db2('0x83')]=_0x281e48[_0x8db2('0x82')];_0x54a645['message'][_0x8db2('0x84')]='reject';_0x54a645[_0x8db2('0x1b')][_0x8db2('0x48')]=htmlToText[_0x8db2('0x8f')](_0x281e48[_0x8db2('0x1b')][_0x8db2('0x48')]);respondWithRpcPromise('EventManager',_0x8db2('0x86'),{'event':_0x8db2('0x90'),'message':_0x54a645['message']},client9002);return _0x281e48;}return null;})[_0x8db2('0x14')](respondWithResult(_0x18b4a6,null))[_0x8db2('0x1d')](handleError(_0x18b4a6,null));};exports[_0x8db2('0x91')]=function(_0x1c184c,_0x537af3){var _0x5ef09c=moment()['unix']()['toString']();var _0xaa90b9=path[_0x8db2('0x5d')](config[_0x8db2('0x5e')],_0x8db2('0x92'),_0x8db2('0x93'),_0x8db2('0x94'));var _0xbf3a2f=path['join'](config[_0x8db2('0x5e')],'server','files',_0x8db2('0x5c'));var _0x4ced3e=util['format'](_0x8db2('0x95'),_0x5ef09c);return db[_0x8db2('0x2c')][_0x8db2('0x49')]({'where':{'id':_0x1c184c['params']['id']},'attributes':['id',_0x8db2('0x48'),_0x8db2('0x96'),'to','cc',_0x8db2('0x97'),'subject',_0x8db2('0x98')],'include':_0x1c184c[_0x8db2('0x32')][_0x8db2('0x5c')]?[{'model':db[_0x8db2('0x99')],'as':_0x8db2('0x9a')}]:undefined})[_0x8db2('0x14')](handleEntityNotFound(_0x537af3,null))[_0x8db2('0x14')](function(_0x24cbd2){if(_0x24cbd2){var _0x4f09d8=_0x24cbd2;var _0xa7b208={'from':_0x4f09d8[_0x8db2('0x96')],'to':_0x4f09d8['to'],'subject':_0x4f09d8[_0x8db2('0x9b')],'html':htmlEntities[_0x8db2('0x9c')](_0x4f09d8[_0x8db2('0x48')]),'headers':{'Date':moment(_0x4f09d8[_0x8db2('0x98')])[_0x8db2('0x66')](_0x8db2('0x9d'))},'attachments':[]};if(_0x24cbd2['cc']){_0xa7b208[_0x8db2('0x9e')]['Cc']=_0x24cbd2['cc'];}if(_0x24cbd2[_0x8db2('0x97')]){_0xa7b208[_0x8db2('0x9e')]['Bcc']=_0x24cbd2[_0x8db2('0x97')];}return new BPromise(function(_0x33df7d,_0x3c65f1){if(_0x24cbd2['Attachments']){for(var _0x4459e8=0x0;_0x4459e8<_0x24cbd2[_0x8db2('0x9a')][_0x8db2('0x37')];_0x4459e8++){var _0x518825=_0x24cbd2['Attachments'][_0x4459e8];var _0x47043b=path[_0x8db2('0x5d')](_0xbf3a2f,_0x518825[_0x8db2('0x60')]);if(fs[_0x8db2('0x9f')](_0x47043b)){_0xa7b208[_0x8db2('0x5c')][_0x8db2('0xa0')]({'name':_0x518825[_0x8db2('0x31')],'contentType':_0x518825[_0x8db2('0x3e')],'data':fs[_0x8db2('0xa1')](_0x47043b)});}}}emlformat[_0x8db2('0xa2')](_0xa7b208,function(_0x581ef1,_0x1ef1c0){if(_0x581ef1)return _0x3c65f1(_0x581ef1);fs[_0x8db2('0xa3')](path['join'](_0xaa90b9,_0x4ced3e),_0x1ef1c0);return _0x33df7d(_0x1ef1c0);});});}})[_0x8db2('0x14')](function(_0x113c08){if(_0x113c08){return _0x537af3[_0x8db2('0x91')](path[_0x8db2('0x5d')](_0xaa90b9,_0x4ced3e),_0x4ced3e,function(_0x81bb0f){if(!_0x81bb0f)fs[_0x8db2('0xa4')](path[_0x8db2('0x5d')](_0xaa90b9,_0x4ced3e));});}})[_0x8db2('0x1d')](handleError(_0x537af3,null));}; \ No newline at end of file +var _0xeccb=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','body','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','rejectmessage','download','toString','files','tmp','server','from','createdAt','Attachments','subject','headers','Bcc','bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3bcc84,_0x1ec4ea){var _0x59e1b2=function(_0x1581f1){while(--_0x1581f1){_0x3bcc84['push'](_0x3bcc84['shift']());}};_0x59e1b2(++_0x1ec4ea);}(_0xeccb,0x64));var _0xbecc=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xeccb[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0xbecc('0x0'));var moment=require(_0xbecc('0x1'));var BPromise=require(_0xbecc('0x2'));var util=require(_0xbecc('0x3'));var path=require(_0xbecc('0x4'));var fs=require('fs');var _=require(_0xbecc('0x5'));var Redis=require(_0xbecc('0x6'));var htmlToText=require('html-to-text');var qs=require(_0xbecc('0x7'));var logger=require('../../config/logger')(_0xbecc('0x8'));var interaction_log=require('../../config/logger')(_0xbecc('0x9'));var config=require(_0xbecc('0xa'));var db=require(_0xbecc('0xb'))['db'];config[_0xbecc('0xc')]=_[_0xbecc('0xd')](config[_0xbecc('0xc')],{'host':_0xbecc('0xe'),'port':0x18eb});var socket=require(_0xbecc('0xf'))(new Redis(config[_0xbecc('0xc')]));var htmlEntities=require(_0xbecc('0x10'));require('./mailMessage.socket')[_0xbecc('0x11')](socket);var jayson=require(_0xbecc('0x12'));var client=jayson[_0xbecc('0x13')][_0xbecc('0x14')]({'port':0x232c});var client9003=jayson[_0xbecc('0x13')]['http']({'port':0x232b});var client9002=jayson[_0xbecc('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521642,_0x51558b,_0x321176,_0x458e9f){return new BPromise(function(_0x3c7f99,_0x144464){var _0x53bdad=_0x458e9f||client;return _0x53bdad[_0xbecc('0x15')](_0x521642,_0x321176)[_0xbecc('0x16')](function(_0x40240c){logger[_0xbecc('0x17')](_0xbecc('0x18'),_0x51558b,'request\x20sent');logger[_0xbecc('0x19')](_0xbecc('0x1a'),_0x51558b,_0xbecc('0x1b'),JSON[_0xbecc('0x1c')](_0x40240c));if(_0x40240c[_0xbecc('0x1d')]){if(_0x40240c[_0xbecc('0x1d')]['code']===0x1f4){logger[_0xbecc('0x1d')](_0xbecc('0x18'),_0x51558b,_0x40240c[_0xbecc('0x1d')][_0xbecc('0x1e')]);return _0x144464(_0x40240c['error']['message']);}logger['error'](_0xbecc('0x18'),_0x51558b,_0x40240c[_0xbecc('0x1d')][_0xbecc('0x1e')]);return _0x3c7f99(_0x40240c[_0xbecc('0x1d')]['message']);}else{logger[_0xbecc('0x17')](_0xbecc('0x18'),_0x51558b,_0xbecc('0x1b'));_0x3c7f99(_0x40240c[_0xbecc('0x1f')][_0xbecc('0x1e')]);}})[_0xbecc('0x20')](function(_0x2c83fd){logger[_0xbecc('0x1d')](_0xbecc('0x18'),_0x51558b,_0x2c83fd);_0x144464(_0x2c83fd);});});}function respondWithResult(_0x2e926e,_0x3702ed){_0x3702ed=_0x3702ed||0xc8;return function(_0x555c78){if(_0x555c78){return _0x2e926e[_0xbecc('0x21')](_0x3702ed)[_0xbecc('0x22')](_0x555c78);}};}function respondWithFilteredResult(_0x5266a7,_0x4a2ca2){return function(_0x1f57f3){if(_0x1f57f3){var _0x588360=typeof _0x4a2ca2[_0xbecc('0x23')]===_0xbecc('0x24')&&typeof _0x4a2ca2[_0xbecc('0x25')]===_0xbecc('0x24');var _0x1d626b=_0x1f57f3[_0xbecc('0x26')];var _0x8ac205=_0x588360?0x0:_0x4a2ca2['offset'];var _0xec7d37=_0x588360?_0x1f57f3[_0xbecc('0x26')]:_0x4a2ca2[_0xbecc('0x23')]+_0x4a2ca2['limit'];var _0x3c1db1;if(_0xec7d37>=_0x1d626b){_0xec7d37=_0x1d626b;_0x3c1db1=0xc8;}else{_0x3c1db1=0xce;}_0x5266a7[_0xbecc('0x21')](_0x3c1db1);return _0x5266a7[_0xbecc('0x27')](_0xbecc('0x28'),_0x8ac205+'-'+_0xec7d37+'/'+_0x1d626b)['json'](_0x1f57f3);}return null;};}function saveUpdates(_0x3bfc19){return function(_0x15ebf7){if(_0x15ebf7){return _0x15ebf7[_0xbecc('0x29')](_0x3bfc19)[_0xbecc('0x16')](function(_0xbbe21f){return _0xbbe21f;});}return null;};}function removeEntity(_0xa8f226){return function(_0x319f8b){if(_0x319f8b){return _0x319f8b[_0xbecc('0x2a')]()[_0xbecc('0x16')](function(){_0xa8f226['status'](0xcc)[_0xbecc('0x2b')]();});}};}function handleEntityNotFound(_0x4c3b2d){return function(_0x52852f){if(!_0x52852f){_0x4c3b2d[_0xbecc('0x2c')](0x194);}return _0x52852f;};}function handleError(_0x599081,_0x309322){_0x309322=_0x309322||0x1f4;return function(_0x419707){logger[_0xbecc('0x1d')](_0x419707[_0xbecc('0x2d')]);if(_0x419707['name']){delete _0x419707[_0xbecc('0x2e')];}_0x599081[_0xbecc('0x21')](_0x309322)['send'](_0x419707);};}exports[_0xbecc('0x2f')]=function(_0x3a86c3,_0x2cbc13){var _0x4daae0={},_0x2b1553={},_0x1c4c2a={'count':0x0,'rows':[]};var _0x4a3fd4=_[_0xbecc('0x30')](db[_0xbecc('0x31')][_0xbecc('0x32')],function(_0x1b75e4){return{'name':_0x1b75e4[_0xbecc('0x33')],'type':_0x1b75e4[_0xbecc('0x34')][_0xbecc('0x35')]};});_0x2b1553['model']=_['map'](_0x4a3fd4,'name');_0x2b1553[_0xbecc('0x36')]=_[_0xbecc('0x37')](_0x3a86c3[_0xbecc('0x36')]);_0x2b1553[_0xbecc('0x38')]=_[_0xbecc('0x39')](_0x2b1553[_0xbecc('0x3a')],_0x2b1553[_0xbecc('0x36')]);_0x4daae0[_0xbecc('0x3b')]=_[_0xbecc('0x39')](_0x2b1553['model'],qs[_0xbecc('0x3c')](_0x3a86c3[_0xbecc('0x36')]['fields']));_0x4daae0['attributes']=_0x4daae0[_0xbecc('0x3b')][_0xbecc('0x3d')]?_0x4daae0[_0xbecc('0x3b')]:_0x2b1553['model'];if(!_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x3e')](_0xbecc('0x3f'))){_0x4daae0[_0xbecc('0x25')]=qs[_0xbecc('0x25')](_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x25')]);_0x4daae0['offset']=qs['offset'](_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x23')]);}_0x4daae0[_0xbecc('0x40')]=qs['sort'](_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x41')]);_0x4daae0[_0xbecc('0x42')]=qs[_0xbecc('0x38')](_['pick'](_0x3a86c3[_0xbecc('0x36')],_0x2b1553[_0xbecc('0x38')]),_0x4a3fd4);if(_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x43')]){_0x4daae0[_0xbecc('0x42')]=_[_0xbecc('0x44')](_0x4daae0['where'],{'$or':_['map'](_0x4a3fd4,function(_0x602d10){if(_0x602d10[_0xbecc('0x34')]!==_0xbecc('0x45')){var _0x2a49cf={};_0x2a49cf[_0x602d10[_0xbecc('0x2e')]]={'$like':'%'+_0x3a86c3['query'][_0xbecc('0x43')]+'%'};return _0x2a49cf;}})});}_0x4daae0=_['merge']({},_0x4daae0,_0x3a86c3[_0xbecc('0x46')]);var _0x3ddaea={'where':_0x4daae0[_0xbecc('0x42')]};return db[_0xbecc('0x31')][_0xbecc('0x26')](_0x3ddaea)[_0xbecc('0x16')](function(_0x510f0b){_0x1c4c2a[_0xbecc('0x26')]=_0x510f0b;if(_0x3a86c3[_0xbecc('0x36')][_0xbecc('0x47')]){_0x4daae0['include']=[{'all':!![]}];}return db['MailMessage'][_0xbecc('0x48')](_0x4daae0);})[_0xbecc('0x16')](function(_0x22edf7){_0x1c4c2a[_0xbecc('0x49')]=_0x22edf7;return _0x1c4c2a;})[_0xbecc('0x16')](respondWithFilteredResult(_0x2cbc13,_0x4daae0))['catch'](handleError(_0x2cbc13,null));};exports[_0xbecc('0x4a')]=function(_0x746f35,_0x121fea){var _0xb844={'raw':!![],'where':{'id':_0x746f35[_0xbecc('0x4b')]['id']}},_0x4e3ae4={};_0x4e3ae4['model']=_[_0xbecc('0x37')](db[_0xbecc('0x31')][_0xbecc('0x32')]);_0x4e3ae4[_0xbecc('0x36')]=_[_0xbecc('0x37')](_0x746f35[_0xbecc('0x36')]);_0x4e3ae4[_0xbecc('0x38')]=_[_0xbecc('0x39')](_0x4e3ae4['model'],_0x4e3ae4[_0xbecc('0x36')]);_0xb844[_0xbecc('0x3b')]=_[_0xbecc('0x39')](_0x4e3ae4[_0xbecc('0x3a')],qs['fields'](_0x746f35[_0xbecc('0x36')][_0xbecc('0x3c')]));_0xb844[_0xbecc('0x3b')]=_0xb844['attributes'][_0xbecc('0x3d')]?_0xb844['attributes']:_0x4e3ae4[_0xbecc('0x3a')];if(_0x746f35[_0xbecc('0x36')][_0xbecc('0x47')]){_0xb844[_0xbecc('0x4c')]=[{'all':!![]}];}_0xb844=_[_0xbecc('0x44')]({},_0xb844,_0x746f35[_0xbecc('0x46')]);return db['MailMessage'][_0xbecc('0x4d')](_0xb844)[_0xbecc('0x16')](handleEntityNotFound(_0x121fea,null))[_0xbecc('0x16')](respondWithResult(_0x121fea,null))['catch'](handleError(_0x121fea,null));};exports[_0xbecc('0x29')]=function(_0x23f930,_0x3cd1e7){if(_0x23f930['body']['id']){delete _0x23f930[_0xbecc('0x4e')]['id'];}return db[_0xbecc('0x31')][_0xbecc('0x4d')]({'where':{'id':_0x23f930[_0xbecc('0x4b')]['id']}})[_0xbecc('0x16')](handleEntityNotFound(_0x3cd1e7,null))[_0xbecc('0x16')](saveUpdates(_0x23f930[_0xbecc('0x4e')],null))['then'](respondWithResult(_0x3cd1e7,null))['catch'](handleError(_0x3cd1e7,null));};exports[_0xbecc('0x2a')]=function(_0x27e259,_0x4a78cc){return db[_0xbecc('0x31')][_0xbecc('0x4d')]({'where':{'id':_0x27e259[_0xbecc('0x4b')]['id']}})[_0xbecc('0x16')](handleEntityNotFound(_0x4a78cc,null))[_0xbecc('0x16')](removeEntity(_0x4a78cc,null))['catch'](handleError(_0x4a78cc,null));};exports[_0xbecc('0x4f')]=function(_0x2b1356,_0x563dc8){return db[_0xbecc('0x31')]['describe']()[_0xbecc('0x16')](respondWithResult(_0x563dc8,null))['catch'](handleError(_0x563dc8,null));};exports[_0xbecc('0x50')]=function(_0x239d8a,_0x12dd8a){return db[_0xbecc('0x31')][_0xbecc('0x50')](_0x239d8a[_0xbecc('0x4e')])['then'](function(_0x1fb70c){if(_0x1fb70c){if(_0x1fb70c['direction']===_0xbecc('0x51')&&!_0x1fb70c[_0xbecc('0x52')]){var _0x458fc0,_0x5b3481,_0x491c22;if(_0x239d8a[_0xbecc('0x4e')]['to']){_0x5b3481=_0x239d8a[_0xbecc('0x4e')]['to'][_0xbecc('0x53')](',')[0x0];}return db[_0xbecc('0x54')][_0xbecc('0x55')]({'where':{'id':_0x1fb70c[_0xbecc('0x56')]},'include':[{'model':db[_0xbecc('0x57')],'as':_0xbecc('0x58'),'include':[{'model':db[_0xbecc('0x59')],'as':'Contacts','where':{'email':_0x5b3481},'limit':0x1,'order':[[_0xbecc('0x5a'),_0xbecc('0x5b')]]}]},{'model':db[_0xbecc('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xbecc('0x5d'),'raw':!![]}]}]})[_0xbecc('0x16')](function(_0x3d77ad){_0x458fc0=_0x3d77ad;if(!_0x458fc0||!_0x458fc0[_0xbecc('0x5e')])return;var _0x4ca159=_0x458fc0[_0xbecc('0x5f')]();if(_0x239d8a['body'][_0xbecc('0x60')]&&_0x239d8a['body'][_0xbecc('0x60')]['length']){for(var _0x15bc79=0x0;_0x15bc79<_0x239d8a[_0xbecc('0x4e')][_0xbecc('0x60')]['length'];_0x15bc79+=0x1){_0x239d8a[_0xbecc('0x4e')][_0xbecc('0x60')][_0x15bc79]={'filename':_0x239d8a[_0xbecc('0x4e')][_0xbecc('0x60')][_0x15bc79]['name'],'path':path[_0xbecc('0x61')](config[_0xbecc('0x62')],_0xbecc('0x63'),_0x239d8a[_0xbecc('0x4e')][_0xbecc('0x60')][_0x15bc79][_0xbecc('0x64')])};}}_0x491c22={'account':_0x4ca159,'message':_0x239d8a[_0xbecc('0x4e')]};return;})['then'](function(){if(_0x458fc0[_0xbecc('0x58')]){if(_0x458fc0['List']['Contacts'][_0xbecc('0x3d')]){return _0x458fc0[_0xbecc('0x58')]['Contacts'][0x0];}else{return db[_0xbecc('0x59')][_0xbecc('0x50')](_[_0xbecc('0xd')](_0x239d8a['body'],{'firstName':_0x239d8a[_0xbecc('0x4e')]['to'],'email':_0x239d8a[_0xbecc('0x4e')]['to'],'phone':_0x239d8a['body']['to'],'ListId':_0x458fc0[_0xbecc('0x65')]}));}}else{throw new Error(_0xbecc('0x66'));}})[_0xbecc('0x16')](function(){if(_0x491c22){return respondWithRpcPromise('SendMail',_0xbecc('0x67'),_0x491c22,client9003)[_0xbecc('0x16')](function(_0x2a7ee3){return _0x1fb70c[_0xbecc('0x29')]({'read':!![],'messageId':_0x2a7ee3['messageId'],'sentAt':moment()['format'](_0xbecc('0x68'))});})[_0xbecc('0x20')](function(_0x4625ca){logger[_0xbecc('0x1d')]('%s',JSON[_0xbecc('0x1c')](_0x4625ca));return _0x1fb70c;});}return _0x1fb70c;});}return _0x1fb70c;}})['then'](respondWithResult(_0x12dd8a,0xc9))['catch'](handleError(_0x12dd8a,null));};exports[_0xbecc('0x69')]=function(_0x339c32,_0x10f392){var _0x4b27b1={'agent':{},'channel':_0xbecc('0x6a')};if(_0x339c32['body']['id']){delete _0x339c32[_0xbecc('0x4e')]['id'];}_0x339c32[_0xbecc('0x4e')][_0xbecc('0x6b')]=!![];_0x339c32[_0xbecc('0x4e')]['readAt']=moment()[_0xbecc('0x6c')](_0xbecc('0x68'));_0x339c32[_0xbecc('0x4e')][_0xbecc('0x6d')]=_0x339c32[_0xbecc('0x4e')]['UserId']||_0x339c32[_0xbecc('0x6e')]['id'];_0x4b27b1[_0xbecc('0x6f')]['id']=_0x339c32[_0xbecc('0x4e')][_0xbecc('0x6d')];return db['MailMessage'][_0xbecc('0x4d')]({'where':{'id':_0x339c32[_0xbecc('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x10f392,null))[_0xbecc('0x16')](saveUpdates(_0x339c32[_0xbecc('0x4e')],null))[_0xbecc('0x16')](function(_0x45b531){if(_0x45b531){_0x4b27b1[_0xbecc('0x1e')]=_0x45b531[_0xbecc('0x70')]({'plain':!![]});return db[_0xbecc('0x71')]['find']({'where':{'id':_0x45b531[_0xbecc('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x10f392,null))[_0xbecc('0x16')](function(_0x2a3b76){if(_0x2a3b76){return _0x2a3b76[_0xbecc('0x29')]({'UserId':_0x339c32[_0xbecc('0x4e')]['UserId'],'read1stAt':_[_0xbecc('0x73')](_0x2a3b76[_0xbecc('0x74')])?moment()['format'](_0xbecc('0x68')):undefined});}return null;})['then'](function(_0x40f175){if(_0x40f175){_0x4b27b1[_0xbecc('0x75')]=_0x40f175[_0xbecc('0x70')]({'plain':!![]});interaction_log[_0xbecc('0x17')](_0xbecc('0x76'),_0x339c32[_0xbecc('0x6e')]['id'],_0x339c32['user'][_0xbecc('0x2e')],_0x339c32[_0xbecc('0x6e')][_0xbecc('0x77')],_0x4b27b1[_0xbecc('0x75')]['id'],_0x339c32[_0xbecc('0x4e')]?JSON[_0xbecc('0x1c')](_0x339c32['body']):_0xbecc('0x78'));return respondWithRpcPromise(_0xbecc('0x79'),_0xbecc('0x7a'),_0x4b27b1);}return null;})['then'](function(_0x15a364){var _0x251284=_0xbecc('0x7b')+_0x15a364[_0xbecc('0x1e')][_0xbecc('0x7c')];return db[_0xbecc('0x7d')]['query'](_0x251284,{'type':db['Sequelize'][_0xbecc('0x7e')][_0xbecc('0x7f')],'raw':!![]})[_0xbecc('0x16')](function(_0x146efa){return _0x146efa;});})[_0xbecc('0x16')](function(_0x2a7df0){if(_0x2a7df0){_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x80')]=_0x2a7df0[0x0];if(!_0x339c32['body'][_0xbecc('0x6d')])return;return db[_0xbecc('0x81')][_0xbecc('0x4d')]({'where':{'id':_0x339c32[_0xbecc('0x4e')]['UserId'],'role':'agent'},'attributes':['id','name',_0xbecc('0x82'),'email','internal'],'raw':!![]});}return null;})[_0xbecc('0x16')](function(_0x3ec977){if(!_0x3ec977)return null;_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x6f')]=_0x3ec977;return _0x4b27b1;})[_0xbecc('0x16')](function(_0x106a6f){if(_0x106a6f){if(_0x339c32[_0xbecc('0x4e')][_0xbecc('0x83')]){_0x4b27b1['message']['interface']=util['format'](_0xbecc('0x84'),_0x339c32[_0xbecc('0x6e')]['name']);_0x4b27b1[_0xbecc('0x1e')]['channel']=_0x4b27b1[_0xbecc('0x85')];_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x86')]=_0x4b27b1['channel'];_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x87')]='accept';_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x4e')]=htmlToText[_0xbecc('0x88')](_0x4b27b1[_0xbecc('0x1e')][_0xbecc('0x4e')]);return respondWithRpcPromise(_0xbecc('0x89'),'EventManager',{'event':_0xbecc('0x8a'),'message':_0x4b27b1[_0xbecc('0x1e')]},client9002)['then'](function(){return _0x4b27b1;});}return _0x4b27b1;}return null;})[_0xbecc('0x16')](respondWithResult(_0x10f392,null))['catch'](handleError(_0x10f392,null));};exports[_0xbecc('0x8b')]=function(_0x47b4bc,_0xc838d7){var _0x3170b1={'agent':{},'channel':_0xbecc('0x6a')};if(_0x47b4bc[_0xbecc('0x4e')]['id']){delete _0x47b4bc[_0xbecc('0x4e')]['id'];}_0x47b4bc[_0xbecc('0x4e')][_0xbecc('0x6d')]=_0x47b4bc['body']['UserId']||_0x47b4bc[_0xbecc('0x6e')]['id'];_0x3170b1['agent']['id']=_0x47b4bc[_0xbecc('0x4e')]['UserId'];return db[_0xbecc('0x31')]['find']({'where':{'id':_0x47b4bc[_0xbecc('0x4b')]['id'],'UserId':null}})[_0xbecc('0x16')](handleEntityNotFound(_0xc838d7,null))[_0xbecc('0x16')](function(_0x47dd0e){if(_0x47dd0e){_0x3170b1[_0xbecc('0x1e')]=_0x47dd0e['get']({'plain':!![]});return db[_0xbecc('0x71')][_0xbecc('0x4d')]({'where':{'id':_0x47dd0e[_0xbecc('0x72')]}});}return null;})[_0xbecc('0x16')](handleEntityNotFound(_0xc838d7,null))[_0xbecc('0x16')](function(_0x44272e){if(_0x44272e){_0x3170b1[_0xbecc('0x75')]=_0x44272e['get']({'plain':!![]});interaction_log[_0xbecc('0x17')](_0xbecc('0x8c'),_0x47b4bc['user']['id'],_0x47b4bc[_0xbecc('0x6e')][_0xbecc('0x2e')],_0x47b4bc[_0xbecc('0x6e')][_0xbecc('0x77')],_0x3170b1[_0xbecc('0x75')]['id'],_0x47b4bc[_0xbecc('0x4e')]?JSON['stringify'](_0x47b4bc[_0xbecc('0x4e')]):_0xbecc('0x78'));return respondWithRpcPromise(_0xbecc('0x8d'),_0xbecc('0x8e'),_0x3170b1);}return null;})['then'](function(_0x3799ed){var _0x33a8ba='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3799ed[_0xbecc('0x1e')]['ContactId'];return db[_0xbecc('0x7d')][_0xbecc('0x36')](_0x33a8ba,{'type':db['Sequelize'][_0xbecc('0x7e')][_0xbecc('0x7f')],'raw':!![]})[_0xbecc('0x16')](function(_0x41eb55){return _0x41eb55;});})[_0xbecc('0x16')](function(_0x5ec8e3){if(_0x5ec8e3){_0x3170b1['message']['contact']=_0x5ec8e3[0x0];if(!_0x47b4bc[_0xbecc('0x4e')]['UserId'])return;return db[_0xbecc('0x81')][_0xbecc('0x4d')]({'where':{'id':_0x47b4bc['body']['UserId'],'role':_0xbecc('0x6f')},'attributes':['id',_0xbecc('0x2e'),'fullname','email',_0xbecc('0x8f')],'raw':!![]});}return null;})['then'](function(_0x3787b8){if(!_0x3787b8)return null;_0x3170b1['message']['agent']=_0x3787b8;return _0x3170b1;})[_0xbecc('0x16')](function(_0x239f60){if(_0x239f60){_0x239f60[_0xbecc('0x1e')][_0xbecc('0x90')]=util[_0xbecc('0x6c')]('SIP/%s',_0x47b4bc[_0xbecc('0x6e')][_0xbecc('0x2e')]);_0x239f60[_0xbecc('0x1e')]['channel']=_0x3170b1[_0xbecc('0x85')];_0x239f60[_0xbecc('0x1e')][_0xbecc('0x86')]=_0x3170b1[_0xbecc('0x85')];_0x239f60[_0xbecc('0x1e')]['event']='reject';_0x239f60[_0xbecc('0x1e')][_0xbecc('0x4e')]=htmlToText[_0xbecc('0x88')](_0x3170b1[_0xbecc('0x1e')][_0xbecc('0x4e')]);respondWithRpcPromise(_0xbecc('0x89'),_0xbecc('0x89'),{'event':_0xbecc('0x91'),'message':_0x239f60[_0xbecc('0x1e')]},client9002);return _0x3170b1;}return null;})[_0xbecc('0x16')](respondWithResult(_0xc838d7,null))['catch'](handleError(_0xc838d7,null));};exports[_0xbecc('0x92')]=function(_0x447250,_0x52569d){var _0x44ac38=moment()['unix']()[_0xbecc('0x93')]();var _0x422651=path[_0xbecc('0x61')](config[_0xbecc('0x62')],'server',_0xbecc('0x94'),_0xbecc('0x95'));var _0x504d9f=path['join'](config[_0xbecc('0x62')],_0xbecc('0x96'),_0xbecc('0x94'),_0xbecc('0x60'));var _0x593426=util['format']('message-%s.eml',_0x44ac38);return db['MailMessage'][_0xbecc('0x4d')]({'where':{'id':_0x447250[_0xbecc('0x4b')]['id']},'attributes':['id',_0xbecc('0x4e'),_0xbecc('0x97'),'to','cc','bcc','subject',_0xbecc('0x98')],'include':_0x447250[_0xbecc('0x36')][_0xbecc('0x60')]?[{'model':db['Attachment'],'as':_0xbecc('0x99')}]:undefined})[_0xbecc('0x16')](handleEntityNotFound(_0x52569d,null))[_0xbecc('0x16')](function(_0x4b9989){if(_0x4b9989){var _0x469c80=_0x4b9989;var _0x1b955c={'from':_0x469c80[_0xbecc('0x97')],'to':_0x469c80['to'],'subject':_0x469c80[_0xbecc('0x9a')],'html':htmlEntities['decode'](_0x469c80[_0xbecc('0x4e')]),'headers':{'Date':moment(_0x469c80[_0xbecc('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4b9989['cc']){_0x1b955c[_0xbecc('0x9b')]['Cc']=_0x4b9989['cc'];}if(_0x4b9989['bcc']){_0x1b955c['headers'][_0xbecc('0x9c')]=_0x4b9989[_0xbecc('0x9d')];}return new BPromise(function(_0xf21ca8,_0x115030){if(_0x4b9989['Attachments']){for(var _0x18d8b6=0x0;_0x18d8b6<_0x4b9989[_0xbecc('0x99')][_0xbecc('0x3d')];_0x18d8b6++){var _0x181dcd=_0x4b9989['Attachments'][_0x18d8b6];var _0xa4e991=path[_0xbecc('0x61')](_0x504d9f,_0x181dcd[_0xbecc('0x64')]);if(fs[_0xbecc('0x9e')](_0xa4e991)){_0x1b955c[_0xbecc('0x60')][_0xbecc('0x9f')]({'name':_0x181dcd['name'],'contentType':_0x181dcd['type'],'data':fs[_0xbecc('0xa0')](_0xa4e991)});}}}emlformat[_0xbecc('0xa1')](_0x1b955c,function(_0x217f53,_0x22a3f1){if(_0x217f53)return _0x115030(_0x217f53);fs[_0xbecc('0xa2')](path[_0xbecc('0x61')](_0x422651,_0x593426),_0x22a3f1);return _0xf21ca8(_0x22a3f1);});});}})['then'](function(_0x135833){if(_0x135833){return _0x52569d[_0xbecc('0x92')](path[_0xbecc('0x61')](_0x422651,_0x593426),_0x593426,function(_0x3a2bcc){if(!_0x3a2bcc)fs[_0xbecc('0xa3')](path[_0xbecc('0x61')](_0x422651,_0x593426));});}})['catch'](handleError(_0x52569d,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8929fbe..7b60b3e 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 _0x8c53=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x22f197,_0x372175){var _0xae8560=function(_0x1f6cc0){while(--_0x1f6cc0){_0x22f197['push'](_0x22f197['shift']());}};_0xae8560(++_0x372175);}(_0x8c53,0xdd));var _0x38c5=function(_0x111253,_0x17603c){_0x111253=_0x111253-0x0;var _0x2db40e=_0x8c53[_0x111253];return _0x2db40e;};'use strict';var EventEmitter=require(_0x38c5('0x0'));var MailMessage=require(_0x38c5('0x1'))['db'][_0x38c5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x38c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38c5('0x4'),'afterDestroy':_0x38c5('0x5')};function emitEvent(_0x2ebc9f){return function(_0x3c7f7d,_0xc4d9ee,_0xc35dba){MailMessageEvents[_0x38c5('0x6')](_0x2ebc9f+':'+_0x3c7f7d['id'],_0x3c7f7d);MailMessageEvents[_0x38c5('0x6')](_0x2ebc9f,_0x3c7f7d);_0xc35dba(null);};}for(var e in events){if(events[_0x38c5('0x7')](e)){var event=events[e];MailMessage[_0x38c5('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x6908=['events','../../mysqldb','MailMessage','save','emit','hasOwnProperty','hook'];(function(_0xe073a3,_0x72504a){var _0x38577e=function(_0x1e26d1){while(--_0x1e26d1){_0xe073a3['push'](_0xe073a3['shift']());}};_0x38577e(++_0x72504a);}(_0x6908,0x9a));var _0x8690=function(_0x1fbd37,_0xfc796c){_0x1fbd37=_0x1fbd37-0x0;var _0x2012a9=_0x6908[_0x1fbd37];return _0x2012a9;};'use strict';var EventEmitter=require(_0x8690('0x0'));var MailMessage=require(_0x8690('0x1'))['db'][_0x8690('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8690('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fa748){return function(_0x3818be,_0x4ffa77,_0x1fad48){MailMessageEvents[_0x8690('0x4')](_0x3fa748+':'+_0x3818be['id'],_0x3818be);MailMessageEvents[_0x8690('0x4')](_0x3fa748,_0x3818be);_0x1fad48(null);};}for(var e in events){if(events[_0x8690('0x5')](e)){var event=events[e];MailMessage[_0x8690('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 53e6171..3e45d45 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 _0xf30b=['subject','plainBody','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','utf8mb4','lodash','util','api','moment','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId'];(function(_0x165590,_0x40dbf1){var _0x4532ec=function(_0x6dd08d){while(--_0x6dd08d){_0x165590['push'](_0x165590['shift']());}};_0x4532ec(++_0x40dbf1);}(_0xf30b,0xd9));var _0xbf30=function(_0x1e9d62,_0x25bb8e){_0x1e9d62=_0x1e9d62-0x0;var _0x56c490=_0xf30b[_0x1e9d62];return _0x56c490;};'use strict';var _=require(_0xbf30('0x0'));var util=require(_0xbf30('0x1'));var logger=require('../../config/logger')(_0xbf30('0x2'));var moment=require(_0xbf30('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf30('0x4'));var htmlToText=require(_0xbf30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf30('0x6'));var config=require(_0xbf30('0x7'));var attributes=require(_0xbf30('0x8'));module[_0xbf30('0x9')]=function(_0x19eec4,_0x2fb0bf){return _0x19eec4[_0xbf30('0xa')](_0xbf30('0xb'),attributes,{'tableName':_0xbf30('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xbf30('0xd')]},{'name':'fti_mail_messages','fields':['plainBody',_0xbf30('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38dad7,_0x578808,_0x34dd5e){if(_0x38dad7['body']){_0x38dad7[_0xbf30('0xf')]=htmlToText[_0xbf30('0x10')](_0x38dad7[_0xbf30('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x34dd5e(null,_0x578808);},'afterCreate':function(_0x4aaaa2,_0x400270,_0x4d3691){var _0x17e10e=_0x19eec4[_0xbf30('0x12')];var _0xe6b15d=_0x4aaaa2[_0xbf30('0x13')]({'plain':!![]});if(_0xe6b15d[_0xbf30('0x14')][_0xbf30('0x15')]()==='in'||_0xe6b15d['direction'][_0xbf30('0x15')]()===_0xbf30('0x16')&&!_0xe6b15d[_0xbf30('0x17')]&&!_[_0xbf30('0x18')](_0xe6b15d[_0xbf30('0x19')])){_0x17e10e[_0xbf30('0x1a')]['findOne']({'where':{'id':_0xe6b15d[_0xbf30('0x1b')]}})[_0xbf30('0x1c')](function(_0x347ba5){if(_0x347ba5){_0x347ba5[_0xbf30('0x1d')]({'lastMsgAt':_0xe6b15d[_0xbf30('0x1e')],'lastMsgDirection':_0xe6b15d[_0xbf30('0x14')][_0xbf30('0x15')]()});}})[_0xbf30('0x1f')](function(_0x2078c0){console['error'](_0x2078c0);});}_0x4d3691();}},'charset':_0xbf30('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4ea2=['fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','define','MailMessage','mail_messages','messageId'];(function(_0x343e76,_0x5593cb){var _0x47537f=function(_0x1f265f){while(--_0x1f265f){_0x343e76['push'](_0x343e76['shift']());}};_0x47537f(++_0x5593cb);}(_0x4ea2,0xa5));var _0x24ea=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0x4ea2[_0x2b31a8];return _0x1175a5;};'use strict';var _=require(_0x24ea('0x0'));var util=require(_0x24ea('0x1'));var logger=require(_0x24ea('0x2'))(_0x24ea('0x3'));var moment=require(_0x24ea('0x4'));var BPromise=require(_0x24ea('0x5'));var rp=require(_0x24ea('0x6'));var htmlToText=require(_0x24ea('0x7'));var fs=require('fs');var path=require(_0x24ea('0x8'));var rimraf=require(_0x24ea('0x9'));var config=require(_0x24ea('0xa'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x1a343c,_0x44264b){return _0x1a343c[_0x24ea('0xb')](_0x24ea('0xc'),attributes,{'tableName':_0x24ea('0xd'),'paranoid':![],'indexes':[{'name':_0x24ea('0xe'),'fields':[_0x24ea('0xe')]},{'name':_0x24ea('0xf'),'fields':[_0x24ea('0x10'),_0x24ea('0x11')],'type':_0x24ea('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3cce8d,_0x47dd7e,_0x4c275c){if(_0x3cce8d[_0x24ea('0x13')]){_0x3cce8d[_0x24ea('0x10')]=htmlToText['fromString'](_0x3cce8d[_0x24ea('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c275c(null,_0x47dd7e);},'afterCreate':function(_0x1ffd74,_0x1cee1b,_0x3e6497){var _0x5706a9=_0x1a343c[_0x24ea('0x14')];var _0x131e36=_0x1ffd74[_0x24ea('0x15')]({'plain':!![]});if(_0x131e36[_0x24ea('0x16')][_0x24ea('0x17')]()==='in'||_0x131e36[_0x24ea('0x16')][_0x24ea('0x17')]()==='out'&&!_0x131e36[_0x24ea('0x18')]&&!_[_0x24ea('0x19')](_0x131e36[_0x24ea('0x1a')])){_0x5706a9[_0x24ea('0x1b')][_0x24ea('0x1c')]({'where':{'id':_0x131e36[_0x24ea('0x1d')]}})['then'](function(_0x1f6ba7){if(_0x1f6ba7){_0x1f6ba7[_0x24ea('0x1e')]({'lastMsgAt':_0x131e36[_0x24ea('0x1f')],'lastMsgDirection':_0x131e36[_0x24ea('0x16')][_0x24ea('0x17')]()});}})[_0x24ea('0x20')](function(_0x572558){console[_0x24ea('0x21')](_0x572558);});}_0x3e6497();}},'charset':_0x24ea('0x22'),'collate':_0x24ea('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a0d8575..c0c37ed 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 _0xfef3=['raw','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','body','options'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xfef3,0x118));var _0x3fef=function(_0x14c4f2,_0x4df4b1){_0x14c4f2=_0x14c4f2-0x0;var _0x255998=_0xfef3[_0x14c4f2];return _0x255998;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});config[_0x3fef('0x9')]=_[_0x3fef('0xa')](config[_0x3fef('0x9')],{'host':_0x3fef('0xb'),'port':0x18eb});var socket=require(_0x3fef('0xc'))(new Redis(config[_0x3fef('0x9')]));require(_0x3fef('0xd'))[_0x3fef('0xe')](socket);function respondWithRpcPromise(_0x307586,_0x67cdd8,_0x16252b){return new BPromise(function(_0x1a7ef7,_0x7cc5b){return client['request'](_0x307586,_0x16252b)[_0x3fef('0xf')](function(_0x3560d9){logger[_0x3fef('0x10')]('MailMessage,\x20%s,\x20%s',_0x67cdd8,_0x3fef('0x11'));logger['debug'](_0x3fef('0x12'),_0x67cdd8,_0x3fef('0x11'),JSON[_0x3fef('0x13')](_0x3560d9));if(_0x3560d9['error']){if(_0x3560d9[_0x3fef('0x14')]['code']===0x1f4){logger[_0x3fef('0x14')](_0x3fef('0x15'),_0x67cdd8,_0x3560d9['error'][_0x3fef('0x16')]);return _0x7cc5b(_0x3560d9[_0x3fef('0x14')][_0x3fef('0x16')]);}logger[_0x3fef('0x14')](_0x3fef('0x15'),_0x67cdd8,_0x3560d9[_0x3fef('0x14')]['message']);return _0x1a7ef7(_0x3560d9[_0x3fef('0x14')][_0x3fef('0x16')]);}else{logger[_0x3fef('0x10')](_0x3fef('0x15'),_0x67cdd8,_0x3fef('0x11'));_0x1a7ef7(_0x3560d9[_0x3fef('0x17')]['message']);}})[_0x3fef('0x18')](function(_0x3eb287){logger['error'](_0x3fef('0x15'),_0x67cdd8,_0x3eb287);_0x7cc5b(_0x3eb287);});});}exports[_0x3fef('0x19')]=function(_0x42e095){var _0x218f91=this;return new Promise(function(_0x245332,_0x2b5226){return db[_0x3fef('0x1a')][_0x3fef('0x1b')](_0x42e095[_0x3fef('0x1c')],{'raw':_0x42e095[_0x3fef('0x1d')]?_0x42e095[_0x3fef('0x1d')][_0x3fef('0x1e')]===undefined?!![]:![]:!![]})[_0x3fef('0xf')](function(_0x39a8ea){logger[_0x3fef('0x10')]('CreateMailMessage',_0x42e095);logger['debug']('CreateMailMessage',_0x42e095,JSON[_0x3fef('0x13')](_0x39a8ea));_0x245332(_0x39a8ea);})[_0x3fef('0x18')](function(_0xa16dc){logger['error'](_0x3fef('0x19'),_0xa16dc['message'],_0x42e095);_0x2b5226(_0x218f91[_0x3fef('0x14')](0x1f4,_0xa16dc[_0x3fef('0x16')]));});});}; \ No newline at end of file +var _0x4888=['code','message','request\x20sent','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2a655e,_0x419bc6){var _0x8a2d2d=function(_0x1b87a9){while(--_0x1b87a9){_0x2a655e['push'](_0x2a655e['shift']());}};_0x8a2d2d(++_0x419bc6);}(_0x4888,0x198));var _0x8488=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x4888[_0x138293];return _0x34c4a2;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});config[_0x8488('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8488('0xc')]));require(_0x8488('0xd'))['register'](socket);function respondWithRpcPromise(_0x19c994,_0x1334fe,_0x98223){return new BPromise(function(_0x19a2ee,_0x515ea8){return client[_0x8488('0xe')](_0x19c994,_0x98223)[_0x8488('0xf')](function(_0x468896){logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,'request\x20sent');logger[_0x8488('0x12')](_0x8488('0x13'),_0x1334fe,'request\x20sent',JSON['stringify'](_0x468896));if(_0x468896[_0x8488('0x14')]){if(_0x468896['error'][_0x8488('0x15')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x1334fe,_0x468896[_0x8488('0x14')][_0x8488('0x16')]);return _0x515ea8(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x468896[_0x8488('0x14')]['message']);return _0x19a2ee(_0x468896[_0x8488('0x14')][_0x8488('0x16')]);}else{logger[_0x8488('0x10')](_0x8488('0x11'),_0x1334fe,_0x8488('0x17'));_0x19a2ee(_0x468896[_0x8488('0x18')][_0x8488('0x16')]);}})[_0x8488('0x19')](function(_0x514c31){logger[_0x8488('0x14')](_0x8488('0x11'),_0x1334fe,_0x514c31);_0x515ea8(_0x514c31);});});}exports[_0x8488('0x1a')]=function(_0x3dd93e){var _0x554ec6=this;return new Promise(function(_0x4a1b45,_0x340d6b){return db[_0x8488('0x1b')][_0x8488('0x1c')](_0x3dd93e[_0x8488('0x1d')],{'raw':_0x3dd93e[_0x8488('0x1e')]?_0x3dd93e[_0x8488('0x1e')][_0x8488('0x1f')]===undefined?!![]:![]:!![]})[_0x8488('0xf')](function(_0x39dd43){logger['info'](_0x8488('0x1a'),_0x3dd93e);logger[_0x8488('0x12')](_0x8488('0x1a'),_0x3dd93e,JSON[_0x8488('0x20')](_0x39dd43));_0x4a1b45(_0x39dd43);})[_0x8488('0x19')](function(_0x54ecda){logger['error']('CreateMailMessage',_0x54ecda['message'],_0x3dd93e);_0x340d6b(_0x554ec6[_0x8488('0x14')](0x1f4,_0x54ecda['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index af51697..a22aac0 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 _0x35b6=['remove','emit','register','length','./mailMessage.events','save'];(function(_0x52c130,_0x51184a){var _0x2be8d5=function(_0x360b28){while(--_0x360b28){_0x52c130['push'](_0x52c130['shift']());}};_0x2be8d5(++_0x51184a);}(_0x35b6,0x8e));var _0x635b=function(_0x15d98,_0x1bbd3e){_0x15d98=_0x15d98-0x0;var _0x3ea0e5=_0x35b6[_0x15d98];return _0x3ea0e5;};'use strict';var MailMessageEvents=require(_0x635b('0x0'));var events=[_0x635b('0x1'),_0x635b('0x2'),'update'];function createListener(_0xc8d70c,_0x462c98){return function(_0x4516e1){_0x462c98[_0x635b('0x3')](_0xc8d70c,_0x4516e1);};}function removeListener(_0x4d16ce,_0x48237e){return function(){MailMessageEvents['removeListener'](_0x4d16ce,_0x48237e);};}exports[_0x635b('0x4')]=function(_0x5091fd){for(var _0x177688=0x0,_0x524090=events[_0x635b('0x5')];_0x177688<_0x524090;_0x177688++){var _0x4c2119=events[_0x177688];var _0x5ca6e9=createListener('mailMessage:'+_0x4c2119,_0x5091fd);MailMessageEvents['on'](_0x4c2119,_0x5ca6e9);}}; \ No newline at end of file +var _0xe035=['register','length','mailMessage:','./mailMessage.events','save','remove','emit','removeListener'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xe035,0x1eb));var _0x5e03=function(_0x18259c,_0x1fd94a){_0x18259c=_0x18259c-0x0;var _0x3a5911=_0xe035[_0x18259c];return _0x3a5911;};'use strict';var MailMessageEvents=require(_0x5e03('0x0'));var events=[_0x5e03('0x1'),_0x5e03('0x2'),'update'];function createListener(_0x568463,_0x288a20){return function(_0x3142a4){_0x288a20[_0x5e03('0x3')](_0x568463,_0x3142a4);};}function removeListener(_0x24f1d7,_0x41a5d4){return function(){MailMessageEvents[_0x5e03('0x4')](_0x24f1d7,_0x41a5d4);};}exports[_0x5e03('0x5')]=function(_0x1f8c8e){for(var _0x1cfa7d=0x0,_0x10b696=events[_0x5e03('0x6')];_0x1cfa7d<_0x10b696;_0x1cfa7d++){var _0x223503=events[_0x1cfa7d];var _0x4eefff=createListener(_0x5e03('0x7')+_0x223503,_0x1f8c8e);MailMessageEvents['on'](_0x223503,_0x4eefff);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ca92d54..883f1f9 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 _0xa58c=['addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x5dfa08,_0x30cdee){var _0x31250d=function(_0x3585a6){while(--_0x3585a6){_0x5dfa08['push'](_0x5dfa08['shift']());}};_0x31250d(++_0x30cdee);}(_0xa58c,0x173));var _0xca58=function(_0x13a2e1,_0x150c04){_0x13a2e1=_0x13a2e1-0x0;var _0x2634d2=_0xa58c[_0x13a2e1];return _0x2634d2;};'use strict';var multer=require(_0xca58('0x0'));var util=require(_0xca58('0x1'));var path=require(_0xca58('0x2'));var timeout=require('connect-timeout');var express=require(_0xca58('0x3'));var router=express[_0xca58('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xca58('0x5'));var controller=require(_0xca58('0x6'));router[_0xca58('0x7')]('/',auth[_0xca58('0x8')](),controller[_0xca58('0x9')]);router['get'](_0xca58('0xa'),auth[_0xca58('0x8')](),controller['describe']);router[_0xca58('0x7')](_0xca58('0xb'),auth['isAuthenticated'](),controller[_0xca58('0xc')]);router[_0xca58('0x7')](_0xca58('0xd'),auth[_0xca58('0x8')](),controller[_0xca58('0xe')]);router['get'](_0xca58('0xf'),auth[_0xca58('0x8')](),controller[_0xca58('0x10')]);router[_0xca58('0x7')](_0xca58('0x11'),auth[_0xca58('0x8')](),controller[_0xca58('0x12')]);router[_0xca58('0x13')]('/',auth['isAuthenticated'](),controller[_0xca58('0x14')]);router[_0xca58('0x13')](_0xca58('0xf'),auth[_0xca58('0x8')](),controller[_0xca58('0x15')]);router[_0xca58('0x13')](_0xca58('0x11'),auth[_0xca58('0x8')](),controller['addAgents']);router[_0xca58('0x16')](_0xca58('0xb'),auth[_0xca58('0x8')](),controller[_0xca58('0x17')]);router[_0xca58('0x18')]('/:id',auth[_0xca58('0x8')](),controller[_0xca58('0x19')]);router[_0xca58('0x18')]('/:id/teams',auth[_0xca58('0x8')](),controller['removeTeams']);router[_0xca58('0x18')](_0xca58('0x11'),auth['isAuthenticated'](),controller[_0xca58('0x1a')]);module[_0xca58('0x1b')]=router; \ No newline at end of file +var _0x5502=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy'];(function(_0x4bd7e5,_0x3139ee){var _0x2f5300=function(_0x2754d4){while(--_0x2754d4){_0x4bd7e5['push'](_0x4bd7e5['shift']());}};_0x2f5300(++_0x3139ee);}(_0x5502,0xd9));var _0x2550=function(_0x18eb9d,_0x5d9c1e){_0x18eb9d=_0x18eb9d-0x0;var _0xbb16ab=_0x5502[_0x18eb9d];return _0xbb16ab;};'use strict';var multer=require(_0x2550('0x0'));var util=require(_0x2550('0x1'));var path=require(_0x2550('0x2'));var timeout=require(_0x2550('0x3'));var express=require('express');var router=express[_0x2550('0x4')]();var fs_extra=require(_0x2550('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2550('0x6'));var config=require(_0x2550('0x7'));var controller=require(_0x2550('0x8'));router['get']('/',auth[_0x2550('0x9')](),controller[_0x2550('0xa')]);router[_0x2550('0xb')]('/describe',auth[_0x2550('0x9')](),controller['describe']);router['get'](_0x2550('0xc'),auth[_0x2550('0x9')](),controller[_0x2550('0xd')]);router[_0x2550('0xb')](_0x2550('0xe'),auth[_0x2550('0x9')](),controller[_0x2550('0xf')]);router[_0x2550('0xb')](_0x2550('0x10'),auth[_0x2550('0x9')](),controller['getTeams']);router[_0x2550('0xb')](_0x2550('0x11'),auth[_0x2550('0x9')](),controller['getAgents']);router[_0x2550('0x12')]('/',auth[_0x2550('0x9')](),controller[_0x2550('0x13')]);router['post']('/:id/teams',auth[_0x2550('0x9')](),controller[_0x2550('0x14')]);router[_0x2550('0x12')](_0x2550('0x11'),auth[_0x2550('0x9')](),controller[_0x2550('0x15')]);router[_0x2550('0x16')](_0x2550('0xc'),auth[_0x2550('0x9')](),controller[_0x2550('0x17')]);router[_0x2550('0x18')](_0x2550('0xc'),auth[_0x2550('0x9')](),controller[_0x2550('0x19')]);router[_0x2550('0x18')](_0x2550('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x2550('0x9')](),controller['removeAgents']);module[_0x2550('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index c0b128d..5d6f8a0 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 _0xfcfe=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x240860,_0x20c04d){var _0x40e288=function(_0x38a753){while(--_0x38a753){_0x240860['push'](_0x240860['shift']());}};_0x40e288(++_0x20c04d);}(_0xfcfe,0x181));var _0xefcf=function(_0x3323eb,_0x4f21f4){_0x3323eb=_0x3323eb-0x0;var _0x35457c=_0xfcfe[_0x3323eb];return _0x35457c;};'use strict';var Sequelize=require(_0xefcf('0x0'));module[_0xefcf('0x1')]={'name':{'type':Sequelize[_0xefcf('0x2')],'unique':_0xefcf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefcf('0x2')]},'timeout':{'type':Sequelize[_0xefcf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xefcf('0x5'),_0xefcf('0x6'),_0xefcf('0x7'))}}; \ No newline at end of file +var _0xafa6=['STRING','rrmemory','beepall','sequelize','exports'];(function(_0x2a4b21,_0x3568c0){var _0x4789c3=function(_0x54a79b){while(--_0x54a79b){_0x2a4b21['push'](_0x2a4b21['shift']());}};_0x4789c3(++_0x3568c0);}(_0xafa6,0xfd));var _0x6afa=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xafa6[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require(_0x6afa('0x0'));module[_0x6afa('0x1')]={'name':{'type':Sequelize[_0x6afa('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6afa('0x3'),_0x6afa('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 1d5b38a..d388da5 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 _0x0ec7=['mailPause','createdAt','rows','format','%s/%s','updatedAt','getTeams','Team','addTeams','ids','Agents','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_mail_queues','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','MailQueue','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','User','findAndCountAll','UserId','agent'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0ec7,0x1dc));var _0x70ec=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x0ec7[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x70ec('0x0'));var rimraf=require(_0x70ec('0x1'));var zipdir=require(_0x70ec('0x2'));var jsonpatch=require(_0x70ec('0x3'));var rp=require(_0x70ec('0x4'));var moment=require(_0x70ec('0x5'));var BPromise=require(_0x70ec('0x6'));var Mustache=require('mustache');var util=require(_0x70ec('0x7'));var path=require(_0x70ec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x70ec('0x9'));var fs=require('fs');var fs_extra=require(_0x70ec('0xa'));var _=require('lodash');var squel=require(_0x70ec('0xb'));var crypto=require(_0x70ec('0xc'));var jsforce=require(_0x70ec('0xd'));var deskjs=require(_0x70ec('0xe'));var toCsv=require(_0x70ec('0xf'));var querystring=require(_0x70ec('0x10'));var Papa=require(_0x70ec('0x11'));var Redis=require('ioredis');var authService=require(_0x70ec('0x12'));var qs=require(_0x70ec('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x70ec('0x14'));var logger=require(_0x70ec('0x15'))(_0x70ec('0x16'));var utils=require(_0x70ec('0x17'));var config=require(_0x70ec('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x70ec('0x19'))['db'];config[_0x70ec('0x1a')]=_[_0x70ec('0x1b')](config[_0x70ec('0x1a')],{'host':_0x70ec('0x1c'),'port':0x18eb});var socket=require(_0x70ec('0x1d'))(new Redis(config[_0x70ec('0x1a')]));require(_0x70ec('0x1e'))[_0x70ec('0x1f')](socket);function respondWithStatusCode(_0x3f5852,_0x18ea34){_0x18ea34=_0x18ea34||0xcc;return function(_0x2a7ef0){if(_0x2a7ef0){return _0x3f5852[_0x70ec('0x20')](_0x18ea34);}return _0x3f5852[_0x70ec('0x21')](_0x18ea34)[_0x70ec('0x22')]();};}function respondWithResult(_0x2ff786,_0x486993){_0x486993=_0x486993||0xc8;return function(_0x4a34c9){if(_0x4a34c9){return _0x2ff786[_0x70ec('0x21')](_0x486993)['json'](_0x4a34c9);}};}function respondWithFilteredResult(_0x83ae6e,_0xfb759f){return function(_0x33926c){if(_0x33926c){var _0x36753c=typeof _0xfb759f[_0x70ec('0x23')]===_0x70ec('0x24')&&typeof _0xfb759f[_0x70ec('0x25')]==='undefined';var _0xaa3fd5=_0x33926c[_0x70ec('0x26')];var _0x7556be=_0x36753c?0x0:_0xfb759f[_0x70ec('0x23')];var _0x7023f8=_0x36753c?_0x33926c[_0x70ec('0x26')]:_0xfb759f[_0x70ec('0x23')]+_0xfb759f[_0x70ec('0x25')];var _0x2bf6e2;if(_0x7023f8>=_0xaa3fd5){_0x7023f8=_0xaa3fd5;_0x2bf6e2=0xc8;}else{_0x2bf6e2=0xce;}_0x83ae6e[_0x70ec('0x21')](_0x2bf6e2);return _0x83ae6e['set'](_0x70ec('0x27'),_0x7556be+'-'+_0x7023f8+'/'+_0xaa3fd5)[_0x70ec('0x28')](_0x33926c);}return null;};}function patchUpdates(_0x43a842){return function(_0x575376){try{jsonpatch[_0x70ec('0x29')](_0x575376,_0x43a842,!![]);}catch(_0x55a270){return BPromise[_0x70ec('0x2a')](_0x55a270);}return _0x575376[_0x70ec('0x2b')]();};}function saveUpdates(_0x2bcba4,_0x546ee2){return function(_0x1a7f8b){if(_0x1a7f8b){return _0x1a7f8b[_0x70ec('0x2c')](_0x2bcba4)[_0x70ec('0x2d')](function(_0x12e983){return _0x12e983;});}return null;};}function removeEntity(_0x2a8686,_0x375019){return function(_0x56b46f){if(_0x56b46f){return _0x56b46f[_0x70ec('0x2e')]()[_0x70ec('0x2d')](function(){var _0x201dc5=_0x56b46f[_0x70ec('0x2f')]({'plain':!![]});var _0x5c23d7='MailQueues';return db[_0x70ec('0x30')]['destroy']({'where':{'type':_0x5c23d7,'resourceId':_0x201dc5['id']}})[_0x70ec('0x2d')](function(){return _0x56b46f;});})[_0x70ec('0x2d')](function(){_0x2a8686[_0x70ec('0x21')](0xcc)[_0x70ec('0x22')]();});}};}function handleEntityNotFound(_0x472e76,_0x46a834){return function(_0x288064){if(!_0x288064){_0x472e76[_0x70ec('0x20')](0x194);}return _0x288064;};}function handleError(_0x5baddf,_0x51dd1e){_0x51dd1e=_0x51dd1e||0x1f4;return function(_0xfaec50){logger[_0x70ec('0x31')](_0xfaec50['stack']);if(_0xfaec50[_0x70ec('0x32')]){delete _0xfaec50[_0x70ec('0x32')];}_0x5baddf[_0x70ec('0x21')](_0x51dd1e)['send'](_0xfaec50);};}exports[_0x70ec('0x33')]=function(_0x2f09cd,_0x22a24a){var _0xf863aa={},_0x411f68={},_0x27ce9c={'count':0x0,'rows':[]};var _0x42c142=_[_0x70ec('0x34')](db[_0x70ec('0x35')][_0x70ec('0x36')],function(_0x20aecf){return{'name':_0x20aecf[_0x70ec('0x37')],'type':_0x20aecf['type'][_0x70ec('0x38')]};});_0x411f68[_0x70ec('0x39')]=_[_0x70ec('0x34')](_0x42c142,_0x70ec('0x32'));_0x411f68['query']=_['keys'](_0x2f09cd[_0x70ec('0x3a')]);_0x411f68['filters']=_[_0x70ec('0x3b')](_0x411f68[_0x70ec('0x39')],_0x411f68[_0x70ec('0x3a')]);_0xf863aa[_0x70ec('0x3c')]=_[_0x70ec('0x3b')](_0x411f68[_0x70ec('0x39')],qs[_0x70ec('0x3d')](_0x2f09cd['query'][_0x70ec('0x3d')]));_0xf863aa['attributes']=_0xf863aa[_0x70ec('0x3c')][_0x70ec('0x3e')]?_0xf863aa['attributes']:_0x411f68[_0x70ec('0x39')];if(!_0x2f09cd[_0x70ec('0x3a')]['hasOwnProperty']('nolimit')){_0xf863aa[_0x70ec('0x25')]=qs[_0x70ec('0x25')](_0x2f09cd[_0x70ec('0x3a')][_0x70ec('0x25')]);_0xf863aa['offset']=qs[_0x70ec('0x23')](_0x2f09cd['query'][_0x70ec('0x23')]);}_0xf863aa[_0x70ec('0x3f')]=qs[_0x70ec('0x40')](_0x2f09cd[_0x70ec('0x3a')][_0x70ec('0x40')]);_0xf863aa[_0x70ec('0x41')]=qs[_0x70ec('0x42')](_[_0x70ec('0x43')](_0x2f09cd[_0x70ec('0x3a')],_0x411f68[_0x70ec('0x42')]),_0x42c142);if(_0x2f09cd[_0x70ec('0x3a')][_0x70ec('0x44')]){_0xf863aa[_0x70ec('0x41')]=_[_0x70ec('0x45')](_0xf863aa[_0x70ec('0x41')],{'$or':_['map'](_0x42c142,function(_0x14a76a){if(_0x14a76a[_0x70ec('0x46')]!==_0x70ec('0x47')){var _0x43a438={};_0x43a438[_0x14a76a[_0x70ec('0x32')]]={'$like':'%'+_0x2f09cd[_0x70ec('0x3a')][_0x70ec('0x44')]+'%'};return _0x43a438;}})});}_0xf863aa=_[_0x70ec('0x45')]({},_0xf863aa,_0x2f09cd['options']);var _0x2b0e9e={'where':_0xf863aa[_0x70ec('0x41')]};return db[_0x70ec('0x35')][_0x70ec('0x26')](_0x2b0e9e)['then'](function(_0x28227c){_0x27ce9c[_0x70ec('0x26')]=_0x28227c;if(_0x2f09cd[_0x70ec('0x3a')][_0x70ec('0x48')]){_0xf863aa[_0x70ec('0x49')]=[{'all':!![]}];}return db[_0x70ec('0x35')][_0x70ec('0x4a')](_0xf863aa);})[_0x70ec('0x2d')](function(_0x121b46){_0x27ce9c['rows']=_0x121b46;return _0x27ce9c;})[_0x70ec('0x2d')](respondWithFilteredResult(_0x22a24a,_0xf863aa))[_0x70ec('0x4b')](handleError(_0x22a24a,null));};exports[_0x70ec('0x4c')]=function(_0xd76e63,_0x1b889e){var _0x5c541f={'raw':!![],'where':{'id':_0xd76e63[_0x70ec('0x4d')]['id']}},_0x1c4e0c={};_0x1c4e0c[_0x70ec('0x39')]=_['keys'](db[_0x70ec('0x35')][_0x70ec('0x36')]);_0x1c4e0c[_0x70ec('0x3a')]=_[_0x70ec('0x4e')](_0xd76e63[_0x70ec('0x3a')]);_0x1c4e0c[_0x70ec('0x42')]=_[_0x70ec('0x3b')](_0x1c4e0c[_0x70ec('0x39')],_0x1c4e0c[_0x70ec('0x3a')]);_0x5c541f[_0x70ec('0x3c')]=_[_0x70ec('0x3b')](_0x1c4e0c['model'],qs[_0x70ec('0x3d')](_0xd76e63[_0x70ec('0x3a')][_0x70ec('0x3d')]));_0x5c541f[_0x70ec('0x3c')]=_0x5c541f[_0x70ec('0x3c')]['length']?_0x5c541f[_0x70ec('0x3c')]:_0x1c4e0c['model'];if(_0xd76e63['query'][_0x70ec('0x48')]){_0x5c541f['include']=[{'all':!![]}];}_0x5c541f=_[_0x70ec('0x45')]({},_0x5c541f,_0xd76e63[_0x70ec('0x4f')]);return db[_0x70ec('0x35')][_0x70ec('0x50')](_0x5c541f)[_0x70ec('0x2d')](handleEntityNotFound(_0x1b889e,null))[_0x70ec('0x2d')](respondWithResult(_0x1b889e,null))[_0x70ec('0x4b')](handleError(_0x1b889e,null));};exports[_0x70ec('0x51')]=function(_0x311218,_0x54728f){return db['MailQueue'][_0x70ec('0x51')](_0x311218[_0x70ec('0x52')],{})[_0x70ec('0x2d')](function(_0x43af27){var _0x3287e1=_0x311218[_0x70ec('0x53')][_0x70ec('0x2f')]({'plain':!![]});if(!_0x3287e1)throw new Error(_0x70ec('0x54'));if(_0x3287e1[_0x70ec('0x55')]===_0x70ec('0x53')){var _0x5ebc9c=_0x43af27[_0x70ec('0x2f')]({'plain':!![]});var _0x4105d2=_0x70ec('0x56');return db[_0x70ec('0x57')][_0x70ec('0x50')]({'where':{'name':_0x4105d2,'userProfileId':_0x3287e1[_0x70ec('0x58')]},'raw':!![]})[_0x70ec('0x2d')](function(_0x1a7162){if(_0x1a7162&&_0x1a7162[_0x70ec('0x59')]===0x0){return db['UserProfileResource'][_0x70ec('0x51')]({'name':_0x5ebc9c[_0x70ec('0x32')],'resourceId':_0x5ebc9c['id'],'type':_0x1a7162[_0x70ec('0x32')],'sectionId':_0x1a7162['id']},{})['then'](function(){return _0x43af27;});}else{return _0x43af27;}})[_0x70ec('0x4b')](function(_0x2772ac){logger[_0x70ec('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2772ac);throw _0x2772ac;});}return _0x43af27;})[_0x70ec('0x2d')](respondWithResult(_0x54728f,0xc9))[_0x70ec('0x4b')](handleError(_0x54728f,null));};exports[_0x70ec('0x2c')]=function(_0x3fa7db,_0x35e2e3){if(_0x3fa7db['body']['id']){delete _0x3fa7db[_0x70ec('0x52')]['id'];}return db[_0x70ec('0x35')][_0x70ec('0x50')]({'where':{'id':_0x3fa7db[_0x70ec('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35e2e3,null))[_0x70ec('0x2d')](saveUpdates(_0x3fa7db[_0x70ec('0x52')],null))[_0x70ec('0x2d')](respondWithResult(_0x35e2e3,null))['catch'](handleError(_0x35e2e3,null));};exports[_0x70ec('0x2e')]=function(_0x1ffe7c,_0xf8ff34){return db['MailQueue'][_0x70ec('0x50')]({'where':{'id':_0x1ffe7c[_0x70ec('0x4d')]['id']}})[_0x70ec('0x2d')](handleEntityNotFound(_0xf8ff34,null))[_0x70ec('0x2d')](removeEntity(_0xf8ff34,null))[_0x70ec('0x4b')](handleError(_0xf8ff34,null));};exports['describe']=function(_0xf07028,_0x1141a1){return db[_0x70ec('0x35')][_0x70ec('0x5a')]()['then'](respondWithResult(_0x1141a1,null))['catch'](handleError(_0x1141a1,null));};exports[_0x70ec('0x5b')]=function(_0x41a3d3,_0x28d732,_0x289375){var _0x2f006b={'raw':!![],'where':{}},_0xc41a5f={},_0x5db1ae;return db[_0x70ec('0x35')][_0x70ec('0x5c')]({'where':{'id':_0x41a3d3[_0x70ec('0x4d')]['id']}})[_0x70ec('0x2d')](handleEntityNotFound(_0x28d732,null))['then'](function(_0x47fe4f){if(_0x47fe4f){_0x5db1ae=_0x47fe4f[_0x70ec('0x2f')]({'plain':!![]});_0xc41a5f[_0x70ec('0x39')]=_[_0x70ec('0x4e')](db[_0x70ec('0x5d')][_0x70ec('0x36')]);_0xc41a5f[_0x70ec('0x3a')]=_[_0x70ec('0x4e')](_0x41a3d3['query']);_0xc41a5f[_0x70ec('0x42')]=_[_0x70ec('0x3b')](_0xc41a5f[_0x70ec('0x39')],_0xc41a5f['query']);_0x2f006b[_0x70ec('0x3c')]=_[_0x70ec('0x3b')](_0xc41a5f[_0x70ec('0x39')],qs[_0x70ec('0x3d')](_0x41a3d3[_0x70ec('0x3a')][_0x70ec('0x3d')]));_0x2f006b['attributes']=_0x2f006b[_0x70ec('0x3c')][_0x70ec('0x3e')]?_0x2f006b[_0x70ec('0x3c')]:_0xc41a5f['model'];if(!_0x41a3d3[_0x70ec('0x3a')][_0x70ec('0x5e')](_0x70ec('0x5f'))){_0x2f006b[_0x70ec('0x25')]=qs[_0x70ec('0x25')](_0x41a3d3[_0x70ec('0x3a')]['limit']);_0x2f006b['offset']=qs[_0x70ec('0x23')](_0x41a3d3[_0x70ec('0x3a')]['offset']);}_0x2f006b[_0x70ec('0x3f')]=qs[_0x70ec('0x40')](_0x41a3d3[_0x70ec('0x3a')]['sort']);_0x2f006b[_0x70ec('0x41')]=qs[_0x70ec('0x42')](_['pick'](_0x41a3d3[_0x70ec('0x3a')],_0xc41a5f[_0x70ec('0x42')]));_0x2f006b[_0x70ec('0x41')]['MailQueueId']=_0x47fe4f['id'];if(_0x41a3d3['query'][_0x70ec('0x44')]){_0x2f006b[_0x70ec('0x41')]=_['merge'](_0x2f006b['where'],{'$or':_['map'](_0x2f006b['attributes'],function(_0x17d7bf){var _0x34c99d={};_0x34c99d[_0x17d7bf]={'$like':'%'+_0x41a3d3[_0x70ec('0x3a')][_0x70ec('0x44')]+'%'};return _0x34c99d;})});}_0x2f006b=_[_0x70ec('0x45')]({},_0x2f006b,_0x41a3d3[_0x70ec('0x4f')]);return db[_0x70ec('0x5d')][_0x70ec('0x4a')](_0x2f006b);}})['then'](function(_0x963d03){if(_0x963d03){return db[_0x70ec('0x60')][_0x70ec('0x61')]({'where':{'id':_[_0x70ec('0x34')](_0x963d03,_0x70ec('0x62')),'role':_0x70ec('0x63')},'attributes':['id',_0x70ec('0x32'),_0x70ec('0x64'),'updatedAt',_0x70ec('0x65')]});}})[_0x70ec('0x2d')](function(_0x582f0a){if(_0x582f0a){return{'count':_0x582f0a[_0x70ec('0x26')],'rows':_[_0x70ec('0x34')](_0x582f0a[_0x70ec('0x66')],function(_0x3634cf){return{'membername':_0x3634cf['name'],'UserId':_0x3634cf['id'],'queue_name':_0x5db1ae[_0x70ec('0x32')],'MailQueueId':_0x5db1ae['id'],'interface':util[_0x70ec('0x67')](_0x70ec('0x68'),'SIP',_0x3634cf[_0x70ec('0x32')]),'penalty':0x0,'paused':_0x3634cf['mailPause'],'createdAt':_0x3634cf['createdAt'],'updatedAt':_0x3634cf[_0x70ec('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x70ec('0x2d')](respondWithFilteredResult(_0x28d732,_0x2f006b))[_0x70ec('0x4b')](handleError(_0x28d732,null));};exports[_0x70ec('0x6a')]=function(_0x5e60e1,_0xf5e808,_0x16307d){var _0x227be6={};var _0x17c136={};var _0x11d96a;var _0x344379;return db[_0x70ec('0x35')]['findOne']({'where':{'id':_0x5e60e1['params']['id']}})[_0x70ec('0x2d')](handleEntityNotFound(_0xf5e808,null))['then'](function(_0x3ecd35){if(_0x3ecd35){_0x11d96a=_0x3ecd35;_0x17c136[_0x70ec('0x39')]=_['keys'](db[_0x70ec('0x6b')][_0x70ec('0x36')]);_0x17c136[_0x70ec('0x3a')]=_[_0x70ec('0x4e')](_0x5e60e1[_0x70ec('0x3a')]);_0x17c136[_0x70ec('0x42')]=_[_0x70ec('0x3b')](_0x17c136[_0x70ec('0x39')],_0x17c136[_0x70ec('0x3a')]);_0x227be6['attributes']=_[_0x70ec('0x3b')](_0x17c136[_0x70ec('0x39')],qs[_0x70ec('0x3d')](_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x3d')]));_0x227be6[_0x70ec('0x3c')]=_0x227be6[_0x70ec('0x3c')]['length']?_0x227be6[_0x70ec('0x3c')]:_0x17c136[_0x70ec('0x39')];_0x227be6[_0x70ec('0x3f')]=qs[_0x70ec('0x40')](_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x40')]);_0x227be6[_0x70ec('0x41')]=qs['filters'](_[_0x70ec('0x43')](_0x5e60e1[_0x70ec('0x3a')],_0x17c136[_0x70ec('0x42')]));if(_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x44')]){_0x227be6[_0x70ec('0x41')]=_[_0x70ec('0x45')](_0x227be6['where'],{'$or':_[_0x70ec('0x34')](_0x227be6[_0x70ec('0x3c')],function(_0x38856a){var _0x9bc6fc={};_0x9bc6fc[_0x38856a]={'$like':'%'+_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x44')]+'%'};return _0x9bc6fc;})});}_0x227be6=_[_0x70ec('0x45')]({},_0x227be6,_0x5e60e1[_0x70ec('0x4f')]);return _0x11d96a[_0x70ec('0x6a')](_0x227be6);}})['then'](function(_0x5c507e){if(_0x5c507e){_0x344379=_0x5c507e[_0x70ec('0x3e')];if(!_0x5e60e1['query'][_0x70ec('0x5e')](_0x70ec('0x5f'))){_0x227be6[_0x70ec('0x25')]=qs['limit'](_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x25')]);_0x227be6[_0x70ec('0x23')]=qs['offset'](_0x5e60e1[_0x70ec('0x3a')][_0x70ec('0x23')]);}return _0x11d96a[_0x70ec('0x6a')](_0x227be6);}})['then'](function(_0xaab417){if(_0xaab417){return _0xaab417?{'count':_0x344379,'rows':_0xaab417}:null;}})[_0x70ec('0x2d')](respondWithResult(_0xf5e808,null))[_0x70ec('0x4b')](handleError(_0xf5e808,null));};exports[_0x70ec('0x6c')]=function(_0x3474ab,_0x318a16,_0x5f23a4){var _0x1c3492=_0x3474ab[_0x70ec('0x52')][_0x70ec('0x6d')];return db[_0x70ec('0x6b')]['findAll']({'where':{'id':_0x1c3492},'attributes':['id'],'include':[{'model':db[_0x70ec('0x60')],'as':_0x70ec('0x6e'),'attributes':['id',_0x70ec('0x32'),'online','voicePause','interface'],'raw':!![]}]})[_0x70ec('0x2d')](function(_0x418949){if(_0x418949){var _0x30fd70=_[_0x70ec('0x6f')](_0x418949,function(_0x51723a){var _0x8c7001=_0x51723a[_0x70ec('0x2f')]({'plain':!![]});return _0x8c7001[_0x70ec('0x6e')];});return db['MailQueue'][_0x70ec('0x50')]({'where':{'id':_0x3474ab['params']['id']}})[_0x70ec('0x2d')](function(_0x1bed72){return db['sequelize'][_0x70ec('0x70')](function(_0x5e3c3a){return _0x1bed72['addTeams'](_0x1c3492,{'transaction':_0x5e3c3a})['then'](function(){return BPromise[_0x70ec('0x71')](_0x30fd70,function(_0x28c387){return db['UserMailQueue'][_0x70ec('0x72')]({'where':{'UserId':_0x28c387['id'],'MailQueueId':_0x3474ab[_0x70ec('0x4d')]['id']},'transaction':_0x5e3c3a});});})[_0x70ec('0x2d')](function(){_0x30fd70[_0x70ec('0x73')](function(_0x52fe71){socket[_0x70ec('0x74')]('userMailQueue:save',{'UserId':_0x52fe71['id'],'MailQueueId':_0x1bed72['id']});});});});});}})[_0x70ec('0x2d')](respondWithStatusCode(_0x318a16,null))[_0x70ec('0x4b')](handleError(_0x318a16,null));};exports[_0x70ec('0x75')]=function(_0x2781bf,_0x2120df,_0x392656){return db[_0x70ec('0x6b')][_0x70ec('0x4a')]({'where':{'id':_0x2781bf[_0x70ec('0x3a')][_0x70ec('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x70ec('0x60')],'as':_0x70ec('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x70ec('0x2d')](handleEntityNotFound(_0x2120df,null))['then'](function(_0x57779c){var _0x393385=_[_0x70ec('0x34')](_0x57779c,'id');var _0x5acc13=[];var _0x4f3f81=[];var _0x4cb139=squel[_0x70ec('0x76')]();_0x4cb139[_0x70ec('0x77')]('tq.TeamId')[_0x70ec('0x78')](_0x70ec('0x79'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x70ec('0x41')]('MailQueueId\x20=\x20?',_0x2781bf[_0x70ec('0x4d')]['id']);for(var _0x3257b5=0x0;_0x3257b5<_0x57779c['length'];_0x3257b5+=0x1){let _0x2dfbf0=_0x57779c[_0x3257b5];for(var _0x412081=0x0;_0x412081<_0x2dfbf0[_0x70ec('0x6e')]['length'];_0x412081+=0x1){let _0x59e5fb=_0x2dfbf0[_0x70ec('0x6e')][_0x412081];var _0x11fa68=_0x4cb139[_0x70ec('0x7a')]();_0x11fa68[_0x70ec('0x41')](_0x70ec('0x7b'),_0x59e5fb['id']);_0x4f3f81[_0x70ec('0x7c')](db['sequelize'][_0x70ec('0x3a')](_0x11fa68[_0x70ec('0x7d')](),{'type':db['sequelize'][_0x70ec('0x7e')][_0x70ec('0x7f')]})[_0x70ec('0x2d')](function(_0x4e7805){if(_0x4e7805[_0x70ec('0x3e')]===0x1){return _0x59e5fb['id'];}else{var _0x3244bf=_[_0x70ec('0x80')](_[_0x70ec('0x34')](_0x4e7805,_0x70ec('0x81')),function(_0x1617dc){return _[_0x70ec('0x82')](_0x393385,_0x1617dc);});if(_0x3244bf){return _0x59e5fb['id'];}}}));}}return BPromise[_0x70ec('0x83')](_0x4f3f81)[_0x70ec('0x2d')](function(_0x44ccca){_0x5acc13=_(_0x5acc13)[_0x70ec('0x84')](_0x44ccca)[_0x70ec('0x85')]()[_0x70ec('0x86')]();return db[_0x70ec('0x35')]['find']({'where':{'id':_0x2781bf[_0x70ec('0x4d')]['id']}})['then'](function(_0x50ad6e){return db['sequelize']['transaction'](function(_0x4a09a3){return _0x50ad6e[_0x70ec('0x75')](_0x2781bf[_0x70ec('0x3a')]['ids'],{'transaction':_0x4a09a3})['then'](function(){if(!_[_0x70ec('0x87')](_0x5acc13)){return _0x50ad6e[_0x70ec('0x88')](_0x5acc13,{'transaction':_0x4a09a3});}})[_0x70ec('0x2d')](function(){_0x5acc13['forEach'](function(_0x1160d4){socket[_0x70ec('0x74')](_0x70ec('0x89'),{'UserId':_0x1160d4,'MailQueueId':_0x50ad6e['id']});});});});});});})['then'](respondWithStatusCode(_0x2120df,null))[_0x70ec('0x4b')](handleError(_0x2120df,null));};exports['addAgents']=function(_0x9c2d0e,_0x74259,_0x5a5880){return db['MailQueue'][_0x70ec('0x50')]({'where':{'id':_0x9c2d0e['params']['id']}})[_0x70ec('0x2d')](handleEntityNotFound(_0x74259,null))[_0x70ec('0x2d')](function(_0x40c258){if(_0x40c258){return _0x40c258[_0x70ec('0x8a')](_0x9c2d0e['body'][_0x70ec('0x6d')],_[_0x70ec('0x8b')](_0x9c2d0e['body'],[_0x70ec('0x6d'),'id'])||{})[_0x70ec('0x8c')](function(_0x19770b){for(var _0x512134=0x0;_0x512134<_0x9c2d0e[_0x70ec('0x52')]['ids'][_0x70ec('0x3e')];_0x512134+=0x1){socket['emit'](_0x70ec('0x8d'),{'UserId':Number(_0x9c2d0e['body'][_0x70ec('0x6d')][_0x512134]),'MailQueueId':Number(_0x9c2d0e['params']['id'])});}return _0x19770b;});}})['then'](respondWithResult(_0x74259,null))[_0x70ec('0x4b')](handleError(_0x74259,null));};exports[_0x70ec('0x88')]=function(_0x2fec6a,_0x5cb0ce,_0x3a7515){return db['MailQueue'][_0x70ec('0x50')]({'where':{'id':_0x2fec6a[_0x70ec('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5cb0ce,null))[_0x70ec('0x2d')](function(_0x1a0d33){if(_0x1a0d33){return _0x1a0d33['removeAgents'](_0x2fec6a[_0x70ec('0x3a')][_0x70ec('0x6d')])[_0x70ec('0x2d')](function(){if(_[_0x70ec('0x8e')](_0x2fec6a[_0x70ec('0x3a')][_0x70ec('0x6d')])){for(var _0x2f210f=0x0;_0x2f210f<_0x2fec6a[_0x70ec('0x3a')][_0x70ec('0x6d')]['length'];_0x2f210f+=0x1){socket[_0x70ec('0x74')](_0x70ec('0x89'),{'UserId':Number(_0x2fec6a[_0x70ec('0x3a')][_0x70ec('0x6d')][_0x2f210f]),'MailQueueId':Number(_0x2fec6a[_0x70ec('0x4d')]['id'])});}}else{socket[_0x70ec('0x74')]('userMailQueue:remove',{'UserId':Number(_0x2fec6a[_0x70ec('0x3a')]['ids']),'MailQueueId':Number(_0x2fec6a[_0x70ec('0x4d')]['id'])});}});}})[_0x70ec('0x2d')](respondWithStatusCode(_0x5cb0ce,null))[_0x70ec('0x4b')](handleError(_0x5cb0ce,null));};exports['getAgents']=function(_0x3aad51,_0x9ba6ae,_0x5a244c){var _0x1bc25f={};var _0xe835e7={};var _0x3ca008;var _0x4c7a06;return db[_0x70ec('0x35')][_0x70ec('0x5c')]({'where':{'id':_0x3aad51[_0x70ec('0x4d')]['id']}})[_0x70ec('0x2d')](handleEntityNotFound(_0x9ba6ae,null))['then'](function(_0x409175){if(_0x409175){_0x3ca008=_0x409175;_0xe835e7[_0x70ec('0x39')]=_[_0x70ec('0x4e')](db[_0x70ec('0x60')][_0x70ec('0x36')]);_0xe835e7[_0x70ec('0x3a')]=_[_0x70ec('0x4e')](_0x3aad51[_0x70ec('0x3a')]);_0xe835e7[_0x70ec('0x42')]=_[_0x70ec('0x3b')](_0xe835e7[_0x70ec('0x39')],_0xe835e7[_0x70ec('0x3a')]);_0x1bc25f[_0x70ec('0x3c')]=_[_0x70ec('0x3b')](_0xe835e7[_0x70ec('0x39')],qs[_0x70ec('0x3d')](_0x3aad51[_0x70ec('0x3a')][_0x70ec('0x3d')]));_0x1bc25f[_0x70ec('0x3c')]=_0x1bc25f[_0x70ec('0x3c')][_0x70ec('0x3e')]?_0x1bc25f['attributes']:_0xe835e7['model'];_0x1bc25f[_0x70ec('0x3f')]=qs[_0x70ec('0x40')](_0x3aad51[_0x70ec('0x3a')][_0x70ec('0x40')]);_0x1bc25f['where']=qs[_0x70ec('0x42')](_[_0x70ec('0x43')](_0x3aad51['query'],_0xe835e7['filters']));if(_0x3aad51[_0x70ec('0x3a')]['filter']){_0x1bc25f[_0x70ec('0x41')]=_['merge'](_0x1bc25f['where'],{'$or':_[_0x70ec('0x34')](_0x1bc25f[_0x70ec('0x3c')],function(_0x18e6d5){var _0x1ac0d1={};_0x1ac0d1[_0x18e6d5]={'$like':'%'+_0x3aad51['query']['filter']+'%'};return _0x1ac0d1;})});}_0x1bc25f=_[_0x70ec('0x45')]({},_0x1bc25f,_0x3aad51['options']);return _0x3ca008[_0x70ec('0x8f')](_0x1bc25f);}})[_0x70ec('0x2d')](function(_0x5b0de1){if(_0x5b0de1){_0x4c7a06=_0x5b0de1['length'];if(!_0x3aad51['query']['hasOwnProperty'](_0x70ec('0x5f'))){_0x1bc25f[_0x70ec('0x25')]=qs[_0x70ec('0x25')](_0x3aad51[_0x70ec('0x3a')][_0x70ec('0x25')]);_0x1bc25f[_0x70ec('0x23')]=qs[_0x70ec('0x23')](_0x3aad51['query'][_0x70ec('0x23')]);}return _0x3ca008[_0x70ec('0x8f')](_0x1bc25f);}})[_0x70ec('0x2d')](function(_0x2a165e){if(_0x2a165e){return _0x2a165e?{'count':_0x4c7a06,'rows':_0x2a165e}:null;}})[_0x70ec('0x2d')](respondWithResult(_0x9ba6ae,null))[_0x70ec('0x4b')](handleError(_0x9ba6ae,null));}; \ No newline at end of file +var _0x05ba=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','error','stack','name','MailQueue','fieldName','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','rawAttributes','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','hasOwnProperty','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','createdAt','format','SIP','mailPause','updatedAt','Team','options','getTeams','addTeams','ids','interface','flatMap','sequelize','each','findOrCreate','forEach','userMailQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','emit','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x236f74,_0x169ca6){var _0x2a15b0=function(_0x29c804){while(--_0x29c804){_0x236f74['push'](_0x236f74['shift']());}};_0x2a15b0(++_0x169ca6);}(_0x05ba,0x116));var _0xa05b=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x05ba[_0x5cc3d4];return _0x17ca31;};'use strict';var emlformat=require(_0xa05b('0x0'));var rimraf=require(_0xa05b('0x1'));var zipdir=require(_0xa05b('0x2'));var jsonpatch=require(_0xa05b('0x3'));var rp=require(_0xa05b('0x4'));var moment=require(_0xa05b('0x5'));var BPromise=require(_0xa05b('0x6'));var Mustache=require(_0xa05b('0x7'));var util=require(_0xa05b('0x8'));var path=require(_0xa05b('0x9'));var sox=require(_0xa05b('0xa'));var csv=require(_0xa05b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa05b('0xc'));var _=require('lodash');var squel=require(_0xa05b('0xd'));var crypto=require(_0xa05b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa05b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa05b('0x10'));var Papa=require('papaparse');var Redis=require(_0xa05b('0x11'));var authService=require(_0xa05b('0x12'));var qs=require(_0xa05b('0x13'));var as=require(_0xa05b('0x14'));var hardwareService=require(_0xa05b('0x15'));var logger=require(_0xa05b('0x16'))(_0xa05b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa05b('0x18'));var db=require('../../mysqldb')['db'];config[_0xa05b('0x19')]=_['defaults'](config[_0xa05b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa05b('0x1a'))(new Redis(config[_0xa05b('0x19')]));require(_0xa05b('0x1b'))[_0xa05b('0x1c')](socket);function respondWithStatusCode(_0x5e7209,_0x3011bc){_0x3011bc=_0x3011bc||0xcc;return function(_0x480ad3){if(_0x480ad3){return _0x5e7209[_0xa05b('0x1d')](_0x3011bc);}return _0x5e7209['status'](_0x3011bc)['end']();};}function respondWithResult(_0x96f37,_0x3e273c){_0x3e273c=_0x3e273c||0xc8;return function(_0x10e454){if(_0x10e454){return _0x96f37[_0xa05b('0x1e')](_0x3e273c)[_0xa05b('0x1f')](_0x10e454);}};}function respondWithFilteredResult(_0x431adb,_0x404c54){return function(_0x350620){if(_0x350620){var _0x40accb=typeof _0x404c54[_0xa05b('0x20')]===_0xa05b('0x21')&&typeof _0x404c54['limit']===_0xa05b('0x21');var _0x1b7a1f=_0x350620['count'];var _0x4c34ed=_0x40accb?0x0:_0x404c54[_0xa05b('0x20')];var _0x24f8e4=_0x40accb?_0x350620[_0xa05b('0x22')]:_0x404c54['offset']+_0x404c54[_0xa05b('0x23')];var _0x18b998;if(_0x24f8e4>=_0x1b7a1f){_0x24f8e4=_0x1b7a1f;_0x18b998=0xc8;}else{_0x18b998=0xce;}_0x431adb[_0xa05b('0x1e')](_0x18b998);return _0x431adb['set'](_0xa05b('0x24'),_0x4c34ed+'-'+_0x24f8e4+'/'+_0x1b7a1f)[_0xa05b('0x1f')](_0x350620);}return null;};}function patchUpdates(_0x4fc9b7){return function(_0x26809c){try{jsonpatch[_0xa05b('0x25')](_0x26809c,_0x4fc9b7,!![]);}catch(_0x34f519){return BPromise[_0xa05b('0x26')](_0x34f519);}return _0x26809c[_0xa05b('0x27')]();};}function saveUpdates(_0x11e26d,_0x1048ca){return function(_0x412f47){if(_0x412f47){return _0x412f47[_0xa05b('0x28')](_0x11e26d)[_0xa05b('0x29')](function(_0x52003f){return _0x52003f;});}return null;};}function removeEntity(_0xf42218,_0x43e41c){return function(_0x2c022c){if(_0x2c022c){return _0x2c022c[_0xa05b('0x2a')]()[_0xa05b('0x29')](function(){var _0x49fb1d=_0x2c022c[_0xa05b('0x2b')]({'plain':!![]});var _0x28fc3d=_0xa05b('0x2c');return db['UserProfileResource'][_0xa05b('0x2a')]({'where':{'type':_0x28fc3d,'resourceId':_0x49fb1d['id']}})[_0xa05b('0x29')](function(){return _0x2c022c;});})[_0xa05b('0x29')](function(){_0xf42218[_0xa05b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x431d61,_0x39cb2d){return function(_0x49b355){if(!_0x49b355){_0x431d61['sendStatus'](0x194);}return _0x49b355;};}function handleError(_0x50babc,_0x529d80){_0x529d80=_0x529d80||0x1f4;return function(_0x26bc3d){logger[_0xa05b('0x2d')](_0x26bc3d[_0xa05b('0x2e')]);if(_0x26bc3d[_0xa05b('0x2f')]){delete _0x26bc3d[_0xa05b('0x2f')];}_0x50babc['status'](_0x529d80)['send'](_0x26bc3d);};}exports['index']=function(_0x21650c,_0xb245ef){var _0x4e8fc2={},_0x52fbce={},_0x1dd36e={'count':0x0,'rows':[]};var _0x2e3d85=_['map'](db[_0xa05b('0x30')]['rawAttributes'],function(_0x3331e3){return{'name':_0x3331e3[_0xa05b('0x31')],'type':_0x3331e3['type']['key']};});_0x52fbce[_0xa05b('0x32')]=_[_0xa05b('0x33')](_0x2e3d85,_0xa05b('0x2f'));_0x52fbce[_0xa05b('0x34')]=_[_0xa05b('0x35')](_0x21650c[_0xa05b('0x34')]);_0x52fbce[_0xa05b('0x36')]=_[_0xa05b('0x37')](_0x52fbce[_0xa05b('0x32')],_0x52fbce[_0xa05b('0x34')]);_0x4e8fc2['attributes']=_[_0xa05b('0x37')](_0x52fbce[_0xa05b('0x32')],qs[_0xa05b('0x38')](_0x21650c[_0xa05b('0x34')][_0xa05b('0x38')]));_0x4e8fc2[_0xa05b('0x39')]=_0x4e8fc2[_0xa05b('0x39')]['length']?_0x4e8fc2[_0xa05b('0x39')]:_0x52fbce[_0xa05b('0x32')];if(!_0x21650c[_0xa05b('0x34')]['hasOwnProperty'](_0xa05b('0x3a'))){_0x4e8fc2['limit']=qs[_0xa05b('0x23')](_0x21650c['query']['limit']);_0x4e8fc2[_0xa05b('0x20')]=qs[_0xa05b('0x20')](_0x21650c[_0xa05b('0x34')][_0xa05b('0x20')]);}_0x4e8fc2[_0xa05b('0x3b')]=qs[_0xa05b('0x3c')](_0x21650c[_0xa05b('0x34')][_0xa05b('0x3c')]);_0x4e8fc2[_0xa05b('0x3d')]=qs[_0xa05b('0x36')](_[_0xa05b('0x3e')](_0x21650c['query'],_0x52fbce[_0xa05b('0x36')]),_0x2e3d85);if(_0x21650c[_0xa05b('0x34')][_0xa05b('0x3f')]){_0x4e8fc2[_0xa05b('0x3d')]=_[_0xa05b('0x40')](_0x4e8fc2[_0xa05b('0x3d')],{'$or':_[_0xa05b('0x33')](_0x2e3d85,function(_0x4d9bff){if(_0x4d9bff[_0xa05b('0x41')]!==_0xa05b('0x42')){var _0x310926={};_0x310926[_0x4d9bff[_0xa05b('0x2f')]]={'$like':'%'+_0x21650c['query'][_0xa05b('0x3f')]+'%'};return _0x310926;}})});}_0x4e8fc2=_['merge']({},_0x4e8fc2,_0x21650c['options']);var _0x591a42={'where':_0x4e8fc2['where']};return db[_0xa05b('0x30')][_0xa05b('0x22')](_0x591a42)[_0xa05b('0x29')](function(_0x19e710){_0x1dd36e[_0xa05b('0x22')]=_0x19e710;if(_0x21650c[_0xa05b('0x34')][_0xa05b('0x43')]){_0x4e8fc2[_0xa05b('0x44')]=[{'all':!![]}];}return db[_0xa05b('0x30')]['findAll'](_0x4e8fc2);})['then'](function(_0x1f064c){_0x1dd36e[_0xa05b('0x45')]=_0x1f064c;return _0x1dd36e;})[_0xa05b('0x29')](respondWithFilteredResult(_0xb245ef,_0x4e8fc2))[_0xa05b('0x46')](handleError(_0xb245ef,null));};exports['show']=function(_0x7e770e,_0x5e9929){var _0x38a56f={'raw':!![],'where':{'id':_0x7e770e['params']['id']}},_0x443f40={};_0x443f40['model']=_[_0xa05b('0x35')](db['MailQueue'][_0xa05b('0x47')]);_0x443f40[_0xa05b('0x34')]=_[_0xa05b('0x35')](_0x7e770e[_0xa05b('0x34')]);_0x443f40[_0xa05b('0x36')]=_[_0xa05b('0x37')](_0x443f40[_0xa05b('0x32')],_0x443f40[_0xa05b('0x34')]);_0x38a56f[_0xa05b('0x39')]=_[_0xa05b('0x37')](_0x443f40[_0xa05b('0x32')],qs[_0xa05b('0x38')](_0x7e770e['query'][_0xa05b('0x38')]));_0x38a56f[_0xa05b('0x39')]=_0x38a56f[_0xa05b('0x39')][_0xa05b('0x48')]?_0x38a56f['attributes']:_0x443f40[_0xa05b('0x32')];if(_0x7e770e['query'][_0xa05b('0x43')]){_0x38a56f['include']=[{'all':!![]}];}_0x38a56f=_[_0xa05b('0x40')]({},_0x38a56f,_0x7e770e['options']);return db[_0xa05b('0x30')][_0xa05b('0x49')](_0x38a56f)[_0xa05b('0x29')](handleEntityNotFound(_0x5e9929,null))[_0xa05b('0x29')](respondWithResult(_0x5e9929,null))[_0xa05b('0x46')](handleError(_0x5e9929,null));};exports['create']=function(_0xae8f5d,_0x241b1c){return db[_0xa05b('0x30')][_0xa05b('0x4a')](_0xae8f5d[_0xa05b('0x4b')],{})[_0xa05b('0x29')](function(_0x54767e){var _0x243ed0=_0xae8f5d[_0xa05b('0x4c')][_0xa05b('0x2b')]({'plain':!![]});if(!_0x243ed0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x243ed0[_0xa05b('0x4d')]===_0xa05b('0x4c')){var _0x2bdbfe=_0x54767e[_0xa05b('0x2b')]({'plain':!![]});var _0x469a58=_0xa05b('0x2c');return db[_0xa05b('0x4e')][_0xa05b('0x49')]({'where':{'name':_0x469a58,'userProfileId':_0x243ed0[_0xa05b('0x4f')]},'raw':!![]})[_0xa05b('0x29')](function(_0x154fae){if(_0x154fae&&_0x154fae[_0xa05b('0x50')]===0x0){return db[_0xa05b('0x51')]['create']({'name':_0x2bdbfe[_0xa05b('0x2f')],'resourceId':_0x2bdbfe['id'],'type':_0x154fae['name'],'sectionId':_0x154fae['id']},{})[_0xa05b('0x29')](function(){return _0x54767e;});}else{return _0x54767e;}})[_0xa05b('0x46')](function(_0x2e1b70){logger[_0xa05b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e1b70);throw _0x2e1b70;});}return _0x54767e;})[_0xa05b('0x29')](respondWithResult(_0x241b1c,0xc9))['catch'](handleError(_0x241b1c,null));};exports[_0xa05b('0x28')]=function(_0x204886,_0x4ea58c){if(_0x204886[_0xa05b('0x4b')]['id']){delete _0x204886['body']['id'];}return db[_0xa05b('0x30')][_0xa05b('0x49')]({'where':{'id':_0x204886[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x4ea58c,null))[_0xa05b('0x29')](saveUpdates(_0x204886['body'],null))[_0xa05b('0x29')](respondWithResult(_0x4ea58c,null))['catch'](handleError(_0x4ea58c,null));};exports[_0xa05b('0x2a')]=function(_0x1183b1,_0x56d9bd){return db[_0xa05b('0x30')][_0xa05b('0x49')]({'where':{'id':_0x1183b1[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x56d9bd,null))[_0xa05b('0x29')](removeEntity(_0x56d9bd,null))['catch'](handleError(_0x56d9bd,null));};exports[_0xa05b('0x53')]=function(_0x3395bc,_0x27cba9){return db[_0xa05b('0x30')]['describe']()['then'](respondWithResult(_0x27cba9,null))[_0xa05b('0x46')](handleError(_0x27cba9,null));};exports[_0xa05b('0x54')]=function(_0x45db7d,_0x1c00ed,_0x2f3081){var _0x2a6076={'raw':!![],'where':{}},_0x421f22={},_0x4b8397;return db['MailQueue'][_0xa05b('0x55')]({'where':{'id':_0x45db7d[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x1c00ed,null))[_0xa05b('0x29')](function(_0x17442d){if(_0x17442d){_0x4b8397=_0x17442d[_0xa05b('0x2b')]({'plain':!![]});_0x421f22[_0xa05b('0x32')]=_['keys'](db['UserMailQueue'][_0xa05b('0x47')]);_0x421f22['query']=_['keys'](_0x45db7d[_0xa05b('0x34')]);_0x421f22[_0xa05b('0x36')]=_[_0xa05b('0x37')](_0x421f22[_0xa05b('0x32')],_0x421f22[_0xa05b('0x34')]);_0x2a6076[_0xa05b('0x39')]=_['intersection'](_0x421f22['model'],qs[_0xa05b('0x38')](_0x45db7d[_0xa05b('0x34')][_0xa05b('0x38')]));_0x2a6076['attributes']=_0x2a6076['attributes'][_0xa05b('0x48')]?_0x2a6076[_0xa05b('0x39')]:_0x421f22[_0xa05b('0x32')];if(!_0x45db7d['query'][_0xa05b('0x56')](_0xa05b('0x3a'))){_0x2a6076[_0xa05b('0x23')]=qs[_0xa05b('0x23')](_0x45db7d[_0xa05b('0x34')][_0xa05b('0x23')]);_0x2a6076[_0xa05b('0x20')]=qs[_0xa05b('0x20')](_0x45db7d[_0xa05b('0x34')][_0xa05b('0x20')]);}_0x2a6076[_0xa05b('0x3b')]=qs[_0xa05b('0x3c')](_0x45db7d[_0xa05b('0x34')][_0xa05b('0x3c')]);_0x2a6076['where']=qs[_0xa05b('0x36')](_['pick'](_0x45db7d[_0xa05b('0x34')],_0x421f22[_0xa05b('0x36')]));_0x2a6076[_0xa05b('0x3d')][_0xa05b('0x57')]=_0x17442d['id'];if(_0x45db7d[_0xa05b('0x34')][_0xa05b('0x3f')]){_0x2a6076[_0xa05b('0x3d')]=_[_0xa05b('0x40')](_0x2a6076[_0xa05b('0x3d')],{'$or':_[_0xa05b('0x33')](_0x2a6076[_0xa05b('0x39')],function(_0x162fdb){var _0x1de25e={};_0x1de25e[_0x162fdb]={'$like':'%'+_0x45db7d[_0xa05b('0x34')][_0xa05b('0x3f')]+'%'};return _0x1de25e;})});}_0x2a6076=_[_0xa05b('0x40')]({},_0x2a6076,_0x45db7d['options']);return db[_0xa05b('0x58')][_0xa05b('0x59')](_0x2a6076);}})['then'](function(_0x44d95d){if(_0x44d95d){return db[_0xa05b('0x5a')][_0xa05b('0x5b')]({'where':{'id':_['map'](_0x44d95d,_0xa05b('0x5c')),'role':_0xa05b('0x5d')},'attributes':['id','name','mailPause','updatedAt',_0xa05b('0x5e')]});}})[_0xa05b('0x29')](function(_0x58e24f){if(_0x58e24f){return{'count':_0x58e24f[_0xa05b('0x22')],'rows':_[_0xa05b('0x33')](_0x58e24f['rows'],function(_0xd77033){return{'membername':_0xd77033['name'],'UserId':_0xd77033['id'],'queue_name':_0x4b8397['name'],'MailQueueId':_0x4b8397['id'],'interface':util[_0xa05b('0x5f')]('%s/%s',_0xa05b('0x60'),_0xd77033[_0xa05b('0x2f')]),'penalty':0x0,'paused':_0xd77033[_0xa05b('0x61')],'createdAt':_0xd77033[_0xa05b('0x5e')],'updatedAt':_0xd77033[_0xa05b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa05b('0x29')](respondWithFilteredResult(_0x1c00ed,_0x2a6076))[_0xa05b('0x46')](handleError(_0x1c00ed,null));};exports['getTeams']=function(_0x177c62,_0x3e50a9,_0xe5506){var _0x44f935={};var _0x4b6c63={};var _0x100662;var _0x104732;return db[_0xa05b('0x30')][_0xa05b('0x55')]({'where':{'id':_0x177c62[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x3e50a9,null))['then'](function(_0xe53799){if(_0xe53799){_0x100662=_0xe53799;_0x4b6c63[_0xa05b('0x32')]=_['keys'](db[_0xa05b('0x63')]['rawAttributes']);_0x4b6c63[_0xa05b('0x34')]=_[_0xa05b('0x35')](_0x177c62[_0xa05b('0x34')]);_0x4b6c63['filters']=_[_0xa05b('0x37')](_0x4b6c63[_0xa05b('0x32')],_0x4b6c63[_0xa05b('0x34')]);_0x44f935[_0xa05b('0x39')]=_[_0xa05b('0x37')](_0x4b6c63[_0xa05b('0x32')],qs[_0xa05b('0x38')](_0x177c62[_0xa05b('0x34')][_0xa05b('0x38')]));_0x44f935[_0xa05b('0x39')]=_0x44f935[_0xa05b('0x39')][_0xa05b('0x48')]?_0x44f935[_0xa05b('0x39')]:_0x4b6c63['model'];_0x44f935[_0xa05b('0x3b')]=qs[_0xa05b('0x3c')](_0x177c62[_0xa05b('0x34')]['sort']);_0x44f935['where']=qs[_0xa05b('0x36')](_[_0xa05b('0x3e')](_0x177c62[_0xa05b('0x34')],_0x4b6c63['filters']));if(_0x177c62[_0xa05b('0x34')][_0xa05b('0x3f')]){_0x44f935[_0xa05b('0x3d')]=_[_0xa05b('0x40')](_0x44f935[_0xa05b('0x3d')],{'$or':_[_0xa05b('0x33')](_0x44f935[_0xa05b('0x39')],function(_0x247911){var _0x717675={};_0x717675[_0x247911]={'$like':'%'+_0x177c62[_0xa05b('0x34')][_0xa05b('0x3f')]+'%'};return _0x717675;})});}_0x44f935=_[_0xa05b('0x40')]({},_0x44f935,_0x177c62[_0xa05b('0x64')]);return _0x100662[_0xa05b('0x65')](_0x44f935);}})[_0xa05b('0x29')](function(_0xf6a845){if(_0xf6a845){_0x104732=_0xf6a845[_0xa05b('0x48')];if(!_0x177c62['query'][_0xa05b('0x56')]('nolimit')){_0x44f935[_0xa05b('0x23')]=qs['limit'](_0x177c62[_0xa05b('0x34')]['limit']);_0x44f935[_0xa05b('0x20')]=qs[_0xa05b('0x20')](_0x177c62[_0xa05b('0x34')][_0xa05b('0x20')]);}return _0x100662[_0xa05b('0x65')](_0x44f935);}})[_0xa05b('0x29')](function(_0x46946f){if(_0x46946f){return _0x46946f?{'count':_0x104732,'rows':_0x46946f}:null;}})[_0xa05b('0x29')](respondWithResult(_0x3e50a9,null))[_0xa05b('0x46')](handleError(_0x3e50a9,null));};exports[_0xa05b('0x66')]=function(_0x403998,_0x1d5b0c,_0xcc85e7){var _0xa8559b=_0x403998[_0xa05b('0x4b')][_0xa05b('0x67')];return db[_0xa05b('0x63')][_0xa05b('0x59')]({'where':{'id':_0xa8559b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0xa05b('0x68')],'raw':!![]}]})[_0xa05b('0x29')](function(_0x279e0d){if(_0x279e0d){var _0x25b773=_[_0xa05b('0x69')](_0x279e0d,function(_0x553481){var _0x287b90=_0x553481[_0xa05b('0x2b')]({'plain':!![]});return _0x287b90['Agents'];});return db[_0xa05b('0x30')][_0xa05b('0x49')]({'where':{'id':_0x403998['params']['id']}})[_0xa05b('0x29')](function(_0x1da094){return db[_0xa05b('0x6a')]['transaction'](function(_0x1f2c70){return _0x1da094['addTeams'](_0xa8559b,{'transaction':_0x1f2c70})[_0xa05b('0x29')](function(){return BPromise[_0xa05b('0x6b')](_0x25b773,function(_0x49490d){return db[_0xa05b('0x58')][_0xa05b('0x6c')]({'where':{'UserId':_0x49490d['id'],'MailQueueId':_0x403998[_0xa05b('0x52')]['id']},'transaction':_0x1f2c70});});})[_0xa05b('0x29')](function(){_0x25b773[_0xa05b('0x6d')](function(_0x38a8ad){socket['emit'](_0xa05b('0x6e'),{'UserId':_0x38a8ad['id'],'MailQueueId':_0x1da094['id']});});});});});}})[_0xa05b('0x29')](respondWithStatusCode(_0x1d5b0c,null))[_0xa05b('0x46')](handleError(_0x1d5b0c,null));};exports[_0xa05b('0x6f')]=function(_0x471c2e,_0x52ef83,_0x1fe4f4){return db['Team'][_0xa05b('0x59')]({'where':{'id':_0x471c2e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa05b('0x5a')],'as':_0xa05b('0x70'),'attributes':['id'],'raw':!![]}]})[_0xa05b('0x29')](handleEntityNotFound(_0x52ef83,null))[_0xa05b('0x29')](function(_0xb548c0){var _0x29348b=_[_0xa05b('0x33')](_0xb548c0,'id');var _0x302b49=[];var _0x259ecc=[];var _0x126228=squel[_0xa05b('0x71')]();_0x126228[_0xa05b('0x72')](_0xa05b('0x73'))[_0xa05b('0x74')](_0xa05b('0x75'),'tq')['join'](_0xa05b('0x76'),'ut',_0xa05b('0x77'))['where'](_0xa05b('0x78'),_0x471c2e[_0xa05b('0x52')]['id']);for(var _0x5a8d83=0x0;_0x5a8d83<_0xb548c0[_0xa05b('0x48')];_0x5a8d83+=0x1){let _0x3004f3=_0xb548c0[_0x5a8d83];for(var _0x551dcc=0x0;_0x551dcc<_0x3004f3['Agents'][_0xa05b('0x48')];_0x551dcc+=0x1){let _0x31def6=_0x3004f3[_0xa05b('0x70')][_0x551dcc];var _0x2ff80a=_0x126228[_0xa05b('0x79')]();_0x2ff80a[_0xa05b('0x3d')](_0xa05b('0x7a'),_0x31def6['id']);_0x259ecc[_0xa05b('0x7b')](db[_0xa05b('0x6a')][_0xa05b('0x34')](_0x2ff80a[_0xa05b('0x7c')](),{'type':db[_0xa05b('0x6a')][_0xa05b('0x7d')]['SELECT']})[_0xa05b('0x29')](function(_0x241a71){if(_0x241a71[_0xa05b('0x48')]===0x1){return _0x31def6['id'];}else{var _0xff6c2a=_[_0xa05b('0x7e')](_[_0xa05b('0x33')](_0x241a71,_0xa05b('0x7f')),function(_0x21e4d1){return _[_0xa05b('0x80')](_0x29348b,_0x21e4d1);});if(_0xff6c2a){return _0x31def6['id'];}}}));}}return BPromise[_0xa05b('0x81')](_0x259ecc)[_0xa05b('0x29')](function(_0x2bfd67){_0x302b49=_(_0x302b49)[_0xa05b('0x82')](_0x2bfd67)[_0xa05b('0x83')]()[_0xa05b('0x84')]();return db[_0xa05b('0x30')][_0xa05b('0x49')]({'where':{'id':_0x471c2e[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](function(_0x5b3640){return db[_0xa05b('0x6a')][_0xa05b('0x85')](function(_0x2a51a6){return _0x5b3640[_0xa05b('0x6f')](_0x471c2e[_0xa05b('0x34')][_0xa05b('0x67')],{'transaction':_0x2a51a6})['then'](function(){if(!_['isEmpty'](_0x302b49)){return _0x5b3640['removeAgents'](_0x302b49,{'transaction':_0x2a51a6});}})[_0xa05b('0x29')](function(){_0x302b49[_0xa05b('0x6d')](function(_0x315a65){socket[_0xa05b('0x86')](_0xa05b('0x87'),{'UserId':_0x315a65,'MailQueueId':_0x5b3640['id']});});});});});});})['then'](respondWithStatusCode(_0x52ef83,null))['catch'](handleError(_0x52ef83,null));};exports[_0xa05b('0x88')]=function(_0x4213db,_0x2f3384,_0x334c37){return db[_0xa05b('0x30')][_0xa05b('0x49')]({'where':{'id':_0x4213db[_0xa05b('0x52')]['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x2f3384,null))[_0xa05b('0x29')](function(_0x386e33){if(_0x386e33){return _0x386e33['addAgents'](_0x4213db['body'][_0xa05b('0x67')],_['omit'](_0x4213db['body'],[_0xa05b('0x67'),'id'])||{})[_0xa05b('0x89')](function(_0x339514){for(var _0x122611=0x0;_0x122611<_0x4213db['body'][_0xa05b('0x67')][_0xa05b('0x48')];_0x122611+=0x1){socket[_0xa05b('0x86')](_0xa05b('0x6e'),{'UserId':Number(_0x4213db[_0xa05b('0x4b')]['ids'][_0x122611]),'MailQueueId':Number(_0x4213db[_0xa05b('0x52')]['id'])});}return _0x339514;});}})['then'](respondWithResult(_0x2f3384,null))['catch'](handleError(_0x2f3384,null));};exports['removeAgents']=function(_0x27abc9,_0x1bfa37,_0x1ce99d){return db['MailQueue']['find']({'where':{'id':_0x27abc9['params']['id']}})['then'](handleEntityNotFound(_0x1bfa37,null))[_0xa05b('0x29')](function(_0x1d149e){if(_0x1d149e){return _0x1d149e[_0xa05b('0x8a')](_0x27abc9[_0xa05b('0x34')][_0xa05b('0x67')])[_0xa05b('0x29')](function(){if(_[_0xa05b('0x8b')](_0x27abc9[_0xa05b('0x34')]['ids'])){for(var _0x5a72cd=0x0;_0x5a72cd<_0x27abc9['query'][_0xa05b('0x67')]['length'];_0x5a72cd+=0x1){socket[_0xa05b('0x86')](_0xa05b('0x87'),{'UserId':Number(_0x27abc9[_0xa05b('0x34')]['ids'][_0x5a72cd]),'MailQueueId':Number(_0x27abc9[_0xa05b('0x52')]['id'])});}}else{socket[_0xa05b('0x86')](_0xa05b('0x87'),{'UserId':Number(_0x27abc9[_0xa05b('0x34')][_0xa05b('0x67')]),'MailQueueId':Number(_0x27abc9[_0xa05b('0x52')]['id'])});}});}})[_0xa05b('0x29')](respondWithStatusCode(_0x1bfa37,null))['catch'](handleError(_0x1bfa37,null));};exports[_0xa05b('0x8c')]=function(_0x5a0c8f,_0x3fe18a,_0x18ab5a){var _0x4694fd={};var _0x34354f={};var _0xc9009;var _0x1d78e5;return db[_0xa05b('0x30')]['findOne']({'where':{'id':_0x5a0c8f['params']['id']}})[_0xa05b('0x29')](handleEntityNotFound(_0x3fe18a,null))[_0xa05b('0x29')](function(_0x3d7efe){if(_0x3d7efe){_0xc9009=_0x3d7efe;_0x34354f[_0xa05b('0x32')]=_['keys'](db['User']['rawAttributes']);_0x34354f[_0xa05b('0x34')]=_['keys'](_0x5a0c8f[_0xa05b('0x34')]);_0x34354f['filters']=_[_0xa05b('0x37')](_0x34354f[_0xa05b('0x32')],_0x34354f[_0xa05b('0x34')]);_0x4694fd[_0xa05b('0x39')]=_['intersection'](_0x34354f['model'],qs[_0xa05b('0x38')](_0x5a0c8f[_0xa05b('0x34')][_0xa05b('0x38')]));_0x4694fd['attributes']=_0x4694fd[_0xa05b('0x39')][_0xa05b('0x48')]?_0x4694fd[_0xa05b('0x39')]:_0x34354f[_0xa05b('0x32')];_0x4694fd[_0xa05b('0x3b')]=qs[_0xa05b('0x3c')](_0x5a0c8f[_0xa05b('0x34')][_0xa05b('0x3c')]);_0x4694fd[_0xa05b('0x3d')]=qs['filters'](_[_0xa05b('0x3e')](_0x5a0c8f[_0xa05b('0x34')],_0x34354f[_0xa05b('0x36')]));if(_0x5a0c8f['query'][_0xa05b('0x3f')]){_0x4694fd['where']=_[_0xa05b('0x40')](_0x4694fd['where'],{'$or':_[_0xa05b('0x33')](_0x4694fd[_0xa05b('0x39')],function(_0x477da1){var _0x1e181e={};_0x1e181e[_0x477da1]={'$like':'%'+_0x5a0c8f['query']['filter']+'%'};return _0x1e181e;})});}_0x4694fd=_[_0xa05b('0x40')]({},_0x4694fd,_0x5a0c8f['options']);return _0xc9009[_0xa05b('0x8c')](_0x4694fd);}})[_0xa05b('0x29')](function(_0x1e0f3d){if(_0x1e0f3d){_0x1d78e5=_0x1e0f3d[_0xa05b('0x48')];if(!_0x5a0c8f['query'][_0xa05b('0x56')](_0xa05b('0x3a'))){_0x4694fd['limit']=qs[_0xa05b('0x23')](_0x5a0c8f[_0xa05b('0x34')][_0xa05b('0x23')]);_0x4694fd[_0xa05b('0x20')]=qs['offset'](_0x5a0c8f[_0xa05b('0x34')]['offset']);}return _0xc9009['getAgents'](_0x4694fd);}})['then'](function(_0x33d091){if(_0x33d091){return _0x33d091?{'count':_0x1d78e5,'rows':_0x33d091}:null;}})['then'](respondWithResult(_0x3fe18a,null))[_0xa05b('0x46')](handleError(_0x3fe18a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b49e7c0..f3b3742 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 _0xd360=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x146984,_0x68c9fa){var _0x2a78ef=function(_0x542613){while(--_0x542613){_0x146984['push'](_0x146984['shift']());}};_0x2a78ef(++_0x68c9fa);}(_0xd360,0x151));var _0x0d36=function(_0x318184,_0x351127){_0x318184=_0x318184-0x0;var _0x4bcf36=_0xd360[_0x318184];return _0x4bcf36;};'use strict';var EventEmitter=require(_0x0d36('0x0'));var MailQueue=require(_0x0d36('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0d36('0x2')](0x0);var events={'afterCreate':_0x0d36('0x3'),'afterUpdate':_0x0d36('0x4'),'afterDestroy':_0x0d36('0x5')};function emitEvent(_0x132909){return function(_0x531e5b,_0x328e63,_0xa82857){MailQueueEvents[_0x0d36('0x6')](_0x132909+':'+_0x531e5b['id'],_0x531e5b);MailQueueEvents[_0x0d36('0x6')](_0x132909,_0x531e5b);_0xa82857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x0d36('0x7')](e,emitEvent(event));}}module[_0x0d36('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x5e62=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x43e013,_0x15c4c6){var _0x4d214b=function(_0x285ab5){while(--_0x285ab5){_0x43e013['push'](_0x43e013['shift']());}};_0x4d214b(++_0x15c4c6);}(_0x5e62,0x124));var _0x25e6=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x5e62[_0x485b5a];return _0xd2b34d;};'use strict';var EventEmitter=require(_0x25e6('0x0'));var MailQueue=require(_0x25e6('0x1'))['db'][_0x25e6('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x25e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25e6('0x4'),'afterDestroy':_0x25e6('0x5')};function emitEvent(_0x3d12fb){return function(_0x16a308,_0x4f471b,_0x3ecd2a){MailQueueEvents['emit'](_0x3d12fb+':'+_0x16a308['id'],_0x16a308);MailQueueEvents[_0x25e6('0x6')](_0x3d12fb,_0x16a308);_0x3ecd2a(null);};}for(var e in events){if(events[_0x25e6('0x7')](e)){var event=events[e];MailQueue[_0x25e6('0x8')](e,emitEvent(event));}}module[_0x25e6('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b9628f7..287f36c 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 _0x2d04=['request-promise','path','rimraf','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x2d04,0x7e));var _0x42d0=function(_0x147a08,_0x41aad2){_0x147a08=_0x147a08-0x0;var _0x433e13=_0x2d04[_0x147a08];return _0x433e13;};'use strict';var _=require(_0x42d0('0x0'));var util=require(_0x42d0('0x1'));var logger=require(_0x42d0('0x2'))(_0x42d0('0x3'));var moment=require(_0x42d0('0x4'));var BPromise=require(_0x42d0('0x5'));var rp=require(_0x42d0('0x6'));var fs=require('fs');var path=require(_0x42d0('0x7'));var rimraf=require(_0x42d0('0x8'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x42d0('0x9')]=function(_0x335888,_0x340cd9){return _0x335888[_0x42d0('0xa')](_0x42d0('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aff=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7aff,0x1a4));var _0xf7af=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7aff[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf7af('0x0'));var util=require(_0xf7af('0x1'));var logger=require(_0xf7af('0x2'))(_0xf7af('0x3'));var moment=require(_0xf7af('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7af('0x5'));var fs=require('fs');var path=require(_0xf7af('0x6'));var rimraf=require(_0xf7af('0x7'));var config=require('../../config/environment');var attributes=require(_0xf7af('0x8'));module[_0xf7af('0x9')]=function(_0x36737a,_0x55878b){return _0x36737a[_0xf7af('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','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 b1bd65f..d2c6c28 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 _0x4a47=['./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','options','raw','where','attributes','map','model','include','debug','MailQueue','find','then','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis'];(function(_0x34dba9,_0x4db90f){var _0x9873d6=function(_0xa300ac){while(--_0xa300ac){_0x34dba9['push'](_0x34dba9['shift']());}};_0x9873d6(++_0x4db90f);}(_0x4a47,0xb5));var _0x74a4=function(_0x195690,_0x13d76e){_0x195690=_0x195690-0x0;var _0xcd8219=_0x4a47[_0x195690];return _0xcd8219;};'use strict';var _=require(_0x74a4('0x0'));var util=require(_0x74a4('0x1'));var moment=require(_0x74a4('0x2'));var BPromise=require(_0x74a4('0x3'));var rs=require(_0x74a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a4('0x6'))(_0x74a4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74a4('0x8'));var client=jayson[_0x74a4('0x9')][_0x74a4('0xa')]({'port':0x232a});config['redis']=_[_0x74a4('0xb')](config['redis'],{'host':_0x74a4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74a4('0xd')]));require(_0x74a4('0xe'))[_0x74a4('0xf')](socket);function respondWithRpcPromise(_0x17c01f,_0x56a17a,_0x1efc67){return new BPromise(function(_0x65a4ef,_0x316f53){return client[_0x74a4('0x10')](_0x17c01f,_0x1efc67)['then'](function(_0x379351){logger[_0x74a4('0x11')](_0x74a4('0x12'),_0x56a17a,'request\x20sent');logger['debug'](_0x74a4('0x13'),_0x56a17a,_0x74a4('0x14'),JSON[_0x74a4('0x15')](_0x379351));if(_0x379351[_0x74a4('0x16')]){if(_0x379351[_0x74a4('0x16')][_0x74a4('0x17')]===0x1f4){logger[_0x74a4('0x16')](_0x74a4('0x12'),_0x56a17a,_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);return _0x316f53(_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);}logger[_0x74a4('0x16')](_0x74a4('0x12'),_0x56a17a,_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);return _0x65a4ef(_0x379351['error'][_0x74a4('0x18')]);}else{logger[_0x74a4('0x11')](_0x74a4('0x12'),_0x56a17a,_0x74a4('0x14'));_0x65a4ef(_0x379351['result'][_0x74a4('0x18')]);}})[_0x74a4('0x19')](function(_0x42d72a){logger[_0x74a4('0x16')]('MailQueue,\x20%s,\x20%s',_0x56a17a,_0x42d72a);_0x316f53(_0x42d72a);});});}exports[_0x74a4('0x1a')]=function(_0x3adb7c){var _0x59bb30=this;return new Promise(function(_0x12fc31,_0x2d3075){return db['MailQueue']['findAll']({'raw':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')][_0x74a4('0x1c')]===undefined?!![]:![]:!![],'where':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c['options'][_0x74a4('0x1d')]||null:null,'attributes':_0x3adb7c['options']?_0x3adb7c['options'][_0x74a4('0x1e')]||null:null,'limit':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')]['limit']||null:null,'include':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')]['include']?_[_0x74a4('0x1f')](_0x3adb7c[_0x74a4('0x1b')]['include'],function(_0x12895a){return{'model':db[_0x12895a[_0x74a4('0x20')]],'as':_0x12895a['as'],'attributes':_0x12895a[_0x74a4('0x1e')],'include':_0x12895a['include']?_[_0x74a4('0x1f')](_0x12895a[_0x74a4('0x21')],function(_0x1510fd){return{'model':db[_0x1510fd[_0x74a4('0x20')]],'as':_0x1510fd['as'],'attributes':_0x1510fd[_0x74a4('0x1e')],'include':_0x1510fd[_0x74a4('0x21')]?_['map'](_0x1510fd['include'],function(_0x36472e){return{'model':db[_0x36472e['model']],'as':_0x36472e['as'],'attributes':_0x36472e[_0x74a4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x446340){logger['info']('GetMailQueue',_0x3adb7c);logger[_0x74a4('0x22')](_0x74a4('0x1a'),_0x3adb7c,JSON[_0x74a4('0x15')](_0x446340));_0x12fc31(_0x446340);})['catch'](function(_0x4abc27){logger['error']('GetMailQueue',_0x4abc27['message'],_0x3adb7c);_0x2d3075(_0x59bb30['error'](0x1f4,_0x4abc27[_0x74a4('0x18')]));});});};exports['ShowMailQueue']=function(_0x1734b9){var _0x395e32=this;return new Promise(function(_0x3747f7,_0x5b277a){return db[_0x74a4('0x23')][_0x74a4('0x24')]({'raw':_0x1734b9[_0x74a4('0x1b')]?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1c')]===undefined?!![]:![]:!![],'where':_0x1734b9[_0x74a4('0x1b')]?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1d')]||null:null,'attributes':_0x1734b9['options']?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1e')]||null:null,'include':_0x1734b9['options']?_0x1734b9[_0x74a4('0x1b')]['include']?_['map'](_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x21')],function(_0x2a79e1){return{'model':db[_0x2a79e1[_0x74a4('0x20')]],'as':_0x2a79e1['as'],'attributes':_0x2a79e1[_0x74a4('0x1e')],'include':_0x2a79e1[_0x74a4('0x21')]?_[_0x74a4('0x1f')](_0x2a79e1[_0x74a4('0x21')],function(_0xa52e2){return{'model':db[_0xa52e2['model']],'as':_0xa52e2['as'],'attributes':_0xa52e2[_0x74a4('0x1e')],'include':_0xa52e2[_0x74a4('0x21')]?_[_0x74a4('0x1f')](_0xa52e2[_0x74a4('0x21')],function(_0x1834cc){return{'model':db[_0x1834cc['model']],'as':_0x1834cc['as'],'attributes':_0x1834cc[_0x74a4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x74a4('0x25')](function(_0x5e2944){logger[_0x74a4('0x11')](_0x74a4('0x26'),_0x1734b9);logger[_0x74a4('0x22')](_0x74a4('0x26'),_0x1734b9,JSON[_0x74a4('0x15')](_0x5e2944));_0x3747f7(_0x5e2944);})[_0x74a4('0x19')](function(_0x5ef529){logger[_0x74a4('0x16')](_0x74a4('0x26'),_0x5ef529['message'],_0x1734b9);_0x5b277a(_0x395e32[_0x74a4('0x16')](0x1f4,_0x5ef529[_0x74a4('0x18')]));});});}; \ No newline at end of file +var _0xabbe=['ShowMailQueue','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','find'];(function(_0x3a87b5,_0xdf92e5){var _0x26955a=function(_0x179649){while(--_0x179649){_0x3a87b5['push'](_0x3a87b5['shift']());}};_0x26955a(++_0xdf92e5);}(_0xabbe,0x70));var _0xeabb=function(_0x19e75b,_0x5a58d1){_0x19e75b=_0x19e75b-0x0;var _0x4a29c6=_0xabbe[_0x19e75b];return _0x4a29c6;};'use strict';var _=require(_0xeabb('0x0'));var util=require('util');var moment=require(_0xeabb('0x1'));var BPromise=require('bluebird');var rs=require(_0xeabb('0x2'));var fs=require('fs');var Redis=require(_0xeabb('0x3'));var db=require(_0xeabb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeabb('0x5'));var config=require(_0xeabb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeabb('0x7')][_0xeabb('0x8')]({'port':0x232a});config['redis']=_[_0xeabb('0x9')](config[_0xeabb('0xa')],{'host':_0xeabb('0xb'),'port':0x18eb});var socket=require(_0xeabb('0xc'))(new Redis(config[_0xeabb('0xa')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x355f3c,_0x3cc959,_0x35fc70){return new BPromise(function(_0x4b5ca1,_0x11747f){return client[_0xeabb('0xd')](_0x355f3c,_0x35fc70)[_0xeabb('0xe')](function(_0x2e4ad4){logger[_0xeabb('0xf')](_0xeabb('0x10'),_0x3cc959,'request\x20sent');logger[_0xeabb('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3cc959,_0xeabb('0x12'),JSON[_0xeabb('0x13')](_0x2e4ad4));if(_0x2e4ad4[_0xeabb('0x14')]){if(_0x2e4ad4[_0xeabb('0x14')][_0xeabb('0x15')]===0x1f4){logger[_0xeabb('0x14')](_0xeabb('0x10'),_0x3cc959,_0x2e4ad4['error'][_0xeabb('0x16')]);return _0x11747f(_0x2e4ad4['error'][_0xeabb('0x16')]);}logger['error'](_0xeabb('0x10'),_0x3cc959,_0x2e4ad4[_0xeabb('0x14')][_0xeabb('0x16')]);return _0x4b5ca1(_0x2e4ad4[_0xeabb('0x14')][_0xeabb('0x16')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x3cc959,_0xeabb('0x12'));_0x4b5ca1(_0x2e4ad4[_0xeabb('0x17')][_0xeabb('0x16')]);}})[_0xeabb('0x18')](function(_0x2388de){logger[_0xeabb('0x14')]('MailQueue,\x20%s,\x20%s',_0x3cc959,_0x2388de);_0x11747f(_0x2388de);});});}exports[_0xeabb('0x19')]=function(_0x3fd4de){var _0x51c385=this;return new Promise(function(_0x3ffff1,_0x1e6704){return db[_0xeabb('0x1a')][_0xeabb('0x1b')]({'raw':_0x3fd4de[_0xeabb('0x1c')]?_0x3fd4de['options'][_0xeabb('0x1d')]===undefined?!![]:![]:!![],'where':_0x3fd4de[_0xeabb('0x1c')]?_0x3fd4de[_0xeabb('0x1c')][_0xeabb('0x1e')]||null:null,'attributes':_0x3fd4de[_0xeabb('0x1c')]?_0x3fd4de[_0xeabb('0x1c')][_0xeabb('0x1f')]||null:null,'limit':_0x3fd4de[_0xeabb('0x1c')]?_0x3fd4de[_0xeabb('0x1c')]['limit']||null:null,'include':_0x3fd4de['options']?_0x3fd4de[_0xeabb('0x1c')][_0xeabb('0x20')]?_[_0xeabb('0x21')](_0x3fd4de[_0xeabb('0x1c')][_0xeabb('0x20')],function(_0x403b93){return{'model':db[_0x403b93[_0xeabb('0x22')]],'as':_0x403b93['as'],'attributes':_0x403b93[_0xeabb('0x1f')],'include':_0x403b93[_0xeabb('0x20')]?_['map'](_0x403b93['include'],function(_0x4834c3){return{'model':db[_0x4834c3['model']],'as':_0x4834c3['as'],'attributes':_0x4834c3['attributes'],'include':_0x4834c3[_0xeabb('0x20')]?_[_0xeabb('0x21')](_0x4834c3['include'],function(_0x443846){return{'model':db[_0x443846['model']],'as':_0x443846['as'],'attributes':_0x443846[_0xeabb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeabb('0xe')](function(_0x316fbd){logger[_0xeabb('0xf')](_0xeabb('0x19'),_0x3fd4de);logger[_0xeabb('0x11')](_0xeabb('0x19'),_0x3fd4de,JSON[_0xeabb('0x13')](_0x316fbd));_0x3ffff1(_0x316fbd);})[_0xeabb('0x18')](function(_0x5449dd){logger[_0xeabb('0x14')](_0xeabb('0x19'),_0x5449dd[_0xeabb('0x16')],_0x3fd4de);_0x1e6704(_0x51c385[_0xeabb('0x14')](0x1f4,_0x5449dd[_0xeabb('0x16')]));});});};exports['ShowMailQueue']=function(_0x34f263){var _0x37a214=this;return new Promise(function(_0x1a4fec,_0xa1f965){return db[_0xeabb('0x1a')][_0xeabb('0x23')]({'raw':_0x34f263['options']?_0x34f263[_0xeabb('0x1c')][_0xeabb('0x1d')]===undefined?!![]:![]:!![],'where':_0x34f263[_0xeabb('0x1c')]?_0x34f263['options'][_0xeabb('0x1e')]||null:null,'attributes':_0x34f263[_0xeabb('0x1c')]?_0x34f263[_0xeabb('0x1c')][_0xeabb('0x1f')]||null:null,'include':_0x34f263[_0xeabb('0x1c')]?_0x34f263[_0xeabb('0x1c')][_0xeabb('0x20')]?_['map'](_0x34f263[_0xeabb('0x1c')][_0xeabb('0x20')],function(_0x4a0e04){return{'model':db[_0x4a0e04[_0xeabb('0x22')]],'as':_0x4a0e04['as'],'attributes':_0x4a0e04[_0xeabb('0x1f')],'include':_0x4a0e04[_0xeabb('0x20')]?_[_0xeabb('0x21')](_0x4a0e04['include'],function(_0x46d3df){return{'model':db[_0x46d3df['model']],'as':_0x46d3df['as'],'attributes':_0x46d3df[_0xeabb('0x1f')],'include':_0x46d3df[_0xeabb('0x20')]?_[_0xeabb('0x21')](_0x46d3df['include'],function(_0x210a8d){return{'model':db[_0x210a8d[_0xeabb('0x22')]],'as':_0x210a8d['as'],'attributes':_0x210a8d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e5a93){logger[_0xeabb('0xf')](_0xeabb('0x24'),_0x34f263);logger[_0xeabb('0x11')](_0xeabb('0x24'),_0x34f263,JSON[_0xeabb('0x13')](_0x2e5a93));_0x1a4fec(_0x2e5a93);})[_0xeabb('0x18')](function(_0x40e47f){logger[_0xeabb('0x14')](_0xeabb('0x24'),_0x40e47f[_0xeabb('0x16')],_0x34f263);_0xa1f965(_0x37a214['error'](0x1f4,_0x40e47f[_0xeabb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ae5b3f2..feac499 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 _0x30d9=['emit','removeListener','register','length','mailQueue:','save','update'];(function(_0x248831,_0x5969a3){var _0x51bb37=function(_0x47f8c7){while(--_0x47f8c7){_0x248831['push'](_0x248831['shift']());}};_0x51bb37(++_0x5969a3);}(_0x30d9,0xd7));var _0x930d=function(_0x1ec80d,_0x177bc4){_0x1ec80d=_0x1ec80d-0x0;var _0x429c2d=_0x30d9[_0x1ec80d];return _0x429c2d;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x930d('0x0'),'remove',_0x930d('0x1')];function createListener(_0x4ef298,_0x585e61){return function(_0xb19683){_0x585e61[_0x930d('0x2')](_0x4ef298,_0xb19683);};}function removeListener(_0x14425a,_0xafaf39){return function(){MailQueueEvents[_0x930d('0x3')](_0x14425a,_0xafaf39);};}exports[_0x930d('0x4')]=function(_0x540792){for(var _0x17fe34=0x0,_0x580117=events[_0x930d('0x5')];_0x17fe34<_0x580117;_0x17fe34++){var _0xde6177=events[_0x17fe34];var _0xfaf5eb=createListener(_0x930d('0x6')+_0xde6177,_0x540792);MailQueueEvents['on'](_0xde6177,_0xfaf5eb);}}; \ No newline at end of file +var _0xccd7=['save','remove','update','emit','./mailQueue.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xccd7,0x185));var _0x7ccd=function(_0x406115,_0x19f7a1){_0x406115=_0x406115-0x0;var _0xbbabdb=_0xccd7[_0x406115];return _0xbbabdb;};'use strict';var MailQueueEvents=require(_0x7ccd('0x0'));var events=[_0x7ccd('0x1'),_0x7ccd('0x2'),_0x7ccd('0x3')];function createListener(_0x4a89c5,_0x5fc33c){return function(_0x27a82a){_0x5fc33c[_0x7ccd('0x4')](_0x4a89c5,_0x27a82a);};}function removeListener(_0x444498,_0x344a64){return function(){MailQueueEvents['removeListener'](_0x444498,_0x344a64);};}exports['register']=function(_0x165799){for(var _0x5c1788=0x0,_0x34ea24=events['length'];_0x5c1788<_0x34ea24;_0x5c1788++){var _0x22fad7=events[_0x5c1788];var _0x4ac450=createListener('mailQueue:'+_0x22fad7,_0x165799);MailQueueEvents['on'](_0x22fad7,_0x4ac450);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a4ce8cd..20b08eb 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 _0x7391=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5ed73c,_0x1d4b39){var _0x26bb79=function(_0x4e6aa6){while(--_0x4e6aa6){_0x5ed73c['push'](_0x5ed73c['shift']());}};_0x26bb79(++_0x1d4b39);}(_0x7391,0x11c));var _0x1739=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0x7391[_0x2586ad];return _0x4128db;};'use strict';var multer=require(_0x1739('0x0'));var util=require(_0x1739('0x1'));var path=require(_0x1739('0x2'));var timeout=require(_0x1739('0x3'));var express=require(_0x1739('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1739('0x5'));var controller=require('./mailQueueReport.controller');router[_0x1739('0x6')]('/',auth[_0x1739('0x7')](),controller[_0x1739('0x8')]);router[_0x1739('0x6')](_0x1739('0x9'),auth[_0x1739('0x7')](),controller[_0x1739('0xa')]);router[_0x1739('0x6')](_0x1739('0xb'),auth[_0x1739('0x7')](),controller[_0x1739('0xc')]);router[_0x1739('0xd')]('/',auth[_0x1739('0x7')](),controller[_0x1739('0xe')]);router[_0x1739('0xf')](_0x1739('0xb'),auth['isAuthenticated'](),controller[_0x1739('0x10')]);router[_0x1739('0x11')]('/:id',auth[_0x1739('0x7')](),controller[_0x1739('0x12')]);module[_0x1739('0x13')]=router; \ No newline at end of file +var _0xd25e=['update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x425236,_0x1a3064){var _0x5d0b03=function(_0x3f239a){while(--_0x3f239a){_0x425236['push'](_0x425236['shift']());}};_0x5d0b03(++_0x1a3064);}(_0xd25e,0x191));var _0xed25=function(_0x2d4b7d,_0x374ae5){_0x2d4b7d=_0x2d4b7d-0x0;var _0x106150=_0xd25e[_0x2d4b7d];return _0x106150;};'use strict';var multer=require(_0xed25('0x0'));var util=require(_0xed25('0x1'));var path=require(_0xed25('0x2'));var timeout=require('connect-timeout');var express=require(_0xed25('0x3'));var router=express[_0xed25('0x4')]();var fs_extra=require(_0xed25('0x5'));var auth=require(_0xed25('0x6'));var interaction=require(_0xed25('0x7'));var config=require(_0xed25('0x8'));var controller=require(_0xed25('0x9'));router['get']('/',auth[_0xed25('0xa')](),controller['index']);router[_0xed25('0xb')](_0xed25('0xc'),auth['isAuthenticated'](),controller[_0xed25('0xd')]);router[_0xed25('0xb')](_0xed25('0xe'),auth[_0xed25('0xa')](),controller[_0xed25('0xf')]);router[_0xed25('0x10')]('/',auth[_0xed25('0xa')](),controller[_0xed25('0x11')]);router[_0xed25('0x12')]('/:id',auth[_0xed25('0xa')](),controller[_0xed25('0x13')]);router[_0xed25('0x14')](_0xed25('0xe'),auth[_0xed25('0xa')](),controller['destroy']);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 8cb61e0..51fbd42 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 _0xb958=['STRING','DATE','exports'];(function(_0x42da15,_0x53f02a){var _0x1ebe5e=function(_0x80975d){while(--_0x80975d){_0x42da15['push'](_0x42da15['shift']());}};_0x1ebe5e(++_0x53f02a);}(_0xb958,0x1bb));var _0x8b95=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0xb958[_0x47df54];return _0x261b87;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8b95('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8b95('0x1')]},'joinAt':{'type':Sequelize[_0x8b95('0x2')]},'leaveAt':{'type':Sequelize[_0x8b95('0x2')]},'acceptAt':{'type':Sequelize[_0x8b95('0x2')]},'exitAt':{'type':Sequelize[_0x8b95('0x2')]},'reason':{'type':Sequelize[_0x8b95('0x1')]}}; \ No newline at end of file +var _0xe126=['STRING','DATE','sequelize'];(function(_0x3b611f,_0x2e8440){var _0x5e542b=function(_0x35f178){while(--_0x35f178){_0x3b611f['push'](_0x3b611f['shift']());}};_0x5e542b(++_0x2e8440);}(_0xe126,0xf2));var _0x6e12=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe126[_0x4b2436];return _0x4f5ab2;};'use strict';var moment=require('moment');var Sequelize=require(_0x6e12('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x6e12('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6e12('0x2')]},'leaveAt':{'type':Sequelize[_0x6e12('0x2')]},'acceptAt':{'type':Sequelize[_0x6e12('0x2')]},'exitAt':{'type':Sequelize[_0x6e12('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 50c2a78..6b47071 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 _0x5430=['update','then','destroy','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save'];(function(_0x4e1952,_0x5275a4){var _0x4657c7=function(_0x446312){while(--_0x446312){_0x4e1952['push'](_0x4e1952['shift']());}};_0x4657c7(++_0x5275a4);}(_0x5430,0x10c));var _0x0543=function(_0x83fcba,_0x2de71a){_0x83fcba=_0x83fcba-0x0;var _0xd7da17=_0x5430[_0x83fcba];return _0xd7da17;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require(_0x0543('0x3'));var rp=require(_0x0543('0x4'));var moment=require(_0x0543('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0543('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0543('0x7'));var ejs=require(_0x0543('0x8'));var fs=require('fs');var fs_extra=require(_0x0543('0x9'));var _=require(_0x0543('0xa'));var squel=require(_0x0543('0xb'));var crypto=require('crypto');var jsforce=require(_0x0543('0xc'));var deskjs=require(_0x0543('0xd'));var toCsv=require(_0x0543('0x7'));var querystring=require(_0x0543('0xe'));var Papa=require(_0x0543('0xf'));var Redis=require(_0x0543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x11'));var as=require(_0x0543('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x13'))(_0x0543('0x14'));var utils=require(_0x0543('0x15'));var config=require(_0x0543('0x16'));var licenseUtil=require(_0x0543('0x17'));var db=require(_0x0543('0x18'))['db'];function respondWithStatusCode(_0x30c54e,_0x27290d){_0x27290d=_0x27290d||0xcc;return function(_0x46d176){if(_0x46d176){return _0x30c54e[_0x0543('0x19')](_0x27290d);}return _0x30c54e[_0x0543('0x1a')](_0x27290d)[_0x0543('0x1b')]();};}function respondWithResult(_0x552980,_0x4f1f2a){_0x4f1f2a=_0x4f1f2a||0xc8;return function(_0x21e9ac){if(_0x21e9ac){return _0x552980['status'](_0x4f1f2a)['json'](_0x21e9ac);}};}function respondWithFilteredResult(_0xcb09df,_0x40fb03){return function(_0x1dff7d){if(_0x1dff7d){var _0x1cfadf=typeof _0x40fb03[_0x0543('0x1c')]==='undefined'&&typeof _0x40fb03[_0x0543('0x1d')]===_0x0543('0x1e');var _0x2dd5cb=_0x1dff7d[_0x0543('0x1f')];var _0x20b396=_0x1cfadf?0x0:_0x40fb03[_0x0543('0x1c')];var _0x577cf0=_0x1cfadf?_0x1dff7d['count']:_0x40fb03[_0x0543('0x1c')]+_0x40fb03['limit'];var _0x50ea84;if(_0x577cf0>=_0x2dd5cb){_0x577cf0=_0x2dd5cb;_0x50ea84=0xc8;}else{_0x50ea84=0xce;}_0xcb09df[_0x0543('0x1a')](_0x50ea84);return _0xcb09df[_0x0543('0x20')](_0x0543('0x21'),_0x20b396+'-'+_0x577cf0+'/'+_0x2dd5cb)['json'](_0x1dff7d);}return null;};}function patchUpdates(_0x3f0452){return function(_0x51c271){try{jsonpatch[_0x0543('0x22')](_0x51c271,_0x3f0452,!![]);}catch(_0x411ec2){return BPromise['reject'](_0x411ec2);}return _0x51c271[_0x0543('0x23')]();};}function saveUpdates(_0x333c72,_0x427919){return function(_0x110060){if(_0x110060){return _0x110060[_0x0543('0x24')](_0x333c72)[_0x0543('0x25')](function(_0x4adba7){return _0x4adba7;});}return null;};}function removeEntity(_0x5979d2,_0x59f1b2){return function(_0xbfe5dc){if(_0xbfe5dc){return _0xbfe5dc[_0x0543('0x26')]()[_0x0543('0x25')](function(){_0x5979d2[_0x0543('0x1a')](0xcc)[_0x0543('0x1b')]();});}};}function handleEntityNotFound(_0x26e500,_0x36d824){return function(_0x17a3de){if(!_0x17a3de){_0x26e500[_0x0543('0x19')](0x194);}return _0x17a3de;};}function handleError(_0xf1eccf,_0x40a261){_0x40a261=_0x40a261||0x1f4;return function(_0x21fc63){logger['error'](_0x21fc63[_0x0543('0x27')]);if(_0x21fc63[_0x0543('0x28')]){delete _0x21fc63[_0x0543('0x28')];}_0xf1eccf['status'](_0x40a261)[_0x0543('0x29')](_0x21fc63);};}exports[_0x0543('0x2a')]=function(_0x41c4a7,_0x10b881){var _0x5dd789={},_0x1732be={},_0x10b9f3={'count':0x0,'rows':[]};var _0x492f60=_['map'](db[_0x0543('0x2b')][_0x0543('0x2c')],function(_0x51d49d){return{'name':_0x51d49d[_0x0543('0x2d')],'type':_0x51d49d[_0x0543('0x2e')][_0x0543('0x2f')]};});_0x1732be[_0x0543('0x30')]=_[_0x0543('0x31')](_0x492f60,_0x0543('0x28'));_0x1732be[_0x0543('0x32')]=_['keys'](_0x41c4a7[_0x0543('0x32')]);_0x1732be['filters']=_[_0x0543('0x33')](_0x1732be[_0x0543('0x30')],_0x1732be[_0x0543('0x32')]);_0x5dd789[_0x0543('0x34')]=_[_0x0543('0x33')](_0x1732be['model'],qs[_0x0543('0x35')](_0x41c4a7['query'][_0x0543('0x35')]));_0x5dd789[_0x0543('0x34')]=_0x5dd789[_0x0543('0x34')][_0x0543('0x36')]?_0x5dd789['attributes']:_0x1732be[_0x0543('0x30')];if(!_0x41c4a7['query'][_0x0543('0x37')](_0x0543('0x38'))){_0x5dd789[_0x0543('0x1d')]=qs[_0x0543('0x1d')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1d')]);_0x5dd789[_0x0543('0x1c')]=qs[_0x0543('0x1c')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1c')]);}_0x5dd789['order']=qs[_0x0543('0x39')](_0x41c4a7[_0x0543('0x32')]['sort']);_0x5dd789[_0x0543('0x3a')]=qs['filters'](_[_0x0543('0x3b')](_0x41c4a7[_0x0543('0x32')],_0x1732be['filters']),_0x492f60);if(_0x41c4a7['query'][_0x0543('0x3c')]){_0x5dd789[_0x0543('0x3a')]=_['merge'](_0x5dd789[_0x0543('0x3a')],{'$or':_[_0x0543('0x31')](_0x492f60,function(_0x54543f){if(_0x54543f[_0x0543('0x2e')]!==_0x0543('0x3d')){var _0x3ecd70={};_0x3ecd70[_0x54543f[_0x0543('0x28')]]={'$like':'%'+_0x41c4a7[_0x0543('0x32')]['filter']+'%'};return _0x3ecd70;}})});}_0x5dd789=_['merge']({},_0x5dd789,_0x41c4a7['options']);var _0x486d9c={'where':_0x5dd789[_0x0543('0x3a')]};return db[_0x0543('0x2b')][_0x0543('0x1f')](_0x486d9c)['then'](function(_0xc66396){_0x10b9f3[_0x0543('0x1f')]=_0xc66396;if(_0x41c4a7[_0x0543('0x32')][_0x0543('0x3e')]){_0x5dd789[_0x0543('0x3f')]=[{'all':!![]}];}return db[_0x0543('0x2b')][_0x0543('0x40')](_0x5dd789);})['then'](function(_0x24a891){_0x10b9f3[_0x0543('0x41')]=_0x24a891;return _0x10b9f3;})[_0x0543('0x25')](respondWithFilteredResult(_0x10b881,_0x5dd789))[_0x0543('0x42')](handleError(_0x10b881,null));};exports[_0x0543('0x43')]=function(_0x43b7e8,_0x5bf53d){var _0x53dfb8={'raw':!![],'where':{'id':_0x43b7e8[_0x0543('0x44')]['id']}},_0x44116a={};_0x44116a[_0x0543('0x30')]=_[_0x0543('0x45')](db[_0x0543('0x2b')][_0x0543('0x2c')]);_0x44116a[_0x0543('0x32')]=_[_0x0543('0x45')](_0x43b7e8[_0x0543('0x32')]);_0x44116a['filters']=_['intersection'](_0x44116a[_0x0543('0x30')],_0x44116a[_0x0543('0x32')]);_0x53dfb8['attributes']=_['intersection'](_0x44116a[_0x0543('0x30')],qs[_0x0543('0x35')](_0x43b7e8['query'][_0x0543('0x35')]));_0x53dfb8['attributes']=_0x53dfb8[_0x0543('0x34')][_0x0543('0x36')]?_0x53dfb8['attributes']:_0x44116a['model'];if(_0x43b7e8[_0x0543('0x32')]['includeAll']){_0x53dfb8[_0x0543('0x3f')]=[{'all':!![]}];}_0x53dfb8=_[_0x0543('0x46')]({},_0x53dfb8,_0x43b7e8[_0x0543('0x47')]);return db[_0x0543('0x2b')][_0x0543('0x48')](_0x53dfb8)[_0x0543('0x25')](handleEntityNotFound(_0x5bf53d,null))['then'](respondWithResult(_0x5bf53d,null))[_0x0543('0x42')](handleError(_0x5bf53d,null));};exports[_0x0543('0x49')]=function(_0xb8076c,_0xf0a28f){return db[_0x0543('0x2b')]['create'](_0xb8076c[_0x0543('0x4a')],{})['then'](respondWithResult(_0xf0a28f,0xc9))[_0x0543('0x42')](handleError(_0xf0a28f,null));};exports[_0x0543('0x24')]=function(_0x3f4c40,_0x46d398){if(_0x3f4c40[_0x0543('0x4a')]['id']){delete _0x3f4c40[_0x0543('0x4a')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x3f4c40['params']['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x46d398,null))[_0x0543('0x25')](saveUpdates(_0x3f4c40['body'],null))[_0x0543('0x25')](respondWithResult(_0x46d398,null))[_0x0543('0x42')](handleError(_0x46d398,null));};exports[_0x0543('0x26')]=function(_0x3d3bfc,_0x90dd22){return db[_0x0543('0x2b')]['find']({'where':{'id':_0x3d3bfc[_0x0543('0x44')]['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x90dd22,null))[_0x0543('0x25')](removeEntity(_0x90dd22,null))[_0x0543('0x42')](handleError(_0x90dd22,null));};exports[_0x0543('0x4b')]=function(_0x449150,_0x265bc1){return db[_0x0543('0x2b')][_0x0543('0x4b')]()[_0x0543('0x25')](respondWithResult(_0x265bc1,null))[_0x0543('0x42')](handleError(_0x265bc1,null));}; \ No newline at end of file +var _0x9582=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x2d7bc9,_0x4c4c3b){var _0x28ba8e=function(_0x548080){while(--_0x548080){_0x2d7bc9['push'](_0x2d7bc9['shift']());}};_0x28ba8e(++_0x4c4c3b);}(_0x9582,0x95));var _0x2958=function(_0x3ce8c6,_0x564b9a){_0x3ce8c6=_0x3ce8c6-0x0;var _0x4e26e1=_0x9582[_0x3ce8c6];return _0x4e26e1;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':!![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));};exports[_0x2958('0x4b')]=function(_0x1db8b1,_0x534677){return db['MailQueueReport'][_0x2958('0x4b')]()[_0x2958('0x25')](respondWithResult(_0x534677,null))[_0x2958('0x44')](handleError(_0x534677,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 54b55d3..9a69255 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 _0x43b1=['api','moment','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x5d1d9f,_0x1ef696){var _0x2faa8e=function(_0x13f5ae){while(--_0x13f5ae){_0x5d1d9f['push'](_0x5d1d9f['shift']());}};_0x2faa8e(++_0x1ef696);}(_0x43b1,0xb3));var _0x143b=function(_0x2fdca6,_0x2d232a){_0x2fdca6=_0x2fdca6-0x0;var _0x4ac2db=_0x43b1[_0x2fdca6];return _0x4ac2db;};'use strict';var _=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var logger=require(_0x143b('0x2'))(_0x143b('0x3'));var moment=require(_0x143b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x143b('0x5'));var rimraf=require(_0x143b('0x6'));var config=require(_0x143b('0x7'));var attributes=require(_0x143b('0x8'));module[_0x143b('0x9')]=function(_0x56924c,_0x4c0020){return _0x56924c[_0x143b('0xa')]('MailQueueReport',attributes,{'tableName':_0x143b('0xb'),'paranoid':![],'indexes':[{'name':_0x143b('0xc'),'fields':[_0x143b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bf6=['api','moment','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0xb0daef,_0xefb45b){var _0x433e97=function(_0x42bf8c){while(--_0x42bf8c){_0xb0daef['push'](_0xb0daef['shift']());}};_0x433e97(++_0xefb45b);}(_0x4bf6,0xcb));var _0x64bf=function(_0x4875b7,_0x242853){_0x4875b7=_0x4875b7-0x0;var _0x38e290=_0x4bf6[_0x4875b7];return _0x38e290;};'use strict';var _=require('lodash');var util=require(_0x64bf('0x0'));var logger=require('../../config/logger')(_0x64bf('0x1'));var moment=require(_0x64bf('0x2'));var BPromise=require(_0x64bf('0x3'));var rp=require(_0x64bf('0x4'));var fs=require('fs');var path=require(_0x64bf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64bf('0x6'));module[_0x64bf('0x7')]=function(_0xc25de3,_0x105526){return _0xc25de3[_0x64bf('0x8')](_0x64bf('0x9'),attributes,{'tableName':_0x64bf('0xa'),'paranoid':![],'indexes':[{'name':_0x64bf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3d0cd12..e683567 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x2000fe,_0x5ac8ee){var _0x10230a=function(_0x5eec59){while(--_0x5eec59){_0x2000fe['push'](_0x2000fe['shift']());}};_0x10230a(++_0x5ac8ee);}(_0x7a54,0x106));var _0x47a5=function(_0x228e86,_0x29265d){_0x228e86=_0x228e86-0x0;var _0x3a6acd=_0x7a54[_0x228e86];return _0x3a6acd;};'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')]('MailQueueReport,\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);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x158495,_0x40907b){var _0x3c0cad=function(_0x2e3ed5){while(--_0x2e3ed5){_0x158495['push'](_0x158495['shift']());}};_0x3c0cad(++_0x40907b);}(_0x7a54,0x106));var _0x47a5=function(_0x543bd1,_0x4c1875){_0x543bd1=_0x543bd1-0x0;var _0x2280c4=_0x7a54[_0x543bd1];return _0x2280c4;};'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')]('MailQueueReport,\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);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index bcaf6f5..c948c76 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x548124,_0xa5e910){var _0x4d45aa=function(_0x1a424c){while(--_0x1a424c){_0x548124['push'](_0x548124['shift']());}};_0x4d45aa(++_0xa5e910);}(_0x70e0,0x17b));var _0x070e=function(_0x562181,_0xc9f3){_0x562181=_0x562181-0x0;var _0x212aa0=_0x70e0[_0x562181];return _0x212aa0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x213ae6,_0x37be6c){var _0x1b0e06=function(_0x1cda48){while(--_0x1cda48){_0x213ae6['push'](_0x213ae6['shift']());}};_0x1b0e06(++_0x37be6c);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b4dd4d2..68bc82d 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 _0x75a9=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0x75a9,0x1ef));var _0x975a=function(_0x269d8a,_0x4bf661){_0x269d8a=_0x269d8a-0x0;var _0x1d0244=_0x75a9[_0x269d8a];return _0x1d0244;};'use strict';var Sequelize=require(_0x975a('0x0'));module['exports']={'description':{'type':Sequelize[_0x975a('0x1')]},'host':{'type':Sequelize[_0x975a('0x1')]},'authentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x975a('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x975a('0x3')]},'tls':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x975a('0x1')],'defaultValue':_0x975a('0x4')},'connTimeout':{'type':Sequelize[_0x975a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x975a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf87d=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x91ff52,_0x2cde3c){var _0x37d193=function(_0x5cb450){while(--_0x5cb450){_0x91ff52['push'](_0x91ff52['shift']());}};_0x37d193(++_0x2cde3c);}(_0xf87d,0xc1));var _0xdf87=function(_0x123210,_0x2cca73){_0x123210=_0x123210-0x0;var _0x1e9e00=_0xf87d[_0x123210];return _0x1e9e00;};'use strict';var Sequelize=require(_0xdf87('0x0'));module[_0xdf87('0x1')]={'description':{'type':Sequelize[_0xdf87('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xdf87('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xdf87('0x2')]},'password':{'type':Sequelize[_0xdf87('0x2')]},'port':{'type':Sequelize[_0xdf87('0x4')]},'tls':{'type':Sequelize[_0xdf87('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xdf87('0x2')],'defaultValue':_0xdf87('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xdf87('0x2')]},'modernAuthentication':{'type':Sequelize[_0xdf87('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 162d609..5e59780 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 _0x71ff=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','lodash','util'];(function(_0x48eeab,_0xc3788){var _0x54f1eb=function(_0xcfc86a){while(--_0xcfc86a){_0x48eeab['push'](_0x48eeab['shift']());}};_0x54f1eb(++_0xc3788);}(_0x71ff,0x18a));var _0xf71f=function(_0x372641,_0x407f21){_0x372641=_0x372641-0x0;var _0x11824b=_0x71ff[_0x372641];return _0x11824b;};'use strict';var _=require(_0xf71f('0x0'));var util=require(_0xf71f('0x1'));var logger=require(_0xf71f('0x2'))('api');var moment=require(_0xf71f('0x3'));var BPromise=require(_0xf71f('0x4'));var rp=require(_0xf71f('0x5'));var fs=require('fs');var path=require(_0xf71f('0x6'));var rimraf=require(_0xf71f('0x7'));var config=require(_0xf71f('0x8'));var attributes=require(_0xf71f('0x9'));module[_0xf71f('0xa')]=function(_0x20d9c1,_0x54cb65){return _0x20d9c1['define'](_0xf71f('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa23a=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4101a6,_0x7dc814){var _0x146f2a=function(_0x3f1ef1){while(--_0x3f1ef1){_0x4101a6['push'](_0x4101a6['shift']());}};_0x146f2a(++_0x7dc814);}(_0xa23a,0xab));var _0xaa23=function(_0x5aef12,_0x1edd9d){_0x5aef12=_0x5aef12-0x0;var _0x245089=_0xa23a[_0x5aef12];return _0x245089;};'use strict';var _=require(_0xaa23('0x0'));var util=require(_0xaa23('0x1'));var logger=require(_0xaa23('0x2'))(_0xaa23('0x3'));var moment=require(_0xaa23('0x4'));var BPromise=require(_0xaa23('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa23('0x6'));var rimraf=require(_0xaa23('0x7'));var config=require(_0xaa23('0x8'));var attributes=require('./mailServerIn.attributes');module[_0xaa23('0x9')]=function(_0x2e39ce,_0xbd4d38){return _0x2e39ce[_0xaa23('0xa')](_0xaa23('0xb'),attributes,{'tableName':_0xaa23('0xc'),'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 eeae418..39c7f9a 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 _0x5c7c=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','lodash','moment','bluebird','randomstring','ioredis'];(function(_0xe06dfd,_0x553a8b){var _0x35a4c3=function(_0x390aa2){while(--_0x390aa2){_0xe06dfd['push'](_0xe06dfd['shift']());}};_0x35a4c3(++_0x553a8b);}(_0x5c7c,0xe2));var _0xc5c7=function(_0x417ea3,_0x156e87){_0x417ea3=_0x417ea3-0x0;var _0x18c29d=_0x5c7c[_0x417ea3];return _0x18c29d;};'use strict';var _=require(_0xc5c7('0x0'));var util=require('util');var moment=require(_0xc5c7('0x1'));var BPromise=require(_0xc5c7('0x2'));var rs=require(_0xc5c7('0x3'));var fs=require('fs');var Redis=require(_0xc5c7('0x4'));var db=require(_0xc5c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5c7('0x6'))(_0xc5c7('0x7'));var config=require(_0xc5c7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc5c7('0x9')][_0xc5c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d70c1,_0x18ba87,_0x1c0e31){return new BPromise(function(_0x1ab3f7,_0xb722db){return client[_0xc5c7('0xb')](_0x3d70c1,_0x1c0e31)[_0xc5c7('0xc')](function(_0x335360){logger['info']('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0xc5c7('0xd'));logger[_0xc5c7('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x18ba87,'request\x20sent',JSON['stringify'](_0x335360));if(_0x335360[_0xc5c7('0xf')]){if(_0x335360[_0xc5c7('0xf')][_0xc5c7('0x10')]===0x1f4){logger[_0xc5c7('0xf')](_0xc5c7('0x11'),_0x18ba87,_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);return _0xb722db(_0x335360[_0xc5c7('0xf')]['message']);}logger[_0xc5c7('0xf')]('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);return _0x1ab3f7(_0x335360[_0xc5c7('0xf')][_0xc5c7('0x12')]);}else{logger[_0xc5c7('0x13')](_0xc5c7('0x11'),_0x18ba87,_0xc5c7('0xd'));_0x1ab3f7(_0x335360[_0xc5c7('0x14')]['message']);}})[_0xc5c7('0x15')](function(_0x16826b){logger[_0xc5c7('0xf')]('MailServerIn,\x20%s,\x20%s',_0x18ba87,_0x16826b);_0xb722db(_0x16826b);});});}exports['GetMailServerIn']=function(_0x1db6b3){var _0x22b6f0=this;return new Promise(function(_0x1f0aee,_0x4dd517){return db[_0xc5c7('0x16')][_0xc5c7('0x17')]({'raw':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3['options'][_0xc5c7('0x19')]===undefined?!![]:![]:!![],'where':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1a')]||null:null,'attributes':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1b')]||null:null,'limit':_0x1db6b3[_0xc5c7('0x18')]?_0x1db6b3['options'][_0xc5c7('0x1c')]||null:null,'include':_0x1db6b3['options']?_0x1db6b3[_0xc5c7('0x18')][_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x1db6b3[_0xc5c7('0x18')]['include'],function(_0x10fe26){return{'model':db[_0x10fe26[_0xc5c7('0x1f')]],'as':_0x10fe26['as'],'attributes':_0x10fe26[_0xc5c7('0x1b')],'include':_0x10fe26[_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x10fe26[_0xc5c7('0x1d')],function(_0x48a623){return{'model':db[_0x48a623['model']],'as':_0x48a623['as'],'attributes':_0x48a623['attributes'],'include':_0x48a623[_0xc5c7('0x1d')]?_[_0xc5c7('0x1e')](_0x48a623[_0xc5c7('0x1d')],function(_0x4a509e){return{'model':db[_0x4a509e[_0xc5c7('0x1f')]],'as':_0x4a509e['as'],'attributes':_0x4a509e[_0xc5c7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc5c7('0xc')](function(_0x515789){logger[_0xc5c7('0x13')](_0xc5c7('0x20'),_0x1db6b3);logger[_0xc5c7('0xe')](_0xc5c7('0x20'),_0x1db6b3,JSON['stringify'](_0x515789));_0x1f0aee(_0x515789);})['catch'](function(_0x13ff18){logger[_0xc5c7('0xf')](_0xc5c7('0x20'),_0x13ff18['message'],_0x1db6b3);_0x4dd517(_0x22b6f0[_0xc5c7('0xf')](0x1f4,_0x13ff18[_0xc5c7('0x12')]));});});}; \ No newline at end of file +var _0x77f4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','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','model','map','include','lodash','util','moment'];(function(_0x3cf0c1,_0x266733){var _0x2475ef=function(_0x1d09a5){while(--_0x1d09a5){_0x3cf0c1['push'](_0x3cf0c1['shift']());}};_0x2475ef(++_0x266733);}(_0x77f4,0x1a1));var _0x477f=function(_0x34a97b,_0x34a373){_0x34a97b=_0x34a97b-0x0;var _0x3c2c23=_0x77f4[_0x34a97b];return _0x3c2c23;};'use strict';var _=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var moment=require(_0x477f('0x2'));var BPromise=require(_0x477f('0x3'));var rs=require(_0x477f('0x4'));var fs=require('fs');var Redis=require(_0x477f('0x5'));var db=require(_0x477f('0x6'))['db'];var utils=require(_0x477f('0x7'));var logger=require('../../config/logger')(_0x477f('0x8'));var config=require('../../config/environment');var jayson=require(_0x477f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16eb7d,_0x56912c,_0x16fa8d){return new BPromise(function(_0x462569,_0x1c3100){return client[_0x477f('0xa')](_0x16eb7d,_0x16fa8d)['then'](function(_0x4f60ca){logger[_0x477f('0xb')](_0x477f('0xc'),_0x56912c,'request\x20sent');logger[_0x477f('0xd')](_0x477f('0xe'),_0x56912c,_0x477f('0xf'),JSON[_0x477f('0x10')](_0x4f60ca));if(_0x4f60ca[_0x477f('0x11')]){if(_0x4f60ca[_0x477f('0x11')]['code']===0x1f4){logger[_0x477f('0x11')](_0x477f('0xc'),_0x56912c,_0x4f60ca['error'][_0x477f('0x12')]);return _0x1c3100(_0x4f60ca['error']['message']);}logger[_0x477f('0x11')](_0x477f('0xc'),_0x56912c,_0x4f60ca[_0x477f('0x11')][_0x477f('0x12')]);return _0x462569(_0x4f60ca[_0x477f('0x11')][_0x477f('0x12')]);}else{logger['info'](_0x477f('0xc'),_0x56912c,_0x477f('0xf'));_0x462569(_0x4f60ca['result'][_0x477f('0x12')]);}})[_0x477f('0x13')](function(_0x230a2f){logger['error'](_0x477f('0xc'),_0x56912c,_0x230a2f);_0x1c3100(_0x230a2f);});});}exports[_0x477f('0x14')]=function(_0x1f92cc){var _0x215719=this;return new Promise(function(_0x48fe64,_0x124d10){return db[_0x477f('0x15')][_0x477f('0x16')]({'raw':_0x1f92cc[_0x477f('0x17')]?_0x1f92cc[_0x477f('0x17')][_0x477f('0x18')]===undefined?!![]:![]:!![],'where':_0x1f92cc[_0x477f('0x17')]?_0x1f92cc[_0x477f('0x17')][_0x477f('0x19')]||null:null,'attributes':_0x1f92cc[_0x477f('0x17')]?_0x1f92cc['options'][_0x477f('0x1a')]||null:null,'limit':_0x1f92cc['options']?_0x1f92cc['options']['limit']||null:null,'include':_0x1f92cc[_0x477f('0x17')]?_0x1f92cc[_0x477f('0x17')]['include']?_['map'](_0x1f92cc[_0x477f('0x17')]['include'],function(_0x28a355){return{'model':db[_0x28a355[_0x477f('0x1b')]],'as':_0x28a355['as'],'attributes':_0x28a355[_0x477f('0x1a')],'include':_0x28a355['include']?_[_0x477f('0x1c')](_0x28a355[_0x477f('0x1d')],function(_0x296347){return{'model':db[_0x296347[_0x477f('0x1b')]],'as':_0x296347['as'],'attributes':_0x296347[_0x477f('0x1a')],'include':_0x296347['include']?_[_0x477f('0x1c')](_0x296347['include'],function(_0x59d5f7){return{'model':db[_0x59d5f7[_0x477f('0x1b')]],'as':_0x59d5f7['as'],'attributes':_0x59d5f7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52f4ed){logger[_0x477f('0xb')](_0x477f('0x14'),_0x1f92cc);logger[_0x477f('0xd')](_0x477f('0x14'),_0x1f92cc,JSON[_0x477f('0x10')](_0x52f4ed));_0x48fe64(_0x52f4ed);})[_0x477f('0x13')](function(_0x3b9db0){logger[_0x477f('0x11')](_0x477f('0x14'),_0x3b9db0[_0x477f('0x12')],_0x1f92cc);_0x124d10(_0x215719[_0x477f('0x11')](0x1f4,_0x3b9db0[_0x477f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 659d5fa..6403ef1 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x1186d6,_0x638a46){_0x1186d6=_0x1186d6-0x0;var _0x580033=_0x7a54[_0x1186d6];return _0x580033;};'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 fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x45c646,_0x386de2){_0x45c646=_0x45c646-0x0;var _0x1ddaf1=_0x7a54[_0x45c646];return _0x1ddaf1;};'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 fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index d335291..2de765f 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 _0x3266=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x376430,_0x5265e3){var _0x2b7b2a=function(_0xce1a88){while(--_0xce1a88){_0x376430['push'](_0x376430['shift']());}};_0x2b7b2a(++_0x5265e3);}(_0x3266,0x6a));var _0x6326=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x3266[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'description':{'type':Sequelize[_0x6326('0x2')]},'host':{'type':Sequelize[_0x6326('0x2')]},'user':{'type':Sequelize[_0x6326('0x2')]},'pass':{'type':Sequelize[_0x6326('0x2')]},'port':{'type':Sequelize[_0x6326('0x3')]},'secure':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6326('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x97c1=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5d9762,_0x174292){var _0x1c1628=function(_0x3dc4fe){while(--_0x3dc4fe){_0x5d9762['push'](_0x5d9762['shift']());}};_0x1c1628(++_0x174292);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x197c('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x197c('0x3')]},'secure':{'type':Sequelize[_0x197c('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x197c('0x2')]},'authentication':{'type':Sequelize[_0x197c('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x197c('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 2be395c..2de023d 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 _0x5472=['destroy','error','stack','name','index','MailServerOut','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','findAll','rows','catch','includeAll','include','create','update','body','find','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then'];(function(_0x188a99,_0x3be0b3){var _0x48e993=function(_0xa0609d){while(--_0xa0609d){_0x188a99['push'](_0x188a99['shift']());}};_0x48e993(++_0x3be0b3);}(_0x5472,0x6b));var _0x2547=function(_0x159b6b,_0x52d23f){_0x159b6b=_0x159b6b-0x0;var _0x2dceb3=_0x5472[_0x159b6b];return _0x2dceb3;};'use strict';var emlformat=require(_0x2547('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2547('0x1'));var jsonpatch=require(_0x2547('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2547('0x3'));var Mustache=require(_0x2547('0x4'));var util=require(_0x2547('0x5'));var path=require(_0x2547('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2547('0x7'));var fs=require('fs');var fs_extra=require(_0x2547('0x8'));var _=require(_0x2547('0x9'));var squel=require(_0x2547('0xa'));var crypto=require(_0x2547('0xb'));var jsforce=require(_0x2547('0xc'));var deskjs=require(_0x2547('0xd'));var toCsv=require(_0x2547('0xe'));var querystring=require(_0x2547('0xf'));var Papa=require(_0x2547('0x10'));var Redis=require(_0x2547('0x11'));var authService=require(_0x2547('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2547('0x13'));var logger=require(_0x2547('0x14'))(_0x2547('0x15'));var utils=require(_0x2547('0x16'));var config=require(_0x2547('0x17'));var licenseUtil=require(_0x2547('0x18'));var db=require(_0x2547('0x19'))['db'];function respondWithStatusCode(_0x5407b1,_0x33d614){_0x33d614=_0x33d614||0xcc;return function(_0x59d0b3){if(_0x59d0b3){return _0x5407b1['sendStatus'](_0x33d614);}return _0x5407b1[_0x2547('0x1a')](_0x33d614)[_0x2547('0x1b')]();};}function respondWithResult(_0x2f2868,_0x18bb89){_0x18bb89=_0x18bb89||0xc8;return function(_0x5dc2e2){if(_0x5dc2e2){return _0x2f2868[_0x2547('0x1a')](_0x18bb89)['json'](_0x5dc2e2);}};}function respondWithFilteredResult(_0x395af5,_0x5ae963){return function(_0x33ab1a){if(_0x33ab1a){var _0x16a650=typeof _0x5ae963[_0x2547('0x1c')]===_0x2547('0x1d')&&typeof _0x5ae963[_0x2547('0x1e')]===_0x2547('0x1d');var _0x3727b0=_0x33ab1a[_0x2547('0x1f')];var _0x3d5aef=_0x16a650?0x0:_0x5ae963[_0x2547('0x1c')];var _0x4eed29=_0x16a650?_0x33ab1a[_0x2547('0x1f')]:_0x5ae963[_0x2547('0x1c')]+_0x5ae963[_0x2547('0x1e')];var _0x1d318e;if(_0x4eed29>=_0x3727b0){_0x4eed29=_0x3727b0;_0x1d318e=0xc8;}else{_0x1d318e=0xce;}_0x395af5['status'](_0x1d318e);return _0x395af5[_0x2547('0x20')](_0x2547('0x21'),_0x3d5aef+'-'+_0x4eed29+'/'+_0x3727b0)[_0x2547('0x22')](_0x33ab1a);}return null;};}function patchUpdates(_0x59053f){return function(_0x49f8fd){try{jsonpatch[_0x2547('0x23')](_0x49f8fd,_0x59053f,!![]);}catch(_0x1592d9){return BPromise['reject'](_0x1592d9);}return _0x49f8fd['save']();};}function saveUpdates(_0x480b68,_0x2bcbcf){return function(_0x56f511){if(_0x56f511){return _0x56f511['update'](_0x480b68)[_0x2547('0x24')](function(_0xd0010){return _0xd0010;});}return null;};}function removeEntity(_0x43ccad,_0x18a770){return function(_0x21ebbb){if(_0x21ebbb){return _0x21ebbb[_0x2547('0x25')]()[_0x2547('0x24')](function(){_0x43ccad[_0x2547('0x1a')](0xcc)[_0x2547('0x1b')]();});}};}function handleEntityNotFound(_0x104578,_0x36fb48){return function(_0x353e2c){if(!_0x353e2c){_0x104578['sendStatus'](0x194);}return _0x353e2c;};}function handleError(_0x403bcf,_0x3d20c7){_0x3d20c7=_0x3d20c7||0x1f4;return function(_0x468752){logger[_0x2547('0x26')](_0x468752[_0x2547('0x27')]);if(_0x468752[_0x2547('0x28')]){delete _0x468752[_0x2547('0x28')];}_0x403bcf['status'](_0x3d20c7)['send'](_0x468752);};}exports[_0x2547('0x29')]=function(_0x22a79f,_0x235b34){var _0x5ee800={},_0x14489c={},_0x114342={'count':0x0,'rows':[]};var _0x4a278a=_['map'](db[_0x2547('0x2a')][_0x2547('0x2b')],function(_0x2682aa){return{'name':_0x2682aa['fieldName'],'type':_0x2682aa[_0x2547('0x2c')][_0x2547('0x2d')]};});_0x14489c[_0x2547('0x2e')]=_[_0x2547('0x2f')](_0x4a278a,_0x2547('0x28'));_0x14489c[_0x2547('0x30')]=_[_0x2547('0x31')](_0x22a79f[_0x2547('0x30')]);_0x14489c[_0x2547('0x32')]=_['intersection'](_0x14489c['model'],_0x14489c[_0x2547('0x30')]);_0x5ee800['attributes']=_[_0x2547('0x33')](_0x14489c['model'],qs[_0x2547('0x34')](_0x22a79f[_0x2547('0x30')][_0x2547('0x34')]));_0x5ee800[_0x2547('0x35')]=_0x5ee800[_0x2547('0x35')]['length']?_0x5ee800['attributes']:_0x14489c[_0x2547('0x2e')];if(!_0x22a79f[_0x2547('0x30')][_0x2547('0x36')](_0x2547('0x37'))){_0x5ee800[_0x2547('0x1e')]=qs[_0x2547('0x1e')](_0x22a79f['query'][_0x2547('0x1e')]);_0x5ee800[_0x2547('0x1c')]=qs['offset'](_0x22a79f[_0x2547('0x30')][_0x2547('0x1c')]);}_0x5ee800[_0x2547('0x38')]=qs[_0x2547('0x39')](_0x22a79f[_0x2547('0x30')][_0x2547('0x39')]);_0x5ee800[_0x2547('0x3a')]=qs['filters'](_[_0x2547('0x3b')](_0x22a79f[_0x2547('0x30')],_0x14489c[_0x2547('0x32')]),_0x4a278a);if(_0x22a79f[_0x2547('0x30')]['filter']){_0x5ee800[_0x2547('0x3a')]=_[_0x2547('0x3c')](_0x5ee800[_0x2547('0x3a')],{'$or':_[_0x2547('0x2f')](_0x4a278a,function(_0x219d10){if(_0x219d10['type']!=='VIRTUAL'){var _0x885575={};_0x885575[_0x219d10[_0x2547('0x28')]]={'$like':'%'+_0x22a79f[_0x2547('0x30')]['filter']+'%'};return _0x885575;}})});}_0x5ee800=_[_0x2547('0x3c')]({},_0x5ee800,_0x22a79f[_0x2547('0x3d')]);var _0x10d99c={'where':_0x5ee800[_0x2547('0x3a')]};return db['MailServerOut'][_0x2547('0x1f')](_0x10d99c)['then'](function(_0x46d3de){_0x114342[_0x2547('0x1f')]=_0x46d3de;if(_0x22a79f[_0x2547('0x30')]['includeAll']){_0x5ee800['include']=[{'all':!![]}];}return db[_0x2547('0x2a')][_0x2547('0x3e')](_0x5ee800);})['then'](function(_0x35cc99){_0x114342[_0x2547('0x3f')]=_0x35cc99;return _0x114342;})[_0x2547('0x24')](respondWithFilteredResult(_0x235b34,_0x5ee800))[_0x2547('0x40')](handleError(_0x235b34,null));};exports['show']=function(_0x20671d,_0x587a7d){var _0x42cd64={'raw':!![],'where':{'id':_0x20671d['params']['id']}},_0x53e1a3={};_0x53e1a3[_0x2547('0x2e')]=_[_0x2547('0x31')](db['MailServerOut'][_0x2547('0x2b')]);_0x53e1a3[_0x2547('0x30')]=_[_0x2547('0x31')](_0x20671d[_0x2547('0x30')]);_0x53e1a3[_0x2547('0x32')]=_['intersection'](_0x53e1a3['model'],_0x53e1a3[_0x2547('0x30')]);_0x42cd64[_0x2547('0x35')]=_[_0x2547('0x33')](_0x53e1a3[_0x2547('0x2e')],qs[_0x2547('0x34')](_0x20671d['query'][_0x2547('0x34')]));_0x42cd64['attributes']=_0x42cd64[_0x2547('0x35')]['length']?_0x42cd64[_0x2547('0x35')]:_0x53e1a3['model'];if(_0x20671d[_0x2547('0x30')][_0x2547('0x41')]){_0x42cd64[_0x2547('0x42')]=[{'all':!![]}];}_0x42cd64=_['merge']({},_0x42cd64,_0x20671d[_0x2547('0x3d')]);return db[_0x2547('0x2a')]['find'](_0x42cd64)[_0x2547('0x24')](handleEntityNotFound(_0x587a7d,null))[_0x2547('0x24')](respondWithResult(_0x587a7d,null))['catch'](handleError(_0x587a7d,null));};exports[_0x2547('0x43')]=function(_0x3cc9ef,_0x98c84d){return db['MailServerOut'][_0x2547('0x43')](_0x3cc9ef['body'],{})[_0x2547('0x24')](respondWithResult(_0x98c84d,0xc9))[_0x2547('0x40')](handleError(_0x98c84d,null));};exports[_0x2547('0x44')]=function(_0x10eb68,_0x347e6c){if(_0x10eb68[_0x2547('0x45')]['id']){delete _0x10eb68['body']['id'];}return db[_0x2547('0x2a')][_0x2547('0x46')]({'where':{'id':_0x10eb68[_0x2547('0x47')]['id']}})['then'](handleEntityNotFound(_0x347e6c,null))[_0x2547('0x24')](saveUpdates(_0x10eb68[_0x2547('0x45')],null))[_0x2547('0x24')](respondWithResult(_0x347e6c,null))[_0x2547('0x40')](handleError(_0x347e6c,null));};exports[_0x2547('0x25')]=function(_0x4cefb5,_0x1e3580){return db[_0x2547('0x2a')][_0x2547('0x46')]({'where':{'id':_0x4cefb5[_0x2547('0x47')]['id']}})[_0x2547('0x24')](handleEntityNotFound(_0x1e3580,null))[_0x2547('0x24')](removeEntity(_0x1e3580,null))[_0x2547('0x40')](handleError(_0x1e3580,null));}; \ No newline at end of file +var _0x8e93=['Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','moment','bluebird','util','to-csv','fs-extra','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit'];(function(_0x26d4c8,_0xc9496b){var _0x5f0eb9=function(_0x538cd7){while(--_0x538cd7){_0x26d4c8['push'](_0x26d4c8['shift']());}};_0x5f0eb9(++_0xc9496b);}(_0x8e93,0x108));var _0x38e9=function(_0x3bcb43,_0x402ff8){_0x3bcb43=_0x3bcb43-0x0;var _0x255ff1=_0x8e93[_0x3bcb43];return _0x255ff1;};'use strict';var emlformat=require(_0x38e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x38e9('0x2'));var BPromise=require(_0x38e9('0x3'));var Mustache=require('mustache');var util=require(_0x38e9('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x38e9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e9('0x6'));var _=require(_0x38e9('0x7'));var squel=require(_0x38e9('0x8'));var crypto=require(_0x38e9('0x9'));var jsforce=require(_0x38e9('0xa'));var deskjs=require(_0x38e9('0xb'));var toCsv=require(_0x38e9('0x5'));var querystring=require(_0x38e9('0xc'));var Papa=require(_0x38e9('0xd'));var Redis=require(_0x38e9('0xe'));var authService=require(_0x38e9('0xf'));var qs=require(_0x38e9('0x10'));var as=require(_0x38e9('0x11'));var hardwareService=require(_0x38e9('0x12'));var logger=require(_0x38e9('0x13'))(_0x38e9('0x14'));var utils=require(_0x38e9('0x15'));var config=require(_0x38e9('0x16'));var licenseUtil=require(_0x38e9('0x17'));var db=require(_0x38e9('0x18'))['db'];function respondWithStatusCode(_0x75dd03,_0x14fe7c){_0x14fe7c=_0x14fe7c||0xcc;return function(_0x42df7c){if(_0x42df7c){return _0x75dd03['sendStatus'](_0x14fe7c);}return _0x75dd03[_0x38e9('0x19')](_0x14fe7c)[_0x38e9('0x1a')]();};}function respondWithResult(_0x4d5158,_0x1a6e35){_0x1a6e35=_0x1a6e35||0xc8;return function(_0x4e40b8){if(_0x4e40b8){return _0x4d5158[_0x38e9('0x19')](_0x1a6e35)[_0x38e9('0x1b')](_0x4e40b8);}};}function respondWithFilteredResult(_0x48c49e,_0x1e721e){return function(_0x2f37f0){if(_0x2f37f0){var _0x41ca8d=typeof _0x1e721e[_0x38e9('0x1c')]===_0x38e9('0x1d')&&typeof _0x1e721e['limit']==='undefined';var _0x3f5f67=_0x2f37f0['count'];var _0x242196=_0x41ca8d?0x0:_0x1e721e['offset'];var _0x3d8cda=_0x41ca8d?_0x2f37f0[_0x38e9('0x1e')]:_0x1e721e[_0x38e9('0x1c')]+_0x1e721e[_0x38e9('0x1f')];var _0x499b4a;if(_0x3d8cda>=_0x3f5f67){_0x3d8cda=_0x3f5f67;_0x499b4a=0xc8;}else{_0x499b4a=0xce;}_0x48c49e[_0x38e9('0x19')](_0x499b4a);return _0x48c49e['set'](_0x38e9('0x20'),_0x242196+'-'+_0x3d8cda+'/'+_0x3f5f67)['json'](_0x2f37f0);}return null;};}function patchUpdates(_0x36b17d){return function(_0x5f4e9b){try{jsonpatch['apply'](_0x5f4e9b,_0x36b17d,!![]);}catch(_0x8b7310){return BPromise[_0x38e9('0x21')](_0x8b7310);}return _0x5f4e9b[_0x38e9('0x22')]();};}function saveUpdates(_0x290b9b,_0x4ebf33){return function(_0x1fa25d){if(_0x1fa25d){return _0x1fa25d['update'](_0x290b9b)[_0x38e9('0x23')](function(_0x4242fb){return _0x4242fb;});}return null;};}function removeEntity(_0x1a17a4,_0xbeae69){return function(_0x4036ef){if(_0x4036ef){return _0x4036ef[_0x38e9('0x24')]()['then'](function(){_0x1a17a4['status'](0xcc)[_0x38e9('0x1a')]();});}};}function handleEntityNotFound(_0x3c7539,_0x35425e){return function(_0x1afffb){if(!_0x1afffb){_0x3c7539[_0x38e9('0x25')](0x194);}return _0x1afffb;};}function handleError(_0x436de1,_0x51d160){_0x51d160=_0x51d160||0x1f4;return function(_0x398607){logger[_0x38e9('0x26')](_0x398607[_0x38e9('0x27')]);if(_0x398607['name']){delete _0x398607[_0x38e9('0x28')];}_0x436de1[_0x38e9('0x19')](_0x51d160)[_0x38e9('0x29')](_0x398607);};}exports[_0x38e9('0x2a')]=function(_0x3482c0,_0xb2ad67){var _0x33af71={},_0x169043={},_0xf7e9a9={'count':0x0,'rows':[]};var _0x4303fb=_['map'](db[_0x38e9('0x2b')][_0x38e9('0x2c')],function(_0x8fc864){return{'name':_0x8fc864[_0x38e9('0x2d')],'type':_0x8fc864[_0x38e9('0x2e')][_0x38e9('0x2f')]};});_0x169043[_0x38e9('0x30')]=_[_0x38e9('0x31')](_0x4303fb,_0x38e9('0x28'));_0x169043[_0x38e9('0x32')]=_['keys'](_0x3482c0['query']);_0x169043[_0x38e9('0x33')]=_['intersection'](_0x169043['model'],_0x169043[_0x38e9('0x32')]);_0x33af71[_0x38e9('0x34')]=_[_0x38e9('0x35')](_0x169043[_0x38e9('0x30')],qs[_0x38e9('0x36')](_0x3482c0['query'][_0x38e9('0x36')]));_0x33af71['attributes']=_0x33af71['attributes'][_0x38e9('0x37')]?_0x33af71[_0x38e9('0x34')]:_0x169043[_0x38e9('0x30')];if(!_0x3482c0['query']['hasOwnProperty'](_0x38e9('0x38'))){_0x33af71[_0x38e9('0x1f')]=qs[_0x38e9('0x1f')](_0x3482c0[_0x38e9('0x32')][_0x38e9('0x1f')]);_0x33af71[_0x38e9('0x1c')]=qs[_0x38e9('0x1c')](_0x3482c0[_0x38e9('0x32')][_0x38e9('0x1c')]);}_0x33af71['order']=qs[_0x38e9('0x39')](_0x3482c0['query'][_0x38e9('0x39')]);_0x33af71[_0x38e9('0x3a')]=qs[_0x38e9('0x33')](_[_0x38e9('0x3b')](_0x3482c0['query'],_0x169043['filters']),_0x4303fb);if(_0x3482c0[_0x38e9('0x32')][_0x38e9('0x3c')]){_0x33af71[_0x38e9('0x3a')]=_[_0x38e9('0x3d')](_0x33af71[_0x38e9('0x3a')],{'$or':_[_0x38e9('0x31')](_0x4303fb,function(_0x53a856){if(_0x53a856[_0x38e9('0x2e')]!=='VIRTUAL'){var _0x5286d1={};_0x5286d1[_0x53a856[_0x38e9('0x28')]]={'$like':'%'+_0x3482c0[_0x38e9('0x32')][_0x38e9('0x3c')]+'%'};return _0x5286d1;}})});}_0x33af71=_['merge']({},_0x33af71,_0x3482c0[_0x38e9('0x3e')]);var _0x5bb1b0={'where':_0x33af71[_0x38e9('0x3a')]};return db[_0x38e9('0x2b')][_0x38e9('0x1e')](_0x5bb1b0)[_0x38e9('0x23')](function(_0x50a615){_0xf7e9a9['count']=_0x50a615;if(_0x3482c0[_0x38e9('0x32')][_0x38e9('0x3f')]){_0x33af71[_0x38e9('0x40')]=[{'all':!![]}];}return db[_0x38e9('0x2b')][_0x38e9('0x41')](_0x33af71);})[_0x38e9('0x23')](function(_0x764ffc){_0xf7e9a9[_0x38e9('0x42')]=_0x764ffc;return _0xf7e9a9;})['then'](respondWithFilteredResult(_0xb2ad67,_0x33af71))[_0x38e9('0x43')](handleError(_0xb2ad67,null));};exports[_0x38e9('0x44')]=function(_0x35eab7,_0x37e464){var _0x325b5a={'raw':!![],'where':{'id':_0x35eab7[_0x38e9('0x45')]['id']}},_0x451715={};_0x451715[_0x38e9('0x30')]=_[_0x38e9('0x46')](db[_0x38e9('0x2b')][_0x38e9('0x2c')]);_0x451715[_0x38e9('0x32')]=_[_0x38e9('0x46')](_0x35eab7['query']);_0x451715['filters']=_[_0x38e9('0x35')](_0x451715['model'],_0x451715[_0x38e9('0x32')]);_0x325b5a['attributes']=_[_0x38e9('0x35')](_0x451715[_0x38e9('0x30')],qs[_0x38e9('0x36')](_0x35eab7['query'][_0x38e9('0x36')]));_0x325b5a[_0x38e9('0x34')]=_0x325b5a[_0x38e9('0x34')][_0x38e9('0x37')]?_0x325b5a[_0x38e9('0x34')]:_0x451715[_0x38e9('0x30')];if(_0x35eab7[_0x38e9('0x32')][_0x38e9('0x3f')]){_0x325b5a[_0x38e9('0x40')]=[{'all':!![]}];}_0x325b5a=_[_0x38e9('0x3d')]({},_0x325b5a,_0x35eab7[_0x38e9('0x3e')]);return db[_0x38e9('0x2b')][_0x38e9('0x47')](_0x325b5a)[_0x38e9('0x23')](handleEntityNotFound(_0x37e464,null))[_0x38e9('0x23')](respondWithResult(_0x37e464,null))[_0x38e9('0x43')](handleError(_0x37e464,null));};exports[_0x38e9('0x48')]=function(_0x29937f,_0x41b8ba){return db[_0x38e9('0x2b')][_0x38e9('0x48')](_0x29937f[_0x38e9('0x49')],{})[_0x38e9('0x23')](respondWithResult(_0x41b8ba,0xc9))['catch'](handleError(_0x41b8ba,null));};exports['update']=function(_0x5062e2,_0x507400){if(_0x5062e2[_0x38e9('0x49')]['id']){delete _0x5062e2[_0x38e9('0x49')]['id'];}return db[_0x38e9('0x2b')][_0x38e9('0x47')]({'where':{'id':_0x5062e2['params']['id']}})[_0x38e9('0x23')](handleEntityNotFound(_0x507400,null))[_0x38e9('0x23')](saveUpdates(_0x5062e2[_0x38e9('0x49')],null))[_0x38e9('0x23')](respondWithResult(_0x507400,null))[_0x38e9('0x43')](handleError(_0x507400,null));};exports[_0x38e9('0x24')]=function(_0x1a1990,_0x18b9b4){return db[_0x38e9('0x2b')][_0x38e9('0x47')]({'where':{'id':_0x1a1990[_0x38e9('0x45')]['id']}})[_0x38e9('0x23')](handleEntityNotFound(_0x18b9b4,null))[_0x38e9('0x23')](removeEntity(_0x18b9b4,null))[_0x38e9('0x43')](handleError(_0x18b9b4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 56a00f9..b4aaced 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 _0x8b76=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','mail_servers_out','../../config/logger'];(function(_0x28a998,_0x95a85b){var _0x429c3b=function(_0x4cb4b0){while(--_0x4cb4b0){_0x28a998['push'](_0x28a998['shift']());}};_0x429c3b(++_0x95a85b);}(_0x8b76,0x7d));var _0x68b7=function(_0x3c8a52,_0x2744ad){_0x3c8a52=_0x3c8a52-0x0;var _0x23de6b=_0x8b76[_0x3c8a52];return _0x23de6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x68b7('0x0'))(_0x68b7('0x1'));var moment=require('moment');var BPromise=require(_0x68b7('0x2'));var rp=require(_0x68b7('0x3'));var fs=require('fs');var path=require(_0x68b7('0x4'));var rimraf=require(_0x68b7('0x5'));var config=require(_0x68b7('0x6'));var attributes=require(_0x68b7('0x7'));module['exports']=function(_0x3f76d0,_0xf79051){return _0x3f76d0['define']('MailServerOut',attributes,{'tableName':_0x68b7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x364b=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','util','api','moment','bluebird'];(function(_0x2803dc,_0x1cdaf1){var _0x552ae4=function(_0x15f1ef){while(--_0x15f1ef){_0x2803dc['push'](_0x2803dc['shift']());}};_0x552ae4(++_0x1cdaf1);}(_0x364b,0x15c));var _0xb364=function(_0xfcbdc0,_0x1d432a){_0xfcbdc0=_0xfcbdc0-0x0;var _0x402200=_0x364b[_0xfcbdc0];return _0x402200;};'use strict';var _=require('lodash');var util=require(_0xb364('0x0'));var logger=require('../../config/logger')(_0xb364('0x1'));var moment=require(_0xb364('0x2'));var BPromise=require(_0xb364('0x3'));var rp=require(_0xb364('0x4'));var fs=require('fs');var path=require(_0xb364('0x5'));var rimraf=require(_0xb364('0x6'));var config=require(_0xb364('0x7'));var attributes=require(_0xb364('0x8'));module[_0xb364('0x9')]=function(_0x588a17,_0x5c5a30){return _0x588a17['define'](_0xb364('0xa'),attributes,{'tableName':'mail_servers_out','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 c684c20..d75fb41 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4db40c,_0x5aebda){var _0x572a4b=function(_0x4cb854){while(--_0x4cb854){_0x4db40c['push'](_0x4db40c['shift']());}};_0x572a4b(++_0x5aebda);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e06e9,_0x3ed60d){_0x1e06e9=_0x1e06e9-0x0;var _0x3900b8=_0x2ef3[_0x1e06e9];return _0x3900b8;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3cf2ce,_0x4a34f6){var _0x47d881=function(_0x1fb7d3){while(--_0x1fb7d3){_0x3cf2ce['push'](_0x3cf2ce['shift']());}};_0x47d881(++_0x4a34f6);}(_0x2ef3,0xba));var _0x32ef=function(_0x2ba6b1,_0x108d84){_0x2ba6b1=_0x2ba6b1-0x0;var _0x295a8c=_0x2ef3[_0x2ba6b1];return _0x295a8c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0e5e50c..3f892c0 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 _0x0085=['get','isAuthenticated','index','describe','/:id','post','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x1dc7a2,_0x23b280){var _0x2ab1aa=function(_0x1cca20){while(--_0x1cca20){_0x1dc7a2['push'](_0x1dc7a2['shift']());}};_0x2ab1aa(++_0x23b280);}(_0x0085,0xe0));var _0x5008=function(_0xd41069,_0x3dd47d){_0xd41069=_0xd41069-0x0;var _0x1262d8=_0x0085[_0xd41069];return _0x1262d8;};'use strict';var multer=require(_0x5008('0x0'));var util=require(_0x5008('0x1'));var path=require(_0x5008('0x2'));var timeout=require(_0x5008('0x3'));var express=require(_0x5008('0x4'));var router=express[_0x5008('0x5')]();var fs_extra=require(_0x5008('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5008('0x7'));var config=require(_0x5008('0x8'));var controller=require(_0x5008('0x9'));router[_0x5008('0xa')]('/',auth[_0x5008('0xb')](),controller[_0x5008('0xc')]);router[_0x5008('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5008('0xd')]);router['get'](_0x5008('0xe'),auth[_0x5008('0xb')](),controller['show']);router[_0x5008('0xf')]('/',auth[_0x5008('0xb')](),controller['create']);router[_0x5008('0x10')]('/:id',auth[_0x5008('0xb')](),controller['update']);router['delete'](_0x5008('0xe'),auth[_0x5008('0xb')](),controller['destroy']);module[_0x5008('0x11')]=router; \ No newline at end of file +var _0x56a9=['update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','isAuthenticated','get','describe','/:id','show','create','put'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x56a9,0x103));var _0x956a=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x56a9[_0x174a72];return _0x32cecd;};'use strict';var multer=require('multer');var util=require(_0x956a('0x0'));var path=require(_0x956a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x956a('0x2'));var auth=require(_0x956a('0x3'));var interaction=require(_0x956a('0x4'));var config=require('../../config/environment');var controller=require(_0x956a('0x5'));router['get']('/',auth[_0x956a('0x6')](),controller['index']);router[_0x956a('0x7')]('/describe',auth[_0x956a('0x6')](),controller[_0x956a('0x8')]);router['get'](_0x956a('0x9'),auth['isAuthenticated'](),controller[_0x956a('0xa')]);router['post']('/',auth[_0x956a('0x6')](),controller[_0x956a('0xb')]);router[_0x956a('0xc')](_0x956a('0x9'),auth[_0x956a('0x6')](),controller[_0x956a('0xd')]);router[_0x956a('0xe')](_0x956a('0x9'),auth['isAuthenticated'](),controller[_0x956a('0xf')]);module[_0x956a('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d6b4716..3ebe86f 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 _0x038b=['exports','STRING','name'];(function(_0x5440d3,_0x68412d){var _0x49b20a=function(_0x328c52){while(--_0x328c52){_0x5440d3['push'](_0x5440d3['shift']());}};_0x49b20a(++_0x68412d);}(_0x038b,0x114));var _0xb038=function(_0x33ea26,_0x6825d){_0x33ea26=_0x33ea26-0x0;var _0x229e0c=_0x038b[_0x33ea26];return _0x229e0c;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'unique':_0xb038('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x53ec=['STRING','name','sequelize','exports'];(function(_0x6292ad,_0x16941c){var _0x1d1fde=function(_0x2bf415){while(--_0x2bf415){_0x6292ad['push'](_0x6292ad['shift']());}};_0x1d1fde(++_0x16941c);}(_0x53ec,0x192));var _0xc53e=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x53ec[_0x5dbb84];return _0x1d6eae;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc53e('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 168d7b9..0127b76 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 _0x3073=['apply','reject','save','update','then','end','error','send','index','map','MailSubstatus','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x36e9fc,_0x99ba04){var _0x28a57f=function(_0x32863e){while(--_0x32863e){_0x36e9fc['push'](_0x36e9fc['shift']());}};_0x28a57f(++_0x99ba04);}(_0x3073,0x146));var _0x3307=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x3073[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3307('0x0'));var zipdir=require(_0x3307('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3307('0x2'));var moment=require(_0x3307('0x3'));var BPromise=require(_0x3307('0x4'));var Mustache=require(_0x3307('0x5'));var util=require(_0x3307('0x6'));var path=require(_0x3307('0x7'));var sox=require('sox');var csv=require(_0x3307('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3307('0x9'));var squel=require(_0x3307('0xa'));var crypto=require(_0x3307('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3307('0xc'));var toCsv=require(_0x3307('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3307('0xd'));var qs=require(_0x3307('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3307('0xf'));var logger=require('../../config/logger')(_0x3307('0x10'));var utils=require(_0x3307('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3307('0x12'));var db=require(_0x3307('0x13'))['db'];function respondWithStatusCode(_0x449647,_0x5705ae){_0x5705ae=_0x5705ae||0xcc;return function(_0x16f3da){if(_0x16f3da){return _0x449647[_0x3307('0x14')](_0x5705ae);}return _0x449647[_0x3307('0x15')](_0x5705ae)['end']();};}function respondWithResult(_0x36d663,_0x25c6d0){_0x25c6d0=_0x25c6d0||0xc8;return function(_0x53876c){if(_0x53876c){return _0x36d663[_0x3307('0x15')](_0x25c6d0)[_0x3307('0x16')](_0x53876c);}};}function respondWithFilteredResult(_0x1d6ca4,_0x24171c){return function(_0x2fbe97){if(_0x2fbe97){var _0x2f6747=typeof _0x24171c[_0x3307('0x17')]===_0x3307('0x18')&&typeof _0x24171c[_0x3307('0x19')]===_0x3307('0x18');var _0x455642=_0x2fbe97[_0x3307('0x1a')];var _0x5b8fff=_0x2f6747?0x0:_0x24171c[_0x3307('0x17')];var _0x4fb4aa=_0x2f6747?_0x2fbe97[_0x3307('0x1a')]:_0x24171c[_0x3307('0x17')]+_0x24171c[_0x3307('0x19')];var _0x2235b1;if(_0x4fb4aa>=_0x455642){_0x4fb4aa=_0x455642;_0x2235b1=0xc8;}else{_0x2235b1=0xce;}_0x1d6ca4['status'](_0x2235b1);return _0x1d6ca4[_0x3307('0x1b')](_0x3307('0x1c'),_0x5b8fff+'-'+_0x4fb4aa+'/'+_0x455642)['json'](_0x2fbe97);}return null;};}function patchUpdates(_0x1b958f){return function(_0x28daf0){try{jsonpatch[_0x3307('0x1d')](_0x28daf0,_0x1b958f,!![]);}catch(_0x3f6e8a){return BPromise[_0x3307('0x1e')](_0x3f6e8a);}return _0x28daf0[_0x3307('0x1f')]();};}function saveUpdates(_0x1d2914,_0x32f3ce){return function(_0x8d7b91){if(_0x8d7b91){return _0x8d7b91[_0x3307('0x20')](_0x1d2914)[_0x3307('0x21')](function(_0x331d10){return _0x331d10;});}return null;};}function removeEntity(_0x2a5483,_0x4ca4bf){return function(_0x942cc7){if(_0x942cc7){return _0x942cc7['destroy']()[_0x3307('0x21')](function(){_0x2a5483[_0x3307('0x15')](0xcc)[_0x3307('0x22')]();});}};}function handleEntityNotFound(_0x2c5530,_0x2daa07){return function(_0x25767f){if(!_0x25767f){_0x2c5530['sendStatus'](0x194);}return _0x25767f;};}function handleError(_0x990bc0,_0x3eaebb){_0x3eaebb=_0x3eaebb||0x1f4;return function(_0x4a4fe0){logger[_0x3307('0x23')](_0x4a4fe0['stack']);if(_0x4a4fe0['name']){delete _0x4a4fe0['name'];}_0x990bc0['status'](_0x3eaebb)[_0x3307('0x24')](_0x4a4fe0);};}exports[_0x3307('0x25')]=function(_0x1774e8,_0x4c7995){var _0x5d95c1={},_0x365842={},_0x107b91={'count':0x0,'rows':[]};var _0x2a4232=_[_0x3307('0x26')](db[_0x3307('0x27')]['rawAttributes'],function(_0x3acb14){return{'name':_0x3acb14[_0x3307('0x28')],'type':_0x3acb14[_0x3307('0x29')]['key']};});_0x365842[_0x3307('0x2a')]=_['map'](_0x2a4232,_0x3307('0x2b'));_0x365842[_0x3307('0x2c')]=_[_0x3307('0x2d')](_0x1774e8[_0x3307('0x2c')]);_0x365842[_0x3307('0x2e')]=_[_0x3307('0x2f')](_0x365842[_0x3307('0x2a')],_0x365842[_0x3307('0x2c')]);_0x5d95c1[_0x3307('0x30')]=_[_0x3307('0x2f')](_0x365842[_0x3307('0x2a')],qs[_0x3307('0x31')](_0x1774e8[_0x3307('0x2c')]['fields']));_0x5d95c1['attributes']=_0x5d95c1['attributes'][_0x3307('0x32')]?_0x5d95c1[_0x3307('0x30')]:_0x365842['model'];if(!_0x1774e8[_0x3307('0x2c')]['hasOwnProperty'](_0x3307('0x33'))){_0x5d95c1['limit']=qs[_0x3307('0x19')](_0x1774e8[_0x3307('0x2c')][_0x3307('0x19')]);_0x5d95c1[_0x3307('0x17')]=qs[_0x3307('0x17')](_0x1774e8['query'][_0x3307('0x17')]);}_0x5d95c1[_0x3307('0x34')]=qs[_0x3307('0x35')](_0x1774e8[_0x3307('0x2c')][_0x3307('0x35')]);_0x5d95c1[_0x3307('0x36')]=qs['filters'](_[_0x3307('0x37')](_0x1774e8[_0x3307('0x2c')],_0x365842['filters']),_0x2a4232);if(_0x1774e8[_0x3307('0x2c')][_0x3307('0x38')]){_0x5d95c1[_0x3307('0x36')]=_[_0x3307('0x39')](_0x5d95c1['where'],{'$or':_[_0x3307('0x26')](_0x2a4232,function(_0x308b75){if(_0x308b75[_0x3307('0x29')]!=='VIRTUAL'){var _0x5ea2df={};_0x5ea2df[_0x308b75[_0x3307('0x2b')]]={'$like':'%'+_0x1774e8['query'][_0x3307('0x38')]+'%'};return _0x5ea2df;}})});}_0x5d95c1=_[_0x3307('0x39')]({},_0x5d95c1,_0x1774e8['options']);var _0x25f45b={'where':_0x5d95c1['where']};return db[_0x3307('0x27')][_0x3307('0x1a')](_0x25f45b)[_0x3307('0x21')](function(_0x156287){_0x107b91[_0x3307('0x1a')]=_0x156287;if(_0x1774e8[_0x3307('0x2c')][_0x3307('0x3a')]){_0x5d95c1[_0x3307('0x3b')]=[{'all':!![]}];}return db[_0x3307('0x27')][_0x3307('0x3c')](_0x5d95c1);})[_0x3307('0x21')](function(_0x4b66c3){_0x107b91[_0x3307('0x3d')]=_0x4b66c3;return _0x107b91;})[_0x3307('0x21')](respondWithFilteredResult(_0x4c7995,_0x5d95c1))['catch'](handleError(_0x4c7995,null));};exports[_0x3307('0x3e')]=function(_0x3b3277,_0x13c084){var _0x1b0248={'raw':!![],'where':{'id':_0x3b3277[_0x3307('0x3f')]['id']}},_0x209fbe={};_0x209fbe[_0x3307('0x2a')]=_[_0x3307('0x2d')](db[_0x3307('0x27')][_0x3307('0x40')]);_0x209fbe[_0x3307('0x2c')]=_[_0x3307('0x2d')](_0x3b3277[_0x3307('0x2c')]);_0x209fbe[_0x3307('0x2e')]=_[_0x3307('0x2f')](_0x209fbe['model'],_0x209fbe[_0x3307('0x2c')]);_0x1b0248[_0x3307('0x30')]=_[_0x3307('0x2f')](_0x209fbe[_0x3307('0x2a')],qs['fields'](_0x3b3277['query'][_0x3307('0x31')]));_0x1b0248[_0x3307('0x30')]=_0x1b0248[_0x3307('0x30')][_0x3307('0x32')]?_0x1b0248[_0x3307('0x30')]:_0x209fbe[_0x3307('0x2a')];if(_0x3b3277[_0x3307('0x2c')][_0x3307('0x3a')]){_0x1b0248['include']=[{'all':!![]}];}_0x1b0248=_[_0x3307('0x39')]({},_0x1b0248,_0x3b3277['options']);return db[_0x3307('0x27')][_0x3307('0x41')](_0x1b0248)[_0x3307('0x21')](handleEntityNotFound(_0x13c084,null))[_0x3307('0x21')](respondWithResult(_0x13c084,null))[_0x3307('0x42')](handleError(_0x13c084,null));};exports[_0x3307('0x43')]=function(_0x4eceb1,_0x585383){return db[_0x3307('0x27')]['create'](_0x4eceb1[_0x3307('0x44')],{})[_0x3307('0x21')](respondWithResult(_0x585383,0xc9))['catch'](handleError(_0x585383,null));};exports[_0x3307('0x20')]=function(_0x13650a,_0x1c7e08){if(_0x13650a['body']['id']){delete _0x13650a['body']['id'];}return db[_0x3307('0x27')][_0x3307('0x41')]({'where':{'id':_0x13650a[_0x3307('0x3f')]['id']}})[_0x3307('0x21')](handleEntityNotFound(_0x1c7e08,null))[_0x3307('0x21')](saveUpdates(_0x13650a[_0x3307('0x44')],null))[_0x3307('0x21')](respondWithResult(_0x1c7e08,null))[_0x3307('0x42')](handleError(_0x1c7e08,null));};exports[_0x3307('0x45')]=function(_0x3b1d04,_0x3593bf){return db[_0x3307('0x27')][_0x3307('0x41')]({'where':{'id':_0x3b1d04[_0x3307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3593bf,null))[_0x3307('0x21')](removeEntity(_0x3593bf,null))[_0x3307('0x42')](handleError(_0x3593bf,null));};exports['describe']=function(_0x4294ff,_0x53431a){return db[_0x3307('0x27')][_0x3307('0x46')]()['then'](respondWithResult(_0x53431a,null))[_0x3307('0x42')](handleError(_0x53431a,null));}; \ No newline at end of file +var _0x4ee3=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','MailSubstatus','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','type','VIRTUAL','filter','options','include','rows','catch','show','params','length','includeAll','find'];(function(_0x3de464,_0x1553c2){var _0x444579=function(_0x504ce3){while(--_0x504ce3){_0x3de464['push'](_0x3de464['shift']());}};_0x444579(++_0x1553c2);}(_0x4ee3,0x1cb));var _0x34ee=function(_0x37762c,_0x3c6a24){_0x37762c=_0x37762c-0x0;var _0x4f0935=_0x4ee3[_0x37762c];return _0x4f0935;};'use strict';var emlformat=require(_0x34ee('0x0'));var rimraf=require(_0x34ee('0x1'));var zipdir=require(_0x34ee('0x2'));var jsonpatch=require(_0x34ee('0x3'));var rp=require(_0x34ee('0x4'));var moment=require(_0x34ee('0x5'));var BPromise=require(_0x34ee('0x6'));var Mustache=require(_0x34ee('0x7'));var util=require('util');var path=require(_0x34ee('0x8'));var sox=require(_0x34ee('0x9'));var csv=require('to-csv');var ejs=require(_0x34ee('0xa'));var fs=require('fs');var fs_extra=require(_0x34ee('0xb'));var _=require('lodash');var squel=require(_0x34ee('0xc'));var crypto=require('crypto');var jsforce=require(_0x34ee('0xd'));var deskjs=require(_0x34ee('0xe'));var toCsv=require(_0x34ee('0xf'));var querystring=require(_0x34ee('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x34ee('0x11'));var qs=require(_0x34ee('0x12'));var as=require(_0x34ee('0x13'));var hardwareService=require(_0x34ee('0x14'));var logger=require(_0x34ee('0x15'))(_0x34ee('0x16'));var utils=require(_0x34ee('0x17'));var config=require(_0x34ee('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x34ee('0x19'))['db'];function respondWithStatusCode(_0x201f18,_0x5d8177){_0x5d8177=_0x5d8177||0xcc;return function(_0x3902b5){if(_0x3902b5){return _0x201f18['sendStatus'](_0x5d8177);}return _0x201f18[_0x34ee('0x1a')](_0x5d8177)['end']();};}function respondWithResult(_0x58d3bd,_0x2882e0){_0x2882e0=_0x2882e0||0xc8;return function(_0x39ad84){if(_0x39ad84){return _0x58d3bd[_0x34ee('0x1a')](_0x2882e0)['json'](_0x39ad84);}};}function respondWithFilteredResult(_0x4d52ba,_0x1bec6b){return function(_0x40b602){if(_0x40b602){var _0x12133b=typeof _0x1bec6b[_0x34ee('0x1b')]==='undefined'&&typeof _0x1bec6b['limit']===_0x34ee('0x1c');var _0x2569bf=_0x40b602[_0x34ee('0x1d')];var _0x4fbf45=_0x12133b?0x0:_0x1bec6b[_0x34ee('0x1b')];var _0x307be7=_0x12133b?_0x40b602[_0x34ee('0x1d')]:_0x1bec6b[_0x34ee('0x1b')]+_0x1bec6b['limit'];var _0x2017f3;if(_0x307be7>=_0x2569bf){_0x307be7=_0x2569bf;_0x2017f3=0xc8;}else{_0x2017f3=0xce;}_0x4d52ba['status'](_0x2017f3);return _0x4d52ba[_0x34ee('0x1e')]('Content-Range',_0x4fbf45+'-'+_0x307be7+'/'+_0x2569bf)['json'](_0x40b602);}return null;};}function patchUpdates(_0x4dc9f9){return function(_0x48e1ec){try{jsonpatch[_0x34ee('0x1f')](_0x48e1ec,_0x4dc9f9,!![]);}catch(_0x1ed7b9){return BPromise[_0x34ee('0x20')](_0x1ed7b9);}return _0x48e1ec[_0x34ee('0x21')]();};}function saveUpdates(_0x8088c2,_0x3efcd1){return function(_0xcb04cf){if(_0xcb04cf){return _0xcb04cf[_0x34ee('0x22')](_0x8088c2)[_0x34ee('0x23')](function(_0x547848){return _0x547848;});}return null;};}function removeEntity(_0x641de6,_0x601905){return function(_0x227b1a){if(_0x227b1a){return _0x227b1a[_0x34ee('0x24')]()['then'](function(){_0x641de6[_0x34ee('0x1a')](0xcc)[_0x34ee('0x25')]();});}};}function handleEntityNotFound(_0x15d89a,_0x21d6aa){return function(_0x222512){if(!_0x222512){_0x15d89a[_0x34ee('0x26')](0x194);}return _0x222512;};}function handleError(_0x117978,_0x16b62c){_0x16b62c=_0x16b62c||0x1f4;return function(_0x3cfdc1){logger['error'](_0x3cfdc1['stack']);if(_0x3cfdc1[_0x34ee('0x27')]){delete _0x3cfdc1[_0x34ee('0x27')];}_0x117978[_0x34ee('0x1a')](_0x16b62c)[_0x34ee('0x28')](_0x3cfdc1);};}exports[_0x34ee('0x29')]=function(_0x997a55,_0x314e2c){var _0x1e329e={},_0xb2dac7={},_0x2c8e21={'count':0x0,'rows':[]};var _0x326390=_['map'](db[_0x34ee('0x2a')][_0x34ee('0x2b')],function(_0x4b8d3b){return{'name':_0x4b8d3b[_0x34ee('0x2c')],'type':_0x4b8d3b['type'][_0x34ee('0x2d')]};});_0xb2dac7[_0x34ee('0x2e')]=_['map'](_0x326390,_0x34ee('0x27'));_0xb2dac7['query']=_[_0x34ee('0x2f')](_0x997a55[_0x34ee('0x30')]);_0xb2dac7[_0x34ee('0x31')]=_['intersection'](_0xb2dac7[_0x34ee('0x2e')],_0xb2dac7[_0x34ee('0x30')]);_0x1e329e[_0x34ee('0x32')]=_[_0x34ee('0x33')](_0xb2dac7[_0x34ee('0x2e')],qs[_0x34ee('0x34')](_0x997a55['query'][_0x34ee('0x34')]));_0x1e329e[_0x34ee('0x32')]=_0x1e329e[_0x34ee('0x32')]['length']?_0x1e329e[_0x34ee('0x32')]:_0xb2dac7[_0x34ee('0x2e')];if(!_0x997a55[_0x34ee('0x30')][_0x34ee('0x35')](_0x34ee('0x36'))){_0x1e329e[_0x34ee('0x37')]=qs[_0x34ee('0x37')](_0x997a55[_0x34ee('0x30')]['limit']);_0x1e329e[_0x34ee('0x1b')]=qs[_0x34ee('0x1b')](_0x997a55[_0x34ee('0x30')]['offset']);}_0x1e329e[_0x34ee('0x38')]=qs[_0x34ee('0x39')](_0x997a55[_0x34ee('0x30')][_0x34ee('0x39')]);_0x1e329e[_0x34ee('0x3a')]=qs['filters'](_['pick'](_0x997a55[_0x34ee('0x30')],_0xb2dac7['filters']),_0x326390);if(_0x997a55[_0x34ee('0x30')]['filter']){_0x1e329e[_0x34ee('0x3a')]=_[_0x34ee('0x3b')](_0x1e329e[_0x34ee('0x3a')],{'$or':_[_0x34ee('0x3c')](_0x326390,function(_0x2a48c5){if(_0x2a48c5[_0x34ee('0x3d')]!==_0x34ee('0x3e')){var _0x1ab43a={};_0x1ab43a[_0x2a48c5[_0x34ee('0x27')]]={'$like':'%'+_0x997a55[_0x34ee('0x30')][_0x34ee('0x3f')]+'%'};return _0x1ab43a;}})});}_0x1e329e=_['merge']({},_0x1e329e,_0x997a55[_0x34ee('0x40')]);var _0x163d70={'where':_0x1e329e[_0x34ee('0x3a')]};return db[_0x34ee('0x2a')]['count'](_0x163d70)['then'](function(_0x3b17c9){_0x2c8e21[_0x34ee('0x1d')]=_0x3b17c9;if(_0x997a55[_0x34ee('0x30')]['includeAll']){_0x1e329e[_0x34ee('0x41')]=[{'all':!![]}];}return db[_0x34ee('0x2a')]['findAll'](_0x1e329e);})[_0x34ee('0x23')](function(_0x3355d9){_0x2c8e21[_0x34ee('0x42')]=_0x3355d9;return _0x2c8e21;})[_0x34ee('0x23')](respondWithFilteredResult(_0x314e2c,_0x1e329e))[_0x34ee('0x43')](handleError(_0x314e2c,null));};exports[_0x34ee('0x44')]=function(_0x267449,_0x1f5017){var _0x5aac08={'raw':!![],'where':{'id':_0x267449[_0x34ee('0x45')]['id']}},_0x654e7c={};_0x654e7c[_0x34ee('0x2e')]=_[_0x34ee('0x2f')](db[_0x34ee('0x2a')][_0x34ee('0x2b')]);_0x654e7c['query']=_[_0x34ee('0x2f')](_0x267449[_0x34ee('0x30')]);_0x654e7c[_0x34ee('0x31')]=_[_0x34ee('0x33')](_0x654e7c[_0x34ee('0x2e')],_0x654e7c['query']);_0x5aac08[_0x34ee('0x32')]=_[_0x34ee('0x33')](_0x654e7c[_0x34ee('0x2e')],qs[_0x34ee('0x34')](_0x267449[_0x34ee('0x30')][_0x34ee('0x34')]));_0x5aac08[_0x34ee('0x32')]=_0x5aac08['attributes'][_0x34ee('0x46')]?_0x5aac08[_0x34ee('0x32')]:_0x654e7c[_0x34ee('0x2e')];if(_0x267449['query'][_0x34ee('0x47')]){_0x5aac08[_0x34ee('0x41')]=[{'all':!![]}];}_0x5aac08=_[_0x34ee('0x3b')]({},_0x5aac08,_0x267449[_0x34ee('0x40')]);return db[_0x34ee('0x2a')][_0x34ee('0x48')](_0x5aac08)[_0x34ee('0x23')](handleEntityNotFound(_0x1f5017,null))[_0x34ee('0x23')](respondWithResult(_0x1f5017,null))[_0x34ee('0x43')](handleError(_0x1f5017,null));};exports[_0x34ee('0x49')]=function(_0x317113,_0x3d0e0d){return db[_0x34ee('0x2a')]['create'](_0x317113[_0x34ee('0x4a')],{})[_0x34ee('0x23')](respondWithResult(_0x3d0e0d,0xc9))[_0x34ee('0x43')](handleError(_0x3d0e0d,null));};exports['update']=function(_0x47cf0c,_0x5ee156){if(_0x47cf0c[_0x34ee('0x4a')]['id']){delete _0x47cf0c[_0x34ee('0x4a')]['id'];}return db[_0x34ee('0x2a')][_0x34ee('0x48')]({'where':{'id':_0x47cf0c[_0x34ee('0x45')]['id']}})[_0x34ee('0x23')](handleEntityNotFound(_0x5ee156,null))[_0x34ee('0x23')](saveUpdates(_0x47cf0c[_0x34ee('0x4a')],null))[_0x34ee('0x23')](respondWithResult(_0x5ee156,null))[_0x34ee('0x43')](handleError(_0x5ee156,null));};exports[_0x34ee('0x24')]=function(_0x4c65ac,_0x1d68a1){return db[_0x34ee('0x2a')][_0x34ee('0x48')]({'where':{'id':_0x4c65ac['params']['id']}})[_0x34ee('0x23')](handleEntityNotFound(_0x1d68a1,null))[_0x34ee('0x23')](removeEntity(_0x1d68a1,null))[_0x34ee('0x43')](handleError(_0x1d68a1,null));};exports[_0x34ee('0x4b')]=function(_0x955e6c,_0x46e9e6){return db[_0x34ee('0x2a')][_0x34ee('0x4b')]()[_0x34ee('0x23')](respondWithResult(_0x46e9e6,null))[_0x34ee('0x43')](handleError(_0x46e9e6,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 7775177..52a76be 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x553c=['events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x433959,_0x5ad349){var _0x2bc99e=function(_0x437069){while(--_0x437069){_0x433959['push'](_0x433959['shift']());}};_0x2bc99e(++_0x5ad349);}(_0x553c,0xc4));var _0xc553=function(_0x3508e5,_0x437b1c){_0x3508e5=_0x3508e5-0x0;var _0x77ad2=_0x553c[_0x3508e5];return _0x77ad2;};'use strict';var EventEmitter=require(_0xc553('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xc553('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xc553('0x2')](0x0);var events={'afterUpdate':_0xc553('0x3')};function emitEvent(_0x11f945){return function(_0x5022bd,_0x58c47b,_0x59373b){MailSubstatusEvents['emit'](_0x11f945+':'+_0x5022bd['id'],_0x5022bd);MailSubstatusEvents[_0xc553('0x4')](_0x11f945,_0x5022bd);_0x59373b(null);};}for(var e in events){if(events[_0xc553('0x5')](e)){var event=events[e];MailSubstatus[_0xc553('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x631a=['../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','exports'];(function(_0x163b05,_0x1c0394){var _0x437ccd=function(_0x1d2b6e){while(--_0x1d2b6e){_0x163b05['push'](_0x163b05['shift']());}};_0x437ccd(++_0x1c0394);}(_0x631a,0x90));var _0xa631=function(_0x20f132,_0x4ee1e3){_0x20f132=_0x20f132-0x0;var _0x17218b=_0x631a[_0x20f132];return _0x17218b;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xa631('0x0'))['db'][_0xa631('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xa631('0x2')};function emitEvent(_0x9b890a){return function(_0x2d1cc7,_0x243a05,_0x148827){MailSubstatusEvents[_0xa631('0x3')](_0x9b890a+':'+_0x2d1cc7['id'],_0x2d1cc7);MailSubstatusEvents['emit'](_0x9b890a,_0x2d1cc7);_0x148827(null);};}for(var e in events){if(events[_0xa631('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xa631('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c66a51a..5997860 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 _0xce95=['update','mailSubstatus','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','Condition'];(function(_0x26331d,_0xa438){var _0x9e6b91=function(_0x2e2b44){while(--_0x2e2b44){_0x26331d['push'](_0x26331d['shift']());}};_0x9e6b91(++_0xa438);}(_0xce95,0x13e));var _0x5ce9=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xce95[_0x424a9a];return _0xa7831c;};'use strict';var attributes=require(_0x5ce9('0x0'));module[_0x5ce9('0x1')]=function(_0x53a78b){var _0x2f191a=_0x53a78b[_0x5ce9('0x2')];return _0x53a78b[_0x5ce9('0x3')](_0x5ce9('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x22aa64,_0x37f796,_0x5ad8b5){return _0x2f191a[_0x5ce9('0x5')][_0x5ce9('0x6')]({'value':_0x22aa64['name']},{'where':{'field':_0x5ce9('0x7'),'value':_0x22aa64[_0x5ce9('0x8')][_0x5ce9('0x9')]}})[_0x5ce9('0xa')](function(){_0x5ad8b5();})[_0x5ce9('0xb')](function(_0x638e27){_0x5ad8b5(_0x638e27);});}}});}; \ No newline at end of file +var _0x4892=['update','mailSubstatus','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x4892,0x1cd));var _0x2489=function(_0x5f0d47,_0x1f1ef3){_0x5f0d47=_0x5f0d47-0x0;var _0x46286c=_0x4892[_0x5f0d47];return _0x46286c;};'use strict';var attributes=require(_0x2489('0x0'));module[_0x2489('0x1')]=function(_0x55e43d){var _0x2e7fa3=_0x55e43d[_0x2489('0x2')];return _0x55e43d[_0x2489('0x3')](_0x2489('0x4'),attributes,{'tableName':_0x2489('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x455ebf,_0x19d2fc,_0x54ec07){return _0x2e7fa3[_0x2489('0x6')][_0x2489('0x7')]({'value':_0x455ebf['name']},{'where':{'field':_0x2489('0x8'),'value':_0x455ebf[_0x2489('0x9')][_0x2489('0xa')]}})[_0x2489('0xb')](function(){_0x54ec07();})[_0x2489('0xc')](function(_0x57b619){_0x54ec07(_0x57b619);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f95a328..acb3f8d 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 _0x5b3b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2d8db1,_0x3b2030){var _0x5c65dd=function(_0x363a40){while(--_0x363a40){_0x2d8db1['push'](_0x2d8db1['shift']());}};_0x5c65dd(++_0x3b2030);}(_0x5b3b,0xb4));var _0xb5b3=function(_0x48a3ce,_0x5df6cc){_0x48a3ce=_0x48a3ce-0x0;var _0x54b390=_0x5b3b[_0x48a3ce];return _0x54b390;};'use strict';var _=require(_0xb5b3('0x0'));var util=require(_0xb5b3('0x1'));var moment=require(_0xb5b3('0x2'));var BPromise=require(_0xb5b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5b3('0x4'))['db'];var utils=require(_0xb5b3('0x5'));var logger=require(_0xb5b3('0x6'))('rpc');var config=require(_0xb5b3('0x7'));var jayson=require(_0xb5b3('0x8'));var client=jayson[_0xb5b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d162d,_0x189d66,_0x599342){return new BPromise(function(_0x3718fd,_0x59b277){return client[_0xb5b3('0xa')](_0x5d162d,_0x599342)[_0xb5b3('0xb')](function(_0x56791d){logger[_0xb5b3('0xc')](_0xb5b3('0xd'),_0x189d66,_0xb5b3('0xe'));logger[_0xb5b3('0xf')](_0xb5b3('0x10'),_0x189d66,'request\x20sent',JSON[_0xb5b3('0x11')](_0x56791d));if(_0x56791d['error']){if(_0x56791d[_0xb5b3('0x12')][_0xb5b3('0x13')]===0x1f4){logger['error'](_0xb5b3('0xd'),_0x189d66,_0x56791d[_0xb5b3('0x12')][_0xb5b3('0x14')]);return _0x59b277(_0x56791d[_0xb5b3('0x12')][_0xb5b3('0x14')]);}logger[_0xb5b3('0x12')](_0xb5b3('0xd'),_0x189d66,_0x56791d[_0xb5b3('0x12')]['message']);return _0x3718fd(_0x56791d[_0xb5b3('0x12')][_0xb5b3('0x14')]);}else{logger[_0xb5b3('0xc')](_0xb5b3('0xd'),_0x189d66,_0xb5b3('0xe'));_0x3718fd(_0x56791d[_0xb5b3('0x15')][_0xb5b3('0x14')]);}})[_0xb5b3('0x16')](function(_0x5bdc34){logger[_0xb5b3('0x12')](_0xb5b3('0xd'),_0x189d66,_0x5bdc34);_0x59b277(_0x5bdc34);});});} \ No newline at end of file +var _0x53f3=['request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x14a281,_0x270893){var _0xbfae5f=function(_0x48888d){while(--_0x48888d){_0x14a281['push'](_0x14a281['shift']());}};_0xbfae5f(++_0x270893);}(_0x53f3,0xe0));var _0x353f=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0x53f3[_0x395155];return _0x179767;};'use strict';var _=require(_0x353f('0x0'));var util=require(_0x353f('0x1'));var moment=require(_0x353f('0x2'));var BPromise=require(_0x353f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x353f('0x4'));var db=require(_0x353f('0x5'))['db'];var utils=require(_0x353f('0x6'));var logger=require(_0x353f('0x7'))(_0x353f('0x8'));var config=require(_0x353f('0x9'));var jayson=require(_0x353f('0xa'));var client=jayson[_0x353f('0xb')][_0x353f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x226337,_0x2692d5,_0x528023){return new BPromise(function(_0x3cf8d0,_0x2c7334){return client[_0x353f('0xd')](_0x226337,_0x528023)['then'](function(_0x2f41f4){logger[_0x353f('0xe')](_0x353f('0xf'),_0x2692d5,_0x353f('0x10'));logger['debug'](_0x353f('0x11'),_0x2692d5,_0x353f('0x10'),JSON[_0x353f('0x12')](_0x2f41f4));if(_0x2f41f4[_0x353f('0x13')]){if(_0x2f41f4[_0x353f('0x13')][_0x353f('0x14')]===0x1f4){logger[_0x353f('0x13')](_0x353f('0xf'),_0x2692d5,_0x2f41f4[_0x353f('0x13')][_0x353f('0x15')]);return _0x2c7334(_0x2f41f4[_0x353f('0x13')][_0x353f('0x15')]);}logger[_0x353f('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2692d5,_0x2f41f4[_0x353f('0x13')][_0x353f('0x15')]);return _0x3cf8d0(_0x2f41f4['error'][_0x353f('0x15')]);}else{logger[_0x353f('0xe')](_0x353f('0xf'),_0x2692d5,_0x353f('0x10'));_0x3cf8d0(_0x2f41f4[_0x353f('0x16')]['message']);}})[_0x353f('0x17')](function(_0x237f71){logger[_0x353f('0x13')](_0x353f('0xf'),_0x2692d5,_0x237f71);_0x2c7334(_0x237f71);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3e277e3..8334bd9 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 _0x9cd4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9cd4,0x176));var _0x49cd=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x9cd4[_0x513047];return _0x15b779;};'use strict';var multer=require(_0x49cd('0x0'));var util=require(_0x49cd('0x1'));var path=require('path');var timeout=require(_0x49cd('0x2'));var express=require(_0x49cd('0x3'));var router=express['Router']();var fs_extra=require(_0x49cd('0x4'));var auth=require(_0x49cd('0x5'));var interaction=require(_0x49cd('0x6'));var config=require(_0x49cd('0x7'));var controller=require('./mailTransferReport.controller');router[_0x49cd('0x8')]('/',auth[_0x49cd('0x9')](),controller[_0x49cd('0xa')]);router[_0x49cd('0x8')]('/describe',auth[_0x49cd('0x9')](),controller[_0x49cd('0xb')]);router[_0x49cd('0x8')](_0x49cd('0xc'),auth[_0x49cd('0x9')](),controller[_0x49cd('0xd')]);router[_0x49cd('0xe')]('/',auth[_0x49cd('0x9')](),controller[_0x49cd('0xf')]);router['put'](_0x49cd('0xc'),auth[_0x49cd('0x9')](),controller[_0x49cd('0x10')]);router[_0x49cd('0x11')](_0x49cd('0xc'),auth[_0x49cd('0x9')](),controller[_0x49cd('0x12')]);module[_0x49cd('0x13')]=router; \ No newline at end of file +var _0xc771=['delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xc771,0xf9));var _0x1c77=function(_0x11390a,_0x6d6f41){_0x11390a=_0x11390a-0x0;var _0x31bc62=_0xc771[_0x11390a];return _0x31bc62;};'use strict';var multer=require('multer');var util=require(_0x1c77('0x0'));var path=require(_0x1c77('0x1'));var timeout=require(_0x1c77('0x2'));var express=require('express');var router=express[_0x1c77('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1c77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1c77('0x5'));var controller=require(_0x1c77('0x6'));router[_0x1c77('0x7')]('/',auth[_0x1c77('0x8')](),controller[_0x1c77('0x9')]);router['get'](_0x1c77('0xa'),auth[_0x1c77('0x8')](),controller[_0x1c77('0xb')]);router[_0x1c77('0x7')](_0x1c77('0xc'),auth[_0x1c77('0x8')](),controller[_0x1c77('0xd')]);router[_0x1c77('0xe')]('/',auth[_0x1c77('0x8')](),controller['create']);router[_0x1c77('0xf')](_0x1c77('0xc'),auth[_0x1c77('0x8')](),controller[_0x1c77('0x10')]);router[_0x1c77('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1c77('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 d66e99d..6df3d66 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2af946,_0x3d6088){var _0x3ae43d=function(_0x30ac1e){while(--_0x30ac1e){_0x2af946['push'](_0x2af946['shift']());}};_0x3ae43d(++_0x3d6088);}(_0x008c,0x188));var _0xc008=function(_0x1c88f9,_0x211646){_0x1c88f9=_0x1c88f9-0x0;var _0x1779f7=_0x008c[_0x1c88f9];return _0x1779f7;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x45829c,_0x318a74){_0x45829c=_0x45829c-0x0;var _0x12ec52=_0xb43b[_0x45829c];return _0x12ec52;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 3c313ed..5b9e39a 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 _0xf1d7=['moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','MailTransferReport','include','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x201c75,_0x1b8b35){var _0x39c1a8=function(_0x131b7d){while(--_0x131b7d){_0x201c75['push'](_0x201c75['shift']());}};_0x39c1a8(++_0x1b8b35);}(_0xf1d7,0x169));var _0x7f1d=function(_0x88160d,_0x28acb2){_0x88160d=_0x88160d-0x0;var _0x5d92c5=_0xf1d7[_0x88160d];return _0x5d92c5;};'use strict';var emlformat=require(_0x7f1d('0x0'));var rimraf=require(_0x7f1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f1d('0x2'));var rp=require(_0x7f1d('0x3'));var moment=require(_0x7f1d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f1d('0x5'));var sox=require(_0x7f1d('0x6'));var csv=require(_0x7f1d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f1d('0x8'));var _=require(_0x7f1d('0x9'));var squel=require(_0x7f1d('0xa'));var crypto=require(_0x7f1d('0xb'));var jsforce=require(_0x7f1d('0xc'));var deskjs=require(_0x7f1d('0xd'));var toCsv=require(_0x7f1d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7f1d('0xe'));var qs=require(_0x7f1d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f1d('0x10'))(_0x7f1d('0x11'));var utils=require(_0x7f1d('0x12'));var config=require(_0x7f1d('0x13'));var licenseUtil=require(_0x7f1d('0x14'));var db=require(_0x7f1d('0x15'))['db'];function respondWithStatusCode(_0x3a53ec,_0x1923dc){_0x1923dc=_0x1923dc||0xcc;return function(_0x4912a1){if(_0x4912a1){return _0x3a53ec[_0x7f1d('0x16')](_0x1923dc);}return _0x3a53ec[_0x7f1d('0x17')](_0x1923dc)[_0x7f1d('0x18')]();};}function respondWithResult(_0x400bd0,_0x21f38a){_0x21f38a=_0x21f38a||0xc8;return function(_0x2723ee){if(_0x2723ee){return _0x400bd0[_0x7f1d('0x17')](_0x21f38a)[_0x7f1d('0x19')](_0x2723ee);}};}function respondWithFilteredResult(_0x59fb38,_0x4a85eb){return function(_0x8f7d7a){if(_0x8f7d7a){var _0x526aa3=typeof _0x4a85eb[_0x7f1d('0x1a')]===_0x7f1d('0x1b')&&typeof _0x4a85eb[_0x7f1d('0x1c')]===_0x7f1d('0x1b');var _0xd0a73f=_0x8f7d7a[_0x7f1d('0x1d')];var _0xe868b6=_0x526aa3?0x0:_0x4a85eb[_0x7f1d('0x1a')];var _0x5f279e=_0x526aa3?_0x8f7d7a[_0x7f1d('0x1d')]:_0x4a85eb['offset']+_0x4a85eb[_0x7f1d('0x1c')];var _0xe8b29d;if(_0x5f279e>=_0xd0a73f){_0x5f279e=_0xd0a73f;_0xe8b29d=0xc8;}else{_0xe8b29d=0xce;}_0x59fb38['status'](_0xe8b29d);return _0x59fb38[_0x7f1d('0x1e')](_0x7f1d('0x1f'),_0xe868b6+'-'+_0x5f279e+'/'+_0xd0a73f)[_0x7f1d('0x19')](_0x8f7d7a);}return null;};}function patchUpdates(_0x3a8a96){return function(_0x45528a){try{jsonpatch[_0x7f1d('0x20')](_0x45528a,_0x3a8a96,!![]);}catch(_0x243393){return BPromise[_0x7f1d('0x21')](_0x243393);}return _0x45528a[_0x7f1d('0x22')]();};}function saveUpdates(_0x349cbe,_0x10b069){return function(_0x2ba68c){if(_0x2ba68c){return _0x2ba68c[_0x7f1d('0x23')](_0x349cbe)['then'](function(_0x4755ca){return _0x4755ca;});}return null;};}function removeEntity(_0x52e9fd,_0x589ee2){return function(_0x2129f8){if(_0x2129f8){return _0x2129f8[_0x7f1d('0x24')]()[_0x7f1d('0x25')](function(){_0x52e9fd[_0x7f1d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf2d55c,_0x3383f8){return function(_0x27aa98){if(!_0x27aa98){_0xf2d55c[_0x7f1d('0x16')](0x194);}return _0x27aa98;};}function handleError(_0x11940a,_0x3fadd9){_0x3fadd9=_0x3fadd9||0x1f4;return function(_0x19c81e){logger[_0x7f1d('0x26')](_0x19c81e[_0x7f1d('0x27')]);if(_0x19c81e[_0x7f1d('0x28')]){delete _0x19c81e[_0x7f1d('0x28')];}_0x11940a[_0x7f1d('0x17')](_0x3fadd9)[_0x7f1d('0x29')](_0x19c81e);};}exports[_0x7f1d('0x2a')]=function(_0x124e97,_0xda288e){var _0x54dbe4={},_0x505a08={},_0x3d8f42={'count':0x0,'rows':[]};var _0xaf1d1c=_['map'](db['MailTransferReport'][_0x7f1d('0x2b')],function(_0x324b67){return{'name':_0x324b67[_0x7f1d('0x2c')],'type':_0x324b67[_0x7f1d('0x2d')]['key']};});_0x505a08[_0x7f1d('0x2e')]=_[_0x7f1d('0x2f')](_0xaf1d1c,_0x7f1d('0x28'));_0x505a08[_0x7f1d('0x30')]=_[_0x7f1d('0x31')](_0x124e97[_0x7f1d('0x30')]);_0x505a08[_0x7f1d('0x32')]=_[_0x7f1d('0x33')](_0x505a08[_0x7f1d('0x2e')],_0x505a08[_0x7f1d('0x30')]);_0x54dbe4[_0x7f1d('0x34')]=_[_0x7f1d('0x33')](_0x505a08['model'],qs['fields'](_0x124e97[_0x7f1d('0x30')][_0x7f1d('0x35')]));_0x54dbe4['attributes']=_0x54dbe4[_0x7f1d('0x34')][_0x7f1d('0x36')]?_0x54dbe4[_0x7f1d('0x34')]:_0x505a08[_0x7f1d('0x2e')];if(!_0x124e97[_0x7f1d('0x30')][_0x7f1d('0x37')](_0x7f1d('0x38'))){_0x54dbe4[_0x7f1d('0x1c')]=qs[_0x7f1d('0x1c')](_0x124e97[_0x7f1d('0x30')][_0x7f1d('0x1c')]);_0x54dbe4['offset']=qs['offset'](_0x124e97[_0x7f1d('0x30')]['offset']);}_0x54dbe4[_0x7f1d('0x39')]=qs['sort'](_0x124e97[_0x7f1d('0x30')][_0x7f1d('0x3a')]);_0x54dbe4[_0x7f1d('0x3b')]=qs[_0x7f1d('0x32')](_['pick'](_0x124e97[_0x7f1d('0x30')],_0x505a08[_0x7f1d('0x32')]),_0xaf1d1c);if(_0x124e97[_0x7f1d('0x30')]['filter']){_0x54dbe4['where']=_['merge'](_0x54dbe4[_0x7f1d('0x3b')],{'$or':_[_0x7f1d('0x2f')](_0xaf1d1c,function(_0x2e5077){if(_0x2e5077['type']!==_0x7f1d('0x3c')){var _0x22b4b7={};_0x22b4b7[_0x2e5077[_0x7f1d('0x28')]]={'$like':'%'+_0x124e97[_0x7f1d('0x30')]['filter']+'%'};return _0x22b4b7;}})});}_0x54dbe4=_[_0x7f1d('0x3d')]({},_0x54dbe4,_0x124e97[_0x7f1d('0x3e')]);var _0x2c7f4d={'where':_0x54dbe4[_0x7f1d('0x3b')]};return db[_0x7f1d('0x3f')][_0x7f1d('0x1d')](_0x2c7f4d)[_0x7f1d('0x25')](function(_0x15e2b8){_0x3d8f42[_0x7f1d('0x1d')]=_0x15e2b8;if(_0x124e97[_0x7f1d('0x30')]['includeAll']){_0x54dbe4[_0x7f1d('0x40')]=[{'all':!![]}];}return db[_0x7f1d('0x3f')]['findAll'](_0x54dbe4);})[_0x7f1d('0x25')](function(_0x2e507f){_0x3d8f42[_0x7f1d('0x41')]=_0x2e507f;return _0x3d8f42;})[_0x7f1d('0x25')](respondWithFilteredResult(_0xda288e,_0x54dbe4))[_0x7f1d('0x42')](handleError(_0xda288e,null));};exports['show']=function(_0x276881,_0x2370ae){var _0x3ead70={'raw':!![],'where':{'id':_0x276881[_0x7f1d('0x43')]['id']}},_0x575172={};_0x575172['model']=_[_0x7f1d('0x31')](db['MailTransferReport']['rawAttributes']);_0x575172[_0x7f1d('0x30')]=_[_0x7f1d('0x31')](_0x276881['query']);_0x575172[_0x7f1d('0x32')]=_[_0x7f1d('0x33')](_0x575172['model'],_0x575172[_0x7f1d('0x30')]);_0x3ead70[_0x7f1d('0x34')]=_[_0x7f1d('0x33')](_0x575172[_0x7f1d('0x2e')],qs['fields'](_0x276881[_0x7f1d('0x30')][_0x7f1d('0x35')]));_0x3ead70[_0x7f1d('0x34')]=_0x3ead70['attributes'][_0x7f1d('0x36')]?_0x3ead70['attributes']:_0x575172[_0x7f1d('0x2e')];if(_0x276881[_0x7f1d('0x30')][_0x7f1d('0x44')]){_0x3ead70[_0x7f1d('0x40')]=[{'all':!![]}];}_0x3ead70=_[_0x7f1d('0x3d')]({},_0x3ead70,_0x276881[_0x7f1d('0x3e')]);return db[_0x7f1d('0x3f')][_0x7f1d('0x45')](_0x3ead70)['then'](handleEntityNotFound(_0x2370ae,null))[_0x7f1d('0x25')](respondWithResult(_0x2370ae,null))[_0x7f1d('0x42')](handleError(_0x2370ae,null));};exports[_0x7f1d('0x46')]=function(_0x470129,_0x2207de){return db[_0x7f1d('0x3f')][_0x7f1d('0x46')](_0x470129[_0x7f1d('0x47')],{})[_0x7f1d('0x25')](respondWithResult(_0x2207de,0xc9))[_0x7f1d('0x42')](handleError(_0x2207de,null));};exports['update']=function(_0x544318,_0x1aa411){if(_0x544318[_0x7f1d('0x47')]['id']){delete _0x544318[_0x7f1d('0x47')]['id'];}return db[_0x7f1d('0x3f')][_0x7f1d('0x45')]({'where':{'id':_0x544318[_0x7f1d('0x43')]['id']}})[_0x7f1d('0x25')](handleEntityNotFound(_0x1aa411,null))[_0x7f1d('0x25')](saveUpdates(_0x544318[_0x7f1d('0x47')],null))[_0x7f1d('0x25')](respondWithResult(_0x1aa411,null))[_0x7f1d('0x42')](handleError(_0x1aa411,null));};exports[_0x7f1d('0x24')]=function(_0x5768c4,_0x4174ab){return db[_0x7f1d('0x3f')]['find']({'where':{'id':_0x5768c4['params']['id']}})[_0x7f1d('0x25')](handleEntityNotFound(_0x4174ab,null))[_0x7f1d('0x25')](removeEntity(_0x4174ab,null))['catch'](handleError(_0x4174ab,null));};exports['describe']=function(_0x5094e1,_0x4574e5){return db[_0x7f1d('0x3f')][_0x7f1d('0x48')]()[_0x7f1d('0x25')](respondWithResult(_0x4574e5,null))[_0x7f1d('0x42')](handleError(_0x4574e5,null));}; \ No newline at end of file +var _0xa337=['includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','sort','filters','filter','where','merge','VIRTUAL','options'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xa337,0x1c0));var _0x7a33=function(_0x3f1ec6,_0x47a292){_0x3f1ec6=_0x3f1ec6-0x0;var _0x507638=_0xa337[_0x3f1ec6];return _0x507638;};'use strict';var emlformat=require(_0x7a33('0x0'));var rimraf=require(_0x7a33('0x1'));var zipdir=require(_0x7a33('0x2'));var jsonpatch=require(_0x7a33('0x3'));var rp=require('request-promise');var moment=require(_0x7a33('0x4'));var BPromise=require(_0x7a33('0x5'));var Mustache=require(_0x7a33('0x6'));var util=require(_0x7a33('0x7'));var path=require(_0x7a33('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a33('0x9'));var fs=require('fs');var fs_extra=require(_0x7a33('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7a33('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7a33('0xc'));var toCsv=require(_0x7a33('0xd'));var querystring=require('querystring');var Papa=require(_0x7a33('0xe'));var Redis=require(_0x7a33('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a33('0x10'));var as=require(_0x7a33('0x11'));var hardwareService=require(_0x7a33('0x12'));var logger=require(_0x7a33('0x13'))('api');var utils=require(_0x7a33('0x14'));var config=require(_0x7a33('0x15'));var licenseUtil=require(_0x7a33('0x16'));var db=require(_0x7a33('0x17'))['db'];function respondWithStatusCode(_0x12965a,_0x59e9e9){_0x59e9e9=_0x59e9e9||0xcc;return function(_0x4708ee){if(_0x4708ee){return _0x12965a[_0x7a33('0x18')](_0x59e9e9);}return _0x12965a[_0x7a33('0x19')](_0x59e9e9)[_0x7a33('0x1a')]();};}function respondWithResult(_0x306190,_0x4991d7){_0x4991d7=_0x4991d7||0xc8;return function(_0x45d320){if(_0x45d320){return _0x306190[_0x7a33('0x19')](_0x4991d7)[_0x7a33('0x1b')](_0x45d320);}};}function respondWithFilteredResult(_0x5b81c9,_0x5f20f2){return function(_0x4c7dd5){if(_0x4c7dd5){var _0x37c87a=typeof _0x5f20f2['offset']===_0x7a33('0x1c')&&typeof _0x5f20f2[_0x7a33('0x1d')]===_0x7a33('0x1c');var _0x74edd0=_0x4c7dd5['count'];var _0x274b8d=_0x37c87a?0x0:_0x5f20f2[_0x7a33('0x1e')];var _0x15a7db=_0x37c87a?_0x4c7dd5[_0x7a33('0x1f')]:_0x5f20f2['offset']+_0x5f20f2[_0x7a33('0x1d')];var _0x4b6c49;if(_0x15a7db>=_0x74edd0){_0x15a7db=_0x74edd0;_0x4b6c49=0xc8;}else{_0x4b6c49=0xce;}_0x5b81c9[_0x7a33('0x19')](_0x4b6c49);return _0x5b81c9[_0x7a33('0x20')]('Content-Range',_0x274b8d+'-'+_0x15a7db+'/'+_0x74edd0)[_0x7a33('0x1b')](_0x4c7dd5);}return null;};}function patchUpdates(_0x217108){return function(_0x5d7c8a){try{jsonpatch[_0x7a33('0x21')](_0x5d7c8a,_0x217108,!![]);}catch(_0x35c485){return BPromise[_0x7a33('0x22')](_0x35c485);}return _0x5d7c8a[_0x7a33('0x23')]();};}function saveUpdates(_0x3b0f03,_0xbc6b09){return function(_0x43af25){if(_0x43af25){return _0x43af25[_0x7a33('0x24')](_0x3b0f03)['then'](function(_0x282409){return _0x282409;});}return null;};}function removeEntity(_0xcc5a8b,_0xaff149){return function(_0x28b799){if(_0x28b799){return _0x28b799[_0x7a33('0x25')]()[_0x7a33('0x26')](function(){_0xcc5a8b[_0x7a33('0x19')](0xcc)[_0x7a33('0x1a')]();});}};}function handleEntityNotFound(_0x21dc70,_0x11f60c){return function(_0x314ad1){if(!_0x314ad1){_0x21dc70[_0x7a33('0x18')](0x194);}return _0x314ad1;};}function handleError(_0x245d82,_0x25ad93){_0x25ad93=_0x25ad93||0x1f4;return function(_0x1f038e){logger[_0x7a33('0x27')](_0x1f038e['stack']);if(_0x1f038e['name']){delete _0x1f038e[_0x7a33('0x28')];}_0x245d82[_0x7a33('0x19')](_0x25ad93)[_0x7a33('0x29')](_0x1f038e);};}exports['index']=function(_0x454be1,_0x5a096e){var _0x44857c={},_0x4603cf={},_0x3aa572={'count':0x0,'rows':[]};var _0x31aef1=_[_0x7a33('0x2a')](db[_0x7a33('0x2b')][_0x7a33('0x2c')],function(_0x178bee){return{'name':_0x178bee[_0x7a33('0x2d')],'type':_0x178bee[_0x7a33('0x2e')][_0x7a33('0x2f')]};});_0x4603cf['model']=_[_0x7a33('0x2a')](_0x31aef1,_0x7a33('0x28'));_0x4603cf[_0x7a33('0x30')]=_[_0x7a33('0x31')](_0x454be1['query']);_0x4603cf['filters']=_[_0x7a33('0x32')](_0x4603cf['model'],_0x4603cf[_0x7a33('0x30')]);_0x44857c[_0x7a33('0x33')]=_[_0x7a33('0x32')](_0x4603cf[_0x7a33('0x34')],qs[_0x7a33('0x35')](_0x454be1[_0x7a33('0x30')][_0x7a33('0x35')]));_0x44857c['attributes']=_0x44857c['attributes'][_0x7a33('0x36')]?_0x44857c[_0x7a33('0x33')]:_0x4603cf[_0x7a33('0x34')];if(!_0x454be1['query'][_0x7a33('0x37')]('nolimit')){_0x44857c[_0x7a33('0x1d')]=qs[_0x7a33('0x1d')](_0x454be1[_0x7a33('0x30')][_0x7a33('0x1d')]);_0x44857c['offset']=qs['offset'](_0x454be1[_0x7a33('0x30')][_0x7a33('0x1e')]);}_0x44857c['order']=qs[_0x7a33('0x38')](_0x454be1['query'][_0x7a33('0x38')]);_0x44857c['where']=qs[_0x7a33('0x39')](_['pick'](_0x454be1[_0x7a33('0x30')],_0x4603cf[_0x7a33('0x39')]),_0x31aef1);if(_0x454be1[_0x7a33('0x30')][_0x7a33('0x3a')]){_0x44857c[_0x7a33('0x3b')]=_[_0x7a33('0x3c')](_0x44857c[_0x7a33('0x3b')],{'$or':_[_0x7a33('0x2a')](_0x31aef1,function(_0x359ef3){if(_0x359ef3[_0x7a33('0x2e')]!==_0x7a33('0x3d')){var _0x1eef92={};_0x1eef92[_0x359ef3[_0x7a33('0x28')]]={'$like':'%'+_0x454be1[_0x7a33('0x30')][_0x7a33('0x3a')]+'%'};return _0x1eef92;}})});}_0x44857c=_[_0x7a33('0x3c')]({},_0x44857c,_0x454be1[_0x7a33('0x3e')]);var _0x2f1e58={'where':_0x44857c['where']};return db[_0x7a33('0x2b')][_0x7a33('0x1f')](_0x2f1e58)['then'](function(_0x5f1338){_0x3aa572['count']=_0x5f1338;if(_0x454be1['query'][_0x7a33('0x3f')]){_0x44857c[_0x7a33('0x40')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x44857c);})[_0x7a33('0x26')](function(_0x424486){_0x3aa572[_0x7a33('0x41')]=_0x424486;return _0x3aa572;})['then'](respondWithFilteredResult(_0x5a096e,_0x44857c))[_0x7a33('0x42')](handleError(_0x5a096e,null));};exports[_0x7a33('0x43')]=function(_0x113bc0,_0x2a1368){var _0x1f2a80={'raw':!![],'where':{'id':_0x113bc0['params']['id']}},_0x4956ed={};_0x4956ed['model']=_[_0x7a33('0x31')](db[_0x7a33('0x2b')][_0x7a33('0x2c')]);_0x4956ed['query']=_['keys'](_0x113bc0[_0x7a33('0x30')]);_0x4956ed[_0x7a33('0x39')]=_[_0x7a33('0x32')](_0x4956ed[_0x7a33('0x34')],_0x4956ed[_0x7a33('0x30')]);_0x1f2a80[_0x7a33('0x33')]=_[_0x7a33('0x32')](_0x4956ed[_0x7a33('0x34')],qs[_0x7a33('0x35')](_0x113bc0['query'][_0x7a33('0x35')]));_0x1f2a80[_0x7a33('0x33')]=_0x1f2a80[_0x7a33('0x33')][_0x7a33('0x36')]?_0x1f2a80['attributes']:_0x4956ed[_0x7a33('0x34')];if(_0x113bc0[_0x7a33('0x30')][_0x7a33('0x3f')]){_0x1f2a80[_0x7a33('0x40')]=[{'all':!![]}];}_0x1f2a80=_[_0x7a33('0x3c')]({},_0x1f2a80,_0x113bc0[_0x7a33('0x3e')]);return db[_0x7a33('0x2b')][_0x7a33('0x44')](_0x1f2a80)[_0x7a33('0x26')](handleEntityNotFound(_0x2a1368,null))['then'](respondWithResult(_0x2a1368,null))[_0x7a33('0x42')](handleError(_0x2a1368,null));};exports[_0x7a33('0x45')]=function(_0x133e20,_0x582e4e){return db[_0x7a33('0x2b')]['create'](_0x133e20[_0x7a33('0x46')],{})[_0x7a33('0x26')](respondWithResult(_0x582e4e,0xc9))[_0x7a33('0x42')](handleError(_0x582e4e,null));};exports['update']=function(_0x363089,_0xef13bc){if(_0x363089[_0x7a33('0x46')]['id']){delete _0x363089['body']['id'];}return db[_0x7a33('0x2b')][_0x7a33('0x44')]({'where':{'id':_0x363089[_0x7a33('0x47')]['id']}})[_0x7a33('0x26')](handleEntityNotFound(_0xef13bc,null))[_0x7a33('0x26')](saveUpdates(_0x363089[_0x7a33('0x46')],null))[_0x7a33('0x26')](respondWithResult(_0xef13bc,null))[_0x7a33('0x42')](handleError(_0xef13bc,null));};exports[_0x7a33('0x25')]=function(_0x19cd83,_0x2e1b7f){return db[_0x7a33('0x2b')][_0x7a33('0x44')]({'where':{'id':_0x19cd83[_0x7a33('0x47')]['id']}})[_0x7a33('0x26')](handleEntityNotFound(_0x2e1b7f,null))[_0x7a33('0x26')](removeEntity(_0x2e1b7f,null))[_0x7a33('0x42')](handleError(_0x2e1b7f,null));};exports[_0x7a33('0x48')]=function(_0x4e53d3,_0x8e8efc){return db[_0x7a33('0x2b')][_0x7a33('0x48')]()[_0x7a33('0x26')](respondWithResult(_0x8e8efc,null))[_0x7a33('0x42')](handleError(_0x8e8efc,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 259aa41..4103d22 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 _0x847f=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','MailTransferReport'];(function(_0x2c7d28,_0x41a93f){var _0x4db35d=function(_0x398482){while(--_0x398482){_0x2c7d28['push'](_0x2c7d28['shift']());}};_0x4db35d(++_0x41a93f);}(_0x847f,0x182));var _0xf847=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x847f[_0x3b90ab];return _0x206e92;};'use strict';var _=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var logger=require(_0xf847('0x2'))('api');var moment=require(_0xf847('0x3'));var BPromise=require(_0xf847('0x4'));var rp=require(_0xf847('0x5'));var fs=require('fs');var path=require(_0xf847('0x6'));var rimraf=require(_0xf847('0x7'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0xf847('0x8')]=function(_0x1cf273,_0x587c53){return _0x1cf273['define'](_0xf847('0x9'),attributes,{'tableName':_0xf847('0xa'),'paranoid':![],'indexes':[{'name':_0xf847('0xb'),'fields':[_0xf847('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc492=['../../config/environment','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x4e59e8,_0x4cb70a){var _0x5f8aa=function(_0x49887a){while(--_0x49887a){_0x4e59e8['push'](_0x4e59e8['shift']());}};_0x5f8aa(++_0x4cb70a);}(_0xc492,0xd7));var _0x2c49=function(_0x4d3096,_0x2edfa5){_0x4d3096=_0x4d3096-0x0;var _0xd68839=_0xc492[_0x4d3096];return _0xd68839;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var logger=require(_0x2c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0x2c49('0x6')]=function(_0x499c4e,_0x3ad911){return _0x499c4e[_0x2c49('0x7')]('MailTransferReport',attributes,{'tableName':_0x2c49('0x8'),'paranoid':![],'indexes':[{'name':_0x2c49('0x9'),'fields':[_0x2c49('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 96a1077..e55f88b 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 _0x1f68=['request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x255798,_0x355e09){var _0x783391=function(_0x54984b){while(--_0x54984b){_0x255798['push'](_0x255798['shift']());}};_0x783391(++_0x355e09);}(_0x1f68,0x1b8));var _0x81f6=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x1f68[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x81f6('0x0'));var util=require(_0x81f6('0x1'));var moment=require('moment');var BPromise=require(_0x81f6('0x2'));var rs=require(_0x81f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81f6('0x4'))['db'];var utils=require(_0x81f6('0x5'));var logger=require(_0x81f6('0x6'))(_0x81f6('0x7'));var config=require('../../config/environment');var jayson=require(_0x81f6('0x8'));var client=jayson[_0x81f6('0x9')][_0x81f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f281a,_0x34e311,_0x5d8941){return new BPromise(function(_0x2e4429,_0x5e790a){return client[_0x81f6('0xb')](_0x1f281a,_0x5d8941)[_0x81f6('0xc')](function(_0x52cc1c){logger[_0x81f6('0xd')](_0x81f6('0xe'),_0x34e311,'request\x20sent');logger[_0x81f6('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x34e311,'request\x20sent',JSON[_0x81f6('0x10')](_0x52cc1c));if(_0x52cc1c[_0x81f6('0x11')]){if(_0x52cc1c[_0x81f6('0x11')][_0x81f6('0x12')]===0x1f4){logger[_0x81f6('0x11')](_0x81f6('0xe'),_0x34e311,_0x52cc1c[_0x81f6('0x11')][_0x81f6('0x13')]);return _0x5e790a(_0x52cc1c['error'][_0x81f6('0x13')]);}logger['error'](_0x81f6('0xe'),_0x34e311,_0x52cc1c[_0x81f6('0x11')]['message']);return _0x2e4429(_0x52cc1c[_0x81f6('0x11')][_0x81f6('0x13')]);}else{logger[_0x81f6('0xd')](_0x81f6('0xe'),_0x34e311,_0x81f6('0x14'));_0x2e4429(_0x52cc1c[_0x81f6('0x15')]['message']);}})[_0x81f6('0x16')](function(_0x49c45c){logger[_0x81f6('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x34e311,_0x49c45c);_0x5e790a(_0x49c45c);});});} \ No newline at end of file +var _0xff97=['request','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','MailTransferReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x43130c,_0x1a0e3e){var _0x570f1a=function(_0x4d2eca){while(--_0x4d2eca){_0x43130c['push'](_0x43130c['shift']());}};_0x570f1a(++_0x1a0e3e);}(_0xff97,0x17c));var _0x7ff9=function(_0x2435a5,_0x33069f){_0x2435a5=_0x2435a5-0x0;var _0x45cb35=_0xff97[_0x2435a5];return _0x45cb35;};'use strict';var _=require(_0x7ff9('0x0'));var util=require(_0x7ff9('0x1'));var moment=require(_0x7ff9('0x2'));var BPromise=require(_0x7ff9('0x3'));var rs=require(_0x7ff9('0x4'));var fs=require('fs');var Redis=require(_0x7ff9('0x5'));var db=require(_0x7ff9('0x6'))['db'];var utils=require(_0x7ff9('0x7'));var logger=require('../../config/logger')(_0x7ff9('0x8'));var config=require('../../config/environment');var jayson=require(_0x7ff9('0x9'));var client=jayson[_0x7ff9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5dc8,_0x2dcc2d,_0x4c64e0){return new BPromise(function(_0x51bed5,_0xd44039){return client[_0x7ff9('0xb')](_0x4b5dc8,_0x4c64e0)[_0x7ff9('0xc')](function(_0x205dd0){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2dcc2d,_0x7ff9('0xd'));logger[_0x7ff9('0xe')](_0x7ff9('0xf'),_0x2dcc2d,'request\x20sent',JSON['stringify'](_0x205dd0));if(_0x205dd0[_0x7ff9('0x10')]){if(_0x205dd0[_0x7ff9('0x10')][_0x7ff9('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2dcc2d,_0x205dd0[_0x7ff9('0x10')]['message']);return _0xd44039(_0x205dd0[_0x7ff9('0x10')][_0x7ff9('0x12')]);}logger[_0x7ff9('0x10')](_0x7ff9('0x13'),_0x2dcc2d,_0x205dd0[_0x7ff9('0x10')][_0x7ff9('0x12')]);return _0x51bed5(_0x205dd0[_0x7ff9('0x10')][_0x7ff9('0x12')]);}else{logger[_0x7ff9('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x2dcc2d,_0x7ff9('0xd'));_0x51bed5(_0x205dd0[_0x7ff9('0x15')][_0x7ff9('0x12')]);}})[_0x7ff9('0x16')](function(_0x19b209){logger[_0x7ff9('0x10')](_0x7ff9('0x13'),_0x2dcc2d,_0x19b209);_0xd44039(_0x19b209);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index e79691e..02e5e4d 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 _0x1ea3=['exports','multer','util','path','express','Router','../../components/auth/service','./memberReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x5d1c91,_0x389e7f){var _0x328eef=function(_0x5cb0f1){while(--_0x5cb0f1){_0x5d1c91['push'](_0x5d1c91['shift']());}};_0x328eef(++_0x389e7f);}(_0x1ea3,0x1c9));var _0x31ea=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x1ea3[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x31ea('0x0'));var util=require(_0x31ea('0x1'));var path=require(_0x31ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x31ea('0x3'));var router=express[_0x31ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31ea('0x6'));router[_0x31ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x31ea('0x8')]);router[_0x31ea('0x7')](_0x31ea('0x9'),auth[_0x31ea('0xa')](),controller['describe']);router['get'](_0x31ea('0xb'),auth[_0x31ea('0xa')](),controller[_0x31ea('0xc')]);router[_0x31ea('0xd')]('/',auth[_0x31ea('0xa')](),controller[_0x31ea('0xe')]);router['put'](_0x31ea('0xb'),auth[_0x31ea('0xa')](),controller[_0x31ea('0xf')]);router[_0x31ea('0x10')](_0x31ea('0xb'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x11')]);module[_0x31ea('0x12')]=router; \ No newline at end of file +var _0x7661=['../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x46fcf2,_0x2e8341){var _0x5258c1=function(_0xe0f26b){while(--_0xe0f26b){_0x46fcf2['push'](_0x46fcf2['shift']());}};_0x5258c1(++_0x2e8341);}(_0x7661,0x1c8));var _0x1766=function(_0x27e226,_0x4a1d20){_0x27e226=_0x27e226-0x0;var _0x16c724=_0x7661[_0x27e226];return _0x16c724;};'use strict';var multer=require(_0x1766('0x0'));var util=require(_0x1766('0x1'));var path=require('path');var timeout=require(_0x1766('0x2'));var express=require(_0x1766('0x3'));var router=express[_0x1766('0x4')]();var fs_extra=require(_0x1766('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1766('0x6'));var config=require(_0x1766('0x7'));var controller=require(_0x1766('0x8'));router[_0x1766('0x9')]('/',auth['isAuthenticated'](),controller[_0x1766('0xa')]);router[_0x1766('0x9')](_0x1766('0xb'),auth[_0x1766('0xc')](),controller[_0x1766('0xd')]);router[_0x1766('0x9')]('/:id',auth[_0x1766('0xc')](),controller[_0x1766('0xe')]);router[_0x1766('0xf')]('/',auth['isAuthenticated'](),controller[_0x1766('0x10')]);router[_0x1766('0x11')](_0x1766('0x12'),auth[_0x1766('0xc')](),controller[_0x1766('0x13')]);router['delete'](_0x1766('0x12'),auth['isAuthenticated'](),controller[_0x1766('0x14')]);module[_0x1766('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 31a9c37..fbff4ea 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 _0x0803=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x0803,0x1d6));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3080('0x0'));var moment=require(_0x3080('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3080('0x2')]},'interface':{'type':Sequelize[_0x3080('0x2')]},'type':{'type':Sequelize[_0x3080('0x2')],'defaultValue':_0x3080('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x3080('0x4')]},'enterAt':{'type':Sequelize[_0x3080('0x5')]},'exitAt':{'type':Sequelize[_0x3080('0x5')],'set':function(_0x208ccb){var _0x530850=moment(_0x208ccb);var _0x176259=moment(this[_0x3080('0x6')](_0x3080('0x7')));var _0x22edd7=_0x530850[_0x3080('0x8')](_0x176259,_0x3080('0x9'));this[_0x3080('0xa')]('exitAt',_0x208ccb);this[_0x3080('0xa')](_0x3080('0xb'),_0x22edd7>=0x0?_0x22edd7:null);}},'data1':{'type':Sequelize[_0x3080('0x2')],'comment':_0x3080('0xc')},'data2':{'type':Sequelize[_0x3080('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x3080('0x2')],'comment':_0x3080('0xd')},'data4':{'type':Sequelize[_0x3080('0x2')],'comment':_0x3080('0xe')},'data5':{'type':Sequelize[_0x3080('0x2')],'comment':_0x3080('0xf')},'role':{'type':Sequelize[_0x3080('0x2')]},'internal':{'type':Sequelize[_0x3080('0x4')]},'uniqueid':{'type':Sequelize[_0x3080('0x2')]}}; \ No newline at end of file +var _0xcfc6=['diff','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xcfc6,0x16e));var _0x6cfc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfc6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6cfc('0x0'));var moment=require(_0x6cfc('0x1'));module[_0x6cfc('0x2')]={'channel':{'type':Sequelize[_0x6cfc('0x3')]},'membername':{'type':Sequelize[_0x6cfc('0x3')]},'interface':{'type':Sequelize[_0x6cfc('0x3')]},'type':{'type':Sequelize[_0x6cfc('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x6cfc('0x4')},'duration':{'type':Sequelize[_0x6cfc('0x5')]},'enterAt':{'type':Sequelize[_0x6cfc('0x6')]},'exitAt':{'type':Sequelize[_0x6cfc('0x6')],'set':function(_0xcbebe5){var _0x35cdf4=moment(_0xcbebe5);var _0x43fb56=moment(this[_0x6cfc('0x7')](_0x6cfc('0x8')));var _0x2c7741=_0x35cdf4[_0x6cfc('0x9')](_0x43fb56,'seconds');this[_0x6cfc('0xa')](_0x6cfc('0xb'),_0xcbebe5);this['setDataValue'](_0x6cfc('0xc'),_0x2c7741>=0x0?_0x2c7741:null);}},'data1':{'type':Sequelize[_0x6cfc('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x6cfc('0x3')],'comment':_0x6cfc('0xd')},'data3':{'type':Sequelize[_0x6cfc('0x3')],'comment':_0x6cfc('0xe')},'data4':{'type':Sequelize[_0x6cfc('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x6cfc('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x6cfc('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6cfc('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b2c942d..3a00351 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xedd9,0xfc));var _0x9edd=function(_0x5c56d8,_0x2c6245){_0x5c56d8=_0x5c56d8-0x0;var _0x38c39c=_0xedd9[_0x5c56d8];return _0x38c39c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55ca,0x126));var _0xa55c=function(_0x56e2a0,_0x13b891){_0x56e2a0=_0x56e2a0-0x0;var _0x1b3b78=_0x55ca[_0x56e2a0];return _0x1b3b78;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));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('0x7'));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 licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];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=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a46faf5..8abe9de 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 _0x4148=['membername','interface','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','report_member','membername_interface'];(function(_0x17af2c,_0x5ddbcc){var _0x1abd0b=function(_0x4f1bfc){while(--_0x4f1bfc){_0x17af2c['push'](_0x17af2c['shift']());}};_0x1abd0b(++_0x5ddbcc);}(_0x4148,0xc6));var _0x8414=function(_0x58eca9,_0x219608){_0x58eca9=_0x58eca9-0x0;var _0x25a12e=_0x4148[_0x58eca9];return _0x25a12e;};'use strict';var _=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var logger=require(_0x8414('0x2'))(_0x8414('0x3'));var moment=require(_0x8414('0x4'));var BPromise=require('bluebird');var rp=require(_0x8414('0x5'));var fs=require('fs');var path=require(_0x8414('0x6'));var rimraf=require(_0x8414('0x7'));var config=require(_0x8414('0x8'));var attributes=require('./memberReport.attributes');module[_0x8414('0x9')]=function(_0x5119d0,_0x8b350a){return _0x5119d0['define']('MemberReport',attributes,{'tableName':_0x8414('0xa'),'paranoid':![],'indexes':[{'name':_0x8414('0xb'),'fields':[_0x8414('0xc'),_0x8414('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf969=['report_member','interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports','MemberReport'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xf969,0xc5));var _0x9f96=function(_0x1b39e7,_0x185328){_0x1b39e7=_0x1b39e7-0x0;var _0x24936b=_0xf969[_0x1b39e7];return _0x24936b;};'use strict';var _=require(_0x9f96('0x0'));var util=require(_0x9f96('0x1'));var logger=require(_0x9f96('0x2'))(_0x9f96('0x3'));var moment=require(_0x9f96('0x4'));var BPromise=require(_0x9f96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f96('0x6'));var rimraf=require('rimraf');var config=require(_0x9f96('0x7'));var attributes=require(_0x9f96('0x8'));module[_0x9f96('0x9')]=function(_0x45ccd5,_0x5955b1){return _0x45ccd5['define'](_0x9f96('0xa'),attributes,{'tableName':_0x9f96('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x9f96('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 3763cf3..aa768d6 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 _0xe14b=['debug','UpdateMemberReport','limit','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','include','model','map','stringify','CreateMemberReport','create','body'];(function(_0x2867a6,_0x10d905){var _0x4afc2b=function(_0x457840){while(--_0x457840){_0x2867a6['push'](_0x2867a6['shift']());}};_0x4afc2b(++_0x10d905);}(_0xe14b,0x93));var _0xbe14=function(_0x2cb8be,_0x12d0aa){_0x2cb8be=_0x2cb8be-0x0;var _0xa8ac69=_0xe14b[_0x2cb8be];return _0xa8ac69;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'limit':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['limit']||null:null,'include':_0x29ab73[_0xbe14('0x16')]?_0x29ab73['options'][_0xbe14('0x1a')]?_['map'](_0x29ab73[_0xbe14('0x16')][_0xbe14('0x1a')],function(_0x505dbd){return{'model':db[_0x505dbd[_0xbe14('0x1b')]],'as':_0x505dbd['as'],'attributes':_0x505dbd['attributes'],'include':_0x505dbd[_0xbe14('0x1a')]?_['map'](_0x505dbd[_0xbe14('0x1a')],function(_0x5fa043){return{'model':db[_0x5fa043[_0xbe14('0x1b')]],'as':_0x5fa043['as'],'attributes':_0x5fa043[_0xbe14('0x19')],'include':_0x5fa043[_0xbe14('0x1a')]?_[_0xbe14('0x1c')](_0x5fa043['include'],function(_0x1822e0){return{'model':db[_0x1822e0[_0xbe14('0x1b')]],'as':_0x1822e0['as'],'attributes':_0x1822e0[_0xbe14('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x5dd475){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x5dd475));_0x5ea1f8(_0x5dd475);})[_0xbe14('0x12')](function(_0x19252f){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x19252f[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x19252f[_0xbe14('0x10')]));});});};exports[_0xbe14('0x1e')]=function(_0x40538f){var _0x3bf43c=this;return new Promise(function(_0x39dc0a,_0x10ae36){return db[_0xbe14('0x14')][_0xbe14('0x1f')](_0x40538f[_0xbe14('0x20')],{'raw':_0x40538f[_0xbe14('0x16')]?_0x40538f[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2e33e1){logger['info']('CreateMemberReport',_0x40538f);logger[_0xbe14('0x21')]('CreateMemberReport',_0x40538f,JSON[_0xbe14('0x1d')](_0x2e33e1));_0x39dc0a(_0x2e33e1);})[_0xbe14('0x12')](function(_0x52a25c){logger['error']('CreateMemberReport',_0x52a25c[_0xbe14('0x10')],_0x40538f);_0x10ae36(_0x3bf43c[_0xbe14('0xe')](0x1f4,_0x52a25c['message']));});});};exports[_0xbe14('0x22')]=function(_0x1faf3e){var _0x452635=this;return new Promise(function(_0x1aa849,_0x29c23e){return db['MemberReport']['update'](_0x1faf3e[_0xbe14('0x20')],{'raw':_0x1faf3e['options']?_0x1faf3e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1faf3e[_0xbe14('0x16')]?_0x1faf3e[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x1faf3e[_0xbe14('0x16')]?_0x1faf3e[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'limit':_0x1faf3e[_0xbe14('0x16')]?_0x1faf3e[_0xbe14('0x16')][_0xbe14('0x23')]||null:null})[_0xbe14('0x9')](function(_0x41652d){logger[_0xbe14('0xa')]('UpdateMemberReport',_0x1faf3e);logger['debug'](_0xbe14('0x22'),_0x1faf3e,JSON[_0xbe14('0x1d')](_0x41652d));_0x1aa849(_0x41652d);})[_0xbe14('0x12')](function(_0x520e09){logger[_0xbe14('0xe')](_0xbe14('0x22'),_0x520e09[_0xbe14('0x10')],_0x1faf3e);_0x29c23e(_0x452635[_0xbe14('0xe')](0x1f4,_0x520e09[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0xe928=['raw','attributes','limit','model','include','map','CreateMemberReport','create','update','UpdateMemberReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options'];(function(_0x998b12,_0x2b32fb){var _0x3000d5=function(_0x45bb9b){while(--_0x45bb9b){_0x998b12['push'](_0x998b12['shift']());}};_0x3000d5(++_0x2b32fb);}(_0xe928,0x145));var _0x8e92=function(_0x4739e0,_0x58b895){_0x4739e0=_0x4739e0-0x0;var _0xb5c74d=_0xe928[_0x4739e0];return _0xb5c74d;};'use strict';var _=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var moment=require(_0x8e92('0x2'));var BPromise=require('bluebird');var rs=require(_0x8e92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e92('0x4'))['db'];var utils=require(_0x8e92('0x5'));var logger=require(_0x8e92('0x6'))(_0x8e92('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e92('0x8'));var client=jayson['client'][_0x8e92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe4eff3,_0x14811b,_0x76e11){return new BPromise(function(_0x59e109,_0x361fd2){return client['request'](_0xe4eff3,_0x76e11)[_0x8e92('0xa')](function(_0x8cc27a){logger[_0x8e92('0xb')](_0x8e92('0xc'),_0x14811b,_0x8e92('0xd'));logger[_0x8e92('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x14811b,_0x8e92('0xd'),JSON[_0x8e92('0xf')](_0x8cc27a));if(_0x8cc27a[_0x8e92('0x10')]){if(_0x8cc27a['error'][_0x8e92('0x11')]===0x1f4){logger[_0x8e92('0x10')](_0x8e92('0xc'),_0x14811b,_0x8cc27a[_0x8e92('0x10')][_0x8e92('0x12')]);return _0x361fd2(_0x8cc27a[_0x8e92('0x10')][_0x8e92('0x12')]);}logger['error'](_0x8e92('0xc'),_0x14811b,_0x8cc27a['error'][_0x8e92('0x12')]);return _0x59e109(_0x8cc27a[_0x8e92('0x10')]['message']);}else{logger[_0x8e92('0xb')]('MemberReport,\x20%s,\x20%s',_0x14811b,_0x8e92('0xd'));_0x59e109(_0x8cc27a[_0x8e92('0x13')][_0x8e92('0x12')]);}})[_0x8e92('0x14')](function(_0x1c4b12){logger[_0x8e92('0x10')](_0x8e92('0xc'),_0x14811b,_0x1c4b12);_0x361fd2(_0x1c4b12);});});}exports[_0x8e92('0x15')]=function(_0x55f325){var _0x3dfb4c=this;return new Promise(function(_0x192b0b,_0x3a7417){return db[_0x8e92('0x16')][_0x8e92('0x17')]({'raw':_0x55f325['options']?_0x55f325[_0x8e92('0x18')][_0x8e92('0x19')]===undefined?!![]:![]:!![],'where':_0x55f325['options']?_0x55f325['options']['where']||null:null,'attributes':_0x55f325[_0x8e92('0x18')]?_0x55f325['options'][_0x8e92('0x1a')]||null:null,'limit':_0x55f325[_0x8e92('0x18')]?_0x55f325[_0x8e92('0x18')][_0x8e92('0x1b')]||null:null,'include':_0x55f325[_0x8e92('0x18')]?_0x55f325[_0x8e92('0x18')]['include']?_['map'](_0x55f325['options']['include'],function(_0x322765){return{'model':db[_0x322765[_0x8e92('0x1c')]],'as':_0x322765['as'],'attributes':_0x322765[_0x8e92('0x1a')],'include':_0x322765[_0x8e92('0x1d')]?_[_0x8e92('0x1e')](_0x322765[_0x8e92('0x1d')],function(_0x585adb){return{'model':db[_0x585adb[_0x8e92('0x1c')]],'as':_0x585adb['as'],'attributes':_0x585adb[_0x8e92('0x1a')],'include':_0x585adb[_0x8e92('0x1d')]?_[_0x8e92('0x1e')](_0x585adb[_0x8e92('0x1d')],function(_0x2aaf1d){return{'model':db[_0x2aaf1d['model']],'as':_0x2aaf1d['as'],'attributes':_0x2aaf1d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d3df5){logger['info'](_0x8e92('0x15'),_0x55f325);logger['debug'](_0x8e92('0x15'),_0x55f325,JSON['stringify'](_0x1d3df5));_0x192b0b(_0x1d3df5);})[_0x8e92('0x14')](function(_0x57c4de){logger[_0x8e92('0x10')](_0x8e92('0x15'),_0x57c4de[_0x8e92('0x12')],_0x55f325);_0x3a7417(_0x3dfb4c[_0x8e92('0x10')](0x1f4,_0x57c4de['message']));});});};exports[_0x8e92('0x1f')]=function(_0x405df5){var _0x4c11ef=this;return new Promise(function(_0x2dbd8f,_0x4ddfea){return db[_0x8e92('0x16')][_0x8e92('0x20')](_0x405df5['body'],{'raw':_0x405df5[_0x8e92('0x18')]?_0x405df5[_0x8e92('0x18')][_0x8e92('0x19')]===undefined?!![]:![]:!![]})[_0x8e92('0xa')](function(_0x158fb2){logger[_0x8e92('0xb')](_0x8e92('0x1f'),_0x405df5);logger[_0x8e92('0xe')](_0x8e92('0x1f'),_0x405df5,JSON['stringify'](_0x158fb2));_0x2dbd8f(_0x158fb2);})['catch'](function(_0x456914){logger['error']('CreateMemberReport',_0x456914[_0x8e92('0x12')],_0x405df5);_0x4ddfea(_0x4c11ef[_0x8e92('0x10')](0x1f4,_0x456914[_0x8e92('0x12')]));});});};exports['UpdateMemberReport']=function(_0x2fdbe5){var _0x316593=this;return new Promise(function(_0x300be0,_0x5c462b){return db['MemberReport'][_0x8e92('0x21')](_0x2fdbe5['body'],{'raw':_0x2fdbe5[_0x8e92('0x18')]?_0x2fdbe5[_0x8e92('0x18')][_0x8e92('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fdbe5[_0x8e92('0x18')]?_0x2fdbe5[_0x8e92('0x18')]['where']||null:null,'attributes':_0x2fdbe5[_0x8e92('0x18')]?_0x2fdbe5[_0x8e92('0x18')][_0x8e92('0x1a')]||null:null,'limit':_0x2fdbe5['options']?_0x2fdbe5['options'][_0x8e92('0x1b')]||null:null})['then'](function(_0x20777d){logger[_0x8e92('0xb')](_0x8e92('0x22'),_0x2fdbe5);logger[_0x8e92('0xe')]('UpdateMemberReport',_0x2fdbe5,JSON['stringify'](_0x20777d));_0x300be0(_0x20777d);})['catch'](function(_0x206534){logger['error'](_0x8e92('0x22'),_0x206534['message'],_0x2fdbe5);_0x5c462b(_0x316593['error'](0x1f4,_0x206534['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 02a2cc4..4ba01f0 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 _0xa43a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','exports','multer','util','path','connect-timeout'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xa43a,0xe3));var _0xaa43=function(_0x4ce69c,_0x26bb47){_0x4ce69c=_0x4ce69c-0x0;var _0x494c49=_0xa43a[_0x4ce69c];return _0x494c49;};'use strict';var multer=require(_0xaa43('0x0'));var util=require(_0xaa43('0x1'));var path=require(_0xaa43('0x2'));var timeout=require(_0xaa43('0x3'));var express=require(_0xaa43('0x4'));var router=express[_0xaa43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaa43('0x6'));var interaction=require(_0xaa43('0x7'));var config=require(_0xaa43('0x8'));var controller=require(_0xaa43('0x9'));router['get']('/',controller['index']);module[_0xaa43('0xa')]=router; \ No newline at end of file +var _0xfb67=['./migration.controller','get','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x496ca4,_0x7cc3fa){var _0x5e1e22=function(_0x5f03a1){while(--_0x5f03a1){_0x496ca4['push'](_0x496ca4['shift']());}};_0x5e1e22(++_0x7cc3fa);}(_0xfb67,0x1f2));var _0x7fb6=function(_0x2e9ebf,_0x264263){_0x2e9ebf=_0x2e9ebf-0x0;var _0x20fc91=_0xfb67[_0x2e9ebf];return _0x20fc91;};'use strict';var multer=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var path=require(_0x7fb6('0x2'));var timeout=require('connect-timeout');var express=require(_0x7fb6('0x3'));var router=express[_0x7fb6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7fb6('0x5'));var config=require('../../config/environment');var controller=require(_0x7fb6('0x6'));router[_0x7fb6('0x7')]('/',controller['index']);module[_0x7fb6('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 99326af..9325d94 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 _0x9cda=['STRING','version','exports'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0x9cda,0x1df));var _0xa9cd=function(_0x29130b,_0x478288){_0x29130b=_0x29130b-0x0;var _0x3d1790=_0x9cda[_0x29130b];return _0x3d1790;};'use strict';var Sequelize=require('sequelize');module[_0xa9cd('0x0')]={'version':{'type':Sequelize[_0xa9cd('0x1')],'unique':_0xa9cd('0x2')}}; \ No newline at end of file +var _0xdf54=['version','exports','STRING'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xdf54,0x9d));var _0x4df5=function(_0x941d1b,_0x1649de){_0x941d1b=_0x941d1b-0x0;var _0x37ae15=_0xdf54[_0x941d1b];return _0x37ae15;};'use strict';var Sequelize=require('sequelize');module[_0x4df5('0x0')]={'version':{'type':Sequelize[_0x4df5('0x1')],'unique':_0x4df5('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ec674db..f7c75bb 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 _0x3df6=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Migration','includeAll','catch','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x267a2b,_0x8e6d3e){var _0x596392=function(_0x18d44f){while(--_0x18d44f){_0x267a2b['push'](_0x267a2b['shift']());}};_0x596392(++_0x8e6d3e);}(_0x3df6,0xa8));var _0x63df=function(_0x86ada4,_0x583265){_0x86ada4=_0x86ada4-0x0;var _0x337bbc=_0x3df6[_0x86ada4];return _0x337bbc;};'use strict';var emlformat=require(_0x63df('0x0'));var rimraf=require(_0x63df('0x1'));var zipdir=require(_0x63df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63df('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x63df('0x4'));var util=require('util');var path=require(_0x63df('0x5'));var sox=require(_0x63df('0x6'));var csv=require('to-csv');var ejs=require(_0x63df('0x7'));var fs=require('fs');var fs_extra=require(_0x63df('0x8'));var _=require(_0x63df('0x9'));var squel=require(_0x63df('0xa'));var crypto=require(_0x63df('0xb'));var jsforce=require(_0x63df('0xc'));var deskjs=require(_0x63df('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63df('0xe'));var Papa=require(_0x63df('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63df('0x10'));var as=require(_0x63df('0x11'));var hardwareService=require(_0x63df('0x12'));var logger=require('../../config/logger')(_0x63df('0x13'));var utils=require(_0x63df('0x14'));var config=require(_0x63df('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x63df('0x16'))['db'];function respondWithStatusCode(_0x33e9e4,_0xba3237){_0xba3237=_0xba3237||0xcc;return function(_0x54abc4){if(_0x54abc4){return _0x33e9e4[_0x63df('0x17')](_0xba3237);}return _0x33e9e4[_0x63df('0x18')](_0xba3237)[_0x63df('0x19')]();};}function respondWithResult(_0x584a1c,_0x3bf9b3){_0x3bf9b3=_0x3bf9b3||0xc8;return function(_0xdafec9){if(_0xdafec9){return _0x584a1c[_0x63df('0x18')](_0x3bf9b3)[_0x63df('0x1a')](_0xdafec9);}};}function respondWithFilteredResult(_0x3b108e,_0x578558){return function(_0x47f81c){if(_0x47f81c){var _0x1d3aee=typeof _0x578558[_0x63df('0x1b')]===_0x63df('0x1c')&&typeof _0x578558[_0x63df('0x1d')]===_0x63df('0x1c');var _0xf57bd5=_0x47f81c['count'];var _0x3e6f95=_0x1d3aee?0x0:_0x578558['offset'];var _0x53ac1b=_0x1d3aee?_0x47f81c[_0x63df('0x1e')]:_0x578558[_0x63df('0x1b')]+_0x578558[_0x63df('0x1d')];var _0x68552f;if(_0x53ac1b>=_0xf57bd5){_0x53ac1b=_0xf57bd5;_0x68552f=0xc8;}else{_0x68552f=0xce;}_0x3b108e['status'](_0x68552f);return _0x3b108e[_0x63df('0x1f')](_0x63df('0x20'),_0x3e6f95+'-'+_0x53ac1b+'/'+_0xf57bd5)[_0x63df('0x1a')](_0x47f81c);}return null;};}function patchUpdates(_0x4cd57b){return function(_0x3dc0a8){try{jsonpatch[_0x63df('0x21')](_0x3dc0a8,_0x4cd57b,!![]);}catch(_0x9a6e4e){return BPromise['reject'](_0x9a6e4e);}return _0x3dc0a8['save']();};}function saveUpdates(_0x35ef77,_0x1ff15d){return function(_0x362495){if(_0x362495){return _0x362495['update'](_0x35ef77)['then'](function(_0x136773){return _0x136773;});}return null;};}function removeEntity(_0x52b192,_0x14e5be){return function(_0x3101d5){if(_0x3101d5){return _0x3101d5[_0x63df('0x22')]()[_0x63df('0x23')](function(){_0x52b192[_0x63df('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c1c2,_0x1612a3){return function(_0x12e066){if(!_0x12e066){_0x15c1c2[_0x63df('0x17')](0x194);}return _0x12e066;};}function handleError(_0x9a6632,_0xeb7b6b){_0xeb7b6b=_0xeb7b6b||0x1f4;return function(_0x3c78d5){logger['error'](_0x3c78d5[_0x63df('0x24')]);if(_0x3c78d5[_0x63df('0x25')]){delete _0x3c78d5[_0x63df('0x25')];}_0x9a6632['status'](_0xeb7b6b)[_0x63df('0x26')](_0x3c78d5);};}exports[_0x63df('0x27')]=function(_0x25319e,_0x5deb0b){var _0xd3df87={},_0x2545a6={},_0x227cbe={'count':0x0,'rows':[]};var _0x20681d=_[_0x63df('0x28')](db['Migration'][_0x63df('0x29')],function(_0x3fb1da){return{'name':_0x3fb1da[_0x63df('0x2a')],'type':_0x3fb1da[_0x63df('0x2b')][_0x63df('0x2c')]};});_0x2545a6[_0x63df('0x2d')]=_[_0x63df('0x28')](_0x20681d,_0x63df('0x25'));_0x2545a6[_0x63df('0x2e')]=_[_0x63df('0x2f')](_0x25319e[_0x63df('0x2e')]);_0x2545a6[_0x63df('0x30')]=_[_0x63df('0x31')](_0x2545a6[_0x63df('0x2d')],_0x2545a6[_0x63df('0x2e')]);_0xd3df87['attributes']=_['intersection'](_0x2545a6[_0x63df('0x2d')],qs[_0x63df('0x32')](_0x25319e[_0x63df('0x2e')]['fields']));_0xd3df87['attributes']=_0xd3df87[_0x63df('0x33')]['length']?_0xd3df87[_0x63df('0x33')]:_0x2545a6[_0x63df('0x2d')];if(!_0x25319e[_0x63df('0x2e')]['hasOwnProperty'](_0x63df('0x34'))){_0xd3df87['limit']=qs[_0x63df('0x1d')](_0x25319e[_0x63df('0x2e')][_0x63df('0x1d')]);_0xd3df87[_0x63df('0x1b')]=qs['offset'](_0x25319e[_0x63df('0x2e')][_0x63df('0x1b')]);}_0xd3df87['order']=qs[_0x63df('0x35')](_0x25319e[_0x63df('0x2e')][_0x63df('0x35')]);_0xd3df87[_0x63df('0x36')]=qs['filters'](_[_0x63df('0x37')](_0x25319e[_0x63df('0x2e')],_0x2545a6[_0x63df('0x30')]),_0x20681d);if(_0x25319e[_0x63df('0x2e')][_0x63df('0x38')]){_0xd3df87[_0x63df('0x36')]=_[_0x63df('0x39')](_0xd3df87[_0x63df('0x36')],{'$or':_[_0x63df('0x28')](_0x20681d,function(_0x3d9409){if(_0x3d9409[_0x63df('0x2b')]!==_0x63df('0x3a')){var _0x4b83e6={};_0x4b83e6[_0x3d9409['name']]={'$like':'%'+_0x25319e[_0x63df('0x2e')][_0x63df('0x38')]+'%'};return _0x4b83e6;}})});}_0xd3df87=_[_0x63df('0x39')]({},_0xd3df87,_0x25319e[_0x63df('0x3b')]);var _0x3977e7={'where':_0xd3df87['where']};return db[_0x63df('0x3c')][_0x63df('0x1e')](_0x3977e7)['then'](function(_0x3d2f72){_0x227cbe[_0x63df('0x1e')]=_0x3d2f72;if(_0x25319e[_0x63df('0x2e')][_0x63df('0x3d')]){_0xd3df87['include']=[{'all':!![]}];}return db['Migration']['findAll'](_0xd3df87);})[_0x63df('0x23')](function(_0x58dc50){_0x227cbe['rows']=_0x58dc50;return _0x227cbe;})[_0x63df('0x23')](respondWithFilteredResult(_0x5deb0b,_0xd3df87))[_0x63df('0x3e')](handleError(_0x5deb0b,null));}; \ No newline at end of file +var _0xb3f8=['merge','options','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','VIRTUAL','filter'];(function(_0x3a81f3,_0x218733){var _0x3693d1=function(_0x37c804){while(--_0x37c804){_0x3a81f3['push'](_0x3a81f3['shift']());}};_0x3693d1(++_0x218733);}(_0xb3f8,0x83));var _0x8b3f=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0xb3f8[_0x3ef2d5];return _0x2fefb2;};'use strict';var emlformat=require(_0x8b3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b3f('0x1'));var jsonpatch=require(_0x8b3f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b3f('0x3'));var Mustache=require(_0x8b3f('0x4'));var util=require(_0x8b3f('0x5'));var path=require(_0x8b3f('0x6'));var sox=require(_0x8b3f('0x7'));var csv=require(_0x8b3f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b3f('0x9'));var squel=require(_0x8b3f('0xa'));var crypto=require(_0x8b3f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8b3f('0xc'));var Papa=require('papaparse');var Redis=require(_0x8b3f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8b3f('0xe'));var as=require(_0x8b3f('0xf'));var hardwareService=require(_0x8b3f('0x10'));var logger=require(_0x8b3f('0x11'))(_0x8b3f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b3f('0x13'))['db'];function respondWithStatusCode(_0x541820,_0x3edb1c){_0x3edb1c=_0x3edb1c||0xcc;return function(_0x270395){if(_0x270395){return _0x541820[_0x8b3f('0x14')](_0x3edb1c);}return _0x541820['status'](_0x3edb1c)['end']();};}function respondWithResult(_0x1cc67b,_0x1643f4){_0x1643f4=_0x1643f4||0xc8;return function(_0xdc4aad){if(_0xdc4aad){return _0x1cc67b[_0x8b3f('0x15')](_0x1643f4)[_0x8b3f('0x16')](_0xdc4aad);}};}function respondWithFilteredResult(_0x25ee31,_0x4ca515){return function(_0x1b9b22){if(_0x1b9b22){var _0xe89ae6=typeof _0x4ca515[_0x8b3f('0x17')]===_0x8b3f('0x18')&&typeof _0x4ca515[_0x8b3f('0x19')]===_0x8b3f('0x18');var _0x423e7f=_0x1b9b22['count'];var _0x10e753=_0xe89ae6?0x0:_0x4ca515[_0x8b3f('0x17')];var _0x59ae3c=_0xe89ae6?_0x1b9b22[_0x8b3f('0x1a')]:_0x4ca515['offset']+_0x4ca515[_0x8b3f('0x19')];var _0x1c55ef;if(_0x59ae3c>=_0x423e7f){_0x59ae3c=_0x423e7f;_0x1c55ef=0xc8;}else{_0x1c55ef=0xce;}_0x25ee31['status'](_0x1c55ef);return _0x25ee31[_0x8b3f('0x1b')](_0x8b3f('0x1c'),_0x10e753+'-'+_0x59ae3c+'/'+_0x423e7f)[_0x8b3f('0x16')](_0x1b9b22);}return null;};}function patchUpdates(_0x1c03c1){return function(_0x357fa5){try{jsonpatch['apply'](_0x357fa5,_0x1c03c1,!![]);}catch(_0x5d6d10){return BPromise['reject'](_0x5d6d10);}return _0x357fa5['save']();};}function saveUpdates(_0x35fccf,_0x17210d){return function(_0x5bec30){if(_0x5bec30){return _0x5bec30[_0x8b3f('0x1d')](_0x35fccf)[_0x8b3f('0x1e')](function(_0x314e4e){return _0x314e4e;});}return null;};}function removeEntity(_0x3ffaf0,_0x3af349){return function(_0x1f9c6e){if(_0x1f9c6e){return _0x1f9c6e[_0x8b3f('0x1f')]()[_0x8b3f('0x1e')](function(){_0x3ffaf0[_0x8b3f('0x15')](0xcc)[_0x8b3f('0x20')]();});}};}function handleEntityNotFound(_0x149140,_0x20ece7){return function(_0xcfc0b3){if(!_0xcfc0b3){_0x149140[_0x8b3f('0x14')](0x194);}return _0xcfc0b3;};}function handleError(_0x254965,_0x51153d){_0x51153d=_0x51153d||0x1f4;return function(_0x41cd47){logger[_0x8b3f('0x21')](_0x41cd47[_0x8b3f('0x22')]);if(_0x41cd47[_0x8b3f('0x23')]){delete _0x41cd47[_0x8b3f('0x23')];}_0x254965[_0x8b3f('0x15')](_0x51153d)[_0x8b3f('0x24')](_0x41cd47);};}exports['index']=function(_0x8f89db,_0x481f22){var _0x2ec6d9={},_0x23aa9d={},_0x197a35={'count':0x0,'rows':[]};var _0x2cd5e3=_[_0x8b3f('0x25')](db[_0x8b3f('0x26')][_0x8b3f('0x27')],function(_0x493c33){return{'name':_0x493c33[_0x8b3f('0x28')],'type':_0x493c33[_0x8b3f('0x29')]['key']};});_0x23aa9d[_0x8b3f('0x2a')]=_[_0x8b3f('0x25')](_0x2cd5e3,_0x8b3f('0x23'));_0x23aa9d[_0x8b3f('0x2b')]=_['keys'](_0x8f89db[_0x8b3f('0x2b')]);_0x23aa9d[_0x8b3f('0x2c')]=_[_0x8b3f('0x2d')](_0x23aa9d['model'],_0x23aa9d[_0x8b3f('0x2b')]);_0x2ec6d9[_0x8b3f('0x2e')]=_[_0x8b3f('0x2d')](_0x23aa9d[_0x8b3f('0x2a')],qs[_0x8b3f('0x2f')](_0x8f89db['query']['fields']));_0x2ec6d9['attributes']=_0x2ec6d9[_0x8b3f('0x2e')][_0x8b3f('0x30')]?_0x2ec6d9[_0x8b3f('0x2e')]:_0x23aa9d[_0x8b3f('0x2a')];if(!_0x8f89db['query']['hasOwnProperty'](_0x8b3f('0x31'))){_0x2ec6d9[_0x8b3f('0x19')]=qs['limit'](_0x8f89db[_0x8b3f('0x2b')][_0x8b3f('0x19')]);_0x2ec6d9[_0x8b3f('0x17')]=qs[_0x8b3f('0x17')](_0x8f89db['query'][_0x8b3f('0x17')]);}_0x2ec6d9[_0x8b3f('0x32')]=qs['sort'](_0x8f89db[_0x8b3f('0x2b')]['sort']);_0x2ec6d9[_0x8b3f('0x33')]=qs['filters'](_[_0x8b3f('0x34')](_0x8f89db[_0x8b3f('0x2b')],_0x23aa9d['filters']),_0x2cd5e3);if(_0x8f89db[_0x8b3f('0x2b')]['filter']){_0x2ec6d9[_0x8b3f('0x33')]=_['merge'](_0x2ec6d9[_0x8b3f('0x33')],{'$or':_[_0x8b3f('0x25')](_0x2cd5e3,function(_0x517817){if(_0x517817[_0x8b3f('0x29')]!==_0x8b3f('0x35')){var _0x5c1fc3={};_0x5c1fc3[_0x517817['name']]={'$like':'%'+_0x8f89db[_0x8b3f('0x2b')][_0x8b3f('0x36')]+'%'};return _0x5c1fc3;}})});}_0x2ec6d9=_[_0x8b3f('0x37')]({},_0x2ec6d9,_0x8f89db[_0x8b3f('0x38')]);var _0x27ab64={'where':_0x2ec6d9[_0x8b3f('0x33')]};return db[_0x8b3f('0x26')][_0x8b3f('0x1a')](_0x27ab64)[_0x8b3f('0x1e')](function(_0x3d6163){_0x197a35['count']=_0x3d6163;if(_0x8f89db['query'][_0x8b3f('0x39')]){_0x2ec6d9[_0x8b3f('0x3a')]=[{'all':!![]}];}return db[_0x8b3f('0x26')][_0x8b3f('0x3b')](_0x2ec6d9);})[_0x8b3f('0x1e')](function(_0xdaa757){_0x197a35[_0x8b3f('0x3c')]=_0xdaa757;return _0x197a35;})[_0x8b3f('0x1e')](respondWithFilteredResult(_0x481f22,_0x2ec6d9))[_0x8b3f('0x3d')](handleError(_0x481f22,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f5ff981..9ba806b 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 _0xbd3b=['migrations','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd3b,0x1f0));var _0xbbd3=function(_0x5b564d,_0x533fa7){_0x5b564d=_0x5b564d-0x0;var _0x37cac6=_0xbd3b[_0x5b564d];return _0x37cac6;};'use strict';var _=require(_0xbbd3('0x0'));var util=require('util');var logger=require(_0xbbd3('0x1'))('api');var moment=require(_0xbbd3('0x2'));var BPromise=require(_0xbbd3('0x3'));var rp=require(_0xbbd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbbd3('0x5'));var attributes=require(_0xbbd3('0x6'));module[_0xbbd3('0x7')]=function(_0x54488d,_0x59cbd7){return _0x54488d[_0xbbd3('0x8')](_0xbbd3('0x9'),attributes,{'tableName':_0xbbd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde04=['rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x225d87,_0x840e09){var _0x457240=function(_0x3d5333){while(--_0x3d5333){_0x225d87['push'](_0x225d87['shift']());}};_0x457240(++_0x840e09);}(_0xde04,0xbc));var _0x4de0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4de0('0x0'));var util=require('util');var logger=require(_0x4de0('0x1'))(_0x4de0('0x2'));var moment=require(_0x4de0('0x3'));var BPromise=require(_0x4de0('0x4'));var rp=require(_0x4de0('0x5'));var fs=require('fs');var path=require(_0x4de0('0x6'));var rimraf=require(_0x4de0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4de0('0x8'));module[_0x4de0('0x9')]=function(_0x518a90,_0x11d054){return _0x518a90[_0x4de0('0xa')](_0x4de0('0xb'),attributes,{'tableName':_0x4de0('0xc'),'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 4580c57..085fec5 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 _0x9bc3=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x337998,_0x1906c7){var _0x519f10=function(_0x50d9c8){while(--_0x50d9c8){_0x337998['push'](_0x337998['shift']());}};_0x519f10(++_0x1906c7);}(_0x9bc3,0x137));var _0x39bc=function(_0x1ec341,_0x2b6426){_0x1ec341=_0x1ec341-0x0;var _0x1eeb8e=_0x9bc3[_0x1ec341];return _0x1eeb8e;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var moment=require(_0x39bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x39bc('0x3'));var fs=require('fs');var Redis=require(_0x39bc('0x4'));var db=require(_0x39bc('0x5'))['db'];var utils=require(_0x39bc('0x6'));var logger=require('../../config/logger')(_0x39bc('0x7'));var config=require(_0x39bc('0x8'));var jayson=require(_0x39bc('0x9'));var client=jayson[_0x39bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d6ce,_0x1367c6,_0x86cff3){return new BPromise(function(_0x10be27,_0x3fa4bd){return client[_0x39bc('0xb')](_0x38d6ce,_0x86cff3)[_0x39bc('0xc')](function(_0x2533c1){logger['info'](_0x39bc('0xd'),_0x1367c6,_0x39bc('0xe'));logger[_0x39bc('0xf')](_0x39bc('0x10'),_0x1367c6,_0x39bc('0xe'),JSON[_0x39bc('0x11')](_0x2533c1));if(_0x2533c1['error']){if(_0x2533c1['error'][_0x39bc('0x12')]===0x1f4){logger[_0x39bc('0x13')]('Migration,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')][_0x39bc('0x14')]);return _0x3fa4bd(_0x2533c1[_0x39bc('0x13')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')]['message']);return _0x10be27(_0x2533c1['error'][_0x39bc('0x14')]);}else{logger[_0x39bc('0x15')]('Migration,\x20%s,\x20%s',_0x1367c6,'request\x20sent');_0x10be27(_0x2533c1[_0x39bc('0x16')][_0x39bc('0x14')]);}})[_0x39bc('0x17')](function(_0x5d6b18){logger[_0x39bc('0x13')](_0x39bc('0xd'),_0x1367c6,_0x5d6b18);_0x3fa4bd(_0x5d6b18);});});} \ No newline at end of file +var _0x13f6=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util'];(function(_0x5baf32,_0x103278){var _0x539cae=function(_0x43c0c2){while(--_0x43c0c2){_0x5baf32['push'](_0x5baf32['shift']());}};_0x539cae(++_0x103278);}(_0x13f6,0x124));var _0x613f=function(_0xfefdd7,_0xe404a1){_0xfefdd7=_0xfefdd7-0x0;var _0x32c2eb=_0x13f6[_0xfefdd7];return _0x32c2eb;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('Migration,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('Migration,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 5414e01..6d5cc94 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 _0x8579=['create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','post'];(function(_0x49af2b,_0x589f26){var _0x36a443=function(_0x90a9ea){while(--_0x90a9ea){_0x49af2b['push'](_0x49af2b['shift']());}};_0x36a443(++_0x589f26);}(_0x8579,0x16c));var _0x9857=function(_0x514277,_0x5eb82b){_0x514277=_0x514277-0x0;var _0x824927=_0x8579[_0x514277];return _0x824927;};'use strict';var multer=require(_0x9857('0x0'));var util=require(_0x9857('0x1'));var path=require('path');var timeout=require(_0x9857('0x2'));var express=require(_0x9857('0x3'));var router=express[_0x9857('0x4')]();var fs_extra=require(_0x9857('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./network.controller');router[_0x9857('0x6')]('/',auth[_0x9857('0x7')](),controller[_0x9857('0x8')]);router[_0x9857('0x6')](_0x9857('0x9'),auth[_0x9857('0x7')](),controller['show']);router[_0x9857('0xa')]('/',auth[_0x9857('0x7')](),controller[_0x9857('0xb')]);router[_0x9857('0xc')](_0x9857('0x9'),auth[_0x9857('0x7')](),controller['update']);router['delete']('/:id',auth[_0x9857('0x7')](),controller[_0x9857('0xd')]);module[_0x9857('0xe')]=router; \ No newline at end of file +var _0x2cfd=['destroy','exports','util','path','connect-timeout','Router','fs-extra','./network.controller','get','index','/:id','isAuthenticated','create','update','delete'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xd2cf('0x0'));var path=require(_0xd2cf('0x1'));var timeout=require(_0xd2cf('0x2'));var express=require('express');var router=express[_0xd2cf('0x3')]();var fs_extra=require(_0xd2cf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2cf('0x5'));router[_0xd2cf('0x6')]('/',auth['isAuthenticated'](),controller[_0xd2cf('0x7')]);router[_0xd2cf('0x6')](_0xd2cf('0x8'),auth[_0xd2cf('0x9')](),controller['show']);router['post']('/',auth[_0xd2cf('0x9')](),controller[_0xd2cf('0xa')]);router['put']('/:id',auth[_0xd2cf('0x9')](),controller[_0xd2cf('0xb')]);router[_0xd2cf('0xc')]('/:id',auth[_0xd2cf('0x9')](),controller[_0xd2cf('0xd')]);module[_0xd2cf('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 61b6ffb..b8b0915 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 _0x6505=['localnet','externip','stun','turn','STRING','exports'];(function(_0x57574b,_0x4a8372){var _0x2df082=function(_0xa7b98a){while(--_0xa7b98a){_0x57574b['push'](_0x57574b['shift']());}};_0x2df082(++_0x4a8372);}(_0x6505,0x83));var _0x5650=function(_0x5a79f3,_0x395a5a){_0x5a79f3=_0x5a79f3-0x0;var _0x24d05e=_0x6505[_0x5a79f3];return _0x24d05e;};'use strict';var Sequelize=require('sequelize');module[_0x5650('0x0')]={'type':{'type':Sequelize['ENUM'](_0x5650('0x1'),_0x5650('0x2'),_0x5650('0x3'),_0x5650('0x4'))},'value':{'type':Sequelize[_0x5650('0x5')]},'username':{'type':Sequelize[_0x5650('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x03c3=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x21d642,_0x5e733b){var _0x2815f8=function(_0x103dcd){while(--_0x103dcd){_0x21d642['push'](_0x21d642['shift']());}};_0x2815f8(++_0x5e733b);}(_0x03c3,0x1e6));var _0x303c=function(_0x279679,_0x19605a){_0x279679=_0x279679-0x0;var _0x4e4b87=_0x03c3[_0x279679];return _0x4e4b87;};'use strict';var Sequelize=require(_0x303c('0x0'));module[_0x303c('0x1')]={'type':{'type':Sequelize[_0x303c('0x2')]('localnet',_0x303c('0x3'),_0x303c('0x4'),_0x303c('0x5'))},'value':{'type':Sequelize[_0x303c('0x6')]},'username':{'type':Sequelize[_0x303c('0x6')]},'password':{'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 0c22d12..33e7637 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 _0x946e=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','index','Network','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','sequelize','transaction','body','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','root','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','format','STUN','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x43e75e,_0x324f5f){var _0x159ee9=function(_0x2b61fa){while(--_0x2b61fa){_0x43e75e['push'](_0x43e75e['shift']());}};_0x159ee9(++_0x324f5f);}(_0x946e,0x1d0));var _0xe946=function(_0x446b50,_0x3fcc43){_0x446b50=_0x446b50-0x0;var _0x319613=_0x946e[_0x446b50];return _0x319613;};'use strict';var emlformat=require(_0xe946('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe946('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe946('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe946('0x3'));var util=require(_0xe946('0x4'));var path=require(_0xe946('0x5'));var sox=require(_0xe946('0x6'));var csv=require(_0xe946('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe946('0x8'));var _=require(_0xe946('0x9'));var squel=require(_0xe946('0xa'));var crypto=require('crypto');var jsforce=require(_0xe946('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe946('0x7'));var querystring=require(_0xe946('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe946('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe946('0xe'))(_0xe946('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe946('0x10'));var db=require(_0xe946('0x11'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe946('0x12')][_0xe946('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x36ad64,_0x416e5c,_0xcdfa6,_0x7c5262){return new BPromise(function(_0x3eba3c,_0x5d0038){var _0x50983e=_0x7c5262||client;return _0x50983e[_0xe946('0x14')](_0x36ad64,_0xcdfa6)[_0xe946('0x15')](function(_0x21af3e){logger['info'](_0xe946('0x16'),_0x416e5c,_0xe946('0x17'));logger[_0xe946('0x18')]('Network,\x20%s,\x20%s,\x20%s',_0x416e5c,_0xe946('0x17'),JSON[_0xe946('0x19')](_0x21af3e));if(_0x21af3e[_0xe946('0x1a')]){if(_0x21af3e['error'][_0xe946('0x1b')]===0x1f4){logger[_0xe946('0x1a')]('Network,\x20%s,\x20%s',_0x416e5c,_0x21af3e[_0xe946('0x1a')]['message']);return _0x5d0038(_0x21af3e[_0xe946('0x1a')][_0xe946('0x1c')]);}logger['error'](_0xe946('0x16'),_0x416e5c,_0x21af3e[_0xe946('0x1a')][_0xe946('0x1c')]);return _0x3eba3c(_0x21af3e[_0xe946('0x1a')][_0xe946('0x1c')]);}else{logger[_0xe946('0x1d')](_0xe946('0x16'),_0x416e5c,_0xe946('0x17'));_0x3eba3c(_0x21af3e[_0xe946('0x1e')][_0xe946('0x1c')]);}})['catch'](function(_0x1e9fdf){logger[_0xe946('0x1a')](_0xe946('0x16'),_0x416e5c,_0x1e9fdf);_0x5d0038(_0x1e9fdf);});});}function respondWithStatusCode(_0x25dbfb,_0x169eec){_0x169eec=_0x169eec||0xcc;return function(_0xc4d186){if(_0xc4d186){return _0x25dbfb['sendStatus'](_0x169eec);}return _0x25dbfb[_0xe946('0x1f')](_0x169eec)[_0xe946('0x20')]();};}function respondWithResult(_0x1d0b1f,_0xd3d3b7){_0xd3d3b7=_0xd3d3b7||0xc8;return function(_0x1d2323){if(_0x1d2323){return _0x1d0b1f[_0xe946('0x1f')](_0xd3d3b7)[_0xe946('0x21')](_0x1d2323);}};}function respondWithFilteredResult(_0x73d63d,_0x1655a1){return function(_0x562508){if(_0x562508){var _0xff0c7b=typeof _0x1655a1[_0xe946('0x22')]===_0xe946('0x23')&&typeof _0x1655a1[_0xe946('0x24')]===_0xe946('0x23');var _0x475056=_0x562508['count'];var _0x20366d=_0xff0c7b?0x0:_0x1655a1[_0xe946('0x22')];var _0x422beb=_0xff0c7b?_0x562508[_0xe946('0x25')]:_0x1655a1[_0xe946('0x22')]+_0x1655a1[_0xe946('0x24')];var _0x15d106;if(_0x422beb>=_0x475056){_0x422beb=_0x475056;_0x15d106=0xc8;}else{_0x15d106=0xce;}_0x73d63d[_0xe946('0x1f')](_0x15d106);return _0x73d63d['set'](_0xe946('0x26'),_0x20366d+'-'+_0x422beb+'/'+_0x475056)[_0xe946('0x21')](_0x562508);}return null;};}function patchUpdates(_0x48ed89){return function(_0x17f44c){try{jsonpatch[_0xe946('0x27')](_0x17f44c,_0x48ed89,!![]);}catch(_0x281518){return BPromise[_0xe946('0x28')](_0x281518);}return _0x17f44c['save']();};}function saveUpdates(_0x39258e,_0xbd026d){return function(_0x33c585){if(_0x33c585){return _0x33c585[_0xe946('0x29')](_0x39258e)[_0xe946('0x15')](function(_0x5beef5){return _0x5beef5;});}return null;};}function removeEntity(_0x25d33e,_0x1dcab6){return function(_0x35c87d){if(_0x35c87d){return _0x35c87d[_0xe946('0x2a')]()[_0xe946('0x15')](function(){_0x25d33e['status'](0xcc)[_0xe946('0x20')]();});}};}function handleEntityNotFound(_0x49df0d,_0x5a600c){return function(_0x269161){if(!_0x269161){_0x49df0d['sendStatus'](0x194);}return _0x269161;};}function handleError(_0x1c3ef7,_0x3fcc76){_0x3fcc76=_0x3fcc76||0x1f4;return function(_0x1f8ff9){logger['error'](_0x1f8ff9['stack']);if(_0x1f8ff9['name']){delete _0x1f8ff9['name'];}_0x1c3ef7[_0xe946('0x1f')](_0x3fcc76)['send'](_0x1f8ff9);};}exports[_0xe946('0x2b')]=function(_0x41f775,_0x4b8aa3){var _0x3debed={},_0x1e2156={},_0x1274c0={'count':0x0,'rows':[]};var _0x1dccb2=_['map'](db[_0xe946('0x2c')][_0xe946('0x2d')],function(_0x148f7c){return{'name':_0x148f7c[_0xe946('0x2e')],'type':_0x148f7c[_0xe946('0x2f')]['key']};});_0x1e2156[_0xe946('0x30')]=_[_0xe946('0x31')](_0x1dccb2,_0xe946('0x32'));_0x1e2156[_0xe946('0x33')]=_[_0xe946('0x34')](_0x41f775[_0xe946('0x33')]);_0x1e2156[_0xe946('0x35')]=_[_0xe946('0x36')](_0x1e2156['model'],_0x1e2156[_0xe946('0x33')]);_0x3debed[_0xe946('0x37')]=_[_0xe946('0x36')](_0x1e2156[_0xe946('0x30')],qs[_0xe946('0x38')](_0x41f775[_0xe946('0x33')][_0xe946('0x38')]));_0x3debed[_0xe946('0x37')]=_0x3debed[_0xe946('0x37')]['length']?_0x3debed[_0xe946('0x37')]:_0x1e2156[_0xe946('0x30')];if(!_0x41f775[_0xe946('0x33')]['hasOwnProperty'](_0xe946('0x39'))){_0x3debed['limit']=qs['limit'](_0x41f775[_0xe946('0x33')][_0xe946('0x24')]);_0x3debed[_0xe946('0x22')]=qs['offset'](_0x41f775[_0xe946('0x33')][_0xe946('0x22')]);}_0x3debed[_0xe946('0x3a')]=qs['sort'](_0x41f775[_0xe946('0x33')][_0xe946('0x3b')]);_0x3debed[_0xe946('0x3c')]=qs[_0xe946('0x35')](_[_0xe946('0x3d')](_0x41f775[_0xe946('0x33')],_0x1e2156['filters']),_0x1dccb2);if(_0x41f775[_0xe946('0x33')]['filter']){_0x3debed[_0xe946('0x3c')]=_[_0xe946('0x3e')](_0x3debed[_0xe946('0x3c')],{'$or':_[_0xe946('0x31')](_0x1dccb2,function(_0x52f42b){if(_0x52f42b[_0xe946('0x2f')]!==_0xe946('0x3f')){var _0x4f817a={};_0x4f817a[_0x52f42b[_0xe946('0x32')]]={'$like':'%'+_0x41f775[_0xe946('0x33')][_0xe946('0x40')]+'%'};return _0x4f817a;}})});}_0x3debed=_[_0xe946('0x3e')]({},_0x3debed,_0x41f775[_0xe946('0x41')]);var _0x446f2a={'where':_0x3debed['where']};return db['Network'][_0xe946('0x25')](_0x446f2a)[_0xe946('0x15')](function(_0x34e3d4){_0x1274c0['count']=_0x34e3d4;if(_0x41f775[_0xe946('0x33')][_0xe946('0x42')]){_0x3debed[_0xe946('0x43')]=[{'all':!![]}];}return db['Network'][_0xe946('0x44')](_0x3debed);})[_0xe946('0x15')](function(_0x5b0a43){_0x1274c0[_0xe946('0x45')]=_0x5b0a43;return _0x1274c0;})[_0xe946('0x15')](respondWithFilteredResult(_0x4b8aa3,_0x3debed))[_0xe946('0x46')](handleError(_0x4b8aa3,null));};exports[_0xe946('0x47')]=function(_0x56479c,_0x5190c9){var _0x33031b={'raw':!![],'where':{'id':_0x56479c[_0xe946('0x48')]['id']}},_0xb2f063={};_0xb2f063[_0xe946('0x30')]=_['keys'](db[_0xe946('0x2c')][_0xe946('0x2d')]);_0xb2f063['query']=_[_0xe946('0x34')](_0x56479c[_0xe946('0x33')]);_0xb2f063['filters']=_[_0xe946('0x36')](_0xb2f063[_0xe946('0x30')],_0xb2f063[_0xe946('0x33')]);_0x33031b[_0xe946('0x37')]=_[_0xe946('0x36')](_0xb2f063[_0xe946('0x30')],qs[_0xe946('0x38')](_0x56479c[_0xe946('0x33')][_0xe946('0x38')]));_0x33031b[_0xe946('0x37')]=_0x33031b[_0xe946('0x37')][_0xe946('0x49')]?_0x33031b['attributes']:_0xb2f063[_0xe946('0x30')];if(_0x56479c['query'][_0xe946('0x42')]){_0x33031b[_0xe946('0x43')]=[{'all':!![]}];}_0x33031b=_[_0xe946('0x3e')]({},_0x33031b,_0x56479c['options']);return db['Network'][_0xe946('0x4a')](_0x33031b)[_0xe946('0x15')](handleEntityNotFound(_0x5190c9,null))['then'](respondWithResult(_0x5190c9,null))[_0xe946('0x46')](handleError(_0x5190c9,null));};exports[_0xe946('0x4b')]=function(_0x1683a8,_0x22c933,_0x42e768){var _0x41b15e;return db[_0xe946('0x4c')][_0xe946('0x4d')](function(_0x53ba70){return db['Network'][_0xe946('0x4b')](_0x1683a8[_0xe946('0x4e')],{'raw':!![]})[_0xe946('0x15')](function(_0x2d2368){_0x41b15e=_0x2d2368;return db[_0xe946('0x2c')][_0xe946('0x44')]({'where':{'type':_0x1683a8[_0xe946('0x4e')][_0xe946('0x2f')]},'raw':!![]});})[_0xe946('0x15')](function(_0x3d3d1c){if(_0x41b15e[_0xe946('0x2f')]['toUpperCase']()=='STUN'){var _0xa74fbe=fs[_0xe946('0x4f')](path[_0xe946('0x50')](config['root'],_0xe946('0x51')),_0xe946('0x52'));var _0x12a8b2=ejs[_0xe946('0x53')](_0xa74fbe,{'networks':_0x3d3d1c||[]});fs['writeFileSync'](_0xe946('0x54'),_0x12a8b2);return respondWithRpcPromise('Reload',_0xe946('0x4b'),{'module':_0xe946('0x55')});}else if(_0x41b15e[_0xe946('0x2f')][_0xe946('0x56')]()=='TURN'){var _0x2ddcd4=fs['readFileSync'](path[_0xe946('0x50')](config['root'],_0xe946('0x57')),_0xe946('0x52'));var _0x23ca85=ejs[_0xe946('0x53')](_0x2ddcd4,{'networks':_0x3d3d1c||[]});fs[_0xe946('0x58')](_0xe946('0x59'),_0x23ca85);return respondWithRpcPromise(_0xe946('0x5a'),'create',{'module':_0xe946('0x55')});}else{var _0x479ad2=fs[_0xe946('0x4f')](path['join'](config[_0xe946('0x5b')],_0xe946('0x5c')),_0xe946('0x52'));var _0x2a118a=ejs[_0xe946('0x53')](_0x479ad2,{'networks':_0x3d3d1c||[]});fs[_0xe946('0x58')](util['format'](_0xe946('0x5d'),_0x1683a8[_0xe946('0x4e')]['type'][_0xe946('0x5e')]()),_0x2a118a);return respondWithRpcPromise('Reload',_0xe946('0x4b'),{'module':_0xe946('0x5f')});}return null;})[_0xe946('0x15')](function(){return _0x41b15e;});})[_0xe946('0x15')](respondWithResult(_0x22c933,0xc9))[_0xe946('0x46')](handleError(_0x22c933,null));};exports['update']=function(_0x51abcb,_0x5f5d84,_0x436dab){var _0x55eb1d;return db[_0xe946('0x4c')][_0xe946('0x4d')](function(_0x3d9ace){return db['Network']['find']({'where':{'id':_0x51abcb[_0xe946('0x48')]['id']}})[_0xe946('0x15')](handleEntityNotFound(_0x5f5d84,null))[_0xe946('0x15')](saveUpdates(_0x51abcb['body'],null))[_0xe946('0x15')](function(_0xda6cbb){if(_0xda6cbb){_0x55eb1d=_0xda6cbb;return db['Network']['findAll']({'where':{'type':_0x55eb1d['type']},'raw':!![]});}return null;})['then'](function(_0x4bc929){if(_0x55eb1d[_0xe946('0x2f')][_0xe946('0x56')]()=='STUN'){var _0x3a9f38=fs[_0xe946('0x4f')](path['join'](config[_0xe946('0x5b')],_0xe946('0x51')),_0xe946('0x52'));var _0x55c025=ejs[_0xe946('0x53')](_0x3a9f38,{'networks':_0x4bc929||[]});fs[_0xe946('0x58')]('/etc/asterisk/stun_xcally.conf',_0x55c025);return respondWithRpcPromise(_0xe946('0x5a'),'update',{'module':_0xe946('0x55')});}else if(_0x55eb1d[_0xe946('0x2f')][_0xe946('0x56')]()==_0xe946('0x60')){var _0x3791ba=fs[_0xe946('0x4f')](path['join'](config[_0xe946('0x5b')],'server/files/templates/turn_multiple.ejs'),_0xe946('0x52'));var _0x114971=ejs[_0xe946('0x53')](_0x3791ba,{'networks':_0x4bc929||[]});fs[_0xe946('0x58')](_0xe946('0x59'),_0x114971);return respondWithRpcPromise('Reload',_0xe946('0x29'),{'module':_0xe946('0x55')});}else{var _0x103eee=fs['readFileSync'](path[_0xe946('0x50')](config['root'],_0xe946('0x5c')),_0xe946('0x52'));var _0x28474f=ejs[_0xe946('0x53')](_0x103eee,{'networks':_0x4bc929||[]});fs[_0xe946('0x58')](util[_0xe946('0x61')](_0xe946('0x5d'),_0x51abcb[_0xe946('0x4e')][_0xe946('0x2f')]['toLowerCase']()),_0x28474f);return respondWithRpcPromise(_0xe946('0x5a'),_0xe946('0x29'),{'module':_0xe946('0x5f')});}return null;})[_0xe946('0x15')](function(_0xb4d5a6){if(_0xb4d5a6){return _0x55eb1d;}return null;});})[_0xe946('0x15')](respondWithResult(_0x5f5d84,null))[_0xe946('0x46')](handleError(_0x5f5d84,null));};exports[_0xe946('0x2a')]=function(_0xacb63a,_0x478d56,_0x394ede){var _0x7e6b25;return db[_0xe946('0x2c')]['find']({'where':{'id':_0xacb63a[_0xe946('0x48')]['id']}})[_0xe946('0x15')](function(_0x57f882){_0x7e6b25=_0x57f882;return _0x57f882;})[_0xe946('0x15')](handleEntityNotFound(_0x478d56,null))[_0xe946('0x15')](removeEntity(_0x478d56,null))[_0xe946('0x15')](function(){if(_0x7e6b25){return db['Network']['findAll']({'where':{'type':_0x7e6b25[_0xe946('0x2f')]},'raw':!![]});}})[_0xe946('0x15')](function(_0x26f9c1){if(_0x7e6b25[_0xe946('0x2f')][_0xe946('0x56')]()==_0xe946('0x62')){var _0x354345=fs[_0xe946('0x4f')](path[_0xe946('0x50')](config[_0xe946('0x5b')],_0xe946('0x51')),_0xe946('0x52'));var _0x3f2160=ejs[_0xe946('0x53')](_0x354345,{'networks':_0x26f9c1||[]});fs['writeFileSync'](_0xe946('0x54'),_0x3f2160);return respondWithRpcPromise('Reload',_0xe946('0x2a'),{'module':_0xe946('0x55')});}else if(_0x7e6b25[_0xe946('0x2f')][_0xe946('0x56')]()==_0xe946('0x60')){var _0xb82c7b=fs['readFileSync'](path[_0xe946('0x50')](config['root'],_0xe946('0x57')),_0xe946('0x52'));var _0x2e1773=ejs[_0xe946('0x53')](_0xb82c7b,{'networks':_0x26f9c1||[]});fs[_0xe946('0x58')](_0xe946('0x59'),_0x2e1773);return respondWithRpcPromise(_0xe946('0x5a'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x4360b5=fs[_0xe946('0x4f')](path[_0xe946('0x50')](config[_0xe946('0x5b')],_0xe946('0x5c')),_0xe946('0x52'));var _0x595ea5=ejs[_0xe946('0x53')](_0x4360b5,{'networks':_0x26f9c1||[]});fs[_0xe946('0x58')](util[_0xe946('0x61')](_0xe946('0x5d'),_0xacb63a['body'][_0xe946('0x2f')][_0xe946('0x5e')]()),_0x595ea5);return respondWithRpcPromise(_0xe946('0x5a'),_0xe946('0x2a'),{'module':_0xe946('0x5f')});}return null;})[_0xe946('0x46')](handleError(_0x478d56,null));}; \ No newline at end of file +var _0x4379=['limit','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','index','Network','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','merge','includeAll','include','show','params','options','create','sequelize','transaction','body','findAll','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','find','TURN','server/files/templates/network.ejs','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined'];(function(_0x57d6a1,_0x5eb7d3){var _0x4d09d5=function(_0x90db35){while(--_0x90db35){_0x57d6a1['push'](_0x57d6a1['shift']());}};_0x4d09d5(++_0x5eb7d3);}(_0x4379,0x1e6));var _0x9437=function(_0xcb095d,_0x5972e6){_0xcb095d=_0xcb095d-0x0;var _0x1a79e4=_0x4379[_0xcb095d];return _0x1a79e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9437('0x0'));var jsonpatch=require(_0x9437('0x1'));var rp=require(_0x9437('0x2'));var moment=require(_0x9437('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9437('0x4'));var util=require(_0x9437('0x5'));var path=require(_0x9437('0x6'));var sox=require(_0x9437('0x7'));var csv=require(_0x9437('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9437('0x9'));var _=require('lodash');var squel=require(_0x9437('0xa'));var crypto=require(_0x9437('0xb'));var jsforce=require(_0x9437('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9437('0x8'));var querystring=require(_0x9437('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9437('0xe'));var qs=require(_0x9437('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9437('0x10'));var logger=require(_0x9437('0x11'))(_0x9437('0x12'));var utils=require('../../config/utils');var config=require(_0x9437('0x13'));var licenseUtil=require(_0x9437('0x14'));var db=require(_0x9437('0x15'))['db'];var jayson=require(_0x9437('0x16'));var client=jayson['client'][_0x9437('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5c1b11,_0x5606e4,_0x5d6a81,_0x17a73a){return new BPromise(function(_0x126772,_0x3ba574){var _0x278558=_0x17a73a||client;return _0x278558[_0x9437('0x18')](_0x5c1b11,_0x5d6a81)[_0x9437('0x19')](function(_0xf00dcc){logger['info'](_0x9437('0x1a'),_0x5606e4,'request\x20sent');logger[_0x9437('0x1b')]('Network,\x20%s,\x20%s,\x20%s',_0x5606e4,_0x9437('0x1c'),JSON[_0x9437('0x1d')](_0xf00dcc));if(_0xf00dcc[_0x9437('0x1e')]){if(_0xf00dcc[_0x9437('0x1e')][_0x9437('0x1f')]===0x1f4){logger[_0x9437('0x1e')]('Network,\x20%s,\x20%s',_0x5606e4,_0xf00dcc[_0x9437('0x1e')][_0x9437('0x20')]);return _0x3ba574(_0xf00dcc['error'][_0x9437('0x20')]);}logger['error'](_0x9437('0x1a'),_0x5606e4,_0xf00dcc[_0x9437('0x1e')][_0x9437('0x20')]);return _0x126772(_0xf00dcc['error'][_0x9437('0x20')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x5606e4,_0x9437('0x1c'));_0x126772(_0xf00dcc[_0x9437('0x21')][_0x9437('0x20')]);}})[_0x9437('0x22')](function(_0x93c1ed){logger[_0x9437('0x1e')](_0x9437('0x1a'),_0x5606e4,_0x93c1ed);_0x3ba574(_0x93c1ed);});});}function respondWithStatusCode(_0x315516,_0x526bde){_0x526bde=_0x526bde||0xcc;return function(_0x4be545){if(_0x4be545){return _0x315516['sendStatus'](_0x526bde);}return _0x315516[_0x9437('0x23')](_0x526bde)[_0x9437('0x24')]();};}function respondWithResult(_0x3219b9,_0x4bff85){_0x4bff85=_0x4bff85||0xc8;return function(_0xcf9c7a){if(_0xcf9c7a){return _0x3219b9['status'](_0x4bff85)[_0x9437('0x25')](_0xcf9c7a);}};}function respondWithFilteredResult(_0x50b269,_0x41fa3b){return function(_0x3de742){if(_0x3de742){var _0x3d8d93=typeof _0x41fa3b['offset']===_0x9437('0x26')&&typeof _0x41fa3b[_0x9437('0x27')]===_0x9437('0x26');var _0x473b3e=_0x3de742[_0x9437('0x28')];var _0x53e348=_0x3d8d93?0x0:_0x41fa3b[_0x9437('0x29')];var _0xc5c226=_0x3d8d93?_0x3de742['count']:_0x41fa3b[_0x9437('0x29')]+_0x41fa3b[_0x9437('0x27')];var _0x232eea;if(_0xc5c226>=_0x473b3e){_0xc5c226=_0x473b3e;_0x232eea=0xc8;}else{_0x232eea=0xce;}_0x50b269['status'](_0x232eea);return _0x50b269[_0x9437('0x2a')](_0x9437('0x2b'),_0x53e348+'-'+_0xc5c226+'/'+_0x473b3e)[_0x9437('0x25')](_0x3de742);}return null;};}function patchUpdates(_0x3d9cb1){return function(_0x481def){try{jsonpatch[_0x9437('0x2c')](_0x481def,_0x3d9cb1,!![]);}catch(_0x9bc354){return BPromise[_0x9437('0x2d')](_0x9bc354);}return _0x481def[_0x9437('0x2e')]();};}function saveUpdates(_0x458e1a,_0x16e1e6){return function(_0x5dbb3e){if(_0x5dbb3e){return _0x5dbb3e['update'](_0x458e1a)[_0x9437('0x19')](function(_0x4e38d6){return _0x4e38d6;});}return null;};}function removeEntity(_0x3d2f58,_0x3fe081){return function(_0x5eaa56){if(_0x5eaa56){return _0x5eaa56[_0x9437('0x2f')]()['then'](function(){_0x3d2f58[_0x9437('0x23')](0xcc)[_0x9437('0x24')]();});}};}function handleEntityNotFound(_0x2a1d7a,_0xbe1140){return function(_0x5c14fe){if(!_0x5c14fe){_0x2a1d7a[_0x9437('0x30')](0x194);}return _0x5c14fe;};}function handleError(_0x2adfa2,_0x505956){_0x505956=_0x505956||0x1f4;return function(_0x238ce9){logger[_0x9437('0x1e')](_0x238ce9[_0x9437('0x31')]);if(_0x238ce9[_0x9437('0x32')]){delete _0x238ce9[_0x9437('0x32')];}_0x2adfa2[_0x9437('0x23')](_0x505956)['send'](_0x238ce9);};}exports[_0x9437('0x33')]=function(_0x18c29e,_0xab68cf){var _0x58ddab={},_0x31f2cd={},_0x2dc438={'count':0x0,'rows':[]};var _0x1b14ba=_['map'](db[_0x9437('0x34')][_0x9437('0x35')],function(_0x58ee11){return{'name':_0x58ee11['fieldName'],'type':_0x58ee11[_0x9437('0x36')][_0x9437('0x37')]};});_0x31f2cd['model']=_['map'](_0x1b14ba,_0x9437('0x32'));_0x31f2cd[_0x9437('0x38')]=_[_0x9437('0x39')](_0x18c29e[_0x9437('0x38')]);_0x31f2cd['filters']=_[_0x9437('0x3a')](_0x31f2cd[_0x9437('0x3b')],_0x31f2cd[_0x9437('0x38')]);_0x58ddab[_0x9437('0x3c')]=_[_0x9437('0x3a')](_0x31f2cd[_0x9437('0x3b')],qs[_0x9437('0x3d')](_0x18c29e[_0x9437('0x38')]['fields']));_0x58ddab[_0x9437('0x3c')]=_0x58ddab[_0x9437('0x3c')][_0x9437('0x3e')]?_0x58ddab[_0x9437('0x3c')]:_0x31f2cd[_0x9437('0x3b')];if(!_0x18c29e[_0x9437('0x38')][_0x9437('0x3f')](_0x9437('0x40'))){_0x58ddab[_0x9437('0x27')]=qs[_0x9437('0x27')](_0x18c29e['query'][_0x9437('0x27')]);_0x58ddab['offset']=qs[_0x9437('0x29')](_0x18c29e[_0x9437('0x38')][_0x9437('0x29')]);}_0x58ddab[_0x9437('0x41')]=qs[_0x9437('0x42')](_0x18c29e[_0x9437('0x38')]['sort']);_0x58ddab[_0x9437('0x43')]=qs[_0x9437('0x44')](_[_0x9437('0x45')](_0x18c29e[_0x9437('0x38')],_0x31f2cd[_0x9437('0x44')]),_0x1b14ba);if(_0x18c29e[_0x9437('0x38')][_0x9437('0x46')]){_0x58ddab[_0x9437('0x43')]=_['merge'](_0x58ddab['where'],{'$or':_[_0x9437('0x47')](_0x1b14ba,function(_0x3eaf78){if(_0x3eaf78[_0x9437('0x36')]!=='VIRTUAL'){var _0x417a5d={};_0x417a5d[_0x3eaf78[_0x9437('0x32')]]={'$like':'%'+_0x18c29e[_0x9437('0x38')][_0x9437('0x46')]+'%'};return _0x417a5d;}})});}_0x58ddab=_[_0x9437('0x48')]({},_0x58ddab,_0x18c29e['options']);var _0x3eaa44={'where':_0x58ddab[_0x9437('0x43')]};return db['Network'][_0x9437('0x28')](_0x3eaa44)[_0x9437('0x19')](function(_0x2c085f){_0x2dc438['count']=_0x2c085f;if(_0x18c29e['query'][_0x9437('0x49')]){_0x58ddab[_0x9437('0x4a')]=[{'all':!![]}];}return db[_0x9437('0x34')]['findAll'](_0x58ddab);})[_0x9437('0x19')](function(_0x2148f4){_0x2dc438['rows']=_0x2148f4;return _0x2dc438;})[_0x9437('0x19')](respondWithFilteredResult(_0xab68cf,_0x58ddab))[_0x9437('0x22')](handleError(_0xab68cf,null));};exports[_0x9437('0x4b')]=function(_0x32a4e5,_0x197def){var _0x4b37ed={'raw':!![],'where':{'id':_0x32a4e5[_0x9437('0x4c')]['id']}},_0x2289be={};_0x2289be['model']=_['keys'](db[_0x9437('0x34')][_0x9437('0x35')]);_0x2289be['query']=_[_0x9437('0x39')](_0x32a4e5[_0x9437('0x38')]);_0x2289be[_0x9437('0x44')]=_[_0x9437('0x3a')](_0x2289be[_0x9437('0x3b')],_0x2289be[_0x9437('0x38')]);_0x4b37ed[_0x9437('0x3c')]=_[_0x9437('0x3a')](_0x2289be['model'],qs[_0x9437('0x3d')](_0x32a4e5[_0x9437('0x38')]['fields']));_0x4b37ed[_0x9437('0x3c')]=_0x4b37ed['attributes'][_0x9437('0x3e')]?_0x4b37ed[_0x9437('0x3c')]:_0x2289be[_0x9437('0x3b')];if(_0x32a4e5[_0x9437('0x38')][_0x9437('0x49')]){_0x4b37ed[_0x9437('0x4a')]=[{'all':!![]}];}_0x4b37ed=_[_0x9437('0x48')]({},_0x4b37ed,_0x32a4e5[_0x9437('0x4d')]);return db['Network']['find'](_0x4b37ed)['then'](handleEntityNotFound(_0x197def,null))['then'](respondWithResult(_0x197def,null))['catch'](handleError(_0x197def,null));};exports[_0x9437('0x4e')]=function(_0x3954e6,_0x56ccda,_0x4924f8){var _0x33a5e2;return db[_0x9437('0x4f')][_0x9437('0x50')](function(_0x10ee5b){return db[_0x9437('0x34')][_0x9437('0x4e')](_0x3954e6[_0x9437('0x51')],{'raw':!![]})[_0x9437('0x19')](function(_0xc06c4f){_0x33a5e2=_0xc06c4f;return db[_0x9437('0x34')][_0x9437('0x52')]({'where':{'type':_0x3954e6[_0x9437('0x51')]['type']},'raw':!![]});})['then'](function(_0x41c847){if(_0x33a5e2[_0x9437('0x36')]['toUpperCase']()==_0x9437('0x53')){var _0x36893c=fs[_0x9437('0x54')](path['join'](config[_0x9437('0x55')],_0x9437('0x56')),_0x9437('0x57'));var _0x5e59f9=ejs['render'](_0x36893c,{'networks':_0x41c847||[]});fs[_0x9437('0x58')](_0x9437('0x59'),_0x5e59f9);return respondWithRpcPromise('Reload','create',{'module':_0x9437('0x5a')});}else if(_0x33a5e2['type'][_0x9437('0x5b')]()=='TURN'){var _0x3d4607=fs[_0x9437('0x54')](path[_0x9437('0x5c')](config[_0x9437('0x55')],_0x9437('0x5d')),_0x9437('0x57'));var _0x1b4730=ejs[_0x9437('0x5e')](_0x3d4607,{'networks':_0x41c847||[]});fs[_0x9437('0x58')](_0x9437('0x5f'),_0x1b4730);return respondWithRpcPromise('Reload',_0x9437('0x4e'),{'module':_0x9437('0x5a')});}else{var _0x3b9809=fs[_0x9437('0x54')](path[_0x9437('0x5c')](config['root'],'server/files/templates/network.ejs'),_0x9437('0x57'));var _0x1e95a4=ejs[_0x9437('0x5e')](_0x3b9809,{'networks':_0x41c847||[]});fs['writeFileSync'](util[_0x9437('0x60')](_0x9437('0x61'),_0x3954e6[_0x9437('0x51')][_0x9437('0x36')][_0x9437('0x62')]()),_0x1e95a4);return respondWithRpcPromise(_0x9437('0x63'),_0x9437('0x4e'),{'module':_0x9437('0x64')});}return null;})[_0x9437('0x19')](function(){return _0x33a5e2;});})[_0x9437('0x19')](respondWithResult(_0x56ccda,0xc9))[_0x9437('0x22')](handleError(_0x56ccda,null));};exports[_0x9437('0x65')]=function(_0x5a15e7,_0xca2e7e,_0x5141b9){var _0x31b3d7;return db[_0x9437('0x4f')][_0x9437('0x50')](function(_0x2e7fa0){return db['Network'][_0x9437('0x66')]({'where':{'id':_0x5a15e7['params']['id']}})[_0x9437('0x19')](handleEntityNotFound(_0xca2e7e,null))[_0x9437('0x19')](saveUpdates(_0x5a15e7[_0x9437('0x51')],null))[_0x9437('0x19')](function(_0x26a03c){if(_0x26a03c){_0x31b3d7=_0x26a03c;return db[_0x9437('0x34')][_0x9437('0x52')]({'where':{'type':_0x31b3d7[_0x9437('0x36')]},'raw':!![]});}return null;})[_0x9437('0x19')](function(_0x1d5c8d){if(_0x31b3d7[_0x9437('0x36')]['toUpperCase']()==_0x9437('0x53')){var _0x6bfc14=fs[_0x9437('0x54')](path[_0x9437('0x5c')](config[_0x9437('0x55')],_0x9437('0x56')),_0x9437('0x57'));var _0x38b47e=ejs[_0x9437('0x5e')](_0x6bfc14,{'networks':_0x1d5c8d||[]});fs[_0x9437('0x58')](_0x9437('0x59'),_0x38b47e);return respondWithRpcPromise(_0x9437('0x63'),_0x9437('0x65'),{'module':_0x9437('0x5a')});}else if(_0x31b3d7[_0x9437('0x36')][_0x9437('0x5b')]()==_0x9437('0x67')){var _0x409f4a=fs['readFileSync'](path[_0x9437('0x5c')](config[_0x9437('0x55')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x109b79=ejs[_0x9437('0x5e')](_0x409f4a,{'networks':_0x1d5c8d||[]});fs['writeFileSync'](_0x9437('0x5f'),_0x109b79);return respondWithRpcPromise('Reload',_0x9437('0x65'),{'module':_0x9437('0x5a')});}else{var _0x5ca569=fs[_0x9437('0x54')](path['join'](config[_0x9437('0x55')],_0x9437('0x68')),_0x9437('0x57'));var _0x96f6c1=ejs[_0x9437('0x5e')](_0x5ca569,{'networks':_0x1d5c8d||[]});fs[_0x9437('0x58')](util['format'](_0x9437('0x61'),_0x5a15e7[_0x9437('0x51')][_0x9437('0x36')][_0x9437('0x62')]()),_0x96f6c1);return respondWithRpcPromise('Reload',_0x9437('0x65'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xe55c57){if(_0xe55c57){return _0x31b3d7;}return null;});})['then'](respondWithResult(_0xca2e7e,null))[_0x9437('0x22')](handleError(_0xca2e7e,null));};exports[_0x9437('0x2f')]=function(_0x5d669f,_0x229c52,_0x3dcce3){var _0x2063a9;return db['Network']['find']({'where':{'id':_0x5d669f[_0x9437('0x4c')]['id']}})[_0x9437('0x19')](function(_0x5385be){_0x2063a9=_0x5385be;return _0x5385be;})[_0x9437('0x19')](handleEntityNotFound(_0x229c52,null))[_0x9437('0x19')](removeEntity(_0x229c52,null))[_0x9437('0x19')](function(){if(_0x2063a9){return db[_0x9437('0x34')]['findAll']({'where':{'type':_0x2063a9[_0x9437('0x36')]},'raw':!![]});}})[_0x9437('0x19')](function(_0x23ee9d){if(_0x2063a9[_0x9437('0x36')][_0x9437('0x5b')]()==_0x9437('0x53')){var _0x138e9d=fs[_0x9437('0x54')](path[_0x9437('0x5c')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x9437('0x57'));var _0x460ee0=ejs[_0x9437('0x5e')](_0x138e9d,{'networks':_0x23ee9d||[]});fs['writeFileSync'](_0x9437('0x59'),_0x460ee0);return respondWithRpcPromise('Reload',_0x9437('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x2063a9[_0x9437('0x36')][_0x9437('0x5b')]()==_0x9437('0x67')){var _0x15c4fd=fs[_0x9437('0x54')](path[_0x9437('0x5c')](config[_0x9437('0x55')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x552408=ejs['render'](_0x15c4fd,{'networks':_0x23ee9d||[]});fs['writeFileSync'](_0x9437('0x5f'),_0x552408);return respondWithRpcPromise(_0x9437('0x63'),_0x9437('0x2f'),{'module':_0x9437('0x5a')});}else{var _0x219b4a=fs['readFileSync'](path[_0x9437('0x5c')](config['root'],_0x9437('0x68')),'utf8');var _0x11d419=ejs['render'](_0x219b4a,{'networks':_0x23ee9d||[]});fs['writeFileSync'](util[_0x9437('0x60')](_0x9437('0x61'),_0x5d669f['body']['type'][_0x9437('0x62')]()),_0x11d419);return respondWithRpcPromise('Reload',_0x9437('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x9437('0x22')](handleError(_0x229c52,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 40e4aa9..10ca72f 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 _0x579c=['define','network','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x579c,0xda));var _0xc579=function(_0x5401e2,_0xb8e801){_0x5401e2=_0x5401e2-0x0;var _0x557f0f=_0x579c[_0x5401e2];return _0x557f0f;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var moment=require(_0xc579('0x4'));var BPromise=require('bluebird');var rp=require(_0xc579('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var attributes=require(_0xc579('0x8'));module[_0xc579('0x9')]=function(_0x124ee5,_0x1bd276){return _0x124ee5[_0xc579('0xa')]('Network',attributes,{'tableName':_0xc579('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x235a=['exports','Network','network','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x235a,0x1ef));var _0xa235=function(_0x470bd6,_0xe0cae6){_0x470bd6=_0x470bd6-0x0;var _0x304b54=_0x235a[_0x470bd6];return _0x304b54;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var logger=require(_0xa235('0x2'))('api');var moment=require(_0xa235('0x3'));var BPromise=require('bluebird');var rp=require(_0xa235('0x4'));var fs=require('fs');var path=require(_0xa235('0x5'));var rimraf=require(_0xa235('0x6'));var config=require(_0xa235('0x7'));var attributes=require(_0xa235('0x8'));module[_0xa235('0x9')]=function(_0x2961c8,_0x1707fc){return _0x2961c8['define'](_0xa235('0xa'),attributes,{'tableName':_0xa235('0xb'),'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 20aacba..5644e2c 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xef6990,_0x49ab1d){var _0x2b508e=function(_0x362df3){while(--_0x362df3){_0xef6990['push'](_0xef6990['shift']());}};_0x2b508e(++_0x49ab1d);}(_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']('Network,\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 _0x7a54=['info','Network,\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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x519f44,_0x15bcf1){_0x519f44=_0x519f44-0x0;var _0xeb9301=_0x7a54[_0x519f44];return _0xeb9301;};'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')]('Network,\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/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4e83e40..47e441e 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 _0xde4c=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAgents','/:id/send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x116095,_0x327d96){var _0x2a8c92=function(_0x3058b2){while(--_0x3058b2){_0x116095['push'](_0x116095['shift']());}};_0x2a8c92(++_0x327d96);}(_0xde4c,0xc5));var _0xcde4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde4c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcde4('0x0'));var util=require(_0xcde4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcde4('0x2'));var router=express['Router']();var fs_extra=require(_0xcde4('0x3'));var auth=require(_0xcde4('0x4'));var interaction=require(_0xcde4('0x5'));var config=require(_0xcde4('0x6'));var controller=require(_0xcde4('0x7'));router[_0xcde4('0x8')]('/',auth[_0xcde4('0x9')](),controller[_0xcde4('0xa')]);router[_0xcde4('0x8')](_0xcde4('0xb'),auth[_0xcde4('0x9')](),controller[_0xcde4('0xc')]);router[_0xcde4('0x8')](_0xcde4('0xd'),auth[_0xcde4('0x9')](),controller[_0xcde4('0xe')]);router[_0xcde4('0x8')](_0xcde4('0xf'),auth[_0xcde4('0x9')](),controller['getDispositions']);router[_0xcde4('0x8')]('/:id/canned_answers',auth[_0xcde4('0x9')](),controller['getAnswers']);router[_0xcde4('0x8')](_0xcde4('0x10'),auth[_0xcde4('0x9')](),controller['getApplications']);router[_0xcde4('0x8')]('/:id/interactions',auth[_0xcde4('0x9')](),controller[_0xcde4('0x11')]);router[_0xcde4('0x8')](_0xcde4('0x12'),auth[_0xcde4('0x9')](),controller[_0xcde4('0x13')]);router[_0xcde4('0x14')]('/',auth[_0xcde4('0x9')](),controller[_0xcde4('0x15')]);router[_0xcde4('0x14')](_0xcde4('0xf'),auth[_0xcde4('0x9')](),controller[_0xcde4('0x16')]);router['post'](_0xcde4('0x17'),auth[_0xcde4('0x9')](),controller['addAnswer']);router[_0xcde4('0x14')]('/:id/notify',controller['notify']);router[_0xcde4('0x14')](_0xcde4('0x10'),auth[_0xcde4('0x9')](),controller['addApplications']);router[_0xcde4('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xcde4('0x18')]);router['post'](_0xcde4('0x19'),auth[_0xcde4('0x9')](),controller['send']);router[_0xcde4('0x1a')]('/:id',auth[_0xcde4('0x9')](),controller[_0xcde4('0x1b')]);router[_0xcde4('0x1c')](_0xcde4('0xd'),auth[_0xcde4('0x9')](),controller['destroy']);router[_0xcde4('0x1c')](_0xcde4('0xf'),auth[_0xcde4('0x9')](),controller[_0xcde4('0x1d')]);router[_0xcde4('0x1c')](_0xcde4('0x17'),auth[_0xcde4('0x9')](),controller[_0xcde4('0x1e')]);router[_0xcde4('0x1c')]('/:id/users',auth[_0xcde4('0x9')](),controller[_0xcde4('0x1f')]);module[_0xcde4('0x20')]=router; \ No newline at end of file +var _0xea72=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','/:id/applications','addApplications','/:id/users','/:id/send','put','update','delete','removeDispositions','removeAnswers','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x40b3d4,_0x46e731){var _0x2b317b=function(_0x253829){while(--_0x253829){_0x40b3d4['push'](_0x40b3d4['shift']());}};_0x2b317b(++_0x46e731);}(_0xea72,0xf4));var _0x2ea7=function(_0x69745b,_0x493b54){_0x69745b=_0x69745b-0x0;var _0xd32538=_0xea72[_0x69745b];return _0xd32538;};'use strict';var multer=require(_0x2ea7('0x0'));var util=require(_0x2ea7('0x1'));var path=require('path');var timeout=require(_0x2ea7('0x2'));var express=require(_0x2ea7('0x3'));var router=express[_0x2ea7('0x4')]();var fs_extra=require(_0x2ea7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2ea7('0x6'));var config=require('../../config/environment');var controller=require(_0x2ea7('0x7'));router[_0x2ea7('0x8')]('/',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xa')]);router[_0x2ea7('0x8')](_0x2ea7('0xb'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xc')]);router[_0x2ea7('0x8')](_0x2ea7('0xd'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xe')]);router[_0x2ea7('0x8')](_0x2ea7('0xf'),auth['isAuthenticated'](),controller[_0x2ea7('0x10')]);router[_0x2ea7('0x8')](_0x2ea7('0x11'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x12')]);router[_0x2ea7('0x8')]('/:id/applications',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x13')]);router[_0x2ea7('0x8')](_0x2ea7('0x14'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x15')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x2ea7('0x16')]);router[_0x2ea7('0x17')]('/',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x18')]);router[_0x2ea7('0x17')](_0x2ea7('0xf'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x19')]);router[_0x2ea7('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2ea7('0x1a')]);router[_0x2ea7('0x17')](_0x2ea7('0x1b'),controller['notify']);router['post'](_0x2ea7('0x1c'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x1d')]);router[_0x2ea7('0x17')](_0x2ea7('0x1e'),auth[_0x2ea7('0x9')](),controller['addAgents']);router[_0x2ea7('0x17')](_0x2ea7('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x2ea7('0x20')]('/:id',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x21')]);router[_0x2ea7('0x22')]('/:id',auth[_0x2ea7('0x9')](),controller['destroy']);router[_0x2ea7('0x22')](_0x2ea7('0xf'),auth['isAuthenticated'](),controller[_0x2ea7('0x23')]);router[_0x2ea7('0x22')](_0x2ea7('0x11'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x24')]);router[_0x2ea7('0x22')](_0x2ea7('0x1e'),auth[_0x2ea7('0x9')](),controller['removeAgents']);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 dd8354d..b31bd6d 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 _0x9b7c=['sequelize','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x109402,_0xfb296e){var _0x30efec=function(_0x264a8d){while(--_0x264a8d){_0x109402['push'](_0x109402['shift']());}};_0x30efec(++_0xfb296e);}(_0x9b7c,0x174));var _0xc9b7=function(_0xeeb156,_0x5392f4){_0xeeb156=_0xeeb156-0x0;var _0x4b7c74=_0x9b7c[_0xeeb156];return _0x4b7c74;};'use strict';var Sequelize=require(_0xc9b7('0x0'));var rs=require('randomstring');module[_0xc9b7('0x1')]={'name':{'type':Sequelize[_0xc9b7('0x2')],'unique':_0xc9b7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc9b7('0x2')]},'token':{'type':Sequelize[_0xc9b7('0x2')],'defaultValue':function(){return rs[_0xc9b7('0x4')]();}},'replyUri':{'type':Sequelize[_0xc9b7('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc9b7('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc9b7('0x5');}},'notificationSound':{'type':Sequelize[_0xc9b7('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc9b7('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc9b7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc9b7('0x2')]},'queueTransfer':{'type':Sequelize[_0xc9b7('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc9b7('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc9b7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc9b7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xc9b7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc9b7('0x6')],'defaultValue':![],'comment':_0xc9b7('0x9'),'set':function(_0x5a0732){if(!_0x5a0732)this['setDataValue'](_0xc9b7('0xa'),null);this['setDataValue'](_0xc9b7('0xb'),_0x5a0732);}}}; \ No newline at end of file +var _0xb02c=['setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name','generate','BOOLEAN','INTEGER'];(function(_0x1460bc,_0x509d3b){var _0x1bb22c=function(_0x57b4f5){while(--_0x57b4f5){_0x1460bc['push'](_0x1460bc['shift']());}};_0x1bb22c(++_0x509d3b);}(_0xb02c,0xbf));var _0xcb02=function(_0x308f41,_0x4a2164){_0x308f41=_0x308f41-0x0;var _0x10957e=_0xb02c[_0x308f41];return _0x10957e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xcb02('0x0'));module[_0xcb02('0x1')]={'name':{'type':Sequelize[_0xcb02('0x2')],'unique':_0xcb02('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcb02('0x2')]},'token':{'type':Sequelize[_0xcb02('0x2')],'defaultValue':function(){return rs[_0xcb02('0x4')]();}},'replyUri':{'type':Sequelize[_0xcb02('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcb02('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xcb02('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcb02('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcb02('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb02('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcb02('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb02('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcb02('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcb02('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x43a0ac){if(!_0x43a0ac)this[_0xcb02('0x7')](_0xcb02('0x8'),null);this[_0xcb02('0x7')]('mandatoryDisposition',_0x43a0ac);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index e26f69e..ee86bcd 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 _0xe657=['removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','READ_COMMITTED','findAndCountAll','send','getApplications','Owner','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','count','include','findAll','show','params','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','create','getDispositions','findOne','pick','OpenchannelAccountId','includeAll','rows'];(function(_0x310efa,_0x5e5057){var _0x2fb424=function(_0x5d2658){while(--_0x5d2658){_0x310efa['push'](_0x310efa['shift']());}};_0x2fb424(++_0x5e5057);}(_0xe657,0x1c1));var _0x7e65=function(_0x477de3,_0x33d3b2){_0x477de3=_0x477de3-0x0;var _0x36c52c=_0xe657[_0x477de3];return _0x36c52c;};'use strict';var emlformat=require(_0x7e65('0x0'));var rimraf=require(_0x7e65('0x1'));var zipdir=require(_0x7e65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e65('0x3'));var moment=require(_0x7e65('0x4'));var BPromise=require(_0x7e65('0x5'));var Mustache=require(_0x7e65('0x6'));var util=require(_0x7e65('0x7'));var path=require(_0x7e65('0x8'));var sox=require(_0x7e65('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e65('0xa'));var squel=require(_0x7e65('0xb'));var crypto=require(_0x7e65('0xc'));var jsforce=require(_0x7e65('0xd'));var deskjs=require(_0x7e65('0xe'));var toCsv=require(_0x7e65('0xf'));var querystring=require(_0x7e65('0x10'));var Papa=require(_0x7e65('0x11'));var Redis=require(_0x7e65('0x12'));var authService=require(_0x7e65('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7e65('0x14'));var hardwareService=require(_0x7e65('0x15'));var logger=require(_0x7e65('0x16'))(_0x7e65('0x17'));var utils=require(_0x7e65('0x18'));var config=require(_0x7e65('0x19'));var licenseUtil=require(_0x7e65('0x1a'));var db=require(_0x7e65('0x1b'))['db'];config['redis']=_[_0x7e65('0x1c')](config[_0x7e65('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e65('0x1d')]));require('./openchannelAccount.socket')[_0x7e65('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7e65('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x7e65('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1f4a10,_0xab9f6,_0x2aa845,_0x1d9a9b){return new BPromise(function(_0xddcc9c,_0x1747d2){var _0x15a122=_0x1d9a9b||client;return _0x15a122[_0x7e65('0x20')](_0x1f4a10,_0x2aa845)[_0x7e65('0x21')](function(_0x2ed324){logger['info'](_0x7e65('0x22'),_0xab9f6,_0x7e65('0x23'));logger[_0x7e65('0x24')](_0x7e65('0x25'),_0xab9f6,_0x7e65('0x23'),JSON[_0x7e65('0x26')](_0x2ed324));if(_0x2ed324['error']){if(_0x2ed324[_0x7e65('0x27')]['code']===0x1f4){logger['error'](_0x7e65('0x22'),_0xab9f6,_0x2ed324[_0x7e65('0x27')]['message']);return _0x1747d2(_0x2ed324[_0x7e65('0x27')][_0x7e65('0x28')]);}logger[_0x7e65('0x27')](_0x7e65('0x22'),_0xab9f6,_0x2ed324[_0x7e65('0x27')][_0x7e65('0x28')]);return _0xddcc9c(_0x2ed324[_0x7e65('0x27')]['message']);}else{logger['info'](_0x7e65('0x22'),_0xab9f6,_0x7e65('0x23'));_0xddcc9c(_0x2ed324['result']['message']);}})[_0x7e65('0x29')](function(_0x5632e6){logger[_0x7e65('0x27')](_0x7e65('0x22'),_0xab9f6,_0x5632e6);_0x1747d2(_0x5632e6);});});}function respondWithStatusCode(_0x556a0d,_0x40be8d){_0x40be8d=_0x40be8d||0xcc;return function(_0x4fa475){if(_0x4fa475){return _0x556a0d[_0x7e65('0x2a')](_0x40be8d);}return _0x556a0d[_0x7e65('0x2b')](_0x40be8d)[_0x7e65('0x2c')]();};}function respondWithResult(_0x3606a9,_0x577336){_0x577336=_0x577336||0xc8;return function(_0x15e494){if(_0x15e494){return _0x3606a9[_0x7e65('0x2b')](_0x577336)[_0x7e65('0x2d')](_0x15e494);}};}function respondWithFilteredResult(_0x3000a5,_0x215ef4){return function(_0x25e7bf){if(_0x25e7bf){var _0x341a1d=typeof _0x215ef4[_0x7e65('0x2e')]==='undefined'&&typeof _0x215ef4[_0x7e65('0x2f')]==='undefined';var _0x33a900=_0x25e7bf['count'];var _0x49bf56=_0x341a1d?0x0:_0x215ef4['offset'];var _0x1b591c=_0x341a1d?_0x25e7bf['count']:_0x215ef4[_0x7e65('0x2e')]+_0x215ef4[_0x7e65('0x2f')];var _0x2cc7bf;if(_0x1b591c>=_0x33a900){_0x1b591c=_0x33a900;_0x2cc7bf=0xc8;}else{_0x2cc7bf=0xce;}_0x3000a5['status'](_0x2cc7bf);return _0x3000a5['set'](_0x7e65('0x30'),_0x49bf56+'-'+_0x1b591c+'/'+_0x33a900)[_0x7e65('0x2d')](_0x25e7bf);}return null;};}function patchUpdates(_0x2e9235){return function(_0x5dee50){try{jsonpatch['apply'](_0x5dee50,_0x2e9235,!![]);}catch(_0x3e6dcd){return BPromise[_0x7e65('0x31')](_0x3e6dcd);}return _0x5dee50[_0x7e65('0x32')]();};}function saveUpdates(_0x3df014,_0x5c0152){return function(_0x2adc3d){if(_0x2adc3d){return _0x2adc3d['update'](_0x3df014)[_0x7e65('0x21')](function(_0xb4d4ab){return _0xb4d4ab;});}return null;};}function removeEntity(_0x11476f,_0x3ba46f){return function(_0x45fdd2){if(_0x45fdd2){return _0x45fdd2['destroy']()[_0x7e65('0x21')](function(){var _0x5028b7=_0x45fdd2[_0x7e65('0x33')]({'plain':!![]});var _0x464b13=_0x7e65('0x34');return db[_0x7e65('0x35')][_0x7e65('0x36')]({'where':{'type':_0x464b13,'resourceId':_0x5028b7['id']}})['then'](function(){return _0x45fdd2;});})['then'](function(){_0x11476f[_0x7e65('0x2b')](0xcc)[_0x7e65('0x2c')]();});}};}function handleEntityNotFound(_0x38adbc,_0x5b2a63){return function(_0xe2bba3){if(!_0xe2bba3){_0x38adbc['sendStatus'](0x194);}return _0xe2bba3;};}function handleError(_0xf5342d,_0x4a589c){_0x4a589c=_0x4a589c||0x1f4;return function(_0x2a0601){logger[_0x7e65('0x27')](_0x2a0601[_0x7e65('0x37')]);if(_0x2a0601[_0x7e65('0x38')]){delete _0x2a0601['name'];}_0xf5342d[_0x7e65('0x2b')](_0x4a589c)['send'](_0x2a0601);};}exports[_0x7e65('0x39')]=function(_0xe64ab,_0x571612){var _0x354d49={'include':[{'model':db[_0x7e65('0x3a')],'as':_0x7e65('0x3b')}]},_0x53deb5={},_0x3e390f={'count':0x0,'rows':[]};var _0x232545=_['map'](db[_0x7e65('0x3c')][_0x7e65('0x3d')],function(_0x2d1e2a){return{'name':_0x2d1e2a[_0x7e65('0x3e')],'type':_0x2d1e2a[_0x7e65('0x3f')]['key']};});_0x53deb5[_0x7e65('0x40')]=_[_0x7e65('0x41')](_0x232545,'name');_0x53deb5['query']=_[_0x7e65('0x42')](_0xe64ab[_0x7e65('0x43')]);_0x53deb5[_0x7e65('0x44')]=_[_0x7e65('0x45')](_0x53deb5[_0x7e65('0x40')],_0x53deb5[_0x7e65('0x43')]);_0x354d49[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x53deb5['model'],qs[_0x7e65('0x47')](_0xe64ab[_0x7e65('0x43')][_0x7e65('0x47')]));_0x354d49[_0x7e65('0x46')]=_0x354d49[_0x7e65('0x46')][_0x7e65('0x48')]?_0x354d49['attributes']:_0x53deb5[_0x7e65('0x40')];if(!_0xe64ab['query'][_0x7e65('0x49')](_0x7e65('0x4a'))){_0x354d49[_0x7e65('0x2f')]=qs[_0x7e65('0x2f')](_0xe64ab[_0x7e65('0x43')][_0x7e65('0x2f')]);_0x354d49[_0x7e65('0x2e')]=qs[_0x7e65('0x2e')](_0xe64ab[_0x7e65('0x43')]['offset']);}_0x354d49[_0x7e65('0x4b')]=qs['sort'](_0xe64ab[_0x7e65('0x43')][_0x7e65('0x4c')]);_0x354d49['where']=qs['filters'](_['pick'](_0xe64ab[_0x7e65('0x43')],_0x53deb5[_0x7e65('0x44')]),_0x232545);if(_0xe64ab[_0x7e65('0x43')][_0x7e65('0x4d')]){_0x354d49[_0x7e65('0x4e')]=_[_0x7e65('0x4f')](_0x354d49[_0x7e65('0x4e')],{'$or':_[_0x7e65('0x41')](_0x232545,function(_0x5c8fce){if(_0x5c8fce[_0x7e65('0x3f')]!==_0x7e65('0x50')){var _0x29dfca={};_0x29dfca[_0x5c8fce[_0x7e65('0x38')]]={'$like':'%'+_0xe64ab['query'][_0x7e65('0x4d')]+'%'};return _0x29dfca;}})});}_0x354d49=_[_0x7e65('0x4f')]({},_0x354d49,_0xe64ab['options']);var _0x348644={'where':_0x354d49['where']};return db[_0x7e65('0x3c')][_0x7e65('0x51')](_0x348644)['then'](function(_0x1a1a7a){_0x3e390f['count']=_0x1a1a7a;if(_0xe64ab[_0x7e65('0x43')]['includeAll']){_0x354d49[_0x7e65('0x52')]=[{'all':!![]}];}return db[_0x7e65('0x3c')][_0x7e65('0x53')](_0x354d49);})[_0x7e65('0x21')](function(_0x37ff41){_0x3e390f['rows']=_0x37ff41;return _0x3e390f;})[_0x7e65('0x21')](respondWithFilteredResult(_0x571612,_0x354d49))['catch'](handleError(_0x571612,null));};exports[_0x7e65('0x54')]=function(_0x49867c,_0x508c09){var _0x23465a={'raw':![],'where':{'id':_0x49867c[_0x7e65('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7e65('0x3b')}]},_0x817ea5={};_0x817ea5[_0x7e65('0x40')]=_[_0x7e65('0x42')](db[_0x7e65('0x3c')][_0x7e65('0x3d')]);_0x817ea5[_0x7e65('0x43')]=_[_0x7e65('0x42')](_0x49867c[_0x7e65('0x43')]);_0x817ea5[_0x7e65('0x44')]=_['intersection'](_0x817ea5['model'],_0x817ea5['query']);_0x23465a[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x817ea5[_0x7e65('0x40')],qs[_0x7e65('0x47')](_0x49867c[_0x7e65('0x43')][_0x7e65('0x47')]));_0x23465a['attributes']=_0x23465a['attributes']['length']?_0x23465a[_0x7e65('0x46')]:_0x817ea5[_0x7e65('0x40')];if(_0x49867c[_0x7e65('0x43')]['includeAll']){_0x23465a[_0x7e65('0x52')]=[{'all':!![]}];}_0x23465a=_[_0x7e65('0x4f')]({},_0x23465a,_0x49867c[_0x7e65('0x56')]);return db[_0x7e65('0x3c')][_0x7e65('0x57')](_0x23465a)[_0x7e65('0x21')](handleEntityNotFound(_0x508c09,null))['then'](respondWithResult(_0x508c09,null))[_0x7e65('0x29')](handleError(_0x508c09,null));};exports['create']=function(_0x944a25,_0x1db5e5){return db[_0x7e65('0x3c')]['create'](_0x944a25['body'],{})[_0x7e65('0x21')](function(_0x31da0e){var _0x3cbdc6=_0x944a25[_0x7e65('0x58')][_0x7e65('0x33')]({'plain':!![]});if(!_0x3cbdc6)throw new Error(_0x7e65('0x59'));if(_0x3cbdc6[_0x7e65('0x5a')]===_0x7e65('0x58')){var _0x213c76=_0x31da0e[_0x7e65('0x33')]({'plain':!![]});var _0x295d4f=_0x7e65('0x34');return db['UserProfileSection'][_0x7e65('0x57')]({'where':{'name':_0x295d4f,'userProfileId':_0x3cbdc6[_0x7e65('0x5b')]},'raw':!![]})[_0x7e65('0x21')](function(_0xd30a88){if(_0xd30a88&&_0xd30a88[_0x7e65('0x5c')]===0x0){return db[_0x7e65('0x35')]['create']({'name':_0x213c76[_0x7e65('0x38')],'resourceId':_0x213c76['id'],'type':_0xd30a88[_0x7e65('0x38')],'sectionId':_0xd30a88['id']},{})[_0x7e65('0x21')](function(){return _0x31da0e;});}else{return _0x31da0e;}})[_0x7e65('0x29')](function(_0x4fc9e6){logger[_0x7e65('0x27')](_0x7e65('0x5d'),_0x4fc9e6);throw _0x4fc9e6;});}return _0x31da0e;})[_0x7e65('0x21')](respondWithResult(_0x1db5e5,0xc9))[_0x7e65('0x29')](handleError(_0x1db5e5,null));};exports[_0x7e65('0x5e')]=function(_0x456e17,_0x13716d){if(_0x456e17['body']['id']){delete _0x456e17[_0x7e65('0x5f')]['id'];}return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0x456e17[_0x7e65('0x55')]['id']},'include':[{'model':db[_0x7e65('0x3a')],'as':_0x7e65('0x3b')}]})[_0x7e65('0x21')](handleEntityNotFound(_0x13716d,null))[_0x7e65('0x21')](saveUpdates(_0x456e17[_0x7e65('0x5f')],null))[_0x7e65('0x21')](respondWithResult(_0x13716d,null))[_0x7e65('0x29')](handleError(_0x13716d,null));};exports[_0x7e65('0x36')]=function(_0x14773d,_0x4af2d6){return db['OpenchannelAccount']['find']({'where':{'id':_0x14773d['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x4af2d6,null))[_0x7e65('0x21')](removeEntity(_0x4af2d6,null))[_0x7e65('0x29')](handleError(_0x4af2d6,null));};exports[_0x7e65('0x60')]=function(_0x4cbc96,_0x53212d){return db[_0x7e65('0x3c')][_0x7e65('0x60')]()[_0x7e65('0x21')](respondWithResult(_0x53212d,null))[_0x7e65('0x29')](handleError(_0x53212d,null));};exports[_0x7e65('0x61')]=function(_0x513c8b,_0x4f05ba,_0x2aca1b){if(_0x513c8b[_0x7e65('0x5f')]['id']){delete _0x513c8b[_0x7e65('0x5f')]['id'];}return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0x513c8b['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x4f05ba,null))['then'](function(_0x3dbec4){if(_0x3dbec4){_0x513c8b[_0x7e65('0x5f')]['OpenchannelAccountId']=_0x3dbec4['id'];return db[_0x7e65('0x62')][_0x7e65('0x63')](_0x513c8b[_0x7e65('0x5f')]);}})['then'](respondWithResult(_0x4f05ba,null))[_0x7e65('0x29')](handleError(_0x4f05ba,null));};exports[_0x7e65('0x64')]=function(_0x55843b,_0x4ae4b7,_0x253984){var _0x55d52f={'raw':![],'where':{}};var _0x2fa071={};var _0x58dd61={'count':0x0,'rows':[]};return db[_0x7e65('0x3c')][_0x7e65('0x65')]({'where':{'id':_0x55843b['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x4ae4b7,null))['then'](function(_0x2a4185){if(_0x2a4185){_0x2fa071[_0x7e65('0x40')]=_[_0x7e65('0x42')](db[_0x7e65('0x62')][_0x7e65('0x3d')]);_0x2fa071['query']=_['keys'](_0x55843b[_0x7e65('0x43')]);_0x2fa071[_0x7e65('0x44')]=_[_0x7e65('0x45')](_0x2fa071[_0x7e65('0x40')],_0x2fa071[_0x7e65('0x43')]);_0x55d52f[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x2fa071[_0x7e65('0x40')],qs[_0x7e65('0x47')](_0x55843b[_0x7e65('0x43')][_0x7e65('0x47')]));_0x55d52f[_0x7e65('0x46')]=_0x55d52f[_0x7e65('0x46')][_0x7e65('0x48')]?_0x55d52f[_0x7e65('0x46')]:_0x2fa071[_0x7e65('0x40')];if(!_0x55843b['query'][_0x7e65('0x49')](_0x7e65('0x4a'))){_0x55d52f[_0x7e65('0x2f')]=qs[_0x7e65('0x2f')](_0x55843b['query'][_0x7e65('0x2f')]);_0x55d52f[_0x7e65('0x2e')]=qs[_0x7e65('0x2e')](_0x55843b['query'][_0x7e65('0x2e')]);}_0x55d52f['order']=qs['sort'](_0x55843b[_0x7e65('0x43')][_0x7e65('0x4c')]);_0x55d52f[_0x7e65('0x4e')]=qs[_0x7e65('0x44')](_[_0x7e65('0x66')](_0x55843b[_0x7e65('0x43')],_0x2fa071[_0x7e65('0x44')]));_0x55d52f[_0x7e65('0x4e')][_0x7e65('0x67')]=_0x2a4185['id'];if(_0x55843b[_0x7e65('0x43')][_0x7e65('0x4d')]){_0x55d52f[_0x7e65('0x4e')]=_[_0x7e65('0x4f')](_0x55d52f[_0x7e65('0x4e')],{'$or':_[_0x7e65('0x41')](_0x55d52f[_0x7e65('0x46')],function(_0x1090eb){var _0x239f28={};_0x239f28[_0x1090eb]={'$like':'%'+_0x55843b[_0x7e65('0x43')][_0x7e65('0x4d')]+'%'};return _0x239f28;})});}_0x55d52f=_[_0x7e65('0x4f')]({},_0x55d52f,_0x55843b[_0x7e65('0x56')]);return db['Disposition'][_0x7e65('0x51')]({'where':_0x55d52f[_0x7e65('0x4e')]})[_0x7e65('0x21')](function(_0x3b0511){_0x58dd61[_0x7e65('0x51')]=_0x3b0511;if(_0x55843b[_0x7e65('0x43')][_0x7e65('0x68')]){_0x55d52f[_0x7e65('0x52')]=[{'all':!![]}];}return db[_0x7e65('0x62')]['findAll'](_0x55d52f);})[_0x7e65('0x21')](function(_0x401c08){_0x58dd61[_0x7e65('0x69')]=_0x401c08;return _0x58dd61;});}})[_0x7e65('0x21')](respondWithFilteredResult(_0x4ae4b7,_0x55d52f))[_0x7e65('0x29')](handleError(_0x4ae4b7,null));};exports[_0x7e65('0x6a')]=function(_0x5ec23b,_0xbf2cfc,_0x1e383e){return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0x5ec23b[_0x7e65('0x55')]['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0xbf2cfc,null))[_0x7e65('0x21')](function(_0x39f8cc){if(_0x39f8cc){return _0x39f8cc['removeDispositions'](_0x5ec23b['query'][_0x7e65('0x6b')]);}})[_0x7e65('0x21')](respondWithStatusCode(_0xbf2cfc,null))[_0x7e65('0x29')](handleError(_0xbf2cfc,null));};exports[_0x7e65('0x6c')]=function(_0x2c48e3,_0x387eb2,_0x3a46de){if(_0x2c48e3[_0x7e65('0x5f')]['id']){delete _0x2c48e3[_0x7e65('0x5f')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x2c48e3['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x387eb2,null))[_0x7e65('0x21')](function(_0x44afed){if(_0x44afed){_0x2c48e3[_0x7e65('0x5f')][_0x7e65('0x67')]=_0x44afed['id'];return db[_0x7e65('0x6d')]['create'](_0x2c48e3[_0x7e65('0x5f')]);}})[_0x7e65('0x21')](respondWithResult(_0x387eb2,null))[_0x7e65('0x29')](handleError(_0x387eb2,null));};exports[_0x7e65('0x6e')]=function(_0x118848,_0xe31cfd,_0x40f99c){var _0x5408a3={'raw':![],'where':{}};var _0x4b218f={};var _0x31a8b7={'count':0x0,'rows':[]};return db[_0x7e65('0x3c')]['findOne']({'where':{'id':_0x118848[_0x7e65('0x55')]['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0xe31cfd,null))[_0x7e65('0x21')](function(_0x156444){if(_0x156444){_0x4b218f[_0x7e65('0x40')]=_[_0x7e65('0x42')](db[_0x7e65('0x6d')][_0x7e65('0x3d')]);_0x4b218f['query']=_['keys'](_0x118848['query']);_0x4b218f[_0x7e65('0x44')]=_[_0x7e65('0x45')](_0x4b218f['model'],_0x4b218f[_0x7e65('0x43')]);_0x5408a3[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x4b218f[_0x7e65('0x40')],qs['fields'](_0x118848[_0x7e65('0x43')][_0x7e65('0x47')]));_0x5408a3['attributes']=_0x5408a3['attributes'][_0x7e65('0x48')]?_0x5408a3[_0x7e65('0x46')]:_0x4b218f[_0x7e65('0x40')];if(!_0x118848[_0x7e65('0x43')][_0x7e65('0x49')](_0x7e65('0x4a'))){_0x5408a3[_0x7e65('0x2f')]=qs[_0x7e65('0x2f')](_0x118848[_0x7e65('0x43')]['limit']);_0x5408a3[_0x7e65('0x2e')]=qs['offset'](_0x118848[_0x7e65('0x43')][_0x7e65('0x2e')]);}_0x5408a3[_0x7e65('0x4b')]=qs[_0x7e65('0x4c')](_0x118848['query']['sort']);_0x5408a3[_0x7e65('0x4e')]=qs['filters'](_[_0x7e65('0x66')](_0x118848['query'],_0x4b218f[_0x7e65('0x44')]));_0x5408a3[_0x7e65('0x4e')][_0x7e65('0x67')]=_0x156444['id'];if(_0x118848[_0x7e65('0x43')][_0x7e65('0x4d')]){_0x5408a3['where']=_[_0x7e65('0x4f')](_0x5408a3[_0x7e65('0x4e')],{'$or':_[_0x7e65('0x41')](_0x5408a3['attributes'],function(_0x3185c3){var _0x11b9a4={};_0x11b9a4[_0x3185c3]={'$like':'%'+_0x118848[_0x7e65('0x43')][_0x7e65('0x4d')]+'%'};return _0x11b9a4;})});}_0x5408a3=_[_0x7e65('0x4f')]({},_0x5408a3,_0x118848[_0x7e65('0x56')]);return db[_0x7e65('0x6d')]['count']({'where':_0x5408a3[_0x7e65('0x4e')]})['then'](function(_0x23f8cd){_0x31a8b7['count']=_0x23f8cd;if(_0x118848[_0x7e65('0x43')][_0x7e65('0x68')]){_0x5408a3[_0x7e65('0x52')]=[{'all':!![]}];}return db[_0x7e65('0x6d')]['findAll'](_0x5408a3);})[_0x7e65('0x21')](function(_0x3da320){_0x31a8b7['rows']=_0x3da320;return _0x31a8b7;});}})[_0x7e65('0x21')](respondWithFilteredResult(_0xe31cfd,_0x5408a3))[_0x7e65('0x29')](handleError(_0xe31cfd,null));};exports[_0x7e65('0x6f')]=function(_0x473408,_0x43f5fe,_0x20e586){return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0x473408[_0x7e65('0x55')]['id']}})['then'](handleEntityNotFound(_0x43f5fe,null))['then'](function(_0x52b23d){if(_0x52b23d){return _0x52b23d[_0x7e65('0x6f')](_0x473408[_0x7e65('0x43')][_0x7e65('0x6b')]);}})[_0x7e65('0x21')](respondWithStatusCode(_0x43f5fe,null))['catch'](handleError(_0x43f5fe,null));};exports['notify']=function(_0x1ffc36,_0x30f0e5,_0x448fc6){var _0x2f6cba={'body':_0x1ffc36[_0x7e65('0x5f')],'channel':'openchannel'};var _0x1eb42=[];var _0x9f3ba6=[];var _0x32097c={};var _0x1985c6=![];return db[_0x7e65('0x70')][_0x7e65('0x60')]()[_0x7e65('0x21')](function(_0x2f5a29){if(!_0x2f5a29){throw new db[(_0x7e65('0x71'))][(_0x7e65('0x72'))](_0x7e65('0x73'));}_0x1eb42=_['difference'](_[_0x7e65('0x42')](_0x2f5a29),[_0x7e65('0x74'),_0x7e65('0x75')]);_0x9f3ba6=_[_0x7e65('0x76')](_[_0x7e65('0x42')](_0x2f5a29),[_0x7e65('0x74'),_0x7e65('0x75'),'CompanyId',_0x7e65('0x77')]);if(_0x1ffc36[_0x7e65('0x5f')]['id']){delete _0x1ffc36[_0x7e65('0x5f')]['id'];}if(_['isNil'](_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x78')])){throw new db[(_0x7e65('0x71'))]['ValidationError'](_0x7e65('0x79'));}if(_[_0x7e65('0x7a')](_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x5f')])||_0x1ffc36['body'][_0x7e65('0x5f')]===''){throw new db[(_0x7e65('0x71'))][(_0x7e65('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7e65('0x7a')](_0x1ffc36['body'][_0x7e65('0x7b')])){throw new db[(_0x7e65('0x71'))][(_0x7e65('0x72'))](_0x7e65('0x7c')+_0x9f3ba6);}if(!_[_0x7e65('0x7d')](_0x9f3ba6,_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x7b')])){throw new db['Sequelize'][(_0x7e65('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9f3ba6);}_0x32097c[_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x7b')]]=_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x78')];})[_0x7e65('0x21')](function(){return db[_0x7e65('0x3c')]['find']({'where':{'id':_0x1ffc36[_0x7e65('0x55')]['id']},'include':[{'model':db[_0x7e65('0x7e')],'as':'List','include':[{'model':db[_0x7e65('0x70')],'as':_0x7e65('0x7f'),'where':_0x32097c,'limit':0x1,'order':[[_0x7e65('0x75'),'DESC']]}]},{'model':db[_0x7e65('0x80')],'as':_0x7e65('0x81')}]});})[_0x7e65('0x21')](handleEntityNotFound(_0x30f0e5,null))[_0x7e65('0x21')](function(_0x3429a3){if(_0x3429a3&&_0x3429a3[_0x7e65('0x82')]){_0x2f6cba[_0x7e65('0x83')]=_0x3429a3;_0x2f6cba[_0x7e65('0x84')]=_0x3429a3[_0x7e65('0x81')];_0x2f6cba['list']=_0x3429a3['List'];_0x2f6cba[_0x7e65('0x84')]=_[_0x7e65('0x85')](_0x2f6cba[_0x7e65('0x84')],[_0x7e65('0x86')],['asc']);if(_0x2f6cba[_0x7e65('0x83')][_0x7e65('0x81')]){delete _0x2f6cba[_0x7e65('0x83')][_0x7e65('0x81')];}if(_0x2f6cba[_0x7e65('0x83')][_0x7e65('0x82')]&&_0x2f6cba[_0x7e65('0x83')][_0x7e65('0x82')][_0x7e65('0x7f')]['length']){return _0x2f6cba['account'][_0x7e65('0x82')][_0x7e65('0x7f')][0x0];}var _0x4069be=_['defaults'](_0x1ffc36[_0x7e65('0x5f')],{'firstName':_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x78')],'ListId':_0x3429a3[_0x7e65('0x77')]});_0x4069be[_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x7b')]]=_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x78')];return db[_0x7e65('0x70')][_0x7e65('0x63')](_0x4069be,{'fields':_0x1eb42,'raw':!![]});}})['then'](handleEntityNotFound(_0x30f0e5,null))[_0x7e65('0x21')](function(_0x2c4466){_0x2f6cba['contact']=_0x2c4466;if(_0x2c4466){var _0x4e6569={'ContactId':_0x2c4466['id'],'OpenchannelAccountId':_0x1ffc36['params']['id'],'from':(_0x2c4466['firstName']||'')+'\x20'+(_0x2c4466[_0x7e65('0x87')]||'')};var _0x41206a={'OpenchannelAccountId':_0x1ffc36[_0x7e65('0x55')]['id'],'closed':![]};if(_0x1ffc36['body'][_0x7e65('0x88')]){_0x41206a[_0x7e65('0x88')]=_0x1ffc36['body'][_0x7e65('0x88')];return db[_0x7e65('0x89')][_0x7e65('0x57')]({'where':_0x41206a})[_0x7e65('0x21')](function(_0x1c13e5){if(_0x1c13e5){return[_0x1c13e5,![]];}_0x4e6569[_0x7e65('0x88')]=_0x1ffc36[_0x7e65('0x5f')]['threadId'];_0x4e6569['externalUrl']=_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x8a')];return db['OpenchannelInteraction'][_0x7e65('0x63')](_0x4e6569)[_0x7e65('0x21')](function(_0x23aa7c){return[_0x23aa7c,!![]];});});}else{_0x41206a['threadId']=null;}_0x41206a['ContactId']=_0x2c4466['id'];return db[_0x7e65('0x89')][_0x7e65('0x57')]({'where':_0x41206a})['then'](function(_0x569e4d){if(_0x569e4d){return[_0x569e4d,![]];}return db[_0x7e65('0x89')]['create'](_0x4e6569)['then'](function(_0x17a857){return[_0x17a857,!![]];});});}})[_0x7e65('0x8b')](function(_0x48a0ab,_0x418bab){if(_0x48a0ab){_0x1985c6=_0x418bab;if(!_0x418bab){var _0x46e225={'from':(_0x2f6cba[_0x7e65('0x8c')][_0x7e65('0x8d')]||'')+'\x20'+(_0x2f6cba[_0x7e65('0x8c')][_0x7e65('0x87')]||'')};if(_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x88')]&&_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x8e')]&&_0x1ffc36[_0x7e65('0x5f')]['threadId']!=_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x8e')]){_0x46e225[_0x7e65('0x88')]=_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x8e')];}return _0x48a0ab[_0x7e65('0x5e')](_0x46e225);}else{return _0x48a0ab;}}})['then'](function(_0x3b8c20){_0x2f6cba[_0x7e65('0x8f')]=_0x3b8c20['get']({'plain':!![]});_0x2f6cba[_0x7e65('0x8f')][_0x7e65('0x90')]=_0x1985c6;if(_0x2f6cba[_0x7e65('0x8f')][_0x7e65('0x90')]){if(_0x2f6cba[_0x7e65('0x83')][_0x7e65('0x91')]){_0x2f6cba['applications'][_0x7e65('0x92')]({'id':0x0,'priority':_0x2f6cba[_0x7e65('0x84')][_0x7e65('0x48')]+0x1,'app':_0x7e65('0x93'),'appdata':_0x7e65('0x94'),'interval':_0x7e65('0x95')});}}return db['OpenchannelMessage'][_0x7e65('0x63')]({'body':_0x1ffc36['body'][_0x7e65('0x5f')],'OpenchannelAccountId':_0x1ffc36[_0x7e65('0x55')]['id'],'OpenchannelInteractionId':_0x3b8c20['id'],'direction':'in','ContactId':_0x2f6cba[_0x7e65('0x8c')]['id'],'AttachmentId':_0x1ffc36[_0x7e65('0x5f')][_0x7e65('0x96')]});})['then'](function(_0x5de6ae){_0x2f6cba[_0x7e65('0x28')]=_0x5de6ae;if(_0x2f6cba[_0x7e65('0x8f')][_0x7e65('0x97')]){return db[_0x7e65('0x98')][_0x7e65('0x57')]({'attributes':['id',_0x7e65('0x38')],'where':{'id':_0x2f6cba['interaction'][_0x7e65('0x97')]}})[_0x7e65('0x21')](function(_0x3612a0){if(_0x3612a0){_0x2f6cba[_0x7e65('0x84')][_0x7e65('0x99')]({'id':0x0,'priority':0x0,'app':_0x7e65('0x9a'),'appdata':_0x3612a0[_0x7e65('0x38')]+','+(_0x2f6cba[_0x7e65('0x83')][_0x7e65('0x9b')]||0xa),'interval':_0x7e65('0x95')});_0x2f6cba[_0x7e65('0x9c')]=![];}return respondWithRpcPromise(_0x7e65('0x9d'),_0x7e65('0x9e'),_0x2f6cba);});}return respondWithRpcPromise(_0x7e65('0x9d'),_0x7e65('0x9e'),_0x2f6cba);})[_0x7e65('0x21')](function(_0x37782c){respondWithRpcPromise('EventManager',_0x7e65('0x9f'),{'event':'notify','message':_0x37782c},client9002);return _0x37782c;})[_0x7e65('0x21')](respondWithResult(_0x30f0e5,null))[_0x7e65('0x29')](handleError(_0x30f0e5,null));};exports['addApplications']=function(_0x29ceb8,_0x48d646){var _0xdde277=_0x29ceb8[_0x7e65('0x55')]['id'];var _0xc10548=_0x29ceb8[_0x7e65('0x5f')];var _0x47996f=0xc8;var _0x3e5892=null;return db[_0x7e65('0xa0')][_0x7e65('0xa1')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x7e65('0xa2')]},function(_0x4859a2){return db[_0x7e65('0x3c')]['findOne']({'where':{'id':_0xdde277},'transaction':_0x4859a2})[_0x7e65('0x21')](function(_0x5723b1){if(_0x5723b1){return db[_0x7e65('0x80')]['destroy']({'where':{'OpenchannelAccountId':_0xdde277},'transaction':_0x4859a2})[_0x7e65('0x21')](function(){var _0x275430=_[_0x7e65('0x41')](_0xc10548,function(_0x1115b9){_0x1115b9[_0x7e65('0x67')]=_0xdde277;return _0x1115b9;});return db['OpenchannelApplication']['bulkCreate'](_0x275430,{'transaction':_0x4859a2});});}else{_0x47996f=0x194;_0x3e5892=[];}});})['then'](function(){if(_0x47996f!==0x194){return db[_0x7e65('0x80')][_0x7e65('0xa3')]({'where':{'OpenchannelAccountId':_0xdde277},'order':_0x7e65('0x86')})[_0x7e65('0x21')](function(_0x4238d4){_0x3e5892=_0x4238d4;});}})[_0x7e65('0x29')](function(_0x390442){_0x47996f=0x1f4;logger['error'](_0x390442[_0x7e65('0x37')]);if(_0x390442['name']){delete _0x390442[_0x7e65('0x38')];}_0x3e5892=_0x390442;})['finally'](function(){if(_0x3e5892===null){_0x48d646[_0x7e65('0x2a')](_0x47996f);}else{if(_0x47996f===0x1f4){_0x48d646[_0x7e65('0x2b')](_0x47996f)[_0x7e65('0xa4')](_0x3e5892);}else{_0x48d646['status'](_0x47996f)[_0x7e65('0x2d')](_0x3e5892);}}});};exports[_0x7e65('0xa5')]=function(_0x1ef9cf,_0xd5d9e0,_0x2f7821){var _0x25c98d={};var _0x42b962={};var _0x5def81;var _0x5da623;return db[_0x7e65('0x3c')][_0x7e65('0x65')]({'where':{'id':_0x1ef9cf['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0xd5d9e0,null))['then'](function(_0x4c05e7){if(_0x4c05e7){_0x5def81=_0x4c05e7;_0x42b962['model']=_[_0x7e65('0x42')](db['OpenchannelApplication']['rawAttributes']);_0x42b962['query']=_[_0x7e65('0x42')](_0x1ef9cf[_0x7e65('0x43')]);_0x42b962[_0x7e65('0x44')]=_[_0x7e65('0x45')](_0x42b962['model'],_0x42b962['query']);_0x25c98d[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x42b962[_0x7e65('0x40')],qs[_0x7e65('0x47')](_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x47')]));_0x25c98d[_0x7e65('0x46')]=_0x25c98d[_0x7e65('0x46')][_0x7e65('0x48')]?_0x25c98d[_0x7e65('0x46')]:_0x42b962['model'];_0x25c98d[_0x7e65('0x4b')]=qs[_0x7e65('0x4c')](_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x4c')]);_0x25c98d[_0x7e65('0x4e')]=qs[_0x7e65('0x44')](_[_0x7e65('0x66')](_0x1ef9cf[_0x7e65('0x43')],_0x42b962[_0x7e65('0x44')]));if(_0x1ef9cf['query'][_0x7e65('0x4d')]){_0x25c98d[_0x7e65('0x4e')]=_[_0x7e65('0x4f')](_0x25c98d['where'],{'$or':_[_0x7e65('0x41')](_0x25c98d[_0x7e65('0x46')],function(_0x2b2464){var _0xc0814e={};_0xc0814e[_0x2b2464]={'$like':'%'+_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x4d')]+'%'};return _0xc0814e;})});}_0x25c98d=_[_0x7e65('0x4f')]({},_0x25c98d,_0x1ef9cf[_0x7e65('0x56')]);return _0x5def81['getApplications'](_0x25c98d);}})['then'](function(_0x3a33cb){if(_0x3a33cb){_0x5da623=_0x3a33cb['length'];if(!_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x49')]('nolimit')){_0x25c98d[_0x7e65('0x2f')]=qs['limit'](_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x2f')]);_0x25c98d[_0x7e65('0x2e')]=qs[_0x7e65('0x2e')](_0x1ef9cf[_0x7e65('0x43')][_0x7e65('0x2e')]);}return _0x5def81[_0x7e65('0xa5')](_0x25c98d);}})[_0x7e65('0x21')](function(_0x3376d3){if(_0x3376d3){return _0x3376d3?{'count':_0x5da623,'rows':_0x3376d3}:null;}})[_0x7e65('0x21')](respondWithResult(_0xd5d9e0,null))[_0x7e65('0x29')](handleError(_0xd5d9e0,null));};exports['getInteractions']=function(_0x3eb27f,_0x5b3eed,_0x377fcc){var _0x4761d1={'raw':![],'where':{}};var _0x479700={};var _0x12a969={'count':0x0,'rows':[]};return db[_0x7e65('0x3c')]['findOne']({'where':{'id':_0x3eb27f[_0x7e65('0x55')]['id']}})['then'](handleEntityNotFound(_0x5b3eed,null))[_0x7e65('0x21')](function(_0x543318){if(_0x543318){_0x479700[_0x7e65('0x40')]=_[_0x7e65('0x42')](db[_0x7e65('0x89')][_0x7e65('0x3d')]);_0x479700[_0x7e65('0x43')]=_['keys'](_0x3eb27f[_0x7e65('0x43')]);_0x479700[_0x7e65('0x44')]=_[_0x7e65('0x45')](_0x479700[_0x7e65('0x40')],_0x479700[_0x7e65('0x43')]);_0x4761d1[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x479700[_0x7e65('0x40')],qs[_0x7e65('0x47')](_0x3eb27f[_0x7e65('0x43')]['fields']));_0x4761d1['attributes']=_0x4761d1[_0x7e65('0x46')]['length']?_0x4761d1['attributes']:_0x479700[_0x7e65('0x40')];if(!_0x3eb27f[_0x7e65('0x43')][_0x7e65('0x49')](_0x7e65('0x4a'))){_0x4761d1[_0x7e65('0x2f')]=qs[_0x7e65('0x2f')](_0x3eb27f['query'][_0x7e65('0x2f')]);_0x4761d1[_0x7e65('0x2e')]=qs['offset'](_0x3eb27f['query'][_0x7e65('0x2e')]);}_0x4761d1[_0x7e65('0x4b')]=qs[_0x7e65('0x4c')](_0x3eb27f['query']['sort']);_0x4761d1[_0x7e65('0x4e')]=qs[_0x7e65('0x44')](_[_0x7e65('0x66')](_0x3eb27f[_0x7e65('0x43')],_0x479700[_0x7e65('0x44')]));_0x4761d1[_0x7e65('0x4e')]['OpenchannelAccountId']=_0x543318['id'];if(_0x3eb27f[_0x7e65('0x43')]['filter']){_0x4761d1['where']=_[_0x7e65('0x4f')](_0x4761d1[_0x7e65('0x4e')],{'$or':_[_0x7e65('0x41')](_0x4761d1[_0x7e65('0x46')],function(_0x352ff1){var _0x383d2d={};_0x383d2d[_0x352ff1]={'$like':'%'+_0x3eb27f[_0x7e65('0x43')][_0x7e65('0x4d')]+'%'};return _0x383d2d;})});}_0x4761d1=_[_0x7e65('0x4f')]({},_0x4761d1,_0x3eb27f[_0x7e65('0x56')]);return db[_0x7e65('0x89')][_0x7e65('0x51')]({'where':_0x4761d1[_0x7e65('0x4e')]})[_0x7e65('0x21')](function(_0x3bcb75){_0x12a969[_0x7e65('0x51')]=_0x3bcb75;if(_0x3eb27f[_0x7e65('0x43')][_0x7e65('0x68')]){_0x4761d1[_0x7e65('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x7e65('0x98')],'as':_0x7e65('0xa6'),'attributes':[_0x7e65('0x38'),'fullname',_0x7e65('0xa7')],'required':![]},{'model':db[_0x7e65('0xa8')],'as':_0x7e65('0xa9'),'attributes':['id',_0x7e65('0x38'),_0x7e65('0xaa')],'where':_0x3eb27f['query']['tag']?{'id':_0x3eb27f['query'][_0x7e65('0xab')]}:undefined,'required':_0x3eb27f[_0x7e65('0x43')][_0x7e65('0xab')]?!![]:![]}];}return db[_0x7e65('0x89')][_0x7e65('0x53')](_0x4761d1);})[_0x7e65('0x21')](function(_0x27061d){_0x12a969['rows']=_0x27061d;return _0x12a969;});}})['then'](respondWithFilteredResult(_0x5b3eed,_0x4761d1))[_0x7e65('0x29')](handleError(_0x5b3eed,null));};exports[_0x7e65('0xac')]=function(_0xbe32f,_0x26a221,_0x46b9b0){return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0xbe32f[_0x7e65('0x55')]['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x26a221,null))['then'](function(_0x4f4ea0){if(_0x4f4ea0){return _0x4f4ea0[_0x7e65('0xac')](_0xbe32f[_0x7e65('0x5f')]['ids'],_[_0x7e65('0xad')](_0xbe32f[_0x7e65('0x5f')],['ids','id'])||{})[_0x7e65('0x8b')](function(_0xbb2b27){for(var _0x2ccfd5=0x0;_0x2ccfd5<_0xbe32f['body'][_0x7e65('0x6b')][_0x7e65('0x48')];_0x2ccfd5+=0x1){socket[_0x7e65('0xae')]('userOpenchannelAccount:save',{'UserId':Number(_0xbe32f[_0x7e65('0x5f')]['ids'][_0x2ccfd5]),'OpenchannelAccountId':Number(_0xbe32f[_0x7e65('0x55')]['id'])});}return _0xbb2b27;});}})[_0x7e65('0x21')](respondWithResult(_0x26a221,null))['catch'](handleError(_0x26a221,null));};exports[_0x7e65('0xaf')]=function(_0x3643a2,_0x891b4c,_0x1590a9){return db[_0x7e65('0x3c')][_0x7e65('0x57')]({'where':{'id':_0x3643a2['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x891b4c,null))[_0x7e65('0x21')](function(_0x274fb9){if(_0x274fb9){return _0x274fb9[_0x7e65('0xaf')](_0x3643a2[_0x7e65('0x43')][_0x7e65('0x6b')])[_0x7e65('0x21')](function(){if(_[_0x7e65('0xb0')](_0x3643a2['query']['ids'])){for(var _0x536792=0x0;_0x536792<_0x3643a2[_0x7e65('0x43')]['ids'][_0x7e65('0x48')];_0x536792+=0x1){socket['emit'](_0x7e65('0xb1'),{'UserId':Number(_0x3643a2[_0x7e65('0x43')][_0x7e65('0x6b')][_0x536792]),'OpenchannelAccountId':Number(_0x3643a2['params']['id'])});}}else{socket[_0x7e65('0xae')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3643a2[_0x7e65('0x43')]['ids']),'OpenchannelAccountId':Number(_0x3643a2[_0x7e65('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x891b4c,null))[_0x7e65('0x29')](handleError(_0x891b4c,null));};exports['getAgents']=function(_0x94bf93,_0x189649,_0x221efc){var _0x151f1f={};var _0x1cb3fd={};var _0x5e6e50;var _0x575ad4;return db[_0x7e65('0x3c')][_0x7e65('0x65')]({'where':{'id':_0x94bf93[_0x7e65('0x55')]['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x189649,null))[_0x7e65('0x21')](function(_0x19dc40){if(_0x19dc40){_0x5e6e50=_0x19dc40;_0x1cb3fd[_0x7e65('0x40')]=_[_0x7e65('0x42')](db[_0x7e65('0x98')]['rawAttributes']);_0x1cb3fd[_0x7e65('0x43')]=_[_0x7e65('0x42')](_0x94bf93[_0x7e65('0x43')]);_0x1cb3fd[_0x7e65('0x44')]=_['intersection'](_0x1cb3fd[_0x7e65('0x40')],_0x1cb3fd['query']);_0x151f1f[_0x7e65('0x46')]=_[_0x7e65('0x45')](_0x1cb3fd['model'],qs[_0x7e65('0x47')](_0x94bf93[_0x7e65('0x43')][_0x7e65('0x47')]));_0x151f1f[_0x7e65('0x46')]=_0x151f1f['attributes'][_0x7e65('0x48')]?_0x151f1f[_0x7e65('0x46')]:_0x1cb3fd[_0x7e65('0x40')];_0x151f1f[_0x7e65('0x4b')]=qs['sort'](_0x94bf93[_0x7e65('0x43')][_0x7e65('0x4c')]);_0x151f1f[_0x7e65('0x4e')]=qs[_0x7e65('0x44')](_[_0x7e65('0x66')](_0x94bf93[_0x7e65('0x43')],_0x1cb3fd['filters']));if(_0x94bf93['query'][_0x7e65('0x4d')]){_0x151f1f[_0x7e65('0x4e')]=_[_0x7e65('0x4f')](_0x151f1f[_0x7e65('0x4e')],{'$or':_[_0x7e65('0x41')](_0x151f1f[_0x7e65('0x46')],function(_0x26a2f0){var _0x2d85ad={};_0x2d85ad[_0x26a2f0]={'$like':'%'+_0x94bf93['query'][_0x7e65('0x4d')]+'%'};return _0x2d85ad;})});}_0x151f1f=_[_0x7e65('0x4f')]({},_0x151f1f,_0x94bf93[_0x7e65('0x56')]);return _0x5e6e50['getAgents'](_0x151f1f);}})[_0x7e65('0x21')](function(_0x264b6d){if(_0x264b6d){_0x575ad4=_0x264b6d['length'];if(!_0x94bf93[_0x7e65('0x43')]['hasOwnProperty'](_0x7e65('0x4a'))){_0x151f1f[_0x7e65('0x2f')]=qs[_0x7e65('0x2f')](_0x94bf93[_0x7e65('0x43')]['limit']);_0x151f1f[_0x7e65('0x2e')]=qs[_0x7e65('0x2e')](_0x94bf93['query'][_0x7e65('0x2e')]);}return _0x5e6e50[_0x7e65('0xb2')](_0x151f1f);}})['then'](function(_0x2397c0){if(_0x2397c0){return _0x2397c0?{'count':_0x575ad4,'rows':_0x2397c0}:null;}})[_0x7e65('0x21')](respondWithResult(_0x189649,null))[_0x7e65('0x29')](handleError(_0x189649,null));};exports[_0x7e65('0xa4')]=function(_0x518aed,_0x4f8efe,_0x26128a){var _0x2dd635,_0x5c0a2d,_0x334198;if(_['isNil'](_0x518aed[_0x7e65('0x5f')][_0x7e65('0x5f')])||_0x518aed['body'][_0x7e65('0x5f')]===''){throw new db[(_0x7e65('0x71'))][(_0x7e65('0x72'))](_0x7e65('0xb3'));}if(_[_0x7e65('0x7a')](_0x518aed[_0x7e65('0x5f')]['to'])){}_0x2dd635=_0x518aed[_0x7e65('0x5f')]['to'];return db['OpenchannelAccount'][_0x7e65('0x65')]({'where':{'id':_0x518aed['params']['id']}})[_0x7e65('0x21')](handleEntityNotFound(_0x4f8efe,null))[_0x7e65('0x21')](function(_0x33ea5b){if(_0x33ea5b){return db['OpenchannelAccount'][_0x7e65('0x57')]({'where':{'id':_0x33ea5b['id']},'include':[{'model':db[_0x7e65('0x7e')],'as':_0x7e65('0x82'),'include':[{'model':db[_0x7e65('0x70')],'as':_0x7e65('0x7f'),'where':{[_0x33ea5b[_0x7e65('0x7b')]]:_0x2dd635},'limit':0x1,'order':[[_0x7e65('0x75'),_0x7e65('0xb4')]]}]}]})[_0x7e65('0x21')](handleEntityNotFound(_0x4f8efe,null))['then'](function(_0x492c80){if(_0x492c80&&_0x492c80[_0x7e65('0x82')]){_0x5c0a2d=_0x492c80[_0x7e65('0x33')]({'plain':!![]});if(_0x5c0a2d['List']&&_0x5c0a2d[_0x7e65('0x82')][_0x7e65('0x7f')][_0x7e65('0x48')]){return _0x5c0a2d[_0x7e65('0x82')][_0x7e65('0x7f')][0x0];}return db[_0x7e65('0x70')][_0x7e65('0x63')](_[_0x7e65('0x1c')](_0x518aed[_0x7e65('0x5f')],{'firstName':_0x2dd635,[_0x492c80[_0x7e65('0x7b')]]:_0x2dd635,'phone':_0x2dd635,'ListId':_0x5c0a2d['ListId']}));}})[_0x7e65('0x21')](handleEntityNotFound(_0x4f8efe,null))[_0x7e65('0x21')](function(_0x1fb28b){if(_0x1fb28b){_0x334198=_0x1fb28b;return db['OpenchannelInteraction'][_0x7e65('0x57')]({'where':{'ContactId':_0x334198['id'],'closed':![],'OpenchannelAccountId':_0x5c0a2d['id']}})['then'](function(_0x10c7ac){if(_0x10c7ac){return[_0x10c7ac,![]];}return db[_0x7e65('0x89')]['create']({'UserId':_0x518aed[_0x7e65('0x58')]['id'],'ContactId':_0x334198['id'],'OpenchannelAccountId':_0x5c0a2d['id'],'lastMsgDirection':_0x7e65('0xb5'),'Messages':[_[_0x7e65('0x4f')](_0x518aed[_0x7e65('0x5f')],{'read':![],'body':_0x518aed['body'][_0x7e65('0x5f')],'OpenchannelAccountId':_0x5c0a2d['id'],'UserId':_0x518aed[_0x7e65('0x58')]['id'],'ContactId':_0x334198['id']})]},{'include':[{'model':db[_0x7e65('0xb6')],'as':_0x7e65('0xb7')}]})['then'](function(_0x45c773){return[_0x45c773,!![]];});});}})[_0x7e65('0x8b')](function(_0xb10cc3,_0x6c5786){if(_0x6c5786){return _0xb10cc3;}return db[_0x7e65('0xb6')][_0x7e65('0x63')](_[_0x7e65('0x4f')](_0x518aed[_0x7e65('0x5f')],{'read':![],'body':_0x518aed[_0x7e65('0x5f')]['body'],'OpenchannelAccountId':_0x5c0a2d['id'],'OpenchannelInteractionId':_0xb10cc3['id'],'UserId':_0x518aed[_0x7e65('0x58')]['id'],'ContactId':_0x334198['id']}))[_0x7e65('0x21')](function(_0x3747e7){_0xb10cc3[_0x7e65('0xb8')][_0x7e65('0xb7')]=[];_0xb10cc3['dataValues'][_0x7e65('0xb7')][_0x7e65('0x92')](_0x3747e7[_0x7e65('0xb8')]);return _0xb10cc3;});});}})[_0x7e65('0x21')](respondWithResult(_0x4f8efe,null))['catch'](handleError(_0x4f8efe,null));}; \ No newline at end of file +var _0x163c=['mandatoryDispositionPause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','findAll','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','defaults','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','sendStatus','send','getApplications','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','get','OpenchannelAccounts','destroy','name','index','Pause','map','OpenchannelAccount','fieldName','model','query','keys','filters','intersection','fields','length','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params'];(function(_0x6ba4de,_0x3cb045){var _0x27d232=function(_0x5daeb9){while(--_0x5daeb9){_0x6ba4de['push'](_0x6ba4de['shift']());}};_0x27d232(++_0x3cb045);}(_0x163c,0x1ea));var _0xc163=function(_0x3d0965,_0x1916ae){_0x3d0965=_0x3d0965-0x0;var _0x36c787=_0x163c[_0x3d0965];return _0x36c787;};'use strict';var emlformat=require(_0xc163('0x0'));var rimraf=require(_0xc163('0x1'));var zipdir=require(_0xc163('0x2'));var jsonpatch=require(_0xc163('0x3'));var rp=require('request-promise');var moment=require(_0xc163('0x4'));var BPromise=require(_0xc163('0x5'));var Mustache=require(_0xc163('0x6'));var util=require(_0xc163('0x7'));var path=require(_0xc163('0x8'));var sox=require(_0xc163('0x9'));var csv=require(_0xc163('0xa'));var ejs=require(_0xc163('0xb'));var fs=require('fs');var fs_extra=require(_0xc163('0xc'));var _=require('lodash');var squel=require(_0xc163('0xd'));var crypto=require(_0xc163('0xe'));var jsforce=require(_0xc163('0xf'));var deskjs=require(_0xc163('0x10'));var toCsv=require(_0xc163('0xa'));var querystring=require(_0xc163('0x11'));var Papa=require(_0xc163('0x12'));var Redis=require(_0xc163('0x13'));var authService=require(_0xc163('0x14'));var qs=require(_0xc163('0x15'));var as=require(_0xc163('0x16'));var hardwareService=require(_0xc163('0x17'));var logger=require('../../config/logger')(_0xc163('0x18'));var utils=require('../../config/utils');var config=require(_0xc163('0x19'));var licenseUtil=require(_0xc163('0x1a'));var db=require(_0xc163('0x1b'))['db'];config[_0xc163('0x1c')]=_['defaults'](config[_0xc163('0x1c')],{'host':_0xc163('0x1d'),'port':0x18eb});var socket=require(_0xc163('0x1e'))(new Redis(config[_0xc163('0x1c')]));require(_0xc163('0x1f'))['register'](socket);var jayson=require(_0xc163('0x20'));var client=jayson[_0xc163('0x21')][_0xc163('0x22')]({'port':0x232c});var client9002=jayson[_0xc163('0x21')][_0xc163('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xb78465,_0x34b0d7,_0x2e98bb,_0x5f30e0){return new BPromise(function(_0x7a4915,_0x3749c9){var _0x1de3de=_0x5f30e0||client;return _0x1de3de[_0xc163('0x23')](_0xb78465,_0x2e98bb)['then'](function(_0x5075a7){logger[_0xc163('0x24')](_0xc163('0x25'),_0x34b0d7,_0xc163('0x26'));logger[_0xc163('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x34b0d7,_0xc163('0x26'),JSON[_0xc163('0x28')](_0x5075a7));if(_0x5075a7['error']){if(_0x5075a7[_0xc163('0x29')][_0xc163('0x2a')]===0x1f4){logger[_0xc163('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x34b0d7,_0x5075a7[_0xc163('0x29')][_0xc163('0x2b')]);return _0x3749c9(_0x5075a7[_0xc163('0x29')][_0xc163('0x2b')]);}logger['error'](_0xc163('0x25'),_0x34b0d7,_0x5075a7[_0xc163('0x29')]['message']);return _0x7a4915(_0x5075a7['error'][_0xc163('0x2b')]);}else{logger['info'](_0xc163('0x25'),_0x34b0d7,_0xc163('0x26'));_0x7a4915(_0x5075a7[_0xc163('0x2c')]['message']);}})['catch'](function(_0xd07b84){logger['error'](_0xc163('0x25'),_0x34b0d7,_0xd07b84);_0x3749c9(_0xd07b84);});});}function respondWithStatusCode(_0x5829b3,_0x122ff7){_0x122ff7=_0x122ff7||0xcc;return function(_0x384eec){if(_0x384eec){return _0x5829b3['sendStatus'](_0x122ff7);}return _0x5829b3['status'](_0x122ff7)[_0xc163('0x2d')]();};}function respondWithResult(_0x9f181d,_0x21f6f2){_0x21f6f2=_0x21f6f2||0xc8;return function(_0x27a30f){if(_0x27a30f){return _0x9f181d['status'](_0x21f6f2)[_0xc163('0x2e')](_0x27a30f);}};}function respondWithFilteredResult(_0x3baba5,_0x492bfc){return function(_0x271302){if(_0x271302){var _0x22ac16=typeof _0x492bfc[_0xc163('0x2f')]===_0xc163('0x30')&&typeof _0x492bfc[_0xc163('0x31')]===_0xc163('0x30');var _0x4958df=_0x271302['count'];var _0x1a3921=_0x22ac16?0x0:_0x492bfc['offset'];var _0x4cdafe=_0x22ac16?_0x271302[_0xc163('0x32')]:_0x492bfc[_0xc163('0x2f')]+_0x492bfc[_0xc163('0x31')];var _0x198ba7;if(_0x4cdafe>=_0x4958df){_0x4cdafe=_0x4958df;_0x198ba7=0xc8;}else{_0x198ba7=0xce;}_0x3baba5[_0xc163('0x33')](_0x198ba7);return _0x3baba5[_0xc163('0x34')](_0xc163('0x35'),_0x1a3921+'-'+_0x4cdafe+'/'+_0x4958df)[_0xc163('0x2e')](_0x271302);}return null;};}function patchUpdates(_0x472d3c){return function(_0x3c5a99){try{jsonpatch[_0xc163('0x36')](_0x3c5a99,_0x472d3c,!![]);}catch(_0x5b2da5){return BPromise[_0xc163('0x37')](_0x5b2da5);}return _0x3c5a99['save']();};}function saveUpdates(_0x2e3642,_0x35c035){return function(_0x407712){if(_0x407712){return _0x407712[_0xc163('0x38')](_0x2e3642)[_0xc163('0x39')](function(_0x388dc8){return _0x388dc8;});}return null;};}function removeEntity(_0x32fd4d,_0xf8dc90){return function(_0x5541b0){if(_0x5541b0){return _0x5541b0['destroy']()[_0xc163('0x39')](function(){var _0x48ec7c=_0x5541b0[_0xc163('0x3a')]({'plain':!![]});var _0x19f4b4=_0xc163('0x3b');return db['UserProfileResource'][_0xc163('0x3c')]({'where':{'type':_0x19f4b4,'resourceId':_0x48ec7c['id']}})['then'](function(){return _0x5541b0;});})[_0xc163('0x39')](function(){_0x32fd4d[_0xc163('0x33')](0xcc)[_0xc163('0x2d')]();});}};}function handleEntityNotFound(_0x381856,_0x466d0c){return function(_0x207987){if(!_0x207987){_0x381856['sendStatus'](0x194);}return _0x207987;};}function handleError(_0x37be1e,_0x4466c7){_0x4466c7=_0x4466c7||0x1f4;return function(_0x1874b8){logger[_0xc163('0x29')](_0x1874b8['stack']);if(_0x1874b8[_0xc163('0x3d')]){delete _0x1874b8[_0xc163('0x3d')];}_0x37be1e['status'](_0x4466c7)['send'](_0x1874b8);};}exports[_0xc163('0x3e')]=function(_0x1f3044,_0x27c555){var _0x39b391={'include':[{'model':db[_0xc163('0x3f')],'as':'mandatoryDispositionPause'}]},_0x10377b={},_0x4247df={'count':0x0,'rows':[]};var _0x188b33=_[_0xc163('0x40')](db[_0xc163('0x41')]['rawAttributes'],function(_0x49709d){return{'name':_0x49709d[_0xc163('0x42')],'type':_0x49709d['type']['key']};});_0x10377b[_0xc163('0x43')]=_[_0xc163('0x40')](_0x188b33,_0xc163('0x3d'));_0x10377b[_0xc163('0x44')]=_[_0xc163('0x45')](_0x1f3044[_0xc163('0x44')]);_0x10377b[_0xc163('0x46')]=_[_0xc163('0x47')](_0x10377b[_0xc163('0x43')],_0x10377b['query']);_0x39b391['attributes']=_['intersection'](_0x10377b['model'],qs[_0xc163('0x48')](_0x1f3044[_0xc163('0x44')]['fields']));_0x39b391['attributes']=_0x39b391['attributes'][_0xc163('0x49')]?_0x39b391[_0xc163('0x4a')]:_0x10377b[_0xc163('0x43')];if(!_0x1f3044[_0xc163('0x44')]['hasOwnProperty']('nolimit')){_0x39b391[_0xc163('0x31')]=qs[_0xc163('0x31')](_0x1f3044['query'][_0xc163('0x31')]);_0x39b391[_0xc163('0x2f')]=qs[_0xc163('0x2f')](_0x1f3044[_0xc163('0x44')][_0xc163('0x2f')]);}_0x39b391[_0xc163('0x4b')]=qs[_0xc163('0x4c')](_0x1f3044[_0xc163('0x44')][_0xc163('0x4c')]);_0x39b391[_0xc163('0x4d')]=qs['filters'](_[_0xc163('0x4e')](_0x1f3044['query'],_0x10377b[_0xc163('0x46')]),_0x188b33);if(_0x1f3044[_0xc163('0x44')][_0xc163('0x4f')]){_0x39b391[_0xc163('0x4d')]=_[_0xc163('0x50')](_0x39b391[_0xc163('0x4d')],{'$or':_[_0xc163('0x40')](_0x188b33,function(_0x2f7eb2){if(_0x2f7eb2[_0xc163('0x51')]!==_0xc163('0x52')){var _0x3a8002={};_0x3a8002[_0x2f7eb2[_0xc163('0x3d')]]={'$like':'%'+_0x1f3044[_0xc163('0x44')][_0xc163('0x4f')]+'%'};return _0x3a8002;}})});}_0x39b391=_['merge']({},_0x39b391,_0x1f3044[_0xc163('0x53')]);var _0x146627={'where':_0x39b391[_0xc163('0x4d')]};return db[_0xc163('0x41')][_0xc163('0x32')](_0x146627)['then'](function(_0x1d6526){_0x4247df[_0xc163('0x32')]=_0x1d6526;if(_0x1f3044['query'][_0xc163('0x54')]){_0x39b391[_0xc163('0x55')]=[{'all':!![]}];}return db[_0xc163('0x41')]['findAll'](_0x39b391);})[_0xc163('0x39')](function(_0x22ccc6){_0x4247df[_0xc163('0x56')]=_0x22ccc6;return _0x4247df;})['then'](respondWithFilteredResult(_0x27c555,_0x39b391))[_0xc163('0x57')](handleError(_0x27c555,null));};exports['show']=function(_0x3bcff7,_0x5c93d2){var _0x33d6f9={'raw':![],'where':{'id':_0x3bcff7[_0xc163('0x58')]['id']},'include':[{'model':db[_0xc163('0x3f')],'as':_0xc163('0x59')}]},_0x523eb9={};_0x523eb9[_0xc163('0x43')]=_[_0xc163('0x45')](db[_0xc163('0x41')][_0xc163('0x5a')]);_0x523eb9[_0xc163('0x44')]=_['keys'](_0x3bcff7[_0xc163('0x44')]);_0x523eb9['filters']=_[_0xc163('0x47')](_0x523eb9['model'],_0x523eb9[_0xc163('0x44')]);_0x33d6f9[_0xc163('0x4a')]=_[_0xc163('0x47')](_0x523eb9[_0xc163('0x43')],qs['fields'](_0x3bcff7[_0xc163('0x44')][_0xc163('0x48')]));_0x33d6f9[_0xc163('0x4a')]=_0x33d6f9['attributes'][_0xc163('0x49')]?_0x33d6f9['attributes']:_0x523eb9[_0xc163('0x43')];if(_0x3bcff7[_0xc163('0x44')][_0xc163('0x54')]){_0x33d6f9[_0xc163('0x55')]=[{'all':!![]}];}_0x33d6f9=_[_0xc163('0x50')]({},_0x33d6f9,_0x3bcff7[_0xc163('0x53')]);return db[_0xc163('0x41')][_0xc163('0x5b')](_0x33d6f9)[_0xc163('0x39')](handleEntityNotFound(_0x5c93d2,null))[_0xc163('0x39')](respondWithResult(_0x5c93d2,null))[_0xc163('0x57')](handleError(_0x5c93d2,null));};exports[_0xc163('0x5c')]=function(_0x5f37ee,_0x154c81){return db[_0xc163('0x41')][_0xc163('0x5c')](_0x5f37ee[_0xc163('0x5d')],{})[_0xc163('0x39')](function(_0x1d346a){var _0x1a88a2=_0x5f37ee[_0xc163('0x5e')][_0xc163('0x3a')]({'plain':!![]});if(!_0x1a88a2)throw new Error(_0xc163('0x5f'));if(_0x1a88a2['role']===_0xc163('0x5e')){var _0x26c013=_0x1d346a[_0xc163('0x3a')]({'plain':!![]});var _0x32884d=_0xc163('0x3b');return db[_0xc163('0x60')][_0xc163('0x5b')]({'where':{'name':_0x32884d,'userProfileId':_0x1a88a2[_0xc163('0x61')]},'raw':!![]})[_0xc163('0x39')](function(_0xb2a9c9){if(_0xb2a9c9&&_0xb2a9c9[_0xc163('0x62')]===0x0){return db['UserProfileResource'][_0xc163('0x5c')]({'name':_0x26c013[_0xc163('0x3d')],'resourceId':_0x26c013['id'],'type':_0xb2a9c9[_0xc163('0x3d')],'sectionId':_0xb2a9c9['id']},{})[_0xc163('0x39')](function(){return _0x1d346a;});}else{return _0x1d346a;}})[_0xc163('0x57')](function(_0x54ab0e){logger[_0xc163('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54ab0e);throw _0x54ab0e;});}return _0x1d346a;})['then'](respondWithResult(_0x154c81,0xc9))[_0xc163('0x57')](handleError(_0x154c81,null));};exports[_0xc163('0x38')]=function(_0x331e67,_0x376a8b){if(_0x331e67['body']['id']){delete _0x331e67[_0xc163('0x5d')]['id'];}return db[_0xc163('0x41')][_0xc163('0x5b')]({'where':{'id':_0x331e67[_0xc163('0x58')]['id']},'include':[{'model':db[_0xc163('0x3f')],'as':_0xc163('0x59')}]})['then'](handleEntityNotFound(_0x376a8b,null))[_0xc163('0x39')](saveUpdates(_0x331e67['body'],null))[_0xc163('0x39')](respondWithResult(_0x376a8b,null))[_0xc163('0x57')](handleError(_0x376a8b,null));};exports[_0xc163('0x3c')]=function(_0x5916d7,_0x296094){return db[_0xc163('0x41')]['find']({'where':{'id':_0x5916d7[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x296094,null))[_0xc163('0x39')](removeEntity(_0x296094,null))[_0xc163('0x57')](handleError(_0x296094,null));};exports[_0xc163('0x63')]=function(_0x3a99e5,_0xfa1a3c){return db[_0xc163('0x41')]['describe']()[_0xc163('0x39')](respondWithResult(_0xfa1a3c,null))[_0xc163('0x57')](handleError(_0xfa1a3c,null));};exports['addDisposition']=function(_0x5acff0,_0x1bff45,_0x4d4403){if(_0x5acff0['body']['id']){delete _0x5acff0[_0xc163('0x5d')]['id'];}return db['OpenchannelAccount'][_0xc163('0x5b')]({'where':{'id':_0x5acff0[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x1bff45,null))['then'](function(_0x3baf28){if(_0x3baf28){_0x5acff0[_0xc163('0x5d')][_0xc163('0x64')]=_0x3baf28['id'];return db[_0xc163('0x65')][_0xc163('0x5c')](_0x5acff0['body']);}})[_0xc163('0x39')](respondWithResult(_0x1bff45,null))[_0xc163('0x57')](handleError(_0x1bff45,null));};exports[_0xc163('0x66')]=function(_0x277d32,_0x49f78b,_0x50d374){var _0x21c016={'raw':![],'where':{}};var _0x1dfaa8={};var _0x57c203={'count':0x0,'rows':[]};return db[_0xc163('0x41')][_0xc163('0x67')]({'where':{'id':_0x277d32[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x49f78b,null))[_0xc163('0x39')](function(_0xbfcee){if(_0xbfcee){_0x1dfaa8[_0xc163('0x43')]=_[_0xc163('0x45')](db[_0xc163('0x65')][_0xc163('0x5a')]);_0x1dfaa8[_0xc163('0x44')]=_['keys'](_0x277d32[_0xc163('0x44')]);_0x1dfaa8[_0xc163('0x46')]=_[_0xc163('0x47')](_0x1dfaa8[_0xc163('0x43')],_0x1dfaa8[_0xc163('0x44')]);_0x21c016[_0xc163('0x4a')]=_[_0xc163('0x47')](_0x1dfaa8[_0xc163('0x43')],qs[_0xc163('0x48')](_0x277d32[_0xc163('0x44')][_0xc163('0x48')]));_0x21c016[_0xc163('0x4a')]=_0x21c016[_0xc163('0x4a')]['length']?_0x21c016[_0xc163('0x4a')]:_0x1dfaa8['model'];if(!_0x277d32['query'][_0xc163('0x68')](_0xc163('0x69'))){_0x21c016['limit']=qs[_0xc163('0x31')](_0x277d32['query']['limit']);_0x21c016['offset']=qs[_0xc163('0x2f')](_0x277d32[_0xc163('0x44')][_0xc163('0x2f')]);}_0x21c016['order']=qs['sort'](_0x277d32[_0xc163('0x44')][_0xc163('0x4c')]);_0x21c016[_0xc163('0x4d')]=qs[_0xc163('0x46')](_[_0xc163('0x4e')](_0x277d32[_0xc163('0x44')],_0x1dfaa8[_0xc163('0x46')]));_0x21c016[_0xc163('0x4d')][_0xc163('0x64')]=_0xbfcee['id'];if(_0x277d32[_0xc163('0x44')][_0xc163('0x4f')]){_0x21c016[_0xc163('0x4d')]=_[_0xc163('0x50')](_0x21c016[_0xc163('0x4d')],{'$or':_[_0xc163('0x40')](_0x21c016[_0xc163('0x4a')],function(_0x2b3eb5){var _0x70a1fb={};_0x70a1fb[_0x2b3eb5]={'$like':'%'+_0x277d32[_0xc163('0x44')][_0xc163('0x4f')]+'%'};return _0x70a1fb;})});}_0x21c016=_['merge']({},_0x21c016,_0x277d32['options']);return db['Disposition'][_0xc163('0x32')]({'where':_0x21c016[_0xc163('0x4d')]})[_0xc163('0x39')](function(_0x4ec898){_0x57c203[_0xc163('0x32')]=_0x4ec898;if(_0x277d32[_0xc163('0x44')]['includeAll']){_0x21c016[_0xc163('0x55')]=[{'all':!![]}];}return db[_0xc163('0x65')][_0xc163('0x6a')](_0x21c016);})[_0xc163('0x39')](function(_0x22d68c){_0x57c203['rows']=_0x22d68c;return _0x57c203;});}})[_0xc163('0x39')](respondWithFilteredResult(_0x49f78b,_0x21c016))['catch'](handleError(_0x49f78b,null));};exports['removeDispositions']=function(_0x247bcd,_0x29f1db,_0x25e10f){return db[_0xc163('0x41')]['find']({'where':{'id':_0x247bcd['params']['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x29f1db,null))[_0xc163('0x39')](function(_0x545d23){if(_0x545d23){return _0x545d23['removeDispositions'](_0x247bcd[_0xc163('0x44')][_0xc163('0x6b')]);}})['then'](respondWithStatusCode(_0x29f1db,null))[_0xc163('0x57')](handleError(_0x29f1db,null));};exports[_0xc163('0x6c')]=function(_0x1fa844,_0x509484,_0x29d610){if(_0x1fa844['body']['id']){delete _0x1fa844['body']['id'];}return db[_0xc163('0x41')]['find']({'where':{'id':_0x1fa844[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x509484,null))[_0xc163('0x39')](function(_0x43dc02){if(_0x43dc02){_0x1fa844[_0xc163('0x5d')]['OpenchannelAccountId']=_0x43dc02['id'];return db[_0xc163('0x6d')][_0xc163('0x5c')](_0x1fa844[_0xc163('0x5d')]);}})[_0xc163('0x39')](respondWithResult(_0x509484,null))[_0xc163('0x57')](handleError(_0x509484,null));};exports[_0xc163('0x6e')]=function(_0x4bf29e,_0x202a22,_0x14c1d6){var _0x4b5021={'raw':![],'where':{}};var _0xe235b5={};var _0x24d8bb={'count':0x0,'rows':[]};return db[_0xc163('0x41')]['findOne']({'where':{'id':_0x4bf29e[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x202a22,null))[_0xc163('0x39')](function(_0x36470c){if(_0x36470c){_0xe235b5[_0xc163('0x43')]=_['keys'](db[_0xc163('0x6d')]['rawAttributes']);_0xe235b5[_0xc163('0x44')]=_[_0xc163('0x45')](_0x4bf29e[_0xc163('0x44')]);_0xe235b5[_0xc163('0x46')]=_[_0xc163('0x47')](_0xe235b5['model'],_0xe235b5['query']);_0x4b5021[_0xc163('0x4a')]=_[_0xc163('0x47')](_0xe235b5[_0xc163('0x43')],qs[_0xc163('0x48')](_0x4bf29e[_0xc163('0x44')]['fields']));_0x4b5021[_0xc163('0x4a')]=_0x4b5021[_0xc163('0x4a')][_0xc163('0x49')]?_0x4b5021['attributes']:_0xe235b5[_0xc163('0x43')];if(!_0x4bf29e[_0xc163('0x44')]['hasOwnProperty'](_0xc163('0x69'))){_0x4b5021[_0xc163('0x31')]=qs['limit'](_0x4bf29e['query'][_0xc163('0x31')]);_0x4b5021[_0xc163('0x2f')]=qs[_0xc163('0x2f')](_0x4bf29e[_0xc163('0x44')][_0xc163('0x2f')]);}_0x4b5021['order']=qs[_0xc163('0x4c')](_0x4bf29e[_0xc163('0x44')]['sort']);_0x4b5021['where']=qs['filters'](_[_0xc163('0x4e')](_0x4bf29e[_0xc163('0x44')],_0xe235b5['filters']));_0x4b5021[_0xc163('0x4d')]['OpenchannelAccountId']=_0x36470c['id'];if(_0x4bf29e[_0xc163('0x44')][_0xc163('0x4f')]){_0x4b5021[_0xc163('0x4d')]=_[_0xc163('0x50')](_0x4b5021[_0xc163('0x4d')],{'$or':_[_0xc163('0x40')](_0x4b5021[_0xc163('0x4a')],function(_0x3e6817){var _0x1ed843={};_0x1ed843[_0x3e6817]={'$like':'%'+_0x4bf29e[_0xc163('0x44')][_0xc163('0x4f')]+'%'};return _0x1ed843;})});}_0x4b5021=_[_0xc163('0x50')]({},_0x4b5021,_0x4bf29e[_0xc163('0x53')]);return db[_0xc163('0x6d')][_0xc163('0x32')]({'where':_0x4b5021[_0xc163('0x4d')]})['then'](function(_0x191117){_0x24d8bb[_0xc163('0x32')]=_0x191117;if(_0x4bf29e[_0xc163('0x44')][_0xc163('0x54')]){_0x4b5021[_0xc163('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc163('0x6a')](_0x4b5021);})[_0xc163('0x39')](function(_0xb107c3){_0x24d8bb[_0xc163('0x56')]=_0xb107c3;return _0x24d8bb;});}})[_0xc163('0x39')](respondWithFilteredResult(_0x202a22,_0x4b5021))['catch'](handleError(_0x202a22,null));};exports[_0xc163('0x6f')]=function(_0x19bcd3,_0x1de9ac,_0x41321d){return db[_0xc163('0x41')]['find']({'where':{'id':_0x19bcd3[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x1de9ac,null))[_0xc163('0x39')](function(_0xb536d4){if(_0xb536d4){return _0xb536d4['removeAnswers'](_0x19bcd3[_0xc163('0x44')][_0xc163('0x6b')]);}})[_0xc163('0x39')](respondWithStatusCode(_0x1de9ac,null))['catch'](handleError(_0x1de9ac,null));};exports[_0xc163('0x70')]=function(_0x4f25c4,_0x32382d,_0x20b3ea){var _0x6320bd={'body':_0x4f25c4['body'],'channel':_0xc163('0x71')};var _0x505593=[];var _0xabe587=[];var _0x8f2169={};var _0x9b65d9=![];return db[_0xc163('0x72')][_0xc163('0x63')]()['then'](function(_0x168f2c){if(!_0x168f2c){throw new db[(_0xc163('0x73'))]['ValidationError'](_0xc163('0x74'));}_0x505593=_['difference'](_[_0xc163('0x45')](_0x168f2c),[_0xc163('0x75'),_0xc163('0x76')]);_0xabe587=_[_0xc163('0x77')](_[_0xc163('0x45')](_0x168f2c),[_0xc163('0x75'),_0xc163('0x76'),'CompanyId',_0xc163('0x78')]);if(_0x4f25c4['body']['id']){delete _0x4f25c4[_0xc163('0x5d')]['id'];}if(_[_0xc163('0x79')](_0x4f25c4[_0xc163('0x5d')][_0xc163('0x7a')])){throw new db[(_0xc163('0x73'))]['ValidationError'](_0xc163('0x7b'));}if(_[_0xc163('0x79')](_0x4f25c4[_0xc163('0x5d')][_0xc163('0x5d')])||_0x4f25c4[_0xc163('0x5d')][_0xc163('0x5d')]===''){throw new db[(_0xc163('0x73'))][(_0xc163('0x7c'))](_0xc163('0x7d'));}if(_[_0xc163('0x79')](_0x4f25c4['body'][_0xc163('0x7e')])){throw new db[(_0xc163('0x73'))][(_0xc163('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xabe587);}if(!_[_0xc163('0x7f')](_0xabe587,_0x4f25c4[_0xc163('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0xc163('0x7c'))](_0xc163('0x80')+_0xabe587);}_0x8f2169[_0x4f25c4[_0xc163('0x5d')]['mapKey']]=_0x4f25c4[_0xc163('0x5d')][_0xc163('0x7a')];})[_0xc163('0x39')](function(){return db['OpenchannelAccount'][_0xc163('0x5b')]({'where':{'id':_0x4f25c4[_0xc163('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xc163('0x81'),'include':[{'model':db[_0xc163('0x72')],'as':_0xc163('0x82'),'where':_0x8f2169,'limit':0x1,'order':[[_0xc163('0x76'),'DESC']]}]},{'model':db[_0xc163('0x83')],'as':_0xc163('0x84')}]});})[_0xc163('0x39')](handleEntityNotFound(_0x32382d,null))['then'](function(_0x466247){if(_0x466247&&_0x466247[_0xc163('0x81')]){_0x6320bd[_0xc163('0x85')]=_0x466247;_0x6320bd['applications']=_0x466247[_0xc163('0x84')];_0x6320bd[_0xc163('0x86')]=_0x466247['List'];_0x6320bd[_0xc163('0x87')]=_[_0xc163('0x88')](_0x6320bd['applications'],[_0xc163('0x89')],[_0xc163('0x8a')]);if(_0x6320bd[_0xc163('0x85')][_0xc163('0x84')]){delete _0x6320bd['account'][_0xc163('0x84')];}if(_0x6320bd['account'][_0xc163('0x81')]&&_0x6320bd[_0xc163('0x85')][_0xc163('0x81')][_0xc163('0x82')][_0xc163('0x49')]){return _0x6320bd[_0xc163('0x85')]['List'][_0xc163('0x82')][0x0];}var _0x9a215f=_[_0xc163('0x8b')](_0x4f25c4['body'],{'firstName':_0x4f25c4[_0xc163('0x5d')][_0xc163('0x7a')],'ListId':_0x466247['ListId']});_0x9a215f[_0x4f25c4[_0xc163('0x5d')][_0xc163('0x7e')]]=_0x4f25c4[_0xc163('0x5d')][_0xc163('0x7a')];return db[_0xc163('0x72')][_0xc163('0x5c')](_0x9a215f,{'fields':_0x505593,'raw':!![]});}})[_0xc163('0x39')](handleEntityNotFound(_0x32382d,null))[_0xc163('0x39')](function(_0x1722e0){_0x6320bd['contact']=_0x1722e0;if(_0x1722e0){var _0x2233d0={'ContactId':_0x1722e0['id'],'OpenchannelAccountId':_0x4f25c4['params']['id'],'from':(_0x1722e0[_0xc163('0x8c')]||'')+'\x20'+(_0x1722e0[_0xc163('0x8d')]||'')};var _0x52cee0={'OpenchannelAccountId':_0x4f25c4[_0xc163('0x58')]['id'],'closed':![]};if(_0x4f25c4[_0xc163('0x5d')][_0xc163('0x8e')]){_0x52cee0[_0xc163('0x8e')]=_0x4f25c4[_0xc163('0x5d')][_0xc163('0x8e')];return db[_0xc163('0x8f')][_0xc163('0x5b')]({'where':_0x52cee0})[_0xc163('0x39')](function(_0x526d70){if(_0x526d70){return[_0x526d70,![]];}_0x2233d0[_0xc163('0x8e')]=_0x4f25c4[_0xc163('0x5d')][_0xc163('0x8e')];_0x2233d0['externalUrl']=_0x4f25c4[_0xc163('0x5d')][_0xc163('0x90')];return db[_0xc163('0x8f')]['create'](_0x2233d0)[_0xc163('0x39')](function(_0x336813){return[_0x336813,!![]];});});}else{_0x52cee0[_0xc163('0x8e')]=null;}_0x52cee0['ContactId']=_0x1722e0['id'];return db['OpenchannelInteraction'][_0xc163('0x5b')]({'where':_0x52cee0})[_0xc163('0x39')](function(_0x17e1c5){if(_0x17e1c5){return[_0x17e1c5,![]];}return db[_0xc163('0x8f')][_0xc163('0x5c')](_0x2233d0)[_0xc163('0x39')](function(_0x428b75){return[_0x428b75,!![]];});});}})[_0xc163('0x91')](function(_0xef106,_0x46c53d){if(_0xef106){_0x9b65d9=_0x46c53d;if(!_0x46c53d){var _0x3a6027={'from':(_0x6320bd[_0xc163('0x92')][_0xc163('0x8c')]||'')+'\x20'+(_0x6320bd[_0xc163('0x92')]['lastName']||'')};if(_0x4f25c4['body'][_0xc163('0x8e')]&&_0x4f25c4[_0xc163('0x5d')][_0xc163('0x93')]&&_0x4f25c4['body'][_0xc163('0x8e')]!=_0x4f25c4['body'][_0xc163('0x93')]){_0x3a6027[_0xc163('0x8e')]=_0x4f25c4['body'][_0xc163('0x93')];}return _0xef106[_0xc163('0x38')](_0x3a6027);}else{return _0xef106;}}})[_0xc163('0x39')](function(_0x82d9c2){_0x6320bd[_0xc163('0x94')]=_0x82d9c2['get']({'plain':!![]});_0x6320bd[_0xc163('0x94')][_0xc163('0x95')]=_0x9b65d9;if(_0x6320bd[_0xc163('0x94')][_0xc163('0x95')]){if(_0x6320bd[_0xc163('0x85')][_0xc163('0x96')]){_0x6320bd['applications'][_0xc163('0x97')]({'id':0x0,'priority':_0x6320bd[_0xc163('0x87')][_0xc163('0x49')]+0x1,'app':_0xc163('0x98'),'appdata':_0xc163('0x99'),'interval':'*,*,*,*'});}}return db[_0xc163('0x9a')][_0xc163('0x5c')]({'body':_0x4f25c4[_0xc163('0x5d')][_0xc163('0x5d')],'OpenchannelAccountId':_0x4f25c4['params']['id'],'OpenchannelInteractionId':_0x82d9c2['id'],'direction':'in','ContactId':_0x6320bd[_0xc163('0x92')]['id'],'AttachmentId':_0x4f25c4[_0xc163('0x5d')][_0xc163('0x9b')]});})[_0xc163('0x39')](function(_0x44a8b6){_0x6320bd[_0xc163('0x2b')]=_0x44a8b6;if(_0x6320bd[_0xc163('0x94')][_0xc163('0x9c')]){return db[_0xc163('0x9d')][_0xc163('0x5b')]({'attributes':['id','name'],'where':{'id':_0x6320bd['interaction'][_0xc163('0x9c')]}})[_0xc163('0x39')](function(_0x2b0d49){if(_0x2b0d49){_0x6320bd['applications'][_0xc163('0x9e')]({'id':0x0,'priority':0x0,'app':_0xc163('0x9f'),'appdata':_0x2b0d49[_0xc163('0x3d')]+','+(_0x6320bd[_0xc163('0x85')][_0xc163('0xa0')]||0xa),'interval':_0xc163('0xa1')});_0x6320bd[_0xc163('0xa2')]=![];}return respondWithRpcPromise(_0xc163('0xa3'),_0xc163('0xa4'),_0x6320bd);});}return respondWithRpcPromise(_0xc163('0xa3'),'startRouting',_0x6320bd);})[_0xc163('0x39')](function(_0x5b52a1){respondWithRpcPromise('EventManager',_0xc163('0xa5'),{'event':_0xc163('0x70'),'message':_0x5b52a1},client9002);return _0x5b52a1;})['then'](respondWithResult(_0x32382d,null))[_0xc163('0x57')](handleError(_0x32382d,null));};exports[_0xc163('0xa6')]=function(_0x7de435,_0x463c9a){var _0x2fdede=_0x7de435[_0xc163('0x58')]['id'];var _0x5c4de2=_0x7de435[_0xc163('0x5d')];var _0x33e2df=0xc8;var _0x383a07=null;return db[_0xc163('0xa7')]['transaction']({'isolationLevel':db[_0xc163('0xa7')][_0xc163('0xa8')][_0xc163('0xa9')][_0xc163('0xaa')]},function(_0x26bff6){return db[_0xc163('0x41')][_0xc163('0x67')]({'where':{'id':_0x2fdede},'transaction':_0x26bff6})['then'](function(_0xf9ad9b){if(_0xf9ad9b){return db['OpenchannelApplication'][_0xc163('0x3c')]({'where':{'OpenchannelAccountId':_0x2fdede},'transaction':_0x26bff6})[_0xc163('0x39')](function(){var _0x427fd1=_[_0xc163('0x40')](_0x5c4de2,function(_0x3c4b29){_0x3c4b29['OpenchannelAccountId']=_0x2fdede;return _0x3c4b29;});return db['OpenchannelApplication'][_0xc163('0xab')](_0x427fd1,{'transaction':_0x26bff6});});}else{_0x33e2df=0x194;_0x383a07=[];}});})['then'](function(){if(_0x33e2df!==0x194){return db['OpenchannelApplication'][_0xc163('0xac')]({'where':{'OpenchannelAccountId':_0x2fdede},'order':_0xc163('0x89')})[_0xc163('0x39')](function(_0x27b099){_0x383a07=_0x27b099;});}})[_0xc163('0x57')](function(_0x2cc016){_0x33e2df=0x1f4;logger[_0xc163('0x29')](_0x2cc016['stack']);if(_0x2cc016[_0xc163('0x3d')]){delete _0x2cc016[_0xc163('0x3d')];}_0x383a07=_0x2cc016;})['finally'](function(){if(_0x383a07===null){_0x463c9a[_0xc163('0xad')](_0x33e2df);}else{if(_0x33e2df===0x1f4){_0x463c9a[_0xc163('0x33')](_0x33e2df)[_0xc163('0xae')](_0x383a07);}else{_0x463c9a['status'](_0x33e2df)[_0xc163('0x2e')](_0x383a07);}}});};exports[_0xc163('0xaf')]=function(_0x15e721,_0x4631a1,_0x2cb904){var _0x3ff364={};var _0x3fbaee={};var _0xff66d6;var _0x11e973;return db[_0xc163('0x41')]['findOne']({'where':{'id':_0x15e721[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x4631a1,null))[_0xc163('0x39')](function(_0x5677b1){if(_0x5677b1){_0xff66d6=_0x5677b1;_0x3fbaee[_0xc163('0x43')]=_[_0xc163('0x45')](db['OpenchannelApplication']['rawAttributes']);_0x3fbaee[_0xc163('0x44')]=_['keys'](_0x15e721[_0xc163('0x44')]);_0x3fbaee[_0xc163('0x46')]=_['intersection'](_0x3fbaee['model'],_0x3fbaee[_0xc163('0x44')]);_0x3ff364[_0xc163('0x4a')]=_[_0xc163('0x47')](_0x3fbaee['model'],qs[_0xc163('0x48')](_0x15e721[_0xc163('0x44')][_0xc163('0x48')]));_0x3ff364[_0xc163('0x4a')]=_0x3ff364[_0xc163('0x4a')][_0xc163('0x49')]?_0x3ff364[_0xc163('0x4a')]:_0x3fbaee['model'];_0x3ff364['order']=qs[_0xc163('0x4c')](_0x15e721[_0xc163('0x44')][_0xc163('0x4c')]);_0x3ff364[_0xc163('0x4d')]=qs[_0xc163('0x46')](_[_0xc163('0x4e')](_0x15e721[_0xc163('0x44')],_0x3fbaee[_0xc163('0x46')]));if(_0x15e721[_0xc163('0x44')]['filter']){_0x3ff364['where']=_[_0xc163('0x50')](_0x3ff364['where'],{'$or':_[_0xc163('0x40')](_0x3ff364['attributes'],function(_0x5209dd){var _0xb7b46e={};_0xb7b46e[_0x5209dd]={'$like':'%'+_0x15e721[_0xc163('0x44')][_0xc163('0x4f')]+'%'};return _0xb7b46e;})});}_0x3ff364=_[_0xc163('0x50')]({},_0x3ff364,_0x15e721[_0xc163('0x53')]);return _0xff66d6[_0xc163('0xaf')](_0x3ff364);}})[_0xc163('0x39')](function(_0x4b9c90){if(_0x4b9c90){_0x11e973=_0x4b9c90['length'];if(!_0x15e721[_0xc163('0x44')][_0xc163('0x68')]('nolimit')){_0x3ff364['limit']=qs[_0xc163('0x31')](_0x15e721[_0xc163('0x44')][_0xc163('0x31')]);_0x3ff364[_0xc163('0x2f')]=qs['offset'](_0x15e721[_0xc163('0x44')][_0xc163('0x2f')]);}return _0xff66d6['getApplications'](_0x3ff364);}})[_0xc163('0x39')](function(_0x4abd72){if(_0x4abd72){return _0x4abd72?{'count':_0x11e973,'rows':_0x4abd72}:null;}})[_0xc163('0x39')](respondWithResult(_0x4631a1,null))[_0xc163('0x57')](handleError(_0x4631a1,null));};exports['getInteractions']=function(_0x105d46,_0x3cd8a6,_0x2544fa){var _0x1957cc={'raw':![],'where':{}};var _0x4fe614={};var _0x2dfddd={'count':0x0,'rows':[]};return db[_0xc163('0x41')][_0xc163('0x67')]({'where':{'id':_0x105d46['params']['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x3cd8a6,null))[_0xc163('0x39')](function(_0x8c2302){if(_0x8c2302){_0x4fe614[_0xc163('0x43')]=_['keys'](db[_0xc163('0x8f')][_0xc163('0x5a')]);_0x4fe614[_0xc163('0x44')]=_[_0xc163('0x45')](_0x105d46[_0xc163('0x44')]);_0x4fe614['filters']=_[_0xc163('0x47')](_0x4fe614['model'],_0x4fe614[_0xc163('0x44')]);_0x1957cc[_0xc163('0x4a')]=_['intersection'](_0x4fe614[_0xc163('0x43')],qs[_0xc163('0x48')](_0x105d46[_0xc163('0x44')][_0xc163('0x48')]));_0x1957cc[_0xc163('0x4a')]=_0x1957cc[_0xc163('0x4a')]['length']?_0x1957cc[_0xc163('0x4a')]:_0x4fe614[_0xc163('0x43')];if(!_0x105d46[_0xc163('0x44')]['hasOwnProperty'](_0xc163('0x69'))){_0x1957cc[_0xc163('0x31')]=qs['limit'](_0x105d46['query'][_0xc163('0x31')]);_0x1957cc[_0xc163('0x2f')]=qs[_0xc163('0x2f')](_0x105d46[_0xc163('0x44')]['offset']);}_0x1957cc['order']=qs[_0xc163('0x4c')](_0x105d46[_0xc163('0x44')][_0xc163('0x4c')]);_0x1957cc[_0xc163('0x4d')]=qs[_0xc163('0x46')](_[_0xc163('0x4e')](_0x105d46[_0xc163('0x44')],_0x4fe614[_0xc163('0x46')]));_0x1957cc[_0xc163('0x4d')][_0xc163('0x64')]=_0x8c2302['id'];if(_0x105d46[_0xc163('0x44')][_0xc163('0x4f')]){_0x1957cc[_0xc163('0x4d')]=_['merge'](_0x1957cc['where'],{'$or':_[_0xc163('0x40')](_0x1957cc[_0xc163('0x4a')],function(_0x44ed1a){var _0x3ccec8={};_0x3ccec8[_0x44ed1a]={'$like':'%'+_0x105d46[_0xc163('0x44')][_0xc163('0x4f')]+'%'};return _0x3ccec8;})});}_0x1957cc=_[_0xc163('0x50')]({},_0x1957cc,_0x105d46[_0xc163('0x53')]);return db[_0xc163('0x8f')]['count']({'where':_0x1957cc[_0xc163('0x4d')]})[_0xc163('0x39')](function(_0x519426){_0x2dfddd[_0xc163('0x32')]=_0x519426;if(_0x105d46['query'][_0xc163('0x54')]){_0x1957cc[_0xc163('0x55')]=[{'model':db[_0xc163('0x72')],'as':'Contact','required':![]},{'model':db[_0xc163('0x9d')],'as':'Owner','attributes':[_0xc163('0x3d'),'fullname',_0xc163('0xb0')],'required':![]},{'model':db['Tag'],'as':_0xc163('0xb1'),'attributes':['id','name',_0xc163('0xb2')],'where':_0x105d46[_0xc163('0x44')][_0xc163('0xb3')]?{'id':_0x105d46[_0xc163('0x44')][_0xc163('0xb3')]}:undefined,'required':_0x105d46['query'][_0xc163('0xb3')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xc163('0x6a')](_0x1957cc);})[_0xc163('0x39')](function(_0x282ffd){_0x2dfddd['rows']=_0x282ffd;return _0x2dfddd;});}})[_0xc163('0x39')](respondWithFilteredResult(_0x3cd8a6,_0x1957cc))['catch'](handleError(_0x3cd8a6,null));};exports['addAgents']=function(_0x1cff10,_0x864d1f,_0xeb845f){return db[_0xc163('0x41')][_0xc163('0x5b')]({'where':{'id':_0x1cff10['params']['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x864d1f,null))[_0xc163('0x39')](function(_0x350cc8){if(_0x350cc8){return _0x350cc8[_0xc163('0xb4')](_0x1cff10[_0xc163('0x5d')]['ids'],_[_0xc163('0xb5')](_0x1cff10['body'],[_0xc163('0x6b'),'id'])||{})['spread'](function(_0x550ddd){for(var _0x110d77=0x0;_0x110d77<_0x1cff10[_0xc163('0x5d')][_0xc163('0x6b')][_0xc163('0x49')];_0x110d77+=0x1){socket[_0xc163('0xb6')](_0xc163('0xb7'),{'UserId':Number(_0x1cff10[_0xc163('0x5d')][_0xc163('0x6b')][_0x110d77]),'OpenchannelAccountId':Number(_0x1cff10['params']['id'])});}return _0x550ddd;});}})['then'](respondWithResult(_0x864d1f,null))[_0xc163('0x57')](handleError(_0x864d1f,null));};exports[_0xc163('0xb8')]=function(_0x16055d,_0x508dda,_0x2fbb69){return db[_0xc163('0x41')][_0xc163('0x5b')]({'where':{'id':_0x16055d[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x508dda,null))['then'](function(_0x58f5ce){if(_0x58f5ce){return _0x58f5ce[_0xc163('0xb8')](_0x16055d[_0xc163('0x44')]['ids'])['then'](function(){if(_[_0xc163('0xb9')](_0x16055d[_0xc163('0x44')]['ids'])){for(var _0x11706c=0x0;_0x11706c<_0x16055d['query']['ids'][_0xc163('0x49')];_0x11706c+=0x1){socket[_0xc163('0xb6')](_0xc163('0xba'),{'UserId':Number(_0x16055d['query'][_0xc163('0x6b')][_0x11706c]),'OpenchannelAccountId':Number(_0x16055d[_0xc163('0x58')]['id'])});}}else{socket[_0xc163('0xb6')](_0xc163('0xba'),{'UserId':Number(_0x16055d[_0xc163('0x44')][_0xc163('0x6b')]),'OpenchannelAccountId':Number(_0x16055d['params']['id'])});}});}})[_0xc163('0x39')](respondWithStatusCode(_0x508dda,null))['catch'](handleError(_0x508dda,null));};exports[_0xc163('0xbb')]=function(_0x5e77d3,_0x4a8fae,_0x31cab9){var _0x1de9a2={};var _0x1dfcca={};var _0x4299c1;var _0x47d22a;return db[_0xc163('0x41')][_0xc163('0x67')]({'where':{'id':_0x5e77d3[_0xc163('0x58')]['id']}})[_0xc163('0x39')](handleEntityNotFound(_0x4a8fae,null))['then'](function(_0x392422){if(_0x392422){_0x4299c1=_0x392422;_0x1dfcca[_0xc163('0x43')]=_[_0xc163('0x45')](db[_0xc163('0x9d')][_0xc163('0x5a')]);_0x1dfcca[_0xc163('0x44')]=_[_0xc163('0x45')](_0x5e77d3[_0xc163('0x44')]);_0x1dfcca[_0xc163('0x46')]=_[_0xc163('0x47')](_0x1dfcca[_0xc163('0x43')],_0x1dfcca[_0xc163('0x44')]);_0x1de9a2[_0xc163('0x4a')]=_['intersection'](_0x1dfcca['model'],qs[_0xc163('0x48')](_0x5e77d3['query'][_0xc163('0x48')]));_0x1de9a2[_0xc163('0x4a')]=_0x1de9a2['attributes'][_0xc163('0x49')]?_0x1de9a2[_0xc163('0x4a')]:_0x1dfcca['model'];_0x1de9a2[_0xc163('0x4b')]=qs[_0xc163('0x4c')](_0x5e77d3['query'][_0xc163('0x4c')]);_0x1de9a2[_0xc163('0x4d')]=qs[_0xc163('0x46')](_[_0xc163('0x4e')](_0x5e77d3[_0xc163('0x44')],_0x1dfcca[_0xc163('0x46')]));if(_0x5e77d3[_0xc163('0x44')][_0xc163('0x4f')]){_0x1de9a2['where']=_[_0xc163('0x50')](_0x1de9a2['where'],{'$or':_['map'](_0x1de9a2['attributes'],function(_0x4ec1f4){var _0x2094b2={};_0x2094b2[_0x4ec1f4]={'$like':'%'+_0x5e77d3['query'][_0xc163('0x4f')]+'%'};return _0x2094b2;})});}_0x1de9a2=_[_0xc163('0x50')]({},_0x1de9a2,_0x5e77d3[_0xc163('0x53')]);return _0x4299c1['getAgents'](_0x1de9a2);}})[_0xc163('0x39')](function(_0x416477){if(_0x416477){_0x47d22a=_0x416477[_0xc163('0x49')];if(!_0x5e77d3[_0xc163('0x44')][_0xc163('0x68')](_0xc163('0x69'))){_0x1de9a2[_0xc163('0x31')]=qs[_0xc163('0x31')](_0x5e77d3[_0xc163('0x44')][_0xc163('0x31')]);_0x1de9a2['offset']=qs['offset'](_0x5e77d3[_0xc163('0x44')][_0xc163('0x2f')]);}return _0x4299c1[_0xc163('0xbb')](_0x1de9a2);}})[_0xc163('0x39')](function(_0x3fd904){if(_0x3fd904){return _0x3fd904?{'count':_0x47d22a,'rows':_0x3fd904}:null;}})[_0xc163('0x39')](respondWithResult(_0x4a8fae,null))[_0xc163('0x57')](handleError(_0x4a8fae,null));};exports[_0xc163('0xae')]=function(_0x1c0161,_0x154bc4,_0x42d618){var _0x78df40,_0x3c7a34,_0x125780;if(_[_0xc163('0x79')](_0x1c0161[_0xc163('0x5d')][_0xc163('0x5d')])||_0x1c0161[_0xc163('0x5d')][_0xc163('0x5d')]===''){throw new db[(_0xc163('0x73'))][(_0xc163('0x7c'))](_0xc163('0x7d'));}if(_[_0xc163('0x79')](_0x1c0161[_0xc163('0x5d')]['to'])){}_0x78df40=_0x1c0161[_0xc163('0x5d')]['to'];return db['OpenchannelAccount'][_0xc163('0x67')]({'where':{'id':_0x1c0161[_0xc163('0x58')]['id']}})['then'](handleEntityNotFound(_0x154bc4,null))['then'](function(_0x392bcd){if(_0x392bcd){return db[_0xc163('0x41')][_0xc163('0x5b')]({'where':{'id':_0x392bcd['id']},'include':[{'model':db[_0xc163('0xbc')],'as':_0xc163('0x81'),'include':[{'model':db[_0xc163('0x72')],'as':_0xc163('0x82'),'where':{[_0x392bcd[_0xc163('0x7e')]]:_0x78df40},'limit':0x1,'order':[[_0xc163('0x76'),_0xc163('0xbd')]]}]}]})[_0xc163('0x39')](handleEntityNotFound(_0x154bc4,null))['then'](function(_0x215a0e){if(_0x215a0e&&_0x215a0e['List']){_0x3c7a34=_0x215a0e[_0xc163('0x3a')]({'plain':!![]});if(_0x3c7a34[_0xc163('0x81')]&&_0x3c7a34[_0xc163('0x81')][_0xc163('0x82')][_0xc163('0x49')]){return _0x3c7a34[_0xc163('0x81')][_0xc163('0x82')][0x0];}return db[_0xc163('0x72')][_0xc163('0x5c')](_[_0xc163('0x8b')](_0x1c0161[_0xc163('0x5d')],{'firstName':_0x78df40,[_0x215a0e[_0xc163('0x7e')]]:_0x78df40,'phone':_0x78df40,'ListId':_0x3c7a34[_0xc163('0x78')]}));}})[_0xc163('0x39')](handleEntityNotFound(_0x154bc4,null))[_0xc163('0x39')](function(_0x43a511){if(_0x43a511){_0x125780=_0x43a511;return db[_0xc163('0x8f')][_0xc163('0x5b')]({'where':{'ContactId':_0x125780['id'],'closed':![],'OpenchannelAccountId':_0x3c7a34['id']}})[_0xc163('0x39')](function(_0x532b06){if(_0x532b06){return[_0x532b06,![]];}return db['OpenchannelInteraction'][_0xc163('0x5c')]({'UserId':_0x1c0161[_0xc163('0x5e')]['id'],'ContactId':_0x125780['id'],'OpenchannelAccountId':_0x3c7a34['id'],'lastMsgDirection':_0xc163('0xbe'),'Messages':[_['merge'](_0x1c0161[_0xc163('0x5d')],{'read':![],'body':_0x1c0161['body'][_0xc163('0x5d')],'OpenchannelAccountId':_0x3c7a34['id'],'UserId':_0x1c0161[_0xc163('0x5e')]['id'],'ContactId':_0x125780['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xc163('0x39')](function(_0x4383a5){return[_0x4383a5,!![]];});});}})[_0xc163('0x91')](function(_0x27cb28,_0x544285){if(_0x544285){return _0x27cb28;}return db[_0xc163('0x9a')][_0xc163('0x5c')](_[_0xc163('0x50')](_0x1c0161['body'],{'read':![],'body':_0x1c0161['body'][_0xc163('0x5d')],'OpenchannelAccountId':_0x3c7a34['id'],'OpenchannelInteractionId':_0x27cb28['id'],'UserId':_0x1c0161[_0xc163('0x5e')]['id'],'ContactId':_0x125780['id']}))[_0xc163('0x39')](function(_0x3eff44){_0x27cb28[_0xc163('0xbf')][_0xc163('0xc0')]=[];_0x27cb28[_0xc163('0xbf')][_0xc163('0xc0')][_0xc163('0x97')](_0x3eff44['dataValues']);return _0x27cb28;});});}})[_0xc163('0x39')](respondWithResult(_0x154bc4,null))[_0xc163('0x57')](handleError(_0x154bc4,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index cbe8268..0d6379b 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 _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x20e5c3,_0x41470c){var _0x401520=function(_0x37f246){while(--_0x37f246){_0x20e5c3['push'](_0x20e5c3['shift']());}};_0x401520(++_0x41470c);}(_0xb688,0xcf));var _0x8b68=function(_0x447006,_0x5d4600){_0x447006=_0x447006-0x0;var _0x1260f2=_0xb688[_0x447006];return _0x1260f2;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xda55,0x6d));var _0x5da5=function(_0x1b9764,_0x361ac4){_0x1b9764=_0x1b9764-0x0;var _0x4303c3=_0xda55[_0x1b9764];return _0x4303c3;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 6dbde63..36b8e5e 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 _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x40db15,_0x512ac1){var _0x3a3b17=function(_0xf92205){while(--_0xf92205){_0x40db15['push'](_0x40db15['shift']());}};_0x3a3b17(++_0x512ac1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x30ae50,_0x58f4e9){var _0x1938f1=function(_0x3c90fd){while(--_0x3c90fd){_0x30ae50['push'](_0x30ae50['shift']());}};_0x1938f1(++_0x58f4e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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':'openchannel_accounts','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 4996a8c..e6e18fc 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 _0xdb94=['randomstring','../../mysqldb','../../config/utils','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','request','info','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x6172d1,_0xe52241){var _0x30607f=function(_0x479416){while(--_0x479416){_0x6172d1['push'](_0x6172d1['shift']());}};_0x30607f(++_0xe52241);}(_0xdb94,0xab));var _0x4db9=function(_0x4d1903,_0x2c2317){_0x4d1903=_0x4d1903-0x0;var _0x40a73c=_0xdb94[_0x4d1903];return _0x40a73c;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});config['redis']=_[_0x4db9('0x9')](config['redis'],{'host':_0x4db9('0xa'),'port':0x18eb});var socket=require(_0x4db9('0xb'))(new Redis(config[_0x4db9('0xc')]));require(_0x4db9('0xd'))[_0x4db9('0xe')](socket);function respondWithRpcPromise(_0x242116,_0x45c0e4,_0xeb2168){return new BPromise(function(_0x26f3ae,_0x2bf991){return client[_0x4db9('0xf')](_0x242116,_0xeb2168)['then'](function(_0x451970){logger[_0x4db9('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,'request\x20sent');logger[_0x4db9('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45c0e4,'request\x20sent',JSON[_0x4db9('0x12')](_0x451970));if(_0x451970[_0x4db9('0x13')]){if(_0x451970['error'][_0x4db9('0x14')]===0x1f4){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x451970[_0x4db9('0x13')]['message']);return _0x2bf991(_0x451970['error'][_0x4db9('0x16')]);}logger[_0x4db9('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,_0x451970[_0x4db9('0x13')][_0x4db9('0x16')]);return _0x26f3ae(_0x451970['error']['message']);}else{logger[_0x4db9('0x10')](_0x4db9('0x15'),_0x45c0e4,_0x4db9('0x17'));_0x26f3ae(_0x451970[_0x4db9('0x18')][_0x4db9('0x16')]);}})['catch'](function(_0x3b1f87){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x3b1f87);_0x2bf991(_0x3b1f87);});});} \ No newline at end of file +var _0xde2c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment'];(function(_0x48d968,_0x352369){var _0xd147c9=function(_0x31fad1){while(--_0x31fad1){_0x48d968['push'](_0x48d968['shift']());}};_0xd147c9(++_0x352369);}(_0xde2c,0x7f));var _0xcde2=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xde2c[_0x2c2980];return _0x2a20a9;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});config['redis']=_[_0xcde2('0xd')](config[_0xcde2('0xe')],{'host':_0xcde2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcde2('0x10'))[_0xcde2('0x11')](socket);function respondWithRpcPromise(_0x4e9749,_0x181a73,_0x29f7e0){return new BPromise(function(_0x12a287,_0x127358){return client['request'](_0x4e9749,_0x29f7e0)['then'](function(_0x25677f){logger[_0xcde2('0x12')](_0xcde2('0x13'),_0x181a73,_0xcde2('0x14'));logger[_0xcde2('0x15')](_0xcde2('0x16'),_0x181a73,'request\x20sent',JSON[_0xcde2('0x17')](_0x25677f));if(_0x25677f['error']){if(_0x25677f[_0xcde2('0x18')]['code']===0x1f4){logger['error'](_0xcde2('0x13'),_0x181a73,_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);return _0x127358(_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);}logger['error'](_0xcde2('0x13'),_0x181a73,_0x25677f['error'][_0xcde2('0x19')]);return _0x12a287(_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);}else{logger[_0xcde2('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x181a73,'request\x20sent');_0x12a287(_0x25677f['result'][_0xcde2('0x19')]);}})['catch'](function(_0x285ac7){logger[_0xcde2('0x18')](_0xcde2('0x13'),_0x181a73,_0x285ac7);_0x127358(_0x285ac7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index f1d3828..35f2190 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 _0xaefc=['./openchannelAccount.events','save','remove','length','openchannelAccount:'];(function(_0x27fac1,_0x8c7c97){var _0x159bf3=function(_0x14e126){while(--_0x14e126){_0x27fac1['push'](_0x27fac1['shift']());}};_0x159bf3(++_0x8c7c97);}(_0xaefc,0xc8));var _0xcaef=function(_0x13f0ae,_0x37b1bf){_0x13f0ae=_0x13f0ae-0x0;var _0x3f0c0c=_0xaefc[_0x13f0ae];return _0x3f0c0c;};'use strict';var OpenchannelAccountEvents=require(_0xcaef('0x0'));var events=[_0xcaef('0x1'),_0xcaef('0x2'),'update'];function createListener(_0x1da249,_0xd60229){return function(_0x49cc54){_0xd60229['emit'](_0x1da249,_0x49cc54);};}function removeListener(_0x37a134,_0x46a35e){return function(){OpenchannelAccountEvents['removeListener'](_0x37a134,_0x46a35e);};}exports['register']=function(_0x47457d){for(var _0x4471a1=0x0,_0x567a8f=events[_0xcaef('0x3')];_0x4471a1<_0x567a8f;_0x4471a1++){var _0x538f22=events[_0x4471a1];var _0x49d64c=createListener(_0xcaef('0x4')+_0x538f22,_0x47457d);OpenchannelAccountEvents['on'](_0x538f22,_0x49d64c);}}; \ No newline at end of file +var _0xb07f=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','length'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb07f,0x109));var _0xfb07=function(_0x31fb43,_0x5d6efd){_0x31fb43=_0x31fb43-0x0;var _0x5893c6=_0xb07f[_0x31fb43];return _0x5893c6;};'use strict';var OpenchannelAccountEvents=require(_0xfb07('0x0'));var events=[_0xfb07('0x1'),_0xfb07('0x2'),_0xfb07('0x3')];function createListener(_0x2e561d,_0xc9317c){return function(_0x3a262e){_0xc9317c[_0xfb07('0x4')](_0x2e561d,_0x3a262e);};}function removeListener(_0x3b3c05,_0x2fc1ce){return function(){OpenchannelAccountEvents[_0xfb07('0x5')](_0x3b3c05,_0x2fc1ce);};}exports['register']=function(_0x3c79a9){for(var _0x934f98=0x0,_0x14fc69=events[_0xfb07('0x6')];_0x934f98<_0x14fc69;_0x934f98++){var _0x41d73a=events[_0x934f98];var _0x3bb9cf=createListener(_0xfb07('0x7')+_0x41d73a,_0x3c79a9);OpenchannelAccountEvents['on'](_0x41d73a,_0x3bb9cf);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 011c602..7a075f0 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 _0x5482=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','show','isAuthenticated','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3fac24,_0x48cecd){var _0x229eee=function(_0x140535){while(--_0x140535){_0x3fac24['push'](_0x3fac24['shift']());}};_0x229eee(++_0x48cecd);}(_0x5482,0x159));var _0x2548=function(_0x199394,_0x3d0297){_0x199394=_0x199394-0x0;var _0x61e770=_0x5482[_0x199394];return _0x61e770;};'use strict';var multer=require(_0x2548('0x0'));var util=require('util');var path=require(_0x2548('0x1'));var timeout=require(_0x2548('0x2'));var express=require(_0x2548('0x3'));var router=express[_0x2548('0x4')]();var fs_extra=require(_0x2548('0x5'));var auth=require(_0x2548('0x6'));var interaction=require(_0x2548('0x7'));var config=require(_0x2548('0x8'));var controller=require(_0x2548('0x9'));router[_0x2548('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2548('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2548('0xb')]);router['post']('/',auth[_0x2548('0xc')](),controller['create']);router['put'](_0x2548('0xd'),auth[_0x2548('0xc')](),controller['update']);router['delete']('/:id',auth[_0x2548('0xc')](),controller[_0x2548('0xe')]);module[_0x2548('0xf')]=router; \ No newline at end of file +var _0xd27d=['./openchannelApplication.controller','get','index','show','put','/:id','isAuthenticated','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4528ee,_0xcf06bf){var _0x43b2fe=function(_0x49559b){while(--_0x49559b){_0x4528ee['push'](_0x4528ee['shift']());}};_0x43b2fe(++_0xcf06bf);}(_0xd27d,0x6f));var _0xdd27=function(_0x4ec863,_0x85080a){_0x4ec863=_0x4ec863-0x0;var _0x2071fc=_0xd27d[_0x4ec863];return _0x2071fc;};'use strict';var multer=require(_0xdd27('0x0'));var util=require(_0xdd27('0x1'));var path=require('path');var timeout=require(_0xdd27('0x2'));var express=require(_0xdd27('0x3'));var router=express['Router']();var fs_extra=require(_0xdd27('0x4'));var auth=require(_0xdd27('0x5'));var interaction=require(_0xdd27('0x6'));var config=require(_0xdd27('0x7'));var controller=require(_0xdd27('0x8'));router[_0xdd27('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd27('0xa')]);router[_0xdd27('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdd27('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdd27('0xc')](_0xdd27('0xd'),auth[_0xdd27('0xe')](),controller[_0xdd27('0xf')]);router[_0xdd27('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 7e65260..92b3735 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 _0xd057=['exports','STRING','noop','sequelize'];(function(_0x2ff88c,_0x444be2){var _0x5e3c4d=function(_0x4967d7){while(--_0x4967d7){_0x2ff88c['push'](_0x2ff88c['shift']());}};_0x5e3c4d(++_0x444be2);}(_0xd057,0x123));var _0x7d05=function(_0x5a904d,_0xfb61be){_0x5a904d=_0x5a904d-0x0;var _0x2890d6=_0xd057[_0x5a904d];return _0x2890d6;};'use strict';var Sequelize=require(_0x7d05('0x0'));module[_0x7d05('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d05('0x2')],'allowNull':![],'defaultValue':_0x7d05('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7d05('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa42f=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xa42f,0x8e));var _0xfa42=function(_0x35bd35,_0x234893){_0x35bd35=_0x35bd35-0x0;var _0x10aa11=_0xa42f[_0x35bd35];return _0x10aa11;};'use strict';var Sequelize=require(_0xfa42('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfa42('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfa42('0x2')],'allowNull':![],'defaultValue':_0xfa42('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfa42('0x2')]},'interval':{'type':Sequelize[_0xfa42('0x2')],'defaultValue':_0xfa42('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6a025e3..33f23eb 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 _0xd866=['merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','body','update','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','then','error','send','index','map','OpenchannelApplication','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5a6f4c,_0x2d5991){var _0x4044a8=function(_0x33610b){while(--_0x33610b){_0x5a6f4c['push'](_0x5a6f4c['shift']());}};_0x4044a8(++_0x2d5991);}(_0xd866,0x16d));var _0x6d86=function(_0x3525ad,_0x3d1b34){_0x3525ad=_0x3525ad-0x0;var _0x3f30fb=_0xd866[_0x3525ad];return _0x3f30fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d86('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d86('0x1'));var rp=require(_0x6d86('0x2'));var moment=require(_0x6d86('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6d86('0x4'));var util=require(_0x6d86('0x5'));var path=require(_0x6d86('0x6'));var sox=require(_0x6d86('0x7'));var csv=require(_0x6d86('0x8'));var ejs=require(_0x6d86('0x9'));var fs=require('fs');var fs_extra=require(_0x6d86('0xa'));var _=require('lodash');var squel=require(_0x6d86('0xb'));var crypto=require(_0x6d86('0xc'));var jsforce=require(_0x6d86('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6d86('0x8'));var querystring=require('querystring');var Papa=require(_0x6d86('0xe'));var Redis=require(_0x6d86('0xf'));var authService=require(_0x6d86('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6d86('0x11'));var hardwareService=require(_0x6d86('0x12'));var logger=require(_0x6d86('0x13'))(_0x6d86('0x14'));var utils=require(_0x6d86('0x15'));var config=require(_0x6d86('0x16'));var licenseUtil=require(_0x6d86('0x17'));var db=require(_0x6d86('0x18'))['db'];function respondWithStatusCode(_0x5cf350,_0x46f80c){_0x46f80c=_0x46f80c||0xcc;return function(_0x5c64a0){if(_0x5c64a0){return _0x5cf350[_0x6d86('0x19')](_0x46f80c);}return _0x5cf350[_0x6d86('0x1a')](_0x46f80c)[_0x6d86('0x1b')]();};}function respondWithResult(_0x271f08,_0x3b7f5e){_0x3b7f5e=_0x3b7f5e||0xc8;return function(_0x9b68be){if(_0x9b68be){return _0x271f08[_0x6d86('0x1a')](_0x3b7f5e)['json'](_0x9b68be);}};}function respondWithFilteredResult(_0x108d3f,_0x57f956){return function(_0x5ad435){if(_0x5ad435){var _0x5dcdc5=typeof _0x57f956[_0x6d86('0x1c')]===_0x6d86('0x1d')&&typeof _0x57f956[_0x6d86('0x1e')]===_0x6d86('0x1d');var _0x48b622=_0x5ad435[_0x6d86('0x1f')];var _0x4cf1ab=_0x5dcdc5?0x0:_0x57f956['offset'];var _0x25250f=_0x5dcdc5?_0x5ad435[_0x6d86('0x1f')]:_0x57f956[_0x6d86('0x1c')]+_0x57f956[_0x6d86('0x1e')];var _0x4a170c;if(_0x25250f>=_0x48b622){_0x25250f=_0x48b622;_0x4a170c=0xc8;}else{_0x4a170c=0xce;}_0x108d3f[_0x6d86('0x1a')](_0x4a170c);return _0x108d3f[_0x6d86('0x20')]('Content-Range',_0x4cf1ab+'-'+_0x25250f+'/'+_0x48b622)['json'](_0x5ad435);}return null;};}function patchUpdates(_0x2b548e){return function(_0x2936f1){try{jsonpatch['apply'](_0x2936f1,_0x2b548e,!![]);}catch(_0x3e955d){return BPromise['reject'](_0x3e955d);}return _0x2936f1['save']();};}function saveUpdates(_0x440128,_0x1c8993){return function(_0x5c0b62){if(_0x5c0b62){return _0x5c0b62['update'](_0x440128)['then'](function(_0x1ce64a){return _0x1ce64a;});}return null;};}function removeEntity(_0x2d24f0,_0x3b6dbc){return function(_0x35902e){if(_0x35902e){return _0x35902e['destroy']()[_0x6d86('0x21')](function(){_0x2d24f0[_0x6d86('0x1a')](0xcc)[_0x6d86('0x1b')]();});}};}function handleEntityNotFound(_0x154b7a,_0x4ed4e3){return function(_0x127173){if(!_0x127173){_0x154b7a['sendStatus'](0x194);}return _0x127173;};}function handleError(_0x26aeed,_0x411706){_0x411706=_0x411706||0x1f4;return function(_0x5da776){logger[_0x6d86('0x22')](_0x5da776['stack']);if(_0x5da776['name']){delete _0x5da776['name'];}_0x26aeed[_0x6d86('0x1a')](_0x411706)[_0x6d86('0x23')](_0x5da776);};}exports[_0x6d86('0x24')]=function(_0x1136a4,_0x59511e){var _0x1f7820={},_0x1652e={},_0x2785ae={'count':0x0,'rows':[]};var _0x4cc784=_[_0x6d86('0x25')](db[_0x6d86('0x26')][_0x6d86('0x27')],function(_0x1c3392){return{'name':_0x1c3392['fieldName'],'type':_0x1c3392[_0x6d86('0x28')]['key']};});_0x1652e['model']=_['map'](_0x4cc784,_0x6d86('0x29'));_0x1652e[_0x6d86('0x2a')]=_['keys'](_0x1136a4['query']);_0x1652e[_0x6d86('0x2b')]=_[_0x6d86('0x2c')](_0x1652e[_0x6d86('0x2d')],_0x1652e[_0x6d86('0x2a')]);_0x1f7820[_0x6d86('0x2e')]=_[_0x6d86('0x2c')](_0x1652e[_0x6d86('0x2d')],qs[_0x6d86('0x2f')](_0x1136a4['query']['fields']));_0x1f7820[_0x6d86('0x2e')]=_0x1f7820[_0x6d86('0x2e')][_0x6d86('0x30')]?_0x1f7820[_0x6d86('0x2e')]:_0x1652e['model'];if(!_0x1136a4[_0x6d86('0x2a')][_0x6d86('0x31')](_0x6d86('0x32'))){_0x1f7820[_0x6d86('0x1e')]=qs[_0x6d86('0x1e')](_0x1136a4[_0x6d86('0x2a')][_0x6d86('0x1e')]);_0x1f7820[_0x6d86('0x1c')]=qs[_0x6d86('0x1c')](_0x1136a4['query']['offset']);}_0x1f7820[_0x6d86('0x33')]=qs[_0x6d86('0x34')](_0x1136a4[_0x6d86('0x2a')]['sort']);_0x1f7820[_0x6d86('0x35')]=qs[_0x6d86('0x2b')](_[_0x6d86('0x36')](_0x1136a4[_0x6d86('0x2a')],_0x1652e[_0x6d86('0x2b')]),_0x4cc784);if(_0x1136a4[_0x6d86('0x2a')]['filter']){_0x1f7820['where']=_[_0x6d86('0x37')](_0x1f7820[_0x6d86('0x35')],{'$or':_[_0x6d86('0x25')](_0x4cc784,function(_0x2957ea){if(_0x2957ea[_0x6d86('0x28')]!==_0x6d86('0x38')){var _0x34e147={};_0x34e147[_0x2957ea[_0x6d86('0x29')]]={'$like':'%'+_0x1136a4[_0x6d86('0x2a')][_0x6d86('0x39')]+'%'};return _0x34e147;}})});}_0x1f7820=_[_0x6d86('0x37')]({},_0x1f7820,_0x1136a4[_0x6d86('0x3a')]);var _0x3fdbf5={'where':_0x1f7820['where']};return db['OpenchannelApplication']['count'](_0x3fdbf5)[_0x6d86('0x21')](function(_0x33dfa2){_0x2785ae[_0x6d86('0x1f')]=_0x33dfa2;if(_0x1136a4[_0x6d86('0x2a')][_0x6d86('0x3b')]){_0x1f7820[_0x6d86('0x3c')]=[{'all':!![]}];}return db[_0x6d86('0x26')][_0x6d86('0x3d')](_0x1f7820);})[_0x6d86('0x21')](function(_0x3c83c5){_0x2785ae[_0x6d86('0x3e')]=_0x3c83c5;return _0x2785ae;})[_0x6d86('0x21')](respondWithFilteredResult(_0x59511e,_0x1f7820))[_0x6d86('0x3f')](handleError(_0x59511e,null));};exports[_0x6d86('0x40')]=function(_0x500c2a,_0x15d8c9){var _0x53d3e5={'raw':!![],'where':{'id':_0x500c2a[_0x6d86('0x41')]['id']}},_0x30b92b={};_0x30b92b[_0x6d86('0x2d')]=_[_0x6d86('0x42')](db[_0x6d86('0x26')][_0x6d86('0x27')]);_0x30b92b[_0x6d86('0x2a')]=_['keys'](_0x500c2a['query']);_0x30b92b[_0x6d86('0x2b')]=_['intersection'](_0x30b92b[_0x6d86('0x2d')],_0x30b92b['query']);_0x53d3e5['attributes']=_[_0x6d86('0x2c')](_0x30b92b[_0x6d86('0x2d')],qs['fields'](_0x500c2a['query'][_0x6d86('0x2f')]));_0x53d3e5[_0x6d86('0x2e')]=_0x53d3e5[_0x6d86('0x2e')][_0x6d86('0x30')]?_0x53d3e5[_0x6d86('0x2e')]:_0x30b92b[_0x6d86('0x2d')];if(_0x500c2a['query']['includeAll']){_0x53d3e5[_0x6d86('0x3c')]=[{'all':!![]}];}_0x53d3e5=_[_0x6d86('0x37')]({},_0x53d3e5,_0x500c2a[_0x6d86('0x3a')]);return db[_0x6d86('0x26')]['find'](_0x53d3e5)['then'](handleEntityNotFound(_0x15d8c9,null))['then'](respondWithResult(_0x15d8c9,null))[_0x6d86('0x3f')](handleError(_0x15d8c9,null));};exports['create']=function(_0x17d3ad,_0x1e0dae){return db[_0x6d86('0x26')]['create'](_0x17d3ad[_0x6d86('0x43')],{})[_0x6d86('0x21')](respondWithResult(_0x1e0dae,0xc9))[_0x6d86('0x3f')](handleError(_0x1e0dae,null));};exports[_0x6d86('0x44')]=function(_0xc9a077,_0x1145a4){if(_0xc9a077[_0x6d86('0x43')]['id']){delete _0xc9a077[_0x6d86('0x43')]['id'];}return db[_0x6d86('0x26')]['find']({'where':{'id':_0xc9a077[_0x6d86('0x41')]['id']}})['then'](handleEntityNotFound(_0x1145a4,null))[_0x6d86('0x21')](saveUpdates(_0xc9a077[_0x6d86('0x43')],null))[_0x6d86('0x21')](respondWithResult(_0x1145a4,null))[_0x6d86('0x3f')](handleError(_0x1145a4,null));};exports['destroy']=function(_0x2a9d87,_0x2ba6e0){return db[_0x6d86('0x26')][_0x6d86('0x45')]({'where':{'id':_0x2a9d87[_0x6d86('0x41')]['id']}})[_0x6d86('0x21')](handleEntityNotFound(_0x2ba6e0,null))[_0x6d86('0x21')](removeEntity(_0x2ba6e0,null))[_0x6d86('0x3f')](handleError(_0x2ba6e0,null));}; \ No newline at end of file +var _0x455a=['model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','query','keys','intersection'];(function(_0x5ebf95,_0x4e8aef){var _0x28693c=function(_0x23bc7e){while(--_0x23bc7e){_0x5ebf95['push'](_0x5ebf95['shift']());}};_0x28693c(++_0x4e8aef);}(_0x455a,0xf6));var _0xa455=function(_0x2245c7,_0x47951d){_0x2245c7=_0x2245c7-0x0;var _0x267daa=_0x455a[_0x2245c7];return _0x267daa;};'use strict';var emlformat=require(_0xa455('0x0'));var rimraf=require(_0xa455('0x1'));var zipdir=require(_0xa455('0x2'));var jsonpatch=require(_0xa455('0x3'));var rp=require(_0xa455('0x4'));var moment=require(_0xa455('0x5'));var BPromise=require(_0xa455('0x6'));var Mustache=require(_0xa455('0x7'));var util=require(_0xa455('0x8'));var path=require(_0xa455('0x9'));var sox=require(_0xa455('0xa'));var csv=require(_0xa455('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa455('0xc'));var squel=require('squel');var crypto=require(_0xa455('0xd'));var jsforce=require(_0xa455('0xe'));var deskjs=require(_0xa455('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa455('0x10'));var Papa=require(_0xa455('0x11'));var Redis=require('ioredis');var authService=require(_0xa455('0x12'));var qs=require(_0xa455('0x13'));var as=require(_0xa455('0x14'));var hardwareService=require(_0xa455('0x15'));var logger=require(_0xa455('0x16'))(_0xa455('0x17'));var utils=require(_0xa455('0x18'));var config=require(_0xa455('0x19'));var licenseUtil=require(_0xa455('0x1a'));var db=require(_0xa455('0x1b'))['db'];function respondWithStatusCode(_0xf7ecaf,_0x2360bd){_0x2360bd=_0x2360bd||0xcc;return function(_0x5b2da5){if(_0x5b2da5){return _0xf7ecaf[_0xa455('0x1c')](_0x2360bd);}return _0xf7ecaf[_0xa455('0x1d')](_0x2360bd)[_0xa455('0x1e')]();};}function respondWithResult(_0x3c8611,_0x3e4ea9){_0x3e4ea9=_0x3e4ea9||0xc8;return function(_0x4aaa53){if(_0x4aaa53){return _0x3c8611['status'](_0x3e4ea9)['json'](_0x4aaa53);}};}function respondWithFilteredResult(_0x16d9d5,_0x3a12fd){return function(_0x3d14c6){if(_0x3d14c6){var _0x5dcb04=typeof _0x3a12fd[_0xa455('0x1f')]==='undefined'&&typeof _0x3a12fd[_0xa455('0x20')]==='undefined';var _0x34967a=_0x3d14c6[_0xa455('0x21')];var _0x53e54a=_0x5dcb04?0x0:_0x3a12fd['offset'];var _0x4b5d48=_0x5dcb04?_0x3d14c6['count']:_0x3a12fd[_0xa455('0x1f')]+_0x3a12fd[_0xa455('0x20')];var _0x2252f7;if(_0x4b5d48>=_0x34967a){_0x4b5d48=_0x34967a;_0x2252f7=0xc8;}else{_0x2252f7=0xce;}_0x16d9d5['status'](_0x2252f7);return _0x16d9d5[_0xa455('0x22')](_0xa455('0x23'),_0x53e54a+'-'+_0x4b5d48+'/'+_0x34967a)['json'](_0x3d14c6);}return null;};}function patchUpdates(_0x1cfa25){return function(_0x3b0d8d){try{jsonpatch[_0xa455('0x24')](_0x3b0d8d,_0x1cfa25,!![]);}catch(_0x3fc359){return BPromise[_0xa455('0x25')](_0x3fc359);}return _0x3b0d8d['save']();};}function saveUpdates(_0x308dd7,_0x5ce08f){return function(_0x12fa80){if(_0x12fa80){return _0x12fa80[_0xa455('0x26')](_0x308dd7)[_0xa455('0x27')](function(_0x56db1e){return _0x56db1e;});}return null;};}function removeEntity(_0x504ddb,_0x59d13d){return function(_0x559f8b){if(_0x559f8b){return _0x559f8b[_0xa455('0x28')]()['then'](function(){_0x504ddb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4704ba,_0x352087){return function(_0x2de353){if(!_0x2de353){_0x4704ba['sendStatus'](0x194);}return _0x2de353;};}function handleError(_0x4a5b35,_0x5053a8){_0x5053a8=_0x5053a8||0x1f4;return function(_0x18fd00){logger[_0xa455('0x29')](_0x18fd00[_0xa455('0x2a')]);if(_0x18fd00[_0xa455('0x2b')]){delete _0x18fd00[_0xa455('0x2b')];}_0x4a5b35[_0xa455('0x1d')](_0x5053a8)[_0xa455('0x2c')](_0x18fd00);};}exports[_0xa455('0x2d')]=function(_0x52f2c8,_0x4166d0){var _0x3f4e9e={},_0x2a4040={},_0x164cca={'count':0x0,'rows':[]};var _0x3eb68f=_[_0xa455('0x2e')](db[_0xa455('0x2f')][_0xa455('0x30')],function(_0x52615f){return{'name':_0x52615f[_0xa455('0x31')],'type':_0x52615f[_0xa455('0x32')]['key']};});_0x2a4040['model']=_['map'](_0x3eb68f,_0xa455('0x2b'));_0x2a4040[_0xa455('0x33')]=_[_0xa455('0x34')](_0x52f2c8[_0xa455('0x33')]);_0x2a4040['filters']=_[_0xa455('0x35')](_0x2a4040[_0xa455('0x36')],_0x2a4040[_0xa455('0x33')]);_0x3f4e9e[_0xa455('0x37')]=_[_0xa455('0x35')](_0x2a4040[_0xa455('0x36')],qs[_0xa455('0x38')](_0x52f2c8[_0xa455('0x33')][_0xa455('0x38')]));_0x3f4e9e[_0xa455('0x37')]=_0x3f4e9e[_0xa455('0x37')]['length']?_0x3f4e9e[_0xa455('0x37')]:_0x2a4040[_0xa455('0x36')];if(!_0x52f2c8['query'][_0xa455('0x39')](_0xa455('0x3a'))){_0x3f4e9e[_0xa455('0x20')]=qs[_0xa455('0x20')](_0x52f2c8[_0xa455('0x33')][_0xa455('0x20')]);_0x3f4e9e[_0xa455('0x1f')]=qs['offset'](_0x52f2c8[_0xa455('0x33')][_0xa455('0x1f')]);}_0x3f4e9e[_0xa455('0x3b')]=qs[_0xa455('0x3c')](_0x52f2c8[_0xa455('0x33')]['sort']);_0x3f4e9e[_0xa455('0x3d')]=qs[_0xa455('0x3e')](_['pick'](_0x52f2c8[_0xa455('0x33')],_0x2a4040[_0xa455('0x3e')]),_0x3eb68f);if(_0x52f2c8[_0xa455('0x33')][_0xa455('0x3f')]){_0x3f4e9e[_0xa455('0x3d')]=_[_0xa455('0x40')](_0x3f4e9e[_0xa455('0x3d')],{'$or':_[_0xa455('0x2e')](_0x3eb68f,function(_0x2d2928){if(_0x2d2928['type']!==_0xa455('0x41')){var _0x2c8baf={};_0x2c8baf[_0x2d2928['name']]={'$like':'%'+_0x52f2c8[_0xa455('0x33')]['filter']+'%'};return _0x2c8baf;}})});}_0x3f4e9e=_[_0xa455('0x40')]({},_0x3f4e9e,_0x52f2c8[_0xa455('0x42')]);var _0x596801={'where':_0x3f4e9e[_0xa455('0x3d')]};return db[_0xa455('0x2f')][_0xa455('0x21')](_0x596801)[_0xa455('0x27')](function(_0x26a58d){_0x164cca['count']=_0x26a58d;if(_0x52f2c8[_0xa455('0x33')][_0xa455('0x43')]){_0x3f4e9e[_0xa455('0x44')]=[{'all':!![]}];}return db[_0xa455('0x2f')][_0xa455('0x45')](_0x3f4e9e);})[_0xa455('0x27')](function(_0x32480b){_0x164cca['rows']=_0x32480b;return _0x164cca;})[_0xa455('0x27')](respondWithFilteredResult(_0x4166d0,_0x3f4e9e))[_0xa455('0x46')](handleError(_0x4166d0,null));};exports[_0xa455('0x47')]=function(_0x5d90ab,_0x10960b){var _0x5f263e={'raw':!![],'where':{'id':_0x5d90ab[_0xa455('0x48')]['id']}},_0x18da34={};_0x18da34[_0xa455('0x36')]=_[_0xa455('0x34')](db[_0xa455('0x2f')][_0xa455('0x30')]);_0x18da34['query']=_[_0xa455('0x34')](_0x5d90ab['query']);_0x18da34[_0xa455('0x3e')]=_[_0xa455('0x35')](_0x18da34['model'],_0x18da34[_0xa455('0x33')]);_0x5f263e[_0xa455('0x37')]=_[_0xa455('0x35')](_0x18da34[_0xa455('0x36')],qs[_0xa455('0x38')](_0x5d90ab[_0xa455('0x33')][_0xa455('0x38')]));_0x5f263e['attributes']=_0x5f263e['attributes']['length']?_0x5f263e['attributes']:_0x18da34[_0xa455('0x36')];if(_0x5d90ab['query'][_0xa455('0x43')]){_0x5f263e['include']=[{'all':!![]}];}_0x5f263e=_['merge']({},_0x5f263e,_0x5d90ab[_0xa455('0x42')]);return db[_0xa455('0x2f')]['find'](_0x5f263e)[_0xa455('0x27')](handleEntityNotFound(_0x10960b,null))[_0xa455('0x27')](respondWithResult(_0x10960b,null))[_0xa455('0x46')](handleError(_0x10960b,null));};exports[_0xa455('0x49')]=function(_0x7ae61,_0x4811d1){return db[_0xa455('0x2f')][_0xa455('0x49')](_0x7ae61[_0xa455('0x4a')],{})[_0xa455('0x27')](respondWithResult(_0x4811d1,0xc9))[_0xa455('0x46')](handleError(_0x4811d1,null));};exports[_0xa455('0x26')]=function(_0x4a5002,_0x2d4012){if(_0x4a5002[_0xa455('0x4a')]['id']){delete _0x4a5002[_0xa455('0x4a')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x4a5002[_0xa455('0x48')]['id']}})[_0xa455('0x27')](handleEntityNotFound(_0x2d4012,null))[_0xa455('0x27')](saveUpdates(_0x4a5002[_0xa455('0x4a')],null))[_0xa455('0x27')](respondWithResult(_0x2d4012,null))['catch'](handleError(_0x2d4012,null));};exports[_0xa455('0x28')]=function(_0x21100b,_0x19b80a){return db[_0xa455('0x2f')]['find']({'where':{'id':_0x21100b[_0xa455('0x48')]['id']}})['then'](handleEntityNotFound(_0x19b80a,null))[_0xa455('0x27')](removeEntity(_0x19b80a,null))[_0xa455('0x46')](handleError(_0x19b80a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index ce255d7..1faba1b 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 _0xa6e6=['lodash','../../config/logger','api','moment','bluebird','path','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6e6,0x1ee));var _0x6a6e=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xa6e6[_0x589aee];return _0x2f5ed4;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var logger=require(_0x6a6e('0x1'))(_0x6a6e('0x2'));var moment=require(_0x6a6e('0x3'));var BPromise=require(_0x6a6e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a6e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a6e('0x6'));module[_0x6a6e('0x7')]=function(_0xf525d,_0x55c886){return _0xf525d[_0x6a6e('0x8')](_0x6a6e('0x9'),attributes,{'tableName':_0x6a6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a6e('0xb'),'collate':_0x6a6e('0xc')});}; \ No newline at end of file +var _0x2f87=['../../config/logger','api','moment','bluebird','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x254849,_0x321ff6){var _0x4f73d1=function(_0x489d88){while(--_0x489d88){_0x254849['push'](_0x254849['shift']());}};_0x4f73d1(++_0x321ff6);}(_0x2f87,0x124));var _0x72f8=function(_0x24b707,_0x1152a9){_0x24b707=_0x24b707-0x0;var _0x256e0b=_0x2f87[_0x24b707];return _0x256e0b;};'use strict';var _=require(_0x72f8('0x0'));var util=require(_0x72f8('0x1'));var logger=require(_0x72f8('0x2'))(_0x72f8('0x3'));var moment=require(_0x72f8('0x4'));var BPromise=require(_0x72f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72f8('0x6'));var attributes=require(_0x72f8('0x7'));module[_0x72f8('0x8')]=function(_0x3f3745,_0x1318b1){return _0x3f3745[_0x72f8('0x9')](_0x72f8('0xa'),attributes,{'tableName':_0x72f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x72f8('0xc'),'collate':_0x72f8('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7a88c4a..2ede84b 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 _0xef96=['request\x20sent','debug','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','options','raw','attributes','limit','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0xef96,0xf7));var _0x6ef9=function(_0x29938f,_0x1fb6df){_0x29938f=_0x29938f-0x0;var _0x5e768c=_0xef96[_0x29938f];return _0x5e768c;};'use strict';var _=require(_0x6ef9('0x0'));var util=require(_0x6ef9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ef9('0x2'));var db=require(_0x6ef9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ef9('0x4'));var config=require(_0x6ef9('0x5'));var jayson=require(_0x6ef9('0x6'));var client=jayson[_0x6ef9('0x7')][_0x6ef9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3634dd,_0x211e86,_0x42ca33){return new BPromise(function(_0x13b7b0,_0x199bf6){return client[_0x6ef9('0x9')](_0x3634dd,_0x42ca33)[_0x6ef9('0xa')](function(_0x907ed0){logger[_0x6ef9('0xb')](_0x6ef9('0xc'),_0x211e86,_0x6ef9('0xd'));logger[_0x6ef9('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x211e86,'request\x20sent',JSON[_0x6ef9('0xf')](_0x907ed0));if(_0x907ed0[_0x6ef9('0x10')]){if(_0x907ed0[_0x6ef9('0x10')][_0x6ef9('0x11')]===0x1f4){logger[_0x6ef9('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x211e86,_0x907ed0[_0x6ef9('0x10')][_0x6ef9('0x12')]);return _0x199bf6(_0x907ed0['error']['message']);}logger['error'](_0x6ef9('0xc'),_0x211e86,_0x907ed0['error'][_0x6ef9('0x12')]);return _0x13b7b0(_0x907ed0[_0x6ef9('0x10')][_0x6ef9('0x12')]);}else{logger[_0x6ef9('0xb')](_0x6ef9('0xc'),_0x211e86,_0x6ef9('0xd'));_0x13b7b0(_0x907ed0[_0x6ef9('0x13')][_0x6ef9('0x12')]);}})['catch'](function(_0x512fc4){logger[_0x6ef9('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x211e86,_0x512fc4);_0x199bf6(_0x512fc4);});});}exports[_0x6ef9('0x14')]=function(_0x4febb5){var _0x33e559=this;return new Promise(function(_0x23dad4,_0x1676eb){return db[_0x6ef9('0x15')]['update'](_0x4febb5['body'],{'raw':_0x4febb5[_0x6ef9('0x16')]?_0x4febb5[_0x6ef9('0x16')][_0x6ef9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4febb5[_0x6ef9('0x16')]?_0x4febb5['options']['where']||null:null,'attributes':_0x4febb5[_0x6ef9('0x16')]?_0x4febb5['options'][_0x6ef9('0x18')]||null:null,'limit':_0x4febb5[_0x6ef9('0x16')]?_0x4febb5[_0x6ef9('0x16')][_0x6ef9('0x19')]||null:null})[_0x6ef9('0xa')](function(_0xb51d11){logger[_0x6ef9('0xb')](_0x6ef9('0x14'),_0x4febb5);logger[_0x6ef9('0xe')](_0x6ef9('0x14'),_0x4febb5,JSON[_0x6ef9('0xf')](_0xb51d11));_0x23dad4(_0xb51d11);})['catch'](function(_0x654859){logger[_0x6ef9('0x10')](_0x6ef9('0x14'),_0x654859[_0x6ef9('0x12')],_0x4febb5);_0x1676eb(_0x33e559[_0x6ef9('0x10')](0x1f4,_0x654859[_0x6ef9('0x12')]));});});}; \ No newline at end of file +var _0xbfac=['where','limit','info','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw'];(function(_0x47bf43,_0x4f8dd4){var _0x570bac=function(_0x13415f){while(--_0x13415f){_0x47bf43['push'](_0x47bf43['shift']());}};_0x570bac(++_0x4f8dd4);}(_0xbfac,0x67));var _0xcbfa=function(_0x5499d9,_0x1abd4f){_0x5499d9=_0x5499d9-0x0;var _0x52054c=_0xbfac[_0x5499d9];return _0x52054c;};'use strict';var _=require('lodash');var util=require(_0xcbfa('0x0'));var moment=require(_0xcbfa('0x1'));var BPromise=require(_0xcbfa('0x2'));var rs=require(_0xcbfa('0x3'));var fs=require('fs');var Redis=require(_0xcbfa('0x4'));var db=require(_0xcbfa('0x5'))['db'];var utils=require(_0xcbfa('0x6'));var logger=require(_0xcbfa('0x7'))(_0xcbfa('0x8'));var config=require(_0xcbfa('0x9'));var jayson=require(_0xcbfa('0xa'));var client=jayson[_0xcbfa('0xb')][_0xcbfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22ae64,_0x1f9999,_0x549742){return new BPromise(function(_0x1fa56d,_0x4c1e3f){return client[_0xcbfa('0xd')](_0x22ae64,_0x549742)['then'](function(_0x924029){logger['info'](_0xcbfa('0xe'),_0x1f9999,'request\x20sent');logger['debug'](_0xcbfa('0xf'),_0x1f9999,_0xcbfa('0x10'),JSON[_0xcbfa('0x11')](_0x924029));if(_0x924029[_0xcbfa('0x12')]){if(_0x924029[_0xcbfa('0x12')][_0xcbfa('0x13')]===0x1f4){logger['error'](_0xcbfa('0xe'),_0x1f9999,_0x924029[_0xcbfa('0x12')]['message']);return _0x4c1e3f(_0x924029['error']['message']);}logger[_0xcbfa('0x12')](_0xcbfa('0xe'),_0x1f9999,_0x924029[_0xcbfa('0x12')][_0xcbfa('0x14')]);return _0x1fa56d(_0x924029[_0xcbfa('0x12')][_0xcbfa('0x14')]);}else{logger['info'](_0xcbfa('0xe'),_0x1f9999,'request\x20sent');_0x1fa56d(_0x924029[_0xcbfa('0x15')]['message']);}})[_0xcbfa('0x16')](function(_0x384fec){logger[_0xcbfa('0x12')](_0xcbfa('0xe'),_0x1f9999,_0x384fec);_0x4c1e3f(_0x384fec);});});}exports[_0xcbfa('0x17')]=function(_0x481275){var _0x10f48e=this;return new Promise(function(_0x4b2118,_0x2a712f){return db[_0xcbfa('0x18')][_0xcbfa('0x19')](_0x481275[_0xcbfa('0x1a')],{'raw':_0x481275['options']?_0x481275[_0xcbfa('0x1b')][_0xcbfa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481275[_0xcbfa('0x1b')]?_0x481275[_0xcbfa('0x1b')][_0xcbfa('0x1d')]||null:null,'attributes':_0x481275['options']?_0x481275[_0xcbfa('0x1b')]['attributes']||null:null,'limit':_0x481275[_0xcbfa('0x1b')]?_0x481275[_0xcbfa('0x1b')][_0xcbfa('0x1e')]||null:null})['then'](function(_0x12398e){logger[_0xcbfa('0x1f')](_0xcbfa('0x17'),_0x481275);logger[_0xcbfa('0x20')](_0xcbfa('0x17'),_0x481275,JSON[_0xcbfa('0x11')](_0x12398e));_0x4b2118(_0x12398e);})[_0xcbfa('0x16')](function(_0x53c7f3){logger['error'](_0xcbfa('0x17'),_0x53c7f3['message'],_0x481275);_0x2a712f(_0x10f48e[_0xcbfa('0x12')](0x1f4,_0x53c7f3[_0xcbfa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c8f4269..b27cbd0 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 _0xa614=['put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','openchannel'];(function(_0x5cd16f,_0x185360){var _0x521bff=function(_0x2b96b1){while(--_0x2b96b1){_0x5cd16f['push'](_0x5cd16f['shift']());}};_0x521bff(++_0x185360);}(_0xa614,0x133));var _0x4a61=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa614[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0x4a61('0x0'));var util=require(_0x4a61('0x1'));var path=require(_0x4a61('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a61('0x3'));var router=express[_0x4a61('0x4')]();var fs_extra=require(_0x4a61('0x5'));var auth=require(_0x4a61('0x6'));var interaction=require(_0x4a61('0x7'));var config=require(_0x4a61('0x8'));var controller=require(_0x4a61('0x9'));router['get']('/',auth[_0x4a61('0xa')](),controller['index']);router[_0x4a61('0xb')](_0x4a61('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4a61('0xd'),auth[_0x4a61('0xa')](),controller[_0x4a61('0xe')]);router[_0x4a61('0xb')](_0x4a61('0xf'),auth[_0x4a61('0xa')](),controller[_0x4a61('0x10')]);router[_0x4a61('0xb')](_0x4a61('0x11'),auth[_0x4a61('0xa')](),controller[_0x4a61('0x12')]);router[_0x4a61('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4a61('0xf'),auth[_0x4a61('0xa')](),controller['addMessage']);router[_0x4a61('0x13')](_0x4a61('0x14'),auth[_0x4a61('0xa')](),interaction[_0x4a61('0x15')](_0x4a61('0x16'),'openchannelinteraction:addtags'),controller['addTags']);router[_0x4a61('0x17')](_0x4a61('0xd'),auth[_0x4a61('0xa')](),interaction[_0x4a61('0x15')](_0x4a61('0x16'),_0x4a61('0x18')),controller[_0x4a61('0x19')]);router[_0x4a61('0x1a')](_0x4a61('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x4a61('0x16'),_0x4a61('0x1b')),controller[_0x4a61('0x1c')]);router[_0x4a61('0x1a')](_0x4a61('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4a61('0x1d')]=router; \ No newline at end of file +var _0x22cb=['/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x478264,_0x354250){var _0x3d29e0=function(_0x208ed9){while(--_0x208ed9){_0x478264['push'](_0x478264['shift']());}};_0x3d29e0(++_0x354250);}(_0x22cb,0x17e));var _0xb22c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x22cb[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xb22c('0x0'));var util=require(_0xb22c('0x1'));var path=require(_0xb22c('0x2'));var timeout=require(_0xb22c('0x3'));var express=require(_0xb22c('0x4'));var router=express[_0xb22c('0x5')]();var fs_extra=require(_0xb22c('0x6'));var auth=require(_0xb22c('0x7'));var interaction=require(_0xb22c('0x8'));var config=require(_0xb22c('0x9'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xb22c('0xa')](),controller['index']);router[_0xb22c('0xb')](_0xb22c('0xc'),auth[_0xb22c('0xa')](),controller[_0xb22c('0xd')]);router[_0xb22c('0xb')](_0xb22c('0xe'),auth[_0xb22c('0xa')](),controller[_0xb22c('0xf')]);router[_0xb22c('0xb')](_0xb22c('0x10'),auth[_0xb22c('0xa')](),controller[_0xb22c('0x11')]);router['get'](_0xb22c('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xb22c('0xa')](),controller[_0xb22c('0x13')]);router[_0xb22c('0x14')](_0xb22c('0x10'),auth[_0xb22c('0xa')](),controller[_0xb22c('0x15')]);router['post'](_0xb22c('0x16'),auth['isAuthenticated'](),interaction[_0xb22c('0x17')](_0xb22c('0x18'),_0xb22c('0x19')),controller[_0xb22c('0x1a')]);router[_0xb22c('0x1b')]('/:id',auth[_0xb22c('0xa')](),interaction[_0xb22c('0x17')](_0xb22c('0x18'),'openchannelinteraction:update'),controller[_0xb22c('0x1c')]);router[_0xb22c('0x1d')](_0xb22c('0xe'),auth[_0xb22c('0xa')](),interaction['tracked'](_0xb22c('0x18'),_0xb22c('0x1e')),controller[_0xb22c('0x1f')]);router['delete'](_0xb22c('0x16'),auth[_0xb22c('0xa')](),controller['removeTags']);module[_0xb22c('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index c1fcccf..9d35ad9 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 _0x26ac=['DATE','out','exports','BOOLEAN','STRING'];(function(_0x1c8a8d,_0x167d05){var _0x7b3cc4=function(_0x171b3a){while(--_0x171b3a){_0x1c8a8d['push'](_0x1c8a8d['shift']());}};_0x7b3cc4(++_0x167d05);}(_0x26ac,0x106));var _0xc26a=function(_0x38c466,_0x43665d){_0x38c466=_0x38c466-0x0;var _0x401461=_0x26ac[_0x38c466];return _0x401461;};'use strict';var Sequelize=require('sequelize');module[_0xc26a('0x0')]={'closed':{'type':Sequelize[_0xc26a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc26a('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc26a('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc26a('0x2')]},'lastMsgAt':{'type':Sequelize[_0xc26a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc26a('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc26a('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xc26a('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x121d=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x55b10f,_0x216487){var _0x1727a3=function(_0x3a387e){while(--_0x3a387e){_0x55b10f['push'](_0x55b10f['shift']());}};_0x1727a3(++_0x216487);}(_0x121d,0xea));var _0xd121=function(_0x45fa2a,_0x2762f4){_0x45fa2a=_0x45fa2a-0x0;var _0x1eaa4d=_0x121d[_0x45fa2a];return _0x1eaa4d;};'use strict';var Sequelize=require(_0xd121('0x0'));module[_0xd121('0x1')]={'closed':{'type':Sequelize[_0xd121('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd121('0x3')]},'disposition':{'type':Sequelize[_0xd121('0x4')]},'secondDisposition':{'type':Sequelize[_0xd121('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd121('0x4')]},'note':{'type':Sequelize[_0xd121('0x4')]},'read1stAt':{'type':Sequelize[_0xd121('0x3')]},'threadId':{'type':Sequelize[_0xd121('0x4')]},'externalUrl':{'type':Sequelize[_0xd121('0x4')]},'lastMsgAt':{'type':Sequelize[_0xd121('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd121('0x5')]('in',_0xd121('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xd121('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index dd8614d..b3f8089 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 _0xe5d1=['filters','pick','field','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','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','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','text','start','body','keys','some','compact','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','includeAll','include','options','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','join','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','secret','get','mkdirSync','Openchannel','Owner','N.A.','closedAt','disposition','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','System','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','error','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0xe5d1,0xb5));var _0x1e5d=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0xe5d1[_0x36b400];return _0x4d47bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e5d('0x0'));var jsonpatch=require(_0x1e5d('0x1'));var rp=require(_0x1e5d('0x2'));var moment=require(_0x1e5d('0x3'));var BPromise=require(_0x1e5d('0x4'));var Mustache=require(_0x1e5d('0x5'));var util=require('util');var path=require(_0x1e5d('0x6'));var sox=require(_0x1e5d('0x7'));var csv=require(_0x1e5d('0x8'));var ejs=require(_0x1e5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e5d('0xa'));var squel=require(_0x1e5d('0xb'));var crypto=require(_0x1e5d('0xc'));var jsforce=require(_0x1e5d('0xd'));var deskjs=require(_0x1e5d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e5d('0xf'));var Papa=require(_0x1e5d('0x10'));var Redis=require(_0x1e5d('0x11'));var authService=require(_0x1e5d('0x12'));var qs=require(_0x1e5d('0x13'));var as=require(_0x1e5d('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1e5d('0x15'));var logger=require(_0x1e5d('0x16'))('api');var utils=require(_0x1e5d('0x17'));var config=require(_0x1e5d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e5d('0x19'))['db'];config[_0x1e5d('0x1a')]=_[_0x1e5d('0x1b')](config[_0x1e5d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e5d('0x1c'))(new Redis(config[_0x1e5d('0x1a')]));require('./openchannelInteraction.socket')[_0x1e5d('0x1d')](socket);function respondWithStatusCode(_0x488d21,_0x2528e4){_0x2528e4=_0x2528e4||0xcc;return function(_0x129f06){if(_0x129f06){return _0x488d21[_0x1e5d('0x1e')](_0x2528e4);}return _0x488d21[_0x1e5d('0x1f')](_0x2528e4)[_0x1e5d('0x20')]();};}function respondWithResult(_0xbffa85,_0x398677){_0x398677=_0x398677||0xc8;return function(_0x378052){if(_0x378052){return _0xbffa85[_0x1e5d('0x1f')](_0x398677)[_0x1e5d('0x21')](_0x378052);}};}function respondWithFilteredResult(_0x2e2fa3,_0x4f1429){return function(_0x41d66a){if(_0x41d66a){var _0x5e65d8=typeof _0x4f1429[_0x1e5d('0x22')]===_0x1e5d('0x23')&&typeof _0x4f1429[_0x1e5d('0x24')]===_0x1e5d('0x23');var _0x22623d=_0x41d66a['count'];var _0x1dfdcf=_0x5e65d8?0x0:_0x4f1429[_0x1e5d('0x22')];var _0x578f6e=_0x5e65d8?_0x41d66a[_0x1e5d('0x25')]:_0x4f1429['offset']+_0x4f1429['limit'];var _0x3a063f;if(_0x578f6e>=_0x22623d){_0x578f6e=_0x22623d;_0x3a063f=0xc8;}else{_0x3a063f=0xce;}_0x2e2fa3[_0x1e5d('0x1f')](_0x3a063f);return _0x2e2fa3[_0x1e5d('0x26')](_0x1e5d('0x27'),_0x1dfdcf+'-'+_0x578f6e+'/'+_0x22623d)[_0x1e5d('0x21')](_0x41d66a);}return null;};}function patchUpdates(_0x3a4209){return function(_0x378bd3){try{jsonpatch['apply'](_0x378bd3,_0x3a4209,!![]);}catch(_0x2d9d12){return BPromise['reject'](_0x2d9d12);}return _0x378bd3['save']();};}function saveUpdates(_0x389e3e,_0x51a7fc){return function(_0x4302c4){if(_0x4302c4){return _0x4302c4['update'](_0x389e3e)['then'](function(_0x2a254b){return _0x2a254b;});}return null;};}function removeEntity(_0x4ee88f,_0x24ea9c){return function(_0x40af90){if(_0x40af90){return _0x40af90[_0x1e5d('0x28')]()[_0x1e5d('0x29')](function(){_0x4ee88f[_0x1e5d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493b3c,_0x278660){return function(_0x7d222){if(!_0x7d222){_0x493b3c['sendStatus'](0x194);}return _0x7d222;};}function handleError(_0x4aeb83,_0x3cb36a){_0x3cb36a=_0x3cb36a||0x1f4;return function(_0x1beef7){logger[_0x1e5d('0x2a')](_0x1beef7['stack']);if(_0x1beef7[_0x1e5d('0x2b')]){delete _0x1beef7['name'];}_0x4aeb83[_0x1e5d('0x1f')](_0x3cb36a)['send'](_0x1beef7);};}function getInteractionUsers(_0x499f5b,_0x4aee46){return new BPromise(function(_0x22129e,_0x1d9f6a){try{if(_0x4aee46[_0x499f5b['id']]){_0x499f5b[_0x1e5d('0x2c')]=_[_0x1e5d('0x2d')](_0x4aee46[_0x499f5b['id']],function(_0x20619c){return{'id':_0x20619c['id'],'fullname':_0x20619c[_0x1e5d('0x2e')]};});}}catch(_0x4e581f){_0x1d9f6a(_0x4e581f);}_0x22129e(_0x499f5b);});}function getInteractionTags(_0x5608fb,_0x73177d){return new BPromise(function(_0x1a55e7,_0x24832b){try{if(_0x5608fb[_0x1e5d('0x2f')]){_0x5608fb[_0x1e5d('0x30')]=[];_0x5608fb[_0x1e5d('0x2f')]['split'](',')[_0x1e5d('0x31')](function(_0x5761e9){_0x5608fb[_0x1e5d('0x30')][_0x1e5d('0x32')](_0x73177d[_0x5761e9]);});}delete _0x5608fb[_0x1e5d('0x2f')];}catch(_0x18641f){_0x24832b(_0x18641f);}_0x1a55e7(_0x5608fb);});}function updateOpenchannelInteraction(_0x324c81,_0x9f895e,_0x17b7dd){return new BPromise(function(_0x7c14ac,_0x3664cd){return getInteractionUsers(_0x324c81,_0x17b7dd)[_0x1e5d('0x29')](function(_0x265b42){return getInteractionTags(_0x265b42,_0x9f895e);})[_0x1e5d('0x29')](function(_0x2a7581){return getStateInteraction(_0x2a7581);})[_0x1e5d('0x29')](function(_0x58976c){_0x7c14ac(_0x58976c);})[_0x1e5d('0x33')](function(_0x348868){_0x3664cd(_0x348868);});});}function getStateInteraction(_0x54b7f3){return new BPromise(function(_0x3270cf){_0x54b7f3[_0x1e5d('0x34')]=0x0;_0x54b7f3[_0x1e5d('0x35')]=0x0;_0x54b7f3[_0x1e5d('0x36')]=0x0;_0x54b7f3[_0x1e5d('0x37')]=0x0;_0x54b7f3[_0x1e5d('0x38')]=0x0;if(!_0x54b7f3[_0x1e5d('0x39')]&&!_0x54b7f3[_0x1e5d('0x3a')]){_0x54b7f3['waiting']+=0x1;}if(!_0x54b7f3['closed']&&_0x54b7f3['UserId']){_0x54b7f3[_0x1e5d('0x35')]+=0x1;if(_0x54b7f3[_0x1e5d('0x34')]){_0x54b7f3[_0x1e5d('0x34')]-=0x1;}}if(_0x54b7f3[_0x1e5d('0x39')]&&_0x54b7f3[_0x1e5d('0x3a')]){_0x54b7f3[_0x1e5d('0x36')]+=0x1;if(_0x54b7f3[_0x1e5d('0x35')]){_0x54b7f3[_0x1e5d('0x35')]-=0x1;}}if(_0x54b7f3['closed']&&!_0x54b7f3['UserId']){_0x54b7f3[_0x1e5d('0x37')]+=0x1;if(_0x54b7f3[_0x1e5d('0x34')]){_0x54b7f3[_0x1e5d('0x34')]-=0x1;}}_0x54b7f3[_0x1e5d('0x38')]+=0x1;_0x3270cf(_0x54b7f3);});}exports[_0x1e5d('0x3b')]=function(_0x574918,_0x5af027){var _0xdfe356={},_0x4aa4a4={},_0x28c721={'count':0x0,'rows':[]};var _0x19a9b8=_[_0x1e5d('0x2d')](db[_0x1e5d('0x3c')][_0x1e5d('0x3d')],function(_0x576179){return{'name':_0x576179[_0x1e5d('0x3e')],'type':_0x576179['type']['key']};});_0x4aa4a4[_0x1e5d('0x3f')]=_['map'](_0x19a9b8,_0x1e5d('0x2b'));_0x4aa4a4[_0x1e5d('0x40')]=_['keys'](_0x574918[_0x1e5d('0x40')]);_0x4aa4a4['filters']=_[_0x1e5d('0x41')](_0x4aa4a4[_0x1e5d('0x3f')],_0x4aa4a4[_0x1e5d('0x40')]);_0xdfe356[_0x1e5d('0x42')]=_[_0x1e5d('0x41')](_0x4aa4a4[_0x1e5d('0x3f')],qs[_0x1e5d('0x43')](_0x574918[_0x1e5d('0x40')]['fields']));_0xdfe356['attributes']=_0xdfe356[_0x1e5d('0x42')][_0x1e5d('0x44')]?_0xdfe356[_0x1e5d('0x42')]:_0x4aa4a4[_0x1e5d('0x3f')];if(!_0x574918[_0x1e5d('0x40')][_0x1e5d('0x45')]('nolimit')){_0xdfe356[_0x1e5d('0x24')]=qs[_0x1e5d('0x24')](_0x574918['query'][_0x1e5d('0x24')]);_0xdfe356['offset']=qs['offset'](_0x574918[_0x1e5d('0x40')][_0x1e5d('0x22')]);}_0xdfe356['order']=qs[_0x1e5d('0x46')](_0x574918['query'][_0x1e5d('0x46')]);_0xdfe356['where']=qs[_0x1e5d('0x47')](_[_0x1e5d('0x48')](_0x574918[_0x1e5d('0x40')],_0x4aa4a4[_0x1e5d('0x47')]),_0x19a9b8);var _0x3d9437=[];var _0x13d33c=squel['select']()[_0x1e5d('0x49')]('id')['field'](_0x1e5d('0x2b'))[_0x1e5d('0x49')]('color')[_0x1e5d('0x4a')](_0x1e5d('0x4b'));var _0x48cb70=squel[_0x1e5d('0x4c')]()[_0x1e5d('0x49')](_0x1e5d('0x4d'))['field'](_0x1e5d('0x4e'))['field'](_0x1e5d('0x4f'))[_0x1e5d('0x4a')](_0x1e5d('0x50'),'ui')[_0x1e5d('0x51')](_0x1e5d('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x908586=squel[_0x1e5d('0x4c')]()[_0x1e5d('0x4a')](_0x1e5d('0x53'),'i')[_0x1e5d('0x51')](_0x1e5d('0x54'),'c',_0x1e5d('0x55'))[_0x1e5d('0x51')]('users','o',_0x1e5d('0x56'))[_0x1e5d('0x51')](_0x1e5d('0x57'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x1e5d('0x51')](_0x1e5d('0x58'),'me',_0x1e5d('0x59'))[_0x1e5d('0x51')](_0x1e5d('0x5a'),'it',_0x1e5d('0x5b'))[_0x1e5d('0x51')](_0x1e5d('0x4b'),'t',_0x1e5d('0x5c'));var _0xca3761=squel[_0x1e5d('0x5d')]();var _0x241944=[];var _0x215119=squel[_0x1e5d('0x5d')]();var _0xed2dc3;if(_0x574918[_0x1e5d('0x40')]['search']){_0xed2dc3=as[_0x1e5d('0x5e')](_0x574918['query']['search']);var _0x479a89=_0xed2dc3[_0x1e5d('0x5f')];for(var _0x5403a6=0x0;_0x5403a6<_0xed2dc3[_0x1e5d('0x60')][_0x1e5d('0x44')];_0x5403a6++){var _0x2afde1=_0xed2dc3[_0x1e5d('0x60')][_0x5403a6];var _0x17311b='i';var _0x3bedda=_['find'](_0x19a9b8,['name',_0x2afde1[_0x1e5d('0x49')]]);if(!_0x3bedda){switch(_0x2afde1[_0x1e5d('0x49')]){case _0x1e5d('0x61'):if(_0x2afde1[_0x1e5d('0x62')]==0x1){_0x908586['having']('`'+_0x2afde1[_0x1e5d('0x49')]+_0x1e5d('0x63'));}else{_0x908586['having']('`'+_0x2afde1['field']+_0x1e5d('0x64'));}break;case _0x1e5d('0x65'):if(_0x2afde1[_0x1e5d('0x66')]===_0x1e5d('0x67')){if(_0x2afde1[_0x1e5d('0x62')][_0x1e5d('0x68')]('\x20')[_0x1e5d('0x44')]>0x1){_0xca3761[_0x479a89](_0x1e5d('0x69'),qs['getFullTextValue'](_0x2afde1[_0x1e5d('0x62')]),null);}else{var _0x24b156='%'+_0x2afde1['value']+'%';_0xca3761[_0x479a89](_0x1e5d('0x6a'),_0x24b156,_0x24b156,_0x24b156);}}else{_0x3bedda=_['find'](_0x19a9b8,['name',_0x1e5d('0x6b')]);_0x2afde1[_0x1e5d('0x49')]=_0x1e5d('0x6b');_0x53d6cb=as[_0x1e5d('0x6c')](_0x17311b,_0x3bedda[_0x1e5d('0x6d')],_0x2afde1);_0xca3761[_0x479a89](_0x53d6cb['text'],_0x53d6cb[_0x1e5d('0x62')]['start'],_0x53d6cb[_0x1e5d('0x62')]['end']);}break;case _0x1e5d('0x6e'):var _0x270697=_0x2afde1['value']['split'](',')[_0x1e5d('0x2d')](function(_0x5b8eb8){return Number(_0x5b8eb8);});_0x270697[_0x1e5d('0x31')](function(_0xaa3175){_0x215119['or'](_0x1e5d('0x6f'),'%,'+_0xaa3175+',%');});_0x241944=_[_0x1e5d('0x70')](_0x241944,_0x270697);break;case _0x1e5d('0x71'):if(_0x2afde1[_0x1e5d('0x66')]===_0x1e5d('0x67')){_0xca3761[_0x479a89](_0x1e5d('0x72'),'%'+_0x2afde1[_0x1e5d('0x62')]+'%',null);}else{_0x3bedda=_[_0x1e5d('0x73')](_0x19a9b8,[_0x1e5d('0x2b'),_0x1e5d('0x3a')]);_0x2afde1[_0x1e5d('0x49')]='UserId';_0x53d6cb=as[_0x1e5d('0x6c')](_0x17311b,_0x3bedda['type'],_0x2afde1);_0xca3761[_0x479a89](_0x53d6cb[_0x1e5d('0x74')],_0x53d6cb['value'][_0x1e5d('0x75')],_0x53d6cb[_0x1e5d('0x62')][_0x1e5d('0x20')]);}break;case _0x1e5d('0x76'):_0x53d6cb=as[_0x1e5d('0x6c')]('me',null,_0x2afde1);_0xca3761[_0x479a89](_0x53d6cb[_0x1e5d('0x74')],_0x53d6cb[_0x1e5d('0x62')][_0x1e5d('0x75')],_0x53d6cb['value'][_0x1e5d('0x20')]);break;}}else{var _0x53d6cb=as['buildExpression'](_0x17311b,_0x3bedda[_0x1e5d('0x6d')],_0x2afde1);_0xca3761[_0x479a89](_0x53d6cb['text'],_0x53d6cb[_0x1e5d('0x62')][_0x1e5d('0x75')],_0x53d6cb['value']['end']);}}}else{var _0x5ac733=_(_0x574918[_0x1e5d('0x40')])[_0x1e5d('0x77')]()[_0x1e5d('0x2d')](function(_0x4ea801){return _[_0x1e5d('0x78')](_0x19a9b8,[_0x1e5d('0x2b'),_0x4ea801])?_0x4ea801:undefined;})[_0x1e5d('0x79')]()[_0x1e5d('0x62')]();if(!_['isEmpty'](_0x5ac733)){_0x5ac733[_0x1e5d('0x31')](function(_0x3b2dc9){if(_0x3b2dc9===_0x1e5d('0x7a')){_0x908586[_0x1e5d('0x7b')](_0x1e5d('0x7c'),[][_0x1e5d('0x7d')](_0x574918[_0x1e5d('0x40')][_0x3b2dc9]));}else if(_0x3b2dc9===_0x1e5d('0x7e')){var _0x3d9095=JSON[_0x1e5d('0x7f')](_0x574918['query'][_0x3b2dc9])[_0x1e5d('0x80')];var _0x10316a=JSON['parse'](_0x574918['query'][_0x3b2dc9])[_0x1e5d('0x81')];_0x908586[_0x1e5d('0x7b')](_0x1e5d('0x82'),_0x3d9095,_0x10316a);}else{if(_0x574918['query'][_0x3b2dc9]===_0x1e5d('0x83')){_0x908586[_0x1e5d('0x7b')]('i.'+_0x3b2dc9+_0x1e5d('0x84'));}else{_0x908586[_0x1e5d('0x7b')]('i.'+_0x3b2dc9+_0x1e5d('0x85'),_0x574918[_0x1e5d('0x40')][_0x3b2dc9]);}}});}if(_0x574918[_0x1e5d('0x40')][_0x1e5d('0x86')]){if(_0x574918[_0x1e5d('0x40')][_0x1e5d('0x86')]==0x1){_0x908586[_0x1e5d('0x87')]('`unreadMessages`\x20=\x200');}else{_0x908586[_0x1e5d('0x87')](_0x1e5d('0x88'));}}if(_0x574918['query'][_0x1e5d('0x89')]){_0x241944=_[_0x1e5d('0x8a')](_0x574918[_0x1e5d('0x40')][_0x1e5d('0x89')])?_0x574918[_0x1e5d('0x40')][_0x1e5d('0x89')]:new Array(_0x574918[_0x1e5d('0x40')]['tag']);_0x241944[_0x1e5d('0x31')](function(_0x40d26f){_0x215119['or'](_0x1e5d('0x6f'),'%,'+_0x40d26f+',%');});}if(_0x574918[_0x1e5d('0x40')]['filter']){var _0x234bc2=_0x574918[_0x1e5d('0x40')][_0x1e5d('0x8b')]['replace']('\x5c','\x5c\x5c')[_0x1e5d('0x8c')](/'/g,'\x27\x27');if(qs[_0x1e5d('0x8d')](_0x234bc2)){_0xca3761['or'](_0x1e5d('0x8e'),_0x234bc2+'%');}else{_0xca3761['or'](_0x1e5d('0x8f'),qs[_0x1e5d('0x90')](_0x234bc2))['or'](_0x1e5d('0x91'),_0x234bc2+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x234bc2+'%');}}}_0x908586[_0x1e5d('0x7b')](_0xca3761);_0x908586[_0x1e5d('0x92')](_0x1e5d('0x93'));var _0x2d8f97={'type':db[_0x1e5d('0x94')][_0x1e5d('0x95')]['SELECT'],'raw':!![]};var _0x4bcbc1=_0x908586[_0x1e5d('0x96')]();_0x4bcbc1[_0x1e5d('0x49')](_0x1e5d('0x93'));_0x4bcbc1[_0x1e5d('0x49')](_0x1e5d('0x97'),_0x1e5d('0x61'));if(_0xdfe356[_0x1e5d('0x98')]){_0xdfe356['order'][_0x1e5d('0x31')](function(_0x37248f){var _0x504e6e=_0x37248f[0x0]==='contactName'?_0x37248f[0x0]:'i.'+_0x37248f[0x0];_0x908586[_0x1e5d('0x98')](_0x504e6e,_0x37248f[0x1]===_0x1e5d('0x99')?![]:!![]);});}if(!_[_0x1e5d('0x9a')](_0x241944)){_0x908586['having'](_0x215119);_0x4bcbc1['where'](_0x1e5d('0x9b'),_0x241944);}BPromise[_0x1e5d('0x9c')]()['then'](function(){if(!_0xed2dc3){if(_0x574918['query']['OpenchannelAccountId'])return;_0x4bcbc1[_0x1e5d('0x7b')](_0x1e5d('0x9d'));_0x908586[_0x1e5d('0x7b')](_0x1e5d('0x9d'));return;}if(_0x574918[_0x1e5d('0x9e')][_0x1e5d('0x9f')]!=='agent')return;return _0x574918['user'][_0x1e5d('0xa0')]({'attributes':['id'],'raw':!![]})[_0x1e5d('0x29')](function(_0x160795){if(_[_0x1e5d('0x9a')](_0x160795)){_0x4bcbc1[_0x1e5d('0x7b')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x908586[_0x1e5d('0x7b')](_0x1e5d('0xa1'));}else{_0x4bcbc1[_0x1e5d('0x7b')](_0x1e5d('0x7c'),_[_0x1e5d('0x2d')](_0x160795,'id'));_0x908586[_0x1e5d('0x7b')](_0x1e5d('0x7c'),_['map'](_0x160795,'id'));}});})[_0x1e5d('0x29')](function(){if(_0x574918[_0x1e5d('0x9e')][_0x1e5d('0x9f')]===_0x1e5d('0xa2')&&!_0xed2dc3&&!_0x574918[_0x1e5d('0x40')]['OpenchannelAccountId'])return[];return db['sequelize'][_0x1e5d('0x40')](_0x4bcbc1['toString'](),_0x2d8f97);})[_0x1e5d('0x29')](function(_0x125343){_0x28c721['count']=_0x125343[_0x1e5d('0x44')];if(_0x28c721[_0x1e5d('0x25')]===0x0)return[];return db[_0x1e5d('0xa3')]['query'](_0x13d33c[_0x1e5d('0xa4')](),_0x2d8f97)[_0x1e5d('0x29')](function(_0x2b0820){_0x3d9437=_[_0x1e5d('0xa5')](_0x2b0820,'id');_0x2d8f97=_[_0x1e5d('0xa6')](_0x2d8f97,{'model':db[_0x1e5d('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x574918[_0x1e5d('0x40')][_0x1e5d('0x43')]){_0xdfe356[_0x1e5d('0x42')][_0x1e5d('0x31')](function(_0x3625fd){_0x908586['field']('i.'+_0x3625fd);});}else{_0x908586['field'](_0x1e5d('0x97'),_0x1e5d('0x61'));_0x908586[_0x1e5d('0x49')](_0x1e5d('0xa7'),_0x1e5d('0xa8'));_0x908586[_0x1e5d('0x49')](_0x1e5d('0xa9'),_0x1e5d('0xaa'));_0x908586[_0x1e5d('0x49')](_0x1e5d('0xab'),_0x1e5d('0xac'));_0x908586[_0x1e5d('0x49')](_0x1e5d('0xad'));_0x908586[_0x1e5d('0x49')]('c.firstName',_0x1e5d('0xae'));_0x908586['field'](_0x1e5d('0xaf'),_0x1e5d('0xb0'));_0x908586['field']('c.email',_0x1e5d('0xb1'));_0x908586['field'](_0x1e5d('0xb2'),'Contact.phone');_0x908586[_0x1e5d('0x49')]('c.mobile',_0x1e5d('0xb3'));_0x908586[_0x1e5d('0x49')]('c.fax',_0x1e5d('0xb4'));_0x908586[_0x1e5d('0x49')]('o.fullname',_0x1e5d('0xb5'));_0x908586[_0x1e5d('0x49')](_0x1e5d('0xb6'),_0x1e5d('0xb7'));_0x908586['field'](_0x1e5d('0xb8'),_0x1e5d('0x2f'));}if(_0xdfe356[_0x1e5d('0x24')])_0x908586[_0x1e5d('0x24')](_0xdfe356[_0x1e5d('0x24')]);if(_0xdfe356['offset'])_0x908586[_0x1e5d('0x22')](_0xdfe356['offset']);return db[_0x1e5d('0xa3')][_0x1e5d('0x40')](_0x908586['toString'](),_0x2d8f97);})[_0x1e5d('0x29')](function(_0x652bda){if(_0x652bda[_0x1e5d('0x44')]>0x0)_0x48cb70[_0x1e5d('0x7b')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x1e5d('0x2d')](_0x652bda,'id'));return db[_0x1e5d('0xa3')][_0x1e5d('0x40')](_0x48cb70[_0x1e5d('0xa4')](),_0x2d8f97)['then'](function(_0x345771){var _0xbcac0d=_[_0x1e5d('0xb9')](_0x345771,'OpenchannelInteractionId');var _0x37ae0d=[];_0x652bda[_0x1e5d('0x31')](function(_0x12c636){_0x37ae0d[_0x1e5d('0x32')](updateOpenchannelInteraction(_0x12c636,_0x3d9437,_0xbcac0d));});return BPromise[_0x1e5d('0xba')](_0x37ae0d);});});})[_0x1e5d('0x29')](function(_0x1efa9b){_0x28c721[_0x1e5d('0xbb')]=_0x1efa9b;return _0x28c721;})[_0x1e5d('0x29')](respondWithFilteredResult(_0x5af027,_0xdfe356))[_0x1e5d('0x33')](handleError(_0x5af027,null));};exports[_0x1e5d('0xbc')]=function(_0x668ca3,_0x350345){var _0x3d4bd8={};if(_0x668ca3[_0x1e5d('0x40')]['type']&&_0x668ca3[_0x1e5d('0x40')][_0x1e5d('0x6d')]==='from'){_0x3d4bd8['from']=_0x668ca3[_0x1e5d('0xbd')]['id'];}else{_0x3d4bd8['id']=_0x668ca3['params']['id'];}var _0x45d6a9={'raw':![],'where':_0x3d4bd8},_0x22f2be={};_0x22f2be['model']=_[_0x1e5d('0x77')](db[_0x1e5d('0x3c')][_0x1e5d('0x3d')]);_0x22f2be[_0x1e5d('0x40')]=_['keys'](_0x668ca3[_0x1e5d('0x40')]);_0x22f2be[_0x1e5d('0x47')]=_[_0x1e5d('0x41')](_0x22f2be[_0x1e5d('0x3f')],_0x22f2be[_0x1e5d('0x40')]);_0x45d6a9[_0x1e5d('0x42')]=_[_0x1e5d('0x41')](_0x22f2be['model'],qs[_0x1e5d('0x43')](_0x668ca3['query'][_0x1e5d('0x43')]));_0x45d6a9['attributes']=_0x45d6a9['attributes'][_0x1e5d('0x44')]?_0x45d6a9['attributes']:_0x22f2be[_0x1e5d('0x3f')];if(_0x668ca3[_0x1e5d('0x40')][_0x1e5d('0xbe')]){_0x45d6a9[_0x1e5d('0xbf')]=[{'all':!![]}];}_0x45d6a9=_[_0x1e5d('0xa6')]({},_0x45d6a9,_0x668ca3[_0x1e5d('0xc0')]);return db[_0x1e5d('0x3c')]['find'](_0x45d6a9)['then'](handleEntityNotFound(_0x350345,null))[_0x1e5d('0x29')](respondWithResult(_0x350345,null))[_0x1e5d('0x33')](handleError(_0x350345,null));};exports[_0x1e5d('0xc1')]=function(_0x59ab28,_0xc940b0){return db['OpenchannelInteraction'][_0x1e5d('0xc1')](_0x59ab28['body'],{})[_0x1e5d('0x29')](respondWithResult(_0xc940b0,0xc9))[_0x1e5d('0x33')](handleError(_0xc940b0,null));};exports[_0x1e5d('0xc2')]=function(_0x1f61c4,_0x4d1a1c){if(_0x1f61c4[_0x1e5d('0x76')]['id']){delete _0x1f61c4['body']['id'];}return db['OpenchannelInteraction'][_0x1e5d('0x73')]({'where':{'id':_0x1f61c4[_0x1e5d('0xbd')]['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x4d1a1c,null))[_0x1e5d('0x29')](saveUpdates(_0x1f61c4[_0x1e5d('0x76')],null))[_0x1e5d('0x29')](respondWithResult(_0x4d1a1c,null))['catch'](handleError(_0x4d1a1c,null));};exports[_0x1e5d('0x28')]=function(_0x59c6ea,_0x4adf4c){return db[_0x1e5d('0x3c')][_0x1e5d('0x73')]({'where':{'id':_0x59c6ea[_0x1e5d('0xbd')]['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x4adf4c,null))['then'](removeEntity(_0x4adf4c,null))[_0x1e5d('0x33')](handleError(_0x4adf4c,null));};exports[_0x1e5d('0xc3')]=function(_0x422f9c,_0x266a45){return db[_0x1e5d('0x3c')]['describe']()['then'](respondWithResult(_0x266a45,null))['catch'](handleError(_0x266a45,null));};exports[_0x1e5d('0xc4')]=function(_0x159ae7,_0x544496,_0xcb7d87){return db[_0x1e5d('0xc5')][_0x1e5d('0x73')]({'where':{'id':_0x159ae7['params']['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x544496,null))['then'](function(_0x2c340e){if(_0x2c340e){return _0x2c340e[_0x1e5d('0xc4')](_0x159ae7[_0x1e5d('0x76')][_0x1e5d('0xc6')],_[_0x1e5d('0xc7')](_0x159ae7[_0x1e5d('0x76')],[_0x1e5d('0xc6'),'id'])||{});}})[_0x1e5d('0x29')](respondWithResult(_0x544496,null))['catch'](handleError(_0x544496,null));};exports[_0x1e5d('0xc8')]=function(_0x4f4ac3,_0x2f4bc3,_0x53bafc){var _0x521994={'raw':![],'where':{}};var _0x557591={};var _0x218121={'count':0x0,'rows':[]};return db[_0x1e5d('0x3c')][_0x1e5d('0xc9')]({'where':{'id':_0x4f4ac3['params']['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x2f4bc3,null))[_0x1e5d('0x29')](function(_0x1aeeef){if(_0x1aeeef){_0x557591[_0x1e5d('0x3f')]=_['keys'](db[_0x1e5d('0xc5')][_0x1e5d('0x3d')]);_0x557591[_0x1e5d('0x40')]=_[_0x1e5d('0x77')](_0x4f4ac3[_0x1e5d('0x40')]);_0x557591['filters']=_[_0x1e5d('0x41')](_0x557591[_0x1e5d('0x3f')],_0x557591[_0x1e5d('0x40')]);_0x521994['attributes']=_['intersection'](_0x557591[_0x1e5d('0x3f')],qs['fields'](_0x4f4ac3['query'][_0x1e5d('0x43')]));_0x521994[_0x1e5d('0x42')]=_0x521994[_0x1e5d('0x42')][_0x1e5d('0x44')]?_0x521994['attributes']:_0x557591[_0x1e5d('0x3f')];if(!_0x4f4ac3[_0x1e5d('0x40')][_0x1e5d('0x45')](_0x1e5d('0xca'))){_0x521994[_0x1e5d('0x24')]=qs[_0x1e5d('0x24')](_0x4f4ac3['query'][_0x1e5d('0x24')]);_0x521994['offset']=qs[_0x1e5d('0x22')](_0x4f4ac3[_0x1e5d('0x40')][_0x1e5d('0x22')]);}_0x521994[_0x1e5d('0x98')]=qs[_0x1e5d('0x46')](_0x4f4ac3['query'][_0x1e5d('0x46')]);_0x521994['where']=qs[_0x1e5d('0x47')](_[_0x1e5d('0x48')](_0x4f4ac3[_0x1e5d('0x40')],_0x557591['filters']));_0x521994[_0x1e5d('0x7b')][_0x1e5d('0xcb')]=_0x1aeeef['id'];if(_0x4f4ac3[_0x1e5d('0x40')][_0x1e5d('0x8b')]){_0x521994[_0x1e5d('0x7b')]=_[_0x1e5d('0xa6')](_0x521994[_0x1e5d('0x7b')],{'$or':_[_0x1e5d('0x2d')](_0x521994['attributes'],function(_0x41b6d6){var _0x3996be={};_0x3996be[_0x41b6d6]={'$like':'%'+_0x4f4ac3[_0x1e5d('0x40')]['filter']+'%'};return _0x3996be;})});}if(_0x4f4ac3[_0x1e5d('0x40')]['$gte']){var _0x149f15=_0x4f4ac3[_0x1e5d('0x40')][_0x1e5d('0x80')]['split'](',');var _0x5bd9fd={};_0x5bd9fd[_0x149f15[0x0]]={'$gte':moment(_0x149f15[0x1])[_0x1e5d('0xcc')](_0x1e5d('0xcd'))};_0x521994[_0x1e5d('0x7b')]=_[_0x1e5d('0xa6')](_0x521994[_0x1e5d('0x7b')],_0x5bd9fd);}_0x521994=_[_0x1e5d('0xa6')]({},_0x521994,_0x4f4ac3[_0x1e5d('0xc0')]);return db[_0x1e5d('0xc5')][_0x1e5d('0x25')]({'where':_0x521994[_0x1e5d('0x7b')]})[_0x1e5d('0x29')](function(_0x4f28b1){_0x218121[_0x1e5d('0x25')]=_0x4f28b1;if(_0x4f4ac3['query']['includeAll']){_0x521994['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1e5d('0xce')](_0x521994);})[_0x1e5d('0x29')](function(_0x353083){_0x218121[_0x1e5d('0xbb')]=_0x353083;return _0x218121;});}})[_0x1e5d('0x29')](respondWithFilteredResult(_0x2f4bc3,_0x521994))[_0x1e5d('0x33')](handleError(_0x2f4bc3,null));};exports[_0x1e5d('0xcf')]=function(_0x3dab82,_0x151720,_0x385cfc){return db[_0x1e5d('0x3c')][_0x1e5d('0x73')]({'where':{'id':_0x3dab82['params']['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x151720,null))[_0x1e5d('0x29')](function(_0xbdb669){if(_0xbdb669){return _0xbdb669[_0x1e5d('0xd0')](_0x3dab82[_0x1e5d('0x76')]['ids'],_[_0x1e5d('0xc7')](_0x3dab82['body'],[_0x1e5d('0xc6'),'id'])||{})[_0x1e5d('0xd1')](function(){return db['Tag'][_0x1e5d('0xce')]({'attributes':['id',_0x1e5d('0x2b'),_0x1e5d('0xd2')],'where':{'id':_0x3dab82[_0x1e5d('0x76')][_0x1e5d('0xc6')]}});})[_0x1e5d('0x29')](function(_0x5e9cb8){socket[_0x1e5d('0xd3')](_0x1e5d('0xd4'),{'id':Number(_0x3dab82[_0x1e5d('0xbd')]['id']),'tags':_0x5e9cb8||[]});return{'id':Number(_0x3dab82[_0x1e5d('0xbd')]['id']),'tags':_0x5e9cb8||[]};});}})[_0x1e5d('0x29')](respondWithResult(_0x151720,null))[_0x1e5d('0x33')](handleError(_0x151720,null));};exports[_0x1e5d('0xd5')]=function(_0x244c41,_0x2a930f,_0x56b58e){return db[_0x1e5d('0x3c')][_0x1e5d('0x73')]({'where':{'id':_0x244c41[_0x1e5d('0xbd')]['id']}})[_0x1e5d('0x29')](handleEntityNotFound(_0x2a930f,null))['then'](function(_0x1ad3b7){if(_0x1ad3b7){return _0x1ad3b7[_0x1e5d('0xd5')](_0x244c41['query'][_0x1e5d('0xc6')]);}})[_0x1e5d('0x29')](respondWithStatusCode(_0x2a930f,null))[_0x1e5d('0x33')](handleError(_0x2a930f,null));};exports[_0x1e5d('0xd6')]=function(_0x128979,_0xbebb38){var _0x83c34a=moment()['unix']()[_0x1e5d('0xa4')]();var _0x21c6ca=path[_0x1e5d('0xd7')](config['root'],'server',_0x1e5d('0xd8'),_0x1e5d('0xd9'));var _0x59d697=path['join'](config[_0x1e5d('0xda')],'server',_0x1e5d('0xd8'),_0x1e5d('0xdb'));var _0x37fdfd=path['join'](_0x21c6ca,_0x83c34a);var _0x4fa7f2=util[_0x1e5d('0xcc')](_0x1e5d('0xdc'),_0x128979[_0x1e5d('0xbd')]['id'],_0x83c34a);var _0x1d5e9c=path['join'](_0x21c6ca,_0x4fa7f2);var _0x58fa24=[];_0x58fa24[_0x1e5d('0x32')]({'model':db[_0x1e5d('0x71')],'as':_0x1e5d('0x71'),'attributes':['id',_0x1e5d('0x2e')],'raw':!![]});_0x58fa24[_0x1e5d('0x32')]({'model':db[_0x1e5d('0xdd')],'as':_0x1e5d('0x65'),'attributes':['id',_0x1e5d('0xde'),_0x1e5d('0xdf')],'raw':!![]});if(_0x128979[_0x1e5d('0x40')]['attachments']){_0x58fa24[_0x1e5d('0x32')]({'model':db[_0x1e5d('0xe0')],'as':_0x1e5d('0xe0'),'raw':!![]});}var _0x5d9b23=[{'model':db[_0x1e5d('0xc5')],'as':_0x1e5d('0xe1'),'attributes':['id',_0x1e5d('0x76'),_0x1e5d('0x7e'),'direction',_0x1e5d('0xe2'),_0x1e5d('0x86')],'include':_0x58fa24}];_0x5d9b23[_0x1e5d('0x32')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x1e5d('0x2b')]});_0x5d9b23[_0x1e5d('0x32')]({'model':db['User'],'as':'Owner','attributes':['id',_0x1e5d('0x2e')]});return db[_0x1e5d('0x3c')]['find']({'where':{'id':_0x128979[_0x1e5d('0xbd')]['id']},'include':_0x5d9b23})['then'](handleEntityNotFound(_0xbebb38,null))[_0x1e5d('0x29')](function(_0xec867d){if(_0xec867d){var _0x2d0ddf=_0xec867d[_0x1e5d('0xe3')]({'plain':!![]});fs[_0x1e5d('0xe4')](_0x37fdfd);var _0x355d1d={'channel':_0x1e5d('0xe5'),'account':_0x2d0ddf['Account'][_0x1e5d('0x2b')],'agent':_0x2d0ddf[_0x1e5d('0xe6')]?_0x2d0ddf[_0x1e5d('0xe6')]['fullname']:_0x1e5d('0xe7'),'createdAt':moment(_0x2d0ddf[_0x1e5d('0x7e')])[_0x1e5d('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1e5d('0xa4')](),'closedAt':_0x2d0ddf[_0x1e5d('0x39')]?moment(_0x2d0ddf[_0x1e5d('0xe8')])['format'](_0x1e5d('0xcd'))['toString']():'','disposition':_0x2d0ddf[_0x1e5d('0xe9')],'visibility':_0x2d0ddf['threadId']?'Public':_0x1e5d('0xea'),'messages':_(_0x2d0ddf['Messages'])[_0x1e5d('0x8b')]({'secret':![]})[_0x1e5d('0x2d')](function(_0x3df70c){if(_0x3df70c[_0x1e5d('0xe0')]){var _0x162201=path[_0x1e5d('0xd7')](_0x59d697,_0x3df70c['Attachment'][_0x1e5d('0xeb')]);if(fs[_0x1e5d('0xec')](_0x162201)){fs[_0x1e5d('0xed')](_0x162201)['pipe'](fs[_0x1e5d('0xee')](path[_0x1e5d('0xd7')](_0x37fdfd,_0x3df70c['Attachment'][_0x1e5d('0xeb')])));}}return{'date':moment(_0x3df70c[_0x1e5d('0x7e')])[_0x1e5d('0xcc')](_0x1e5d('0xcd'))[_0x1e5d('0xa4')](),'sender':_0x3df70c[_0x1e5d('0xef')]===_0x1e5d('0xf0')?_0x3df70c[_0x1e5d('0x71')]?_0x3df70c[_0x1e5d('0x71')][_0x1e5d('0x2e')]:_0x1e5d('0xf1'):_0x3df70c[_0x1e5d('0x65')][_0x1e5d('0xde')]+(_0x3df70c[_0x1e5d('0x65')][_0x1e5d('0xdf')]?'\x20'+_0x3df70c[_0x1e5d('0x65')][_0x1e5d('0xdf')]:''),'body':_0x3df70c[_0x1e5d('0xe0')]?_0x3df70c['Attachment']['basename']:_0x3df70c[_0x1e5d('0x76')],'direction':_0x3df70c[_0x1e5d('0xef')]==='out'?'A':'C','secret':_0x3df70c['secret'],'read':_0x3df70c[_0x1e5d('0x86')],'attachment':_0x3df70c[_0x1e5d('0xe0')]};})[_0x1e5d('0x62')]()};return ejs[_0x1e5d('0xf2')](path[_0x1e5d('0xd7')](config[_0x1e5d('0xda')],_0x1e5d('0xf3'),_0x1e5d('0xf4'),_0x1e5d('0xf5')),{'interaction':_0x355d1d})[_0x1e5d('0x29')](function(_0x3bee76){var _0x5d12fc=path['join'](_0x37fdfd,_0x1e5d('0xf6')+_0x2d0ddf['id']+'-'+_0x83c34a+_0x1e5d('0xf7'));var _0x1764c1={'path':_0x5d12fc,'channel':_0x1e5d('0xe5'),'interactionId':_0x2d0ddf['id']};return pdf[_0x1e5d('0xf8')](_0x3bee76,_0x1764c1);})[_0x1e5d('0x29')](function(){return new BPromise(function(_0x4cec81,_0x3b27d3){zipdir(_0x37fdfd,{'saveTo':_0x1d5e9c},function(_0x25b9ab,_0x5230a1){if(_0x25b9ab)return _0x3b27d3(_0x25b9ab);return _0x4cec81(_0x5230a1);});})[_0x1e5d('0x29')](function(){return new BPromise(function(_0x3e79a1,_0x4ab8c1){rimraf(_0x37fdfd,function(_0x560eeb){if(_0x560eeb)_0x4ab8c1(_0x560eeb);return _0x3e79a1();});});})[_0x1e5d('0x29')](function(){return _0xbebb38[_0x1e5d('0xd6')](_0x1d5e9c,_0x4fa7f2,function(_0x19ea84){if(_0x19ea84){console[_0x1e5d('0xf9')](_0x1e5d('0xfa'),_0x19ea84);}else{fs[_0x1e5d('0xfb')](_0x1d5e9c);}});});});}else{return _0xbebb38[_0x1e5d('0x1e')](0xc8);}})['catch'](handleError(_0xbebb38,null));}; \ No newline at end of file +var _0x0c45=['addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','download','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','createWriteStream','out','basename','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','TagIds','split','Tags','push','waiting','talking','answered','unmanaged','total','closed','UserId','OpenchannelInteraction','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','field','color','from','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','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?','text','body','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','show','params','rawAttributes','includeAll','include','merge','options','create','describe'];(function(_0x310d1b,_0x28df82){var _0x1f5919=function(_0x419983){while(--_0x419983){_0x310d1b['push'](_0x310d1b['shift']());}};_0x1f5919(++_0x28df82);}(_0x0c45,0x128));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x50c4('0x0'));var rimraf=require(_0x50c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50c4('0x2'));var moment=require(_0x50c4('0x3'));var BPromise=require(_0x50c4('0x4'));var Mustache=require('mustache');var util=require(_0x50c4('0x5'));var path=require(_0x50c4('0x6'));var sox=require(_0x50c4('0x7'));var csv=require('to-csv');var ejs=require(_0x50c4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50c4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x50c4('0xa'));var deskjs=require(_0x50c4('0xb'));var toCsv=require(_0x50c4('0xc'));var querystring=require(_0x50c4('0xd'));var Papa=require(_0x50c4('0xe'));var Redis=require(_0x50c4('0xf'));var authService=require(_0x50c4('0x10'));var qs=require(_0x50c4('0x11'));var as=require(_0x50c4('0x12'));var pdf=require(_0x50c4('0x13'));var hardwareService=require(_0x50c4('0x14'));var logger=require(_0x50c4('0x15'))(_0x50c4('0x16'));var utils=require(_0x50c4('0x17'));var config=require(_0x50c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x50c4('0x19'))['db'];config[_0x50c4('0x1a')]=_[_0x50c4('0x1b')](config['redis'],{'host':_0x50c4('0x1c'),'port':0x18eb});var socket=require(_0x50c4('0x1d'))(new Redis(config[_0x50c4('0x1a')]));require('./openchannelInteraction.socket')[_0x50c4('0x1e')](socket);function respondWithStatusCode(_0x271514,_0x2ca603){_0x2ca603=_0x2ca603||0xcc;return function(_0x252eb0){if(_0x252eb0){return _0x271514[_0x50c4('0x1f')](_0x2ca603);}return _0x271514[_0x50c4('0x20')](_0x2ca603)[_0x50c4('0x21')]();};}function respondWithResult(_0x15c51a,_0x12ba45){_0x12ba45=_0x12ba45||0xc8;return function(_0x10fc58){if(_0x10fc58){return _0x15c51a['status'](_0x12ba45)[_0x50c4('0x22')](_0x10fc58);}};}function respondWithFilteredResult(_0x527ca9,_0x369052){return function(_0x397e08){if(_0x397e08){var _0x36fb3e=typeof _0x369052[_0x50c4('0x23')]===_0x50c4('0x24')&&typeof _0x369052[_0x50c4('0x25')]==='undefined';var _0x1659db=_0x397e08[_0x50c4('0x26')];var _0x4f2c90=_0x36fb3e?0x0:_0x369052[_0x50c4('0x23')];var _0x4ba3a8=_0x36fb3e?_0x397e08[_0x50c4('0x26')]:_0x369052[_0x50c4('0x23')]+_0x369052['limit'];var _0x2961a6;if(_0x4ba3a8>=_0x1659db){_0x4ba3a8=_0x1659db;_0x2961a6=0xc8;}else{_0x2961a6=0xce;}_0x527ca9[_0x50c4('0x20')](_0x2961a6);return _0x527ca9[_0x50c4('0x27')]('Content-Range',_0x4f2c90+'-'+_0x4ba3a8+'/'+_0x1659db)[_0x50c4('0x22')](_0x397e08);}return null;};}function patchUpdates(_0x17daac){return function(_0x5ac3ed){try{jsonpatch[_0x50c4('0x28')](_0x5ac3ed,_0x17daac,!![]);}catch(_0x37c35f){return BPromise[_0x50c4('0x29')](_0x37c35f);}return _0x5ac3ed[_0x50c4('0x2a')]();};}function saveUpdates(_0x1d9f49,_0x362003){return function(_0x263e0a){if(_0x263e0a){return _0x263e0a[_0x50c4('0x2b')](_0x1d9f49)[_0x50c4('0x2c')](function(_0x31b23f){return _0x31b23f;});}return null;};}function removeEntity(_0x38a7bb,_0x2590ee){return function(_0xeaa6c){if(_0xeaa6c){return _0xeaa6c[_0x50c4('0x2d')]()[_0x50c4('0x2c')](function(){_0x38a7bb[_0x50c4('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5e96,_0x1da1d5){return function(_0x159540){if(!_0x159540){_0x2d5e96[_0x50c4('0x1f')](0x194);}return _0x159540;};}function handleError(_0x19067b,_0x4134f6){_0x4134f6=_0x4134f6||0x1f4;return function(_0x356a74){logger[_0x50c4('0x2e')](_0x356a74[_0x50c4('0x2f')]);if(_0x356a74[_0x50c4('0x30')]){delete _0x356a74[_0x50c4('0x30')];}_0x19067b[_0x50c4('0x20')](_0x4134f6)[_0x50c4('0x31')](_0x356a74);};}function getInteractionUsers(_0x16e7fd,_0x1cb07b){return new BPromise(function(_0x4d2eb9,_0x2eb9c7){try{if(_0x1cb07b[_0x16e7fd['id']]){_0x16e7fd['Users']=_[_0x50c4('0x32')](_0x1cb07b[_0x16e7fd['id']],function(_0x16aeb3){return{'id':_0x16aeb3['id'],'fullname':_0x16aeb3['fullname']};});}}catch(_0x361544){_0x2eb9c7(_0x361544);}_0x4d2eb9(_0x16e7fd);});}function getInteractionTags(_0x4dc5cd,_0xa0d246){return new BPromise(function(_0x1868f1,_0x1ea558){try{if(_0x4dc5cd[_0x50c4('0x33')]){_0x4dc5cd['Tags']=[];_0x4dc5cd[_0x50c4('0x33')][_0x50c4('0x34')](',')['forEach'](function(_0x21426f){_0x4dc5cd[_0x50c4('0x35')][_0x50c4('0x36')](_0xa0d246[_0x21426f]);});}delete _0x4dc5cd[_0x50c4('0x33')];}catch(_0x1664de){_0x1ea558(_0x1664de);}_0x1868f1(_0x4dc5cd);});}function updateOpenchannelInteraction(_0x3af4e5,_0x114547,_0x3b3250){return new BPromise(function(_0x398e56,_0x52071d){return getInteractionUsers(_0x3af4e5,_0x3b3250)['then'](function(_0xcb8d){return getInteractionTags(_0xcb8d,_0x114547);})[_0x50c4('0x2c')](function(_0x1aee06){return getStateInteraction(_0x1aee06);})[_0x50c4('0x2c')](function(_0xc2a6ba){_0x398e56(_0xc2a6ba);})['catch'](function(_0x3aa2c5){_0x52071d(_0x3aa2c5);});});}function getStateInteraction(_0x40b68e){return new BPromise(function(_0x1e7a44){_0x40b68e[_0x50c4('0x37')]=0x0;_0x40b68e[_0x50c4('0x38')]=0x0;_0x40b68e[_0x50c4('0x39')]=0x0;_0x40b68e[_0x50c4('0x3a')]=0x0;_0x40b68e[_0x50c4('0x3b')]=0x0;if(!_0x40b68e[_0x50c4('0x3c')]&&!_0x40b68e['UserId']){_0x40b68e['waiting']+=0x1;}if(!_0x40b68e[_0x50c4('0x3c')]&&_0x40b68e[_0x50c4('0x3d')]){_0x40b68e[_0x50c4('0x38')]+=0x1;if(_0x40b68e[_0x50c4('0x37')]){_0x40b68e['waiting']-=0x1;}}if(_0x40b68e[_0x50c4('0x3c')]&&_0x40b68e[_0x50c4('0x3d')]){_0x40b68e['answered']+=0x1;if(_0x40b68e[_0x50c4('0x38')]){_0x40b68e[_0x50c4('0x38')]-=0x1;}}if(_0x40b68e['closed']&&!_0x40b68e[_0x50c4('0x3d')]){_0x40b68e['unmanaged']+=0x1;if(_0x40b68e[_0x50c4('0x37')]){_0x40b68e['waiting']-=0x1;}}_0x40b68e[_0x50c4('0x3b')]+=0x1;_0x1e7a44(_0x40b68e);});}exports['index']=function(_0x516587,_0x5e695a){var _0x4d62dd={},_0xe209d={},_0x97d95={'count':0x0,'rows':[]};var _0xf4cdcd=_[_0x50c4('0x32')](db[_0x50c4('0x3e')]['rawAttributes'],function(_0x290dc7){return{'name':_0x290dc7['fieldName'],'type':_0x290dc7[_0x50c4('0x3f')]['key']};});_0xe209d[_0x50c4('0x40')]=_['map'](_0xf4cdcd,_0x50c4('0x30'));_0xe209d['query']=_[_0x50c4('0x41')](_0x516587[_0x50c4('0x42')]);_0xe209d[_0x50c4('0x43')]=_['intersection'](_0xe209d[_0x50c4('0x40')],_0xe209d['query']);_0x4d62dd[_0x50c4('0x44')]=_[_0x50c4('0x45')](_0xe209d[_0x50c4('0x40')],qs[_0x50c4('0x46')](_0x516587[_0x50c4('0x42')][_0x50c4('0x46')]));_0x4d62dd['attributes']=_0x4d62dd[_0x50c4('0x44')]['length']?_0x4d62dd[_0x50c4('0x44')]:_0xe209d['model'];if(!_0x516587['query'][_0x50c4('0x47')]('nolimit')){_0x4d62dd[_0x50c4('0x25')]=qs[_0x50c4('0x25')](_0x516587[_0x50c4('0x42')][_0x50c4('0x25')]);_0x4d62dd[_0x50c4('0x23')]=qs[_0x50c4('0x23')](_0x516587[_0x50c4('0x42')][_0x50c4('0x23')]);}_0x4d62dd['order']=qs['sort'](_0x516587['query'][_0x50c4('0x48')]);_0x4d62dd[_0x50c4('0x49')]=qs['filters'](_['pick'](_0x516587[_0x50c4('0x42')],_0xe209d['filters']),_0xf4cdcd);var _0x523ce9=[];var _0x2b2447=squel['select']()[_0x50c4('0x4a')]('id')[_0x50c4('0x4a')](_0x50c4('0x30'))['field'](_0x50c4('0x4b'))[_0x50c4('0x4c')]('tools_tags');var _0xd8d0ca=squel['select']()[_0x50c4('0x4a')](_0x50c4('0x4d'))[_0x50c4('0x4a')](_0x50c4('0x4e'))['field']('ui.OpenchannelInteractionId')[_0x50c4('0x4c')](_0x50c4('0x4f'),'ui')[_0x50c4('0x50')](_0x50c4('0x51'),'u',_0x50c4('0x52'));var _0x1cc840=squel[_0x50c4('0x53')]()['from'](_0x50c4('0x54'),'i')[_0x50c4('0x50')](_0x50c4('0x55'),'c',_0x50c4('0x56'))[_0x50c4('0x50')](_0x50c4('0x51'),'o',_0x50c4('0x57'))[_0x50c4('0x50')](_0x50c4('0x58'),'a',_0x50c4('0x59'))['left_join'](_0x50c4('0x5a'),'me',_0x50c4('0x5b'))[_0x50c4('0x50')]('openchannel_interaction_has_tags','it',_0x50c4('0x5c'))['left_join'](_0x50c4('0x5d'),'t','t.id\x20=\x20it.TagId');var _0x3ca34e=squel[_0x50c4('0x5e')]();var _0xbed8d1=[];var _0xf1ffa2=squel[_0x50c4('0x5e')]();var _0x4a58a5;if(_0x516587['query'][_0x50c4('0x5f')]){_0x4a58a5=as[_0x50c4('0x60')](_0x516587['query'][_0x50c4('0x5f')]);var _0x264df5=_0x4a58a5[_0x50c4('0x61')];for(var _0x586af5=0x0;_0x586af5<_0x4a58a5[_0x50c4('0x62')][_0x50c4('0x63')];_0x586af5++){var _0x51f3b4=_0x4a58a5[_0x50c4('0x62')][_0x586af5];var _0x2a6007='i';var _0x4043b8=_[_0x50c4('0x64')](_0xf4cdcd,['name',_0x51f3b4[_0x50c4('0x4a')]]);if(!_0x4043b8){switch(_0x51f3b4[_0x50c4('0x4a')]){case _0x50c4('0x65'):if(_0x51f3b4[_0x50c4('0x66')]==0x1){_0x1cc840[_0x50c4('0x67')]('`'+_0x51f3b4[_0x50c4('0x4a')]+'`\x20=\x200');}else{_0x1cc840['having']('`'+_0x51f3b4[_0x50c4('0x4a')]+_0x50c4('0x68'));}break;case _0x50c4('0x69'):if(_0x51f3b4[_0x50c4('0x6a')]===_0x50c4('0x6b')){if(_0x51f3b4[_0x50c4('0x66')][_0x50c4('0x34')]('\x20')[_0x50c4('0x63')]>0x1){_0x3ca34e[_0x264df5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x50c4('0x6c')](_0x51f3b4[_0x50c4('0x66')]),null);}else{var _0x11a55e='%'+_0x51f3b4[_0x50c4('0x66')]+'%';_0x3ca34e[_0x264df5](_0x50c4('0x6d'),_0x11a55e,_0x11a55e,_0x11a55e);}}else{_0x4043b8=_[_0x50c4('0x64')](_0xf4cdcd,['name',_0x50c4('0x6e')]);_0x51f3b4[_0x50c4('0x4a')]=_0x50c4('0x6e');_0x18f0a6=as[_0x50c4('0x6f')](_0x2a6007,_0x4043b8[_0x50c4('0x3f')],_0x51f3b4);_0x3ca34e[_0x264df5](_0x18f0a6['text'],_0x18f0a6[_0x50c4('0x66')][_0x50c4('0x70')],_0x18f0a6['value'][_0x50c4('0x21')]);}break;case _0x50c4('0x71'):var _0x2b3b45=_0x51f3b4[_0x50c4('0x66')][_0x50c4('0x34')](',')[_0x50c4('0x32')](function(_0x461633){return Number(_0x461633);});_0x2b3b45[_0x50c4('0x72')](function(_0x53a25d){_0xf1ffa2['or'](_0x50c4('0x73'),'%,'+_0x53a25d+',%');});_0xbed8d1=_[_0x50c4('0x74')](_0xbed8d1,_0x2b3b45);break;case _0x50c4('0x75'):if(_0x51f3b4[_0x50c4('0x6a')]===_0x50c4('0x6b')){_0x3ca34e[_0x264df5](_0x50c4('0x76'),'%'+_0x51f3b4['value']+'%',null);}else{_0x4043b8=_['find'](_0xf4cdcd,[_0x50c4('0x30'),_0x50c4('0x3d')]);_0x51f3b4[_0x50c4('0x4a')]=_0x50c4('0x3d');_0x18f0a6=as[_0x50c4('0x6f')](_0x2a6007,_0x4043b8[_0x50c4('0x3f')],_0x51f3b4);_0x3ca34e[_0x264df5](_0x18f0a6[_0x50c4('0x77')],_0x18f0a6[_0x50c4('0x66')][_0x50c4('0x70')],_0x18f0a6[_0x50c4('0x66')][_0x50c4('0x21')]);}break;case _0x50c4('0x78'):_0x18f0a6=as[_0x50c4('0x6f')]('me',null,_0x51f3b4);_0x3ca34e[_0x264df5](_0x18f0a6[_0x50c4('0x77')],_0x18f0a6['value'][_0x50c4('0x70')],_0x18f0a6[_0x50c4('0x66')][_0x50c4('0x21')]);break;}}else{var _0x18f0a6=as[_0x50c4('0x6f')](_0x2a6007,_0x4043b8['type'],_0x51f3b4);_0x3ca34e[_0x264df5](_0x18f0a6[_0x50c4('0x77')],_0x18f0a6['value']['start'],_0x18f0a6[_0x50c4('0x66')][_0x50c4('0x21')]);}}}else{var _0x21a16b=_(_0x516587['query'])[_0x50c4('0x41')]()[_0x50c4('0x32')](function(_0x9f343e){return _['some'](_0xf4cdcd,[_0x50c4('0x30'),_0x9f343e])?_0x9f343e:undefined;})['compact']()['value']();if(!_[_0x50c4('0x79')](_0x21a16b)){_0x21a16b['forEach'](function(_0x22b4a9){if(_0x22b4a9===_0x50c4('0x7a')){_0x1cc840[_0x50c4('0x49')](_0x50c4('0x7b'),[]['concat'](_0x516587['query'][_0x22b4a9]));}else if(_0x22b4a9===_0x50c4('0x7c')){var _0xdc02=JSON[_0x50c4('0x7d')](_0x516587[_0x50c4('0x42')][_0x22b4a9])[_0x50c4('0x7e')];var _0x10a0b2=JSON[_0x50c4('0x7d')](_0x516587['query'][_0x22b4a9])['$lte'];_0x1cc840[_0x50c4('0x49')](_0x50c4('0x7f'),_0xdc02,_0x10a0b2);}else{if(_0x516587[_0x50c4('0x42')][_0x22b4a9]==='null'){_0x1cc840[_0x50c4('0x49')]('i.'+_0x22b4a9+_0x50c4('0x80'));}else{_0x1cc840['where']('i.'+_0x22b4a9+'\x20=\x20?',_0x516587[_0x50c4('0x42')][_0x22b4a9]);}}});}if(_0x516587[_0x50c4('0x42')][_0x50c4('0x81')]){if(_0x516587[_0x50c4('0x42')][_0x50c4('0x81')]==0x1){_0x1cc840[_0x50c4('0x67')]('`unreadMessages`\x20=\x200');}else{_0x1cc840[_0x50c4('0x67')](_0x50c4('0x82'));}}if(_0x516587[_0x50c4('0x42')][_0x50c4('0x83')]){_0xbed8d1=_['isArray'](_0x516587['query'][_0x50c4('0x83')])?_0x516587['query']['tag']:new Array(_0x516587[_0x50c4('0x42')][_0x50c4('0x83')]);_0xbed8d1[_0x50c4('0x72')](function(_0x592c17){_0xf1ffa2['or'](_0x50c4('0x73'),'%,'+_0x592c17+',%');});}if(_0x516587[_0x50c4('0x42')][_0x50c4('0x84')]){var _0x37dc5b=_0x516587['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x50c4('0x85')](/'/g,'\x27\x27');if(qs[_0x50c4('0x86')](_0x37dc5b)){_0x3ca34e['or'](_0x50c4('0x87'),_0x37dc5b+'%');}else{_0x3ca34e['or'](_0x50c4('0x88'),qs[_0x50c4('0x6c')](_0x37dc5b))['or'](_0x50c4('0x89'),_0x37dc5b+'%')['or'](_0x50c4('0x8a'),_0x37dc5b+'%');}}}_0x1cc840[_0x50c4('0x49')](_0x3ca34e);_0x1cc840[_0x50c4('0x8b')](_0x50c4('0x8c'));var _0x3064f3={'type':db['Sequelize'][_0x50c4('0x8d')][_0x50c4('0x8e')],'raw':!![]};var _0x14dd50=_0x1cc840['clone']();_0x14dd50[_0x50c4('0x4a')](_0x50c4('0x8c'));_0x14dd50['field'](_0x50c4('0x8f'),_0x50c4('0x65'));if(_0x4d62dd[_0x50c4('0x90')]){_0x4d62dd[_0x50c4('0x90')][_0x50c4('0x72')](function(_0x4c0367){var _0x14af50=_0x4c0367[0x0]===_0x50c4('0x91')?_0x4c0367[0x0]:'i.'+_0x4c0367[0x0];_0x1cc840[_0x50c4('0x90')](_0x14af50,_0x4c0367[0x1]==='DESC'?![]:!![]);});}if(!_[_0x50c4('0x79')](_0xbed8d1)){_0x1cc840[_0x50c4('0x67')](_0xf1ffa2);_0x14dd50[_0x50c4('0x49')](_0x50c4('0x92'),_0xbed8d1);}BPromise[_0x50c4('0x93')]()[_0x50c4('0x2c')](function(){if(!_0x4a58a5){if(_0x516587[_0x50c4('0x42')]['OpenchannelAccountId'])return;_0x14dd50[_0x50c4('0x49')](_0x50c4('0x94'));_0x1cc840[_0x50c4('0x49')](_0x50c4('0x94'));return;}if(_0x516587[_0x50c4('0x95')][_0x50c4('0x96')]!=='agent')return;return _0x516587[_0x50c4('0x95')][_0x50c4('0x97')]({'attributes':['id'],'raw':!![]})[_0x50c4('0x2c')](function(_0x3c5987){if(_[_0x50c4('0x79')](_0x3c5987)){_0x14dd50[_0x50c4('0x49')](_0x50c4('0x98'));_0x1cc840[_0x50c4('0x49')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x14dd50[_0x50c4('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x50c4('0x32')](_0x3c5987,'id'));_0x1cc840[_0x50c4('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x50c4('0x32')](_0x3c5987,'id'));}});})[_0x50c4('0x2c')](function(){if(_0x516587[_0x50c4('0x95')]['role']==='agent'&&!_0x4a58a5&&!_0x516587[_0x50c4('0x42')][_0x50c4('0x7a')])return[];return db[_0x50c4('0x99')][_0x50c4('0x42')](_0x14dd50[_0x50c4('0x9a')](),_0x3064f3);})['then'](function(_0x45ef85){_0x97d95[_0x50c4('0x26')]=_0x45ef85[_0x50c4('0x63')];if(_0x97d95[_0x50c4('0x26')]===0x0)return[];return db[_0x50c4('0x99')][_0x50c4('0x42')](_0x2b2447[_0x50c4('0x9a')](),_0x3064f3)[_0x50c4('0x2c')](function(_0x18e186){_0x523ce9=_[_0x50c4('0x9b')](_0x18e186,'id');_0x3064f3=_['merge'](_0x3064f3,{'model':db[_0x50c4('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x516587[_0x50c4('0x42')][_0x50c4('0x46')]){_0x4d62dd[_0x50c4('0x44')][_0x50c4('0x72')](function(_0x146f19){_0x1cc840[_0x50c4('0x4a')]('i.'+_0x146f19);});}else{_0x1cc840['field'](_0x50c4('0x8f'),_0x50c4('0x65'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0x9c'),'Account.key');_0x1cc840[_0x50c4('0x4a')](_0x50c4('0x9d'),_0x50c4('0x9e'));_0x1cc840['field'](_0x50c4('0x9f'),_0x50c4('0x91'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0xa0'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0xa1'),'Contact.firstName');_0x1cc840['field'](_0x50c4('0xa2'),_0x50c4('0xa3'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0xa4'),_0x50c4('0xa5'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0xa6'),_0x50c4('0xa7'));_0x1cc840[_0x50c4('0x4a')](_0x50c4('0xa8'),'Contact.mobile');_0x1cc840[_0x50c4('0x4a')]('c.fax',_0x50c4('0xa9'));_0x1cc840[_0x50c4('0x4a')]('o.fullname',_0x50c4('0xaa'));_0x1cc840['field'](_0x50c4('0xab'),_0x50c4('0xac'));_0x1cc840['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4d62dd[_0x50c4('0x25')])_0x1cc840['limit'](_0x4d62dd['limit']);if(_0x4d62dd[_0x50c4('0x23')])_0x1cc840[_0x50c4('0x23')](_0x4d62dd[_0x50c4('0x23')]);return db['sequelize'][_0x50c4('0x42')](_0x1cc840[_0x50c4('0x9a')](),_0x3064f3);})[_0x50c4('0x2c')](function(_0x1b4e56){if(_0x1b4e56[_0x50c4('0x63')]>0x0)_0xd8d0ca[_0x50c4('0x49')](_0x50c4('0xad'),_['map'](_0x1b4e56,'id'));return db[_0x50c4('0x99')][_0x50c4('0x42')](_0xd8d0ca[_0x50c4('0x9a')](),_0x3064f3)[_0x50c4('0x2c')](function(_0x5da628){var _0x1fc47d=_[_0x50c4('0xae')](_0x5da628,_0x50c4('0xaf'));var _0x4228b6=[];_0x1b4e56['forEach'](function(_0x28c3ab){_0x4228b6['push'](updateOpenchannelInteraction(_0x28c3ab,_0x523ce9,_0x1fc47d));});return BPromise[_0x50c4('0xb0')](_0x4228b6);});});})[_0x50c4('0x2c')](function(_0x260c68){_0x97d95[_0x50c4('0xb1')]=_0x260c68;return _0x97d95;})[_0x50c4('0x2c')](respondWithFilteredResult(_0x5e695a,_0x4d62dd))[_0x50c4('0xb2')](handleError(_0x5e695a,null));};exports[_0x50c4('0xb3')]=function(_0x41d745,_0xdf5157){var _0x552aa0={};if(_0x41d745[_0x50c4('0x42')][_0x50c4('0x3f')]&&_0x41d745['query'][_0x50c4('0x3f')]===_0x50c4('0x4c')){_0x552aa0[_0x50c4('0x4c')]=_0x41d745[_0x50c4('0xb4')]['id'];}else{_0x552aa0['id']=_0x41d745[_0x50c4('0xb4')]['id'];}var _0x11f72a={'raw':![],'where':_0x552aa0},_0x2cf791={};_0x2cf791['model']=_[_0x50c4('0x41')](db[_0x50c4('0x3e')][_0x50c4('0xb5')]);_0x2cf791[_0x50c4('0x42')]=_[_0x50c4('0x41')](_0x41d745['query']);_0x2cf791[_0x50c4('0x43')]=_[_0x50c4('0x45')](_0x2cf791[_0x50c4('0x40')],_0x2cf791[_0x50c4('0x42')]);_0x11f72a[_0x50c4('0x44')]=_['intersection'](_0x2cf791[_0x50c4('0x40')],qs['fields'](_0x41d745[_0x50c4('0x42')][_0x50c4('0x46')]));_0x11f72a[_0x50c4('0x44')]=_0x11f72a['attributes']['length']?_0x11f72a[_0x50c4('0x44')]:_0x2cf791['model'];if(_0x41d745[_0x50c4('0x42')][_0x50c4('0xb6')]){_0x11f72a[_0x50c4('0xb7')]=[{'all':!![]}];}_0x11f72a=_[_0x50c4('0xb8')]({},_0x11f72a,_0x41d745[_0x50c4('0xb9')]);return db[_0x50c4('0x3e')]['find'](_0x11f72a)[_0x50c4('0x2c')](handleEntityNotFound(_0xdf5157,null))[_0x50c4('0x2c')](respondWithResult(_0xdf5157,null))[_0x50c4('0xb2')](handleError(_0xdf5157,null));};exports[_0x50c4('0xba')]=function(_0x18b156,_0x70875c){return db['OpenchannelInteraction'][_0x50c4('0xba')](_0x18b156[_0x50c4('0x78')],{})[_0x50c4('0x2c')](respondWithResult(_0x70875c,0xc9))[_0x50c4('0xb2')](handleError(_0x70875c,null));};exports[_0x50c4('0x2b')]=function(_0x49703b,_0x224d29){if(_0x49703b[_0x50c4('0x78')]['id']){delete _0x49703b[_0x50c4('0x78')]['id'];}return db[_0x50c4('0x3e')]['find']({'where':{'id':_0x49703b[_0x50c4('0xb4')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x224d29,null))[_0x50c4('0x2c')](saveUpdates(_0x49703b[_0x50c4('0x78')],null))['then'](respondWithResult(_0x224d29,null))[_0x50c4('0xb2')](handleError(_0x224d29,null));};exports[_0x50c4('0x2d')]=function(_0x58b525,_0xcfb3c3){return db['OpenchannelInteraction'][_0x50c4('0x64')]({'where':{'id':_0x58b525[_0x50c4('0xb4')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0xcfb3c3,null))['then'](removeEntity(_0xcfb3c3,null))[_0x50c4('0xb2')](handleError(_0xcfb3c3,null));};exports['describe']=function(_0x791c66,_0x4e8eac){return db[_0x50c4('0x3e')][_0x50c4('0xbb')]()[_0x50c4('0x2c')](respondWithResult(_0x4e8eac,null))[_0x50c4('0xb2')](handleError(_0x4e8eac,null));};exports[_0x50c4('0xbc')]=function(_0xe71d89,_0x3864ee,_0x52963f){return db[_0x50c4('0xbd')][_0x50c4('0x64')]({'where':{'id':_0xe71d89[_0x50c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x3864ee,null))[_0x50c4('0x2c')](function(_0x1618bf){if(_0x1618bf){return _0x1618bf[_0x50c4('0xbc')](_0xe71d89[_0x50c4('0x78')][_0x50c4('0xbe')],_[_0x50c4('0xbf')](_0xe71d89[_0x50c4('0x78')],[_0x50c4('0xbe'),'id'])||{});}})[_0x50c4('0x2c')](respondWithResult(_0x3864ee,null))[_0x50c4('0xb2')](handleError(_0x3864ee,null));};exports[_0x50c4('0xc0')]=function(_0x2a81bf,_0x55326e,_0x4c3069){var _0x2de72c={'raw':![],'where':{}};var _0xfd903b={};var _0x23ef1e={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x50c4('0xc1')]({'where':{'id':_0x2a81bf[_0x50c4('0xb4')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x55326e,null))['then'](function(_0x11e028){if(_0x11e028){_0xfd903b[_0x50c4('0x40')]=_[_0x50c4('0x41')](db[_0x50c4('0xbd')][_0x50c4('0xb5')]);_0xfd903b['query']=_['keys'](_0x2a81bf[_0x50c4('0x42')]);_0xfd903b[_0x50c4('0x43')]=_['intersection'](_0xfd903b[_0x50c4('0x40')],_0xfd903b[_0x50c4('0x42')]);_0x2de72c['attributes']=_[_0x50c4('0x45')](_0xfd903b[_0x50c4('0x40')],qs[_0x50c4('0x46')](_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x46')]));_0x2de72c[_0x50c4('0x44')]=_0x2de72c[_0x50c4('0x44')][_0x50c4('0x63')]?_0x2de72c[_0x50c4('0x44')]:_0xfd903b['model'];if(!_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x47')]('nolimit')){_0x2de72c[_0x50c4('0x25')]=qs[_0x50c4('0x25')](_0x2a81bf[_0x50c4('0x42')]['limit']);_0x2de72c[_0x50c4('0x23')]=qs[_0x50c4('0x23')](_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x23')]);}_0x2de72c[_0x50c4('0x90')]=qs['sort'](_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x48')]);_0x2de72c[_0x50c4('0x49')]=qs[_0x50c4('0x43')](_['pick'](_0x2a81bf[_0x50c4('0x42')],_0xfd903b['filters']));_0x2de72c[_0x50c4('0x49')][_0x50c4('0xaf')]=_0x11e028['id'];if(_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x84')]){_0x2de72c[_0x50c4('0x49')]=_['merge'](_0x2de72c[_0x50c4('0x49')],{'$or':_[_0x50c4('0x32')](_0x2de72c[_0x50c4('0x44')],function(_0x53b209){var _0x6086a7={};_0x6086a7[_0x53b209]={'$like':'%'+_0x2a81bf[_0x50c4('0x42')]['filter']+'%'};return _0x6086a7;})});}if(_0x2a81bf['query'][_0x50c4('0x7e')]){var _0x5109a6=_0x2a81bf[_0x50c4('0x42')][_0x50c4('0x7e')][_0x50c4('0x34')](',');var _0x499ecb={};_0x499ecb[_0x5109a6[0x0]]={'$gte':moment(_0x5109a6[0x1])['format'](_0x50c4('0xc2'))};_0x2de72c['where']=_[_0x50c4('0xb8')](_0x2de72c[_0x50c4('0x49')],_0x499ecb);}_0x2de72c=_['merge']({},_0x2de72c,_0x2a81bf[_0x50c4('0xb9')]);return db[_0x50c4('0xbd')]['count']({'where':_0x2de72c[_0x50c4('0x49')]})[_0x50c4('0x2c')](function(_0x2ab33e){_0x23ef1e[_0x50c4('0x26')]=_0x2ab33e;if(_0x2a81bf['query'][_0x50c4('0xb6')]){_0x2de72c[_0x50c4('0xb7')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x50c4('0xc3')](_0x2de72c);})[_0x50c4('0x2c')](function(_0x50020f){_0x23ef1e[_0x50c4('0xb1')]=_0x50020f;return _0x23ef1e;});}})[_0x50c4('0x2c')](respondWithFilteredResult(_0x55326e,_0x2de72c))['catch'](handleError(_0x55326e,null));};exports[_0x50c4('0xc4')]=function(_0x4af3d0,_0xf2f3f3,_0x54b8a1){return db[_0x50c4('0x3e')]['find']({'where':{'id':_0x4af3d0[_0x50c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0xf2f3f3,null))[_0x50c4('0x2c')](function(_0x2277a1){if(_0x2277a1){return _0x2277a1[_0x50c4('0xc5')](_0x4af3d0[_0x50c4('0x78')][_0x50c4('0xbe')],_['omit'](_0x4af3d0[_0x50c4('0x78')],[_0x50c4('0xbe'),'id'])||{})[_0x50c4('0xc6')](function(){return db[_0x50c4('0x71')][_0x50c4('0xc3')]({'attributes':['id','name',_0x50c4('0x4b')],'where':{'id':_0x4af3d0[_0x50c4('0x78')]['ids']}});})[_0x50c4('0x2c')](function(_0x3e9414){socket[_0x50c4('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x4af3d0[_0x50c4('0xb4')]['id']),'tags':_0x3e9414||[]});return{'id':Number(_0x4af3d0[_0x50c4('0xb4')]['id']),'tags':_0x3e9414||[]};});}})['then'](respondWithResult(_0xf2f3f3,null))[_0x50c4('0xb2')](handleError(_0xf2f3f3,null));};exports['removeTags']=function(_0x55f9f9,_0x5f2af6,_0x5d7d7c){return db[_0x50c4('0x3e')]['find']({'where':{'id':_0x55f9f9[_0x50c4('0xb4')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x5f2af6,null))[_0x50c4('0x2c')](function(_0x105245){if(_0x105245){return _0x105245['removeTags'](_0x55f9f9['query'][_0x50c4('0xbe')]);}})[_0x50c4('0x2c')](respondWithStatusCode(_0x5f2af6,null))[_0x50c4('0xb2')](handleError(_0x5f2af6,null));};exports[_0x50c4('0xc8')]=function(_0x3b3130,_0x1210ac){var _0x179d4b=moment()['unix']()[_0x50c4('0x9a')]();var _0x4a9ac5=path['join'](config['root'],_0x50c4('0xc9'),_0x50c4('0xca'),_0x50c4('0xcb'));var _0x3e3316=path[_0x50c4('0xcc')](config[_0x50c4('0xcd')],_0x50c4('0xc9'),_0x50c4('0xca'),_0x50c4('0xce'));var _0x2443c1=path[_0x50c4('0xcc')](_0x4a9ac5,_0x179d4b);var _0xd35923=util[_0x50c4('0xcf')](_0x50c4('0xd0'),_0x3b3130[_0x50c4('0xb4')]['id'],_0x179d4b);var _0x2c6ac4=path['join'](_0x4a9ac5,_0xd35923);var _0x4b57b2=[];_0x4b57b2[_0x50c4('0x36')]({'model':db[_0x50c4('0x75')],'as':_0x50c4('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x4b57b2[_0x50c4('0x36')]({'model':db[_0x50c4('0xd1')],'as':_0x50c4('0x69'),'attributes':['id',_0x50c4('0xd2'),_0x50c4('0xd3')],'raw':!![]});if(_0x3b3130[_0x50c4('0x42')]['attachments']){_0x4b57b2[_0x50c4('0x36')]({'model':db[_0x50c4('0xd4')],'as':_0x50c4('0xd4'),'raw':!![]});}var _0x53e4aa=[{'model':db['OpenchannelMessage'],'as':_0x50c4('0xd5'),'attributes':['id','body',_0x50c4('0x7c'),_0x50c4('0xd6'),_0x50c4('0xd7'),'read'],'include':_0x4b57b2}];_0x53e4aa['push']({'model':db[_0x50c4('0xd8')],'as':_0x50c4('0xd9'),'attributes':['id',_0x50c4('0x30')]});_0x53e4aa[_0x50c4('0x36')]({'model':db['User'],'as':_0x50c4('0xda'),'attributes':['id',_0x50c4('0xdb')]});return db[_0x50c4('0x3e')][_0x50c4('0x64')]({'where':{'id':_0x3b3130['params']['id']},'include':_0x53e4aa})[_0x50c4('0x2c')](handleEntityNotFound(_0x1210ac,null))[_0x50c4('0x2c')](function(_0x1c18a1){if(_0x1c18a1){var _0xba2f10=_0x1c18a1[_0x50c4('0xdc')]({'plain':!![]});fs[_0x50c4('0xdd')](_0x2443c1);var _0x472105={'channel':_0x50c4('0xde'),'account':_0xba2f10[_0x50c4('0xd9')][_0x50c4('0x30')],'agent':_0xba2f10[_0x50c4('0xda')]?_0xba2f10[_0x50c4('0xda')][_0x50c4('0xdb')]:_0x50c4('0xdf'),'createdAt':moment(_0xba2f10[_0x50c4('0x7c')])[_0x50c4('0xcf')](_0x50c4('0xc2'))[_0x50c4('0x9a')](),'closedAt':_0xba2f10[_0x50c4('0x3c')]?moment(_0xba2f10[_0x50c4('0xe0')])[_0x50c4('0xcf')](_0x50c4('0xc2'))[_0x50c4('0x9a')]():'','disposition':_0xba2f10[_0x50c4('0xe1')],'visibility':_0xba2f10[_0x50c4('0xe2')]?_0x50c4('0xe3'):_0x50c4('0xe4'),'messages':_(_0xba2f10[_0x50c4('0xd5')])[_0x50c4('0x84')]({'secret':![]})[_0x50c4('0x32')](function(_0x5601be){if(_0x5601be[_0x50c4('0xd4')]){var _0x45e68a=path['join'](_0x3e3316,_0x5601be[_0x50c4('0xd4')]['basename']);if(fs[_0x50c4('0xe5')](_0x45e68a)){fs[_0x50c4('0xe6')](_0x45e68a)['pipe'](fs[_0x50c4('0xe7')](path[_0x50c4('0xcc')](_0x2443c1,_0x5601be[_0x50c4('0xd4')]['basename'])));}}return{'date':moment(_0x5601be[_0x50c4('0x7c')])['format'](_0x50c4('0xc2'))['toString'](),'sender':_0x5601be[_0x50c4('0xd6')]===_0x50c4('0xe8')?_0x5601be[_0x50c4('0x75')]?_0x5601be[_0x50c4('0x75')][_0x50c4('0xdb')]:'System':_0x5601be[_0x50c4('0x69')]['firstName']+(_0x5601be[_0x50c4('0x69')]['lastName']?'\x20'+_0x5601be['Contact'][_0x50c4('0xd3')]:''),'body':_0x5601be['Attachment']?_0x5601be[_0x50c4('0xd4')][_0x50c4('0xe9')]:_0x5601be[_0x50c4('0x78')],'direction':_0x5601be[_0x50c4('0xd6')]===_0x50c4('0xe8')?'A':'C','secret':_0x5601be[_0x50c4('0xd7')],'read':_0x5601be['read'],'attachment':_0x5601be[_0x50c4('0xd4')]};})[_0x50c4('0x66')]()};return ejs[_0x50c4('0xea')](path['join'](config['root'],'server',_0x50c4('0xeb'),_0x50c4('0xec')),{'interaction':_0x472105})[_0x50c4('0x2c')](function(_0x3b7f35){var _0x49b298=path[_0x50c4('0xcc')](_0x2443c1,_0x50c4('0xed')+_0xba2f10['id']+'-'+_0x179d4b+_0x50c4('0xee'));var _0xd91957={'path':_0x49b298,'channel':'Openchannel','interactionId':_0xba2f10['id']};return pdf[_0x50c4('0xef')](_0x3b7f35,_0xd91957);})['then'](function(){return new BPromise(function(_0x4af05f,_0x5c2355){zipdir(_0x2443c1,{'saveTo':_0x2c6ac4},function(_0x1421d4,_0x4115b0){if(_0x1421d4)return _0x5c2355(_0x1421d4);return _0x4af05f(_0x4115b0);});})[_0x50c4('0x2c')](function(){return new BPromise(function(_0x1c19bb,_0x31c5e7){rimraf(_0x2443c1,function(_0x46578a){if(_0x46578a)_0x31c5e7(_0x46578a);return _0x1c19bb();});});})['then'](function(){return _0x1210ac[_0x50c4('0xc8')](_0x2c6ac4,_0xd35923,function(_0x248748){if(_0x248748){console[_0x50c4('0xf0')]('err',_0x248748);}else{fs[_0x50c4('0xf1')](_0x2c6ac4);}});});});}else{return _0x1210ac[_0x50c4('0x1f')](0xc8);}})[_0x50c4('0xb2')](handleError(_0x1210ac,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ff564a4..b442744 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 _0xf4b6=['save','update','remove','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xf4b6,0x139));var _0x6f4b=function(_0x4c5dc6,_0x409841){_0x4c5dc6=_0x4c5dc6-0x0;var _0x2a41db=_0xf4b6[_0x4c5dc6];return _0x2a41db;};'use strict';var EventEmitter=require(_0x6f4b('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x6f4b('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f4b('0x2'),'afterUpdate':_0x6f4b('0x3'),'afterDestroy':_0x6f4b('0x4')};function emitEvent(_0x19ad5c){return function(_0x3e6916,_0x28b932,_0x5dd1c0){_0x3e6916['getUsers']({'attributes':['id'],'raw':!![]})[_0x6f4b('0x5')](function(_0x46f71d){_0x3e6916[_0x6f4b('0x6')]('Users',_0x46f71d[_0x6f4b('0x7')](function(_0xcbb187){return{'id':_0xcbb187['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3e6916['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6f4b('0x5')](function(_0x38c625){_0x3e6916[_0x6f4b('0x6')](_0x6f4b('0x8'),_0x38c625[_0x6f4b('0x9')]);OpenchannelInteractionEvents[_0x6f4b('0xa')](_0x19ad5c+':'+_0x3e6916['id'],_0x3e6916);OpenchannelInteractionEvents[_0x6f4b('0xa')](_0x19ad5c,_0x3e6916);_0x5dd1c0(null);})[_0x6f4b('0xb')](_0x5dd1c0(null));};}for(var e in events){if(events[_0x6f4b('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x6f4b('0xd')](e,emitEvent(event));}}module[_0x6f4b('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5e29=['map','findAll','unreadMessages','length','emit','catch','hook','events','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users'];(function(_0x5bdf15,_0x39f070){var _0x1c7939=function(_0x2895e9){while(--_0x2895e9){_0x5bdf15['push'](_0x5bdf15['shift']());}};_0x1c7939(++_0x39f070);}(_0x5e29,0xa7));var _0x95e2=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x5e29[_0x42235f];return _0x3f5fab;};'use strict';var EventEmitter=require(_0x95e2('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x95e2('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x95e2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x95e2('0x3'),'afterDestroy':_0x95e2('0x4')};function emitEvent(_0x3ee4e1){return function(_0x273860,_0x384276,_0xc72e11){_0x273860[_0x95e2('0x5')]({'attributes':['id'],'raw':!![]})[_0x95e2('0x6')](function(_0x5140c8){_0x273860[_0x95e2('0x7')](_0x95e2('0x8'),_0x5140c8[_0x95e2('0x9')](function(_0x2e31d3){return{'id':_0x2e31d3['id']};}));return OpenchannelMessage[_0x95e2('0xa')]({'where':{'OpenchannelInteractionId':_0x273860['id'],'direction':'in','read':![]},'raw':!![]});})[_0x95e2('0x6')](function(_0x4a6b43){_0x273860[_0x95e2('0x7')](_0x95e2('0xb'),_0x4a6b43[_0x95e2('0xc')]);OpenchannelInteractionEvents[_0x95e2('0xd')](_0x3ee4e1+':'+_0x273860['id'],_0x273860);OpenchannelInteractionEvents[_0x95e2('0xd')](_0x3ee4e1,_0x273860);_0xc72e11(null);})[_0x95e2('0xe')](_0xc72e11(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x95e2('0xf')](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 68c1011..6481508 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 _0x4b97=['bluebird','request-promise','path','rimraf','../../config/environment','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x334aa2,_0x195198){var _0x142c8a=function(_0x460a64){while(--_0x460a64){_0x334aa2['push'](_0x334aa2['shift']());}};_0x142c8a(++_0x195198);}(_0x4b97,0xf2));var _0x74b9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4b97[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x74b9('0x0'));var util=require(_0x74b9('0x1'));var logger=require(_0x74b9('0x2'))(_0x74b9('0x3'));var moment=require(_0x74b9('0x4'));var BPromise=require(_0x74b9('0x5'));var rp=require(_0x74b9('0x6'));var fs=require('fs');var path=require(_0x74b9('0x7'));var rimraf=require(_0x74b9('0x8'));var config=require(_0x74b9('0x9'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x2c709c,_0xd27ca0){return _0x2c709c['define'](_0x74b9('0xa'),attributes,{'tableName':_0x74b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74b9('0xc'),'collate':_0x74b9('0xd'),'hooks':{'beforeUpdate':function(_0x5b42ff,_0x1a9759,_0x45937d){if(_0x5b42ff[_0x74b9('0xe')](_0x74b9('0xf'))){_0x5b42ff[_0x74b9('0x10')]=moment()[_0x74b9('0x11')](_0x74b9('0x12'));}_0x45937d(null,_0x5b42ff);}}});}; \ No newline at end of file +var _0xf02e=['util','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closedAt','format'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xf02e,0x68));var _0xef02=function(_0x31a308,_0x448a53){_0x31a308=_0x31a308-0x0;var _0x353a67=_0xf02e[_0x31a308];return _0x353a67;};'use strict';var _=require('lodash');var util=require(_0xef02('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xef02('0x1'));var rp=require(_0xef02('0x2'));var fs=require('fs');var path=require(_0xef02('0x3'));var rimraf=require('rimraf');var config=require(_0xef02('0x4'));var attributes=require(_0xef02('0x5'));module[_0xef02('0x6')]=function(_0x9ac2b1,_0x4fd0d2){return _0x9ac2b1[_0xef02('0x7')](_0xef02('0x8'),attributes,{'tableName':_0xef02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x28f393,_0x432f6c,_0xb05e58){if(_0x28f393[_0xef02('0xa')]('closed')){_0x28f393[_0xef02('0xb')]=moment()[_0xef02('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0xb05e58(null,_0x28f393);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 09b4117..6b50bac 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 _0x5966=['addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','attributes','AddTagsToOpenchannelInteraction','find'];(function(_0x261efc,_0x385c76){var _0x102c63=function(_0x2a3154){while(--_0x2a3154){_0x261efc['push'](_0x261efc['shift']());}};_0x102c63(++_0x385c76);}(_0x5966,0x101));var _0x6596=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x5966[_0x2a56ad];return _0x425175;};'use strict';var _=require('lodash');var util=require(_0x6596('0x0'));var moment=require(_0x6596('0x1'));var BPromise=require(_0x6596('0x2'));var rs=require(_0x6596('0x3'));var fs=require('fs');var Redis=require(_0x6596('0x4'));var db=require(_0x6596('0x5'))['db'];var utils=require(_0x6596('0x6'));var logger=require(_0x6596('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6596('0x8'));var client=jayson[_0x6596('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x6596('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6596('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x6596('0xc')](socket);function respondWithRpcPromise(_0x2a1edd,_0x1a8f72,_0x3d10d4){return new BPromise(function(_0xe93350,_0x136451){return client['request'](_0x2a1edd,_0x3d10d4)[_0x6596('0xd')](function(_0xe5e0cc){logger[_0x6596('0xe')](_0x6596('0xf'),_0x1a8f72,_0x6596('0x10'));logger[_0x6596('0x11')](_0x6596('0x12'),_0x1a8f72,_0x6596('0x10'),JSON[_0x6596('0x13')](_0xe5e0cc));if(_0xe5e0cc[_0x6596('0x14')]){if(_0xe5e0cc[_0x6596('0x14')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1a8f72,_0xe5e0cc[_0x6596('0x14')][_0x6596('0x15')]);return _0x136451(_0xe5e0cc[_0x6596('0x14')][_0x6596('0x15')]);}logger[_0x6596('0x14')](_0x6596('0xf'),_0x1a8f72,_0xe5e0cc[_0x6596('0x14')]['message']);return _0xe93350(_0xe5e0cc[_0x6596('0x14')][_0x6596('0x15')]);}else{logger[_0x6596('0xe')](_0x6596('0xf'),_0x1a8f72,_0x6596('0x10'));_0xe93350(_0xe5e0cc['result'][_0x6596('0x15')]);}})[_0x6596('0x16')](function(_0x192526){logger[_0x6596('0x14')](_0x6596('0xf'),_0x1a8f72,_0x192526);_0x136451(_0x192526);});});}exports[_0x6596('0x17')]=function(_0x13b8a7){var _0x40a050=this;return new Promise(function(_0xc0c7f7,_0x217588){return db[_0x6596('0x18')]['update'](_0x13b8a7[_0x6596('0x19')],{'raw':_0x13b8a7[_0x6596('0x1a')]?_0x13b8a7[_0x6596('0x1a')][_0x6596('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b8a7['options']?_0x13b8a7[_0x6596('0x1a')]['where']||null:null,'attributes':_0x13b8a7[_0x6596('0x1a')]?_0x13b8a7[_0x6596('0x1a')][_0x6596('0x1c')]||null:null,'limit':_0x13b8a7[_0x6596('0x1a')]?_0x13b8a7['options']['limit']||null:null})['then'](function(_0x511df2){logger[_0x6596('0xe')](_0x6596('0x17'),_0x13b8a7);logger['debug'](_0x6596('0x17'),_0x13b8a7,JSON[_0x6596('0x13')](_0x511df2));_0xc0c7f7(_0x511df2);})['catch'](function(_0x48cfb2){logger[_0x6596('0x14')]('UpdateOpenchannelInteraction',_0x48cfb2['message'],_0x13b8a7);_0x217588(_0x40a050[_0x6596('0x14')](0x1f4,_0x48cfb2[_0x6596('0x15')]));});});};exports[_0x6596('0x1d')]=function(_0x344195){return new Promise(function(_0x45b142,_0x4e1653){return db[_0x6596('0x18')][_0x6596('0x1e')]({'where':_0x344195[_0x6596('0x1a')]?_0x344195[_0x6596('0x1a')]['where']||null:null})[_0x6596('0xd')](function(_0x2d0889){if(_0x2d0889){return _0x2d0889[_0x6596('0x1f')](_0x344195[_0x6596('0x19')][_0x6596('0x20')],_[_0x6596('0x21')](_0x344195[_0x6596('0x19')],[_0x6596('0x20'),'id'])||{});}})[_0x6596('0x22')](function(_0x251256){logger['info'](_0x6596('0x23'),_0x344195);logger['debug'](_0x6596('0x23'),_0x344195,JSON['stringify'](_0x251256));_0x45b142(_0x251256);})[_0x6596('0x16')](function(_0xe1c3c2){logger[_0x6596('0x14')]('AddTags',_0xe1c3c2['message'],_0x344195);_0x4e1653(_this[_0x6596('0x14')](0x1f4,_0xe1c3c2[_0x6596('0x15')]));});});}; \ No newline at end of file +var _0xb4d2=['redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','OpenchannelInteraction','update','body','options','raw','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','where','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x114cbc,_0x5d447f){var _0xafba69=function(_0x1a4488){while(--_0x1a4488){_0x114cbc['push'](_0x114cbc['shift']());}};_0xafba69(++_0x5d447f);}(_0xb4d2,0x1d9));var _0x2b4d=function(_0x330c91,_0x28ea88){_0x330c91=_0x330c91-0x0;var _0x194b10=_0xb4d2[_0x330c91];return _0x194b10;};'use strict';var _=require('lodash');var util=require(_0x2b4d('0x0'));var moment=require(_0x2b4d('0x1'));var BPromise=require(_0x2b4d('0x2'));var rs=require(_0x2b4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b4d('0x4'))['db'];var utils=require(_0x2b4d('0x5'));var logger=require(_0x2b4d('0x6'))('rpc');var config=require(_0x2b4d('0x7'));var jayson=require(_0x2b4d('0x8'));var client=jayson[_0x2b4d('0x9')][_0x2b4d('0xa')]({'port':0x232a});config[_0x2b4d('0xb')]=_['defaults'](config['redis'],{'host':_0x2b4d('0xc'),'port':0x18eb});var socket=require(_0x2b4d('0xd'))(new Redis(config[_0x2b4d('0xb')]));require(_0x2b4d('0xe'))[_0x2b4d('0xf')](socket);function respondWithRpcPromise(_0x57d3ef,_0x558cfa,_0x569d6b){return new BPromise(function(_0x1e31b0,_0x58f2c2){return client[_0x2b4d('0x10')](_0x57d3ef,_0x569d6b)[_0x2b4d('0x11')](function(_0x1a44cd){logger[_0x2b4d('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x558cfa,_0x2b4d('0x13'));logger[_0x2b4d('0x14')](_0x2b4d('0x15'),_0x558cfa,_0x2b4d('0x13'),JSON[_0x2b4d('0x16')](_0x1a44cd));if(_0x1a44cd['error']){if(_0x1a44cd['error'][_0x2b4d('0x17')]===0x1f4){logger[_0x2b4d('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x558cfa,_0x1a44cd[_0x2b4d('0x18')][_0x2b4d('0x19')]);return _0x58f2c2(_0x1a44cd[_0x2b4d('0x18')][_0x2b4d('0x19')]);}logger['error'](_0x2b4d('0x1a'),_0x558cfa,_0x1a44cd[_0x2b4d('0x18')][_0x2b4d('0x19')]);return _0x1e31b0(_0x1a44cd['error'][_0x2b4d('0x19')]);}else{logger[_0x2b4d('0x12')](_0x2b4d('0x1a'),_0x558cfa,_0x2b4d('0x13'));_0x1e31b0(_0x1a44cd[_0x2b4d('0x1b')]['message']);}})[_0x2b4d('0x1c')](function(_0x387846){logger[_0x2b4d('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x558cfa,_0x387846);_0x58f2c2(_0x387846);});});}exports['UpdateOpenchannelInteraction']=function(_0x515cf4){var _0x358e69=this;return new Promise(function(_0x8a17cd,_0x39bfdc){return db[_0x2b4d('0x1d')][_0x2b4d('0x1e')](_0x515cf4[_0x2b4d('0x1f')],{'raw':_0x515cf4[_0x2b4d('0x20')]?_0x515cf4['options'][_0x2b4d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x515cf4['options']?_0x515cf4[_0x2b4d('0x20')]['where']||null:null,'attributes':_0x515cf4[_0x2b4d('0x20')]?_0x515cf4['options'][_0x2b4d('0x22')]||null:null,'limit':_0x515cf4[_0x2b4d('0x20')]?_0x515cf4[_0x2b4d('0x20')][_0x2b4d('0x23')]||null:null})[_0x2b4d('0x11')](function(_0x57a1a0){logger[_0x2b4d('0x12')](_0x2b4d('0x24'),_0x515cf4);logger[_0x2b4d('0x14')](_0x2b4d('0x24'),_0x515cf4,JSON[_0x2b4d('0x16')](_0x57a1a0));_0x8a17cd(_0x57a1a0);})[_0x2b4d('0x1c')](function(_0x3e2340){logger[_0x2b4d('0x18')](_0x2b4d('0x24'),_0x3e2340['message'],_0x515cf4);_0x39bfdc(_0x358e69[_0x2b4d('0x18')](0x1f4,_0x3e2340[_0x2b4d('0x19')]));});});};exports[_0x2b4d('0x25')]=function(_0x5e7b45){return new Promise(function(_0xab9b84,_0x4bcf16){return db['OpenchannelInteraction'][_0x2b4d('0x26')]({'where':_0x5e7b45[_0x2b4d('0x20')]?_0x5e7b45[_0x2b4d('0x20')][_0x2b4d('0x27')]||null:null})[_0x2b4d('0x11')](function(_0x4ed739){if(_0x4ed739){return _0x4ed739[_0x2b4d('0x28')](_0x5e7b45[_0x2b4d('0x1f')]['ids'],_['omit'](_0x5e7b45[_0x2b4d('0x1f')],[_0x2b4d('0x29'),'id'])||{});}})[_0x2b4d('0x2a')](function(_0x2cf7f3){logger['info'](_0x2b4d('0x2b'),_0x5e7b45);logger[_0x2b4d('0x14')](_0x2b4d('0x2b'),_0x5e7b45,JSON[_0x2b4d('0x16')](_0x2cf7f3));_0xab9b84(_0x2cf7f3);})[_0x2b4d('0x1c')](function(_0x1a30e2){logger[_0x2b4d('0x18')](_0x2b4d('0x2b'),_0x1a30e2['message'],_0x5e7b45);_0x4bcf16(_this[_0x2b4d('0x18')](0x1f4,_0x1a30e2[_0x2b4d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 509a8df..904d29b 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 _0x4858=['register','length','./openchannelInteraction.events','save','remove','update','emit','removeListener'];(function(_0x38f1b1,_0x4690c6){var _0x527ab6=function(_0xa5381f){while(--_0xa5381f){_0x38f1b1['push'](_0x38f1b1['shift']());}};_0x527ab6(++_0x4690c6);}(_0x4858,0x1da));var _0x8485=function(_0x440f34,_0x19d3b2){_0x440f34=_0x440f34-0x0;var _0x3f0107=_0x4858[_0x440f34];return _0x3f0107;};'use strict';var OpenchannelInteractionEvents=require(_0x8485('0x0'));var events=[_0x8485('0x1'),_0x8485('0x2'),_0x8485('0x3')];function createListener(_0x19fd51,_0x17baeb){return function(_0x3fdfb4){_0x17baeb[_0x8485('0x4')](_0x19fd51,_0x3fdfb4);};}function removeListener(_0x1906c7,_0x53255a){return function(){OpenchannelInteractionEvents[_0x8485('0x5')](_0x1906c7,_0x53255a);};}exports[_0x8485('0x6')]=function(_0x1d5508){for(var _0x471f5c=0x0,_0x2b39b1=events[_0x8485('0x7')];_0x471f5c<_0x2b39b1;_0x471f5c++){var _0x1b51f1=events[_0x471f5c];var _0x2341cf=createListener('openchannelInteraction:'+_0x1b51f1,_0x1d5508);OpenchannelInteractionEvents['on'](_0x1b51f1,_0x2341cf);}}; \ No newline at end of file +var _0x5c20=['length','openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c20,0x198));var _0x05c2=function(_0x230ea7,_0x5225da){_0x230ea7=_0x230ea7-0x0;var _0x123485=_0x5c20[_0x230ea7];return _0x123485;};'use strict';var OpenchannelInteractionEvents=require(_0x05c2('0x0'));var events=['save',_0x05c2('0x1'),'update'];function createListener(_0x4302ba,_0x510278){return function(_0x26fd7e){_0x510278[_0x05c2('0x2')](_0x4302ba,_0x26fd7e);};}function removeListener(_0x24dea9,_0x53c272){return function(){OpenchannelInteractionEvents[_0x05c2('0x3')](_0x24dea9,_0x53c272);};}exports[_0x05c2('0x4')]=function(_0x46bd6b){for(var _0x58eb50=0x0,_0x14de0f=events[_0x05c2('0x5')];_0x58eb50<_0x14de0f;_0x58eb50++){var _0x2a509e=events[_0x58eb50];var _0x3e1b05=createListener(_0x05c2('0x6')+_0x2a509e,_0x46bd6b);OpenchannelInteractionEvents['on'](_0x2a509e,_0x3e1b05);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ac7c8f7..c30c0ca 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0xc11333,_0x2e1fdf){var _0x3b1fd8=function(_0x39dc95){while(--_0x39dc95){_0xc11333['push'](_0xc11333['shift']());}};_0x3b1fd8(++_0x2e1fdf);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x21dc11,_0x55fbf3){var _0x54137c=function(_0x2113fd){while(--_0x2113fd){_0x21dc11['push'](_0x21dc11['shift']());}};_0x54137c(++_0x55fbf3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 4c1e960..bcd1902 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 _0x6ea9=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x50affd,_0x35f15e){var _0x1b5bcd=function(_0x2786c0){while(--_0x2786c0){_0x50affd['push'](_0x50affd['shift']());}};_0x1b5bcd(++_0x35f15e);}(_0x6ea9,0x89));var _0x96ea=function(_0x4c4c30,_0x455e56){_0x4c4c30=_0x4c4c30-0x0;var _0x17e465=_0x6ea9[_0x4c4c30];return _0x17e465;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'body':{'type':Sequelize[_0x96ea('0x2')](_0x96ea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x96ea('0x5')]('in',_0x96ea('0x6')),'defaultValue':_0x96ea('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x96ea('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x17a7=['STRING','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x17a7,0xc2));var _0x717a=function(_0x2d9130,_0x570dee){_0x2d9130=_0x2d9130-0x0;var _0x46a7b3=_0x17a7[_0x2d9130];return _0x46a7b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x717a('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x717a('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x717a('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x717a('0x2')]('in','out'),'defaultValue':_0x717a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x717a('0x4')]},'providerResponse':{'type':Sequelize[_0x717a('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e709b3e..700bbf9 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 _0x35a1=['openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','event','EventManager','acceptmessage','openchannel','RejectMessage','rejectMessage','SIP/%s','motionChannel','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','rawAttributes','keys','create','body','find','describe'];(function(_0xcd47d6,_0x5cc999){var _0x199c4b=function(_0x234bd7){while(--_0x234bd7){_0xcd47d6['push'](_0xcd47d6['shift']());}};_0x199c4b(++_0x5cc999);}(_0x35a1,0x1ad));var _0x135a=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x35a1[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x135a('0x0'));var zipdir=require(_0x135a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x135a('0x2'));var moment=require(_0x135a('0x3'));var BPromise=require(_0x135a('0x4'));var Mustache=require('mustache');var util=require(_0x135a('0x5'));var path=require(_0x135a('0x6'));var sox=require('sox');var csv=require(_0x135a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x135a('0x8'));var _=require(_0x135a('0x9'));var squel=require(_0x135a('0xa'));var crypto=require(_0x135a('0xb'));var jsforce=require(_0x135a('0xc'));var deskjs=require(_0x135a('0xd'));var toCsv=require(_0x135a('0x7'));var querystring=require(_0x135a('0xe'));var Papa=require(_0x135a('0xf'));var Redis=require(_0x135a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x135a('0x11'));var logger=require(_0x135a('0x12'))(_0x135a('0x13'));var utils=require(_0x135a('0x14'));var config=require(_0x135a('0x15'));var licenseUtil=require(_0x135a('0x16'));var db=require('../../mysqldb')['db'];config[_0x135a('0x17')]=_[_0x135a('0x18')](config[_0x135a('0x17')],{'host':_0x135a('0x19'),'port':0x18eb});var socket=require(_0x135a('0x1a'))(new Redis(config['redis']));require(_0x135a('0x1b'))['register'](socket);var jayson=require(_0x135a('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x135a('0x1d')][_0x135a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x343d21,_0xdec372,_0x48745f,_0x1a71da){return new BPromise(function(_0x487ce3,_0x220900){var _0x2242a6=_0x1a71da||client;return _0x2242a6[_0x135a('0x1f')](_0x343d21,_0x48745f)[_0x135a('0x20')](function(_0x35fdf7){logger[_0x135a('0x21')](_0x135a('0x22'),_0xdec372,_0x135a('0x23'));logger[_0x135a('0x24')](_0x135a('0x25'),_0xdec372,'request\x20sent',JSON[_0x135a('0x26')](_0x35fdf7));if(_0x35fdf7[_0x135a('0x27')]){if(_0x35fdf7[_0x135a('0x27')][_0x135a('0x28')]===0x1f4){logger['error'](_0x135a('0x22'),_0xdec372,_0x35fdf7['error']['message']);return _0x220900(_0x35fdf7[_0x135a('0x27')][_0x135a('0x29')]);}logger[_0x135a('0x27')](_0x135a('0x22'),_0xdec372,_0x35fdf7['error'][_0x135a('0x29')]);return _0x487ce3(_0x35fdf7[_0x135a('0x27')]['message']);}else{logger[_0x135a('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xdec372,_0x135a('0x23'));_0x487ce3(_0x35fdf7[_0x135a('0x2a')][_0x135a('0x29')]);}})[_0x135a('0x2b')](function(_0x58f0d9){logger[_0x135a('0x27')](_0x135a('0x22'),_0xdec372,_0x58f0d9);_0x220900(_0x58f0d9);});});}function respondWithStatusCode(_0x5d4f24,_0x2332ec){_0x2332ec=_0x2332ec||0xcc;return function(_0x446722){if(_0x446722){return _0x5d4f24[_0x135a('0x2c')](_0x2332ec);}return _0x5d4f24['status'](_0x2332ec)[_0x135a('0x2d')]();};}function respondWithResult(_0xe92ae9,_0x1504d3){_0x1504d3=_0x1504d3||0xc8;return function(_0x41a074){if(_0x41a074){return _0xe92ae9[_0x135a('0x2e')](_0x1504d3)[_0x135a('0x2f')](_0x41a074);}};}function respondWithFilteredResult(_0x1fe144,_0x320cce){return function(_0x147244){if(_0x147244){var _0x34d618=typeof _0x320cce[_0x135a('0x30')]===_0x135a('0x31')&&typeof _0x320cce[_0x135a('0x32')]===_0x135a('0x31');var _0xa0ae84=_0x147244[_0x135a('0x33')];var _0x5aa251=_0x34d618?0x0:_0x320cce[_0x135a('0x30')];var _0x3b5369=_0x34d618?_0x147244[_0x135a('0x33')]:_0x320cce['offset']+_0x320cce[_0x135a('0x32')];var _0xc14957;if(_0x3b5369>=_0xa0ae84){_0x3b5369=_0xa0ae84;_0xc14957=0xc8;}else{_0xc14957=0xce;}_0x1fe144[_0x135a('0x2e')](_0xc14957);return _0x1fe144[_0x135a('0x34')]('Content-Range',_0x5aa251+'-'+_0x3b5369+'/'+_0xa0ae84)[_0x135a('0x2f')](_0x147244);}return null;};}function patchUpdates(_0x409dcb){return function(_0x3e61c2){try{jsonpatch['apply'](_0x3e61c2,_0x409dcb,!![]);}catch(_0x23876e){return BPromise[_0x135a('0x35')](_0x23876e);}return _0x3e61c2['save']();};}function saveUpdates(_0xe3104,_0x55b6d7){return function(_0x1f5565){if(_0x1f5565){return _0x1f5565[_0x135a('0x36')](_0xe3104)[_0x135a('0x20')](function(_0x3cf481){return _0x3cf481;});}return null;};}function removeEntity(_0x46b6be,_0x5379c3){return function(_0x5a7b1d){if(_0x5a7b1d){return _0x5a7b1d[_0x135a('0x37')]()[_0x135a('0x20')](function(){_0x46b6be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b4ac,_0x2c26ac){return function(_0x4d1cb5){if(!_0x4d1cb5){_0x48b4ac[_0x135a('0x2c')](0x194);}return _0x4d1cb5;};}function handleError(_0x5823eb,_0x539c31){_0x539c31=_0x539c31||0x1f4;return function(_0x218a6a){logger[_0x135a('0x27')](_0x218a6a[_0x135a('0x38')]);if(_0x218a6a[_0x135a('0x39')]){delete _0x218a6a['name'];}_0x5823eb[_0x135a('0x2e')](_0x539c31)[_0x135a('0x3a')](_0x218a6a);};}exports[_0x135a('0x3b')]=function(_0x3626f4,_0x407b54){var _0x5b236f={},_0x47e5b7={},_0x1fc2a7={'count':0x0,'rows':[]};var _0x3d46eb=_[_0x135a('0x3c')](db[_0x135a('0x3d')]['rawAttributes'],function(_0x2edf87){return{'name':_0x2edf87[_0x135a('0x3e')],'type':_0x2edf87[_0x135a('0x3f')][_0x135a('0x40')]};});_0x47e5b7[_0x135a('0x41')]=_[_0x135a('0x3c')](_0x3d46eb,_0x135a('0x39'));_0x47e5b7[_0x135a('0x42')]=_['keys'](_0x3626f4[_0x135a('0x42')]);_0x47e5b7[_0x135a('0x43')]=_[_0x135a('0x44')](_0x47e5b7[_0x135a('0x41')],_0x47e5b7[_0x135a('0x42')]);_0x5b236f[_0x135a('0x45')]=_[_0x135a('0x44')](_0x47e5b7[_0x135a('0x41')],qs[_0x135a('0x46')](_0x3626f4['query'][_0x135a('0x46')]));_0x5b236f[_0x135a('0x45')]=_0x5b236f[_0x135a('0x45')][_0x135a('0x47')]?_0x5b236f[_0x135a('0x45')]:_0x47e5b7[_0x135a('0x41')];if(!_0x3626f4[_0x135a('0x42')][_0x135a('0x48')](_0x135a('0x49'))){_0x5b236f['limit']=qs[_0x135a('0x32')](_0x3626f4[_0x135a('0x42')][_0x135a('0x32')]);_0x5b236f[_0x135a('0x30')]=qs[_0x135a('0x30')](_0x3626f4['query'][_0x135a('0x30')]);}_0x5b236f[_0x135a('0x4a')]=qs[_0x135a('0x4b')](_0x3626f4[_0x135a('0x42')]['sort']);_0x5b236f[_0x135a('0x4c')]=qs[_0x135a('0x43')](_[_0x135a('0x4d')](_0x3626f4[_0x135a('0x42')],_0x47e5b7[_0x135a('0x43')]),_0x3d46eb);if(_0x3626f4[_0x135a('0x42')][_0x135a('0x4e')]){_0x5b236f[_0x135a('0x4c')]=_[_0x135a('0x4f')](_0x5b236f[_0x135a('0x4c')],{'$or':_[_0x135a('0x3c')](_0x3d46eb,function(_0x3aaf79){if(_0x3aaf79['type']!=='VIRTUAL'){var _0x9978b={};_0x9978b[_0x3aaf79[_0x135a('0x39')]]={'$like':'%'+_0x3626f4[_0x135a('0x42')][_0x135a('0x4e')]+'%'};return _0x9978b;}})});}_0x5b236f=_[_0x135a('0x4f')]({},_0x5b236f,_0x3626f4[_0x135a('0x50')]);var _0x25e17c={'where':_0x5b236f[_0x135a('0x4c')]};return db[_0x135a('0x3d')][_0x135a('0x33')](_0x25e17c)[_0x135a('0x20')](function(_0x3f15b3){_0x1fc2a7[_0x135a('0x33')]=_0x3f15b3;if(_0x3626f4['query'][_0x135a('0x51')]){_0x5b236f['include']=[{'all':!![]}];}return db[_0x135a('0x3d')][_0x135a('0x52')](_0x5b236f);})[_0x135a('0x20')](function(_0x2d8edb){_0x1fc2a7['rows']=_0x2d8edb;return _0x1fc2a7;})[_0x135a('0x20')](respondWithFilteredResult(_0x407b54,_0x5b236f))[_0x135a('0x2b')](handleError(_0x407b54,null));};exports[_0x135a('0x53')]=function(_0x25275e,_0x2d0e2e){var _0x264857={'raw':!![],'where':{'id':_0x25275e[_0x135a('0x54')]['id']}},_0x1a6091={};_0x1a6091[_0x135a('0x41')]=_['keys'](db['OpenchannelMessage'][_0x135a('0x55')]);_0x1a6091['query']=_[_0x135a('0x56')](_0x25275e[_0x135a('0x42')]);_0x1a6091['filters']=_['intersection'](_0x1a6091[_0x135a('0x41')],_0x1a6091[_0x135a('0x42')]);_0x264857[_0x135a('0x45')]=_[_0x135a('0x44')](_0x1a6091['model'],qs['fields'](_0x25275e['query'][_0x135a('0x46')]));_0x264857[_0x135a('0x45')]=_0x264857[_0x135a('0x45')][_0x135a('0x47')]?_0x264857['attributes']:_0x1a6091[_0x135a('0x41')];if(_0x25275e[_0x135a('0x42')][_0x135a('0x51')]){_0x264857['include']=[{'all':!![]}];}_0x264857=_[_0x135a('0x4f')]({},_0x264857,_0x25275e['options']);return db[_0x135a('0x3d')]['find'](_0x264857)[_0x135a('0x20')](handleEntityNotFound(_0x2d0e2e,null))[_0x135a('0x20')](respondWithResult(_0x2d0e2e,null))['catch'](handleError(_0x2d0e2e,null));};exports['create']=function(_0x56cc21,_0x57620a){return db[_0x135a('0x3d')][_0x135a('0x57')](_0x56cc21['body'],{})['then'](respondWithResult(_0x57620a,0xc9))[_0x135a('0x2b')](handleError(_0x57620a,null));};exports[_0x135a('0x36')]=function(_0x592774,_0x4395de){if(_0x592774[_0x135a('0x58')]['id']){delete _0x592774[_0x135a('0x58')]['id'];}return db['OpenchannelMessage'][_0x135a('0x59')]({'where':{'id':_0x592774[_0x135a('0x54')]['id']}})[_0x135a('0x20')](handleEntityNotFound(_0x4395de,null))[_0x135a('0x20')](saveUpdates(_0x592774['body'],null))[_0x135a('0x20')](respondWithResult(_0x4395de,null))[_0x135a('0x2b')](handleError(_0x4395de,null));};exports[_0x135a('0x37')]=function(_0x31fcb7,_0x332615){return db['OpenchannelMessage'][_0x135a('0x59')]({'where':{'id':_0x31fcb7[_0x135a('0x54')]['id']}})[_0x135a('0x20')](handleEntityNotFound(_0x332615,null))['then'](removeEntity(_0x332615,null))[_0x135a('0x2b')](handleError(_0x332615,null));};exports[_0x135a('0x5a')]=function(_0x2ece60,_0x5f243b){return db[_0x135a('0x3d')][_0x135a('0x5a')]()['then'](respondWithResult(_0x5f243b,null))[_0x135a('0x2b')](handleError(_0x5f243b,null));};var interaction_log=require(_0x135a('0x12'))(_0x135a('0x5b'));exports[_0x135a('0x5c')]=function(_0x69fb94,_0x306093,_0x50e364){var _0x4e55a7={'agent':{},'channel':'openchannel'};if(_0x69fb94[_0x135a('0x58')]['id']){delete _0x69fb94[_0x135a('0x58')]['id'];}_0x69fb94[_0x135a('0x58')][_0x135a('0x5d')]=!![];_0x69fb94[_0x135a('0x58')]['readAt']=moment()[_0x135a('0x5e')](_0x135a('0x5f'));_0x69fb94['body'][_0x135a('0x60')]=_0x69fb94[_0x135a('0x58')][_0x135a('0x60')]||_0x69fb94[_0x135a('0x61')]['id'];_0x4e55a7[_0x135a('0x62')]['id']=_0x69fb94[_0x135a('0x58')][_0x135a('0x60')];return db[_0x135a('0x3d')]['find']({'where':{'id':_0x69fb94[_0x135a('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x306093,null))[_0x135a('0x20')](saveUpdates(_0x69fb94[_0x135a('0x58')],null))[_0x135a('0x20')](function(_0x2f7b13){if(_0x2f7b13){_0x4e55a7[_0x135a('0x29')]=_0x2f7b13[_0x135a('0x63')]({'plain':!![]});return db[_0x135a('0x64')][_0x135a('0x59')]({'where':{'id':_0x2f7b13[_0x135a('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x306093,null))[_0x135a('0x20')](function(_0x45863c){if(_0x45863c){return _0x45863c[_0x135a('0x36')]({'UserId':_0x69fb94['body'][_0x135a('0x60')],'read1stAt':_[_0x135a('0x66')](_0x45863c[_0x135a('0x67')])?moment()[_0x135a('0x5e')](_0x135a('0x5f')):undefined});}return null;})[_0x135a('0x20')](function(_0x102800){if(_0x102800){_0x4e55a7[_0x135a('0x68')]=_0x102800[_0x135a('0x63')]({'plain':!![]});interaction_log[_0x135a('0x21')](_0x135a('0x69'),_0x69fb94[_0x135a('0x61')]['id'],_0x69fb94['user'][_0x135a('0x39')],_0x69fb94[_0x135a('0x61')][_0x135a('0x6a')],_0x4e55a7[_0x135a('0x68')]['id'],_0x69fb94[_0x135a('0x58')]?JSON[_0x135a('0x26')](_0x69fb94[_0x135a('0x58')]):_0x135a('0x6b'));return respondWithRpcPromise(_0x135a('0x6c'),_0x135a('0x6d'),_0x4e55a7);}return null;})[_0x135a('0x20')](function(_0x1dcb61){var _0x24371c=_0x135a('0x6e')+_0x1dcb61['message'][_0x135a('0x6f')];return db[_0x135a('0x70')]['query'](_0x24371c,{'type':db[_0x135a('0x71')][_0x135a('0x72')][_0x135a('0x73')],'raw':!![]})[_0x135a('0x20')](function(_0x3cefa8){return _0x3cefa8;});})['then'](function(_0x8d5c94){if(_0x8d5c94){_0x4e55a7[_0x135a('0x29')][_0x135a('0x74')]=_0x8d5c94[0x0];if(!_0x69fb94[_0x135a('0x58')][_0x135a('0x60')])return;return db[_0x135a('0x75')][_0x135a('0x59')]({'where':{'id':_0x69fb94[_0x135a('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x135a('0x39'),_0x135a('0x76'),_0x135a('0x77'),'internal'],'raw':!![]});}return null;})[_0x135a('0x20')](function(_0x24c17a){if(!_0x24c17a)return null;_0x4e55a7[_0x135a('0x29')][_0x135a('0x62')]=_0x24c17a;return _0x4e55a7;})[_0x135a('0x20')](function(_0x42497e){if(_0x42497e){if(_0x69fb94[_0x135a('0x58')]['manual']){_0x4e55a7[_0x135a('0x29')][_0x135a('0x78')]=util[_0x135a('0x5e')]('SIP/%s',_0x69fb94[_0x135a('0x61')][_0x135a('0x39')]);_0x4e55a7['message'][_0x135a('0x79')]=_0x4e55a7['channel'];_0x4e55a7[_0x135a('0x29')]['motionChannel']=_0x4e55a7[_0x135a('0x79')];_0x4e55a7[_0x135a('0x29')][_0x135a('0x7a')]='accept';return respondWithRpcPromise(_0x135a('0x7b'),_0x135a('0x7b'),{'event':_0x135a('0x7c'),'message':_0x4e55a7[_0x135a('0x29')]},client9002)[_0x135a('0x20')](function(){return _0x4e55a7;});}return _0x4e55a7;}return null;})[_0x135a('0x20')](respondWithResult(_0x306093,null))[_0x135a('0x2b')](handleError(_0x306093,null));};var interaction_log=require(_0x135a('0x12'))('openchannel-interactions');exports[_0x135a('0x35')]=function(_0x10e5ff,_0x2d8a22,_0x5780f6){var _0x2c5f52={'agent':{},'channel':_0x135a('0x7d')};if(_0x10e5ff['body']['id']){delete _0x10e5ff[_0x135a('0x58')]['id'];}_0x10e5ff[_0x135a('0x58')][_0x135a('0x60')]=_0x10e5ff[_0x135a('0x58')][_0x135a('0x60')]||_0x10e5ff[_0x135a('0x61')]['id'];_0x2c5f52[_0x135a('0x62')]['id']=_0x10e5ff[_0x135a('0x58')]['UserId'];return db['OpenchannelMessage'][_0x135a('0x59')]({'where':{'id':_0x10e5ff['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d8a22,null))[_0x135a('0x20')](function(_0x1358ca){if(_0x1358ca){_0x2c5f52[_0x135a('0x29')]=_0x1358ca[_0x135a('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0x135a('0x59')]({'where':{'id':_0x1358ca[_0x135a('0x65')]}});}return null;})[_0x135a('0x20')](handleEntityNotFound(_0x2d8a22,null))[_0x135a('0x20')](function(_0x35d007){if(_0x35d007){_0x2c5f52['interaction']=_0x35d007[_0x135a('0x63')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10e5ff['user']['id'],_0x10e5ff['user'][_0x135a('0x39')],_0x10e5ff['user'][_0x135a('0x6a')],_0x2c5f52['interaction']['id'],_0x10e5ff[_0x135a('0x58')]?JSON[_0x135a('0x26')](_0x10e5ff['body']):_0x135a('0x6b'));return respondWithRpcPromise(_0x135a('0x7e'),_0x135a('0x7f'),_0x2c5f52);}return null;})['then'](function(_0x395241){var _0x444683='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x395241['message'][_0x135a('0x6f')];return db['sequelize']['query'](_0x444683,{'type':db['Sequelize'][_0x135a('0x72')][_0x135a('0x73')],'raw':!![]})[_0x135a('0x20')](function(_0x370e38){return _0x370e38;});})['then'](function(_0x556190){if(_0x556190){_0x2c5f52['message'][_0x135a('0x74')]=_0x556190[0x0];if(!_0x10e5ff[_0x135a('0x58')][_0x135a('0x60')])return;return db[_0x135a('0x75')][_0x135a('0x59')]({'where':{'id':_0x10e5ff[_0x135a('0x58')]['UserId'],'role':_0x135a('0x62')},'attributes':['id',_0x135a('0x39'),'fullname',_0x135a('0x77'),'internal'],'raw':!![]});}return null;})[_0x135a('0x20')](function(_0x3599c7){if(!_0x3599c7)return null;_0x2c5f52['message'][_0x135a('0x62')]=_0x3599c7;return _0x2c5f52;})['then'](function(_0x1b1bba){if(_0x1b1bba){_0x1b1bba[_0x135a('0x29')][_0x135a('0x78')]=util[_0x135a('0x5e')](_0x135a('0x80'),_0x10e5ff[_0x135a('0x61')]['name']);_0x1b1bba[_0x135a('0x29')][_0x135a('0x79')]=_0x2c5f52['channel'];_0x1b1bba[_0x135a('0x29')][_0x135a('0x81')]=_0x2c5f52['channel'];_0x1b1bba['message'][_0x135a('0x7a')]=_0x135a('0x35');respondWithRpcPromise(_0x135a('0x7b'),_0x135a('0x7b'),{'event':'rejectmessage','message':_0x1b1bba[_0x135a('0x29')]},client9002);return _0x2c5f52;}return null;})[_0x135a('0x20')](respondWithResult(_0x2d8a22,null))[_0x135a('0x2b')](handleError(_0x2d8a22,null));}; \ No newline at end of file +var _0xfb65=['event','EventManager','acceptmessage','../../config/logger','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','SIP/%s','motionChannel','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','map','OpenchannelMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','include','find','create','body','describe','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','format','channel'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb65,0x8c));var _0x5fb6=function(_0x5d2ebe,_0x2ac299){_0x5d2ebe=_0x5d2ebe-0x0;var _0x96421b=_0xfb65[_0x5d2ebe];return _0x96421b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fb6('0x0'));var zipdir=require(_0x5fb6('0x1'));var jsonpatch=require(_0x5fb6('0x2'));var rp=require(_0x5fb6('0x3'));var moment=require(_0x5fb6('0x4'));var BPromise=require(_0x5fb6('0x5'));var Mustache=require('mustache');var util=require(_0x5fb6('0x6'));var path=require(_0x5fb6('0x7'));var sox=require('sox');var csv=require(_0x5fb6('0x8'));var ejs=require(_0x5fb6('0x9'));var fs=require('fs');var fs_extra=require(_0x5fb6('0xa'));var _=require('lodash');var squel=require(_0x5fb6('0xb'));var crypto=require('crypto');var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5fb6('0xd'));var Papa=require(_0x5fb6('0xe'));var Redis=require(_0x5fb6('0xf'));var authService=require(_0x5fb6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5fb6('0x11'));var hardwareService=require(_0x5fb6('0x12'));var logger=require('../../config/logger')(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var licenseUtil=require(_0x5fb6('0x16'));var db=require(_0x5fb6('0x17'))['db'];config[_0x5fb6('0x18')]=_['defaults'](config[_0x5fb6('0x18')],{'host':_0x5fb6('0x19'),'port':0x18eb});var socket=require(_0x5fb6('0x1a'))(new Redis(config['redis']));require(_0x5fb6('0x1b'))['register'](socket);var jayson=require(_0x5fb6('0x1c'));var client=jayson[_0x5fb6('0x1d')][_0x5fb6('0x1e')]({'port':0x232c});var client9002=jayson[_0x5fb6('0x1d')][_0x5fb6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x43828b,_0x4c1cdf,_0xe6e7fb,_0x1168c4){return new BPromise(function(_0x2930a7,_0x581c31){var _0x518020=_0x1168c4||client;return _0x518020[_0x5fb6('0x1f')](_0x43828b,_0xe6e7fb)['then'](function(_0x3b0b87){logger[_0x5fb6('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x4c1cdf,_0x5fb6('0x21'));logger[_0x5fb6('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4c1cdf,'request\x20sent',JSON[_0x5fb6('0x23')](_0x3b0b87));if(_0x3b0b87[_0x5fb6('0x24')]){if(_0x3b0b87[_0x5fb6('0x24')][_0x5fb6('0x25')]===0x1f4){logger[_0x5fb6('0x24')](_0x5fb6('0x26'),_0x4c1cdf,_0x3b0b87[_0x5fb6('0x24')]['message']);return _0x581c31(_0x3b0b87[_0x5fb6('0x24')]['message']);}logger[_0x5fb6('0x24')](_0x5fb6('0x26'),_0x4c1cdf,_0x3b0b87[_0x5fb6('0x24')][_0x5fb6('0x27')]);return _0x2930a7(_0x3b0b87['error'][_0x5fb6('0x27')]);}else{logger[_0x5fb6('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x4c1cdf,_0x5fb6('0x21'));_0x2930a7(_0x3b0b87['result'][_0x5fb6('0x27')]);}})[_0x5fb6('0x28')](function(_0x4fa1e0){logger[_0x5fb6('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4c1cdf,_0x4fa1e0);_0x581c31(_0x4fa1e0);});});}function respondWithStatusCode(_0x55fa52,_0x169817){_0x169817=_0x169817||0xcc;return function(_0x7bea12){if(_0x7bea12){return _0x55fa52[_0x5fb6('0x29')](_0x169817);}return _0x55fa52[_0x5fb6('0x2a')](_0x169817)['end']();};}function respondWithResult(_0x41ea87,_0x309bc0){_0x309bc0=_0x309bc0||0xc8;return function(_0x802306){if(_0x802306){return _0x41ea87['status'](_0x309bc0)[_0x5fb6('0x2b')](_0x802306);}};}function respondWithFilteredResult(_0x753de9,_0x249e51){return function(_0x57437d){if(_0x57437d){var _0x68b491=typeof _0x249e51[_0x5fb6('0x2c')]===_0x5fb6('0x2d')&&typeof _0x249e51['limit']===_0x5fb6('0x2d');var _0x303c4a=_0x57437d[_0x5fb6('0x2e')];var _0x52ea14=_0x68b491?0x0:_0x249e51[_0x5fb6('0x2c')];var _0x5f27fc=_0x68b491?_0x57437d[_0x5fb6('0x2e')]:_0x249e51[_0x5fb6('0x2c')]+_0x249e51[_0x5fb6('0x2f')];var _0x2b167f;if(_0x5f27fc>=_0x303c4a){_0x5f27fc=_0x303c4a;_0x2b167f=0xc8;}else{_0x2b167f=0xce;}_0x753de9['status'](_0x2b167f);return _0x753de9[_0x5fb6('0x30')](_0x5fb6('0x31'),_0x52ea14+'-'+_0x5f27fc+'/'+_0x303c4a)[_0x5fb6('0x2b')](_0x57437d);}return null;};}function patchUpdates(_0xfe78ba){return function(_0x41f184){try{jsonpatch[_0x5fb6('0x32')](_0x41f184,_0xfe78ba,!![]);}catch(_0x20c89e){return BPromise[_0x5fb6('0x33')](_0x20c89e);}return _0x41f184[_0x5fb6('0x34')]();};}function saveUpdates(_0x2d8e99,_0x21ddfb){return function(_0x20b80f){if(_0x20b80f){return _0x20b80f[_0x5fb6('0x35')](_0x2d8e99)[_0x5fb6('0x36')](function(_0x5dd68a){return _0x5dd68a;});}return null;};}function removeEntity(_0x54466b,_0x5c0dab){return function(_0x3825e1){if(_0x3825e1){return _0x3825e1['destroy']()[_0x5fb6('0x36')](function(){_0x54466b['status'](0xcc)[_0x5fb6('0x37')]();});}};}function handleEntityNotFound(_0x29658c,_0x1e0fc1){return function(_0x7c8e2){if(!_0x7c8e2){_0x29658c['sendStatus'](0x194);}return _0x7c8e2;};}function handleError(_0x379652,_0x60d892){_0x60d892=_0x60d892||0x1f4;return function(_0x5d32d4){logger[_0x5fb6('0x24')](_0x5d32d4[_0x5fb6('0x38')]);if(_0x5d32d4['name']){delete _0x5d32d4[_0x5fb6('0x39')];}_0x379652[_0x5fb6('0x2a')](_0x60d892)[_0x5fb6('0x3a')](_0x5d32d4);};}exports['index']=function(_0x5bfb54,_0x295edc){var _0x39a66c={},_0xdc76cf={},_0x48f5e8={'count':0x0,'rows':[]};var _0x40991b=_[_0x5fb6('0x3b')](db[_0x5fb6('0x3c')][_0x5fb6('0x3d')],function(_0x4582c7){return{'name':_0x4582c7['fieldName'],'type':_0x4582c7[_0x5fb6('0x3e')]['key']};});_0xdc76cf[_0x5fb6('0x3f')]=_['map'](_0x40991b,_0x5fb6('0x39'));_0xdc76cf[_0x5fb6('0x40')]=_[_0x5fb6('0x41')](_0x5bfb54[_0x5fb6('0x40')]);_0xdc76cf[_0x5fb6('0x42')]=_[_0x5fb6('0x43')](_0xdc76cf[_0x5fb6('0x3f')],_0xdc76cf['query']);_0x39a66c[_0x5fb6('0x44')]=_[_0x5fb6('0x43')](_0xdc76cf[_0x5fb6('0x3f')],qs[_0x5fb6('0x45')](_0x5bfb54[_0x5fb6('0x40')][_0x5fb6('0x45')]));_0x39a66c[_0x5fb6('0x44')]=_0x39a66c[_0x5fb6('0x44')]['length']?_0x39a66c[_0x5fb6('0x44')]:_0xdc76cf[_0x5fb6('0x3f')];if(!_0x5bfb54[_0x5fb6('0x40')][_0x5fb6('0x46')](_0x5fb6('0x47'))){_0x39a66c['limit']=qs[_0x5fb6('0x2f')](_0x5bfb54['query'][_0x5fb6('0x2f')]);_0x39a66c['offset']=qs[_0x5fb6('0x2c')](_0x5bfb54[_0x5fb6('0x40')][_0x5fb6('0x2c')]);}_0x39a66c[_0x5fb6('0x48')]=qs['sort'](_0x5bfb54[_0x5fb6('0x40')][_0x5fb6('0x49')]);_0x39a66c[_0x5fb6('0x4a')]=qs[_0x5fb6('0x42')](_['pick'](_0x5bfb54[_0x5fb6('0x40')],_0xdc76cf['filters']),_0x40991b);if(_0x5bfb54['query'][_0x5fb6('0x4b')]){_0x39a66c['where']=_[_0x5fb6('0x4c')](_0x39a66c[_0x5fb6('0x4a')],{'$or':_[_0x5fb6('0x3b')](_0x40991b,function(_0x18a481){if(_0x18a481[_0x5fb6('0x3e')]!==_0x5fb6('0x4d')){var _0x18c99d={};_0x18c99d[_0x18a481[_0x5fb6('0x39')]]={'$like':'%'+_0x5bfb54[_0x5fb6('0x40')][_0x5fb6('0x4b')]+'%'};return _0x18c99d;}})});}_0x39a66c=_['merge']({},_0x39a66c,_0x5bfb54[_0x5fb6('0x4e')]);var _0x168e9f={'where':_0x39a66c[_0x5fb6('0x4a')]};return db[_0x5fb6('0x3c')]['count'](_0x168e9f)[_0x5fb6('0x36')](function(_0x58c34c){_0x48f5e8['count']=_0x58c34c;if(_0x5bfb54['query'][_0x5fb6('0x4f')]){_0x39a66c['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x39a66c);})[_0x5fb6('0x36')](function(_0x54e388){_0x48f5e8[_0x5fb6('0x50')]=_0x54e388;return _0x48f5e8;})[_0x5fb6('0x36')](respondWithFilteredResult(_0x295edc,_0x39a66c))['catch'](handleError(_0x295edc,null));};exports[_0x5fb6('0x51')]=function(_0x35dc2d,_0x7817de){var _0xd91779={'raw':!![],'where':{'id':_0x35dc2d[_0x5fb6('0x52')]['id']}},_0x52383d={};_0x52383d[_0x5fb6('0x3f')]=_[_0x5fb6('0x41')](db[_0x5fb6('0x3c')][_0x5fb6('0x3d')]);_0x52383d['query']=_[_0x5fb6('0x41')](_0x35dc2d[_0x5fb6('0x40')]);_0x52383d[_0x5fb6('0x42')]=_[_0x5fb6('0x43')](_0x52383d[_0x5fb6('0x3f')],_0x52383d['query']);_0xd91779[_0x5fb6('0x44')]=_['intersection'](_0x52383d[_0x5fb6('0x3f')],qs[_0x5fb6('0x45')](_0x35dc2d['query'][_0x5fb6('0x45')]));_0xd91779['attributes']=_0xd91779[_0x5fb6('0x44')][_0x5fb6('0x53')]?_0xd91779[_0x5fb6('0x44')]:_0x52383d[_0x5fb6('0x3f')];if(_0x35dc2d[_0x5fb6('0x40')]['includeAll']){_0xd91779[_0x5fb6('0x54')]=[{'all':!![]}];}_0xd91779=_[_0x5fb6('0x4c')]({},_0xd91779,_0x35dc2d['options']);return db[_0x5fb6('0x3c')][_0x5fb6('0x55')](_0xd91779)[_0x5fb6('0x36')](handleEntityNotFound(_0x7817de,null))['then'](respondWithResult(_0x7817de,null))[_0x5fb6('0x28')](handleError(_0x7817de,null));};exports['create']=function(_0x30f5c1,_0x56075a){return db[_0x5fb6('0x3c')][_0x5fb6('0x56')](_0x30f5c1['body'],{})[_0x5fb6('0x36')](respondWithResult(_0x56075a,0xc9))[_0x5fb6('0x28')](handleError(_0x56075a,null));};exports['update']=function(_0x356056,_0x1140c0){if(_0x356056['body']['id']){delete _0x356056[_0x5fb6('0x57')]['id'];}return db[_0x5fb6('0x3c')]['find']({'where':{'id':_0x356056[_0x5fb6('0x52')]['id']}})['then'](handleEntityNotFound(_0x1140c0,null))[_0x5fb6('0x36')](saveUpdates(_0x356056[_0x5fb6('0x57')],null))[_0x5fb6('0x36')](respondWithResult(_0x1140c0,null))[_0x5fb6('0x28')](handleError(_0x1140c0,null));};exports['destroy']=function(_0x374007,_0x21f06b){return db[_0x5fb6('0x3c')][_0x5fb6('0x55')]({'where':{'id':_0x374007[_0x5fb6('0x52')]['id']}})['then'](handleEntityNotFound(_0x21f06b,null))[_0x5fb6('0x36')](removeEntity(_0x21f06b,null))[_0x5fb6('0x28')](handleError(_0x21f06b,null));};exports[_0x5fb6('0x58')]=function(_0x20eac3,_0x1a035f){return db['OpenchannelMessage'][_0x5fb6('0x58')]()['then'](respondWithResult(_0x1a035f,null))[_0x5fb6('0x28')](handleError(_0x1a035f,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x5fb6('0x59')]=function(_0x569f85,_0x43e6dc,_0x9a9122){var _0xed5f1={'agent':{},'channel':_0x5fb6('0x5a')};if(_0x569f85[_0x5fb6('0x57')]['id']){delete _0x569f85['body']['id'];}_0x569f85[_0x5fb6('0x57')][_0x5fb6('0x5b')]=!![];_0x569f85[_0x5fb6('0x57')]['readAt']=moment()['format'](_0x5fb6('0x5c'));_0x569f85[_0x5fb6('0x57')][_0x5fb6('0x5d')]=_0x569f85[_0x5fb6('0x57')]['UserId']||_0x569f85[_0x5fb6('0x5e')]['id'];_0xed5f1[_0x5fb6('0x5f')]['id']=_0x569f85[_0x5fb6('0x57')][_0x5fb6('0x5d')];return db[_0x5fb6('0x3c')][_0x5fb6('0x55')]({'where':{'id':_0x569f85[_0x5fb6('0x52')]['id'],'UserId':null}})[_0x5fb6('0x36')](handleEntityNotFound(_0x43e6dc,null))[_0x5fb6('0x36')](saveUpdates(_0x569f85[_0x5fb6('0x57')],null))['then'](function(_0x154347){if(_0x154347){_0xed5f1[_0x5fb6('0x27')]=_0x154347[_0x5fb6('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5fb6('0x55')]({'where':{'id':_0x154347[_0x5fb6('0x61')]}});}return null;})[_0x5fb6('0x36')](handleEntityNotFound(_0x43e6dc,null))[_0x5fb6('0x36')](function(_0x21ba9f){if(_0x21ba9f){return _0x21ba9f[_0x5fb6('0x35')]({'UserId':_0x569f85[_0x5fb6('0x57')][_0x5fb6('0x5d')],'read1stAt':_[_0x5fb6('0x62')](_0x21ba9f[_0x5fb6('0x63')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x193baa){if(_0x193baa){_0xed5f1[_0x5fb6('0x64')]=_0x193baa[_0x5fb6('0x60')]({'plain':!![]});interaction_log[_0x5fb6('0x20')](_0x5fb6('0x65'),_0x569f85[_0x5fb6('0x5e')]['id'],_0x569f85['user'][_0x5fb6('0x39')],_0x569f85[_0x5fb6('0x5e')][_0x5fb6('0x66')],_0xed5f1[_0x5fb6('0x64')]['id'],_0x569f85[_0x5fb6('0x57')]?JSON[_0x5fb6('0x23')](_0x569f85[_0x5fb6('0x57')]):_0x5fb6('0x67'));return respondWithRpcPromise(_0x5fb6('0x68'),_0x5fb6('0x69'),_0xed5f1);}return null;})['then'](function(_0x41cc11){var _0x1d838f=_0x5fb6('0x6a')+_0x41cc11['message']['ContactId'];return db['sequelize'][_0x5fb6('0x40')](_0x1d838f,{'type':db[_0x5fb6('0x6b')][_0x5fb6('0x6c')][_0x5fb6('0x6d')],'raw':!![]})[_0x5fb6('0x36')](function(_0x3c39f0){return _0x3c39f0;});})[_0x5fb6('0x36')](function(_0x22f6bc){if(_0x22f6bc){_0xed5f1[_0x5fb6('0x27')][_0x5fb6('0x6e')]=_0x22f6bc[0x0];if(!_0x569f85[_0x5fb6('0x57')][_0x5fb6('0x5d')])return;return db[_0x5fb6('0x6f')]['find']({'where':{'id':_0x569f85['body'][_0x5fb6('0x5d')],'role':'agent'},'attributes':['id',_0x5fb6('0x39'),_0x5fb6('0x70'),'email',_0x5fb6('0x71')],'raw':!![]});}return null;})['then'](function(_0x49af0b){if(!_0x49af0b)return null;_0xed5f1[_0x5fb6('0x27')][_0x5fb6('0x5f')]=_0x49af0b;return _0xed5f1;})['then'](function(_0x3ba43f){if(_0x3ba43f){if(_0x569f85[_0x5fb6('0x57')]['manual']){_0xed5f1['message']['interface']=util[_0x5fb6('0x72')]('SIP/%s',_0x569f85[_0x5fb6('0x5e')][_0x5fb6('0x39')]);_0xed5f1['message']['channel']=_0xed5f1[_0x5fb6('0x73')];_0xed5f1['message']['motionChannel']=_0xed5f1['channel'];_0xed5f1['message'][_0x5fb6('0x74')]=_0x5fb6('0x59');return respondWithRpcPromise(_0x5fb6('0x75'),_0x5fb6('0x75'),{'event':_0x5fb6('0x76'),'message':_0xed5f1['message']},client9002)['then'](function(){return _0xed5f1;});}return _0xed5f1;}return null;})[_0x5fb6('0x36')](respondWithResult(_0x43e6dc,null))[_0x5fb6('0x28')](handleError(_0x43e6dc,null));};var interaction_log=require(_0x5fb6('0x77'))(_0x5fb6('0x78'));exports[_0x5fb6('0x33')]=function(_0x23071e,_0x2775c0,_0x5587d4){var _0x49291a={'agent':{},'channel':_0x5fb6('0x5a')};if(_0x23071e[_0x5fb6('0x57')]['id']){delete _0x23071e[_0x5fb6('0x57')]['id'];}_0x23071e['body']['UserId']=_0x23071e['body'][_0x5fb6('0x5d')]||_0x23071e[_0x5fb6('0x5e')]['id'];_0x49291a[_0x5fb6('0x5f')]['id']=_0x23071e[_0x5fb6('0x57')][_0x5fb6('0x5d')];return db[_0x5fb6('0x3c')][_0x5fb6('0x55')]({'where':{'id':_0x23071e[_0x5fb6('0x52')]['id'],'UserId':null}})[_0x5fb6('0x36')](handleEntityNotFound(_0x2775c0,null))[_0x5fb6('0x36')](function(_0x54b14f){if(_0x54b14f){_0x49291a['message']=_0x54b14f[_0x5fb6('0x60')]({'plain':!![]});return db[_0x5fb6('0x79')]['find']({'where':{'id':_0x54b14f[_0x5fb6('0x61')]}});}return null;})[_0x5fb6('0x36')](handleEntityNotFound(_0x2775c0,null))['then'](function(_0x3755b6){if(_0x3755b6){_0x49291a['interaction']=_0x3755b6[_0x5fb6('0x60')]({'plain':!![]});interaction_log[_0x5fb6('0x20')](_0x5fb6('0x7a'),_0x23071e[_0x5fb6('0x5e')]['id'],_0x23071e[_0x5fb6('0x5e')][_0x5fb6('0x39')],_0x23071e[_0x5fb6('0x5e')]['role'],_0x49291a['interaction']['id'],_0x23071e['body']?JSON['stringify'](_0x23071e['body']):_0x5fb6('0x67'));return respondWithRpcPromise(_0x5fb6('0x7b'),'rejectMessage',_0x49291a);}return null;})['then'](function(_0x51eeb5){var _0x4c7e4d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x51eeb5[_0x5fb6('0x27')][_0x5fb6('0x7c')];return db[_0x5fb6('0x7d')][_0x5fb6('0x40')](_0x4c7e4d,{'type':db[_0x5fb6('0x6b')][_0x5fb6('0x6c')][_0x5fb6('0x6d')],'raw':!![]})[_0x5fb6('0x36')](function(_0x5662f8){return _0x5662f8;});})[_0x5fb6('0x36')](function(_0x431685){if(_0x431685){_0x49291a['message'][_0x5fb6('0x6e')]=_0x431685[0x0];if(!_0x23071e[_0x5fb6('0x57')][_0x5fb6('0x5d')])return;return db['User'][_0x5fb6('0x55')]({'where':{'id':_0x23071e[_0x5fb6('0x57')]['UserId'],'role':_0x5fb6('0x5f')},'attributes':['id',_0x5fb6('0x39'),_0x5fb6('0x70'),'email',_0x5fb6('0x71')],'raw':!![]});}return null;})[_0x5fb6('0x36')](function(_0x2b9d8f){if(!_0x2b9d8f)return null;_0x49291a[_0x5fb6('0x27')][_0x5fb6('0x5f')]=_0x2b9d8f;return _0x49291a;})['then'](function(_0x39902b){if(_0x39902b){_0x39902b['message']['interface']=util[_0x5fb6('0x72')](_0x5fb6('0x7e'),_0x23071e[_0x5fb6('0x5e')][_0x5fb6('0x39')]);_0x39902b['message'][_0x5fb6('0x73')]=_0x49291a[_0x5fb6('0x73')];_0x39902b[_0x5fb6('0x27')][_0x5fb6('0x7f')]=_0x49291a[_0x5fb6('0x73')];_0x39902b[_0x5fb6('0x27')][_0x5fb6('0x74')]=_0x5fb6('0x33');respondWithRpcPromise(_0x5fb6('0x75'),_0x5fb6('0x75'),{'event':'rejectmessage','message':_0x39902b[_0x5fb6('0x27')]},client9002);return _0x49291a;}return null;})[_0x5fb6('0x36')](respondWithResult(_0x2775c0,null))[_0x5fb6('0x28')](handleError(_0x2775c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9e80c7c..c06cd77 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 _0x6523=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners'];(function(_0x1b69f5,_0x528d25){var _0x35fbfb=function(_0xfe06f7){while(--_0xfe06f7){_0x1b69f5['push'](_0x1b69f5['shift']());}};_0x35fbfb(++_0x528d25);}(_0x6523,0x65));var _0x3652=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x6523[_0x4ec13d];return _0x3c3fa7;};'use strict';var EventEmitter=require(_0x3652('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3652('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3652('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3652('0x3')};function emitEvent(_0x1c1027){return function(_0xe6a999,_0x5eea64,_0x1f1570){OpenchannelMessageEvents[_0x3652('0x4')](_0x1c1027+':'+_0xe6a999['id'],_0xe6a999);OpenchannelMessageEvents[_0x3652('0x4')](_0x1c1027,_0xe6a999);_0x1f1570(null);};}for(var e in events){if(events[_0x3652('0x5')](e)){var event=events[e];OpenchannelMessage[_0x3652('0x6')](e,emitEvent(event));}}module[_0x3652('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe25f=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xe25f,0x119));var _0xfe25=function(_0x39db3d,_0x39a60d){_0x39db3d=_0x39db3d-0x0;var _0x39b5e1=_0xe25f[_0x39db3d];return _0x39b5e1;};'use strict';var EventEmitter=require(_0xfe25('0x0'));var OpenchannelMessage=require(_0xfe25('0x1'))['db'][_0xfe25('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfe25('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe25('0x4'),'afterDestroy':_0xfe25('0x5')};function emitEvent(_0x3d0f03){return function(_0x2d41e2,_0x4cd28a,_0x192d54){OpenchannelMessageEvents[_0xfe25('0x6')](_0x3d0f03+':'+_0x2d41e2['id'],_0x2d41e2);OpenchannelMessageEvents[_0xfe25('0x6')](_0x3d0f03,_0x2d41e2);_0x192d54(null);};}for(var e in events){if(events[_0xfe25('0x7')](e)){var event=events[e];OpenchannelMessage[_0xfe25('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9e634a1..27fc5bb 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x1f5513,_0x486e28){var _0x5e38a3=function(_0x315dcf){while(--_0x315dcf){_0x1f5513['push'](_0x1f5513['shift']());}};_0x5e38a3(++_0x486e28);}(_0x2032,0xd9));var _0x2203=function(_0x3c585d,_0x3890d5){_0x3c585d=_0x3c585d-0x0;var _0xe6f36b=_0x2032[_0x3c585d];return _0xe6f36b;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0xa571=['afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Contact','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','OpenchannelInteractionId','createdAt','catch','error','CmContact','then','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions'];(function(_0x196cc3,_0x3e4899){var _0x5b4f97=function(_0x37ede4){while(--_0x37ede4){_0x196cc3['push'](_0x196cc3['shift']());}};_0x5b4f97(++_0x3e4899);}(_0xa571,0x107));var _0x1a57=function(_0x1c7382,_0x3b7223){_0x1c7382=_0x1c7382-0x0;var _0x13f9e8=_0xa571[_0x1c7382];return _0x13f9e8;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x1a57('0xb')],'type':_0x1a57('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3631d6,_0x58e266,_0x3c8182){var _0x1f7086=_0xd97a33[_0x1a57('0xd')];var _0x289dc0=_0x3631d6[_0x1a57('0xe')]({'plain':!![]});if(_0x289dc0[_0x1a57('0xf')][_0x1a57('0x10')]()==='in'||_0x289dc0[_0x1a57('0xf')]['toLowerCase']()==='out'&&!_0x289dc0[_0x1a57('0x11')]&&!_[_0x1a57('0x12')](_0x289dc0[_0x1a57('0x13')])){_0x1f7086['OpenchannelInteraction'][_0x1a57('0x14')]({'where':{'id':_0x289dc0[_0x1a57('0x15')]}})['then'](function(_0x503278){if(_0x503278){_0x503278['update']({'lastMsgAt':_0x289dc0[_0x1a57('0x16')],'lastMsgDirection':_0x289dc0[_0x1a57('0xf')][_0x1a57('0x10')]()});}})[_0x1a57('0x17')](function(_0x5802d6){console[_0x1a57('0x18')](_0x5802d6);});}if(_0x289dc0['direction']==='out'&&!_0x289dc0[_0x1a57('0x11')]){var _0x1c537f;_0x1f7086[_0x1a57('0x19')]['describe']()[_0x1a57('0x1a')](function(_0x1662a3){return _0x1f7086[_0x1a57('0x1b')]['find']({'where':{'id':_0x289dc0[_0x1a57('0x1c')]},'include':[{'model':_0x1f7086[_0x1a57('0x1d')],'as':_0x1a57('0x1e'),'where':{'id':_0x289dc0[_0x1a57('0x15')]},'limit':0x1,'include':[{'model':_0x1f7086[_0x1a57('0x19')],'as':'Contact','attributes':_['keys'](_0x1662a3)}]}]});})[_0x1a57('0x1a')](function(_0x21e811){_0x1c537f=_0x21e811[_0x1a57('0xe')]({'plain':!![]});if(_0x1c537f&&_0x1c537f['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1a57('0x1f'),util[_0x1a57('0x20')](_0x1a57('0x21'),_0x289dc0['id'],_0x1c537f[_0x1a57('0x22')]));if(_0x1c537f[_0x1a57('0x1e')]&&_0x1c537f[_0x1a57('0x1e')][_0x1a57('0x23')]){_0x289dc0[_0x1a57('0x24')]=_[_0x1a57('0x25')](_0x1c537f[_0x1a57('0x1e')][0x0],_0x1a57('0x26'));_0x289dc0[_0x1a57('0x26')]=_0x1c537f[_0x1a57('0x1e')][0x0][_0x1a57('0x26')];}var _0x58e266={'method':_0x1a57('0x27'),'uri':encodeURI(_0x1c537f[_0x1a57('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x58e266[_0x1a57('0x28')]){case _0x1a57('0x29'):_0x58e266['qs']=_0x289dc0;break;case _0x1a57('0x27'):_0x58e266[_0x1a57('0xb')]=_0x289dc0;break;}return rp(_0x58e266)[_0x1a57('0x1a')](function(_0x5a53c8){logger['info'](_0x1a57('0x2a'),_0x1a57('0x1f'),util['format'](_0x1a57('0x2b'),_0x289dc0['id'],_0x1c537f['replyUri']));if(_0x5a53c8[_0x1a57('0xb')][_0x1a57('0x2c')]&&_0x5a53c8['body'][_0x1a57('0x2c')]!=_0x289dc0[_0x1a57('0x24')][_0x1a57('0x2c')]){return _0x1f7086[_0x1a57('0x1d')]['update']({'threadId':_0x5a53c8[_0x1a57('0xb')][_0x1a57('0x2c')]},{'logging':!![],'where':{'id':_0x289dc0[_0x1a57('0x24')]['id']}});}else{return;}})[_0x1a57('0x1a')](function(){return _0x3631d6['update']({'read':!![]});})[_0x1a57('0x17')](function(_0x251a54){logger[_0x1a57('0x18')](_0x1a57('0x2a'),_0x1a57('0x1f'),util[_0x1a57('0x2d')](_0x251a54,{'showHidden':![],'depth':null}));_0x3c8182();});}else{_0x3c8182();}})[_0x1a57('0x2e')](function(){_0x3c8182();});}else{_0x3c8182();}}},'charset':_0x1a57('0x2f'),'collate':_0x1a57('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 00e2df6..f8736dd 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x1a7d40,_0x27105c){var _0x408e7b=function(_0x2b2f31){while(--_0x2b2f31){_0x1a7d40['push'](_0x1a7d40['shift']());}};_0x408e7b(++_0x27105c);}(_0x2ef3,0xba));var _0x32ef=function(_0x538432,_0x417eff){_0x538432=_0x538432-0x0;var _0x582091=_0x2ef3[_0x538432];return _0x582091;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xe55770,_0x3840cc){var _0x49ce96=function(_0x338a86){while(--_0x338a86){_0xe55770['push'](_0xe55770['shift']());}};_0x49ce96(++_0x3840cc);}(_0x7a54,0x106));var _0x47a5=function(_0x4a593b,_0x25f8b2){_0x4a593b=_0x4a593b-0x0;var _0x408010=_0x7a54[_0x4a593b];return _0x408010;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 5cefd2c..13aac61 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 _0xf1c6=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x16b4c0,_0x2137bf){var _0x16fbbf=function(_0x2beb74){while(--_0x2beb74){_0x16b4c0['push'](_0x16b4c0['shift']());}};_0x16fbbf(++_0x2137bf);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x163d50,_0x392384){_0x163d50=_0x163d50-0x0;var _0x5154b3=_0xf1c6[_0x163d50];return _0x5154b3;};'use strict';var OpenchannelMessageEvents=require(_0x6f1c('0x0'));var events=[_0x6f1c('0x1'),_0x6f1c('0x2'),_0x6f1c('0x3')];function createListener(_0x381044,_0x17a05a){return function(_0x15b146){_0x17a05a['emit'](_0x381044,_0x15b146);};}function removeListener(_0x3747f8,_0x2c875e){return function(){OpenchannelMessageEvents[_0x6f1c('0x4')](_0x3747f8,_0x2c875e);};}exports[_0x6f1c('0x5')]=function(_0x4fd3fc){for(var _0x57bb67=0x0,_0x1a3460=events[_0x6f1c('0x6')];_0x57bb67<_0x1a3460;_0x57bb67++){var _0x3f7b30=events[_0x57bb67];var _0x2efcb5=createListener(_0x6f1c('0x7')+_0x3f7b30,_0x4fd3fc);OpenchannelMessageEvents['on'](_0x3f7b30,_0x2efcb5);}}; \ No newline at end of file +var _0x0e50=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x2d6840,_0xa9c39f){var _0x390a5e=function(_0x3990b6){while(--_0x3990b6){_0x2d6840['push'](_0x2d6840['shift']());}};_0x390a5e(++_0xa9c39f);}(_0x0e50,0x168));var _0x00e5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x0e50[_0x5a776b];return _0xbbef59;};'use strict';var OpenchannelMessageEvents=require(_0x00e5('0x0'));var events=[_0x00e5('0x1'),_0x00e5('0x2'),'update'];function createListener(_0x1b3523,_0xa345ef){return function(_0x4a0533){_0xa345ef[_0x00e5('0x3')](_0x1b3523,_0x4a0533);};}function removeListener(_0x3d2263,_0x4f38ad){return function(){OpenchannelMessageEvents[_0x00e5('0x4')](_0x3d2263,_0x4f38ad);};}exports['register']=function(_0x3efbe7){for(var _0xeb6242=0x0,_0x255aec=events[_0x00e5('0x5')];_0xeb6242<_0x255aec;_0xeb6242++){var _0x40b93e=events[_0xeb6242];var _0x4c91eb=createListener(_0x00e5('0x6')+_0x40b93e,_0x3efbe7);OpenchannelMessageEvents['on'](_0x40b93e,_0x4c91eb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d9d7f4e..98047e6 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 _0xf373=['update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put'];(function(_0x4b8dde,_0x193202){var _0xa0c426=function(_0x1647d9){while(--_0x1647d9){_0x4b8dde['push'](_0x4b8dde['shift']());}};_0xa0c426(++_0x193202);}(_0xf373,0xd1));var _0x3f37=function(_0x38a4ff,_0x2f5911){_0x38a4ff=_0x38a4ff-0x0;var _0x94f062=_0xf373[_0x38a4ff];return _0x94f062;};'use strict';var multer=require('multer');var util=require(_0x3f37('0x0'));var path=require(_0x3f37('0x1'));var timeout=require(_0x3f37('0x2'));var express=require(_0x3f37('0x3'));var router=express[_0x3f37('0x4')]();var fs_extra=require(_0x3f37('0x5'));var auth=require(_0x3f37('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3f37('0x7'));var controller=require('./openchannelQueue.controller');router[_0x3f37('0x8')]('/',auth[_0x3f37('0x9')](),controller[_0x3f37('0xa')]);router[_0x3f37('0x8')]('/describe',auth[_0x3f37('0x9')](),controller[_0x3f37('0xb')]);router[_0x3f37('0x8')](_0x3f37('0xc'),auth['isAuthenticated'](),controller[_0x3f37('0xd')]);router['get'](_0x3f37('0xe'),auth[_0x3f37('0x9')](),controller['getMembers']);router[_0x3f37('0x8')]('/:id/teams',auth[_0x3f37('0x9')](),controller[_0x3f37('0xf')]);router[_0x3f37('0x8')](_0x3f37('0x10'),auth['isAuthenticated'](),controller[_0x3f37('0x11')]);router[_0x3f37('0x12')]('/',auth['isAuthenticated'](),controller[_0x3f37('0x13')]);router['post'](_0x3f37('0x14'),auth[_0x3f37('0x9')](),controller[_0x3f37('0x15')]);router[_0x3f37('0x12')](_0x3f37('0x10'),auth[_0x3f37('0x9')](),controller['addAgents']);router[_0x3f37('0x16')](_0x3f37('0xc'),auth[_0x3f37('0x9')](),controller[_0x3f37('0x17')]);router[_0x3f37('0x18')](_0x3f37('0xc'),auth['isAuthenticated'](),controller[_0x3f37('0x19')]);router[_0x3f37('0x18')](_0x3f37('0x14'),auth[_0x3f37('0x9')](),controller[_0x3f37('0x1a')]);router['delete'](_0x3f37('0x10'),auth[_0x3f37('0x9')](),controller[_0x3f37('0x1b')]);module[_0x3f37('0x1c')]=router; \ No newline at end of file +var _0x4eae=['/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x28547e,_0x100df3){var _0x5382da=function(_0x281bbf){while(--_0x281bbf){_0x28547e['push'](_0x28547e['shift']());}};_0x5382da(++_0x100df3);}(_0x4eae,0x102));var _0xe4ea=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x4eae[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require('multer');var util=require(_0xe4ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe4ea('0x1'));var router=express[_0xe4ea('0x2')]();var fs_extra=require(_0xe4ea('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe4ea('0x4'));var config=require(_0xe4ea('0x5'));var controller=require('./openchannelQueue.controller');router[_0xe4ea('0x6')]('/',auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x8')]);router[_0xe4ea('0x6')](_0xe4ea('0x9'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0xa')]);router[_0xe4ea('0x6')](_0xe4ea('0xb'),auth[_0xe4ea('0x7')](),controller['show']);router[_0xe4ea('0x6')](_0xe4ea('0xc'),auth[_0xe4ea('0x7')](),controller['getMembers']);router[_0xe4ea('0x6')](_0xe4ea('0xd'),auth['isAuthenticated'](),controller[_0xe4ea('0xe')]);router[_0xe4ea('0x6')](_0xe4ea('0xf'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x10')]);router[_0xe4ea('0x11')]('/',auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x12')]);router[_0xe4ea('0x11')](_0xe4ea('0xd'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x13')]);router[_0xe4ea('0x11')](_0xe4ea('0xf'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x14')]);router[_0xe4ea('0x15')](_0xe4ea('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe4ea('0x16')](_0xe4ea('0xb'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x17')]);router[_0xe4ea('0x16')](_0xe4ea('0xd'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x18')]);router[_0xe4ea('0x16')](_0xe4ea('0xf'),auth[_0xe4ea('0x7')](),controller[_0xe4ea('0x19')]);module[_0xe4ea('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 676caa3..0ae03a9 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 _0xd905=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x567864,_0x126f18){var _0x4ded2a=function(_0x409158){while(--_0x409158){_0x567864['push'](_0x567864['shift']());}};_0x4ded2a(++_0x126f18);}(_0xd905,0x7b));var _0x5d90=function(_0x20693a,_0x539731){_0x20693a=_0x20693a-0x0;var _0x3c2fe8=_0xd905[_0x20693a];return _0x3c2fe8;};'use strict';var Sequelize=require(_0x5d90('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d90('0x1')],'unique':_0x5d90('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5d90('0x1')]},'timeout':{'type':Sequelize[_0x5d90('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5d90('0x4')](_0x5d90('0x5'),_0x5d90('0x6'),_0x5d90('0x7'))}}; \ No newline at end of file +var _0x4195=['exports','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x4195,0x1d4));var _0x5419=function(_0x146bf6,_0x3a3461){_0x146bf6=_0x146bf6-0x0;var _0x4af2c3=_0x4195[_0x146bf6];return _0x4af2c3;};'use strict';var Sequelize=require('sequelize');module[_0x5419('0x0')]={'name':{'type':Sequelize[_0x5419('0x1')],'unique':_0x5419('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5419('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5419('0x4'),'beepall',_0x5419('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0335d23..9e73a0c 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 _0x643d=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','rows','format','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','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','every','TeamId','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x56524c,_0x418110){var _0x156dd3=function(_0x20f05f){while(--_0x20f05f){_0x56524c['push'](_0x56524c['shift']());}};_0x156dd3(++_0x418110);}(_0x643d,0x1a1));var _0xd643=function(_0x3b27be,_0x4b60a7){_0x3b27be=_0x3b27be-0x0;var _0x4b7232=_0x643d[_0x3b27be];return _0x4b7232;};'use strict';var emlformat=require(_0xd643('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd643('0x1'));var jsonpatch=require(_0xd643('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd643('0x3'));var Mustache=require(_0xd643('0x4'));var util=require('util');var path=require(_0xd643('0x5'));var sox=require(_0xd643('0x6'));var csv=require(_0xd643('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd643('0x8'));var _=require(_0xd643('0x9'));var squel=require('squel');var crypto=require(_0xd643('0xa'));var jsforce=require(_0xd643('0xb'));var deskjs=require(_0xd643('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd643('0xd'));var Papa=require(_0xd643('0xe'));var Redis=require(_0xd643('0xf'));var authService=require(_0xd643('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd643('0x11'));var hardwareService=require(_0xd643('0x12'));var logger=require(_0xd643('0x13'))(_0xd643('0x14'));var utils=require(_0xd643('0x15'));var config=require(_0xd643('0x16'));var licenseUtil=require(_0xd643('0x17'));var db=require(_0xd643('0x18'))['db'];config[_0xd643('0x19')]=_[_0xd643('0x1a')](config[_0xd643('0x19')],{'host':_0xd643('0x1b'),'port':0x18eb});var socket=require(_0xd643('0x1c'))(new Redis(config[_0xd643('0x19')]));require(_0xd643('0x1d'))['register'](socket);function respondWithStatusCode(_0x326d6a,_0x1a9492){_0x1a9492=_0x1a9492||0xcc;return function(_0x286a1f){if(_0x286a1f){return _0x326d6a['sendStatus'](_0x1a9492);}return _0x326d6a['status'](_0x1a9492)[_0xd643('0x1e')]();};}function respondWithResult(_0x11a4c1,_0x592268){_0x592268=_0x592268||0xc8;return function(_0xdf7cbe){if(_0xdf7cbe){return _0x11a4c1[_0xd643('0x1f')](_0x592268)[_0xd643('0x20')](_0xdf7cbe);}};}function respondWithFilteredResult(_0x20123a,_0x594dd2){return function(_0x5b6982){if(_0x5b6982){var _0x4ae4a8=typeof _0x594dd2[_0xd643('0x21')]===_0xd643('0x22')&&typeof _0x594dd2[_0xd643('0x23')]===_0xd643('0x22');var _0x442509=_0x5b6982[_0xd643('0x24')];var _0x1c0886=_0x4ae4a8?0x0:_0x594dd2[_0xd643('0x21')];var _0x255656=_0x4ae4a8?_0x5b6982[_0xd643('0x24')]:_0x594dd2[_0xd643('0x21')]+_0x594dd2[_0xd643('0x23')];var _0x170d94;if(_0x255656>=_0x442509){_0x255656=_0x442509;_0x170d94=0xc8;}else{_0x170d94=0xce;}_0x20123a[_0xd643('0x1f')](_0x170d94);return _0x20123a[_0xd643('0x25')](_0xd643('0x26'),_0x1c0886+'-'+_0x255656+'/'+_0x442509)['json'](_0x5b6982);}return null;};}function patchUpdates(_0x2b2fa8){return function(_0xea981a){try{jsonpatch[_0xd643('0x27')](_0xea981a,_0x2b2fa8,!![]);}catch(_0x402861){return BPromise['reject'](_0x402861);}return _0xea981a['save']();};}function saveUpdates(_0x15f017,_0x1bc280){return function(_0x25210e){if(_0x25210e){return _0x25210e[_0xd643('0x28')](_0x15f017)[_0xd643('0x29')](function(_0x333750){return _0x333750;});}return null;};}function removeEntity(_0x2b9b9b,_0x2987bd){return function(_0x39a9d0){if(_0x39a9d0){return _0x39a9d0[_0xd643('0x2a')]()[_0xd643('0x29')](function(){var _0x4b700b=_0x39a9d0[_0xd643('0x2b')]({'plain':!![]});var _0x4b0946='OpenchannelQueues';return db[_0xd643('0x2c')][_0xd643('0x2a')]({'where':{'type':_0x4b0946,'resourceId':_0x4b700b['id']}})[_0xd643('0x29')](function(){return _0x39a9d0;});})['then'](function(){_0x2b9b9b[_0xd643('0x1f')](0xcc)[_0xd643('0x1e')]();});}};}function handleEntityNotFound(_0xc935d2,_0xdd1b9a){return function(_0x1e7612){if(!_0x1e7612){_0xc935d2[_0xd643('0x2d')](0x194);}return _0x1e7612;};}function handleError(_0x38c597,_0x4c8a47){_0x4c8a47=_0x4c8a47||0x1f4;return function(_0x3bf2f2){logger[_0xd643('0x2e')](_0x3bf2f2[_0xd643('0x2f')]);if(_0x3bf2f2['name']){delete _0x3bf2f2[_0xd643('0x30')];}_0x38c597[_0xd643('0x1f')](_0x4c8a47)[_0xd643('0x31')](_0x3bf2f2);};}exports[_0xd643('0x32')]=function(_0x1a2937,_0x4856b4){var _0x2536f7={},_0xaeba69={},_0x4e4f6c={'count':0x0,'rows':[]};var _0x2f99b6=_[_0xd643('0x33')](db[_0xd643('0x34')][_0xd643('0x35')],function(_0x4d0a12){return{'name':_0x4d0a12[_0xd643('0x36')],'type':_0x4d0a12['type'][_0xd643('0x37')]};});_0xaeba69[_0xd643('0x38')]=_[_0xd643('0x33')](_0x2f99b6,_0xd643('0x30'));_0xaeba69['query']=_[_0xd643('0x39')](_0x1a2937['query']);_0xaeba69['filters']=_[_0xd643('0x3a')](_0xaeba69[_0xd643('0x38')],_0xaeba69['query']);_0x2536f7['attributes']=_['intersection'](_0xaeba69[_0xd643('0x38')],qs[_0xd643('0x3b')](_0x1a2937[_0xd643('0x3c')]['fields']));_0x2536f7[_0xd643('0x3d')]=_0x2536f7['attributes'][_0xd643('0x3e')]?_0x2536f7[_0xd643('0x3d')]:_0xaeba69['model'];if(!_0x1a2937[_0xd643('0x3c')][_0xd643('0x3f')](_0xd643('0x40'))){_0x2536f7['limit']=qs['limit'](_0x1a2937[_0xd643('0x3c')][_0xd643('0x23')]);_0x2536f7['offset']=qs[_0xd643('0x21')](_0x1a2937[_0xd643('0x3c')][_0xd643('0x21')]);}_0x2536f7['order']=qs[_0xd643('0x41')](_0x1a2937[_0xd643('0x3c')]['sort']);_0x2536f7[_0xd643('0x42')]=qs[_0xd643('0x43')](_[_0xd643('0x44')](_0x1a2937['query'],_0xaeba69[_0xd643('0x43')]),_0x2f99b6);if(_0x1a2937[_0xd643('0x3c')][_0xd643('0x45')]){_0x2536f7[_0xd643('0x42')]=_[_0xd643('0x46')](_0x2536f7['where'],{'$or':_[_0xd643('0x33')](_0x2f99b6,function(_0x552b70){if(_0x552b70[_0xd643('0x47')]!==_0xd643('0x48')){var _0x39b5f0={};_0x39b5f0[_0x552b70[_0xd643('0x30')]]={'$like':'%'+_0x1a2937['query'][_0xd643('0x45')]+'%'};return _0x39b5f0;}})});}_0x2536f7=_['merge']({},_0x2536f7,_0x1a2937[_0xd643('0x49')]);var _0x2f1ccd={'where':_0x2536f7[_0xd643('0x42')]};return db[_0xd643('0x34')]['count'](_0x2f1ccd)[_0xd643('0x29')](function(_0x5c21cf){_0x4e4f6c[_0xd643('0x24')]=_0x5c21cf;if(_0x1a2937['query'][_0xd643('0x4a')]){_0x2536f7[_0xd643('0x4b')]=[{'all':!![]}];}return db[_0xd643('0x34')]['findAll'](_0x2536f7);})['then'](function(_0x2f7bcc){_0x4e4f6c['rows']=_0x2f7bcc;return _0x4e4f6c;})[_0xd643('0x29')](respondWithFilteredResult(_0x4856b4,_0x2536f7))['catch'](handleError(_0x4856b4,null));};exports['show']=function(_0x48f98a,_0x4b1dc0){var _0x826516={'raw':!![],'where':{'id':_0x48f98a[_0xd643('0x4c')]['id']}},_0x43298e={};_0x43298e[_0xd643('0x38')]=_[_0xd643('0x39')](db[_0xd643('0x34')][_0xd643('0x35')]);_0x43298e[_0xd643('0x3c')]=_[_0xd643('0x39')](_0x48f98a['query']);_0x43298e[_0xd643('0x43')]=_[_0xd643('0x3a')](_0x43298e[_0xd643('0x38')],_0x43298e[_0xd643('0x3c')]);_0x826516[_0xd643('0x3d')]=_[_0xd643('0x3a')](_0x43298e[_0xd643('0x38')],qs[_0xd643('0x3b')](_0x48f98a['query'][_0xd643('0x3b')]));_0x826516[_0xd643('0x3d')]=_0x826516[_0xd643('0x3d')][_0xd643('0x3e')]?_0x826516[_0xd643('0x3d')]:_0x43298e[_0xd643('0x38')];if(_0x48f98a['query'][_0xd643('0x4a')]){_0x826516[_0xd643('0x4b')]=[{'all':!![]}];}_0x826516=_['merge']({},_0x826516,_0x48f98a[_0xd643('0x49')]);return db[_0xd643('0x34')][_0xd643('0x4d')](_0x826516)['then'](handleEntityNotFound(_0x4b1dc0,null))[_0xd643('0x29')](respondWithResult(_0x4b1dc0,null))['catch'](handleError(_0x4b1dc0,null));};exports[_0xd643('0x4e')]=function(_0x5d6d69,_0x182e21){return db[_0xd643('0x34')][_0xd643('0x4e')](_0x5d6d69[_0xd643('0x4f')],{})[_0xd643('0x29')](function(_0x446afa){var _0x1b2c14=_0x5d6d69['user'][_0xd643('0x2b')]({'plain':!![]});if(!_0x1b2c14)throw new Error(_0xd643('0x50'));if(_0x1b2c14[_0xd643('0x51')]===_0xd643('0x52')){var _0x270b9f=_0x446afa[_0xd643('0x2b')]({'plain':!![]});var _0x54f198=_0xd643('0x53');return db['UserProfileSection'][_0xd643('0x4d')]({'where':{'name':_0x54f198,'userProfileId':_0x1b2c14[_0xd643('0x54')]},'raw':!![]})[_0xd643('0x29')](function(_0x1f48db){if(_0x1f48db&&_0x1f48db[_0xd643('0x55')]===0x0){return db[_0xd643('0x2c')][_0xd643('0x4e')]({'name':_0x270b9f[_0xd643('0x30')],'resourceId':_0x270b9f['id'],'type':_0x1f48db[_0xd643('0x30')],'sectionId':_0x1f48db['id']},{})['then'](function(){return _0x446afa;});}else{return _0x446afa;}})[_0xd643('0x56')](function(_0x4f4076){logger[_0xd643('0x2e')](_0xd643('0x57'),_0x4f4076);throw _0x4f4076;});}return _0x446afa;})[_0xd643('0x29')](respondWithResult(_0x182e21,0xc9))[_0xd643('0x56')](handleError(_0x182e21,null));};exports[_0xd643('0x28')]=function(_0x5626e9,_0x498eb2){if(_0x5626e9[_0xd643('0x4f')]['id']){delete _0x5626e9[_0xd643('0x4f')]['id'];}return db[_0xd643('0x34')][_0xd643('0x4d')]({'where':{'id':_0x5626e9['params']['id']}})['then'](handleEntityNotFound(_0x498eb2,null))[_0xd643('0x29')](saveUpdates(_0x5626e9[_0xd643('0x4f')],null))['then'](respondWithResult(_0x498eb2,null))['catch'](handleError(_0x498eb2,null));};exports[_0xd643('0x2a')]=function(_0x13bddc,_0x487e22){return db['OpenchannelQueue'][_0xd643('0x4d')]({'where':{'id':_0x13bddc[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x487e22,null))[_0xd643('0x29')](removeEntity(_0x487e22,null))[_0xd643('0x56')](handleError(_0x487e22,null));};exports[_0xd643('0x58')]=function(_0x17cdc6,_0x283b7c){return db[_0xd643('0x34')][_0xd643('0x58')]()[_0xd643('0x29')](respondWithResult(_0x283b7c,null))[_0xd643('0x56')](handleError(_0x283b7c,null));};exports[_0xd643('0x59')]=function(_0x3de0cb,_0x2429b8,_0x6b65e5){var _0x36215d={'raw':!![],'where':{}},_0x32e37d={},_0x695f34;return db['OpenchannelQueue'][_0xd643('0x5a')]({'where':{'id':_0x3de0cb[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x2429b8,null))[_0xd643('0x29')](function(_0x520d43){if(_0x520d43){_0x695f34=_0x520d43[_0xd643('0x2b')]({'plain':!![]});_0x32e37d['model']=_[_0xd643('0x39')](db[_0xd643('0x5b')][_0xd643('0x35')]);_0x32e37d[_0xd643('0x3c')]=_[_0xd643('0x39')](_0x3de0cb[_0xd643('0x3c')]);_0x32e37d[_0xd643('0x43')]=_[_0xd643('0x3a')](_0x32e37d['model'],_0x32e37d[_0xd643('0x3c')]);_0x36215d[_0xd643('0x3d')]=_[_0xd643('0x3a')](_0x32e37d[_0xd643('0x38')],qs[_0xd643('0x3b')](_0x3de0cb[_0xd643('0x3c')][_0xd643('0x3b')]));_0x36215d[_0xd643('0x3d')]=_0x36215d[_0xd643('0x3d')]['length']?_0x36215d['attributes']:_0x32e37d[_0xd643('0x38')];if(!_0x3de0cb[_0xd643('0x3c')][_0xd643('0x3f')](_0xd643('0x40'))){_0x36215d[_0xd643('0x23')]=qs[_0xd643('0x23')](_0x3de0cb[_0xd643('0x3c')]['limit']);_0x36215d[_0xd643('0x21')]=qs[_0xd643('0x21')](_0x3de0cb[_0xd643('0x3c')][_0xd643('0x21')]);}_0x36215d[_0xd643('0x5c')]=qs[_0xd643('0x41')](_0x3de0cb[_0xd643('0x3c')][_0xd643('0x41')]);_0x36215d['where']=qs[_0xd643('0x43')](_['pick'](_0x3de0cb[_0xd643('0x3c')],_0x32e37d[_0xd643('0x43')]));_0x36215d[_0xd643('0x42')][_0xd643('0x5d')]=_0x520d43['id'];if(_0x3de0cb[_0xd643('0x3c')][_0xd643('0x45')]){_0x36215d['where']=_['merge'](_0x36215d[_0xd643('0x42')],{'$or':_[_0xd643('0x33')](_0x36215d[_0xd643('0x3d')],function(_0x397b43){var _0x17c321={};_0x17c321[_0x397b43]={'$like':'%'+_0x3de0cb['query']['filter']+'%'};return _0x17c321;})});}_0x36215d=_[_0xd643('0x46')]({},_0x36215d,_0x3de0cb[_0xd643('0x49')]);return db[_0xd643('0x5b')][_0xd643('0x5e')](_0x36215d);}})[_0xd643('0x29')](function(_0x2bfb2b){if(_0x2bfb2b){return db[_0xd643('0x5f')][_0xd643('0x60')]({'where':{'id':_['map'](_0x2bfb2b,_0xd643('0x61')),'role':_0xd643('0x62')},'attributes':['id','name',_0xd643('0x63'),'updatedAt',_0xd643('0x64')]});}})[_0xd643('0x29')](function(_0x1e5867){if(_0x1e5867){return{'count':_0x1e5867[_0xd643('0x24')],'rows':_['map'](_0x1e5867[_0xd643('0x65')],function(_0x114254){return{'membername':_0x114254[_0xd643('0x30')],'UserId':_0x114254['id'],'queue_name':_0x695f34[_0xd643('0x30')],'OpenchannelQueueId':_0x695f34['id'],'interface':util[_0xd643('0x66')]('%s/%s',_0xd643('0x67'),_0x114254[_0xd643('0x30')]),'penalty':0x0,'paused':_0x114254[_0xd643('0x63')],'createdAt':_0x114254[_0xd643('0x64')],'updatedAt':_0x114254[_0xd643('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd643('0x29')](respondWithFilteredResult(_0x2429b8,_0x36215d))[_0xd643('0x56')](handleError(_0x2429b8,null));};exports[_0xd643('0x69')]=function(_0x15a167,_0x3fb840,_0x43756f){var _0x406b22={};var _0x1a3364={};var _0x457d84;var _0x487a01;return db[_0xd643('0x34')][_0xd643('0x5a')]({'where':{'id':_0x15a167[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x3fb840,null))['then'](function(_0x480660){if(_0x480660){_0x457d84=_0x480660;_0x1a3364['model']=_['keys'](db[_0xd643('0x6a')][_0xd643('0x35')]);_0x1a3364[_0xd643('0x3c')]=_[_0xd643('0x39')](_0x15a167[_0xd643('0x3c')]);_0x1a3364[_0xd643('0x43')]=_[_0xd643('0x3a')](_0x1a3364[_0xd643('0x38')],_0x1a3364[_0xd643('0x3c')]);_0x406b22[_0xd643('0x3d')]=_['intersection'](_0x1a3364[_0xd643('0x38')],qs['fields'](_0x15a167[_0xd643('0x3c')]['fields']));_0x406b22[_0xd643('0x3d')]=_0x406b22[_0xd643('0x3d')][_0xd643('0x3e')]?_0x406b22[_0xd643('0x3d')]:_0x1a3364[_0xd643('0x38')];_0x406b22[_0xd643('0x5c')]=qs[_0xd643('0x41')](_0x15a167[_0xd643('0x3c')][_0xd643('0x41')]);_0x406b22[_0xd643('0x42')]=qs[_0xd643('0x43')](_[_0xd643('0x44')](_0x15a167[_0xd643('0x3c')],_0x1a3364['filters']));if(_0x15a167[_0xd643('0x3c')][_0xd643('0x45')]){_0x406b22[_0xd643('0x42')]=_[_0xd643('0x46')](_0x406b22['where'],{'$or':_[_0xd643('0x33')](_0x406b22[_0xd643('0x3d')],function(_0x22aa20){var _0x287855={};_0x287855[_0x22aa20]={'$like':'%'+_0x15a167[_0xd643('0x3c')][_0xd643('0x45')]+'%'};return _0x287855;})});}_0x406b22=_['merge']({},_0x406b22,_0x15a167['options']);return _0x457d84['getTeams'](_0x406b22);}})[_0xd643('0x29')](function(_0x54d2f5){if(_0x54d2f5){_0x487a01=_0x54d2f5['length'];if(!_0x15a167['query'][_0xd643('0x3f')]('nolimit')){_0x406b22[_0xd643('0x23')]=qs[_0xd643('0x23')](_0x15a167['query']['limit']);_0x406b22[_0xd643('0x21')]=qs[_0xd643('0x21')](_0x15a167[_0xd643('0x3c')]['offset']);}return _0x457d84['getTeams'](_0x406b22);}})['then'](function(_0x16587a){if(_0x16587a){return _0x16587a?{'count':_0x487a01,'rows':_0x16587a}:null;}})[_0xd643('0x29')](respondWithResult(_0x3fb840,null))[_0xd643('0x56')](handleError(_0x3fb840,null));};exports[_0xd643('0x6b')]=function(_0x3b2779,_0x4b3c1a,_0x599cc9){var _0x45d7f9=_0x3b2779[_0xd643('0x4f')][_0xd643('0x6c')];return db[_0xd643('0x6a')][_0xd643('0x5e')]({'where':{'id':_0x45d7f9},'attributes':['id'],'include':[{'model':db[_0xd643('0x5f')],'as':_0xd643('0x6d'),'attributes':['id','name',_0xd643('0x6e'),_0xd643('0x6f'),_0xd643('0x70')],'raw':!![]}]})[_0xd643('0x29')](function(_0x3bdb82){if(_0x3bdb82){var _0x731c95=_[_0xd643('0x71')](_0x3bdb82,function(_0x23da43){var _0x3a625d=_0x23da43[_0xd643('0x2b')]({'plain':!![]});return _0x3a625d[_0xd643('0x6d')];});return db[_0xd643('0x34')][_0xd643('0x4d')]({'where':{'id':_0x3b2779[_0xd643('0x4c')]['id']}})['then'](function(_0x46c417){return db[_0xd643('0x72')][_0xd643('0x73')](function(_0x466ed6){return _0x46c417[_0xd643('0x6b')](_0x45d7f9,{'transaction':_0x466ed6})['then'](function(){return BPromise['each'](_0x731c95,function(_0x11faa8){return db[_0xd643('0x5b')][_0xd643('0x74')]({'where':{'UserId':_0x11faa8['id'],'OpenchannelQueueId':_0x3b2779[_0xd643('0x4c')]['id']},'transaction':_0x466ed6});});})[_0xd643('0x29')](function(){_0x731c95[_0xd643('0x75')](function(_0x350bd3){socket[_0xd643('0x76')](_0xd643('0x77'),{'UserId':_0x350bd3['id'],'OpenchannelQueueId':_0x46c417['id']});});});});});}})['then'](respondWithStatusCode(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};exports['removeTeams']=function(_0x420968,_0x59b8df,_0xabc954){return db['Team'][_0xd643('0x5e')]({'where':{'id':_0x420968['query'][_0xd643('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd643('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xd643('0x29')](handleEntityNotFound(_0x59b8df,null))[_0xd643('0x29')](function(_0x41db5a){var _0x15bde9=_[_0xd643('0x33')](_0x41db5a,'id');var _0x2fc05b=[];var _0x50a447=[];var _0x52a7e8=squel[_0xd643('0x78')]();_0x52a7e8['field'](_0xd643('0x79'))[_0xd643('0x7a')](_0xd643('0x7b'),'tq')[_0xd643('0x7c')](_0xd643('0x7d'),'ut',_0xd643('0x7e'))['where'](_0xd643('0x7f'),_0x420968[_0xd643('0x4c')]['id']);for(var _0x32ea23=0x0;_0x32ea23<_0x41db5a[_0xd643('0x3e')];_0x32ea23+=0x1){let _0x3c5206=_0x41db5a[_0x32ea23];for(var _0x4f658b=0x0;_0x4f658b<_0x3c5206[_0xd643('0x6d')][_0xd643('0x3e')];_0x4f658b+=0x1){let _0x241205=_0x3c5206['Agents'][_0x4f658b];var _0x2288f0=_0x52a7e8[_0xd643('0x80')]();_0x2288f0[_0xd643('0x42')](_0xd643('0x81'),_0x241205['id']);_0x50a447[_0xd643('0x82')](db['sequelize'][_0xd643('0x3c')](_0x2288f0['toString'](),{'type':db[_0xd643('0x72')][_0xd643('0x83')]['SELECT']})['then'](function(_0x23a29a){if(_0x23a29a[_0xd643('0x3e')]===0x1){return _0x241205['id'];}else{var _0x39a24b=_[_0xd643('0x84')](_[_0xd643('0x33')](_0x23a29a,_0xd643('0x85')),function(_0x4e602d){return _['includes'](_0x15bde9,_0x4e602d);});if(_0x39a24b){return _0x241205['id'];}}}));}}return BPromise['all'](_0x50a447)[_0xd643('0x29')](function(_0x16ef90){_0x2fc05b=_(_0x2fc05b)['union'](_0x16ef90)['compact']()['value']();return db[_0xd643('0x34')][_0xd643('0x4d')]({'where':{'id':_0x420968[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](function(_0x2bc2df){return db[_0xd643('0x72')][_0xd643('0x73')](function(_0x10f9f7){return _0x2bc2df[_0xd643('0x86')](_0x420968[_0xd643('0x3c')][_0xd643('0x6c')],{'transaction':_0x10f9f7})[_0xd643('0x29')](function(){if(!_[_0xd643('0x87')](_0x2fc05b)){return _0x2bc2df[_0xd643('0x88')](_0x2fc05b,{'transaction':_0x10f9f7});}})[_0xd643('0x29')](function(){_0x2fc05b[_0xd643('0x75')](function(_0x4fba40){socket[_0xd643('0x76')](_0xd643('0x89'),{'UserId':_0x4fba40,'OpenchannelQueueId':_0x2bc2df['id']});});});});});});})[_0xd643('0x29')](respondWithStatusCode(_0x59b8df,null))[_0xd643('0x56')](handleError(_0x59b8df,null));};exports['addAgents']=function(_0x556dbb,_0x579443,_0x27b6d9){return db[_0xd643('0x34')]['find']({'where':{'id':_0x556dbb[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x579443,null))[_0xd643('0x29')](function(_0x598a14){if(_0x598a14){return _0x598a14[_0xd643('0x8a')](_0x556dbb['body'][_0xd643('0x6c')],_[_0xd643('0x8b')](_0x556dbb[_0xd643('0x4f')],[_0xd643('0x6c'),'id'])||{})[_0xd643('0x8c')](function(_0x54c911){for(var _0x3adc2a=0x0;_0x3adc2a<_0x556dbb[_0xd643('0x4f')]['ids'][_0xd643('0x3e')];_0x3adc2a+=0x1){socket[_0xd643('0x76')](_0xd643('0x77'),{'UserId':Number(_0x556dbb[_0xd643('0x4f')][_0xd643('0x6c')][_0x3adc2a]),'OpenchannelQueueId':Number(_0x556dbb[_0xd643('0x4c')]['id'])});}return _0x54c911;});}})[_0xd643('0x29')](respondWithResult(_0x579443,null))['catch'](handleError(_0x579443,null));};exports[_0xd643('0x88')]=function(_0x5c9853,_0x4f0efa,_0x2cf274){return db[_0xd643('0x34')][_0xd643('0x4d')]({'where':{'id':_0x5c9853['params']['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x4f0efa,null))[_0xd643('0x29')](function(_0x5c5ae7){if(_0x5c5ae7){return _0x5c5ae7['removeAgents'](_0x5c9853[_0xd643('0x3c')][_0xd643('0x6c')])['then'](function(){if(_[_0xd643('0x8d')](_0x5c9853[_0xd643('0x3c')][_0xd643('0x6c')])){for(var _0x133648=0x0;_0x133648<_0x5c9853[_0xd643('0x3c')][_0xd643('0x6c')][_0xd643('0x3e')];_0x133648+=0x1){socket[_0xd643('0x76')](_0xd643('0x89'),{'UserId':Number(_0x5c9853[_0xd643('0x3c')][_0xd643('0x6c')][_0x133648]),'OpenchannelQueueId':Number(_0x5c9853[_0xd643('0x4c')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x5c9853[_0xd643('0x3c')][_0xd643('0x6c')]),'OpenchannelQueueId':Number(_0x5c9853['params']['id'])});}});}})[_0xd643('0x29')](respondWithStatusCode(_0x4f0efa,null))[_0xd643('0x56')](handleError(_0x4f0efa,null));};exports['getAgents']=function(_0x1d6eda,_0x28fa65,_0x40c039){var _0x55e40a={};var _0x386de7={};var _0x253cce;var _0x325430;return db[_0xd643('0x34')][_0xd643('0x5a')]({'where':{'id':_0x1d6eda[_0xd643('0x4c')]['id']}})[_0xd643('0x29')](handleEntityNotFound(_0x28fa65,null))[_0xd643('0x29')](function(_0xedad9c){if(_0xedad9c){_0x253cce=_0xedad9c;_0x386de7[_0xd643('0x38')]=_[_0xd643('0x39')](db[_0xd643('0x5f')][_0xd643('0x35')]);_0x386de7['query']=_['keys'](_0x1d6eda[_0xd643('0x3c')]);_0x386de7[_0xd643('0x43')]=_[_0xd643('0x3a')](_0x386de7[_0xd643('0x38')],_0x386de7['query']);_0x55e40a['attributes']=_[_0xd643('0x3a')](_0x386de7['model'],qs[_0xd643('0x3b')](_0x1d6eda[_0xd643('0x3c')]['fields']));_0x55e40a['attributes']=_0x55e40a[_0xd643('0x3d')][_0xd643('0x3e')]?_0x55e40a[_0xd643('0x3d')]:_0x386de7[_0xd643('0x38')];_0x55e40a[_0xd643('0x5c')]=qs[_0xd643('0x41')](_0x1d6eda[_0xd643('0x3c')][_0xd643('0x41')]);_0x55e40a['where']=qs[_0xd643('0x43')](_[_0xd643('0x44')](_0x1d6eda['query'],_0x386de7[_0xd643('0x43')]));if(_0x1d6eda[_0xd643('0x3c')][_0xd643('0x45')]){_0x55e40a['where']=_[_0xd643('0x46')](_0x55e40a[_0xd643('0x42')],{'$or':_[_0xd643('0x33')](_0x55e40a[_0xd643('0x3d')],function(_0x1f65c7){var _0x3de7a8={};_0x3de7a8[_0x1f65c7]={'$like':'%'+_0x1d6eda[_0xd643('0x3c')][_0xd643('0x45')]+'%'};return _0x3de7a8;})});}_0x55e40a=_[_0xd643('0x46')]({},_0x55e40a,_0x1d6eda[_0xd643('0x49')]);return _0x253cce[_0xd643('0x8e')](_0x55e40a);}})[_0xd643('0x29')](function(_0x29a994){if(_0x29a994){_0x325430=_0x29a994[_0xd643('0x3e')];if(!_0x1d6eda[_0xd643('0x3c')][_0xd643('0x3f')](_0xd643('0x40'))){_0x55e40a[_0xd643('0x23')]=qs['limit'](_0x1d6eda['query']['limit']);_0x55e40a['offset']=qs['offset'](_0x1d6eda['query'][_0xd643('0x21')]);}return _0x253cce[_0xd643('0x8e')](_0x55e40a);}})[_0xd643('0x29')](function(_0x50894b){if(_0x50894b){return _0x50894b?{'count':_0x325430,'rows':_0x50894b}:null;}})['then'](respondWithResult(_0x28fa65,null))[_0xd643('0x56')](handleError(_0x28fa65,null));}; \ No newline at end of file +var _0x1368=['nolimit','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','sendStatus','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1368,0xc4));var _0x8136=function(_0x83178,_0x20224f){_0x83178=_0x83178-0x0;var _0x2c7776=_0x1368[_0x83178];return _0x2c7776;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8136('0x0'));var zipdir=require(_0x8136('0x1'));var jsonpatch=require(_0x8136('0x2'));var rp=require(_0x8136('0x3'));var moment=require(_0x8136('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8136('0x5'));var path=require(_0x8136('0x6'));var sox=require(_0x8136('0x7'));var csv=require(_0x8136('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8136('0x9'));var _=require(_0x8136('0xa'));var squel=require(_0x8136('0xb'));var crypto=require(_0x8136('0xc'));var jsforce=require(_0x8136('0xd'));var deskjs=require(_0x8136('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8136('0xf'));var Papa=require(_0x8136('0x10'));var Redis=require('ioredis');var authService=require(_0x8136('0x11'));var qs=require(_0x8136('0x12'));var as=require(_0x8136('0x13'));var hardwareService=require(_0x8136('0x14'));var logger=require(_0x8136('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8136('0x16'));var licenseUtil=require(_0x8136('0x17'));var db=require(_0x8136('0x18'))['db'];config[_0x8136('0x19')]=_[_0x8136('0x1a')](config[_0x8136('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8136('0x1b'))(new Redis(config[_0x8136('0x19')]));require(_0x8136('0x1c'))[_0x8136('0x1d')](socket);function respondWithStatusCode(_0x48f05a,_0x3cac26){_0x3cac26=_0x3cac26||0xcc;return function(_0x452d61){if(_0x452d61){return _0x48f05a['sendStatus'](_0x3cac26);}return _0x48f05a[_0x8136('0x1e')](_0x3cac26)[_0x8136('0x1f')]();};}function respondWithResult(_0x383bb5,_0x2c7339){_0x2c7339=_0x2c7339||0xc8;return function(_0x4a834c){if(_0x4a834c){return _0x383bb5[_0x8136('0x1e')](_0x2c7339)[_0x8136('0x20')](_0x4a834c);}};}function respondWithFilteredResult(_0x4c3e31,_0x113f25){return function(_0x511d29){if(_0x511d29){var _0xe0c330=typeof _0x113f25[_0x8136('0x21')]===_0x8136('0x22')&&typeof _0x113f25[_0x8136('0x23')]===_0x8136('0x22');var _0x2ee197=_0x511d29[_0x8136('0x24')];var _0x582105=_0xe0c330?0x0:_0x113f25[_0x8136('0x21')];var _0xadf415=_0xe0c330?_0x511d29[_0x8136('0x24')]:_0x113f25['offset']+_0x113f25[_0x8136('0x23')];var _0x3c02d8;if(_0xadf415>=_0x2ee197){_0xadf415=_0x2ee197;_0x3c02d8=0xc8;}else{_0x3c02d8=0xce;}_0x4c3e31[_0x8136('0x1e')](_0x3c02d8);return _0x4c3e31[_0x8136('0x25')](_0x8136('0x26'),_0x582105+'-'+_0xadf415+'/'+_0x2ee197)[_0x8136('0x20')](_0x511d29);}return null;};}function patchUpdates(_0x3f7d51){return function(_0x1f3be6){try{jsonpatch[_0x8136('0x27')](_0x1f3be6,_0x3f7d51,!![]);}catch(_0x3c3cd5){return BPromise[_0x8136('0x28')](_0x3c3cd5);}return _0x1f3be6['save']();};}function saveUpdates(_0x2097a3,_0x43ecc3){return function(_0x4e88b8){if(_0x4e88b8){return _0x4e88b8[_0x8136('0x29')](_0x2097a3)[_0x8136('0x2a')](function(_0x14b034){return _0x14b034;});}return null;};}function removeEntity(_0x2593c7,_0xbcc912){return function(_0x178344){if(_0x178344){return _0x178344[_0x8136('0x2b')]()[_0x8136('0x2a')](function(){var _0x3a3c42=_0x178344['get']({'plain':!![]});var _0x54f3be=_0x8136('0x2c');return db[_0x8136('0x2d')][_0x8136('0x2b')]({'where':{'type':_0x54f3be,'resourceId':_0x3a3c42['id']}})[_0x8136('0x2a')](function(){return _0x178344;});})['then'](function(){_0x2593c7['status'](0xcc)[_0x8136('0x1f')]();});}};}function handleEntityNotFound(_0x759cf6,_0x2daf07){return function(_0x329fb2){if(!_0x329fb2){_0x759cf6[_0x8136('0x2e')](0x194);}return _0x329fb2;};}function handleError(_0x2e9e9a,_0x45303c){_0x45303c=_0x45303c||0x1f4;return function(_0x8fc0de){logger['error'](_0x8fc0de[_0x8136('0x2f')]);if(_0x8fc0de[_0x8136('0x30')]){delete _0x8fc0de[_0x8136('0x30')];}_0x2e9e9a[_0x8136('0x1e')](_0x45303c)[_0x8136('0x31')](_0x8fc0de);};}exports[_0x8136('0x32')]=function(_0x13b5f6,_0x4e34f0){var _0x3f3e86={},_0x145405={},_0x52306b={'count':0x0,'rows':[]};var _0x255f79=_[_0x8136('0x33')](db[_0x8136('0x34')][_0x8136('0x35')],function(_0x4f365f){return{'name':_0x4f365f[_0x8136('0x36')],'type':_0x4f365f[_0x8136('0x37')][_0x8136('0x38')]};});_0x145405[_0x8136('0x39')]=_[_0x8136('0x33')](_0x255f79,'name');_0x145405[_0x8136('0x3a')]=_[_0x8136('0x3b')](_0x13b5f6[_0x8136('0x3a')]);_0x145405[_0x8136('0x3c')]=_[_0x8136('0x3d')](_0x145405[_0x8136('0x39')],_0x145405['query']);_0x3f3e86['attributes']=_['intersection'](_0x145405[_0x8136('0x39')],qs[_0x8136('0x3e')](_0x13b5f6['query']['fields']));_0x3f3e86[_0x8136('0x3f')]=_0x3f3e86[_0x8136('0x3f')][_0x8136('0x40')]?_0x3f3e86[_0x8136('0x3f')]:_0x145405[_0x8136('0x39')];if(!_0x13b5f6[_0x8136('0x3a')][_0x8136('0x41')]('nolimit')){_0x3f3e86[_0x8136('0x23')]=qs[_0x8136('0x23')](_0x13b5f6[_0x8136('0x3a')][_0x8136('0x23')]);_0x3f3e86[_0x8136('0x21')]=qs['offset'](_0x13b5f6['query'][_0x8136('0x21')]);}_0x3f3e86[_0x8136('0x42')]=qs[_0x8136('0x43')](_0x13b5f6[_0x8136('0x3a')][_0x8136('0x43')]);_0x3f3e86[_0x8136('0x44')]=qs[_0x8136('0x3c')](_[_0x8136('0x45')](_0x13b5f6[_0x8136('0x3a')],_0x145405[_0x8136('0x3c')]),_0x255f79);if(_0x13b5f6[_0x8136('0x3a')]['filter']){_0x3f3e86['where']=_[_0x8136('0x46')](_0x3f3e86[_0x8136('0x44')],{'$or':_['map'](_0x255f79,function(_0x402d82){if(_0x402d82['type']!==_0x8136('0x47')){var _0x39a51f={};_0x39a51f[_0x402d82['name']]={'$like':'%'+_0x13b5f6['query']['filter']+'%'};return _0x39a51f;}})});}_0x3f3e86=_[_0x8136('0x46')]({},_0x3f3e86,_0x13b5f6['options']);var _0xdbc29b={'where':_0x3f3e86['where']};return db[_0x8136('0x34')][_0x8136('0x24')](_0xdbc29b)[_0x8136('0x2a')](function(_0x45dcdd){_0x52306b[_0x8136('0x24')]=_0x45dcdd;if(_0x13b5f6[_0x8136('0x3a')][_0x8136('0x48')]){_0x3f3e86[_0x8136('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x8136('0x4a')](_0x3f3e86);})[_0x8136('0x2a')](function(_0x49f235){_0x52306b['rows']=_0x49f235;return _0x52306b;})[_0x8136('0x2a')](respondWithFilteredResult(_0x4e34f0,_0x3f3e86))[_0x8136('0x4b')](handleError(_0x4e34f0,null));};exports[_0x8136('0x4c')]=function(_0x44ff03,_0x33a31b){var _0x1cfff1={'raw':!![],'where':{'id':_0x44ff03[_0x8136('0x4d')]['id']}},_0x161091={};_0x161091['model']=_[_0x8136('0x3b')](db['OpenchannelQueue']['rawAttributes']);_0x161091[_0x8136('0x3a')]=_[_0x8136('0x3b')](_0x44ff03[_0x8136('0x3a')]);_0x161091[_0x8136('0x3c')]=_[_0x8136('0x3d')](_0x161091['model'],_0x161091[_0x8136('0x3a')]);_0x1cfff1[_0x8136('0x3f')]=_['intersection'](_0x161091['model'],qs[_0x8136('0x3e')](_0x44ff03['query'][_0x8136('0x3e')]));_0x1cfff1[_0x8136('0x3f')]=_0x1cfff1['attributes'][_0x8136('0x40')]?_0x1cfff1[_0x8136('0x3f')]:_0x161091[_0x8136('0x39')];if(_0x44ff03[_0x8136('0x3a')][_0x8136('0x48')]){_0x1cfff1['include']=[{'all':!![]}];}_0x1cfff1=_[_0x8136('0x46')]({},_0x1cfff1,_0x44ff03[_0x8136('0x4e')]);return db[_0x8136('0x34')][_0x8136('0x4f')](_0x1cfff1)[_0x8136('0x2a')](handleEntityNotFound(_0x33a31b,null))[_0x8136('0x2a')](respondWithResult(_0x33a31b,null))[_0x8136('0x4b')](handleError(_0x33a31b,null));};exports[_0x8136('0x50')]=function(_0x5181a0,_0x6a5b90){return db['OpenchannelQueue'][_0x8136('0x50')](_0x5181a0['body'],{})['then'](function(_0x146b7a){var _0x42b634=_0x5181a0[_0x8136('0x51')]['get']({'plain':!![]});if(!_0x42b634)throw new Error(_0x8136('0x52'));if(_0x42b634['role']===_0x8136('0x51')){var _0x3b1a37=_0x146b7a[_0x8136('0x53')]({'plain':!![]});var _0x478c07='OpenchannelQueues';return db[_0x8136('0x54')][_0x8136('0x4f')]({'where':{'name':_0x478c07,'userProfileId':_0x42b634['userProfileId']},'raw':!![]})[_0x8136('0x2a')](function(_0x2913aa){if(_0x2913aa&&_0x2913aa[_0x8136('0x55')]===0x0){return db[_0x8136('0x2d')][_0x8136('0x50')]({'name':_0x3b1a37[_0x8136('0x30')],'resourceId':_0x3b1a37['id'],'type':_0x2913aa[_0x8136('0x30')],'sectionId':_0x2913aa['id']},{})[_0x8136('0x2a')](function(){return _0x146b7a;});}else{return _0x146b7a;}})[_0x8136('0x4b')](function(_0x29d1a1){logger['error'](_0x8136('0x56'),_0x29d1a1);throw _0x29d1a1;});}return _0x146b7a;})[_0x8136('0x2a')](respondWithResult(_0x6a5b90,0xc9))['catch'](handleError(_0x6a5b90,null));};exports[_0x8136('0x29')]=function(_0x4c8f56,_0x215b23){if(_0x4c8f56[_0x8136('0x57')]['id']){delete _0x4c8f56[_0x8136('0x57')]['id'];}return db[_0x8136('0x34')][_0x8136('0x4f')]({'where':{'id':_0x4c8f56[_0x8136('0x4d')]['id']}})['then'](handleEntityNotFound(_0x215b23,null))[_0x8136('0x2a')](saveUpdates(_0x4c8f56[_0x8136('0x57')],null))[_0x8136('0x2a')](respondWithResult(_0x215b23,null))['catch'](handleError(_0x215b23,null));};exports[_0x8136('0x2b')]=function(_0x40fc33,_0x55a4e6){return db[_0x8136('0x34')][_0x8136('0x4f')]({'where':{'id':_0x40fc33[_0x8136('0x4d')]['id']}})[_0x8136('0x2a')](handleEntityNotFound(_0x55a4e6,null))[_0x8136('0x2a')](removeEntity(_0x55a4e6,null))['catch'](handleError(_0x55a4e6,null));};exports[_0x8136('0x58')]=function(_0x2a40ce,_0x571a0e){return db[_0x8136('0x34')][_0x8136('0x58')]()[_0x8136('0x2a')](respondWithResult(_0x571a0e,null))[_0x8136('0x4b')](handleError(_0x571a0e,null));};exports[_0x8136('0x59')]=function(_0x4743ca,_0x332560,_0x218ece){var _0x15e56f={'raw':!![],'where':{}},_0x22e258={},_0x373fc5;return db['OpenchannelQueue'][_0x8136('0x5a')]({'where':{'id':_0x4743ca[_0x8136('0x4d')]['id']}})[_0x8136('0x2a')](handleEntityNotFound(_0x332560,null))['then'](function(_0x3bd2de){if(_0x3bd2de){_0x373fc5=_0x3bd2de[_0x8136('0x53')]({'plain':!![]});_0x22e258[_0x8136('0x39')]=_[_0x8136('0x3b')](db[_0x8136('0x5b')]['rawAttributes']);_0x22e258['query']=_['keys'](_0x4743ca['query']);_0x22e258[_0x8136('0x3c')]=_[_0x8136('0x3d')](_0x22e258[_0x8136('0x39')],_0x22e258[_0x8136('0x3a')]);_0x15e56f[_0x8136('0x3f')]=_[_0x8136('0x3d')](_0x22e258[_0x8136('0x39')],qs['fields'](_0x4743ca['query']['fields']));_0x15e56f[_0x8136('0x3f')]=_0x15e56f[_0x8136('0x3f')][_0x8136('0x40')]?_0x15e56f[_0x8136('0x3f')]:_0x22e258['model'];if(!_0x4743ca[_0x8136('0x3a')][_0x8136('0x41')](_0x8136('0x5c'))){_0x15e56f[_0x8136('0x23')]=qs[_0x8136('0x23')](_0x4743ca['query'][_0x8136('0x23')]);_0x15e56f[_0x8136('0x21')]=qs[_0x8136('0x21')](_0x4743ca[_0x8136('0x3a')][_0x8136('0x21')]);}_0x15e56f[_0x8136('0x42')]=qs[_0x8136('0x43')](_0x4743ca[_0x8136('0x3a')][_0x8136('0x43')]);_0x15e56f[_0x8136('0x44')]=qs[_0x8136('0x3c')](_['pick'](_0x4743ca[_0x8136('0x3a')],_0x22e258[_0x8136('0x3c')]));_0x15e56f[_0x8136('0x44')]['OpenchannelQueueId']=_0x3bd2de['id'];if(_0x4743ca['query'][_0x8136('0x5d')]){_0x15e56f[_0x8136('0x44')]=_[_0x8136('0x46')](_0x15e56f[_0x8136('0x44')],{'$or':_['map'](_0x15e56f[_0x8136('0x3f')],function(_0x3375d2){var _0x4b0c8={};_0x4b0c8[_0x3375d2]={'$like':'%'+_0x4743ca[_0x8136('0x3a')][_0x8136('0x5d')]+'%'};return _0x4b0c8;})});}_0x15e56f=_[_0x8136('0x46')]({},_0x15e56f,_0x4743ca[_0x8136('0x4e')]);return db[_0x8136('0x5b')][_0x8136('0x4a')](_0x15e56f);}})['then'](function(_0x534513){if(_0x534513){return db[_0x8136('0x5e')][_0x8136('0x5f')]({'where':{'id':_[_0x8136('0x33')](_0x534513,_0x8136('0x60')),'role':_0x8136('0x61')},'attributes':['id',_0x8136('0x30'),_0x8136('0x62'),_0x8136('0x63'),'createdAt']});}})['then'](function(_0x504789){if(_0x504789){return{'count':_0x504789[_0x8136('0x24')],'rows':_[_0x8136('0x33')](_0x504789[_0x8136('0x64')],function(_0x20875d){return{'membername':_0x20875d['name'],'UserId':_0x20875d['id'],'queue_name':_0x373fc5[_0x8136('0x30')],'OpenchannelQueueId':_0x373fc5['id'],'interface':util[_0x8136('0x65')](_0x8136('0x66'),_0x8136('0x67'),_0x20875d[_0x8136('0x30')]),'penalty':0x0,'paused':_0x20875d[_0x8136('0x62')],'createdAt':_0x20875d[_0x8136('0x68')],'updatedAt':_0x20875d[_0x8136('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8136('0x2a')](respondWithFilteredResult(_0x332560,_0x15e56f))['catch'](handleError(_0x332560,null));};exports['getTeams']=function(_0x2f1f81,_0x22da0b,_0x22c79d){var _0x406065={};var _0x5bfdb3={};var _0x49bfad;var _0x54f347;return db[_0x8136('0x34')][_0x8136('0x5a')]({'where':{'id':_0x2f1f81[_0x8136('0x4d')]['id']}})[_0x8136('0x2a')](handleEntityNotFound(_0x22da0b,null))[_0x8136('0x2a')](function(_0x512047){if(_0x512047){_0x49bfad=_0x512047;_0x5bfdb3[_0x8136('0x39')]=_[_0x8136('0x3b')](db[_0x8136('0x69')]['rawAttributes']);_0x5bfdb3[_0x8136('0x3a')]=_[_0x8136('0x3b')](_0x2f1f81[_0x8136('0x3a')]);_0x5bfdb3[_0x8136('0x3c')]=_[_0x8136('0x3d')](_0x5bfdb3[_0x8136('0x39')],_0x5bfdb3['query']);_0x406065[_0x8136('0x3f')]=_[_0x8136('0x3d')](_0x5bfdb3[_0x8136('0x39')],qs[_0x8136('0x3e')](_0x2f1f81[_0x8136('0x3a')][_0x8136('0x3e')]));_0x406065[_0x8136('0x3f')]=_0x406065['attributes'][_0x8136('0x40')]?_0x406065['attributes']:_0x5bfdb3[_0x8136('0x39')];_0x406065['order']=qs[_0x8136('0x43')](_0x2f1f81['query'][_0x8136('0x43')]);_0x406065['where']=qs['filters'](_[_0x8136('0x45')](_0x2f1f81[_0x8136('0x3a')],_0x5bfdb3[_0x8136('0x3c')]));if(_0x2f1f81[_0x8136('0x3a')][_0x8136('0x5d')]){_0x406065[_0x8136('0x44')]=_['merge'](_0x406065[_0x8136('0x44')],{'$or':_[_0x8136('0x33')](_0x406065[_0x8136('0x3f')],function(_0x1d3532){var _0x3d061c={};_0x3d061c[_0x1d3532]={'$like':'%'+_0x2f1f81[_0x8136('0x3a')][_0x8136('0x5d')]+'%'};return _0x3d061c;})});}_0x406065=_[_0x8136('0x46')]({},_0x406065,_0x2f1f81[_0x8136('0x4e')]);return _0x49bfad[_0x8136('0x6a')](_0x406065);}})[_0x8136('0x2a')](function(_0x2f8630){if(_0x2f8630){_0x54f347=_0x2f8630[_0x8136('0x40')];if(!_0x2f1f81[_0x8136('0x3a')]['hasOwnProperty'](_0x8136('0x5c'))){_0x406065[_0x8136('0x23')]=qs[_0x8136('0x23')](_0x2f1f81['query'][_0x8136('0x23')]);_0x406065['offset']=qs[_0x8136('0x21')](_0x2f1f81[_0x8136('0x3a')][_0x8136('0x21')]);}return _0x49bfad['getTeams'](_0x406065);}})[_0x8136('0x2a')](function(_0x1d3a24){if(_0x1d3a24){return _0x1d3a24?{'count':_0x54f347,'rows':_0x1d3a24}:null;}})[_0x8136('0x2a')](respondWithResult(_0x22da0b,null))[_0x8136('0x4b')](handleError(_0x22da0b,null));};exports[_0x8136('0x6b')]=function(_0x4f27da,_0x39c1c3,_0x3c9f0d){var _0x26d855=_0x4f27da[_0x8136('0x57')][_0x8136('0x6c')];return db[_0x8136('0x69')][_0x8136('0x4a')]({'where':{'id':_0x26d855},'attributes':['id'],'include':[{'model':db[_0x8136('0x5e')],'as':_0x8136('0x6d'),'attributes':['id',_0x8136('0x30'),_0x8136('0x6e'),_0x8136('0x6f'),'interface'],'raw':!![]}]})[_0x8136('0x2a')](function(_0x116cd5){if(_0x116cd5){var _0x237122=_[_0x8136('0x70')](_0x116cd5,function(_0x5d6dfd){var _0x471285=_0x5d6dfd['get']({'plain':!![]});return _0x471285['Agents'];});return db[_0x8136('0x34')][_0x8136('0x4f')]({'where':{'id':_0x4f27da[_0x8136('0x4d')]['id']}})['then'](function(_0x16fb46){return db[_0x8136('0x71')][_0x8136('0x72')](function(_0x5ec0d6){return _0x16fb46['addTeams'](_0x26d855,{'transaction':_0x5ec0d6})[_0x8136('0x2a')](function(){return BPromise['each'](_0x237122,function(_0x383ab3){return db[_0x8136('0x5b')][_0x8136('0x73')]({'where':{'UserId':_0x383ab3['id'],'OpenchannelQueueId':_0x4f27da[_0x8136('0x4d')]['id']},'transaction':_0x5ec0d6});});})[_0x8136('0x2a')](function(){_0x237122[_0x8136('0x74')](function(_0x1f4fc1){socket[_0x8136('0x75')](_0x8136('0x76'),{'UserId':_0x1f4fc1['id'],'OpenchannelQueueId':_0x16fb46['id']});});});});});}})[_0x8136('0x2a')](respondWithStatusCode(_0x39c1c3,null))['catch'](handleError(_0x39c1c3,null));};exports[_0x8136('0x77')]=function(_0x2c13fe,_0x4e21a0,_0xa06a34){return db[_0x8136('0x69')][_0x8136('0x4a')]({'where':{'id':_0x2c13fe[_0x8136('0x3a')][_0x8136('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x8136('0x5e')],'as':_0x8136('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4e21a0,null))['then'](function(_0x2ddbb0){var _0x5f55bd=_[_0x8136('0x33')](_0x2ddbb0,'id');var _0x2e699=[];var _0x4659e4=[];var _0x307783=squel[_0x8136('0x78')]();_0x307783[_0x8136('0x79')]('tq.TeamId')[_0x8136('0x7a')](_0x8136('0x7b'),'tq')['join'](_0x8136('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8136('0x44')]('OpenchannelQueueId\x20=\x20?',_0x2c13fe[_0x8136('0x4d')]['id']);for(var _0x388bdb=0x0;_0x388bdb<_0x2ddbb0[_0x8136('0x40')];_0x388bdb+=0x1){let _0xac6dc4=_0x2ddbb0[_0x388bdb];for(var _0x39d3f1=0x0;_0x39d3f1<_0xac6dc4[_0x8136('0x6d')]['length'];_0x39d3f1+=0x1){let _0x51c029=_0xac6dc4[_0x8136('0x6d')][_0x39d3f1];var _0x45970c=_0x307783['clone']();_0x45970c['where'](_0x8136('0x7d'),_0x51c029['id']);_0x4659e4[_0x8136('0x7e')](db[_0x8136('0x71')][_0x8136('0x3a')](_0x45970c[_0x8136('0x7f')](),{'type':db[_0x8136('0x71')][_0x8136('0x80')]['SELECT']})[_0x8136('0x2a')](function(_0x3f1e50){if(_0x3f1e50[_0x8136('0x40')]===0x1){return _0x51c029['id'];}else{var _0x56b794=_[_0x8136('0x81')](_[_0x8136('0x33')](_0x3f1e50,_0x8136('0x82')),function(_0x53c3b0){return _[_0x8136('0x83')](_0x5f55bd,_0x53c3b0);});if(_0x56b794){return _0x51c029['id'];}}}));}}return BPromise[_0x8136('0x84')](_0x4659e4)['then'](function(_0x7f1f38){_0x2e699=_(_0x2e699)[_0x8136('0x85')](_0x7f1f38)[_0x8136('0x86')]()[_0x8136('0x87')]();return db[_0x8136('0x34')]['find']({'where':{'id':_0x2c13fe['params']['id']}})[_0x8136('0x2a')](function(_0x513b99){return db[_0x8136('0x71')][_0x8136('0x72')](function(_0x42c2fc){return _0x513b99[_0x8136('0x77')](_0x2c13fe[_0x8136('0x3a')][_0x8136('0x6c')],{'transaction':_0x42c2fc})[_0x8136('0x2a')](function(){if(!_[_0x8136('0x88')](_0x2e699)){return _0x513b99[_0x8136('0x89')](_0x2e699,{'transaction':_0x42c2fc});}})[_0x8136('0x2a')](function(){_0x2e699[_0x8136('0x74')](function(_0x94d677){socket[_0x8136('0x75')]('userOpenchannelQueue:remove',{'UserId':_0x94d677,'OpenchannelQueueId':_0x513b99['id']});});});});});});})[_0x8136('0x2a')](respondWithStatusCode(_0x4e21a0,null))['catch'](handleError(_0x4e21a0,null));};exports[_0x8136('0x8a')]=function(_0x32bccb,_0x43ce46,_0x3be951){return db[_0x8136('0x34')]['find']({'where':{'id':_0x32bccb[_0x8136('0x4d')]['id']}})[_0x8136('0x2a')](handleEntityNotFound(_0x43ce46,null))[_0x8136('0x2a')](function(_0x252bef){if(_0x252bef){return _0x252bef['addAgents'](_0x32bccb[_0x8136('0x57')]['ids'],_[_0x8136('0x8b')](_0x32bccb[_0x8136('0x57')],[_0x8136('0x6c'),'id'])||{})[_0x8136('0x8c')](function(_0x415299){for(var _0x589652=0x0;_0x589652<_0x32bccb[_0x8136('0x57')][_0x8136('0x6c')][_0x8136('0x40')];_0x589652+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x32bccb[_0x8136('0x57')][_0x8136('0x6c')][_0x589652]),'OpenchannelQueueId':Number(_0x32bccb['params']['id'])});}return _0x415299;});}})['then'](respondWithResult(_0x43ce46,null))[_0x8136('0x4b')](handleError(_0x43ce46,null));};exports[_0x8136('0x89')]=function(_0x404ee5,_0x1595a2,_0x390818){return db[_0x8136('0x34')][_0x8136('0x4f')]({'where':{'id':_0x404ee5['params']['id']}})[_0x8136('0x2a')](handleEntityNotFound(_0x1595a2,null))['then'](function(_0x582b4d){if(_0x582b4d){return _0x582b4d['removeAgents'](_0x404ee5[_0x8136('0x3a')][_0x8136('0x6c')])[_0x8136('0x2a')](function(){if(_[_0x8136('0x8d')](_0x404ee5['query']['ids'])){for(var _0x22afcb=0x0;_0x22afcb<_0x404ee5['query'][_0x8136('0x6c')][_0x8136('0x40')];_0x22afcb+=0x1){socket[_0x8136('0x75')](_0x8136('0x8e'),{'UserId':Number(_0x404ee5[_0x8136('0x3a')][_0x8136('0x6c')][_0x22afcb]),'OpenchannelQueueId':Number(_0x404ee5[_0x8136('0x4d')]['id'])});}}else{socket[_0x8136('0x75')](_0x8136('0x8e'),{'UserId':Number(_0x404ee5[_0x8136('0x3a')][_0x8136('0x6c')]),'OpenchannelQueueId':Number(_0x404ee5[_0x8136('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1595a2,null))[_0x8136('0x4b')](handleError(_0x1595a2,null));};exports[_0x8136('0x8f')]=function(_0x22bf11,_0x44a02c,_0x54fed6){var _0x4e0714={};var _0x18bd9c={};var _0x53d1b0;var _0x4c65b1;return db[_0x8136('0x34')][_0x8136('0x5a')]({'where':{'id':_0x22bf11['params']['id']}})['then'](handleEntityNotFound(_0x44a02c,null))['then'](function(_0x4998bb){if(_0x4998bb){_0x53d1b0=_0x4998bb;_0x18bd9c[_0x8136('0x39')]=_[_0x8136('0x3b')](db['User'][_0x8136('0x35')]);_0x18bd9c[_0x8136('0x3a')]=_[_0x8136('0x3b')](_0x22bf11['query']);_0x18bd9c[_0x8136('0x3c')]=_[_0x8136('0x3d')](_0x18bd9c[_0x8136('0x39')],_0x18bd9c['query']);_0x4e0714[_0x8136('0x3f')]=_[_0x8136('0x3d')](_0x18bd9c[_0x8136('0x39')],qs[_0x8136('0x3e')](_0x22bf11[_0x8136('0x3a')][_0x8136('0x3e')]));_0x4e0714[_0x8136('0x3f')]=_0x4e0714['attributes']['length']?_0x4e0714['attributes']:_0x18bd9c[_0x8136('0x39')];_0x4e0714[_0x8136('0x42')]=qs[_0x8136('0x43')](_0x22bf11[_0x8136('0x3a')]['sort']);_0x4e0714[_0x8136('0x44')]=qs[_0x8136('0x3c')](_[_0x8136('0x45')](_0x22bf11[_0x8136('0x3a')],_0x18bd9c[_0x8136('0x3c')]));if(_0x22bf11[_0x8136('0x3a')][_0x8136('0x5d')]){_0x4e0714[_0x8136('0x44')]=_['merge'](_0x4e0714[_0x8136('0x44')],{'$or':_[_0x8136('0x33')](_0x4e0714[_0x8136('0x3f')],function(_0x3e6df5){var _0x5132b3={};_0x5132b3[_0x3e6df5]={'$like':'%'+_0x22bf11[_0x8136('0x3a')][_0x8136('0x5d')]+'%'};return _0x5132b3;})});}_0x4e0714=_[_0x8136('0x46')]({},_0x4e0714,_0x22bf11['options']);return _0x53d1b0['getAgents'](_0x4e0714);}})['then'](function(_0x260e04){if(_0x260e04){_0x4c65b1=_0x260e04['length'];if(!_0x22bf11[_0x8136('0x3a')][_0x8136('0x41')]('nolimit')){_0x4e0714[_0x8136('0x23')]=qs[_0x8136('0x23')](_0x22bf11[_0x8136('0x3a')][_0x8136('0x23')]);_0x4e0714[_0x8136('0x21')]=qs[_0x8136('0x21')](_0x22bf11[_0x8136('0x3a')]['offset']);}return _0x53d1b0[_0x8136('0x8f')](_0x4e0714);}})[_0x8136('0x2a')](function(_0x35369c){if(_0x35369c){return _0x35369c?{'count':_0x4c65b1,'rows':_0x35369c}:null;}})[_0x8136('0x2a')](respondWithResult(_0x44a02c,null))[_0x8136('0x4b')](handleError(_0x44a02c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 0005d51..9ce0f40 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 _0xe0f3=['emit','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xe0f3,0xfd));var _0x3e0f=function(_0x4b7de3,_0x57cd78){_0x4b7de3=_0x4b7de3-0x0;var _0x3c2859=_0xe0f3[_0x4b7de3];return _0x3c2859;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x3e0f('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3e0f('0x1')](0x0);var events={'afterCreate':_0x3e0f('0x2'),'afterUpdate':_0x3e0f('0x3'),'afterDestroy':_0x3e0f('0x4')};function emitEvent(_0x39faf2){return function(_0x5438d8,_0x33b7c6,_0x2e01ff){OpenchannelQueueEvents['emit'](_0x39faf2+':'+_0x5438d8['id'],_0x5438d8);OpenchannelQueueEvents[_0x3e0f('0x5')](_0x39faf2,_0x5438d8);_0x2e01ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xe80c=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0xa36e97,_0x4a32db){var _0x511b49=function(_0xa25854){while(--_0xa25854){_0xa36e97['push'](_0xa36e97['shift']());}};_0x511b49(++_0x4a32db);}(_0xe80c,0x1b3));var _0xce80=function(_0x11c3fb,_0x46980c){_0x11c3fb=_0x11c3fb-0x0;var _0x27f7a0=_0xe80c[_0x11c3fb];return _0x27f7a0;};'use strict';var EventEmitter=require(_0xce80('0x0'));var OpenchannelQueue=require(_0xce80('0x1'))['db'][_0xce80('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xce80('0x3')](0x0);var events={'afterCreate':_0xce80('0x4'),'afterUpdate':_0xce80('0x5'),'afterDestroy':_0xce80('0x6')};function emitEvent(_0x6eb6f8){return function(_0x51c3d4,_0x1b6c30,_0x93e822){OpenchannelQueueEvents[_0xce80('0x7')](_0x6eb6f8+':'+_0x51c3d4['id'],_0x51c3d4);OpenchannelQueueEvents['emit'](_0x6eb6f8,_0x51c3d4);_0x93e822(null);};}for(var e in events){if(events[_0xce80('0x8')](e)){var event=events[e];OpenchannelQueue[_0xce80('0x9')](e,emitEvent(event));}}module[_0xce80('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 19437bc..6d5bebe 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 _0x481b=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','util','api'];(function(_0x346b88,_0x5c93ff){var _0x48e4b3=function(_0x3d5b96){while(--_0x3d5b96){_0x346b88['push'](_0x346b88['shift']());}};_0x48e4b3(++_0x5c93ff);}(_0x481b,0xc4));var _0xb481=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x481b[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require(_0xb481('0x0'));var logger=require('../../config/logger')(_0xb481('0x1'));var moment=require(_0xb481('0x2'));var BPromise=require(_0xb481('0x3'));var rp=require(_0xb481('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb481('0x5'));var config=require(_0xb481('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0xb481('0x7')]=function(_0x2b4419,_0x13f895){return _0x2b4419[_0xb481('0x8')](_0xb481('0x9'),attributes,{'tableName':_0xb481('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x004c=['path','rimraf','OpenchannelQueue','openchannel_queues','util','api','moment','bluebird'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x004c,0xd4));var _0xc004=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x004c[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require('lodash');var util=require(_0xc004('0x0'));var logger=require('../../config/logger')(_0xc004('0x1'));var moment=require(_0xc004('0x2'));var BPromise=require(_0xc004('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc004('0x4'));var rimraf=require(_0xc004('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x20a337,_0x58bb1c){return _0x20a337['define'](_0xc004('0x6'),attributes,{'tableName':_0xc004('0x7'),'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 3f65b68..27d2e9a 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 _0x03e7=['attributes','limit','map','include','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','findAll','options','raw','where'];(function(_0x3eb1c1,_0x1bb418){var _0x53645a=function(_0x5824b8){while(--_0x5824b8){_0x3eb1c1['push'](_0x3eb1c1['shift']());}};_0x53645a(++_0x1bb418);}(_0x03e7,0x121));var _0x703e=function(_0x35bc32,_0x288dd0){_0x35bc32=_0x35bc32-0x0;var _0x4b96b1=_0x03e7[_0x35bc32];return _0x4b96b1;};'use strict';var _=require(_0x703e('0x0'));var util=require(_0x703e('0x1'));var moment=require('moment');var BPromise=require(_0x703e('0x2'));var rs=require(_0x703e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x703e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x703e('0x5'))(_0x703e('0x6'));var config=require(_0x703e('0x7'));var jayson=require(_0x703e('0x8'));var client=jayson[_0x703e('0x9')][_0x703e('0xa')]({'port':0x232a});config['redis']=_[_0x703e('0xb')](config[_0x703e('0xc')],{'host':_0x703e('0xd'),'port':0x18eb});var socket=require(_0x703e('0xe'))(new Redis(config[_0x703e('0xc')]));require(_0x703e('0xf'))[_0x703e('0x10')](socket);function respondWithRpcPromise(_0x3465b4,_0x1438d5,_0x128c11){return new BPromise(function(_0xcce614,_0x5e8a47){return client['request'](_0x3465b4,_0x128c11)[_0x703e('0x11')](function(_0x455782){logger['info'](_0x703e('0x12'),_0x1438d5,_0x703e('0x13'));logger[_0x703e('0x14')](_0x703e('0x15'),_0x1438d5,'request\x20sent',JSON['stringify'](_0x455782));if(_0x455782[_0x703e('0x16')]){if(_0x455782['error'][_0x703e('0x17')]===0x1f4){logger[_0x703e('0x16')](_0x703e('0x12'),_0x1438d5,_0x455782[_0x703e('0x16')][_0x703e('0x18')]);return _0x5e8a47(_0x455782[_0x703e('0x16')][_0x703e('0x18')]);}logger[_0x703e('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1438d5,_0x455782[_0x703e('0x16')][_0x703e('0x18')]);return _0xcce614(_0x455782['error'][_0x703e('0x18')]);}else{logger[_0x703e('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x1438d5,_0x703e('0x13'));_0xcce614(_0x455782['result'][_0x703e('0x18')]);}})[_0x703e('0x1a')](function(_0x27e747){logger['error'](_0x703e('0x12'),_0x1438d5,_0x27e747);_0x5e8a47(_0x27e747);});});}exports['GetOpenchannelQueue']=function(_0x26b561){var _0x2b9c14=this;return new Promise(function(_0x4b89ee,_0x266115){return db['OpenchannelQueue'][_0x703e('0x1b')]({'raw':_0x26b561[_0x703e('0x1c')]?_0x26b561[_0x703e('0x1c')][_0x703e('0x1d')]===undefined?!![]:![]:!![],'where':_0x26b561[_0x703e('0x1c')]?_0x26b561[_0x703e('0x1c')][_0x703e('0x1e')]||null:null,'attributes':_0x26b561['options']?_0x26b561[_0x703e('0x1c')][_0x703e('0x1f')]||null:null,'limit':_0x26b561[_0x703e('0x1c')]?_0x26b561[_0x703e('0x1c')][_0x703e('0x20')]||null:null,'include':_0x26b561[_0x703e('0x1c')]?_0x26b561[_0x703e('0x1c')]['include']?_[_0x703e('0x21')](_0x26b561[_0x703e('0x1c')]['include'],function(_0x80f23e){return{'model':db[_0x80f23e['model']],'as':_0x80f23e['as'],'attributes':_0x80f23e['attributes'],'include':_0x80f23e[_0x703e('0x22')]?_[_0x703e('0x21')](_0x80f23e[_0x703e('0x22')],function(_0xfd40e5){return{'model':db[_0xfd40e5['model']],'as':_0xfd40e5['as'],'attributes':_0xfd40e5[_0x703e('0x1f')],'include':_0xfd40e5[_0x703e('0x22')]?_['map'](_0xfd40e5['include'],function(_0x29b98a){return{'model':db[_0x29b98a[_0x703e('0x23')]],'as':_0x29b98a['as'],'attributes':_0x29b98a['attributes']};}):[]};}):[]};}):[]:[]})[_0x703e('0x11')](function(_0x250b8f){logger[_0x703e('0x19')](_0x703e('0x24'),_0x26b561);logger['debug'](_0x703e('0x24'),_0x26b561,JSON[_0x703e('0x25')](_0x250b8f));_0x4b89ee(_0x250b8f);})[_0x703e('0x1a')](function(_0x14275e){logger['error']('GetOpenchannelQueue',_0x14275e['message'],_0x26b561);_0x266115(_0x2b9c14[_0x703e('0x16')](0x1f4,_0x14275e[_0x703e('0x18')]));});});};exports[_0x703e('0x26')]=function(_0x24962d){var _0x39c9ae=this;return new Promise(function(_0x3b3560,_0x2ce003){return db['OpenchannelQueue'][_0x703e('0x27')]({'raw':_0x24962d[_0x703e('0x1c')]?_0x24962d[_0x703e('0x1c')][_0x703e('0x1d')]===undefined?!![]:![]:!![],'where':_0x24962d[_0x703e('0x1c')]?_0x24962d[_0x703e('0x1c')]['where']||null:null,'attributes':_0x24962d['options']?_0x24962d[_0x703e('0x1c')][_0x703e('0x1f')]||null:null,'include':_0x24962d[_0x703e('0x1c')]?_0x24962d[_0x703e('0x1c')][_0x703e('0x22')]?_['map'](_0x24962d[_0x703e('0x1c')][_0x703e('0x22')],function(_0x4d0078){return{'model':db[_0x4d0078[_0x703e('0x23')]],'as':_0x4d0078['as'],'attributes':_0x4d0078['attributes'],'include':_0x4d0078[_0x703e('0x22')]?_['map'](_0x4d0078[_0x703e('0x22')],function(_0x187217){return{'model':db[_0x187217['model']],'as':_0x187217['as'],'attributes':_0x187217[_0x703e('0x1f')],'include':_0x187217[_0x703e('0x22')]?_[_0x703e('0x21')](_0x187217[_0x703e('0x22')],function(_0x5b0fba){return{'model':db[_0x5b0fba[_0x703e('0x23')]],'as':_0x5b0fba['as'],'attributes':_0x5b0fba['attributes']};}):[]};}):[]};}):[]:[]})[_0x703e('0x11')](function(_0x52afdd){logger[_0x703e('0x19')]('ShowOpenchannelQueue',_0x24962d);logger['debug'](_0x703e('0x26'),_0x24962d,JSON['stringify'](_0x52afdd));_0x3b3560(_0x52afdd);})[_0x703e('0x1a')](function(_0x1a21d5){logger[_0x703e('0x16')]('ShowOpenchannelQueue',_0x1a21d5[_0x703e('0x18')],_0x24962d);_0x2ce003(_0x39c9ae[_0x703e('0x16')](0x1f4,_0x1a21d5[_0x703e('0x18')]));});});}; \ No newline at end of file +var _0x7739=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','lodash'];(function(_0x1534e9,_0x1c062c){var _0x3d9d86=function(_0x3a0a91){while(--_0x3a0a91){_0x1534e9['push'](_0x1534e9['shift']());}};_0x3d9d86(++_0x1c062c);}(_0x7739,0x1c7));var _0x9773=function(_0x45b5f6,_0x490fb2){_0x45b5f6=_0x45b5f6-0x0;var _0x1b2a71=_0x7739[_0x45b5f6];return _0x1b2a71;};'use strict';var _=require(_0x9773('0x0'));var util=require(_0x9773('0x1'));var moment=require('moment');var BPromise=require(_0x9773('0x2'));var rs=require(_0x9773('0x3'));var fs=require('fs');var Redis=require(_0x9773('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9773('0x5'));var logger=require(_0x9773('0x6'))('rpc');var config=require(_0x9773('0x7'));var jayson=require(_0x9773('0x8'));var client=jayson[_0x9773('0x9')][_0x9773('0xa')]({'port':0x232a});config[_0x9773('0xb')]=_[_0x9773('0xc')](config[_0x9773('0xb')],{'host':_0x9773('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9773('0xb')]));require('./openchannelQueue.socket')[_0x9773('0xe')](socket);function respondWithRpcPromise(_0x381120,_0x57c49a,_0x1e1e7a){return new BPromise(function(_0x5959c5,_0x2cda07){return client['request'](_0x381120,_0x1e1e7a)[_0x9773('0xf')](function(_0x1e9d70){logger[_0x9773('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x57c49a,'request\x20sent');logger[_0x9773('0x11')](_0x9773('0x12'),_0x57c49a,'request\x20sent',JSON['stringify'](_0x1e9d70));if(_0x1e9d70[_0x9773('0x13')]){if(_0x1e9d70[_0x9773('0x13')][_0x9773('0x14')]===0x1f4){logger[_0x9773('0x13')](_0x9773('0x15'),_0x57c49a,_0x1e9d70[_0x9773('0x13')][_0x9773('0x16')]);return _0x2cda07(_0x1e9d70['error'][_0x9773('0x16')]);}logger[_0x9773('0x13')](_0x9773('0x15'),_0x57c49a,_0x1e9d70[_0x9773('0x13')][_0x9773('0x16')]);return _0x5959c5(_0x1e9d70[_0x9773('0x13')][_0x9773('0x16')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x57c49a,_0x9773('0x17'));_0x5959c5(_0x1e9d70[_0x9773('0x18')][_0x9773('0x16')]);}})[_0x9773('0x19')](function(_0x4e5bf5){logger[_0x9773('0x13')](_0x9773('0x15'),_0x57c49a,_0x4e5bf5);_0x2cda07(_0x4e5bf5);});});}exports['GetOpenchannelQueue']=function(_0x361598){var _0x182d83=this;return new Promise(function(_0x2d9c9b,_0x2c2243){return db[_0x9773('0x1a')][_0x9773('0x1b')]({'raw':_0x361598['options']?_0x361598[_0x9773('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x361598[_0x9773('0x1c')]?_0x361598[_0x9773('0x1c')][_0x9773('0x1d')]||null:null,'attributes':_0x361598[_0x9773('0x1c')]?_0x361598['options'][_0x9773('0x1e')]||null:null,'limit':_0x361598[_0x9773('0x1c')]?_0x361598[_0x9773('0x1c')][_0x9773('0x1f')]||null:null,'include':_0x361598[_0x9773('0x1c')]?_0x361598['options'][_0x9773('0x20')]?_[_0x9773('0x21')](_0x361598[_0x9773('0x1c')][_0x9773('0x20')],function(_0x14d516){return{'model':db[_0x14d516[_0x9773('0x22')]],'as':_0x14d516['as'],'attributes':_0x14d516['attributes'],'include':_0x14d516[_0x9773('0x20')]?_[_0x9773('0x21')](_0x14d516[_0x9773('0x20')],function(_0x1e0b79){return{'model':db[_0x1e0b79[_0x9773('0x22')]],'as':_0x1e0b79['as'],'attributes':_0x1e0b79[_0x9773('0x1e')],'include':_0x1e0b79[_0x9773('0x20')]?_['map'](_0x1e0b79[_0x9773('0x20')],function(_0x167245){return{'model':db[_0x167245[_0x9773('0x22')]],'as':_0x167245['as'],'attributes':_0x167245['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33a46d){logger[_0x9773('0x10')](_0x9773('0x23'),_0x361598);logger['debug'](_0x9773('0x23'),_0x361598,JSON[_0x9773('0x24')](_0x33a46d));_0x2d9c9b(_0x33a46d);})[_0x9773('0x19')](function(_0x83ec41){logger[_0x9773('0x13')]('GetOpenchannelQueue',_0x83ec41[_0x9773('0x16')],_0x361598);_0x2c2243(_0x182d83[_0x9773('0x13')](0x1f4,_0x83ec41[_0x9773('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x4890d8){var _0x5e94c3=this;return new Promise(function(_0x3a45e9,_0x198689){return db[_0x9773('0x1a')]['find']({'raw':_0x4890d8['options']?_0x4890d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x4890d8['options']?_0x4890d8[_0x9773('0x1c')][_0x9773('0x1d')]||null:null,'attributes':_0x4890d8[_0x9773('0x1c')]?_0x4890d8[_0x9773('0x1c')][_0x9773('0x1e')]||null:null,'include':_0x4890d8[_0x9773('0x1c')]?_0x4890d8[_0x9773('0x1c')][_0x9773('0x20')]?_[_0x9773('0x21')](_0x4890d8['options'][_0x9773('0x20')],function(_0x33283f){return{'model':db[_0x33283f[_0x9773('0x22')]],'as':_0x33283f['as'],'attributes':_0x33283f['attributes'],'include':_0x33283f[_0x9773('0x20')]?_[_0x9773('0x21')](_0x33283f[_0x9773('0x20')],function(_0x17e6a7){return{'model':db[_0x17e6a7[_0x9773('0x22')]],'as':_0x17e6a7['as'],'attributes':_0x17e6a7[_0x9773('0x1e')],'include':_0x17e6a7[_0x9773('0x20')]?_[_0x9773('0x21')](_0x17e6a7['include'],function(_0x10e428){return{'model':db[_0x10e428[_0x9773('0x22')]],'as':_0x10e428['as'],'attributes':_0x10e428[_0x9773('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27371c){logger[_0x9773('0x10')]('ShowOpenchannelQueue',_0x4890d8);logger[_0x9773('0x11')](_0x9773('0x25'),_0x4890d8,JSON[_0x9773('0x24')](_0x27371c));_0x3a45e9(_0x27371c);})['catch'](function(_0x44b5da){logger['error'](_0x9773('0x25'),_0x44b5da[_0x9773('0x16')],_0x4890d8);_0x198689(_0x5e94c3['error'](0x1f4,_0x44b5da[_0x9773('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 8290ef3..9d04953 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 _0x3395=['remove','update','openchannelQueue:'];(function(_0x1bca73,_0x4cd61d){var _0x2457c6=function(_0x5ddeb2){while(--_0x5ddeb2){_0x1bca73['push'](_0x1bca73['shift']());}};_0x2457c6(++_0x4cd61d);}(_0x3395,0x1b3));var _0x5339=function(_0x11a838,_0x592747){_0x11a838=_0x11a838-0x0;var _0x5b659f=_0x3395[_0x11a838];return _0x5b659f;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x5339('0x0'),_0x5339('0x1')];function createListener(_0x5a2708,_0x2271ca){return function(_0xbcffd3){_0x2271ca['emit'](_0x5a2708,_0xbcffd3);};}function removeListener(_0x1dfc16,_0x581d0e){return function(){OpenchannelQueueEvents['removeListener'](_0x1dfc16,_0x581d0e);};}exports['register']=function(_0x2487be){for(var _0x2de837=0x0,_0x297902=events['length'];_0x2de837<_0x297902;_0x2de837++){var _0x3bc6e7=events[_0x2de837];var _0x3d458b=createListener(_0x5339('0x2')+_0x3bc6e7,_0x2487be);OpenchannelQueueEvents['on'](_0x3bc6e7,_0x3d458b);}}; \ No newline at end of file +var _0xe3b0=['length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0xe3b0,0x67));var _0x0e3b=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xe3b0[_0x52085a];return _0x5afc1a;};'use strict';var OpenchannelQueueEvents=require(_0x0e3b('0x0'));var events=[_0x0e3b('0x1'),_0x0e3b('0x2'),_0x0e3b('0x3')];function createListener(_0xfad3bf,_0x5ce55b){return function(_0x3a1658){_0x5ce55b[_0x0e3b('0x4')](_0xfad3bf,_0x3a1658);};}function removeListener(_0x505c44,_0x3128be){return function(){OpenchannelQueueEvents['removeListener'](_0x505c44,_0x3128be);};}exports['register']=function(_0x1e0297){for(var _0x4094cb=0x0,_0x733932=events[_0x0e3b('0x5')];_0x4094cb<_0x733932;_0x4094cb++){var _0x15d829=events[_0x4094cb];var _0x180484=createListener('openchannelQueue:'+_0x15d829,_0x1e0297);OpenchannelQueueEvents['on'](_0x15d829,_0x180484);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 656cbe2..7e1c51a 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 _0xeb6a=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0xeb6a,0xf3));var _0xaeb6=function(_0x207e9e,_0x3a9606){_0x207e9e=_0x207e9e-0x0;var _0x33c42b=_0xeb6a[_0x207e9e];return _0x33c42b;};'use strict';var multer=require('multer');var util=require(_0xaeb6('0x0'));var path=require('path');var timeout=require(_0xaeb6('0x1'));var express=require(_0xaeb6('0x2'));var router=express[_0xaeb6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaeb6('0x4'));var interaction=require(_0xaeb6('0x5'));var config=require(_0xaeb6('0x6'));var controller=require(_0xaeb6('0x7'));router[_0xaeb6('0x8')]('/',auth['isAuthenticated'](),controller[_0xaeb6('0x9')]);router[_0xaeb6('0x8')](_0xaeb6('0xa'),auth[_0xaeb6('0xb')](),controller[_0xaeb6('0xc')]);router[_0xaeb6('0x8')](_0xaeb6('0xd'),auth[_0xaeb6('0xb')](),controller[_0xaeb6('0xe')]);router[_0xaeb6('0xf')]('/',auth[_0xaeb6('0xb')](),controller[_0xaeb6('0x10')]);router[_0xaeb6('0x11')](_0xaeb6('0xd'),auth[_0xaeb6('0xb')](),controller[_0xaeb6('0x12')]);router[_0xaeb6('0x13')](_0xaeb6('0xd'),auth[_0xaeb6('0xb')](),controller['destroy']);module[_0xaeb6('0x14')]=router; \ No newline at end of file +var _0xfd50=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xfd50,0xbe));var _0x0fd5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfd50[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0fd5('0x0'));var util=require(_0x0fd5('0x1'));var path=require('path');var timeout=require(_0x0fd5('0x2'));var express=require(_0x0fd5('0x3'));var router=express[_0x0fd5('0x4')]();var fs_extra=require(_0x0fd5('0x5'));var auth=require(_0x0fd5('0x6'));var interaction=require(_0x0fd5('0x7'));var config=require(_0x0fd5('0x8'));var controller=require(_0x0fd5('0x9'));router[_0x0fd5('0xa')]('/',auth['isAuthenticated'](),controller[_0x0fd5('0xb')]);router[_0x0fd5('0xa')]('/describe',auth[_0x0fd5('0xc')](),controller['describe']);router['get'](_0x0fd5('0xd'),auth[_0x0fd5('0xc')](),controller[_0x0fd5('0xe')]);router[_0x0fd5('0xf')]('/',auth['isAuthenticated'](),controller[_0x0fd5('0x10')]);router[_0x0fd5('0x11')](_0x0fd5('0xd'),auth[_0x0fd5('0xc')](),controller[_0x0fd5('0x12')]);router[_0x0fd5('0x13')]('/:id',auth[_0x0fd5('0xc')](),controller['destroy']);module[_0x0fd5('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 04749ad..5b284a6 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 _0x808d=['STRING','DATE','moment','exports'];(function(_0x1bee7a,_0xacfa2a){var _0x5d69d7=function(_0x3b8891){while(--_0x3b8891){_0x1bee7a['push'](_0x1bee7a['shift']());}};_0x5d69d7(++_0xacfa2a);}(_0x808d,0x1c2));var _0xd808=function(_0x5da34e,_0xa2769c){_0x5da34e=_0x5da34e-0x0;var _0x5665dc=_0x808d[_0x5da34e];return _0x5665dc;};'use strict';var moment=require(_0xd808('0x0'));var Sequelize=require('sequelize');module[_0xd808('0x1')]={'uniqueid':{'type':Sequelize[_0xd808('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd808('0x2')]},'joinAt':{'type':Sequelize[_0xd808('0x3')]},'leaveAt':{'type':Sequelize[_0xd808('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd808('0x3')]},'reason':{'type':Sequelize[_0xd808('0x2')]}}; \ No newline at end of file +var _0x2f86=['STRING','DATE','sequelize','exports'];(function(_0x29c1ef,_0x40d082){var _0x61a486=function(_0x3865a6){while(--_0x3865a6){_0x29c1ef['push'](_0x29c1ef['shift']());}};_0x61a486(++_0x40d082);}(_0x2f86,0x18e));var _0x62f8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2f86[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require('moment');var Sequelize=require(_0x62f8('0x0'));module[_0x62f8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x62f8('0x2')]},'joinAt':{'type':Sequelize[_0x62f8('0x3')]},'leaveAt':{'type':Sequelize[_0x62f8('0x3')]},'acceptAt':{'type':Sequelize[_0x62f8('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x62f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b5592be..74a8317 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 _0xe8d9=['query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model'];(function(_0x3ac2ed,_0x60b800){var _0x56b758=function(_0x1a02fb){while(--_0x1a02fb){_0x3ac2ed['push'](_0x3ac2ed['shift']());}};_0x56b758(++_0x60b800);}(_0xe8d9,0x1a2));var _0x9e8d=function(_0x11a8ea,_0x30b131){_0x11a8ea=_0x11a8ea-0x0;var _0x539101=_0xe8d9[_0x11a8ea];return _0x539101;};'use strict';var emlformat=require(_0x9e8d('0x0'));var rimraf=require(_0x9e8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e8d('0x2'));var rp=require('request-promise');var moment=require(_0x9e8d('0x3'));var BPromise=require(_0x9e8d('0x4'));var Mustache=require(_0x9e8d('0x5'));var util=require(_0x9e8d('0x6'));var path=require(_0x9e8d('0x7'));var sox=require(_0x9e8d('0x8'));var csv=require('to-csv');var ejs=require(_0x9e8d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e8d('0xa'));var squel=require(_0x9e8d('0xb'));var crypto=require(_0x9e8d('0xc'));var jsforce=require(_0x9e8d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e8d('0xe'));var Papa=require(_0x9e8d('0xf'));var Redis=require(_0x9e8d('0x10'));var authService=require(_0x9e8d('0x11'));var qs=require(_0x9e8d('0x12'));var as=require(_0x9e8d('0x13'));var hardwareService=require(_0x9e8d('0x14'));var logger=require('../../config/logger')(_0x9e8d('0x15'));var utils=require(_0x9e8d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9e8d('0x17'))['db'];function respondWithStatusCode(_0x591376,_0x24fcec){_0x24fcec=_0x24fcec||0xcc;return function(_0x6684c5){if(_0x6684c5){return _0x591376[_0x9e8d('0x18')](_0x24fcec);}return _0x591376[_0x9e8d('0x19')](_0x24fcec)[_0x9e8d('0x1a')]();};}function respondWithResult(_0x20b3ea,_0x2a1889){_0x2a1889=_0x2a1889||0xc8;return function(_0x4fd9ca){if(_0x4fd9ca){return _0x20b3ea[_0x9e8d('0x19')](_0x2a1889)['json'](_0x4fd9ca);}};}function respondWithFilteredResult(_0x7a0c5a,_0x3be40e){return function(_0x3b4c3b){if(_0x3b4c3b){var _0x1baa0c=typeof _0x3be40e['offset']===_0x9e8d('0x1b')&&typeof _0x3be40e[_0x9e8d('0x1c')]===_0x9e8d('0x1b');var _0x1dea8a=_0x3b4c3b[_0x9e8d('0x1d')];var _0x154b34=_0x1baa0c?0x0:_0x3be40e[_0x9e8d('0x1e')];var _0x821dc7=_0x1baa0c?_0x3b4c3b[_0x9e8d('0x1d')]:_0x3be40e['offset']+_0x3be40e[_0x9e8d('0x1c')];var _0x5be56f;if(_0x821dc7>=_0x1dea8a){_0x821dc7=_0x1dea8a;_0x5be56f=0xc8;}else{_0x5be56f=0xce;}_0x7a0c5a['status'](_0x5be56f);return _0x7a0c5a[_0x9e8d('0x1f')]('Content-Range',_0x154b34+'-'+_0x821dc7+'/'+_0x1dea8a)[_0x9e8d('0x20')](_0x3b4c3b);}return null;};}function patchUpdates(_0x157fde){return function(_0x47ad14){try{jsonpatch[_0x9e8d('0x21')](_0x47ad14,_0x157fde,!![]);}catch(_0x11a601){return BPromise[_0x9e8d('0x22')](_0x11a601);}return _0x47ad14[_0x9e8d('0x23')]();};}function saveUpdates(_0x4a8c6d,_0x19ca9f){return function(_0x422552){if(_0x422552){return _0x422552[_0x9e8d('0x24')](_0x4a8c6d)[_0x9e8d('0x25')](function(_0x4b99b7){return _0x4b99b7;});}return null;};}function removeEntity(_0x282e8f,_0x4a8f6b){return function(_0x57657f){if(_0x57657f){return _0x57657f[_0x9e8d('0x26')]()[_0x9e8d('0x25')](function(){_0x282e8f['status'](0xcc)[_0x9e8d('0x1a')]();});}};}function handleEntityNotFound(_0x32b9b1,_0x40ca70){return function(_0xd5d2c3){if(!_0xd5d2c3){_0x32b9b1['sendStatus'](0x194);}return _0xd5d2c3;};}function handleError(_0x5a4599,_0x20eb6e){_0x20eb6e=_0x20eb6e||0x1f4;return function(_0x1695a2){logger[_0x9e8d('0x27')](_0x1695a2[_0x9e8d('0x28')]);if(_0x1695a2[_0x9e8d('0x29')]){delete _0x1695a2[_0x9e8d('0x29')];}_0x5a4599[_0x9e8d('0x19')](_0x20eb6e)[_0x9e8d('0x2a')](_0x1695a2);};}exports[_0x9e8d('0x2b')]=function(_0x13a3f0,_0x5e2f7e){var _0x3e10bc={},_0x1b8008={},_0x31c932={'count':0x0,'rows':[]};var _0x1d0a03=_[_0x9e8d('0x2c')](db[_0x9e8d('0x2d')][_0x9e8d('0x2e')],function(_0x40f818){return{'name':_0x40f818[_0x9e8d('0x2f')],'type':_0x40f818[_0x9e8d('0x30')]['key']};});_0x1b8008[_0x9e8d('0x31')]=_[_0x9e8d('0x2c')](_0x1d0a03,_0x9e8d('0x29'));_0x1b8008[_0x9e8d('0x32')]=_[_0x9e8d('0x33')](_0x13a3f0[_0x9e8d('0x32')]);_0x1b8008[_0x9e8d('0x34')]=_['intersection'](_0x1b8008[_0x9e8d('0x31')],_0x1b8008['query']);_0x3e10bc[_0x9e8d('0x35')]=_['intersection'](_0x1b8008[_0x9e8d('0x31')],qs[_0x9e8d('0x36')](_0x13a3f0[_0x9e8d('0x32')]['fields']));_0x3e10bc['attributes']=_0x3e10bc[_0x9e8d('0x35')][_0x9e8d('0x37')]?_0x3e10bc[_0x9e8d('0x35')]:_0x1b8008['model'];if(!_0x13a3f0[_0x9e8d('0x32')][_0x9e8d('0x38')](_0x9e8d('0x39'))){_0x3e10bc[_0x9e8d('0x1c')]=qs[_0x9e8d('0x1c')](_0x13a3f0[_0x9e8d('0x32')]['limit']);_0x3e10bc['offset']=qs['offset'](_0x13a3f0[_0x9e8d('0x32')]['offset']);}_0x3e10bc[_0x9e8d('0x3a')]=qs[_0x9e8d('0x3b')](_0x13a3f0[_0x9e8d('0x32')][_0x9e8d('0x3b')]);_0x3e10bc[_0x9e8d('0x3c')]=qs['filters'](_[_0x9e8d('0x3d')](_0x13a3f0[_0x9e8d('0x32')],_0x1b8008[_0x9e8d('0x34')]),_0x1d0a03);if(_0x13a3f0['query'][_0x9e8d('0x3e')]){_0x3e10bc[_0x9e8d('0x3c')]=_['merge'](_0x3e10bc[_0x9e8d('0x3c')],{'$or':_[_0x9e8d('0x2c')](_0x1d0a03,function(_0x431899){if(_0x431899[_0x9e8d('0x30')]!==_0x9e8d('0x3f')){var _0x259406={};_0x259406[_0x431899[_0x9e8d('0x29')]]={'$like':'%'+_0x13a3f0[_0x9e8d('0x32')][_0x9e8d('0x3e')]+'%'};return _0x259406;}})});}_0x3e10bc=_[_0x9e8d('0x40')]({},_0x3e10bc,_0x13a3f0[_0x9e8d('0x41')]);var _0x250f1d={'where':_0x3e10bc[_0x9e8d('0x3c')]};return db['OpenchannelQueueReport'][_0x9e8d('0x1d')](_0x250f1d)[_0x9e8d('0x25')](function(_0x1ce961){_0x31c932['count']=_0x1ce961;if(_0x13a3f0[_0x9e8d('0x32')][_0x9e8d('0x42')]){_0x3e10bc[_0x9e8d('0x43')]=[{'all':!![]}];}return db[_0x9e8d('0x2d')][_0x9e8d('0x44')](_0x3e10bc);})[_0x9e8d('0x25')](function(_0x191cd7){_0x31c932[_0x9e8d('0x45')]=_0x191cd7;return _0x31c932;})[_0x9e8d('0x25')](respondWithFilteredResult(_0x5e2f7e,_0x3e10bc))[_0x9e8d('0x46')](handleError(_0x5e2f7e,null));};exports[_0x9e8d('0x47')]=function(_0x545b0f,_0xa81b42){var _0x213653={'raw':!![],'where':{'id':_0x545b0f[_0x9e8d('0x48')]['id']}},_0xe57e25={};_0xe57e25['model']=_['keys'](db[_0x9e8d('0x2d')][_0x9e8d('0x2e')]);_0xe57e25[_0x9e8d('0x32')]=_[_0x9e8d('0x33')](_0x545b0f[_0x9e8d('0x32')]);_0xe57e25[_0x9e8d('0x34')]=_['intersection'](_0xe57e25[_0x9e8d('0x31')],_0xe57e25[_0x9e8d('0x32')]);_0x213653[_0x9e8d('0x35')]=_[_0x9e8d('0x49')](_0xe57e25['model'],qs[_0x9e8d('0x36')](_0x545b0f[_0x9e8d('0x32')][_0x9e8d('0x36')]));_0x213653['attributes']=_0x213653[_0x9e8d('0x35')]['length']?_0x213653[_0x9e8d('0x35')]:_0xe57e25[_0x9e8d('0x31')];if(_0x545b0f[_0x9e8d('0x32')][_0x9e8d('0x42')]){_0x213653[_0x9e8d('0x43')]=[{'all':!![]}];}_0x213653=_['merge']({},_0x213653,_0x545b0f['options']);return db[_0x9e8d('0x2d')][_0x9e8d('0x4a')](_0x213653)[_0x9e8d('0x25')](handleEntityNotFound(_0xa81b42,null))[_0x9e8d('0x25')](respondWithResult(_0xa81b42,null))[_0x9e8d('0x46')](handleError(_0xa81b42,null));};exports[_0x9e8d('0x4b')]=function(_0x52e944,_0x56e91a){return db[_0x9e8d('0x2d')][_0x9e8d('0x4b')](_0x52e944['body'],{})[_0x9e8d('0x25')](respondWithResult(_0x56e91a,0xc9))[_0x9e8d('0x46')](handleError(_0x56e91a,null));};exports[_0x9e8d('0x24')]=function(_0x412dc3,_0x2f512a){if(_0x412dc3[_0x9e8d('0x4c')]['id']){delete _0x412dc3[_0x9e8d('0x4c')]['id'];}return db['OpenchannelQueueReport'][_0x9e8d('0x4a')]({'where':{'id':_0x412dc3[_0x9e8d('0x48')]['id']}})[_0x9e8d('0x25')](handleEntityNotFound(_0x2f512a,null))[_0x9e8d('0x25')](saveUpdates(_0x412dc3[_0x9e8d('0x4c')],null))[_0x9e8d('0x25')](respondWithResult(_0x2f512a,null))[_0x9e8d('0x46')](handleError(_0x2f512a,null));};exports['destroy']=function(_0x5f5c2f,_0x1f2744){return db[_0x9e8d('0x2d')][_0x9e8d('0x4a')]({'where':{'id':_0x5f5c2f['params']['id']}})[_0x9e8d('0x25')](handleEntityNotFound(_0x1f2744,null))[_0x9e8d('0x25')](removeEntity(_0x1f2744,null))['catch'](handleError(_0x1f2744,null));};exports[_0x9e8d('0x4d')]=function(_0x30400a,_0x420b85){return db[_0x9e8d('0x2d')][_0x9e8d('0x4d')]()[_0x9e8d('0x25')](respondWithResult(_0x420b85,null))['catch'](handleError(_0x420b85,null));}; \ No newline at end of file +var _0xc44b=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','query','keys','filters'];(function(_0x155617,_0x512454){var _0x34bf91=function(_0x48aa16){while(--_0x48aa16){_0x155617['push'](_0x155617['shift']());}};_0x34bf91(++_0x512454);}(_0xc44b,0x1cf));var _0xbc44=function(_0x501ca1,_0x6c6edc){_0x501ca1=_0x501ca1-0x0;var _0x2a99c4=_0xc44b[_0x501ca1];return _0x2a99c4;};'use strict';var emlformat=require(_0xbc44('0x0'));var rimraf=require(_0xbc44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc44('0x2'));var rp=require(_0xbc44('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbc44('0x4'));var util=require(_0xbc44('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbc44('0x6'));var ejs=require(_0xbc44('0x7'));var fs=require('fs');var fs_extra=require(_0xbc44('0x8'));var _=require('lodash');var squel=require(_0xbc44('0x9'));var crypto=require('crypto');var jsforce=require(_0xbc44('0xa'));var deskjs=require(_0xbc44('0xb'));var toCsv=require(_0xbc44('0x6'));var querystring=require(_0xbc44('0xc'));var Papa=require('papaparse');var Redis=require(_0xbc44('0xd'));var authService=require(_0xbc44('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbc44('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbc44('0x10'));var utils=require(_0xbc44('0x11'));var config=require(_0xbc44('0x12'));var licenseUtil=require(_0xbc44('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x416896,_0x384e18){_0x384e18=_0x384e18||0xcc;return function(_0xef0264){if(_0xef0264){return _0x416896['sendStatus'](_0x384e18);}return _0x416896['status'](_0x384e18)['end']();};}function respondWithResult(_0x375ccf,_0x24f898){_0x24f898=_0x24f898||0xc8;return function(_0x491789){if(_0x491789){return _0x375ccf[_0xbc44('0x14')](_0x24f898)['json'](_0x491789);}};}function respondWithFilteredResult(_0x184938,_0x3871cf){return function(_0x11771e){if(_0x11771e){var _0x1e1475=typeof _0x3871cf[_0xbc44('0x15')]===_0xbc44('0x16')&&typeof _0x3871cf[_0xbc44('0x17')]===_0xbc44('0x16');var _0x96fbc7=_0x11771e[_0xbc44('0x18')];var _0x146fce=_0x1e1475?0x0:_0x3871cf[_0xbc44('0x15')];var _0x303ce4=_0x1e1475?_0x11771e[_0xbc44('0x18')]:_0x3871cf[_0xbc44('0x15')]+_0x3871cf[_0xbc44('0x17')];var _0x5dfa59;if(_0x303ce4>=_0x96fbc7){_0x303ce4=_0x96fbc7;_0x5dfa59=0xc8;}else{_0x5dfa59=0xce;}_0x184938[_0xbc44('0x14')](_0x5dfa59);return _0x184938[_0xbc44('0x19')](_0xbc44('0x1a'),_0x146fce+'-'+_0x303ce4+'/'+_0x96fbc7)[_0xbc44('0x1b')](_0x11771e);}return null;};}function patchUpdates(_0x74270e){return function(_0x4bfdb7){try{jsonpatch[_0xbc44('0x1c')](_0x4bfdb7,_0x74270e,!![]);}catch(_0x513d72){return BPromise[_0xbc44('0x1d')](_0x513d72);}return _0x4bfdb7[_0xbc44('0x1e')]();};}function saveUpdates(_0x188434,_0x5c45ad){return function(_0x387d14){if(_0x387d14){return _0x387d14[_0xbc44('0x1f')](_0x188434)[_0xbc44('0x20')](function(_0x44fec3){return _0x44fec3;});}return null;};}function removeEntity(_0x3acd37,_0x465c1b){return function(_0x4e9ba0){if(_0x4e9ba0){return _0x4e9ba0[_0xbc44('0x21')]()['then'](function(){_0x3acd37[_0xbc44('0x14')](0xcc)[_0xbc44('0x22')]();});}};}function handleEntityNotFound(_0x254fc3,_0x498749){return function(_0x455413){if(!_0x455413){_0x254fc3['sendStatus'](0x194);}return _0x455413;};}function handleError(_0x295bf1,_0x3b671f){_0x3b671f=_0x3b671f||0x1f4;return function(_0xf8f1f7){logger[_0xbc44('0x23')](_0xf8f1f7[_0xbc44('0x24')]);if(_0xf8f1f7[_0xbc44('0x25')]){delete _0xf8f1f7[_0xbc44('0x25')];}_0x295bf1[_0xbc44('0x14')](_0x3b671f)[_0xbc44('0x26')](_0xf8f1f7);};}exports[_0xbc44('0x27')]=function(_0x2d74e3,_0x4727d9){var _0x37a48d={},_0x523043={},_0x315b69={'count':0x0,'rows':[]};var _0x1d9c19=_[_0xbc44('0x28')](db[_0xbc44('0x29')]['rawAttributes'],function(_0x27dc8c){return{'name':_0x27dc8c[_0xbc44('0x2a')],'type':_0x27dc8c[_0xbc44('0x2b')][_0xbc44('0x2c')]};});_0x523043['model']=_[_0xbc44('0x28')](_0x1d9c19,_0xbc44('0x25'));_0x523043[_0xbc44('0x2d')]=_[_0xbc44('0x2e')](_0x2d74e3['query']);_0x523043[_0xbc44('0x2f')]=_[_0xbc44('0x30')](_0x523043[_0xbc44('0x31')],_0x523043[_0xbc44('0x2d')]);_0x37a48d[_0xbc44('0x32')]=_[_0xbc44('0x30')](_0x523043[_0xbc44('0x31')],qs[_0xbc44('0x33')](_0x2d74e3[_0xbc44('0x2d')]['fields']));_0x37a48d[_0xbc44('0x32')]=_0x37a48d[_0xbc44('0x32')][_0xbc44('0x34')]?_0x37a48d[_0xbc44('0x32')]:_0x523043['model'];if(!_0x2d74e3['query'][_0xbc44('0x35')](_0xbc44('0x36'))){_0x37a48d[_0xbc44('0x17')]=qs[_0xbc44('0x17')](_0x2d74e3[_0xbc44('0x2d')][_0xbc44('0x17')]);_0x37a48d[_0xbc44('0x15')]=qs[_0xbc44('0x15')](_0x2d74e3[_0xbc44('0x2d')][_0xbc44('0x15')]);}_0x37a48d['order']=qs['sort'](_0x2d74e3[_0xbc44('0x2d')][_0xbc44('0x37')]);_0x37a48d['where']=qs[_0xbc44('0x2f')](_[_0xbc44('0x38')](_0x2d74e3[_0xbc44('0x2d')],_0x523043['filters']),_0x1d9c19);if(_0x2d74e3[_0xbc44('0x2d')]['filter']){_0x37a48d[_0xbc44('0x39')]=_['merge'](_0x37a48d[_0xbc44('0x39')],{'$or':_[_0xbc44('0x28')](_0x1d9c19,function(_0x2ef959){if(_0x2ef959[_0xbc44('0x2b')]!=='VIRTUAL'){var _0xd38eb8={};_0xd38eb8[_0x2ef959[_0xbc44('0x25')]]={'$like':'%'+_0x2d74e3[_0xbc44('0x2d')][_0xbc44('0x3a')]+'%'};return _0xd38eb8;}})});}_0x37a48d=_[_0xbc44('0x3b')]({},_0x37a48d,_0x2d74e3[_0xbc44('0x3c')]);var _0xe0965f={'where':_0x37a48d[_0xbc44('0x39')]};return db[_0xbc44('0x29')][_0xbc44('0x18')](_0xe0965f)[_0xbc44('0x20')](function(_0x5dc1cd){_0x315b69[_0xbc44('0x18')]=_0x5dc1cd;if(_0x2d74e3[_0xbc44('0x2d')]['includeAll']){_0x37a48d[_0xbc44('0x3d')]=[{'all':!![]}];}return db[_0xbc44('0x29')][_0xbc44('0x3e')](_0x37a48d);})[_0xbc44('0x20')](function(_0x213671){_0x315b69[_0xbc44('0x3f')]=_0x213671;return _0x315b69;})[_0xbc44('0x20')](respondWithFilteredResult(_0x4727d9,_0x37a48d))['catch'](handleError(_0x4727d9,null));};exports[_0xbc44('0x40')]=function(_0xa834ee,_0x16dcf2){var _0x1d28e6={'raw':!![],'where':{'id':_0xa834ee[_0xbc44('0x41')]['id']}},_0x25761b={};_0x25761b[_0xbc44('0x31')]=_[_0xbc44('0x2e')](db['OpenchannelQueueReport'][_0xbc44('0x42')]);_0x25761b['query']=_[_0xbc44('0x2e')](_0xa834ee[_0xbc44('0x2d')]);_0x25761b[_0xbc44('0x2f')]=_[_0xbc44('0x30')](_0x25761b[_0xbc44('0x31')],_0x25761b['query']);_0x1d28e6[_0xbc44('0x32')]=_[_0xbc44('0x30')](_0x25761b[_0xbc44('0x31')],qs[_0xbc44('0x33')](_0xa834ee[_0xbc44('0x2d')][_0xbc44('0x33')]));_0x1d28e6['attributes']=_0x1d28e6['attributes'][_0xbc44('0x34')]?_0x1d28e6[_0xbc44('0x32')]:_0x25761b[_0xbc44('0x31')];if(_0xa834ee[_0xbc44('0x2d')][_0xbc44('0x43')]){_0x1d28e6[_0xbc44('0x3d')]=[{'all':!![]}];}_0x1d28e6=_[_0xbc44('0x3b')]({},_0x1d28e6,_0xa834ee[_0xbc44('0x3c')]);return db[_0xbc44('0x29')][_0xbc44('0x44')](_0x1d28e6)[_0xbc44('0x20')](handleEntityNotFound(_0x16dcf2,null))[_0xbc44('0x20')](respondWithResult(_0x16dcf2,null))[_0xbc44('0x45')](handleError(_0x16dcf2,null));};exports[_0xbc44('0x46')]=function(_0x288fe1,_0x41109b){return db[_0xbc44('0x29')][_0xbc44('0x46')](_0x288fe1['body'],{})[_0xbc44('0x20')](respondWithResult(_0x41109b,0xc9))['catch'](handleError(_0x41109b,null));};exports[_0xbc44('0x1f')]=function(_0x16652f,_0x4b9e6a){if(_0x16652f[_0xbc44('0x47')]['id']){delete _0x16652f[_0xbc44('0x47')]['id'];}return db['OpenchannelQueueReport'][_0xbc44('0x44')]({'where':{'id':_0x16652f[_0xbc44('0x41')]['id']}})[_0xbc44('0x20')](handleEntityNotFound(_0x4b9e6a,null))[_0xbc44('0x20')](saveUpdates(_0x16652f[_0xbc44('0x47')],null))['then'](respondWithResult(_0x4b9e6a,null))[_0xbc44('0x45')](handleError(_0x4b9e6a,null));};exports[_0xbc44('0x21')]=function(_0x2a3824,_0x302abe){return db[_0xbc44('0x29')][_0xbc44('0x44')]({'where':{'id':_0x2a3824[_0xbc44('0x41')]['id']}})[_0xbc44('0x20')](handleEntityNotFound(_0x302abe,null))[_0xbc44('0x20')](removeEntity(_0x302abe,null))[_0xbc44('0x45')](handleError(_0x302abe,null));};exports[_0xbc44('0x48')]=function(_0xfdfef3,_0x598aa2){return db['OpenchannelQueueReport'][_0xbc44('0x48')]()[_0xbc44('0x20')](respondWithResult(_0x598aa2,null))['catch'](handleError(_0x598aa2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 17941fa..1b465eb 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x46aab6,_0x3c618c){var _0x4f1363=function(_0x2052ff){while(--_0x2052ff){_0x46aab6['push'](_0x46aab6['shift']());}};_0x4f1363(++_0x3c618c);}(_0x2ef3,0xba));var _0x32ef=function(_0x3a25da,_0x5d3663){_0x3a25da=_0x3a25da-0x0;var _0x482718=_0x2ef3[_0x3a25da];return _0x482718;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x3f884b,_0x1bb3cd){var _0x3626c7=function(_0x276a65){while(--_0x276a65){_0x3f884b['push'](_0x3f884b['shift']());}};_0x3626c7(++_0x1bb3cd);}(_0x1261,0x144));var _0x1126=function(_0x54e9cd,_0x16ae73){_0x54e9cd=_0x54e9cd-0x0;var _0x343ae7=_0x1261[_0x54e9cd];return _0x343ae7;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('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 83f5767..8804e37 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 _0x1a37=['error','message','catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a8db6,_0x3981fe){var _0x54ad62=function(_0x3ee65c){while(--_0x3ee65c){_0x5a8db6['push'](_0x5a8db6['shift']());}};_0x54ad62(++_0x3981fe);}(_0x1a37,0xb4));var _0x71a3=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x1a37[_0x403c20];return _0x2b271a;};'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});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['OpenchannelQueueReport'][_0x71a3('0x16')](_0x5d4dee[_0x71a3('0x17')],{'raw':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1ab947){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON['stringify'](_0x1ab947));_0x27bfb4(_0x1ab947);})[_0x71a3('0x14')](function(_0x5bbaee){logger[_0x71a3('0x12')](_0x71a3('0x15'),_0x5bbaee[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2[_0x71a3('0x12')](0x1f4,_0x5bbaee[_0x71a3('0x13')]));});});};exports[_0x71a3('0x1a')]=function(_0x5f33c5){var _0x26e6e7=this;return new Promise(function(_0x299d1d,_0xb9c195){return db[_0x71a3('0x1b')][_0x71a3('0x1c')](_0x5f33c5['body'],{'raw':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5['options'][_0x71a3('0x1d')]||null:null,'attributes':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')][_0x71a3('0x1e')]||null:null,'limit':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')][_0x71a3('0x1f')]||null:null})[_0x71a3('0x20')](function(_0x305eb1){logger[_0x71a3('0xc')](_0x71a3('0x1a'),_0x5f33c5);logger[_0x71a3('0xf')]('UpdateOpenchannelQueueReport',_0x5f33c5,JSON[_0x71a3('0x11')](_0x305eb1));_0x299d1d(_0x305eb1);})[_0x71a3('0x14')](function(_0x334db0){logger[_0x71a3('0x12')]('UpdateOpenchannelQueueReport',_0x334db0[_0x71a3('0x13')],_0x5f33c5);_0xb9c195(_0x26e6e7[_0x71a3('0x12')](0x1f4,_0x334db0[_0x71a3('0x13')]));});});}; \ No newline at end of file +var _0x5a13=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1133a7,_0x598146){var _0xb08be1=function(_0x2c6d46){while(--_0x2c6d46){_0x1133a7['push'](_0x1133a7['shift']());}};_0xb08be1(++_0x598146);}(_0x5a13,0x145));var _0x35a1=function(_0x17f54a,_0x3e0c35){_0x17f54a=_0x17f54a-0x0;var _0x3c246e=_0x5a13[_0x17f54a];return _0x3c246e;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});};exports[_0x35a1('0x1d')]=function(_0x2b87a1){var _0x48f1bd=this;return new Promise(function(_0x4c41ce,_0x5303b4){return db[_0x35a1('0x18')]['update'](_0x2b87a1['body'],{'raw':_0x2b87a1['options']?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')]['where']||null:null,'attributes':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1e')]||null:null,'limit':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1f')]||null:null})[_0x35a1('0xd')](function(_0x24bb2d){logger[_0x35a1('0x14')](_0x35a1('0x1d'),_0x2b87a1);logger[_0x35a1('0x20')](_0x35a1('0x1d'),_0x2b87a1,JSON[_0x35a1('0x10')](_0x24bb2d));_0x4c41ce(_0x24bb2d);})[_0x35a1('0x16')](function(_0x2ae0ca){logger['error'](_0x35a1('0x1d'),_0x2ae0ca[_0x35a1('0x12')],_0x2b87a1);_0x5303b4(_0x48f1bd[_0x35a1('0x13')](0x1f4,_0x2ae0ca[_0x35a1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 143f305..2bd302c 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 _0x65ee=['get','/describe','/:id','show','post','create','update','delete','multer','path','connect-timeout','express','fs-extra','../../config/environment','./openchannelTransferReport.controller','isAuthenticated'];(function(_0xd89c4,_0x93a17a){var _0x188f61=function(_0xf21002){while(--_0xf21002){_0xd89c4['push'](_0xd89c4['shift']());}};_0x188f61(++_0x93a17a);}(_0x65ee,0x1d8));var _0xe65e=function(_0x57c188,_0x1e8bec){_0x57c188=_0x57c188-0x0;var _0x1045fe=_0x65ee[_0x57c188];return _0x1045fe;};'use strict';var multer=require(_0xe65e('0x0'));var util=require('util');var path=require(_0xe65e('0x1'));var timeout=require(_0xe65e('0x2'));var express=require(_0xe65e('0x3'));var router=express['Router']();var fs_extra=require(_0xe65e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe65e('0x5'));var controller=require(_0xe65e('0x6'));router['get']('/',auth[_0xe65e('0x7')](),controller['index']);router[_0xe65e('0x8')](_0xe65e('0x9'),auth[_0xe65e('0x7')](),controller['describe']);router[_0xe65e('0x8')](_0xe65e('0xa'),auth[_0xe65e('0x7')](),controller[_0xe65e('0xb')]);router[_0xe65e('0xc')]('/',auth[_0xe65e('0x7')](),controller[_0xe65e('0xd')]);router['put'](_0xe65e('0xa'),auth[_0xe65e('0x7')](),controller[_0xe65e('0xe')]);router[_0xe65e('0xf')](_0xe65e('0xa'),auth[_0xe65e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9fa5=['delete','destroy','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x13a085,_0x4c4880){var _0x3e3f5e=function(_0x236b06){while(--_0x236b06){_0x13a085['push'](_0x13a085['shift']());}};_0x3e3f5e(++_0x4c4880);}(_0x9fa5,0x93));var _0x59fa=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9fa5[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x59fa('0x0'));var timeout=require(_0x59fa('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x59fa('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x59fa('0x3'));var config=require(_0x59fa('0x4'));var controller=require('./openchannelTransferReport.controller');router[_0x59fa('0x5')]('/',auth[_0x59fa('0x6')](),controller['index']);router[_0x59fa('0x5')]('/describe',auth[_0x59fa('0x6')](),controller[_0x59fa('0x7')]);router[_0x59fa('0x5')](_0x59fa('0x8'),auth['isAuthenticated'](),controller[_0x59fa('0x9')]);router[_0x59fa('0xa')]('/',auth[_0x59fa('0x6')](),controller[_0x59fa('0xb')]);router[_0x59fa('0xc')](_0x59fa('0x8'),auth[_0x59fa('0x6')](),controller['update']);router[_0x59fa('0xd')](_0x59fa('0x8'),auth[_0x59fa('0x6')](),controller[_0x59fa('0xe')]);module[_0x59fa('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 8e3b030..cea5159 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x179db5,_0x44ef9e){var _0x3368a6=function(_0x45ce47){while(--_0x45ce47){_0x179db5['push'](_0x179db5['shift']());}};_0x3368a6(++_0x44ef9e);}(_0xe706,0xa3));var _0x6e70=function(_0x595e7b,_0x32000d){_0x595e7b=_0x595e7b-0x0;var _0x330302=_0xe706[_0x595e7b];return _0x330302;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x356085,_0x5ed3ae){var _0x5acb73=function(_0x35b6bc){while(--_0x35b6bc){_0x356085['push'](_0x356085['shift']());}};_0x5acb73(++_0x5ed3ae);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5831d9,_0x4da171){_0x5831d9=_0x5831d9-0x0;var _0x439f6c=_0xf4eb[_0x5831d9];return _0x439f6c;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 064f81f..760e1c1 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 _0xb597=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','findAll','rows','catch','length','include','options','find','create'];(function(_0x330198,_0x214712){var _0x55479b=function(_0x3a1529){while(--_0x3a1529){_0x330198['push'](_0x330198['shift']());}};_0x55479b(++_0x214712);}(_0xb597,0x1a7));var _0x7b59=function(_0x2471b1,_0x125b9b){_0x2471b1=_0x2471b1-0x0;var _0x238477=_0xb597[_0x2471b1];return _0x238477;};'use strict';var emlformat=require(_0x7b59('0x0'));var rimraf=require(_0x7b59('0x1'));var zipdir=require(_0x7b59('0x2'));var jsonpatch=require(_0x7b59('0x3'));var rp=require(_0x7b59('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b59('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7b59('0x6'));var csv=require(_0x7b59('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7b59('0x8'));var crypto=require(_0x7b59('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7b59('0xa'));var toCsv=require(_0x7b59('0x7'));var querystring=require('querystring');var Papa=require(_0x7b59('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b59('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b59('0xd'));var logger=require(_0x7b59('0xe'))(_0x7b59('0xf'));var utils=require(_0x7b59('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x7b59('0x11'));var db=require(_0x7b59('0x12'))['db'];function respondWithStatusCode(_0x5e9c87,_0x579499){_0x579499=_0x579499||0xcc;return function(_0x59bb5f){if(_0x59bb5f){return _0x5e9c87['sendStatus'](_0x579499);}return _0x5e9c87['status'](_0x579499)[_0x7b59('0x13')]();};}function respondWithResult(_0x3c3931,_0x2b8106){_0x2b8106=_0x2b8106||0xc8;return function(_0xafde55){if(_0xafde55){return _0x3c3931[_0x7b59('0x14')](_0x2b8106)[_0x7b59('0x15')](_0xafde55);}};}function respondWithFilteredResult(_0x4b7fb9,_0xd2300e){return function(_0x1d7ef5){if(_0x1d7ef5){var _0x401871=typeof _0xd2300e[_0x7b59('0x16')]===_0x7b59('0x17')&&typeof _0xd2300e[_0x7b59('0x18')]==='undefined';var _0x49bc28=_0x1d7ef5[_0x7b59('0x19')];var _0x9a993f=_0x401871?0x0:_0xd2300e[_0x7b59('0x16')];var _0x172847=_0x401871?_0x1d7ef5[_0x7b59('0x19')]:_0xd2300e[_0x7b59('0x16')]+_0xd2300e[_0x7b59('0x18')];var _0x386878;if(_0x172847>=_0x49bc28){_0x172847=_0x49bc28;_0x386878=0xc8;}else{_0x386878=0xce;}_0x4b7fb9[_0x7b59('0x14')](_0x386878);return _0x4b7fb9[_0x7b59('0x1a')](_0x7b59('0x1b'),_0x9a993f+'-'+_0x172847+'/'+_0x49bc28)[_0x7b59('0x15')](_0x1d7ef5);}return null;};}function patchUpdates(_0x172044){return function(_0x16fd36){try{jsonpatch[_0x7b59('0x1c')](_0x16fd36,_0x172044,!![]);}catch(_0x2a50fc){return BPromise[_0x7b59('0x1d')](_0x2a50fc);}return _0x16fd36['save']();};}function saveUpdates(_0x5821ea,_0x2a2404){return function(_0x2d97d0){if(_0x2d97d0){return _0x2d97d0[_0x7b59('0x1e')](_0x5821ea)['then'](function(_0x1d4f8e){return _0x1d4f8e;});}return null;};}function removeEntity(_0x5371bc,_0x58a950){return function(_0xfed190){if(_0xfed190){return _0xfed190[_0x7b59('0x1f')]()[_0x7b59('0x20')](function(){_0x5371bc[_0x7b59('0x14')](0xcc)[_0x7b59('0x13')]();});}};}function handleEntityNotFound(_0x4a5f77,_0x3fa42d){return function(_0x356619){if(!_0x356619){_0x4a5f77[_0x7b59('0x21')](0x194);}return _0x356619;};}function handleError(_0x290c5b,_0xf7f575){_0xf7f575=_0xf7f575||0x1f4;return function(_0x199526){logger[_0x7b59('0x22')](_0x199526['stack']);if(_0x199526[_0x7b59('0x23')]){delete _0x199526[_0x7b59('0x23')];}_0x290c5b[_0x7b59('0x14')](_0xf7f575)[_0x7b59('0x24')](_0x199526);};}exports[_0x7b59('0x25')]=function(_0x527c24,_0x194d0f){var _0x2d968c={},_0x5cb5ef={},_0x4113f1={'count':0x0,'rows':[]};var _0x39ed42=_['map'](db[_0x7b59('0x26')][_0x7b59('0x27')],function(_0x4d6b34){return{'name':_0x4d6b34[_0x7b59('0x28')],'type':_0x4d6b34[_0x7b59('0x29')][_0x7b59('0x2a')]};});_0x5cb5ef[_0x7b59('0x2b')]=_[_0x7b59('0x2c')](_0x39ed42,_0x7b59('0x23'));_0x5cb5ef['query']=_[_0x7b59('0x2d')](_0x527c24[_0x7b59('0x2e')]);_0x5cb5ef[_0x7b59('0x2f')]=_[_0x7b59('0x30')](_0x5cb5ef[_0x7b59('0x2b')],_0x5cb5ef[_0x7b59('0x2e')]);_0x2d968c[_0x7b59('0x31')]=_[_0x7b59('0x30')](_0x5cb5ef['model'],qs[_0x7b59('0x32')](_0x527c24[_0x7b59('0x2e')][_0x7b59('0x32')]));_0x2d968c[_0x7b59('0x31')]=_0x2d968c['attributes']['length']?_0x2d968c[_0x7b59('0x31')]:_0x5cb5ef['model'];if(!_0x527c24[_0x7b59('0x2e')][_0x7b59('0x33')](_0x7b59('0x34'))){_0x2d968c['limit']=qs[_0x7b59('0x18')](_0x527c24[_0x7b59('0x2e')][_0x7b59('0x18')]);_0x2d968c[_0x7b59('0x16')]=qs['offset'](_0x527c24[_0x7b59('0x2e')][_0x7b59('0x16')]);}_0x2d968c[_0x7b59('0x35')]=qs[_0x7b59('0x36')](_0x527c24['query'][_0x7b59('0x36')]);_0x2d968c[_0x7b59('0x37')]=qs['filters'](_[_0x7b59('0x38')](_0x527c24[_0x7b59('0x2e')],_0x5cb5ef[_0x7b59('0x2f')]),_0x39ed42);if(_0x527c24[_0x7b59('0x2e')]['filter']){_0x2d968c[_0x7b59('0x37')]=_['merge'](_0x2d968c[_0x7b59('0x37')],{'$or':_[_0x7b59('0x2c')](_0x39ed42,function(_0x356444){if(_0x356444[_0x7b59('0x29')]!=='VIRTUAL'){var _0x398cb9={};_0x398cb9[_0x356444[_0x7b59('0x23')]]={'$like':'%'+_0x527c24[_0x7b59('0x2e')][_0x7b59('0x39')]+'%'};return _0x398cb9;}})});}_0x2d968c=_['merge']({},_0x2d968c,_0x527c24['options']);var _0x392a4e={'where':_0x2d968c[_0x7b59('0x37')]};return db[_0x7b59('0x26')][_0x7b59('0x19')](_0x392a4e)[_0x7b59('0x20')](function(_0x1736d7){_0x4113f1[_0x7b59('0x19')]=_0x1736d7;if(_0x527c24[_0x7b59('0x2e')][_0x7b59('0x3a')]){_0x2d968c['include']=[{'all':!![]}];}return db[_0x7b59('0x26')][_0x7b59('0x3b')](_0x2d968c);})[_0x7b59('0x20')](function(_0x320f4d){_0x4113f1[_0x7b59('0x3c')]=_0x320f4d;return _0x4113f1;})['then'](respondWithFilteredResult(_0x194d0f,_0x2d968c))[_0x7b59('0x3d')](handleError(_0x194d0f,null));};exports['show']=function(_0xf32ba5,_0x3b5b7b){var _0x43b94b={'raw':!![],'where':{'id':_0xf32ba5['params']['id']}},_0x3973da={};_0x3973da[_0x7b59('0x2b')]=_[_0x7b59('0x2d')](db[_0x7b59('0x26')][_0x7b59('0x27')]);_0x3973da[_0x7b59('0x2e')]=_[_0x7b59('0x2d')](_0xf32ba5['query']);_0x3973da[_0x7b59('0x2f')]=_[_0x7b59('0x30')](_0x3973da['model'],_0x3973da[_0x7b59('0x2e')]);_0x43b94b[_0x7b59('0x31')]=_[_0x7b59('0x30')](_0x3973da[_0x7b59('0x2b')],qs[_0x7b59('0x32')](_0xf32ba5[_0x7b59('0x2e')]['fields']));_0x43b94b['attributes']=_0x43b94b[_0x7b59('0x31')][_0x7b59('0x3e')]?_0x43b94b['attributes']:_0x3973da[_0x7b59('0x2b')];if(_0xf32ba5[_0x7b59('0x2e')][_0x7b59('0x3a')]){_0x43b94b[_0x7b59('0x3f')]=[{'all':!![]}];}_0x43b94b=_['merge']({},_0x43b94b,_0xf32ba5[_0x7b59('0x40')]);return db[_0x7b59('0x26')][_0x7b59('0x41')](_0x43b94b)[_0x7b59('0x20')](handleEntityNotFound(_0x3b5b7b,null))[_0x7b59('0x20')](respondWithResult(_0x3b5b7b,null))['catch'](handleError(_0x3b5b7b,null));};exports['create']=function(_0x57ea22,_0xef45e2){return db[_0x7b59('0x26')][_0x7b59('0x42')](_0x57ea22[_0x7b59('0x43')],{})['then'](respondWithResult(_0xef45e2,0xc9))[_0x7b59('0x3d')](handleError(_0xef45e2,null));};exports['update']=function(_0xaf32df,_0x37e0a9){if(_0xaf32df[_0x7b59('0x43')]['id']){delete _0xaf32df[_0x7b59('0x43')]['id'];}return db[_0x7b59('0x26')][_0x7b59('0x41')]({'where':{'id':_0xaf32df[_0x7b59('0x44')]['id']}})[_0x7b59('0x20')](handleEntityNotFound(_0x37e0a9,null))['then'](saveUpdates(_0xaf32df[_0x7b59('0x43')],null))[_0x7b59('0x20')](respondWithResult(_0x37e0a9,null))[_0x7b59('0x3d')](handleError(_0x37e0a9,null));};exports[_0x7b59('0x1f')]=function(_0x10820b,_0x8e9935){return db[_0x7b59('0x26')]['find']({'where':{'id':_0x10820b[_0x7b59('0x44')]['id']}})[_0x7b59('0x20')](handleEntityNotFound(_0x8e9935,null))[_0x7b59('0x20')](removeEntity(_0x8e9935,null))[_0x7b59('0x3d')](handleError(_0x8e9935,null));};exports[_0x7b59('0x45')]=function(_0x2ff665,_0x524fd0){return db[_0x7b59('0x26')][_0x7b59('0x45')]()[_0x7b59('0x20')](respondWithResult(_0x524fd0,null))[_0x7b59('0x3d')](handleError(_0x524fd0,null));}; \ No newline at end of file +var _0x71ff=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','OpenchannelTransferReport','includeAll','include','rows','catch','show','params','keys','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5cb795,_0x449049){var _0x441f78=function(_0xdb02cf){while(--_0xdb02cf){_0x5cb795['push'](_0x5cb795['shift']());}};_0x441f78(++_0x449049);}(_0x71ff,0x155));var _0xf71f=function(_0x173088,_0x535a44){_0x173088=_0x173088-0x0;var _0x51df29=_0x71ff[_0x173088];return _0x51df29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf71f('0x0'));var zipdir=require(_0xf71f('0x1'));var jsonpatch=require(_0xf71f('0x2'));var rp=require(_0xf71f('0x3'));var moment=require(_0xf71f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf71f('0x5'));var sox=require('sox');var csv=require(_0xf71f('0x6'));var ejs=require(_0xf71f('0x7'));var fs=require('fs');var fs_extra=require(_0xf71f('0x8'));var _=require(_0xf71f('0x9'));var squel=require(_0xf71f('0xa'));var crypto=require(_0xf71f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf71f('0xc'));var toCsv=require(_0xf71f('0x6'));var querystring=require(_0xf71f('0xd'));var Papa=require('papaparse');var Redis=require(_0xf71f('0xe'));var authService=require(_0xf71f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf71f('0x10'));var hardwareService=require(_0xf71f('0x11'));var logger=require(_0xf71f('0x12'))(_0xf71f('0x13'));var utils=require(_0xf71f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf71f('0x15'));var db=require(_0xf71f('0x16'))['db'];function respondWithStatusCode(_0x586ea7,_0x1ea1fe){_0x1ea1fe=_0x1ea1fe||0xcc;return function(_0x5c29d7){if(_0x5c29d7){return _0x586ea7[_0xf71f('0x17')](_0x1ea1fe);}return _0x586ea7[_0xf71f('0x18')](_0x1ea1fe)[_0xf71f('0x19')]();};}function respondWithResult(_0x1859f2,_0x2c7905){_0x2c7905=_0x2c7905||0xc8;return function(_0x1566ed){if(_0x1566ed){return _0x1859f2['status'](_0x2c7905)[_0xf71f('0x1a')](_0x1566ed);}};}function respondWithFilteredResult(_0x21745b,_0x2946a8){return function(_0x1b1b9f){if(_0x1b1b9f){var _0x34c4b0=typeof _0x2946a8['offset']==='undefined'&&typeof _0x2946a8[_0xf71f('0x1b')]==='undefined';var _0x8af9fd=_0x1b1b9f[_0xf71f('0x1c')];var _0x4dd534=_0x34c4b0?0x0:_0x2946a8['offset'];var _0x3f015d=_0x34c4b0?_0x1b1b9f['count']:_0x2946a8[_0xf71f('0x1d')]+_0x2946a8['limit'];var _0x1cacc3;if(_0x3f015d>=_0x8af9fd){_0x3f015d=_0x8af9fd;_0x1cacc3=0xc8;}else{_0x1cacc3=0xce;}_0x21745b[_0xf71f('0x18')](_0x1cacc3);return _0x21745b[_0xf71f('0x1e')](_0xf71f('0x1f'),_0x4dd534+'-'+_0x3f015d+'/'+_0x8af9fd)[_0xf71f('0x1a')](_0x1b1b9f);}return null;};}function patchUpdates(_0xcc602){return function(_0x94fa97){try{jsonpatch[_0xf71f('0x20')](_0x94fa97,_0xcc602,!![]);}catch(_0x283208){return BPromise[_0xf71f('0x21')](_0x283208);}return _0x94fa97[_0xf71f('0x22')]();};}function saveUpdates(_0x78daec,_0x1abbdf){return function(_0x1cd3b3){if(_0x1cd3b3){return _0x1cd3b3[_0xf71f('0x23')](_0x78daec)[_0xf71f('0x24')](function(_0x5c237d){return _0x5c237d;});}return null;};}function removeEntity(_0x25ff3b,_0x338398){return function(_0x28cf4f){if(_0x28cf4f){return _0x28cf4f[_0xf71f('0x25')]()['then'](function(){_0x25ff3b[_0xf71f('0x18')](0xcc)[_0xf71f('0x19')]();});}};}function handleEntityNotFound(_0x4d8ed1,_0x1dec38){return function(_0x13f1ac){if(!_0x13f1ac){_0x4d8ed1[_0xf71f('0x17')](0x194);}return _0x13f1ac;};}function handleError(_0x3dca38,_0x4736da){_0x4736da=_0x4736da||0x1f4;return function(_0x5bc491){logger[_0xf71f('0x26')](_0x5bc491['stack']);if(_0x5bc491['name']){delete _0x5bc491[_0xf71f('0x27')];}_0x3dca38[_0xf71f('0x18')](_0x4736da)[_0xf71f('0x28')](_0x5bc491);};}exports[_0xf71f('0x29')]=function(_0x9cba43,_0x120720){var _0x2f5e73={},_0x28e8ee={},_0x2163e1={'count':0x0,'rows':[]};var _0x9357bb=_[_0xf71f('0x2a')](db['OpenchannelTransferReport'][_0xf71f('0x2b')],function(_0x28b3af){return{'name':_0x28b3af[_0xf71f('0x2c')],'type':_0x28b3af['type'][_0xf71f('0x2d')]};});_0x28e8ee[_0xf71f('0x2e')]=_[_0xf71f('0x2a')](_0x9357bb,_0xf71f('0x27'));_0x28e8ee[_0xf71f('0x2f')]=_['keys'](_0x9cba43[_0xf71f('0x2f')]);_0x28e8ee[_0xf71f('0x30')]=_[_0xf71f('0x31')](_0x28e8ee['model'],_0x28e8ee[_0xf71f('0x2f')]);_0x2f5e73[_0xf71f('0x32')]=_[_0xf71f('0x31')](_0x28e8ee[_0xf71f('0x2e')],qs[_0xf71f('0x33')](_0x9cba43[_0xf71f('0x2f')]['fields']));_0x2f5e73[_0xf71f('0x32')]=_0x2f5e73[_0xf71f('0x32')][_0xf71f('0x34')]?_0x2f5e73[_0xf71f('0x32')]:_0x28e8ee['model'];if(!_0x9cba43['query'][_0xf71f('0x35')]('nolimit')){_0x2f5e73[_0xf71f('0x1b')]=qs['limit'](_0x9cba43[_0xf71f('0x2f')][_0xf71f('0x1b')]);_0x2f5e73[_0xf71f('0x1d')]=qs['offset'](_0x9cba43['query'][_0xf71f('0x1d')]);}_0x2f5e73[_0xf71f('0x36')]=qs['sort'](_0x9cba43[_0xf71f('0x2f')]['sort']);_0x2f5e73[_0xf71f('0x37')]=qs['filters'](_[_0xf71f('0x38')](_0x9cba43[_0xf71f('0x2f')],_0x28e8ee[_0xf71f('0x30')]),_0x9357bb);if(_0x9cba43[_0xf71f('0x2f')][_0xf71f('0x39')]){_0x2f5e73[_0xf71f('0x37')]=_[_0xf71f('0x3a')](_0x2f5e73[_0xf71f('0x37')],{'$or':_[_0xf71f('0x2a')](_0x9357bb,function(_0x1a779a){if(_0x1a779a[_0xf71f('0x3b')]!=='VIRTUAL'){var _0x4f3484={};_0x4f3484[_0x1a779a['name']]={'$like':'%'+_0x9cba43[_0xf71f('0x2f')][_0xf71f('0x39')]+'%'};return _0x4f3484;}})});}_0x2f5e73=_[_0xf71f('0x3a')]({},_0x2f5e73,_0x9cba43['options']);var _0x3031d9={'where':_0x2f5e73[_0xf71f('0x37')]};return db[_0xf71f('0x3c')][_0xf71f('0x1c')](_0x3031d9)['then'](function(_0x3bdc24){_0x2163e1[_0xf71f('0x1c')]=_0x3bdc24;if(_0x9cba43[_0xf71f('0x2f')][_0xf71f('0x3d')]){_0x2f5e73[_0xf71f('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x2f5e73);})[_0xf71f('0x24')](function(_0x4ee2c5){_0x2163e1[_0xf71f('0x3f')]=_0x4ee2c5;return _0x2163e1;})[_0xf71f('0x24')](respondWithFilteredResult(_0x120720,_0x2f5e73))[_0xf71f('0x40')](handleError(_0x120720,null));};exports[_0xf71f('0x41')]=function(_0x3f03cc,_0xefd19f){var _0x3a6c1b={'raw':!![],'where':{'id':_0x3f03cc[_0xf71f('0x42')]['id']}},_0x21dfec={};_0x21dfec[_0xf71f('0x2e')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x21dfec[_0xf71f('0x2f')]=_[_0xf71f('0x43')](_0x3f03cc[_0xf71f('0x2f')]);_0x21dfec[_0xf71f('0x30')]=_[_0xf71f('0x31')](_0x21dfec[_0xf71f('0x2e')],_0x21dfec[_0xf71f('0x2f')]);_0x3a6c1b[_0xf71f('0x32')]=_[_0xf71f('0x31')](_0x21dfec['model'],qs[_0xf71f('0x33')](_0x3f03cc[_0xf71f('0x2f')][_0xf71f('0x33')]));_0x3a6c1b['attributes']=_0x3a6c1b['attributes']['length']?_0x3a6c1b[_0xf71f('0x32')]:_0x21dfec['model'];if(_0x3f03cc[_0xf71f('0x2f')]['includeAll']){_0x3a6c1b['include']=[{'all':!![]}];}_0x3a6c1b=_[_0xf71f('0x3a')]({},_0x3a6c1b,_0x3f03cc[_0xf71f('0x44')]);return db[_0xf71f('0x3c')]['find'](_0x3a6c1b)[_0xf71f('0x24')](handleEntityNotFound(_0xefd19f,null))[_0xf71f('0x24')](respondWithResult(_0xefd19f,null))[_0xf71f('0x40')](handleError(_0xefd19f,null));};exports[_0xf71f('0x45')]=function(_0x48aa77,_0x10f7bb){return db[_0xf71f('0x3c')][_0xf71f('0x45')](_0x48aa77[_0xf71f('0x46')],{})[_0xf71f('0x24')](respondWithResult(_0x10f7bb,0xc9))['catch'](handleError(_0x10f7bb,null));};exports[_0xf71f('0x23')]=function(_0x3a59f3,_0x2015aa){if(_0x3a59f3[_0xf71f('0x46')]['id']){delete _0x3a59f3[_0xf71f('0x46')]['id'];}return db[_0xf71f('0x3c')][_0xf71f('0x47')]({'where':{'id':_0x3a59f3[_0xf71f('0x42')]['id']}})[_0xf71f('0x24')](handleEntityNotFound(_0x2015aa,null))['then'](saveUpdates(_0x3a59f3[_0xf71f('0x46')],null))['then'](respondWithResult(_0x2015aa,null))['catch'](handleError(_0x2015aa,null));};exports[_0xf71f('0x25')]=function(_0x413422,_0x451978){return db[_0xf71f('0x3c')]['find']({'where':{'id':_0x413422['params']['id']}})[_0xf71f('0x24')](handleEntityNotFound(_0x451978,null))[_0xf71f('0x24')](removeEntity(_0x451978,null))[_0xf71f('0x40')](handleError(_0x451978,null));};exports['describe']=function(_0x14dca1,_0x59dbe3){return db['OpenchannelTransferReport'][_0xf71f('0x48')]()[_0xf71f('0x24')](respondWithResult(_0x59dbe3,null))[_0xf71f('0x40')](handleError(_0x59dbe3,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4646c26..535603b 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 _0x7e48=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e48,0x6b));var _0x87e4=function(_0x5c1c4e,_0x28722a){_0x5c1c4e=_0x5c1c4e-0x0;var _0x31787c=_0x7e48[_0x5c1c4e];return _0x31787c;};'use strict';var _=require(_0x87e4('0x0'));var util=require(_0x87e4('0x1'));var logger=require(_0x87e4('0x2'))(_0x87e4('0x3'));var moment=require(_0x87e4('0x4'));var BPromise=require(_0x87e4('0x5'));var rp=require(_0x87e4('0x6'));var fs=require('fs');var path=require(_0x87e4('0x7'));var rimraf=require(_0x87e4('0x8'));var config=require(_0x87e4('0x9'));var attributes=require(_0x87e4('0xa'));module['exports']=function(_0x5a5457,_0x4bbed2){return _0x5a5457[_0x87e4('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0x87e4('0xc'),'paranoid':![],'indexes':[{'name':_0x87e4('0xd'),'fields':[_0x87e4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf8=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x3243f5,_0x163290){var _0x2187fb=function(_0x3022e6){while(--_0x3022e6){_0x3243f5['push'](_0x3243f5['shift']());}};_0x2187fb(++_0x163290);}(_0xbaf8,0x1b1));var _0x8baf=function(_0x10c2d3,_0x2f5914){_0x10c2d3=_0x10c2d3-0x0;var _0x5a0b13=_0xbaf8[_0x10c2d3];return _0x5a0b13;};'use strict';var _=require('lodash');var util=require(_0x8baf('0x0'));var logger=require(_0x8baf('0x1'))(_0x8baf('0x2'));var moment=require(_0x8baf('0x3'));var BPromise=require(_0x8baf('0x4'));var rp=require(_0x8baf('0x5'));var fs=require('fs');var path=require(_0x8baf('0x6'));var rimraf=require('rimraf');var config=require(_0x8baf('0x7'));var attributes=require(_0x8baf('0x8'));module['exports']=function(_0x525202,_0x20da25){return _0x525202['define'](_0x8baf('0x9'),attributes,{'tableName':_0x8baf('0xa'),'paranoid':![],'indexes':[{'name':_0x8baf('0xb'),'fields':[_0x8baf('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 d102df5..d824723 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 _0xc43c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x27d3f3,_0x485cb8){var _0x884f1f=function(_0x2e62cc){while(--_0x2e62cc){_0x27d3f3['push'](_0x27d3f3['shift']());}};_0x884f1f(++_0x485cb8);}(_0xc43c,0x152));var _0xcc43=function(_0x37c5c8,_0x512395){_0x37c5c8=_0x37c5c8-0x0;var _0x222eee=_0xc43c[_0x37c5c8];return _0x222eee;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require(_0xcc43('0x3'));var rs=require(_0xcc43('0x4'));var fs=require('fs');var Redis=require(_0xcc43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc43('0x6'));var logger=require(_0xcc43('0x7'))('rpc');var config=require(_0xcc43('0x8'));var jayson=require(_0xcc43('0x9'));var client=jayson[_0xcc43('0xa')][_0xcc43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9140b6,_0x13c316,_0x298aa7){return new BPromise(function(_0x3b8857,_0x1913c6){return client[_0xcc43('0xc')](_0x9140b6,_0x298aa7)['then'](function(_0x3f017e){logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));logger[_0xcc43('0x10')](_0xcc43('0x11'),_0x13c316,'request\x20sent',JSON[_0xcc43('0x12')](_0x3f017e));if(_0x3f017e[_0xcc43('0x13')]){if(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x14')]===0x1f4){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x1913c6(_0x3f017e['error'][_0xcc43('0x15')]);}logger[_0xcc43('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x3b8857(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x15')]);}else{logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));_0x3b8857(_0x3f017e['result']['message']);}})[_0xcc43('0x16')](function(_0x9b6dc){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x9b6dc);_0x1913c6(_0x9b6dc);});});} \ No newline at end of file +var _0x78d3=['../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3829a1,_0x2cea90){var _0xc1bda8=function(_0x45cba6){while(--_0x45cba6){_0x3829a1['push'](_0x3829a1['shift']());}};_0xc1bda8(++_0x2cea90);}(_0x78d3,0x73));var _0x378d=function(_0x450049,_0x103e25){_0x450049=_0x450049-0x0;var _0x4744fa=_0x78d3[_0x450049];return _0x4744fa;};'use strict';var _=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var moment=require(_0x378d('0x2'));var BPromise=require(_0x378d('0x3'));var rs=require(_0x378d('0x4'));var fs=require('fs');var Redis=require(_0x378d('0x5'));var db=require(_0x378d('0x6'))['db'];var utils=require(_0x378d('0x7'));var logger=require(_0x378d('0x8'))(_0x378d('0x9'));var config=require(_0x378d('0xa'));var jayson=require(_0x378d('0xb'));var client=jayson[_0x378d('0xc')][_0x378d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x47a99f,_0x4fef30,_0x1c880e){return new BPromise(function(_0x4b3ef5,_0x14112d){return client[_0x378d('0xe')](_0x47a99f,_0x1c880e)[_0x378d('0xf')](function(_0x4698d9){logger[_0x378d('0x10')](_0x378d('0x11'),_0x4fef30,'request\x20sent');logger[_0x378d('0x12')](_0x378d('0x13'),_0x4fef30,_0x378d('0x14'),JSON['stringify'](_0x4698d9));if(_0x4698d9[_0x378d('0x15')]){if(_0x4698d9['error']['code']===0x1f4){logger[_0x378d('0x15')](_0x378d('0x11'),_0x4fef30,_0x4698d9['error'][_0x378d('0x16')]);return _0x14112d(_0x4698d9[_0x378d('0x15')][_0x378d('0x16')]);}logger['error'](_0x378d('0x11'),_0x4fef30,_0x4698d9['error'][_0x378d('0x16')]);return _0x4b3ef5(_0x4698d9[_0x378d('0x15')][_0x378d('0x16')]);}else{logger[_0x378d('0x10')](_0x378d('0x11'),_0x4fef30,'request\x20sent');_0x4b3ef5(_0x4698d9[_0x378d('0x17')]['message']);}})[_0x378d('0x18')](function(_0x1602f9){logger[_0x378d('0x15')](_0x378d('0x11'),_0x4fef30,_0x1602f9);_0x14112d(_0x1602f9);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 88cc988..0d4e5a8 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 _0x08e8=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x1ffdb9,_0x49f22e){var _0x1a3a49=function(_0x5ca226){while(--_0x5ca226){_0x1ffdb9['push'](_0x1ffdb9['shift']());}};_0x1a3a49(++_0x49f22e);}(_0x08e8,0xc9));var _0x808e=function(_0x350aec,_0xa01635){_0x350aec=_0x350aec-0x0;var _0x35de30=_0x08e8[_0x350aec];return _0x35de30;};'use strict';var multer=require('multer');var util=require(_0x808e('0x0'));var path=require('path');var timeout=require(_0x808e('0x1'));var express=require(_0x808e('0x2'));var router=express[_0x808e('0x3')]();var fs_extra=require(_0x808e('0x4'));var auth=require(_0x808e('0x5'));var interaction=require(_0x808e('0x6'));var config=require(_0x808e('0x7'));var controller=require(_0x808e('0x8'));router[_0x808e('0x9')]('/',auth[_0x808e('0xa')](),controller['index']);router['get'](_0x808e('0xb'),auth['isAuthenticated'](),controller[_0x808e('0xc')]);router[_0x808e('0xd')]('/',auth[_0x808e('0xa')](),controller[_0x808e('0xe')]);router['put']('/:id',auth[_0x808e('0xa')](),controller[_0x808e('0xf')]);router['delete'](_0x808e('0xb'),auth[_0x808e('0xa')](),controller[_0x808e('0x10')]);module[_0x808e('0x11')]=router; \ No newline at end of file +var _0x60b4=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','put','update','delete'];(function(_0x313b92,_0x2faef7){var _0x23e17a=function(_0x2ac590){while(--_0x2ac590){_0x313b92['push'](_0x313b92['shift']());}};_0x23e17a(++_0x2faef7);}(_0x60b4,0xb5));var _0x460b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60b4[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x460b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x460b('0x1'));var express=require(_0x460b('0x2'));var router=express[_0x460b('0x3')]();var fs_extra=require(_0x460b('0x4'));var auth=require(_0x460b('0x5'));var interaction=require(_0x460b('0x6'));var config=require(_0x460b('0x7'));var controller=require(_0x460b('0x8'));router['get']('/',auth[_0x460b('0x9')](),controller[_0x460b('0xa')]);router[_0x460b('0xb')](_0x460b('0xc'),auth['isAuthenticated'](),controller[_0x460b('0xd')]);router['post']('/',auth[_0x460b('0x9')](),controller['create']);router[_0x460b('0xe')](_0x460b('0xc'),auth[_0x460b('0x9')](),controller[_0x460b('0xf')]);router[_0x460b('0x10')](_0x460b('0xc'),auth['isAuthenticated'](),controller[_0x460b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f65bdc1..9cb3911 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 _0x87d8=['STRING','name','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x87d8,0x1c7));var _0x887d=function(_0x36a974,_0x381b74){_0x36a974=_0x36a974-0x0;var _0x2d0781=_0x87d8[_0x36a974];return _0x2d0781;};'use strict';var Sequelize=require('sequelize');module[_0x887d('0x0')]={'name':{'type':Sequelize[_0x887d('0x1')],'unique':_0x887d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x887d('0x1')]}}; \ No newline at end of file +var _0xf69c=['exports','name','STRING'];(function(_0x3c10d9,_0x219f97){var _0x244991=function(_0x479473){while(--_0x479473){_0x3c10d9['push'](_0x3c10d9['shift']());}};_0x244991(++_0x219f97);}(_0xf69c,0x126));var _0xcf69=function(_0x2c2781,_0x5f1153){_0x2c2781=_0x2c2781-0x0;var _0x3fe469=_0xf69c[_0x2c2781];return _0x3fe469;};'use strict';var Sequelize=require('sequelize');module[_0xcf69('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xcf69('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xcf69('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d59e108..8aa4116 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 _0x82d9=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','Pauses','UserProfileResource','stack','name','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x4dafab,_0x57b390){var _0x36e1b8=function(_0x1e349f){while(--_0x1e349f){_0x4dafab['push'](_0x4dafab['shift']());}};_0x36e1b8(++_0x57b390);}(_0x82d9,0xe0));var _0x982d=function(_0x1d4915,_0x3a2368){_0x1d4915=_0x1d4915-0x0;var _0x22cad4=_0x82d9[_0x1d4915];return _0x22cad4;};'use strict';var emlformat=require(_0x982d('0x0'));var rimraf=require(_0x982d('0x1'));var zipdir=require(_0x982d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x982d('0x3'));var moment=require(_0x982d('0x4'));var BPromise=require(_0x982d('0x5'));var Mustache=require(_0x982d('0x6'));var util=require(_0x982d('0x7'));var path=require(_0x982d('0x8'));var sox=require(_0x982d('0x9'));var csv=require(_0x982d('0xa'));var ejs=require(_0x982d('0xb'));var fs=require('fs');var fs_extra=require(_0x982d('0xc'));var _=require(_0x982d('0xd'));var squel=require(_0x982d('0xe'));var crypto=require(_0x982d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x982d('0x10'));var toCsv=require(_0x982d('0xa'));var querystring=require(_0x982d('0x11'));var Papa=require(_0x982d('0x12'));var Redis=require(_0x982d('0x13'));var authService=require(_0x982d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x982d('0x15'));var hardwareService=require(_0x982d('0x16'));var logger=require('../../config/logger')(_0x982d('0x17'));var utils=require(_0x982d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x982d('0x19'));var db=require(_0x982d('0x1a'))['db'];function respondWithStatusCode(_0x3c3aa0,_0x126233){_0x126233=_0x126233||0xcc;return function(_0x4e15cb){if(_0x4e15cb){return _0x3c3aa0[_0x982d('0x1b')](_0x126233);}return _0x3c3aa0[_0x982d('0x1c')](_0x126233)[_0x982d('0x1d')]();};}function respondWithResult(_0x469181,_0x50fa5c){_0x50fa5c=_0x50fa5c||0xc8;return function(_0x687cd6){if(_0x687cd6){return _0x469181[_0x982d('0x1c')](_0x50fa5c)['json'](_0x687cd6);}};}function respondWithFilteredResult(_0x3471e7,_0xf7a73b){return function(_0x356acc){if(_0x356acc){var _0x42774d=typeof _0xf7a73b['offset']===_0x982d('0x1e')&&typeof _0xf7a73b[_0x982d('0x1f')]==='undefined';var _0x10e600=_0x356acc[_0x982d('0x20')];var _0xbd1eab=_0x42774d?0x0:_0xf7a73b[_0x982d('0x21')];var _0x52dad7=_0x42774d?_0x356acc[_0x982d('0x20')]:_0xf7a73b[_0x982d('0x21')]+_0xf7a73b['limit'];var _0x5b5d56;if(_0x52dad7>=_0x10e600){_0x52dad7=_0x10e600;_0x5b5d56=0xc8;}else{_0x5b5d56=0xce;}_0x3471e7['status'](_0x5b5d56);return _0x3471e7[_0x982d('0x22')](_0x982d('0x23'),_0xbd1eab+'-'+_0x52dad7+'/'+_0x10e600)[_0x982d('0x24')](_0x356acc);}return null;};}function patchUpdates(_0xda2a78){return function(_0x594855){try{jsonpatch[_0x982d('0x25')](_0x594855,_0xda2a78,!![]);}catch(_0x5db462){return BPromise[_0x982d('0x26')](_0x5db462);}return _0x594855[_0x982d('0x27')]();};}function saveUpdates(_0xc313e4,_0x46044f){return function(_0x376174){if(_0x376174){return _0x376174['update'](_0xc313e4)['then'](function(_0x523ef1){return _0x523ef1;});}return null;};}function removeEntity(_0x7b8a89,_0x20e479){return function(_0x27e217){if(_0x27e217){return _0x27e217[_0x982d('0x28')]()[_0x982d('0x29')](function(){var _0x2e96ae=_0x27e217['get']({'plain':!![]});var _0x54f1d6=_0x982d('0x2a');return db[_0x982d('0x2b')][_0x982d('0x28')]({'where':{'type':_0x54f1d6,'resourceId':_0x2e96ae['id']}})[_0x982d('0x29')](function(){return _0x27e217;});})[_0x982d('0x29')](function(){_0x7b8a89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x178761,_0x2094ce){return function(_0x3f5e1b){if(!_0x3f5e1b){_0x178761[_0x982d('0x1b')](0x194);}return _0x3f5e1b;};}function handleError(_0x2c814e,_0x3a0049){_0x3a0049=_0x3a0049||0x1f4;return function(_0x3e71e4){logger['error'](_0x3e71e4[_0x982d('0x2c')]);if(_0x3e71e4[_0x982d('0x2d')]){delete _0x3e71e4[_0x982d('0x2d')];}_0x2c814e['status'](_0x3a0049)['send'](_0x3e71e4);};}exports['index']=function(_0xa38896,_0x7a99c9){var _0x4571d0={},_0x5a14bb={},_0x491bf8={'count':0x0,'rows':[]};var _0x51f92d=_['map'](db[_0x982d('0x2e')][_0x982d('0x2f')],function(_0x3e3dde){return{'name':_0x3e3dde['fieldName'],'type':_0x3e3dde[_0x982d('0x30')][_0x982d('0x31')]};});_0x5a14bb[_0x982d('0x32')]=_['map'](_0x51f92d,_0x982d('0x2d'));_0x5a14bb[_0x982d('0x33')]=_[_0x982d('0x34')](_0xa38896['query']);_0x5a14bb[_0x982d('0x35')]=_[_0x982d('0x36')](_0x5a14bb['model'],_0x5a14bb[_0x982d('0x33')]);_0x4571d0[_0x982d('0x37')]=_[_0x982d('0x36')](_0x5a14bb[_0x982d('0x32')],qs['fields'](_0xa38896['query'][_0x982d('0x38')]));_0x4571d0['attributes']=_0x4571d0['attributes'][_0x982d('0x39')]?_0x4571d0[_0x982d('0x37')]:_0x5a14bb[_0x982d('0x32')];if(!_0xa38896[_0x982d('0x33')][_0x982d('0x3a')]('nolimit')){_0x4571d0['limit']=qs[_0x982d('0x1f')](_0xa38896['query']['limit']);_0x4571d0[_0x982d('0x21')]=qs[_0x982d('0x21')](_0xa38896[_0x982d('0x33')][_0x982d('0x21')]);}_0x4571d0[_0x982d('0x3b')]=qs['sort'](_0xa38896['query']['sort']);_0x4571d0[_0x982d('0x3c')]=qs[_0x982d('0x35')](_['pick'](_0xa38896[_0x982d('0x33')],_0x5a14bb[_0x982d('0x35')]),_0x51f92d);if(_0xa38896[_0x982d('0x33')][_0x982d('0x3d')]){_0x4571d0['where']=_[_0x982d('0x3e')](_0x4571d0[_0x982d('0x3c')],{'$or':_[_0x982d('0x3f')](_0x51f92d,function(_0xc60376){if(_0xc60376['type']!=='VIRTUAL'){var _0x3ac86d={};_0x3ac86d[_0xc60376[_0x982d('0x2d')]]={'$like':'%'+_0xa38896[_0x982d('0x33')][_0x982d('0x3d')]+'%'};return _0x3ac86d;}})});}_0x4571d0=_[_0x982d('0x3e')]({},_0x4571d0,_0xa38896['options']);var _0x37c537={'where':_0x4571d0['where']};return db['Pause'][_0x982d('0x20')](_0x37c537)[_0x982d('0x29')](function(_0x4098f3){_0x491bf8[_0x982d('0x20')]=_0x4098f3;if(_0xa38896['query'][_0x982d('0x40')]){_0x4571d0[_0x982d('0x41')]=[{'all':!![]}];}return db['Pause'][_0x982d('0x42')](_0x4571d0);})[_0x982d('0x29')](function(_0x4b6717){_0x491bf8[_0x982d('0x43')]=_0x4b6717;return _0x491bf8;})[_0x982d('0x29')](respondWithFilteredResult(_0x7a99c9,_0x4571d0))[_0x982d('0x44')](handleError(_0x7a99c9,null));};exports[_0x982d('0x45')]=function(_0x5908b8,_0x308901){var _0x344ab9={'raw':!![],'where':{'id':_0x5908b8[_0x982d('0x46')]['id']}},_0x571e2d={};_0x571e2d[_0x982d('0x32')]=_[_0x982d('0x34')](db[_0x982d('0x2e')][_0x982d('0x2f')]);_0x571e2d[_0x982d('0x33')]=_['keys'](_0x5908b8['query']);_0x571e2d['filters']=_['intersection'](_0x571e2d['model'],_0x571e2d['query']);_0x344ab9[_0x982d('0x37')]=_[_0x982d('0x36')](_0x571e2d[_0x982d('0x32')],qs[_0x982d('0x38')](_0x5908b8['query'][_0x982d('0x38')]));_0x344ab9[_0x982d('0x37')]=_0x344ab9[_0x982d('0x37')]['length']?_0x344ab9[_0x982d('0x37')]:_0x571e2d[_0x982d('0x32')];if(_0x5908b8[_0x982d('0x33')]['includeAll']){_0x344ab9[_0x982d('0x41')]=[{'all':!![]}];}_0x344ab9=_[_0x982d('0x3e')]({},_0x344ab9,_0x5908b8[_0x982d('0x47')]);return db['Pause'][_0x982d('0x48')](_0x344ab9)[_0x982d('0x29')](handleEntityNotFound(_0x308901,null))['then'](respondWithResult(_0x308901,null))[_0x982d('0x44')](handleError(_0x308901,null));};exports['create']=function(_0x4b2a23,_0x31e218){return db['Pause'][_0x982d('0x49')](_0x4b2a23['body'],{})[_0x982d('0x29')](function(_0x42dd51){var _0x56b12b=_0x4b2a23[_0x982d('0x4a')][_0x982d('0x4b')]({'plain':!![]});if(!_0x56b12b)throw new Error(_0x982d('0x4c'));if(_0x56b12b[_0x982d('0x4d')]==='user'){var _0x575f17=_0x42dd51[_0x982d('0x4b')]({'plain':!![]});var _0x31f9a8=_0x982d('0x2a');return db[_0x982d('0x4e')][_0x982d('0x48')]({'where':{'name':_0x31f9a8,'userProfileId':_0x56b12b[_0x982d('0x4f')]},'raw':!![]})[_0x982d('0x29')](function(_0x558040){if(_0x558040&&_0x558040['autoAssociation']===0x0){return db[_0x982d('0x2b')][_0x982d('0x49')]({'name':_0x575f17[_0x982d('0x2d')],'resourceId':_0x575f17['id'],'type':_0x558040[_0x982d('0x2d')],'sectionId':_0x558040['id']},{})['then'](function(){return _0x42dd51;});}else{return _0x42dd51;}})[_0x982d('0x44')](function(_0x3c6745){logger[_0x982d('0x50')](_0x982d('0x51'),_0x3c6745);throw _0x3c6745;});}return _0x42dd51;})[_0x982d('0x29')](respondWithResult(_0x31e218,0xc9))['catch'](handleError(_0x31e218,null));};exports['update']=function(_0x334f1f,_0x290a4d){if(_0x334f1f[_0x982d('0x52')]['id']){delete _0x334f1f[_0x982d('0x52')]['id'];}return db[_0x982d('0x2e')][_0x982d('0x48')]({'where':{'id':_0x334f1f[_0x982d('0x46')]['id']}})['then'](handleEntityNotFound(_0x290a4d,null))[_0x982d('0x29')](saveUpdates(_0x334f1f[_0x982d('0x52')],null))[_0x982d('0x29')](respondWithResult(_0x290a4d,null))[_0x982d('0x44')](handleError(_0x290a4d,null));};exports[_0x982d('0x28')]=function(_0x44086c,_0x5b9bf6){return db[_0x982d('0x2e')]['find']({'where':{'id':_0x44086c[_0x982d('0x46')]['id']}})[_0x982d('0x29')](handleEntityNotFound(_0x5b9bf6,null))[_0x982d('0x29')](removeEntity(_0x5b9bf6,null))[_0x982d('0x44')](handleError(_0x5b9bf6,null));}; \ No newline at end of file +var _0xe308=['keys','filters','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','Pause','rawAttributes','key','model'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xe308,0xcf));var _0x8e30=function(_0x4a7b6a,_0x5c1526){_0x4a7b6a=_0x4a7b6a-0x0;var _0x1e01f8=_0xe308[_0x4a7b6a];return _0x1e01f8;};'use strict';var emlformat=require(_0x8e30('0x0'));var rimraf=require(_0x8e30('0x1'));var zipdir=require(_0x8e30('0x2'));var jsonpatch=require(_0x8e30('0x3'));var rp=require(_0x8e30('0x4'));var moment=require(_0x8e30('0x5'));var BPromise=require(_0x8e30('0x6'));var Mustache=require(_0x8e30('0x7'));var util=require(_0x8e30('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8e30('0x9'));var ejs=require(_0x8e30('0xa'));var fs=require('fs');var fs_extra=require(_0x8e30('0xb'));var _=require(_0x8e30('0xc'));var squel=require(_0x8e30('0xd'));var crypto=require(_0x8e30('0xe'));var jsforce=require(_0x8e30('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8e30('0x9'));var querystring=require(_0x8e30('0x10'));var Papa=require(_0x8e30('0x11'));var Redis=require(_0x8e30('0x12'));var authService=require(_0x8e30('0x13'));var qs=require(_0x8e30('0x14'));var as=require(_0x8e30('0x15'));var hardwareService=require(_0x8e30('0x16'));var logger=require(_0x8e30('0x17'))(_0x8e30('0x18'));var utils=require(_0x8e30('0x19'));var config=require(_0x8e30('0x1a'));var licenseUtil=require(_0x8e30('0x1b'));var db=require(_0x8e30('0x1c'))['db'];function respondWithStatusCode(_0xf74e43,_0x58bd82){_0x58bd82=_0x58bd82||0xcc;return function(_0x975661){if(_0x975661){return _0xf74e43[_0x8e30('0x1d')](_0x58bd82);}return _0xf74e43[_0x8e30('0x1e')](_0x58bd82)[_0x8e30('0x1f')]();};}function respondWithResult(_0x4ed26d,_0x4afc5a){_0x4afc5a=_0x4afc5a||0xc8;return function(_0x2b0263){if(_0x2b0263){return _0x4ed26d[_0x8e30('0x1e')](_0x4afc5a)[_0x8e30('0x20')](_0x2b0263);}};}function respondWithFilteredResult(_0xfbad92,_0x52758f){return function(_0x583507){if(_0x583507){var _0x4819c4=typeof _0x52758f[_0x8e30('0x21')]===_0x8e30('0x22')&&typeof _0x52758f[_0x8e30('0x23')]===_0x8e30('0x22');var _0xc03601=_0x583507[_0x8e30('0x24')];var _0x50d36a=_0x4819c4?0x0:_0x52758f[_0x8e30('0x21')];var _0x107c2d=_0x4819c4?_0x583507[_0x8e30('0x24')]:_0x52758f[_0x8e30('0x21')]+_0x52758f['limit'];var _0x50cc7f;if(_0x107c2d>=_0xc03601){_0x107c2d=_0xc03601;_0x50cc7f=0xc8;}else{_0x50cc7f=0xce;}_0xfbad92[_0x8e30('0x1e')](_0x50cc7f);return _0xfbad92[_0x8e30('0x25')](_0x8e30('0x26'),_0x50d36a+'-'+_0x107c2d+'/'+_0xc03601)['json'](_0x583507);}return null;};}function patchUpdates(_0x541b86){return function(_0x120ee3){try{jsonpatch[_0x8e30('0x27')](_0x120ee3,_0x541b86,!![]);}catch(_0x244d05){return BPromise[_0x8e30('0x28')](_0x244d05);}return _0x120ee3[_0x8e30('0x29')]();};}function saveUpdates(_0x48af2a,_0x22eae0){return function(_0x2abdec){if(_0x2abdec){return _0x2abdec[_0x8e30('0x2a')](_0x48af2a)[_0x8e30('0x2b')](function(_0x596a14){return _0x596a14;});}return null;};}function removeEntity(_0x2f16ad,_0x45c4f2){return function(_0x42b25c){if(_0x42b25c){return _0x42b25c[_0x8e30('0x2c')]()[_0x8e30('0x2b')](function(){var _0xf56431=_0x42b25c[_0x8e30('0x2d')]({'plain':!![]});var _0xa2f145=_0x8e30('0x2e');return db[_0x8e30('0x2f')]['destroy']({'where':{'type':_0xa2f145,'resourceId':_0xf56431['id']}})[_0x8e30('0x2b')](function(){return _0x42b25c;});})['then'](function(){_0x2f16ad[_0x8e30('0x1e')](0xcc)[_0x8e30('0x1f')]();});}};}function handleEntityNotFound(_0x52b3c7,_0x3d7a72){return function(_0x238991){if(!_0x238991){_0x52b3c7[_0x8e30('0x1d')](0x194);}return _0x238991;};}function handleError(_0x2538a6,_0x5b3624){_0x5b3624=_0x5b3624||0x1f4;return function(_0x50eee7){logger[_0x8e30('0x30')](_0x50eee7[_0x8e30('0x31')]);if(_0x50eee7['name']){delete _0x50eee7[_0x8e30('0x32')];}_0x2538a6['status'](_0x5b3624)[_0x8e30('0x33')](_0x50eee7);};}exports['index']=function(_0x4bef83,_0x77822e){var _0x312af8={},_0x46a7fe={},_0x3ba590={'count':0x0,'rows':[]};var _0x13ef57=_[_0x8e30('0x34')](db[_0x8e30('0x35')][_0x8e30('0x36')],function(_0x30dd79){return{'name':_0x30dd79['fieldName'],'type':_0x30dd79['type'][_0x8e30('0x37')]};});_0x46a7fe[_0x8e30('0x38')]=_[_0x8e30('0x34')](_0x13ef57,_0x8e30('0x32'));_0x46a7fe['query']=_[_0x8e30('0x39')](_0x4bef83['query']);_0x46a7fe[_0x8e30('0x3a')]=_['intersection'](_0x46a7fe['model'],_0x46a7fe[_0x8e30('0x3b')]);_0x312af8['attributes']=_[_0x8e30('0x3c')](_0x46a7fe['model'],qs[_0x8e30('0x3d')](_0x4bef83[_0x8e30('0x3b')]['fields']));_0x312af8['attributes']=_0x312af8[_0x8e30('0x3e')]['length']?_0x312af8['attributes']:_0x46a7fe['model'];if(!_0x4bef83[_0x8e30('0x3b')][_0x8e30('0x3f')]('nolimit')){_0x312af8['limit']=qs[_0x8e30('0x23')](_0x4bef83[_0x8e30('0x3b')]['limit']);_0x312af8[_0x8e30('0x21')]=qs[_0x8e30('0x21')](_0x4bef83[_0x8e30('0x3b')][_0x8e30('0x21')]);}_0x312af8[_0x8e30('0x40')]=qs[_0x8e30('0x41')](_0x4bef83['query'][_0x8e30('0x41')]);_0x312af8[_0x8e30('0x42')]=qs[_0x8e30('0x3a')](_[_0x8e30('0x43')](_0x4bef83[_0x8e30('0x3b')],_0x46a7fe['filters']),_0x13ef57);if(_0x4bef83[_0x8e30('0x3b')][_0x8e30('0x44')]){_0x312af8[_0x8e30('0x42')]=_[_0x8e30('0x45')](_0x312af8[_0x8e30('0x42')],{'$or':_[_0x8e30('0x34')](_0x13ef57,function(_0x5249bf){if(_0x5249bf[_0x8e30('0x46')]!==_0x8e30('0x47')){var _0x53a624={};_0x53a624[_0x5249bf[_0x8e30('0x32')]]={'$like':'%'+_0x4bef83[_0x8e30('0x3b')][_0x8e30('0x44')]+'%'};return _0x53a624;}})});}_0x312af8=_[_0x8e30('0x45')]({},_0x312af8,_0x4bef83[_0x8e30('0x48')]);var _0x3431dd={'where':_0x312af8[_0x8e30('0x42')]};return db[_0x8e30('0x35')][_0x8e30('0x24')](_0x3431dd)[_0x8e30('0x2b')](function(_0x2f45f8){_0x3ba590['count']=_0x2f45f8;if(_0x4bef83[_0x8e30('0x3b')][_0x8e30('0x49')]){_0x312af8[_0x8e30('0x4a')]=[{'all':!![]}];}return db[_0x8e30('0x35')][_0x8e30('0x4b')](_0x312af8);})['then'](function(_0x22d6ba){_0x3ba590[_0x8e30('0x4c')]=_0x22d6ba;return _0x3ba590;})[_0x8e30('0x2b')](respondWithFilteredResult(_0x77822e,_0x312af8))[_0x8e30('0x4d')](handleError(_0x77822e,null));};exports[_0x8e30('0x4e')]=function(_0x28f1dc,_0x9d0794){var _0x55d7d5={'raw':!![],'where':{'id':_0x28f1dc[_0x8e30('0x4f')]['id']}},_0xd8dbfc={};_0xd8dbfc[_0x8e30('0x38')]=_['keys'](db[_0x8e30('0x35')]['rawAttributes']);_0xd8dbfc[_0x8e30('0x3b')]=_[_0x8e30('0x39')](_0x28f1dc['query']);_0xd8dbfc['filters']=_['intersection'](_0xd8dbfc[_0x8e30('0x38')],_0xd8dbfc[_0x8e30('0x3b')]);_0x55d7d5['attributes']=_[_0x8e30('0x3c')](_0xd8dbfc[_0x8e30('0x38')],qs[_0x8e30('0x3d')](_0x28f1dc[_0x8e30('0x3b')]['fields']));_0x55d7d5['attributes']=_0x55d7d5['attributes'][_0x8e30('0x50')]?_0x55d7d5[_0x8e30('0x3e')]:_0xd8dbfc[_0x8e30('0x38')];if(_0x28f1dc[_0x8e30('0x3b')][_0x8e30('0x49')]){_0x55d7d5[_0x8e30('0x4a')]=[{'all':!![]}];}_0x55d7d5=_[_0x8e30('0x45')]({},_0x55d7d5,_0x28f1dc[_0x8e30('0x48')]);return db[_0x8e30('0x35')][_0x8e30('0x51')](_0x55d7d5)[_0x8e30('0x2b')](handleEntityNotFound(_0x9d0794,null))[_0x8e30('0x2b')](respondWithResult(_0x9d0794,null))[_0x8e30('0x4d')](handleError(_0x9d0794,null));};exports[_0x8e30('0x52')]=function(_0x38e137,_0x1f8a49){return db['Pause'][_0x8e30('0x52')](_0x38e137[_0x8e30('0x53')],{})['then'](function(_0x2f63d8){var _0x1f9ea2=_0x38e137['user']['get']({'plain':!![]});if(!_0x1f9ea2)throw new Error(_0x8e30('0x54'));if(_0x1f9ea2[_0x8e30('0x55')]==='user'){var _0x203b32=_0x2f63d8['get']({'plain':!![]});var _0x17cf89='Pauses';return db[_0x8e30('0x56')][_0x8e30('0x51')]({'where':{'name':_0x17cf89,'userProfileId':_0x1f9ea2[_0x8e30('0x57')]},'raw':!![]})['then'](function(_0x5d1c93){if(_0x5d1c93&&_0x5d1c93['autoAssociation']===0x0){return db[_0x8e30('0x2f')][_0x8e30('0x52')]({'name':_0x203b32[_0x8e30('0x32')],'resourceId':_0x203b32['id'],'type':_0x5d1c93[_0x8e30('0x32')],'sectionId':_0x5d1c93['id']},{})[_0x8e30('0x2b')](function(){return _0x2f63d8;});}else{return _0x2f63d8;}})['catch'](function(_0x380f22){logger[_0x8e30('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x380f22);throw _0x380f22;});}return _0x2f63d8;})[_0x8e30('0x2b')](respondWithResult(_0x1f8a49,0xc9))[_0x8e30('0x4d')](handleError(_0x1f8a49,null));};exports[_0x8e30('0x2a')]=function(_0x3704b3,_0x5c56b0){if(_0x3704b3[_0x8e30('0x53')]['id']){delete _0x3704b3[_0x8e30('0x53')]['id'];}return db['Pause']['find']({'where':{'id':_0x3704b3['params']['id']}})[_0x8e30('0x2b')](handleEntityNotFound(_0x5c56b0,null))['then'](saveUpdates(_0x3704b3[_0x8e30('0x53')],null))['then'](respondWithResult(_0x5c56b0,null))['catch'](handleError(_0x5c56b0,null));};exports[_0x8e30('0x2c')]=function(_0x27899b,_0x5514f0){return db[_0x8e30('0x35')][_0x8e30('0x51')]({'where':{'id':_0x27899b['params']['id']}})['then'](handleEntityNotFound(_0x5514f0,null))['then'](removeEntity(_0x5514f0,null))[_0x8e30('0x4d')](handleError(_0x5514f0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index f60452f..3dd4194 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x17f37e,_0x4f5d4c){var _0x19555e=function(_0x161ece){while(--_0x161ece){_0x17f37e['push'](_0x17f37e['shift']());}};_0x19555e(++_0x4f5d4c);}(_0xe14b,0x93));var _0xbe14=function(_0x329705,_0x37d93d){_0x329705=_0x329705-0x0;var _0x9cd6c2=_0xe14b[_0x329705];return _0x9cd6c2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'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 2b6c76b..2c6b0c0 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x25b049,_0x42fedf){var _0x444f30=function(_0x2fff9c){while(--_0x2fff9c){_0x25b049['push'](_0x25b049['shift']());}};_0x444f30(++_0x42fedf);}(_0xb10b,0x12a));var _0xbb10=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0xb10b[_0xf33afd];return _0x5f432a;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3b76a2,_0x2d37b3){var _0x327e21=function(_0x5d57d1){while(--_0x5d57d1){_0x3b76a2['push'](_0x3b76a2['shift']());}};_0x327e21(++_0x2d37b3);}(_0x7a54,0x106));var _0x47a5=function(_0x4c7b21,_0x268e66){_0x4c7b21=_0x4c7b21-0x0;var _0x3ceb95=_0x7a54[_0x4c7b21];return _0x3ceb95;};'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')]('Pause,\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);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bb0b2eb..dc186fc 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 _0x4b19=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','webhookGet','/:id','show','isAuthenticated','download','diskStorage','root','server/files/plugins','originalname','replace','basename','post','single','file','/webhook','webhookPost','put','update','delete','multer'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x4b19,0x195));var _0x94b1=function(_0x43537e,_0x4b4744){_0x43537e=_0x43537e-0x0;var _0x315b1d=_0x4b19[_0x43537e];return _0x315b1d;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/webhook',controller[_0x94b1('0xa')]);router[_0x94b1('0x8')](_0x94b1('0xb'),auth['isAuthenticated'](),controller[_0x94b1('0xc')]);router['get']('/:id/download',auth[_0x94b1('0xd')](),controller[_0x94b1('0xe')]);var upload=multer({'storage':multer[_0x94b1('0xf')]({'destination':function(_0x8ddf47,_0x162995,_0x3aeb91){_0x3aeb91(null,path['join'](config[_0x94b1('0x10')],_0x94b1('0x11')));},'filename':function(_0x340a29,_0x2b378c,_0x5cbf96){_0x2b378c['originalname']=_0x2b378c[_0x94b1('0x12')][_0x94b1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cbf96(null,util['format']('%s-%s%s',path[_0x94b1('0x14')](_0x2b378c[_0x94b1('0x12')],path['extname'](_0x2b378c[_0x94b1('0x12')])),Date['now'](),path['extname'](_0x2b378c[_0x94b1('0x12')])));}})});router[_0x94b1('0x15')]('/',upload[_0x94b1('0x16')](_0x94b1('0x17')),controller['upload']);router[_0x94b1('0x15')](_0x94b1('0x18'),controller[_0x94b1('0x19')]);router[_0x94b1('0x1a')](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1b')]);router['delete'](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xe14d=['isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','/webhook','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x386569,_0x531de2){var _0x3c9872=function(_0x4cdf3c){while(--_0x4cdf3c){_0x386569['push'](_0x386569['shift']());}};_0x3c9872(++_0x531de2);}(_0xe14d,0x1ee));var _0xde14=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xe14d[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/webhook',controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0x9')](_0xde14('0xf'),auth[_0xde14('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xde14('0x10')]({'destination':function(_0xe785fb,_0x417269,_0x4357c7){_0x4357c7(null,path[_0xde14('0x11')](config[_0xde14('0x12')],_0xde14('0x13')));},'filename':function(_0x3d5a29,_0x34e28f,_0x29e3ca){_0x34e28f[_0xde14('0x14')]=_0x34e28f[_0xde14('0x14')][_0xde14('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29e3ca(null,util[_0xde14('0x16')](_0xde14('0x17'),path['basename'](_0x34e28f['originalname'],path[_0xde14('0x18')](_0x34e28f[_0xde14('0x14')])),Date[_0xde14('0x19')](),path['extname'](_0x34e28f[_0xde14('0x14')])));}})});router[_0xde14('0x1a')]('/',upload[_0xde14('0x1b')](_0xde14('0x1c')),controller[_0xde14('0x1d')]);router[_0xde14('0x1a')](_0xde14('0x1e'),controller[_0xde14('0x1f')]);router[_0xde14('0x20')](_0xde14('0xd'),auth['isAuthenticated'](),controller[_0xde14('0x21')]);router[_0xde14('0x22')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller['delete']);module[_0xde14('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e5fe6b0..06c5f84 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 _0xa978=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x2daba5,_0x15ee4e){var _0xe64e4a=function(_0x267adb){while(--_0x267adb){_0x2daba5['push'](_0x2daba5['shift']());}};_0xe64e4a(++_0x15ee4e);}(_0xa978,0xe3));var _0x8a97=function(_0xc01de9,_0x5f3917){_0xc01de9=_0xc01de9-0x0;var _0x50843a=_0xa978[_0xc01de9];return _0x50843a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a97('0x0')]},'type':{'type':Sequelize[_0x8a97('0x1')](_0x8a97('0x2'),_0x8a97('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x8a97('0x4')]},'path':{'type':Sequelize[_0x8a97('0x0')],'comment':_0x8a97('0x5')},'active':{'type':Sequelize[_0x8a97('0x6')],'defaultValue':0x0,'comment':_0x8a97('0x7')},'sidebar':{'type':Sequelize[_0x8a97('0x1')](_0x8a97('0x8'),_0x8a97('0x9'),_0x8a97('0xa'),_0x8a97('0xb')),'defaultValue':_0x8a97('0xa'),'comment':_0x8a97('0xc')},'icon':{'type':Sequelize[_0x8a97('0x0')]},'adminUrl':{'type':Sequelize[_0x8a97('0x0')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x8a97('0x0')]}}; \ No newline at end of file +var _0x7aad=['ENUM','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x7d1853,_0x4df35a){var _0x3b4409=function(_0x45efc3){while(--_0x45efc3){_0x7d1853['push'](_0x7d1853['shift']());}};_0x3b4409(++_0x4df35a);}(_0x7aad,0x1cb));var _0xd7aa=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x7aad[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0xd7aa('0x0'));module[_0xd7aa('0x1')]={'name':{'type':Sequelize[_0xd7aa('0x2')]},'type':{'type':Sequelize[_0xd7aa('0x3')]('html','script')},'description':{'type':Sequelize[_0xd7aa('0x4')]},'version':{'type':Sequelize[_0xd7aa('0x4')]},'path':{'type':Sequelize[_0xd7aa('0x2')],'comment':_0xd7aa('0x5')},'active':{'type':Sequelize[_0xd7aa('0x6')],'defaultValue':0x0,'comment':_0xd7aa('0x7')},'sidebar':{'type':Sequelize[_0xd7aa('0x3')](_0xd7aa('0x8'),'agentOnly',_0xd7aa('0x9'),'never'),'defaultValue':'always','comment':_0xd7aa('0xa')},'icon':{'type':Sequelize[_0xd7aa('0x2')]},'adminUrl':{'type':Sequelize[_0xd7aa('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xd7aa('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e818146..00c3f5b 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 _0xd8f0=['%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','destroy','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','Plugin','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','format','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','Error','Plugin\x20not\x20found'];(function(_0x2c0a24,_0x3bc24b){var _0xbfae11=function(_0x41ab82){while(--_0x41ab82){_0x2c0a24['push'](_0x2c0a24['shift']());}};_0xbfae11(++_0x3bc24b);}(_0xd8f0,0xed));var _0x0d8f=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xd8f0[_0x1b6186];return _0x186121;};'use strict';var emlformat=require(_0x0d8f('0x0'));var rimraf=require(_0x0d8f('0x1'));var zipdir=require(_0x0d8f('0x2'));var jsonpatch=require(_0x0d8f('0x3'));var rp=require(_0x0d8f('0x4'));var moment=require(_0x0d8f('0x5'));var BPromise=require(_0x0d8f('0x6'));var Mustache=require(_0x0d8f('0x7'));var util=require(_0x0d8f('0x8'));var path=require(_0x0d8f('0x9'));var sox=require('sox');var csv=require(_0x0d8f('0xa'));var ejs=require(_0x0d8f('0xb'));var fs=require('fs');var fs_extra=require(_0x0d8f('0xc'));var _=require(_0x0d8f('0xd'));var squel=require(_0x0d8f('0xe'));var crypto=require(_0x0d8f('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0d8f('0xa'));var querystring=require(_0x0d8f('0x10'));var Papa=require(_0x0d8f('0x11'));var extract=require(_0x0d8f('0x12'));var rimraf=require(_0x0d8f('0x1'));var archiver=require(_0x0d8f('0x13'));var Redis=require(_0x0d8f('0x14'));var authService=require(_0x0d8f('0x15'));var qs=require(_0x0d8f('0x16'));var as=require(_0x0d8f('0x17'));var hardwareService=require(_0x0d8f('0x18'));var logger=require('../../config/logger')(_0x0d8f('0x19'));var utils=require(_0x0d8f('0x1a'));var config=require(_0x0d8f('0x1b'));var licenseUtil=require(_0x0d8f('0x1c'));var db=require(_0x0d8f('0x1d'))['db'];config[_0x0d8f('0x1e')]=_['defaults'](config[_0x0d8f('0x1e')],{'host':_0x0d8f('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d8f('0x20'))[_0x0d8f('0x21')](socket);function respondWithStatusCode(_0x142343,_0x314ae1){_0x314ae1=_0x314ae1||0xcc;return function(_0x24f2dc){if(_0x24f2dc){return _0x142343[_0x0d8f('0x22')](_0x314ae1);}return _0x142343['status'](_0x314ae1)[_0x0d8f('0x23')]();};}function respondWithResult(_0x3f047d,_0x357762){_0x357762=_0x357762||0xc8;return function(_0x324477){if(_0x324477){return _0x3f047d['status'](_0x357762)[_0x0d8f('0x24')](_0x324477);}};}function respondWithFilteredResult(_0x84ff8a,_0x17b248){return function(_0x1538a0){if(_0x1538a0){var _0x467181=typeof _0x17b248[_0x0d8f('0x25')]===_0x0d8f('0x26')&&typeof _0x17b248[_0x0d8f('0x27')]===_0x0d8f('0x26');var _0x18cc5f=_0x1538a0[_0x0d8f('0x28')];var _0x29f14d=_0x467181?0x0:_0x17b248[_0x0d8f('0x25')];var _0x185b0f=_0x467181?_0x1538a0[_0x0d8f('0x28')]:_0x17b248['offset']+_0x17b248[_0x0d8f('0x27')];var _0xb8c0a0;if(_0x185b0f>=_0x18cc5f){_0x185b0f=_0x18cc5f;_0xb8c0a0=0xc8;}else{_0xb8c0a0=0xce;}_0x84ff8a[_0x0d8f('0x29')](_0xb8c0a0);return _0x84ff8a[_0x0d8f('0x2a')](_0x0d8f('0x2b'),_0x29f14d+'-'+_0x185b0f+'/'+_0x18cc5f)[_0x0d8f('0x24')](_0x1538a0);}return null;};}function patchUpdates(_0x1a8514){return function(_0x113486){try{jsonpatch[_0x0d8f('0x2c')](_0x113486,_0x1a8514,!![]);}catch(_0x483ae0){return BPromise['reject'](_0x483ae0);}return _0x113486['save']();};}function saveUpdates(_0x3e32d1,_0x336f57){return function(_0x498da9){if(_0x498da9){return _0x498da9[_0x0d8f('0x2d')](_0x3e32d1)[_0x0d8f('0x2e')](function(_0x48061e){return _0x48061e;});}return null;};}function removeEntity(_0x366e1f,_0x2a10f2){return function(_0x4ff5ea){if(_0x4ff5ea){return _0x4ff5ea[_0x0d8f('0x2f')]()[_0x0d8f('0x2e')](function(){var _0x43abf2=_0x4ff5ea['get']({'plain':!![]});var _0x2cfd7b='Plugins';return db[_0x0d8f('0x30')][_0x0d8f('0x2f')]({'where':{'type':_0x2cfd7b,'resourceId':_0x43abf2['id']}})[_0x0d8f('0x2e')](function(){return _0x4ff5ea;});})[_0x0d8f('0x2e')](function(){_0x366e1f[_0x0d8f('0x29')](0xcc)[_0x0d8f('0x23')]();});}};}function handleEntityNotFound(_0x5bb0c6,_0x1340da){return function(_0x4c5ddd){if(!_0x4c5ddd){_0x5bb0c6[_0x0d8f('0x22')](0x194);}return _0x4c5ddd;};}function handleError(_0x3819e3,_0x440d3c){_0x440d3c=_0x440d3c||0x1f4;return function(_0x378db7){logger[_0x0d8f('0x31')](_0x378db7[_0x0d8f('0x32')]);if(_0x378db7[_0x0d8f('0x33')]){delete _0x378db7[_0x0d8f('0x33')];}_0x3819e3[_0x0d8f('0x29')](_0x440d3c)[_0x0d8f('0x34')](_0x378db7);};}exports['index']=function(_0x347123,_0x4901aa){var _0x14b561={},_0xbbc1c9={},_0x520935={'count':0x0,'rows':[]};var _0x29747b=_['map'](db['Plugin'][_0x0d8f('0x35')],function(_0x1b3102){return{'name':_0x1b3102[_0x0d8f('0x36')],'type':_0x1b3102['type'][_0x0d8f('0x37')]};});_0xbbc1c9[_0x0d8f('0x38')]=_[_0x0d8f('0x39')](_0x29747b,_0x0d8f('0x33'));_0xbbc1c9[_0x0d8f('0x3a')]=_[_0x0d8f('0x3b')](_0x347123[_0x0d8f('0x3a')]);_0xbbc1c9[_0x0d8f('0x3c')]=_[_0x0d8f('0x3d')](_0xbbc1c9['model'],_0xbbc1c9[_0x0d8f('0x3a')]);_0x14b561[_0x0d8f('0x3e')]=_['intersection'](_0xbbc1c9[_0x0d8f('0x38')],qs['fields'](_0x347123[_0x0d8f('0x3a')][_0x0d8f('0x3f')]));_0x14b561[_0x0d8f('0x3e')]=_0x14b561['attributes'][_0x0d8f('0x40')]?_0x14b561[_0x0d8f('0x3e')]:_0xbbc1c9['model'];if(!_0x347123[_0x0d8f('0x3a')]['hasOwnProperty'](_0x0d8f('0x41'))){_0x14b561[_0x0d8f('0x27')]=qs[_0x0d8f('0x27')](_0x347123[_0x0d8f('0x3a')][_0x0d8f('0x27')]);_0x14b561[_0x0d8f('0x25')]=qs['offset'](_0x347123[_0x0d8f('0x3a')][_0x0d8f('0x25')]);}_0x14b561[_0x0d8f('0x42')]=qs[_0x0d8f('0x43')](_0x347123[_0x0d8f('0x3a')]['sort']);_0x14b561[_0x0d8f('0x44')]=qs[_0x0d8f('0x3c')](_[_0x0d8f('0x45')](_0x347123[_0x0d8f('0x3a')],_0xbbc1c9[_0x0d8f('0x3c')]),_0x29747b);if(_0x347123[_0x0d8f('0x3a')]['filter']){_0x14b561[_0x0d8f('0x44')]=_[_0x0d8f('0x46')](_0x14b561[_0x0d8f('0x44')],{'$or':_[_0x0d8f('0x39')](_0x29747b,function(_0x340aa7){if(_0x340aa7[_0x0d8f('0x47')]!=='VIRTUAL'){var _0x47dc7e={};_0x47dc7e[_0x340aa7[_0x0d8f('0x33')]]={'$like':'%'+_0x347123['query']['filter']+'%'};return _0x47dc7e;}})});}_0x14b561=_[_0x0d8f('0x46')]({},_0x14b561,_0x347123[_0x0d8f('0x48')]);var _0x16b54c={'where':_0x14b561[_0x0d8f('0x44')]};return db['Plugin']['count'](_0x16b54c)['then'](function(_0x11858e){_0x520935[_0x0d8f('0x28')]=_0x11858e;if(_0x347123[_0x0d8f('0x3a')][_0x0d8f('0x49')]){_0x14b561[_0x0d8f('0x4a')]=[{'all':!![]}];}return db[_0x0d8f('0x4b')][_0x0d8f('0x4c')](_0x14b561);})[_0x0d8f('0x2e')](function(_0x54a840){_0x520935[_0x0d8f('0x4d')]=_0x54a840;return _0x520935;})[_0x0d8f('0x2e')](respondWithFilteredResult(_0x4901aa,_0x14b561))[_0x0d8f('0x4e')](handleError(_0x4901aa,null));};exports[_0x0d8f('0x4f')]=function(_0x2ef72f,_0x2ddda0){var _0x25d5fd={'raw':!![],'where':{'id':_0x2ef72f[_0x0d8f('0x50')]['id']}},_0x351415={};_0x351415[_0x0d8f('0x38')]=_[_0x0d8f('0x3b')](db['Plugin'][_0x0d8f('0x35')]);_0x351415[_0x0d8f('0x3a')]=_['keys'](_0x2ef72f[_0x0d8f('0x3a')]);_0x351415['filters']=_[_0x0d8f('0x3d')](_0x351415[_0x0d8f('0x38')],_0x351415['query']);_0x25d5fd[_0x0d8f('0x3e')]=_[_0x0d8f('0x3d')](_0x351415[_0x0d8f('0x38')],qs['fields'](_0x2ef72f['query']['fields']));_0x25d5fd['attributes']=_0x25d5fd[_0x0d8f('0x3e')][_0x0d8f('0x40')]?_0x25d5fd[_0x0d8f('0x3e')]:_0x351415['model'];if(_0x2ef72f[_0x0d8f('0x3a')][_0x0d8f('0x49')]){_0x25d5fd[_0x0d8f('0x4a')]=[{'all':!![]}];}_0x25d5fd=_[_0x0d8f('0x46')]({},_0x25d5fd,_0x2ef72f[_0x0d8f('0x48')]);return db[_0x0d8f('0x4b')][_0x0d8f('0x51')](_0x25d5fd)[_0x0d8f('0x2e')](handleEntityNotFound(_0x2ddda0,null))[_0x0d8f('0x2e')](respondWithResult(_0x2ddda0,null))[_0x0d8f('0x4e')](handleError(_0x2ddda0,null));};exports[_0x0d8f('0x52')]=function(_0x313a1f,_0x3fc501,_0x4f1d2f){return db[_0x0d8f('0x4b')][_0x0d8f('0x51')]({'where':{'id':_0x313a1f['params']['id']},'attributes':[_0x0d8f('0x33'),_0x0d8f('0x9')],'raw':!![]})[_0x0d8f('0x2e')](handleEntityNotFound(_0x3fc501,null))[_0x0d8f('0x2e')](function(_0x1620f0){if(_0x1620f0){var _0x470f80=path[_0x0d8f('0x53')](config[_0x0d8f('0x54')],_0x0d8f('0x55'),util[_0x0d8f('0x56')]('%s.zip',path['basename'](_0x1620f0[_0x0d8f('0x9')])));var _0x41d74e=fs[_0x0d8f('0x57')](_0x470f80);var _0x5cb574=archiver(_0x0d8f('0x58'),{'zlib':{'level':0x9}});_0x5cb574['on'](_0x0d8f('0x59'),function(_0x5c8fbe){if(_0x5c8fbe[_0x0d8f('0x5a')]===_0x0d8f('0x5b')){logger['error'](_0x5c8fbe);}else{throw new db[(_0x0d8f('0x5c'))]['Error'](_0x0d8f('0x5d'));}});_0x5cb574['on'](_0x0d8f('0x31'),function(_0x4e854f){throw new db[(_0x0d8f('0x5c'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5cb574['pipe'](_0x41d74e);_0x5cb574['glob'](_0x0d8f('0x5e'),{'cwd':path['join'](config[_0x0d8f('0x54')],_0x0d8f('0x55'),path[_0x0d8f('0x5f')](_0x1620f0['path'])),'ignore':[path[_0x0d8f('0x53')](path[_0x0d8f('0x60')](_0x1620f0['path']),_0x0d8f('0x61')),path[_0x0d8f('0x53')](path[_0x0d8f('0x60')](_0x1620f0[_0x0d8f('0x9')]),_0x0d8f('0x62'))],'nodir':!![]})[_0x0d8f('0x63')]();_0x41d74e['on'](_0x0d8f('0x64'),function(){if(!fs['existsSync'](_0x470f80)){throw new db['Sequelize'][(_0x0d8f('0x65'))](_0x0d8f('0x66'));}return _0x3fc501['download'](_0x470f80,util[_0x0d8f('0x56')](_0x0d8f('0x67'),path['basename'](_0x1620f0['path'])),function(_0x5db6dd){if(_0x5db6dd){throw new db[(_0x0d8f('0x5c'))]['Error'](_0x0d8f('0x68'));}fs[_0x0d8f('0x69')](_0x470f80);logger[_0x0d8f('0x6a')](_0x0d8f('0x6b'));logger[_0x0d8f('0x6a')](_0x0d8f('0x6c'));});});}return null;})['catch'](handleError(_0x3fc501,null));};exports[_0x0d8f('0x6d')]=function(_0xac502e,_0x2528b6,_0x1ee87e){var _0x54d347=path['basename'](_0xac502e[_0x0d8f('0x6e')]['filename'],path['extname'](_0xac502e[_0x0d8f('0x6e')][_0x0d8f('0x6f')]));var _0x4a3f07=path[_0x0d8f('0x53')](config[_0x0d8f('0x54')],_0x0d8f('0x55'),_0xac502e[_0x0d8f('0x6e')][_0x0d8f('0x6f')]);var _0x2b8dfd=path[_0x0d8f('0x53')](config[_0x0d8f('0x54')],'server/files/plugins',_0x54d347);logger[_0x0d8f('0x6a')](_0x0d8f('0x70'),_0x4a3f07);logger[_0x0d8f('0x6a')](_0x0d8f('0x71'),_0x2b8dfd);try{fs['chmodSync'](_0x4a3f07,parseInt('0777',0x8));extract(_0x4a3f07,{'dir':_0x2b8dfd},function(_0x2f3abc){if(_0x2f3abc){logger[_0x0d8f('0x31')](_0x2f3abc);handleError(_0x2f3abc,!![]);};var _0x3cb65c=fs[_0x0d8f('0x72')](_0x2b8dfd);if(_0x3cb65c[_0x0d8f('0x40')]>0x1){removeReferences(_0x4a3f07,_0x2b8dfd);logger[_0x0d8f('0x31')](_0x0d8f('0x73'));return _0x1ee87e(new Error(_0x0d8f('0x73')));}var _0x1310ec=fs[_0x0d8f('0x74')](path['join'](_0x2b8dfd,_0x3cb65c[0x0]));if(_0x1310ec[_0x0d8f('0x75')]()){removeReferences(_0x4a3f07,_0x2b8dfd);logger[_0x0d8f('0x31')](_0x0d8f('0x73'));return _0x1ee87e(new Error(_0x0d8f('0x73')));}if(_0x1310ec['isDirectory']()){var _0x3f7a27=fs[_0x0d8f('0x72')](path['join'](_0x2b8dfd,_0x3cb65c[0x0]));if(_0x3f7a27['length']===0x0){removeReferences(_0x4a3f07,_0x2b8dfd);logger[_0x0d8f('0x31')](_0x0d8f('0x73'));return _0x1ee87e(new Error(_0x0d8f('0x73')));}var _0xae347a=_0x3f7a27['some'](function(_0x3fadbe){return _0x3fadbe===_0x0d8f('0x76');});if(!_0xae347a){return _0x1ee87e(new Error(_0x0d8f('0x77')));}var _0x23c507=fs[_0x0d8f('0x78')](path[_0x0d8f('0x53')](_0x2b8dfd,_0x3cb65c[0x0],_0x0d8f('0x76')));var _0x4335ef=JSON[_0x0d8f('0x79')](_0x23c507);if('undefined'==typeof _0x4335ef[_0x0d8f('0x33')]){return _0x1ee87e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x0d8f('0x26')==typeof _0x4335ef[_0x0d8f('0x47')]){return _0x1ee87e(new Error(_0x0d8f('0x7a')));}if('undefined'==typeof _0x4335ef[_0x0d8f('0x7b')]){return _0x1ee87e(new Error(_0x0d8f('0x7c')));}if('undefined'==typeof _0x4335ef['parameters']){return _0x1ee87e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4335ef['type']===_0x0d8f('0x7d')){if('undefined'==typeof _0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')]){return _0x1ee87e(new Error(_0x0d8f('0x80')));}if(_0x0d8f('0x26')==typeof _0x4335ef[_0x0d8f('0x7e')]['views'][_0x0d8f('0x81')]&&_0x0d8f('0x26')==typeof _0x4335ef[_0x0d8f('0x7e')]['views'][_0x0d8f('0x82')]){return _0x1ee87e(new Error(_0x0d8f('0x83')));}}else if(_0x4335ef[_0x0d8f('0x47')]===_0x0d8f('0x84')){if(_0x0d8f('0x26')==typeof _0x4335ef['parameters'][_0x0d8f('0x85')]){return _0x1ee87e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x0d8f('0x26')==typeof _0x4335ef['parameters'][_0x0d8f('0x86')]){return _0x1ee87e(new Error(_0x0d8f('0x87')));}}else{return _0x1ee87e(new Error(_0x0d8f('0x88')));}var _0x12e273=_0x4335ef['name'];var _0x4af7ee=_0x4335ef[_0x0d8f('0x89')];var _0x53a15a=_0x4335ef['type'];var _0x17e57b=_0x4335ef[_0x0d8f('0x8a')]?_0x4335ef[_0x0d8f('0x8a')]:_0x0d8f('0x8b');var _0x34438c=_0x4335ef['icon']?_0x4335ef[_0x0d8f('0x8c')]:_0x0d8f('0x8d');var _0x28dd10='';var _0x573bdb='';var _0x1f80c4='';var _0x30c944='';var _0x3b947f=_0x4335ef[_0x0d8f('0x7b')];if(_0x53a15a===_0x0d8f('0x7d')){if(_0x0d8f('0x26')!=typeof _0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')][_0x0d8f('0x81')]){var _0x56beaa=_0x4335ef['parameters'][_0x0d8f('0x7f')][_0x0d8f('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x0d8f('0x8e')](_0x56beaa)){_0x28dd10=path[_0x0d8f('0x53')](_0x0d8f('0x8f'),_0x54d347,_0x3cb65c[0x0],_0x56beaa);}else{_0x28dd10=_0x56beaa;}}else{logger[_0x0d8f('0x6a')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')][_0x0d8f('0x82')]){var _0x361277=_0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')][_0x0d8f('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x0d8f('0x8e')](_0x361277)){_0x573bdb=path[_0x0d8f('0x53')]('plugins',_0x54d347,_0x3cb65c[0x0],_0x361277);}else{_0x573bdb=_0x361277;}}else{logger['info'](_0x0d8f('0x90'));}}else if(_0x53a15a===_0x0d8f('0x84')){_0x1f80c4=_0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x85')];_0x30c944=_0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x86')];if(_0x0d8f('0x26')!=typeof _0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')]){if(_0x0d8f('0x26')!=typeof _0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')][_0x0d8f('0x81')]){var _0x56beaa=_0x4335ef[_0x0d8f('0x7e')][_0x0d8f('0x7f')][_0x0d8f('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x0d8f('0x8e')](_0x56beaa)){_0x28dd10=path[_0x0d8f('0x53')]('plugins',_0x54d347,_0x3cb65c[0x0],_0x56beaa);}else{_0x28dd10=_0x56beaa;}}if(_0x0d8f('0x26')!=typeof _0x4335ef[_0x0d8f('0x7e')]['views'][_0x0d8f('0x82')]){var _0x361277=_0x4335ef['parameters'][_0x0d8f('0x7f')][_0x0d8f('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x361277)){_0x573bdb=path[_0x0d8f('0x53')](_0x0d8f('0x8f'),_0x54d347,_0x3cb65c[0x0],_0x361277);}else{_0x573bdb=_0x361277;}}}}var _0x1cd5bb={'name':_0x12e273,'description':_0x4af7ee,'path':path[_0x0d8f('0x53')](_0x54d347,_0x3cb65c[0x0]),'type':_0x53a15a,'sidebar':_0x17e57b,'icon':_0x34438c,'adminUrl':_0x28dd10,'agentUrl':_0x573bdb,'scriptName':_0x1f80c4,'scriptPath':_0x30c944,'version':_0x3b947f};removeReferences(_0x4a3f07,null);return db['Plugin'][_0x0d8f('0x91')](_0x1cd5bb)[_0x0d8f('0x2e')](function(_0x1beaac){var _0x326524={'role':_0xac502e[_0x0d8f('0x92')]['role'],'userProfileId':_0xac502e[_0x0d8f('0x92')][_0x0d8f('0x93')]};if(!_0x326524)throw new Error(_0x0d8f('0x94'));if(_0x326524[_0x0d8f('0x95')]==='user'){var _0x379235=_0x1beaac['get']({'plain':!![]});return db[_0x0d8f('0x96')][_0x0d8f('0x51')]({'where':{'name':_0x0d8f('0x97'),'userProfileId':_0x326524[_0x0d8f('0x93')]},'raw':!![]})[_0x0d8f('0x2e')](function(_0x4f34c6){if(_0x4f34c6&&_0x4f34c6[_0x0d8f('0x98')]===0x0){return db[_0x0d8f('0x30')]['create']({'name':_0x379235[_0x0d8f('0x33')],'resourceId':_0x379235['id'],'type':_0x4f34c6['name'],'sectionId':_0x4f34c6['id']},{})[_0x0d8f('0x2e')](function(){return _0x1beaac;});}else{return _0x1beaac;}})['catch'](function(_0x5b71ed){logger[_0x0d8f('0x31')](_0x0d8f('0x99'),_0x5b71ed);throw _0x5b71ed;});}return _0x1beaac;})[_0x0d8f('0x2e')](respondWithResult(_0x2528b6,null))['catch'](handleError(_0x2528b6,null));}});}catch(_0x5944fa){_0x2528b6['status'](0x1f4)[_0x0d8f('0x34')](_0x5944fa);}};function removeReferences(_0xfe1fb0,_0x259c63){try{if(_0xfe1fb0){fs[_0x0d8f('0x69')](_0xfe1fb0);logger['info'](_0x0d8f('0x9a'));}if(_0x259c63){rimraf(_0x259c63,function(){});logger[_0x0d8f('0x6a')](_0x0d8f('0x9b'));}}catch(_0xb532cd){logger[_0x0d8f('0x31')](_0xb532cd);}}exports[_0x0d8f('0x2d')]=function(_0x2c06f7,_0x3ab79f,_0x43dcf1){return db['Plugin'][_0x0d8f('0x51')]({'where':{'id':_0x2c06f7[_0x0d8f('0x50')]['id']}})[_0x0d8f('0x2e')](handleEntityNotFound(_0x3ab79f,null))[_0x0d8f('0x2e')](saveUpdates(_0x2c06f7[_0x0d8f('0x92')],null))['then'](respondWithResult(_0x3ab79f,null))[_0x0d8f('0x4e')](handleError(_0x3ab79f,null));};exports[_0x0d8f('0x9c')]=function(_0x2bd080,_0x408265,_0x362bf7){return db[_0x0d8f('0x4b')][_0x0d8f('0x51')]({'where':{'id':_0x2bd080[_0x0d8f('0x50')]['id']}})[_0x0d8f('0x2e')](function(_0xbcce2e){if(_0xbcce2e){return _0xbcce2e[_0x0d8f('0x2f')]();}})[_0x0d8f('0x2e')](function(_0x301a76){rimraf(path['join'](config['root'],_0x0d8f('0x55'),path[_0x0d8f('0x5f')](_0x301a76['path'])),function(){});return _0x301a76;})[_0x0d8f('0x2e')](handleEntityNotFound(_0x408265,null))[_0x0d8f('0x2e')](respondWithStatusCode(_0x408265,null))[_0x0d8f('0x4e')](handleError(_0x408265,null));};exports['webhookGet']=function(_0x25b565,_0x246037,_0x31496a){return BPromise[_0x0d8f('0x9d')]()['then'](function(){if(!_0x25b565['query'][_0x0d8f('0x9')]){throw new Error(_0x0d8f('0x9e'));}if(!_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x21a592=_0x25b565['query']['hostname']?_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0xa0')]+':'+_0x25b565[_0x0d8f('0x3a')]['port']:_0x0d8f('0xa1')+_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0x9f')];var _0x43231f=_0x25b565['query'][_0x0d8f('0x24')]?_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0x24')]:!![];var _0x1d4858=_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0xa2')]?_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0xa2')]:null;var _0x523c6d={'method':_0x25b565['method'],'uri':util[_0x0d8f('0x56')](_0x0d8f('0xa3'),_0x21a592,_0x25b565[_0x0d8f('0x3a')][_0x0d8f('0x9')]),'json':_0x43231f,'resolveWithFullResponse':!![],'encoding':_0x1d4858,'qs':_0x25b565[_0x0d8f('0x3a')]};if(_0x25b565[_0x0d8f('0xa4')]){_0x523c6d[_0x0d8f('0xa4')]=_0x25b565['headers'];if(_0x523c6d[_0x0d8f('0xa4')][_0x0d8f('0xa5')]){delete _0x523c6d[_0x0d8f('0xa4')][_0x0d8f('0xa5')];}}if(_0x523c6d[_0x0d8f('0xa4')][_0x0d8f('0xa6')]){delete _0x523c6d['headers'][_0x0d8f('0xa6')];}return rp(_0x523c6d);})[_0x0d8f('0x2e')](function(_0x1bd9fc){if(_0x1bd9fc){_0x246037[_0x0d8f('0x2a')](_0x1bd9fc[_0x0d8f('0xa4')]);logger[_0x0d8f('0x6a')](_0x1bd9fc[_0x0d8f('0x92')]);if(_['endsWith'](_0x25b565[_0x0d8f('0x3a')]['path'],_0x0d8f('0x52'))&&_0x1bd9fc[_0x0d8f('0xa7')]==0x1f4){return _0x246037[_0x0d8f('0x22')](_0x1bd9fc['statusCode']);}else{return _0x246037[_0x0d8f('0x29')](_0x1bd9fc[_0x0d8f('0xa7')])[_0x0d8f('0x34')](_0x1bd9fc[_0x0d8f('0x92')]);}}else{return _0x246037[_0x0d8f('0x22')](0xc8);}})[_0x0d8f('0x4e')](handleError(_0x246037,null));};exports[_0x0d8f('0xa8')]=function(_0x34f8e0,_0x39db1,_0x32b883){return BPromise[_0x0d8f('0x9d')]()[_0x0d8f('0x2e')](function(){if(!_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0x9')]){throw new Error(_0x0d8f('0x9e'));}if(!_0x34f8e0['query'][_0x0d8f('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x399b31=_0x34f8e0[_0x0d8f('0x3a')]['hostname']?_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0xa0')]+':'+_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0x9f')]:_0x0d8f('0xa1')+_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0x9f')];var _0x46f86a=_0x34f8e0['query'][_0x0d8f('0x24')]?_0x34f8e0[_0x0d8f('0x3a')]['json']:!![];var _0x45c53c=_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0xa2')]?_0x34f8e0['query'][_0x0d8f('0xa2')]:null;var _0x4e994f={'method':_0x34f8e0[_0x0d8f('0xa9')],'uri':util[_0x0d8f('0x56')](_0x0d8f('0xa3'),_0x399b31,_0x34f8e0[_0x0d8f('0x3a')][_0x0d8f('0x9')]),'json':_0x46f86a,'resolveWithFullResponse':!![],'encoding':_0x45c53c,'body':_0x34f8e0[_0x0d8f('0x92')]};if(_0x34f8e0[_0x0d8f('0xa4')]){_0x4e994f[_0x0d8f('0xa4')]=_0x34f8e0[_0x0d8f('0xa4')];if(_0x4e994f[_0x0d8f('0xa4')][_0x0d8f('0xa5')]){delete _0x4e994f['headers']['content-length'];}}if(_0x4e994f[_0x0d8f('0xa4')]['content-type']){delete _0x4e994f['headers'][_0x0d8f('0xa6')];}return rp(_0x4e994f);})[_0x0d8f('0x2e')](function(_0x346f27){if(_0x346f27){_0x39db1[_0x0d8f('0x2a')](_0x346f27['headers']);logger[_0x0d8f('0x6a')](_0x346f27[_0x0d8f('0x92')]);return _0x39db1[_0x0d8f('0x29')](_0x346f27['statusCode'])[_0x0d8f('0x34')](_0x346f27[_0x0d8f('0x92')]);}else{return _0x39db1[_0x0d8f('0x22')](0xc8);}})['catch'](handleError(_0x39db1,null));}; \ No newline at end of file +var _0x77d7=['desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','Plugin','includeAll','findAll','catch','show','params','length','include','find','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','node_modules/**/*','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','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','get','Plugins','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','%s%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x77d7,0x9e));var _0x777d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x77d7[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x777d('0x0'));var jsonpatch=require(_0x777d('0x1'));var rp=require(_0x777d('0x2'));var moment=require(_0x777d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x777d('0x4'));var util=require(_0x777d('0x5'));var path=require(_0x777d('0x6'));var sox=require('sox');var csv=require(_0x777d('0x7'));var ejs=require(_0x777d('0x8'));var fs=require('fs');var fs_extra=require(_0x777d('0x9'));var _=require(_0x777d('0xa'));var squel=require(_0x777d('0xb'));var crypto=require(_0x777d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x777d('0xd'));var toCsv=require(_0x777d('0x7'));var querystring=require(_0x777d('0xe'));var Papa=require(_0x777d('0xf'));var extract=require(_0x777d('0x10'));var rimraf=require(_0x777d('0x11'));var archiver=require(_0x777d('0x12'));var Redis=require(_0x777d('0x13'));var authService=require(_0x777d('0x14'));var qs=require(_0x777d('0x15'));var as=require(_0x777d('0x16'));var hardwareService=require(_0x777d('0x17'));var logger=require(_0x777d('0x18'))(_0x777d('0x19'));var utils=require('../../config/utils');var config=require(_0x777d('0x1a'));var licenseUtil=require(_0x777d('0x1b'));var db=require('../../mysqldb')['db'];config[_0x777d('0x1c')]=_[_0x777d('0x1d')](config[_0x777d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x777d('0x1c')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x1972cc,_0x82442d){_0x82442d=_0x82442d||0xcc;return function(_0xdcfe0f){if(_0xdcfe0f){return _0x1972cc[_0x777d('0x1e')](_0x82442d);}return _0x1972cc[_0x777d('0x1f')](_0x82442d)[_0x777d('0x20')]();};}function respondWithResult(_0x5523c4,_0x246fb6){_0x246fb6=_0x246fb6||0xc8;return function(_0x45327d){if(_0x45327d){return _0x5523c4['status'](_0x246fb6)[_0x777d('0x21')](_0x45327d);}};}function respondWithFilteredResult(_0xe6528e,_0x21a123){return function(_0x565170){if(_0x565170){var _0x55ba30=typeof _0x21a123['offset']==='undefined'&&typeof _0x21a123[_0x777d('0x22')]===_0x777d('0x23');var _0x7c6fc1=_0x565170[_0x777d('0x24')];var _0x21b4c2=_0x55ba30?0x0:_0x21a123[_0x777d('0x25')];var _0x4097d1=_0x55ba30?_0x565170['count']:_0x21a123[_0x777d('0x25')]+_0x21a123[_0x777d('0x22')];var _0x4f3241;if(_0x4097d1>=_0x7c6fc1){_0x4097d1=_0x7c6fc1;_0x4f3241=0xc8;}else{_0x4f3241=0xce;}_0xe6528e['status'](_0x4f3241);return _0xe6528e[_0x777d('0x26')](_0x777d('0x27'),_0x21b4c2+'-'+_0x4097d1+'/'+_0x7c6fc1)[_0x777d('0x21')](_0x565170);}return null;};}function patchUpdates(_0x22baef){return function(_0x5220ca){try{jsonpatch[_0x777d('0x28')](_0x5220ca,_0x22baef,!![]);}catch(_0x3c275b){return BPromise[_0x777d('0x29')](_0x3c275b);}return _0x5220ca[_0x777d('0x2a')]();};}function saveUpdates(_0x12b1f7,_0xd77db4){return function(_0x130097){if(_0x130097){return _0x130097[_0x777d('0x2b')](_0x12b1f7)[_0x777d('0x2c')](function(_0x39e76f){return _0x39e76f;});}return null;};}function removeEntity(_0x5f1994,_0x474381){return function(_0x58ae27){if(_0x58ae27){return _0x58ae27[_0x777d('0x2d')]()['then'](function(){var _0x4743ac=_0x58ae27['get']({'plain':!![]});var _0x4181d9='Plugins';return db[_0x777d('0x2e')]['destroy']({'where':{'type':_0x4181d9,'resourceId':_0x4743ac['id']}})[_0x777d('0x2c')](function(){return _0x58ae27;});})['then'](function(){_0x5f1994[_0x777d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x427001,_0x4f968e){return function(_0x3b7e57){if(!_0x3b7e57){_0x427001[_0x777d('0x1e')](0x194);}return _0x3b7e57;};}function handleError(_0x336ead,_0x5daf77){_0x5daf77=_0x5daf77||0x1f4;return function(_0x5b52a4){logger['error'](_0x5b52a4[_0x777d('0x2f')]);if(_0x5b52a4[_0x777d('0x30')]){delete _0x5b52a4['name'];}_0x336ead[_0x777d('0x1f')](_0x5daf77)[_0x777d('0x31')](_0x5b52a4);};}exports[_0x777d('0x32')]=function(_0x7b9107,_0x33f067){var _0x226f4a={},_0x5a4a1d={},_0x3c16eb={'count':0x0,'rows':[]};var _0x386d73=_[_0x777d('0x33')](db['Plugin'][_0x777d('0x34')],function(_0x3c1d81){return{'name':_0x3c1d81[_0x777d('0x35')],'type':_0x3c1d81[_0x777d('0x36')][_0x777d('0x37')]};});_0x5a4a1d[_0x777d('0x38')]=_[_0x777d('0x33')](_0x386d73,_0x777d('0x30'));_0x5a4a1d[_0x777d('0x39')]=_[_0x777d('0x3a')](_0x7b9107[_0x777d('0x39')]);_0x5a4a1d[_0x777d('0x3b')]=_[_0x777d('0x3c')](_0x5a4a1d[_0x777d('0x38')],_0x5a4a1d[_0x777d('0x39')]);_0x226f4a[_0x777d('0x3d')]=_['intersection'](_0x5a4a1d[_0x777d('0x38')],qs[_0x777d('0x3e')](_0x7b9107[_0x777d('0x39')][_0x777d('0x3e')]));_0x226f4a['attributes']=_0x226f4a[_0x777d('0x3d')]['length']?_0x226f4a['attributes']:_0x5a4a1d[_0x777d('0x38')];if(!_0x7b9107[_0x777d('0x39')][_0x777d('0x3f')]('nolimit')){_0x226f4a[_0x777d('0x22')]=qs[_0x777d('0x22')](_0x7b9107['query'][_0x777d('0x22')]);_0x226f4a[_0x777d('0x25')]=qs[_0x777d('0x25')](_0x7b9107[_0x777d('0x39')]['offset']);}_0x226f4a[_0x777d('0x40')]=qs[_0x777d('0x41')](_0x7b9107['query'][_0x777d('0x41')]);_0x226f4a[_0x777d('0x42')]=qs['filters'](_[_0x777d('0x43')](_0x7b9107[_0x777d('0x39')],_0x5a4a1d[_0x777d('0x3b')]),_0x386d73);if(_0x7b9107[_0x777d('0x39')][_0x777d('0x44')]){_0x226f4a[_0x777d('0x42')]=_['merge'](_0x226f4a[_0x777d('0x42')],{'$or':_[_0x777d('0x33')](_0x386d73,function(_0x4795a5){if(_0x4795a5[_0x777d('0x36')]!==_0x777d('0x45')){var _0x2b7585={};_0x2b7585[_0x4795a5[_0x777d('0x30')]]={'$like':'%'+_0x7b9107[_0x777d('0x39')]['filter']+'%'};return _0x2b7585;}})});}_0x226f4a=_[_0x777d('0x46')]({},_0x226f4a,_0x7b9107['options']);var _0x1e9ac8={'where':_0x226f4a[_0x777d('0x42')]};return db[_0x777d('0x47')]['count'](_0x1e9ac8)[_0x777d('0x2c')](function(_0x3016a4){_0x3c16eb[_0x777d('0x24')]=_0x3016a4;if(_0x7b9107[_0x777d('0x39')][_0x777d('0x48')]){_0x226f4a['include']=[{'all':!![]}];}return db[_0x777d('0x47')][_0x777d('0x49')](_0x226f4a);})['then'](function(_0x50b510){_0x3c16eb['rows']=_0x50b510;return _0x3c16eb;})['then'](respondWithFilteredResult(_0x33f067,_0x226f4a))[_0x777d('0x4a')](handleError(_0x33f067,null));};exports[_0x777d('0x4b')]=function(_0x58b1a5,_0x40dac5){var _0x1c8404={'raw':!![],'where':{'id':_0x58b1a5[_0x777d('0x4c')]['id']}},_0xa3f34c={};_0xa3f34c[_0x777d('0x38')]=_['keys'](db[_0x777d('0x47')][_0x777d('0x34')]);_0xa3f34c[_0x777d('0x39')]=_['keys'](_0x58b1a5[_0x777d('0x39')]);_0xa3f34c[_0x777d('0x3b')]=_['intersection'](_0xa3f34c[_0x777d('0x38')],_0xa3f34c[_0x777d('0x39')]);_0x1c8404[_0x777d('0x3d')]=_[_0x777d('0x3c')](_0xa3f34c[_0x777d('0x38')],qs[_0x777d('0x3e')](_0x58b1a5[_0x777d('0x39')][_0x777d('0x3e')]));_0x1c8404[_0x777d('0x3d')]=_0x1c8404[_0x777d('0x3d')][_0x777d('0x4d')]?_0x1c8404[_0x777d('0x3d')]:_0xa3f34c[_0x777d('0x38')];if(_0x58b1a5[_0x777d('0x39')]['includeAll']){_0x1c8404[_0x777d('0x4e')]=[{'all':!![]}];}_0x1c8404=_[_0x777d('0x46')]({},_0x1c8404,_0x58b1a5['options']);return db[_0x777d('0x47')][_0x777d('0x4f')](_0x1c8404)[_0x777d('0x2c')](handleEntityNotFound(_0x40dac5,null))[_0x777d('0x2c')](respondWithResult(_0x40dac5,null))[_0x777d('0x4a')](handleError(_0x40dac5,null));};exports[_0x777d('0x50')]=function(_0x5f21d1,_0x2a04c7,_0x386950){return db['Plugin']['find']({'where':{'id':_0x5f21d1[_0x777d('0x4c')]['id']},'attributes':[_0x777d('0x30'),_0x777d('0x6')],'raw':!![]})[_0x777d('0x2c')](handleEntityNotFound(_0x2a04c7,null))[_0x777d('0x2c')](function(_0x18c36e){if(_0x18c36e){var _0x2ccf31=path[_0x777d('0x51')](config['root'],_0x777d('0x52'),util[_0x777d('0x53')](_0x777d('0x54'),path[_0x777d('0x55')](_0x18c36e[_0x777d('0x6')])));var _0xbeaa8a=fs[_0x777d('0x56')](_0x2ccf31);var _0x475ef5=archiver(_0x777d('0x57'),{'zlib':{'level':0x9}});_0x475ef5['on'](_0x777d('0x58'),function(_0x321e46){if(_0x321e46[_0x777d('0x59')]==='ENOENT'){logger[_0x777d('0x5a')](_0x321e46);}else{throw new db[(_0x777d('0x5b'))][(_0x777d('0x5c'))](_0x777d('0x5d'));}});_0x475ef5['on']('error',function(_0x2a9a62){throw new db[(_0x777d('0x5b'))]['Error'](_0x777d('0x5d'));});_0x475ef5[_0x777d('0x5e')](_0xbeaa8a);_0x475ef5['glob'](_0x777d('0x5f'),{'cwd':path['join'](config[_0x777d('0x60')],_0x777d('0x52'),path[_0x777d('0x61')](_0x18c36e['path'])),'ignore':[path[_0x777d('0x51')](path[_0x777d('0x55')](_0x18c36e[_0x777d('0x6')]),_0x777d('0x62')),path[_0x777d('0x51')](path['basename'](_0x18c36e[_0x777d('0x6')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0xbeaa8a['on'](_0x777d('0x63'),function(){if(!fs['existsSync'](_0x2ccf31)){throw new db[(_0x777d('0x5b'))][(_0x777d('0x5c'))](_0x777d('0x64'));}return _0x2a04c7[_0x777d('0x50')](_0x2ccf31,util[_0x777d('0x53')]('%s.zip',path[_0x777d('0x55')](_0x18c36e[_0x777d('0x6')])),function(_0x54c8ff){if(_0x54c8ff){throw new db[(_0x777d('0x5b'))]['Error'](_0x777d('0x65'));}fs[_0x777d('0x66')](_0x2ccf31);logger[_0x777d('0x67')]('Download\x20completed');logger[_0x777d('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0x777d('0x4a')](handleError(_0x2a04c7,null));};exports['upload']=function(_0x259e2e,_0x40cf1f,_0x124cfa){var _0x2375b2=path['basename'](_0x259e2e[_0x777d('0x68')][_0x777d('0x69')],path[_0x777d('0x6a')](_0x259e2e['file'][_0x777d('0x69')]));var _0x4f3b5b=path[_0x777d('0x51')](config[_0x777d('0x60')],_0x777d('0x52'),_0x259e2e[_0x777d('0x68')]['filename']);var _0xc5acce=path[_0x777d('0x51')](config['root'],'server/files/plugins',_0x2375b2);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x4f3b5b);logger[_0x777d('0x67')](_0x777d('0x6b'),_0xc5acce);try{fs[_0x777d('0x6c')](_0x4f3b5b,parseInt(_0x777d('0x6d'),0x8));extract(_0x4f3b5b,{'dir':_0xc5acce},function(_0x13ecb3){if(_0x13ecb3){logger['error'](_0x13ecb3);handleError(_0x13ecb3,!![]);};var _0x166dfb=fs[_0x777d('0x6e')](_0xc5acce);if(_0x166dfb[_0x777d('0x4d')]>0x1){removeReferences(_0x4f3b5b,_0xc5acce);logger[_0x777d('0x5a')](_0x777d('0x6f'));return _0x124cfa(new Error(_0x777d('0x6f')));}var _0x5e52a0=fs[_0x777d('0x70')](path[_0x777d('0x51')](_0xc5acce,_0x166dfb[0x0]));if(_0x5e52a0[_0x777d('0x71')]()){removeReferences(_0x4f3b5b,_0xc5acce);logger[_0x777d('0x5a')]('Invalid\x20plugin\x20structure');return _0x124cfa(new Error('Invalid\x20plugin\x20structure'));}if(_0x5e52a0[_0x777d('0x72')]()){var _0x31105d=fs[_0x777d('0x6e')](path[_0x777d('0x51')](_0xc5acce,_0x166dfb[0x0]));if(_0x31105d[_0x777d('0x4d')]===0x0){removeReferences(_0x4f3b5b,_0xc5acce);logger[_0x777d('0x5a')](_0x777d('0x6f'));return _0x124cfa(new Error('Invalid\x20plugin\x20structure'));}var _0x2c22de=_0x31105d[_0x777d('0x73')](function(_0x8b558){return _0x8b558===_0x777d('0x74');});if(!_0x2c22de){return _0x124cfa(new Error(_0x777d('0x75')));}var _0x28b518=fs['readFileSync'](path[_0x777d('0x51')](_0xc5acce,_0x166dfb[0x0],'manifest.json'));var _0x4c9331=JSON['parse'](_0x28b518);if(_0x777d('0x23')==typeof _0x4c9331[_0x777d('0x30')]){return _0x124cfa(new Error(_0x777d('0x76')));}if(_0x777d('0x23')==typeof _0x4c9331[_0x777d('0x36')]){return _0x124cfa(new Error(_0x777d('0x77')));}if('undefined'==typeof _0x4c9331[_0x777d('0x78')]){return _0x124cfa(new Error(_0x777d('0x79')));}if(_0x777d('0x23')==typeof _0x4c9331[_0x777d('0x7a')]){return _0x124cfa(new Error(_0x777d('0x7b')));}if(_0x4c9331['type']===_0x777d('0x7c')){if(_0x777d('0x23')==typeof _0x4c9331['parameters'][_0x777d('0x7d')]){return _0x124cfa(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x4c9331['parameters'][_0x777d('0x7d')][_0x777d('0x7e')]&&_0x777d('0x23')==typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7f')]){return _0x124cfa(new Error(_0x777d('0x80')));}}else if(_0x4c9331[_0x777d('0x36')]===_0x777d('0x81')){if('undefined'==typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x82')]){return _0x124cfa(new Error(_0x777d('0x83')));}if(_0x777d('0x23')==typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x84')]){return _0x124cfa(new Error(_0x777d('0x85')));}}else{return _0x124cfa(new Error(_0x777d('0x86')));}var _0x5d1c1b=_0x4c9331[_0x777d('0x30')];var _0x5201ae=_0x4c9331[_0x777d('0x87')];var _0x100d38=_0x4c9331[_0x777d('0x36')];var _0x8b64d5=_0x4c9331[_0x777d('0x88')]?_0x4c9331[_0x777d('0x88')]:_0x777d('0x89');var _0x1426c0=_0x4c9331[_0x777d('0x8a')]?_0x4c9331[_0x777d('0x8a')]:_0x777d('0x8b');var _0x2f37ce='';var _0x47736a='';var _0x7e709='';var _0x5a4aa1='';var _0x37f286=_0x4c9331[_0x777d('0x78')];if(_0x100d38===_0x777d('0x7c')){if(_0x777d('0x23')!=typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7e')]){var _0x433422=_0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x777d('0x8c')](_0x433422)){_0x2f37ce=path[_0x777d('0x51')](_0x777d('0x8d'),_0x2375b2,_0x166dfb[0x0],_0x433422);}else{_0x2f37ce=_0x433422;}}else{logger['info'](_0x777d('0x8e'));}if(_0x777d('0x23')!=typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7f')]){var _0x43e5a9=_0x4c9331[_0x777d('0x7a')]['views'][_0x777d('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x777d('0x8c')](_0x43e5a9)){_0x47736a=path['join'](_0x777d('0x8d'),_0x2375b2,_0x166dfb[0x0],_0x43e5a9);}else{_0x47736a=_0x43e5a9;}}else{logger['info'](_0x777d('0x8f'));}}else if(_0x100d38===_0x777d('0x81')){_0x7e709=_0x4c9331[_0x777d('0x7a')][_0x777d('0x82')];_0x5a4aa1=_0x4c9331[_0x777d('0x7a')][_0x777d('0x84')];if('undefined'!=typeof _0x4c9331[_0x777d('0x7a')]['views']){if('undefined'!=typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7e')]){var _0x433422=_0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x777d('0x8c')](_0x433422)){_0x2f37ce=path[_0x777d('0x51')](_0x777d('0x8d'),_0x2375b2,_0x166dfb[0x0],_0x433422);}else{_0x2f37ce=_0x433422;}}if('undefined'!=typeof _0x4c9331[_0x777d('0x7a')][_0x777d('0x7d')][_0x777d('0x7f')]){var _0x43e5a9=_0x4c9331['parameters'][_0x777d('0x7d')][_0x777d('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x43e5a9)){_0x47736a=path[_0x777d('0x51')](_0x777d('0x8d'),_0x2375b2,_0x166dfb[0x0],_0x43e5a9);}else{_0x47736a=_0x43e5a9;}}}}var _0x14cdbc={'name':_0x5d1c1b,'description':_0x5201ae,'path':path[_0x777d('0x51')](_0x2375b2,_0x166dfb[0x0]),'type':_0x100d38,'sidebar':_0x8b64d5,'icon':_0x1426c0,'adminUrl':_0x2f37ce,'agentUrl':_0x47736a,'scriptName':_0x7e709,'scriptPath':_0x5a4aa1,'version':_0x37f286};removeReferences(_0x4f3b5b,null);return db[_0x777d('0x47')][_0x777d('0x90')](_0x14cdbc)[_0x777d('0x2c')](function(_0x4985d8){var _0x157820={'role':_0x259e2e[_0x777d('0x91')][_0x777d('0x92')],'userProfileId':_0x259e2e[_0x777d('0x91')][_0x777d('0x93')]};if(!_0x157820)throw new Error(_0x777d('0x94'));if(_0x157820[_0x777d('0x92')]==='user'){var _0x428443=_0x4985d8[_0x777d('0x95')]({'plain':!![]});return db['UserProfileSection'][_0x777d('0x4f')]({'where':{'name':_0x777d('0x96'),'userProfileId':_0x157820[_0x777d('0x93')]},'raw':!![]})[_0x777d('0x2c')](function(_0x21f4b2){if(_0x21f4b2&&_0x21f4b2[_0x777d('0x97')]===0x0){return db[_0x777d('0x2e')][_0x777d('0x90')]({'name':_0x428443['name'],'resourceId':_0x428443['id'],'type':_0x21f4b2[_0x777d('0x30')],'sectionId':_0x21f4b2['id']},{})[_0x777d('0x2c')](function(){return _0x4985d8;});}else{return _0x4985d8;}})[_0x777d('0x4a')](function(_0x3afd60){logger[_0x777d('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3afd60);throw _0x3afd60;});}return _0x4985d8;})[_0x777d('0x2c')](respondWithResult(_0x40cf1f,null))['catch'](handleError(_0x40cf1f,null));}});}catch(_0x337207){_0x40cf1f['status'](0x1f4)[_0x777d('0x31')](_0x337207);}};function removeReferences(_0x277e1c,_0x4a7798){try{if(_0x277e1c){fs[_0x777d('0x66')](_0x277e1c);logger['info'](_0x777d('0x98'));}if(_0x4a7798){rimraf(_0x4a7798,function(){});logger[_0x777d('0x67')](_0x777d('0x99'));}}catch(_0x275659){logger['error'](_0x275659);}}exports[_0x777d('0x2b')]=function(_0x330498,_0x50b30b,_0x4f6ec6){return db[_0x777d('0x47')][_0x777d('0x4f')]({'where':{'id':_0x330498['params']['id']}})[_0x777d('0x2c')](handleEntityNotFound(_0x50b30b,null))[_0x777d('0x2c')](saveUpdates(_0x330498[_0x777d('0x91')],null))[_0x777d('0x2c')](respondWithResult(_0x50b30b,null))[_0x777d('0x4a')](handleError(_0x50b30b,null));};exports[_0x777d('0x9a')]=function(_0x575450,_0x160a67,_0x145ee9){return db[_0x777d('0x47')]['find']({'where':{'id':_0x575450[_0x777d('0x4c')]['id']}})[_0x777d('0x2c')](function(_0x4ca181){if(_0x4ca181){return _0x4ca181[_0x777d('0x2d')]();}})[_0x777d('0x2c')](function(_0x1ac3c1){rimraf(path['join'](config['root'],'server/files/plugins',path['dirname'](_0x1ac3c1[_0x777d('0x6')])),function(){});return _0x1ac3c1;})[_0x777d('0x2c')](handleEntityNotFound(_0x160a67,null))['then'](respondWithStatusCode(_0x160a67,null))[_0x777d('0x4a')](handleError(_0x160a67,null));};exports[_0x777d('0x9b')]=function(_0x519fc3,_0x1b3223,_0x351765){return BPromise[_0x777d('0x9c')]()[_0x777d('0x2c')](function(){if(!_0x519fc3['query'][_0x777d('0x6')]){throw new Error(_0x777d('0x9d'));}if(!_0x519fc3[_0x777d('0x39')][_0x777d('0x9e')]){throw new Error(_0x777d('0x9f'));}var _0x2d16ed=_0x519fc3[_0x777d('0x39')][_0x777d('0xa0')]?_0x519fc3[_0x777d('0x39')][_0x777d('0xa0')]+':'+_0x519fc3[_0x777d('0x39')][_0x777d('0x9e')]:'http://localhost:'+_0x519fc3[_0x777d('0x39')][_0x777d('0x9e')];var _0x54b8b1=_0x519fc3[_0x777d('0x39')][_0x777d('0x21')]?_0x519fc3['query'][_0x777d('0x21')]:!![];var _0x372229=_0x519fc3[_0x777d('0x39')][_0x777d('0xa1')]?_0x519fc3['query'][_0x777d('0xa1')]:null;var _0x1e82c3={'method':_0x519fc3[_0x777d('0xa2')],'uri':util[_0x777d('0x53')]('%s%s',_0x2d16ed,_0x519fc3[_0x777d('0x39')]['path']),'json':_0x54b8b1,'resolveWithFullResponse':!![],'encoding':_0x372229,'qs':_0x519fc3['query']};if(_0x519fc3[_0x777d('0xa3')]){_0x1e82c3['headers']=_0x519fc3[_0x777d('0xa3')];if(_0x1e82c3[_0x777d('0xa3')][_0x777d('0xa4')]){delete _0x1e82c3['headers'][_0x777d('0xa4')];}}if(_0x1e82c3['headers'][_0x777d('0xa5')]){delete _0x1e82c3[_0x777d('0xa3')][_0x777d('0xa5')];}return rp(_0x1e82c3);})['then'](function(_0x722117){if(_0x722117){_0x1b3223[_0x777d('0x26')](_0x722117[_0x777d('0xa3')]);logger[_0x777d('0x67')](_0x722117[_0x777d('0x91')]);if(_[_0x777d('0xa6')](_0x519fc3[_0x777d('0x39')][_0x777d('0x6')],_0x777d('0x50'))&&_0x722117['statusCode']==0x1f4){return _0x1b3223[_0x777d('0x1e')](_0x722117[_0x777d('0xa7')]);}else{return _0x1b3223[_0x777d('0x1f')](_0x722117[_0x777d('0xa7')])[_0x777d('0x31')](_0x722117['body']);}}else{return _0x1b3223[_0x777d('0x1e')](0xc8);}})[_0x777d('0x4a')](handleError(_0x1b3223,null));};exports[_0x777d('0xa8')]=function(_0x48bfc9,_0x141314,_0xec41fb){return BPromise[_0x777d('0x9c')]()[_0x777d('0x2c')](function(){if(!_0x48bfc9[_0x777d('0x39')][_0x777d('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x48bfc9[_0x777d('0x39')][_0x777d('0x9e')]){throw new Error(_0x777d('0x9f'));}var _0x46af20=_0x48bfc9[_0x777d('0x39')][_0x777d('0xa0')]?_0x48bfc9[_0x777d('0x39')][_0x777d('0xa0')]+':'+_0x48bfc9[_0x777d('0x39')]['port']:_0x777d('0xa9')+_0x48bfc9[_0x777d('0x39')][_0x777d('0x9e')];var _0x58222d=_0x48bfc9[_0x777d('0x39')][_0x777d('0x21')]?_0x48bfc9[_0x777d('0x39')][_0x777d('0x21')]:!![];var _0x1fb351=_0x48bfc9['query'][_0x777d('0xa1')]?_0x48bfc9[_0x777d('0x39')][_0x777d('0xa1')]:null;var _0x54120c={'method':_0x48bfc9[_0x777d('0xa2')],'uri':util[_0x777d('0x53')](_0x777d('0xaa'),_0x46af20,_0x48bfc9[_0x777d('0x39')][_0x777d('0x6')]),'json':_0x58222d,'resolveWithFullResponse':!![],'encoding':_0x1fb351,'body':_0x48bfc9[_0x777d('0x91')]};if(_0x48bfc9[_0x777d('0xa3')]){_0x54120c[_0x777d('0xa3')]=_0x48bfc9['headers'];if(_0x54120c[_0x777d('0xa3')][_0x777d('0xa4')]){delete _0x54120c[_0x777d('0xa3')]['content-length'];}}if(_0x54120c[_0x777d('0xa3')]['content-type']){delete _0x54120c[_0x777d('0xa3')][_0x777d('0xa5')];}return rp(_0x54120c);})[_0x777d('0x2c')](function(_0x986518){if(_0x986518){_0x141314[_0x777d('0x26')](_0x986518['headers']);logger[_0x777d('0x67')](_0x986518[_0x777d('0x91')]);return _0x141314['status'](_0x986518['statusCode'])[_0x777d('0x31')](_0x986518['body']);}else{return _0x141314[_0x777d('0x1e')](0xc8);}})[_0x777d('0x4a')](handleError(_0x141314,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 6159e0e..b061098 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 _0xfb67=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hook'];(function(_0x23bfa4,_0x356360){var _0x174e06=function(_0xdad3d7){while(--_0xdad3d7){_0x23bfa4['push'](_0x23bfa4['shift']());}};_0x174e06(++_0x356360);}(_0xfb67,0xdd));var _0x7fb6=function(_0x25a123,_0x550c57){_0x25a123=_0x25a123-0x0;var _0xf5e6e6=_0xfb67[_0x25a123];return _0xf5e6e6;};'use strict';var EventEmitter=require(_0x7fb6('0x0'));var Plugin=require(_0x7fb6('0x1'))['db'][_0x7fb6('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7fb6('0x3')](0x0);var events={'afterCreate':_0x7fb6('0x4'),'afterUpdate':_0x7fb6('0x5'),'afterDestroy':_0x7fb6('0x6')};function emitEvent(_0x5db5cf){return function(_0x40c3ce,_0x29dadc,_0x1c528e){PluginEvents[_0x7fb6('0x7')](_0x5db5cf+':'+_0x40c3ce['id'],_0x40c3ce);PluginEvents[_0x7fb6('0x7')](_0x5db5cf,_0x40c3ce);_0x1c528e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x7fb6('0x8')](e,emitEvent(event));}}module[_0x7fb6('0x9')]=PluginEvents; \ No newline at end of file +var _0xed5f=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb','Plugin'];(function(_0x5d4eaf,_0x979935){var _0x126415=function(_0x5a9e4a){while(--_0x5a9e4a){_0x5d4eaf['push'](_0x5d4eaf['shift']());}};_0x126415(++_0x979935);}(_0xed5f,0x1e6));var _0xfed5=function(_0x1fd2ba,_0x3dbdc3){_0x1fd2ba=_0x1fd2ba-0x0;var _0x4c9d98=_0xed5f[_0x1fd2ba];return _0x4c9d98;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xfed5('0x0'))['db'][_0xfed5('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xfed5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfed5('0x3'),'afterDestroy':_0xfed5('0x4')};function emitEvent(_0x387c6e){return function(_0x1e5aae,_0x5df01a,_0x1abffa){PluginEvents[_0xfed5('0x5')](_0x387c6e+':'+_0x1e5aae['id'],_0x1e5aae);PluginEvents[_0xfed5('0x5')](_0x387c6e,_0x1e5aae);_0x1abffa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xfed5('0x6')](e,emitEvent(event));}}module[_0xfed5('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 bbd3a08..9a68ed1 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 _0x9b31=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','lodash','util','api','moment'];(function(_0x127860,_0x3392c8){var _0x4f40ec=function(_0x3029a0){while(--_0x3029a0){_0x127860['push'](_0x127860['shift']());}};_0x4f40ec(++_0x3392c8);}(_0x9b31,0x104));var _0x19b3=function(_0x3bdb7e,_0x33702f){_0x3bdb7e=_0x3bdb7e-0x0;var _0x4b3cd3=_0x9b31[_0x3bdb7e];return _0x4b3cd3;};'use strict';var _=require(_0x19b3('0x0'));var util=require(_0x19b3('0x1'));var logger=require('../../config/logger')(_0x19b3('0x2'));var moment=require(_0x19b3('0x3'));var BPromise=require(_0x19b3('0x4'));var rp=require(_0x19b3('0x5'));var fs=require('fs');var path=require(_0x19b3('0x6'));var rimraf=require(_0x19b3('0x7'));var config=require(_0x19b3('0x8'));var attributes=require(_0x19b3('0x9'));module['exports']=function(_0x497af,_0xbd3986){return _0x497af[_0x19b3('0xa')](_0x19b3('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa535=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Plugin'];(function(_0x2d05cf,_0x58750d){var _0x36421a=function(_0x45e48c){while(--_0x45e48c){_0x2d05cf['push'](_0x2d05cf['shift']());}};_0x36421a(++_0x58750d);}(_0xa535,0x1ad));var _0x5a53=function(_0x44bb8c,_0x2ae84f){_0x44bb8c=_0x44bb8c-0x0;var _0x33ece4=_0xa535[_0x44bb8c];return _0x33ece4;};'use strict';var _=require(_0x5a53('0x0'));var util=require(_0x5a53('0x1'));var logger=require(_0x5a53('0x2'))(_0x5a53('0x3'));var moment=require(_0x5a53('0x4'));var BPromise=require(_0x5a53('0x5'));var rp=require(_0x5a53('0x6'));var fs=require('fs');var path=require(_0x5a53('0x7'));var rimraf=require(_0x5a53('0x8'));var config=require(_0x5a53('0x9'));var attributes=require('./plugin.attributes');module[_0x5a53('0xa')]=function(_0x17da54,_0x1123ff){return _0x17da54[_0x5a53('0xb')](_0x5a53('0xc'),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 ed5af82..a77cd3a 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 _0x9a75=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','body','options','raw','debug','lodash','util','moment','ioredis'];(function(_0x54468f,_0x3faf9e){var _0x574590=function(_0x4eee74){while(--_0x4eee74){_0x54468f['push'](_0x54468f['shift']());}};_0x574590(++_0x3faf9e);}(_0x9a75,0xf1));var _0x59a7=function(_0x1846be,_0x1ed5bd){_0x1846be=_0x1846be-0x0;var _0x46d49d=_0x9a75[_0x1846be];return _0x46d49d;};'use strict';var _=require(_0x59a7('0x0'));var util=require(_0x59a7('0x1'));var moment=require(_0x59a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59a7('0x3'));var db=require(_0x59a7('0x4'))['db'];var utils=require(_0x59a7('0x5'));var logger=require(_0x59a7('0x6'))(_0x59a7('0x7'));var config=require(_0x59a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x59a7('0x9')][_0x59a7('0xa')]({'port':0x232a});config['redis']=_[_0x59a7('0xb')](config[_0x59a7('0xc')],{'host':_0x59a7('0xd'),'port':0x18eb});var socket=require(_0x59a7('0xe'))(new Redis(config[_0x59a7('0xc')]));require(_0x59a7('0xf'))[_0x59a7('0x10')](socket);function respondWithRpcPromise(_0x420671,_0x40c183,_0x4726c0){return new BPromise(function(_0x506325,_0xc42cd3){return client[_0x59a7('0x11')](_0x420671,_0x4726c0)[_0x59a7('0x12')](function(_0x26f074){logger[_0x59a7('0x13')](_0x59a7('0x14'),_0x40c183,_0x59a7('0x15'));logger['debug'](_0x59a7('0x16'),_0x40c183,_0x59a7('0x15'),JSON[_0x59a7('0x17')](_0x26f074));if(_0x26f074['error']){if(_0x26f074[_0x59a7('0x18')][_0x59a7('0x19')]===0x1f4){logger[_0x59a7('0x18')](_0x59a7('0x14'),_0x40c183,_0x26f074['error']['message']);return _0xc42cd3(_0x26f074[_0x59a7('0x18')][_0x59a7('0x1a')]);}logger[_0x59a7('0x18')](_0x59a7('0x14'),_0x40c183,_0x26f074[_0x59a7('0x18')][_0x59a7('0x1a')]);return _0x506325(_0x26f074[_0x59a7('0x18')][_0x59a7('0x1a')]);}else{logger[_0x59a7('0x13')](_0x59a7('0x14'),_0x40c183,_0x59a7('0x15'));_0x506325(_0x26f074[_0x59a7('0x1b')]['message']);}})[_0x59a7('0x1c')](function(_0x44a2ff){logger[_0x59a7('0x18')](_0x59a7('0x14'),_0x40c183,_0x44a2ff);_0xc42cd3(_0x44a2ff);});});}exports[_0x59a7('0x1d')]=function(_0x57b52f){var _0x556ad5=this;return new Promise(function(_0x509222,_0x55b26){return db[_0x59a7('0x1e')]['create'](_0x57b52f[_0x59a7('0x1f')],{'raw':_0x57b52f[_0x59a7('0x20')]?_0x57b52f[_0x59a7('0x20')][_0x59a7('0x21')]===undefined?!![]:![]:!![]})[_0x59a7('0x12')](function(_0x383922){logger[_0x59a7('0x13')](_0x59a7('0x1d'),_0x57b52f);logger[_0x59a7('0x22')]('CreatePlugin',_0x57b52f,JSON[_0x59a7('0x17')](_0x383922));_0x509222(_0x383922);})[_0x59a7('0x1c')](function(_0x30fca6){logger['error'](_0x59a7('0x1d'),_0x30fca6['message'],_0x57b52f);_0x55b26(_0x556ad5['error'](0x1f4,_0x30fca6[_0x59a7('0x1a')]));});});}; \ No newline at end of file +var _0x59fe=['request','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','Plugin,\x20%s,\x20%s','info','result','catch','CreatePlugin','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','register'];(function(_0x5575f9,_0x59232c){var _0x2715f0=function(_0x575bcd){while(--_0x575bcd){_0x5575f9['push'](_0x5575f9['shift']());}};_0x2715f0(++_0x59232c);}(_0x59fe,0x146));var _0xe59f=function(_0x2efad5,_0x209696){_0x2efad5=_0x2efad5-0x0;var _0x54f45e=_0x59fe[_0x2efad5];return _0x54f45e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe59f('0x0'));var BPromise=require(_0xe59f('0x1'));var rs=require(_0xe59f('0x2'));var fs=require('fs');var Redis=require(_0xe59f('0x3'));var db=require(_0xe59f('0x4'))['db'];var utils=require(_0xe59f('0x5'));var logger=require(_0xe59f('0x6'))(_0xe59f('0x7'));var config=require(_0xe59f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe59f('0x9')][_0xe59f('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xe59f('0xb'),'port':0x18eb});var socket=require(_0xe59f('0xc'))(new Redis(config[_0xe59f('0xd')]));require('./plugin.socket')[_0xe59f('0xe')](socket);function respondWithRpcPromise(_0x4bb565,_0xf732e8,_0x113330){return new BPromise(function(_0x479490,_0x32bb6d){return client[_0xe59f('0xf')](_0x4bb565,_0x113330)['then'](function(_0x4dfd48){logger['info']('Plugin,\x20%s,\x20%s',_0xf732e8,_0xe59f('0x10'));logger[_0xe59f('0x11')](_0xe59f('0x12'),_0xf732e8,'request\x20sent',JSON[_0xe59f('0x13')](_0x4dfd48));if(_0x4dfd48[_0xe59f('0x14')]){if(_0x4dfd48[_0xe59f('0x14')]['code']===0x1f4){logger[_0xe59f('0x14')]('Plugin,\x20%s,\x20%s',_0xf732e8,_0x4dfd48[_0xe59f('0x14')][_0xe59f('0x15')]);return _0x32bb6d(_0x4dfd48[_0xe59f('0x14')]['message']);}logger['error'](_0xe59f('0x16'),_0xf732e8,_0x4dfd48[_0xe59f('0x14')][_0xe59f('0x15')]);return _0x479490(_0x4dfd48[_0xe59f('0x14')]['message']);}else{logger[_0xe59f('0x17')](_0xe59f('0x16'),_0xf732e8,_0xe59f('0x10'));_0x479490(_0x4dfd48[_0xe59f('0x18')][_0xe59f('0x15')]);}})[_0xe59f('0x19')](function(_0x20375f){logger[_0xe59f('0x14')](_0xe59f('0x16'),_0xf732e8,_0x20375f);_0x32bb6d(_0x20375f);});});}exports[_0xe59f('0x1a')]=function(_0x10ef0f){var _0x4b57cc=this;return new Promise(function(_0x24834e,_0x1c880d){return db['Plugin'][_0xe59f('0x1b')](_0x10ef0f[_0xe59f('0x1c')],{'raw':_0x10ef0f[_0xe59f('0x1d')]?_0x10ef0f[_0xe59f('0x1d')][_0xe59f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x14d91b){logger['info']('CreatePlugin',_0x10ef0f);logger['debug'](_0xe59f('0x1a'),_0x10ef0f,JSON[_0xe59f('0x13')](_0x14d91b));_0x24834e(_0x14d91b);})[_0xe59f('0x19')](function(_0x11a8d4){logger[_0xe59f('0x14')](_0xe59f('0x1a'),_0x11a8d4[_0xe59f('0x15')],_0x10ef0f);_0x1c880d(_0x4b57cc[_0xe59f('0x14')](0x1f4,_0x11a8d4[_0xe59f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index db437b9..44cdc9c 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 _0x354c=['save','update','emit','removeListener','register','length','plugin:','./plugin.events'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x354c,0xf7));var _0xc354=function(_0x147857,_0x1bfebe){_0x147857=_0x147857-0x0;var _0x1895c7=_0x354c[_0x147857];return _0x1895c7;};'use strict';var PluginEvents=require(_0xc354('0x0'));var events=[_0xc354('0x1'),'remove',_0xc354('0x2')];function createListener(_0x31852d,_0x304286){return function(_0x2ac349){_0x304286[_0xc354('0x3')](_0x31852d,_0x2ac349);};}function removeListener(_0x582b94,_0xcccf5d){return function(){PluginEvents[_0xc354('0x4')](_0x582b94,_0xcccf5d);};}exports[_0xc354('0x5')]=function(_0x49723e){for(var _0xe4b230=0x0,_0xf42a60=events[_0xc354('0x6')];_0xe4b230<_0xf42a60;_0xe4b230++){var _0x2b36c7=events[_0xe4b230];var _0x203632=createListener(_0xc354('0x7')+_0x2b36c7,_0x49723e);PluginEvents['on'](_0x2b36c7,_0x203632);}}; \ No newline at end of file +var _0x27a7=['register','length','plugin:','./plugin.events','remove','update','emit','removeListener'];(function(_0x41752b,_0x12fe91){var _0x192ee7=function(_0xe5c354){while(--_0xe5c354){_0x41752b['push'](_0x41752b['shift']());}};_0x192ee7(++_0x12fe91);}(_0x27a7,0xeb));var _0x727a=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x27a7[_0x3b5ad9];return _0x611ae9;};'use strict';var PluginEvents=require(_0x727a('0x0'));var events=['save',_0x727a('0x1'),_0x727a('0x2')];function createListener(_0x553b9a,_0x399e58){return function(_0x57b9ab){_0x399e58[_0x727a('0x3')](_0x553b9a,_0x57b9ab);};}function removeListener(_0xb3c8ae,_0x12b6ad){return function(){PluginEvents[_0x727a('0x4')](_0xb3c8ae,_0x12b6ad);};}exports[_0x727a('0x5')]=function(_0x34c2b5){for(var _0x3cd661=0x0,_0x2829f6=events[_0x727a('0x6')];_0x3cd661<_0x2829f6;_0x3cd661++){var _0x539581=events[_0x3cd661];var _0xa72085=createListener(_0x727a('0x7')+_0x539581,_0x34c2b5);PluginEvents['on'](_0x539581,_0xa72085);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 81ad08d..d0075ab 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 _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x28eac6,_0x28bbf9){var _0x59cc6a=function(_0x3f15d2){while(--_0x3f15d2){_0x28eac6['push'](_0x28eac6['shift']());}};_0x59cc6a(++_0x28bbf9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x496486,_0x3bb6a7){var _0x56b92a=function(_0x19d620){while(--_0x19d620){_0x496486['push'](_0x496486['shift']());}};_0x56b92a(++_0x3bb6a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 09b3304..d91f6ea 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 _0x57f8=['error','name','npm\x20install','info','index','list','express','length','then','catch','show','describe','params','body','script','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0x39f211,_0x3b551b){var _0x1c1f5c=function(_0x14278c){while(--_0x14278c){_0x39f211['push'](_0x39f211['shift']());}};_0x1c1f5c(++_0x3b551b);}(_0x57f8,0x198));var _0x857f=function(_0x474e22,_0x5d5515){_0x474e22=_0x474e22-0x0;var _0x76a179=_0x57f8[_0x474e22];return _0x76a179;};'use strict';var _=require('lodash');var pm2=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var path=require(_0x857f('0x3'));var exec=require(_0x857f('0x4'))[_0x857f('0x5')];var BPromise=require(_0x857f('0x6'));function handleEntityNotFound(_0x6f054b,_0x318050){return function(_0xced48e){if(!_0xced48e){_0x6f054b[_0x857f('0x7')](0x194);;}return _0xced48e;};}function respondWithResult(_0x369c40,_0x5d22e4){_0x5d22e4=_0x5d22e4||0xc8;return function(_0x8380e8){if(_0x8380e8){return _0x369c40[_0x857f('0x8')](_0x5d22e4)[_0x857f('0x9')](_0x8380e8);}return null;};}function handleError(_0x577fc3,_0x5f6a66){_0x5f6a66=_0x5f6a66||0x1f4;return function(_0x135855){logger[_0x857f('0xa')](_0x135855['stack']);if(_0x135855[_0x857f('0xb')]){delete _0x135855[_0x857f('0xb')];}_0x577fc3[_0x857f('0x8')](_0x5f6a66)['send'](_0x135855);};}function execChildProcess(){return new BPromise(function(_0xefee53,_0x360827){exec(_0x857f('0xc'),function(_0x11adfd,_0x268f9d,_0x3eb530){logger[_0x857f('0xd')](_0x268f9d);logger['info'](_0x3eb530);if(_0x11adfd){logger[_0x857f('0xa')](_0x11adfd);return _0x360827(_0x11adfd);}return _0xefee53(_0x268f9d);});});}exports[_0x857f('0xe')]=function(_0x373333,_0x2caf29){return pm2[_0x857f('0xf')]()['then'](function(_0x4bc590){if(_0x4bc590){var _0x3b09d9=_['reject'](_0x4bc590,function(_0x1fafbe){return _0x1fafbe['name']===_0x857f('0x10')||_0x1fafbe[_0x857f('0xb')]==='motion2';});return{'rows':_0x3b09d9,'count':_0x3b09d9[_0x857f('0x11')]};}return null;})[_0x857f('0x12')](respondWithResult(_0x2caf29,null))[_0x857f('0x13')](handleError(_0x2caf29,null));};exports[_0x857f('0x14')]=function(_0x279e74,_0x38a3c2){return pm2[_0x857f('0x15')](_0x279e74[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x38a3c2,null))[_0x857f('0x12')](handleEntityNotFound(_0x38a3c2,null))[_0x857f('0x13')](handleError(_0x38a3c2,null));};exports['create']=function(_0x1729d8,_0x1e8fd4){if(_0x1729d8['body'][_0x857f('0xb')]&&_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]){var _0x484035=path['join'](__dirname,_0x857f('0x19'),_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]);var _0x4fa031=process[_0x857f('0x1a')]();process[_0x857f('0x1b')](path[_0x857f('0x1c')](_0x484035));return execChildProcess()['then'](function(_0x1961ea){process[_0x857f('0x1b')](_0x4fa031);return pm2['start']({'name':_0x1729d8[_0x857f('0x17')][_0x857f('0xb')],'script':_0x484035});})[_0x857f('0x12')](function(_0x44ff23){pm2[_0x857f('0x1d')]();return _0x44ff23[0x0];})[_0x857f('0x12')](respondWithResult(_0x1e8fd4,0xc9))[_0x857f('0x13')](handleError(_0x1e8fd4,null));}else{return _0x1e8fd4[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x1f')});}};exports[_0x857f('0x20')]=function(_0x4782ab,_0x250731){if(_0x4782ab[_0x857f('0x17')]['id']){delete _0x4782ab['body']['id'];}var _0x17e415={'online':_0x857f('0x21'),'stopped':_0x857f('0x22')};if(_0x17e415[_0x857f('0x23')](_0x4782ab['body'][_0x857f('0x8')])){return pm2[_0x17e415[_0x4782ab['body'][_0x857f('0x8')]]](_0x4782ab[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x250731,0xc8))[_0x857f('0x13')](handleError(_0x250731,null));}else{return _0x250731[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x24')});}};exports[_0x857f('0x25')]=function(_0x17e7b6,_0x41f832){if(_0x17e7b6[_0x857f('0x17')]['id']){delete _0x17e7b6[_0x857f('0x17')]['id'];}if(_0x17e7b6[_0x857f('0x16')]['id']){return pm2['delete'](_0x17e7b6[_0x857f('0x16')]['id'])[_0x857f('0x12')](function(_0x55e69f){pm2[_0x857f('0x1d')]();return _0x55e69f[0x0];})[_0x857f('0x12')](respondWithResult(_0x41f832,null))['catch'](handleError(_0x41f832,null));}else{return _0x41f832[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x60cc61,_0x563ce9){var _0x4824b6=function(_0x4529d8){while(--_0x4529d8){_0x60cc61['push'](_0x60cc61['shift']());}};_0x4824b6(++_0x563ce9);}(_0x2750,0x13b));var _0x0275=function(_0x44a27c,_0x5dd152){_0x44a27c=_0x44a27c-0x0;var _0x97387b=_0x2750[_0x44a27c];return _0x97387b;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 4e83b8e..7c74898 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14c5=['exports','express','../../components/auth/service','get','/agents','isAuthenticated','getAgents','getQueues'];(function(_0x4818a3,_0x1c28a3){var _0x5309f8=function(_0x4d33a1){while(--_0x4d33a1){_0x4818a3['push'](_0x4818a3['shift']());}};_0x5309f8(++_0x1c28a3);}(_0x14c5,0xc1));var _0x514c=function(_0x396e01,_0x499872){_0x396e01=_0x396e01-0x0;var _0x1e9324=_0x14c5[_0x396e01];return _0x1e9324;};'use strict';var express=require(_0x514c('0x0'));var router=express['Router']();var auth=require(_0x514c('0x1'));var controller=require('./realtime.controller');router[_0x514c('0x2')](_0x514c('0x3'),auth[_0x514c('0x4')](),controller[_0x514c('0x5')]);router[_0x514c('0x2')]('/queues',auth[_0x514c('0x4')](),controller[_0x514c('0x6')]);module[_0x514c('0x7')]=router; \ No newline at end of file +var _0x14e1=['exports','Router','../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents','/queues'];(function(_0x48b185,_0x4664a0){var _0x3c832a=function(_0x73774d){while(--_0x73774d){_0x48b185['push'](_0x48b185['shift']());}};_0x3c832a(++_0x4664a0);}(_0x14e1,0x129));var _0x114e=function(_0x39b933,_0x7c9c8){_0x39b933=_0x39b933-0x0;var _0x445f14=_0x14e1[_0x39b933];return _0x445f14;};'use strict';var express=require('express');var router=express[_0x114e('0x0')]();var auth=require(_0x114e('0x1'));var controller=require(_0x114e('0x2'));router[_0x114e('0x3')]('/agents',auth[_0x114e('0x4')](),controller[_0x114e('0x5')]);router[_0x114e('0x3')](_0x114e('0x6'),auth[_0x114e('0x4')](),controller['getQueues']);module[_0x114e('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 648ae4f..9659127 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','talking','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','paused','loggedInDb','loggedIn','waiting','busy','find','pick','filter','queue','length','some','internal','toString','UserId','online','User','Pause','QueueId','idle','unknown','unavailable','ringing','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','voiceStatus','faxStatus','openchannelStatus','smsStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','role','agent','query','getOptions','raw','user','userProfileId','nolimit','sort','getResources','findAndCountAll','rows','omit','globalStatusFilter','globalStatus','getQueues','sms','openchannel','channel','includes','toLowerCase','Queue','type','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','limit','undefined','count','status','json','name'];(function(_0x3f3ae9,_0x46b55c){var _0x2700d4=function(_0x227480){while(--_0x227480){_0x3f3ae9['push'](_0x3f3ae9['shift']());}};_0x2700d4(++_0x46b55c);}(_0x53ec,0x192));var _0xc53e=function(_0xb08792,_0x298252){_0xb08792=_0xb08792-0x0;var _0x2d9992=_0x53ec[_0xb08792];return _0x2d9992;};'use strict';var util=require(_0xc53e('0x0'));var _=require(_0xc53e('0x1'));var jayson=require(_0xc53e('0x2'));var qs=require(_0xc53e('0x3'));var logger=require(_0xc53e('0x4'))(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xc53e('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xc53e('0x6')][_0xc53e('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x4a9c59,_0x2f1414){return function(_0x4f989b){if(_0x4f989b){var _0x41a9e8=typeof _0x2f1414[_0xc53e('0x8')]==='undefined'&&typeof _0x2f1414[_0xc53e('0x9')]===_0xc53e('0xa');var _0x8b231f=_0x4f989b[_0xc53e('0xb')];var _0xd9612=_0x41a9e8?0x0:_0x2f1414[_0xc53e('0x8')];var _0xd82002=_0x41a9e8?_0x4f989b[_0xc53e('0xb')]:_0x2f1414[_0xc53e('0x8')]+_0x2f1414['limit'];var _0x57e818;if(_0xd82002>=_0x8b231f){_0xd82002=_0x8b231f;_0x57e818=0xc8;}else{_0x57e818=0xce;}_0x4a9c59[_0xc53e('0xc')](_0x57e818);return _0x4a9c59['set']('Content-Range',_0xd9612+'-'+_0xd82002+'/'+_0x8b231f)[_0xc53e('0xd')](_0x4f989b);}return null;};}function handleError(_0x9ffbcb,_0x863fa){_0x863fa=_0x863fa||0x1f4;return function(_0x4203aa){logger['error'](_0x4203aa['stack']);if(_0x4203aa[_0xc53e('0xe')]){delete _0x4203aa[_0xc53e('0xe')];}_0x9ffbcb[_0xc53e('0xc')](_0x863fa)[_0xc53e('0xf')](_0x4203aa);};}function getRealtimeAgents(){return new Promise(function(_0x358ef3,_0x382e87){return amiClient[_0xc53e('0x10')](_0xc53e('0x11'),{})[_0xc53e('0x12')](function(_0x2ad6eb){if(_0x2ad6eb['error'])throw new Error(_0xc53e('0x13'));var _0x191567=_0x2ad6eb[_0xc53e('0x14')];return routingClient[_0xc53e('0x10')](_0xc53e('0x11'),{})[_0xc53e('0x12')](function(_0x164016){if(_0x164016[_0xc53e('0x15')])throw new Error(_0xc53e('0x16'));var _0x5d1098=_0x164016['result'];return _0x358ef3(_[_0xc53e('0x17')]({},_0x191567,_0x5d1098));});})[_0xc53e('0x18')](function(_0x421641){_0x382e87(_0x421641);});});}function getRealtimeQueues(_0x2e85df,_0x20066e){return new Promise(function(_0x2cfe2b,_0x15a015){var _0x25702b=_0x20066e===_0xc53e('0x19')?amiClient:routingClient;return _0x25702b[_0xc53e('0x10')](_[_0xc53e('0x1a')](_0x20066e)+_0xc53e('0x1b'),_0x2e85df)[_0xc53e('0x12')](function(_0x4fb695){if(_0x4fb695['error'])throw new Error(util['format'](_0xc53e('0x1c'),_0x20066e));return _0x2cfe2b(_0x4fb695[_0xc53e('0x14')]);})[_0xc53e('0x18')](function(_0x4015c8){_0x15a015(_0x4015c8);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x180811,_0x5009e1){return amiClient['request'](_0xc53e('0x1d'),{})['then'](function(_0x1ae55e){if(_0x1ae55e[_0xc53e('0x15')])throw new Error(_0xc53e('0x1e'));return _0x180811(_0x1ae55e[_0xc53e('0x14')]);})[_0xc53e('0x18')](function(_0x4df8cf){_0x5009e1(_0x4df8cf);});});}function initializeQueues(_0x398e7a,_0x4b9f6a,_0x4d9a68,_0x5c65d3){var _0x3c5056=['loggedIn',_0xc53e('0x1f'),'waiting',_0xc53e('0x20'),'paused'];if(_0x4d9a68==='voice'&&_0x5c65d3===_0xc53e('0x21')){_0x3c5056[_0xc53e('0x22')](_0xc53e('0x23'),_0xc53e('0x24'),_0xc53e('0x25'),_0xc53e('0x26'),_0xc53e('0x27'),_0xc53e('0x28'),'startPredictive',_0xc53e('0x29'),_0xc53e('0x2a'),_0xc53e('0x2b'),'erlangAbandonmentRate',_0xc53e('0x2c'),'dialPredictiveInterval',_0xc53e('0x2d'),_0xc53e('0x2e'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0xc53e('0x2f'),_0xc53e('0x30'),_0xc53e('0x31'),_0xc53e('0x32'),_0xc53e('0x33'));}return _0x398e7a[_0xc53e('0x34')](function(_0x40a8db){var _0x168d25=_0x40a8db['get']({'plain':!![]});_0x168d25[_0xc53e('0x35')]=[];_0x168d25[_0xc53e('0x36')]=0x0;_0x168d25[_0xc53e('0x37')]=0x0;_0x168d25[_0xc53e('0x38')]=0x0;_0x168d25[_0xc53e('0x1f')]=0x0;_0x168d25[_0xc53e('0x39')]=0x0;if(_0x4d9a68===_0xc53e('0x19')){_0x168d25[_0xc53e('0x20')]=0x0;_0x168d25[_0xc53e('0x3a')]=0x0;if(_0x5c65d3==='outbound'){_0x168d25[_0xc53e('0x23')]=0x0;_0x168d25['originated']=0x0;}}var _0x1059f3=_[_0xc53e('0x3b')](_0x4b9f6a,['id',_0x168d25['id']]);if(_0x1059f3)_['merge'](_0x168d25,_[_0xc53e('0x3c')](_0x1059f3,_0x3c5056));return _0x168d25;});}function updateAgentVoiceStatus(_0x154f8b,_0x3254e9,_0x5ed90b){var _0x4b82bb=_[_0xc53e('0x3d')](_0x5ed90b,[_0xc53e('0x3e'),_0x3254e9[_0xc53e('0xe')]]);if(_0x4b82bb[_0xc53e('0x3f')]===0x0)return _0x154f8b[_0xc53e('0x3a')]=!![];if(_[_0xc53e('0x40')](_0x4b82bb,['connectedlinenum',_0x154f8b[_0xc53e('0x41')][_0xc53e('0x42')]()]))return _0x154f8b[_0xc53e('0x20')]=!![];if(!_0x154f8b['talking'])return _0x154f8b[_0xc53e('0x3a')]=!![];}function getVoiceQueueAgents(_0x5e8ab7,_0xaa00cd,_0x15052d,_0x40c4f5){var _0xad1232=_[_0xc53e('0x3b')](_0xaa00cd,['id',_0x5e8ab7['id']]);if(!_0xad1232)return _0x5e8ab7;return _0xad1232['getMembers']({'raw':!![]})[_0xc53e('0x12')](function(_0x3c72b1){for(var _0x4a5529=0x0;_0x4a5529<_0x3c72b1['length'];_0x4a5529++){var _0x5e9e15=_['find'](_0x15052d,['id',_0x3c72b1[_0x4a5529][_0xc53e('0x43')]]);if(!_0x5e9e15){_0x5e9e15={'id':_0x3c72b1[_0x4a5529][_0xc53e('0x43')],'name':_0x3c72b1[_0x4a5529]['UserId'],'accountcode':'','online':![]};}var _0x460ee6={'id':_0x5e9e15['id'],'name':_0x5e9e15['name'],'internal':_0x5e9e15['accountcode'],'online':Boolean(_0x5e9e15['online']),'paused':Boolean(_0x3c72b1[_0x4a5529][_0xc53e('0x36')])};if(_0x5e9e15['voiceStatus']==='talking')updateAgentVoiceStatus(_0x460ee6,_0x5e8ab7,_0x40c4f5);if(_0x460ee6[_0xc53e('0x44')])_0x5e8ab7['loggedInDb']++;if(_0x460ee6[_0xc53e('0x3a')])_0x5e8ab7[_0xc53e('0x3a')]++;if(_0x460ee6['paused']&&!_0x460ee6[_0xc53e('0x3a')]&&!_0x460ee6[_0xc53e('0x20')])_0x5e8ab7['paused']++;_0x5e8ab7[_0xc53e('0x35')]['push'](_0x460ee6);}return _0x5e8ab7;});}function getQueueAgents(_0x547be0,_0x481e6d,_0x4efee5){var _0x887d78=_0xc53e('0x45')+_[_0xc53e('0x1a')](_0x4efee5)+'Queue';var _0x1a5014=_0x4efee5+_0xc53e('0x46');return db[_0x887d78]['findAll']({'where':{[_['startCase'](_0x4efee5)+_0xc53e('0x47')]:_0x547be0['id']},'raw':!![]})[_0xc53e('0x12')](function(_0x162acd){for(var _0x59b9d9=0x0;_0x59b9d9<_0x162acd[_0xc53e('0x3f')];_0x59b9d9++){var _0x1fb82c=_[_0xc53e('0x3b')](_0x481e6d,['id',_0x162acd[_0x59b9d9][_0xc53e('0x43')]]);if(!_0x1fb82c){_0x1fb82c={'id':_0x162acd[_0x59b9d9][_0xc53e('0x43')],'name':_0x162acd[_0x59b9d9][_0xc53e('0x43')],'online':![],['pauseField']:![]};}var _0x372ce6={'id':_0x1fb82c['id'],'name':_0x1fb82c['name'],'online':Boolean(_0x1fb82c[_0xc53e('0x44')]),'paused':Boolean(_0x1fb82c[_0x1a5014])};if(_0x372ce6[_0xc53e('0x44')])_0x547be0[_0xc53e('0x37')]++;_0x547be0['agents'][_0xc53e('0x22')](_0x372ce6);}return _0x547be0;});}function isIdle(_0x2d1382){return _0x2d1382===_0xc53e('0x48')||_0x2d1382===_0xc53e('0x49')||_0x2d1382===_0xc53e('0x4a')||_0x2d1382===_0xc53e('0x4b')||_['isNil'](_0x2d1382);}function isAgentPaused(_0x1e073b,_0x3505e2){var _0x39feea=[_0x1e073b['chatPause'],_0x1e073b[_0xc53e('0x4c')],_0x1e073b[_0xc53e('0x4d')],_0x1e073b[_0xc53e('0x4e')],_0x1e073b[_0xc53e('0x4f')],_0x1e073b[_0xc53e('0x50')],_0x1e073b[_0xc53e('0x51')]];if(!_0x3505e2)return _[_0xc53e('0x52')](_0x39feea);var _0x2ba2b4=_[_0xc53e('0x3d')](_0x39feea);return _0x2ba2b4[_0xc53e('0x3f')]>0x0&&_0x2ba2b4['length']<_0x39feea[_0xc53e('0x3f')]?!![]:![];}function isAgentIdle(_0x17cf13){if(_0x17cf13[_0xc53e('0x53')]!==_0xc53e('0x48')&&_0x17cf13[_0xc53e('0x50')]){_0x17cf13['voiceStatus']='pause';return![];}return _[_0xc53e('0x52')]([_0x17cf13['chatStatus'],_0x17cf13[_0xc53e('0x54')],_0x17cf13['mailStatus'],_0x17cf13[_0xc53e('0x55')],_0x17cf13[_0xc53e('0x56')],_0x17cf13[_0xc53e('0x53')],_0x17cf13['whatsappStatus']],isIdle);}function getAgentStatus(_0x393611){var _0x10bebb=_0xc53e('0x49');if(isAgentPaused(_0x393611))_0x10bebb='pause';else if(isAgentPaused(_0x393611,!![]))_0x10bebb=_0xc53e('0x57');else if(isAgentIdle(_0x393611))_0x10bebb='idle';else _0x10bebb=_0xc53e('0x3a');return _0x10bebb;}exports[_0xc53e('0x58')]=function(_0x5ce90c,_0x15a96a){var _0x1515ea={'count':0x0,'rows':[]},_0x5bba72={},_0x44f7cc,_0x36d321,_0x27a620=[_0xc53e('0x59'),_0xc53e('0x44'),_0xc53e('0x5a'),_0xc53e('0x5b'),_0xc53e('0x5c'),_0xc53e('0x5b'),_0xc53e('0x41'),'address',_0xc53e('0x5d'),'openchannelPause',_0xc53e('0x4d'),'smsPause',_0xc53e('0x51'),_0xc53e('0x4c'),'voicePause',_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60'),_0xc53e('0x61'),'whatsappCapacity',_0xc53e('0x62'),_0xc53e('0x63'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xc53e('0x64'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus',_0xc53e('0x55'),'mailStatus',_0xc53e('0x56'),'whatsappStatus',_0xc53e('0x54'),_0xc53e('0x53'),_0xc53e('0x65'),_0xc53e('0x66'),_0xc53e('0x67'),'smsStatusTime','whatsappStatusTime',_0xc53e('0x68'),_0xc53e('0x69'),_0xc53e('0x3e'),_0xc53e('0x6a'),_0xc53e('0x6b'),_0xc53e('0x6c'),_0xc53e('0x6d'),_0xc53e('0x6e')],_0x1ff92d=[_0xc53e('0x5d'),_0xc53e('0x4e'),_0xc53e('0x4d'),_0xc53e('0x4f'),_0xc53e('0x51'),'faxPause',_0xc53e('0x50'),'online'];Promise[_0xc53e('0x6f')]()[_0xc53e('0x12')](function(){var _0x259c89=_[_0xc53e('0x34')](db[_0xc53e('0x45')][_0xc53e('0x70')],function(_0x391825){return{'name':_0x391825[_0xc53e('0x71')],'type':_0x391825['type']['key']};});_0x5ce90c['query'][_0xc53e('0x72')]=_0xc53e('0x73');_0x5ce90c[_0xc53e('0x74')][_0xc53e('0x44')]=!![];_0x5bba72=qs[_0xc53e('0x75')](_0x259c89,_0x5ce90c);_0x5bba72[_0xc53e('0x76')]=!![];if(_0x5ce90c[_0xc53e('0x77')]['role']==='user'){var _0x5961bb={'params':{'id':_0x5ce90c[_0xc53e('0x77')][_0xc53e('0x78')]},'query':{'section':'Agents','role':_0xc53e('0x73'),'online':!![],'nolimit':_0x5ce90c[_0xc53e('0x74')][_0xc53e('0x79')],'sort':_0x5ce90c[_0xc53e('0x74')][_0xc53e('0x7a')],'filter':_0x5ce90c[_0xc53e('0x74')]['filter'],'raw':!![]}};return db['UserProfile'][_0xc53e('0x7b')](_0x5961bb);}return db[_0xc53e('0x45')][_0xc53e('0x7c')](_0x5bba72);})[_0xc53e('0x12')](function(_0x29ee08){_0x1515ea[_0xc53e('0xb')]=_0x29ee08['count'];_0x44f7cc=_0x29ee08[_0xc53e('0x7d')];return getRealtimeAgents();})[_0xc53e('0x12')](function(_0x1c15a3){_0x36d321=_0x1c15a3[_0xc53e('0x7d')];return _0x44f7cc['map'](function(_0xdd851e){var _0xef9095=_[_0xc53e('0x3b')](_0x36d321,['id',_0xdd851e['id']]);if(_0xef9095)_[_0xc53e('0x17')](_0xdd851e,_[_0xc53e('0x3c')](_[_0xc53e('0x7e')](_0xef9095,_0x1ff92d),_0x27a620));_0xdd851e['globalStatus']=getAgentStatus(_0xdd851e);return _0xdd851e;});})[_0xc53e('0x12')](function(_0x134018){if(_0x5ce90c[_0xc53e('0x74')][_0xc53e('0x7f')]){var _0x548d63=_['filter'](_0x134018,[_0xc53e('0x80'),_0x5ce90c[_0xc53e('0x74')][_0xc53e('0x7f')]]);if(_0x5ce90c[_0xc53e('0x74')]['pauseTypeFilter']){_0x548d63=_[_0xc53e('0x3d')](_0x548d63,['pauseType',_0x5ce90c[_0xc53e('0x74')]['pauseTypeFilter']]);}}_0x1515ea[_0xc53e('0x7d')]=_0x548d63||_0x134018;return _0x1515ea;})['then'](respondWithFilteredResult(_0x15a96a,_0x5bba72))[_0xc53e('0x18')](handleError(_0x15a96a,null));};exports[_0xc53e('0x81')]=function(_0x5a0633,_0x1bc7b0){var _0xfd2140=['mail','chat',_0xc53e('0x82'),_0xc53e('0x83'),'fax','whatsapp',_0xc53e('0x19')];var _0x5ba256={'count':0x0,'rows':[]},_0x354c33={},_0x5bfdbb,_0x1de087,_0x330411,_0x10167b,_0x388874;Promise[_0xc53e('0x6f')]()[_0xc53e('0x12')](function(){if(_0x5a0633[_0xc53e('0x74')][_0xc53e('0x84')]){if(!_[_0xc53e('0x85')](_0xfd2140,_0x5a0633[_0xc53e('0x74')]['channel'][_0xc53e('0x86')]()))throw new Error('Invalid\x20channel');_0x5bfdbb=_0x5a0633[_0xc53e('0x74')][_0xc53e('0x84')][_0xc53e('0x86')]();}var _0x2c027c=_[_0xc53e('0x1a')](_0x5bfdbb)+_0xc53e('0x87');var _0x1e3499=_[_0xc53e('0x34')](db[_0x2c027c][_0xc53e('0x70')],function(_0x1f572b){return{'name':_0x1f572b['fieldName'],'type':_0x1f572b[_0xc53e('0x88')]['key']};});_0x354c33=qs[_0xc53e('0x75')](_0x1e3499,_0x5a0633);if(_0x5a0633[_0xc53e('0x77')][_0xc53e('0x72')]==='user'){var _0xfd01b9={'params':{'id':_0x5a0633[_0xc53e('0x77')][_0xc53e('0x78')]},'query':{'section':_0x5bfdbb===_0xc53e('0x19')&&_0x5a0633[_0xc53e('0x74')]['type']===_0xc53e('0x21')?_0xc53e('0x89'):_['startCase'](_0x5bfdbb)+_0xc53e('0x1b'),'type':_0x5a0633[_0xc53e('0x74')][_0xc53e('0x88')],'nolimit':!![],'sort':'name','filter':_0x5a0633[_0xc53e('0x74')][_0xc53e('0x3d')]}};return db['UserProfile'][_0xc53e('0x7b')](_0xfd01b9);}return db[_0x2c027c][_0xc53e('0x7c')](_0x354c33);})['then'](function(_0x4a5483){_0x5ba256[_0xc53e('0xb')]=_0x4a5483['count'];_0x1de087=_0x4a5483[_0xc53e('0x7d')];return getRealtimeQueues(_0x5a0633,_0x5bfdbb);})[_0xc53e('0x12')](function(_0x263d97){_0x10167b=_0x263d97['rows'];return getRealtimeAgents();})[_0xc53e('0x12')](function(_0x2dd747){_0x330411=_0x2dd747[_0xc53e('0x7d')];if(_0x5bfdbb!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xc53e('0x12')](function(_0x2e048a){_0x388874=_0x2e048a?_0x2e048a[_0xc53e('0x7d')]:[];return initializeQueues(_0x1de087,_0x10167b,_0x5bfdbb,_0x5a0633[_0xc53e('0x74')][_0xc53e('0x88')]);})['then'](function(_0x3dac82){var _0x325287=_0x3dac82[_0xc53e('0x34')](function(_0x2f0a47){if(_0x5bfdbb===_0xc53e('0x19'))return getVoiceQueueAgents(_0x2f0a47,_0x1de087,_0x330411,_0x388874);else return getQueueAgents(_0x2f0a47,_0x330411,_0x5bfdbb);});return Promise[_0xc53e('0x8a')](_0x325287);})[_0xc53e('0x12')](function(_0xa704d){_0x5ba256[_0xc53e('0x7d')]=_0xa704d;return _0x5ba256;})['then'](respondWithFilteredResult(_0x1bc7b0,_0x354c33))[_0xc53e('0x18')](handleError(_0x1bc7b0,null));}; \ No newline at end of file +var _0x2eb2=['voice','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','agents','loggedInDb','waiting','talking','busy','merge','pick','filter','queue','length','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','startCase','Pause','unknown','chatPause','faxPause','openchannelPause','voicePause','whatsappPause','every','idle','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','lastLoginAt','lastPauseAt','pauseType','address','mailPause','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','map','rawAttributes','fieldName','type','query','role','getOptions','raw','user','agent','nolimit','sort','UserProfile','findAndCountAll','rows','omit','globalStatus','pauseTypeFilter','getQueues','mail','fax','whatsapp','Invalid\x20channel','key','Queues','getResources','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','offset','undefined','limit','count','set','Content-Range','error','stack','name','status','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x2eb2[_0x31cb5f];return _0x586042;};'use strict';var util=require('util');var _=require(_0x22eb('0x0'));var jayson=require(_0x22eb('0x1'));var qs=require(_0x22eb('0x2'));var logger=require(_0x22eb('0x3'))(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var amiClient=jayson['client'][_0x22eb('0x6')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x1dfef7,_0x10e116){return function(_0x35dd5b){if(_0x35dd5b){var _0x2a9850=typeof _0x10e116[_0x22eb('0x7')]===_0x22eb('0x8')&&typeof _0x10e116[_0x22eb('0x9')]===_0x22eb('0x8');var _0x419601=_0x35dd5b[_0x22eb('0xa')];var _0xb9c8a4=_0x2a9850?0x0:_0x10e116[_0x22eb('0x7')];var _0x489260=_0x2a9850?_0x35dd5b[_0x22eb('0xa')]:_0x10e116['offset']+_0x10e116['limit'];var _0x1aa348;if(_0x489260>=_0x419601){_0x489260=_0x419601;_0x1aa348=0xc8;}else{_0x1aa348=0xce;}_0x1dfef7['status'](_0x1aa348);return _0x1dfef7[_0x22eb('0xb')](_0x22eb('0xc'),_0xb9c8a4+'-'+_0x489260+'/'+_0x419601)['json'](_0x35dd5b);}return null;};}function handleError(_0x5068ea,_0x1f286c){_0x1f286c=_0x1f286c||0x1f4;return function(_0x189f05){logger[_0x22eb('0xd')](_0x189f05[_0x22eb('0xe')]);if(_0x189f05[_0x22eb('0xf')]){delete _0x189f05['name'];}_0x5068ea[_0x22eb('0x10')](_0x1f286c)['send'](_0x189f05);};}function getRealtimeAgents(){return new Promise(function(_0x1f5089,_0x55ede8){return amiClient[_0x22eb('0x11')](_0x22eb('0x12'),{})['then'](function(_0x48b63c){if(_0x48b63c['error'])throw new Error(_0x22eb('0x13'));var _0x5245fe=_0x48b63c['result'];return routingClient[_0x22eb('0x11')]('Agents',{})['then'](function(_0xb7a73a){if(_0xb7a73a[_0x22eb('0xd')])throw new Error(_0x22eb('0x14'));var _0x1ff041=_0xb7a73a[_0x22eb('0x15')];return _0x1f5089(_['merge']({},_0x5245fe,_0x1ff041));});})[_0x22eb('0x16')](function(_0x12bbd1){_0x55ede8(_0x12bbd1);});});}function getRealtimeQueues(_0x10d182,_0x410c25){return new Promise(function(_0x36be50,_0x517313){var _0x2eb115=_0x410c25===_0x22eb('0x17')?amiClient:routingClient;return _0x2eb115[_0x22eb('0x11')](_['startCase'](_0x410c25)+'Queues',_0x10d182)[_0x22eb('0x18')](function(_0x267d97){if(_0x267d97[_0x22eb('0xd')])throw new Error(util[_0x22eb('0x19')](_0x22eb('0x1a'),_0x410c25));return _0x36be50(_0x267d97[_0x22eb('0x15')]);})[_0x22eb('0x16')](function(_0x4e7e69){_0x517313(_0x4e7e69);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2e8f7c,_0x11edbd){return amiClient[_0x22eb('0x11')](_0x22eb('0x1b'),{})[_0x22eb('0x18')](function(_0x4da252){if(_0x4da252[_0x22eb('0xd')])throw new Error(_0x22eb('0x1c'));return _0x2e8f7c(_0x4da252[_0x22eb('0x15')]);})['catch'](function(_0xe0783c){_0x11edbd(_0xe0783c);});});}function initializeQueues(_0x259847,_0x4b409a,_0x32a4b6,_0x222ef3){var _0x1e3015=[_0x22eb('0x1d'),_0x22eb('0x1e'),'waiting','talking',_0x22eb('0x1f')];if(_0x32a4b6===_0x22eb('0x17')&&_0x222ef3===_0x22eb('0x20')){_0x1e3015[_0x22eb('0x21')](_0x22eb('0x22'),_0x22eb('0x23'),_0x22eb('0x24'),_0x22eb('0x25'),_0x22eb('0x26'),_0x22eb('0x27'),_0x22eb('0x28'),_0x22eb('0x29'),'erlangCalls',_0x22eb('0x2a'),'erlangAbandonmentRate',_0x22eb('0x2b'),_0x22eb('0x2c'),_0x22eb('0x2d'),_0x22eb('0x2e'),_0x22eb('0x2f'),_0x22eb('0x30'),_0x22eb('0x31'),_0x22eb('0x32'),_0x22eb('0x33'),_0x22eb('0x34'),'predictiveIntervalAvgTalktime');}return _0x259847['map'](function(_0x239a41){var _0x5ceec1=_0x239a41['get']({'plain':!![]});_0x5ceec1[_0x22eb('0x35')]=[];_0x5ceec1[_0x22eb('0x1f')]=0x0;_0x5ceec1[_0x22eb('0x36')]=0x0;_0x5ceec1[_0x22eb('0x1d')]=0x0;_0x5ceec1[_0x22eb('0x1e')]=0x0;_0x5ceec1[_0x22eb('0x37')]=0x0;if(_0x32a4b6===_0x22eb('0x17')){_0x5ceec1[_0x22eb('0x38')]=0x0;_0x5ceec1[_0x22eb('0x39')]=0x0;if(_0x222ef3===_0x22eb('0x20')){_0x5ceec1['pTalking']=0x0;_0x5ceec1[_0x22eb('0x23')]=0x0;}}var _0x47be01=_['find'](_0x4b409a,['id',_0x5ceec1['id']]);if(_0x47be01)_[_0x22eb('0x3a')](_0x5ceec1,_[_0x22eb('0x3b')](_0x47be01,_0x1e3015));return _0x5ceec1;});}function updateAgentVoiceStatus(_0x48e47e,_0x42e9bd,_0x121c04){var _0x236def=_[_0x22eb('0x3c')](_0x121c04,[_0x22eb('0x3d'),_0x42e9bd['name']]);if(_0x236def[_0x22eb('0x3e')]===0x0)return _0x48e47e[_0x22eb('0x39')]=!![];if(_['some'](_0x236def,[_0x22eb('0x3f'),_0x48e47e[_0x22eb('0x40')][_0x22eb('0x41')]()]))return _0x48e47e[_0x22eb('0x38')]=!![];if(!_0x48e47e[_0x22eb('0x38')])return _0x48e47e['busy']=!![];}function getVoiceQueueAgents(_0x51c8b5,_0x2b1ae1,_0x6cd651,_0x541153){var _0x595d76=_[_0x22eb('0x42')](_0x2b1ae1,['id',_0x51c8b5['id']]);if(!_0x595d76)return _0x51c8b5;return _0x595d76[_0x22eb('0x43')]({'raw':!![]})['then'](function(_0x1d977c){for(var _0x3377eb=0x0;_0x3377eb<_0x1d977c[_0x22eb('0x3e')];_0x3377eb++){var _0x2a8517=_[_0x22eb('0x42')](_0x6cd651,['id',_0x1d977c[_0x3377eb][_0x22eb('0x44')]]);if(!_0x2a8517){_0x2a8517={'id':_0x1d977c[_0x3377eb]['UserId'],'name':_0x1d977c[_0x3377eb][_0x22eb('0x44')],'accountcode':'','online':![]};}var _0x3d2d1d={'id':_0x2a8517['id'],'name':_0x2a8517['name'],'internal':_0x2a8517[_0x22eb('0x45')],'online':Boolean(_0x2a8517[_0x22eb('0x46')]),'paused':Boolean(_0x1d977c[_0x3377eb][_0x22eb('0x1f')])};if(_0x2a8517[_0x22eb('0x47')]===_0x22eb('0x38'))updateAgentVoiceStatus(_0x3d2d1d,_0x51c8b5,_0x541153);if(_0x3d2d1d[_0x22eb('0x46')])_0x51c8b5[_0x22eb('0x36')]++;if(_0x3d2d1d[_0x22eb('0x39')])_0x51c8b5[_0x22eb('0x39')]++;if(_0x3d2d1d[_0x22eb('0x1f')]&&!_0x3d2d1d[_0x22eb('0x39')]&&!_0x3d2d1d[_0x22eb('0x38')])_0x51c8b5[_0x22eb('0x1f')]++;_0x51c8b5[_0x22eb('0x35')][_0x22eb('0x21')](_0x3d2d1d);}return _0x51c8b5;});}function getQueueAgents(_0x471657,_0x6996b4,_0x46e3ec){var _0x507f21=_0x22eb('0x48')+_[_0x22eb('0x49')](_0x46e3ec)+'Queue';var _0x10462d=_0x46e3ec+_0x22eb('0x4a');return db[_0x507f21]['findAll']({'where':{[_['startCase'](_0x46e3ec)+'QueueId']:_0x471657['id']},'raw':!![]})[_0x22eb('0x18')](function(_0x1efc65){for(var _0x4e4c6d=0x0;_0x4e4c6d<_0x1efc65['length'];_0x4e4c6d++){var _0xa7c642=_[_0x22eb('0x42')](_0x6996b4,['id',_0x1efc65[_0x4e4c6d][_0x22eb('0x44')]]);if(!_0xa7c642){_0xa7c642={'id':_0x1efc65[_0x4e4c6d][_0x22eb('0x44')],'name':_0x1efc65[_0x4e4c6d][_0x22eb('0x44')],'online':![],['pauseField']:![]};}var _0x3b30a3={'id':_0xa7c642['id'],'name':_0xa7c642[_0x22eb('0xf')],'online':Boolean(_0xa7c642[_0x22eb('0x46')]),'paused':Boolean(_0xa7c642[_0x10462d])};if(_0x3b30a3['online'])_0x471657['loggedInDb']++;_0x471657[_0x22eb('0x35')]['push'](_0x3b30a3);}return _0x471657;});}function isIdle(_0x5e695c){return _0x5e695c==='idle'||_0x5e695c===_0x22eb('0x4b')||_0x5e695c==='unavailable'||_0x5e695c==='ringing'||_['isNil'](_0x5e695c);}function isAgentPaused(_0x517784,_0x36b174){var _0x4b5c03=[_0x517784[_0x22eb('0x4c')],_0x517784[_0x22eb('0x4d')],_0x517784['mailPause'],_0x517784[_0x22eb('0x4e')],_0x517784['smsPause'],_0x517784[_0x22eb('0x4f')],_0x517784[_0x22eb('0x50')]];if(!_0x36b174)return _[_0x22eb('0x51')](_0x4b5c03);var _0x111cbe=_[_0x22eb('0x3c')](_0x4b5c03);return _0x111cbe[_0x22eb('0x3e')]>0x0&&_0x111cbe[_0x22eb('0x3e')]<_0x4b5c03[_0x22eb('0x3e')]?!![]:![];}function isAgentIdle(_0x11942d){if(_0x11942d['voiceStatus']!==_0x22eb('0x52')&&_0x11942d[_0x22eb('0x4f')]){_0x11942d['voiceStatus']=_0x22eb('0x53');return![];}return _[_0x22eb('0x51')]([_0x11942d[_0x22eb('0x54')],_0x11942d[_0x22eb('0x55')],_0x11942d['mailStatus'],_0x11942d[_0x22eb('0x56')],_0x11942d[_0x22eb('0x57')],_0x11942d[_0x22eb('0x47')],_0x11942d[_0x22eb('0x58')]],isIdle);}function getAgentStatus(_0x447177){var _0x10393b='unknown';if(isAgentPaused(_0x447177))_0x10393b=_0x22eb('0x53');else if(isAgentPaused(_0x447177,!![]))_0x10393b='*pause';else if(isAgentIdle(_0x447177))_0x10393b=_0x22eb('0x52');else _0x10393b='busy';return _0x10393b;}exports[_0x22eb('0x59')]=function(_0x254b53,_0x4028ef){var _0x2c1b87={'count':0x0,'rows':[]},_0x3f03df={},_0x4aa0c5,_0x4896ed,_0xfbf2e7=['userpic',_0x22eb('0x46'),_0x22eb('0x5a'),_0x22eb('0x5b'),_0x22eb('0x5c'),_0x22eb('0x5b'),_0x22eb('0x40'),_0x22eb('0x5d'),_0x22eb('0x4c'),_0x22eb('0x4e'),_0x22eb('0x5e'),_0x22eb('0x5f'),'whatsappPause',_0x22eb('0x4d'),_0x22eb('0x4f'),_0x22eb('0x60'),_0x22eb('0x61'),_0x22eb('0x62'),_0x22eb('0x63'),_0x22eb('0x64'),_0x22eb('0x65'),_0x22eb('0x66'),_0x22eb('0x67'),_0x22eb('0x68'),_0x22eb('0x69'),_0x22eb('0x6a'),_0x22eb('0x6b'),'chatStatus','openchannelStatus',_0x22eb('0x6c'),_0x22eb('0x57'),_0x22eb('0x58'),_0x22eb('0x55'),_0x22eb('0x47'),'chatStatusTime',_0x22eb('0x6d'),_0x22eb('0x6e'),'smsStatusTime','whatsappStatusTime',_0x22eb('0x6f'),_0x22eb('0x70'),_0x22eb('0x3d'),_0x22eb('0x71'),_0x22eb('0x72'),_0x22eb('0x73'),_0x22eb('0x74'),_0x22eb('0x75')],_0x8e3864=[_0x22eb('0x4c'),_0x22eb('0x4e'),_0x22eb('0x5e'),_0x22eb('0x5f'),_0x22eb('0x50'),_0x22eb('0x4d'),'voicePause',_0x22eb('0x46')];Promise[_0x22eb('0x76')]()[_0x22eb('0x18')](function(){var _0x5dbc43=_[_0x22eb('0x77')](db['User'][_0x22eb('0x78')],function(_0x5347b4){return{'name':_0x5347b4[_0x22eb('0x79')],'type':_0x5347b4[_0x22eb('0x7a')]['key']};});_0x254b53[_0x22eb('0x7b')][_0x22eb('0x7c')]='agent';_0x254b53['query'][_0x22eb('0x46')]=!![];_0x3f03df=qs[_0x22eb('0x7d')](_0x5dbc43,_0x254b53);_0x3f03df[_0x22eb('0x7e')]=!![];if(_0x254b53[_0x22eb('0x7f')][_0x22eb('0x7c')]===_0x22eb('0x7f')){var _0x4f5eee={'params':{'id':_0x254b53[_0x22eb('0x7f')]['userProfileId']},'query':{'section':'Agents','role':_0x22eb('0x80'),'online':!![],'nolimit':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x81')],'sort':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x82')],'filter':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x3c')],'raw':!![]}};return db[_0x22eb('0x83')]['getResources'](_0x4f5eee);}return db['User'][_0x22eb('0x84')](_0x3f03df);})[_0x22eb('0x18')](function(_0x49f182){_0x2c1b87[_0x22eb('0xa')]=_0x49f182[_0x22eb('0xa')];_0x4aa0c5=_0x49f182[_0x22eb('0x85')];return getRealtimeAgents();})[_0x22eb('0x18')](function(_0x40faf6){_0x4896ed=_0x40faf6[_0x22eb('0x85')];return _0x4aa0c5['map'](function(_0x3dd49b){var _0x29d4a7=_[_0x22eb('0x42')](_0x4896ed,['id',_0x3dd49b['id']]);if(_0x29d4a7)_['merge'](_0x3dd49b,_['pick'](_[_0x22eb('0x86')](_0x29d4a7,_0x8e3864),_0xfbf2e7));_0x3dd49b[_0x22eb('0x87')]=getAgentStatus(_0x3dd49b);return _0x3dd49b;});})[_0x22eb('0x18')](function(_0x5ebeb5){if(_0x254b53[_0x22eb('0x7b')]['globalStatusFilter']){var _0x1a305d=_[_0x22eb('0x3c')](_0x5ebeb5,[_0x22eb('0x87'),_0x254b53[_0x22eb('0x7b')]['globalStatusFilter']]);if(_0x254b53[_0x22eb('0x7b')][_0x22eb('0x88')]){_0x1a305d=_[_0x22eb('0x3c')](_0x1a305d,[_0x22eb('0x5c'),_0x254b53[_0x22eb('0x7b')][_0x22eb('0x88')]]);}}_0x2c1b87[_0x22eb('0x85')]=_0x1a305d||_0x5ebeb5;return _0x2c1b87;})[_0x22eb('0x18')](respondWithFilteredResult(_0x4028ef,_0x3f03df))[_0x22eb('0x16')](handleError(_0x4028ef,null));};exports[_0x22eb('0x89')]=function(_0x14006f,_0x5b4e6a){var _0x1d0749=[_0x22eb('0x8a'),'chat','sms','openchannel',_0x22eb('0x8b'),_0x22eb('0x8c'),'voice'];var _0x10726f={'count':0x0,'rows':[]},_0x15e08a={},_0xe6e71d,_0x41c50e,_0x8cbc83,_0x4ab4f8,_0x5e01b5;Promise[_0x22eb('0x76')]()[_0x22eb('0x18')](function(){if(_0x14006f[_0x22eb('0x7b')]['channel']){if(!_['includes'](_0x1d0749,_0x14006f[_0x22eb('0x7b')]['channel']['toLowerCase']()))throw new Error(_0x22eb('0x8d'));_0xe6e71d=_0x14006f[_0x22eb('0x7b')]['channel']['toLowerCase']();}var _0x1e393a=_[_0x22eb('0x49')](_0xe6e71d)+'Queue';var _0x17f51b=_[_0x22eb('0x77')](db[_0x1e393a][_0x22eb('0x78')],function(_0x5823d0){return{'name':_0x5823d0[_0x22eb('0x79')],'type':_0x5823d0[_0x22eb('0x7a')][_0x22eb('0x8e')]};});_0x15e08a=qs[_0x22eb('0x7d')](_0x17f51b,_0x14006f);if(_0x14006f[_0x22eb('0x7f')]['role']===_0x22eb('0x7f')){var _0x2ecc24={'params':{'id':_0x14006f[_0x22eb('0x7f')]['userProfileId']},'query':{'section':_0xe6e71d==='voice'&&_0x14006f[_0x22eb('0x7b')][_0x22eb('0x7a')]===_0x22eb('0x20')?'QueueCampaigns':_[_0x22eb('0x49')](_0xe6e71d)+_0x22eb('0x8f'),'type':_0x14006f[_0x22eb('0x7b')]['type'],'nolimit':!![],'sort':_0x22eb('0xf'),'filter':_0x14006f['query']['filter']}};return db[_0x22eb('0x83')][_0x22eb('0x90')](_0x2ecc24);}return db[_0x1e393a][_0x22eb('0x84')](_0x15e08a);})['then'](function(_0x3fc402){_0x10726f[_0x22eb('0xa')]=_0x3fc402[_0x22eb('0xa')];_0x41c50e=_0x3fc402[_0x22eb('0x85')];return getRealtimeQueues(_0x14006f,_0xe6e71d);})[_0x22eb('0x18')](function(_0x545c0a){_0x4ab4f8=_0x545c0a[_0x22eb('0x85')];return getRealtimeAgents();})['then'](function(_0x36dde2){_0x8cbc83=_0x36dde2[_0x22eb('0x85')];if(_0xe6e71d!=_0x22eb('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0xe19621){_0x5e01b5=_0xe19621?_0xe19621[_0x22eb('0x85')]:[];return initializeQueues(_0x41c50e,_0x4ab4f8,_0xe6e71d,_0x14006f[_0x22eb('0x7b')][_0x22eb('0x7a')]);})[_0x22eb('0x18')](function(_0xeaf655){var _0x45b691=_0xeaf655[_0x22eb('0x77')](function(_0x1ef974){if(_0xe6e71d===_0x22eb('0x17'))return getVoiceQueueAgents(_0x1ef974,_0x41c50e,_0x8cbc83,_0x5e01b5);else return getQueueAgents(_0x1ef974,_0x8cbc83,_0xe6e71d);});return Promise[_0x22eb('0x91')](_0x45b691);})['then'](function(_0x30e721){_0x10726f[_0x22eb('0x85')]=_0x30e721;return _0x10726f;})[_0x22eb('0x18')](respondWithFilteredResult(_0x5b4e6a,_0x15e08a))[_0x22eb('0x16')](handleError(_0x5b4e6a,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index b140ed8..4895b58 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x399e37,_0x224c36){var _0xa8e037=function(_0x8b02d){while(--_0x8b02d){_0x399e37['push'](_0x399e37['shift']());}};_0xa8e037(++_0x224c36);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0xcb91[_0x441f7a];return _0x4821da;};'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 fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3677b4,_0x22651e){var _0x4636de=function(_0xe324d0){while(--_0xe324d0){_0x3677b4['push'](_0x3677b4['shift']());}};_0x4636de(++_0x22651e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e0fda22..2961d92 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 _0x25fa=['DATE','sequelize','INTEGER','STRING'];(function(_0x297042,_0x13bb40){var _0x1a351c=function(_0x9e2fe6){while(--_0x9e2fe6){_0x297042['push'](_0x297042['shift']());}};_0x1a351c(++_0x13bb40);}(_0x25fa,0x109));var _0xa25f=function(_0x397e2a,_0x21dc2a){_0x397e2a=_0x397e2a-0x0;var _0xd3bc3a=_0x25fa[_0x397e2a];return _0xd3bc3a;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'state':{'type':Sequelize[_0xa25f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa25f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xa25f('0x2')]},'starttime':{'type':Sequelize[_0xa25f('0x3')]},'responsetime':{'type':Sequelize[_0xa25f('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa25f('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x82f8=['INTEGER','DATE','STRING','exports'];(function(_0x9683dd,_0x334a98){var _0x42758e=function(_0x5e3961){while(--_0x5e3961){_0x9683dd['push'](_0x9683dd['shift']());}};_0x42758e(++_0x334a98);}(_0x82f8,0x157));var _0x882f=function(_0x4de94e,_0x473230){_0x4de94e=_0x4de94e-0x0;var _0x452fb8=_0x82f8[_0x4de94e];return _0x452fb8;};'use strict';var Sequelize=require('sequelize');module[_0x882f('0x0')]={'state':{'type':Sequelize[_0x882f('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x882f('0x2')]},'uniqueid':{'type':Sequelize[_0x882f('0x3')]},'starttime':{'type':Sequelize[_0x882f('0x2')]},'responsetime':{'type':Sequelize[_0x882f('0x2')]},'ringtime':{'type':Sequelize[_0x882f('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x882f('0x3')]},'campaigntype':{'type':Sequelize[_0x882f('0x3')]},'membername':{'type':Sequelize[_0x882f('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 5dfa9ed..628eb76 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 _0x34fe=['path','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment'];(function(_0x3b5f67,_0x2ea317){var _0x2a9a23=function(_0x589327){while(--_0x589327){_0x3b5f67['push'](_0x3b5f67['shift']());}};_0x2a9a23(++_0x2ea317);}(_0x34fe,0xd4));var _0xe34f=function(_0x688b4b,_0x910c5b){_0x688b4b=_0x688b4b-0x0;var _0x1a2dc1=_0x34fe[_0x688b4b];return _0x1a2dc1;};'use strict';var _=require(_0xe34f('0x0'));var util=require(_0xe34f('0x1'));var logger=require(_0xe34f('0x2'))('api');var moment=require(_0xe34f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe34f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xe34f('0x5')]=function(_0x46ed9e,_0xeeeae4){return _0x46ed9e[_0xe34f('0x6')](_0xe34f('0x7'),attributes,{'tableName':_0xe34f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0643=['../../config/logger','moment','path','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','util'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0x0643,0x1af));var _0x3064=function(_0x36029c,_0x392087){_0x36029c=_0x36029c-0x0;var _0xd82b6=_0x0643[_0x36029c];return _0xd82b6;};'use strict';var _=require('lodash');var util=require(_0x3064('0x0'));var logger=require(_0x3064('0x1'))('api');var moment=require(_0x3064('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3064('0x3'));var rimraf=require('rimraf');var config=require(_0x3064('0x4'));var attributes=require(_0x3064('0x5'));module['exports']=function(_0x31657c,_0x7217b4){return _0x31657c['define'](_0x3064('0x6'),attributes,{'tableName':_0x3064('0x7'),'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 c8bd448..c4e7ea8 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 _0x9570=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','debug','stringify','lodash','util','moment'];(function(_0x4e93b4,_0x48c2dd){var _0x1cd5b7=function(_0xd0ad93){while(--_0xd0ad93){_0x4e93b4['push'](_0x4e93b4['shift']());}};_0x1cd5b7(++_0x48c2dd);}(_0x9570,0x79));var _0x0957=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x9570[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x0957('0x0'));var util=require(_0x0957('0x1'));var moment=require(_0x0957('0x2'));var BPromise=require(_0x0957('0x3'));var rs=require(_0x0957('0x4'));var fs=require('fs');var Redis=require(_0x0957('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0957('0x6'));var logger=require('../../config/logger')(_0x0957('0x7'));var config=require(_0x0957('0x8'));var jayson=require(_0x0957('0x9'));var client=jayson[_0x0957('0xa')][_0x0957('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3237fc,_0x5a4054,_0x598e63){return new BPromise(function(_0x32b1a4,_0x3543fa){return client[_0x0957('0xc')](_0x3237fc,_0x598e63)[_0x0957('0xd')](function(_0x37e71b){logger[_0x0957('0xe')](_0x0957('0xf'),_0x5a4054,_0x0957('0x10'));logger['debug'](_0x0957('0x11'),_0x5a4054,'request\x20sent',JSON['stringify'](_0x37e71b));if(_0x37e71b[_0x0957('0x12')]){if(_0x37e71b['error'][_0x0957('0x13')]===0x1f4){logger[_0x0957('0x12')](_0x0957('0xf'),_0x5a4054,_0x37e71b[_0x0957('0x12')]['message']);return _0x3543fa(_0x37e71b['error'][_0x0957('0x14')]);}logger[_0x0957('0x12')](_0x0957('0xf'),_0x5a4054,_0x37e71b[_0x0957('0x12')]['message']);return _0x32b1a4(_0x37e71b[_0x0957('0x12')]['message']);}else{logger[_0x0957('0xe')](_0x0957('0xf'),_0x5a4054,'request\x20sent');_0x32b1a4(_0x37e71b[_0x0957('0x15')]['message']);}})[_0x0957('0x16')](function(_0x535c03){logger['error'](_0x0957('0xf'),_0x5a4054,_0x535c03);_0x3543fa(_0x535c03);});});}exports['CreateReportAgentPreview']=function(_0x1d6c1a){var _0x21c47a=this;return new Promise(function(_0x558f24,_0x455bb2){return db[_0x0957('0x17')][_0x0957('0x18')](_0x1d6c1a[_0x0957('0x19')],{'raw':_0x1d6c1a[_0x0957('0x1a')]?_0x1d6c1a[_0x0957('0x1a')][_0x0957('0x1b')]===undefined?!![]:![]:!![]})[_0x0957('0xd')](function(_0x40d4b5){logger[_0x0957('0xe')](_0x0957('0x1c'),_0x1d6c1a);logger[_0x0957('0x1d')](_0x0957('0x1c'),_0x1d6c1a,JSON[_0x0957('0x1e')](_0x40d4b5));_0x558f24(_0x40d4b5);})['catch'](function(_0x5b1815){logger['error'](_0x0957('0x1c'),_0x5b1815[_0x0957('0x14')],_0x1d6c1a);_0x455bb2(_0x21c47a[_0x0957('0x12')](0x1f4,_0x5b1815[_0x0957('0x14')]));});});}; \ No newline at end of file +var _0x1a6b=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','code','error','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','create','stringify','lodash','util'];(function(_0x3eca70,_0x491b92){var _0x242de7=function(_0x101925){while(--_0x101925){_0x3eca70['push'](_0x3eca70['shift']());}};_0x242de7(++_0x491b92);}(_0x1a6b,0x94));var _0xb1a6=function(_0x4d798a,_0x422042){_0x4d798a=_0x4d798a-0x0;var _0x475310=_0x1a6b[_0x4d798a];return _0x475310;};'use strict';var _=require(_0xb1a6('0x0'));var util=require(_0xb1a6('0x1'));var moment=require(_0xb1a6('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1a6('0x3'));var fs=require('fs');var Redis=require(_0xb1a6('0x4'));var db=require(_0xb1a6('0x5'))['db'];var utils=require(_0xb1a6('0x6'));var logger=require('../../config/logger')(_0xb1a6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1a6('0x8'));var client=jayson[_0xb1a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcef30f,_0x47acc5,_0x2c3e2e){return new BPromise(function(_0x1ff4f9,_0x498095){return client[_0xb1a6('0xa')](_0xcef30f,_0x2c3e2e)[_0xb1a6('0xb')](function(_0x433d5c){logger[_0xb1a6('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x47acc5,_0xb1a6('0xd'));logger[_0xb1a6('0xe')](_0xb1a6('0xf'),_0x47acc5,'request\x20sent',JSON['stringify'](_0x433d5c));if(_0x433d5c['error']){if(_0x433d5c['error'][_0xb1a6('0x10')]===0x1f4){logger[_0xb1a6('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x47acc5,_0x433d5c[_0xb1a6('0x11')]['message']);return _0x498095(_0x433d5c['error'][_0xb1a6('0x12')]);}logger['error'](_0xb1a6('0x13'),_0x47acc5,_0x433d5c['error'][_0xb1a6('0x12')]);return _0x1ff4f9(_0x433d5c[_0xb1a6('0x11')][_0xb1a6('0x12')]);}else{logger['info'](_0xb1a6('0x13'),_0x47acc5,'request\x20sent');_0x1ff4f9(_0x433d5c[_0xb1a6('0x14')]['message']);}})[_0xb1a6('0x15')](function(_0x4e3018){logger[_0xb1a6('0x11')](_0xb1a6('0x13'),_0x47acc5,_0x4e3018);_0x498095(_0x4e3018);});});}exports[_0xb1a6('0x16')]=function(_0x3b4711){var _0x3d2f5f=this;return new Promise(function(_0x3e2d29,_0x1a3af3){return db['ReportAgentPreview'][_0xb1a6('0x17')](_0x3b4711['body'],{'raw':_0x3b4711['options']?_0x3b4711['options']['raw']===undefined?!![]:![]:!![]})[_0xb1a6('0xb')](function(_0x155a30){logger[_0xb1a6('0xc')]('CreateReportAgentPreview',_0x3b4711);logger[_0xb1a6('0xe')](_0xb1a6('0x16'),_0x3b4711,JSON[_0xb1a6('0x18')](_0x155a30));_0x3e2d29(_0x155a30);})['catch'](function(_0x4daf67){logger['error'](_0xb1a6('0x16'),_0x4daf67['message'],_0x3b4711);_0x1a3af3(_0x3d2f5f[_0xb1a6('0x11')](0x1f4,_0x4daf67[_0xb1a6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 95e77df..fe13093 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 _0xcb62=['mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcb62,0x70));var _0x2cb6=function(_0x49a160,_0x5db81f){_0x49a160=_0x49a160-0x0;var _0x8f6cc0=_0xcb62[_0x49a160];return _0x8f6cc0;};'use strict';var multer=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var path=require(_0x2cb6('0x2'));var express=require(_0x2cb6('0x3'));var router=express[_0x2cb6('0x4')]();var auth=require(_0x2cb6('0x5'));var controller=require(_0x2cb6('0x6'));router[_0x2cb6('0x7')](_0x2cb6('0x8'),auth['isAuthenticated'](),controller[_0x2cb6('0x9')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0xb')]);router[_0x2cb6('0x7')](_0x2cb6('0xc'),auth['isAuthenticated'](),controller[_0x2cb6('0xd')]);router[_0x2cb6('0x7')](_0x2cb6('0xe'),auth['isAuthenticated'](),controller[_0x2cb6('0xf')]);router[_0x2cb6('0x7')](_0x2cb6('0x10'),auth['isAuthenticated'](),controller[_0x2cb6('0x11')]);router['get'](_0x2cb6('0x12'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x13')]);router['get'](_0x2cb6('0x14'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x15')]);router[_0x2cb6('0x7')](_0x2cb6('0x16'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x17')]);router[_0x2cb6('0x7')](_0x2cb6('0x18'),auth['isAuthenticated'](),controller[_0x2cb6('0x19')]);router[_0x2cb6('0x7')](_0x2cb6('0x1a'),auth[_0x2cb6('0xa')](),controller['whatsappQueues']);router['get'](_0x2cb6('0x1b'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x1c')]);router[_0x2cb6('0x7')](_0x2cb6('0x1d'),auth['isAuthenticated'](),controller[_0x2cb6('0x1e')]);router['get'](_0x2cb6('0x1f'),auth[_0x2cb6('0xa')](),controller['voiceQueuesChannels']);router['get'](_0x2cb6('0x20'),auth['isAuthenticated'](),controller[_0x2cb6('0x21')]);router[_0x2cb6('0x7')](_0x2cb6('0x22'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x23')]);router[_0x2cb6('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x24')]);router[_0x2cb6('0x7')]('/voice/queues/:id',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x25')]);router[_0x2cb6('0x26')]('/voice/queues/:id',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x27')]);router['get']('/outbound',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x28')]);router[_0x2cb6('0x7')]('/outbound/channels',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x29')]);router[_0x2cb6('0x7')](_0x2cb6('0x2a'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x2b')]);router['put'](_0x2cb6('0x2c'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x2d')]);router[_0x2cb6('0x7')]('/telephones',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x2e')]);router[_0x2cb6('0x7')](_0x2cb6('0x2f'),auth[_0x2cb6('0xa')](),controller['trunks']);router[_0x2cb6('0x7')]('/campaigns',auth[_0x2cb6('0xa')](),controller['campaigns']);router[_0x2cb6('0x7')]('/fax/accounts',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x30')]);router[_0x2cb6('0x7')](_0x2cb6('0x31'),auth['isAuthenticated'](),controller[_0x2cb6('0x32')]);router['get'](_0x2cb6('0x33'),auth['isAuthenticated'](),controller[_0x2cb6('0x34')]);router[_0x2cb6('0x7')](_0x2cb6('0x35'),auth['isAuthenticated'](),controller[_0x2cb6('0x36')]);router[_0x2cb6('0x7')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x2cb6('0x37')]);router[_0x2cb6('0x7')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2cb6('0x38')]);router[_0x2cb6('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x39')]);router[_0x2cb6('0x7')](_0x2cb6('0x3a'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x3b')]);router['post'](_0x2cb6('0x3c'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x3d')](_0x2cb6('0x3e')));router['get'](_0x2cb6('0x3f'),auth['isAuthenticated'](),controller[_0x2cb6('0x40')]);router[_0x2cb6('0x41')](_0x2cb6('0x42'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x3d')]('chat'));router['get'](_0x2cb6('0x43'),auth[_0x2cb6('0xa')](),controller['showChatQueues']);router[_0x2cb6('0x41')](_0x2cb6('0x44'),auth['isAuthenticated'](),controller[_0x2cb6('0x3d')](_0x2cb6('0x45')));router['get'](_0x2cb6('0x46'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x47')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2cb6('0x3d')](_0x2cb6('0x48')));router[_0x2cb6('0x7')](_0x2cb6('0x49'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x2cb6('0x41')](_0x2cb6('0x4a'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x3d')](_0x2cb6('0x4b')));router[_0x2cb6('0x41')](_0x2cb6('0x4c'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x3d')]('whatsapp'));router[_0x2cb6('0x7')](_0x2cb6('0x4d'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x2cb6('0x7')](_0x2cb6('0x4e'),auth[_0x2cb6('0xa')](),controller['showWhatsappQueues']);router[_0x2cb6('0x41')](_0x2cb6('0x4f'),auth[_0x2cb6('0xa')](),controller[_0x2cb6('0x50')]);module[_0x2cb6('0x51')]=router; \ No newline at end of file +var _0x2a78=['/sms/queues/:id/notify','sms','whatsapp','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','util','express','Router','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues'];(function(_0x2be6ab,_0x215ff7){var _0x253862=function(_0x1e853a){while(--_0x1e853a){_0x2be6ab['push'](_0x2be6ab['shift']());}};_0x253862(++_0x215ff7);}(_0x2a78,0x1e7));var _0x82a7=function(_0x4fc22b,_0x409a04){_0x4fc22b=_0x4fc22b-0x0;var _0x5cd908=_0x2a78[_0x4fc22b];return _0x5cd908;};'use strict';var multer=require(_0x82a7('0x0'));var util=require(_0x82a7('0x1'));var path=require('path');var express=require(_0x82a7('0x2'));var router=express[_0x82a7('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x82a7('0x4'));router['get'](_0x82a7('0x5'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x7')]);router['get'](_0x82a7('0x8'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x9')]);router[_0x82a7('0xa')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x82a7('0xb')]);router[_0x82a7('0xa')](_0x82a7('0xc'),auth['isAuthenticated'](),controller[_0x82a7('0xd')]);router['get'](_0x82a7('0xe'),auth[_0x82a7('0x6')](),controller[_0x82a7('0xf')]);router[_0x82a7('0xa')](_0x82a7('0x10'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x11')]);router['get'](_0x82a7('0x12'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x13')]);router[_0x82a7('0xa')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x82a7('0x14')]);router[_0x82a7('0xa')](_0x82a7('0x15'),auth['isAuthenticated'](),controller[_0x82a7('0x16')]);router[_0x82a7('0xa')](_0x82a7('0x17'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x18')]);router[_0x82a7('0xa')](_0x82a7('0x19'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x1a')]);router[_0x82a7('0xa')](_0x82a7('0x1b'),auth['isAuthenticated'](),controller[_0x82a7('0x1c')]);router[_0x82a7('0xa')]('/voice/queues/channels',auth[_0x82a7('0x6')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x82a7('0x6')](),controller[_0x82a7('0x1d')]);router[_0x82a7('0xa')](_0x82a7('0x1e'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x1f')]);router[_0x82a7('0xa')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x82a7('0x6')](),controller[_0x82a7('0x20')]);router['get']('/voice/queues/:id',auth[_0x82a7('0x6')](),controller['showVoiceQueues']);router[_0x82a7('0x21')](_0x82a7('0x22'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x23')]);router['get'](_0x82a7('0x24'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x25')]);router[_0x82a7('0xa')]('/outbound/channels',auth[_0x82a7('0x6')](),controller['outboundChannels']);router[_0x82a7('0xa')](_0x82a7('0x26'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x27')]);router[_0x82a7('0x21')](_0x82a7('0x28'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x29')]);router[_0x82a7('0xa')](_0x82a7('0x2a'),auth[_0x82a7('0x6')](),controller['telephones']);router[_0x82a7('0xa')](_0x82a7('0x2b'),auth[_0x82a7('0x6')](),controller['trunks']);router[_0x82a7('0xa')](_0x82a7('0x2c'),auth[_0x82a7('0x6')](),controller['campaigns']);router['get'](_0x82a7('0x2d'),auth['isAuthenticated'](),controller[_0x82a7('0x2e')]);router[_0x82a7('0xa')](_0x82a7('0x2f'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x30')]);router[_0x82a7('0xa')](_0x82a7('0x31'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x32')]);router[_0x82a7('0xa')](_0x82a7('0x33'),auth[_0x82a7('0x6')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x82a7('0x34'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x35')]);router['get']('/sms/queues/waitinginteractions',auth[_0x82a7('0x6')](),controller[_0x82a7('0x36')]);router[_0x82a7('0xa')](_0x82a7('0x37'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x38')]);router[_0x82a7('0xa')](_0x82a7('0x39'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x3a')]);router['post'](_0x82a7('0x3b'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x3c')]('mail'));router[_0x82a7('0xa')](_0x82a7('0x3d'),auth['isAuthenticated'](),controller[_0x82a7('0x3e')]);router[_0x82a7('0x3f')](_0x82a7('0x40'),auth['isAuthenticated'](),controller[_0x82a7('0x3c')](_0x82a7('0x41')));router[_0x82a7('0xa')]('/chat/queues/:id',auth[_0x82a7('0x6')](),controller[_0x82a7('0x42')]);router['post'](_0x82a7('0x43'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x3c')]('fax'));router[_0x82a7('0xa')](_0x82a7('0x44'),auth[_0x82a7('0x6')](),controller['showFaxQueues']);router[_0x82a7('0x3f')](_0x82a7('0x45'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x3c')](_0x82a7('0x46')));router[_0x82a7('0xa')](_0x82a7('0x47'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x48')]);router[_0x82a7('0x3f')](_0x82a7('0x49'),auth[_0x82a7('0x6')](),controller[_0x82a7('0x3c')](_0x82a7('0x4a')));router[_0x82a7('0x3f')]('/whatsapp/queues/:id/notify',auth[_0x82a7('0x6')](),controller[_0x82a7('0x3c')](_0x82a7('0x4b')));router[_0x82a7('0xa')]('/sms/queues/:id',auth[_0x82a7('0x6')](),controller[_0x82a7('0x4c')]);router[_0x82a7('0xa')]('/whatsapp/queues/:id',auth[_0x82a7('0x6')](),controller[_0x82a7('0x4d')]);router[_0x82a7('0x3f')]('/agents/:id/notify',auth[_0x82a7('0x6')](),controller[_0x82a7('0x4e')]);module[_0x82a7('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 11f336f..dfad1a4 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 _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0xac9d,0x14d));var _0xdac9=function(_0x14286a,_0x54bf72){_0x14286a=_0x14286a-0x0;var _0x26d207=_0xac9d[_0x14286a];return _0x26d207;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file +var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x1348df,_0x4124ef){var _0x44f99b=function(_0x2d0169){while(--_0x2d0169){_0x1348df['push'](_0x1348df['shift']());}};_0x44f99b(++_0x4124ef);}(_0x2d17,0x17e));var _0x72d1=function(_0x563451,_0x225bca){_0x563451=_0x563451-0x0;var _0x43f99e=_0x2d17[_0x563451];return _0x43f99e;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a5bcb2a..d8500e1 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 _0x4ba5=['post','create','put','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4ba5,0xa6));var _0x54ba=function(_0x120647,_0x5ab0d0){_0x120647=_0x120647-0x0;var _0x3f7cba=_0x4ba5[_0x120647];return _0x3f7cba;};'use strict';var multer=require('multer');var util=require(_0x54ba('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x54ba('0x1'));var router=express[_0x54ba('0x2')]();var fs_extra=require(_0x54ba('0x3'));var auth=require(_0x54ba('0x4'));var interaction=require(_0x54ba('0x5'));var config=require(_0x54ba('0x6'));var controller=require(_0x54ba('0x7'));router[_0x54ba('0x8')]('/',auth[_0x54ba('0x9')](),controller[_0x54ba('0xa')]);router[_0x54ba('0x8')](_0x54ba('0xb'),auth[_0x54ba('0x9')](),controller['show']);router['get'](_0x54ba('0xc'),auth['isAuthenticated'](),controller[_0x54ba('0xd')]);router[_0x54ba('0xe')]('/',auth[_0x54ba('0x9')](),controller[_0x54ba('0xf')]);router[_0x54ba('0x10')]('/:id',auth[_0x54ba('0x9')](),controller['update']);router[_0x54ba('0x11')](_0x54ba('0xb'),auth[_0x54ba('0x9')](),controller[_0x54ba('0x12')]);module[_0x54ba('0x13')]=router; \ No newline at end of file +var _0x34bc=['Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post','create','put','/:id','update','exports','multer','util','path','express'];(function(_0x23f9c0,_0x46bb19){var _0x5a27cd=function(_0x3c09d0){while(--_0x3c09d0){_0x23f9c0['push'](_0x23f9c0['shift']());}};_0x5a27cd(++_0x46bb19);}(_0x34bc,0x14c));var _0xc34b=function(_0x3e542d,_0x210259){_0x3e542d=_0x3e542d-0x0;var _0x3830a8=_0x34bc[_0x3e542d];return _0x3830a8;};'use strict';var multer=require(_0xc34b('0x0'));var util=require(_0xc34b('0x1'));var path=require(_0xc34b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc34b('0x3'));var router=express[_0xc34b('0x4')]();var fs_extra=require(_0xc34b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc34b('0x6'));var config=require(_0xc34b('0x7'));var controller=require(_0xc34b('0x8'));router[_0xc34b('0x9')]('/',auth[_0xc34b('0xa')](),controller[_0xc34b('0xb')]);router[_0xc34b('0x9')]('/:id',auth[_0xc34b('0xa')](),controller[_0xc34b('0xc')]);router['get'](_0xc34b('0xd'),auth['isAuthenticated'](),controller[_0xc34b('0xe')]);router[_0xc34b('0xf')]('/',auth[_0xc34b('0xa')](),controller[_0xc34b('0x10')]);router[_0xc34b('0x11')](_0xc34b('0x12'),auth[_0xc34b('0xa')](),controller[_0xc34b('0x13')]);router['delete'](_0xc34b('0x12'),auth[_0xc34b('0xa')](),controller['destroy']);module[_0xc34b('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2e31fd7..868395a 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 _0x2954=['csv','pdf','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0x11a9e3,_0x51c78f){var _0x47772d=function(_0x30056f){while(--_0x30056f){_0x11a9e3['push'](_0x11a9e3['shift']());}};_0x47772d(++_0x51c78f);}(_0x2954,0x9d));var _0x4295=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x2954[_0x5ac84c];return _0x3c53d2;};'use strict';var Sequelize=require('sequelize');module[_0x4295('0x0')]={'name':{'type':Sequelize[_0x4295('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4295('0x1')]},'active':{'type':Sequelize[_0x4295('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4295('0x1')],'allowNull':![],'defaultValue':_0x4295('0x3')},'startAt':{'type':Sequelize[_0x4295('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4295('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4295('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4295('0x6')](_0x4295('0x7'),_0x4295('0x8'),_0x4295('0x9'),_0x4295('0xa'),_0x4295('0xb'),_0x4295('0xc'),_0x4295('0xd')),'allowNull':![],'defaultValue':_0x4295('0xb')},'output':{'type':Sequelize[_0x4295('0x6')](_0x4295('0xe'),_0x4295('0xf'),_0x4295('0x10')),'allowNull':![],'defaultValue':_0x4295('0xe')},'type':{'type':Sequelize[_0x4295('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x4295('0x11')},'sendMail':{'type':Sequelize[_0x4295('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4295('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x4295('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x4295('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd2f=['minutes','csv','pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','months','days','hours'];(function(_0x3dab34,_0x48e9a){var _0x26f968=function(_0x1d3d61){while(--_0x1d3d61){_0x3dab34['push'](_0x3dab34['shift']());}};_0x26f968(++_0x48e9a);}(_0xfd2f,0x135));var _0xffd2=function(_0x97f219,_0x2f4c3a){_0x97f219=_0x97f219-0x0;var _0x54d14f=_0xfd2f[_0x97f219];return _0x54d14f;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'name':{'type':Sequelize[_0xffd2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xffd2('0x2')]},'active':{'type':Sequelize[_0xffd2('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xffd2('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xffd2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xffd2('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xffd2('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xffd2('0x6')](_0xffd2('0x7'),'quarters',_0xffd2('0x8'),'weeks',_0xffd2('0x9'),_0xffd2('0xa'),_0xffd2('0xb')),'allowNull':![],'defaultValue':_0xffd2('0x9')},'output':{'type':Sequelize['ENUM'](_0xffd2('0xc'),_0xffd2('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xffd2('0xc')},'type':{'type':Sequelize[_0xffd2('0x6')](_0xffd2('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xffd2('0xf')]},'bcc':{'type':Sequelize[_0xffd2('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 201cd68..22280ea 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 _0x1cd4=['index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','Schedule','includeAll','include','findAll','rows','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','end','stack','name','send'];(function(_0x214515,_0x281baa){var _0x34cf1e=function(_0x26fbc4){while(--_0x26fbc4){_0x214515['push'](_0x214515['shift']());}};_0x34cf1e(++_0x281baa);}(_0x1cd4,0x13a));var _0x41cd=function(_0x2090d4,_0x46f10f){_0x2090d4=_0x2090d4-0x0;var _0x2137ad=_0x1cd4[_0x2090d4];return _0x2137ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41cd('0x0'));var zipdir=require(_0x41cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41cd('0x2'));var moment=require(_0x41cd('0x3'));var BPromise=require(_0x41cd('0x4'));var Mustache=require(_0x41cd('0x5'));var util=require(_0x41cd('0x6'));var path=require(_0x41cd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x41cd('0x8'));var fs=require('fs');var fs_extra=require(_0x41cd('0x9'));var _=require('lodash');var squel=require(_0x41cd('0xa'));var crypto=require(_0x41cd('0xb'));var jsforce=require(_0x41cd('0xc'));var deskjs=require(_0x41cd('0xd'));var toCsv=require(_0x41cd('0xe'));var querystring=require('querystring');var Papa=require(_0x41cd('0xf'));var Redis=require(_0x41cd('0x10'));var authService=require(_0x41cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41cd('0x12'));var hardwareService=require(_0x41cd('0x13'));var logger=require(_0x41cd('0x14'))(_0x41cd('0x15'));var utils=require(_0x41cd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x41cd('0x17'));var db=require(_0x41cd('0x18'))['db'];function respondWithStatusCode(_0x206359,_0x36be20){_0x36be20=_0x36be20||0xcc;return function(_0x38bcd4){if(_0x38bcd4){return _0x206359[_0x41cd('0x19')](_0x36be20);}return _0x206359[_0x41cd('0x1a')](_0x36be20)['end']();};}function respondWithResult(_0x21b3f7,_0x4a5235){_0x4a5235=_0x4a5235||0xc8;return function(_0x26dfae){if(_0x26dfae){return _0x21b3f7['status'](_0x4a5235)[_0x41cd('0x1b')](_0x26dfae);}};}function respondWithFilteredResult(_0x3885c6,_0xbaa8df){return function(_0x5ca4bc){if(_0x5ca4bc){var _0xa8f3e2=typeof _0xbaa8df[_0x41cd('0x1c')]==='undefined'&&typeof _0xbaa8df['limit']===_0x41cd('0x1d');var _0x3e94d0=_0x5ca4bc[_0x41cd('0x1e')];var _0x64a90e=_0xa8f3e2?0x0:_0xbaa8df[_0x41cd('0x1c')];var _0x573987=_0xa8f3e2?_0x5ca4bc[_0x41cd('0x1e')]:_0xbaa8df[_0x41cd('0x1c')]+_0xbaa8df[_0x41cd('0x1f')];var _0x5b2ee6;if(_0x573987>=_0x3e94d0){_0x573987=_0x3e94d0;_0x5b2ee6=0xc8;}else{_0x5b2ee6=0xce;}_0x3885c6[_0x41cd('0x1a')](_0x5b2ee6);return _0x3885c6[_0x41cd('0x20')](_0x41cd('0x21'),_0x64a90e+'-'+_0x573987+'/'+_0x3e94d0)[_0x41cd('0x1b')](_0x5ca4bc);}return null;};}function patchUpdates(_0x5731f6){return function(_0x5959db){try{jsonpatch[_0x41cd('0x22')](_0x5959db,_0x5731f6,!![]);}catch(_0x438c32){return BPromise[_0x41cd('0x23')](_0x438c32);}return _0x5959db[_0x41cd('0x24')]();};}function saveUpdates(_0x4bd1ae,_0x1a8463){return function(_0x24e9e1){if(_0x24e9e1){return _0x24e9e1[_0x41cd('0x25')](_0x4bd1ae)[_0x41cd('0x26')](function(_0xc5432d){return _0xc5432d;});}return null;};}function removeEntity(_0x403ee7,_0x339455){return function(_0x3ffe46){if(_0x3ffe46){return _0x3ffe46[_0x41cd('0x27')]()[_0x41cd('0x26')](function(){var _0x3538e7=_0x3ffe46[_0x41cd('0x28')]({'plain':!![]});var _0x2d1f51=_0x41cd('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x2d1f51,'resourceId':_0x3538e7['id']}})[_0x41cd('0x26')](function(){return _0x3ffe46;});})[_0x41cd('0x26')](function(){_0x403ee7[_0x41cd('0x1a')](0xcc)[_0x41cd('0x2a')]();});}};}function handleEntityNotFound(_0xce9330,_0x83d672){return function(_0x2ba2f7){if(!_0x2ba2f7){_0xce9330[_0x41cd('0x19')](0x194);}return _0x2ba2f7;};}function handleError(_0x2799aa,_0x267b75){_0x267b75=_0x267b75||0x1f4;return function(_0x47f1aa){logger['error'](_0x47f1aa[_0x41cd('0x2b')]);if(_0x47f1aa[_0x41cd('0x2c')]){delete _0x47f1aa[_0x41cd('0x2c')];}_0x2799aa[_0x41cd('0x1a')](_0x267b75)[_0x41cd('0x2d')](_0x47f1aa);};}exports[_0x41cd('0x2e')]=function(_0x29e6df,_0x240f5f){var _0xffc575={},_0x45a119={},_0x94f491={'count':0x0,'rows':[]};var _0x434f03=_['map'](db['Schedule'][_0x41cd('0x2f')],function(_0xd2d0a5){return{'name':_0xd2d0a5[_0x41cd('0x30')],'type':_0xd2d0a5['type'][_0x41cd('0x31')]};});_0x45a119[_0x41cd('0x32')]=_[_0x41cd('0x33')](_0x434f03,_0x41cd('0x2c'));_0x45a119[_0x41cd('0x34')]=_[_0x41cd('0x35')](_0x29e6df['query']);_0x45a119[_0x41cd('0x36')]=_[_0x41cd('0x37')](_0x45a119[_0x41cd('0x32')],_0x45a119[_0x41cd('0x34')]);_0xffc575[_0x41cd('0x38')]=_[_0x41cd('0x37')](_0x45a119[_0x41cd('0x32')],qs[_0x41cd('0x39')](_0x29e6df[_0x41cd('0x34')][_0x41cd('0x39')]));_0xffc575[_0x41cd('0x38')]=_0xffc575[_0x41cd('0x38')][_0x41cd('0x3a')]?_0xffc575['attributes']:_0x45a119['model'];if(!_0x29e6df[_0x41cd('0x34')][_0x41cd('0x3b')]('nolimit')){_0xffc575[_0x41cd('0x1f')]=qs[_0x41cd('0x1f')](_0x29e6df[_0x41cd('0x34')]['limit']);_0xffc575[_0x41cd('0x1c')]=qs[_0x41cd('0x1c')](_0x29e6df[_0x41cd('0x34')][_0x41cd('0x1c')]);}_0xffc575[_0x41cd('0x3c')]=qs[_0x41cd('0x3d')](_0x29e6df[_0x41cd('0x34')]['sort']);_0xffc575['where']=qs[_0x41cd('0x36')](_[_0x41cd('0x3e')](_0x29e6df[_0x41cd('0x34')],_0x45a119[_0x41cd('0x36')]),_0x434f03);if(_0x29e6df[_0x41cd('0x34')][_0x41cd('0x3f')]){_0xffc575[_0x41cd('0x40')]=_['merge'](_0xffc575[_0x41cd('0x40')],{'$or':_['map'](_0x434f03,function(_0x114b9d){if(_0x114b9d['type']!==_0x41cd('0x41')){var _0x52ef1a={};_0x52ef1a[_0x114b9d[_0x41cd('0x2c')]]={'$like':'%'+_0x29e6df[_0x41cd('0x34')][_0x41cd('0x3f')]+'%'};return _0x52ef1a;}})});}_0xffc575=_[_0x41cd('0x42')]({},_0xffc575,_0x29e6df['options']);var _0x2c67f5={'where':_0xffc575[_0x41cd('0x40')]};return db[_0x41cd('0x43')][_0x41cd('0x1e')](_0x2c67f5)[_0x41cd('0x26')](function(_0x5379c6){_0x94f491[_0x41cd('0x1e')]=_0x5379c6;if(_0x29e6df[_0x41cd('0x34')][_0x41cd('0x44')]){_0xffc575[_0x41cd('0x45')]=[{'all':!![]}];}return db[_0x41cd('0x43')][_0x41cd('0x46')](_0xffc575);})[_0x41cd('0x26')](function(_0xfbdf18){_0x94f491[_0x41cd('0x47')]=_0xfbdf18;return _0x94f491;})[_0x41cd('0x26')](respondWithFilteredResult(_0x240f5f,_0xffc575))['catch'](handleError(_0x240f5f,null));};exports[_0x41cd('0x48')]=function(_0x591c08,_0x1c8bb5){var _0x3fade6={'raw':![],'where':{'id':_0x591c08[_0x41cd('0x49')]['id']}},_0x2bcc15={};_0x2bcc15[_0x41cd('0x32')]=_[_0x41cd('0x35')](db[_0x41cd('0x43')]['rawAttributes']);_0x2bcc15[_0x41cd('0x34')]=_[_0x41cd('0x35')](_0x591c08[_0x41cd('0x34')]);_0x2bcc15['filters']=_[_0x41cd('0x37')](_0x2bcc15[_0x41cd('0x32')],_0x2bcc15[_0x41cd('0x34')]);_0x3fade6['attributes']=_[_0x41cd('0x37')](_0x2bcc15[_0x41cd('0x32')],qs[_0x41cd('0x39')](_0x591c08[_0x41cd('0x34')][_0x41cd('0x39')]));_0x3fade6['attributes']=_0x3fade6[_0x41cd('0x38')][_0x41cd('0x3a')]?_0x3fade6[_0x41cd('0x38')]:_0x2bcc15[_0x41cd('0x32')];if(_0x591c08[_0x41cd('0x34')]['includeAll']){_0x3fade6['include']=[{'all':!![]}];}_0x3fade6=_[_0x41cd('0x42')]({},_0x3fade6,_0x591c08[_0x41cd('0x4a')]);return db['Schedule']['find'](_0x3fade6)[_0x41cd('0x26')](handleEntityNotFound(_0x1c8bb5,null))[_0x41cd('0x26')](respondWithResult(_0x1c8bb5,null))[_0x41cd('0x4b')](handleError(_0x1c8bb5,null));};exports['create']=function(_0x15521a,_0x6180b3){return db[_0x41cd('0x43')][_0x41cd('0x4c')](_0x15521a[_0x41cd('0x4d')],{})['then'](function(_0x46d5e8){var _0x25b01a=_0x15521a[_0x41cd('0x4e')]['get']({'plain':!![]});if(!_0x25b01a)throw new Error(_0x41cd('0x4f'));if(_0x25b01a[_0x41cd('0x50')]===_0x41cd('0x4e')){var _0x22c264=_0x46d5e8[_0x41cd('0x28')]({'plain':!![]});var _0x165878=_0x41cd('0x29');return db[_0x41cd('0x51')][_0x41cd('0x52')]({'where':{'name':_0x165878,'userProfileId':_0x25b01a[_0x41cd('0x53')]},'raw':!![]})[_0x41cd('0x26')](function(_0x3b062a){if(_0x3b062a&&_0x3b062a[_0x41cd('0x54')]===0x0){return db[_0x41cd('0x55')][_0x41cd('0x4c')]({'name':_0x22c264[_0x41cd('0x2c')],'resourceId':_0x22c264['id'],'type':_0x3b062a[_0x41cd('0x2c')],'sectionId':_0x3b062a['id']},{})['then'](function(){return _0x46d5e8;});}else{return _0x46d5e8;}})[_0x41cd('0x4b')](function(_0x11ac9b){logger[_0x41cd('0x56')](_0x41cd('0x57'),_0x11ac9b);throw _0x11ac9b;});}return _0x46d5e8;})['then'](respondWithResult(_0x6180b3,0xc9))[_0x41cd('0x4b')](handleError(_0x6180b3,null));};exports[_0x41cd('0x25')]=function(_0x18a5e4,_0x4e6414){if(_0x18a5e4[_0x41cd('0x4d')]['id']){delete _0x18a5e4[_0x41cd('0x4d')]['id'];}return db['Schedule']['find']({'where':{'id':_0x18a5e4[_0x41cd('0x49')]['id']}})[_0x41cd('0x26')](handleEntityNotFound(_0x4e6414,null))[_0x41cd('0x26')](saveUpdates(_0x18a5e4['body'],null))['then'](respondWithResult(_0x4e6414,null))['catch'](handleError(_0x4e6414,null));};exports[_0x41cd('0x27')]=function(_0x2f34d5,_0x26cdda){return db[_0x41cd('0x43')]['find']({'where':{'id':_0x2f34d5[_0x41cd('0x49')]['id']}})[_0x41cd('0x26')](handleEntityNotFound(_0x26cdda,null))[_0x41cd('0x26')](removeEntity(_0x26cdda,null))[_0x41cd('0x4b')](handleError(_0x26cdda,null));};exports[_0x41cd('0x58')]=function(_0xb3d592,_0x57c59c,_0xad69ac){var _0x41ebc0=require(_0x41cd('0x59'));return db['Schedule'][_0x41cd('0x52')]({'where':{'id':_0xb3d592[_0x41cd('0x49')]['id']},'raw':!![]})[_0x41cd('0x26')](handleEntityNotFound(_0x57c59c,null))[_0x41cd('0x26')](function(){_0x41ebc0[_0x41cd('0x58')](_0xb3d592[_0x41cd('0x49')]['id']);})[_0x41cd('0x26')](respondWithStatusCode(_0x57c59c,null))[_0x41cd('0x4b')](handleError(_0x57c59c,null));}; \ No newline at end of file +var _0x3feb=['body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','run','../../config/schedule','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','end','sendStatus','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','include','options','find','create'];(function(_0x2e6321,_0x5c9e40){var _0x163f0b=function(_0x283229){while(--_0x283229){_0x2e6321['push'](_0x2e6321['shift']());}};_0x163f0b(++_0x5c9e40);}(_0x3feb,0x1ee));var _0xb3fe=function(_0x3842da,_0xa23321){_0x3842da=_0x3842da-0x0;var _0x255239=_0x3feb[_0x3842da];return _0x255239;};'use strict';var emlformat=require(_0xb3fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3fe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb3fe('0x2'));var BPromise=require(_0xb3fe('0x3'));var Mustache=require(_0xb3fe('0x4'));var util=require(_0xb3fe('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb3fe('0x6'));var ejs=require(_0xb3fe('0x7'));var fs=require('fs');var fs_extra=require(_0xb3fe('0x8'));var _=require(_0xb3fe('0x9'));var squel=require(_0xb3fe('0xa'));var crypto=require(_0xb3fe('0xb'));var jsforce=require(_0xb3fe('0xc'));var deskjs=require(_0xb3fe('0xd'));var toCsv=require(_0xb3fe('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb3fe('0xe'));var authService=require(_0xb3fe('0xf'));var qs=require(_0xb3fe('0x10'));var as=require(_0xb3fe('0x11'));var hardwareService=require(_0xb3fe('0x12'));var logger=require(_0xb3fe('0x13'))(_0xb3fe('0x14'));var utils=require('../../config/utils');var config=require(_0xb3fe('0x15'));var licenseUtil=require(_0xb3fe('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2deca1,_0x3d34da){_0x3d34da=_0x3d34da||0xcc;return function(_0x3e670f){if(_0x3e670f){return _0x2deca1['sendStatus'](_0x3d34da);}return _0x2deca1[_0xb3fe('0x17')](_0x3d34da)['end']();};}function respondWithResult(_0xa58f95,_0x37c108){_0x37c108=_0x37c108||0xc8;return function(_0x5eb6f9){if(_0x5eb6f9){return _0xa58f95[_0xb3fe('0x17')](_0x37c108)[_0xb3fe('0x18')](_0x5eb6f9);}};}function respondWithFilteredResult(_0x13dfa3,_0x50a74b){return function(_0x1c057c){if(_0x1c057c){var _0x26dcb8=typeof _0x50a74b[_0xb3fe('0x19')]===_0xb3fe('0x1a')&&typeof _0x50a74b[_0xb3fe('0x1b')]===_0xb3fe('0x1a');var _0x3df5f4=_0x1c057c[_0xb3fe('0x1c')];var _0x22ab48=_0x26dcb8?0x0:_0x50a74b[_0xb3fe('0x19')];var _0x349403=_0x26dcb8?_0x1c057c[_0xb3fe('0x1c')]:_0x50a74b[_0xb3fe('0x19')]+_0x50a74b[_0xb3fe('0x1b')];var _0x13188e;if(_0x349403>=_0x3df5f4){_0x349403=_0x3df5f4;_0x13188e=0xc8;}else{_0x13188e=0xce;}_0x13dfa3['status'](_0x13188e);return _0x13dfa3[_0xb3fe('0x1d')](_0xb3fe('0x1e'),_0x22ab48+'-'+_0x349403+'/'+_0x3df5f4)[_0xb3fe('0x18')](_0x1c057c);}return null;};}function patchUpdates(_0x2d1efb){return function(_0x1a3bc0){try{jsonpatch[_0xb3fe('0x1f')](_0x1a3bc0,_0x2d1efb,!![]);}catch(_0x3a2dc6){return BPromise['reject'](_0x3a2dc6);}return _0x1a3bc0[_0xb3fe('0x20')]();};}function saveUpdates(_0x45cf88,_0x29d29f){return function(_0x131e12){if(_0x131e12){return _0x131e12[_0xb3fe('0x21')](_0x45cf88)[_0xb3fe('0x22')](function(_0x3696e1){return _0x3696e1;});}return null;};}function removeEntity(_0x36a18c,_0x67c428){return function(_0x44d897){if(_0x44d897){return _0x44d897[_0xb3fe('0x23')]()[_0xb3fe('0x22')](function(){var _0x379b54=_0x44d897[_0xb3fe('0x24')]({'plain':!![]});var _0xf95914=_0xb3fe('0x25');return db['UserProfileResource'][_0xb3fe('0x23')]({'where':{'type':_0xf95914,'resourceId':_0x379b54['id']}})['then'](function(){return _0x44d897;});})['then'](function(){_0x36a18c['status'](0xcc)[_0xb3fe('0x26')]();});}};}function handleEntityNotFound(_0x211fc7,_0x47c735){return function(_0x40c1b3){if(!_0x40c1b3){_0x211fc7[_0xb3fe('0x27')](0x194);}return _0x40c1b3;};}function handleError(_0x39714f,_0x35a678){_0x35a678=_0x35a678||0x1f4;return function(_0x9270e7){logger[_0xb3fe('0x28')](_0x9270e7[_0xb3fe('0x29')]);if(_0x9270e7[_0xb3fe('0x2a')]){delete _0x9270e7[_0xb3fe('0x2a')];}_0x39714f[_0xb3fe('0x17')](_0x35a678)[_0xb3fe('0x2b')](_0x9270e7);};}exports['index']=function(_0x4cd685,_0x4da9d7){var _0x55c6ae={},_0x5ca5cf={},_0x47f238={'count':0x0,'rows':[]};var _0x133b8a=_[_0xb3fe('0x2c')](db[_0xb3fe('0x2d')][_0xb3fe('0x2e')],function(_0x1ed778){return{'name':_0x1ed778[_0xb3fe('0x2f')],'type':_0x1ed778[_0xb3fe('0x30')][_0xb3fe('0x31')]};});_0x5ca5cf[_0xb3fe('0x32')]=_[_0xb3fe('0x2c')](_0x133b8a,_0xb3fe('0x2a'));_0x5ca5cf['query']=_[_0xb3fe('0x33')](_0x4cd685[_0xb3fe('0x34')]);_0x5ca5cf[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x5ca5cf[_0xb3fe('0x32')],_0x5ca5cf['query']);_0x55c6ae['attributes']=_[_0xb3fe('0x36')](_0x5ca5cf['model'],qs['fields'](_0x4cd685['query'][_0xb3fe('0x37')]));_0x55c6ae['attributes']=_0x55c6ae[_0xb3fe('0x38')]['length']?_0x55c6ae['attributes']:_0x5ca5cf[_0xb3fe('0x32')];if(!_0x4cd685['query'][_0xb3fe('0x39')]('nolimit')){_0x55c6ae['limit']=qs[_0xb3fe('0x1b')](_0x4cd685['query'][_0xb3fe('0x1b')]);_0x55c6ae[_0xb3fe('0x19')]=qs[_0xb3fe('0x19')](_0x4cd685['query'][_0xb3fe('0x19')]);}_0x55c6ae[_0xb3fe('0x3a')]=qs[_0xb3fe('0x3b')](_0x4cd685[_0xb3fe('0x34')]['sort']);_0x55c6ae[_0xb3fe('0x3c')]=qs[_0xb3fe('0x35')](_[_0xb3fe('0x3d')](_0x4cd685['query'],_0x5ca5cf[_0xb3fe('0x35')]),_0x133b8a);if(_0x4cd685[_0xb3fe('0x34')][_0xb3fe('0x3e')]){_0x55c6ae[_0xb3fe('0x3c')]=_[_0xb3fe('0x3f')](_0x55c6ae[_0xb3fe('0x3c')],{'$or':_['map'](_0x133b8a,function(_0x1dd845){if(_0x1dd845[_0xb3fe('0x30')]!=='VIRTUAL'){var _0x402d89={};_0x402d89[_0x1dd845[_0xb3fe('0x2a')]]={'$like':'%'+_0x4cd685[_0xb3fe('0x34')][_0xb3fe('0x3e')]+'%'};return _0x402d89;}})});}_0x55c6ae=_[_0xb3fe('0x3f')]({},_0x55c6ae,_0x4cd685['options']);var _0x244b39={'where':_0x55c6ae[_0xb3fe('0x3c')]};return db[_0xb3fe('0x2d')]['count'](_0x244b39)[_0xb3fe('0x22')](function(_0xc7f39b){_0x47f238['count']=_0xc7f39b;if(_0x4cd685[_0xb3fe('0x34')][_0xb3fe('0x40')]){_0x55c6ae['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0x55c6ae);})[_0xb3fe('0x22')](function(_0x332a49){_0x47f238[_0xb3fe('0x41')]=_0x332a49;return _0x47f238;})[_0xb3fe('0x22')](respondWithFilteredResult(_0x4da9d7,_0x55c6ae))[_0xb3fe('0x42')](handleError(_0x4da9d7,null));};exports[_0xb3fe('0x43')]=function(_0x51d2c4,_0x363c60){var _0x2a1aef={'raw':![],'where':{'id':_0x51d2c4[_0xb3fe('0x44')]['id']}},_0x5ba28f={};_0x5ba28f[_0xb3fe('0x32')]=_[_0xb3fe('0x33')](db[_0xb3fe('0x2d')][_0xb3fe('0x2e')]);_0x5ba28f['query']=_[_0xb3fe('0x33')](_0x51d2c4[_0xb3fe('0x34')]);_0x5ba28f[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x5ba28f[_0xb3fe('0x32')],_0x5ba28f[_0xb3fe('0x34')]);_0x2a1aef['attributes']=_[_0xb3fe('0x36')](_0x5ba28f[_0xb3fe('0x32')],qs[_0xb3fe('0x37')](_0x51d2c4[_0xb3fe('0x34')]['fields']));_0x2a1aef[_0xb3fe('0x38')]=_0x2a1aef[_0xb3fe('0x38')]['length']?_0x2a1aef['attributes']:_0x5ba28f['model'];if(_0x51d2c4['query'][_0xb3fe('0x40')]){_0x2a1aef[_0xb3fe('0x45')]=[{'all':!![]}];}_0x2a1aef=_['merge']({},_0x2a1aef,_0x51d2c4[_0xb3fe('0x46')]);return db[_0xb3fe('0x2d')][_0xb3fe('0x47')](_0x2a1aef)['then'](handleEntityNotFound(_0x363c60,null))[_0xb3fe('0x22')](respondWithResult(_0x363c60,null))[_0xb3fe('0x42')](handleError(_0x363c60,null));};exports['create']=function(_0x57267f,_0x44ac96){return db[_0xb3fe('0x2d')][_0xb3fe('0x48')](_0x57267f[_0xb3fe('0x49')],{})[_0xb3fe('0x22')](function(_0x38a1b6){var _0x3aeb6c=_0x57267f[_0xb3fe('0x4a')]['get']({'plain':!![]});if(!_0x3aeb6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aeb6c['role']===_0xb3fe('0x4a')){var _0x3c16ac=_0x38a1b6[_0xb3fe('0x24')]({'plain':!![]});var _0x4d8b57=_0xb3fe('0x25');return db[_0xb3fe('0x4b')][_0xb3fe('0x47')]({'where':{'name':_0x4d8b57,'userProfileId':_0x3aeb6c[_0xb3fe('0x4c')]},'raw':!![]})[_0xb3fe('0x22')](function(_0x6bd478){if(_0x6bd478&&_0x6bd478[_0xb3fe('0x4d')]===0x0){return db[_0xb3fe('0x4e')][_0xb3fe('0x48')]({'name':_0x3c16ac[_0xb3fe('0x2a')],'resourceId':_0x3c16ac['id'],'type':_0x6bd478[_0xb3fe('0x2a')],'sectionId':_0x6bd478['id']},{})[_0xb3fe('0x22')](function(){return _0x38a1b6;});}else{return _0x38a1b6;}})['catch'](function(_0x4c60c3){logger[_0xb3fe('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c60c3);throw _0x4c60c3;});}return _0x38a1b6;})[_0xb3fe('0x22')](respondWithResult(_0x44ac96,0xc9))[_0xb3fe('0x42')](handleError(_0x44ac96,null));};exports[_0xb3fe('0x21')]=function(_0xfef2e0,_0x7829e5){if(_0xfef2e0[_0xb3fe('0x49')]['id']){delete _0xfef2e0['body']['id'];}return db[_0xb3fe('0x2d')]['find']({'where':{'id':_0xfef2e0[_0xb3fe('0x44')]['id']}})[_0xb3fe('0x22')](handleEntityNotFound(_0x7829e5,null))[_0xb3fe('0x22')](saveUpdates(_0xfef2e0[_0xb3fe('0x49')],null))[_0xb3fe('0x22')](respondWithResult(_0x7829e5,null))[_0xb3fe('0x42')](handleError(_0x7829e5,null));};exports[_0xb3fe('0x23')]=function(_0x5b78dc,_0x4c1934){return db[_0xb3fe('0x2d')]['find']({'where':{'id':_0x5b78dc['params']['id']}})[_0xb3fe('0x22')](handleEntityNotFound(_0x4c1934,null))[_0xb3fe('0x22')](removeEntity(_0x4c1934,null))[_0xb3fe('0x42')](handleError(_0x4c1934,null));};exports[_0xb3fe('0x4f')]=function(_0x4b983a,_0x27232c,_0x32655a){var _0x21dad7=require(_0xb3fe('0x50'));return db['Schedule'][_0xb3fe('0x47')]({'where':{'id':_0x4b983a[_0xb3fe('0x44')]['id']},'raw':!![]})[_0xb3fe('0x22')](handleEntityNotFound(_0x27232c,null))[_0xb3fe('0x22')](function(){_0x21dad7[_0xb3fe('0x4f')](_0x4b983a['params']['id']);})['then'](respondWithStatusCode(_0x27232c,null))[_0xb3fe('0x42')](handleError(_0x27232c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8198588..c65c406 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 _0xfe9e=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash'];(function(_0xca1db3,_0x293e6c){var _0x135702=function(_0x362a06){while(--_0x362a06){_0xca1db3['push'](_0xca1db3['shift']());}};_0x135702(++_0x293e6c);}(_0xfe9e,0x137));var _0xefe9=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0xfe9e[_0x50a1f6];return _0x84f8d4;};'use strict';var _=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var logger=require(_0xefe9('0x2'))(_0xefe9('0x3'));var moment=require(_0xefe9('0x4'));var BPromise=require(_0xefe9('0x5'));var rp=require(_0xefe9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xefe9('0x7'));var attributes=require(_0xefe9('0x8'));module[_0xefe9('0x9')]=function(_0x491de8,_0x14ff5c){return _0x491de8['define'](_0xefe9('0xa'),attributes,{'tableName':_0xefe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4835=['exports','define','tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4835,0xc3));var _0x5483=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x4835[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x5483('0x0'));var util=require(_0x5483('0x1'));var logger=require(_0x5483('0x2'))('api');var moment=require(_0x5483('0x3'));var BPromise=require(_0x5483('0x4'));var rp=require(_0x5483('0x5'));var fs=require('fs');var path=require(_0x5483('0x6'));var rimraf=require('rimraf');var config=require(_0x5483('0x7'));var attributes=require(_0x5483('0x8'));module[_0x5483('0x9')]=function(_0xc5da3a,_0x51b059){return _0xc5da3a[_0x5483('0xa')]('Schedule',attributes,{'tableName':_0x5483('0xb'),'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 1908c95..e23a654 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 _0xdf2c=['stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xea91a5,_0x37c91b){var _0x5b4940=function(_0x31fb0f){while(--_0x31fb0f){_0xea91a5['push'](_0xea91a5['shift']());}};_0x5b4940(++_0x37c91b);}(_0xdf2c,0x13f));var _0xcdf2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xdf2c[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xcdf2('0x0'));var moment=require(_0xcdf2('0x1'));var BPromise=require(_0xcdf2('0x2'));var rs=require(_0xcdf2('0x3'));var fs=require('fs');var Redis=require(_0xcdf2('0x4'));var db=require(_0xcdf2('0x5'))['db'];var utils=require(_0xcdf2('0x6'));var logger=require(_0xcdf2('0x7'))(_0xcdf2('0x8'));var config=require('../../config/environment');var jayson=require(_0xcdf2('0x9'));var client=jayson[_0xcdf2('0xa')][_0xcdf2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x312d0f,_0x4e466b,_0x5ed211){return new BPromise(function(_0x34b499,_0x5dae29){return client[_0xcdf2('0xc')](_0x312d0f,_0x5ed211)['then'](function(_0xf95218){logger[_0xcdf2('0xd')](_0xcdf2('0xe'),_0x4e466b,_0xcdf2('0xf'));logger[_0xcdf2('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4e466b,'request\x20sent',JSON[_0xcdf2('0x11')](_0xf95218));if(_0xf95218[_0xcdf2('0x12')]){if(_0xf95218[_0xcdf2('0x12')]['code']===0x1f4){logger[_0xcdf2('0x12')]('Schedule,\x20%s,\x20%s',_0x4e466b,_0xf95218[_0xcdf2('0x12')][_0xcdf2('0x13')]);return _0x5dae29(_0xf95218[_0xcdf2('0x12')][_0xcdf2('0x13')]);}logger[_0xcdf2('0x12')]('Schedule,\x20%s,\x20%s',_0x4e466b,_0xf95218[_0xcdf2('0x12')][_0xcdf2('0x13')]);return _0x34b499(_0xf95218[_0xcdf2('0x12')]['message']);}else{logger[_0xcdf2('0xd')](_0xcdf2('0xe'),_0x4e466b,'request\x20sent');_0x34b499(_0xf95218['result']['message']);}})[_0xcdf2('0x14')](function(_0x12aaae){logger[_0xcdf2('0x12')]('Schedule,\x20%s,\x20%s',_0x4e466b,_0x12aaae);_0x5dae29(_0x12aaae);});});} \ No newline at end of file +var _0x33d2=['request','then','debug','request\x20sent','stringify','error','code','message','Schedule,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3e1b6b,_0x31208f){var _0x493bcf=function(_0x11d354){while(--_0x11d354){_0x3e1b6b['push'](_0x3e1b6b['shift']());}};_0x493bcf(++_0x31208f);}(_0x33d2,0x75));var _0x233d=function(_0x28c870,_0x1bf349){_0x28c870=_0x28c870-0x0;var _0x5e4de6=_0x33d2[_0x28c870];return _0x5e4de6;};'use strict';var _=require(_0x233d('0x0'));var util=require('util');var moment=require(_0x233d('0x1'));var BPromise=require(_0x233d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x233d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x233d('0x4'))(_0x233d('0x5'));var config=require('../../config/environment');var jayson=require(_0x233d('0x6'));var client=jayson[_0x233d('0x7')][_0x233d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2abc3f,_0x5c54cc,_0x3823a5){return new BPromise(function(_0x3c3a7f,_0x3ea131){return client[_0x233d('0x9')](_0x2abc3f,_0x3823a5)[_0x233d('0xa')](function(_0x2b2b3d){logger['info']('Schedule,\x20%s,\x20%s',_0x5c54cc,'request\x20sent');logger[_0x233d('0xb')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5c54cc,_0x233d('0xc'),JSON[_0x233d('0xd')](_0x2b2b3d));if(_0x2b2b3d[_0x233d('0xe')]){if(_0x2b2b3d[_0x233d('0xe')][_0x233d('0xf')]===0x1f4){logger[_0x233d('0xe')]('Schedule,\x20%s,\x20%s',_0x5c54cc,_0x2b2b3d[_0x233d('0xe')][_0x233d('0x10')]);return _0x3ea131(_0x2b2b3d['error'][_0x233d('0x10')]);}logger[_0x233d('0xe')](_0x233d('0x11'),_0x5c54cc,_0x2b2b3d[_0x233d('0xe')]['message']);return _0x3c3a7f(_0x2b2b3d[_0x233d('0xe')][_0x233d('0x10')]);}else{logger[_0x233d('0x12')](_0x233d('0x11'),_0x5c54cc,_0x233d('0xc'));_0x3c3a7f(_0x2b2b3d[_0x233d('0x13')][_0x233d('0x10')]);}})[_0x233d('0x14')](function(_0x380877){logger['error']('Schedule,\x20%s,\x20%s',_0x5c54cc,_0x380877);_0x3ea131(_0x380877);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 938cf52..30233a5 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 _0x05f1=['/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','download','create','put','update','delete'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x05f1,0x74));var _0x105f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x05f1[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x105f('0x0'));var util=require(_0x105f('0x1'));var path=require(_0x105f('0x2'));var timeout=require('connect-timeout');var express=require(_0x105f('0x3'));var router=express['Router']();var fs_extra=require(_0x105f('0x4'));var auth=require(_0x105f('0x5'));var interaction=require(_0x105f('0x6'));var config=require(_0x105f('0x7'));var controller=require('./screenRecording.controller');router[_0x105f('0x8')]('/',auth[_0x105f('0x9')](),controller['index']);router[_0x105f('0x8')](_0x105f('0xa'),auth[_0x105f('0x9')](),controller[_0x105f('0xb')]);router[_0x105f('0x8')]('/:id',auth[_0x105f('0x9')](),controller['show']);router[_0x105f('0x8')]('/:id/download',auth[_0x105f('0x9')](),controller[_0x105f('0xc')]);router['post']('/',auth[_0x105f('0x9')](),controller[_0x105f('0xd')]);router[_0x105f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x105f('0xf')]);router[_0x105f('0x10')](_0x105f('0x11'),auth['isAuthenticated'](),controller[_0x105f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xddc7=['index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x58cc71,_0x2191c8){var _0x49fc9e=function(_0xcbca19){while(--_0xcbca19){_0x58cc71['push'](_0x58cc71['shift']());}};_0x49fc9e(++_0x2191c8);}(_0xddc7,0x1b0));var _0x7ddc=function(_0x928aa1,_0x16bd67){_0x928aa1=_0x928aa1-0x0;var _0x37b02b=_0xddc7[_0x928aa1];return _0x37b02b;};'use strict';var multer=require(_0x7ddc('0x0'));var util=require(_0x7ddc('0x1'));var path=require(_0x7ddc('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ddc('0x3'));var router=express[_0x7ddc('0x4')]();var fs_extra=require(_0x7ddc('0x5'));var auth=require(_0x7ddc('0x6'));var interaction=require(_0x7ddc('0x7'));var config=require(_0x7ddc('0x8'));var controller=require('./screenRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7ddc('0x9')]);router[_0x7ddc('0xa')](_0x7ddc('0xb'),auth[_0x7ddc('0xc')](),controller[_0x7ddc('0xd')]);router[_0x7ddc('0xa')](_0x7ddc('0xe'),auth[_0x7ddc('0xc')](),controller[_0x7ddc('0xf')]);router[_0x7ddc('0xa')](_0x7ddc('0x10'),auth[_0x7ddc('0xc')](),controller[_0x7ddc('0x11')]);router[_0x7ddc('0x12')]('/',auth[_0x7ddc('0xc')](),controller[_0x7ddc('0x13')]);router[_0x7ddc('0x14')](_0x7ddc('0xe'),auth[_0x7ddc('0xc')](),controller['update']);router['delete']('/:id',auth[_0x7ddc('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 0c18c3c..4e6d62e 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 _0x1678=['updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x1678,0x17b));var _0x8167=function(_0x366b7d,_0x4db0e3){_0x366b7d=_0x366b7d-0x0;var _0xb05408=_0x1678[_0x366b7d];return _0xb05408;};'use strict';var Sequelize=require(_0x8167('0x0'));var moment=require(_0x8167('0x1'));var path=require(_0x8167('0x2'));var config=require(_0x8167('0x3'));module[_0x8167('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x8167('0x5'))?path[_0x8167('0x6')](this[_0x8167('0x7')](_0x8167('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x8167('0x8')]},'channel':{'type':Sequelize[_0x8167('0x8')]},'value':{'type':Sequelize[_0x8167('0x8')],'set':function(_0x4ce075){var _0x34768e=_0x4ce075[_0x8167('0x9')](/\\/g,'/');this[_0x8167('0xa')]('value',_0x34768e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8167('0xb')],'set':function(_0x381a87){this['setDataValue'](_0x8167('0xc'),moment()[_0x8167('0xd')](_0x381a87,'ms'));this[_0x8167('0xa')](_0x8167('0xe'),moment());this[_0x8167('0xa')](_0x8167('0xf'),_0x381a87);}},'startedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'closedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0xe')))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x8167('0x13'))[_0x8167('0x12')]();}},'updatedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0x14')))[_0x8167('0x11')](_0x8167('0x13'))[_0x8167('0x12')]();}}}; \ No newline at end of file +var _0x2884=['MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','path','../../config/environment','exports','getDataValue','value','STRING','setDataValue','INTEGER','closedAt','duration','DATE','startedAt'];(function(_0x282419,_0x2809b6){var _0x317df2=function(_0xd07b9c){while(--_0xd07b9c){_0x282419['push'](_0x282419['shift']());}};_0x317df2(++_0x2809b6);}(_0x2884,0x1eb));var _0x4288=function(_0x96ad7d,_0x1017ba){_0x96ad7d=_0x96ad7d-0x0;var _0x32d63a=_0x2884[_0x96ad7d];return _0x32d63a;};'use strict';var Sequelize=require(_0x4288('0x0'));var moment=require('moment');var path=require(_0x4288('0x1'));var config=require(_0x4288('0x2'));module[_0x4288('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4288('0x4')](_0x4288('0x5'))?path['extname'](this['getDataValue'](_0x4288('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x4288('0x6')]},'channel':{'type':Sequelize[_0x4288('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x526a07){var _0x3a930e=_0x526a07['replace'](/\\/g,'/');this[_0x4288('0x7')](_0x4288('0x5'),_0x3a930e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4288('0x8')],'set':function(_0x3c8d6e){this[_0x4288('0x7')]('startedAt',moment()['subtract'](_0x3c8d6e,'ms'));this[_0x4288('0x7')](_0x4288('0x9'),moment());this[_0x4288('0x7')](_0x4288('0xa'),_0x3c8d6e);}},'startedAt':{'type':Sequelize[_0x4288('0xb')],'get':function(){return moment(this[_0x4288('0x4')](_0x4288('0xc')))['format'](_0x4288('0xd'))[_0x4288('0xe')]();}},'closedAt':{'type':Sequelize[_0x4288('0xb')],'get':function(){return moment(this[_0x4288('0x4')]('closedAt'))[_0x4288('0xf')](_0x4288('0xd'))['toString']();}},'createdAt':{'type':Sequelize[_0x4288('0xb')],'get':function(){return moment(this['getDataValue'](_0x4288('0x10')))['format'](_0x4288('0xd'))[_0x4288('0xe')]();}},'updatedAt':{'type':Sequelize[_0x4288('0xb')],'get':function(){return moment(this[_0x4288('0x4')](_0x4288('0x11')))[_0x4288('0xf')](_0x4288('0xd'))[_0x4288('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 59acd30..69a1b08 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 _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x4a99b0,_0x558293){var _0x3093ac=function(_0x5032df){while(--_0x5032df){_0x4a99b0['push'](_0x4a99b0['shift']());}};_0x3093ac(++_0x558293);}(_0xb458,0x103));var _0x8b45=function(_0x149be0,_0x43d7e7){_0x149be0=_0x149be0-0x0;var _0x5c96f7=_0xb458[_0x149be0];return _0x5c96f7;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file +var _0x9c5a=['ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','recording','existsSync','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xf40dd5,_0x4fce75){_0xf40dd5=_0xf40dd5-0x0;var _0x165f41=_0x9c5a[_0xf40dd5];return _0x165f41;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['ScreenRecording'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['differenceBy'](_[_0xa9c5('0x28')](_0x4f6e70,_0xa9c5('0x26')),[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2e')]=_[_0xa9c5('0x2f')](_0x413edf[_0xa9c5('0x2e')]);_0x185eb8[_0xa9c5('0x30')]=_['intersection'](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8[_0xa9c5('0x2e')]);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x32')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x33')]));_0x198cdf['attributes']=_0x198cdf['attributes'][_0xa9c5('0x34')]?_0x198cdf[_0xa9c5('0x31')]:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x35')](_0xa9c5('0x36'))){_0x198cdf['limit']=qs['limit'](_0x413edf['query'][_0xa9c5('0x1c')]);_0x198cdf[_0xa9c5('0x1e')]=qs['offset'](_0x413edf[_0xa9c5('0x2e')]['offset']);}_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x38')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x38')]);_0x198cdf['where']=qs[_0xa9c5('0x30')](_[_0xa9c5('0x39')](_0x413edf[_0xa9c5('0x2e')],_0x185eb8[_0xa9c5('0x30')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x3a')]){_0x198cdf[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x198cdf['where'],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x46e5d2){if(_0x46e5d2[_0xa9c5('0x3d')]!==_0xa9c5('0x3e')){var _0x1132e0={};_0x1132e0[_0x46e5d2[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf['query'][_0xa9c5('0x3a')]+'%'};return _0x1132e0;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3f')]);var _0x5c89e7={'where':_0x198cdf[_0xa9c5('0x3b')]};return db[_0xa9c5('0x40')][_0xa9c5('0x1d')](_0x5c89e7)['then'](function(_0x12e19c){_0x325c65[_0xa9c5('0x1d')]=_0x12e19c;if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x198cdf['include']=[{'all':!![]}];}return db[_0xa9c5('0x40')][_0xa9c5('0x42')](_0x198cdf);})[_0xa9c5('0x24')](function(_0x45668e){_0x325c65[_0xa9c5('0x43')]=_0x45668e;return _0x325c65;})['then'](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x44')](handleError(_0x32baf9,null));};exports['show']=function(_0x1de605,_0x397614){var _0x2998ad={'raw':![],'where':{'id':_0x1de605[_0xa9c5('0x45')]['id']}},_0xc8fca4={};_0xc8fca4[_0xa9c5('0x2c')]=_[_0xa9c5('0x2f')](db[_0xa9c5('0x40')][_0xa9c5('0x29')]);_0xc8fca4[_0xa9c5('0x2e')]=_['keys'](_0x1de605[_0xa9c5('0x2e')]);_0xc8fca4[_0xa9c5('0x30')]=_[_0xa9c5('0x32')](_0xc8fca4[_0xa9c5('0x2c')],_0xc8fca4[_0xa9c5('0x2e')]);_0x2998ad[_0xa9c5('0x31')]=_['intersection'](_0xc8fca4[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x1de605['query']['fields']));_0x2998ad['attributes']=_0x2998ad['attributes']['length']?_0x2998ad[_0xa9c5('0x31')]:_0xc8fca4[_0xa9c5('0x2c')];if(_0x1de605[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x2998ad[_0xa9c5('0x46')]=[{'all':!![]}];}_0x2998ad=_[_0xa9c5('0x3c')]({},_0x2998ad,_0x1de605[_0xa9c5('0x3f')]);return db[_0xa9c5('0x40')][_0xa9c5('0x47')](_0x2998ad)[_0xa9c5('0x24')](handleEntityNotFound(_0x397614,null))[_0xa9c5('0x24')](respondWithResult(_0x397614,null))[_0xa9c5('0x44')](handleError(_0x397614,null));};exports[_0xa9c5('0x48')]=function(_0x4bf8b4,_0x1108f0){return db['ScreenRecording'][_0xa9c5('0x48')](_0x4bf8b4[_0xa9c5('0x49')],{})['then'](respondWithResult(_0x1108f0,0xc9))['catch'](handleError(_0x1108f0,null));};exports[_0xa9c5('0x23')]=function(_0x32e64a,_0xeb0720){if(_0x32e64a['body']['id']){delete _0x32e64a['body']['id'];}delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4a')];delete _0x32e64a['body'][_0xa9c5('0x4b')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4c')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4d')];return db[_0xa9c5('0x40')]['find']({'where':{'id':_0x32e64a['params']['id']}})['then'](handleEntityNotFound(_0xeb0720,null))[_0xa9c5('0x24')](saveUpdates(_0x32e64a[_0xa9c5('0x49')],null))[_0xa9c5('0x24')](respondWithResult(_0xeb0720,null))[_0xa9c5('0x44')](handleError(_0xeb0720,null));};exports[_0xa9c5('0x4e')]=function(_0x15d044,_0x56bc1d){return db[_0xa9c5('0x40')][_0xa9c5('0x4e')]()[_0xa9c5('0x24')](respondWithResult(_0x56bc1d,null))[_0xa9c5('0x44')](handleError(_0x56bc1d,null));};exports[_0xa9c5('0x4f')]=function(_0x242e8a,_0x547654,_0x4fcc44){var _0x10ff6b=require('../../components/encryptor');var _0x1b158f=![];var _0x5ea9b0={};if(_0x242e8a[_0xa9c5('0x2e')][_0xa9c5('0x3d')]&&_0x242e8a[_0xa9c5('0x2e')]['type']===_0xa9c5('0x50')){_0x5ea9b0[_0xa9c5('0x50')]=_0x242e8a[_0xa9c5('0x45')]['id'];}else{_0x5ea9b0['id']=_0x242e8a[_0xa9c5('0x45')]['id'];}return db['ScreenRecording']['find']({'where':_0x5ea9b0,'attributes':['id',_0xa9c5('0x4d')],'raw':!![]})[_0xa9c5('0x24')](handleEntityNotFound(_0x547654,null))[_0xa9c5('0x24')](function(_0x5b4323){if(_0x5b4323){var _0x31e12e=path[_0xa9c5('0x51')](config[_0xa9c5('0x52')],_0xa9c5('0x53'),_0x5b4323[_0xa9c5('0x4d')]);var _0x29b198=util[_0xa9c5('0x2d')](_0xa9c5('0x54'),_0x31e12e);if(fs['existsSync'](_0x29b198)){_0x1b158f=!![];return _0x10ff6b[_0xa9c5('0x55')](_0x29b198,_0x31e12e,config['secrets'][_0xa9c5('0x56')])[_0xa9c5('0x24')](function(){return _0x5b4323;});}return _0x5b4323;}})[_0xa9c5('0x24')](function(_0x4dfe3a){if(_0x4dfe3a){var _0x4d475a=path[_0xa9c5('0x51')](config['root'],_0xa9c5('0x53'),_0x4dfe3a[_0xa9c5('0x4d')]);if(!fs[_0xa9c5('0x57')](_0x4d475a)){throw new db[(_0xa9c5('0x58'))]['ValidationError'](_0xa9c5('0x59'));}if(_0x4dfe3a[_0xa9c5('0x5a')]){return _0x547654[_0xa9c5('0x4f')](_0x4d475a,_0x4dfe3a[_0xa9c5('0x5a')]+path['extname'](_0x4d475a),function(){if(_0x1b158f){fs['unlink'](_0x4d475a);}});}else{return _0x547654[_0xa9c5('0x4f')](_0x4d475a,function(_0x3deb64){if(_0x1b158f){fs[_0xa9c5('0x5b')](_0x4d475a);}});}}})[_0xa9c5('0x44')](function(_0x279a26){if(_0x279a26[_0xa9c5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x547654[_0xa9c5('0x19')](0x194)[_0xa9c5('0x27')](_0xa9c5('0x5d'));}else{return handleError(_0x547654,null);}});};exports[_0xa9c5('0x5e')]=function(_0x2b8575,_0x372ab9){return db[_0xa9c5('0x40')][_0xa9c5('0x47')]({'where':{'id':_0x2b8575[_0xa9c5('0x45')]['id']}})[_0xa9c5('0x24')](function(_0x50d438){if(_['isNil'](_0x50d438)){throw new ReferenceError(_0xa9c5('0x5f'));}return _0x50d438;})[_0xa9c5('0x24')](function(_0x3322cc){var _0x47afaa=path['join'](config[_0xa9c5('0x52')],'server/files/screen_recordings',_0x3322cc[_0xa9c5('0x4d')]);logger[_0xa9c5('0x60')](_0xa9c5('0x61'),_0x47afaa);if(!_[_0xa9c5('0x62')](_0x3322cc[_0xa9c5('0x4d')])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}_0x47afaa=_0x47afaa+_0xa9c5('0x66');if(!_[_0xa9c5('0x62')](_0x3322cc['value'])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}return _0x3322cc;})[_0xa9c5('0x24')](function(_0x28ba54){if(!_0x28ba54)throw new InternalError();return _0x28ba54['destroy']();})['then'](function(){_0x372ab9[_0xa9c5('0x19')](0xcc)['end']();})[_0xa9c5('0x44')](handleError(_0x372ab9,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index c2c585e..23570f3 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 _0x1909=['path','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1909,0x1f3));var _0x9190=function(_0x10a530,_0x5a49e3){_0x10a530=_0x10a530-0x0;var _0x1ca1a4=_0x1909[_0x10a530];return _0x1ca1a4;};'use strict';var _=require(_0x9190('0x0'));var util=require(_0x9190('0x1'));var logger=require(_0x9190('0x2'))(_0x9190('0x3'));var moment=require(_0x9190('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9190('0x5'));var rimraf=require('rimraf');var config=require(_0x9190('0x6'));var attributes=require(_0x9190('0x7'));module[_0x9190('0x8')]=function(_0x1f844d,_0x67ee79){return _0x1f844d['define'](_0x9190('0x9'),attributes,{'tableName':_0x9190('0xa'),'paranoid':![],'indexes':[{'name':_0x9190('0xb'),'fields':[_0x9190('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b3e=['moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','util','../../config/logger','api'];(function(_0x2641c3,_0x3511a2){var _0xef0386=function(_0x523099){while(--_0x523099){_0x2641c3['push'](_0x2641c3['shift']());}};_0xef0386(++_0x3511a2);}(_0x0b3e,0x142));var _0xe0b3=function(_0x2f182c,_0x102927){_0x2f182c=_0x2f182c-0x0;var _0x2898bc=_0x0b3e[_0x2f182c];return _0x2898bc;};'use strict';var _=require('lodash');var util=require(_0xe0b3('0x0'));var logger=require(_0xe0b3('0x1'))(_0xe0b3('0x2'));var moment=require(_0xe0b3('0x3'));var BPromise=require(_0xe0b3('0x4'));var rp=require(_0xe0b3('0x5'));var fs=require('fs');var path=require(_0xe0b3('0x6'));var rimraf=require('rimraf');var config=require(_0xe0b3('0x7'));var attributes=require(_0xe0b3('0x8'));module[_0xe0b3('0x9')]=function(_0x3d2ccb,_0x119d75){return _0x3d2ccb[_0xe0b3('0xa')]('ScreenRecording',attributes,{'tableName':_0xe0b3('0xb'),'paranoid':![],'indexes':[{'name':_0xe0b3('0xc'),'fields':[_0xe0b3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 21fddfc..1f25365 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 _0x4a63=['jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x351aaf,_0x57c807){var _0x546c83=function(_0x521472){while(--_0x521472){_0x351aaf['push'](_0x351aaf['shift']());}};_0x546c83(++_0x57c807);}(_0x4a63,0x1b1));var _0x34a6=function(_0x56f935,_0xbb3e13){_0x56f935=_0x56f935-0x0;var _0x25ff2f=_0x4a63[_0x56f935];return _0x25ff2f;};'use strict';var _=require(_0x34a6('0x0'));var util=require(_0x34a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x34a6('0x2'));var fs=require('fs');var Redis=require(_0x34a6('0x3'));var db=require(_0x34a6('0x4'))['db'];var utils=require(_0x34a6('0x5'));var logger=require(_0x34a6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x34a6('0x7'));var client=jayson[_0x34a6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48577f,_0x34bbaa,_0x3bf304){return new BPromise(function(_0x3c2f17,_0x2a5fb7){return client[_0x34a6('0x9')](_0x48577f,_0x3bf304)[_0x34a6('0xa')](function(_0x4d39d1){logger[_0x34a6('0xb')](_0x34a6('0xc'),_0x34bbaa,_0x34a6('0xd'));logger[_0x34a6('0xe')](_0x34a6('0xf'),_0x34bbaa,'request\x20sent',JSON[_0x34a6('0x10')](_0x4d39d1));if(_0x4d39d1[_0x34a6('0x11')]){if(_0x4d39d1[_0x34a6('0x11')][_0x34a6('0x12')]===0x1f4){logger[_0x34a6('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x34bbaa,_0x4d39d1['error'][_0x34a6('0x13')]);return _0x2a5fb7(_0x4d39d1[_0x34a6('0x11')][_0x34a6('0x13')]);}logger[_0x34a6('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x34bbaa,_0x4d39d1[_0x34a6('0x11')][_0x34a6('0x13')]);return _0x3c2f17(_0x4d39d1['error'][_0x34a6('0x13')]);}else{logger[_0x34a6('0xb')](_0x34a6('0xc'),_0x34bbaa,_0x34a6('0xd'));_0x3c2f17(_0x4d39d1['result'][_0x34a6('0x13')]);}})['catch'](function(_0x327a9d){logger[_0x34a6('0x11')](_0x34a6('0xc'),_0x34bbaa,_0x327a9d);_0x2a5fb7(_0x327a9d);});});} \ No newline at end of file +var _0x8c98=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x1f8541,_0x478be6){var _0x58d505=function(_0x4ad5c3){while(--_0x4ad5c3){_0x1f8541['push'](_0x1f8541['shift']());}};_0x58d505(++_0x478be6);}(_0x8c98,0x172));var _0x88c9=function(_0x30fd00,_0x33a97f){_0x30fd00=_0x30fd00-0x0;var _0x2626f2=_0x8c98[_0x30fd00];return _0x2626f2;};'use strict';var _=require(_0x88c9('0x0'));var util=require(_0x88c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x88c9('0x2'));var fs=require('fs');var Redis=require(_0x88c9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x88c9('0x4'));var logger=require(_0x88c9('0x5'))('rpc');var config=require(_0x88c9('0x6'));var jayson=require(_0x88c9('0x7'));var client=jayson['client'][_0x88c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x206765,_0x2ef759,_0x3e888f){return new BPromise(function(_0x440d73,_0x207817){return client[_0x88c9('0x9')](_0x206765,_0x3e888f)['then'](function(_0x502810){logger[_0x88c9('0xa')](_0x88c9('0xb'),_0x2ef759,_0x88c9('0xc'));logger['debug'](_0x88c9('0xd'),_0x2ef759,'request\x20sent',JSON[_0x88c9('0xe')](_0x502810));if(_0x502810[_0x88c9('0xf')]){if(_0x502810[_0x88c9('0xf')][_0x88c9('0x10')]===0x1f4){logger[_0x88c9('0xf')](_0x88c9('0xb'),_0x2ef759,_0x502810[_0x88c9('0xf')][_0x88c9('0x11')]);return _0x207817(_0x502810[_0x88c9('0xf')][_0x88c9('0x11')]);}logger[_0x88c9('0xf')](_0x88c9('0xb'),_0x2ef759,_0x502810[_0x88c9('0xf')][_0x88c9('0x11')]);return _0x440d73(_0x502810[_0x88c9('0xf')][_0x88c9('0x11')]);}else{logger[_0x88c9('0xa')](_0x88c9('0xb'),_0x2ef759,_0x88c9('0xc'));_0x440d73(_0x502810['result'][_0x88c9('0x11')]);}})[_0x88c9('0x12')](function(_0x3cd67a){logger[_0x88c9('0xf')](_0x88c9('0xb'),_0x2ef759,_0x3cd67a);_0x207817(_0x3cd67a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9cb73c6..511fa24 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 _0xcd0b=['root','server/files/images/logos/','%s%s','extname','originalname','post','single','file','addLogo','format','addLogoLogin','preferred','addPreferred','favicon','addFavicon','/:id','isAuthenticated','update','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join'];(function(_0x486fc2,_0x809cae){var _0x1b281e=function(_0x4c04f7){while(--_0x4c04f7){_0x486fc2['push'](_0x486fc2['shift']());}};_0x1b281e(++_0x809cae);}(_0xcd0b,0xae));var _0xbcd0=function(_0x36743b,_0x41426a){_0x36743b=_0x36743b-0x0;var _0xc6db05=_0xcd0b[_0x36743b];return _0xc6db05;};'use strict';var multer=require(_0xbcd0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbcd0('0x1'));var express=require('express');var router=express[_0xbcd0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbcd0('0x3'));var interaction=require(_0xbcd0('0x4'));var config=require(_0xbcd0('0x5'));var controller=require(_0xbcd0('0x6'));router[_0xbcd0('0x7')]('/',auth['isAuthenticated'](),controller[_0xbcd0('0x8')]);router['get'](_0xbcd0('0x9'),controller[_0xbcd0('0xa')]);router[_0xbcd0('0x7')]('/:id',controller['show']);router[_0xbcd0('0x7')](_0xbcd0('0xb'),controller[_0xbcd0('0xc')]);router[_0xbcd0('0x7')]('/:id/logo_login',controller['getLogoLogin']);router[_0xbcd0('0x7')](_0xbcd0('0xd'),controller[_0xbcd0('0xe')]);router['get'](_0xbcd0('0xf'),controller[_0xbcd0('0x10')]);router[_0xbcd0('0x7')](_0xbcd0('0x11'),controller[_0xbcd0('0x12')]);var upload=multer({'storage':multer[_0xbcd0('0x13')]({'destination':function(_0x7ee2a4,_0x2d6278,_0x519bff){_0x519bff(null,path[_0xbcd0('0x14')](config[_0xbcd0('0x15')],_0xbcd0('0x16')));},'filename':function(_0x536d4d,_0x215fb7,_0x559bdc){_0x559bdc(null,util['format'](_0xbcd0('0x17'),'logo',path[_0xbcd0('0x18')](_0x215fb7[_0xbcd0('0x19')])));}})});router[_0xbcd0('0x1a')]('/:id/logo',upload[_0xbcd0('0x1b')](_0xbcd0('0x1c')),controller[_0xbcd0('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45d227,_0x4d9356,_0x4d539d){_0x4d539d(null,path['join'](config['root'],_0xbcd0('0x16')));},'filename':function(_0x2ef82a,_0x1231ba,_0x12ec6c){_0x12ec6c(null,util[_0xbcd0('0x1e')]('%s%s','logologin',path[_0xbcd0('0x18')](_0x1231ba[_0xbcd0('0x19')])));}})});router['post']('/:id/logo_login',upload['single'](_0xbcd0('0x1c')),controller[_0xbcd0('0x1f')]);var upload=multer({'storage':multer[_0xbcd0('0x13')]({'destination':function(_0x3a0bc2,_0x282a63,_0x171758){_0x171758(null,path[_0xbcd0('0x14')](config[_0xbcd0('0x15')],_0xbcd0('0x16')));},'filename':function(_0x1556e2,_0x206a24,_0x48f228){_0x48f228(null,util['format'](_0xbcd0('0x17'),_0xbcd0('0x20'),path[_0xbcd0('0x18')](_0x206a24[_0xbcd0('0x19')])));}})});router[_0xbcd0('0x1a')](_0xbcd0('0xf'),upload[_0xbcd0('0x1b')](_0xbcd0('0x1c')),controller[_0xbcd0('0x21')]);var upload=multer({'storage':multer[_0xbcd0('0x13')]({'destination':function(_0x5582ac,_0x1d4ec3,_0x5b9aae){_0x5b9aae(null,path[_0xbcd0('0x14')](config['root'],_0xbcd0('0x16')));},'filename':function(_0x34ec43,_0x42751c,_0x5b546b){_0x5b546b(null,util['format'](_0xbcd0('0x17'),_0xbcd0('0x22'),path[_0xbcd0('0x18')](_0x42751c[_0xbcd0('0x19')])));}})});router[_0xbcd0('0x1a')](_0xbcd0('0x11'),upload['single']('file'),controller[_0xbcd0('0x23')]);router['put'](_0xbcd0('0x24'),auth[_0xbcd0('0x25')](),controller[_0xbcd0('0x26')]);module['exports']=router; \ No newline at end of file +var _0x1c09=['/:id/preferred','addPreferred','favicon','addFavicon','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','getDate','/:id','show','getLogoLogin','/:id/gdpr','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','logologin','/:id/logo_login','single','preferred'];(function(_0x1e7060,_0x453e1a){var _0x4233cf=function(_0x456a3e){while(--_0x456a3e){_0x1e7060['push'](_0x1e7060['shift']());}};_0x4233cf(++_0x453e1a);}(_0x1c09,0x101));var _0x91c0=function(_0x3c1c49,_0x127345){_0x3c1c49=_0x3c1c49-0x0;var _0x346bb6=_0x1c09[_0x3c1c49];return _0x346bb6;};'use strict';var multer=require(_0x91c0('0x0'));var util=require('util');var path=require(_0x91c0('0x1'));var timeout=require(_0x91c0('0x2'));var express=require(_0x91c0('0x3'));var router=express[_0x91c0('0x4')]();var fs_extra=require(_0x91c0('0x5'));var auth=require(_0x91c0('0x6'));var interaction=require(_0x91c0('0x7'));var config=require(_0x91c0('0x8'));var controller=require(_0x91c0('0x9'));router['get']('/',auth[_0x91c0('0xa')](),controller[_0x91c0('0xb')]);router[_0x91c0('0xc')]('/now',controller[_0x91c0('0xd')]);router[_0x91c0('0xc')](_0x91c0('0xe'),controller[_0x91c0('0xf')]);router[_0x91c0('0xc')]('/:id/logo',controller['getLogo']);router['get']('/:id/logo_login',controller[_0x91c0('0x10')]);router[_0x91c0('0xc')](_0x91c0('0x11'),controller[_0x91c0('0x12')]);router[_0x91c0('0xc')]('/:id/preferred',controller[_0x91c0('0x13')]);router[_0x91c0('0xc')]('/:id/favicon',controller[_0x91c0('0x14')]);var upload=multer({'storage':multer[_0x91c0('0x15')]({'destination':function(_0x1c0d84,_0x3ea322,_0x16acf5){_0x16acf5(null,path[_0x91c0('0x16')](config[_0x91c0('0x17')],_0x91c0('0x18')));},'filename':function(_0x3e0ccd,_0x595ad6,_0x37d5ab){_0x37d5ab(null,util[_0x91c0('0x19')](_0x91c0('0x1a'),_0x91c0('0x1b'),path[_0x91c0('0x1c')](_0x595ad6[_0x91c0('0x1d')])));}})});router[_0x91c0('0x1e')]('/:id/logo',upload['single'](_0x91c0('0x1f')),controller[_0x91c0('0x20')]);var upload=multer({'storage':multer[_0x91c0('0x15')]({'destination':function(_0x1df7e7,_0x5f590b,_0x152138){_0x152138(null,path[_0x91c0('0x16')](config[_0x91c0('0x17')],_0x91c0('0x18')));},'filename':function(_0x1583a7,_0x25111c,_0x1f70ab){_0x1f70ab(null,util[_0x91c0('0x19')](_0x91c0('0x1a'),_0x91c0('0x21'),path[_0x91c0('0x1c')](_0x25111c[_0x91c0('0x1d')])));}})});router['post'](_0x91c0('0x22'),upload[_0x91c0('0x23')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x91c0('0x15')]({'destination':function(_0x4cc1f3,_0x5e36f6,_0x26173f){_0x26173f(null,path[_0x91c0('0x16')](config[_0x91c0('0x17')],_0x91c0('0x18')));},'filename':function(_0x1b87ee,_0x4e3430,_0x2aaa8d){_0x2aaa8d(null,util[_0x91c0('0x19')](_0x91c0('0x1a'),_0x91c0('0x24'),path[_0x91c0('0x1c')](_0x4e3430['originalname'])));}})});router[_0x91c0('0x1e')](_0x91c0('0x25'),upload[_0x91c0('0x23')](_0x91c0('0x1f')),controller[_0x91c0('0x26')]);var upload=multer({'storage':multer[_0x91c0('0x15')]({'destination':function(_0x2f95f3,_0x2defcc,_0x37f45e){_0x37f45e(null,path[_0x91c0('0x16')](config[_0x91c0('0x17')],_0x91c0('0x18')));},'filename':function(_0x258d14,_0x252245,_0x2228f6){_0x2228f6(null,util[_0x91c0('0x19')]('%s%s',_0x91c0('0x27'),path[_0x91c0('0x1c')](_0x252245[_0x91c0('0x1d')])));}})});router[_0x91c0('0x1e')]('/:id/favicon',upload[_0x91c0('0x23')](_0x91c0('0x1f')),controller[_0x91c0('0x28')]);router[_0x91c0('0x29')](_0x91c0('0xe'),auth[_0x91c0('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index bc659c3..715add3 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 _0x30d3=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','INTEGER','min_internal','min_mailbox'];(function(_0x16acb7,_0x23f034){var _0x39bf39=function(_0x21281e){while(--_0x21281e){_0x16acb7['push'](_0x16acb7['shift']());}};_0x39bf39(++_0x23f034);}(_0x30d3,0x9f));var _0x330d=function(_0x3a3b16,_0x2103bc){_0x3a3b16=_0x3a3b16-0x0;var _0x48e481=_0x30d3[_0x3a3b16];return _0x48e481;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x330d('0x0')](0xb),'unique':_0x330d('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x330d('0x0')](0xb),'unique':_0x330d('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x330d('0x0')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x330d('0x3')],'defaultValue':_0x330d('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x330d('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x330d('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x330d('0x3')]},'turnaddr':{'type':Sequelize[_0x330d('0x3')]},'turnusername':{'type':Sequelize[_0x330d('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x330d('0x0')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x330d('0x3')],'defaultValue':_0x330d('0x6')},'enableEmailPreview':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x330d('0x7')},'chatTimeout':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x330d('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x330d('0x3')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x330d('0x3')]},'sentiment':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x330d('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x330d('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x330d('0x0')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x330d('0x0')](0x2)[_0x330d('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x330d('0x0')](0x2)[_0x330d('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x330d('0x0')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x330d('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x330d('0x0')],'defaultValue':0x14}}; \ No newline at end of file +var _0xf4ce=['min_internal','INTEGER','min_mailbox','BOOLEAN','STRING','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize'];(function(_0x264d7d,_0x1f2358){var _0x55ca61=function(_0x10503e){while(--_0x10503e){_0x264d7d['push'](_0x264d7d['shift']());}};_0x55ca61(++_0x1f2358);}(_0xf4ce,0xf2));var _0xef4c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf4ce[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xef4c('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xef4c('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xef4c('0x2')](0xb),'unique':_0xef4c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xef4c('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xef4c('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xef4c('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xef4c('0x5')]},'turnpassword':{'type':Sequelize[_0xef4c('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xef4c('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xef4c('0x5')],'defaultValue':_0xef4c('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xef4c('0x5')],'defaultValue':_0xef4c('0x7')},'chatTimeout':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xef4c('0x5')]},'defaultPreferred':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xef4c('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xef4c('0x5')]},'defaultFavicon':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xef4c('0x2')]},'transcribeRegion':{'type':Sequelize[_0xef4c('0x5')]},'sentiment':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xef4c('0x2')]},'sentimentRegion':{'type':Sequelize[_0xef4c('0x5')]},'language':{'type':Sequelize[_0xef4c('0x5')]},'bucket':{'type':Sequelize[_0xef4c('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xef4c('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xef4c('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xef4c('0x2')](0x2)[_0xef4c('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xef4c('0x2')](0x2)[_0xef4c('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xef4c('0x4')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xef4c('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index d94f56d..c637418 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 _0xd6cb=['getDate','now','format','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','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','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','show','body','find','file','filename','logo','addLogoLogin','params','getLogo','getLicense','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','preferred','defaultFavicon','default_loginLogo.svg','upperFirst','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico'];(function(_0x3872a4,_0xe0113a){var _0x354285=function(_0x2bd09e){while(--_0x2bd09e){_0x3872a4['push'](_0x3872a4['shift']());}};_0x354285(++_0xe0113a);}(_0xd6cb,0x16b));var _0xbd6c=function(_0x53ae66,_0x4d00fc){_0x53ae66=_0x53ae66-0x0;var _0x446592=_0xd6cb[_0x53ae66];return _0x446592;};'use strict';var emlformat=require(_0xbd6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd6c('0x1'));var jsonpatch=require(_0xbd6c('0x2'));var rp=require('request-promise');var moment=require(_0xbd6c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd6c('0x4'));var path=require(_0xbd6c('0x5'));var sox=require(_0xbd6c('0x6'));var csv=require(_0xbd6c('0x7'));var ejs=require(_0xbd6c('0x8'));var fs=require('fs');var fs_extra=require(_0xbd6c('0x9'));var _=require(_0xbd6c('0xa'));var squel=require(_0xbd6c('0xb'));var crypto=require(_0xbd6c('0xc'));var jsforce=require(_0xbd6c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbd6c('0x7'));var querystring=require(_0xbd6c('0xe'));var Papa=require(_0xbd6c('0xf'));var Redis=require(_0xbd6c('0x10'));var authService=require(_0xbd6c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd6c('0x12'));var hardwareService=require(_0xbd6c('0x13'));var logger=require('../../config/logger')(_0xbd6c('0x14'));var utils=require('../../config/utils');var config=require(_0xbd6c('0x15'));var licenseUtil=require(_0xbd6c('0x16'));var db=require(_0xbd6c('0x17'))['db'];var jayson=require(_0xbd6c('0x18'));var client=jayson[_0xbd6c('0x19')][_0xbd6c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x377ec1,_0x1d0892,_0x49d87c,_0x239745){return new BPromise(function(_0xadf6d6,_0x3d0f46){var _0x31c2f4=_0x239745||client;return _0x31c2f4['request'](_0x377ec1,_0x49d87c)[_0xbd6c('0x1b')](function(_0x41c616){logger['info'](_0xbd6c('0x1c'),_0x1d0892,'request\x20sent');logger[_0xbd6c('0x1d')](_0xbd6c('0x1e'),_0x1d0892,_0xbd6c('0x1f'),JSON[_0xbd6c('0x20')](_0x41c616));if(_0x41c616['error']){if(_0x41c616[_0xbd6c('0x21')][_0xbd6c('0x22')]===0x1f4){logger[_0xbd6c('0x21')](_0xbd6c('0x1c'),_0x1d0892,_0x41c616[_0xbd6c('0x21')][_0xbd6c('0x23')]);return _0x3d0f46(_0x41c616['error'][_0xbd6c('0x23')]);}logger[_0xbd6c('0x21')](_0xbd6c('0x1c'),_0x1d0892,_0x41c616[_0xbd6c('0x21')][_0xbd6c('0x23')]);return _0xadf6d6(_0x41c616['error']['message']);}else{logger[_0xbd6c('0x24')]('Setting,\x20%s,\x20%s',_0x1d0892,'request\x20sent');_0xadf6d6(_0x41c616['result'][_0xbd6c('0x23')]);}})[_0xbd6c('0x25')](function(_0xcd1437){logger[_0xbd6c('0x21')](_0xbd6c('0x1c'),_0x1d0892,_0xcd1437);_0x3d0f46(_0xcd1437);});});}function respondWithStatusCode(_0x359081,_0x53e26a){_0x53e26a=_0x53e26a||0xcc;return function(_0x411456){if(_0x411456){return _0x359081[_0xbd6c('0x26')](_0x53e26a);}return _0x359081[_0xbd6c('0x27')](_0x53e26a)[_0xbd6c('0x28')]();};}function respondWithResult(_0x4abfb2,_0x45f7c7){_0x45f7c7=_0x45f7c7||0xc8;return function(_0x2e4f19){if(_0x2e4f19){return _0x4abfb2['status'](_0x45f7c7)[_0xbd6c('0x29')](_0x2e4f19);}};}function respondWithFilteredResult(_0x560589,_0x2c48f6){return function(_0x2abb7a){if(_0x2abb7a){var _0xf3ba2b=typeof _0x2c48f6[_0xbd6c('0x2a')]==='undefined'&&typeof _0x2c48f6[_0xbd6c('0x2b')]==='undefined';var _0x22c798=_0x2abb7a[_0xbd6c('0x2c')];var _0x10f9c3=_0xf3ba2b?0x0:_0x2c48f6[_0xbd6c('0x2a')];var _0xf19680=_0xf3ba2b?_0x2abb7a[_0xbd6c('0x2c')]:_0x2c48f6[_0xbd6c('0x2a')]+_0x2c48f6[_0xbd6c('0x2b')];var _0xbc5e6c;if(_0xf19680>=_0x22c798){_0xf19680=_0x22c798;_0xbc5e6c=0xc8;}else{_0xbc5e6c=0xce;}_0x560589[_0xbd6c('0x27')](_0xbc5e6c);return _0x560589[_0xbd6c('0x2d')](_0xbd6c('0x2e'),_0x10f9c3+'-'+_0xf19680+'/'+_0x22c798)[_0xbd6c('0x29')](_0x2abb7a);}return null;};}function patchUpdates(_0x1b10a1){return function(_0x4ed63d){try{jsonpatch[_0xbd6c('0x2f')](_0x4ed63d,_0x1b10a1,!![]);}catch(_0x2ee0d8){return BPromise[_0xbd6c('0x30')](_0x2ee0d8);}return _0x4ed63d[_0xbd6c('0x31')]();};}function saveUpdates(_0x1ab734,_0x20a73e){return function(_0x48af52){if(_0x48af52){return _0x48af52[_0xbd6c('0x32')](_0x1ab734)[_0xbd6c('0x1b')](function(_0x1240c6){return _0x1240c6;});}return null;};}function removeEntity(_0x36e693,_0x410eeb){return function(_0x31d462){if(_0x31d462){return _0x31d462['destroy']()[_0xbd6c('0x1b')](function(){_0x36e693['status'](0xcc)[_0xbd6c('0x28')]();});}};}function handleEntityNotFound(_0x5edc02,_0x3dd0c8){return function(_0x576ef3){if(!_0x576ef3){_0x5edc02[_0xbd6c('0x26')](0x194);}return _0x576ef3;};}function handleError(_0x36ce5e,_0x20087e){_0x20087e=_0x20087e||0x1f4;return function(_0x4c6548){logger[_0xbd6c('0x21')](_0x4c6548['stack']);if(_0x4c6548[_0xbd6c('0x33')]){delete _0x4c6548['name'];}_0x36ce5e[_0xbd6c('0x27')](_0x20087e)[_0xbd6c('0x34')](_0x4c6548);};}exports[_0xbd6c('0x35')]=function(_0x41ef88,_0x5d3dbc){var _0x2e2282={},_0x480c19={},_0x4dbd99={'count':0x0,'rows':[]};var _0x3c2171=_['map'](db[_0xbd6c('0x36')][_0xbd6c('0x37')],function(_0x159fd9){return{'name':_0x159fd9[_0xbd6c('0x38')],'type':_0x159fd9[_0xbd6c('0x39')][_0xbd6c('0x3a')]};});_0x480c19[_0xbd6c('0x3b')]=_[_0xbd6c('0x3c')](_0x3c2171,_0xbd6c('0x33'));_0x480c19[_0xbd6c('0x3d')]=_[_0xbd6c('0x3e')](_0x41ef88[_0xbd6c('0x3d')]);_0x480c19['filters']=_[_0xbd6c('0x3f')](_0x480c19[_0xbd6c('0x3b')],_0x480c19[_0xbd6c('0x3d')]);_0x2e2282['attributes']=_[_0xbd6c('0x3f')](_0x480c19[_0xbd6c('0x3b')],qs[_0xbd6c('0x40')](_0x41ef88['query'][_0xbd6c('0x40')]));_0x2e2282[_0xbd6c('0x41')]=_0x2e2282[_0xbd6c('0x41')][_0xbd6c('0x42')]?_0x2e2282['attributes']:_0x480c19[_0xbd6c('0x3b')];if(!_0x41ef88[_0xbd6c('0x3d')][_0xbd6c('0x43')](_0xbd6c('0x44'))){_0x2e2282[_0xbd6c('0x2b')]=qs[_0xbd6c('0x2b')](_0x41ef88[_0xbd6c('0x3d')][_0xbd6c('0x2b')]);_0x2e2282[_0xbd6c('0x2a')]=qs[_0xbd6c('0x2a')](_0x41ef88[_0xbd6c('0x3d')][_0xbd6c('0x2a')]);}_0x2e2282['order']=qs[_0xbd6c('0x45')](_0x41ef88[_0xbd6c('0x3d')][_0xbd6c('0x45')]);_0x2e2282[_0xbd6c('0x46')]=qs[_0xbd6c('0x47')](_['pick'](_0x41ef88[_0xbd6c('0x3d')],_0x480c19[_0xbd6c('0x47')]),_0x3c2171);if(_0x41ef88[_0xbd6c('0x3d')]['filter']){_0x2e2282[_0xbd6c('0x46')]=_[_0xbd6c('0x48')](_0x2e2282['where'],{'$or':_[_0xbd6c('0x3c')](_0x3c2171,function(_0x168089){if(_0x168089[_0xbd6c('0x39')]!==_0xbd6c('0x49')){var _0x205186={};_0x205186[_0x168089['name']]={'$like':'%'+_0x41ef88[_0xbd6c('0x3d')]['filter']+'%'};return _0x205186;}})});}_0x2e2282=_[_0xbd6c('0x48')]({},_0x2e2282,_0x41ef88[_0xbd6c('0x4a')]);var _0x38499e={'where':_0x2e2282[_0xbd6c('0x46')]};return db[_0xbd6c('0x36')][_0xbd6c('0x2c')](_0x38499e)['then'](function(_0x33ce02){_0x4dbd99[_0xbd6c('0x2c')]=_0x33ce02;if(_0x41ef88[_0xbd6c('0x3d')][_0xbd6c('0x4b')]){_0x2e2282[_0xbd6c('0x4c')]=[{'all':!![]}];}return db[_0xbd6c('0x36')][_0xbd6c('0x4d')](_0x2e2282);})[_0xbd6c('0x1b')](function(_0x1aae2b){_0x4dbd99['rows']=_0x1aae2b;return _0x4dbd99;})[_0xbd6c('0x1b')](respondWithFilteredResult(_0x5d3dbc,_0x2e2282))[_0xbd6c('0x25')](handleError(_0x5d3dbc,null));};exports[_0xbd6c('0x4e')]=function(_0xe5c0c4,_0x39d565){var _0x4a8c71={'raw':![],'where':{'id':_0xe5c0c4['params']['id']}},_0x576daa={};_0x576daa[_0xbd6c('0x3b')]=_['keys'](db[_0xbd6c('0x36')][_0xbd6c('0x37')]);_0x576daa[_0xbd6c('0x3d')]=_['keys'](_0xe5c0c4[_0xbd6c('0x3d')]);_0x576daa['filters']=_['intersection'](_0x576daa[_0xbd6c('0x3b')],_0x576daa[_0xbd6c('0x3d')]);_0x4a8c71[_0xbd6c('0x41')]=_[_0xbd6c('0x3f')](_0x576daa[_0xbd6c('0x3b')],qs['fields'](_0xe5c0c4[_0xbd6c('0x3d')][_0xbd6c('0x40')]));_0x4a8c71[_0xbd6c('0x41')]=_0x4a8c71['attributes']['length']?_0x4a8c71[_0xbd6c('0x41')]:_0x576daa[_0xbd6c('0x3b')];if(_0xe5c0c4[_0xbd6c('0x3d')][_0xbd6c('0x4b')]){_0x4a8c71['include']=[{'all':!![]}];}_0x4a8c71=_[_0xbd6c('0x48')]({},_0x4a8c71,_0xe5c0c4[_0xbd6c('0x4a')]);return db[_0xbd6c('0x36')]['find'](_0x4a8c71)[_0xbd6c('0x1b')](handleEntityNotFound(_0x39d565,null))[_0xbd6c('0x1b')](respondWithResult(_0x39d565,null))[_0xbd6c('0x25')](handleError(_0x39d565,null));};exports[_0xbd6c('0x32')]=function(_0x4ba5e9,_0x1d35ae){if(_0x4ba5e9['body']['id']){delete _0x4ba5e9[_0xbd6c('0x4f')]['id'];}return db['Setting'][_0xbd6c('0x50')]({'where':{'id':_0x4ba5e9['params']['id']}})[_0xbd6c('0x1b')](handleEntityNotFound(_0x1d35ae,null))[_0xbd6c('0x1b')](saveUpdates(_0x4ba5e9[_0xbd6c('0x4f')],null))[_0xbd6c('0x1b')](respondWithResult(_0x1d35ae,null))[_0xbd6c('0x25')](handleError(_0x1d35ae,null));};exports['addLogo']=function(_0x353d83,_0x19685d,_0x28986c){if(_0x353d83['file']&&_0x353d83[_0xbd6c('0x51')][_0xbd6c('0x52')]){_0x353d83[_0xbd6c('0x4f')][_0xbd6c('0x53')]=_0x353d83[_0xbd6c('0x51')][_0xbd6c('0x52')];}return db[_0xbd6c('0x36')]['find']({'where':{'id':_0x353d83['params']['id']}})[_0xbd6c('0x1b')](handleEntityNotFound(_0x19685d,null))['then'](saveUpdates(_0x353d83[_0xbd6c('0x4f')],null))[_0xbd6c('0x1b')](respondWithResult(_0x19685d,null))[_0xbd6c('0x25')](handleError(_0x19685d,null));};exports[_0xbd6c('0x54')]=function(_0x251108,_0x979f3c,_0x235e68){if(_0x251108[_0xbd6c('0x51')]&&_0x251108[_0xbd6c('0x51')][_0xbd6c('0x52')]){_0x251108[_0xbd6c('0x4f')]['loginLogo']=_0x251108['file'][_0xbd6c('0x52')];}return db[_0xbd6c('0x36')][_0xbd6c('0x50')]({'where':{'id':_0x251108[_0xbd6c('0x55')]['id']}})[_0xbd6c('0x1b')](handleEntityNotFound(_0x979f3c,null))['then'](saveUpdates(_0x251108['body'],null))[_0xbd6c('0x1b')](respondWithResult(_0x979f3c,null))[_0xbd6c('0x25')](handleError(_0x979f3c,null));};var utilLicense=require(_0xbd6c('0x16'));exports[_0xbd6c('0x56')]=function(_0x497c18,_0x59c98c,_0x49bd7e){var _0x189635='server/files/images/logos';var _0x41802d={'custom':![]};return utilLicense[_0xbd6c('0x57')]()['then'](function(_0x3be59c){if(_0x3be59c){_0x41802d=_0x3be59c;}return db[_0xbd6c('0x36')]['find']({'where':{'id':_0x497c18[_0xbd6c('0x55')]['id']},'attributes':[_0xbd6c('0x53'),_0xbd6c('0x58'),'preferred',_0xbd6c('0x59'),_0xbd6c('0x5a'),_0xbd6c('0x5b'),_0xbd6c('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x59c98c,null))[_0xbd6c('0x1b')](function(_0x345848){if(_0x345848){var _0x36b347=_0x345848[_0xbd6c('0x53')]&&fs[_0xbd6c('0x5d')](path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x189635,_[_0xbd6c('0x60')](_0x345848[_0xbd6c('0x53')])))?path['join'](config[_0xbd6c('0x5f')],_0x189635,_[_0xbd6c('0x60')](_0x345848[_0xbd6c('0x53')])):path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x189635,_[_0xbd6c('0x60')](_0xbd6c('0x61')));var _0x4d3069=_0xbd6c('0x62')+_['upperFirst'](_0xbd6c('0x53'));if(_0x345848[_0x4d3069]||!_0x41802d[_0xbd6c('0x63')]){_0x36b347=path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x189635,_[_0xbd6c('0x60')](_0xbd6c('0x61')));}if(!fs[_0xbd6c('0x5d')](_0x36b347)){throw new db[(_0xbd6c('0x64'))][(_0xbd6c('0x65'))](_['upperFirst'](_0xbd6c('0x53'))+_0xbd6c('0x66'));}return _0x59c98c[_0xbd6c('0x67')](_0x36b347);}})[_0xbd6c('0x25')](handleError(_0x59c98c,null));};var utilLicense=require(_0xbd6c('0x16'));exports['getLogoLogin']=function(_0x15416c,_0x1d1410,_0x5654b0){var _0x4556d3=_0xbd6c('0x68');var _0x47039e={'custom':![]};return utilLicense[_0xbd6c('0x57')]()[_0xbd6c('0x1b')](function(_0x556e88){if(_0x556e88){_0x47039e=_0x556e88;}return db[_0xbd6c('0x36')]['find']({'where':{'id':_0x15416c[_0xbd6c('0x55')]['id']},'attributes':['logo',_0xbd6c('0x58'),_0xbd6c('0x69'),'favicon',_0xbd6c('0x5a'),_0xbd6c('0x5b'),_0xbd6c('0x5c'),_0xbd6c('0x6a')],'raw':!![]});})[_0xbd6c('0x1b')](handleEntityNotFound(_0x1d1410,null))[_0xbd6c('0x1b')](function(_0x41dd1d){if(_0x41dd1d){var _0x17918b=_0x41dd1d[_0xbd6c('0x58')]&&fs[_0xbd6c('0x5d')](path['join'](config[_0xbd6c('0x5f')],_0x4556d3,_[_0xbd6c('0x60')](_0x41dd1d[_0xbd6c('0x58')])))?path[_0xbd6c('0x5e')](config['root'],_0x4556d3,_[_0xbd6c('0x60')](_0x41dd1d[_0xbd6c('0x58')])):path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x4556d3,_['toLower'](_0xbd6c('0x6b')));var _0x4f667b=_0xbd6c('0x62')+_[_0xbd6c('0x6c')]('loginLogo');if(_0x41dd1d[_0x4f667b]||!_0x47039e['custom']){_0x17918b=path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x4556d3,_[_0xbd6c('0x60')]('default_loginLogo.svg'));}if(!fs[_0xbd6c('0x5d')](_0x17918b)){throw new db[(_0xbd6c('0x64'))]['ValidationError'](_[_0xbd6c('0x6c')](_0xbd6c('0x58'))+_0xbd6c('0x66'));}return _0x1d1410['download'](_0x17918b);}})['catch'](handleError(_0x1d1410,null));};exports[_0xbd6c('0x6d')]=function(_0x17c2eb,_0x2ac245){return db[_0xbd6c('0x36')][_0xbd6c('0x50')]({'where':{'id':_0x17c2eb[_0xbd6c('0x55')]['id']},'attributes':[_0xbd6c('0x6e')]})['then'](respondWithResult(_0x2ac245,null))[_0xbd6c('0x25')](handleError(_0x2ac245,null));};exports[_0xbd6c('0x6f')]=function(_0x4b88ef,_0x1fcc8b,_0x1fd940){if(_0x4b88ef[_0xbd6c('0x51')]&&_0x4b88ef[_0xbd6c('0x51')][_0xbd6c('0x52')]){_0x4b88ef[_0xbd6c('0x4f')][_0xbd6c('0x69')]=_0x4b88ef['file'][_0xbd6c('0x52')];}return db[_0xbd6c('0x36')][_0xbd6c('0x50')]({'where':{'id':_0x4b88ef[_0xbd6c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fcc8b,null))['then'](saveUpdates(_0x4b88ef[_0xbd6c('0x4f')],null))[_0xbd6c('0x1b')](respondWithResult(_0x1fcc8b,null))['catch'](handleError(_0x1fcc8b,null));};var utilLicense=require('../../config/license/util');exports[_0xbd6c('0x70')]=function(_0x2d63aa,_0x320056,_0x31abdb){var _0x493bc7=_0xbd6c('0x68');var _0x551191={'custom':![]};return utilLicense[_0xbd6c('0x57')]()[_0xbd6c('0x1b')](function(_0x147e90){if(_0x147e90){_0x551191=_0x147e90;}return db['Setting'][_0xbd6c('0x50')]({'where':{'id':_0x2d63aa[_0xbd6c('0x55')]['id']},'attributes':[_0xbd6c('0x53'),'loginLogo','preferred',_0xbd6c('0x59'),'defaultLogo',_0xbd6c('0x5b'),'defaultPreferred',_0xbd6c('0x6a')],'raw':!![]});})[_0xbd6c('0x1b')](handleEntityNotFound(_0x320056,null))[_0xbd6c('0x1b')](function(_0xd2dede){if(_0xd2dede){var _0x5bf4c0=_0xd2dede['preferred']&&fs[_0xbd6c('0x5d')](path['join'](config[_0xbd6c('0x5f')],_0x493bc7,_[_0xbd6c('0x60')](_0xd2dede[_0xbd6c('0x69')])))?path[_0xbd6c('0x5e')](config['root'],_0x493bc7,_['toLower'](_0xd2dede[_0xbd6c('0x69')])):path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x493bc7,_[_0xbd6c('0x60')](_0xbd6c('0x71')));var _0x5049b7=_0xbd6c('0x62')+_[_0xbd6c('0x6c')](_0xbd6c('0x69'));if(_0xd2dede[_0x5049b7]||!_0x551191[_0xbd6c('0x63')]||!_0x551191['preferred']){_0x5bf4c0=path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0x493bc7,_['toLower']('default_preferred.png'));}if(!fs[_0xbd6c('0x5d')](_0x5bf4c0)){throw new db[(_0xbd6c('0x64'))][(_0xbd6c('0x65'))](_[_0xbd6c('0x6c')](_0xbd6c('0x69'))+'\x20not\x20found');}return _0x320056['download'](_0x5bf4c0);}})[_0xbd6c('0x25')](handleError(_0x320056,null));};exports[_0xbd6c('0x72')]=function(_0x1e8092,_0x4cbf41,_0x2a48cb){if(_0x1e8092[_0xbd6c('0x51')]&&_0x1e8092[_0xbd6c('0x51')][_0xbd6c('0x52')]){_0x1e8092['body'][_0xbd6c('0x59')]=_0x1e8092['file'][_0xbd6c('0x52')];}return db[_0xbd6c('0x36')][_0xbd6c('0x50')]({'where':{'id':_0x1e8092[_0xbd6c('0x55')]['id']}})[_0xbd6c('0x1b')](handleEntityNotFound(_0x4cbf41,null))[_0xbd6c('0x1b')](saveUpdates(_0x1e8092[_0xbd6c('0x4f')],null))[_0xbd6c('0x1b')](respondWithResult(_0x4cbf41,null))[_0xbd6c('0x25')](handleError(_0x4cbf41,null));};var utilLicense=require(_0xbd6c('0x16'));exports[_0xbd6c('0x73')]=function(_0x50f9f0,_0x3adbb8,_0x101c7b){var _0xc1f617=_0xbd6c('0x68');var _0x22ef95={'custom':![]};return utilLicense[_0xbd6c('0x57')]()[_0xbd6c('0x1b')](function(_0x2798eb){if(_0x2798eb){_0x22ef95=_0x2798eb;}return db[_0xbd6c('0x36')][_0xbd6c('0x50')]({'where':{'id':_0x50f9f0['params']['id']},'attributes':[_0xbd6c('0x53'),_0xbd6c('0x58'),'preferred','favicon',_0xbd6c('0x5a'),_0xbd6c('0x5b'),'defaultPreferred',_0xbd6c('0x6a')],'raw':!![]});})[_0xbd6c('0x1b')](handleEntityNotFound(_0x3adbb8,null))[_0xbd6c('0x1b')](function(_0x436dc1){if(_0x436dc1){var _0x3e4309=_0x436dc1[_0xbd6c('0x59')]&&fs[_0xbd6c('0x5d')](path[_0xbd6c('0x5e')](config['root'],_0xc1f617,_[_0xbd6c('0x60')](_0x436dc1[_0xbd6c('0x59')])))?path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0xc1f617,_[_0xbd6c('0x60')](_0x436dc1[_0xbd6c('0x59')])):path['join'](config[_0xbd6c('0x5f')],_0xc1f617,_[_0xbd6c('0x60')](_0xbd6c('0x74')));var _0x3fd851='default'+_['upperFirst']('favicon');if(_0x436dc1[_0x3fd851]||!_0x22ef95[_0xbd6c('0x63')]){_0x3e4309=path[_0xbd6c('0x5e')](config[_0xbd6c('0x5f')],_0xc1f617,_[_0xbd6c('0x60')](_0xbd6c('0x74')));}if(!fs[_0xbd6c('0x5d')](_0x3e4309)){throw new db[(_0xbd6c('0x64'))][(_0xbd6c('0x65'))](_[_0xbd6c('0x6c')](_0xbd6c('0x59'))+_0xbd6c('0x66'));}return _0x3adbb8[_0xbd6c('0x67')](_0x3e4309);}})[_0xbd6c('0x25')](handleError(_0x3adbb8,null));};exports[_0xbd6c('0x75')]=function(_0x157b17,_0x31f64e){var _0x1e9562={'offset':moment()['utcOffset']()};_0x1e9562[_0xbd6c('0x76')]=moment()['utcOffset'](_0x1e9562[_0xbd6c('0x2a')])[_0xbd6c('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x31f64e['status'](0xc8)['send'](_0x1e9562);}; \ No newline at end of file +var _0xc095=['defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','upperFirst','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','client','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','Setting','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','body','find','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo'];(function(_0x17ae09,_0x1f326d){var _0x152e29=function(_0x3f159a){while(--_0x3f159a){_0x17ae09['push'](_0x17ae09['shift']());}};_0x152e29(++_0x1f326d);}(_0xc095,0x18c));var _0x5c09=function(_0x4e1340,_0x11ed37){_0x4e1340=_0x4e1340-0x0;var _0xb389a2=_0xc095[_0x4e1340];return _0xb389a2;};'use strict';var emlformat=require(_0x5c09('0x0'));var rimraf=require(_0x5c09('0x1'));var zipdir=require(_0x5c09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c09('0x3'));var moment=require(_0x5c09('0x4'));var BPromise=require(_0x5c09('0x5'));var Mustache=require(_0x5c09('0x6'));var util=require(_0x5c09('0x7'));var path=require(_0x5c09('0x8'));var sox=require(_0x5c09('0x9'));var csv=require(_0x5c09('0xa'));var ejs=require(_0x5c09('0xb'));var fs=require('fs');var fs_extra=require(_0x5c09('0xc'));var _=require(_0x5c09('0xd'));var squel=require(_0x5c09('0xe'));var crypto=require(_0x5c09('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5c09('0x10'));var toCsv=require(_0x5c09('0xa'));var querystring=require(_0x5c09('0x11'));var Papa=require(_0x5c09('0x12'));var Redis=require('ioredis');var authService=require(_0x5c09('0x13'));var qs=require(_0x5c09('0x14'));var as=require(_0x5c09('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c09('0x16'));var utils=require(_0x5c09('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c09('0x18'));var db=require(_0x5c09('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5c09('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x213f9f,_0x5b7ffc,_0x9fa051,_0x19579c){return new BPromise(function(_0x1a29f4,_0x432f5a){var _0xcdb0cf=_0x19579c||client;return _0xcdb0cf[_0x5c09('0x1b')](_0x213f9f,_0x9fa051)[_0x5c09('0x1c')](function(_0x11dae2){logger[_0x5c09('0x1d')](_0x5c09('0x1e'),_0x5b7ffc,'request\x20sent');logger[_0x5c09('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x5b7ffc,_0x5c09('0x20'),JSON[_0x5c09('0x21')](_0x11dae2));if(_0x11dae2[_0x5c09('0x22')]){if(_0x11dae2[_0x5c09('0x22')]['code']===0x1f4){logger[_0x5c09('0x22')](_0x5c09('0x1e'),_0x5b7ffc,_0x11dae2[_0x5c09('0x22')][_0x5c09('0x23')]);return _0x432f5a(_0x11dae2[_0x5c09('0x22')][_0x5c09('0x23')]);}logger[_0x5c09('0x22')](_0x5c09('0x1e'),_0x5b7ffc,_0x11dae2[_0x5c09('0x22')][_0x5c09('0x23')]);return _0x1a29f4(_0x11dae2[_0x5c09('0x22')][_0x5c09('0x23')]);}else{logger[_0x5c09('0x1d')](_0x5c09('0x1e'),_0x5b7ffc,_0x5c09('0x20'));_0x1a29f4(_0x11dae2[_0x5c09('0x24')][_0x5c09('0x23')]);}})['catch'](function(_0x3aecab){logger[_0x5c09('0x22')](_0x5c09('0x1e'),_0x5b7ffc,_0x3aecab);_0x432f5a(_0x3aecab);});});}function respondWithStatusCode(_0x32b1d4,_0x4ff239){_0x4ff239=_0x4ff239||0xcc;return function(_0x2492e1){if(_0x2492e1){return _0x32b1d4[_0x5c09('0x25')](_0x4ff239);}return _0x32b1d4['status'](_0x4ff239)[_0x5c09('0x26')]();};}function respondWithResult(_0x5c3ad7,_0x112f11){_0x112f11=_0x112f11||0xc8;return function(_0x241edf){if(_0x241edf){return _0x5c3ad7[_0x5c09('0x27')](_0x112f11)[_0x5c09('0x28')](_0x241edf);}};}function respondWithFilteredResult(_0x2ea46f,_0x5f5e19){return function(_0x56587a){if(_0x56587a){var _0x1df169=typeof _0x5f5e19[_0x5c09('0x29')]===_0x5c09('0x2a')&&typeof _0x5f5e19[_0x5c09('0x2b')]===_0x5c09('0x2a');var _0x11938d=_0x56587a[_0x5c09('0x2c')];var _0x4825ed=_0x1df169?0x0:_0x5f5e19['offset'];var _0x28563b=_0x1df169?_0x56587a[_0x5c09('0x2c')]:_0x5f5e19[_0x5c09('0x29')]+_0x5f5e19['limit'];var _0x329e1f;if(_0x28563b>=_0x11938d){_0x28563b=_0x11938d;_0x329e1f=0xc8;}else{_0x329e1f=0xce;}_0x2ea46f[_0x5c09('0x27')](_0x329e1f);return _0x2ea46f[_0x5c09('0x2d')](_0x5c09('0x2e'),_0x4825ed+'-'+_0x28563b+'/'+_0x11938d)[_0x5c09('0x28')](_0x56587a);}return null;};}function patchUpdates(_0x579de8){return function(_0x558fdb){try{jsonpatch[_0x5c09('0x2f')](_0x558fdb,_0x579de8,!![]);}catch(_0xa59aac){return BPromise['reject'](_0xa59aac);}return _0x558fdb[_0x5c09('0x30')]();};}function saveUpdates(_0xa3d069,_0x486f26){return function(_0x52bcbd){if(_0x52bcbd){return _0x52bcbd[_0x5c09('0x31')](_0xa3d069)['then'](function(_0xa654a4){return _0xa654a4;});}return null;};}function removeEntity(_0x14ec23,_0x44d63c){return function(_0x8dd4a3){if(_0x8dd4a3){return _0x8dd4a3['destroy']()[_0x5c09('0x1c')](function(){_0x14ec23[_0x5c09('0x27')](0xcc)[_0x5c09('0x26')]();});}};}function handleEntityNotFound(_0x16a010,_0x658517){return function(_0x45ba0c){if(!_0x45ba0c){_0x16a010[_0x5c09('0x25')](0x194);}return _0x45ba0c;};}function handleError(_0x191531,_0x46167d){_0x46167d=_0x46167d||0x1f4;return function(_0x316d54){logger['error'](_0x316d54[_0x5c09('0x32')]);if(_0x316d54['name']){delete _0x316d54[_0x5c09('0x33')];}_0x191531['status'](_0x46167d)['send'](_0x316d54);};}exports[_0x5c09('0x34')]=function(_0x754280,_0x1d9d1c){var _0x3311c0={},_0x6fe33f={},_0x375b6f={'count':0x0,'rows':[]};var _0x287d73=_[_0x5c09('0x35')](db[_0x5c09('0x36')]['rawAttributes'],function(_0x2d60d8){return{'name':_0x2d60d8[_0x5c09('0x37')],'type':_0x2d60d8[_0x5c09('0x38')][_0x5c09('0x39')]};});_0x6fe33f[_0x5c09('0x3a')]=_[_0x5c09('0x35')](_0x287d73,_0x5c09('0x33'));_0x6fe33f[_0x5c09('0x3b')]=_[_0x5c09('0x3c')](_0x754280[_0x5c09('0x3b')]);_0x6fe33f[_0x5c09('0x3d')]=_[_0x5c09('0x3e')](_0x6fe33f[_0x5c09('0x3a')],_0x6fe33f[_0x5c09('0x3b')]);_0x3311c0[_0x5c09('0x3f')]=_['intersection'](_0x6fe33f[_0x5c09('0x3a')],qs[_0x5c09('0x40')](_0x754280[_0x5c09('0x3b')][_0x5c09('0x40')]));_0x3311c0[_0x5c09('0x3f')]=_0x3311c0['attributes'][_0x5c09('0x41')]?_0x3311c0[_0x5c09('0x3f')]:_0x6fe33f['model'];if(!_0x754280[_0x5c09('0x3b')]['hasOwnProperty'](_0x5c09('0x42'))){_0x3311c0['limit']=qs[_0x5c09('0x2b')](_0x754280['query']['limit']);_0x3311c0[_0x5c09('0x29')]=qs[_0x5c09('0x29')](_0x754280['query'][_0x5c09('0x29')]);}_0x3311c0['order']=qs[_0x5c09('0x43')](_0x754280[_0x5c09('0x3b')][_0x5c09('0x43')]);_0x3311c0[_0x5c09('0x44')]=qs[_0x5c09('0x3d')](_[_0x5c09('0x45')](_0x754280['query'],_0x6fe33f['filters']),_0x287d73);if(_0x754280['query'][_0x5c09('0x46')]){_0x3311c0[_0x5c09('0x44')]=_[_0x5c09('0x47')](_0x3311c0[_0x5c09('0x44')],{'$or':_[_0x5c09('0x35')](_0x287d73,function(_0xd617c){if(_0xd617c['type']!==_0x5c09('0x48')){var _0x3fe8b8={};_0x3fe8b8[_0xd617c[_0x5c09('0x33')]]={'$like':'%'+_0x754280[_0x5c09('0x3b')][_0x5c09('0x46')]+'%'};return _0x3fe8b8;}})});}_0x3311c0=_[_0x5c09('0x47')]({},_0x3311c0,_0x754280[_0x5c09('0x49')]);var _0x1af222={'where':_0x3311c0[_0x5c09('0x44')]};return db[_0x5c09('0x36')]['count'](_0x1af222)[_0x5c09('0x1c')](function(_0x41f7e5){_0x375b6f['count']=_0x41f7e5;if(_0x754280[_0x5c09('0x3b')]['includeAll']){_0x3311c0[_0x5c09('0x4a')]=[{'all':!![]}];}return db[_0x5c09('0x36')][_0x5c09('0x4b')](_0x3311c0);})[_0x5c09('0x1c')](function(_0x20b98a){_0x375b6f[_0x5c09('0x4c')]=_0x20b98a;return _0x375b6f;})[_0x5c09('0x1c')](respondWithFilteredResult(_0x1d9d1c,_0x3311c0))[_0x5c09('0x4d')](handleError(_0x1d9d1c,null));};exports[_0x5c09('0x4e')]=function(_0x188dcf,_0x12fa73){var _0x2a68a6={'raw':![],'where':{'id':_0x188dcf[_0x5c09('0x4f')]['id']}},_0x5d4dd4={};_0x5d4dd4['model']=_[_0x5c09('0x3c')](db[_0x5c09('0x36')][_0x5c09('0x50')]);_0x5d4dd4['query']=_[_0x5c09('0x3c')](_0x188dcf['query']);_0x5d4dd4['filters']=_[_0x5c09('0x3e')](_0x5d4dd4['model'],_0x5d4dd4[_0x5c09('0x3b')]);_0x2a68a6[_0x5c09('0x3f')]=_[_0x5c09('0x3e')](_0x5d4dd4[_0x5c09('0x3a')],qs['fields'](_0x188dcf[_0x5c09('0x3b')][_0x5c09('0x40')]));_0x2a68a6[_0x5c09('0x3f')]=_0x2a68a6[_0x5c09('0x3f')][_0x5c09('0x41')]?_0x2a68a6[_0x5c09('0x3f')]:_0x5d4dd4[_0x5c09('0x3a')];if(_0x188dcf[_0x5c09('0x3b')]['includeAll']){_0x2a68a6[_0x5c09('0x4a')]=[{'all':!![]}];}_0x2a68a6=_[_0x5c09('0x47')]({},_0x2a68a6,_0x188dcf[_0x5c09('0x49')]);return db[_0x5c09('0x36')]['find'](_0x2a68a6)[_0x5c09('0x1c')](handleEntityNotFound(_0x12fa73,null))[_0x5c09('0x1c')](respondWithResult(_0x12fa73,null))[_0x5c09('0x4d')](handleError(_0x12fa73,null));};exports[_0x5c09('0x31')]=function(_0x8eacc9,_0x59d057){if(_0x8eacc9[_0x5c09('0x51')]['id']){delete _0x8eacc9[_0x5c09('0x51')]['id'];}return db[_0x5c09('0x36')][_0x5c09('0x52')]({'where':{'id':_0x8eacc9[_0x5c09('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59d057,null))[_0x5c09('0x1c')](saveUpdates(_0x8eacc9[_0x5c09('0x51')],null))[_0x5c09('0x1c')](respondWithResult(_0x59d057,null))[_0x5c09('0x4d')](handleError(_0x59d057,null));};exports['addLogo']=function(_0x559ee6,_0x321430,_0x21b9a3){if(_0x559ee6['file']&&_0x559ee6[_0x5c09('0x53')][_0x5c09('0x54')]){_0x559ee6[_0x5c09('0x51')][_0x5c09('0x55')]=_0x559ee6[_0x5c09('0x53')][_0x5c09('0x54')];}return db['Setting'][_0x5c09('0x52')]({'where':{'id':_0x559ee6['params']['id']}})[_0x5c09('0x1c')](handleEntityNotFound(_0x321430,null))[_0x5c09('0x1c')](saveUpdates(_0x559ee6[_0x5c09('0x51')],null))[_0x5c09('0x1c')](respondWithResult(_0x321430,null))[_0x5c09('0x4d')](handleError(_0x321430,null));};exports['addLogoLogin']=function(_0x831777,_0x3051f5,_0x5052c2){if(_0x831777[_0x5c09('0x53')]&&_0x831777[_0x5c09('0x53')][_0x5c09('0x54')]){_0x831777[_0x5c09('0x51')][_0x5c09('0x56')]=_0x831777[_0x5c09('0x53')][_0x5c09('0x54')];}return db[_0x5c09('0x36')][_0x5c09('0x52')]({'where':{'id':_0x831777[_0x5c09('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3051f5,null))[_0x5c09('0x1c')](saveUpdates(_0x831777[_0x5c09('0x51')],null))[_0x5c09('0x1c')](respondWithResult(_0x3051f5,null))[_0x5c09('0x4d')](handleError(_0x3051f5,null));};var utilLicense=require(_0x5c09('0x18'));exports[_0x5c09('0x57')]=function(_0x221652,_0x38835e,_0x3a8b96){var _0xb40017=_0x5c09('0x58');var _0x2e98af={'custom':![]};return utilLicense[_0x5c09('0x59')]()['then'](function(_0x1f178c){if(_0x1f178c){_0x2e98af=_0x1f178c;}return db[_0x5c09('0x36')][_0x5c09('0x52')]({'where':{'id':_0x221652[_0x5c09('0x4f')]['id']},'attributes':[_0x5c09('0x55'),_0x5c09('0x56'),'preferred',_0x5c09('0x5a'),_0x5c09('0x5b'),_0x5c09('0x5c'),'defaultPreferred',_0x5c09('0x5d')],'raw':!![]});})[_0x5c09('0x1c')](handleEntityNotFound(_0x38835e,null))[_0x5c09('0x1c')](function(_0x52ba4c){if(_0x52ba4c){var _0x117aa9=_0x52ba4c['logo']&&fs[_0x5c09('0x5e')](path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0xb40017,_[_0x5c09('0x61')](_0x52ba4c['logo'])))?path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0xb40017,_[_0x5c09('0x61')](_0x52ba4c[_0x5c09('0x55')])):path['join'](config['root'],_0xb40017,_['toLower'](_0x5c09('0x62')));var _0x579b86=_0x5c09('0x63')+_['upperFirst'](_0x5c09('0x55'));if(_0x52ba4c[_0x579b86]||!_0x2e98af[_0x5c09('0x64')]){_0x117aa9=path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0xb40017,_[_0x5c09('0x61')]('default_logo.svg'));}if(!fs['existsSync'](_0x117aa9)){throw new db[(_0x5c09('0x65'))]['ValidationError'](_[_0x5c09('0x66')]('logo')+'\x20not\x20found');}return _0x38835e[_0x5c09('0x67')](_0x117aa9);}})[_0x5c09('0x4d')](handleError(_0x38835e,null));};var utilLicense=require('../../config/license/util');exports[_0x5c09('0x68')]=function(_0x38eaa2,_0x33a6d9,_0x33f22e){var _0x2dadc1=_0x5c09('0x58');var _0x41c115={'custom':![]};return utilLicense[_0x5c09('0x59')]()['then'](function(_0x2cd5ee){if(_0x2cd5ee){_0x41c115=_0x2cd5ee;}return db[_0x5c09('0x36')][_0x5c09('0x52')]({'where':{'id':_0x38eaa2[_0x5c09('0x4f')]['id']},'attributes':[_0x5c09('0x55'),_0x5c09('0x56'),'preferred',_0x5c09('0x5a'),'defaultLogo',_0x5c09('0x5c'),_0x5c09('0x69'),'defaultFavicon'],'raw':!![]});})[_0x5c09('0x1c')](handleEntityNotFound(_0x33a6d9,null))[_0x5c09('0x1c')](function(_0x410847){if(_0x410847){var _0x5b1b6a=_0x410847[_0x5c09('0x56')]&&fs['existsSync'](path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x2dadc1,_['toLower'](_0x410847[_0x5c09('0x56')])))?path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x2dadc1,_[_0x5c09('0x61')](_0x410847['loginLogo'])):path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x2dadc1,_[_0x5c09('0x61')](_0x5c09('0x6a')));var _0x3b9aea=_0x5c09('0x63')+_[_0x5c09('0x66')](_0x5c09('0x56'));if(_0x410847[_0x3b9aea]||!_0x41c115[_0x5c09('0x64')]){_0x5b1b6a=path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x2dadc1,_['toLower'](_0x5c09('0x6a')));}if(!fs[_0x5c09('0x5e')](_0x5b1b6a)){throw new db[(_0x5c09('0x65'))][(_0x5c09('0x6b'))](_[_0x5c09('0x66')]('loginLogo')+_0x5c09('0x6c'));}return _0x33a6d9[_0x5c09('0x67')](_0x5b1b6a);}})[_0x5c09('0x4d')](handleError(_0x33a6d9,null));};exports[_0x5c09('0x6d')]=function(_0x2236d9,_0x3e5a99){return db[_0x5c09('0x36')][_0x5c09('0x52')]({'where':{'id':_0x2236d9[_0x5c09('0x4f')]['id']},'attributes':[_0x5c09('0x6e')]})[_0x5c09('0x1c')](respondWithResult(_0x3e5a99,null))['catch'](handleError(_0x3e5a99,null));};exports[_0x5c09('0x6f')]=function(_0x2220e4,_0x2d7bbc,_0x47712c){if(_0x2220e4[_0x5c09('0x53')]&&_0x2220e4[_0x5c09('0x53')][_0x5c09('0x54')]){_0x2220e4[_0x5c09('0x51')][_0x5c09('0x70')]=_0x2220e4[_0x5c09('0x53')][_0x5c09('0x54')];}return db[_0x5c09('0x36')]['find']({'where':{'id':_0x2220e4[_0x5c09('0x4f')]['id']}})[_0x5c09('0x1c')](handleEntityNotFound(_0x2d7bbc,null))[_0x5c09('0x1c')](saveUpdates(_0x2220e4[_0x5c09('0x51')],null))[_0x5c09('0x1c')](respondWithResult(_0x2d7bbc,null))['catch'](handleError(_0x2d7bbc,null));};var utilLicense=require('../../config/license/util');exports[_0x5c09('0x71')]=function(_0x54de8b,_0x3e2ad7,_0x5dcd62){var _0x394b5d=_0x5c09('0x58');var _0x3e886a={'custom':![]};return utilLicense[_0x5c09('0x59')]()[_0x5c09('0x1c')](function(_0x105173){if(_0x105173){_0x3e886a=_0x105173;}return db['Setting']['find']({'where':{'id':_0x54de8b['params']['id']},'attributes':[_0x5c09('0x55'),_0x5c09('0x56'),_0x5c09('0x70'),'favicon','defaultLogo',_0x5c09('0x5c'),'defaultPreferred',_0x5c09('0x5d')],'raw':!![]});})[_0x5c09('0x1c')](handleEntityNotFound(_0x3e2ad7,null))[_0x5c09('0x1c')](function(_0x3530b5){if(_0x3530b5){var _0x53ee9c=_0x3530b5[_0x5c09('0x70')]&&fs['existsSync'](path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x394b5d,_['toLower'](_0x3530b5['preferred'])))?path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x394b5d,_[_0x5c09('0x61')](_0x3530b5[_0x5c09('0x70')])):path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x394b5d,_[_0x5c09('0x61')](_0x5c09('0x72')));var _0x36225b=_0x5c09('0x63')+_[_0x5c09('0x66')]('preferred');if(_0x3530b5[_0x36225b]||!_0x3e886a['custom']||!_0x3e886a[_0x5c09('0x70')]){_0x53ee9c=path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x394b5d,_[_0x5c09('0x61')](_0x5c09('0x72')));}if(!fs[_0x5c09('0x5e')](_0x53ee9c)){throw new db[(_0x5c09('0x65'))][(_0x5c09('0x6b'))](_[_0x5c09('0x66')](_0x5c09('0x70'))+_0x5c09('0x6c'));}return _0x3e2ad7[_0x5c09('0x67')](_0x53ee9c);}})[_0x5c09('0x4d')](handleError(_0x3e2ad7,null));};exports['addFavicon']=function(_0x12146a,_0x987e43,_0x5601ee){if(_0x12146a[_0x5c09('0x53')]&&_0x12146a['file'][_0x5c09('0x54')]){_0x12146a['body']['favicon']=_0x12146a['file'][_0x5c09('0x54')];}return db['Setting'][_0x5c09('0x52')]({'where':{'id':_0x12146a[_0x5c09('0x4f')]['id']}})['then'](handleEntityNotFound(_0x987e43,null))[_0x5c09('0x1c')](saveUpdates(_0x12146a[_0x5c09('0x51')],null))[_0x5c09('0x1c')](respondWithResult(_0x987e43,null))[_0x5c09('0x4d')](handleError(_0x987e43,null));};var utilLicense=require(_0x5c09('0x18'));exports[_0x5c09('0x73')]=function(_0x18e473,_0x23ae60,_0x219c82){var _0x16f1b1=_0x5c09('0x58');var _0x31a3a3={'custom':![]};return utilLicense[_0x5c09('0x59')]()[_0x5c09('0x1c')](function(_0x115c89){if(_0x115c89){_0x31a3a3=_0x115c89;}return db[_0x5c09('0x36')]['find']({'where':{'id':_0x18e473[_0x5c09('0x4f')]['id']},'attributes':['logo',_0x5c09('0x56'),'preferred',_0x5c09('0x5a'),'defaultLogo',_0x5c09('0x5c'),_0x5c09('0x69'),_0x5c09('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x23ae60,null))[_0x5c09('0x1c')](function(_0x11d015){if(_0x11d015){var _0x50ea14=_0x11d015[_0x5c09('0x5a')]&&fs[_0x5c09('0x5e')](path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x16f1b1,_[_0x5c09('0x61')](_0x11d015[_0x5c09('0x5a')])))?path[_0x5c09('0x5f')](config[_0x5c09('0x60')],_0x16f1b1,_['toLower'](_0x11d015[_0x5c09('0x5a')])):path['join'](config['root'],_0x16f1b1,_[_0x5c09('0x61')](_0x5c09('0x74')));var _0x9543de=_0x5c09('0x63')+_['upperFirst'](_0x5c09('0x5a'));if(_0x11d015[_0x9543de]||!_0x31a3a3[_0x5c09('0x64')]){_0x50ea14=path[_0x5c09('0x5f')](config['root'],_0x16f1b1,_[_0x5c09('0x61')](_0x5c09('0x74')));}if(!fs['existsSync'](_0x50ea14)){throw new db['Sequelize'][(_0x5c09('0x6b'))](_[_0x5c09('0x66')]('favicon')+_0x5c09('0x6c'));}return _0x23ae60[_0x5c09('0x67')](_0x50ea14);}})[_0x5c09('0x4d')](handleError(_0x23ae60,null));};exports[_0x5c09('0x75')]=function(_0x1263a1,_0x52faae){var _0x2d1b0f={'offset':moment()[_0x5c09('0x76')]()};_0x2d1b0f['now']=moment()['utcOffset'](_0x2d1b0f[_0x5c09('0x29')])[_0x5c09('0x77')](_0x5c09('0x78'));return _0x52faae[_0x5c09('0x27')](0xc8)[_0x5c09('0x79')](_0x2d1b0f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 64f5a0b..74c6727 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x5c2042,_0x59d450){var _0x1d7b1b=function(_0x16cc3b){while(--_0x16cc3b){_0x5c2042['push'](_0x5c2042['shift']());}};_0x1d7b1b(++_0x59d450);}(_0xedd9,0xfc));var _0x9edd=function(_0xaf7d36,_0x64ead5){_0xaf7d36=_0xaf7d36-0x0;var _0x5eeb6a=_0xedd9[_0xaf7d36];return _0x5eeb6a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x1a596b,_0xeb0492){var _0x4710bb=function(_0x5a0ef6){while(--_0x5a0ef6){_0x1a596b['push'](_0x1a596b['shift']());}};_0x4710bb(++_0xeb0492);}(_0x34e8,0x12c));var _0x834e=function(_0x2ec157,_0x116344){_0x2ec157=_0x2ec157-0x0;var _0x40c22d=_0x34e8[_0x2ec157];return _0x40c22d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'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 c3d9a84..c211918 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 _0x58f1=['request\x20sent','debug','error','code','message','info','catch','find','options','where','attributes','include','map','model','ShowSetting','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','Setting,\x20%s,\x20%s'];(function(_0x4fedc0,_0x2bff67){var _0x4e3c73=function(_0xa5ddd7){while(--_0xa5ddd7){_0x4fedc0['push'](_0x4fedc0['shift']());}};_0x4e3c73(++_0x2bff67);}(_0x58f1,0xa1));var _0x158f=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x58f1[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x158f('0x0'));var util=require(_0x158f('0x1'));var moment=require(_0x158f('0x2'));var BPromise=require(_0x158f('0x3'));var rs=require(_0x158f('0x4'));var fs=require('fs');var Redis=require(_0x158f('0x5'));var db=require(_0x158f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x158f('0x7'))('rpc');var config=require(_0x158f('0x8'));var jayson=require(_0x158f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec56c,_0x5ef9f7,_0xd26017){return new BPromise(function(_0x5c961e,_0x1eaf14){return client[_0x158f('0xa')](_0x3ec56c,_0xd26017)[_0x158f('0xb')](function(_0x1ecdd6){logger['info'](_0x158f('0xc'),_0x5ef9f7,_0x158f('0xd'));logger[_0x158f('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x5ef9f7,'request\x20sent',JSON['stringify'](_0x1ecdd6));if(_0x1ecdd6[_0x158f('0xf')]){if(_0x1ecdd6['error'][_0x158f('0x10')]===0x1f4){logger[_0x158f('0xf')](_0x158f('0xc'),_0x5ef9f7,_0x1ecdd6[_0x158f('0xf')][_0x158f('0x11')]);return _0x1eaf14(_0x1ecdd6[_0x158f('0xf')][_0x158f('0x11')]);}logger['error'](_0x158f('0xc'),_0x5ef9f7,_0x1ecdd6['error'][_0x158f('0x11')]);return _0x5c961e(_0x1ecdd6[_0x158f('0xf')][_0x158f('0x11')]);}else{logger[_0x158f('0x12')](_0x158f('0xc'),_0x5ef9f7,_0x158f('0xd'));_0x5c961e(_0x1ecdd6['result'][_0x158f('0x11')]);}})[_0x158f('0x13')](function(_0x129cc1){logger[_0x158f('0xf')](_0x158f('0xc'),_0x5ef9f7,_0x129cc1);_0x1eaf14(_0x129cc1);});});}exports['ShowSetting']=function(_0x5f3026){var _0x5579eb=this;return new Promise(function(_0x11d1d5,_0x195244){return db['Setting'][_0x158f('0x14')]({'raw':_0x5f3026['options']?_0x5f3026['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f3026[_0x158f('0x15')]?_0x5f3026[_0x158f('0x15')][_0x158f('0x16')]||null:null,'attributes':_0x5f3026['options']?_0x5f3026['options'][_0x158f('0x17')]||null:null,'include':_0x5f3026[_0x158f('0x15')]?_0x5f3026[_0x158f('0x15')][_0x158f('0x18')]?_[_0x158f('0x19')](_0x5f3026[_0x158f('0x15')]['include'],function(_0x12c704){return{'model':db[_0x12c704[_0x158f('0x1a')]],'as':_0x12c704['as'],'attributes':_0x12c704[_0x158f('0x17')],'include':_0x12c704[_0x158f('0x18')]?_['map'](_0x12c704['include'],function(_0x1cde98){return{'model':db[_0x1cde98['model']],'as':_0x1cde98['as'],'attributes':_0x1cde98[_0x158f('0x17')],'include':_0x1cde98[_0x158f('0x18')]?_[_0x158f('0x19')](_0x1cde98[_0x158f('0x18')],function(_0x9f4bc8){return{'model':db[_0x9f4bc8[_0x158f('0x1a')]],'as':_0x9f4bc8['as'],'attributes':_0x9f4bc8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12f2e4){logger[_0x158f('0x12')](_0x158f('0x1b'),_0x5f3026);logger[_0x158f('0xe')]('ShowSetting',_0x5f3026,JSON[_0x158f('0x1c')](_0x12f2e4));_0x11d1d5(_0x12f2e4);})['catch'](function(_0x243970){logger['error'](_0x158f('0x1b'),_0x243970[_0x158f('0x11')],_0x5f3026);_0x195244(_0x5579eb['error'](0x1f4,_0x243970[_0x158f('0x11')]));});});}; \ No newline at end of file +var _0xa35f=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSetting','find','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','bluebird','randomstring'];(function(_0x4ae9aa,_0x4f5010){var _0x3e0e6f=function(_0x3d2043){while(--_0x3d2043){_0x4ae9aa['push'](_0x4ae9aa['shift']());}};_0x3e0e6f(++_0x4f5010);}(_0xa35f,0xb0));var _0xfa35=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xa35f[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0xfa35('0x0'));var util=require(_0xfa35('0x1'));var moment=require('moment');var BPromise=require(_0xfa35('0x2'));var rs=require(_0xfa35('0x3'));var fs=require('fs');var Redis=require(_0xfa35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa35('0x5'));var logger=require(_0xfa35('0x6'))('rpc');var config=require(_0xfa35('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfa35('0x8')][_0xfa35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d4b07,_0x114629,_0x325a8f){return new BPromise(function(_0x253123,_0x400003){return client['request'](_0x1d4b07,_0x325a8f)[_0xfa35('0xa')](function(_0x28a136){logger['info'](_0xfa35('0xb'),_0x114629,'request\x20sent');logger['debug'](_0xfa35('0xc'),_0x114629,'request\x20sent',JSON[_0xfa35('0xd')](_0x28a136));if(_0x28a136[_0xfa35('0xe')]){if(_0x28a136['error'][_0xfa35('0xf')]===0x1f4){logger['error'](_0xfa35('0xb'),_0x114629,_0x28a136['error'][_0xfa35('0x10')]);return _0x400003(_0x28a136['error'][_0xfa35('0x10')]);}logger['error'](_0xfa35('0xb'),_0x114629,_0x28a136[_0xfa35('0xe')][_0xfa35('0x10')]);return _0x253123(_0x28a136[_0xfa35('0xe')][_0xfa35('0x10')]);}else{logger[_0xfa35('0x11')](_0xfa35('0xb'),_0x114629,'request\x20sent');_0x253123(_0x28a136[_0xfa35('0x12')]['message']);}})['catch'](function(_0x582546){logger[_0xfa35('0xe')](_0xfa35('0xb'),_0x114629,_0x582546);_0x400003(_0x582546);});});}exports[_0xfa35('0x13')]=function(_0x155f05){var _0x256258=this;return new Promise(function(_0x4a030d,_0x426220){return db['Setting'][_0xfa35('0x14')]({'raw':_0x155f05[_0xfa35('0x15')]?_0x155f05[_0xfa35('0x15')][_0xfa35('0x16')]===undefined?!![]:![]:!![],'where':_0x155f05[_0xfa35('0x15')]?_0x155f05['options'][_0xfa35('0x17')]||null:null,'attributes':_0x155f05['options']?_0x155f05[_0xfa35('0x15')][_0xfa35('0x18')]||null:null,'include':_0x155f05['options']?_0x155f05['options'][_0xfa35('0x19')]?_[_0xfa35('0x1a')](_0x155f05[_0xfa35('0x15')][_0xfa35('0x19')],function(_0x3bf569){return{'model':db[_0x3bf569['model']],'as':_0x3bf569['as'],'attributes':_0x3bf569[_0xfa35('0x18')],'include':_0x3bf569[_0xfa35('0x19')]?_['map'](_0x3bf569['include'],function(_0x1f83de){return{'model':db[_0x1f83de[_0xfa35('0x1b')]],'as':_0x1f83de['as'],'attributes':_0x1f83de[_0xfa35('0x18')],'include':_0x1f83de['include']?_[_0xfa35('0x1a')](_0x1f83de['include'],function(_0x2c18a9){return{'model':db[_0x2c18a9[_0xfa35('0x1b')]],'as':_0x2c18a9['as'],'attributes':_0x2c18a9[_0xfa35('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfa35('0xa')](function(_0x22cf6f){logger[_0xfa35('0x11')](_0xfa35('0x13'),_0x155f05);logger[_0xfa35('0x1c')](_0xfa35('0x13'),_0x155f05,JSON[_0xfa35('0xd')](_0x22cf6f));_0x4a030d(_0x22cf6f);})[_0xfa35('0x1d')](function(_0x39c63d){logger[_0xfa35('0xe')](_0xfa35('0x13'),_0x39c63d['message'],_0x155f05);_0x426220(_0x256258['error'](0x1f4,_0x39c63d[_0xfa35('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e6b683a..c39f163 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x4a90b4,_0x51f9ef){var _0x1fc985=function(_0x508518){while(--_0x508518){_0x4a90b4['push'](_0x4a90b4['shift']());}};_0x1fc985(++_0x51f9ef);}(_0x8ef6,0xf2));var _0x68ef=function(_0x36515c,_0x3475b3){_0x36515c=_0x36515c-0x0;var _0x2b4e63=_0x8ef6[_0x36515c];return _0x2b4e63;};'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 fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x61c3b0,_0x364f6b){_0x61c3b0=_0x61c3b0-0x0;var _0x4eacf3=_0xf494[_0x61c3b0];return _0x4eacf3;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index aa9c1af..c02b279 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 _0x890f=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','BOOLEAN'];(function(_0xe2b5fb,_0x232eaf){var _0x13a5f5=function(_0x5a54b5){while(--_0x5a54b5){_0xe2b5fb['push'](_0xe2b5fb['shift']());}};_0x13a5f5(++_0x232eaf);}(_0x890f,0xd4));var _0xf890=function(_0x11efe8,_0xe6ad7e){_0x11efe8=_0x11efe8-0x0;var _0x5954b8=_0x890f[_0x11efe8];return _0x5954b8;};'use strict';var Sequelize=require(_0xf890('0x0'));var rs=require(_0xf890('0x1'));module[_0xf890('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf890('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf890('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xf890('0x4')],'defaultValue':function(){return rs[_0xf890('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf890('0x6')](_0xf890('0x7'),'skebby',_0xf890('0x8'),_0xf890('0x9'),_0xf890('0xa'),_0xf890('0xb'),_0xf890('0xc'),_0xf890('0xd'),_0xf890('0xe'),_0xf890('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xf890('0x4')]},'smsMethod':{'type':Sequelize[_0xf890('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf890('0x4')]},'apiKey':{'type':Sequelize[_0xf890('0x4')]},'applicationId':{'type':Sequelize[_0xf890('0x4')]},'accountId':{'type':Sequelize[_0xf890('0x4')]},'senderString':{'type':Sequelize[_0xf890('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf890('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf890('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf890('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf890('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf890('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf890('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf890('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf890('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf890('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf890('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf890('0x11')],'defaultValue':![],'comment':_0xf890('0x13'),'set':function(_0x6f20d6){if(!_0x6f20d6)this[_0xf890('0x14')](_0xf890('0x15'),null);this[_0xf890('0x14')](_0xf890('0x16'),_0x6f20d6);}}}; \ No newline at end of file +var _0xb41f=['twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','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','name','STRING','ENUM'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb41f,0x10e));var _0xfb41=function(_0x1e553e,_0x38d687){_0x1e553e=_0x1e553e-0x0;var _0x328c2c=_0xb41f[_0x1e553e];return _0x328c2c;};'use strict';var Sequelize=require(_0xfb41('0x0'));var rs=require(_0xfb41('0x1'));module[_0xfb41('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb41('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfb41('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xfb41('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xfb41('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xfb41('0x4')]},'type':{'type':Sequelize[_0xfb41('0x5')](_0xfb41('0x6'),'skebby',_0xfb41('0x7'),_0xfb41('0x8'),_0xfb41('0x9'),_0xfb41('0xa'),_0xfb41('0xb'),_0xfb41('0xc'),_0xfb41('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0xfb41('0x4')]},'authId':{'type':Sequelize[_0xfb41('0x4')]},'authToken':{'type':Sequelize[_0xfb41('0x4')]},'smsMethod':{'type':Sequelize[_0xfb41('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfb41('0x4')]},'password':{'type':Sequelize[_0xfb41('0x4')]},'apiKey':{'type':Sequelize[_0xfb41('0x4')]},'applicationId':{'type':Sequelize[_0xfb41('0x4')]},'accountId':{'type':Sequelize[_0xfb41('0x4')]},'senderString':{'type':Sequelize[_0xfb41('0x4')]},'deliveryReport':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xfb41('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfb41('0xf')],'defaultValue':function(){return _0xfb41('0x10');}},'notificationSound':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb41('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb41('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb41('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfb41('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb41('0x11')],'comment':_0xfb41('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xfb41('0xe')],'defaultValue':![],'comment':_0xfb41('0x13'),'set':function(_0x3aecca){if(!_0x3aecca)this[_0xfb41('0x14')](_0xfb41('0x15'),null);this[_0xfb41('0x14')](_0xfb41('0x16'),_0x3aecca);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5e20f70..f6f1227 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 _0x29ef=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','message_id','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','limit','undefined','set','Content-Range','reject','save','update','then','get','SmsAccounts','UserProfileResource','end','stack','name','map','SmsAccount','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','options','count','includeAll','include','findAll','catch','show','params','Pause','mandatoryDispositionPause','rawAttributes','fields','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','SmsAccountId','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','infobip','results','csc','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','json','sequelize','transaction'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x29ef,0x10b));var _0xf29e=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x29ef[_0x43a37c];return _0x5d1d40;};'use strict';var emlformat=require(_0xf29e('0x0'));var rimraf=require(_0xf29e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf29e('0x2'));var rp=require(_0xf29e('0x3'));var moment=require(_0xf29e('0x4'));var BPromise=require(_0xf29e('0x5'));var Mustache=require(_0xf29e('0x6'));var util=require('util');var path=require(_0xf29e('0x7'));var sox=require('sox');var csv=require(_0xf29e('0x8'));var ejs=require(_0xf29e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf29e('0xa'));var squel=require(_0xf29e('0xb'));var crypto=require(_0xf29e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf29e('0xd'));var Redis=require('ioredis');var authService=require(_0xf29e('0xe'));var qs=require(_0xf29e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf29e('0x10'))(_0xf29e('0x11'));var utils=require(_0xf29e('0x12'));var config=require(_0xf29e('0x13'));var licenseUtil=require(_0xf29e('0x14'));var db=require(_0xf29e('0x15'))['db'];config[_0xf29e('0x16')]=_[_0xf29e('0x17')](config[_0xf29e('0x16')],{'host':_0xf29e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf29e('0x16')]));require(_0xf29e('0x19'))[_0xf29e('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf29e('0x1b')][_0xf29e('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x3b22cd,_0x5bc416,_0x508107,_0x36384b){return new BPromise(function(_0x3da57f,_0x1da178){var _0x2194f4=_0x36384b||client;return _0x2194f4[_0xf29e('0x1d')](_0x3b22cd,_0x508107)['then'](function(_0x14d714){logger[_0xf29e('0x1e')](_0xf29e('0x1f'),_0x5bc416,_0xf29e('0x20'));logger['debug'](_0xf29e('0x21'),_0x5bc416,_0xf29e('0x20'),JSON[_0xf29e('0x22')](_0x14d714));if(_0x14d714[_0xf29e('0x23')]){if(_0x14d714['error'][_0xf29e('0x24')]===0x1f4){logger[_0xf29e('0x23')](_0xf29e('0x1f'),_0x5bc416,_0x14d714[_0xf29e('0x23')][_0xf29e('0x25')]);return _0x1da178(_0x14d714['error'][_0xf29e('0x25')]);}logger[_0xf29e('0x23')]('SmsAccount,\x20%s,\x20%s',_0x5bc416,_0x14d714[_0xf29e('0x23')][_0xf29e('0x25')]);return _0x3da57f(_0x14d714['error'][_0xf29e('0x25')]);}else{logger[_0xf29e('0x1e')](_0xf29e('0x1f'),_0x5bc416,'request\x20sent');_0x3da57f(_0x14d714[_0xf29e('0x26')]['message']);}})['catch'](function(_0x53765b){logger[_0xf29e('0x23')](_0xf29e('0x1f'),_0x5bc416,_0x53765b);_0x1da178(_0x53765b);});});}function respondWithStatusCode(_0x3304be,_0x3585b2){_0x3585b2=_0x3585b2||0xcc;return function(_0x412f87){if(_0x412f87){return _0x3304be[_0xf29e('0x27')](_0x3585b2);}return _0x3304be[_0xf29e('0x28')](_0x3585b2)['end']();};}function respondWithResult(_0xbb3fdf,_0x1c8cae){_0x1c8cae=_0x1c8cae||0xc8;return function(_0x569672){if(_0x569672){return _0xbb3fdf[_0xf29e('0x28')](_0x1c8cae)['json'](_0x569672);}};}function respondWithFilteredResult(_0xcf1a56,_0x4a6fce){return function(_0x35fa8e){if(_0x35fa8e){var _0x58168d=typeof _0x4a6fce[_0xf29e('0x29')]==='undefined'&&typeof _0x4a6fce[_0xf29e('0x2a')]===_0xf29e('0x2b');var _0x5ccfe2=_0x35fa8e['count'];var _0x5d3474=_0x58168d?0x0:_0x4a6fce[_0xf29e('0x29')];var _0x432671=_0x58168d?_0x35fa8e['count']:_0x4a6fce[_0xf29e('0x29')]+_0x4a6fce[_0xf29e('0x2a')];var _0x250c76;if(_0x432671>=_0x5ccfe2){_0x432671=_0x5ccfe2;_0x250c76=0xc8;}else{_0x250c76=0xce;}_0xcf1a56['status'](_0x250c76);return _0xcf1a56[_0xf29e('0x2c')](_0xf29e('0x2d'),_0x5d3474+'-'+_0x432671+'/'+_0x5ccfe2)['json'](_0x35fa8e);}return null;};}function patchUpdates(_0x5ca432){return function(_0x3fd913){try{jsonpatch['apply'](_0x3fd913,_0x5ca432,!![]);}catch(_0x1ec4a4){return BPromise[_0xf29e('0x2e')](_0x1ec4a4);}return _0x3fd913[_0xf29e('0x2f')]();};}function saveUpdates(_0x3f7d3f,_0x38cc8a){return function(_0x51af6e){if(_0x51af6e){return _0x51af6e[_0xf29e('0x30')](_0x3f7d3f)['then'](function(_0x5eff7a){return _0x5eff7a;});}return null;};}function removeEntity(_0x2e6527,_0x28e862){return function(_0x309e16){if(_0x309e16){return _0x309e16['destroy']()[_0xf29e('0x31')](function(){var _0x2a2a20=_0x309e16[_0xf29e('0x32')]({'plain':!![]});var _0x49192e=_0xf29e('0x33');return db[_0xf29e('0x34')]['destroy']({'where':{'type':_0x49192e,'resourceId':_0x2a2a20['id']}})[_0xf29e('0x31')](function(){return _0x309e16;});})[_0xf29e('0x31')](function(){_0x2e6527[_0xf29e('0x28')](0xcc)[_0xf29e('0x35')]();});}};}function handleEntityNotFound(_0x16b05d,_0x144665){return function(_0x930e4d){if(!_0x930e4d){_0x16b05d[_0xf29e('0x27')](0x194);}return _0x930e4d;};}function handleError(_0x499718,_0x175728){_0x175728=_0x175728||0x1f4;return function(_0xf04640){logger['error'](_0xf04640[_0xf29e('0x36')]);if(_0xf04640[_0xf29e('0x37')]){delete _0xf04640[_0xf29e('0x37')];}_0x499718[_0xf29e('0x28')](_0x175728)['send'](_0xf04640);};}exports['index']=function(_0x5b6e4f,_0x17e785){var _0x889eb={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5cc644={},_0x3eac75={'count':0x0,'rows':[]};var _0x1d19b8=_[_0xf29e('0x38')](db[_0xf29e('0x39')]['rawAttributes'],function(_0x584416){return{'name':_0x584416[_0xf29e('0x3a')],'type':_0x584416['type']['key']};});_0x5cc644[_0xf29e('0x3b')]=_[_0xf29e('0x38')](_0x1d19b8,_0xf29e('0x37'));_0x5cc644[_0xf29e('0x3c')]=_[_0xf29e('0x3d')](_0x5b6e4f[_0xf29e('0x3c')]);_0x5cc644['filters']=_[_0xf29e('0x3e')](_0x5cc644[_0xf29e('0x3b')],_0x5cc644[_0xf29e('0x3c')]);_0x889eb[_0xf29e('0x3f')]=_[_0xf29e('0x3e')](_0x5cc644[_0xf29e('0x3b')],qs['fields'](_0x5b6e4f[_0xf29e('0x3c')]['fields']));_0x889eb[_0xf29e('0x3f')]=_0x889eb[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x889eb[_0xf29e('0x3f')]:_0x5cc644[_0xf29e('0x3b')];if(!_0x5b6e4f[_0xf29e('0x3c')][_0xf29e('0x41')](_0xf29e('0x42'))){_0x889eb['limit']=qs[_0xf29e('0x2a')](_0x5b6e4f['query'][_0xf29e('0x2a')]);_0x889eb[_0xf29e('0x29')]=qs['offset'](_0x5b6e4f['query'][_0xf29e('0x29')]);}_0x889eb[_0xf29e('0x43')]=qs['sort'](_0x5b6e4f[_0xf29e('0x3c')][_0xf29e('0x44')]);_0x889eb['where']=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x5b6e4f['query'],_0x5cc644[_0xf29e('0x45')]),_0x1d19b8);if(_0x5b6e4f[_0xf29e('0x3c')][_0xf29e('0x47')]){_0x889eb['where']=_[_0xf29e('0x48')](_0x889eb[_0xf29e('0x49')],{'$or':_['map'](_0x1d19b8,function(_0x29ca68){if(_0x29ca68[_0xf29e('0x4a')]!=='VIRTUAL'){var _0x206e0b={};_0x206e0b[_0x29ca68[_0xf29e('0x37')]]={'$like':'%'+_0x5b6e4f[_0xf29e('0x3c')][_0xf29e('0x47')]+'%'};return _0x206e0b;}})});}_0x889eb=_[_0xf29e('0x48')]({},_0x889eb,_0x5b6e4f[_0xf29e('0x4b')]);var _0x53be98={'where':_0x889eb[_0xf29e('0x49')]};return db['SmsAccount'][_0xf29e('0x4c')](_0x53be98)[_0xf29e('0x31')](function(_0x1c0390){_0x3eac75[_0xf29e('0x4c')]=_0x1c0390;if(_0x5b6e4f[_0xf29e('0x3c')][_0xf29e('0x4d')]){_0x889eb[_0xf29e('0x4e')]=[{'all':!![]}];}return db['SmsAccount'][_0xf29e('0x4f')](_0x889eb);})['then'](function(_0x4cbe98){_0x3eac75['rows']=_0x4cbe98;return _0x3eac75;})[_0xf29e('0x31')](respondWithFilteredResult(_0x17e785,_0x889eb))[_0xf29e('0x50')](handleError(_0x17e785,null));};exports[_0xf29e('0x51')]=function(_0xd89e6a,_0x347d9e){var _0x42f81b={'raw':![],'where':{'id':_0xd89e6a[_0xf29e('0x52')]['id']},'include':[{'model':db[_0xf29e('0x53')],'as':_0xf29e('0x54')}]},_0x50cd63={};_0x50cd63['model']=_[_0xf29e('0x3d')](db['SmsAccount'][_0xf29e('0x55')]);_0x50cd63[_0xf29e('0x3c')]=_[_0xf29e('0x3d')](_0xd89e6a['query']);_0x50cd63['filters']=_[_0xf29e('0x3e')](_0x50cd63['model'],_0x50cd63[_0xf29e('0x3c')]);_0x42f81b[_0xf29e('0x3f')]=_[_0xf29e('0x3e')](_0x50cd63['model'],qs[_0xf29e('0x56')](_0xd89e6a[_0xf29e('0x3c')]['fields']));_0x42f81b['attributes']=_0x42f81b[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x42f81b[_0xf29e('0x3f')]:_0x50cd63['model'];if(_0xd89e6a['query'][_0xf29e('0x4d')]){_0x42f81b['include']=[{'all':!![]}];}_0x42f81b=_[_0xf29e('0x48')]({},_0x42f81b,_0xd89e6a['options']);return db[_0xf29e('0x39')]['find'](_0x42f81b)[_0xf29e('0x31')](handleEntityNotFound(_0x347d9e,null))[_0xf29e('0x31')](respondWithResult(_0x347d9e,null))['catch'](handleError(_0x347d9e,null));};exports[_0xf29e('0x57')]=function(_0x3746da,_0x57e628){return db[_0xf29e('0x39')][_0xf29e('0x57')](_0x3746da[_0xf29e('0x58')],{})[_0xf29e('0x31')](function(_0x44e597){var _0x2c0fef=_0x3746da[_0xf29e('0x59')][_0xf29e('0x32')]({'plain':!![]});if(!_0x2c0fef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c0fef[_0xf29e('0x5a')]===_0xf29e('0x59')){var _0x3bc212=_0x44e597[_0xf29e('0x32')]({'plain':!![]});var _0x243302=_0xf29e('0x33');return db[_0xf29e('0x5b')][_0xf29e('0x5c')]({'where':{'name':_0x243302,'userProfileId':_0x2c0fef[_0xf29e('0x5d')]},'raw':!![]})[_0xf29e('0x31')](function(_0x3d14fe){if(_0x3d14fe&&_0x3d14fe['autoAssociation']===0x0){return db[_0xf29e('0x34')][_0xf29e('0x57')]({'name':_0x3bc212[_0xf29e('0x37')],'resourceId':_0x3bc212['id'],'type':_0x3d14fe[_0xf29e('0x37')],'sectionId':_0x3d14fe['id']},{})[_0xf29e('0x31')](function(){return _0x44e597;});}else{return _0x44e597;}})[_0xf29e('0x50')](function(_0x5fa757){logger[_0xf29e('0x23')](_0xf29e('0x5e'),_0x5fa757);throw _0x5fa757;});}return _0x44e597;})[_0xf29e('0x31')](respondWithResult(_0x57e628,0xc9))['catch'](handleError(_0x57e628,null));};exports['update']=function(_0xd797a5,_0x592b48){if(_0xd797a5[_0xf29e('0x58')]['id']){delete _0xd797a5[_0xf29e('0x58')]['id'];}return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0xd797a5[_0xf29e('0x52')]['id']},'include':[{'model':db[_0xf29e('0x53')],'as':_0xf29e('0x54')}]})[_0xf29e('0x31')](handleEntityNotFound(_0x592b48,null))[_0xf29e('0x31')](saveUpdates(_0xd797a5['body'],null))[_0xf29e('0x31')](respondWithResult(_0x592b48,null))[_0xf29e('0x50')](handleError(_0x592b48,null));};exports[_0xf29e('0x5f')]=function(_0x110852,_0x1f3081){return db[_0xf29e('0x39')]['find']({'where':{'id':_0x110852[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x1f3081,null))[_0xf29e('0x31')](removeEntity(_0x1f3081,null))['catch'](handleError(_0x1f3081,null));};exports[_0xf29e('0x60')]=function(_0x189415,_0x45979f){return db[_0xf29e('0x39')][_0xf29e('0x60')]()[_0xf29e('0x31')](respondWithResult(_0x45979f,null))[_0xf29e('0x50')](handleError(_0x45979f,null));};exports[_0xf29e('0x61')]=function(_0xfeb308,_0x444499,_0x452172){if(_0xfeb308[_0xf29e('0x58')]['id']){delete _0xfeb308[_0xf29e('0x58')]['id'];}return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0xfeb308[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x444499,null))[_0xf29e('0x31')](function(_0x48f6c3){if(_0x48f6c3){_0xfeb308[_0xf29e('0x58')]['SmsAccountId']=_0x48f6c3['id'];return db[_0xf29e('0x62')][_0xf29e('0x57')](_0xfeb308[_0xf29e('0x58')]);}})['then'](respondWithResult(_0x444499,null))[_0xf29e('0x50')](handleError(_0x444499,null));};exports[_0xf29e('0x63')]=function(_0x1a3f0f,_0xdb281c,_0x217edd){var _0x4b4ead={'raw':![],'where':{}};var _0x1a8b33={};var _0x4056c4={'count':0x0,'rows':[]};return db[_0xf29e('0x39')]['findOne']({'where':{'id':_0x1a3f0f[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0xdb281c,null))[_0xf29e('0x31')](function(_0x1ddeea){if(_0x1ddeea){_0x1a8b33['model']=_[_0xf29e('0x3d')](db[_0xf29e('0x62')]['rawAttributes']);_0x1a8b33['query']=_[_0xf29e('0x3d')](_0x1a3f0f['query']);_0x1a8b33['filters']=_[_0xf29e('0x3e')](_0x1a8b33[_0xf29e('0x3b')],_0x1a8b33[_0xf29e('0x3c')]);_0x4b4ead['attributes']=_['intersection'](_0x1a8b33['model'],qs[_0xf29e('0x56')](_0x1a3f0f[_0xf29e('0x3c')]['fields']));_0x4b4ead['attributes']=_0x4b4ead[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x4b4ead[_0xf29e('0x3f')]:_0x1a8b33[_0xf29e('0x3b')];if(!_0x1a3f0f[_0xf29e('0x3c')][_0xf29e('0x41')]('nolimit')){_0x4b4ead[_0xf29e('0x2a')]=qs[_0xf29e('0x2a')](_0x1a3f0f[_0xf29e('0x3c')]['limit']);_0x4b4ead['offset']=qs[_0xf29e('0x29')](_0x1a3f0f[_0xf29e('0x3c')][_0xf29e('0x29')]);}_0x4b4ead[_0xf29e('0x43')]=qs[_0xf29e('0x44')](_0x1a3f0f[_0xf29e('0x3c')]['sort']);_0x4b4ead[_0xf29e('0x49')]=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x1a3f0f['query'],_0x1a8b33[_0xf29e('0x45')]));_0x4b4ead[_0xf29e('0x49')][_0xf29e('0x64')]=_0x1ddeea['id'];if(_0x1a3f0f['query'][_0xf29e('0x47')]){_0x4b4ead['where']=_[_0xf29e('0x48')](_0x4b4ead[_0xf29e('0x49')],{'$or':_[_0xf29e('0x38')](_0x4b4ead[_0xf29e('0x3f')],function(_0x5361f5){var _0x1e2876={};_0x1e2876[_0x5361f5]={'$like':'%'+_0x1a3f0f[_0xf29e('0x3c')][_0xf29e('0x47')]+'%'};return _0x1e2876;})});}_0x4b4ead=_[_0xf29e('0x48')]({},_0x4b4ead,_0x1a3f0f['options']);return db['Disposition']['count']({'where':_0x4b4ead[_0xf29e('0x49')]})['then'](function(_0x590432){_0x4056c4[_0xf29e('0x4c')]=_0x590432;if(_0x1a3f0f[_0xf29e('0x3c')][_0xf29e('0x4d')]){_0x4b4ead['include']=[{'all':!![]}];}return db[_0xf29e('0x62')][_0xf29e('0x4f')](_0x4b4ead);})[_0xf29e('0x31')](function(_0x2fb059){_0x4056c4[_0xf29e('0x65')]=_0x2fb059;return _0x4056c4;});}})['then'](respondWithFilteredResult(_0xdb281c,_0x4b4ead))[_0xf29e('0x50')](handleError(_0xdb281c,null));};exports[_0xf29e('0x66')]=function(_0x587283,_0x576c14,_0x3f6434){return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0x587283['params']['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x576c14,null))[_0xf29e('0x31')](function(_0x22a4df){if(_0x22a4df){return _0x22a4df[_0xf29e('0x66')](_0x587283[_0xf29e('0x3c')]['ids']);}})[_0xf29e('0x31')](respondWithStatusCode(_0x576c14,null))[_0xf29e('0x50')](handleError(_0x576c14,null));};exports[_0xf29e('0x67')]=function(_0x4ef2ea,_0x3068e1,_0xe49506){if(_0x4ef2ea[_0xf29e('0x58')]['id']){delete _0x4ef2ea[_0xf29e('0x58')]['id'];}return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0x4ef2ea[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x3068e1,null))['then'](function(_0x26b451){if(_0x26b451){_0x4ef2ea['body']['SmsAccountId']=_0x26b451['id'];return db['CannedAnswer'][_0xf29e('0x57')](_0x4ef2ea[_0xf29e('0x58')]);}})[_0xf29e('0x31')](respondWithResult(_0x3068e1,null))['catch'](handleError(_0x3068e1,null));};exports[_0xf29e('0x68')]=function(_0x229912,_0x2877d9,_0x57f1ab){var _0x182829={'raw':![],'where':{}};var _0x3f8793={};var _0x2a7504={'count':0x0,'rows':[]};return db[_0xf29e('0x39')]['findOne']({'where':{'id':_0x229912['params']['id']}})['then'](handleEntityNotFound(_0x2877d9,null))[_0xf29e('0x31')](function(_0x263246){if(_0x263246){_0x3f8793[_0xf29e('0x3b')]=_['keys'](db[_0xf29e('0x69')][_0xf29e('0x55')]);_0x3f8793[_0xf29e('0x3c')]=_[_0xf29e('0x3d')](_0x229912[_0xf29e('0x3c')]);_0x3f8793[_0xf29e('0x45')]=_[_0xf29e('0x3e')](_0x3f8793[_0xf29e('0x3b')],_0x3f8793[_0xf29e('0x3c')]);_0x182829[_0xf29e('0x3f')]=_[_0xf29e('0x3e')](_0x3f8793['model'],qs[_0xf29e('0x56')](_0x229912[_0xf29e('0x3c')][_0xf29e('0x56')]));_0x182829['attributes']=_0x182829['attributes'][_0xf29e('0x40')]?_0x182829[_0xf29e('0x3f')]:_0x3f8793['model'];if(!_0x229912[_0xf29e('0x3c')][_0xf29e('0x41')](_0xf29e('0x42'))){_0x182829[_0xf29e('0x2a')]=qs[_0xf29e('0x2a')](_0x229912[_0xf29e('0x3c')]['limit']);_0x182829['offset']=qs[_0xf29e('0x29')](_0x229912[_0xf29e('0x3c')][_0xf29e('0x29')]);}_0x182829[_0xf29e('0x43')]=qs[_0xf29e('0x44')](_0x229912[_0xf29e('0x3c')][_0xf29e('0x44')]);_0x182829[_0xf29e('0x49')]=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x229912[_0xf29e('0x3c')],_0x3f8793[_0xf29e('0x45')]));_0x182829[_0xf29e('0x49')][_0xf29e('0x64')]=_0x263246['id'];if(_0x229912[_0xf29e('0x3c')][_0xf29e('0x47')]){_0x182829['where']=_[_0xf29e('0x48')](_0x182829['where'],{'$or':_[_0xf29e('0x38')](_0x182829[_0xf29e('0x3f')],function(_0x218670){var _0x5ee430={};_0x5ee430[_0x218670]={'$like':'%'+_0x229912[_0xf29e('0x3c')][_0xf29e('0x47')]+'%'};return _0x5ee430;})});}_0x182829=_[_0xf29e('0x48')]({},_0x182829,_0x229912[_0xf29e('0x4b')]);return db[_0xf29e('0x69')][_0xf29e('0x4c')]({'where':_0x182829['where']})[_0xf29e('0x31')](function(_0x4c302a){_0x2a7504['count']=_0x4c302a;if(_0x229912[_0xf29e('0x3c')][_0xf29e('0x4d')]){_0x182829['include']=[{'all':!![]}];}return db[_0xf29e('0x69')][_0xf29e('0x4f')](_0x182829);})['then'](function(_0x348fd6){_0x2a7504[_0xf29e('0x65')]=_0x348fd6;return _0x2a7504;});}})[_0xf29e('0x31')](respondWithFilteredResult(_0x2877d9,_0x182829))['catch'](handleError(_0x2877d9,null));};exports['removeAnswers']=function(_0x50b3c2,_0x6521e0,_0x615f74){return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0x50b3c2[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x6521e0,null))[_0xf29e('0x31')](function(_0x3e7489){if(_0x3e7489){return _0x3e7489[_0xf29e('0x6a')](_0x50b3c2[_0xf29e('0x3c')][_0xf29e('0x6b')]);}})[_0xf29e('0x31')](respondWithStatusCode(_0x6521e0,null))['catch'](handleError(_0x6521e0,null));};exports[_0xf29e('0x6c')]=function(_0x34a566,_0x3acbf6,_0x5164c4){var _0x37593d={'channel':'sms'};var _0x2905bf=[];var _0x50ca9c=[];var _0x392eb7={};return db['SmsAccount']['find']({'where':{'id':_0x34a566[_0xf29e('0x52')]['id']},'include':[{'model':db[_0xf29e('0x6d')],'as':_0xf29e('0x6e')}]})[_0xf29e('0x31')](handleEntityNotFound(_0x3acbf6,null))[_0xf29e('0x31')](function(_0x5db196){_0x37593d[_0xf29e('0x6f')]=_0x5db196;_0x37593d['applications']=_[_0xf29e('0x70')](_0x5db196[_0xf29e('0x6e')],[_0xf29e('0x71')],[_0xf29e('0x72')]);if(_0x37593d[_0xf29e('0x6f')][_0xf29e('0x6e')]){delete _0x37593d[_0xf29e('0x6f')]['Applications'];}return db[_0xf29e('0x73')][_0xf29e('0x60')]();})[_0xf29e('0x31')](function(_0x96ee2f){if(!_0x96ee2f){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2905bf=_[_0xf29e('0x74')](_[_0xf29e('0x3d')](_0x96ee2f),[_0xf29e('0x75'),_0xf29e('0x76')]);_0x50ca9c=_[_0xf29e('0x74')](_[_0xf29e('0x3d')](_0x96ee2f),[_0xf29e('0x75'),_0xf29e('0x76'),_0xf29e('0x77'),_0xf29e('0x78')]);_0x37593d[_0xf29e('0x58')]={'mapKey':_0xf29e('0x79')};if(_0x37593d[_0xf29e('0x6f')]['type']){switch(_0x37593d[_0xf29e('0x6f')][_0xf29e('0x4a')]){case'twilio':_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x7b')];_0x37593d[_0xf29e('0x58')]['body']=_0x34a566[_0xf29e('0x58')][_0xf29e('0x7c')];_0x37593d[_0xf29e('0x58')][_0xf29e('0x7d')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x7e')];break;case _0xf29e('0x7f'):_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')]='+'+_0x34a566[_0xf29e('0x58')]['sender'];_0x37593d[_0xf29e('0x58')]['body']=_0x34a566[_0xf29e('0x58')][_0xf29e('0x80')];break;case _0xf29e('0x81'):_0x37593d['body'][_0xf29e('0x7a')]=_0x34a566['body']['from'];_0x37593d[_0xf29e('0x58')]['body']=_0x34a566['body']['message'];break;case _0xf29e('0x82'):_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x7a')];_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x58')];_0x37593d['body'][_0xf29e('0x7d')]=_0x34a566[_0xf29e('0x58')]['message_id'];break;case _0xf29e('0x83'):_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x7b')];_0x37593d['body']['body']=_0x34a566[_0xf29e('0x58')]['Text'];_0x37593d[_0xf29e('0x58')]['messageId']=_0x34a566[_0xf29e('0x58')]['MessageUUID'];break;case _0xf29e('0x84'):_0x37593d[_0xf29e('0x58')]['from']='+'+_0x34a566[_0xf29e('0x58')][_0xf29e('0x85')][0x0][_0xf29e('0x7a')];_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]=_0x34a566['body'][_0xf29e('0x85')][0x0]['text'];_0x37593d[_0xf29e('0x58')][_0xf29e('0x7d')]=_0x34a566['body']['results'][0x0][_0xf29e('0x7d')];break;case _0xf29e('0x86'):_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')]=_0x34a566['body']['originatingAddress'];_0x37593d['body'][_0xf29e('0x58')]=_0x34a566[_0xf29e('0x58')]['segmentedMessage'][_0xf29e('0x25')];break;case _0xf29e('0x87'):_0x37593d['body'][_0xf29e('0x7a')]=_0x34a566['body']['fromNumber'];_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]=_0x34a566[_0xf29e('0x58')]['text'];_0x37593d['body'][_0xf29e('0x7d')]=_0x34a566[_0xf29e('0x58')][_0xf29e('0x88')];break;case _0xf29e('0x89'):_0x37593d[_0xf29e('0x58')][_0xf29e('0x7d')]=_0x34a566['body'][0x0][_0xf29e('0x25')]['id'];_0x37593d[_0xf29e('0x58')]['from']=_0x34a566[_0xf29e('0x58')][0x0][_0xf29e('0x25')][_0xf29e('0x7a')];_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]=_0x34a566['body'][0x0]['message'][_0xf29e('0x80')];break;case _0xf29e('0x8a'):_0x37593d['body'][_0xf29e('0x7a')]=_0x34a566['body']['from'];_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]=_0x34a566['body'][_0xf29e('0x25')];_0x37593d['body']['messageId']=_0x34a566[_0xf29e('0x58')][_0xf29e('0x8b')];break;}}if(_0x37593d[_0xf29e('0x58')]['id']){delete _0x37593d['body']['id'];}if(_[_0xf29e('0x8c')](_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')])){throw new db[(_0xf29e('0x8d'))][(_0xf29e('0x8e'))](_0xf29e('0x8f'));}if(_[_0xf29e('0x8c')](_0x37593d['body']['body'])||_0x37593d[_0xf29e('0x58')][_0xf29e('0x58')]===''){throw new db[(_0xf29e('0x8d'))][(_0xf29e('0x8e'))](_0xf29e('0x90'));}if(_['isNil'](_0x37593d['body'][_0xf29e('0x91')])){throw new db[(_0xf29e('0x8d'))][(_0xf29e('0x8e'))](_0xf29e('0x92')+_0x50ca9c);}if(!_['includes'](_0x50ca9c,_0x37593d[_0xf29e('0x58')][_0xf29e('0x91')])){throw new db[(_0xf29e('0x8d'))][(_0xf29e('0x8e'))](_0xf29e('0x93')+_0x50ca9c);}_0x392eb7[_0x37593d[_0xf29e('0x58')][_0xf29e('0x91')]]=_0x37593d[_0xf29e('0x58')]['from'];return db[_0xf29e('0x94')][_0xf29e('0x5c')]({'where':{'id':_0x37593d[_0xf29e('0x6f')][_0xf29e('0x78')]},'include':[{'model':db[_0xf29e('0x73')],'as':_0xf29e('0x95'),'where':_0x392eb7,'limit':0x1,'order':[[_0xf29e('0x76'),_0xf29e('0x96')]]}]});})['then'](handleEntityNotFound(_0x3acbf6,null))[_0xf29e('0x31')](function(_0x45ef0c){if(_0x45ef0c){_0x37593d[_0xf29e('0x97')]=_[_0xf29e('0x98')](_0x45ef0c,['Contacts']);if(_0x45ef0c[_0xf29e('0x95')][_0xf29e('0x40')]){return _0x45ef0c[_0xf29e('0x95')][0x0];}var _0x5ddd47=_[_0xf29e('0x17')](_0x37593d['body'],{'firstName':_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')],'ListId':_0x45ef0c['id']});_0x5ddd47[_0x37593d[_0xf29e('0x58')]['mapKey']]=_0x37593d['body'][_0xf29e('0x7a')];return db['CmContact']['create'](_0x5ddd47,{'fields':_0x2905bf,'raw':!![]});}})[_0xf29e('0x31')](handleEntityNotFound(_0x3acbf6,null))[_0xf29e('0x31')](function(_0x154800){if(_0x154800){_0x37593d[_0xf29e('0x99')]=_0x154800;var _0x247e2a={'ContactId':_0x154800['id'],'phone':_0x37593d['body'][_0xf29e('0x7a')],'SmsAccountId':_0x34a566['params']['id']};var _0x5325db={'ContactId':_0x154800['id'],'SmsAccountId':_0x34a566[_0xf29e('0x52')]['id'],'closed':![]};return db['SmsInteraction'][_0xf29e('0x5c')]({'where':_0x5325db})[_0xf29e('0x31')](function(_0x5b0982){if(_0x5b0982){return[_0x5b0982,![]];}return db[_0xf29e('0x9a')]['create'](_0x247e2a)[_0xf29e('0x31')](function(_0x45cf8f){return[_0x45cf8f,!![]];});});}})[_0xf29e('0x9b')](function(_0x37d383,_0x4c5fbe){_0x37593d[_0xf29e('0x9c')]=_0x37d383[_0xf29e('0x32')]({'plain':!![]});_0x37593d[_0xf29e('0x9c')][_0xf29e('0x9d')]=![];if(_0x4c5fbe){if(_0x37593d[_0xf29e('0x6f')]['autoclose']){_0x37593d[_0xf29e('0x9e')][_0xf29e('0x9f')]({'id':0x0,'priority':_0x37593d['applications'][_0xf29e('0x40')]+0x1,'app':_0xf29e('0xa0'),'appdata':_0xf29e('0xa1'),'interval':_0xf29e('0xa2')});}_0x37593d[_0xf29e('0x9c')]['created']=!![];}return db[_0xf29e('0xa3')][_0xf29e('0x57')]({'phone':_0x37593d[_0xf29e('0x58')][_0xf29e('0x7a')],'messageId':_0x37593d[_0xf29e('0x58')][_0xf29e('0x7d')],'body':_0x37593d[_0xf29e('0x58')]['body'],'SmsAccountId':_0x34a566['params']['id'],'SmsInteractionId':_0x37d383['id'],'direction':'in','ContactId':_0x37d383[_0xf29e('0xa4')],'AttachmentId':_0x37593d[_0xf29e('0x58')]['AttachmentId']});})[_0xf29e('0x31')](function(_0x55e7f4){_0x37593d[_0xf29e('0x25')]=_0x55e7f4;if(_0x37593d[_0xf29e('0x9c')][_0xf29e('0xa5')]){return db['User']['find']({'attributes':['id',_0xf29e('0x37')],'where':{'id':_0x37593d[_0xf29e('0x9c')][_0xf29e('0xa5')]}})[_0xf29e('0x31')](function(_0x33bafe){if(_0x33bafe){_0x37593d['applications'][_0xf29e('0xa6')]({'id':0x0,'priority':0x0,'app':_0xf29e('0xa7'),'appdata':_0x33bafe[_0xf29e('0x37')]+','+(_0x37593d['account'][_0xf29e('0xa8')]||0xa),'interval':_0xf29e('0xa2')});}return respondWithRpcPromise(_0xf29e('0xa9'),_0xf29e('0xaa'),_0x37593d);});}return respondWithRpcPromise(_0xf29e('0xa9'),_0xf29e('0xaa'),_0x37593d);})[_0xf29e('0x31')](function(_0x193649){if(_0x193649){var _0x14448a=0xc8;var _0x57d312=_0xf29e('0xab');logger[_0xf29e('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x57d312,_0x14448a,_0xf29e('0xac'));logger[_0xf29e('0xad')](_0xf29e('0xae'),_0x57d312,_0x14448a,_0xf29e('0xac'),JSON[_0xf29e('0x22')](_0x193649));if(_0x37593d[_0xf29e('0x6f')][_0xf29e('0x4a')]==='twilio'){return _0x3acbf6[_0xf29e('0x28')](_0x14448a)[_0xf29e('0x2c')]('Content-Type',_0xf29e('0xaf'))[_0xf29e('0xb0')](_0xf29e('0xb1'));}else{return _0x3acbf6['status'](_0x14448a)[_0xf29e('0xb2')](_0x193649);}}})[_0xf29e('0x50')](handleError(_0x3acbf6,null));};exports['addApplications']=function(_0x2a4cdb,_0x3cfebf){var _0x55cdd9=_0x2a4cdb[_0xf29e('0x52')]['id'];var _0x565611=_0x2a4cdb[_0xf29e('0x58')];var _0x336cea=0xc8;var _0x5c69f1=null;return db[_0xf29e('0xb3')][_0xf29e('0xb4')]({'isolationLevel':db[_0xf29e('0xb3')][_0xf29e('0xb5')][_0xf29e('0xb6')][_0xf29e('0xb7')]},function(_0x52a7c7){return db['SmsAccount'][_0xf29e('0xb8')]({'where':{'id':_0x55cdd9},'transaction':_0x52a7c7})[_0xf29e('0x31')](function(_0x48f957){if(_0x48f957){return db[_0xf29e('0x6d')]['destroy']({'where':{'SmsAccountId':_0x55cdd9},'transaction':_0x52a7c7})['then'](function(){var _0x13776d=_[_0xf29e('0x38')](_0x565611,function(_0x87e85c){_0x87e85c[_0xf29e('0x64')]=_0x55cdd9;return _0x87e85c;});return db[_0xf29e('0x6d')]['bulkCreate'](_0x13776d,{'transaction':_0x52a7c7});});}else{_0x336cea=0x194;_0x5c69f1=[];}});})[_0xf29e('0x31')](function(){if(_0x336cea!==0x194){return db[_0xf29e('0x6d')][_0xf29e('0xb9')]({'where':{'SmsAccountId':_0x55cdd9},'order':_0xf29e('0x71')})[_0xf29e('0x31')](function(_0x2fe00d){_0x5c69f1=_0x2fe00d;});}})[_0xf29e('0x50')](function(_0x31130e){_0x336cea=0x1f4;logger[_0xf29e('0x23')](_0x31130e[_0xf29e('0x36')]);if(_0x31130e[_0xf29e('0x37')]){delete _0x31130e[_0xf29e('0x37')];}_0x5c69f1=_0x31130e;})[_0xf29e('0xba')](function(){if(_0x5c69f1===null){_0x3cfebf[_0xf29e('0x27')](_0x336cea);}else{if(_0x336cea===0x1f4){_0x3cfebf[_0xf29e('0x28')](_0x336cea)[_0xf29e('0xb0')](_0x5c69f1);}else{_0x3cfebf['status'](_0x336cea)[_0xf29e('0xb2')](_0x5c69f1);}}});};exports[_0xf29e('0xbb')]=function(_0x53a434,_0x2875ff,_0x2bbcea){var _0x5bb912={};var _0x281fb7={};var _0x5e1072;var _0x5cb6ff;return db[_0xf29e('0x39')][_0xf29e('0xb8')]({'where':{'id':_0x53a434['params']['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x2875ff,null))[_0xf29e('0x31')](function(_0x242b41){if(_0x242b41){_0x5e1072=_0x242b41;_0x281fb7[_0xf29e('0x3b')]=_[_0xf29e('0x3d')](db[_0xf29e('0x6d')][_0xf29e('0x55')]);_0x281fb7['query']=_[_0xf29e('0x3d')](_0x53a434[_0xf29e('0x3c')]);_0x281fb7[_0xf29e('0x45')]=_['intersection'](_0x281fb7[_0xf29e('0x3b')],_0x281fb7[_0xf29e('0x3c')]);_0x5bb912[_0xf29e('0x3f')]=_['intersection'](_0x281fb7['model'],qs['fields'](_0x53a434[_0xf29e('0x3c')][_0xf29e('0x56')]));_0x5bb912[_0xf29e('0x3f')]=_0x5bb912[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x5bb912[_0xf29e('0x3f')]:_0x281fb7[_0xf29e('0x3b')];_0x5bb912[_0xf29e('0x43')]=qs[_0xf29e('0x44')](_0x53a434[_0xf29e('0x3c')][_0xf29e('0x44')]);_0x5bb912[_0xf29e('0x49')]=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x53a434[_0xf29e('0x3c')],_0x281fb7[_0xf29e('0x45')]));if(_0x53a434[_0xf29e('0x3c')][_0xf29e('0x47')]){_0x5bb912[_0xf29e('0x49')]=_[_0xf29e('0x48')](_0x5bb912[_0xf29e('0x49')],{'$or':_[_0xf29e('0x38')](_0x5bb912[_0xf29e('0x3f')],function(_0x294131){var _0x1b6cfa={};_0x1b6cfa[_0x294131]={'$like':'%'+_0x53a434['query'][_0xf29e('0x47')]+'%'};return _0x1b6cfa;})});}_0x5bb912=_['merge']({},_0x5bb912,_0x53a434['options']);return _0x5e1072[_0xf29e('0xbb')](_0x5bb912);}})[_0xf29e('0x31')](function(_0x9193ae){if(_0x9193ae){_0x5cb6ff=_0x9193ae[_0xf29e('0x40')];if(!_0x53a434[_0xf29e('0x3c')][_0xf29e('0x41')](_0xf29e('0x42'))){_0x5bb912[_0xf29e('0x2a')]=qs['limit'](_0x53a434[_0xf29e('0x3c')][_0xf29e('0x2a')]);_0x5bb912['offset']=qs[_0xf29e('0x29')](_0x53a434[_0xf29e('0x3c')]['offset']);}return _0x5e1072[_0xf29e('0xbb')](_0x5bb912);}})[_0xf29e('0x31')](function(_0x5a84ef){if(_0x5a84ef){return _0x5a84ef?{'count':_0x5cb6ff,'rows':_0x5a84ef}:null;}})[_0xf29e('0x31')](respondWithResult(_0x2875ff,null))[_0xf29e('0x50')](handleError(_0x2875ff,null));};exports[_0xf29e('0xbc')]=function(_0x3ceba2,_0x2be314,_0x4a9fa6){var _0x41a118={'raw':![],'where':{}};var _0x569e6d={};var _0xa5939b={'count':0x0,'rows':[]};return db[_0xf29e('0x39')]['findOne']({'where':{'id':_0x3ceba2[_0xf29e('0x52')]['id']}})['then'](handleEntityNotFound(_0x2be314,null))['then'](function(_0x4ad644){if(_0x4ad644){_0x569e6d[_0xf29e('0x3b')]=_[_0xf29e('0x3d')](db['SmsInteraction'][_0xf29e('0x55')]);_0x569e6d[_0xf29e('0x3c')]=_[_0xf29e('0x3d')](_0x3ceba2[_0xf29e('0x3c')]);_0x569e6d['filters']=_[_0xf29e('0x3e')](_0x569e6d['model'],_0x569e6d['query']);_0x41a118[_0xf29e('0x3f')]=_['intersection'](_0x569e6d['model'],qs[_0xf29e('0x56')](_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0x56')]));_0x41a118[_0xf29e('0x3f')]=_0x41a118[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x41a118[_0xf29e('0x3f')]:_0x569e6d[_0xf29e('0x3b')];if(!_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0x41')](_0xf29e('0x42'))){_0x41a118[_0xf29e('0x2a')]=qs[_0xf29e('0x2a')](_0x3ceba2[_0xf29e('0x3c')]['limit']);_0x41a118[_0xf29e('0x29')]=qs[_0xf29e('0x29')](_0x3ceba2['query']['offset']);}_0x41a118[_0xf29e('0x43')]=qs['sort'](_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0x44')]);_0x41a118['where']=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x3ceba2[_0xf29e('0x3c')],_0x569e6d[_0xf29e('0x45')]));_0x41a118[_0xf29e('0x49')][_0xf29e('0x64')]=_0x4ad644['id'];if(_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0x47')]){_0x41a118[_0xf29e('0x49')]=_['merge'](_0x41a118[_0xf29e('0x49')],{'$or':_[_0xf29e('0x38')](_0x41a118[_0xf29e('0x3f')],function(_0x4b6bbb){var _0x20c57b={};_0x20c57b[_0x4b6bbb]={'$like':'%'+_0x3ceba2['query']['filter']+'%'};return _0x20c57b;})});}_0x41a118=_[_0xf29e('0x48')]({},_0x41a118,_0x3ceba2['options']);return db[_0xf29e('0x9a')][_0xf29e('0x4c')]({'where':_0x41a118['where']})[_0xf29e('0x31')](function(_0x4a25d7){_0xa5939b[_0xf29e('0x4c')]=_0x4a25d7;if(_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0x4d')]){_0x41a118[_0xf29e('0x4e')]=[{'model':db[_0xf29e('0x73')],'as':_0xf29e('0xbd'),'required':![]},{'model':db[_0xf29e('0xbe')],'as':_0xf29e('0xbf'),'attributes':[_0xf29e('0x37'),'fullname',_0xf29e('0xc0')],'required':![]},{'model':db[_0xf29e('0xc1')],'as':_0xf29e('0xc2'),'attributes':['id','name',_0xf29e('0xc3')],'where':_0x3ceba2[_0xf29e('0x3c')][_0xf29e('0xc4')]?{'id':_0x3ceba2[_0xf29e('0x3c')]['tag']}:undefined,'required':_0x3ceba2[_0xf29e('0x3c')]['tag']?!![]:![]}];}return db[_0xf29e('0x9a')]['findAll'](_0x41a118);})['then'](function(_0x4ce6ae){_0xa5939b[_0xf29e('0x65')]=_0x4ce6ae;return _0xa5939b;});}})[_0xf29e('0x31')](respondWithFilteredResult(_0x2be314,_0x41a118))['catch'](handleError(_0x2be314,null));};exports[_0xf29e('0xb0')]=function(_0x408f19,_0x236f1f,_0x5deeab){var _0xc3ebb6,_0x45cf62,_0x620da8;if(_[_0xf29e('0x8c')](_0x408f19[_0xf29e('0x58')][_0xf29e('0x58')])||_0x408f19[_0xf29e('0x58')][_0xf29e('0x58')]===''){throw new db[(_0xf29e('0x8d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf29e('0x8c')](_0x408f19[_0xf29e('0x58')]['to'])){throw new db[(_0xf29e('0x8d'))][(_0xf29e('0x8e'))](_0xf29e('0xc5'));}_0xc3ebb6=_0x408f19[_0xf29e('0x58')]['to'];return db['SmsAccount'][_0xf29e('0x5c')]({'where':{'id':_0x408f19[_0xf29e('0x52')]['id']},'include':[{'model':db[_0xf29e('0x94')],'as':'List','include':[{'model':db[_0xf29e('0x73')],'as':_0xf29e('0x95'),'where':{'mobile':_0xc3ebb6},'limit':0x1,'order':[[_0xf29e('0x76'),'DESC']]}]}]})[_0xf29e('0x31')](handleEntityNotFound(_0x236f1f,null))[_0xf29e('0x31')](function(_0x4f7e60){if(_0x4f7e60&&_0x4f7e60[_0xf29e('0xc6')]){_0x45cf62=_0x4f7e60[_0xf29e('0x32')]({'plain':!![]});if(_0x45cf62[_0xf29e('0xc6')]&&_0x45cf62[_0xf29e('0xc6')]['Contacts'][_0xf29e('0x40')]){return _0x45cf62[_0xf29e('0xc6')][_0xf29e('0x95')][0x0];}return db[_0xf29e('0x73')][_0xf29e('0x57')](_[_0xf29e('0x17')](_0x408f19[_0xf29e('0x58')],{'firstName':_0xc3ebb6,'mobile':_0xc3ebb6,'phone':_0xc3ebb6,'ListId':_0x45cf62[_0xf29e('0x78')]}));}})[_0xf29e('0x31')](handleEntityNotFound(_0x236f1f,null))[_0xf29e('0x31')](function(_0x5b0290){if(_0x5b0290){_0x620da8=_0x5b0290;return db['SmsInteraction']['find']({'where':{'ContactId':_0x620da8['id'],'closed':![],'SmsAccountId':_0x45cf62['id']}})[_0xf29e('0x31')](function(_0x2f7513){if(_0x2f7513){return[_0x2f7513,![]];}return db[_0xf29e('0x9a')][_0xf29e('0x57')]({'UserId':_0x408f19[_0xf29e('0x59')]['id'],'ContactId':_0x620da8['id'],'SmsAccountId':_0x45cf62['id'],'phone':_0xc3ebb6,'firstMsgDirection':_0xf29e('0xc7'),'Messages':[_[_0xf29e('0x48')](_0x408f19[_0xf29e('0x58')],{'read':![],'body':_0x408f19[_0xf29e('0x58')][_0xf29e('0x58')],'phone':_0xc3ebb6,'SmsAccountId':_0x45cf62['id'],'UserId':_0x408f19[_0xf29e('0x59')]['id'],'ContactId':_0x620da8['id']})]},{'include':[{'model':db[_0xf29e('0xa3')],'as':_0xf29e('0xc8')}]})['then'](function(_0x471209){return[_0x471209,!![]];});});}})[_0xf29e('0x9b')](function(_0x2f7d43,_0x5d572f){if(_0x5d572f){return _0x2f7d43;}return db[_0xf29e('0xa3')][_0xf29e('0x57')](_[_0xf29e('0x48')](_0x408f19[_0xf29e('0x58')],{'read':![],'body':_0x408f19['body']['body'],'phone':_0xc3ebb6,'SmsAccountId':_0x45cf62['id'],'SmsInteractionId':_0x2f7d43['id'],'UserId':_0x408f19[_0xf29e('0x59')]['id'],'ContactId':_0x620da8['id']}))[_0xf29e('0x31')](function(_0x18edcf){_0x2f7d43[_0xf29e('0xc9')]['Messages']=[];_0x2f7d43[_0xf29e('0xc9')][_0xf29e('0xc8')][_0xf29e('0x9f')](_0x18edcf[_0xf29e('0xc9')]);return _0x2f7d43;});})[_0xf29e('0x31')](respondWithResult(_0x236f1f,null))[_0xf29e('0x50')](handleError(_0x236f1f,null));};exports[_0xf29e('0x28')]=function(_0x40610,_0x4ca206,_0x98b73c){if(_0x40610[_0xf29e('0x58')]['id']){delete _0x40610[_0xf29e('0x58')]['id'];}var _0x41ee72,_0x4b274b,_0x434b14;return db[_0xf29e('0x39')]['find']({'where':{'id':_0x40610[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x4ca206,null))[_0xf29e('0x31')](function(_0x19a4e6){if(_0x19a4e6){_0x434b14=_0x19a4e6;logger[_0xf29e('0xad')](_0xf29e('0x21'),_0xf29e('0x28'),'received\x20delivery\x20report\x20from',_0x19a4e6[_0xf29e('0x4a')],util[_0xf29e('0xca')](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));switch(_0x19a4e6[_0xf29e('0x4a')]){case _0xf29e('0x7f'):if(_0x40610[_0xf29e('0x58')][_0xf29e('0xcb')]&&_0x40610[_0xf29e('0x58')][_0xf29e('0x28')]){_0x4b274b=_0x40610[_0xf29e('0x58')]['status'];return db[_0xf29e('0xa3')][_0xf29e('0x5c')]({'where':{'messageId':_0x40610[_0xf29e('0x58')][_0xf29e('0xcb')]}});}break;case'connectel':if(_0x40610['body'][_0xf29e('0xcc')]&&_0x40610[_0xf29e('0x58')]['statusInt']){_0x4b274b=_0x40610['body']['statusInt'];return db[_0xf29e('0xa3')][_0xf29e('0x5c')]({'where':{'messageId':_0x40610[_0xf29e('0x58')][_0xf29e('0xcc')]}});}break;case _0xf29e('0x82'):if(_0x40610[_0xf29e('0x58')]['message_id']&&_0x40610['body']['status_code']){_0x4b274b=_0x40610['body']['status_code'];return db['SmsMessage'][_0xf29e('0x5c')]({'where':{'messageId':_0x40610[_0xf29e('0x58')][_0xf29e('0xcd')]}});}break;case'infobip':var _0x2fc971=_0x40610['body'][_0xf29e('0x85')][0x0];if(_0x2fc971['messageId']&&_0x2fc971['status']['groupName']==='DELIVERED'){_0x4b274b=_0x2fc971[_0xf29e('0x28')][_0xf29e('0xce')];return db[_0xf29e('0xa3')]['find']({'where':{'messageId':_0x2fc971[_0xf29e('0x7d')]}});}break;case _0xf29e('0x87'):if(_0x40610['body'][_0xf29e('0x7d')]&&_0x40610[_0xf29e('0x58')][_0xf29e('0x28')]){_0x4b274b=_0x40610[_0xf29e('0x58')][_0xf29e('0x28')];return db[_0xf29e('0xa3')]['find']({'where':{'messageId':_0x40610['body'][_0xf29e('0x7d')]}});}break;case _0xf29e('0x89'):if(_0x40610[_0xf29e('0x58')][0x0][_0xf29e('0x25')]['id']){_0x4b274b=_0x40610[_0xf29e('0x58')][0x0][_0xf29e('0x4a')];return db[_0xf29e('0xa3')][_0xf29e('0x5c')]({'where':{'messageId':_0x40610['body'][0x0]['message']['id']}});}break;case _0xf29e('0x8a'):if(_0x40610[_0xf29e('0x58')][_0xf29e('0xcf')]&&_0x40610[_0xf29e('0x58')]['status']){_0x4b274b=_0x40610['body'][_0xf29e('0x28')];return db[_0xf29e('0xa3')]['find']({'where':{'messageId':_0x40610[_0xf29e('0x58')][_0xf29e('0xcf')]}});}break;}}})[_0xf29e('0x31')](handleEntityNotFound(_0x4ca206,null))[_0xf29e('0x31')](function(_0x7b8bf3){if(_0x7b8bf3){_0x41ee72=_0x7b8bf3;switch(_0x434b14[_0xf29e('0x4a')]){case _0xf29e('0x7f'):if(_0x4b274b===_0xf29e('0xd0')){return _0x41ee72[_0xf29e('0x30')]({'read':!![]});}else{logger['error'](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0x7f'),util[_0xf29e('0xca')](_0x40610['body'],{'showHidden':![],'depth':null}));}break;case _0xf29e('0x81'):if(_0x4b274b==='1'){return _0x41ee72[_0xf29e('0x30')]({'read':!![]});}else{logger[_0xf29e('0x23')](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0x7f'),util[_0xf29e('0xca')](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf29e('0x82'):if(!_0x40610[_0xf29e('0x58')][_0xf29e('0xd1')]&&_0x4b274b>=0xc8&&_0x4b274b<=0xce){return _0x41ee72[_0xf29e('0x30')]({'read':!![]});}else{logger[_0xf29e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf29e('0x28'),'clicksend',util[_0xf29e('0xca')](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf29e('0x84'):var _0x3d441e=_0x40610['body'][_0xf29e('0x85')][0x0];if(_0x3d441e[_0xf29e('0x28')][_0xf29e('0xce')]===_0xf29e('0xd0')){return _0x41ee72['update']({'read':!![]});}else{logger[_0xf29e('0x23')](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0x84'),util[_0xf29e('0xca')](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf29e('0x87'):if(_0x4b274b==_0xf29e('0xd2')||_0x4b274b==_0xf29e('0xd3')){return _0x41ee72[_0xf29e('0x30')]({'read':!![]});}else{logger[_0xf29e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf29e('0x28'),'clickatell',util[_0xf29e('0xca')](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf29e('0x89'):if(_0x4b274b==_0xf29e('0xd4')){return _0x41ee72[_0xf29e('0x30')]({'read':!![]});}else{logger[_0xf29e('0x23')](_0xf29e('0x21'),'status',_0xf29e('0x89'),util['inspect'](_0x40610[_0xf29e('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4b274b===_0xf29e('0xd5')||_0x4b274b==='ACCEPTD'){return _0x41ee72['update']({'read':!![]});}else{logger[_0xf29e('0x23')](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0x8a'),util[_0xf29e('0xca')](_0x40610['body'],{'showHidden':![],'depth':null}));}break;}return _0x41ee72;}})[_0xf29e('0x31')](respondWithResult(_0x4ca206,null))[_0xf29e('0x50')](handleError(_0x4ca206,null));};exports['statusGet']=function(_0x17e82d,_0x1c83bf,_0x3e4a70){var _0x133448,_0x41f843,_0x5878d2;return db[_0xf29e('0x39')]['find']({'where':{'id':_0x17e82d['params']['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x1c83bf,null))[_0xf29e('0x31')](function(_0x33d81a){if(_0x33d81a){_0x5878d2=_0x33d81a;logger['debug'](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0xd6'),_0x33d81a[_0xf29e('0x4a')],util['inspect'](_0x17e82d[_0xf29e('0x3c')],{'showHidden':![],'depth':null}));switch(_0x33d81a[_0xf29e('0x4a')]){case _0xf29e('0x86'):if(_0x17e82d[_0xf29e('0x3c')][_0xf29e('0xd7')]&&_0x17e82d['query'][_0xf29e('0xd8')]){_0x41f843=_0x17e82d[_0xf29e('0x3c')][_0xf29e('0xd8')];return db['SmsMessage']['find']({'where':{'messageId':_0x17e82d[_0xf29e('0x3c')][_0xf29e('0xd7')]}});}break;}}})[_0xf29e('0x31')](handleEntityNotFound(_0x1c83bf,null))[_0xf29e('0x31')](function(_0x5e3ae7){if(_0x5e3ae7){_0x133448=_0x5e3ae7;switch(_0x5878d2[_0xf29e('0x4a')]){case'csc':if(_0x41f843==='2'||_0x41f843==='6'){return _0x133448[_0xf29e('0x30')]({'read':!![]});}else{logger[_0xf29e('0x23')](_0xf29e('0x21'),_0xf29e('0x28'),_0xf29e('0x86'),util[_0xf29e('0xca')](_0x17e82d['query'],{'showHidden':![],'depth':null}));};break;}return _0x133448;}})['then'](respondWithResult(_0x1c83bf,null))[_0xf29e('0x50')](handleError(_0x1c83bf,null));};exports[_0xf29e('0xd9')]=function(_0x4afa69,_0x25e475,_0x21f805){return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0x4afa69[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x25e475,null))[_0xf29e('0x31')](function(_0x4e06d1){if(_0x4e06d1){return _0x4e06d1[_0xf29e('0xd9')](_0x4afa69[_0xf29e('0x58')][_0xf29e('0x6b')],_[_0xf29e('0x98')](_0x4afa69[_0xf29e('0x58')],[_0xf29e('0x6b'),'id'])||{})[_0xf29e('0x9b')](function(_0x59db6f){for(var _0x248f6=0x0;_0x248f6<_0x4afa69[_0xf29e('0x58')]['ids'][_0xf29e('0x40')];_0x248f6+=0x1){socket[_0xf29e('0xda')](_0xf29e('0xdb'),{'UserId':Number(_0x4afa69['body'][_0xf29e('0x6b')][_0x248f6]),'SmsAccountId':Number(_0x4afa69[_0xf29e('0x52')]['id'])});}return _0x59db6f;});}})[_0xf29e('0x31')](respondWithResult(_0x25e475,null))[_0xf29e('0x50')](handleError(_0x25e475,null));};exports[_0xf29e('0xdc')]=function(_0x11e8b4,_0x5f2ba0,_0x3e7db4){return db[_0xf29e('0x39')][_0xf29e('0x5c')]({'where':{'id':_0x11e8b4['params']['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x5f2ba0,null))[_0xf29e('0x31')](function(_0x17a1c8){if(_0x17a1c8){return _0x17a1c8[_0xf29e('0xdc')](_0x11e8b4[_0xf29e('0x3c')][_0xf29e('0x6b')])[_0xf29e('0x31')](function(){if(_[_0xf29e('0xdd')](_0x11e8b4['query']['ids'])){for(var _0x26ce9f=0x0;_0x26ce9f<_0x11e8b4[_0xf29e('0x3c')][_0xf29e('0x6b')]['length'];_0x26ce9f+=0x1){socket[_0xf29e('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x11e8b4[_0xf29e('0x3c')]['ids'][_0x26ce9f]),'SmsAccountId':Number(_0x11e8b4[_0xf29e('0x52')]['id'])});}}else{socket[_0xf29e('0xda')](_0xf29e('0xde'),{'UserId':Number(_0x11e8b4[_0xf29e('0x3c')][_0xf29e('0x6b')]),'SmsAccountId':Number(_0x11e8b4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5f2ba0,null))[_0xf29e('0x50')](handleError(_0x5f2ba0,null));};exports[_0xf29e('0xdf')]=function(_0x36e135,_0x38f248,_0x5dc4b4){var _0x2ab68a={};var _0x16767c={};var _0x4c0aa2;var _0x138a44;return db[_0xf29e('0x39')][_0xf29e('0xb8')]({'where':{'id':_0x36e135[_0xf29e('0x52')]['id']}})[_0xf29e('0x31')](handleEntityNotFound(_0x38f248,null))[_0xf29e('0x31')](function(_0x584e6f){if(_0x584e6f){_0x4c0aa2=_0x584e6f;_0x16767c['model']=_[_0xf29e('0x3d')](db[_0xf29e('0xbe')]['rawAttributes']);_0x16767c['query']=_[_0xf29e('0x3d')](_0x36e135[_0xf29e('0x3c')]);_0x16767c['filters']=_[_0xf29e('0x3e')](_0x16767c[_0xf29e('0x3b')],_0x16767c[_0xf29e('0x3c')]);_0x2ab68a[_0xf29e('0x3f')]=_[_0xf29e('0x3e')](_0x16767c[_0xf29e('0x3b')],qs['fields'](_0x36e135[_0xf29e('0x3c')][_0xf29e('0x56')]));_0x2ab68a[_0xf29e('0x3f')]=_0x2ab68a[_0xf29e('0x3f')][_0xf29e('0x40')]?_0x2ab68a[_0xf29e('0x3f')]:_0x16767c[_0xf29e('0x3b')];_0x2ab68a['order']=qs['sort'](_0x36e135[_0xf29e('0x3c')][_0xf29e('0x44')]);_0x2ab68a[_0xf29e('0x49')]=qs[_0xf29e('0x45')](_[_0xf29e('0x46')](_0x36e135[_0xf29e('0x3c')],_0x16767c[_0xf29e('0x45')]));if(_0x36e135['query'][_0xf29e('0x47')]){_0x2ab68a[_0xf29e('0x49')]=_[_0xf29e('0x48')](_0x2ab68a[_0xf29e('0x49')],{'$or':_[_0xf29e('0x38')](_0x2ab68a['attributes'],function(_0x400a54){var _0x22893c={};_0x22893c[_0x400a54]={'$like':'%'+_0x36e135[_0xf29e('0x3c')][_0xf29e('0x47')]+'%'};return _0x22893c;})});}_0x2ab68a=_[_0xf29e('0x48')]({},_0x2ab68a,_0x36e135[_0xf29e('0x4b')]);return _0x4c0aa2['getAgents'](_0x2ab68a);}})[_0xf29e('0x31')](function(_0x36f9da){if(_0x36f9da){_0x138a44=_0x36f9da[_0xf29e('0x40')];if(!_0x36e135[_0xf29e('0x3c')]['hasOwnProperty'](_0xf29e('0x42'))){_0x2ab68a[_0xf29e('0x2a')]=qs[_0xf29e('0x2a')](_0x36e135['query']['limit']);_0x2ab68a['offset']=qs['offset'](_0x36e135[_0xf29e('0x3c')][_0xf29e('0x29')]);}return _0x4c0aa2[_0xf29e('0xdf')](_0x2ab68a);}})[_0xf29e('0x31')](function(_0x3aa440){if(_0x3aa440){return _0x3aa440?{'count':_0x138a44,'rows':_0x3aa440}:null;}})[_0xf29e('0x31')](respondWithResult(_0x38f248,null))[_0xf29e('0x50')](handleError(_0x38f248,null));}; \ No newline at end of file +var _0x18a9=['inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','infobip','DELIVERED_TO_GATEWAY','update','message-delivered','DELIVRD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','stack','name','send','index','Pause','SmsAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','mandatoryDispositionPause','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','skebby','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','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','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','User','unshift','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','fullname','internal','color','tag','List','SmsMessage','Messages','dataValues','push'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0x18a9,0x1df));var _0x918a=function(_0x1a691a,_0x349066){_0x1a691a=_0x1a691a-0x0;var _0x539f77=_0x18a9[_0x1a691a];return _0x539f77;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require(_0x918a('0x1'));var zipdir=require(_0x918a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x918a('0x3'));var moment=require(_0x918a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x918a('0x5'));var util=require(_0x918a('0x6'));var path=require(_0x918a('0x7'));var sox=require(_0x918a('0x8'));var csv=require(_0x918a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x918a('0xa'));var crypto=require(_0x918a('0xb'));var jsforce=require(_0x918a('0xc'));var deskjs=require(_0x918a('0xd'));var toCsv=require(_0x918a('0x9'));var querystring=require(_0x918a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x918a('0xf'));var qs=require(_0x918a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x918a('0x11'))('api');var utils=require(_0x918a('0x12'));var config=require(_0x918a('0x13'));var licenseUtil=require(_0x918a('0x14'));var db=require(_0x918a('0x15'))['db'];config[_0x918a('0x16')]=_[_0x918a('0x17')](config[_0x918a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x918a('0x18'))(new Redis(config['redis']));require(_0x918a('0x19'))[_0x918a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x918a('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x57e715,_0x743767,_0x15b470,_0x46a687){return new BPromise(function(_0x4823d7,_0xa1d555){var _0x130ed3=_0x46a687||client;return _0x130ed3[_0x918a('0x1c')](_0x57e715,_0x15b470)[_0x918a('0x1d')](function(_0x160c06){logger[_0x918a('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x743767,'request\x20sent');logger[_0x918a('0x1f')](_0x918a('0x20'),_0x743767,_0x918a('0x21'),JSON[_0x918a('0x22')](_0x160c06));if(_0x160c06[_0x918a('0x23')]){if(_0x160c06[_0x918a('0x23')][_0x918a('0x24')]===0x1f4){logger[_0x918a('0x23')](_0x918a('0x25'),_0x743767,_0x160c06[_0x918a('0x23')][_0x918a('0x26')]);return _0xa1d555(_0x160c06[_0x918a('0x23')][_0x918a('0x26')]);}logger[_0x918a('0x23')](_0x918a('0x25'),_0x743767,_0x160c06[_0x918a('0x23')][_0x918a('0x26')]);return _0x4823d7(_0x160c06['error']['message']);}else{logger['info'](_0x918a('0x25'),_0x743767,'request\x20sent');_0x4823d7(_0x160c06[_0x918a('0x27')][_0x918a('0x26')]);}})[_0x918a('0x28')](function(_0x3a51de){logger['error'](_0x918a('0x25'),_0x743767,_0x3a51de);_0xa1d555(_0x3a51de);});});}function respondWithStatusCode(_0x32c704,_0x4a4274){_0x4a4274=_0x4a4274||0xcc;return function(_0x48cbda){if(_0x48cbda){return _0x32c704[_0x918a('0x29')](_0x4a4274);}return _0x32c704[_0x918a('0x2a')](_0x4a4274)[_0x918a('0x2b')]();};}function respondWithResult(_0x4a082f,_0x2034a4){_0x2034a4=_0x2034a4||0xc8;return function(_0x57b83a){if(_0x57b83a){return _0x4a082f[_0x918a('0x2a')](_0x2034a4)[_0x918a('0x2c')](_0x57b83a);}};}function respondWithFilteredResult(_0xe79af2,_0x56a497){return function(_0x34f19a){if(_0x34f19a){var _0x1f4593=typeof _0x56a497[_0x918a('0x2d')]===_0x918a('0x2e')&&typeof _0x56a497[_0x918a('0x2f')]===_0x918a('0x2e');var _0x3ee5d5=_0x34f19a[_0x918a('0x30')];var _0x3db109=_0x1f4593?0x0:_0x56a497['offset'];var _0x4367f1=_0x1f4593?_0x34f19a['count']:_0x56a497['offset']+_0x56a497[_0x918a('0x2f')];var _0x41bb6a;if(_0x4367f1>=_0x3ee5d5){_0x4367f1=_0x3ee5d5;_0x41bb6a=0xc8;}else{_0x41bb6a=0xce;}_0xe79af2[_0x918a('0x2a')](_0x41bb6a);return _0xe79af2[_0x918a('0x31')](_0x918a('0x32'),_0x3db109+'-'+_0x4367f1+'/'+_0x3ee5d5)[_0x918a('0x2c')](_0x34f19a);}return null;};}function patchUpdates(_0x4835ee){return function(_0x28ffb0){try{jsonpatch[_0x918a('0x33')](_0x28ffb0,_0x4835ee,!![]);}catch(_0x43c62b){return BPromise[_0x918a('0x34')](_0x43c62b);}return _0x28ffb0[_0x918a('0x35')]();};}function saveUpdates(_0x3f2a7f,_0x5579ff){return function(_0x7a075){if(_0x7a075){return _0x7a075['update'](_0x3f2a7f)[_0x918a('0x1d')](function(_0x1da315){return _0x1da315;});}return null;};}function removeEntity(_0x33d2ef,_0x2e930a){return function(_0x28e494){if(_0x28e494){return _0x28e494[_0x918a('0x36')]()[_0x918a('0x1d')](function(){var _0x538f6b=_0x28e494[_0x918a('0x37')]({'plain':!![]});var _0x517476=_0x918a('0x38');return db['UserProfileResource'][_0x918a('0x36')]({'where':{'type':_0x517476,'resourceId':_0x538f6b['id']}})['then'](function(){return _0x28e494;});})[_0x918a('0x1d')](function(){_0x33d2ef[_0x918a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f0e1,_0x164d14){return function(_0x34b571){if(!_0x34b571){_0x11f0e1['sendStatus'](0x194);}return _0x34b571;};}function handleError(_0x288a0e,_0x2aaeea){_0x2aaeea=_0x2aaeea||0x1f4;return function(_0x579101){logger[_0x918a('0x23')](_0x579101[_0x918a('0x39')]);if(_0x579101[_0x918a('0x3a')]){delete _0x579101[_0x918a('0x3a')];}_0x288a0e['status'](_0x2aaeea)[_0x918a('0x3b')](_0x579101);};}exports[_0x918a('0x3c')]=function(_0x4656f8,_0x399037){var _0x3dd4e6={'include':[{'model':db[_0x918a('0x3d')],'as':'mandatoryDispositionPause'}]},_0xf6bec9={},_0x3282d9={'count':0x0,'rows':[]};var _0x105428=_['map'](db[_0x918a('0x3e')][_0x918a('0x3f')],function(_0x27f256){return{'name':_0x27f256[_0x918a('0x40')],'type':_0x27f256[_0x918a('0x41')]['key']};});_0xf6bec9[_0x918a('0x42')]=_[_0x918a('0x43')](_0x105428,_0x918a('0x3a'));_0xf6bec9[_0x918a('0x44')]=_[_0x918a('0x45')](_0x4656f8[_0x918a('0x44')]);_0xf6bec9[_0x918a('0x46')]=_['intersection'](_0xf6bec9[_0x918a('0x42')],_0xf6bec9[_0x918a('0x44')]);_0x3dd4e6[_0x918a('0x47')]=_['intersection'](_0xf6bec9['model'],qs[_0x918a('0x48')](_0x4656f8[_0x918a('0x44')][_0x918a('0x48')]));_0x3dd4e6['attributes']=_0x3dd4e6[_0x918a('0x47')][_0x918a('0x49')]?_0x3dd4e6[_0x918a('0x47')]:_0xf6bec9['model'];if(!_0x4656f8[_0x918a('0x44')][_0x918a('0x4a')](_0x918a('0x4b'))){_0x3dd4e6[_0x918a('0x2f')]=qs[_0x918a('0x2f')](_0x4656f8[_0x918a('0x44')][_0x918a('0x2f')]);_0x3dd4e6[_0x918a('0x2d')]=qs[_0x918a('0x2d')](_0x4656f8[_0x918a('0x44')][_0x918a('0x2d')]);}_0x3dd4e6[_0x918a('0x4c')]=qs['sort'](_0x4656f8[_0x918a('0x44')][_0x918a('0x4d')]);_0x3dd4e6[_0x918a('0x4e')]=qs[_0x918a('0x46')](_[_0x918a('0x4f')](_0x4656f8[_0x918a('0x44')],_0xf6bec9['filters']),_0x105428);if(_0x4656f8[_0x918a('0x44')]['filter']){_0x3dd4e6[_0x918a('0x4e')]=_[_0x918a('0x50')](_0x3dd4e6[_0x918a('0x4e')],{'$or':_[_0x918a('0x43')](_0x105428,function(_0x4307e8){if(_0x4307e8[_0x918a('0x41')]!=='VIRTUAL'){var _0x43da52={};_0x43da52[_0x4307e8[_0x918a('0x3a')]]={'$like':'%'+_0x4656f8['query'][_0x918a('0x51')]+'%'};return _0x43da52;}})});}_0x3dd4e6=_[_0x918a('0x50')]({},_0x3dd4e6,_0x4656f8[_0x918a('0x52')]);var _0x55b837={'where':_0x3dd4e6[_0x918a('0x4e')]};return db[_0x918a('0x3e')]['count'](_0x55b837)[_0x918a('0x1d')](function(_0xa23d7e){_0x3282d9[_0x918a('0x30')]=_0xa23d7e;if(_0x4656f8[_0x918a('0x44')]['includeAll']){_0x3dd4e6[_0x918a('0x53')]=[{'all':!![]}];}return db[_0x918a('0x3e')][_0x918a('0x54')](_0x3dd4e6);})[_0x918a('0x1d')](function(_0x5da06e){_0x3282d9[_0x918a('0x55')]=_0x5da06e;return _0x3282d9;})['then'](respondWithFilteredResult(_0x399037,_0x3dd4e6))['catch'](handleError(_0x399037,null));};exports[_0x918a('0x56')]=function(_0x42058a,_0x2a4745){var _0x332567={'raw':![],'where':{'id':_0x42058a[_0x918a('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x918a('0x58')}]},_0x14ba08={};_0x14ba08['model']=_[_0x918a('0x45')](db[_0x918a('0x3e')][_0x918a('0x3f')]);_0x14ba08['query']=_[_0x918a('0x45')](_0x42058a[_0x918a('0x44')]);_0x14ba08[_0x918a('0x46')]=_[_0x918a('0x59')](_0x14ba08[_0x918a('0x42')],_0x14ba08[_0x918a('0x44')]);_0x332567['attributes']=_[_0x918a('0x59')](_0x14ba08[_0x918a('0x42')],qs[_0x918a('0x48')](_0x42058a[_0x918a('0x44')]['fields']));_0x332567[_0x918a('0x47')]=_0x332567[_0x918a('0x47')]['length']?_0x332567['attributes']:_0x14ba08[_0x918a('0x42')];if(_0x42058a[_0x918a('0x44')]['includeAll']){_0x332567[_0x918a('0x53')]=[{'all':!![]}];}_0x332567=_[_0x918a('0x50')]({},_0x332567,_0x42058a[_0x918a('0x52')]);return db[_0x918a('0x3e')][_0x918a('0x5a')](_0x332567)[_0x918a('0x1d')](handleEntityNotFound(_0x2a4745,null))[_0x918a('0x1d')](respondWithResult(_0x2a4745,null))['catch'](handleError(_0x2a4745,null));};exports['create']=function(_0x48f2f2,_0x3a1077){return db[_0x918a('0x3e')][_0x918a('0x5b')](_0x48f2f2[_0x918a('0x5c')],{})['then'](function(_0x31aaaf){var _0x1b2a13=_0x48f2f2[_0x918a('0x5d')][_0x918a('0x37')]({'plain':!![]});if(!_0x1b2a13)throw new Error(_0x918a('0x5e'));if(_0x1b2a13[_0x918a('0x5f')]==='user'){var _0x54b718=_0x31aaaf[_0x918a('0x37')]({'plain':!![]});var _0x30741a=_0x918a('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x30741a,'userProfileId':_0x1b2a13[_0x918a('0x60')]},'raw':!![]})[_0x918a('0x1d')](function(_0x909a6d){if(_0x909a6d&&_0x909a6d['autoAssociation']===0x0){return db[_0x918a('0x61')][_0x918a('0x5b')]({'name':_0x54b718[_0x918a('0x3a')],'resourceId':_0x54b718['id'],'type':_0x909a6d[_0x918a('0x3a')],'sectionId':_0x909a6d['id']},{})[_0x918a('0x1d')](function(){return _0x31aaaf;});}else{return _0x31aaaf;}})[_0x918a('0x28')](function(_0x56cb93){logger[_0x918a('0x23')](_0x918a('0x62'),_0x56cb93);throw _0x56cb93;});}return _0x31aaaf;})[_0x918a('0x1d')](respondWithResult(_0x3a1077,0xc9))['catch'](handleError(_0x3a1077,null));};exports['update']=function(_0x39fedf,_0x1c361e){if(_0x39fedf[_0x918a('0x5c')]['id']){delete _0x39fedf[_0x918a('0x5c')]['id'];}return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x39fedf[_0x918a('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x918a('0x58')}]})[_0x918a('0x1d')](handleEntityNotFound(_0x1c361e,null))[_0x918a('0x1d')](saveUpdates(_0x39fedf[_0x918a('0x5c')],null))[_0x918a('0x1d')](respondWithResult(_0x1c361e,null))[_0x918a('0x28')](handleError(_0x1c361e,null));};exports[_0x918a('0x36')]=function(_0xf0b3af,_0x287021){return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0xf0b3af[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x287021,null))['then'](removeEntity(_0x287021,null))[_0x918a('0x28')](handleError(_0x287021,null));};exports['describe']=function(_0x3a6339,_0x53f7d1){return db[_0x918a('0x3e')][_0x918a('0x63')]()[_0x918a('0x1d')](respondWithResult(_0x53f7d1,null))['catch'](handleError(_0x53f7d1,null));};exports[_0x918a('0x64')]=function(_0x33a6ff,_0x172813,_0x482826){if(_0x33a6ff[_0x918a('0x5c')]['id']){delete _0x33a6ff[_0x918a('0x5c')]['id'];}return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x33a6ff[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x172813,null))[_0x918a('0x1d')](function(_0xdcce2d){if(_0xdcce2d){_0x33a6ff[_0x918a('0x5c')][_0x918a('0x65')]=_0xdcce2d['id'];return db[_0x918a('0x66')][_0x918a('0x5b')](_0x33a6ff[_0x918a('0x5c')]);}})[_0x918a('0x1d')](respondWithResult(_0x172813,null))[_0x918a('0x28')](handleError(_0x172813,null));};exports[_0x918a('0x67')]=function(_0xe4da02,_0x5dbd75,_0x462367){var _0x9c8422={'raw':![],'where':{}};var _0x2fb685={};var _0x78e41a={'count':0x0,'rows':[]};return db[_0x918a('0x3e')][_0x918a('0x68')]({'where':{'id':_0xe4da02['params']['id']}})['then'](handleEntityNotFound(_0x5dbd75,null))[_0x918a('0x1d')](function(_0x4fb496){if(_0x4fb496){_0x2fb685[_0x918a('0x42')]=_[_0x918a('0x45')](db[_0x918a('0x66')][_0x918a('0x3f')]);_0x2fb685[_0x918a('0x44')]=_[_0x918a('0x45')](_0xe4da02['query']);_0x2fb685['filters']=_[_0x918a('0x59')](_0x2fb685[_0x918a('0x42')],_0x2fb685['query']);_0x9c8422[_0x918a('0x47')]=_[_0x918a('0x59')](_0x2fb685['model'],qs[_0x918a('0x48')](_0xe4da02[_0x918a('0x44')]['fields']));_0x9c8422[_0x918a('0x47')]=_0x9c8422[_0x918a('0x47')][_0x918a('0x49')]?_0x9c8422[_0x918a('0x47')]:_0x2fb685[_0x918a('0x42')];if(!_0xe4da02[_0x918a('0x44')]['hasOwnProperty'](_0x918a('0x4b'))){_0x9c8422[_0x918a('0x2f')]=qs[_0x918a('0x2f')](_0xe4da02[_0x918a('0x44')]['limit']);_0x9c8422[_0x918a('0x2d')]=qs[_0x918a('0x2d')](_0xe4da02['query'][_0x918a('0x2d')]);}_0x9c8422[_0x918a('0x4c')]=qs[_0x918a('0x4d')](_0xe4da02[_0x918a('0x44')][_0x918a('0x4d')]);_0x9c8422[_0x918a('0x4e')]=qs['filters'](_[_0x918a('0x4f')](_0xe4da02['query'],_0x2fb685[_0x918a('0x46')]));_0x9c8422[_0x918a('0x4e')][_0x918a('0x65')]=_0x4fb496['id'];if(_0xe4da02[_0x918a('0x44')]['filter']){_0x9c8422['where']=_[_0x918a('0x50')](_0x9c8422['where'],{'$or':_[_0x918a('0x43')](_0x9c8422['attributes'],function(_0x5ddfbd){var _0x298bee={};_0x298bee[_0x5ddfbd]={'$like':'%'+_0xe4da02[_0x918a('0x44')][_0x918a('0x51')]+'%'};return _0x298bee;})});}_0x9c8422=_[_0x918a('0x50')]({},_0x9c8422,_0xe4da02['options']);return db['Disposition']['count']({'where':_0x9c8422[_0x918a('0x4e')]})[_0x918a('0x1d')](function(_0xf880d8){_0x78e41a[_0x918a('0x30')]=_0xf880d8;if(_0xe4da02['query'][_0x918a('0x69')]){_0x9c8422[_0x918a('0x53')]=[{'all':!![]}];}return db[_0x918a('0x66')][_0x918a('0x54')](_0x9c8422);})['then'](function(_0x47108e){_0x78e41a['rows']=_0x47108e;return _0x78e41a;});}})[_0x918a('0x1d')](respondWithFilteredResult(_0x5dbd75,_0x9c8422))[_0x918a('0x28')](handleError(_0x5dbd75,null));};exports[_0x918a('0x6a')]=function(_0x1ac7ac,_0x46593f,_0x1cd0b0){return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x1ac7ac[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x46593f,null))[_0x918a('0x1d')](function(_0x37691f){if(_0x37691f){return _0x37691f[_0x918a('0x6a')](_0x1ac7ac[_0x918a('0x44')][_0x918a('0x6b')]);}})['then'](respondWithStatusCode(_0x46593f,null))[_0x918a('0x28')](handleError(_0x46593f,null));};exports['addAnswer']=function(_0x33fb9a,_0x2f2da2,_0x38173b){if(_0x33fb9a[_0x918a('0x5c')]['id']){delete _0x33fb9a['body']['id'];}return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x33fb9a[_0x918a('0x57')]['id']}})['then'](handleEntityNotFound(_0x2f2da2,null))[_0x918a('0x1d')](function(_0x31ada4){if(_0x31ada4){_0x33fb9a[_0x918a('0x5c')][_0x918a('0x65')]=_0x31ada4['id'];return db[_0x918a('0x6c')][_0x918a('0x5b')](_0x33fb9a[_0x918a('0x5c')]);}})[_0x918a('0x1d')](respondWithResult(_0x2f2da2,null))[_0x918a('0x28')](handleError(_0x2f2da2,null));};exports[_0x918a('0x6d')]=function(_0x53384c,_0x49a067,_0x404be9){var _0x1cd267={'raw':![],'where':{}};var _0x3e91b4={};var _0x446a0a={'count':0x0,'rows':[]};return db[_0x918a('0x3e')][_0x918a('0x68')]({'where':{'id':_0x53384c[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x49a067,null))[_0x918a('0x1d')](function(_0x5b6a28){if(_0x5b6a28){_0x3e91b4[_0x918a('0x42')]=_['keys'](db[_0x918a('0x6c')][_0x918a('0x3f')]);_0x3e91b4[_0x918a('0x44')]=_[_0x918a('0x45')](_0x53384c[_0x918a('0x44')]);_0x3e91b4[_0x918a('0x46')]=_[_0x918a('0x59')](_0x3e91b4[_0x918a('0x42')],_0x3e91b4['query']);_0x1cd267['attributes']=_[_0x918a('0x59')](_0x3e91b4[_0x918a('0x42')],qs[_0x918a('0x48')](_0x53384c[_0x918a('0x44')][_0x918a('0x48')]));_0x1cd267[_0x918a('0x47')]=_0x1cd267[_0x918a('0x47')][_0x918a('0x49')]?_0x1cd267['attributes']:_0x3e91b4['model'];if(!_0x53384c[_0x918a('0x44')][_0x918a('0x4a')](_0x918a('0x4b'))){_0x1cd267[_0x918a('0x2f')]=qs[_0x918a('0x2f')](_0x53384c[_0x918a('0x44')][_0x918a('0x2f')]);_0x1cd267['offset']=qs[_0x918a('0x2d')](_0x53384c[_0x918a('0x44')][_0x918a('0x2d')]);}_0x1cd267[_0x918a('0x4c')]=qs[_0x918a('0x4d')](_0x53384c[_0x918a('0x44')]['sort']);_0x1cd267['where']=qs['filters'](_['pick'](_0x53384c[_0x918a('0x44')],_0x3e91b4[_0x918a('0x46')]));_0x1cd267[_0x918a('0x4e')][_0x918a('0x65')]=_0x5b6a28['id'];if(_0x53384c['query']['filter']){_0x1cd267[_0x918a('0x4e')]=_[_0x918a('0x50')](_0x1cd267[_0x918a('0x4e')],{'$or':_[_0x918a('0x43')](_0x1cd267[_0x918a('0x47')],function(_0x2b7130){var _0x514a5d={};_0x514a5d[_0x2b7130]={'$like':'%'+_0x53384c[_0x918a('0x44')]['filter']+'%'};return _0x514a5d;})});}_0x1cd267=_['merge']({},_0x1cd267,_0x53384c[_0x918a('0x52')]);return db[_0x918a('0x6c')]['count']({'where':_0x1cd267[_0x918a('0x4e')]})[_0x918a('0x1d')](function(_0x2e0171){_0x446a0a[_0x918a('0x30')]=_0x2e0171;if(_0x53384c[_0x918a('0x44')]['includeAll']){_0x1cd267['include']=[{'all':!![]}];}return db[_0x918a('0x6c')][_0x918a('0x54')](_0x1cd267);})[_0x918a('0x1d')](function(_0x3a8724){_0x446a0a[_0x918a('0x55')]=_0x3a8724;return _0x446a0a;});}})[_0x918a('0x1d')](respondWithFilteredResult(_0x49a067,_0x1cd267))['catch'](handleError(_0x49a067,null));};exports[_0x918a('0x6e')]=function(_0x100e7b,_0x9fe7c2,_0x415234){return db['SmsAccount'][_0x918a('0x5a')]({'where':{'id':_0x100e7b[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x9fe7c2,null))[_0x918a('0x1d')](function(_0x162219){if(_0x162219){return _0x162219[_0x918a('0x6e')](_0x100e7b['query'][_0x918a('0x6b')]);}})['then'](respondWithStatusCode(_0x9fe7c2,null))[_0x918a('0x28')](handleError(_0x9fe7c2,null));};exports['notify']=function(_0x99a84,_0x2d3a9d,_0x39e9bb){var _0x2ba6b0={'channel':_0x918a('0x6f')};var _0x32fb35=[];var _0x4ef00b=[];var _0x21417a={};return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x99a84['params']['id']},'include':[{'model':db[_0x918a('0x70')],'as':_0x918a('0x71')}]})[_0x918a('0x1d')](handleEntityNotFound(_0x2d3a9d,null))[_0x918a('0x1d')](function(_0x4e1d78){_0x2ba6b0['account']=_0x4e1d78;_0x2ba6b0[_0x918a('0x72')]=_[_0x918a('0x73')](_0x4e1d78[_0x918a('0x71')],['priority'],[_0x918a('0x74')]);if(_0x2ba6b0['account'][_0x918a('0x71')]){delete _0x2ba6b0[_0x918a('0x75')][_0x918a('0x71')];}return db[_0x918a('0x76')][_0x918a('0x63')]();})[_0x918a('0x1d')](function(_0x5731f7){if(!_0x5731f7){throw new db[(_0x918a('0x77'))][(_0x918a('0x78'))](_0x918a('0x79'));}_0x32fb35=_[_0x918a('0x7a')](_['keys'](_0x5731f7),['createdAt',_0x918a('0x7b')]);_0x4ef00b=_['difference'](_[_0x918a('0x45')](_0x5731f7),['createdAt',_0x918a('0x7b'),_0x918a('0x7c'),_0x918a('0x7d')]);_0x2ba6b0[_0x918a('0x5c')]={'mapKey':_0x918a('0x7e')};if(_0x2ba6b0[_0x918a('0x75')][_0x918a('0x41')]){switch(_0x2ba6b0[_0x918a('0x75')][_0x918a('0x41')]){case _0x918a('0x7f'):_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84['body'][_0x918a('0x81')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84['body'][_0x918a('0x82')];_0x2ba6b0[_0x918a('0x5c')]['messageId']=_0x99a84[_0x918a('0x5c')]['MessageSid'];break;case _0x918a('0x83'):_0x2ba6b0[_0x918a('0x5c')]['from']='+'+_0x99a84['body']['sender'];_0x2ba6b0['body']['body']=_0x99a84[_0x918a('0x5c')][_0x918a('0x84')];break;case _0x918a('0x85'):_0x2ba6b0[_0x918a('0x5c')]['from']=_0x99a84[_0x918a('0x5c')][_0x918a('0x80')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x26')];break;case _0x918a('0x86'):_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x80')];_0x2ba6b0[_0x918a('0x5c')]['body']=_0x99a84['body'][_0x918a('0x5c')];_0x2ba6b0['body'][_0x918a('0x87')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x88')];break;case _0x918a('0x89'):_0x2ba6b0['body']['from']=_0x99a84[_0x918a('0x5c')][_0x918a('0x81')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84['body'][_0x918a('0x8a')];_0x2ba6b0['body'][_0x918a('0x87')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x8b')];break;case'infobip':_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]='+'+_0x99a84[_0x918a('0x5c')][_0x918a('0x8c')][0x0][_0x918a('0x80')];_0x2ba6b0[_0x918a('0x5c')]['body']=_0x99a84['body'][_0x918a('0x8c')][0x0][_0x918a('0x84')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x87')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x8c')][0x0][_0x918a('0x87')];break;case _0x918a('0x8d'):_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x8e')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x8f')][_0x918a('0x26')];break;case _0x918a('0x90'):_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x91')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x84')];_0x2ba6b0['body'][_0x918a('0x87')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x92')];break;case _0x918a('0x93'):_0x2ba6b0[_0x918a('0x5c')]['messageId']=_0x99a84['body'][0x0][_0x918a('0x26')]['id'];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84[_0x918a('0x5c')][0x0][_0x918a('0x26')]['from'];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84[_0x918a('0x5c')][0x0]['message'][_0x918a('0x84')];break;case _0x918a('0x94'):_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x80')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')]=_0x99a84['body'][_0x918a('0x26')];_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x87')]=_0x99a84[_0x918a('0x5c')][_0x918a('0x95')];break;}}if(_0x2ba6b0[_0x918a('0x5c')]['id']){delete _0x2ba6b0[_0x918a('0x5c')]['id'];}if(_['isNil'](_0x2ba6b0['body'][_0x918a('0x80')])){throw new db['Sequelize'][(_0x918a('0x78'))](_0x918a('0x96'));}if(_[_0x918a('0x97')](_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')])||_0x2ba6b0['body'][_0x918a('0x5c')]===''){throw new db[(_0x918a('0x77'))][(_0x918a('0x78'))](_0x918a('0x98'));}if(_['isNil'](_0x2ba6b0['body']['mapKey'])){throw new db[(_0x918a('0x77'))][(_0x918a('0x78'))](_0x918a('0x99')+_0x4ef00b);}if(!_[_0x918a('0x9a')](_0x4ef00b,_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x9b')])){throw new db['Sequelize'][(_0x918a('0x78'))](_0x918a('0x9c')+_0x4ef00b);}_0x21417a[_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x9b')]]=_0x2ba6b0['body'][_0x918a('0x80')];return db[_0x918a('0x9d')]['find']({'where':{'id':_0x2ba6b0[_0x918a('0x75')][_0x918a('0x7d')]},'include':[{'model':db['CmContact'],'as':_0x918a('0x9e'),'where':_0x21417a,'limit':0x1,'order':[[_0x918a('0x7b'),_0x918a('0x9f')]]}]});})[_0x918a('0x1d')](handleEntityNotFound(_0x2d3a9d,null))['then'](function(_0x4b23c4){if(_0x4b23c4){_0x2ba6b0['list']=_[_0x918a('0xa0')](_0x4b23c4,[_0x918a('0x9e')]);if(_0x4b23c4['Contacts'][_0x918a('0x49')]){return _0x4b23c4[_0x918a('0x9e')][0x0];}var _0x58b79d=_[_0x918a('0x17')](_0x2ba6b0['body'],{'firstName':_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')],'ListId':_0x4b23c4['id']});_0x58b79d[_0x2ba6b0[_0x918a('0x5c')]['mapKey']]=_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')];return db[_0x918a('0x76')][_0x918a('0x5b')](_0x58b79d,{'fields':_0x32fb35,'raw':!![]});}})[_0x918a('0x1d')](handleEntityNotFound(_0x2d3a9d,null))[_0x918a('0x1d')](function(_0x260d73){if(_0x260d73){_0x2ba6b0[_0x918a('0xa1')]=_0x260d73;var _0xa74c={'ContactId':_0x260d73['id'],'phone':_0x2ba6b0['body'][_0x918a('0x80')],'SmsAccountId':_0x99a84[_0x918a('0x57')]['id']};var _0x4e14af={'ContactId':_0x260d73['id'],'SmsAccountId':_0x99a84[_0x918a('0x57')]['id'],'closed':![]};return db[_0x918a('0xa2')][_0x918a('0x5a')]({'where':_0x4e14af})[_0x918a('0x1d')](function(_0x396ae0){if(_0x396ae0){return[_0x396ae0,![]];}return db[_0x918a('0xa2')][_0x918a('0x5b')](_0xa74c)[_0x918a('0x1d')](function(_0x220973){return[_0x220973,!![]];});});}})[_0x918a('0xa3')](function(_0x16a4aa,_0x2f3be4){_0x2ba6b0[_0x918a('0xa4')]=_0x16a4aa[_0x918a('0x37')]({'plain':!![]});_0x2ba6b0[_0x918a('0xa4')][_0x918a('0xa5')]=![];if(_0x2f3be4){if(_0x2ba6b0[_0x918a('0x75')][_0x918a('0xa6')]){_0x2ba6b0['applications']['push']({'id':0x0,'priority':_0x2ba6b0['applications']['length']+0x1,'app':_0x918a('0xa7'),'appdata':_0x918a('0xa8'),'interval':_0x918a('0xa9')});}_0x2ba6b0[_0x918a('0xa4')][_0x918a('0xa5')]=!![];}return db['SmsMessage'][_0x918a('0x5b')]({'phone':_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x80')],'messageId':_0x2ba6b0[_0x918a('0x5c')]['messageId'],'body':_0x2ba6b0[_0x918a('0x5c')][_0x918a('0x5c')],'SmsAccountId':_0x99a84[_0x918a('0x57')]['id'],'SmsInteractionId':_0x16a4aa['id'],'direction':'in','ContactId':_0x16a4aa[_0x918a('0xaa')],'AttachmentId':_0x2ba6b0[_0x918a('0x5c')][_0x918a('0xab')]});})[_0x918a('0x1d')](function(_0x5573c7){_0x2ba6b0[_0x918a('0x26')]=_0x5573c7;if(_0x2ba6b0[_0x918a('0xa4')]['UserId']){return db[_0x918a('0xac')][_0x918a('0x5a')]({'attributes':['id',_0x918a('0x3a')],'where':{'id':_0x2ba6b0['interaction']['UserId']}})[_0x918a('0x1d')](function(_0x19bf80){if(_0x19bf80){_0x2ba6b0[_0x918a('0x72')][_0x918a('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x19bf80['name']+','+(_0x2ba6b0[_0x918a('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x918a('0xa9')});}return respondWithRpcPromise(_0x918a('0xae'),_0x918a('0xaf'),_0x2ba6b0);});}return respondWithRpcPromise(_0x918a('0xae'),_0x918a('0xaf'),_0x2ba6b0);})['then'](function(_0x27b1b4){if(_0x27b1b4){var _0x3ee680=0xc8;var _0x1954bd='receiveMessage';logger['info'](_0x918a('0x20'),_0x1954bd,_0x3ee680,_0x918a('0xb0'));logger[_0x918a('0x1f')](_0x918a('0xb1'),_0x1954bd,_0x3ee680,'entity\x20found',JSON['stringify'](_0x27b1b4));if(_0x2ba6b0['account'][_0x918a('0x41')]===_0x918a('0x7f')){return _0x2d3a9d[_0x918a('0x2a')](_0x3ee680)['set'](_0x918a('0xb2'),'text/xml')['send'](_0x918a('0xb3'));}else{return _0x2d3a9d[_0x918a('0x2a')](_0x3ee680)['json'](_0x27b1b4);}}})['catch'](handleError(_0x2d3a9d,null));};exports[_0x918a('0xb4')]=function(_0x2ec1dd,_0x43ae2c){var _0x1f14f9=_0x2ec1dd[_0x918a('0x57')]['id'];var _0x3c3852=_0x2ec1dd['body'];var _0x53a351=0xc8;var _0x5baad5=null;return db['sequelize'][_0x918a('0xb5')]({'isolationLevel':db[_0x918a('0xb6')][_0x918a('0xb7')][_0x918a('0xb8')][_0x918a('0xb9')]},function(_0x161745){return db[_0x918a('0x3e')]['findOne']({'where':{'id':_0x1f14f9},'transaction':_0x161745})['then'](function(_0x103d83){if(_0x103d83){return db['SmsApplication'][_0x918a('0x36')]({'where':{'SmsAccountId':_0x1f14f9},'transaction':_0x161745})[_0x918a('0x1d')](function(){var _0x322887=_[_0x918a('0x43')](_0x3c3852,function(_0x7d84b3){_0x7d84b3['SmsAccountId']=_0x1f14f9;return _0x7d84b3;});return db[_0x918a('0x70')][_0x918a('0xba')](_0x322887,{'transaction':_0x161745});});}else{_0x53a351=0x194;_0x5baad5=[];}});})[_0x918a('0x1d')](function(){if(_0x53a351!==0x194){return db[_0x918a('0x70')][_0x918a('0xbb')]({'where':{'SmsAccountId':_0x1f14f9},'order':_0x918a('0xbc')})['then'](function(_0x5e2365){_0x5baad5=_0x5e2365;});}})[_0x918a('0x28')](function(_0x39e683){_0x53a351=0x1f4;logger[_0x918a('0x23')](_0x39e683[_0x918a('0x39')]);if(_0x39e683[_0x918a('0x3a')]){delete _0x39e683[_0x918a('0x3a')];}_0x5baad5=_0x39e683;})[_0x918a('0xbd')](function(){if(_0x5baad5===null){_0x43ae2c[_0x918a('0x29')](_0x53a351);}else{if(_0x53a351===0x1f4){_0x43ae2c[_0x918a('0x2a')](_0x53a351)[_0x918a('0x3b')](_0x5baad5);}else{_0x43ae2c[_0x918a('0x2a')](_0x53a351)['json'](_0x5baad5);}}});};exports['getApplications']=function(_0x25db31,_0x58a5d7,_0x5be719){var _0x429584={};var _0x556f13={};var _0x228e61;var _0x5ee664;return db[_0x918a('0x3e')][_0x918a('0x68')]({'where':{'id':_0x25db31[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x58a5d7,null))['then'](function(_0x59009a){if(_0x59009a){_0x228e61=_0x59009a;_0x556f13[_0x918a('0x42')]=_[_0x918a('0x45')](db[_0x918a('0x70')][_0x918a('0x3f')]);_0x556f13[_0x918a('0x44')]=_['keys'](_0x25db31[_0x918a('0x44')]);_0x556f13[_0x918a('0x46')]=_['intersection'](_0x556f13[_0x918a('0x42')],_0x556f13[_0x918a('0x44')]);_0x429584[_0x918a('0x47')]=_[_0x918a('0x59')](_0x556f13[_0x918a('0x42')],qs[_0x918a('0x48')](_0x25db31[_0x918a('0x44')]['fields']));_0x429584[_0x918a('0x47')]=_0x429584['attributes'][_0x918a('0x49')]?_0x429584[_0x918a('0x47')]:_0x556f13[_0x918a('0x42')];_0x429584[_0x918a('0x4c')]=qs[_0x918a('0x4d')](_0x25db31[_0x918a('0x44')][_0x918a('0x4d')]);_0x429584[_0x918a('0x4e')]=qs[_0x918a('0x46')](_[_0x918a('0x4f')](_0x25db31[_0x918a('0x44')],_0x556f13[_0x918a('0x46')]));if(_0x25db31['query'][_0x918a('0x51')]){_0x429584[_0x918a('0x4e')]=_[_0x918a('0x50')](_0x429584[_0x918a('0x4e')],{'$or':_[_0x918a('0x43')](_0x429584['attributes'],function(_0x1dce82){var _0x52c4d5={};_0x52c4d5[_0x1dce82]={'$like':'%'+_0x25db31[_0x918a('0x44')][_0x918a('0x51')]+'%'};return _0x52c4d5;})});}_0x429584=_['merge']({},_0x429584,_0x25db31[_0x918a('0x52')]);return _0x228e61[_0x918a('0xbe')](_0x429584);}})['then'](function(_0x39b859){if(_0x39b859){_0x5ee664=_0x39b859[_0x918a('0x49')];if(!_0x25db31[_0x918a('0x44')]['hasOwnProperty'](_0x918a('0x4b'))){_0x429584['limit']=qs[_0x918a('0x2f')](_0x25db31[_0x918a('0x44')][_0x918a('0x2f')]);_0x429584[_0x918a('0x2d')]=qs[_0x918a('0x2d')](_0x25db31['query'][_0x918a('0x2d')]);}return _0x228e61[_0x918a('0xbe')](_0x429584);}})[_0x918a('0x1d')](function(_0x32edc3){if(_0x32edc3){return _0x32edc3?{'count':_0x5ee664,'rows':_0x32edc3}:null;}})[_0x918a('0x1d')](respondWithResult(_0x58a5d7,null))[_0x918a('0x28')](handleError(_0x58a5d7,null));};exports[_0x918a('0xbf')]=function(_0x1ab897,_0x15a41a,_0x14e6f3){var _0x3d53e6={'raw':![],'where':{}};var _0x4ce755={};var _0x3112e8={'count':0x0,'rows':[]};return db[_0x918a('0x3e')]['findOne']({'where':{'id':_0x1ab897[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x15a41a,null))[_0x918a('0x1d')](function(_0x50786a){if(_0x50786a){_0x4ce755[_0x918a('0x42')]=_[_0x918a('0x45')](db[_0x918a('0xa2')][_0x918a('0x3f')]);_0x4ce755[_0x918a('0x44')]=_[_0x918a('0x45')](_0x1ab897['query']);_0x4ce755[_0x918a('0x46')]=_['intersection'](_0x4ce755[_0x918a('0x42')],_0x4ce755['query']);_0x3d53e6[_0x918a('0x47')]=_[_0x918a('0x59')](_0x4ce755['model'],qs[_0x918a('0x48')](_0x1ab897[_0x918a('0x44')]['fields']));_0x3d53e6[_0x918a('0x47')]=_0x3d53e6[_0x918a('0x47')][_0x918a('0x49')]?_0x3d53e6[_0x918a('0x47')]:_0x4ce755[_0x918a('0x42')];if(!_0x1ab897[_0x918a('0x44')][_0x918a('0x4a')]('nolimit')){_0x3d53e6[_0x918a('0x2f')]=qs[_0x918a('0x2f')](_0x1ab897[_0x918a('0x44')][_0x918a('0x2f')]);_0x3d53e6[_0x918a('0x2d')]=qs['offset'](_0x1ab897[_0x918a('0x44')][_0x918a('0x2d')]);}_0x3d53e6['order']=qs[_0x918a('0x4d')](_0x1ab897['query'][_0x918a('0x4d')]);_0x3d53e6[_0x918a('0x4e')]=qs[_0x918a('0x46')](_['pick'](_0x1ab897[_0x918a('0x44')],_0x4ce755['filters']));_0x3d53e6[_0x918a('0x4e')][_0x918a('0x65')]=_0x50786a['id'];if(_0x1ab897['query']['filter']){_0x3d53e6['where']=_[_0x918a('0x50')](_0x3d53e6[_0x918a('0x4e')],{'$or':_['map'](_0x3d53e6[_0x918a('0x47')],function(_0x1952e0){var _0x6153a7={};_0x6153a7[_0x1952e0]={'$like':'%'+_0x1ab897[_0x918a('0x44')]['filter']+'%'};return _0x6153a7;})});}_0x3d53e6=_[_0x918a('0x50')]({},_0x3d53e6,_0x1ab897['options']);return db[_0x918a('0xa2')][_0x918a('0x30')]({'where':_0x3d53e6[_0x918a('0x4e')]})[_0x918a('0x1d')](function(_0x11bcbe){_0x3112e8[_0x918a('0x30')]=_0x11bcbe;if(_0x1ab897[_0x918a('0x44')][_0x918a('0x69')]){_0x3d53e6['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x918a('0xac')],'as':_0x918a('0xc0'),'attributes':[_0x918a('0x3a'),_0x918a('0xc1'),_0x918a('0xc2')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x918a('0x3a'),_0x918a('0xc3')],'where':_0x1ab897[_0x918a('0x44')]['tag']?{'id':_0x1ab897[_0x918a('0x44')][_0x918a('0xc4')]}:undefined,'required':_0x1ab897[_0x918a('0x44')][_0x918a('0xc4')]?!![]:![]}];}return db[_0x918a('0xa2')]['findAll'](_0x3d53e6);})[_0x918a('0x1d')](function(_0x22815f){_0x3112e8[_0x918a('0x55')]=_0x22815f;return _0x3112e8;});}})[_0x918a('0x1d')](respondWithFilteredResult(_0x15a41a,_0x3d53e6))['catch'](handleError(_0x15a41a,null));};exports[_0x918a('0x3b')]=function(_0x96a96b,_0x3a586e,_0xaa8fd){var _0x2c94b2,_0x4d57b9,_0x1a66f8;if(_[_0x918a('0x97')](_0x96a96b['body'][_0x918a('0x5c')])||_0x96a96b[_0x918a('0x5c')][_0x918a('0x5c')]===''){throw new db[(_0x918a('0x77'))][(_0x918a('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x918a('0x97')](_0x96a96b['body']['to'])){throw new db[(_0x918a('0x77'))][(_0x918a('0x78'))]('to\x20is\x20mandatory');}_0x2c94b2=_0x96a96b[_0x918a('0x5c')]['to'];return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x96a96b['params']['id']},'include':[{'model':db[_0x918a('0x9d')],'as':_0x918a('0xc5'),'include':[{'model':db[_0x918a('0x76')],'as':_0x918a('0x9e'),'where':{'mobile':_0x2c94b2},'limit':0x1,'order':[[_0x918a('0x7b'),_0x918a('0x9f')]]}]}]})[_0x918a('0x1d')](handleEntityNotFound(_0x3a586e,null))[_0x918a('0x1d')](function(_0x22af45){if(_0x22af45&&_0x22af45[_0x918a('0xc5')]){_0x4d57b9=_0x22af45[_0x918a('0x37')]({'plain':!![]});if(_0x4d57b9[_0x918a('0xc5')]&&_0x4d57b9[_0x918a('0xc5')][_0x918a('0x9e')][_0x918a('0x49')]){return _0x4d57b9['List'][_0x918a('0x9e')][0x0];}return db['CmContact'][_0x918a('0x5b')](_[_0x918a('0x17')](_0x96a96b['body'],{'firstName':_0x2c94b2,'mobile':_0x2c94b2,'phone':_0x2c94b2,'ListId':_0x4d57b9[_0x918a('0x7d')]}));}})['then'](handleEntityNotFound(_0x3a586e,null))[_0x918a('0x1d')](function(_0x22df21){if(_0x22df21){_0x1a66f8=_0x22df21;return db['SmsInteraction']['find']({'where':{'ContactId':_0x1a66f8['id'],'closed':![],'SmsAccountId':_0x4d57b9['id']}})['then'](function(_0x5349c7){if(_0x5349c7){return[_0x5349c7,![]];}return db[_0x918a('0xa2')][_0x918a('0x5b')]({'UserId':_0x96a96b['user']['id'],'ContactId':_0x1a66f8['id'],'SmsAccountId':_0x4d57b9['id'],'phone':_0x2c94b2,'firstMsgDirection':'out','Messages':[_['merge'](_0x96a96b[_0x918a('0x5c')],{'read':![],'body':_0x96a96b['body'][_0x918a('0x5c')],'phone':_0x2c94b2,'SmsAccountId':_0x4d57b9['id'],'UserId':_0x96a96b[_0x918a('0x5d')]['id'],'ContactId':_0x1a66f8['id']})]},{'include':[{'model':db[_0x918a('0xc6')],'as':_0x918a('0xc7')}]})[_0x918a('0x1d')](function(_0x24fb71){return[_0x24fb71,!![]];});});}})[_0x918a('0xa3')](function(_0x1023f9,_0x566b1e){if(_0x566b1e){return _0x1023f9;}return db[_0x918a('0xc6')][_0x918a('0x5b')](_[_0x918a('0x50')](_0x96a96b['body'],{'read':![],'body':_0x96a96b[_0x918a('0x5c')][_0x918a('0x5c')],'phone':_0x2c94b2,'SmsAccountId':_0x4d57b9['id'],'SmsInteractionId':_0x1023f9['id'],'UserId':_0x96a96b[_0x918a('0x5d')]['id'],'ContactId':_0x1a66f8['id']}))[_0x918a('0x1d')](function(_0x51ec15){_0x1023f9[_0x918a('0xc8')][_0x918a('0xc7')]=[];_0x1023f9[_0x918a('0xc8')][_0x918a('0xc7')][_0x918a('0xc9')](_0x51ec15[_0x918a('0xc8')]);return _0x1023f9;});})[_0x918a('0x1d')](respondWithResult(_0x3a586e,null))[_0x918a('0x28')](handleError(_0x3a586e,null));};exports[_0x918a('0x2a')]=function(_0x16fcdc,_0x40f542,_0x4f7a64){if(_0x16fcdc[_0x918a('0x5c')]['id']){delete _0x16fcdc[_0x918a('0x5c')]['id'];}var _0x11ebba,_0x1ff6e8,_0x4e5af7;return db['SmsAccount']['find']({'where':{'id':_0x16fcdc[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x40f542,null))['then'](function(_0x3dc3be){if(_0x3dc3be){_0x4e5af7=_0x3dc3be;logger[_0x918a('0x1f')](_0x918a('0x20'),_0x918a('0x2a'),'received\x20delivery\x20report\x20from',_0x3dc3be[_0x918a('0x41')],util[_0x918a('0xca')](_0x16fcdc['body'],{'showHidden':![],'depth':null}));switch(_0x3dc3be[_0x918a('0x41')]){case _0x918a('0x83'):if(_0x16fcdc[_0x918a('0x5c')][_0x918a('0xcb')]&&_0x16fcdc[_0x918a('0x5c')][_0x918a('0x2a')]){_0x1ff6e8=_0x16fcdc[_0x918a('0x5c')][_0x918a('0x2a')];return db[_0x918a('0xc6')][_0x918a('0x5a')]({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')][_0x918a('0xcb')]}});}break;case'connectel':if(_0x16fcdc['body'][_0x918a('0xcc')]&&_0x16fcdc[_0x918a('0x5c')]['statusInt']){_0x1ff6e8=_0x16fcdc['body'][_0x918a('0xcd')];return db[_0x918a('0xc6')]['find']({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')][_0x918a('0xcc')]}});}break;case _0x918a('0x86'):if(_0x16fcdc[_0x918a('0x5c')][_0x918a('0x88')]&&_0x16fcdc['body'][_0x918a('0xce')]){_0x1ff6e8=_0x16fcdc[_0x918a('0x5c')]['status_code'];return db['SmsMessage'][_0x918a('0x5a')]({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')][_0x918a('0x88')]}});}break;case'infobip':var _0x3b2965=_0x16fcdc[_0x918a('0x5c')][_0x918a('0x8c')][0x0];if(_0x3b2965[_0x918a('0x87')]&&_0x3b2965[_0x918a('0x2a')][_0x918a('0xcf')]===_0x918a('0xd0')){_0x1ff6e8=_0x3b2965[_0x918a('0x2a')][_0x918a('0xcf')];return db['SmsMessage'][_0x918a('0x5a')]({'where':{'messageId':_0x3b2965[_0x918a('0x87')]}});}break;case _0x918a('0x90'):if(_0x16fcdc[_0x918a('0x5c')]['messageId']&&_0x16fcdc[_0x918a('0x5c')][_0x918a('0x2a')]){_0x1ff6e8=_0x16fcdc[_0x918a('0x5c')][_0x918a('0x2a')];return db[_0x918a('0xc6')][_0x918a('0x5a')]({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')][_0x918a('0x87')]}});}break;case _0x918a('0x93'):if(_0x16fcdc[_0x918a('0x5c')][0x0][_0x918a('0x26')]['id']){_0x1ff6e8=_0x16fcdc['body'][0x0][_0x918a('0x41')];return db[_0x918a('0xc6')][_0x918a('0x5a')]({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')][0x0][_0x918a('0x26')]['id']}});}break;case _0x918a('0x94'):if(_0x16fcdc[_0x918a('0x5c')][_0x918a('0xd1')]&&_0x16fcdc['body'][_0x918a('0x2a')]){_0x1ff6e8=_0x16fcdc['body'][_0x918a('0x2a')];return db['SmsMessage'][_0x918a('0x5a')]({'where':{'messageId':_0x16fcdc[_0x918a('0x5c')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x40f542,null))[_0x918a('0x1d')](function(_0x336313){if(_0x336313){_0x11ebba=_0x336313;switch(_0x4e5af7[_0x918a('0x41')]){case'skebby':if(_0x1ff6e8===_0x918a('0xd0')){return _0x11ebba['update']({'read':!![]});}else{logger[_0x918a('0x23')](_0x918a('0x20'),_0x918a('0x2a'),_0x918a('0x83'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x918a('0x85'):if(_0x1ff6e8==='1'){return _0x11ebba['update']({'read':!![]});}else{logger[_0x918a('0x23')](_0x918a('0x20'),_0x918a('0x2a'),_0x918a('0x83'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x918a('0x86'):if(!_0x16fcdc[_0x918a('0x5c')][_0x918a('0xd2')]&&_0x1ff6e8>=0xc8&&_0x1ff6e8<=0xce){return _0x11ebba['update']({'read':!![]});}else{logger[_0x918a('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x918a('0x2a'),_0x918a('0x86'),util['inspect'](_0x16fcdc['body'],{'showHidden':![],'depth':null}));}break;case _0x918a('0xd3'):var _0x18dcaf=_0x16fcdc[_0x918a('0x5c')]['results'][0x0];if(_0x18dcaf[_0x918a('0x2a')]['groupName']===_0x918a('0xd0')){return _0x11ebba['update']({'read':!![]});}else{logger[_0x918a('0x23')](_0x918a('0x20'),_0x918a('0x2a'),_0x918a('0xd3'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x918a('0x90'):if(_0x1ff6e8==_0x918a('0xd4')||_0x1ff6e8=='RECEIVED_BY_RECIPIENT'){return _0x11ebba[_0x918a('0xd5')]({'read':!![]});}else{logger[_0x918a('0x23')](_0x918a('0x20'),'status',_0x918a('0x90'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1ff6e8==_0x918a('0xd6')){return _0x11ebba[_0x918a('0xd5')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x918a('0x93'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x918a('0x94'):if(_0x1ff6e8===_0x918a('0xd7')||_0x1ff6e8==='ACCEPTD'){return _0x11ebba[_0x918a('0xd5')]({'read':!![]});}else{logger['error'](_0x918a('0x20'),'status',_0x918a('0x94'),util[_0x918a('0xca')](_0x16fcdc[_0x918a('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x11ebba;}})['then'](respondWithResult(_0x40f542,null))['catch'](handleError(_0x40f542,null));};exports[_0x918a('0xd8')]=function(_0x3be8fc,_0x22bc17,_0x33a095){var _0x350f38,_0x13b321,_0xdf268a;return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x3be8fc[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x22bc17,null))['then'](function(_0x22f004){if(_0x22f004){_0xdf268a=_0x22f004;logger[_0x918a('0x1f')](_0x918a('0x20'),_0x918a('0x2a'),_0x918a('0xd9'),_0x22f004[_0x918a('0x41')],util[_0x918a('0xca')](_0x3be8fc[_0x918a('0x44')],{'showHidden':![],'depth':null}));switch(_0x22f004[_0x918a('0x41')]){case _0x918a('0x8d'):if(_0x3be8fc[_0x918a('0x44')]['message-id']&&_0x3be8fc[_0x918a('0x44')]['state']){_0x13b321=_0x3be8fc[_0x918a('0x44')][_0x918a('0xda')];return db[_0x918a('0xc6')][_0x918a('0x5a')]({'where':{'messageId':_0x3be8fc[_0x918a('0x44')][_0x918a('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x22bc17,null))[_0x918a('0x1d')](function(_0x52a666){if(_0x52a666){_0x350f38=_0x52a666;switch(_0xdf268a[_0x918a('0x41')]){case _0x918a('0x8d'):if(_0x13b321==='2'||_0x13b321==='6'){return _0x350f38[_0x918a('0xd5')]({'read':!![]});}else{logger['error'](_0x918a('0x20'),'status','csc',util[_0x918a('0xca')](_0x3be8fc[_0x918a('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x350f38;}})['then'](respondWithResult(_0x22bc17,null))[_0x918a('0x28')](handleError(_0x22bc17,null));};exports[_0x918a('0xdc')]=function(_0x1c219b,_0x3113ad,_0x481d2a){return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x1c219b['params']['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x3113ad,null))[_0x918a('0x1d')](function(_0x5a1189){if(_0x5a1189){return _0x5a1189[_0x918a('0xdc')](_0x1c219b[_0x918a('0x5c')][_0x918a('0x6b')],_[_0x918a('0xa0')](_0x1c219b['body'],['ids','id'])||{})['spread'](function(_0x4a4893){for(var _0x598d8c=0x0;_0x598d8c<_0x1c219b[_0x918a('0x5c')]['ids'][_0x918a('0x49')];_0x598d8c+=0x1){socket['emit'](_0x918a('0xdd'),{'UserId':Number(_0x1c219b[_0x918a('0x5c')]['ids'][_0x598d8c]),'SmsAccountId':Number(_0x1c219b[_0x918a('0x57')]['id'])});}return _0x4a4893;});}})['then'](respondWithResult(_0x3113ad,null))[_0x918a('0x28')](handleError(_0x3113ad,null));};exports[_0x918a('0xde')]=function(_0x20232b,_0x42b6a6,_0x3fa05c){return db[_0x918a('0x3e')][_0x918a('0x5a')]({'where':{'id':_0x20232b[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x42b6a6,null))[_0x918a('0x1d')](function(_0x1295aa){if(_0x1295aa){return _0x1295aa[_0x918a('0xde')](_0x20232b['query'][_0x918a('0x6b')])[_0x918a('0x1d')](function(){if(_[_0x918a('0xdf')](_0x20232b['query']['ids'])){for(var _0x372cbc=0x0;_0x372cbc<_0x20232b[_0x918a('0x44')][_0x918a('0x6b')][_0x918a('0x49')];_0x372cbc+=0x1){socket[_0x918a('0xe0')](_0x918a('0xe1'),{'UserId':Number(_0x20232b[_0x918a('0x44')][_0x918a('0x6b')][_0x372cbc]),'SmsAccountId':Number(_0x20232b[_0x918a('0x57')]['id'])});}}else{socket[_0x918a('0xe0')](_0x918a('0xe1'),{'UserId':Number(_0x20232b[_0x918a('0x44')][_0x918a('0x6b')]),'SmsAccountId':Number(_0x20232b[_0x918a('0x57')]['id'])});}});}})[_0x918a('0x1d')](respondWithStatusCode(_0x42b6a6,null))[_0x918a('0x28')](handleError(_0x42b6a6,null));};exports[_0x918a('0xe2')]=function(_0x5cfeac,_0x5e89aa,_0x27f629){var _0x3a5081={};var _0x5c856c={};var _0x4bf4cf;var _0x39557f;return db[_0x918a('0x3e')]['findOne']({'where':{'id':_0x5cfeac[_0x918a('0x57')]['id']}})[_0x918a('0x1d')](handleEntityNotFound(_0x5e89aa,null))[_0x918a('0x1d')](function(_0x66af73){if(_0x66af73){_0x4bf4cf=_0x66af73;_0x5c856c[_0x918a('0x42')]=_[_0x918a('0x45')](db[_0x918a('0xac')][_0x918a('0x3f')]);_0x5c856c[_0x918a('0x44')]=_[_0x918a('0x45')](_0x5cfeac[_0x918a('0x44')]);_0x5c856c[_0x918a('0x46')]=_['intersection'](_0x5c856c[_0x918a('0x42')],_0x5c856c[_0x918a('0x44')]);_0x3a5081[_0x918a('0x47')]=_[_0x918a('0x59')](_0x5c856c[_0x918a('0x42')],qs['fields'](_0x5cfeac[_0x918a('0x44')][_0x918a('0x48')]));_0x3a5081[_0x918a('0x47')]=_0x3a5081[_0x918a('0x47')][_0x918a('0x49')]?_0x3a5081[_0x918a('0x47')]:_0x5c856c[_0x918a('0x42')];_0x3a5081[_0x918a('0x4c')]=qs[_0x918a('0x4d')](_0x5cfeac[_0x918a('0x44')]['sort']);_0x3a5081[_0x918a('0x4e')]=qs[_0x918a('0x46')](_['pick'](_0x5cfeac[_0x918a('0x44')],_0x5c856c[_0x918a('0x46')]));if(_0x5cfeac[_0x918a('0x44')][_0x918a('0x51')]){_0x3a5081['where']=_[_0x918a('0x50')](_0x3a5081[_0x918a('0x4e')],{'$or':_['map'](_0x3a5081[_0x918a('0x47')],function(_0x6ed8f6){var _0x5019db={};_0x5019db[_0x6ed8f6]={'$like':'%'+_0x5cfeac[_0x918a('0x44')][_0x918a('0x51')]+'%'};return _0x5019db;})});}_0x3a5081=_['merge']({},_0x3a5081,_0x5cfeac[_0x918a('0x52')]);return _0x4bf4cf[_0x918a('0xe2')](_0x3a5081);}})[_0x918a('0x1d')](function(_0x278c12){if(_0x278c12){_0x39557f=_0x278c12[_0x918a('0x49')];if(!_0x5cfeac['query'][_0x918a('0x4a')](_0x918a('0x4b'))){_0x3a5081['limit']=qs[_0x918a('0x2f')](_0x5cfeac[_0x918a('0x44')][_0x918a('0x2f')]);_0x3a5081[_0x918a('0x2d')]=qs['offset'](_0x5cfeac['query'][_0x918a('0x2d')]);}return _0x4bf4cf[_0x918a('0xe2')](_0x3a5081);}})[_0x918a('0x1d')](function(_0x295df1){if(_0x295df1){return _0x295df1?{'count':_0x39557f,'rows':_0x295df1}:null;}})[_0x918a('0x1d')](respondWithResult(_0x5e89aa,null))['catch'](handleError(_0x5e89aa,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 1ff6205..0d7bab2 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 _0xb888=['save','remove','emit','hook','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb888,0x184));var _0x8b88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb888[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x8b88('0x0'));var SmsAccount=require(_0x8b88('0x1'))['db'][_0x8b88('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8b88('0x3')](0x0);var events={'afterCreate':_0x8b88('0x4'),'afterUpdate':'update','afterDestroy':_0x8b88('0x5')};function emitEvent(_0x2d7ec1){return function(_0x396e90,_0x1468a1,_0x1022d2){SmsAccountEvents['emit'](_0x2d7ec1+':'+_0x396e90['id'],_0x396e90);SmsAccountEvents[_0x8b88('0x6')](_0x2d7ec1,_0x396e90);_0x1022d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x8b88('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xb28f=['setMaxListeners','save','update','remove','emit','hook','exports','SmsAccount'];(function(_0x346477,_0x1ec366){var _0x1d859a=function(_0x19ba4e){while(--_0x19ba4e){_0x346477['push'](_0x346477['shift']());}};_0x1d859a(++_0x1ec366);}(_0xb28f,0x1c7));var _0xfb28=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb28f[_0x3b0731];return _0x4204d7;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xfb28('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfb28('0x1')](0x0);var events={'afterCreate':_0xfb28('0x2'),'afterUpdate':_0xfb28('0x3'),'afterDestroy':_0xfb28('0x4')};function emitEvent(_0x5b219e){return function(_0x31dbc6,_0x530778,_0x14835a){SmsAccountEvents['emit'](_0x5b219e+':'+_0x31dbc6['id'],_0x31dbc6);SmsAccountEvents[_0xfb28('0x5')](_0x5b219e,_0x31dbc6);_0x14835a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xfb28('0x6')](e,emitEvent(event));}}module[_0xfb28('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 13589aa..24a6e51 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 _0xcf68=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xcf68,0x103));var _0x8cf6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf68[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8cf6('0x0'));var util=require('util');var logger=require(_0x8cf6('0x1'))(_0x8cf6('0x2'));var moment=require(_0x8cf6('0x3'));var BPromise=require('bluebird');var rp=require(_0x8cf6('0x4'));var fs=require('fs');var path=require(_0x8cf6('0x5'));var rimraf=require(_0x8cf6('0x6'));var config=require(_0x8cf6('0x7'));var attributes=require(_0x8cf6('0x8'));module[_0x8cf6('0x9')]=function(_0x1421e1,_0x3804ac){return _0x1421e1[_0x8cf6('0xa')](_0x8cf6('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c5f=['api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','../../config/logger'];(function(_0x249c44,_0x18a728){var _0x50389c=function(_0x882bcc){while(--_0x882bcc){_0x249c44['push'](_0x249c44['shift']());}};_0x50389c(++_0x18a728);}(_0x1c5f,0x1ea));var _0xf1c5=function(_0x4819b7,_0x3f5d2f){_0x4819b7=_0x4819b7-0x0;var _0x5ac37b=_0x1c5f[_0x4819b7];return _0x5ac37b;};'use strict';var _=require(_0xf1c5('0x0'));var util=require('util');var logger=require(_0xf1c5('0x1'))(_0xf1c5('0x2'));var moment=require('moment');var BPromise=require(_0xf1c5('0x3'));var rp=require(_0xf1c5('0x4'));var fs=require('fs');var path=require(_0xf1c5('0x5'));var rimraf=require(_0xf1c5('0x6'));var config=require(_0xf1c5('0x7'));var attributes=require(_0xf1c5('0x8'));module['exports']=function(_0x3d684a,_0x330768){return _0x3d684a[_0xf1c5('0x9')](_0xf1c5('0xa'),attributes,{'tableName':_0xf1c5('0xb'),'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 f199a27..ec31fb2 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 _0x35c3=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','debug','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5ba6ed,_0x51a650){var _0x65cb5a=function(_0x45fca1){while(--_0x45fca1){_0x5ba6ed['push'](_0x5ba6ed['shift']());}};_0x65cb5a(++_0x51a650);}(_0x35c3,0x67));var _0x335c=function(_0x299c33,_0x394650){_0x299c33=_0x299c33-0x0;var _0x2d391e=_0x35c3[_0x299c33];return _0x2d391e;};'use strict';var _=require(_0x335c('0x0'));var util=require(_0x335c('0x1'));var moment=require(_0x335c('0x2'));var BPromise=require(_0x335c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x335c('0x4'));var logger=require(_0x335c('0x5'))(_0x335c('0x6'));var config=require(_0x335c('0x7'));var jayson=require(_0x335c('0x8'));var client=jayson[_0x335c('0x9')][_0x335c('0xa')]({'port':0x232a});config['redis']=_[_0x335c('0xb')](config['redis'],{'host':_0x335c('0xc'),'port':0x18eb});var socket=require(_0x335c('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x209ff9,_0x19f50a,_0x23621b){return new BPromise(function(_0xe43e7e,_0x5ddf55){return client[_0x335c('0xe')](_0x209ff9,_0x23621b)[_0x335c('0xf')](function(_0x39f068){logger[_0x335c('0x10')](_0x335c('0x11'),_0x19f50a,_0x335c('0x12'));logger['debug'](_0x335c('0x13'),_0x19f50a,_0x335c('0x12'),JSON['stringify'](_0x39f068));if(_0x39f068['error']){if(_0x39f068[_0x335c('0x14')][_0x335c('0x15')]===0x1f4){logger['error'](_0x335c('0x11'),_0x19f50a,_0x39f068['error'][_0x335c('0x16')]);return _0x5ddf55(_0x39f068['error'][_0x335c('0x16')]);}logger[_0x335c('0x14')](_0x335c('0x11'),_0x19f50a,_0x39f068[_0x335c('0x14')]['message']);return _0xe43e7e(_0x39f068[_0x335c('0x14')][_0x335c('0x16')]);}else{logger[_0x335c('0x10')](_0x335c('0x11'),_0x19f50a,_0x335c('0x12'));_0xe43e7e(_0x39f068[_0x335c('0x17')][_0x335c('0x16')]);}})[_0x335c('0x18')](function(_0x2efd07){logger['error'](_0x335c('0x11'),_0x19f50a,_0x2efd07);_0x5ddf55(_0x2efd07);});});}exports[_0x335c('0x19')]=function(_0x2bd295){var _0x5ee2cb=this;return new Promise(function(_0x255c01,_0x4319df){return db[_0x335c('0x1a')][_0x335c('0x1b')]({'raw':_0x2bd295[_0x335c('0x1c')]?_0x2bd295[_0x335c('0x1c')][_0x335c('0x1d')]===undefined?!![]:![]:!![],'where':_0x2bd295[_0x335c('0x1c')]?_0x2bd295[_0x335c('0x1c')][_0x335c('0x1e')]||null:null,'attributes':_0x2bd295[_0x335c('0x1c')]?_0x2bd295[_0x335c('0x1c')][_0x335c('0x1f')]||null:null,'include':_0x2bd295[_0x335c('0x1c')]?_0x2bd295[_0x335c('0x1c')]['include']?_[_0x335c('0x20')](_0x2bd295[_0x335c('0x1c')][_0x335c('0x21')],function(_0x43b0d9){return{'model':db[_0x43b0d9[_0x335c('0x22')]],'as':_0x43b0d9['as'],'attributes':_0x43b0d9[_0x335c('0x1f')],'include':_0x43b0d9[_0x335c('0x21')]?_['map'](_0x43b0d9[_0x335c('0x21')],function(_0x391be1){return{'model':db[_0x391be1[_0x335c('0x22')]],'as':_0x391be1['as'],'attributes':_0x391be1[_0x335c('0x1f')],'include':_0x391be1[_0x335c('0x21')]?_[_0x335c('0x20')](_0x391be1[_0x335c('0x21')],function(_0x1c8df7){return{'model':db[_0x1c8df7[_0x335c('0x22')]],'as':_0x1c8df7['as'],'attributes':_0x1c8df7[_0x335c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x335c('0xf')](function(_0x1e0277){logger['info'](_0x335c('0x19'),_0x2bd295);logger[_0x335c('0x23')](_0x335c('0x19'),_0x2bd295,JSON[_0x335c('0x24')](_0x1e0277));_0x255c01(_0x1e0277);})[_0x335c('0x18')](function(_0x25c12f){logger[_0x335c('0x14')](_0x335c('0x19'),_0x25c12f['message'],_0x2bd295);_0x4319df(_0x5ee2cb[_0x335c('0x14')](0x1f4,_0x25c12f[_0x335c('0x16')]));});});}; \ No newline at end of file +var _0x09bf=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','options','raw','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x16c619,_0x6cac5){var _0x87d66c=function(_0x1acdbd){while(--_0x1acdbd){_0x16c619['push'](_0x16c619['shift']());}};_0x87d66c(++_0x6cac5);}(_0x09bf,0xa1));var _0xf09b=function(_0x21aea2,_0x65e0e2){_0x21aea2=_0x21aea2-0x0;var _0x27793c=_0x09bf[_0x21aea2];return _0x27793c;};'use strict';var _=require(_0xf09b('0x0'));var util=require(_0xf09b('0x1'));var moment=require(_0xf09b('0x2'));var BPromise=require(_0xf09b('0x3'));var rs=require(_0xf09b('0x4'));var fs=require('fs');var Redis=require(_0xf09b('0x5'));var db=require(_0xf09b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf09b('0x7'))(_0xf09b('0x8'));var config=require(_0xf09b('0x9'));var jayson=require(_0xf09b('0xa'));var client=jayson[_0xf09b('0xb')]['http']({'port':0x232a});config[_0xf09b('0xc')]=_['defaults'](config['redis'],{'host':_0xf09b('0xd'),'port':0x18eb});var socket=require(_0xf09b('0xe'))(new Redis(config['redis']));require(_0xf09b('0xf'))[_0xf09b('0x10')](socket);function respondWithRpcPromise(_0x159097,_0x2e1c10,_0x29b5a4){return new BPromise(function(_0x5dbf81,_0x2a5488){return client[_0xf09b('0x11')](_0x159097,_0x29b5a4)[_0xf09b('0x12')](function(_0x147f53){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2e1c10,_0xf09b('0x13'));logger[_0xf09b('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e1c10,_0xf09b('0x13'),JSON[_0xf09b('0x15')](_0x147f53));if(_0x147f53[_0xf09b('0x16')]){if(_0x147f53[_0xf09b('0x16')]['code']===0x1f4){logger[_0xf09b('0x16')](_0xf09b('0x17'),_0x2e1c10,_0x147f53[_0xf09b('0x16')][_0xf09b('0x18')]);return _0x2a5488(_0x147f53[_0xf09b('0x16')][_0xf09b('0x18')]);}logger['error'](_0xf09b('0x17'),_0x2e1c10,_0x147f53['error'][_0xf09b('0x18')]);return _0x5dbf81(_0x147f53[_0xf09b('0x16')][_0xf09b('0x18')]);}else{logger['info'](_0xf09b('0x17'),_0x2e1c10,'request\x20sent');_0x5dbf81(_0x147f53[_0xf09b('0x19')][_0xf09b('0x18')]);}})[_0xf09b('0x1a')](function(_0x42635c){logger[_0xf09b('0x16')](_0xf09b('0x17'),_0x2e1c10,_0x42635c);_0x2a5488(_0x42635c);});});}exports[_0xf09b('0x1b')]=function(_0x4d2403){var _0x43810b=this;return new Promise(function(_0x27bfc4,_0x4b5d76){return db['SmsAccount']['find']({'raw':_0x4d2403[_0xf09b('0x1c')]?_0x4d2403[_0xf09b('0x1c')][_0xf09b('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d2403[_0xf09b('0x1c')]?_0x4d2403[_0xf09b('0x1c')]['where']||null:null,'attributes':_0x4d2403[_0xf09b('0x1c')]?_0x4d2403[_0xf09b('0x1c')][_0xf09b('0x1e')]||null:null,'include':_0x4d2403['options']?_0x4d2403['options']['include']?_[_0xf09b('0x1f')](_0x4d2403[_0xf09b('0x1c')][_0xf09b('0x20')],function(_0x238571){return{'model':db[_0x238571[_0xf09b('0x21')]],'as':_0x238571['as'],'attributes':_0x238571[_0xf09b('0x1e')],'include':_0x238571[_0xf09b('0x20')]?_['map'](_0x238571[_0xf09b('0x20')],function(_0x1c0198){return{'model':db[_0x1c0198[_0xf09b('0x21')]],'as':_0x1c0198['as'],'attributes':_0x1c0198['attributes'],'include':_0x1c0198['include']?_[_0xf09b('0x1f')](_0x1c0198[_0xf09b('0x20')],function(_0x37c37e){return{'model':db[_0x37c37e[_0xf09b('0x21')]],'as':_0x37c37e['as'],'attributes':_0x37c37e[_0xf09b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf09b('0x12')](function(_0x62469f){logger['info']('ShowSmsAccount',_0x4d2403);logger['debug'](_0xf09b('0x1b'),_0x4d2403,JSON[_0xf09b('0x15')](_0x62469f));_0x27bfc4(_0x62469f);})[_0xf09b('0x1a')](function(_0x3bad9d){logger[_0xf09b('0x16')](_0xf09b('0x1b'),_0x3bad9d[_0xf09b('0x18')],_0x4d2403);_0x4b5d76(_0x43810b['error'](0x1f4,_0x3bad9d[_0xf09b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 6648a7b..a1f0c81 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 _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 71d4347..69d4ed5 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1dc4a7,_0x91b00e){var _0x96b509=function(_0x179a96){while(--_0x179a96){_0x1dc4a7['push'](_0x1dc4a7['shift']());}};_0x96b509(++_0x91b00e);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a1baa,_0x3185a5){_0x5a1baa=_0x5a1baa-0x0;var _0x3ebe28=_0xedd9[_0x5a1baa];return _0x3ebe28;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1971a0,_0x50cda3){var _0x1f2934=function(_0xe49d16){while(--_0xe49d16){_0x1971a0['push'](_0x1971a0['shift']());}};_0x1f2934(++_0x50cda3);}(_0xedd9,0xfc));var _0x9edd=function(_0x5b5fa1,_0x4597e9){_0x5b5fa1=_0x5b5fa1-0x0;var _0x12a4a4=_0xedd9[_0x5b5fa1];return _0x12a4a4;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d7588bc..cd949c7 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 _0x1e41=['INTEGER','noop','TEXT','STRING','exports'];(function(_0x5cb72e,_0x7ed69f){var _0xfafa53=function(_0xbfb960){while(--_0xbfb960){_0x5cb72e['push'](_0x5cb72e['shift']());}};_0xfafa53(++_0x7ed69f);}(_0x1e41,0x11c));var _0x11e4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1e41[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x11e4('0x0')]={'priority':{'type':Sequelize[_0x11e4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11e4('0x2')},'appdata':{'type':Sequelize[_0x11e4('0x3')]()},'description':{'type':Sequelize[_0x11e4('0x4')]},'interval':{'type':Sequelize[_0x11e4('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x90f8=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x90f8,0x9a));var _0x890f=function(_0x332a2c,_0x7adc98){_0x332a2c=_0x332a2c-0x0;var _0x318f7f=_0x90f8[_0x332a2c];return _0x318f7f;};'use strict';var Sequelize=require(_0x890f('0x0'));module[_0x890f('0x1')]={'priority':{'type':Sequelize[_0x890f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x890f('0x3')],'allowNull':![],'defaultValue':_0x890f('0x4')},'appdata':{'type':Sequelize[_0x890f('0x5')]()},'description':{'type':Sequelize[_0x890f('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 78ec771..fedb778 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 _0x8ec5=['update','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','count','apply','reject','save','destroy','then','status','stack','name','send','index','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','nolimit','limit','sort','where','pick','filters','filter','merge','VIRTUAL','options','SmsApplication','includeAll','findAll','rows','catch','show','params','rawAttributes','create'];(function(_0x573290,_0x286680){var _0x5bbf67=function(_0x4d7525){while(--_0x4d7525){_0x573290['push'](_0x573290['shift']());}};_0x5bbf67(++_0x286680);}(_0x8ec5,0xcf));var _0x58ec=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0x8ec5[_0x1e6e39];return _0x2d9029;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58ec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58ec('0x1'));var rp=require(_0x58ec('0x2'));var moment=require(_0x58ec('0x3'));var BPromise=require(_0x58ec('0x4'));var Mustache=require('mustache');var util=require(_0x58ec('0x5'));var path=require('path');var sox=require(_0x58ec('0x6'));var csv=require(_0x58ec('0x7'));var ejs=require(_0x58ec('0x8'));var fs=require('fs');var fs_extra=require(_0x58ec('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x58ec('0xa'));var deskjs=require(_0x58ec('0xb'));var toCsv=require(_0x58ec('0x7'));var querystring=require(_0x58ec('0xc'));var Papa=require(_0x58ec('0xd'));var Redis=require('ioredis');var authService=require(_0x58ec('0xe'));var qs=require(_0x58ec('0xf'));var as=require(_0x58ec('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58ec('0x11'))(_0x58ec('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x58ec('0x13'))['db'];function respondWithStatusCode(_0x243d43,_0x4a5569){_0x4a5569=_0x4a5569||0xcc;return function(_0x21096d){if(_0x21096d){return _0x243d43[_0x58ec('0x14')](_0x4a5569);}return _0x243d43['status'](_0x4a5569)[_0x58ec('0x15')]();};}function respondWithResult(_0x239794,_0x58acd0){_0x58acd0=_0x58acd0||0xc8;return function(_0x1c6a7f){if(_0x1c6a7f){return _0x239794['status'](_0x58acd0)[_0x58ec('0x16')](_0x1c6a7f);}};}function respondWithFilteredResult(_0x22ab2b,_0x5c7e4b){return function(_0x333315){if(_0x333315){var _0x3c565a=typeof _0x5c7e4b[_0x58ec('0x17')]===_0x58ec('0x18')&&typeof _0x5c7e4b['limit']===_0x58ec('0x18');var _0x2131ed=_0x333315[_0x58ec('0x19')];var _0x2e5376=_0x3c565a?0x0:_0x5c7e4b[_0x58ec('0x17')];var _0x559d8b=_0x3c565a?_0x333315['count']:_0x5c7e4b[_0x58ec('0x17')]+_0x5c7e4b['limit'];var _0x59ee6b;if(_0x559d8b>=_0x2131ed){_0x559d8b=_0x2131ed;_0x59ee6b=0xc8;}else{_0x59ee6b=0xce;}_0x22ab2b['status'](_0x59ee6b);return _0x22ab2b['set']('Content-Range',_0x2e5376+'-'+_0x559d8b+'/'+_0x2131ed)[_0x58ec('0x16')](_0x333315);}return null;};}function patchUpdates(_0x2e10f8){return function(_0x437f51){try{jsonpatch[_0x58ec('0x1a')](_0x437f51,_0x2e10f8,!![]);}catch(_0x5c2d5e){return BPromise[_0x58ec('0x1b')](_0x5c2d5e);}return _0x437f51[_0x58ec('0x1c')]();};}function saveUpdates(_0x5cd0f4,_0x4bdde0){return function(_0x49b5df){if(_0x49b5df){return _0x49b5df['update'](_0x5cd0f4)['then'](function(_0x39ed7d){return _0x39ed7d;});}return null;};}function removeEntity(_0xbdd586,_0x246428){return function(_0x11e9c4){if(_0x11e9c4){return _0x11e9c4[_0x58ec('0x1d')]()[_0x58ec('0x1e')](function(){_0xbdd586[_0x58ec('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ba92b,_0x4f3f5b){return function(_0x5cf87c){if(!_0x5cf87c){_0x4ba92b[_0x58ec('0x14')](0x194);}return _0x5cf87c;};}function handleError(_0x59377e,_0x37bef7){_0x37bef7=_0x37bef7||0x1f4;return function(_0x3b0f12){logger['error'](_0x3b0f12[_0x58ec('0x20')]);if(_0x3b0f12[_0x58ec('0x21')]){delete _0x3b0f12['name'];}_0x59377e[_0x58ec('0x1f')](_0x37bef7)[_0x58ec('0x22')](_0x3b0f12);};}exports[_0x58ec('0x23')]=function(_0x123f5b,_0x185f8a){var _0x276d3e={},_0x5de123={},_0x5cbbaf={'count':0x0,'rows':[]};var _0x550d21=_['map'](db['SmsApplication']['rawAttributes'],function(_0x339130){return{'name':_0x339130[_0x58ec('0x24')],'type':_0x339130[_0x58ec('0x25')][_0x58ec('0x26')]};});_0x5de123['model']=_[_0x58ec('0x27')](_0x550d21,_0x58ec('0x21'));_0x5de123[_0x58ec('0x28')]=_[_0x58ec('0x29')](_0x123f5b['query']);_0x5de123['filters']=_['intersection'](_0x5de123[_0x58ec('0x2a')],_0x5de123[_0x58ec('0x28')]);_0x276d3e[_0x58ec('0x2b')]=_[_0x58ec('0x2c')](_0x5de123['model'],qs[_0x58ec('0x2d')](_0x123f5b[_0x58ec('0x28')][_0x58ec('0x2d')]));_0x276d3e['attributes']=_0x276d3e[_0x58ec('0x2b')]['length']?_0x276d3e['attributes']:_0x5de123[_0x58ec('0x2a')];if(!_0x123f5b['query']['hasOwnProperty'](_0x58ec('0x2e'))){_0x276d3e[_0x58ec('0x2f')]=qs[_0x58ec('0x2f')](_0x123f5b['query']['limit']);_0x276d3e[_0x58ec('0x17')]=qs[_0x58ec('0x17')](_0x123f5b['query']['offset']);}_0x276d3e['order']=qs[_0x58ec('0x30')](_0x123f5b['query'][_0x58ec('0x30')]);_0x276d3e[_0x58ec('0x31')]=qs['filters'](_[_0x58ec('0x32')](_0x123f5b['query'],_0x5de123[_0x58ec('0x33')]),_0x550d21);if(_0x123f5b[_0x58ec('0x28')][_0x58ec('0x34')]){_0x276d3e[_0x58ec('0x31')]=_[_0x58ec('0x35')](_0x276d3e[_0x58ec('0x31')],{'$or':_[_0x58ec('0x27')](_0x550d21,function(_0x550641){if(_0x550641['type']!==_0x58ec('0x36')){var _0x1cacc5={};_0x1cacc5[_0x550641[_0x58ec('0x21')]]={'$like':'%'+_0x123f5b['query'][_0x58ec('0x34')]+'%'};return _0x1cacc5;}})});}_0x276d3e=_[_0x58ec('0x35')]({},_0x276d3e,_0x123f5b[_0x58ec('0x37')]);var _0x3f693e={'where':_0x276d3e['where']};return db[_0x58ec('0x38')]['count'](_0x3f693e)[_0x58ec('0x1e')](function(_0x457354){_0x5cbbaf[_0x58ec('0x19')]=_0x457354;if(_0x123f5b[_0x58ec('0x28')][_0x58ec('0x39')]){_0x276d3e['include']=[{'all':!![]}];}return db['SmsApplication'][_0x58ec('0x3a')](_0x276d3e);})[_0x58ec('0x1e')](function(_0x3fb25e){_0x5cbbaf[_0x58ec('0x3b')]=_0x3fb25e;return _0x5cbbaf;})['then'](respondWithFilteredResult(_0x185f8a,_0x276d3e))[_0x58ec('0x3c')](handleError(_0x185f8a,null));};exports[_0x58ec('0x3d')]=function(_0x43a218,_0x438732){var _0x1ffef8={'raw':!![],'where':{'id':_0x43a218[_0x58ec('0x3e')]['id']}},_0x1efdbc={};_0x1efdbc[_0x58ec('0x2a')]=_[_0x58ec('0x29')](db[_0x58ec('0x38')][_0x58ec('0x3f')]);_0x1efdbc[_0x58ec('0x28')]=_[_0x58ec('0x29')](_0x43a218[_0x58ec('0x28')]);_0x1efdbc[_0x58ec('0x33')]=_['intersection'](_0x1efdbc[_0x58ec('0x2a')],_0x1efdbc[_0x58ec('0x28')]);_0x1ffef8[_0x58ec('0x2b')]=_['intersection'](_0x1efdbc[_0x58ec('0x2a')],qs[_0x58ec('0x2d')](_0x43a218['query'][_0x58ec('0x2d')]));_0x1ffef8['attributes']=_0x1ffef8[_0x58ec('0x2b')]['length']?_0x1ffef8[_0x58ec('0x2b')]:_0x1efdbc['model'];if(_0x43a218['query'][_0x58ec('0x39')]){_0x1ffef8['include']=[{'all':!![]}];}_0x1ffef8=_[_0x58ec('0x35')]({},_0x1ffef8,_0x43a218['options']);return db['SmsApplication']['find'](_0x1ffef8)[_0x58ec('0x1e')](handleEntityNotFound(_0x438732,null))['then'](respondWithResult(_0x438732,null))['catch'](handleError(_0x438732,null));};exports[_0x58ec('0x40')]=function(_0x1448ca,_0x5eab0e){return db[_0x58ec('0x38')][_0x58ec('0x40')](_0x1448ca['body'],{})[_0x58ec('0x1e')](respondWithResult(_0x5eab0e,0xc9))['catch'](handleError(_0x5eab0e,null));};exports[_0x58ec('0x41')]=function(_0xd0ac27,_0x20224b){if(_0xd0ac27[_0x58ec('0x42')]['id']){delete _0xd0ac27['body']['id'];}return db['SmsApplication'][_0x58ec('0x43')]({'where':{'id':_0xd0ac27['params']['id']}})['then'](handleEntityNotFound(_0x20224b,null))[_0x58ec('0x1e')](saveUpdates(_0xd0ac27[_0x58ec('0x42')],null))['then'](respondWithResult(_0x20224b,null))['catch'](handleError(_0x20224b,null));};exports[_0x58ec('0x1d')]=function(_0x2f71ee,_0x6cfd7b){return db[_0x58ec('0x38')][_0x58ec('0x43')]({'where':{'id':_0x2f71ee[_0x58ec('0x3e')]['id']}})[_0x58ec('0x1e')](handleEntityNotFound(_0x6cfd7b,null))[_0x58ec('0x1e')](removeEntity(_0x6cfd7b,null))['catch'](handleError(_0x6cfd7b,null));}; \ No newline at end of file +var _0xa978=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','show','params','intersection','find','create','catch','update','body','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x12d8d9,_0x36e47b){var _0x44f4f3=function(_0xa3935d){while(--_0xa3935d){_0x12d8d9['push'](_0x12d8d9['shift']());}};_0x44f4f3(++_0x36e47b);}(_0xa978,0xd9));var _0x8a97=function(_0x5c512e,_0x23dfb9){_0x5c512e=_0x5c512e-0x0;var _0x95381d=_0xa978[_0x5c512e];return _0x95381d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a97('0x0'));var moment=require(_0x8a97('0x1'));var BPromise=require(_0x8a97('0x2'));var Mustache=require(_0x8a97('0x3'));var util=require(_0x8a97('0x4'));var path=require(_0x8a97('0x5'));var sox=require(_0x8a97('0x6'));var csv=require('to-csv');var ejs=require(_0x8a97('0x7'));var fs=require('fs');var fs_extra=require(_0x8a97('0x8'));var _=require(_0x8a97('0x9'));var squel=require(_0x8a97('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a97('0xb'));var deskjs=require(_0x8a97('0xc'));var toCsv=require(_0x8a97('0xd'));var querystring=require(_0x8a97('0xe'));var Papa=require(_0x8a97('0xf'));var Redis=require('ioredis');var authService=require(_0x8a97('0x10'));var qs=require(_0x8a97('0x11'));var as=require(_0x8a97('0x12'));var hardwareService=require(_0x8a97('0x13'));var logger=require(_0x8a97('0x14'))(_0x8a97('0x15'));var utils=require(_0x8a97('0x16'));var config=require(_0x8a97('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a97('0x18'))['db'];function respondWithStatusCode(_0x10c98f,_0x6e6373){_0x6e6373=_0x6e6373||0xcc;return function(_0x21f8b6){if(_0x21f8b6){return _0x10c98f['sendStatus'](_0x6e6373);}return _0x10c98f['status'](_0x6e6373)[_0x8a97('0x19')]();};}function respondWithResult(_0x33f8dc,_0x162c2f){_0x162c2f=_0x162c2f||0xc8;return function(_0x1d02ef){if(_0x1d02ef){return _0x33f8dc[_0x8a97('0x1a')](_0x162c2f)[_0x8a97('0x1b')](_0x1d02ef);}};}function respondWithFilteredResult(_0x5966b0,_0x4862fc){return function(_0x4459d1){if(_0x4459d1){var _0x4637d4=typeof _0x4862fc[_0x8a97('0x1c')]===_0x8a97('0x1d')&&typeof _0x4862fc[_0x8a97('0x1e')]===_0x8a97('0x1d');var _0x1b6e6c=_0x4459d1[_0x8a97('0x1f')];var _0x418d23=_0x4637d4?0x0:_0x4862fc['offset'];var _0xffdf78=_0x4637d4?_0x4459d1[_0x8a97('0x1f')]:_0x4862fc[_0x8a97('0x1c')]+_0x4862fc['limit'];var _0x40d536;if(_0xffdf78>=_0x1b6e6c){_0xffdf78=_0x1b6e6c;_0x40d536=0xc8;}else{_0x40d536=0xce;}_0x5966b0[_0x8a97('0x1a')](_0x40d536);return _0x5966b0[_0x8a97('0x20')]('Content-Range',_0x418d23+'-'+_0xffdf78+'/'+_0x1b6e6c)[_0x8a97('0x1b')](_0x4459d1);}return null;};}function patchUpdates(_0x52db3e){return function(_0x23a16d){try{jsonpatch[_0x8a97('0x21')](_0x23a16d,_0x52db3e,!![]);}catch(_0x2d624e){return BPromise['reject'](_0x2d624e);}return _0x23a16d['save']();};}function saveUpdates(_0x2e8b9f,_0x4cc54){return function(_0x2aa1da){if(_0x2aa1da){return _0x2aa1da['update'](_0x2e8b9f)[_0x8a97('0x22')](function(_0x225059){return _0x225059;});}return null;};}function removeEntity(_0x439497,_0xb983dc){return function(_0x1f3096){if(_0x1f3096){return _0x1f3096[_0x8a97('0x23')]()[_0x8a97('0x22')](function(){_0x439497[_0x8a97('0x1a')](0xcc)[_0x8a97('0x19')]();});}};}function handleEntityNotFound(_0xc16e39,_0x505996){return function(_0x46f054){if(!_0x46f054){_0xc16e39[_0x8a97('0x24')](0x194);}return _0x46f054;};}function handleError(_0x14c12e,_0x4122ba){_0x4122ba=_0x4122ba||0x1f4;return function(_0x228537){logger[_0x8a97('0x25')](_0x228537[_0x8a97('0x26')]);if(_0x228537[_0x8a97('0x27')]){delete _0x228537[_0x8a97('0x27')];}_0x14c12e[_0x8a97('0x1a')](_0x4122ba)[_0x8a97('0x28')](_0x228537);};}exports[_0x8a97('0x29')]=function(_0x5da692,_0x4f4a80){var _0x356c7c={},_0x2742c5={},_0x508d29={'count':0x0,'rows':[]};var _0x182b11=_['map'](db['SmsApplication'][_0x8a97('0x2a')],function(_0x1e61a4){return{'name':_0x1e61a4[_0x8a97('0x2b')],'type':_0x1e61a4[_0x8a97('0x2c')][_0x8a97('0x2d')]};});_0x2742c5[_0x8a97('0x2e')]=_[_0x8a97('0x2f')](_0x182b11,_0x8a97('0x27'));_0x2742c5['query']=_[_0x8a97('0x30')](_0x5da692['query']);_0x2742c5[_0x8a97('0x31')]=_['intersection'](_0x2742c5[_0x8a97('0x2e')],_0x2742c5[_0x8a97('0x32')]);_0x356c7c['attributes']=_['intersection'](_0x2742c5[_0x8a97('0x2e')],qs['fields'](_0x5da692[_0x8a97('0x32')][_0x8a97('0x33')]));_0x356c7c['attributes']=_0x356c7c[_0x8a97('0x34')][_0x8a97('0x35')]?_0x356c7c[_0x8a97('0x34')]:_0x2742c5[_0x8a97('0x2e')];if(!_0x5da692[_0x8a97('0x32')][_0x8a97('0x36')]('nolimit')){_0x356c7c[_0x8a97('0x1e')]=qs['limit'](_0x5da692['query'][_0x8a97('0x1e')]);_0x356c7c[_0x8a97('0x1c')]=qs[_0x8a97('0x1c')](_0x5da692['query'][_0x8a97('0x1c')]);}_0x356c7c[_0x8a97('0x37')]=qs['sort'](_0x5da692[_0x8a97('0x32')][_0x8a97('0x38')]);_0x356c7c[_0x8a97('0x39')]=qs[_0x8a97('0x31')](_[_0x8a97('0x3a')](_0x5da692['query'],_0x2742c5[_0x8a97('0x31')]),_0x182b11);if(_0x5da692[_0x8a97('0x32')][_0x8a97('0x3b')]){_0x356c7c[_0x8a97('0x39')]=_[_0x8a97('0x3c')](_0x356c7c[_0x8a97('0x39')],{'$or':_['map'](_0x182b11,function(_0x2af262){if(_0x2af262[_0x8a97('0x2c')]!==_0x8a97('0x3d')){var _0x283f0d={};_0x283f0d[_0x2af262[_0x8a97('0x27')]]={'$like':'%'+_0x5da692[_0x8a97('0x32')][_0x8a97('0x3b')]+'%'};return _0x283f0d;}})});}_0x356c7c=_[_0x8a97('0x3c')]({},_0x356c7c,_0x5da692[_0x8a97('0x3e')]);var _0x235b20={'where':_0x356c7c[_0x8a97('0x39')]};return db[_0x8a97('0x3f')][_0x8a97('0x1f')](_0x235b20)[_0x8a97('0x22')](function(_0x5819f9){_0x508d29[_0x8a97('0x1f')]=_0x5819f9;if(_0x5da692[_0x8a97('0x32')][_0x8a97('0x40')]){_0x356c7c[_0x8a97('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0x8a97('0x42')](_0x356c7c);})[_0x8a97('0x22')](function(_0x27c342){_0x508d29[_0x8a97('0x43')]=_0x27c342;return _0x508d29;})[_0x8a97('0x22')](respondWithFilteredResult(_0x4f4a80,_0x356c7c))['catch'](handleError(_0x4f4a80,null));};exports[_0x8a97('0x44')]=function(_0x3c81f4,_0x48fdcd){var _0x4c56a7={'raw':!![],'where':{'id':_0x3c81f4[_0x8a97('0x45')]['id']}},_0x23aacf={};_0x23aacf[_0x8a97('0x2e')]=_[_0x8a97('0x30')](db[_0x8a97('0x3f')][_0x8a97('0x2a')]);_0x23aacf['query']=_['keys'](_0x3c81f4[_0x8a97('0x32')]);_0x23aacf[_0x8a97('0x31')]=_[_0x8a97('0x46')](_0x23aacf[_0x8a97('0x2e')],_0x23aacf[_0x8a97('0x32')]);_0x4c56a7['attributes']=_[_0x8a97('0x46')](_0x23aacf[_0x8a97('0x2e')],qs[_0x8a97('0x33')](_0x3c81f4[_0x8a97('0x32')][_0x8a97('0x33')]));_0x4c56a7[_0x8a97('0x34')]=_0x4c56a7[_0x8a97('0x34')][_0x8a97('0x35')]?_0x4c56a7[_0x8a97('0x34')]:_0x23aacf[_0x8a97('0x2e')];if(_0x3c81f4[_0x8a97('0x32')][_0x8a97('0x40')]){_0x4c56a7[_0x8a97('0x41')]=[{'all':!![]}];}_0x4c56a7=_['merge']({},_0x4c56a7,_0x3c81f4[_0x8a97('0x3e')]);return db[_0x8a97('0x3f')][_0x8a97('0x47')](_0x4c56a7)[_0x8a97('0x22')](handleEntityNotFound(_0x48fdcd,null))['then'](respondWithResult(_0x48fdcd,null))['catch'](handleError(_0x48fdcd,null));};exports['create']=function(_0x4fb494,_0x3b5cfa){return db[_0x8a97('0x3f')][_0x8a97('0x48')](_0x4fb494['body'],{})[_0x8a97('0x22')](respondWithResult(_0x3b5cfa,0xc9))[_0x8a97('0x49')](handleError(_0x3b5cfa,null));};exports[_0x8a97('0x4a')]=function(_0x8eaadd,_0x47811c){if(_0x8eaadd[_0x8a97('0x4b')]['id']){delete _0x8eaadd[_0x8a97('0x4b')]['id'];}return db[_0x8a97('0x3f')][_0x8a97('0x47')]({'where':{'id':_0x8eaadd['params']['id']}})[_0x8a97('0x22')](handleEntityNotFound(_0x47811c,null))[_0x8a97('0x22')](saveUpdates(_0x8eaadd['body'],null))[_0x8a97('0x22')](respondWithResult(_0x47811c,null))[_0x8a97('0x49')](handleError(_0x47811c,null));};exports[_0x8a97('0x23')]=function(_0x14b07f,_0x47dd8d){return db[_0x8a97('0x3f')][_0x8a97('0x47')]({'where':{'id':_0x14b07f[_0x8a97('0x45')]['id']}})[_0x8a97('0x22')](handleEntityNotFound(_0x47dd8d,null))[_0x8a97('0x22')](removeEntity(_0x47dd8d,null))[_0x8a97('0x49')](handleError(_0x47dd8d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9426a0e..b789710 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 _0x9578=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x4bedce,_0x265ebf){var _0x4fd2fb=function(_0x14122b){while(--_0x14122b){_0x4bedce['push'](_0x4bedce['shift']());}};_0x4fd2fb(++_0x265ebf);}(_0x9578,0x89));var _0x8957=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x9578[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x8957('0x0'));var util=require(_0x8957('0x1'));var logger=require(_0x8957('0x2'))(_0x8957('0x3'));var moment=require('moment');var BPromise=require(_0x8957('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8957('0x5'));var rimraf=require('rimraf');var config=require(_0x8957('0x6'));var attributes=require(_0x8957('0x7'));module[_0x8957('0x8')]=function(_0x3d965b,_0x1eeccd){return _0x3d965b[_0x8957('0x9')](_0x8957('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8957('0xb')});}; \ No newline at end of file +var _0xf4e5=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications'];(function(_0x9cd194,_0x2bd0e3){var _0x1950fe=function(_0x1353da){while(--_0x1353da){_0x9cd194['push'](_0x9cd194['shift']());}};_0x1950fe(++_0x2bd0e3);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x4c716c,_0x41588c){_0x4c716c=_0x4c716c-0x0;var _0x305dd9=_0xf4e5[_0x4c716c];return _0x305dd9;};'use strict';var _=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var logger=require(_0x5f4e('0x2'))(_0x5f4e('0x3'));var moment=require(_0x5f4e('0x4'));var BPromise=require(_0x5f4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5f4e('0x6'));var config=require(_0x5f4e('0x7'));var attributes=require(_0x5f4e('0x8'));module['exports']=function(_0x1cff58,_0x44e9e4){return _0x1cff58[_0x5f4e('0x9')](_0x5f4e('0xa'),attributes,{'tableName':_0x5f4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f4e('0xc'),'collate':_0x5f4e('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0bf79ad..ff37ce6 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 _0xdf94=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x412222,_0x5c635e){var _0x33cfd7=function(_0x346c6d){while(--_0x346c6d){_0x412222['push'](_0x412222['shift']());}};_0x33cfd7(++_0x5c635e);}(_0xdf94,0xad));var _0x4df9=function(_0x1f9d3f,_0x170765){_0x1f9d3f=_0x1f9d3f-0x0;var _0x220566=_0xdf94[_0x1f9d3f];return _0x220566;};'use strict';var _=require('lodash');var util=require(_0x4df9('0x0'));var moment=require(_0x4df9('0x1'));var BPromise=require(_0x4df9('0x2'));var rs=require(_0x4df9('0x3'));var fs=require('fs');var Redis=require(_0x4df9('0x4'));var db=require(_0x4df9('0x5'))['db'];var utils=require(_0x4df9('0x6'));var logger=require(_0x4df9('0x7'))(_0x4df9('0x8'));var config=require(_0x4df9('0x9'));var jayson=require(_0x4df9('0xa'));var client=jayson[_0x4df9('0xb')][_0x4df9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f46e3,_0x34faba,_0x2fac37){return new BPromise(function(_0x39ebc3,_0xf808f0){return client['request'](_0x2f46e3,_0x2fac37)[_0x4df9('0xd')](function(_0x3eaca1){logger[_0x4df9('0xe')](_0x4df9('0xf'),_0x34faba,_0x4df9('0x10'));logger[_0x4df9('0x11')](_0x4df9('0x12'),_0x34faba,'request\x20sent',JSON['stringify'](_0x3eaca1));if(_0x3eaca1[_0x4df9('0x13')]){if(_0x3eaca1['error'][_0x4df9('0x14')]===0x1f4){logger[_0x4df9('0x13')](_0x4df9('0xf'),_0x34faba,_0x3eaca1[_0x4df9('0x13')]['message']);return _0xf808f0(_0x3eaca1[_0x4df9('0x13')][_0x4df9('0x15')]);}logger[_0x4df9('0x13')]('SmsApplication,\x20%s,\x20%s',_0x34faba,_0x3eaca1[_0x4df9('0x13')][_0x4df9('0x15')]);return _0x39ebc3(_0x3eaca1[_0x4df9('0x13')]['message']);}else{logger[_0x4df9('0xe')]('SmsApplication,\x20%s,\x20%s',_0x34faba,_0x4df9('0x10'));_0x39ebc3(_0x3eaca1[_0x4df9('0x16')][_0x4df9('0x15')]);}})[_0x4df9('0x17')](function(_0x5d2910){logger[_0x4df9('0x13')](_0x4df9('0xf'),_0x34faba,_0x5d2910);_0xf808f0(_0x5d2910);});});} \ No newline at end of file +var _0x186d=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x186d,0x1ca));var _0xd186=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x186d[_0x48b5e0];return _0x4287ea;};'use strict';var _=require('lodash');var util=require(_0xd186('0x0'));var moment=require(_0xd186('0x1'));var BPromise=require(_0xd186('0x2'));var rs=require(_0xd186('0x3'));var fs=require('fs');var Redis=require(_0xd186('0x4'));var db=require(_0xd186('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd186('0x6'))(_0xd186('0x7'));var config=require(_0xd186('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd186('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x60fc96,_0x2ecccd,_0x4970a3){return new BPromise(function(_0x36fdc3,_0xd76bc8){return client[_0xd186('0xa')](_0x60fc96,_0x4970a3)['then'](function(_0x1ef64a){logger[_0xd186('0xb')](_0xd186('0xc'),_0x2ecccd,_0xd186('0xd'));logger[_0xd186('0xe')](_0xd186('0xf'),_0x2ecccd,'request\x20sent',JSON['stringify'](_0x1ef64a));if(_0x1ef64a[_0xd186('0x10')]){if(_0x1ef64a['error'][_0xd186('0x11')]===0x1f4){logger[_0xd186('0x10')](_0xd186('0xc'),_0x2ecccd,_0x1ef64a['error'][_0xd186('0x12')]);return _0xd76bc8(_0x1ef64a['error'][_0xd186('0x12')]);}logger[_0xd186('0x10')](_0xd186('0xc'),_0x2ecccd,_0x1ef64a[_0xd186('0x10')][_0xd186('0x12')]);return _0x36fdc3(_0x1ef64a[_0xd186('0x10')][_0xd186('0x12')]);}else{logger[_0xd186('0xb')](_0xd186('0xc'),_0x2ecccd,_0xd186('0xd'));_0x36fdc3(_0x1ef64a[_0xd186('0x13')]['message']);}})[_0xd186('0x14')](function(_0x94b224){logger[_0xd186('0x10')](_0xd186('0xc'),_0x2ecccd,_0x94b224);_0xd76bc8(_0x94b224);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 68db2d8..f4ae9d8 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 _0x9354=['/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x153107,_0x2779f8){var _0x29519e=function(_0x93ba4a){while(--_0x93ba4a){_0x153107['push'](_0x153107['shift']());}};_0x29519e(++_0x2779f8);}(_0x9354,0x96));var _0x4935=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9354[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x4935('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),interaction[_0x4935('0x16')](_0x4935('0x17'),_0x4935('0x18')),controller[_0x4935('0x19')]);router[_0x4935('0x1a')](_0x4935('0xd'),auth[_0x4935('0x9')](),interaction[_0x4935('0x16')]('sms',_0x4935('0x1b')),controller[_0x4935('0x1c')]);router[_0x4935('0x1d')](_0x4935('0xd'),auth[_0x4935('0x9')](),interaction[_0x4935('0x16')]('sms',_0x4935('0x1e')),controller[_0x4935('0x1f')]);router['delete'](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x20')]);module['exports']=router; \ No newline at end of file +var _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x58025a,_0x1f4ae9){var _0x2d89bc=function(_0x2952d9){while(--_0x2952d9){_0x58025a['push'](_0x58025a['shift']());}};_0x2d89bc(++_0x1f4ae9);}(_0x6324,0x142));var _0x4632=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x6324[_0x421e36];return _0x20b3e3;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('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 e09c213..f7d1ca9 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 _0x4aa3=['sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4aa3,0x174));var _0x34aa=function(_0x28398d,_0xbfe141){_0x28398d=_0x28398d-0x0;var _0x4fdc3d=_0x4aa3[_0x28398d];return _0x4fdc3d;};'use strict';var Sequelize=require(_0x34aa('0x0'));var moment=require(_0x34aa('0x1'));module['exports']={'closed':{'type':Sequelize[_0x34aa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x34aa('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x34aa('0x4')]},'thirdDisposition':{'type':Sequelize[_0x34aa('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x34aa('0x4')]},'read1stAt':{'type':Sequelize[_0x34aa('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x34aa('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x34aa('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x34aa('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x34aa('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9a14=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a14,0xa8));var _0x49a1=function(_0xf8ba59,_0x26eb0a){_0xf8ba59=_0xf8ba59-0x0;var _0x4a31cc=_0x9a14[_0xf8ba59];return _0x4a31cc;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x49a1('0x0')]={'closed':{'type':Sequelize[_0x49a1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x49a1('0x2')]},'disposition':{'type':Sequelize[_0x49a1('0x3')]},'secondDisposition':{'type':Sequelize[_0x49a1('0x3')]},'thirdDisposition':{'type':Sequelize[_0x49a1('0x3')]},'note':{'type':Sequelize[_0x49a1('0x3')]},'phone':{'type':Sequelize[_0x49a1('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x49a1('0x4')]('in',_0x49a1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x49a1('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ea0763c..2273b47 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 _0x188e=['log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','error','stack','name','send','Users','fullname','TagIds','Tags','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','SmsInteraction','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','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','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','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)','getFullTextValue','ContactId','buildExpression','text','end','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','compact','SmsAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','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?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','isEmpty','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','params','includeAll','include','create','update','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','omit','spread','emit','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','read','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','direction','System','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML'];(function(_0x4eb2df,_0x262791){var _0x434c3c=function(_0x1f475d){while(--_0x1f475d){_0x4eb2df['push'](_0x4eb2df['shift']());}};_0x434c3c(++_0x262791);}(_0x188e,0x1df));var _0xe188=function(_0x18ae93,_0x29a039){_0x18ae93=_0x18ae93-0x0;var _0x4272e0=_0x188e[_0x18ae93];return _0x4272e0;};'use strict';var emlformat=require(_0xe188('0x0'));var rimraf=require(_0xe188('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe188('0x2'));var moment=require(_0xe188('0x3'));var BPromise=require(_0xe188('0x4'));var Mustache=require(_0xe188('0x5'));var util=require(_0xe188('0x6'));var path=require(_0xe188('0x7'));var sox=require(_0xe188('0x8'));var csv=require(_0xe188('0x9'));var ejs=require(_0xe188('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe188('0xb'));var jsforce=require(_0xe188('0xc'));var deskjs=require(_0xe188('0xd'));var toCsv=require(_0xe188('0x9'));var querystring=require('querystring');var Papa=require(_0xe188('0xe'));var Redis=require(_0xe188('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe188('0x10'));var as=require(_0xe188('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe188('0x12'));var logger=require(_0xe188('0x13'))(_0xe188('0x14'));var utils=require(_0xe188('0x15'));var config=require(_0xe188('0x16'));var licenseUtil=require(_0xe188('0x17'));var db=require(_0xe188('0x18'))['db'];config[_0xe188('0x19')]=_[_0xe188('0x1a')](config[_0xe188('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0xe0bf59,_0x3b0795){_0x3b0795=_0x3b0795||0xcc;return function(_0x15baa4){if(_0x15baa4){return _0xe0bf59['sendStatus'](_0x3b0795);}return _0xe0bf59[_0xe188('0x1b')](_0x3b0795)['end']();};}function respondWithResult(_0x5d36f1,_0x204c9d){_0x204c9d=_0x204c9d||0xc8;return function(_0xc08f7d){if(_0xc08f7d){return _0x5d36f1[_0xe188('0x1b')](_0x204c9d)[_0xe188('0x1c')](_0xc08f7d);}};}function respondWithFilteredResult(_0x5d64ee,_0x1a76e1){return function(_0x933bcb){if(_0x933bcb){var _0x1af45c=typeof _0x1a76e1[_0xe188('0x1d')]===_0xe188('0x1e')&&typeof _0x1a76e1['limit']==='undefined';var _0x3f84f9=_0x933bcb[_0xe188('0x1f')];var _0x800257=_0x1af45c?0x0:_0x1a76e1[_0xe188('0x1d')];var _0x5b38ff=_0x1af45c?_0x933bcb['count']:_0x1a76e1[_0xe188('0x1d')]+_0x1a76e1[_0xe188('0x20')];var _0x48568e;if(_0x5b38ff>=_0x3f84f9){_0x5b38ff=_0x3f84f9;_0x48568e=0xc8;}else{_0x48568e=0xce;}_0x5d64ee['status'](_0x48568e);return _0x5d64ee[_0xe188('0x21')](_0xe188('0x22'),_0x800257+'-'+_0x5b38ff+'/'+_0x3f84f9)[_0xe188('0x1c')](_0x933bcb);}return null;};}function patchUpdates(_0x5d5b84){return function(_0x3da89f){try{jsonpatch['apply'](_0x3da89f,_0x5d5b84,!![]);}catch(_0x5077c9){return BPromise[_0xe188('0x23')](_0x5077c9);}return _0x3da89f['save']();};}function saveUpdates(_0x4f5505,_0x1a262e){return function(_0x15edff){if(_0x15edff){return _0x15edff['update'](_0x4f5505)[_0xe188('0x24')](function(_0x180c50){return _0x180c50;});}return null;};}function removeEntity(_0xe6b309,_0x1df0ea){return function(_0x2121b7){if(_0x2121b7){return _0x2121b7['destroy']()[_0xe188('0x24')](function(){_0xe6b309[_0xe188('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17cd86,_0x12ec02){return function(_0x43d987){if(!_0x43d987){_0x17cd86['sendStatus'](0x194);}return _0x43d987;};}function handleError(_0x57d58c,_0x57378a){_0x57378a=_0x57378a||0x1f4;return function(_0x595927){logger[_0xe188('0x25')](_0x595927[_0xe188('0x26')]);if(_0x595927[_0xe188('0x27')]){delete _0x595927[_0xe188('0x27')];}_0x57d58c[_0xe188('0x1b')](_0x57378a)[_0xe188('0x28')](_0x595927);};}function getInteractionUsers(_0xf3dfac,_0x3f9741){return new BPromise(function(_0x6871a6,_0x126d49){try{if(_0x3f9741[_0xf3dfac['id']]){_0xf3dfac[_0xe188('0x29')]=_['map'](_0x3f9741[_0xf3dfac['id']],function(_0x37eb13){return{'id':_0x37eb13['id'],'fullname':_0x37eb13[_0xe188('0x2a')]};});}}catch(_0xf7efc0){_0x126d49(_0xf7efc0);}_0x6871a6(_0xf3dfac);});}function getInteractionTags(_0x4c3581,_0x2ea2f7){return new BPromise(function(_0x51df32,_0x5cc0da){try{if(_0x4c3581[_0xe188('0x2b')]){_0x4c3581[_0xe188('0x2c')]=[];_0x4c3581[_0xe188('0x2b')]['split'](',')['forEach'](function(_0x3721be){_0x4c3581[_0xe188('0x2c')][_0xe188('0x2d')](_0x2ea2f7[_0x3721be]);});}delete _0x4c3581['TagIds'];}catch(_0x29bb18){_0x5cc0da(_0x29bb18);}_0x51df32(_0x4c3581);});}function updateSmsInteraction(_0x4a0be9,_0x4c70ff,_0x31aa30){return new BPromise(function(_0x255e19,_0x47025d){return getInteractionUsers(_0x4a0be9,_0x31aa30)[_0xe188('0x24')](function(_0x4ad546){return getInteractionTags(_0x4ad546,_0x4c70ff);})['then'](function(_0x54bc40){return getStateInteraction(_0x54bc40);})[_0xe188('0x24')](function(_0x6be505){_0x255e19(_0x6be505);})[_0xe188('0x2e')](function(_0x2aed8b){_0x47025d(_0x2aed8b);});});}function getStateInteraction(_0x47e8e4){return new BPromise(function(_0x217183){_0x47e8e4[_0xe188('0x2f')]=0x0;_0x47e8e4['talking']=0x0;_0x47e8e4[_0xe188('0x30')]=0x0;_0x47e8e4[_0xe188('0x31')]=0x0;_0x47e8e4[_0xe188('0x32')]=0x0;if(!_0x47e8e4[_0xe188('0x33')]&&!_0x47e8e4[_0xe188('0x34')]){_0x47e8e4[_0xe188('0x2f')]+=0x1;}if(!_0x47e8e4['closed']&&_0x47e8e4[_0xe188('0x34')]){_0x47e8e4[_0xe188('0x35')]+=0x1;if(_0x47e8e4['waiting']){_0x47e8e4[_0xe188('0x2f')]-=0x1;}}if(_0x47e8e4[_0xe188('0x33')]&&_0x47e8e4[_0xe188('0x34')]){_0x47e8e4[_0xe188('0x30')]+=0x1;if(_0x47e8e4[_0xe188('0x35')]){_0x47e8e4[_0xe188('0x35')]-=0x1;}}if(_0x47e8e4[_0xe188('0x33')]&&!_0x47e8e4[_0xe188('0x34')]){_0x47e8e4[_0xe188('0x31')]+=0x1;if(_0x47e8e4[_0xe188('0x2f')]){_0x47e8e4[_0xe188('0x2f')]-=0x1;}}_0x47e8e4[_0xe188('0x32')]+=0x1;_0x217183(_0x47e8e4);});}exports[_0xe188('0x36')]=function(_0x236483,_0x4a9fee){var _0x2675b3={},_0x536700={},_0x5e00a8={'count':0x0,'rows':[]};var _0x38f0dc=_[_0xe188('0x37')](db[_0xe188('0x38')]['rawAttributes'],function(_0x9e83f5){return{'name':_0x9e83f5[_0xe188('0x39')],'type':_0x9e83f5[_0xe188('0x3a')][_0xe188('0x3b')]};});_0x536700['model']=_['map'](_0x38f0dc,_0xe188('0x27'));_0x536700[_0xe188('0x3c')]=_[_0xe188('0x3d')](_0x236483[_0xe188('0x3c')]);_0x536700[_0xe188('0x3e')]=_['intersection'](_0x536700[_0xe188('0x3f')],_0x536700['query']);_0x2675b3['attributes']=_[_0xe188('0x40')](_0x536700[_0xe188('0x3f')],qs[_0xe188('0x41')](_0x236483[_0xe188('0x3c')][_0xe188('0x41')]));_0x2675b3[_0xe188('0x42')]=_0x2675b3[_0xe188('0x42')][_0xe188('0x43')]?_0x2675b3[_0xe188('0x42')]:_0x536700[_0xe188('0x3f')];if(!_0x236483['query'][_0xe188('0x44')](_0xe188('0x45'))){_0x2675b3[_0xe188('0x20')]=qs['limit'](_0x236483[_0xe188('0x3c')][_0xe188('0x20')]);_0x2675b3[_0xe188('0x1d')]=qs[_0xe188('0x1d')](_0x236483['query'][_0xe188('0x1d')]);}_0x2675b3[_0xe188('0x46')]=qs[_0xe188('0x47')](_0x236483[_0xe188('0x3c')]['sort']);_0x2675b3[_0xe188('0x48')]=qs['filters'](_['pick'](_0x236483[_0xe188('0x3c')],_0x536700['filters']),_0x38f0dc);var _0x2bff7=[];var _0x37b176=squel['select']()[_0xe188('0x49')]('id')[_0xe188('0x49')](_0xe188('0x27'))[_0xe188('0x49')](_0xe188('0x4a'))[_0xe188('0x4b')](_0xe188('0x4c'));var _0x3df062=squel[_0xe188('0x4d')]()[_0xe188('0x49')](_0xe188('0x4e'))[_0xe188('0x49')](_0xe188('0x4f'))[_0xe188('0x49')]('ui.SmsInteractionId')[_0xe188('0x4b')](_0xe188('0x50'),'ui')[_0xe188('0x51')](_0xe188('0x52'),'u',_0xe188('0x53'));var _0x575fd3=squel[_0xe188('0x4d')]()[_0xe188('0x4b')](_0xe188('0x54'),'i')[_0xe188('0x51')](_0xe188('0x55'),'c',_0xe188('0x56'))[_0xe188('0x51')](_0xe188('0x52'),'o',_0xe188('0x57'))[_0xe188('0x51')]('sms_accounts','a',_0xe188('0x58'))['left_join'](_0xe188('0x59'),'me',_0xe188('0x5a'))[_0xe188('0x51')](_0xe188('0x5b'),'it',_0xe188('0x5c'))[_0xe188('0x51')](_0xe188('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x21b232=squel[_0xe188('0x5d')]();var _0x26d571=[];var _0x1ca11e=squel[_0xe188('0x5d')]();var _0x5ef249;if(_0x236483['query'][_0xe188('0x5e')]){_0x5ef249=as[_0xe188('0x5f')](_0x236483[_0xe188('0x3c')]['search']);var _0x683b0a=_0x5ef249[_0xe188('0x60')];for(var _0xa5dce6=0x0;_0xa5dce6<_0x5ef249['conditions'][_0xe188('0x43')];_0xa5dce6++){var _0x41e4fd=_0x5ef249[_0xe188('0x61')][_0xa5dce6];var _0xb1500c='i';var _0x575f11=_[_0xe188('0x62')](_0x38f0dc,[_0xe188('0x27'),_0x41e4fd[_0xe188('0x49')]]);if(!_0x575f11){switch(_0x41e4fd['field']){case _0xe188('0x63'):if(_0x41e4fd[_0xe188('0x64')]==0x1){_0x575fd3[_0xe188('0x65')]('`'+_0x41e4fd[_0xe188('0x49')]+'`\x20=\x200');}else{_0x575fd3[_0xe188('0x65')]('`'+_0x41e4fd[_0xe188('0x49')]+_0xe188('0x66'));}break;case _0xe188('0x67'):if(_0x41e4fd[_0xe188('0x68')]==='$substring'){if(_0x41e4fd[_0xe188('0x64')]['split']('\x20')[_0xe188('0x43')]>0x1){_0x21b232[_0x683b0a](_0xe188('0x69'),qs[_0xe188('0x6a')](_0x41e4fd[_0xe188('0x64')]),null);}else{var _0x17b240='%'+_0x41e4fd[_0xe188('0x64')]+'%';_0x21b232[_0x683b0a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x17b240,_0x17b240,_0x17b240);}}else{_0x575f11=_[_0xe188('0x62')](_0x38f0dc,[_0xe188('0x27'),_0xe188('0x6b')]);_0x41e4fd['field']=_0xe188('0x6b');_0x29b3fd=as[_0xe188('0x6c')](_0xb1500c,_0x575f11['type'],_0x41e4fd);_0x21b232[_0x683b0a](_0x29b3fd[_0xe188('0x6d')],_0x29b3fd[_0xe188('0x64')]['start'],_0x29b3fd['value'][_0xe188('0x6e')]);}break;case _0xe188('0x6f'):var _0x208152=_0x41e4fd[_0xe188('0x64')][_0xe188('0x70')](',')['map'](function(_0x430683){return Number(_0x430683);});_0x208152[_0xe188('0x71')](function(_0x1ed50b){_0x1ca11e['or'](_0xe188('0x72'),'%,'+_0x1ed50b+',%');});_0x26d571=_[_0xe188('0x73')](_0x26d571,_0x208152);break;case _0xe188('0x74'):if(_0x41e4fd['operator']==='$substring'){_0x21b232[_0x683b0a](_0xe188('0x75'),'%'+_0x41e4fd[_0xe188('0x64')]+'%',null);}else{_0x575f11=_[_0xe188('0x62')](_0x38f0dc,[_0xe188('0x27'),_0xe188('0x34')]);_0x41e4fd['field']=_0xe188('0x34');_0x29b3fd=as[_0xe188('0x6c')](_0xb1500c,_0x575f11[_0xe188('0x3a')],_0x41e4fd);_0x21b232[_0x683b0a](_0x29b3fd['text'],_0x29b3fd['value'][_0xe188('0x76')],_0x29b3fd[_0xe188('0x64')][_0xe188('0x6e')]);}break;case _0xe188('0x77'):_0x29b3fd=as[_0xe188('0x6c')]('me',null,_0x41e4fd);_0x21b232[_0x683b0a](_0x29b3fd[_0xe188('0x6d')],_0x29b3fd[_0xe188('0x64')][_0xe188('0x76')],_0x29b3fd[_0xe188('0x64')][_0xe188('0x6e')]);break;}}else{var _0x29b3fd=as['buildExpression'](_0xb1500c,_0x575f11[_0xe188('0x3a')],_0x41e4fd);_0x21b232[_0x683b0a](_0x29b3fd['text'],_0x29b3fd[_0xe188('0x64')][_0xe188('0x76')],_0x29b3fd[_0xe188('0x64')][_0xe188('0x6e')]);}}}else{var _0x3998f4=_(_0x236483[_0xe188('0x3c')])['keys']()[_0xe188('0x37')](function(_0x4f0d80){return _['some'](_0x38f0dc,['name',_0x4f0d80])?_0x4f0d80:undefined;})[_0xe188('0x78')]()[_0xe188('0x64')]();if(!_['isEmpty'](_0x3998f4)){_0x3998f4[_0xe188('0x71')](function(_0x3987d9){if(_0x3987d9===_0xe188('0x79')){_0x575fd3['where']('i.SmsAccountId\x20IN\x20?',[][_0xe188('0x7a')](_0x236483[_0xe188('0x3c')][_0x3987d9]));}else if(_0x3987d9===_0xe188('0x7b')){var _0x83e23e=JSON['parse'](_0x236483['query'][_0x3987d9])[_0xe188('0x7c')];var _0x126df1=JSON[_0xe188('0x7d')](_0x236483[_0xe188('0x3c')][_0x3987d9])[_0xe188('0x7e')];_0x575fd3['where'](_0xe188('0x7f'),_0x83e23e,_0x126df1);}else{if(_0x236483['query'][_0x3987d9]==='null'){_0x575fd3['where']('i.'+_0x3987d9+_0xe188('0x80'));}else{_0x575fd3['where']('i.'+_0x3987d9+_0xe188('0x81'),_0x236483[_0xe188('0x3c')][_0x3987d9]);}}});}if(_0x236483['query']['read']){if(_0x236483[_0xe188('0x3c')]['read']==0x1){_0x575fd3[_0xe188('0x65')](_0xe188('0x82'));}else{_0x575fd3[_0xe188('0x65')](_0xe188('0x83'));}}if(_0x236483['query']['tag']){_0x26d571=_[_0xe188('0x84')](_0x236483[_0xe188('0x3c')]['tag'])?_0x236483['query']['tag']:new Array(_0x236483['query'][_0xe188('0x85')]);_0x26d571[_0xe188('0x71')](function(_0x55183f){_0x1ca11e['or'](_0xe188('0x72'),'%,'+_0x55183f+',%');});}if(_0x236483[_0xe188('0x3c')][_0xe188('0x86')]){var _0x2e995c=_0x236483[_0xe188('0x3c')][_0xe188('0x86')][_0xe188('0x87')]('\x5c','\x5c\x5c')[_0xe188('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2e995c)){_0x21b232['or'](_0xe188('0x88'),_0x2e995c+'%')['or'](_0xe188('0x89'),_0x2e995c+'%');}else{_0x21b232['or'](_0xe188('0x8a'),qs['getFullTextValue'](_0x2e995c))['or'](_0xe188('0x8b'),_0x2e995c+'%');}}}_0x575fd3[_0xe188('0x48')](_0x21b232);_0x575fd3[_0xe188('0x8c')](_0xe188('0x8d'));var _0x386c84={'type':db[_0xe188('0x8e')][_0xe188('0x8f')][_0xe188('0x90')],'raw':!![]};var _0x41a6ad=_0x575fd3[_0xe188('0x91')]();_0x41a6ad[_0xe188('0x49')](_0xe188('0x8d'));_0x41a6ad['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe188('0x63'));if(_0x2675b3[_0xe188('0x46')]){_0x2675b3['order'][_0xe188('0x71')](function(_0x67d871){var _0xbf0b78=_0x67d871[0x0]===_0xe188('0x92')?_0x67d871[0x0]:'i.'+_0x67d871[0x0];_0x575fd3[_0xe188('0x46')](_0xbf0b78,_0x67d871[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe188('0x93')](_0x26d571)){_0x575fd3[_0xe188('0x65')](_0x1ca11e);_0x41a6ad['where']('t.id\x20IN\x20?',_0x26d571);}BPromise['resolve']()['then'](function(){if(!_0x5ef249){if(_0x236483['query'][_0xe188('0x79')])return;_0x41a6ad[_0xe188('0x48')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x575fd3[_0xe188('0x48')](_0xe188('0x94'));return;}if(_0x236483[_0xe188('0x95')][_0xe188('0x96')]!=='agent')return;return _0x236483[_0xe188('0x95')][_0xe188('0x97')]({'attributes':['id'],'raw':!![]})[_0xe188('0x24')](function(_0x4909d1){if(_[_0xe188('0x93')](_0x4909d1)){_0x41a6ad[_0xe188('0x48')](_0xe188('0x98'));_0x575fd3['where'](_0xe188('0x98'));}else{_0x41a6ad['where']('i.SmsAccountId\x20IN\x20?',_[_0xe188('0x37')](_0x4909d1,'id'));_0x575fd3[_0xe188('0x48')](_0xe188('0x99'),_['map'](_0x4909d1,'id'));}});})['then'](function(){if(_0x236483['user']['role']===_0xe188('0x9a')&&!_0x5ef249&&!_0x236483[_0xe188('0x3c')][_0xe188('0x79')])return[];return db[_0xe188('0x9b')][_0xe188('0x3c')](_0x41a6ad['toString'](),_0x386c84);})[_0xe188('0x24')](function(_0x39996c){_0x5e00a8['count']=_0x39996c[_0xe188('0x43')];if(_0x5e00a8[_0xe188('0x1f')]===0x0)return[];return db[_0xe188('0x9b')][_0xe188('0x3c')](_0x37b176[_0xe188('0x9c')](),_0x386c84)['then'](function(_0x191b61){_0x2bff7=_['keyBy'](_0x191b61,'id');_0x386c84=_[_0xe188('0x9d')](_0x386c84,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x236483[_0xe188('0x3c')]['fields']){_0x2675b3[_0xe188('0x42')][_0xe188('0x71')](function(_0x169e61){_0x575fd3[_0xe188('0x49')]('i.'+_0x169e61);});}else{_0x575fd3[_0xe188('0x49')](_0xe188('0x9e'),_0xe188('0x63'));_0x575fd3['field']('a.key',_0xe188('0x9f'));_0x575fd3[_0xe188('0x49')](_0xe188('0xa0'),_0xe188('0xa1'));_0x575fd3['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe188('0x92'));_0x575fd3[_0xe188('0x49')](_0xe188('0xa2'));_0x575fd3[_0xe188('0x49')]('c.firstName','Contact.firstName');_0x575fd3[_0xe188('0x49')](_0xe188('0xa3'),_0xe188('0xa4'));_0x575fd3['field']('c.email','Contact.email');_0x575fd3['field'](_0xe188('0xa5'),_0xe188('0xa6'));_0x575fd3['field'](_0xe188('0xa7'),'Contact.mobile');_0x575fd3[_0xe188('0x49')](_0xe188('0xa8'),_0xe188('0xa9'));_0x575fd3[_0xe188('0x49')](_0xe188('0xaa'),_0xe188('0xab'));_0x575fd3[_0xe188('0x49')](_0xe188('0xac'),_0xe188('0xad'));_0x575fd3[_0xe188('0x49')](_0xe188('0xae'),_0xe188('0x2b'));}if(_0x2675b3[_0xe188('0x20')])_0x575fd3[_0xe188('0x20')](_0x2675b3['limit']);if(_0x2675b3[_0xe188('0x1d')])_0x575fd3['offset'](_0x2675b3[_0xe188('0x1d')]);return db[_0xe188('0x9b')][_0xe188('0x3c')](_0x575fd3[_0xe188('0x9c')](),_0x386c84);})[_0xe188('0x24')](function(_0x19d2e4){if(_0x19d2e4[_0xe188('0x43')]>0x0)_0x3df062['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x19d2e4,'id'));return db[_0xe188('0x9b')][_0xe188('0x3c')](_0x3df062[_0xe188('0x9c')](),_0x386c84)[_0xe188('0x24')](function(_0x12d662){var _0x1f06d8=_[_0xe188('0xaf')](_0x12d662,_0xe188('0xb0'));var _0x2a08f7=[];_0x19d2e4[_0xe188('0x71')](function(_0x1befc0){_0x2a08f7[_0xe188('0x2d')](updateSmsInteraction(_0x1befc0,_0x2bff7,_0x1f06d8));});return BPromise[_0xe188('0xb1')](_0x2a08f7);});});})[_0xe188('0x24')](function(_0xa257f2){_0x5e00a8[_0xe188('0xb2')]=_0xa257f2;return _0x5e00a8;})[_0xe188('0x24')](respondWithFilteredResult(_0x4a9fee,_0x2675b3))[_0xe188('0x2e')](handleError(_0x4a9fee,null));};exports['show']=function(_0x576bed,_0x244902){var _0x1f4961={'raw':![],'where':{'id':_0x576bed[_0xe188('0xb3')]['id']}},_0x1fd9a2={};_0x1fd9a2['model']=_[_0xe188('0x3d')](db[_0xe188('0x38')]['rawAttributes']);_0x1fd9a2[_0xe188('0x3c')]=_['keys'](_0x576bed[_0xe188('0x3c')]);_0x1fd9a2[_0xe188('0x3e')]=_[_0xe188('0x40')](_0x1fd9a2['model'],_0x1fd9a2[_0xe188('0x3c')]);_0x1f4961[_0xe188('0x42')]=_[_0xe188('0x40')](_0x1fd9a2[_0xe188('0x3f')],qs['fields'](_0x576bed[_0xe188('0x3c')]['fields']));_0x1f4961[_0xe188('0x42')]=_0x1f4961[_0xe188('0x42')]['length']?_0x1f4961[_0xe188('0x42')]:_0x1fd9a2[_0xe188('0x3f')];if(_0x576bed['query'][_0xe188('0xb4')]){_0x1f4961[_0xe188('0xb5')]=[{'all':!![]}];}_0x1f4961=_[_0xe188('0x9d')]({},_0x1f4961,_0x576bed['options']);return db[_0xe188('0x38')][_0xe188('0x62')](_0x1f4961)[_0xe188('0x24')](handleEntityNotFound(_0x244902,null))[_0xe188('0x24')](respondWithResult(_0x244902,null))[_0xe188('0x2e')](handleError(_0x244902,null));};exports[_0xe188('0xb6')]=function(_0x511710,_0x485ebc){return db['SmsInteraction'][_0xe188('0xb6')](_0x511710[_0xe188('0x77')],{})[_0xe188('0x24')](respondWithResult(_0x485ebc,0xc9))[_0xe188('0x2e')](handleError(_0x485ebc,null));};exports[_0xe188('0xb7')]=function(_0x16fb61,_0x171bf1){if(_0x16fb61[_0xe188('0x77')]['id']){delete _0x16fb61[_0xe188('0x77')]['id'];}return db['SmsInteraction'][_0xe188('0x62')]({'where':{'id':_0x16fb61['params']['id']}})['then'](handleEntityNotFound(_0x171bf1,null))[_0xe188('0x24')](saveUpdates(_0x16fb61['body'],null))[_0xe188('0x24')](respondWithResult(_0x171bf1,null))[_0xe188('0x2e')](handleError(_0x171bf1,null));};exports[_0xe188('0xb8')]=function(_0x291624,_0x3e01b0){return db[_0xe188('0x38')][_0xe188('0x62')]({'where':{'id':_0x291624[_0xe188('0xb3')]['id']}})[_0xe188('0x24')](handleEntityNotFound(_0x3e01b0,null))[_0xe188('0x24')](removeEntity(_0x3e01b0,null))['catch'](handleError(_0x3e01b0,null));};exports[_0xe188('0xb9')]=function(_0x4ba7a6,_0x595a4c){return db['SmsInteraction'][_0xe188('0xb9')]()[_0xe188('0x24')](respondWithResult(_0x595a4c,null))[_0xe188('0x2e')](handleError(_0x595a4c,null));};exports[_0xe188('0xba')]=function(_0x4f9da6,_0x8d85c7,_0x424b64){return db[_0xe188('0xbb')]['find']({'where':{'id':_0x4f9da6[_0xe188('0xb3')]['id']}})[_0xe188('0x24')](handleEntityNotFound(_0x8d85c7,null))[_0xe188('0x24')](function(_0x5ab308){if(_0x5ab308){return _0x5ab308[_0xe188('0xba')](_0x4f9da6[_0xe188('0x77')][_0xe188('0xbc')],_['omit'](_0x4f9da6['body'],[_0xe188('0xbc'),'id'])||{});}})[_0xe188('0x24')](respondWithResult(_0x8d85c7,null))[_0xe188('0x2e')](handleError(_0x8d85c7,null));};exports[_0xe188('0xbd')]=function(_0x5cc615,_0xae59a8,_0x1a379f){var _0x25a045={'raw':![],'where':{}};var _0x397fa4={};var _0x47fde7={'count':0x0,'rows':[]};return db[_0xe188('0x38')][_0xe188('0xbe')]({'where':{'id':_0x5cc615['params']['id']}})[_0xe188('0x24')](handleEntityNotFound(_0xae59a8,null))[_0xe188('0x24')](function(_0x591ae0){if(_0x591ae0){_0x397fa4[_0xe188('0x3f')]=_[_0xe188('0x3d')](db[_0xe188('0xbb')]['rawAttributes']);_0x397fa4['query']=_[_0xe188('0x3d')](_0x5cc615['query']);_0x397fa4[_0xe188('0x3e')]=_[_0xe188('0x40')](_0x397fa4[_0xe188('0x3f')],_0x397fa4[_0xe188('0x3c')]);_0x25a045[_0xe188('0x42')]=_['intersection'](_0x397fa4[_0xe188('0x3f')],qs[_0xe188('0x41')](_0x5cc615['query'][_0xe188('0x41')]));_0x25a045[_0xe188('0x42')]=_0x25a045[_0xe188('0x42')][_0xe188('0x43')]?_0x25a045[_0xe188('0x42')]:_0x397fa4['model'];if(!_0x5cc615[_0xe188('0x3c')][_0xe188('0x44')](_0xe188('0x45'))){_0x25a045['limit']=qs['limit'](_0x5cc615['query'][_0xe188('0x20')]);_0x25a045[_0xe188('0x1d')]=qs[_0xe188('0x1d')](_0x5cc615['query']['offset']);}_0x25a045[_0xe188('0x46')]=qs[_0xe188('0x47')](_0x5cc615[_0xe188('0x3c')][_0xe188('0x47')]);_0x25a045[_0xe188('0x48')]=qs[_0xe188('0x3e')](_[_0xe188('0xbf')](_0x5cc615[_0xe188('0x3c')],_0x397fa4[_0xe188('0x3e')]));_0x25a045[_0xe188('0x48')][_0xe188('0xb0')]=_0x591ae0['id'];if(_0x5cc615[_0xe188('0x3c')][_0xe188('0x86')]){_0x25a045['where']=_['merge'](_0x25a045['where'],{'$or':_['map'](_0x25a045[_0xe188('0x42')],function(_0x2db80e){var _0x2bb630={};_0x2bb630[_0x2db80e]={'$like':'%'+_0x5cc615[_0xe188('0x3c')][_0xe188('0x86')]+'%'};return _0x2bb630;})});}if(_0x5cc615['query'][_0xe188('0x7c')]){var _0x3004ef=_0x5cc615[_0xe188('0x3c')][_0xe188('0x7c')][_0xe188('0x70')](',');var _0x267648={};_0x267648[_0x3004ef[0x0]]={'$gte':moment(_0x3004ef[0x1])[_0xe188('0xc0')](_0xe188('0xc1'))};_0x25a045[_0xe188('0x48')]=_[_0xe188('0x9d')](_0x25a045['where'],_0x267648);}_0x25a045=_[_0xe188('0x9d')]({},_0x25a045,_0x5cc615[_0xe188('0xc2')]);return db[_0xe188('0xbb')][_0xe188('0x1f')]({'where':_0x25a045[_0xe188('0x48')]})[_0xe188('0x24')](function(_0x450ba2){_0x47fde7[_0xe188('0x1f')]=_0x450ba2;if(_0x5cc615[_0xe188('0x3c')][_0xe188('0xb4')]){_0x25a045[_0xe188('0xb5')]=[{'all':!![]}];}return db[_0xe188('0xbb')][_0xe188('0xc3')](_0x25a045);})[_0xe188('0x24')](function(_0xe2e5a){_0x47fde7[_0xe188('0xb2')]=_0xe2e5a;return _0x47fde7;});}})['then'](respondWithFilteredResult(_0xae59a8,_0x25a045))['catch'](handleError(_0xae59a8,null));};exports[_0xe188('0xc4')]=function(_0x22ebe0,_0x962f02,_0x55160e){return db[_0xe188('0x38')][_0xe188('0x62')]({'where':{'id':_0x22ebe0[_0xe188('0xb3')]['id']}})['then'](handleEntityNotFound(_0x962f02,null))[_0xe188('0x24')](function(_0x44eced){if(_0x44eced){return _0x44eced[_0xe188('0xc5')](_0x22ebe0[_0xe188('0x77')]['ids'],_[_0xe188('0xc6')](_0x22ebe0['body'],[_0xe188('0xbc'),'id'])||{})[_0xe188('0xc7')](function(){return db[_0xe188('0x6f')][_0xe188('0xc3')]({'attributes':['id',_0xe188('0x27'),_0xe188('0x4a')],'where':{'id':_0x22ebe0[_0xe188('0x77')][_0xe188('0xbc')]}});})['then'](function(_0x10dbdb){socket[_0xe188('0xc8')]('smsInteractionTags:save',{'id':Number(_0x22ebe0[_0xe188('0xb3')]['id']),'tags':_0x10dbdb||[]});return{'id':Number(_0x22ebe0[_0xe188('0xb3')]['id']),'tags':_0x10dbdb||[]};});}})[_0xe188('0x24')](respondWithResult(_0x962f02,null))['catch'](handleError(_0x962f02,null));};exports[_0xe188('0xc9')]=function(_0x4c54ac,_0x4812de,_0x25aa5b){return db[_0xe188('0x38')][_0xe188('0x62')]({'where':{'id':_0x4c54ac[_0xe188('0xb3')]['id']}})[_0xe188('0x24')](handleEntityNotFound(_0x4812de,null))[_0xe188('0x24')](function(_0x78661b){if(_0x78661b){return _0x78661b['removeTags'](_0x4c54ac[_0xe188('0x3c')][_0xe188('0xbc')]);}})[_0xe188('0x24')](respondWithStatusCode(_0x4812de,null))[_0xe188('0x2e')](handleError(_0x4812de,null));};exports[_0xe188('0xca')]=function(_0x109e70,_0x3bc401){var _0x2c1f4a=moment()[_0xe188('0xcb')]()[_0xe188('0x9c')]();var _0x1a9f37=path[_0xe188('0xcc')](config['root'],_0xe188('0xcd'),_0xe188('0xce'),_0xe188('0xcf'));var _0x53c26b=path[_0xe188('0xcc')](config[_0xe188('0xd0')],'server','files',_0xe188('0xd1'));var _0x3bab78=path[_0xe188('0xcc')](_0x1a9f37,_0x2c1f4a);var _0x3a7143=util[_0xe188('0xc0')](_0xe188('0xd2'),_0x109e70[_0xe188('0xb3')]['id'],_0x2c1f4a);var _0x3d9eb5=path[_0xe188('0xcc')](_0x1a9f37,_0x3a7143);var _0xaaff8a=[];_0xaaff8a['push']({'model':db['User'],'as':_0xe188('0x74'),'attributes':['id','fullname'],'raw':!![]});_0xaaff8a[_0xe188('0x2d')]({'model':db[_0xe188('0xd3')],'as':_0xe188('0x67'),'attributes':['id',_0xe188('0xd4'),_0xe188('0xd5')],'raw':!![]});var _0x591054=[{'model':db[_0xe188('0xbb')],'as':_0xe188('0xd6'),'attributes':['id',_0xe188('0x77'),'createdAt','direction','secret',_0xe188('0xd7')],'include':_0xaaff8a}];_0x591054[_0xe188('0x2d')]({'model':db[_0xe188('0xd8')],'as':_0xe188('0xd9'),'attributes':['id',_0xe188('0x27')]});_0x591054[_0xe188('0x2d')]({'model':db[_0xe188('0x74')],'as':'Owner','attributes':['id',_0xe188('0x2a')]});return db[_0xe188('0x38')][_0xe188('0x62')]({'where':{'id':_0x109e70[_0xe188('0xb3')]['id']},'include':_0x591054})[_0xe188('0x24')](handleEntityNotFound(_0x3bc401,null))['then'](function(_0x2a7b34){if(_0x2a7b34){var _0x71cfa5=_0x2a7b34[_0xe188('0xda')]({'plain':!![]});fs[_0xe188('0xdb')](_0x3bab78);var _0x42734a={'channel':_0xe188('0xdc'),'account':_0x71cfa5[_0xe188('0xd9')][_0xe188('0x27')],'agent':_0x71cfa5[_0xe188('0xdd')]?_0x71cfa5['Owner'][_0xe188('0x2a')]:_0xe188('0xde'),'createdAt':moment(_0x71cfa5[_0xe188('0x7b')])[_0xe188('0xc0')](_0xe188('0xc1'))[_0xe188('0x9c')](),'closedAt':_0x71cfa5[_0xe188('0x33')]?moment(_0x71cfa5[_0xe188('0xdf')])['format'](_0xe188('0xc1'))[_0xe188('0x9c')]():'','disposition':_0x71cfa5[_0xe188('0xe0')],'messages':_(_0x71cfa5['Messages'])[_0xe188('0x86')]({'secret':![]})['map'](function(_0x5cb152){return{'date':moment(_0x5cb152[_0xe188('0x7b')])[_0xe188('0xc0')](_0xe188('0xc1'))[_0xe188('0x9c')](),'sender':_0x5cb152[_0xe188('0xe1')]==='out'?_0x5cb152[_0xe188('0x74')]?_0x5cb152[_0xe188('0x74')][_0xe188('0x2a')]:_0xe188('0xe2'):_0x5cb152[_0xe188('0x67')][_0xe188('0xd4')]+(_0x5cb152['Contact']['lastName']?'\x20'+_0x5cb152['Contact']['lastName']:''),'body':_0x5cb152[_0xe188('0x77')],'direction':_0x5cb152[_0xe188('0xe1')]===_0xe188('0xe3')?'A':'C','secret':_0x5cb152[_0xe188('0xe4')],'read':_0x5cb152['read']};})['value']()};return ejs[_0xe188('0xe5')](path[_0xe188('0xcc')](config[_0xe188('0xd0')],'server',_0xe188('0xe6'),_0xe188('0xe7')),{'interaction':_0x42734a})['then'](function(_0xb54cfd){var _0x314da3=path[_0xe188('0xcc')](_0x3bab78,_0xe188('0xe8')+_0x71cfa5['id']+'-'+_0x2c1f4a+_0xe188('0xe9'));var _0x2c6317={'path':_0x314da3,'channel':_0xe188('0xdc'),'interactionId':_0x71cfa5['id']};return pdf[_0xe188('0xea')](_0xb54cfd,_0x2c6317);})['then'](function(){return new BPromise(function(_0x24f957,_0x566bae){zipdir(_0x3bab78,{'saveTo':_0x3d9eb5},function(_0x15fd54,_0x4bf680){if(_0x15fd54)return _0x566bae(_0x15fd54);return _0x24f957(_0x4bf680);});})[_0xe188('0x24')](function(){return new BPromise(function(_0x268044,_0x5c43da){rimraf(_0x3bab78,function(_0x16bfed){if(_0x16bfed)_0x5c43da(_0x16bfed);return _0x268044();});});})['then'](function(){return _0x3bc401[_0xe188('0xca')](_0x3d9eb5,_0x3a7143,function(_0x16a961){if(_0x16a961){console[_0xe188('0xeb')](_0xe188('0xec'),_0x16a961);}else{fs[_0xe188('0xed')](_0x3d9eb5);}});});});}else{return _0x3bc401['sendStatus'](0xc8);}})['catch'](handleError(_0x3bc401,null));}; \ No newline at end of file +var _0x0cfa=['SmsInteraction','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','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','type','text','start','forEach','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','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?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','rows','show','params','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','spread','Tag','emit','smsInteractionTags:save','removeTags','download','root','files','tmp','attachments','join','transcript-%d-%s.zip','User','fullname','CmContact','firstName','Messages','get','mkdirSync','Sms','Account','Owner','closedAt','disposition','direction','out','System','lastName','secret','renderFile','server','views','downloadInteraction.ejs','createPdfFromHTML','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','stack','name','Users','map','Tags','TagIds','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x5c46ee,_0x1b0c4d){_0x5c46ee=_0x5c46ee-0x0;var _0x399890=_0x0cfa[_0x5c46ee];return _0x399890;};'use strict';var emlformat=require(_0xa0cf('0x0'));var rimraf=require(_0xa0cf('0x1'));var zipdir=require(_0xa0cf('0x2'));var jsonpatch=require(_0xa0cf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa0cf('0x4'));var util=require('util');var path=require(_0xa0cf('0x5'));var sox=require(_0xa0cf('0x6'));var csv=require(_0xa0cf('0x7'));var ejs=require(_0xa0cf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0cf('0x9'));var squel=require('squel');var crypto=require(_0xa0cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa0cf('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa0cf('0xc'));var Papa=require(_0xa0cf('0xd'));var Redis=require(_0xa0cf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa0cf('0xf'));var as=require(_0xa0cf('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0cf('0x11'))(_0xa0cf('0x12'));var utils=require(_0xa0cf('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa0cf('0x14'));var db=require(_0xa0cf('0x15'))['db'];config[_0xa0cf('0x16')]=_[_0xa0cf('0x17')](config[_0xa0cf('0x16')],{'host':_0xa0cf('0x18'),'port':0x18eb});var socket=require(_0xa0cf('0x19'))(new Redis(config['redis']));require(_0xa0cf('0x1a'))[_0xa0cf('0x1b')](socket);function respondWithStatusCode(_0x219f1e,_0x4848ed){_0x4848ed=_0x4848ed||0xcc;return function(_0x1e8234){if(_0x1e8234){return _0x219f1e[_0xa0cf('0x1c')](_0x4848ed);}return _0x219f1e[_0xa0cf('0x1d')](_0x4848ed)[_0xa0cf('0x1e')]();};}function respondWithResult(_0x31951b,_0x4cbe8a){_0x4cbe8a=_0x4cbe8a||0xc8;return function(_0x19e263){if(_0x19e263){return _0x31951b[_0xa0cf('0x1d')](_0x4cbe8a)['json'](_0x19e263);}};}function respondWithFilteredResult(_0x351038,_0x36c524){return function(_0x53a186){if(_0x53a186){var _0x112ced=typeof _0x36c524[_0xa0cf('0x1f')]===_0xa0cf('0x20')&&typeof _0x36c524[_0xa0cf('0x21')]===_0xa0cf('0x20');var _0x8bb2ab=_0x53a186['count'];var _0x3a57b0=_0x112ced?0x0:_0x36c524[_0xa0cf('0x1f')];var _0x3551df=_0x112ced?_0x53a186[_0xa0cf('0x22')]:_0x36c524[_0xa0cf('0x1f')]+_0x36c524[_0xa0cf('0x21')];var _0xc516be;if(_0x3551df>=_0x8bb2ab){_0x3551df=_0x8bb2ab;_0xc516be=0xc8;}else{_0xc516be=0xce;}_0x351038[_0xa0cf('0x1d')](_0xc516be);return _0x351038[_0xa0cf('0x23')](_0xa0cf('0x24'),_0x3a57b0+'-'+_0x3551df+'/'+_0x8bb2ab)[_0xa0cf('0x25')](_0x53a186);}return null;};}function patchUpdates(_0x49c107){return function(_0x5f275c){try{jsonpatch['apply'](_0x5f275c,_0x49c107,!![]);}catch(_0x555973){return BPromise['reject'](_0x555973);}return _0x5f275c[_0xa0cf('0x26')]();};}function saveUpdates(_0x30070e,_0x5ce4bd){return function(_0x21fc4e){if(_0x21fc4e){return _0x21fc4e[_0xa0cf('0x27')](_0x30070e)[_0xa0cf('0x28')](function(_0x1a9e25){return _0x1a9e25;});}return null;};}function removeEntity(_0x5a39f9,_0x180722){return function(_0x3f03ff){if(_0x3f03ff){return _0x3f03ff['destroy']()['then'](function(){_0x5a39f9[_0xa0cf('0x1d')](0xcc)[_0xa0cf('0x1e')]();});}};}function handleEntityNotFound(_0x432b5,_0x3d78f0){return function(_0x36ce2b){if(!_0x36ce2b){_0x432b5[_0xa0cf('0x1c')](0x194);}return _0x36ce2b;};}function handleError(_0x4c36ed,_0x57b088){_0x57b088=_0x57b088||0x1f4;return function(_0x1ef1d4){logger['error'](_0x1ef1d4[_0xa0cf('0x29')]);if(_0x1ef1d4[_0xa0cf('0x2a')]){delete _0x1ef1d4[_0xa0cf('0x2a')];}_0x4c36ed[_0xa0cf('0x1d')](_0x57b088)['send'](_0x1ef1d4);};}function getInteractionUsers(_0x1b26ab,_0x285778){return new BPromise(function(_0x3f4fcf,_0x22e162){try{if(_0x285778[_0x1b26ab['id']]){_0x1b26ab[_0xa0cf('0x2b')]=_[_0xa0cf('0x2c')](_0x285778[_0x1b26ab['id']],function(_0x991102){return{'id':_0x991102['id'],'fullname':_0x991102['fullname']};});}}catch(_0x217649){_0x22e162(_0x217649);}_0x3f4fcf(_0x1b26ab);});}function getInteractionTags(_0x2e00ff,_0x5aeddc){return new BPromise(function(_0x304445,_0x1f6ad6){try{if(_0x2e00ff['TagIds']){_0x2e00ff[_0xa0cf('0x2d')]=[];_0x2e00ff[_0xa0cf('0x2e')]['split'](',')['forEach'](function(_0x2bef36){_0x2e00ff[_0xa0cf('0x2d')][_0xa0cf('0x2f')](_0x5aeddc[_0x2bef36]);});}delete _0x2e00ff[_0xa0cf('0x2e')];}catch(_0x355d26){_0x1f6ad6(_0x355d26);}_0x304445(_0x2e00ff);});}function updateSmsInteraction(_0x24cf22,_0x1b3ecd,_0x3049e9){return new BPromise(function(_0x489f1b,_0x1d04cd){return getInteractionUsers(_0x24cf22,_0x3049e9)[_0xa0cf('0x28')](function(_0x12edd1){return getInteractionTags(_0x12edd1,_0x1b3ecd);})[_0xa0cf('0x28')](function(_0x2bdc06){return getStateInteraction(_0x2bdc06);})['then'](function(_0x334c22){_0x489f1b(_0x334c22);})[_0xa0cf('0x30')](function(_0x4b247c){_0x1d04cd(_0x4b247c);});});}function getStateInteraction(_0x44b2b2){return new BPromise(function(_0x54c2c0){_0x44b2b2[_0xa0cf('0x31')]=0x0;_0x44b2b2[_0xa0cf('0x32')]=0x0;_0x44b2b2[_0xa0cf('0x33')]=0x0;_0x44b2b2[_0xa0cf('0x34')]=0x0;_0x44b2b2[_0xa0cf('0x35')]=0x0;if(!_0x44b2b2[_0xa0cf('0x36')]&&!_0x44b2b2[_0xa0cf('0x37')]){_0x44b2b2[_0xa0cf('0x31')]+=0x1;}if(!_0x44b2b2['closed']&&_0x44b2b2['UserId']){_0x44b2b2[_0xa0cf('0x32')]+=0x1;if(_0x44b2b2[_0xa0cf('0x31')]){_0x44b2b2[_0xa0cf('0x31')]-=0x1;}}if(_0x44b2b2[_0xa0cf('0x36')]&&_0x44b2b2['UserId']){_0x44b2b2[_0xa0cf('0x33')]+=0x1;if(_0x44b2b2[_0xa0cf('0x32')]){_0x44b2b2[_0xa0cf('0x32')]-=0x1;}}if(_0x44b2b2['closed']&&!_0x44b2b2[_0xa0cf('0x37')]){_0x44b2b2[_0xa0cf('0x34')]+=0x1;if(_0x44b2b2['waiting']){_0x44b2b2[_0xa0cf('0x31')]-=0x1;}}_0x44b2b2[_0xa0cf('0x35')]+=0x1;_0x54c2c0(_0x44b2b2);});}exports[_0xa0cf('0x38')]=function(_0x3f2b8e,_0x4cf2e1){var _0x1d3363={},_0x172c54={},_0x34a101={'count':0x0,'rows':[]};var _0x43ec67=_[_0xa0cf('0x2c')](db[_0xa0cf('0x39')][_0xa0cf('0x3a')],function(_0x2ad771){return{'name':_0x2ad771[_0xa0cf('0x3b')],'type':_0x2ad771['type']['key']};});_0x172c54[_0xa0cf('0x3c')]=_[_0xa0cf('0x2c')](_0x43ec67,_0xa0cf('0x2a'));_0x172c54['query']=_[_0xa0cf('0x3d')](_0x3f2b8e['query']);_0x172c54[_0xa0cf('0x3e')]=_[_0xa0cf('0x3f')](_0x172c54[_0xa0cf('0x3c')],_0x172c54[_0xa0cf('0x40')]);_0x1d3363[_0xa0cf('0x41')]=_[_0xa0cf('0x3f')](_0x172c54[_0xa0cf('0x3c')],qs[_0xa0cf('0x42')](_0x3f2b8e[_0xa0cf('0x40')]['fields']));_0x1d3363[_0xa0cf('0x41')]=_0x1d3363['attributes'][_0xa0cf('0x43')]?_0x1d3363[_0xa0cf('0x41')]:_0x172c54[_0xa0cf('0x3c')];if(!_0x3f2b8e[_0xa0cf('0x40')]['hasOwnProperty'](_0xa0cf('0x44'))){_0x1d3363['limit']=qs['limit'](_0x3f2b8e[_0xa0cf('0x40')]['limit']);_0x1d3363[_0xa0cf('0x1f')]=qs[_0xa0cf('0x1f')](_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x1f')]);}_0x1d3363[_0xa0cf('0x45')]=qs[_0xa0cf('0x46')](_0x3f2b8e['query']['sort']);_0x1d3363[_0xa0cf('0x47')]=qs[_0xa0cf('0x3e')](_[_0xa0cf('0x48')](_0x3f2b8e[_0xa0cf('0x40')],_0x172c54[_0xa0cf('0x3e')]),_0x43ec67);var _0x13778a=[];var _0x5572a3=squel[_0xa0cf('0x49')]()['field']('id')[_0xa0cf('0x4a')](_0xa0cf('0x2a'))[_0xa0cf('0x4a')](_0xa0cf('0x4b'))[_0xa0cf('0x4c')]('tools_tags');var _0x2ca1da=squel[_0xa0cf('0x49')]()['field'](_0xa0cf('0x4d'))[_0xa0cf('0x4a')](_0xa0cf('0x4e'))[_0xa0cf('0x4a')](_0xa0cf('0x4f'))[_0xa0cf('0x4c')](_0xa0cf('0x50'),'ui')['left_join'](_0xa0cf('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x252953=squel['select']()[_0xa0cf('0x4c')](_0xa0cf('0x52'),'i')[_0xa0cf('0x53')](_0xa0cf('0x54'),'c',_0xa0cf('0x55'))[_0xa0cf('0x53')](_0xa0cf('0x51'),'o','o.id\x20=\x20i.UserId')[_0xa0cf('0x53')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xa0cf('0x53')](_0xa0cf('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xa0cf('0x53')](_0xa0cf('0x57'),'it',_0xa0cf('0x58'))['left_join'](_0xa0cf('0x59'),'t',_0xa0cf('0x5a'));var _0x465340=squel[_0xa0cf('0x5b')]();var _0x474157=[];var _0x58b628=squel[_0xa0cf('0x5b')]();var _0x12a383;if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x5c')]){_0x12a383=as[_0xa0cf('0x5d')](_0x3f2b8e[_0xa0cf('0x40')]['search']);var _0x589d0b=_0x12a383['sqlOperator'];for(var _0x2cd33e=0x0;_0x2cd33e<_0x12a383[_0xa0cf('0x5e')][_0xa0cf('0x43')];_0x2cd33e++){var _0xcbf54d=_0x12a383[_0xa0cf('0x5e')][_0x2cd33e];var _0x376616='i';var _0x5beaa8=_[_0xa0cf('0x5f')](_0x43ec67,[_0xa0cf('0x2a'),_0xcbf54d[_0xa0cf('0x4a')]]);if(!_0x5beaa8){switch(_0xcbf54d[_0xa0cf('0x4a')]){case'unreadMessages':if(_0xcbf54d['value']==0x1){_0x252953[_0xa0cf('0x60')]('`'+_0xcbf54d[_0xa0cf('0x4a')]+_0xa0cf('0x61'));}else{_0x252953[_0xa0cf('0x60')]('`'+_0xcbf54d[_0xa0cf('0x4a')]+_0xa0cf('0x62'));}break;case _0xa0cf('0x63'):if(_0xcbf54d[_0xa0cf('0x64')]===_0xa0cf('0x65')){if(_0xcbf54d[_0xa0cf('0x66')][_0xa0cf('0x67')]('\x20')[_0xa0cf('0x43')]>0x1){_0x465340[_0x589d0b](_0xa0cf('0x68'),qs[_0xa0cf('0x69')](_0xcbf54d[_0xa0cf('0x66')]),null);}else{var _0x24798b='%'+_0xcbf54d[_0xa0cf('0x66')]+'%';_0x465340[_0x589d0b](_0xa0cf('0x6a'),_0x24798b,_0x24798b,_0x24798b);}}else{_0x5beaa8=_[_0xa0cf('0x5f')](_0x43ec67,[_0xa0cf('0x2a'),_0xa0cf('0x6b')]);_0xcbf54d[_0xa0cf('0x4a')]='ContactId';_0x270f76=as[_0xa0cf('0x6c')](_0x376616,_0x5beaa8[_0xa0cf('0x6d')],_0xcbf54d);_0x465340[_0x589d0b](_0x270f76[_0xa0cf('0x6e')],_0x270f76[_0xa0cf('0x66')][_0xa0cf('0x6f')],_0x270f76[_0xa0cf('0x66')]['end']);}break;case'Tag':var _0x585e3d=_0xcbf54d['value'][_0xa0cf('0x67')](',')[_0xa0cf('0x2c')](function(_0x57a61e){return Number(_0x57a61e);});_0x585e3d[_0xa0cf('0x70')](function(_0x4cd7b8){_0x58b628['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4cd7b8+',%');});_0x474157=_[_0xa0cf('0x71')](_0x474157,_0x585e3d);break;case'User':if(_0xcbf54d[_0xa0cf('0x64')]===_0xa0cf('0x65')){_0x465340[_0x589d0b](_0xa0cf('0x72'),'%'+_0xcbf54d[_0xa0cf('0x66')]+'%',null);}else{_0x5beaa8=_[_0xa0cf('0x5f')](_0x43ec67,['name','UserId']);_0xcbf54d[_0xa0cf('0x4a')]='UserId';_0x270f76=as[_0xa0cf('0x6c')](_0x376616,_0x5beaa8[_0xa0cf('0x6d')],_0xcbf54d);_0x465340[_0x589d0b](_0x270f76[_0xa0cf('0x6e')],_0x270f76[_0xa0cf('0x66')]['start'],_0x270f76[_0xa0cf('0x66')][_0xa0cf('0x1e')]);}break;case _0xa0cf('0x73'):_0x270f76=as[_0xa0cf('0x6c')]('me',null,_0xcbf54d);_0x465340[_0x589d0b](_0x270f76[_0xa0cf('0x6e')],_0x270f76['value']['start'],_0x270f76[_0xa0cf('0x66')][_0xa0cf('0x1e')]);break;}}else{var _0x270f76=as[_0xa0cf('0x6c')](_0x376616,_0x5beaa8[_0xa0cf('0x6d')],_0xcbf54d);_0x465340[_0x589d0b](_0x270f76['text'],_0x270f76[_0xa0cf('0x66')][_0xa0cf('0x6f')],_0x270f76[_0xa0cf('0x66')][_0xa0cf('0x1e')]);}}}else{var _0x4c54ea=_(_0x3f2b8e[_0xa0cf('0x40')])['keys']()['map'](function(_0x5d63e5){return _[_0xa0cf('0x74')](_0x43ec67,[_0xa0cf('0x2a'),_0x5d63e5])?_0x5d63e5:undefined;})[_0xa0cf('0x75')]()[_0xa0cf('0x66')]();if(!_['isEmpty'](_0x4c54ea)){_0x4c54ea[_0xa0cf('0x70')](function(_0x5aadf5){if(_0x5aadf5===_0xa0cf('0x76')){_0x252953[_0xa0cf('0x47')](_0xa0cf('0x77'),[]['concat'](_0x3f2b8e[_0xa0cf('0x40')][_0x5aadf5]));}else if(_0x5aadf5===_0xa0cf('0x78')){var _0x9418e8=JSON[_0xa0cf('0x79')](_0x3f2b8e[_0xa0cf('0x40')][_0x5aadf5])['$gte'];var _0xa63d53=JSON[_0xa0cf('0x79')](_0x3f2b8e[_0xa0cf('0x40')][_0x5aadf5])['$lte'];_0x252953[_0xa0cf('0x47')](_0xa0cf('0x7a'),_0x9418e8,_0xa63d53);}else{if(_0x3f2b8e[_0xa0cf('0x40')][_0x5aadf5]===_0xa0cf('0x7b')){_0x252953[_0xa0cf('0x47')]('i.'+_0x5aadf5+'\x20IS\x20NULL');}else{_0x252953['where']('i.'+_0x5aadf5+_0xa0cf('0x7c'),_0x3f2b8e[_0xa0cf('0x40')][_0x5aadf5]);}}});}if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x7d')]){if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x7d')]==0x1){_0x252953[_0xa0cf('0x60')]('`unreadMessages`\x20=\x200');}else{_0x252953['having'](_0xa0cf('0x7e'));}}if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x7f')]){_0x474157=_[_0xa0cf('0x80')](_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x7f')])?_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x7f')]:new Array(_0x3f2b8e['query'][_0xa0cf('0x7f')]);_0x474157[_0xa0cf('0x70')](function(_0x1b2840){_0x58b628['or'](_0xa0cf('0x81'),'%,'+_0x1b2840+',%');});}if(_0x3f2b8e[_0xa0cf('0x40')]['filter']){var _0x210216=_0x3f2b8e[_0xa0cf('0x40')]['filter'][_0xa0cf('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa0cf('0x83')](_0x210216)){_0x465340['or'](_0xa0cf('0x84'),_0x210216+'%')['or'](_0xa0cf('0x85'),_0x210216+'%');}else{_0x465340['or'](_0xa0cf('0x86'),qs['getFullTextValue'](_0x210216))['or'](_0xa0cf('0x87'),_0x210216+'%');}}}_0x252953[_0xa0cf('0x47')](_0x465340);_0x252953[_0xa0cf('0x88')]('i.id');var _0x400a9f={'type':db[_0xa0cf('0x89')][_0xa0cf('0x8a')][_0xa0cf('0x8b')],'raw':!![]};var _0x4676a2=_0x252953[_0xa0cf('0x8c')]();_0x4676a2[_0xa0cf('0x4a')](_0xa0cf('0x8d'));_0x4676a2[_0xa0cf('0x4a')](_0xa0cf('0x8e'),_0xa0cf('0x8f'));if(_0x1d3363[_0xa0cf('0x45')]){_0x1d3363[_0xa0cf('0x45')][_0xa0cf('0x70')](function(_0x448096){var _0xa31aaa=_0x448096[0x0]===_0xa0cf('0x90')?_0x448096[0x0]:'i.'+_0x448096[0x0];_0x252953[_0xa0cf('0x45')](_0xa31aaa,_0x448096[0x1]===_0xa0cf('0x91')?![]:!![]);});}if(!_[_0xa0cf('0x92')](_0x474157)){_0x252953[_0xa0cf('0x60')](_0x58b628);_0x4676a2[_0xa0cf('0x47')]('t.id\x20IN\x20?',_0x474157);}BPromise[_0xa0cf('0x93')]()['then'](function(){if(!_0x12a383){if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x76')])return;_0x4676a2['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x252953[_0xa0cf('0x47')](_0xa0cf('0x94'));return;}if(_0x3f2b8e['user']['role']!==_0xa0cf('0x95'))return;return _0x3f2b8e[_0xa0cf('0x96')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x24f4c9){if(_[_0xa0cf('0x92')](_0x24f4c9)){_0x4676a2[_0xa0cf('0x47')](_0xa0cf('0x97'));_0x252953[_0xa0cf('0x47')](_0xa0cf('0x97'));}else{_0x4676a2['where'](_0xa0cf('0x77'),_[_0xa0cf('0x2c')](_0x24f4c9,'id'));_0x252953[_0xa0cf('0x47')](_0xa0cf('0x77'),_['map'](_0x24f4c9,'id'));}});})[_0xa0cf('0x28')](function(){if(_0x3f2b8e['user'][_0xa0cf('0x98')]===_0xa0cf('0x95')&&!_0x12a383&&!_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x76')])return[];return db[_0xa0cf('0x99')][_0xa0cf('0x40')](_0x4676a2[_0xa0cf('0x9a')](),_0x400a9f);})[_0xa0cf('0x28')](function(_0x47a115){_0x34a101['count']=_0x47a115['length'];if(_0x34a101['count']===0x0)return[];return db[_0xa0cf('0x99')][_0xa0cf('0x40')](_0x5572a3[_0xa0cf('0x9a')](),_0x400a9f)[_0xa0cf('0x28')](function(_0x23a5e8){_0x13778a=_[_0xa0cf('0x9b')](_0x23a5e8,'id');_0x400a9f=_[_0xa0cf('0x9c')](_0x400a9f,{'model':db[_0xa0cf('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f2b8e[_0xa0cf('0x40')][_0xa0cf('0x42')]){_0x1d3363['attributes'][_0xa0cf('0x70')](function(_0x1e357d){_0x252953[_0xa0cf('0x4a')]('i.'+_0x1e357d);});}else{_0x252953['field'](_0xa0cf('0x8e'),_0xa0cf('0x8f'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0x9d'),_0xa0cf('0x9e'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0x9f'),_0xa0cf('0xa0'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xa1'),_0xa0cf('0x90'));_0x252953['field'](_0xa0cf('0xa2'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xa3'),'Contact.firstName');_0x252953[_0xa0cf('0x4a')]('c.lastName',_0xa0cf('0xa4'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xa5'),_0xa0cf('0xa6'));_0x252953[_0xa0cf('0x4a')]('c.phone',_0xa0cf('0xa7'));_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xa8'),_0xa0cf('0xa9'));_0x252953[_0xa0cf('0x4a')]('c.fax','Contact.fax');_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xaa'),'Owner.fullname');_0x252953[_0xa0cf('0x4a')](_0xa0cf('0xab'),'Owner.internal');_0x252953['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa0cf('0x2e'));}if(_0x1d3363[_0xa0cf('0x21')])_0x252953[_0xa0cf('0x21')](_0x1d3363[_0xa0cf('0x21')]);if(_0x1d3363[_0xa0cf('0x1f')])_0x252953[_0xa0cf('0x1f')](_0x1d3363[_0xa0cf('0x1f')]);return db[_0xa0cf('0x99')][_0xa0cf('0x40')](_0x252953[_0xa0cf('0x9a')](),_0x400a9f);})[_0xa0cf('0x28')](function(_0x30f4f1){if(_0x30f4f1[_0xa0cf('0x43')]>0x0)_0x2ca1da[_0xa0cf('0x47')](_0xa0cf('0xac'),_[_0xa0cf('0x2c')](_0x30f4f1,'id'));return db[_0xa0cf('0x99')][_0xa0cf('0x40')](_0x2ca1da[_0xa0cf('0x9a')](),_0x400a9f)['then'](function(_0x4862a4){var _0x560bda=_[_0xa0cf('0xad')](_0x4862a4,'SmsInteractionId');var _0x295ec3=[];_0x30f4f1['forEach'](function(_0x52619b){_0x295ec3[_0xa0cf('0x2f')](updateSmsInteraction(_0x52619b,_0x13778a,_0x560bda));});return BPromise['all'](_0x295ec3);});});})[_0xa0cf('0x28')](function(_0x112ff9){_0x34a101[_0xa0cf('0xae')]=_0x112ff9;return _0x34a101;})[_0xa0cf('0x28')](respondWithFilteredResult(_0x4cf2e1,_0x1d3363))[_0xa0cf('0x30')](handleError(_0x4cf2e1,null));};exports[_0xa0cf('0xaf')]=function(_0x3ec5da,_0x33d981){var _0x48aa3f={'raw':![],'where':{'id':_0x3ec5da[_0xa0cf('0xb0')]['id']}},_0x53704b={};_0x53704b[_0xa0cf('0x3c')]=_['keys'](db[_0xa0cf('0x39')][_0xa0cf('0x3a')]);_0x53704b[_0xa0cf('0x40')]=_[_0xa0cf('0x3d')](_0x3ec5da[_0xa0cf('0x40')]);_0x53704b[_0xa0cf('0x3e')]=_[_0xa0cf('0x3f')](_0x53704b[_0xa0cf('0x3c')],_0x53704b[_0xa0cf('0x40')]);_0x48aa3f[_0xa0cf('0x41')]=_[_0xa0cf('0x3f')](_0x53704b[_0xa0cf('0x3c')],qs[_0xa0cf('0x42')](_0x3ec5da['query'][_0xa0cf('0x42')]));_0x48aa3f[_0xa0cf('0x41')]=_0x48aa3f[_0xa0cf('0x41')][_0xa0cf('0x43')]?_0x48aa3f[_0xa0cf('0x41')]:_0x53704b[_0xa0cf('0x3c')];if(_0x3ec5da['query']['includeAll']){_0x48aa3f['include']=[{'all':!![]}];}_0x48aa3f=_[_0xa0cf('0x9c')]({},_0x48aa3f,_0x3ec5da[_0xa0cf('0xb1')]);return db['SmsInteraction'][_0xa0cf('0x5f')](_0x48aa3f)[_0xa0cf('0x28')](handleEntityNotFound(_0x33d981,null))[_0xa0cf('0x28')](respondWithResult(_0x33d981,null))['catch'](handleError(_0x33d981,null));};exports['create']=function(_0x33668a,_0x20b9c5){return db['SmsInteraction'][_0xa0cf('0xb2')](_0x33668a['body'],{})[_0xa0cf('0x28')](respondWithResult(_0x20b9c5,0xc9))[_0xa0cf('0x30')](handleError(_0x20b9c5,null));};exports[_0xa0cf('0x27')]=function(_0x238f2b,_0x527986){if(_0x238f2b[_0xa0cf('0x73')]['id']){delete _0x238f2b[_0xa0cf('0x73')]['id'];}return db[_0xa0cf('0x39')]['find']({'where':{'id':_0x238f2b[_0xa0cf('0xb0')]['id']}})[_0xa0cf('0x28')](handleEntityNotFound(_0x527986,null))[_0xa0cf('0x28')](saveUpdates(_0x238f2b['body'],null))[_0xa0cf('0x28')](respondWithResult(_0x527986,null))[_0xa0cf('0x30')](handleError(_0x527986,null));};exports['destroy']=function(_0x2ccf0e,_0x53947c){return db[_0xa0cf('0x39')][_0xa0cf('0x5f')]({'where':{'id':_0x2ccf0e['params']['id']}})[_0xa0cf('0x28')](handleEntityNotFound(_0x53947c,null))[_0xa0cf('0x28')](removeEntity(_0x53947c,null))[_0xa0cf('0x30')](handleError(_0x53947c,null));};exports['describe']=function(_0x350a5f,_0x4609ce){return db[_0xa0cf('0x39')][_0xa0cf('0xb3')]()[_0xa0cf('0x28')](respondWithResult(_0x4609ce,null))[_0xa0cf('0x30')](handleError(_0x4609ce,null));};exports[_0xa0cf('0xb4')]=function(_0x4c3374,_0x45822c,_0x17ac48){return db[_0xa0cf('0xb5')][_0xa0cf('0x5f')]({'where':{'id':_0x4c3374[_0xa0cf('0xb0')]['id']}})[_0xa0cf('0x28')](handleEntityNotFound(_0x45822c,null))['then'](function(_0xd60b6f){if(_0xd60b6f){return _0xd60b6f[_0xa0cf('0xb4')](_0x4c3374['body'][_0xa0cf('0xb6')],_[_0xa0cf('0xb7')](_0x4c3374['body'],[_0xa0cf('0xb6'),'id'])||{});}})[_0xa0cf('0x28')](respondWithResult(_0x45822c,null))[_0xa0cf('0x30')](handleError(_0x45822c,null));};exports[_0xa0cf('0xb8')]=function(_0x16eae1,_0x3a5a0c,_0x1bd0f4){var _0x22a22e={'raw':![],'where':{}};var _0x3450f4={};var _0x1710e7={'count':0x0,'rows':[]};return db[_0xa0cf('0x39')][_0xa0cf('0xb9')]({'where':{'id':_0x16eae1['params']['id']}})[_0xa0cf('0x28')](handleEntityNotFound(_0x3a5a0c,null))[_0xa0cf('0x28')](function(_0x3f088c){if(_0x3f088c){_0x3450f4[_0xa0cf('0x3c')]=_['keys'](db[_0xa0cf('0xb5')]['rawAttributes']);_0x3450f4[_0xa0cf('0x40')]=_[_0xa0cf('0x3d')](_0x16eae1[_0xa0cf('0x40')]);_0x3450f4[_0xa0cf('0x3e')]=_[_0xa0cf('0x3f')](_0x3450f4[_0xa0cf('0x3c')],_0x3450f4[_0xa0cf('0x40')]);_0x22a22e[_0xa0cf('0x41')]=_[_0xa0cf('0x3f')](_0x3450f4['model'],qs['fields'](_0x16eae1[_0xa0cf('0x40')]['fields']));_0x22a22e['attributes']=_0x22a22e[_0xa0cf('0x41')][_0xa0cf('0x43')]?_0x22a22e[_0xa0cf('0x41')]:_0x3450f4[_0xa0cf('0x3c')];if(!_0x16eae1['query'][_0xa0cf('0xba')](_0xa0cf('0x44'))){_0x22a22e['limit']=qs[_0xa0cf('0x21')](_0x16eae1['query'][_0xa0cf('0x21')]);_0x22a22e[_0xa0cf('0x1f')]=qs[_0xa0cf('0x1f')](_0x16eae1[_0xa0cf('0x40')][_0xa0cf('0x1f')]);}_0x22a22e[_0xa0cf('0x45')]=qs[_0xa0cf('0x46')](_0x16eae1[_0xa0cf('0x40')][_0xa0cf('0x46')]);_0x22a22e[_0xa0cf('0x47')]=qs['filters'](_[_0xa0cf('0x48')](_0x16eae1[_0xa0cf('0x40')],_0x3450f4['filters']));_0x22a22e[_0xa0cf('0x47')]['SmsInteractionId']=_0x3f088c['id'];if(_0x16eae1[_0xa0cf('0x40')][_0xa0cf('0xbb')]){_0x22a22e[_0xa0cf('0x47')]=_[_0xa0cf('0x9c')](_0x22a22e[_0xa0cf('0x47')],{'$or':_[_0xa0cf('0x2c')](_0x22a22e[_0xa0cf('0x41')],function(_0x10609c){var _0x4f5fee={};_0x4f5fee[_0x10609c]={'$like':'%'+_0x16eae1['query'][_0xa0cf('0xbb')]+'%'};return _0x4f5fee;})});}if(_0x16eae1['query'][_0xa0cf('0xbc')]){var _0xbda535=_0x16eae1['query']['$gte'][_0xa0cf('0x67')](',');var _0x2cccb5={};_0x2cccb5[_0xbda535[0x0]]={'$gte':moment(_0xbda535[0x1])[_0xa0cf('0xbd')](_0xa0cf('0xbe'))};_0x22a22e[_0xa0cf('0x47')]=_[_0xa0cf('0x9c')](_0x22a22e[_0xa0cf('0x47')],_0x2cccb5);}_0x22a22e=_[_0xa0cf('0x9c')]({},_0x22a22e,_0x16eae1[_0xa0cf('0xb1')]);return db[_0xa0cf('0xb5')][_0xa0cf('0x22')]({'where':_0x22a22e[_0xa0cf('0x47')]})[_0xa0cf('0x28')](function(_0x434e34){_0x1710e7[_0xa0cf('0x22')]=_0x434e34;if(_0x16eae1[_0xa0cf('0x40')][_0xa0cf('0xbf')]){_0x22a22e[_0xa0cf('0xc0')]=[{'all':!![]}];}return db[_0xa0cf('0xb5')][_0xa0cf('0xc1')](_0x22a22e);})[_0xa0cf('0x28')](function(_0x5f2808){_0x1710e7[_0xa0cf('0xae')]=_0x5f2808;return _0x1710e7;});}})[_0xa0cf('0x28')](respondWithFilteredResult(_0x3a5a0c,_0x22a22e))['catch'](handleError(_0x3a5a0c,null));};exports['addTags']=function(_0x4d9126,_0x30b066,_0x13184e){return db[_0xa0cf('0x39')][_0xa0cf('0x5f')]({'where':{'id':_0x4d9126[_0xa0cf('0xb0')]['id']}})[_0xa0cf('0x28')](handleEntityNotFound(_0x30b066,null))['then'](function(_0x1424f0){if(_0x1424f0){return _0x1424f0['setTags'](_0x4d9126[_0xa0cf('0x73')][_0xa0cf('0xb6')],_[_0xa0cf('0xb7')](_0x4d9126['body'],['ids','id'])||{})[_0xa0cf('0xc2')](function(){return db[_0xa0cf('0xc3')][_0xa0cf('0xc1')]({'attributes':['id','name',_0xa0cf('0x4b')],'where':{'id':_0x4d9126['body']['ids']}});})[_0xa0cf('0x28')](function(_0x3e77f4){socket[_0xa0cf('0xc4')](_0xa0cf('0xc5'),{'id':Number(_0x4d9126[_0xa0cf('0xb0')]['id']),'tags':_0x3e77f4||[]});return{'id':Number(_0x4d9126[_0xa0cf('0xb0')]['id']),'tags':_0x3e77f4||[]};});}})[_0xa0cf('0x28')](respondWithResult(_0x30b066,null))['catch'](handleError(_0x30b066,null));};exports[_0xa0cf('0xc6')]=function(_0x432135,_0x84740e,_0x209898){return db['SmsInteraction'][_0xa0cf('0x5f')]({'where':{'id':_0x432135[_0xa0cf('0xb0')]['id']}})['then'](handleEntityNotFound(_0x84740e,null))[_0xa0cf('0x28')](function(_0x2e37fe){if(_0x2e37fe){return _0x2e37fe['removeTags'](_0x432135[_0xa0cf('0x40')][_0xa0cf('0xb6')]);}})[_0xa0cf('0x28')](respondWithStatusCode(_0x84740e,null))[_0xa0cf('0x30')](handleError(_0x84740e,null));};exports[_0xa0cf('0xc7')]=function(_0x153513,_0x596b9b){var _0x493cd3=moment()['unix']()[_0xa0cf('0x9a')]();var _0x510b0d=path['join'](config[_0xa0cf('0xc8')],'server',_0xa0cf('0xc9'),_0xa0cf('0xca'));var _0x3a4ec5=path['join'](config[_0xa0cf('0xc8')],'server',_0xa0cf('0xc9'),_0xa0cf('0xcb'));var _0x1af64f=path[_0xa0cf('0xcc')](_0x510b0d,_0x493cd3);var _0x164393=util['format'](_0xa0cf('0xcd'),_0x153513[_0xa0cf('0xb0')]['id'],_0x493cd3);var _0x56cad0=path[_0xa0cf('0xcc')](_0x510b0d,_0x164393);var _0x3fb8ee=[];_0x3fb8ee[_0xa0cf('0x2f')]({'model':db['User'],'as':_0xa0cf('0xce'),'attributes':['id',_0xa0cf('0xcf')],'raw':!![]});_0x3fb8ee[_0xa0cf('0x2f')]({'model':db[_0xa0cf('0xd0')],'as':_0xa0cf('0x63'),'attributes':['id',_0xa0cf('0xd1'),'lastName'],'raw':!![]});var _0x2ad78d=[{'model':db[_0xa0cf('0xb5')],'as':_0xa0cf('0xd2'),'attributes':['id',_0xa0cf('0x73'),_0xa0cf('0x78'),'direction','secret',_0xa0cf('0x7d')],'include':_0x3fb8ee}];_0x2ad78d['push']({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xa0cf('0x2a')]});_0x2ad78d[_0xa0cf('0x2f')]({'model':db[_0xa0cf('0xce')],'as':'Owner','attributes':['id',_0xa0cf('0xcf')]});return db[_0xa0cf('0x39')]['find']({'where':{'id':_0x153513[_0xa0cf('0xb0')]['id']},'include':_0x2ad78d})[_0xa0cf('0x28')](handleEntityNotFound(_0x596b9b,null))[_0xa0cf('0x28')](function(_0x11807f){if(_0x11807f){var _0x48d7c5=_0x11807f[_0xa0cf('0xd3')]({'plain':!![]});fs[_0xa0cf('0xd4')](_0x1af64f);var _0x45adf0={'channel':_0xa0cf('0xd5'),'account':_0x48d7c5[_0xa0cf('0xd6')][_0xa0cf('0x2a')],'agent':_0x48d7c5[_0xa0cf('0xd7')]?_0x48d7c5[_0xa0cf('0xd7')][_0xa0cf('0xcf')]:'N.A.','createdAt':moment(_0x48d7c5['createdAt'])[_0xa0cf('0xbd')](_0xa0cf('0xbe'))[_0xa0cf('0x9a')](),'closedAt':_0x48d7c5[_0xa0cf('0x36')]?moment(_0x48d7c5[_0xa0cf('0xd8')])['format'](_0xa0cf('0xbe'))[_0xa0cf('0x9a')]():'','disposition':_0x48d7c5[_0xa0cf('0xd9')],'messages':_(_0x48d7c5[_0xa0cf('0xd2')])[_0xa0cf('0xbb')]({'secret':![]})[_0xa0cf('0x2c')](function(_0x51e696){return{'date':moment(_0x51e696[_0xa0cf('0x78')])[_0xa0cf('0xbd')](_0xa0cf('0xbe'))[_0xa0cf('0x9a')](),'sender':_0x51e696[_0xa0cf('0xda')]===_0xa0cf('0xdb')?_0x51e696[_0xa0cf('0xce')]?_0x51e696[_0xa0cf('0xce')][_0xa0cf('0xcf')]:_0xa0cf('0xdc'):_0x51e696[_0xa0cf('0x63')]['firstName']+(_0x51e696[_0xa0cf('0x63')][_0xa0cf('0xdd')]?'\x20'+_0x51e696[_0xa0cf('0x63')][_0xa0cf('0xdd')]:''),'body':_0x51e696['body'],'direction':_0x51e696['direction']===_0xa0cf('0xdb')?'A':'C','secret':_0x51e696[_0xa0cf('0xde')],'read':_0x51e696[_0xa0cf('0x7d')]};})[_0xa0cf('0x66')]()};return ejs[_0xa0cf('0xdf')](path[_0xa0cf('0xcc')](config[_0xa0cf('0xc8')],_0xa0cf('0xe0'),_0xa0cf('0xe1'),_0xa0cf('0xe2')),{'interaction':_0x45adf0})[_0xa0cf('0x28')](function(_0x53bd3e){var _0x3acbf2=path[_0xa0cf('0xcc')](_0x1af64f,'transcript-'+_0x48d7c5['id']+'-'+_0x493cd3+'.pdf');var _0x453227={'path':_0x3acbf2,'channel':'Sms','interactionId':_0x48d7c5['id']};return pdf[_0xa0cf('0xe3')](_0x53bd3e,_0x453227);})[_0xa0cf('0x28')](function(){return new BPromise(function(_0x4abe19,_0x1b13c1){zipdir(_0x1af64f,{'saveTo':_0x56cad0},function(_0x31821b,_0x1f37f1){if(_0x31821b)return _0x1b13c1(_0x31821b);return _0x4abe19(_0x1f37f1);});})[_0xa0cf('0x28')](function(){return new BPromise(function(_0x222b42,_0x5952ef){rimraf(_0x1af64f,function(_0x522a4e){if(_0x522a4e)_0x5952ef(_0x522a4e);return _0x222b42();});});})[_0xa0cf('0x28')](function(){return _0x596b9b['download'](_0x56cad0,_0x164393,function(_0x17b0a4){if(_0x17b0a4){console['log']('err',_0x17b0a4);}else{fs['unlinkSync'](_0x56cad0);}});});});}else{return _0x596b9b[_0xa0cf('0x1c')](0xc8);}})['catch'](handleError(_0x596b9b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index eb7439a..555d5d7 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 _0x955f=['save','getUsers','setDataValue','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x30fa2e,_0x17aa6d){var _0x4d4ea4=function(_0x9960eb){while(--_0x9960eb){_0x30fa2e['push'](_0x30fa2e['shift']());}};_0x4d4ea4(++_0x17aa6d);}(_0x955f,0x1eb));var _0xf955=function(_0x216890,_0x2613c3){_0x216890=_0x216890-0x0;var _0x4f0656=_0x955f[_0x216890];return _0x4f0656;};'use strict';var EventEmitter=require(_0xf955('0x0'));var SmsInteraction=require(_0xf955('0x1'))['db'][_0xf955('0x2')];var SmsMessage=require(_0xf955('0x1'))['db'][_0xf955('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf955('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1db0dd){return function(_0x5a20bc,_0x13b796,_0x2caff2){_0x5a20bc[_0xf955('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18432f){_0x5a20bc[_0xf955('0x6')]('Users',_0x18432f[_0xf955('0x7')](function(_0x151034){return{'id':_0x151034['id']};}));return SmsMessage[_0xf955('0x8')]({'where':{'SmsInteractionId':_0x5a20bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf955('0x9')](function(_0x134c1b){_0x5a20bc[_0xf955('0x6')](_0xf955('0xa'),_0x134c1b['length']);SmsInteractionEvents[_0xf955('0xb')](_0x1db0dd+':'+_0x5a20bc['id'],_0x5a20bc);SmsInteractionEvents['emit'](_0x1db0dd,_0x5a20bc);_0x2caff2(null);})[_0xf955('0xc')](_0x2caff2(null));};}for(var e in events){if(events[_0xf955('0xd')](e)){var event=events[e];SmsInteraction[_0xf955('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xe511=['Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','getUsers','then'];(function(_0xbd1066,_0x9d97f){var _0x197794=function(_0x51214f){while(--_0x51214f){_0xbd1066['push'](_0xbd1066['shift']());}};_0x197794(++_0x9d97f);}(_0xe511,0x16f));var _0x1e51=function(_0x1682a9,_0x34b75f){_0x1682a9=_0x1682a9-0x0;var _0x1cdf47=_0xe511[_0x1682a9];return _0x1cdf47;};'use strict';var EventEmitter=require(_0x1e51('0x0'));var SmsInteraction=require(_0x1e51('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x1e51('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1e51('0x2')](0x0);var events={'afterCreate':_0x1e51('0x3'),'afterUpdate':'update','afterDestroy':_0x1e51('0x4')};function emitEvent(_0x2be2b7){return function(_0x204da7,_0x16ec99,_0x480cca){_0x204da7[_0x1e51('0x5')]({'attributes':['id'],'raw':!![]})[_0x1e51('0x6')](function(_0x5c4590){_0x204da7['setDataValue'](_0x1e51('0x7'),_0x5c4590[_0x1e51('0x8')](function(_0x4fa8a9){return{'id':_0x4fa8a9['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x204da7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e51('0x6')](function(_0x2712e0){_0x204da7[_0x1e51('0x9')](_0x1e51('0xa'),_0x2712e0[_0x1e51('0xb')]);SmsInteractionEvents[_0x1e51('0xc')](_0x2be2b7+':'+_0x204da7['id'],_0x204da7);SmsInteractionEvents['emit'](_0x2be2b7,_0x204da7);_0x480cca(null);})[_0x1e51('0xd')](_0x480cca(null));};}for(var e in events){if(events[_0x1e51('0xe')](e)){var event=events[e];SmsInteraction[_0x1e51('0xf')](e,emitEvent(event));}}module[_0x1e51('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 fee91f7..301671b 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 _0x073b=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','exports','define','SmsInteraction'];(function(_0x212d22,_0x2309d2){var _0x48f2b1=function(_0x43cc92){while(--_0x43cc92){_0x212d22['push'](_0x212d22['shift']());}};_0x48f2b1(++_0x2309d2);}(_0x073b,0x83));var _0xb073=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x073b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb073('0x0'));var util=require(_0xb073('0x1'));var logger=require(_0xb073('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb073('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb073('0x4'));var config=require(_0xb073('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xb073('0x6')]=function(_0x1d85c7,_0x190758){return _0x1d85c7[_0xb073('0x7')](_0xb073('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x458b7f,_0x52514a,_0x4b9477){if(_0x458b7f[_0xb073('0x9')](_0xb073('0xa'))){_0x458b7f[_0xb073('0xb')]=moment()[_0xb073('0xc')](_0xb073('0xd'));}_0x4b9477(null,_0x458b7f);}}});}; \ No newline at end of file +var _0x5e65=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','define','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x5e65,0x193));var _0x55e6=function(_0x53a976,_0xf87685){_0x53a976=_0x53a976-0x0;var _0x802014=_0x5e65[_0x53a976];return _0x802014;};'use strict';var _=require(_0x55e6('0x0'));var util=require(_0x55e6('0x1'));var logger=require(_0x55e6('0x2'))(_0x55e6('0x3'));var moment=require(_0x55e6('0x4'));var BPromise=require(_0x55e6('0x5'));var rp=require(_0x55e6('0x6'));var fs=require('fs');var path=require(_0x55e6('0x7'));var rimraf=require(_0x55e6('0x8'));var config=require('../../config/environment');var attributes=require(_0x55e6('0x9'));module['exports']=function(_0x39bc99,_0x598ee4){return _0x39bc99[_0x55e6('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c3bad,_0x25b4d2,_0x211fe0){if(_0x5c3bad[_0x55e6('0xb')]('closed')){_0x5c3bad[_0x55e6('0xc')]=moment()[_0x55e6('0xd')](_0x55e6('0xe'));}_0x211fe0(null,_0x5c3bad);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 5a18de3..d49853f 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 _0x03e7=['../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','request\x20sent','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x03e7,0x1d2));var _0x703e=function(_0x11b01a,_0x53bb1a){_0x11b01a=_0x11b01a-0x0;var _0x49e250=_0x03e7[_0x11b01a];return _0x49e250;};'use strict';var _=require(_0x703e('0x0'));var util=require(_0x703e('0x1'));var moment=require(_0x703e('0x2'));var BPromise=require(_0x703e('0x3'));var rs=require(_0x703e('0x4'));var fs=require('fs');var Redis=require(_0x703e('0x5'));var db=require(_0x703e('0x6'))['db'];var utils=require(_0x703e('0x7'));var logger=require(_0x703e('0x8'))(_0x703e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x703e('0xa')]({'port':0x232a});config[_0x703e('0xb')]=_[_0x703e('0xc')](config[_0x703e('0xb')],{'host':_0x703e('0xd'),'port':0x18eb});var socket=require(_0x703e('0xe'))(new Redis(config[_0x703e('0xb')]));require(_0x703e('0xf'))[_0x703e('0x10')](socket);function respondWithRpcPromise(_0xef1a39,_0x5c539d,_0x41aac5){return new BPromise(function(_0x4fb09e,_0x3e708e){return client[_0x703e('0x11')](_0xef1a39,_0x41aac5)[_0x703e('0x12')](function(_0x4a6071){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5c539d,'request\x20sent');logger[_0x703e('0x13')](_0x703e('0x14'),_0x5c539d,'request\x20sent',JSON[_0x703e('0x15')](_0x4a6071));if(_0x4a6071[_0x703e('0x16')]){if(_0x4a6071[_0x703e('0x16')][_0x703e('0x17')]===0x1f4){logger[_0x703e('0x16')](_0x703e('0x18'),_0x5c539d,_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);return _0x3e708e(_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);}logger['error'](_0x703e('0x18'),_0x5c539d,_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);return _0x4fb09e(_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5c539d,_0x703e('0x1a'));_0x4fb09e(_0x4a6071['result']['message']);}})[_0x703e('0x1b')](function(_0xb442cb){logger[_0x703e('0x16')](_0x703e('0x18'),_0x5c539d,_0xb442cb);_0x3e708e(_0xb442cb);});});}exports[_0x703e('0x1c')]=function(_0x475283){var _0x41371d=this;return new Promise(function(_0x72a542,_0x45e2cc){return db[_0x703e('0x1d')][_0x703e('0x1e')](_0x475283[_0x703e('0x1f')],{'raw':_0x475283[_0x703e('0x20')]?_0x475283['options'][_0x703e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x475283[_0x703e('0x20')]?_0x475283[_0x703e('0x20')][_0x703e('0x22')]||null:null,'attributes':_0x475283[_0x703e('0x20')]?_0x475283[_0x703e('0x20')][_0x703e('0x23')]||null:null,'limit':_0x475283[_0x703e('0x20')]?_0x475283[_0x703e('0x20')][_0x703e('0x24')]||null:null})[_0x703e('0x12')](function(_0x3b639c){logger['info']('UpdateSmsInteraction',_0x475283);logger[_0x703e('0x13')](_0x703e('0x1c'),_0x475283,JSON[_0x703e('0x15')](_0x3b639c));_0x72a542(_0x3b639c);})[_0x703e('0x1b')](function(_0x1a3aec){logger[_0x703e('0x16')](_0x703e('0x1c'),_0x1a3aec[_0x703e('0x19')],_0x475283);_0x45e2cc(_0x41371d[_0x703e('0x16')](0x1f4,_0x1a3aec[_0x703e('0x19')]));});});};exports[_0x703e('0x25')]=function(_0x287d01){return new Promise(function(_0x40670c,_0x33656d){return db[_0x703e('0x1d')][_0x703e('0x26')]({'where':_0x287d01[_0x703e('0x20')]?_0x287d01[_0x703e('0x20')]['where']||null:null})[_0x703e('0x12')](function(_0x340359){if(_0x340359){return _0x340359['addTags'](_0x287d01[_0x703e('0x1f')][_0x703e('0x27')],_[_0x703e('0x28')](_0x287d01[_0x703e('0x1f')],[_0x703e('0x27'),'id'])||{});}})[_0x703e('0x29')](function(_0x1cba43){logger['info'](_0x703e('0x2a'),_0x287d01);logger[_0x703e('0x13')](_0x703e('0x2a'),_0x287d01,JSON[_0x703e('0x15')](_0x1cba43));_0x40670c(_0x1cba43);})['catch'](function(_0x25d995){logger[_0x703e('0x16')](_0x703e('0x2a'),_0x25d995[_0x703e('0x19')],_0x287d01);_0x33656d(_this[_0x703e('0x16')](0x1f4,_0x25d995[_0x703e('0x19')]));});});}; \ No newline at end of file +var _0x0abc=['stringify','error','code','message','info','result','SmsInteraction','body','options','where','attributes','limit','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','then','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0abc,0x94));var _0xc0ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0abc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc0ab('0x0'));var util=require(_0xc0ab('0x1'));var moment=require(_0xc0ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0ab('0x4'))['db'];var utils=require(_0xc0ab('0x5'));var logger=require(_0xc0ab('0x6'))(_0xc0ab('0x7'));var config=require(_0xc0ab('0x8'));var jayson=require(_0xc0ab('0x9'));var client=jayson[_0xc0ab('0xa')]['http']({'port':0x232a});config[_0xc0ab('0xb')]=_[_0xc0ab('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc0ab('0xd'))(new Redis(config[_0xc0ab('0xb')]));require(_0xc0ab('0xe'))[_0xc0ab('0xf')](socket);function respondWithRpcPromise(_0x480c24,_0x8f061a,_0x2b6e56){return new BPromise(function(_0x437759,_0x2a1ee0){return client[_0xc0ab('0x10')](_0x480c24,_0x2b6e56)['then'](function(_0x58b0d7){logger['info'](_0xc0ab('0x11'),_0x8f061a,_0xc0ab('0x12'));logger[_0xc0ab('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x8f061a,_0xc0ab('0x12'),JSON[_0xc0ab('0x14')](_0x58b0d7));if(_0x58b0d7['error']){if(_0x58b0d7[_0xc0ab('0x15')][_0xc0ab('0x16')]===0x1f4){logger[_0xc0ab('0x15')](_0xc0ab('0x11'),_0x8f061a,_0x58b0d7[_0xc0ab('0x15')][_0xc0ab('0x17')]);return _0x2a1ee0(_0x58b0d7[_0xc0ab('0x15')][_0xc0ab('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x8f061a,_0x58b0d7[_0xc0ab('0x15')]['message']);return _0x437759(_0x58b0d7[_0xc0ab('0x15')][_0xc0ab('0x17')]);}else{logger[_0xc0ab('0x18')](_0xc0ab('0x11'),_0x8f061a,_0xc0ab('0x12'));_0x437759(_0x58b0d7[_0xc0ab('0x19')][_0xc0ab('0x17')]);}})['catch'](function(_0xadb157){logger[_0xc0ab('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x8f061a,_0xadb157);_0x2a1ee0(_0xadb157);});});}exports['UpdateSmsInteraction']=function(_0x5bec74){var _0x346c99=this;return new Promise(function(_0xdb0c02,_0x508e80){return db[_0xc0ab('0x1a')]['update'](_0x5bec74[_0xc0ab('0x1b')],{'raw':_0x5bec74[_0xc0ab('0x1c')]?_0x5bec74[_0xc0ab('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bec74[_0xc0ab('0x1c')]?_0x5bec74[_0xc0ab('0x1c')][_0xc0ab('0x1d')]||null:null,'attributes':_0x5bec74[_0xc0ab('0x1c')]?_0x5bec74[_0xc0ab('0x1c')][_0xc0ab('0x1e')]||null:null,'limit':_0x5bec74[_0xc0ab('0x1c')]?_0x5bec74[_0xc0ab('0x1c')][_0xc0ab('0x1f')]||null:null})['then'](function(_0x19dbf4){logger[_0xc0ab('0x18')](_0xc0ab('0x20'),_0x5bec74);logger[_0xc0ab('0x13')](_0xc0ab('0x20'),_0x5bec74,JSON[_0xc0ab('0x14')](_0x19dbf4));_0xdb0c02(_0x19dbf4);})[_0xc0ab('0x21')](function(_0x2a7fa5){logger['error'](_0xc0ab('0x20'),_0x2a7fa5['message'],_0x5bec74);_0x508e80(_0x346c99[_0xc0ab('0x15')](0x1f4,_0x2a7fa5[_0xc0ab('0x17')]));});});};exports[_0xc0ab('0x22')]=function(_0x3c610d){return new Promise(function(_0x3eac04,_0x414eeb){return db['SmsInteraction'][_0xc0ab('0x23')]({'where':_0x3c610d['options']?_0x3c610d[_0xc0ab('0x1c')]['where']||null:null})[_0xc0ab('0x24')](function(_0xaf4fd){if(_0xaf4fd){return _0xaf4fd[_0xc0ab('0x25')](_0x3c610d['body']['ids'],_[_0xc0ab('0x26')](_0x3c610d['body'],[_0xc0ab('0x27'),'id'])||{});}})[_0xc0ab('0x28')](function(_0x1e8c31){logger[_0xc0ab('0x18')](_0xc0ab('0x29'),_0x3c610d);logger[_0xc0ab('0x13')](_0xc0ab('0x29'),_0x3c610d,JSON[_0xc0ab('0x14')](_0x1e8c31));_0x3eac04(_0x1e8c31);})['catch'](function(_0x274ac){logger[_0xc0ab('0x15')](_0xc0ab('0x29'),_0x274ac[_0xc0ab('0x17')],_0x3c610d);_0x414eeb(_this[_0xc0ab('0x15')](0x1f4,_0x274ac['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a18a3d2..7f1a46e 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 _0x022b=['smsInteraction:','save','remove','emit','register','length'];(function(_0x345a17,_0x3b9d2a){var _0xd0f947=function(_0x519fcd){while(--_0x519fcd){_0x345a17['push'](_0x345a17['shift']());}};_0xd0f947(++_0x3b9d2a);}(_0x022b,0x1a5));var _0xb022=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x022b[_0x7e2eb0];return _0xd92de4;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xb022('0x0'),_0xb022('0x1'),'update'];function createListener(_0x19dbd9,_0x57c698){return function(_0xb7b672){_0x57c698[_0xb022('0x2')](_0x19dbd9,_0xb7b672);};}function removeListener(_0x3111de,_0x140cda){return function(){SmsInteractionEvents['removeListener'](_0x3111de,_0x140cda);};}exports[_0xb022('0x3')]=function(_0x465e67){for(var _0x8087e5=0x0,_0x2ee05d=events[_0xb022('0x4')];_0x8087e5<_0x2ee05d;_0x8087e5++){var _0x4bd95f=events[_0x8087e5];var _0x1d085f=createListener(_0xb022('0x5')+_0x4bd95f,_0x465e67);SmsInteractionEvents['on'](_0x4bd95f,_0x1d085f);}}; \ No newline at end of file +var _0x9270=['save','remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3337b9,_0x4c176f){var _0x580945=function(_0x2f52f7){while(--_0x2f52f7){_0x3337b9['push'](_0x3337b9['shift']());}};_0x580945(++_0x4c176f);}(_0x9270,0x1dc));var _0x0927=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x9270[_0x47b15f];return _0x55bf25;};'use strict';var SmsInteractionEvents=require(_0x0927('0x0'));var events=[_0x0927('0x1'),_0x0927('0x2'),_0x0927('0x3')];function createListener(_0x176920,_0x581fc5){return function(_0xd0e62d){_0x581fc5[_0x0927('0x4')](_0x176920,_0xd0e62d);};}function removeListener(_0x160225,_0x525f40){return function(){SmsInteractionEvents[_0x0927('0x5')](_0x160225,_0x525f40);};}exports[_0x0927('0x6')]=function(_0x359606){for(var _0x519ba6=0x0,_0x163aff=events[_0x0927('0x7')];_0x519ba6<_0x163aff;_0x519ba6++){var _0x7306d1=events[_0x519ba6];var _0x3e237d=createListener(_0x0927('0x8')+_0x7306d1,_0x359606);SmsInteractionEvents['on'](_0x7306d1,_0x3e237d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2462bc6..544f28a 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 _0x3dde=['fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','destroy','util','path','connect-timeout','express','Router'];(function(_0x52f4d2,_0x2b0805){var _0x57cce5=function(_0x4d1079){while(--_0x4d1079){_0x52f4d2['push'](_0x52f4d2['shift']());}};_0x57cce5(++_0x2b0805);}(_0x3dde,0x14b));var _0xe3dd=function(_0x422a51,_0x1782d8){_0x422a51=_0x422a51-0x0;var _0x250b2a=_0x3dde[_0x422a51];return _0x250b2a;};'use strict';var multer=require('multer');var util=require(_0xe3dd('0x0'));var path=require(_0xe3dd('0x1'));var timeout=require(_0xe3dd('0x2'));var express=require(_0xe3dd('0x3'));var router=express[_0xe3dd('0x4')]();var fs_extra=require(_0xe3dd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe3dd('0x6'));var config=require(_0xe3dd('0x7'));var controller=require(_0xe3dd('0x8'));router['get']('/',auth[_0xe3dd('0x9')](),controller[_0xe3dd('0xa')]);router[_0xe3dd('0xb')](_0xe3dd('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xe3dd('0xb')](_0xe3dd('0xd'),auth['isAuthenticated'](),controller[_0xe3dd('0xe')]);router[_0xe3dd('0xf')]('/',auth[_0xe3dd('0x9')](),interaction[_0xe3dd('0x10')](_0xe3dd('0x11'),_0xe3dd('0x12')),controller['create']);router[_0xe3dd('0xf')](_0xe3dd('0x13'),controller[_0xe3dd('0x14')]);router['put'](_0xe3dd('0xd'),auth[_0xe3dd('0x9')](),controller[_0xe3dd('0x15')]);router[_0xe3dd('0x16')](_0xe3dd('0x17'),auth['isAuthenticated'](),controller[_0xe3dd('0x18')]);router['put'](_0xe3dd('0x19'),auth['isAuthenticated'](),controller[_0xe3dd('0x1a')]);router['delete'](_0xe3dd('0xd'),auth[_0xe3dd('0x9')](),controller[_0xe3dd('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x6635=['post','status','put','update','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create'];(function(_0x4926d2,_0x4a91c9){var _0x1eefd2=function(_0x26e7e6){while(--_0x26e7e6){_0x4926d2['push'](_0x4926d2['shift']());}};_0x1eefd2(++_0x4a91c9);}(_0x6635,0x90));var _0x5663=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x6635[_0x39096d];return _0x13da4f;};'use strict';var multer=require('multer');var util=require(_0x5663('0x0'));var path=require(_0x5663('0x1'));var timeout=require(_0x5663('0x2'));var express=require(_0x5663('0x3'));var router=express['Router']();var fs_extra=require(_0x5663('0x4'));var auth=require(_0x5663('0x5'));var interaction=require(_0x5663('0x6'));var config=require(_0x5663('0x7'));var controller=require('./smsMessage.controller');router[_0x5663('0x8')]('/',auth[_0x5663('0x9')](),controller['index']);router[_0x5663('0x8')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0xb')]);router[_0x5663('0x8')](_0x5663('0xc'),auth['isAuthenticated'](),controller[_0x5663('0xd')]);router['post']('/',auth[_0x5663('0x9')](),interaction[_0x5663('0xe')](_0x5663('0xf'),_0x5663('0x10')),controller[_0x5663('0x11')]);router[_0x5663('0x12')]('/:id/status',controller[_0x5663('0x13')]);router[_0x5663('0x14')](_0x5663('0xc'),auth[_0x5663('0x9')](),controller[_0x5663('0x15')]);router[_0x5663('0x14')]('/:id/accept',auth[_0x5663('0x9')](),controller[_0x5663('0x16')]);router[_0x5663('0x14')](_0x5663('0x17'),auth[_0x5663('0x9')](),controller[_0x5663('0x18')]);router[_0x5663('0x19')](_0x5663('0xc'),auth[_0x5663('0x9')](),controller['destroy']);module[_0x5663('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 fd34150..ac0b864 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 _0x1176=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2f85b3,_0x416a6f){var _0x99349d=function(_0x20a835){while(--_0x20a835){_0x2f85b3['push'](_0x2f85b3['shift']());}};_0x99349d(++_0x416a6f);}(_0x1176,0xa3));var _0x6117=function(_0x56aaf5,_0x3d602f){_0x56aaf5=_0x56aaf5-0x0;var _0x2efe21=_0x1176[_0x56aaf5];return _0x2efe21;};'use strict';var Sequelize=require(_0x6117('0x0'));module[_0x6117('0x1')]={'body':{'type':Sequelize[_0x6117('0x2')](_0x6117('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6117('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6117('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6117('0x6')]},'providerResponse':{'type':Sequelize[_0x6117('0x2')]}}; \ No newline at end of file +var _0xbeec=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0x1fa7da,_0x82cb97){var _0x809b2f=function(_0x8fb22a){while(--_0x8fb22a){_0x1fa7da['push'](_0x1fa7da['shift']());}};_0x809b2f(++_0x82cb97);}(_0xbeec,0x76));var _0xcbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xcbee('0x0')](_0xcbee('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xcbee('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcbee('0x3')]('in',_0xcbee('0x4')),'defaultValue':_0xcbee('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcbee('0x5')](0xbe)},'phone':{'type':Sequelize[_0xcbee('0x5')]},'readAt':{'type':Sequelize[_0xcbee('0x6')]},'secret':{'type':Sequelize[_0xcbee('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcbee('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 55b6c48..b2d2958 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 _0x0f97=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','then','destroy','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','rows','params','fields','include','find','create','body','update','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','channel','motionChannel','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','interface','SIP/%s','event','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0f97,0x196));var _0x70f9=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x0f97[_0x2aaa60];return _0x2e3fa5;};'use strict';var emlformat=require(_0x70f9('0x0'));var rimraf=require(_0x70f9('0x1'));var zipdir=require(_0x70f9('0x2'));var jsonpatch=require(_0x70f9('0x3'));var rp=require(_0x70f9('0x4'));var moment=require(_0x70f9('0x5'));var BPromise=require(_0x70f9('0x6'));var Mustache=require(_0x70f9('0x7'));var util=require(_0x70f9('0x8'));var path=require(_0x70f9('0x9'));var sox=require(_0x70f9('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70f9('0xb'));var _=require(_0x70f9('0xc'));var squel=require(_0x70f9('0xd'));var crypto=require(_0x70f9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x70f9('0xf'));var querystring=require(_0x70f9('0x10'));var Papa=require(_0x70f9('0x11'));var Redis=require(_0x70f9('0x12'));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(_0x70f9('0x13'))(_0x70f9('0x14'));var utils=require(_0x70f9('0x15'));var config=require(_0x70f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x70f9('0x17'))['db'];config[_0x70f9('0x18')]=_[_0x70f9('0x19')](config[_0x70f9('0x18')],{'host':_0x70f9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f9('0x18')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x70f9('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x70f9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x36044f,_0x138a8e,_0x3ce5ed,_0x25b88f){return new BPromise(function(_0x2d2226,_0xfa4388){var _0x344590=_0x25b88f||client;return _0x344590[_0x70f9('0x1c')](_0x36044f,_0x3ce5ed)['then'](function(_0x59d036){logger[_0x70f9('0x1d')]('SmsMessage,\x20%s,\x20%s',_0x138a8e,_0x70f9('0x1e'));logger[_0x70f9('0x1f')](_0x70f9('0x20'),_0x138a8e,_0x70f9('0x1e'),JSON['stringify'](_0x59d036));if(_0x59d036['error']){if(_0x59d036[_0x70f9('0x21')][_0x70f9('0x22')]===0x1f4){logger[_0x70f9('0x21')](_0x70f9('0x23'),_0x138a8e,_0x59d036['error'][_0x70f9('0x24')]);return _0xfa4388(_0x59d036['error'][_0x70f9('0x24')]);}logger[_0x70f9('0x21')](_0x70f9('0x23'),_0x138a8e,_0x59d036[_0x70f9('0x21')][_0x70f9('0x24')]);return _0x2d2226(_0x59d036['error'][_0x70f9('0x24')]);}else{logger[_0x70f9('0x1d')](_0x70f9('0x23'),_0x138a8e,'request\x20sent');_0x2d2226(_0x59d036[_0x70f9('0x25')][_0x70f9('0x24')]);}})[_0x70f9('0x26')](function(_0x3c3051){logger[_0x70f9('0x21')]('SmsMessage,\x20%s,\x20%s',_0x138a8e,_0x3c3051);_0xfa4388(_0x3c3051);});});}function respondWithStatusCode(_0x3a8209,_0x74b33c){_0x74b33c=_0x74b33c||0xcc;return function(_0x1139e7){if(_0x1139e7){return _0x3a8209[_0x70f9('0x27')](_0x74b33c);}return _0x3a8209[_0x70f9('0x28')](_0x74b33c)[_0x70f9('0x29')]();};}function respondWithResult(_0x54ddcd,_0x470d0c){_0x470d0c=_0x470d0c||0xc8;return function(_0x37d551){if(_0x37d551){return _0x54ddcd[_0x70f9('0x28')](_0x470d0c)[_0x70f9('0x2a')](_0x37d551);}};}function respondWithFilteredResult(_0x35d452,_0x701ff2){return function(_0x3e29b9){if(_0x3e29b9){var _0x28a8c6=typeof _0x701ff2['offset']==='undefined'&&typeof _0x701ff2[_0x70f9('0x2b')]===_0x70f9('0x2c');var _0x2f805a=_0x3e29b9['count'];var _0x562f5e=_0x28a8c6?0x0:_0x701ff2[_0x70f9('0x2d')];var _0xe9d41f=_0x28a8c6?_0x3e29b9['count']:_0x701ff2['offset']+_0x701ff2[_0x70f9('0x2b')];var _0x17cf3f;if(_0xe9d41f>=_0x2f805a){_0xe9d41f=_0x2f805a;_0x17cf3f=0xc8;}else{_0x17cf3f=0xce;}_0x35d452['status'](_0x17cf3f);return _0x35d452[_0x70f9('0x2e')](_0x70f9('0x2f'),_0x562f5e+'-'+_0xe9d41f+'/'+_0x2f805a)['json'](_0x3e29b9);}return null;};}function patchUpdates(_0x8bc855){return function(_0xb9c6a2){try{jsonpatch[_0x70f9('0x30')](_0xb9c6a2,_0x8bc855,!![]);}catch(_0x54b093){return BPromise[_0x70f9('0x31')](_0x54b093);}return _0xb9c6a2[_0x70f9('0x32')]();};}function saveUpdates(_0x4b9b8d,_0x2ca11e){return function(_0x2ce706){if(_0x2ce706){return _0x2ce706['update'](_0x4b9b8d)[_0x70f9('0x33')](function(_0x214543){return _0x214543;});}return null;};}function removeEntity(_0x375aba,_0x175f3f){return function(_0x191306){if(_0x191306){return _0x191306[_0x70f9('0x34')]()[_0x70f9('0x33')](function(){_0x375aba['status'](0xcc)[_0x70f9('0x29')]();});}};}function handleEntityNotFound(_0x1b98cf,_0x242101){return function(_0x13a5ea){if(!_0x13a5ea){_0x1b98cf[_0x70f9('0x27')](0x194);}return _0x13a5ea;};}function handleError(_0x35ad29,_0x5adf6e){_0x5adf6e=_0x5adf6e||0x1f4;return function(_0x2caf65){logger[_0x70f9('0x21')](_0x2caf65['stack']);if(_0x2caf65[_0x70f9('0x35')]){delete _0x2caf65['name'];}_0x35ad29[_0x70f9('0x28')](_0x5adf6e)['send'](_0x2caf65);};}exports[_0x70f9('0x36')]=function(_0x45b127,_0x38e305){var _0x3385f9={},_0x14a88d={},_0x190bc7={'count':0x0,'rows':[]};var _0x229078=_[_0x70f9('0x37')](db[_0x70f9('0x38')][_0x70f9('0x39')],function(_0x5f2247){return{'name':_0x5f2247[_0x70f9('0x3a')],'type':_0x5f2247[_0x70f9('0x3b')][_0x70f9('0x3c')]};});_0x14a88d[_0x70f9('0x3d')]=_[_0x70f9('0x37')](_0x229078,_0x70f9('0x35'));_0x14a88d['query']=_[_0x70f9('0x3e')](_0x45b127[_0x70f9('0x3f')]);_0x14a88d[_0x70f9('0x40')]=_[_0x70f9('0x41')](_0x14a88d[_0x70f9('0x3d')],_0x14a88d['query']);_0x3385f9[_0x70f9('0x42')]=_['intersection'](_0x14a88d[_0x70f9('0x3d')],qs['fields'](_0x45b127[_0x70f9('0x3f')]['fields']));_0x3385f9[_0x70f9('0x42')]=_0x3385f9['attributes']['length']?_0x3385f9[_0x70f9('0x42')]:_0x14a88d['model'];if(!_0x45b127[_0x70f9('0x3f')]['hasOwnProperty'](_0x70f9('0x43'))){_0x3385f9[_0x70f9('0x2b')]=qs[_0x70f9('0x2b')](_0x45b127['query']['limit']);_0x3385f9[_0x70f9('0x2d')]=qs[_0x70f9('0x2d')](_0x45b127['query'][_0x70f9('0x2d')]);}_0x3385f9[_0x70f9('0x44')]=qs[_0x70f9('0x45')](_0x45b127[_0x70f9('0x3f')][_0x70f9('0x45')]);_0x3385f9[_0x70f9('0x46')]=qs[_0x70f9('0x40')](_['pick'](_0x45b127[_0x70f9('0x3f')],_0x14a88d[_0x70f9('0x40')]),_0x229078);if(_0x45b127[_0x70f9('0x3f')][_0x70f9('0x47')]){_0x3385f9['where']=_[_0x70f9('0x48')](_0x3385f9[_0x70f9('0x46')],{'$or':_[_0x70f9('0x37')](_0x229078,function(_0x3df3cd){if(_0x3df3cd[_0x70f9('0x3b')]!==_0x70f9('0x49')){var _0x531bf1={};_0x531bf1[_0x3df3cd[_0x70f9('0x35')]]={'$like':'%'+_0x45b127[_0x70f9('0x3f')][_0x70f9('0x47')]+'%'};return _0x531bf1;}})});}_0x3385f9=_[_0x70f9('0x48')]({},_0x3385f9,_0x45b127['options']);var _0x394379={'where':_0x3385f9['where']};return db[_0x70f9('0x38')]['count'](_0x394379)[_0x70f9('0x33')](function(_0xb7dc40){_0x190bc7[_0x70f9('0x4a')]=_0xb7dc40;if(_0x45b127[_0x70f9('0x3f')][_0x70f9('0x4b')]){_0x3385f9['include']=[{'all':!![]}];}return db[_0x70f9('0x38')]['findAll'](_0x3385f9);})[_0x70f9('0x33')](function(_0x15b17e){_0x190bc7[_0x70f9('0x4c')]=_0x15b17e;return _0x190bc7;})[_0x70f9('0x33')](respondWithFilteredResult(_0x38e305,_0x3385f9))[_0x70f9('0x26')](handleError(_0x38e305,null));};exports['show']=function(_0x8bc338,_0x580ac4){var _0x58fd12={'raw':!![],'where':{'id':_0x8bc338[_0x70f9('0x4d')]['id']}},_0x36c5bf={};_0x36c5bf['model']=_[_0x70f9('0x3e')](db[_0x70f9('0x38')][_0x70f9('0x39')]);_0x36c5bf[_0x70f9('0x3f')]=_[_0x70f9('0x3e')](_0x8bc338[_0x70f9('0x3f')]);_0x36c5bf[_0x70f9('0x40')]=_[_0x70f9('0x41')](_0x36c5bf[_0x70f9('0x3d')],_0x36c5bf[_0x70f9('0x3f')]);_0x58fd12['attributes']=_[_0x70f9('0x41')](_0x36c5bf[_0x70f9('0x3d')],qs['fields'](_0x8bc338[_0x70f9('0x3f')][_0x70f9('0x4e')]));_0x58fd12[_0x70f9('0x42')]=_0x58fd12[_0x70f9('0x42')]['length']?_0x58fd12[_0x70f9('0x42')]:_0x36c5bf['model'];if(_0x8bc338[_0x70f9('0x3f')][_0x70f9('0x4b')]){_0x58fd12[_0x70f9('0x4f')]=[{'all':!![]}];}_0x58fd12=_[_0x70f9('0x48')]({},_0x58fd12,_0x8bc338['options']);return db['SmsMessage'][_0x70f9('0x50')](_0x58fd12)['then'](handleEntityNotFound(_0x580ac4,null))[_0x70f9('0x33')](respondWithResult(_0x580ac4,null))[_0x70f9('0x26')](handleError(_0x580ac4,null));};exports[_0x70f9('0x51')]=function(_0x47c1be,_0x2ed80c){return db[_0x70f9('0x38')][_0x70f9('0x51')](_0x47c1be[_0x70f9('0x52')],{})[_0x70f9('0x33')](respondWithResult(_0x2ed80c,0xc9))[_0x70f9('0x26')](handleError(_0x2ed80c,null));};exports[_0x70f9('0x53')]=function(_0x402696,_0xaa9bcb){if(_0x402696[_0x70f9('0x52')]['id']){delete _0x402696[_0x70f9('0x52')]['id'];}return db[_0x70f9('0x38')]['find']({'where':{'id':_0x402696[_0x70f9('0x4d')]['id']}})[_0x70f9('0x33')](handleEntityNotFound(_0xaa9bcb,null))['then'](saveUpdates(_0x402696[_0x70f9('0x52')],null))[_0x70f9('0x33')](respondWithResult(_0xaa9bcb,null))[_0x70f9('0x26')](handleError(_0xaa9bcb,null));};exports[_0x70f9('0x34')]=function(_0x4d8b01,_0x389c86){return db['SmsMessage']['find']({'where':{'id':_0x4d8b01['params']['id']}})[_0x70f9('0x33')](handleEntityNotFound(_0x389c86,null))['then'](removeEntity(_0x389c86,null))[_0x70f9('0x26')](handleError(_0x389c86,null));};exports[_0x70f9('0x54')]=function(_0xc1f296,_0x487b25){return db[_0x70f9('0x38')][_0x70f9('0x54')]()[_0x70f9('0x33')](respondWithResult(_0x487b25,null))[_0x70f9('0x26')](handleError(_0x487b25,null));};var interaction_log=require(_0x70f9('0x13'))(_0x70f9('0x55'));exports[_0x70f9('0x56')]=function(_0x4adec7,_0x2e6a2d,_0x1ee638){var _0x19e933={'agent':{},'channel':_0x70f9('0x57')};if(_0x4adec7[_0x70f9('0x52')]['id']){delete _0x4adec7['body']['id'];}_0x4adec7[_0x70f9('0x52')][_0x70f9('0x58')]=!![];_0x4adec7[_0x70f9('0x52')]['readAt']=moment()[_0x70f9('0x59')](_0x70f9('0x5a'));_0x4adec7[_0x70f9('0x52')][_0x70f9('0x5b')]=_0x4adec7[_0x70f9('0x52')]['UserId']||_0x4adec7[_0x70f9('0x5c')]['id'];_0x19e933[_0x70f9('0x5d')]['id']=_0x4adec7[_0x70f9('0x52')][_0x70f9('0x5b')];return db[_0x70f9('0x38')]['find']({'where':{'id':_0x4adec7[_0x70f9('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e6a2d,null))[_0x70f9('0x33')](saveUpdates(_0x4adec7[_0x70f9('0x52')],null))[_0x70f9('0x33')](function(_0x3746c3){if(_0x3746c3){_0x19e933[_0x70f9('0x24')]=_0x3746c3[_0x70f9('0x5e')]({'plain':!![]});return db[_0x70f9('0x5f')][_0x70f9('0x50')]({'where':{'id':_0x3746c3['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2e6a2d,null))[_0x70f9('0x33')](function(_0x581456){if(_0x581456){return _0x581456[_0x70f9('0x53')]({'UserId':_0x4adec7[_0x70f9('0x52')][_0x70f9('0x5b')],'read1stAt':_[_0x70f9('0x60')](_0x581456['read1stAt'])?moment()[_0x70f9('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x70f9('0x33')](function(_0x77722b){if(_0x77722b){_0x19e933['interaction']=_0x77722b['get']({'plain':!![]});interaction_log[_0x70f9('0x1d')](_0x70f9('0x61'),_0x4adec7['user']['id'],_0x4adec7[_0x70f9('0x5c')][_0x70f9('0x35')],_0x4adec7[_0x70f9('0x5c')][_0x70f9('0x62')],_0x19e933[_0x70f9('0x63')]['id'],_0x4adec7[_0x70f9('0x52')]?JSON[_0x70f9('0x64')](_0x4adec7['body']):_0x70f9('0x65'));return respondWithRpcPromise(_0x70f9('0x66'),_0x70f9('0x67'),_0x19e933);}return null;})['then'](function(_0x33e959){var _0x25d9bf=_0x70f9('0x68')+_0x33e959[_0x70f9('0x24')][_0x70f9('0x69')];return db[_0x70f9('0x6a')][_0x70f9('0x3f')](_0x25d9bf,{'type':db[_0x70f9('0x6b')][_0x70f9('0x6c')][_0x70f9('0x6d')],'raw':!![]})['then'](function(_0xd46dc3){return _0xd46dc3;});})['then'](function(_0x1a2ba0){if(_0x1a2ba0){_0x19e933['message']['contact']=_0x1a2ba0[0x0];if(!_0x4adec7[_0x70f9('0x52')][_0x70f9('0x5b')])return;return db['User'][_0x70f9('0x50')]({'where':{'id':_0x4adec7['body'][_0x70f9('0x5b')],'role':'agent'},'attributes':['id',_0x70f9('0x35'),_0x70f9('0x6e'),_0x70f9('0x6f'),_0x70f9('0x70')],'raw':!![]});}return null;})['then'](function(_0x49a4c4){if(!_0x49a4c4)return null;_0x19e933[_0x70f9('0x24')][_0x70f9('0x5d')]=_0x49a4c4;return _0x19e933;})[_0x70f9('0x33')](function(_0x30f746){if(_0x30f746){if(_0x4adec7['body'][_0x70f9('0x71')]){_0x19e933[_0x70f9('0x24')]['interface']=util[_0x70f9('0x59')]('SIP/%s',_0x4adec7[_0x70f9('0x5c')]['name']);_0x19e933[_0x70f9('0x24')][_0x70f9('0x72')]=_0x19e933[_0x70f9('0x72')];_0x19e933[_0x70f9('0x24')][_0x70f9('0x73')]=_0x19e933[_0x70f9('0x72')];_0x19e933['message']['event']='accept';return respondWithRpcPromise(_0x70f9('0x74'),_0x70f9('0x74'),{'event':_0x70f9('0x75'),'message':_0x19e933[_0x70f9('0x24')]},client9002)[_0x70f9('0x33')](function(){return _0x19e933;});}return _0x19e933;}return null;})[_0x70f9('0x33')](respondWithResult(_0x2e6a2d,null))['catch'](handleError(_0x2e6a2d,null));};var interaction_log=require(_0x70f9('0x13'))('sms-interactions');exports[_0x70f9('0x31')]=function(_0x3d2108,_0x44fc2e,_0x58d1a0){var _0x1c2228={'agent':{},'channel':_0x70f9('0x57')};if(_0x3d2108[_0x70f9('0x52')]['id']){delete _0x3d2108[_0x70f9('0x52')]['id'];}_0x3d2108[_0x70f9('0x52')][_0x70f9('0x5b')]=_0x3d2108[_0x70f9('0x52')]['UserId']||_0x3d2108[_0x70f9('0x5c')]['id'];_0x1c2228[_0x70f9('0x5d')]['id']=_0x3d2108[_0x70f9('0x52')]['UserId'];return db[_0x70f9('0x38')][_0x70f9('0x50')]({'where':{'id':_0x3d2108[_0x70f9('0x4d')]['id'],'UserId':null}})[_0x70f9('0x33')](handleEntityNotFound(_0x44fc2e,null))[_0x70f9('0x33')](function(_0x1bdb01){if(_0x1bdb01){_0x1c2228['message']=_0x1bdb01['get']({'plain':!![]});return db[_0x70f9('0x5f')]['find']({'where':{'id':_0x1bdb01[_0x70f9('0x76')]}});}return null;})[_0x70f9('0x33')](handleEntityNotFound(_0x44fc2e,null))[_0x70f9('0x33')](function(_0x5796a8){if(_0x5796a8){_0x1c2228['interaction']=_0x5796a8[_0x70f9('0x5e')]({'plain':!![]});interaction_log[_0x70f9('0x1d')](_0x70f9('0x77'),_0x3d2108[_0x70f9('0x5c')]['id'],_0x3d2108[_0x70f9('0x5c')]['name'],_0x3d2108['user'][_0x70f9('0x62')],_0x1c2228['interaction']['id'],_0x3d2108[_0x70f9('0x52')]?JSON['stringify'](_0x3d2108[_0x70f9('0x52')]):_0x70f9('0x65'));return respondWithRpcPromise('RejectMessage',_0x70f9('0x78'),_0x1c2228);}return null;})[_0x70f9('0x33')](function(_0x1208a5){var _0x4b5c10='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1208a5[_0x70f9('0x24')][_0x70f9('0x69')];return db[_0x70f9('0x6a')][_0x70f9('0x3f')](_0x4b5c10,{'type':db['Sequelize'][_0x70f9('0x6c')][_0x70f9('0x6d')],'raw':!![]})[_0x70f9('0x33')](function(_0x5214d8){return _0x5214d8;});})[_0x70f9('0x33')](function(_0x36469e){if(_0x36469e){_0x1c2228['message']['contact']=_0x36469e[0x0];if(!_0x3d2108[_0x70f9('0x52')][_0x70f9('0x5b')])return;return db[_0x70f9('0x79')][_0x70f9('0x50')]({'where':{'id':_0x3d2108['body'][_0x70f9('0x5b')],'role':'agent'},'attributes':['id','name',_0x70f9('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0x70f9('0x33')](function(_0x5456a8){if(!_0x5456a8)return null;_0x1c2228[_0x70f9('0x24')][_0x70f9('0x5d')]=_0x5456a8;return _0x1c2228;})['then'](function(_0x13f267){if(_0x13f267){_0x13f267['message'][_0x70f9('0x7a')]=util['format'](_0x70f9('0x7b'),_0x3d2108[_0x70f9('0x5c')][_0x70f9('0x35')]);_0x13f267[_0x70f9('0x24')][_0x70f9('0x72')]=_0x1c2228[_0x70f9('0x72')];_0x13f267[_0x70f9('0x24')]['motionChannel']=_0x1c2228['channel'];_0x13f267[_0x70f9('0x24')][_0x70f9('0x7c')]=_0x70f9('0x31');respondWithRpcPromise(_0x70f9('0x74'),'EventManager',{'event':'rejectmessage','message':_0x13f267['message']},client9002);return _0x1c2228;}return null;})['then'](respondWithResult(_0x44fc2e,null))[_0x70f9('0x26')](handleError(_0x44fc2e,null));};exports[_0x70f9('0x28')]=function(_0x3b28f0,_0x41ea52,_0x230f9c){if(_0x3b28f0[_0x70f9('0x52')]['id']){delete _0x3b28f0[_0x70f9('0x52')]['id'];}var _0x8a9812;return db[_0x70f9('0x38')][_0x70f9('0x50')]({'where':{'id':_0x3b28f0['params']['id']}})[_0x70f9('0x33')](handleEntityNotFound(_0x41ea52,null))[_0x70f9('0x33')](function(_0x396453){if(_0x396453){_0x8a9812=_0x396453;return db[_0x70f9('0x7d')][_0x70f9('0x50')]({'where':{'id':_0x396453[_0x70f9('0x7e')]}});}})['then'](handleEntityNotFound(_0x41ea52,null))[_0x70f9('0x33')](function(_0x546f23){if(_0x546f23){logger[_0x70f9('0x1f')](_0x70f9('0x20'),_0x70f9('0x28'),'received\x20delivery\x20report\x20from',_0x546f23[_0x70f9('0x3b')],util[_0x70f9('0x7f')](_0x3b28f0[_0x70f9('0x52')],{'showHidden':![],'depth':null}));switch(_0x546f23[_0x70f9('0x3b')]){case _0x70f9('0x80'):if(_0x3b28f0[_0x70f9('0x52')][_0x70f9('0x81')]&&_0x3b28f0[_0x70f9('0x52')][_0x70f9('0x81')]===_0x8a9812[_0x70f9('0x82')]){return _0x8a9812[_0x70f9('0x53')]({'read':!![]});}else{logger[_0x70f9('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x70f9('0x28'),_0x70f9('0x80'),util[_0x70f9('0x7f')](_0x3b28f0[_0x70f9('0x52')],{'showHidden':![],'depth':null}));}break;case _0x70f9('0x83'):if(_0x3b28f0[_0x70f9('0x52')][_0x70f9('0x84')]&&_0x3b28f0[_0x70f9('0x52')][_0x70f9('0x84')]===_0x8a9812[_0x70f9('0x82')]&&_['indexOf']([_0x70f9('0x85'),_0x70f9('0x86')],_0x3b28f0[_0x70f9('0x52')][_0x70f9('0x87')])>=0x0){return _0x8a9812[_0x70f9('0x53')]({'read':!![]});}else{logger['error'](_0x70f9('0x88'),_0x70f9('0x28'),_0x70f9('0x89'),util[_0x70f9('0x7f')](_0x3b28f0[_0x70f9('0x52')],{'showHidden':![],'depth':null}));}break;case _0x70f9('0x8a'):var _0x56d511=_0x3b28f0['body'][_0x70f9('0x8b')][0x0];if(_0x56d511['status'][_0x70f9('0x8c')]===_0x70f9('0x8d')){return _0x8a9812[_0x70f9('0x53')]({'read':!![]});}else{logger[_0x70f9('0x21')](_0x70f9('0x88'),_0x70f9('0x28'),_0x70f9('0x8a'),util[_0x70f9('0x7f')](_0x3b28f0[_0x70f9('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x8a9812;}})[_0x70f9('0x33')](respondWithResult(_0x41ea52,null))['catch'](handleError(_0x41ea52,null));}; \ No newline at end of file +var _0xe354=['reject','save','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','pick','filter','where','type','VIRTUAL','merge','options','SmsMessage','includeAll','include','findAll','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','update','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','count','set','apply'];(function(_0x53308b,_0x28dc1a){var _0x5eac23=function(_0x30fe72){while(--_0x30fe72){_0x53308b['push'](_0x53308b['shift']());}};_0x5eac23(++_0x28dc1a);}(_0xe354,0x187));var _0x4e35=function(_0x557112,_0x507e55){_0x557112=_0x557112-0x0;var _0xd48f2c=_0xe354[_0x557112];return _0xd48f2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4e35('0x0'));var jsonpatch=require(_0x4e35('0x1'));var rp=require('request-promise');var moment=require(_0x4e35('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4e35('0x3'));var util=require(_0x4e35('0x4'));var path=require(_0x4e35('0x5'));var sox=require(_0x4e35('0x6'));var csv=require(_0x4e35('0x7'));var ejs=require(_0x4e35('0x8'));var fs=require('fs');var fs_extra=require(_0x4e35('0x9'));var _=require(_0x4e35('0xa'));var squel=require('squel');var crypto=require(_0x4e35('0xb'));var jsforce=require(_0x4e35('0xc'));var deskjs=require(_0x4e35('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4e35('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e35('0xf'));var as=require(_0x4e35('0x10'));var hardwareService=require(_0x4e35('0x11'));var logger=require(_0x4e35('0x12'))(_0x4e35('0x13'));var utils=require(_0x4e35('0x14'));var config=require(_0x4e35('0x15'));var licenseUtil=require(_0x4e35('0x16'));var db=require(_0x4e35('0x17'))['db'];config[_0x4e35('0x18')]=_['defaults'](config['redis'],{'host':_0x4e35('0x19'),'port':0x18eb});var socket=require(_0x4e35('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x4e35('0x1b')](socket);var jayson=require(_0x4e35('0x1c'));var client=jayson[_0x4e35('0x1d')][_0x4e35('0x1e')]({'port':0x232c});var client9002=jayson[_0x4e35('0x1d')][_0x4e35('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xfe9f0a,_0x579029,_0x307d65,_0x3377ec){return new BPromise(function(_0x4aa4c8,_0x112ecf){var _0x2a6103=_0x3377ec||client;return _0x2a6103['request'](_0xfe9f0a,_0x307d65)[_0x4e35('0x1f')](function(_0x2270e4){logger[_0x4e35('0x20')]('SmsMessage,\x20%s,\x20%s',_0x579029,'request\x20sent');logger[_0x4e35('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x579029,_0x4e35('0x22'),JSON[_0x4e35('0x23')](_0x2270e4));if(_0x2270e4[_0x4e35('0x24')]){if(_0x2270e4['error'][_0x4e35('0x25')]===0x1f4){logger[_0x4e35('0x24')](_0x4e35('0x26'),_0x579029,_0x2270e4[_0x4e35('0x24')]['message']);return _0x112ecf(_0x2270e4[_0x4e35('0x24')][_0x4e35('0x27')]);}logger[_0x4e35('0x24')](_0x4e35('0x26'),_0x579029,_0x2270e4[_0x4e35('0x24')][_0x4e35('0x27')]);return _0x4aa4c8(_0x2270e4[_0x4e35('0x24')][_0x4e35('0x27')]);}else{logger['info'](_0x4e35('0x26'),_0x579029,_0x4e35('0x22'));_0x4aa4c8(_0x2270e4[_0x4e35('0x28')][_0x4e35('0x27')]);}})[_0x4e35('0x29')](function(_0x171533){logger['error']('SmsMessage,\x20%s,\x20%s',_0x579029,_0x171533);_0x112ecf(_0x171533);});});}function respondWithStatusCode(_0x1c0bbb,_0x573d9d){_0x573d9d=_0x573d9d||0xcc;return function(_0x3e6805){if(_0x3e6805){return _0x1c0bbb['sendStatus'](_0x573d9d);}return _0x1c0bbb[_0x4e35('0x2a')](_0x573d9d)[_0x4e35('0x2b')]();};}function respondWithResult(_0x5e0a03,_0x1c0f71){_0x1c0f71=_0x1c0f71||0xc8;return function(_0x19a1b0){if(_0x19a1b0){return _0x5e0a03[_0x4e35('0x2a')](_0x1c0f71)[_0x4e35('0x2c')](_0x19a1b0);}};}function respondWithFilteredResult(_0x2b5505,_0x4689e7){return function(_0x1b89fa){if(_0x1b89fa){var _0x2afe93=typeof _0x4689e7[_0x4e35('0x2d')]==='undefined'&&typeof _0x4689e7[_0x4e35('0x2e')]==='undefined';var _0xef4db4=_0x1b89fa[_0x4e35('0x2f')];var _0x32e07b=_0x2afe93?0x0:_0x4689e7[_0x4e35('0x2d')];var _0x49f217=_0x2afe93?_0x1b89fa['count']:_0x4689e7[_0x4e35('0x2d')]+_0x4689e7[_0x4e35('0x2e')];var _0x44637e;if(_0x49f217>=_0xef4db4){_0x49f217=_0xef4db4;_0x44637e=0xc8;}else{_0x44637e=0xce;}_0x2b5505[_0x4e35('0x2a')](_0x44637e);return _0x2b5505[_0x4e35('0x30')]('Content-Range',_0x32e07b+'-'+_0x49f217+'/'+_0xef4db4)[_0x4e35('0x2c')](_0x1b89fa);}return null;};}function patchUpdates(_0x2e4b5e){return function(_0x42154b){try{jsonpatch[_0x4e35('0x31')](_0x42154b,_0x2e4b5e,!![]);}catch(_0x2844af){return BPromise[_0x4e35('0x32')](_0x2844af);}return _0x42154b[_0x4e35('0x33')]();};}function saveUpdates(_0x516048,_0x138f27){return function(_0x3d4865){if(_0x3d4865){return _0x3d4865['update'](_0x516048)[_0x4e35('0x1f')](function(_0x3cd9b3){return _0x3cd9b3;});}return null;};}function removeEntity(_0x102fb3,_0x24b672){return function(_0x4f45ad){if(_0x4f45ad){return _0x4f45ad[_0x4e35('0x34')]()[_0x4e35('0x1f')](function(){_0x102fb3[_0x4e35('0x2a')](0xcc)[_0x4e35('0x2b')]();});}};}function handleEntityNotFound(_0x39d19d,_0x36a12e){return function(_0x21ef0b){if(!_0x21ef0b){_0x39d19d[_0x4e35('0x35')](0x194);}return _0x21ef0b;};}function handleError(_0x3e42d3,_0x562496){_0x562496=_0x562496||0x1f4;return function(_0x55115d){logger[_0x4e35('0x24')](_0x55115d[_0x4e35('0x36')]);if(_0x55115d['name']){delete _0x55115d[_0x4e35('0x37')];}_0x3e42d3[_0x4e35('0x2a')](_0x562496)['send'](_0x55115d);};}exports[_0x4e35('0x38')]=function(_0x14a2c7,_0x5cc1de){var _0x28154f={},_0x1d159d={},_0x4e41a9={'count':0x0,'rows':[]};var _0x5f5887=_[_0x4e35('0x39')](db['SmsMessage'][_0x4e35('0x3a')],function(_0x446ef0){return{'name':_0x446ef0[_0x4e35('0x3b')],'type':_0x446ef0['type'][_0x4e35('0x3c')]};});_0x1d159d[_0x4e35('0x3d')]=_[_0x4e35('0x39')](_0x5f5887,_0x4e35('0x37'));_0x1d159d[_0x4e35('0x3e')]=_[_0x4e35('0x3f')](_0x14a2c7[_0x4e35('0x3e')]);_0x1d159d[_0x4e35('0x40')]=_[_0x4e35('0x41')](_0x1d159d[_0x4e35('0x3d')],_0x1d159d[_0x4e35('0x3e')]);_0x28154f[_0x4e35('0x42')]=_['intersection'](_0x1d159d[_0x4e35('0x3d')],qs['fields'](_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x43')]));_0x28154f[_0x4e35('0x42')]=_0x28154f['attributes'][_0x4e35('0x44')]?_0x28154f[_0x4e35('0x42')]:_0x1d159d[_0x4e35('0x3d')];if(!_0x14a2c7[_0x4e35('0x3e')]['hasOwnProperty'](_0x4e35('0x45'))){_0x28154f[_0x4e35('0x2e')]=qs[_0x4e35('0x2e')](_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x2e')]);_0x28154f[_0x4e35('0x2d')]=qs[_0x4e35('0x2d')](_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x2d')]);}_0x28154f['order']=qs['sort'](_0x14a2c7[_0x4e35('0x3e')]['sort']);_0x28154f['where']=qs[_0x4e35('0x40')](_[_0x4e35('0x46')](_0x14a2c7['query'],_0x1d159d[_0x4e35('0x40')]),_0x5f5887);if(_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x47')]){_0x28154f[_0x4e35('0x48')]=_['merge'](_0x28154f[_0x4e35('0x48')],{'$or':_[_0x4e35('0x39')](_0x5f5887,function(_0x3ed68a){if(_0x3ed68a[_0x4e35('0x49')]!==_0x4e35('0x4a')){var _0x26f456={};_0x26f456[_0x3ed68a[_0x4e35('0x37')]]={'$like':'%'+_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x47')]+'%'};return _0x26f456;}})});}_0x28154f=_[_0x4e35('0x4b')]({},_0x28154f,_0x14a2c7[_0x4e35('0x4c')]);var _0x2a2781={'where':_0x28154f[_0x4e35('0x48')]};return db[_0x4e35('0x4d')]['count'](_0x2a2781)[_0x4e35('0x1f')](function(_0x4d5391){_0x4e41a9['count']=_0x4d5391;if(_0x14a2c7[_0x4e35('0x3e')][_0x4e35('0x4e')]){_0x28154f[_0x4e35('0x4f')]=[{'all':!![]}];}return db[_0x4e35('0x4d')][_0x4e35('0x50')](_0x28154f);})[_0x4e35('0x1f')](function(_0x1eeaf6){_0x4e41a9['rows']=_0x1eeaf6;return _0x4e41a9;})[_0x4e35('0x1f')](respondWithFilteredResult(_0x5cc1de,_0x28154f))[_0x4e35('0x29')](handleError(_0x5cc1de,null));};exports[_0x4e35('0x51')]=function(_0x54383e,_0x549c17){var _0x45c55b={'raw':!![],'where':{'id':_0x54383e[_0x4e35('0x52')]['id']}},_0x7c5243={};_0x7c5243[_0x4e35('0x3d')]=_[_0x4e35('0x3f')](db[_0x4e35('0x4d')]['rawAttributes']);_0x7c5243[_0x4e35('0x3e')]=_[_0x4e35('0x3f')](_0x54383e['query']);_0x7c5243[_0x4e35('0x40')]=_['intersection'](_0x7c5243[_0x4e35('0x3d')],_0x7c5243['query']);_0x45c55b[_0x4e35('0x42')]=_[_0x4e35('0x41')](_0x7c5243['model'],qs['fields'](_0x54383e[_0x4e35('0x3e')]['fields']));_0x45c55b[_0x4e35('0x42')]=_0x45c55b[_0x4e35('0x42')]['length']?_0x45c55b[_0x4e35('0x42')]:_0x7c5243[_0x4e35('0x3d')];if(_0x54383e[_0x4e35('0x3e')]['includeAll']){_0x45c55b['include']=[{'all':!![]}];}_0x45c55b=_[_0x4e35('0x4b')]({},_0x45c55b,_0x54383e[_0x4e35('0x4c')]);return db[_0x4e35('0x4d')][_0x4e35('0x53')](_0x45c55b)[_0x4e35('0x1f')](handleEntityNotFound(_0x549c17,null))[_0x4e35('0x1f')](respondWithResult(_0x549c17,null))[_0x4e35('0x29')](handleError(_0x549c17,null));};exports['create']=function(_0xb27cd8,_0x4c74a){return db[_0x4e35('0x4d')][_0x4e35('0x54')](_0xb27cd8[_0x4e35('0x55')],{})['then'](respondWithResult(_0x4c74a,0xc9))['catch'](handleError(_0x4c74a,null));};exports['update']=function(_0x14f8dd,_0x475344){if(_0x14f8dd[_0x4e35('0x55')]['id']){delete _0x14f8dd[_0x4e35('0x55')]['id'];}return db[_0x4e35('0x4d')][_0x4e35('0x53')]({'where':{'id':_0x14f8dd[_0x4e35('0x52')]['id']}})[_0x4e35('0x1f')](handleEntityNotFound(_0x475344,null))[_0x4e35('0x1f')](saveUpdates(_0x14f8dd[_0x4e35('0x55')],null))[_0x4e35('0x1f')](respondWithResult(_0x475344,null))[_0x4e35('0x29')](handleError(_0x475344,null));};exports[_0x4e35('0x34')]=function(_0xb592f7,_0x109627){return db[_0x4e35('0x4d')][_0x4e35('0x53')]({'where':{'id':_0xb592f7[_0x4e35('0x52')]['id']}})[_0x4e35('0x1f')](handleEntityNotFound(_0x109627,null))[_0x4e35('0x1f')](removeEntity(_0x109627,null))[_0x4e35('0x29')](handleError(_0x109627,null));};exports[_0x4e35('0x56')]=function(_0x3c7199,_0x3e149e){return db[_0x4e35('0x4d')][_0x4e35('0x56')]()['then'](respondWithResult(_0x3e149e,null))[_0x4e35('0x29')](handleError(_0x3e149e,null));};var interaction_log=require(_0x4e35('0x12'))(_0x4e35('0x57'));exports[_0x4e35('0x58')]=function(_0x1151fc,_0x5d2b84,_0x10fafd){var _0x39ea66={'agent':{},'channel':_0x4e35('0x59')};if(_0x1151fc[_0x4e35('0x55')]['id']){delete _0x1151fc[_0x4e35('0x55')]['id'];}_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5a')]=!![];_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5b')]=moment()[_0x4e35('0x5c')](_0x4e35('0x5d'));_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5e')]=_0x1151fc[_0x4e35('0x55')]['UserId']||_0x1151fc[_0x4e35('0x5f')]['id'];_0x39ea66[_0x4e35('0x60')]['id']=_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5e')];return db['SmsMessage'][_0x4e35('0x53')]({'where':{'id':_0x1151fc[_0x4e35('0x52')]['id'],'UserId':null}})[_0x4e35('0x1f')](handleEntityNotFound(_0x5d2b84,null))['then'](saveUpdates(_0x1151fc['body'],null))[_0x4e35('0x1f')](function(_0x99cb1){if(_0x99cb1){_0x39ea66[_0x4e35('0x27')]=_0x99cb1[_0x4e35('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x4e35('0x53')]({'where':{'id':_0x99cb1['SmsInteractionId']}});}return null;})[_0x4e35('0x1f')](handleEntityNotFound(_0x5d2b84,null))['then'](function(_0x4b9991){if(_0x4b9991){return _0x4b9991[_0x4e35('0x62')]({'UserId':_0x1151fc['body']['UserId'],'read1stAt':_[_0x4e35('0x63')](_0x4b9991[_0x4e35('0x64')])?moment()['format'](_0x4e35('0x5d')):undefined});}return null;})[_0x4e35('0x1f')](function(_0x193662){if(_0x193662){_0x39ea66[_0x4e35('0x65')]=_0x193662['get']({'plain':!![]});interaction_log['info'](_0x4e35('0x66'),_0x1151fc[_0x4e35('0x5f')]['id'],_0x1151fc[_0x4e35('0x5f')][_0x4e35('0x37')],_0x1151fc[_0x4e35('0x5f')][_0x4e35('0x67')],_0x39ea66[_0x4e35('0x65')]['id'],_0x1151fc[_0x4e35('0x55')]?JSON[_0x4e35('0x23')](_0x1151fc['body']):_0x4e35('0x68'));return respondWithRpcPromise(_0x4e35('0x69'),'acceptMessage',_0x39ea66);}return null;})[_0x4e35('0x1f')](function(_0x53350f){var _0x2dbc34=_0x4e35('0x6a')+_0x53350f[_0x4e35('0x27')][_0x4e35('0x6b')];return db[_0x4e35('0x6c')][_0x4e35('0x3e')](_0x2dbc34,{'type':db[_0x4e35('0x6d')][_0x4e35('0x6e')][_0x4e35('0x6f')],'raw':!![]})[_0x4e35('0x1f')](function(_0x495bab){return _0x495bab;});})['then'](function(_0x158a45){if(_0x158a45){_0x39ea66[_0x4e35('0x27')][_0x4e35('0x70')]=_0x158a45[0x0];if(!_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5e')])return;return db[_0x4e35('0x71')][_0x4e35('0x53')]({'where':{'id':_0x1151fc[_0x4e35('0x55')][_0x4e35('0x5e')],'role':'agent'},'attributes':['id','name',_0x4e35('0x72'),_0x4e35('0x73'),_0x4e35('0x74')],'raw':!![]});}return null;})[_0x4e35('0x1f')](function(_0x286db3){if(!_0x286db3)return null;_0x39ea66[_0x4e35('0x27')][_0x4e35('0x60')]=_0x286db3;return _0x39ea66;})[_0x4e35('0x1f')](function(_0x8660f3){if(_0x8660f3){if(_0x1151fc[_0x4e35('0x55')]['manual']){_0x39ea66[_0x4e35('0x27')][_0x4e35('0x75')]=util[_0x4e35('0x5c')](_0x4e35('0x76'),_0x1151fc['user'][_0x4e35('0x37')]);_0x39ea66[_0x4e35('0x27')][_0x4e35('0x77')]=_0x39ea66[_0x4e35('0x77')];_0x39ea66[_0x4e35('0x27')][_0x4e35('0x78')]=_0x39ea66[_0x4e35('0x77')];_0x39ea66[_0x4e35('0x27')][_0x4e35('0x79')]=_0x4e35('0x58');return respondWithRpcPromise('EventManager',_0x4e35('0x7a'),{'event':'acceptmessage','message':_0x39ea66['message']},client9002)[_0x4e35('0x1f')](function(){return _0x39ea66;});}return _0x39ea66;}return null;})[_0x4e35('0x1f')](respondWithResult(_0x5d2b84,null))[_0x4e35('0x29')](handleError(_0x5d2b84,null));};var interaction_log=require(_0x4e35('0x12'))('sms-interactions');exports['reject']=function(_0x407d03,_0x230713,_0x266c9d){var _0x820ebb={'agent':{},'channel':'sms'};if(_0x407d03['body']['id']){delete _0x407d03[_0x4e35('0x55')]['id'];}_0x407d03[_0x4e35('0x55')][_0x4e35('0x5e')]=_0x407d03['body'][_0x4e35('0x5e')]||_0x407d03[_0x4e35('0x5f')]['id'];_0x820ebb['agent']['id']=_0x407d03[_0x4e35('0x55')][_0x4e35('0x5e')];return db[_0x4e35('0x4d')][_0x4e35('0x53')]({'where':{'id':_0x407d03[_0x4e35('0x52')]['id'],'UserId':null}})[_0x4e35('0x1f')](handleEntityNotFound(_0x230713,null))[_0x4e35('0x1f')](function(_0x6f2a5b){if(_0x6f2a5b){_0x820ebb[_0x4e35('0x27')]=_0x6f2a5b[_0x4e35('0x61')]({'plain':!![]});return db[_0x4e35('0x7b')][_0x4e35('0x53')]({'where':{'id':_0x6f2a5b[_0x4e35('0x7c')]}});}return null;})['then'](handleEntityNotFound(_0x230713,null))[_0x4e35('0x1f')](function(_0x30563f){if(_0x30563f){_0x820ebb[_0x4e35('0x65')]=_0x30563f[_0x4e35('0x61')]({'plain':!![]});interaction_log['info'](_0x4e35('0x7d'),_0x407d03['user']['id'],_0x407d03['user'][_0x4e35('0x37')],_0x407d03['user']['role'],_0x820ebb[_0x4e35('0x65')]['id'],_0x407d03[_0x4e35('0x55')]?JSON[_0x4e35('0x23')](_0x407d03[_0x4e35('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0x4e35('0x7e'),_0x820ebb);}return null;})['then'](function(_0x5db221){var _0x25d28a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5db221['message']['ContactId'];return db[_0x4e35('0x6c')]['query'](_0x25d28a,{'type':db[_0x4e35('0x6d')][_0x4e35('0x6e')]['SELECT'],'raw':!![]})[_0x4e35('0x1f')](function(_0x401775){return _0x401775;});})['then'](function(_0x283a00){if(_0x283a00){_0x820ebb['message'][_0x4e35('0x70')]=_0x283a00[0x0];if(!_0x407d03[_0x4e35('0x55')][_0x4e35('0x5e')])return;return db['User'][_0x4e35('0x53')]({'where':{'id':_0x407d03[_0x4e35('0x55')][_0x4e35('0x5e')],'role':_0x4e35('0x60')},'attributes':['id',_0x4e35('0x37'),_0x4e35('0x72'),_0x4e35('0x73'),_0x4e35('0x74')],'raw':!![]});}return null;})[_0x4e35('0x1f')](function(_0x27510a){if(!_0x27510a)return null;_0x820ebb['message'][_0x4e35('0x60')]=_0x27510a;return _0x820ebb;})[_0x4e35('0x1f')](function(_0x2bf9e8){if(_0x2bf9e8){_0x2bf9e8[_0x4e35('0x27')]['interface']=util[_0x4e35('0x5c')]('SIP/%s',_0x407d03[_0x4e35('0x5f')][_0x4e35('0x37')]);_0x2bf9e8[_0x4e35('0x27')]['channel']=_0x820ebb[_0x4e35('0x77')];_0x2bf9e8['message'][_0x4e35('0x78')]=_0x820ebb[_0x4e35('0x77')];_0x2bf9e8[_0x4e35('0x27')][_0x4e35('0x79')]=_0x4e35('0x32');respondWithRpcPromise('EventManager',_0x4e35('0x7a'),{'event':_0x4e35('0x7f'),'message':_0x2bf9e8[_0x4e35('0x27')]},client9002);return _0x820ebb;}return null;})['then'](respondWithResult(_0x230713,null))[_0x4e35('0x29')](handleError(_0x230713,null));};exports['status']=function(_0x5763c0,_0x40f4b2,_0x2d8914){if(_0x5763c0[_0x4e35('0x55')]['id']){delete _0x5763c0['body']['id'];}var _0x2472ab;return db[_0x4e35('0x4d')]['find']({'where':{'id':_0x5763c0[_0x4e35('0x52')]['id']}})[_0x4e35('0x1f')](handleEntityNotFound(_0x40f4b2,null))[_0x4e35('0x1f')](function(_0xbb1035){if(_0xbb1035){_0x2472ab=_0xbb1035;return db[_0x4e35('0x80')][_0x4e35('0x53')]({'where':{'id':_0xbb1035[_0x4e35('0x81')]}});}})[_0x4e35('0x1f')](handleEntityNotFound(_0x40f4b2,null))[_0x4e35('0x1f')](function(_0x4bde20){if(_0x4bde20){logger[_0x4e35('0x21')](_0x4e35('0x82'),_0x4e35('0x2a'),_0x4e35('0x83'),_0x4bde20[_0x4e35('0x49')],util['inspect'](_0x5763c0[_0x4e35('0x55')],{'showHidden':![],'depth':null}));switch(_0x4bde20[_0x4e35('0x49')]){case _0x4e35('0x84'):if(_0x5763c0[_0x4e35('0x55')]['MessageSid']&&_0x5763c0[_0x4e35('0x55')][_0x4e35('0x85')]===_0x2472ab['messageId']){return _0x2472ab[_0x4e35('0x62')]({'read':!![]});}else{logger[_0x4e35('0x24')](_0x4e35('0x86'),_0x4e35('0x2a'),_0x4e35('0x84'),util[_0x4e35('0x87')](_0x5763c0[_0x4e35('0x55')],{'showHidden':![],'depth':null}));}break;case _0x4e35('0x88'):if(_0x5763c0[_0x4e35('0x55')][_0x4e35('0x89')]&&_0x5763c0[_0x4e35('0x55')]['MessageUUID']===_0x2472ab['messageId']&&_[_0x4e35('0x8a')]([_0x4e35('0x8b'),_0x4e35('0x8c')],_0x5763c0[_0x4e35('0x55')][_0x4e35('0x8d')])>=0x0){return _0x2472ab[_0x4e35('0x62')]({'read':!![]});}else{logger[_0x4e35('0x24')](_0x4e35('0x86'),_0x4e35('0x2a'),_0x4e35('0x8e'),util[_0x4e35('0x87')](_0x5763c0[_0x4e35('0x55')],{'showHidden':![],'depth':null}));}break;case _0x4e35('0x8f'):var _0x3d3ff3=_0x5763c0[_0x4e35('0x55')][_0x4e35('0x90')][0x0];if(_0x3d3ff3[_0x4e35('0x2a')][_0x4e35('0x91')]===_0x4e35('0x92')){return _0x2472ab[_0x4e35('0x62')]({'read':!![]});}else{logger[_0x4e35('0x24')](_0x4e35('0x86'),_0x4e35('0x2a'),_0x4e35('0x8f'),util['inspect'](_0x5763c0[_0x4e35('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2472ab;}})['then'](respondWithResult(_0x40f4b2,null))[_0x4e35('0x29')](handleError(_0x40f4b2,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index dfb361e..e98d1fa 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 _0xef90=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x4a6c52,_0x3638f2){var _0x245d5d=function(_0x2dcaa3){while(--_0x2dcaa3){_0x4a6c52['push'](_0x4a6c52['shift']());}};_0x245d5d(++_0x3638f2);}(_0xef90,0x110));var _0x0ef9=function(_0x1e4709,_0x548a8b){_0x1e4709=_0x1e4709-0x0;var _0x493a85=_0xef90[_0x1e4709];return _0x493a85;};'use strict';var EventEmitter=require(_0x0ef9('0x0'));var SmsMessage=require(_0x0ef9('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ef9('0x2')](0x0);var events={'afterCreate':_0x0ef9('0x3'),'afterUpdate':'update','afterDestroy':_0x0ef9('0x4')};function emitEvent(_0x554a66){return function(_0x48cfad,_0x176b8d,_0x38c88c){SmsMessageEvents[_0x0ef9('0x5')](_0x554a66+':'+_0x48cfad['id'],_0x48cfad);SmsMessageEvents[_0x0ef9('0x5')](_0x554a66,_0x48cfad);_0x38c88c(null);};}for(var e in events){if(events[_0x0ef9('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x8f4d=['../../mysqldb','SmsMessage','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x4ef395,_0x45faed){var _0x155d7d=function(_0x562ca0){while(--_0x562ca0){_0x4ef395['push'](_0x4ef395['shift']());}};_0x155d7d(++_0x45faed);}(_0x8f4d,0x117));var _0xd8f4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f4d[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xd8f4('0x0'));var SmsMessage=require(_0xd8f4('0x1'))['db'][_0xd8f4('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd8f4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd8f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f2c16){return function(_0x59ae54,_0xcbe2b5,_0xf8dede){SmsMessageEvents[_0xd8f4('0x5')](_0x5f2c16+':'+_0x59ae54['id'],_0x59ae54);SmsMessageEvents[_0xd8f4('0x5')](_0x5f2c16,_0x59ae54);_0xf8dede(null);};}for(var e in events){if(events[_0xd8f4('0x6')](e)){var event=events[e];SmsMessage[_0xd8f4('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ecf2e5a..abd4978 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 _0xcdf8=['data','queued_count','head','messages','clickSend','plivo','authId','/status?token=','format','%s:%s','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','createHash','md5','digest','hex','signature=','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','SmsAccount','SmsAccountId','type','twilio','authToken','accountSid','create','phone','remote','/api/sms/messages/','token','sid','afterCreate','error','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','session_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code'];(function(_0x4b0f1b,_0x30b503){var _0xbeff58=function(_0x24b84a){while(--_0x24b84a){_0x4b0f1b['push'](_0x4b0f1b['shift']());}};_0xbeff58(++_0x30b503);}(_0xcdf8,0x1a6));var _0x8cdf=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xcdf8[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x8cdf('0x0'));var util=require('util');var logger=require(_0x8cdf('0x1'))(_0x8cdf('0x2'));var moment=require(_0x8cdf('0x3'));var BPromise=require('bluebird');var rp=require(_0x8cdf('0x4'));var fs=require('fs');var path=require(_0x8cdf('0x5'));var rimraf=require('rimraf');var config=require(_0x8cdf('0x6'));var attributes=require('./smsMessage.attributes');module[_0x8cdf('0x7')]=function(_0xdfb739,_0x4183ef){return _0xdfb739[_0x8cdf('0x8')]('SmsMessage',attributes,{'tableName':_0x8cdf('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8cdf('0xa')]},{'name':_0x8cdf('0xb'),'fields':[_0x8cdf('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d2a84,_0x183344,_0x1adf31){var _0x2d8534=_0xdfb739[_0x8cdf('0xd')];var _0x46cac8=_0x5d2a84[_0x8cdf('0xe')]({'plain':!![]});if(_0x46cac8[_0x8cdf('0xf')][_0x8cdf('0x10')]()==='in'||_0x46cac8['direction'][_0x8cdf('0x10')]()==='out'&&!_0x46cac8[_0x8cdf('0x11')]&&!_[_0x8cdf('0x12')](_0x46cac8[_0x8cdf('0x13')])&&!_['isNil'](_0x46cac8[_0x8cdf('0x14')])){_0x2d8534['SmsInteraction'][_0x8cdf('0x15')]({'where':{'id':_0x46cac8[_0x8cdf('0x14')]}})[_0x8cdf('0x16')](function(_0xc8b75a){if(_0xc8b75a){_0xc8b75a[_0x8cdf('0x17')]({'lastMsgAt':_0x46cac8[_0x8cdf('0x18')],'lastMsgDirection':_0x46cac8[_0x8cdf('0xf')]['toLowerCase']()});}})[_0x8cdf('0x19')](function(_0x386ce5){console['error'](_0x386ce5);});}if(_0x46cac8['direction']==='out'&&!_0x46cac8[_0x8cdf('0x11')]){var _0x582a2a;_0x2d8534[_0x8cdf('0x1a')]['find']({'where':{'id':_0x46cac8[_0x8cdf('0x1b')]},'raw':!![]})[_0x8cdf('0x16')](function(_0x214aba){_0x582a2a=_0x214aba;if(_0x582a2a&&_0x582a2a[_0x8cdf('0x1c')]){switch(_0x582a2a[_0x8cdf('0x1c')]){case _0x8cdf('0x1d'):var _0x162f1b=require(_0x8cdf('0x1d'));if(_0x582a2a['accountSid']&&_0x582a2a[_0x8cdf('0x1e')]&&_0x582a2a['phone']){var _0x538986=new _0x162f1b(_0x582a2a[_0x8cdf('0x1f')],_0x582a2a[_0x8cdf('0x1e')]);_0x538986['messages'][_0x8cdf('0x20')]({'body':_0x46cac8[_0x8cdf('0xc')],'to':_0x46cac8['phone'],'from':_0x582a2a[_0x8cdf('0x21')],'statusCallback':_0x582a2a[_0x8cdf('0x22')]+_0x8cdf('0x23')+_0x46cac8['id']+'/status?token='+_0x582a2a[_0x8cdf('0x24')]})['then'](function(_0x53c241){if(_0x53c241[_0x8cdf('0x25')]){return _0x5d2a84[_0x8cdf('0x17')]({'messageId':_0x53c241['sid']});}})['catch'](function(_0x32a656){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),_0x8cdf('0x1d'),util['inspect'](_0x32a656,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),'afterCreate',_0x8cdf('0x1d'),_0x8cdf('0x29'));}break;case _0x8cdf('0x2a'):var _0x5e433a='https://api.skebby.it/API/v1.0/REST/';if(_0x582a2a[_0x8cdf('0x2b')]&&_0x582a2a[_0x8cdf('0x2c')]){var _0x348e8f={'recipient':[_0x46cac8[_0x8cdf('0x21')]],'message':_0x46cac8[_0x8cdf('0xc')],'message_type':_0x582a2a[_0x8cdf('0x2d')]};if(_0x582a2a['smsMethod']&&_0x582a2a[_0x8cdf('0x2d')]!=='SI'){_0x348e8f['sender']=_0x582a2a[_0x8cdf('0x21')];}var _0x1c9cb7={'url':_0x5e433a+_0x8cdf('0x2e')+_0x582a2a[_0x8cdf('0x2b')]+_0x8cdf('0x2f')+_0x582a2a[_0x8cdf('0x2c')],'method':_0x8cdf('0x30')};rp(_0x1c9cb7)[_0x8cdf('0x16')](function(_0x26e71b){var _0x423671=_0x26e71b[_0x8cdf('0x31')](';');var _0x161fee={'user_key':_0x423671[0x0],'session_key':_0x423671[0x1]};_0x1c9cb7={'url':_0x5e433a+_0x8cdf('0x32'),'method':_0x8cdf('0x33'),'headers':{'user_key':_0x161fee['user_key'],'Session_key':_0x161fee[_0x8cdf('0x34')]},'json':!![],'body':_0x348e8f};return rp(_0x1c9cb7);})[_0x8cdf('0x16')](function(_0x2e2998){if(_0x2e2998[_0x8cdf('0x35')]>=0x1){var _0x8da03b={'messageId':_0x2e2998[_0x8cdf('0x36')]};if(_0x582a2a[_0x8cdf('0x2d')]!=='GP'||!_0x582a2a['deliveryReport']){_0x8da03b[_0x8cdf('0x37')]=!![];}return _0x5d2a84[_0x8cdf('0x17')](_0x8da03b);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),_0x8cdf('0x2a'),util[_0x8cdf('0x38')](_0x2e2998,{'showHidden':![],'depth':null}));}})[_0x8cdf('0x19')](function(_0x492a3){return logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),'skebby',util['inspect'](_0x492a3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x2a'),_0x8cdf('0x39'));}break;case _0x8cdf('0x3a'):if(_0x582a2a[_0x8cdf('0x1e')]){var _0x111eda={'recipient':_0x46cac8[_0x8cdf('0x21')],'message':_0x46cac8[_0x8cdf('0xc')],'sender':_0x582a2a[_0x8cdf('0x3b')]||_0x582a2a[_0x8cdf('0x21')],'authorization':_0x582a2a['authToken']};var _0x183344={'method':'POST','uri':_0x8cdf('0x3c'),'body':_0x111eda,'json':!![]};rp(_0x183344)[_0x8cdf('0x16')](function(_0x30b9c0){var _0x1f68e6={'messageId':_0x30b9c0[_0x8cdf('0x3d')]};if(!_0x582a2a[_0x8cdf('0x3e')]){_0x1f68e6[_0x8cdf('0x37')]=!![];}return _0x5d2a84['update'](_0x1f68e6);})[_0x8cdf('0x19')](function(_0x4ef8d3){logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x3a'),util[_0x8cdf('0x38')](_0x4ef8d3,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x8cdf('0x3f'):if(_0x582a2a[_0x8cdf('0x2b')]&&_0x582a2a['password']){var _0x111eda={'messages':[{'source':_0x8cdf('0x40'),'to':_0x46cac8[_0x8cdf('0x21')],'body':_0x46cac8[_0x8cdf('0xc')],'from':_0x582a2a[_0x8cdf('0x3b')]||_0x582a2a[_0x8cdf('0x21')]}]};var _0x2afd31=util['format']('%s:%s',_0x582a2a[_0x8cdf('0x2b')],_0x582a2a[_0x8cdf('0x2c')]);var _0x183344={'method':_0x8cdf('0x33'),'uri':_0x8cdf('0x41'),'body':_0x111eda,'headers':{'Authorization':util['format'](_0x8cdf('0x42'),new Buffer(_0x2afd31)[_0x8cdf('0x43')](_0x8cdf('0x44')))},'json':!![]};rp(_0x183344)['then'](function(_0x1ddb3a){if(_0x1ddb3a[_0x8cdf('0x45')]>=0xc8&&_0x1ddb3a[_0x8cdf('0x45')]<=0xce){if(_0x1ddb3a['data']&&_0x1ddb3a[_0x8cdf('0x46')][_0x8cdf('0x47')]>0x0){var _0x5abe17=_[_0x8cdf('0x48')](_0x1ddb3a[_0x8cdf('0x46')][_0x8cdf('0x49')]);var _0x710e30={'messageId':_0x5abe17['message_id']};if(!_0x582a2a[_0x8cdf('0x3e')]){_0x710e30[_0x8cdf('0x37')]=!![];}return _0x5d2a84[_0x8cdf('0x17')](_0x710e30);}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x4a'),util[_0x8cdf('0x38')](_0x1ddb3a,{'showHidden':![],'depth':null}));}}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),'clickSend',util[_0x8cdf('0x38')](_0x1ddb3a,{'showHidden':![],'depth':null}));}})[_0x8cdf('0x19')](function(_0x2f8fc3){logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x4a'),util[_0x8cdf('0x38')](_0x2f8fc3,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),'clickSend',_0x8cdf('0x39'));}break;case _0x8cdf('0x4b'):if(_0x582a2a[_0x8cdf('0x4c')]&&_0x582a2a[_0x8cdf('0x1e')]){var _0x111eda={'dst':_0x46cac8[_0x8cdf('0x21')],'text':_0x46cac8[_0x8cdf('0xc')],'src':_0x582a2a[_0x8cdf('0x3b')]||_0x582a2a[_0x8cdf('0x21')],'url':_0x582a2a[_0x8cdf('0x22')]+_0x8cdf('0x23')+_0x46cac8['id']+_0x8cdf('0x4d')+_0x582a2a['token']};var _0x2afd31=util[_0x8cdf('0x4e')](_0x8cdf('0x4f'),_0x582a2a['authId'],_0x582a2a['authToken']);var _0x183344={'method':_0x8cdf('0x33'),'uri':util[_0x8cdf('0x4e')]('https://api.plivo.com/v1/Account/%s/Message/',_0x582a2a[_0x8cdf('0x4c')]),'body':_0x111eda,'headers':{'Authorization':util[_0x8cdf('0x4e')](_0x8cdf('0x42'),new Buffer(_0x2afd31)[_0x8cdf('0x43')]('base64'))},'json':!![]};rp(_0x183344)[_0x8cdf('0x16')](function(_0x5014a6){var _0x379bfd={'messageId':_0x5014a6['message_uuid'][0x0]};return _0x5d2a84[_0x8cdf('0x17')](_0x379bfd);})[_0x8cdf('0x19')](function(_0x340717){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8cdf('0x4b'),util[_0x8cdf('0x38')](_0x340717,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),_0x8cdf('0x4b'),_0x8cdf('0x50'));}break;case'infobip':if(_0x582a2a[_0x8cdf('0x2b')]&&_0x582a2a[_0x8cdf('0x2c')]){if(_0x582a2a[_0x8cdf('0x51')]){var _0x324bfe={'method':'POST','uri':_0x582a2a['baseUrl']+'/auth/1/session','body':{'username':_0x582a2a['username'],'password':_0x582a2a['password']},'json':!![]};return rp(_0x324bfe)[_0x8cdf('0x16')](function(_0x20042d){var _0x39b9b8={'method':_0x8cdf('0x33'),'uri':_0x582a2a[_0x8cdf('0x51')]+_0x8cdf('0x52'),'body':{'messages':[{'from':_0x582a2a['phone'],'destinations':[{'to':_0x46cac8[_0x8cdf('0x21')]}],'text':_0x46cac8[_0x8cdf('0xc')],'notifyUrl':_0x582a2a[_0x8cdf('0x22')]+_0x8cdf('0x23')+_0x46cac8['id']+_0x8cdf('0x4d')+_0x582a2a[_0x8cdf('0x24')],'notifyContentType':_0x8cdf('0x53'),'callbackData':_0x582a2a[_0x8cdf('0x21')]+';'+_0x46cac8[_0x8cdf('0xc')]}]},'headers':{'Authorization':_0x8cdf('0x54')+_0x20042d[_0x8cdf('0x24')]},'json':!![]};return rp(_0x39b9b8)[_0x8cdf('0x16')](function(_0x3912c2){if(_0x3912c2[_0x8cdf('0x49')]){var _0xef6cf9={'messageId':_0x3912c2['messages'][0x0]['messageId']};if(!_0x582a2a['deliveryReport']){_0xef6cf9[_0x8cdf('0x37')]=!![];}return _0x5d2a84[_0x8cdf('0x17')](_0xef6cf9);}else{return logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),_0x8cdf('0x55'),util['inspect'](_0x3912c2,{'showHidden':![],'depth':null}));}});})[_0x8cdf('0x19')](function(_0x128dc8){return logger[_0x8cdf('0x27')](_0x8cdf('0x28'),'afterCreate',_0x8cdf('0x55'),util[_0x8cdf('0x38')](_0x128dc8,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x55'),_0x8cdf('0x56'));}}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),'afterCreate',_0x8cdf('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8cdf('0x57'):var _0x423c74=require(_0x8cdf('0x58'));if(_0x582a2a[_0x8cdf('0x59')]){var _0x22b43e={};_0x22b43e[_0x8cdf('0x5a')]=_0x582a2a['username'];_0x22b43e[_0x8cdf('0x21')]=_0x46cac8[_0x8cdf('0x21')];_0x22b43e[_0x8cdf('0x5b')]=_0x582a2a[_0x8cdf('0x21')];_0x22b43e[_0x8cdf('0x5c')]=_0x46cac8['body'];_0x22b43e[_0x8cdf('0x5d')]=+new Date();var _0x2ee74c='';var _0x3a3fc1='';var _0x4a79c7=Object[_0x8cdf('0x5e')](_0x22b43e);_0x4a79c7[_0x8cdf('0x5f')]();for(var _0x44b8ba=0x0;_0x44b8ba<_0x4a79c7['length'];_0x44b8ba++){if(_0x2ee74c!=''){_0x2ee74c+='&';}_0x2ee74c+=_0x4a79c7[_0x44b8ba]+'='+encodeURIComponent(_0x22b43e[_0x4a79c7[_0x44b8ba]]);_0x3a3fc1+=_0x22b43e[_0x4a79c7[_0x44b8ba]];}_0x3a3fc1+=_0x582a2a[_0x8cdf('0x59')];_0x3a3fc1=_0x423c74[_0x8cdf('0x60')](_0x8cdf('0x61'))[_0x8cdf('0x17')](_0x3a3fc1)[_0x8cdf('0x62')](_0x8cdf('0x63'));if(_0x2ee74c!==''){_0x2ee74c+='&';}_0x2ee74c+=_0x8cdf('0x64')+_0x3a3fc1;var _0x1c9cb7={'method':'GET','uri':_0x582a2a[_0x8cdf('0x51')]+'/external/get/send.php?'+_0x2ee74c,'json':!![]};return rp(_0x1c9cb7)['then'](function(_0x4c1d2c){var _0x168d85=Object['keys'](_0x4c1d2c);if(_0x4c1d2c[_0x168d85[0x0]][_0x8cdf('0x27')]&&parseInt(_0x4c1d2c[_0x168d85[0x0]][_0x8cdf('0x27')])===0x0){var _0x1d6b4e={'messageId':_0x4c1d2c[_0x168d85[0x0]]['id_sms']};if(!_0x582a2a[_0x8cdf('0x3e')]){_0x1d6b4e['read']=!![];}return _0x5d2a84[_0x8cdf('0x17')](_0x1d6b4e);}else{return logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x57'),util[_0x8cdf('0x38')](_0x4c1d2c[_0x8cdf('0x27')],{'showHidden':![],'depth':null}));}})[_0x8cdf('0x19')](function(_0x24f21c){return logger[_0x8cdf('0x27')](_0x8cdf('0x28'),'afterCreate',_0x8cdf('0x57'),util[_0x8cdf('0x38')](_0x24f21c,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x57'),_0x8cdf('0x65'));}break;case'clickatell':if(_0x582a2a['apiKey']){var _0x5cafec={'method':_0x8cdf('0x33'),'uri':_0x8cdf('0x66'),'headers':{'Authorization':_0x582a2a[_0x8cdf('0x59')]},'body':{'content':_0x46cac8[_0x8cdf('0xc')],'to':[_0x46cac8['phone']],'from':_0x582a2a[_0x8cdf('0x21')],'binary':![],'clientMessageId':_0x8cdf('0x67'),'charset':_0x8cdf('0x68')},'json':!![]};rp(_0x5cafec)[_0x8cdf('0x16')](function(_0x5cd920){if(!_0x5cd920[_0x8cdf('0x27')]){var _0x41af8b={'messageId':_0x5cd920[_0x8cdf('0x49')][0x0][_0x8cdf('0x69')]};if(!_0x582a2a[_0x8cdf('0x3e')]){_0x41af8b[_0x8cdf('0x37')]=!![];}return _0x5d2a84[_0x8cdf('0x17')](_0x41af8b);}else{return logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x6a'),util[_0x8cdf('0x38')](_0x5cd920[_0x8cdf('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4d526e){return logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cdf('0x26'),_0x8cdf('0x6a'),util[_0x8cdf('0x38')](_0x4d526e,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x6a'),_0x8cdf('0x65'));}break;case _0x8cdf('0x6b'):if(_0x582a2a[_0x8cdf('0x2b')]&&_0x582a2a['password']){var _0x2afd31=util[_0x8cdf('0x4e')](_0x8cdf('0x4f'),_0x582a2a['username'],_0x582a2a['password']);var _0x183344={'method':_0x8cdf('0x33'),'uri':_0x8cdf('0x6c')+_0x582a2a[_0x8cdf('0x6d')]+_0x8cdf('0x6e'),'body':{'to':[_0x46cac8[_0x8cdf('0x21')]],'text':_0x46cac8[_0x8cdf('0xc')],'from':_0x582a2a[_0x8cdf('0x21')],'applicationId':_0x582a2a[_0x8cdf('0x6f')]},'headers':{'Authorization':util[_0x8cdf('0x4e')](_0x8cdf('0x42'),new Buffer(_0x2afd31)[_0x8cdf('0x43')]('base64'))},'json':!![]};rp(_0x183344)[_0x8cdf('0x16')](function(_0x2a1056){if(_0x2a1056['id']){var _0x576d2f={'messageId':_0x2a1056['id']};return _0x5d2a84[_0x8cdf('0x17')](_0x576d2f);}else{logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),'bandwidth',util[_0x8cdf('0x38')](_0x2a1056,{'showHidden':![],'depth':null}));}})[_0x8cdf('0x19')](function(_0x5dee54){logger[_0x8cdf('0x27')](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x6b'),util[_0x8cdf('0x38')](_0x5dee54,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8cdf('0x6b'),_0x8cdf('0x39'));}break;case'intelepeer':if(_0x582a2a[_0x8cdf('0x59')]){var _0x3c9350={};var _0x1c9cb7={'method':_0x8cdf('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x8cdf('0x70')+_0x582a2a[_0x8cdf('0x59')],'Content-Type':_0x8cdf('0x53')},'body':{'from':_0x582a2a[_0x8cdf('0x21')],'to':_0x46cac8[_0x8cdf('0x21')],'text':_0x46cac8[_0x8cdf('0xc')]},'json':!![]};return rp(_0x1c9cb7)['then'](function(_0x381cdd){if(_0x381cdd[_0x8cdf('0x71')]==0xca){_0x3c9350[_0x8cdf('0x72')]=_0x381cdd;var _0x1cf767={'method':_0x8cdf('0x33'),'uri':_0x8cdf('0x73'),'headers':{'Authorization':_0x8cdf('0x70')+_0x582a2a[_0x8cdf('0x59')],'Content-Type':_0x8cdf('0x53')},'body':{'refid':_0x3c9350['message'][_0x8cdf('0x74')]},'json':!![]};return rp(_0x1cf767)['then'](function(_0x5eeee2){_0x3c9350[_0x8cdf('0x75')]=_0x5eeee2;var _0x351f83={'messageId':_0x3c9350[_0x8cdf('0x72')][_0x8cdf('0x74')],'read':!![]};return _0x5d2a84[_0x8cdf('0x17')](_0x351f83);});}else{return logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x76'),util[_0x8cdf('0x38')](_0x381cdd,{'showHidden':![],'depth':null}));}})[_0x8cdf('0x19')](function(_0x54e491){return logger[_0x8cdf('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0x8cdf('0x38')](_0x54e491,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x8cdf('0x28'),_0x8cdf('0x26'),_0x8cdf('0x76'),_0x8cdf('0x77'));}break;}}})[_0x8cdf('0x78')](function(){_0x1adf31();});}else{_0x1adf31();}}},'charset':_0x8cdf('0x79'),'collate':_0x8cdf('0x7a')});}; \ No newline at end of file +var _0xce03=['phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','split','sms','POST','user_key','session_key','deliveryReport','read','skebby','catch','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','csc','crypto','apiKey','login','sender','text','keys','sort','length','createHash','md5','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken'];(function(_0x44166f,_0x3e71e2){var _0x5f390a=function(_0x4876fb){while(--_0x4876fb){_0x44166f['push'](_0x44166f['shift']());}};_0x5f390a(++_0x3e71e2);}(_0xce03,0x1b9));var _0x3ce0=function(_0x9cc5d8,_0x11b7ef){_0x9cc5d8=_0x9cc5d8-0x0;var _0x57109b=_0xce03[_0x9cc5d8];return _0x57109b;};'use strict';var _=require('lodash');var util=require(_0x3ce0('0x0'));var logger=require(_0x3ce0('0x1'))(_0x3ce0('0x2'));var moment=require(_0x3ce0('0x3'));var BPromise=require(_0x3ce0('0x4'));var rp=require(_0x3ce0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ce0('0x6'));var config=require(_0x3ce0('0x7'));var attributes=require('./smsMessage.attributes');module[_0x3ce0('0x8')]=function(_0x457218,_0x886984){return _0x457218[_0x3ce0('0x9')](_0x3ce0('0xa'),attributes,{'tableName':_0x3ce0('0xb'),'paranoid':![],'indexes':[{'name':_0x3ce0('0xc'),'fields':[_0x3ce0('0xc')]},{'name':_0x3ce0('0xd'),'fields':[_0x3ce0('0xe')],'type':_0x3ce0('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22a44f,_0x9a9360,_0x5c8dc3){var _0xa1d377=_0x457218[_0x3ce0('0x10')];var _0x4b2533=_0x22a44f['get']({'plain':!![]});if(_0x4b2533[_0x3ce0('0x11')][_0x3ce0('0x12')]()==='in'||_0x4b2533['direction'][_0x3ce0('0x12')]()===_0x3ce0('0x13')&&!_0x4b2533[_0x3ce0('0x14')]&&!_[_0x3ce0('0x15')](_0x4b2533[_0x3ce0('0x16')])&&!_[_0x3ce0('0x15')](_0x4b2533['SmsInteractionId'])){_0xa1d377[_0x3ce0('0x17')]['findOne']({'where':{'id':_0x4b2533[_0x3ce0('0x18')]}})[_0x3ce0('0x19')](function(_0x37d412){if(_0x37d412){_0x37d412[_0x3ce0('0x1a')]({'lastMsgAt':_0x4b2533['createdAt'],'lastMsgDirection':_0x4b2533[_0x3ce0('0x11')][_0x3ce0('0x12')]()});}})['catch'](function(_0x29079c){console[_0x3ce0('0x1b')](_0x29079c);});}if(_0x4b2533[_0x3ce0('0x11')]===_0x3ce0('0x13')&&!_0x4b2533[_0x3ce0('0x14')]){var _0x2ba171;_0xa1d377[_0x3ce0('0x1c')][_0x3ce0('0x1d')]({'where':{'id':_0x4b2533[_0x3ce0('0x1e')]},'raw':!![]})[_0x3ce0('0x19')](function(_0x57c338){_0x2ba171=_0x57c338;if(_0x2ba171&&_0x2ba171['type']){switch(_0x2ba171[_0x3ce0('0x1f')]){case _0x3ce0('0x20'):var _0x9c1b6d=require('twilio');if(_0x2ba171[_0x3ce0('0x21')]&&_0x2ba171[_0x3ce0('0x22')]&&_0x2ba171[_0x3ce0('0x23')]){var _0x11341c=new _0x9c1b6d(_0x2ba171[_0x3ce0('0x21')],_0x2ba171[_0x3ce0('0x22')]);_0x11341c[_0x3ce0('0x24')][_0x3ce0('0x25')]({'body':_0x4b2533[_0x3ce0('0xe')],'to':_0x4b2533[_0x3ce0('0x23')],'from':_0x2ba171['phone'],'statusCallback':_0x2ba171[_0x3ce0('0x26')]+_0x3ce0('0x27')+_0x4b2533['id']+_0x3ce0('0x28')+_0x2ba171[_0x3ce0('0x29')]})[_0x3ce0('0x19')](function(_0x46365c){if(_0x46365c[_0x3ce0('0x2a')]){return _0x22a44f[_0x3ce0('0x1a')]({'messageId':_0x46365c['sid']});}})['catch'](function(_0xd23f41){logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'twilio',util[_0x3ce0('0x2d')](_0xd23f41,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x1c3a02=_0x3ce0('0x2e');if(_0x2ba171[_0x3ce0('0x2f')]&&_0x2ba171['password']){var _0x516ae5={'recipient':[_0x4b2533[_0x3ce0('0x23')]],'message':_0x4b2533[_0x3ce0('0xe')],'message_type':_0x2ba171['smsMethod']};if(_0x2ba171[_0x3ce0('0x30')]&&_0x2ba171[_0x3ce0('0x30')]!=='SI'){_0x516ae5['sender']=_0x2ba171[_0x3ce0('0x23')];}var _0x114c24={'url':_0x1c3a02+_0x3ce0('0x31')+_0x2ba171[_0x3ce0('0x2f')]+_0x3ce0('0x32')+_0x2ba171[_0x3ce0('0x33')],'method':'GET'};rp(_0x114c24)[_0x3ce0('0x19')](function(_0x40d8a5){var _0x218f7f=_0x40d8a5[_0x3ce0('0x34')](';');var _0x1c52f2={'user_key':_0x218f7f[0x0],'session_key':_0x218f7f[0x1]};_0x114c24={'url':_0x1c3a02+_0x3ce0('0x35'),'method':_0x3ce0('0x36'),'headers':{'user_key':_0x1c52f2[_0x3ce0('0x37')],'Session_key':_0x1c52f2[_0x3ce0('0x38')]},'json':!![],'body':_0x516ae5};return rp(_0x114c24);})[_0x3ce0('0x19')](function(_0x19bba8){if(_0x19bba8['total_sent']>=0x1){var _0x4c0213={'messageId':_0x19bba8['internal_order_id']};if(_0x2ba171['smsMethod']!=='GP'||!_0x2ba171[_0x3ce0('0x39')]){_0x4c0213[_0x3ce0('0x3a')]=!![];}return _0x22a44f[_0x3ce0('0x1a')](_0x4c0213);}else{return logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x3b'),util[_0x3ce0('0x2d')](_0x19bba8,{'showHidden':![],'depth':null}));}})[_0x3ce0('0x3c')](function(_0x5f4a0c){return logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),'afterCreate',_0x3ce0('0x3b'),util['inspect'](_0x5f4a0c,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),'afterCreate',_0x3ce0('0x3b'),_0x3ce0('0x3d'));}break;case _0x3ce0('0x3e'):if(_0x2ba171[_0x3ce0('0x22')]){var _0x488f99={'recipient':_0x4b2533[_0x3ce0('0x23')],'message':_0x4b2533[_0x3ce0('0xe')],'sender':_0x2ba171[_0x3ce0('0x3f')]||_0x2ba171['phone'],'authorization':_0x2ba171[_0x3ce0('0x22')]};var _0x9a9360={'method':_0x3ce0('0x36'),'uri':_0x3ce0('0x40'),'body':_0x488f99,'json':!![]};rp(_0x9a9360)[_0x3ce0('0x19')](function(_0x1f5c83){var _0xe4bea3={'messageId':_0x1f5c83[_0x3ce0('0x41')]};if(!_0x2ba171[_0x3ce0('0x39')]){_0xe4bea3['read']=!![];}return _0x22a44f[_0x3ce0('0x1a')](_0xe4bea3);})[_0x3ce0('0x3c')](function(_0x160a41){logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x3e'),util['inspect'](_0x160a41,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x3e'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x2ba171[_0x3ce0('0x2f')]&&_0x2ba171['password']){var _0x488f99={'messages':[{'source':_0x3ce0('0x42'),'to':_0x4b2533[_0x3ce0('0x23')],'body':_0x4b2533['body'],'from':_0x2ba171['senderString']||_0x2ba171[_0x3ce0('0x23')]}]};var _0x484cf4=util[_0x3ce0('0x43')](_0x3ce0('0x44'),_0x2ba171['username'],_0x2ba171['password']);var _0x9a9360={'method':_0x3ce0('0x36'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x488f99,'headers':{'Authorization':util[_0x3ce0('0x43')](_0x3ce0('0x45'),new Buffer(_0x484cf4)[_0x3ce0('0x46')](_0x3ce0('0x47')))},'json':!![]};rp(_0x9a9360)[_0x3ce0('0x19')](function(_0x644c53){if(_0x644c53[_0x3ce0('0x48')]>=0xc8&&_0x644c53[_0x3ce0('0x48')]<=0xce){if(_0x644c53[_0x3ce0('0x49')]&&_0x644c53[_0x3ce0('0x49')][_0x3ce0('0x4a')]>0x0){var _0x1bcc75=_[_0x3ce0('0x4b')](_0x644c53['data']['messages']);var _0x55518c={'messageId':_0x1bcc75['message_id']};if(!_0x2ba171[_0x3ce0('0x39')]){_0x55518c['read']=!![];}return _0x22a44f[_0x3ce0('0x1a')](_0x55518c);}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'clickSend',util['inspect'](_0x644c53,{'showHidden':![],'depth':null}));}}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x4c'),util['inspect'](_0x644c53,{'showHidden':![],'depth':null}));}})['catch'](function(_0x126d49){logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x4c'),util[_0x3ce0('0x2d')](_0x126d49,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3ce0('0x4d'):if(_0x2ba171['authId']&&_0x2ba171[_0x3ce0('0x22')]){var _0x488f99={'dst':_0x4b2533[_0x3ce0('0x23')],'text':_0x4b2533[_0x3ce0('0xe')],'src':_0x2ba171[_0x3ce0('0x3f')]||_0x2ba171[_0x3ce0('0x23')],'url':_0x2ba171[_0x3ce0('0x26')]+_0x3ce0('0x27')+_0x4b2533['id']+_0x3ce0('0x28')+_0x2ba171[_0x3ce0('0x29')]};var _0x484cf4=util[_0x3ce0('0x43')](_0x3ce0('0x44'),_0x2ba171['authId'],_0x2ba171[_0x3ce0('0x22')]);var _0x9a9360={'method':_0x3ce0('0x36'),'uri':util[_0x3ce0('0x43')](_0x3ce0('0x4e'),_0x2ba171['authId']),'body':_0x488f99,'headers':{'Authorization':util['format'](_0x3ce0('0x45'),new Buffer(_0x484cf4)[_0x3ce0('0x46')](_0x3ce0('0x47')))},'json':!![]};rp(_0x9a9360)[_0x3ce0('0x19')](function(_0x3a390a){var _0x4d0945={'messageId':_0x3a390a[_0x3ce0('0x4f')][0x0]};return _0x22a44f[_0x3ce0('0x1a')](_0x4d0945);})[_0x3ce0('0x3c')](function(_0x4d3c92){logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),'afterCreate',_0x3ce0('0x4d'),util[_0x3ce0('0x2d')](_0x4d3c92,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x4d'),_0x3ce0('0x50'));}break;case _0x3ce0('0x51'):if(_0x2ba171[_0x3ce0('0x2f')]&&_0x2ba171[_0x3ce0('0x33')]){if(_0x2ba171[_0x3ce0('0x52')]){var _0x5f0328={'method':_0x3ce0('0x36'),'uri':_0x2ba171['baseUrl']+'/auth/1/session','body':{'username':_0x2ba171[_0x3ce0('0x2f')],'password':_0x2ba171['password']},'json':!![]};return rp(_0x5f0328)[_0x3ce0('0x19')](function(_0x3f575b){var _0x458cc0={'method':_0x3ce0('0x36'),'uri':_0x2ba171[_0x3ce0('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2ba171[_0x3ce0('0x23')],'destinations':[{'to':_0x4b2533[_0x3ce0('0x23')]}],'text':_0x4b2533[_0x3ce0('0xe')],'notifyUrl':_0x2ba171[_0x3ce0('0x26')]+'/api/sms/messages/'+_0x4b2533['id']+_0x3ce0('0x28')+_0x2ba171[_0x3ce0('0x29')],'notifyContentType':'application/json','callbackData':_0x2ba171['phone']+';'+_0x4b2533[_0x3ce0('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3f575b[_0x3ce0('0x29')]},'json':!![]};return rp(_0x458cc0)['then'](function(_0x4b70bc){if(_0x4b70bc[_0x3ce0('0x24')]){var _0x3851be={'messageId':_0x4b70bc['messages'][0x0][_0x3ce0('0xc')]};if(!_0x2ba171['deliveryReport']){_0x3851be[_0x3ce0('0x3a')]=!![];}return _0x22a44f['update'](_0x3851be);}else{return logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'infobip',util[_0x3ce0('0x2d')](_0x4b70bc,{'showHidden':![],'depth':null}));}});})[_0x3ce0('0x3c')](function(_0x3b2514){return logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'infobip',util[_0x3ce0('0x2d')](_0x3b2514,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x51'),_0x3ce0('0x3d'));}break;case _0x3ce0('0x53'):var _0x105b1a=require(_0x3ce0('0x54'));if(_0x2ba171[_0x3ce0('0x55')]){var _0x18fa5a={};_0x18fa5a[_0x3ce0('0x56')]=_0x2ba171[_0x3ce0('0x2f')];_0x18fa5a[_0x3ce0('0x23')]=_0x4b2533['phone'];_0x18fa5a[_0x3ce0('0x57')]=_0x2ba171[_0x3ce0('0x23')];_0x18fa5a[_0x3ce0('0x58')]=_0x4b2533[_0x3ce0('0xe')];_0x18fa5a['timestamp']=+new Date();var _0x3e5509='';var _0x29839e='';var _0x495863=Object[_0x3ce0('0x59')](_0x18fa5a);_0x495863[_0x3ce0('0x5a')]();for(var _0x35d31c=0x0;_0x35d31c<_0x495863[_0x3ce0('0x5b')];_0x35d31c++){if(_0x3e5509!=''){_0x3e5509+='&';}_0x3e5509+=_0x495863[_0x35d31c]+'='+encodeURIComponent(_0x18fa5a[_0x495863[_0x35d31c]]);_0x29839e+=_0x18fa5a[_0x495863[_0x35d31c]];}_0x29839e+=_0x2ba171[_0x3ce0('0x55')];_0x29839e=_0x105b1a[_0x3ce0('0x5c')](_0x3ce0('0x5d'))[_0x3ce0('0x1a')](_0x29839e)['digest'](_0x3ce0('0x5e'));if(_0x3e5509!==''){_0x3e5509+='&';}_0x3e5509+=_0x3ce0('0x5f')+_0x29839e;var _0x114c24={'method':_0x3ce0('0x60'),'uri':_0x2ba171['baseUrl']+_0x3ce0('0x61')+_0x3e5509,'json':!![]};return rp(_0x114c24)[_0x3ce0('0x19')](function(_0x2db251){var _0x17107f=Object[_0x3ce0('0x59')](_0x2db251);if(_0x2db251[_0x17107f[0x0]]['error']&&parseInt(_0x2db251[_0x17107f[0x0]]['error'])===0x0){var _0xe02bae={'messageId':_0x2db251[_0x17107f[0x0]][_0x3ce0('0x62')]};if(!_0x2ba171['deliveryReport']){_0xe02bae['read']=!![];}return _0x22a44f[_0x3ce0('0x1a')](_0xe02bae);}else{return logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'csc',util[_0x3ce0('0x2d')](_0x2db251[_0x3ce0('0x1b')],{'showHidden':![],'depth':null}));}})[_0x3ce0('0x3c')](function(_0x31656d){return logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'csc',util[_0x3ce0('0x2d')](_0x31656d,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x53'),_0x3ce0('0x63'));}break;case _0x3ce0('0x64'):if(_0x2ba171[_0x3ce0('0x55')]){var _0x43e086={'method':_0x3ce0('0x36'),'uri':_0x3ce0('0x65'),'headers':{'Authorization':_0x2ba171['apiKey']},'body':{'content':_0x4b2533[_0x3ce0('0xe')],'to':[_0x4b2533['phone']],'from':_0x2ba171['phone'],'binary':![],'clientMessageId':_0x3ce0('0x66'),'charset':'UTF-8'},'json':!![]};rp(_0x43e086)['then'](function(_0x57d472){if(!_0x57d472[_0x3ce0('0x1b')]){var _0x21771a={'messageId':_0x57d472[_0x3ce0('0x24')][0x0][_0x3ce0('0x67')]};if(!_0x2ba171['deliveryReport']){_0x21771a[_0x3ce0('0x3a')]=!![];}return _0x22a44f[_0x3ce0('0x1a')](_0x21771a);}else{return logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),'afterCreate','clickatell',util[_0x3ce0('0x2d')](_0x57d472['error'],{'showHidden':![],'depth':null}));}})[_0x3ce0('0x3c')](function(_0x4232d9){return logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'clickatell',util[_0x3ce0('0x2d')](_0x4232d9,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')](_0x3ce0('0x2b'),_0x3ce0('0x2c'),'clickatell',_0x3ce0('0x63'));}break;case _0x3ce0('0x68'):if(_0x2ba171['username']&&_0x2ba171[_0x3ce0('0x33')]){var _0x484cf4=util[_0x3ce0('0x43')]('%s:%s',_0x2ba171[_0x3ce0('0x2f')],_0x2ba171[_0x3ce0('0x33')]);var _0x9a9360={'method':'POST','uri':_0x3ce0('0x69')+_0x2ba171[_0x3ce0('0x6a')]+_0x3ce0('0x6b'),'body':{'to':[_0x4b2533[_0x3ce0('0x23')]],'text':_0x4b2533[_0x3ce0('0xe')],'from':_0x2ba171[_0x3ce0('0x23')],'applicationId':_0x2ba171[_0x3ce0('0x6c')]},'headers':{'Authorization':util[_0x3ce0('0x43')]('Basic\x20%s',new Buffer(_0x484cf4)[_0x3ce0('0x46')](_0x3ce0('0x47')))},'json':!![]};rp(_0x9a9360)[_0x3ce0('0x19')](function(_0x545fd6){if(_0x545fd6['id']){var _0x215656={'messageId':_0x545fd6['id']};return _0x22a44f['update'](_0x215656);}else{logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),'bandwidth',util[_0x3ce0('0x2d')](_0x545fd6,{'showHidden':![],'depth':null}));}})[_0x3ce0('0x3c')](function(_0x44145e){logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),'bandwidth',util['inspect'](_0x44145e,{'showHidden':![],'depth':null}));});}else{logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x68'),_0x3ce0('0x3d'));}break;case _0x3ce0('0x6d'):if(_0x2ba171[_0x3ce0('0x55')]){var _0x2eb8b2={};var _0x114c24={'method':_0x3ce0('0x36'),'uri':_0x3ce0('0x6e'),'headers':{'Authorization':_0x3ce0('0x6f')+_0x2ba171[_0x3ce0('0x55')],'Content-Type':_0x3ce0('0x70')},'body':{'from':_0x2ba171[_0x3ce0('0x23')],'to':_0x4b2533[_0x3ce0('0x23')],'text':_0x4b2533[_0x3ce0('0xe')]},'json':!![]};return rp(_0x114c24)[_0x3ce0('0x19')](function(_0x131c86){if(_0x131c86['code']==0xca){_0x2eb8b2['message']=_0x131c86;var _0x38b8a5={'method':_0x3ce0('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3ce0('0x6f')+_0x2ba171[_0x3ce0('0x55')],'Content-Type':'application/json'},'body':{'refid':_0x2eb8b2[_0x3ce0('0x71')][_0x3ce0('0x72')]},'json':!![]};return rp(_0x38b8a5)['then'](function(_0x5372fc){_0x2eb8b2[_0x3ce0('0x73')]=_0x5372fc;var _0x19daf0={'messageId':_0x2eb8b2[_0x3ce0('0x71')][_0x3ce0('0x72')],'read':!![]};return _0x22a44f['update'](_0x19daf0);});}else{return logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x6d'),util[_0x3ce0('0x2d')](_0x131c86,{'showHidden':![],'depth':null}));}})['catch'](function(_0x49deca){return logger['error'](_0x3ce0('0x2b'),_0x3ce0('0x2c'),_0x3ce0('0x6d'),util[_0x3ce0('0x2d')](_0x49deca,{'showHidden':![],'depth':null}));});}else{return logger[_0x3ce0('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ce0('0x2c'),_0x3ce0('0x6d'),_0x3ce0('0x74'));}break;}}})['finally'](function(){_0x5c8dc3();});}else{_0x5c8dc3();}}},'charset':_0x3ce0('0x75'),'collate':_0x3ce0('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8765d3c..501b041 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 _0x0c2b=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x32dfcb,_0x7a903e){var _0x12d694=function(_0x53a06f){while(--_0x53a06f){_0x32dfcb['push'](_0x32dfcb['shift']());}};_0x12d694(++_0x7a903e);}(_0x0c2b,0x133));var _0xb0c2=function(_0x252702,_0x5728bb){_0x252702=_0x252702-0x0;var _0x1bec29=_0x0c2b[_0x252702];return _0x1bec29;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var moment=require(_0xb0c2('0x2'));var BPromise=require(_0xb0c2('0x3'));var rs=require(_0xb0c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0c2('0x5'))['db'];var utils=require(_0xb0c2('0x6'));var logger=require(_0xb0c2('0x7'))(_0xb0c2('0x8'));var config=require(_0xb0c2('0x9'));var jayson=require(_0xb0c2('0xa'));var client=jayson[_0xb0c2('0xb')][_0xb0c2('0xc')]({'port':0x232a});config[_0xb0c2('0xd')]=_[_0xb0c2('0xe')](config[_0xb0c2('0xd')],{'host':_0xb0c2('0xf'),'port':0x18eb});var socket=require(_0xb0c2('0x10'))(new Redis(config[_0xb0c2('0xd')]));require(_0xb0c2('0x11'))[_0xb0c2('0x12')](socket);function respondWithRpcPromise(_0x5a65e9,_0x18e747,_0x3ef17c){return new BPromise(function(_0x2ccb62,_0x50facf){return client[_0xb0c2('0x13')](_0x5a65e9,_0x3ef17c)[_0xb0c2('0x14')](function(_0x29a09b){logger[_0xb0c2('0x15')](_0xb0c2('0x16'),_0x18e747,_0xb0c2('0x17'));logger[_0xb0c2('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18e747,_0xb0c2('0x17'),JSON[_0xb0c2('0x19')](_0x29a09b));if(_0x29a09b[_0xb0c2('0x1a')]){if(_0x29a09b[_0xb0c2('0x1a')]['code']===0x1f4){logger[_0xb0c2('0x1a')](_0xb0c2('0x16'),_0x18e747,_0x29a09b[_0xb0c2('0x1a')][_0xb0c2('0x1b')]);return _0x50facf(_0x29a09b[_0xb0c2('0x1a')][_0xb0c2('0x1b')]);}logger[_0xb0c2('0x1a')](_0xb0c2('0x16'),_0x18e747,_0x29a09b[_0xb0c2('0x1a')]['message']);return _0x2ccb62(_0x29a09b[_0xb0c2('0x1a')][_0xb0c2('0x1b')]);}else{logger[_0xb0c2('0x15')](_0xb0c2('0x16'),_0x18e747,_0xb0c2('0x17'));_0x2ccb62(_0x29a09b[_0xb0c2('0x1c')]['message']);}})['catch'](function(_0x2890ce){logger[_0xb0c2('0x1a')](_0xb0c2('0x16'),_0x18e747,_0x2890ce);_0x50facf(_0x2890ce);});});}exports[_0xb0c2('0x1d')]=function(_0x439740){var _0x58abd3=this;return new Promise(function(_0x3c708b,_0x4dd061){return db[_0xb0c2('0x1e')][_0xb0c2('0x1f')](_0x439740[_0xb0c2('0x20')],{'raw':_0x439740[_0xb0c2('0x21')]?_0x439740[_0xb0c2('0x21')][_0xb0c2('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x14b20d){logger[_0xb0c2('0x15')](_0xb0c2('0x1d'),_0x439740);logger[_0xb0c2('0x18')](_0xb0c2('0x1d'),_0x439740,JSON[_0xb0c2('0x19')](_0x14b20d));_0x3c708b(_0x14b20d);})['catch'](function(_0x5e1c51){logger[_0xb0c2('0x1a')](_0xb0c2('0x1d'),_0x5e1c51[_0xb0c2('0x1b')],_0x439740);_0x4dd061(_0x58abd3[_0xb0c2('0x1a')](0x1f4,_0x5e1c51[_0xb0c2('0x1b')]));});});}; \ No newline at end of file +var _0x5bbe=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe02996,_0x1c9fd5){var _0x458538=function(_0x43303d){while(--_0x43303d){_0xe02996['push'](_0xe02996['shift']());}};_0x458538(++_0x1c9fd5);}(_0x5bbe,0x110));var _0xe5bb=function(_0x3b19a8,_0x2616ad){_0x3b19a8=_0x3b19a8-0x0;var _0x68afc3=_0x5bbe[_0x3b19a8];return _0x68afc3;};'use strict';var _=require(_0xe5bb('0x0'));var util=require(_0xe5bb('0x1'));var moment=require(_0xe5bb('0x2'));var BPromise=require(_0xe5bb('0x3'));var rs=require(_0xe5bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5bb('0x5'))['db'];var utils=require(_0xe5bb('0x6'));var logger=require(_0xe5bb('0x7'))(_0xe5bb('0x8'));var config=require(_0xe5bb('0x9'));var jayson=require(_0xe5bb('0xa'));var client=jayson[_0xe5bb('0xb')]['http']({'port':0x232a});config[_0xe5bb('0xc')]=_[_0xe5bb('0xd')](config['redis'],{'host':_0xe5bb('0xe'),'port':0x18eb});var socket=require(_0xe5bb('0xf'))(new Redis(config[_0xe5bb('0xc')]));require(_0xe5bb('0x10'))[_0xe5bb('0x11')](socket);function respondWithRpcPromise(_0x4d38ca,_0x574a4e,_0x109d13){return new BPromise(function(_0x18817c,_0x596cae){return client['request'](_0x4d38ca,_0x109d13)[_0xe5bb('0x12')](function(_0x42d856){logger[_0xe5bb('0x13')]('SmsMessage,\x20%s,\x20%s',_0x574a4e,_0xe5bb('0x14'));logger[_0xe5bb('0x15')](_0xe5bb('0x16'),_0x574a4e,_0xe5bb('0x14'),JSON[_0xe5bb('0x17')](_0x42d856));if(_0x42d856[_0xe5bb('0x18')]){if(_0x42d856[_0xe5bb('0x18')][_0xe5bb('0x19')]===0x1f4){logger['error'](_0xe5bb('0x1a'),_0x574a4e,_0x42d856[_0xe5bb('0x18')][_0xe5bb('0x1b')]);return _0x596cae(_0x42d856['error'][_0xe5bb('0x1b')]);}logger['error'](_0xe5bb('0x1a'),_0x574a4e,_0x42d856[_0xe5bb('0x18')]['message']);return _0x18817c(_0x42d856[_0xe5bb('0x18')][_0xe5bb('0x1b')]);}else{logger[_0xe5bb('0x13')]('SmsMessage,\x20%s,\x20%s',_0x574a4e,_0xe5bb('0x14'));_0x18817c(_0x42d856[_0xe5bb('0x1c')]['message']);}})[_0xe5bb('0x1d')](function(_0x172140){logger['error'](_0xe5bb('0x1a'),_0x574a4e,_0x172140);_0x596cae(_0x172140);});});}exports[_0xe5bb('0x1e')]=function(_0x19190f){var _0x20a4c6=this;return new Promise(function(_0x400372,_0x33930d){return db[_0xe5bb('0x1f')][_0xe5bb('0x20')](_0x19190f[_0xe5bb('0x21')],{'raw':_0x19190f[_0xe5bb('0x22')]?_0x19190f['options']['raw']===undefined?!![]:![]:!![]})[_0xe5bb('0x12')](function(_0x2c1aad){logger[_0xe5bb('0x13')](_0xe5bb('0x1e'),_0x19190f);logger[_0xe5bb('0x15')](_0xe5bb('0x1e'),_0x19190f,JSON['stringify'](_0x2c1aad));_0x400372(_0x2c1aad);})[_0xe5bb('0x1d')](function(_0x35ba89){logger['error'](_0xe5bb('0x1e'),_0x35ba89['message'],_0x19190f);_0x33930d(_0x20a4c6[_0xe5bb('0x18')](0x1f4,_0x35ba89['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4aafd04..9194985 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 _0xd69e=['smsMessage:','./smsMessage.events','update','emit','removeListener','register','length'];(function(_0x55929e,_0x16e7e0){var _0x14d5de=function(_0x14a69f){while(--_0x14a69f){_0x55929e['push'](_0x55929e['shift']());}};_0x14d5de(++_0x16e7e0);}(_0xd69e,0x174));var _0xed69=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd69e[_0x4a53d];return _0x27410e;};'use strict';var SmsMessageEvents=require(_0xed69('0x0'));var events=['save','remove',_0xed69('0x1')];function createListener(_0x19d9a2,_0x504286){return function(_0x2fe105){_0x504286[_0xed69('0x2')](_0x19d9a2,_0x2fe105);};}function removeListener(_0x22f97a,_0x569e8a){return function(){SmsMessageEvents[_0xed69('0x3')](_0x22f97a,_0x569e8a);};}exports[_0xed69('0x4')]=function(_0xa2c7b7){for(var _0x218415=0x0,_0x10a6e6=events[_0xed69('0x5')];_0x218415<_0x10a6e6;_0x218415++){var _0x284369=events[_0x218415];var _0x2c0f45=createListener(_0xed69('0x6')+_0x284369,_0xa2c7b7);SmsMessageEvents['on'](_0x284369,_0x2c0f45);}}; \ No newline at end of file +var _0x4aad=['remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x4aad,0x10e));var _0xd4aa=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x4aad[_0x273c39];return _0x46d6b5;};'use strict';var SmsMessageEvents=require(_0xd4aa('0x0'));var events=[_0xd4aa('0x1'),_0xd4aa('0x2'),'update'];function createListener(_0x2c5bb4,_0x4dd83d){return function(_0x4e218a){_0x4dd83d[_0xd4aa('0x3')](_0x2c5bb4,_0x4e218a);};}function removeListener(_0x576559,_0x4c5074){return function(){SmsMessageEvents[_0xd4aa('0x4')](_0x576559,_0x4c5074);};}exports[_0xd4aa('0x5')]=function(_0x3cdfab){for(var _0x518283=0x0,_0x53eab6=events[_0xd4aa('0x6')];_0x518283<_0x53eab6;_0x518283++){var _0x5bfa17=events[_0x518283];var _0x924b76=createListener(_0xd4aa('0x7')+_0x5bfa17,_0x3cdfab);SmsMessageEvents['on'](_0x5bfa17,_0x924b76);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1c8475e..4e22c3b 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 _0x9e87=['isAuthenticated','index','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9e87,0x1d3));var _0x79e8=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0x9e87[_0x53ad58];return _0x554b03;};'use strict';var multer=require(_0x79e8('0x0'));var util=require(_0x79e8('0x1'));var path=require('path');var timeout=require(_0x79e8('0x2'));var express=require(_0x79e8('0x3'));var router=express['Router']();var fs_extra=require(_0x79e8('0x4'));var auth=require(_0x79e8('0x5'));var interaction=require(_0x79e8('0x6'));var config=require(_0x79e8('0x7'));var controller=require(_0x79e8('0x8'));router['get']('/',auth[_0x79e8('0x9')](),controller[_0x79e8('0xa')]);router[_0x79e8('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x79e8('0xb')](_0x79e8('0xc'),auth[_0x79e8('0x9')](),controller[_0x79e8('0xd')]);router[_0x79e8('0xb')](_0x79e8('0xe'),auth[_0x79e8('0x9')](),controller[_0x79e8('0xf')]);router[_0x79e8('0xb')](_0x79e8('0x10'),auth[_0x79e8('0x9')](),controller[_0x79e8('0x11')]);router[_0x79e8('0xb')](_0x79e8('0x12'),auth[_0x79e8('0x9')](),controller[_0x79e8('0x13')]);router[_0x79e8('0x14')]('/',auth[_0x79e8('0x9')](),controller[_0x79e8('0x15')]);router[_0x79e8('0x14')](_0x79e8('0x10'),auth[_0x79e8('0x9')](),controller[_0x79e8('0x16')]);router['post'](_0x79e8('0x12'),auth[_0x79e8('0x9')](),controller['addAgents']);router[_0x79e8('0x17')]('/:id',auth[_0x79e8('0x9')](),controller[_0x79e8('0x18')]);router[_0x79e8('0x19')]('/:id',auth[_0x79e8('0x9')](),controller['destroy']);router[_0x79e8('0x19')](_0x79e8('0x10'),auth['isAuthenticated'](),controller[_0x79e8('0x1a')]);router[_0x79e8('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x79e8('0x1b')]=router; \ No newline at end of file +var _0xb82d=['Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x25ea25,_0x570998){var _0x1d453c=function(_0x2a5c09){while(--_0x2a5c09){_0x25ea25['push'](_0x25ea25['shift']());}};_0x1d453c(++_0x570998);}(_0xb82d,0x1cc));var _0xdb82=function(_0x29ff84,_0x40de7b){_0x29ff84=_0x29ff84-0x0;var _0x4e81a0=_0xb82d[_0x29ff84];return _0x4e81a0;};'use strict';var multer=require(_0xdb82('0x0'));var util=require(_0xdb82('0x1'));var path=require('path');var timeout=require(_0xdb82('0x2'));var express=require(_0xdb82('0x3'));var router=express[_0xdb82('0x4')]();var fs_extra=require(_0xdb82('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb82('0x6'));var config=require(_0xdb82('0x7'));var controller=require(_0xdb82('0x8'));router[_0xdb82('0x9')]('/',auth[_0xdb82('0xa')](),controller[_0xdb82('0xb')]);router[_0xdb82('0x9')]('/describe',auth[_0xdb82('0xa')](),controller[_0xdb82('0xc')]);router['get'](_0xdb82('0xd'),auth[_0xdb82('0xa')](),controller[_0xdb82('0xe')]);router[_0xdb82('0x9')](_0xdb82('0xf'),auth['isAuthenticated'](),controller[_0xdb82('0x10')]);router['get'](_0xdb82('0x11'),auth[_0xdb82('0xa')](),controller['getTeams']);router[_0xdb82('0x9')](_0xdb82('0x12'),auth[_0xdb82('0xa')](),controller[_0xdb82('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb82('0x14')]);router[_0xdb82('0x15')](_0xdb82('0x11'),auth['isAuthenticated'](),controller[_0xdb82('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xdb82('0x17')]);router['put'](_0xdb82('0xd'),auth[_0xdb82('0xa')](),controller[_0xdb82('0x18')]);router[_0xdb82('0x19')](_0xdb82('0xd'),auth[_0xdb82('0xa')](),controller[_0xdb82('0x1a')]);router['delete'](_0xdb82('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xdb82('0x12'),auth[_0xdb82('0xa')](),controller[_0xdb82('0x1b')]);module[_0xdb82('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 0676a0d..fb964f6 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 _0x2937=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4f21c4,_0x960024){var _0x2f9fa6=function(_0x26f914){while(--_0x26f914){_0x4f21c4['push'](_0x4f21c4['shift']());}};_0x2f9fa6(++_0x960024);}(_0x2937,0xe8));var _0x7293=function(_0x17c5ec,_0x409460){_0x17c5ec=_0x17c5ec-0x0;var _0x161bad=_0x2937[_0x17c5ec];return _0x161bad;};'use strict';var Sequelize=require(_0x7293('0x0'));module[_0x7293('0x1')]={'name':{'type':Sequelize[_0x7293('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7293('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7293('0x4')](_0x7293('0x5'),'beepall',_0x7293('0x6'))}}; \ No newline at end of file +var _0x01ff=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x29b189,_0x542f7b){var _0x1c30c5=function(_0x10af2c){while(--_0x10af2c){_0x29b189['push'](_0x29b189['shift']());}};_0x1c30c5(++_0x542f7b);}(_0x01ff,0x17b));var _0xf01f=function(_0x1d133a,_0x5ee33d){_0x1d133a=_0x1d133a-0x0;var _0x186f0d=_0x01ff[_0x1d133a];return _0x186f0d;};'use strict';var Sequelize=require(_0xf01f('0x0'));module[_0xf01f('0x1')]={'name':{'type':Sequelize[_0xf01f('0x2')],'unique':_0xf01f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf01f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf01f('0x5'),_0xf01f('0x6'),_0xf01f('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 68a5eee..c6b4d8e 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 _0x4e2e=['create','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','interface','flatMap','get','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userSmsQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','params','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation'];(function(_0xf535ca,_0x35e48b){var _0x28b940=function(_0x416ea6){while(--_0x416ea6){_0xf535ca['push'](_0xf535ca['shift']());}};_0x28b940(++_0x35e48b);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x390964,_0x3f0806){_0x390964=_0x390964-0x0;var _0x2c5c2d=_0x4e2e[_0x390964];return _0x2c5c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];config[_0xe4e2('0x1a')]=_[_0xe4e2('0x1b')](config[_0xe4e2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4e2('0x1c'))(new Redis(config[_0xe4e2('0x1a')]));require(_0xe4e2('0x1d'))[_0xe4e2('0x1e')](socket);function respondWithStatusCode(_0x202486,_0x50678d){_0x50678d=_0x50678d||0xcc;return function(_0x58e012){if(_0x58e012){return _0x202486[_0xe4e2('0x1f')](_0x50678d);}return _0x202486[_0xe4e2('0x20')](_0x50678d)[_0xe4e2('0x21')]();};}function respondWithResult(_0x28ee12,_0x217ea5){_0x217ea5=_0x217ea5||0xc8;return function(_0x54107a){if(_0x54107a){return _0x28ee12[_0xe4e2('0x20')](_0x217ea5)[_0xe4e2('0x22')](_0x54107a);}};}function respondWithFilteredResult(_0x340935,_0x4fe2f2){return function(_0x196f16){if(_0x196f16){var _0x54c80b=typeof _0x4fe2f2[_0xe4e2('0x23')]===_0xe4e2('0x24')&&typeof _0x4fe2f2[_0xe4e2('0x25')]===_0xe4e2('0x24');var _0x3dfbdf=_0x196f16[_0xe4e2('0x26')];var _0x339d00=_0x54c80b?0x0:_0x4fe2f2[_0xe4e2('0x23')];var _0x4769dd=_0x54c80b?_0x196f16[_0xe4e2('0x26')]:_0x4fe2f2['offset']+_0x4fe2f2[_0xe4e2('0x25')];var _0x2e7ecd;if(_0x4769dd>=_0x3dfbdf){_0x4769dd=_0x3dfbdf;_0x2e7ecd=0xc8;}else{_0x2e7ecd=0xce;}_0x340935[_0xe4e2('0x20')](_0x2e7ecd);return _0x340935[_0xe4e2('0x27')](_0xe4e2('0x28'),_0x339d00+'-'+_0x4769dd+'/'+_0x3dfbdf)[_0xe4e2('0x22')](_0x196f16);}return null;};}function patchUpdates(_0x16f14b){return function(_0x51c67e){try{jsonpatch[_0xe4e2('0x29')](_0x51c67e,_0x16f14b,!![]);}catch(_0x2ab435){return BPromise[_0xe4e2('0x2a')](_0x2ab435);}return _0x51c67e['save']();};}function saveUpdates(_0x353030,_0x12ad33){return function(_0x598fa3){if(_0x598fa3){return _0x598fa3[_0xe4e2('0x2b')](_0x353030)[_0xe4e2('0x2c')](function(_0x29143c){return _0x29143c;});}return null;};}function removeEntity(_0x3f5265,_0x249b7e){return function(_0x5887c9){if(_0x5887c9){return _0x5887c9[_0xe4e2('0x2d')]()[_0xe4e2('0x2c')](function(){var _0x1f6d1f=_0x5887c9['get']({'plain':!![]});var _0x3a31b8=_0xe4e2('0x2e');return db[_0xe4e2('0x2f')]['destroy']({'where':{'type':_0x3a31b8,'resourceId':_0x1f6d1f['id']}})[_0xe4e2('0x2c')](function(){return _0x5887c9;});})['then'](function(){_0x3f5265[_0xe4e2('0x20')](0xcc)[_0xe4e2('0x21')]();});}};}function handleEntityNotFound(_0x52c849,_0x46926a){return function(_0x18e2e5){if(!_0x18e2e5){_0x52c849[_0xe4e2('0x1f')](0x194);}return _0x18e2e5;};}function handleError(_0x41500b,_0x1f7bcc){_0x1f7bcc=_0x1f7bcc||0x1f4;return function(_0x4d33de){logger['error'](_0x4d33de[_0xe4e2('0x30')]);if(_0x4d33de[_0xe4e2('0x31')]){delete _0x4d33de[_0xe4e2('0x31')];}_0x41500b[_0xe4e2('0x20')](_0x1f7bcc)[_0xe4e2('0x32')](_0x4d33de);};}exports[_0xe4e2('0x33')]=function(_0x1c7f9a,_0x40569e){var _0x37dec8={},_0x59eb={},_0x1c87b0={'count':0x0,'rows':[]};var _0x3fb693=_['map'](db[_0xe4e2('0x34')][_0xe4e2('0x35')],function(_0xe0846a){return{'name':_0xe0846a[_0xe4e2('0x36')],'type':_0xe0846a[_0xe4e2('0x37')][_0xe4e2('0x38')]};});_0x59eb['model']=_[_0xe4e2('0x39')](_0x3fb693,_0xe4e2('0x31'));_0x59eb[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x1c7f9a[_0xe4e2('0x3a')]);_0x59eb[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x59eb[_0xe4e2('0x3e')],_0x59eb[_0xe4e2('0x3a')]);_0x37dec8[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x59eb['model'],qs[_0xe4e2('0x40')](_0x1c7f9a['query'][_0xe4e2('0x40')]));_0x37dec8[_0xe4e2('0x3f')]=_0x37dec8['attributes'][_0xe4e2('0x41')]?_0x37dec8[_0xe4e2('0x3f')]:_0x59eb[_0xe4e2('0x3e')];if(!_0x1c7f9a[_0xe4e2('0x3a')]['hasOwnProperty'](_0xe4e2('0x42'))){_0x37dec8['limit']=qs[_0xe4e2('0x25')](_0x1c7f9a['query'][_0xe4e2('0x25')]);_0x37dec8[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x1c7f9a['query'][_0xe4e2('0x23')]);}_0x37dec8[_0xe4e2('0x43')]=qs['sort'](_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x37dec8[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x1c7f9a[_0xe4e2('0x3a')],_0x59eb[_0xe4e2('0x3c')]),_0x3fb693);if(_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x37dec8['where']=_['merge'](_0x37dec8[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x3fb693,function(_0x5d05a4){if(_0x5d05a4[_0xe4e2('0x37')]!=='VIRTUAL'){var _0x4d8a2d={};_0x4d8a2d[_0x5d05a4[_0xe4e2('0x31')]]={'$like':'%'+_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x4d8a2d;}})});}_0x37dec8=_[_0xe4e2('0x48')]({},_0x37dec8,_0x1c7f9a['options']);var _0x45e88c={'where':_0x37dec8[_0xe4e2('0x45')]};return db[_0xe4e2('0x34')]['count'](_0x45e88c)[_0xe4e2('0x2c')](function(_0x4789cf){_0x1c87b0[_0xe4e2('0x26')]=_0x4789cf;if(_0x1c7f9a[_0xe4e2('0x3a')]['includeAll']){_0x37dec8['include']=[{'all':!![]}];}return db[_0xe4e2('0x34')][_0xe4e2('0x49')](_0x37dec8);})[_0xe4e2('0x2c')](function(_0x5c29c3){_0x1c87b0[_0xe4e2('0x4a')]=_0x5c29c3;return _0x1c87b0;})[_0xe4e2('0x2c')](respondWithFilteredResult(_0x40569e,_0x37dec8))['catch'](handleError(_0x40569e,null));};exports[_0xe4e2('0x4b')]=function(_0x3d55f9,_0x1538bd){var _0x17f30f={'raw':!![],'where':{'id':_0x3d55f9[_0xe4e2('0x4c')]['id']}},_0x4ed88f={};_0x4ed88f[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['SmsQueue'][_0xe4e2('0x35')]);_0x4ed88f[_0xe4e2('0x3a')]=_['keys'](_0x3d55f9['query']);_0x4ed88f[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],_0x4ed88f['query']);_0x17f30f[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x3d55f9['query'][_0xe4e2('0x40')]));_0x17f30f[_0xe4e2('0x3f')]=_0x17f30f[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x17f30f['attributes']:_0x4ed88f[_0xe4e2('0x3e')];if(_0x3d55f9[_0xe4e2('0x3a')]['includeAll']){_0x17f30f[_0xe4e2('0x4d')]=[{'all':!![]}];}_0x17f30f=_[_0xe4e2('0x48')]({},_0x17f30f,_0x3d55f9[_0xe4e2('0x4e')]);return db['SmsQueue'][_0xe4e2('0x4f')](_0x17f30f)[_0xe4e2('0x2c')](handleEntityNotFound(_0x1538bd,null))[_0xe4e2('0x2c')](respondWithResult(_0x1538bd,null))['catch'](handleError(_0x1538bd,null));};exports['create']=function(_0xccf95e,_0x4c6253){return db[_0xe4e2('0x34')]['create'](_0xccf95e[_0xe4e2('0x50')],{})[_0xe4e2('0x2c')](function(_0x2a2e76){var _0x553817=_0xccf95e[_0xe4e2('0x51')]['get']({'plain':!![]});if(!_0x553817)throw new Error(_0xe4e2('0x52'));if(_0x553817[_0xe4e2('0x53')]==='user'){var _0x9d00fb=_0x2a2e76['get']({'plain':!![]});var _0x169251=_0xe4e2('0x2e');return db['UserProfileSection'][_0xe4e2('0x4f')]({'where':{'name':_0x169251,'userProfileId':_0x553817[_0xe4e2('0x54')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x3e540d){if(_0x3e540d&&_0x3e540d[_0xe4e2('0x55')]===0x0){return db[_0xe4e2('0x2f')][_0xe4e2('0x56')]({'name':_0x9d00fb[_0xe4e2('0x31')],'resourceId':_0x9d00fb['id'],'type':_0x3e540d[_0xe4e2('0x31')],'sectionId':_0x3e540d['id']},{})['then'](function(){return _0x2a2e76;});}else{return _0x2a2e76;}})[_0xe4e2('0x57')](function(_0x172747){logger[_0xe4e2('0x58')](_0xe4e2('0x59'),_0x172747);throw _0x172747;});}return _0x2a2e76;})[_0xe4e2('0x2c')](respondWithResult(_0x4c6253,0xc9))[_0xe4e2('0x57')](handleError(_0x4c6253,null));};exports[_0xe4e2('0x2b')]=function(_0x135bcf,_0x1ac9b7){if(_0x135bcf[_0xe4e2('0x50')]['id']){delete _0x135bcf[_0xe4e2('0x50')]['id'];}return db['SmsQueue'][_0xe4e2('0x4f')]({'where':{'id':_0x135bcf[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x1ac9b7,null))[_0xe4e2('0x2c')](saveUpdates(_0x135bcf['body'],null))[_0xe4e2('0x2c')](respondWithResult(_0x1ac9b7,null))[_0xe4e2('0x57')](handleError(_0x1ac9b7,null));};exports['destroy']=function(_0x189514,_0xfbf731){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x189514['params']['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0xfbf731,null))['then'](removeEntity(_0xfbf731,null))[_0xe4e2('0x57')](handleError(_0xfbf731,null));};exports[_0xe4e2('0x5a')]=function(_0x1f22fb,_0x380dc0){return db[_0xe4e2('0x34')][_0xe4e2('0x5a')]()[_0xe4e2('0x2c')](respondWithResult(_0x380dc0,null))[_0xe4e2('0x57')](handleError(_0x380dc0,null));};exports[_0xe4e2('0x5b')]=function(_0x230969,_0x3cb0d2,_0x2fa153){var _0x5b0aa7={'raw':!![],'where':{}},_0x435dbc={},_0x58dc01;return db['SmsQueue'][_0xe4e2('0x5c')]({'where':{'id':_0x230969[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x3cb0d2,null))['then'](function(_0x477acd){if(_0x477acd){_0x58dc01=_0x477acd['get']({'plain':!![]});_0x435dbc[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['UserSmsQueue'][_0xe4e2('0x35')]);_0x435dbc[_0xe4e2('0x3a')]=_['keys'](_0x230969[_0xe4e2('0x3a')]);_0x435dbc[_0xe4e2('0x3c')]=_['intersection'](_0x435dbc[_0xe4e2('0x3e')],_0x435dbc[_0xe4e2('0x3a')]);_0x5b0aa7[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x435dbc['model'],qs[_0xe4e2('0x40')](_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x5b0aa7[_0xe4e2('0x3f')]=_0x5b0aa7[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x5b0aa7[_0xe4e2('0x3f')]:_0x435dbc[_0xe4e2('0x3e')];if(!_0x230969[_0xe4e2('0x3a')]['hasOwnProperty']('nolimit')){_0x5b0aa7['limit']=qs[_0xe4e2('0x25')](_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x5b0aa7[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x23')]);}_0x5b0aa7['order']=qs[_0xe4e2('0x44')](_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x5b0aa7[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x230969[_0xe4e2('0x3a')],_0x435dbc[_0xe4e2('0x3c')]));_0x5b0aa7[_0xe4e2('0x45')][_0xe4e2('0x5d')]=_0x477acd['id'];if(_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x5b0aa7[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x5b0aa7[_0xe4e2('0x45')],{'$or':_['map'](_0x5b0aa7[_0xe4e2('0x3f')],function(_0xdeb76a){var _0x32185b={};_0x32185b[_0xdeb76a]={'$like':'%'+_0x230969[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x32185b;})});}_0x5b0aa7=_[_0xe4e2('0x48')]({},_0x5b0aa7,_0x230969[_0xe4e2('0x4e')]);return db[_0xe4e2('0x5e')][_0xe4e2('0x49')](_0x5b0aa7);}})[_0xe4e2('0x2c')](function(_0x57a7eb){if(_0x57a7eb){return db[_0xe4e2('0x5f')][_0xe4e2('0x60')]({'where':{'id':_[_0xe4e2('0x39')](_0x57a7eb,_0xe4e2('0x61')),'role':_0xe4e2('0x62')},'attributes':['id',_0xe4e2('0x31'),_0xe4e2('0x63'),_0xe4e2('0x64'),'createdAt']});}})[_0xe4e2('0x2c')](function(_0x248432){if(_0x248432){return{'count':_0x248432[_0xe4e2('0x26')],'rows':_[_0xe4e2('0x39')](_0x248432[_0xe4e2('0x4a')],function(_0x122d12){return{'membername':_0x122d12[_0xe4e2('0x31')],'UserId':_0x122d12['id'],'queue_name':_0x58dc01[_0xe4e2('0x31')],'SmsQueueId':_0x58dc01['id'],'interface':util[_0xe4e2('0x65')](_0xe4e2('0x66'),'SIP',_0x122d12[_0xe4e2('0x31')]),'penalty':0x0,'paused':_0x122d12[_0xe4e2('0x63')],'createdAt':_0x122d12['createdAt'],'updatedAt':_0x122d12[_0xe4e2('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe4e2('0x2c')](respondWithFilteredResult(_0x3cb0d2,_0x5b0aa7))[_0xe4e2('0x57')](handleError(_0x3cb0d2,null));};exports[_0xe4e2('0x67')]=function(_0x16f0d1,_0x4b2024,_0x3640aa){var _0x1447ee={};var _0x287546={};var _0x4c2e68;var _0x1795c8;return db[_0xe4e2('0x34')][_0xe4e2('0x5c')]({'where':{'id':_0x16f0d1[_0xe4e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b2024,null))[_0xe4e2('0x2c')](function(_0x386253){if(_0x386253){_0x4c2e68=_0x386253;_0x287546[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db[_0xe4e2('0x68')][_0xe4e2('0x35')]);_0x287546[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x16f0d1[_0xe4e2('0x3a')]);_0x287546['filters']=_[_0xe4e2('0x3d')](_0x287546[_0xe4e2('0x3e')],_0x287546[_0xe4e2('0x3a')]);_0x1447ee[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x287546[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x1447ee[_0xe4e2('0x3f')]=_0x1447ee[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x1447ee[_0xe4e2('0x3f')]:_0x287546['model'];_0x1447ee[_0xe4e2('0x43')]=qs['sort'](_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x1447ee['where']=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x16f0d1[_0xe4e2('0x3a')],_0x287546[_0xe4e2('0x3c')]));if(_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x1447ee[_0xe4e2('0x45')]=_['merge'](_0x1447ee[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x1447ee['attributes'],function(_0x4a8f87){var _0x1106ab={};_0x1106ab[_0x4a8f87]={'$like':'%'+_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x1106ab;})});}_0x1447ee=_['merge']({},_0x1447ee,_0x16f0d1[_0xe4e2('0x4e')]);return _0x4c2e68['getTeams'](_0x1447ee);}})[_0xe4e2('0x2c')](function(_0x406c7e){if(_0x406c7e){_0x1795c8=_0x406c7e['length'];if(!_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x69')](_0xe4e2('0x42'))){_0x1447ee[_0xe4e2('0x25')]=qs[_0xe4e2('0x25')](_0x16f0d1[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x1447ee[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x16f0d1[_0xe4e2('0x3a')]['offset']);}return _0x4c2e68[_0xe4e2('0x67')](_0x1447ee);}})[_0xe4e2('0x2c')](function(_0x48d98c){if(_0x48d98c){return _0x48d98c?{'count':_0x1795c8,'rows':_0x48d98c}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x4b2024,null))['catch'](handleError(_0x4b2024,null));};exports[_0xe4e2('0x6a')]=function(_0x388f48,_0x94fe22,_0x30dc01){var _0x4ac90a=_0x388f48[_0xe4e2('0x50')][_0xe4e2('0x6b')];return db[_0xe4e2('0x68')][_0xe4e2('0x49')]({'where':{'id':_0x4ac90a},'attributes':['id'],'include':[{'model':db[_0xe4e2('0x5f')],'as':_0xe4e2('0x6c'),'attributes':['id',_0xe4e2('0x31'),'online','voicePause',_0xe4e2('0x6d')],'raw':!![]}]})[_0xe4e2('0x2c')](function(_0x197969){if(_0x197969){var _0x2708fe=_[_0xe4e2('0x6e')](_0x197969,function(_0x1e9959){var _0x1e6e71=_0x1e9959[_0xe4e2('0x6f')]({'plain':!![]});return _0x1e6e71[_0xe4e2('0x6c')];});return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x388f48[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x2ef410){return db[_0xe4e2('0x70')][_0xe4e2('0x71')](function(_0x1955d3){return _0x2ef410[_0xe4e2('0x6a')](_0x4ac90a,{'transaction':_0x1955d3})[_0xe4e2('0x2c')](function(){return BPromise['each'](_0x2708fe,function(_0x18607a){return db[_0xe4e2('0x5e')][_0xe4e2('0x72')]({'where':{'UserId':_0x18607a['id'],'SmsQueueId':_0x388f48['params']['id']},'transaction':_0x1955d3});});})['then'](function(){_0x2708fe[_0xe4e2('0x73')](function(_0x5738cd){socket[_0xe4e2('0x74')](_0xe4e2('0x75'),{'UserId':_0x5738cd['id'],'SmsQueueId':_0x2ef410['id']});});});});});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x94fe22,null))[_0xe4e2('0x57')](handleError(_0x94fe22,null));};exports[_0xe4e2('0x76')]=function(_0x30c7cc,_0x2c35f3,_0x3fc8c3){return db[_0xe4e2('0x68')]['findAll']({'where':{'id':_0x30c7cc[_0xe4e2('0x3a')][_0xe4e2('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe4e2('0x2c')](handleEntityNotFound(_0x2c35f3,null))[_0xe4e2('0x2c')](function(_0x31743b){var _0x10c166=_[_0xe4e2('0x39')](_0x31743b,'id');var _0x11a6f4=[];var _0x38675b=[];var _0x39fcac=squel[_0xe4e2('0x77')]();_0x39fcac[_0xe4e2('0x78')]('tq.TeamId')[_0xe4e2('0x79')](_0xe4e2('0x7a'),'tq')[_0xe4e2('0x7b')](_0xe4e2('0x7c'),'ut',_0xe4e2('0x7d'))[_0xe4e2('0x45')](_0xe4e2('0x7e'),_0x30c7cc['params']['id']);for(var _0xceeaed=0x0;_0xceeaed<_0x31743b[_0xe4e2('0x41')];_0xceeaed+=0x1){let _0x256b6d=_0x31743b[_0xceeaed];for(var _0x7d7592=0x0;_0x7d7592<_0x256b6d[_0xe4e2('0x6c')][_0xe4e2('0x41')];_0x7d7592+=0x1){let _0x3feb6c=_0x256b6d[_0xe4e2('0x6c')][_0x7d7592];var _0x36bdff=_0x39fcac['clone']();_0x36bdff[_0xe4e2('0x45')](_0xe4e2('0x7f'),_0x3feb6c['id']);_0x38675b[_0xe4e2('0x80')](db['sequelize'][_0xe4e2('0x3a')](_0x36bdff[_0xe4e2('0x81')](),{'type':db[_0xe4e2('0x70')][_0xe4e2('0x82')][_0xe4e2('0x83')]})[_0xe4e2('0x2c')](function(_0x5653e2){if(_0x5653e2[_0xe4e2('0x41')]===0x1){return _0x3feb6c['id'];}else{var _0x203fb2=_[_0xe4e2('0x84')](_['map'](_0x5653e2,_0xe4e2('0x85')),function(_0x2b0b25){return _[_0xe4e2('0x86')](_0x10c166,_0x2b0b25);});if(_0x203fb2){return _0x3feb6c['id'];}}}));}}return BPromise[_0xe4e2('0x87')](_0x38675b)[_0xe4e2('0x2c')](function(_0x17a6de){_0x11a6f4=_(_0x11a6f4)[_0xe4e2('0x88')](_0x17a6de)[_0xe4e2('0x89')]()[_0xe4e2('0x8a')]();return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x30c7cc[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x46437f){return db[_0xe4e2('0x70')]['transaction'](function(_0x5650b9){return _0x46437f[_0xe4e2('0x76')](_0x30c7cc['query']['ids'],{'transaction':_0x5650b9})[_0xe4e2('0x2c')](function(){if(!_[_0xe4e2('0x8b')](_0x11a6f4)){return _0x46437f[_0xe4e2('0x8c')](_0x11a6f4,{'transaction':_0x5650b9});}})[_0xe4e2('0x2c')](function(){_0x11a6f4['forEach'](function(_0x33c705){socket['emit']('userSmsQueue:remove',{'UserId':_0x33c705,'SmsQueueId':_0x46437f['id']});});});});});});})[_0xe4e2('0x2c')](respondWithStatusCode(_0x2c35f3,null))['catch'](handleError(_0x2c35f3,null));};exports[_0xe4e2('0x8d')]=function(_0x2b509a,_0x1130ec,_0x4e6552){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x2b509a[_0xe4e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1130ec,null))[_0xe4e2('0x2c')](function(_0x1b94e9){if(_0x1b94e9){return _0x1b94e9[_0xe4e2('0x8d')](_0x2b509a[_0xe4e2('0x50')]['ids'],_[_0xe4e2('0x8e')](_0x2b509a[_0xe4e2('0x50')],[_0xe4e2('0x6b'),'id'])||{})['spread'](function(_0x5d39bf){for(var _0x24fa78=0x0;_0x24fa78<_0x2b509a[_0xe4e2('0x50')]['ids'][_0xe4e2('0x41')];_0x24fa78+=0x1){socket['emit'](_0xe4e2('0x75'),{'UserId':Number(_0x2b509a[_0xe4e2('0x50')]['ids'][_0x24fa78]),'SmsQueueId':Number(_0x2b509a[_0xe4e2('0x4c')]['id'])});}return _0x5d39bf;});}})['then'](respondWithResult(_0x1130ec,null))[_0xe4e2('0x57')](handleError(_0x1130ec,null));};exports[_0xe4e2('0x8c')]=function(_0x3a46f6,_0x28d63a,_0x457b0f){return db[_0xe4e2('0x34')]['find']({'where':{'id':_0x3a46f6[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x28d63a,null))[_0xe4e2('0x2c')](function(_0x5c5c51){if(_0x5c5c51){return _0x5c5c51[_0xe4e2('0x8c')](_0x3a46f6[_0xe4e2('0x3a')][_0xe4e2('0x6b')])['then'](function(){if(_[_0xe4e2('0x8f')](_0x3a46f6[_0xe4e2('0x3a')][_0xe4e2('0x6b')])){for(var _0x4bbc99=0x0;_0x4bbc99<_0x3a46f6[_0xe4e2('0x3a')][_0xe4e2('0x6b')][_0xe4e2('0x41')];_0x4bbc99+=0x1){socket[_0xe4e2('0x74')](_0xe4e2('0x90'),{'UserId':Number(_0x3a46f6[_0xe4e2('0x3a')][_0xe4e2('0x6b')][_0x4bbc99]),'SmsQueueId':Number(_0x3a46f6[_0xe4e2('0x4c')]['id'])});}}else{socket[_0xe4e2('0x74')](_0xe4e2('0x90'),{'UserId':Number(_0x3a46f6[_0xe4e2('0x3a')][_0xe4e2('0x6b')]),'SmsQueueId':Number(_0x3a46f6['params']['id'])});}});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x28d63a,null))[_0xe4e2('0x57')](handleError(_0x28d63a,null));};exports[_0xe4e2('0x91')]=function(_0x353b97,_0x112397,_0x17b8b4){var _0x183fd3={};var _0x32856a={};var _0x5b221f;var _0x1e4bea;return db[_0xe4e2('0x34')][_0xe4e2('0x5c')]({'where':{'id':_0x353b97[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x112397,null))[_0xe4e2('0x2c')](function(_0xfb32dd){if(_0xfb32dd){_0x5b221f=_0xfb32dd;_0x32856a[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db[_0xe4e2('0x5f')][_0xe4e2('0x35')]);_0x32856a[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x353b97[_0xe4e2('0x3a')]);_0x32856a['filters']=_['intersection'](_0x32856a['model'],_0x32856a[_0xe4e2('0x3a')]);_0x183fd3[_0xe4e2('0x3f')]=_['intersection'](_0x32856a[_0xe4e2('0x3e')],qs['fields'](_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x183fd3[_0xe4e2('0x3f')]=_0x183fd3[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x183fd3[_0xe4e2('0x3f')]:_0x32856a['model'];_0x183fd3[_0xe4e2('0x43')]=qs['sort'](_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x183fd3[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x353b97[_0xe4e2('0x3a')],_0x32856a[_0xe4e2('0x3c')]));if(_0x353b97['query']['filter']){_0x183fd3[_0xe4e2('0x45')]=_['merge'](_0x183fd3['where'],{'$or':_[_0xe4e2('0x39')](_0x183fd3[_0xe4e2('0x3f')],function(_0x302224){var _0x2fbd55={};_0x2fbd55[_0x302224]={'$like':'%'+_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x2fbd55;})});}_0x183fd3=_[_0xe4e2('0x48')]({},_0x183fd3,_0x353b97[_0xe4e2('0x4e')]);return _0x5b221f['getAgents'](_0x183fd3);}})[_0xe4e2('0x2c')](function(_0xf143c2){if(_0xf143c2){_0x1e4bea=_0xf143c2[_0xe4e2('0x41')];if(!_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x69')](_0xe4e2('0x42'))){_0x183fd3[_0xe4e2('0x25')]=qs[_0xe4e2('0x25')](_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x183fd3[_0xe4e2('0x23')]=qs['offset'](_0x353b97[_0xe4e2('0x3a')][_0xe4e2('0x23')]);}return _0x5b221f[_0xe4e2('0x91')](_0x183fd3);}})['then'](function(_0x3dabd1){if(_0x3dabd1){return _0x3dabd1?{'count':_0x1e4bea,'rows':_0x3dabd1}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x112397,null))[_0xe4e2('0x57')](handleError(_0x112397,null));}; \ No newline at end of file +var _0x3c45=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','pick','User','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','destroy','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x348802,_0x31c11d){var _0xd94a77=function(_0x19eaca){while(--_0x19eaca){_0x348802['push'](_0x348802['shift']());}};_0xd94a77(++_0x31c11d);}(_0x3c45,0xd8));var _0x53c4=function(_0x135b3d,_0x2b645a){_0x135b3d=_0x135b3d-0x0;var _0x1fbad2=_0x3c45[_0x135b3d];return _0x1fbad2;};'use strict';var emlformat=require(_0x53c4('0x0'));var rimraf=require(_0x53c4('0x1'));var zipdir=require(_0x53c4('0x2'));var jsonpatch=require(_0x53c4('0x3'));var rp=require(_0x53c4('0x4'));var moment=require(_0x53c4('0x5'));var BPromise=require(_0x53c4('0x6'));var Mustache=require(_0x53c4('0x7'));var util=require(_0x53c4('0x8'));var path=require(_0x53c4('0x9'));var sox=require('sox');var csv=require(_0x53c4('0xa'));var ejs=require(_0x53c4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53c4('0xc'));var squel=require('squel');var crypto=require(_0x53c4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x53c4('0xa'));var querystring=require('querystring');var Papa=require(_0x53c4('0xe'));var Redis=require(_0x53c4('0xf'));var authService=require(_0x53c4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x53c4('0x11'));var hardwareService=require(_0x53c4('0x12'));var logger=require(_0x53c4('0x13'))('api');var utils=require(_0x53c4('0x14'));var config=require(_0x53c4('0x15'));var licenseUtil=require(_0x53c4('0x16'));var db=require(_0x53c4('0x17'))['db'];config[_0x53c4('0x18')]=_[_0x53c4('0x19')](config['redis'],{'host':_0x53c4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53c4('0x18')]));require(_0x53c4('0x1b'))[_0x53c4('0x1c')](socket);function respondWithStatusCode(_0x25bdb9,_0xe06b17){_0xe06b17=_0xe06b17||0xcc;return function(_0x3c0c03){if(_0x3c0c03){return _0x25bdb9[_0x53c4('0x1d')](_0xe06b17);}return _0x25bdb9[_0x53c4('0x1e')](_0xe06b17)['end']();};}function respondWithResult(_0x2adf02,_0x22a281){_0x22a281=_0x22a281||0xc8;return function(_0x9578c4){if(_0x9578c4){return _0x2adf02[_0x53c4('0x1e')](_0x22a281)[_0x53c4('0x1f')](_0x9578c4);}};}function respondWithFilteredResult(_0x19415b,_0x5ce5a0){return function(_0x4f487e){if(_0x4f487e){var _0x10d46b=typeof _0x5ce5a0[_0x53c4('0x20')]===_0x53c4('0x21')&&typeof _0x5ce5a0[_0x53c4('0x22')]===_0x53c4('0x21');var _0x1404c5=_0x4f487e[_0x53c4('0x23')];var _0xac4694=_0x10d46b?0x0:_0x5ce5a0[_0x53c4('0x20')];var _0x29f8e7=_0x10d46b?_0x4f487e[_0x53c4('0x23')]:_0x5ce5a0[_0x53c4('0x20')]+_0x5ce5a0[_0x53c4('0x22')];var _0x170511;if(_0x29f8e7>=_0x1404c5){_0x29f8e7=_0x1404c5;_0x170511=0xc8;}else{_0x170511=0xce;}_0x19415b[_0x53c4('0x1e')](_0x170511);return _0x19415b[_0x53c4('0x24')](_0x53c4('0x25'),_0xac4694+'-'+_0x29f8e7+'/'+_0x1404c5)[_0x53c4('0x1f')](_0x4f487e);}return null;};}function patchUpdates(_0x1f1ae4){return function(_0x234107){try{jsonpatch[_0x53c4('0x26')](_0x234107,_0x1f1ae4,!![]);}catch(_0x19b69f){return BPromise[_0x53c4('0x27')](_0x19b69f);}return _0x234107[_0x53c4('0x28')]();};}function saveUpdates(_0x471bd8,_0x1520b4){return function(_0x32461a){if(_0x32461a){return _0x32461a[_0x53c4('0x29')](_0x471bd8)['then'](function(_0x4c8f1a){return _0x4c8f1a;});}return null;};}function removeEntity(_0x2f364a,_0x3b4488){return function(_0x2aae6f){if(_0x2aae6f){return _0x2aae6f['destroy']()[_0x53c4('0x2a')](function(){var _0x5a07c3=_0x2aae6f[_0x53c4('0x2b')]({'plain':!![]});var _0x1566e8=_0x53c4('0x2c');return db['UserProfileResource'][_0x53c4('0x2d')]({'where':{'type':_0x1566e8,'resourceId':_0x5a07c3['id']}})[_0x53c4('0x2a')](function(){return _0x2aae6f;});})[_0x53c4('0x2a')](function(){_0x2f364a['status'](0xcc)[_0x53c4('0x2e')]();});}};}function handleEntityNotFound(_0x40a42d,_0x16492f){return function(_0x447f6e){if(!_0x447f6e){_0x40a42d[_0x53c4('0x1d')](0x194);}return _0x447f6e;};}function handleError(_0x3b51d6,_0x4c1f16){_0x4c1f16=_0x4c1f16||0x1f4;return function(_0x3cbbe9){logger[_0x53c4('0x2f')](_0x3cbbe9[_0x53c4('0x30')]);if(_0x3cbbe9[_0x53c4('0x31')]){delete _0x3cbbe9[_0x53c4('0x31')];}_0x3b51d6[_0x53c4('0x1e')](_0x4c1f16)[_0x53c4('0x32')](_0x3cbbe9);};}exports[_0x53c4('0x33')]=function(_0x337713,_0x3e517c){var _0x3e70b3={},_0x3fb169={},_0x41987c={'count':0x0,'rows':[]};var _0x12c0b7=_[_0x53c4('0x34')](db[_0x53c4('0x35')][_0x53c4('0x36')],function(_0x46520f){return{'name':_0x46520f[_0x53c4('0x37')],'type':_0x46520f['type'][_0x53c4('0x38')]};});_0x3fb169['model']=_[_0x53c4('0x34')](_0x12c0b7,_0x53c4('0x31'));_0x3fb169[_0x53c4('0x39')]=_[_0x53c4('0x3a')](_0x337713['query']);_0x3fb169[_0x53c4('0x3b')]=_[_0x53c4('0x3c')](_0x3fb169[_0x53c4('0x3d')],_0x3fb169[_0x53c4('0x39')]);_0x3e70b3['attributes']=_[_0x53c4('0x3c')](_0x3fb169[_0x53c4('0x3d')],qs[_0x53c4('0x3e')](_0x337713['query'][_0x53c4('0x3e')]));_0x3e70b3[_0x53c4('0x3f')]=_0x3e70b3[_0x53c4('0x3f')][_0x53c4('0x40')]?_0x3e70b3['attributes']:_0x3fb169[_0x53c4('0x3d')];if(!_0x337713[_0x53c4('0x39')][_0x53c4('0x41')](_0x53c4('0x42'))){_0x3e70b3[_0x53c4('0x22')]=qs['limit'](_0x337713['query'][_0x53c4('0x22')]);_0x3e70b3[_0x53c4('0x20')]=qs[_0x53c4('0x20')](_0x337713[_0x53c4('0x39')][_0x53c4('0x20')]);}_0x3e70b3[_0x53c4('0x43')]=qs[_0x53c4('0x44')](_0x337713['query']['sort']);_0x3e70b3[_0x53c4('0x45')]=qs[_0x53c4('0x3b')](_['pick'](_0x337713[_0x53c4('0x39')],_0x3fb169[_0x53c4('0x3b')]),_0x12c0b7);if(_0x337713[_0x53c4('0x39')][_0x53c4('0x46')]){_0x3e70b3[_0x53c4('0x45')]=_[_0x53c4('0x47')](_0x3e70b3[_0x53c4('0x45')],{'$or':_[_0x53c4('0x34')](_0x12c0b7,function(_0x4d709b){if(_0x4d709b['type']!=='VIRTUAL'){var _0x3e0945={};_0x3e0945[_0x4d709b[_0x53c4('0x31')]]={'$like':'%'+_0x337713[_0x53c4('0x39')][_0x53c4('0x46')]+'%'};return _0x3e0945;}})});}_0x3e70b3=_[_0x53c4('0x47')]({},_0x3e70b3,_0x337713[_0x53c4('0x48')]);var _0x5c4f18={'where':_0x3e70b3[_0x53c4('0x45')]};return db[_0x53c4('0x35')][_0x53c4('0x23')](_0x5c4f18)[_0x53c4('0x2a')](function(_0x5c2874){_0x41987c[_0x53c4('0x23')]=_0x5c2874;if(_0x337713[_0x53c4('0x39')][_0x53c4('0x49')]){_0x3e70b3[_0x53c4('0x4a')]=[{'all':!![]}];}return db[_0x53c4('0x35')][_0x53c4('0x4b')](_0x3e70b3);})['then'](function(_0x5839c0){_0x41987c[_0x53c4('0x4c')]=_0x5839c0;return _0x41987c;})[_0x53c4('0x2a')](respondWithFilteredResult(_0x3e517c,_0x3e70b3))[_0x53c4('0x4d')](handleError(_0x3e517c,null));};exports['show']=function(_0x59cbe0,_0x463e46){var _0x4edfb9={'raw':!![],'where':{'id':_0x59cbe0['params']['id']}},_0x3f48c5={};_0x3f48c5[_0x53c4('0x3d')]=_[_0x53c4('0x3a')](db[_0x53c4('0x35')][_0x53c4('0x36')]);_0x3f48c5['query']=_[_0x53c4('0x3a')](_0x59cbe0[_0x53c4('0x39')]);_0x3f48c5[_0x53c4('0x3b')]=_['intersection'](_0x3f48c5['model'],_0x3f48c5[_0x53c4('0x39')]);_0x4edfb9[_0x53c4('0x3f')]=_[_0x53c4('0x3c')](_0x3f48c5[_0x53c4('0x3d')],qs['fields'](_0x59cbe0[_0x53c4('0x39')]['fields']));_0x4edfb9[_0x53c4('0x3f')]=_0x4edfb9['attributes'][_0x53c4('0x40')]?_0x4edfb9[_0x53c4('0x3f')]:_0x3f48c5[_0x53c4('0x3d')];if(_0x59cbe0[_0x53c4('0x39')][_0x53c4('0x49')]){_0x4edfb9[_0x53c4('0x4a')]=[{'all':!![]}];}_0x4edfb9=_[_0x53c4('0x47')]({},_0x4edfb9,_0x59cbe0['options']);return db['SmsQueue']['find'](_0x4edfb9)['then'](handleEntityNotFound(_0x463e46,null))['then'](respondWithResult(_0x463e46,null))[_0x53c4('0x4d')](handleError(_0x463e46,null));};exports[_0x53c4('0x4e')]=function(_0x41ddd0,_0x2bac83){return db[_0x53c4('0x35')][_0x53c4('0x4e')](_0x41ddd0['body'],{})['then'](function(_0x1de693){var _0x3cd41b=_0x41ddd0[_0x53c4('0x4f')][_0x53c4('0x2b')]({'plain':!![]});if(!_0x3cd41b)throw new Error(_0x53c4('0x50'));if(_0x3cd41b[_0x53c4('0x51')]===_0x53c4('0x4f')){var _0x22d24c=_0x1de693[_0x53c4('0x2b')]({'plain':!![]});var _0x43c42a='SmsQueues';return db[_0x53c4('0x52')][_0x53c4('0x53')]({'where':{'name':_0x43c42a,'userProfileId':_0x3cd41b[_0x53c4('0x54')]},'raw':!![]})['then'](function(_0x2b68ae){if(_0x2b68ae&&_0x2b68ae[_0x53c4('0x55')]===0x0){return db['UserProfileResource'][_0x53c4('0x4e')]({'name':_0x22d24c[_0x53c4('0x31')],'resourceId':_0x22d24c['id'],'type':_0x2b68ae['name'],'sectionId':_0x2b68ae['id']},{})[_0x53c4('0x2a')](function(){return _0x1de693;});}else{return _0x1de693;}})[_0x53c4('0x4d')](function(_0x584d4d){logger[_0x53c4('0x2f')](_0x53c4('0x56'),_0x584d4d);throw _0x584d4d;});}return _0x1de693;})[_0x53c4('0x2a')](respondWithResult(_0x2bac83,0xc9))[_0x53c4('0x4d')](handleError(_0x2bac83,null));};exports[_0x53c4('0x29')]=function(_0x60ca68,_0x267c16){if(_0x60ca68[_0x53c4('0x57')]['id']){delete _0x60ca68[_0x53c4('0x57')]['id'];}return db[_0x53c4('0x35')][_0x53c4('0x53')]({'where':{'id':_0x60ca68[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0x267c16,null))[_0x53c4('0x2a')](saveUpdates(_0x60ca68['body'],null))[_0x53c4('0x2a')](respondWithResult(_0x267c16,null))['catch'](handleError(_0x267c16,null));};exports[_0x53c4('0x2d')]=function(_0x31f3c8,_0x3e8568){return db['SmsQueue'][_0x53c4('0x53')]({'where':{'id':_0x31f3c8[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0x3e8568,null))['then'](removeEntity(_0x3e8568,null))[_0x53c4('0x4d')](handleError(_0x3e8568,null));};exports[_0x53c4('0x59')]=function(_0x55c89f,_0x2338f2){return db[_0x53c4('0x35')]['describe']()[_0x53c4('0x2a')](respondWithResult(_0x2338f2,null))[_0x53c4('0x4d')](handleError(_0x2338f2,null));};exports[_0x53c4('0x5a')]=function(_0x49bd79,_0x24d21c,_0x2d1fcf){var _0x3a52d4={'raw':!![],'where':{}},_0x5c42f3={},_0x53400d;return db['SmsQueue'][_0x53c4('0x5b')]({'where':{'id':_0x49bd79[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0x24d21c,null))[_0x53c4('0x2a')](function(_0x5de0e6){if(_0x5de0e6){_0x53400d=_0x5de0e6[_0x53c4('0x2b')]({'plain':!![]});_0x5c42f3['model']=_[_0x53c4('0x3a')](db[_0x53c4('0x5c')][_0x53c4('0x36')]);_0x5c42f3[_0x53c4('0x39')]=_[_0x53c4('0x3a')](_0x49bd79[_0x53c4('0x39')]);_0x5c42f3['filters']=_[_0x53c4('0x3c')](_0x5c42f3[_0x53c4('0x3d')],_0x5c42f3[_0x53c4('0x39')]);_0x3a52d4[_0x53c4('0x3f')]=_[_0x53c4('0x3c')](_0x5c42f3['model'],qs[_0x53c4('0x3e')](_0x49bd79[_0x53c4('0x39')][_0x53c4('0x3e')]));_0x3a52d4[_0x53c4('0x3f')]=_0x3a52d4[_0x53c4('0x3f')][_0x53c4('0x40')]?_0x3a52d4[_0x53c4('0x3f')]:_0x5c42f3[_0x53c4('0x3d')];if(!_0x49bd79[_0x53c4('0x39')]['hasOwnProperty'](_0x53c4('0x42'))){_0x3a52d4[_0x53c4('0x22')]=qs[_0x53c4('0x22')](_0x49bd79[_0x53c4('0x39')]['limit']);_0x3a52d4[_0x53c4('0x20')]=qs[_0x53c4('0x20')](_0x49bd79[_0x53c4('0x39')][_0x53c4('0x20')]);}_0x3a52d4[_0x53c4('0x43')]=qs[_0x53c4('0x44')](_0x49bd79[_0x53c4('0x39')]['sort']);_0x3a52d4[_0x53c4('0x45')]=qs[_0x53c4('0x3b')](_[_0x53c4('0x5d')](_0x49bd79['query'],_0x5c42f3[_0x53c4('0x3b')]));_0x3a52d4[_0x53c4('0x45')]['SmsQueueId']=_0x5de0e6['id'];if(_0x49bd79['query'][_0x53c4('0x46')]){_0x3a52d4[_0x53c4('0x45')]=_[_0x53c4('0x47')](_0x3a52d4[_0x53c4('0x45')],{'$or':_[_0x53c4('0x34')](_0x3a52d4[_0x53c4('0x3f')],function(_0x47bca3){var _0x3ac466={};_0x3ac466[_0x47bca3]={'$like':'%'+_0x49bd79[_0x53c4('0x39')][_0x53c4('0x46')]+'%'};return _0x3ac466;})});}_0x3a52d4=_[_0x53c4('0x47')]({},_0x3a52d4,_0x49bd79[_0x53c4('0x48')]);return db[_0x53c4('0x5c')]['findAll'](_0x3a52d4);}})['then'](function(_0x504d7a){if(_0x504d7a){return db[_0x53c4('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x504d7a,'UserId'),'role':_0x53c4('0x5f')},'attributes':['id',_0x53c4('0x31'),_0x53c4('0x60'),_0x53c4('0x61'),'createdAt']});}})[_0x53c4('0x2a')](function(_0x317eaf){if(_0x317eaf){return{'count':_0x317eaf[_0x53c4('0x23')],'rows':_[_0x53c4('0x34')](_0x317eaf[_0x53c4('0x4c')],function(_0x34e13e){return{'membername':_0x34e13e['name'],'UserId':_0x34e13e['id'],'queue_name':_0x53400d[_0x53c4('0x31')],'SmsQueueId':_0x53400d['id'],'interface':util[_0x53c4('0x62')](_0x53c4('0x63'),_0x53c4('0x64'),_0x34e13e[_0x53c4('0x31')]),'penalty':0x0,'paused':_0x34e13e[_0x53c4('0x60')],'createdAt':_0x34e13e[_0x53c4('0x65')],'updatedAt':_0x34e13e[_0x53c4('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x53c4('0x2a')](respondWithFilteredResult(_0x24d21c,_0x3a52d4))[_0x53c4('0x4d')](handleError(_0x24d21c,null));};exports[_0x53c4('0x66')]=function(_0x9c43a8,_0x53b6d6,_0x2d8f88){var _0x41a9a8={};var _0x1820ff={};var _0xf328c5;var _0x4cfe1;return db['SmsQueue']['findOne']({'where':{'id':_0x9c43a8[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0x53b6d6,null))[_0x53c4('0x2a')](function(_0x2ec9aa){if(_0x2ec9aa){_0xf328c5=_0x2ec9aa;_0x1820ff[_0x53c4('0x3d')]=_[_0x53c4('0x3a')](db[_0x53c4('0x67')][_0x53c4('0x36')]);_0x1820ff[_0x53c4('0x39')]=_['keys'](_0x9c43a8['query']);_0x1820ff[_0x53c4('0x3b')]=_[_0x53c4('0x3c')](_0x1820ff[_0x53c4('0x3d')],_0x1820ff[_0x53c4('0x39')]);_0x41a9a8[_0x53c4('0x3f')]=_[_0x53c4('0x3c')](_0x1820ff[_0x53c4('0x3d')],qs[_0x53c4('0x3e')](_0x9c43a8[_0x53c4('0x39')][_0x53c4('0x3e')]));_0x41a9a8['attributes']=_0x41a9a8[_0x53c4('0x3f')]['length']?_0x41a9a8[_0x53c4('0x3f')]:_0x1820ff[_0x53c4('0x3d')];_0x41a9a8[_0x53c4('0x43')]=qs[_0x53c4('0x44')](_0x9c43a8[_0x53c4('0x39')]['sort']);_0x41a9a8[_0x53c4('0x45')]=qs[_0x53c4('0x3b')](_[_0x53c4('0x5d')](_0x9c43a8[_0x53c4('0x39')],_0x1820ff[_0x53c4('0x3b')]));if(_0x9c43a8['query'][_0x53c4('0x46')]){_0x41a9a8[_0x53c4('0x45')]=_[_0x53c4('0x47')](_0x41a9a8[_0x53c4('0x45')],{'$or':_['map'](_0x41a9a8['attributes'],function(_0x36b82b){var _0x1847bb={};_0x1847bb[_0x36b82b]={'$like':'%'+_0x9c43a8[_0x53c4('0x39')][_0x53c4('0x46')]+'%'};return _0x1847bb;})});}_0x41a9a8=_[_0x53c4('0x47')]({},_0x41a9a8,_0x9c43a8[_0x53c4('0x48')]);return _0xf328c5[_0x53c4('0x66')](_0x41a9a8);}})[_0x53c4('0x2a')](function(_0x467ed9){if(_0x467ed9){_0x4cfe1=_0x467ed9[_0x53c4('0x40')];if(!_0x9c43a8[_0x53c4('0x39')][_0x53c4('0x41')](_0x53c4('0x42'))){_0x41a9a8[_0x53c4('0x22')]=qs[_0x53c4('0x22')](_0x9c43a8[_0x53c4('0x39')][_0x53c4('0x22')]);_0x41a9a8['offset']=qs['offset'](_0x9c43a8['query']['offset']);}return _0xf328c5[_0x53c4('0x66')](_0x41a9a8);}})[_0x53c4('0x2a')](function(_0x2909c3){if(_0x2909c3){return _0x2909c3?{'count':_0x4cfe1,'rows':_0x2909c3}:null;}})['then'](respondWithResult(_0x53b6d6,null))['catch'](handleError(_0x53b6d6,null));};exports[_0x53c4('0x68')]=function(_0x5bf814,_0xa59bf7,_0xc2abd4){var _0x4a1056=_0x5bf814[_0x53c4('0x57')][_0x53c4('0x69')];return db[_0x53c4('0x67')]['findAll']({'where':{'id':_0x4a1056},'attributes':['id'],'include':[{'model':db['User'],'as':_0x53c4('0x6a'),'attributes':['id',_0x53c4('0x31'),_0x53c4('0x6b'),_0x53c4('0x6c'),_0x53c4('0x6d')],'raw':!![]}]})['then'](function(_0x38cc07){if(_0x38cc07){var _0x231aa8=_[_0x53c4('0x6e')](_0x38cc07,function(_0x2f338f){var _0xa5a1ff=_0x2f338f[_0x53c4('0x2b')]({'plain':!![]});return _0xa5a1ff[_0x53c4('0x6a')];});return db[_0x53c4('0x35')][_0x53c4('0x53')]({'where':{'id':_0x5bf814[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](function(_0x4f9bff){return db['sequelize'][_0x53c4('0x6f')](function(_0x18ca2e){return _0x4f9bff[_0x53c4('0x68')](_0x4a1056,{'transaction':_0x18ca2e})['then'](function(){return BPromise[_0x53c4('0x70')](_0x231aa8,function(_0x377c2a){return db[_0x53c4('0x5c')]['findOrCreate']({'where':{'UserId':_0x377c2a['id'],'SmsQueueId':_0x5bf814[_0x53c4('0x58')]['id']},'transaction':_0x18ca2e});});})[_0x53c4('0x2a')](function(){_0x231aa8[_0x53c4('0x71')](function(_0x215959){socket[_0x53c4('0x72')]('userSmsQueue:save',{'UserId':_0x215959['id'],'SmsQueueId':_0x4f9bff['id']});});});});});}})[_0x53c4('0x2a')](respondWithStatusCode(_0xa59bf7,null))['catch'](handleError(_0xa59bf7,null));};exports['removeTeams']=function(_0x7e4727,_0x3a3f94,_0x40e5ea){return db['Team'][_0x53c4('0x4b')]({'where':{'id':_0x7e4727[_0x53c4('0x39')][_0x53c4('0x69')]},'attributes':['id'],'include':[{'model':db[_0x53c4('0x5e')],'as':_0x53c4('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x53c4('0x2a')](handleEntityNotFound(_0x3a3f94,null))[_0x53c4('0x2a')](function(_0x2161f7){var _0x334b4a=_[_0x53c4('0x34')](_0x2161f7,'id');var _0x11d82a=[];var _0x25883a=[];var _0x69846d=squel[_0x53c4('0x73')]();_0x69846d[_0x53c4('0x74')](_0x53c4('0x75'))['from']('team_has_sms_queues','tq')[_0x53c4('0x76')](_0x53c4('0x77'),'ut',_0x53c4('0x78'))['where'](_0x53c4('0x79'),_0x7e4727['params']['id']);for(var _0x79150a=0x0;_0x79150a<_0x2161f7[_0x53c4('0x40')];_0x79150a+=0x1){let _0x3855e6=_0x2161f7[_0x79150a];for(var _0x7aad70=0x0;_0x7aad70<_0x3855e6['Agents']['length'];_0x7aad70+=0x1){let _0x1ceae6=_0x3855e6['Agents'][_0x7aad70];var _0x58c83f=_0x69846d[_0x53c4('0x7a')]();_0x58c83f[_0x53c4('0x45')](_0x53c4('0x7b'),_0x1ceae6['id']);_0x25883a['push'](db[_0x53c4('0x7c')][_0x53c4('0x39')](_0x58c83f['toString'](),{'type':db[_0x53c4('0x7c')][_0x53c4('0x7d')]['SELECT']})[_0x53c4('0x2a')](function(_0x39adcf){if(_0x39adcf[_0x53c4('0x40')]===0x1){return _0x1ceae6['id'];}else{var _0x3b80b6=_[_0x53c4('0x7e')](_[_0x53c4('0x34')](_0x39adcf,_0x53c4('0x7f')),function(_0x35119b){return _[_0x53c4('0x80')](_0x334b4a,_0x35119b);});if(_0x3b80b6){return _0x1ceae6['id'];}}}));}}return BPromise[_0x53c4('0x81')](_0x25883a)[_0x53c4('0x2a')](function(_0x497a02){_0x11d82a=_(_0x11d82a)[_0x53c4('0x82')](_0x497a02)[_0x53c4('0x83')]()['value']();return db['SmsQueue'][_0x53c4('0x53')]({'where':{'id':_0x7e4727[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](function(_0x59d30f){return db['sequelize']['transaction'](function(_0x1bac47){return _0x59d30f['removeTeams'](_0x7e4727['query'][_0x53c4('0x69')],{'transaction':_0x1bac47})['then'](function(){if(!_[_0x53c4('0x84')](_0x11d82a)){return _0x59d30f[_0x53c4('0x85')](_0x11d82a,{'transaction':_0x1bac47});}})['then'](function(){_0x11d82a[_0x53c4('0x71')](function(_0x7872f4){socket[_0x53c4('0x72')](_0x53c4('0x86'),{'UserId':_0x7872f4,'SmsQueueId':_0x59d30f['id']});});});});});});})['then'](respondWithStatusCode(_0x3a3f94,null))[_0x53c4('0x4d')](handleError(_0x3a3f94,null));};exports[_0x53c4('0x87')]=function(_0x34703b,_0x848e90,_0xf3f187){return db[_0x53c4('0x35')][_0x53c4('0x53')]({'where':{'id':_0x34703b[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0x848e90,null))[_0x53c4('0x2a')](function(_0x41b861){if(_0x41b861){return _0x41b861[_0x53c4('0x87')](_0x34703b[_0x53c4('0x57')][_0x53c4('0x69')],_['omit'](_0x34703b[_0x53c4('0x57')],[_0x53c4('0x69'),'id'])||{})[_0x53c4('0x88')](function(_0x445fb2){for(var _0x902c9e=0x0;_0x902c9e<_0x34703b[_0x53c4('0x57')]['ids'][_0x53c4('0x40')];_0x902c9e+=0x1){socket[_0x53c4('0x72')](_0x53c4('0x89'),{'UserId':Number(_0x34703b[_0x53c4('0x57')]['ids'][_0x902c9e]),'SmsQueueId':Number(_0x34703b[_0x53c4('0x58')]['id'])});}return _0x445fb2;});}})['then'](respondWithResult(_0x848e90,null))[_0x53c4('0x4d')](handleError(_0x848e90,null));};exports['removeAgents']=function(_0x2167cd,_0xdca269,_0x377e9c){return db[_0x53c4('0x35')]['find']({'where':{'id':_0x2167cd[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0xdca269,null))[_0x53c4('0x2a')](function(_0x538b6e){if(_0x538b6e){return _0x538b6e[_0x53c4('0x85')](_0x2167cd['query'][_0x53c4('0x69')])[_0x53c4('0x2a')](function(){if(_[_0x53c4('0x8a')](_0x2167cd[_0x53c4('0x39')][_0x53c4('0x69')])){for(var _0x270731=0x0;_0x270731<_0x2167cd['query'][_0x53c4('0x69')]['length'];_0x270731+=0x1){socket[_0x53c4('0x72')]('userSmsQueue:remove',{'UserId':Number(_0x2167cd[_0x53c4('0x39')][_0x53c4('0x69')][_0x270731]),'SmsQueueId':Number(_0x2167cd[_0x53c4('0x58')]['id'])});}}else{socket[_0x53c4('0x72')](_0x53c4('0x86'),{'UserId':Number(_0x2167cd[_0x53c4('0x39')][_0x53c4('0x69')]),'SmsQueueId':Number(_0x2167cd[_0x53c4('0x58')]['id'])});}});}})[_0x53c4('0x2a')](respondWithStatusCode(_0xdca269,null))[_0x53c4('0x4d')](handleError(_0xdca269,null));};exports['getAgents']=function(_0x4f7857,_0xb22ecd,_0x1a3db7){var _0x8aed2={};var _0x4b33be={};var _0x14fe32;var _0x4d39a9;return db[_0x53c4('0x35')][_0x53c4('0x5b')]({'where':{'id':_0x4f7857[_0x53c4('0x58')]['id']}})[_0x53c4('0x2a')](handleEntityNotFound(_0xb22ecd,null))[_0x53c4('0x2a')](function(_0x10e0a3){if(_0x10e0a3){_0x14fe32=_0x10e0a3;_0x4b33be[_0x53c4('0x3d')]=_[_0x53c4('0x3a')](db[_0x53c4('0x5e')][_0x53c4('0x36')]);_0x4b33be[_0x53c4('0x39')]=_[_0x53c4('0x3a')](_0x4f7857[_0x53c4('0x39')]);_0x4b33be[_0x53c4('0x3b')]=_[_0x53c4('0x3c')](_0x4b33be[_0x53c4('0x3d')],_0x4b33be[_0x53c4('0x39')]);_0x8aed2[_0x53c4('0x3f')]=_[_0x53c4('0x3c')](_0x4b33be[_0x53c4('0x3d')],qs[_0x53c4('0x3e')](_0x4f7857['query']['fields']));_0x8aed2['attributes']=_0x8aed2['attributes']['length']?_0x8aed2[_0x53c4('0x3f')]:_0x4b33be[_0x53c4('0x3d')];_0x8aed2[_0x53c4('0x43')]=qs[_0x53c4('0x44')](_0x4f7857[_0x53c4('0x39')][_0x53c4('0x44')]);_0x8aed2[_0x53c4('0x45')]=qs['filters'](_[_0x53c4('0x5d')](_0x4f7857[_0x53c4('0x39')],_0x4b33be[_0x53c4('0x3b')]));if(_0x4f7857[_0x53c4('0x39')][_0x53c4('0x46')]){_0x8aed2[_0x53c4('0x45')]=_[_0x53c4('0x47')](_0x8aed2['where'],{'$or':_[_0x53c4('0x34')](_0x8aed2['attributes'],function(_0x3d0645){var _0x327944={};_0x327944[_0x3d0645]={'$like':'%'+_0x4f7857[_0x53c4('0x39')][_0x53c4('0x46')]+'%'};return _0x327944;})});}_0x8aed2=_[_0x53c4('0x47')]({},_0x8aed2,_0x4f7857[_0x53c4('0x48')]);return _0x14fe32[_0x53c4('0x8b')](_0x8aed2);}})[_0x53c4('0x2a')](function(_0x3bf343){if(_0x3bf343){_0x4d39a9=_0x3bf343[_0x53c4('0x40')];if(!_0x4f7857[_0x53c4('0x39')][_0x53c4('0x41')]('nolimit')){_0x8aed2[_0x53c4('0x22')]=qs[_0x53c4('0x22')](_0x4f7857[_0x53c4('0x39')][_0x53c4('0x22')]);_0x8aed2[_0x53c4('0x20')]=qs[_0x53c4('0x20')](_0x4f7857[_0x53c4('0x39')][_0x53c4('0x20')]);}return _0x14fe32[_0x53c4('0x8b')](_0x8aed2);}})[_0x53c4('0x2a')](function(_0x1dde4f){if(_0x1dde4f){return _0x1dde4f?{'count':_0x4d39a9,'rows':_0x1dde4f}:null;}})[_0x53c4('0x2a')](respondWithResult(_0xb22ecd,null))[_0x53c4('0x4d')](handleError(_0xb22ecd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9208d92..5f31492 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 _0xa1f1=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit'];(function(_0x430e6a,_0x11cf03){var _0x57d32f=function(_0x5257a9){while(--_0x5257a9){_0x430e6a['push'](_0x430e6a['shift']());}};_0x57d32f(++_0x11cf03);}(_0xa1f1,0x14d));var _0x1a1f=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0xa1f1[_0x1aed80];return _0x43961e;};'use strict';var EventEmitter=require(_0x1a1f('0x0'));var SmsQueue=require(_0x1a1f('0x1'))['db'][_0x1a1f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1a1f('0x3')](0x0);var events={'afterCreate':_0x1a1f('0x4'),'afterUpdate':'update','afterDestroy':_0x1a1f('0x5')};function emitEvent(_0x210eea){return function(_0x15d6b4,_0x47586d,_0x46d1aa){SmsQueueEvents[_0x1a1f('0x6')](_0x210eea+':'+_0x15d6b4['id'],_0x15d6b4);SmsQueueEvents['emit'](_0x210eea,_0x15d6b4);_0x46d1aa(null);};}for(var e in events){if(events[_0x1a1f('0x7')](e)){var event=events[e];SmsQueue[_0x1a1f('0x8')](e,emitEvent(event));}}module[_0x1a1f('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xb3af=['SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x30a70c,_0x53a2f7){var _0x182bcc=function(_0x38012e){while(--_0x38012e){_0x30a70c['push'](_0x30a70c['shift']());}};_0x182bcc(++_0x53a2f7);}(_0xb3af,0x1b7));var _0xfb3a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xb3af[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xfb3a('0x0'))['db'][_0xfb3a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfb3a('0x2')](0x0);var events={'afterCreate':_0xfb3a('0x3'),'afterUpdate':_0xfb3a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d90bc){return function(_0x37f7a0,_0x3bb430,_0x3abd34){SmsQueueEvents[_0xfb3a('0x5')](_0x5d90bc+':'+_0x37f7a0['id'],_0x37f7a0);SmsQueueEvents[_0xfb3a('0x5')](_0x5d90bc,_0x37f7a0);_0x3abd34(null);};}for(var e in events){if(events[_0xfb3a('0x6')](e)){var event=events[e];SmsQueue[_0xfb3a('0x7')](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 d62101f..f1f6d3b 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 _0x142d=['define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x218166,_0x23839c){var _0x12a021=function(_0x400fbf){while(--_0x400fbf){_0x218166['push'](_0x218166['shift']());}};_0x12a021(++_0x23839c);}(_0x142d,0x12a));var _0xd142=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x142d[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd142('0x0'))(_0xd142('0x1'));var moment=require(_0xd142('0x2'));var BPromise=require(_0xd142('0x3'));var rp=require(_0xd142('0x4'));var fs=require('fs');var path=require(_0xd142('0x5'));var rimraf=require(_0xd142('0x6'));var config=require(_0xd142('0x7'));var attributes=require(_0xd142('0x8'));module[_0xd142('0x9')]=function(_0x5f1ebe,_0x4f1528){return _0x5f1ebe[_0xd142('0xa')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41e2=['exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes'];(function(_0x5dd391,_0x4763e3){var _0x47eccc=function(_0x85998e){while(--_0x85998e){_0x5dd391['push'](_0x5dd391['shift']());}};_0x47eccc(++_0x4763e3);}(_0x41e2,0x197));var _0x241e=function(_0x28f550,_0x5ec7d4){_0x28f550=_0x28f550-0x0;var _0x3d8001=_0x41e2[_0x28f550];return _0x3d8001;};'use strict';var _=require(_0x241e('0x0'));var util=require('util');var logger=require(_0x241e('0x1'))(_0x241e('0x2'));var moment=require(_0x241e('0x3'));var BPromise=require(_0x241e('0x4'));var rp=require(_0x241e('0x5'));var fs=require('fs');var path=require(_0x241e('0x6'));var rimraf=require(_0x241e('0x7'));var config=require('../../config/environment');var attributes=require(_0x241e('0x8'));module[_0x241e('0x9')]=function(_0xb543fb,_0x55ecca){return _0xb543fb[_0x241e('0xa')](_0x241e('0xb'),attributes,{'tableName':_0x241e('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 0130258..b2775ae 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 _0xc641=['defaults','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','where','include','map','model','attributes','then','debug','catch','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xc641,0xde));var _0x1c64=function(_0x28bd00,_0x41665c){_0x28bd00=_0x28bd00-0x0;var _0x5dc11d=_0xc641[_0x28bd00];return _0x5dc11d;};'use strict';var _=require(_0x1c64('0x0'));var util=require(_0x1c64('0x1'));var moment=require(_0x1c64('0x2'));var BPromise=require(_0x1c64('0x3'));var rs=require(_0x1c64('0x4'));var fs=require('fs');var Redis=require(_0x1c64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c64('0x6'));var logger=require(_0x1c64('0x7'))('rpc');var config=require(_0x1c64('0x8'));var jayson=require(_0x1c64('0x9'));var client=jayson[_0x1c64('0xa')]['http']({'port':0x232a});config[_0x1c64('0xb')]=_[_0x1c64('0xc')](config[_0x1c64('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c64('0xd'))(new Redis(config[_0x1c64('0xb')]));require(_0x1c64('0xe'))[_0x1c64('0xf')](socket);function respondWithRpcPromise(_0x53b0b8,_0x35f194,_0x3e4f49){return new BPromise(function(_0x44e4dc,_0x43ed68){return client[_0x1c64('0x10')](_0x53b0b8,_0x3e4f49)['then'](function(_0x54f09b){logger[_0x1c64('0x11')](_0x1c64('0x12'),_0x35f194,_0x1c64('0x13'));logger['debug'](_0x1c64('0x14'),_0x35f194,_0x1c64('0x13'),JSON[_0x1c64('0x15')](_0x54f09b));if(_0x54f09b[_0x1c64('0x16')]){if(_0x54f09b['error'][_0x1c64('0x17')]===0x1f4){logger[_0x1c64('0x16')](_0x1c64('0x12'),_0x35f194,_0x54f09b[_0x1c64('0x16')][_0x1c64('0x18')]);return _0x43ed68(_0x54f09b['error'][_0x1c64('0x18')]);}logger[_0x1c64('0x16')](_0x1c64('0x12'),_0x35f194,_0x54f09b[_0x1c64('0x16')][_0x1c64('0x18')]);return _0x44e4dc(_0x54f09b[_0x1c64('0x16')][_0x1c64('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x35f194,_0x1c64('0x13'));_0x44e4dc(_0x54f09b[_0x1c64('0x19')][_0x1c64('0x18')]);}})['catch'](function(_0x26c04d){logger[_0x1c64('0x16')](_0x1c64('0x12'),_0x35f194,_0x26c04d);_0x43ed68(_0x26c04d);});});}exports[_0x1c64('0x1a')]=function(_0x3d7d6a){var _0x2d61f6=this;return new Promise(function(_0x48133d,_0xd647e2){return db[_0x1c64('0x1b')]['findAll']({'raw':_0x3d7d6a[_0x1c64('0x1c')]?_0x3d7d6a[_0x1c64('0x1c')][_0x1c64('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d7d6a[_0x1c64('0x1c')]?_0x3d7d6a[_0x1c64('0x1c')][_0x1c64('0x1e')]||null:null,'attributes':_0x3d7d6a['options']?_0x3d7d6a[_0x1c64('0x1c')]['attributes']||null:null,'limit':_0x3d7d6a['options']?_0x3d7d6a['options']['limit']||null:null,'include':_0x3d7d6a[_0x1c64('0x1c')]?_0x3d7d6a['options'][_0x1c64('0x1f')]?_[_0x1c64('0x20')](_0x3d7d6a['options'][_0x1c64('0x1f')],function(_0x409b37){return{'model':db[_0x409b37[_0x1c64('0x21')]],'as':_0x409b37['as'],'attributes':_0x409b37[_0x1c64('0x22')],'include':_0x409b37[_0x1c64('0x1f')]?_[_0x1c64('0x20')](_0x409b37[_0x1c64('0x1f')],function(_0x1dc554){return{'model':db[_0x1dc554[_0x1c64('0x21')]],'as':_0x1dc554['as'],'attributes':_0x1dc554[_0x1c64('0x22')],'include':_0x1dc554[_0x1c64('0x1f')]?_['map'](_0x1dc554[_0x1c64('0x1f')],function(_0x22d851){return{'model':db[_0x22d851['model']],'as':_0x22d851['as'],'attributes':_0x22d851[_0x1c64('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1c64('0x23')](function(_0x5f0b33){logger['info']('GetSmsQueue',_0x3d7d6a);logger[_0x1c64('0x24')]('GetSmsQueue',_0x3d7d6a,JSON[_0x1c64('0x15')](_0x5f0b33));_0x48133d(_0x5f0b33);})[_0x1c64('0x25')](function(_0x1036b9){logger[_0x1c64('0x16')]('GetSmsQueue',_0x1036b9[_0x1c64('0x18')],_0x3d7d6a);_0xd647e2(_0x2d61f6[_0x1c64('0x16')](0x1f4,_0x1036b9[_0x1c64('0x18')]));});});};exports[_0x1c64('0x26')]=function(_0x1414ba){var _0x3fc45d=this;return new Promise(function(_0x1caa94,_0xfb308e){return db['SmsQueue']['find']({'raw':_0x1414ba[_0x1c64('0x1c')]?_0x1414ba[_0x1c64('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1414ba[_0x1c64('0x1c')]?_0x1414ba[_0x1c64('0x1c')]['where']||null:null,'attributes':_0x1414ba[_0x1c64('0x1c')]?_0x1414ba[_0x1c64('0x1c')][_0x1c64('0x22')]||null:null,'include':_0x1414ba[_0x1c64('0x1c')]?_0x1414ba[_0x1c64('0x1c')][_0x1c64('0x1f')]?_[_0x1c64('0x20')](_0x1414ba[_0x1c64('0x1c')][_0x1c64('0x1f')],function(_0xd133e2){return{'model':db[_0xd133e2[_0x1c64('0x21')]],'as':_0xd133e2['as'],'attributes':_0xd133e2['attributes'],'include':_0xd133e2[_0x1c64('0x1f')]?_[_0x1c64('0x20')](_0xd133e2[_0x1c64('0x1f')],function(_0x3309d2){return{'model':db[_0x3309d2[_0x1c64('0x21')]],'as':_0x3309d2['as'],'attributes':_0x3309d2[_0x1c64('0x22')],'include':_0x3309d2['include']?_['map'](_0x3309d2[_0x1c64('0x1f')],function(_0xbe01c6){return{'model':db[_0xbe01c6[_0x1c64('0x21')]],'as':_0xbe01c6['as'],'attributes':_0xbe01c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c64('0x23')](function(_0x58821d){logger['info'](_0x1c64('0x26'),_0x1414ba);logger[_0x1c64('0x24')]('ShowSmsQueue',_0x1414ba,JSON[_0x1c64('0x15')](_0x58821d));_0x1caa94(_0x58821d);})[_0x1c64('0x25')](function(_0x3a129e){logger[_0x1c64('0x16')](_0x1c64('0x26'),_0x3a129e[_0x1c64('0x18')],_0x1414ba);_0xfb308e(_0x3fc45d[_0x1c64('0x16')](0x1f4,_0x3a129e[_0x1c64('0x18')]));});});}; \ No newline at end of file +var _0xc775=['ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','where','include','model','attributes','map','GetSmsQueue','catch'];(function(_0x294ca4,_0x2014a4){var _0x187cc0=function(_0x49fa8a){while(--_0x49fa8a){_0x294ca4['push'](_0x294ca4['shift']());}};_0x187cc0(++_0x2014a4);}(_0xc775,0x78));var _0x5c77=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc775[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var moment=require(_0x5c77('0x2'));var BPromise=require(_0x5c77('0x3'));var rs=require(_0x5c77('0x4'));var fs=require('fs');var Redis=require(_0x5c77('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c77('0x6'));var logger=require(_0x5c77('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5c77('0x8'));var client=jayson[_0x5c77('0x9')][_0x5c77('0xa')]({'port':0x232a});config['redis']=_[_0x5c77('0xb')](config[_0x5c77('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c77('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x5c77('0xe')](socket);function respondWithRpcPromise(_0x1321ca,_0x4b15dd,_0x1e0d9a){return new BPromise(function(_0x15c18d,_0x596265){return client[_0x5c77('0xf')](_0x1321ca,_0x1e0d9a)[_0x5c77('0x10')](function(_0x285206){logger['info'](_0x5c77('0x11'),_0x4b15dd,_0x5c77('0x12'));logger[_0x5c77('0x13')](_0x5c77('0x14'),_0x4b15dd,_0x5c77('0x12'),JSON[_0x5c77('0x15')](_0x285206));if(_0x285206[_0x5c77('0x16')]){if(_0x285206['error'][_0x5c77('0x17')]===0x1f4){logger[_0x5c77('0x16')](_0x5c77('0x11'),_0x4b15dd,_0x285206[_0x5c77('0x16')][_0x5c77('0x18')]);return _0x596265(_0x285206['error'][_0x5c77('0x18')]);}logger[_0x5c77('0x16')](_0x5c77('0x11'),_0x4b15dd,_0x285206['error']['message']);return _0x15c18d(_0x285206[_0x5c77('0x16')][_0x5c77('0x18')]);}else{logger[_0x5c77('0x19')](_0x5c77('0x11'),_0x4b15dd,_0x5c77('0x12'));_0x15c18d(_0x285206[_0x5c77('0x1a')][_0x5c77('0x18')]);}})['catch'](function(_0x444d9c){logger[_0x5c77('0x16')](_0x5c77('0x11'),_0x4b15dd,_0x444d9c);_0x596265(_0x444d9c);});});}exports['GetSmsQueue']=function(_0x26d69e){var _0x28eb2d=this;return new Promise(function(_0x109524,_0x131f39){return db['SmsQueue'][_0x5c77('0x1b')]({'raw':_0x26d69e[_0x5c77('0x1c')]?_0x26d69e['options']['raw']===undefined?!![]:![]:!![],'where':_0x26d69e[_0x5c77('0x1c')]?_0x26d69e[_0x5c77('0x1c')][_0x5c77('0x1d')]||null:null,'attributes':_0x26d69e[_0x5c77('0x1c')]?_0x26d69e[_0x5c77('0x1c')]['attributes']||null:null,'limit':_0x26d69e['options']?_0x26d69e[_0x5c77('0x1c')]['limit']||null:null,'include':_0x26d69e['options']?_0x26d69e['options']['include']?_['map'](_0x26d69e['options'][_0x5c77('0x1e')],function(_0x6c9d9e){return{'model':db[_0x6c9d9e[_0x5c77('0x1f')]],'as':_0x6c9d9e['as'],'attributes':_0x6c9d9e[_0x5c77('0x20')],'include':_0x6c9d9e[_0x5c77('0x1e')]?_[_0x5c77('0x21')](_0x6c9d9e[_0x5c77('0x1e')],function(_0x4d2438){return{'model':db[_0x4d2438['model']],'as':_0x4d2438['as'],'attributes':_0x4d2438[_0x5c77('0x20')],'include':_0x4d2438['include']?_['map'](_0x4d2438[_0x5c77('0x1e')],function(_0x291e1e){return{'model':db[_0x291e1e[_0x5c77('0x1f')]],'as':_0x291e1e['as'],'attributes':_0x291e1e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c77('0x10')](function(_0x45893c){logger['info'](_0x5c77('0x22'),_0x26d69e);logger[_0x5c77('0x13')](_0x5c77('0x22'),_0x26d69e,JSON[_0x5c77('0x15')](_0x45893c));_0x109524(_0x45893c);})[_0x5c77('0x23')](function(_0x5ef3fd){logger[_0x5c77('0x16')](_0x5c77('0x22'),_0x5ef3fd[_0x5c77('0x18')],_0x26d69e);_0x131f39(_0x28eb2d['error'](0x1f4,_0x5ef3fd['message']));});});};exports[_0x5c77('0x24')]=function(_0x4d7b77){var _0x170e21=this;return new Promise(function(_0x2f0a87,_0x2a3454){return db['SmsQueue'][_0x5c77('0x25')]({'raw':_0x4d7b77[_0x5c77('0x1c')]?_0x4d7b77[_0x5c77('0x1c')][_0x5c77('0x26')]===undefined?!![]:![]:!![],'where':_0x4d7b77['options']?_0x4d7b77[_0x5c77('0x1c')][_0x5c77('0x1d')]||null:null,'attributes':_0x4d7b77[_0x5c77('0x1c')]?_0x4d7b77[_0x5c77('0x1c')][_0x5c77('0x20')]||null:null,'include':_0x4d7b77['options']?_0x4d7b77[_0x5c77('0x1c')][_0x5c77('0x1e')]?_[_0x5c77('0x21')](_0x4d7b77[_0x5c77('0x1c')][_0x5c77('0x1e')],function(_0x4324d5){return{'model':db[_0x4324d5['model']],'as':_0x4324d5['as'],'attributes':_0x4324d5['attributes'],'include':_0x4324d5[_0x5c77('0x1e')]?_[_0x5c77('0x21')](_0x4324d5[_0x5c77('0x1e')],function(_0x54896d){return{'model':db[_0x54896d['model']],'as':_0x54896d['as'],'attributes':_0x54896d['attributes'],'include':_0x54896d[_0x5c77('0x1e')]?_['map'](_0x54896d[_0x5c77('0x1e')],function(_0x3db7fa){return{'model':db[_0x3db7fa[_0x5c77('0x1f')]],'as':_0x3db7fa['as'],'attributes':_0x3db7fa[_0x5c77('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5c77('0x10')](function(_0x32bf6e){logger[_0x5c77('0x19')](_0x5c77('0x24'),_0x4d7b77);logger[_0x5c77('0x13')](_0x5c77('0x24'),_0x4d7b77,JSON[_0x5c77('0x15')](_0x32bf6e));_0x2f0a87(_0x32bf6e);})[_0x5c77('0x23')](function(_0x4d4b6a){logger[_0x5c77('0x16')](_0x5c77('0x24'),_0x4d4b6a['message'],_0x4d7b77);_0x2a3454(_0x170e21[_0x5c77('0x16')](0x1f4,_0x4d4b6a[_0x5c77('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 8cce403..b5e3dee 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 _0x9755=['smsQueue:','./smsQueue.events','save','emit','register','length'];(function(_0x5753e1,_0x585f12){var _0x4ccc7a=function(_0x1f0975){while(--_0x1f0975){_0x5753e1['push'](_0x5753e1['shift']());}};_0x4ccc7a(++_0x585f12);}(_0x9755,0x1e7));var _0x5975=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x9755[_0x1f3aec];return _0x409f0d;};'use strict';var SmsQueueEvents=require(_0x5975('0x0'));var events=[_0x5975('0x1'),'remove','update'];function createListener(_0xae1bbf,_0x3029eb){return function(_0x1f8fb0){_0x3029eb[_0x5975('0x2')](_0xae1bbf,_0x1f8fb0);};}function removeListener(_0x48a5e7,_0x7f37c2){return function(){SmsQueueEvents['removeListener'](_0x48a5e7,_0x7f37c2);};}exports[_0x5975('0x3')]=function(_0x4d4648){for(var _0x58cf08=0x0,_0x5c5ef9=events[_0x5975('0x4')];_0x58cf08<_0x5c5ef9;_0x58cf08++){var _0x1aed74=events[_0x58cf08];var _0x1f71a1=createListener(_0x5975('0x5')+_0x1aed74,_0x4d4648);SmsQueueEvents['on'](_0x1aed74,_0x1f71a1);}}; \ No newline at end of file +var _0x4a42=['update','removeListener','register','length','./smsQueue.events','remove'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x4a42,0x10c));var _0x24a4=function(_0x1b7dcb,_0x384c62){_0x1b7dcb=_0x1b7dcb-0x0;var _0x5ee56c=_0x4a42[_0x1b7dcb];return _0x5ee56c;};'use strict';var SmsQueueEvents=require(_0x24a4('0x0'));var events=['save',_0x24a4('0x1'),_0x24a4('0x2')];function createListener(_0x4e264c,_0x1e7e30){return function(_0x2df252){_0x1e7e30['emit'](_0x4e264c,_0x2df252);};}function removeListener(_0x153cb3,_0x20fe52){return function(){SmsQueueEvents[_0x24a4('0x3')](_0x153cb3,_0x20fe52);};}exports[_0x24a4('0x4')]=function(_0xbdde61){for(var _0x45594b=0x0,_0x1248f1=events[_0x24a4('0x5')];_0x45594b<_0x1248f1;_0x45594b++){var _0x253680=events[_0x45594b];var _0x5341ae=createListener('smsQueue:'+_0x253680,_0xbdde61);SmsQueueEvents['on'](_0x253680,_0x5341ae);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5eba7a8..4cf16ed 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 _0xb39f=['isAuthenticated','index','get','/describe','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./smsQueueReport.controller'];(function(_0x5794e8,_0x3ed2ff){var _0x382ffb=function(_0x25e51f){while(--_0x25e51f){_0x5794e8['push'](_0x5794e8['shift']());}};_0x382ffb(++_0x3ed2ff);}(_0xb39f,0x1e6));var _0xfb39=function(_0x23b37b,_0x35ab0d){_0x23b37b=_0x23b37b-0x0;var _0x186627=_0xb39f[_0x23b37b];return _0x186627;};'use strict';var multer=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var path=require(_0xfb39('0x2'));var timeout=require(_0xfb39('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb39('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfb39('0x5'));var controller=require(_0xfb39('0x6'));router['get']('/',auth[_0xfb39('0x7')](),controller[_0xfb39('0x8')]);router[_0xfb39('0x9')](_0xfb39('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xfb39('0x9')](_0xfb39('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfb39('0x7')](),controller[_0xfb39('0xc')]);router[_0xfb39('0xd')](_0xfb39('0xb'),auth[_0xfb39('0x7')](),controller['update']);router[_0xfb39('0xe')](_0xfb39('0xb'),auth[_0xfb39('0x7')](),controller[_0xfb39('0xf')]);module[_0xfb39('0x10')]=router; \ No newline at end of file +var _0xb714=['post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x34f6e4,_0x4b8c1a){var _0x15d736=function(_0xceb2b5){while(--_0xceb2b5){_0x34f6e4['push'](_0x34f6e4['shift']());}};_0x15d736(++_0x4b8c1a);}(_0xb714,0x196));var _0x4b71=function(_0x38bf74,_0x1164bd){_0x38bf74=_0x38bf74-0x0;var _0x414e5b=_0xb714[_0x38bf74];return _0x414e5b;};'use strict';var multer=require(_0x4b71('0x0'));var util=require(_0x4b71('0x1'));var path=require(_0x4b71('0x2'));var timeout=require(_0x4b71('0x3'));var express=require('express');var router=express[_0x4b71('0x4')]();var fs_extra=require(_0x4b71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4b71('0x6'));var config=require(_0x4b71('0x7'));var controller=require('./smsQueueReport.controller');router[_0x4b71('0x8')]('/',auth[_0x4b71('0x9')](),controller[_0x4b71('0xa')]);router['get'](_0x4b71('0xb'),auth[_0x4b71('0x9')](),controller['describe']);router[_0x4b71('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4b71('0xc')]('/',auth[_0x4b71('0x9')](),controller[_0x4b71('0xd')]);router[_0x4b71('0xe')](_0x4b71('0xf'),auth[_0x4b71('0x9')](),controller['update']);router[_0x4b71('0x10')](_0x4b71('0xf'),auth['isAuthenticated'](),controller[_0x4b71('0x11')]);module[_0x4b71('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 69ffbf9..1eaae4b 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 _0x9206=['STRING','DATE','moment','exports'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x9206,0x1ba));var _0x6920=function(_0x2a58a3,_0x1d71a1){_0x2a58a3=_0x2a58a3-0x0;var _0x19f203=_0x9206[_0x2a58a3];return _0x19f203;};'use strict';var moment=require(_0x6920('0x0'));var Sequelize=require('sequelize');module[_0x6920('0x1')]={'uniqueid':{'type':Sequelize[_0x6920('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6920('0x2')]},'joinAt':{'type':Sequelize[_0x6920('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6920('0x3')]},'exitAt':{'type':Sequelize[_0x6920('0x3')]},'reason':{'type':Sequelize[_0x6920('0x2')]}}; \ No newline at end of file +var _0x37b1=['moment','STRING','DATE'];(function(_0x7befab,_0x5435cc){var _0x499368=function(_0x4f53b8){while(--_0x4f53b8){_0x7befab['push'](_0x7befab['shift']());}};_0x499368(++_0x5435cc);}(_0x37b1,0x10b));var _0x137b=function(_0x3d627d,_0x1c4b6e){_0x3d627d=_0x3d627d-0x0;var _0x39aa67=_0x37b1[_0x3d627d];return _0x39aa67;};'use strict';var moment=require(_0x137b('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x137b('0x1')]},'joinAt':{'type':Sequelize[_0x137b('0x2')]},'leaveAt':{'type':Sequelize[_0x137b('0x2')]},'acceptAt':{'type':Sequelize[_0x137b('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index e13e7c1..f64cd17 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 _0x8945=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x3a340f,_0x18653e){var _0x14ca55=function(_0x2e2fd6){while(--_0x2e2fd6){_0x3a340f['push'](_0x3a340f['shift']());}};_0x14ca55(++_0x18653e);}(_0x8945,0x132));var _0x5894=function(_0x5201af,_0x2fb0bc){_0x5201af=_0x5201af-0x0;var _0x2d9b34=_0x8945[_0x5201af];return _0x2d9b34;};'use strict';var emlformat=require(_0x5894('0x0'));var rimraf=require(_0x5894('0x1'));var zipdir=require(_0x5894('0x2'));var jsonpatch=require(_0x5894('0x3'));var rp=require(_0x5894('0x4'));var moment=require(_0x5894('0x5'));var BPromise=require(_0x5894('0x6'));var Mustache=require(_0x5894('0x7'));var util=require(_0x5894('0x8'));var path=require(_0x5894('0x9'));var sox=require(_0x5894('0xa'));var csv=require('to-csv');var ejs=require(_0x5894('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5894('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5894('0xd'));var toCsv=require(_0x5894('0xe'));var querystring=require(_0x5894('0xf'));var Papa=require(_0x5894('0x10'));var Redis=require(_0x5894('0x11'));var authService=require(_0x5894('0x12'));var qs=require(_0x5894('0x13'));var as=require(_0x5894('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5894('0x15'))(_0x5894('0x16'));var utils=require(_0x5894('0x17'));var config=require(_0x5894('0x18'));var licenseUtil=require(_0x5894('0x19'));var db=require(_0x5894('0x1a'))['db'];function respondWithStatusCode(_0x5d2f76,_0x5887f9){_0x5887f9=_0x5887f9||0xcc;return function(_0x5daa1b){if(_0x5daa1b){return _0x5d2f76[_0x5894('0x1b')](_0x5887f9);}return _0x5d2f76[_0x5894('0x1c')](_0x5887f9)['end']();};}function respondWithResult(_0x51ffd0,_0x58d024){_0x58d024=_0x58d024||0xc8;return function(_0x576325){if(_0x576325){return _0x51ffd0[_0x5894('0x1c')](_0x58d024)[_0x5894('0x1d')](_0x576325);}};}function respondWithFilteredResult(_0x2f7b76,_0x53d369){return function(_0x5bfbc8){if(_0x5bfbc8){var _0x47e69e=typeof _0x53d369[_0x5894('0x1e')]===_0x5894('0x1f')&&typeof _0x53d369[_0x5894('0x20')]===_0x5894('0x1f');var _0x13479a=_0x5bfbc8['count'];var _0x3a160a=_0x47e69e?0x0:_0x53d369[_0x5894('0x1e')];var _0x16b367=_0x47e69e?_0x5bfbc8['count']:_0x53d369['offset']+_0x53d369[_0x5894('0x20')];var _0x3ab1ec;if(_0x16b367>=_0x13479a){_0x16b367=_0x13479a;_0x3ab1ec=0xc8;}else{_0x3ab1ec=0xce;}_0x2f7b76[_0x5894('0x1c')](_0x3ab1ec);return _0x2f7b76['set'](_0x5894('0x21'),_0x3a160a+'-'+_0x16b367+'/'+_0x13479a)[_0x5894('0x1d')](_0x5bfbc8);}return null;};}function patchUpdates(_0x2272d0){return function(_0xc6c891){try{jsonpatch[_0x5894('0x22')](_0xc6c891,_0x2272d0,!![]);}catch(_0x26fbb2){return BPromise[_0x5894('0x23')](_0x26fbb2);}return _0xc6c891[_0x5894('0x24')]();};}function saveUpdates(_0x7e85e0,_0x28643f){return function(_0x2094c3){if(_0x2094c3){return _0x2094c3['update'](_0x7e85e0)[_0x5894('0x25')](function(_0x5d87f4){return _0x5d87f4;});}return null;};}function removeEntity(_0x210eb4,_0x3c8c6d){return function(_0x4440d2){if(_0x4440d2){return _0x4440d2[_0x5894('0x26')]()[_0x5894('0x25')](function(){_0x210eb4['status'](0xcc)[_0x5894('0x27')]();});}};}function handleEntityNotFound(_0x523a9c,_0x33625b){return function(_0x366295){if(!_0x366295){_0x523a9c['sendStatus'](0x194);}return _0x366295;};}function handleError(_0x19cec5,_0x410259){_0x410259=_0x410259||0x1f4;return function(_0x4f820c){logger['error'](_0x4f820c[_0x5894('0x28')]);if(_0x4f820c[_0x5894('0x29')]){delete _0x4f820c[_0x5894('0x29')];}_0x19cec5[_0x5894('0x1c')](_0x410259)[_0x5894('0x2a')](_0x4f820c);};}exports[_0x5894('0x2b')]=function(_0x645c85,_0x32a55d){var _0x55411c={},_0x39f298={},_0x16b931={'count':0x0,'rows':[]};var _0x465fe1=_[_0x5894('0x2c')](db[_0x5894('0x2d')][_0x5894('0x2e')],function(_0x36a3df){return{'name':_0x36a3df[_0x5894('0x2f')],'type':_0x36a3df[_0x5894('0x30')][_0x5894('0x31')]};});_0x39f298[_0x5894('0x32')]=_[_0x5894('0x2c')](_0x465fe1,'name');_0x39f298[_0x5894('0x33')]=_[_0x5894('0x34')](_0x645c85['query']);_0x39f298[_0x5894('0x35')]=_[_0x5894('0x36')](_0x39f298[_0x5894('0x32')],_0x39f298[_0x5894('0x33')]);_0x55411c[_0x5894('0x37')]=_[_0x5894('0x36')](_0x39f298[_0x5894('0x32')],qs[_0x5894('0x38')](_0x645c85[_0x5894('0x33')]['fields']));_0x55411c[_0x5894('0x37')]=_0x55411c['attributes'][_0x5894('0x39')]?_0x55411c[_0x5894('0x37')]:_0x39f298[_0x5894('0x32')];if(!_0x645c85['query']['hasOwnProperty'](_0x5894('0x3a'))){_0x55411c['limit']=qs[_0x5894('0x20')](_0x645c85['query'][_0x5894('0x20')]);_0x55411c[_0x5894('0x1e')]=qs[_0x5894('0x1e')](_0x645c85[_0x5894('0x33')][_0x5894('0x1e')]);}_0x55411c['order']=qs[_0x5894('0x3b')](_0x645c85[_0x5894('0x33')]['sort']);_0x55411c[_0x5894('0x3c')]=qs['filters'](_['pick'](_0x645c85[_0x5894('0x33')],_0x39f298[_0x5894('0x35')]),_0x465fe1);if(_0x645c85[_0x5894('0x33')][_0x5894('0x3d')]){_0x55411c[_0x5894('0x3c')]=_[_0x5894('0x3e')](_0x55411c[_0x5894('0x3c')],{'$or':_[_0x5894('0x2c')](_0x465fe1,function(_0x10defd){if(_0x10defd[_0x5894('0x30')]!==_0x5894('0x3f')){var _0x91171f={};_0x91171f[_0x10defd['name']]={'$like':'%'+_0x645c85[_0x5894('0x33')][_0x5894('0x3d')]+'%'};return _0x91171f;}})});}_0x55411c=_[_0x5894('0x3e')]({},_0x55411c,_0x645c85[_0x5894('0x40')]);var _0x2c04d9={'where':_0x55411c['where']};return db['SmsQueueReport'][_0x5894('0x41')](_0x2c04d9)['then'](function(_0x5e81b7){_0x16b931[_0x5894('0x41')]=_0x5e81b7;if(_0x645c85[_0x5894('0x33')]['includeAll']){_0x55411c[_0x5894('0x42')]=[{'all':!![]}];}return db[_0x5894('0x2d')][_0x5894('0x43')](_0x55411c);})[_0x5894('0x25')](function(_0x249c97){_0x16b931[_0x5894('0x44')]=_0x249c97;return _0x16b931;})[_0x5894('0x25')](respondWithFilteredResult(_0x32a55d,_0x55411c))[_0x5894('0x45')](handleError(_0x32a55d,null));};exports[_0x5894('0x46')]=function(_0x429bac,_0x13a96d){var _0x311a3c={'raw':!![],'where':{'id':_0x429bac[_0x5894('0x47')]['id']}},_0xbfa2bf={};_0xbfa2bf['model']=_['keys'](db[_0x5894('0x2d')][_0x5894('0x2e')]);_0xbfa2bf[_0x5894('0x33')]=_[_0x5894('0x34')](_0x429bac[_0x5894('0x33')]);_0xbfa2bf['filters']=_[_0x5894('0x36')](_0xbfa2bf['model'],_0xbfa2bf[_0x5894('0x33')]);_0x311a3c[_0x5894('0x37')]=_[_0x5894('0x36')](_0xbfa2bf[_0x5894('0x32')],qs[_0x5894('0x38')](_0x429bac[_0x5894('0x33')][_0x5894('0x38')]));_0x311a3c[_0x5894('0x37')]=_0x311a3c[_0x5894('0x37')][_0x5894('0x39')]?_0x311a3c[_0x5894('0x37')]:_0xbfa2bf[_0x5894('0x32')];if(_0x429bac[_0x5894('0x33')][_0x5894('0x48')]){_0x311a3c['include']=[{'all':!![]}];}_0x311a3c=_[_0x5894('0x3e')]({},_0x311a3c,_0x429bac[_0x5894('0x40')]);return db[_0x5894('0x2d')][_0x5894('0x49')](_0x311a3c)['then'](handleEntityNotFound(_0x13a96d,null))[_0x5894('0x25')](respondWithResult(_0x13a96d,null))[_0x5894('0x45')](handleError(_0x13a96d,null));};exports['create']=function(_0x2b2b32,_0xcc055c){return db[_0x5894('0x2d')][_0x5894('0x4a')](_0x2b2b32[_0x5894('0x4b')],{})['then'](respondWithResult(_0xcc055c,0xc9))[_0x5894('0x45')](handleError(_0xcc055c,null));};exports['update']=function(_0x30e671,_0x1c8754){if(_0x30e671['body']['id']){delete _0x30e671[_0x5894('0x4b')]['id'];}return db[_0x5894('0x2d')][_0x5894('0x49')]({'where':{'id':_0x30e671[_0x5894('0x47')]['id']}})[_0x5894('0x25')](handleEntityNotFound(_0x1c8754,null))[_0x5894('0x25')](saveUpdates(_0x30e671[_0x5894('0x4b')],null))['then'](respondWithResult(_0x1c8754,null))[_0x5894('0x45')](handleError(_0x1c8754,null));};exports[_0x5894('0x26')]=function(_0x27c8e8,_0xb19d){return db[_0x5894('0x2d')][_0x5894('0x49')]({'where':{'id':_0x27c8e8[_0x5894('0x47')]['id']}})[_0x5894('0x25')](handleEntityNotFound(_0xb19d,null))[_0x5894('0x25')](removeEntity(_0xb19d,null))['catch'](handleError(_0xb19d,null));};exports['describe']=function(_0xa31d52,_0x138bf2){return db[_0x5894('0x2d')]['describe']()[_0x5894('0x25')](respondWithResult(_0x138bf2,null))[_0x5894('0x45')](handleError(_0x138bf2,null));}; \ No newline at end of file +var _0x0b5f=['show','params','length','includeAll','options','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','findAll','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b5f,0xf1));var _0xf0b5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0b5f[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xf0b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0b5('0x1'));var jsonpatch=require(_0xf0b5('0x2'));var rp=require(_0xf0b5('0x3'));var moment=require('moment');var BPromise=require(_0xf0b5('0x4'));var Mustache=require(_0xf0b5('0x5'));var util=require(_0xf0b5('0x6'));var path=require(_0xf0b5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0b5('0x8'));var fs=require('fs');var fs_extra=require(_0xf0b5('0x9'));var _=require(_0xf0b5('0xa'));var squel=require(_0xf0b5('0xb'));var crypto=require('crypto');var jsforce=require(_0xf0b5('0xc'));var deskjs=require(_0xf0b5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0b5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf0b5('0xf'));var as=require(_0xf0b5('0x10'));var hardwareService=require(_0xf0b5('0x11'));var logger=require(_0xf0b5('0x12'))(_0xf0b5('0x13'));var utils=require(_0xf0b5('0x14'));var config=require(_0xf0b5('0x15'));var licenseUtil=require(_0xf0b5('0x16'));var db=require(_0xf0b5('0x17'))['db'];function respondWithStatusCode(_0x36e303,_0x488f62){_0x488f62=_0x488f62||0xcc;return function(_0x34d51a){if(_0x34d51a){return _0x36e303['sendStatus'](_0x488f62);}return _0x36e303[_0xf0b5('0x18')](_0x488f62)['end']();};}function respondWithResult(_0x182545,_0x167d04){_0x167d04=_0x167d04||0xc8;return function(_0x501801){if(_0x501801){return _0x182545[_0xf0b5('0x18')](_0x167d04)[_0xf0b5('0x19')](_0x501801);}};}function respondWithFilteredResult(_0x4dfe9c,_0x1fdc40){return function(_0x3e400a){if(_0x3e400a){var _0x119981=typeof _0x1fdc40[_0xf0b5('0x1a')]===_0xf0b5('0x1b')&&typeof _0x1fdc40[_0xf0b5('0x1c')]===_0xf0b5('0x1b');var _0x12b15d=_0x3e400a[_0xf0b5('0x1d')];var _0x3bb645=_0x119981?0x0:_0x1fdc40[_0xf0b5('0x1a')];var _0x532781=_0x119981?_0x3e400a[_0xf0b5('0x1d')]:_0x1fdc40[_0xf0b5('0x1a')]+_0x1fdc40[_0xf0b5('0x1c')];var _0x65830e;if(_0x532781>=_0x12b15d){_0x532781=_0x12b15d;_0x65830e=0xc8;}else{_0x65830e=0xce;}_0x4dfe9c['status'](_0x65830e);return _0x4dfe9c[_0xf0b5('0x1e')](_0xf0b5('0x1f'),_0x3bb645+'-'+_0x532781+'/'+_0x12b15d)['json'](_0x3e400a);}return null;};}function patchUpdates(_0x238632){return function(_0x342b0d){try{jsonpatch[_0xf0b5('0x20')](_0x342b0d,_0x238632,!![]);}catch(_0x20b5c2){return BPromise[_0xf0b5('0x21')](_0x20b5c2);}return _0x342b0d[_0xf0b5('0x22')]();};}function saveUpdates(_0xc005c9,_0x2c2443){return function(_0x57f407){if(_0x57f407){return _0x57f407['update'](_0xc005c9)[_0xf0b5('0x23')](function(_0xd82da2){return _0xd82da2;});}return null;};}function removeEntity(_0xa894f0,_0x3c09e1){return function(_0x2ebfdd){if(_0x2ebfdd){return _0x2ebfdd[_0xf0b5('0x24')]()[_0xf0b5('0x23')](function(){_0xa894f0[_0xf0b5('0x18')](0xcc)[_0xf0b5('0x25')]();});}};}function handleEntityNotFound(_0x234d52,_0x25eb39){return function(_0x2a23f0){if(!_0x2a23f0){_0x234d52[_0xf0b5('0x26')](0x194);}return _0x2a23f0;};}function handleError(_0x50e61c,_0x456e3a){_0x456e3a=_0x456e3a||0x1f4;return function(_0x16cefa){logger[_0xf0b5('0x27')](_0x16cefa[_0xf0b5('0x28')]);if(_0x16cefa[_0xf0b5('0x29')]){delete _0x16cefa[_0xf0b5('0x29')];}_0x50e61c[_0xf0b5('0x18')](_0x456e3a)['send'](_0x16cefa);};}exports[_0xf0b5('0x2a')]=function(_0xaa8eba,_0x486f56){var _0x2a66b6={},_0x1c451b={},_0x3b9182={'count':0x0,'rows':[]};var _0x2afab2=_[_0xf0b5('0x2b')](db[_0xf0b5('0x2c')][_0xf0b5('0x2d')],function(_0x26fcc4){return{'name':_0x26fcc4[_0xf0b5('0x2e')],'type':_0x26fcc4[_0xf0b5('0x2f')][_0xf0b5('0x30')]};});_0x1c451b[_0xf0b5('0x31')]=_[_0xf0b5('0x2b')](_0x2afab2,_0xf0b5('0x29'));_0x1c451b[_0xf0b5('0x32')]=_[_0xf0b5('0x33')](_0xaa8eba['query']);_0x1c451b[_0xf0b5('0x34')]=_['intersection'](_0x1c451b[_0xf0b5('0x31')],_0x1c451b[_0xf0b5('0x32')]);_0x2a66b6['attributes']=_[_0xf0b5('0x35')](_0x1c451b['model'],qs['fields'](_0xaa8eba[_0xf0b5('0x32')][_0xf0b5('0x36')]));_0x2a66b6[_0xf0b5('0x37')]=_0x2a66b6['attributes']['length']?_0x2a66b6[_0xf0b5('0x37')]:_0x1c451b[_0xf0b5('0x31')];if(!_0xaa8eba['query'][_0xf0b5('0x38')](_0xf0b5('0x39'))){_0x2a66b6['limit']=qs[_0xf0b5('0x1c')](_0xaa8eba[_0xf0b5('0x32')]['limit']);_0x2a66b6[_0xf0b5('0x1a')]=qs[_0xf0b5('0x1a')](_0xaa8eba[_0xf0b5('0x32')][_0xf0b5('0x1a')]);}_0x2a66b6[_0xf0b5('0x3a')]=qs[_0xf0b5('0x3b')](_0xaa8eba[_0xf0b5('0x32')][_0xf0b5('0x3b')]);_0x2a66b6[_0xf0b5('0x3c')]=qs['filters'](_[_0xf0b5('0x3d')](_0xaa8eba[_0xf0b5('0x32')],_0x1c451b[_0xf0b5('0x34')]),_0x2afab2);if(_0xaa8eba[_0xf0b5('0x32')]['filter']){_0x2a66b6[_0xf0b5('0x3c')]=_[_0xf0b5('0x3e')](_0x2a66b6[_0xf0b5('0x3c')],{'$or':_['map'](_0x2afab2,function(_0x5c2752){if(_0x5c2752[_0xf0b5('0x2f')]!=='VIRTUAL'){var _0x198278={};_0x198278[_0x5c2752[_0xf0b5('0x29')]]={'$like':'%'+_0xaa8eba[_0xf0b5('0x32')][_0xf0b5('0x3f')]+'%'};return _0x198278;}})});}_0x2a66b6=_[_0xf0b5('0x3e')]({},_0x2a66b6,_0xaa8eba['options']);var _0x108383={'where':_0x2a66b6['where']};return db['SmsQueueReport'][_0xf0b5('0x1d')](_0x108383)[_0xf0b5('0x23')](function(_0x15c71a){_0x3b9182[_0xf0b5('0x1d')]=_0x15c71a;if(_0xaa8eba['query']['includeAll']){_0x2a66b6[_0xf0b5('0x40')]=[{'all':!![]}];}return db[_0xf0b5('0x2c')][_0xf0b5('0x41')](_0x2a66b6);})['then'](function(_0x4e66e7){_0x3b9182['rows']=_0x4e66e7;return _0x3b9182;})[_0xf0b5('0x23')](respondWithFilteredResult(_0x486f56,_0x2a66b6))[_0xf0b5('0x42')](handleError(_0x486f56,null));};exports[_0xf0b5('0x43')]=function(_0x5657aa,_0xb88a62){var _0x4f6c9b={'raw':!![],'where':{'id':_0x5657aa[_0xf0b5('0x44')]['id']}},_0x65d83e={};_0x65d83e['model']=_['keys'](db[_0xf0b5('0x2c')][_0xf0b5('0x2d')]);_0x65d83e[_0xf0b5('0x32')]=_['keys'](_0x5657aa[_0xf0b5('0x32')]);_0x65d83e['filters']=_['intersection'](_0x65d83e[_0xf0b5('0x31')],_0x65d83e['query']);_0x4f6c9b[_0xf0b5('0x37')]=_['intersection'](_0x65d83e[_0xf0b5('0x31')],qs[_0xf0b5('0x36')](_0x5657aa['query'][_0xf0b5('0x36')]));_0x4f6c9b[_0xf0b5('0x37')]=_0x4f6c9b[_0xf0b5('0x37')][_0xf0b5('0x45')]?_0x4f6c9b[_0xf0b5('0x37')]:_0x65d83e['model'];if(_0x5657aa['query'][_0xf0b5('0x46')]){_0x4f6c9b[_0xf0b5('0x40')]=[{'all':!![]}];}_0x4f6c9b=_[_0xf0b5('0x3e')]({},_0x4f6c9b,_0x5657aa[_0xf0b5('0x47')]);return db[_0xf0b5('0x2c')][_0xf0b5('0x48')](_0x4f6c9b)[_0xf0b5('0x23')](handleEntityNotFound(_0xb88a62,null))[_0xf0b5('0x23')](respondWithResult(_0xb88a62,null))[_0xf0b5('0x42')](handleError(_0xb88a62,null));};exports['create']=function(_0x1a0397,_0x1e9b77){return db['SmsQueueReport'][_0xf0b5('0x49')](_0x1a0397['body'],{})[_0xf0b5('0x23')](respondWithResult(_0x1e9b77,0xc9))['catch'](handleError(_0x1e9b77,null));};exports[_0xf0b5('0x4a')]=function(_0x518b10,_0x536aa9){if(_0x518b10[_0xf0b5('0x4b')]['id']){delete _0x518b10[_0xf0b5('0x4b')]['id'];}return db[_0xf0b5('0x2c')][_0xf0b5('0x48')]({'where':{'id':_0x518b10['params']['id']}})[_0xf0b5('0x23')](handleEntityNotFound(_0x536aa9,null))[_0xf0b5('0x23')](saveUpdates(_0x518b10[_0xf0b5('0x4b')],null))['then'](respondWithResult(_0x536aa9,null))[_0xf0b5('0x42')](handleError(_0x536aa9,null));};exports[_0xf0b5('0x24')]=function(_0x1e6db4,_0x3ff2ed){return db[_0xf0b5('0x2c')][_0xf0b5('0x48')]({'where':{'id':_0x1e6db4['params']['id']}})['then'](handleEntityNotFound(_0x3ff2ed,null))[_0xf0b5('0x23')](removeEntity(_0x3ff2ed,null))[_0xf0b5('0x42')](handleError(_0x3ff2ed,null));};exports['describe']=function(_0x366c5c,_0x3302fb){return db[_0xf0b5('0x2c')][_0xf0b5('0x4c')]()[_0xf0b5('0x23')](respondWithResult(_0x3302fb,null))[_0xf0b5('0x42')](handleError(_0x3302fb,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 2a77dfc..b05d41a 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39f353,_0x19847f){var _0x19b66e=function(_0x4e9d8b){while(--_0x4e9d8b){_0x39f353['push'](_0x39f353['shift']());}};_0x19b66e(++_0x19847f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x58fe63,_0xf6ae1a){var _0x8264c9=function(_0x3d07ef){while(--_0x3d07ef){_0x58fe63['push'](_0x58fe63['shift']());}};_0x8264c9(++_0xf6ae1a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0xcb91[_0x5302fb];return _0x43e6a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 2176bdf..e059b75 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 _0xc41b=['rpc','../../config/environment','jayson/promise','client','http','request','then','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e3bde,_0xba9c2a){var _0x2d3631=function(_0x2e6ead){while(--_0x2e6ead){_0x1e3bde['push'](_0x1e3bde['shift']());}};_0x2d3631(++_0xba9c2a);}(_0xc41b,0xed));var _0xbc41=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc41b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xbc41('0x0'));var util=require(_0xbc41('0x1'));var moment=require('moment');var BPromise=require(_0xbc41('0x2'));var rs=require(_0xbc41('0x3'));var fs=require('fs');var Redis=require(_0xbc41('0x4'));var db=require(_0xbc41('0x5'))['db'];var utils=require(_0xbc41('0x6'));var logger=require(_0xbc41('0x7'))(_0xbc41('0x8'));var config=require(_0xbc41('0x9'));var jayson=require(_0xbc41('0xa'));var client=jayson[_0xbc41('0xb')][_0xbc41('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172dca,_0xe9ea8f,_0x449541){return new BPromise(function(_0x25625a,_0x15a3a1){return client[_0xbc41('0xd')](_0x172dca,_0x449541)[_0xbc41('0xe')](function(_0x1f2f04){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0xe9ea8f,'request\x20sent');logger[_0xbc41('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xe9ea8f,'request\x20sent',JSON[_0xbc41('0x10')](_0x1f2f04));if(_0x1f2f04[_0xbc41('0x11')]){if(_0x1f2f04['error'][_0xbc41('0x12')]===0x1f4){logger[_0xbc41('0x11')](_0xbc41('0x13'),_0xe9ea8f,_0x1f2f04[_0xbc41('0x11')]['message']);return _0x15a3a1(_0x1f2f04[_0xbc41('0x11')]['message']);}logger[_0xbc41('0x11')](_0xbc41('0x13'),_0xe9ea8f,_0x1f2f04[_0xbc41('0x11')][_0xbc41('0x14')]);return _0x25625a(_0x1f2f04[_0xbc41('0x11')][_0xbc41('0x14')]);}else{logger[_0xbc41('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0xe9ea8f,_0xbc41('0x16'));_0x25625a(_0x1f2f04[_0xbc41('0x17')][_0xbc41('0x14')]);}})[_0xbc41('0x18')](function(_0x202257){logger[_0xbc41('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0xe9ea8f,_0x202257);_0x15a3a1(_0x202257);});});}exports[_0xbc41('0x19')]=function(_0x41f7e9){var _0x2b07fc=this;return new Promise(function(_0x23cfc8,_0x1ef44c){return db[_0xbc41('0x1a')][_0xbc41('0x1b')](_0x41f7e9[_0xbc41('0x1c')],{'raw':_0x41f7e9[_0xbc41('0x1d')]?_0x41f7e9[_0xbc41('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x489449){logger[_0xbc41('0x15')](_0xbc41('0x19'),_0x41f7e9);logger[_0xbc41('0xf')]('CreateSmsQueueReport',_0x41f7e9,JSON[_0xbc41('0x10')](_0x489449));_0x23cfc8(_0x489449);})['catch'](function(_0x5440a2){logger[_0xbc41('0x11')](_0xbc41('0x19'),_0x5440a2[_0xbc41('0x14')],_0x41f7e9);_0x1ef44c(_0x2b07fc[_0xbc41('0x11')](0x1f4,_0x5440a2['message']));});});};exports[_0xbc41('0x1e')]=function(_0x41b11d){var _0x34ea5b=this;return new Promise(function(_0x1b5ab6,_0x4ffd86){return db[_0xbc41('0x1a')]['update'](_0x41b11d[_0xbc41('0x1c')],{'raw':_0x41b11d[_0xbc41('0x1d')]?_0x41b11d[_0xbc41('0x1d')][_0xbc41('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41b11d[_0xbc41('0x1d')]?_0x41b11d['options'][_0xbc41('0x20')]||null:null,'attributes':_0x41b11d['options']?_0x41b11d[_0xbc41('0x1d')][_0xbc41('0x21')]||null:null,'limit':_0x41b11d['options']?_0x41b11d['options'][_0xbc41('0x22')]||null:null})[_0xbc41('0xe')](function(_0x1f4dec){logger['info'](_0xbc41('0x1e'),_0x41b11d);logger['debug'](_0xbc41('0x1e'),_0x41b11d,JSON['stringify'](_0x1f4dec));_0x1b5ab6(_0x1f4dec);})[_0xbc41('0x18')](function(_0x32d7f9){logger['error'](_0xbc41('0x1e'),_0x32d7f9[_0xbc41('0x14')],_0x41b11d);_0x4ffd86(_0x34ea5b['error'](0x1f4,_0x32d7f9[_0xbc41('0x14')]));});});}; \ No newline at end of file +var _0xaee1=['stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','update','where','UpdateSmsQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13015c,_0x4ebb51){var _0x30a9ac=function(_0x184a17){while(--_0x184a17){_0x13015c['push'](_0x13015c['shift']());}};_0x30a9ac(++_0x4ebb51);}(_0xaee1,0x144));var _0x1aee=function(_0x4613b0,_0x278b0a){_0x4613b0=_0x4613b0-0x0;var _0x4b811b=_0xaee1[_0x4613b0];return _0x4b811b;};'use strict';var _=require(_0x1aee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1aee('0x1'));var rs=require(_0x1aee('0x2'));var fs=require('fs');var Redis=require(_0x1aee('0x3'));var db=require(_0x1aee('0x4'))['db'];var utils=require(_0x1aee('0x5'));var logger=require(_0x1aee('0x6'))('rpc');var config=require(_0x1aee('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1aee('0x8')][_0x1aee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a985,_0x1b458f,_0x53a63){return new BPromise(function(_0xa3e0c,_0x1ac942){return client[_0x1aee('0xa')](_0x14a985,_0x53a63)[_0x1aee('0xb')](function(_0x1ad328){logger[_0x1aee('0xc')](_0x1aee('0xd'),_0x1b458f,'request\x20sent');logger[_0x1aee('0xe')](_0x1aee('0xf'),_0x1b458f,_0x1aee('0x10'),JSON[_0x1aee('0x11')](_0x1ad328));if(_0x1ad328['error']){if(_0x1ad328[_0x1aee('0x12')][_0x1aee('0x13')]===0x1f4){logger[_0x1aee('0x12')](_0x1aee('0xd'),_0x1b458f,_0x1ad328[_0x1aee('0x12')][_0x1aee('0x14')]);return _0x1ac942(_0x1ad328['error']['message']);}logger[_0x1aee('0x12')](_0x1aee('0xd'),_0x1b458f,_0x1ad328['error']['message']);return _0xa3e0c(_0x1ad328[_0x1aee('0x12')]['message']);}else{logger[_0x1aee('0xc')](_0x1aee('0xd'),_0x1b458f,_0x1aee('0x10'));_0xa3e0c(_0x1ad328[_0x1aee('0x15')][_0x1aee('0x14')]);}})[_0x1aee('0x16')](function(_0x64f74b){logger[_0x1aee('0x12')](_0x1aee('0xd'),_0x1b458f,_0x64f74b);_0x1ac942(_0x64f74b);});});}exports[_0x1aee('0x17')]=function(_0x6867c4){var _0x298640=this;return new Promise(function(_0x429e6b,_0x3e94d7){return db[_0x1aee('0x18')][_0x1aee('0x19')](_0x6867c4[_0x1aee('0x1a')],{'raw':_0x6867c4[_0x1aee('0x1b')]?_0x6867c4['options']['raw']===undefined?!![]:![]:!![]})[_0x1aee('0xb')](function(_0x245fa0){logger[_0x1aee('0xc')](_0x1aee('0x17'),_0x6867c4);logger[_0x1aee('0xe')]('CreateSmsQueueReport',_0x6867c4,JSON[_0x1aee('0x11')](_0x245fa0));_0x429e6b(_0x245fa0);})[_0x1aee('0x16')](function(_0x2e5d5c){logger[_0x1aee('0x12')](_0x1aee('0x17'),_0x2e5d5c[_0x1aee('0x14')],_0x6867c4);_0x3e94d7(_0x298640['error'](0x1f4,_0x2e5d5c[_0x1aee('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x5c0a26){var _0x1059c6=this;return new Promise(function(_0x347b27,_0x6667b){return db[_0x1aee('0x18')][_0x1aee('0x1c')](_0x5c0a26['body'],{'raw':_0x5c0a26[_0x1aee('0x1b')]?_0x5c0a26[_0x1aee('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0a26[_0x1aee('0x1b')]?_0x5c0a26['options'][_0x1aee('0x1d')]||null:null,'attributes':_0x5c0a26[_0x1aee('0x1b')]?_0x5c0a26[_0x1aee('0x1b')]['attributes']||null:null,'limit':_0x5c0a26['options']?_0x5c0a26[_0x1aee('0x1b')]['limit']||null:null})['then'](function(_0x2c6fa5){logger[_0x1aee('0xc')]('UpdateSmsQueueReport',_0x5c0a26);logger['debug'](_0x1aee('0x1e'),_0x5c0a26,JSON[_0x1aee('0x11')](_0x2c6fa5));_0x347b27(_0x2c6fa5);})[_0x1aee('0x16')](function(_0x80ac62){logger[_0x1aee('0x12')](_0x1aee('0x1e'),_0x80ac62[_0x1aee('0x14')],_0x5c0a26);_0x6667b(_0x1059c6[_0x1aee('0x12')](0x1f4,_0x80ac62[_0x1aee('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index d4eaed9..360b0eb 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 _0x3435=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','exports','multer','util'];(function(_0x506183,_0x4506ad){var _0x18e328=function(_0x4f44ac){while(--_0x4f44ac){_0x506183['push'](_0x506183['shift']());}};_0x18e328(++_0x4506ad);}(_0x3435,0xfa));var _0x5343=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3435[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5343('0x6'));var interaction=require(_0x5343('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x5343('0x8')]('/',auth[_0x5343('0x9')](),controller['index']);router['get'](_0x5343('0xa'),auth[_0x5343('0x9')](),controller[_0x5343('0xb')]);router[_0x5343('0x8')](_0x5343('0xc'),auth['isAuthenticated'](),controller[_0x5343('0xd')]);router['post']('/',auth[_0x5343('0x9')](),controller[_0x5343('0xe')]);router[_0x5343('0xf')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['update']);router[_0x5343('0x10')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['destroy']);module[_0x5343('0x11')]=router; \ No newline at end of file +var _0x207c=['/:id','show','post','isAuthenticated','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe'];(function(_0x39acf8,_0x158e5a){var _0x378ac3=function(_0x2f00e0){while(--_0x2f00e0){_0x39acf8['push'](_0x39acf8['shift']());}};_0x378ac3(++_0x158e5a);}(_0x207c,0x1e8));var _0xc207=function(_0x4ed7,_0x14f3ba){_0x4ed7=_0x4ed7-0x0;var _0x584b32=_0x207c[_0x4ed7];return _0x584b32;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0x9')](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0xd')]);router[_0xc207('0xe')]('/',auth[_0xc207('0xf')](),controller[_0xc207('0x10')]);router[_0xc207('0x11')](_0xc207('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0x12')]);module[_0xc207('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 7557026..49356db 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xb43b,0x1b2));var _0xbb43=function(_0x51f693,_0x402baa){_0x51f693=_0x51f693-0x0;var _0xfde759=_0xb43b[_0x51f693];return _0xfde759;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x10dcb8,_0x49ea5d){var _0x3b910b=function(_0x54789f){while(--_0x54789f){_0x10dcb8['push'](_0x10dcb8['shift']());}};_0x3b910b(++_0x49ea5d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x101ba2,_0x4091d5){_0x101ba2=_0x101ba2-0x0;var _0x4aa9c0=_0xf4eb[_0x101ba2];return _0x4aa9c0;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 34aae28..82694f0 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 _0x445b=['SmsTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','map'];(function(_0x539fa6,_0x37cc90){var _0x4f13b3=function(_0x3f0e95){while(--_0x3f0e95){_0x539fa6['push'](_0x539fa6['shift']());}};_0x4f13b3(++_0x37cc90);}(_0x445b,0x146));var _0xb445=function(_0x47af78,_0x3d012e){_0x47af78=_0x47af78-0x0;var _0x229cca=_0x445b[_0x47af78];return _0x229cca;};'use strict';var emlformat=require(_0xb445('0x0'));var rimraf=require(_0xb445('0x1'));var zipdir=require(_0xb445('0x2'));var jsonpatch=require(_0xb445('0x3'));var rp=require('request-promise');var moment=require(_0xb445('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb445('0x5'));var util=require(_0xb445('0x6'));var path=require(_0xb445('0x7'));var sox=require(_0xb445('0x8'));var csv=require(_0xb445('0x9'));var ejs=require(_0xb445('0xa'));var fs=require('fs');var fs_extra=require(_0xb445('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb445('0xc'));var jsforce=require(_0xb445('0xd'));var deskjs=require(_0xb445('0xe'));var toCsv=require(_0xb445('0x9'));var querystring=require(_0xb445('0xf'));var Papa=require(_0xb445('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb445('0x11'));var as=require(_0xb445('0x12'));var hardwareService=require(_0xb445('0x13'));var logger=require('../../config/logger')(_0xb445('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb445('0x15'))['db'];function respondWithStatusCode(_0x2eea07,_0xc2d2fe){_0xc2d2fe=_0xc2d2fe||0xcc;return function(_0x5398be){if(_0x5398be){return _0x2eea07[_0xb445('0x16')](_0xc2d2fe);}return _0x2eea07[_0xb445('0x17')](_0xc2d2fe)[_0xb445('0x18')]();};}function respondWithResult(_0x4a999e,_0x439289){_0x439289=_0x439289||0xc8;return function(_0x433d2f){if(_0x433d2f){return _0x4a999e['status'](_0x439289)[_0xb445('0x19')](_0x433d2f);}};}function respondWithFilteredResult(_0x38de46,_0x3b8a4b){return function(_0x32b00c){if(_0x32b00c){var _0x13e028=typeof _0x3b8a4b['offset']==='undefined'&&typeof _0x3b8a4b['limit']==='undefined';var _0x41bc9c=_0x32b00c['count'];var _0x3f2111=_0x13e028?0x0:_0x3b8a4b['offset'];var _0x20dd94=_0x13e028?_0x32b00c[_0xb445('0x1a')]:_0x3b8a4b[_0xb445('0x1b')]+_0x3b8a4b[_0xb445('0x1c')];var _0xa1d38d;if(_0x20dd94>=_0x41bc9c){_0x20dd94=_0x41bc9c;_0xa1d38d=0xc8;}else{_0xa1d38d=0xce;}_0x38de46[_0xb445('0x17')](_0xa1d38d);return _0x38de46[_0xb445('0x1d')](_0xb445('0x1e'),_0x3f2111+'-'+_0x20dd94+'/'+_0x41bc9c)[_0xb445('0x19')](_0x32b00c);}return null;};}function patchUpdates(_0x3cd94b){return function(_0xa0acbc){try{jsonpatch[_0xb445('0x1f')](_0xa0acbc,_0x3cd94b,!![]);}catch(_0x391fc9){return BPromise[_0xb445('0x20')](_0x391fc9);}return _0xa0acbc['save']();};}function saveUpdates(_0xb84a,_0xdf2576){return function(_0x107e43){if(_0x107e43){return _0x107e43['update'](_0xb84a)[_0xb445('0x21')](function(_0x51e644){return _0x51e644;});}return null;};}function removeEntity(_0x822f87,_0x5aa7cf){return function(_0x33a42a){if(_0x33a42a){return _0x33a42a[_0xb445('0x22')]()[_0xb445('0x21')](function(){_0x822f87[_0xb445('0x17')](0xcc)[_0xb445('0x18')]();});}};}function handleEntityNotFound(_0x5afd35,_0x52ff99){return function(_0x287794){if(!_0x287794){_0x5afd35[_0xb445('0x16')](0x194);}return _0x287794;};}function handleError(_0x38512d,_0x4d171c){_0x4d171c=_0x4d171c||0x1f4;return function(_0x148cf1){logger[_0xb445('0x23')](_0x148cf1[_0xb445('0x24')]);if(_0x148cf1[_0xb445('0x25')]){delete _0x148cf1[_0xb445('0x25')];}_0x38512d['status'](_0x4d171c)['send'](_0x148cf1);};}exports['index']=function(_0xd57289,_0x2f6bd9){var _0xc47bf7={},_0x43a334={},_0x123c24={'count':0x0,'rows':[]};var _0x4b0016=_[_0xb445('0x26')](db[_0xb445('0x27')][_0xb445('0x28')],function(_0x1cd143){return{'name':_0x1cd143[_0xb445('0x29')],'type':_0x1cd143['type'][_0xb445('0x2a')]};});_0x43a334[_0xb445('0x2b')]=_['map'](_0x4b0016,_0xb445('0x25'));_0x43a334['query']=_[_0xb445('0x2c')](_0xd57289[_0xb445('0x2d')]);_0x43a334[_0xb445('0x2e')]=_[_0xb445('0x2f')](_0x43a334[_0xb445('0x2b')],_0x43a334[_0xb445('0x2d')]);_0xc47bf7[_0xb445('0x30')]=_[_0xb445('0x2f')](_0x43a334['model'],qs[_0xb445('0x31')](_0xd57289[_0xb445('0x2d')][_0xb445('0x31')]));_0xc47bf7['attributes']=_0xc47bf7[_0xb445('0x30')][_0xb445('0x32')]?_0xc47bf7[_0xb445('0x30')]:_0x43a334[_0xb445('0x2b')];if(!_0xd57289[_0xb445('0x2d')][_0xb445('0x33')](_0xb445('0x34'))){_0xc47bf7[_0xb445('0x1c')]=qs[_0xb445('0x1c')](_0xd57289[_0xb445('0x2d')][_0xb445('0x1c')]);_0xc47bf7[_0xb445('0x1b')]=qs['offset'](_0xd57289['query'][_0xb445('0x1b')]);}_0xc47bf7[_0xb445('0x35')]=qs['sort'](_0xd57289[_0xb445('0x2d')][_0xb445('0x36')]);_0xc47bf7[_0xb445('0x37')]=qs[_0xb445('0x2e')](_[_0xb445('0x38')](_0xd57289[_0xb445('0x2d')],_0x43a334[_0xb445('0x2e')]),_0x4b0016);if(_0xd57289[_0xb445('0x2d')][_0xb445('0x39')]){_0xc47bf7[_0xb445('0x37')]=_[_0xb445('0x3a')](_0xc47bf7[_0xb445('0x37')],{'$or':_[_0xb445('0x26')](_0x4b0016,function(_0x159ba9){if(_0x159ba9[_0xb445('0x3b')]!==_0xb445('0x3c')){var _0x4a5a98={};_0x4a5a98[_0x159ba9[_0xb445('0x25')]]={'$like':'%'+_0xd57289[_0xb445('0x2d')][_0xb445('0x39')]+'%'};return _0x4a5a98;}})});}_0xc47bf7=_[_0xb445('0x3a')]({},_0xc47bf7,_0xd57289['options']);var _0x388398={'where':_0xc47bf7[_0xb445('0x37')]};return db[_0xb445('0x27')][_0xb445('0x1a')](_0x388398)[_0xb445('0x21')](function(_0x53b6a8){_0x123c24['count']=_0x53b6a8;if(_0xd57289[_0xb445('0x2d')][_0xb445('0x3d')]){_0xc47bf7['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xb445('0x3e')](_0xc47bf7);})[_0xb445('0x21')](function(_0x465e26){_0x123c24[_0xb445('0x3f')]=_0x465e26;return _0x123c24;})['then'](respondWithFilteredResult(_0x2f6bd9,_0xc47bf7))[_0xb445('0x40')](handleError(_0x2f6bd9,null));};exports[_0xb445('0x41')]=function(_0x45cd1a,_0x4e2f0d){var _0x3298ae={'raw':!![],'where':{'id':_0x45cd1a['params']['id']}},_0x1a5907={};_0x1a5907['model']=_[_0xb445('0x2c')](db[_0xb445('0x27')][_0xb445('0x28')]);_0x1a5907['query']=_[_0xb445('0x2c')](_0x45cd1a[_0xb445('0x2d')]);_0x1a5907[_0xb445('0x2e')]=_[_0xb445('0x2f')](_0x1a5907[_0xb445('0x2b')],_0x1a5907[_0xb445('0x2d')]);_0x3298ae[_0xb445('0x30')]=_[_0xb445('0x2f')](_0x1a5907[_0xb445('0x2b')],qs['fields'](_0x45cd1a[_0xb445('0x2d')][_0xb445('0x31')]));_0x3298ae[_0xb445('0x30')]=_0x3298ae[_0xb445('0x30')]['length']?_0x3298ae[_0xb445('0x30')]:_0x1a5907['model'];if(_0x45cd1a[_0xb445('0x2d')]['includeAll']){_0x3298ae[_0xb445('0x42')]=[{'all':!![]}];}_0x3298ae=_['merge']({},_0x3298ae,_0x45cd1a[_0xb445('0x43')]);return db[_0xb445('0x27')][_0xb445('0x44')](_0x3298ae)[_0xb445('0x21')](handleEntityNotFound(_0x4e2f0d,null))['then'](respondWithResult(_0x4e2f0d,null))[_0xb445('0x40')](handleError(_0x4e2f0d,null));};exports[_0xb445('0x45')]=function(_0x38ed8b,_0x579afb){return db[_0xb445('0x27')]['create'](_0x38ed8b['body'],{})[_0xb445('0x21')](respondWithResult(_0x579afb,0xc9))['catch'](handleError(_0x579afb,null));};exports[_0xb445('0x46')]=function(_0x1cfe3f,_0x36acbf){if(_0x1cfe3f[_0xb445('0x47')]['id']){delete _0x1cfe3f['body']['id'];}return db[_0xb445('0x27')]['find']({'where':{'id':_0x1cfe3f[_0xb445('0x48')]['id']}})[_0xb445('0x21')](handleEntityNotFound(_0x36acbf,null))[_0xb445('0x21')](saveUpdates(_0x1cfe3f[_0xb445('0x47')],null))[_0xb445('0x21')](respondWithResult(_0x36acbf,null))['catch'](handleError(_0x36acbf,null));};exports['destroy']=function(_0x265c97,_0x429fe6){return db[_0xb445('0x27')][_0xb445('0x44')]({'where':{'id':_0x265c97[_0xb445('0x48')]['id']}})[_0xb445('0x21')](handleEntityNotFound(_0x429fe6,null))[_0xb445('0x21')](removeEntity(_0x429fe6,null))[_0xb445('0x40')](handleError(_0x429fe6,null));};exports['describe']=function(_0x40f395,_0x48884b){return db['SmsTransferReport']['describe']()[_0xb445('0x21')](respondWithResult(_0x48884b,null))['catch'](handleError(_0x48884b,null));}; \ No newline at end of file +var _0xffb9=['sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','includeAll','include','SmsTransferReport','findAll','catch','show','params','length','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x36c4a6,_0x150f42){var _0x45626f=function(_0x36edda){while(--_0x36edda){_0x36c4a6['push'](_0x36c4a6['shift']());}};_0x45626f(++_0x150f42);}(_0xffb9,0x113));var _0x9ffb=function(_0x183ebe,_0x23e777){_0x183ebe=_0x183ebe-0x0;var _0x37f310=_0xffb9[_0x183ebe];return _0x37f310;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ffb('0x0'));var zipdir=require(_0x9ffb('0x1'));var jsonpatch=require(_0x9ffb('0x2'));var rp=require('request-promise');var moment=require(_0x9ffb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9ffb('0x4'));var util=require('util');var path=require(_0x9ffb('0x5'));var sox=require(_0x9ffb('0x6'));var csv=require(_0x9ffb('0x7'));var ejs=require(_0x9ffb('0x8'));var fs=require('fs');var fs_extra=require(_0x9ffb('0x9'));var _=require(_0x9ffb('0xa'));var squel=require(_0x9ffb('0xb'));var crypto=require(_0x9ffb('0xc'));var jsforce=require(_0x9ffb('0xd'));var deskjs=require(_0x9ffb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ffb('0xf'));var Papa=require(_0x9ffb('0x10'));var Redis=require(_0x9ffb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9ffb('0x12'));var as=require(_0x9ffb('0x13'));var hardwareService=require(_0x9ffb('0x14'));var logger=require(_0x9ffb('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9ffb('0x16'));var licenseUtil=require(_0x9ffb('0x17'));var db=require(_0x9ffb('0x18'))['db'];function respondWithStatusCode(_0x1b4ff3,_0x567a37){_0x567a37=_0x567a37||0xcc;return function(_0x5eed9e){if(_0x5eed9e){return _0x1b4ff3[_0x9ffb('0x19')](_0x567a37);}return _0x1b4ff3[_0x9ffb('0x1a')](_0x567a37)[_0x9ffb('0x1b')]();};}function respondWithResult(_0x50533c,_0x2f3e5a){_0x2f3e5a=_0x2f3e5a||0xc8;return function(_0x187a07){if(_0x187a07){return _0x50533c['status'](_0x2f3e5a)[_0x9ffb('0x1c')](_0x187a07);}};}function respondWithFilteredResult(_0x17200e,_0x3e51ec){return function(_0x49717c){if(_0x49717c){var _0x2e0527=typeof _0x3e51ec[_0x9ffb('0x1d')]==='undefined'&&typeof _0x3e51ec[_0x9ffb('0x1e')]===_0x9ffb('0x1f');var _0x24d593=_0x49717c['count'];var _0x826979=_0x2e0527?0x0:_0x3e51ec[_0x9ffb('0x1d')];var _0x54a851=_0x2e0527?_0x49717c[_0x9ffb('0x20')]:_0x3e51ec[_0x9ffb('0x1d')]+_0x3e51ec['limit'];var _0x279ba1;if(_0x54a851>=_0x24d593){_0x54a851=_0x24d593;_0x279ba1=0xc8;}else{_0x279ba1=0xce;}_0x17200e['status'](_0x279ba1);return _0x17200e[_0x9ffb('0x21')](_0x9ffb('0x22'),_0x826979+'-'+_0x54a851+'/'+_0x24d593)[_0x9ffb('0x1c')](_0x49717c);}return null;};}function patchUpdates(_0x185b17){return function(_0x2ed7b7){try{jsonpatch[_0x9ffb('0x23')](_0x2ed7b7,_0x185b17,!![]);}catch(_0x1ad9a1){return BPromise[_0x9ffb('0x24')](_0x1ad9a1);}return _0x2ed7b7[_0x9ffb('0x25')]();};}function saveUpdates(_0x473b12,_0x285682){return function(_0x5da63e){if(_0x5da63e){return _0x5da63e['update'](_0x473b12)[_0x9ffb('0x26')](function(_0x43f091){return _0x43f091;});}return null;};}function removeEntity(_0x320f8b,_0x5d255f){return function(_0x3a8c69){if(_0x3a8c69){return _0x3a8c69[_0x9ffb('0x27')]()[_0x9ffb('0x26')](function(){_0x320f8b['status'](0xcc)[_0x9ffb('0x1b')]();});}};}function handleEntityNotFound(_0x5d96fb,_0x52d844){return function(_0x286e44){if(!_0x286e44){_0x5d96fb['sendStatus'](0x194);}return _0x286e44;};}function handleError(_0x4f654f,_0x4c82ff){_0x4c82ff=_0x4c82ff||0x1f4;return function(_0x574d14){logger[_0x9ffb('0x28')](_0x574d14[_0x9ffb('0x29')]);if(_0x574d14[_0x9ffb('0x2a')]){delete _0x574d14[_0x9ffb('0x2a')];}_0x4f654f[_0x9ffb('0x1a')](_0x4c82ff)['send'](_0x574d14);};}exports[_0x9ffb('0x2b')]=function(_0x2da6b8,_0x31056c){var _0x54a892={},_0x5c094f={},_0x2dd799={'count':0x0,'rows':[]};var _0xa3f617=_[_0x9ffb('0x2c')](db['SmsTransferReport'][_0x9ffb('0x2d')],function(_0x143b94){return{'name':_0x143b94['fieldName'],'type':_0x143b94[_0x9ffb('0x2e')][_0x9ffb('0x2f')]};});_0x5c094f[_0x9ffb('0x30')]=_['map'](_0xa3f617,_0x9ffb('0x2a'));_0x5c094f[_0x9ffb('0x31')]=_[_0x9ffb('0x32')](_0x2da6b8[_0x9ffb('0x31')]);_0x5c094f['filters']=_['intersection'](_0x5c094f['model'],_0x5c094f[_0x9ffb('0x31')]);_0x54a892[_0x9ffb('0x33')]=_[_0x9ffb('0x34')](_0x5c094f[_0x9ffb('0x30')],qs[_0x9ffb('0x35')](_0x2da6b8['query'][_0x9ffb('0x35')]));_0x54a892[_0x9ffb('0x33')]=_0x54a892[_0x9ffb('0x33')]['length']?_0x54a892['attributes']:_0x5c094f[_0x9ffb('0x30')];if(!_0x2da6b8[_0x9ffb('0x31')][_0x9ffb('0x36')](_0x9ffb('0x37'))){_0x54a892[_0x9ffb('0x1e')]=qs[_0x9ffb('0x1e')](_0x2da6b8[_0x9ffb('0x31')]['limit']);_0x54a892[_0x9ffb('0x1d')]=qs[_0x9ffb('0x1d')](_0x2da6b8[_0x9ffb('0x31')]['offset']);}_0x54a892[_0x9ffb('0x38')]=qs[_0x9ffb('0x39')](_0x2da6b8[_0x9ffb('0x31')][_0x9ffb('0x39')]);_0x54a892[_0x9ffb('0x3a')]=qs[_0x9ffb('0x3b')](_[_0x9ffb('0x3c')](_0x2da6b8[_0x9ffb('0x31')],_0x5c094f[_0x9ffb('0x3b')]),_0xa3f617);if(_0x2da6b8['query']['filter']){_0x54a892[_0x9ffb('0x3a')]=_[_0x9ffb('0x3d')](_0x54a892[_0x9ffb('0x3a')],{'$or':_[_0x9ffb('0x2c')](_0xa3f617,function(_0x21026d){if(_0x21026d[_0x9ffb('0x2e')]!=='VIRTUAL'){var _0x240cb9={};_0x240cb9[_0x21026d[_0x9ffb('0x2a')]]={'$like':'%'+_0x2da6b8['query'][_0x9ffb('0x3e')]+'%'};return _0x240cb9;}})});}_0x54a892=_[_0x9ffb('0x3d')]({},_0x54a892,_0x2da6b8['options']);var _0x2fe068={'where':_0x54a892[_0x9ffb('0x3a')]};return db['SmsTransferReport']['count'](_0x2fe068)[_0x9ffb('0x26')](function(_0x48d604){_0x2dd799[_0x9ffb('0x20')]=_0x48d604;if(_0x2da6b8[_0x9ffb('0x31')][_0x9ffb('0x3f')]){_0x54a892[_0x9ffb('0x40')]=[{'all':!![]}];}return db[_0x9ffb('0x41')][_0x9ffb('0x42')](_0x54a892);})['then'](function(_0x3db0b3){_0x2dd799['rows']=_0x3db0b3;return _0x2dd799;})['then'](respondWithFilteredResult(_0x31056c,_0x54a892))[_0x9ffb('0x43')](handleError(_0x31056c,null));};exports[_0x9ffb('0x44')]=function(_0x2487da,_0x22eca5){var _0x136170={'raw':!![],'where':{'id':_0x2487da[_0x9ffb('0x45')]['id']}},_0x41d5d8={};_0x41d5d8[_0x9ffb('0x30')]=_[_0x9ffb('0x32')](db[_0x9ffb('0x41')][_0x9ffb('0x2d')]);_0x41d5d8['query']=_[_0x9ffb('0x32')](_0x2487da['query']);_0x41d5d8[_0x9ffb('0x3b')]=_['intersection'](_0x41d5d8[_0x9ffb('0x30')],_0x41d5d8[_0x9ffb('0x31')]);_0x136170[_0x9ffb('0x33')]=_['intersection'](_0x41d5d8[_0x9ffb('0x30')],qs[_0x9ffb('0x35')](_0x2487da[_0x9ffb('0x31')][_0x9ffb('0x35')]));_0x136170[_0x9ffb('0x33')]=_0x136170['attributes'][_0x9ffb('0x46')]?_0x136170[_0x9ffb('0x33')]:_0x41d5d8[_0x9ffb('0x30')];if(_0x2487da[_0x9ffb('0x31')][_0x9ffb('0x3f')]){_0x136170[_0x9ffb('0x40')]=[{'all':!![]}];}_0x136170=_[_0x9ffb('0x3d')]({},_0x136170,_0x2487da[_0x9ffb('0x47')]);return db[_0x9ffb('0x41')][_0x9ffb('0x48')](_0x136170)[_0x9ffb('0x26')](handleEntityNotFound(_0x22eca5,null))['then'](respondWithResult(_0x22eca5,null))[_0x9ffb('0x43')](handleError(_0x22eca5,null));};exports[_0x9ffb('0x49')]=function(_0x24f7fd,_0x4d203e){return db['SmsTransferReport'][_0x9ffb('0x49')](_0x24f7fd[_0x9ffb('0x4a')],{})[_0x9ffb('0x26')](respondWithResult(_0x4d203e,0xc9))[_0x9ffb('0x43')](handleError(_0x4d203e,null));};exports['update']=function(_0x231ac2,_0xacba72){if(_0x231ac2[_0x9ffb('0x4a')]['id']){delete _0x231ac2[_0x9ffb('0x4a')]['id'];}return db[_0x9ffb('0x41')][_0x9ffb('0x48')]({'where':{'id':_0x231ac2[_0x9ffb('0x45')]['id']}})['then'](handleEntityNotFound(_0xacba72,null))[_0x9ffb('0x26')](saveUpdates(_0x231ac2[_0x9ffb('0x4a')],null))[_0x9ffb('0x26')](respondWithResult(_0xacba72,null))[_0x9ffb('0x43')](handleError(_0xacba72,null));};exports[_0x9ffb('0x27')]=function(_0x52afdb,_0x47b409){return db[_0x9ffb('0x41')][_0x9ffb('0x48')]({'where':{'id':_0x52afdb[_0x9ffb('0x45')]['id']}})[_0x9ffb('0x26')](handleEntityNotFound(_0x47b409,null))[_0x9ffb('0x26')](removeEntity(_0x47b409,null))['catch'](handleError(_0x47b409,null));};exports['describe']=function(_0x1677c2,_0x50ff7b){return db['SmsTransferReport']['describe']()[_0x9ffb('0x26')](respondWithResult(_0x50ff7b,null))[_0x9ffb('0x43')](handleError(_0x50ff7b,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e230b3f..5b48ea2 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 _0x2f5a=['../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0x2f5a,0x1e6));var _0xa2f5=function(_0xb8efe0,_0x1dd3f1){_0xb8efe0=_0xb8efe0-0x0;var _0x2154af=_0x2f5a[_0xb8efe0];return _0x2154af;};'use strict';var _=require('lodash');var util=require(_0xa2f5('0x0'));var logger=require('../../config/logger')(_0xa2f5('0x1'));var moment=require(_0xa2f5('0x2'));var BPromise=require(_0xa2f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2f5('0x4'));var rimraf=require(_0xa2f5('0x5'));var config=require(_0xa2f5('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xa2f5('0x7')]=function(_0x210ca5,_0x58450b){return _0x210ca5[_0xa2f5('0x8')](_0xa2f5('0x9'),attributes,{'tableName':_0xa2f5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa2f5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89b2=['./smsTransferReport.attributes','exports','report_sms_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x23adf6,_0x29e9dc){var _0x5db754=function(_0x5b24bc){while(--_0x5b24bc){_0x23adf6['push'](_0x23adf6['shift']());}};_0x5db754(++_0x29e9dc);}(_0x89b2,0xc6));var _0x289b=function(_0x3a121b,_0x16de2b){_0x3a121b=_0x3a121b-0x0;var _0x16958e=_0x89b2[_0x3a121b];return _0x16958e;};'use strict';var _=require(_0x289b('0x0'));var util=require(_0x289b('0x1'));var logger=require(_0x289b('0x2'))(_0x289b('0x3'));var moment=require(_0x289b('0x4'));var BPromise=require(_0x289b('0x5'));var rp=require(_0x289b('0x6'));var fs=require('fs');var path=require(_0x289b('0x7'));var rimraf=require(_0x289b('0x8'));var config=require(_0x289b('0x9'));var attributes=require(_0x289b('0xa'));module[_0x289b('0xb')]=function(_0x5a6cc7,_0x1f7062){return _0x5a6cc7['define']('SmsTransferReport',attributes,{'tableName':_0x289b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','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 b2ad8ad..dffd2ec 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 _0xd2bb=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xdbda28,_0x119fe1){var _0x539db7=function(_0x394448){while(--_0x394448){_0xdbda28['push'](_0xdbda28['shift']());}};_0x539db7(++_0x119fe1);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x3b984c,_0x52d63e){_0x3b984c=_0x3b984c-0x0;var _0x35e5dc=_0xd2bb[_0x3b984c];return _0x35e5dc;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var moment=require('moment');var BPromise=require(_0xbd2b('0x1'));var rs=require(_0xbd2b('0x2'));var fs=require('fs');var Redis=require(_0xbd2b('0x3'));var db=require(_0xbd2b('0x4'))['db'];var utils=require(_0xbd2b('0x5'));var logger=require(_0xbd2b('0x6'))('rpc');var config=require(_0xbd2b('0x7'));var jayson=require(_0xbd2b('0x8'));var client=jayson[_0xbd2b('0x9')][_0xbd2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x296d68,_0x3751df,_0x42fee1){return new BPromise(function(_0x30cd3f,_0x259bca){return client[_0xbd2b('0xb')](_0x296d68,_0x42fee1)['then'](function(_0x172aef){logger['info'](_0xbd2b('0xc'),_0x3751df,_0xbd2b('0xd'));logger['debug'](_0xbd2b('0xe'),_0x3751df,_0xbd2b('0xd'),JSON[_0xbd2b('0xf')](_0x172aef));if(_0x172aef[_0xbd2b('0x10')]){if(_0x172aef[_0xbd2b('0x10')][_0xbd2b('0x11')]===0x1f4){logger[_0xbd2b('0x10')](_0xbd2b('0xc'),_0x3751df,_0x172aef['error'][_0xbd2b('0x12')]);return _0x259bca(_0x172aef[_0xbd2b('0x10')][_0xbd2b('0x12')]);}logger[_0xbd2b('0x10')](_0xbd2b('0xc'),_0x3751df,_0x172aef['error'][_0xbd2b('0x12')]);return _0x30cd3f(_0x172aef[_0xbd2b('0x10')][_0xbd2b('0x12')]);}else{logger[_0xbd2b('0x13')](_0xbd2b('0xc'),_0x3751df,_0xbd2b('0xd'));_0x30cd3f(_0x172aef[_0xbd2b('0x14')][_0xbd2b('0x12')]);}})[_0xbd2b('0x15')](function(_0x571596){logger[_0xbd2b('0x10')](_0xbd2b('0xc'),_0x3751df,_0x571596);_0x259bca(_0x571596);});});} \ No newline at end of file +var _0x43fd=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x43fd,0x1ec));var _0xd43f=function(_0x12216a,_0x2f4a8c){_0x12216a=_0x12216a-0x0;var _0x507751=_0x43fd[_0x12216a];return _0x507751;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd43f('0x1'));var fs=require('fs');var Redis=require(_0xd43f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd43f('0x3'));var logger=require('../../config/logger')(_0xd43f('0x4'));var config=require(_0xd43f('0x5'));var jayson=require(_0xd43f('0x6'));var client=jayson[_0xd43f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xde214d,_0xad5196,_0x20ccd7){return new BPromise(function(_0x331163,_0x547e12){return client[_0xd43f('0x8')](_0xde214d,_0x20ccd7)[_0xd43f('0x9')](function(_0x52e9c8){logger[_0xd43f('0xa')](_0xd43f('0xb'),_0xad5196,_0xd43f('0xc'));logger[_0xd43f('0xd')](_0xd43f('0xe'),_0xad5196,'request\x20sent',JSON[_0xd43f('0xf')](_0x52e9c8));if(_0x52e9c8[_0xd43f('0x10')]){if(_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x11')]===0x1f4){logger[_0xd43f('0x10')](_0xd43f('0xb'),_0xad5196,_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);return _0x547e12(_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);}logger[_0xd43f('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xad5196,_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);return _0x331163(_0x52e9c8[_0xd43f('0x10')]['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xad5196,_0xd43f('0xc'));_0x331163(_0x52e9c8[_0xd43f('0x13')]['message']);}})[_0xd43f('0x14')](function(_0x3647df){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xad5196,_0x3647df);_0x547e12(_0x3647df);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f6774ac..f2d8f28 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 _0x92c8=['root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','put','update','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','diskStorage','join'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x92c8,0x91));var _0x892c=function(_0x522420,_0x2a53de){_0x522420=_0x522420-0x0;var _0xff02e1=_0x92c8[_0x522420];return _0xff02e1;};'use strict';var multer=require(_0x892c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x892c('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x892c('0x2'));var interaction=require(_0x892c('0x3'));var config=require(_0x892c('0x4'));var controller=require('./sound.controller');router['get']('/',auth[_0x892c('0x5')](),controller[_0x892c('0x6')]);router['get'](_0x892c('0x7'),auth['isAuthenticated'](),controller[_0x892c('0x8')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x892c('0x9')]({'destination':function(_0xf6c380,_0x50d548,_0x3d8c04){_0x3d8c04(null,path[_0x892c('0xa')](config[_0x892c('0xb')],_0x892c('0xc')));},'filename':function(_0x37248b,_0x5f0c87,_0x11b1fe){_0x5f0c87[_0x892c('0xd')]=_0x5f0c87[_0x892c('0xd')][_0x892c('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11b1fe(null,util[_0x892c('0xf')](_0x892c('0x10'),path[_0x892c('0x11')](_0x5f0c87[_0x892c('0xd')],path[_0x892c('0x12')](_0x5f0c87['originalname'])),Date[_0x892c('0x13')](),path[_0x892c('0x12')](_0x5f0c87[_0x892c('0xd')])));}})});router[_0x892c('0x14')]('/',upload[_0x892c('0x15')]('file'),controller['create']);router[_0x892c('0x16')](_0x892c('0x7'),auth[_0x892c('0x5')](),controller[_0x892c('0x17')]);router[_0x892c('0x18')](_0x892c('0x7'),auth[_0x892c('0x5')](),controller[_0x892c('0x18')]);module[_0x892c('0x19')]=router; \ No newline at end of file +var _0x0402=['download','join','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x3c5aa6,_0x4c4f86){var _0x49e397=function(_0x37004d){while(--_0x37004d){_0x3c5aa6['push'](_0x3c5aa6['shift']());}};_0x49e397(++_0x4c4f86);}(_0x0402,0x1a6));var _0x2040=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0402[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x2040('0x0'));var util=require('util');var path=require(_0x2040('0x1'));var timeout=require(_0x2040('0x2'));var express=require(_0x2040('0x3'));var router=express[_0x2040('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2040('0x5'));var config=require(_0x2040('0x6'));var controller=require(_0x2040('0x7'));router[_0x2040('0x8')]('/',auth[_0x2040('0x9')](),controller['index']);router[_0x2040('0x8')](_0x2040('0xa'),auth[_0x2040('0x9')](),controller[_0x2040('0xb')]);router[_0x2040('0x8')](_0x2040('0xc'),auth[_0x2040('0x9')](),controller[_0x2040('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1127a5,_0xebccf8,_0x489d66){_0x489d66(null,path[_0x2040('0xe')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x57fb76,_0x58b4b0,_0x575292){_0x58b4b0[_0x2040('0xf')]=_0x58b4b0[_0x2040('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x575292(null,util[_0x2040('0x10')](_0x2040('0x11'),path[_0x2040('0x12')](_0x58b4b0[_0x2040('0xf')],path[_0x2040('0x13')](_0x58b4b0[_0x2040('0xf')])),Date[_0x2040('0x14')](),path[_0x2040('0x13')](_0x58b4b0['originalname'])));}})});router[_0x2040('0x15')]('/',upload[_0x2040('0x16')](_0x2040('0x17')),controller[_0x2040('0x18')]);router[_0x2040('0x19')](_0x2040('0xa'),auth[_0x2040('0x9')](),controller[_0x2040('0x1a')]);router[_0x2040('0x1b')](_0x2040('0xa'),auth['isAuthenticated'](),controller[_0x2040('0x1b')]);module[_0x2040('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 7258693..aa4c7a6 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 _0xfa74=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x242e68,_0x56f606){var _0x46307a=function(_0x2b7d43){while(--_0x2b7d43){_0x242e68['push'](_0x242e68['shift']());}};_0x46307a(++_0x56f606);}(_0xfa74,0x1a3));var _0x4fa7=function(_0x52fb5b,_0x2dca2a){_0x52fb5b=_0x52fb5b-0x0;var _0x5439a=_0xfa74[_0x52fb5b];return _0x5439a;};'use strict';var Sequelize=require(_0x4fa7('0x0'));module[_0x4fa7('0x1')]={'name':{'type':Sequelize[_0x4fa7('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x4fa7('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x4fa7('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x4fa7('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4fa7('0x4')]},'original_channelCount':{'type':Sequelize[_0x4fa7('0x5')]},'original_bitRate':{'type':Sequelize[_0x4fa7('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4fa7('0x5')]},'converted_format':{'type':Sequelize[_0x4fa7('0x2')]},'converted_duration':{'type':Sequelize[_0x4fa7('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4fa7('0x4')]},'converted_channelCount':{'type':Sequelize[_0x4fa7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4fa7('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x82fb=['STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82fb,0x1b7));var _0xb82f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x82fb[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xb82f('0x0'));module['exports']={'name':{'type':Sequelize[_0xb82f('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb82f('0x1')]},'display_name':{'type':Sequelize[_0xb82f('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xb82f('0x1')]},'original_format':{'type':Sequelize[_0xb82f('0x1')]},'original_duration':{'type':Sequelize[_0xb82f('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xb82f('0x3')]},'original_sampleRate':{'type':Sequelize[_0xb82f('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xb82f('0x3')]},'converted_channelCount':{'type':Sequelize[_0xb82f('0x4')]},'converted_bitRate':{'type':Sequelize[_0xb82f('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xb82f('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b7f6ddf..602b3e9 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 _0xd113=['VIRTUAL','filter','options','include','rows','catch','params','download','find','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','root','format','%s.%s','create','file','extname','originalname','filename','substring','wav','server/files/sounds/original','basename','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','duration','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','delete','original_format','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','then','error','name','send','index','Sound','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge'];(function(_0x1a23fd,_0x12b022){var _0x26a4cf=function(_0x1602f7){while(--_0x1602f7){_0x1a23fd['push'](_0x1a23fd['shift']());}};_0x26a4cf(++_0x12b022);}(_0xd113,0x1aa));var _0x3d11=function(_0x5e5f15,_0x43bc43){_0x5e5f15=_0x5e5f15-0x0;var _0x3a98bd=_0xd113[_0x5e5f15];return _0x3a98bd;};'use strict';var emlformat=require(_0x3d11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d11('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3d11('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3d11('0x3'));var util=require(_0x3d11('0x4'));var path=require(_0x3d11('0x5'));var sox=require(_0x3d11('0x6'));var csv=require(_0x3d11('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d11('0x8'));var _=require(_0x3d11('0x9'));var squel=require(_0x3d11('0xa'));var crypto=require('crypto');var jsforce=require(_0x3d11('0xb'));var deskjs=require(_0x3d11('0xc'));var toCsv=require(_0x3d11('0x7'));var querystring=require('querystring');var Papa=require(_0x3d11('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d11('0xe'));var as=require(_0x3d11('0xf'));var hardwareService=require(_0x3d11('0x10'));var logger=require('../../config/logger')(_0x3d11('0x11'));var utils=require(_0x3d11('0x12'));var config=require(_0x3d11('0x13'));var licenseUtil=require(_0x3d11('0x14'));var db=require(_0x3d11('0x15'))['db'];function respondWithStatusCode(_0x38df30,_0x4d1b4a){_0x4d1b4a=_0x4d1b4a||0xcc;return function(_0xbce0ef){if(_0xbce0ef){return _0x38df30[_0x3d11('0x16')](_0x4d1b4a);}return _0x38df30['status'](_0x4d1b4a)[_0x3d11('0x17')]();};}function respondWithResult(_0x19dacd,_0x231593){_0x231593=_0x231593||0xc8;return function(_0x4d463a){if(_0x4d463a){return _0x19dacd[_0x3d11('0x18')](_0x231593)['json'](_0x4d463a);}};}function respondWithFilteredResult(_0xb7be0e,_0x5313f6){return function(_0x567fb2){if(_0x567fb2){var _0x3fdb96=typeof _0x5313f6[_0x3d11('0x19')]===_0x3d11('0x1a')&&typeof _0x5313f6[_0x3d11('0x1b')]===_0x3d11('0x1a');var _0x2c592c=_0x567fb2['count'];var _0x70dba7=_0x3fdb96?0x0:_0x5313f6['offset'];var _0x390b39=_0x3fdb96?_0x567fb2[_0x3d11('0x1c')]:_0x5313f6[_0x3d11('0x19')]+_0x5313f6['limit'];var _0x13682f;if(_0x390b39>=_0x2c592c){_0x390b39=_0x2c592c;_0x13682f=0xc8;}else{_0x13682f=0xce;}_0xb7be0e[_0x3d11('0x18')](_0x13682f);return _0xb7be0e[_0x3d11('0x1d')](_0x3d11('0x1e'),_0x70dba7+'-'+_0x390b39+'/'+_0x2c592c)[_0x3d11('0x1f')](_0x567fb2);}return null;};}function patchUpdates(_0x110dd0){return function(_0x47b666){try{jsonpatch[_0x3d11('0x20')](_0x47b666,_0x110dd0,!![]);}catch(_0x57d1f6){return BPromise[_0x3d11('0x21')](_0x57d1f6);}return _0x47b666[_0x3d11('0x22')]();};}function saveUpdates(_0xcd3e0d,_0x1359ea){return function(_0x45f57c){if(_0x45f57c){return _0x45f57c['update'](_0xcd3e0d)['then'](function(_0x455078){return _0x455078;});}return null;};}function removeEntity(_0x5be7e5,_0x738410){return function(_0x105818){if(_0x105818){return _0x105818[_0x3d11('0x23')]()['then'](function(){var _0x182b65=_0x105818[_0x3d11('0x24')]({'plain':!![]});var _0x3f0116='Sounds';return db[_0x3d11('0x25')]['destroy']({'where':{'type':_0x3f0116,'resourceId':_0x182b65['id']}})[_0x3d11('0x26')](function(){return _0x105818;});})[_0x3d11('0x26')](function(){_0x5be7e5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1224,_0x291b62){return function(_0x300416){if(!_0x300416){_0x3d1224['sendStatus'](0x194);}return _0x300416;};}function handleError(_0xa85016,_0x1f359e){_0x1f359e=_0x1f359e||0x1f4;return function(_0x417af1){logger[_0x3d11('0x27')](_0x417af1['stack']);if(_0x417af1['name']){delete _0x417af1[_0x3d11('0x28')];}_0xa85016['status'](_0x1f359e)[_0x3d11('0x29')](_0x417af1);};}exports[_0x3d11('0x2a')]=function(_0x132a8b,_0x4ef2a2){var _0x28496d={},_0x23ecf4={},_0x14e187={'count':0x0,'rows':[]};var _0x5c8414=_['map'](db[_0x3d11('0x2b')][_0x3d11('0x2c')],function(_0x1ffeb1){return{'name':_0x1ffeb1[_0x3d11('0x2d')],'type':_0x1ffeb1[_0x3d11('0x2e')]['key']};});_0x23ecf4[_0x3d11('0x2f')]=_[_0x3d11('0x30')](_0x5c8414,_0x3d11('0x28'));_0x23ecf4[_0x3d11('0x31')]=_[_0x3d11('0x32')](_0x132a8b[_0x3d11('0x31')]);_0x23ecf4[_0x3d11('0x33')]=_[_0x3d11('0x34')](_0x23ecf4[_0x3d11('0x2f')],_0x23ecf4[_0x3d11('0x31')]);_0x28496d[_0x3d11('0x35')]=_[_0x3d11('0x34')](_0x23ecf4['model'],qs['fields'](_0x132a8b['query'][_0x3d11('0x36')]));_0x28496d[_0x3d11('0x35')]=_0x28496d[_0x3d11('0x35')][_0x3d11('0x37')]?_0x28496d[_0x3d11('0x35')]:_0x23ecf4[_0x3d11('0x2f')];if(!_0x132a8b[_0x3d11('0x31')][_0x3d11('0x38')](_0x3d11('0x39'))){_0x28496d[_0x3d11('0x1b')]=qs[_0x3d11('0x1b')](_0x132a8b[_0x3d11('0x31')][_0x3d11('0x1b')]);_0x28496d[_0x3d11('0x19')]=qs[_0x3d11('0x19')](_0x132a8b['query']['offset']);}_0x28496d[_0x3d11('0x3a')]=qs[_0x3d11('0x3b')](_0x132a8b['query'][_0x3d11('0x3b')]);_0x28496d[_0x3d11('0x3c')]=qs[_0x3d11('0x33')](_['pick'](_0x132a8b['query'],_0x23ecf4[_0x3d11('0x33')]),_0x5c8414);if(_0x132a8b[_0x3d11('0x31')]['filter']){_0x28496d['where']=_[_0x3d11('0x3d')](_0x28496d[_0x3d11('0x3c')],{'$or':_[_0x3d11('0x30')](_0x5c8414,function(_0x30d2e9){if(_0x30d2e9[_0x3d11('0x2e')]!==_0x3d11('0x3e')){var _0x2fe3f4={};_0x2fe3f4[_0x30d2e9[_0x3d11('0x28')]]={'$like':'%'+_0x132a8b[_0x3d11('0x31')][_0x3d11('0x3f')]+'%'};return _0x2fe3f4;}})});}_0x28496d=_[_0x3d11('0x3d')]({},_0x28496d,_0x132a8b[_0x3d11('0x40')]);var _0xb0f55c={'where':_0x28496d[_0x3d11('0x3c')]};return db['Sound']['count'](_0xb0f55c)[_0x3d11('0x26')](function(_0x139b60){_0x14e187['count']=_0x139b60;if(_0x132a8b[_0x3d11('0x31')]['includeAll']){_0x28496d[_0x3d11('0x41')]=[{'all':!![]}];}return db[_0x3d11('0x2b')]['findAll'](_0x28496d);})['then'](function(_0x476267){_0x14e187[_0x3d11('0x42')]=_0x476267;return _0x14e187;})[_0x3d11('0x26')](respondWithFilteredResult(_0x4ef2a2,_0x28496d))[_0x3d11('0x43')](handleError(_0x4ef2a2,null));};exports['show']=function(_0x4958e3,_0x1961fb){var _0x4ed400={'raw':!![],'where':{'id':_0x4958e3[_0x3d11('0x44')]['id']}},_0x3fa87c={};_0x3fa87c[_0x3d11('0x2f')]=_[_0x3d11('0x32')](db[_0x3d11('0x2b')][_0x3d11('0x2c')]);_0x3fa87c[_0x3d11('0x31')]=_[_0x3d11('0x32')](_0x4958e3[_0x3d11('0x31')]);_0x3fa87c[_0x3d11('0x33')]=_['intersection'](_0x3fa87c[_0x3d11('0x2f')],_0x3fa87c['query']);_0x4ed400[_0x3d11('0x35')]=_[_0x3d11('0x34')](_0x3fa87c[_0x3d11('0x2f')],qs[_0x3d11('0x36')](_0x4958e3[_0x3d11('0x31')][_0x3d11('0x36')]));_0x4ed400[_0x3d11('0x35')]=_0x4ed400[_0x3d11('0x35')][_0x3d11('0x37')]?_0x4ed400[_0x3d11('0x35')]:_0x3fa87c[_0x3d11('0x2f')];if(_0x4958e3['query']['includeAll']){_0x4ed400[_0x3d11('0x41')]=[{'all':!![]}];}_0x4ed400=_[_0x3d11('0x3d')]({},_0x4ed400,_0x4958e3[_0x3d11('0x40')]);return db['Sound']['find'](_0x4ed400)[_0x3d11('0x26')](handleEntityNotFound(_0x1961fb,null))[_0x3d11('0x26')](respondWithResult(_0x1961fb,null))[_0x3d11('0x43')](handleError(_0x1961fb,null));};exports[_0x3d11('0x45')]=function(_0x39d5c8,_0x1abbf3,_0x1947df){return db[_0x3d11('0x2b')][_0x3d11('0x46')]({'where':{'id':_0x39d5c8[_0x3d11('0x44')]['id']},'attributes':[_0x3d11('0x28'),_0x3d11('0x47'),_0x3d11('0x48')],'raw':!![]})[_0x3d11('0x26')](handleEntityNotFound(_0x1abbf3,null))[_0x3d11('0x26')](function(_0x3d0c8d){if(_0x3d0c8d){if(!fs[_0x3d11('0x49')](path['join'](config['root'],_0x3d11('0x4a'),_0x3d0c8d['save_name']+'.'+_0x3d0c8d['converted_format']))){throw new db[(_0x3d11('0x4b'))][(_0x3d11('0x4c'))](_0x3d11('0x4d'));}return _0x1abbf3[_0x3d11('0x45')](path[_0x3d11('0x4e')](config[_0x3d11('0x4f')],'server/files/sounds/converted',util[_0x3d11('0x50')]('%s.%s',_0x3d0c8d['save_name'],_0x3d0c8d[_0x3d11('0x48')])),util[_0x3d11('0x50')](_0x3d11('0x51'),_0x3d0c8d[_0x3d11('0x28')],_0x3d0c8d[_0x3d11('0x48')]));}return null;})[_0x3d11('0x43')](handleError(_0x1abbf3,null));};exports[_0x3d11('0x52')]=function(_0xa54094,_0x56b0cb,_0x3501ab){var _0x49ba00={'name':path['basename'](_0xa54094[_0x3d11('0x53')]['originalname'],path[_0x3d11('0x54')](_0xa54094['file'][_0x3d11('0x55')])),'save_name':path['basename'](_0xa54094['file']['filename'],path['extname'](_0xa54094['file'][_0x3d11('0x56')])),'original_format':path[_0x3d11('0x54')](_0xa54094[_0x3d11('0x53')][_0x3d11('0x55')])[_0x3d11('0x57')](0x1),'converted_format':_0x3d11('0x58')};var _0x32fd7e=path[_0x3d11('0x4e')](config['root'],_0x3d11('0x59'),_0xa54094['file']['filename']);var _0x5198df=path[_0x3d11('0x4e')](config[_0x3d11('0x4f')],_0x3d11('0x4a'),util['format'](_0x3d11('0x51'),path[_0x3d11('0x5a')](_0xa54094[_0x3d11('0x53')]['filename'],path[_0x3d11('0x54')](_0xa54094[_0x3d11('0x53')][_0x3d11('0x56')])),_0x49ba00[_0x3d11('0x48')]));logger[_0x3d11('0x5b')](_0x3d11('0x5c'),_0x32fd7e);logger[_0x3d11('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x5198df);try{fs[_0x3d11('0x5d')](_0x32fd7e,parseInt(_0x3d11('0x5e'),0x8));var _0x5f3f9c=sox[_0x3d11('0x5f')](_0x32fd7e,_0x5198df,{'sampleRate':0x1f40,'format':_0x3d11('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5f3f9c['on'](_0x3d11('0x27'),function(_0x26be41){fs[_0x3d11('0x60')](_0x32fd7e);_0x56b0cb[_0x3d11('0x18')](0x1f4)[_0x3d11('0x29')](_0x26be41);});_0x5f3f9c['on']('src',function(_0x1628dd){_0x49ba00[_0x3d11('0x61')]=isNaN(_0x1628dd['duration'])?null:_0x1628dd['duration']*0x3e8;_0x49ba00['original_sampleCount']=isNaN(_0x1628dd[_0x3d11('0x62')])?null:_0x1628dd[_0x3d11('0x62')];_0x49ba00[_0x3d11('0x63')]=isNaN(_0x1628dd['channelCount'])?null:_0x1628dd['channelCount'];_0x49ba00[_0x3d11('0x64')]=isNaN(_0x1628dd[_0x3d11('0x65')])?null:_0x1628dd[_0x3d11('0x65')];_0x49ba00[_0x3d11('0x66')]=isNaN(_0x1628dd[_0x3d11('0x67')])?null:_0x1628dd[_0x3d11('0x67')];});_0x5f3f9c['on']('dest',function(_0x463ae6){_0x49ba00['converted_duration']=isNaN(_0x463ae6[_0x3d11('0x68')])?null:_0x463ae6[_0x3d11('0x68')]*0x3e8;_0x49ba00[_0x3d11('0x69')]=isNaN(_0x463ae6[_0x3d11('0x62')])?null:_0x463ae6[_0x3d11('0x62')];_0x49ba00[_0x3d11('0x6a')]=isNaN(_0x463ae6[_0x3d11('0x6b')])?null:_0x463ae6['channelCount'];_0x49ba00[_0x3d11('0x6c')]=isNaN(_0x463ae6[_0x3d11('0x65')])?null:_0x463ae6[_0x3d11('0x65')];_0x49ba00[_0x3d11('0x6d')]=isNaN(_0x463ae6[_0x3d11('0x67')])?null:_0x463ae6[_0x3d11('0x67')];});_0x5f3f9c['on']('end',function(){fs[_0x3d11('0x5d')](_0x5198df,parseInt(_0x3d11('0x5e'),0x8));return db[_0x3d11('0x2b')]['create'](_0x49ba00)[_0x3d11('0x26')](function(_0x55ea8b){var _0x242324={'role':_0xa54094[_0x3d11('0x6e')]['role'],'userProfileId':_0xa54094[_0x3d11('0x6e')]['userProfileId']};if(!_0x242324)throw new Error(_0x3d11('0x6f'));if(_0x242324[_0x3d11('0x70')]===_0x3d11('0x71')){var _0x8f096d=_0x55ea8b['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x3d11('0x72'),'userProfileId':_0x242324['userProfileId']},'raw':!![]})[_0x3d11('0x26')](function(_0x29e52f){if(_0x29e52f&&_0x29e52f['autoAssociation']===0x0){return db[_0x3d11('0x25')][_0x3d11('0x52')]({'name':_0x8f096d['name'],'resourceId':_0x8f096d['id'],'type':_0x29e52f[_0x3d11('0x28')],'sectionId':_0x29e52f['id']},{})[_0x3d11('0x26')](function(){return _0x55ea8b;});}else{return _0x55ea8b;}})[_0x3d11('0x43')](function(_0x4a8fa0){logger[_0x3d11('0x27')](_0x3d11('0x73'),_0x4a8fa0);throw _0x4a8fa0;});}return _0x55ea8b;})[_0x3d11('0x26')](respondWithResult(_0x56b0cb,null))[_0x3d11('0x43')](handleError(_0x56b0cb,null));});_0x5f3f9c[_0x3d11('0x74')]();}catch(_0x69513){_0x56b0cb[_0x3d11('0x18')](0x1f4)['send'](_0x69513);}};exports[_0x3d11('0x75')]=function(_0x1d27b3,_0xa46693,_0x523e62){return db['Sound']['find']({'where':{'id':_0x1d27b3['params']['id']}})['then'](handleEntityNotFound(_0xa46693,null))[_0x3d11('0x26')](saveUpdates(_[_0x3d11('0x76')](_0x1d27b3[_0x3d11('0x6e')],[_0x3d11('0x28'),_0x3d11('0x77')]),null))[_0x3d11('0x26')](respondWithResult(_0xa46693,null))[_0x3d11('0x43')](handleError(_0xa46693,null));};exports[_0x3d11('0x78')]=function(_0x5eae49,_0x2a54f7,_0x507063){return db[_0x3d11('0x2b')][_0x3d11('0x46')]({'where':{'id':_0x5eae49[_0x3d11('0x44')]['id']}})[_0x3d11('0x26')](function(_0x741bf3){if(_0x741bf3){return _0x741bf3[_0x3d11('0x23')]();}})[_0x3d11('0x26')](function(_0x5cbd1e){var _0x36c652=path['join'](config[_0x3d11('0x4f')],_0x3d11('0x59'),util['format'](_0x3d11('0x51'),_0x5cbd1e[_0x3d11('0x47')],_0x5cbd1e[_0x3d11('0x79')]));var _0x400f50=path[_0x3d11('0x4e')](config[_0x3d11('0x4f')],'server/files/sounds/converted',util[_0x3d11('0x50')]('%s.%s',_0x5cbd1e[_0x3d11('0x47')],_0x5cbd1e['converted_format']));fs[_0x3d11('0x60')](_0x36c652);fs[_0x3d11('0x60')](_0x400f50);return _0x5cbd1e;})[_0x3d11('0x26')](function(_0x587110){if(_0x587110){return _0x2a54f7[_0x3d11('0x18')](0xcc)[_0x3d11('0x17')]();}})[_0x3d11('0x26')](handleEntityNotFound(_0x2a54f7,null))[_0x3d11('0x43')](handleError(_0x2a54f7,null));}; \ No newline at end of file +var _0xc1bb=['params','include','find','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sound\x20not\x20found','download','format','basename','file','originalname','extname','filename','wav','join','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','src','original_duration','duration','original_sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','Sound','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show'];(function(_0x5b0d50,_0x14474a){var _0x239b89=function(_0x5b700e){while(--_0x5b700e){_0x5b0d50['push'](_0x5b0d50['shift']());}};_0x239b89(++_0x14474a);}(_0xc1bb,0x19b));var _0xbc1b=function(_0x4a46f4,_0x42c898){_0x4a46f4=_0x4a46f4-0x0;var _0x158273=_0xc1bb[_0x4a46f4];return _0x158273;};'use strict';var emlformat=require(_0xbc1b('0x0'));var rimraf=require(_0xbc1b('0x1'));var zipdir=require(_0xbc1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc1b('0x3'));var moment=require(_0xbc1b('0x4'));var BPromise=require(_0xbc1b('0x5'));var Mustache=require(_0xbc1b('0x6'));var util=require('util');var path=require(_0xbc1b('0x7'));var sox=require(_0xbc1b('0x8'));var csv=require(_0xbc1b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc1b('0xa'));var _=require('lodash');var squel=require(_0xbc1b('0xb'));var crypto=require(_0xbc1b('0xc'));var jsforce=require(_0xbc1b('0xd'));var deskjs=require(_0xbc1b('0xe'));var toCsv=require(_0xbc1b('0x9'));var querystring=require('querystring');var Papa=require(_0xbc1b('0xf'));var Redis=require(_0xbc1b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbc1b('0x11'));var as=require(_0xbc1b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc1b('0x13'))(_0xbc1b('0x14'));var utils=require(_0xbc1b('0x15'));var config=require(_0xbc1b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3189d8,_0x1ba594){_0x1ba594=_0x1ba594||0xcc;return function(_0x26cbc4){if(_0x26cbc4){return _0x3189d8['sendStatus'](_0x1ba594);}return _0x3189d8[_0xbc1b('0x17')](_0x1ba594)[_0xbc1b('0x18')]();};}function respondWithResult(_0x48a603,_0xa98b9d){_0xa98b9d=_0xa98b9d||0xc8;return function(_0x1073f9){if(_0x1073f9){return _0x48a603[_0xbc1b('0x17')](_0xa98b9d)['json'](_0x1073f9);}};}function respondWithFilteredResult(_0x498077,_0x9c5ea){return function(_0x1367a3){if(_0x1367a3){var _0x272c0e=typeof _0x9c5ea['offset']==='undefined'&&typeof _0x9c5ea[_0xbc1b('0x19')]===_0xbc1b('0x1a');var _0x39f1c7=_0x1367a3[_0xbc1b('0x1b')];var _0x2d18e7=_0x272c0e?0x0:_0x9c5ea[_0xbc1b('0x1c')];var _0x2e8e82=_0x272c0e?_0x1367a3[_0xbc1b('0x1b')]:_0x9c5ea[_0xbc1b('0x1c')]+_0x9c5ea['limit'];var _0x3d08ea;if(_0x2e8e82>=_0x39f1c7){_0x2e8e82=_0x39f1c7;_0x3d08ea=0xc8;}else{_0x3d08ea=0xce;}_0x498077[_0xbc1b('0x17')](_0x3d08ea);return _0x498077[_0xbc1b('0x1d')](_0xbc1b('0x1e'),_0x2d18e7+'-'+_0x2e8e82+'/'+_0x39f1c7)[_0xbc1b('0x1f')](_0x1367a3);}return null;};}function patchUpdates(_0x1b586f){return function(_0x418332){try{jsonpatch[_0xbc1b('0x20')](_0x418332,_0x1b586f,!![]);}catch(_0x4997c9){return BPromise[_0xbc1b('0x21')](_0x4997c9);}return _0x418332[_0xbc1b('0x22')]();};}function saveUpdates(_0x1ba036,_0x53937e){return function(_0x4ec140){if(_0x4ec140){return _0x4ec140[_0xbc1b('0x23')](_0x1ba036)[_0xbc1b('0x24')](function(_0x2e85e9){return _0x2e85e9;});}return null;};}function removeEntity(_0x2239e4,_0x1dceab){return function(_0x3e82b2){if(_0x3e82b2){return _0x3e82b2[_0xbc1b('0x25')]()[_0xbc1b('0x24')](function(){var _0x258206=_0x3e82b2[_0xbc1b('0x26')]({'plain':!![]});var _0x30a0e2=_0xbc1b('0x27');return db[_0xbc1b('0x28')]['destroy']({'where':{'type':_0x30a0e2,'resourceId':_0x258206['id']}})[_0xbc1b('0x24')](function(){return _0x3e82b2;});})[_0xbc1b('0x24')](function(){_0x2239e4[_0xbc1b('0x17')](0xcc)[_0xbc1b('0x18')]();});}};}function handleEntityNotFound(_0x77b7f,_0x514f93){return function(_0x44493b){if(!_0x44493b){_0x77b7f[_0xbc1b('0x29')](0x194);}return _0x44493b;};}function handleError(_0x28efcc,_0x32872e){_0x32872e=_0x32872e||0x1f4;return function(_0x58990d){logger[_0xbc1b('0x2a')](_0x58990d[_0xbc1b('0x2b')]);if(_0x58990d[_0xbc1b('0x2c')]){delete _0x58990d[_0xbc1b('0x2c')];}_0x28efcc[_0xbc1b('0x17')](_0x32872e)['send'](_0x58990d);};}exports['index']=function(_0x51179f,_0x4f4397){var _0xae056b={},_0xbe0ec={},_0xaa59ba={'count':0x0,'rows':[]};var _0x37a9f1=_['map'](db[_0xbc1b('0x2d')][_0xbc1b('0x2e')],function(_0x3c2821){return{'name':_0x3c2821[_0xbc1b('0x2f')],'type':_0x3c2821[_0xbc1b('0x30')][_0xbc1b('0x31')]};});_0xbe0ec[_0xbc1b('0x32')]=_[_0xbc1b('0x33')](_0x37a9f1,_0xbc1b('0x2c'));_0xbe0ec['query']=_[_0xbc1b('0x34')](_0x51179f[_0xbc1b('0x35')]);_0xbe0ec[_0xbc1b('0x36')]=_[_0xbc1b('0x37')](_0xbe0ec['model'],_0xbe0ec['query']);_0xae056b[_0xbc1b('0x38')]=_[_0xbc1b('0x37')](_0xbe0ec[_0xbc1b('0x32')],qs[_0xbc1b('0x39')](_0x51179f['query'][_0xbc1b('0x39')]));_0xae056b['attributes']=_0xae056b[_0xbc1b('0x38')][_0xbc1b('0x3a')]?_0xae056b[_0xbc1b('0x38')]:_0xbe0ec[_0xbc1b('0x32')];if(!_0x51179f[_0xbc1b('0x35')][_0xbc1b('0x3b')]('nolimit')){_0xae056b['limit']=qs[_0xbc1b('0x19')](_0x51179f[_0xbc1b('0x35')][_0xbc1b('0x19')]);_0xae056b[_0xbc1b('0x1c')]=qs[_0xbc1b('0x1c')](_0x51179f['query'][_0xbc1b('0x1c')]);}_0xae056b[_0xbc1b('0x3c')]=qs[_0xbc1b('0x3d')](_0x51179f['query']['sort']);_0xae056b[_0xbc1b('0x3e')]=qs[_0xbc1b('0x36')](_[_0xbc1b('0x3f')](_0x51179f[_0xbc1b('0x35')],_0xbe0ec[_0xbc1b('0x36')]),_0x37a9f1);if(_0x51179f[_0xbc1b('0x35')]['filter']){_0xae056b[_0xbc1b('0x3e')]=_[_0xbc1b('0x40')](_0xae056b[_0xbc1b('0x3e')],{'$or':_['map'](_0x37a9f1,function(_0x70151f){if(_0x70151f[_0xbc1b('0x30')]!==_0xbc1b('0x41')){var _0x3d0376={};_0x3d0376[_0x70151f[_0xbc1b('0x2c')]]={'$like':'%'+_0x51179f['query'][_0xbc1b('0x42')]+'%'};return _0x3d0376;}})});}_0xae056b=_[_0xbc1b('0x40')]({},_0xae056b,_0x51179f[_0xbc1b('0x43')]);var _0x28693e={'where':_0xae056b[_0xbc1b('0x3e')]};return db['Sound'][_0xbc1b('0x1b')](_0x28693e)[_0xbc1b('0x24')](function(_0x2c26f5){_0xaa59ba['count']=_0x2c26f5;if(_0x51179f[_0xbc1b('0x35')][_0xbc1b('0x44')]){_0xae056b['include']=[{'all':!![]}];}return db[_0xbc1b('0x2d')][_0xbc1b('0x45')](_0xae056b);})['then'](function(_0x4ad340){_0xaa59ba[_0xbc1b('0x46')]=_0x4ad340;return _0xaa59ba;})['then'](respondWithFilteredResult(_0x4f4397,_0xae056b))[_0xbc1b('0x47')](handleError(_0x4f4397,null));};exports[_0xbc1b('0x48')]=function(_0x2ed8d4,_0x42c019){var _0xbfb664={'raw':!![],'where':{'id':_0x2ed8d4[_0xbc1b('0x49')]['id']}},_0x2703fc={};_0x2703fc[_0xbc1b('0x32')]=_[_0xbc1b('0x34')](db[_0xbc1b('0x2d')]['rawAttributes']);_0x2703fc['query']=_[_0xbc1b('0x34')](_0x2ed8d4['query']);_0x2703fc[_0xbc1b('0x36')]=_[_0xbc1b('0x37')](_0x2703fc['model'],_0x2703fc['query']);_0xbfb664[_0xbc1b('0x38')]=_[_0xbc1b('0x37')](_0x2703fc[_0xbc1b('0x32')],qs[_0xbc1b('0x39')](_0x2ed8d4[_0xbc1b('0x35')][_0xbc1b('0x39')]));_0xbfb664[_0xbc1b('0x38')]=_0xbfb664[_0xbc1b('0x38')][_0xbc1b('0x3a')]?_0xbfb664[_0xbc1b('0x38')]:_0x2703fc[_0xbc1b('0x32')];if(_0x2ed8d4[_0xbc1b('0x35')][_0xbc1b('0x44')]){_0xbfb664[_0xbc1b('0x4a')]=[{'all':!![]}];}_0xbfb664=_['merge']({},_0xbfb664,_0x2ed8d4['options']);return db[_0xbc1b('0x2d')][_0xbc1b('0x4b')](_0xbfb664)[_0xbc1b('0x24')](handleEntityNotFound(_0x42c019,null))[_0xbc1b('0x24')](respondWithResult(_0x42c019,null))[_0xbc1b('0x47')](handleError(_0x42c019,null));};exports['download']=function(_0x3ff3f7,_0x2de177,_0x433f6d){return db[_0xbc1b('0x2d')][_0xbc1b('0x4b')]({'where':{'id':_0x3ff3f7[_0xbc1b('0x49')]['id']},'attributes':[_0xbc1b('0x2c'),_0xbc1b('0x4c'),_0xbc1b('0x4d')],'raw':!![]})[_0xbc1b('0x24')](handleEntityNotFound(_0x2de177,null))[_0xbc1b('0x24')](function(_0x3201ec){if(_0x3201ec){if(!fs[_0xbc1b('0x4e')](path['join'](config[_0xbc1b('0x4f')],_0xbc1b('0x50'),_0x3201ec[_0xbc1b('0x4c')]+'.'+_0x3201ec[_0xbc1b('0x4d')]))){throw new db['Sequelize']['ValidationError'](_0xbc1b('0x51'));}return _0x2de177[_0xbc1b('0x52')](path['join'](config[_0xbc1b('0x4f')],_0xbc1b('0x50'),util[_0xbc1b('0x53')]('%s.%s',_0x3201ec['save_name'],_0x3201ec[_0xbc1b('0x4d')])),util[_0xbc1b('0x53')]('%s.%s',_0x3201ec['name'],_0x3201ec[_0xbc1b('0x4d')]));}return null;})['catch'](handleError(_0x2de177,null));};exports['create']=function(_0x3a4649,_0x2aaee0,_0x4fc468){var _0x526bb1={'name':path[_0xbc1b('0x54')](_0x3a4649[_0xbc1b('0x55')][_0xbc1b('0x56')],path[_0xbc1b('0x57')](_0x3a4649['file']['originalname'])),'save_name':path[_0xbc1b('0x54')](_0x3a4649['file']['filename'],path[_0xbc1b('0x57')](_0x3a4649[_0xbc1b('0x55')][_0xbc1b('0x58')])),'original_format':path[_0xbc1b('0x57')](_0x3a4649[_0xbc1b('0x55')][_0xbc1b('0x56')])['substring'](0x1),'converted_format':_0xbc1b('0x59')};var _0x5bd745=path[_0xbc1b('0x5a')](config['root'],_0xbc1b('0x5b'),_0x3a4649['file'][_0xbc1b('0x58')]);var _0x463c07=path[_0xbc1b('0x5a')](config['root'],'server/files/sounds/converted',util[_0xbc1b('0x53')](_0xbc1b('0x5c'),path['basename'](_0x3a4649[_0xbc1b('0x55')][_0xbc1b('0x58')],path[_0xbc1b('0x57')](_0x3a4649[_0xbc1b('0x55')]['filename'])),_0x526bb1[_0xbc1b('0x4d')]));logger[_0xbc1b('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x5bd745);logger['info'](_0xbc1b('0x5e'),_0x463c07);try{fs[_0xbc1b('0x5f')](_0x5bd745,parseInt(_0xbc1b('0x60'),0x8));var _0x40ad4d=sox['transcode'](_0x5bd745,_0x463c07,{'sampleRate':0x1f40,'format':_0xbc1b('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x40ad4d['on'](_0xbc1b('0x2a'),function(_0x254f15){fs[_0xbc1b('0x61')](_0x5bd745);_0x2aaee0['status'](0x1f4)[_0xbc1b('0x62')](_0x254f15);});_0x40ad4d['on'](_0xbc1b('0x63'),function(_0x58de93){_0x526bb1[_0xbc1b('0x64')]=isNaN(_0x58de93[_0xbc1b('0x65')])?null:_0x58de93[_0xbc1b('0x65')]*0x3e8;_0x526bb1[_0xbc1b('0x66')]=isNaN(_0x58de93['sampleCount'])?null:_0x58de93['sampleCount'];_0x526bb1['original_channelCount']=isNaN(_0x58de93[_0xbc1b('0x67')])?null:_0x58de93['channelCount'];_0x526bb1[_0xbc1b('0x68')]=isNaN(_0x58de93[_0xbc1b('0x69')])?null:_0x58de93[_0xbc1b('0x69')];_0x526bb1['original_sampleRate']=isNaN(_0x58de93[_0xbc1b('0x6a')])?null:_0x58de93[_0xbc1b('0x6a')];});_0x40ad4d['on'](_0xbc1b('0x6b'),function(_0x1bf610){_0x526bb1[_0xbc1b('0x6c')]=isNaN(_0x1bf610[_0xbc1b('0x65')])?null:_0x1bf610[_0xbc1b('0x65')]*0x3e8;_0x526bb1[_0xbc1b('0x6d')]=isNaN(_0x1bf610[_0xbc1b('0x6e')])?null:_0x1bf610[_0xbc1b('0x6e')];_0x526bb1[_0xbc1b('0x6f')]=isNaN(_0x1bf610[_0xbc1b('0x67')])?null:_0x1bf610[_0xbc1b('0x67')];_0x526bb1['converted_bitRate']=isNaN(_0x1bf610[_0xbc1b('0x69')])?null:_0x1bf610[_0xbc1b('0x69')];_0x526bb1[_0xbc1b('0x70')]=isNaN(_0x1bf610[_0xbc1b('0x6a')])?null:_0x1bf610[_0xbc1b('0x6a')];});_0x40ad4d['on']('end',function(){fs[_0xbc1b('0x5f')](_0x463c07,parseInt('0777',0x8));return db['Sound'][_0xbc1b('0x71')](_0x526bb1)['then'](function(_0xbd00bb){var _0x464e25={'role':_0x3a4649[_0xbc1b('0x72')]['role'],'userProfileId':_0x3a4649[_0xbc1b('0x72')][_0xbc1b('0x73')]};if(!_0x464e25)throw new Error(_0xbc1b('0x74'));if(_0x464e25['role']===_0xbc1b('0x75')){var _0xa02df6=_0xbd00bb[_0xbc1b('0x26')]({'plain':!![]});return db[_0xbc1b('0x76')][_0xbc1b('0x4b')]({'where':{'name':_0xbc1b('0x27'),'userProfileId':_0x464e25[_0xbc1b('0x73')]},'raw':!![]})[_0xbc1b('0x24')](function(_0x3c0f4d){if(_0x3c0f4d&&_0x3c0f4d['autoAssociation']===0x0){return db[_0xbc1b('0x28')][_0xbc1b('0x71')]({'name':_0xa02df6['name'],'resourceId':_0xa02df6['id'],'type':_0x3c0f4d[_0xbc1b('0x2c')],'sectionId':_0x3c0f4d['id']},{})[_0xbc1b('0x24')](function(){return _0xbd00bb;});}else{return _0xbd00bb;}})[_0xbc1b('0x47')](function(_0x1f5ef3){logger[_0xbc1b('0x2a')](_0xbc1b('0x77'),_0x1f5ef3);throw _0x1f5ef3;});}return _0xbd00bb;})[_0xbc1b('0x24')](respondWithResult(_0x2aaee0,null))[_0xbc1b('0x47')](handleError(_0x2aaee0,null));});_0x40ad4d['start']();}catch(_0x36eea0){_0x2aaee0['status'](0x1f4)[_0xbc1b('0x62')](_0x36eea0);}};exports['update']=function(_0x583f7a,_0x1260bf,_0x28da31){return db['Sound'][_0xbc1b('0x4b')]({'where':{'id':_0x583f7a['params']['id']}})[_0xbc1b('0x24')](handleEntityNotFound(_0x1260bf,null))[_0xbc1b('0x24')](saveUpdates(_['pick'](_0x583f7a['body'],[_0xbc1b('0x2c'),_0xbc1b('0x78')]),null))[_0xbc1b('0x24')](respondWithResult(_0x1260bf,null))[_0xbc1b('0x47')](handleError(_0x1260bf,null));};exports['delete']=function(_0x5a8af3,_0x3f5a3d,_0x4dc8e7){return db['Sound'][_0xbc1b('0x4b')]({'where':{'id':_0x5a8af3['params']['id']}})[_0xbc1b('0x24')](function(_0x1c9859){if(_0x1c9859){return _0x1c9859[_0xbc1b('0x25')]();}})[_0xbc1b('0x24')](function(_0x2f2bf0){var _0x39a4fe=path[_0xbc1b('0x5a')](config[_0xbc1b('0x4f')],_0xbc1b('0x5b'),util[_0xbc1b('0x53')](_0xbc1b('0x5c'),_0x2f2bf0[_0xbc1b('0x4c')],_0x2f2bf0['original_format']));var _0xd52b20=path['join'](config['root'],_0xbc1b('0x50'),util[_0xbc1b('0x53')](_0xbc1b('0x5c'),_0x2f2bf0[_0xbc1b('0x4c')],_0x2f2bf0[_0xbc1b('0x4d')]));fs[_0xbc1b('0x61')](_0x39a4fe);fs['unlinkSync'](_0xd52b20);return _0x2f2bf0;})['then'](function(_0xb18f87){if(_0xb18f87){return _0x3f5a3d[_0xbc1b('0x17')](0xcc)[_0xbc1b('0x18')]();}})[_0xbc1b('0x24')](handleEntityNotFound(_0x3f5a3d,null))['catch'](handleError(_0x3f5a3d,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1b18b2e..cb9ccbc 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 _0x0285=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash','util'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x0285,0xce));var _0x5028=function(_0x7c54d4,_0x113465){_0x7c54d4=_0x7c54d4-0x0;var _0x29f545=_0x0285[_0x7c54d4];return _0x29f545;};'use strict';var _=require(_0x5028('0x0'));var util=require(_0x5028('0x1'));var logger=require(_0x5028('0x2'))(_0x5028('0x3'));var moment=require('moment');var BPromise=require(_0x5028('0x4'));var rp=require(_0x5028('0x5'));var fs=require('fs');var path=require(_0x5028('0x6'));var rimraf=require(_0x5028('0x7'));var config=require(_0x5028('0x8'));var attributes=require(_0x5028('0x9'));module[_0x5028('0xa')]=function(_0x545e5b,_0x14b634){return _0x545e5b['define'](_0x5028('0xb'),attributes,{'tableName':_0x5028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99db=['moment','bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api'];(function(_0x511111,_0x4ab3d8){var _0x265601=function(_0x5cba3b){while(--_0x5cba3b){_0x511111['push'](_0x511111['shift']());}};_0x265601(++_0x4ab3d8);}(_0x99db,0x141));var _0xb99d=function(_0x4d9403,_0x33c5f0){_0x4d9403=_0x4d9403-0x0;var _0x5eef11=_0x99db[_0x4d9403];return _0x5eef11;};'use strict';var _=require('lodash');var util=require(_0xb99d('0x0'));var logger=require(_0xb99d('0x1'))(_0xb99d('0x2'));var moment=require(_0xb99d('0x3'));var BPromise=require(_0xb99d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb99d('0x5'));var config=require(_0xb99d('0x6'));var attributes=require(_0xb99d('0x7'));module[_0xb99d('0x8')]=function(_0x11974a,_0x4f16c2){return _0x11974a[_0xb99d('0x9')](_0xb99d('0xa'),attributes,{'tableName':_0xb99d('0xb'),'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 8cc394f..bca14c6 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 _0x5991=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment'];(function(_0x3f2207,_0xde7af0){var _0x5a3084=function(_0x35e555){while(--_0x35e555){_0x3f2207['push'](_0x3f2207['shift']());}};_0x5a3084(++_0xde7af0);}(_0x5991,0x79));var _0x1599=function(_0x2c6e64,_0x40d228){_0x2c6e64=_0x2c6e64-0x0;var _0x167788=_0x5991[_0x2c6e64];return _0x167788;};'use strict';var _=require(_0x1599('0x0'));var util=require(_0x1599('0x1'));var moment=require(_0x1599('0x2'));var BPromise=require('bluebird');var rs=require(_0x1599('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1599('0x4'))['db'];var utils=require(_0x1599('0x5'));var logger=require(_0x1599('0x6'))(_0x1599('0x7'));var config=require(_0x1599('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1599('0x9')][_0x1599('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x464905,_0x1a9e16,_0x28b3a3){return new BPromise(function(_0xefe493,_0xd05035){return client[_0x1599('0xb')](_0x464905,_0x28b3a3)[_0x1599('0xc')](function(_0x332ccb){logger[_0x1599('0xd')](_0x1599('0xe'),_0x1a9e16,_0x1599('0xf'));logger['debug'](_0x1599('0x10'),_0x1a9e16,_0x1599('0xf'),JSON[_0x1599('0x11')](_0x332ccb));if(_0x332ccb[_0x1599('0x12')]){if(_0x332ccb[_0x1599('0x12')]['code']===0x1f4){logger[_0x1599('0x12')](_0x1599('0xe'),_0x1a9e16,_0x332ccb[_0x1599('0x12')][_0x1599('0x13')]);return _0xd05035(_0x332ccb['error'][_0x1599('0x13')]);}logger[_0x1599('0x12')](_0x1599('0xe'),_0x1a9e16,_0x332ccb[_0x1599('0x12')][_0x1599('0x13')]);return _0xefe493(_0x332ccb[_0x1599('0x12')][_0x1599('0x13')]);}else{logger[_0x1599('0xd')]('Sound,\x20%s,\x20%s',_0x1a9e16,_0x1599('0xf'));_0xefe493(_0x332ccb['result'][_0x1599('0x13')]);}})[_0x1599('0x14')](function(_0x6cf46b){logger[_0x1599('0x12')](_0x1599('0xe'),_0x1a9e16,_0x6cf46b);_0xd05035(_0x6cf46b);});});}exports[_0x1599('0x15')]=function(_0x327704){var _0x4794a0=this;return new Promise(function(_0x24b304,_0x33ad9f){return db[_0x1599('0x16')]['find']({'raw':_0x327704[_0x1599('0x17')]?_0x327704[_0x1599('0x17')][_0x1599('0x18')]===undefined?!![]:![]:!![],'where':_0x327704[_0x1599('0x17')]?_0x327704[_0x1599('0x17')][_0x1599('0x19')]||null:null,'attributes':_0x327704[_0x1599('0x17')]?_0x327704[_0x1599('0x17')][_0x1599('0x1a')]||null:null,'include':_0x327704[_0x1599('0x17')]?_0x327704[_0x1599('0x17')][_0x1599('0x1b')]?_[_0x1599('0x1c')](_0x327704['options'][_0x1599('0x1b')],function(_0x4c8941){return{'model':db[_0x4c8941[_0x1599('0x1d')]],'as':_0x4c8941['as'],'attributes':_0x4c8941[_0x1599('0x1a')],'include':_0x4c8941['include']?_[_0x1599('0x1c')](_0x4c8941['include'],function(_0x189428){return{'model':db[_0x189428[_0x1599('0x1d')]],'as':_0x189428['as'],'attributes':_0x189428[_0x1599('0x1a')],'include':_0x189428[_0x1599('0x1b')]?_[_0x1599('0x1c')](_0x189428[_0x1599('0x1b')],function(_0x5b551c){return{'model':db[_0x5b551c[_0x1599('0x1d')]],'as':_0x5b551c['as'],'attributes':_0x5b551c[_0x1599('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1599('0xc')](function(_0x112486){logger[_0x1599('0xd')](_0x1599('0x15'),_0x327704);logger[_0x1599('0x1e')](_0x1599('0x15'),_0x327704,JSON[_0x1599('0x11')](_0x112486));_0x24b304(_0x112486);})[_0x1599('0x14')](function(_0x52e9b7){logger['error'](_0x1599('0x15'),_0x52e9b7[_0x1599('0x13')],_0x327704);_0x33ad9f(_0x4794a0[_0x1599('0x12')](0x1f4,_0x52e9b7[_0x1599('0x13')]));});});}; \ No newline at end of file +var _0x3512=['error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x259ce8,_0x798276){var _0x5ef5c2=function(_0x1bb84e){while(--_0x1bb84e){_0x259ce8['push'](_0x259ce8['shift']());}};_0x5ef5c2(++_0x798276);}(_0x3512,0x6f));var _0x2351=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3512[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x2351('0x0'));var moment=require(_0x2351('0x1'));var BPromise=require(_0x2351('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2351('0x3'));var db=require(_0x2351('0x4'))['db'];var utils=require(_0x2351('0x5'));var logger=require(_0x2351('0x6'))(_0x2351('0x7'));var config=require(_0x2351('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2351('0x9')][_0x2351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28f479,_0xcf4ea7,_0x1b2dd8){return new BPromise(function(_0xb30f3c,_0x30db46){return client[_0x2351('0xb')](_0x28f479,_0x1b2dd8)[_0x2351('0xc')](function(_0x3ef855){logger[_0x2351('0xd')]('Sound,\x20%s,\x20%s',_0xcf4ea7,_0x2351('0xe'));logger[_0x2351('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0xcf4ea7,_0x2351('0xe'),JSON[_0x2351('0x10')](_0x3ef855));if(_0x3ef855['error']){if(_0x3ef855[_0x2351('0x11')][_0x2351('0x12')]===0x1f4){logger[_0x2351('0x11')](_0x2351('0x13'),_0xcf4ea7,_0x3ef855['error'][_0x2351('0x14')]);return _0x30db46(_0x3ef855[_0x2351('0x11')][_0x2351('0x14')]);}logger[_0x2351('0x11')](_0x2351('0x13'),_0xcf4ea7,_0x3ef855[_0x2351('0x11')][_0x2351('0x14')]);return _0xb30f3c(_0x3ef855['error']['message']);}else{logger[_0x2351('0xd')](_0x2351('0x13'),_0xcf4ea7,_0x2351('0xe'));_0xb30f3c(_0x3ef855[_0x2351('0x15')][_0x2351('0x14')]);}})[_0x2351('0x16')](function(_0x27eff5){logger[_0x2351('0x11')](_0x2351('0x13'),_0xcf4ea7,_0x27eff5);_0x30db46(_0x27eff5);});});}exports[_0x2351('0x17')]=function(_0x173a31){var _0x183f3e=this;return new Promise(function(_0x22a00c,_0x40482){return db[_0x2351('0x18')][_0x2351('0x19')]({'raw':_0x173a31['options']?_0x173a31[_0x2351('0x1a')][_0x2351('0x1b')]===undefined?!![]:![]:!![],'where':_0x173a31['options']?_0x173a31['options']['where']||null:null,'attributes':_0x173a31[_0x2351('0x1a')]?_0x173a31['options'][_0x2351('0x1c')]||null:null,'include':_0x173a31[_0x2351('0x1a')]?_0x173a31['options'][_0x2351('0x1d')]?_[_0x2351('0x1e')](_0x173a31[_0x2351('0x1a')][_0x2351('0x1d')],function(_0x932cc9){return{'model':db[_0x932cc9['model']],'as':_0x932cc9['as'],'attributes':_0x932cc9[_0x2351('0x1c')],'include':_0x932cc9[_0x2351('0x1d')]?_[_0x2351('0x1e')](_0x932cc9[_0x2351('0x1d')],function(_0x3021e7){return{'model':db[_0x3021e7[_0x2351('0x1f')]],'as':_0x3021e7['as'],'attributes':_0x3021e7[_0x2351('0x1c')],'include':_0x3021e7[_0x2351('0x1d')]?_[_0x2351('0x1e')](_0x3021e7[_0x2351('0x1d')],function(_0x1b4eb0){return{'model':db[_0x1b4eb0[_0x2351('0x1f')]],'as':_0x1b4eb0['as'],'attributes':_0x1b4eb0['attributes']};}):[]};}):[]};}):[]:[]})[_0x2351('0xc')](function(_0xc0001c){logger[_0x2351('0xd')](_0x2351('0x17'),_0x173a31);logger[_0x2351('0xf')]('ShowSound',_0x173a31,JSON[_0x2351('0x10')](_0xc0001c));_0x22a00c(_0xc0001c);})[_0x2351('0x16')](function(_0x524796){logger['error'](_0x2351('0x17'),_0x524796[_0x2351('0x14')],_0x173a31);_0x40482(_0x183f3e[_0x2351('0x11')](0x1f4,_0x524796[_0x2351('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a0076e8..d18aa7a 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x5cd841,_0x68b05a){var _0x425f88=function(_0x2d714b){while(--_0x2d714b){_0x5cd841['push'](_0x5cd841['shift']());}};_0x425f88(++_0x68b05a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb7e7[_0x3c2a69];return _0x596bc8;};'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 fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5beb9a,_0x4bbfb3){_0x5beb9a=_0x5beb9a-0x0;var _0x4530d5=_0x9ffd[_0x5beb9a];return _0x4530d5;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 63b4071..311961f 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 _0xe764=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x467779,_0x325747){var _0x2bc80d=function(_0x1110b0){while(--_0x1110b0){_0x467779['push'](_0x467779['shift']());}};_0x2bc80d(++_0x325747);}(_0xe764,0x12d));var _0x4e76=function(_0x211de7,_0x2e6f69){_0x211de7=_0x211de7-0x0;var _0x2b29e0=_0xe764[_0x211de7];return _0x2b29e0;};'use strict';var Sequelize=require(_0x4e76('0x0'));module[_0x4e76('0x1')]={'uniqueid':{'type':Sequelize[_0x4e76('0x2')]},'body':{'type':Sequelize[_0x4e76('0x3')](_0x4e76('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x4e76('0x5')]('in',_0x4e76('0x6')),'defaultValue':_0x4e76('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4e76('0x2')]},'providerResponse':{'type':Sequelize[_0x4e76('0x3')]}}; \ No newline at end of file +var _0x0976=['TEXT','medium','ENUM','out','STRING','sequelize','exports'];(function(_0x4ef77b,_0x6a3df){var _0x58d1a6=function(_0x3b7e29){while(--_0x3b7e29){_0x4ef77b['push'](_0x4ef77b['shift']());}};_0x58d1a6(++_0x6a3df);}(_0x0976,0xa6));var _0x6097=function(_0x56c231,_0x4d95f9){_0x56c231=_0x56c231-0x0;var _0x18be20=_0x0976[_0x56c231];return _0x18be20;};'use strict';var Sequelize=require(_0x6097('0x0'));module[_0x6097('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x6097('0x2')](_0x6097('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x6097('0x4')]('in','out'),'defaultValue':_0x6097('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6097('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4e7aac6..22c3f09 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 _0x0268=['sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x471fbc,_0x325be2){var _0x3ad548=function(_0x3a4e0b){while(--_0x3a4e0b){_0x471fbc['push'](_0x471fbc['shift']());}};_0x3ad548(++_0x325be2);}(_0x0268,0x17e));var _0x8026=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0268[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x8026('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8026('0x1'));var jsonpatch=require(_0x8026('0x2'));var rp=require('request-promise');var moment=require(_0x8026('0x3'));var BPromise=require(_0x8026('0x4'));var Mustache=require(_0x8026('0x5'));var util=require(_0x8026('0x6'));var path=require(_0x8026('0x7'));var sox=require('sox');var csv=require(_0x8026('0x8'));var ejs=require(_0x8026('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8026('0xa'));var squel=require(_0x8026('0xb'));var crypto=require(_0x8026('0xc'));var jsforce=require(_0x8026('0xd'));var deskjs=require(_0x8026('0xe'));var toCsv=require(_0x8026('0x8'));var querystring=require(_0x8026('0xf'));var Papa=require(_0x8026('0x10'));var Redis=require(_0x8026('0x11'));var authService=require(_0x8026('0x12'));var qs=require(_0x8026('0x13'));var as=require(_0x8026('0x14'));var hardwareService=require(_0x8026('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8026('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8026('0x17'))['db'];function respondWithStatusCode(_0x1fa831,_0x386b8c){_0x386b8c=_0x386b8c||0xcc;return function(_0x3898d2){if(_0x3898d2){return _0x1fa831[_0x8026('0x18')](_0x386b8c);}return _0x1fa831[_0x8026('0x19')](_0x386b8c)[_0x8026('0x1a')]();};}function respondWithResult(_0x386ddc,_0x2e0d72){_0x2e0d72=_0x2e0d72||0xc8;return function(_0x2b9da3){if(_0x2b9da3){return _0x386ddc[_0x8026('0x19')](_0x2e0d72)[_0x8026('0x1b')](_0x2b9da3);}};}function respondWithFilteredResult(_0x24c5b2,_0x324e50){return function(_0x276623){if(_0x276623){var _0x10057d=typeof _0x324e50[_0x8026('0x1c')]==='undefined'&&typeof _0x324e50['limit']===_0x8026('0x1d');var _0x27d2f5=_0x276623[_0x8026('0x1e')];var _0x49094d=_0x10057d?0x0:_0x324e50[_0x8026('0x1c')];var _0x5df1f6=_0x10057d?_0x276623[_0x8026('0x1e')]:_0x324e50[_0x8026('0x1c')]+_0x324e50['limit'];var _0x1a7ddb;if(_0x5df1f6>=_0x27d2f5){_0x5df1f6=_0x27d2f5;_0x1a7ddb=0xc8;}else{_0x1a7ddb=0xce;}_0x24c5b2[_0x8026('0x19')](_0x1a7ddb);return _0x24c5b2[_0x8026('0x1f')]('Content-Range',_0x49094d+'-'+_0x5df1f6+'/'+_0x27d2f5)['json'](_0x276623);}return null;};}function patchUpdates(_0x4548a6){return function(_0x351b9c){try{jsonpatch['apply'](_0x351b9c,_0x4548a6,!![]);}catch(_0x30c9dd){return BPromise[_0x8026('0x20')](_0x30c9dd);}return _0x351b9c['save']();};}function saveUpdates(_0x1b98a5,_0x3366b2){return function(_0xe6e4c3){if(_0xe6e4c3){return _0xe6e4c3['update'](_0x1b98a5)[_0x8026('0x21')](function(_0x442f83){return _0x442f83;});}return null;};}function removeEntity(_0x52b30a,_0x195d94){return function(_0x3222b2){if(_0x3222b2){return _0x3222b2[_0x8026('0x22')]()[_0x8026('0x21')](function(){_0x52b30a[_0x8026('0x19')](0xcc)[_0x8026('0x1a')]();});}};}function handleEntityNotFound(_0x570bb7,_0xe28955){return function(_0x471277){if(!_0x471277){_0x570bb7[_0x8026('0x18')](0x194);}return _0x471277;};}function handleError(_0xac0701,_0x14ce60){_0x14ce60=_0x14ce60||0x1f4;return function(_0x2dee5e){logger[_0x8026('0x23')](_0x2dee5e['stack']);if(_0x2dee5e['name']){delete _0x2dee5e[_0x8026('0x24')];}_0xac0701[_0x8026('0x19')](_0x14ce60)[_0x8026('0x25')](_0x2dee5e);};}exports[_0x8026('0x26')]=function(_0x414eca,_0x37a555){var _0x558ff7={},_0x4f1ecd={},_0x5928bc={'count':0x0,'rows':[]};var _0x39a5f3=_[_0x8026('0x27')](db[_0x8026('0x28')][_0x8026('0x29')],function(_0x5577ed){return{'name':_0x5577ed[_0x8026('0x2a')],'type':_0x5577ed[_0x8026('0x2b')][_0x8026('0x2c')]};});_0x4f1ecd[_0x8026('0x2d')]=_[_0x8026('0x27')](_0x39a5f3,_0x8026('0x24'));_0x4f1ecd[_0x8026('0x2e')]=_[_0x8026('0x2f')](_0x414eca[_0x8026('0x2e')]);_0x4f1ecd['filters']=_[_0x8026('0x30')](_0x4f1ecd[_0x8026('0x2d')],_0x4f1ecd[_0x8026('0x2e')]);_0x558ff7['attributes']=_[_0x8026('0x30')](_0x4f1ecd[_0x8026('0x2d')],qs[_0x8026('0x31')](_0x414eca[_0x8026('0x2e')][_0x8026('0x31')]));_0x558ff7[_0x8026('0x32')]=_0x558ff7[_0x8026('0x32')][_0x8026('0x33')]?_0x558ff7['attributes']:_0x4f1ecd[_0x8026('0x2d')];if(!_0x414eca[_0x8026('0x2e')][_0x8026('0x34')](_0x8026('0x35'))){_0x558ff7[_0x8026('0x36')]=qs['limit'](_0x414eca['query'][_0x8026('0x36')]);_0x558ff7[_0x8026('0x1c')]=qs[_0x8026('0x1c')](_0x414eca[_0x8026('0x2e')][_0x8026('0x1c')]);}_0x558ff7[_0x8026('0x37')]=qs[_0x8026('0x38')](_0x414eca[_0x8026('0x2e')][_0x8026('0x38')]);_0x558ff7[_0x8026('0x39')]=qs['filters'](_[_0x8026('0x3a')](_0x414eca[_0x8026('0x2e')],_0x4f1ecd[_0x8026('0x3b')]),_0x39a5f3);if(_0x414eca[_0x8026('0x2e')][_0x8026('0x3c')]){_0x558ff7[_0x8026('0x39')]=_['merge'](_0x558ff7[_0x8026('0x39')],{'$or':_[_0x8026('0x27')](_0x39a5f3,function(_0x148f63){if(_0x148f63['type']!==_0x8026('0x3d')){var _0x5dd29c={};_0x5dd29c[_0x148f63[_0x8026('0x24')]]={'$like':'%'+_0x414eca[_0x8026('0x2e')][_0x8026('0x3c')]+'%'};return _0x5dd29c;}})});}_0x558ff7=_[_0x8026('0x3e')]({},_0x558ff7,_0x414eca[_0x8026('0x3f')]);var _0x1b13e0={'where':_0x558ff7[_0x8026('0x39')]};return db['SquareMessage'][_0x8026('0x1e')](_0x1b13e0)[_0x8026('0x21')](function(_0x460e28){_0x5928bc[_0x8026('0x1e')]=_0x460e28;if(_0x414eca[_0x8026('0x2e')][_0x8026('0x40')]){_0x558ff7[_0x8026('0x41')]=[{'all':!![]}];}return db[_0x8026('0x28')][_0x8026('0x42')](_0x558ff7);})[_0x8026('0x21')](function(_0x404037){_0x5928bc[_0x8026('0x43')]=_0x404037;return _0x5928bc;})[_0x8026('0x21')](respondWithFilteredResult(_0x37a555,_0x558ff7))[_0x8026('0x44')](handleError(_0x37a555,null));};exports['show']=function(_0x2010fb,_0x3d487d){var _0x5c861b={'raw':!![],'where':{'id':_0x2010fb[_0x8026('0x45')]['id']}},_0x27616a={};_0x27616a[_0x8026('0x2d')]=_[_0x8026('0x2f')](db[_0x8026('0x28')]['rawAttributes']);_0x27616a[_0x8026('0x2e')]=_[_0x8026('0x2f')](_0x2010fb[_0x8026('0x2e')]);_0x27616a[_0x8026('0x3b')]=_[_0x8026('0x30')](_0x27616a['model'],_0x27616a[_0x8026('0x2e')]);_0x5c861b['attributes']=_[_0x8026('0x30')](_0x27616a[_0x8026('0x2d')],qs[_0x8026('0x31')](_0x2010fb['query'][_0x8026('0x31')]));_0x5c861b[_0x8026('0x32')]=_0x5c861b[_0x8026('0x32')][_0x8026('0x33')]?_0x5c861b[_0x8026('0x32')]:_0x27616a[_0x8026('0x2d')];if(_0x2010fb['query'][_0x8026('0x40')]){_0x5c861b[_0x8026('0x41')]=[{'all':!![]}];}_0x5c861b=_[_0x8026('0x3e')]({},_0x5c861b,_0x2010fb['options']);return db[_0x8026('0x28')][_0x8026('0x46')](_0x5c861b)[_0x8026('0x21')](handleEntityNotFound(_0x3d487d,null))[_0x8026('0x21')](respondWithResult(_0x3d487d,null))[_0x8026('0x44')](handleError(_0x3d487d,null));};exports[_0x8026('0x47')]=function(_0x41121,_0x582980){return db[_0x8026('0x28')][_0x8026('0x47')](_0x41121[_0x8026('0x48')],{})[_0x8026('0x21')](respondWithResult(_0x582980,0xc9))[_0x8026('0x44')](handleError(_0x582980,null));};exports['update']=function(_0x58cad4,_0x5c6f74){if(_0x58cad4['body']['id']){delete _0x58cad4[_0x8026('0x48')]['id'];}return db[_0x8026('0x28')][_0x8026('0x46')]({'where':{'id':_0x58cad4[_0x8026('0x45')]['id']}})[_0x8026('0x21')](handleEntityNotFound(_0x5c6f74,null))['then'](saveUpdates(_0x58cad4[_0x8026('0x48')],null))[_0x8026('0x21')](respondWithResult(_0x5c6f74,null))[_0x8026('0x44')](handleError(_0x5c6f74,null));};exports[_0x8026('0x22')]=function(_0x2cc4b3,_0x3439a2){return db[_0x8026('0x28')]['find']({'where':{'id':_0x2cc4b3[_0x8026('0x45')]['id']}})[_0x8026('0x21')](handleEntityNotFound(_0x3439a2,null))[_0x8026('0x21')](removeEntity(_0x3439a2,null))[_0x8026('0x44')](handleError(_0x3439a2,null));}; \ No newline at end of file +var _0xa1cc=['ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareMessage','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x3cf84c,_0x343e87){var _0x17ade1=function(_0x1df8a9){while(--_0x1df8a9){_0x3cf84c['push'](_0x3cf84c['shift']());}};_0x17ade1(++_0x343e87);}(_0xa1cc,0x10f));var _0xca1c=function(_0x18f443,_0x5e41d5){_0x18f443=_0x18f443-0x0;var _0x3f6991=_0xa1cc[_0x18f443];return _0x3f6991;};'use strict';var emlformat=require(_0xca1c('0x0'));var rimraf=require(_0xca1c('0x1'));var zipdir=require(_0xca1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca1c('0x3'));var moment=require(_0xca1c('0x4'));var BPromise=require(_0xca1c('0x5'));var Mustache=require('mustache');var util=require(_0xca1c('0x6'));var path=require('path');var sox=require(_0xca1c('0x7'));var csv=require(_0xca1c('0x8'));var ejs=require(_0xca1c('0x9'));var fs=require('fs');var fs_extra=require(_0xca1c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xca1c('0xb'));var jsforce=require(_0xca1c('0xc'));var deskjs=require(_0xca1c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca1c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xca1c('0xf'));var as=require(_0xca1c('0x10'));var hardwareService=require(_0xca1c('0x11'));var logger=require(_0xca1c('0x12'))(_0xca1c('0x13'));var utils=require('../../config/utils');var config=require(_0xca1c('0x14'));var licenseUtil=require(_0xca1c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3029fd,_0x5d60df){_0x5d60df=_0x5d60df||0xcc;return function(_0x292272){if(_0x292272){return _0x3029fd[_0xca1c('0x16')](_0x5d60df);}return _0x3029fd[_0xca1c('0x17')](_0x5d60df)['end']();};}function respondWithResult(_0x344d4c,_0x222a56){_0x222a56=_0x222a56||0xc8;return function(_0x5c7c21){if(_0x5c7c21){return _0x344d4c['status'](_0x222a56)[_0xca1c('0x18')](_0x5c7c21);}};}function respondWithFilteredResult(_0x2b55fd,_0x196a66){return function(_0x18e6ac){if(_0x18e6ac){var _0x2644f0=typeof _0x196a66[_0xca1c('0x19')]===_0xca1c('0x1a')&&typeof _0x196a66[_0xca1c('0x1b')]===_0xca1c('0x1a');var _0x882fd4=_0x18e6ac[_0xca1c('0x1c')];var _0x10b126=_0x2644f0?0x0:_0x196a66[_0xca1c('0x19')];var _0x447547=_0x2644f0?_0x18e6ac[_0xca1c('0x1c')]:_0x196a66[_0xca1c('0x19')]+_0x196a66['limit'];var _0x1b2d8d;if(_0x447547>=_0x882fd4){_0x447547=_0x882fd4;_0x1b2d8d=0xc8;}else{_0x1b2d8d=0xce;}_0x2b55fd[_0xca1c('0x17')](_0x1b2d8d);return _0x2b55fd['set']('Content-Range',_0x10b126+'-'+_0x447547+'/'+_0x882fd4)[_0xca1c('0x18')](_0x18e6ac);}return null;};}function patchUpdates(_0x10f801){return function(_0x31aa79){try{jsonpatch[_0xca1c('0x1d')](_0x31aa79,_0x10f801,!![]);}catch(_0x140e90){return BPromise[_0xca1c('0x1e')](_0x140e90);}return _0x31aa79[_0xca1c('0x1f')]();};}function saveUpdates(_0x5d23ac,_0x115b4d){return function(_0x540596){if(_0x540596){return _0x540596[_0xca1c('0x20')](_0x5d23ac)[_0xca1c('0x21')](function(_0x3fac0d){return _0x3fac0d;});}return null;};}function removeEntity(_0x40b169,_0x5f2d76){return function(_0x1c06dc){if(_0x1c06dc){return _0x1c06dc[_0xca1c('0x22')]()['then'](function(){_0x40b169[_0xca1c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1639da,_0x13ff50){return function(_0x2868c4){if(!_0x2868c4){_0x1639da[_0xca1c('0x16')](0x194);}return _0x2868c4;};}function handleError(_0x4aacb8,_0x1c3056){_0x1c3056=_0x1c3056||0x1f4;return function(_0xa1a686){logger[_0xca1c('0x23')](_0xa1a686[_0xca1c('0x24')]);if(_0xa1a686[_0xca1c('0x25')]){delete _0xa1a686[_0xca1c('0x25')];}_0x4aacb8[_0xca1c('0x17')](_0x1c3056)['send'](_0xa1a686);};}exports[_0xca1c('0x26')]=function(_0x5408c6,_0x573fc){var _0x31042a={},_0x4a2406={},_0xb2db36={'count':0x0,'rows':[]};var _0x3ffa43=_[_0xca1c('0x27')](db[_0xca1c('0x28')]['rawAttributes'],function(_0x404579){return{'name':_0x404579[_0xca1c('0x29')],'type':_0x404579[_0xca1c('0x2a')][_0xca1c('0x2b')]};});_0x4a2406['model']=_[_0xca1c('0x27')](_0x3ffa43,'name');_0x4a2406['query']=_[_0xca1c('0x2c')](_0x5408c6[_0xca1c('0x2d')]);_0x4a2406[_0xca1c('0x2e')]=_[_0xca1c('0x2f')](_0x4a2406[_0xca1c('0x30')],_0x4a2406['query']);_0x31042a['attributes']=_[_0xca1c('0x2f')](_0x4a2406[_0xca1c('0x30')],qs[_0xca1c('0x31')](_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x31')]));_0x31042a['attributes']=_0x31042a[_0xca1c('0x32')]['length']?_0x31042a[_0xca1c('0x32')]:_0x4a2406[_0xca1c('0x30')];if(!_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x33')]('nolimit')){_0x31042a[_0xca1c('0x1b')]=qs[_0xca1c('0x1b')](_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x1b')]);_0x31042a[_0xca1c('0x19')]=qs[_0xca1c('0x19')](_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x19')]);}_0x31042a[_0xca1c('0x34')]=qs[_0xca1c('0x35')](_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x35')]);_0x31042a['where']=qs[_0xca1c('0x2e')](_[_0xca1c('0x36')](_0x5408c6['query'],_0x4a2406[_0xca1c('0x2e')]),_0x3ffa43);if(_0x5408c6[_0xca1c('0x2d')]['filter']){_0x31042a[_0xca1c('0x37')]=_[_0xca1c('0x38')](_0x31042a[_0xca1c('0x37')],{'$or':_['map'](_0x3ffa43,function(_0x2f3a87){if(_0x2f3a87[_0xca1c('0x2a')]!=='VIRTUAL'){var _0x2ffdab={};_0x2ffdab[_0x2f3a87['name']]={'$like':'%'+_0x5408c6['query'][_0xca1c('0x39')]+'%'};return _0x2ffdab;}})});}_0x31042a=_[_0xca1c('0x38')]({},_0x31042a,_0x5408c6[_0xca1c('0x3a')]);var _0x56e943={'where':_0x31042a[_0xca1c('0x37')]};return db[_0xca1c('0x28')][_0xca1c('0x1c')](_0x56e943)[_0xca1c('0x21')](function(_0x2c37b8){_0xb2db36[_0xca1c('0x1c')]=_0x2c37b8;if(_0x5408c6[_0xca1c('0x2d')][_0xca1c('0x3b')]){_0x31042a[_0xca1c('0x3c')]=[{'all':!![]}];}return db[_0xca1c('0x28')][_0xca1c('0x3d')](_0x31042a);})[_0xca1c('0x21')](function(_0x15fd6f){_0xb2db36[_0xca1c('0x3e')]=_0x15fd6f;return _0xb2db36;})[_0xca1c('0x21')](respondWithFilteredResult(_0x573fc,_0x31042a))[_0xca1c('0x3f')](handleError(_0x573fc,null));};exports['show']=function(_0x248722,_0x3f81ae){var _0x55fb2a={'raw':!![],'where':{'id':_0x248722[_0xca1c('0x40')]['id']}},_0x34609c={};_0x34609c[_0xca1c('0x30')]=_[_0xca1c('0x2c')](db[_0xca1c('0x28')][_0xca1c('0x41')]);_0x34609c[_0xca1c('0x2d')]=_['keys'](_0x248722['query']);_0x34609c[_0xca1c('0x2e')]=_[_0xca1c('0x2f')](_0x34609c[_0xca1c('0x30')],_0x34609c['query']);_0x55fb2a[_0xca1c('0x32')]=_[_0xca1c('0x2f')](_0x34609c['model'],qs[_0xca1c('0x31')](_0x248722[_0xca1c('0x2d')][_0xca1c('0x31')]));_0x55fb2a[_0xca1c('0x32')]=_0x55fb2a['attributes'][_0xca1c('0x42')]?_0x55fb2a['attributes']:_0x34609c[_0xca1c('0x30')];if(_0x248722['query'][_0xca1c('0x3b')]){_0x55fb2a[_0xca1c('0x3c')]=[{'all':!![]}];}_0x55fb2a=_['merge']({},_0x55fb2a,_0x248722['options']);return db[_0xca1c('0x28')][_0xca1c('0x43')](_0x55fb2a)[_0xca1c('0x21')](handleEntityNotFound(_0x3f81ae,null))[_0xca1c('0x21')](respondWithResult(_0x3f81ae,null))[_0xca1c('0x3f')](handleError(_0x3f81ae,null));};exports[_0xca1c('0x44')]=function(_0x26d107,_0x227a80){return db['SquareMessage'][_0xca1c('0x44')](_0x26d107[_0xca1c('0x45')],{})[_0xca1c('0x21')](respondWithResult(_0x227a80,0xc9))[_0xca1c('0x3f')](handleError(_0x227a80,null));};exports[_0xca1c('0x20')]=function(_0x166d45,_0x26c8cf){if(_0x166d45[_0xca1c('0x45')]['id']){delete _0x166d45[_0xca1c('0x45')]['id'];}return db[_0xca1c('0x28')][_0xca1c('0x43')]({'where':{'id':_0x166d45['params']['id']}})[_0xca1c('0x21')](handleEntityNotFound(_0x26c8cf,null))[_0xca1c('0x21')](saveUpdates(_0x166d45[_0xca1c('0x45')],null))['then'](respondWithResult(_0x26c8cf,null))['catch'](handleError(_0x26c8cf,null));};exports[_0xca1c('0x22')]=function(_0x43c0c1,_0x2b4eb4){return db['SquareMessage']['find']({'where':{'id':_0x43c0c1[_0xca1c('0x40')]['id']}})[_0xca1c('0x21')](handleEntityNotFound(_0x2b4eb4,null))['then'](removeEntity(_0x2b4eb4,null))[_0xca1c('0x3f')](handleError(_0x2b4eb4,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4846fd5..130d618 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 _0xa610=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x50aaf0,_0x570b36){var _0x425591=function(_0x5f3e7d){while(--_0x5f3e7d){_0x50aaf0['push'](_0x50aaf0['shift']());}};_0x425591(++_0x570b36);}(_0xa610,0xe7));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a61('0x0'));var util=require(_0x0a61('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a61('0x2'));var rp=require(_0x0a61('0x3'));var fs=require('fs');var path=require(_0x0a61('0x4'));var rimraf=require(_0x0a61('0x5'));var config=require(_0x0a61('0x6'));var attributes=require(_0x0a61('0x7'));module[_0x0a61('0x8')]=function(_0x37bd67,_0x2299ae){return _0x37bd67[_0x0a61('0x9')](_0x0a61('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x990a=['./squareMessage.attributes','SquareMessage','square_messages','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x990a,0x111));var _0xa990=function(_0x4bd1ae,_0xbc16fa){_0x4bd1ae=_0x4bd1ae-0x0;var _0x252bde=_0x990a[_0x4bd1ae];return _0x252bde;};'use strict';var _=require(_0xa990('0x0'));var util=require(_0xa990('0x1'));var logger=require('../../config/logger')(_0xa990('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa990('0x3'));var fs=require('fs');var path=require(_0xa990('0x4'));var rimraf=require(_0xa990('0x5'));var config=require(_0xa990('0x6'));var attributes=require(_0xa990('0x7'));module['exports']=function(_0x3d3228,_0x50003e){return _0x3d3228['define'](_0xa990('0x8'),attributes,{'tableName':_0xa990('0x9'),'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 2439667..1c8d2f5 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 _0xeeb2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','CreateSquareMessage','SquareMessage','body','options','raw','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xeeb2,0xb8));var _0x2eeb=function(_0x4da4ea,_0x2875d3){_0x4da4ea=_0x4da4ea-0x0;var _0x3cc102=_0xeeb2[_0x4da4ea];return _0x3cc102;};'use strict';var _=require(_0x2eeb('0x0'));var util=require(_0x2eeb('0x1'));var moment=require(_0x2eeb('0x2'));var BPromise=require(_0x2eeb('0x3'));var rs=require(_0x2eeb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2eeb('0x5'))['db'];var utils=require(_0x2eeb('0x6'));var logger=require(_0x2eeb('0x7'))(_0x2eeb('0x8'));var config=require(_0x2eeb('0x9'));var jayson=require(_0x2eeb('0xa'));var client=jayson[_0x2eeb('0xb')][_0x2eeb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f12f0,_0x3b5781,_0x479419){return new BPromise(function(_0x5d3229,_0x159484){return client['request'](_0x5f12f0,_0x479419)[_0x2eeb('0xd')](function(_0x449d3d){logger['info'](_0x2eeb('0xe'),_0x3b5781,_0x2eeb('0xf'));logger[_0x2eeb('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3b5781,_0x2eeb('0xf'),JSON[_0x2eeb('0x11')](_0x449d3d));if(_0x449d3d['error']){if(_0x449d3d['error']['code']===0x1f4){logger[_0x2eeb('0x12')](_0x2eeb('0xe'),_0x3b5781,_0x449d3d[_0x2eeb('0x12')][_0x2eeb('0x13')]);return _0x159484(_0x449d3d[_0x2eeb('0x12')][_0x2eeb('0x13')]);}logger[_0x2eeb('0x12')](_0x2eeb('0xe'),_0x3b5781,_0x449d3d[_0x2eeb('0x12')][_0x2eeb('0x13')]);return _0x5d3229(_0x449d3d['error']['message']);}else{logger[_0x2eeb('0x14')]('SquareMessage,\x20%s,\x20%s',_0x3b5781,_0x2eeb('0xf'));_0x5d3229(_0x449d3d['result'][_0x2eeb('0x13')]);}})['catch'](function(_0x514401){logger[_0x2eeb('0x12')]('SquareMessage,\x20%s,\x20%s',_0x3b5781,_0x514401);_0x159484(_0x514401);});});}exports[_0x2eeb('0x15')]=function(_0x1ee5be){var _0x5bc798=this;return new Promise(function(_0x2fa825,_0x52bd43){return db[_0x2eeb('0x16')]['create'](_0x1ee5be[_0x2eeb('0x17')],{'raw':_0x1ee5be['options']?_0x1ee5be[_0x2eeb('0x18')][_0x2eeb('0x19')]===undefined?!![]:![]:!![]})[_0x2eeb('0xd')](function(_0x5b8ce8){logger[_0x2eeb('0x14')](_0x2eeb('0x15'),_0x1ee5be);logger[_0x2eeb('0x10')](_0x2eeb('0x15'),_0x1ee5be,JSON['stringify'](_0x5b8ce8));_0x2fa825(_0x5b8ce8);})[_0x2eeb('0x1a')](function(_0x27d6c1){logger[_0x2eeb('0x12')](_0x2eeb('0x15'),_0x27d6c1[_0x2eeb('0x13')],_0x1ee5be);_0x52bd43(_0x5bc798[_0x2eeb('0x12')](0x1f4,_0x27d6c1['message']));});});}; \ No newline at end of file +var _0x79e0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','body','options','raw'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79e0,0x1b3));var _0x079e=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x79e0[_0x214a25];return _0x405988;};'use strict';var _=require(_0x079e('0x0'));var util=require(_0x079e('0x1'));var moment=require(_0x079e('0x2'));var BPromise=require(_0x079e('0x3'));var rs=require(_0x079e('0x4'));var fs=require('fs');var Redis=require(_0x079e('0x5'));var db=require(_0x079e('0x6'))['db'];var utils=require(_0x079e('0x7'));var logger=require(_0x079e('0x8'))(_0x079e('0x9'));var config=require(_0x079e('0xa'));var jayson=require(_0x079e('0xb'));var client=jayson[_0x079e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x291a5a,_0x6ee728,_0x5c3b59){return new BPromise(function(_0x23a6ba,_0x241a0d){return client['request'](_0x291a5a,_0x5c3b59)[_0x079e('0xd')](function(_0x2e6cee){logger['info'](_0x079e('0xe'),_0x6ee728,_0x079e('0xf'));logger[_0x079e('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x6ee728,_0x079e('0xf'),JSON[_0x079e('0x11')](_0x2e6cee));if(_0x2e6cee['error']){if(_0x2e6cee[_0x079e('0x12')][_0x079e('0x13')]===0x1f4){logger['error'](_0x079e('0xe'),_0x6ee728,_0x2e6cee['error'][_0x079e('0x14')]);return _0x241a0d(_0x2e6cee[_0x079e('0x12')]['message']);}logger['error'](_0x079e('0xe'),_0x6ee728,_0x2e6cee['error']['message']);return _0x23a6ba(_0x2e6cee[_0x079e('0x12')][_0x079e('0x14')]);}else{logger[_0x079e('0x15')](_0x079e('0xe'),_0x6ee728,'request\x20sent');_0x23a6ba(_0x2e6cee[_0x079e('0x16')]['message']);}})[_0x079e('0x17')](function(_0x1aa44d){logger[_0x079e('0x12')](_0x079e('0xe'),_0x6ee728,_0x1aa44d);_0x241a0d(_0x1aa44d);});});}exports[_0x079e('0x18')]=function(_0x1c8b52){var _0xf3c96a=this;return new Promise(function(_0x31d255,_0x37ab3b){return db[_0x079e('0x19')]['create'](_0x1c8b52[_0x079e('0x1a')],{'raw':_0x1c8b52[_0x079e('0x1b')]?_0x1c8b52['options'][_0x079e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5bf494){logger[_0x079e('0x15')](_0x079e('0x18'),_0x1c8b52);logger[_0x079e('0x10')]('CreateSquareMessage',_0x1c8b52,JSON[_0x079e('0x11')](_0x5bf494));_0x31d255(_0x5bf494);})[_0x079e('0x17')](function(_0xd6ca7f){logger['error']('CreateSquareMessage',_0xd6ca7f[_0x079e('0x14')],_0x1c8b52);_0x37ab3b(_0xf3c96a[_0x079e('0x12')](0x1f4,_0xd6ca7f[_0x079e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ece04a4..d9be8cf 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 _0x6312=['create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','15s','test','post'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x6312,0xd7));var _0x2631=function(_0x3c5276,_0x2739d7){_0x3c5276=_0x3c5276-0x0;var _0x9a9c2=_0x6312[_0x3c5276];return _0x9a9c2;};'use strict';var multer=require('multer');var util=require(_0x2631('0x0'));var path=require(_0x2631('0x1'));var timeout=require(_0x2631('0x2'));var express=require('express');var router=express[_0x2631('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2631('0x4'));var interaction=require(_0x2631('0x5'));var config=require(_0x2631('0x6'));var controller=require(_0x2631('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2631('0x8')](_0x2631('0x9'),auth[_0x2631('0xa')](),controller[_0x2631('0xb')]);router[_0x2631('0x8')](_0x2631('0xc'),auth['isAuthenticated'](),timeout(_0x2631('0xd')),controller[_0x2631('0xe')]);router[_0x2631('0xf')]('/',auth['isAuthenticated'](),controller[_0x2631('0x10')]);router[_0x2631('0x11')](_0x2631('0x9'),auth[_0x2631('0xa')](),controller[_0x2631('0x12')]);router[_0x2631('0x13')](_0x2631('0x9'),auth[_0x2631('0xa')](),controller[_0x2631('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6d94=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put','update'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6d94,0x7b));var _0x46d9=function(_0x223221,_0x5b614a){_0x223221=_0x223221-0x0;var _0x5e9e7c=_0x6d94[_0x223221];return _0x5e9e7c;};'use strict';var multer=require(_0x46d9('0x0'));var util=require(_0x46d9('0x1'));var path=require(_0x46d9('0x2'));var timeout=require(_0x46d9('0x3'));var express=require(_0x46d9('0x4'));var router=express[_0x46d9('0x5')]();var fs_extra=require(_0x46d9('0x6'));var auth=require(_0x46d9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x46d9('0x8'));var controller=require(_0x46d9('0x9'));router[_0x46d9('0xa')]('/',auth[_0x46d9('0xb')](),controller[_0x46d9('0xc')]);router[_0x46d9('0xa')](_0x46d9('0xd'),auth[_0x46d9('0xb')](),controller[_0x46d9('0xe')]);router[_0x46d9('0xa')](_0x46d9('0xf'),auth[_0x46d9('0xb')](),timeout(_0x46d9('0x10')),controller[_0x46d9('0x11')]);router[_0x46d9('0x12')]('/',auth[_0x46d9('0xb')](),controller['create']);router[_0x46d9('0x13')](_0x46d9('0xd'),auth[_0x46d9('0xb')](),controller[_0x46d9('0x14')]);router[_0x46d9('0x15')](_0x46d9('0xd'),auth[_0x46d9('0xb')](),controller[_0x46d9('0x16')]);module[_0x46d9('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 57e9036..d14e228 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 _0x736e=['sequelize','exports','name','STRING'];(function(_0x3ad2e5,_0x94d414){var _0xc4e565=function(_0x2c96e3){while(--_0x2c96e3){_0x3ad2e5['push'](_0x3ad2e5['shift']());}};_0xc4e565(++_0x94d414);}(_0x736e,0x12c));var _0xe736=function(_0x529601,_0x3d3f9e){_0x529601=_0x529601-0x0;var _0xe609=_0x736e[_0x529601];return _0xe609;};'use strict';var Sequelize=require(_0xe736('0x0'));module[_0xe736('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe736('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe736('0x3')]},'description':{'type':Sequelize[_0xe736('0x3')]}}; \ No newline at end of file +var _0x9bfd=['STRING','sequelize','name'];(function(_0x242876,_0x40c095){var _0x2e2718=function(_0x335d22){while(--_0x335d22){_0x242876['push'](_0x242876['shift']());}};_0x2e2718(++_0x40c095);}(_0x9bfd,0x1db));var _0xd9bf=function(_0x3fa61a,_0x3a9ffc){_0x3fa61a=_0x3fa61a-0x0;var _0x130630=_0x9bfd[_0x3fa61a];return _0x130630;};'use strict';var Sequelize=require(_0xd9bf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd9bf('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd9bf('0x2')]},'description':{'type':Sequelize[_0xd9bf('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 293e981..9248cdc 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 _0x9b0f=['then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','show','keys','includeAll','find','catch','create','body','role','user','UserProfileSection','userProfileId','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update'];(function(_0xc8bcf9,_0x30b65e){var _0x460138=function(_0x35f431){while(--_0x35f431){_0xc8bcf9['push'](_0xc8bcf9['shift']());}};_0x460138(++_0x30b65e);}(_0x9b0f,0x8b));var _0xf9b0=function(_0x4e3aaa,_0x10144b){_0x4e3aaa=_0x4e3aaa-0x0;var _0x586431=_0x9b0f[_0x4e3aaa];return _0x586431;};'use strict';var emlformat=require(_0xf9b0('0x0'));var rimraf=require(_0xf9b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9b0('0x2'));var rp=require(_0xf9b0('0x3'));var moment=require(_0xf9b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf9b0('0x5'));var util=require('util');var path=require(_0xf9b0('0x6'));var sox=require(_0xf9b0('0x7'));var csv=require(_0xf9b0('0x8'));var ejs=require(_0xf9b0('0x9'));var fs=require('fs');var fs_extra=require(_0xf9b0('0xa'));var _=require(_0xf9b0('0xb'));var squel=require(_0xf9b0('0xc'));var crypto=require(_0xf9b0('0xd'));var jsforce=require(_0xf9b0('0xe'));var deskjs=require(_0xf9b0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf9b0('0x10'));var Papa=require(_0xf9b0('0x11'));var Redis=require(_0xf9b0('0x12'));var authService=require(_0xf9b0('0x13'));var qs=require(_0xf9b0('0x14'));var as=require(_0xf9b0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9b0('0x16'))(_0xf9b0('0x17'));var utils=require(_0xf9b0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf9b0('0x19'));var db=require(_0xf9b0('0x1a'))['db'];function respondWithStatusCode(_0x227519,_0x55b529){_0x55b529=_0x55b529||0xcc;return function(_0x874a97){if(_0x874a97){return _0x227519[_0xf9b0('0x1b')](_0x55b529);}return _0x227519[_0xf9b0('0x1c')](_0x55b529)[_0xf9b0('0x1d')]();};}function respondWithResult(_0x24dc7c,_0x2fa270){_0x2fa270=_0x2fa270||0xc8;return function(_0x7a9ce0){if(_0x7a9ce0){return _0x24dc7c[_0xf9b0('0x1c')](_0x2fa270)[_0xf9b0('0x1e')](_0x7a9ce0);}};}function respondWithFilteredResult(_0x291081,_0x23ee19){return function(_0xac7904){if(_0xac7904){var _0x25925f=typeof _0x23ee19['offset']===_0xf9b0('0x1f')&&typeof _0x23ee19[_0xf9b0('0x20')]===_0xf9b0('0x1f');var _0x5ea94a=_0xac7904[_0xf9b0('0x21')];var _0x405805=_0x25925f?0x0:_0x23ee19[_0xf9b0('0x22')];var _0x17ed4b=_0x25925f?_0xac7904['count']:_0x23ee19[_0xf9b0('0x22')]+_0x23ee19['limit'];var _0x702d5d;if(_0x17ed4b>=_0x5ea94a){_0x17ed4b=_0x5ea94a;_0x702d5d=0xc8;}else{_0x702d5d=0xce;}_0x291081[_0xf9b0('0x1c')](_0x702d5d);return _0x291081[_0xf9b0('0x23')](_0xf9b0('0x24'),_0x405805+'-'+_0x17ed4b+'/'+_0x5ea94a)[_0xf9b0('0x1e')](_0xac7904);}return null;};}function patchUpdates(_0x168cfd){return function(_0x162fd9){try{jsonpatch['apply'](_0x162fd9,_0x168cfd,!![]);}catch(_0x5a3366){return BPromise['reject'](_0x5a3366);}return _0x162fd9[_0xf9b0('0x25')]();};}function saveUpdates(_0x4810ab,_0x1c9f96){return function(_0x4b9b33){if(_0x4b9b33){return _0x4b9b33[_0xf9b0('0x26')](_0x4810ab)[_0xf9b0('0x27')](function(_0x3cfd75){return _0x3cfd75;});}return null;};}function removeEntity(_0x548de5,_0x3141ad){return function(_0x104c78){if(_0x104c78){return _0x104c78[_0xf9b0('0x28')]()[_0xf9b0('0x27')](function(){var _0x605331=_0x104c78[_0xf9b0('0x29')]({'plain':!![]});var _0x10dd2d=_0xf9b0('0x2a');return db[_0xf9b0('0x2b')][_0xf9b0('0x28')]({'where':{'type':_0x10dd2d,'resourceId':_0x605331['id']}})[_0xf9b0('0x27')](function(){return _0x104c78;});})[_0xf9b0('0x27')](function(){_0x548de5[_0xf9b0('0x1c')](0xcc)[_0xf9b0('0x1d')]();});}};}function handleEntityNotFound(_0x5e8e6c,_0x194c73){return function(_0xb34014){if(!_0xb34014){_0x5e8e6c[_0xf9b0('0x1b')](0x194);}return _0xb34014;};}function handleError(_0x5e967d,_0x560835){_0x560835=_0x560835||0x1f4;return function(_0x192e19){logger[_0xf9b0('0x2c')](_0x192e19[_0xf9b0('0x2d')]);if(_0x192e19['name']){delete _0x192e19[_0xf9b0('0x2e')];}_0x5e967d[_0xf9b0('0x1c')](_0x560835)[_0xf9b0('0x2f')](_0x192e19);};}exports[_0xf9b0('0x30')]=function(_0x23491e,_0x331cc2){var _0x475d8c={},_0x13ec49={},_0x5af61d={'count':0x0,'rows':[]};var _0x172975=_[_0xf9b0('0x31')](db[_0xf9b0('0x32')][_0xf9b0('0x33')],function(_0x51c1a1){return{'name':_0x51c1a1[_0xf9b0('0x34')],'type':_0x51c1a1[_0xf9b0('0x35')]['key']};});_0x13ec49[_0xf9b0('0x36')]=_['map'](_0x172975,_0xf9b0('0x2e'));_0x13ec49[_0xf9b0('0x37')]=_['keys'](_0x23491e[_0xf9b0('0x37')]);_0x13ec49[_0xf9b0('0x38')]=_[_0xf9b0('0x39')](_0x13ec49[_0xf9b0('0x36')],_0x13ec49[_0xf9b0('0x37')]);_0x475d8c[_0xf9b0('0x3a')]=_['intersection'](_0x13ec49[_0xf9b0('0x36')],qs[_0xf9b0('0x3b')](_0x23491e[_0xf9b0('0x37')][_0xf9b0('0x3b')]));_0x475d8c[_0xf9b0('0x3a')]=_0x475d8c[_0xf9b0('0x3a')][_0xf9b0('0x3c')]?_0x475d8c[_0xf9b0('0x3a')]:_0x13ec49[_0xf9b0('0x36')];if(!_0x23491e[_0xf9b0('0x37')][_0xf9b0('0x3d')](_0xf9b0('0x3e'))){_0x475d8c['limit']=qs[_0xf9b0('0x20')](_0x23491e[_0xf9b0('0x37')][_0xf9b0('0x20')]);_0x475d8c[_0xf9b0('0x22')]=qs[_0xf9b0('0x22')](_0x23491e['query'][_0xf9b0('0x22')]);}_0x475d8c[_0xf9b0('0x3f')]=qs[_0xf9b0('0x40')](_0x23491e[_0xf9b0('0x37')][_0xf9b0('0x40')]);_0x475d8c[_0xf9b0('0x41')]=qs[_0xf9b0('0x38')](_[_0xf9b0('0x42')](_0x23491e[_0xf9b0('0x37')],_0x13ec49[_0xf9b0('0x38')]),_0x172975);if(_0x23491e[_0xf9b0('0x37')]['filter']){_0x475d8c[_0xf9b0('0x41')]=_[_0xf9b0('0x43')](_0x475d8c[_0xf9b0('0x41')],{'$or':_[_0xf9b0('0x31')](_0x172975,function(_0x1c83a3){if(_0x1c83a3[_0xf9b0('0x35')]!==_0xf9b0('0x44')){var _0x485ddf={};_0x485ddf[_0x1c83a3[_0xf9b0('0x2e')]]={'$like':'%'+_0x23491e[_0xf9b0('0x37')][_0xf9b0('0x45')]+'%'};return _0x485ddf;}})});}_0x475d8c=_[_0xf9b0('0x43')]({},_0x475d8c,_0x23491e['options']);var _0xf199c2={'where':_0x475d8c[_0xf9b0('0x41')]};return db[_0xf9b0('0x32')]['count'](_0xf199c2)[_0xf9b0('0x27')](function(_0x54bb75){_0x5af61d[_0xf9b0('0x21')]=_0x54bb75;if(_0x23491e[_0xf9b0('0x37')]['includeAll']){_0x475d8c[_0xf9b0('0x46')]=[{'all':!![]}];}return db[_0xf9b0('0x32')]['findAll'](_0x475d8c);})[_0xf9b0('0x27')](function(_0x45fa3e){_0x5af61d[_0xf9b0('0x47')]=_0x45fa3e;return _0x5af61d;})[_0xf9b0('0x27')](respondWithFilteredResult(_0x331cc2,_0x475d8c))['catch'](handleError(_0x331cc2,null));};exports[_0xf9b0('0x48')]=function(_0x309a7e,_0x19995e){var _0x244271={'raw':!![],'where':{'id':_0x309a7e['params']['id']}},_0x3b57ee={};_0x3b57ee[_0xf9b0('0x36')]=_[_0xf9b0('0x49')](db[_0xf9b0('0x32')][_0xf9b0('0x33')]);_0x3b57ee[_0xf9b0('0x37')]=_['keys'](_0x309a7e[_0xf9b0('0x37')]);_0x3b57ee['filters']=_[_0xf9b0('0x39')](_0x3b57ee[_0xf9b0('0x36')],_0x3b57ee['query']);_0x244271[_0xf9b0('0x3a')]=_[_0xf9b0('0x39')](_0x3b57ee[_0xf9b0('0x36')],qs[_0xf9b0('0x3b')](_0x309a7e[_0xf9b0('0x37')][_0xf9b0('0x3b')]));_0x244271[_0xf9b0('0x3a')]=_0x244271[_0xf9b0('0x3a')]['length']?_0x244271['attributes']:_0x3b57ee[_0xf9b0('0x36')];if(_0x309a7e[_0xf9b0('0x37')][_0xf9b0('0x4a')]){_0x244271['include']=[{'all':!![]}];}_0x244271=_[_0xf9b0('0x43')]({},_0x244271,_0x309a7e['options']);return db[_0xf9b0('0x32')][_0xf9b0('0x4b')](_0x244271)[_0xf9b0('0x27')](handleEntityNotFound(_0x19995e,null))['then'](respondWithResult(_0x19995e,null))[_0xf9b0('0x4c')](handleError(_0x19995e,null));};exports[_0xf9b0('0x4d')]=function(_0x3e8b62,_0x5932be){return db[_0xf9b0('0x32')]['create'](_0x3e8b62[_0xf9b0('0x4e')],{})[_0xf9b0('0x27')](function(_0x3e357b){var _0x502111=_0x3e8b62['user']['get']({'plain':!![]});if(!_0x502111)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502111[_0xf9b0('0x4f')]===_0xf9b0('0x50')){var _0xe6d2cc=_0x3e357b[_0xf9b0('0x29')]({'plain':!![]});var _0x44890a=_0xf9b0('0x2a');return db[_0xf9b0('0x51')][_0xf9b0('0x4b')]({'where':{'name':_0x44890a,'userProfileId':_0x502111[_0xf9b0('0x52')]},'raw':!![]})[_0xf9b0('0x27')](function(_0x3b0635){if(_0x3b0635&&_0x3b0635['autoAssociation']===0x0){return db[_0xf9b0('0x2b')]['create']({'name':_0xe6d2cc['name'],'resourceId':_0xe6d2cc['id'],'type':_0x3b0635[_0xf9b0('0x2e')],'sectionId':_0x3b0635['id']},{})[_0xf9b0('0x27')](function(){return _0x3e357b;});}else{return _0x3e357b;}})[_0xf9b0('0x4c')](function(_0x1b7b2f){logger[_0xf9b0('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7b2f);throw _0x1b7b2f;});}return _0x3e357b;})[_0xf9b0('0x27')](respondWithResult(_0x5932be,0xc9))[_0xf9b0('0x4c')](handleError(_0x5932be,null));};exports[_0xf9b0('0x26')]=function(_0x26c748,_0x58b195){if(_0x26c748[_0xf9b0('0x4e')]['id']){delete _0x26c748['body']['id'];}return db[_0xf9b0('0x32')][_0xf9b0('0x4b')]({'where':{'id':_0x26c748['params']['id']}})[_0xf9b0('0x27')](handleEntityNotFound(_0x58b195,null))['then'](saveUpdates(_0x26c748[_0xf9b0('0x4e')],null))['then'](respondWithResult(_0x58b195,null))['catch'](handleError(_0x58b195,null));};exports[_0xf9b0('0x28')]=function(_0x1d7192,_0x108211){return db[_0xf9b0('0x32')][_0xf9b0('0x4b')]({'where':{'id':_0x1d7192[_0xf9b0('0x53')]['id']}})[_0xf9b0('0x27')](handleEntityNotFound(_0x108211,null))[_0xf9b0('0x27')](removeEntity(_0x108211,null))['catch'](handleError(_0x108211,null));};exports[_0xf9b0('0x54')]=function(_0xfd2417,_0x40e5ca,_0x172db6){var _0x3339ce;return db[_0xf9b0('0x32')][_0xf9b0('0x4b')]({'where':{'id':_0xfd2417['params']['id']},'attributes':['id',_0xf9b0('0x55')]})[_0xf9b0('0x27')](handleEntityNotFound(_0x40e5ca,null))[_0xf9b0('0x27')](function(_0x4330b3){if(_0x4330b3){var _0x3b0e1e=require(_0xf9b0('0x56'))();_0x3b0e1e[_0xf9b0('0x57')](_0x4330b3[_0xf9b0('0x55')]);_0x3b0e1e[_0xf9b0('0x58')]();return _0x4330b3;}})[_0xf9b0('0x27')](respondWithResult(_0x40e5ca,null))['catch'](handleError(_0x40e5ca,null));}; \ No newline at end of file +var _0x7cf1=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','get','ODBC','UserProfileResource','then','error','name','send','index','map','SquareOdbc','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','body','user','find','userProfileId'];(function(_0x2e6b99,_0xf7f807){var _0x6a1926=function(_0x1e4271){while(--_0x1e4271){_0x2e6b99['push'](_0x2e6b99['shift']());}};_0x6a1926(++_0xf7f807);}(_0x7cf1,0x1a5));var _0x17cf=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7cf1[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0x17cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17cf('0x1'));var jsonpatch=require(_0x17cf('0x2'));var rp=require(_0x17cf('0x3'));var moment=require('moment');var BPromise=require(_0x17cf('0x4'));var Mustache=require(_0x17cf('0x5'));var util=require(_0x17cf('0x6'));var path=require(_0x17cf('0x7'));var sox=require('sox');var csv=require(_0x17cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17cf('0x9'));var _=require('lodash');var squel=require(_0x17cf('0xa'));var crypto=require('crypto');var jsforce=require(_0x17cf('0xb'));var deskjs=require(_0x17cf('0xc'));var toCsv=require(_0x17cf('0x8'));var querystring=require(_0x17cf('0xd'));var Papa=require('papaparse');var Redis=require(_0x17cf('0xe'));var authService=require(_0x17cf('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x17cf('0x10'));var hardwareService=require(_0x17cf('0x11'));var logger=require(_0x17cf('0x12'))(_0x17cf('0x13'));var utils=require('../../config/utils');var config=require(_0x17cf('0x14'));var licenseUtil=require(_0x17cf('0x15'));var db=require(_0x17cf('0x16'))['db'];function respondWithStatusCode(_0x5b15c,_0x15805b){_0x15805b=_0x15805b||0xcc;return function(_0x3a4615){if(_0x3a4615){return _0x5b15c[_0x17cf('0x17')](_0x15805b);}return _0x5b15c[_0x17cf('0x18')](_0x15805b)[_0x17cf('0x19')]();};}function respondWithResult(_0x24e0fa,_0x352997){_0x352997=_0x352997||0xc8;return function(_0x4e95d4){if(_0x4e95d4){return _0x24e0fa[_0x17cf('0x18')](_0x352997)['json'](_0x4e95d4);}};}function respondWithFilteredResult(_0x246b31,_0x5194a6){return function(_0x47de8f){if(_0x47de8f){var _0x32380f=typeof _0x5194a6[_0x17cf('0x1a')]===_0x17cf('0x1b')&&typeof _0x5194a6[_0x17cf('0x1c')]===_0x17cf('0x1b');var _0x1f39fb=_0x47de8f['count'];var _0x576899=_0x32380f?0x0:_0x5194a6['offset'];var _0x154b3b=_0x32380f?_0x47de8f[_0x17cf('0x1d')]:_0x5194a6['offset']+_0x5194a6['limit'];var _0x5cf16b;if(_0x154b3b>=_0x1f39fb){_0x154b3b=_0x1f39fb;_0x5cf16b=0xc8;}else{_0x5cf16b=0xce;}_0x246b31[_0x17cf('0x18')](_0x5cf16b);return _0x246b31['set'](_0x17cf('0x1e'),_0x576899+'-'+_0x154b3b+'/'+_0x1f39fb)[_0x17cf('0x1f')](_0x47de8f);}return null;};}function patchUpdates(_0x1697eb){return function(_0x51350c){try{jsonpatch[_0x17cf('0x20')](_0x51350c,_0x1697eb,!![]);}catch(_0x545ffb){return BPromise['reject'](_0x545ffb);}return _0x51350c[_0x17cf('0x21')]();};}function saveUpdates(_0x1071e3,_0x1aef9b){return function(_0x5270d4){if(_0x5270d4){return _0x5270d4['update'](_0x1071e3)['then'](function(_0x2814e1){return _0x2814e1;});}return null;};}function removeEntity(_0x19f223,_0x905293){return function(_0x28a281){if(_0x28a281){return _0x28a281[_0x17cf('0x22')]()['then'](function(){var _0x90a9fe=_0x28a281[_0x17cf('0x23')]({'plain':!![]});var _0x16da43=_0x17cf('0x24');return db[_0x17cf('0x25')]['destroy']({'where':{'type':_0x16da43,'resourceId':_0x90a9fe['id']}})[_0x17cf('0x26')](function(){return _0x28a281;});})[_0x17cf('0x26')](function(){_0x19f223[_0x17cf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa485,_0x9e3ee6){return function(_0x425732){if(!_0x425732){_0x5aa485[_0x17cf('0x17')](0x194);}return _0x425732;};}function handleError(_0x2f7692,_0x335d5e){_0x335d5e=_0x335d5e||0x1f4;return function(_0x4a0284){logger[_0x17cf('0x27')](_0x4a0284['stack']);if(_0x4a0284['name']){delete _0x4a0284[_0x17cf('0x28')];}_0x2f7692[_0x17cf('0x18')](_0x335d5e)[_0x17cf('0x29')](_0x4a0284);};}exports[_0x17cf('0x2a')]=function(_0x2a6ae6,_0x31fbef){var _0x2d0a23={},_0x3c1ba3={},_0xb3a4d3={'count':0x0,'rows':[]};var _0x2f2830=_[_0x17cf('0x2b')](db[_0x17cf('0x2c')][_0x17cf('0x2d')],function(_0x439341){return{'name':_0x439341['fieldName'],'type':_0x439341[_0x17cf('0x2e')][_0x17cf('0x2f')]};});_0x3c1ba3['model']=_[_0x17cf('0x2b')](_0x2f2830,'name');_0x3c1ba3[_0x17cf('0x30')]=_['keys'](_0x2a6ae6[_0x17cf('0x30')]);_0x3c1ba3[_0x17cf('0x31')]=_[_0x17cf('0x32')](_0x3c1ba3['model'],_0x3c1ba3[_0x17cf('0x30')]);_0x2d0a23['attributes']=_[_0x17cf('0x32')](_0x3c1ba3[_0x17cf('0x33')],qs[_0x17cf('0x34')](_0x2a6ae6[_0x17cf('0x30')]['fields']));_0x2d0a23['attributes']=_0x2d0a23[_0x17cf('0x35')][_0x17cf('0x36')]?_0x2d0a23['attributes']:_0x3c1ba3[_0x17cf('0x33')];if(!_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x37')](_0x17cf('0x38'))){_0x2d0a23[_0x17cf('0x1c')]=qs[_0x17cf('0x1c')](_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x1c')]);_0x2d0a23[_0x17cf('0x1a')]=qs['offset'](_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x1a')]);}_0x2d0a23[_0x17cf('0x39')]=qs[_0x17cf('0x3a')](_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x3a')]);_0x2d0a23['where']=qs[_0x17cf('0x31')](_[_0x17cf('0x3b')](_0x2a6ae6[_0x17cf('0x30')],_0x3c1ba3['filters']),_0x2f2830);if(_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x3c')]){_0x2d0a23['where']=_[_0x17cf('0x3d')](_0x2d0a23[_0x17cf('0x3e')],{'$or':_[_0x17cf('0x2b')](_0x2f2830,function(_0x32b88b){if(_0x32b88b[_0x17cf('0x2e')]!==_0x17cf('0x3f')){var _0xc592c={};_0xc592c[_0x32b88b['name']]={'$like':'%'+_0x2a6ae6[_0x17cf('0x30')][_0x17cf('0x3c')]+'%'};return _0xc592c;}})});}_0x2d0a23=_[_0x17cf('0x3d')]({},_0x2d0a23,_0x2a6ae6[_0x17cf('0x40')]);var _0x536a3f={'where':_0x2d0a23['where']};return db[_0x17cf('0x2c')][_0x17cf('0x1d')](_0x536a3f)['then'](function(_0x319066){_0xb3a4d3['count']=_0x319066;if(_0x2a6ae6['query']['includeAll']){_0x2d0a23[_0x17cf('0x41')]=[{'all':!![]}];}return db[_0x17cf('0x2c')][_0x17cf('0x42')](_0x2d0a23);})[_0x17cf('0x26')](function(_0x59923c){_0xb3a4d3[_0x17cf('0x43')]=_0x59923c;return _0xb3a4d3;})[_0x17cf('0x26')](respondWithFilteredResult(_0x31fbef,_0x2d0a23))[_0x17cf('0x44')](handleError(_0x31fbef,null));};exports[_0x17cf('0x45')]=function(_0xb4dfd5,_0x3a5968){var _0x510ba7={'raw':!![],'where':{'id':_0xb4dfd5[_0x17cf('0x46')]['id']}},_0x2109d4={};_0x2109d4[_0x17cf('0x33')]=_[_0x17cf('0x47')](db[_0x17cf('0x2c')][_0x17cf('0x2d')]);_0x2109d4[_0x17cf('0x30')]=_['keys'](_0xb4dfd5[_0x17cf('0x30')]);_0x2109d4[_0x17cf('0x31')]=_[_0x17cf('0x32')](_0x2109d4[_0x17cf('0x33')],_0x2109d4['query']);_0x510ba7[_0x17cf('0x35')]=_[_0x17cf('0x32')](_0x2109d4['model'],qs[_0x17cf('0x34')](_0xb4dfd5[_0x17cf('0x30')][_0x17cf('0x34')]));_0x510ba7[_0x17cf('0x35')]=_0x510ba7['attributes'][_0x17cf('0x36')]?_0x510ba7[_0x17cf('0x35')]:_0x2109d4[_0x17cf('0x33')];if(_0xb4dfd5['query']['includeAll']){_0x510ba7['include']=[{'all':!![]}];}_0x510ba7=_[_0x17cf('0x3d')]({},_0x510ba7,_0xb4dfd5[_0x17cf('0x40')]);return db[_0x17cf('0x2c')]['find'](_0x510ba7)[_0x17cf('0x26')](handleEntityNotFound(_0x3a5968,null))[_0x17cf('0x26')](respondWithResult(_0x3a5968,null))[_0x17cf('0x44')](handleError(_0x3a5968,null));};exports[_0x17cf('0x48')]=function(_0x8581a8,_0x95c46f){return db[_0x17cf('0x2c')][_0x17cf('0x48')](_0x8581a8[_0x17cf('0x49')],{})[_0x17cf('0x26')](function(_0x5110c3){var _0x34f001=_0x8581a8[_0x17cf('0x4a')][_0x17cf('0x23')]({'plain':!![]});if(!_0x34f001)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34f001['role']==='user'){var _0x452747=_0x5110c3[_0x17cf('0x23')]({'plain':!![]});var _0x3c05c4=_0x17cf('0x24');return db['UserProfileSection'][_0x17cf('0x4b')]({'where':{'name':_0x3c05c4,'userProfileId':_0x34f001[_0x17cf('0x4c')]},'raw':!![]})['then'](function(_0x43fed0){if(_0x43fed0&&_0x43fed0[_0x17cf('0x4d')]===0x0){return db[_0x17cf('0x25')]['create']({'name':_0x452747[_0x17cf('0x28')],'resourceId':_0x452747['id'],'type':_0x43fed0[_0x17cf('0x28')],'sectionId':_0x43fed0['id']},{})['then'](function(){return _0x5110c3;});}else{return _0x5110c3;}})[_0x17cf('0x44')](function(_0x1b78ff){logger[_0x17cf('0x27')](_0x17cf('0x4e'),_0x1b78ff);throw _0x1b78ff;});}return _0x5110c3;})[_0x17cf('0x26')](respondWithResult(_0x95c46f,0xc9))['catch'](handleError(_0x95c46f,null));};exports[_0x17cf('0x4f')]=function(_0x294ad6,_0x341b97){if(_0x294ad6['body']['id']){delete _0x294ad6[_0x17cf('0x49')]['id'];}return db[_0x17cf('0x2c')][_0x17cf('0x4b')]({'where':{'id':_0x294ad6[_0x17cf('0x46')]['id']}})[_0x17cf('0x26')](handleEntityNotFound(_0x341b97,null))[_0x17cf('0x26')](saveUpdates(_0x294ad6[_0x17cf('0x49')],null))['then'](respondWithResult(_0x341b97,null))[_0x17cf('0x44')](handleError(_0x341b97,null));};exports[_0x17cf('0x22')]=function(_0x2535aa,_0x4e8fce){return db['SquareOdbc']['find']({'where':{'id':_0x2535aa['params']['id']}})[_0x17cf('0x26')](handleEntityNotFound(_0x4e8fce,null))[_0x17cf('0x26')](removeEntity(_0x4e8fce,null))[_0x17cf('0x44')](handleError(_0x4e8fce,null));};exports[_0x17cf('0x50')]=function(_0x43c1b9,_0x1e94ca,_0x624725){var _0x4f8458;return db['SquareOdbc'][_0x17cf('0x4b')]({'where':{'id':_0x43c1b9['params']['id']},'attributes':['id',_0x17cf('0x51')]})[_0x17cf('0x26')](handleEntityNotFound(_0x1e94ca,null))[_0x17cf('0x26')](function(_0x1f0550){if(_0x1f0550){var _0x27392f=require('odbc')();_0x27392f['openSync'](_0x1f0550[_0x17cf('0x51')]);_0x27392f[_0x17cf('0x52')]();return _0x1f0550;}})[_0x17cf('0x26')](respondWithResult(_0x1e94ca,null))[_0x17cf('0x44')](handleError(_0x1e94ca,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c8641f8..d388002 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 _0x4726=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','lodash','util'];(function(_0xb6b285,_0x596e01){var _0x11393c=function(_0x506469){while(--_0x506469){_0xb6b285['push'](_0xb6b285['shift']());}};_0x11393c(++_0x596e01);}(_0x4726,0x106));var _0x6472=function(_0x5bb75e,_0x50373d){_0x5bb75e=_0x5bb75e-0x0;var _0x380892=_0x4726[_0x5bb75e];return _0x380892;};'use strict';var _=require(_0x6472('0x0'));var util=require(_0x6472('0x1'));var logger=require(_0x6472('0x2'))(_0x6472('0x3'));var moment=require(_0x6472('0x4'));var BPromise=require(_0x6472('0x5'));var rp=require(_0x6472('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6472('0x7'));var attributes=require(_0x6472('0x8'));module[_0x6472('0x9')]=function(_0x28b3c6,_0x22a27d){return _0x28b3c6['define'](_0x6472('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11a8=['SquareOdbc','square_odbc','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x11a8,0x1e2));var _0x811a=function(_0x332e65,_0x368a12){_0x332e65=_0x332e65-0x0;var _0x1b19dc=_0x11a8[_0x332e65];return _0x1b19dc;};'use strict';var _=require(_0x811a('0x0'));var util=require('util');var logger=require(_0x811a('0x1'))('api');var moment=require(_0x811a('0x2'));var BPromise=require('bluebird');var rp=require(_0x811a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x811a('0x4'));var config=require(_0x811a('0x5'));var attributes=require(_0x811a('0x6'));module[_0x811a('0x7')]=function(_0x254c4c,_0x81f3f2){return _0x254c4c['define'](_0x811a('0x8'),attributes,{'tableName':_0x811a('0x9'),'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 8c41383..9b910e7 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 _0x61d7=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','attributes','include','map','model','ShowSquareOdbc','lodash','util'];(function(_0xc467ef,_0x420914){var _0x351aff=function(_0x5b3012){while(--_0x5b3012){_0xc467ef['push'](_0xc467ef['shift']());}};_0x351aff(++_0x420914);}(_0x61d7,0x1de));var _0x761d=function(_0x3cb010,_0x38f900){_0x3cb010=_0x3cb010-0x0;var _0x25586b=_0x61d7[_0x3cb010];return _0x25586b;};'use strict';var _=require(_0x761d('0x0'));var util=require(_0x761d('0x1'));var moment=require(_0x761d('0x2'));var BPromise=require(_0x761d('0x3'));var rs=require(_0x761d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x761d('0x5'));var logger=require(_0x761d('0x6'))(_0x761d('0x7'));var config=require(_0x761d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x761d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c90d8,_0x1e4c9d,_0xd2679c){return new BPromise(function(_0x5bc48b,_0x4a0968){return client[_0x761d('0xa')](_0x2c90d8,_0xd2679c)[_0x761d('0xb')](function(_0x49ad0b){logger[_0x761d('0xc')](_0x761d('0xd'),_0x1e4c9d,_0x761d('0xe'));logger[_0x761d('0xf')](_0x761d('0x10'),_0x1e4c9d,_0x761d('0xe'),JSON[_0x761d('0x11')](_0x49ad0b));if(_0x49ad0b[_0x761d('0x12')]){if(_0x49ad0b[_0x761d('0x12')][_0x761d('0x13')]===0x1f4){logger[_0x761d('0x12')](_0x761d('0xd'),_0x1e4c9d,_0x49ad0b[_0x761d('0x12')][_0x761d('0x14')]);return _0x4a0968(_0x49ad0b['error']['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x1e4c9d,_0x49ad0b[_0x761d('0x12')][_0x761d('0x14')]);return _0x5bc48b(_0x49ad0b[_0x761d('0x12')][_0x761d('0x14')]);}else{logger['info'](_0x761d('0xd'),_0x1e4c9d,_0x761d('0xe'));_0x5bc48b(_0x49ad0b[_0x761d('0x15')][_0x761d('0x14')]);}})[_0x761d('0x16')](function(_0xee0c36){logger[_0x761d('0x12')](_0x761d('0xd'),_0x1e4c9d,_0xee0c36);_0x4a0968(_0xee0c36);});});}exports['ShowSquareOdbc']=function(_0x2ce37a){var _0x50fa06=this;return new Promise(function(_0x45e0b5,_0x533ce7){return db[_0x761d('0x17')][_0x761d('0x18')]({'raw':_0x2ce37a['options']?_0x2ce37a[_0x761d('0x19')][_0x761d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ce37a['options']?_0x2ce37a['options']['where']||null:null,'attributes':_0x2ce37a['options']?_0x2ce37a['options'][_0x761d('0x1b')]||null:null,'include':_0x2ce37a[_0x761d('0x19')]?_0x2ce37a['options'][_0x761d('0x1c')]?_[_0x761d('0x1d')](_0x2ce37a[_0x761d('0x19')][_0x761d('0x1c')],function(_0x5832e3){return{'model':db[_0x5832e3[_0x761d('0x1e')]],'as':_0x5832e3['as'],'attributes':_0x5832e3[_0x761d('0x1b')],'include':_0x5832e3[_0x761d('0x1c')]?_[_0x761d('0x1d')](_0x5832e3[_0x761d('0x1c')],function(_0x41c0b0){return{'model':db[_0x41c0b0['model']],'as':_0x41c0b0['as'],'attributes':_0x41c0b0['attributes'],'include':_0x41c0b0[_0x761d('0x1c')]?_['map'](_0x41c0b0[_0x761d('0x1c')],function(_0x4b103e){return{'model':db[_0x4b103e[_0x761d('0x1e')]],'as':_0x4b103e['as'],'attributes':_0x4b103e[_0x761d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x583956){logger[_0x761d('0xc')](_0x761d('0x1f'),_0x2ce37a);logger[_0x761d('0xf')](_0x761d('0x1f'),_0x2ce37a,JSON[_0x761d('0x11')](_0x583956));_0x45e0b5(_0x583956);})[_0x761d('0x16')](function(_0x93d8f0){logger['error']('ShowSquareOdbc',_0x93d8f0[_0x761d('0x14')],_0x2ce37a);_0x533ce7(_0x50fa06[_0x761d('0x12')](0x1f4,_0x93d8f0[_0x761d('0x14')]));});});}; \ No newline at end of file +var _0x923e=['message','result','catch','ShowSquareOdbc','options','raw','where','attributes','map','include','model','then','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x308a4e,_0x5b6c19){var _0x7e11c4=function(_0x4bd716){while(--_0x4bd716){_0x308a4e['push'](_0x308a4e['shift']());}};_0x7e11c4(++_0x5b6c19);}(_0x923e,0xa8));var _0xe923=function(_0x367d25,_0x11e20c){_0x367d25=_0x367d25-0x0;var _0x486919=_0x923e[_0x367d25];return _0x486919;};'use strict';var _=require('lodash');var util=require(_0xe923('0x0'));var moment=require(_0xe923('0x1'));var BPromise=require(_0xe923('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe923('0x3'))['db'];var utils=require(_0xe923('0x4'));var logger=require(_0xe923('0x5'))(_0xe923('0x6'));var config=require(_0xe923('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe923('0x8')][_0xe923('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa42c11,_0x2cfb2a,_0x2f8804){return new BPromise(function(_0x3361e6,_0x534ca1){return client[_0xe923('0xa')](_0xa42c11,_0x2f8804)['then'](function(_0x5c9686){logger['info'](_0xe923('0xb'),_0x2cfb2a,_0xe923('0xc'));logger[_0xe923('0xd')](_0xe923('0xe'),_0x2cfb2a,'request\x20sent',JSON[_0xe923('0xf')](_0x5c9686));if(_0x5c9686['error']){if(_0x5c9686[_0xe923('0x10')][_0xe923('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2cfb2a,_0x5c9686[_0xe923('0x10')][_0xe923('0x12')]);return _0x534ca1(_0x5c9686[_0xe923('0x10')][_0xe923('0x12')]);}logger[_0xe923('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x2cfb2a,_0x5c9686[_0xe923('0x10')]['message']);return _0x3361e6(_0x5c9686[_0xe923('0x10')][_0xe923('0x12')]);}else{logger['info'](_0xe923('0xb'),_0x2cfb2a,'request\x20sent');_0x3361e6(_0x5c9686[_0xe923('0x13')]['message']);}})[_0xe923('0x14')](function(_0x3c68df){logger[_0xe923('0x10')](_0xe923('0xb'),_0x2cfb2a,_0x3c68df);_0x534ca1(_0x3c68df);});});}exports[_0xe923('0x15')]=function(_0x49c650){var _0x27cea1=this;return new Promise(function(_0x535ccc,_0x457823){return db['SquareOdbc']['find']({'raw':_0x49c650[_0xe923('0x16')]?_0x49c650[_0xe923('0x16')][_0xe923('0x17')]===undefined?!![]:![]:!![],'where':_0x49c650[_0xe923('0x16')]?_0x49c650[_0xe923('0x16')][_0xe923('0x18')]||null:null,'attributes':_0x49c650[_0xe923('0x16')]?_0x49c650[_0xe923('0x16')][_0xe923('0x19')]||null:null,'include':_0x49c650['options']?_0x49c650[_0xe923('0x16')]['include']?_[_0xe923('0x1a')](_0x49c650[_0xe923('0x16')][_0xe923('0x1b')],function(_0x4468a1){return{'model':db[_0x4468a1[_0xe923('0x1c')]],'as':_0x4468a1['as'],'attributes':_0x4468a1[_0xe923('0x19')],'include':_0x4468a1[_0xe923('0x1b')]?_[_0xe923('0x1a')](_0x4468a1[_0xe923('0x1b')],function(_0x7ea92c){return{'model':db[_0x7ea92c[_0xe923('0x1c')]],'as':_0x7ea92c['as'],'attributes':_0x7ea92c[_0xe923('0x19')],'include':_0x7ea92c[_0xe923('0x1b')]?_[_0xe923('0x1a')](_0x7ea92c[_0xe923('0x1b')],function(_0x43a4d7){return{'model':db[_0x43a4d7[_0xe923('0x1c')]],'as':_0x43a4d7['as'],'attributes':_0x43a4d7[_0xe923('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe923('0x1d')](function(_0x1a6566){logger[_0xe923('0x1e')](_0xe923('0x15'),_0x49c650);logger[_0xe923('0xd')](_0xe923('0x15'),_0x49c650,JSON['stringify'](_0x1a6566));_0x535ccc(_0x1a6566);})[_0xe923('0x14')](function(_0x52628f){logger[_0xe923('0x10')](_0xe923('0x15'),_0x52628f['message'],_0x49c650);_0x457823(_0x27cea1[_0xe923('0x10')](0x1f4,_0x52628f[_0xe923('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index b2327cc..9c72fde 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 _0x2b4a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','removeUsers','multer','util','path','connect-timeout'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2b4a,0x13e));var _0xa2b4=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x2b4a[_0xe73080];return _0x12cbc4;};'use strict';var multer=require(_0xa2b4('0x0'));var util=require(_0xa2b4('0x1'));var path=require(_0xa2b4('0x2'));var timeout=require(_0xa2b4('0x3'));var express=require(_0xa2b4('0x4'));var router=express[_0xa2b4('0x5')]();var fs_extra=require(_0xa2b4('0x6'));var auth=require(_0xa2b4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2b4('0x8'));var controller=require(_0xa2b4('0x9'));router[_0xa2b4('0xa')]('/',auth[_0xa2b4('0xb')](),controller['index']);router[_0xa2b4('0xa')](_0xa2b4('0xc'),auth['isAuthenticated'](),controller[_0xa2b4('0xd')]);router[_0xa2b4('0xa')](_0xa2b4('0xe'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0xf')]);router[_0xa2b4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa2b4('0x10')]('/:id/users',auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x11')]);router[_0xa2b4('0x12')](_0xa2b4('0xc'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x13')]);router[_0xa2b4('0x14')](_0xa2b4('0xc'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x15')]);router[_0xa2b4('0x14')](_0xa2b4('0xe'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd4a2=['/:id','show','/:id/users','getUsers','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd4a2,0x173));var _0x2d4a=function(_0x13e6f7,_0x2cadf7){_0x13e6f7=_0x13e6f7-0x0;var _0x280cd0=_0xd4a2[_0x13e6f7];return _0x280cd0;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xd')](_0x2d4a('0xb'),auth['isAuthenticated'](),controller['addUsers']);router[_0x2d4a('0xf')]('/:id',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0xb'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x2d4a('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5ae09bc..0b78b58 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 _0xb6dc=['preproduction','toString','production','utf8','DATE','exports','STRING','name','TEXT','long','getDataValue'];(function(_0x488ebb,_0x2189c6){var _0x179e5b=function(_0x1ea520){while(--_0x1ea520){_0x488ebb['push'](_0x488ebb['shift']());}};_0x179e5b(++_0x2189c6);}(_0xb6dc,0xaa));var _0xcb6d=function(_0x10b665,_0x5c7a5d){_0x10b665=_0x10b665-0x0;var _0x36ca0d=_0xb6dc[_0x10b665];return _0x36ca0d;};'use strict';var Sequelize=require('sequelize');module[_0xcb6d('0x0')]={'name':{'type':Sequelize[_0xcb6d('0x1')],'unique':_0xcb6d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb6d('0x1')]},'notes':{'type':Sequelize[_0xcb6d('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xcb6d('0x4')),'get':function(){if(this[_0xcb6d('0x5')](_0xcb6d('0x6'))){return this['getDataValue'](_0xcb6d('0x6'))[_0xcb6d('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xcb6d('0x4')),'get':function(){if(this[_0xcb6d('0x5')](_0xcb6d('0x8'))){return this[_0xcb6d('0x5')]('production')[_0xcb6d('0x7')](_0xcb6d('0x9'));}}},'savedAt':{'type':Sequelize[_0xcb6d('0xa')]},'publishedAt':{'type':Sequelize[_0xcb6d('0xa')]}}; \ No newline at end of file +var _0x5943=['long','getDataValue','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x5943,0x1f2));var _0x3594=function(_0x2c36f3,_0x200f12){_0x2c36f3=_0x2c36f3-0x0;var _0x5c6451=_0x5943[_0x2c36f3];return _0x5c6451;};'use strict';var Sequelize=require(_0x3594('0x0'));module[_0x3594('0x1')]={'name':{'type':Sequelize[_0x3594('0x2')],'unique':_0x3594('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3594('0x2')]},'notes':{'type':Sequelize[_0x3594('0x4')]},'preproduction':{'type':Sequelize[_0x3594('0x5')](_0x3594('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x3594('0x7')]('preproduction')[_0x3594('0x8')](_0x3594('0x9'));}}},'production':{'type':Sequelize[_0x3594('0x5')](_0x3594('0x6')),'get':function(){if(this[_0x3594('0x7')](_0x3594('0xa'))){return this[_0x3594('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x3594('0xb')]},'publishedAt':{'type':Sequelize[_0x3594('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 61b41e1..e6889a1 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 _0xbf41=['order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','spread','pick','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','hasOwnProperty','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','get','SquareProjects','UserProfileResource','stringify','error','stack','name','send','connect','127.0.0.1','index','map','SquareProject','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit'];(function(_0x556658,_0x36be73){var _0x19a14b=function(_0x24aee4){while(--_0x24aee4){_0x556658['push'](_0x556658['shift']());}};_0x19a14b(++_0x36be73);}(_0xbf41,0x77));var _0x1bf4=function(_0x3884d6,_0x2c012c){_0x3884d6=_0x3884d6-0x0;var _0x161849=_0xbf41[_0x3884d6];return _0x161849;};'use strict';var _=require(_0x1bf4('0x0'));var Redis=require(_0x1bf4('0x1'));var qs=require(_0x1bf4('0x2'));var logger=require(_0x1bf4('0x3'))(_0x1bf4('0x4'));var config=require(_0x1bf4('0x5'));var db=require(_0x1bf4('0x6'))['db'];config[_0x1bf4('0x7')]=_[_0x1bf4('0x8')](config['redis'],{'host':_0x1bf4('0x9'),'port':0x18eb});var socket=require(_0x1bf4('0xa'))(new Redis(config[_0x1bf4('0x7')]));require('./squareProject.socket')[_0x1bf4('0xb')](socket);function respondWithStatusCode(_0x175874,_0x30c66e){_0x30c66e=_0x30c66e||0xcc;return function(_0x34357b){if(_0x34357b){return _0x175874[_0x1bf4('0xc')](_0x30c66e);}return _0x175874[_0x1bf4('0xd')](_0x30c66e)[_0x1bf4('0xe')]();};}function respondWithResult(_0x1e78f7,_0x521270){_0x521270=_0x521270||0xc8;return function(_0x585e4c){if(_0x585e4c){return _0x1e78f7[_0x1bf4('0xd')](_0x521270)[_0x1bf4('0xf')](_0x585e4c);}};}function respondWithFilteredResult(_0x46ce15,_0x2af82f){return function(_0x2efa2e){if(_0x2efa2e){var _0x4c6d12=typeof _0x2af82f[_0x1bf4('0x10')]===_0x1bf4('0x11')&&typeof _0x2af82f['limit']==='undefined';var _0x1c8c64=_0x2efa2e[_0x1bf4('0x12')];var _0x3a3345=_0x4c6d12?0x0:_0x2af82f[_0x1bf4('0x10')];var _0x2b0377=_0x4c6d12?_0x2efa2e['count']:_0x2af82f[_0x1bf4('0x10')]+_0x2af82f[_0x1bf4('0x13')];var _0x1d512d;if(_0x2b0377>=_0x1c8c64){_0x2b0377=_0x1c8c64;_0x1d512d=0xc8;}else{_0x1d512d=0xce;}_0x46ce15['status'](_0x1d512d);return _0x46ce15[_0x1bf4('0x14')]('Content-Range',_0x3a3345+'-'+_0x2b0377+'/'+_0x1c8c64)['json'](_0x2efa2e);}return null;};}function saveUpdates(_0x591ed7){return function(_0x51d5e3){if(_0x51d5e3){return _0x51d5e3[_0x1bf4('0x15')](_0x591ed7)[_0x1bf4('0x16')](function(_0x1f2e3b){return _0x1f2e3b;});}return null;};}function removeEntity(_0x2d4c67){return function(_0x24ae0a){if(_0x24ae0a){return _0x24ae0a[_0x1bf4('0x17')]()['then'](function(){var _0x499bba=_0x24ae0a[_0x1bf4('0x18')]({'plain':!![]});var _0x483045=_0x1bf4('0x19');return db[_0x1bf4('0x1a')]['destroy']({'where':{'type':_0x483045,'resourceId':_0x499bba['id']}})[_0x1bf4('0x16')](function(){return _0x24ae0a;});})[_0x1bf4('0x16')](function(){return createAgiSocket();})[_0x1bf4('0x16')](function(_0x16861f){_0x16861f['end'](JSON[_0x1bf4('0x1b')]({'id':_0x24ae0a['id'],'deleted':!![]}));})['then'](function(){_0x2d4c67[_0x1bf4('0xd')](0xcc)[_0x1bf4('0xe')]();});}};}function handleEntityNotFound(_0xb248f7){return function(_0xd83014){if(!_0xd83014){_0xb248f7[_0x1bf4('0xc')](0x194);}return _0xd83014;};}function handleError(_0x2bd3ec,_0x49ba72){_0x49ba72=_0x49ba72||0x1f4;return function(_0x183e44){logger[_0x1bf4('0x1c')](_0x183e44[_0x1bf4('0x1d')]);if(_0x183e44['name']){delete _0x183e44[_0x1bf4('0x1e')];}_0x2bd3ec[_0x1bf4('0xd')](_0x49ba72)[_0x1bf4('0x1f')](_0x183e44);};}function createAgiSocket(){try{var _0x42bb12=require('net');var _0x14d4cf=new _0x42bb12['Socket']();return _0x14d4cf[_0x1bf4('0x20')](config['agi']['port']||0x11dd,_0x1bf4('0x21'));}catch(_0x3c474d){throw _0x3c474d;}}exports[_0x1bf4('0x22')]=function(_0x4970fb,_0x394ef2){var _0x37939f={},_0x30228a={},_0x2d03d0={'count':0x0,'rows':[]};var _0xdce80=_[_0x1bf4('0x23')](db[_0x1bf4('0x24')][_0x1bf4('0x25')],function(_0x10b8ad){return{'name':_0x10b8ad[_0x1bf4('0x26')],'type':_0x10b8ad[_0x1bf4('0x27')][_0x1bf4('0x28')]};});_0x30228a['model']=_[_0x1bf4('0x23')](_0xdce80,_0x1bf4('0x1e'));_0x30228a[_0x1bf4('0x29')]=_[_0x1bf4('0x2a')](_0x4970fb[_0x1bf4('0x29')]);_0x30228a['filters']=_[_0x1bf4('0x2b')](_0x30228a['model'],_0x30228a['query']);_0x37939f[_0x1bf4('0x2c')]=_[_0x1bf4('0x2b')](_0x30228a[_0x1bf4('0x2d')],qs[_0x1bf4('0x2e')](_0x4970fb[_0x1bf4('0x29')][_0x1bf4('0x2e')]));_0x37939f[_0x1bf4('0x2c')]=_0x37939f['attributes'][_0x1bf4('0x2f')]?_0x37939f[_0x1bf4('0x2c')]:_0x30228a['model'];if(!_0x4970fb[_0x1bf4('0x29')]['hasOwnProperty'](_0x1bf4('0x30'))){_0x37939f[_0x1bf4('0x13')]=qs[_0x1bf4('0x13')](_0x4970fb[_0x1bf4('0x29')][_0x1bf4('0x13')]);_0x37939f[_0x1bf4('0x10')]=qs[_0x1bf4('0x10')](_0x4970fb[_0x1bf4('0x29')][_0x1bf4('0x10')]);}_0x37939f[_0x1bf4('0x31')]=qs[_0x1bf4('0x32')](_0x4970fb[_0x1bf4('0x29')][_0x1bf4('0x32')]);_0x37939f[_0x1bf4('0x33')]=qs[_0x1bf4('0x34')](_['pick'](_0x4970fb['query'],_0x30228a[_0x1bf4('0x34')]),_0xdce80);if(_0x4970fb['query'][_0x1bf4('0x35')]){_0x37939f[_0x1bf4('0x33')]=_[_0x1bf4('0x36')](_0x37939f[_0x1bf4('0x33')],{'$or':_[_0x1bf4('0x23')](_0xdce80,function(_0x4c56c4){if(_0x4c56c4[_0x1bf4('0x27')]!==_0x1bf4('0x37')){var _0x55f68a={};_0x55f68a[_0x4c56c4[_0x1bf4('0x1e')]]={'$like':'%'+_0x4970fb['query'][_0x1bf4('0x35')]+'%'};return _0x55f68a;}})});}_0x37939f=_[_0x1bf4('0x36')]({},_0x37939f,_0x4970fb[_0x1bf4('0x38')]);var _0x1a612f={'where':_0x37939f[_0x1bf4('0x33')]};return db['SquareProject'][_0x1bf4('0x12')](_0x1a612f)[_0x1bf4('0x16')](function(_0x488f5b){_0x2d03d0[_0x1bf4('0x12')]=_0x488f5b;if(_0x4970fb[_0x1bf4('0x29')]['includeAll']){_0x37939f[_0x1bf4('0x39')]=[{'all':!![]}];}return db[_0x1bf4('0x24')][_0x1bf4('0x3a')](_0x37939f);})[_0x1bf4('0x16')](function(_0x22d886){_0x2d03d0[_0x1bf4('0x3b')]=_0x22d886;return _0x2d03d0;})[_0x1bf4('0x16')](respondWithFilteredResult(_0x394ef2,_0x37939f))['catch'](handleError(_0x394ef2,null));};exports[_0x1bf4('0x3c')]=function(_0x8a0d0f,_0x4ec91e){var _0x598d47={'raw':![],'where':{'id':_0x8a0d0f[_0x1bf4('0x3d')]['id']}},_0x2f9691={};_0x2f9691[_0x1bf4('0x2d')]=_[_0x1bf4('0x2a')](db['SquareProject']['rawAttributes']);_0x2f9691[_0x1bf4('0x29')]=_[_0x1bf4('0x2a')](_0x8a0d0f[_0x1bf4('0x29')]);_0x2f9691[_0x1bf4('0x34')]=_[_0x1bf4('0x2b')](_0x2f9691[_0x1bf4('0x2d')],_0x2f9691[_0x1bf4('0x29')]);_0x598d47[_0x1bf4('0x2c')]=_[_0x1bf4('0x2b')](_0x2f9691['model'],qs[_0x1bf4('0x2e')](_0x8a0d0f[_0x1bf4('0x29')]['fields']));_0x598d47[_0x1bf4('0x2c')]=_0x598d47[_0x1bf4('0x2c')][_0x1bf4('0x2f')]?_0x598d47[_0x1bf4('0x2c')]:_0x2f9691[_0x1bf4('0x2d')];if(_0x8a0d0f[_0x1bf4('0x29')][_0x1bf4('0x3e')]){_0x598d47[_0x1bf4('0x39')]=[{'all':!![]}];}_0x598d47=_['merge']({},_0x598d47,_0x8a0d0f[_0x1bf4('0x38')]);return db[_0x1bf4('0x24')]['find'](_0x598d47)['then'](handleEntityNotFound(_0x4ec91e,null))[_0x1bf4('0x16')](respondWithResult(_0x4ec91e,null))[_0x1bf4('0x3f')](handleError(_0x4ec91e,null));};exports[_0x1bf4('0x40')]=function(_0x3470c2,_0x584460){return db[_0x1bf4('0x24')]['create'](_0x3470c2[_0x1bf4('0x41')],{})[_0x1bf4('0x16')](function(_0x3f8841){var _0x4166b6=_0x3470c2['user']['get']({'plain':!![]});if(!_0x4166b6)throw new Error(_0x1bf4('0x42'));if(_0x4166b6['role']===_0x1bf4('0x43')){var _0xc0a1c3=_0x3f8841[_0x1bf4('0x18')]({'plain':!![]});var _0x40d368=_0x1bf4('0x19');return db[_0x1bf4('0x44')][_0x1bf4('0x45')]({'where':{'name':_0x40d368,'userProfileId':_0x4166b6['userProfileId']},'raw':!![]})['then'](function(_0x1bac7f){if(_0x1bac7f&&_0x1bac7f[_0x1bf4('0x46')]===0x0){return db['UserProfileResource'][_0x1bf4('0x40')]({'name':_0xc0a1c3[_0x1bf4('0x1e')],'resourceId':_0xc0a1c3['id'],'type':_0x1bac7f[_0x1bf4('0x1e')],'sectionId':_0x1bac7f['id']},{})['then'](function(){return _0x3f8841;});}else{return _0x3f8841;}})[_0x1bf4('0x3f')](function(_0x568c56){logger[_0x1bf4('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x568c56);throw _0x568c56;});}return _0x3f8841;})[_0x1bf4('0x16')](respondWithResult(_0x584460,0xc9))[_0x1bf4('0x3f')](handleError(_0x584460,null));};exports[_0x1bf4('0x15')]=function(_0x2941ca,_0x3dcb71){if(_0x2941ca['body']['id']){delete _0x2941ca['body']['id'];}return db[_0x1bf4('0x24')][_0x1bf4('0x45')]({'where':{'id':_0x2941ca['params']['id']}})[_0x1bf4('0x16')](handleEntityNotFound(_0x3dcb71,null))[_0x1bf4('0x16')](saveUpdates(_0x2941ca['body'],null))['then'](function(_0x9b838e){if(!_0x9b838e)return;var _0x1563ec=_0x9b838e[_0x1bf4('0x18')]({'plain':!![]});return[createAgiSocket(),_0x1563ec];})[_0x1bf4('0x47')](function(_0xbe8027,_0x29946a){_0xbe8027[_0x1bf4('0xe')](JSON[_0x1bf4('0x1b')](_[_0x1bf4('0x48')](_0x29946a,['id',_0x1bf4('0x1e'),_0x1bf4('0x49')])));return _0x29946a;})[_0x1bf4('0x16')](respondWithResult(_0x3dcb71,null))['catch'](handleError(_0x3dcb71,null));};exports[_0x1bf4('0x17')]=function(_0x3d2022,_0x19b4f3){return db[_0x1bf4('0x24')]['find']({'where':{'id':_0x3d2022[_0x1bf4('0x3d')]['id']}})[_0x1bf4('0x16')](handleEntityNotFound(_0x19b4f3,null))['then'](removeEntity(_0x19b4f3,null))[_0x1bf4('0x3f')](handleError(_0x19b4f3,null));};exports[_0x1bf4('0x4a')]=function(_0x83495e,_0x380351){return db[_0x1bf4('0x24')][_0x1bf4('0x45')]({'where':{'id':_0x83495e[_0x1bf4('0x3d')]['id']}})[_0x1bf4('0x16')](handleEntityNotFound(_0x380351,null))[_0x1bf4('0x16')](function(_0x1ce5e9){if(_0x1ce5e9){return _0x1ce5e9[_0x1bf4('0x4a')](_0x83495e[_0x1bf4('0x41')][_0x1bf4('0x4b')],_[_0x1bf4('0x4c')](_0x83495e['body'],[_0x1bf4('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x380351,null))[_0x1bf4('0x3f')](handleError(_0x380351,null));};exports[_0x1bf4('0x4d')]=function(_0xe8863e,_0x4092f7){return db['SquareProject'][_0x1bf4('0x45')]({'where':{'id':_0xe8863e[_0x1bf4('0x3d')]['id']}})[_0x1bf4('0x16')](handleEntityNotFound(_0x4092f7,null))[_0x1bf4('0x16')](function(_0x1efdb2){if(_0x1efdb2){return _0x1efdb2[_0x1bf4('0x4d')](_0xe8863e[_0x1bf4('0x29')][_0x1bf4('0x4b')])[_0x1bf4('0x16')](function(){if(_[_0x1bf4('0x4e')](_0xe8863e[_0x1bf4('0x29')][_0x1bf4('0x4b')])){for(var _0xfea4e5=0x0;_0xfea4e5<_0xe8863e[_0x1bf4('0x29')][_0x1bf4('0x4b')]['length'];_0xfea4e5+=0x1){socket[_0x1bf4('0x4f')](_0x1bf4('0x50'),{'UserId':Number(_0xe8863e[_0x1bf4('0x29')]['ids'][_0xfea4e5]),'SquareProjectId':Number(_0xe8863e[_0x1bf4('0x3d')]['id'])});}}else{socket[_0x1bf4('0x4f')](_0x1bf4('0x50'),{'UserId':Number(_0xe8863e[_0x1bf4('0x29')][_0x1bf4('0x4b')]),'SquareProjectId':Number(_0xe8863e['params']['id'])});}});}})[_0x1bf4('0x16')](respondWithStatusCode(_0x4092f7,null))[_0x1bf4('0x3f')](handleError(_0x4092f7,null));};exports[_0x1bf4('0x51')]=function(_0x313cfa,_0x2cfc6f){var _0x1ca2c9={};var _0x615654={};var _0x5d9611;var _0x68f27d;return db[_0x1bf4('0x24')]['findOne']({'where':{'id':_0x313cfa[_0x1bf4('0x3d')]['id']}})[_0x1bf4('0x16')](handleEntityNotFound(_0x2cfc6f,null))[_0x1bf4('0x16')](function(_0x1bddfc){if(_0x1bddfc){_0x5d9611=_0x1bddfc;_0x615654['model']=_['keys'](db[_0x1bf4('0x52')]['rawAttributes']);_0x615654['query']=_['keys'](_0x313cfa[_0x1bf4('0x29')]);_0x615654['filters']=_[_0x1bf4('0x2b')](_0x615654[_0x1bf4('0x2d')],_0x615654['query']);_0x1ca2c9[_0x1bf4('0x2c')]=_[_0x1bf4('0x2b')](_0x615654[_0x1bf4('0x2d')],qs[_0x1bf4('0x2e')](_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x2e')]));_0x1ca2c9['attributes']=_0x1ca2c9['attributes'][_0x1bf4('0x2f')]?_0x1ca2c9[_0x1bf4('0x2c')]:_0x615654[_0x1bf4('0x2d')];_0x1ca2c9['order']=qs[_0x1bf4('0x32')](_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x32')]);_0x1ca2c9[_0x1bf4('0x33')]=qs['filters'](_[_0x1bf4('0x48')](_0x313cfa[_0x1bf4('0x29')],_0x615654['filters']));if(_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x35')]){_0x1ca2c9[_0x1bf4('0x33')]=_[_0x1bf4('0x36')](_0x1ca2c9['where'],{'$or':_['map'](_0x1ca2c9['attributes'],function(_0x1b284c){var _0x2c5745={};_0x2c5745[_0x1b284c]={'$like':'%'+_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x35')]+'%'};return _0x2c5745;})});}_0x1ca2c9=_['merge']({},_0x1ca2c9,_0x313cfa[_0x1bf4('0x38')]);return _0x5d9611['getUsers'](_0x1ca2c9);}})[_0x1bf4('0x16')](function(_0x3ee4cb){if(_0x3ee4cb){_0x68f27d=_0x3ee4cb[_0x1bf4('0x2f')];if(!_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x53')](_0x1bf4('0x30'))){_0x1ca2c9[_0x1bf4('0x13')]=qs[_0x1bf4('0x13')](_0x313cfa[_0x1bf4('0x29')][_0x1bf4('0x13')]);_0x1ca2c9['offset']=qs[_0x1bf4('0x10')](_0x313cfa[_0x1bf4('0x29')]['offset']);}return _0x5d9611[_0x1bf4('0x51')](_0x1ca2c9);}})['then'](function(_0x27f997){if(_0x27f997){return _0x27f997?{'count':_0x68f27d,'rows':_0x27f997}:null;}})[_0x1bf4('0x16')](respondWithResult(_0x2cfc6f,null))[_0x1bf4('0x3f')](handleError(_0x2cfc6f,null));}; \ No newline at end of file +var _0xcb9d=['limit','count','Content-Range','update','destroy','then','get','SquareProjects','stringify','error','stack','name','net','Socket','connect','agi','127.0.0.1','index','map','SquareProject','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','filter','merge','includeAll','include','findAll','rows','params','rawAttributes','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','keys','User','getUsers','lodash','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','undefined'];(function(_0x48100b,_0x22674a){var _0x35dd0b=function(_0x1e1f2c){while(--_0x1e1f2c){_0x48100b['push'](_0x48100b['shift']());}};_0x35dd0b(++_0x22674a);}(_0xcb9d,0x13c));var _0xdcb9=function(_0x5d579a,_0x6918c7){_0x5d579a=_0x5d579a-0x0;var _0x2d0610=_0xcb9d[_0x5d579a];return _0x2d0610;};'use strict';var _=require(_0xdcb9('0x0'));var Redis=require(_0xdcb9('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xdcb9('0x2'))('api');var config=require('../../config/environment');var db=require(_0xdcb9('0x3'))['db'];config[_0xdcb9('0x4')]=_[_0xdcb9('0x5')](config['redis'],{'host':_0xdcb9('0x6'),'port':0x18eb});var socket=require(_0xdcb9('0x7'))(new Redis(config[_0xdcb9('0x4')]));require(_0xdcb9('0x8'))[_0xdcb9('0x9')](socket);function respondWithStatusCode(_0x5acca7,_0x406a5e){_0x406a5e=_0x406a5e||0xcc;return function(_0x5792fb){if(_0x5792fb){return _0x5acca7[_0xdcb9('0xa')](_0x406a5e);}return _0x5acca7['status'](_0x406a5e)[_0xdcb9('0xb')]();};}function respondWithResult(_0xcab6ac,_0x35aa40){_0x35aa40=_0x35aa40||0xc8;return function(_0x4b9a87){if(_0x4b9a87){return _0xcab6ac[_0xdcb9('0xc')](_0x35aa40)[_0xdcb9('0xd')](_0x4b9a87);}};}function respondWithFilteredResult(_0x1199e2,_0x375dab){return function(_0x1f2908){if(_0x1f2908){var _0x34ba03=typeof _0x375dab[_0xdcb9('0xe')]===_0xdcb9('0xf')&&typeof _0x375dab[_0xdcb9('0x10')]===_0xdcb9('0xf');var _0x564ec5=_0x1f2908[_0xdcb9('0x11')];var _0x47e9a4=_0x34ba03?0x0:_0x375dab[_0xdcb9('0xe')];var _0x131b7d=_0x34ba03?_0x1f2908[_0xdcb9('0x11')]:_0x375dab[_0xdcb9('0xe')]+_0x375dab[_0xdcb9('0x10')];var _0x3e63c4;if(_0x131b7d>=_0x564ec5){_0x131b7d=_0x564ec5;_0x3e63c4=0xc8;}else{_0x3e63c4=0xce;}_0x1199e2[_0xdcb9('0xc')](_0x3e63c4);return _0x1199e2['set'](_0xdcb9('0x12'),_0x47e9a4+'-'+_0x131b7d+'/'+_0x564ec5)['json'](_0x1f2908);}return null;};}function saveUpdates(_0xd49b45){return function(_0x58b867){if(_0x58b867){return _0x58b867[_0xdcb9('0x13')](_0xd49b45)['then'](function(_0x4075be){return _0x4075be;});}return null;};}function removeEntity(_0x4a8d8c){return function(_0x2d3c4d){if(_0x2d3c4d){return _0x2d3c4d[_0xdcb9('0x14')]()[_0xdcb9('0x15')](function(){var _0x2a280c=_0x2d3c4d[_0xdcb9('0x16')]({'plain':!![]});var _0x117ef8=_0xdcb9('0x17');return db['UserProfileResource'][_0xdcb9('0x14')]({'where':{'type':_0x117ef8,'resourceId':_0x2a280c['id']}})['then'](function(){return _0x2d3c4d;});})['then'](function(){return createAgiSocket();})[_0xdcb9('0x15')](function(_0x1a37e6){_0x1a37e6['end'](JSON[_0xdcb9('0x18')]({'id':_0x2d3c4d['id'],'deleted':!![]}));})[_0xdcb9('0x15')](function(){_0x4a8d8c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1127b0){return function(_0x42ce6c){if(!_0x42ce6c){_0x1127b0[_0xdcb9('0xa')](0x194);}return _0x42ce6c;};}function handleError(_0x258806,_0x54f19e){_0x54f19e=_0x54f19e||0x1f4;return function(_0xaa3400){logger[_0xdcb9('0x19')](_0xaa3400[_0xdcb9('0x1a')]);if(_0xaa3400[_0xdcb9('0x1b')]){delete _0xaa3400['name'];}_0x258806['status'](_0x54f19e)['send'](_0xaa3400);};}function createAgiSocket(){try{var _0xc95fc2=require(_0xdcb9('0x1c'));var _0x161f6d=new _0xc95fc2[(_0xdcb9('0x1d'))]();return _0x161f6d[_0xdcb9('0x1e')](config[_0xdcb9('0x1f')]['port']||0x11dd,_0xdcb9('0x20'));}catch(_0x22ba14){throw _0x22ba14;}}exports[_0xdcb9('0x21')]=function(_0x4df2cb,_0x9289cf){var _0x5b1848={},_0x4a826b={},_0x51a81a={'count':0x0,'rows':[]};var _0x46164d=_[_0xdcb9('0x22')](db[_0xdcb9('0x23')]['rawAttributes'],function(_0x24c958){return{'name':_0x24c958[_0xdcb9('0x24')],'type':_0x24c958['type']['key']};});_0x4a826b[_0xdcb9('0x25')]=_[_0xdcb9('0x22')](_0x46164d,_0xdcb9('0x1b'));_0x4a826b[_0xdcb9('0x26')]=_['keys'](_0x4df2cb[_0xdcb9('0x26')]);_0x4a826b['filters']=_[_0xdcb9('0x27')](_0x4a826b[_0xdcb9('0x25')],_0x4a826b[_0xdcb9('0x26')]);_0x5b1848['attributes']=_[_0xdcb9('0x27')](_0x4a826b[_0xdcb9('0x25')],qs[_0xdcb9('0x28')](_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x28')]));_0x5b1848[_0xdcb9('0x29')]=_0x5b1848[_0xdcb9('0x29')][_0xdcb9('0x2a')]?_0x5b1848[_0xdcb9('0x29')]:_0x4a826b['model'];if(!_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x2b')](_0xdcb9('0x2c'))){_0x5b1848[_0xdcb9('0x10')]=qs[_0xdcb9('0x10')](_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x10')]);_0x5b1848[_0xdcb9('0xe')]=qs['offset'](_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0xe')]);}_0x5b1848[_0xdcb9('0x2d')]=qs['sort'](_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x2e')]);_0x5b1848[_0xdcb9('0x2f')]=qs[_0xdcb9('0x30')](_[_0xdcb9('0x31')](_0x4df2cb[_0xdcb9('0x26')],_0x4a826b[_0xdcb9('0x30')]),_0x46164d);if(_0x4df2cb[_0xdcb9('0x26')]['filter']){_0x5b1848[_0xdcb9('0x2f')]=_['merge'](_0x5b1848['where'],{'$or':_[_0xdcb9('0x22')](_0x46164d,function(_0x949e39){if(_0x949e39[_0xdcb9('0x32')]!=='VIRTUAL'){var _0x460880={};_0x460880[_0x949e39['name']]={'$like':'%'+_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x33')]+'%'};return _0x460880;}})});}_0x5b1848=_[_0xdcb9('0x34')]({},_0x5b1848,_0x4df2cb['options']);var _0x5708fc={'where':_0x5b1848[_0xdcb9('0x2f')]};return db[_0xdcb9('0x23')][_0xdcb9('0x11')](_0x5708fc)[_0xdcb9('0x15')](function(_0x30c4d7){_0x51a81a[_0xdcb9('0x11')]=_0x30c4d7;if(_0x4df2cb[_0xdcb9('0x26')][_0xdcb9('0x35')]){_0x5b1848[_0xdcb9('0x36')]=[{'all':!![]}];}return db[_0xdcb9('0x23')][_0xdcb9('0x37')](_0x5b1848);})[_0xdcb9('0x15')](function(_0xc14fb1){_0x51a81a[_0xdcb9('0x38')]=_0xc14fb1;return _0x51a81a;})[_0xdcb9('0x15')](respondWithFilteredResult(_0x9289cf,_0x5b1848))['catch'](handleError(_0x9289cf,null));};exports['show']=function(_0x133fe8,_0x3117b0){var _0xf526d1={'raw':![],'where':{'id':_0x133fe8[_0xdcb9('0x39')]['id']}},_0x291309={};_0x291309[_0xdcb9('0x25')]=_['keys'](db[_0xdcb9('0x23')][_0xdcb9('0x3a')]);_0x291309[_0xdcb9('0x26')]=_['keys'](_0x133fe8[_0xdcb9('0x26')]);_0x291309['filters']=_[_0xdcb9('0x27')](_0x291309[_0xdcb9('0x25')],_0x291309[_0xdcb9('0x26')]);_0xf526d1[_0xdcb9('0x29')]=_['intersection'](_0x291309[_0xdcb9('0x25')],qs[_0xdcb9('0x28')](_0x133fe8[_0xdcb9('0x26')][_0xdcb9('0x28')]));_0xf526d1['attributes']=_0xf526d1['attributes'][_0xdcb9('0x2a')]?_0xf526d1[_0xdcb9('0x29')]:_0x291309['model'];if(_0x133fe8[_0xdcb9('0x26')]['includeAll']){_0xf526d1[_0xdcb9('0x36')]=[{'all':!![]}];}_0xf526d1=_[_0xdcb9('0x34')]({},_0xf526d1,_0x133fe8[_0xdcb9('0x3b')]);return db[_0xdcb9('0x23')]['find'](_0xf526d1)[_0xdcb9('0x15')](handleEntityNotFound(_0x3117b0,null))[_0xdcb9('0x15')](respondWithResult(_0x3117b0,null))[_0xdcb9('0x3c')](handleError(_0x3117b0,null));};exports[_0xdcb9('0x3d')]=function(_0x5218de,_0x2e9a6a){return db[_0xdcb9('0x23')]['create'](_0x5218de[_0xdcb9('0x3e')],{})[_0xdcb9('0x15')](function(_0x3527b6){var _0x4a7b1e=_0x5218de[_0xdcb9('0x3f')][_0xdcb9('0x16')]({'plain':!![]});if(!_0x4a7b1e)throw new Error(_0xdcb9('0x40'));if(_0x4a7b1e['role']===_0xdcb9('0x3f')){var _0x1b9faa=_0x3527b6[_0xdcb9('0x16')]({'plain':!![]});var _0x13ad77='SquareProjects';return db[_0xdcb9('0x41')][_0xdcb9('0x42')]({'where':{'name':_0x13ad77,'userProfileId':_0x4a7b1e['userProfileId']},'raw':!![]})['then'](function(_0x331547){if(_0x331547&&_0x331547[_0xdcb9('0x43')]===0x0){return db[_0xdcb9('0x44')][_0xdcb9('0x3d')]({'name':_0x1b9faa[_0xdcb9('0x1b')],'resourceId':_0x1b9faa['id'],'type':_0x331547[_0xdcb9('0x1b')],'sectionId':_0x331547['id']},{})[_0xdcb9('0x15')](function(){return _0x3527b6;});}else{return _0x3527b6;}})[_0xdcb9('0x3c')](function(_0x1dd1c0){logger['error'](_0xdcb9('0x45'),_0x1dd1c0);throw _0x1dd1c0;});}return _0x3527b6;})[_0xdcb9('0x15')](respondWithResult(_0x2e9a6a,0xc9))[_0xdcb9('0x3c')](handleError(_0x2e9a6a,null));};exports[_0xdcb9('0x13')]=function(_0x1cde26,_0x223137){if(_0x1cde26['body']['id']){delete _0x1cde26['body']['id'];}return db[_0xdcb9('0x23')][_0xdcb9('0x42')]({'where':{'id':_0x1cde26[_0xdcb9('0x39')]['id']}})['then'](handleEntityNotFound(_0x223137,null))[_0xdcb9('0x15')](saveUpdates(_0x1cde26[_0xdcb9('0x3e')],null))[_0xdcb9('0x15')](function(_0x2bc54b){if(!_0x2bc54b)return;var _0x57254d=_0x2bc54b['get']({'plain':!![]});return[createAgiSocket(),_0x57254d];})[_0xdcb9('0x46')](function(_0x372bbf,_0x39644c){_0x372bbf[_0xdcb9('0xb')](JSON[_0xdcb9('0x18')](_[_0xdcb9('0x31')](_0x39644c,['id','name',_0xdcb9('0x47')])));return _0x39644c;})[_0xdcb9('0x15')](respondWithResult(_0x223137,null))[_0xdcb9('0x3c')](handleError(_0x223137,null));};exports['destroy']=function(_0x3ff462,_0x558bc4){return db[_0xdcb9('0x23')][_0xdcb9('0x42')]({'where':{'id':_0x3ff462[_0xdcb9('0x39')]['id']}})[_0xdcb9('0x15')](handleEntityNotFound(_0x558bc4,null))[_0xdcb9('0x15')](removeEntity(_0x558bc4,null))[_0xdcb9('0x3c')](handleError(_0x558bc4,null));};exports[_0xdcb9('0x48')]=function(_0x4930bb,_0x4ceaa7){return db[_0xdcb9('0x23')][_0xdcb9('0x42')]({'where':{'id':_0x4930bb['params']['id']}})[_0xdcb9('0x15')](handleEntityNotFound(_0x4ceaa7,null))[_0xdcb9('0x15')](function(_0x2ceb4f){if(_0x2ceb4f){return _0x2ceb4f[_0xdcb9('0x48')](_0x4930bb['body'][_0xdcb9('0x49')],_[_0xdcb9('0x4a')](_0x4930bb[_0xdcb9('0x3e')],['ids','id'])||{});}})[_0xdcb9('0x15')](respondWithResult(_0x4ceaa7,null))[_0xdcb9('0x3c')](handleError(_0x4ceaa7,null));};exports['removeUsers']=function(_0x4e16e9,_0x529178){return db[_0xdcb9('0x23')][_0xdcb9('0x42')]({'where':{'id':_0x4e16e9[_0xdcb9('0x39')]['id']}})['then'](handleEntityNotFound(_0x529178,null))[_0xdcb9('0x15')](function(_0x34058f){if(_0x34058f){return _0x34058f[_0xdcb9('0x4b')](_0x4e16e9[_0xdcb9('0x26')][_0xdcb9('0x49')])[_0xdcb9('0x15')](function(){if(_[_0xdcb9('0x4c')](_0x4e16e9[_0xdcb9('0x26')]['ids'])){for(var _0xab21b0=0x0;_0xab21b0<_0x4e16e9[_0xdcb9('0x26')][_0xdcb9('0x49')][_0xdcb9('0x2a')];_0xab21b0+=0x1){socket[_0xdcb9('0x4d')](_0xdcb9('0x4e'),{'UserId':Number(_0x4e16e9[_0xdcb9('0x26')][_0xdcb9('0x49')][_0xab21b0]),'SquareProjectId':Number(_0x4e16e9[_0xdcb9('0x39')]['id'])});}}else{socket[_0xdcb9('0x4d')]('userSquareProject:remove',{'UserId':Number(_0x4e16e9[_0xdcb9('0x26')][_0xdcb9('0x49')]),'SquareProjectId':Number(_0x4e16e9[_0xdcb9('0x39')]['id'])});}});}})[_0xdcb9('0x15')](respondWithStatusCode(_0x529178,null))[_0xdcb9('0x3c')](handleError(_0x529178,null));};exports['getUsers']=function(_0x2024dd,_0x29fd88){var _0x186a8f={};var _0x33f71e={};var _0x3bdadd;var _0x5f4b95;return db[_0xdcb9('0x23')][_0xdcb9('0x4f')]({'where':{'id':_0x2024dd[_0xdcb9('0x39')]['id']}})[_0xdcb9('0x15')](handleEntityNotFound(_0x29fd88,null))[_0xdcb9('0x15')](function(_0x4bed5d){if(_0x4bed5d){_0x3bdadd=_0x4bed5d;_0x33f71e[_0xdcb9('0x25')]=_[_0xdcb9('0x50')](db[_0xdcb9('0x51')][_0xdcb9('0x3a')]);_0x33f71e[_0xdcb9('0x26')]=_[_0xdcb9('0x50')](_0x2024dd[_0xdcb9('0x26')]);_0x33f71e[_0xdcb9('0x30')]=_[_0xdcb9('0x27')](_0x33f71e[_0xdcb9('0x25')],_0x33f71e[_0xdcb9('0x26')]);_0x186a8f['attributes']=_[_0xdcb9('0x27')](_0x33f71e['model'],qs['fields'](_0x2024dd[_0xdcb9('0x26')][_0xdcb9('0x28')]));_0x186a8f['attributes']=_0x186a8f[_0xdcb9('0x29')]['length']?_0x186a8f[_0xdcb9('0x29')]:_0x33f71e[_0xdcb9('0x25')];_0x186a8f[_0xdcb9('0x2d')]=qs['sort'](_0x2024dd[_0xdcb9('0x26')][_0xdcb9('0x2e')]);_0x186a8f[_0xdcb9('0x2f')]=qs['filters'](_[_0xdcb9('0x31')](_0x2024dd[_0xdcb9('0x26')],_0x33f71e[_0xdcb9('0x30')]));if(_0x2024dd[_0xdcb9('0x26')]['filter']){_0x186a8f[_0xdcb9('0x2f')]=_['merge'](_0x186a8f[_0xdcb9('0x2f')],{'$or':_[_0xdcb9('0x22')](_0x186a8f[_0xdcb9('0x29')],function(_0x2a19c0){var _0x44d63a={};_0x44d63a[_0x2a19c0]={'$like':'%'+_0x2024dd[_0xdcb9('0x26')][_0xdcb9('0x33')]+'%'};return _0x44d63a;})});}_0x186a8f=_[_0xdcb9('0x34')]({},_0x186a8f,_0x2024dd['options']);return _0x3bdadd[_0xdcb9('0x52')](_0x186a8f);}})[_0xdcb9('0x15')](function(_0x4961a7){if(_0x4961a7){_0x5f4b95=_0x4961a7[_0xdcb9('0x2a')];if(!_0x2024dd[_0xdcb9('0x26')][_0xdcb9('0x2b')]('nolimit')){_0x186a8f[_0xdcb9('0x10')]=qs[_0xdcb9('0x10')](_0x2024dd[_0xdcb9('0x26')]['limit']);_0x186a8f[_0xdcb9('0xe')]=qs[_0xdcb9('0xe')](_0x2024dd[_0xdcb9('0x26')][_0xdcb9('0xe')]);}return _0x3bdadd['getUsers'](_0x186a8f);}})[_0xdcb9('0x15')](function(_0x302c42){if(_0x302c42){return _0x302c42?{'count':_0x5f4b95,'rows':_0x302c42}:null;}})['then'](respondWithResult(_0x29fd88,null))[_0xdcb9('0x3c')](handleError(_0x29fd88,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3635a27..2e15762 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 _0xa26c=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x17c666,_0x38f065){var _0x140d8c=function(_0x2a9350){while(--_0x2a9350){_0x17c666['push'](_0x17c666['shift']());}};_0x140d8c(++_0x38f065);}(_0xa26c,0x1dd));var _0xca26=function(_0x4388c9,_0x2dfb5d){_0x4388c9=_0x4388c9-0x0;var _0x1df9ac=_0xa26c[_0x4388c9];return _0x1df9ac;};'use strict';var EventEmitter=require(_0xca26('0x0'));var SquareProject=require(_0xca26('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xca26('0x2')](0x0);var events={'afterCreate':_0xca26('0x3'),'afterUpdate':_0xca26('0x4'),'afterDestroy':_0xca26('0x5')};function emitEvent(_0x17354a){return function(_0x27fd8a,_0x1524d3,_0x540ad0){SquareProjectEvents['emit'](_0x17354a+':'+_0x27fd8a['id'],_0x27fd8a);SquareProjectEvents[_0xca26('0x6')](_0x17354a,_0x27fd8a);_0x540ad0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xca26('0x7')](e,emitEvent(event));}}module[_0xca26('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x1f6a=['save','update','remove','emit','hook','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x18eeaa,_0x4380b6){var _0x23d240=function(_0x864c98){while(--_0x864c98){_0x18eeaa['push'](_0x18eeaa['shift']());}};_0x23d240(++_0x4380b6);}(_0x1f6a,0x152));var _0xa1f6=function(_0x2f5297,_0x2b93fc){_0x2f5297=_0x2f5297-0x0;var _0x446f62=_0x1f6a[_0x2f5297];return _0x446f62;};'use strict';var EventEmitter=require(_0xa1f6('0x0'));var SquareProject=require(_0xa1f6('0x1'))['db'][_0xa1f6('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa1f6('0x3')](0x0);var events={'afterCreate':_0xa1f6('0x4'),'afterUpdate':_0xa1f6('0x5'),'afterDestroy':_0xa1f6('0x6')};function emitEvent(_0x54c196){return function(_0x1ad6d5,_0x2eee8e,_0x3b1fe4){SquareProjectEvents[_0xa1f6('0x7')](_0x54c196+':'+_0x1ad6d5['id'],_0x1ad6d5);SquareProjectEvents[_0xa1f6('0x7')](_0x54c196,_0x1ad6d5);_0x3b1fe4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa1f6('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 ed0a3fe..0546f05 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 _0x9684=['production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','preproduction','savedAt','format','changed'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0x9684,0x6f));var _0x4968=function(_0x3b6792,_0x463510){_0x3b6792=_0x3b6792-0x0;var _0x219716=_0x9684[_0x3b6792];return _0x219716;};'use strict';var _=require(_0x4968('0x0'));var util=require(_0x4968('0x1'));var logger=require('../../config/logger')(_0x4968('0x2'));var moment=require(_0x4968('0x3'));var BPromise=require(_0x4968('0x4'));var rp=require(_0x4968('0x5'));var fs=require('fs');var path=require(_0x4968('0x6'));var rimraf=require(_0x4968('0x7'));var config=require(_0x4968('0x8'));var attributes=require('./squareProject.attributes');module[_0x4968('0x9')]=function(_0x2f51c4,_0x2de003){return _0x2f51c4[_0x4968('0xa')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4edc0f,_0x156ee9,_0x3d7c0f){if(_0x4edc0f['changed'](_0x4968('0xb'))){_0x4edc0f[_0x4968('0xc')]=moment()[_0x4968('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4edc0f[_0x4968('0xe')](_0x4968('0xf'))){_0x4edc0f[_0x4968('0x10')]=moment()[_0x4968('0xd')](_0x4968('0x11'));}_0x3d7c0f(null,_0x4edc0f);}}});}; \ No newline at end of file +var _0x9a66=['SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x5490,_0x5dfa44){var _0x5c04d2=function(_0x2dce2b){while(--_0x2dce2b){_0x5490['push'](_0x5490['shift']());}};_0x5c04d2(++_0x5dfa44);}(_0x9a66,0x179));var _0x69a6=function(_0x1f123a,_0x56897d){_0x1f123a=_0x1f123a-0x0;var _0x44433a=_0x9a66[_0x1f123a];return _0x44433a;};'use strict';var _=require('lodash');var util=require(_0x69a6('0x0'));var logger=require(_0x69a6('0x1'))(_0x69a6('0x2'));var moment=require(_0x69a6('0x3'));var BPromise=require('bluebird');var rp=require(_0x69a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69a6('0x5'));var config=require(_0x69a6('0x6'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x15ec88,_0x51a3fc){return _0x15ec88['define'](_0x69a6('0x7'),attributes,{'tableName':_0x69a6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ab906,_0x4e5ab7,_0x2611b5){if(_0x4ab906[_0x69a6('0x9')](_0x69a6('0xa'))){_0x4ab906[_0x69a6('0xb')]=moment()[_0x69a6('0xc')](_0x69a6('0xd'));}if(_0x4ab906[_0x69a6('0x9')](_0x69a6('0xe'))){_0x4ab906[_0x69a6('0xf')]=moment()[_0x69a6('0xc')](_0x69a6('0xd'));}_0x2611b5(null,_0x4ab906);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c476b57..acef235 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 _0x29da=['GetSquareProjects','debug','stringify','catch','message','error','find','ShowSquareProject','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info'];(function(_0x384613,_0x3088f2){var _0xff585f=function(_0xa61815){while(--_0xa61815){_0x384613['push'](_0x384613['shift']());}};_0xff585f(++_0x3088f2);}(_0x29da,0xa3));var _0xa29d=function(_0x152b5c,_0x1f0a46){_0x152b5c=_0x152b5c-0x0;var _0x5603fd=_0x29da[_0x152b5c];return _0x5603fd;};'use strict';var _=require(_0xa29d('0x0'));var Redis=require(_0xa29d('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xa29d('0x2'))(_0xa29d('0x3'));var config=require(_0xa29d('0x4'));config[_0xa29d('0x5')]=_[_0xa29d('0x6')](config[_0xa29d('0x5')],{'host':_0xa29d('0x7'),'port':0x18eb});var socket=require(_0xa29d('0x8'))(new Redis(config[_0xa29d('0x5')]));require(_0xa29d('0x9'))[_0xa29d('0xa')](socket);exports['GetSquareProjects']=function(_0x411fca){var _0x5a0ff2=this;return new Promise(function(_0x5703ba,_0x528dd2){return db[_0xa29d('0xb')][_0xa29d('0xc')]({'raw':_0x411fca[_0xa29d('0xd')]?_0x411fca[_0xa29d('0xd')][_0xa29d('0xe')]===undefined?!![]:![]:!![],'where':_0x411fca[_0xa29d('0xd')]?_0x411fca[_0xa29d('0xd')][_0xa29d('0xf')]||null:null,'attributes':_0x411fca[_0xa29d('0xd')]?_0x411fca[_0xa29d('0xd')][_0xa29d('0x10')]||null:null,'limit':_0x411fca[_0xa29d('0xd')]?_0x411fca[_0xa29d('0xd')][_0xa29d('0x11')]||null:null,'include':_0x411fca[_0xa29d('0xd')]?_0x411fca[_0xa29d('0xd')]['include']?_[_0xa29d('0x12')](_0x411fca['options'][_0xa29d('0x13')],function(_0xaefb26){return{'model':db[_0xaefb26[_0xa29d('0x14')]],'as':_0xaefb26['as'],'attributes':_0xaefb26[_0xa29d('0x10')],'include':_0xaefb26[_0xa29d('0x13')]?_['map'](_0xaefb26['include'],function(_0x5b5ee5){return{'model':db[_0x5b5ee5[_0xa29d('0x14')]],'as':_0x5b5ee5['as'],'attributes':_0x5b5ee5[_0xa29d('0x10')],'include':_0x5b5ee5[_0xa29d('0x13')]?_[_0xa29d('0x12')](_0x5b5ee5[_0xa29d('0x13')],function(_0x1f4763){return{'model':db[_0x1f4763[_0xa29d('0x14')]],'as':_0x1f4763['as'],'attributes':_0x1f4763[_0xa29d('0x10')]};}):[]};}):[]};}):[]:[]})[_0xa29d('0x15')](function(_0x2263ab){logger[_0xa29d('0x16')](_0xa29d('0x17'),_0x411fca);logger[_0xa29d('0x18')](_0xa29d('0x17'),_0x411fca,JSON[_0xa29d('0x19')](_0x2263ab));_0x5703ba(_0x2263ab);})[_0xa29d('0x1a')](function(_0x5f2bbd){logger['error'](_0xa29d('0x17'),_0x5f2bbd[_0xa29d('0x1b')],_0x411fca);_0x528dd2(_0x5a0ff2[_0xa29d('0x1c')](0x1f4,_0x5f2bbd[_0xa29d('0x1b')]));});});};exports['ShowSquareProject']=function(_0x43f18a){var _0x2c26a0=this;return new Promise(function(_0x1f0a1d,_0x2dfad3){return db[_0xa29d('0xb')][_0xa29d('0x1d')]({'raw':_0x43f18a[_0xa29d('0xd')]?_0x43f18a[_0xa29d('0xd')][_0xa29d('0xe')]===undefined?!![]:![]:!![],'where':_0x43f18a['options']?_0x43f18a[_0xa29d('0xd')]['where']||null:null,'attributes':_0x43f18a[_0xa29d('0xd')]?_0x43f18a[_0xa29d('0xd')][_0xa29d('0x10')]||null:null,'include':_0x43f18a['options']?_0x43f18a['options'][_0xa29d('0x13')]?_[_0xa29d('0x12')](_0x43f18a['options'][_0xa29d('0x13')],function(_0x5e9e14){return{'model':db[_0x5e9e14[_0xa29d('0x14')]],'as':_0x5e9e14['as'],'attributes':_0x5e9e14[_0xa29d('0x10')],'include':_0x5e9e14[_0xa29d('0x13')]?_[_0xa29d('0x12')](_0x5e9e14[_0xa29d('0x13')],function(_0x277173){return{'model':db[_0x277173[_0xa29d('0x14')]],'as':_0x277173['as'],'attributes':_0x277173['attributes'],'include':_0x277173[_0xa29d('0x13')]?_['map'](_0x277173[_0xa29d('0x13')],function(_0x4fedbc){return{'model':db[_0x4fedbc['model']],'as':_0x4fedbc['as'],'attributes':_0x4fedbc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43ab39){logger['info'](_0xa29d('0x1e'),_0x43f18a);logger['debug'](_0xa29d('0x1e'),_0x43f18a,JSON[_0xa29d('0x19')](_0x43ab39));_0x1f0a1d(_0x43ab39);})['catch'](function(_0xd68374){logger[_0xa29d('0x1c')](_0xa29d('0x1e'),_0xd68374['message'],_0x43f18a);_0x2dfad3(_0x2c26a0[_0xa29d('0x1c')](0x1f4,_0xd68374[_0xa29d('0x1b')]));});});}; \ No newline at end of file +var _0xf6c3=['SquareProject','options','raw','attributes','limit','include','map','model','then','info','debug','stringify','error','message','ShowSquareProject','find','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects'];(function(_0x3e5134,_0xf81cb9){var _0x550cd4=function(_0x30ddc7){while(--_0x30ddc7){_0x3e5134['push'](_0x3e5134['shift']());}};_0x550cd4(++_0xf81cb9);}(_0xf6c3,0x11f));var _0x3f6c=function(_0x30213b,_0x2f0782){_0x30213b=_0x30213b-0x0;var _0x2c78e6=_0xf6c3[_0x30213b];return _0x2c78e6;};'use strict';var _=require(_0x3f6c('0x0'));var Redis=require(_0x3f6c('0x1'));var db=require(_0x3f6c('0x2'))['db'];var logger=require(_0x3f6c('0x3'))(_0x3f6c('0x4'));var config=require(_0x3f6c('0x5'));config[_0x3f6c('0x6')]=_[_0x3f6c('0x7')](config[_0x3f6c('0x6')],{'host':_0x3f6c('0x8'),'port':0x18eb});var socket=require(_0x3f6c('0x9'))(new Redis(config[_0x3f6c('0x6')]));require(_0x3f6c('0xa'))[_0x3f6c('0xb')](socket);exports[_0x3f6c('0xc')]=function(_0x31c61c){var _0x5aa970=this;return new Promise(function(_0x101aa6,_0x3c0d19){return db[_0x3f6c('0xd')]['findAll']({'raw':_0x31c61c[_0x3f6c('0xe')]?_0x31c61c['options'][_0x3f6c('0xf')]===undefined?!![]:![]:!![],'where':_0x31c61c[_0x3f6c('0xe')]?_0x31c61c[_0x3f6c('0xe')]['where']||null:null,'attributes':_0x31c61c[_0x3f6c('0xe')]?_0x31c61c[_0x3f6c('0xe')][_0x3f6c('0x10')]||null:null,'limit':_0x31c61c[_0x3f6c('0xe')]?_0x31c61c[_0x3f6c('0xe')][_0x3f6c('0x11')]||null:null,'include':_0x31c61c[_0x3f6c('0xe')]?_0x31c61c[_0x3f6c('0xe')][_0x3f6c('0x12')]?_[_0x3f6c('0x13')](_0x31c61c[_0x3f6c('0xe')][_0x3f6c('0x12')],function(_0x37badc){return{'model':db[_0x37badc[_0x3f6c('0x14')]],'as':_0x37badc['as'],'attributes':_0x37badc['attributes'],'include':_0x37badc['include']?_[_0x3f6c('0x13')](_0x37badc[_0x3f6c('0x12')],function(_0x3fb0b4){return{'model':db[_0x3fb0b4['model']],'as':_0x3fb0b4['as'],'attributes':_0x3fb0b4[_0x3f6c('0x10')],'include':_0x3fb0b4[_0x3f6c('0x12')]?_[_0x3f6c('0x13')](_0x3fb0b4[_0x3f6c('0x12')],function(_0x59e554){return{'model':db[_0x59e554[_0x3f6c('0x14')]],'as':_0x59e554['as'],'attributes':_0x59e554[_0x3f6c('0x10')]};}):[]};}):[]};}):[]:[]})[_0x3f6c('0x15')](function(_0x5d2dda){logger[_0x3f6c('0x16')](_0x3f6c('0xc'),_0x31c61c);logger[_0x3f6c('0x17')](_0x3f6c('0xc'),_0x31c61c,JSON[_0x3f6c('0x18')](_0x5d2dda));_0x101aa6(_0x5d2dda);})['catch'](function(_0xa1c67e){logger[_0x3f6c('0x19')]('GetSquareProjects',_0xa1c67e[_0x3f6c('0x1a')],_0x31c61c);_0x3c0d19(_0x5aa970[_0x3f6c('0x19')](0x1f4,_0xa1c67e['message']));});});};exports[_0x3f6c('0x1b')]=function(_0xc818b5){var _0x13ee88=this;return new Promise(function(_0x1103e0,_0x57c594){return db[_0x3f6c('0xd')][_0x3f6c('0x1c')]({'raw':_0xc818b5[_0x3f6c('0xe')]?_0xc818b5[_0x3f6c('0xe')][_0x3f6c('0xf')]===undefined?!![]:![]:!![],'where':_0xc818b5[_0x3f6c('0xe')]?_0xc818b5[_0x3f6c('0xe')]['where']||null:null,'attributes':_0xc818b5[_0x3f6c('0xe')]?_0xc818b5[_0x3f6c('0xe')][_0x3f6c('0x10')]||null:null,'include':_0xc818b5['options']?_0xc818b5[_0x3f6c('0xe')]['include']?_[_0x3f6c('0x13')](_0xc818b5[_0x3f6c('0xe')][_0x3f6c('0x12')],function(_0x47dd61){return{'model':db[_0x47dd61[_0x3f6c('0x14')]],'as':_0x47dd61['as'],'attributes':_0x47dd61[_0x3f6c('0x10')],'include':_0x47dd61['include']?_['map'](_0x47dd61['include'],function(_0x31bfcb){return{'model':db[_0x31bfcb[_0x3f6c('0x14')]],'as':_0x31bfcb['as'],'attributes':_0x31bfcb[_0x3f6c('0x10')],'include':_0x31bfcb[_0x3f6c('0x12')]?_[_0x3f6c('0x13')](_0x31bfcb[_0x3f6c('0x12')],function(_0x51755c){return{'model':db[_0x51755c[_0x3f6c('0x14')]],'as':_0x51755c['as'],'attributes':_0x51755c[_0x3f6c('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26d5f7){logger[_0x3f6c('0x16')](_0x3f6c('0x1b'),_0xc818b5);logger[_0x3f6c('0x17')](_0x3f6c('0x1b'),_0xc818b5,JSON[_0x3f6c('0x18')](_0x26d5f7));_0x1103e0(_0x26d5f7);})[_0x3f6c('0x1d')](function(_0x1387d8){logger['error'](_0x3f6c('0x1b'),_0x1387d8[_0x3f6c('0x1a')],_0xc818b5);_0x57c594(_0x13ee88[_0x3f6c('0x19')](0x1f4,_0x1387d8[_0x3f6c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4910e93..5150be7 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 _0xdd8a=['length','./squareProject.events','save','remove','update','removeListener','register'];(function(_0x47c723,_0x13ac5c){var _0x17b74e=function(_0x553052){while(--_0x553052){_0x47c723['push'](_0x47c723['shift']());}};_0x17b74e(++_0x13ac5c);}(_0xdd8a,0x1f2));var _0xadd8=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xdd8a[_0x37bd26];return _0xe83dc4;};'use strict';var SquareProjectEvents=require(_0xadd8('0x0'));var events=[_0xadd8('0x1'),_0xadd8('0x2'),_0xadd8('0x3')];function createListener(_0x414239,_0x4efd5e){return function(_0x1ab1a1){_0x4efd5e['emit'](_0x414239,_0x1ab1a1);};}function removeListener(_0x2a3302,_0x2f8e97){return function(){SquareProjectEvents[_0xadd8('0x4')](_0x2a3302,_0x2f8e97);};}exports[_0xadd8('0x5')]=function(_0x387b92){for(var _0x4876c3=0x0,_0x14b609=events[_0xadd8('0x6')];_0x4876c3<_0x14b609;_0x4876c3++){var _0x3aea9e=events[_0x4876c3];var _0xdb8434=createListener('squareProject:'+_0x3aea9e,_0x387b92);SquareProjectEvents['on'](_0x3aea9e,_0xdb8434);}}; \ No newline at end of file +var _0xbcc1=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0xf28865,_0x3bb4a0){var _0x3d73d8=function(_0x5ae2d2){while(--_0x5ae2d2){_0xf28865['push'](_0xf28865['shift']());}};_0x3d73d8(++_0x3bb4a0);}(_0xbcc1,0xe9));var _0x1bcc=function(_0xea583c,_0x2a89cc){_0xea583c=_0xea583c-0x0;var _0x13dc09=_0xbcc1[_0xea583c];return _0x13dc09;};'use strict';var SquareProjectEvents=require(_0x1bcc('0x0'));var events=[_0x1bcc('0x1'),_0x1bcc('0x2'),_0x1bcc('0x3')];function createListener(_0x37391c,_0xaf0c1){return function(_0x42f252){_0xaf0c1[_0x1bcc('0x4')](_0x37391c,_0x42f252);};}function removeListener(_0x37baa7,_0x30a176){return function(){SquareProjectEvents[_0x1bcc('0x5')](_0x37baa7,_0x30a176);};}exports[_0x1bcc('0x6')]=function(_0x5b3597){for(var _0x3c293e=0x0,_0x582e6d=events[_0x1bcc('0x7')];_0x3c293e<_0x582e6d;_0x3c293e++){var _0x480966=events[_0x3c293e];var _0x25ff28=createListener(_0x1bcc('0x8')+_0x480966,_0x5b3597);SquareProjectEvents['on'](_0x480966,_0x25ff28);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index dfe54c4..0facf93 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x5e6d4,_0x5d0c09){var _0x550409=function(_0x3b7bf7){while(--_0x3b7bf7){_0x5e6d4['push'](_0x5e6d4['shift']());}};_0x550409(++_0x5d0c09);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x1d519d,_0x332a4e){var _0x5922ad=function(_0x2d7261){while(--_0x2d7261){_0x1d519d['push'](_0x1d519d['shift']());}};_0x5922ad(++_0x332a4e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index bb3c6f0..e4cd315 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 _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x1c2335,_0x2f6f5a){var _0x4ec446=function(_0x5e0b71){while(--_0x5e0b71){_0x1c2335['push'](_0x1c2335['shift']());}};_0x4ec446(++_0x2f6f5a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3993f0,_0x40c90e){_0x3993f0=_0x3993f0-0x0;var _0x4545d9=_0xf2ca[_0x3993f0];return _0x4545d9;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}}; \ No newline at end of file +var _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x314bc6,_0x1e99bd){var _0x1449de=function(_0x5a4872){while(--_0x5a4872){_0x314bc6['push'](_0x314bc6['shift']());}};_0x1449de(++_0x1e99bd);}(_0x55ca,0x126));var _0xa55c=function(_0x20d73e,_0x39f9ec){_0x20d73e=_0x20d73e-0x0;var _0x52e84b=_0x55ca[_0x20d73e];return _0x52e84b;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 52fe47f..f5dc063 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 _0xa4aa=['find','download','../../components/encryptor','filename','format','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','create','body'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa4aa,0x79));var _0xaa4a=function(_0x282c41,_0x106967){_0x282c41=_0x282c41-0x0;var _0x5f546c=_0xa4aa[_0x282c41];return _0x5f546c;};'use strict';var emlformat=require(_0xaa4a('0x0'));var rimraf=require(_0xaa4a('0x1'));var zipdir=require(_0xaa4a('0x2'));var jsonpatch=require(_0xaa4a('0x3'));var rp=require('request-promise');var moment=require(_0xaa4a('0x4'));var BPromise=require(_0xaa4a('0x5'));var Mustache=require(_0xaa4a('0x6'));var util=require(_0xaa4a('0x7'));var path=require(_0xaa4a('0x8'));var sox=require(_0xaa4a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa4a('0xa'));var _=require(_0xaa4a('0xb'));var squel=require(_0xaa4a('0xc'));var crypto=require(_0xaa4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaa4a('0xe'));var querystring=require(_0xaa4a('0xf'));var Papa=require(_0xaa4a('0x10'));var Redis=require(_0xaa4a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaa4a('0x12'));var as=require(_0xaa4a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa4a('0x14'))(_0xaa4a('0x15'));var utils=require(_0xaa4a('0x16'));var config=require(_0xaa4a('0x17'));var licenseUtil=require(_0xaa4a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aee52,_0xf53a35){_0xf53a35=_0xf53a35||0xcc;return function(_0x53178d){if(_0x53178d){return _0x3aee52[_0xaa4a('0x19')](_0xf53a35);}return _0x3aee52[_0xaa4a('0x1a')](_0xf53a35)[_0xaa4a('0x1b')]();};}function respondWithResult(_0x365069,_0x42eee5){_0x42eee5=_0x42eee5||0xc8;return function(_0x1b3dd4){if(_0x1b3dd4){return _0x365069[_0xaa4a('0x1a')](_0x42eee5)[_0xaa4a('0x1c')](_0x1b3dd4);}};}function respondWithFilteredResult(_0x393e04,_0x7d1699){return function(_0x13424a){if(_0x13424a){var _0x1fdb0f=typeof _0x7d1699['offset']===_0xaa4a('0x1d')&&typeof _0x7d1699[_0xaa4a('0x1e')]==='undefined';var _0x3e00f4=_0x13424a[_0xaa4a('0x1f')];var _0x16b50c=_0x1fdb0f?0x0:_0x7d1699['offset'];var _0x4d7107=_0x1fdb0f?_0x13424a['count']:_0x7d1699[_0xaa4a('0x20')]+_0x7d1699[_0xaa4a('0x1e')];var _0x2ef309;if(_0x4d7107>=_0x3e00f4){_0x4d7107=_0x3e00f4;_0x2ef309=0xc8;}else{_0x2ef309=0xce;}_0x393e04['status'](_0x2ef309);return _0x393e04[_0xaa4a('0x21')](_0xaa4a('0x22'),_0x16b50c+'-'+_0x4d7107+'/'+_0x3e00f4)[_0xaa4a('0x1c')](_0x13424a);}return null;};}function patchUpdates(_0x2dde22){return function(_0x3c0084){try{jsonpatch[_0xaa4a('0x23')](_0x3c0084,_0x2dde22,!![]);}catch(_0x24231b){return BPromise[_0xaa4a('0x24')](_0x24231b);}return _0x3c0084[_0xaa4a('0x25')]();};}function saveUpdates(_0x1e2ecf,_0x58619b){return function(_0x4acb64){if(_0x4acb64){return _0x4acb64[_0xaa4a('0x26')](_0x1e2ecf)['then'](function(_0x2b169a){return _0x2b169a;});}return null;};}function removeEntity(_0x1aad53,_0x388050){return function(_0x5aeab9){if(_0x5aeab9){return _0x5aeab9['destroy']()[_0xaa4a('0x27')](function(){_0x1aad53[_0xaa4a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46285a,_0x1d866a){return function(_0x4e3051){if(!_0x4e3051){_0x46285a[_0xaa4a('0x19')](0x194);}return _0x4e3051;};}function handleError(_0x1338fe,_0x3787f7){_0x3787f7=_0x3787f7||0x1f4;return function(_0xae790){logger[_0xaa4a('0x28')](_0xae790[_0xaa4a('0x29')]);if(_0xae790[_0xaa4a('0x2a')]){delete _0xae790[_0xaa4a('0x2a')];}_0x1338fe['status'](_0x3787f7)[_0xaa4a('0x2b')](_0xae790);};}exports[_0xaa4a('0x2c')]=function(_0x432219,_0x226317){var _0x8baff2={},_0xf4d2ff={},_0x2345b5={'count':0x0,'rows':[]};var _0x4f7f0f=_[_0xaa4a('0x2d')](db[_0xaa4a('0x2e')][_0xaa4a('0x2f')],function(_0x4cc342){return{'name':_0x4cc342['fieldName'],'type':_0x4cc342['type']['key']};});_0xf4d2ff['model']=_[_0xaa4a('0x2d')](_0x4f7f0f,_0xaa4a('0x2a'));_0xf4d2ff['query']=_[_0xaa4a('0x30')](_0x432219[_0xaa4a('0x31')]);_0xf4d2ff[_0xaa4a('0x32')]=_['intersection'](_0xf4d2ff[_0xaa4a('0x33')],_0xf4d2ff[_0xaa4a('0x31')]);_0x8baff2[_0xaa4a('0x34')]=_['intersection'](_0xf4d2ff[_0xaa4a('0x33')],qs['fields'](_0x432219[_0xaa4a('0x31')][_0xaa4a('0x35')]));_0x8baff2[_0xaa4a('0x34')]=_0x8baff2['attributes'][_0xaa4a('0x36')]?_0x8baff2[_0xaa4a('0x34')]:_0xf4d2ff[_0xaa4a('0x33')];if(!_0x432219['query'][_0xaa4a('0x37')]('nolimit')){_0x8baff2[_0xaa4a('0x1e')]=qs[_0xaa4a('0x1e')](_0x432219['query'][_0xaa4a('0x1e')]);_0x8baff2['offset']=qs[_0xaa4a('0x20')](_0x432219[_0xaa4a('0x31')][_0xaa4a('0x20')]);}_0x8baff2['order']=qs[_0xaa4a('0x38')](_0x432219[_0xaa4a('0x31')][_0xaa4a('0x38')]);_0x8baff2['where']=qs[_0xaa4a('0x32')](_['pick'](_0x432219['query'],_0xf4d2ff[_0xaa4a('0x32')]),_0x4f7f0f);if(_0x432219[_0xaa4a('0x31')][_0xaa4a('0x39')]){_0x8baff2[_0xaa4a('0x3a')]=_[_0xaa4a('0x3b')](_0x8baff2['where'],{'$or':_[_0xaa4a('0x2d')](_0x4f7f0f,function(_0x1c8781){if(_0x1c8781[_0xaa4a('0x3c')]!==_0xaa4a('0x3d')){var _0x46a56b={};_0x46a56b[_0x1c8781[_0xaa4a('0x2a')]]={'$like':'%'+_0x432219[_0xaa4a('0x31')][_0xaa4a('0x39')]+'%'};return _0x46a56b;}})});}_0x8baff2=_['merge']({},_0x8baff2,_0x432219['options']);var _0x44fb40={'where':_0x8baff2[_0xaa4a('0x3a')]};return db[_0xaa4a('0x2e')][_0xaa4a('0x1f')](_0x44fb40)[_0xaa4a('0x27')](function(_0x22e188){_0x2345b5['count']=_0x22e188;if(_0x432219[_0xaa4a('0x31')][_0xaa4a('0x3e')]){_0x8baff2[_0xaa4a('0x3f')]=[{'all':!![]}];}return db[_0xaa4a('0x2e')][_0xaa4a('0x40')](_0x8baff2);})[_0xaa4a('0x27')](function(_0x5badb1){_0x2345b5[_0xaa4a('0x41')]=_0x5badb1;return _0x2345b5;})[_0xaa4a('0x27')](respondWithFilteredResult(_0x226317,_0x8baff2))[_0xaa4a('0x42')](handleError(_0x226317,null));};exports[_0xaa4a('0x43')]=function(_0x358ed6,_0x2aa206){var _0x4d6456={'raw':!![],'where':{'id':_0x358ed6[_0xaa4a('0x44')]['id']}},_0x3c34ea={};_0x3c34ea[_0xaa4a('0x33')]=_[_0xaa4a('0x30')](db[_0xaa4a('0x2e')][_0xaa4a('0x2f')]);_0x3c34ea[_0xaa4a('0x31')]=_[_0xaa4a('0x30')](_0x358ed6[_0xaa4a('0x31')]);_0x3c34ea[_0xaa4a('0x32')]=_[_0xaa4a('0x45')](_0x3c34ea['model'],_0x3c34ea[_0xaa4a('0x31')]);_0x4d6456[_0xaa4a('0x34')]=_[_0xaa4a('0x45')](_0x3c34ea['model'],qs[_0xaa4a('0x35')](_0x358ed6[_0xaa4a('0x31')][_0xaa4a('0x35')]));_0x4d6456['attributes']=_0x4d6456[_0xaa4a('0x34')][_0xaa4a('0x36')]?_0x4d6456['attributes']:_0x3c34ea[_0xaa4a('0x33')];if(_0x358ed6[_0xaa4a('0x31')]['includeAll']){_0x4d6456['include']=[{'all':!![]}];}_0x4d6456=_[_0xaa4a('0x3b')]({},_0x4d6456,_0x358ed6[_0xaa4a('0x46')]);return db['SquareRecording']['find'](_0x4d6456)[_0xaa4a('0x27')](handleEntityNotFound(_0x2aa206,null))[_0xaa4a('0x27')](respondWithResult(_0x2aa206,null))[_0xaa4a('0x42')](handleError(_0x2aa206,null));};exports[_0xaa4a('0x47')]=function(_0xf64efb,_0x58064b){return db[_0xaa4a('0x2e')]['create'](_0xf64efb[_0xaa4a('0x48')],{})[_0xaa4a('0x27')](respondWithResult(_0x58064b,0xc9))[_0xaa4a('0x42')](handleError(_0x58064b,null));};exports[_0xaa4a('0x26')]=function(_0x5b870,_0x3647b1){if(_0x5b870[_0xaa4a('0x48')]['id']){delete _0x5b870[_0xaa4a('0x48')]['id'];}return db[_0xaa4a('0x2e')][_0xaa4a('0x49')]({'where':{'id':_0x5b870[_0xaa4a('0x44')]['id']}})[_0xaa4a('0x27')](handleEntityNotFound(_0x3647b1,null))[_0xaa4a('0x27')](saveUpdates(_0x5b870[_0xaa4a('0x48')],null))[_0xaa4a('0x27')](respondWithResult(_0x3647b1,null))[_0xaa4a('0x42')](handleError(_0x3647b1,null));};exports[_0xaa4a('0x4a')]=function(_0x2f3099,_0x1a41ab,_0x247631){var _0x15a53a=require(_0xaa4a('0x4b'));var _0x353ca=![];var _0x1bc2f0={};if(_0x2f3099[_0xaa4a('0x31')][_0xaa4a('0x3c')]&&_0x2f3099[_0xaa4a('0x31')]['type']==='uniqueid'){_0x1bc2f0['uniqueid']=_0x2f3099[_0xaa4a('0x44')]['id'];}else{_0x1bc2f0['id']=_0x2f3099[_0xaa4a('0x44')]['id'];}return db[_0xaa4a('0x2e')][_0xaa4a('0x49')]({'where':_0x1bc2f0,'attributes':['id','savePath',_0xaa4a('0x4c')],'raw':!![]})[_0xaa4a('0x27')](handleEntityNotFound(_0x1a41ab,null))['then'](function(_0x502e68){if(_0x502e68){var _0x1ac0d5=_0x502e68['savePath'];var _0x5cee2a=util[_0xaa4a('0x4d')]('%s.cypher',_0x1ac0d5);if(fs[_0xaa4a('0x4e')](_0x5cee2a)){_0x353ca=!![];return _0x15a53a[_0xaa4a('0x4f')](_0x5cee2a,_0x1ac0d5,config[_0xaa4a('0x50')][_0xaa4a('0x51')])['then'](function(){return _0x502e68;});}return _0x502e68;}})['then'](function(_0x1cc4ff){if(_0x1cc4ff){var _0x1f9775=_0x1cc4ff[_0xaa4a('0x52')];if(!fs[_0xaa4a('0x4e')](_0x1f9775)){throw new db[(_0xaa4a('0x53'))][(_0xaa4a('0x54'))]('SquareRecording\x20not\x20found');}if(_0x1cc4ff[_0xaa4a('0x4c')]){return _0x1a41ab[_0xaa4a('0x4a')](_0x1f9775,_0x1cc4ff['filename']+path[_0xaa4a('0x55')](_0x1f9775),function(){if(_0x353ca){fs[_0xaa4a('0x56')](_0x1f9775);}});}else{return _0x1a41ab[_0xaa4a('0x4a')](_0x1f9775,function(_0x2e2506){if(_0x353ca){fs[_0xaa4a('0x56')](_0x1f9775);}});}}})['catch'](function(_0x284ca0){if(_0x284ca0[_0xaa4a('0x57')]==='SquareRecording\x20not\x20found'){_0x1a41ab[_0xaa4a('0x1a')](0x194)[_0xaa4a('0x2b')](_0xaa4a('0x58'));}else{return handleError(_0x1a41ab,null);}});};exports[_0xaa4a('0x59')]=function(_0x2e59df,_0x5bf161){return db[_0xaa4a('0x2e')][_0xaa4a('0x49')]({'where':{'id':_0x2e59df[_0xaa4a('0x44')]['id']}})[_0xaa4a('0x27')](function(_0x435c97){if(_[_0xaa4a('0x5a')](_0x435c97)){throw new ReferenceError(_0xaa4a('0x5b'));}return _0x435c97;})[_0xaa4a('0x27')](function(_0x2f06ca){var _0x552814=_0x2f06ca['savePath'];logger[_0xaa4a('0x5c')](_0xaa4a('0x5d'),_0x552814);if(!_['isNil'](_0x2f06ca['savePath'])&&fs[_0xaa4a('0x4e')](_0x552814)){logger['info'](_0xaa4a('0x5e')+_0x552814+_0xaa4a('0x5f'));fs[_0xaa4a('0x60')](_0x552814);}_0x552814=_0x552814+'.cypher';if(!_[_0xaa4a('0x5a')](_0x2f06ca['savePath'])&&fs[_0xaa4a('0x4e')](_0x552814)){logger[_0xaa4a('0x5c')]('File:\x20\x22'+_0x552814+_0xaa4a('0x5f'));fs[_0xaa4a('0x60')](_0x552814);}return _0x2f06ca;})['then'](function(_0x33db99){if(!_0x33db99)throw new InternalError();return _0x33db99[_0xaa4a('0x59')]();})[_0xaa4a('0x27')](function(){_0x5bf161[_0xaa4a('0x1a')](0xcc)[_0xaa4a('0x1b')]();})[_0xaa4a('0x42')](handleError(_0x5bf161,null));}; \ No newline at end of file +var _0xd240=['../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','rows','catch','show','params','merge','create','body','update','download','../../components/encryptor','uniqueid','find','filename','format','decryptFile','secrets','recording','savePath','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd240,0x111));var _0x0d24=function(_0x5bc531,_0x254c66){_0x5bc531=_0x5bc531-0x0;var _0x12af2d=_0xd240[_0x5bc531];return _0x12af2d;};'use strict';var emlformat=require(_0x0d24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d24('0x1'));var jsonpatch=require(_0x0d24('0x2'));var rp=require(_0x0d24('0x3'));var moment=require(_0x0d24('0x4'));var BPromise=require(_0x0d24('0x5'));var Mustache=require(_0x0d24('0x6'));var util=require('util');var path=require(_0x0d24('0x7'));var sox=require('sox');var csv=require(_0x0d24('0x8'));var ejs=require(_0x0d24('0x9'));var fs=require('fs');var fs_extra=require(_0x0d24('0xa'));var _=require(_0x0d24('0xb'));var squel=require(_0x0d24('0xc'));var crypto=require(_0x0d24('0xd'));var jsforce=require(_0x0d24('0xe'));var deskjs=require(_0x0d24('0xf'));var toCsv=require(_0x0d24('0x8'));var querystring=require('querystring');var Papa=require(_0x0d24('0x10'));var Redis=require(_0x0d24('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0d24('0x12'));var as=require(_0x0d24('0x13'));var hardwareService=require(_0x0d24('0x14'));var logger=require(_0x0d24('0x15'))(_0x0d24('0x16'));var utils=require(_0x0d24('0x17'));var config=require(_0x0d24('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d24('0x19'))['db'];function respondWithStatusCode(_0x34f00e,_0x444988){_0x444988=_0x444988||0xcc;return function(_0x3300cd){if(_0x3300cd){return _0x34f00e['sendStatus'](_0x444988);}return _0x34f00e[_0x0d24('0x1a')](_0x444988)[_0x0d24('0x1b')]();};}function respondWithResult(_0x4c0549,_0x3e6daf){_0x3e6daf=_0x3e6daf||0xc8;return function(_0x25a871){if(_0x25a871){return _0x4c0549[_0x0d24('0x1a')](_0x3e6daf)['json'](_0x25a871);}};}function respondWithFilteredResult(_0x3c8023,_0xe73d29){return function(_0x1a0c2e){if(_0x1a0c2e){var _0x59aaae=typeof _0xe73d29[_0x0d24('0x1c')]==='undefined'&&typeof _0xe73d29['limit']===_0x0d24('0x1d');var _0x42ae19=_0x1a0c2e['count'];var _0x543aaa=_0x59aaae?0x0:_0xe73d29[_0x0d24('0x1c')];var _0x42af8a=_0x59aaae?_0x1a0c2e[_0x0d24('0x1e')]:_0xe73d29[_0x0d24('0x1c')]+_0xe73d29[_0x0d24('0x1f')];var _0xecd983;if(_0x42af8a>=_0x42ae19){_0x42af8a=_0x42ae19;_0xecd983=0xc8;}else{_0xecd983=0xce;}_0x3c8023[_0x0d24('0x1a')](_0xecd983);return _0x3c8023['set'](_0x0d24('0x20'),_0x543aaa+'-'+_0x42af8a+'/'+_0x42ae19)['json'](_0x1a0c2e);}return null;};}function patchUpdates(_0x4a915a){return function(_0x1ab050){try{jsonpatch[_0x0d24('0x21')](_0x1ab050,_0x4a915a,!![]);}catch(_0x48defd){return BPromise[_0x0d24('0x22')](_0x48defd);}return _0x1ab050[_0x0d24('0x23')]();};}function saveUpdates(_0x29b6a5,_0x34a347){return function(_0x3b88da){if(_0x3b88da){return _0x3b88da['update'](_0x29b6a5)[_0x0d24('0x24')](function(_0x2a5805){return _0x2a5805;});}return null;};}function removeEntity(_0x435a32,_0x3ad15c){return function(_0x1c5a57){if(_0x1c5a57){return _0x1c5a57['destroy']()[_0x0d24('0x24')](function(){_0x435a32['status'](0xcc)[_0x0d24('0x1b')]();});}};}function handleEntityNotFound(_0x13a977,_0x334841){return function(_0xf73cbc){if(!_0xf73cbc){_0x13a977[_0x0d24('0x25')](0x194);}return _0xf73cbc;};}function handleError(_0x43b117,_0x428cfe){_0x428cfe=_0x428cfe||0x1f4;return function(_0x1adb0c){logger[_0x0d24('0x26')](_0x1adb0c[_0x0d24('0x27')]);if(_0x1adb0c[_0x0d24('0x28')]){delete _0x1adb0c[_0x0d24('0x28')];}_0x43b117['status'](_0x428cfe)[_0x0d24('0x29')](_0x1adb0c);};}exports['index']=function(_0x5a1692,_0x565571){var _0x482a69={},_0x663db3={},_0x291b78={'count':0x0,'rows':[]};var _0x97d693=_[_0x0d24('0x2a')](db[_0x0d24('0x2b')][_0x0d24('0x2c')],function(_0x1486c5){return{'name':_0x1486c5[_0x0d24('0x2d')],'type':_0x1486c5[_0x0d24('0x2e')][_0x0d24('0x2f')]};});_0x663db3['model']=_['map'](_0x97d693,_0x0d24('0x28'));_0x663db3[_0x0d24('0x30')]=_[_0x0d24('0x31')](_0x5a1692['query']);_0x663db3['filters']=_[_0x0d24('0x32')](_0x663db3[_0x0d24('0x33')],_0x663db3[_0x0d24('0x30')]);_0x482a69[_0x0d24('0x34')]=_[_0x0d24('0x32')](_0x663db3[_0x0d24('0x33')],qs[_0x0d24('0x35')](_0x5a1692['query'][_0x0d24('0x35')]));_0x482a69['attributes']=_0x482a69[_0x0d24('0x34')][_0x0d24('0x36')]?_0x482a69[_0x0d24('0x34')]:_0x663db3[_0x0d24('0x33')];if(!_0x5a1692['query'][_0x0d24('0x37')](_0x0d24('0x38'))){_0x482a69[_0x0d24('0x1f')]=qs[_0x0d24('0x1f')](_0x5a1692[_0x0d24('0x30')][_0x0d24('0x1f')]);_0x482a69['offset']=qs[_0x0d24('0x1c')](_0x5a1692[_0x0d24('0x30')][_0x0d24('0x1c')]);}_0x482a69[_0x0d24('0x39')]=qs[_0x0d24('0x3a')](_0x5a1692[_0x0d24('0x30')]['sort']);_0x482a69[_0x0d24('0x3b')]=qs[_0x0d24('0x3c')](_[_0x0d24('0x3d')](_0x5a1692[_0x0d24('0x30')],_0x663db3[_0x0d24('0x3c')]),_0x97d693);if(_0x5a1692[_0x0d24('0x30')][_0x0d24('0x3e')]){_0x482a69['where']=_['merge'](_0x482a69[_0x0d24('0x3b')],{'$or':_[_0x0d24('0x2a')](_0x97d693,function(_0x38a723){if(_0x38a723['type']!=='VIRTUAL'){var _0x3ddaa5={};_0x3ddaa5[_0x38a723[_0x0d24('0x28')]]={'$like':'%'+_0x5a1692['query']['filter']+'%'};return _0x3ddaa5;}})});}_0x482a69=_['merge']({},_0x482a69,_0x5a1692[_0x0d24('0x3f')]);var _0x349772={'where':_0x482a69['where']};return db[_0x0d24('0x2b')][_0x0d24('0x1e')](_0x349772)[_0x0d24('0x24')](function(_0x35c780){_0x291b78[_0x0d24('0x1e')]=_0x35c780;if(_0x5a1692[_0x0d24('0x30')][_0x0d24('0x40')]){_0x482a69[_0x0d24('0x41')]=[{'all':!![]}];}return db[_0x0d24('0x2b')]['findAll'](_0x482a69);})[_0x0d24('0x24')](function(_0x5aed19){_0x291b78[_0x0d24('0x42')]=_0x5aed19;return _0x291b78;})['then'](respondWithFilteredResult(_0x565571,_0x482a69))[_0x0d24('0x43')](handleError(_0x565571,null));};exports[_0x0d24('0x44')]=function(_0x529161,_0xeb4c65){var _0x2dcf53={'raw':!![],'where':{'id':_0x529161[_0x0d24('0x45')]['id']}},_0x3465d6={};_0x3465d6['model']=_['keys'](db['SquareRecording'][_0x0d24('0x2c')]);_0x3465d6[_0x0d24('0x30')]=_[_0x0d24('0x31')](_0x529161[_0x0d24('0x30')]);_0x3465d6[_0x0d24('0x3c')]=_['intersection'](_0x3465d6['model'],_0x3465d6[_0x0d24('0x30')]);_0x2dcf53[_0x0d24('0x34')]=_[_0x0d24('0x32')](_0x3465d6[_0x0d24('0x33')],qs[_0x0d24('0x35')](_0x529161[_0x0d24('0x30')]['fields']));_0x2dcf53[_0x0d24('0x34')]=_0x2dcf53['attributes'][_0x0d24('0x36')]?_0x2dcf53[_0x0d24('0x34')]:_0x3465d6['model'];if(_0x529161[_0x0d24('0x30')][_0x0d24('0x40')]){_0x2dcf53[_0x0d24('0x41')]=[{'all':!![]}];}_0x2dcf53=_[_0x0d24('0x46')]({},_0x2dcf53,_0x529161['options']);return db[_0x0d24('0x2b')]['find'](_0x2dcf53)[_0x0d24('0x24')](handleEntityNotFound(_0xeb4c65,null))['then'](respondWithResult(_0xeb4c65,null))[_0x0d24('0x43')](handleError(_0xeb4c65,null));};exports[_0x0d24('0x47')]=function(_0x521dcc,_0x4e7b84){return db[_0x0d24('0x2b')][_0x0d24('0x47')](_0x521dcc[_0x0d24('0x48')],{})[_0x0d24('0x24')](respondWithResult(_0x4e7b84,0xc9))['catch'](handleError(_0x4e7b84,null));};exports[_0x0d24('0x49')]=function(_0x752930,_0xce0522){if(_0x752930[_0x0d24('0x48')]['id']){delete _0x752930[_0x0d24('0x48')]['id'];}return db[_0x0d24('0x2b')]['find']({'where':{'id':_0x752930['params']['id']}})[_0x0d24('0x24')](handleEntityNotFound(_0xce0522,null))[_0x0d24('0x24')](saveUpdates(_0x752930[_0x0d24('0x48')],null))[_0x0d24('0x24')](respondWithResult(_0xce0522,null))['catch'](handleError(_0xce0522,null));};exports[_0x0d24('0x4a')]=function(_0x57449a,_0xa30ec6,_0x1a0ed0){var _0xda282f=require(_0x0d24('0x4b'));var _0x300cd5=![];var _0x291d0f={};if(_0x57449a[_0x0d24('0x30')][_0x0d24('0x2e')]&&_0x57449a[_0x0d24('0x30')][_0x0d24('0x2e')]==='uniqueid'){_0x291d0f[_0x0d24('0x4c')]=_0x57449a[_0x0d24('0x45')]['id'];}else{_0x291d0f['id']=_0x57449a[_0x0d24('0x45')]['id'];}return db['SquareRecording'][_0x0d24('0x4d')]({'where':_0x291d0f,'attributes':['id','savePath',_0x0d24('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0xa30ec6,null))[_0x0d24('0x24')](function(_0x49c562){if(_0x49c562){var _0x3b3153=_0x49c562['savePath'];var _0x323046=util[_0x0d24('0x4f')]('%s.cypher',_0x3b3153);if(fs['existsSync'](_0x323046)){_0x300cd5=!![];return _0xda282f[_0x0d24('0x50')](_0x323046,_0x3b3153,config[_0x0d24('0x51')][_0x0d24('0x52')])[_0x0d24('0x24')](function(){return _0x49c562;});}return _0x49c562;}})[_0x0d24('0x24')](function(_0x411ae7){if(_0x411ae7){var _0x383582=_0x411ae7[_0x0d24('0x53')];if(!fs[_0x0d24('0x54')](_0x383582)){throw new db[(_0x0d24('0x55'))][(_0x0d24('0x56'))](_0x0d24('0x57'));}if(_0x411ae7[_0x0d24('0x4e')]){return _0xa30ec6['download'](_0x383582,_0x411ae7[_0x0d24('0x4e')]+path[_0x0d24('0x58')](_0x383582),function(){if(_0x300cd5){fs[_0x0d24('0x59')](_0x383582);}});}else{return _0xa30ec6[_0x0d24('0x4a')](_0x383582,function(_0x43ed31){if(_0x300cd5){fs['unlink'](_0x383582);}});}}})[_0x0d24('0x43')](function(_0x2c8387){if(_0x2c8387[_0x0d24('0x5a')]===_0x0d24('0x57')){_0xa30ec6['status'](0x194)[_0x0d24('0x29')]('Not\x20found');}else{return handleError(_0xa30ec6,null);}});};exports['destroy']=function(_0x156ac9,_0x2bf96d){return db[_0x0d24('0x2b')][_0x0d24('0x4d')]({'where':{'id':_0x156ac9[_0x0d24('0x45')]['id']}})[_0x0d24('0x24')](function(_0x212e37){if(_[_0x0d24('0x5b')](_0x212e37)){throw new ReferenceError(_0x0d24('0x5c'));}return _0x212e37;})['then'](function(_0xc006b6){var _0x973c98=_0xc006b6[_0x0d24('0x53')];logger[_0x0d24('0x5d')](_0x0d24('0x5e'),_0x973c98);if(!_['isNil'](_0xc006b6[_0x0d24('0x53')])&&fs[_0x0d24('0x54')](_0x973c98)){logger['info']('File:\x20\x22'+_0x973c98+_0x0d24('0x5f'));fs[_0x0d24('0x60')](_0x973c98);}_0x973c98=_0x973c98+'.cypher';if(!_['isNil'](_0xc006b6['savePath'])&&fs[_0x0d24('0x54')](_0x973c98)){logger[_0x0d24('0x5d')](_0x0d24('0x61')+_0x973c98+_0x0d24('0x5f'));fs[_0x0d24('0x60')](_0x973c98);}return _0xc006b6;})[_0x0d24('0x24')](function(_0x520f33){if(!_0x520f33)throw new InternalError();return _0x520f33[_0x0d24('0x62')]();})[_0x0d24('0x24')](function(){_0x2bf96d[_0x0d24('0x1a')](0xcc)[_0x0d24('0x1b')]();})['catch'](handleError(_0x2bf96d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 00ff738..8232559 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 _0x58c9=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x144025,_0x591834){var _0x36079b=function(_0x4272fb){while(--_0x4272fb){_0x144025['push'](_0x144025['shift']());}};_0x36079b(++_0x591834);}(_0x58c9,0x1bc));var _0x958c=function(_0x18fa70,_0x25e628){_0x18fa70=_0x18fa70-0x0;var _0x59940d=_0x58c9[_0x18fa70];return _0x59940d;};'use strict';var _=require(_0x958c('0x0'));var util=require(_0x958c('0x1'));var logger=require(_0x958c('0x2'))(_0x958c('0x3'));var moment=require(_0x958c('0x4'));var BPromise=require(_0x958c('0x5'));var rp=require(_0x958c('0x6'));var fs=require('fs');var path=require(_0x958c('0x7'));var rimraf=require(_0x958c('0x8'));var config=require(_0x958c('0x9'));var attributes=require(_0x958c('0xa'));module[_0x958c('0xb')]=function(_0x3e5ce2,_0x4ddd59){return _0x3e5ce2[_0x958c('0xc')](_0x958c('0xd'),attributes,{'tableName':_0x958c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x444e=['moment','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','lodash','../../config/logger'];(function(_0x28089e,_0x530f8a){var _0x46a73c=function(_0x461513){while(--_0x461513){_0x28089e['push'](_0x28089e['shift']());}};_0x46a73c(++_0x530f8a);}(_0x444e,0xe8));var _0xe444=function(_0x33c818,_0x3f06ff){_0x33c818=_0x33c818-0x0;var _0x102413=_0x444e[_0x33c818];return _0x102413;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var logger=require(_0xe444('0x1'))('api');var moment=require(_0xe444('0x2'));var BPromise=require('bluebird');var rp=require(_0xe444('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var attributes=require(_0xe444('0x6'));module[_0xe444('0x7')]=function(_0x36ac3b,_0x1ddb27){return _0x36ac3b['define'](_0xe444('0x8'),attributes,{'tableName':'square_recordings','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 a6d3158..650baec 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 _0x7ab1=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b0056,_0x20c96e){var _0x3d08c0=function(_0x18581b){while(--_0x18581b){_0x4b0056['push'](_0x4b0056['shift']());}};_0x3d08c0(++_0x20c96e);}(_0x7ab1,0x1e7));var _0x17ab=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x7ab1[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x17ab('0x0'));var util=require(_0x17ab('0x1'));var moment=require(_0x17ab('0x2'));var BPromise=require(_0x17ab('0x3'));var rs=require(_0x17ab('0x4'));var fs=require('fs');var Redis=require(_0x17ab('0x5'));var db=require(_0x17ab('0x6'))['db'];var utils=require(_0x17ab('0x7'));var logger=require(_0x17ab('0x8'))('rpc');var config=require(_0x17ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x547349,_0x84a7c5,_0x4beaef){return new BPromise(function(_0x1d0321,_0x2fd01d){return client[_0x17ab('0xb')](_0x547349,_0x4beaef)[_0x17ab('0xc')](function(_0x1bb4ce){logger[_0x17ab('0xd')](_0x17ab('0xe'),_0x84a7c5,_0x17ab('0xf'));logger[_0x17ab('0x10')](_0x17ab('0x11'),_0x84a7c5,_0x17ab('0xf'),JSON[_0x17ab('0x12')](_0x1bb4ce));if(_0x1bb4ce['error']){if(_0x1bb4ce[_0x17ab('0x13')][_0x17ab('0x14')]===0x1f4){logger['error'](_0x17ab('0xe'),_0x84a7c5,_0x1bb4ce['error'][_0x17ab('0x15')]);return _0x2fd01d(_0x1bb4ce['error']['message']);}logger[_0x17ab('0x13')](_0x17ab('0xe'),_0x84a7c5,_0x1bb4ce[_0x17ab('0x13')][_0x17ab('0x15')]);return _0x1d0321(_0x1bb4ce[_0x17ab('0x13')][_0x17ab('0x15')]);}else{logger[_0x17ab('0xd')](_0x17ab('0xe'),_0x84a7c5,_0x17ab('0xf'));_0x1d0321(_0x1bb4ce[_0x17ab('0x16')]['message']);}})['catch'](function(_0x52dc23){logger[_0x17ab('0x13')]('SquareRecording,\x20%s,\x20%s',_0x84a7c5,_0x52dc23);_0x2fd01d(_0x52dc23);});});}exports[_0x17ab('0x17')]=function(_0x41cab4){var _0x21f840=this;return new Promise(function(_0x2fa47d,_0x579995){return db[_0x17ab('0x18')][_0x17ab('0x19')](_0x41cab4['body'],{'raw':_0x41cab4['options']?_0x41cab4[_0x17ab('0x1a')][_0x17ab('0x1b')]===undefined?!![]:![]:!![]})[_0x17ab('0xc')](function(_0x47284e){logger[_0x17ab('0xd')](_0x17ab('0x17'),_0x41cab4);logger[_0x17ab('0x10')](_0x17ab('0x17'),_0x41cab4,JSON[_0x17ab('0x12')](_0x47284e));_0x2fa47d(_0x47284e);})[_0x17ab('0x1c')](function(_0x36b6c6){logger[_0x17ab('0x13')]('CreateSquareRecording',_0x36b6c6[_0x17ab('0x15')],_0x41cab4);_0x579995(_0x21f840[_0x17ab('0x13')](0x1f4,_0x36b6c6[_0x17ab('0x15')]));});});}; \ No newline at end of file +var _0xe84f=['create','body','options','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording'];(function(_0x23f0d8,_0x337357){var _0x52a486=function(_0x1ad078){while(--_0x1ad078){_0x23f0d8['push'](_0x23f0d8['shift']());}};_0x52a486(++_0x337357);}(_0xe84f,0x155));var _0xfe84=function(_0x3b8dbd,_0x2c2129){_0x3b8dbd=_0x3b8dbd-0x0;var _0x53a86c=_0xe84f[_0x3b8dbd];return _0x53a86c;};'use strict';var _=require(_0xfe84('0x0'));var util=require('util');var moment=require(_0xfe84('0x1'));var BPromise=require(_0xfe84('0x2'));var rs=require(_0xfe84('0x3'));var fs=require('fs');var Redis=require(_0xfe84('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe84('0x5'));var config=require(_0xfe84('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe84('0x7')][_0xfe84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fa3c2,_0x28b2c4,_0xaa0dc2){return new BPromise(function(_0x2ce724,_0x2b06ea){return client[_0xfe84('0x9')](_0x2fa3c2,_0xaa0dc2)[_0xfe84('0xa')](function(_0x459ff4){logger[_0xfe84('0xb')](_0xfe84('0xc'),_0x28b2c4,_0xfe84('0xd'));logger[_0xfe84('0xe')](_0xfe84('0xf'),_0x28b2c4,_0xfe84('0xd'),JSON[_0xfe84('0x10')](_0x459ff4));if(_0x459ff4[_0xfe84('0x11')]){if(_0x459ff4['error'][_0xfe84('0x12')]===0x1f4){logger['error'](_0xfe84('0xc'),_0x28b2c4,_0x459ff4[_0xfe84('0x11')][_0xfe84('0x13')]);return _0x2b06ea(_0x459ff4['error'][_0xfe84('0x13')]);}logger[_0xfe84('0x11')](_0xfe84('0xc'),_0x28b2c4,_0x459ff4[_0xfe84('0x11')]['message']);return _0x2ce724(_0x459ff4[_0xfe84('0x11')][_0xfe84('0x13')]);}else{logger['info'](_0xfe84('0xc'),_0x28b2c4,_0xfe84('0xd'));_0x2ce724(_0x459ff4[_0xfe84('0x14')][_0xfe84('0x13')]);}})['catch'](function(_0x5e3b5d){logger[_0xfe84('0x11')](_0xfe84('0xc'),_0x28b2c4,_0x5e3b5d);_0x2b06ea(_0x5e3b5d);});});}exports[_0xfe84('0x15')]=function(_0x1715a0){var _0x152101=this;return new Promise(function(_0x250f0d,_0xc8d423){return db[_0xfe84('0x16')][_0xfe84('0x17')](_0x1715a0[_0xfe84('0x18')],{'raw':_0x1715a0[_0xfe84('0x19')]?_0x1715a0[_0xfe84('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xfe84('0xa')](function(_0x50a9a6){logger[_0xfe84('0xb')](_0xfe84('0x15'),_0x1715a0);logger[_0xfe84('0xe')]('CreateSquareRecording',_0x1715a0,JSON[_0xfe84('0x10')](_0x50a9a6));_0x250f0d(_0x50a9a6);})['catch'](function(_0x26b892){logger[_0xfe84('0x11')]('CreateSquareRecording',_0x26b892[_0xfe84('0x13')],_0x1715a0);_0xc8d423(_0x152101[_0xfe84('0x11')](0x1f4,_0x26b892['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 4de4353..6fa5f21 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1122ab,_0x1acfaf){var _0xa19715=function(_0xbb5d67){while(--_0xbb5d67){_0x1122ab['push'](_0x1122ab['shift']());}};_0xa19715(++_0x1acfaf);}(_0xe706,0xa3));var _0x6e70=function(_0x7750c9,_0x205ccc){_0x7750c9=_0x7750c9-0x0;var _0x57f2c0=_0xe706[_0x7750c9];return _0x57f2c0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x3121ef,_0x2db327){var _0x167958=function(_0x369fef){while(--_0x369fef){_0x3121ef['push'](_0x3121ef['shift']());}};_0x167958(++_0x2db327);}(_0xe706,0xa3));var _0x6e70=function(_0x39d625,_0xcbd247){_0x39d625=_0x39d625-0x0;var _0x45bafa=_0xe706[_0x39d625];return _0x45bafa;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0aacd5d..3c71b75 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 _0xb366=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0xb366,0x1a2));var _0x6b36=function(_0xcb3eb3,_0x4b2bed){_0xcb3eb3=_0xcb3eb3-0x0;var _0x7bbcb6=_0xb366[_0xcb3eb3];return _0x7bbcb6;};'use strict';var Sequelize=require(_0x6b36('0x0'));module[_0x6b36('0x1')]={'network':{'type':Sequelize[_0x6b36('0x2')]},'network_script':{'type':Sequelize[_0x6b36('0x2')]},'request':{'type':Sequelize[_0x6b36('0x2')]},'channel':{'type':Sequelize[_0x6b36('0x2')]},'language':{'type':Sequelize[_0x6b36('0x2')]},'type':{'type':Sequelize[_0x6b36('0x2')]},'uniqueid':{'type':Sequelize[_0x6b36('0x2')]},'version':{'type':Sequelize[_0x6b36('0x2')]},'callerid':{'type':Sequelize[_0x6b36('0x2')]},'calleridname':{'type':Sequelize[_0x6b36('0x2')]},'callingpres':{'type':Sequelize[_0x6b36('0x2')]},'callingani2':{'type':Sequelize[_0x6b36('0x2')]},'callington':{'type':Sequelize[_0x6b36('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x6b36('0x2')]},'rdnis':{'type':Sequelize[_0x6b36('0x2')]},'context':{'type':Sequelize[_0x6b36('0x2')]},'extension':{'type':Sequelize[_0x6b36('0x2')]},'priority':{'type':Sequelize[_0x6b36('0x2')]},'enhanced':{'type':Sequelize[_0x6b36('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x6b36('0x2')]},'project_name':{'type':Sequelize[_0x6b36('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6b36('0x3')]},'bot':{'type':Sequelize[_0x6b36('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xa161=['BOOLEAN','exports','STRING','DATE'];(function(_0x133139,_0x5d98dd){var _0x9581f8=function(_0x19e453){while(--_0x19e453){_0x133139['push'](_0x133139['shift']());}};_0x9581f8(++_0x5d98dd);}(_0xa161,0xd1));var _0x1a16=function(_0x4bb7ab,_0x2ec9cd){_0x4bb7ab=_0x4bb7ab-0x0;var _0x1a51e9=_0xa161[_0x4bb7ab];return _0x1a51e9;};'use strict';var Sequelize=require('sequelize');module[_0x1a16('0x0')]={'network':{'type':Sequelize[_0x1a16('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x1a16('0x1')]},'channel':{'type':Sequelize[_0x1a16('0x1')]},'language':{'type':Sequelize[_0x1a16('0x1')]},'type':{'type':Sequelize[_0x1a16('0x1')]},'uniqueid':{'type':Sequelize[_0x1a16('0x1')]},'version':{'type':Sequelize[_0x1a16('0x1')]},'callerid':{'type':Sequelize[_0x1a16('0x1')]},'calleridname':{'type':Sequelize[_0x1a16('0x1')]},'callingpres':{'type':Sequelize[_0x1a16('0x1')]},'callingani2':{'type':Sequelize[_0x1a16('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x1a16('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1a16('0x1')]},'extension':{'type':Sequelize[_0x1a16('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1a16('0x1')]},'accountcode':{'type':Sequelize[_0x1a16('0x1')]},'threadid':{'type':Sequelize[_0x1a16('0x1')]},'project_name':{'type':Sequelize[_0x1a16('0x1')]},'joinAt':{'type':Sequelize[_0x1a16('0x2')]},'leaveAt':{'type':Sequelize[_0x1a16('0x2')]},'bot':{'type':Sequelize[_0x1a16('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 0cafa19..a4bcc68 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 _0x3174=['../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3174,0x110));var _0x4317=function(_0x35109b,_0x227369){_0x35109b=_0x35109b-0x0;var _0x385e54=_0x3174[_0x35109b];return _0x385e54;};'use strict';var emlformat=require(_0x4317('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4317('0x1'));var jsonpatch=require(_0x4317('0x2'));var rp=require('request-promise');var moment=require(_0x4317('0x3'));var BPromise=require(_0x4317('0x4'));var Mustache=require('mustache');var util=require(_0x4317('0x5'));var path=require(_0x4317('0x6'));var sox=require(_0x4317('0x7'));var csv=require(_0x4317('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4317('0x9'));var _=require(_0x4317('0xa'));var squel=require('squel');var crypto=require(_0x4317('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4317('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4317('0xd'));var Papa=require(_0x4317('0xe'));var Redis=require(_0x4317('0xf'));var authService=require(_0x4317('0x10'));var qs=require(_0x4317('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4317('0x12'));var utils=require('../../config/utils');var config=require(_0x4317('0x13'));var licenseUtil=require(_0x4317('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f1245,_0x294a92){_0x294a92=_0x294a92||0xcc;return function(_0x2cf6ae){if(_0x2cf6ae){return _0x3f1245[_0x4317('0x15')](_0x294a92);}return _0x3f1245[_0x4317('0x16')](_0x294a92)[_0x4317('0x17')]();};}function respondWithResult(_0x33bff8,_0x2afacc){_0x2afacc=_0x2afacc||0xc8;return function(_0x41dabc){if(_0x41dabc){return _0x33bff8['status'](_0x2afacc)[_0x4317('0x18')](_0x41dabc);}};}function respondWithFilteredResult(_0xad5859,_0xf01a45){return function(_0x36ce06){if(_0x36ce06){var _0x52e933=typeof _0xf01a45[_0x4317('0x19')]===_0x4317('0x1a')&&typeof _0xf01a45[_0x4317('0x1b')]===_0x4317('0x1a');var _0x47e81f=_0x36ce06['count'];var _0x567578=_0x52e933?0x0:_0xf01a45[_0x4317('0x19')];var _0x16dfc0=_0x52e933?_0x36ce06[_0x4317('0x1c')]:_0xf01a45[_0x4317('0x19')]+_0xf01a45[_0x4317('0x1b')];var _0x1150bd;if(_0x16dfc0>=_0x47e81f){_0x16dfc0=_0x47e81f;_0x1150bd=0xc8;}else{_0x1150bd=0xce;}_0xad5859['status'](_0x1150bd);return _0xad5859[_0x4317('0x1d')](_0x4317('0x1e'),_0x567578+'-'+_0x16dfc0+'/'+_0x47e81f)['json'](_0x36ce06);}return null;};}function patchUpdates(_0x214e3f){return function(_0x361bd9){try{jsonpatch['apply'](_0x361bd9,_0x214e3f,!![]);}catch(_0x35b6a6){return BPromise[_0x4317('0x1f')](_0x35b6a6);}return _0x361bd9[_0x4317('0x20')]();};}function saveUpdates(_0x3f1e91,_0x52ea07){return function(_0x9a8371){if(_0x9a8371){return _0x9a8371[_0x4317('0x21')](_0x3f1e91)[_0x4317('0x22')](function(_0x1c1246){return _0x1c1246;});}return null;};}function removeEntity(_0x165fd0,_0x4fe77a){return function(_0x5e0cc1){if(_0x5e0cc1){return _0x5e0cc1[_0x4317('0x23')]()[_0x4317('0x22')](function(){_0x165fd0['status'](0xcc)[_0x4317('0x17')]();});}};}function handleEntityNotFound(_0x5d0860,_0x6b23dc){return function(_0x1833d2){if(!_0x1833d2){_0x5d0860[_0x4317('0x15')](0x194);}return _0x1833d2;};}function handleError(_0x2c349f,_0x208d9b){_0x208d9b=_0x208d9b||0x1f4;return function(_0x67410a){logger[_0x4317('0x24')](_0x67410a[_0x4317('0x25')]);if(_0x67410a['name']){delete _0x67410a[_0x4317('0x26')];}_0x2c349f['status'](_0x208d9b)[_0x4317('0x27')](_0x67410a);};}exports[_0x4317('0x28')]=function(_0x1fc20d,_0x20e8a){var _0x14b9fb={},_0x1f1a03={},_0x471579={'count':0x0,'rows':[]};var _0xe0a8ba=_[_0x4317('0x29')](db['SquareReport']['rawAttributes'],function(_0x4e2f51){return{'name':_0x4e2f51['fieldName'],'type':_0x4e2f51[_0x4317('0x2a')][_0x4317('0x2b')]};});_0x1f1a03[_0x4317('0x2c')]=_[_0x4317('0x29')](_0xe0a8ba,_0x4317('0x26'));_0x1f1a03[_0x4317('0x2d')]=_[_0x4317('0x2e')](_0x1fc20d[_0x4317('0x2d')]);_0x1f1a03[_0x4317('0x2f')]=_[_0x4317('0x30')](_0x1f1a03['model'],_0x1f1a03[_0x4317('0x2d')]);_0x14b9fb[_0x4317('0x31')]=_[_0x4317('0x30')](_0x1f1a03[_0x4317('0x2c')],qs[_0x4317('0x32')](_0x1fc20d[_0x4317('0x2d')][_0x4317('0x32')]));_0x14b9fb[_0x4317('0x31')]=_0x14b9fb['attributes']['length']?_0x14b9fb['attributes']:_0x1f1a03['model'];if(!_0x1fc20d[_0x4317('0x2d')][_0x4317('0x33')]('nolimit')){_0x14b9fb['limit']=qs[_0x4317('0x1b')](_0x1fc20d[_0x4317('0x2d')][_0x4317('0x1b')]);_0x14b9fb['offset']=qs[_0x4317('0x19')](_0x1fc20d[_0x4317('0x2d')][_0x4317('0x19')]);}_0x14b9fb[_0x4317('0x34')]=qs['sort'](_0x1fc20d[_0x4317('0x2d')][_0x4317('0x35')]);_0x14b9fb[_0x4317('0x36')]=qs[_0x4317('0x2f')](_[_0x4317('0x37')](_0x1fc20d['query'],_0x1f1a03[_0x4317('0x2f')]),_0xe0a8ba);if(_0x1fc20d[_0x4317('0x2d')]['filter']){_0x14b9fb['where']=_['merge'](_0x14b9fb[_0x4317('0x36')],{'$or':_['map'](_0xe0a8ba,function(_0x200ad0){if(_0x200ad0[_0x4317('0x2a')]!==_0x4317('0x38')){var _0x40a74d={};_0x40a74d[_0x200ad0[_0x4317('0x26')]]={'$like':'%'+_0x1fc20d['query']['filter']+'%'};return _0x40a74d;}})});}_0x14b9fb=_[_0x4317('0x39')]({},_0x14b9fb,_0x1fc20d[_0x4317('0x3a')]);var _0x5c6982={'where':_0x14b9fb[_0x4317('0x36')]};return db[_0x4317('0x3b')]['count'](_0x5c6982)['then'](function(_0x44d24a){_0x471579[_0x4317('0x1c')]=_0x44d24a;if(_0x1fc20d['query'][_0x4317('0x3c')]){_0x14b9fb[_0x4317('0x3d')]=[{'all':!![]}];}return db[_0x4317('0x3b')][_0x4317('0x3e')](_0x14b9fb);})['then'](function(_0x4072cd){_0x471579[_0x4317('0x3f')]=_0x4072cd;return _0x471579;})[_0x4317('0x22')](respondWithFilteredResult(_0x20e8a,_0x14b9fb))[_0x4317('0x40')](handleError(_0x20e8a,null));};exports[_0x4317('0x41')]=function(_0x573f35,_0x3fb9fe){var _0x2dcae2={'raw':!![],'where':{'id':_0x573f35[_0x4317('0x42')]['id']}},_0x10a611={};_0x10a611[_0x4317('0x2c')]=_['keys'](db['SquareReport'][_0x4317('0x43')]);_0x10a611[_0x4317('0x2d')]=_[_0x4317('0x2e')](_0x573f35['query']);_0x10a611[_0x4317('0x2f')]=_[_0x4317('0x30')](_0x10a611[_0x4317('0x2c')],_0x10a611[_0x4317('0x2d')]);_0x2dcae2[_0x4317('0x31')]=_[_0x4317('0x30')](_0x10a611['model'],qs['fields'](_0x573f35[_0x4317('0x2d')][_0x4317('0x32')]));_0x2dcae2[_0x4317('0x31')]=_0x2dcae2[_0x4317('0x31')][_0x4317('0x44')]?_0x2dcae2[_0x4317('0x31')]:_0x10a611['model'];if(_0x573f35['query'][_0x4317('0x3c')]){_0x2dcae2[_0x4317('0x3d')]=[{'all':!![]}];}_0x2dcae2=_[_0x4317('0x39')]({},_0x2dcae2,_0x573f35[_0x4317('0x3a')]);return db[_0x4317('0x3b')][_0x4317('0x45')](_0x2dcae2)[_0x4317('0x22')](handleEntityNotFound(_0x3fb9fe,null))[_0x4317('0x22')](respondWithResult(_0x3fb9fe,null))[_0x4317('0x40')](handleError(_0x3fb9fe,null));};exports['create']=function(_0x41ed1b,_0x5571c9){return db[_0x4317('0x3b')]['create'](_0x41ed1b[_0x4317('0x46')],{})[_0x4317('0x22')](respondWithResult(_0x5571c9,0xc9))[_0x4317('0x40')](handleError(_0x5571c9,null));};exports['update']=function(_0x1a4fb0,_0x1118a){if(_0x1a4fb0[_0x4317('0x46')]['id']){delete _0x1a4fb0[_0x4317('0x46')]['id'];}return db[_0x4317('0x3b')][_0x4317('0x45')]({'where':{'id':_0x1a4fb0['params']['id']}})['then'](handleEntityNotFound(_0x1118a,null))[_0x4317('0x22')](saveUpdates(_0x1a4fb0['body'],null))[_0x4317('0x22')](respondWithResult(_0x1118a,null))[_0x4317('0x40')](handleError(_0x1118a,null));};exports['destroy']=function(_0x111a94,_0x175309){return db['SquareReport'][_0x4317('0x45')]({'where':{'id':_0x111a94['params']['id']}})[_0x4317('0x22')](handleEntityNotFound(_0x175309,null))[_0x4317('0x22')](removeEntity(_0x175309,null))[_0x4317('0x40')](handleError(_0x175309,null));};exports['describe']=function(_0x4c2003,_0x3e18ed){return db[_0x4317('0x3b')][_0x4317('0x47')]()[_0x4317('0x22')](respondWithResult(_0x3e18ed,null))[_0x4317('0x40')](handleError(_0x3e18ed,null));}; \ No newline at end of file +var _0x372c=['send','map','SquareReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','nolimit','order','where','pick','filters','filter','merge','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','name'];(function(_0x121660,_0xa161ef){var _0x5ca38d=function(_0xaabcdf){while(--_0xaabcdf){_0x121660['push'](_0x121660['shift']());}};_0x5ca38d(++_0xa161ef);}(_0x372c,0xe9));var _0xc372=function(_0x46f89d,_0x2e4c42){_0x46f89d=_0x46f89d-0x0;var _0x2162f1=_0x372c[_0x46f89d];return _0x2162f1;};'use strict';var emlformat=require(_0xc372('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc372('0x1'));var jsonpatch=require(_0xc372('0x2'));var rp=require(_0xc372('0x3'));var moment=require(_0xc372('0x4'));var BPromise=require(_0xc372('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc372('0x6'));var sox=require(_0xc372('0x7'));var csv=require(_0xc372('0x8'));var ejs=require(_0xc372('0x9'));var fs=require('fs');var fs_extra=require(_0xc372('0xa'));var _=require(_0xc372('0xb'));var squel=require(_0xc372('0xc'));var crypto=require(_0xc372('0xd'));var jsforce=require(_0xc372('0xe'));var deskjs=require(_0xc372('0xf'));var toCsv=require(_0xc372('0x8'));var querystring=require('querystring');var Papa=require(_0xc372('0x10'));var Redis=require(_0xc372('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc372('0x12'));var hardwareService=require(_0xc372('0x13'));var logger=require(_0xc372('0x14'))('api');var utils=require(_0xc372('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc372('0x16'));var db=require(_0xc372('0x17'))['db'];function respondWithStatusCode(_0x565b34,_0x475a91){_0x475a91=_0x475a91||0xcc;return function(_0x52c764){if(_0x52c764){return _0x565b34[_0xc372('0x18')](_0x475a91);}return _0x565b34[_0xc372('0x19')](_0x475a91)[_0xc372('0x1a')]();};}function respondWithResult(_0x3cd014,_0x3b17f2){_0x3b17f2=_0x3b17f2||0xc8;return function(_0x104135){if(_0x104135){return _0x3cd014[_0xc372('0x19')](_0x3b17f2)[_0xc372('0x1b')](_0x104135);}};}function respondWithFilteredResult(_0x103635,_0x8ad8){return function(_0x3c9c77){if(_0x3c9c77){var _0x3e7bf6=typeof _0x8ad8[_0xc372('0x1c')]===_0xc372('0x1d')&&typeof _0x8ad8['limit']===_0xc372('0x1d');var _0x1723e=_0x3c9c77[_0xc372('0x1e')];var _0x28cbaa=_0x3e7bf6?0x0:_0x8ad8[_0xc372('0x1c')];var _0x96f8a=_0x3e7bf6?_0x3c9c77[_0xc372('0x1e')]:_0x8ad8[_0xc372('0x1c')]+_0x8ad8[_0xc372('0x1f')];var _0x5d50ae;if(_0x96f8a>=_0x1723e){_0x96f8a=_0x1723e;_0x5d50ae=0xc8;}else{_0x5d50ae=0xce;}_0x103635[_0xc372('0x19')](_0x5d50ae);return _0x103635['set'](_0xc372('0x20'),_0x28cbaa+'-'+_0x96f8a+'/'+_0x1723e)[_0xc372('0x1b')](_0x3c9c77);}return null;};}function patchUpdates(_0x52d881){return function(_0x44fb9a){try{jsonpatch['apply'](_0x44fb9a,_0x52d881,!![]);}catch(_0x25332a){return BPromise['reject'](_0x25332a);}return _0x44fb9a[_0xc372('0x21')]();};}function saveUpdates(_0x48b5e3,_0x1ca2d8){return function(_0x529352){if(_0x529352){return _0x529352[_0xc372('0x22')](_0x48b5e3)[_0xc372('0x23')](function(_0xa0b7e5){return _0xa0b7e5;});}return null;};}function removeEntity(_0x4c07c6,_0x2e4237){return function(_0x54ced1){if(_0x54ced1){return _0x54ced1[_0xc372('0x24')]()[_0xc372('0x23')](function(){_0x4c07c6[_0xc372('0x19')](0xcc)[_0xc372('0x1a')]();});}};}function handleEntityNotFound(_0x32387c,_0x9fd7ac){return function(_0x4cd267){if(!_0x4cd267){_0x32387c[_0xc372('0x18')](0x194);}return _0x4cd267;};}function handleError(_0x1dd8a7,_0x32cb6d){_0x32cb6d=_0x32cb6d||0x1f4;return function(_0x3b4570){logger[_0xc372('0x25')](_0x3b4570['stack']);if(_0x3b4570[_0xc372('0x26')]){delete _0x3b4570[_0xc372('0x26')];}_0x1dd8a7[_0xc372('0x19')](_0x32cb6d)[_0xc372('0x27')](_0x3b4570);};}exports['index']=function(_0x51eaf8,_0x46fe9f){var _0x594b1e={},_0xbc4d2c={},_0x525ee8={'count':0x0,'rows':[]};var _0x7acac6=_[_0xc372('0x28')](db[_0xc372('0x29')][_0xc372('0x2a')],function(_0x33c991){return{'name':_0x33c991['fieldName'],'type':_0x33c991[_0xc372('0x2b')]['key']};});_0xbc4d2c[_0xc372('0x2c')]=_[_0xc372('0x28')](_0x7acac6,_0xc372('0x26'));_0xbc4d2c[_0xc372('0x2d')]=_[_0xc372('0x2e')](_0x51eaf8[_0xc372('0x2d')]);_0xbc4d2c['filters']=_['intersection'](_0xbc4d2c[_0xc372('0x2c')],_0xbc4d2c[_0xc372('0x2d')]);_0x594b1e['attributes']=_[_0xc372('0x2f')](_0xbc4d2c['model'],qs[_0xc372('0x30')](_0x51eaf8[_0xc372('0x2d')][_0xc372('0x30')]));_0x594b1e[_0xc372('0x31')]=_0x594b1e[_0xc372('0x31')]['length']?_0x594b1e[_0xc372('0x31')]:_0xbc4d2c[_0xc372('0x2c')];if(!_0x51eaf8[_0xc372('0x2d')]['hasOwnProperty'](_0xc372('0x32'))){_0x594b1e[_0xc372('0x1f')]=qs['limit'](_0x51eaf8[_0xc372('0x2d')]['limit']);_0x594b1e[_0xc372('0x1c')]=qs[_0xc372('0x1c')](_0x51eaf8['query'][_0xc372('0x1c')]);}_0x594b1e[_0xc372('0x33')]=qs['sort'](_0x51eaf8['query']['sort']);_0x594b1e[_0xc372('0x34')]=qs['filters'](_[_0xc372('0x35')](_0x51eaf8[_0xc372('0x2d')],_0xbc4d2c[_0xc372('0x36')]),_0x7acac6);if(_0x51eaf8[_0xc372('0x2d')][_0xc372('0x37')]){_0x594b1e['where']=_['merge'](_0x594b1e[_0xc372('0x34')],{'$or':_[_0xc372('0x28')](_0x7acac6,function(_0x66720e){if(_0x66720e['type']!=='VIRTUAL'){var _0x15b160={};_0x15b160[_0x66720e[_0xc372('0x26')]]={'$like':'%'+_0x51eaf8[_0xc372('0x2d')][_0xc372('0x37')]+'%'};return _0x15b160;}})});}_0x594b1e=_[_0xc372('0x38')]({},_0x594b1e,_0x51eaf8['options']);var _0x6904fa={'where':_0x594b1e[_0xc372('0x34')]};return db[_0xc372('0x29')]['count'](_0x6904fa)[_0xc372('0x23')](function(_0x9b5477){_0x525ee8[_0xc372('0x1e')]=_0x9b5477;if(_0x51eaf8[_0xc372('0x2d')]['includeAll']){_0x594b1e['include']=[{'all':!![]}];}return db['SquareReport'][_0xc372('0x39')](_0x594b1e);})[_0xc372('0x23')](function(_0x8cb793){_0x525ee8[_0xc372('0x3a')]=_0x8cb793;return _0x525ee8;})[_0xc372('0x23')](respondWithFilteredResult(_0x46fe9f,_0x594b1e))[_0xc372('0x3b')](handleError(_0x46fe9f,null));};exports[_0xc372('0x3c')]=function(_0x5da5b9,_0x82414a){var _0x2aee9b={'raw':!![],'where':{'id':_0x5da5b9[_0xc372('0x3d')]['id']}},_0x376436={};_0x376436[_0xc372('0x2c')]=_[_0xc372('0x2e')](db['SquareReport'][_0xc372('0x2a')]);_0x376436[_0xc372('0x2d')]=_[_0xc372('0x2e')](_0x5da5b9['query']);_0x376436[_0xc372('0x36')]=_[_0xc372('0x2f')](_0x376436['model'],_0x376436['query']);_0x2aee9b[_0xc372('0x31')]=_[_0xc372('0x2f')](_0x376436['model'],qs[_0xc372('0x30')](_0x5da5b9['query'][_0xc372('0x30')]));_0x2aee9b[_0xc372('0x31')]=_0x2aee9b[_0xc372('0x31')]['length']?_0x2aee9b[_0xc372('0x31')]:_0x376436[_0xc372('0x2c')];if(_0x5da5b9[_0xc372('0x2d')][_0xc372('0x3e')]){_0x2aee9b[_0xc372('0x3f')]=[{'all':!![]}];}_0x2aee9b=_[_0xc372('0x38')]({},_0x2aee9b,_0x5da5b9['options']);return db[_0xc372('0x29')][_0xc372('0x40')](_0x2aee9b)[_0xc372('0x23')](handleEntityNotFound(_0x82414a,null))[_0xc372('0x23')](respondWithResult(_0x82414a,null))[_0xc372('0x3b')](handleError(_0x82414a,null));};exports['create']=function(_0x46dc1d,_0x57ceee){return db['SquareReport'][_0xc372('0x41')](_0x46dc1d[_0xc372('0x42')],{})['then'](respondWithResult(_0x57ceee,0xc9))[_0xc372('0x3b')](handleError(_0x57ceee,null));};exports['update']=function(_0x341958,_0x159bdd){if(_0x341958[_0xc372('0x42')]['id']){delete _0x341958[_0xc372('0x42')]['id'];}return db['SquareReport'][_0xc372('0x40')]({'where':{'id':_0x341958[_0xc372('0x3d')]['id']}})[_0xc372('0x23')](handleEntityNotFound(_0x159bdd,null))[_0xc372('0x23')](saveUpdates(_0x341958[_0xc372('0x42')],null))[_0xc372('0x23')](respondWithResult(_0x159bdd,null))[_0xc372('0x3b')](handleError(_0x159bdd,null));};exports['destroy']=function(_0xe3c598,_0xd4a4dc){return db['SquareReport']['find']({'where':{'id':_0xe3c598['params']['id']}})['then'](handleEntityNotFound(_0xd4a4dc,null))[_0xc372('0x23')](removeEntity(_0xd4a4dc,null))[_0xc372('0x3b')](handleError(_0xd4a4dc,null));};exports['describe']=function(_0x580e9e,_0x151b9c){return db['SquareReport'][_0xc372('0x43')]()[_0xc372('0x23')](respondWithResult(_0x151b9c,null))['catch'](handleError(_0x151b9c,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 070f11d..afc24f1 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 _0x39b2=['uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport'];(function(_0x249311,_0x349ee2){var _0x409d22=function(_0x5b06bd){while(--_0x5b06bd){_0x249311['push'](_0x249311['shift']());}};_0x409d22(++_0x349ee2);}(_0x39b2,0xaa));var _0x239b=function(_0x2552d0,_0x4f8bdb){_0x2552d0=_0x2552d0-0x0;var _0x2b7f11=_0x39b2[_0x2552d0];return _0x2b7f11;};'use strict';var _=require(_0x239b('0x0'));var util=require(_0x239b('0x1'));var logger=require(_0x239b('0x2'))(_0x239b('0x3'));var moment=require(_0x239b('0x4'));var BPromise=require(_0x239b('0x5'));var rp=require(_0x239b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x239b('0x7'));var config=require(_0x239b('0x8'));var attributes=require(_0x239b('0x9'));module['exports']=function(_0xc12e26,_0x1bb787){return _0xc12e26[_0x239b('0xa')](_0x239b('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x239b('0xc'),'fields':['uniqueid','project_name']},{'name':_0x239b('0xd'),'fields':[_0x239b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3748=['uniqueid','leaveAt','lodash','util','api','moment','request-promise','path','rimraf','./squareReport.attributes','define','SquareReport','report_square','uid_pname'];(function(_0x56092a,_0x291ce5){var _0x1c9558=function(_0x5bf0c5){while(--_0x5bf0c5){_0x56092a['push'](_0x56092a['shift']());}};_0x1c9558(++_0x291ce5);}(_0x3748,0xaa));var _0x8374=function(_0x1ffef2,_0x1b0032){_0x1ffef2=_0x1ffef2-0x0;var _0x2c3407=_0x3748[_0x1ffef2];return _0x2c3407;};'use strict';var _=require(_0x8374('0x0'));var util=require(_0x8374('0x1'));var logger=require('../../config/logger')(_0x8374('0x2'));var moment=require(_0x8374('0x3'));var BPromise=require('bluebird');var rp=require(_0x8374('0x4'));var fs=require('fs');var path=require(_0x8374('0x5'));var rimraf=require(_0x8374('0x6'));var config=require('../../config/environment');var attributes=require(_0x8374('0x7'));module['exports']=function(_0x5b3b86,_0x556211){return _0x5b3b86[_0x8374('0x8')](_0x8374('0x9'),attributes,{'tableName':_0x8374('0xa'),'paranoid':![],'indexes':[{'name':_0x8374('0xb'),'fields':[_0x8374('0xc'),'project_name']},{'name':_0x8374('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index dbeec4d..0dd3a64 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 _0x18ac=['SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update','limit','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18ac,0x1b8));var _0xc18a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x18ac[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc18a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc18a('0x1'));var fs=require('fs');var Redis=require(_0xc18a('0x2'));var db=require(_0xc18a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc18a('0x4'))(_0xc18a('0x5'));var config=require(_0xc18a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc18a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15efe4,_0x233e07,_0x93c4cc){return new BPromise(function(_0x13380e,_0x211801){return client[_0xc18a('0x8')](_0x15efe4,_0x93c4cc)[_0xc18a('0x9')](function(_0x38b697){logger['info'](_0xc18a('0xa'),_0x233e07,_0xc18a('0xb'));logger['debug'](_0xc18a('0xc'),_0x233e07,_0xc18a('0xb'),JSON['stringify'](_0x38b697));if(_0x38b697[_0xc18a('0xd')]){if(_0x38b697[_0xc18a('0xd')][_0xc18a('0xe')]===0x1f4){logger['error'](_0xc18a('0xa'),_0x233e07,_0x38b697['error'][_0xc18a('0xf')]);return _0x211801(_0x38b697['error'][_0xc18a('0xf')]);}logger[_0xc18a('0xd')](_0xc18a('0xa'),_0x233e07,_0x38b697[_0xc18a('0xd')]['message']);return _0x13380e(_0x38b697[_0xc18a('0xd')]['message']);}else{logger[_0xc18a('0x10')](_0xc18a('0xa'),_0x233e07,_0xc18a('0xb'));_0x13380e(_0x38b697[_0xc18a('0x11')][_0xc18a('0xf')]);}})[_0xc18a('0x12')](function(_0x4a0298){logger[_0xc18a('0xd')](_0xc18a('0xa'),_0x233e07,_0x4a0298);_0x211801(_0x4a0298);});});}exports[_0xc18a('0x13')]=function(_0x37d8c4){var _0x2bbfc7=this;return new Promise(function(_0x1d6aa9,_0x246723){return db[_0xc18a('0x14')][_0xc18a('0x15')](_0x37d8c4[_0xc18a('0x16')],{'raw':_0x37d8c4[_0xc18a('0x17')]?_0x37d8c4[_0xc18a('0x17')][_0xc18a('0x18')]===undefined?!![]:![]:!![]})[_0xc18a('0x9')](function(_0x4406fb){logger[_0xc18a('0x10')](_0xc18a('0x13'),_0x37d8c4);logger['debug'](_0xc18a('0x13'),_0x37d8c4,JSON[_0xc18a('0x19')](_0x4406fb));_0x1d6aa9(_0x4406fb);})['catch'](function(_0x24d209){logger[_0xc18a('0xd')](_0xc18a('0x13'),_0x24d209[_0xc18a('0xf')],_0x37d8c4);_0x246723(_0x2bbfc7[_0xc18a('0xd')](0x1f4,_0x24d209[_0xc18a('0xf')]));});});};exports[_0xc18a('0x1a')]=function(_0x1d5f42){var _0x1a07d0=this;return new Promise(function(_0x4a450a,_0x4747ba){return db[_0xc18a('0x14')][_0xc18a('0x1b')](_0x1d5f42[_0xc18a('0x16')],{'raw':_0x1d5f42[_0xc18a('0x17')]?_0x1d5f42['options'][_0xc18a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d5f42[_0xc18a('0x17')]?_0x1d5f42['options']['where']||null:null,'attributes':_0x1d5f42['options']?_0x1d5f42[_0xc18a('0x17')]['attributes']||null:null,'limit':_0x1d5f42[_0xc18a('0x17')]?_0x1d5f42[_0xc18a('0x17')][_0xc18a('0x1c')]||null:null})[_0xc18a('0x9')](function(_0x28d13a){logger['info'](_0xc18a('0x1a'),_0x1d5f42);logger[_0xc18a('0x1d')](_0xc18a('0x1a'),_0x1d5f42,JSON['stringify'](_0x28d13a));_0x4a450a(_0x28d13a);})['catch'](function(_0x410d10){logger['error'](_0xc18a('0x1a'),_0x410d10['message'],_0x1d5f42);_0x4747ba(_0x1a07d0[_0xc18a('0xd')](0x1f4,_0x410d10[_0xc18a('0xf')]));});});}; \ No newline at end of file +var _0x89a2=['options','UpdateSquareReport','update','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','body'];(function(_0x5d2bd4,_0x210353){var _0x2b0012=function(_0x491403){while(--_0x491403){_0x5d2bd4['push'](_0x5d2bd4['shift']());}};_0x2b0012(++_0x210353);}(_0x89a2,0x127));var _0x289a=function(_0x444e8b,_0x3524cc){_0x444e8b=_0x444e8b-0x0;var _0x35eb37=_0x89a2[_0x444e8b];return _0x35eb37;};'use strict';var _=require(_0x289a('0x0'));var util=require('util');var moment=require(_0x289a('0x1'));var BPromise=require('bluebird');var rs=require(_0x289a('0x2'));var fs=require('fs');var Redis=require(_0x289a('0x3'));var db=require(_0x289a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x289a('0x5'))(_0x289a('0x6'));var config=require(_0x289a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x289a('0x8')][_0x289a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c08e1,_0x17d589,_0x3b18ac){return new BPromise(function(_0x342727,_0x16036f){return client[_0x289a('0xa')](_0x2c08e1,_0x3b18ac)[_0x289a('0xb')](function(_0x552964){logger[_0x289a('0xc')](_0x289a('0xd'),_0x17d589,_0x289a('0xe'));logger['debug'](_0x289a('0xf'),_0x17d589,_0x289a('0xe'),JSON[_0x289a('0x10')](_0x552964));if(_0x552964[_0x289a('0x11')]){if(_0x552964['error'][_0x289a('0x12')]===0x1f4){logger[_0x289a('0x11')](_0x289a('0xd'),_0x17d589,_0x552964[_0x289a('0x11')][_0x289a('0x13')]);return _0x16036f(_0x552964[_0x289a('0x11')][_0x289a('0x13')]);}logger['error'](_0x289a('0xd'),_0x17d589,_0x552964[_0x289a('0x11')]['message']);return _0x342727(_0x552964[_0x289a('0x11')][_0x289a('0x13')]);}else{logger[_0x289a('0xc')](_0x289a('0xd'),_0x17d589,_0x289a('0xe'));_0x342727(_0x552964['result'][_0x289a('0x13')]);}})[_0x289a('0x14')](function(_0x26d77e){logger[_0x289a('0x11')](_0x289a('0xd'),_0x17d589,_0x26d77e);_0x16036f(_0x26d77e);});});}exports[_0x289a('0x15')]=function(_0x15e3c9){var _0x29e59d=this;return new Promise(function(_0x1128e1,_0x2a63f7){return db[_0x289a('0x16')][_0x289a('0x17')](_0x15e3c9[_0x289a('0x18')],{'raw':_0x15e3c9['options']?_0x15e3c9[_0x289a('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x403d3e){logger['info'](_0x289a('0x15'),_0x15e3c9);logger['debug'](_0x289a('0x15'),_0x15e3c9,JSON[_0x289a('0x10')](_0x403d3e));_0x1128e1(_0x403d3e);})['catch'](function(_0x4e1929){logger[_0x289a('0x11')](_0x289a('0x15'),_0x4e1929[_0x289a('0x13')],_0x15e3c9);_0x2a63f7(_0x29e59d['error'](0x1f4,_0x4e1929[_0x289a('0x13')]));});});};exports[_0x289a('0x1a')]=function(_0x2c7cf0){var _0x40ec9f=this;return new Promise(function(_0x500c71,_0x43c76e){return db[_0x289a('0x16')][_0x289a('0x1b')](_0x2c7cf0[_0x289a('0x18')],{'raw':_0x2c7cf0['options']?_0x2c7cf0['options'][_0x289a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c7cf0[_0x289a('0x19')]?_0x2c7cf0[_0x289a('0x19')][_0x289a('0x1d')]||null:null,'attributes':_0x2c7cf0[_0x289a('0x19')]?_0x2c7cf0['options'][_0x289a('0x1e')]||null:null,'limit':_0x2c7cf0['options']?_0x2c7cf0[_0x289a('0x19')][_0x289a('0x1f')]||null:null})[_0x289a('0xb')](function(_0xf3b58c){logger[_0x289a('0xc')](_0x289a('0x1a'),_0x2c7cf0);logger['debug'](_0x289a('0x1a'),_0x2c7cf0,JSON[_0x289a('0x10')](_0xf3b58c));_0x500c71(_0xf3b58c);})[_0x289a('0x14')](function(_0x399b5b){logger[_0x289a('0x11')]('UpdateSquareReport',_0x399b5b[_0x289a('0x13')],_0x2c7cf0);_0x43c76e(_0x40ec9f[_0x289a('0x11')](0x1f4,_0x399b5b[_0x289a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 61279dd..fee57fc 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 _0x4dfe=['./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0x4dfe,0x9b));var _0xe4df=function(_0x48e24d,_0xadb7a2){_0x48e24d=_0x48e24d-0x0;var _0x1ff562=_0x4dfe[_0x48e24d];return _0x1ff562;};'use strict';var multer=require(_0xe4df('0x0'));var util=require(_0xe4df('0x1'));var path=require(_0xe4df('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4df('0x3'));var router=express[_0xe4df('0x4')]();var fs_extra=require(_0xe4df('0x5'));var auth=require(_0xe4df('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe4df('0x7'));router[_0xe4df('0x8')]('/',auth['isAuthenticated'](),controller[_0xe4df('0x9')]);router['get'](_0xe4df('0xa'),auth[_0xe4df('0xb')](),controller[_0xe4df('0xc')]);router[_0xe4df('0x8')](_0xe4df('0xd'),auth[_0xe4df('0xb')](),controller[_0xe4df('0xe')]);router[_0xe4df('0xf')]('/',auth[_0xe4df('0xb')](),controller['create']);router['put']('/:id',auth[_0xe4df('0xb')](),controller['update']);router['delete']('/:id',auth[_0xe4df('0xb')](),controller[_0xe4df('0x10')]);module[_0xe4df('0x11')]=router; \ No newline at end of file +var _0x4b07=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x5e492e,_0x54ecec){var _0x339e70=function(_0x109353){while(--_0x109353){_0x5e492e['push'](_0x5e492e['shift']());}};_0x339e70(++_0x54ecec);}(_0x4b07,0x89));var _0x74b0=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x4b07[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x74b0('0x0'));var util=require('util');var path=require(_0x74b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x74b0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x74b0('0x3'));var interaction=require(_0x74b0('0x4'));var config=require(_0x74b0('0x5'));var controller=require('./squareReportDetail.controller');router[_0x74b0('0x6')]('/',auth[_0x74b0('0x7')](),controller[_0x74b0('0x8')]);router[_0x74b0('0x6')](_0x74b0('0x9'),auth[_0x74b0('0x7')](),controller[_0x74b0('0xa')]);router['get'](_0x74b0('0xb'),auth[_0x74b0('0x7')](),controller[_0x74b0('0xc')]);router[_0x74b0('0xd')]('/',auth[_0x74b0('0x7')](),controller[_0x74b0('0xe')]);router[_0x74b0('0xf')]('/:id',auth[_0x74b0('0x7')](),controller[_0x74b0('0x10')]);router[_0x74b0('0x11')](_0x74b0('0xb'),auth[_0x74b0('0x7')](),controller[_0x74b0('0x12')]);module[_0x74b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c7581ba..cda1b04 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 _0xac38=['exports','STRING','TEXT','sequelize'];(function(_0x3fe8cf,_0x800437){var _0x56beb7=function(_0x44dd23){while(--_0x44dd23){_0x3fe8cf['push'](_0x3fe8cf['shift']());}};_0x56beb7(++_0x800437);}(_0xac38,0xb3));var _0x8ac3=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0xac38[_0x44dba1];return _0x2fbd3f;};'use strict';var Sequelize=require(_0x8ac3('0x0'));module[_0x8ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x8ac3('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x8ac3('0x3')]},'project_name':{'type':Sequelize[_0x8ac3('0x2')]},'callerid':{'type':Sequelize[_0x8ac3('0x2')]}}; \ No newline at end of file +var _0x2494=['TEXT','sequelize','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2494,0xf5));var _0x4249=function(_0x204d23,_0x32f4cf){_0x204d23=_0x204d23-0x0;var _0x38d614=_0x2494[_0x204d23];return _0x38d614;};'use strict';var Sequelize=require(_0x4249('0x0'));module[_0x4249('0x1')]={'uniqueid':{'type':Sequelize[_0x4249('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x4249('0x3')]},'project_name':{'type':Sequelize[_0x4249('0x2')]},'callerid':{'type':Sequelize[_0x4249('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index da5d4d8..b6168a8 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 _0xba92=['../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba92,0x178));var _0x2ba9=function(_0x1a7f2c,_0x1e6812){_0x1a7f2c=_0x1a7f2c-0x0;var _0x357274=_0xba92[_0x1a7f2c];return _0x357274;};'use strict';var emlformat=require(_0x2ba9('0x0'));var rimraf=require(_0x2ba9('0x1'));var zipdir=require(_0x2ba9('0x2'));var jsonpatch=require(_0x2ba9('0x3'));var rp=require(_0x2ba9('0x4'));var moment=require(_0x2ba9('0x5'));var BPromise=require(_0x2ba9('0x6'));var Mustache=require(_0x2ba9('0x7'));var util=require(_0x2ba9('0x8'));var path=require(_0x2ba9('0x9'));var sox=require(_0x2ba9('0xa'));var csv=require(_0x2ba9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ba9('0xc'));var _=require(_0x2ba9('0xd'));var squel=require(_0x2ba9('0xe'));var crypto=require(_0x2ba9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2ba9('0x10'));var toCsv=require(_0x2ba9('0xb'));var querystring=require(_0x2ba9('0x11'));var Papa=require(_0x2ba9('0x12'));var Redis=require(_0x2ba9('0x13'));var authService=require(_0x2ba9('0x14'));var qs=require(_0x2ba9('0x15'));var as=require(_0x2ba9('0x16'));var hardwareService=require(_0x2ba9('0x17'));var logger=require(_0x2ba9('0x18'))(_0x2ba9('0x19'));var utils=require('../../config/utils');var config=require(_0x2ba9('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ba9('0x1b'))['db'];function respondWithStatusCode(_0x471427,_0x3e3257){_0x3e3257=_0x3e3257||0xcc;return function(_0x2192d5){if(_0x2192d5){return _0x471427['sendStatus'](_0x3e3257);}return _0x471427['status'](_0x3e3257)[_0x2ba9('0x1c')]();};}function respondWithResult(_0x5ec0ea,_0x4cf5b7){_0x4cf5b7=_0x4cf5b7||0xc8;return function(_0x5166be){if(_0x5166be){return _0x5ec0ea[_0x2ba9('0x1d')](_0x4cf5b7)[_0x2ba9('0x1e')](_0x5166be);}};}function respondWithFilteredResult(_0x3f03ec,_0x5a9b6a){return function(_0x559776){if(_0x559776){var _0x104461=typeof _0x5a9b6a[_0x2ba9('0x1f')]==='undefined'&&typeof _0x5a9b6a[_0x2ba9('0x20')]===_0x2ba9('0x21');var _0x5ea4b2=_0x559776[_0x2ba9('0x22')];var _0x4b9ea2=_0x104461?0x0:_0x5a9b6a[_0x2ba9('0x1f')];var _0x21aaa2=_0x104461?_0x559776['count']:_0x5a9b6a[_0x2ba9('0x1f')]+_0x5a9b6a[_0x2ba9('0x20')];var _0x107682;if(_0x21aaa2>=_0x5ea4b2){_0x21aaa2=_0x5ea4b2;_0x107682=0xc8;}else{_0x107682=0xce;}_0x3f03ec['status'](_0x107682);return _0x3f03ec[_0x2ba9('0x23')](_0x2ba9('0x24'),_0x4b9ea2+'-'+_0x21aaa2+'/'+_0x5ea4b2)['json'](_0x559776);}return null;};}function patchUpdates(_0x3906a9){return function(_0x904c65){try{jsonpatch[_0x2ba9('0x25')](_0x904c65,_0x3906a9,!![]);}catch(_0xbddbbc){return BPromise[_0x2ba9('0x26')](_0xbddbbc);}return _0x904c65['save']();};}function saveUpdates(_0x4cc6af,_0x1959e0){return function(_0x97f26){if(_0x97f26){return _0x97f26[_0x2ba9('0x27')](_0x4cc6af)[_0x2ba9('0x28')](function(_0x2b0090){return _0x2b0090;});}return null;};}function removeEntity(_0xf9ae07,_0x35739c){return function(_0x317ba0){if(_0x317ba0){return _0x317ba0[_0x2ba9('0x29')]()['then'](function(){_0xf9ae07['status'](0xcc)[_0x2ba9('0x1c')]();});}};}function handleEntityNotFound(_0x1314aa,_0x18fe22){return function(_0x1f8ca3){if(!_0x1f8ca3){_0x1314aa['sendStatus'](0x194);}return _0x1f8ca3;};}function handleError(_0x1f3be6,_0x4a9c81){_0x4a9c81=_0x4a9c81||0x1f4;return function(_0xb350df){logger[_0x2ba9('0x2a')](_0xb350df[_0x2ba9('0x2b')]);if(_0xb350df[_0x2ba9('0x2c')]){delete _0xb350df[_0x2ba9('0x2c')];}_0x1f3be6[_0x2ba9('0x1d')](_0x4a9c81)[_0x2ba9('0x2d')](_0xb350df);};}exports[_0x2ba9('0x2e')]=function(_0x3d07fd,_0x5d71e8){var _0x46241f={},_0x424e01={},_0xbfb152={'count':0x0,'rows':[]};var _0x408c40=_[_0x2ba9('0x2f')](db[_0x2ba9('0x30')][_0x2ba9('0x31')],function(_0x5c91b2){return{'name':_0x5c91b2[_0x2ba9('0x32')],'type':_0x5c91b2[_0x2ba9('0x33')]['key']};});_0x424e01[_0x2ba9('0x34')]=_[_0x2ba9('0x2f')](_0x408c40,_0x2ba9('0x2c'));_0x424e01[_0x2ba9('0x35')]=_[_0x2ba9('0x36')](_0x3d07fd['query']);_0x424e01[_0x2ba9('0x37')]=_[_0x2ba9('0x38')](_0x424e01['model'],_0x424e01[_0x2ba9('0x35')]);_0x46241f['attributes']=_[_0x2ba9('0x38')](_0x424e01[_0x2ba9('0x34')],qs['fields'](_0x3d07fd[_0x2ba9('0x35')][_0x2ba9('0x39')]));_0x46241f[_0x2ba9('0x3a')]=_0x46241f[_0x2ba9('0x3a')]['length']?_0x46241f[_0x2ba9('0x3a')]:_0x424e01[_0x2ba9('0x34')];if(!_0x3d07fd[_0x2ba9('0x35')][_0x2ba9('0x3b')](_0x2ba9('0x3c'))){_0x46241f[_0x2ba9('0x20')]=qs[_0x2ba9('0x20')](_0x3d07fd[_0x2ba9('0x35')][_0x2ba9('0x20')]);_0x46241f['offset']=qs[_0x2ba9('0x1f')](_0x3d07fd[_0x2ba9('0x35')][_0x2ba9('0x1f')]);}_0x46241f[_0x2ba9('0x3d')]=qs['sort'](_0x3d07fd['query']['sort']);_0x46241f[_0x2ba9('0x3e')]=qs[_0x2ba9('0x37')](_[_0x2ba9('0x3f')](_0x3d07fd[_0x2ba9('0x35')],_0x424e01['filters']),_0x408c40);if(_0x3d07fd[_0x2ba9('0x35')][_0x2ba9('0x40')]){_0x46241f[_0x2ba9('0x3e')]=_[_0x2ba9('0x41')](_0x46241f[_0x2ba9('0x3e')],{'$or':_['map'](_0x408c40,function(_0x192183){if(_0x192183[_0x2ba9('0x33')]!==_0x2ba9('0x42')){var _0x35a683={};_0x35a683[_0x192183[_0x2ba9('0x2c')]]={'$like':'%'+_0x3d07fd['query'][_0x2ba9('0x40')]+'%'};return _0x35a683;}})});}_0x46241f=_[_0x2ba9('0x41')]({},_0x46241f,_0x3d07fd[_0x2ba9('0x43')]);var _0x5e14ae={'where':_0x46241f[_0x2ba9('0x3e')]};return db['SquareDetailsReport']['count'](_0x5e14ae)['then'](function(_0x3b9dfc){_0xbfb152['count']=_0x3b9dfc;if(_0x3d07fd['query'][_0x2ba9('0x44')]){_0x46241f[_0x2ba9('0x45')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x2ba9('0x46')](_0x46241f);})[_0x2ba9('0x28')](function(_0x2e2582){_0xbfb152[_0x2ba9('0x47')]=_0x2e2582;return _0xbfb152;})['then'](respondWithFilteredResult(_0x5d71e8,_0x46241f))[_0x2ba9('0x48')](handleError(_0x5d71e8,null));};exports[_0x2ba9('0x49')]=function(_0x470b2b,_0x2b375e){var _0x2ee0e2={'raw':!![],'where':{'id':_0x470b2b[_0x2ba9('0x4a')]['id']}},_0xd02030={};_0xd02030[_0x2ba9('0x34')]=_[_0x2ba9('0x36')](db['SquareDetailsReport'][_0x2ba9('0x31')]);_0xd02030[_0x2ba9('0x35')]=_[_0x2ba9('0x36')](_0x470b2b[_0x2ba9('0x35')]);_0xd02030[_0x2ba9('0x37')]=_[_0x2ba9('0x38')](_0xd02030[_0x2ba9('0x34')],_0xd02030[_0x2ba9('0x35')]);_0x2ee0e2[_0x2ba9('0x3a')]=_[_0x2ba9('0x38')](_0xd02030[_0x2ba9('0x34')],qs[_0x2ba9('0x39')](_0x470b2b[_0x2ba9('0x35')][_0x2ba9('0x39')]));_0x2ee0e2['attributes']=_0x2ee0e2[_0x2ba9('0x3a')][_0x2ba9('0x4b')]?_0x2ee0e2[_0x2ba9('0x3a')]:_0xd02030[_0x2ba9('0x34')];if(_0x470b2b[_0x2ba9('0x35')][_0x2ba9('0x44')]){_0x2ee0e2[_0x2ba9('0x45')]=[{'all':!![]}];}_0x2ee0e2=_[_0x2ba9('0x41')]({},_0x2ee0e2,_0x470b2b[_0x2ba9('0x43')]);return db[_0x2ba9('0x30')][_0x2ba9('0x4c')](_0x2ee0e2)[_0x2ba9('0x28')](handleEntityNotFound(_0x2b375e,null))['then'](respondWithResult(_0x2b375e,null))['catch'](handleError(_0x2b375e,null));};exports[_0x2ba9('0x4d')]=function(_0xddc686,_0x3c8e22){return db[_0x2ba9('0x30')][_0x2ba9('0x4d')](_0xddc686[_0x2ba9('0x4e')],{})[_0x2ba9('0x28')](respondWithResult(_0x3c8e22,0xc9))[_0x2ba9('0x48')](handleError(_0x3c8e22,null));};exports[_0x2ba9('0x27')]=function(_0x473660,_0x1c93d5){if(_0x473660[_0x2ba9('0x4e')]['id']){delete _0x473660[_0x2ba9('0x4e')]['id'];}return db[_0x2ba9('0x30')][_0x2ba9('0x4c')]({'where':{'id':_0x473660[_0x2ba9('0x4a')]['id']}})[_0x2ba9('0x28')](handleEntityNotFound(_0x1c93d5,null))[_0x2ba9('0x28')](saveUpdates(_0x473660[_0x2ba9('0x4e')],null))[_0x2ba9('0x28')](respondWithResult(_0x1c93d5,null))[_0x2ba9('0x48')](handleError(_0x1c93d5,null));};exports[_0x2ba9('0x29')]=function(_0x4308c9,_0x17344d){return db[_0x2ba9('0x30')][_0x2ba9('0x4c')]({'where':{'id':_0x4308c9['params']['id']}})[_0x2ba9('0x28')](handleEntityNotFound(_0x17344d,null))[_0x2ba9('0x28')](removeEntity(_0x17344d,null))['catch'](handleError(_0x17344d,null));};exports['describe']=function(_0x4aea09,_0x1b399a){return db['SquareDetailsReport'][_0x2ba9('0x4f')]()['then'](respondWithResult(_0x1b399a,null))[_0x2ba9('0x48')](handleError(_0x1b399a,null));}; \ No newline at end of file +var _0xa211=['reject','save','update','destroy','then','error','stack','name','send','map','SquareDetailsReport','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range'];(function(_0x5ae761,_0x9afc7c){var _0x42add3=function(_0x5e0fa8){while(--_0x5e0fa8){_0x5ae761['push'](_0x5ae761['shift']());}};_0x42add3(++_0x9afc7c);}(_0xa211,0x10c));var _0x1a21=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa211[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x1a21('0x0'));var rimraf=require(_0x1a21('0x1'));var zipdir=require(_0x1a21('0x2'));var jsonpatch=require(_0x1a21('0x3'));var rp=require(_0x1a21('0x4'));var moment=require(_0x1a21('0x5'));var BPromise=require(_0x1a21('0x6'));var Mustache=require(_0x1a21('0x7'));var util=require(_0x1a21('0x8'));var path=require(_0x1a21('0x9'));var sox=require('sox');var csv=require(_0x1a21('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a21('0xb'));var _=require(_0x1a21('0xc'));var squel=require(_0x1a21('0xd'));var crypto=require(_0x1a21('0xe'));var jsforce=require(_0x1a21('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1a21('0xa'));var querystring=require('querystring');var Papa=require(_0x1a21('0x10'));var Redis=require(_0x1a21('0x11'));var authService=require(_0x1a21('0x12'));var qs=require(_0x1a21('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a21('0x14'));var logger=require(_0x1a21('0x15'))(_0x1a21('0x16'));var utils=require(_0x1a21('0x17'));var config=require(_0x1a21('0x18'));var licenseUtil=require(_0x1a21('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x89e569,_0x274dd7){_0x274dd7=_0x274dd7||0xcc;return function(_0x1f02d1){if(_0x1f02d1){return _0x89e569[_0x1a21('0x1a')](_0x274dd7);}return _0x89e569['status'](_0x274dd7)[_0x1a21('0x1b')]();};}function respondWithResult(_0x4c18db,_0x106b5d){_0x106b5d=_0x106b5d||0xc8;return function(_0xc8630c){if(_0xc8630c){return _0x4c18db['status'](_0x106b5d)[_0x1a21('0x1c')](_0xc8630c);}};}function respondWithFilteredResult(_0x3d80d4,_0x1fa2ab){return function(_0x51704d){if(_0x51704d){var _0x2c8093=typeof _0x1fa2ab[_0x1a21('0x1d')]===_0x1a21('0x1e')&&typeof _0x1fa2ab['limit']===_0x1a21('0x1e');var _0x16eaa6=_0x51704d[_0x1a21('0x1f')];var _0x316155=_0x2c8093?0x0:_0x1fa2ab[_0x1a21('0x1d')];var _0x1249d2=_0x2c8093?_0x51704d[_0x1a21('0x1f')]:_0x1fa2ab[_0x1a21('0x1d')]+_0x1fa2ab[_0x1a21('0x20')];var _0x320897;if(_0x1249d2>=_0x16eaa6){_0x1249d2=_0x16eaa6;_0x320897=0xc8;}else{_0x320897=0xce;}_0x3d80d4[_0x1a21('0x21')](_0x320897);return _0x3d80d4[_0x1a21('0x22')](_0x1a21('0x23'),_0x316155+'-'+_0x1249d2+'/'+_0x16eaa6)[_0x1a21('0x1c')](_0x51704d);}return null;};}function patchUpdates(_0x44135b){return function(_0x53365a){try{jsonpatch['apply'](_0x53365a,_0x44135b,!![]);}catch(_0x131f98){return BPromise[_0x1a21('0x24')](_0x131f98);}return _0x53365a[_0x1a21('0x25')]();};}function saveUpdates(_0x4f0a23,_0x4c7132){return function(_0x356f3f){if(_0x356f3f){return _0x356f3f[_0x1a21('0x26')](_0x4f0a23)['then'](function(_0x1b902d){return _0x1b902d;});}return null;};}function removeEntity(_0x3587d2,_0x264ffe){return function(_0x244ed5){if(_0x244ed5){return _0x244ed5[_0x1a21('0x27')]()[_0x1a21('0x28')](function(){_0x3587d2['status'](0xcc)[_0x1a21('0x1b')]();});}};}function handleEntityNotFound(_0x11a0f1,_0x482536){return function(_0x5d6197){if(!_0x5d6197){_0x11a0f1[_0x1a21('0x1a')](0x194);}return _0x5d6197;};}function handleError(_0x140876,_0x3b2b5a){_0x3b2b5a=_0x3b2b5a||0x1f4;return function(_0x459650){logger[_0x1a21('0x29')](_0x459650[_0x1a21('0x2a')]);if(_0x459650[_0x1a21('0x2b')]){delete _0x459650['name'];}_0x140876[_0x1a21('0x21')](_0x3b2b5a)[_0x1a21('0x2c')](_0x459650);};}exports['index']=function(_0x1e6ab6,_0x2ea4e9){var _0x371b95={},_0x3afc55={},_0x23c0b2={'count':0x0,'rows':[]};var _0x279caf=_[_0x1a21('0x2d')](db[_0x1a21('0x2e')][_0x1a21('0x2f')],function(_0x156a00){return{'name':_0x156a00['fieldName'],'type':_0x156a00[_0x1a21('0x30')][_0x1a21('0x31')]};});_0x3afc55[_0x1a21('0x32')]=_['map'](_0x279caf,_0x1a21('0x2b'));_0x3afc55[_0x1a21('0x33')]=_['keys'](_0x1e6ab6[_0x1a21('0x33')]);_0x3afc55['filters']=_[_0x1a21('0x34')](_0x3afc55[_0x1a21('0x32')],_0x3afc55[_0x1a21('0x33')]);_0x371b95[_0x1a21('0x35')]=_[_0x1a21('0x34')](_0x3afc55[_0x1a21('0x32')],qs[_0x1a21('0x36')](_0x1e6ab6[_0x1a21('0x33')][_0x1a21('0x36')]));_0x371b95[_0x1a21('0x35')]=_0x371b95[_0x1a21('0x35')]['length']?_0x371b95[_0x1a21('0x35')]:_0x3afc55[_0x1a21('0x32')];if(!_0x1e6ab6[_0x1a21('0x33')][_0x1a21('0x37')](_0x1a21('0x38'))){_0x371b95[_0x1a21('0x20')]=qs['limit'](_0x1e6ab6[_0x1a21('0x33')]['limit']);_0x371b95[_0x1a21('0x1d')]=qs[_0x1a21('0x1d')](_0x1e6ab6[_0x1a21('0x33')]['offset']);}_0x371b95[_0x1a21('0x39')]=qs[_0x1a21('0x3a')](_0x1e6ab6[_0x1a21('0x33')][_0x1a21('0x3a')]);_0x371b95[_0x1a21('0x3b')]=qs['filters'](_[_0x1a21('0x3c')](_0x1e6ab6[_0x1a21('0x33')],_0x3afc55['filters']),_0x279caf);if(_0x1e6ab6[_0x1a21('0x33')][_0x1a21('0x3d')]){_0x371b95['where']=_[_0x1a21('0x3e')](_0x371b95['where'],{'$or':_['map'](_0x279caf,function(_0x2faa80){if(_0x2faa80['type']!=='VIRTUAL'){var _0x13f15e={};_0x13f15e[_0x2faa80['name']]={'$like':'%'+_0x1e6ab6['query'][_0x1a21('0x3d')]+'%'};return _0x13f15e;}})});}_0x371b95=_[_0x1a21('0x3e')]({},_0x371b95,_0x1e6ab6[_0x1a21('0x3f')]);var _0x35a767={'where':_0x371b95[_0x1a21('0x3b')]};return db['SquareDetailsReport'][_0x1a21('0x1f')](_0x35a767)[_0x1a21('0x28')](function(_0x2e5128){_0x23c0b2[_0x1a21('0x1f')]=_0x2e5128;if(_0x1e6ab6[_0x1a21('0x33')][_0x1a21('0x40')]){_0x371b95[_0x1a21('0x41')]=[{'all':!![]}];}return db[_0x1a21('0x2e')][_0x1a21('0x42')](_0x371b95);})[_0x1a21('0x28')](function(_0x297734){_0x23c0b2[_0x1a21('0x43')]=_0x297734;return _0x23c0b2;})[_0x1a21('0x28')](respondWithFilteredResult(_0x2ea4e9,_0x371b95))[_0x1a21('0x44')](handleError(_0x2ea4e9,null));};exports['show']=function(_0x4d5272,_0x450d03){var _0x4880de={'raw':!![],'where':{'id':_0x4d5272['params']['id']}},_0x5b3293={};_0x5b3293[_0x1a21('0x32')]=_[_0x1a21('0x45')](db[_0x1a21('0x2e')]['rawAttributes']);_0x5b3293[_0x1a21('0x33')]=_[_0x1a21('0x45')](_0x4d5272[_0x1a21('0x33')]);_0x5b3293['filters']=_[_0x1a21('0x34')](_0x5b3293[_0x1a21('0x32')],_0x5b3293[_0x1a21('0x33')]);_0x4880de[_0x1a21('0x35')]=_[_0x1a21('0x34')](_0x5b3293[_0x1a21('0x32')],qs[_0x1a21('0x36')](_0x4d5272[_0x1a21('0x33')]['fields']));_0x4880de[_0x1a21('0x35')]=_0x4880de[_0x1a21('0x35')][_0x1a21('0x46')]?_0x4880de[_0x1a21('0x35')]:_0x5b3293[_0x1a21('0x32')];if(_0x4d5272[_0x1a21('0x33')][_0x1a21('0x40')]){_0x4880de['include']=[{'all':!![]}];}_0x4880de=_[_0x1a21('0x3e')]({},_0x4880de,_0x4d5272[_0x1a21('0x3f')]);return db['SquareDetailsReport'][_0x1a21('0x47')](_0x4880de)['then'](handleEntityNotFound(_0x450d03,null))[_0x1a21('0x28')](respondWithResult(_0x450d03,null))[_0x1a21('0x44')](handleError(_0x450d03,null));};exports['create']=function(_0x231a01,_0x2795b5){return db['SquareDetailsReport'][_0x1a21('0x48')](_0x231a01['body'],{})[_0x1a21('0x28')](respondWithResult(_0x2795b5,0xc9))[_0x1a21('0x44')](handleError(_0x2795b5,null));};exports[_0x1a21('0x26')]=function(_0x1941b6,_0x10b03d){if(_0x1941b6[_0x1a21('0x49')]['id']){delete _0x1941b6[_0x1a21('0x49')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x1941b6[_0x1a21('0x4a')]['id']}})[_0x1a21('0x28')](handleEntityNotFound(_0x10b03d,null))['then'](saveUpdates(_0x1941b6[_0x1a21('0x49')],null))[_0x1a21('0x28')](respondWithResult(_0x10b03d,null))['catch'](handleError(_0x10b03d,null));};exports['destroy']=function(_0x4b4e70,_0x10a0d6){return db[_0x1a21('0x2e')][_0x1a21('0x47')]({'where':{'id':_0x4b4e70[_0x1a21('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10a0d6,null))[_0x1a21('0x28')](removeEntity(_0x10a0d6,null))[_0x1a21('0x44')](handleError(_0x10a0d6,null));};exports[_0x1a21('0x4b')]=function(_0x4fe4f7,_0x4031e2){return db['SquareDetailsReport'][_0x1a21('0x4b')]()['then'](respondWithResult(_0x4031e2,null))[_0x1a21('0x44')](handleError(_0x4031e2,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3ef9d91..0bce28a 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 _0xeb55=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x40710f,_0x3f145e){var _0x591385=function(_0x1615e4){while(--_0x1615e4){_0x40710f['push'](_0x40710f['shift']());}};_0x591385(++_0x3f145e);}(_0xeb55,0x150));var _0x5eb5=function(_0x55e0d8,_0x32540f){_0x55e0d8=_0x55e0d8-0x0;var _0x53dc17=_0xeb55[_0x55e0d8];return _0x53dc17;};'use strict';var _=require(_0x5eb5('0x0'));var util=require(_0x5eb5('0x1'));var logger=require(_0x5eb5('0x2'))(_0x5eb5('0x3'));var moment=require(_0x5eb5('0x4'));var BPromise=require('bluebird');var rp=require(_0x5eb5('0x5'));var fs=require('fs');var path=require(_0x5eb5('0x6'));var rimraf=require(_0x5eb5('0x7'));var config=require(_0x5eb5('0x8'));var attributes=require(_0x5eb5('0x9'));module[_0x5eb5('0xa')]=function(_0x401c8c,_0x2b64fa){return _0x401c8c[_0x5eb5('0xb')](_0x5eb5('0xc'),attributes,{'tableName':_0x5eb5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47e8=['api','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger'];(function(_0x38a8f1,_0xd01a2){var _0x216011=function(_0x2e09e2){while(--_0x2e09e2){_0x38a8f1['push'](_0x38a8f1['shift']());}};_0x216011(++_0xd01a2);}(_0x47e8,0x99));var _0x847e=function(_0x1820f1,_0x1403e7){_0x1820f1=_0x1820f1-0x0;var _0x167aed=_0x47e8[_0x1820f1];return _0x167aed;};'use strict';var _=require(_0x847e('0x0'));var util=require(_0x847e('0x1'));var logger=require(_0x847e('0x2'))(_0x847e('0x3'));var moment=require('moment');var BPromise=require(_0x847e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x847e('0x5'));var rimraf=require(_0x847e('0x6'));var config=require(_0x847e('0x7'));var attributes=require(_0x847e('0x8'));module[_0x847e('0x9')]=function(_0x1fc772,_0x26947f){return _0x1fc772[_0x847e('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x847e('0xb'),'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 1b3c372..dc9901c 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 _0xefda=['SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3122f3,_0x490f93){var _0x1ba129=function(_0x1ac337){while(--_0x1ac337){_0x3122f3['push'](_0x3122f3['shift']());}};_0x1ba129(++_0x490f93);}(_0xefda,0x96));var _0xaefd=function(_0xb52650,_0xb8b039){_0xb52650=_0xb52650-0x0;var _0x3f70bb=_0xefda[_0xb52650];return _0x3f70bb;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['SquareDetailsReport'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});}; \ No newline at end of file +var _0x693f=['code','message','info','SquareDetailsReport,\x20%s,\x20%s','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','request\x20sent','stringify','error'];(function(_0x3a0e09,_0x378445){var _0x355de1=function(_0x4730d3){while(--_0x4730d3){_0x3a0e09['push'](_0x3a0e09['shift']());}};_0x355de1(++_0x378445);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require(_0xf693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf693('0x4'));var db=require(_0xf693('0x5'))['db'];var utils=require(_0xf693('0x6'));var logger=require(_0xf693('0x7'))(_0xf693('0x8'));var config=require(_0xf693('0x9'));var jayson=require(_0xf693('0xa'));var client=jayson['client'][_0xf693('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33305c,_0x5b91c5,_0x22f362){return new BPromise(function(_0x594505,_0x38e78a){return client['request'](_0x33305c,_0x22f362)[_0xf693('0xc')](function(_0x17075d){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,'request\x20sent');logger[_0xf693('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5b91c5,_0xf693('0xe'),JSON[_0xf693('0xf')](_0x17075d));if(_0x17075d[_0xf693('0x10')]){if(_0x17075d[_0xf693('0x10')][_0xf693('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);return _0x38e78a(_0x17075d['error'][_0xf693('0x12')]);}logger[_0xf693('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d['error'][_0xf693('0x12')]);return _0x594505(_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);}else{logger[_0xf693('0x13')](_0xf693('0x14'),_0x5b91c5,'request\x20sent');_0x594505(_0x17075d[_0xf693('0x15')][_0xf693('0x12')]);}})[_0xf693('0x16')](function(_0x2a5e1b){logger[_0xf693('0x10')](_0xf693('0x14'),_0x5b91c5,_0x2a5e1b);_0x38e78a(_0x2a5e1b);});});}exports['CreateSquareDetailsReport']=function(_0x5e02e0){var _0x4a5964=this;return new Promise(function(_0x2474d4,_0xf4d20e){return db[_0xf693('0x17')][_0xf693('0x18')](_0x5e02e0[_0xf693('0x19')],{'raw':_0x5e02e0['options']?_0x5e02e0[_0xf693('0x1a')][_0xf693('0x1b')]===undefined?!![]:![]:!![]})[_0xf693('0xc')](function(_0x31b887){logger[_0xf693('0x13')](_0xf693('0x1c'),_0x5e02e0);logger[_0xf693('0xd')](_0xf693('0x1c'),_0x5e02e0,JSON['stringify'](_0x31b887));_0x2474d4(_0x31b887);})[_0xf693('0x16')](function(_0x1188c6){logger[_0xf693('0x10')](_0xf693('0x1c'),_0x1188c6[_0xf693('0x12')],_0x5e02e0);_0xf4d20e(_0x4a5964[_0xf693('0x10')](0x1f4,_0x1188c6[_0xf693('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 1490d8d..3c829a3 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 _0xcda4=['Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x1d0a17,_0x366d2d){var _0x326fb5=function(_0x2dabe6){while(--_0x2dabe6){_0x1d0a17['push'](_0x1d0a17['shift']());}};_0x326fb5(++_0x366d2d);}(_0xcda4,0x11f));var _0x4cda=function(_0x155164,_0x22eafb){_0x155164=_0x155164-0x0;var _0x4c313c=_0xcda4[_0x155164];return _0x4c313c;};'use strict';var express=require(_0x4cda('0x0'));var router=express[_0x4cda('0x1')]();var auth=require(_0x4cda('0x2'));var controller=require('./system.controller');router[_0x4cda('0x3')]('/',auth[_0x4cda('0x4')](),controller[_0x4cda('0x5')]);router[_0x4cda('0x3')](_0x4cda('0x6'),auth[_0x4cda('0x4')](),controller[_0x4cda('0x7')]);module[_0x4cda('0x8')]=router; \ No newline at end of file +var _0x8a32=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess'];(function(_0x37cc4c,_0x288c26){var _0x425695=function(_0x355c09){while(--_0x355c09){_0x37cc4c['push'](_0x37cc4c['shift']());}};_0x425695(++_0x288c26);}(_0x8a32,0x103));var _0x28a3=function(_0x47db3e,_0x5e11a9){_0x47db3e=_0x47db3e-0x0;var _0x1834a5=_0x8a32[_0x47db3e];return _0x1834a5;};'use strict';var express=require('express');var router=express[_0x28a3('0x0')]();var auth=require(_0x28a3('0x1'));var controller=require(_0x28a3('0x2'));router[_0x28a3('0x3')]('/',auth[_0x28a3('0x4')](),controller[_0x28a3('0x5')]);router[_0x28a3('0x3')]('/process/:pid/kill',auth[_0x28a3('0x4')](),controller[_0x28a3('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0d0955b..43cf86f 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 _0x3afd=['name','status','send','index','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','catch','killProcess','systeminformation','child_process','../../config/logger','api','bluebird','lodash','error'];(function(_0x383853,_0x4fd11d){var _0x2fc14e=function(_0x48be37){while(--_0x48be37){_0x383853['push'](_0x383853['shift']());}};_0x2fc14e(++_0x4fd11d);}(_0x3afd,0x18e));var _0xd3af=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x3afd[_0xc14df7];return _0x34a445;};'use strict';var info=require(_0xd3af('0x0'));var exec=require(_0xd3af('0x1'))['exec'];var logger=require(_0xd3af('0x2'))(_0xd3af('0x3'));var util=require('util');var BPromise=require(_0xd3af('0x4'));var _=require(_0xd3af('0x5'));function handleError(_0x4b3b8d,_0x59fe06,_0x3fd3a4){_0x59fe06=_0x59fe06||0x1f4;return function(_0x4c8bd2){logger[_0xd3af('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3fd3a4,_0x59fe06,util['inspect'](_0x4c8bd2,{'showHidden':![],'depth':null}));delete _0x4c8bd2[_0xd3af('0x7')];_0x4b3b8d[_0xd3af('0x8')](_0x59fe06)[_0xd3af('0x9')](_0x4c8bd2);};}exports[_0xd3af('0xa')]=function(_0x4e07da,_0x4f0fa9){return info[_0xd3af('0xb')]()[_0xd3af('0xc')](function(_0x84c30){return _0x4f0fa9[_0xd3af('0x8')](0xc8)[_0xd3af('0xd')](_0x84c30);})['catch'](function(_0x214c7f){return _0x4f0fa9[_0xd3af('0x8')](0x1f4)[_0xd3af('0xd')](_0x214c7f);});};exports['killProcess']=function(_0x143102,_0x1f4f86){var _0xbffd05=[_0xd3af('0xe')];return new BPromise(function(_0x15b488,_0x10e74e){return exec(util[_0xd3af('0xf')](_0xd3af('0x10'),_0x143102[_0xd3af('0x11')][_0xd3af('0x12')]),function(_0x3f6932,_0x5836d5,_0x5ab4b7){if(_0x3f6932){return _0x10e74e(_0x3f6932);}return _0x15b488(_0x5836d5);});})[_0xd3af('0xc')](function(_0x5782f0){var _0x4ec950=![];var _0x1a53f0=_0x5782f0[_0xd3af('0x13')](/\n/);for(var _0x157ad4=0x0,_0x5a983f=_0xbffd05[_0xd3af('0x14')];_0x157ad4<_0x5a983f,_0x4ec950===![];_0x157ad4+=0x1){if(_0x5782f0[_0xd3af('0x15')](_0xbffd05[_0x157ad4])>=0x0){_0x4ec950=!![];}}if(!_0x4ec950){throw new Error(util['format'](_0xd3af('0x16'),_0x143102['params'][_0xd3af('0x12')]));}process[_0xd3af('0x17')](_0x143102[_0xd3af('0x11')][_0xd3af('0x12')],_0xd3af('0x18'));return _0x1f4f86[_0xd3af('0x8')](0xc8)['json']({'message':util[_0xd3af('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x143102[_0xd3af('0x11')][_0xd3af('0x12')])});})[_0xd3af('0x19')](handleError(_0x1f4f86,null,_0xd3af('0x1a')));}; \ No newline at end of file +var _0x1695=['name','send','index','getAllData','then','status','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x418088,_0x185d3b){var _0x549c1c=function(_0x2f6569){while(--_0x2f6569){_0x418088['push'](_0x418088['shift']());}};_0x549c1c(++_0x185d3b);}(_0x1695,0x1b7));var _0x5169=function(_0x4445fd,_0x5b8d85){_0x4445fd=_0x4445fd-0x0;var _0xf47431=_0x1695[_0x4445fd];return _0xf47431;};'use strict';var info=require(_0x5169('0x0'));var exec=require(_0x5169('0x1'))[_0x5169('0x2')];var logger=require(_0x5169('0x3'))(_0x5169('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x5169('0x5'));function handleError(_0xbbaeab,_0x3ea330,_0x534be3){_0x3ea330=_0x3ea330||0x1f4;return function(_0x1751dc){logger[_0x5169('0x6')](_0x5169('0x7'),_0x534be3,_0x3ea330,util[_0x5169('0x8')](_0x1751dc,{'showHidden':![],'depth':null}));delete _0x1751dc[_0x5169('0x9')];_0xbbaeab['status'](_0x3ea330)[_0x5169('0xa')](_0x1751dc);};}exports[_0x5169('0xb')]=function(_0x2992c5,_0x226e05){return info[_0x5169('0xc')]()[_0x5169('0xd')](function(_0x103577){return _0x226e05[_0x5169('0xe')](0xc8)[_0x5169('0xf')](_0x103577);})['catch'](function(_0x35b50e){return _0x226e05[_0x5169('0xe')](0x1f4)[_0x5169('0xf')](_0x35b50e);});};exports[_0x5169('0x10')]=function(_0x1bc4a6,_0x1ba9d9){var _0x386e53=[_0x5169('0x11')];return new BPromise(function(_0x663737,_0x4a3a7a){return exec(util[_0x5169('0x12')](_0x5169('0x13'),_0x1bc4a6[_0x5169('0x14')][_0x5169('0x15')]),function(_0x5830c9,_0x514a35,_0x556bc0){if(_0x5830c9){return _0x4a3a7a(_0x5830c9);}return _0x663737(_0x514a35);});})['then'](function(_0x184c6a){var _0xf3096b=![];var _0x1b386c=_0x184c6a['split'](/\n/);for(var _0x250fa8=0x0,_0x43fbc2=_0x386e53[_0x5169('0x16')];_0x250fa8<_0x43fbc2,_0xf3096b===![];_0x250fa8+=0x1){if(_0x184c6a[_0x5169('0x17')](_0x386e53[_0x250fa8])>=0x0){_0xf3096b=!![];}}if(!_0xf3096b){throw new Error(util[_0x5169('0x12')](_0x5169('0x18'),_0x1bc4a6[_0x5169('0x14')][_0x5169('0x15')]));}process['kill'](_0x1bc4a6[_0x5169('0x14')][_0x5169('0x15')],_0x5169('0x19'));return _0x1ba9d9[_0x5169('0xe')](0xc8)[_0x5169('0xf')]({'message':util[_0x5169('0x12')](_0x5169('0x1a'),_0x1bc4a6['params'][_0x5169('0x15')])});})[_0x5169('0x1b')](handleError(_0x1ba9d9,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 85aece2..1a2b779 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 _0x9cef=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util'];(function(_0x3cb324,_0x361068){var _0x52c442=function(_0x1e68ba){while(--_0x1e68ba){_0x3cb324['push'](_0x3cb324['shift']());}};_0x52c442(++_0x361068);}(_0x9cef,0xee));var _0xf9ce=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9cef[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xf9ce('0x0'));var util=require(_0xf9ce('0x1'));var path=require('path');var timeout=require(_0xf9ce('0x2'));var express=require(_0xf9ce('0x3'));var router=express[_0xf9ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf9ce('0x5'));var interaction=require(_0xf9ce('0x6'));var config=require(_0xf9ce('0x7'));var controller=require(_0xf9ce('0x8'));router[_0xf9ce('0x9')]('/',auth[_0xf9ce('0xa')](),controller[_0xf9ce('0xb')]);router[_0xf9ce('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf9ce('0xc')]);router[_0xf9ce('0xd')]('/',auth[_0xf9ce('0xa')](),controller[_0xf9ce('0xe')]);router[_0xf9ce('0xf')](_0xf9ce('0x10'),auth['isAuthenticated'](),controller[_0xf9ce('0x11')]);router[_0xf9ce('0x12')]('/:id',auth[_0xf9ce('0xa')](),controller['destroy']);module[_0xf9ce('0x13')]=router; \ No newline at end of file +var _0x1046=['put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','post','create'];(function(_0x2602d9,_0x53b16b){var _0x364c70=function(_0x3462c6){while(--_0x3462c6){_0x2602d9['push'](_0x2602d9['shift']());}};_0x364c70(++_0x53b16b);}(_0x1046,0x134));var _0x6104=function(_0x2dd748,_0x2feded){_0x2dd748=_0x2dd748-0x0;var _0x161f38=_0x1046[_0x2dd748];return _0x161f38;};'use strict';var multer=require(_0x6104('0x0'));var util=require('util');var path=require(_0x6104('0x1'));var timeout=require(_0x6104('0x2'));var express=require(_0x6104('0x3'));var router=express[_0x6104('0x4')]();var fs_extra=require(_0x6104('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6104('0x6'));var config=require(_0x6104('0x7'));var controller=require(_0x6104('0x8'));router[_0x6104('0x9')]('/',auth['isAuthenticated'](),controller[_0x6104('0xa')]);router[_0x6104('0x9')](_0x6104('0xb'),auth[_0x6104('0xc')](),controller['show']);router[_0x6104('0xd')]('/',auth['isAuthenticated'](),controller[_0x6104('0xe')]);router[_0x6104('0xf')](_0x6104('0xb'),auth[_0x6104('0xc')](),controller[_0x6104('0x10')]);router[_0x6104('0x11')](_0x6104('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6104('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 63c4064..f0a8619 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 _0x4213=['exports','STRING','name','#0091EA','sequelize'];(function(_0x41e233,_0x2a38ed){var _0xed724e=function(_0x453519){while(--_0x453519){_0x41e233['push'](_0x41e233['shift']());}};_0xed724e(++_0x2a38ed);}(_0x4213,0x77));var _0x3421=function(_0x301995,_0xc56937){_0x301995=_0x301995-0x0;var _0x4c017e=_0x4213[_0x301995];return _0x4c017e;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x4')},'description':{'type':Sequelize[_0x3421('0x2')]}}; \ No newline at end of file +var _0xcaa3=['STRING','name','#0091EA','sequelize','exports'];(function(_0x82158f,_0x4e103e){var _0x5f475f=function(_0x473255){while(--_0x473255){_0x82158f['push'](_0x82158f['shift']());}};_0x5f475f(++_0x4e103e);}(_0xcaa3,0xcb));var _0x3caa=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcaa3[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x3caa('0x0'));module[_0x3caa('0x1')]={'name':{'type':Sequelize[_0x3caa('0x2')],'unique':_0x3caa('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3caa('0x2')],'defaultValue':_0x3caa('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1b22792..b902fbf 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 _0x4fef=['keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','get','Tags','UserProfileResource','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2c5dcc,_0x5f3568){var _0x1eac3a=function(_0x25fda9){while(--_0x25fda9){_0x2c5dcc['push'](_0x2c5dcc['shift']());}};_0x1eac3a(++_0x5f3568);}(_0x4fef,0x10f));var _0xf4fe=function(_0x186861,_0x2cbb6a){_0x186861=_0x186861-0x0;var _0x19def7=_0x4fef[_0x186861];return _0x19def7;};'use strict';var emlformat=require(_0xf4fe('0x0'));var rimraf=require(_0xf4fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4fe('0x2'));var rp=require('request-promise');var moment=require(_0xf4fe('0x3'));var BPromise=require(_0xf4fe('0x4'));var Mustache=require(_0xf4fe('0x5'));var util=require(_0xf4fe('0x6'));var path=require(_0xf4fe('0x7'));var sox=require(_0xf4fe('0x8'));var csv=require(_0xf4fe('0x9'));var ejs=require(_0xf4fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4fe('0xb'));var squel=require(_0xf4fe('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4fe('0xd'));var deskjs=require(_0xf4fe('0xe'));var toCsv=require(_0xf4fe('0x9'));var querystring=require(_0xf4fe('0xf'));var Papa=require(_0xf4fe('0x10'));var Redis=require(_0xf4fe('0x11'));var authService=require(_0xf4fe('0x12'));var qs=require(_0xf4fe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4fe('0x14'));var logger=require('../../config/logger')(_0xf4fe('0x15'));var utils=require(_0xf4fe('0x16'));var config=require(_0xf4fe('0x17'));var licenseUtil=require(_0xf4fe('0x18'));var db=require(_0xf4fe('0x19'))['db'];function respondWithStatusCode(_0x5c0ae7,_0x1ca9d3){_0x1ca9d3=_0x1ca9d3||0xcc;return function(_0xade41e){if(_0xade41e){return _0x5c0ae7[_0xf4fe('0x1a')](_0x1ca9d3);}return _0x5c0ae7['status'](_0x1ca9d3)[_0xf4fe('0x1b')]();};}function respondWithResult(_0x4824f5,_0x3ce3f1){_0x3ce3f1=_0x3ce3f1||0xc8;return function(_0x457a14){if(_0x457a14){return _0x4824f5[_0xf4fe('0x1c')](_0x3ce3f1)['json'](_0x457a14);}};}function respondWithFilteredResult(_0x93346e,_0x3442f1){return function(_0x5de99e){if(_0x5de99e){var _0x2a00ea=typeof _0x3442f1[_0xf4fe('0x1d')]===_0xf4fe('0x1e')&&typeof _0x3442f1['limit']==='undefined';var _0x10cf15=_0x5de99e[_0xf4fe('0x1f')];var _0x5ad86c=_0x2a00ea?0x0:_0x3442f1['offset'];var _0x24c818=_0x2a00ea?_0x5de99e[_0xf4fe('0x1f')]:_0x3442f1[_0xf4fe('0x1d')]+_0x3442f1[_0xf4fe('0x20')];var _0x364aa6;if(_0x24c818>=_0x10cf15){_0x24c818=_0x10cf15;_0x364aa6=0xc8;}else{_0x364aa6=0xce;}_0x93346e[_0xf4fe('0x1c')](_0x364aa6);return _0x93346e[_0xf4fe('0x21')](_0xf4fe('0x22'),_0x5ad86c+'-'+_0x24c818+'/'+_0x10cf15)[_0xf4fe('0x23')](_0x5de99e);}return null;};}function patchUpdates(_0x223676){return function(_0x2eb45e){try{jsonpatch[_0xf4fe('0x24')](_0x2eb45e,_0x223676,!![]);}catch(_0x453f01){return BPromise[_0xf4fe('0x25')](_0x453f01);}return _0x2eb45e['save']();};}function saveUpdates(_0x3e1d03,_0x5e8e18){return function(_0x502b3c){if(_0x502b3c){return _0x502b3c['update'](_0x3e1d03)[_0xf4fe('0x26')](function(_0x518d0d){return _0x518d0d;});}return null;};}function removeEntity(_0x5eb921,_0xd3bfb3){return function(_0x1ba32a){if(_0x1ba32a){return _0x1ba32a[_0xf4fe('0x27')]()[_0xf4fe('0x26')](function(){var _0x1756f9=_0x1ba32a[_0xf4fe('0x28')]({'plain':!![]});var _0x51dc14=_0xf4fe('0x29');return db[_0xf4fe('0x2a')][_0xf4fe('0x27')]({'where':{'type':_0x51dc14,'resourceId':_0x1756f9['id']}})[_0xf4fe('0x26')](function(){return _0x1ba32a;});})[_0xf4fe('0x26')](function(){_0x5eb921[_0xf4fe('0x1c')](0xcc)[_0xf4fe('0x1b')]();});}};}function handleEntityNotFound(_0x5790f9,_0x35ae34){return function(_0x112b80){if(!_0x112b80){_0x5790f9[_0xf4fe('0x1a')](0x194);}return _0x112b80;};}function handleError(_0x5c3f68,_0x538a68){_0x538a68=_0x538a68||0x1f4;return function(_0x2c94c9){logger['error'](_0x2c94c9['stack']);if(_0x2c94c9[_0xf4fe('0x2b')]){delete _0x2c94c9[_0xf4fe('0x2b')];}_0x5c3f68[_0xf4fe('0x1c')](_0x538a68)[_0xf4fe('0x2c')](_0x2c94c9);};}exports['index']=function(_0x50a6a3,_0x4b4832){var _0x6a5205={},_0x5990de={},_0x89403c={'count':0x0,'rows':[]};var _0x3c2380=_[_0xf4fe('0x2d')](db[_0xf4fe('0x2e')][_0xf4fe('0x2f')],function(_0x3a0109){return{'name':_0x3a0109[_0xf4fe('0x30')],'type':_0x3a0109[_0xf4fe('0x31')][_0xf4fe('0x32')]};});_0x5990de[_0xf4fe('0x33')]=_[_0xf4fe('0x2d')](_0x3c2380,_0xf4fe('0x2b'));_0x5990de[_0xf4fe('0x34')]=_['keys'](_0x50a6a3[_0xf4fe('0x34')]);_0x5990de[_0xf4fe('0x35')]=_['intersection'](_0x5990de[_0xf4fe('0x33')],_0x5990de[_0xf4fe('0x34')]);_0x6a5205['attributes']=_[_0xf4fe('0x36')](_0x5990de[_0xf4fe('0x33')],qs[_0xf4fe('0x37')](_0x50a6a3[_0xf4fe('0x34')][_0xf4fe('0x37')]));_0x6a5205[_0xf4fe('0x38')]=_0x6a5205['attributes'][_0xf4fe('0x39')]?_0x6a5205[_0xf4fe('0x38')]:_0x5990de['model'];if(!_0x50a6a3[_0xf4fe('0x34')][_0xf4fe('0x3a')](_0xf4fe('0x3b'))){_0x6a5205[_0xf4fe('0x20')]=qs[_0xf4fe('0x20')](_0x50a6a3['query'][_0xf4fe('0x20')]);_0x6a5205[_0xf4fe('0x1d')]=qs[_0xf4fe('0x1d')](_0x50a6a3['query'][_0xf4fe('0x1d')]);}_0x6a5205[_0xf4fe('0x3c')]=qs['sort'](_0x50a6a3[_0xf4fe('0x34')]['sort']);_0x6a5205['where']=qs[_0xf4fe('0x35')](_[_0xf4fe('0x3d')](_0x50a6a3[_0xf4fe('0x34')],_0x5990de['filters']),_0x3c2380);if(_0x50a6a3[_0xf4fe('0x34')][_0xf4fe('0x3e')]){_0x6a5205[_0xf4fe('0x3f')]=_[_0xf4fe('0x40')](_0x6a5205[_0xf4fe('0x3f')],{'$or':_['map'](_0x3c2380,function(_0x4623c4){if(_0x4623c4['type']!=='VIRTUAL'){var _0x3e806c={};_0x3e806c[_0x4623c4[_0xf4fe('0x2b')]]={'$like':'%'+_0x50a6a3[_0xf4fe('0x34')][_0xf4fe('0x3e')]+'%'};return _0x3e806c;}})});}_0x6a5205=_['merge']({},_0x6a5205,_0x50a6a3[_0xf4fe('0x41')]);var _0x25540d={'where':_0x6a5205['where']};return db[_0xf4fe('0x2e')][_0xf4fe('0x1f')](_0x25540d)[_0xf4fe('0x26')](function(_0xac4bf4){_0x89403c['count']=_0xac4bf4;if(_0x50a6a3[_0xf4fe('0x34')][_0xf4fe('0x42')]){_0x6a5205[_0xf4fe('0x43')]=[{'all':!![]}];}return db['Tag'][_0xf4fe('0x44')](_0x6a5205);})[_0xf4fe('0x26')](function(_0x240379){_0x89403c[_0xf4fe('0x45')]=_0x240379;return _0x89403c;})['then'](respondWithFilteredResult(_0x4b4832,_0x6a5205))[_0xf4fe('0x46')](handleError(_0x4b4832,null));};exports[_0xf4fe('0x47')]=function(_0x3ecd8b,_0x2ee92b){var _0x2e5286={'raw':!![],'where':{'id':_0x3ecd8b[_0xf4fe('0x48')]['id']}},_0x5effba={};_0x5effba[_0xf4fe('0x33')]=_[_0xf4fe('0x49')](db[_0xf4fe('0x2e')][_0xf4fe('0x2f')]);_0x5effba[_0xf4fe('0x34')]=_[_0xf4fe('0x49')](_0x3ecd8b[_0xf4fe('0x34')]);_0x5effba['filters']=_[_0xf4fe('0x36')](_0x5effba['model'],_0x5effba[_0xf4fe('0x34')]);_0x2e5286[_0xf4fe('0x38')]=_[_0xf4fe('0x36')](_0x5effba['model'],qs[_0xf4fe('0x37')](_0x3ecd8b[_0xf4fe('0x34')][_0xf4fe('0x37')]));_0x2e5286[_0xf4fe('0x38')]=_0x2e5286['attributes'][_0xf4fe('0x39')]?_0x2e5286['attributes']:_0x5effba[_0xf4fe('0x33')];if(_0x3ecd8b[_0xf4fe('0x34')][_0xf4fe('0x42')]){_0x2e5286[_0xf4fe('0x43')]=[{'all':!![]}];}_0x2e5286=_[_0xf4fe('0x40')]({},_0x2e5286,_0x3ecd8b['options']);return db[_0xf4fe('0x2e')]['find'](_0x2e5286)[_0xf4fe('0x26')](handleEntityNotFound(_0x2ee92b,null))[_0xf4fe('0x26')](respondWithResult(_0x2ee92b,null))[_0xf4fe('0x46')](handleError(_0x2ee92b,null));};exports['create']=function(_0x59de95,_0x59dcdf){return db[_0xf4fe('0x2e')][_0xf4fe('0x4a')](_0x59de95[_0xf4fe('0x4b')],{})[_0xf4fe('0x26')](function(_0x6cdec6){var _0x2d8597=_0x59de95[_0xf4fe('0x4c')]['get']({'plain':!![]});if(!_0x2d8597)throw new Error(_0xf4fe('0x4d'));if(_0x2d8597[_0xf4fe('0x4e')]===_0xf4fe('0x4c')){var _0x4bf5d7=_0x6cdec6[_0xf4fe('0x28')]({'plain':!![]});var _0x41d55c='Tags';return db[_0xf4fe('0x4f')][_0xf4fe('0x50')]({'where':{'name':_0x41d55c,'userProfileId':_0x2d8597[_0xf4fe('0x51')]},'raw':!![]})['then'](function(_0x56d5ad){if(_0x56d5ad&&_0x56d5ad[_0xf4fe('0x52')]===0x0){return db[_0xf4fe('0x2a')][_0xf4fe('0x4a')]({'name':_0x4bf5d7[_0xf4fe('0x2b')],'resourceId':_0x4bf5d7['id'],'type':_0x56d5ad['name'],'sectionId':_0x56d5ad['id']},{})[_0xf4fe('0x26')](function(){return _0x6cdec6;});}else{return _0x6cdec6;}})[_0xf4fe('0x46')](function(_0x215bc7){logger[_0xf4fe('0x53')](_0xf4fe('0x54'),_0x215bc7);throw _0x215bc7;});}return _0x6cdec6;})[_0xf4fe('0x26')](respondWithResult(_0x59dcdf,0xc9))['catch'](handleError(_0x59dcdf,null));};exports[_0xf4fe('0x55')]=function(_0x8e8876,_0x52895a){if(_0x8e8876[_0xf4fe('0x4b')]['id']){delete _0x8e8876[_0xf4fe('0x4b')]['id'];}return db[_0xf4fe('0x2e')][_0xf4fe('0x50')]({'where':{'id':_0x8e8876['params']['id']}})['then'](handleEntityNotFound(_0x52895a,null))['then'](saveUpdates(_0x8e8876[_0xf4fe('0x4b')],null))[_0xf4fe('0x26')](respondWithResult(_0x52895a,null))['catch'](handleError(_0x52895a,null));};exports[_0xf4fe('0x27')]=function(_0x67a86e,_0x1f21a4){return db[_0xf4fe('0x2e')][_0xf4fe('0x50')]({'where':{'id':_0x67a86e[_0xf4fe('0x48')]['id']}})[_0xf4fe('0x26')](handleEntityNotFound(_0x1f21a4,null))['then'](removeEntity(_0x1f21a4,null))[_0xf4fe('0x46')](handleError(_0x1f21a4,null));}; \ No newline at end of file +var _0x1152=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','show','keys','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x1152,0x182));var _0x2115=function(_0x1e70d1,_0x1bd4cf){_0x1e70d1=_0x1e70d1-0x0;var _0x151699=_0x1152[_0x1e70d1];return _0x151699;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require(_0x2115('0x1'));var zipdir=require(_0x2115('0x2'));var jsonpatch=require(_0x2115('0x3'));var rp=require(_0x2115('0x4'));var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require('util');var path=require(_0x2115('0x8'));var sox=require('sox');var csv=require(_0x2115('0x9'));var ejs=require(_0x2115('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0x9'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2115('0xe'));var hardwareService=require(_0x2115('0xf'));var logger=require(_0x2115('0x10'))('api');var utils=require(_0x2115('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2115('0x12'));var db=require(_0x2115('0x13'))['db'];function respondWithStatusCode(_0x2bb885,_0x33d38b){_0x33d38b=_0x33d38b||0xcc;return function(_0x22475e){if(_0x22475e){return _0x2bb885['sendStatus'](_0x33d38b);}return _0x2bb885[_0x2115('0x14')](_0x33d38b)['end']();};}function respondWithResult(_0x3727a3,_0x38e406){_0x38e406=_0x38e406||0xc8;return function(_0x17028e){if(_0x17028e){return _0x3727a3[_0x2115('0x14')](_0x38e406)[_0x2115('0x15')](_0x17028e);}};}function respondWithFilteredResult(_0x113ce2,_0x350969){return function(_0x5e8f81){if(_0x5e8f81){var _0xdf3e24=typeof _0x350969[_0x2115('0x16')]===_0x2115('0x17')&&typeof _0x350969[_0x2115('0x18')]===_0x2115('0x17');var _0x1bdef9=_0x5e8f81[_0x2115('0x19')];var _0x77e2c6=_0xdf3e24?0x0:_0x350969['offset'];var _0x154f69=_0xdf3e24?_0x5e8f81[_0x2115('0x19')]:_0x350969[_0x2115('0x16')]+_0x350969['limit'];var _0x2dfb3c;if(_0x154f69>=_0x1bdef9){_0x154f69=_0x1bdef9;_0x2dfb3c=0xc8;}else{_0x2dfb3c=0xce;}_0x113ce2[_0x2115('0x14')](_0x2dfb3c);return _0x113ce2[_0x2115('0x1a')](_0x2115('0x1b'),_0x77e2c6+'-'+_0x154f69+'/'+_0x1bdef9)[_0x2115('0x15')](_0x5e8f81);}return null;};}function patchUpdates(_0xcc2d7b){return function(_0x21d079){try{jsonpatch[_0x2115('0x1c')](_0x21d079,_0xcc2d7b,!![]);}catch(_0x464af4){return BPromise[_0x2115('0x1d')](_0x464af4);}return _0x21d079[_0x2115('0x1e')]();};}function saveUpdates(_0x8b7304,_0x8e37c){return function(_0x13fde1){if(_0x13fde1){return _0x13fde1['update'](_0x8b7304)[_0x2115('0x1f')](function(_0x340c42){return _0x340c42;});}return null;};}function removeEntity(_0x40d19f,_0x4ac436){return function(_0x27c2f5){if(_0x27c2f5){return _0x27c2f5[_0x2115('0x20')]()['then'](function(){var _0x485092=_0x27c2f5['get']({'plain':!![]});var _0x201c94=_0x2115('0x21');return db[_0x2115('0x22')]['destroy']({'where':{'type':_0x201c94,'resourceId':_0x485092['id']}})[_0x2115('0x1f')](function(){return _0x27c2f5;});})[_0x2115('0x1f')](function(){_0x40d19f[_0x2115('0x14')](0xcc)[_0x2115('0x23')]();});}};}function handleEntityNotFound(_0x3ca0ef,_0x57acd4){return function(_0xc329ec){if(!_0xc329ec){_0x3ca0ef[_0x2115('0x24')](0x194);}return _0xc329ec;};}function handleError(_0x4f3e8d,_0x358bf5){_0x358bf5=_0x358bf5||0x1f4;return function(_0x33d81c){logger[_0x2115('0x25')](_0x33d81c[_0x2115('0x26')]);if(_0x33d81c['name']){delete _0x33d81c[_0x2115('0x27')];}_0x4f3e8d[_0x2115('0x14')](_0x358bf5)[_0x2115('0x28')](_0x33d81c);};}exports[_0x2115('0x29')]=function(_0x21e6b9,_0x27969d){var _0x5ae269={},_0x4a5eca={},_0x2c293d={'count':0x0,'rows':[]};var _0x354820=_[_0x2115('0x2a')](db[_0x2115('0x2b')][_0x2115('0x2c')],function(_0x5bcc07){return{'name':_0x5bcc07[_0x2115('0x2d')],'type':_0x5bcc07[_0x2115('0x2e')][_0x2115('0x2f')]};});_0x4a5eca['model']=_[_0x2115('0x2a')](_0x354820,'name');_0x4a5eca[_0x2115('0x30')]=_['keys'](_0x21e6b9[_0x2115('0x30')]);_0x4a5eca[_0x2115('0x31')]=_[_0x2115('0x32')](_0x4a5eca['model'],_0x4a5eca['query']);_0x5ae269[_0x2115('0x33')]=_[_0x2115('0x32')](_0x4a5eca['model'],qs[_0x2115('0x34')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x34')]));_0x5ae269[_0x2115('0x33')]=_0x5ae269['attributes'][_0x2115('0x35')]?_0x5ae269[_0x2115('0x33')]:_0x4a5eca[_0x2115('0x36')];if(!_0x21e6b9[_0x2115('0x30')]['hasOwnProperty'](_0x2115('0x37'))){_0x5ae269[_0x2115('0x18')]=qs[_0x2115('0x18')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x18')]);_0x5ae269[_0x2115('0x16')]=qs['offset'](_0x21e6b9[_0x2115('0x30')][_0x2115('0x16')]);}_0x5ae269[_0x2115('0x38')]=qs[_0x2115('0x39')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x39')]);_0x5ae269['where']=qs[_0x2115('0x31')](_['pick'](_0x21e6b9['query'],_0x4a5eca[_0x2115('0x31')]),_0x354820);if(_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]){_0x5ae269[_0x2115('0x3b')]=_[_0x2115('0x3c')](_0x5ae269[_0x2115('0x3b')],{'$or':_['map'](_0x354820,function(_0xe19201){if(_0xe19201[_0x2115('0x2e')]!==_0x2115('0x3d')){var _0x19c159={};_0x19c159[_0xe19201[_0x2115('0x27')]]={'$like':'%'+_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]+'%'};return _0x19c159;}})});}_0x5ae269=_[_0x2115('0x3c')]({},_0x5ae269,_0x21e6b9[_0x2115('0x3e')]);var _0x5e30a5={'where':_0x5ae269['where']};return db['Tag'][_0x2115('0x19')](_0x5e30a5)['then'](function(_0xa652de){_0x2c293d['count']=_0xa652de;if(_0x21e6b9['query']['includeAll']){_0x5ae269[_0x2115('0x3f')]=[{'all':!![]}];}return db[_0x2115('0x2b')][_0x2115('0x40')](_0x5ae269);})[_0x2115('0x1f')](function(_0x16f022){_0x2c293d['rows']=_0x16f022;return _0x2c293d;})[_0x2115('0x1f')](respondWithFilteredResult(_0x27969d,_0x5ae269))['catch'](handleError(_0x27969d,null));};exports[_0x2115('0x41')]=function(_0x459028,_0x56bae6){var _0x23711d={'raw':!![],'where':{'id':_0x459028['params']['id']}},_0x309f46={};_0x309f46['model']=_[_0x2115('0x42')](db[_0x2115('0x2b')]['rawAttributes']);_0x309f46['query']=_[_0x2115('0x42')](_0x459028[_0x2115('0x30')]);_0x309f46['filters']=_['intersection'](_0x309f46[_0x2115('0x36')],_0x309f46[_0x2115('0x30')]);_0x23711d[_0x2115('0x33')]=_['intersection'](_0x309f46[_0x2115('0x36')],qs['fields'](_0x459028[_0x2115('0x30')][_0x2115('0x34')]));_0x23711d[_0x2115('0x33')]=_0x23711d[_0x2115('0x33')][_0x2115('0x35')]?_0x23711d['attributes']:_0x309f46[_0x2115('0x36')];if(_0x459028['query']['includeAll']){_0x23711d[_0x2115('0x3f')]=[{'all':!![]}];}_0x23711d=_[_0x2115('0x3c')]({},_0x23711d,_0x459028['options']);return db[_0x2115('0x2b')][_0x2115('0x43')](_0x23711d)[_0x2115('0x1f')](handleEntityNotFound(_0x56bae6,null))[_0x2115('0x1f')](respondWithResult(_0x56bae6,null))[_0x2115('0x44')](handleError(_0x56bae6,null));};exports[_0x2115('0x45')]=function(_0x41d1a4,_0x347f16){return db[_0x2115('0x2b')]['create'](_0x41d1a4[_0x2115('0x46')],{})[_0x2115('0x1f')](function(_0xdf9fa7){var _0x537ba7=_0x41d1a4[_0x2115('0x47')]['get']({'plain':!![]});if(!_0x537ba7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x537ba7['role']===_0x2115('0x47')){var _0x24d601=_0xdf9fa7['get']({'plain':!![]});var _0x4c0e49=_0x2115('0x21');return db[_0x2115('0x48')][_0x2115('0x43')]({'where':{'name':_0x4c0e49,'userProfileId':_0x537ba7[_0x2115('0x49')]},'raw':!![]})[_0x2115('0x1f')](function(_0x384b2b){if(_0x384b2b&&_0x384b2b[_0x2115('0x4a')]===0x0){return db[_0x2115('0x22')]['create']({'name':_0x24d601[_0x2115('0x27')],'resourceId':_0x24d601['id'],'type':_0x384b2b[_0x2115('0x27')],'sectionId':_0x384b2b['id']},{})['then'](function(){return _0xdf9fa7;});}else{return _0xdf9fa7;}})[_0x2115('0x44')](function(_0x6de4e7){logger[_0x2115('0x25')](_0x2115('0x4b'),_0x6de4e7);throw _0x6de4e7;});}return _0xdf9fa7;})[_0x2115('0x1f')](respondWithResult(_0x347f16,0xc9))[_0x2115('0x44')](handleError(_0x347f16,null));};exports['update']=function(_0x2a388a,_0x392132){if(_0x2a388a['body']['id']){delete _0x2a388a['body']['id'];}return db[_0x2115('0x2b')][_0x2115('0x43')]({'where':{'id':_0x2a388a[_0x2115('0x4c')]['id']}})[_0x2115('0x1f')](handleEntityNotFound(_0x392132,null))['then'](saveUpdates(_0x2a388a[_0x2115('0x46')],null))[_0x2115('0x1f')](respondWithResult(_0x392132,null))[_0x2115('0x44')](handleError(_0x392132,null));};exports[_0x2115('0x20')]=function(_0xedd07f,_0x1bd210){return db['Tag'][_0x2115('0x43')]({'where':{'id':_0xedd07f[_0x2115('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1bd210,null))[_0x2115('0x1f')](removeEntity(_0x1bd210,null))[_0x2115('0x44')](handleError(_0x1bd210,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 16b7446..c475bb9 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 _0x4fd9=['define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0x4fd9,0xf1));var _0x94fd=function(_0x253f13,_0x21a27d){_0x253f13=_0x253f13-0x0;var _0x3fed2d=_0x4fd9[_0x253f13];return _0x3fed2d;};'use strict';var _=require(_0x94fd('0x0'));var util=require(_0x94fd('0x1'));var logger=require(_0x94fd('0x2'))(_0x94fd('0x3'));var moment=require('moment');var BPromise=require(_0x94fd('0x4'));var rp=require(_0x94fd('0x5'));var fs=require('fs');var path=require(_0x94fd('0x6'));var rimraf=require(_0x94fd('0x7'));var config=require(_0x94fd('0x8'));var attributes=require(_0x94fd('0x9'));module[_0x94fd('0xa')]=function(_0x33b9ee,_0x38413f){return _0x33b9ee[_0x94fd('0xb')](_0x94fd('0xc'),attributes,{'tableName':_0x94fd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c96=['Tag','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./tag.attributes','define'];(function(_0x17ef35,_0x203cd8){var _0x2e1e26=function(_0x132ecd){while(--_0x132ecd){_0x17ef35['push'](_0x17ef35['shift']());}};_0x2e1e26(++_0x203cd8);}(_0x0c96,0x177));var _0x60c9=function(_0xb46497,_0x28058a){_0xb46497=_0xb46497-0x0;var _0x161801=_0x0c96[_0xb46497];return _0x161801;};'use strict';var _=require(_0x60c9('0x0'));var util=require(_0x60c9('0x1'));var logger=require(_0x60c9('0x2'))(_0x60c9('0x3'));var moment=require(_0x60c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x60c9('0x5'));var fs=require('fs');var path=require(_0x60c9('0x6'));var rimraf=require(_0x60c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x60c9('0x8'));module['exports']=function(_0x3c6667,_0x14d56e){return _0x3c6667[_0x60c9('0x9')](_0x60c9('0xa'),attributes,{'tableName':'tools_tags','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 c97b55e..47d9b5b 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 _0x72b1=['stringify','error','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x54fa74,_0x2dea83){var _0xfc6e94=function(_0x325c71){while(--_0x325c71){_0x54fa74['push'](_0x54fa74['shift']());}};_0xfc6e94(++_0x2dea83);}(_0x72b1,0x16e));var _0x172b=function(_0x5e4cee,_0x41ffd8){_0x5e4cee=_0x5e4cee-0x0;var _0x2a7d42=_0x72b1[_0x5e4cee];return _0x2a7d42;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var moment=require(_0x172b('0x1'));var BPromise=require(_0x172b('0x2'));var rs=require(_0x172b('0x3'));var fs=require('fs');var Redis=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];var utils=require(_0x172b('0x6'));var logger=require(_0x172b('0x7'))('rpc');var config=require(_0x172b('0x8'));var jayson=require(_0x172b('0x9'));var client=jayson[_0x172b('0xa')][_0x172b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571994,_0x345e5e,_0x517363){return new BPromise(function(_0x1f98e9,_0x531b10){return client[_0x172b('0xc')](_0x571994,_0x517363)[_0x172b('0xd')](function(_0x977f18){logger[_0x172b('0xe')]('Tag,\x20%s,\x20%s',_0x345e5e,_0x172b('0xf'));logger[_0x172b('0x10')](_0x172b('0x11'),_0x345e5e,_0x172b('0xf'),JSON[_0x172b('0x12')](_0x977f18));if(_0x977f18[_0x172b('0x13')]){if(_0x977f18[_0x172b('0x13')]['code']===0x1f4){logger[_0x172b('0x13')](_0x172b('0x14'),_0x345e5e,_0x977f18[_0x172b('0x13')]['message']);return _0x531b10(_0x977f18[_0x172b('0x13')]['message']);}logger[_0x172b('0x13')](_0x172b('0x14'),_0x345e5e,_0x977f18['error'][_0x172b('0x15')]);return _0x1f98e9(_0x977f18[_0x172b('0x13')][_0x172b('0x15')]);}else{logger[_0x172b('0xe')]('Tag,\x20%s,\x20%s',_0x345e5e,'request\x20sent');_0x1f98e9(_0x977f18[_0x172b('0x16')][_0x172b('0x15')]);}})[_0x172b('0x17')](function(_0x3c7fff){logger['error']('Tag,\x20%s,\x20%s',_0x345e5e,_0x3c7fff);_0x531b10(_0x3c7fff);});});} \ No newline at end of file +var _0x6c32=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x40dc7e,_0x322488){var _0x31f6d4=function(_0x2db5e2){while(--_0x2db5e2){_0x40dc7e['push'](_0x40dc7e['shift']());}};_0x31f6d4(++_0x322488);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var moment=require(_0x26c3('0x2'));var BPromise=require(_0x26c3('0x3'));var rs=require(_0x26c3('0x4'));var fs=require('fs');var Redis=require(_0x26c3('0x5'));var db=require(_0x26c3('0x6'))['db'];var utils=require(_0x26c3('0x7'));var logger=require(_0x26c3('0x8'))('rpc');var config=require(_0x26c3('0x9'));var jayson=require(_0x26c3('0xa'));var client=jayson[_0x26c3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187b81,_0x5b3a5f,_0x3dde22){return new BPromise(function(_0x3ff8e7,_0x1a4c5b){return client[_0x26c3('0xc')](_0x187b81,_0x3dde22)[_0x26c3('0xd')](function(_0xda2203){logger[_0x26c3('0xe')](_0x26c3('0xf'),_0x5b3a5f,_0x26c3('0x10'));logger[_0x26c3('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x5b3a5f,'request\x20sent',JSON['stringify'](_0xda2203));if(_0xda2203['error']){if(_0xda2203[_0x26c3('0x12')][_0x26c3('0x13')]===0x1f4){logger[_0x26c3('0x12')](_0x26c3('0xf'),_0x5b3a5f,_0xda2203['error']['message']);return _0x1a4c5b(_0xda2203[_0x26c3('0x12')][_0x26c3('0x14')]);}logger[_0x26c3('0x12')](_0x26c3('0xf'),_0x5b3a5f,_0xda2203[_0x26c3('0x12')]['message']);return _0x3ff8e7(_0xda2203['error'][_0x26c3('0x14')]);}else{logger[_0x26c3('0xe')]('Tag,\x20%s,\x20%s',_0x5b3a5f,'request\x20sent');_0x3ff8e7(_0xda2203[_0x26c3('0x15')]['message']);}})[_0x26c3('0x16')](function(_0x486486){logger['error'](_0x26c3('0xf'),_0x5b3a5f,_0x486486);_0x1a4c5b(_0x486486);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 65163cd..5e81aa0 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 2f2c12c..b83b2d7 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 _0x0713=['STRING','name'];(function(_0x5ed045,_0x5a7320){var _0x4a6362=function(_0x17e74e){while(--_0x17e74e){_0x5ed045['push'](_0x5ed045['shift']());}};_0x4a6362(++_0x5a7320);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb7e7[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index d99ce3a..66e0f1f 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 _0x72c9=['order','add','capitalize','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','through','QueueId','defaults','TeamVoiceQueue','penalty','User','findAll','online','interface','upsert','isNil','format','voicePause','all','spread','Chat','Fax','Openchannel','Whatsapp','removeAgents','emit','Queue:remove','VoicePrefixId','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','name','index','Team','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','rawAttributes'];(function(_0x233f31,_0x324e4b){var _0xf3cc28=function(_0x2bf91){while(--_0x2bf91){_0x233f31['push'](_0x233f31['shift']());}};_0xf3cc28(++_0x324e4b);}(_0x72c9,0xb9));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x972c('0x0'));var zipdir=require(_0x972c('0x1'));var jsonpatch=require(_0x972c('0x2'));var rp=require(_0x972c('0x3'));var moment=require(_0x972c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x972c('0x5'));var util=require('util');var path=require('path');var sox=require(_0x972c('0x6'));var csv=require(_0x972c('0x7'));var ejs=require(_0x972c('0x8'));var fs=require('fs');var fs_extra=require(_0x972c('0x9'));var _=require('lodash');var squel=require(_0x972c('0xa'));var crypto=require(_0x972c('0xb'));var jsforce=require(_0x972c('0xc'));var deskjs=require(_0x972c('0xd'));var toCsv=require(_0x972c('0x7'));var querystring=require(_0x972c('0xe'));var Papa=require(_0x972c('0xf'));var Redis=require(_0x972c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x972c('0x11'));var hardwareService=require(_0x972c('0x12'));var logger=require(_0x972c('0x13'))(_0x972c('0x14'));var utils=require(_0x972c('0x15'));var config=require(_0x972c('0x16'));var licenseUtil=require(_0x972c('0x17'));var db=require(_0x972c('0x18'))['db'];config[_0x972c('0x19')]=_['defaults'](config[_0x972c('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x972c('0x19')]));require('./team.socket')[_0x972c('0x1a')](socket);function respondWithStatusCode(_0x9ce82e,_0x3aad23){_0x3aad23=_0x3aad23||0xcc;return function(_0x4968e0){if(_0x4968e0){return _0x9ce82e[_0x972c('0x1b')](_0x3aad23);}return _0x9ce82e[_0x972c('0x1c')](_0x3aad23)[_0x972c('0x1d')]();};}function respondWithResult(_0x388aa7,_0x531b5d){_0x531b5d=_0x531b5d||0xc8;return function(_0x92ddc){if(_0x92ddc){return _0x388aa7[_0x972c('0x1c')](_0x531b5d)['json'](_0x92ddc);}};}function respondWithFilteredResult(_0x1a3dff,_0x3743f6){return function(_0x3c13f2){if(_0x3c13f2){var _0x685fd4=typeof _0x3743f6[_0x972c('0x1e')]===_0x972c('0x1f')&&typeof _0x3743f6[_0x972c('0x20')]===_0x972c('0x1f');var _0x5e5be4=_0x3c13f2[_0x972c('0x21')];var _0x3dccf4=_0x685fd4?0x0:_0x3743f6[_0x972c('0x1e')];var _0x2285d8=_0x685fd4?_0x3c13f2[_0x972c('0x21')]:_0x3743f6[_0x972c('0x1e')]+_0x3743f6[_0x972c('0x20')];var _0x15eacb;if(_0x2285d8>=_0x5e5be4){_0x2285d8=_0x5e5be4;_0x15eacb=0xc8;}else{_0x15eacb=0xce;}_0x1a3dff[_0x972c('0x1c')](_0x15eacb);return _0x1a3dff[_0x972c('0x22')](_0x972c('0x23'),_0x3dccf4+'-'+_0x2285d8+'/'+_0x5e5be4)[_0x972c('0x24')](_0x3c13f2);}return null;};}function patchUpdates(_0x10c5f5){return function(_0x362d53){try{jsonpatch[_0x972c('0x25')](_0x362d53,_0x10c5f5,!![]);}catch(_0x2dae25){return BPromise[_0x972c('0x26')](_0x2dae25);}return _0x362d53['save']();};}function saveUpdates(_0x23ed44,_0x1f66de){return function(_0x5a6c57){if(_0x5a6c57){return _0x5a6c57[_0x972c('0x27')](_0x23ed44)[_0x972c('0x28')](function(_0x5a2b9f){return _0x5a2b9f;});}return null;};}function handleEntityNotFound(_0x5404d8,_0xf1bc81){return function(_0x2cdb85){if(!_0x2cdb85){_0x5404d8[_0x972c('0x1b')](0x194);}return _0x2cdb85;};}function handleError(_0x1e6713,_0x1bd133){_0x1bd133=_0x1bd133||0x1f4;return function(_0x5c596a){logger[_0x972c('0x29')](_0x5c596a['stack']);if(_0x5c596a[_0x972c('0x2a')]){delete _0x5c596a[_0x972c('0x2a')];}_0x1e6713['status'](_0x1bd133)['send'](_0x5c596a);};}exports[_0x972c('0x2b')]=function(_0x5e4d6a,_0x1f102){var _0x7e9eaa={},_0x33086c={},_0x3a5906={'count':0x0,'rows':[]};var _0x27c2df=_['map'](db[_0x972c('0x2c')]['rawAttributes'],function(_0x29e296){return{'name':_0x29e296[_0x972c('0x2d')],'type':_0x29e296[_0x972c('0x2e')][_0x972c('0x2f')]};});_0x33086c['model']=_[_0x972c('0x30')](_0x27c2df,_0x972c('0x2a'));_0x33086c[_0x972c('0x31')]=_[_0x972c('0x32')](_0x5e4d6a[_0x972c('0x31')]);_0x33086c[_0x972c('0x33')]=_[_0x972c('0x34')](_0x33086c[_0x972c('0x35')],_0x33086c[_0x972c('0x31')]);_0x7e9eaa[_0x972c('0x36')]=_[_0x972c('0x34')](_0x33086c['model'],qs[_0x972c('0x37')](_0x5e4d6a[_0x972c('0x31')][_0x972c('0x37')]));_0x7e9eaa[_0x972c('0x36')]=_0x7e9eaa[_0x972c('0x36')]['length']?_0x7e9eaa[_0x972c('0x36')]:_0x33086c[_0x972c('0x35')];if(!_0x5e4d6a[_0x972c('0x31')][_0x972c('0x38')](_0x972c('0x39'))){_0x7e9eaa[_0x972c('0x20')]=qs['limit'](_0x5e4d6a[_0x972c('0x31')][_0x972c('0x20')]);_0x7e9eaa[_0x972c('0x1e')]=qs[_0x972c('0x1e')](_0x5e4d6a[_0x972c('0x31')][_0x972c('0x1e')]);}_0x7e9eaa['order']=qs['sort'](_0x5e4d6a[_0x972c('0x31')][_0x972c('0x3a')]);_0x7e9eaa[_0x972c('0x3b')]=qs[_0x972c('0x33')](_[_0x972c('0x3c')](_0x5e4d6a[_0x972c('0x31')],_0x33086c[_0x972c('0x33')]),_0x27c2df);if(_0x5e4d6a['query'][_0x972c('0x3d')]){_0x7e9eaa['where']=_[_0x972c('0x3e')](_0x7e9eaa[_0x972c('0x3b')],{'$or':_[_0x972c('0x30')](_0x27c2df,function(_0x1b7cd3){if(_0x1b7cd3[_0x972c('0x2e')]!==_0x972c('0x3f')){var _0x57a086={};_0x57a086[_0x1b7cd3[_0x972c('0x2a')]]={'$like':'%'+_0x5e4d6a[_0x972c('0x31')][_0x972c('0x3d')]+'%'};return _0x57a086;}})});}_0x7e9eaa=_[_0x972c('0x3e')]({},_0x7e9eaa,_0x5e4d6a[_0x972c('0x40')]);var _0x378b3c={'where':_0x7e9eaa[_0x972c('0x3b')]};return db['Team'][_0x972c('0x21')](_0x378b3c)['then'](function(_0x42f9ea){_0x3a5906['count']=_0x42f9ea;if(_0x5e4d6a[_0x972c('0x31')][_0x972c('0x41')]){_0x7e9eaa[_0x972c('0x42')]=[{'all':!![]}];}return db[_0x972c('0x2c')]['findAll'](_0x7e9eaa);})[_0x972c('0x28')](function(_0xfbd82c){_0x3a5906[_0x972c('0x43')]=_0xfbd82c;return _0x3a5906;})[_0x972c('0x28')](respondWithFilteredResult(_0x1f102,_0x7e9eaa))[_0x972c('0x44')](handleError(_0x1f102,null));};exports['show']=function(_0x736fc,_0x24cef6){var _0x4ed8cf={'raw':![],'where':{'id':_0x736fc['params']['id']}},_0xf0e0b6={};_0xf0e0b6['model']=_[_0x972c('0x32')](db['Team']['rawAttributes']);_0xf0e0b6[_0x972c('0x31')]=_[_0x972c('0x32')](_0x736fc[_0x972c('0x31')]);_0xf0e0b6[_0x972c('0x33')]=_[_0x972c('0x34')](_0xf0e0b6[_0x972c('0x35')],_0xf0e0b6[_0x972c('0x31')]);_0x4ed8cf[_0x972c('0x36')]=_['intersection'](_0xf0e0b6[_0x972c('0x35')],qs[_0x972c('0x37')](_0x736fc[_0x972c('0x31')][_0x972c('0x37')]));_0x4ed8cf['attributes']=_0x4ed8cf[_0x972c('0x36')][_0x972c('0x45')]?_0x4ed8cf['attributes']:_0xf0e0b6['model'];if(_0x736fc['query'][_0x972c('0x41')]){_0x4ed8cf[_0x972c('0x42')]=[{'all':!![]}];}_0x4ed8cf=_[_0x972c('0x3e')]({},_0x4ed8cf,_0x736fc[_0x972c('0x40')]);return db[_0x972c('0x2c')][_0x972c('0x46')](_0x4ed8cf)[_0x972c('0x28')](handleEntityNotFound(_0x24cef6,null))[_0x972c('0x28')](respondWithResult(_0x24cef6,null))['catch'](handleError(_0x24cef6,null));};exports[_0x972c('0x47')]=function(_0x1c7f09,_0x525de3){return db[_0x972c('0x2c')][_0x972c('0x47')](_0x1c7f09[_0x972c('0x48')],{})[_0x972c('0x28')](function(_0x414be9){var _0x31bab9=_0x1c7f09[_0x972c('0x49')][_0x972c('0x4a')]({'plain':!![]});if(!_0x31bab9)throw new Error(_0x972c('0x4b'));if(_0x31bab9['role']===_0x972c('0x49')){var _0x551665=_0x414be9[_0x972c('0x4a')]({'plain':!![]});var _0x301570=_0x972c('0x4c');return db['UserProfileSection'][_0x972c('0x46')]({'where':{'name':_0x301570,'userProfileId':_0x31bab9['userProfileId']},'raw':!![]})['then'](function(_0x5a7422){if(_0x5a7422&&_0x5a7422[_0x972c('0x4d')]===0x0){return db[_0x972c('0x4e')]['create']({'name':_0x551665['name'],'resourceId':_0x551665['id'],'type':_0x5a7422['name'],'sectionId':_0x5a7422['id']},{})[_0x972c('0x28')](function(){return _0x414be9;});}else{return _0x414be9;}})[_0x972c('0x44')](function(_0xe38e68){logger[_0x972c('0x29')](_0x972c('0x4f'),_0xe38e68);throw _0xe38e68;});}return _0x414be9;})[_0x972c('0x28')](respondWithResult(_0x525de3,0xc9))[_0x972c('0x44')](handleError(_0x525de3,null));};exports[_0x972c('0x27')]=function(_0x6cd5f5,_0x3aefbd){if(_0x6cd5f5[_0x972c('0x48')]['id']){delete _0x6cd5f5['body']['id'];}return db[_0x972c('0x2c')][_0x972c('0x46')]({'where':{'id':_0x6cd5f5['params']['id']}})['then'](handleEntityNotFound(_0x3aefbd,null))[_0x972c('0x28')](saveUpdates(_0x6cd5f5[_0x972c('0x48')],null))[_0x972c('0x28')](respondWithResult(_0x3aefbd,null))[_0x972c('0x44')](handleError(_0x3aefbd,null));};exports[_0x972c('0x50')]=function(_0x377f1b,_0x3aaa8b){var _0x6ad736=_0x377f1b[_0x972c('0x51')]['id'];var _0x3ad425=[];return db[_0x972c('0x52')][_0x972c('0x53')](function(_0x2c47cf){var _0x3882ba=_0x972c('0x54')+_0x6ad736;return db[_0x972c('0x52')][_0x972c('0x31')](_0x3882ba,{'type':db[_0x972c('0x55')][_0x972c('0x56')][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf})['then'](function(_0x125b35){_0x3ad425=_[_0x972c('0x30')](_0x125b35,function(_0x3b3dd0){return Number(_0x3b3dd0['UserId']);});})[_0x972c('0x28')](function(){var _0x576a1a='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6ad736;return db[_0x972c('0x52')][_0x972c('0x31')](_0x576a1a,{'type':db['Sequelize']['QueryTypes'][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x251163){var _0xcd4453=_[_0x972c('0x30')](_0x251163,function(_0xdacdd2){return Number(_0xdacdd2['VoiceQueueId']);});return db[_0x972c('0x58')]['destroy']({'where':{'UserId':{'$in':_0x3ad425},'VoiceQueueId':{'$in':_0xcd4453}},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){var _0x1bf6a0=_0x972c('0x59')+_0x6ad736;return db[_0x972c('0x52')]['query'](_0x1bf6a0,{'type':db[_0x972c('0x55')][_0x972c('0x56')][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x519605){var _0x224809=_[_0x972c('0x30')](_0x519605,function(_0x61a55d){return Number(_0x61a55d[_0x972c('0x5a')]);});return db['UserMailQueue'][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'MailQueueId':{'$in':_0x224809}},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){var _0x1fb572='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6ad736;return db[_0x972c('0x52')]['query'](_0x1fb572,{'type':db[_0x972c('0x55')]['QueryTypes'][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x27279e){var _0x191cff=_['map'](_0x27279e,function(_0x24bfe4){return Number(_0x24bfe4[_0x972c('0x5b')]);});return db[_0x972c('0x5c')][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'SmsQueueId':{'$in':_0x191cff}},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){var _0x19d8bf='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6ad736;return db[_0x972c('0x52')][_0x972c('0x31')](_0x19d8bf,{'type':db[_0x972c('0x55')]['QueryTypes'][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x52e07f){var _0x571848=_[_0x972c('0x30')](_0x52e07f,function(_0x4c3bc3){return Number(_0x4c3bc3[_0x972c('0x5d')]);});return db[_0x972c('0x5e')][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'ChatQueueId':{'$in':_0x571848}},'transaction':_0x2c47cf});})['then'](function(){var _0x411f2c=_0x972c('0x5f')+_0x6ad736;return db[_0x972c('0x52')][_0x972c('0x31')](_0x411f2c,{'type':db[_0x972c('0x55')][_0x972c('0x56')][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x53d76b){var _0x17d5ad=_[_0x972c('0x30')](_0x53d76b,function(_0xfadf5){return Number(_0xfadf5['FaxQueueId']);});return db[_0x972c('0x60')][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'FaxQueueId':{'$in':_0x17d5ad}},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){var _0x2a87d1='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6ad736;return db[_0x972c('0x52')][_0x972c('0x31')](_0x2a87d1,{'type':db[_0x972c('0x55')][_0x972c('0x56')][_0x972c('0x57')],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x311f30){var _0x38ba51=_[_0x972c('0x30')](_0x311f30,function(_0x44272a){return Number(_0x44272a[_0x972c('0x61')]);});return db[_0x972c('0x62')][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'OpenchannelQueueId':{'$in':_0x38ba51}},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){var _0x33fbd2=_0x972c('0x63')+_0x6ad736;return db[_0x972c('0x52')]['query'](_0x33fbd2,{'type':db['Sequelize'][_0x972c('0x56')]['SELECT'],'raw':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x927b12){var _0x2f4f8b=_['map'](_0x927b12,function(_0x1e4e48){return Number(_0x1e4e48[_0x972c('0x64')]);});return db[_0x972c('0x65')]['destroy']({'where':{'UserId':{'$in':_0x3ad425},'WhatsappQueueId':{'$in':_0x2f4f8b}},'transaction':_0x2c47cf});})['then'](function(){return db[_0x972c('0x66')][_0x972c('0x46')]({'where':{'TeamId':_0x6ad736}});})[_0x972c('0x28')](function(_0x39370e){if(_0x39370e===null){return;}return db[_0x972c('0x67')][_0x972c('0x50')]({'where':{'UserId':{'$in':_0x3ad425},'VoicePrefixId':_0x39370e['VoicePrefixId']},'transaction':_0x2c47cf});})[_0x972c('0x28')](function(){return db[_0x972c('0x2c')]['destroy']({'where':{'id':_0x6ad736},'cascade':!![],'transaction':_0x2c47cf});})[_0x972c('0x28')](function(_0x851e0a){if(_0x851e0a===0x0){_0x3aaa8b[_0x972c('0x1b')](0x194);}else{return db['UserProfileResource'][_0x972c('0x50')]({'where':{'type':_0x972c('0x4c'),'resourceId':_0x6ad736},'cascade':!![],'transaction':_0x2c47cf})['then'](function(){_0x3aaa8b[_0x972c('0x1c')](0xcc)[_0x972c('0x1d')]();});}})[_0x972c('0x44')](function(_0x21f616){_0x3aaa8b[_0x972c('0x1c')](0x1f4)['send'](_0x21f616);});});};exports[_0x972c('0x68')]=function(_0x4db672,_0x4786f3,_0x5cdf38){return db[_0x972c('0x2c')][_0x972c('0x69')]({'where':{'id':_0x4db672[_0x972c('0x51')]['id']}})[_0x972c('0x28')](handleEntityNotFound(_0x4786f3,null))[_0x972c('0x28')](function(_0x3fccd5){if(!_0x4db672['query'][_0x972c('0x6a')]||!utils[_0x972c('0x6b')](_0x4db672[_0x972c('0x31')][_0x972c('0x6a')])){throw new db[(_0x972c('0x55'))][(_0x972c('0x6c'))](_0x972c('0x6d'));}var _0x2b0ad4={};var _0x5aa7ab={};_0x5aa7ab[_0x972c('0x35')]=_[_0x972c('0x32')](db[_['capitalize'](_0x4db672[_0x972c('0x31')][_0x972c('0x6a')][_0x972c('0x6e')]())+_0x972c('0x6f')][_0x972c('0x70')]);_0x5aa7ab[_0x972c('0x31')]=_[_0x972c('0x32')](_0x4db672[_0x972c('0x31')]);_0x5aa7ab['filters']=_[_0x972c('0x34')](_0x5aa7ab['model'],_0x5aa7ab[_0x972c('0x31')]);_0x2b0ad4[_0x972c('0x36')]=_['intersection'](_0x5aa7ab[_0x972c('0x35')],qs['fields'](_0x4db672[_0x972c('0x31')]['fields']));_0x2b0ad4[_0x972c('0x36')]=_0x2b0ad4[_0x972c('0x36')][_0x972c('0x45')]?_0x2b0ad4['attributes']:_0x5aa7ab[_0x972c('0x35')];_0x2b0ad4[_0x972c('0x20')]=qs[_0x972c('0x20')](_0x4db672['query'][_0x972c('0x20')]);_0x2b0ad4[_0x972c('0x1e')]=qs[_0x972c('0x1e')](_0x4db672[_0x972c('0x31')][_0x972c('0x1e')]);_0x2b0ad4[_0x972c('0x71')]=qs['sort'](_0x4db672[_0x972c('0x31')]['sort']);_0x2b0ad4[_0x972c('0x3b')]=qs[_0x972c('0x33')](_[_0x972c('0x3c')](_0x4db672['query'],_0x5aa7ab[_0x972c('0x33')]));_0x2b0ad4=_[_0x972c('0x3e')]({},_0x2b0ad4,_0x4db672[_0x972c('0x40')]);return _0x3fccd5[_0x972c('0x4a')+_['capitalize'](_0x4db672['query'][_0x972c('0x6a')]['toLowerCase']())+'Queues'](_0x2b0ad4);})[_0x972c('0x28')](respondWithResult(_0x4786f3,null))[_0x972c('0x44')](handleError(_0x4786f3,null));};exports['addQueues']=function(_0x14b7c3,_0x43d8d8,_0x149a29){return db[_0x972c('0x2c')][_0x972c('0x69')]({'where':{'id':_0x14b7c3[_0x972c('0x51')]['id']}})[_0x972c('0x28')](function(_0x59f795){if(_0x59f795){if(!_0x14b7c3[_0x972c('0x48')][_0x972c('0x6a')]||!utils[_0x972c('0x6b')](_0x14b7c3[_0x972c('0x48')][_0x972c('0x6a')])){throw new db['Sequelize'][(_0x972c('0x6c'))]('Unknown\x20channel');}return _0x59f795[_0x972c('0x72')+_[_0x972c('0x73')](_0x14b7c3['body'][_0x972c('0x6a')][_0x972c('0x6e')]())+_0x972c('0x74')](_0x14b7c3['body'][_0x972c('0x75')]);}return null;})[_0x972c('0x28')](handleEntityNotFound(_0x43d8d8,null))['then'](respondWithStatusCode(_0x43d8d8,null))[_0x972c('0x44')](handleError(_0x43d8d8,null));};exports[_0x972c('0x76')]=function(_0x5db945,_0x56152e,_0x135d4e){return db[_0x972c('0x2c')][_0x972c('0x69')]({'where':{'id':_0x5db945[_0x972c('0x51')]['id']}})['then'](function(_0x12e372){if(_0x12e372){if(!_0x5db945['query'][_0x972c('0x6a')]||!utils[_0x972c('0x6b')](_0x5db945['query'][_0x972c('0x6a')])){throw new db[(_0x972c('0x55'))][(_0x972c('0x6c'))](_0x972c('0x6d'));}return _0x12e372[_0x972c('0x77')+_['capitalize'](_0x5db945[_0x972c('0x31')][_0x972c('0x6a')][_0x972c('0x6e')]())+_0x972c('0x74')](_0x5db945[_0x972c('0x31')][_0x972c('0x75')]);}return null;})[_0x972c('0x28')](handleEntityNotFound(_0x56152e,null))['then'](respondWithStatusCode(_0x56152e,null))['catch'](handleError(_0x56152e,null));};exports[_0x972c('0x78')]=function(_0x108eb7,_0x33566a){var _0x2536e2=_[_0x972c('0x79')](_0x108eb7[_0x972c('0x48')][_0x972c('0x75')])?_0x108eb7['body'][_0x972c('0x75')]:[_0x108eb7[_0x972c('0x48')]['ids']];var _0x3a7591=_0x108eb7[_0x972c('0x51')]['id'];return db[_0x972c('0x2c')][_0x972c('0x46')]({'where':{'id':_0x3a7591}})[_0x972c('0x28')](handleEntityNotFound(_0x33566a,null))['then'](function(_0x1de4e1){if(_0x1de4e1){var _0xcc9ad3=[_0x972c('0x7a'),'Chat',_0x972c('0x7b'),_0x972c('0x7c'),'Fax','Openchannel','Whatsapp'];return db[_0x972c('0x52')]['transaction'](function(_0x1d2a3d){var _0x54cfac=_[_0x972c('0x30')](_0xcc9ad3,function(_0x36892c){var _0x64cb79={'attributes':['id',_0x972c('0x2a')]};if(_0x36892c===_0x972c('0x7a')){_0x64cb79[_0x972c('0x7d')]={'attributes':['penalty']};}return _0x1de4e1['get'+_0x36892c+'Queues'](_0x64cb79)['then'](function(_0x53982f){var _0x28c0a3=_[_0x972c('0x30')](_0x53982f,function(_0x415f7c){var _0x126bc7=_[_0x972c('0x30')](_0x2536e2,function(_0x31ccce){var _0x284b70={'where':{'UserId':_0x31ccce,[_0x36892c+_0x972c('0x7e')]:_0x415f7c['id']},'transaction':_0x1d2a3d};if(_0x36892c===_0x972c('0x7a')){_0x284b70[_0x972c('0x7f')]={'penalty':_0x415f7c[_0x972c('0x80')][_0x972c('0x81')]};}return db[_0x972c('0x82')+_0x36892c+'Queue']['findOrCreate'](_0x284b70)['then'](function(){socket['emit'](_0x972c('0x49')+_0x36892c+'Queue:save',{'UserId':_0x31ccce,[_0x36892c+_0x972c('0x7e')]:_0x415f7c['id']});if(_0x36892c!==_0x972c('0x7a')){return;}return db[_0x972c('0x82')][_0x972c('0x83')]({'where':{'id':_0x2536e2,'online':0x1},'attributes':['id','name',_0x972c('0x84'),'voicePause',_0x972c('0x85')],'raw':!![]})['then'](function(_0x2e8807){var _0x477157=_[_0x972c('0x30')](_0x2e8807,function(_0x5b7d26){return db['UserVoiceQueueRt'][_0x972c('0x86')]({'membername':_0x5b7d26[_0x972c('0x2a')],'UserId':_0x5b7d26['id'],'queue_name':_0x415f7c[_0x972c('0x2a')],'VoiceQueueId':_0x415f7c['id'],'interface':_[_0x972c('0x87')](_0x5b7d26[_0x972c('0x85')])?util[_0x972c('0x88')]('SIP/%s',_0x5b7d26[_0x972c('0x2a')]):_0x5b7d26[_0x972c('0x85')],'paused':_0x5b7d26[_0x972c('0x89')]||![],'penalty':_0x415f7c[_0x972c('0x80')][_0x972c('0x81')]},{'transaction':_0x1d2a3d});});return Promise[_0x972c('0x8a')](_0x477157);});});});return Promise[_0x972c('0x8a')](_0x126bc7);});return Promise['all'](_0x28c0a3);})[_0x972c('0x28')](function(){return db[_0x972c('0x66')][_0x972c('0x69')]({'where':{'teamId':_0x3a7591}})['then'](function(_0x44fa12){if(_0x44fa12){var _0x2a9668=_['map'](_0x2536e2,function(_0x236e49){db['UserVoicePrefix'][_0x972c('0x86')]({'UserId':_0x236e49,'VoicePrefixId':_0x44fa12['VoicePrefixId']});});return Promise[_0x972c('0x8a')](_0x2a9668);}});});});return Promise[_0x972c('0x8a')](_0x54cfac)[_0x972c('0x28')](function(){return _0x1de4e1['addAgents'](_0x2536e2,{'transaction':_0x1d2a3d})[_0x972c('0x8b')](function(_0x494bc5){return _0x494bc5;});});});}})[_0x972c('0x28')](respondWithResult(_0x33566a,null))['catch'](handleError(_0x33566a,null));};exports['removeAgents']=function(_0x41d99d,_0x5ba0d0){var _0x4c9255=_[_0x972c('0x79')](_0x41d99d[_0x972c('0x31')][_0x972c('0x75')])?_0x41d99d['query'][_0x972c('0x75')]:[_0x41d99d[_0x972c('0x31')][_0x972c('0x75')]];var _0x59d5a0=_0x41d99d[_0x972c('0x51')]['id'];return db[_0x972c('0x2c')]['find']({'where':{'id':_0x59d5a0}})[_0x972c('0x28')](handleEntityNotFound(_0x5ba0d0,null))['then'](function(_0x196add){if(_0x196add){var _0x2b8008=['Voice',_0x972c('0x8c'),_0x972c('0x7b'),'Sms',_0x972c('0x8d'),_0x972c('0x8e'),_0x972c('0x8f')];return db[_0x972c('0x52')][_0x972c('0x53')](function(_0x2b27ff){var _0x545b4e=_[_0x972c('0x30')](_0x2b8008,function(_0x2c6695){var _0xedb4cc={'attributes':['id','name']};return _0x196add[_0x972c('0x4a')+_0x2c6695+_0x972c('0x74')](_0xedb4cc)[_0x972c('0x28')](function(_0x56aa6a){var _0x2e2c8e=_[_0x972c('0x30')](_0x56aa6a,function(_0x26b8a6){return _0x26b8a6[_0x972c('0x90')](_0x4c9255,{'transaction':_0x2b27ff})[_0x972c('0x28')](function(){var _0x426abb=_[_0x972c('0x30')](_0x4c9255,function(_0x5b7afd){socket[_0x972c('0x91')](_0x972c('0x49')+_0x2c6695+_0x972c('0x92'),{'UserId':Number(_0x5b7afd),[_0x2c6695+_0x972c('0x7e')]:_0x26b8a6['id']});if(_0x2c6695!==_0x972c('0x7a')){return;}return db['UserVoiceQueueRt'][_0x972c('0x50')]({'where':{'VoiceQueueId':_0x26b8a6['id'],'UserId':_0x5b7afd},'transaction':_0x2b27ff});});return Promise['all'](_0x426abb);});});return Promise[_0x972c('0x8a')](_0x2e2c8e);});});return Promise[_0x972c('0x8a')](_0x545b4e)[_0x972c('0x28')](function(){return _0x196add[_0x972c('0x90')](_0x4c9255,{'transaction':_0x2b27ff});})[_0x972c('0x28')](function(){return db[_0x972c('0x66')][_0x972c('0x69')]({'where':{'teamId':_0x59d5a0}})['then'](function(_0x5e50a5){if(_0x5e50a5){var _0x3f2987=_[_0x972c('0x30')](_0x4c9255,function(_0x4361b2){db[_0x972c('0x67')][_0x972c('0x50')]({'where':{'UserId':_0x4361b2,'VoicePrefixId':_0x5e50a5[_0x972c('0x93')]}});});return Promise['all'](_0x3f2987);}});});});}})[_0x972c('0x28')](respondWithStatusCode(_0x5ba0d0,null))['catch'](handleError(_0x5ba0d0,null));};exports[_0x972c('0x94')]=function(_0x4f1323,_0x59c03c,_0x5bdeb0){var _0x19bbe7={};var _0x122386={};var _0x15de14;var _0x46fc99;return db['Team'][_0x972c('0x69')]({'where':{'id':_0x4f1323[_0x972c('0x51')]['id']}})[_0x972c('0x28')](handleEntityNotFound(_0x59c03c,null))[_0x972c('0x28')](function(_0xf409ee){if(_0xf409ee){_0x15de14=_0xf409ee;_0x122386[_0x972c('0x35')]=_[_0x972c('0x32')](db[_0x972c('0x82')][_0x972c('0x70')]);_0x122386[_0x972c('0x31')]=_[_0x972c('0x32')](_0x4f1323[_0x972c('0x31')]);_0x122386[_0x972c('0x33')]=_[_0x972c('0x34')](_0x122386['model'],_0x122386[_0x972c('0x31')]);_0x19bbe7['attributes']=_['intersection'](_0x122386['model'],qs[_0x972c('0x37')](_0x4f1323['query']['fields']));_0x19bbe7[_0x972c('0x36')]=_0x19bbe7[_0x972c('0x36')][_0x972c('0x45')]?_0x19bbe7[_0x972c('0x36')]:_0x122386[_0x972c('0x35')];_0x19bbe7[_0x972c('0x71')]=qs[_0x972c('0x3a')](_0x4f1323[_0x972c('0x31')][_0x972c('0x3a')]);_0x19bbe7['where']=qs[_0x972c('0x33')](_['pick'](_0x4f1323[_0x972c('0x31')],_0x122386[_0x972c('0x33')]));if(_0x4f1323[_0x972c('0x31')][_0x972c('0x3d')]){_0x19bbe7[_0x972c('0x3b')]=_[_0x972c('0x3e')](_0x19bbe7[_0x972c('0x3b')],{'$or':_['map'](_0x19bbe7[_0x972c('0x36')],function(_0x279a2f){var _0x31da72={};_0x31da72[_0x279a2f]={'$like':'%'+_0x4f1323['query'][_0x972c('0x3d')]+'%'};return _0x31da72;})});}_0x19bbe7=_[_0x972c('0x3e')]({},_0x19bbe7,_0x4f1323['options']);return _0x15de14[_0x972c('0x94')](_0x19bbe7);}})['then'](function(_0x115ed6){if(_0x115ed6){_0x46fc99=_0x115ed6[_0x972c('0x45')];if(!_0x4f1323['query'][_0x972c('0x38')](_0x972c('0x39'))){_0x19bbe7[_0x972c('0x20')]=qs[_0x972c('0x20')](_0x4f1323[_0x972c('0x31')]['limit']);_0x19bbe7[_0x972c('0x1e')]=qs[_0x972c('0x1e')](_0x4f1323[_0x972c('0x31')][_0x972c('0x1e')]);}return _0x15de14[_0x972c('0x94')](_0x19bbe7);}})[_0x972c('0x28')](function(_0x5b83e6){if(_0x5b83e6){return _0x5b83e6?{'count':_0x46fc99,'rows':_0x5b83e6}:null;}})[_0x972c('0x28')](respondWithResult(_0x59c03c,null))[_0x972c('0x44')](handleError(_0x59c03c,null));}; \ No newline at end of file +var _0x2021=['count','set','reject','save','update','then','error','stack','name','send','Team','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','channel','ValidationError','Unknown\x20channel','keys','capitalize','toLowerCase','Queue','Queues','addQueues','findOne','isValidChannel','removeQueues','remove','ids','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','Voice','through','QueueId','TeamVoiceQueue','penalty','User','emit','Queue:save','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','Whatsapp','removeAgents','getAgents','nolimit','rimraf','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./team.socket','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x22cd51,_0x115d0a){var _0x523854=function(_0x2df46d){while(--_0x2df46d){_0x22cd51['push'](_0x22cd51['shift']());}};_0x523854(++_0x115d0a);}(_0x2021,0x76));var _0x1202=function(_0x10b75b,_0x15c82f){_0x10b75b=_0x10b75b-0x0;var _0x3a3d3d=_0x2021[_0x10b75b];return _0x3a3d3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1202('0x0'));var zipdir=require(_0x1202('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1202('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1202('0x3'));var util=require(_0x1202('0x4'));var path=require(_0x1202('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1202('0x6'));var fs=require('fs');var fs_extra=require(_0x1202('0x7'));var _=require('lodash');var squel=require(_0x1202('0x8'));var crypto=require('crypto');var jsforce=require(_0x1202('0x9'));var deskjs=require(_0x1202('0xa'));var toCsv=require(_0x1202('0xb'));var querystring=require(_0x1202('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1202('0xd'));var qs=require(_0x1202('0xe'));var as=require(_0x1202('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1202('0x10'))('api');var utils=require(_0x1202('0x11'));var config=require(_0x1202('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1202('0x13'))['db'];config[_0x1202('0x14')]=_[_0x1202('0x15')](config[_0x1202('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1202('0x14')]));require(_0x1202('0x16'))['register'](socket);function respondWithStatusCode(_0x360bb3,_0x2de284){_0x2de284=_0x2de284||0xcc;return function(_0x31ffae){if(_0x31ffae){return _0x360bb3[_0x1202('0x17')](_0x2de284);}return _0x360bb3[_0x1202('0x18')](_0x2de284)[_0x1202('0x19')]();};}function respondWithResult(_0x5730f6,_0x1174db){_0x1174db=_0x1174db||0xc8;return function(_0x568655){if(_0x568655){return _0x5730f6[_0x1202('0x18')](_0x1174db)[_0x1202('0x1a')](_0x568655);}};}function respondWithFilteredResult(_0x665f97,_0x579a7b){return function(_0x3016cd){if(_0x3016cd){var _0x48c71f=typeof _0x579a7b[_0x1202('0x1b')]===_0x1202('0x1c')&&typeof _0x579a7b[_0x1202('0x1d')]===_0x1202('0x1c');var _0x3baefb=_0x3016cd[_0x1202('0x1e')];var _0x4f5946=_0x48c71f?0x0:_0x579a7b[_0x1202('0x1b')];var _0x1f2ed2=_0x48c71f?_0x3016cd[_0x1202('0x1e')]:_0x579a7b[_0x1202('0x1b')]+_0x579a7b[_0x1202('0x1d')];var _0x12010d;if(_0x1f2ed2>=_0x3baefb){_0x1f2ed2=_0x3baefb;_0x12010d=0xc8;}else{_0x12010d=0xce;}_0x665f97[_0x1202('0x18')](_0x12010d);return _0x665f97[_0x1202('0x1f')]('Content-Range',_0x4f5946+'-'+_0x1f2ed2+'/'+_0x3baefb)[_0x1202('0x1a')](_0x3016cd);}return null;};}function patchUpdates(_0x3fa6f3){return function(_0x33ed5e){try{jsonpatch['apply'](_0x33ed5e,_0x3fa6f3,!![]);}catch(_0x24e107){return BPromise[_0x1202('0x20')](_0x24e107);}return _0x33ed5e[_0x1202('0x21')]();};}function saveUpdates(_0x593683,_0x3ff199){return function(_0x284e56){if(_0x284e56){return _0x284e56[_0x1202('0x22')](_0x593683)[_0x1202('0x23')](function(_0x3b3a9e){return _0x3b3a9e;});}return null;};}function handleEntityNotFound(_0x4ecf09,_0x4d7d12){return function(_0x1d44ea){if(!_0x1d44ea){_0x4ecf09[_0x1202('0x17')](0x194);}return _0x1d44ea;};}function handleError(_0x1977a1,_0x2876f3){_0x2876f3=_0x2876f3||0x1f4;return function(_0x52ad8d){logger[_0x1202('0x24')](_0x52ad8d[_0x1202('0x25')]);if(_0x52ad8d[_0x1202('0x26')]){delete _0x52ad8d[_0x1202('0x26')];}_0x1977a1['status'](_0x2876f3)[_0x1202('0x27')](_0x52ad8d);};}exports['index']=function(_0x1b1373,_0x468bef){var _0x26a6fc={},_0x35a959={},_0x36f95e={'count':0x0,'rows':[]};var _0xe3546d=_['map'](db[_0x1202('0x28')][_0x1202('0x29')],function(_0x50a772){return{'name':_0x50a772[_0x1202('0x2a')],'type':_0x50a772[_0x1202('0x2b')][_0x1202('0x2c')]};});_0x35a959[_0x1202('0x2d')]=_[_0x1202('0x2e')](_0xe3546d,_0x1202('0x26'));_0x35a959[_0x1202('0x2f')]=_['keys'](_0x1b1373[_0x1202('0x2f')]);_0x35a959['filters']=_[_0x1202('0x30')](_0x35a959[_0x1202('0x2d')],_0x35a959['query']);_0x26a6fc[_0x1202('0x31')]=_['intersection'](_0x35a959['model'],qs[_0x1202('0x32')](_0x1b1373[_0x1202('0x2f')]['fields']));_0x26a6fc[_0x1202('0x31')]=_0x26a6fc[_0x1202('0x31')]['length']?_0x26a6fc[_0x1202('0x31')]:_0x35a959['model'];if(!_0x1b1373[_0x1202('0x2f')][_0x1202('0x33')]('nolimit')){_0x26a6fc['limit']=qs[_0x1202('0x1d')](_0x1b1373[_0x1202('0x2f')][_0x1202('0x1d')]);_0x26a6fc[_0x1202('0x1b')]=qs['offset'](_0x1b1373['query']['offset']);}_0x26a6fc[_0x1202('0x34')]=qs[_0x1202('0x35')](_0x1b1373[_0x1202('0x2f')][_0x1202('0x35')]);_0x26a6fc['where']=qs[_0x1202('0x36')](_[_0x1202('0x37')](_0x1b1373[_0x1202('0x2f')],_0x35a959[_0x1202('0x36')]),_0xe3546d);if(_0x1b1373[_0x1202('0x2f')][_0x1202('0x38')]){_0x26a6fc[_0x1202('0x39')]=_[_0x1202('0x3a')](_0x26a6fc[_0x1202('0x39')],{'$or':_[_0x1202('0x2e')](_0xe3546d,function(_0x49b972){if(_0x49b972[_0x1202('0x2b')]!==_0x1202('0x3b')){var _0x379b27={};_0x379b27[_0x49b972[_0x1202('0x26')]]={'$like':'%'+_0x1b1373[_0x1202('0x2f')][_0x1202('0x38')]+'%'};return _0x379b27;}})});}_0x26a6fc=_[_0x1202('0x3a')]({},_0x26a6fc,_0x1b1373[_0x1202('0x3c')]);var _0x2a5e2d={'where':_0x26a6fc[_0x1202('0x39')]};return db[_0x1202('0x28')][_0x1202('0x1e')](_0x2a5e2d)[_0x1202('0x23')](function(_0x28f61d){_0x36f95e['count']=_0x28f61d;if(_0x1b1373[_0x1202('0x2f')][_0x1202('0x3d')]){_0x26a6fc[_0x1202('0x3e')]=[{'all':!![]}];}return db[_0x1202('0x28')]['findAll'](_0x26a6fc);})[_0x1202('0x23')](function(_0x3250ad){_0x36f95e['rows']=_0x3250ad;return _0x36f95e;})[_0x1202('0x23')](respondWithFilteredResult(_0x468bef,_0x26a6fc))[_0x1202('0x3f')](handleError(_0x468bef,null));};exports['show']=function(_0x50b0c2,_0x4bbb77){var _0x89ad7={'raw':![],'where':{'id':_0x50b0c2[_0x1202('0x40')]['id']}},_0x1d7eb5={};_0x1d7eb5[_0x1202('0x2d')]=_['keys'](db['Team'][_0x1202('0x29')]);_0x1d7eb5[_0x1202('0x2f')]=_['keys'](_0x50b0c2[_0x1202('0x2f')]);_0x1d7eb5[_0x1202('0x36')]=_[_0x1202('0x30')](_0x1d7eb5[_0x1202('0x2d')],_0x1d7eb5[_0x1202('0x2f')]);_0x89ad7['attributes']=_[_0x1202('0x30')](_0x1d7eb5[_0x1202('0x2d')],qs['fields'](_0x50b0c2[_0x1202('0x2f')][_0x1202('0x32')]));_0x89ad7[_0x1202('0x31')]=_0x89ad7[_0x1202('0x31')][_0x1202('0x41')]?_0x89ad7['attributes']:_0x1d7eb5[_0x1202('0x2d')];if(_0x50b0c2[_0x1202('0x2f')][_0x1202('0x3d')]){_0x89ad7[_0x1202('0x3e')]=[{'all':!![]}];}_0x89ad7=_[_0x1202('0x3a')]({},_0x89ad7,_0x50b0c2['options']);return db[_0x1202('0x28')][_0x1202('0x42')](_0x89ad7)[_0x1202('0x23')](handleEntityNotFound(_0x4bbb77,null))[_0x1202('0x23')](respondWithResult(_0x4bbb77,null))[_0x1202('0x3f')](handleError(_0x4bbb77,null));};exports[_0x1202('0x43')]=function(_0x4e2286,_0x53f62c){return db[_0x1202('0x28')]['create'](_0x4e2286[_0x1202('0x44')],{})[_0x1202('0x23')](function(_0x54878e){var _0x3bbbba=_0x4e2286[_0x1202('0x45')]['get']({'plain':!![]});if(!_0x3bbbba)throw new Error(_0x1202('0x46'));if(_0x3bbbba[_0x1202('0x47')]==='user'){var _0x49e506=_0x54878e[_0x1202('0x48')]({'plain':!![]});var _0x498963=_0x1202('0x49');return db[_0x1202('0x4a')]['find']({'where':{'name':_0x498963,'userProfileId':_0x3bbbba[_0x1202('0x4b')]},'raw':!![]})[_0x1202('0x23')](function(_0x2a3947){if(_0x2a3947&&_0x2a3947[_0x1202('0x4c')]===0x0){return db[_0x1202('0x4d')][_0x1202('0x43')]({'name':_0x49e506[_0x1202('0x26')],'resourceId':_0x49e506['id'],'type':_0x2a3947['name'],'sectionId':_0x2a3947['id']},{})[_0x1202('0x23')](function(){return _0x54878e;});}else{return _0x54878e;}})[_0x1202('0x3f')](function(_0x2a2ed0){logger[_0x1202('0x24')](_0x1202('0x4e'),_0x2a2ed0);throw _0x2a2ed0;});}return _0x54878e;})[_0x1202('0x23')](respondWithResult(_0x53f62c,0xc9))[_0x1202('0x3f')](handleError(_0x53f62c,null));};exports['update']=function(_0x2fe3ce,_0x57df7d){if(_0x2fe3ce['body']['id']){delete _0x2fe3ce['body']['id'];}return db[_0x1202('0x28')][_0x1202('0x42')]({'where':{'id':_0x2fe3ce['params']['id']}})[_0x1202('0x23')](handleEntityNotFound(_0x57df7d,null))['then'](saveUpdates(_0x2fe3ce[_0x1202('0x44')],null))['then'](respondWithResult(_0x57df7d,null))[_0x1202('0x3f')](handleError(_0x57df7d,null));};exports[_0x1202('0x4f')]=function(_0x2bbcd8,_0x1b90b8){var _0x1de0bf=_0x2bbcd8[_0x1202('0x40')]['id'];var _0x5ed411=[];return db[_0x1202('0x50')][_0x1202('0x51')](function(_0x8e1046){var _0x202117=_0x1202('0x52')+_0x1de0bf;return db[_0x1202('0x50')][_0x1202('0x2f')](_0x202117,{'type':db[_0x1202('0x53')]['QueryTypes'][_0x1202('0x54')],'raw':!![],'transaction':_0x8e1046})['then'](function(_0x771407){_0x5ed411=_[_0x1202('0x2e')](_0x771407,function(_0x112978){return Number(_0x112978[_0x1202('0x55')]);});})[_0x1202('0x23')](function(){var _0x108ca4=_0x1202('0x56')+_0x1de0bf;return db[_0x1202('0x50')][_0x1202('0x2f')](_0x108ca4,{'type':db[_0x1202('0x53')][_0x1202('0x57')][_0x1202('0x54')],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x56b611){var _0x12b857=_[_0x1202('0x2e')](_0x56b611,function(_0x1bf53c){return Number(_0x1bf53c[_0x1202('0x58')]);});return db[_0x1202('0x59')]['destroy']({'where':{'UserId':{'$in':_0x5ed411},'VoiceQueueId':{'$in':_0x12b857}},'transaction':_0x8e1046});})['then'](function(){var _0x154554='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1de0bf;return db['sequelize'][_0x1202('0x2f')](_0x154554,{'type':db[_0x1202('0x53')][_0x1202('0x57')][_0x1202('0x54')],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x1ae4ba){var _0x949927=_[_0x1202('0x2e')](_0x1ae4ba,function(_0x1d2f3b){return Number(_0x1d2f3b[_0x1202('0x5a')]);});return db[_0x1202('0x5b')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'MailQueueId':{'$in':_0x949927}},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){var _0x516eff=_0x1202('0x5c')+_0x1de0bf;return db[_0x1202('0x50')][_0x1202('0x2f')](_0x516eff,{'type':db[_0x1202('0x53')]['QueryTypes'][_0x1202('0x54')],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x1d7802){var _0x466782=_[_0x1202('0x2e')](_0x1d7802,function(_0xfdb258){return Number(_0xfdb258[_0x1202('0x5d')]);});return db['UserSmsQueue'][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'SmsQueueId':{'$in':_0x466782}},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){var _0x51bcc9=_0x1202('0x5e')+_0x1de0bf;return db[_0x1202('0x50')][_0x1202('0x2f')](_0x51bcc9,{'type':db[_0x1202('0x53')]['QueryTypes'][_0x1202('0x54')],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x59de3d){var _0x31c29f=_[_0x1202('0x2e')](_0x59de3d,function(_0x1b03d7){return Number(_0x1b03d7[_0x1202('0x5f')]);});return db[_0x1202('0x60')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'ChatQueueId':{'$in':_0x31c29f}},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){var _0x317df9='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1de0bf;return db[_0x1202('0x50')]['query'](_0x317df9,{'type':db[_0x1202('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x58cd5b){var _0x2b7f3a=_[_0x1202('0x2e')](_0x58cd5b,function(_0x1fb5ec){return Number(_0x1fb5ec['FaxQueueId']);});return db[_0x1202('0x61')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'FaxQueueId':{'$in':_0x2b7f3a}},'transaction':_0x8e1046});})['then'](function(){var _0x409532=_0x1202('0x62')+_0x1de0bf;return db[_0x1202('0x50')][_0x1202('0x2f')](_0x409532,{'type':db[_0x1202('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x505afd){var _0x274f46=_[_0x1202('0x2e')](_0x505afd,function(_0x4aefa9){return Number(_0x4aefa9[_0x1202('0x63')]);});return db[_0x1202('0x64')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'OpenchannelQueueId':{'$in':_0x274f46}},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){var _0x8b8b9a=_0x1202('0x65')+_0x1de0bf;return db['sequelize'][_0x1202('0x2f')](_0x8b8b9a,{'type':db[_0x1202('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x8e1046});})[_0x1202('0x23')](function(_0x37a4a6){var _0x3e58ed=_[_0x1202('0x2e')](_0x37a4a6,function(_0x4b3e83){return Number(_0x4b3e83[_0x1202('0x66')]);});return db[_0x1202('0x67')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'WhatsappQueueId':{'$in':_0x3e58ed}},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){return db[_0x1202('0x68')][_0x1202('0x42')]({'where':{'TeamId':_0x1de0bf}});})[_0x1202('0x23')](function(_0xb02995){if(_0xb02995===null){return;}return db[_0x1202('0x69')][_0x1202('0x4f')]({'where':{'UserId':{'$in':_0x5ed411},'VoicePrefixId':_0xb02995[_0x1202('0x6a')]},'transaction':_0x8e1046});})[_0x1202('0x23')](function(){return db[_0x1202('0x28')][_0x1202('0x4f')]({'where':{'id':_0x1de0bf},'cascade':!![],'transaction':_0x8e1046});})['then'](function(_0x8127ea){if(_0x8127ea===0x0){_0x1b90b8[_0x1202('0x17')](0x194);}else{return db[_0x1202('0x4d')]['destroy']({'where':{'type':_0x1202('0x49'),'resourceId':_0x1de0bf},'cascade':!![],'transaction':_0x8e1046})[_0x1202('0x23')](function(){_0x1b90b8[_0x1202('0x18')](0xcc)[_0x1202('0x19')]();});}})['catch'](function(_0x4a5fc3){_0x1b90b8[_0x1202('0x18')](0x1f4)[_0x1202('0x27')](_0x4a5fc3);});});};exports[_0x1202('0x6b')]=function(_0x4e9d7c,_0x95379,_0x8ae628){return db[_0x1202('0x28')]['findOne']({'where':{'id':_0x4e9d7c[_0x1202('0x40')]['id']}})[_0x1202('0x23')](handleEntityNotFound(_0x95379,null))['then'](function(_0x154abc){if(!_0x4e9d7c['query'][_0x1202('0x6c')]||!utils['isValidChannel'](_0x4e9d7c[_0x1202('0x2f')][_0x1202('0x6c')])){throw new db['Sequelize'][(_0x1202('0x6d'))](_0x1202('0x6e'));}var _0x5a1d57={};var _0x42763c={};_0x42763c['model']=_[_0x1202('0x6f')](db[_[_0x1202('0x70')](_0x4e9d7c[_0x1202('0x2f')][_0x1202('0x6c')][_0x1202('0x71')]())+_0x1202('0x72')][_0x1202('0x29')]);_0x42763c[_0x1202('0x2f')]=_['keys'](_0x4e9d7c[_0x1202('0x2f')]);_0x42763c[_0x1202('0x36')]=_[_0x1202('0x30')](_0x42763c[_0x1202('0x2d')],_0x42763c['query']);_0x5a1d57[_0x1202('0x31')]=_[_0x1202('0x30')](_0x42763c[_0x1202('0x2d')],qs[_0x1202('0x32')](_0x4e9d7c[_0x1202('0x2f')]['fields']));_0x5a1d57[_0x1202('0x31')]=_0x5a1d57['attributes']['length']?_0x5a1d57[_0x1202('0x31')]:_0x42763c[_0x1202('0x2d')];_0x5a1d57[_0x1202('0x1d')]=qs[_0x1202('0x1d')](_0x4e9d7c['query'][_0x1202('0x1d')]);_0x5a1d57[_0x1202('0x1b')]=qs['offset'](_0x4e9d7c[_0x1202('0x2f')][_0x1202('0x1b')]);_0x5a1d57['order']=qs['sort'](_0x4e9d7c['query']['sort']);_0x5a1d57[_0x1202('0x39')]=qs[_0x1202('0x36')](_['pick'](_0x4e9d7c[_0x1202('0x2f')],_0x42763c['filters']));_0x5a1d57=_[_0x1202('0x3a')]({},_0x5a1d57,_0x4e9d7c[_0x1202('0x3c')]);return _0x154abc[_0x1202('0x48')+_[_0x1202('0x70')](_0x4e9d7c[_0x1202('0x2f')]['channel'][_0x1202('0x71')]())+_0x1202('0x73')](_0x5a1d57);})['then'](respondWithResult(_0x95379,null))['catch'](handleError(_0x95379,null));};exports[_0x1202('0x74')]=function(_0x51e779,_0x2a46e9,_0x6d217f){return db[_0x1202('0x28')][_0x1202('0x75')]({'where':{'id':_0x51e779[_0x1202('0x40')]['id']}})[_0x1202('0x23')](function(_0x39a2a6){if(_0x39a2a6){if(!_0x51e779[_0x1202('0x44')]['channel']||!utils[_0x1202('0x76')](_0x51e779['body'][_0x1202('0x6c')])){throw new db['Sequelize'][(_0x1202('0x6d'))]('Unknown\x20channel');}return _0x39a2a6['add'+_['capitalize'](_0x51e779['body'][_0x1202('0x6c')][_0x1202('0x71')]())+_0x1202('0x73')](_0x51e779[_0x1202('0x44')]['ids']);}return null;})[_0x1202('0x23')](handleEntityNotFound(_0x2a46e9,null))[_0x1202('0x23')](respondWithStatusCode(_0x2a46e9,null))['catch'](handleError(_0x2a46e9,null));};exports[_0x1202('0x77')]=function(_0x295f5f,_0xde8d07,_0x25d8d0){return db[_0x1202('0x28')][_0x1202('0x75')]({'where':{'id':_0x295f5f[_0x1202('0x40')]['id']}})['then'](function(_0x509f4c){if(_0x509f4c){if(!_0x295f5f['query'][_0x1202('0x6c')]||!utils[_0x1202('0x76')](_0x295f5f[_0x1202('0x2f')]['channel'])){throw new db['Sequelize'][(_0x1202('0x6d'))](_0x1202('0x6e'));}return _0x509f4c[_0x1202('0x78')+_[_0x1202('0x70')](_0x295f5f[_0x1202('0x2f')][_0x1202('0x6c')][_0x1202('0x71')]())+'Queues'](_0x295f5f['query'][_0x1202('0x79')]);}return null;})[_0x1202('0x23')](handleEntityNotFound(_0xde8d07,null))[_0x1202('0x23')](respondWithStatusCode(_0xde8d07,null))[_0x1202('0x3f')](handleError(_0xde8d07,null));};exports[_0x1202('0x7a')]=function(_0x167ce4,_0x3bf473){var _0x3416c7=_[_0x1202('0x7b')](_0x167ce4[_0x1202('0x44')][_0x1202('0x79')])?_0x167ce4[_0x1202('0x44')][_0x1202('0x79')]:[_0x167ce4['body']['ids']];var _0x4473d2=_0x167ce4[_0x1202('0x40')]['id'];return db[_0x1202('0x28')][_0x1202('0x42')]({'where':{'id':_0x4473d2}})[_0x1202('0x23')](handleEntityNotFound(_0x3bf473,null))['then'](function(_0x40651c){if(_0x40651c){var _0x174993=['Voice',_0x1202('0x7c'),_0x1202('0x7d'),_0x1202('0x7e'),_0x1202('0x7f'),_0x1202('0x80'),'Whatsapp'];return db[_0x1202('0x50')][_0x1202('0x51')](function(_0x5791b3){var _0x3879e0=_[_0x1202('0x2e')](_0x174993,function(_0x17a932){var _0x4d3e65={'attributes':['id',_0x1202('0x26')]};if(_0x17a932===_0x1202('0x81')){_0x4d3e65[_0x1202('0x82')]={'attributes':['penalty']};}return _0x40651c['get'+_0x17a932+_0x1202('0x73')](_0x4d3e65)['then'](function(_0x141d06){var _0x5869fa=_['map'](_0x141d06,function(_0x208a73){var _0x2e836f=_[_0x1202('0x2e')](_0x3416c7,function(_0x225dcc){var _0xa08db5={'where':{'UserId':_0x225dcc,[_0x17a932+_0x1202('0x83')]:_0x208a73['id']},'transaction':_0x5791b3};if(_0x17a932==='Voice'){_0xa08db5[_0x1202('0x15')]={'penalty':_0x208a73[_0x1202('0x84')][_0x1202('0x85')]};}return db[_0x1202('0x86')+_0x17a932+'Queue']['findOrCreate'](_0xa08db5)[_0x1202('0x23')](function(){socket[_0x1202('0x87')](_0x1202('0x45')+_0x17a932+_0x1202('0x88'),{'UserId':_0x225dcc,[_0x17a932+_0x1202('0x83')]:_0x208a73['id']});if(_0x17a932!==_0x1202('0x81')){return;}return db[_0x1202('0x86')]['findAll']({'where':{'id':_0x3416c7,'online':0x1},'attributes':['id',_0x1202('0x26'),'online','voicePause',_0x1202('0x89')],'raw':!![]})['then'](function(_0x430eb6){var _0x9e1398=_['map'](_0x430eb6,function(_0x5a2551){return db[_0x1202('0x8a')][_0x1202('0x8b')]({'membername':_0x5a2551[_0x1202('0x26')],'UserId':_0x5a2551['id'],'queue_name':_0x208a73[_0x1202('0x26')],'VoiceQueueId':_0x208a73['id'],'interface':_[_0x1202('0x8c')](_0x5a2551[_0x1202('0x89')])?util['format'](_0x1202('0x8d'),_0x5a2551[_0x1202('0x26')]):_0x5a2551['interface'],'paused':_0x5a2551[_0x1202('0x8e')]||![],'penalty':_0x208a73[_0x1202('0x84')]['penalty']},{'transaction':_0x5791b3});});return Promise['all'](_0x9e1398);});});});return Promise[_0x1202('0x8f')](_0x2e836f);});return Promise[_0x1202('0x8f')](_0x5869fa);})['then'](function(){return db[_0x1202('0x68')][_0x1202('0x75')]({'where':{'teamId':_0x4473d2}})[_0x1202('0x23')](function(_0x1bb674){if(_0x1bb674){var _0x47698c=_[_0x1202('0x2e')](_0x3416c7,function(_0x308191){db[_0x1202('0x69')]['upsert']({'UserId':_0x308191,'VoicePrefixId':_0x1bb674[_0x1202('0x6a')]});});return Promise[_0x1202('0x8f')](_0x47698c);}});});});return Promise[_0x1202('0x8f')](_0x3879e0)['then'](function(){return _0x40651c[_0x1202('0x7a')](_0x3416c7,{'transaction':_0x5791b3})['spread'](function(_0x2c10a0){return _0x2c10a0;});});});}})[_0x1202('0x23')](respondWithResult(_0x3bf473,null))[_0x1202('0x3f')](handleError(_0x3bf473,null));};exports['removeAgents']=function(_0x435024,_0x4d2bf8){var _0x3d9d01=_[_0x1202('0x7b')](_0x435024[_0x1202('0x2f')][_0x1202('0x79')])?_0x435024[_0x1202('0x2f')][_0x1202('0x79')]:[_0x435024['query'][_0x1202('0x79')]];var _0x3af00a=_0x435024[_0x1202('0x40')]['id'];return db[_0x1202('0x28')][_0x1202('0x42')]({'where':{'id':_0x3af00a}})[_0x1202('0x23')](handleEntityNotFound(_0x4d2bf8,null))[_0x1202('0x23')](function(_0x4dc365){if(_0x4dc365){var _0x27c0d4=[_0x1202('0x81'),_0x1202('0x7c'),'Mail',_0x1202('0x7e'),_0x1202('0x7f'),_0x1202('0x80'),_0x1202('0x90')];return db[_0x1202('0x50')][_0x1202('0x51')](function(_0x398404){var _0x318196=_[_0x1202('0x2e')](_0x27c0d4,function(_0x20f80a){var _0x53949d={'attributes':['id','name']};return _0x4dc365['get'+_0x20f80a+'Queues'](_0x53949d)['then'](function(_0x15a7bd){var _0x327794=_[_0x1202('0x2e')](_0x15a7bd,function(_0x3c0d26){return _0x3c0d26[_0x1202('0x91')](_0x3d9d01,{'transaction':_0x398404})[_0x1202('0x23')](function(){var _0x2be188=_[_0x1202('0x2e')](_0x3d9d01,function(_0x22d67c){socket[_0x1202('0x87')](_0x1202('0x45')+_0x20f80a+'Queue:remove',{'UserId':Number(_0x22d67c),[_0x20f80a+_0x1202('0x83')]:_0x3c0d26['id']});if(_0x20f80a!==_0x1202('0x81')){return;}return db[_0x1202('0x8a')][_0x1202('0x4f')]({'where':{'VoiceQueueId':_0x3c0d26['id'],'UserId':_0x22d67c},'transaction':_0x398404});});return Promise[_0x1202('0x8f')](_0x2be188);});});return Promise[_0x1202('0x8f')](_0x327794);});});return Promise['all'](_0x318196)['then'](function(){return _0x4dc365[_0x1202('0x91')](_0x3d9d01,{'transaction':_0x398404});})[_0x1202('0x23')](function(){return db[_0x1202('0x68')]['findOne']({'where':{'teamId':_0x3af00a}})[_0x1202('0x23')](function(_0x45b528){if(_0x45b528){var _0x4c0eda=_[_0x1202('0x2e')](_0x3d9d01,function(_0x349adf){db[_0x1202('0x69')][_0x1202('0x4f')]({'where':{'UserId':_0x349adf,'VoicePrefixId':_0x45b528[_0x1202('0x6a')]}});});return Promise[_0x1202('0x8f')](_0x4c0eda);}});});});}})[_0x1202('0x23')](respondWithStatusCode(_0x4d2bf8,null))[_0x1202('0x3f')](handleError(_0x4d2bf8,null));};exports[_0x1202('0x92')]=function(_0x2f8ab8,_0x3743d7,_0xd62185){var _0x2ec0a4={};var _0x57855d={};var _0x41db2c;var _0x19c26b;return db['Team'][_0x1202('0x75')]({'where':{'id':_0x2f8ab8['params']['id']}})['then'](handleEntityNotFound(_0x3743d7,null))[_0x1202('0x23')](function(_0x2e3902){if(_0x2e3902){_0x41db2c=_0x2e3902;_0x57855d[_0x1202('0x2d')]=_[_0x1202('0x6f')](db[_0x1202('0x86')][_0x1202('0x29')]);_0x57855d[_0x1202('0x2f')]=_[_0x1202('0x6f')](_0x2f8ab8[_0x1202('0x2f')]);_0x57855d['filters']=_[_0x1202('0x30')](_0x57855d['model'],_0x57855d[_0x1202('0x2f')]);_0x2ec0a4[_0x1202('0x31')]=_[_0x1202('0x30')](_0x57855d[_0x1202('0x2d')],qs[_0x1202('0x32')](_0x2f8ab8['query'][_0x1202('0x32')]));_0x2ec0a4[_0x1202('0x31')]=_0x2ec0a4[_0x1202('0x31')]['length']?_0x2ec0a4[_0x1202('0x31')]:_0x57855d[_0x1202('0x2d')];_0x2ec0a4[_0x1202('0x34')]=qs['sort'](_0x2f8ab8['query']['sort']);_0x2ec0a4[_0x1202('0x39')]=qs['filters'](_[_0x1202('0x37')](_0x2f8ab8[_0x1202('0x2f')],_0x57855d['filters']));if(_0x2f8ab8['query'][_0x1202('0x38')]){_0x2ec0a4[_0x1202('0x39')]=_['merge'](_0x2ec0a4[_0x1202('0x39')],{'$or':_['map'](_0x2ec0a4[_0x1202('0x31')],function(_0x1796e6){var _0x110fa4={};_0x110fa4[_0x1796e6]={'$like':'%'+_0x2f8ab8[_0x1202('0x2f')][_0x1202('0x38')]+'%'};return _0x110fa4;})});}_0x2ec0a4=_[_0x1202('0x3a')]({},_0x2ec0a4,_0x2f8ab8['options']);return _0x41db2c[_0x1202('0x92')](_0x2ec0a4);}})[_0x1202('0x23')](function(_0x429069){if(_0x429069){_0x19c26b=_0x429069[_0x1202('0x41')];if(!_0x2f8ab8['query'][_0x1202('0x33')](_0x1202('0x93'))){_0x2ec0a4['limit']=qs[_0x1202('0x1d')](_0x2f8ab8[_0x1202('0x2f')]['limit']);_0x2ec0a4['offset']=qs[_0x1202('0x1b')](_0x2f8ab8[_0x1202('0x2f')]['offset']);}return _0x41db2c[_0x1202('0x92')](_0x2ec0a4);}})[_0x1202('0x23')](function(_0x199a0b){if(_0x199a0b){return _0x199a0b?{'count':_0x19c26b,'rows':_0x199a0b}:null;}})[_0x1202('0x23')](respondWithResult(_0x3743d7,null))[_0x1202('0x3f')](handleError(_0x3743d7,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 12d338f..9acc585 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 _0x509c=['events','../../mysqldb','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x11c391,_0x39cbf0){var _0x338312=function(_0x55905f){while(--_0x55905f){_0x11c391['push'](_0x11c391['shift']());}};_0x338312(++_0x39cbf0);}(_0x509c,0x1d0));var _0xc509=function(_0x27a0c3,_0x4809e1){_0x27a0c3=_0x27a0c3-0x0;var _0x3f628a=_0x509c[_0x27a0c3];return _0x3f628a;};'use strict';var EventEmitter=require(_0xc509('0x0'));var Team=require(_0xc509('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc509('0x2'),'afterUpdate':_0xc509('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5f41de){return function(_0x1ec812,_0x1e8e99,_0x540fdb){TeamEvents['emit'](_0x5f41de+':'+_0x1ec812['id'],_0x1ec812);TeamEvents[_0xc509('0x4')](_0x5f41de,_0x1ec812);_0x540fdb(null);};}for(var e in events){if(events[_0xc509('0x5')](e)){var event=events[e];Team[_0xc509('0x6')](e,emitEvent(event));}}module[_0xc509('0x7')]=TeamEvents; \ No newline at end of file +var _0x5cc0=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','remove'];(function(_0x179cce,_0x239422){var _0x54ac6d=function(_0x21a7f0){while(--_0x21a7f0){_0x179cce['push'](_0x179cce['shift']());}};_0x54ac6d(++_0x239422);}(_0x5cc0,0xc2));var _0x05cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5cc0[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x05cc('0x0'));var Team=require(_0x05cc('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x05cc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x05cc('0x3')};function emitEvent(_0x4c95f9){return function(_0x41efe1,_0x2e0784,_0x5d0db8){TeamEvents[_0x05cc('0x4')](_0x4c95f9+':'+_0x41efe1['id'],_0x41efe1);TeamEvents[_0x05cc('0x4')](_0x4c95f9,_0x41efe1);_0x5d0db8(null);};}for(var e in events){if(events[_0x05cc('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 9a3e071..0a23f77 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 _0xaf66=['teams','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team'];(function(_0x18e80c,_0x4077f7){var _0x183ba9=function(_0x2f8947){while(--_0x2f8947){_0x18e80c['push'](_0x18e80c['shift']());}};_0x183ba9(++_0x4077f7);}(_0xaf66,0x145));var _0x6af6=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0xaf66[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x6af6('0x0'));var util=require('util');var logger=require(_0x6af6('0x1'))(_0x6af6('0x2'));var moment=require('moment');var BPromise=require(_0x6af6('0x3'));var rp=require(_0x6af6('0x4'));var fs=require('fs');var path=require(_0x6af6('0x5'));var rimraf=require(_0x6af6('0x6'));var config=require(_0x6af6('0x7'));var attributes=require(_0x6af6('0x8'));module['exports']=function(_0x2bfbf4,_0x13e744){return _0x2bfbf4[_0x6af6('0x9')](_0x6af6('0xa'),attributes,{'tableName':_0x6af6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad1f=['request-promise','./team.attributes','exports','define','Team','teams','util','../../config/logger','api','moment'];(function(_0x2006e8,_0x16e3f6){var _0x5135da=function(_0x4f4712){while(--_0x4f4712){_0x2006e8['push'](_0x2006e8['shift']());}};_0x5135da(++_0x16e3f6);}(_0xad1f,0x178));var _0xfad1=function(_0x4da83c,_0x28262b){_0x4da83c=_0x4da83c-0x0;var _0x4aa347=_0xad1f[_0x4da83c];return _0x4aa347;};'use strict';var _=require('lodash');var util=require(_0xfad1('0x0'));var logger=require(_0xfad1('0x1'))(_0xfad1('0x2'));var moment=require(_0xfad1('0x3'));var BPromise=require('bluebird');var rp=require(_0xfad1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfad1('0x5'));module[_0xfad1('0x6')]=function(_0x7cd2a7,_0x11c5fa){return _0x7cd2a7[_0xfad1('0x7')](_0xfad1('0x8'),attributes,{'tableName':_0xfad1('0x9'),'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 ee0eecc..ae6401c 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 _0x51b0=['error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xa21387,_0x455889){var _0x5f4536=function(_0x2e1762){while(--_0x2e1762){_0xa21387['push'](_0xa21387['shift']());}};_0x5f4536(++_0x455889);}(_0x51b0,0x81));var _0x051b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x51b0[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x051b('0x0'));var BPromise=require(_0x051b('0x1'));var rs=require(_0x051b('0x2'));var fs=require('fs');var Redis=require(_0x051b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x051b('0x4'))(_0x051b('0x5'));var config=require('../../config/environment');var jayson=require(_0x051b('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x051b('0x7')]=_[_0x051b('0x8')](config[_0x051b('0x7')],{'host':_0x051b('0x9'),'port':0x18eb});var socket=require(_0x051b('0xa'))(new Redis(config[_0x051b('0x7')]));require(_0x051b('0xb'))[_0x051b('0xc')](socket);function respondWithRpcPromise(_0x38c7de,_0x279d41,_0x32c7bc){return new BPromise(function(_0x1f23dc,_0x53277a){return client[_0x051b('0xd')](_0x38c7de,_0x32c7bc)[_0x051b('0xe')](function(_0x12ba73){logger[_0x051b('0xf')](_0x051b('0x10'),_0x279d41,_0x051b('0x11'));logger[_0x051b('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x279d41,_0x051b('0x11'),JSON[_0x051b('0x13')](_0x12ba73));if(_0x12ba73['error']){if(_0x12ba73['error'][_0x051b('0x14')]===0x1f4){logger['error'](_0x051b('0x10'),_0x279d41,_0x12ba73[_0x051b('0x15')][_0x051b('0x16')]);return _0x53277a(_0x12ba73['error']['message']);}logger[_0x051b('0x15')](_0x051b('0x10'),_0x279d41,_0x12ba73['error']['message']);return _0x1f23dc(_0x12ba73['error']['message']);}else{logger['info'](_0x051b('0x10'),_0x279d41,_0x051b('0x11'));_0x1f23dc(_0x12ba73[_0x051b('0x17')][_0x051b('0x16')]);}})[_0x051b('0x18')](function(_0x7ae821){logger[_0x051b('0x15')](_0x051b('0x10'),_0x279d41,_0x7ae821);_0x53277a(_0x7ae821);});});} \ No newline at end of file +var _0x0869=['debug','stringify','error','message','Team,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./team.socket','register','request\x20sent'];(function(_0x1dd544,_0x4d9c96){var _0x223607=function(_0x5d34ed){while(--_0x5d34ed){_0x1dd544['push'](_0x1dd544['shift']());}};_0x223607(++_0x4d9c96);}(_0x0869,0xaf));var _0x9086=function(_0xfbe764,_0x416aa3){_0xfbe764=_0xfbe764-0x0;var _0x17bdb6=_0x0869[_0xfbe764];return _0x17bdb6;};'use strict';var _=require(_0x9086('0x0'));var util=require(_0x9086('0x1'));var moment=require(_0x9086('0x2'));var BPromise=require(_0x9086('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9086('0x4'));var db=require(_0x9086('0x5'))['db'];var utils=require(_0x9086('0x6'));var logger=require(_0x9086('0x7'))(_0x9086('0x8'));var config=require(_0x9086('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9086('0xa')][_0x9086('0xb')]({'port':0x232a});config[_0x9086('0xc')]=_['defaults'](config[_0x9086('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9086('0xd'))(new Redis(config[_0x9086('0xc')]));require(_0x9086('0xe'))[_0x9086('0xf')](socket);function respondWithRpcPromise(_0x107cc5,_0x1b1fda,_0x317cd3){return new BPromise(function(_0x43c230,_0x5a801e){return client['request'](_0x107cc5,_0x317cd3)['then'](function(_0x3179aa){logger['info']('Team,\x20%s,\x20%s',_0x1b1fda,_0x9086('0x10'));logger[_0x9086('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x1b1fda,_0x9086('0x10'),JSON[_0x9086('0x12')](_0x3179aa));if(_0x3179aa[_0x9086('0x13')]){if(_0x3179aa[_0x9086('0x13')]['code']===0x1f4){logger[_0x9086('0x13')]('Team,\x20%s,\x20%s',_0x1b1fda,_0x3179aa['error']['message']);return _0x5a801e(_0x3179aa[_0x9086('0x13')][_0x9086('0x14')]);}logger[_0x9086('0x13')]('Team,\x20%s,\x20%s',_0x1b1fda,_0x3179aa[_0x9086('0x13')][_0x9086('0x14')]);return _0x43c230(_0x3179aa['error']['message']);}else{logger['info'](_0x9086('0x15'),_0x1b1fda,_0x9086('0x10'));_0x43c230(_0x3179aa[_0x9086('0x16')][_0x9086('0x14')]);}})[_0x9086('0x17')](function(_0x29f450){logger['error'](_0x9086('0x15'),_0x1b1fda,_0x29f450);_0x5a801e(_0x29f450);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2e00334..19c8e02 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 _0x6487=['team:','./team.events','emit','removeListener','register','length'];(function(_0x4372b4,_0x548c68){var _0x5d48bd=function(_0xcdbc44){while(--_0xcdbc44){_0x4372b4['push'](_0x4372b4['shift']());}};_0x5d48bd(++_0x548c68);}(_0x6487,0x19f));var _0x7648=function(_0x4be809,_0x5d7102){_0x4be809=_0x4be809-0x0;var _0x3aebe6=_0x6487[_0x4be809];return _0x3aebe6;};'use strict';var TeamEvents=require(_0x7648('0x0'));var events=['save','remove','update'];function createListener(_0x322da0,_0x93db45){return function(_0x27fe87){_0x93db45[_0x7648('0x1')](_0x322da0,_0x27fe87);};}function removeListener(_0x4aaff7,_0x21402c){return function(){TeamEvents[_0x7648('0x2')](_0x4aaff7,_0x21402c);};}exports[_0x7648('0x3')]=function(_0xc007d2){for(var _0x4da4a1=0x0,_0x5d6f08=events[_0x7648('0x4')];_0x4da4a1<_0x5d6f08;_0x4da4a1++){var _0x52a6a9=events[_0x4da4a1];var _0x23d012=createListener(_0x7648('0x5')+_0x52a6a9,_0xc007d2);TeamEvents['on'](_0x52a6a9,_0x23d012);}}; \ No newline at end of file +var _0xf95a=['emit','removeListener','register','length','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf95a,0xd6));var _0xaf95=function(_0x4a97b0,_0x2af7d9){_0x4a97b0=_0x4a97b0-0x0;var _0x165e0b=_0xf95a[_0x4a97b0];return _0x165e0b;};'use strict';var TeamEvents=require('./team.events');var events=[_0xaf95('0x0'),'remove',_0xaf95('0x1')];function createListener(_0xbbbb8a,_0x55170c){return function(_0x458b42){_0x55170c[_0xaf95('0x2')](_0xbbbb8a,_0x458b42);};}function removeListener(_0x508dc3,_0x416374){return function(){TeamEvents[_0xaf95('0x3')](_0x508dc3,_0x416374);};}exports[_0xaf95('0x4')]=function(_0x247c79){for(var _0x159c4c=0x0,_0x2e9df2=events[_0xaf95('0x5')];_0x159c4c<_0x2e9df2;_0x159c4c++){var _0x3029ee=events[_0x159c4c];var _0x546824=createListener('team:'+_0x3029ee,_0x247c79);TeamEvents['on'](_0x3029ee,_0x546824);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c34f0cc..bfbe440 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0fd=['exports','sequelize'];(function(_0x4fddd8,_0x39898d){var _0x311727=function(_0x557635){while(--_0x557635){_0x4fddd8['push'](_0x4fddd8['shift']());}};_0x311727(++_0x39898d);}(_0xe0fd,0x1bb));var _0xde0f=function(_0x4b1cd0,_0x1981cb){_0x4b1cd0=_0x4b1cd0-0x0;var _0x398a39=_0xe0fd[_0x4b1cd0];return _0x398a39;};'use strict';var Sequelize=require(_0xde0f('0x0'));module[_0xde0f('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbd3b=['INTEGER','sequelize','exports'];(function(_0x5b2e3d,_0x2d7f7b){var _0x35a13c=function(_0x831acc){while(--_0x831acc){_0x5b2e3d['push'](_0x5b2e3d['shift']());}};_0x35a13c(++_0x2d7f7b);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x16270b,_0x4ff120){_0x16270b=_0x16270b-0x0;var _0x2cd122=_0xbd3b[_0x16270b];return _0x2cd122;};'use strict';var Sequelize=require(_0xbbd3('0x0'));module[_0xbbd3('0x1')]={'TeamId':{'type':Sequelize[_0xbbd3('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 33c3db4..28eb6ab 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe13=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./teamVoicePrefix.attributes'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xfe13,0x178));var _0x3fe1=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xfe13[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x3fe1('0x0'));var util=require('util');var logger=require(_0x3fe1('0x1'))(_0x3fe1('0x2'));var moment=require(_0x3fe1('0x3'));var BPromise=require(_0x3fe1('0x4'));var rp=require(_0x3fe1('0x5'));var fs=require('fs');var path=require(_0x3fe1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fe1('0x7'));module[_0x3fe1('0x8')]=function(_0x2c5ed2,_0x5caa2e){return _0x2c5ed2[_0x3fe1('0x9')](_0x3fe1('0xa'),attributes,{'tableName':_0x3fe1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dc0=['./teamVoicePrefix.attributes','define','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3fcda7,_0x2af810){var _0x39af34=function(_0x2b0192){while(--_0x2b0192){_0x3fcda7['push'](_0x3fcda7['shift']());}};_0x39af34(++_0x2af810);}(_0x4dc0,0x13d));var _0x04dc=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4dc0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04dc('0x0'))(_0x04dc('0x1'));var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var rp=require(_0x04dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04dc('0x5'));var config=require(_0x04dc('0x6'));var attributes=require(_0x04dc('0x7'));module['exports']=function(_0x224df5,_0x40b21a){return _0x224df5[_0x04dc('0x8')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b9374c3..45388c4 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f87ce,_0x4abd6c){var _0x8d7035=function(_0x5aa071){while(--_0x5aa071){_0x3f87ce['push'](_0x3f87ce['shift']());}};_0x8d7035(++_0x4abd6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x152374,_0x3d4aa2){var _0xd84978=function(_0x572791){while(--_0x572791){_0x152374['push'](_0x152374['shift']());}};_0xd84978(++_0x3d4aa2);}(_0x70e0,0x17b));var _0x070e=function(_0x3675d6,_0x111372){_0x3675d6=_0x3675d6-0x0;var _0x1b6c84=_0x70e0[_0x3675d6];return _0x1b6c84;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 642b7c0..5a13fb9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8812=['INTEGER','sequelize','exports'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x8812,0x154));var _0x2881=function(_0x1fe735,_0x4cd180){_0x1fe735=_0x1fe735-0x0;var _0x444a1d=_0x8812[_0x1fe735];return _0x444a1d;};'use strict';var Sequelize=require(_0x2881('0x0'));module[_0x2881('0x1')]={'penalty':{'type':Sequelize[_0x2881('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b9d=['sequelize','exports','INTEGER'];(function(_0x35ced4,_0x397162){var _0x265f45=function(_0x2fa128){while(--_0x2fa128){_0x35ced4['push'](_0x35ced4['shift']());}};_0x265f45(++_0x397162);}(_0x6b9d,0xed));var _0xd6b9=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x6b9d[_0x3f4891];return _0x54f2d8;};'use strict';var Sequelize=require(_0xd6b9('0x0'));module[_0xd6b9('0x1')]={'penalty':{'type':Sequelize[_0xd6b9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 5540271..cf00d12 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x689c=['moment','bluebird','request-promise','path','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api'];(function(_0x52bb85,_0x1f6cc1){var _0x417a58=function(_0x332d31){while(--_0x332d31){_0x52bb85['push'](_0x52bb85['shift']());}};_0x417a58(++_0x1f6cc1);}(_0x689c,0x9e));var _0xc689=function(_0x5aeab2,_0x49a694){_0x5aeab2=_0x5aeab2-0x0;var _0xde89e=_0x689c[_0x5aeab2];return _0xde89e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc689('0x0'))(_0xc689('0x1'));var moment=require(_0xc689('0x2'));var BPromise=require(_0xc689('0x3'));var rp=require(_0xc689('0x4'));var fs=require('fs');var path=require(_0xc689('0x5'));var rimraf=require('rimraf');var config=require(_0xc689('0x6'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x3a4916,_0x28ce4c){return _0x3a4916[_0xc689('0x7')](_0xc689('0x8'),attributes,{'tableName':_0xc689('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44d4=['TeamVoiceQueue','lodash','moment','bluebird','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x4e2c5f,_0x8522d4){var _0xf65832=function(_0x373af8){while(--_0x373af8){_0x4e2c5f['push'](_0x4e2c5f['shift']());}};_0xf65832(++_0x8522d4);}(_0x44d4,0x161));var _0x444d=function(_0x463bde,_0x23282c){_0x463bde=_0x463bde-0x0;var _0x3c73c3=_0x44d4[_0x463bde];return _0x3c73c3;};'use strict';var _=require(_0x444d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x444d('0x1'));var BPromise=require(_0x444d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x444d('0x3'));var attributes=require(_0x444d('0x4'));module[_0x444d('0x5')]=function(_0x24f601,_0x45dfdb){return _0x24f601[_0x444d('0x6')](_0x444d('0x7'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index f9dfdc5..c9e28c9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44af=['info','request\x20sent','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4b4160,_0xb7f230){var _0x157952=function(_0x4df22d){while(--_0x4df22d){_0x4b4160['push'](_0x4b4160['shift']());}};_0x157952(++_0xb7f230);}(_0x44af,0xc5));var _0xf44a=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x44af[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf44a('0x0'));var BPromise=require(_0xf44a('0x1'));var rs=require(_0xf44a('0x2'));var fs=require('fs');var Redis=require(_0xf44a('0x3'));var db=require(_0xf44a('0x4'))['db'];var utils=require(_0xf44a('0x5'));var logger=require('../../config/logger')(_0xf44a('0x6'));var config=require(_0xf44a('0x7'));var jayson=require(_0xf44a('0x8'));var client=jayson[_0xf44a('0x9')][_0xf44a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c550,_0x971b34,_0x2bf323){return new BPromise(function(_0x4117bf,_0x5b249f){return client[_0xf44a('0xb')](_0x38c550,_0x2bf323)[_0xf44a('0xc')](function(_0x3bda51){logger[_0xf44a('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x971b34,_0xf44a('0xe'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x971b34,_0xf44a('0xe'),JSON['stringify'](_0x3bda51));if(_0x3bda51[_0xf44a('0xf')]){if(_0x3bda51['error'][_0xf44a('0x10')]===0x1f4){logger[_0xf44a('0xf')](_0xf44a('0x11'),_0x971b34,_0x3bda51[_0xf44a('0xf')][_0xf44a('0x12')]);return _0x5b249f(_0x3bda51['error'][_0xf44a('0x12')]);}logger[_0xf44a('0xf')](_0xf44a('0x11'),_0x971b34,_0x3bda51[_0xf44a('0xf')][_0xf44a('0x12')]);return _0x4117bf(_0x3bda51['error'][_0xf44a('0x12')]);}else{logger[_0xf44a('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x971b34,'request\x20sent');_0x4117bf(_0x3bda51[_0xf44a('0x13')][_0xf44a('0x12')]);}})[_0xf44a('0x14')](function(_0x3f265b){logger[_0xf44a('0xf')](_0xf44a('0x11'),_0x971b34,_0x3f265b);_0x5b249f(_0x3f265b);});});} \ No newline at end of file +var _0xbef6=['rpc','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbef6,0x1b0));var _0x6bef=function(_0x34692f,_0x4ebd44){_0x34692f=_0x34692f-0x0;var _0x2b543b=_0xbef6[_0x34692f];return _0x2b543b;};'use strict';var _=require(_0x6bef('0x0'));var util=require(_0x6bef('0x1'));var moment=require('moment');var BPromise=require(_0x6bef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6bef('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bef('0x4'))(_0x6bef('0x5'));var config=require('../../config/environment');var jayson=require(_0x6bef('0x6'));var client=jayson[_0x6bef('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a59d,_0x7e58a9,_0x590b4c){return new BPromise(function(_0x4d47d0,_0x30639d){return client[_0x6bef('0x8')](_0x11a59d,_0x590b4c)[_0x6bef('0x9')](function(_0x19d992){logger[_0x6bef('0xa')](_0x6bef('0xb'),_0x7e58a9,_0x6bef('0xc'));logger[_0x6bef('0xd')](_0x6bef('0xe'),_0x7e58a9,_0x6bef('0xc'),JSON[_0x6bef('0xf')](_0x19d992));if(_0x19d992[_0x6bef('0x10')]){if(_0x19d992[_0x6bef('0x10')]['code']===0x1f4){logger[_0x6bef('0x10')](_0x6bef('0xb'),_0x7e58a9,_0x19d992[_0x6bef('0x10')][_0x6bef('0x11')]);return _0x30639d(_0x19d992[_0x6bef('0x10')][_0x6bef('0x11')]);}logger[_0x6bef('0x10')](_0x6bef('0xb'),_0x7e58a9,_0x19d992[_0x6bef('0x10')][_0x6bef('0x11')]);return _0x4d47d0(_0x19d992[_0x6bef('0x10')][_0x6bef('0x11')]);}else{logger[_0x6bef('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x7e58a9,_0x6bef('0xc'));_0x4d47d0(_0x19d992['result'][_0x6bef('0x11')]);}})[_0x6bef('0x12')](function(_0x35bd32){logger[_0x6bef('0x10')](_0x6bef('0xb'),_0x7e58a9,_0x35bd32);_0x30639d(_0x35bd32);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d441acc..8cf8ab9 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 _0x5458=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1e243a,_0x412fd0){var _0x561939=function(_0x25b5f8){while(--_0x25b5f8){_0x1e243a['push'](_0x1e243a['shift']());}};_0x561939(++_0x412fd0);}(_0x5458,0x1c7));var _0x8545=function(_0x2484e4,_0x4827a0){_0x2484e4=_0x2484e4-0x0;var _0x3e00e0=_0x5458[_0x2484e4];return _0x3e00e0;};'use strict';var multer=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var path=require(_0x8545('0x2'));var timeout=require('connect-timeout');var express=require(_0x8545('0x3'));var router=express[_0x8545('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8545('0x5'));var interaction=require(_0x8545('0x6'));var config=require(_0x8545('0x7'));var controller=require('./template.controller');router[_0x8545('0x8')]('/',auth[_0x8545('0x9')](),controller[_0x8545('0xa')]);router[_0x8545('0x8')]('/:id',auth[_0x8545('0x9')](),controller['show']);router[_0x8545('0xb')]('/',auth[_0x8545('0x9')](),controller[_0x8545('0xc')]);router[_0x8545('0xd')](_0x8545('0xe'),auth[_0x8545('0x9')](),controller[_0x8545('0xf')]);router[_0x8545('0x10')]('/:id',auth[_0x8545('0x9')](),controller[_0x8545('0x11')]);module[_0x8545('0x12')]=router; \ No newline at end of file +var _0x505d=['Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','post','update','destroy','path','connect-timeout','express'];(function(_0x291354,_0x1ee76c){var _0x31da9c=function(_0x4fda3b){while(--_0x4fda3b){_0x291354['push'](_0x291354['shift']());}};_0x31da9c(++_0x1ee76c);}(_0x505d,0x93));var _0xd505=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x505d[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd505('0x0'));var timeout=require(_0xd505('0x1'));var express=require(_0xd505('0x2'));var router=express[_0xd505('0x3')]();var fs_extra=require(_0xd505('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd505('0x5'));var config=require(_0xd505('0x6'));var controller=require(_0xd505('0x7'));router[_0xd505('0x8')]('/',auth['isAuthenticated'](),controller[_0xd505('0x9')]);router['get'](_0xd505('0xa'),auth[_0xd505('0xb')](),controller['show']);router[_0xd505('0xc')]('/',auth[_0xd505('0xb')](),controller['create']);router['put'](_0xd505('0xa'),auth['isAuthenticated'](),controller[_0xd505('0xd')]);router['delete'](_0xd505('0xa'),auth['isAuthenticated'](),controller[_0xd505('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 31d10db..0aa07db 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 _0xe726=['sequelize','exports','STRING','TEXT'];(function(_0x5b3b6a,_0x906f49){var _0x4a9af7=function(_0x435c41){while(--_0x435c41){_0x5b3b6a['push'](_0x5b3b6a['shift']());}};_0x4a9af7(++_0x906f49);}(_0xe726,0x1e8));var _0x6e72=function(_0x17fd33,_0x2853a1){_0x17fd33=_0x17fd33-0x0;var _0x14a692=_0xe726[_0x17fd33];return _0x14a692;};'use strict';var Sequelize=require(_0x6e72('0x0'));module[_0x6e72('0x1')]={'name':{'type':Sequelize[_0x6e72('0x2')]},'description':{'type':Sequelize[_0x6e72('0x2')]},'html':{'type':Sequelize[_0x6e72('0x3')]}}; \ No newline at end of file +var _0x0d39=['exports','STRING','TEXT'];(function(_0x3d78b5,_0x4936ed){var _0x380d7b=function(_0x1b7bf8){while(--_0x1b7bf8){_0x3d78b5['push'](_0x3d78b5['shift']());}};_0x380d7b(++_0x4936ed);}(_0x0d39,0x17d));var _0x90d3=function(_0x1b76a6,_0x3cfd08){_0x1b76a6=_0x1b76a6-0x0;var _0x37198f=_0x0d39[_0x1b76a6];return _0x37198f;};'use strict';var Sequelize=require('sequelize');module[_0x90d3('0x0')]={'name':{'type':Sequelize[_0x90d3('0x1')]},'description':{'type':Sequelize[_0x90d3('0x1')]},'html':{'type':Sequelize[_0x90d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 368ce66..2aa9b34 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 _0x098c=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','error','stack','name','map','Template','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','filter','options','where','include','findAll','rows','show','keys','includeAll','find','catch','create'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0x098c,0x161));var _0xc098=function(_0x5dec4c,_0x5ae5f9){_0x5dec4c=_0x5dec4c-0x0;var _0x131fb5=_0x098c[_0x5dec4c];return _0x131fb5;};'use strict';var emlformat=require(_0xc098('0x0'));var rimraf=require(_0xc098('0x1'));var zipdir=require(_0xc098('0x2'));var jsonpatch=require(_0xc098('0x3'));var rp=require(_0xc098('0x4'));var moment=require('moment');var BPromise=require(_0xc098('0x5'));var Mustache=require(_0xc098('0x6'));var util=require(_0xc098('0x7'));var path=require(_0xc098('0x8'));var sox=require(_0xc098('0x9'));var csv=require(_0xc098('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc098('0xb'));var _=require(_0xc098('0xc'));var squel=require(_0xc098('0xd'));var crypto=require(_0xc098('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc098('0xf'));var Papa=require(_0xc098('0x10'));var Redis=require(_0xc098('0x11'));var authService=require(_0xc098('0x12'));var qs=require(_0xc098('0x13'));var as=require(_0xc098('0x14'));var hardwareService=require(_0xc098('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc098('0x16'));var config=require(_0xc098('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc098('0x18'))['db'];function respondWithStatusCode(_0x2e4f1a,_0x1fc939){_0x1fc939=_0x1fc939||0xcc;return function(_0x2cb558){if(_0x2cb558){return _0x2e4f1a[_0xc098('0x19')](_0x1fc939);}return _0x2e4f1a['status'](_0x1fc939)[_0xc098('0x1a')]();};}function respondWithResult(_0x2bd9f0,_0x2a9538){_0x2a9538=_0x2a9538||0xc8;return function(_0x1eb76b){if(_0x1eb76b){return _0x2bd9f0['status'](_0x2a9538)[_0xc098('0x1b')](_0x1eb76b);}};}function respondWithFilteredResult(_0x4996c3,_0x297ce4){return function(_0x25c05a){if(_0x25c05a){var _0x4e6be6=typeof _0x297ce4[_0xc098('0x1c')]===_0xc098('0x1d')&&typeof _0x297ce4[_0xc098('0x1e')]===_0xc098('0x1d');var _0x46c270=_0x25c05a[_0xc098('0x1f')];var _0x462b97=_0x4e6be6?0x0:_0x297ce4[_0xc098('0x1c')];var _0x448750=_0x4e6be6?_0x25c05a[_0xc098('0x1f')]:_0x297ce4[_0xc098('0x1c')]+_0x297ce4[_0xc098('0x1e')];var _0xe45b4e;if(_0x448750>=_0x46c270){_0x448750=_0x46c270;_0xe45b4e=0xc8;}else{_0xe45b4e=0xce;}_0x4996c3[_0xc098('0x20')](_0xe45b4e);return _0x4996c3[_0xc098('0x21')](_0xc098('0x22'),_0x462b97+'-'+_0x448750+'/'+_0x46c270)[_0xc098('0x1b')](_0x25c05a);}return null;};}function patchUpdates(_0xb02975){return function(_0x331793){try{jsonpatch[_0xc098('0x23')](_0x331793,_0xb02975,!![]);}catch(_0x1b0ee3){return BPromise[_0xc098('0x24')](_0x1b0ee3);}return _0x331793[_0xc098('0x25')]();};}function saveUpdates(_0x523d82,_0x98757d){return function(_0x59fc04){if(_0x59fc04){return _0x59fc04[_0xc098('0x26')](_0x523d82)[_0xc098('0x27')](function(_0x6fdeea){return _0x6fdeea;});}return null;};}function removeEntity(_0x550466,_0x415a85){return function(_0x572b36){if(_0x572b36){return _0x572b36[_0xc098('0x28')]()[_0xc098('0x27')](function(){var _0x1e6ab8=_0x572b36['get']({'plain':!![]});var _0x1645ad=_0xc098('0x29');return db[_0xc098('0x2a')][_0xc098('0x28')]({'where':{'type':_0x1645ad,'resourceId':_0x1e6ab8['id']}})[_0xc098('0x27')](function(){return _0x572b36;});})[_0xc098('0x27')](function(){_0x550466[_0xc098('0x20')](0xcc)[_0xc098('0x1a')]();});}};}function handleEntityNotFound(_0x529830,_0x583533){return function(_0x458cb3){if(!_0x458cb3){_0x529830[_0xc098('0x19')](0x194);}return _0x458cb3;};}function handleError(_0x4c04da,_0x48a7c3){_0x48a7c3=_0x48a7c3||0x1f4;return function(_0x1eb4a7){logger[_0xc098('0x2b')](_0x1eb4a7[_0xc098('0x2c')]);if(_0x1eb4a7[_0xc098('0x2d')]){delete _0x1eb4a7[_0xc098('0x2d')];}_0x4c04da[_0xc098('0x20')](_0x48a7c3)['send'](_0x1eb4a7);};}exports['index']=function(_0x2a734c,_0x17d747){var _0x1c3496={},_0x442dcc={},_0x538922={'count':0x0,'rows':[]};var _0x5a8ebb=_[_0xc098('0x2e')](db[_0xc098('0x2f')][_0xc098('0x30')],function(_0x5f4a74){return{'name':_0x5f4a74[_0xc098('0x31')],'type':_0x5f4a74[_0xc098('0x32')][_0xc098('0x33')]};});_0x442dcc['model']=_[_0xc098('0x2e')](_0x5a8ebb,'name');_0x442dcc['query']=_['keys'](_0x2a734c[_0xc098('0x34')]);_0x442dcc[_0xc098('0x35')]=_[_0xc098('0x36')](_0x442dcc['model'],_0x442dcc[_0xc098('0x34')]);_0x1c3496[_0xc098('0x37')]=_['intersection'](_0x442dcc['model'],qs['fields'](_0x2a734c[_0xc098('0x34')][_0xc098('0x38')]));_0x1c3496['attributes']=_0x1c3496['attributes'][_0xc098('0x39')]?_0x1c3496[_0xc098('0x37')]:_0x442dcc[_0xc098('0x3a')];if(!_0x2a734c[_0xc098('0x34')][_0xc098('0x3b')](_0xc098('0x3c'))){_0x1c3496[_0xc098('0x1e')]=qs[_0xc098('0x1e')](_0x2a734c[_0xc098('0x34')][_0xc098('0x1e')]);_0x1c3496[_0xc098('0x1c')]=qs[_0xc098('0x1c')](_0x2a734c['query']['offset']);}_0x1c3496['order']=qs[_0xc098('0x3d')](_0x2a734c[_0xc098('0x34')][_0xc098('0x3d')]);_0x1c3496['where']=qs[_0xc098('0x35')](_[_0xc098('0x3e')](_0x2a734c[_0xc098('0x34')],_0x442dcc[_0xc098('0x35')]),_0x5a8ebb);if(_0x2a734c[_0xc098('0x34')]['filter']){_0x1c3496['where']=_[_0xc098('0x3f')](_0x1c3496['where'],{'$or':_[_0xc098('0x2e')](_0x5a8ebb,function(_0x2f28dc){if(_0x2f28dc[_0xc098('0x32')]!==_0xc098('0x40')){var _0x4d1e13={};_0x4d1e13[_0x2f28dc[_0xc098('0x2d')]]={'$like':'%'+_0x2a734c['query'][_0xc098('0x41')]+'%'};return _0x4d1e13;}})});}_0x1c3496=_['merge']({},_0x1c3496,_0x2a734c[_0xc098('0x42')]);var _0x16cc8f={'where':_0x1c3496[_0xc098('0x43')]};return db[_0xc098('0x2f')][_0xc098('0x1f')](_0x16cc8f)['then'](function(_0x38c167){_0x538922[_0xc098('0x1f')]=_0x38c167;if(_0x2a734c[_0xc098('0x34')]['includeAll']){_0x1c3496[_0xc098('0x44')]=[{'all':!![]}];}return db[_0xc098('0x2f')][_0xc098('0x45')](_0x1c3496);})['then'](function(_0x1008bf){_0x538922[_0xc098('0x46')]=_0x1008bf;return _0x538922;})[_0xc098('0x27')](respondWithFilteredResult(_0x17d747,_0x1c3496))['catch'](handleError(_0x17d747,null));};exports[_0xc098('0x47')]=function(_0x55c34b,_0x42b48d){var _0x440f96={'raw':!![],'where':{'id':_0x55c34b['params']['id']}},_0x573358={};_0x573358['model']=_[_0xc098('0x48')](db[_0xc098('0x2f')][_0xc098('0x30')]);_0x573358[_0xc098('0x34')]=_[_0xc098('0x48')](_0x55c34b[_0xc098('0x34')]);_0x573358[_0xc098('0x35')]=_['intersection'](_0x573358['model'],_0x573358['query']);_0x440f96[_0xc098('0x37')]=_['intersection'](_0x573358[_0xc098('0x3a')],qs[_0xc098('0x38')](_0x55c34b[_0xc098('0x34')][_0xc098('0x38')]));_0x440f96[_0xc098('0x37')]=_0x440f96[_0xc098('0x37')][_0xc098('0x39')]?_0x440f96[_0xc098('0x37')]:_0x573358[_0xc098('0x3a')];if(_0x55c34b[_0xc098('0x34')][_0xc098('0x49')]){_0x440f96[_0xc098('0x44')]=[{'all':!![]}];}_0x440f96=_['merge']({},_0x440f96,_0x55c34b['options']);return db['Template'][_0xc098('0x4a')](_0x440f96)[_0xc098('0x27')](handleEntityNotFound(_0x42b48d,null))[_0xc098('0x27')](respondWithResult(_0x42b48d,null))[_0xc098('0x4b')](handleError(_0x42b48d,null));};exports[_0xc098('0x4c')]=function(_0x3be0b4,_0x19fb1b){return db['Template'][_0xc098('0x4c')](_0x3be0b4[_0xc098('0x4d')],{})[_0xc098('0x27')](function(_0x27f57b){var _0x10d878=_0x3be0b4[_0xc098('0x4e')]['get']({'plain':!![]});if(!_0x10d878)throw new Error(_0xc098('0x4f'));if(_0x10d878[_0xc098('0x50')]===_0xc098('0x4e')){var _0x543e2c=_0x27f57b[_0xc098('0x51')]({'plain':!![]});var _0x298319=_0xc098('0x29');return db['UserProfileSection'][_0xc098('0x4a')]({'where':{'name':_0x298319,'userProfileId':_0x10d878[_0xc098('0x52')]},'raw':!![]})[_0xc098('0x27')](function(_0x486e0e){if(_0x486e0e&&_0x486e0e[_0xc098('0x53')]===0x0){return db[_0xc098('0x2a')][_0xc098('0x4c')]({'name':_0x543e2c[_0xc098('0x2d')],'resourceId':_0x543e2c['id'],'type':_0x486e0e[_0xc098('0x2d')],'sectionId':_0x486e0e['id']},{})[_0xc098('0x27')](function(){return _0x27f57b;});}else{return _0x27f57b;}})[_0xc098('0x4b')](function(_0x264d81){logger['error'](_0xc098('0x54'),_0x264d81);throw _0x264d81;});}return _0x27f57b;})[_0xc098('0x27')](respondWithResult(_0x19fb1b,0xc9))[_0xc098('0x4b')](handleError(_0x19fb1b,null));};exports['update']=function(_0x515bea,_0x3cb253){if(_0x515bea[_0xc098('0x4d')]['id']){delete _0x515bea['body']['id'];}return db[_0xc098('0x2f')][_0xc098('0x4a')]({'where':{'id':_0x515bea[_0xc098('0x55')]['id']}})[_0xc098('0x27')](handleEntityNotFound(_0x3cb253,null))[_0xc098('0x27')](saveUpdates(_0x515bea[_0xc098('0x4d')],null))[_0xc098('0x27')](respondWithResult(_0x3cb253,null))[_0xc098('0x4b')](handleError(_0x3cb253,null));};exports[_0xc098('0x28')]=function(_0x223634,_0x2b83fb){return db[_0xc098('0x2f')]['find']({'where':{'id':_0x223634[_0xc098('0x55')]['id']}})[_0xc098('0x27')](handleEntityNotFound(_0x2b83fb,null))[_0xc098('0x27')](removeEntity(_0x2b83fb,null))[_0xc098('0x4b')](handleError(_0x2b83fb,null));}; \ No newline at end of file +var _0x8db9=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','get','Templates','UserProfileResource','then','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','rows','catch','params','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','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x8db9,0x9a));var _0x98db=function(_0x38dfda,_0x1527ae){_0x38dfda=_0x38dfda-0x0;var _0x3fd30f=_0x8db9[_0x38dfda];return _0x3fd30f;};'use strict';var emlformat=require(_0x98db('0x0'));var rimraf=require(_0x98db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98db('0x2'));var rp=require('request-promise');var moment=require(_0x98db('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x98db('0x4'));var util=require(_0x98db('0x5'));var path=require('path');var sox=require(_0x98db('0x6'));var csv=require('to-csv');var ejs=require(_0x98db('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98db('0x8'));var squel=require(_0x98db('0x9'));var crypto=require(_0x98db('0xa'));var jsforce=require(_0x98db('0xb'));var deskjs=require(_0x98db('0xc'));var toCsv=require(_0x98db('0xd'));var querystring=require(_0x98db('0xe'));var Papa=require(_0x98db('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x98db('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98db('0x11'));var logger=require('../../config/logger')(_0x98db('0x12'));var utils=require('../../config/utils');var config=require(_0x98db('0x13'));var licenseUtil=require(_0x98db('0x14'));var db=require(_0x98db('0x15'))['db'];function respondWithStatusCode(_0x40728a,_0x378ab8){_0x378ab8=_0x378ab8||0xcc;return function(_0xfa91ee){if(_0xfa91ee){return _0x40728a[_0x98db('0x16')](_0x378ab8);}return _0x40728a[_0x98db('0x17')](_0x378ab8)[_0x98db('0x18')]();};}function respondWithResult(_0x885151,_0x5eb23b){_0x5eb23b=_0x5eb23b||0xc8;return function(_0x3b94a2){if(_0x3b94a2){return _0x885151[_0x98db('0x17')](_0x5eb23b)[_0x98db('0x19')](_0x3b94a2);}};}function respondWithFilteredResult(_0x2acc30,_0x5b0666){return function(_0x100374){if(_0x100374){var _0x4b23e1=typeof _0x5b0666['offset']===_0x98db('0x1a')&&typeof _0x5b0666[_0x98db('0x1b')]===_0x98db('0x1a');var _0x5eef2b=_0x100374[_0x98db('0x1c')];var _0x212f5d=_0x4b23e1?0x0:_0x5b0666[_0x98db('0x1d')];var _0x1f8ea9=_0x4b23e1?_0x100374[_0x98db('0x1c')]:_0x5b0666[_0x98db('0x1d')]+_0x5b0666['limit'];var _0x1dca5c;if(_0x1f8ea9>=_0x5eef2b){_0x1f8ea9=_0x5eef2b;_0x1dca5c=0xc8;}else{_0x1dca5c=0xce;}_0x2acc30['status'](_0x1dca5c);return _0x2acc30[_0x98db('0x1e')](_0x98db('0x1f'),_0x212f5d+'-'+_0x1f8ea9+'/'+_0x5eef2b)[_0x98db('0x19')](_0x100374);}return null;};}function patchUpdates(_0x2211a5){return function(_0x5696d4){try{jsonpatch['apply'](_0x5696d4,_0x2211a5,!![]);}catch(_0x41ee34){return BPromise[_0x98db('0x20')](_0x41ee34);}return _0x5696d4[_0x98db('0x21')]();};}function saveUpdates(_0x1e51a7,_0x360e22){return function(_0xe94669){if(_0xe94669){return _0xe94669['update'](_0x1e51a7)['then'](function(_0x38ebdc){return _0x38ebdc;});}return null;};}function removeEntity(_0x9be729,_0x14d55e){return function(_0x38b359){if(_0x38b359){return _0x38b359[_0x98db('0x22')]()['then'](function(){var _0x4c4275=_0x38b359[_0x98db('0x23')]({'plain':!![]});var _0x5e4cd4=_0x98db('0x24');return db[_0x98db('0x25')][_0x98db('0x22')]({'where':{'type':_0x5e4cd4,'resourceId':_0x4c4275['id']}})[_0x98db('0x26')](function(){return _0x38b359;});})[_0x98db('0x26')](function(){_0x9be729[_0x98db('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c17e1,_0x401567){return function(_0xc9cb1){if(!_0xc9cb1){_0x5c17e1['sendStatus'](0x194);}return _0xc9cb1;};}function handleError(_0x431365,_0x147d3a){_0x147d3a=_0x147d3a||0x1f4;return function(_0x54c468){logger[_0x98db('0x27')](_0x54c468[_0x98db('0x28')]);if(_0x54c468[_0x98db('0x29')]){delete _0x54c468['name'];}_0x431365[_0x98db('0x17')](_0x147d3a)['send'](_0x54c468);};}exports[_0x98db('0x2a')]=function(_0xc47271,_0x28d655){var _0x46c68a={},_0x3d570d={},_0x36be50={'count':0x0,'rows':[]};var _0x3b414a=_[_0x98db('0x2b')](db[_0x98db('0x2c')][_0x98db('0x2d')],function(_0x39854e){return{'name':_0x39854e[_0x98db('0x2e')],'type':_0x39854e[_0x98db('0x2f')][_0x98db('0x30')]};});_0x3d570d[_0x98db('0x31')]=_[_0x98db('0x2b')](_0x3b414a,_0x98db('0x29'));_0x3d570d[_0x98db('0x32')]=_[_0x98db('0x33')](_0xc47271[_0x98db('0x32')]);_0x3d570d[_0x98db('0x34')]=_['intersection'](_0x3d570d[_0x98db('0x31')],_0x3d570d[_0x98db('0x32')]);_0x46c68a['attributes']=_[_0x98db('0x35')](_0x3d570d[_0x98db('0x31')],qs[_0x98db('0x36')](_0xc47271[_0x98db('0x32')][_0x98db('0x36')]));_0x46c68a['attributes']=_0x46c68a[_0x98db('0x37')][_0x98db('0x38')]?_0x46c68a['attributes']:_0x3d570d['model'];if(!_0xc47271[_0x98db('0x32')][_0x98db('0x39')](_0x98db('0x3a'))){_0x46c68a['limit']=qs['limit'](_0xc47271[_0x98db('0x32')][_0x98db('0x1b')]);_0x46c68a[_0x98db('0x1d')]=qs[_0x98db('0x1d')](_0xc47271[_0x98db('0x32')][_0x98db('0x1d')]);}_0x46c68a[_0x98db('0x3b')]=qs[_0x98db('0x3c')](_0xc47271['query']['sort']);_0x46c68a['where']=qs[_0x98db('0x34')](_[_0x98db('0x3d')](_0xc47271[_0x98db('0x32')],_0x3d570d[_0x98db('0x34')]),_0x3b414a);if(_0xc47271[_0x98db('0x32')]['filter']){_0x46c68a[_0x98db('0x3e')]=_['merge'](_0x46c68a[_0x98db('0x3e')],{'$or':_[_0x98db('0x2b')](_0x3b414a,function(_0x11b185){if(_0x11b185[_0x98db('0x2f')]!=='VIRTUAL'){var _0x13b517={};_0x13b517[_0x11b185[_0x98db('0x29')]]={'$like':'%'+_0xc47271['query']['filter']+'%'};return _0x13b517;}})});}_0x46c68a=_[_0x98db('0x3f')]({},_0x46c68a,_0xc47271[_0x98db('0x40')]);var _0x335de8={'where':_0x46c68a[_0x98db('0x3e')]};return db[_0x98db('0x2c')][_0x98db('0x1c')](_0x335de8)[_0x98db('0x26')](function(_0x28b59f){_0x36be50[_0x98db('0x1c')]=_0x28b59f;if(_0xc47271[_0x98db('0x32')][_0x98db('0x41')]){_0x46c68a[_0x98db('0x42')]=[{'all':!![]}];}return db[_0x98db('0x2c')]['findAll'](_0x46c68a);})[_0x98db('0x26')](function(_0x2ae9cf){_0x36be50[_0x98db('0x43')]=_0x2ae9cf;return _0x36be50;})[_0x98db('0x26')](respondWithFilteredResult(_0x28d655,_0x46c68a))[_0x98db('0x44')](handleError(_0x28d655,null));};exports['show']=function(_0xae9b87,_0x5efaa2){var _0x408ec6={'raw':!![],'where':{'id':_0xae9b87[_0x98db('0x45')]['id']}},_0x104b0a={};_0x104b0a[_0x98db('0x31')]=_['keys'](db[_0x98db('0x2c')][_0x98db('0x2d')]);_0x104b0a[_0x98db('0x32')]=_[_0x98db('0x33')](_0xae9b87[_0x98db('0x32')]);_0x104b0a[_0x98db('0x34')]=_[_0x98db('0x35')](_0x104b0a[_0x98db('0x31')],_0x104b0a['query']);_0x408ec6['attributes']=_[_0x98db('0x35')](_0x104b0a['model'],qs[_0x98db('0x36')](_0xae9b87[_0x98db('0x32')]['fields']));_0x408ec6[_0x98db('0x37')]=_0x408ec6[_0x98db('0x37')]['length']?_0x408ec6['attributes']:_0x104b0a[_0x98db('0x31')];if(_0xae9b87[_0x98db('0x32')][_0x98db('0x41')]){_0x408ec6[_0x98db('0x42')]=[{'all':!![]}];}_0x408ec6=_[_0x98db('0x3f')]({},_0x408ec6,_0xae9b87[_0x98db('0x40')]);return db[_0x98db('0x2c')][_0x98db('0x46')](_0x408ec6)['then'](handleEntityNotFound(_0x5efaa2,null))[_0x98db('0x26')](respondWithResult(_0x5efaa2,null))[_0x98db('0x44')](handleError(_0x5efaa2,null));};exports['create']=function(_0x5d2c00,_0x34bb90){return db[_0x98db('0x2c')][_0x98db('0x47')](_0x5d2c00[_0x98db('0x48')],{})[_0x98db('0x26')](function(_0x17520b){var _0xce02f1=_0x5d2c00[_0x98db('0x49')]['get']({'plain':!![]});if(!_0xce02f1)throw new Error(_0x98db('0x4a'));if(_0xce02f1[_0x98db('0x4b')]==='user'){var _0x551be9=_0x17520b[_0x98db('0x23')]({'plain':!![]});var _0x521b79=_0x98db('0x24');return db[_0x98db('0x4c')]['find']({'where':{'name':_0x521b79,'userProfileId':_0xce02f1[_0x98db('0x4d')]},'raw':!![]})[_0x98db('0x26')](function(_0x324506){if(_0x324506&&_0x324506[_0x98db('0x4e')]===0x0){return db[_0x98db('0x25')][_0x98db('0x47')]({'name':_0x551be9[_0x98db('0x29')],'resourceId':_0x551be9['id'],'type':_0x324506[_0x98db('0x29')],'sectionId':_0x324506['id']},{})['then'](function(){return _0x17520b;});}else{return _0x17520b;}})[_0x98db('0x44')](function(_0xbd812f){logger[_0x98db('0x27')](_0x98db('0x4f'),_0xbd812f);throw _0xbd812f;});}return _0x17520b;})[_0x98db('0x26')](respondWithResult(_0x34bb90,0xc9))[_0x98db('0x44')](handleError(_0x34bb90,null));};exports[_0x98db('0x50')]=function(_0x1a6034,_0x1fcd54){if(_0x1a6034[_0x98db('0x48')]['id']){delete _0x1a6034[_0x98db('0x48')]['id'];}return db['Template'][_0x98db('0x46')]({'where':{'id':_0x1a6034[_0x98db('0x45')]['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x1fcd54,null))['then'](saveUpdates(_0x1a6034[_0x98db('0x48')],null))['then'](respondWithResult(_0x1fcd54,null))[_0x98db('0x44')](handleError(_0x1fcd54,null));};exports['destroy']=function(_0x2a4e91,_0x4df6d8){return db[_0x98db('0x2c')][_0x98db('0x46')]({'where':{'id':_0x2a4e91[_0x98db('0x45')]['id']}})['then'](handleEntityNotFound(_0x4df6d8,null))[_0x98db('0x26')](removeEntity(_0x4df6d8,null))[_0x98db('0x44')](handleError(_0x4df6d8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e9c32c0..8857795 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 _0xa031=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment','bluebird'];(function(_0x46a6ab,_0x3ade0c){var _0x21e2a5=function(_0x2b1b83){while(--_0x2b1b83){_0x46a6ab['push'](_0x46a6ab['shift']());}};_0x21e2a5(++_0x3ade0c);}(_0xa031,0x1f3));var _0x1a03=function(_0x1d7a12,_0x58566f){_0x1d7a12=_0x1d7a12-0x0;var _0x451acb=_0xa031[_0x1d7a12];return _0x451acb;};'use strict';var _=require('lodash');var util=require(_0x1a03('0x0'));var logger=require(_0x1a03('0x1'))(_0x1a03('0x2'));var moment=require(_0x1a03('0x3'));var BPromise=require(_0x1a03('0x4'));var rp=require(_0x1a03('0x5'));var fs=require('fs');var path=require(_0x1a03('0x6'));var rimraf=require(_0x1a03('0x7'));var config=require(_0x1a03('0x8'));var attributes=require(_0x1a03('0x9'));module[_0x1a03('0xa')]=function(_0x1e56ad,_0x2d92ea){return _0x1e56ad[_0x1a03('0xb')](_0x1a03('0xc'),attributes,{'tableName':_0x1a03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd145=['../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x36c5d3,_0x55101f){var _0x4fa988=function(_0x14ea0a){while(--_0x14ea0a){_0x36c5d3['push'](_0x36c5d3['shift']());}};_0x4fa988(++_0x55101f);}(_0xd145,0xfc));var _0x5d14=function(_0x2b3e6e,_0x507e1f){_0x2b3e6e=_0x2b3e6e-0x0;var _0x46b423=_0xd145[_0x2b3e6e];return _0x46b423;};'use strict';var _=require(_0x5d14('0x0'));var util=require(_0x5d14('0x1'));var logger=require(_0x5d14('0x2'))(_0x5d14('0x3'));var moment=require(_0x5d14('0x4'));var BPromise=require(_0x5d14('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d14('0x6'));var rimraf=require(_0x5d14('0x7'));var config=require(_0x5d14('0x8'));var attributes=require(_0x5d14('0x9'));module[_0x5d14('0xa')]=function(_0x1e502b,_0x535f0d){return _0x1e502b[_0x5d14('0xb')]('Template',attributes,{'tableName':_0x5d14('0xc'),'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 b765e7b..f414b31 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 _0x2b00=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','Template','findAll','options','where','attributes','include','model','map','debug','GetTemplate','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2b00,0x1ef));var _0x02b0=function(_0x527733,_0x16051c){_0x527733=_0x527733-0x0;var _0x5400ba=_0x2b00[_0x527733];return _0x5400ba;};'use strict';var _=require(_0x02b0('0x0'));var util=require(_0x02b0('0x1'));var moment=require('moment');var BPromise=require(_0x02b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02b0('0x3'));var db=require(_0x02b0('0x4'))['db'];var utils=require(_0x02b0('0x5'));var logger=require(_0x02b0('0x6'))(_0x02b0('0x7'));var config=require(_0x02b0('0x8'));var jayson=require(_0x02b0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa60396,_0x2c5cf3,_0x208e5b){return new BPromise(function(_0x405626,_0x54cb32){return client[_0x02b0('0xa')](_0xa60396,_0x208e5b)[_0x02b0('0xb')](function(_0x457112){logger['info'](_0x02b0('0xc'),_0x2c5cf3,'request\x20sent');logger['debug'](_0x02b0('0xd'),_0x2c5cf3,_0x02b0('0xe'),JSON[_0x02b0('0xf')](_0x457112));if(_0x457112[_0x02b0('0x10')]){if(_0x457112[_0x02b0('0x10')][_0x02b0('0x11')]===0x1f4){logger[_0x02b0('0x10')](_0x02b0('0xc'),_0x2c5cf3,_0x457112[_0x02b0('0x10')]['message']);return _0x54cb32(_0x457112[_0x02b0('0x10')][_0x02b0('0x12')]);}logger[_0x02b0('0x10')]('Template,\x20%s,\x20%s',_0x2c5cf3,_0x457112[_0x02b0('0x10')]['message']);return _0x405626(_0x457112[_0x02b0('0x10')]['message']);}else{logger[_0x02b0('0x13')](_0x02b0('0xc'),_0x2c5cf3,_0x02b0('0xe'));_0x405626(_0x457112['result'][_0x02b0('0x12')]);}})[_0x02b0('0x14')](function(_0x338f2e){logger[_0x02b0('0x10')]('Template,\x20%s,\x20%s',_0x2c5cf3,_0x338f2e);_0x54cb32(_0x338f2e);});});}exports['GetTemplate']=function(_0x2b3281){var _0x3cf2b5=this;return new Promise(function(_0x18de78,_0x262a37){return db[_0x02b0('0x15')][_0x02b0('0x16')]({'raw':_0x2b3281[_0x02b0('0x17')]?_0x2b3281[_0x02b0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2b3281[_0x02b0('0x17')]?_0x2b3281[_0x02b0('0x17')][_0x02b0('0x18')]||null:null,'attributes':_0x2b3281[_0x02b0('0x17')]?_0x2b3281[_0x02b0('0x17')][_0x02b0('0x19')]||null:null,'limit':_0x2b3281[_0x02b0('0x17')]?_0x2b3281[_0x02b0('0x17')]['limit']||null:null,'include':_0x2b3281[_0x02b0('0x17')]?_0x2b3281[_0x02b0('0x17')]['include']?_['map'](_0x2b3281['options'][_0x02b0('0x1a')],function(_0x3cadda){return{'model':db[_0x3cadda[_0x02b0('0x1b')]],'as':_0x3cadda['as'],'attributes':_0x3cadda['attributes'],'include':_0x3cadda[_0x02b0('0x1a')]?_[_0x02b0('0x1c')](_0x3cadda[_0x02b0('0x1a')],function(_0x1280a5){return{'model':db[_0x1280a5[_0x02b0('0x1b')]],'as':_0x1280a5['as'],'attributes':_0x1280a5[_0x02b0('0x19')],'include':_0x1280a5[_0x02b0('0x1a')]?_[_0x02b0('0x1c')](_0x1280a5['include'],function(_0x1f423b){return{'model':db[_0x1f423b[_0x02b0('0x1b')]],'as':_0x1f423b['as'],'attributes':_0x1f423b['attributes']};}):[]};}):[]};}):[]:[]})[_0x02b0('0xb')](function(_0x5974dc){logger['info']('GetTemplate',_0x2b3281);logger[_0x02b0('0x1d')](_0x02b0('0x1e'),_0x2b3281,JSON[_0x02b0('0xf')](_0x5974dc));_0x18de78(_0x5974dc);})[_0x02b0('0x14')](function(_0xd09688){logger[_0x02b0('0x10')](_0x02b0('0x1e'),_0xd09688[_0x02b0('0x12')],_0x2b3281);_0x262a37(_0x3cf2b5[_0x02b0('0x10')](0x1f4,_0xd09688[_0x02b0('0x12')]));});});}; \ No newline at end of file +var _0x13c9=['bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model','debug','stringify','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x13c9,0x1dd));var _0x913c=function(_0x418894,_0x38f1c1){_0x418894=_0x418894-0x0;var _0x396392=_0x13c9[_0x418894];return _0x396392;};'use strict';var _=require(_0x913c('0x0'));var util=require(_0x913c('0x1'));var moment=require(_0x913c('0x2'));var BPromise=require(_0x913c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x913c('0x4'));var logger=require(_0x913c('0x5'))(_0x913c('0x6'));var config=require(_0x913c('0x7'));var jayson=require(_0x913c('0x8'));var client=jayson[_0x913c('0x9')][_0x913c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed05d,_0x29cbd8,_0x174a25){return new BPromise(function(_0x14a944,_0x2c1228){return client[_0x913c('0xb')](_0x3ed05d,_0x174a25)[_0x913c('0xc')](function(_0x4d70c4){logger[_0x913c('0xd')](_0x913c('0xe'),_0x29cbd8,_0x913c('0xf'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x29cbd8,_0x913c('0xf'),JSON['stringify'](_0x4d70c4));if(_0x4d70c4[_0x913c('0x10')]){if(_0x4d70c4[_0x913c('0x10')][_0x913c('0x11')]===0x1f4){logger['error'](_0x913c('0xe'),_0x29cbd8,_0x4d70c4[_0x913c('0x10')][_0x913c('0x12')]);return _0x2c1228(_0x4d70c4[_0x913c('0x10')][_0x913c('0x12')]);}logger[_0x913c('0x10')](_0x913c('0xe'),_0x29cbd8,_0x4d70c4['error']['message']);return _0x14a944(_0x4d70c4['error'][_0x913c('0x12')]);}else{logger[_0x913c('0xd')](_0x913c('0xe'),_0x29cbd8,_0x913c('0xf'));_0x14a944(_0x4d70c4['result']['message']);}})[_0x913c('0x13')](function(_0x1349be){logger[_0x913c('0x10')](_0x913c('0xe'),_0x29cbd8,_0x1349be);_0x2c1228(_0x1349be);});});}exports[_0x913c('0x14')]=function(_0x3bf46b){var _0xd7b5ee=this;return new Promise(function(_0x3b61f9,_0x294a4f){return db[_0x913c('0x15')][_0x913c('0x16')]({'raw':_0x3bf46b[_0x913c('0x17')]?_0x3bf46b[_0x913c('0x17')][_0x913c('0x18')]===undefined?!![]:![]:!![],'where':_0x3bf46b[_0x913c('0x17')]?_0x3bf46b[_0x913c('0x17')][_0x913c('0x19')]||null:null,'attributes':_0x3bf46b[_0x913c('0x17')]?_0x3bf46b[_0x913c('0x17')][_0x913c('0x1a')]||null:null,'limit':_0x3bf46b[_0x913c('0x17')]?_0x3bf46b[_0x913c('0x17')]['limit']||null:null,'include':_0x3bf46b[_0x913c('0x17')]?_0x3bf46b[_0x913c('0x17')][_0x913c('0x1b')]?_[_0x913c('0x1c')](_0x3bf46b['options'][_0x913c('0x1b')],function(_0x453fd8){return{'model':db[_0x453fd8['model']],'as':_0x453fd8['as'],'attributes':_0x453fd8[_0x913c('0x1a')],'include':_0x453fd8[_0x913c('0x1b')]?_[_0x913c('0x1c')](_0x453fd8[_0x913c('0x1b')],function(_0x4c794c){return{'model':db[_0x4c794c['model']],'as':_0x4c794c['as'],'attributes':_0x4c794c['attributes'],'include':_0x4c794c[_0x913c('0x1b')]?_['map'](_0x4c794c['include'],function(_0xc2b275){return{'model':db[_0xc2b275[_0x913c('0x1d')]],'as':_0xc2b275['as'],'attributes':_0xc2b275[_0x913c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x913c('0xc')](function(_0x2308ad){logger[_0x913c('0xd')]('GetTemplate',_0x3bf46b);logger[_0x913c('0x1e')](_0x913c('0x14'),_0x3bf46b,JSON[_0x913c('0x1f')](_0x2308ad));_0x3b61f9(_0x2308ad);})[_0x913c('0x13')](function(_0x3ec8a8){logger[_0x913c('0x10')](_0x913c('0x14'),_0x3ec8a8[_0x913c('0x12')],_0x3bf46b);_0x294a4f(_0xd7b5ee[_0x913c('0x10')](0x1f4,_0x3ec8a8[_0x913c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 4afcca3..0f221bc 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 _0x1677=['../../config/environment','get','index','show','isAuthenticated','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAction','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7e50ef,_0x40b59c){var _0x4558c5=function(_0x1c0512){while(--_0x1c0512){_0x7e50ef['push'](_0x7e50ef['shift']());}};_0x4558c5(++_0x40b59c);}(_0x1677,0x18f));var _0x7167=function(_0x14070a,_0x5bad17){_0x14070a=_0x14070a-0x0;var _0x54643b=_0x1677[_0x14070a];return _0x54643b;};'use strict';var multer=require('multer');var util=require(_0x7167('0x0'));var path=require('path');var timeout=require(_0x7167('0x1'));var express=require('express');var router=express[_0x7167('0x2')]();var fs_extra=require(_0x7167('0x3'));var auth=require(_0x7167('0x4'));var interaction=require(_0x7167('0x5'));var config=require(_0x7167('0x6'));var controller=require('./trigger.controller');router[_0x7167('0x7')]('/',auth['isAuthenticated'](),controller[_0x7167('0x8')]);router[_0x7167('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7167('0x9')]);router[_0x7167('0x7')]('/:id/all_conditions',auth[_0x7167('0xa')](),controller[_0x7167('0xb')]);router['get']('/:id/any_conditions',auth[_0x7167('0xa')](),controller[_0x7167('0xc')]);router[_0x7167('0x7')](_0x7167('0xd'),auth[_0x7167('0xa')](),controller[_0x7167('0xe')]);router[_0x7167('0xf')]('/',auth[_0x7167('0xa')](),controller[_0x7167('0x10')]);router[_0x7167('0xf')](_0x7167('0x11'),auth[_0x7167('0xa')](),controller[_0x7167('0x12')]);router['post'](_0x7167('0x13'),auth[_0x7167('0xa')](),controller['addAnyCondition']);router[_0x7167('0xf')](_0x7167('0xd'),auth[_0x7167('0xa')](),controller[_0x7167('0x14')]);router[_0x7167('0x15')](_0x7167('0x16'),auth[_0x7167('0xa')](),controller[_0x7167('0x17')]);router[_0x7167('0x18')](_0x7167('0x16'),auth[_0x7167('0xa')](),controller[_0x7167('0x19')]);module[_0x7167('0x1a')]=router; \ No newline at end of file +var _0x27dd=['express','../../components/auth/service','./trigger.controller','get','index','/:id','isAuthenticated','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','update','multer','path','connect-timeout'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x27dd,0x177));var _0xd27d=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x27dd[_0x47a349];return _0x18ab75;};'use strict';var multer=require(_0xd27d('0x0'));var util=require('util');var path=require(_0xd27d('0x1'));var timeout=require(_0xd27d('0x2'));var express=require(_0xd27d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd27d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd27d('0x5'));router[_0xd27d('0x6')]('/',auth['isAuthenticated'](),controller[_0xd27d('0x7')]);router[_0xd27d('0x6')](_0xd27d('0x8'),auth[_0xd27d('0x9')](),controller['show']);router[_0xd27d('0x6')]('/:id/all_conditions',auth[_0xd27d('0x9')](),controller['getAllConditions']);router['get'](_0xd27d('0xa'),auth[_0xd27d('0x9')](),controller['getAnyConditions']);router['get'](_0xd27d('0xb'),auth[_0xd27d('0x9')](),controller[_0xd27d('0xc')]);router[_0xd27d('0xd')]('/',auth[_0xd27d('0x9')](),controller['create']);router['post']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xd27d('0xe')]);router['post'](_0xd27d('0xa'),auth[_0xd27d('0x9')](),controller[_0xd27d('0xf')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addAction']);router[_0xd27d('0x10')]('/:id',auth[_0xd27d('0x9')](),controller[_0xd27d('0x11')]);router['delete'](_0xd27d('0x8'),auth[_0xd27d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 7055a7d..a8f9451 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 _0xcb7f=['BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb7f,0xc7));var _0xfcb7=function(_0x344e42,_0x31c2cf){_0x344e42=_0x344e42-0x0;var _0x3d6b58=_0xcb7f[_0x344e42];return _0x3d6b58;};'use strict';var Sequelize=require('sequelize');module[_0xfcb7('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfcb7('0x1')]},'description':{'type':Sequelize[_0xfcb7('0x1')]},'status':{'type':Sequelize[_0xfcb7('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fe4=['sequelize','exports','STRING','BOOLEAN'];(function(_0x54c915,_0x29ce6b){var _0x3b293b=function(_0x1d2be7){while(--_0x1d2be7){_0x54c915['push'](_0x54c915['shift']());}};_0x3b293b(++_0x29ce6b);}(_0x3fe4,0x1b0));var _0x43fe=function(_0x3f0c7d,_0x57bbd4){_0x3f0c7d=_0x3f0c7d-0x0;var _0x45a295=_0x3fe4[_0x3f0c7d];return _0x45a295;};'use strict';var Sequelize=require(_0x43fe('0x0'));module[_0x43fe('0x1')]={'name':{'type':Sequelize[_0x43fe('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x43fe('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6c0ee44..7e54591 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 _0x4fc5=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','error','name','Trigger','rawAttributes','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4fc5,0xa5));var _0x54fc=function(_0x2a9490,_0x43cb5f){_0x2a9490=_0x2a9490-0x0;var _0x5bf90e=_0x4fc5[_0x2a9490];return _0x5bf90e;};'use strict';var emlformat=require(_0x54fc('0x0'));var rimraf=require(_0x54fc('0x1'));var zipdir=require(_0x54fc('0x2'));var jsonpatch=require(_0x54fc('0x3'));var rp=require(_0x54fc('0x4'));var moment=require(_0x54fc('0x5'));var BPromise=require(_0x54fc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x54fc('0x7'));var sox=require(_0x54fc('0x8'));var csv=require('to-csv');var ejs=require(_0x54fc('0x9'));var fs=require('fs');var fs_extra=require(_0x54fc('0xa'));var _=require(_0x54fc('0xb'));var squel=require(_0x54fc('0xc'));var crypto=require(_0x54fc('0xd'));var jsforce=require(_0x54fc('0xe'));var deskjs=require(_0x54fc('0xf'));var toCsv=require(_0x54fc('0x10'));var querystring=require(_0x54fc('0x11'));var Papa=require('papaparse');var Redis=require(_0x54fc('0x12'));var authService=require(_0x54fc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x54fc('0x14'));var hardwareService=require(_0x54fc('0x15'));var logger=require(_0x54fc('0x16'))(_0x54fc('0x17'));var utils=require(_0x54fc('0x18'));var config=require(_0x54fc('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d29da,_0x1de14b){_0x1de14b=_0x1de14b||0xcc;return function(_0x49537e){if(_0x49537e){return _0x3d29da[_0x54fc('0x1a')](_0x1de14b);}return _0x3d29da[_0x54fc('0x1b')](_0x1de14b)[_0x54fc('0x1c')]();};}function respondWithResult(_0x262d95,_0xa4ae5e){_0xa4ae5e=_0xa4ae5e||0xc8;return function(_0xd212e9){if(_0xd212e9){return _0x262d95[_0x54fc('0x1b')](_0xa4ae5e)[_0x54fc('0x1d')](_0xd212e9);}};}function respondWithFilteredResult(_0x419593,_0x21dded){return function(_0x2c78d4){if(_0x2c78d4){var _0x2436e8=typeof _0x21dded[_0x54fc('0x1e')]===_0x54fc('0x1f')&&typeof _0x21dded['limit']===_0x54fc('0x1f');var _0x6b26fe=_0x2c78d4['count'];var _0x3b5d92=_0x2436e8?0x0:_0x21dded[_0x54fc('0x1e')];var _0x2f6ec7=_0x2436e8?_0x2c78d4[_0x54fc('0x20')]:_0x21dded[_0x54fc('0x1e')]+_0x21dded[_0x54fc('0x21')];var _0x4cdd44;if(_0x2f6ec7>=_0x6b26fe){_0x2f6ec7=_0x6b26fe;_0x4cdd44=0xc8;}else{_0x4cdd44=0xce;}_0x419593[_0x54fc('0x1b')](_0x4cdd44);return _0x419593[_0x54fc('0x22')](_0x54fc('0x23'),_0x3b5d92+'-'+_0x2f6ec7+'/'+_0x6b26fe)[_0x54fc('0x1d')](_0x2c78d4);}return null;};}function patchUpdates(_0x530c94){return function(_0x5f1d2e){try{jsonpatch[_0x54fc('0x24')](_0x5f1d2e,_0x530c94,!![]);}catch(_0x12e12c){return BPromise[_0x54fc('0x25')](_0x12e12c);}return _0x5f1d2e[_0x54fc('0x26')]();};}function saveUpdates(_0x1d9d1d,_0x24420a){return function(_0xbd99b5){if(_0xbd99b5){return _0xbd99b5[_0x54fc('0x27')](_0x1d9d1d)[_0x54fc('0x28')](function(_0x1d89e9){return _0x1d89e9;});}return null;};}function removeEntity(_0x1bb762,_0x456a25){return function(_0x18d70d){if(_0x18d70d){return _0x18d70d[_0x54fc('0x29')]()[_0x54fc('0x28')](function(){var _0x49f28d=_0x18d70d['get']({'plain':!![]});var _0x4b0d55=_0x54fc('0x2a');return db[_0x54fc('0x2b')][_0x54fc('0x29')]({'where':{'type':_0x4b0d55,'resourceId':_0x49f28d['id']}})[_0x54fc('0x28')](function(){return _0x18d70d;});})[_0x54fc('0x28')](function(){_0x1bb762[_0x54fc('0x1b')](0xcc)[_0x54fc('0x1c')]();});}};}function handleEntityNotFound(_0x3a06f7,_0x3045a6){return function(_0x52024f){if(!_0x52024f){_0x3a06f7[_0x54fc('0x1a')](0x194);}return _0x52024f;};}function handleError(_0x4eae8a,_0x154a2f){_0x154a2f=_0x154a2f||0x1f4;return function(_0x985cf0){logger[_0x54fc('0x2c')](_0x985cf0['stack']);if(_0x985cf0[_0x54fc('0x2d')]){delete _0x985cf0[_0x54fc('0x2d')];}_0x4eae8a['status'](_0x154a2f)['send'](_0x985cf0);};}exports['index']=function(_0x56bb5b,_0x58b917){var _0x3a487c={},_0x705adf={},_0xbfe5ff={'count':0x0,'rows':[]};var _0x10c8b9=_['map'](db[_0x54fc('0x2e')][_0x54fc('0x2f')],function(_0x32f5c3){return{'name':_0x32f5c3['fieldName'],'type':_0x32f5c3['type'][_0x54fc('0x30')]};});_0x705adf[_0x54fc('0x31')]=_[_0x54fc('0x32')](_0x10c8b9,_0x54fc('0x2d'));_0x705adf['query']=_[_0x54fc('0x33')](_0x56bb5b['query']);_0x705adf[_0x54fc('0x34')]=_[_0x54fc('0x35')](_0x705adf['model'],_0x705adf[_0x54fc('0x36')]);_0x3a487c[_0x54fc('0x37')]=_[_0x54fc('0x35')](_0x705adf[_0x54fc('0x31')],qs['fields'](_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x38')]));_0x3a487c[_0x54fc('0x37')]=_0x3a487c['attributes'][_0x54fc('0x39')]?_0x3a487c[_0x54fc('0x37')]:_0x705adf[_0x54fc('0x31')];if(!_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x3a')](_0x54fc('0x3b'))){_0x3a487c[_0x54fc('0x21')]=qs[_0x54fc('0x21')](_0x56bb5b['query'][_0x54fc('0x21')]);_0x3a487c[_0x54fc('0x1e')]=qs[_0x54fc('0x1e')](_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x1e')]);}_0x3a487c[_0x54fc('0x3c')]=qs[_0x54fc('0x3d')](_0x56bb5b['query'][_0x54fc('0x3d')]);_0x3a487c[_0x54fc('0x3e')]=qs[_0x54fc('0x34')](_[_0x54fc('0x3f')](_0x56bb5b[_0x54fc('0x36')],_0x705adf['filters']),_0x10c8b9);if(_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x40')]){_0x3a487c[_0x54fc('0x3e')]=_[_0x54fc('0x41')](_0x3a487c[_0x54fc('0x3e')],{'$or':_['map'](_0x10c8b9,function(_0x2f5592){if(_0x2f5592['type']!==_0x54fc('0x42')){var _0x67f7d9={};_0x67f7d9[_0x2f5592['name']]={'$like':'%'+_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x40')]+'%'};return _0x67f7d9;}})});}_0x3a487c=_[_0x54fc('0x41')]({},_0x3a487c,_0x56bb5b[_0x54fc('0x43')]);var _0x5984c3={'where':_0x3a487c[_0x54fc('0x3e')]};return db[_0x54fc('0x2e')][_0x54fc('0x20')](_0x5984c3)['then'](function(_0xb1ae7a){_0xbfe5ff['count']=_0xb1ae7a;if(_0x56bb5b[_0x54fc('0x36')][_0x54fc('0x44')]){_0x3a487c[_0x54fc('0x45')]=[{'all':!![]}];}return db[_0x54fc('0x2e')][_0x54fc('0x46')](_0x3a487c);})[_0x54fc('0x28')](function(_0x473273){_0xbfe5ff[_0x54fc('0x47')]=_0x473273;return _0xbfe5ff;})['then'](respondWithFilteredResult(_0x58b917,_0x3a487c))[_0x54fc('0x48')](handleError(_0x58b917,null));};exports[_0x54fc('0x49')]=function(_0x434a5a,_0x274592){var _0x4fd308={'raw':![],'where':{'id':_0x434a5a['params']['id']}},_0x1e86be={};_0x1e86be[_0x54fc('0x31')]=_[_0x54fc('0x33')](db[_0x54fc('0x2e')]['rawAttributes']);_0x1e86be[_0x54fc('0x36')]=_[_0x54fc('0x33')](_0x434a5a[_0x54fc('0x36')]);_0x1e86be[_0x54fc('0x34')]=_[_0x54fc('0x35')](_0x1e86be[_0x54fc('0x31')],_0x1e86be[_0x54fc('0x36')]);_0x4fd308['attributes']=_[_0x54fc('0x35')](_0x1e86be[_0x54fc('0x31')],qs['fields'](_0x434a5a[_0x54fc('0x36')]['fields']));_0x4fd308['attributes']=_0x4fd308[_0x54fc('0x37')][_0x54fc('0x39')]?_0x4fd308['attributes']:_0x1e86be[_0x54fc('0x31')];if(_0x434a5a['query'][_0x54fc('0x44')]){_0x4fd308['include']=[{'all':!![]}];}_0x4fd308=_['merge']({},_0x4fd308,_0x434a5a[_0x54fc('0x43')]);return db[_0x54fc('0x2e')][_0x54fc('0x4a')](_0x4fd308)[_0x54fc('0x28')](handleEntityNotFound(_0x274592,null))[_0x54fc('0x28')](respondWithResult(_0x274592,null))['catch'](handleError(_0x274592,null));};exports[_0x54fc('0x4b')]=function(_0x4378c1,_0x5d6b44){return db[_0x54fc('0x2e')][_0x54fc('0x4b')](_0x4378c1[_0x54fc('0x4c')],{})['then'](function(_0x35d164){var _0x59c6cb=_0x4378c1[_0x54fc('0x4d')][_0x54fc('0x4e')]({'plain':!![]});if(!_0x59c6cb)throw new Error(_0x54fc('0x4f'));if(_0x59c6cb['role']==='user'){var _0xa8601f=_0x35d164[_0x54fc('0x4e')]({'plain':!![]});var _0x3c95e4=_0x54fc('0x2a');return db[_0x54fc('0x50')][_0x54fc('0x4a')]({'where':{'name':_0x3c95e4,'userProfileId':_0x59c6cb[_0x54fc('0x51')]},'raw':!![]})[_0x54fc('0x28')](function(_0x53cbbf){if(_0x53cbbf&&_0x53cbbf[_0x54fc('0x52')]===0x0){return db[_0x54fc('0x2b')][_0x54fc('0x4b')]({'name':_0xa8601f[_0x54fc('0x2d')],'resourceId':_0xa8601f['id'],'type':_0x53cbbf[_0x54fc('0x2d')],'sectionId':_0x53cbbf['id']},{})[_0x54fc('0x28')](function(){return _0x35d164;});}else{return _0x35d164;}})[_0x54fc('0x48')](function(_0x182dcb){logger['error'](_0x54fc('0x53'),_0x182dcb);throw _0x182dcb;});}return _0x35d164;})[_0x54fc('0x28')](respondWithResult(_0x5d6b44,0xc9))[_0x54fc('0x48')](handleError(_0x5d6b44,null));};exports[_0x54fc('0x27')]=function(_0x3822ac,_0x2d98f3){if(_0x3822ac[_0x54fc('0x4c')]['id']){delete _0x3822ac[_0x54fc('0x4c')]['id'];}return db[_0x54fc('0x2e')][_0x54fc('0x4a')]({'where':{'id':_0x3822ac['params']['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0x2d98f3,null))[_0x54fc('0x28')](saveUpdates(_0x3822ac[_0x54fc('0x4c')],null))['then'](respondWithResult(_0x2d98f3,null))[_0x54fc('0x48')](handleError(_0x2d98f3,null));};exports[_0x54fc('0x29')]=function(_0x5ad5d9,_0x4577c1){return db[_0x54fc('0x2e')]['find']({'where':{'id':_0x5ad5d9[_0x54fc('0x54')]['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0x4577c1,null))[_0x54fc('0x28')](removeEntity(_0x4577c1,null))['catch'](handleError(_0x4577c1,null));};exports[_0x54fc('0x55')]=function(_0x555687,_0xf9d7af,_0xa8d78c){if(_0x555687[_0x54fc('0x4c')]['id']){delete _0x555687[_0x54fc('0x4c')]['id'];}return db[_0x54fc('0x2e')]['find']({'where':{'id':_0x555687[_0x54fc('0x54')]['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0xf9d7af,null))[_0x54fc('0x28')](function(_0x3c0bec){if(_0x3c0bec){_0x555687[_0x54fc('0x4c')]['TriggerAllId']=_0x3c0bec['id'];return db[_0x54fc('0x56')][_0x54fc('0x4b')](_0x555687[_0x54fc('0x4c')]);}})[_0x54fc('0x28')](respondWithResult(_0xf9d7af,null))['catch'](handleError(_0xf9d7af,null));};exports[_0x54fc('0x57')]=function(_0x3bd78e,_0x378fbb,_0x47a928){if(_0x3bd78e[_0x54fc('0x4c')]['id']){delete _0x3bd78e['body']['id'];}return db[_0x54fc('0x2e')]['find']({'where':{'id':_0x3bd78e[_0x54fc('0x54')]['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0x378fbb,null))[_0x54fc('0x28')](function(_0x5dd703){if(_0x5dd703){_0x3bd78e['body'][_0x54fc('0x58')]=_0x5dd703['id'];return db[_0x54fc('0x56')]['create'](_0x3bd78e[_0x54fc('0x4c')]);}})[_0x54fc('0x28')](respondWithResult(_0x378fbb,null))['catch'](handleError(_0x378fbb,null));};exports[_0x54fc('0x59')]=function(_0x5d0877,_0x462317,_0x40129b){var _0x470e75={};var _0x248d5d={};var _0x3b205a;var _0x3aa6e8;return db[_0x54fc('0x2e')][_0x54fc('0x5a')]({'where':{'id':_0x5d0877[_0x54fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x462317,null))[_0x54fc('0x28')](function(_0x366c12){if(_0x366c12){_0x3b205a=_0x366c12;_0x248d5d[_0x54fc('0x31')]=_['keys'](db[_0x54fc('0x56')]['rawAttributes']);_0x248d5d[_0x54fc('0x36')]=_[_0x54fc('0x33')](_0x5d0877[_0x54fc('0x36')]);_0x248d5d[_0x54fc('0x34')]=_[_0x54fc('0x35')](_0x248d5d[_0x54fc('0x31')],_0x248d5d[_0x54fc('0x36')]);_0x470e75[_0x54fc('0x37')]=_[_0x54fc('0x35')](_0x248d5d[_0x54fc('0x31')],qs[_0x54fc('0x38')](_0x5d0877[_0x54fc('0x36')][_0x54fc('0x38')]));_0x470e75[_0x54fc('0x37')]=_0x470e75[_0x54fc('0x37')][_0x54fc('0x39')]?_0x470e75['attributes']:_0x248d5d[_0x54fc('0x31')];_0x470e75['order']=qs['sort'](_0x5d0877[_0x54fc('0x36')][_0x54fc('0x3d')]);_0x470e75[_0x54fc('0x3e')]=qs[_0x54fc('0x34')](_[_0x54fc('0x3f')](_0x5d0877[_0x54fc('0x36')],_0x248d5d[_0x54fc('0x34')]));if(_0x5d0877[_0x54fc('0x36')][_0x54fc('0x40')]){_0x470e75[_0x54fc('0x3e')]=_[_0x54fc('0x41')](_0x470e75['where'],{'$or':_['map'](_0x470e75[_0x54fc('0x37')],function(_0x8cdf0){var _0x26e145={};_0x26e145[_0x8cdf0]={'$like':'%'+_0x5d0877['query']['filter']+'%'};return _0x26e145;})});}_0x470e75=_[_0x54fc('0x41')]({},_0x470e75,_0x5d0877['options']);return _0x3b205a[_0x54fc('0x59')](_0x470e75);}})[_0x54fc('0x28')](function(_0x1d8396){if(_0x1d8396){_0x3aa6e8=_0x1d8396[_0x54fc('0x39')];if(!_0x5d0877[_0x54fc('0x36')][_0x54fc('0x3a')](_0x54fc('0x3b'))){_0x470e75[_0x54fc('0x21')]=qs['limit'](_0x5d0877[_0x54fc('0x36')]['limit']);_0x470e75[_0x54fc('0x1e')]=qs[_0x54fc('0x1e')](_0x5d0877[_0x54fc('0x36')]['offset']);}return _0x3b205a[_0x54fc('0x59')](_0x470e75);}})[_0x54fc('0x28')](function(_0x48b839){if(_0x48b839){return _0x48b839?{'count':_0x3aa6e8,'rows':_0x48b839}:null;}})['then'](respondWithResult(_0x462317,null))[_0x54fc('0x48')](handleError(_0x462317,null));};exports[_0x54fc('0x5b')]=function(_0x4bc2ff,_0x167d14,_0x570547){var _0xa59ed={};var _0x2c1f31={};var _0x2547c7;var _0x22a609;return db[_0x54fc('0x2e')]['findOne']({'where':{'id':_0x4bc2ff[_0x54fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x167d14,null))[_0x54fc('0x28')](function(_0x3d3ca4){if(_0x3d3ca4){_0x2547c7=_0x3d3ca4;_0x2c1f31[_0x54fc('0x31')]=_[_0x54fc('0x33')](db[_0x54fc('0x56')][_0x54fc('0x2f')]);_0x2c1f31[_0x54fc('0x36')]=_[_0x54fc('0x33')](_0x4bc2ff[_0x54fc('0x36')]);_0x2c1f31[_0x54fc('0x34')]=_[_0x54fc('0x35')](_0x2c1f31[_0x54fc('0x31')],_0x2c1f31[_0x54fc('0x36')]);_0xa59ed['attributes']=_[_0x54fc('0x35')](_0x2c1f31[_0x54fc('0x31')],qs[_0x54fc('0x38')](_0x4bc2ff[_0x54fc('0x36')][_0x54fc('0x38')]));_0xa59ed['attributes']=_0xa59ed[_0x54fc('0x37')]['length']?_0xa59ed[_0x54fc('0x37')]:_0x2c1f31[_0x54fc('0x31')];_0xa59ed[_0x54fc('0x3c')]=qs[_0x54fc('0x3d')](_0x4bc2ff['query'][_0x54fc('0x3d')]);_0xa59ed[_0x54fc('0x3e')]=qs['filters'](_['pick'](_0x4bc2ff['query'],_0x2c1f31[_0x54fc('0x34')]));if(_0x4bc2ff[_0x54fc('0x36')]['filter']){_0xa59ed[_0x54fc('0x3e')]=_[_0x54fc('0x41')](_0xa59ed['where'],{'$or':_[_0x54fc('0x32')](_0xa59ed[_0x54fc('0x37')],function(_0xfd9c4e){var _0x1b5ba9={};_0x1b5ba9[_0xfd9c4e]={'$like':'%'+_0x4bc2ff[_0x54fc('0x36')]['filter']+'%'};return _0x1b5ba9;})});}_0xa59ed=_['merge']({},_0xa59ed,_0x4bc2ff[_0x54fc('0x43')]);return _0x2547c7[_0x54fc('0x5b')](_0xa59ed);}})[_0x54fc('0x28')](function(_0xdffa7f){if(_0xdffa7f){_0x22a609=_0xdffa7f[_0x54fc('0x39')];if(!_0x4bc2ff[_0x54fc('0x36')][_0x54fc('0x3a')](_0x54fc('0x3b'))){_0xa59ed[_0x54fc('0x21')]=qs['limit'](_0x4bc2ff['query'][_0x54fc('0x21')]);_0xa59ed[_0x54fc('0x1e')]=qs['offset'](_0x4bc2ff[_0x54fc('0x36')][_0x54fc('0x1e')]);}return _0x2547c7['getAnyConditions'](_0xa59ed);}})[_0x54fc('0x28')](function(_0x5ac6f4){if(_0x5ac6f4){return _0x5ac6f4?{'count':_0x22a609,'rows':_0x5ac6f4}:null;}})[_0x54fc('0x28')](respondWithResult(_0x167d14,null))[_0x54fc('0x48')](handleError(_0x167d14,null));};exports[_0x54fc('0x5c')]=function(_0x10315c,_0x3a6a67,_0x840fd2){if(_0x10315c[_0x54fc('0x4c')]['id']){delete _0x10315c[_0x54fc('0x4c')]['id'];}return db[_0x54fc('0x2e')][_0x54fc('0x4a')]({'where':{'id':_0x10315c['params']['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0x3a6a67,null))[_0x54fc('0x28')](function(_0x5613b8){if(_0x5613b8){_0x10315c['body'][_0x54fc('0x5d')]=_0x5613b8['id'];return db[_0x54fc('0x5e')][_0x54fc('0x4b')](_0x10315c[_0x54fc('0x4c')]);}})[_0x54fc('0x28')](respondWithResult(_0x3a6a67,null))[_0x54fc('0x48')](handleError(_0x3a6a67,null));};exports[_0x54fc('0x5f')]=function(_0x2fbb3e,_0x1eeae6,_0x232699){var _0x52f386={};var _0x3a6d4d={};var _0x1d9c9e;var _0x9f31ee;return db['Trigger'][_0x54fc('0x5a')]({'where':{'id':_0x2fbb3e['params']['id']}})[_0x54fc('0x28')](handleEntityNotFound(_0x1eeae6,null))[_0x54fc('0x28')](function(_0x5a60c8){if(_0x5a60c8){_0x1d9c9e=_0x5a60c8;_0x3a6d4d[_0x54fc('0x31')]=_[_0x54fc('0x33')](db[_0x54fc('0x5e')]['rawAttributes']);_0x3a6d4d[_0x54fc('0x36')]=_[_0x54fc('0x33')](_0x2fbb3e[_0x54fc('0x36')]);_0x3a6d4d[_0x54fc('0x34')]=_[_0x54fc('0x35')](_0x3a6d4d[_0x54fc('0x31')],_0x3a6d4d[_0x54fc('0x36')]);_0x52f386[_0x54fc('0x37')]=_[_0x54fc('0x35')](_0x3a6d4d[_0x54fc('0x31')],qs[_0x54fc('0x38')](_0x2fbb3e[_0x54fc('0x36')][_0x54fc('0x38')]));_0x52f386[_0x54fc('0x37')]=_0x52f386[_0x54fc('0x37')][_0x54fc('0x39')]?_0x52f386[_0x54fc('0x37')]:_0x3a6d4d[_0x54fc('0x31')];_0x52f386[_0x54fc('0x3c')]=qs[_0x54fc('0x3d')](_0x2fbb3e['query'][_0x54fc('0x3d')]);_0x52f386[_0x54fc('0x3e')]=qs[_0x54fc('0x34')](_[_0x54fc('0x3f')](_0x2fbb3e[_0x54fc('0x36')],_0x3a6d4d[_0x54fc('0x34')]));if(_0x2fbb3e[_0x54fc('0x36')][_0x54fc('0x40')]){_0x52f386[_0x54fc('0x3e')]=_[_0x54fc('0x41')](_0x52f386[_0x54fc('0x3e')],{'$or':_[_0x54fc('0x32')](_0x52f386[_0x54fc('0x37')],function(_0x1af8b0){var _0x3471a6={};_0x3471a6[_0x1af8b0]={'$like':'%'+_0x2fbb3e[_0x54fc('0x36')][_0x54fc('0x40')]+'%'};return _0x3471a6;})});}_0x52f386=_[_0x54fc('0x41')]({},_0x52f386,_0x2fbb3e[_0x54fc('0x43')]);return _0x1d9c9e[_0x54fc('0x5f')](_0x52f386);}})['then'](function(_0x52ebb1){if(_0x52ebb1){_0x9f31ee=_0x52ebb1[_0x54fc('0x39')];if(!_0x2fbb3e['query'][_0x54fc('0x3a')](_0x54fc('0x3b'))){_0x52f386['limit']=qs[_0x54fc('0x21')](_0x2fbb3e[_0x54fc('0x36')][_0x54fc('0x21')]);_0x52f386['offset']=qs[_0x54fc('0x1e')](_0x2fbb3e[_0x54fc('0x36')][_0x54fc('0x1e')]);}return _0x1d9c9e[_0x54fc('0x5f')](_0x52f386);}})[_0x54fc('0x28')](function(_0x1fc8fb){if(_0x1fc8fb){return _0x1fc8fb?{'count':_0x9f31ee,'rows':_0x1fc8fb}:null;}})['then'](respondWithResult(_0x1eeae6,null))[_0x54fc('0x48')](handleError(_0x1eeae6,null));}; \ No newline at end of file +var _0x842f=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAnyId','Condition','order','getAllConditions','getAnyConditions','findOne','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x4dcb47,_0x50ef92){var _0x352b40=function(_0x5bce21){while(--_0x5bce21){_0x4dcb47['push'](_0x4dcb47['shift']());}};_0x352b40(++_0x50ef92);}(_0x842f,0x10f));var _0xf842=function(_0x5caee2,_0x325a65){_0x5caee2=_0x5caee2-0x0;var _0x3f8747=_0x842f[_0x5caee2];return _0x3f8747;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf842('0x0'));var zipdir=require(_0xf842('0x1'));var jsonpatch=require(_0xf842('0x2'));var rp=require('request-promise');var moment=require(_0xf842('0x3'));var BPromise=require(_0xf842('0x4'));var Mustache=require('mustache');var util=require(_0xf842('0x5'));var path=require(_0xf842('0x6'));var sox=require('sox');var csv=require(_0xf842('0x7'));var ejs=require(_0xf842('0x8'));var fs=require('fs');var fs_extra=require(_0xf842('0x9'));var _=require(_0xf842('0xa'));var squel=require(_0xf842('0xb'));var crypto=require(_0xf842('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf842('0xd'));var toCsv=require(_0xf842('0x7'));var querystring=require('querystring');var Papa=require(_0xf842('0xe'));var Redis=require(_0xf842('0xf'));var authService=require(_0xf842('0x10'));var qs=require(_0xf842('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf842('0x12'));var logger=require(_0xf842('0x13'))(_0xf842('0x14'));var utils=require(_0xf842('0x15'));var config=require(_0xf842('0x16'));var licenseUtil=require(_0xf842('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120e07,_0x11c158){_0x11c158=_0x11c158||0xcc;return function(_0x3fe336){if(_0x3fe336){return _0x120e07[_0xf842('0x18')](_0x11c158);}return _0x120e07[_0xf842('0x19')](_0x11c158)[_0xf842('0x1a')]();};}function respondWithResult(_0x856ce3,_0x292a89){_0x292a89=_0x292a89||0xc8;return function(_0x25da67){if(_0x25da67){return _0x856ce3[_0xf842('0x19')](_0x292a89)['json'](_0x25da67);}};}function respondWithFilteredResult(_0x20a6c3,_0x29c74a){return function(_0xc0eeb6){if(_0xc0eeb6){var _0x140cee=typeof _0x29c74a[_0xf842('0x1b')]===_0xf842('0x1c')&&typeof _0x29c74a[_0xf842('0x1d')]==='undefined';var _0x46fb80=_0xc0eeb6[_0xf842('0x1e')];var _0x5c0c50=_0x140cee?0x0:_0x29c74a[_0xf842('0x1b')];var _0x2e3219=_0x140cee?_0xc0eeb6[_0xf842('0x1e')]:_0x29c74a['offset']+_0x29c74a[_0xf842('0x1d')];var _0x2184df;if(_0x2e3219>=_0x46fb80){_0x2e3219=_0x46fb80;_0x2184df=0xc8;}else{_0x2184df=0xce;}_0x20a6c3[_0xf842('0x19')](_0x2184df);return _0x20a6c3['set']('Content-Range',_0x5c0c50+'-'+_0x2e3219+'/'+_0x46fb80)[_0xf842('0x1f')](_0xc0eeb6);}return null;};}function patchUpdates(_0x1f5395){return function(_0x557f50){try{jsonpatch[_0xf842('0x20')](_0x557f50,_0x1f5395,!![]);}catch(_0x438ddd){return BPromise[_0xf842('0x21')](_0x438ddd);}return _0x557f50[_0xf842('0x22')]();};}function saveUpdates(_0x52bb05,_0x1d99da){return function(_0x235bf4){if(_0x235bf4){return _0x235bf4[_0xf842('0x23')](_0x52bb05)[_0xf842('0x24')](function(_0x55eb63){return _0x55eb63;});}return null;};}function removeEntity(_0x1cf628,_0x730b17){return function(_0x146a0d){if(_0x146a0d){return _0x146a0d['destroy']()[_0xf842('0x24')](function(){var _0x37943f=_0x146a0d[_0xf842('0x25')]({'plain':!![]});var _0x230b8b=_0xf842('0x26');return db[_0xf842('0x27')][_0xf842('0x28')]({'where':{'type':_0x230b8b,'resourceId':_0x37943f['id']}})['then'](function(){return _0x146a0d;});})[_0xf842('0x24')](function(){_0x1cf628[_0xf842('0x19')](0xcc)[_0xf842('0x1a')]();});}};}function handleEntityNotFound(_0x161293,_0x507457){return function(_0x3f3263){if(!_0x3f3263){_0x161293[_0xf842('0x18')](0x194);}return _0x3f3263;};}function handleError(_0x16e00c,_0x25a236){_0x25a236=_0x25a236||0x1f4;return function(_0x5b2fd9){logger[_0xf842('0x29')](_0x5b2fd9[_0xf842('0x2a')]);if(_0x5b2fd9[_0xf842('0x2b')]){delete _0x5b2fd9['name'];}_0x16e00c[_0xf842('0x19')](_0x25a236)[_0xf842('0x2c')](_0x5b2fd9);};}exports[_0xf842('0x2d')]=function(_0x191e81,_0x830d1e){var _0x3b8256={},_0x1b3e42={},_0x42efab={'count':0x0,'rows':[]};var _0x22cc5f=_['map'](db[_0xf842('0x2e')][_0xf842('0x2f')],function(_0x4e1ad6){return{'name':_0x4e1ad6[_0xf842('0x30')],'type':_0x4e1ad6[_0xf842('0x31')]['key']};});_0x1b3e42['model']=_[_0xf842('0x32')](_0x22cc5f,_0xf842('0x2b'));_0x1b3e42[_0xf842('0x33')]=_[_0xf842('0x34')](_0x191e81[_0xf842('0x33')]);_0x1b3e42[_0xf842('0x35')]=_[_0xf842('0x36')](_0x1b3e42[_0xf842('0x37')],_0x1b3e42[_0xf842('0x33')]);_0x3b8256[_0xf842('0x38')]=_[_0xf842('0x36')](_0x1b3e42[_0xf842('0x37')],qs['fields'](_0x191e81['query'][_0xf842('0x39')]));_0x3b8256[_0xf842('0x38')]=_0x3b8256['attributes']['length']?_0x3b8256[_0xf842('0x38')]:_0x1b3e42[_0xf842('0x37')];if(!_0x191e81[_0xf842('0x33')][_0xf842('0x3a')](_0xf842('0x3b'))){_0x3b8256[_0xf842('0x1d')]=qs[_0xf842('0x1d')](_0x191e81[_0xf842('0x33')][_0xf842('0x1d')]);_0x3b8256[_0xf842('0x1b')]=qs['offset'](_0x191e81[_0xf842('0x33')][_0xf842('0x1b')]);}_0x3b8256['order']=qs['sort'](_0x191e81[_0xf842('0x33')][_0xf842('0x3c')]);_0x3b8256[_0xf842('0x3d')]=qs[_0xf842('0x35')](_[_0xf842('0x3e')](_0x191e81[_0xf842('0x33')],_0x1b3e42['filters']),_0x22cc5f);if(_0x191e81[_0xf842('0x33')]['filter']){_0x3b8256['where']=_[_0xf842('0x3f')](_0x3b8256['where'],{'$or':_[_0xf842('0x32')](_0x22cc5f,function(_0x2e496b){if(_0x2e496b['type']!=='VIRTUAL'){var _0x5a7b80={};_0x5a7b80[_0x2e496b[_0xf842('0x2b')]]={'$like':'%'+_0x191e81[_0xf842('0x33')][_0xf842('0x40')]+'%'};return _0x5a7b80;}})});}_0x3b8256=_['merge']({},_0x3b8256,_0x191e81[_0xf842('0x41')]);var _0x50e60f={'where':_0x3b8256[_0xf842('0x3d')]};return db[_0xf842('0x2e')][_0xf842('0x1e')](_0x50e60f)[_0xf842('0x24')](function(_0x3f4e27){_0x42efab[_0xf842('0x1e')]=_0x3f4e27;if(_0x191e81[_0xf842('0x33')][_0xf842('0x42')]){_0x3b8256[_0xf842('0x43')]=[{'all':!![]}];}return db[_0xf842('0x2e')][_0xf842('0x44')](_0x3b8256);})[_0xf842('0x24')](function(_0x3822d7){_0x42efab[_0xf842('0x45')]=_0x3822d7;return _0x42efab;})[_0xf842('0x24')](respondWithFilteredResult(_0x830d1e,_0x3b8256))[_0xf842('0x46')](handleError(_0x830d1e,null));};exports[_0xf842('0x47')]=function(_0xfa3f47,_0x3daa1d){var _0x46bf86={'raw':![],'where':{'id':_0xfa3f47[_0xf842('0x48')]['id']}},_0x169b89={};_0x169b89[_0xf842('0x37')]=_[_0xf842('0x34')](db[_0xf842('0x2e')][_0xf842('0x2f')]);_0x169b89[_0xf842('0x33')]=_['keys'](_0xfa3f47[_0xf842('0x33')]);_0x169b89[_0xf842('0x35')]=_[_0xf842('0x36')](_0x169b89[_0xf842('0x37')],_0x169b89[_0xf842('0x33')]);_0x46bf86[_0xf842('0x38')]=_[_0xf842('0x36')](_0x169b89[_0xf842('0x37')],qs[_0xf842('0x39')](_0xfa3f47[_0xf842('0x33')][_0xf842('0x39')]));_0x46bf86[_0xf842('0x38')]=_0x46bf86[_0xf842('0x38')][_0xf842('0x49')]?_0x46bf86[_0xf842('0x38')]:_0x169b89[_0xf842('0x37')];if(_0xfa3f47[_0xf842('0x33')][_0xf842('0x42')]){_0x46bf86[_0xf842('0x43')]=[{'all':!![]}];}_0x46bf86=_[_0xf842('0x3f')]({},_0x46bf86,_0xfa3f47['options']);return db['Trigger'][_0xf842('0x4a')](_0x46bf86)[_0xf842('0x24')](handleEntityNotFound(_0x3daa1d,null))[_0xf842('0x24')](respondWithResult(_0x3daa1d,null))[_0xf842('0x46')](handleError(_0x3daa1d,null));};exports[_0xf842('0x4b')]=function(_0x58193f,_0x4b17ba){return db[_0xf842('0x2e')]['create'](_0x58193f[_0xf842('0x4c')],{})['then'](function(_0x203678){var _0x1d23bb=_0x58193f[_0xf842('0x4d')][_0xf842('0x25')]({'plain':!![]});if(!_0x1d23bb)throw new Error(_0xf842('0x4e'));if(_0x1d23bb[_0xf842('0x4f')]===_0xf842('0x4d')){var _0x464c60=_0x203678[_0xf842('0x25')]({'plain':!![]});var _0x30fb8b=_0xf842('0x26');return db[_0xf842('0x50')][_0xf842('0x4a')]({'where':{'name':_0x30fb8b,'userProfileId':_0x1d23bb[_0xf842('0x51')]},'raw':!![]})[_0xf842('0x24')](function(_0x35ba8d){if(_0x35ba8d&&_0x35ba8d['autoAssociation']===0x0){return db[_0xf842('0x27')][_0xf842('0x4b')]({'name':_0x464c60[_0xf842('0x2b')],'resourceId':_0x464c60['id'],'type':_0x35ba8d[_0xf842('0x2b')],'sectionId':_0x35ba8d['id']},{})['then'](function(){return _0x203678;});}else{return _0x203678;}})[_0xf842('0x46')](function(_0x228ca2){logger['error'](_0xf842('0x52'),_0x228ca2);throw _0x228ca2;});}return _0x203678;})[_0xf842('0x24')](respondWithResult(_0x4b17ba,0xc9))[_0xf842('0x46')](handleError(_0x4b17ba,null));};exports['update']=function(_0x4dc5b0,_0x53cda3){if(_0x4dc5b0[_0xf842('0x4c')]['id']){delete _0x4dc5b0[_0xf842('0x4c')]['id'];}return db[_0xf842('0x2e')][_0xf842('0x4a')]({'where':{'id':_0x4dc5b0['params']['id']}})[_0xf842('0x24')](handleEntityNotFound(_0x53cda3,null))[_0xf842('0x24')](saveUpdates(_0x4dc5b0['body'],null))[_0xf842('0x24')](respondWithResult(_0x53cda3,null))['catch'](handleError(_0x53cda3,null));};exports[_0xf842('0x28')]=function(_0x403bc6,_0x3e40e9){return db[_0xf842('0x2e')]['find']({'where':{'id':_0x403bc6[_0xf842('0x48')]['id']}})[_0xf842('0x24')](handleEntityNotFound(_0x3e40e9,null))[_0xf842('0x24')](removeEntity(_0x3e40e9,null))[_0xf842('0x46')](handleError(_0x3e40e9,null));};exports['addAllCondition']=function(_0x3df4c9,_0xae32c0,_0x41bbd4){if(_0x3df4c9[_0xf842('0x4c')]['id']){delete _0x3df4c9['body']['id'];}return db[_0xf842('0x2e')][_0xf842('0x4a')]({'where':{'id':_0x3df4c9[_0xf842('0x48')]['id']}})['then'](handleEntityNotFound(_0xae32c0,null))[_0xf842('0x24')](function(_0x5ad019){if(_0x5ad019){_0x3df4c9[_0xf842('0x4c')]['TriggerAllId']=_0x5ad019['id'];return db['Condition'][_0xf842('0x4b')](_0x3df4c9[_0xf842('0x4c')]);}})[_0xf842('0x24')](respondWithResult(_0xae32c0,null))[_0xf842('0x46')](handleError(_0xae32c0,null));};exports['addAnyCondition']=function(_0x2d8c28,_0x37e93f,_0x406eca){if(_0x2d8c28[_0xf842('0x4c')]['id']){delete _0x2d8c28['body']['id'];}return db['Trigger'][_0xf842('0x4a')]({'where':{'id':_0x2d8c28['params']['id']}})['then'](handleEntityNotFound(_0x37e93f,null))['then'](function(_0x2f4393){if(_0x2f4393){_0x2d8c28[_0xf842('0x4c')][_0xf842('0x53')]=_0x2f4393['id'];return db['Condition']['create'](_0x2d8c28['body']);}})[_0xf842('0x24')](respondWithResult(_0x37e93f,null))[_0xf842('0x46')](handleError(_0x37e93f,null));};exports['getAllConditions']=function(_0x1443c5,_0xbcbb8,_0x54f1b8){var _0x3e5f6e={};var _0x2c77a6={};var _0x44afe4;var _0x55af21;return db[_0xf842('0x2e')]['findOne']({'where':{'id':_0x1443c5[_0xf842('0x48')]['id']}})[_0xf842('0x24')](handleEntityNotFound(_0xbcbb8,null))[_0xf842('0x24')](function(_0x15be50){if(_0x15be50){_0x44afe4=_0x15be50;_0x2c77a6[_0xf842('0x37')]=_[_0xf842('0x34')](db[_0xf842('0x54')][_0xf842('0x2f')]);_0x2c77a6[_0xf842('0x33')]=_[_0xf842('0x34')](_0x1443c5[_0xf842('0x33')]);_0x2c77a6['filters']=_['intersection'](_0x2c77a6[_0xf842('0x37')],_0x2c77a6['query']);_0x3e5f6e[_0xf842('0x38')]=_[_0xf842('0x36')](_0x2c77a6[_0xf842('0x37')],qs[_0xf842('0x39')](_0x1443c5[_0xf842('0x33')][_0xf842('0x39')]));_0x3e5f6e[_0xf842('0x38')]=_0x3e5f6e['attributes'][_0xf842('0x49')]?_0x3e5f6e[_0xf842('0x38')]:_0x2c77a6[_0xf842('0x37')];_0x3e5f6e[_0xf842('0x55')]=qs[_0xf842('0x3c')](_0x1443c5[_0xf842('0x33')]['sort']);_0x3e5f6e[_0xf842('0x3d')]=qs[_0xf842('0x35')](_['pick'](_0x1443c5[_0xf842('0x33')],_0x2c77a6['filters']));if(_0x1443c5['query'][_0xf842('0x40')]){_0x3e5f6e[_0xf842('0x3d')]=_[_0xf842('0x3f')](_0x3e5f6e[_0xf842('0x3d')],{'$or':_[_0xf842('0x32')](_0x3e5f6e[_0xf842('0x38')],function(_0xe3547e){var _0x4313a0={};_0x4313a0[_0xe3547e]={'$like':'%'+_0x1443c5['query']['filter']+'%'};return _0x4313a0;})});}_0x3e5f6e=_[_0xf842('0x3f')]({},_0x3e5f6e,_0x1443c5[_0xf842('0x41')]);return _0x44afe4['getAllConditions'](_0x3e5f6e);}})[_0xf842('0x24')](function(_0x1ebcb1){if(_0x1ebcb1){_0x55af21=_0x1ebcb1[_0xf842('0x49')];if(!_0x1443c5[_0xf842('0x33')][_0xf842('0x3a')](_0xf842('0x3b'))){_0x3e5f6e[_0xf842('0x1d')]=qs[_0xf842('0x1d')](_0x1443c5[_0xf842('0x33')]['limit']);_0x3e5f6e[_0xf842('0x1b')]=qs[_0xf842('0x1b')](_0x1443c5['query'][_0xf842('0x1b')]);}return _0x44afe4[_0xf842('0x56')](_0x3e5f6e);}})[_0xf842('0x24')](function(_0x55d6d9){if(_0x55d6d9){return _0x55d6d9?{'count':_0x55af21,'rows':_0x55d6d9}:null;}})[_0xf842('0x24')](respondWithResult(_0xbcbb8,null))[_0xf842('0x46')](handleError(_0xbcbb8,null));};exports[_0xf842('0x57')]=function(_0x296723,_0x43ff8a,_0x1a0bb9){var _0x597c50={};var _0x14bb3f={};var _0x4d5c1b;var _0x4512b6;return db['Trigger'][_0xf842('0x58')]({'where':{'id':_0x296723[_0xf842('0x48')]['id']}})['then'](handleEntityNotFound(_0x43ff8a,null))[_0xf842('0x24')](function(_0x3b8efc){if(_0x3b8efc){_0x4d5c1b=_0x3b8efc;_0x14bb3f[_0xf842('0x37')]=_[_0xf842('0x34')](db[_0xf842('0x54')][_0xf842('0x2f')]);_0x14bb3f[_0xf842('0x33')]=_['keys'](_0x296723[_0xf842('0x33')]);_0x14bb3f[_0xf842('0x35')]=_[_0xf842('0x36')](_0x14bb3f['model'],_0x14bb3f[_0xf842('0x33')]);_0x597c50[_0xf842('0x38')]=_[_0xf842('0x36')](_0x14bb3f[_0xf842('0x37')],qs[_0xf842('0x39')](_0x296723[_0xf842('0x33')]['fields']));_0x597c50[_0xf842('0x38')]=_0x597c50[_0xf842('0x38')][_0xf842('0x49')]?_0x597c50[_0xf842('0x38')]:_0x14bb3f[_0xf842('0x37')];_0x597c50[_0xf842('0x55')]=qs[_0xf842('0x3c')](_0x296723[_0xf842('0x33')][_0xf842('0x3c')]);_0x597c50['where']=qs['filters'](_[_0xf842('0x3e')](_0x296723[_0xf842('0x33')],_0x14bb3f[_0xf842('0x35')]));if(_0x296723[_0xf842('0x33')][_0xf842('0x40')]){_0x597c50['where']=_['merge'](_0x597c50['where'],{'$or':_[_0xf842('0x32')](_0x597c50[_0xf842('0x38')],function(_0x312527){var _0x478ef7={};_0x478ef7[_0x312527]={'$like':'%'+_0x296723['query'][_0xf842('0x40')]+'%'};return _0x478ef7;})});}_0x597c50=_['merge']({},_0x597c50,_0x296723[_0xf842('0x41')]);return _0x4d5c1b['getAnyConditions'](_0x597c50);}})[_0xf842('0x24')](function(_0x495752){if(_0x495752){_0x4512b6=_0x495752[_0xf842('0x49')];if(!_0x296723[_0xf842('0x33')]['hasOwnProperty'](_0xf842('0x3b'))){_0x597c50['limit']=qs[_0xf842('0x1d')](_0x296723[_0xf842('0x33')][_0xf842('0x1d')]);_0x597c50[_0xf842('0x1b')]=qs['offset'](_0x296723['query'][_0xf842('0x1b')]);}return _0x4d5c1b[_0xf842('0x57')](_0x597c50);}})[_0xf842('0x24')](function(_0x131c12){if(_0x131c12){return _0x131c12?{'count':_0x4512b6,'rows':_0x131c12}:null;}})[_0xf842('0x24')](respondWithResult(_0x43ff8a,null))[_0xf842('0x46')](handleError(_0x43ff8a,null));};exports[_0xf842('0x59')]=function(_0x1cca27,_0x32214a,_0x44cf9d){if(_0x1cca27[_0xf842('0x4c')]['id']){delete _0x1cca27[_0xf842('0x4c')]['id'];}return db[_0xf842('0x2e')][_0xf842('0x4a')]({'where':{'id':_0x1cca27[_0xf842('0x48')]['id']}})[_0xf842('0x24')](handleEntityNotFound(_0x32214a,null))[_0xf842('0x24')](function(_0x4faf9e){if(_0x4faf9e){_0x1cca27[_0xf842('0x4c')]['TriggerId']=_0x4faf9e['id'];return db['Action'][_0xf842('0x4b')](_0x1cca27[_0xf842('0x4c')]);}})[_0xf842('0x24')](respondWithResult(_0x32214a,null))[_0xf842('0x46')](handleError(_0x32214a,null));};exports['getActions']=function(_0x4aaf22,_0x165675,_0x333159){var _0x1bf39b={};var _0x276641={};var _0x365546;var _0x484474;return db[_0xf842('0x2e')][_0xf842('0x58')]({'where':{'id':_0x4aaf22[_0xf842('0x48')]['id']}})[_0xf842('0x24')](handleEntityNotFound(_0x165675,null))[_0xf842('0x24')](function(_0x4055f9){if(_0x4055f9){_0x365546=_0x4055f9;_0x276641[_0xf842('0x37')]=_['keys'](db[_0xf842('0x5a')][_0xf842('0x2f')]);_0x276641[_0xf842('0x33')]=_[_0xf842('0x34')](_0x4aaf22[_0xf842('0x33')]);_0x276641[_0xf842('0x35')]=_['intersection'](_0x276641[_0xf842('0x37')],_0x276641[_0xf842('0x33')]);_0x1bf39b['attributes']=_['intersection'](_0x276641['model'],qs[_0xf842('0x39')](_0x4aaf22[_0xf842('0x33')][_0xf842('0x39')]));_0x1bf39b['attributes']=_0x1bf39b[_0xf842('0x38')][_0xf842('0x49')]?_0x1bf39b[_0xf842('0x38')]:_0x276641[_0xf842('0x37')];_0x1bf39b['order']=qs['sort'](_0x4aaf22[_0xf842('0x33')][_0xf842('0x3c')]);_0x1bf39b[_0xf842('0x3d')]=qs['filters'](_[_0xf842('0x3e')](_0x4aaf22[_0xf842('0x33')],_0x276641['filters']));if(_0x4aaf22[_0xf842('0x33')]['filter']){_0x1bf39b[_0xf842('0x3d')]=_[_0xf842('0x3f')](_0x1bf39b[_0xf842('0x3d')],{'$or':_[_0xf842('0x32')](_0x1bf39b[_0xf842('0x38')],function(_0x4463db){var _0x278ab4={};_0x278ab4[_0x4463db]={'$like':'%'+_0x4aaf22['query']['filter']+'%'};return _0x278ab4;})});}_0x1bf39b=_[_0xf842('0x3f')]({},_0x1bf39b,_0x4aaf22[_0xf842('0x41')]);return _0x365546['getActions'](_0x1bf39b);}})['then'](function(_0x318508){if(_0x318508){_0x484474=_0x318508[_0xf842('0x49')];if(!_0x4aaf22[_0xf842('0x33')][_0xf842('0x3a')](_0xf842('0x3b'))){_0x1bf39b['limit']=qs[_0xf842('0x1d')](_0x4aaf22[_0xf842('0x33')][_0xf842('0x1d')]);_0x1bf39b['offset']=qs[_0xf842('0x1b')](_0x4aaf22[_0xf842('0x33')][_0xf842('0x1b')]);}return _0x365546[_0xf842('0x5b')](_0x1bf39b);}})[_0xf842('0x24')](function(_0x11bfa0){if(_0x11bfa0){return _0x11bfa0?{'count':_0x484474,'rows':_0x11bfa0}:null;}})[_0xf842('0x24')](respondWithResult(_0x165675,null))['catch'](handleError(_0x165675,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a1058d3..5d3ab7d 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 _0x2fda=['lodash','api','moment','bluebird','request-promise','path','exports','define','Trigger','tools_triggers'];(function(_0x39adb6,_0x29e29b){var _0x1f24d1=function(_0x48b57d){while(--_0x48b57d){_0x39adb6['push'](_0x39adb6['shift']());}};_0x1f24d1(++_0x29e29b);}(_0x2fda,0x186));var _0xa2fd=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x2fda[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xa2fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2fd('0x1'));var moment=require(_0xa2fd('0x2'));var BPromise=require(_0xa2fd('0x3'));var rp=require(_0xa2fd('0x4'));var fs=require('fs');var path=require(_0xa2fd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0xa2fd('0x6')]=function(_0x1bab5a,_0x4c6b0b){return _0x1bab5a[_0xa2fd('0x7')](_0xa2fd('0x8'),attributes,{'tableName':_0xa2fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacfe=['tools_triggers','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x221797,_0x22992b){var _0x1f7672=function(_0x39fca1){while(--_0x39fca1){_0x221797['push'](_0x221797['shift']());}};_0x1f7672(++_0x22992b);}(_0xacfe,0xfd));var _0xeacf=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xacfe[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeacf('0x0'))(_0xeacf('0x1'));var moment=require(_0xeacf('0x2'));var BPromise=require(_0xeacf('0x3'));var rp=require(_0xeacf('0x4'));var fs=require('fs');var path=require(_0xeacf('0x5'));var rimraf=require(_0xeacf('0x6'));var config=require(_0xeacf('0x7'));var attributes=require(_0xeacf('0x8'));module[_0xeacf('0x9')]=function(_0x369ad7,_0x229f28){return _0x369ad7[_0xeacf('0xa')]('Trigger',attributes,{'tableName':_0xeacf('0xb'),'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 45d33e8..6b114a3 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 _0xe6cb=['attributes','limit','map','include','model','GetTrigger','stringify','ShowTrigger','Trigger','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','Trigger,\x20%s,\x20%s','message','result','catch','options'];(function(_0x44e35e,_0x5a2801){var _0x2d02e0=function(_0x39f15e){while(--_0x39f15e){_0x44e35e['push'](_0x44e35e['shift']());}};_0x2d02e0(++_0x5a2801);}(_0xe6cb,0x1d8));var _0xbe6c=function(_0x1f7ef8,_0xa1f4f6){_0x1f7ef8=_0x1f7ef8-0x0;var _0x9ed5e8=_0xe6cb[_0x1f7ef8];return _0x9ed5e8;};'use strict';var _=require(_0xbe6c('0x0'));var util=require(_0xbe6c('0x1'));var moment=require(_0xbe6c('0x2'));var BPromise=require(_0xbe6c('0x3'));var rs=require(_0xbe6c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe6c('0x5'))['db'];var utils=require(_0xbe6c('0x6'));var logger=require(_0xbe6c('0x7'))(_0xbe6c('0x8'));var config=require(_0xbe6c('0x9'));var jayson=require(_0xbe6c('0xa'));var client=jayson['client'][_0xbe6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x539711,_0x4f11a9,_0x24b639){return new BPromise(function(_0x58e3b6,_0xdcf309){return client['request'](_0x539711,_0x24b639)[_0xbe6c('0xc')](function(_0x2b1d1f){logger[_0xbe6c('0xd')]('Trigger,\x20%s,\x20%s',_0x4f11a9,'request\x20sent');logger[_0xbe6c('0xe')](_0xbe6c('0xf'),_0x4f11a9,_0xbe6c('0x10'),JSON['stringify'](_0x2b1d1f));if(_0x2b1d1f['error']){if(_0x2b1d1f['error']['code']===0x1f4){logger[_0xbe6c('0x11')]('Trigger,\x20%s,\x20%s',_0x4f11a9,_0x2b1d1f[_0xbe6c('0x11')]['message']);return _0xdcf309(_0x2b1d1f['error']['message']);}logger[_0xbe6c('0x11')](_0xbe6c('0x12'),_0x4f11a9,_0x2b1d1f[_0xbe6c('0x11')]['message']);return _0x58e3b6(_0x2b1d1f[_0xbe6c('0x11')][_0xbe6c('0x13')]);}else{logger['info'](_0xbe6c('0x12'),_0x4f11a9,'request\x20sent');_0x58e3b6(_0x2b1d1f[_0xbe6c('0x14')][_0xbe6c('0x13')]);}})[_0xbe6c('0x15')](function(_0x5922b5){logger[_0xbe6c('0x11')]('Trigger,\x20%s,\x20%s',_0x4f11a9,_0x5922b5);_0xdcf309(_0x5922b5);});});}exports['GetTrigger']=function(_0x3e1756){var _0x5e9707=this;return new Promise(function(_0x2e3c59,_0x2cc319){return db['Trigger']['findAll']({'raw':_0x3e1756[_0xbe6c('0x16')]?_0x3e1756[_0xbe6c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3e1756[_0xbe6c('0x16')]?_0x3e1756[_0xbe6c('0x16')]['where']||null:null,'attributes':_0x3e1756['options']?_0x3e1756['options'][_0xbe6c('0x17')]||null:null,'limit':_0x3e1756['options']?_0x3e1756[_0xbe6c('0x16')][_0xbe6c('0x18')]||null:null,'include':_0x3e1756[_0xbe6c('0x16')]?_0x3e1756[_0xbe6c('0x16')]['include']?_[_0xbe6c('0x19')](_0x3e1756[_0xbe6c('0x16')][_0xbe6c('0x1a')],function(_0x406e20){return{'model':db[_0x406e20['model']],'as':_0x406e20['as'],'attributes':_0x406e20[_0xbe6c('0x17')],'include':_0x406e20[_0xbe6c('0x1a')]?_[_0xbe6c('0x19')](_0x406e20['include'],function(_0x4c28c0){return{'model':db[_0x4c28c0['model']],'as':_0x4c28c0['as'],'attributes':_0x4c28c0[_0xbe6c('0x17')],'include':_0x4c28c0[_0xbe6c('0x1a')]?_[_0xbe6c('0x19')](_0x4c28c0[_0xbe6c('0x1a')],function(_0x2b1a17){return{'model':db[_0x2b1a17[_0xbe6c('0x1b')]],'as':_0x2b1a17['as'],'attributes':_0x2b1a17[_0xbe6c('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbe6c('0xc')](function(_0x566577){logger[_0xbe6c('0xd')](_0xbe6c('0x1c'),_0x3e1756);logger[_0xbe6c('0xe')](_0xbe6c('0x1c'),_0x3e1756,JSON[_0xbe6c('0x1d')](_0x566577));_0x2e3c59(_0x566577);})[_0xbe6c('0x15')](function(_0x2c1e6e){logger['error']('GetTrigger',_0x2c1e6e['message'],_0x3e1756);_0x2cc319(_0x5e9707[_0xbe6c('0x11')](0x1f4,_0x2c1e6e[_0xbe6c('0x13')]));});});};exports[_0xbe6c('0x1e')]=function(_0x4eed6e){var _0x4d6268=this;return new Promise(function(_0x82df14,_0x512b84){return db[_0xbe6c('0x1f')]['find']({'raw':_0x4eed6e[_0xbe6c('0x16')]?_0x4eed6e[_0xbe6c('0x16')][_0xbe6c('0x20')]===undefined?!![]:![]:!![],'where':_0x4eed6e[_0xbe6c('0x16')]?_0x4eed6e[_0xbe6c('0x16')]['where']||null:null,'attributes':_0x4eed6e[_0xbe6c('0x16')]?_0x4eed6e[_0xbe6c('0x16')][_0xbe6c('0x17')]||null:null,'include':_0x4eed6e[_0xbe6c('0x16')]?_0x4eed6e[_0xbe6c('0x16')]['include']?_[_0xbe6c('0x19')](_0x4eed6e[_0xbe6c('0x16')]['include'],function(_0x47217d){return{'model':db[_0x47217d[_0xbe6c('0x1b')]],'as':_0x47217d['as'],'attributes':_0x47217d[_0xbe6c('0x17')],'include':_0x47217d[_0xbe6c('0x1a')]?_['map'](_0x47217d[_0xbe6c('0x1a')],function(_0x3e7fda){return{'model':db[_0x3e7fda['model']],'as':_0x3e7fda['as'],'attributes':_0x3e7fda[_0xbe6c('0x17')],'include':_0x3e7fda['include']?_[_0xbe6c('0x19')](_0x3e7fda[_0xbe6c('0x1a')],function(_0x575a7e){return{'model':db[_0x575a7e[_0xbe6c('0x1b')]],'as':_0x575a7e['as'],'attributes':_0x575a7e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x39c5a2){logger[_0xbe6c('0xd')](_0xbe6c('0x1e'),_0x4eed6e);logger[_0xbe6c('0xe')](_0xbe6c('0x1e'),_0x4eed6e,JSON[_0xbe6c('0x1d')](_0x39c5a2));_0x82df14(_0x39c5a2);})['catch'](function(_0x223b53){logger[_0xbe6c('0x11')]('ShowTrigger',_0x223b53[_0xbe6c('0x13')],_0x4eed6e);_0x512b84(_0x4d6268['error'](0x1f4,_0x223b53[_0xbe6c('0x13')]));});});}; \ No newline at end of file +var _0x5294=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','include','model','map','ShowTrigger','find','util','moment','bluebird','randomstring'];(function(_0x273f88,_0x5d4150){var _0x177ca1=function(_0xf46ec4){while(--_0xf46ec4){_0x273f88['push'](_0x273f88['shift']());}};_0x177ca1(++_0x5d4150);}(_0x5294,0xda));var _0x4529=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5294[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x4529('0x0'));var moment=require(_0x4529('0x1'));var BPromise=require(_0x4529('0x2'));var rs=require(_0x4529('0x3'));var fs=require('fs');var Redis=require(_0x4529('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4529('0x5'));var logger=require(_0x4529('0x6'))(_0x4529('0x7'));var config=require(_0x4529('0x8'));var jayson=require(_0x4529('0x9'));var client=jayson[_0x4529('0xa')][_0x4529('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda0494,_0x426052,_0x11ea1c){return new BPromise(function(_0x51f2ff,_0x5d173f){return client[_0x4529('0xc')](_0xda0494,_0x11ea1c)[_0x4529('0xd')](function(_0x56e385){logger[_0x4529('0xe')](_0x4529('0xf'),_0x426052,_0x4529('0x10'));logger[_0x4529('0x11')](_0x4529('0x12'),_0x426052,_0x4529('0x10'),JSON[_0x4529('0x13')](_0x56e385));if(_0x56e385[_0x4529('0x14')]){if(_0x56e385[_0x4529('0x14')][_0x4529('0x15')]===0x1f4){logger[_0x4529('0x14')](_0x4529('0xf'),_0x426052,_0x56e385['error'][_0x4529('0x16')]);return _0x5d173f(_0x56e385[_0x4529('0x14')][_0x4529('0x16')]);}logger[_0x4529('0x14')](_0x4529('0xf'),_0x426052,_0x56e385[_0x4529('0x14')]['message']);return _0x51f2ff(_0x56e385['error'][_0x4529('0x16')]);}else{logger[_0x4529('0xe')](_0x4529('0xf'),_0x426052,_0x4529('0x10'));_0x51f2ff(_0x56e385[_0x4529('0x17')][_0x4529('0x16')]);}})[_0x4529('0x18')](function(_0x2adc46){logger['error'](_0x4529('0xf'),_0x426052,_0x2adc46);_0x5d173f(_0x2adc46);});});}exports[_0x4529('0x19')]=function(_0x44c39f){var _0x2ac276=this;return new Promise(function(_0x1ef91b,_0x519f5e){return db[_0x4529('0x1a')]['findAll']({'raw':_0x44c39f[_0x4529('0x1b')]?_0x44c39f[_0x4529('0x1b')][_0x4529('0x1c')]===undefined?!![]:![]:!![],'where':_0x44c39f[_0x4529('0x1b')]?_0x44c39f[_0x4529('0x1b')][_0x4529('0x1d')]||null:null,'attributes':_0x44c39f[_0x4529('0x1b')]?_0x44c39f[_0x4529('0x1b')][_0x4529('0x1e')]||null:null,'limit':_0x44c39f[_0x4529('0x1b')]?_0x44c39f[_0x4529('0x1b')][_0x4529('0x1f')]||null:null,'include':_0x44c39f[_0x4529('0x1b')]?_0x44c39f[_0x4529('0x1b')][_0x4529('0x20')]?_['map'](_0x44c39f['options'][_0x4529('0x20')],function(_0x576a6f){return{'model':db[_0x576a6f[_0x4529('0x21')]],'as':_0x576a6f['as'],'attributes':_0x576a6f['attributes'],'include':_0x576a6f[_0x4529('0x20')]?_[_0x4529('0x22')](_0x576a6f[_0x4529('0x20')],function(_0x42d2de){return{'model':db[_0x42d2de[_0x4529('0x21')]],'as':_0x42d2de['as'],'attributes':_0x42d2de[_0x4529('0x1e')],'include':_0x42d2de[_0x4529('0x20')]?_[_0x4529('0x22')](_0x42d2de[_0x4529('0x20')],function(_0x24b5c9){return{'model':db[_0x24b5c9[_0x4529('0x21')]],'as':_0x24b5c9['as'],'attributes':_0x24b5c9[_0x4529('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4529('0xd')](function(_0x6a854c){logger[_0x4529('0xe')]('GetTrigger',_0x44c39f);logger[_0x4529('0x11')](_0x4529('0x19'),_0x44c39f,JSON[_0x4529('0x13')](_0x6a854c));_0x1ef91b(_0x6a854c);})['catch'](function(_0x329e62){logger[_0x4529('0x14')]('GetTrigger',_0x329e62[_0x4529('0x16')],_0x44c39f);_0x519f5e(_0x2ac276[_0x4529('0x14')](0x1f4,_0x329e62[_0x4529('0x16')]));});});};exports[_0x4529('0x23')]=function(_0x3202ee){var _0x3a4793=this;return new Promise(function(_0xcb28ec,_0x22711c){return db['Trigger'][_0x4529('0x24')]({'raw':_0x3202ee[_0x4529('0x1b')]?_0x3202ee[_0x4529('0x1b')][_0x4529('0x1c')]===undefined?!![]:![]:!![],'where':_0x3202ee[_0x4529('0x1b')]?_0x3202ee[_0x4529('0x1b')][_0x4529('0x1d')]||null:null,'attributes':_0x3202ee[_0x4529('0x1b')]?_0x3202ee[_0x4529('0x1b')][_0x4529('0x1e')]||null:null,'include':_0x3202ee['options']?_0x3202ee['options'][_0x4529('0x20')]?_[_0x4529('0x22')](_0x3202ee[_0x4529('0x1b')]['include'],function(_0x43cf04){return{'model':db[_0x43cf04[_0x4529('0x21')]],'as':_0x43cf04['as'],'attributes':_0x43cf04[_0x4529('0x1e')],'include':_0x43cf04[_0x4529('0x20')]?_[_0x4529('0x22')](_0x43cf04[_0x4529('0x20')],function(_0x7a3095){return{'model':db[_0x7a3095[_0x4529('0x21')]],'as':_0x7a3095['as'],'attributes':_0x7a3095[_0x4529('0x1e')],'include':_0x7a3095[_0x4529('0x20')]?_[_0x4529('0x22')](_0x7a3095['include'],function(_0x123eec){return{'model':db[_0x123eec[_0x4529('0x21')]],'as':_0x123eec['as'],'attributes':_0x123eec[_0x4529('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4529('0xd')](function(_0x48530c){logger[_0x4529('0xe')]('ShowTrigger',_0x3202ee);logger['debug'](_0x4529('0x23'),_0x3202ee,JSON[_0x4529('0x13')](_0x48530c));_0xcb28ec(_0x48530c);})[_0x4529('0x18')](function(_0x453603){logger[_0x4529('0x14')](_0x4529('0x23'),_0x453603['message'],_0x3202ee);_0x22711c(_0x3a4793['error'](0x1f4,_0x453603[_0x4529('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 51290ea..8e347ab 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 _0xad20=['isAuthenticated','show','post','/:id/clone','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id'];(function(_0x4bab11,_0x4fe44b){var _0x1b69e8=function(_0x4fad39){while(--_0x4fad39){_0x4bab11['push'](_0x4bab11['shift']());}};_0x1b69e8(++_0x4fe44b);}(_0xad20,0x1d6));var _0x0ad2=function(_0x5c1d9b,_0x3117b0){_0x5c1d9b=_0x5c1d9b-0x0;var _0x229290=_0xad20[_0x5c1d9b];return _0x229290;};'use strict';var multer=require(_0x0ad2('0x0'));var util=require(_0x0ad2('0x1'));var path=require('path');var timeout=require(_0x0ad2('0x2'));var express=require(_0x0ad2('0x3'));var router=express[_0x0ad2('0x4')]();var fs_extra=require(_0x0ad2('0x5'));var auth=require(_0x0ad2('0x6'));var interaction=require(_0x0ad2('0x7'));var config=require(_0x0ad2('0x8'));var controller=require(_0x0ad2('0x9'));router[_0x0ad2('0xa')]('/',auth['isAuthenticated'](),controller[_0x0ad2('0xb')]);router['get'](_0x0ad2('0xc'),auth[_0x0ad2('0xd')](),controller[_0x0ad2('0xe')]);router[_0x0ad2('0xf')](_0x0ad2('0x10'),auth[_0x0ad2('0xd')](),controller['clone']);router[_0x0ad2('0xf')]('/',auth[_0x0ad2('0xd')](),controller['create']);router[_0x0ad2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0ad2('0x12')]);router['delete'](_0x0ad2('0xc'),auth[_0x0ad2('0xd')](),controller[_0x0ad2('0x13')]);module[_0x0ad2('0x14')]=router; \ No newline at end of file +var _0x1659=['post','clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show'];(function(_0x370650,_0x5cbc15){var _0x3e008a=function(_0x2e263e){while(--_0x2e263e){_0x370650['push'](_0x370650['shift']());}};_0x3e008a(++_0x5cbc15);}(_0x1659,0x18f));var _0x9165=function(_0x407f2a,_0x2ecf2c){_0x407f2a=_0x407f2a-0x0;var _0x38a01b=_0x1659[_0x407f2a];return _0x38a01b;};'use strict';var multer=require(_0x9165('0x0'));var util=require(_0x9165('0x1'));var path=require(_0x9165('0x2'));var timeout=require(_0x9165('0x3'));var express=require(_0x9165('0x4'));var router=express['Router']();var fs_extra=require(_0x9165('0x5'));var auth=require(_0x9165('0x6'));var interaction=require(_0x9165('0x7'));var config=require(_0x9165('0x8'));var controller=require(_0x9165('0x9'));router['get']('/',auth[_0x9165('0xa')](),controller[_0x9165('0xb')]);router[_0x9165('0xc')](_0x9165('0xd'),auth[_0x9165('0xa')](),controller[_0x9165('0xe')]);router[_0x9165('0xf')]('/:id/clone',auth[_0x9165('0xa')](),controller[_0x9165('0x10')]);router[_0x9165('0xf')]('/',auth[_0x9165('0xa')](),controller[_0x9165('0x11')]);router[_0x9165('0x12')](_0x9165('0xd'),auth[_0x9165('0xa')](),controller[_0x9165('0x13')]);router[_0x9165('0x14')](_0x9165('0xd'),auth[_0x9165('0xa')](),controller[_0x9165('0x15')]);module[_0x9165('0x16')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 40f10d5..1965f62 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 _0xee89=['transport','join','getDataValue','split','rfc2833','shortinfo','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','port,invite','insecure','INTEGER','\x22\x22\x20<>','always','accept','originate','uas','pai','fingerprint','certificate','active','actpass','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xee89,0xd6));var _0x9ee8=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xee89[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x9ee8('0x0'));module[_0x9ee8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ee8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x4'),'user',_0x9ee8('0x5')),'allowNull':![],'defaultValue':_0x9ee8('0x4')},'context':{'type':Sequelize[_0x9ee8('0x6')],'allowNull':![],'defaultValue':_0x9ee8('0x7')},'callingpres':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x8'),_0x9ee8('0x9'),_0x9ee8('0xa'),_0x9ee8('0xb'),_0x9ee8('0xc'),'PROHIB_PASSED_SCREEN',_0x9ee8('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x9ee8('0x6')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x9ee8('0x6')]},'md5secret':{'type':Sequelize[_0x9ee8('0x6')]},'remotesecret':{'type':Sequelize[_0x9ee8('0x6')]},'transport':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':_0x9ee8('0xe'),'set':function(_0x524113){this[_0x9ee8('0xf')](_0x9ee8('0x10'),_0x524113?_0x524113[_0x9ee8('0x11')](','):null);},'get':function(){return this[_0x9ee8('0x12')](_0x9ee8('0x10'))?this[_0x9ee8('0x12')]('transport')[_0x9ee8('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x14'),'info',_0x9ee8('0x15'),'inband',_0x9ee8('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9ee8('0x3')]('yes','no',_0x9ee8('0x17'),_0x9ee8('0x18'),_0x9ee8('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9ee8('0x6')]},'directmediadeny':{'type':Sequelize[_0x9ee8('0x6')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9ee8('0x1b'),'set':function(_0x176c63){this['setDataValue']('nat',_0x176c63?_0x176c63['join'](','):null);},'get':function(){return this[_0x9ee8('0x12')](_0x9ee8('0x1c'))?this[_0x9ee8('0x12')]('nat')['split'](','):null;},'comment':_0x9ee8('0x1d')},'callgroup':{'type':Sequelize[_0x9ee8('0x6')]},'namedcallgroup':{'type':Sequelize[_0x9ee8('0x6')]},'pickupgroup':{'type':Sequelize[_0x9ee8('0x6')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x335418){this[_0x9ee8('0xf')](_0x9ee8('0x1e'),_0x335418?_0x335418[_0x9ee8('0x11')](';'):_0x9ee8('0x1f'));},'get':function(){return this[_0x9ee8('0x12')](_0x9ee8('0x1e'))?this[_0x9ee8('0x12')](_0x9ee8('0x1e'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x9ee8('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':_0x9ee8('0x20'),'set':function(_0x2f001b){this[_0x9ee8('0xf')](_0x9ee8('0x21'),_0x2f001b?_0x2f001b[_0x9ee8('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x9ee8('0x21'))?this[_0x9ee8('0x12')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9ee8('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9ee8('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'setvar':{'type':Sequelize[_0x9ee8('0x6')]},'callerid':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':_0x9ee8('0x23')},'amaflags':{'type':Sequelize[_0x9ee8('0x6')]},'callcounter':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no'),'defaultValue':_0x9ee8('0x1a')},'busylevel':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x9ee8('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no',_0x9ee8('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9ee8('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x25'),'refuse',_0x9ee8('0x26'))},'session_expires':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x9ee8('0x3')]('uac','uas'),'defaultValue':_0x9ee8('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x9ee8('0x6')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x9ee8('0x6')]},'fromuser':{'type':Sequelize[_0x9ee8('0x6')]},'port':{'type':Sequelize[_0x9ee8('0x22')](0x5)},'qualify':{'type':Sequelize[_0x9ee8('0x3')]('yes','no'),'defaultValue':_0x9ee8('0x1a')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x9ee8('0x6')]},'defaultuser':{'type':Sequelize[_0x9ee8('0x6')]},'rtptimeout':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9ee8('0x3')]('yes','no',_0x9ee8('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9ee8('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'timerb':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x9ee8('0x6')]},'contactdeny':{'type':Sequelize[_0x9ee8('0x6')]},'contactacl':{'type':Sequelize[_0x9ee8('0x6')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x9ee8('0x6')]},'maxforwards':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'encryption':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x9ee8('0x1a'),'no',_0x9ee8('0x29'),_0x9ee8('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x9ee8('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9ee8('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x9ee8('0x6')]},'dtlscipher':{'type':Sequelize[_0x9ee8('0x6')]},'dtlscafile':{'type':Sequelize[_0x9ee8('0x6')]},'dtlscapath':{'type':Sequelize[_0x9ee8('0x6')]},'dtlssetup':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x2b'),'passive',_0x9ee8('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9ee8('0x6')]},'usereqphone':{'type':Sequelize[_0x9ee8('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9ee8('0x6')]},'recordofffeature':{'type':Sequelize[_0x9ee8('0x6')]},'call_limit':{'type':Sequelize[_0x9ee8('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x9ee8('0x3')](_0x9ee8('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x9ee8('0x6')]},'mohinterpret':{'type':Sequelize[_0x9ee8('0x6')]},'mohsuggest':{'type':Sequelize[_0x9ee8('0x6')]},'parkinglot':{'type':Sequelize[_0x9ee8('0x6')]},'description':{'type':Sequelize[_0x9ee8('0x6')]},'host':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x9ee8('0x17'),_0x9ee8('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x9ee8('0x6')]},'active':{'type':Sequelize[_0x9ee8('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9ee8('0x6')],'defaultValue':'no'}}; \ No newline at end of file +var _0x66cb=['port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow'];(function(_0x4f469c,_0x20bc35){var _0x44740d=function(_0x183dc1){while(--_0x183dc1){_0x4f469c['push'](_0x4f469c['shift']());}};_0x44740d(++_0x20bc35);}(_0x66cb,0x1dc));var _0xb66c=function(_0x19ca40,_0x26047f){_0x19ca40=_0x19ca40-0x0;var _0x5df865=_0x66cb[_0x19ca40];return _0x5df865;};'use strict';var Sequelize=require(_0xb66c('0x0'));module[_0xb66c('0x1')]={'name':{'type':Sequelize[_0xb66c('0x2')],'allowNull':![],'unique':_0xb66c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xb66c('0x4'),_0xb66c('0x5'),'peer'),'allowNull':![],'defaultValue':_0xb66c('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb66c('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xb66c('0x7'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xb66c('0x8'),_0xb66c('0x9'),_0xb66c('0xa'),_0xb66c('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0xb66c('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xb66c('0x2')]},'md5secret':{'type':Sequelize[_0xb66c('0x2')]},'remotesecret':{'type':Sequelize[_0xb66c('0x2')]},'transport':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':_0xb66c('0xc'),'set':function(_0x344305){this[_0xb66c('0xd')](_0xb66c('0xe'),_0x344305?_0x344305[_0xb66c('0xf')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xb66c('0x10')](_0xb66c('0xe'))['split'](','):null;},'comment':_0xb66c('0x11')},'dtmfmode':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x13'),_0xb66c('0x14'),_0xb66c('0x15'),_0xb66c('0x16'),_0xb66c('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xb66c('0x18'),'no',_0xb66c('0x19'),_0xb66c('0x1a'),_0xb66c('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xb66c('0x1c'),'set':function(_0x28ca69){this['setDataValue'](_0xb66c('0x1d'),_0x28ca69?_0x28ca69[_0xb66c('0xf')](','):null);},'get':function(){return this[_0xb66c('0x10')]('nat')?this[_0xb66c('0x10')](_0xb66c('0x1d'))[_0xb66c('0x1e')](','):null;},'comment':_0xb66c('0x1f')},'callgroup':{'type':Sequelize[_0xb66c('0x2')]},'namedcallgroup':{'type':Sequelize[_0xb66c('0x2')]},'pickupgroup':{'type':Sequelize[_0xb66c('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb66c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xb66c('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2ad727){this[_0xb66c('0xd')]('allow',_0x2ad727?_0x2ad727[_0xb66c('0xf')](';'):_0xb66c('0x20'));},'get':function(){return this[_0xb66c('0x10')](_0xb66c('0x21'))?this[_0xb66c('0x10')](_0xb66c('0x21'))[_0xb66c('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'insecure':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':_0xb66c('0x22'),'set':function(_0x385f20){this[_0xb66c('0xd')](_0xb66c('0x23'),_0x385f20?_0x385f20[_0xb66c('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xb66c('0x23'))?this[_0xb66c('0x10')](_0xb66c('0x23'))[_0xb66c('0x1e')](','):null;},'comment':_0xb66c('0x24')},'trustrpid':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb66c('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xb66c('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xb66c('0x12')]('yes','no')},'accountcode':{'type':Sequelize[_0xb66c('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xb66c('0x2')]},'callcounter':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no'),'defaultValue':_0xb66c('0x18')},'busylevel':{'type':Sequelize[_0xb66c('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xb66c('0x12')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xb66c('0x12')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xb66c('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xb66c('0x2')]},'template':{'type':Sequelize[_0xb66c('0x2')]},'videosupport':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no',_0xb66c('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb66c('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'mailbox':{'type':Sequelize[_0xb66c('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xb66c('0x27'),_0xb66c('0x28'),_0xb66c('0x29'))},'session_expires':{'type':Sequelize[_0xb66c('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xb66c('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x2a'),_0xb66c('0x2b')),'defaultValue':_0xb66c('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xb66c('0x2')]},'regexten':{'type':Sequelize[_0xb66c('0x2')]},'fromdomain':{'type':Sequelize[_0xb66c('0x2')]},'fromuser':{'type':Sequelize[_0xb66c('0x2')]},'port':{'type':Sequelize[_0xb66c('0x25')](0x5)},'qualify':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xb66c('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xb66c('0x2')]},'defaultuser':{'type':Sequelize[_0xb66c('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb66c('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb66c('0x2')]},'callbackextension':{'type':Sequelize[_0xb66c('0x2')]},'timert1':{'type':Sequelize[_0xb66c('0x25')](0xb)},'timerb':{'type':Sequelize[_0xb66c('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xb66c('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xb66c('0x2')]},'contactacl':{'type':Sequelize[_0xb66c('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xb66c('0x12')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb66c('0x12')]('yes','no')},'force_avp':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'icesupport':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xb66c('0x18'),'no',_0xb66c('0x2c'),_0xb66c('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xb66c('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xb66c('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xb66c('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xb66c('0x2e'),'passive',_0xb66c('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb66c('0x2')]},'usereqphone':{'type':Sequelize[_0xb66c('0x12')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb66c('0x2')]},'recordofffeature':{'type':Sequelize[_0xb66c('0x2')]},'call_limit':{'type':Sequelize[_0xb66c('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb66c('0x12')](_0xb66c('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xb66c('0x12')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xb66c('0x2')]},'description':{'type':Sequelize[_0xb66c('0x2')]},'host':{'type':Sequelize[_0xb66c('0x2')],'defaultValue':_0xb66c('0x30')},'canreinvite':{'type':Sequelize[_0xb66c('0x12')]('yes','no','nonat',_0xb66c('0x1a'),_0xb66c('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb66c('0x2')]},'otherFields':{'type':Sequelize[_0xb66c('0x2')]},'active':{'type':Sequelize[_0xb66c('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb66c('0x2')],'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 4524af7..a92b4d4 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 _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4b84,0x1cc));var _0x44b8=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x4b84[_0x326e79];return _0x37eb89;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file +var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0xb0054f,_0x4f806d){var _0x4ebdff=function(_0x16b3cb){while(--_0x16b3cb){_0xb0054f['push'](_0xb0054f['shift']());}};_0x4ebdff(++_0x4f806d);}(_0xa41a,0x6b));var _0xaa41=function(_0x2938f5,_0x5a8384){_0x2938f5=_0x2938f5-0x0;var _0x8d093c=_0xa41a[_0x2938f5];return _0x8d093c;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8d11cc1..cba0ee8 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 _0xf8b7=['lodash','util','../../config/logger','api','request-promise','rimraf','./trunk.attributes','define','Trunk','tools_trunks'];(function(_0x1aee32,_0x288446){var _0x477135=function(_0xfb4d1c){while(--_0xfb4d1c){_0x1aee32['push'](_0x1aee32['shift']());}};_0x477135(++_0x288446);}(_0xf8b7,0xe6));var _0x7f8b=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0xf8b7[_0x53f37f];return _0x2fe5f8;};'use strict';var _=require(_0x7f8b('0x0'));var util=require(_0x7f8b('0x1'));var logger=require(_0x7f8b('0x2'))(_0x7f8b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f8b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f8b('0x5'));var config=require('../../config/environment');var attributes=require(_0x7f8b('0x6'));module['exports']=function(_0x1badea,_0x3b59bd){return _0x1badea[_0x7f8b('0x7')](_0x7f8b('0x8'),attributes,{'tableName':_0x7f8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08d7=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x08d7,0x11e));var _0x708d=function(_0x741427,_0x21fe4c){_0x741427=_0x741427-0x0;var _0x5e0a59=_0x08d7[_0x741427];return _0x5e0a59;};'use strict';var _=require(_0x708d('0x0'));var util=require(_0x708d('0x1'));var logger=require(_0x708d('0x2'))('api');var moment=require(_0x708d('0x3'));var BPromise=require('bluebird');var rp=require(_0x708d('0x4'));var fs=require('fs');var path=require(_0x708d('0x5'));var rimraf=require('rimraf');var config=require(_0x708d('0x6'));var attributes=require(_0x708d('0x7'));module['exports']=function(_0x46c5ef,_0x1df767){return _0x46c5ef[_0x708d('0x8')](_0x708d('0x9'),attributes,{'tableName':_0x708d('0xa'),'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 27a2de6..d44e0a9 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 _0x092a=['http','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x151553,_0x295f9c){var _0x1a0ad6=function(_0x3d2fc5){while(--_0x3d2fc5){_0x151553['push'](_0x151553['shift']());}};_0x1a0ad6(++_0x295f9c);}(_0x092a,0x18d));var _0xa092=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0x092a[_0x1a5687];return _0x257d5c;};'use strict';var _=require(_0xa092('0x0'));var util=require(_0xa092('0x1'));var moment=require(_0xa092('0x2'));var BPromise=require(_0xa092('0x3'));var rs=require(_0xa092('0x4'));var fs=require('fs');var Redis=require(_0xa092('0x5'));var db=require(_0xa092('0x6'))['db'];var utils=require(_0xa092('0x7'));var logger=require('../../config/logger')(_0xa092('0x8'));var config=require('../../config/environment');var jayson=require(_0xa092('0x9'));var client=jayson[_0xa092('0xa')][_0xa092('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x96b679,_0x58e602,_0x2c6279){return new BPromise(function(_0x83742d,_0x121ac9){return client['request'](_0x96b679,_0x2c6279)['then'](function(_0x30bb1d){logger[_0xa092('0xc')](_0xa092('0xd'),_0x58e602,_0xa092('0xe'));logger[_0xa092('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x58e602,_0xa092('0xe'),JSON[_0xa092('0x10')](_0x30bb1d));if(_0x30bb1d[_0xa092('0x11')]){if(_0x30bb1d[_0xa092('0x11')][_0xa092('0x12')]===0x1f4){logger[_0xa092('0x11')](_0xa092('0xd'),_0x58e602,_0x30bb1d['error']['message']);return _0x121ac9(_0x30bb1d['error'][_0xa092('0x13')]);}logger[_0xa092('0x11')](_0xa092('0xd'),_0x58e602,_0x30bb1d[_0xa092('0x11')][_0xa092('0x13')]);return _0x83742d(_0x30bb1d[_0xa092('0x11')]['message']);}else{logger[_0xa092('0xc')](_0xa092('0xd'),_0x58e602,'request\x20sent');_0x83742d(_0x30bb1d[_0xa092('0x14')]['message']);}})[_0xa092('0x15')](function(_0x2f70cd){logger[_0xa092('0x11')](_0xa092('0xd'),_0x58e602,_0x2f70cd);_0x121ac9(_0x2f70cd);});});}exports[_0xa092('0x16')]=function(_0x5a3e5a){var _0x4951da=this;return new Promise(function(_0x4f7f06,_0x44390f){return db[_0xa092('0x17')][_0xa092('0x18')]({'raw':_0x5a3e5a['options']?_0x5a3e5a[_0xa092('0x19')][_0xa092('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a3e5a[_0xa092('0x19')]?_0x5a3e5a[_0xa092('0x19')][_0xa092('0x1b')]||null:null,'attributes':_0x5a3e5a[_0xa092('0x19')]?_0x5a3e5a[_0xa092('0x19')][_0xa092('0x1c')]||null:null,'limit':_0x5a3e5a[_0xa092('0x19')]?_0x5a3e5a[_0xa092('0x19')]['limit']||null:null,'include':_0x5a3e5a[_0xa092('0x19')]?_0x5a3e5a[_0xa092('0x19')][_0xa092('0x1d')]?_[_0xa092('0x1e')](_0x5a3e5a[_0xa092('0x19')][_0xa092('0x1d')],function(_0x4143d1){return{'model':db[_0x4143d1[_0xa092('0x1f')]],'as':_0x4143d1['as'],'attributes':_0x4143d1[_0xa092('0x1c')],'include':_0x4143d1[_0xa092('0x1d')]?_[_0xa092('0x1e')](_0x4143d1[_0xa092('0x1d')],function(_0x280615){return{'model':db[_0x280615['model']],'as':_0x280615['as'],'attributes':_0x280615[_0xa092('0x1c')],'include':_0x280615[_0xa092('0x1d')]?_[_0xa092('0x1e')](_0x280615[_0xa092('0x1d')],function(_0x2a0999){return{'model':db[_0x2a0999[_0xa092('0x1f')]],'as':_0x2a0999['as'],'attributes':_0x2a0999[_0xa092('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32cb1a){logger[_0xa092('0xc')](_0xa092('0x16'),_0x5a3e5a);logger[_0xa092('0xf')](_0xa092('0x16'),_0x5a3e5a,JSON[_0xa092('0x10')](_0x32cb1a));_0x4f7f06(_0x32cb1a);})[_0xa092('0x15')](function(_0x3b4156){logger[_0xa092('0x11')]('GetTrunk',_0x3b4156['message'],_0x5a3e5a);_0x44390f(_0x4951da['error'](0x1f4,_0x3b4156[_0xa092('0x13')]));});});};exports[_0xa092('0x20')]=function(_0x20bed0){var _0x550f4a=this;return new Promise(function(_0x24fedf,_0x3e6c4d){return db[_0xa092('0x17')][_0xa092('0x21')]({'raw':_0x20bed0[_0xa092('0x19')]?_0x20bed0[_0xa092('0x19')][_0xa092('0x1a')]===undefined?!![]:![]:!![],'where':_0x20bed0['options']?_0x20bed0['options']['where']||null:null,'attributes':_0x20bed0['options']?_0x20bed0[_0xa092('0x19')]['attributes']||null:null,'include':_0x20bed0[_0xa092('0x19')]?_0x20bed0[_0xa092('0x19')]['include']?_[_0xa092('0x1e')](_0x20bed0['options'][_0xa092('0x1d')],function(_0xcd22ce){return{'model':db[_0xcd22ce[_0xa092('0x1f')]],'as':_0xcd22ce['as'],'attributes':_0xcd22ce[_0xa092('0x1c')],'include':_0xcd22ce['include']?_[_0xa092('0x1e')](_0xcd22ce['include'],function(_0x2257bc){return{'model':db[_0x2257bc[_0xa092('0x1f')]],'as':_0x2257bc['as'],'attributes':_0x2257bc['attributes'],'include':_0x2257bc[_0xa092('0x1d')]?_[_0xa092('0x1e')](_0x2257bc[_0xa092('0x1d')],function(_0x3bb671){return{'model':db[_0x3bb671[_0xa092('0x1f')]],'as':_0x3bb671['as'],'attributes':_0x3bb671['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae365){logger[_0xa092('0xc')](_0xa092('0x20'),_0x20bed0);logger[_0xa092('0xf')](_0xa092('0x20'),_0x20bed0,JSON[_0xa092('0x10')](_0x4ae365));_0x24fedf(_0x4ae365);})[_0xa092('0x15')](function(_0x5ad9a6){logger[_0xa092('0x11')](_0xa092('0x20'),_0x5ad9a6[_0xa092('0x13')],_0x20bed0);_0x3e6c4d(_0x550f4a[_0xa092('0x11')](0x1f4,_0x5ad9a6[_0xa092('0x13')]));});});}; \ No newline at end of file +var _0x4ec7=['raw','where','attributes','include','map','model','ShowTrunk','Trunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','findAll','options'];(function(_0x302a6f,_0x483a07){var _0x1ca2ea=function(_0x45e71e){while(--_0x45e71e){_0x302a6f['push'](_0x302a6f['shift']());}};_0x1ca2ea(++_0x483a07);}(_0x4ec7,0xb8));var _0x74ec=function(_0x351b79,_0xde37c9){_0x351b79=_0x351b79-0x0;var _0x13b9e4=_0x4ec7[_0x351b79];return _0x13b9e4;};'use strict';var _=require(_0x74ec('0x0'));var util=require(_0x74ec('0x1'));var moment=require(_0x74ec('0x2'));var BPromise=require(_0x74ec('0x3'));var rs=require(_0x74ec('0x4'));var fs=require('fs');var Redis=require(_0x74ec('0x5'));var db=require(_0x74ec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x74ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74ec('0x8')][_0x74ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ce2d,_0x4cf42e,_0x235d6e){return new BPromise(function(_0xf905a0,_0x29fdc2){return client[_0x74ec('0xa')](_0x29ce2d,_0x235d6e)[_0x74ec('0xb')](function(_0x33bf27){logger[_0x74ec('0xc')]('Trunk,\x20%s,\x20%s',_0x4cf42e,_0x74ec('0xd'));logger[_0x74ec('0xe')](_0x74ec('0xf'),_0x4cf42e,_0x74ec('0xd'),JSON[_0x74ec('0x10')](_0x33bf27));if(_0x33bf27['error']){if(_0x33bf27[_0x74ec('0x11')][_0x74ec('0x12')]===0x1f4){logger[_0x74ec('0x11')]('Trunk,\x20%s,\x20%s',_0x4cf42e,_0x33bf27['error'][_0x74ec('0x13')]);return _0x29fdc2(_0x33bf27['error']['message']);}logger[_0x74ec('0x11')]('Trunk,\x20%s,\x20%s',_0x4cf42e,_0x33bf27[_0x74ec('0x11')][_0x74ec('0x13')]);return _0xf905a0(_0x33bf27['error']['message']);}else{logger[_0x74ec('0xc')](_0x74ec('0x14'),_0x4cf42e,_0x74ec('0xd'));_0xf905a0(_0x33bf27[_0x74ec('0x15')][_0x74ec('0x13')]);}})[_0x74ec('0x16')](function(_0x6a3111){logger[_0x74ec('0x11')](_0x74ec('0x14'),_0x4cf42e,_0x6a3111);_0x29fdc2(_0x6a3111);});});}exports[_0x74ec('0x17')]=function(_0x46f1f9){var _0x2bcfbd=this;return new Promise(function(_0x4c1ad5,_0x231f25){return db['Trunk'][_0x74ec('0x18')]({'raw':_0x46f1f9[_0x74ec('0x19')]?_0x46f1f9[_0x74ec('0x19')][_0x74ec('0x1a')]===undefined?!![]:![]:!![],'where':_0x46f1f9[_0x74ec('0x19')]?_0x46f1f9[_0x74ec('0x19')][_0x74ec('0x1b')]||null:null,'attributes':_0x46f1f9[_0x74ec('0x19')]?_0x46f1f9[_0x74ec('0x19')][_0x74ec('0x1c')]||null:null,'limit':_0x46f1f9[_0x74ec('0x19')]?_0x46f1f9['options']['limit']||null:null,'include':_0x46f1f9[_0x74ec('0x19')]?_0x46f1f9['options'][_0x74ec('0x1d')]?_[_0x74ec('0x1e')](_0x46f1f9['options'][_0x74ec('0x1d')],function(_0xcd81e7){return{'model':db[_0xcd81e7[_0x74ec('0x1f')]],'as':_0xcd81e7['as'],'attributes':_0xcd81e7[_0x74ec('0x1c')],'include':_0xcd81e7[_0x74ec('0x1d')]?_[_0x74ec('0x1e')](_0xcd81e7[_0x74ec('0x1d')],function(_0x3f8acb){return{'model':db[_0x3f8acb[_0x74ec('0x1f')]],'as':_0x3f8acb['as'],'attributes':_0x3f8acb[_0x74ec('0x1c')],'include':_0x3f8acb['include']?_[_0x74ec('0x1e')](_0x3f8acb[_0x74ec('0x1d')],function(_0x39bc5b){return{'model':db[_0x39bc5b[_0x74ec('0x1f')]],'as':_0x39bc5b['as'],'attributes':_0x39bc5b[_0x74ec('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb81cab){logger[_0x74ec('0xc')](_0x74ec('0x17'),_0x46f1f9);logger['debug'](_0x74ec('0x17'),_0x46f1f9,JSON['stringify'](_0xb81cab));_0x4c1ad5(_0xb81cab);})[_0x74ec('0x16')](function(_0x1bfb98){logger[_0x74ec('0x11')]('GetTrunk',_0x1bfb98[_0x74ec('0x13')],_0x46f1f9);_0x231f25(_0x2bcfbd[_0x74ec('0x11')](0x1f4,_0x1bfb98[_0x74ec('0x13')]));});});};exports[_0x74ec('0x20')]=function(_0x4c4ed2){var _0x1c5831=this;return new Promise(function(_0x40bc7e,_0x11bd15){return db[_0x74ec('0x21')][_0x74ec('0x22')]({'raw':_0x4c4ed2[_0x74ec('0x19')]?_0x4c4ed2['options'][_0x74ec('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c4ed2[_0x74ec('0x19')]?_0x4c4ed2[_0x74ec('0x19')][_0x74ec('0x1b')]||null:null,'attributes':_0x4c4ed2[_0x74ec('0x19')]?_0x4c4ed2[_0x74ec('0x19')]['attributes']||null:null,'include':_0x4c4ed2['options']?_0x4c4ed2[_0x74ec('0x19')][_0x74ec('0x1d')]?_[_0x74ec('0x1e')](_0x4c4ed2[_0x74ec('0x19')][_0x74ec('0x1d')],function(_0xe8f29e){return{'model':db[_0xe8f29e[_0x74ec('0x1f')]],'as':_0xe8f29e['as'],'attributes':_0xe8f29e['attributes'],'include':_0xe8f29e[_0x74ec('0x1d')]?_['map'](_0xe8f29e[_0x74ec('0x1d')],function(_0x497316){return{'model':db[_0x497316[_0x74ec('0x1f')]],'as':_0x497316['as'],'attributes':_0x497316['attributes'],'include':_0x497316[_0x74ec('0x1d')]?_[_0x74ec('0x1e')](_0x497316[_0x74ec('0x1d')],function(_0x1b9c21){return{'model':db[_0x1b9c21['model']],'as':_0x1b9c21['as'],'attributes':_0x1b9c21[_0x74ec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x74ec('0xb')](function(_0x22a995){logger[_0x74ec('0xc')](_0x74ec('0x20'),_0x4c4ed2);logger[_0x74ec('0xe')]('ShowTrunk',_0x4c4ed2,JSON[_0x74ec('0x10')](_0x22a995));_0x40bc7e(_0x22a995);})[_0x74ec('0x16')](function(_0x533a74){logger[_0x74ec('0x11')](_0x74ec('0x20'),_0x533a74[_0x74ec('0x13')],_0x4c4ed2);_0x11bd15(_0x1c5831[_0x74ec('0x11')](0x1f4,_0x533a74['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3c920f7..4d0b3b0 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ff0=['isAuthenticated','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0x58fbcf,_0x410edc){var _0x39e428=function(_0x749c12){while(--_0x749c12){_0x58fbcf['push'](_0x58fbcf['shift']());}};_0x39e428(++_0x410edc);}(_0x8ff0,0xdf));var _0x08ff=function(_0x1ea6c6,_0xeaa372){_0x1ea6c6=_0x1ea6c6-0x0;var _0x3c04e3=_0x8ff0[_0x1ea6c6];return _0x3c04e3;};'use strict';var express=require(_0x08ff('0x0'));var router=express[_0x08ff('0x1')]();var auth=require(_0x08ff('0x2'));var controller=require(_0x08ff('0x3'));router[_0x08ff('0x4')]('/:id',auth[_0x08ff('0x5')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x9c16=['express','../../components/auth/service','./user-setting.controller','put','update','exports'];(function(_0xe0c084,_0x1ba86a){var _0x467678=function(_0x4b4dc7){while(--_0x4b4dc7){_0xe0c084['push'](_0xe0c084['shift']());}};_0x467678(++_0x1ba86a);}(_0x9c16,0x90));var _0x69c1=function(_0x2b39b1,_0x5e8581){_0x2b39b1=_0x2b39b1-0x0;var _0x502583=_0x9c16[_0x2b39b1];return _0x502583;};'use strict';var express=require(_0x69c1('0x0'));var router=express['Router']();var auth=require(_0x69c1('0x1'));var controller=require(_0x69c1('0x2'));router[_0x69c1('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x69c1('0x4')]);module[_0x69c1('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 5d3c3df..2d44057 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfde3=['BOOLEAN','sequelize','error','warning','info','exports','ENUM'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xfde3,0x13c));var _0x3fde=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xfde3[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x3fde('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3fde('0x1'),_0x3fde('0x2'),_0x3fde('0x3'),'debug'];module[_0x3fde('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3fde('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3fde('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3fde('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0xf47d=['DATE','UserId','sequelize','warning','info','debug','exports','ENUM','BOOLEAN','TEXT'];(function(_0x322be4,_0x232b01){var _0x37257b=function(_0x3cd867){while(--_0x3cd867){_0x322be4['push'](_0x322be4['shift']());}};_0x37257b(++_0x232b01);}(_0xf47d,0x1d8));var _0xdf47=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0xf47d[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require(_0xdf47('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xdf47('0x1'),_0xdf47('0x2'),_0xdf47('0x3')];module[_0xdf47('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xdf47('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xdf47('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xdf47('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xdf47('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xdf47('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 11b41fd..5def0c0 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb99=['catch','lodash','../../config/logger','../../mysqldb','socket.io-emitter','redis','register','status','json','update','sendStatus','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcb99,0x8b));var _0x9cb9=function(_0x13a5e2,_0x4e2d46){_0x13a5e2=_0x13a5e2-0x0;var _0x42c586=_0xcb99[_0x13a5e2];return _0x42c586;};'use strict';var _=require(_0x9cb9('0x0'));var Redis=require('ioredis');var logger=require(_0x9cb9('0x1'))('api');var config=require('../../config/environment');var db=require(_0x9cb9('0x2'))['db'];var socket=require(_0x9cb9('0x3'))(new Redis(config[_0x9cb9('0x4')]));require('./user-setting.socket')[_0x9cb9('0x5')](socket);config[_0x9cb9('0x4')]=_['defaults'](config[_0x9cb9('0x4')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x2ed26a,_0xa84493){_0xa84493=_0xa84493||0xc8;return function(_0x1bf9b7){if(_0x1bf9b7){return _0x2ed26a[_0x9cb9('0x6')](_0xa84493)[_0x9cb9('0x7')](_0x1bf9b7);}};}function saveUpdates(_0x124bd0){return function(_0x106f17){if(_0x106f17){return _0x106f17[_0x9cb9('0x8')](_0x124bd0)['then'](function(_0x5264c9){return _0x5264c9;});}return null;};}function handleEntityNotFound(_0xe6d275){return function(_0x392f93){if(!_0x392f93){_0xe6d275[_0x9cb9('0x9')](0x194);}return _0x392f93;};}function handleError(_0x5a0ac7,_0x3be02c){_0x3be02c=_0x3be02c||0x1f4;return function(_0x3d38f1){logger['error'](_0x3d38f1['stack']);if(_0x3d38f1[_0x9cb9('0xa')]){delete _0x3d38f1[_0x9cb9('0xa')];}_0x5a0ac7[_0x9cb9('0x6')](_0x3be02c)[_0x9cb9('0xb')](_0x3d38f1);};}exports['update']=function(_0x255f8e,_0x37dc98){if(_0x255f8e[_0x9cb9('0xc')][_0x9cb9('0xd')]!==_0x9cb9('0xe'))throw new Error(_0x9cb9('0xf'));if(isNaN(Number(_0x255f8e[_0x9cb9('0x10')]['id'])))throw new Error(_0x9cb9('0x11'));return db[_0x9cb9('0x12')][_0x9cb9('0x13')]({'where':{'id':_0x255f8e[_0x9cb9('0x10')]['id']}})[_0x9cb9('0x14')](handleEntityNotFound(_0x37dc98,null))[_0x9cb9('0x14')](saveUpdates(_0x255f8e[_0x9cb9('0x15')],null))[_0x9cb9('0x14')](respondWithResult(_0x37dc98,null))[_0x9cb9('0x16')](handleError(_0x37dc98,null));}; \ No newline at end of file +var _0x04de=['redis','./user-setting.socket','register','status','json','update','then','sendStatus','error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter'];(function(_0xfda3b2,_0x4c88ab){var _0x1f45fd=function(_0x579d1e){while(--_0x579d1e){_0xfda3b2['push'](_0xfda3b2['shift']());}};_0x1f45fd(++_0x4c88ab);}(_0x04de,0x107));var _0xe04d=function(_0x2ecef4,_0x503e05){_0x2ecef4=_0x2ecef4-0x0;var _0x51f2ff=_0x04de[_0x2ecef4];return _0x51f2ff;};'use strict';var _=require(_0xe04d('0x0'));var Redis=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var config=require(_0xe04d('0x4'));var db=require(_0xe04d('0x5'))['db'];var socket=require(_0xe04d('0x6'))(new Redis(config[_0xe04d('0x7')]));require(_0xe04d('0x8'))[_0xe04d('0x9')](socket);config[_0xe04d('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x531688,_0x55efb5){_0x55efb5=_0x55efb5||0xc8;return function(_0x210e93){if(_0x210e93){return _0x531688[_0xe04d('0xa')](_0x55efb5)[_0xe04d('0xb')](_0x210e93);}};}function saveUpdates(_0x154f40){return function(_0x2a1f43){if(_0x2a1f43){return _0x2a1f43[_0xe04d('0xc')](_0x154f40)[_0xe04d('0xd')](function(_0x562204){return _0x562204;});}return null;};}function handleEntityNotFound(_0x160d4f){return function(_0x21c91c){if(!_0x21c91c){_0x160d4f[_0xe04d('0xe')](0x194);}return _0x21c91c;};}function handleError(_0x30c46b,_0xad5c34){_0xad5c34=_0xad5c34||0x1f4;return function(_0x3e1837){logger[_0xe04d('0xf')](_0x3e1837[_0xe04d('0x10')]);if(_0x3e1837[_0xe04d('0x11')]){delete _0x3e1837['name'];}_0x30c46b[_0xe04d('0xa')](_0xad5c34)[_0xe04d('0x12')](_0x3e1837);};}exports[_0xe04d('0xc')]=function(_0x11203e,_0x2f7f51){if(_0x11203e[_0xe04d('0x13')][_0xe04d('0x14')]!==_0xe04d('0x15'))throw new Error(_0xe04d('0x16'));if(isNaN(Number(_0x11203e[_0xe04d('0x17')]['id'])))throw new Error(_0xe04d('0x18'));return db[_0xe04d('0x19')]['find']({'where':{'id':_0x11203e[_0xe04d('0x17')]['id']}})['then'](handleEntityNotFound(_0x2f7f51,null))[_0xe04d('0xd')](saveUpdates(_0x11203e['body'],null))[_0xe04d('0xd')](respondWithResult(_0x2f7f51,null))[_0xe04d('0x1a')](handleError(_0x2f7f51,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 9344f80..6134c5a 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1203=['update','hook','exports','../../mysqldb','UserSetting','setMaxListeners','save'];(function(_0x13c922,_0x7fe660){var _0x536e44=function(_0x2e1497){while(--_0x2e1497){_0x13c922['push'](_0x13c922['shift']());}};_0x536e44(++_0x7fe660);}(_0x1203,0xea));var _0x3120=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1203[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x3120('0x0'))['db'][_0x3120('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3120('0x2')](0x0);var events={'afterCreate':_0x3120('0x3'),'afterUpdate':_0x3120('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbd7e8c){return function(_0x3743ec,_0xba4e47,_0x154ab5){UserSettingEvents['emit'](_0xbd7e8c+':'+_0x3743ec['id'],_0x3743ec);UserSettingEvents['emit'](_0xbd7e8c,_0x3743ec);_0x154ab5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3120('0x5')](e,emitEvent(event));}}module[_0x3120('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xcb49=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserSetting','setMaxListeners','save'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcb49,0xc2));var _0x9cb4=function(_0x25280c,_0x2edec1){_0x25280c=_0x25280c-0x0;var _0x3a58c3=_0xcb49[_0x25280c];return _0x3a58c3;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x9cb4('0x0'))['db'][_0x9cb4('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9cb4('0x2')](0x0);var events={'afterCreate':_0x9cb4('0x3'),'afterUpdate':_0x9cb4('0x4'),'afterDestroy':_0x9cb4('0x5')};function emitEvent(_0x29de08){return function(_0x52bc97,_0x1d5c18,_0x1190e0){UserSettingEvents[_0x9cb4('0x6')](_0x29de08+':'+_0x52bc97['id'],_0x52bc97);UserSettingEvents[_0x9cb4('0x6')](_0x29de08,_0x52bc97);_0x1190e0(null);};}for(var e in events){if(events[_0x9cb4('0x7')](e)){var event=events[e];UserSetting[_0x9cb4('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index e0d3b50..a836917 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf1d=['exports','define','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x17d50e,_0x415f01){var _0x2f29ca=function(_0x181cbb){while(--_0x181cbb){_0x17d50e['push'](_0x17d50e['shift']());}};_0x2f29ca(++_0x415f01);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x2befc5,_0x302763){_0x2befc5=_0x2befc5-0x0;var _0x1ec607=_0xaf1d[_0x2befc5];return _0x1ec607;};'use strict';var attributes=require(_0xdaf1('0x0'));module[_0xdaf1('0x1')]=function(_0x39b0cb){return _0x39b0cb[_0xdaf1('0x2')]('UserSetting',attributes,{'tableName':_0xdaf1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x258708){if(!_0x258708['clientSideLoggingEnabled'])_0x258708[_0xdaf1('0x4')]=null;else if(_0x258708[_0xdaf1('0x4')]===null)_0x258708[_0xdaf1('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x4227=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0x4227,0x89));var _0x7422=function(_0x140cf3,_0x4b0b53){_0x140cf3=_0x140cf3-0x0;var _0xe18555=_0x4227[_0x140cf3];return _0xe18555;};'use strict';var attributes=require(_0x7422('0x0'));module['exports']=function(_0x4f6e48){return _0x4f6e48[_0x7422('0x1')]('UserSetting',attributes,{'tableName':_0x7422('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17e787){if(!_0x17e787[_0x7422('0x3')])_0x17e787['clientSideLoggingEnabledSince']=null;else if(_0x17e787[_0x7422('0x4')]===null)_0x17e787[_0x7422('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 1c7c9bb..63b331f 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a56=['length','user-setting:','./user-setting.events','save','update','user-setting:update','emit','user-setting:update:user-','UserId'];(function(_0x38f202,_0x57a3e1){var _0xac68c9=function(_0x52de3d){while(--_0x52de3d){_0x38f202['push'](_0x38f202['shift']());}};_0xac68c9(++_0x57a3e1);}(_0x4a56,0x17c));var _0x64a5=function(_0x3f342b,_0x2ba8ac){_0x3f342b=_0x3f342b-0x0;var _0x5d3e91=_0x4a56[_0x3f342b];return _0x5d3e91;};'use strict';var UserSettingEvents=require(_0x64a5('0x0'));var events=[_0x64a5('0x1'),'remove',_0x64a5('0x2')];function createListener(_0x4d37b,_0x4254db){return function(_0x3d98f5){_0x4254db['emit'](_0x4d37b,_0x3d98f5);if(_0x4d37b===_0x64a5('0x3')){_0x4254db[_0x64a5('0x4')](_0x64a5('0x5')+_0x3d98f5[_0x64a5('0x6')],_0x3d98f5);}};}exports['register']=function(_0x17317b){for(var _0x512273=0x0,_0x18988f=events[_0x64a5('0x7')];_0x512273<_0x18988f;_0x512273++){var _0x360b72=events[_0x512273];var _0x5c70c1=createListener(_0x64a5('0x8')+_0x360b72,_0x17317b);UserSettingEvents['on'](_0x360b72,_0x5c70c1);}}; \ No newline at end of file +var _0xb66f=['user-setting:','./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-','UserId','length'];(function(_0x2a9045,_0x529a1a){var _0x307ff7=function(_0x264a8f){while(--_0x264a8f){_0x2a9045['push'](_0x2a9045['shift']());}};_0x307ff7(++_0x529a1a);}(_0xb66f,0x196));var _0xfb66=function(_0x50bc61,_0x56b675){_0x50bc61=_0x50bc61-0x0;var _0x3b2801=_0xb66f[_0x50bc61];return _0x3b2801;};'use strict';var UserSettingEvents=require(_0xfb66('0x0'));var events=[_0xfb66('0x1'),'remove',_0xfb66('0x2')];function createListener(_0x41fd44,_0x204b3f){return function(_0x129659){_0x204b3f[_0xfb66('0x3')](_0x41fd44,_0x129659);if(_0x41fd44===_0xfb66('0x4')){_0x204b3f[_0xfb66('0x3')](_0xfb66('0x5')+_0x129659[_0xfb66('0x6')],_0x129659);}};}exports['register']=function(_0x1ef8bb){for(var _0x524161=0x0,_0x40233f=events[_0xfb66('0x7')];_0x524161<_0x40233f;_0x524161++){var _0x35cda9=events[_0x524161];var _0x4e6b38=createListener(_0xfb66('0x8')+_0x35cda9,_0x1ef8bb);UserSettingEvents['on'](_0x35cda9,_0x4e6b38);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bb46231..3ad16fb 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 _0x7296=['getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','addContacts','post','create','bulkCreate','diskStorage','join','root','server/files/images/','format','now','originalname','/:id/avatar','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/sms_interactions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7296,0xd2));var _0x6729=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x7296[_0x2ec2bf];return _0x2c279c;};'use strict';var multer=require(_0x6729('0x0'));var util=require(_0x6729('0x1'));var path=require(_0x6729('0x2'));var timeout=require('connect-timeout');var express=require(_0x6729('0x3'));var router=express[_0x6729('0x4')]();var fs_extra=require(_0x6729('0x5'));var auth=require(_0x6729('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6729('0x7'));var controller=require(_0x6729('0x8'));router[_0x6729('0x9')]('/',auth[_0x6729('0xa')](),controller[_0x6729('0xb')]);router[_0x6729('0x9')](_0x6729('0xc'),auth[_0x6729('0xa')](),controller[_0x6729('0xd')]);router[_0x6729('0x9')]('/whoami',auth['isAuthenticated'](),controller[_0x6729('0xe')]);router[_0x6729('0x9')](_0x6729('0xf'),auth['isAuthenticated'](),controller[_0x6729('0x10')]);router[_0x6729('0x9')](_0x6729('0x11'),auth[_0x6729('0xa')](),controller[_0x6729('0x12')]);router[_0x6729('0x9')]('/:id/avatar',controller[_0x6729('0x13')]);router[_0x6729('0x9')](_0x6729('0x14'),auth[_0x6729('0xa')](),controller[_0x6729('0x15')]);router[_0x6729('0x9')](_0x6729('0x16'),auth[_0x6729('0xa')](),controller[_0x6729('0x17')]);router[_0x6729('0x9')](_0x6729('0x18'),auth['isAuthenticated'](),controller[_0x6729('0x19')]);router['get'](_0x6729('0x1a'),auth[_0x6729('0xa')](),controller[_0x6729('0x1b')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0x6729('0x9')]('/:id/recordings',auth[_0x6729('0xa')](),controller[_0x6729('0x1c')]);router[_0x6729('0x9')](_0x6729('0x1d'),auth[_0x6729('0xa')](),controller[_0x6729('0x1e')]);router['get']('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x6729('0x1f')]);router['get'](_0x6729('0x20'),auth[_0x6729('0xa')](),controller[_0x6729('0x21')]);router[_0x6729('0x9')](_0x6729('0x22'),auth[_0x6729('0xa')](),controller[_0x6729('0x23')]);router[_0x6729('0x9')](_0x6729('0x24'),auth['isAuthenticated'](),controller[_0x6729('0x25')]);router[_0x6729('0x9')](_0x6729('0x26'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x6729('0x9')](_0x6729('0x27'),auth[_0x6729('0xa')](),controller[_0x6729('0x28')]);router[_0x6729('0x9')](_0x6729('0x29'),auth[_0x6729('0xa')](),controller['getTeams']);router[_0x6729('0x9')](_0x6729('0x2a'),auth[_0x6729('0xa')](),controller[_0x6729('0x2b')]);router[_0x6729('0x9')](_0x6729('0x2c'),auth['isAuthenticated'](),controller[_0x6729('0x2d')]);router[_0x6729('0x9')](_0x6729('0x2e'),auth[_0x6729('0xa')](),controller[_0x6729('0x2f')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x6729('0x30')]);router[_0x6729('0x9')](_0x6729('0x31'),auth[_0x6729('0xa')](),controller['getMailAccounts']);router['get'](_0x6729('0x32'),auth[_0x6729('0xa')](),controller[_0x6729('0x33')]);router[_0x6729('0x9')](_0x6729('0x34'),auth['isAuthenticated'](),controller[_0x6729('0x35')]);router[_0x6729('0x9')]('/:id/chat_websites',auth[_0x6729('0xa')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0x6729('0xa')](),controller[_0x6729('0x36')]);router[_0x6729('0x9')](_0x6729('0x37'),auth[_0x6729('0xa')](),controller[_0x6729('0x38')]);router[_0x6729('0x9')](_0x6729('0x39'),auth[_0x6729('0xa')](),controller['getScheduledCalls']);router[_0x6729('0x9')](_0x6729('0x3a'),auth[_0x6729('0xa')](),controller['getApiKey']);router['post'](_0x6729('0x16'),auth[_0x6729('0xa')](),controller[_0x6729('0x3b')]);router[_0x6729('0x3c')]('/',auth[_0x6729('0xa')](),controller[_0x6729('0x3d')]);router[_0x6729('0x3c')]('/create_many',auth[_0x6729('0xa')](),controller[_0x6729('0x3e')]);router[_0x6729('0x3c')](_0x6729('0x18'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x6729('0x3f')]({'destination':function(_0x55a038,_0x3f415b,_0x29e85b){_0x29e85b(null,path[_0x6729('0x40')](config[_0x6729('0x41')],_0x6729('0x42')));},'filename':function(_0x287d15,_0x9cf83d,_0x56dfe3){_0x56dfe3(null,util[_0x6729('0x43')]('%s-%s',Date[_0x6729('0x44')](),_0x9cf83d[_0x6729('0x45')]));}})});router[_0x6729('0x3c')](_0x6729('0x46'),upload[_0x6729('0x47')](_0x6729('0x48')),controller['addAvatar']);router[_0x6729('0x3c')](_0x6729('0x49'),auth[_0x6729('0xa')](),controller[_0x6729('0x4a')]);router[_0x6729('0x3c')](_0x6729('0x4b'),auth['isAuthenticated'](),controller[_0x6729('0x4c')]);router[_0x6729('0x3c')](_0x6729('0x4d'),auth['isAuthenticated'](),controller[_0x6729('0x4e')]);router[_0x6729('0x3c')](_0x6729('0x4f'),auth[_0x6729('0xa')](),controller[_0x6729('0x50')]);router[_0x6729('0x3c')]('/:id/teams',auth[_0x6729('0xa')](),controller[_0x6729('0x51')]);router[_0x6729('0x3c')]('/:id/chat_interactions',auth[_0x6729('0xa')](),controller['addChatInteractions']);router[_0x6729('0x3c')](_0x6729('0x52'),auth['isAuthenticated'](),controller[_0x6729('0x53')]);router[_0x6729('0x3c')](_0x6729('0x54'),auth[_0x6729('0xa')](),controller[_0x6729('0x55')]);router['post']('/:id/sms_interactions',auth[_0x6729('0xa')](),controller['addSmsInteractions']);router[_0x6729('0x3c')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x6729('0x56')]);router[_0x6729('0x3c')](_0x6729('0x57'),auth[_0x6729('0xa')](),controller['addWhatsappInteractions']);router['post'](_0x6729('0x58'),auth[_0x6729('0xa')](),controller[_0x6729('0x59')]);router[_0x6729('0x3c')](_0x6729('0x31'),auth[_0x6729('0xa')](),controller['addMailAccounts']);router[_0x6729('0x3c')](_0x6729('0x32'),auth[_0x6729('0xa')](),controller[_0x6729('0x5a')]);router['post'](_0x6729('0x34'),auth[_0x6729('0xa')](),controller[_0x6729('0x5b')]);router['post'](_0x6729('0x5c'),auth[_0x6729('0xa')](),controller[_0x6729('0x5d')]);router[_0x6729('0x3c')](_0x6729('0x5e'),auth[_0x6729('0xa')](),controller[_0x6729('0x5f')]);router[_0x6729('0x3c')](_0x6729('0x37'),auth[_0x6729('0xa')](),controller[_0x6729('0x60')]);router[_0x6729('0x3c')](_0x6729('0x3a'),auth[_0x6729('0xa')](),controller['createApiKey']);router[_0x6729('0x61')]('/:id',auth[_0x6729('0xa')](),controller['update']);router[_0x6729('0x61')](_0x6729('0x62'),auth[_0x6729('0xa')](),controller[_0x6729('0x63')]);router[_0x6729('0x64')](_0x6729('0x18'),auth[_0x6729('0xa')](),controller[_0x6729('0x65')]);router[_0x6729('0x64')](_0x6729('0x29'),auth[_0x6729('0xa')](),controller[_0x6729('0x66')]);router[_0x6729('0x64')](_0x6729('0x11'),auth[_0x6729('0xa')](),controller[_0x6729('0x67')]);router[_0x6729('0x64')](_0x6729('0x68'),auth[_0x6729('0xa')](),controller[_0x6729('0x69')]);router[_0x6729('0x64')](_0x6729('0x52'),auth['isAuthenticated'](),controller[_0x6729('0x6a')]);router[_0x6729('0x64')](_0x6729('0x54'),auth[_0x6729('0xa')](),controller['removeFaxInteractions']);router[_0x6729('0x64')](_0x6729('0x6b'),auth[_0x6729('0xa')](),controller['removeSmsInteractions']);router['delete'](_0x6729('0x6c'),auth[_0x6729('0xa')](),controller[_0x6729('0x6d')]);router['delete'](_0x6729('0x57'),auth[_0x6729('0xa')](),controller[_0x6729('0x6e')]);router[_0x6729('0x64')](_0x6729('0x58'),auth['isAuthenticated'](),controller[_0x6729('0x6f')]);router[_0x6729('0x64')](_0x6729('0x31'),auth[_0x6729('0xa')](),controller[_0x6729('0x70')]);router[_0x6729('0x64')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x6729('0x71')]);router[_0x6729('0x64')](_0x6729('0x34'),auth[_0x6729('0xa')](),controller[_0x6729('0x72')]);router[_0x6729('0x64')](_0x6729('0x5c'),auth[_0x6729('0xa')](),controller[_0x6729('0x73')]);router['delete'](_0x6729('0x5e'),auth[_0x6729('0xa')](),controller[_0x6729('0x74')]);router['delete']('/:id/square_projects',auth[_0x6729('0xa')](),controller['removeSquareProjects']);router['delete'](_0x6729('0x3a'),auth[_0x6729('0xa')](),controller[_0x6729('0x75')]);module[_0x6729('0x76')]=router; \ No newline at end of file +var _0x7089=['getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','create','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7089,0xc5));var _0x9708=function(_0x5d7db9,_0x16a1c1){_0x5d7db9=_0x5d7db9-0x0;var _0x4f5c34=_0x7089[_0x5d7db9];return _0x4f5c34;};'use strict';var multer=require(_0x9708('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9708('0x1'));var router=express[_0x9708('0x2')]();var fs_extra=require(_0x9708('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9708('0x4'));var config=require(_0x9708('0x5'));var controller=require(_0x9708('0x6'));router[_0x9708('0x7')]('/',auth[_0x9708('0x8')](),controller[_0x9708('0x9')]);router[_0x9708('0x7')]('/describe',auth[_0x9708('0x8')](),controller[_0x9708('0xa')]);router[_0x9708('0x7')](_0x9708('0xb'),auth[_0x9708('0x8')](),controller[_0x9708('0xc')]);router[_0x9708('0x7')](_0x9708('0xd'),auth[_0x9708('0x8')](),controller['getPresence']);router[_0x9708('0x7')](_0x9708('0xe'),auth[_0x9708('0x8')](),controller[_0x9708('0xf')]);router[_0x9708('0x7')](_0x9708('0x10'),controller[_0x9708('0x11')]);router['get'](_0x9708('0x12'),auth['isAuthenticated'](),controller[_0x9708('0x13')]);router['get']('/:id/contacts',auth[_0x9708('0x8')](),controller[_0x9708('0x14')]);router['get'](_0x9708('0x15'),auth[_0x9708('0x8')](),controller[_0x9708('0x16')]);router[_0x9708('0x7')]('/:id/queues_rt',auth[_0x9708('0x8')](),controller[_0x9708('0x17')]);router[_0x9708('0x7')](_0x9708('0x18'),auth[_0x9708('0x8')](),controller[_0x9708('0x19')]);router[_0x9708('0x7')](_0x9708('0x1a'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x9708('0x7')](_0x9708('0x1b'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x9708('0x7')](_0x9708('0x1c'),auth['isAuthenticated'](),controller[_0x9708('0x1d')]);router[_0x9708('0x7')](_0x9708('0x1e'),auth[_0x9708('0x8')](),controller[_0x9708('0x1f')]);router[_0x9708('0x7')](_0x9708('0x20'),auth['isAuthenticated'](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth[_0x9708('0x8')](),controller['getSmsInteractions']);router['get'](_0x9708('0x21'),auth[_0x9708('0x8')](),controller['getFaxInteractions']);router[_0x9708('0x7')](_0x9708('0x22'),auth[_0x9708('0x8')](),controller[_0x9708('0x23')]);router[_0x9708('0x7')]('/:id/teams',auth[_0x9708('0x8')](),controller[_0x9708('0x24')]);router[_0x9708('0x7')](_0x9708('0x25'),auth[_0x9708('0x8')](),controller[_0x9708('0x26')]);router[_0x9708('0x7')]('/:id/agents',auth[_0x9708('0x8')](),controller[_0x9708('0x27')]);router[_0x9708('0x7')](_0x9708('0x28'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x9708('0x7')]('/:id/fax_accounts',auth[_0x9708('0x8')](),controller[_0x9708('0x29')]);router['get'](_0x9708('0x2a'),auth['isAuthenticated'](),controller[_0x9708('0x2b')]);router['get'](_0x9708('0x2c'),auth[_0x9708('0x8')](),controller['getOpenchannelAccounts']);router[_0x9708('0x7')](_0x9708('0x2d'),auth[_0x9708('0x8')](),controller[_0x9708('0x2e')]);router[_0x9708('0x7')]('/:id/chat_websites',auth[_0x9708('0x8')](),controller[_0x9708('0x2f')]);router[_0x9708('0x7')](_0x9708('0x30'),auth[_0x9708('0x8')](),controller[_0x9708('0x31')]);router[_0x9708('0x7')]('/:id/square_projects',auth[_0x9708('0x8')](),controller['getSquareProjects']);router['get'](_0x9708('0x32'),auth['isAuthenticated'](),controller[_0x9708('0x33')]);router[_0x9708('0x7')]('/:id/api_key',auth[_0x9708('0x8')](),controller[_0x9708('0x34')]);router[_0x9708('0x35')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0x9708('0x8')](),controller[_0x9708('0x36')]);router[_0x9708('0x35')]('/create_many',auth[_0x9708('0x8')](),controller['bulkCreate']);router[_0x9708('0x35')](_0x9708('0x15'),auth[_0x9708('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x9708('0x37')]({'destination':function(_0x541057,_0x30564c,_0xbdb91d){_0xbdb91d(null,path[_0x9708('0x38')](config[_0x9708('0x39')],_0x9708('0x3a')));},'filename':function(_0x28c662,_0x486055,_0x9260dc){_0x9260dc(null,util[_0x9708('0x3b')](_0x9708('0x3c'),Date['now'](),_0x486055[_0x9708('0x3d')]));}})});router[_0x9708('0x35')](_0x9708('0x10'),upload[_0x9708('0x3e')](_0x9708('0x3f')),controller[_0x9708('0x40')]);router[_0x9708('0x35')]('/:id/login',auth['isAuthenticated'](),controller[_0x9708('0x41')]);router[_0x9708('0x35')](_0x9708('0x42'),auth[_0x9708('0x8')](),controller[_0x9708('0x43')]);router[_0x9708('0x35')](_0x9708('0x44'),auth[_0x9708('0x8')](),controller['pause']);router[_0x9708('0x35')](_0x9708('0x45'),auth[_0x9708('0x8')](),controller[_0x9708('0x46')]);router[_0x9708('0x35')](_0x9708('0x47'),auth[_0x9708('0x8')](),controller[_0x9708('0x48')]);router['post'](_0x9708('0x49'),auth[_0x9708('0x8')](),controller['addChatInteractions']);router[_0x9708('0x35')](_0x9708('0x4a'),auth['isAuthenticated'](),controller[_0x9708('0x4b')]);router[_0x9708('0x35')](_0x9708('0x4c'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x9708('0x35')]('/:id/sms_interactions',auth[_0x9708('0x8')](),controller[_0x9708('0x4d')]);router[_0x9708('0x35')](_0x9708('0x4e'),auth[_0x9708('0x8')](),controller['addOpenchannelInteractions']);router[_0x9708('0x35')](_0x9708('0x4f'),auth[_0x9708('0x8')](),controller[_0x9708('0x50')]);router[_0x9708('0x35')](_0x9708('0x51'),auth['isAuthenticated'](),controller[_0x9708('0x52')]);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x9708('0x53')]);router[_0x9708('0x35')](_0x9708('0x2c'),auth[_0x9708('0x8')](),controller['addOpenchannelAccounts']);router[_0x9708('0x35')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x9708('0x54')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x9708('0x55')]);router[_0x9708('0x35')](_0x9708('0x30'),auth['isAuthenticated'](),controller[_0x9708('0x56')]);router[_0x9708('0x35')]('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router['post']('/:id/api_key',auth['isAuthenticated'](),controller[_0x9708('0x57')]);router[_0x9708('0x58')](_0x9708('0xe'),auth[_0x9708('0x8')](),controller[_0x9708('0x59')]);router['put'](_0x9708('0x5a'),auth[_0x9708('0x8')](),controller[_0x9708('0x5b')]);router[_0x9708('0x5c')]('/:id/queues',auth[_0x9708('0x8')](),controller[_0x9708('0x5d')]);router[_0x9708('0x5c')](_0x9708('0x47'),auth[_0x9708('0x8')](),controller['removeTeams']);router['delete'](_0x9708('0xe'),auth[_0x9708('0x8')](),controller[_0x9708('0x5e')]);router[_0x9708('0x5c')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x9708('0x5f')]);router[_0x9708('0x5c')](_0x9708('0x4a'),auth[_0x9708('0x8')](),controller[_0x9708('0x60')]);router[_0x9708('0x5c')](_0x9708('0x4c'),auth['isAuthenticated'](),controller[_0x9708('0x61')]);router[_0x9708('0x5c')](_0x9708('0x62'),auth['isAuthenticated'](),controller[_0x9708('0x63')]);router[_0x9708('0x5c')](_0x9708('0x4e'),auth[_0x9708('0x8')](),controller['removeOpenchannelInteractions']);router[_0x9708('0x5c')](_0x9708('0x4f'),auth['isAuthenticated'](),controller[_0x9708('0x64')]);router[_0x9708('0x5c')](_0x9708('0x51'),auth[_0x9708('0x8')](),controller[_0x9708('0x65')]);router[_0x9708('0x5c')](_0x9708('0x2a'),auth[_0x9708('0x8')](),controller[_0x9708('0x66')]);router['delete'](_0x9708('0x2c'),auth[_0x9708('0x8')](),controller['removeOpenchannelAccounts']);router[_0x9708('0x5c')](_0x9708('0x2d'),auth[_0x9708('0x8')](),controller[_0x9708('0x67')]);router[_0x9708('0x5c')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x9708('0x68')]);router[_0x9708('0x5c')](_0x9708('0x30'),auth[_0x9708('0x8')](),controller[_0x9708('0x69')]);router[_0x9708('0x5c')](_0x9708('0x6a'),auth[_0x9708('0x8')](),controller[_0x9708('0x6b')]);router[_0x9708('0x5c')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x9708('0x6c')]);module[_0x9708('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e3c4ceb..a386020 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 _0x2738=['ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','inband','auto','rfc2833','update','yes','force_rport,comedia','nat','split','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\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','dtlsverify','dtlssetup','rtcp_mux','avpf','icesupport','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','ALLOWED_NOT_SCREENED'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x2738,0x1ac));var _0x8273=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x2738[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0x8273('0x0'));var moment=require(_0x8273('0x1'));var util=require('util');var _=require(_0x8273('0x2'));module[_0x8273('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8273('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x145aec){this[_0x8273('0x5')]('name',_0x145aec);this[_0x8273('0x5')]('defaultuser',_0x145aec);},'comment':_0x8273('0x6')},'fullname':{'type':Sequelize[_0x8273('0x7')],'allowNull':![],'set':function(_0x3113ad){this[_0x8273('0x5')](_0x8273('0x8'),_0x3113ad);this[_0x8273('0x5')](_0x8273('0x9'),util[_0x8273('0xa')](_0x8273('0xb'),_0x3113ad,this[_0x8273('0xc')](_0x8273('0xd'))));}},'alias':{'type':Sequelize[_0x8273('0x7')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8273('0xe'),'validate':{'isEmail':!![]},'set':function(_0x4732db){if(_0x4732db){this[_0x8273('0x5')](_0x8273('0xe'),_0x4732db['toLowerCase']());}}},'role':{'type':Sequelize[_0x8273('0xf')]('admin',_0x8273('0x10'),'agent',_0x8273('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x8273('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x8273('0x12')},'internal':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':![],'unique':_0x8273('0xd'),'set':function(_0x2fa070){this[_0x8273('0x5')](_0x8273('0xd'),_0x2fa070);this[_0x8273('0x5')](_0x8273('0x14'),_0x2fa070);this[_0x8273('0x5')]('callerid',util[_0x8273('0xa')](_0x8273('0xb'),this[_0x8273('0xc')](_0x8273('0x8')),_0x2fa070));}},'salt':{'type':Sequelize[_0x8273('0x7')]},'phone':{'type':Sequelize[_0x8273('0x7')]},'mobile':{'type':Sequelize[_0x8273('0x7')]},'address':{'type':Sequelize[_0x8273('0x7')]},'zipcode':{'type':Sequelize[_0x8273('0x7')]},'userpic':{'type':Sequelize[_0x8273('0x7')]},'city':{'type':Sequelize[_0x8273('0x7')]},'country':{'type':Sequelize[_0x8273('0x7')]},'online':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8273('0x7')],'defaultValue':_0x8273('0x16')},'lastPauseAt':{'type':Sequelize[_0x8273('0x17')]},'chatCapacity':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8273('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8273('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0x8273('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x18'),_0x8273('0x10'),_0x8273('0x19')),'allowNull':!![],'defaultValue':_0x8273('0x18')},'context':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x1a'),_0x8273('0x1b'),_0x8273('0x1c'),_0x8273('0x1d'),_0x8273('0x1e'),_0x8273('0x1f'),_0x8273('0x20'),_0x8273('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8273('0x22'),'set':function(_0x3d8c14){this[_0x8273('0x5')](_0x8273('0x23'),_0x3d8c14?_0x3d8c14[_0x8273('0x24')](','):null);},'get':function(){return this[_0x8273('0xc')]('transport')?this['getDataValue']('transport')['split'](','):null;},'comment':_0x8273('0x25')},'dtmfmode':{'type':Sequelize[_0x8273('0xf')]('rfc2833','info','shortinfo',_0x8273('0x26'),_0x8273('0x27')),'allowNull':!![],'defaultValue':_0x8273('0x28')},'directmedia':{'type':Sequelize[_0x8273('0xf')]('yes','no','nonat',_0x8273('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![],'defaultValue':_0x8273('0x2b'),'set':function(_0x56b730){this[_0x8273('0x5')](_0x8273('0x2c'),_0x56b730?_0x56b730[_0x8273('0x24')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0x8273('0x2c'))[_0x8273('0x2d')](','):null;},'comment':_0x8273('0x2e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x8273('0x7')]},'pickupgroup':{'type':Sequelize[_0x8273('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x8273('0x7')]},'language':{'type':Sequelize[_0x8273('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8273('0x7')]},'disallow':{'type':Sequelize[_0x8273('0x7')],'allowNull':![],'defaultValue':_0x8273('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8273('0x30'),'set':function(_0x3509f2){this[_0x8273('0x5')](_0x8273('0x31'),_0x3509f2?_0x3509f2['join'](';'):_0x8273('0x30'));},'get':function(){return this[_0x8273('0xc')]('allow')?this[_0x8273('0xc')]('allow')[_0x8273('0x2d')](';'):null;},'comment':_0x8273('0x32')},'autoframing':{'type':Sequelize[_0x8273('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![],'set':function(_0x774193){this[_0x8273('0x5')](_0x8273('0x33'),_0x774193?_0x774193[_0x8273('0x24')](','):null);},'get':function(){return this[_0x8273('0xc')](_0x8273('0x33'))?this[_0x8273('0xc')](_0x8273('0x33'))[_0x8273('0x2d')](','):null;},'comment':_0x8273('0x34')},'trustrpid':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8273('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no',_0x8273('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![],'defaultValue':_0x8273('0x36')},'amaflags':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8273('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x8273('0x2a')},'busylevel':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no',_0x8273('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8273('0xf')]('accept',_0x8273('0x38'),_0x8273('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x8273('0x3a'),_0x8273('0x3b')),'allowNull':!![],'defaultValue':_0x8273('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x8273('0x2a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no',_0x8273('0x3c'),_0x8273('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x3e'),'passive',_0x8273('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8273('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x8273('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8273('0xf')](_0x8273('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x8273('0x2a'),'no','nonat',_0x8273('0x29'),_0x8273('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8273('0x7')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x8273('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8273('0x41')]},'showWebBar':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0,'set':function(_0x316f05){this['setDataValue'](_0x8273('0x42'),_0x316f05);var _0x475fe2=this[_0x8273('0x43')]({'plain':!![]});switch(_0x316f05){case 0x0:case 0x1:var _0x20e6e8=_0x475fe2[_0x8273('0x23')]?_[_0x8273('0x44')](_0x475fe2[_0x8273('0x23')])?_0x475fe2[_0x8273('0x23')][_0x8273('0x24')]():_0x475fe2[_0x8273('0x23')]:_0x8273('0x22');if(_0x20e6e8===_0x8273('0x45')){_0x20e6e8='udp';}this['setDataValue'](_0x8273('0x23'),_0x20e6e8);this['setDataValue'](_0x8273('0x46'),'no');this[_0x8273('0x5')]('avpf',null);this['setDataValue'](_0x8273('0x47'),null);this[_0x8273('0x5')]('icesupport',null);this[_0x8273('0x5')]('dtlsenable',null);this[_0x8273('0x5')](_0x8273('0x48'),null);this[_0x8273('0x5')](_0x8273('0x49'),null);this[_0x8273('0x5')]('dtlscertfile',null);this[_0x8273('0x5')]('dtlsprivatekey',null);this[_0x8273('0x5')](_0x8273('0x4a'),'no');break;case 0x2:this[_0x8273('0x5')](_0x8273('0x23'),'wss');this[_0x8273('0x5')]('encryption',_0x8273('0x2a'));this[_0x8273('0x5')](_0x8273('0x4b'),_0x8273('0x2a'));this['setDataValue']('force_avp','yes');this[_0x8273('0x5')](_0x8273('0x4c'),_0x8273('0x2a'));this[_0x8273('0x5')]('dtlsenable','yes');this[_0x8273('0x5')]('dtlsverify','no');this[_0x8273('0x5')]('dtlssetup','actpass');this['setDataValue']('dtlscertfile',_0x475fe2['dtlscertfile']||_0x8273('0x4d'));this[_0x8273('0x5')](_0x8273('0x4e'),_0x475fe2[_0x8273('0x4e')]||_0x8273('0x4f'));this[_0x8273('0x5')](_0x8273('0x4a'),_0x8273('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x8273('0x41')],'set':function(_0x1018b1){this['setDataValue']('permissions',_0x1018b1?_0x1018b1['join'](','):[]);},'get':function(){return this[_0x8273('0xc')](_0x8273('0x50'))?_[_0x8273('0x51')](this['getDataValue'](_0x8273('0x50'))[_0x8273('0x2d')](','),function(_0x3380c7){return parseInt(_0x3380c7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8273('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8273('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8273('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8273('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8273('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8273('0x52')],'get':function(){return this['getDataValue'](_0x8273('0x53'))?this[_0x8273('0xc')](_0x8273('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x8273('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8273('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![],'set':function(_0x41919e){if(typeof _0x41919e===_0x8273('0x54')){var _0x12c87a=_0x41919e==='1'?!![]:_0x41919e==='0'?![]:_0x41919e===_0x8273('0x55')?!![]:_0x41919e==='false'?![]:![];this[_0x8273('0x5')](_0x8273('0x56'),_0x12c87a);}else{this[_0x8273('0x5')](_0x8273('0x56'),_0x41919e);}}},'blocked':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![],'set':function(_0x43dbb0){this[_0x8273('0x5')](_0x8273('0x57'),_0x43dbb0);if(_0x43dbb0===!![]){this[_0x8273('0x5')](_0x8273('0x58'),moment());this[_0x8273('0x5')](_0x8273('0x59'),0x0);}else{this[_0x8273('0x5')](_0x8273('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x8273('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8273('0x13')](0x5)[_0x8273('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8273('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8273('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5d70=['wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','local','internal','DATE','BOOLEAN','INTEGER','dynamic','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','split','rfc2833','info','shortinfo','inband','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\x22gsm\x22]','insecure','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','passive','actpass','update,nonat'];(function(_0x352df9,_0x346200){var _0x2bb47f=function(_0x3225d8){while(--_0x3225d8){_0x352df9['push'](_0x352df9['shift']());}};_0x2bb47f(++_0x346200);}(_0x5d70,0x178));var _0x05d7=function(_0x3d7da9,_0x40bb4a){_0x3d7da9=_0x3d7da9-0x0;var _0x2470eb=_0x5d70[_0x3d7da9];return _0x2470eb;};'use strict';var Sequelize=require(_0x05d7('0x0'));var moment=require(_0x05d7('0x1'));var util=require('util');var _=require(_0x05d7('0x2'));module[_0x05d7('0x3')]={'name':{'type':Sequelize[_0x05d7('0x4')],'allowNull':![],'unique':_0x05d7('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x6a1fea){this[_0x05d7('0x6')](_0x05d7('0x5'),_0x6a1fea);this[_0x05d7('0x6')](_0x05d7('0x7'),_0x6a1fea);},'comment':_0x05d7('0x8')},'fullname':{'type':Sequelize[_0x05d7('0x4')],'allowNull':![],'set':function(_0x3906bb){this[_0x05d7('0x6')](_0x05d7('0x9'),_0x3906bb);this[_0x05d7('0x6')](_0x05d7('0xa'),util[_0x05d7('0xb')](_0x05d7('0xc'),_0x3906bb,this[_0x05d7('0xd')]('internal')));}},'alias':{'type':Sequelize[_0x05d7('0x4')]},'email':{'type':Sequelize[_0x05d7('0x4')],'allowNull':![],'unique':_0x05d7('0xe'),'validate':{'isEmail':!![]},'set':function(_0x13b602){if(_0x13b602){this['setDataValue'](_0x05d7('0xe'),_0x13b602[_0x05d7('0xf')]());}}},'role':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x11'),_0x05d7('0x12'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x05d7('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x3abc73){this['setDataValue'](_0x05d7('0x14'),_0x3abc73);this[_0x05d7('0x6')]('accountcode',_0x3abc73);this[_0x05d7('0x6')]('callerid',util['format']('\x22%s\x22\x20<%s>',this['getDataValue'](_0x05d7('0x9')),_0x3abc73));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x05d7('0x4')]},'mobile':{'type':Sequelize[_0x05d7('0x4')]},'address':{'type':Sequelize[_0x05d7('0x4')]},'zipcode':{'type':Sequelize[_0x05d7('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x05d7('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x05d7('0x15')]},'voicePause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x05d7('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x05d7('0x15')]},'chatCapacity':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x05d7('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x05d7('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x05d7('0x18')},'ipaddr':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0x05d7('0x12'),_0x05d7('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![],'defaultValue':_0x05d7('0x1a')},'callingpres':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x1b'),'ALLOWED_PASSED_SCREEN',_0x05d7('0x1c'),_0x05d7('0x1d'),_0x05d7('0x1e'),'PROHIB_PASSED_SCREEN',_0x05d7('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x05d7('0x20'),'set':function(_0x4ddb7f){this[_0x05d7('0x6')]('transport',_0x4ddb7f?_0x4ddb7f['join'](','):null);},'get':function(){return this[_0x05d7('0xd')](_0x05d7('0x21'))?this[_0x05d7('0xd')](_0x05d7('0x21'))[_0x05d7('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x23'),_0x05d7('0x24'),_0x05d7('0x25'),_0x05d7('0x26'),'auto'),'allowNull':!![],'defaultValue':_0x05d7('0x23')},'directmedia':{'type':Sequelize[_0x05d7('0x10')]('yes','no',_0x05d7('0x27'),_0x05d7('0x28'),_0x05d7('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x05d7('0x2b'),'set':function(_0x5cd044){this[_0x05d7('0x6')](_0x05d7('0x2c'),_0x5cd044?_0x5cd044['join'](','):null);},'get':function(){return this[_0x05d7('0xd')](_0x05d7('0x2c'))?this[_0x05d7('0xd')](_0x05d7('0x2c'))[_0x05d7('0x22')](','):null;},'comment':_0x05d7('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x05d7('0x4')]},'pickupgroup':{'type':Sequelize[_0x05d7('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x05d7('0x4')]},'language':{'type':Sequelize[_0x05d7('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x05d7('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x05d7('0x2e')},'allow':{'type':Sequelize[_0x05d7('0x4')],'allowNull':![],'defaultValue':_0x05d7('0x2f'),'set':function(_0x2a928f){this[_0x05d7('0x6')](_0x05d7('0x30'),_0x2a928f?_0x2a928f['join'](';'):_0x05d7('0x2f'));},'get':function(){return this[_0x05d7('0xd')]('allow')?this['getDataValue'](_0x05d7('0x30'))['split'](';'):null;},'comment':_0x05d7('0x31')},'autoframing':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![],'set':function(_0x214ce2){this[_0x05d7('0x6')](_0x05d7('0x32'),_0x214ce2?_0x214ce2[_0x05d7('0x33')](','):null);},'get':function(){return this[_0x05d7('0xd')](_0x05d7('0x32'))?this['getDataValue'](_0x05d7('0x32'))[_0x05d7('0x22')](','):null;},'comment':_0x05d7('0x34')},'trustrpid':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![],'defaultValue':_0x05d7('0x35')},'amaflags':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x05d7('0x2a')},'busylevel':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x05d7('0x10')]('yes','no',_0x05d7('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x05d7('0x37'),_0x05d7('0x38'),_0x05d7('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0x05d7('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x05d7('0x2a')},'keepalive':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x05d7('0x10')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no',_0x05d7('0x3b'),_0x05d7('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x05d7('0x10')]('active',_0x05d7('0x3d'),_0x05d7('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x05d7('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x05d7('0x2a'),'no',_0x05d7('0x27'),'update',_0x05d7('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x05d7('0x15')]},'passwordResetAt':{'type':Sequelize[_0x05d7('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0,'set':function(_0x1c1a13){this[_0x05d7('0x6')]('showWebBar',_0x1c1a13);var _0x19f137=this['get']({'plain':!![]});switch(_0x1c1a13){case 0x0:case 0x1:var _0x13156d=_0x19f137[_0x05d7('0x21')]?_['isArray'](_0x19f137[_0x05d7('0x21')])?_0x19f137[_0x05d7('0x21')][_0x05d7('0x33')]():_0x19f137['transport']:_0x05d7('0x20');if(_0x13156d===_0x05d7('0x40')){_0x13156d=_0x05d7('0x20');}this[_0x05d7('0x6')](_0x05d7('0x21'),_0x13156d);this[_0x05d7('0x6')]('encryption','no');this[_0x05d7('0x6')](_0x05d7('0x41'),null);this['setDataValue']('force_avp',null);this[_0x05d7('0x6')](_0x05d7('0x42'),null);this[_0x05d7('0x6')](_0x05d7('0x43'),null);this[_0x05d7('0x6')](_0x05d7('0x44'),null);this[_0x05d7('0x6')](_0x05d7('0x45'),null);this[_0x05d7('0x6')]('dtlscertfile',null);this[_0x05d7('0x6')](_0x05d7('0x46'),null);this[_0x05d7('0x6')]('rtcp_mux','no');break;case 0x2:this[_0x05d7('0x6')](_0x05d7('0x21'),'wss');this['setDataValue']('encryption',_0x05d7('0x2a'));this['setDataValue']('avpf',_0x05d7('0x2a'));this[_0x05d7('0x6')](_0x05d7('0x47'),_0x05d7('0x2a'));this['setDataValue'](_0x05d7('0x42'),_0x05d7('0x2a'));this[_0x05d7('0x6')]('dtlsenable',_0x05d7('0x2a'));this['setDataValue'](_0x05d7('0x44'),'no');this['setDataValue'](_0x05d7('0x45'),_0x05d7('0x3e'));this[_0x05d7('0x6')](_0x05d7('0x48'),_0x19f137[_0x05d7('0x48')]||_0x05d7('0x49'));this[_0x05d7('0x6')](_0x05d7('0x46'),_0x19f137[_0x05d7('0x46')]||_0x05d7('0x4a'));this[_0x05d7('0x6')](_0x05d7('0x4b'),_0x05d7('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x05d7('0x4c')],'set':function(_0x2bd8ab){this['setDataValue'](_0x05d7('0x4d'),_0x2bd8ab?_0x2bd8ab[_0x05d7('0x33')](','):[]);},'get':function(){return this[_0x05d7('0xd')]('permissions')?_[_0x05d7('0x4e')](this['getDataValue'](_0x05d7('0x4d'))['split'](','),function(_0x346fa4){return parseInt(_0x346fa4,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x05d7('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x05d7('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x05d7('0x10')](_0x05d7('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x05d7('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x05d7('0x4f')],'get':function(){return this['getDataValue'](_0x05d7('0x50'))?this[_0x05d7('0xd')](_0x05d7('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x05d7('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x05d7('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x501cd4){if(typeof _0x501cd4===_0x05d7('0x51')){var _0x46ae28=_0x501cd4==='1'?!![]:_0x501cd4==='0'?![]:_0x501cd4===_0x05d7('0x52')?!![]:_0x501cd4===_0x05d7('0x53')?![]:![];this[_0x05d7('0x6')](_0x05d7('0x54'),_0x46ae28);}else{this[_0x05d7('0x6')](_0x05d7('0x54'),_0x501cd4);}}},'blocked':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![],'set':function(_0x3e2a01){this[_0x05d7('0x6')](_0x05d7('0x55'),_0x3e2a01);if(_0x3e2a01===!![]){this[_0x05d7('0x6')](_0x05d7('0x56'),moment());this[_0x05d7('0x6')]('loginAttempts',0x0);}else{this[_0x05d7('0x6')](_0x05d7('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x05d7('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x05d7('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x05d7('0x17')](0x5)[_0x05d7('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x05d7('0x16')],'defaultValue':![]},'adSsoEnabled':{'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 b1b2726..9e932e9 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 _0x6bc3=['WhatsappInteraction','LOCAL/%s@from-sip/n','intrf','user:%s','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','whatsapppause','pauseType','lastPauseAt','manual','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getSmsQueues','Sms','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','VoicePrefixId','removeTeams','getMailQueues','Mail','removeAgent','UserVoicePrefix','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','CmHopper','lastName','phone','dialActive','VoiceQueue','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','lower','col','toString','asc','uniqBy','orderBy','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','toUpperCase','slice','field','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','redis','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','end','offset','limit','count','status','set','Content-Range','json','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','password','salt','where','query','includeAll','include','userSetting','true','attributes','findAll','rows','openTabs','length','push','chat','dataValues','mail','show','params','differenceBy','keys','filters','intersection','model','UserSetting','merge','options','sms','fax','body','find','describe','addContacts','ids','omit','internal','findById','securePassword','isNil','min_internal','sequelize','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)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','103','113','110','104','105','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','telephone','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','Queue:save','voice','format','SIP/%s','voicePause','each','UserVoiceQueueRt','upsert','remove','isArray','emit','Queue:remove','addAvatar','filename','getAvatar','root','server/files/images/logos/default_profile.png','userpic','existsSync','join','download','server/files/images/','getOpenTabs','openchannel','whatsapp','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','fields','order','sort','pick','hasOwnProperty','CmList','List','Tag','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions'];(function(_0x2a7298,_0x54b9df){var _0xbc7a81=function(_0x506cb2){while(--_0x506cb2){_0x2a7298['push'](_0x2a7298['shift']());}};_0xbc7a81(++_0x54b9df);}(_0x6bc3,0xa8));var _0x36bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc3[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x36bc('0x0'));var BPromise=require(_0x36bc('0x1'));var util=require(_0x36bc('0x2'));var path=require(_0x36bc('0x3'));var fs=require('fs');var _=require(_0x36bc('0x4'));var squel=require(_0x36bc('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x36bc('0x6'));var authService=require('../../components/auth/service');var qs=require(_0x36bc('0x7'));var logger=require(_0x36bc('0x8'))(_0x36bc('0x9'));var utils=require(_0x36bc('0xa'));var config=require('../../config/environment');var licenseUtil=require(_0x36bc('0xb'));var db=require(_0x36bc('0xc'))['db'];var socket=require(_0x36bc('0xd'))(new Redis(config['redis']));require(_0x36bc('0xe'))['register'](socket);config[_0x36bc('0xf')]=_[_0x36bc('0x10')](config[_0x36bc('0xf')],{'host':_0x36bc('0x11'),'port':0x18eb});var client=jayson[_0x36bc('0x12')][_0x36bc('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4ec9fe,_0x22af58,_0xfd0a05,_0x32b77d){return new BPromise(function(_0x10d03a,_0x321084){var _0x40e020=_0x32b77d||client;return _0x40e020[_0x36bc('0x14')](_0x4ec9fe,_0xfd0a05)[_0x36bc('0x15')](function(_0x5467de){logger[_0x36bc('0x16')](_0x36bc('0x17'),_0x22af58,'request\x20sent');logger[_0x36bc('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x22af58,'request\x20sent',JSON[_0x36bc('0x19')](_0x5467de));if(_0x5467de[_0x36bc('0x1a')]){if(_0x5467de[_0x36bc('0x1a')][_0x36bc('0x1b')]===0x1f4){logger[_0x36bc('0x1a')](_0x36bc('0x17'),_0x22af58,_0x5467de[_0x36bc('0x1a')][_0x36bc('0x1c')]);return _0x321084(_0x5467de['error'][_0x36bc('0x1c')]);}logger[_0x36bc('0x1a')](_0x36bc('0x17'),_0x22af58,_0x5467de[_0x36bc('0x1a')][_0x36bc('0x1c')]);return _0x10d03a(_0x5467de[_0x36bc('0x1a')][_0x36bc('0x1c')]);}else{logger[_0x36bc('0x16')](_0x36bc('0x17'),_0x22af58,_0x36bc('0x1d'));_0x10d03a(_0x5467de['result'][_0x36bc('0x1c')]);}})[_0x36bc('0x1e')](function(_0x48d33b){logger['error'](_0x36bc('0x17'),_0x22af58,_0x48d33b);_0x321084(_0x48d33b);});});}function respondWithStatusCode(_0x2ff664,_0x40147e){_0x40147e=_0x40147e||0xcc;return function(_0x472e62){if(_0x472e62){return _0x2ff664[_0x36bc('0x1f')](_0x40147e);}return _0x2ff664['status'](_0x40147e)[_0x36bc('0x20')]();};}function respondWithResult(_0x114f7d,_0x37a66d){_0x37a66d=_0x37a66d||0xc8;return function(_0x337b14){if(_0x337b14){return _0x114f7d['status'](_0x37a66d)['json'](_0x337b14);}};}function respondWithFilteredResult(_0xce3e7,_0x3d8adb){return function(_0x5b3e64){if(_0x5b3e64){var _0x450141=typeof _0x3d8adb[_0x36bc('0x21')]==='undefined'&&typeof _0x3d8adb[_0x36bc('0x22')]==='undefined';var _0x568030=_0x5b3e64['count'];var _0x2367a2=_0x450141?0x0:_0x3d8adb[_0x36bc('0x21')];var _0x1729b4=_0x450141?_0x5b3e64[_0x36bc('0x23')]:_0x3d8adb['offset']+_0x3d8adb[_0x36bc('0x22')];var _0x14e477;if(_0x1729b4>=_0x568030){_0x1729b4=_0x568030;_0x14e477=0xc8;}else{_0x14e477=0xce;}_0xce3e7[_0x36bc('0x24')](_0x14e477);return _0xce3e7[_0x36bc('0x25')](_0x36bc('0x26'),_0x2367a2+'-'+_0x1729b4+'/'+_0x568030)[_0x36bc('0x27')](_0x5b3e64);}return null;};}function saveUpdates(_0x395f1b){return function(_0x26bde4){if(_0x26bde4){return _0x26bde4[_0x36bc('0x28')](_0x395f1b)[_0x36bc('0x15')](function(_0x1e8905){return _0x1e8905;});}return null;};}function removeEntity(_0x58feee){return function(_0x46e2b8){if(_0x46e2b8){return _0x46e2b8[_0x36bc('0x29')]()[_0x36bc('0x15')](function(){var _0x3aa048=_0x46e2b8[_0x36bc('0x2a')]({'plain':!![]});if(_0x3aa048[_0x36bc('0x2b')]===_0x36bc('0x2c'))return;var _0x5d90d6=[{'name':_0x36bc('0x2d'),'value':_0x36bc('0x2e'),'ignore':!![]},{'name':_0x36bc('0x2f'),'value':_0x36bc('0x30'),'ignore':![]},{'name':_0x36bc('0x31'),'value':'telephone','ignore':![]}];var _0x47b04e=_(_0x5d90d6)[_0x36bc('0x32')](_0x36bc('0x33'))[_0x36bc('0x34')](_0x36bc('0x35'))[_0x36bc('0x35')]();if(_[_0x36bc('0x36')](_0x47b04e,_0x3aa048['role'])){return;}var _0x24255f=_['find'](_0x5d90d6,[_0x36bc('0x35'),_0x3aa048[_0x36bc('0x2b')]])[_0x36bc('0x37')];return db[_0x36bc('0x38')][_0x36bc('0x29')]({'where':{'type':_0x24255f,'resourceId':_0x3aa048['id']}})[_0x36bc('0x15')](function(){return _0x46e2b8;});})[_0x36bc('0x15')](function(){_0x58feee[_0x36bc('0x24')](0xcc)[_0x36bc('0x20')]();});}};}function handleEntityNotFound(_0x58a0a1){return function(_0x10b672){if(!_0x10b672){_0x58a0a1[_0x36bc('0x1f')](0x194);}return _0x10b672;};}function handleError(_0x1782f3,_0x1b80f8){_0x1b80f8=_0x1b80f8||0x1f4;return function(_0x545ea2){logger[_0x36bc('0x1a')](_0x545ea2[_0x36bc('0x39')]);if(_0x545ea2[_0x36bc('0x37')]){delete _0x545ea2[_0x36bc('0x37')];}_0x1782f3[_0x36bc('0x24')](_0x1b80f8)[_0x36bc('0x3a')](_0x545ea2);};}exports[_0x36bc('0x3b')]=function(_0x40a6d4,_0xa6b09d){var _0x196892={},_0x5770ac={'count':0x0,'rows':[]};var _0x43dd59=_(db[_0x36bc('0x3c')][_0x36bc('0x3d')])['map'](function(_0x31460d){return{'name':_0x31460d[_0x36bc('0x3e')],'type':_0x31460d[_0x36bc('0x3f')][_0x36bc('0x40')]};})['filter'](function(_0x29b8ca){return!_[_0x36bc('0x36')]([_0x36bc('0x41'),_0x36bc('0x42')],_0x29b8ca[_0x36bc('0x37')]);})[_0x36bc('0x35')]();_0x196892=qs['getOptions'](_0x43dd59,_0x40a6d4);var _0x25b65b={'where':_0x196892[_0x36bc('0x43')]};return db['User'][_0x36bc('0x23')](_0x25b65b)[_0x36bc('0x15')](function(_0x10a387){_0x5770ac[_0x36bc('0x23')]=_0x10a387;if(_0x40a6d4[_0x36bc('0x44')][_0x36bc('0x45')]){_0x196892[_0x36bc('0x46')]=[{'all':!![]}];}if(_0x40a6d4['query'][_0x36bc('0x47')]===_0x36bc('0x48')){_0x196892[_0x36bc('0x46')]=[{'model':db['UserSetting'],'as':_0x36bc('0x47')}];}if(!_[_0x36bc('0x36')](_0x196892[_0x36bc('0x49')],'id')){_0x196892[_0x36bc('0x49')]['push']('id');}return db[_0x36bc('0x3c')][_0x36bc('0x4a')](_0x196892);})[_0x36bc('0x15')](function(_0x1506ba){_0x5770ac[_0x36bc('0x4b')]=_0x1506ba;if(_0x40a6d4[_0x36bc('0x44')][_0x36bc('0x4c')]==='true'){var _0x2a3a19=[];for(var _0x215c20=0x0;_0x215c20<_0x5770ac[_0x36bc('0x4b')][_0x36bc('0x4d')];_0x215c20++){_0x2a3a19[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x4f'),_0x5770ac['rows'][_0x215c20][_0x36bc('0x50')]));_0x2a3a19[_0x36bc('0x4e')](get_open_tabs('sms',_0x5770ac[_0x36bc('0x4b')][_0x215c20][_0x36bc('0x50')]));_0x2a3a19[_0x36bc('0x4e')](get_open_tabs('fax',_0x5770ac[_0x36bc('0x4b')][_0x215c20]['dataValues']));_0x2a3a19['push'](get_open_tabs(_0x36bc('0x51'),_0x5770ac['rows'][_0x215c20][_0x36bc('0x50')]));_0x2a3a19[_0x36bc('0x4e')](get_open_tabs('openchannel',_0x5770ac[_0x36bc('0x4b')][_0x215c20]['dataValues']));_0x2a3a19[_0x36bc('0x4e')](get_open_tabs('whatsapp',_0x5770ac['rows'][_0x215c20][_0x36bc('0x50')]));}return BPromise['all'](_0x2a3a19)[_0x36bc('0x15')](function(){return _0x5770ac;});}else{return _0x5770ac;}})['then'](respondWithFilteredResult(_0xa6b09d,_0x196892))['catch'](handleError(_0xa6b09d,null));};exports[_0x36bc('0x52')]=function(_0x44eab8,_0x5333e5){var _0x5e8208={'raw':![],'where':{'id':_0x44eab8[_0x36bc('0x53')]['id']}},_0x807a98={};_0x807a98['model']=_[_0x36bc('0x54')](_[_0x36bc('0x55')](db['User']['rawAttributes']),['password',_0x36bc('0x42')]);_0x807a98[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x44eab8[_0x36bc('0x44')]);_0x807a98[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x807a98[_0x36bc('0x58')],_0x807a98[_0x36bc('0x44')]);_0x5e8208[_0x36bc('0x49')]=_['intersection'](_0x807a98[_0x36bc('0x58')],qs['fields'](_0x44eab8[_0x36bc('0x44')]['fields']));_0x5e8208[_0x36bc('0x49')]=_0x5e8208['attributes'][_0x36bc('0x4d')]?_0x5e8208[_0x36bc('0x49')]:_0x807a98['model'];if(_0x44eab8['query']['includeAll']){_0x5e8208[_0x36bc('0x46')]=[{'all':!![]}];}if(_0x44eab8[_0x36bc('0x44')][_0x36bc('0x47')]===_0x36bc('0x48')){_0x5e8208[_0x36bc('0x46')]=[{'model':db[_0x36bc('0x59')],'as':_0x36bc('0x47')}];}_0x5e8208=_[_0x36bc('0x5a')]({},_0x5e8208,_0x44eab8[_0x36bc('0x5b')]);if(!_[_0x36bc('0x36')](_0x5e8208[_0x36bc('0x49')],'id')){_0x5e8208[_0x36bc('0x49')][_0x36bc('0x4e')]('id');}return db['User']['find'](_0x5e8208)[_0x36bc('0x15')](handleEntityNotFound(_0x5333e5,null))['then'](function(_0x6222e7){var _0x1113a1=[];values=_0x6222e7;if(_0x44eab8[_0x36bc('0x44')][_0x36bc('0x4c')]===_0x36bc('0x48')){_0x1113a1[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x4f'),_0x6222e7[_0x36bc('0x50')]));_0x1113a1[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x5c'),_0x6222e7['dataValues']));_0x1113a1[_0x36bc('0x4e')](get_open_tabs('openchannel',_0x6222e7[_0x36bc('0x50')]));_0x1113a1[_0x36bc('0x4e')](get_open_tabs('whatsapp',_0x6222e7[_0x36bc('0x50')]));_0x1113a1[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x5d'),_0x6222e7[_0x36bc('0x50')]));_0x1113a1[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x51'),_0x6222e7['dataValues']));return BPromise['all'](_0x1113a1);}else{return values;}})[_0x36bc('0x15')](function(){return values;})[_0x36bc('0x15')](respondWithResult(_0x5333e5,null))['catch'](handleError(_0x5333e5,null));};exports[_0x36bc('0x28')]=function(_0x460c15,_0x72f398){if(_0x460c15[_0x36bc('0x5e')]['id']){delete _0x460c15[_0x36bc('0x5e')]['id'];}delete _0x460c15[_0x36bc('0x5e')][_0x36bc('0x2b')];return db['User'][_0x36bc('0x5f')]({'where':{'id':_0x460c15[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x72f398,null))[_0x36bc('0x15')](saveUpdates(_0x460c15[_0x36bc('0x5e')],null))[_0x36bc('0x15')](respondWithResult(_0x72f398,null))[_0x36bc('0x1e')](handleError(_0x72f398,null));};exports['describe']=function(_0x16d9b6,_0x44a186){return db[_0x36bc('0x3c')][_0x36bc('0x60')]()[_0x36bc('0x15')](respondWithResult(_0x44a186,null))[_0x36bc('0x1e')](handleError(_0x44a186,null));};exports[_0x36bc('0x61')]=function(_0x25836d,_0x127f8a){return db['User'][_0x36bc('0x5f')]({'where':{'id':_0x25836d[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x127f8a,null))[_0x36bc('0x15')](function(_0xca0d8c){if(_0xca0d8c){return _0xca0d8c[_0x36bc('0x61')](_0x25836d[_0x36bc('0x5e')][_0x36bc('0x62')],_[_0x36bc('0x63')](_0x25836d[_0x36bc('0x5e')],[_0x36bc('0x62'),'id'])||{});}})[_0x36bc('0x15')](respondWithResult(_0x127f8a,null))['catch'](handleError(_0x127f8a,null));};function validateUser(_0x9e4db1){return new BPromise(function(_0x227e5f,_0x25dbd9){if(_0x9e4db1[_0x36bc('0x64')])return _0x227e5f(_0x9e4db1);return db['Setting'][_0x36bc('0x65')](0x1)['then'](function(_0x2be35c){if(_0x2be35c[_0x36bc('0x66')])authService['validatePasswordPattern'](_0x9e4db1[_0x36bc('0x41')]);db[_0x36bc('0x3c')]['max']('internal')['then'](function(_0x261dec){if(_[_0x36bc('0x67')](_0x261dec)){_0x9e4db1[_0x36bc('0x64')]=_0x2be35c[_0x36bc('0x68')]||0x1;return;}if(_[_0x36bc('0x67')](_0x2be35c[_0x36bc('0x68')])||_0x2be35c[_0x36bc('0x68')]===_0x261dec){_0x9e4db1[_0x36bc('0x64')]=_0x261dec+0x1;return;}if(_0x2be35c[_0x36bc('0x68')]>_0x261dec){_0x9e4db1['internal']=_0x2be35c[_0x36bc('0x68')];return;}return db[_0x36bc('0x69')][_0x36bc('0x44')](_0x36bc('0x6a'),{'type':db['sequelize'][_0x36bc('0x6b')][_0x36bc('0x6c')]})['then'](function(_0x45bf07){if(_0x45bf07&&_0x45bf07[_0x36bc('0x4d')]){for(var _0x3509cd=0x0,_0x4e49c5=_0x45bf07[_0x36bc('0x4d')];_0x3509cd<_0x4e49c5&&_[_0x36bc('0x67')](_0x9e4db1[_0x36bc('0x64')]);_0x3509cd++){if(_0x2be35c['min_internal']<=_0x45bf07[_0x3509cd][_0x36bc('0x6d')]){_0x9e4db1[_0x36bc('0x64')]=_0x45bf07[_0x3509cd][_0x36bc('0x6d')];}else if(_0x2be35c[_0x36bc('0x68')]>_0x45bf07[_0x3509cd][_0x36bc('0x6d')]&&_0x2be35c['min_internal']<=_0x45bf07[_0x3509cd]['to']){_0x9e4db1[_0x36bc('0x64')]=_0x2be35c[_0x36bc('0x68')];}}}if(_['isNil'](_0x9e4db1[_0x36bc('0x64')])){_0x9e4db1[_0x36bc('0x64')]=_0x261dec+0x1;}return _0x227e5f(_0x9e4db1);});});})[_0x36bc('0x1e')](function(_0x139892){_0x25dbd9(_0x139892);});});}function updateUser(_0x539839){return new BPromise(function(_0x1fb662,_0x254419){try{if(_0x539839[_0x36bc('0x6e')]){_0x539839[_0x36bc('0x6f')]=_0x539839[_0x36bc('0x64')];_0x539839[_0x36bc('0x70')]={'mailbox':_0x539839['internal'],'password':_0x539839[_0x36bc('0x41')],'fullname':_0x539839[_0x36bc('0x71')],'email':_0x539839[_0x36bc('0x72')]};}if(_0x539839[_0x36bc('0x2b')]===_0x36bc('0x30')){if(!_0x539839['permissions'])_0x539839[_0x36bc('0x73')]=['101',_0x36bc('0x74'),_0x36bc('0x75'),_0x36bc('0x76'),_0x36bc('0x77'),_0x36bc('0x78'),_0x36bc('0x79'),'106',_0x36bc('0x7a'),_0x36bc('0x7b'),_0x36bc('0x7c'),_0x36bc('0x7d'),_0x36bc('0x7e'),_0x36bc('0x7f'),_0x36bc('0x80')];}_0x1fb662(_0x539839);}catch(_0x37dd26){_0x254419(_0x37dd26);}});}exports[_0x36bc('0x81')]=function(_0x1434c3,_0x3305f5){if(_0x1434c3[_0x36bc('0x2e')]['role']===_0x36bc('0x30'))throw new Error(_0x36bc('0x82'));if(_0x1434c3[_0x36bc('0x5e')]['role']===_0x36bc('0x2e')&&_0x1434c3[_0x36bc('0x2e')][_0x36bc('0x2b')]!==_0x36bc('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x1434c3['body'][_0x36bc('0x2b')]===_0x36bc('0x2c')&&_0x1434c3[_0x36bc('0x2e')]['role']!==_0x36bc('0x2c')){throw new Error(_0x36bc('0x83'));}return licenseUtil[_0x36bc('0x84')]([_0x1434c3['body']])['then'](function(){return validateUser(_0x1434c3[_0x36bc('0x5e')]);})['then'](function(_0x3a04f9){return updateUser(_0x3a04f9)[_0x36bc('0x15')](function(_0x339a5b){if(_0x339a5b['role']===_0x36bc('0x2c')){_0x339a5b[_0x36bc('0x85')]=_0x1434c3[_0x36bc('0x2e')]['settingsEnabled'];delete _0x339a5b[_0x36bc('0x86')];}return _0x339a5b;});})[_0x36bc('0x15')](function(_0x297be1){return db['User'][_0x36bc('0x81')](_0x297be1,{'include':[{'model':db['VoiceMail'],'as':_0x36bc('0x70')}]});})['then'](function(_0x26dfd0){if(_0x1434c3[_0x36bc('0x5e')][_0x36bc('0x2b')]===_0x36bc('0x2e'))return _0x26dfd0;if(_0x1434c3['user'][_0x36bc('0x2b')]!==_0x36bc('0x2e'))return _0x26dfd0;return db[_0x36bc('0x87')][_0x36bc('0x5f')]({'where':{'name':_0x26dfd0['role']===_0x36bc('0x30')?_0x36bc('0x2f'):_0x36bc('0x31'),'userProfileId':_0x1434c3[_0x36bc('0x2e')]['userProfileId']},'raw':!![]})['then'](function(_0x1d0a6c){if(!_0x1d0a6c||_0x1d0a6c[_0x36bc('0x88')]!=0x0)return _0x26dfd0;return db[_0x36bc('0x38')][_0x36bc('0x81')]({'name':_0x26dfd0[_0x36bc('0x37')],'resourceId':_0x26dfd0['id'],'type':_0x1d0a6c[_0x36bc('0x37')],'sectionId':_0x1d0a6c['id']},{})[_0x36bc('0x15')](function(){return _0x26dfd0;});})[_0x36bc('0x1e')](function(_0x5ee481){logger[_0x36bc('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee481);throw _0x5ee481;});})[_0x36bc('0x15')](respondWithResult(_0x3305f5,0xc9))[_0x36bc('0x1e')](handleError(_0x3305f5,null));};exports[_0x36bc('0x89')]=function(_0x446499,_0x463a33){var _0x57795d=_0x446499[_0x36bc('0x5e')];var _0xbf9b82=[];if(_0x446499[_0x36bc('0x2e')][_0x36bc('0x2b')]===_0x36bc('0x30'))throw new Error(_0x36bc('0x82'));if(_[_0x36bc('0x8a')](_0x57795d,[_0x36bc('0x2b'),_0x36bc('0x2e')])&&_0x446499[_0x36bc('0x2e')][_0x36bc('0x2b')]!==_0x36bc('0x2c')){throw new Error(_0x36bc('0x8b'));}if(_[_0x36bc('0x8a')](_0x57795d,['role','admin'])&&_0x446499['user'][_0x36bc('0x2b')]!=='admin'){throw new Error(_0x36bc('0x8c'));}return licenseUtil['checkUserLimits'](_0x57795d)[_0x36bc('0x15')](function(){return validateUser(_0x57795d[0x0]);})[_0x36bc('0x15')](function(){for(var _0x16050e=0x1;_0x16050e<_0x57795d[_0x36bc('0x4d')];_0x16050e++){var _0x17a13c=_0x57795d[_0x16050e-0x1]['internal'];if(!_0x57795d[_0x16050e][_0x36bc('0x64')])_0x57795d[_0x16050e][_0x36bc('0x64')]=_0x17a13c+0x1;_0xbf9b82[_0x36bc('0x4e')](validateUser(_0x57795d[_0x16050e]));}return BPromise[_0x36bc('0x8d')](_0xbf9b82);})[_0x36bc('0x15')](function(){_0xbf9b82=[];for(var _0x13080a=0x0;_0x13080a<_0x57795d[_0x36bc('0x4d')];_0x13080a++){_0xbf9b82[_0x36bc('0x4e')](updateUser(_0x57795d[_0x13080a]));}return BPromise[_0x36bc('0x8d')](_0xbf9b82);})['then'](function(){return BPromise['each'](_0x57795d,function(_0x45013a){return db['User']['create'](_0x45013a,{'include':[{'model':db[_0x36bc('0x70')],'as':'VoiceMail'}]})[_0x36bc('0x15')](function(_0x1f6e9e){_0x45013a['id']=_0x1f6e9e['id'];return _0x45013a;});});})['then'](function(_0x28f7ed){if(_0x446499[_0x36bc('0x5e')]['role']==='user')return _0x28f7ed;if(_0x446499['user']['role']!=='user')return _0x28f7ed;var _0x25c166=_[_0x36bc('0x8a')](_0x28f7ed,function(_0x5d7e16){return _0x5d7e16[_0x36bc('0x2b')]===_0x36bc('0x30')||_0x5d7e16[_0x36bc('0x2b')]===_0x36bc('0x8e');});if(!_0x25c166)return _0x28f7ed;return db[_0x36bc('0x87')][_0x36bc('0x4a')]({'where':{'name':{'$or':[_0x36bc('0x2f'),_0x36bc('0x31')]},'userProfileId':_0x446499[_0x36bc('0x2e')][_0x36bc('0x86')]},'raw':!![]})['then'](function(_0x38721b){if(_[_0x36bc('0x8f')](_0x38721b)||!_[_0x36bc('0x8a')](_0x38721b,['autoAssociation',0x0]))return _0x28f7ed;_0xbf9b82=[];var _0x115255=_(_0x38721b)[_0x36bc('0x34')](function(_0x42083f){if(_0x42083f[_0x36bc('0x88')]===0x1)return;return _0x42083f['name']===_0x36bc('0x2f')?'agent':_0x36bc('0x8e');})[_0x36bc('0x90')]()[_0x36bc('0x35')]();for(var _0x54b824=0x0;_0x54b824<_0x28f7ed[_0x36bc('0x4d')];_0x54b824++){if(!_[_0x36bc('0x36')](_0x115255,_0x28f7ed[_0x54b824][_0x36bc('0x2b')]))return;var _0x53313e=_0x28f7ed[_0x54b824][_0x36bc('0x2b')]===_0x36bc('0x30')?_0x36bc('0x2f'):'Telephones';_0xbf9b82[_0x36bc('0x4e')](db[_0x36bc('0x38')][_0x36bc('0x81')]({'name':_0x28f7ed[_0x54b824][_0x36bc('0x37')],'resourceId':_0x28f7ed[_0x54b824]['id'],'type':_0x53313e,'sectionId':_['find'](_0x38721b,['name',_0x53313e])['id']},{}));}return BPromise[_0x36bc('0x8d')](_0xbf9b82);});})[_0x36bc('0x15')](respondWithResult(_0x463a33,0xc9))['catch'](handleError(_0x463a33,null));};exports[_0x36bc('0x91')]=function(_0x34475f,_0x41d3b2){if(_0x34475f[_0x36bc('0x5e')]['id']){delete _0x34475f[_0x36bc('0x5e')]['id'];}return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x34475f['params']['id']}})[_0x36bc('0x15')](function(_0x1a7d05){if(!_0x1a7d05)return null;if(_0x1a7d05['id']===_0x34475f['user']['id']){if(!_0x34475f[_0x36bc('0x5e')]['oldPassword']||!_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')]){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0x95'));}if(!_0x1a7d05['authenticate'](_0x34475f[_0x36bc('0x5e')][_0x36bc('0x96')])){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0x97'));}if(_0x34475f[_0x36bc('0x5e')]['oldPassword']===_0x34475f[_0x36bc('0x5e')]['newPassword']){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0x98'));}}else if(_0x34475f['user']['role']===_0x36bc('0x2c')){if(!_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')]){throw new db[(_0x36bc('0x93'))]['ValidationError'](_0x36bc('0x99'));}}else if(_0x34475f[_0x36bc('0x2e')][_0x36bc('0x2b')]===_0x36bc('0x2e')){if(!_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')]){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0x99'));}if(_0x1a7d05[_0x36bc('0x2b')]!==_0x36bc('0x30')){throw new db[(_0x36bc('0x93'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0x36bc('0x93'))]['ValidationError']('Unauthorized');}return _0x1a7d05;})[_0x36bc('0x15')](handleEntityNotFound(_0x41d3b2,null))[_0x36bc('0x15')](function(_0x6f792f){return db[_0x36bc('0x9a')][_0x36bc('0x9b')]({'attributes':['id',_0x36bc('0x66'),_0x36bc('0x9c'),_0x36bc('0x9d')]})['then'](function(_0x42dd49){if(_0x42dd49[_0x36bc('0x66')])authService['validatePasswordPattern'](_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')]);if(!_0x42dd49[_0x36bc('0x9c')]||!_0x6f792f[_0x36bc('0x9e')])return _0x6f792f;authService[_0x36bc('0x9f')](_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')],_0x6f792f[_0x36bc('0x9e')],_0x42dd49[_0x36bc('0x9d')]);return _0x6f792f;})[_0x36bc('0x15')](saveUpdates({'password':_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')],'passwordResetAt':_0x34475f[_0x36bc('0x2e')]['id']==_0x34475f[_0x36bc('0x53')]['id']?moment():null,'previousPasswords':authService[_0x36bc('0xa0')](_0x34475f[_0x36bc('0x5e')][_0x36bc('0x92')],_0x6f792f[_0x36bc('0x9e')])},null));})[_0x36bc('0x15')](respondWithResult(_0x41d3b2,null))[_0x36bc('0x1e')](handleError(_0x41d3b2,null));};exports[_0x36bc('0xa1')]=function(_0x2f6417,_0x5daf40){var _0x4e9f5e=_0x2f6417[_0x36bc('0x5e')][_0x36bc('0xa2')];return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x2f6417[_0x36bc('0x53')]['id']},'attributes':['id',_0x36bc('0x37'),'role',_0x36bc('0xa3'),_0x36bc('0xa4'),'voicePause',_0x36bc('0xa5')]})[_0x36bc('0x15')](handleEntityNotFound(_0x5daf40,null))[_0x36bc('0x15')](function(_0x57b822){if(_0x57b822){if(!utils[_0x36bc('0xa6')](_0x4e9f5e)){throw new db[(_0x36bc('0x93'))]['ValidationError'](_0x36bc('0xa7'));}return _0x57b822[_0x36bc('0xa8')+_[_0x36bc('0xa9')](_0x4e9f5e[_0x36bc('0xaa')]())+_0x36bc('0xab')](_0x2f6417['body']['ids'],{'penalty':_0x2f6417['body'][_0x36bc('0xac')]||0x0})['spread'](function(_0x5002dd){for(var _0x5b3ad2=0x0;_0x5b3ad2<_0x2f6417[_0x36bc('0x5e')][_0x36bc('0x62')][_0x36bc('0x4d')];_0x5b3ad2+=0x1){var _0x509872={'UserId':Number(_0x2f6417[_0x36bc('0x53')]['id'])};_0x509872[_[_0x36bc('0xa9')](_0x4e9f5e[_0x36bc('0xaa')]())+_0x36bc('0xad')]=Number(_0x2f6417['body'][_0x36bc('0x62')][_0x5b3ad2]);socket['emit'](_0x36bc('0x2e')+_['capitalize'](_0x4e9f5e[_0x36bc('0xaa')]())+_0x36bc('0xae'),_0x509872);}return _0x5002dd;})[_0x36bc('0x15')](function(){if(_0x4e9f5e==='voice'){return db['VoiceQueue'][_0x36bc('0x4a')]({'where':{'id':_0x2f6417[_0x36bc('0x5e')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x36bc('0x15')](function(_0x41ff9b){var _0x2918ee=_0x57b822[_0x36bc('0x2a')]({'plain':!![]});var _0x4ec087=[];if(_0x4e9f5e===_0x36bc('0xaf')&&_0x2918ee[_0x36bc('0x2b')]==='agent'&&_0x2918ee['online']){for(var _0x38eb9c=0x0;_0x38eb9c<_0x41ff9b[_0x36bc('0x4d')];_0x38eb9c+=0x1){_0x4ec087[_0x36bc('0x4e')]({'membername':_0x2918ee[_0x36bc('0x37')],'UserId':_0x2918ee['id'],'queue_name':_0x41ff9b[_0x38eb9c][_0x36bc('0x37')],'VoiceQueueId':_0x41ff9b[_0x38eb9c]['id'],'interface':_[_0x36bc('0x67')](_0x2918ee['interface'])?util[_0x36bc('0xb0')](_0x36bc('0xb1'),_0x2918ee[_0x36bc('0x37')]):_0x2918ee[_0x36bc('0xa5')],'paused':_0x2918ee[_0x36bc('0xb2')]||![],'penalty':_0x2f6417[_0x36bc('0x5e')]['penalty']||0x0});}return BPromise[_0x36bc('0xb3')](_0x4ec087,function(_0x267281){return db[_0x36bc('0xb4')][_0x36bc('0xb5')](_0x267281);});}return _0x57b822;});}})[_0x36bc('0x15')](respondWithStatusCode(_0x5daf40,null))[_0x36bc('0x1e')](handleError(_0x5daf40,null));};exports['removeQueues']=function(_0x567332,_0x571a85){var _0xa92e32,_0x3ae989;return db[_0x36bc('0x3c')]['find']({'where':{'id':_0x567332['params']['id']},'attributes':['id','name',_0x36bc('0x2b')]})[_0x36bc('0x15')](handleEntityNotFound(_0x571a85,null))[_0x36bc('0x15')](function(_0x59065e){if(_0x59065e){_0xa92e32=_0x59065e;if(!_0x567332[_0x36bc('0x44')][_0x36bc('0xa2')]||!utils['isValidChannel'](_0x567332['query']['channel'])){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0xa7'));}return _0x59065e[_0x36bc('0xb6')+_['capitalize'](_0x567332['query']['channel'][_0x36bc('0xaa')]())+'Queues'](_0x567332[_0x36bc('0x44')][_0x36bc('0x62')]);}})[_0x36bc('0x15')](function(_0x2d9886){if(_[_0x36bc('0xb7')](_0x567332[_0x36bc('0x44')]['ids'])){for(var _0x40f204=0x0;_0x40f204<_0x567332['query'][_0x36bc('0x62')][_0x36bc('0x4d')];_0x40f204+=0x1){_0x3ae989={'UserId':Number(_0x567332[_0x36bc('0x53')]['id'])};_0x3ae989[_[_0x36bc('0xa9')](_0x567332[_0x36bc('0x44')][_0x36bc('0xa2')]['toLowerCase']())+_0x36bc('0xad')]=Number(_0x567332[_0x36bc('0x44')][_0x36bc('0x62')][_0x40f204]);socket[_0x36bc('0xb8')](_0x36bc('0x2e')+_[_0x36bc('0xa9')](_0x567332[_0x36bc('0x44')][_0x36bc('0xa2')][_0x36bc('0xaa')]())+_0x36bc('0xb9'),_0x3ae989);}}else{_0x3ae989={'UserId':Number(_0x567332[_0x36bc('0x53')]['id'])};_0x3ae989[_[_0x36bc('0xa9')](_0x567332[_0x36bc('0x44')][_0x36bc('0xa2')][_0x36bc('0xaa')]())+_0x36bc('0xad')]=Number(_0x567332[_0x36bc('0x44')][_0x36bc('0x62')]);socket['emit'](_0x36bc('0x2e')+_[_0x36bc('0xa9')](_0x567332['query'][_0x36bc('0xa2')]['toLowerCase']())+'Queue:remove',_0x3ae989);}return _0x2d9886;})[_0x36bc('0x15')](function(){if(_0x567332[_0x36bc('0x44')][_0x36bc('0xa2')]===_0x36bc('0xaf')){return db[_0x36bc('0xb4')]['destroy']({'where':{'UserId':_0x567332[_0x36bc('0x53')]['id'],'VoiceQueueId':_0x567332[_0x36bc('0x44')]['ids']},'individualHooks':!![]})[_0x36bc('0x15')](function(){return _0xa92e32;});}return _0xa92e32;})['then'](respondWithStatusCode(_0x571a85,null))[_0x36bc('0x1e')](handleError(_0x571a85,null));};exports[_0x36bc('0xba')]=function(_0x241d44,_0x685ba9){_0x241d44[_0x36bc('0x5e')]['userpic']=_0x241d44['file'][_0x36bc('0xbb')];return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x241d44[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x685ba9,null))['then'](saveUpdates(_0x241d44[_0x36bc('0x5e')],null))[_0x36bc('0x15')](respondWithResult(_0x685ba9,null))[_0x36bc('0x1e')](handleError(_0x685ba9,null));};exports[_0x36bc('0xbc')]=function(_0x3b4976,_0x1899f2){var _0x157c3d=path['join'](config[_0x36bc('0xbd')],_0x36bc('0xbe'));return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x3b4976[_0x36bc('0x53')]['id']},'attributes':['id',_0x36bc('0xbf')],'raw':!![]})[_0x36bc('0x15')](handleEntityNotFound(_0x1899f2,null))[_0x36bc('0x15')](function(_0x59d13b){if(_0x59d13b){if(_[_0x36bc('0x67')](_0x59d13b[_0x36bc('0xbf')])){return _0x1899f2['download'](_0x157c3d);}else{if(!fs[_0x36bc('0xc0')](path[_0x36bc('0xc1')](config['root'],'server/files/images/',_0x59d13b['userpic']))){return _0x1899f2[_0x36bc('0xc2')](_0x157c3d);}return _0x1899f2['download'](path[_0x36bc('0xc1')](config[_0x36bc('0xbd')],_0x36bc('0xc3'),_0x59d13b[_0x36bc('0xbf')]));}}})[_0x36bc('0x1e')](handleError(_0x1899f2,null));};exports[_0x36bc('0xc4')]=function(_0x152819,_0x495a04){return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x152819[_0x36bc('0x53')]['id']},'attributes':['id']})[_0x36bc('0x15')](handleEntityNotFound(_0x495a04,null))[_0x36bc('0x15')](function(_0x3d5dbb){var _0x5eef23=[];values=_0x3d5dbb['dataValues'];_0x5eef23['push'](get_open_tabs('chat',_0x3d5dbb[_0x36bc('0x50')]));_0x5eef23[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x5c'),_0x3d5dbb[_0x36bc('0x50')]));_0x5eef23['push'](get_open_tabs(_0x36bc('0xc5'),_0x3d5dbb[_0x36bc('0x50')]));_0x5eef23['push'](get_open_tabs(_0x36bc('0xc6'),_0x3d5dbb[_0x36bc('0x50')]));_0x5eef23['push'](get_open_tabs(_0x36bc('0x5d'),_0x3d5dbb[_0x36bc('0x50')]));_0x5eef23[_0x36bc('0x4e')](get_open_tabs(_0x36bc('0x51'),_0x3d5dbb['dataValues']));return BPromise[_0x36bc('0x8d')](_0x5eef23);})[_0x36bc('0x15')](function(_0x319659){if(_0x319659){var _0x2bab39=_[_0x36bc('0x34')](values[_0x36bc('0xc7')],function(_0x292504){return{'channel':_0x36bc('0xc8'),'id':_0x292504['id'],'createdAt':_0x292504[_0x36bc('0xc9')]};});var _0x656d4f=_[_0x36bc('0x34')](values[_0x36bc('0xca')],function(_0x17c262){return{'channel':_0x36bc('0xcb'),'id':_0x17c262['id'],'createdAt':_0x17c262[_0x36bc('0xc9')]};});var _0x5ac8f9=_['map'](values[_0x36bc('0xcc')],function(_0x1f099f){return{'channel':'OPENCHANNEL','id':_0x1f099f['id'],'createdAt':_0x1f099f[_0x36bc('0xc9')]};});var _0x4b1222=_[_0x36bc('0x34')](values[_0x36bc('0xcd')],function(_0x32df21){return{'channel':'MAIL','id':_0x32df21['id'],'createdAt':_0x32df21[_0x36bc('0xc9')]};});var _0x597672=_[_0x36bc('0x34')](values[_0x36bc('0xce')],function(_0x4d7cc8){return{'channel':_0x36bc('0xcf'),'id':_0x4d7cc8['id'],'createdAt':_0x4d7cc8[_0x36bc('0xc9')]};});var _0x1f46c8=_[_0x36bc('0x34')](values[_0x36bc('0xd0')],function(_0x17042d){return{'channel':_0x36bc('0xd1'),'id':_0x17042d['id'],'createdAt':_0x17042d[_0x36bc('0xc9')]};});var _0x242275=_[_0x36bc('0xd2')](_0x2bab39,_0x656d4f,_0x5ac8f9,_0x4b1222,_0x597672,_0x1f46c8);var _0x42dd40={'count':_0x242275[_0x36bc('0x4d')],'rows':_0x242275};return _0x42dd40;}else return null;})[_0x36bc('0x15')](respondWithResult(_0x495a04,null))[_0x36bc('0x1e')](handleError(_0x495a04,null));};exports[_0x36bc('0xd3')]=function(_0x491f32,_0x348a02){var _0x48b19e={};var _0x579171={};var _0x55b00c;var _0x543075;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x491f32[_0x36bc('0x53')]['id']}})['then'](handleEntityNotFound(_0x348a02,null))['then'](function(_0x3c664c){if(_0x3c664c){_0x55b00c=_0x3c664c;_0x579171[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xd4')][_0x36bc('0x3d')]);_0x579171[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x491f32[_0x36bc('0x44')]);_0x579171[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x579171[_0x36bc('0x58')],_0x579171[_0x36bc('0x44')]);_0x48b19e[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x579171[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x491f32[_0x36bc('0x44')]['fields']));_0x48b19e[_0x36bc('0x49')]=_0x48b19e[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x48b19e[_0x36bc('0x49')]:_0x579171[_0x36bc('0x58')];_0x48b19e[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x491f32[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x48b19e['where']=qs['filters'](_[_0x36bc('0xd8')](_0x491f32[_0x36bc('0x44')],_0x579171[_0x36bc('0x56')]));if(_0x491f32[_0x36bc('0x44')][_0x36bc('0x32')]){_0x48b19e['where']=_['merge'](_0x48b19e[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x48b19e[_0x36bc('0x49')],function(_0x31d4f1){var _0x402717={};_0x402717[_0x31d4f1]={'$like':'%'+_0x491f32[_0x36bc('0x44')]['filter']+'%'};return _0x402717;})});}_0x48b19e=_[_0x36bc('0x5a')]({},_0x48b19e,_0x491f32[_0x36bc('0x5b')]);return _0x55b00c['getContacts'](_0x48b19e);}})[_0x36bc('0x15')](function(_0x34039e){if(_0x34039e){_0x543075=_0x34039e[_0x36bc('0x4d')];if(_0x491f32[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0x45'))){_0x48b19e[_0x36bc('0x46')]=[{'model':db[_0x36bc('0xda')],'as':_0x36bc('0xdb'),'required':![]},{'model':db[_0x36bc('0xdc')],'as':'Tags','attributes':['id',_0x36bc('0x37'),_0x36bc('0xdd')],'where':_0x491f32[_0x36bc('0x44')]['tag']?{'id':_0x491f32['query'][_0x36bc('0xde')]}:undefined,'required':_0x491f32['query']['tag']?!![]:![]}];}if(!_0x491f32[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x48b19e[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x491f32[_0x36bc('0x44')][_0x36bc('0x22')]);_0x48b19e['offset']=qs[_0x36bc('0x21')](_0x491f32[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x55b00c['getContacts'](_0x48b19e);}})[_0x36bc('0x15')](function(_0x306d5c){if(_0x306d5c){return _0x306d5c?{'count':_0x543075,'rows':_0x306d5c}:null;}})[_0x36bc('0x15')](respondWithResult(_0x348a02,null))[_0x36bc('0x1e')](handleError(_0x348a02,null));};exports[_0x36bc('0xe0')]=function(_0x5e13cb,_0x4ca4f1){var _0x2f018e;var _0x1c6aef={};var _0x2a3013;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x5e13cb[_0x36bc('0x53')]['id']},'attributes':['id',_0x36bc('0x37'),'role']})[_0x36bc('0x15')](handleEntityNotFound(_0x4ca4f1,null))[_0x36bc('0x15')](function(_0x42baf7){if(!utils['isValidChannel'](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0xa2')])){throw new db[(_0x36bc('0x93'))]['ValidationError'](_0x36bc('0xa7'));}_0x2f018e=_0x42baf7;var _0x26bc00={};_0x26bc00['model']=_[_0x36bc('0x55')](db[_[_0x36bc('0xa9')](_0x5e13cb['query'][_0x36bc('0xa2')])+_0x36bc('0xe1')]['rawAttributes']);_0x26bc00['query']=_[_0x36bc('0x55')](_0x5e13cb[_0x36bc('0x44')]);_0x26bc00[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x26bc00[_0x36bc('0x58')],_0x26bc00[_0x36bc('0x44')]);_0x1c6aef[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x26bc00[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x1c6aef[_0x36bc('0x49')]=_0x1c6aef['attributes'][_0x36bc('0x4d')]?_0x1c6aef[_0x36bc('0x49')]:_0x26bc00[_0x36bc('0x58')];_0x1c6aef[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x1c6aef['where']=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x5e13cb[_0x36bc('0x44')],_0x26bc00[_0x36bc('0x56')]));if(_0x5e13cb['query']['filter']){_0x1c6aef[_0x36bc('0x43')]=_['merge'](_0x1c6aef[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x1c6aef['attributes'],function(_0x136736){var _0x48b770={};_0x48b770[_0x136736]={'$like':'%'+_0x5e13cb[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x48b770;})});}_0x1c6aef=_['merge']({},_0x1c6aef,_0x5e13cb[_0x36bc('0x5b')]);switch(_0x2f018e[_0x36bc('0x2b')]){case _0x36bc('0x2c'):return db[_['capitalize'](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0xa2')])+_0x36bc('0xe1')][_0x36bc('0x4a')](_0x1c6aef);case _0x36bc('0x2e'):case _0x36bc('0x30'):return _0x2f018e['get'+_[_0x36bc('0xa9')](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0xa2')])+_0x36bc('0xab')](_0x1c6aef);default:throw new db['Sequelize'][(_0x36bc('0x94'))](_0x36bc('0xe2'));}})[_0x36bc('0x15')](function(_0x210d0f){_0x2a3013=_0x210d0f[_0x36bc('0x4d')];if(!_0x5e13cb[_0x36bc('0x44')]['hasOwnProperty'](_0x36bc('0xdf'))){_0x1c6aef['limit']=qs[_0x36bc('0x22')](_0x5e13cb[_0x36bc('0x44')][_0x36bc('0x22')]);_0x1c6aef[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x5e13cb['query'][_0x36bc('0x21')]);}switch(_0x2f018e[_0x36bc('0x2b')]){case _0x36bc('0x2c'):return db[_[_0x36bc('0xa9')](_0x5e13cb['query'][_0x36bc('0xa2')])+_0x36bc('0xe1')]['findAll'](_0x1c6aef);case _0x36bc('0x2e'):case'agent':return _0x2f018e[_0x36bc('0x2a')+_[_0x36bc('0xa9')](_0x5e13cb['query'][_0x36bc('0xa2')])+_0x36bc('0xab')](_0x1c6aef);}})['then'](function(_0x3d74de){return{'count':_0x2a3013,'rows':_0x3d74de};})['then'](respondWithResult(_0x4ca4f1,null))[_0x36bc('0x1e')](handleError(_0x4ca4f1,null));};exports[_0x36bc('0xe3')]=function(_0xd5d475,_0x22a370){var _0x53f865={};var _0x5e6f17={};var _0x355514;var _0x56d08a;return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0xd5d475['params']['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x22a370,null))[_0x36bc('0x15')](function(_0x1e7cd0){if(_0x1e7cd0){_0x355514=_0x1e7cd0;_0x5e6f17[_0x36bc('0x58')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x5e6f17[_0x36bc('0x44')]=_['keys'](_0xd5d475[_0x36bc('0x44')]);_0x5e6f17[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x5e6f17[_0x36bc('0x58')],_0x5e6f17[_0x36bc('0x44')]);_0x53f865[_0x36bc('0x49')]=_['intersection'](_0x5e6f17[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0xd5d475[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x53f865['attributes']=_0x53f865['attributes'][_0x36bc('0x4d')]?_0x53f865['attributes']:_0x5e6f17[_0x36bc('0x58')];_0x53f865[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0xd5d475['query'][_0x36bc('0xd7')]);_0x53f865['where']=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0xd5d475[_0x36bc('0x44')],_0x5e6f17['filters']));if(_0xd5d475[_0x36bc('0x44')][_0x36bc('0x32')]){_0x53f865[_0x36bc('0x43')]=_['merge'](_0x53f865[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x53f865[_0x36bc('0x49')],function(_0x489d15){var _0x38ad4b={};_0x38ad4b[_0x489d15]={'$like':'%'+_0xd5d475[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x38ad4b;})});}_0x53f865=_[_0x36bc('0x5a')]({},_0x53f865,_0xd5d475[_0x36bc('0x5b')]);return _0x355514[_0x36bc('0xe3')](_0x53f865);}})[_0x36bc('0x15')](function(_0x2d003c){if(_0x2d003c){_0x56d08a=_0x2d003c[_0x36bc('0x4d')];if(!_0xd5d475[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x53f865[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0xd5d475[_0x36bc('0x44')][_0x36bc('0x22')]);_0x53f865[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0xd5d475[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x355514[_0x36bc('0xe3')](_0x53f865);}})['then'](function(_0x49ca1a){if(_0x49ca1a){return _0x49ca1a?{'count':_0x56d08a,'rows':_0x49ca1a}:null;}})[_0x36bc('0x15')](respondWithResult(_0x22a370,null))['catch'](handleError(_0x22a370,null));};exports['getGroups']=function(_0x46c9b6,_0x296fed){var _0x29f344={};var _0x5b4d37={};var _0x3f4bbb;var _0x1bffe2;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x46c9b6['params']['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x296fed,null))['then'](function(_0x28220f){if(_0x28220f){_0x3f4bbb=_0x28220f;_0x5b4d37[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xe4')][_0x36bc('0x3d')]);_0x5b4d37[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x46c9b6['query']);_0x5b4d37[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x5b4d37[_0x36bc('0x58')],_0x5b4d37[_0x36bc('0x44')]);_0x29f344[_0x36bc('0x49')]=_['intersection'](_0x5b4d37[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x46c9b6[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x29f344[_0x36bc('0x49')]=_0x29f344['attributes'][_0x36bc('0x4d')]?_0x29f344[_0x36bc('0x49')]:_0x5b4d37[_0x36bc('0x58')];_0x29f344[_0x36bc('0xd6')]=qs['sort'](_0x46c9b6[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x29f344[_0x36bc('0x43')]=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x46c9b6[_0x36bc('0x44')],_0x5b4d37[_0x36bc('0x56')]));if(_0x46c9b6[_0x36bc('0x44')][_0x36bc('0x32')]){_0x29f344[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x29f344[_0x36bc('0x43')],{'$or':_['map'](_0x29f344[_0x36bc('0x49')],function(_0x18b8d9){var _0x3a1745={};_0x3a1745[_0x18b8d9]={'$like':'%'+_0x46c9b6[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x3a1745;})});}_0x29f344=_[_0x36bc('0x5a')]({},_0x29f344,_0x46c9b6[_0x36bc('0x5b')]);return _0x3f4bbb['getGroups'](_0x29f344);}})['then'](function(_0x42fd32){if(_0x42fd32){_0x1bffe2=_0x42fd32[_0x36bc('0x4d')];if(!_0x46c9b6[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x29f344[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x46c9b6[_0x36bc('0x44')][_0x36bc('0x22')]);_0x29f344[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x46c9b6[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x3f4bbb['getGroups'](_0x29f344);}})[_0x36bc('0x15')](function(_0x554711){if(_0x554711){return _0x554711?{'count':_0x1bffe2,'rows':_0x554711}:null;}})['then'](respondWithResult(_0x296fed,null))[_0x36bc('0x1e')](handleError(_0x296fed,null));};exports[_0x36bc('0xe5')]=function(_0x4f8c3c,_0xef9940){var _0x30477a={'raw':!![],'where':{}};var _0x535459={};var _0x204837={'count':0x0,'rows':[]};return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x4f8c3c[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0xef9940,null))[_0x36bc('0x15')](function(_0x10ac35){if(_0x10ac35){_0x535459[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xe6')]['rawAttributes']);_0x535459[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x4f8c3c[_0x36bc('0x44')]);_0x535459[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x535459[_0x36bc('0x58')],_0x535459[_0x36bc('0x44')]);_0x30477a['attributes']=_['intersection'](_0x535459['model'],qs[_0x36bc('0xd5')](_0x4f8c3c[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x30477a[_0x36bc('0x49')]=_0x30477a[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x30477a['attributes']:_0x535459[_0x36bc('0x58')];if(!_0x4f8c3c[_0x36bc('0x44')][_0x36bc('0xd9')]('nolimit')){_0x30477a[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x4f8c3c[_0x36bc('0x44')][_0x36bc('0x22')]);_0x30477a[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x4f8c3c['query']['offset']);}_0x30477a[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x4f8c3c[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x30477a['where']=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x4f8c3c[_0x36bc('0x44')],_0x535459['filters']));_0x30477a['where'][_0x36bc('0xe7')]=_0x10ac35['id'];if(_0x4f8c3c[_0x36bc('0x44')]['filter']){_0x30477a[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x30477a['where'],{'$or':_[_0x36bc('0x34')](_0x30477a[_0x36bc('0x49')],function(_0x39ac14){var _0x1232b4={};_0x1232b4[_0x39ac14]={'$like':'%'+_0x4f8c3c['query']['filter']+'%'};return _0x1232b4;})});}_0x30477a=_['merge']({},_0x30477a,_0x4f8c3c['options']);return db[_0x36bc('0xe6')][_0x36bc('0x23')]({'where':_0x30477a[_0x36bc('0x43')]})[_0x36bc('0x15')](function(_0x329d96){_0x204837[_0x36bc('0x23')]=_0x329d96;if(_0x4f8c3c['query']['includeAll']){_0x30477a[_0x36bc('0x46')]=[{'all':!![]}];}return db[_0x36bc('0xe6')][_0x36bc('0x4a')](_0x30477a);})[_0x36bc('0x15')](function(_0x191a26){_0x204837[_0x36bc('0x4b')]=_0x191a26;return _0x204837;});}})['then'](respondWithFilteredResult(_0xef9940,_0x30477a))[_0x36bc('0x1e')](handleError(_0xef9940,null));};exports['getScreenRecordings']=function(_0x391271,_0x15cfde){var _0x22a7ea={'raw':!![],'where':{}};var _0x2c7b19={};var _0x2e2e89={'count':0x0,'rows':[]};return db['User'][_0x36bc('0x9b')]({'where':{'id':_0x391271[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x15cfde,null))[_0x36bc('0x15')](function(_0x102645){if(_0x102645){_0x2c7b19[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xe8')][_0x36bc('0x3d')]);_0x2c7b19['query']=_[_0x36bc('0x55')](_0x391271[_0x36bc('0x44')]);_0x2c7b19[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x2c7b19['model'],_0x2c7b19[_0x36bc('0x44')]);_0x22a7ea['attributes']=_[_0x36bc('0x57')](_0x2c7b19[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x391271[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x22a7ea[_0x36bc('0x49')]=_0x22a7ea[_0x36bc('0x49')]['length']?_0x22a7ea['attributes']:_0x2c7b19[_0x36bc('0x58')];if(!_0x391271[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x22a7ea[_0x36bc('0x22')]=qs['limit'](_0x391271[_0x36bc('0x44')][_0x36bc('0x22')]);_0x22a7ea[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x391271[_0x36bc('0x44')]['offset']);}_0x22a7ea[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x391271[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x22a7ea['where']=qs[_0x36bc('0x56')](_['pick'](_0x391271[_0x36bc('0x44')],_0x2c7b19[_0x36bc('0x56')]));_0x22a7ea[_0x36bc('0x43')][_0x36bc('0xe7')]=_0x102645['id'];if(_0x391271['query']['filter']){_0x22a7ea['where']=_['merge'](_0x22a7ea[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x22a7ea[_0x36bc('0x49')],function(_0x3e4151){var _0x4e9769={};_0x4e9769[_0x3e4151]={'$like':'%'+_0x391271['query'][_0x36bc('0x32')]+'%'};return _0x4e9769;})});}_0x22a7ea=_[_0x36bc('0x5a')]({},_0x22a7ea,_0x391271[_0x36bc('0x5b')]);return db[_0x36bc('0xe8')][_0x36bc('0x23')]({'where':_0x22a7ea[_0x36bc('0x43')]})[_0x36bc('0x15')](function(_0xe331f0){_0x2e2e89[_0x36bc('0x23')]=_0xe331f0;if(_0x391271[_0x36bc('0x44')][_0x36bc('0x45')]){_0x22a7ea['include']=[{'all':!![]}];}return db[_0x36bc('0xe8')][_0x36bc('0x4a')](_0x22a7ea);})[_0x36bc('0x15')](function(_0x45f53a){_0x2e2e89[_0x36bc('0x4b')]=_0x45f53a;return _0x2e2e89;});}})[_0x36bc('0x15')](respondWithFilteredResult(_0x15cfde,_0x22a7ea))[_0x36bc('0x1e')](handleError(_0x15cfde,null));};exports['getChatInteractions']=function(_0xcc98fd,_0xecbd47){var _0x4cd7b={};var _0x356480={};var _0x153c59;var _0x51114f;return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0xcc98fd[_0x36bc('0x53')]['id']}})['then'](handleEntityNotFound(_0xecbd47,null))[_0x36bc('0x15')](function(_0x48d05f){if(_0x48d05f){_0x153c59=_0x48d05f;_0x356480[_0x36bc('0x58')]=_['keys'](db[_0x36bc('0xe9')][_0x36bc('0x3d')]);_0x356480[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0xcc98fd[_0x36bc('0x44')]);_0x356480[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x356480['model'],_0x356480[_0x36bc('0x44')]);_0x4cd7b['attributes']=_[_0x36bc('0x57')](_0x356480['model'],qs[_0x36bc('0xd5')](_0xcc98fd[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x4cd7b[_0x36bc('0x49')]=_0x4cd7b[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x4cd7b['attributes']:_0x356480[_0x36bc('0x58')];_0x4cd7b['order']=qs[_0x36bc('0xd7')](_0xcc98fd[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x4cd7b['where']=qs['filters'](_[_0x36bc('0xd8')](_0xcc98fd[_0x36bc('0x44')],_0x356480['filters']));if(_0xcc98fd[_0x36bc('0x44')][_0x36bc('0x32')]){_0x4cd7b[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x4cd7b[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x4cd7b[_0x36bc('0x49')],function(_0x22b0b4){var _0x37c51b={};_0x37c51b[_0x22b0b4]={'$like':'%'+_0xcc98fd['query']['filter']+'%'};return _0x37c51b;})});}_0x4cd7b=_[_0x36bc('0x5a')]({},_0x4cd7b,_0xcc98fd[_0x36bc('0x5b')]);return _0x153c59[_0x36bc('0xea')](_0x4cd7b);}})[_0x36bc('0x15')](function(_0x2189df){if(_0x2189df){_0x51114f=_0x2189df['length'];if(!_0xcc98fd[_0x36bc('0x44')][_0x36bc('0xd9')]('nolimit')){_0x4cd7b[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0xcc98fd[_0x36bc('0x44')][_0x36bc('0x22')]);_0x4cd7b['offset']=qs[_0x36bc('0x21')](_0xcc98fd[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x153c59[_0x36bc('0xea')](_0x4cd7b);}})[_0x36bc('0x15')](function(_0xe6d12){if(_0xe6d12){return _0xe6d12?{'count':_0x51114f,'rows':_0xe6d12}:null;}})[_0x36bc('0x15')](respondWithResult(_0xecbd47,null))[_0x36bc('0x1e')](handleError(_0xecbd47,null));};exports[_0x36bc('0xeb')]=function(_0x26ee58,_0x371795){var _0x323b44={};var _0x8b60a4={};var _0x1460bc;var _0x1ad91c;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x26ee58['params']['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x371795,null))['then'](function(_0xd833db){if(_0xd833db){_0x1460bc=_0xd833db;_0x8b60a4['model']=_[_0x36bc('0x55')](db[_0x36bc('0xec')][_0x36bc('0x3d')]);_0x8b60a4[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x26ee58[_0x36bc('0x44')]);_0x8b60a4[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x8b60a4[_0x36bc('0x58')],_0x8b60a4[_0x36bc('0x44')]);_0x323b44[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x8b60a4[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x26ee58['query'][_0x36bc('0xd5')]));_0x323b44[_0x36bc('0x49')]=_0x323b44[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x323b44[_0x36bc('0x49')]:_0x8b60a4[_0x36bc('0x58')];_0x323b44[_0x36bc('0xd6')]=qs['sort'](_0x26ee58[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x323b44[_0x36bc('0x43')]=qs['filters'](_[_0x36bc('0xd8')](_0x26ee58[_0x36bc('0x44')],_0x8b60a4[_0x36bc('0x56')]));if(_0x26ee58[_0x36bc('0x44')]['filter']){_0x323b44[_0x36bc('0x43')]=_['merge'](_0x323b44[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x323b44[_0x36bc('0x49')],function(_0x423621){var _0x181a1a={};_0x181a1a[_0x423621]={'$like':'%'+_0x26ee58[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x181a1a;})});}_0x323b44=_[_0x36bc('0x5a')]({},_0x323b44,_0x26ee58[_0x36bc('0x5b')]);return _0x1460bc['getOpenchannelInteractions'](_0x323b44);}})[_0x36bc('0x15')](function(_0x9de3da){if(_0x9de3da){_0x1ad91c=_0x9de3da['length'];if(!_0x26ee58[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x323b44[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x26ee58['query'][_0x36bc('0x22')]);_0x323b44['offset']=qs[_0x36bc('0x21')](_0x26ee58[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x1460bc[_0x36bc('0xeb')](_0x323b44);}})[_0x36bc('0x15')](function(_0x52e6ab){if(_0x52e6ab){return _0x52e6ab?{'count':_0x1ad91c,'rows':_0x52e6ab}:null;}})[_0x36bc('0x15')](respondWithResult(_0x371795,null))[_0x36bc('0x1e')](handleError(_0x371795,null));};exports[_0x36bc('0xed')]=function(_0x60336,_0x3c664b){var _0x51e91c={'raw':!![],'where':{}};var _0x322d14={};var _0x3b53b8={'count':0x0,'rows':[]};return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x60336[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x3c664b,null))[_0x36bc('0x15')](function(_0x44282b){if(_0x44282b){_0x322d14[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xee')]['rawAttributes']);_0x322d14[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x60336[_0x36bc('0x44')]);_0x322d14[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x322d14[_0x36bc('0x58')],_0x322d14[_0x36bc('0x44')]);_0x51e91c[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x322d14[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x60336[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x51e91c['attributes']=_0x51e91c[_0x36bc('0x49')]['length']?_0x51e91c[_0x36bc('0x49')]:_0x322d14[_0x36bc('0x58')];if(!_0x60336[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x51e91c['limit']=qs['limit'](_0x60336['query'][_0x36bc('0x22')]);_0x51e91c[_0x36bc('0x21')]=qs['offset'](_0x60336[_0x36bc('0x44')][_0x36bc('0x21')]);}_0x51e91c[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x60336[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x51e91c['where']=qs['filters'](_[_0x36bc('0xd8')](_0x60336[_0x36bc('0x44')],_0x322d14[_0x36bc('0x56')]));_0x51e91c[_0x36bc('0x43')][_0x36bc('0xe7')]=_0x44282b['id'];if(_0x60336[_0x36bc('0x44')][_0x36bc('0x32')]){_0x51e91c[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x51e91c[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x51e91c[_0x36bc('0x49')],function(_0x32634d){var _0x5b6842={};_0x5b6842[_0x32634d]={'$like':'%'+_0x60336[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x5b6842;})});}_0x51e91c=_[_0x36bc('0x5a')]({},_0x51e91c,_0x60336[_0x36bc('0x5b')]);return db[_0x36bc('0xee')][_0x36bc('0x23')]({'where':_0x51e91c[_0x36bc('0x43')]})[_0x36bc('0x15')](function(_0x4cdb86){_0x3b53b8['count']=_0x4cdb86;if(_0x60336['query'][_0x36bc('0x45')]){_0x51e91c[_0x36bc('0x46')]=[{'all':!![]}];}return db['MailInteraction'][_0x36bc('0x4a')](_0x51e91c);})[_0x36bc('0x15')](function(_0x32e1a9){_0x3b53b8[_0x36bc('0x4b')]=_0x32e1a9;return _0x3b53b8;});}})[_0x36bc('0x15')](respondWithFilteredResult(_0x3c664b,_0x51e91c))[_0x36bc('0x1e')](handleError(_0x3c664b,null));};exports['getSmsInteractions']=function(_0x8faf8c,_0x13791d){var _0x346e1a={};var _0xbde0c7={};var _0x3d8c63;var _0x10f94;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x8faf8c[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x13791d,null))['then'](function(_0x5d213b){if(_0x5d213b){_0x3d8c63=_0x5d213b;_0xbde0c7[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xef')][_0x36bc('0x3d')]);_0xbde0c7[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x8faf8c[_0x36bc('0x44')]);_0xbde0c7[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0xbde0c7[_0x36bc('0x58')],_0xbde0c7[_0x36bc('0x44')]);_0x346e1a[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0xbde0c7[_0x36bc('0x58')],qs['fields'](_0x8faf8c[_0x36bc('0x44')]['fields']));_0x346e1a[_0x36bc('0x49')]=_0x346e1a[_0x36bc('0x49')]['length']?_0x346e1a[_0x36bc('0x49')]:_0xbde0c7[_0x36bc('0x58')];_0x346e1a[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x8faf8c['query'][_0x36bc('0xd7')]);_0x346e1a[_0x36bc('0x43')]=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x8faf8c['query'],_0xbde0c7['filters']));if(_0x8faf8c[_0x36bc('0x44')][_0x36bc('0x32')]){_0x346e1a[_0x36bc('0x43')]=_['merge'](_0x346e1a[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x346e1a[_0x36bc('0x49')],function(_0x3fc3e8){var _0x3e61c8={};_0x3e61c8[_0x3fc3e8]={'$like':'%'+_0x8faf8c[_0x36bc('0x44')]['filter']+'%'};return _0x3e61c8;})});}_0x346e1a=_[_0x36bc('0x5a')]({},_0x346e1a,_0x8faf8c[_0x36bc('0x5b')]);return _0x3d8c63[_0x36bc('0xf0')](_0x346e1a);}})['then'](function(_0x4ab199){if(_0x4ab199){_0x10f94=_0x4ab199['length'];if(!_0x8faf8c[_0x36bc('0x44')][_0x36bc('0xd9')]('nolimit')){_0x346e1a[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x8faf8c[_0x36bc('0x44')][_0x36bc('0x22')]);_0x346e1a[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x8faf8c[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x3d8c63['getSmsInteractions'](_0x346e1a);}})[_0x36bc('0x15')](function(_0x46d950){if(_0x46d950){return _0x46d950?{'count':_0x10f94,'rows':_0x46d950}:null;}})[_0x36bc('0x15')](respondWithResult(_0x13791d,null))[_0x36bc('0x1e')](handleError(_0x13791d,null));};exports[_0x36bc('0xf1')]=function(_0x5cf11a,_0x14d492){var _0x15a917={};var _0x296b8c={};var _0x26b44d;var _0x53bc8f;return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0x5cf11a['params']['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x14d492,null))[_0x36bc('0x15')](function(_0x1d0911){if(_0x1d0911){_0x26b44d=_0x1d0911;_0x296b8c['model']=_[_0x36bc('0x55')](db[_0x36bc('0xf2')][_0x36bc('0x3d')]);_0x296b8c[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x5cf11a[_0x36bc('0x44')]);_0x296b8c[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x296b8c[_0x36bc('0x58')],_0x296b8c[_0x36bc('0x44')]);_0x15a917[_0x36bc('0x49')]=_['intersection'](_0x296b8c[_0x36bc('0x58')],qs['fields'](_0x5cf11a[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x15a917[_0x36bc('0x49')]=_0x15a917[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x15a917[_0x36bc('0x49')]:_0x296b8c[_0x36bc('0x58')];_0x15a917[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x5cf11a['query'][_0x36bc('0xd7')]);_0x15a917['where']=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x5cf11a['query'],_0x296b8c[_0x36bc('0x56')]));if(_0x5cf11a[_0x36bc('0x44')]['filter']){_0x15a917[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x15a917['where'],{'$or':_[_0x36bc('0x34')](_0x15a917[_0x36bc('0x49')],function(_0x255966){var _0x48dfc7={};_0x48dfc7[_0x255966]={'$like':'%'+_0x5cf11a[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x48dfc7;})});}_0x15a917=_[_0x36bc('0x5a')]({},_0x15a917,_0x5cf11a[_0x36bc('0x5b')]);return _0x26b44d[_0x36bc('0xf1')](_0x15a917);}})[_0x36bc('0x15')](function(_0x24eae1){if(_0x24eae1){_0x53bc8f=_0x24eae1[_0x36bc('0x4d')];if(!_0x5cf11a[_0x36bc('0x44')][_0x36bc('0xd9')]('nolimit')){_0x15a917[_0x36bc('0x22')]=qs['limit'](_0x5cf11a[_0x36bc('0x44')]['limit']);_0x15a917['offset']=qs[_0x36bc('0x21')](_0x5cf11a[_0x36bc('0x44')]['offset']);}return _0x26b44d[_0x36bc('0xf1')](_0x15a917);}})[_0x36bc('0x15')](function(_0xf211a9){if(_0xf211a9){return _0xf211a9?{'count':_0x53bc8f,'rows':_0xf211a9}:null;}})[_0x36bc('0x15')](respondWithResult(_0x14d492,null))['catch'](handleError(_0x14d492,null));};exports[_0x36bc('0xf3')]=function(_0x4f08da,_0x3398e9){var _0x3e6d75={};var _0x4d997e={};var _0x5ee2ee;var _0x5044c2;return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0x4f08da['params']['id']}})['then'](handleEntityNotFound(_0x3398e9,null))[_0x36bc('0x15')](function(_0x1acd74){if(_0x1acd74){_0x5ee2ee=_0x1acd74;_0x4d997e[_0x36bc('0x58')]=_[_0x36bc('0x55')](db[_0x36bc('0xf4')][_0x36bc('0x3d')]);_0x4d997e['query']=_['keys'](_0x4f08da['query']);_0x4d997e['filters']=_['intersection'](_0x4d997e[_0x36bc('0x58')],_0x4d997e['query']);_0x3e6d75[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x4d997e[_0x36bc('0x58')],qs['fields'](_0x4f08da['query'][_0x36bc('0xd5')]));_0x3e6d75['attributes']=_0x3e6d75[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x3e6d75[_0x36bc('0x49')]:_0x4d997e[_0x36bc('0x58')];_0x3e6d75[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x4f08da[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x3e6d75[_0x36bc('0x43')]=qs[_0x36bc('0x56')](_[_0x36bc('0xd8')](_0x4f08da[_0x36bc('0x44')],_0x4d997e['filters']));if(_0x4f08da[_0x36bc('0x44')][_0x36bc('0x32')]){_0x3e6d75[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x3e6d75[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x3e6d75[_0x36bc('0x49')],function(_0x3423b8){var _0x82f2ca={};_0x82f2ca[_0x3423b8]={'$like':'%'+_0x4f08da[_0x36bc('0x44')]['filter']+'%'};return _0x82f2ca;})});}_0x3e6d75=_[_0x36bc('0x5a')]({},_0x3e6d75,_0x4f08da['options']);return _0x5ee2ee[_0x36bc('0xf3')](_0x3e6d75);}})['then'](function(_0x242b28){if(_0x242b28){_0x5044c2=_0x242b28['length'];if(!_0x4f08da[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x3e6d75['limit']=qs[_0x36bc('0x22')](_0x4f08da['query']['limit']);_0x3e6d75[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x4f08da[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x5ee2ee['getWhatsappInteractions'](_0x3e6d75);}})['then'](function(_0x31a172){if(_0x31a172){return _0x31a172?{'count':_0x5044c2,'rows':_0x31a172}:null;}})[_0x36bc('0x15')](respondWithResult(_0x3398e9,null))[_0x36bc('0x1e')](handleError(_0x3398e9,null));};exports['login']=function(_0x1e12e3,_0x2b4dfe,_0x2e070c){var _0x11f023;var _0x366c58;var _0x337855;var _0x5700fa=!_[_0x36bc('0x67')](_0x1e12e3['params']['id'])?_0x1e12e3[_0x36bc('0x53')]['id']:!_[_0x36bc('0x67')](_0x1e12e3['user']['id'])?_0x1e12e3[_0x36bc('0x2e')]['id']:null;return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x5700fa,'role':{'$or':['admin',_0x36bc('0x2e'),_0x36bc('0x30')]}},'attributes':['id',_0x36bc('0x37'),'phone','mobile',_0x36bc('0x2b'),_0x36bc('0x64'),_0x36bc('0xa4')]})[_0x36bc('0x15')](function(_0x1bc1b8){if(_0x1bc1b8){if(_0x1bc1b8[_0x36bc('0x2b')]===_0x36bc('0x30')){_0x11f023=_0x1bc1b8;if(_0x1e12e3[_0x36bc('0x5e')][_0x36bc('0xa5')]){_0x337855=util[_0x36bc('0xb0')](_0x36bc('0xf5'),_0x11f023[_0x1e12e3['body'][_0x36bc('0xa5')]]);}else if(_0x1e12e3[_0x36bc('0x5e')][_0x36bc('0xf6')]){_0x337855=util[_0x36bc('0xb0')](_0x36bc('0xb1'),_0x1e12e3['body'][_0x36bc('0xf6')]);}else{_0x337855=util[_0x36bc('0xb0')]('SIP/%s',_0x11f023[_0x36bc('0x37')]);}socket['to'](util[_0x36bc('0xb0')](_0x36bc('0xf7'),_0x11f023['name']))[_0x36bc('0xb8')]('user:forcelogout',{'user':{'id':_0x11f023['id'],'name':_0x11f023['name']},'ip':_0x1e12e3[_0x36bc('0xf8')]['x-forwarded-for']||_0x1e12e3[_0x36bc('0xf9')][_0x36bc('0xfa')]||_0x1e12e3[_0x36bc('0xfb')]['remoteAddress']||_0x1e12e3['connection'][_0x36bc('0xfb')][_0x36bc('0xfa')]});return db[_0x36bc('0xb4')][_0x36bc('0x29')]({'where':{'membername':_0x11f023[_0x36bc('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x36bc('0x93'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x11f023){return _0x11f023[_0x36bc('0xfc')]({'raw':!![]});}})[_0x36bc('0x15')](function(_0x1586bf){if(_0x11f023){var _0x181276=[];if(_0x1586bf){_0x366c58=_0x1586bf;if(_0x366c58[_0x36bc('0x4d')]){for(var _0x1875e4=0x0;_0x1875e4<_0x366c58[_0x36bc('0x4d')];_0x1875e4++){_0x181276[_0x36bc('0x4e')]({'membername':_0x11f023['name'],'UserId':_0x11f023['id'],'queue_name':_0x366c58[_0x1875e4][_0x36bc('0x37')],'VoiceQueueId':_0x366c58[_0x1875e4]['id'],'interface':_0x337855,'paused':_0x11f023[_0x36bc('0xa4')]||![],'penalty':_0x366c58[_0x1875e4][_0x36bc('0xfd')]||0x0});}return BPromise[_0x36bc('0xb3')](_0x181276,function(_0x1ced75){return db[_0x36bc('0xb4')][_0x36bc('0xb5')](_0x1ced75);});}}}})[_0x36bc('0x15')](function(){if(_0x11f023){return db[_0x36bc('0xfe')][_0x36bc('0x4a')]({'where':{'membername':_0x11f023['name'],'exitAt':null}});}})[_0x36bc('0x15')](function(_0x273398){if(_0x11f023){var _0x108dde=[];_0x273398[_0x36bc('0xff')](function(_0x35e320){_0x108dde[_0x36bc('0x4e')](_0x35e320[_0x36bc('0x28')]({'exitAt':moment()[_0x36bc('0xb0')](_0x36bc('0x100'))}));});return BPromise[_0x36bc('0x8d')](_0x108dde);}})[_0x36bc('0x15')](function(){if(_0x11f023){var _0x3784f8=[];var _0x1cd95f=[];var _0x283a3d=utils[_0x36bc('0x101')]();var _0x2a725f={'membername':_0x11f023[_0x36bc('0x37')],'interface':_0x337855,'enterAt':moment()[_0x36bc('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x11f023[_0x36bc('0x2b')],'internal':_0x11f023['internal']};_0x283a3d['forEach'](function(_0xe70d12){_0x3784f8[_0x36bc('0x4e')](_[_0x36bc('0x5a')]({'channel':_0xe70d12,'type':'LOGIN','data1':_0x1e12e3[_0x36bc('0x5e')][_0x36bc('0x102')],'data2':_0x337855},_0x2a725f));if(_0x11f023[_0x36bc('0xa4')]){_0x1cd95f[_0x36bc('0x4e')](_[_0x36bc('0x5a')]({'channel':_0xe70d12,'type':_0x36bc('0x103'),'data1':'LOGININPAUSE'},_0x2a725f));}});return db[_0x36bc('0xfe')][_0x36bc('0x89')](_0x3784f8[_0x36bc('0xd2')](_0x1cd95f),{'individualHooks':!![]});}})['then'](function(){if(_0x11f023){return _0x11f023[_0x36bc('0x28')]({'online':!![],'lastLoginAt':moment()[_0x36bc('0xb0')](_0x36bc('0x100')),'voicePause':_0x11f023[_0x36bc('0xa4')]||![],'mailPause':_0x11f023[_0x36bc('0xa4')]||![],'chatPause':_0x11f023['loginInPause']||![],'faxPause':_0x11f023[_0x36bc('0xa4')]||![],'smsPause':_0x11f023['loginInPause']||![],'openchannelPause':_0x11f023[_0x36bc('0xa4')]||![],'whatsappPause':_0x11f023['loginInPause']||![],'pauseType':_0x11f023[_0x36bc('0xa4')]?_0x36bc('0x104'):null,'interface':_0x337855,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x36bc('0x15')](function(_0x49ddcf){if(_0x1e12e3['isMiddleware']){return _0x2e070c();}else{return BPromise[_0x36bc('0x105')](_0x49ddcf)[_0x36bc('0x15')](respondWithResult(_0x2b4dfe,null));}})['catch'](handleError(_0x2b4dfe,null));};exports[_0x36bc('0x106')]=function(_0x40a096,_0x51bdf8){var _0x5b1258;return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x40a096[_0x36bc('0x53')]['id'],'role':_0x36bc('0x30')},'attributes':['id',_0x36bc('0x37'),_0x36bc('0x2b')]})[_0x36bc('0x15')](handleEntityNotFound(_0x51bdf8,null))[_0x36bc('0x15')](function(_0x1ea5df){if(_0x1ea5df){_0x5b1258=_0x1ea5df;return db[_0x36bc('0xb4')][_0x36bc('0x29')]({'where':{'membername':_0x5b1258[_0x36bc('0x37')]},'individualHooks':!![]});}})[_0x36bc('0x15')](function(){return db['MemberReport'][_0x36bc('0x4a')]({'where':{'membername':_0x5b1258[_0x36bc('0x37')],'exitAt':null}});})[_0x36bc('0x15')](function(_0x1818dd){var _0x4d6576=[];_0x1818dd[_0x36bc('0xff')](function(_0x1e5f1e){_0x4d6576[_0x36bc('0x4e')](_0x1e5f1e['update']({'exitAt':moment()[_0x36bc('0xb0')](_0x36bc('0x100'))}));});return BPromise[_0x36bc('0x8d')](_0x4d6576);})[_0x36bc('0x15')](function(){return _0x5b1258[_0x36bc('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x36bc('0x15')](respondWithResult(_0x51bdf8,null))['catch'](handleError(_0x51bdf8,null));};exports[_0x36bc('0x107')]=function(_0x4ce62e,_0x1f7765){var _0x5d8130;return db[_0x36bc('0xb4')][_0x36bc('0x28')]({'paused':0x1},{'where':{'UserId':_0x4ce62e['params']['id']},'individualHooks':!![]})[_0x36bc('0x15')](function(){return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x4ce62e['params']['id'],'role':'agent'},'attributes':['id',_0x36bc('0x37'),_0x36bc('0x2b'),'internal',_0x36bc('0xa5')]});})['then'](handleEntityNotFound(_0x1f7765,null))[_0x36bc('0x15')](function(_0x50f6c1){if(_0x50f6c1){_0x5d8130=_0x50f6c1;return respondWithRpcPromise(_0x36bc('0x108'),_0x36bc('0x107'),{'id':_0x5d8130['id'],'name':_0x5d8130[_0x36bc('0x37')],'pause':!![]});}})['then'](function(){if(_0x5d8130){return db[_0x36bc('0xfe')][_0x36bc('0x4a')]({'where':{'membername':_0x5d8130[_0x36bc('0x37')],'type':_0x36bc('0x103'),'exitAt':null}});}})['then'](function(_0x54c56f){if(_0x54c56f[_0x36bc('0x4d')]){var _0x27a11f=moment()[_0x36bc('0xb0')](_0x36bc('0x100'));for(var _0x190e9b=0x0,_0x12f1c6=_0x54c56f['length'];_0x190e9b<_0x12f1c6;_0x190e9b++){_0x54c56f[_0x190e9b][_0x36bc('0x109')]({'exitAt':_0x27a11f});}}})[_0x36bc('0x15')](function(){var _0x484323=[];var _0x205198=utils['getChannels']();_0x205198[_0x36bc('0xff')](function(_0x2b72ea){_0x484323[_0x36bc('0x4e')]({'channel':_0x2b72ea,'membername':_0x5d8130[_0x36bc('0x37')],'interface':_[_0x36bc('0x67')](_0x5d8130['interface'])?util[_0x36bc('0xb0')](_0x36bc('0xb1'),_0x5d8130[_0x36bc('0x37')]):_0x5d8130[_0x36bc('0xa5')],'type':_0x36bc('0x103'),'enterAt':moment()[_0x36bc('0xb0')](_0x36bc('0x100')),'data1':_0x4ce62e['body'][_0x36bc('0x3f')]||_0x36bc('0x10a'),'role':_0x5d8130['role'],'internal':_0x5d8130['internal']});});return db[_0x36bc('0xfe')]['bulkCreate'](_0x484323,{'individualHooks':!![]});})[_0x36bc('0x15')](function(){return _0x5d8130[_0x36bc('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4ce62e[_0x36bc('0x5e')][_0x36bc('0x3f')]||_0x36bc('0x10a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x36bc('0x15')](respondWithResult(_0x1f7765,null))['catch'](handleError(_0x1f7765,null));};exports[_0x36bc('0x10b')]=function(_0x287afb,_0x238761){var _0x3e516b;return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x287afb[_0x36bc('0x53')]['id']},'attributes':['id',_0x36bc('0x37'),_0x36bc('0x2b'),_0x36bc('0xb2'),_0x36bc('0x10c'),_0x36bc('0x10d'),_0x36bc('0x10e'),'openchannelPause','smsPause',_0x36bc('0x10f'),_0x36bc('0x110'),_0x36bc('0x111')]})[_0x36bc('0x15')](handleEntityNotFound(_0x238761,null))[_0x36bc('0x15')](function(_0x562666){if(_0x562666){_0x3e516b=_0x562666;if(_0x287afb[_0x36bc('0x5e')][_0x36bc('0xa2')]&&!utils[_0x36bc('0xa6')](_0x287afb['body'][_0x36bc('0xa2')])){throw new db[(_0x36bc('0x93'))][(_0x36bc('0x94'))](_0x36bc('0xa7'));}switch(_0x287afb[_0x36bc('0x5e')]['channel']){case _0x36bc('0xaf'):return respondWithRpcPromise(_0x36bc('0x108'),_0x36bc('0x10b'),{'id':_0x3e516b['id'],'name':_0x3e516b['name'],'pause':![]})['then'](function(){return db[_0x36bc('0xb4')]['update']({'paused':0x0},{'where':{'UserId':_0x3e516b['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x36bc('0x5f')]({'where':{'channel':_0x287afb['body']['channel'],'membername':_0x3e516b[_0x36bc('0x37')],'type':'PAUSE','exitAt':null}});})[_0x36bc('0x15')](function(_0x553543){if(_0x553543){return _0x553543['update']({'exitAt':moment()[_0x36bc('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x36bc('0x112')},{'individualHooks':!![]});}return null;})[_0x36bc('0x15')](function(){return _0x3e516b['update']({'voicePause':![]});});case'mail':case _0x36bc('0x4f'):case'fax':case _0x36bc('0x5c'):case _0x36bc('0xc6'):case _0x36bc('0xc5'):return db[_0x36bc('0xfe')]['find']({'where':{'channel':_0x287afb[_0x36bc('0x5e')][_0x36bc('0xa2')],'membername':_0x3e516b[_0x36bc('0x37')],'type':'PAUSE','exitAt':null}})[_0x36bc('0x15')](function(_0x401893){if(_0x401893){return _0x401893[_0x36bc('0x28')]({'exitAt':moment()['format'](_0x36bc('0x100')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x36bc('0x15')](function(){var _0x44b8eb={};_['set'](_0x44b8eb,util[_0x36bc('0xb0')]('%s%s',_0x287afb[_0x36bc('0x5e')][_0x36bc('0xa2')],'Pause'),![]);return _0x3e516b['update'](_0x44b8eb);});default:return respondWithRpcPromise(_0x36bc('0x108'),_0x36bc('0x10b'),{'id':_0x3e516b['id'],'name':_0x3e516b[_0x36bc('0x37')],'pause':![]})[_0x36bc('0x15')](function(){return db[_0x36bc('0xb4')]['update']({'paused':0x0},{'where':{'UserId':_0x3e516b['id']}});})['then'](function(){return db['MemberReport'][_0x36bc('0x4a')]({'where':{'membername':_0x3e516b[_0x36bc('0x37')],'type':_0x36bc('0x103'),'exitAt':null}});})[_0x36bc('0x15')](function(_0x320a40){var _0x55a95f=[];_0x320a40[_0x36bc('0xff')](function(_0x22b08a){_0x55a95f['push'](_0x22b08a['update']({'exitAt':moment()[_0x36bc('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x36bc('0x112')}));});return BPromise[_0x36bc('0x8d')](_0x55a95f);})[_0x36bc('0x15')](function(){return _0x3e516b[_0x36bc('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x36bc('0x15')](respondWithResult(_0x238761,null))['catch'](handleError(_0x238761,null));};exports['getTeams']=function(_0x2bc303,_0x4aa45f){var _0x4e82ac={};var _0x270924={};var _0x5096c8;var _0x2c3a13;return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0x2bc303[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x4aa45f,null))[_0x36bc('0x15')](function(_0x4401e1){if(_0x4401e1){_0x5096c8=_0x4401e1;_0x270924[_0x36bc('0x58')]=_['keys'](db['Team'][_0x36bc('0x3d')]);_0x270924[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x2bc303[_0x36bc('0x44')]);_0x270924[_0x36bc('0x56')]=_[_0x36bc('0x57')](_0x270924[_0x36bc('0x58')],_0x270924['query']);_0x4e82ac['attributes']=_[_0x36bc('0x57')](_0x270924[_0x36bc('0x58')],qs[_0x36bc('0xd5')](_0x2bc303['query'][_0x36bc('0xd5')]));_0x4e82ac[_0x36bc('0x49')]=_0x4e82ac[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x4e82ac[_0x36bc('0x49')]:_0x270924['model'];_0x4e82ac[_0x36bc('0xd6')]=qs[_0x36bc('0xd7')](_0x2bc303['query']['sort']);_0x4e82ac[_0x36bc('0x43')]=qs[_0x36bc('0x56')](_['pick'](_0x2bc303[_0x36bc('0x44')],_0x270924[_0x36bc('0x56')]));if(_0x2bc303[_0x36bc('0x44')][_0x36bc('0x32')]){_0x4e82ac[_0x36bc('0x43')]=_[_0x36bc('0x5a')](_0x4e82ac[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x4e82ac[_0x36bc('0x49')],function(_0x32a3ad){var _0x56c5cb={};_0x56c5cb[_0x32a3ad]={'$like':'%'+_0x2bc303[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x56c5cb;})});}_0x4e82ac=_[_0x36bc('0x5a')]({},_0x4e82ac,_0x2bc303[_0x36bc('0x5b')]);return _0x5096c8[_0x36bc('0x113')](_0x4e82ac);}})[_0x36bc('0x15')](function(_0x23973c){if(_0x23973c){_0x2c3a13=_0x23973c[_0x36bc('0x4d')];if(!_0x2bc303[_0x36bc('0x44')][_0x36bc('0xd9')](_0x36bc('0xdf'))){_0x4e82ac[_0x36bc('0x22')]=qs['limit'](_0x2bc303[_0x36bc('0x44')][_0x36bc('0x22')]);_0x4e82ac[_0x36bc('0x21')]=qs[_0x36bc('0x21')](_0x2bc303['query'][_0x36bc('0x21')]);}return _0x5096c8['getTeams'](_0x4e82ac);}})[_0x36bc('0x15')](function(_0x5ece4f){if(_0x5ece4f){return _0x5ece4f?{'count':_0x2c3a13,'rows':_0x5ece4f}:null;}})[_0x36bc('0x15')](respondWithResult(_0x4aa45f,null))[_0x36bc('0x1e')](handleError(_0x4aa45f,null));};exports[_0x36bc('0x114')]=function(_0x12b6d6,_0x4c0ac7){return db[_0x36bc('0x3c')][_0x36bc('0x5f')]({'where':{'id':_0x12b6d6['params']['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x4c0ac7,null))[_0x36bc('0x15')](function(_0x49d5b7){if(_0x49d5b7){var _0x3b47bb=_0x49d5b7['get']({'plain':!![]});return _0x49d5b7[_0x36bc('0x114')](_0x12b6d6[_0x36bc('0x5e')]['ids'],_['omit'](_0x12b6d6[_0x36bc('0x5e')],[_0x36bc('0x62'),'id'])||{})[_0x36bc('0x15')](function(){for(var _0x10d9bd=0x0;_0x10d9bd<_0x12b6d6[_0x36bc('0x5e')][_0x36bc('0x62')][_0x36bc('0x4d')];_0x10d9bd++){var _0xa43735=[];var _0x5b613b={};db[_0x36bc('0x115')][_0x36bc('0x9b')]({'where':{'id':_0x12b6d6[_0x36bc('0x5e')]['ids'][_0x10d9bd]}})[_0x36bc('0x15')](function(_0x57b595){_0x5b613b=_0x57b595[_0x36bc('0x50')];_0xa43735[_0x36bc('0x4e')](_0x57b595[_0x36bc('0xfc')]()[_0x36bc('0x15')](function(_0x15ef33){for(var _0x54f3dd=0x0;_0x54f3dd<_0x15ef33['length'];_0x54f3dd++){_0x15ef33[_0x54f3dd][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x117'));}return _0x15ef33;}));_0xa43735[_0x36bc('0x4e')](_0x57b595[_0x36bc('0x118')]()['then'](function(_0x5a91bc){for(var _0x279ebe=0x0;_0x279ebe<_0x5a91bc[_0x36bc('0x4d')];_0x279ebe++){_0x5a91bc[_0x279ebe][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x119'));}return _0x5a91bc;}));_0xa43735[_0x36bc('0x4e')](_0x57b595['getMailQueues']()[_0x36bc('0x15')](function(_0x5e1a0a){for(var _0x5ab766=0x0;_0x5ab766<_0x5e1a0a[_0x36bc('0x4d')];_0x5ab766++){_0x5e1a0a[_0x5ab766][_0x36bc('0x116')](_0x36bc('0xa2'),'Mail');}return _0x5e1a0a;}));_0xa43735[_0x36bc('0x4e')](_0x57b595[_0x36bc('0x11a')]()['then'](function(_0xc38b53){for(var _0xa6761a=0x0;_0xa6761a<_0xc38b53['length'];_0xa6761a++){_0xc38b53[_0xa6761a][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x11b'));}return _0xc38b53;}));_0xa43735['push'](_0x57b595['getWhatsappQueues']()['then'](function(_0x91337e){for(var _0x442378=0x0;_0x442378<_0x91337e[_0x36bc('0x4d')];_0x442378++){_0x91337e[_0x442378][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x11c'));}return _0x91337e;}));_0xa43735[_0x36bc('0x4e')](_0x57b595[_0x36bc('0x11d')]()[_0x36bc('0x15')](function(_0x1454ad){for(var _0x3b203c=0x0;_0x3b203c<_0x1454ad['length'];_0x3b203c++){_0x1454ad[_0x3b203c][_0x36bc('0x116')]('channel',_0x36bc('0x11e'));}return _0x1454ad;}));_0xa43735[_0x36bc('0x4e')](_0x57b595[_0x36bc('0x11f')]()[_0x36bc('0x15')](function(_0x22a9a6){for(var _0x586ea4=0x0;_0x586ea4<_0x22a9a6[_0x36bc('0x4d')];_0x586ea4++){_0x22a9a6[_0x586ea4][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x120'));}return _0x22a9a6;}));return BPromise[_0x36bc('0x8d')](_0xa43735);})['then'](function(_0x6a7216){var _0x207d4c=_[_0x36bc('0x121')](_0x6a7216);_0xa43735=[];return db['sequelize'][_0x36bc('0x122')](function(_0x78954b){for(var _0x356460=0x0;_0x356460<_0x207d4c['length'];_0x356460++){_0xa43735[_0x36bc('0x4e')](_0x207d4c[_0x356460]['addAgent'](_0x3b47bb['id']),{'transaction':_0x78954b});}return BPromise[_0x36bc('0x8d')](_0xa43735)[_0x36bc('0x15')](function(){if(_0x3b47bb[_0x36bc('0xa3')]){return BPromise[_0x36bc('0xb3')](_[_0x36bc('0x32')](_0x207d4c,function(_0x2c45e2){return _0x2c45e2[_0x36bc('0x123')](_0x36bc('0xa2'))===_0x36bc('0x117');}),function(_0x5d3d6e){return db['UserVoiceQueueRt'][_0x36bc('0xb5')]({'membername':_0x3b47bb[_0x36bc('0x37')],'UserId':_0x3b47bb['id'],'queue_name':_0x5d3d6e['name'],'VoiceQueueId':_0x5d3d6e['id'],'interface':_[_0x36bc('0x67')](_0x3b47bb[_0x36bc('0xa5')])?util[_0x36bc('0xb0')](_0x36bc('0xb1'),_0x3b47bb['name']):_0x3b47bb[_0x36bc('0xa5')],'paused':_0x3b47bb['voicePause']||![],'penalty':_0x3b47bb[_0x36bc('0xac')]},{'transaction':_0x78954b});});}else{return;}})['then'](function(){for(var _0x27e88f=0x0;_0x27e88f<_0x207d4c[_0x36bc('0x4d')];_0x27e88f++){var _0x4f7ac2=_0x207d4c[_0x27e88f][_0x36bc('0x123')](_0x36bc('0xa2'));var _0x5560a9=_0x4f7ac2+'QueueId';socket['emit'](_0x36bc('0x2e')+_0x4f7ac2+'Queue:save',{'UserId':_0x3b47bb['id'],['queueField']:_0x207d4c[_0x27e88f]['id']});}});});})[_0x36bc('0x15')](function(){db['TeamVoicePrefix'][_0x36bc('0x9b')]({'where':{'teamId':_0x5b613b['id']}})['then'](function(_0x11618a){if(_0x11618a){db['UserVoicePrefix']['create']({'UserId':_0x12b6d6[_0x36bc('0x53')]['id'],'VoicePrefixId':_0x11618a[_0x36bc('0x124')]});}});});}});}})['then'](respondWithStatusCode(_0x4c0ac7,null))['catch'](handleError(_0x4c0ac7,null));};exports[_0x36bc('0x125')]=function(_0x4600c5,_0x3c9154){return db[_0x36bc('0x3c')]['findOne']({'where':{'id':_0x4600c5[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x3c9154,null))[_0x36bc('0x15')](function(_0x1245f6){if(_0x1245f6){var _0xe37581=_0x1245f6[_0x36bc('0x2a')]({'plain':!![]});var _0x5c275d=_0x4600c5[_0x36bc('0x44')][_0x36bc('0x62')];return _0x1245f6['removeTeams'](_0x5c275d)[_0x36bc('0x15')](function(){for(var _0x35a621=0x0;_0x35a621<_0x5c275d[_0x36bc('0x4d')];_0x35a621++){var _0x20cb8f=[];var _0x516144={};db[_0x36bc('0x115')][_0x36bc('0x9b')]({'where':{'id':_0x5c275d[_0x35a621]}})['then'](function(_0x400373){_0x516144=_0x400373['dataValues'];_0x20cb8f[_0x36bc('0x4e')](_0x400373[_0x36bc('0xfc')]()[_0x36bc('0x15')](function(_0x47820d){for(var _0x37eee0=0x0;_0x37eee0<_0x47820d['length'];_0x37eee0++){_0x47820d[_0x37eee0][_0x36bc('0x116')]('channel',_0x36bc('0x117'));}return _0x47820d;}));_0x20cb8f[_0x36bc('0x4e')](_0x400373[_0x36bc('0x118')]()[_0x36bc('0x15')](function(_0xb6599f){for(var _0x63d5c0=0x0;_0x63d5c0<_0xb6599f[_0x36bc('0x4d')];_0x63d5c0++){_0xb6599f[_0x63d5c0][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x119'));}return _0xb6599f;}));_0x20cb8f[_0x36bc('0x4e')](_0x400373[_0x36bc('0x126')]()[_0x36bc('0x15')](function(_0x48a76e){for(var _0x4b015a=0x0;_0x4b015a<_0x48a76e[_0x36bc('0x4d')];_0x4b015a++){_0x48a76e[_0x4b015a]['setDataValue'](_0x36bc('0xa2'),_0x36bc('0x127'));}return _0x48a76e;}));_0x20cb8f[_0x36bc('0x4e')](_0x400373[_0x36bc('0x11a')]()[_0x36bc('0x15')](function(_0x1d7058){for(var _0x26ea30=0x0;_0x26ea30<_0x1d7058[_0x36bc('0x4d')];_0x26ea30++){_0x1d7058[_0x26ea30][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x11b'));}return _0x1d7058;}));_0x20cb8f[_0x36bc('0x4e')](_0x400373['getWhatsappQueues']()['then'](function(_0x14a28a){for(var _0x35d143=0x0;_0x35d143<_0x14a28a[_0x36bc('0x4d')];_0x35d143++){_0x14a28a[_0x35d143][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x11c'));}return _0x14a28a;}));_0x20cb8f[_0x36bc('0x4e')](_0x400373['getFaxQueues']()[_0x36bc('0x15')](function(_0x56c196){for(var _0x4b5127=0x0;_0x4b5127<_0x56c196[_0x36bc('0x4d')];_0x4b5127++){_0x56c196[_0x4b5127][_0x36bc('0x116')](_0x36bc('0xa2'),'Fax');}return _0x56c196;}));_0x20cb8f['push'](_0x400373[_0x36bc('0x11f')]()[_0x36bc('0x15')](function(_0x2a9d0f){for(var _0x4cf5a3=0x0;_0x4cf5a3<_0x2a9d0f['length'];_0x4cf5a3++){_0x2a9d0f[_0x4cf5a3][_0x36bc('0x116')](_0x36bc('0xa2'),_0x36bc('0x120'));}return _0x2a9d0f;}));return BPromise['all'](_0x20cb8f);})['then'](function(_0x2eb247){var _0x4f0519=_['flatten'](_0x2eb247);_0x20cb8f=[];return db[_0x36bc('0x69')][_0x36bc('0x122')](function(_0x2614ce){for(var _0x448a00=0x0;_0x448a00<_0x4f0519['length'];_0x448a00++){_0x20cb8f[_0x36bc('0x4e')](_0x4f0519[_0x448a00][_0x36bc('0x128')](_0xe37581['id']),{'transaction':_0x2614ce});}return BPromise[_0x36bc('0x8d')](_0x20cb8f)[_0x36bc('0x15')](function(){if(_0xe37581[_0x36bc('0xa3')]){return BPromise[_0x36bc('0xb3')](_['filter'](_0x4f0519,function(_0x1c6b9b){return _0x1c6b9b['getDataValue'](_0x36bc('0xa2'))===_0x36bc('0x117');}),function(_0x4ade46){return db['UserVoiceQueueRt'][_0x36bc('0x29')]({'where':{'VoiceQueueId':_0x4ade46['id'],'UserId':_0xe37581['id']},'transaction':_0x2614ce});});}else{return;}})[_0x36bc('0x15')](function(){db['TeamVoicePrefix'][_0x36bc('0x9b')]({'where':{'teamId':_0x516144['id']}})[_0x36bc('0x15')](function(_0x353c5d){if(_0x353c5d){return db[_0x36bc('0x129')]['destroy']({'where':{'UserId':_0xe37581['id'],'VoicePrefixId':_0x353c5d[_0x36bc('0x50')][_0x36bc('0x124')]}});}});})[_0x36bc('0x15')](function(){for(var _0x44763b=0x0;_0x44763b<_0x4f0519[_0x36bc('0x4d')];_0x44763b++){var _0x1376eb=_0x4f0519[_0x44763b][_0x36bc('0x123')]('channel');var _0x54c2b0=_0x1376eb+'QueueId';socket[_0x36bc('0xb8')](_0x36bc('0x2e')+_0x1376eb+_0x36bc('0xb9'),{'UserId':_0xe37581['id'],['queueField']:_0x4f0519[_0x44763b]['id']});}});});});}});}})[_0x36bc('0x15')](respondWithStatusCode(_0x3c9154,null))[_0x36bc('0x1e')](handleError(_0x3c9154,null));};exports[_0x36bc('0x12a')]=function(_0x1b07a5,_0x5ddfaa){var _0x2fc1c1={};var _0x101fbd={};var _0x3928fd;var _0x28ac61;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0x1b07a5[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x5ddfaa,null))[_0x36bc('0x15')](function(_0x5a3a27){if(_0x5a3a27){_0x3928fd=_0x5a3a27;_0x101fbd[_0x36bc('0x58')]=_['keys'](db[_0x36bc('0xda')][_0x36bc('0x3d')]);_0x101fbd[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0x1b07a5[_0x36bc('0x44')]);_0x101fbd['filters']=_[_0x36bc('0x57')](_0x101fbd[_0x36bc('0x58')],_0x101fbd[_0x36bc('0x44')]);_0x2fc1c1['attributes']=_[_0x36bc('0x57')](_0x101fbd['model'],qs[_0x36bc('0xd5')](_0x1b07a5[_0x36bc('0x44')][_0x36bc('0xd5')]));_0x2fc1c1[_0x36bc('0x49')]=_0x2fc1c1[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x2fc1c1[_0x36bc('0x49')]:_0x101fbd[_0x36bc('0x58')];_0x2fc1c1[_0x36bc('0xd6')]=qs['sort'](_0x1b07a5[_0x36bc('0x44')]['sort']);_0x2fc1c1['where']=qs[_0x36bc('0x56')](_['pick'](_0x1b07a5[_0x36bc('0x44')],_0x101fbd[_0x36bc('0x56')]));if(_0x1b07a5['query'][_0x36bc('0x32')]){_0x2fc1c1[_0x36bc('0x43')]=_['merge'](_0x2fc1c1[_0x36bc('0x43')],{'$or':_[_0x36bc('0x34')](_0x2fc1c1[_0x36bc('0x49')],function(_0xdfdc4e){var _0x2a3b2c={};_0x2a3b2c[_0xdfdc4e]={'$like':'%'+_0x1b07a5[_0x36bc('0x44')][_0x36bc('0x32')]+'%'};return _0x2a3b2c;})});}_0x2fc1c1=_[_0x36bc('0x5a')]({},_0x2fc1c1,_0x1b07a5['options']);return _0x3928fd[_0x36bc('0x12a')](_0x2fc1c1);}})[_0x36bc('0x15')](function(_0x428989){if(_0x428989){_0x28ac61=_0x428989[_0x36bc('0x4d')];if(!_0x1b07a5[_0x36bc('0x44')][_0x36bc('0xd9')]('nolimit')){_0x2fc1c1[_0x36bc('0x22')]=qs[_0x36bc('0x22')](_0x1b07a5[_0x36bc('0x44')][_0x36bc('0x22')]);_0x2fc1c1['offset']=qs[_0x36bc('0x21')](_0x1b07a5[_0x36bc('0x44')][_0x36bc('0x21')]);}return _0x3928fd[_0x36bc('0x12a')](_0x2fc1c1);}})[_0x36bc('0x15')](function(_0x43c105){if(_0x43c105){return _0x43c105?{'count':_0x28ac61,'rows':_0x43c105}:null;}})[_0x36bc('0x15')](respondWithResult(_0x5ddfaa,null))[_0x36bc('0x1e')](handleError(_0x5ddfaa,null));};exports['getAgents']=function(_0xb8ab7e,_0x4d5cc7){var _0x1b3a2a={};var _0x4a4c18={};var _0x2c9c73;return db[_0x36bc('0x3c')][_0x36bc('0x9b')]({'where':{'id':_0xb8ab7e[_0x36bc('0x53')]['id']}})[_0x36bc('0x15')](handleEntityNotFound(_0x4d5cc7,null))[_0x36bc('0x15')](function(_0x48d47a){if(_0x48d47a){_0x2c9c73=_0x48d47a;_0x4a4c18[_0x36bc('0x58')]=_[_0x36bc('0x55')](db['User']['rawAttributes']);_0x4a4c18[_0x36bc('0x44')]=_[_0x36bc('0x55')](_0xb8ab7e[_0x36bc('0x44')]);_0x4a4c18[_0x36bc('0x56')]=_['intersection'](_0x4a4c18['model'],_0x4a4c18[_0x36bc('0x44')]);_0x1b3a2a[_0x36bc('0x49')]=_[_0x36bc('0x57')](_0x4a4c18[_0x36bc('0x58')],qs['fields'](_0xb8ab7e['query'][_0x36bc('0xd5')]));_0x1b3a2a['attributes']=_0x1b3a2a[_0x36bc('0x49')][_0x36bc('0x4d')]?_0x1b3a2a[_0x36bc('0x49')]:_0x4a4c18[_0x36bc('0x58')];_0x1b3a2a[_0x36bc('0xd6')]=qs['sort'](_0xb8ab7e[_0x36bc('0x44')][_0x36bc('0xd7')]);_0x1b3a2a[_0x36bc('0x43')]=qs[_0x36bc('0x56')](_['pick'](_0xb8ab7e['query'],_0x4a4c18['filters']));if(_0xb8ab7e[_0x36bc('0x44')][_0x36bc('0x32')]){_0x1b3a2a['where']=_[_0x36bc('0x5a')](_0x1b3a2a['where'],{'$or':_['map'](_0x1b3a2a[_0x36bc('0x49')],function(_0x3902c8){var _0x2132b0={};_0x2132b0[_0x3902c8]={'$like':'%'+_0xb8ab7e[_0x36bc('0x44')]['filter']+'%'};return _0x2132b0;})});}_0x1b3a2a['model']=db['User'];_0x1b3a2a['as']=_0x36bc('0x2f');_0x1b3a2a=_[_0x36bc('0x5a')]({},_0x1b3a2a,_0xb8ab7e[_0x36bc('0x5b')]);return _0x2c9c73[_0x36bc('0xfc')]({'include':[_0x1b3a2a]});}})[_0x36bc('0x15')](function(_0x48c142){if(_0x48c142){var _0x5d9f91={},_0x2e1064=[];for(var _0x1996de=0x0;_0x1996de<_0x48c142[_0x36bc('0x4d')];_0x1996de+=0x1){for(var _0x351d43=0x0,_0x40ec83;_0x351d43<_0x48c142[_0x1996de]['Agents'][_0x36bc('0x4d')];_0x351d43+=0x1){_0x40ec83=_0x48c142[_0x1996de][_0x36bc('0x2f')][_0x351d43][_0x36bc('0x2a')]({'plain':!![]});_0x5d9f91[_0x40ec83['id']]=_0x40ec83;}}_0x5d9f91=_[_0x36bc('0x12b')](_0x5d9f91);for(var _0x1e90ba=qs['offset'](_0xb8ab7e[_0x36bc('0x44')][_0x36bc('0x21')]);_0x1e90ba<_0x5d9f91[_0x36bc('0x4d')]&&_0x2e1064[_0x36bc('0x4d')]=_0x5b30b5){_0x460c1d=_0x5b30b5;_0x56d99a=0xc8;}else{_0x56d99a=0xce;}_0x2fd358['status'](_0x56d99a);return _0x2fd358['set'](_0x7b6a('0x23'),_0x21b270+'-'+_0x460c1d+'/'+_0x5b30b5)['json'](_0x1a1abf);}return null;};}function saveUpdates(_0x119430){return function(_0x41e3a1){if(_0x41e3a1){return _0x41e3a1[_0x7b6a('0x24')](_0x119430)[_0x7b6a('0x14')](function(_0x5bfc68){return _0x5bfc68;});}return null;};}function removeEntity(_0x1656ef){return function(_0x1b2908){if(_0x1b2908){return _0x1b2908[_0x7b6a('0x25')]()[_0x7b6a('0x14')](function(){var _0x43a796=_0x1b2908[_0x7b6a('0x26')]({'plain':!![]});if(_0x43a796[_0x7b6a('0x27')]===_0x7b6a('0x28'))return;var _0x3ea212=[{'name':'Users','value':_0x7b6a('0x29'),'ignore':!![]},{'name':_0x7b6a('0x2a'),'value':_0x7b6a('0x2b'),'ignore':![]},{'name':_0x7b6a('0x2c'),'value':_0x7b6a('0x2d'),'ignore':![]}];var _0x5c348f=_(_0x3ea212)[_0x7b6a('0x2e')](_0x7b6a('0x2f'))[_0x7b6a('0x30')]('value')[_0x7b6a('0x31')]();if(_[_0x7b6a('0x32')](_0x5c348f,_0x43a796[_0x7b6a('0x27')])){return;}var _0x58a75e=_[_0x7b6a('0x33')](_0x3ea212,['value',_0x43a796[_0x7b6a('0x27')]])['name'];return db[_0x7b6a('0x34')]['destroy']({'where':{'type':_0x58a75e,'resourceId':_0x43a796['id']}})[_0x7b6a('0x14')](function(){return _0x1b2908;});})[_0x7b6a('0x14')](function(){_0x1656ef[_0x7b6a('0x1e')](0xcc)[_0x7b6a('0x35')]();});}};}function handleEntityNotFound(_0x144481){return function(_0x39f92f){if(!_0x39f92f){_0x144481[_0x7b6a('0x1d')](0x194);}return _0x39f92f;};}function handleError(_0x32ca48,_0x4f6ef2){_0x4f6ef2=_0x4f6ef2||0x1f4;return function(_0xeeec41){logger[_0x7b6a('0x1b')](_0xeeec41[_0x7b6a('0x36')]);if(_0xeeec41['name']){delete _0xeeec41[_0x7b6a('0x37')];}_0x32ca48[_0x7b6a('0x1e')](_0x4f6ef2)[_0x7b6a('0x38')](_0xeeec41);};}exports[_0x7b6a('0x39')]=function(_0x2af847,_0x1b7a19){var _0x21e2f8={},_0x3ae38f={'count':0x0,'rows':[]};var _0x13eee8=_(db[_0x7b6a('0x3a')][_0x7b6a('0x3b')])[_0x7b6a('0x30')](function(_0xfadf42){return{'name':_0xfadf42[_0x7b6a('0x3c')],'type':_0xfadf42[_0x7b6a('0x3d')][_0x7b6a('0x3e')]};})[_0x7b6a('0x2e')](function(_0x3eb3da){return!_[_0x7b6a('0x32')]([_0x7b6a('0x3f'),_0x7b6a('0x40')],_0x3eb3da[_0x7b6a('0x37')]);})['value']();_0x21e2f8=qs[_0x7b6a('0x41')](_0x13eee8,_0x2af847);var _0x530c05={'where':_0x21e2f8['where']};return db[_0x7b6a('0x3a')][_0x7b6a('0x22')](_0x530c05)[_0x7b6a('0x14')](function(_0xfdd3b2){_0x3ae38f[_0x7b6a('0x22')]=_0xfdd3b2;if(_0x2af847['query'][_0x7b6a('0x42')]){_0x21e2f8[_0x7b6a('0x43')]=[{'all':!![]}];}if(_0x2af847[_0x7b6a('0x44')]['userSetting']===_0x7b6a('0x45')){_0x21e2f8[_0x7b6a('0x43')]=[{'model':db[_0x7b6a('0x46')],'as':_0x7b6a('0x47')}];}if(!_[_0x7b6a('0x32')](_0x21e2f8[_0x7b6a('0x48')],'id')){_0x21e2f8[_0x7b6a('0x48')][_0x7b6a('0x49')]('id');}return db['User'][_0x7b6a('0x4a')](_0x21e2f8);})[_0x7b6a('0x14')](function(_0x3e4511){_0x3ae38f[_0x7b6a('0x4b')]=_0x3e4511;if(_0x2af847['query'][_0x7b6a('0x4c')]===_0x7b6a('0x45')){var _0x3622c2=[];for(var _0x392f51=0x0;_0x392f51<_0x3ae38f[_0x7b6a('0x4b')][_0x7b6a('0x4d')];_0x392f51++){_0x3622c2[_0x7b6a('0x49')](get_open_tabs('chat',_0x3ae38f[_0x7b6a('0x4b')][_0x392f51]['dataValues']));_0x3622c2['push'](get_open_tabs(_0x7b6a('0x4e'),_0x3ae38f[_0x7b6a('0x4b')][_0x392f51][_0x7b6a('0x4f')]));_0x3622c2[_0x7b6a('0x49')](get_open_tabs('fax',_0x3ae38f[_0x7b6a('0x4b')][_0x392f51][_0x7b6a('0x4f')]));_0x3622c2['push'](get_open_tabs(_0x7b6a('0x50'),_0x3ae38f[_0x7b6a('0x4b')][_0x392f51][_0x7b6a('0x4f')]));_0x3622c2[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x51'),_0x3ae38f[_0x7b6a('0x4b')][_0x392f51][_0x7b6a('0x4f')]));_0x3622c2['push'](get_open_tabs(_0x7b6a('0x52'),_0x3ae38f[_0x7b6a('0x4b')][_0x392f51][_0x7b6a('0x4f')]));}return BPromise[_0x7b6a('0x53')](_0x3622c2)[_0x7b6a('0x14')](function(){return _0x3ae38f;});}else{return _0x3ae38f;}})['then'](respondWithFilteredResult(_0x1b7a19,_0x21e2f8))[_0x7b6a('0x54')](handleError(_0x1b7a19,null));};exports['show']=function(_0x149eb4,_0x744ab4){var _0x50874d={'raw':![],'where':{'id':_0x149eb4[_0x7b6a('0x55')]['id']}},_0x53c7a8={};_0x53c7a8[_0x7b6a('0x56')]=_[_0x7b6a('0x57')](_[_0x7b6a('0x58')](db[_0x7b6a('0x3a')][_0x7b6a('0x3b')]),[_0x7b6a('0x3f'),_0x7b6a('0x40')]);_0x53c7a8['query']=_[_0x7b6a('0x58')](_0x149eb4[_0x7b6a('0x44')]);_0x53c7a8[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x53c7a8[_0x7b6a('0x56')],_0x53c7a8[_0x7b6a('0x44')]);_0x50874d[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x53c7a8['model'],qs['fields'](_0x149eb4[_0x7b6a('0x44')]['fields']));_0x50874d[_0x7b6a('0x48')]=_0x50874d[_0x7b6a('0x48')]['length']?_0x50874d[_0x7b6a('0x48')]:_0x53c7a8[_0x7b6a('0x56')];if(_0x149eb4[_0x7b6a('0x44')][_0x7b6a('0x42')]){_0x50874d['include']=[{'all':!![]}];}if(_0x149eb4['query']['userSetting']==='true'){_0x50874d[_0x7b6a('0x43')]=[{'model':db[_0x7b6a('0x46')],'as':_0x7b6a('0x47')}];}_0x50874d=_['merge']({},_0x50874d,_0x149eb4[_0x7b6a('0x5b')]);if(!_[_0x7b6a('0x32')](_0x50874d[_0x7b6a('0x48')],'id')){_0x50874d['attributes'][_0x7b6a('0x49')]('id');}return db[_0x7b6a('0x3a')]['find'](_0x50874d)[_0x7b6a('0x14')](handleEntityNotFound(_0x744ab4,null))[_0x7b6a('0x14')](function(_0x1cf31d){var _0x57de3a=[];values=_0x1cf31d;if(_0x149eb4[_0x7b6a('0x44')]['openTabs']===_0x7b6a('0x45')){_0x57de3a['push'](get_open_tabs(_0x7b6a('0x5c'),_0x1cf31d[_0x7b6a('0x4f')]));_0x57de3a[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x4e'),_0x1cf31d[_0x7b6a('0x4f')]));_0x57de3a[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x51'),_0x1cf31d[_0x7b6a('0x4f')]));_0x57de3a[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x52'),_0x1cf31d['dataValues']));_0x57de3a[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x5d'),_0x1cf31d[_0x7b6a('0x4f')]));_0x57de3a['push'](get_open_tabs('mail',_0x1cf31d['dataValues']));return BPromise[_0x7b6a('0x53')](_0x57de3a);}else{return values;}})[_0x7b6a('0x14')](function(){return values;})[_0x7b6a('0x14')](respondWithResult(_0x744ab4,null))[_0x7b6a('0x54')](handleError(_0x744ab4,null));};exports['update']=function(_0x94616e,_0x44010f){if(_0x94616e['body']['id']){delete _0x94616e[_0x7b6a('0x5e')]['id'];}delete _0x94616e[_0x7b6a('0x5e')]['role'];return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x94616e['params']['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x44010f,null))['then'](saveUpdates(_0x94616e[_0x7b6a('0x5e')],null))[_0x7b6a('0x14')](respondWithResult(_0x44010f,null))[_0x7b6a('0x54')](handleError(_0x44010f,null));};exports[_0x7b6a('0x5f')]=function(_0x2fbd05,_0x9c52ad){return db[_0x7b6a('0x3a')][_0x7b6a('0x5f')]()['then'](respondWithResult(_0x9c52ad,null))[_0x7b6a('0x54')](handleError(_0x9c52ad,null));};exports[_0x7b6a('0x60')]=function(_0xa618f1,_0x1ec835){return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0xa618f1[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x1ec835,null))[_0x7b6a('0x14')](function(_0x5e4cf9){if(_0x5e4cf9){return _0x5e4cf9['addContacts'](_0xa618f1[_0x7b6a('0x5e')]['ids'],_[_0x7b6a('0x61')](_0xa618f1[_0x7b6a('0x5e')],[_0x7b6a('0x62'),'id'])||{});}})[_0x7b6a('0x14')](respondWithResult(_0x1ec835,null))[_0x7b6a('0x54')](handleError(_0x1ec835,null));};function validateUser(_0x8de304){return new BPromise(function(_0x417f35,_0x3a5272){if(_0x8de304[_0x7b6a('0x63')])return _0x417f35(_0x8de304);return db[_0x7b6a('0x64')][_0x7b6a('0x65')](0x1)[_0x7b6a('0x14')](function(_0x2bca1c){if(_0x2bca1c[_0x7b6a('0x66')])authService[_0x7b6a('0x67')](_0x8de304[_0x7b6a('0x3f')]);db[_0x7b6a('0x3a')]['max'](_0x7b6a('0x63'))[_0x7b6a('0x14')](function(_0x4fc28f){if(_[_0x7b6a('0x68')](_0x4fc28f)){_0x8de304['internal']=_0x2bca1c[_0x7b6a('0x69')]||0x1;return;}if(_['isNil'](_0x2bca1c[_0x7b6a('0x69')])||_0x2bca1c[_0x7b6a('0x69')]===_0x4fc28f){_0x8de304[_0x7b6a('0x63')]=_0x4fc28f+0x1;return;}if(_0x2bca1c[_0x7b6a('0x69')]>_0x4fc28f){_0x8de304[_0x7b6a('0x63')]=_0x2bca1c[_0x7b6a('0x69')];return;}return db['sequelize'][_0x7b6a('0x44')](_0x7b6a('0x6a'),{'type':db[_0x7b6a('0x6b')][_0x7b6a('0x6c')][_0x7b6a('0x6d')]})[_0x7b6a('0x14')](function(_0xa95122){if(_0xa95122&&_0xa95122[_0x7b6a('0x4d')]){for(var _0x218ad7=0x0,_0x3f31b4=_0xa95122[_0x7b6a('0x4d')];_0x218ad7<_0x3f31b4&&_[_0x7b6a('0x68')](_0x8de304[_0x7b6a('0x63')]);_0x218ad7++){if(_0x2bca1c[_0x7b6a('0x69')]<=_0xa95122[_0x218ad7][_0x7b6a('0x6e')]){_0x8de304[_0x7b6a('0x63')]=_0xa95122[_0x218ad7][_0x7b6a('0x6e')];}else if(_0x2bca1c[_0x7b6a('0x69')]>_0xa95122[_0x218ad7][_0x7b6a('0x6e')]&&_0x2bca1c[_0x7b6a('0x69')]<=_0xa95122[_0x218ad7]['to']){_0x8de304[_0x7b6a('0x63')]=_0x2bca1c['min_internal'];}}}if(_[_0x7b6a('0x68')](_0x8de304[_0x7b6a('0x63')])){_0x8de304[_0x7b6a('0x63')]=_0x4fc28f+0x1;}return _0x417f35(_0x8de304);});});})[_0x7b6a('0x54')](function(_0x91e272){_0x3a5272(_0x91e272);});});}function updateUser(_0x420a6b){return new BPromise(function(_0x2ff976,_0x5104c5){try{if(_0x420a6b[_0x7b6a('0x6f')]){_0x420a6b['mailbox']=_0x420a6b[_0x7b6a('0x63')];_0x420a6b[_0x7b6a('0x70')]={'mailbox':_0x420a6b[_0x7b6a('0x63')],'password':_0x420a6b['password'],'fullname':_0x420a6b[_0x7b6a('0x71')],'email':_0x420a6b[_0x7b6a('0x72')]};}if(_0x420a6b['role']==='agent'){if(!_0x420a6b[_0x7b6a('0x73')])_0x420a6b[_0x7b6a('0x73')]=[_0x7b6a('0x74'),'102',_0x7b6a('0x75'),_0x7b6a('0x76'),_0x7b6a('0x77'),_0x7b6a('0x78'),_0x7b6a('0x79'),'106',_0x7b6a('0x7a'),_0x7b6a('0x7b'),_0x7b6a('0x7c'),'100',_0x7b6a('0x7d'),_0x7b6a('0x7e'),_0x7b6a('0x7f')];}_0x2ff976(_0x420a6b);}catch(_0x46189e){_0x5104c5(_0x46189e);}});}exports['create']=function(_0x596fe5,_0x36a515){if(_0x596fe5[_0x7b6a('0x29')][_0x7b6a('0x27')]===_0x7b6a('0x2b'))throw new Error('Unauthorized');if(_0x596fe5[_0x7b6a('0x5e')]['role']===_0x7b6a('0x29')&&_0x596fe5[_0x7b6a('0x29')][_0x7b6a('0x27')]!==_0x7b6a('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x596fe5[_0x7b6a('0x5e')][_0x7b6a('0x27')]===_0x7b6a('0x28')&&_0x596fe5[_0x7b6a('0x29')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x7b6a('0x80')]([_0x596fe5[_0x7b6a('0x5e')]])[_0x7b6a('0x14')](function(){return validateUser(_0x596fe5[_0x7b6a('0x5e')]);})[_0x7b6a('0x14')](function(_0x2f1443){return updateUser(_0x2f1443)['then'](function(_0x12dafd){if(_0x12dafd['role']===_0x7b6a('0x28')){_0x12dafd[_0x7b6a('0x81')]=_0x596fe5[_0x7b6a('0x29')]['settingsEnabled'];delete _0x12dafd['userProfileId'];}return _0x12dafd;});})[_0x7b6a('0x14')](function(_0x1538cd){return db[_0x7b6a('0x3a')][_0x7b6a('0x82')](_0x1538cd,{'include':[{'model':db[_0x7b6a('0x70')],'as':'VoiceMail'}]});})[_0x7b6a('0x14')](function(_0x4d82df){if(_0x596fe5[_0x7b6a('0x5e')][_0x7b6a('0x27')]==='user')return _0x4d82df;if(_0x596fe5['user'][_0x7b6a('0x27')]!==_0x7b6a('0x29'))return _0x4d82df;return db[_0x7b6a('0x83')]['find']({'where':{'name':_0x4d82df[_0x7b6a('0x27')]===_0x7b6a('0x2b')?_0x7b6a('0x2a'):_0x7b6a('0x2c'),'userProfileId':_0x596fe5[_0x7b6a('0x29')]['userProfileId']},'raw':!![]})['then'](function(_0xafffed){if(!_0xafffed||_0xafffed[_0x7b6a('0x84')]!=0x0)return _0x4d82df;return db[_0x7b6a('0x34')][_0x7b6a('0x82')]({'name':_0x4d82df[_0x7b6a('0x37')],'resourceId':_0x4d82df['id'],'type':_0xafffed[_0x7b6a('0x37')],'sectionId':_0xafffed['id']},{})[_0x7b6a('0x14')](function(){return _0x4d82df;});})[_0x7b6a('0x54')](function(_0x3135a6){logger['error'](_0x7b6a('0x85'),_0x3135a6);throw _0x3135a6;});})[_0x7b6a('0x14')](respondWithResult(_0x36a515,0xc9))[_0x7b6a('0x54')](handleError(_0x36a515,null));};exports[_0x7b6a('0x86')]=function(_0x666abd,_0x5e9c56){var _0x10db50=_0x666abd[_0x7b6a('0x5e')];var _0x5ae98d=[];if(_0x666abd[_0x7b6a('0x29')]['role']===_0x7b6a('0x2b'))throw new Error('Unauthorized');if(_[_0x7b6a('0x87')](_0x10db50,[_0x7b6a('0x27'),_0x7b6a('0x29')])&&_0x666abd[_0x7b6a('0x29')][_0x7b6a('0x27')]!==_0x7b6a('0x28')){throw new Error(_0x7b6a('0x88'));}if(_[_0x7b6a('0x87')](_0x10db50,[_0x7b6a('0x27'),_0x7b6a('0x28')])&&_0x666abd['user'][_0x7b6a('0x27')]!=='admin'){throw new Error(_0x7b6a('0x89'));}return licenseUtil[_0x7b6a('0x80')](_0x10db50)[_0x7b6a('0x14')](function(){return validateUser(_0x10db50[0x0]);})[_0x7b6a('0x14')](function(){for(var _0x1fabc6=0x1;_0x1fabc6<_0x10db50[_0x7b6a('0x4d')];_0x1fabc6++){var _0x20c92f=_0x10db50[_0x1fabc6-0x1][_0x7b6a('0x63')];if(!_0x10db50[_0x1fabc6][_0x7b6a('0x63')])_0x10db50[_0x1fabc6][_0x7b6a('0x63')]=_0x20c92f+0x1;_0x5ae98d['push'](validateUser(_0x10db50[_0x1fabc6]));}return BPromise[_0x7b6a('0x53')](_0x5ae98d);})['then'](function(){_0x5ae98d=[];for(var _0x4c8dec=0x0;_0x4c8dec<_0x10db50['length'];_0x4c8dec++){_0x5ae98d[_0x7b6a('0x49')](updateUser(_0x10db50[_0x4c8dec]));}return BPromise[_0x7b6a('0x53')](_0x5ae98d);})['then'](function(){return BPromise['each'](_0x10db50,function(_0x113df1){return db[_0x7b6a('0x3a')][_0x7b6a('0x82')](_0x113df1,{'include':[{'model':db['VoiceMail'],'as':_0x7b6a('0x70')}]})[_0x7b6a('0x14')](function(_0x5bdfb2){_0x113df1['id']=_0x5bdfb2['id'];return _0x113df1;});});})['then'](function(_0x4a238a){if(_0x666abd[_0x7b6a('0x5e')][_0x7b6a('0x27')]==='user')return _0x4a238a;if(_0x666abd[_0x7b6a('0x29')][_0x7b6a('0x27')]!==_0x7b6a('0x29'))return _0x4a238a;var _0x24210e=_[_0x7b6a('0x87')](_0x4a238a,function(_0x330d2c){return _0x330d2c[_0x7b6a('0x27')]==='agent'||_0x330d2c[_0x7b6a('0x27')]===_0x7b6a('0x2d');});if(!_0x24210e)return _0x4a238a;return db[_0x7b6a('0x83')][_0x7b6a('0x4a')]({'where':{'name':{'$or':['Agents',_0x7b6a('0x2c')]},'userProfileId':_0x666abd[_0x7b6a('0x29')][_0x7b6a('0x8a')]},'raw':!![]})[_0x7b6a('0x14')](function(_0x34e582){if(_[_0x7b6a('0x8b')](_0x34e582)||!_[_0x7b6a('0x87')](_0x34e582,[_0x7b6a('0x84'),0x0]))return _0x4a238a;_0x5ae98d=[];var _0x42c016=_(_0x34e582)[_0x7b6a('0x30')](function(_0x338a49){if(_0x338a49[_0x7b6a('0x84')]===0x1)return;return _0x338a49[_0x7b6a('0x37')]===_0x7b6a('0x2a')?_0x7b6a('0x2b'):'telephone';})['compact']()['value']();for(var _0x3432d6=0x0;_0x3432d6<_0x4a238a['length'];_0x3432d6++){if(!_[_0x7b6a('0x32')](_0x42c016,_0x4a238a[_0x3432d6][_0x7b6a('0x27')]))return;var _0x327874=_0x4a238a[_0x3432d6]['role']===_0x7b6a('0x2b')?_0x7b6a('0x2a'):_0x7b6a('0x2c');_0x5ae98d[_0x7b6a('0x49')](db[_0x7b6a('0x34')]['create']({'name':_0x4a238a[_0x3432d6]['name'],'resourceId':_0x4a238a[_0x3432d6]['id'],'type':_0x327874,'sectionId':_['find'](_0x34e582,[_0x7b6a('0x37'),_0x327874])['id']},{}));}return BPromise['all'](_0x5ae98d);});})[_0x7b6a('0x14')](respondWithResult(_0x5e9c56,0xc9))[_0x7b6a('0x54')](handleError(_0x5e9c56,null));};exports[_0x7b6a('0x8c')]=function(_0x28274a,_0x2249b4){if(_0x28274a[_0x7b6a('0x5e')]['id']){delete _0x28274a[_0x7b6a('0x5e')]['id'];}return db['User'][_0x7b6a('0x33')]({'where':{'id':_0x28274a['params']['id']}})['then'](function(_0x32dba3){if(!_0x32dba3)return null;if(_0x32dba3['id']===_0x28274a[_0x7b6a('0x29')]['id']){if(!_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8d')]||!_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')]){throw new db[(_0x7b6a('0x8f'))][(_0x7b6a('0x90'))](_0x7b6a('0x91'));}if(!_0x32dba3[_0x7b6a('0x92')](_0x28274a[_0x7b6a('0x5e')]['oldPassword'])){throw new db[(_0x7b6a('0x8f'))]['ValidationError'](_0x7b6a('0x93'));}if(_0x28274a['body'][_0x7b6a('0x8d')]===_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')]){throw new db[(_0x7b6a('0x8f'))][(_0x7b6a('0x90'))](_0x7b6a('0x94'));}}else if(_0x28274a[_0x7b6a('0x29')]['role']===_0x7b6a('0x28')){if(!_0x28274a['body']['newPassword']){throw new db[(_0x7b6a('0x8f'))][(_0x7b6a('0x90'))](_0x7b6a('0x95'));}}else if(_0x28274a[_0x7b6a('0x29')][_0x7b6a('0x27')]==='user'){if(!_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')]){throw new db[(_0x7b6a('0x8f'))]['ValidationError'](_0x7b6a('0x95'));}if(_0x32dba3[_0x7b6a('0x27')]!=='agent'){throw new db[(_0x7b6a('0x8f'))]['ValidationError'](_0x7b6a('0x96'));}}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0x32dba3;})['then'](handleEntityNotFound(_0x2249b4,null))[_0x7b6a('0x14')](function(_0x382edc){return db['Setting'][_0x7b6a('0x97')]({'attributes':['id',_0x7b6a('0x66'),_0x7b6a('0x98'),_0x7b6a('0x99')]})[_0x7b6a('0x14')](function(_0x16d8c0){if(_0x16d8c0[_0x7b6a('0x66')])authService[_0x7b6a('0x67')](_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')]);if(!_0x16d8c0[_0x7b6a('0x98')]||!_0x382edc['previousPasswords'])return _0x382edc;authService[_0x7b6a('0x9a')](_0x28274a[_0x7b6a('0x5e')]['newPassword'],_0x382edc[_0x7b6a('0x9b')],_0x16d8c0[_0x7b6a('0x99')]);return _0x382edc;})[_0x7b6a('0x14')](saveUpdates({'password':_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')],'passwordResetAt':_0x28274a[_0x7b6a('0x29')]['id']==_0x28274a[_0x7b6a('0x55')]['id']?moment():null,'previousPasswords':authService[_0x7b6a('0x9c')](_0x28274a[_0x7b6a('0x5e')][_0x7b6a('0x8e')],_0x382edc[_0x7b6a('0x9b')])},null));})[_0x7b6a('0x14')](respondWithResult(_0x2249b4,null))[_0x7b6a('0x54')](handleError(_0x2249b4,null));};exports['addQueues']=function(_0x38e97b,_0x46e720){var _0x5d56f5=_0x38e97b[_0x7b6a('0x5e')][_0x7b6a('0x9d')];return db['User'][_0x7b6a('0x33')]({'where':{'id':_0x38e97b[_0x7b6a('0x55')]['id']},'attributes':['id',_0x7b6a('0x37'),_0x7b6a('0x27'),_0x7b6a('0x9e'),_0x7b6a('0x9f'),_0x7b6a('0xa0'),'interface']})[_0x7b6a('0x14')](handleEntityNotFound(_0x46e720,null))[_0x7b6a('0x14')](function(_0x2bf9ee){if(_0x2bf9ee){if(!utils['isValidChannel'](_0x5d56f5)){throw new db[(_0x7b6a('0x8f'))][(_0x7b6a('0x90'))]('Unknown\x20channel');}return _0x2bf9ee[_0x7b6a('0xa1')+_[_0x7b6a('0xa2')](_0x5d56f5[_0x7b6a('0xa3')]())+'Queues'](_0x38e97b['body']['ids'],{'penalty':_0x38e97b['body'][_0x7b6a('0xa4')]||0x0})['spread'](function(_0x2e436d){for(var _0x200722=0x0;_0x200722<_0x38e97b['body'][_0x7b6a('0x62')][_0x7b6a('0x4d')];_0x200722+=0x1){var _0x420bcb={'UserId':Number(_0x38e97b[_0x7b6a('0x55')]['id'])};_0x420bcb[_[_0x7b6a('0xa2')](_0x5d56f5[_0x7b6a('0xa3')]())+_0x7b6a('0xa5')]=Number(_0x38e97b['body']['ids'][_0x200722]);socket['emit'](_0x7b6a('0x29')+_['capitalize'](_0x5d56f5[_0x7b6a('0xa3')]())+_0x7b6a('0xa6'),_0x420bcb);}return _0x2e436d;})[_0x7b6a('0x14')](function(){if(_0x5d56f5===_0x7b6a('0xa7')){return db[_0x7b6a('0xa8')][_0x7b6a('0x4a')]({'where':{'id':_0x38e97b[_0x7b6a('0x5e')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x7b6a('0x14')](function(_0x2d4065){var _0x1956ed=_0x2bf9ee[_0x7b6a('0x26')]({'plain':!![]});var _0xfc8d31=[];if(_0x5d56f5===_0x7b6a('0xa7')&&_0x1956ed['role']===_0x7b6a('0x2b')&&_0x1956ed[_0x7b6a('0x9e')]){for(var _0x13fa47=0x0;_0x13fa47<_0x2d4065[_0x7b6a('0x4d')];_0x13fa47+=0x1){_0xfc8d31[_0x7b6a('0x49')]({'membername':_0x1956ed[_0x7b6a('0x37')],'UserId':_0x1956ed['id'],'queue_name':_0x2d4065[_0x13fa47][_0x7b6a('0x37')],'VoiceQueueId':_0x2d4065[_0x13fa47]['id'],'interface':_[_0x7b6a('0x68')](_0x1956ed[_0x7b6a('0xa9')])?util['format']('SIP/%s',_0x1956ed[_0x7b6a('0x37')]):_0x1956ed['interface'],'paused':_0x1956ed[_0x7b6a('0xa0')]||![],'penalty':_0x38e97b['body'][_0x7b6a('0xa4')]||0x0});}return BPromise[_0x7b6a('0xaa')](_0xfc8d31,function(_0x39f220){return db[_0x7b6a('0xab')][_0x7b6a('0xac')](_0x39f220);});}return _0x2bf9ee;});}})[_0x7b6a('0x14')](respondWithStatusCode(_0x46e720,null))[_0x7b6a('0x54')](handleError(_0x46e720,null));};exports[_0x7b6a('0xad')]=function(_0x135290,_0x3a484){var _0xc9c6db,_0x44541d;return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x135290[_0x7b6a('0x55')]['id']},'attributes':['id',_0x7b6a('0x37'),'role']})[_0x7b6a('0x14')](handleEntityNotFound(_0x3a484,null))[_0x7b6a('0x14')](function(_0x2b5482){if(_0x2b5482){_0xc9c6db=_0x2b5482;if(!_0x135290['query'][_0x7b6a('0x9d')]||!utils['isValidChannel'](_0x135290['query'][_0x7b6a('0x9d')])){throw new db[(_0x7b6a('0x8f'))]['ValidationError'](_0x7b6a('0xae'));}return _0x2b5482['remove'+_[_0x7b6a('0xa2')](_0x135290[_0x7b6a('0x44')]['channel'][_0x7b6a('0xa3')]())+_0x7b6a('0xaf')](_0x135290[_0x7b6a('0x44')][_0x7b6a('0x62')]);}})[_0x7b6a('0x14')](function(_0x2bd8a8){if(_['isArray'](_0x135290['query'][_0x7b6a('0x62')])){for(var _0x205115=0x0;_0x205115<_0x135290[_0x7b6a('0x44')][_0x7b6a('0x62')][_0x7b6a('0x4d')];_0x205115+=0x1){_0x44541d={'UserId':Number(_0x135290[_0x7b6a('0x55')]['id'])};_0x44541d[_[_0x7b6a('0xa2')](_0x135290[_0x7b6a('0x44')][_0x7b6a('0x9d')][_0x7b6a('0xa3')]())+_0x7b6a('0xa5')]=Number(_0x135290[_0x7b6a('0x44')][_0x7b6a('0x62')][_0x205115]);socket[_0x7b6a('0xb0')](_0x7b6a('0x29')+_[_0x7b6a('0xa2')](_0x135290['query'][_0x7b6a('0x9d')][_0x7b6a('0xa3')]())+'Queue:remove',_0x44541d);}}else{_0x44541d={'UserId':Number(_0x135290[_0x7b6a('0x55')]['id'])};_0x44541d[_['capitalize'](_0x135290['query'][_0x7b6a('0x9d')][_0x7b6a('0xa3')]())+_0x7b6a('0xa5')]=Number(_0x135290[_0x7b6a('0x44')][_0x7b6a('0x62')]);socket['emit'](_0x7b6a('0x29')+_[_0x7b6a('0xa2')](_0x135290['query'][_0x7b6a('0x9d')]['toLowerCase']())+_0x7b6a('0xb1'),_0x44541d);}return _0x2bd8a8;})[_0x7b6a('0x14')](function(){if(_0x135290[_0x7b6a('0x44')][_0x7b6a('0x9d')]===_0x7b6a('0xa7')){return db[_0x7b6a('0xab')][_0x7b6a('0x25')]({'where':{'UserId':_0x135290[_0x7b6a('0x55')]['id'],'VoiceQueueId':_0x135290[_0x7b6a('0x44')][_0x7b6a('0x62')]},'individualHooks':!![]})[_0x7b6a('0x14')](function(){return _0xc9c6db;});}return _0xc9c6db;})[_0x7b6a('0x14')](respondWithStatusCode(_0x3a484,null))['catch'](handleError(_0x3a484,null));};exports['addAvatar']=function(_0x14d9d7,_0x4742b9){_0x14d9d7[_0x7b6a('0x5e')][_0x7b6a('0xb2')]=_0x14d9d7['file']['filename'];return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x14d9d7[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x4742b9,null))[_0x7b6a('0x14')](saveUpdates(_0x14d9d7[_0x7b6a('0x5e')],null))[_0x7b6a('0x14')](respondWithResult(_0x4742b9,null))[_0x7b6a('0x54')](handleError(_0x4742b9,null));};exports[_0x7b6a('0xb3')]=function(_0x5f5cd2,_0x3e34bb){var _0x275706=path[_0x7b6a('0xb4')](config[_0x7b6a('0xb5')],_0x7b6a('0xb6'));return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x5f5cd2['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7b6a('0x14')](handleEntityNotFound(_0x3e34bb,null))['then'](function(_0x4cbf79){if(_0x4cbf79){if(_['isNil'](_0x4cbf79[_0x7b6a('0xb2')])){return _0x3e34bb[_0x7b6a('0xb7')](_0x275706);}else{if(!fs[_0x7b6a('0xb8')](path[_0x7b6a('0xb4')](config['root'],_0x7b6a('0xb9'),_0x4cbf79[_0x7b6a('0xb2')]))){return _0x3e34bb[_0x7b6a('0xb7')](_0x275706);}return _0x3e34bb[_0x7b6a('0xb7')](path[_0x7b6a('0xb4')](config[_0x7b6a('0xb5')],_0x7b6a('0xb9'),_0x4cbf79[_0x7b6a('0xb2')]));}}})[_0x7b6a('0x54')](handleError(_0x3e34bb,null));};exports[_0x7b6a('0xba')]=function(_0x55a727,_0x31b5e1){return db[_0x7b6a('0x3a')]['find']({'where':{'id':_0x55a727[_0x7b6a('0x55')]['id']},'attributes':['id']})[_0x7b6a('0x14')](handleEntityNotFound(_0x31b5e1,null))['then'](function(_0x1f2b68){var _0x3deed5=[];values=_0x1f2b68[_0x7b6a('0x4f')];_0x3deed5['push'](get_open_tabs('chat',_0x1f2b68[_0x7b6a('0x4f')]));_0x3deed5[_0x7b6a('0x49')](get_open_tabs('sms',_0x1f2b68[_0x7b6a('0x4f')]));_0x3deed5[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x51'),_0x1f2b68['dataValues']));_0x3deed5['push'](get_open_tabs(_0x7b6a('0x52'),_0x1f2b68[_0x7b6a('0x4f')]));_0x3deed5[_0x7b6a('0x49')](get_open_tabs(_0x7b6a('0x5d'),_0x1f2b68[_0x7b6a('0x4f')]));_0x3deed5['push'](get_open_tabs(_0x7b6a('0x50'),_0x1f2b68[_0x7b6a('0x4f')]));return BPromise[_0x7b6a('0x53')](_0x3deed5);})['then'](function(_0x3c3a58){if(_0x3c3a58){var _0x5d7e00=_[_0x7b6a('0x30')](values['ChatOpenTabs'],function(_0x5ff647){return{'channel':'CHAT','id':_0x5ff647['id'],'createdAt':_0x5ff647['createdAt']};});var _0x2db0dd=_[_0x7b6a('0x30')](values[_0x7b6a('0xbb')],function(_0x1ee0c7){return{'channel':'FAX','id':_0x1ee0c7['id'],'createdAt':_0x1ee0c7[_0x7b6a('0xbc')]};});var _0x27c9cb=_[_0x7b6a('0x30')](values[_0x7b6a('0xbd')],function(_0x5c8976){return{'channel':_0x7b6a('0xbe'),'id':_0x5c8976['id'],'createdAt':_0x5c8976['createdAt']};});var _0x8dffe8=_[_0x7b6a('0x30')](values[_0x7b6a('0xbf')],function(_0x585d23){return{'channel':'MAIL','id':_0x585d23['id'],'createdAt':_0x585d23[_0x7b6a('0xbc')]};});var _0x324654=_[_0x7b6a('0x30')](values[_0x7b6a('0xc0')],function(_0x5adc7e){return{'channel':_0x7b6a('0xc1'),'id':_0x5adc7e['id'],'createdAt':_0x5adc7e[_0x7b6a('0xbc')]};});var _0x4a103a=_[_0x7b6a('0x30')](values[_0x7b6a('0xc2')],function(_0x2313f3){return{'channel':'WHATSAPP','id':_0x2313f3['id'],'createdAt':_0x2313f3[_0x7b6a('0xbc')]};});var _0x5d5a25=_[_0x7b6a('0xc3')](_0x5d7e00,_0x2db0dd,_0x27c9cb,_0x8dffe8,_0x324654,_0x4a103a);var _0x247dcb={'count':_0x5d5a25['length'],'rows':_0x5d5a25};return _0x247dcb;}else return null;})[_0x7b6a('0x14')](respondWithResult(_0x31b5e1,null))['catch'](handleError(_0x31b5e1,null));};exports[_0x7b6a('0xc4')]=function(_0x4db313,_0x32c82c){var _0x2bd5e1={};var _0x19f2e7={};var _0x4b3223;var _0xeb8ca7;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x4db313[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x32c82c,null))[_0x7b6a('0x14')](function(_0x2a5c0a){if(_0x2a5c0a){_0x4b3223=_0x2a5c0a;_0x19f2e7['model']=_[_0x7b6a('0x58')](db[_0x7b6a('0xc5')]['rawAttributes']);_0x19f2e7[_0x7b6a('0x44')]=_['keys'](_0x4db313[_0x7b6a('0x44')]);_0x19f2e7[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x19f2e7['model'],_0x19f2e7[_0x7b6a('0x44')]);_0x2bd5e1[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x19f2e7['model'],qs[_0x7b6a('0xc6')](_0x4db313[_0x7b6a('0x44')]['fields']));_0x2bd5e1[_0x7b6a('0x48')]=_0x2bd5e1[_0x7b6a('0x48')][_0x7b6a('0x4d')]?_0x2bd5e1[_0x7b6a('0x48')]:_0x19f2e7['model'];_0x2bd5e1['order']=qs['sort'](_0x4db313[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x2bd5e1[_0x7b6a('0xc8')]=qs['filters'](_[_0x7b6a('0xc9')](_0x4db313[_0x7b6a('0x44')],_0x19f2e7[_0x7b6a('0x59')]));if(_0x4db313['query'][_0x7b6a('0x2e')]){_0x2bd5e1[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x2bd5e1[_0x7b6a('0xc8')],{'$or':_['map'](_0x2bd5e1[_0x7b6a('0x48')],function(_0x2d8210){var _0x37eef9={};_0x37eef9[_0x2d8210]={'$like':'%'+_0x4db313[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0x37eef9;})});}_0x2bd5e1=_[_0x7b6a('0xca')]({},_0x2bd5e1,_0x4db313[_0x7b6a('0x5b')]);return _0x4b3223[_0x7b6a('0xc4')](_0x2bd5e1);}})[_0x7b6a('0x14')](function(_0x2e1687){if(_0x2e1687){_0xeb8ca7=_0x2e1687[_0x7b6a('0x4d')];if(_0x4db313['query'][_0x7b6a('0xcb')](_0x7b6a('0x42'))){_0x2bd5e1['include']=[{'model':db[_0x7b6a('0xcc')],'as':_0x7b6a('0xcd'),'required':![]},{'model':db['Tag'],'as':_0x7b6a('0xce'),'attributes':['id',_0x7b6a('0x37'),'color'],'where':_0x4db313[_0x7b6a('0x44')][_0x7b6a('0xcf')]?{'id':_0x4db313[_0x7b6a('0x44')][_0x7b6a('0xcf')]}:undefined,'required':_0x4db313['query'][_0x7b6a('0xcf')]?!![]:![]}];}if(!_0x4db313[_0x7b6a('0x44')][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x2bd5e1[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x4db313['query'][_0x7b6a('0xd1')]);_0x2bd5e1['offset']=qs[_0x7b6a('0x21')](_0x4db313['query'][_0x7b6a('0x21')]);}return _0x4b3223['getContacts'](_0x2bd5e1);}})['then'](function(_0x174606){if(_0x174606){return _0x174606?{'count':_0xeb8ca7,'rows':_0x174606}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x32c82c,null))['catch'](handleError(_0x32c82c,null));};exports[_0x7b6a('0xd2')]=function(_0x394536,_0x1160d2){var _0x1a131d;var _0x5353aa={};var _0x2ade52;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x394536[_0x7b6a('0x55')]['id']},'attributes':['id',_0x7b6a('0x37'),_0x7b6a('0x27')]})['then'](handleEntityNotFound(_0x1160d2,null))[_0x7b6a('0x14')](function(_0x56b469){if(!utils[_0x7b6a('0xd3')](_0x394536[_0x7b6a('0x44')][_0x7b6a('0x9d')])){throw new db[(_0x7b6a('0x8f'))]['ValidationError']('Unknown\x20channel');}_0x1a131d=_0x56b469;var _0x3d62b5={};_0x3d62b5[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_[_0x7b6a('0xa2')](_0x394536[_0x7b6a('0x44')]['channel'])+'Queue'][_0x7b6a('0x3b')]);_0x3d62b5[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x394536[_0x7b6a('0x44')]);_0x3d62b5[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x3d62b5[_0x7b6a('0x56')],_0x3d62b5[_0x7b6a('0x44')]);_0x5353aa[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x3d62b5[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x394536['query'][_0x7b6a('0xc6')]));_0x5353aa['attributes']=_0x5353aa[_0x7b6a('0x48')]['length']?_0x5353aa[_0x7b6a('0x48')]:_0x3d62b5[_0x7b6a('0x56')];_0x5353aa[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x394536[_0x7b6a('0x44')]['sort']);_0x5353aa[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x394536[_0x7b6a('0x44')],_0x3d62b5[_0x7b6a('0x59')]));if(_0x394536[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x5353aa[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x5353aa[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x5353aa[_0x7b6a('0x48')],function(_0x538fae){var _0xf8faaf={};_0xf8faaf[_0x538fae]={'$like':'%'+_0x394536['query'][_0x7b6a('0x2e')]+'%'};return _0xf8faaf;})});}_0x5353aa=_['merge']({},_0x5353aa,_0x394536[_0x7b6a('0x5b')]);switch(_0x1a131d[_0x7b6a('0x27')]){case'admin':return db[_['capitalize'](_0x394536['query']['channel'])+_0x7b6a('0xd5')][_0x7b6a('0x4a')](_0x5353aa);case'user':case _0x7b6a('0x2b'):return _0x1a131d[_0x7b6a('0x26')+_[_0x7b6a('0xa2')](_0x394536[_0x7b6a('0x44')]['channel'])+_0x7b6a('0xaf')](_0x5353aa);default:throw new db[(_0x7b6a('0x8f'))][(_0x7b6a('0x90'))](_0x7b6a('0xd6'));}})[_0x7b6a('0x14')](function(_0xea7d7e){_0x2ade52=_0xea7d7e[_0x7b6a('0x4d')];if(!_0x394536['query'][_0x7b6a('0xcb')]('nolimit')){_0x5353aa['limit']=qs[_0x7b6a('0xd1')](_0x394536[_0x7b6a('0x44')]['limit']);_0x5353aa[_0x7b6a('0x21')]=qs['offset'](_0x394536[_0x7b6a('0x44')][_0x7b6a('0x21')]);}switch(_0x1a131d[_0x7b6a('0x27')]){case _0x7b6a('0x28'):return db[_[_0x7b6a('0xa2')](_0x394536['query'][_0x7b6a('0x9d')])+_0x7b6a('0xd5')]['findAll'](_0x5353aa);case _0x7b6a('0x29'):case'agent':return _0x1a131d[_0x7b6a('0x26')+_['capitalize'](_0x394536[_0x7b6a('0x44')][_0x7b6a('0x9d')])+'Queues'](_0x5353aa);}})[_0x7b6a('0x14')](function(_0x1267a3){return{'count':_0x2ade52,'rows':_0x1267a3};})[_0x7b6a('0x14')](respondWithResult(_0x1160d2,null))[_0x7b6a('0x54')](handleError(_0x1160d2,null));};exports[_0x7b6a('0xd7')]=function(_0x3f5bce,_0x2dcc31){var _0x3a9174={};var _0xb98041={};var _0x556d5c;var _0x2c8350;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x3f5bce[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x2dcc31,null))[_0x7b6a('0x14')](function(_0x5b4cb1){if(_0x5b4cb1){_0x556d5c=_0x5b4cb1;_0xb98041[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xab')]['rawAttributes']);_0xb98041[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x3f5bce['query']);_0xb98041[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0xb98041[_0x7b6a('0x56')],_0xb98041[_0x7b6a('0x44')]);_0x3a9174[_0x7b6a('0x48')]=_['intersection'](_0xb98041[_0x7b6a('0x56')],qs['fields'](_0x3f5bce[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x3a9174[_0x7b6a('0x48')]=_0x3a9174['attributes'][_0x7b6a('0x4d')]?_0x3a9174[_0x7b6a('0x48')]:_0xb98041[_0x7b6a('0x56')];_0x3a9174[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x3f5bce[_0x7b6a('0x44')]['sort']);_0x3a9174['where']=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x3f5bce[_0x7b6a('0x44')],_0xb98041[_0x7b6a('0x59')]));if(_0x3f5bce[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x3a9174['where']=_[_0x7b6a('0xca')](_0x3a9174[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x3a9174['attributes'],function(_0x3f8d2a){var _0x55eeda={};_0x55eeda[_0x3f8d2a]={'$like':'%'+_0x3f5bce[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0x55eeda;})});}_0x3a9174=_[_0x7b6a('0xca')]({},_0x3a9174,_0x3f5bce['options']);return _0x556d5c['getVoiceQueuesRt'](_0x3a9174);}})[_0x7b6a('0x14')](function(_0x32350f){if(_0x32350f){_0x2c8350=_0x32350f[_0x7b6a('0x4d')];if(!_0x3f5bce[_0x7b6a('0x44')]['hasOwnProperty'](_0x7b6a('0xd0'))){_0x3a9174[_0x7b6a('0xd1')]=qs['limit'](_0x3f5bce[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x3a9174[_0x7b6a('0x21')]=qs['offset'](_0x3f5bce[_0x7b6a('0x44')][_0x7b6a('0x21')]);}return _0x556d5c['getVoiceQueuesRt'](_0x3a9174);}})['then'](function(_0x29ccb3){if(_0x29ccb3){return _0x29ccb3?{'count':_0x2c8350,'rows':_0x29ccb3}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x2dcc31,null))[_0x7b6a('0x54')](handleError(_0x2dcc31,null));};exports['getGroups']=function(_0x150bc5,_0x596188){var _0x5aa25b={};var _0x159c9d={};var _0x4381ae;var _0x4b09ba;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x150bc5['params']['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x596188,null))[_0x7b6a('0x14')](function(_0x36e02c){if(_0x36e02c){_0x4381ae=_0x36e02c;_0x159c9d[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xd8')][_0x7b6a('0x3b')]);_0x159c9d[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x150bc5[_0x7b6a('0x44')]);_0x159c9d['filters']=_[_0x7b6a('0x5a')](_0x159c9d[_0x7b6a('0x56')],_0x159c9d[_0x7b6a('0x44')]);_0x5aa25b[_0x7b6a('0x48')]=_['intersection'](_0x159c9d[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x150bc5[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x5aa25b['attributes']=_0x5aa25b['attributes'][_0x7b6a('0x4d')]?_0x5aa25b[_0x7b6a('0x48')]:_0x159c9d['model'];_0x5aa25b[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x150bc5[_0x7b6a('0x44')]['sort']);_0x5aa25b[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x150bc5[_0x7b6a('0x44')],_0x159c9d[_0x7b6a('0x59')]));if(_0x150bc5['query']['filter']){_0x5aa25b[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x5aa25b[_0x7b6a('0xc8')],{'$or':_['map'](_0x5aa25b[_0x7b6a('0x48')],function(_0x5b0a1f){var _0x40cb2a={};_0x40cb2a[_0x5b0a1f]={'$like':'%'+_0x150bc5['query'][_0x7b6a('0x2e')]+'%'};return _0x40cb2a;})});}_0x5aa25b=_[_0x7b6a('0xca')]({},_0x5aa25b,_0x150bc5[_0x7b6a('0x5b')]);return _0x4381ae[_0x7b6a('0xd9')](_0x5aa25b);}})[_0x7b6a('0x14')](function(_0x3e9cc5){if(_0x3e9cc5){_0x4b09ba=_0x3e9cc5[_0x7b6a('0x4d')];if(!_0x150bc5['query']['hasOwnProperty']('nolimit')){_0x5aa25b[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x150bc5[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x5aa25b[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x150bc5[_0x7b6a('0x44')][_0x7b6a('0x21')]);}return _0x4381ae[_0x7b6a('0xd9')](_0x5aa25b);}})[_0x7b6a('0x14')](function(_0x5491e2){if(_0x5491e2){return _0x5491e2?{'count':_0x4b09ba,'rows':_0x5491e2}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x596188,null))[_0x7b6a('0x54')](handleError(_0x596188,null));};exports[_0x7b6a('0xda')]=function(_0x3551f9,_0x460b37){var _0x1d9f81={'raw':!![],'where':{}};var _0x4ed766={};var _0xde2f32={'count':0x0,'rows':[]};return db[_0x7b6a('0x3a')]['findOne']({'where':{'id':_0x3551f9[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x460b37,null))['then'](function(_0x59b92a){if(_0x59b92a){_0x4ed766[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xdb')][_0x7b6a('0x3b')]);_0x4ed766['query']=_[_0x7b6a('0x58')](_0x3551f9[_0x7b6a('0x44')]);_0x4ed766[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x4ed766[_0x7b6a('0x56')],_0x4ed766['query']);_0x1d9f81[_0x7b6a('0x48')]=_['intersection'](_0x4ed766[_0x7b6a('0x56')],qs['fields'](_0x3551f9[_0x7b6a('0x44')]['fields']));_0x1d9f81['attributes']=_0x1d9f81[_0x7b6a('0x48')][_0x7b6a('0x4d')]?_0x1d9f81[_0x7b6a('0x48')]:_0x4ed766[_0x7b6a('0x56')];if(!_0x3551f9['query']['hasOwnProperty'](_0x7b6a('0xd0'))){_0x1d9f81[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x3551f9[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x1d9f81['offset']=qs[_0x7b6a('0x21')](_0x3551f9[_0x7b6a('0x44')][_0x7b6a('0x21')]);}_0x1d9f81[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x3551f9[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x1d9f81[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x3551f9[_0x7b6a('0x44')],_0x4ed766['filters']));_0x1d9f81[_0x7b6a('0xc8')]['UserId']=_0x59b92a['id'];if(_0x3551f9['query'][_0x7b6a('0x2e')]){_0x1d9f81[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x1d9f81['where'],{'$or':_[_0x7b6a('0x30')](_0x1d9f81[_0x7b6a('0x48')],function(_0x13a708){var _0x4f07cb={};_0x4f07cb[_0x13a708]={'$like':'%'+_0x3551f9['query']['filter']+'%'};return _0x4f07cb;})});}_0x1d9f81=_['merge']({},_0x1d9f81,_0x3551f9['options']);return db['VoiceRecording']['count']({'where':_0x1d9f81[_0x7b6a('0xc8')]})[_0x7b6a('0x14')](function(_0x20af53){_0xde2f32[_0x7b6a('0x22')]=_0x20af53;if(_0x3551f9[_0x7b6a('0x44')][_0x7b6a('0x42')]){_0x1d9f81[_0x7b6a('0x43')]=[{'all':!![]}];}return db[_0x7b6a('0xdb')]['findAll'](_0x1d9f81);})[_0x7b6a('0x14')](function(_0x40c7bb){_0xde2f32[_0x7b6a('0x4b')]=_0x40c7bb;return _0xde2f32;});}})[_0x7b6a('0x14')](respondWithFilteredResult(_0x460b37,_0x1d9f81))[_0x7b6a('0x54')](handleError(_0x460b37,null));};exports[_0x7b6a('0xdc')]=function(_0x10415c,_0x12f1ae){var _0x1c1505={'raw':!![],'where':{}};var _0xd5873f={};var _0x77c0c4={'count':0x0,'rows':[]};return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x10415c[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x12f1ae,null))[_0x7b6a('0x14')](function(_0x132dfc){if(_0x132dfc){_0xd5873f[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xdd')][_0x7b6a('0x3b')]);_0xd5873f[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x10415c['query']);_0xd5873f[_0x7b6a('0x59')]=_['intersection'](_0xd5873f[_0x7b6a('0x56')],_0xd5873f[_0x7b6a('0x44')]);_0x1c1505[_0x7b6a('0x48')]=_['intersection'](_0xd5873f['model'],qs[_0x7b6a('0xc6')](_0x10415c[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x1c1505[_0x7b6a('0x48')]=_0x1c1505[_0x7b6a('0x48')]['length']?_0x1c1505[_0x7b6a('0x48')]:_0xd5873f[_0x7b6a('0x56')];if(!_0x10415c[_0x7b6a('0x44')]['hasOwnProperty'](_0x7b6a('0xd0'))){_0x1c1505[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x10415c['query'][_0x7b6a('0xd1')]);_0x1c1505['offset']=qs['offset'](_0x10415c[_0x7b6a('0x44')]['offset']);}_0x1c1505[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x10415c[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x1c1505[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x10415c[_0x7b6a('0x44')],_0xd5873f[_0x7b6a('0x59')]));_0x1c1505[_0x7b6a('0xc8')]['UserId']=_0x132dfc['id'];if(_0x10415c['query'][_0x7b6a('0x2e')]){_0x1c1505[_0x7b6a('0xc8')]=_['merge'](_0x1c1505['where'],{'$or':_[_0x7b6a('0x30')](_0x1c1505['attributes'],function(_0x2e31a3){var _0x3b4271={};_0x3b4271[_0x2e31a3]={'$like':'%'+_0x10415c['query'][_0x7b6a('0x2e')]+'%'};return _0x3b4271;})});}_0x1c1505=_['merge']({},_0x1c1505,_0x10415c[_0x7b6a('0x5b')]);return db['ScreenRecording'][_0x7b6a('0x22')]({'where':_0x1c1505[_0x7b6a('0xc8')]})[_0x7b6a('0x14')](function(_0x1d7263){_0x77c0c4[_0x7b6a('0x22')]=_0x1d7263;if(_0x10415c['query'][_0x7b6a('0x42')]){_0x1c1505['include']=[{'all':!![]}];}return db[_0x7b6a('0xdd')]['findAll'](_0x1c1505);})[_0x7b6a('0x14')](function(_0x5d93f8){_0x77c0c4[_0x7b6a('0x4b')]=_0x5d93f8;return _0x77c0c4;});}})[_0x7b6a('0x14')](respondWithFilteredResult(_0x12f1ae,_0x1c1505))[_0x7b6a('0x54')](handleError(_0x12f1ae,null));};exports[_0x7b6a('0xde')]=function(_0x1ee572,_0x1f54ac){var _0x341f20={};var _0x46a1ad={};var _0xdc1dca;var _0x1542ce;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x1ee572[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x1f54ac,null))['then'](function(_0x289455){if(_0x289455){_0xdc1dca=_0x289455;_0x46a1ad[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xdf')]['rawAttributes']);_0x46a1ad[_0x7b6a('0x44')]=_['keys'](_0x1ee572[_0x7b6a('0x44')]);_0x46a1ad[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x46a1ad[_0x7b6a('0x56')],_0x46a1ad['query']);_0x341f20[_0x7b6a('0x48')]=_['intersection'](_0x46a1ad[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x1ee572[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x341f20[_0x7b6a('0x48')]=_0x341f20[_0x7b6a('0x48')]['length']?_0x341f20[_0x7b6a('0x48')]:_0x46a1ad[_0x7b6a('0x56')];_0x341f20[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x1ee572[_0x7b6a('0x44')]['sort']);_0x341f20[_0x7b6a('0xc8')]=qs['filters'](_[_0x7b6a('0xc9')](_0x1ee572[_0x7b6a('0x44')],_0x46a1ad['filters']));if(_0x1ee572[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x341f20['where']=_[_0x7b6a('0xca')](_0x341f20[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x341f20[_0x7b6a('0x48')],function(_0x4173b7){var _0x37cf4f={};_0x37cf4f[_0x4173b7]={'$like':'%'+_0x1ee572[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0x37cf4f;})});}_0x341f20=_[_0x7b6a('0xca')]({},_0x341f20,_0x1ee572[_0x7b6a('0x5b')]);return _0xdc1dca['getChatInteractions'](_0x341f20);}})['then'](function(_0x20fdfe){if(_0x20fdfe){_0x1542ce=_0x20fdfe[_0x7b6a('0x4d')];if(!_0x1ee572['query'][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x341f20['limit']=qs[_0x7b6a('0xd1')](_0x1ee572['query']['limit']);_0x341f20['offset']=qs[_0x7b6a('0x21')](_0x1ee572[_0x7b6a('0x44')]['offset']);}return _0xdc1dca[_0x7b6a('0xde')](_0x341f20);}})[_0x7b6a('0x14')](function(_0x13c54f){if(_0x13c54f){return _0x13c54f?{'count':_0x1542ce,'rows':_0x13c54f}:null;}})['then'](respondWithResult(_0x1f54ac,null))[_0x7b6a('0x54')](handleError(_0x1f54ac,null));};exports[_0x7b6a('0xe0')]=function(_0x951b08,_0x2c1a9f){var _0x308b3c={};var _0x569767={};var _0x31ef26;var _0x111eff;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x951b08[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x2c1a9f,null))[_0x7b6a('0x14')](function(_0x568bed){if(_0x568bed){_0x31ef26=_0x568bed;_0x569767[_0x7b6a('0x56')]=_['keys'](db[_0x7b6a('0xe1')][_0x7b6a('0x3b')]);_0x569767[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x951b08[_0x7b6a('0x44')]);_0x569767[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x569767['model'],_0x569767[_0x7b6a('0x44')]);_0x308b3c[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x569767['model'],qs[_0x7b6a('0xc6')](_0x951b08[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x308b3c[_0x7b6a('0x48')]=_0x308b3c['attributes'][_0x7b6a('0x4d')]?_0x308b3c[_0x7b6a('0x48')]:_0x569767[_0x7b6a('0x56')];_0x308b3c[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x951b08[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x308b3c['where']=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x951b08[_0x7b6a('0x44')],_0x569767[_0x7b6a('0x59')]));if(_0x951b08['query'][_0x7b6a('0x2e')]){_0x308b3c[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x308b3c[_0x7b6a('0xc8')],{'$or':_['map'](_0x308b3c[_0x7b6a('0x48')],function(_0x526e3d){var _0x2b59b2={};_0x2b59b2[_0x526e3d]={'$like':'%'+_0x951b08[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0x2b59b2;})});}_0x308b3c=_[_0x7b6a('0xca')]({},_0x308b3c,_0x951b08[_0x7b6a('0x5b')]);return _0x31ef26[_0x7b6a('0xe0')](_0x308b3c);}})['then'](function(_0x3ca759){if(_0x3ca759){_0x111eff=_0x3ca759[_0x7b6a('0x4d')];if(!_0x951b08['query'][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x308b3c[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x951b08[_0x7b6a('0x44')]['limit']);_0x308b3c[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x951b08[_0x7b6a('0x44')]['offset']);}return _0x31ef26[_0x7b6a('0xe0')](_0x308b3c);}})[_0x7b6a('0x14')](function(_0x435952){if(_0x435952){return _0x435952?{'count':_0x111eff,'rows':_0x435952}:null;}})['then'](respondWithResult(_0x2c1a9f,null))['catch'](handleError(_0x2c1a9f,null));};exports[_0x7b6a('0xe2')]=function(_0x341011,_0x1bbfbc){var _0x38b593={'raw':!![],'where':{}};var _0x5f2cfa={};var _0x4f462e={'count':0x0,'rows':[]};return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x341011['params']['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x1bbfbc,null))['then'](function(_0x56ac6b){if(_0x56ac6b){_0x5f2cfa[_0x7b6a('0x56')]=_['keys'](db[_0x7b6a('0xe3')][_0x7b6a('0x3b')]);_0x5f2cfa[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x341011['query']);_0x5f2cfa[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x5f2cfa[_0x7b6a('0x56')],_0x5f2cfa['query']);_0x38b593['attributes']=_[_0x7b6a('0x5a')](_0x5f2cfa['model'],qs['fields'](_0x341011[_0x7b6a('0x44')]['fields']));_0x38b593[_0x7b6a('0x48')]=_0x38b593['attributes']['length']?_0x38b593[_0x7b6a('0x48')]:_0x5f2cfa[_0x7b6a('0x56')];if(!_0x341011[_0x7b6a('0x44')][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x38b593[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x341011[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x38b593[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x341011[_0x7b6a('0x44')]['offset']);}_0x38b593[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x341011[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x38b593[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x341011[_0x7b6a('0x44')],_0x5f2cfa[_0x7b6a('0x59')]));_0x38b593[_0x7b6a('0xc8')][_0x7b6a('0xe4')]=_0x56ac6b['id'];if(_0x341011[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x38b593[_0x7b6a('0xc8')]=_['merge'](_0x38b593[_0x7b6a('0xc8')],{'$or':_['map'](_0x38b593[_0x7b6a('0x48')],function(_0x48dffe){var _0x4bc1ca={};_0x4bc1ca[_0x48dffe]={'$like':'%'+_0x341011['query']['filter']+'%'};return _0x4bc1ca;})});}_0x38b593=_['merge']({},_0x38b593,_0x341011[_0x7b6a('0x5b')]);return db['MailInteraction'][_0x7b6a('0x22')]({'where':_0x38b593[_0x7b6a('0xc8')]})[_0x7b6a('0x14')](function(_0x1da9e4){_0x4f462e['count']=_0x1da9e4;if(_0x341011[_0x7b6a('0x44')][_0x7b6a('0x42')]){_0x38b593['include']=[{'all':!![]}];}return db[_0x7b6a('0xe3')]['findAll'](_0x38b593);})[_0x7b6a('0x14')](function(_0x2819b5){_0x4f462e[_0x7b6a('0x4b')]=_0x2819b5;return _0x4f462e;});}})[_0x7b6a('0x14')](respondWithFilteredResult(_0x1bbfbc,_0x38b593))['catch'](handleError(_0x1bbfbc,null));};exports['getSmsInteractions']=function(_0x241695,_0x3ba6b9){var _0xe584c5={};var _0x3acee9={};var _0x3ac79e;var _0x215317;return db[_0x7b6a('0x3a')]['findOne']({'where':{'id':_0x241695[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x3ba6b9,null))[_0x7b6a('0x14')](function(_0xcac7b3){if(_0xcac7b3){_0x3ac79e=_0xcac7b3;_0x3acee9[_0x7b6a('0x56')]=_['keys'](db[_0x7b6a('0xe5')][_0x7b6a('0x3b')]);_0x3acee9[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x241695[_0x7b6a('0x44')]);_0x3acee9[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x3acee9[_0x7b6a('0x56')],_0x3acee9[_0x7b6a('0x44')]);_0xe584c5[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x3acee9[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x241695[_0x7b6a('0x44')]['fields']));_0xe584c5[_0x7b6a('0x48')]=_0xe584c5[_0x7b6a('0x48')]['length']?_0xe584c5[_0x7b6a('0x48')]:_0x3acee9[_0x7b6a('0x56')];_0xe584c5[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x241695[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0xe584c5['where']=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x241695['query'],_0x3acee9[_0x7b6a('0x59')]));if(_0x241695[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0xe584c5[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0xe584c5[_0x7b6a('0xc8')],{'$or':_['map'](_0xe584c5[_0x7b6a('0x48')],function(_0x12be5a){var _0x52fcb6={};_0x52fcb6[_0x12be5a]={'$like':'%'+_0x241695[_0x7b6a('0x44')]['filter']+'%'};return _0x52fcb6;})});}_0xe584c5=_[_0x7b6a('0xca')]({},_0xe584c5,_0x241695[_0x7b6a('0x5b')]);return _0x3ac79e[_0x7b6a('0xe6')](_0xe584c5);}})[_0x7b6a('0x14')](function(_0x49006f){if(_0x49006f){_0x215317=_0x49006f[_0x7b6a('0x4d')];if(!_0x241695[_0x7b6a('0x44')]['hasOwnProperty'](_0x7b6a('0xd0'))){_0xe584c5[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x241695['query'][_0x7b6a('0xd1')]);_0xe584c5[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x241695[_0x7b6a('0x44')][_0x7b6a('0x21')]);}return _0x3ac79e[_0x7b6a('0xe6')](_0xe584c5);}})['then'](function(_0x2f820b){if(_0x2f820b){return _0x2f820b?{'count':_0x215317,'rows':_0x2f820b}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x3ba6b9,null))['catch'](handleError(_0x3ba6b9,null));};exports[_0x7b6a('0xe7')]=function(_0x1f5bf4,_0x48373a){var _0x4f3820={};var _0x2bfbfe={};var _0x16bfb2;var _0x3a8e21;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x1f5bf4[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x48373a,null))[_0x7b6a('0x14')](function(_0xae11b){if(_0xae11b){_0x16bfb2=_0xae11b;_0x2bfbfe[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xe8')][_0x7b6a('0x3b')]);_0x2bfbfe[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x1f5bf4[_0x7b6a('0x44')]);_0x2bfbfe['filters']=_['intersection'](_0x2bfbfe[_0x7b6a('0x56')],_0x2bfbfe[_0x7b6a('0x44')]);_0x4f3820[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x2bfbfe['model'],qs[_0x7b6a('0xc6')](_0x1f5bf4[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x4f3820[_0x7b6a('0x48')]=_0x4f3820[_0x7b6a('0x48')][_0x7b6a('0x4d')]?_0x4f3820[_0x7b6a('0x48')]:_0x2bfbfe['model'];_0x4f3820[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x1f5bf4[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x4f3820[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x1f5bf4[_0x7b6a('0x44')],_0x2bfbfe['filters']));if(_0x1f5bf4[_0x7b6a('0x44')]['filter']){_0x4f3820[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x4f3820[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x4f3820['attributes'],function(_0x28efd1){var _0x231845={};_0x231845[_0x28efd1]={'$like':'%'+_0x1f5bf4[_0x7b6a('0x44')]['filter']+'%'};return _0x231845;})});}_0x4f3820=_['merge']({},_0x4f3820,_0x1f5bf4['options']);return _0x16bfb2['getFaxInteractions'](_0x4f3820);}})[_0x7b6a('0x14')](function(_0x25a287){if(_0x25a287){_0x3a8e21=_0x25a287[_0x7b6a('0x4d')];if(!_0x1f5bf4[_0x7b6a('0x44')][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x4f3820[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x1f5bf4[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x4f3820['offset']=qs[_0x7b6a('0x21')](_0x1f5bf4['query'][_0x7b6a('0x21')]);}return _0x16bfb2[_0x7b6a('0xe7')](_0x4f3820);}})[_0x7b6a('0x14')](function(_0x2ac1ab){if(_0x2ac1ab){return _0x2ac1ab?{'count':_0x3a8e21,'rows':_0x2ac1ab}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x48373a,null))[_0x7b6a('0x54')](handleError(_0x48373a,null));};exports[_0x7b6a('0xe9')]=function(_0x344323,_0x17eec8){var _0x4f59eb={};var _0x310a43={};var _0x44e02c;var _0x4e3e52;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x344323[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x17eec8,null))[_0x7b6a('0x14')](function(_0x18d33a){if(_0x18d33a){_0x44e02c=_0x18d33a;_0x310a43[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db[_0x7b6a('0xea')][_0x7b6a('0x3b')]);_0x310a43[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x344323[_0x7b6a('0x44')]);_0x310a43[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x310a43[_0x7b6a('0x56')],_0x310a43[_0x7b6a('0x44')]);_0x4f59eb[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x310a43[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x344323['query'][_0x7b6a('0xc6')]));_0x4f59eb[_0x7b6a('0x48')]=_0x4f59eb[_0x7b6a('0x48')][_0x7b6a('0x4d')]?_0x4f59eb[_0x7b6a('0x48')]:_0x310a43['model'];_0x4f59eb[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x344323['query'][_0x7b6a('0xc7')]);_0x4f59eb[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_['pick'](_0x344323[_0x7b6a('0x44')],_0x310a43[_0x7b6a('0x59')]));if(_0x344323[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x4f59eb['where']=_['merge'](_0x4f59eb[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x4f59eb[_0x7b6a('0x48')],function(_0x268f47){var _0xf90efb={};_0xf90efb[_0x268f47]={'$like':'%'+_0x344323[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0xf90efb;})});}_0x4f59eb=_[_0x7b6a('0xca')]({},_0x4f59eb,_0x344323[_0x7b6a('0x5b')]);return _0x44e02c[_0x7b6a('0xe9')](_0x4f59eb);}})[_0x7b6a('0x14')](function(_0x634dd4){if(_0x634dd4){_0x4e3e52=_0x634dd4[_0x7b6a('0x4d')];if(!_0x344323['query'][_0x7b6a('0xcb')]('nolimit')){_0x4f59eb[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x344323[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x4f59eb[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x344323[_0x7b6a('0x44')]['offset']);}return _0x44e02c[_0x7b6a('0xe9')](_0x4f59eb);}})['then'](function(_0x262c1e){if(_0x262c1e){return _0x262c1e?{'count':_0x4e3e52,'rows':_0x262c1e}:null;}})[_0x7b6a('0x14')](respondWithResult(_0x17eec8,null))[_0x7b6a('0x54')](handleError(_0x17eec8,null));};exports['login']=function(_0x1aa6bf,_0x5b3f8c,_0x365a04){var _0x3be475;var _0xfa52c3;var _0x2ca7d2;var _0x1e169d=!_[_0x7b6a('0x68')](_0x1aa6bf[_0x7b6a('0x55')]['id'])?_0x1aa6bf[_0x7b6a('0x55')]['id']:!_['isNil'](_0x1aa6bf['user']['id'])?_0x1aa6bf[_0x7b6a('0x29')]['id']:null;return db[_0x7b6a('0x3a')]['find']({'where':{'id':_0x1e169d,'role':{'$or':[_0x7b6a('0x28'),_0x7b6a('0x29'),'agent']}},'attributes':['id','name',_0x7b6a('0xeb'),_0x7b6a('0xec'),_0x7b6a('0x27'),'internal',_0x7b6a('0x9f')]})[_0x7b6a('0x14')](function(_0x308061){if(_0x308061){if(_0x308061[_0x7b6a('0x27')]===_0x7b6a('0x2b')){_0x3be475=_0x308061;if(_0x1aa6bf[_0x7b6a('0x5e')][_0x7b6a('0xa9')]){_0x2ca7d2=util[_0x7b6a('0xed')](_0x7b6a('0xee'),_0x3be475[_0x1aa6bf['body']['interface']]);}else if(_0x1aa6bf['body']['intrf']){_0x2ca7d2=util[_0x7b6a('0xed')](_0x7b6a('0xef'),_0x1aa6bf['body']['intrf']);}else{_0x2ca7d2=util['format'](_0x7b6a('0xef'),_0x3be475[_0x7b6a('0x37')]);}socket['to'](util[_0x7b6a('0xed')](_0x7b6a('0xf0'),_0x3be475['name']))[_0x7b6a('0xb0')](_0x7b6a('0xf1'),{'user':{'id':_0x3be475['id'],'name':_0x3be475[_0x7b6a('0x37')]},'ip':_0x1aa6bf[_0x7b6a('0xf2')][_0x7b6a('0xf3')]||_0x1aa6bf[_0x7b6a('0xf4')][_0x7b6a('0xf5')]||_0x1aa6bf[_0x7b6a('0xf6')]['remoteAddress']||_0x1aa6bf[_0x7b6a('0xf4')][_0x7b6a('0xf6')]['remoteAddress']});return db[_0x7b6a('0xab')][_0x7b6a('0x25')]({'where':{'membername':_0x3be475[_0x7b6a('0x37')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x7b6a('0x90'))](_0x7b6a('0xf7'));}})[_0x7b6a('0x14')](function(){if(_0x3be475){return _0x3be475[_0x7b6a('0xf8')]({'raw':!![]});}})[_0x7b6a('0x14')](function(_0x15d429){if(_0x3be475){var _0x246406=[];if(_0x15d429){_0xfa52c3=_0x15d429;if(_0xfa52c3[_0x7b6a('0x4d')]){for(var _0x2c56f8=0x0;_0x2c56f8<_0xfa52c3[_0x7b6a('0x4d')];_0x2c56f8++){_0x246406['push']({'membername':_0x3be475[_0x7b6a('0x37')],'UserId':_0x3be475['id'],'queue_name':_0xfa52c3[_0x2c56f8][_0x7b6a('0x37')],'VoiceQueueId':_0xfa52c3[_0x2c56f8]['id'],'interface':_0x2ca7d2,'paused':_0x3be475['loginInPause']||![],'penalty':_0xfa52c3[_0x2c56f8]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x7b6a('0xaa')](_0x246406,function(_0x7cd013){return db[_0x7b6a('0xab')][_0x7b6a('0xac')](_0x7cd013);});}}}})[_0x7b6a('0x14')](function(){if(_0x3be475){return db[_0x7b6a('0xf9')][_0x7b6a('0x4a')]({'where':{'membername':_0x3be475['name'],'exitAt':null}});}})[_0x7b6a('0x14')](function(_0xe6db75){if(_0x3be475){var _0x1d346d=[];_0xe6db75[_0x7b6a('0xfa')](function(_0x5b9cb4){_0x1d346d[_0x7b6a('0x49')](_0x5b9cb4[_0x7b6a('0x24')]({'exitAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb'))}));});return BPromise[_0x7b6a('0x53')](_0x1d346d);}})[_0x7b6a('0x14')](function(){if(_0x3be475){var _0x55faa2=[];var _0x435529=[];var _0x479b15=utils[_0x7b6a('0xfc')]();var _0xdff0a7={'membername':_0x3be475[_0x7b6a('0x37')],'interface':_0x2ca7d2,'enterAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb')),'role':_0x3be475['role'],'internal':_0x3be475[_0x7b6a('0x63')]};_0x479b15[_0x7b6a('0xfa')](function(_0x4e5afe){_0x55faa2['push'](_[_0x7b6a('0xca')]({'channel':_0x4e5afe,'type':'LOGIN','data1':_0x1aa6bf['body'][_0x7b6a('0xfd')],'data2':_0x2ca7d2},_0xdff0a7));if(_0x3be475['loginInPause']){_0x435529[_0x7b6a('0x49')](_[_0x7b6a('0xca')]({'channel':_0x4e5afe,'type':_0x7b6a('0xfe'),'data1':'LOGININPAUSE'},_0xdff0a7));}});return db['MemberReport'][_0x7b6a('0x86')](_0x55faa2[_0x7b6a('0xc3')](_0x435529),{'individualHooks':!![]});}})[_0x7b6a('0x14')](function(){if(_0x3be475){return _0x3be475[_0x7b6a('0x24')]({'online':!![],'lastLoginAt':moment()['format'](_0x7b6a('0xfb')),'voicePause':_0x3be475['loginInPause']||![],'mailPause':_0x3be475[_0x7b6a('0x9f')]||![],'chatPause':_0x3be475[_0x7b6a('0x9f')]||![],'faxPause':_0x3be475['loginInPause']||![],'smsPause':_0x3be475[_0x7b6a('0x9f')]||![],'openchannelPause':_0x3be475['loginInPause']||![],'whatsappPause':_0x3be475[_0x7b6a('0x9f')]||![],'pauseType':_0x3be475[_0x7b6a('0x9f')]?_0x7b6a('0xff'):null,'interface':_0x2ca7d2,'lastPauseAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb'))});}})[_0x7b6a('0x14')](function(_0x3a73cc){if(_0x1aa6bf['isMiddleware']){return _0x365a04();}else{return BPromise[_0x7b6a('0x100')](_0x3a73cc)[_0x7b6a('0x14')](respondWithResult(_0x5b3f8c,null));}})[_0x7b6a('0x54')](handleError(_0x5b3f8c,null));};exports[_0x7b6a('0x101')]=function(_0x33bb77,_0xfca9ad){var _0xdf483c;return db['User'][_0x7b6a('0x33')]({'where':{'id':_0x33bb77[_0x7b6a('0x55')]['id'],'role':'agent'},'attributes':['id',_0x7b6a('0x37'),_0x7b6a('0x27')]})[_0x7b6a('0x14')](handleEntityNotFound(_0xfca9ad,null))['then'](function(_0x16d3ee){if(_0x16d3ee){_0xdf483c=_0x16d3ee;return db['UserVoiceQueueRt'][_0x7b6a('0x25')]({'where':{'membername':_0xdf483c[_0x7b6a('0x37')]},'individualHooks':!![]});}})[_0x7b6a('0x14')](function(){return db[_0x7b6a('0xf9')]['findAll']({'where':{'membername':_0xdf483c['name'],'exitAt':null}});})['then'](function(_0x599ee5){var _0x30af4d=[];_0x599ee5['forEach'](function(_0x204684){_0x30af4d[_0x7b6a('0x49')](_0x204684['update']({'exitAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb'))}));});return BPromise[_0x7b6a('0x53')](_0x30af4d);})[_0x7b6a('0x14')](function(){return _0xdf483c[_0x7b6a('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7b6a('0x14')](respondWithResult(_0xfca9ad,null))[_0x7b6a('0x54')](handleError(_0xfca9ad,null));};exports[_0x7b6a('0x102')]=function(_0x4f8cf8,_0x43161c){var _0x15ebb9;return db[_0x7b6a('0xab')][_0x7b6a('0x24')]({'paused':0x1},{'where':{'UserId':_0x4f8cf8[_0x7b6a('0x55')]['id']},'individualHooks':!![]})[_0x7b6a('0x14')](function(){return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x4f8cf8[_0x7b6a('0x55')]['id'],'role':_0x7b6a('0x2b')},'attributes':['id',_0x7b6a('0x37'),_0x7b6a('0x27'),_0x7b6a('0x63'),_0x7b6a('0xa9')]});})[_0x7b6a('0x14')](handleEntityNotFound(_0x43161c,null))[_0x7b6a('0x14')](function(_0x2c0c53){if(_0x2c0c53){_0x15ebb9=_0x2c0c53;return respondWithRpcPromise(_0x7b6a('0x103'),_0x7b6a('0x102'),{'id':_0x15ebb9['id'],'name':_0x15ebb9['name'],'pause':!![]});}})[_0x7b6a('0x14')](function(){if(_0x15ebb9){return db['MemberReport']['findAll']({'where':{'membername':_0x15ebb9['name'],'type':_0x7b6a('0xfe'),'exitAt':null}});}})[_0x7b6a('0x14')](function(_0x1c3572){if(_0x1c3572[_0x7b6a('0x4d')]){var _0x282857=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x41c06f=0x0,_0x45f159=_0x1c3572['length'];_0x41c06f<_0x45f159;_0x41c06f++){_0x1c3572[_0x41c06f]['updateAttributes']({'exitAt':_0x282857});}}})[_0x7b6a('0x14')](function(){var _0x43405d=[];var _0x55dd10=utils[_0x7b6a('0xfc')]();_0x55dd10[_0x7b6a('0xfa')](function(_0x37f304){_0x43405d['push']({'channel':_0x37f304,'membername':_0x15ebb9[_0x7b6a('0x37')],'interface':_[_0x7b6a('0x68')](_0x15ebb9[_0x7b6a('0xa9')])?util['format']('SIP/%s',_0x15ebb9['name']):_0x15ebb9[_0x7b6a('0xa9')],'type':_0x7b6a('0xfe'),'enterAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb')),'data1':_0x4f8cf8[_0x7b6a('0x5e')][_0x7b6a('0x3d')]||_0x7b6a('0x104'),'role':_0x15ebb9[_0x7b6a('0x27')],'internal':_0x15ebb9[_0x7b6a('0x63')]});});return db[_0x7b6a('0xf9')][_0x7b6a('0x86')](_0x43405d,{'individualHooks':!![]});})[_0x7b6a('0x14')](function(){return _0x15ebb9[_0x7b6a('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4f8cf8['body']['type']||_0x7b6a('0x104'),'lastPauseAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb'))});})[_0x7b6a('0x14')](respondWithResult(_0x43161c,null))[_0x7b6a('0x54')](handleError(_0x43161c,null));};exports[_0x7b6a('0x105')]=function(_0x39649c,_0x44fc12){var _0x29b1de;return db[_0x7b6a('0x3a')][_0x7b6a('0x33')]({'where':{'id':_0x39649c['params']['id']},'attributes':['id',_0x7b6a('0x37'),_0x7b6a('0x27'),_0x7b6a('0xa0'),_0x7b6a('0x106'),_0x7b6a('0x107'),_0x7b6a('0x108'),_0x7b6a('0x109'),_0x7b6a('0x10a'),'whatsapppause','pauseType',_0x7b6a('0x10b')]})[_0x7b6a('0x14')](handleEntityNotFound(_0x44fc12,null))[_0x7b6a('0x14')](function(_0x74e163){if(_0x74e163){_0x29b1de=_0x74e163;if(_0x39649c[_0x7b6a('0x5e')][_0x7b6a('0x9d')]&&!utils[_0x7b6a('0xd3')](_0x39649c[_0x7b6a('0x5e')][_0x7b6a('0x9d')])){throw new db[(_0x7b6a('0x8f'))]['ValidationError'](_0x7b6a('0xae'));}switch(_0x39649c[_0x7b6a('0x5e')][_0x7b6a('0x9d')]){case _0x7b6a('0xa7'):return respondWithRpcPromise(_0x7b6a('0x103'),_0x7b6a('0x105'),{'id':_0x29b1de['id'],'name':_0x29b1de[_0x7b6a('0x37')],'pause':![]})[_0x7b6a('0x14')](function(){return db[_0x7b6a('0xab')][_0x7b6a('0x24')]({'paused':0x0},{'where':{'UserId':_0x29b1de['id']},'individualHooks':!![]});})[_0x7b6a('0x14')](function(){return db['MemberReport'][_0x7b6a('0x33')]({'where':{'channel':_0x39649c[_0x7b6a('0x5e')][_0x7b6a('0x9d')],'membername':_0x29b1de[_0x7b6a('0x37')],'type':_0x7b6a('0xfe'),'exitAt':null}});})[_0x7b6a('0x14')](function(_0x5c1e7){if(_0x5c1e7){return _0x5c1e7[_0x7b6a('0x24')]({'exitAt':moment()[_0x7b6a('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7b6a('0x10c')},{'individualHooks':!![]});}return null;})[_0x7b6a('0x14')](function(){return _0x29b1de['update']({'voicePause':![]});});case _0x7b6a('0x50'):case _0x7b6a('0x5c'):case'fax':case _0x7b6a('0x4e'):case _0x7b6a('0x52'):case _0x7b6a('0x51'):return db[_0x7b6a('0xf9')]['find']({'where':{'channel':_0x39649c[_0x7b6a('0x5e')]['channel'],'membername':_0x29b1de[_0x7b6a('0x37')],'type':'PAUSE','exitAt':null}})[_0x7b6a('0x14')](function(_0x354a42){if(_0x354a42){return _0x354a42['update']({'exitAt':moment()[_0x7b6a('0xed')](_0x7b6a('0xfb')),'data2':_0x7b6a('0x10c')},{'individualHooks':!![]});}return null;})[_0x7b6a('0x14')](function(){var _0x4acb83={};_[_0x7b6a('0x10d')](_0x4acb83,util[_0x7b6a('0xed')](_0x7b6a('0x10e'),_0x39649c[_0x7b6a('0x5e')][_0x7b6a('0x9d')],'Pause'),![]);return _0x29b1de['update'](_0x4acb83);});default:return respondWithRpcPromise('QueuePause',_0x7b6a('0x105'),{'id':_0x29b1de['id'],'name':_0x29b1de[_0x7b6a('0x37')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x7b6a('0x24')]({'paused':0x0},{'where':{'UserId':_0x29b1de['id']}});})[_0x7b6a('0x14')](function(){return db[_0x7b6a('0xf9')]['findAll']({'where':{'membername':_0x29b1de[_0x7b6a('0x37')],'type':_0x7b6a('0xfe'),'exitAt':null}});})[_0x7b6a('0x14')](function(_0x11997b){var _0x43b261=[];_0x11997b[_0x7b6a('0xfa')](function(_0x4e5d70){_0x43b261[_0x7b6a('0x49')](_0x4e5d70[_0x7b6a('0x24')]({'exitAt':moment()['format'](_0x7b6a('0xfb')),'data2':_0x7b6a('0x10c')}));});return BPromise[_0x7b6a('0x53')](_0x43b261);})[_0x7b6a('0x14')](function(){return _0x29b1de['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7b6a('0x14')](respondWithResult(_0x44fc12,null))[_0x7b6a('0x54')](handleError(_0x44fc12,null));};exports[_0x7b6a('0x10f')]=function(_0x50b27b,_0x3f08c2){var _0x271b7f={};var _0x236860={};var _0x37c06e;var _0x564978;return db[_0x7b6a('0x3a')]['findOne']({'where':{'id':_0x50b27b[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x3f08c2,null))[_0x7b6a('0x14')](function(_0x5d1390){if(_0x5d1390){_0x37c06e=_0x5d1390;_0x236860[_0x7b6a('0x56')]=_['keys'](db[_0x7b6a('0x110')]['rawAttributes']);_0x236860['query']=_[_0x7b6a('0x58')](_0x50b27b['query']);_0x236860[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x236860[_0x7b6a('0x56')],_0x236860[_0x7b6a('0x44')]);_0x271b7f[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x236860[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x50b27b[_0x7b6a('0x44')]['fields']));_0x271b7f['attributes']=_0x271b7f['attributes']['length']?_0x271b7f[_0x7b6a('0x48')]:_0x236860[_0x7b6a('0x56')];_0x271b7f[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x50b27b[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x271b7f['where']=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x50b27b['query'],_0x236860['filters']));if(_0x50b27b[_0x7b6a('0x44')]['filter']){_0x271b7f[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x271b7f[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x271b7f[_0x7b6a('0x48')],function(_0x3fba46){var _0x1555bf={};_0x1555bf[_0x3fba46]={'$like':'%'+_0x50b27b['query']['filter']+'%'};return _0x1555bf;})});}_0x271b7f=_[_0x7b6a('0xca')]({},_0x271b7f,_0x50b27b['options']);return _0x37c06e[_0x7b6a('0x10f')](_0x271b7f);}})[_0x7b6a('0x14')](function(_0xb6a393){if(_0xb6a393){_0x564978=_0xb6a393[_0x7b6a('0x4d')];if(!_0x50b27b[_0x7b6a('0x44')][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x271b7f[_0x7b6a('0xd1')]=qs[_0x7b6a('0xd1')](_0x50b27b[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x271b7f[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x50b27b[_0x7b6a('0x44')][_0x7b6a('0x21')]);}return _0x37c06e['getTeams'](_0x271b7f);}})[_0x7b6a('0x14')](function(_0x2a6ed5){if(_0x2a6ed5){return _0x2a6ed5?{'count':_0x564978,'rows':_0x2a6ed5}:null;}})['then'](respondWithResult(_0x3f08c2,null))['catch'](handleError(_0x3f08c2,null));};exports['addTeams']=function(_0x2dc4ee,_0x4c862f){return db[_0x7b6a('0x3a')]['find']({'where':{'id':_0x2dc4ee[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x4c862f,null))[_0x7b6a('0x14')](function(_0x5a3570){if(_0x5a3570){var _0x2c6320=_0x5a3570['get']({'plain':!![]});return _0x5a3570[_0x7b6a('0x111')](_0x2dc4ee['body']['ids'],_['omit'](_0x2dc4ee[_0x7b6a('0x5e')],['ids','id'])||{})['then'](function(){for(var _0x4e0d7d=0x0;_0x4e0d7d<_0x2dc4ee[_0x7b6a('0x5e')][_0x7b6a('0x62')][_0x7b6a('0x4d')];_0x4e0d7d++){var _0x1540af=[];var _0x4cb1cd={};db['Team'][_0x7b6a('0x97')]({'where':{'id':_0x2dc4ee[_0x7b6a('0x5e')]['ids'][_0x4e0d7d]}})[_0x7b6a('0x14')](function(_0x287609){_0x4cb1cd=_0x287609[_0x7b6a('0x4f')];_0x1540af[_0x7b6a('0x49')](_0x287609[_0x7b6a('0xf8')]()[_0x7b6a('0x14')](function(_0xb431cd){for(var _0x518486=0x0;_0x518486<_0xb431cd[_0x7b6a('0x4d')];_0x518486++){_0xb431cd[_0x518486]['setDataValue']('channel',_0x7b6a('0x112'));}return _0xb431cd;}));_0x1540af['push'](_0x287609['getChatQueues']()[_0x7b6a('0x14')](function(_0x5e7a9e){for(var _0x4af890=0x0;_0x4af890<_0x5e7a9e[_0x7b6a('0x4d')];_0x4af890++){_0x5e7a9e[_0x4af890][_0x7b6a('0x113')]('channel',_0x7b6a('0x114'));}return _0x5e7a9e;}));_0x1540af['push'](_0x287609[_0x7b6a('0x115')]()[_0x7b6a('0x14')](function(_0x159979){for(var _0x466d0b=0x0;_0x466d0b<_0x159979[_0x7b6a('0x4d')];_0x466d0b++){_0x159979[_0x466d0b][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x116'));}return _0x159979;}));_0x1540af[_0x7b6a('0x49')](_0x287609['getSmsQueues']()[_0x7b6a('0x14')](function(_0x217b37){for(var _0x448cd2=0x0;_0x448cd2<_0x217b37['length'];_0x448cd2++){_0x217b37[_0x448cd2]['setDataValue'](_0x7b6a('0x9d'),'Sms');}return _0x217b37;}));_0x1540af['push'](_0x287609[_0x7b6a('0x117')]()[_0x7b6a('0x14')](function(_0x345094){for(var _0x18b0ca=0x0;_0x18b0ca<_0x345094[_0x7b6a('0x4d')];_0x18b0ca++){_0x345094[_0x18b0ca]['setDataValue'](_0x7b6a('0x9d'),'Whatsapp');}return _0x345094;}));_0x1540af['push'](_0x287609[_0x7b6a('0x118')]()[_0x7b6a('0x14')](function(_0x34ec07){for(var _0x1c9ecf=0x0;_0x1c9ecf<_0x34ec07['length'];_0x1c9ecf++){_0x34ec07[_0x1c9ecf][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x119'));}return _0x34ec07;}));_0x1540af[_0x7b6a('0x49')](_0x287609[_0x7b6a('0x11a')]()[_0x7b6a('0x14')](function(_0x1a74fc){for(var _0x36648b=0x0;_0x36648b<_0x1a74fc[_0x7b6a('0x4d')];_0x36648b++){_0x1a74fc[_0x36648b][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x11b'));}return _0x1a74fc;}));return BPromise['all'](_0x1540af);})['then'](function(_0x2f42ec){var _0x269fcc=_[_0x7b6a('0x11c')](_0x2f42ec);_0x1540af=[];return db[_0x7b6a('0x6b')][_0x7b6a('0x11d')](function(_0x70ee8b){for(var _0x5d7e9b=0x0;_0x5d7e9b<_0x269fcc[_0x7b6a('0x4d')];_0x5d7e9b++){_0x1540af[_0x7b6a('0x49')](_0x269fcc[_0x5d7e9b][_0x7b6a('0x11e')](_0x2c6320['id']),{'transaction':_0x70ee8b});}return BPromise[_0x7b6a('0x53')](_0x1540af)[_0x7b6a('0x14')](function(){if(_0x2c6320[_0x7b6a('0x9e')]){return BPromise['each'](_['filter'](_0x269fcc,function(_0x4241a2){return _0x4241a2['getDataValue'](_0x7b6a('0x9d'))===_0x7b6a('0x112');}),function(_0x274772){return db[_0x7b6a('0xab')][_0x7b6a('0xac')]({'membername':_0x2c6320[_0x7b6a('0x37')],'UserId':_0x2c6320['id'],'queue_name':_0x274772[_0x7b6a('0x37')],'VoiceQueueId':_0x274772['id'],'interface':_[_0x7b6a('0x68')](_0x2c6320[_0x7b6a('0xa9')])?util[_0x7b6a('0xed')]('SIP/%s',_0x2c6320['name']):_0x2c6320[_0x7b6a('0xa9')],'paused':_0x2c6320[_0x7b6a('0xa0')]||![],'penalty':_0x2c6320['penalty']},{'transaction':_0x70ee8b});});}else{return;}})[_0x7b6a('0x14')](function(){for(var _0x59682e=0x0;_0x59682e<_0x269fcc[_0x7b6a('0x4d')];_0x59682e++){var _0x3c3987=_0x269fcc[_0x59682e][_0x7b6a('0x11f')](_0x7b6a('0x9d'));var _0x4e1690=_0x3c3987+_0x7b6a('0xa5');socket[_0x7b6a('0xb0')]('user'+_0x3c3987+_0x7b6a('0xa6'),{'UserId':_0x2c6320['id'],['queueField']:_0x269fcc[_0x59682e]['id']});}});});})['then'](function(){db[_0x7b6a('0x120')][_0x7b6a('0x97')]({'where':{'teamId':_0x4cb1cd['id']}})[_0x7b6a('0x14')](function(_0x365002){if(_0x365002){db[_0x7b6a('0x121')][_0x7b6a('0x82')]({'UserId':_0x2dc4ee[_0x7b6a('0x55')]['id'],'VoicePrefixId':_0x365002['VoicePrefixId']});}});});}});}})[_0x7b6a('0x14')](respondWithStatusCode(_0x4c862f,null))[_0x7b6a('0x54')](handleError(_0x4c862f,null));};exports[_0x7b6a('0x122')]=function(_0x3fe93c,_0x29fdf1){return db['User'][_0x7b6a('0x97')]({'where':{'id':_0x3fe93c[_0x7b6a('0x55')]['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x29fdf1,null))[_0x7b6a('0x14')](function(_0x571ad4){if(_0x571ad4){var _0x100809=_0x571ad4[_0x7b6a('0x26')]({'plain':!![]});var _0x33254f=_0x3fe93c['query'][_0x7b6a('0x62')];return _0x571ad4['removeTeams'](_0x33254f)[_0x7b6a('0x14')](function(){for(var _0x373026=0x0;_0x373026<_0x33254f[_0x7b6a('0x4d')];_0x373026++){var _0x549030=[];var _0x123cb4={};db[_0x7b6a('0x110')][_0x7b6a('0x97')]({'where':{'id':_0x33254f[_0x373026]}})[_0x7b6a('0x14')](function(_0x528d46){_0x123cb4=_0x528d46[_0x7b6a('0x4f')];_0x549030['push'](_0x528d46['getVoiceQueues']()[_0x7b6a('0x14')](function(_0x4c676b){for(var _0x17e5c2=0x0;_0x17e5c2<_0x4c676b['length'];_0x17e5c2++){_0x4c676b[_0x17e5c2][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x112'));}return _0x4c676b;}));_0x549030[_0x7b6a('0x49')](_0x528d46[_0x7b6a('0x123')]()['then'](function(_0x478ff9){for(var _0x51b568=0x0;_0x51b568<_0x478ff9[_0x7b6a('0x4d')];_0x51b568++){_0x478ff9[_0x51b568][_0x7b6a('0x113')]('channel',_0x7b6a('0x114'));}return _0x478ff9;}));_0x549030[_0x7b6a('0x49')](_0x528d46[_0x7b6a('0x115')]()['then'](function(_0x1b23ff){for(var _0x487451=0x0;_0x487451<_0x1b23ff[_0x7b6a('0x4d')];_0x487451++){_0x1b23ff[_0x487451][_0x7b6a('0x113')]('channel','Mail');}return _0x1b23ff;}));_0x549030[_0x7b6a('0x49')](_0x528d46['getSmsQueues']()['then'](function(_0x25c949){for(var _0xc9fbde=0x0;_0xc9fbde<_0x25c949[_0x7b6a('0x4d')];_0xc9fbde++){_0x25c949[_0xc9fbde][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x124'));}return _0x25c949;}));_0x549030[_0x7b6a('0x49')](_0x528d46[_0x7b6a('0x117')]()[_0x7b6a('0x14')](function(_0x41163d){for(var _0x352781=0x0;_0x352781<_0x41163d['length'];_0x352781++){_0x41163d[_0x352781][_0x7b6a('0x113')](_0x7b6a('0x9d'),'Whatsapp');}return _0x41163d;}));_0x549030[_0x7b6a('0x49')](_0x528d46[_0x7b6a('0x118')]()[_0x7b6a('0x14')](function(_0x3b7a08){for(var _0x2ef0fa=0x0;_0x2ef0fa<_0x3b7a08['length'];_0x2ef0fa++){_0x3b7a08[_0x2ef0fa][_0x7b6a('0x113')]('channel',_0x7b6a('0x119'));}return _0x3b7a08;}));_0x549030[_0x7b6a('0x49')](_0x528d46[_0x7b6a('0x11a')]()[_0x7b6a('0x14')](function(_0x48bb2b){for(var _0x2e228c=0x0;_0x2e228c<_0x48bb2b[_0x7b6a('0x4d')];_0x2e228c++){_0x48bb2b[_0x2e228c][_0x7b6a('0x113')](_0x7b6a('0x9d'),_0x7b6a('0x11b'));}return _0x48bb2b;}));return BPromise[_0x7b6a('0x53')](_0x549030);})[_0x7b6a('0x14')](function(_0x5a0ab7){var _0x587559=_[_0x7b6a('0x11c')](_0x5a0ab7);_0x549030=[];return db[_0x7b6a('0x6b')][_0x7b6a('0x11d')](function(_0x46af9d){for(var _0x28adf0=0x0;_0x28adf0<_0x587559[_0x7b6a('0x4d')];_0x28adf0++){_0x549030[_0x7b6a('0x49')](_0x587559[_0x28adf0][_0x7b6a('0x125')](_0x100809['id']),{'transaction':_0x46af9d});}return BPromise['all'](_0x549030)[_0x7b6a('0x14')](function(){if(_0x100809[_0x7b6a('0x9e')]){return BPromise[_0x7b6a('0xaa')](_['filter'](_0x587559,function(_0x39c7de){return _0x39c7de[_0x7b6a('0x11f')](_0x7b6a('0x9d'))===_0x7b6a('0x112');}),function(_0x27a1d0){return db[_0x7b6a('0xab')]['destroy']({'where':{'VoiceQueueId':_0x27a1d0['id'],'UserId':_0x100809['id']},'transaction':_0x46af9d});});}else{return;}})[_0x7b6a('0x14')](function(){db['TeamVoicePrefix'][_0x7b6a('0x97')]({'where':{'teamId':_0x123cb4['id']}})[_0x7b6a('0x14')](function(_0x51fca9){if(_0x51fca9){return db[_0x7b6a('0x121')][_0x7b6a('0x25')]({'where':{'UserId':_0x100809['id'],'VoicePrefixId':_0x51fca9[_0x7b6a('0x4f')][_0x7b6a('0x126')]}});}});})[_0x7b6a('0x14')](function(){for(var _0x9707de=0x0;_0x9707de<_0x587559[_0x7b6a('0x4d')];_0x9707de++){var _0x5cb658=_0x587559[_0x9707de][_0x7b6a('0x11f')]('channel');var _0x4ab5ae=_0x5cb658+_0x7b6a('0xa5');socket[_0x7b6a('0xb0')](_0x7b6a('0x29')+_0x5cb658+_0x7b6a('0xb1'),{'UserId':_0x100809['id'],['queueField']:_0x587559[_0x9707de]['id']});}});});});}});}})[_0x7b6a('0x14')](respondWithStatusCode(_0x29fdf1,null))['catch'](handleError(_0x29fdf1,null));};exports[_0x7b6a('0x127')]=function(_0x5d9b10,_0xf67620){var _0x4bb1f8={};var _0x388a1e={};var _0x5502ff;var _0x3f2999;return db['User'][_0x7b6a('0x97')]({'where':{'id':_0x5d9b10['params']['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0xf67620,null))[_0x7b6a('0x14')](function(_0x1a7662){if(_0x1a7662){_0x5502ff=_0x1a7662;_0x388a1e[_0x7b6a('0x56')]=_[_0x7b6a('0x58')](db['CmList'][_0x7b6a('0x3b')]);_0x388a1e[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x5d9b10['query']);_0x388a1e[_0x7b6a('0x59')]=_[_0x7b6a('0x5a')](_0x388a1e[_0x7b6a('0x56')],_0x388a1e[_0x7b6a('0x44')]);_0x4bb1f8[_0x7b6a('0x48')]=_[_0x7b6a('0x5a')](_0x388a1e['model'],qs['fields'](_0x5d9b10[_0x7b6a('0x44')][_0x7b6a('0xc6')]));_0x4bb1f8[_0x7b6a('0x48')]=_0x4bb1f8['attributes'][_0x7b6a('0x4d')]?_0x4bb1f8[_0x7b6a('0x48')]:_0x388a1e[_0x7b6a('0x56')];_0x4bb1f8[_0x7b6a('0xd4')]=qs['sort'](_0x5d9b10[_0x7b6a('0x44')]['sort']);_0x4bb1f8[_0x7b6a('0xc8')]=qs[_0x7b6a('0x59')](_[_0x7b6a('0xc9')](_0x5d9b10[_0x7b6a('0x44')],_0x388a1e['filters']));if(_0x5d9b10[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x4bb1f8[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x4bb1f8[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x4bb1f8['attributes'],function(_0x71a005){var _0x17fe2a={};_0x17fe2a[_0x71a005]={'$like':'%'+_0x5d9b10[_0x7b6a('0x44')][_0x7b6a('0x2e')]+'%'};return _0x17fe2a;})});}_0x4bb1f8=_['merge']({},_0x4bb1f8,_0x5d9b10[_0x7b6a('0x5b')]);return _0x5502ff[_0x7b6a('0x127')](_0x4bb1f8);}})[_0x7b6a('0x14')](function(_0x2ee2b3){if(_0x2ee2b3){_0x3f2999=_0x2ee2b3['length'];if(!_0x5d9b10['query'][_0x7b6a('0xcb')](_0x7b6a('0xd0'))){_0x4bb1f8[_0x7b6a('0xd1')]=qs['limit'](_0x5d9b10[_0x7b6a('0x44')][_0x7b6a('0xd1')]);_0x4bb1f8[_0x7b6a('0x21')]=qs[_0x7b6a('0x21')](_0x5d9b10['query']['offset']);}return _0x5502ff[_0x7b6a('0x127')](_0x4bb1f8);}})[_0x7b6a('0x14')](function(_0x1fa797){if(_0x1fa797){return _0x1fa797?{'count':_0x3f2999,'rows':_0x1fa797}:null;}})['then'](respondWithResult(_0xf67620,null))[_0x7b6a('0x54')](handleError(_0xf67620,null));};exports[_0x7b6a('0x128')]=function(_0x11c534,_0x201d01){var _0x31a0e4={};var _0x3414ae={};var _0x4633c4;return db[_0x7b6a('0x3a')][_0x7b6a('0x97')]({'where':{'id':_0x11c534['params']['id']}})[_0x7b6a('0x14')](handleEntityNotFound(_0x201d01,null))['then'](function(_0x47ac1c){if(_0x47ac1c){_0x4633c4=_0x47ac1c;_0x3414ae[_0x7b6a('0x56')]=_['keys'](db['User'][_0x7b6a('0x3b')]);_0x3414ae[_0x7b6a('0x44')]=_[_0x7b6a('0x58')](_0x11c534[_0x7b6a('0x44')]);_0x3414ae[_0x7b6a('0x59')]=_['intersection'](_0x3414ae[_0x7b6a('0x56')],_0x3414ae[_0x7b6a('0x44')]);_0x31a0e4['attributes']=_[_0x7b6a('0x5a')](_0x3414ae[_0x7b6a('0x56')],qs[_0x7b6a('0xc6')](_0x11c534[_0x7b6a('0x44')]['fields']));_0x31a0e4[_0x7b6a('0x48')]=_0x31a0e4[_0x7b6a('0x48')][_0x7b6a('0x4d')]?_0x31a0e4[_0x7b6a('0x48')]:_0x3414ae['model'];_0x31a0e4[_0x7b6a('0xd4')]=qs[_0x7b6a('0xc7')](_0x11c534[_0x7b6a('0x44')][_0x7b6a('0xc7')]);_0x31a0e4[_0x7b6a('0xc8')]=qs['filters'](_[_0x7b6a('0xc9')](_0x11c534['query'],_0x3414ae[_0x7b6a('0x59')]));if(_0x11c534[_0x7b6a('0x44')][_0x7b6a('0x2e')]){_0x31a0e4[_0x7b6a('0xc8')]=_[_0x7b6a('0xca')](_0x31a0e4[_0x7b6a('0xc8')],{'$or':_[_0x7b6a('0x30')](_0x31a0e4[_0x7b6a('0x48')],function(_0x562cfb){var _0x196474={};_0x196474[_0x562cfb]={'$like':'%'+_0x11c534[_0x7b6a('0x44')]['filter']+'%'};return _0x196474;})});}_0x31a0e4[_0x7b6a('0x56')]=db[_0x7b6a('0x3a')];_0x31a0e4['as']=_0x7b6a('0x2a');_0x31a0e4=_[_0x7b6a('0xca')]({},_0x31a0e4,_0x11c534['options']);return _0x4633c4[_0x7b6a('0xf8')]({'include':[_0x31a0e4]});}})['then'](function(_0x4d238b){if(_0x4d238b){var _0x5e800f={},_0x157003=[];for(var _0x6a1099=0x0;_0x6a1099<_0x4d238b[_0x7b6a('0x4d')];_0x6a1099+=0x1){for(var _0x4d30de=0x0,_0xfda24c;_0x4d30de<_0x4d238b[_0x6a1099][_0x7b6a('0x2a')][_0x7b6a('0x4d')];_0x4d30de+=0x1){_0xfda24c=_0x4d238b[_0x6a1099]['Agents'][_0x4d30de][_0x7b6a('0x26')]({'plain':!![]});_0x5e800f[_0xfda24c['id']]=_0xfda24c;}}_0x5e800f=_[_0x7b6a('0x129')](_0x5e800f);for(var _0x4e46cc=qs['offset'](_0x11c534['query']['offset']);_0x4e46cc<_0x5e800f[_0x7b6a('0x4d')]&&_0x157003['length']=_0x8a5552['agents']){throw new Error(_0x71da('0x54'));}})[_0x71da('0x23')](function(){if(_0x706c5b){return db[_0x71da('0x2a')][_0x71da('0x4a')]({'where':{'membername':_0x706c5b[_0x71da('0x2d')]},'individualHooks':!![]});}})[_0x71da('0x23')](function(){if(_0x706c5b){return _0x706c5b[_0x71da('0x55')]({'raw':!![]});}})[_0x71da('0x23')](function(_0x29b0a3){if(_0x706c5b){if(_0x29b0a3){var _0x4a2371=[];_0xb13551=_0x29b0a3;if(_0xb13551['length']){for(var _0x5f4977=0x0;_0x5f4977<_0xb13551[_0x71da('0x2f')];_0x5f4977++){_0x4a2371[_0x71da('0x34')](db[_0x71da('0x2a')][_0x71da('0x56')]({'membername':_0x706c5b[_0x71da('0x2d')],'UserId':_0x706c5b['id'],'queue_name':_0xb13551[_0x5f4977][_0x71da('0x2d')],'VoiceQueueId':_0xb13551[_0x5f4977]['id'],'interface':_0xf119d3,'paused':_0x706c5b[_0x71da('0x4e')]||![],'penalty':_0xb13551[_0x5f4977][_0x71da('0x57')]||0x0}));}return BPromise['all'](_0x4a2371);}}}})[_0x71da('0x23')](function(){if(_0x706c5b){return db[_0x71da('0x2c')][_0x71da('0x1b')]({'where':{'membername':_0x706c5b[_0x71da('0x2d')],'exitAt':null}});}})[_0x71da('0x23')](function(_0x3b8187){if(_0x706c5b){if(_0x3b8187&&_0x3b8187[_0x71da('0x2f')]){var _0xba6112=[];_0x3b8187[_0x71da('0x33')](function(_0x24dc60){_0xba6112[_0x71da('0x34')](_0x24dc60['update']({'exitAt':moment()['format'](_0x71da('0x36'))}));});return BPromise[_0x71da('0x48')](_0xba6112);}}})[_0x71da('0x23')](function(_0x56d49e){if(_0x706c5b){var _0x21c0c6=[];var _0x311181=[];var _0x54047c=utils['getChannels']();var _0x55c415={'membername':_0x706c5b[_0x71da('0x2d')],'interface':_0xf119d3,'enterAt':moment()[_0x71da('0x30')](_0x71da('0x36')),'role':_0x706c5b[_0x71da('0x58')],'internal':_0x706c5b[_0x71da('0x28')]};_0x54047c[_0x71da('0x33')](function(_0x465f74){_0x21c0c6[_0x71da('0x34')](_['merge']({'channel':_0x465f74,'type':_0x71da('0x59'),'data1':_0x71da('0x5a'),'data2':_0xf119d3},_0x55c415));if(_0x706c5b['loginInPause']){_0x311181['push'](_[_0x71da('0x5b')]({'channel':_0x465f74,'type':_0x71da('0x2e'),'data1':_0x71da('0x5c')},_0x55c415));}});return db[_0x71da('0x2c')][_0x71da('0x3b')](_0x21c0c6[_0x71da('0x5d')](_0x311181),{'individualHooks':!![]});}})[_0x71da('0x23')](function(){if(_0x706c5b){return _0x706c5b[_0x71da('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x71da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x706c5b[_0x71da('0x4e')]||![],'mailPause':_0x706c5b[_0x71da('0x4e')]||![],'chatPause':_0x706c5b['loginInPause']||![],'faxPause':_0x706c5b[_0x71da('0x4e')]||![],'smsPause':_0x706c5b[_0x71da('0x4e')]||![],'openchannelPause':_0x706c5b[_0x71da('0x4e')]||![],'pauseType':_0x706c5b[_0x71da('0x4e')]?_0x71da('0x5c'):null,'lastPauseAt':moment()[_0x71da('0x30')](_0x71da('0x36')),'interface':_0xf119d3});}})[_0x71da('0x23')](function(_0xe1c247){_0x8840eb(_0xe1c247);})['catch'](function(_0x4a7e10){_0xeedf87(_0x3702e5[_0x71da('0x15')](0x1f4,_0x4a7e10[_0x71da('0x17')]));});});}; \ No newline at end of file +var _0xd7af=['getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','upsert','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','User','findAll','options','raw','where','attributes','limit','include','model','map','GetUser','catch','ShowUser','find','stringify','PauseUser','name','role','internal','interface','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','SIP/%s','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','body','isValidChannel','channel','voice','UserVoiceQueueRt','system','mail','fax','openchannel','whatsapp','set','%s%s','Pause','forEach','all','LogoutUser','mobile','phone','loginInPause','count','agent'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xd7af,0xbd));var _0xfd7a=function(_0x17aa38,_0x54fb7a){_0x17aa38=_0x17aa38-0x0;var _0x1742cb=_0xd7af[_0x17aa38];return _0x1742cb;};'use strict';var _=require(_0xfd7a('0x0'));var util=require(_0xfd7a('0x1'));var moment=require(_0xfd7a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7a('0x3'));var db=require(_0xfd7a('0x4'))['db'];var utils=require(_0xfd7a('0x5'));var logger=require(_0xfd7a('0x6'))(_0xfd7a('0x7'));var config=require(_0xfd7a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd7a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfd7a('0xa')],{'host':_0xfd7a('0xb'),'port':0x18eb});var socket=require(_0xfd7a('0xc'))(new Redis(config[_0xfd7a('0xa')]));require('./user.socket')[_0xfd7a('0xd')](socket);function respondWithRpcPromise(_0x3c1687,_0x58621f,_0x2d4a12){return new BPromise(function(_0x20ea6c,_0xfe60fe){return client[_0xfd7a('0xe')](_0x3c1687,_0x2d4a12)[_0xfd7a('0xf')](function(_0x57b0cf){logger[_0xfd7a('0x10')](_0xfd7a('0x11'),_0x58621f,_0xfd7a('0x12'));logger[_0xfd7a('0x13')](_0xfd7a('0x14'),_0x58621f,_0xfd7a('0x12'),JSON['stringify'](_0x57b0cf));if(_0x57b0cf['error']){if(_0x57b0cf[_0xfd7a('0x15')][_0xfd7a('0x16')]===0x1f4){logger[_0xfd7a('0x15')]('User,\x20%s,\x20%s',_0x58621f,_0x57b0cf['error'][_0xfd7a('0x17')]);return _0xfe60fe(_0x57b0cf[_0xfd7a('0x15')][_0xfd7a('0x17')]);}logger[_0xfd7a('0x15')](_0xfd7a('0x11'),_0x58621f,_0x57b0cf[_0xfd7a('0x15')][_0xfd7a('0x17')]);return _0x20ea6c(_0x57b0cf['error'][_0xfd7a('0x17')]);}else{logger[_0xfd7a('0x10')]('User,\x20%s,\x20%s',_0x58621f,_0xfd7a('0x12'));_0x20ea6c(_0x57b0cf[_0xfd7a('0x18')][_0xfd7a('0x17')]);}})['catch'](function(_0x520915){logger[_0xfd7a('0x15')](_0xfd7a('0x11'),_0x58621f,_0x520915);_0xfe60fe(_0x520915);});});}exports['GetUser']=function(_0x5bd66b){var _0xc61fc0=this;return new Promise(function(_0x15b53f,_0x2e2715){return db[_0xfd7a('0x19')][_0xfd7a('0x1a')]({'raw':_0x5bd66b[_0xfd7a('0x1b')]?_0x5bd66b[_0xfd7a('0x1b')][_0xfd7a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bd66b[_0xfd7a('0x1b')]?_0x5bd66b[_0xfd7a('0x1b')][_0xfd7a('0x1d')]||null:null,'attributes':_0x5bd66b['options']?_0x5bd66b[_0xfd7a('0x1b')][_0xfd7a('0x1e')]||null:null,'limit':_0x5bd66b[_0xfd7a('0x1b')]?_0x5bd66b['options'][_0xfd7a('0x1f')]||null:null,'include':_0x5bd66b['options']?_0x5bd66b[_0xfd7a('0x1b')][_0xfd7a('0x20')]?_['map'](_0x5bd66b['options'][_0xfd7a('0x20')],function(_0x5f041){return{'model':db[_0x5f041[_0xfd7a('0x21')]],'as':_0x5f041['as'],'attributes':_0x5f041[_0xfd7a('0x1e')],'include':_0x5f041[_0xfd7a('0x20')]?_[_0xfd7a('0x22')](_0x5f041['include'],function(_0x51a88b){return{'model':db[_0x51a88b['model']],'as':_0x51a88b['as'],'attributes':_0x51a88b[_0xfd7a('0x1e')],'include':_0x51a88b[_0xfd7a('0x20')]?_[_0xfd7a('0x22')](_0x51a88b['include'],function(_0x10f12b){return{'model':db[_0x10f12b[_0xfd7a('0x21')]],'as':_0x10f12b['as'],'attributes':_0x10f12b[_0xfd7a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfd7a('0xf')](function(_0x102eec){logger[_0xfd7a('0x10')]('GetUser',_0x5bd66b);logger['debug'](_0xfd7a('0x23'),_0x5bd66b,JSON['stringify'](_0x102eec));_0x15b53f(_0x102eec);})[_0xfd7a('0x24')](function(_0x26a120){logger[_0xfd7a('0x15')](_0xfd7a('0x23'),_0x26a120['message'],_0x5bd66b);_0x2e2715(_0xc61fc0['error'](0x1f4,_0x26a120['message']));});});};exports[_0xfd7a('0x25')]=function(_0x2fa12e){var _0x3d8bc3=this;return new Promise(function(_0x5d1c27,_0x314cea){return db['User'][_0xfd7a('0x26')]({'raw':_0x2fa12e[_0xfd7a('0x1b')]?_0x2fa12e[_0xfd7a('0x1b')][_0xfd7a('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fa12e['options']?_0x2fa12e[_0xfd7a('0x1b')]['where']||null:null,'attributes':_0x2fa12e[_0xfd7a('0x1b')]?_0x2fa12e[_0xfd7a('0x1b')]['attributes']||null:null,'include':_0x2fa12e[_0xfd7a('0x1b')]?_0x2fa12e[_0xfd7a('0x1b')]['include']?_['map'](_0x2fa12e['options'][_0xfd7a('0x20')],function(_0x5e08df){return{'model':db[_0x5e08df['model']],'as':_0x5e08df['as'],'attributes':_0x5e08df[_0xfd7a('0x1e')],'include':_0x5e08df[_0xfd7a('0x20')]?_[_0xfd7a('0x22')](_0x5e08df[_0xfd7a('0x20')],function(_0x358160){return{'model':db[_0x358160[_0xfd7a('0x21')]],'as':_0x358160['as'],'attributes':_0x358160[_0xfd7a('0x1e')],'include':_0x358160[_0xfd7a('0x20')]?_['map'](_0x358160['include'],function(_0x40f90c){return{'model':db[_0x40f90c[_0xfd7a('0x21')]],'as':_0x40f90c['as'],'attributes':_0x40f90c['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd7a('0xf')](function(_0x5f4223){logger[_0xfd7a('0x10')](_0xfd7a('0x25'),_0x2fa12e);logger['debug']('ShowUser',_0x2fa12e,JSON[_0xfd7a('0x27')](_0x5f4223));_0x5d1c27(_0x5f4223);})[_0xfd7a('0x24')](function(_0x2a8514){logger[_0xfd7a('0x15')](_0xfd7a('0x25'),_0x2a8514['message'],_0x2fa12e);_0x314cea(_0x3d8bc3['error'](0x1f4,_0x2a8514['message']));});});};exports[_0xfd7a('0x28')]=function(_0x16c745){var _0x3083fc=this;return new Promise(function(_0x530e,_0x2bd352){var _0x4629f4;return db[_0xfd7a('0x19')][_0xfd7a('0x26')]({'where':_0x16c745[_0xfd7a('0x1b')][_0xfd7a('0x1d')]||{},'attributes':['id',_0xfd7a('0x29'),_0xfd7a('0x2a'),_0xfd7a('0x2b'),_0xfd7a('0x2c')]})[_0xfd7a('0xf')](function(_0x2ee1b5){if(_0x2ee1b5){_0x4629f4=_0x2ee1b5;return db['UserVoiceQueueRt'][_0xfd7a('0x2d')]({'paused':0x1},{'where':{'UserId':_0x4629f4['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4629f4){return db[_0xfd7a('0x2e')]['findAll']({'where':{'membername':_0x4629f4[_0xfd7a('0x29')],'type':_0xfd7a('0x2f'),'exitAt':null}});}})[_0xfd7a('0xf')](function(_0x4cac29){if(_0x4629f4){if(_0x4cac29&&_0x4cac29[_0xfd7a('0x30')]){var _0x2e5e3f=moment()[_0xfd7a('0x31')](_0xfd7a('0x32'));for(var _0xf6133c=0x0,_0x16cd13=_0x4cac29[_0xfd7a('0x30')];_0xf6133c<_0x16cd13;_0xf6133c++){_0x4cac29[_0xf6133c][_0xfd7a('0x33')]({'exitAt':_0x2e5e3f});}}}})['then'](function(){if(_0x4629f4){var _0x2d522b=[];var _0x4c5d1d=utils[_0xfd7a('0x34')]();_0x4c5d1d['forEach'](function(_0x5b083e){_0x2d522b[_0xfd7a('0x35')]({'channel':_0x5b083e,'membername':_0x4629f4[_0xfd7a('0x29')],'interface':_[_0xfd7a('0x36')](_0x4629f4['interface'])?util['format'](_0xfd7a('0x37'),_0x4629f4[_0xfd7a('0x29')]):_0x4629f4[_0xfd7a('0x2c')],'type':'PAUSE','enterAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'data1':_0x16c745['body']['type']||_0xfd7a('0x38'),'role':_0x4629f4[_0xfd7a('0x2a')],'internal':_0x4629f4[_0xfd7a('0x2b')],'uniqueid':_0x16c745['body'][_0xfd7a('0x39')]||null});});return db[_0xfd7a('0x2e')][_0xfd7a('0x3a')](_0x2d522b,{'individualHooks':!![]});}})[_0xfd7a('0xf')](function(){if(_0x4629f4){return _0x4629f4[_0xfd7a('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x16c745['body']['type']||_0xfd7a('0x38'),'lastPauseAt':moment()['format'](_0xfd7a('0x32'))});}})[_0xfd7a('0xf')](function(_0x4d88fb){_0x530e(_0x4d88fb);})['catch'](function(_0x35ad52){_0x2bd352(_0x3083fc['error'](0x1f4,_0x35ad52[_0xfd7a('0x17')]));});});};exports[_0xfd7a('0x3b')]=function(_0x1ddb4e){var _0xd3fdf2=this;return new Promise(function(_0x55d0a7,_0x225f2c){var _0x58a36d;return db['User']['findOne']({'where':_0x1ddb4e[_0xfd7a('0x1b')][_0xfd7a('0x1d')]||{},'attributes':['id',_0xfd7a('0x29')]})[_0xfd7a('0xf')](function(_0x5e38c2){if(_0x5e38c2){_0x58a36d=_0x5e38c2;if(_0x1ddb4e[_0xfd7a('0x3c')]['channel']&&!utils[_0xfd7a('0x3d')](_0x1ddb4e[_0xfd7a('0x3c')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x1ddb4e[_0xfd7a('0x3c')][_0xfd7a('0x3e')]){case _0xfd7a('0x3f'):return db[_0xfd7a('0x40')][_0xfd7a('0x2d')]({'paused':0x0},{'where':{'UserId':_0x58a36d['id']}})[_0xfd7a('0xf')](function(){return db[_0xfd7a('0x2e')]['find']({'where':{'channel':_0x1ddb4e[_0xfd7a('0x3c')][_0xfd7a('0x3e')],'membername':_0x58a36d[_0xfd7a('0x29')],'type':_0xfd7a('0x2f'),'exitAt':null}});})[_0xfd7a('0xf')](function(_0xbed8c7){if(_0xbed8c7){return _0xbed8c7[_0xfd7a('0x2d')]({'exitAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'data2':_0xfd7a('0x41')},{'individualHooks':!![]});}return null;})[_0xfd7a('0xf')](function(){return _0x58a36d[_0xfd7a('0x2d')]({'voicePause':![]});});case _0xfd7a('0x42'):case'chat':case _0xfd7a('0x43'):case'sms':case _0xfd7a('0x44'):case _0xfd7a('0x45'):return db[_0xfd7a('0x2e')][_0xfd7a('0x26')]({'where':{'channel':_0x1ddb4e[_0xfd7a('0x3c')][_0xfd7a('0x3e')],'membername':_0x58a36d[_0xfd7a('0x29')],'type':_0xfd7a('0x2f'),'exitAt':null}})[_0xfd7a('0xf')](function(_0x328140){return _0x328140[_0xfd7a('0x2d')]({'exitAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'data2':_0xfd7a('0x41')},{'individualHooks':!![]});})[_0xfd7a('0xf')](function(){var _0x90f1a0={};_[_0xfd7a('0x46')](_0x90f1a0,util[_0xfd7a('0x31')](_0xfd7a('0x47'),_0x1ddb4e[_0xfd7a('0x3c')][_0xfd7a('0x3e')],_0xfd7a('0x48')),![]);return _0x58a36d[_0xfd7a('0x2d')](_0x90f1a0);});default:return db[_0xfd7a('0x40')][_0xfd7a('0x2d')]({'paused':0x0},{'where':{'UserId':_0x58a36d['id']}})[_0xfd7a('0xf')](function(){return db[_0xfd7a('0x2e')][_0xfd7a('0x1a')]({'where':{'membername':_0x58a36d[_0xfd7a('0x29')],'type':_0xfd7a('0x2f'),'exitAt':null}});})[_0xfd7a('0xf')](function(_0x2b0de1){var _0xa0ef41=[];_0x2b0de1[_0xfd7a('0x49')](function(_0x452367){_0xa0ef41[_0xfd7a('0x35')](_0x452367[_0xfd7a('0x2d')]({'exitAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'data2':_0xfd7a('0x41')}));});return BPromise[_0xfd7a('0x4a')](_0xa0ef41);})['then'](function(){return _0x58a36d[_0xfd7a('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xfd7a('0xf')](function(_0xcd6aed){_0x55d0a7(_0xcd6aed);})['catch'](function(_0x52b515){_0x225f2c(_0xd3fdf2[_0xfd7a('0x15')](0x1f4,_0x52b515['message']));});});};exports[_0xfd7a('0x4b')]=function(_0x228952){var _0x20dd4e=this;return new Promise(function(_0x3ea0da,_0x32078c){var _0x1a80dd;return db[_0xfd7a('0x19')]['findOne']({'where':_0x228952['options']['where']||{},'attributes':['id','name']})[_0xfd7a('0xf')](function(_0x299a6f){if(_0x299a6f){_0x1a80dd=_0x299a6f;return db[_0xfd7a('0x40')]['destroy']({'where':{'membername':_0x1a80dd['name']},'individualHooks':!![]});}})['then'](function(){if(_0x1a80dd){return db[_0xfd7a('0x2e')]['findAll']({'where':{'membername':_0x1a80dd[_0xfd7a('0x29')],'exitAt':null}});}})['then'](function(_0x20c6ab){if(_0x1a80dd){if(_0x20c6ab&&_0x20c6ab['length']){var _0x2f3f53=[];_0x20c6ab[_0xfd7a('0x49')](function(_0x579f33){_0x2f3f53[_0xfd7a('0x35')](_0x579f33[_0xfd7a('0x2d')]({'exitAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32'))}));});return BPromise[_0xfd7a('0x4a')](_0x2f3f53);}}})[_0xfd7a('0xf')](function(){if(_0x1a80dd){return _0x1a80dd['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xfd7a('0xf')](function(_0x57a583){_0x3ea0da(_0x57a583);})[_0xfd7a('0x24')](function(_0x475ede){_0x32078c(_0x20dd4e[_0xfd7a('0x15')](0x1f4,_0x475ede['message']));});});};exports['LoginUser']=function(_0x3fa4ca){var _0x2c46de=this;return new Promise(function(_0x4dbc08,_0x2ab0c8){var _0x439368;var _0x436e34;var _0xbacc9b;var _0x570cf0;return db[_0xfd7a('0x19')]['findOne']({'where':_0x3fa4ca['options'][_0xfd7a('0x1d')]||{},'attributes':['id',_0xfd7a('0x29'),'role',_0xfd7a('0x4c'),_0xfd7a('0x4d'),_0xfd7a('0x2b'),_0xfd7a('0x4e'),_0xfd7a('0x2c')]})['then'](function(_0x4f4ece){if(_0x4f4ece){_0x439368=_0x4f4ece;_0x570cf0=_0x3fa4ca[_0xfd7a('0x3c')][_0xfd7a('0x2c')]?_0x3fa4ca[_0xfd7a('0x3c')][_0xfd7a('0x2c')]:util[_0xfd7a('0x31')](_0xfd7a('0x37'),_0x439368['name']);return db[_0xfd7a('0x19')][_0xfd7a('0x4f')]({'where':{'role':_0xfd7a('0x50'),'online':!![],'id':{'$ne':_0x439368['id']}}});}})[_0xfd7a('0xf')](function(_0x32597a){if(_0x32597a){_0xbacc9b=_0x32597a;return require('../../config/license/util')[_0xfd7a('0x51')]();}})[_0xfd7a('0xf')](function(_0x4b028e){if(_0x4b028e&&_0x4b028e[_0xfd7a('0x52')]&&_0xbacc9b>=_0x4b028e[_0xfd7a('0x52')]){throw new Error(_0xfd7a('0x53'));}})['then'](function(){if(_0x439368){return db[_0xfd7a('0x40')][_0xfd7a('0x54')]({'where':{'membername':_0x439368[_0xfd7a('0x29')]},'individualHooks':!![]});}})[_0xfd7a('0xf')](function(){if(_0x439368){return _0x439368['getVoiceQueues']({'raw':!![]});}})[_0xfd7a('0xf')](function(_0x35a9dc){if(_0x439368){if(_0x35a9dc){var _0x1b94fb=[];_0x436e34=_0x35a9dc;if(_0x436e34[_0xfd7a('0x30')]){for(var _0x411471=0x0;_0x411471<_0x436e34[_0xfd7a('0x30')];_0x411471++){_0x1b94fb[_0xfd7a('0x35')](db[_0xfd7a('0x40')][_0xfd7a('0x55')]({'membername':_0x439368[_0xfd7a('0x29')],'UserId':_0x439368['id'],'queue_name':_0x436e34[_0x411471][_0xfd7a('0x29')],'VoiceQueueId':_0x436e34[_0x411471]['id'],'interface':_0x570cf0,'paused':_0x439368['loginInPause']||![],'penalty':_0x436e34[_0x411471]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xfd7a('0x4a')](_0x1b94fb);}}}})['then'](function(){if(_0x439368){return db[_0xfd7a('0x2e')][_0xfd7a('0x1a')]({'where':{'membername':_0x439368[_0xfd7a('0x29')],'exitAt':null}});}})[_0xfd7a('0xf')](function(_0x34998c){if(_0x439368){if(_0x34998c&&_0x34998c[_0xfd7a('0x30')]){var _0x48f582=[];_0x34998c[_0xfd7a('0x49')](function(_0x27fefd){_0x48f582['push'](_0x27fefd['update']({'exitAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32'))}));});return BPromise[_0xfd7a('0x4a')](_0x48f582);}}})['then'](function(_0x57558d){if(_0x439368){var _0x2b5902=[];var _0x5cec17=[];var _0x199b42=utils[_0xfd7a('0x34')]();var _0x184fa5={'membername':_0x439368[_0xfd7a('0x29')],'interface':_0x570cf0,'enterAt':moment()['format'](_0xfd7a('0x32')),'role':_0x439368[_0xfd7a('0x2a')],'internal':_0x439368[_0xfd7a('0x2b')]};_0x199b42[_0xfd7a('0x49')](function(_0x160b2d){_0x2b5902[_0xfd7a('0x35')](_[_0xfd7a('0x56')]({'channel':_0x160b2d,'type':'LOGIN','data1':_0xfd7a('0x57'),'data2':_0x570cf0},_0x184fa5));if(_0x439368[_0xfd7a('0x4e')]){_0x5cec17[_0xfd7a('0x35')](_[_0xfd7a('0x56')]({'channel':_0x160b2d,'type':_0xfd7a('0x2f'),'data1':_0xfd7a('0x58')},_0x184fa5));}});return db[_0xfd7a('0x2e')]['bulkCreate'](_0x2b5902[_0xfd7a('0x59')](_0x5cec17),{'individualHooks':!![]});}})[_0xfd7a('0xf')](function(){if(_0x439368){return _0x439368[_0xfd7a('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'voicePause':_0x439368[_0xfd7a('0x4e')]||![],'mailPause':_0x439368[_0xfd7a('0x4e')]||![],'chatPause':_0x439368[_0xfd7a('0x4e')]||![],'faxPause':_0x439368[_0xfd7a('0x4e')]||![],'smsPause':_0x439368['loginInPause']||![],'openchannelPause':_0x439368[_0xfd7a('0x4e')]||![],'pauseType':_0x439368[_0xfd7a('0x4e')]?_0xfd7a('0x58'):null,'lastPauseAt':moment()[_0xfd7a('0x31')](_0xfd7a('0x32')),'interface':_0x570cf0});}})[_0xfd7a('0xf')](function(_0x252d15){_0x4dbc08(_0x252d15);})[_0xfd7a('0x24')](function(_0x56788a){_0x2ab0c8(_0x2c46de[_0xfd7a('0x15')](0x1f4,_0x56788a['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6c7b106..307209e 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 _0xbe0c=['removeListener','register','length','user:','./user.events','save','update','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbe0c,0x11c));var _0xcbe0=function(_0x2d69e1,_0x43f881){_0x2d69e1=_0x2d69e1-0x0;var _0x9b5140=_0xbe0c[_0x2d69e1];return _0x9b5140;};'use strict';var UserEvents=require(_0xcbe0('0x0'));var events=[_0xcbe0('0x1'),'remove',_0xcbe0('0x2')];function createListener(_0x40c082,_0x2b4bde){return function(_0x19df21){_0x2b4bde[_0xcbe0('0x3')](_0x40c082,_0x19df21);};}function removeListener(_0x3d0a91,_0x1cc3d4){return function(){UserEvents[_0xcbe0('0x4')](_0x3d0a91,_0x1cc3d4);};}exports[_0xcbe0('0x5')]=function(_0x361809){for(var _0xfdb46c=0x0,_0x472229=events[_0xcbe0('0x6')];_0xfdb46c<_0x472229;_0xfdb46c++){var _0x381018=events[_0xfdb46c];var _0x58e21a=createListener(_0xcbe0('0x7')+_0x381018,_0x361809);UserEvents['on'](_0x381018,_0x58e21a);}}; \ No newline at end of file +var _0xd562=['user:','./user.events','save','update','emit','removeListener','length'];(function(_0xfcb0f1,_0x3f2d57){var _0x4ed14e=function(_0x29cc13){while(--_0x29cc13){_0xfcb0f1['push'](_0xfcb0f1['shift']());}};_0x4ed14e(++_0x3f2d57);}(_0xd562,0x1ac));var _0x2d56=function(_0x3fdc2d,_0x44dc47){_0x3fdc2d=_0x3fdc2d-0x0;var _0x2f6916=_0xd562[_0x3fdc2d];return _0x2f6916;};'use strict';var UserEvents=require(_0x2d56('0x0'));var events=[_0x2d56('0x1'),'remove',_0x2d56('0x2')];function createListener(_0x5193f1,_0x34bfa3){return function(_0x26b49e){_0x34bfa3[_0x2d56('0x3')](_0x5193f1,_0x26b49e);};}function removeListener(_0x5a8327,_0x2d5a4b){return function(){UserEvents[_0x2d56('0x4')](_0x5a8327,_0x2d5a4b);};}exports['register']=function(_0x559157){for(var _0xb5c646=0x0,_0x2365ec=events[_0x2d56('0x5')];_0xb5c646<_0x2365ec;_0xb5c646++){var _0x5f14fd=events[_0xb5c646];var _0x243983=createListener(_0x2d56('0x6')+_0x5f14fd,_0x559157);UserEvents['on'](_0x5f14fd,_0x243983);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index be992db..b419943 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3fea63,_0x1b68f1){var _0xc4442b=function(_0xa54494){while(--_0xa54494){_0x3fea63['push'](_0x3fea63['shift']());}};_0xc4442b(++_0x1b68f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3a465a,_0x3e8001){var _0x1ed244=function(_0x1349e9){while(--_0x1349e9){_0x3a465a['push'](_0x3a465a['shift']());}};_0x1ed244(++_0x3e8001);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 41319e1..66f6592 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 _0x01c0=['INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01c0,0x105));var _0x001c=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x01c0[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x001c('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x486e=['INTEGER','sequelize','exports'];(function(_0x877dbb,_0x4d00d5){var _0xc224a9=function(_0x29fb7f){while(--_0x29fb7f){_0x877dbb['push'](_0x877dbb['shift']());}};_0xc224a9(++_0x4d00d5);}(_0x486e,0xcd));var _0xe486=function(_0x2c3c18,_0x576f9b){_0x2c3c18=_0x2c3c18-0x0;var _0x2c0c42=_0x486e[_0x2c3c18];return _0x2c0c42;};'use strict';var Sequelize=require(_0xe486('0x0'));module[_0xe486('0x1')]={'penalty':{'type':Sequelize[_0xe486('0x2')],'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 372c71d..e933914 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 _0xf209=['path','rimraf','../../config/environment','exports','user_has_chat_queues','util','../../config/logger','api','bluebird'];(function(_0x31aa8f,_0x23216b){var _0x492ba2=function(_0x3b6cf4){while(--_0x3b6cf4){_0x31aa8f['push'](_0x31aa8f['shift']());}};_0x492ba2(++_0x23216b);}(_0xf209,0x10a));var _0x9f20=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0xf209[_0x550e29];return _0x3515b6;};'use strict';var _=require('lodash');var util=require(_0x9f20('0x0'));var logger=require(_0x9f20('0x1'))(_0x9f20('0x2'));var moment=require('moment');var BPromise=require(_0x9f20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f20('0x4'));var rimraf=require(_0x9f20('0x5'));var config=require(_0x9f20('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x9f20('0x7')]=function(_0x40c223,_0x5b6cc4){return _0x40c223['define']('UserChatQueue',attributes,{'tableName':_0x9f20('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x973c=['user_has_chat_queues','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue'];(function(_0x521b02,_0x45513f){var _0x26bacd=function(_0x4ce940){while(--_0x4ce940){_0x521b02['push'](_0x521b02['shift']());}};_0x26bacd(++_0x45513f);}(_0x973c,0x177));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var util=require('util');var logger=require(_0xc973('0x1'))('api');var moment=require(_0xc973('0x2'));var BPromise=require('bluebird');var rp=require(_0xc973('0x3'));var fs=require('fs');var path=require(_0xc973('0x4'));var rimraf=require(_0xc973('0x5'));var config=require(_0xc973('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xc973('0x7')]=function(_0x50d0e8,_0x512a5d){return _0x50d0e8[_0xc973('0x8')](_0xc973('0x9'),attributes,{'tableName':_0xc973('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 5c5ed8b..1bcdc91 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 _0x04c9=['rpc','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x04c9,0x94));var _0x904c=function(_0x48ea74,_0x26b38f){_0x48ea74=_0x48ea74-0x0;var _0x195602=_0x04c9[_0x48ea74];return _0x195602;};'use strict';var _=require('lodash');var util=require(_0x904c('0x0'));var moment=require(_0x904c('0x1'));var BPromise=require('bluebird');var rs=require(_0x904c('0x2'));var fs=require('fs');var Redis=require(_0x904c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x904c('0x4'));var logger=require('../../config/logger')(_0x904c('0x5'));var config=require('../../config/environment');var jayson=require(_0x904c('0x6'));var client=jayson['client'][_0x904c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40f177,_0x30fd0d,_0x1b03d8){return new BPromise(function(_0x177eb8,_0x174cc5){return client['request'](_0x40f177,_0x1b03d8)[_0x904c('0x8')](function(_0x2451b2){logger[_0x904c('0x9')](_0x904c('0xa'),_0x30fd0d,_0x904c('0xb'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x30fd0d,_0x904c('0xb'),JSON[_0x904c('0xc')](_0x2451b2));if(_0x2451b2['error']){if(_0x2451b2[_0x904c('0xd')]['code']===0x1f4){logger['error'](_0x904c('0xa'),_0x30fd0d,_0x2451b2[_0x904c('0xd')][_0x904c('0xe')]);return _0x174cc5(_0x2451b2[_0x904c('0xd')]['message']);}logger[_0x904c('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x30fd0d,_0x2451b2[_0x904c('0xd')][_0x904c('0xe')]);return _0x177eb8(_0x2451b2[_0x904c('0xd')][_0x904c('0xe')]);}else{logger[_0x904c('0x9')](_0x904c('0xa'),_0x30fd0d,_0x904c('0xb'));_0x177eb8(_0x2451b2[_0x904c('0xf')]['message']);}})[_0x904c('0x10')](function(_0x3fac67){logger[_0x904c('0xd')](_0x904c('0xa'),_0x30fd0d,_0x3fac67);_0x174cc5(_0x3fac67);});});} \ No newline at end of file +var _0xd7b8=['rpc','../../config/environment','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x10e1ec,_0x32f4fa){var _0x19009d=function(_0x231c98){while(--_0x231c98){_0x10e1ec['push'](_0x10e1ec['shift']());}};_0x19009d(++_0x32f4fa);}(_0xd7b8,0xd5));var _0x8d7b=function(_0x4cb4e4,_0xf22f36){_0x4cb4e4=_0x4cb4e4-0x0;var _0xbe63b2=_0xd7b8[_0x4cb4e4];return _0xbe63b2;};'use strict';var _=require(_0x8d7b('0x0'));var util=require('util');var moment=require(_0x8d7b('0x1'));var BPromise=require(_0x8d7b('0x2'));var rs=require(_0x8d7b('0x3'));var fs=require('fs');var Redis=require(_0x8d7b('0x4'));var db=require(_0x8d7b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d7b('0x6'))(_0x8d7b('0x7'));var config=require(_0x8d7b('0x8'));var jayson=require(_0x8d7b('0x9'));var client=jayson[_0x8d7b('0xa')][_0x8d7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd4f3,_0x551074,_0x516798){return new BPromise(function(_0x59f312,_0x5c4359){return client['request'](_0x2dd4f3,_0x516798)['then'](function(_0x5e8ac4){logger[_0x8d7b('0xc')](_0x8d7b('0xd'),_0x551074,_0x8d7b('0xe'));logger[_0x8d7b('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x551074,'request\x20sent',JSON[_0x8d7b('0x10')](_0x5e8ac4));if(_0x5e8ac4[_0x8d7b('0x11')]){if(_0x5e8ac4[_0x8d7b('0x11')][_0x8d7b('0x12')]===0x1f4){logger[_0x8d7b('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x551074,_0x5e8ac4[_0x8d7b('0x11')][_0x8d7b('0x13')]);return _0x5c4359(_0x5e8ac4['error']['message']);}logger[_0x8d7b('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x551074,_0x5e8ac4[_0x8d7b('0x11')][_0x8d7b('0x13')]);return _0x59f312(_0x5e8ac4['error']['message']);}else{logger['info'](_0x8d7b('0xd'),_0x551074,_0x8d7b('0xe'));_0x59f312(_0x5e8ac4[_0x8d7b('0x14')][_0x8d7b('0x13')]);}})[_0x8d7b('0x15')](function(_0x2080b7){logger['error'](_0x8d7b('0xd'),_0x551074,_0x2080b7);_0x5c4359(_0x2080b7);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ea7adb8..1bf9443 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf1e6f9,_0x527826){var _0x30556c=function(_0x1bbf75){while(--_0x1bbf75){_0xf1e6f9['push'](_0xf1e6f9['shift']());}};_0x30556c(++_0x527826);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3e7be2,_0xf2451){var _0x715f75=function(_0x587b02){while(--_0x587b02){_0x3e7be2['push'](_0x3e7be2['shift']());}};_0x715f75(++_0xf2451);}(_0x70e0,0x17b));var _0x070e=function(_0x1d2be9,_0x65f791){_0x1d2be9=_0x1d2be9-0x0;var _0x35d9fe=_0x70e0[_0x1d2be9];return _0x35d9fe;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 4de1ce5..302dc88 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 _0xc982=['STRING','INTEGER'];(function(_0x3b774b,_0x4a2aec){var _0x3f0759=function(_0x15ffa3){while(--_0x15ffa3){_0x3b774b['push'](_0x3b774b['shift']());}};_0x3f0759(++_0x4a2aec);}(_0xc982,0x139));var _0x2c98=function(_0x5e4633,_0x2cf0d0){_0x5e4633=_0x5e4633-0x0;var _0x3edbc0=_0xc982[_0x5e4633];return _0x3edbc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x2c98('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2c98('0x1')]}}; \ No newline at end of file +var _0x1b2e=['sequelize','INTEGER'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x1b2e,0x18c));var _0xe1b2=function(_0x5d02f4,_0x1f0924){_0x5d02f4=_0x5d02f4-0x0;var _0x3a97f4=_0x1b2e[_0x5d02f4];return _0x3a97f4;};'use strict';var Sequelize=require(_0xe1b2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe1b2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe1b2('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 878e72a..5d2de40 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 _0xc45c=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0xc45c,0x120));var _0xcc45=function(_0x4e8222,_0x1eb278){_0x4e8222=_0x4e8222-0x0;var _0x3ab653=_0xc45c[_0x4e8222];return _0x3ab653;};'use strict';var _=require(_0xcc45('0x0'));var util=require(_0xcc45('0x1'));var logger=require(_0xcc45('0x2'))(_0xcc45('0x3'));var moment=require('moment');var BPromise=require(_0xcc45('0x4'));var rp=require(_0xcc45('0x5'));var fs=require('fs');var path=require(_0xcc45('0x6'));var rimraf=require(_0xcc45('0x7'));var config=require(_0xcc45('0x8'));var attributes=require(_0xcc45('0x9'));module['exports']=function(_0x3d08f0,_0x3d3242){return _0x3d08f0[_0xcc45('0xa')](_0xcc45('0xb'),attributes,{'tableName':_0xcc45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ef9=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x4ef9,0x17f));var _0x94ef=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0x4ef9[_0x512f81];return _0xa15099;};'use strict';var _=require(_0x94ef('0x0'));var util=require(_0x94ef('0x1'));var logger=require(_0x94ef('0x2'))(_0x94ef('0x3'));var moment=require(_0x94ef('0x4'));var BPromise=require(_0x94ef('0x5'));var rp=require(_0x94ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94ef('0x7'));var config=require(_0x94ef('0x8'));var attributes=require(_0x94ef('0x9'));module[_0x94ef('0xa')]=function(_0x18c67e,_0x23828d){return _0x18c67e[_0x94ef('0xb')](_0x94ef('0xc'),attributes,{'tableName':_0x94ef('0xd'),'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 18168ff..f7601f1 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 _0x2baf=['catch','lodash','util','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3a2769,_0x2b2709){var _0x367197=function(_0x3242c8){while(--_0x3242c8){_0x3a2769['push'](_0x3a2769['shift']());}};_0x367197(++_0x2b2709);}(_0x2baf,0x16a));var _0xf2ba=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0x2baf[_0x418549];return _0x288826;};'use strict';var _=require(_0xf2ba('0x0'));var util=require(_0xf2ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf2ba('0x2'));var logger=require(_0xf2ba('0x3'))(_0xf2ba('0x4'));var config=require('../../config/environment');var jayson=require(_0xf2ba('0x5'));var client=jayson[_0xf2ba('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x200b04,_0x137a2c,_0x4fe21d){return new BPromise(function(_0x46115d,_0xf999f5){return client[_0xf2ba('0x7')](_0x200b04,_0x4fe21d)[_0xf2ba('0x8')](function(_0x14c960){logger[_0xf2ba('0x9')](_0xf2ba('0xa'),_0x137a2c,_0xf2ba('0xb'));logger[_0xf2ba('0xc')](_0xf2ba('0xd'),_0x137a2c,_0xf2ba('0xb'),JSON[_0xf2ba('0xe')](_0x14c960));if(_0x14c960[_0xf2ba('0xf')]){if(_0x14c960['error']['code']===0x1f4){logger[_0xf2ba('0xf')](_0xf2ba('0xa'),_0x137a2c,_0x14c960[_0xf2ba('0xf')][_0xf2ba('0x10')]);return _0xf999f5(_0x14c960[_0xf2ba('0xf')][_0xf2ba('0x10')]);}logger[_0xf2ba('0xf')](_0xf2ba('0xa'),_0x137a2c,_0x14c960[_0xf2ba('0xf')]['message']);return _0x46115d(_0x14c960['error']['message']);}else{logger[_0xf2ba('0x9')]('UserFaxQueue,\x20%s,\x20%s',_0x137a2c,_0xf2ba('0xb'));_0x46115d(_0x14c960[_0xf2ba('0x11')][_0xf2ba('0x10')]);}})[_0xf2ba('0x12')](function(_0x204601){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x137a2c,_0x204601);_0xf999f5(_0x204601);});});} \ No newline at end of file +var _0x1f4a=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x50d471,_0x2d9086){var _0x214900=function(_0x413fa1){while(--_0x413fa1){_0x50d471['push'](_0x50d471['shift']());}};_0x214900(++_0x2d9086);}(_0x1f4a,0xbb));var _0xa1f4=function(_0x172f62,_0x21a49c){_0x172f62=_0x172f62-0x0;var _0x472373=_0x1f4a[_0x172f62];return _0x472373;};'use strict';var _=require(_0xa1f4('0x0'));var util=require(_0xa1f4('0x1'));var moment=require(_0xa1f4('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1f4('0x5'))(_0xa1f4('0x6'));var config=require(_0xa1f4('0x7'));var jayson=require(_0xa1f4('0x8'));var client=jayson[_0xa1f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19aeac,_0x1feb3d,_0x50fb82){return new BPromise(function(_0x105447,_0x170df7){return client[_0xa1f4('0xa')](_0x19aeac,_0x50fb82)['then'](function(_0x484653){logger[_0xa1f4('0xb')](_0xa1f4('0xc'),_0x1feb3d,_0xa1f4('0xd'));logger[_0xa1f4('0xe')](_0xa1f4('0xf'),_0x1feb3d,_0xa1f4('0xd'),JSON[_0xa1f4('0x10')](_0x484653));if(_0x484653[_0xa1f4('0x11')]){if(_0x484653['error'][_0xa1f4('0x12')]===0x1f4){logger[_0xa1f4('0x11')](_0xa1f4('0xc'),_0x1feb3d,_0x484653[_0xa1f4('0x11')]['message']);return _0x170df7(_0x484653[_0xa1f4('0x11')][_0xa1f4('0x13')]);}logger[_0xa1f4('0x11')](_0xa1f4('0xc'),_0x1feb3d,_0x484653[_0xa1f4('0x11')][_0xa1f4('0x13')]);return _0x105447(_0x484653[_0xa1f4('0x11')][_0xa1f4('0x13')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x1feb3d,_0xa1f4('0xd'));_0x105447(_0x484653['result']['message']);}})['catch'](function(_0x5bd123){logger[_0xa1f4('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x1feb3d,_0x5bd123);_0x170df7(_0x5bd123);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index bcdbd85..1398f42 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x8631f5,_0x6c2a11){var _0x144c25=function(_0x224f99){while(--_0x224f99){_0x8631f5['push'](_0x8631f5['shift']());}};_0x144c25(++_0x6c2a11);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b56e5,_0x278d62){_0x2b56e5=_0x2b56e5-0x0;var _0x4ba401=_0xedd9[_0x2b56e5];return _0x4ba401;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x24b66b,_0x149f2a){var _0x1eac23=function(_0x3722d6){while(--_0x3722d6){_0x24b66b['push'](_0x24b66b['shift']());}};_0x1eac23(++_0x149f2a);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 527a3c5..7e5d12d 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 _0x99a8=['exports','INTEGER'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x99a8,0x102));var _0x899a=function(_0x4a97e3,_0x50fee4){_0x4a97e3=_0x4a97e3-0x0;var _0x7ca187=_0x99a8[_0x4a97e3];return _0x7ca187;};'use strict';var Sequelize=require('sequelize');module[_0x899a('0x0')]={'penalty':{'type':Sequelize[_0x899a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9917=['sequelize','INTEGER'];(function(_0x3b274b,_0x2df4de){var _0x526ebe=function(_0x203f75){while(--_0x203f75){_0x3b274b['push'](_0x3b274b['shift']());}};_0x526ebe(++_0x2df4de);}(_0x9917,0xe6));var _0x7991=function(_0x316d4f,_0x5926db){_0x316d4f=_0x316d4f-0x0;var _0x24501c=_0x9917[_0x316d4f];return _0x24501c;};'use strict';var Sequelize=require(_0x7991('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7991('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 8281b70..2799a71 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 _0x677c=['lodash','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues'];(function(_0x2ebbbb,_0x4045de){var _0x2bd9ea=function(_0x347d1e){while(--_0x347d1e){_0x2ebbbb['push'](_0x2ebbbb['shift']());}};_0x2bd9ea(++_0x4045de);}(_0x677c,0x1ce));var _0xc677=function(_0x5ccd78,_0x5af671){_0x5ccd78=_0x5ccd78-0x0;var _0x495b9d=_0x677c[_0x5ccd78];return _0x495b9d;};'use strict';var _=require(_0xc677('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc677('0x1'));var moment=require(_0xc677('0x2'));var BPromise=require(_0xc677('0x3'));var rp=require(_0xc677('0x4'));var fs=require('fs');var path=require(_0xc677('0x5'));var rimraf=require(_0xc677('0x6'));var config=require('../../config/environment');var attributes=require(_0xc677('0x7'));module[_0xc677('0x8')]=function(_0x752ae5,_0x1793f8){return _0x752ae5['define'](_0xc677('0x9'),attributes,{'tableName':_0xc677('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7367=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x3ff80b,_0x1acd10){var _0x5a6465=function(_0x4d7ac7){while(--_0x4d7ac7){_0x3ff80b['push'](_0x3ff80b['shift']());}};_0x5a6465(++_0x1acd10);}(_0x7367,0x166));var _0x7736=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7367[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7736('0x0'));var util=require(_0x7736('0x1'));var logger=require(_0x7736('0x2'))(_0x7736('0x3'));var moment=require('moment');var BPromise=require(_0x7736('0x4'));var rp=require(_0x7736('0x5'));var fs=require('fs');var path=require(_0x7736('0x6'));var rimraf=require(_0x7736('0x7'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x7736('0x8')]=function(_0x19340d,_0x599b05){return _0x19340d[_0x7736('0x9')](_0x7736('0xa'),attributes,{'tableName':_0x7736('0xb'),'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 f9a94f9..69dc747 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x43508f,_0x2ed68a){var _0x5a48b=function(_0xaeed76){while(--_0xaeed76){_0x43508f['push'](_0x43508f['shift']());}};_0x5a48b(++_0x2ed68a);}(_0xe14b,0x93));var _0xbe14=function(_0x2c4639,_0x93928e){_0x2c4639=_0x2c4639-0x0;var _0x2bc89d=_0xe14b[_0x2c4639];return _0x2bc89d;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x32b2f6,_0x43641e){_0x32b2f6=_0x32b2f6-0x0;var _0x3c2ec9=_0x1cb9[_0x32b2f6];return _0x3c2ec9;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 773d624..4cbc371 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x537f=['../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c05a2,_0x4c2ab6){var _0x290c57=function(_0x44b95d){while(--_0x44b95d){_0x1c05a2['push'](_0x1c05a2['shift']());}};_0x290c57(++_0x4c2ab6);}(_0x537f,0x17e));var _0xf537=function(_0x4508e0,_0x5f4cbc){_0x4508e0=_0x4508e0-0x0;var _0x3d0086=_0x537f[_0x4508e0];return _0x3d0086;};'use strict';var multer=require(_0xf537('0x0'));var util=require(_0xf537('0x1'));var path=require(_0xf537('0x2'));var timeout=require(_0xf537('0x3'));var express=require(_0xf537('0x4'));var router=express['Router']();var fs_extra=require(_0xf537('0x5'));var auth=require(_0xf537('0x6'));var interaction=require(_0xf537('0x7'));var config=require(_0xf537('0x8'));var controller=require(_0xf537('0x9'));router['post']('/',auth[_0xf537('0xa')](),controller[_0xf537('0xb')]);module[_0xf537('0xc')]=router; \ No newline at end of file +var _0x6fec=['../../components/interaction/service','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x6fec,0x122));var _0xc6fe=function(_0xd6a461,_0x6704ef){_0xd6a461=_0xd6a461-0x0;var _0x30d716=_0x6fec[_0xd6a461];return _0x30d716;};'use strict';var multer=require(_0xc6fe('0x0'));var util=require(_0xc6fe('0x1'));var path=require(_0xc6fe('0x2'));var timeout=require(_0xc6fe('0x3'));var express=require(_0xc6fe('0x4'));var router=express[_0xc6fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc6fe('0x6'));var interaction=require(_0xc6fe('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xc6fe('0x8')]('/',auth[_0xc6fe('0x9')](),controller[_0xc6fe('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 96dc700..f23ee75 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb84=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb84,0x15a));var _0x4cb8=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0xcb84[_0x2731f0];return _0x36a180;};'use strict';var Sequelize=require(_0x4cb8('0x0'));module['exports']={'body':{'type':Sequelize[_0x4cb8('0x1')]},'senderName':{'type':Sequelize[_0x4cb8('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x4cb8('0x3')]}}; \ No newline at end of file +var _0x004d=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5c8ab9,_0x32f9d7){var _0x2fbbac=function(_0x452868){while(--_0x452868){_0x5c8ab9['push'](_0x5c8ab9['shift']());}};_0x2fbbac(++_0x32f9d7);}(_0x004d,0x184));var _0xd004=function(_0x3d30f8,_0x26be8c){_0x3d30f8=_0x3d30f8-0x0;var _0x227daf=_0x004d[_0x3d30f8];return _0x227daf;};'use strict';var Sequelize=require(_0xd004('0x0'));module[_0xd004('0x1')]={'body':{'type':Sequelize[_0xd004('0x2')]},'senderName':{'type':Sequelize[_0xd004('0x3')]},'recipientsId':{'type':Sequelize[_0xd004('0x2')]},'recipientsDescription':{'type':Sequelize[_0xd004('0x3')]},'beep':{'type':Sequelize[_0xd004('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 3e1e79f..5afa153 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64a1=['Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','ids','queue','replace','Queue','push','all','union','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','faxqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase'];(function(_0x599ae5,_0xdc174e){var _0x5960ce=function(_0x5de60e){while(--_0x5de60e){_0x599ae5['push'](_0x599ae5['shift']());}};_0x5960ce(++_0xdc174e);}(_0x64a1,0xed));var _0x164a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x64a1[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0x164a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x164a('0x1'));var jsonpatch=require(_0x164a('0x2'));var rp=require(_0x164a('0x3'));var moment=require(_0x164a('0x4'));var BPromise=require(_0x164a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x164a('0x6'));var sox=require('sox');var csv=require(_0x164a('0x7'));var ejs=require(_0x164a('0x8'));var fs=require('fs');var fs_extra=require(_0x164a('0x9'));var _=require(_0x164a('0xa'));var squel=require(_0x164a('0xb'));var crypto=require(_0x164a('0xc'));var jsforce=require(_0x164a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x164a('0x7'));var querystring=require(_0x164a('0xe'));var Papa=require(_0x164a('0xf'));var Redis=require(_0x164a('0x10'));var authService=require(_0x164a('0x11'));var qs=require(_0x164a('0x12'));var as=require(_0x164a('0x13'));var hardwareService=require(_0x164a('0x14'));var logger=require(_0x164a('0x15'))(_0x164a('0x16'));var utils=require(_0x164a('0x17'));var config=require(_0x164a('0x18'));var licenseUtil=require(_0x164a('0x19'));var db=require(_0x164a('0x1a'))['db'];config['redis']=_['defaults'](config[_0x164a('0x1b')],{'host':_0x164a('0x1c'),'port':0x18eb});var socket=require(_0x164a('0x1d'))(new Redis(config[_0x164a('0x1b')]));require(_0x164a('0x1e'))[_0x164a('0x1f')](socket);function respondWithStatusCode(_0x41e733,_0x581b7e){_0x581b7e=_0x581b7e||0xcc;return function(_0x15b97c){if(_0x15b97c){return _0x41e733[_0x164a('0x20')](_0x581b7e);}return _0x41e733[_0x164a('0x21')](_0x581b7e)[_0x164a('0x22')]();};}function respondWithResult(_0x35bbd8,_0x24b7af){_0x24b7af=_0x24b7af||0xc8;return function(_0x33a877){if(_0x33a877){return _0x35bbd8[_0x164a('0x21')](_0x24b7af)['json'](_0x33a877);}};}function respondWithFilteredResult(_0x571eaa,_0x94ed43){return function(_0x49257){if(_0x49257){var _0x58da01=typeof _0x94ed43[_0x164a('0x23')]===_0x164a('0x24')&&typeof _0x94ed43['limit']===_0x164a('0x24');var _0xc627d4=_0x49257[_0x164a('0x25')];var _0x299e45=_0x58da01?0x0:_0x94ed43['offset'];var _0x1c9e60=_0x58da01?_0x49257[_0x164a('0x25')]:_0x94ed43[_0x164a('0x23')]+_0x94ed43[_0x164a('0x26')];var _0x4c0c22;if(_0x1c9e60>=_0xc627d4){_0x1c9e60=_0xc627d4;_0x4c0c22=0xc8;}else{_0x4c0c22=0xce;}_0x571eaa['status'](_0x4c0c22);return _0x571eaa[_0x164a('0x27')](_0x164a('0x28'),_0x299e45+'-'+_0x1c9e60+'/'+_0xc627d4)[_0x164a('0x29')](_0x49257);}return null;};}function patchUpdates(_0xae1cbf){return function(_0x2f8449){try{jsonpatch[_0x164a('0x2a')](_0x2f8449,_0xae1cbf,!![]);}catch(_0x42ee5a){return BPromise['reject'](_0x42ee5a);}return _0x2f8449[_0x164a('0x2b')]();};}function saveUpdates(_0x205249,_0x2cbd82){return function(_0x1cd067){if(_0x1cd067){return _0x1cd067[_0x164a('0x2c')](_0x205249)['then'](function(_0x337cf7){return _0x337cf7;});}return null;};}function removeEntity(_0x4cb45b,_0xc932ca){return function(_0xde3b2e){if(_0xde3b2e){return _0xde3b2e[_0x164a('0x2d')]()[_0x164a('0x2e')](function(){_0x4cb45b[_0x164a('0x21')](0xcc)[_0x164a('0x22')]();});}};}function handleEntityNotFound(_0x270da7,_0x189579){return function(_0x275ce6){if(!_0x275ce6){_0x270da7[_0x164a('0x20')](0x194);}return _0x275ce6;};}function handleError(_0x2b4c5c,_0x2e9efd){_0x2e9efd=_0x2e9efd||0x1f4;return function(_0x2b3423){logger[_0x164a('0x2f')](_0x2b3423['stack']);if(_0x2b3423[_0x164a('0x30')]){delete _0x2b3423[_0x164a('0x30')];}_0x2b4c5c[_0x164a('0x21')](_0x2e9efd)[_0x164a('0x31')](_0x2b3423);};}exports[_0x164a('0x32')]=function(_0x387f67,_0x5766b3,_0x3fdc25){if(!_0x387f67[_0x164a('0x33')][_0x164a('0x34')](_0x164a('0x35'))&&!_0x387f67[_0x164a('0x33')][_0x164a('0x34')](_0x164a('0x36'))){throw new db[(_0x164a('0x37'))][(_0x164a('0x38'))](_0x164a('0x39'));}else{if(_0x387f67[_0x164a('0x33')]['hasOwnProperty'](_0x164a('0x36'))&&!_0x387f67[_0x164a('0x33')][_0x164a('0x34')](_0x164a('0x3a'))){throw new db['Sequelize'][(_0x164a('0x38'))](_0x164a('0x3b'));}if(!_0x387f67[_0x164a('0x33')][_0x164a('0x34')](_0x164a('0x3c'))){throw new db['Sequelize'][(_0x164a('0x38'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x28e657=JSON[_0x164a('0x3d')](_0x387f67['body'][_0x164a('0x3c')]);}catch(_0x23cd32){logger['error'](_0x23cd32);throw new db[(_0x164a('0x37'))][(_0x164a('0x38'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x3f3e9a=[_0x164a('0x3e'),_0x164a('0x3f'),'mailqueue','openchannelqueue',_0x164a('0x40'),_0x164a('0x41'),_0x164a('0x42'),_0x164a('0x43'),_0x164a('0x44')];if(_[_0x164a('0x45')](_0x28e657,function(_0x1f6b24){return!_[_0x164a('0x46')](_0x3f3e9a,_0x1f6b24['model'][_0x164a('0x47')]());})){throw new db[(_0x164a('0x37'))]['ValidationError'](_0x164a('0x48'));}}}var _0x115e97={};_0x115e97[_0x164a('0x49')]=_0x387f67['body'][_0x164a('0x34')](_0x164a('0x49'))?_0x387f67[_0x164a('0x33')][_0x164a('0x49')]:_0x387f67['user'][_0x164a('0x4a')];_0x115e97['recipientsDescription']=_[_0x164a('0x4b')](_0x387f67[_0x164a('0x33')][_0x164a('0x4c')])?null:_0x387f67[_0x164a('0x33')][_0x164a('0x4c')];_0x115e97[_0x164a('0x4d')]=_0x387f67[_0x164a('0x33')]['beep']||![];_0x115e97[_0x164a('0x4e')]=_0x387f67['user']['id'];return getContent(_0x387f67[_0x164a('0x33')])['then'](function(_0xc984b3){_0x115e97[_0x164a('0x33')]=_0xc984b3;return getRecipients(_0x28e657);})['then'](function(_0x4d484b){_0x115e97[_0x164a('0x4f')]=_['sortBy'](_0x4d484b)[_0x164a('0x50')](',');return db[_0x164a('0x51')]['transaction'](function(_0x21dc74){return db[_0x164a('0x52')][_0x164a('0x53')](_0x115e97,{'raw':!![],'transaction':_0x21dc74})[_0x164a('0x2e')](function(_0x44ecf8){var _0x527ea5={'sender':_0x115e97[_0x164a('0x49')],'description':_0x115e97[_0x164a('0x4c')],'content':_0x115e97['body'],'beep':_0x115e97[_0x164a('0x4d')]};_0x4d484b[_0x164a('0x54')](function(_0xb4ab51){_0x527ea5[_0x164a('0x55')]=_0xb4ab51;socket[_0x164a('0x56')](_0x164a('0x57'),_0x527ea5);});return _0x44ecf8;});});})[_0x164a('0x2e')](respondWithResult(_0x5766b3,0xc9))[_0x164a('0x58')](handleError(_0x5766b3,null));};function getContent(_0x5c0e93){return new BPromise(function(_0x1c0625,_0x536b7a){if(_0x5c0e93[_0x164a('0x35')]){_0x1c0625(_0x5c0e93[_0x164a('0x35')]);return;}return db['Template']['findOne']({'attributes':[_0x164a('0x59')],'where':{'id':_0x5c0e93[_0x164a('0x36')]},'raw':!![]})[_0x164a('0x2e')](function(_0x33f49c){if(!_0x33f49c)throw new db[(_0x164a('0x37'))]['ValidationError'](_0x164a('0x5a'));var _0x1180d0=Mustache[_0x164a('0x5b')](_0x33f49c[_0x164a('0x59')],_0x5c0e93[_0x164a('0x3a')]);_0x1c0625(_0x1180d0);})[_0x164a('0x58')](function(_0x25d072){_0x536b7a(_0x25d072);});});}function getRecipients(_0x255bda){return new BPromise(function(_0x1d254a,_0x282b0b){var _0x52dcbb=[];var _0x128226=[];_0x255bda[_0x164a('0x54')](function(_0x8b7f09){var _0x289bb0=_[_0x164a('0x5c')](_0x8b7f09['model']['toLowerCase']());if(_0x289bb0===_0x164a('0x5d')){_0x52dcbb=_['union'](_0x52dcbb,_0x8b7f09[_0x164a('0x5e')]);}else{if(_[_0x164a('0x46')](_0x289bb0,_0x164a('0x5f')))_0x289bb0=_0x289bb0[_0x164a('0x60')](_0x164a('0x5f'),_0x164a('0x61'));_0x8b7f09[_0x164a('0x5e')][_0x164a('0x54')](function(_0x3880ff){_0x128226[_0x164a('0x62')](getAgents(_0x289bb0,_0x3880ff));});}});return BPromise[_0x164a('0x63')](_0x128226)[_0x164a('0x2e')](function(_0xe7198a){_0x52dcbb=_[_0x164a('0x64')](_0x52dcbb,_['flatten'](_0xe7198a));_0x1d254a(_0x52dcbb);})[_0x164a('0x58')](function(_0x270507){_0x282b0b(_0x270507);});});}function getAgents(_0x34be2b,_0x55e2ed){return new BPromise(function(_0x583229,_0xa45652){return db[_0x34be2b]['findOne']({'where':{'id':_0x55e2ed}})['then'](function(_0x1392ba){return _0x1392ba[_0x164a('0x65')]({'attributes':['id'],'raw':!![]})[_0x164a('0x2e')](function(_0x542218){var _0x41a968=_[_0x164a('0x66')](_0x542218,'id');_0x583229(_0x41a968);});})['catch'](function(_0x18d935){_0xa45652(_0x18d935);});});} \ No newline at end of file +var _0x9f96=['api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','body','text','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','Sequelize','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','beep','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','queue','replace','Queue','push','flatten','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f96,0x1e4));var _0x69f9=function(_0x4f400a,_0x33ea58){_0x4f400a=_0x4f400a-0x0;var _0x329a4f=_0x9f96[_0x4f400a];return _0x329a4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69f9('0x0'));var zipdir=require(_0x69f9('0x1'));var jsonpatch=require(_0x69f9('0x2'));var rp=require(_0x69f9('0x3'));var moment=require(_0x69f9('0x4'));var BPromise=require(_0x69f9('0x5'));var Mustache=require(_0x69f9('0x6'));var util=require('util');var path=require(_0x69f9('0x7'));var sox=require(_0x69f9('0x8'));var csv=require(_0x69f9('0x9'));var ejs=require(_0x69f9('0xa'));var fs=require('fs');var fs_extra=require(_0x69f9('0xb'));var _=require(_0x69f9('0xc'));var squel=require(_0x69f9('0xd'));var crypto=require(_0x69f9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x69f9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x69f9('0x10'));var Papa=require('papaparse');var Redis=require(_0x69f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x69f9('0x12'));var hardwareService=require(_0x69f9('0x13'));var logger=require(_0x69f9('0x14'))(_0x69f9('0x15'));var utils=require(_0x69f9('0x16'));var config=require(_0x69f9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x69f9('0x18'))['db'];config['redis']=_[_0x69f9('0x19')](config[_0x69f9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x69f9('0x1a')]));require(_0x69f9('0x1b'))[_0x69f9('0x1c')](socket);function respondWithStatusCode(_0x53ea1c,_0x2f22df){_0x2f22df=_0x2f22df||0xcc;return function(_0x2135a9){if(_0x2135a9){return _0x53ea1c[_0x69f9('0x1d')](_0x2f22df);}return _0x53ea1c['status'](_0x2f22df)[_0x69f9('0x1e')]();};}function respondWithResult(_0x2e4efc,_0x2e1029){_0x2e1029=_0x2e1029||0xc8;return function(_0x62b84e){if(_0x62b84e){return _0x2e4efc[_0x69f9('0x1f')](_0x2e1029)[_0x69f9('0x20')](_0x62b84e);}};}function respondWithFilteredResult(_0x317879,_0x1f4d13){return function(_0xb54459){if(_0xb54459){var _0x350fe2=typeof _0x1f4d13[_0x69f9('0x21')]===_0x69f9('0x22')&&typeof _0x1f4d13[_0x69f9('0x23')]===_0x69f9('0x22');var _0xd2bab4=_0xb54459[_0x69f9('0x24')];var _0x27c1ef=_0x350fe2?0x0:_0x1f4d13[_0x69f9('0x21')];var _0x4618e4=_0x350fe2?_0xb54459[_0x69f9('0x24')]:_0x1f4d13[_0x69f9('0x21')]+_0x1f4d13[_0x69f9('0x23')];var _0x113361;if(_0x4618e4>=_0xd2bab4){_0x4618e4=_0xd2bab4;_0x113361=0xc8;}else{_0x113361=0xce;}_0x317879[_0x69f9('0x1f')](_0x113361);return _0x317879[_0x69f9('0x25')](_0x69f9('0x26'),_0x27c1ef+'-'+_0x4618e4+'/'+_0xd2bab4)[_0x69f9('0x20')](_0xb54459);}return null;};}function patchUpdates(_0x197613){return function(_0x40e85a){try{jsonpatch[_0x69f9('0x27')](_0x40e85a,_0x197613,!![]);}catch(_0x2193c0){return BPromise[_0x69f9('0x28')](_0x2193c0);}return _0x40e85a['save']();};}function saveUpdates(_0x41ea5b,_0x1046d3){return function(_0x48bd97){if(_0x48bd97){return _0x48bd97[_0x69f9('0x29')](_0x41ea5b)[_0x69f9('0x2a')](function(_0x541a9a){return _0x541a9a;});}return null;};}function removeEntity(_0x21c24a,_0x124534){return function(_0x3ffb56){if(_0x3ffb56){return _0x3ffb56[_0x69f9('0x2b')]()[_0x69f9('0x2a')](function(){_0x21c24a['status'](0xcc)[_0x69f9('0x1e')]();});}};}function handleEntityNotFound(_0x36d606,_0x4a6c31){return function(_0x426d41){if(!_0x426d41){_0x36d606[_0x69f9('0x1d')](0x194);}return _0x426d41;};}function handleError(_0x26296e,_0x49f425){_0x49f425=_0x49f425||0x1f4;return function(_0x57d4a8){logger['error'](_0x57d4a8[_0x69f9('0x2c')]);if(_0x57d4a8['name']){delete _0x57d4a8[_0x69f9('0x2d')];}_0x26296e[_0x69f9('0x1f')](_0x49f425)[_0x69f9('0x2e')](_0x57d4a8);};}exports['sendUserNotification']=function(_0x18c449,_0x11f0fd,_0x29671f){if(!_0x18c449[_0x69f9('0x2f')]['hasOwnProperty'](_0x69f9('0x30'))&&!_0x18c449[_0x69f9('0x2f')][_0x69f9('0x31')]('TemplateId')){throw new db['Sequelize'][(_0x69f9('0x32'))](_0x69f9('0x33'));}else{if(_0x18c449['body']['hasOwnProperty'](_0x69f9('0x34'))&&!_0x18c449[_0x69f9('0x2f')][_0x69f9('0x31')]('view')){throw new db['Sequelize'][(_0x69f9('0x32'))](_0x69f9('0x35'));}if(!_0x18c449['body']['hasOwnProperty']('recipients')){throw new db[(_0x69f9('0x36'))][(_0x69f9('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x3d7cdc=JSON[_0x69f9('0x37')](_0x18c449[_0x69f9('0x2f')]['recipients']);}catch(_0x3d1397){logger[_0x69f9('0x38')](_0x3d1397);throw new db[(_0x69f9('0x36'))]['ValidationError'](_0x69f9('0x39'));}var _0xeed562=[_0x69f9('0x3a'),'faxqueue',_0x69f9('0x3b'),'openchannelqueue',_0x69f9('0x3c'),_0x69f9('0x3d'),_0x69f9('0x3e'),_0x69f9('0x3f'),_0x69f9('0x40')];if(_[_0x69f9('0x41')](_0x3d7cdc,function(_0x26c7a4){return!_[_0x69f9('0x42')](_0xeed562,_0x26c7a4[_0x69f9('0x43')][_0x69f9('0x44')]());})){throw new db[(_0x69f9('0x36'))]['ValidationError'](_0x69f9('0x45'));}}}var _0x3db239={};_0x3db239[_0x69f9('0x46')]=_0x18c449[_0x69f9('0x2f')][_0x69f9('0x31')](_0x69f9('0x46'))?_0x18c449[_0x69f9('0x2f')][_0x69f9('0x46')]:_0x18c449['user'][_0x69f9('0x47')];_0x3db239['recipientsDescription']=_[_0x69f9('0x48')](_0x18c449[_0x69f9('0x2f')][_0x69f9('0x49')])?null:_0x18c449[_0x69f9('0x2f')][_0x69f9('0x49')];_0x3db239['beep']=_0x18c449[_0x69f9('0x2f')]['beep']||![];_0x3db239[_0x69f9('0x4a')]=_0x18c449[_0x69f9('0x40')]['id'];return getContent(_0x18c449[_0x69f9('0x2f')])[_0x69f9('0x2a')](function(_0x322687){_0x3db239['body']=_0x322687;return getRecipients(_0x3d7cdc);})[_0x69f9('0x2a')](function(_0x5956f6){_0x3db239[_0x69f9('0x4b')]=_[_0x69f9('0x4c')](_0x5956f6)[_0x69f9('0x4d')](',');return db['sequelize'][_0x69f9('0x4e')](function(_0x55830c){return db[_0x69f9('0x4f')][_0x69f9('0x50')](_0x3db239,{'raw':!![],'transaction':_0x55830c})[_0x69f9('0x2a')](function(_0x47d643){var _0x244139={'sender':_0x3db239[_0x69f9('0x46')],'description':_0x3db239['recipientsDescription'],'content':_0x3db239[_0x69f9('0x2f')],'beep':_0x3db239[_0x69f9('0x51')]};_0x5956f6[_0x69f9('0x52')](function(_0x444baa){_0x244139[_0x69f9('0x53')]=_0x444baa;socket[_0x69f9('0x54')](_0x69f9('0x55'),_0x244139);});return _0x47d643;});});})[_0x69f9('0x2a')](respondWithResult(_0x11f0fd,0xc9))['catch'](handleError(_0x11f0fd,null));};function getContent(_0x48045c){return new BPromise(function(_0x2d3a01,_0x836b08){if(_0x48045c[_0x69f9('0x30')]){_0x2d3a01(_0x48045c[_0x69f9('0x30')]);return;}return db[_0x69f9('0x56')][_0x69f9('0x57')]({'attributes':[_0x69f9('0x58')],'where':{'id':_0x48045c[_0x69f9('0x34')]},'raw':!![]})[_0x69f9('0x2a')](function(_0x42c159){if(!_0x42c159)throw new db[(_0x69f9('0x36'))][(_0x69f9('0x32'))](_0x69f9('0x59'));var _0x5c87e7=Mustache[_0x69f9('0x5a')](_0x42c159['html'],_0x48045c['view']);_0x2d3a01(_0x5c87e7);})[_0x69f9('0x5b')](function(_0x7511b1){_0x836b08(_0x7511b1);});});}function getRecipients(_0x10edf6){return new BPromise(function(_0x240f69,_0x3a624c){var _0x4ce99a=[];var _0x273fc3=[];_0x10edf6[_0x69f9('0x52')](function(_0x1c1312){var _0x3c3b6d=_[_0x69f9('0x5c')](_0x1c1312[_0x69f9('0x43')][_0x69f9('0x44')]());if(_0x3c3b6d===_0x69f9('0x5d')){_0x4ce99a=_[_0x69f9('0x5e')](_0x4ce99a,_0x1c1312[_0x69f9('0x5f')]);}else{if(_[_0x69f9('0x42')](_0x3c3b6d,_0x69f9('0x60')))_0x3c3b6d=_0x3c3b6d[_0x69f9('0x61')](_0x69f9('0x60'),_0x69f9('0x62'));_0x1c1312[_0x69f9('0x5f')][_0x69f9('0x52')](function(_0x2adf24){_0x273fc3[_0x69f9('0x63')](getAgents(_0x3c3b6d,_0x2adf24));});}});return BPromise['all'](_0x273fc3)[_0x69f9('0x2a')](function(_0x5e1f93){_0x4ce99a=_[_0x69f9('0x5e')](_0x4ce99a,_[_0x69f9('0x64')](_0x5e1f93));_0x240f69(_0x4ce99a);})['catch'](function(_0x5e1e19){_0x3a624c(_0x5e1e19);});});}function getAgents(_0x29c5ab,_0x152094){return new BPromise(function(_0x121f5c,_0x3536d0){return db[_0x29c5ab]['findOne']({'where':{'id':_0x152094}})[_0x69f9('0x2a')](function(_0x3cb1c0){return _0x3cb1c0['getAgents']({'attributes':['id'],'raw':!![]})[_0x69f9('0x2a')](function(_0x3ae288){var _0x2eef79=_['map'](_0x3ae288,'id');_0x121f5c(_0x2eef79);});})['catch'](function(_0x73b7e1){_0x3536d0(_0x73b7e1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index a88ff78..7b913e1 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe67e=['events','../../mysqldb','UserNotification','save','update','remove','emit','exports'];(function(_0x28efbb,_0x3e225c){var _0xbf41f6=function(_0x3b7e72){while(--_0x3b7e72){_0x28efbb['push'](_0x28efbb['shift']());}};_0xbf41f6(++_0x3e225c);}(_0xe67e,0x168));var _0xee67=function(_0x47ad88,_0x53e221){_0x47ad88=_0x47ad88-0x0;var _0x315c8b=_0xe67e[_0x47ad88];return _0x315c8b;};'use strict';var EventEmitter=require(_0xee67('0x0'));var UserNotification=require(_0xee67('0x1'))['db'][_0xee67('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee67('0x3'),'afterUpdate':_0xee67('0x4'),'afterDestroy':_0xee67('0x5')};function emitEvent(_0x1ad635){return function(_0x3b3df3,_0x4e16d9,_0x59fda2){UserNotificationEvents[_0xee67('0x6')](_0x1ad635+':'+_0x3b3df3['id'],_0x3b3df3);UserNotificationEvents[_0xee67('0x6')](_0x1ad635,_0x3b3df3);_0x59fda2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xee67('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x7404=['events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7404,0xab));var _0x4740=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7404[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x4740('0x0'));var UserNotification=require(_0x4740('0x1'))['db'][_0x4740('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4740('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4740('0x4')};function emitEvent(_0x2ba468){return function(_0x2d2ad8,_0x506491,_0x4a5c81){UserNotificationEvents[_0x4740('0x5')](_0x2ba468+':'+_0x2d2ad8['id'],_0x2d2ad8);UserNotificationEvents['emit'](_0x2ba468,_0x2d2ad8);_0x4a5c81(null);};}for(var e in events){if(events[_0x4740('0x6')](e)){var event=events[e];UserNotification[_0x4740('0x7')](e,emitEvent(event));}}module[_0x4740('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index ba170fe..50c47a1 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6074=['bluebird','request-promise','path','../../config/environment','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x5b16b4,_0x41f999){var _0x57f5e9=function(_0x4afd32){while(--_0x4afd32){_0x5b16b4['push'](_0x5b16b4['shift']());}};_0x57f5e9(++_0x41f999);}(_0x6074,0x8b));var _0x4607=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x6074[_0x267c52];return _0x46c47b;};'use strict';var _=require('lodash');var util=require(_0x4607('0x0'));var logger=require(_0x4607('0x1'))(_0x4607('0x2'));var moment=require(_0x4607('0x3'));var BPromise=require(_0x4607('0x4'));var rp=require(_0x4607('0x5'));var fs=require('fs');var path=require(_0x4607('0x6'));var rimraf=require('rimraf');var config=require(_0x4607('0x7'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x106ca3,_0x9d1ad0){return _0x106ca3[_0x4607('0x8')](_0x4607('0x9'),attributes,{'tableName':_0x4607('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4607('0xb'),'collate':_0x4607('0xc')});}; \ No newline at end of file +var _0x0b3a=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x3e438f,_0x4439e7){var _0x35f7ff=function(_0x5c643a){while(--_0x5c643a){_0x3e438f['push'](_0x3e438f['shift']());}};_0x35f7ff(++_0x4439e7);}(_0x0b3a,0x114));var _0xa0b3=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x0b3a[_0x178668];return _0x26107d;};'use strict';var _=require(_0xa0b3('0x0'));var util=require('util');var logger=require(_0xa0b3('0x1'))(_0xa0b3('0x2'));var moment=require(_0xa0b3('0x3'));var BPromise=require(_0xa0b3('0x4'));var rp=require(_0xa0b3('0x5'));var fs=require('fs');var path=require(_0xa0b3('0x6'));var rimraf=require(_0xa0b3('0x7'));var config=require(_0xa0b3('0x8'));var attributes=require(_0xa0b3('0x9'));module[_0xa0b3('0xa')]=function(_0x4ba3fc,_0x138883){return _0x4ba3fc[_0xa0b3('0xb')]('UserNotification',attributes,{'tableName':_0xa0b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa0b3('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index bb7aad0..483d07a 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa63=['info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userNotification.socket','request','then'];(function(_0x5a3674,_0x586d0c){var _0x144f53=function(_0x21821a){while(--_0x21821a){_0x5a3674['push'](_0x5a3674['shift']());}};_0x144f53(++_0x586d0c);}(_0xfa63,0x1ae));var _0x3fa6=function(_0x536a76,_0x57696f){_0x536a76=_0x536a76-0x0;var _0xee36f3=_0xfa63[_0x536a76];return _0xee36f3;};'use strict';var _=require(_0x3fa6('0x0'));var util=require('util');var moment=require(_0x3fa6('0x1'));var BPromise=require(_0x3fa6('0x2'));var rs=require(_0x3fa6('0x3'));var fs=require('fs');var Redis=require(_0x3fa6('0x4'));var db=require(_0x3fa6('0x5'))['db'];var utils=require(_0x3fa6('0x6'));var logger=require(_0x3fa6('0x7'))(_0x3fa6('0x8'));var config=require(_0x3fa6('0x9'));var jayson=require(_0x3fa6('0xa'));var client=jayson[_0x3fa6('0xb')]['http']({'port':0x232a});config[_0x3fa6('0xc')]=_['defaults'](config['redis'],{'host':_0x3fa6('0xd'),'port':0x18eb});var socket=require(_0x3fa6('0xe'))(new Redis(config[_0x3fa6('0xc')]));require(_0x3fa6('0xf'))['register'](socket);function respondWithRpcPromise(_0x12c0e4,_0x5efb26,_0x519c60){return new BPromise(function(_0x1866f5,_0x1691ef){return client[_0x3fa6('0x10')](_0x12c0e4,_0x519c60)[_0x3fa6('0x11')](function(_0x4dab5c){logger[_0x3fa6('0x12')](_0x3fa6('0x13'),_0x5efb26,_0x3fa6('0x14'));logger[_0x3fa6('0x15')](_0x3fa6('0x16'),_0x5efb26,_0x3fa6('0x14'),JSON[_0x3fa6('0x17')](_0x4dab5c));if(_0x4dab5c[_0x3fa6('0x18')]){if(_0x4dab5c[_0x3fa6('0x18')][_0x3fa6('0x19')]===0x1f4){logger[_0x3fa6('0x18')]('UserNotification,\x20%s,\x20%s',_0x5efb26,_0x4dab5c[_0x3fa6('0x18')][_0x3fa6('0x1a')]);return _0x1691ef(_0x4dab5c['error'][_0x3fa6('0x1a')]);}logger[_0x3fa6('0x18')](_0x3fa6('0x13'),_0x5efb26,_0x4dab5c[_0x3fa6('0x18')][_0x3fa6('0x1a')]);return _0x1866f5(_0x4dab5c[_0x3fa6('0x18')][_0x3fa6('0x1a')]);}else{logger['info'](_0x3fa6('0x13'),_0x5efb26,'request\x20sent');_0x1866f5(_0x4dab5c[_0x3fa6('0x1b')][_0x3fa6('0x1a')]);}})['catch'](function(_0x3078a3){logger[_0x3fa6('0x18')]('UserNotification,\x20%s,\x20%s',_0x5efb26,_0x3078a3);_0x1691ef(_0x3078a3);});});} \ No newline at end of file +var _0x7902=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment'];(function(_0x2cc891,_0x4808ce){var _0x31b65a=function(_0x5c4452){while(--_0x5c4452){_0x2cc891['push'](_0x2cc891['shift']());}};_0x31b65a(++_0x4808ce);}(_0x7902,0x1ae));var _0x2790=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x7902[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x2790('0x0'));var util=require('util');var moment=require(_0x2790('0x1'));var BPromise=require('bluebird');var rs=require(_0x2790('0x2'));var fs=require('fs');var Redis=require(_0x2790('0x3'));var db=require(_0x2790('0x4'))['db'];var utils=require(_0x2790('0x5'));var logger=require(_0x2790('0x6'))(_0x2790('0x7'));var config=require(_0x2790('0x8'));var jayson=require(_0x2790('0x9'));var client=jayson[_0x2790('0xa')]['http']({'port':0x232a});config[_0x2790('0xb')]=_[_0x2790('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2790('0xd'))(new Redis(config['redis']));require(_0x2790('0xe'))[_0x2790('0xf')](socket);function respondWithRpcPromise(_0x58b399,_0x111f5b,_0x5120fc){return new BPromise(function(_0x325f0b,_0x5b9d85){return client[_0x2790('0x10')](_0x58b399,_0x5120fc)[_0x2790('0x11')](function(_0x1e5415){logger['info'](_0x2790('0x12'),_0x111f5b,_0x2790('0x13'));logger['debug'](_0x2790('0x14'),_0x111f5b,'request\x20sent',JSON[_0x2790('0x15')](_0x1e5415));if(_0x1e5415[_0x2790('0x16')]){if(_0x1e5415[_0x2790('0x16')]['code']===0x1f4){logger[_0x2790('0x16')](_0x2790('0x12'),_0x111f5b,_0x1e5415[_0x2790('0x16')]['message']);return _0x5b9d85(_0x1e5415[_0x2790('0x16')][_0x2790('0x17')]);}logger[_0x2790('0x16')]('UserNotification,\x20%s,\x20%s',_0x111f5b,_0x1e5415[_0x2790('0x16')]['message']);return _0x325f0b(_0x1e5415[_0x2790('0x16')][_0x2790('0x17')]);}else{logger[_0x2790('0x18')]('UserNotification,\x20%s,\x20%s',_0x111f5b,_0x2790('0x13'));_0x325f0b(_0x1e5415[_0x2790('0x19')][_0x2790('0x17')]);}})[_0x2790('0x1a')](function(_0x1461ae){logger['error']('UserNotification,\x20%s,\x20%s',_0x111f5b,_0x1461ae);_0x5b9d85(_0x1461ae);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index f0cc27f..4f69789 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa818=['length','update','emit','removeListener','register'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa818,0x191));var _0x8a81=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xa818[_0x382e89];return _0x3a1318;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove',_0x8a81('0x0')];function createListener(_0x5f26f1,_0x501a51){return function(_0x3d2c57){_0x501a51[_0x8a81('0x1')](_0x5f26f1,_0x3d2c57);};}function removeListener(_0x52d2f1,_0x24310d){return function(){UserNotificationEvents[_0x8a81('0x2')](_0x52d2f1,_0x24310d);};}exports[_0x8a81('0x3')]=function(_0x24d98e){for(var _0x149880=0x0,_0x464a21=events[_0x8a81('0x4')];_0x149880<_0x464a21;_0x149880++){var _0xd276b3=events[_0x149880];var _0x124eba=createListener('userNotification:'+_0xd276b3,_0x24d98e);UserNotificationEvents['on'](_0xd276b3,_0x124eba);}}; \ No newline at end of file +var _0xa76e=['register','length','userNotification:','./userNotification.events','remove','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa76e,0x83));var _0xea76=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa76e[_0x4b055c];return _0x4b62bb;};'use strict';var UserNotificationEvents=require(_0xea76('0x0'));var events=['save',_0xea76('0x1'),_0xea76('0x2')];function createListener(_0x89ab3c,_0x8ae763){return function(_0x17b41d){_0x8ae763[_0xea76('0x3')](_0x89ab3c,_0x17b41d);};}function removeListener(_0x2b3fca,_0xcea919){return function(){UserNotificationEvents[_0xea76('0x4')](_0x2b3fca,_0xcea919);};}exports[_0xea76('0x5')]=function(_0x4d7cec){for(var _0x286299=0x0,_0x505a42=events[_0xea76('0x6')];_0x286299<_0x505a42;_0x286299++){var _0x218477=events[_0x286299];var _0xb873a5=createListener(_0xea76('0x7')+_0x218477,_0x4d7cec);UserNotificationEvents['on'](_0x218477,_0xb873a5);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 700fc2c..fcff8d4 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51d7e0,_0x1d679a){var _0x177150=function(_0x73f9f2){while(--_0x73f9f2){_0x51d7e0['push'](_0x51d7e0['shift']());}};_0x177150(++_0x1d679a);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4ec119,_0x5e20f7){var _0x1f45a9=function(_0x247f80){while(--_0x247f80){_0x4ec119['push'](_0x4ec119['shift']());}};_0x1f45a9(++_0x5e20f7);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d7d126a..d5312be 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 _0x714b=['sequelize','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x714b,0x72));var _0xb714=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x714b[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xb714('0x0'));module[_0xb714('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x63eb=['sequelize','exports','INTEGER'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0x63eb,0x195));var _0xb63e=function(_0x47bb33,_0x210576){_0x47bb33=_0x47bb33-0x0;var _0x5e37df=_0x63eb[_0x47bb33];return _0x5e37df;};'use strict';var Sequelize=require(_0xb63e('0x0'));module[_0xb63e('0x1')]={'penalty':{'type':Sequelize[_0xb63e('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 6f257d3..f3adea8 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 _0xc221=['user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x4b4739,_0x9b3da9){var _0x2f1495=function(_0x44605f){while(--_0x44605f){_0x4b4739['push'](_0x4b4739['shift']());}};_0x2f1495(++_0x9b3da9);}(_0xc221,0x10b));var _0x1c22=function(_0x19fb03,_0x29f537){_0x19fb03=_0x19fb03-0x0;var _0xcf77be=_0xc221[_0x19fb03];return _0xcf77be;};'use strict';var _=require(_0x1c22('0x0'));var util=require(_0x1c22('0x1'));var logger=require(_0x1c22('0x2'))(_0x1c22('0x3'));var moment=require(_0x1c22('0x4'));var BPromise=require(_0x1c22('0x5'));var rp=require(_0x1c22('0x6'));var fs=require('fs');var path=require(_0x1c22('0x7'));var rimraf=require(_0x1c22('0x8'));var config=require(_0x1c22('0x9'));var attributes=require(_0x1c22('0xa'));module[_0x1c22('0xb')]=function(_0x5e491f,_0x22f8cd){return _0x5e491f['define'](_0x1c22('0xc'),attributes,{'tableName':_0x1c22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32db=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2af6ef,_0x3af560){var _0x2429b1=function(_0x4deca7){while(--_0x4deca7){_0x2af6ef['push'](_0x2af6ef['shift']());}};_0x2429b1(++_0x3af560);}(_0x32db,0xe3));var _0xb32d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x32db[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb32d('0x0'));var util=require('util');var logger=require(_0xb32d('0x1'))(_0xb32d('0x2'));var moment=require(_0xb32d('0x3'));var BPromise=require(_0xb32d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb32d('0x5'));var rimraf=require(_0xb32d('0x6'));var config=require(_0xb32d('0x7'));var attributes=require(_0xb32d('0x8'));module[_0xb32d('0x9')]=function(_0x3046f4,_0x11b546){return _0x3046f4[_0xb32d('0xa')](_0xb32d('0xb'),attributes,{'tableName':_0xb32d('0xc'),'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 6508022..caa208f 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 _0x08d9=['rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2775b4,_0x22b5e8){var _0x2025dd=function(_0x41d4e5){while(--_0x41d4e5){_0x2775b4['push'](_0x2775b4['shift']());}};_0x2025dd(++_0x22b5e8);}(_0x08d9,0xa9));var _0x908d=function(_0x498d4c,_0x4df5ee){_0x498d4c=_0x498d4c-0x0;var _0x15c22d=_0x08d9[_0x498d4c];return _0x15c22d;};'use strict';var _=require(_0x908d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x908d('0x1'));var rs=require(_0x908d('0x2'));var fs=require('fs');var Redis=require(_0x908d('0x3'));var db=require(_0x908d('0x4'))['db'];var utils=require(_0x908d('0x5'));var logger=require(_0x908d('0x6'))(_0x908d('0x7'));var config=require(_0x908d('0x8'));var jayson=require(_0x908d('0x9'));var client=jayson['client'][_0x908d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a0df,_0x3a3787,_0x36a8f2){return new BPromise(function(_0x4f965f,_0x22e6e5){return client[_0x908d('0xb')](_0x54a0df,_0x36a8f2)['then'](function(_0x73b228){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x3a3787,_0x908d('0xc'));logger[_0x908d('0xd')](_0x908d('0xe'),_0x3a3787,_0x908d('0xc'),JSON[_0x908d('0xf')](_0x73b228));if(_0x73b228[_0x908d('0x10')]){if(_0x73b228[_0x908d('0x10')]['code']===0x1f4){logger['error'](_0x908d('0x11'),_0x3a3787,_0x73b228['error']['message']);return _0x22e6e5(_0x73b228['error']['message']);}logger[_0x908d('0x10')](_0x908d('0x11'),_0x3a3787,_0x73b228[_0x908d('0x10')][_0x908d('0x12')]);return _0x4f965f(_0x73b228['error']['message']);}else{logger[_0x908d('0x13')](_0x908d('0x11'),_0x3a3787,_0x908d('0xc'));_0x4f965f(_0x73b228[_0x908d('0x14')][_0x908d('0x12')]);}})[_0x908d('0x15')](function(_0x514b3){logger[_0x908d('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3a3787,_0x514b3);_0x22e6e5(_0x514b3);});});} \ No newline at end of file +var _0x8744=['info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x52ca81,_0x70c883){var _0x4ca8fb=function(_0x440889){while(--_0x440889){_0x52ca81['push'](_0x52ca81['shift']());}};_0x4ca8fb(++_0x70c883);}(_0x8744,0x10b));var _0x4874=function(_0x4066c7,_0x4bf181){_0x4066c7=_0x4066c7-0x0;var _0x11b4f9=_0x8744[_0x4066c7];return _0x11b4f9;};'use strict';var _=require(_0x4874('0x0'));var util=require(_0x4874('0x1'));var moment=require('moment');var BPromise=require(_0x4874('0x2'));var rs=require(_0x4874('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4874('0x4'))['db'];var utils=require(_0x4874('0x5'));var logger=require(_0x4874('0x6'))(_0x4874('0x7'));var config=require(_0x4874('0x8'));var jayson=require(_0x4874('0x9'));var client=jayson['client'][_0x4874('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54690a,_0x1fd0b1,_0x3a1b51){return new BPromise(function(_0x1f14b0,_0x7b1e32){return client['request'](_0x54690a,_0x3a1b51)[_0x4874('0xb')](function(_0x403e6){logger['info'](_0x4874('0xc'),_0x1fd0b1,'request\x20sent');logger[_0x4874('0xd')](_0x4874('0xe'),_0x1fd0b1,_0x4874('0xf'),JSON[_0x4874('0x10')](_0x403e6));if(_0x403e6['error']){if(_0x403e6[_0x4874('0x11')]['code']===0x1f4){logger[_0x4874('0x11')](_0x4874('0xc'),_0x1fd0b1,_0x403e6[_0x4874('0x11')]['message']);return _0x7b1e32(_0x403e6[_0x4874('0x11')][_0x4874('0x12')]);}logger[_0x4874('0x11')](_0x4874('0xc'),_0x1fd0b1,_0x403e6[_0x4874('0x11')][_0x4874('0x12')]);return _0x1f14b0(_0x403e6[_0x4874('0x11')][_0x4874('0x12')]);}else{logger[_0x4874('0x13')](_0x4874('0xc'),_0x1fd0b1,_0x4874('0xf'));_0x1f14b0(_0x403e6[_0x4874('0x14')][_0x4874('0x12')]);}})[_0x4874('0x15')](function(_0x3a8244){logger['error'](_0x4874('0xc'),_0x1fd0b1,_0x3a8244);_0x7b1e32(_0x3a8244);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6c52f77..7bdb110 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 _0x2aba=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getSections','post','create','clone','/:id/sections','addResources','put','update','delete','destroy','removeSections','/:id/resources','multer','path'];(function(_0x4f9009,_0x14bd07){var _0x1d0ce1=function(_0x21991c){while(--_0x21991c){_0x4f9009['push'](_0x4f9009['shift']());}};_0x1d0ce1(++_0x14bd07);}(_0x2aba,0x1c9));var _0xa2ab=function(_0x1dbc6e,_0x1b9700){_0x1dbc6e=_0x1dbc6e-0x0;var _0x112745=_0x2aba[_0x1dbc6e];return _0x112745;};'use strict';var multer=require(_0xa2ab('0x0'));var util=require('util');var path=require(_0xa2ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2ab('0x2'));var router=express[_0xa2ab('0x3')]();var fs_extra=require(_0xa2ab('0x4'));var auth=require(_0xa2ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa2ab('0x6'));var controller=require(_0xa2ab('0x7'));router['get']('/',auth[_0xa2ab('0x8')](),controller[_0xa2ab('0x9')]);router[_0xa2ab('0xa')](_0xa2ab('0xb'),auth[_0xa2ab('0x8')](),controller[_0xa2ab('0xc')]);router[_0xa2ab('0xa')](_0xa2ab('0xd'),auth['isAuthenticated'](),controller[_0xa2ab('0xe')]);router[_0xa2ab('0xa')]('/:id/sections',auth['isAuthenticated'](),controller[_0xa2ab('0xf')]);router[_0xa2ab('0xa')]('/:id/resources',auth[_0xa2ab('0x8')](),controller['getResources']);router[_0xa2ab('0x10')]('/',auth['isAuthenticated'](),controller[_0xa2ab('0x11')]);router[_0xa2ab('0x10')]('/:id/clone',auth[_0xa2ab('0x8')](),controller[_0xa2ab('0x12')]);router[_0xa2ab('0x10')](_0xa2ab('0x13'),auth['isAuthenticated'](),controller['addSections']);router[_0xa2ab('0x10')]('/:id/resources',auth['isAuthenticated'](),controller[_0xa2ab('0x14')]);router[_0xa2ab('0x15')](_0xa2ab('0xd'),auth[_0xa2ab('0x8')](),controller[_0xa2ab('0x16')]);router[_0xa2ab('0x17')](_0xa2ab('0xd'),auth[_0xa2ab('0x8')](),controller[_0xa2ab('0x18')]);router[_0xa2ab('0x17')](_0xa2ab('0x13'),auth['isAuthenticated'](),controller[_0xa2ab('0x19')]);router[_0xa2ab('0x17')](_0xa2ab('0x1a'),auth[_0xa2ab('0x8')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0x783f=['index','/describe','describe','/:id','show','getSections','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources','put','update','delete','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x414826,_0xd9f46a){var _0xa0c969=function(_0x1ec688){while(--_0x1ec688){_0x414826['push'](_0x414826['shift']());}};_0xa0c969(++_0xd9f46a);}(_0x783f,0x16e));var _0xf783=function(_0x317104,_0x4c0b6a){_0x317104=_0x317104-0x0;var _0x15d0ed=_0x783f[_0x317104];return _0x15d0ed;};'use strict';var multer=require('multer');var util=require(_0xf783('0x0'));var path=require(_0xf783('0x1'));var timeout=require(_0xf783('0x2'));var express=require(_0xf783('0x3'));var router=express[_0xf783('0x4')]();var fs_extra=require(_0xf783('0x5'));var auth=require(_0xf783('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf783('0x7'));var controller=require(_0xf783('0x8'));router[_0xf783('0x9')]('/',auth[_0xf783('0xa')](),controller[_0xf783('0xb')]);router['get'](_0xf783('0xc'),auth['isAuthenticated'](),controller[_0xf783('0xd')]);router['get'](_0xf783('0xe'),auth[_0xf783('0xa')](),controller[_0xf783('0xf')]);router[_0xf783('0x9')]('/:id/sections',auth['isAuthenticated'](),controller[_0xf783('0x10')]);router['get']('/:id/resources',auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0xf783('0xa')](),controller['create']);router[_0xf783('0x11')](_0xf783('0x12'),auth[_0xf783('0xa')](),controller[_0xf783('0x13')]);router[_0xf783('0x11')](_0xf783('0x14'),auth[_0xf783('0xa')](),controller[_0xf783('0x15')]);router[_0xf783('0x11')](_0xf783('0x16'),auth['isAuthenticated'](),controller['addResources']);router[_0xf783('0x17')]('/:id',auth[_0xf783('0xa')](),controller[_0xf783('0x18')]);router[_0xf783('0x19')](_0xf783('0xe'),auth[_0xf783('0xa')](),controller['destroy']);router[_0xf783('0x19')]('/:id/sections',auth[_0xf783('0xa')](),controller[_0xf783('0x1a')]);router[_0xf783('0x19')]('/:id/resources',auth['isAuthenticated'](),controller[_0xf783('0x1b')]);module[_0xf783('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index cea6c90..9409a77 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 _0x4f4a=['BOOLEAN','exports','STRING','name','setDataValue','join','crudPermissions','getDataValue','split'];(function(_0x540e13,_0xd377be){var _0x101ba2=function(_0x373cf6){while(--_0x373cf6){_0x540e13['push'](_0x540e13['shift']());}};_0x101ba2(++_0xd377be);}(_0x4f4a,0x7f));var _0xa4f4=function(_0x2cfb38,_0x1fd697){_0x2cfb38=_0x2cfb38-0x0;var _0xf2c879=_0x4f4a[_0x2cfb38];return _0xf2c879;};'use strict';var Sequelize=require('sequelize');module[_0xa4f4('0x0')]={'name':{'type':Sequelize[_0xa4f4('0x1')],'allowNull':![],'unique':_0xa4f4('0x2')},'crudPermissions':{'type':Sequelize[_0xa4f4('0x1')],'set':function(_0x3a0a22){this[_0xa4f4('0x3')]('crudPermissions',_0x3a0a22?_0x3a0a22[_0xa4f4('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xa4f4('0x5'))?this[_0xa4f4('0x6')]('crudPermissions')[_0xa4f4('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa4f4('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa4f4('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa4f4('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa4f4('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa4f4('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa4f4('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd21a=['STRING','name','setDataValue','crudPermissions','getDataValue','BOOLEAN','exports'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0xd21a,0x1e2));var _0xad21=function(_0x5ab11e,_0x5928cf){_0x5ab11e=_0x5ab11e-0x0;var _0xccc333=_0xd21a[_0x5ab11e];return _0xccc333;};'use strict';var Sequelize=require('sequelize');module[_0xad21('0x0')]={'name':{'type':Sequelize[_0xad21('0x1')],'allowNull':![],'unique':_0xad21('0x2')},'crudPermissions':{'type':Sequelize[_0xad21('0x1')],'set':function(_0x2c2d00){this[_0xad21('0x3')](_0xad21('0x4'),_0x2c2d00?_0x2c2d00['join'](''):[]);},'get':function(){return this[_0xad21('0x5')]('crudPermissions')?this[_0xad21('0x5')](_0xad21('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xad21('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xad21('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xad21('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3b77cc7..76a713e 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 _0x0c3a=['merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','clone','omit','updatedAt','crudPermissions','transaction','get','UserProfileSection','autoAssociation','UserProfileResource','createdAt','userProfileId','create','Resources','addSections','sequelize','sectionId','each','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x31c359,_0x1d6736){var _0x35f3f7=function(_0x1f9282){while(--_0x1f9282){_0x31c359['push'](_0x31c359['shift']());}};_0x35f3f7(++_0x1d6736);}(_0x0c3a,0x171));var _0xa0c3=function(_0x551c17,_0x1b51b8){_0x551c17=_0x551c17-0x0;var _0x3b4288=_0x0c3a[_0x551c17];return _0x3b4288;};'use strict';var emlformat=require(_0xa0c3('0x0'));var rimraf=require(_0xa0c3('0x1'));var zipdir=require(_0xa0c3('0x2'));var jsonpatch=require(_0xa0c3('0x3'));var rp=require(_0xa0c3('0x4'));var moment=require(_0xa0c3('0x5'));var BPromise=require(_0xa0c3('0x6'));var Mustache=require('mustache');var util=require(_0xa0c3('0x7'));var path=require(_0xa0c3('0x8'));var sox=require('sox');var csv=require(_0xa0c3('0x9'));var ejs=require(_0xa0c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0c3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0c3('0xc'));var deskjs=require(_0xa0c3('0xd'));var toCsv=require(_0xa0c3('0x9'));var querystring=require(_0xa0c3('0xe'));var Papa=require('papaparse');var Redis=require(_0xa0c3('0xf'));var authService=require(_0xa0c3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0c3('0x11'));var logger=require(_0xa0c3('0x12'))('api');var utils=require(_0xa0c3('0x13'));var config=require(_0xa0c3('0x14'));var licenseUtil=require(_0xa0c3('0x15'));var db=require('../../mysqldb')['db'];config[_0xa0c3('0x16')]=_[_0xa0c3('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa0c3('0x18'))(new Redis(config[_0xa0c3('0x16')]));require(_0xa0c3('0x19'))[_0xa0c3('0x1a')](socket);function respondWithStatusCode(_0x334049,_0x4bbfcf){_0x4bbfcf=_0x4bbfcf||0xcc;return function(_0xe792e2){if(_0xe792e2){return _0x334049['sendStatus'](_0x4bbfcf);}return _0x334049[_0xa0c3('0x1b')](_0x4bbfcf)['end']();};}function respondWithResult(_0x49983c,_0x4d5c8a){_0x4d5c8a=_0x4d5c8a||0xc8;return function(_0xd70a2b){if(_0xd70a2b){return _0x49983c[_0xa0c3('0x1b')](_0x4d5c8a)[_0xa0c3('0x1c')](_0xd70a2b);}};}function respondWithFilteredResult(_0x4c6b92,_0x95dd1a){return function(_0xbadd6f){if(_0xbadd6f){var _0x351919=typeof _0x95dd1a[_0xa0c3('0x1d')]===_0xa0c3('0x1e')&&typeof _0x95dd1a[_0xa0c3('0x1f')]===_0xa0c3('0x1e');var _0x50c239=_0xbadd6f[_0xa0c3('0x20')];var _0x4c310d=_0x351919?0x0:_0x95dd1a[_0xa0c3('0x1d')];var _0x23df7b=_0x351919?_0xbadd6f[_0xa0c3('0x20')]:_0x95dd1a[_0xa0c3('0x1d')]+_0x95dd1a['limit'];var _0x91fd9f;if(_0x23df7b>=_0x50c239){_0x23df7b=_0x50c239;_0x91fd9f=0xc8;}else{_0x91fd9f=0xce;}_0x4c6b92[_0xa0c3('0x1b')](_0x91fd9f);return _0x4c6b92[_0xa0c3('0x21')](_0xa0c3('0x22'),_0x4c310d+'-'+_0x23df7b+'/'+_0x50c239)[_0xa0c3('0x1c')](_0xbadd6f);}return null;};}function patchUpdates(_0xdb5807){return function(_0x2926b5){try{jsonpatch['apply'](_0x2926b5,_0xdb5807,!![]);}catch(_0x406356){return BPromise[_0xa0c3('0x23')](_0x406356);}return _0x2926b5[_0xa0c3('0x24')]();};}function saveUpdates(_0x4a70bc,_0x47b303){return function(_0x76f403){if(_0x76f403){return _0x76f403[_0xa0c3('0x25')](_0x4a70bc)[_0xa0c3('0x26')](function(_0x256f8c){return _0x256f8c;});}return null;};}function removeEntity(_0xf43037,_0x303410){return function(_0x381f3b){if(_0x381f3b){return _0x381f3b[_0xa0c3('0x27')]()['then'](function(){_0xf43037[_0xa0c3('0x1b')](0xcc)[_0xa0c3('0x28')]();});}};}function handleEntityNotFound(_0x254969,_0x38b5f8){return function(_0x39ec3d){if(!_0x39ec3d){_0x254969['sendStatus'](0x194);}return _0x39ec3d;};}function handleError(_0x160290,_0x51ea75){_0x51ea75=_0x51ea75||0x1f4;return function(_0x24c677){logger[_0xa0c3('0x29')](_0x24c677[_0xa0c3('0x2a')]);if(_0x24c677[_0xa0c3('0x2b')]){delete _0x24c677[_0xa0c3('0x2b')];}_0x160290[_0xa0c3('0x1b')](_0x51ea75)['send'](_0x24c677);};}exports[_0xa0c3('0x2c')]=function(_0x1f256f,_0xa06c67){var _0xc48146={},_0x217edb={},_0x5ab556={'count':0x0,'rows':[]};var _0x275f2=_[_0xa0c3('0x2d')](db[_0xa0c3('0x2e')][_0xa0c3('0x2f')],function(_0x538f29){return{'name':_0x538f29[_0xa0c3('0x30')],'type':_0x538f29['type'][_0xa0c3('0x31')]};});_0x217edb[_0xa0c3('0x32')]=_[_0xa0c3('0x2d')](_0x275f2,'name');_0x217edb[_0xa0c3('0x33')]=_[_0xa0c3('0x34')](_0x1f256f[_0xa0c3('0x33')]);_0x217edb[_0xa0c3('0x35')]=_[_0xa0c3('0x36')](_0x217edb[_0xa0c3('0x32')],_0x217edb['query']);_0xc48146[_0xa0c3('0x37')]=_[_0xa0c3('0x36')](_0x217edb[_0xa0c3('0x32')],qs[_0xa0c3('0x38')](_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x38')]));_0xc48146[_0xa0c3('0x37')]=_0xc48146['attributes']['length']?_0xc48146['attributes']:_0x217edb[_0xa0c3('0x32')];if(!_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x39')](_0xa0c3('0x3a'))){_0xc48146[_0xa0c3('0x1f')]=qs[_0xa0c3('0x1f')](_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x1f')]);_0xc48146[_0xa0c3('0x1d')]=qs[_0xa0c3('0x1d')](_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x1d')]);}_0xc48146['order']=qs[_0xa0c3('0x3b')](_0x1f256f['query'][_0xa0c3('0x3b')]);_0xc48146['where']=qs[_0xa0c3('0x35')](_[_0xa0c3('0x3c')](_0x1f256f[_0xa0c3('0x33')],_0x217edb[_0xa0c3('0x35')]),_0x275f2);if(_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x3d')]){_0xc48146[_0xa0c3('0x3e')]=_[_0xa0c3('0x3f')](_0xc48146[_0xa0c3('0x3e')],{'$or':_['map'](_0x275f2,function(_0x4dc341){if(_0x4dc341['type']!=='VIRTUAL'){var _0x8427ee={};_0x8427ee[_0x4dc341['name']]={'$like':'%'+_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x3d')]+'%'};return _0x8427ee;}})});}_0xc48146=_[_0xa0c3('0x3f')]({},_0xc48146,_0x1f256f[_0xa0c3('0x40')]);var _0x2aeeba={'where':_0xc48146[_0xa0c3('0x3e')]};return db[_0xa0c3('0x2e')][_0xa0c3('0x20')](_0x2aeeba)[_0xa0c3('0x26')](function(_0x25e989){_0x5ab556[_0xa0c3('0x20')]=_0x25e989;if(_0x1f256f[_0xa0c3('0x33')][_0xa0c3('0x41')]){_0xc48146[_0xa0c3('0x42')]=[{'all':!![]}];}return db['UserProfile'][_0xa0c3('0x43')](_0xc48146);})[_0xa0c3('0x26')](function(_0x3d0b8c){_0x5ab556[_0xa0c3('0x44')]=_0x3d0b8c;return _0x5ab556;})[_0xa0c3('0x26')](respondWithFilteredResult(_0xa06c67,_0xc48146))[_0xa0c3('0x45')](handleError(_0xa06c67,null));};exports[_0xa0c3('0x46')]=function(_0x3b8dbd,_0x3130b7){var _0x3db5e5={'raw':![],'where':{'id':_0x3b8dbd[_0xa0c3('0x47')]['id']}},_0x5ba4f2={};_0x5ba4f2[_0xa0c3('0x32')]=_[_0xa0c3('0x34')](db[_0xa0c3('0x2e')]['rawAttributes']);_0x5ba4f2[_0xa0c3('0x33')]=_[_0xa0c3('0x34')](_0x3b8dbd[_0xa0c3('0x33')]);_0x5ba4f2[_0xa0c3('0x35')]=_[_0xa0c3('0x36')](_0x5ba4f2['model'],_0x5ba4f2['query']);_0x3db5e5['attributes']=_[_0xa0c3('0x36')](_0x5ba4f2['model'],qs[_0xa0c3('0x38')](_0x3b8dbd[_0xa0c3('0x33')][_0xa0c3('0x38')]));_0x3db5e5['attributes']=_0x3db5e5[_0xa0c3('0x37')]['length']?_0x3db5e5['attributes']:_0x5ba4f2[_0xa0c3('0x32')];if(_0x3b8dbd[_0xa0c3('0x33')][_0xa0c3('0x41')]){_0x3db5e5[_0xa0c3('0x42')]=[{'all':!![]}];}_0x3db5e5=_[_0xa0c3('0x3f')]({},_0x3db5e5,_0x3b8dbd[_0xa0c3('0x40')]);return db[_0xa0c3('0x2e')][_0xa0c3('0x48')](_0x3db5e5)[_0xa0c3('0x26')](handleEntityNotFound(_0x3130b7,null))[_0xa0c3('0x26')](respondWithResult(_0x3130b7,null))['catch'](handleError(_0x3130b7,null));};exports['create']=function(_0x3ffaf8,_0x50df44){return db['UserProfile']['create'](_0x3ffaf8[_0xa0c3('0x49')],{})['then'](respondWithResult(_0x50df44,0xc9))['catch'](handleError(_0x50df44,null));};exports[_0xa0c3('0x4a')]=function(_0x460552,_0x9007df){var _0x302758={'where':{'id':_0x460552['params']['id']}},_0x5a1d76={};_0x5a1d76[_0xa0c3('0x32')]=_[_0xa0c3('0x34')](db[_0xa0c3('0x2e')][_0xa0c3('0x2f')]);_0x302758[_0xa0c3('0x37')]=_[_0xa0c3('0x36')](_0x5a1d76[_0xa0c3('0x32')],qs['fields'](_0x460552[_0xa0c3('0x33')][_0xa0c3('0x38')]));_0x302758[_0xa0c3('0x37')]=_0x302758['attributes']['length']?_0x302758['attributes']:_0x5a1d76[_0xa0c3('0x32')];if(_0x460552[_0xa0c3('0x33')]['includeAll']){_0x302758[_0xa0c3('0x42')]=[{'all':!![]}];}_0x302758=_['merge']({},_0x302758,_0x460552[_0xa0c3('0x40')]);return db[_0xa0c3('0x2e')][_0xa0c3('0x48')](_0x302758)['then'](handleEntityNotFound(_0x9007df,null))[_0xa0c3('0x26')](function(_0x728afc){if(_0x728afc){var _0x2eed00=_0x728afc['get']({'plain':!![]});_0x2eed00=qs[_0xa0c3('0x4b')](_0x2eed00,['id','createdAt',_0xa0c3('0x4c'),_0xa0c3('0x4d')]);_0x460552['body']=_['omit'](_0x460552[_0xa0c3('0x49')],['id','createdAt',_0xa0c3('0x4c')]);return db['sequelize'][_0xa0c3('0x4e')](function(_0x1337d7){return db['UserProfile']['create'](_[_0xa0c3('0x3f')](_0x2eed00,_0x460552['body']),{'include':_0x460552['query'][_0xa0c3('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x1337d7})[_0xa0c3('0x26')](function(_0x24a0f9){var _0xff147c=_0x24a0f9[_0xa0c3('0x4f')]({'plain':!![]});return db[_0xa0c3('0x50')][_0xa0c3('0x43')]({'where':{'userProfileId':_0x460552[_0xa0c3('0x47')]['id']},'raw':!![]})[_0xa0c3('0x26')](function(_0x4a9104){if(_0x4a9104){return BPromise['each'](_0x4a9104,function(_0x45bd4f){return new BPromise(function(_0x35fb6e,_0x927de7){if(_0x45bd4f[_0xa0c3('0x51')]===null||_0x45bd4f[_0xa0c3('0x51')]===0x1)_0x35fb6e(null);return db[_0xa0c3('0x52')]['findAll']({'where':{'sectionId':_0x45bd4f['id']},'raw':!![]})[_0xa0c3('0x26')](function(_0x2d75ac){var _0x52d065=_['map'](_0x2d75ac,function(_0x4a84e8){return qs[_0xa0c3('0x4b')](_0x4a84e8,['id',_0xa0c3('0x53'),_0xa0c3('0x4c'),'sectionId']);});_0x35fb6e(_0x52d065);})['catch'](function(_0x3e4a60){_0x927de7(_0x3e4a60);});})[_0xa0c3('0x26')](function(_0x379ad9){var _0x404e77=qs[_0xa0c3('0x4b')](_0x45bd4f,['id',_0xa0c3('0x53'),_0xa0c3('0x4c')]);_0x404e77[_0xa0c3('0x54')]=_0xff147c['id'];if(_0x379ad9)_0x404e77['Resources']=_0x379ad9;return _0x404e77;})[_0xa0c3('0x26')](function(_0x480984){return db[_0xa0c3('0x50')][_0xa0c3('0x55')](_0x480984,{'include':[{'model':db[_0xa0c3('0x52')],'as':_0xa0c3('0x56')}],'raw':!![],'transaction':_0x1337d7});});})['then'](function(){return _0xff147c;});}});});});}})[_0xa0c3('0x26')](respondWithResult(_0x9007df,0xc9))['catch'](handleError(_0x9007df,null));};exports['update']=function(_0x547d86,_0x11e8ce){if(_0x547d86[_0xa0c3('0x49')]['id']){delete _0x547d86[_0xa0c3('0x49')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x547d86[_0xa0c3('0x47')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x11e8ce,null))[_0xa0c3('0x26')](saveUpdates(_0x547d86[_0xa0c3('0x49')],null))[_0xa0c3('0x26')](respondWithResult(_0x11e8ce,null))[_0xa0c3('0x45')](handleError(_0x11e8ce,null));};exports[_0xa0c3('0x27')]=function(_0x41eb59,_0x3b9452){return db[_0xa0c3('0x2e')][_0xa0c3('0x48')]({'where':{'id':_0x41eb59[_0xa0c3('0x47')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x3b9452,null))[_0xa0c3('0x26')](removeEntity(_0x3b9452,null))[_0xa0c3('0x45')](handleError(_0x3b9452,null));};exports['describe']=function(_0x4e0934,_0x1c4b8b){return db[_0xa0c3('0x2e')]['describe']()[_0xa0c3('0x26')](respondWithResult(_0x1c4b8b,null))[_0xa0c3('0x45')](handleError(_0x1c4b8b,null));};exports[_0xa0c3('0x57')]=function(_0x56306b,_0x439bf1){var _0x4e0f44=_0x56306b[_0xa0c3('0x49')];return db['UserProfile'][_0xa0c3('0x48')]({'where':{'id':_0x56306b[_0xa0c3('0x47')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x439bf1,null))[_0xa0c3('0x26')](function(_0x1ea795){if(_0x1ea795){return db[_0xa0c3('0x58')][_0xa0c3('0x4e')](function(_0x518f7a){return db[_0xa0c3('0x50')]['destroy']({'where':{'userProfileId':_0x56306b[_0xa0c3('0x47')]['id'],'sectionId':_[_0xa0c3('0x2d')](_0x4e0f44,function(_0x2a12be){return _0x2a12be[_0xa0c3('0x59')];})},'transaction':_0x518f7a})[_0xa0c3('0x26')](function(){var _0x2ce548=_[_0xa0c3('0x2d')](_0x4e0f44,function(_0x212edf){_0x212edf[_0xa0c3('0x54')]=_0x56306b['params']['id'];return _0x212edf;});var _0x410e32=[];return BPromise[_0xa0c3('0x5a')](_0x2ce548,function(_0xd9512e){return db[_0xa0c3('0x50')][_0xa0c3('0x55')](_0xd9512e,{'include':[{'model':db[_0xa0c3('0x52')],'as':_0xa0c3('0x56')}],'raw':!![],'transaction':_0x518f7a})[_0xa0c3('0x26')](function(_0x43de86){_0x410e32[_0xa0c3('0x5b')](_0x43de86[_0xa0c3('0x4f')]({'plain':!![]}));});})[_0xa0c3('0x26')](function(){return _0x410e32;});});});}})['then'](function(_0x259bd0){return _0x259bd0;})[_0xa0c3('0x26')](respondWithResult(_0x439bf1,null))[_0xa0c3('0x45')](handleError(_0x439bf1,null));};exports[_0xa0c3('0x5c')]=function(_0x56d1df,_0x4d5b32){var _0x3dd5e3;return db[_0xa0c3('0x2e')][_0xa0c3('0x48')]({'where':{'id':_0x56d1df['params']['id']},'attributes':['id',_0xa0c3('0x2b')]})[_0xa0c3('0x26')](handleEntityNotFound(_0x4d5b32,null))[_0xa0c3('0x26')](function(_0x16ae54){if(_0x16ae54){_0x3dd5e3=_0x16ae54;return db[_0xa0c3('0x50')][_0xa0c3('0x27')]({'where':{'userProfileId':_0x56d1df[_0xa0c3('0x47')]['id'],'sectionId':_0x56d1df[_0xa0c3('0x33')][_0xa0c3('0x5d')]}});}})[_0xa0c3('0x26')](function(){return _0x3dd5e3;})[_0xa0c3('0x26')](respondWithStatusCode(_0x4d5b32,null))[_0xa0c3('0x45')](handleError(_0x4d5b32,null));};exports[_0xa0c3('0x5e')]=function(_0x4d17e9,_0x27403b){var _0x279ae2=[];var _0x143fda=[];return db[_0xa0c3('0x50')][_0xa0c3('0x43')]({'where':{'userProfileId':_0x4d17e9[_0xa0c3('0x47')]['id']},'raw':!![]})[_0xa0c3('0x26')](function(_0x32fd40){_0x279ae2=_['filter'](_0x32fd40,function(_0xcfec35){return _0xcfec35[_0xa0c3('0x5f')]===0x1||_[_0xa0c3('0x60')]([0x3eb,0x709],_0xcfec35['sectionId']);});if(!_['isEmpty'](_0x279ae2)){return _[_0xa0c3('0x2d')](_0x279ae2,function(_0x21cf3a){return _0x21cf3a[_0xa0c3('0x59')];});}else{return;}})[_0xa0c3('0x26')](function(_0x24732a){if(_0x24732a)_0x143fda=_0x24732a;if(_['includes'](_0x143fda,0x64)){var _0x2145e4=_[_0xa0c3('0x48')](_0x279ae2,{'sectionId':0x64});return hasDefaultDashboard(_0x2145e4)[_0xa0c3('0x26')](function(_0x46711a){return _[_0xa0c3('0x2d')](_0x279ae2,function(_0x3e96ca){if(_0x3e96ca['sectionId']===0x64){_0x3e96ca[_0xa0c3('0x61')]=_0x46711a;}return _0x3e96ca;});});}else{return;}})[_0xa0c3('0x26')](function(_0x7265c8){if(_0x7265c8)_0x279ae2=_0x7265c8;if(_['includes'](_0x143fda,0x3eb)){var _0x4bdccb=_[_0xa0c3('0x48')](_0x279ae2,{'sectionId':0x3eb});return getCustomDashboards(_0x4bdccb)[_0xa0c3('0x26')](function(_0x19f352){return _['map'](_0x279ae2,function(_0x1ebf94){if(_0x4bdccb['enabled']){if(_0x1ebf94['sectionId']===0x3eb){_0x1ebf94[_0xa0c3('0x61')]=_0x19f352;}}else{if(_0x1ebf94[_0xa0c3('0x59')]===0x64){_0x1ebf94['subsections']=_0x19f352;}}return _0x1ebf94;});});}else{return;}})[_0xa0c3('0x26')](function(_0x38b876){if(_0x38b876)_0x279ae2=_0x38b876;if(_[_0xa0c3('0x60')](_0x143fda,0x709)){var _0x35c0ac=_[_0xa0c3('0x48')](_0x279ae2,{'sectionId':0x709});return getPlugins(_0x35c0ac)[_0xa0c3('0x26')](function(_0x2e00dc){if(_0x35c0ac['enabled']){return _[_0xa0c3('0x2d')](_0x279ae2,function(_0x2cb305){if(_0x2cb305['sectionId']===0x709){_0x2cb305[_0xa0c3('0x61')]=_0x2e00dc;}return _0x2cb305;});}else{var _0x34c22e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e00dc};var _0x2ea4af=_['map'](_0x279ae2);_0x2ea4af[_0xa0c3('0x5b')](_0x34c22e);return _0x2ea4af;}});}else{return;}})[_0xa0c3('0x26')](function(_0x464e78){if(_0x464e78)_0x279ae2=_0x464e78;return _[_0xa0c3('0x3d')](_0x279ae2,['enabled',0x1]);})[_0xa0c3('0x26')](respondWithResult(_0x27403b,null))[_0xa0c3('0x45')](handleError(_0x27403b,null));};function hasDefaultDashboard(_0x524452){var _0x10359d=[0x65];return new BPromise(function(_0x58b6fc,_0x546687){try{if(_0x524452[_0xa0c3('0x51')]){_0x58b6fc(_0x10359d);}else{return db[_0xa0c3('0x52')][_0xa0c3('0x62')]({'where':{'sectionId':_0x524452['id']},'raw':!![]})['then'](function(_0x371469){_0x371469?_0x58b6fc(_0x10359d):_0x58b6fc();});}}catch(_0x5a890a){_0x546687(_0x5a890a);}});}function getCustomDashboards(_0xacff){var _0xa8d0e6=[];return new BPromise(function(_0x297fc1,_0x3f3afa){try{if(_0xacff[_0xa0c3('0x51')]){return db[_0xa0c3('0x63')][_0xa0c3('0x43')]({'raw':!![]})[_0xa0c3('0x26')](function(_0x568835){_0x568835['forEach'](function(_0x21d5e8){_0xa8d0e6[_0xa0c3('0x5b')](_0x21d5e8['id']+0x1869f);});_0x297fc1(_0xa8d0e6);});}else{return db[_0xa0c3('0x52')]['findAll']({'where':{'sectionId':_0xacff['id']},'raw':!![]})[_0xa0c3('0x26')](function(_0x10aedb){_0x10aedb[_0xa0c3('0x64')](function(_0x1a1cd5){_0xa8d0e6['push'](_0x1a1cd5[_0xa0c3('0x65')]+0x1869f);});_0x297fc1(_0xa8d0e6);});}}catch(_0x34302a){_0x3f3afa(_0x34302a);}});}function getPlugins(_0x85e973){var _0x14c02d=[];return new BPromise(function(_0x437ab4,_0x1027f9){try{if(_0x85e973['autoAssociation']){return db['Plugin'][_0xa0c3('0x43')]({'raw':!![]})['then'](function(_0xfb5932){_0xfb5932[_0xa0c3('0x64')](function(_0x117432){_0x14c02d[_0xa0c3('0x5b')](_0x117432['id']+0x15b38);});_0x437ab4(_0x14c02d);});}else{return db['UserProfileResource'][_0xa0c3('0x43')]({'where':{'sectionId':_0x85e973['id']},'raw':!![]})[_0xa0c3('0x26')](function(_0x258fe8){_0x258fe8['forEach'](function(_0xfd2e81){_0x14c02d[_0xa0c3('0x5b')](_0xfd2e81[_0xa0c3('0x65')]+0x15b38);});_0x437ab4(_0x14c02d);});}}catch(_0x3c2cd9){_0x1027f9(_0x3c2cd9);}});}exports['addResources']=function(_0x244293,_0x11cab4){return db[_0xa0c3('0x2e')][_0xa0c3('0x48')]({'where':{'id':_0x244293['params']['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x11cab4,null))['then'](function(_0x41e86e){if(_0x41e86e){return db[_0xa0c3('0x58')][_0xa0c3('0x4e')](function(_0x9f40b){return db[_0xa0c3('0x50')]['findAll']({'where':{'userProfileId':_0x244293['params']['id']},'attributes':['id'],'raw':!![]})[_0xa0c3('0x26')](function(_0x4958da){if(_0x4958da){return db[_0xa0c3('0x50')][_0xa0c3('0x27')]({'where':{'userProfileId':_0x244293[_0xa0c3('0x47')]['id'],'id':_[_0xa0c3('0x2d')](_0x4958da,function(_0xcfaf50){return _0xcfaf50['id'];})},'transaction':_0x9f40b});}})[_0xa0c3('0x26')](function(_0x2b4d1f){var _0x2f3382=_[_0xa0c3('0x2d')](_0x244293['body'],function(_0xfaa93b){_0xfaa93b[_0xa0c3('0x54')]=_0x244293[_0xa0c3('0x47')]['id'];return _0xfaa93b;});return db[_0xa0c3('0x50')][_0xa0c3('0x66')](_0x2f3382,{'raw':!![],'transaction':_0x9f40b});})[_0xa0c3('0x26')](function(_0x47c18d){var _0xdcc780=_['filter'](_[_0xa0c3('0x2d')](_0x47c18d,function(_0x3cd461){return _0x3cd461[_0xa0c3('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0xdcc780){return db[_0xa0c3('0x50')][_0xa0c3('0x43')]({'where':{'userProfileId':_0x244293[_0xa0c3('0x47')]['id'],'sectionId':_[_0xa0c3('0x2d')](_0xdcc780,function(_0x44765d){return _0x44765d[_0xa0c3('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xa0c3('0x26')](function(_0x2f1760){var _0x2ac33c=_[_0xa0c3('0x2d')](_0x244293[_0xa0c3('0x49')],function(_0x5ae2db){_0x5ae2db[_0xa0c3('0x54')]=_0x244293[_0xa0c3('0x47')]['id'];return _0x5ae2db;});return db['UserProfileResource'][_0xa0c3('0x66')](_0x2ac33c,{'raw':!![],'transaction':_0x9f40b});});}})[_0xa0c3('0x45')](handleError(_0x11cab4,null));});}})['then'](function(_0x403e4a){var _0x2aff4b=_['map'](_0x403e4a,function(_0x3791ee){return _0x3791ee[_0xa0c3('0x4f')]({'plain':!![]});});})[_0xa0c3('0x26')](respondWithResult(_0x11cab4,null))['catch'](handleError(_0x11cab4,null));};exports[_0xa0c3('0x67')]=function(_0x4fc268,_0x278813,_0x5c2e4e){return db[_0xa0c3('0x2e')][_0xa0c3('0x48')]({'where':{'id':_0x4fc268[_0xa0c3('0x47')]['id']}})['then'](handleEntityNotFound(_0x278813,null))['then'](function(_0x87f116){if(_0x87f116){return _0x87f116[_0xa0c3('0x67')](_0x4fc268[_0xa0c3('0x33')][_0xa0c3('0x5d')]);}})['then'](respondWithStatusCode(_0x278813,null))[_0xa0c3('0x45')](handleError(_0x278813,null));};exports['getResources']=function(_0x54d52d,_0x1205f8){var _0x492525={};if(!_0x54d52d[_0xa0c3('0x33')][_0xa0c3('0x68')])throw new Error(_0xa0c3('0x69'));if(!_0x54d52d[_0xa0c3('0x33')]['hasOwnProperty']('nolimit')){_0x492525[_0xa0c3('0x1f')]=qs['limit'](_0x54d52d[_0xa0c3('0x33')]['limit']);_0x492525['offset']=qs['offset'](_0x54d52d[_0xa0c3('0x33')][_0xa0c3('0x1d')]);}return db[_0xa0c3('0x2e')][_0xa0c3('0x48')]({'where':{'id':_0x54d52d[_0xa0c3('0x47')]['id']}})[_0xa0c3('0x26')](function(_0x56ba9a){if(!_0x56ba9a)throw new Error(_0xa0c3('0x6a')+_0x54d52d['params']['id']);return db[_0xa0c3('0x2e')][_0xa0c3('0x6b')](_0x54d52d);})['then'](respondWithFilteredResult(_0x1205f8,_0x492525))[_0xa0c3('0x45')](handleError(_0x1205f8,null));}; \ No newline at end of file +var _0xee2c=['subsections','findOne','forEach','push','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','UserProfile','includeAll','findAll','catch','show','params','include','options','find','create','body','clone','get','omit','createdAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','describe','addSections','Resources','removeSections','ids','getSections','includes','isEmpty','enabled'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xee2c,0x1c7));var _0xcee2=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xee2c[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0xcee2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcee2('0x1'));var jsonpatch=require(_0xcee2('0x2'));var rp=require(_0xcee2('0x3'));var moment=require(_0xcee2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcee2('0x5'));var path=require(_0xcee2('0x6'));var sox=require('sox');var csv=require(_0xcee2('0x7'));var ejs=require(_0xcee2('0x8'));var fs=require('fs');var fs_extra=require(_0xcee2('0x9'));var _=require(_0xcee2('0xa'));var squel=require(_0xcee2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee2('0xc'));var toCsv=require(_0xcee2('0x7'));var querystring=require(_0xcee2('0xd'));var Papa=require(_0xcee2('0xe'));var Redis=require(_0xcee2('0xf'));var authService=require(_0xcee2('0x10'));var qs=require(_0xcee2('0x11'));var as=require(_0xcee2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcee2('0x13'))(_0xcee2('0x14'));var utils=require(_0xcee2('0x15'));var config=require(_0xcee2('0x16'));var licenseUtil=require(_0xcee2('0x17'));var db=require('../../mysqldb')['db'];config[_0xcee2('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcee2('0x19'))(new Redis(config[_0xcee2('0x18')]));require(_0xcee2('0x1a'))[_0xcee2('0x1b')](socket);function respondWithStatusCode(_0x54a718,_0x1cf4bb){_0x1cf4bb=_0x1cf4bb||0xcc;return function(_0x818e13){if(_0x818e13){return _0x54a718[_0xcee2('0x1c')](_0x1cf4bb);}return _0x54a718[_0xcee2('0x1d')](_0x1cf4bb)[_0xcee2('0x1e')]();};}function respondWithResult(_0x21a182,_0x25bdcf){_0x25bdcf=_0x25bdcf||0xc8;return function(_0x106c5e){if(_0x106c5e){return _0x21a182[_0xcee2('0x1d')](_0x25bdcf)['json'](_0x106c5e);}};}function respondWithFilteredResult(_0x170586,_0x548e47){return function(_0x221d75){if(_0x221d75){var _0xeae302=typeof _0x548e47[_0xcee2('0x1f')]===_0xcee2('0x20')&&typeof _0x548e47['limit']===_0xcee2('0x20');var _0x317659=_0x221d75[_0xcee2('0x21')];var _0x36af7f=_0xeae302?0x0:_0x548e47[_0xcee2('0x1f')];var _0x223f98=_0xeae302?_0x221d75[_0xcee2('0x21')]:_0x548e47[_0xcee2('0x1f')]+_0x548e47[_0xcee2('0x22')];var _0x148023;if(_0x223f98>=_0x317659){_0x223f98=_0x317659;_0x148023=0xc8;}else{_0x148023=0xce;}_0x170586[_0xcee2('0x1d')](_0x148023);return _0x170586['set'](_0xcee2('0x23'),_0x36af7f+'-'+_0x223f98+'/'+_0x317659)[_0xcee2('0x24')](_0x221d75);}return null;};}function patchUpdates(_0x4fdb88){return function(_0x526ab1){try{jsonpatch[_0xcee2('0x25')](_0x526ab1,_0x4fdb88,!![]);}catch(_0x4fa083){return BPromise[_0xcee2('0x26')](_0x4fa083);}return _0x526ab1[_0xcee2('0x27')]();};}function saveUpdates(_0x2edef5,_0x53bd9f){return function(_0x49b1a8){if(_0x49b1a8){return _0x49b1a8[_0xcee2('0x28')](_0x2edef5)[_0xcee2('0x29')](function(_0x22789d){return _0x22789d;});}return null;};}function removeEntity(_0x5905f6,_0x2f18ec){return function(_0x538c04){if(_0x538c04){return _0x538c04[_0xcee2('0x2a')]()[_0xcee2('0x29')](function(){_0x5905f6[_0xcee2('0x1d')](0xcc)[_0xcee2('0x1e')]();});}};}function handleEntityNotFound(_0x84d7c,_0x31618c){return function(_0xbc2b2e){if(!_0xbc2b2e){_0x84d7c[_0xcee2('0x1c')](0x194);}return _0xbc2b2e;};}function handleError(_0x262954,_0x104e18){_0x104e18=_0x104e18||0x1f4;return function(_0x3705a0){logger['error'](_0x3705a0[_0xcee2('0x2b')]);if(_0x3705a0[_0xcee2('0x2c')]){delete _0x3705a0[_0xcee2('0x2c')];}_0x262954['status'](_0x104e18)[_0xcee2('0x2d')](_0x3705a0);};}exports[_0xcee2('0x2e')]=function(_0x559816,_0x1e0dfc){var _0x25ead9={},_0x56e23b={},_0x5ee5a5={'count':0x0,'rows':[]};var _0x1efa5b=_['map'](db['UserProfile'][_0xcee2('0x2f')],function(_0x14ccc3){return{'name':_0x14ccc3['fieldName'],'type':_0x14ccc3[_0xcee2('0x30')][_0xcee2('0x31')]};});_0x56e23b[_0xcee2('0x32')]=_[_0xcee2('0x33')](_0x1efa5b,_0xcee2('0x2c'));_0x56e23b[_0xcee2('0x34')]=_[_0xcee2('0x35')](_0x559816[_0xcee2('0x34')]);_0x56e23b[_0xcee2('0x36')]=_[_0xcee2('0x37')](_0x56e23b[_0xcee2('0x32')],_0x56e23b[_0xcee2('0x34')]);_0x25ead9['attributes']=_[_0xcee2('0x37')](_0x56e23b[_0xcee2('0x32')],qs['fields'](_0x559816[_0xcee2('0x34')][_0xcee2('0x38')]));_0x25ead9['attributes']=_0x25ead9[_0xcee2('0x39')][_0xcee2('0x3a')]?_0x25ead9[_0xcee2('0x39')]:_0x56e23b['model'];if(!_0x559816[_0xcee2('0x34')][_0xcee2('0x3b')](_0xcee2('0x3c'))){_0x25ead9[_0xcee2('0x22')]=qs[_0xcee2('0x22')](_0x559816[_0xcee2('0x34')]['limit']);_0x25ead9[_0xcee2('0x1f')]=qs[_0xcee2('0x1f')](_0x559816[_0xcee2('0x34')]['offset']);}_0x25ead9[_0xcee2('0x3d')]=qs['sort'](_0x559816['query'][_0xcee2('0x3e')]);_0x25ead9[_0xcee2('0x3f')]=qs[_0xcee2('0x36')](_[_0xcee2('0x40')](_0x559816[_0xcee2('0x34')],_0x56e23b[_0xcee2('0x36')]),_0x1efa5b);if(_0x559816['query']['filter']){_0x25ead9['where']=_[_0xcee2('0x41')](_0x25ead9['where'],{'$or':_[_0xcee2('0x33')](_0x1efa5b,function(_0x157220){if(_0x157220['type']!==_0xcee2('0x42')){var _0x595caa={};_0x595caa[_0x157220['name']]={'$like':'%'+_0x559816[_0xcee2('0x34')][_0xcee2('0x43')]+'%'};return _0x595caa;}})});}_0x25ead9=_['merge']({},_0x25ead9,_0x559816['options']);var _0x208139={'where':_0x25ead9[_0xcee2('0x3f')]};return db[_0xcee2('0x44')][_0xcee2('0x21')](_0x208139)[_0xcee2('0x29')](function(_0x28bb5b){_0x5ee5a5[_0xcee2('0x21')]=_0x28bb5b;if(_0x559816[_0xcee2('0x34')][_0xcee2('0x45')]){_0x25ead9['include']=[{'all':!![]}];}return db[_0xcee2('0x44')][_0xcee2('0x46')](_0x25ead9);})[_0xcee2('0x29')](function(_0x3f1546){_0x5ee5a5['rows']=_0x3f1546;return _0x5ee5a5;})[_0xcee2('0x29')](respondWithFilteredResult(_0x1e0dfc,_0x25ead9))[_0xcee2('0x47')](handleError(_0x1e0dfc,null));};exports[_0xcee2('0x48')]=function(_0x27bb11,_0x8746a6){var _0x16b4c2={'raw':![],'where':{'id':_0x27bb11[_0xcee2('0x49')]['id']}},_0x337bba={};_0x337bba[_0xcee2('0x32')]=_['keys'](db[_0xcee2('0x44')][_0xcee2('0x2f')]);_0x337bba[_0xcee2('0x34')]=_['keys'](_0x27bb11[_0xcee2('0x34')]);_0x337bba[_0xcee2('0x36')]=_[_0xcee2('0x37')](_0x337bba[_0xcee2('0x32')],_0x337bba[_0xcee2('0x34')]);_0x16b4c2[_0xcee2('0x39')]=_[_0xcee2('0x37')](_0x337bba[_0xcee2('0x32')],qs[_0xcee2('0x38')](_0x27bb11[_0xcee2('0x34')][_0xcee2('0x38')]));_0x16b4c2[_0xcee2('0x39')]=_0x16b4c2[_0xcee2('0x39')][_0xcee2('0x3a')]?_0x16b4c2['attributes']:_0x337bba[_0xcee2('0x32')];if(_0x27bb11['query']['includeAll']){_0x16b4c2[_0xcee2('0x4a')]=[{'all':!![]}];}_0x16b4c2=_[_0xcee2('0x41')]({},_0x16b4c2,_0x27bb11[_0xcee2('0x4b')]);return db[_0xcee2('0x44')][_0xcee2('0x4c')](_0x16b4c2)['then'](handleEntityNotFound(_0x8746a6,null))[_0xcee2('0x29')](respondWithResult(_0x8746a6,null))['catch'](handleError(_0x8746a6,null));};exports[_0xcee2('0x4d')]=function(_0x209877,_0x465e9a){return db[_0xcee2('0x44')][_0xcee2('0x4d')](_0x209877[_0xcee2('0x4e')],{})[_0xcee2('0x29')](respondWithResult(_0x465e9a,0xc9))['catch'](handleError(_0x465e9a,null));};exports[_0xcee2('0x4f')]=function(_0x19002c,_0xb533cc){var _0x8a8f4f={'where':{'id':_0x19002c[_0xcee2('0x49')]['id']}},_0x2f4414={};_0x2f4414[_0xcee2('0x32')]=_[_0xcee2('0x35')](db[_0xcee2('0x44')]['rawAttributes']);_0x8a8f4f['attributes']=_[_0xcee2('0x37')](_0x2f4414[_0xcee2('0x32')],qs['fields'](_0x19002c[_0xcee2('0x34')][_0xcee2('0x38')]));_0x8a8f4f[_0xcee2('0x39')]=_0x8a8f4f[_0xcee2('0x39')][_0xcee2('0x3a')]?_0x8a8f4f[_0xcee2('0x39')]:_0x2f4414[_0xcee2('0x32')];if(_0x19002c['query']['includeAll']){_0x8a8f4f['include']=[{'all':!![]}];}_0x8a8f4f=_[_0xcee2('0x41')]({},_0x8a8f4f,_0x19002c[_0xcee2('0x4b')]);return db[_0xcee2('0x44')]['find'](_0x8a8f4f)[_0xcee2('0x29')](handleEntityNotFound(_0xb533cc,null))[_0xcee2('0x29')](function(_0x2f24d2){if(_0x2f24d2){var _0x5d701b=_0x2f24d2[_0xcee2('0x50')]({'plain':!![]});_0x5d701b=qs[_0xcee2('0x51')](_0x5d701b,['id',_0xcee2('0x52'),'updatedAt',_0xcee2('0x53')]);_0x19002c[_0xcee2('0x4e')]=_[_0xcee2('0x51')](_0x19002c[_0xcee2('0x4e')],['id','createdAt','updatedAt']);return db['sequelize'][_0xcee2('0x54')](function(_0x34ee10){return db[_0xcee2('0x44')][_0xcee2('0x4d')](_[_0xcee2('0x41')](_0x5d701b,_0x19002c[_0xcee2('0x4e')]),{'include':_0x19002c[_0xcee2('0x34')][_0xcee2('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x34ee10})[_0xcee2('0x29')](function(_0x30d3cd){var _0x3f4a06=_0x30d3cd['get']({'plain':!![]});return db[_0xcee2('0x55')][_0xcee2('0x46')]({'where':{'userProfileId':_0x19002c[_0xcee2('0x49')]['id']},'raw':!![]})[_0xcee2('0x29')](function(_0x289744){if(_0x289744){return BPromise[_0xcee2('0x56')](_0x289744,function(_0x325f62){return new BPromise(function(_0x1a7425,_0x5aca9b){if(_0x325f62[_0xcee2('0x57')]===null||_0x325f62[_0xcee2('0x57')]===0x1)_0x1a7425(null);return db[_0xcee2('0x58')][_0xcee2('0x46')]({'where':{'sectionId':_0x325f62['id']},'raw':!![]})[_0xcee2('0x29')](function(_0x297e70){var _0x14bb89=_[_0xcee2('0x33')](_0x297e70,function(_0x2b0815){return qs[_0xcee2('0x51')](_0x2b0815,['id','createdAt','updatedAt',_0xcee2('0x59')]);});_0x1a7425(_0x14bb89);})[_0xcee2('0x47')](function(_0xde163f){_0x5aca9b(_0xde163f);});})['then'](function(_0x5089e1){var _0x566d94=qs[_0xcee2('0x51')](_0x325f62,['id','createdAt','updatedAt']);_0x566d94[_0xcee2('0x5a')]=_0x3f4a06['id'];if(_0x5089e1)_0x566d94['Resources']=_0x5089e1;return _0x566d94;})[_0xcee2('0x29')](function(_0x9943ff){return db['UserProfileSection'][_0xcee2('0x4d')](_0x9943ff,{'include':[{'model':db[_0xcee2('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x34ee10});});})['then'](function(){return _0x3f4a06;});}});});});}})[_0xcee2('0x29')](respondWithResult(_0xb533cc,0xc9))[_0xcee2('0x47')](handleError(_0xb533cc,null));};exports[_0xcee2('0x28')]=function(_0x1b07b5,_0x2a4aed){if(_0x1b07b5['body']['id']){delete _0x1b07b5[_0xcee2('0x4e')]['id'];}return db[_0xcee2('0x44')][_0xcee2('0x4c')]({'where':{'id':_0x1b07b5[_0xcee2('0x49')]['id']}})[_0xcee2('0x29')](handleEntityNotFound(_0x2a4aed,null))[_0xcee2('0x29')](saveUpdates(_0x1b07b5[_0xcee2('0x4e')],null))[_0xcee2('0x29')](respondWithResult(_0x2a4aed,null))[_0xcee2('0x47')](handleError(_0x2a4aed,null));};exports[_0xcee2('0x2a')]=function(_0x210709,_0x216020){return db['UserProfile'][_0xcee2('0x4c')]({'where':{'id':_0x210709[_0xcee2('0x49')]['id']}})[_0xcee2('0x29')](handleEntityNotFound(_0x216020,null))['then'](removeEntity(_0x216020,null))['catch'](handleError(_0x216020,null));};exports[_0xcee2('0x5b')]=function(_0x33767d,_0x25930b){return db[_0xcee2('0x44')]['describe']()['then'](respondWithResult(_0x25930b,null))[_0xcee2('0x47')](handleError(_0x25930b,null));};exports[_0xcee2('0x5c')]=function(_0x81f30a,_0x3bdd96){var _0xe75e6e=_0x81f30a['body'];return db['UserProfile'][_0xcee2('0x4c')]({'where':{'id':_0x81f30a[_0xcee2('0x49')]['id']}})[_0xcee2('0x29')](handleEntityNotFound(_0x3bdd96,null))[_0xcee2('0x29')](function(_0x3ba2d0){if(_0x3ba2d0){return db['sequelize'][_0xcee2('0x54')](function(_0x546ad3){return db[_0xcee2('0x55')][_0xcee2('0x2a')]({'where':{'userProfileId':_0x81f30a[_0xcee2('0x49')]['id'],'sectionId':_[_0xcee2('0x33')](_0xe75e6e,function(_0x59d2fe){return _0x59d2fe[_0xcee2('0x59')];})},'transaction':_0x546ad3})['then'](function(){var _0x56cc94=_[_0xcee2('0x33')](_0xe75e6e,function(_0x3d7b5d){_0x3d7b5d[_0xcee2('0x5a')]=_0x81f30a[_0xcee2('0x49')]['id'];return _0x3d7b5d;});var _0x570f10=[];return BPromise[_0xcee2('0x56')](_0x56cc94,function(_0x51599d){return db['UserProfileSection'][_0xcee2('0x4d')](_0x51599d,{'include':[{'model':db[_0xcee2('0x58')],'as':_0xcee2('0x5d')}],'raw':!![],'transaction':_0x546ad3})['then'](function(_0x17cd07){_0x570f10['push'](_0x17cd07[_0xcee2('0x50')]({'plain':!![]}));});})['then'](function(){return _0x570f10;});});});}})[_0xcee2('0x29')](function(_0x527fb7){return _0x527fb7;})[_0xcee2('0x29')](respondWithResult(_0x3bdd96,null))[_0xcee2('0x47')](handleError(_0x3bdd96,null));};exports[_0xcee2('0x5e')]=function(_0x44cd5e,_0x17f5fe){var _0x43bf19;return db[_0xcee2('0x44')][_0xcee2('0x4c')]({'where':{'id':_0x44cd5e[_0xcee2('0x49')]['id']},'attributes':['id',_0xcee2('0x2c')]})[_0xcee2('0x29')](handleEntityNotFound(_0x17f5fe,null))[_0xcee2('0x29')](function(_0x2c6447){if(_0x2c6447){_0x43bf19=_0x2c6447;return db[_0xcee2('0x55')][_0xcee2('0x2a')]({'where':{'userProfileId':_0x44cd5e[_0xcee2('0x49')]['id'],'sectionId':_0x44cd5e[_0xcee2('0x34')][_0xcee2('0x5f')]}});}})[_0xcee2('0x29')](function(){return _0x43bf19;})['then'](respondWithStatusCode(_0x17f5fe,null))[_0xcee2('0x47')](handleError(_0x17f5fe,null));};exports[_0xcee2('0x60')]=function(_0x586b40,_0x1f9f50){var _0x40557b=[];var _0x2a9012=[];return db[_0xcee2('0x55')][_0xcee2('0x46')]({'where':{'userProfileId':_0x586b40[_0xcee2('0x49')]['id']},'raw':!![]})[_0xcee2('0x29')](function(_0x2a919d){_0x40557b=_[_0xcee2('0x43')](_0x2a919d,function(_0x27de44){return _0x27de44['enabled']===0x1||_[_0xcee2('0x61')]([0x3eb,0x709],_0x27de44['sectionId']);});if(!_[_0xcee2('0x62')](_0x40557b)){return _[_0xcee2('0x33')](_0x40557b,function(_0x132436){return _0x132436[_0xcee2('0x59')];});}else{return;}})['then'](function(_0x4f3f5e){if(_0x4f3f5e)_0x2a9012=_0x4f3f5e;if(_[_0xcee2('0x61')](_0x2a9012,0x64)){var _0x536d04=_[_0xcee2('0x4c')](_0x40557b,{'sectionId':0x64});return hasDefaultDashboard(_0x536d04)[_0xcee2('0x29')](function(_0x2d955f){return _[_0xcee2('0x33')](_0x40557b,function(_0x270322){if(_0x270322['sectionId']===0x64){_0x270322['subsections']=_0x2d955f;}return _0x270322;});});}else{return;}})[_0xcee2('0x29')](function(_0x28b004){if(_0x28b004)_0x40557b=_0x28b004;if(_['includes'](_0x2a9012,0x3eb)){var _0x56f9e9=_[_0xcee2('0x4c')](_0x40557b,{'sectionId':0x3eb});return getCustomDashboards(_0x56f9e9)[_0xcee2('0x29')](function(_0x452a2e){return _['map'](_0x40557b,function(_0x58b8b7){if(_0x56f9e9[_0xcee2('0x63')]){if(_0x58b8b7['sectionId']===0x3eb){_0x58b8b7['subsections']=_0x452a2e;}}else{if(_0x58b8b7[_0xcee2('0x59')]===0x64){_0x58b8b7[_0xcee2('0x64')]=_0x452a2e;}}return _0x58b8b7;});});}else{return;}})[_0xcee2('0x29')](function(_0x3b1962){if(_0x3b1962)_0x40557b=_0x3b1962;if(_[_0xcee2('0x61')](_0x2a9012,0x709)){var _0x450951=_[_0xcee2('0x4c')](_0x40557b,{'sectionId':0x709});return getPlugins(_0x450951)[_0xcee2('0x29')](function(_0x3476c5){if(_0x450951[_0xcee2('0x63')]){return _[_0xcee2('0x33')](_0x40557b,function(_0x27f8d7){if(_0x27f8d7[_0xcee2('0x59')]===0x709){_0x27f8d7[_0xcee2('0x64')]=_0x3476c5;}return _0x27f8d7;});}else{var _0x4a4a47={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3476c5};var _0x176697=_[_0xcee2('0x33')](_0x40557b);_0x176697['push'](_0x4a4a47);return _0x176697;}});}else{return;}})[_0xcee2('0x29')](function(_0x203572){if(_0x203572)_0x40557b=_0x203572;return _[_0xcee2('0x43')](_0x40557b,['enabled',0x1]);})['then'](respondWithResult(_0x1f9f50,null))['catch'](handleError(_0x1f9f50,null));};function hasDefaultDashboard(_0x3cd3e4){var _0x2afc1e=[0x65];return new BPromise(function(_0x2d1a5e,_0x10fd3a){try{if(_0x3cd3e4['autoAssociation']){_0x2d1a5e(_0x2afc1e);}else{return db['UserProfileResource'][_0xcee2('0x65')]({'where':{'sectionId':_0x3cd3e4['id']},'raw':!![]})[_0xcee2('0x29')](function(_0x42cd1d){_0x42cd1d?_0x2d1a5e(_0x2afc1e):_0x2d1a5e();});}}catch(_0x255f8a){_0x10fd3a(_0x255f8a);}});}function getCustomDashboards(_0x10c8c4){var _0x56900e=[];return new BPromise(function(_0x12ba93,_0xf3f119){try{if(_0x10c8c4[_0xcee2('0x57')]){return db['Dashboard'][_0xcee2('0x46')]({'raw':!![]})[_0xcee2('0x29')](function(_0x51f8ff){_0x51f8ff[_0xcee2('0x66')](function(_0x4a15c1){_0x56900e[_0xcee2('0x67')](_0x4a15c1['id']+0x1869f);});_0x12ba93(_0x56900e);});}else{return db[_0xcee2('0x58')][_0xcee2('0x46')]({'where':{'sectionId':_0x10c8c4['id']},'raw':!![]})[_0xcee2('0x29')](function(_0xa68060){_0xa68060['forEach'](function(_0x51c204){_0x56900e[_0xcee2('0x67')](_0x51c204[_0xcee2('0x68')]+0x1869f);});_0x12ba93(_0x56900e);});}}catch(_0x544cb8){_0xf3f119(_0x544cb8);}});}function getPlugins(_0x3e3957){var _0x10e5d5=[];return new BPromise(function(_0x1ecbbf,_0x352100){try{if(_0x3e3957[_0xcee2('0x57')]){return db['Plugin'][_0xcee2('0x46')]({'raw':!![]})[_0xcee2('0x29')](function(_0x3163d7){_0x3163d7[_0xcee2('0x66')](function(_0x53742a){_0x10e5d5[_0xcee2('0x67')](_0x53742a['id']+0x15b38);});_0x1ecbbf(_0x10e5d5);});}else{return db[_0xcee2('0x58')][_0xcee2('0x46')]({'where':{'sectionId':_0x3e3957['id']},'raw':!![]})[_0xcee2('0x29')](function(_0xdc2285){_0xdc2285[_0xcee2('0x66')](function(_0xad1457){_0x10e5d5[_0xcee2('0x67')](_0xad1457[_0xcee2('0x68')]+0x15b38);});_0x1ecbbf(_0x10e5d5);});}}catch(_0x1588c5){_0x352100(_0x1588c5);}});}exports[_0xcee2('0x69')]=function(_0x21211a,_0x3ec08b){return db[_0xcee2('0x44')][_0xcee2('0x4c')]({'where':{'id':_0x21211a['params']['id']}})[_0xcee2('0x29')](handleEntityNotFound(_0x3ec08b,null))[_0xcee2('0x29')](function(_0x27d3a9){if(_0x27d3a9){return db['sequelize'][_0xcee2('0x54')](function(_0x75e016){return db['UserProfileSection'][_0xcee2('0x46')]({'where':{'userProfileId':_0x21211a['params']['id']},'attributes':['id'],'raw':!![]})[_0xcee2('0x29')](function(_0x178edd){if(_0x178edd){return db[_0xcee2('0x55')][_0xcee2('0x2a')]({'where':{'userProfileId':_0x21211a[_0xcee2('0x49')]['id'],'id':_[_0xcee2('0x33')](_0x178edd,function(_0x14825c){return _0x14825c['id'];})},'transaction':_0x75e016});}})[_0xcee2('0x29')](function(_0x1db3c3){var _0x467911=_[_0xcee2('0x33')](_0x21211a[_0xcee2('0x4e')],function(_0x25d1f2){_0x25d1f2[_0xcee2('0x5a')]=_0x21211a['params']['id'];return _0x25d1f2;});return db[_0xcee2('0x55')][_0xcee2('0x6a')](_0x467911,{'raw':!![],'transaction':_0x75e016});})['then'](function(_0x210d45){var _0x37d4eb=_[_0xcee2('0x43')](_[_0xcee2('0x33')](_0x210d45,function(_0x3c79e1){return _0x3c79e1[_0xcee2('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x37d4eb){return db[_0xcee2('0x55')][_0xcee2('0x46')]({'where':{'userProfileId':_0x21211a[_0xcee2('0x49')]['id'],'sectionId':_[_0xcee2('0x33')](_0x37d4eb,function(_0x693ba5){return _0x693ba5[_0xcee2('0x59')];})},'attributes':['id',_0xcee2('0x59')],'raw':!![]})['then'](function(_0x2f988a){var _0x497fc7=_['map'](_0x21211a[_0xcee2('0x4e')],function(_0x56d14f){_0x56d14f[_0xcee2('0x5a')]=_0x21211a[_0xcee2('0x49')]['id'];return _0x56d14f;});return db[_0xcee2('0x58')][_0xcee2('0x6a')](_0x497fc7,{'raw':!![],'transaction':_0x75e016});});}})[_0xcee2('0x47')](handleError(_0x3ec08b,null));});}})[_0xcee2('0x29')](function(_0x32997a){var _0x107510=_['map'](_0x32997a,function(_0x681548){return _0x681548[_0xcee2('0x50')]({'plain':!![]});});})[_0xcee2('0x29')](respondWithResult(_0x3ec08b,null))[_0xcee2('0x47')](handleError(_0x3ec08b,null));};exports[_0xcee2('0x6b')]=function(_0xfa818b,_0x4d1d7f,_0x1013cf){return db[_0xcee2('0x44')][_0xcee2('0x4c')]({'where':{'id':_0xfa818b['params']['id']}})[_0xcee2('0x29')](handleEntityNotFound(_0x4d1d7f,null))['then'](function(_0x189502){if(_0x189502){return _0x189502[_0xcee2('0x6b')](_0xfa818b['query'][_0xcee2('0x5f')]);}})['then'](respondWithStatusCode(_0x4d1d7f,null))['catch'](handleError(_0x4d1d7f,null));};exports['getResources']=function(_0x4e461b,_0x241fcf){var _0x54660c={};if(!_0x4e461b[_0xcee2('0x34')][_0xcee2('0x6c')])throw new Error(_0xcee2('0x6d'));if(!_0x4e461b[_0xcee2('0x34')][_0xcee2('0x3b')](_0xcee2('0x3c'))){_0x54660c[_0xcee2('0x22')]=qs[_0xcee2('0x22')](_0x4e461b['query'][_0xcee2('0x22')]);_0x54660c['offset']=qs['offset'](_0x4e461b[_0xcee2('0x34')][_0xcee2('0x1f')]);}return db['UserProfile'][_0xcee2('0x4c')]({'where':{'id':_0x4e461b[_0xcee2('0x49')]['id']}})[_0xcee2('0x29')](function(_0x4fdbd8){if(!_0x4fdbd8)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x4e461b['params']['id']);return db[_0xcee2('0x44')][_0xcee2('0x6e')](_0x4e461b);})['then'](respondWithFilteredResult(_0x241fcf,_0x54660c))[_0xcee2('0x47')](handleError(_0x241fcf,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b03ae87..e375e9c 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 _0x2bab=['hook','events','../../mysqldb','UserProfile','setMaxListeners','update','remove'];(function(_0x1d3096,_0x2035b2){var _0x3b4672=function(_0x444fe0){while(--_0x444fe0){_0x1d3096['push'](_0x1d3096['shift']());}};_0x3b4672(++_0x2035b2);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x46447b,_0xcb2172){_0x46447b=_0x46447b-0x0;var _0x4954de=_0x2bab[_0x46447b];return _0x4954de;};'use strict';var EventEmitter=require(_0xb2ba('0x0'));var UserProfile=require(_0xb2ba('0x1'))['db'][_0xb2ba('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb2ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2ba('0x4'),'afterDestroy':_0xb2ba('0x5')};function emitEvent(_0x1d5064){return function(_0x54d80d,_0x24000c,_0x17466f){UserProfileEvents['emit'](_0x1d5064+':'+_0x54d80d['id'],_0x54d80d);UserProfileEvents['emit'](_0x1d5064,_0x54d80d);_0x17466f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xb2ba('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xd117=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0xd117,0x182));var _0x7d11=function(_0x29f730,_0x23d7ed){_0x29f730=_0x29f730-0x0;var _0x189806=_0xd117[_0x29f730];return _0x189806;};'use strict';var EventEmitter=require(_0x7d11('0x0'));var UserProfile=require(_0x7d11('0x1'))['db'][_0x7d11('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7d11('0x3')](0x0);var events={'afterCreate':_0x7d11('0x4'),'afterUpdate':_0x7d11('0x5'),'afterDestroy':_0x7d11('0x6')};function emitEvent(_0x254bb4){return function(_0x3c07be,_0x31fcb0,_0x589c51){UserProfileEvents[_0x7d11('0x7')](_0x254bb4+':'+_0x3c07be['id'],_0x3c07be);UserProfileEvents[_0x7d11('0x7')](_0x254bb4,_0x3c07be);_0x589c51(null);};}for(var e in events){if(events[_0x7d11('0x8')](e)){var event=events[e];UserProfile[_0x7d11('0x9')](e,emitEvent(event));}}module[_0x7d11('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 1e1e60f..adc0956 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 _0x6fa7=['zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','Sequelize','SELECT','select','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','user_profiles','section','query','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','all','isEmpty','ignore','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','CustomReports','count','rows','CmContact','Tags','color','ThroughTags','tag','openTabs','chat','sms','dataValues','fax','mail','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','catch','model','associatedResources','name','UserProfileResource','map','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','telephone','VoiceQueues','type','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','teams','voicequeues','queuecampaigns','QueueCampaigns','agents','Users','admin','user','Telephones'];(function(_0x4266b4,_0x4859ad){var _0x1442aa=function(_0x21f8c1){while(--_0x21f8c1){_0x4266b4['push'](_0x4266b4['shift']());}};_0x1442aa(++_0x4859ad);}(_0x6fa7,0x68));var _0x76fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fa7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76fa('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x76fa('0x1'));var squel=require(_0x76fa('0x2'));module[_0x76fa('0x3')]=function(_0x13bd08){var _0x31c8aa=_0x13bd08[_0x76fa('0x4')];function _0x489b3d(_0x31b053,_0x590cdf){return new Promise(function(_0x16510a,_0x13e4fe){if(!_0x590cdf)return _0x16510a(null);var _0xa292ec=_0x590cdf[_0x76fa('0x5')]?{[_0x590cdf[_0x76fa('0x5')][_0x76fa('0x6')]]:_0x590cdf[_0x76fa('0x5')][_0x76fa('0x7')]}:undefined;return _0x31c8aa[_0x31b053][_0x76fa('0x8')]({'where':_0xa292ec,'raw':!![]})[_0x76fa('0x9')](function(_0x17f35c){_0x590cdf['associatedResources']=_['map'](_0x17f35c,'id');_0x16510a(_0x590cdf);})[_0x76fa('0xa')](function(_0x19339c){_0x13e4fe(_0x19339c);});});}function _0x5c30df(_0xdab774,_0x5dcfdc){return new Promise(function(_0x30446e,_0x7495b8){var _0x53a781=_0xdab774['filter']?{[_0xdab774[_0x76fa('0x5')][_0x76fa('0x6')]]:_0xdab774[_0x76fa('0x5')][_0x76fa('0x7')]}:undefined;return _0x31c8aa[_0xdab774[_0x76fa('0xb')]]['findAll']({'where':_0x53a781,'raw':!![]})['then'](function(_0x4c06cf){_0x5dcfdc[_0x76fa('0xc')]=_['map'](_0x4c06cf,function(_0x140685){return _0x140685[_0x76fa('0xd')];});_0x30446e(_0x5dcfdc);})[_0x76fa('0xa')](function(_0x4bd792){_0x7495b8(_0x4bd792);});});}function _0x112aae(_0x1a9684,_0xaee2cf,_0x3f91fe){if(!_0xaee2cf)return Promise['resolve'](null);return new Promise(function(_0x429392,_0xd49914){return _0x31c8aa[_0x76fa('0xe')]['findAll']({'where':{'sectionId':_0xaee2cf['id']},'raw':!![]})[_0x76fa('0x9')](function(_0x49c235){if(_0x1a9684[_0x76fa('0x6')]&&_0x1a9684[_0x76fa('0x6')]!=='id'){_0xaee2cf[_0x76fa('0xc')]=_[_0x76fa('0xf')](_0x49c235,function(_0x431c7a){return _0x431c7a[_0x1a9684['field']];});}else{if(_0x3f91fe===_0x76fa('0x10')){_0xaee2cf[_0x76fa('0xc')]=_[_0x76fa('0xf')](_0x49c235,function(_0x119063){return{'id':_0x119063[_0x76fa('0x11')],'type':_0x119063['type']};});}else{_0xaee2cf['associatedResources']=_[_0x76fa('0xf')](_0x49c235,function(_0x182ee0){return _0x182ee0[_0x76fa('0x11')];});}}_0x429392(_0xaee2cf);})[_0x76fa('0xa')](function(_0x4b2e03){_0xd49914(_0x4b2e03);});});}function _0x10ffbf(_0x37c91e,_0x4ba8d6){var _0x478f37={'parentSections':[]};switch(_0x37c91e[_0x76fa('0x12')]()){case'squareprojects':_0x478f37['childModel']=_0x76fa('0x13');break;case'odbc':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x15');break;case _0x76fa('0x16'):_0x478f37[_0x76fa('0x14')]='SquareRecording';_0x478f37[_0x76fa('0x17')]=[{'name':_0x76fa('0x18'),'field':'name','foreignKey':_0x76fa('0x19')}];break;case _0x76fa('0x1a'):_0x478f37[_0x76fa('0x14')]='JscriptyProject';break;case _0x76fa('0x1b'):_0x478f37['childModel']='CmContact';_0x478f37[_0x76fa('0x17')]=[{'name':_0x76fa('0x1c'),'field':'id','foreignKey':_0x76fa('0x1d')}];break;case _0x76fa('0x1e'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x1f');break;case _0x76fa('0x20'):_0x478f37['childModel']='CmCompany';break;case _0x76fa('0x21'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x22');break;case _0x76fa('0x23'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x24');break;case'chatwebsites':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x25');break;case'faxqueues':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x26');break;case _0x76fa('0x27'):_0x478f37['childModel']=_0x76fa('0x28');break;case _0x76fa('0x29'):case _0x76fa('0x2a'):case _0x76fa('0x2b'):_0x478f37['childModel']='VoiceExtension';break;case _0x76fa('0x2c'):_0x478f37[_0x76fa('0x14')]='VoiceContext';break;case _0x76fa('0x2d'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x2e');break;case _0x76fa('0x2f'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x30');_0x478f37['parentSections']=[{'name':_0x76fa('0x31'),'field':'name','foreignKey':'membername','model':_0x76fa('0x32'),'filter':{'field':_0x76fa('0x33'),'value':['agent']}},{'name':'Telephones','field':_0x76fa('0xd'),'foreignKey':'membername','model':_0x76fa('0x32'),'filter':{'field':'role','value':[_0x76fa('0x34')]}},{'name':_0x76fa('0x35'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x76fa('0x36'),'value':['inbound']}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':_0x76fa('0x37'),'filter':{'field':_0x76fa('0x36'),'value':[_0x76fa('0x38')]}}];break;case _0x76fa('0x39'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x3a');break;case _0x76fa('0x3b'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x3c');break;case'voiceprefixes':_0x478f37[_0x76fa('0x14')]='VoicePrefix';break;case _0x76fa('0x3d'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x3e');break;case _0x76fa('0x3f'):_0x478f37['childModel']=_0x76fa('0x40');break;case _0x76fa('0x41'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x42');break;case _0x76fa('0x43'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x44');break;case'openchannelqueues':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x45');break;case _0x76fa('0x46'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x47');break;case _0x76fa('0x48'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x49');break;case'smsaccounts':_0x478f37['childModel']=_0x76fa('0x4a');break;case _0x76fa('0x4b'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x4c');break;case'whatsappaccounts':_0x478f37[_0x76fa('0x14')]='WhatsappAccount';break;case _0x76fa('0x4d'):_0x478f37[_0x76fa('0x14')]='Team';break;case _0x76fa('0x4e'):case _0x76fa('0x4f'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x37');if(_0x4ba8d6){_0x478f37[_0x76fa('0x17')]=[{'name':'VoiceQueues'},{'name':_0x76fa('0x50')}];}break;case'users':case _0x76fa('0x51'):case'telephones':_0x478f37['childModel']=_0x76fa('0x32');if(_0x4ba8d6){_0x478f37[_0x76fa('0x17')]=[{'name':_0x76fa('0x52'),'filter':{'field':_0x76fa('0x33'),'value':[_0x76fa('0x53'),_0x76fa('0x54')]},'ignore':!![]},{'name':_0x76fa('0x31')},{'name':_0x76fa('0x55')}];}break;case _0x76fa('0x56'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x57');break;case _0x76fa('0x58'):_0x478f37['childModel']=_0x76fa('0x59');break;case _0x76fa('0x5a'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x5b');break;case'sugarcrmaccounts':_0x478f37['childModel']=_0x76fa('0x5c');break;case _0x76fa('0x5d'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x5e');break;case'zohoaccounts':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x5f');break;case'vtigeraccounts':_0x478f37['childModel']=_0x76fa('0x32');break;case _0x76fa('0x60'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x61');break;case _0x76fa('0x62'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x63');break;case _0x76fa('0x64'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x65');break;case _0x76fa('0x66'):_0x478f37['childModel']=_0x76fa('0x67');break;case _0x76fa('0x68'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x69');break;case _0x76fa('0x6a'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x6b');break;case _0x76fa('0x6c'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x6d');break;case _0x76fa('0x6e'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x6f');break;case'templates':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x70');break;case _0x76fa('0x71'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x72');break;case _0x76fa('0x73'):_0x478f37[_0x76fa('0x14')]='Trunk';break;case _0x76fa('0x74'):_0x478f37[_0x76fa('0x14')]=_0x76fa('0x75');break;case'plugins':_0x478f37[_0x76fa('0x14')]=_0x76fa('0x76');break;case _0x76fa('0x77'):_0x478f37[_0x76fa('0x14')]='AnalyticExtractedReport';_0x478f37[_0x76fa('0x17')]=[{'name':_0x76fa('0x78'),'field':'id','foreignKey':_0x76fa('0x79')}];break;case _0x76fa('0x7a'):_0x478f37['childModel']=_0x76fa('0x7b');break;}return _0x478f37;}function _0x36d3e4(_0x3ff587,_0x5b206d){var _0x33e4b4=_0x3ff587[_0x76fa('0x7c')](0x0)['toUpperCase']()+_0x3ff587['slice'](0x1);var _0x5246e1={'type':_0x31c8aa[_0x76fa('0x7d')]['QueryTypes'][_0x76fa('0x7e')],'raw':!![]};return new Promise(function(_0x53a5e5,_0x4e256c){var _0x5d1254=squel[_0x76fa('0x7f')]()['field']('ui.'+_0x33e4b4+_0x76fa('0x80'),'id')[_0x76fa('0x6')](_0x76fa('0x81'))[_0x76fa('0x82')](_0x76fa('0x83')+_0x3ff587+'_interactions','ui')[_0x76fa('0x84')](_0x76fa('0x85'),_0x5b206d['id']);return _0x31c8aa[_0x76fa('0x86')]['query'](_0x5d1254['toString'](),_0x5246e1)[_0x76fa('0x9')](function(_0x2e57f4){_0x5b206d[_0x33e4b4+_0x76fa('0x87')]=_0x2e57f4;_0x53a5e5(_0x2e57f4);})['catch'](function(_0x593f42){_0x4e256c(_0x593f42);});});}return _0x13bd08[_0x76fa('0x88')](_0x76fa('0x89'),attributes,{'tableName':_0x76fa('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x35e532){var _0x2362ff={'raw':_0x35e532['query']['raw'],'where':{}};var _0x4a2dde={};var _0x377eb3={'count':0x0,'rows':[]};var _0x370c57=_0x35e532['query'][_0x76fa('0x8b')];var _0x1f7e55=_0x35e532[_0x76fa('0x8c')][_0x76fa('0x8d')]||![];var _0x187623=_0x10ffbf(_0x370c57,_0x1f7e55);if(!_0x187623[_0x76fa('0x14')])throw new Error(_0x76fa('0x8e')+_0x370c57+'\x27');var _0x4f70b4=[{'name':_0x370c57}];if(!_['isEmpty'](_0x187623[_0x76fa('0x17')]))_0x4f70b4=_0x187623['parentSections'];var _0xe90b87=[];for(var _0x4e6647=0x0;_0x4e6647<_0x4f70b4[_0x76fa('0x8f')];_0x4e6647++){_0xe90b87[_0x76fa('0x90')](_0x31c8aa[_0x76fa('0x91')][_0x76fa('0x92')]({'where':{'userProfileId':_0x35e532['params']['id'],'name':_0x4f70b4[_0x4e6647][_0x76fa('0xd')]},'raw':!![]}));}return Promise[_0x76fa('0x93')](_0xe90b87)[_0x76fa('0x9')](function(_0x1a18bc){var _0xb8bd56=_[_0x76fa('0x5')](_0x1a18bc,function(_0x22126a){return _0x22126a?_0x22126a:undefined;});var _0x596528=_[_0x76fa('0x5')](_0x4f70b4,['ignore',!![]]);var _0x1b7ad8=_[_0x76fa('0x94')](_0xb8bd56)&&_[_0x76fa('0x94')](_0x596528)?null:_['union'](_0x596528,_0xb8bd56);if(!_0x1b7ad8)return null;var _0xf481b8=[];for(var _0x53ece4=0x0;_0x53ece4<_0x1b7ad8['length'];_0x53ece4++){var _0x47135e=_[_0x76fa('0x92')](_0x4f70b4,function(_0x4cf520){return _0x1b7ad8[_0x53ece4]?_0x4cf520[_0x76fa('0xd')]===_0x1b7ad8[_0x53ece4][_0x76fa('0xd')]:null;});if(_0x47135e){if(_0x1b7ad8[_0x53ece4][_0x76fa('0x95')]){_0xf481b8[_0x76fa('0x90')](_0x489b3d(_0x187623[_0x76fa('0x14')],_0x1b7ad8[_0x53ece4]));}else{if(!_0x1b7ad8[_0x53ece4][_0x76fa('0x96')]){_0xf481b8['push'](_0x112aae(_0x47135e,_0x1b7ad8[_0x53ece4],_0x187623['childModel']));}else{if(_0x47135e['model']){_0xf481b8[_0x76fa('0x90')](_0x5c30df(_0x47135e,_0x1b7ad8[_0x53ece4]));}}}}}return Promise[_0x76fa('0x93')](_0xf481b8);})[_0x76fa('0x9')](function(_0x19f799){var _0x381726=_0x19f799;var _0x4b97ef=null;if(_0x381726){_0x4b97ef=_0x381726[_0x76fa('0x8f')]===0x1?_0x381726[0x0]:null;}if(!_0x4b97ef&&!_0x381726)return _0x377eb3;var _0x144b23=_0x31c8aa[_0x187623[_0x76fa('0x14')]][_0x76fa('0x97')];_0x4a2dde[_0x76fa('0xb')]=_[_0x76fa('0x98')](_0x144b23);_0x4a2dde['query']=_['keys'](_0x35e532[_0x76fa('0x8c')]);_0x4a2dde[_0x76fa('0x99')]=_[_0x76fa('0x9a')](_0x4a2dde['model'],_0x4a2dde[_0x76fa('0x8c')]);_0x2362ff['attributes']=_[_0x76fa('0x9a')](_0x4a2dde[_0x76fa('0xb')],qs[_0x76fa('0x9b')](_0x35e532[_0x76fa('0x8c')][_0x76fa('0x9b')]));_0x2362ff['attributes']=_0x2362ff['attributes'][_0x76fa('0x8f')]?_0x2362ff[_0x76fa('0x9c')]:_0x4a2dde['model'];if(!_0x35e532[_0x76fa('0x8c')][_0x76fa('0x9d')](_0x76fa('0x9e'))){_0x2362ff['limit']=qs[_0x76fa('0x9f')](_0x35e532['query'][_0x76fa('0x9f')]);_0x2362ff[_0x76fa('0xa0')]=qs[_0x76fa('0xa0')](_0x35e532[_0x76fa('0x8c')][_0x76fa('0xa0')]);}_0x2362ff[_0x76fa('0xa1')]=qs[_0x76fa('0xa2')](_0x35e532[_0x76fa('0x8c')][_0x76fa('0xa2')]);_0x2362ff[_0x76fa('0x84')]=qs[_0x76fa('0x99')](_[_0x76fa('0xa3')](_0x35e532['query'],_0x4a2dde['filters']));if(_0x35e532[_0x76fa('0x8c')][_0x76fa('0x5')]){_0x2362ff['where']=_[_0x76fa('0xa4')](_0x2362ff[_0x76fa('0x84')],{'$or':_['map'](_0x144b23,function(_0x270a05){if(_0x270a05['type'][_0x76fa('0xa5')]!==_0x76fa('0xa6')){var _0x2b1e61={};_0x2b1e61[_0x270a05[_0x76fa('0x6')]]={'$like':'%'+_0x35e532['query'][_0x76fa('0x5')]+'%'};return _0x2b1e61;}})});}var _0x578e77=[];var _0x2894b2=null;var _0x31fd56={};if(_0x4b97ef){_0x2894b2=_[_0x76fa('0x92')](_0x4f70b4,[_0x76fa('0xd'),_0x4b97ef[_0x76fa('0xd')]]);if(_0x2894b2[_0x76fa('0x6')]){_0x31fd56={};if(_0x187623[_0x76fa('0x14')]===_0x76fa('0x10')){_0x31fd56[_0x2894b2[_0x76fa('0xa7')]]=_[_0x76fa('0xf')](_0x4b97ef['associatedResources'],'id');}else{_0x31fd56[_0x2894b2[_0x76fa('0xa7')]]=_0x4b97ef[_0x76fa('0xc')];}_0x578e77[_0x76fa('0x90')](_0x31fd56);}else{_0x2362ff['where']['id']=_0x4b97ef[_0x76fa('0xc')];}}else{for(var _0x3fbeae=0x0;_0x3fbeae<_0x381726['length'];_0x3fbeae++){_0x2894b2=_[_0x76fa('0x92')](_0x4f70b4,[_0x76fa('0xd'),_0x381726[_0x3fbeae][_0x76fa('0xd')]]);if(_0x2894b2[_0x76fa('0x6')]){_0x31fd56={};_0x31fd56[_0x2894b2[_0x76fa('0xa7')]]=_0x381726[_0x3fbeae]['associatedResources'];_0x578e77[_0x76fa('0x90')](_0x31fd56);}else{if(!_0x2362ff[_0x76fa('0x84')]['id'])_0x2362ff['where']['id']=[];_0x381726[_0x3fbeae][_0x76fa('0xc')]['forEach'](function(_0x38912c){_0x2362ff['where']['id']['push'](_0x38912c);});}}}if(!_[_0x76fa('0x94')](_0x578e77)){_0x2362ff[_0x76fa('0x84')]=_[_0x76fa('0xa4')](_0x2362ff[_0x76fa('0x84')],{'$and':{'$or':_0x578e77}});}_0x2362ff=_['merge']({},_0x2362ff,_0x35e532[_0x76fa('0xa8')]);if(_0x4b97ef&&!_0x4b97ef[_0x76fa('0x96')]&&_0x187623[_0x76fa('0x14')]===_0x76fa('0x10')){if(_0x35e532[_0x76fa('0x8c')][_0x76fa('0xa9')]){_0x2362ff[_0x76fa('0xaa')]=[{'all':!![]}];}return _0x31c8aa[_0x187623[_0x76fa('0x14')]]['findAll'](_0x2362ff)[_0x76fa('0x9')](function(_0x2a487e){var _0x49bea4=[];_0x2a487e[_0x76fa('0xab')](function(_0x46f9b5){var _0x10fa64;switch(_0x46f9b5[_0x76fa('0xac')]){case _0x76fa('0xad'):_0x10fa64=_[_0x76fa('0x92')](_0x4b97ef[_0x76fa('0xc')],function(_0x328427){return _0x328427['id']===_0x46f9b5[_0x76fa('0x79')]&&_0x328427['type']===_0x76fa('0xae');});break;case'custom':_0x10fa64=_['find'](_0x4b97ef[_0x76fa('0xc')],function(_0x33a855){return _0x33a855['id']===_0x46f9b5[_0x76fa('0x79')]&&_0x33a855['type']===_0x76fa('0xaf');});break;}if(_0x10fa64)_0x49bea4[_0x76fa('0x90')](_0x46f9b5);});_0x377eb3[_0x76fa('0xb0')]=_0x49bea4['length'];_0x377eb3[_0x76fa('0xb1')]=_0x49bea4;return _0x377eb3;});}else{return _0x31c8aa[_0x187623['childModel']][_0x76fa('0xb0')]({'where':_0x2362ff[_0x76fa('0x84')]})[_0x76fa('0x9')](function(_0x5bd633){_0x377eb3['count']=_0x5bd633;if(_0x35e532[_0x76fa('0x8c')][_0x76fa('0xa9')]){if(_0x187623['childModel']===_0x76fa('0xb2')){_0x2362ff[_0x76fa('0xaa')]=[{'model':_0x31c8aa['Tag'],'as':_0x76fa('0xb3'),'attributes':['id','name',_0x76fa('0xb4')],'required':_0x35e532[_0x76fa('0x8c')]['tag']?!![]:![]},{'model':_0x31c8aa['Tag'],'as':_0x76fa('0xb5'),'attributes':['id','name',_0x76fa('0xb4')],'through':_0x35e532[_0x76fa('0x8c')][_0x76fa('0xb6')]?{'attributes':[],'where':{'TagId':_0x35e532[_0x76fa('0x8c')][_0x76fa('0xb6')]||undefined}}:{},'required':_0x35e532['query'][_0x76fa('0xb6')]?!![]:![]}];}else{_0x2362ff['include']=[{'all':!![]}];}}return _0x31c8aa[_0x187623[_0x76fa('0x14')]]['findAll'](_0x2362ff);})['then'](function(_0x42686c){_0x377eb3[_0x76fa('0xb1')]=_0x42686c;if(_0x370c57==='Agents'&&_0x35e532[_0x76fa('0x8c')][_0x76fa('0xb7')]==='true'){var _0x26e539=[];for(var _0x91ed03=0x0;_0x91ed03<_0x377eb3[_0x76fa('0xb1')]['length'];_0x91ed03++){_0x26e539[_0x76fa('0x90')](_0x36d3e4(_0x76fa('0xb8'),_0x377eb3[_0x76fa('0xb1')][_0x91ed03]['dataValues']));_0x26e539['push'](_0x36d3e4(_0x76fa('0xb9'),_0x377eb3['rows'][_0x91ed03][_0x76fa('0xba')]));_0x26e539['push'](_0x36d3e4(_0x76fa('0xbb'),_0x377eb3[_0x76fa('0xb1')][_0x91ed03]['dataValues']));_0x26e539[_0x76fa('0x90')](_0x36d3e4(_0x76fa('0xbc'),_0x377eb3['rows'][_0x91ed03][_0x76fa('0xba')]));_0x26e539[_0x76fa('0x90')](_0x36d3e4('openchannel',_0x377eb3['rows'][_0x91ed03][_0x76fa('0xba')]));_0x26e539[_0x76fa('0x90')](_0x36d3e4(_0x76fa('0xbd'),_0x377eb3[_0x76fa('0xb1')][_0x91ed03]['dataValues']));}return Promise[_0x76fa('0x93')](_0x26e539)[_0x76fa('0x9')](function(){return _0x377eb3;});}return _0x377eb3;});}});}}});}; \ No newline at end of file +var _0x24c8=['sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','select','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','raw','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','all','ignore','union','autoAssociation','rawAttributes','filters','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','CustomReports','rows','count','Tags','color','tag','openTabs','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','map','model','associatedResources','name','resolve','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','Users','user','Agents','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','Dashboard','intervals','Interval','pauses','scheduler','Schedule'];(function(_0x3d5dd5,_0x161a29){var _0x43c52e=function(_0x5c55f2){while(--_0x5c55f2){_0x3d5dd5['push'](_0x3d5dd5['shift']());}};_0x43c52e(++_0x161a29);}(_0x24c8,0x10c));var _0x824c=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0x24c8[_0x37a9d7];return _0x1343d3;};'use strict';var _=require(_0x824c('0x0'));var attributes=require(_0x824c('0x1'));var qs=require(_0x824c('0x2'));var squel=require('squel');module[_0x824c('0x3')]=function(_0x21831f){var _0xb7370f=_0x21831f[_0x824c('0x4')];function _0x1ad878(_0xfc25ff,_0x673d84){return new Promise(function(_0x14ee5f,_0x5b8639){if(!_0x673d84)return _0x14ee5f(null);var _0x4b6f08=_0x673d84[_0x824c('0x5')]?{[_0x673d84[_0x824c('0x5')][_0x824c('0x6')]]:_0x673d84['filter'][_0x824c('0x7')]}:undefined;return _0xb7370f[_0xfc25ff][_0x824c('0x8')]({'where':_0x4b6f08,'raw':!![]})[_0x824c('0x9')](function(_0x314df4){_0x673d84['associatedResources']=_[_0x824c('0xa')](_0x314df4,'id');_0x14ee5f(_0x673d84);})['catch'](function(_0x50982b){_0x5b8639(_0x50982b);});});}function _0xe5841e(_0x48a026,_0xd693da){return new Promise(function(_0x24438e,_0xa6dc24){var _0x58f668=_0x48a026[_0x824c('0x5')]?{[_0x48a026[_0x824c('0x5')][_0x824c('0x6')]]:_0x48a026[_0x824c('0x5')][_0x824c('0x7')]}:undefined;return _0xb7370f[_0x48a026[_0x824c('0xb')]][_0x824c('0x8')]({'where':_0x58f668,'raw':!![]})[_0x824c('0x9')](function(_0x38046d){_0xd693da[_0x824c('0xc')]=_[_0x824c('0xa')](_0x38046d,function(_0x4421ea){return _0x4421ea[_0x824c('0xd')];});_0x24438e(_0xd693da);})['catch'](function(_0xe07d05){_0xa6dc24(_0xe07d05);});});}function _0x137db5(_0x4d0345,_0x5a6f84,_0x2ddc11){if(!_0x5a6f84)return Promise[_0x824c('0xe')](null);return new Promise(function(_0x1eebc9,_0x48a00c){return _0xb7370f[_0x824c('0xf')][_0x824c('0x8')]({'where':{'sectionId':_0x5a6f84['id']},'raw':!![]})[_0x824c('0x9')](function(_0x23f7b2){if(_0x4d0345['field']&&_0x4d0345[_0x824c('0x6')]!=='id'){_0x5a6f84[_0x824c('0xc')]=_[_0x824c('0xa')](_0x23f7b2,function(_0x2c3e72){return _0x2c3e72[_0x4d0345['field']];});}else{if(_0x2ddc11==='AnalyticExtractedReport'){_0x5a6f84[_0x824c('0xc')]=_[_0x824c('0xa')](_0x23f7b2,function(_0x174e87){return{'id':_0x174e87[_0x824c('0x10')],'type':_0x174e87[_0x824c('0x11')]};});}else{_0x5a6f84[_0x824c('0xc')]=_[_0x824c('0xa')](_0x23f7b2,function(_0x1a0b6c){return _0x1a0b6c[_0x824c('0x10')];});}}_0x1eebc9(_0x5a6f84);})['catch'](function(_0x5826b2){_0x48a00c(_0x5826b2);});});}function _0x31eca0(_0x32cefc,_0x38495f){var _0x172fd6={'parentSections':[]};switch(_0x32cefc[_0x824c('0x12')]()){case _0x824c('0x13'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x15');break;case _0x824c('0x16'):_0x172fd6[_0x824c('0x14')]='SquareOdbc';break;case'squarerecordings':_0x172fd6[_0x824c('0x14')]=_0x824c('0x17');_0x172fd6[_0x824c('0x18')]=[{'name':_0x824c('0x19'),'field':_0x824c('0xd'),'foreignKey':_0x824c('0x1a')}];break;case _0x824c('0x1b'):_0x172fd6['childModel']='JscriptyProject';break;case _0x824c('0x1c'):_0x172fd6['childModel']=_0x824c('0x1d');_0x172fd6[_0x824c('0x18')]=[{'name':_0x824c('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x824c('0x1f'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x20');break;case _0x824c('0x21'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x22');break;case'globalcustomfields':_0x172fd6[_0x824c('0x14')]=_0x824c('0x23');break;case _0x824c('0x24'):_0x172fd6[_0x824c('0x14')]='ChatQueue';break;case _0x824c('0x25'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x26');break;case _0x824c('0x27'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x28');break;case _0x824c('0x29'):_0x172fd6['childModel']='FaxAccount';break;case _0x824c('0x2a'):case _0x824c('0x2b'):case _0x824c('0x2c'):_0x172fd6['childModel']=_0x824c('0x2d');break;case'contexts':_0x172fd6['childModel']='VoiceContext';break;case'voicemails':_0x172fd6[_0x824c('0x14')]=_0x824c('0x2e');break;case _0x824c('0x2f'):_0x172fd6['childModel']=_0x824c('0x30');_0x172fd6[_0x824c('0x18')]=[{'name':'Agents','field':_0x824c('0xd'),'foreignKey':_0x824c('0x31'),'model':_0x824c('0x32'),'filter':{'field':_0x824c('0x33'),'value':[_0x824c('0x34')]}},{'name':'Telephones','field':_0x824c('0xd'),'foreignKey':'membername','model':_0x824c('0x32'),'filter':{'field':_0x824c('0x33'),'value':[_0x824c('0x35')]}},{'name':'VoiceQueues','field':_0x824c('0xd'),'foreignKey':_0x824c('0x36'),'model':_0x824c('0x37'),'filter':{'field':_0x824c('0x11'),'value':[_0x824c('0x38')]}},{'name':_0x824c('0x39'),'field':_0x824c('0xd'),'foreignKey':'queue','model':_0x824c('0x37'),'filter':{'field':'type','value':[_0x824c('0x3a')]}}];break;case _0x824c('0x3b'):_0x172fd6['childModel']='VoiceMusicOnHold';break;case _0x824c('0x3c'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x3d');break;case _0x824c('0x3e'):_0x172fd6['childModel']=_0x824c('0x3f');break;case _0x824c('0x40'):_0x172fd6['childModel']=_0x824c('0x41');break;case _0x824c('0x42'):_0x172fd6['childModel']='MailQueue';break;case'mailaccounts':_0x172fd6[_0x824c('0x14')]=_0x824c('0x43');break;case _0x824c('0x44'):_0x172fd6['childModel']=_0x824c('0x45');break;case _0x824c('0x46'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x47');break;case'openchannelaccounts':_0x172fd6[_0x824c('0x14')]=_0x824c('0x48');break;case'smsqueues':_0x172fd6[_0x824c('0x14')]=_0x824c('0x49');break;case'smsaccounts':_0x172fd6[_0x824c('0x14')]=_0x824c('0x4a');break;case _0x824c('0x4b'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x4c');break;case'whatsappaccounts':_0x172fd6['childModel']='WhatsappAccount';break;case _0x824c('0x4d'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x4e');break;case _0x824c('0x4f'):case _0x824c('0x50'):_0x172fd6[_0x824c('0x14')]='VoiceQueue';if(_0x38495f){_0x172fd6['parentSections']=[{'name':_0x824c('0x51')},{'name':_0x824c('0x39')}];}break;case _0x824c('0x52'):case'agents':case'telephones':_0x172fd6['childModel']='User';if(_0x38495f){_0x172fd6['parentSections']=[{'name':_0x824c('0x53'),'filter':{'field':_0x824c('0x33'),'value':['admin',_0x824c('0x54')]},'ignore':!![]},{'name':_0x824c('0x55')},{'name':_0x824c('0x56')}];}break;case _0x824c('0x57'):_0x172fd6[_0x824c('0x14')]='ZendeskAccount';break;case _0x824c('0x58'):_0x172fd6['childModel']=_0x824c('0x59');break;case _0x824c('0x5a'):_0x172fd6['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x172fd6[_0x824c('0x14')]='SugarcrmAccount';break;case _0x824c('0x5b'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x5c');break;case'zohoaccounts':_0x172fd6[_0x824c('0x14')]=_0x824c('0x5d');break;case _0x824c('0x5e'):_0x172fd6['childModel']=_0x824c('0x32');break;case _0x824c('0x5f'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x60');break;case'dispositions':_0x172fd6[_0x824c('0x14')]=_0x824c('0x61');break;case'customdashboards':_0x172fd6[_0x824c('0x14')]=_0x824c('0x62');break;case _0x824c('0x63'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x64');break;case _0x824c('0x65'):_0x172fd6[_0x824c('0x14')]='Pause';break;case _0x824c('0x66'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x67');break;case _0x824c('0x68'):_0x172fd6[_0x824c('0x14')]='Sound';break;case _0x824c('0x69'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x6a');break;case _0x824c('0x6b'):_0x172fd6['childModel']=_0x824c('0x6c');break;case _0x824c('0x6d'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x6e');break;case _0x824c('0x6f'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x70');break;case _0x824c('0x71'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x72');break;case _0x824c('0x73'):_0x172fd6[_0x824c('0x14')]='Plugin';break;case _0x824c('0x74'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x75');_0x172fd6[_0x824c('0x18')]=[{'name':_0x824c('0x76'),'field':'id','foreignKey':_0x824c('0x77')}];break;case _0x824c('0x78'):_0x172fd6[_0x824c('0x14')]=_0x824c('0x79');break;}return _0x172fd6;}function _0x2e8bb0(_0x7000a8,_0x572092){var _0xcf5ab3=_0x7000a8[_0x824c('0x7a')](0x0)[_0x824c('0x7b')]()+_0x7000a8['slice'](0x1);var _0x15667e={'type':_0xb7370f[_0x824c('0x7c')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x508044,_0x3e79b2){var _0x5122f6=squel[_0x824c('0x7d')]()['field'](_0x824c('0x7e')+_0xcf5ab3+_0x824c('0x7f'),'id')[_0x824c('0x6')]('ui.createdAt')['from'](_0x824c('0x80')+_0x7000a8+_0x824c('0x81'),'ui')[_0x824c('0x82')](_0x824c('0x83'),_0x572092['id']);return _0xb7370f[_0x824c('0x84')]['query'](_0x5122f6[_0x824c('0x85')](),_0x15667e)[_0x824c('0x9')](function(_0x1290e8){_0x572092[_0xcf5ab3+_0x824c('0x86')]=_0x1290e8;_0x508044(_0x1290e8);})['catch'](function(_0x2eb51e){_0x3e79b2(_0x2eb51e);});});}return _0x21831f[_0x824c('0x87')](_0x824c('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x28ad85){var _0x3bd421={'raw':_0x28ad85['query'][_0x824c('0x89')],'where':{}};var _0x309049={};var _0x29bf84={'count':0x0,'rows':[]};var _0x19c9e0=_0x28ad85[_0x824c('0x8a')][_0x824c('0x8b')];var _0x483463=_0x28ad85[_0x824c('0x8a')][_0x824c('0x8c')]||![];var _0x529b38=_0x31eca0(_0x19c9e0,_0x483463);if(!_0x529b38[_0x824c('0x14')])throw new Error(_0x824c('0x8d')+_0x19c9e0+'\x27');var _0x566849=[{'name':_0x19c9e0}];if(!_[_0x824c('0x8e')](_0x529b38[_0x824c('0x18')]))_0x566849=_0x529b38[_0x824c('0x18')];var _0x59ab19=[];for(var _0xe02c0c=0x0;_0xe02c0c<_0x566849[_0x824c('0x8f')];_0xe02c0c++){_0x59ab19[_0x824c('0x90')](_0xb7370f[_0x824c('0x91')][_0x824c('0x92')]({'where':{'userProfileId':_0x28ad85['params']['id'],'name':_0x566849[_0xe02c0c][_0x824c('0xd')]},'raw':!![]}));}return Promise[_0x824c('0x93')](_0x59ab19)[_0x824c('0x9')](function(_0x42fb70){var _0x27af83=_[_0x824c('0x5')](_0x42fb70,function(_0x3458b8){return _0x3458b8?_0x3458b8:undefined;});var _0x209c02=_['filter'](_0x566849,[_0x824c('0x94'),!![]]);var _0x519206=_[_0x824c('0x8e')](_0x27af83)&&_[_0x824c('0x8e')](_0x209c02)?null:_[_0x824c('0x95')](_0x209c02,_0x27af83);if(!_0x519206)return null;var _0x2c9f46=[];for(var _0x3c117f=0x0;_0x3c117f<_0x519206['length'];_0x3c117f++){var _0x193d1c=_[_0x824c('0x92')](_0x566849,function(_0x57e7cd){return _0x519206[_0x3c117f]?_0x57e7cd[_0x824c('0xd')]===_0x519206[_0x3c117f][_0x824c('0xd')]:null;});if(_0x193d1c){if(_0x519206[_0x3c117f]['ignore']){_0x2c9f46[_0x824c('0x90')](_0x1ad878(_0x529b38[_0x824c('0x14')],_0x519206[_0x3c117f]));}else{if(!_0x519206[_0x3c117f][_0x824c('0x96')]){_0x2c9f46['push'](_0x137db5(_0x193d1c,_0x519206[_0x3c117f],_0x529b38[_0x824c('0x14')]));}else{if(_0x193d1c[_0x824c('0xb')]){_0x2c9f46[_0x824c('0x90')](_0xe5841e(_0x193d1c,_0x519206[_0x3c117f]));}}}}}return Promise[_0x824c('0x93')](_0x2c9f46);})['then'](function(_0x4d1a5a){var _0x2dbe56=_0x4d1a5a;var _0x31bfb8=null;if(_0x2dbe56){_0x31bfb8=_0x2dbe56[_0x824c('0x8f')]===0x1?_0x2dbe56[0x0]:null;}if(!_0x31bfb8&&!_0x2dbe56)return _0x29bf84;var _0x58b114=_0xb7370f[_0x529b38[_0x824c('0x14')]][_0x824c('0x97')];_0x309049['model']=_['keys'](_0x58b114);_0x309049[_0x824c('0x8a')]=_['keys'](_0x28ad85[_0x824c('0x8a')]);_0x309049[_0x824c('0x98')]=_['intersection'](_0x309049[_0x824c('0xb')],_0x309049[_0x824c('0x8a')]);_0x3bd421['attributes']=_['intersection'](_0x309049['model'],qs[_0x824c('0x99')](_0x28ad85[_0x824c('0x8a')][_0x824c('0x99')]));_0x3bd421[_0x824c('0x9a')]=_0x3bd421[_0x824c('0x9a')]['length']?_0x3bd421[_0x824c('0x9a')]:_0x309049[_0x824c('0xb')];if(!_0x28ad85[_0x824c('0x8a')][_0x824c('0x9b')](_0x824c('0x9c'))){_0x3bd421[_0x824c('0x9d')]=qs[_0x824c('0x9d')](_0x28ad85[_0x824c('0x8a')][_0x824c('0x9d')]);_0x3bd421[_0x824c('0x9e')]=qs[_0x824c('0x9e')](_0x28ad85[_0x824c('0x8a')]['offset']);}_0x3bd421[_0x824c('0x9f')]=qs[_0x824c('0xa0')](_0x28ad85[_0x824c('0x8a')][_0x824c('0xa0')]);_0x3bd421[_0x824c('0x82')]=qs[_0x824c('0x98')](_[_0x824c('0xa1')](_0x28ad85[_0x824c('0x8a')],_0x309049[_0x824c('0x98')]));if(_0x28ad85['query']['filter']){_0x3bd421[_0x824c('0x82')]=_['merge'](_0x3bd421[_0x824c('0x82')],{'$or':_[_0x824c('0xa')](_0x58b114,function(_0x5d5f04){if(_0x5d5f04[_0x824c('0x11')][_0x824c('0xa2')]!==_0x824c('0xa3')){var _0x5217a4={};_0x5217a4[_0x5d5f04[_0x824c('0x6')]]={'$like':'%'+_0x28ad85[_0x824c('0x8a')][_0x824c('0x5')]+'%'};return _0x5217a4;}})});}var _0x6953b8=[];var _0x2dd76c=null;var _0x3cc31f={};if(_0x31bfb8){_0x2dd76c=_[_0x824c('0x92')](_0x566849,[_0x824c('0xd'),_0x31bfb8[_0x824c('0xd')]]);if(_0x2dd76c[_0x824c('0x6')]){_0x3cc31f={};if(_0x529b38[_0x824c('0x14')]===_0x824c('0x75')){_0x3cc31f[_0x2dd76c[_0x824c('0xa4')]]=_[_0x824c('0xa')](_0x31bfb8[_0x824c('0xc')],'id');}else{_0x3cc31f[_0x2dd76c[_0x824c('0xa4')]]=_0x31bfb8['associatedResources'];}_0x6953b8['push'](_0x3cc31f);}else{_0x3bd421[_0x824c('0x82')]['id']=_0x31bfb8[_0x824c('0xc')];}}else{for(var _0x3878f8=0x0;_0x3878f8<_0x2dbe56[_0x824c('0x8f')];_0x3878f8++){_0x2dd76c=_[_0x824c('0x92')](_0x566849,[_0x824c('0xd'),_0x2dbe56[_0x3878f8][_0x824c('0xd')]]);if(_0x2dd76c['field']){_0x3cc31f={};_0x3cc31f[_0x2dd76c['foreignKey']]=_0x2dbe56[_0x3878f8][_0x824c('0xc')];_0x6953b8[_0x824c('0x90')](_0x3cc31f);}else{if(!_0x3bd421[_0x824c('0x82')]['id'])_0x3bd421[_0x824c('0x82')]['id']=[];_0x2dbe56[_0x3878f8][_0x824c('0xc')][_0x824c('0xa5')](function(_0x1a4e64){_0x3bd421['where']['id'][_0x824c('0x90')](_0x1a4e64);});}}}if(!_[_0x824c('0x8e')](_0x6953b8)){_0x3bd421['where']=_[_0x824c('0xa6')](_0x3bd421['where'],{'$and':{'$or':_0x6953b8}});}_0x3bd421=_['merge']({},_0x3bd421,_0x28ad85[_0x824c('0xa7')]);if(_0x31bfb8&&!_0x31bfb8[_0x824c('0x96')]&&_0x529b38[_0x824c('0x14')]===_0x824c('0x75')){if(_0x28ad85['query'][_0x824c('0xa8')]){_0x3bd421[_0x824c('0xa9')]=[{'all':!![]}];}return _0xb7370f[_0x529b38['childModel']][_0x824c('0x8')](_0x3bd421)[_0x824c('0x9')](function(_0x400b91){var _0x40ad90=[];_0x400b91[_0x824c('0xa5')](function(_0x5aab87){var _0x333709;switch(_0x5aab87[_0x824c('0xaa')]){case _0x824c('0xab'):_0x333709=_[_0x824c('0x92')](_0x31bfb8[_0x824c('0xc')],function(_0x3899db){return _0x3899db['id']===_0x5aab87[_0x824c('0x77')]&&_0x3899db[_0x824c('0x11')]===_0x824c('0xac');});break;case'custom':_0x333709=_['find'](_0x31bfb8[_0x824c('0xc')],function(_0x197787){return _0x197787['id']===_0x5aab87[_0x824c('0x77')]&&_0x197787[_0x824c('0x11')]===_0x824c('0xad');});break;}if(_0x333709)_0x40ad90[_0x824c('0x90')](_0x5aab87);});_0x29bf84['count']=_0x40ad90[_0x824c('0x8f')];_0x29bf84[_0x824c('0xae')]=_0x40ad90;return _0x29bf84;});}else{return _0xb7370f[_0x529b38[_0x824c('0x14')]][_0x824c('0xaf')]({'where':_0x3bd421['where']})[_0x824c('0x9')](function(_0x5031c5){_0x29bf84['count']=_0x5031c5;if(_0x28ad85[_0x824c('0x8a')][_0x824c('0xa8')]){if(_0x529b38[_0x824c('0x14')]===_0x824c('0x1d')){_0x3bd421[_0x824c('0xa9')]=[{'model':_0xb7370f['Tag'],'as':_0x824c('0xb0'),'attributes':['id','name',_0x824c('0xb1')],'required':_0x28ad85[_0x824c('0x8a')][_0x824c('0xb2')]?!![]:![]},{'model':_0xb7370f[_0x824c('0x6a')],'as':'ThroughTags','attributes':['id',_0x824c('0xd'),_0x824c('0xb1')],'through':_0x28ad85[_0x824c('0x8a')][_0x824c('0xb2')]?{'attributes':[],'where':{'TagId':_0x28ad85[_0x824c('0x8a')]['tag']||undefined}}:{},'required':_0x28ad85['query'][_0x824c('0xb2')]?!![]:![]}];}else{_0x3bd421[_0x824c('0xa9')]=[{'all':!![]}];}}return _0xb7370f[_0x529b38[_0x824c('0x14')]][_0x824c('0x8')](_0x3bd421);})['then'](function(_0x14e8eb){_0x29bf84['rows']=_0x14e8eb;if(_0x19c9e0===_0x824c('0x55')&&_0x28ad85[_0x824c('0x8a')][_0x824c('0xb3')]==='true'){var _0x55164b=[];for(var _0x9670f1=0x0;_0x9670f1<_0x29bf84['rows'][_0x824c('0x8f')];_0x9670f1++){_0x55164b[_0x824c('0x90')](_0x2e8bb0(_0x824c('0xb4'),_0x29bf84[_0x824c('0xae')][_0x9670f1][_0x824c('0xb5')]));_0x55164b['push'](_0x2e8bb0(_0x824c('0xb6'),_0x29bf84['rows'][_0x9670f1][_0x824c('0xb5')]));_0x55164b[_0x824c('0x90')](_0x2e8bb0(_0x824c('0xb7'),_0x29bf84['rows'][_0x9670f1][_0x824c('0xb5')]));_0x55164b[_0x824c('0x90')](_0x2e8bb0(_0x824c('0xb8'),_0x29bf84['rows'][_0x9670f1][_0x824c('0xb5')]));_0x55164b[_0x824c('0x90')](_0x2e8bb0(_0x824c('0xb9'),_0x29bf84[_0x824c('0xae')][_0x9670f1][_0x824c('0xb5')]));_0x55164b[_0x824c('0x90')](_0x2e8bb0('whatsapp',_0x29bf84[_0x824c('0xae')][_0x9670f1]['dataValues']));}return Promise[_0x824c('0x93')](_0x55164b)[_0x824c('0x9')](function(){return _0x29bf84;});}return _0x29bf84;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index dcd4176..3717a38 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 _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x2b0ab6,_0x545877){var _0x15e701=function(_0x1c5d47){while(--_0x1c5d47){_0x2b0ab6['push'](_0x2b0ab6['shift']());}};_0x15e701(++_0x545877);}(_0xacc6,0x150));var _0x6acc=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xacc6[_0xdd2bfa];return _0x55397e;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});config['redis']=_[_0x6acc('0xb')](config['redis'],{'host':_0x6acc('0xc'),'port':0x18eb});var socket=require(_0x6acc('0xd'))(new Redis(config[_0x6acc('0xe')]));require(_0x6acc('0xf'))['register'](socket);function respondWithRpcPromise(_0x1343cb,_0x4cf4c7,_0x3c1a24){return new BPromise(function(_0x21b624,_0xb8647d){return client[_0x6acc('0x10')](_0x1343cb,_0x3c1a24)[_0x6acc('0x11')](function(_0x15b64b){logger['info'](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));logger[_0x6acc('0x14')](_0x6acc('0x15'),_0x4cf4c7,_0x6acc('0x13'),JSON['stringify'](_0x15b64b));if(_0x15b64b['error']){if(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x17')]===0x1f4){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0xb8647d(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0x21b624(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}else{logger[_0x6acc('0x19')](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));_0x21b624(_0x15b64b[_0x6acc('0x1a')]['message']);}})[_0x6acc('0x1b')](function(_0x43b8ca){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x43b8ca);_0xb8647d(_0x43b8ca);});});} \ No newline at end of file +var _0x82c4=['then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x1332c4,_0x454efc){var _0x4b9678=function(_0x3b9649){while(--_0x3b9649){_0x1332c4['push'](_0x1332c4['shift']());}};_0x4b9678(++_0x454efc);}(_0x82c4,0x1ca));var _0x482c=function(_0x2d305b,_0x459d7c){_0x2d305b=_0x2d305b-0x0;var _0x52be39=_0x82c4[_0x2d305b];return _0x52be39;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});config[_0x482c('0xa')]=_[_0x482c('0xb')](config[_0x482c('0xa')],{'host':_0x482c('0xc'),'port':0x18eb});var socket=require(_0x482c('0xd'))(new Redis(config['redis']));require(_0x482c('0xe'))[_0x482c('0xf')](socket);function respondWithRpcPromise(_0x3859ad,_0xc59d41,_0x3c6c56){return new BPromise(function(_0x17e233,_0x51967f){return client[_0x482c('0x10')](_0x3859ad,_0x3c6c56)[_0x482c('0x11')](function(_0x1ed3ff){logger['info'](_0x482c('0x12'),_0xc59d41,_0x482c('0x13'));logger[_0x482c('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xc59d41,'request\x20sent',JSON[_0x482c('0x15')](_0x1ed3ff));if(_0x1ed3ff[_0x482c('0x16')]){if(_0x1ed3ff['error']['code']===0x1f4){logger[_0x482c('0x16')](_0x482c('0x12'),_0xc59d41,_0x1ed3ff[_0x482c('0x16')][_0x482c('0x17')]);return _0x51967f(_0x1ed3ff[_0x482c('0x16')][_0x482c('0x17')]);}logger[_0x482c('0x16')](_0x482c('0x12'),_0xc59d41,_0x1ed3ff[_0x482c('0x16')][_0x482c('0x17')]);return _0x17e233(_0x1ed3ff[_0x482c('0x16')][_0x482c('0x17')]);}else{logger['info'](_0x482c('0x12'),_0xc59d41,'request\x20sent');_0x17e233(_0x1ed3ff[_0x482c('0x18')][_0x482c('0x17')]);}})['catch'](function(_0x4bd270){logger[_0x482c('0x16')]('UserProfile,\x20%s,\x20%s',_0xc59d41,_0x4bd270);_0x51967f(_0x4bd270);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index c6a6b9a..15c5f0a 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 _0x19d4=['remove','update','emit','removeListener','register','length','userProfile:','./userProfile.events','save'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x19d4,0x1a5));var _0x419d=function(_0x406ba6,_0x4abfd9){_0x406ba6=_0x406ba6-0x0;var _0x2ccfc7=_0x19d4[_0x406ba6];return _0x2ccfc7;};'use strict';var UserProfileEvents=require(_0x419d('0x0'));var events=[_0x419d('0x1'),_0x419d('0x2'),_0x419d('0x3')];function createListener(_0x22c17b,_0x112d70){return function(_0x44f47b){_0x112d70[_0x419d('0x4')](_0x22c17b,_0x44f47b);};}function removeListener(_0x269ebb,_0x4ca3f9){return function(){UserProfileEvents[_0x419d('0x5')](_0x269ebb,_0x4ca3f9);};}exports[_0x419d('0x6')]=function(_0x2030bb){for(var _0x13f723=0x0,_0x228dce=events[_0x419d('0x7')];_0x13f723<_0x228dce;_0x13f723++){var _0x3378e9=events[_0x13f723];var _0x50ba85=createListener(_0x419d('0x8')+_0x3378e9,_0x2030bb);UserProfileEvents['on'](_0x3378e9,_0x50ba85);}}; \ No newline at end of file +var _0x4f32=['save','userProfile:','./userProfile.events'];(function(_0x346c99,_0x28829b){var _0x593189=function(_0x2f20c4){while(--_0x2f20c4){_0x346c99['push'](_0x346c99['shift']());}};_0x593189(++_0x28829b);}(_0x4f32,0x116));var _0x24f3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f32[_0x2dafbe];return _0x58a45a;};'use strict';var UserProfileEvents=require(_0x24f3('0x0'));var events=[_0x24f3('0x1'),'remove','update'];function createListener(_0x458229,_0x5dbc1c){return function(_0x17ba3e){_0x5dbc1c['emit'](_0x458229,_0x17ba3e);};}function removeListener(_0x5d81bd,_0x393f47){return function(){UserProfileEvents['removeListener'](_0x5d81bd,_0x393f47);};}exports['register']=function(_0x3de688){for(var _0x345d46=0x0,_0x5e6ebd=events['length'];_0x345d46<_0x5e6ebd;_0x345d46++){var _0x3d84c2=events[_0x345d46];var _0x540715=createListener(_0x24f3('0x2')+_0x3d84c2,_0x3de688);UserProfileEvents['on'](_0x3d84c2,_0x540715);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 46fc37a..18d7fa6 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 _0x7433=['../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','show','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x308b5c,_0x31bf56){var _0x2de469=function(_0x298e66){while(--_0x298e66){_0x308b5c['push'](_0x308b5c['shift']());}};_0x2de469(++_0x31bf56);}(_0x7433,0x1e7));var _0x3743=function(_0x3d3d7b,_0x5c0937){_0x3d3d7b=_0x3d3d7b-0x0;var _0x33e7c8=_0x7433[_0x3d3d7b];return _0x33e7c8;};'use strict';var multer=require(_0x3743('0x0'));var util=require('util');var path=require(_0x3743('0x1'));var timeout=require(_0x3743('0x2'));var express=require(_0x3743('0x3'));var router=express['Router']();var fs_extra=require(_0x3743('0x4'));var auth=require(_0x3743('0x5'));var interaction=require(_0x3743('0x6'));var config=require(_0x3743('0x7'));var controller=require(_0x3743('0x8'));router['get']('/',auth[_0x3743('0x9')](),controller['index']);router[_0x3743('0xa')](_0x3743('0xb'),auth['isAuthenticated'](),controller[_0x3743('0xc')]);router[_0x3743('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3743('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3743('0xe')]);router[_0x3743('0xf')](_0x3743('0x10'),auth[_0x3743('0x9')](),controller['update']);router['delete'](_0x3743('0x10'),auth[_0x3743('0x9')](),controller[_0x3743('0x11')]);module[_0x3743('0x12')]=router; \ No newline at end of file +var _0xfbac=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfileResource.controller','index','/describe','describe','get','isAuthenticated','show','post','create','put','/:id','update','delete','util'];(function(_0x1a84aa,_0x2366e7){var _0x1bf452=function(_0x536dc6){while(--_0x536dc6){_0x1a84aa['push'](_0x1a84aa['shift']());}};_0x1bf452(++_0x2366e7);}(_0xfbac,0x167));var _0xcfba=function(_0x1e3508,_0x4f2c9b){_0x1e3508=_0x1e3508-0x0;var _0x5cb3c7=_0xfbac[_0x1e3508];return _0x5cb3c7;};'use strict';var multer=require('multer');var util=require(_0xcfba('0x0'));var path=require(_0xcfba('0x1'));var timeout=require(_0xcfba('0x2'));var express=require(_0xcfba('0x3'));var router=express[_0xcfba('0x4')]();var fs_extra=require(_0xcfba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcfba('0x6'));var controller=require(_0xcfba('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcfba('0x8')]);router['get'](_0xcfba('0x9'),auth['isAuthenticated'](),controller[_0xcfba('0xa')]);router[_0xcfba('0xb')]('/:id',auth[_0xcfba('0xc')](),controller[_0xcfba('0xd')]);router[_0xcfba('0xe')]('/',auth[_0xcfba('0xc')](),controller[_0xcfba('0xf')]);router[_0xcfba('0x10')](_0xcfba('0x11'),auth[_0xcfba('0xc')](),controller[_0xcfba('0x12')]);router[_0xcfba('0x13')](_0xcfba('0x11'),auth[_0xcfba('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b7aee4a..fc701b0 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 _0x4aa6=['exports','STRING','INTEGER','sequelize'];(function(_0x21365b,_0x25e7e8){var _0x3dde6a=function(_0x6612af){while(--_0x6612af){_0x21365b['push'](_0x21365b['shift']());}};_0x3dde6a(++_0x25e7e8);}(_0x4aa6,0x87));var _0x64aa=function(_0x3f7dc6,_0x2a513a){_0x3f7dc6=_0x3f7dc6-0x0;var _0x2d89a3=_0x4aa6[_0x3f7dc6];return _0x2d89a3;};'use strict';var Sequelize=require(_0x64aa('0x0'));module[_0x64aa('0x1')]={'name':{'type':Sequelize[_0x64aa('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x64aa('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1471=['INTEGER','sequelize','STRING'];(function(_0x46bf80,_0x28e76a){var _0x558a67=function(_0x4eb35d){while(--_0x4eb35d){_0x46bf80['push'](_0x46bf80['shift']());}};_0x558a67(++_0x28e76a);}(_0x1471,0x18d));var _0x1147=function(_0x34eafe,_0x404e92){_0x34eafe=_0x34eafe-0x0;var _0x3b3bb5=_0x1471[_0x34eafe];return _0x3b3bb5;};'use strict';var Sequelize=require(_0x1147('0x0'));module['exports']={'name':{'type':Sequelize[_0x1147('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1147('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 47b1e90..dbe5f9f 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x44a75b,_0x3b156a){var _0x424fc0=function(_0x6571bb){while(--_0x6571bb){_0x44a75b['push'](_0x44a75b['shift']());}};_0x424fc0(++_0x3b156a);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa45f22,_0x407cdb){_0xa45f22=_0xa45f22-0x0;var _0x16b225=_0x5f2f[_0xa45f22];return _0x16b225;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));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('0x9'));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 licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','UserProfileResource','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1623,0xab));var _0x3162=function(_0x43d577,_0x84761f){_0x43d577=_0x43d577-0x0;var _0xdb14e7=_0x1623[_0x43d577];return _0xdb14e7;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['UserProfileResource'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['UserProfileResource'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 54095cb..bc47dc1 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 _0x5118=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','UserProfileResource'];(function(_0x5d193f,_0x288763){var _0x4c1789=function(_0x4727bc){while(--_0x4727bc){_0x5d193f['push'](_0x5d193f['shift']());}};_0x4c1789(++_0x288763);}(_0x5118,0x90));var _0x8511=function(_0x150d01,_0x40fad1){_0x150d01=_0x150d01-0x0;var _0x28e865=_0x5118[_0x150d01];return _0x28e865;};'use strict';var _=require(_0x8511('0x0'));var util=require(_0x8511('0x1'));var logger=require(_0x8511('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8511('0x3'));var rp=require(_0x8511('0x4'));var fs=require('fs');var path=require(_0x8511('0x5'));var rimraf=require(_0x8511('0x6'));var config=require('../../config/environment');var attributes=require(_0x8511('0x7'));module[_0x8511('0x8')]=function(_0x489901,_0x151476){return _0x489901['define'](_0x8511('0x9'),attributes,{'tableName':_0x8511('0xa'),'paranoid':![],'indexes':[{'name':_0x8511('0xb'),'fields':[_0x8511('0xc'),_0x8511('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae50=['exports','define','compositeIndex','resourceId','lodash','util','api','moment','bluebird','path'];(function(_0x265860,_0x307636){var _0x1915af=function(_0x5871da){while(--_0x5871da){_0x265860['push'](_0x265860['shift']());}};_0x1915af(++_0x307636);}(_0xae50,0xe0));var _0x0ae5=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0xae50[_0x50fda9];return _0x36b92b;};'use strict';var _=require(_0x0ae5('0x0'));var util=require(_0x0ae5('0x1'));var logger=require('../../config/logger')(_0x0ae5('0x2'));var moment=require(_0x0ae5('0x3'));var BPromise=require(_0x0ae5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ae5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x0ae5('0x6')]=function(_0x25b737,_0xb9cc07){return _0x25b737[_0x0ae5('0x7')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x0ae5('0x8'),'fields':[_0x0ae5('0x9'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 367d4d8..40853d9 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 _0x8388=['catch','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x8388,0xac));var _0x8838=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x8388[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8838('0x0'));var fs=require('fs');var Redis=require(_0x8838('0x1'));var db=require(_0x8838('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8838('0x3'))(_0x8838('0x4'));var config=require(_0x8838('0x5'));var jayson=require(_0x8838('0x6'));var client=jayson[_0x8838('0x7')][_0x8838('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46c6a0,_0x210262,_0x5e222e){return new BPromise(function(_0x26d65c,_0x43a7d0){return client['request'](_0x46c6a0,_0x5e222e)[_0x8838('0x9')](function(_0x4a04e3){logger[_0x8838('0xa')](_0x8838('0xb'),_0x210262,'request\x20sent');logger[_0x8838('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x210262,_0x8838('0xd'),JSON[_0x8838('0xe')](_0x4a04e3));if(_0x4a04e3[_0x8838('0xf')]){if(_0x4a04e3[_0x8838('0xf')][_0x8838('0x10')]===0x1f4){logger['error'](_0x8838('0xb'),_0x210262,_0x4a04e3['error'][_0x8838('0x11')]);return _0x43a7d0(_0x4a04e3[_0x8838('0xf')]['message']);}logger[_0x8838('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x210262,_0x4a04e3[_0x8838('0xf')][_0x8838('0x11')]);return _0x26d65c(_0x4a04e3[_0x8838('0xf')][_0x8838('0x11')]);}else{logger['info'](_0x8838('0xb'),_0x210262,_0x8838('0xd'));_0x26d65c(_0x4a04e3['result'][_0x8838('0x11')]);}})[_0x8838('0x12')](function(_0x38a2df){logger[_0x8838('0xf')](_0x8838('0xb'),_0x210262,_0x38a2df);_0x43a7d0(_0x38a2df);});});} \ No newline at end of file +var _0x330c=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x2f4830,_0x3be74b){var _0x224115=function(_0x6ce92){while(--_0x6ce92){_0x2f4830['push'](_0x2f4830['shift']());}};_0x224115(++_0x3be74b);}(_0x330c,0x14e));var _0xc330=function(_0x5c8f85,_0x7957cc){_0x5c8f85=_0x5c8f85-0x0;var _0x319d90=_0x330c[_0x5c8f85];return _0x319d90;};'use strict';var _=require('lodash');var util=require(_0xc330('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc330('0x1'));var fs=require('fs');var Redis=require(_0xc330('0x2'));var db=require(_0xc330('0x3'))['db'];var utils=require(_0xc330('0x4'));var logger=require(_0xc330('0x5'))('rpc');var config=require(_0xc330('0x6'));var jayson=require(_0xc330('0x7'));var client=jayson[_0xc330('0x8')][_0xc330('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x360d53,_0x1d9ffa,_0x560fdb){return new BPromise(function(_0x404a8d,_0x3e19ef){return client[_0xc330('0xa')](_0x360d53,_0x560fdb)[_0xc330('0xb')](function(_0x2a3d7b){logger[_0xc330('0xc')](_0xc330('0xd'),_0x1d9ffa,_0xc330('0xe'));logger[_0xc330('0xf')](_0xc330('0x10'),_0x1d9ffa,_0xc330('0xe'),JSON[_0xc330('0x11')](_0x2a3d7b));if(_0x2a3d7b[_0xc330('0x12')]){if(_0x2a3d7b['error'][_0xc330('0x13')]===0x1f4){logger[_0xc330('0x12')](_0xc330('0xd'),_0x1d9ffa,_0x2a3d7b[_0xc330('0x12')][_0xc330('0x14')]);return _0x3e19ef(_0x2a3d7b[_0xc330('0x12')]['message']);}logger[_0xc330('0x12')](_0xc330('0xd'),_0x1d9ffa,_0x2a3d7b['error'][_0xc330('0x14')]);return _0x404a8d(_0x2a3d7b[_0xc330('0x12')][_0xc330('0x14')]);}else{logger[_0xc330('0xc')](_0xc330('0xd'),_0x1d9ffa,'request\x20sent');_0x404a8d(_0x2a3d7b[_0xc330('0x15')][_0xc330('0x14')]);}})[_0xc330('0x16')](function(_0x5f5ab7){logger[_0xc330('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x1d9ffa,_0x5f5ab7);_0x3e19ef(_0x5f5ab7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c8ad4e5..9f01131 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 _0x6fce=['isAuthenticated','describe','show','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x6fce,0x12e));var _0xe6fc=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6fce[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xe6fc('0x0'));var util=require(_0xe6fc('0x1'));var path=require(_0xe6fc('0x2'));var timeout=require(_0xe6fc('0x3'));var express=require(_0xe6fc('0x4'));var router=express[_0xe6fc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe6fc('0x6'));var interaction=require(_0xe6fc('0x7'));var config=require(_0xe6fc('0x8'));var controller=require(_0xe6fc('0x9'));router[_0xe6fc('0xa')]('/',auth['isAuthenticated'](),controller[_0xe6fc('0xb')]);router[_0xe6fc('0xa')](_0xe6fc('0xc'),auth[_0xe6fc('0xd')](),controller[_0xe6fc('0xe')]);router['get']('/:id',auth[_0xe6fc('0xd')](),controller[_0xe6fc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe6fc('0x10')]);router[_0xe6fc('0x11')](_0xe6fc('0x12'),auth[_0xe6fc('0xd')](),controller['update']);router[_0xe6fc('0x13')](_0xe6fc('0x12'),auth[_0xe6fc('0xd')](),controller['destroy']);module[_0xe6fc('0x14')]=router; \ No newline at end of file +var _0x6d0e=['get','index','/describe','describe','/:id','isAuthenticated','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb8d9bc,_0x1cea27){var _0x2fbc8e=function(_0x15b2c4){while(--_0x15b2c4){_0xb8d9bc['push'](_0xb8d9bc['shift']());}};_0x2fbc8e(++_0x1cea27);}(_0x6d0e,0x127));var _0xe6d0=function(_0x548991,_0x12889a){_0x548991=_0x548991-0x0;var _0x274119=_0x6d0e[_0x548991];return _0x274119;};'use strict';var multer=require(_0xe6d0('0x0'));var util=require(_0xe6d0('0x1'));var path=require(_0xe6d0('0x2'));var timeout=require(_0xe6d0('0x3'));var express=require(_0xe6d0('0x4'));var router=express[_0xe6d0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe6d0('0x6'));var interaction=require(_0xe6d0('0x7'));var config=require(_0xe6d0('0x8'));var controller=require('./userProfileSection.controller');router[_0xe6d0('0x9')]('/',auth['isAuthenticated'](),controller[_0xe6d0('0xa')]);router[_0xe6d0('0x9')](_0xe6d0('0xb'),auth['isAuthenticated'](),controller[_0xe6d0('0xc')]);router['get'](_0xe6d0('0xd'),auth[_0xe6d0('0xe')](),controller['show']);router[_0xe6d0('0xf')]('/',auth[_0xe6d0('0xe')](),controller['create']);router[_0xe6d0('0x10')](_0xe6d0('0xd'),auth[_0xe6d0('0xe')](),controller[_0xe6d0('0x11')]);router['delete'](_0xe6d0('0xd'),auth[_0xe6d0('0xe')](),controller[_0xe6d0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 72899af..6da3809 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 _0x0fd9=['join','getDataValue','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x2c6f64,_0x10a3bd){var _0x4baaa1=function(_0x449b9d){while(--_0x449b9d){_0x2c6f64['push'](_0x2c6f64['shift']());}};_0x4baaa1(++_0x10a3bd);}(_0x0fd9,0xa3));var _0x90fd=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x0fd9[_0x58c20f];return _0x3b0318;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'name':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x90fd('0x1')],'set':function(_0x2a5f76){this[_0x90fd('0x3')](_0x90fd('0x4'),_0x2a5f76?_0x2a5f76[_0x90fd('0x5')](''):[]);},'get':function(){return this[_0x90fd('0x6')]('crudPermissions')?this['getDataValue'](_0x90fd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x57580f,_0x241af8){var _0x418eaa=function(_0x2c3085){while(--_0x2c3085){_0x57580f['push'](_0x57580f['shift']());}};_0x418eaa(++_0x241af8);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x197c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x197c('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x197c('0x2')],'set':function(_0x26833e){this[_0x197c('0x4')](_0x197c('0x5'),_0x26833e?_0x26833e['join'](''):[]);},'get':function(){return this['getDataValue'](_0x197c('0x5'))?this[_0x197c('0x6')](_0x197c('0x5'))[_0x197c('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c605198..e0c3d60 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 _0xa8a9=['mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','then','include','findAll','rows','catch','fields','length','includeAll','create','body','find','params','destroy','describe','request-promise','moment','bluebird'];(function(_0x5b8e43,_0x3dec7e){var _0x35be9a=function(_0xd16bf9){while(--_0xd16bf9){_0x5b8e43['push'](_0x5b8e43['shift']());}};_0x35be9a(++_0x3dec7e);}(_0xa8a9,0x125));var _0x9a8a=function(_0x9e227f,_0x2b0f13){_0x9e227f=_0x9e227f-0x0;var _0x467d20=_0xa8a9[_0x9e227f];return _0x467d20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a8a('0x0'));var moment=require(_0x9a8a('0x1'));var BPromise=require(_0x9a8a('0x2'));var Mustache=require(_0x9a8a('0x3'));var util=require(_0x9a8a('0x4'));var path=require(_0x9a8a('0x5'));var sox=require(_0x9a8a('0x6'));var csv=require(_0x9a8a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a8a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a8a('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a8a('0xa'));var Papa=require(_0x9a8a('0xb'));var Redis=require(_0x9a8a('0xc'));var authService=require(_0x9a8a('0xd'));var qs=require(_0x9a8a('0xe'));var as=require(_0x9a8a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a8a('0x10'))(_0x9a8a('0x11'));var utils=require(_0x9a8a('0x12'));var config=require(_0x9a8a('0x13'));var licenseUtil=require(_0x9a8a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf20022,_0x178954){_0x178954=_0x178954||0xcc;return function(_0x424608){if(_0x424608){return _0xf20022[_0x9a8a('0x15')](_0x178954);}return _0xf20022[_0x9a8a('0x16')](_0x178954)[_0x9a8a('0x17')]();};}function respondWithResult(_0x2f2197,_0xa83510){_0xa83510=_0xa83510||0xc8;return function(_0x1d04e6){if(_0x1d04e6){return _0x2f2197[_0x9a8a('0x16')](_0xa83510)[_0x9a8a('0x18')](_0x1d04e6);}};}function respondWithFilteredResult(_0x58ffb9,_0x1d5d01){return function(_0x4f4f8e){if(_0x4f4f8e){var _0x8cfa76=typeof _0x1d5d01[_0x9a8a('0x19')]===_0x9a8a('0x1a')&&typeof _0x1d5d01['limit']===_0x9a8a('0x1a');var _0x1c8ac9=_0x4f4f8e['count'];var _0x484352=_0x8cfa76?0x0:_0x1d5d01[_0x9a8a('0x19')];var _0x45b0ac=_0x8cfa76?_0x4f4f8e[_0x9a8a('0x1b')]:_0x1d5d01[_0x9a8a('0x19')]+_0x1d5d01[_0x9a8a('0x1c')];var _0x2bd6c7;if(_0x45b0ac>=_0x1c8ac9){_0x45b0ac=_0x1c8ac9;_0x2bd6c7=0xc8;}else{_0x2bd6c7=0xce;}_0x58ffb9[_0x9a8a('0x16')](_0x2bd6c7);return _0x58ffb9[_0x9a8a('0x1d')](_0x9a8a('0x1e'),_0x484352+'-'+_0x45b0ac+'/'+_0x1c8ac9)[_0x9a8a('0x18')](_0x4f4f8e);}return null;};}function patchUpdates(_0x5367bd){return function(_0x12a80e){try{jsonpatch[_0x9a8a('0x1f')](_0x12a80e,_0x5367bd,!![]);}catch(_0x3b7125){return BPromise[_0x9a8a('0x20')](_0x3b7125);}return _0x12a80e[_0x9a8a('0x21')]();};}function saveUpdates(_0x30937c,_0x5c8064){return function(_0x946b2d){if(_0x946b2d){return _0x946b2d[_0x9a8a('0x22')](_0x30937c)['then'](function(_0xf97811){return _0xf97811;});}return null;};}function removeEntity(_0x249b97,_0x4e7807){return function(_0x5e43ec){if(_0x5e43ec){return _0x5e43ec['destroy']()['then'](function(){_0x249b97[_0x9a8a('0x16')](0xcc)[_0x9a8a('0x17')]();});}};}function handleEntityNotFound(_0x15bac1,_0x136b43){return function(_0x3ae68d){if(!_0x3ae68d){_0x15bac1['sendStatus'](0x194);}return _0x3ae68d;};}function handleError(_0x10ebc4,_0x119ecf){_0x119ecf=_0x119ecf||0x1f4;return function(_0x525587){logger['error'](_0x525587[_0x9a8a('0x23')]);if(_0x525587[_0x9a8a('0x24')]){delete _0x525587[_0x9a8a('0x24')];}_0x10ebc4['status'](_0x119ecf)[_0x9a8a('0x25')](_0x525587);};}exports[_0x9a8a('0x26')]=function(_0x490bf8,_0x12419c){var _0x5ee415={},_0x4a8ed3={},_0x5e9338={'count':0x0,'rows':[]};var _0x28a90e=_[_0x9a8a('0x27')](db[_0x9a8a('0x28')][_0x9a8a('0x29')],function(_0x32aff0){return{'name':_0x32aff0[_0x9a8a('0x2a')],'type':_0x32aff0[_0x9a8a('0x2b')][_0x9a8a('0x2c')]};});_0x4a8ed3[_0x9a8a('0x2d')]=_[_0x9a8a('0x27')](_0x28a90e,_0x9a8a('0x24'));_0x4a8ed3[_0x9a8a('0x2e')]=_[_0x9a8a('0x2f')](_0x490bf8[_0x9a8a('0x2e')]);_0x4a8ed3['filters']=_[_0x9a8a('0x30')](_0x4a8ed3[_0x9a8a('0x2d')],_0x4a8ed3[_0x9a8a('0x2e')]);_0x5ee415[_0x9a8a('0x31')]=_[_0x9a8a('0x30')](_0x4a8ed3[_0x9a8a('0x2d')],qs['fields'](_0x490bf8[_0x9a8a('0x2e')]['fields']));_0x5ee415[_0x9a8a('0x31')]=_0x5ee415[_0x9a8a('0x31')]['length']?_0x5ee415['attributes']:_0x4a8ed3[_0x9a8a('0x2d')];if(!_0x490bf8[_0x9a8a('0x2e')][_0x9a8a('0x32')](_0x9a8a('0x33'))){_0x5ee415[_0x9a8a('0x1c')]=qs[_0x9a8a('0x1c')](_0x490bf8['query'][_0x9a8a('0x1c')]);_0x5ee415[_0x9a8a('0x19')]=qs[_0x9a8a('0x19')](_0x490bf8['query']['offset']);}_0x5ee415['order']=qs[_0x9a8a('0x34')](_0x490bf8[_0x9a8a('0x2e')][_0x9a8a('0x34')]);_0x5ee415[_0x9a8a('0x35')]=qs['filters'](_[_0x9a8a('0x36')](_0x490bf8[_0x9a8a('0x2e')],_0x4a8ed3[_0x9a8a('0x37')]),_0x28a90e);if(_0x490bf8[_0x9a8a('0x2e')][_0x9a8a('0x38')]){_0x5ee415[_0x9a8a('0x35')]=_['merge'](_0x5ee415[_0x9a8a('0x35')],{'$or':_[_0x9a8a('0x27')](_0x28a90e,function(_0x19f9ad){if(_0x19f9ad[_0x9a8a('0x2b')]!==_0x9a8a('0x39')){var _0x42a0ab={};_0x42a0ab[_0x19f9ad['name']]={'$like':'%'+_0x490bf8[_0x9a8a('0x2e')][_0x9a8a('0x38')]+'%'};return _0x42a0ab;}})});}_0x5ee415=_[_0x9a8a('0x3a')]({},_0x5ee415,_0x490bf8[_0x9a8a('0x3b')]);var _0xdcfefe={'where':_0x5ee415[_0x9a8a('0x35')]};return db[_0x9a8a('0x28')][_0x9a8a('0x1b')](_0xdcfefe)[_0x9a8a('0x3c')](function(_0x328db1){_0x5e9338['count']=_0x328db1;if(_0x490bf8[_0x9a8a('0x2e')]['includeAll']){_0x5ee415[_0x9a8a('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0x9a8a('0x3e')](_0x5ee415);})[_0x9a8a('0x3c')](function(_0x961384){_0x5e9338[_0x9a8a('0x3f')]=_0x961384;return _0x5e9338;})['then'](respondWithFilteredResult(_0x12419c,_0x5ee415))[_0x9a8a('0x40')](handleError(_0x12419c,null));};exports['show']=function(_0x5ad0c1,_0x354d39){var _0x195160={'raw':![],'where':{'id':_0x5ad0c1['params']['id']}},_0x260966={};_0x260966['model']=_['keys'](db[_0x9a8a('0x28')][_0x9a8a('0x29')]);_0x260966['query']=_['keys'](_0x5ad0c1[_0x9a8a('0x2e')]);_0x260966[_0x9a8a('0x37')]=_[_0x9a8a('0x30')](_0x260966[_0x9a8a('0x2d')],_0x260966[_0x9a8a('0x2e')]);_0x195160[_0x9a8a('0x31')]=_[_0x9a8a('0x30')](_0x260966['model'],qs[_0x9a8a('0x41')](_0x5ad0c1[_0x9a8a('0x2e')][_0x9a8a('0x41')]));_0x195160['attributes']=_0x195160['attributes'][_0x9a8a('0x42')]?_0x195160['attributes']:_0x260966[_0x9a8a('0x2d')];if(_0x5ad0c1[_0x9a8a('0x2e')][_0x9a8a('0x43')]){_0x195160[_0x9a8a('0x3d')]=[{'all':!![]}];}_0x195160=_[_0x9a8a('0x3a')]({},_0x195160,_0x5ad0c1[_0x9a8a('0x3b')]);return db[_0x9a8a('0x28')]['find'](_0x195160)[_0x9a8a('0x3c')](handleEntityNotFound(_0x354d39,null))[_0x9a8a('0x3c')](respondWithResult(_0x354d39,null))[_0x9a8a('0x40')](handleError(_0x354d39,null));};exports[_0x9a8a('0x44')]=function(_0x30a428,_0x320349){return db[_0x9a8a('0x28')][_0x9a8a('0x44')](_0x30a428['body'],{})[_0x9a8a('0x3c')](respondWithResult(_0x320349,0xc9))[_0x9a8a('0x40')](handleError(_0x320349,null));};exports[_0x9a8a('0x22')]=function(_0x43b64d,_0xb381c2){if(_0x43b64d[_0x9a8a('0x45')]['id']){delete _0x43b64d[_0x9a8a('0x45')]['id'];}return db[_0x9a8a('0x28')][_0x9a8a('0x46')]({'where':{'id':_0x43b64d[_0x9a8a('0x47')]['id']}})[_0x9a8a('0x3c')](handleEntityNotFound(_0xb381c2,null))[_0x9a8a('0x3c')](saveUpdates(_0x43b64d[_0x9a8a('0x45')],null))['then'](respondWithResult(_0xb381c2,null))[_0x9a8a('0x40')](handleError(_0xb381c2,null));};exports[_0x9a8a('0x48')]=function(_0x23371c,_0x38ff5c){return db['UserProfileSection'][_0x9a8a('0x46')]({'where':{'id':_0x23371c[_0x9a8a('0x47')]['id']}})[_0x9a8a('0x3c')](handleEntityNotFound(_0x38ff5c,null))['then'](removeEntity(_0x38ff5c,null))[_0x9a8a('0x40')](handleError(_0x38ff5c,null));};exports['describe']=function(_0x379493,_0x5e45b4){return db[_0x9a8a('0x28')][_0x9a8a('0x49')]()['then'](respondWithResult(_0x5e45b4,null))[_0x9a8a('0x40')](handleError(_0x5e45b4,null));}; \ No newline at end of file +var _0x36d9=['send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','then','destroy','end','error','stack','name'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0x36d9,0x15c));var _0x936d=function(_0x2ed279,_0x208b52){_0x2ed279=_0x2ed279-0x0;var _0x14c267=_0x36d9[_0x2ed279];return _0x14c267;};'use strict';var emlformat=require(_0x936d('0x0'));var rimraf=require(_0x936d('0x1'));var zipdir=require(_0x936d('0x2'));var jsonpatch=require(_0x936d('0x3'));var rp=require(_0x936d('0x4'));var moment=require(_0x936d('0x5'));var BPromise=require(_0x936d('0x6'));var Mustache=require(_0x936d('0x7'));var util=require(_0x936d('0x8'));var path=require('path');var sox=require(_0x936d('0x9'));var csv=require(_0x936d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x936d('0xb'));var squel=require(_0x936d('0xc'));var crypto=require(_0x936d('0xd'));var jsforce=require(_0x936d('0xe'));var deskjs=require(_0x936d('0xf'));var toCsv=require(_0x936d('0xa'));var querystring=require(_0x936d('0x10'));var Papa=require('papaparse');var Redis=require(_0x936d('0x11'));var authService=require(_0x936d('0x12'));var qs=require(_0x936d('0x13'));var as=require(_0x936d('0x14'));var hardwareService=require(_0x936d('0x15'));var logger=require('../../config/logger')(_0x936d('0x16'));var utils=require(_0x936d('0x17'));var config=require(_0x936d('0x18'));var licenseUtil=require(_0x936d('0x19'));var db=require(_0x936d('0x1a'))['db'];function respondWithStatusCode(_0x444414,_0x6fea2f){_0x6fea2f=_0x6fea2f||0xcc;return function(_0x2d178d){if(_0x2d178d){return _0x444414[_0x936d('0x1b')](_0x6fea2f);}return _0x444414[_0x936d('0x1c')](_0x6fea2f)['end']();};}function respondWithResult(_0xbad7ff,_0x393a9c){_0x393a9c=_0x393a9c||0xc8;return function(_0x308b8d){if(_0x308b8d){return _0xbad7ff[_0x936d('0x1c')](_0x393a9c)['json'](_0x308b8d);}};}function respondWithFilteredResult(_0x1d382b,_0x2c954d){return function(_0x1c7ea7){if(_0x1c7ea7){var _0x51bf4f=typeof _0x2c954d[_0x936d('0x1d')]==='undefined'&&typeof _0x2c954d[_0x936d('0x1e')]===_0x936d('0x1f');var _0xa22523=_0x1c7ea7[_0x936d('0x20')];var _0x5888ad=_0x51bf4f?0x0:_0x2c954d[_0x936d('0x1d')];var _0x513987=_0x51bf4f?_0x1c7ea7[_0x936d('0x20')]:_0x2c954d[_0x936d('0x1d')]+_0x2c954d[_0x936d('0x1e')];var _0x56fdc0;if(_0x513987>=_0xa22523){_0x513987=_0xa22523;_0x56fdc0=0xc8;}else{_0x56fdc0=0xce;}_0x1d382b[_0x936d('0x1c')](_0x56fdc0);return _0x1d382b[_0x936d('0x21')](_0x936d('0x22'),_0x5888ad+'-'+_0x513987+'/'+_0xa22523)[_0x936d('0x23')](_0x1c7ea7);}return null;};}function patchUpdates(_0x2abd6b){return function(_0xf6645e){try{jsonpatch['apply'](_0xf6645e,_0x2abd6b,!![]);}catch(_0x3b8f95){return BPromise['reject'](_0x3b8f95);}return _0xf6645e['save']();};}function saveUpdates(_0x5551e4,_0x2f3ba5){return function(_0x3e60e9){if(_0x3e60e9){return _0x3e60e9['update'](_0x5551e4)[_0x936d('0x24')](function(_0xb810e9){return _0xb810e9;});}return null;};}function removeEntity(_0x28676b,_0x58fd27){return function(_0x4e9eea){if(_0x4e9eea){return _0x4e9eea[_0x936d('0x25')]()['then'](function(){_0x28676b[_0x936d('0x1c')](0xcc)[_0x936d('0x26')]();});}};}function handleEntityNotFound(_0x599c57,_0x5a1b51){return function(_0x1a86ce){if(!_0x1a86ce){_0x599c57[_0x936d('0x1b')](0x194);}return _0x1a86ce;};}function handleError(_0x20034c,_0x52390e){_0x52390e=_0x52390e||0x1f4;return function(_0x324fe9){logger[_0x936d('0x27')](_0x324fe9[_0x936d('0x28')]);if(_0x324fe9[_0x936d('0x29')]){delete _0x324fe9['name'];}_0x20034c[_0x936d('0x1c')](_0x52390e)[_0x936d('0x2a')](_0x324fe9);};}exports[_0x936d('0x2b')]=function(_0xe2ca32,_0x5ced64){var _0x27d734={},_0x3c6fc5={},_0x3f8f68={'count':0x0,'rows':[]};var _0x58540=_[_0x936d('0x2c')](db[_0x936d('0x2d')][_0x936d('0x2e')],function(_0x5cac0e){return{'name':_0x5cac0e[_0x936d('0x2f')],'type':_0x5cac0e['type'][_0x936d('0x30')]};});_0x3c6fc5[_0x936d('0x31')]=_['map'](_0x58540,'name');_0x3c6fc5['query']=_[_0x936d('0x32')](_0xe2ca32[_0x936d('0x33')]);_0x3c6fc5[_0x936d('0x34')]=_['intersection'](_0x3c6fc5[_0x936d('0x31')],_0x3c6fc5[_0x936d('0x33')]);_0x27d734[_0x936d('0x35')]=_[_0x936d('0x36')](_0x3c6fc5[_0x936d('0x31')],qs[_0x936d('0x37')](_0xe2ca32['query']['fields']));_0x27d734['attributes']=_0x27d734['attributes']['length']?_0x27d734[_0x936d('0x35')]:_0x3c6fc5['model'];if(!_0xe2ca32[_0x936d('0x33')][_0x936d('0x38')]('nolimit')){_0x27d734['limit']=qs[_0x936d('0x1e')](_0xe2ca32[_0x936d('0x33')][_0x936d('0x1e')]);_0x27d734[_0x936d('0x1d')]=qs[_0x936d('0x1d')](_0xe2ca32[_0x936d('0x33')]['offset']);}_0x27d734[_0x936d('0x39')]=qs[_0x936d('0x3a')](_0xe2ca32[_0x936d('0x33')]['sort']);_0x27d734[_0x936d('0x3b')]=qs[_0x936d('0x34')](_[_0x936d('0x3c')](_0xe2ca32['query'],_0x3c6fc5[_0x936d('0x34')]),_0x58540);if(_0xe2ca32[_0x936d('0x33')][_0x936d('0x3d')]){_0x27d734[_0x936d('0x3b')]=_[_0x936d('0x3e')](_0x27d734['where'],{'$or':_[_0x936d('0x2c')](_0x58540,function(_0x9fd3d6){if(_0x9fd3d6[_0x936d('0x3f')]!=='VIRTUAL'){var _0x1b6690={};_0x1b6690[_0x9fd3d6['name']]={'$like':'%'+_0xe2ca32[_0x936d('0x33')]['filter']+'%'};return _0x1b6690;}})});}_0x27d734=_[_0x936d('0x3e')]({},_0x27d734,_0xe2ca32[_0x936d('0x40')]);var _0x56cbf9={'where':_0x27d734['where']};return db[_0x936d('0x2d')][_0x936d('0x20')](_0x56cbf9)[_0x936d('0x24')](function(_0x47f24b){_0x3f8f68[_0x936d('0x20')]=_0x47f24b;if(_0xe2ca32[_0x936d('0x33')]['includeAll']){_0x27d734['include']=[{'all':!![]}];}return db[_0x936d('0x2d')][_0x936d('0x41')](_0x27d734);})[_0x936d('0x24')](function(_0x4b68b0){_0x3f8f68[_0x936d('0x42')]=_0x4b68b0;return _0x3f8f68;})[_0x936d('0x24')](respondWithFilteredResult(_0x5ced64,_0x27d734))[_0x936d('0x43')](handleError(_0x5ced64,null));};exports[_0x936d('0x44')]=function(_0x1ad2c7,_0x20e749){var _0x268796={'raw':![],'where':{'id':_0x1ad2c7[_0x936d('0x45')]['id']}},_0x235f66={};_0x235f66['model']=_[_0x936d('0x32')](db[_0x936d('0x2d')][_0x936d('0x2e')]);_0x235f66[_0x936d('0x33')]=_[_0x936d('0x32')](_0x1ad2c7['query']);_0x235f66['filters']=_[_0x936d('0x36')](_0x235f66[_0x936d('0x31')],_0x235f66['query']);_0x268796['attributes']=_[_0x936d('0x36')](_0x235f66['model'],qs[_0x936d('0x37')](_0x1ad2c7[_0x936d('0x33')][_0x936d('0x37')]));_0x268796[_0x936d('0x35')]=_0x268796['attributes'][_0x936d('0x46')]?_0x268796[_0x936d('0x35')]:_0x235f66[_0x936d('0x31')];if(_0x1ad2c7['query'][_0x936d('0x47')]){_0x268796[_0x936d('0x48')]=[{'all':!![]}];}_0x268796=_['merge']({},_0x268796,_0x1ad2c7['options']);return db[_0x936d('0x2d')][_0x936d('0x49')](_0x268796)[_0x936d('0x24')](handleEntityNotFound(_0x20e749,null))[_0x936d('0x24')](respondWithResult(_0x20e749,null))[_0x936d('0x43')](handleError(_0x20e749,null));};exports[_0x936d('0x4a')]=function(_0x51f3d9,_0x13be5a){return db['UserProfileSection'][_0x936d('0x4a')](_0x51f3d9[_0x936d('0x4b')],{})[_0x936d('0x24')](respondWithResult(_0x13be5a,0xc9))[_0x936d('0x43')](handleError(_0x13be5a,null));};exports[_0x936d('0x4c')]=function(_0x2d6a16,_0x52c089){if(_0x2d6a16[_0x936d('0x4b')]['id']){delete _0x2d6a16['body']['id'];}return db[_0x936d('0x2d')][_0x936d('0x49')]({'where':{'id':_0x2d6a16[_0x936d('0x45')]['id']}})[_0x936d('0x24')](handleEntityNotFound(_0x52c089,null))[_0x936d('0x24')](saveUpdates(_0x2d6a16[_0x936d('0x4b')],null))[_0x936d('0x24')](respondWithResult(_0x52c089,null))[_0x936d('0x43')](handleError(_0x52c089,null));};exports[_0x936d('0x25')]=function(_0x1880ba,_0x1c1053){return db[_0x936d('0x2d')]['find']({'where':{'id':_0x1880ba['params']['id']}})[_0x936d('0x24')](handleEntityNotFound(_0x1c1053,null))[_0x936d('0x24')](removeEntity(_0x1c1053,null))[_0x936d('0x43')](handleError(_0x1c1053,null));};exports[_0x936d('0x4d')]=function(_0x513004,_0x5b256a){return db['UserProfileSection']['describe']()[_0x936d('0x24')](respondWithResult(_0x5b256a,null))[_0x936d('0x43')](handleError(_0x5b256a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 733a2c1..1507663 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 _0xaff6=['util','../../config/logger','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','define','user_profile_has_sections','compositeIndex','sectionId','lodash'];(function(_0x5ce8c7,_0x9afbfa){var _0x41dffd=function(_0x1a5cb8){while(--_0x1a5cb8){_0x5ce8c7['push'](_0x5ce8c7['shift']());}};_0x41dffd(++_0x9afbfa);}(_0xaff6,0xef));var _0x6aff=function(_0x33711e,_0x57999f){_0x33711e=_0x33711e-0x0;var _0x5816e3=_0xaff6[_0x33711e];return _0x5816e3;};'use strict';var _=require(_0x6aff('0x0'));var util=require(_0x6aff('0x1'));var logger=require(_0x6aff('0x2'))('api');var moment=require(_0x6aff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aff('0x4'));var rimraf=require(_0x6aff('0x5'));var config=require(_0x6aff('0x6'));var attributes=require(_0x6aff('0x7'));module['exports']=function(_0x4b4057,_0x19bb4d){return _0x4b4057[_0x6aff('0x8')]('UserProfileSection',attributes,{'tableName':_0x6aff('0x9'),'paranoid':![],'indexes':[{'name':_0x6aff('0xa'),'fields':[_0x6aff('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x397c=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x22d1ef,_0x4a5152){var _0x47c5a3=function(_0x9a2c48){while(--_0x9a2c48){_0x22d1ef['push'](_0x22d1ef['shift']());}};_0x47c5a3(++_0x4a5152);}(_0x397c,0x142));var _0xc397=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x397c[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xc397('0x0'));var util=require(_0xc397('0x1'));var logger=require('../../config/logger')(_0xc397('0x2'));var moment=require(_0xc397('0x3'));var BPromise=require(_0xc397('0x4'));var rp=require(_0xc397('0x5'));var fs=require('fs');var path=require(_0xc397('0x6'));var rimraf=require('rimraf');var config=require(_0xc397('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x4749d4,_0x53fbe6){return _0x4749d4[_0xc397('0x8')](_0xc397('0x9'),attributes,{'tableName':_0xc397('0xa'),'paranoid':![],'indexes':[{'name':_0xc397('0xb'),'fields':[_0xc397('0xc'),_0xc397('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 5987b52..6806f5e 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 _0xee87=['message','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xee87,0x193));var _0x7ee8=function(_0x412f20,_0x58111c){_0x412f20=_0x412f20-0x0;var _0x1a0f4b=_0xee87[_0x412f20];return _0x1a0f4b;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ee8('0x1'));var db=require(_0x7ee8('0x2'))['db'];var utils=require(_0x7ee8('0x3'));var logger=require('../../config/logger')(_0x7ee8('0x4'));var config=require(_0x7ee8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0x6')][_0x7ee8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fe0fb,_0x3ac05f,_0x43df79){return new BPromise(function(_0x346771,_0x2d26bd){return client[_0x7ee8('0x8')](_0x2fe0fb,_0x43df79)[_0x7ee8('0x9')](function(_0x4d193a){logger[_0x7ee8('0xa')](_0x7ee8('0xb'),_0x3ac05f,_0x7ee8('0xc'));logger['debug'](_0x7ee8('0xd'),_0x3ac05f,_0x7ee8('0xc'),JSON[_0x7ee8('0xe')](_0x4d193a));if(_0x4d193a[_0x7ee8('0xf')]){if(_0x4d193a['error'][_0x7ee8('0x10')]===0x1f4){logger[_0x7ee8('0xf')](_0x7ee8('0xb'),_0x3ac05f,_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);return _0x2d26bd(_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);}logger[_0x7ee8('0xf')](_0x7ee8('0xb'),_0x3ac05f,_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);return _0x346771(_0x4d193a[_0x7ee8('0xf')][_0x7ee8('0x11')]);}else{logger[_0x7ee8('0xa')](_0x7ee8('0xb'),_0x3ac05f,_0x7ee8('0xc'));_0x346771(_0x4d193a[_0x7ee8('0x12')][_0x7ee8('0x11')]);}})[_0x7ee8('0x13')](function(_0x3b2c7e){logger['error'](_0x7ee8('0xb'),_0x3ac05f,_0x3b2c7e);_0x2d26bd(_0x3b2c7e);});});} \ No newline at end of file +var _0xba25=['http','request','then','debug','request\x20sent','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x30ba85,_0x503490){var _0x58b533=function(_0x131acf){while(--_0x131acf){_0x30ba85['push'](_0x30ba85['shift']());}};_0x58b533(++_0x503490);}(_0xba25,0x194));var _0x5ba2=function(_0x1a10d4,_0x3161d9){_0x1a10d4=_0x1a10d4-0x0;var _0x5d0cec=_0xba25[_0x1a10d4];return _0x5d0cec;};'use strict';var _=require('lodash');var util=require(_0x5ba2('0x0'));var moment=require(_0x5ba2('0x1'));var BPromise=require(_0x5ba2('0x2'));var rs=require(_0x5ba2('0x3'));var fs=require('fs');var Redis=require(_0x5ba2('0x4'));var db=require(_0x5ba2('0x5'))['db'];var utils=require(_0x5ba2('0x6'));var logger=require(_0x5ba2('0x7'))(_0x5ba2('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ba2('0x9'));var client=jayson['client'][_0x5ba2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b71a,_0x5f5b39,_0x33d903){return new BPromise(function(_0x430b82,_0x387bdd){return client[_0x5ba2('0xb')](_0x31b71a,_0x33d903)[_0x5ba2('0xc')](function(_0x2b119e){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5f5b39,'request\x20sent');logger[_0x5ba2('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5f5b39,_0x5ba2('0xe'),JSON[_0x5ba2('0xf')](_0x2b119e));if(_0x2b119e[_0x5ba2('0x10')]){if(_0x2b119e[_0x5ba2('0x10')][_0x5ba2('0x11')]===0x1f4){logger[_0x5ba2('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5f5b39,_0x2b119e['error']['message']);return _0x387bdd(_0x2b119e[_0x5ba2('0x10')][_0x5ba2('0x12')]);}logger[_0x5ba2('0x10')](_0x5ba2('0x13'),_0x5f5b39,_0x2b119e[_0x5ba2('0x10')]['message']);return _0x430b82(_0x2b119e[_0x5ba2('0x10')][_0x5ba2('0x12')]);}else{logger[_0x5ba2('0x14')](_0x5ba2('0x13'),_0x5f5b39,_0x5ba2('0xe'));_0x430b82(_0x2b119e[_0x5ba2('0x15')][_0x5ba2('0x12')]);}})[_0x5ba2('0x16')](function(_0x26cb8c){logger['error'](_0x5ba2('0x13'),_0x5f5b39,_0x26cb8c);_0x387bdd(_0x26cb8c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index cd229a7..2296457 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2f85ab,_0x53f7d5){var _0x2558f0=function(_0x235047){while(--_0x235047){_0x2f85ab['push'](_0x2f85ab['shift']());}};_0x2558f0(++_0x53f7d5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xcb91[_0x11005e];return _0x29338f;};'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 fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x414658,_0x32591f){var _0x3f33b8=function(_0x1ce3f3){while(--_0x1ce3f3){_0x414658['push'](_0x414658['shift']());}};_0x3f33b8(++_0x32591f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d17d3cc..bc18de8 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 _0x8595=['exports','INTEGER','sequelize'];(function(_0x3d778c,_0x455d69){var _0x311859=function(_0x64ba91){while(--_0x64ba91){_0x3d778c['push'](_0x3d778c['shift']());}};_0x311859(++_0x455d69);}(_0x8595,0x1b8));var _0x5859=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8595[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require(_0x5859('0x0'));module[_0x5859('0x1')]={'penalty':{'type':Sequelize[_0x5859('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e8e=['sequelize','exports','INTEGER'];(function(_0x4d493d,_0x34ffa0){var _0x3db7aa=function(_0x356d05){while(--_0x356d05){_0x4d493d['push'](_0x4d493d['shift']());}};_0x3db7aa(++_0x34ffa0);}(_0x9e8e,0x1cb));var _0xe9e8=function(_0x2a8a94,_0x3c5685){_0x2a8a94=_0x2a8a94-0x0;var _0xb59389=_0x9e8e[_0x2a8a94];return _0xb59389;};'use strict';var Sequelize=require(_0xe9e8('0x0'));module[_0xe9e8('0x1')]={'penalty':{'type':Sequelize[_0xe9e8('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 b11c4c9..8041743 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 _0xd8fb=['lodash','util','../../config/logger','api','path','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0xbb4ce,_0x2c21e8){var _0xb984f9=function(_0x116623){while(--_0x116623){_0xbb4ce['push'](_0xbb4ce['shift']());}};_0xb984f9(++_0x2c21e8);}(_0xd8fb,0x99));var _0xbd8f=function(_0x21c441,_0x543571){_0x21c441=_0x21c441-0x0;var _0x590b88=_0xd8fb[_0x21c441];return _0x590b88;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x292c=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x3b0da2,_0x306d66){var _0x45a240=function(_0x557598){while(--_0x557598){_0x3b0da2['push'](_0x3b0da2['shift']());}};_0x45a240(++_0x306d66);}(_0x292c,0x66));var _0xc292=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x292c[_0x37a7c6];return _0x539905;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var logger=require(_0xc292('0x1'))(_0xc292('0x2'));var moment=require(_0xc292('0x3'));var BPromise=require(_0xc292('0x4'));var rp=require(_0xc292('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc292('0x6'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xc292('0x7')]=function(_0x1c45ed,_0x2c01eb){return _0x1c45ed[_0xc292('0x8')](_0xc292('0x9'),attributes,{'tableName':_0xc292('0xa'),'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 a80ec5e..d6a7b9f 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 _0x08f9=['moment','bluebird','randomstring','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x1d192f,_0x5566eb){var _0x24d41f=function(_0x118be3){while(--_0x118be3){_0x1d192f['push'](_0x1d192f['shift']());}};_0x24d41f(++_0x5566eb);}(_0x08f9,0x15f));var _0x908f=function(_0x2227e3,_0x3e2b10){_0x2227e3=_0x2227e3-0x0;var _0x2d02cb=_0x08f9[_0x2227e3];return _0x2d02cb;};'use strict';var _=require('lodash');var util=require(_0x908f('0x0'));var moment=require(_0x908f('0x1'));var BPromise=require(_0x908f('0x2'));var rs=require(_0x908f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['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['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47cce0,_0x58029c,_0x4cb0d6){return new BPromise(function(_0x573007,_0xa216db){return client[_0x908f('0x4')](_0x47cce0,_0x4cb0d6)[_0x908f('0x5')](function(_0xdfcc86){logger[_0x908f('0x6')](_0x908f('0x7'),_0x58029c,_0x908f('0x8'));logger[_0x908f('0x9')](_0x908f('0xa'),_0x58029c,_0x908f('0x8'),JSON[_0x908f('0xb')](_0xdfcc86));if(_0xdfcc86[_0x908f('0xc')]){if(_0xdfcc86['error'][_0x908f('0xd')]===0x1f4){logger[_0x908f('0xc')](_0x908f('0x7'),_0x58029c,_0xdfcc86[_0x908f('0xc')][_0x908f('0xe')]);return _0xa216db(_0xdfcc86['error'][_0x908f('0xe')]);}logger[_0x908f('0xc')](_0x908f('0x7'),_0x58029c,_0xdfcc86[_0x908f('0xc')]['message']);return _0x573007(_0xdfcc86['error']['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x58029c,'request\x20sent');_0x573007(_0xdfcc86[_0x908f('0xf')][_0x908f('0xe')]);}})['catch'](function(_0x193818){logger[_0x908f('0xc')](_0x908f('0x7'),_0x58029c,_0x193818);_0xa216db(_0x193818);});});} \ No newline at end of file +var _0x04f7=['jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5604ca,_0x10235a){var _0x3c4ec0=function(_0x82cbc3){while(--_0x82cbc3){_0x5604ca['push'](_0x5604ca['shift']());}};_0x3c4ec0(++_0x10235a);}(_0x04f7,0x187));var _0x704f=function(_0x222455,_0x4bb55e){_0x222455=_0x222455-0x0;var _0x42a23b=_0x04f7[_0x222455];return _0x42a23b;};'use strict';var _=require(_0x704f('0x0'));var util=require(_0x704f('0x1'));var moment=require(_0x704f('0x2'));var BPromise=require(_0x704f('0x3'));var rs=require(_0x704f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x704f('0x5'));var logger=require(_0x704f('0x6'))('rpc');var config=require(_0x704f('0x7'));var jayson=require(_0x704f('0x8'));var client=jayson[_0x704f('0x9')][_0x704f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e03b,_0x2b9fcd,_0x5568de){return new BPromise(function(_0x4452cd,_0x603e92){return client[_0x704f('0xb')](_0x10e03b,_0x5568de)[_0x704f('0xc')](function(_0x54e45b){logger['info'](_0x704f('0xd'),_0x2b9fcd,'request\x20sent');logger[_0x704f('0xe')](_0x704f('0xf'),_0x2b9fcd,_0x704f('0x10'),JSON[_0x704f('0x11')](_0x54e45b));if(_0x54e45b['error']){if(_0x54e45b[_0x704f('0x12')]['code']===0x1f4){logger[_0x704f('0x12')](_0x704f('0xd'),_0x2b9fcd,_0x54e45b[_0x704f('0x12')][_0x704f('0x13')]);return _0x603e92(_0x54e45b[_0x704f('0x12')][_0x704f('0x13')]);}logger[_0x704f('0x12')](_0x704f('0xd'),_0x2b9fcd,_0x54e45b[_0x704f('0x12')][_0x704f('0x13')]);return _0x4452cd(_0x54e45b[_0x704f('0x12')][_0x704f('0x13')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x2b9fcd,_0x704f('0x10'));_0x4452cd(_0x54e45b['result'][_0x704f('0x13')]);}})[_0x704f('0x14')](function(_0x2dff12){logger[_0x704f('0x12')](_0x704f('0xd'),_0x2b9fcd,_0x2dff12);_0x603e92(_0x2dff12);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 13ca8a8..a845266 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d0b=['exports','INTEGER'];(function(_0x5fe5ca,_0x4e92d3){var _0x42f45f=function(_0x2511eb){while(--_0x2511eb){_0x5fe5ca['push'](_0x5fe5ca['shift']());}};_0x42f45f(++_0x4e92d3);}(_0x0d0b,0x10e));var _0xb0d0=function(_0x21bb18,_0x5937df){_0x21bb18=_0x21bb18-0x0;var _0x54bc43=_0x0d0b[_0x21bb18];return _0x54bc43;};'use strict';var Sequelize=require('sequelize');module[_0xb0d0('0x0')]={'UserId':{'type':Sequelize[_0xb0d0('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xb0d0('0x1')]}}; \ No newline at end of file +var _0x46ce=['INTEGER','sequelize','exports'];(function(_0x14b266,_0x1ba587){var _0x523e2a=function(_0x5c4980){while(--_0x5c4980){_0x14b266['push'](_0x14b266['shift']());}};_0x523e2a(++_0x1ba587);}(_0x46ce,0x85));var _0xe46c=function(_0x46f2c3,_0x421546){_0x46f2c3=_0x46f2c3-0x0;var _0x39d0e1=_0x46ce[_0x46f2c3];return _0x39d0e1;};'use strict';var Sequelize=require(_0xe46c('0x0'));module[_0xe46c('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xe46c('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a6963bd..4c0c4cc 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5ca361,_0x416505){var _0xabec0f=function(_0x32fedf){while(--_0x32fedf){_0x5ca361['push'](_0x5ca361['shift']());}};_0xabec0f(++_0x416505);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5b6991,_0x35a2bb){var _0x101504=function(_0x292e11){while(--_0x292e11){_0x5b6991['push'](_0x5b6991['shift']());}};_0x101504(++_0x35a2bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 1db342c..1e5b23c 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1cfc0d,_0x105ac2){var _0x5d6db0=function(_0x25052d){while(--_0x25052d){_0x1cfc0d['push'](_0x1cfc0d['shift']());}};_0x5d6db0(++_0x105ac2);}(_0xedd9,0xfc));var _0x9edd=function(_0x49f7e0,_0x15a064){_0x49f7e0=_0x49f7e0-0x0;var _0x556090=_0xedd9[_0x49f7e0];return _0x556090;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xe336e0,_0x18f796){var _0x19d2c6=function(_0x3778e1){while(--_0x3778e1){_0xe336e0['push'](_0xe336e0['shift']());}};_0x19d2c6(++_0x18f796);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9b2ec72..9006424 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 _0x9b67=['sequelize','exports','INTEGER'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9b67,0xf6));var _0x79b6=function(_0x180700,_0x3cf6ff){_0x180700=_0x180700-0x0;var _0x31f4ce=_0x9b67[_0x180700];return _0x31f4ce;};'use strict';var Sequelize=require(_0x79b6('0x0'));module[_0x79b6('0x1')]={'penalty':{'type':Sequelize[_0x79b6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 43652fa..40855d5 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 _0x6faf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api'];(function(_0x26982a,_0x59af56){var _0x51e727=function(_0x5d9971){while(--_0x5d9971){_0x26982a['push'](_0x26982a['shift']());}};_0x51e727(++_0x59af56);}(_0x6faf,0x107));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf6fa('0x0'));var util=require('util');var logger=require(_0xf6fa('0x1'))(_0xf6fa('0x2'));var moment=require(_0xf6fa('0x3'));var BPromise=require(_0xf6fa('0x4'));var rp=require(_0xf6fa('0x5'));var fs=require('fs');var path=require(_0xf6fa('0x6'));var rimraf=require(_0xf6fa('0x7'));var config=require(_0xf6fa('0x8'));var attributes=require(_0xf6fa('0x9'));module[_0xf6fa('0xa')]=function(_0x29f2f0,_0xca30ea){return _0x29f2f0[_0xf6fa('0xb')](_0xf6fa('0xc'),attributes,{'tableName':_0xf6fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc88=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util'];(function(_0x27edf3,_0x43b5e3){var _0xe20afa=function(_0x1dfd1f){while(--_0x1dfd1f){_0x27edf3['push'](_0x27edf3['shift']());}};_0xe20afa(++_0x43b5e3);}(_0xbc88,0x1ba));var _0x8bc8=function(_0x57a512,_0x239b65){_0x57a512=_0x57a512-0x0;var _0x4fa1a5=_0xbc88[_0x57a512];return _0x4fa1a5;};'use strict';var _=require(_0x8bc8('0x0'));var util=require(_0x8bc8('0x1'));var logger=require(_0x8bc8('0x2'))(_0x8bc8('0x3'));var moment=require('moment');var BPromise=require(_0x8bc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bc8('0x5'));var rimraf=require(_0x8bc8('0x6'));var config=require(_0x8bc8('0x7'));var attributes=require(_0x8bc8('0x8'));module[_0x8bc8('0x9')]=function(_0x2ca21c,_0x517dd0){return _0x2ca21c[_0x8bc8('0xa')](_0x8bc8('0xb'),attributes,{'tableName':'user_has_voice_queues','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 137f709..7f38cb4 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 _0xf345=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x5398d8,_0x4c51ce){var _0x1e1bdc=function(_0x12c557){while(--_0x12c557){_0x5398d8['push'](_0x5398d8['shift']());}};_0x1e1bdc(++_0x4c51ce);}(_0xf345,0x14e));var _0x5f34=function(_0x533068,_0x1e97be){_0x533068=_0x533068-0x0;var _0x25d623=_0xf345[_0x533068];return _0x25d623;};'use strict';var _=require(_0x5f34('0x0'));var util=require(_0x5f34('0x1'));var moment=require(_0x5f34('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f34('0x3'));var fs=require('fs');var Redis=require(_0x5f34('0x4'));var db=require(_0x5f34('0x5'))['db'];var utils=require(_0x5f34('0x6'));var logger=require(_0x5f34('0x7'))(_0x5f34('0x8'));var config=require(_0x5f34('0x9'));var jayson=require(_0x5f34('0xa'));var client=jayson[_0x5f34('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e4f8,_0x155f47,_0x373009){return new BPromise(function(_0x376a35,_0xb4c7ad){return client[_0x5f34('0xc')](_0x36e4f8,_0x373009)[_0x5f34('0xd')](function(_0x39bc7a){logger[_0x5f34('0xe')](_0x5f34('0xf'),_0x155f47,_0x5f34('0x10'));logger[_0x5f34('0x11')](_0x5f34('0x12'),_0x155f47,_0x5f34('0x10'),JSON[_0x5f34('0x13')](_0x39bc7a));if(_0x39bc7a[_0x5f34('0x14')]){if(_0x39bc7a[_0x5f34('0x14')][_0x5f34('0x15')]===0x1f4){logger[_0x5f34('0x14')](_0x5f34('0xf'),_0x155f47,_0x39bc7a[_0x5f34('0x14')][_0x5f34('0x16')]);return _0xb4c7ad(_0x39bc7a[_0x5f34('0x14')][_0x5f34('0x16')]);}logger['error'](_0x5f34('0xf'),_0x155f47,_0x39bc7a['error'][_0x5f34('0x16')]);return _0x376a35(_0x39bc7a[_0x5f34('0x14')][_0x5f34('0x16')]);}else{logger[_0x5f34('0xe')](_0x5f34('0xf'),_0x155f47,_0x5f34('0x10'));_0x376a35(_0x39bc7a['result'][_0x5f34('0x16')]);}})[_0x5f34('0x17')](function(_0x3d173c){logger[_0x5f34('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x155f47,_0x3d173c);_0xb4c7ad(_0x3d173c);});});} \ No newline at end of file +var _0x8203=['../../config/environment','http','request','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5f584a,_0x47f064){var _0x3788d9=function(_0x29c10b){while(--_0x29c10b){_0x5f584a['push'](_0x5f584a['shift']());}};_0x3788d9(++_0x47f064);}(_0x8203,0x7b));var _0x3820=function(_0x45aa57,_0x1ba682){_0x45aa57=_0x45aa57-0x0;var _0xf4429a=_0x8203[_0x45aa57];return _0xf4429a;};'use strict';var _=require(_0x3820('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3820('0x1'));var db=require(_0x3820('0x2'))['db'];var utils=require(_0x3820('0x3'));var logger=require(_0x3820('0x4'))('rpc');var config=require(_0x3820('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3820('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1bf0d7,_0x53e15b,_0x3bd465){return new BPromise(function(_0x44d299,_0x282b02){return client[_0x3820('0x7')](_0x1bf0d7,_0x3bd465)['then'](function(_0x196b6a){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x53e15b,'request\x20sent');logger['debug'](_0x3820('0x8'),_0x53e15b,_0x3820('0x9'),JSON[_0x3820('0xa')](_0x196b6a));if(_0x196b6a[_0x3820('0xb')]){if(_0x196b6a[_0x3820('0xb')][_0x3820('0xc')]===0x1f4){logger['error'](_0x3820('0xd'),_0x53e15b,_0x196b6a[_0x3820('0xb')][_0x3820('0xe')]);return _0x282b02(_0x196b6a[_0x3820('0xb')]['message']);}logger['error'](_0x3820('0xd'),_0x53e15b,_0x196b6a[_0x3820('0xb')][_0x3820('0xe')]);return _0x44d299(_0x196b6a[_0x3820('0xb')][_0x3820('0xe')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x53e15b,_0x3820('0x9'));_0x44d299(_0x196b6a[_0x3820('0xf')]['message']);}})['catch'](function(_0x419b51){logger[_0x3820('0xb')](_0x3820('0xd'),_0x53e15b,_0x419b51);_0x282b02(_0x419b51);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 20eb8d4..da45ddc 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2c2fa4,_0x97d580){var _0x5a46b5=function(_0x52e017){while(--_0x52e017){_0x2c2fa4['push'](_0x2c2fa4['shift']());}};_0x5a46b5(++_0x97d580);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b8376,_0x3658c7){_0x1b8376=_0x1b8376-0x0;var _0x1d32f3=_0xedd9[_0x1b8376];return _0x1d32f3;};'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 fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5a2d6e,_0x3d3a47){var _0x30ff59=function(_0x2b5e6a){while(--_0x2b5e6a){_0x5a2d6e['push'](_0x5a2d6e['shift']());}};_0x30ff59(++_0x3d3a47);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));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 4040d15..3511dd5 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 _0xe243=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0xe243,0x125));var _0x3e24=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0xe243[_0x35e124];return _0x53c482;};'use strict';var Sequelize=require(_0x3e24('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3e24('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3e24('0x2')},'membername':{'type':Sequelize[_0x3e24('0x3')],'allowNull':![],'comment':_0x3e24('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3e24('0x3')],'allowNull':![],'unique':_0x3e24('0x4'),'comment':_0x3e24('0x2')},'VoiceQueueId':{'type':Sequelize[_0x3e24('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x3e24('0x3')],'allowNull':![],'unique':_0x3e24('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x3e24('0x1')](0xb),'defaultValue':0x0,'comment':_0x3e24('0x2')}}; \ No newline at end of file +var _0xd38a=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x1c1d5f,_0x219dcd){var _0x572286=function(_0x1b521c){while(--_0x1b521c){_0x1c1d5f['push'](_0x1c1d5f['shift']());}};_0x572286(++_0x219dcd);}(_0xd38a,0x1aa));var _0xad38=function(_0x3e14,_0x172ba7){_0x3e14=_0x3e14-0x0;var _0x3078e3=_0xd38a[_0x3e14];return _0x3078e3;};'use strict';var Sequelize=require('sequelize');module[_0xad38('0x0')]={'uniqueid':{'type':Sequelize[_0xad38('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xad38('0x2')},'membername':{'type':Sequelize[_0xad38('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xad38('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xad38('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xad38('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xad38('0x4'),'comment':_0xad38('0x2')},'penalty':{'type':Sequelize[_0xad38('0x1')](0xb),'defaultValue':0x0,'comment':_0xad38('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xad38('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index fb36034..9b4ef63 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 _0x22b0=['update','remove','emit','hasOwnProperty','exports','events','UserVoiceQueueRt','save'];(function(_0x530086,_0x382014){var _0x4e29c2=function(_0x2bc473){while(--_0x2bc473){_0x530086['push'](_0x530086['shift']());}};_0x4e29c2(++_0x382014);}(_0x22b0,0x14d));var _0x022b=function(_0x57a1fb,_0xc3f0c9){_0x57a1fb=_0x57a1fb-0x0;var _0x468b8a=_0x22b0[_0x57a1fb];return _0x468b8a;};'use strict';var EventEmitter=require(_0x022b('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x022b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x022b('0x2'),'afterUpdate':_0x022b('0x3'),'afterDestroy':_0x022b('0x4')};function emitEvent(_0x1670e2){return function(_0xcf2e47,_0x4570fa,_0x5f20f0){UserVoiceQueueRtEvents[_0x022b('0x5')](_0x1670e2+':'+_0xcf2e47['id'],_0xcf2e47);UserVoiceQueueRtEvents[_0x022b('0x5')](_0x1670e2,_0xcf2e47);_0x5f20f0(null);};}for(var e in events){if(events[_0x022b('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x022b('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd6be=['../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd6be,0xbc));var _0xed6b=function(_0x55ee37,_0x465e53){_0x55ee37=_0x55ee37-0x0;var _0x5869a8=_0xd6be[_0x55ee37];return _0x5869a8;};'use strict';var EventEmitter=require(_0xed6b('0x0'));var UserVoiceQueueRt=require(_0xed6b('0x1'))['db'][_0xed6b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed6b('0x3'),'afterUpdate':'update','afterDestroy':_0xed6b('0x4')};function emitEvent(_0x56f7e1){return function(_0x4179ff,_0x3f50db,_0x84f638){UserVoiceQueueRtEvents[_0xed6b('0x5')](_0x56f7e1+':'+_0x4179ff['id'],_0x4179ff);UserVoiceQueueRtEvents[_0xed6b('0x5')](_0x56f7e1,_0x4179ff);_0x84f638(null);};}for(var e in events){if(events[_0xed6b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xed6b('0x7')](e,emitEvent(event));}}module[_0xed6b('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a5eec8e..062d95f 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 _0xb031=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','api'];(function(_0x5b1754,_0x527182){var _0x441bbe=function(_0x59528e){while(--_0x59528e){_0x5b1754['push'](_0x5b1754['shift']());}};_0x441bbe(++_0x527182);}(_0xb031,0xb8));var _0x1b03=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb031[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x1b03('0x0'));var util=require(_0x1b03('0x1'));var logger=require('../../config/logger')(_0x1b03('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b03('0x3'));var fs=require('fs');var path=require(_0x1b03('0x4'));var rimraf=require(_0x1b03('0x5'));var config=require(_0x1b03('0x6'));var attributes=require(_0x1b03('0x7'));module[_0x1b03('0x8')]=function(_0x262956,_0x4f7ed8){return _0x262956[_0x1b03('0x9')](_0x1b03('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3ed=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','moment','bluebird','request-promise'];(function(_0x44db50,_0x5ecc02){var _0x2647ff=function(_0x2e454b){while(--_0x2e454b){_0x44db50['push'](_0x44db50['shift']());}};_0x2647ff(++_0x5ecc02);}(_0xf3ed,0xec));var _0xdf3e=function(_0x5295a4,_0x10b19c){_0x5295a4=_0x5295a4-0x0;var _0x31bf38=_0xf3ed[_0x5295a4];return _0x31bf38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf3e('0x0'))('api');var moment=require(_0xdf3e('0x1'));var BPromise=require(_0xdf3e('0x2'));var rp=require(_0xdf3e('0x3'));var fs=require('fs');var path=require(_0xdf3e('0x4'));var rimraf=require(_0xdf3e('0x5'));var config=require(_0xdf3e('0x6'));var attributes=require(_0xdf3e('0x7'));module[_0xdf3e('0x8')]=function(_0x1cae9c,_0x1a9e01){return _0x1cae9c[_0xdf3e('0x9')](_0xdf3e('0xa'),attributes,{'tableName':_0xdf3e('0xb'),'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 e53c605..fc4abab 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 _0x889d=['error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','then','debug','GetVoiceQueueRtPauses','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x889d,0x18e));var _0xd889=function(_0x3e52b4,_0x502af9){_0x3e52b4=_0x3e52b4-0x0;var _0x19b56e=_0x889d[_0x3e52b4];return _0x19b56e;};'use strict';var _=require(_0xd889('0x0'));var util=require(_0xd889('0x1'));var moment=require(_0xd889('0x2'));var BPromise=require(_0xd889('0x3'));var rs=require(_0xd889('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd889('0x5'))['db'];var utils=require(_0xd889('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd889('0x7'));var jayson=require(_0xd889('0x8'));var client=jayson[_0xd889('0x9')][_0xd889('0xa')]({'port':0x232a});config[_0xd889('0xb')]=_[_0xd889('0xc')](config[_0xd889('0xb')],{'host':_0xd889('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd889('0xb')]));require(_0xd889('0xe'))[_0xd889('0xf')](socket);function respondWithRpcPromise(_0x25278f,_0x580c88,_0x22e8c9){return new BPromise(function(_0x186720,_0x2ddf2a){return client['request'](_0x25278f,_0x22e8c9)['then'](function(_0x5ea5dc){logger[_0xd889('0x10')](_0xd889('0x11'),_0x580c88,_0xd889('0x12'));logger['debug'](_0xd889('0x13'),_0x580c88,_0xd889('0x12'),JSON['stringify'](_0x5ea5dc));if(_0x5ea5dc[_0xd889('0x14')]){if(_0x5ea5dc[_0xd889('0x14')][_0xd889('0x15')]===0x1f4){logger[_0xd889('0x14')](_0xd889('0x11'),_0x580c88,_0x5ea5dc[_0xd889('0x14')][_0xd889('0x16')]);return _0x2ddf2a(_0x5ea5dc['error'][_0xd889('0x16')]);}logger[_0xd889('0x14')](_0xd889('0x11'),_0x580c88,_0x5ea5dc[_0xd889('0x14')]['message']);return _0x186720(_0x5ea5dc[_0xd889('0x14')]['message']);}else{logger[_0xd889('0x10')](_0xd889('0x11'),_0x580c88,'request\x20sent');_0x186720(_0x5ea5dc[_0xd889('0x17')][_0xd889('0x16')]);}})[_0xd889('0x18')](function(_0x3c272e){logger[_0xd889('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x580c88,_0x3c272e);_0x2ddf2a(_0x3c272e);});});}exports['GetVoiceQueueRtPauses']=function(_0x41ca0f){var _0x3203f4=this;return new Promise(function(_0xceab46,_0x5a0a72){return db[_0xd889('0x19')][_0xd889('0x1a')]({'raw':_0x41ca0f[_0xd889('0x1b')]?_0x41ca0f[_0xd889('0x1b')][_0xd889('0x1c')]===undefined?!![]:![]:!![],'where':_0x41ca0f[_0xd889('0x1b')]?_0x41ca0f[_0xd889('0x1b')][_0xd889('0x1d')]||null:null,'attributes':[[db[_0xd889('0x1e')]['fn'](_0xd889('0x1f'),db[_0xd889('0x1e')]['fn']('IF',db[_0xd889('0x1e')][_0xd889('0x20')](_0xd889('0x21')))),'outboundQueuePauses']]})[_0xd889('0x22')](function(_0x9cca80){logger['info']('GetVoiceQueueRtPauses',_0x41ca0f);logger[_0xd889('0x23')](_0xd889('0x24'),_0x41ca0f,JSON[_0xd889('0x25')](_0x9cca80));_0xceab46(_0x9cca80);})[_0xd889('0x18')](function(_0x3dfccd){logger[_0xd889('0x14')](_0xd889('0x24'),_0x3dfccd[_0xd889('0x16')],_0x41ca0f);_0x5a0a72(_0x3203f4[_0xd889('0x14')](0x1f4,_0x3dfccd['message']));});});}; \ No newline at end of file +var _0x88ee=['sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','findAll','options','where'];(function(_0x2db080,_0x5a86e3){var _0x1c5c3f=function(_0x55e704){while(--_0x55e704){_0x2db080['push'](_0x2db080['shift']());}};_0x1c5c3f(++_0x5a86e3);}(_0x88ee,0x153));var _0xe88e=function(_0x5030f8,_0x61f57b){_0x5030f8=_0x5030f8-0x0;var _0x513ddb=_0x88ee[_0x5030f8];return _0x513ddb;};'use strict';var _=require(_0xe88e('0x0'));var util=require(_0xe88e('0x1'));var moment=require(_0xe88e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe88e('0x3'));var fs=require('fs');var Redis=require(_0xe88e('0x4'));var db=require(_0xe88e('0x5'))['db'];var utils=require(_0xe88e('0x6'));var logger=require(_0xe88e('0x7'))(_0xe88e('0x8'));var config=require(_0xe88e('0x9'));var jayson=require(_0xe88e('0xa'));var client=jayson[_0xe88e('0xb')][_0xe88e('0xc')]({'port':0x232a});config[_0xe88e('0xd')]=_[_0xe88e('0xe')](config[_0xe88e('0xd')],{'host':_0xe88e('0xf'),'port':0x18eb});var socket=require(_0xe88e('0x10'))(new Redis(config[_0xe88e('0xd')]));require(_0xe88e('0x11'))[_0xe88e('0x12')](socket);function respondWithRpcPromise(_0x334995,_0x1415b1,_0x46c2c6){return new BPromise(function(_0x825188,_0x191b8e){return client[_0xe88e('0x13')](_0x334995,_0x46c2c6)[_0xe88e('0x14')](function(_0x22e63b){logger[_0xe88e('0x15')](_0xe88e('0x16'),_0x1415b1,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1415b1,_0xe88e('0x17'),JSON[_0xe88e('0x18')](_0x22e63b));if(_0x22e63b[_0xe88e('0x19')]){if(_0x22e63b['error']['code']===0x1f4){logger['error'](_0xe88e('0x16'),_0x1415b1,_0x22e63b[_0xe88e('0x19')][_0xe88e('0x1a')]);return _0x191b8e(_0x22e63b['error'][_0xe88e('0x1a')]);}logger[_0xe88e('0x19')](_0xe88e('0x16'),_0x1415b1,_0x22e63b[_0xe88e('0x19')][_0xe88e('0x1a')]);return _0x825188(_0x22e63b[_0xe88e('0x19')]['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1415b1,_0xe88e('0x17'));_0x825188(_0x22e63b['result'][_0xe88e('0x1a')]);}})[_0xe88e('0x1b')](function(_0x1e4a23){logger[_0xe88e('0x19')](_0xe88e('0x16'),_0x1415b1,_0x1e4a23);_0x191b8e(_0x1e4a23);});});}exports['GetVoiceQueueRtPauses']=function(_0x2f2c8a){var _0x5f0af8=this;return new Promise(function(_0x2947ac,_0x65a7bd){return db['UserVoiceQueueRt'][_0xe88e('0x1c')]({'raw':_0x2f2c8a['options']?_0x2f2c8a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f2c8a[_0xe88e('0x1d')]?_0x2f2c8a[_0xe88e('0x1d')][_0xe88e('0x1e')]||null:null,'attributes':[[db[_0xe88e('0x1f')]['fn'](_0xe88e('0x20'),db[_0xe88e('0x1f')]['fn']('IF',db[_0xe88e('0x1f')][_0xe88e('0x21')](_0xe88e('0x22')))),_0xe88e('0x23')]]})[_0xe88e('0x14')](function(_0x37aeba){logger['info'](_0xe88e('0x24'),_0x2f2c8a);logger['debug'](_0xe88e('0x24'),_0x2f2c8a,JSON[_0xe88e('0x18')](_0x37aeba));_0x2947ac(_0x37aeba);})[_0xe88e('0x1b')](function(_0x53d771){logger[_0xe88e('0x19')](_0xe88e('0x24'),_0x53d771[_0xe88e('0x1a')],_0x2f2c8a);_0x65a7bd(_0x5f0af8[_0xe88e('0x19')](0x1f4,_0x53d771[_0xe88e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index dce310c..50ed2f3 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 _0xaa48=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x34ea27,_0x453234){var _0x272cd2=function(_0x11854f){while(--_0x11854f){_0x34ea27['push'](_0x34ea27['shift']());}};_0x272cd2(++_0x453234);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3763f8,_0x4e948c){_0x3763f8=_0x3763f8-0x0;var _0x3a87c9=_0xaa48[_0x3763f8];return _0x3a87c9;};'use strict';var UserVoiceQueueRtEvents=require(_0x8aa4('0x0'));var events=[_0x8aa4('0x1'),_0x8aa4('0x2'),_0x8aa4('0x3')];function createListener(_0x1a93a7,_0x31afa9){return function(_0x3a0672){_0x31afa9[_0x8aa4('0x4')](_0x1a93a7,_0x3a0672);};}function removeListener(_0x229357,_0x1005db){return function(){UserVoiceQueueRtEvents[_0x8aa4('0x5')](_0x229357,_0x1005db);};}exports[_0x8aa4('0x6')]=function(_0x141d8b){for(var _0x14614c=0x0,_0x17bf06=events[_0x8aa4('0x7')];_0x14614c<_0x17bf06;_0x14614c++){var _0x37498b=events[_0x14614c];var _0xa5c92e=createListener(_0x8aa4('0x8')+_0x37498b,_0x141d8b);UserVoiceQueueRtEvents['on'](_0x37498b,_0xa5c92e);}}; \ No newline at end of file +var _0xcbd3=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','register'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0xdad071,_0x59b000){_0xdad071=_0xdad071-0x0;var _0x5c1225=_0xcbd3[_0xdad071];return _0x5c1225;};'use strict';var UserVoiceQueueRtEvents=require(_0x3cbd('0x0'));var events=[_0x3cbd('0x1'),_0x3cbd('0x2'),_0x3cbd('0x3')];function createListener(_0x3dc6fa,_0x2f631d){return function(_0x1092bc){_0x2f631d[_0x3cbd('0x4')](_0x3dc6fa,_0x1092bc);};}function removeListener(_0x2f4854,_0x32a914){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2f4854,_0x32a914);};}exports[_0x3cbd('0x5')]=function(_0x2f2631){for(var _0x525b74=0x0,_0x372e19=events['length'];_0x525b74<_0x372e19;_0x525b74++){var _0x25420f=events[_0x525b74];var _0x4c1a53=createListener(_0x3cbd('0x6')+_0x25420f,_0x2f2631);UserVoiceQueueRtEvents['on'](_0x25420f,_0x4c1a53);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f97e2c4..0ff4488 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x21e3b1,_0x2ce536){var _0x151822=function(_0x35cd03){while(--_0x35cd03){_0x21e3b1['push'](_0x21e3b1['shift']());}};_0x151822(++_0x2ce536);}(_0x70e0,0x17b));var _0x070e=function(_0x4eded5,_0x54fd62){_0x4eded5=_0x4eded5-0x0;var _0x333ae3=_0x70e0[_0x4eded5];return _0x333ae3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x19777b,_0x2375c6){var _0x70a038=function(_0x599fab){while(--_0x599fab){_0x19777b['push'](_0x19777b['shift']());}};_0x70a038(++_0x2375c6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0xcb91[_0x4c4042];return _0xbd10dc;};'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 fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index be5ce6b..c75bfad 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafed=['sequelize'];(function(_0x2a038c,_0x2bb0f0){var _0x57ad4a=function(_0x498378){while(--_0x498378){_0x2a038c['push'](_0x2a038c['shift']());}};_0x57ad4a(++_0x2bb0f0);}(_0xafed,0x1a0));var _0xdafe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdafe('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2e8f=['sequelize','exports','INTEGER'];(function(_0x5ac527,_0x269eef){var _0x1cbab0=function(_0x52a7e2){while(--_0x52a7e2){_0x5ac527['push'](_0x5ac527['shift']());}};_0x1cbab0(++_0x269eef);}(_0x2e8f,0x159));var _0xf2e8=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x2e8f[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xf2e8('0x0'));module[_0xf2e8('0x1')]={'penalty':{'type':Sequelize[_0xf2e8('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 0c65835..d234b4f 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6af=['request-promise','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0x5b53f6,_0x14dc5c){var _0x23f49b=function(_0x336578){while(--_0x336578){_0x5b53f6['push'](_0x5b53f6['shift']());}};_0x23f49b(++_0x14dc5c);}(_0xb6af,0x16d));var _0xfb6a=function(_0x2a880e,_0x44beb7){_0x2a880e=_0x2a880e-0x0;var _0x45e0ce=_0xb6af[_0x2a880e];return _0x45e0ce;};'use strict';var _=require(_0xfb6a('0x0'));var util=require(_0xfb6a('0x1'));var logger=require(_0xfb6a('0x2'))(_0xfb6a('0x3'));var moment=require('moment');var BPromise=require(_0xfb6a('0x4'));var rp=require(_0xfb6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfb6a('0x6'));var attributes=require(_0xfb6a('0x7'));module['exports']=function(_0x3fd4bd,_0x10aa15){return _0x3fd4bd[_0xfb6a('0x8')](_0xfb6a('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe927=['./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x100cd0,_0x154d5f){var _0x54a721=function(_0x4959d3){while(--_0x4959d3){_0x100cd0['push'](_0x100cd0['shift']());}};_0x54a721(++_0x154d5f);}(_0xe927,0x72));var _0x7e92=function(_0xb603f1,_0x31555a){_0xb603f1=_0xb603f1-0x0;var _0x5a77aa=_0xe927[_0xb603f1];return _0x5a77aa;};'use strict';var _=require('lodash');var util=require(_0x7e92('0x0'));var logger=require(_0x7e92('0x1'))(_0x7e92('0x2'));var moment=require('moment');var BPromise=require(_0x7e92('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e92('0x4'));var rimraf=require(_0x7e92('0x5'));var config=require('../../config/environment');var attributes=require(_0x7e92('0x6'));module['exports']=function(_0x3eb241,_0x2723ad){return _0x3eb241[_0x7e92('0x7')](_0x7e92('0x8'),attributes,{'tableName':_0x7e92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 475901a..8ae83ec 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8235=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1e9d6a,_0x3e5cab){var _0x222bd1=function(_0x3e9c8f){while(--_0x3e9c8f){_0x1e9d6a['push'](_0x1e9d6a['shift']());}};_0x222bd1(++_0x3e5cab);}(_0x8235,0x124));var _0x5823=function(_0x5c15c0,_0x45ac4b){_0x5c15c0=_0x5c15c0-0x0;var _0x661c67=_0x8235[_0x5c15c0];return _0x661c67;};'use strict';var _=require(_0x5823('0x0'));var util=require(_0x5823('0x1'));var moment=require(_0x5823('0x2'));var BPromise=require(_0x5823('0x3'));var rs=require(_0x5823('0x4'));var fs=require('fs');var Redis=require(_0x5823('0x5'));var db=require(_0x5823('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5823('0x7'));var config=require('../../config/environment');var jayson=require(_0x5823('0x8'));var client=jayson['client'][_0x5823('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x137a12,_0xab7a72,_0x3729c8){return new BPromise(function(_0x2afb69,_0x8a813e){return client[_0x5823('0xa')](_0x137a12,_0x3729c8)[_0x5823('0xb')](function(_0x11537c){logger[_0x5823('0xc')](_0x5823('0xd'),_0xab7a72,'request\x20sent');logger['debug'](_0x5823('0xe'),_0xab7a72,_0x5823('0xf'),JSON[_0x5823('0x10')](_0x11537c));if(_0x11537c['error']){if(_0x11537c[_0x5823('0x11')][_0x5823('0x12')]===0x1f4){logger[_0x5823('0x11')](_0x5823('0xd'),_0xab7a72,_0x11537c[_0x5823('0x11')][_0x5823('0x13')]);return _0x8a813e(_0x11537c[_0x5823('0x11')][_0x5823('0x13')]);}logger[_0x5823('0x11')](_0x5823('0xd'),_0xab7a72,_0x11537c[_0x5823('0x11')][_0x5823('0x13')]);return _0x2afb69(_0x11537c[_0x5823('0x11')]['message']);}else{logger[_0x5823('0xc')](_0x5823('0xd'),_0xab7a72,_0x5823('0xf'));_0x2afb69(_0x11537c[_0x5823('0x14')][_0x5823('0x13')]);}})[_0x5823('0x15')](function(_0x4f7fb7){logger[_0x5823('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0xab7a72,_0x4f7fb7);_0x8a813e(_0x4f7fb7);});});} \ No newline at end of file +var _0x2b99=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b99,0x1bc));var _0x92b9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x2b99[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x92b9('0x0'));var util=require(_0x92b9('0x1'));var moment=require(_0x92b9('0x2'));var BPromise=require(_0x92b9('0x3'));var rs=require(_0x92b9('0x4'));var fs=require('fs');var Redis=require(_0x92b9('0x5'));var db=require(_0x92b9('0x6'))['db'];var utils=require(_0x92b9('0x7'));var logger=require(_0x92b9('0x8'))(_0x92b9('0x9'));var config=require('../../config/environment');var jayson=require(_0x92b9('0xa'));var client=jayson[_0x92b9('0xb')][_0x92b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x371afb,_0x22a8ee,_0x12e23c){return new BPromise(function(_0xa9ae91,_0x37b253){return client[_0x92b9('0xd')](_0x371afb,_0x12e23c)[_0x92b9('0xe')](function(_0x4e4d7b){logger[_0x92b9('0xf')](_0x92b9('0x10'),_0x22a8ee,_0x92b9('0x11'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x22a8ee,_0x92b9('0x11'),JSON['stringify'](_0x4e4d7b));if(_0x4e4d7b[_0x92b9('0x12')]){if(_0x4e4d7b[_0x92b9('0x12')][_0x92b9('0x13')]===0x1f4){logger['error'](_0x92b9('0x10'),_0x22a8ee,_0x4e4d7b['error'][_0x92b9('0x14')]);return _0x37b253(_0x4e4d7b[_0x92b9('0x12')]['message']);}logger[_0x92b9('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22a8ee,_0x4e4d7b[_0x92b9('0x12')]['message']);return _0xa9ae91(_0x4e4d7b[_0x92b9('0x12')][_0x92b9('0x14')]);}else{logger[_0x92b9('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22a8ee,_0x92b9('0x11'));_0xa9ae91(_0x4e4d7b[_0x92b9('0x15')][_0x92b9('0x14')]);}})[_0x92b9('0x16')](function(_0x472990){logger[_0x92b9('0x12')](_0x92b9('0x10'),_0x22a8ee,_0x472990);_0x37b253(_0x472990);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index f3d9c53..5a607dc 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 _0xac55=['isAuthenticated','show','post','create','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','/:id'];(function(_0x295c71,_0x5abbab){var _0x28e114=function(_0x4a68ee){while(--_0x4a68ee){_0x295c71['push'](_0x295c71['shift']());}};_0x28e114(++_0x5abbab);}(_0xac55,0x1c8));var _0x5ac5=function(_0x21e54d,_0x591f03){_0x21e54d=_0x21e54d-0x0;var _0x3ab091=_0xac55[_0x21e54d];return _0x3ab091;};'use strict';var multer=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var path=require(_0x5ac5('0x2'));var timeout=require(_0x5ac5('0x3'));var express=require('express');var router=express[_0x5ac5('0x4')]();var fs_extra=require(_0x5ac5('0x5'));var auth=require(_0x5ac5('0x6'));var interaction=require(_0x5ac5('0x7'));var config=require(_0x5ac5('0x8'));var controller=require(_0x5ac5('0x9'));router[_0x5ac5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ac5('0xa')](_0x5ac5('0xb'),auth[_0x5ac5('0xc')](),controller[_0x5ac5('0xd')]);router[_0x5ac5('0xe')]('/',auth[_0x5ac5('0xc')](),controller[_0x5ac5('0xf')]);router['put']('/:id',auth[_0x5ac5('0xc')](),controller[_0x5ac5('0x10')]);router['delete'](_0x5ac5('0xb'),auth[_0x5ac5('0xc')](),controller['destroy']);module[_0x5ac5('0x11')]=router; \ No newline at end of file +var _0xea89=['/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index'];(function(_0x1394b8,_0xf53e70){var _0x4ff78=function(_0x32f336){while(--_0x32f336){_0x1394b8['push'](_0x1394b8['shift']());}};_0x4ff78(++_0xf53e70);}(_0xea89,0x1e2));var _0x9ea8=function(_0xa417ff,_0x2ab57c){_0xa417ff=_0xa417ff-0x0;var _0x2c0a82=_0xea89[_0xa417ff];return _0x2c0a82;};'use strict';var multer=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var path=require(_0x9ea8('0x2'));var timeout=require(_0x9ea8('0x3'));var express=require(_0x9ea8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ea8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ea8('0x6'));var config=require('../../config/environment');var controller=require(_0x9ea8('0x7'));router[_0x9ea8('0x8')]('/',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xa')]);router[_0x9ea8('0x8')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller['show']);router[_0x9ea8('0xc')]('/',auth[_0x9ea8('0x9')](),controller['create']);router[_0x9ea8('0xd')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller['update']);router[_0x9ea8('0xe')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xf')]);module[_0x9ea8('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8043d8e..1594937 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 _0x5793=['name','sequelize','exports','STRING'];(function(_0xe05c2c,_0x398a51){var _0x481458=function(_0x19942c){while(--_0x19942c){_0xe05c2c['push'](_0xe05c2c['shift']());}};_0x481458(++_0x398a51);}(_0x5793,0xb1));var _0x3579=function(_0x17c335,_0x4d3f50){_0x17c335=_0x17c335-0x0;var _0x44713d=_0x5793[_0x17c335];return _0x44713d;};'use strict';var Sequelize=require(_0x3579('0x0'));module[_0x3579('0x1')]={'name':{'type':Sequelize[_0x3579('0x2')],'unique':_0x3579('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa969=['sequelize','exports','STRING','name'];(function(_0x310eb7,_0xbbbe0d){var _0xc672=function(_0x16cee2){while(--_0x16cee2){_0x310eb7['push'](_0x310eb7['shift']());}};_0xc672(++_0xbbbe0d);}(_0xa969,0x114));var _0x9a96=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xa969[_0x1fafa5];return _0xcf08c9;};'use strict';var Sequelize=require(_0x9a96('0x0'));module[_0x9a96('0x1')]={'name':{'type':Sequelize[_0x9a96('0x2')],'unique':_0x9a96('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9a96('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index fdce2c3..b8e09fe 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 _0x0985=['include','findAll','rows','catch','show','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','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge'];(function(_0x5556d5,_0x1909f3){var _0x4f93d8=function(_0xe5adbd){while(--_0xe5adbd){_0x5556d5['push'](_0x5556d5['shift']());}};_0x4f93d8(++_0x1909f3);}(_0x0985,0x16a));var _0x5098=function(_0x5edd2d,_0x22d7ca){_0x5edd2d=_0x5edd2d-0x0;var _0x3aef67=_0x0985[_0x5edd2d];return _0x3aef67;};'use strict';var emlformat=require(_0x5098('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5098('0x1'));var jsonpatch=require(_0x5098('0x2'));var rp=require(_0x5098('0x3'));var moment=require(_0x5098('0x4'));var BPromise=require(_0x5098('0x5'));var Mustache=require('mustache');var util=require(_0x5098('0x6'));var path=require('path');var sox=require(_0x5098('0x7'));var csv=require('to-csv');var ejs=require(_0x5098('0x8'));var fs=require('fs');var fs_extra=require(_0x5098('0x9'));var _=require(_0x5098('0xa'));var squel=require(_0x5098('0xb'));var crypto=require(_0x5098('0xc'));var jsforce=require(_0x5098('0xd'));var deskjs=require(_0x5098('0xe'));var toCsv=require(_0x5098('0xf'));var querystring=require(_0x5098('0x10'));var Papa=require(_0x5098('0x11'));var Redis=require('ioredis');var authService=require(_0x5098('0x12'));var qs=require(_0x5098('0x13'));var as=require(_0x5098('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5098('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5098('0x16'));var licenseUtil=require(_0x5098('0x17'));var db=require(_0x5098('0x18'))['db'];function respondWithStatusCode(_0x23280f,_0x6f1322){_0x6f1322=_0x6f1322||0xcc;return function(_0x8f4740){if(_0x8f4740){return _0x23280f[_0x5098('0x19')](_0x6f1322);}return _0x23280f[_0x5098('0x1a')](_0x6f1322)[_0x5098('0x1b')]();};}function respondWithResult(_0x4db41b,_0x1847f8){_0x1847f8=_0x1847f8||0xc8;return function(_0x5af225){if(_0x5af225){return _0x4db41b[_0x5098('0x1a')](_0x1847f8)[_0x5098('0x1c')](_0x5af225);}};}function respondWithFilteredResult(_0x307254,_0x286e12){return function(_0x211b76){if(_0x211b76){var _0x4708ec=typeof _0x286e12['offset']===_0x5098('0x1d')&&typeof _0x286e12[_0x5098('0x1e')]===_0x5098('0x1d');var _0x3e23ac=_0x211b76['count'];var _0xc8b782=_0x4708ec?0x0:_0x286e12[_0x5098('0x1f')];var _0x34e12c=_0x4708ec?_0x211b76[_0x5098('0x20')]:_0x286e12[_0x5098('0x1f')]+_0x286e12[_0x5098('0x1e')];var _0x196e5f;if(_0x34e12c>=_0x3e23ac){_0x34e12c=_0x3e23ac;_0x196e5f=0xc8;}else{_0x196e5f=0xce;}_0x307254[_0x5098('0x1a')](_0x196e5f);return _0x307254[_0x5098('0x21')](_0x5098('0x22'),_0xc8b782+'-'+_0x34e12c+'/'+_0x3e23ac)[_0x5098('0x1c')](_0x211b76);}return null;};}function patchUpdates(_0x26f2bd){return function(_0x2f3e0c){try{jsonpatch['apply'](_0x2f3e0c,_0x26f2bd,!![]);}catch(_0x5f1141){return BPromise[_0x5098('0x23')](_0x5f1141);}return _0x2f3e0c[_0x5098('0x24')]();};}function saveUpdates(_0xf1c7fa,_0x2e6c4a){return function(_0xd88643){if(_0xd88643){return _0xd88643[_0x5098('0x25')](_0xf1c7fa)[_0x5098('0x26')](function(_0x59cf60){return _0x59cf60;});}return null;};}function removeEntity(_0x1d5ba1,_0x52654e){return function(_0xbbce0b){if(_0xbbce0b){return _0xbbce0b[_0x5098('0x27')]()['then'](function(){var _0x25db38=_0xbbce0b[_0x5098('0x28')]({'plain':!![]});var _0x1b9891=_0x5098('0x29');return db[_0x5098('0x2a')][_0x5098('0x27')]({'where':{'type':_0x1b9891,'resourceId':_0x25db38['id']}})['then'](function(){return _0xbbce0b;});})[_0x5098('0x26')](function(){_0x1d5ba1[_0x5098('0x1a')](0xcc)[_0x5098('0x1b')]();});}};}function handleEntityNotFound(_0x183708,_0x9cda65){return function(_0x35284a){if(!_0x35284a){_0x183708[_0x5098('0x19')](0x194);}return _0x35284a;};}function handleError(_0x1a0147,_0x4e70a5){_0x4e70a5=_0x4e70a5||0x1f4;return function(_0x441208){logger[_0x5098('0x2b')](_0x441208['stack']);if(_0x441208[_0x5098('0x2c')]){delete _0x441208[_0x5098('0x2c')];}_0x1a0147[_0x5098('0x1a')](_0x4e70a5)[_0x5098('0x2d')](_0x441208);};}exports[_0x5098('0x2e')]=function(_0x5e19d3,_0x1b9826){var _0x43c90e={},_0x4898e6={},_0x16ded2={'count':0x0,'rows':[]};var _0x1b7cd4=_[_0x5098('0x2f')](db[_0x5098('0x30')][_0x5098('0x31')],function(_0x1feb13){return{'name':_0x1feb13[_0x5098('0x32')],'type':_0x1feb13['type'][_0x5098('0x33')]};});_0x4898e6[_0x5098('0x34')]=_[_0x5098('0x2f')](_0x1b7cd4,_0x5098('0x2c'));_0x4898e6[_0x5098('0x35')]=_['keys'](_0x5e19d3[_0x5098('0x35')]);_0x4898e6['filters']=_[_0x5098('0x36')](_0x4898e6['model'],_0x4898e6['query']);_0x43c90e[_0x5098('0x37')]=_[_0x5098('0x36')](_0x4898e6['model'],qs[_0x5098('0x38')](_0x5e19d3[_0x5098('0x35')][_0x5098('0x38')]));_0x43c90e[_0x5098('0x37')]=_0x43c90e[_0x5098('0x37')][_0x5098('0x39')]?_0x43c90e['attributes']:_0x4898e6[_0x5098('0x34')];if(!_0x5e19d3[_0x5098('0x35')][_0x5098('0x3a')]('nolimit')){_0x43c90e[_0x5098('0x1e')]=qs[_0x5098('0x1e')](_0x5e19d3[_0x5098('0x35')][_0x5098('0x1e')]);_0x43c90e[_0x5098('0x1f')]=qs[_0x5098('0x1f')](_0x5e19d3[_0x5098('0x35')][_0x5098('0x1f')]);}_0x43c90e[_0x5098('0x3b')]=qs[_0x5098('0x3c')](_0x5e19d3['query'][_0x5098('0x3c')]);_0x43c90e[_0x5098('0x3d')]=qs[_0x5098('0x3e')](_[_0x5098('0x3f')](_0x5e19d3[_0x5098('0x35')],_0x4898e6[_0x5098('0x3e')]),_0x1b7cd4);if(_0x5e19d3[_0x5098('0x35')][_0x5098('0x40')]){_0x43c90e['where']=_['merge'](_0x43c90e['where'],{'$or':_[_0x5098('0x2f')](_0x1b7cd4,function(_0x4d0ca6){if(_0x4d0ca6[_0x5098('0x41')]!==_0x5098('0x42')){var _0x3109e0={};_0x3109e0[_0x4d0ca6['name']]={'$like':'%'+_0x5e19d3[_0x5098('0x35')][_0x5098('0x40')]+'%'};return _0x3109e0;}})});}_0x43c90e=_[_0x5098('0x43')]({},_0x43c90e,_0x5e19d3['options']);var _0x37c855={'where':_0x43c90e['where']};return db[_0x5098('0x30')][_0x5098('0x20')](_0x37c855)[_0x5098('0x26')](function(_0x363a92){_0x16ded2[_0x5098('0x20')]=_0x363a92;if(_0x5e19d3[_0x5098('0x35')]['includeAll']){_0x43c90e[_0x5098('0x44')]=[{'all':!![]}];}return db[_0x5098('0x30')][_0x5098('0x45')](_0x43c90e);})[_0x5098('0x26')](function(_0x583831){_0x16ded2[_0x5098('0x46')]=_0x583831;return _0x16ded2;})[_0x5098('0x26')](respondWithFilteredResult(_0x1b9826,_0x43c90e))[_0x5098('0x47')](handleError(_0x1b9826,null));};exports[_0x5098('0x48')]=function(_0x3b99eb,_0x3a2776){var _0x5e7ec0={'raw':!![],'where':{'id':_0x3b99eb['params']['id']}},_0x1cef8c={};_0x1cef8c[_0x5098('0x34')]=_['keys'](db[_0x5098('0x30')][_0x5098('0x31')]);_0x1cef8c[_0x5098('0x35')]=_[_0x5098('0x49')](_0x3b99eb[_0x5098('0x35')]);_0x1cef8c[_0x5098('0x3e')]=_['intersection'](_0x1cef8c[_0x5098('0x34')],_0x1cef8c[_0x5098('0x35')]);_0x5e7ec0[_0x5098('0x37')]=_['intersection'](_0x1cef8c[_0x5098('0x34')],qs['fields'](_0x3b99eb[_0x5098('0x35')][_0x5098('0x38')]));_0x5e7ec0[_0x5098('0x37')]=_0x5e7ec0['attributes'][_0x5098('0x39')]?_0x5e7ec0[_0x5098('0x37')]:_0x1cef8c[_0x5098('0x34')];if(_0x3b99eb[_0x5098('0x35')]['includeAll']){_0x5e7ec0[_0x5098('0x44')]=[{'all':!![]}];}_0x5e7ec0=_[_0x5098('0x43')]({},_0x5e7ec0,_0x3b99eb[_0x5098('0x4a')]);return db[_0x5098('0x30')][_0x5098('0x4b')](_0x5e7ec0)[_0x5098('0x26')](handleEntityNotFound(_0x3a2776,null))[_0x5098('0x26')](respondWithResult(_0x3a2776,null))[_0x5098('0x47')](handleError(_0x3a2776,null));};exports[_0x5098('0x4c')]=function(_0x2b45f4,_0x4a63a5){return db['Variable']['create'](_0x2b45f4[_0x5098('0x4d')],{})[_0x5098('0x26')](function(_0x5776e5){var _0x4750d0=_0x2b45f4[_0x5098('0x4e')]['get']({'plain':!![]});if(!_0x4750d0)throw new Error(_0x5098('0x4f'));if(_0x4750d0[_0x5098('0x50')]===_0x5098('0x4e')){var _0x43f34f=_0x5776e5[_0x5098('0x28')]({'plain':!![]});var _0x51ac1a=_0x5098('0x29');return db[_0x5098('0x51')][_0x5098('0x4b')]({'where':{'name':_0x51ac1a,'userProfileId':_0x4750d0[_0x5098('0x52')]},'raw':!![]})['then'](function(_0x535bc3){if(_0x535bc3&&_0x535bc3[_0x5098('0x53')]===0x0){return db[_0x5098('0x2a')][_0x5098('0x4c')]({'name':_0x43f34f[_0x5098('0x2c')],'resourceId':_0x43f34f['id'],'type':_0x535bc3['name'],'sectionId':_0x535bc3['id']},{})[_0x5098('0x26')](function(){return _0x5776e5;});}else{return _0x5776e5;}})['catch'](function(_0x4c423e){logger[_0x5098('0x2b')](_0x5098('0x54'),_0x4c423e);throw _0x4c423e;});}return _0x5776e5;})['then'](respondWithResult(_0x4a63a5,0xc9))['catch'](handleError(_0x4a63a5,null));};exports[_0x5098('0x25')]=function(_0x8193df,_0x4b33f7){if(_0x8193df[_0x5098('0x4d')]['id']){delete _0x8193df[_0x5098('0x4d')]['id'];}return db[_0x5098('0x30')][_0x5098('0x4b')]({'where':{'id':_0x8193df[_0x5098('0x55')]['id']}})[_0x5098('0x26')](handleEntityNotFound(_0x4b33f7,null))['then'](saveUpdates(_0x8193df[_0x5098('0x4d')],null))[_0x5098('0x26')](respondWithResult(_0x4b33f7,null))[_0x5098('0x47')](handleError(_0x4b33f7,null));};exports[_0x5098('0x27')]=function(_0x246d27,_0x14c054){return db[_0x5098('0x30')]['find']({'where':{'id':_0x246d27[_0x5098('0x55')]['id']}})[_0x5098('0x26')](handleEntityNotFound(_0x14c054,null))[_0x5098('0x26')](removeEntity(_0x14c054,null))[_0x5098('0x47')](handleError(_0x14c054,null));}; \ No newline at end of file +var _0x5c57=['Variable','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','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','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','Variables','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x55d290,_0x255d89){var _0x301d34=function(_0x414bfa){while(--_0x414bfa){_0x55d290['push'](_0x55d290['shift']());}};_0x301d34(++_0x255d89);}(_0x5c57,0x155));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x75c5('0x0'));var rimraf=require(_0x75c5('0x1'));var zipdir=require(_0x75c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75c5('0x3'));var moment=require(_0x75c5('0x4'));var BPromise=require(_0x75c5('0x5'));var Mustache=require(_0x75c5('0x6'));var util=require('util');var path=require(_0x75c5('0x7'));var sox=require('sox');var csv=require(_0x75c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75c5('0x9'));var _=require(_0x75c5('0xa'));var squel=require(_0x75c5('0xb'));var crypto=require('crypto');var jsforce=require(_0x75c5('0xc'));var deskjs=require(_0x75c5('0xd'));var toCsv=require(_0x75c5('0x8'));var querystring=require(_0x75c5('0xe'));var Papa=require(_0x75c5('0xf'));var Redis=require(_0x75c5('0x10'));var authService=require(_0x75c5('0x11'));var qs=require(_0x75c5('0x12'));var as=require(_0x75c5('0x13'));var hardwareService=require(_0x75c5('0x14'));var logger=require(_0x75c5('0x15'))(_0x75c5('0x16'));var utils=require(_0x75c5('0x17'));var config=require(_0x75c5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x75c5('0x19'))['db'];function respondWithStatusCode(_0x5780d9,_0x5bac14){_0x5bac14=_0x5bac14||0xcc;return function(_0x556222){if(_0x556222){return _0x5780d9['sendStatus'](_0x5bac14);}return _0x5780d9[_0x75c5('0x1a')](_0x5bac14)['end']();};}function respondWithResult(_0x1e6139,_0x2dd55c){_0x2dd55c=_0x2dd55c||0xc8;return function(_0x20c99){if(_0x20c99){return _0x1e6139[_0x75c5('0x1a')](_0x2dd55c)[_0x75c5('0x1b')](_0x20c99);}};}function respondWithFilteredResult(_0x587490,_0x315fb9){return function(_0x2a2439){if(_0x2a2439){var _0x255a1d=typeof _0x315fb9[_0x75c5('0x1c')]===_0x75c5('0x1d')&&typeof _0x315fb9[_0x75c5('0x1e')]===_0x75c5('0x1d');var _0x56e0fe=_0x2a2439[_0x75c5('0x1f')];var _0x5212b8=_0x255a1d?0x0:_0x315fb9[_0x75c5('0x1c')];var _0x5351fa=_0x255a1d?_0x2a2439[_0x75c5('0x1f')]:_0x315fb9[_0x75c5('0x1c')]+_0x315fb9[_0x75c5('0x1e')];var _0x532305;if(_0x5351fa>=_0x56e0fe){_0x5351fa=_0x56e0fe;_0x532305=0xc8;}else{_0x532305=0xce;}_0x587490[_0x75c5('0x1a')](_0x532305);return _0x587490['set'](_0x75c5('0x20'),_0x5212b8+'-'+_0x5351fa+'/'+_0x56e0fe)[_0x75c5('0x1b')](_0x2a2439);}return null;};}function patchUpdates(_0x5e92fd){return function(_0x410c78){try{jsonpatch[_0x75c5('0x21')](_0x410c78,_0x5e92fd,!![]);}catch(_0x4fb2e7){return BPromise['reject'](_0x4fb2e7);}return _0x410c78[_0x75c5('0x22')]();};}function saveUpdates(_0x1b54b8,_0x4aace1){return function(_0x10e59d){if(_0x10e59d){return _0x10e59d[_0x75c5('0x23')](_0x1b54b8)[_0x75c5('0x24')](function(_0x4874c3){return _0x4874c3;});}return null;};}function removeEntity(_0x593fab,_0x3500ca){return function(_0x53e642){if(_0x53e642){return _0x53e642['destroy']()[_0x75c5('0x24')](function(){var _0x5c4cc5=_0x53e642[_0x75c5('0x25')]({'plain':!![]});var _0x480edf=_0x75c5('0x26');return db['UserProfileResource'][_0x75c5('0x27')]({'where':{'type':_0x480edf,'resourceId':_0x5c4cc5['id']}})[_0x75c5('0x24')](function(){return _0x53e642;});})[_0x75c5('0x24')](function(){_0x593fab[_0x75c5('0x1a')](0xcc)[_0x75c5('0x28')]();});}};}function handleEntityNotFound(_0x40cdc1,_0x51016d){return function(_0x2b18ba){if(!_0x2b18ba){_0x40cdc1[_0x75c5('0x29')](0x194);}return _0x2b18ba;};}function handleError(_0x2aaeb1,_0x5263c1){_0x5263c1=_0x5263c1||0x1f4;return function(_0x2dabf8){logger[_0x75c5('0x2a')](_0x2dabf8[_0x75c5('0x2b')]);if(_0x2dabf8[_0x75c5('0x2c')]){delete _0x2dabf8['name'];}_0x2aaeb1[_0x75c5('0x1a')](_0x5263c1)[_0x75c5('0x2d')](_0x2dabf8);};}exports['index']=function(_0x1215d4,_0x5130f0){var _0x251ce4={},_0xcb84fe={},_0x552c47={'count':0x0,'rows':[]};var _0x10ec1f=_[_0x75c5('0x2e')](db['Variable'][_0x75c5('0x2f')],function(_0x379bf4){return{'name':_0x379bf4[_0x75c5('0x30')],'type':_0x379bf4['type'][_0x75c5('0x31')]};});_0xcb84fe[_0x75c5('0x32')]=_[_0x75c5('0x2e')](_0x10ec1f,'name');_0xcb84fe['query']=_[_0x75c5('0x33')](_0x1215d4['query']);_0xcb84fe[_0x75c5('0x34')]=_[_0x75c5('0x35')](_0xcb84fe[_0x75c5('0x32')],_0xcb84fe[_0x75c5('0x36')]);_0x251ce4[_0x75c5('0x37')]=_[_0x75c5('0x35')](_0xcb84fe[_0x75c5('0x32')],qs[_0x75c5('0x38')](_0x1215d4[_0x75c5('0x36')][_0x75c5('0x38')]));_0x251ce4[_0x75c5('0x37')]=_0x251ce4[_0x75c5('0x37')]['length']?_0x251ce4[_0x75c5('0x37')]:_0xcb84fe[_0x75c5('0x32')];if(!_0x1215d4[_0x75c5('0x36')][_0x75c5('0x39')](_0x75c5('0x3a'))){_0x251ce4['limit']=qs['limit'](_0x1215d4['query'][_0x75c5('0x1e')]);_0x251ce4[_0x75c5('0x1c')]=qs[_0x75c5('0x1c')](_0x1215d4[_0x75c5('0x36')]['offset']);}_0x251ce4[_0x75c5('0x3b')]=qs['sort'](_0x1215d4[_0x75c5('0x36')]['sort']);_0x251ce4[_0x75c5('0x3c')]=qs[_0x75c5('0x34')](_[_0x75c5('0x3d')](_0x1215d4[_0x75c5('0x36')],_0xcb84fe['filters']),_0x10ec1f);if(_0x1215d4[_0x75c5('0x36')]['filter']){_0x251ce4[_0x75c5('0x3c')]=_[_0x75c5('0x3e')](_0x251ce4['where'],{'$or':_['map'](_0x10ec1f,function(_0x9098de){if(_0x9098de[_0x75c5('0x3f')]!==_0x75c5('0x40')){var _0x20cace={};_0x20cace[_0x9098de[_0x75c5('0x2c')]]={'$like':'%'+_0x1215d4[_0x75c5('0x36')][_0x75c5('0x41')]+'%'};return _0x20cace;}})});}_0x251ce4=_[_0x75c5('0x3e')]({},_0x251ce4,_0x1215d4[_0x75c5('0x42')]);var _0x508cb4={'where':_0x251ce4['where']};return db['Variable']['count'](_0x508cb4)[_0x75c5('0x24')](function(_0x4d2c03){_0x552c47[_0x75c5('0x1f')]=_0x4d2c03;if(_0x1215d4['query'][_0x75c5('0x43')]){_0x251ce4[_0x75c5('0x44')]=[{'all':!![]}];}return db[_0x75c5('0x45')]['findAll'](_0x251ce4);})[_0x75c5('0x24')](function(_0x55b4c2){_0x552c47['rows']=_0x55b4c2;return _0x552c47;})[_0x75c5('0x24')](respondWithFilteredResult(_0x5130f0,_0x251ce4))['catch'](handleError(_0x5130f0,null));};exports[_0x75c5('0x46')]=function(_0x9590ac,_0x459913){var _0x471e12={'raw':!![],'where':{'id':_0x9590ac[_0x75c5('0x47')]['id']}},_0xedf721={};_0xedf721[_0x75c5('0x32')]=_[_0x75c5('0x33')](db[_0x75c5('0x45')][_0x75c5('0x2f')]);_0xedf721[_0x75c5('0x36')]=_['keys'](_0x9590ac[_0x75c5('0x36')]);_0xedf721[_0x75c5('0x34')]=_[_0x75c5('0x35')](_0xedf721[_0x75c5('0x32')],_0xedf721[_0x75c5('0x36')]);_0x471e12[_0x75c5('0x37')]=_['intersection'](_0xedf721['model'],qs['fields'](_0x9590ac[_0x75c5('0x36')][_0x75c5('0x38')]));_0x471e12[_0x75c5('0x37')]=_0x471e12['attributes'][_0x75c5('0x48')]?_0x471e12[_0x75c5('0x37')]:_0xedf721[_0x75c5('0x32')];if(_0x9590ac['query'][_0x75c5('0x43')]){_0x471e12[_0x75c5('0x44')]=[{'all':!![]}];}_0x471e12=_[_0x75c5('0x3e')]({},_0x471e12,_0x9590ac[_0x75c5('0x42')]);return db[_0x75c5('0x45')][_0x75c5('0x49')](_0x471e12)[_0x75c5('0x24')](handleEntityNotFound(_0x459913,null))[_0x75c5('0x24')](respondWithResult(_0x459913,null))['catch'](handleError(_0x459913,null));};exports[_0x75c5('0x4a')]=function(_0x53a143,_0x3e4e7e){return db[_0x75c5('0x45')][_0x75c5('0x4a')](_0x53a143[_0x75c5('0x4b')],{})[_0x75c5('0x24')](function(_0xf4e556){var _0x2d3fe7=_0x53a143['user']['get']({'plain':!![]});if(!_0x2d3fe7)throw new Error(_0x75c5('0x4c'));if(_0x2d3fe7[_0x75c5('0x4d')]==='user'){var _0x9c9701=_0xf4e556[_0x75c5('0x25')]({'plain':!![]});var _0x367627=_0x75c5('0x26');return db[_0x75c5('0x4e')][_0x75c5('0x49')]({'where':{'name':_0x367627,'userProfileId':_0x2d3fe7['userProfileId']},'raw':!![]})[_0x75c5('0x24')](function(_0x26e036){if(_0x26e036&&_0x26e036[_0x75c5('0x4f')]===0x0){return db[_0x75c5('0x50')]['create']({'name':_0x9c9701[_0x75c5('0x2c')],'resourceId':_0x9c9701['id'],'type':_0x26e036[_0x75c5('0x2c')],'sectionId':_0x26e036['id']},{})['then'](function(){return _0xf4e556;});}else{return _0xf4e556;}})[_0x75c5('0x51')](function(_0x557f14){logger[_0x75c5('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x557f14);throw _0x557f14;});}return _0xf4e556;})['then'](respondWithResult(_0x3e4e7e,0xc9))[_0x75c5('0x51')](handleError(_0x3e4e7e,null));};exports[_0x75c5('0x23')]=function(_0x96e5f6,_0x40ebf6){if(_0x96e5f6[_0x75c5('0x4b')]['id']){delete _0x96e5f6[_0x75c5('0x4b')]['id'];}return db[_0x75c5('0x45')][_0x75c5('0x49')]({'where':{'id':_0x96e5f6[_0x75c5('0x47')]['id']}})[_0x75c5('0x24')](handleEntityNotFound(_0x40ebf6,null))[_0x75c5('0x24')](saveUpdates(_0x96e5f6[_0x75c5('0x4b')],null))['then'](respondWithResult(_0x40ebf6,null))[_0x75c5('0x51')](handleError(_0x40ebf6,null));};exports[_0x75c5('0x27')]=function(_0x495eef,_0x2ba5c9){return db['Variable'][_0x75c5('0x49')]({'where':{'id':_0x495eef[_0x75c5('0x47')]['id']}})[_0x75c5('0x24')](handleEntityNotFound(_0x2ba5c9,null))[_0x75c5('0x24')](removeEntity(_0x2ba5c9,null))['catch'](handleError(_0x2ba5c9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ceda439..d8ae73e 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 _0xaf11=['util','../../config/logger','api','rimraf','../../config/environment','exports','define','tools_variables'];(function(_0x1a6c7f,_0x5aee3f){var _0x1d378d=function(_0x3faee3){while(--_0x3faee3){_0x1a6c7f['push'](_0x1a6c7f['shift']());}};_0x1d378d(++_0x5aee3f);}(_0xaf11,0x178));var _0x1af1=function(_0x491499,_0x2d4463){_0x491499=_0x491499-0x0;var _0x436b4e=_0xaf11[_0x491499];return _0x436b4e;};'use strict';var _=require('lodash');var util=require(_0x1af1('0x0'));var logger=require(_0x1af1('0x1'))(_0x1af1('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(_0x1af1('0x3'));var config=require(_0x1af1('0x4'));var attributes=require('./variable.attributes');module[_0x1af1('0x5')]=function(_0x52f5f8,_0x27ec53){return _0x52f5f8[_0x1af1('0x6')]('Variable',attributes,{'tableName':_0x1af1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5790=['./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2d9a0f,_0x238a38){var _0x2236e8=function(_0x5a91b6){while(--_0x5a91b6){_0x2d9a0f['push'](_0x2d9a0f['shift']());}};_0x2236e8(++_0x238a38);}(_0x5790,0x139));var _0x0579=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5790[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0579('0x0'));var util=require(_0x0579('0x1'));var logger=require(_0x0579('0x2'))(_0x0579('0x3'));var moment=require(_0x0579('0x4'));var BPromise=require(_0x0579('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0579('0x6'));var rimraf=require(_0x0579('0x7'));var config=require(_0x0579('0x8'));var attributes=require(_0x0579('0x9'));module[_0x0579('0xa')]=function(_0x3101f3,_0x3dbcca){return _0x3101f3[_0x0579('0xb')](_0x0579('0xc'),attributes,{'tableName':_0x0579('0xd'),'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 27271c4..c3f30ad 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 _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0xa22ffa,_0x2ea5d8){var _0x1c4c4f=function(_0x4cf6ee){while(--_0x4cf6ee){_0xa22ffa['push'](_0xa22ffa['shift']());}};_0x1c4c4f(++_0x2ea5d8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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']('Variable,\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['Variable'][_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,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x78d6ae,_0x6b7196){var _0x2c8de5=function(_0x437bc9){while(--_0x437bc9){_0x78d6ae['push'](_0x78d6ae['shift']());}};_0x2c8de5(++_0x6b7196);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0x7fbe[_0x2872b0];return _0x58b379;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 9dedfb4..8e1ef33 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 _0x8554=['pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','fetch','/reset','reset','/pull'];(function(_0x56de66,_0x517040){var _0x5479ec=function(_0x21dd9){while(--_0x21dd9){_0x56de66['push'](_0x56de66['shift']());}};_0x5479ec(++_0x517040);}(_0x8554,0x6c));var _0x4855=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8554[_0x17d9e3];return _0x14192d;};'use strict';var express=require(_0x4855('0x0'));var router=express[_0x4855('0x1')]();var auth=require(_0x4855('0x2'));var controller=require('./version.controller');router[_0x4855('0x3')]('/',controller[_0x4855('0x4')]);router['get'](_0x4855('0x5'),auth[_0x4855('0x6')](),auth['canUpdate'](),controller[_0x4855('0x7')]);router[_0x4855('0x3')](_0x4855('0x8'),auth[_0x4855('0x6')](),auth['canUpdate'](),controller[_0x4855('0x9')]);router[_0x4855('0x3')](_0x4855('0xa'),auth[_0x4855('0x6')](),auth['canUpdate'](),controller[_0x4855('0xb')]);router[_0x4855('0x3')](_0x4855('0xc'),auth[_0x4855('0x6')](),controller[_0x4855('0xd')]);router[_0x4855('0x3')](_0x4855('0xe'),controller[_0x4855('0xf')]);module[_0x4855('0x10')]=router; \ No newline at end of file +var _0x7826=['index','fetch','/reset','isAuthenticated','canUpdate','reset','/pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7826,0x1d7));var _0x6782=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x7826[_0x81dcac];return _0xc7803b;};'use strict';var express=require(_0x6782('0x0'));var router=express[_0x6782('0x1')]();var auth=require(_0x6782('0x2'));var controller=require(_0x6782('0x3'));router[_0x6782('0x4')]('/',controller[_0x6782('0x5')]);router[_0x6782('0x4')]('/fetch',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x6782('0x6')]);router[_0x6782('0x4')](_0x6782('0x7'),auth[_0x6782('0x8')](),auth[_0x6782('0x9')](),controller[_0x6782('0xa')]);router[_0x6782('0x4')](_0x6782('0xb'),auth[_0x6782('0x8')](),auth['canUpdate'](),controller['pull']);router[_0x6782('0x4')](_0x6782('0xc'),auth[_0x6782('0x8')](),controller[_0x6782('0xd')]);router[_0x6782('0x4')](_0x6782('0xe'),controller[_0x6782('0xf')]);module[_0x6782('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 209a59e..17dd39d 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 _0xb600=['push','sort','Migration','sequelize','constructor','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','query','latest','version','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js'];(function(_0x155704,_0x448728){var _0x1a28cf=function(_0x1bee52){while(--_0x1bee52){_0x155704['push'](_0x155704['shift']());}};_0x1a28cf(++_0x448728);}(_0xb600,0x127));var _0x0b60=function(_0x43f6d0,_0x448b68){_0x43f6d0=_0x43f6d0-0x0;var _0x213c2e=_0xb600[_0x43f6d0];return _0x213c2e;};'use strict';var Umzug=require(_0x0b60('0x0'));var path=require(_0x0b60('0x1'));var fs=require('fs');var _=require(_0x0b60('0x2'));var pkginfo=require(_0x0b60('0x3'))(module,'version');var compareVersions=require(_0x0b60('0x4'));var exec=require('child_process')[_0x0b60('0x5')];var db=require(_0x0b60('0x6'))['db'];var config=require(_0x0b60('0x7'));var pm2=require(_0x0b60('0x8'));var logger=require('../../config/logger')(_0x0b60('0x9'));var git=require(_0x0b60('0xa'))(config[_0x0b60('0xb')]);exports['index']=function(_0x49d328,_0x1e5086){var _0x4cc8a6={'current':module[_0x0b60('0xc')]['version'],'phonebar':0x2};if(_0x49d328['query']&&_0x49d328[_0x0b60('0xd')][_0x0b60('0xe')]){return git['fetch']()['tags'](function(_0x311d05,_0xea79d1){_0x4cc8a6[_0x0b60('0xe')]=(_0x311d05?module[_0x0b60('0xc')][_0x0b60('0xf')]:_0xea79d1[_0x0b60('0xe')])||_0x0b60('0x10');return _0x1e5086[_0x0b60('0x11')](0xc8)[_0x0b60('0x12')](_0x4cc8a6);});}else{return _0x1e5086[_0x0b60('0x11')](0xc8)[_0x0b60('0x12')](_0x4cc8a6);}};exports['fetch']=function(_0x3a90c1,_0x243684){return git['fetch']([_0x0b60('0x13'),'master'],function(_0x582757){if(_0x582757){logger[_0x0b60('0x14')](_0x582757);return _0x243684[_0x0b60('0x11')](0x1f4)[_0x0b60('0x12')](_0x582757);}logger[_0x0b60('0x15')](_0x0b60('0x16'));return _0x243684['status'](0xc8)['json']({'output':_0x0b60('0x17')});});};exports[_0x0b60('0x18')]=function(_0x4b22c8,_0x1c150c){return git['reset'](['--hard',_0x0b60('0x19')],function(_0x1243e6){if(_0x1243e6){logger['error'](_0x1243e6);return _0x1c150c[_0x0b60('0x11')](0x1f4)[_0x0b60('0x12')](_0x1243e6);}logger[_0x0b60('0x15')](_0x0b60('0x1a'));return _0x1c150c['status'](0xc8)[_0x0b60('0x12')]({'output':_0x0b60('0x1b')});});};exports[_0x0b60('0x1c')]=function(_0x537853,_0x543b3d){exec(_0x0b60('0x1d'),function(_0x42254a,_0x299fe3,_0x1b422f){logger[_0x0b60('0x15')](_0x299fe3);logger['info'](_0x1b422f);if(_0x42254a){logger[_0x0b60('0x14')](_0x42254a);return _0x543b3d[_0x0b60('0x11')](0x1f4)['json'](_0x42254a);}return _0x543b3d[_0x0b60('0x11')](0xc8)[_0x0b60('0x12')]({'output':_0x299fe3});});};exports['restart']=function(_0x559779,_0x25fa62){return pm2['restart'](_0x0b60('0x1e'))[_0x0b60('0x1f')](function(_0x5e84da){logger[_0x0b60('0x15')](_0x0b60('0x20'),_0x5e84da);return _0x25fa62[_0x0b60('0x11')](0xc8)[_0x0b60('0x12')]({'output':_0x0b60('0x21')});})[_0x0b60('0x22')](function(_0x5e8023){logger[_0x0b60('0x14')](_0x5e8023);return _0x25fa62[_0x0b60('0x11')](0x1f4)[_0x0b60('0x12')](_0x5e8023);});};exports[_0x0b60('0x23')]=function(_0x37f7f2,_0x2f1def){var _0x6fa7c6=fs[_0x0b60('0x24')](path[_0x0b60('0x25')](config[_0x0b60('0xb')],_0x0b60('0x26'),_0x0b60('0x23')));var _0x5a4236=[];for(var _0x586f80=0x0;_0x586f80<_0x6fa7c6[_0x0b60('0x27')];_0x586f80++){var _0x261062=_0x6fa7c6[_0x586f80]['replace'](_0x0b60('0x28'),'');if(compareVersions(module[_0x0b60('0xc')]['version'],_0x261062)===-0x1){_0x5a4236[_0x0b60('0x29')](_0x261062);}}if(_0x5a4236[_0x0b60('0x27')]){var _0x16f6cb=_0x5a4236[_0x0b60('0x2a')](compareVersions);var _0x4725b7=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x0b60('0x2b')],'modelName':'Migration','columnName':_0x0b60('0xf')},'migrations':{'params':[db[_0x0b60('0x2c')]['getQueryInterface'](),db['sequelize'][_0x0b60('0x2d')],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[_0x0b60('0x25')](config[_0x0b60('0xb')],_0x0b60('0x26'),_0x0b60('0x23')),'pattern':/\.js$/}});_0x4725b7['up']({'migrations':_['map'](_0x16f6cb,function(_0x2998f1){return _0x2998f1+_0x0b60('0x28');})})[_0x0b60('0x1f')](function(){return _0x2f1def['status'](0xc8)[_0x0b60('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x0b60('0xc')][_0x0b60('0xf')]+'\x20to\x20'+_[_0x0b60('0x2e')](_0x16f6cb),'migrations':_[_0x0b60('0x25')](_0x16f6cb)});})[_0x0b60('0x22')](function(_0x51a1f5){if(_0x51a1f5 instanceof db[_0x0b60('0x2c')]['UniqueConstraintError']){return _0x2f1def[_0x0b60('0x11')](0xc8)[_0x0b60('0x12')]({'output':_0x0b60('0x2f')});}else{return _0x2f1def[_0x0b60('0x11')](0x1f4)[_0x0b60('0x12')](_0x51a1f5);}});}else{return _0x2f1def[_0x0b60('0x11')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xfca5=['replace','sort','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','exports','query','fetch','tags','2.0.0','status','json','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','root','server','migrations','length'];(function(_0x3e400d,_0x569ed1){var _0x17e63f=function(_0x46aae5){while(--_0x46aae5){_0x3e400d['push'](_0x3e400d['shift']());}};_0x17e63f(++_0x569ed1);}(_0xfca5,0x1bb));var _0x5fca=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0xfca5[_0x52b24f];return _0x46ea6b;};'use strict';var Umzug=require(_0x5fca('0x0'));var path=require(_0x5fca('0x1'));var fs=require('fs');var _=require(_0x5fca('0x2'));var pkginfo=require('pkginfo')(module,_0x5fca('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x5fca('0x4')];var db=require(_0x5fca('0x5'))['db'];var config=require(_0x5fca('0x6'));var pm2=require(_0x5fca('0x7'));var logger=require(_0x5fca('0x8'))(_0x5fca('0x9'));var git=require('simple-git')(config['root']);exports['index']=function(_0xf6d3eb,_0x53c4d0){var _0x378e3f={'current':module[_0x5fca('0xa')][_0x5fca('0x3')],'phonebar':0x2};if(_0xf6d3eb[_0x5fca('0xb')]&&_0xf6d3eb[_0x5fca('0xb')]['latest']){return git[_0x5fca('0xc')]()[_0x5fca('0xd')](function(_0x3b2b85,_0x5344dd){_0x378e3f['latest']=(_0x3b2b85?module[_0x5fca('0xa')][_0x5fca('0x3')]:_0x5344dd['latest'])||_0x5fca('0xe');return _0x53c4d0[_0x5fca('0xf')](0xc8)['json'](_0x378e3f);});}else{return _0x53c4d0[_0x5fca('0xf')](0xc8)[_0x5fca('0x10')](_0x378e3f);}};exports[_0x5fca('0xc')]=function(_0x6b717,_0x2b3cbd){return git[_0x5fca('0xc')](['origin','master'],function(_0x3adb21){if(_0x3adb21){logger[_0x5fca('0x11')](_0x3adb21);return _0x2b3cbd[_0x5fca('0xf')](0x1f4)[_0x5fca('0x10')](_0x3adb21);}logger[_0x5fca('0x12')](_0x5fca('0x13'));return _0x2b3cbd[_0x5fca('0xf')](0xc8)[_0x5fca('0x10')]({'output':_0x5fca('0x14')});});};exports[_0x5fca('0x15')]=function(_0x8821f1,_0x5836d3){return git[_0x5fca('0x15')]([_0x5fca('0x16'),'FETCH_HEAD'],function(_0x4ad2ca){if(_0x4ad2ca){logger[_0x5fca('0x11')](_0x4ad2ca);return _0x5836d3[_0x5fca('0xf')](0x1f4)[_0x5fca('0x10')](_0x4ad2ca);}logger[_0x5fca('0x12')](_0x5fca('0x17'));return _0x5836d3[_0x5fca('0xf')](0xc8)['json']({'output':_0x5fca('0x18')});});};exports[_0x5fca('0x19')]=function(_0x283d56,_0x3f48a4){exec('npm\x20install\x20--production',function(_0x21aed6,_0x4da298,_0x386985){logger[_0x5fca('0x12')](_0x4da298);logger[_0x5fca('0x12')](_0x386985);if(_0x21aed6){logger[_0x5fca('0x11')](_0x21aed6);return _0x3f48a4[_0x5fca('0xf')](0x1f4)[_0x5fca('0x10')](_0x21aed6);}return _0x3f48a4[_0x5fca('0xf')](0xc8)[_0x5fca('0x10')]({'output':_0x4da298});});};exports[_0x5fca('0x1a')]=function(_0x33bc8b,_0x104ad9){return pm2[_0x5fca('0x1a')](_0x5fca('0x1b'))[_0x5fca('0x1c')](function(_0x4d8410){logger[_0x5fca('0x12')](_0x5fca('0x1d'),_0x4d8410);return _0x104ad9[_0x5fca('0xf')](0xc8)['json']({'output':_0x5fca('0x1e')});})[_0x5fca('0x1f')](function(_0x4359b1){logger[_0x5fca('0x11')](_0x4359b1);return _0x104ad9[_0x5fca('0xf')](0x1f4)[_0x5fca('0x10')](_0x4359b1);});};exports['migrations']=function(_0x59ab02,_0xe37800){var _0x19c35b=fs['readdirSync'](path[_0x5fca('0x20')](config[_0x5fca('0x21')],_0x5fca('0x22'),_0x5fca('0x23')));var _0x397d47=[];for(var _0x11accd=0x0;_0x11accd<_0x19c35b[_0x5fca('0x24')];_0x11accd++){var _0x817536=_0x19c35b[_0x11accd][_0x5fca('0x25')]('.js','');if(compareVersions(module[_0x5fca('0xa')][_0x5fca('0x3')],_0x817536)===-0x1){_0x397d47['push'](_0x817536);}}if(_0x397d47[_0x5fca('0x24')]){var _0x5093c9=_0x397d47[_0x5fca('0x26')](compareVersions);var _0x3e0f83=new Umzug({'storage':_0x5fca('0x27'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x5fca('0x3')},'migrations':{'params':[db['sequelize'][_0x5fca('0x28')](),db[_0x5fca('0x27')][_0x5fca('0x29')],function(){throw new Error(_0x5fca('0x2a'));}],'path':path[_0x5fca('0x20')](config[_0x5fca('0x21')],_0x5fca('0x22'),_0x5fca('0x23')),'pattern':/\.js$/}});_0x3e0f83['up']({'migrations':_[_0x5fca('0x2b')](_0x5093c9,function(_0x295e02){return _0x295e02+'.js';})})[_0x5fca('0x1c')](function(){return _0xe37800[_0x5fca('0xf')](0xc8)[_0x5fca('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x5fca('0xa')][_0x5fca('0x3')]+_0x5fca('0x2c')+_[_0x5fca('0x2d')](_0x5093c9),'migrations':_[_0x5fca('0x20')](_0x5093c9)});})['catch'](function(_0x465840){if(_0x465840 instanceof db[_0x5fca('0x27')][_0x5fca('0x2e')]){return _0xe37800['status'](0xc8)[_0x5fca('0x10')]({'output':_0x5fca('0x2f')});}else{return _0xe37800[_0x5fca('0xf')](0x1f4)[_0x5fca('0x10')](_0x465840);}});}else{return _0xe37800[_0x5fca('0xf')](0xc8)[_0x5fca('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index a0dd62b..164d63c 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 _0xe836=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceAgentReport.controller'];(function(_0x107604,_0x3adcb6){var _0x1a8fe8=function(_0x21c6db){while(--_0x21c6db){_0x107604['push'](_0x107604['shift']());}};_0x1a8fe8(++_0x3adcb6);}(_0xe836,0x187));var _0x6e83=function(_0x2b41e3,_0x49c30b){_0x2b41e3=_0x2b41e3-0x0;var _0x36c322=_0xe836[_0x2b41e3];return _0x36c322;};'use strict';var multer=require('multer');var util=require(_0x6e83('0x0'));var path=require(_0x6e83('0x1'));var timeout=require(_0x6e83('0x2'));var express=require(_0x6e83('0x3'));var router=express[_0x6e83('0x4')]();var fs_extra=require(_0x6e83('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6e83('0x6'));var controller=require(_0x6e83('0x7'));router[_0x6e83('0x8')]('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0xa')]);router[_0x6e83('0x8')](_0x6e83('0xb'),auth[_0x6e83('0x9')](),controller[_0x6e83('0xc')]);router['get'](_0x6e83('0xd'),auth[_0x6e83('0x9')](),controller[_0x6e83('0xe')]);router['post']('/',auth[_0x6e83('0x9')](),controller[_0x6e83('0xf')]);router[_0x6e83('0x10')](_0x6e83('0xd'),auth['isAuthenticated'](),controller[_0x6e83('0x11')]);router[_0x6e83('0x12')](_0x6e83('0xd'),auth['isAuthenticated'](),controller[_0x6e83('0x13')]);module[_0x6e83('0x14')]=router; \ No newline at end of file +var _0xd674=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0xf3b0c3,_0x384d23){var _0x447fa8=function(_0x26277c){while(--_0x26277c){_0xf3b0c3['push'](_0xf3b0c3['shift']());}};_0x447fa8(++_0x384d23);}(_0xd674,0x1b2));var _0x4d67=function(_0x4eeb1d,_0xa01958){_0x4eeb1d=_0x4eeb1d-0x0;var _0x1a5375=_0xd674[_0x4eeb1d];return _0x1a5375;};'use strict';var multer=require(_0x4d67('0x0'));var util=require(_0x4d67('0x1'));var path=require('path');var timeout=require(_0x4d67('0x2'));var express=require(_0x4d67('0x3'));var router=express[_0x4d67('0x4')]();var fs_extra=require(_0x4d67('0x5'));var auth=require(_0x4d67('0x6'));var interaction=require(_0x4d67('0x7'));var config=require('../../config/environment');var controller=require(_0x4d67('0x8'));router[_0x4d67('0x9')]('/',auth[_0x4d67('0xa')](),controller[_0x4d67('0xb')]);router['get'](_0x4d67('0xc'),auth[_0x4d67('0xa')](),controller[_0x4d67('0xd')]);router[_0x4d67('0x9')](_0x4d67('0xe'),auth[_0x4d67('0xa')](),controller[_0x4d67('0xf')]);router[_0x4d67('0x10')]('/',auth['isAuthenticated'](),controller[_0x4d67('0x11')]);router[_0x4d67('0x12')](_0x4d67('0xe'),auth[_0x4d67('0xa')](),controller[_0x4d67('0x13')]);router[_0x4d67('0x14')](_0x4d67('0xe'),auth[_0x4d67('0xa')](),controller[_0x4d67('0x15')]);module[_0x4d67('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 328ca74..ce44d97 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 _0x958a=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x958a,0x128));var _0xa958=function(_0x5aea3b,_0x54a69a){_0x5aea3b=_0x5aea3b-0x0;var _0x25a870=_0x958a[_0x5aea3b];return _0x25a870;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa958('0x2')]},'calleridnum':{'type':Sequelize[_0xa958('0x2')]},'calleridname':{'type':Sequelize[_0xa958('0x2')]},'queue':{'type':Sequelize[_0xa958('0x2')]},'interface':{'type':Sequelize[_0xa958('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xa958('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xa958('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xa958('0x3')]},'agentdumpAt':{'type':Sequelize[_0xa958('0x3')]},'holdtime':{'type':Sequelize[_0xa958('0x4')]},'agentcomplete':{'type':Sequelize[_0xa958('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa958('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa958('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa958('0x4')]},'reason':{'type':Sequelize[_0xa958('0x2')]},'lastevent':{'type':Sequelize[_0xa958('0x2')]},'channel':{'type':Sequelize[_0xa958('0x2')]},'channelstate':{'type':Sequelize[_0xa958('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa958('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa958('0x2')]},'connectedlinename':{'type':Sequelize[_0xa958('0x2')]},'language':{'type':Sequelize[_0xa958('0x2')]},'accountcode':{'type':Sequelize[_0xa958('0x2')]},'context':{'type':Sequelize[_0xa958('0x2')]},'exten':{'type':Sequelize[_0xa958('0x2')]},'priority':{'type':Sequelize[_0xa958('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xa958('0x2')]},'destcalleridname':{'type':Sequelize[_0xa958('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa958('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xa958('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xa958('0x2')]},'destuniqueid':{'type':Sequelize[_0xa958('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa958('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xa958('0x2')]},'transfer':{'type':Sequelize[_0xa958('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa958('0x2')],'comment':_0xa958('0x6')},'transferexten':{'type':Sequelize[_0xa958('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xa958('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0bb4=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x5a7309,_0x54f90a){var _0x1d71e5=function(_0x4657c8){while(--_0x4657c8){_0x5a7309['push'](_0x5a7309['shift']());}};_0x1d71e5(++_0x54f90a);}(_0x0bb4,0x77));var _0x40bb=function(_0x3ef94c,_0x584dd6){_0x3ef94c=_0x3ef94c-0x0;var _0x110810=_0x0bb4[_0x3ef94c];return _0x110810;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x40bb('0x2')]},'calleridnum':{'type':Sequelize[_0x40bb('0x2')]},'calleridname':{'type':Sequelize[_0x40bb('0x2')]},'queue':{'type':Sequelize[_0x40bb('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x40bb('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x40bb('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x40bb('0x3')]},'agentdumpAt':{'type':Sequelize[_0x40bb('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x40bb('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x40bb('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x40bb('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x40bb('0x5')]},'reason':{'type':Sequelize[_0x40bb('0x2')]},'lastevent':{'type':Sequelize[_0x40bb('0x2')]},'channel':{'type':Sequelize[_0x40bb('0x2')]},'channelstate':{'type':Sequelize[_0x40bb('0x5')]},'channelstatedesc':{'type':Sequelize[_0x40bb('0x2')]},'connectedlinenum':{'type':Sequelize[_0x40bb('0x2')]},'connectedlinename':{'type':Sequelize[_0x40bb('0x2')]},'language':{'type':Sequelize[_0x40bb('0x2')]},'accountcode':{'type':Sequelize[_0x40bb('0x2')]},'context':{'type':Sequelize[_0x40bb('0x2')]},'exten':{'type':Sequelize[_0x40bb('0x2')]},'priority':{'type':Sequelize[_0x40bb('0x2')]},'destchannel':{'type':Sequelize[_0x40bb('0x2')]},'destchannelstate':{'type':Sequelize[_0x40bb('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x40bb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x40bb('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x40bb('0x2')]},'destlanguage':{'type':Sequelize[_0x40bb('0x2')]},'destaccountcode':{'type':Sequelize[_0x40bb('0x2')]},'destcontext':{'type':Sequelize[_0x40bb('0x2')]},'destexten':{'type':Sequelize[_0x40bb('0x2')]},'destpriority':{'type':Sequelize[_0x40bb('0x2')]},'destuniqueid':{'type':Sequelize[_0x40bb('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x40bb('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x40bb('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x40bb('0x2')],'comment':_0x40bb('0x6')},'transferexten':{'type':Sequelize[_0x40bb('0x2')]},'transferuniqueid':{'type':Sequelize[_0x40bb('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 33b5380..2009d23 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 _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));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 licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index bc822c6..ead9810 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 _0x4f0d=['uniqueid','destuniqueid','bluebird','request-promise','path','../../config/environment','define','VoiceAgentReport'];(function(_0x4ef90a,_0x26cf61){var _0x5fc36b=function(_0x31bd64){while(--_0x31bd64){_0x4ef90a['push'](_0x4ef90a['shift']());}};_0x5fc36b(++_0x26cf61);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x4f0d[_0x3f8282];return _0x50f918;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd4f0('0x0'));var rp=require(_0xd4f0('0x1'));var fs=require('fs');var path=require(_0xd4f0('0x2'));var rimraf=require('rimraf');var config=require(_0xd4f0('0x3'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1809dd,_0x4da370){return _0x1809dd[_0xd4f0('0x4')](_0xd4f0('0x5'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd4f0('0x6'),_0xd4f0('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5785=['moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5785,0x119));var _0x5578=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5785[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var logger=require(_0x5578('0x2'))(_0x5578('0x3'));var moment=require(_0x5578('0x4'));var BPromise=require('bluebird');var rp=require(_0x5578('0x5'));var fs=require('fs');var path=require(_0x5578('0x6'));var rimraf=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var attributes=require(_0x5578('0x9'));module[_0x5578('0xa')]=function(_0x35a1f4,_0x1a9d73){return _0x35a1f4[_0x5578('0xb')](_0x5578('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5578('0xd'),_0x5578('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0a1e897..bb5c75c 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 _0xf5a1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','body','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x261031,_0x330c1b){var _0x43c143=function(_0x3e3b76){while(--_0x3e3b76){_0x261031['push'](_0x261031['shift']());}};_0x43c143(++_0x330c1b);}(_0xf5a1,0xc5));var _0x1f5a=function(_0x274bdb,_0xf24d8b){_0x274bdb=_0x274bdb-0x0;var _0x717ae=_0xf5a1[_0x274bdb];return _0x717ae;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require('moment');var BPromise=require(_0x1f5a('0x2'));var rs=require(_0x1f5a('0x3'));var fs=require('fs');var Redis=require(_0x1f5a('0x4'));var db=require(_0x1f5a('0x5'))['db'];var utils=require(_0x1f5a('0x6'));var logger=require(_0x1f5a('0x7'))(_0x1f5a('0x8'));var config=require(_0x1f5a('0x9'));var jayson=require(_0x1f5a('0xa'));var client=jayson[_0x1f5a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21a248,_0x467184,_0x3f719a){return new BPromise(function(_0x1f163c,_0x28d0fe){return client[_0x1f5a('0xc')](_0x21a248,_0x3f719a)[_0x1f5a('0xd')](function(_0x2bb087){logger[_0x1f5a('0xe')](_0x1f5a('0xf'),_0x467184,_0x1f5a('0x10'));logger[_0x1f5a('0x11')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x467184,_0x1f5a('0x10'),JSON[_0x1f5a('0x12')](_0x2bb087));if(_0x2bb087['error']){if(_0x2bb087[_0x1f5a('0x13')][_0x1f5a('0x14')]===0x1f4){logger[_0x1f5a('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x467184,_0x2bb087[_0x1f5a('0x13')][_0x1f5a('0x15')]);return _0x28d0fe(_0x2bb087[_0x1f5a('0x13')]['message']);}logger[_0x1f5a('0x13')](_0x1f5a('0xf'),_0x467184,_0x2bb087['error'][_0x1f5a('0x15')]);return _0x1f163c(_0x2bb087[_0x1f5a('0x13')]['message']);}else{logger['info'](_0x1f5a('0xf'),_0x467184,_0x1f5a('0x10'));_0x1f163c(_0x2bb087['result'][_0x1f5a('0x15')]);}})[_0x1f5a('0x16')](function(_0xa91848){logger[_0x1f5a('0x13')](_0x1f5a('0xf'),_0x467184,_0xa91848);_0x28d0fe(_0xa91848);});});}exports[_0x1f5a('0x17')]=function(_0x3c7020){var _0x13e324=this;return new Promise(function(_0x50ee52,_0x3ebf08){return db['VoiceAgentReport'][_0x1f5a('0x18')](_0x3c7020['body'],{'raw':_0x3c7020[_0x1f5a('0x19')]?_0x3c7020['options'][_0x1f5a('0x1a')]===undefined?!![]:![]:!![]})[_0x1f5a('0xd')](function(_0x2ba3fd){logger[_0x1f5a('0xe')]('CreateVoiceAgentReport',_0x3c7020);logger['debug'](_0x1f5a('0x17'),_0x3c7020,JSON[_0x1f5a('0x12')](_0x2ba3fd));_0x50ee52(_0x2ba3fd);})[_0x1f5a('0x16')](function(_0x3a2914){logger[_0x1f5a('0x13')](_0x1f5a('0x17'),_0x3a2914[_0x1f5a('0x15')],_0x3c7020);_0x3ebf08(_0x13e324[_0x1f5a('0x13')](0x1f4,_0x3a2914[_0x1f5a('0x15')]));});});};exports[_0x1f5a('0x1b')]=function(_0x5606){var _0x36a779=this;return new Promise(function(_0x203ca3,_0x4367d0){return db[_0x1f5a('0x1c')][_0x1f5a('0x1d')](_0x5606[_0x1f5a('0x1e')],{'raw':_0x5606[_0x1f5a('0x19')]?_0x5606[_0x1f5a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5606[_0x1f5a('0x19')]?_0x5606['options'][_0x1f5a('0x1f')]||null:null,'attributes':_0x5606[_0x1f5a('0x19')]?_0x5606['options'][_0x1f5a('0x20')]||null:null,'limit':_0x5606['options']?_0x5606[_0x1f5a('0x19')][_0x1f5a('0x21')]||null:null})[_0x1f5a('0xd')](function(_0x4d04de){logger['info'](_0x1f5a('0x1b'),_0x5606);logger[_0x1f5a('0x11')](_0x1f5a('0x1b'),_0x5606,JSON['stringify'](_0x4d04de));_0x203ca3(_0x4d04de);})[_0x1f5a('0x16')](function(_0x4cf9a5){logger['error'](_0x1f5a('0x1b'),_0x4cf9a5[_0x1f5a('0x15')],_0x5606);_0x4367d0(_0x36a779[_0x1f5a('0x13')](0x1f4,_0x4cf9a5[_0x1f5a('0x15')]));});});}; \ No newline at end of file +var _0x6eb6=['jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','UpdateVoiceAgentReport','VoiceAgentReport','update','options','raw','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x6eb6,0x8a));var _0x66eb=function(_0x1dec27,_0x7a70b8){_0x1dec27=_0x1dec27-0x0;var _0x3cffca=_0x6eb6[_0x1dec27];return _0x3cffca;};'use strict';var _=require(_0x66eb('0x0'));var util=require(_0x66eb('0x1'));var moment=require(_0x66eb('0x2'));var BPromise=require(_0x66eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66eb('0x4'));var db=require(_0x66eb('0x5'))['db'];var utils=require(_0x66eb('0x6'));var logger=require(_0x66eb('0x7'))(_0x66eb('0x8'));var config=require(_0x66eb('0x9'));var jayson=require(_0x66eb('0xa'));var client=jayson[_0x66eb('0xb')][_0x66eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ec6b6,_0x35c1a3,_0x48f946){return new BPromise(function(_0x453829,_0x9eea1c){return client[_0x66eb('0xd')](_0x2ec6b6,_0x48f946)[_0x66eb('0xe')](function(_0x44d4e5){logger[_0x66eb('0xf')](_0x66eb('0x10'),_0x35c1a3,_0x66eb('0x11'));logger[_0x66eb('0x12')](_0x66eb('0x13'),_0x35c1a3,_0x66eb('0x11'),JSON[_0x66eb('0x14')](_0x44d4e5));if(_0x44d4e5['error']){if(_0x44d4e5[_0x66eb('0x15')][_0x66eb('0x16')]===0x1f4){logger[_0x66eb('0x15')](_0x66eb('0x10'),_0x35c1a3,_0x44d4e5[_0x66eb('0x15')]['message']);return _0x9eea1c(_0x44d4e5[_0x66eb('0x15')]['message']);}logger[_0x66eb('0x15')](_0x66eb('0x10'),_0x35c1a3,_0x44d4e5[_0x66eb('0x15')][_0x66eb('0x17')]);return _0x453829(_0x44d4e5['error']['message']);}else{logger[_0x66eb('0xf')](_0x66eb('0x10'),_0x35c1a3,_0x66eb('0x11'));_0x453829(_0x44d4e5[_0x66eb('0x18')][_0x66eb('0x17')]);}})[_0x66eb('0x19')](function(_0x4f4a98){logger[_0x66eb('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x35c1a3,_0x4f4a98);_0x9eea1c(_0x4f4a98);});});}exports[_0x66eb('0x1a')]=function(_0x4951df){var _0x78d6be=this;return new Promise(function(_0x11f84f,_0x283b89){return db['VoiceAgentReport'][_0x66eb('0x1b')](_0x4951df[_0x66eb('0x1c')],{'raw':_0x4951df['options']?_0x4951df['options']['raw']===undefined?!![]:![]:!![]})[_0x66eb('0xe')](function(_0x6f0581){logger[_0x66eb('0xf')](_0x66eb('0x1a'),_0x4951df);logger[_0x66eb('0x12')](_0x66eb('0x1a'),_0x4951df,JSON['stringify'](_0x6f0581));_0x11f84f(_0x6f0581);})[_0x66eb('0x19')](function(_0xa08eb7){logger[_0x66eb('0x15')]('CreateVoiceAgentReport',_0xa08eb7['message'],_0x4951df);_0x283b89(_0x78d6be[_0x66eb('0x15')](0x1f4,_0xa08eb7[_0x66eb('0x17')]));});});};exports[_0x66eb('0x1d')]=function(_0x184fda){var _0x34c5a8=this;return new Promise(function(_0x236913,_0x391c2b){return db[_0x66eb('0x1e')][_0x66eb('0x1f')](_0x184fda[_0x66eb('0x1c')],{'raw':_0x184fda[_0x66eb('0x20')]?_0x184fda[_0x66eb('0x20')][_0x66eb('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184fda[_0x66eb('0x20')]?_0x184fda[_0x66eb('0x20')][_0x66eb('0x22')]||null:null,'attributes':_0x184fda['options']?_0x184fda[_0x66eb('0x20')][_0x66eb('0x23')]||null:null,'limit':_0x184fda[_0x66eb('0x20')]?_0x184fda['options'][_0x66eb('0x24')]||null:null})[_0x66eb('0xe')](function(_0x14b84e){logger[_0x66eb('0xf')]('UpdateVoiceAgentReport',_0x184fda);logger[_0x66eb('0x12')]('UpdateVoiceAgentReport',_0x184fda,JSON['stringify'](_0x14b84e));_0x236913(_0x14b84e);})['catch'](function(_0x95b321){logger[_0x66eb('0x15')]('UpdateVoiceAgentReport',_0x95b321[_0x66eb('0x17')],_0x184fda);_0x391c2b(_0x34c5a8[_0x66eb('0x15')](0x1f4,_0x95b321[_0x66eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 66e3387..ba97118 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 _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0xae24,0x182));var _0x4ae2=function(_0x5be195,_0x4cc610){_0x5be195=_0x5be195-0x0;var _0x3972b4=_0xae24[_0x5be195];return _0x3972b4;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router; \ No newline at end of file +var _0xa41a=['/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','describe'];(function(_0x2df568,_0x593b5c){var _0x3083c0=function(_0x3d51c1){while(--_0x3d51c1){_0x2df568['push'](_0x2df568['shift']());}};_0x3083c0(++_0x593b5c);}(_0xa41a,0x6b));var _0xaa41=function(_0x28306d,_0x90e5cb){_0x28306d=_0x28306d-0x0;var _0x2c8e39=_0xa41a[_0x28306d];return _0x2c8e39;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/describe',auth[_0xaa41('0xa')](),controller[_0xaa41('0xc')]);router['get'](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xf')]('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);router[_0xaa41('0x11')](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller['update']);router[_0xaa41('0x12')](_0xaa41('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa41('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 1bd2d38..343b8c4 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 _0x082b=['DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound','outbound-fax','dialer'];(function(_0x48aa2f,_0x4c432b){var _0x2195db=function(_0x13ad55){while(--_0x13ad55){_0x48aa2f['push'](_0x48aa2f['shift']());}};_0x2195db(++_0x4c432b);}(_0x082b,0x1ec));var _0xb082=function(_0x7f89b0,_0xb15ba0){_0x7f89b0=_0x7f89b0-0x0;var _0x4c45b9=_0x082b[_0x7f89b0];return _0x4c45b9;};'use strict';var Sequelize=require(_0xb082('0x0'));module[_0xb082('0x1')]={'uniqueid':{'type':Sequelize[_0xb082('0x2')]},'type':{'type':Sequelize[_0xb082('0x3')]('inbound',_0xb082('0x4'),_0xb082('0x5'),'inbound-fax',_0xb082('0x6'),_0xb082('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb082('0x2')]},'source':{'type':Sequelize[_0xb082('0x2')]},'destination':{'type':Sequelize[_0xb082('0x2')]},'destinationcontext':{'type':Sequelize[_0xb082('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb082('0x2')]},'destinationchannel':{'type':Sequelize[_0xb082('0x2')]},'lastapplication':{'type':Sequelize[_0xb082('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xb082('0x8')]},'systemanswertime':{'type':Sequelize[_0xb082('0x8')]},'answertime':{'type':Sequelize[_0xb082('0x8')]},'endtime':{'type':Sequelize[_0xb082('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xb082('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb082('0x2')]},'amaflags':{'type':Sequelize[_0xb082('0x2')]},'userfield':{'type':Sequelize[_0xb082('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xb082('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb082('0x2')]},'note':{'type':Sequelize[_0xb082('0x2')]},'prefix':{'type':Sequelize[_0xb082('0x2')]},'routeid':{'type':Sequelize[_0xb082('0x9')]},'sipcallid':{'type':Sequelize[_0xb082('0x2')]}}; \ No newline at end of file +var _0x7ace=['STRING','ENUM','inbound','internal','outbound','DATE','INTEGER','sequelize','exports'];(function(_0x232829,_0x2223d9){var _0x1995ca=function(_0x2d0eaa){while(--_0x2d0eaa){_0x232829['push'](_0x232829['shift']());}};_0x1995ca(++_0x2223d9);}(_0x7ace,0xd6));var _0xe7ac=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7ace[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xe7ac('0x0'));module[_0xe7ac('0x1')]={'uniqueid':{'type':Sequelize[_0xe7ac('0x2')]},'type':{'type':Sequelize[_0xe7ac('0x3')](_0xe7ac('0x4'),_0xe7ac('0x5'),_0xe7ac('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xe7ac('0x2')]},'accountcode':{'type':Sequelize[_0xe7ac('0x2')]},'source':{'type':Sequelize[_0xe7ac('0x2')]},'destination':{'type':Sequelize[_0xe7ac('0x2')]},'destinationcontext':{'type':Sequelize[_0xe7ac('0x2')]},'callerid':{'type':Sequelize[_0xe7ac('0x2')]},'channel':{'type':Sequelize[_0xe7ac('0x2')]},'destinationchannel':{'type':Sequelize[_0xe7ac('0x2')]},'lastapplication':{'type':Sequelize[_0xe7ac('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xe7ac('0x7')]},'systemanswertime':{'type':Sequelize[_0xe7ac('0x7')]},'answertime':{'type':Sequelize[_0xe7ac('0x7')]},'endtime':{'type':Sequelize[_0xe7ac('0x7')]},'duration':{'type':Sequelize[_0xe7ac('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe7ac('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xe7ac('0x2')]},'userfield':{'type':Sequelize[_0xe7ac('0x2')]},'userDisposition':{'type':Sequelize[_0xe7ac('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe7ac('0x2')]},'note':{'type':Sequelize[_0xe7ac('0x2')]},'prefix':{'type':Sequelize[_0xe7ac('0x2')]},'routeid':{'type':Sequelize[_0xe7ac('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 7ac1df5..453256e 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x43de81,_0xae3ab3){var _0x585f8c=function(_0x2cbdc0){while(--_0x2cbdc0){_0x43de81['push'](_0x43de81['shift']());}};_0x585f8c(++_0xae3ab3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0x0b0e[_0x2aa48b];return _0x48caf8;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x43debf,_0x52dd5a){var _0x44832b=function(_0x386c36){while(--_0x386c36){_0x43debf['push'](_0x43debf['shift']());}};_0x44832b(++_0x52dd5a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44caf4,_0x238750){_0x44caf4=_0x44caf4-0x0;var _0x117cad=_0x0b0e[_0x44caf4];return _0x117cad;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 309436f..9970196 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 _0x9f2d=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','moment','bluebird'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x9f2d,0x1d1));var _0xd9f2=function(_0x1073e2,_0x21f6d9){_0x1073e2=_0x1073e2-0x0;var _0x1b1afd=_0x9f2d[_0x1073e2];return _0x1b1afd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9f2('0x0'))('api');var moment=require(_0xd9f2('0x1'));var BPromise=require(_0xd9f2('0x2'));var rp=require(_0xd9f2('0x3'));var fs=require('fs');var path=require(_0xd9f2('0x4'));var rimraf=require(_0xd9f2('0x5'));var config=require(_0xd9f2('0x6'));var attributes=require(_0xd9f2('0x7'));module[_0xd9f2('0x8')]=function(_0x1b4c30,_0x24abd3){return _0x1b4c30[_0xd9f2('0x9')](_0xd9f2('0xa'),attributes,{'tableName':_0xd9f2('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd9f2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x996b=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash'];(function(_0x4cd874,_0x573fe5){var _0x501388=function(_0x5dd62b){while(--_0x5dd62b){_0x4cd874['push'](_0x4cd874['shift']());}};_0x501388(++_0x573fe5);}(_0x996b,0x9b));var _0xb996=function(_0x47a72c,_0xa44e5){_0x47a72c=_0x47a72c-0x0;var _0x1347f6=_0x996b[_0x47a72c];return _0x1347f6;};'use strict';var _=require(_0xb996('0x0'));var util=require(_0xb996('0x1'));var logger=require(_0xb996('0x2'))(_0xb996('0x3'));var moment=require(_0xb996('0x4'));var BPromise=require(_0xb996('0x5'));var rp=require(_0xb996('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb996('0x7'));var attributes=require(_0xb996('0x8'));module[_0xb996('0x9')]=function(_0x26fc01,_0x4552da){return _0x26fc01[_0xb996('0xa')](_0xb996('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xb996('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 42a53c4..5161f31 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 _0x5b7b=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','include','map','model','info','debug','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','limit','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x57f4de,_0x57c7ae){var _0x1edd7b=function(_0x249c96){while(--_0x249c96){_0x57f4de['push'](_0x57f4de['shift']());}};_0x1edd7b(++_0x57c7ae);}(_0x5b7b,0xe5));var _0xb5b7=function(_0x5d0f97,_0x25009f){_0x5d0f97=_0x5d0f97-0x0;var _0xc7236=_0x5b7b[_0x5d0f97];return _0xc7236;};'use strict';var _=require(_0xb5b7('0x0'));var util=require(_0xb5b7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5b7('0x2'));var fs=require('fs');var Redis=require(_0xb5b7('0x3'));var db=require(_0xb5b7('0x4'))['db'];var utils=require(_0xb5b7('0x5'));var logger=require(_0xb5b7('0x6'))(_0xb5b7('0x7'));var config=require(_0xb5b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5b7('0x9')][_0xb5b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f4396,_0x5d0d95,_0x42b48e){return new BPromise(function(_0x177517,_0x2d6285){return client[_0xb5b7('0xb')](_0x3f4396,_0x42b48e)[_0xb5b7('0xc')](function(_0x195477){logger['info'](_0xb5b7('0xd'),_0x5d0d95,_0xb5b7('0xe'));logger['debug'](_0xb5b7('0xf'),_0x5d0d95,'request\x20sent',JSON[_0xb5b7('0x10')](_0x195477));if(_0x195477[_0xb5b7('0x11')]){if(_0x195477[_0xb5b7('0x11')][_0xb5b7('0x12')]===0x1f4){logger['error'](_0xb5b7('0xd'),_0x5d0d95,_0x195477[_0xb5b7('0x11')][_0xb5b7('0x13')]);return _0x2d6285(_0x195477[_0xb5b7('0x11')]['message']);}logger[_0xb5b7('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5d0d95,_0x195477[_0xb5b7('0x11')][_0xb5b7('0x13')]);return _0x177517(_0x195477[_0xb5b7('0x11')][_0xb5b7('0x13')]);}else{logger['info'](_0xb5b7('0xd'),_0x5d0d95,_0xb5b7('0xe'));_0x177517(_0x195477['result']['message']);}})['catch'](function(_0x42d28f){logger[_0xb5b7('0x11')](_0xb5b7('0xd'),_0x5d0d95,_0x42d28f);_0x2d6285(_0x42d28f);});});}exports[_0xb5b7('0x14')]=function(_0x2a8a82){var _0x175222=this;return new Promise(function(_0xcbe237,_0x118679){return db[_0xb5b7('0x15')][_0xb5b7('0x16')]({'raw':_0x2a8a82[_0xb5b7('0x17')]?_0x2a8a82[_0xb5b7('0x17')][_0xb5b7('0x18')]===undefined?!![]:![]:!![],'where':_0x2a8a82['options']?_0x2a8a82[_0xb5b7('0x17')]['where']||null:null,'attributes':_0x2a8a82[_0xb5b7('0x17')]?_0x2a8a82[_0xb5b7('0x17')][_0xb5b7('0x19')]||null:null,'limit':_0x2a8a82[_0xb5b7('0x17')]?_0x2a8a82[_0xb5b7('0x17')]['limit']||null:null,'include':_0x2a8a82['options']?_0x2a8a82[_0xb5b7('0x17')][_0xb5b7('0x1a')]?_[_0xb5b7('0x1b')](_0x2a8a82[_0xb5b7('0x17')]['include'],function(_0x5bf2d2){return{'model':db[_0x5bf2d2[_0xb5b7('0x1c')]],'as':_0x5bf2d2['as'],'attributes':_0x5bf2d2['attributes'],'include':_0x5bf2d2[_0xb5b7('0x1a')]?_[_0xb5b7('0x1b')](_0x5bf2d2[_0xb5b7('0x1a')],function(_0x461d40){return{'model':db[_0x461d40['model']],'as':_0x461d40['as'],'attributes':_0x461d40[_0xb5b7('0x19')],'include':_0x461d40[_0xb5b7('0x1a')]?_[_0xb5b7('0x1b')](_0x461d40[_0xb5b7('0x1a')],function(_0x2d97be){return{'model':db[_0x2d97be[_0xb5b7('0x1c')]],'as':_0x2d97be['as'],'attributes':_0x2d97be[_0xb5b7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb5b7('0xc')](function(_0x149d14){logger[_0xb5b7('0x1d')]('GetVoiceCallReport',_0x2a8a82);logger[_0xb5b7('0x1e')]('GetVoiceCallReport',_0x2a8a82,JSON[_0xb5b7('0x10')](_0x149d14));_0xcbe237(_0x149d14);})[_0xb5b7('0x1f')](function(_0x43ce78){logger['error'](_0xb5b7('0x14'),_0x43ce78[_0xb5b7('0x13')],_0x2a8a82);_0x118679(_0x175222[_0xb5b7('0x11')](0x1f4,_0x43ce78[_0xb5b7('0x13')]));});});};exports[_0xb5b7('0x20')]=function(_0x346313){var _0x29fa3a=this;return new Promise(function(_0x4e7d1e,_0x417416){return db[_0xb5b7('0x15')][_0xb5b7('0x21')](_0x346313[_0xb5b7('0x22')],{'raw':_0x346313[_0xb5b7('0x17')]?_0x346313[_0xb5b7('0x17')][_0xb5b7('0x18')]===undefined?!![]:![]:!![]})[_0xb5b7('0xc')](function(_0xdc6e76){logger[_0xb5b7('0x1d')](_0xb5b7('0x20'),_0x346313);logger[_0xb5b7('0x1e')](_0xb5b7('0x20'),_0x346313,JSON[_0xb5b7('0x10')](_0xdc6e76));_0x4e7d1e(_0xdc6e76);})[_0xb5b7('0x1f')](function(_0x2519ad){logger['error'](_0xb5b7('0x20'),_0x2519ad[_0xb5b7('0x13')],_0x346313);_0x417416(_0x29fa3a[_0xb5b7('0x11')](0x1f4,_0x2519ad[_0xb5b7('0x13')]));});});};exports[_0xb5b7('0x23')]=function(_0x2cde79){var _0x3147fa=this;return new Promise(function(_0x3cd8c7,_0x32e030){return db[_0xb5b7('0x15')][_0xb5b7('0x24')](_0x2cde79[_0xb5b7('0x22')],{'raw':_0x2cde79[_0xb5b7('0x17')]?_0x2cde79[_0xb5b7('0x17')][_0xb5b7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cde79[_0xb5b7('0x17')]?_0x2cde79[_0xb5b7('0x17')][_0xb5b7('0x25')]||null:null,'attributes':_0x2cde79[_0xb5b7('0x17')]?_0x2cde79[_0xb5b7('0x17')][_0xb5b7('0x19')]||null:null,'limit':_0x2cde79[_0xb5b7('0x17')]?_0x2cde79['options'][_0xb5b7('0x26')]||null:null})[_0xb5b7('0xc')](function(_0x4b759e){logger['info']('UpdateVoiceCallReport',_0x2cde79);logger[_0xb5b7('0x1e')](_0xb5b7('0x23'),_0x2cde79,JSON[_0xb5b7('0x10')](_0x4b759e));_0x3cd8c7(_0x4b759e);})[_0xb5b7('0x1f')](function(_0x36e369){logger[_0xb5b7('0x11')](_0xb5b7('0x23'),_0x36e369['message'],_0x2cde79);_0x32e030(_0x3147fa[_0xb5b7('0x11')](0x1f4,_0x36e369[_0xb5b7('0x13')]));});});}; \ No newline at end of file +var _0x4fa2=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','catch','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4eae8c,_0x5cee60){var _0x5a2973=function(_0x25c19e){while(--_0x25c19e){_0x4eae8c['push'](_0x4eae8c['shift']());}};_0x5a2973(++_0x5cee60);}(_0x4fa2,0xac));var _0x24fa=function(_0x564dff,_0x32bdc5){_0x564dff=_0x564dff-0x0;var _0x283988=_0x4fa2[_0x564dff];return _0x283988;};'use strict';var _=require(_0x24fa('0x0'));var util=require(_0x24fa('0x1'));var moment=require(_0x24fa('0x2'));var BPromise=require(_0x24fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x24fa('0x4'));var logger=require('../../config/logger')(_0x24fa('0x5'));var config=require(_0x24fa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x24fa('0x7')][_0x24fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ae7b8,_0x10461e,_0x1460ba){return new BPromise(function(_0x340d34,_0x32c29e){return client[_0x24fa('0x9')](_0x4ae7b8,_0x1460ba)[_0x24fa('0xa')](function(_0x4b63d2){logger['info'](_0x24fa('0xb'),_0x10461e,_0x24fa('0xc'));logger[_0x24fa('0xd')](_0x24fa('0xe'),_0x10461e,'request\x20sent',JSON[_0x24fa('0xf')](_0x4b63d2));if(_0x4b63d2[_0x24fa('0x10')]){if(_0x4b63d2[_0x24fa('0x10')][_0x24fa('0x11')]===0x1f4){logger[_0x24fa('0x10')](_0x24fa('0xb'),_0x10461e,_0x4b63d2[_0x24fa('0x10')][_0x24fa('0x12')]);return _0x32c29e(_0x4b63d2[_0x24fa('0x10')][_0x24fa('0x12')]);}logger[_0x24fa('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x10461e,_0x4b63d2[_0x24fa('0x10')][_0x24fa('0x12')]);return _0x340d34(_0x4b63d2[_0x24fa('0x10')][_0x24fa('0x12')]);}else{logger[_0x24fa('0x13')](_0x24fa('0xb'),_0x10461e,_0x24fa('0xc'));_0x340d34(_0x4b63d2[_0x24fa('0x14')][_0x24fa('0x12')]);}})['catch'](function(_0x5913d3){logger[_0x24fa('0x10')](_0x24fa('0xb'),_0x10461e,_0x5913d3);_0x32c29e(_0x5913d3);});});}exports['GetVoiceCallReport']=function(_0x20e18d){var _0x5d1cd8=this;return new Promise(function(_0x1bf206,_0x4d2354){return db[_0x24fa('0x15')][_0x24fa('0x16')]({'raw':_0x20e18d[_0x24fa('0x17')]?_0x20e18d['options'][_0x24fa('0x18')]===undefined?!![]:![]:!![],'where':_0x20e18d['options']?_0x20e18d['options'][_0x24fa('0x19')]||null:null,'attributes':_0x20e18d['options']?_0x20e18d[_0x24fa('0x17')][_0x24fa('0x1a')]||null:null,'limit':_0x20e18d[_0x24fa('0x17')]?_0x20e18d[_0x24fa('0x17')][_0x24fa('0x1b')]||null:null,'include':_0x20e18d[_0x24fa('0x17')]?_0x20e18d[_0x24fa('0x17')][_0x24fa('0x1c')]?_[_0x24fa('0x1d')](_0x20e18d[_0x24fa('0x17')][_0x24fa('0x1c')],function(_0x2b1cfe){return{'model':db[_0x2b1cfe['model']],'as':_0x2b1cfe['as'],'attributes':_0x2b1cfe['attributes'],'include':_0x2b1cfe['include']?_['map'](_0x2b1cfe[_0x24fa('0x1c')],function(_0x43daca){return{'model':db[_0x43daca[_0x24fa('0x1e')]],'as':_0x43daca['as'],'attributes':_0x43daca['attributes'],'include':_0x43daca['include']?_[_0x24fa('0x1d')](_0x43daca[_0x24fa('0x1c')],function(_0x1df64c){return{'model':db[_0x1df64c['model']],'as':_0x1df64c['as'],'attributes':_0x1df64c[_0x24fa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x24fa('0xa')](function(_0x43552f){logger[_0x24fa('0x13')](_0x24fa('0x1f'),_0x20e18d);logger[_0x24fa('0xd')]('GetVoiceCallReport',_0x20e18d,JSON[_0x24fa('0xf')](_0x43552f));_0x1bf206(_0x43552f);})['catch'](function(_0x44bf0b){logger[_0x24fa('0x10')](_0x24fa('0x1f'),_0x44bf0b[_0x24fa('0x12')],_0x20e18d);_0x4d2354(_0x5d1cd8['error'](0x1f4,_0x44bf0b[_0x24fa('0x12')]));});});};exports[_0x24fa('0x20')]=function(_0x1c677c){var _0x53c075=this;return new Promise(function(_0x23e986,_0x452b66){return db[_0x24fa('0x15')][_0x24fa('0x21')](_0x1c677c['body'],{'raw':_0x1c677c['options']?_0x1c677c['options'][_0x24fa('0x18')]===undefined?!![]:![]:!![]})[_0x24fa('0xa')](function(_0x228926){logger[_0x24fa('0x13')](_0x24fa('0x20'),_0x1c677c);logger[_0x24fa('0xd')](_0x24fa('0x20'),_0x1c677c,JSON[_0x24fa('0xf')](_0x228926));_0x23e986(_0x228926);})[_0x24fa('0x22')](function(_0x2e6849){logger[_0x24fa('0x10')]('CreateVoiceCallReport',_0x2e6849['message'],_0x1c677c);_0x452b66(_0x53c075[_0x24fa('0x10')](0x1f4,_0x2e6849[_0x24fa('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x5e5d66){var _0x4adffd=this;return new Promise(function(_0x5a79eb,_0x2e1252){return db['VoiceCallReport']['update'](_0x5e5d66[_0x24fa('0x23')],{'raw':_0x5e5d66[_0x24fa('0x17')]?_0x5e5d66['options'][_0x24fa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5d66[_0x24fa('0x17')]?_0x5e5d66[_0x24fa('0x17')][_0x24fa('0x19')]||null:null,'attributes':_0x5e5d66[_0x24fa('0x17')]?_0x5e5d66[_0x24fa('0x17')][_0x24fa('0x1a')]||null:null,'limit':_0x5e5d66[_0x24fa('0x17')]?_0x5e5d66[_0x24fa('0x17')][_0x24fa('0x1b')]||null:null})[_0x24fa('0xa')](function(_0x197f56){logger['info'](_0x24fa('0x24'),_0x5e5d66);logger[_0x24fa('0xd')]('UpdateVoiceCallReport',_0x5e5d66,JSON['stringify'](_0x197f56));_0x5a79eb(_0x197f56);})['catch'](function(_0x4e1bcb){logger[_0x24fa('0x10')](_0x24fa('0x24'),_0x4e1bcb[_0x24fa('0x12')],_0x5e5d66);_0x2e1252(_0x4adffd[_0x24fa('0x10')](0x1f4,_0x4e1bcb['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f431e86..6e22171 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 _0xac92=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','update'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xac92,0x192));var _0x2ac9=function(_0x5de859,_0x3fbfe7){_0x5de859=_0x5de859-0x0;var _0x50e029=_0xac92[_0x5de859];return _0x50e029;};'use strict';var multer=require(_0x2ac9('0x0'));var util=require('util');var path=require(_0x2ac9('0x1'));var timeout=require(_0x2ac9('0x2'));var express=require(_0x2ac9('0x3'));var router=express[_0x2ac9('0x4')]();var fs_extra=require(_0x2ac9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2ac9('0x6'));var config=require(_0x2ac9('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x2ac9('0x8')]('/',auth['isAuthenticated'](),controller[_0x2ac9('0x9')]);router[_0x2ac9('0x8')](_0x2ac9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2ac9('0xb')]('/',auth[_0x2ac9('0xc')](),controller[_0x2ac9('0xd')]);router[_0x2ac9('0xe')](_0x2ac9('0xa'),auth[_0x2ac9('0xc')](),controller[_0x2ac9('0xf')]);router[_0x2ac9('0x10')](_0x2ac9('0xa'),auth[_0x2ac9('0xc')](),controller[_0x2ac9('0x11')]);module[_0x2ac9('0x12')]=router; \ No newline at end of file +var _0xf291=['show','post','create','update','destroy','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x59429b,_0x1af82a){var _0x3e8f60=function(_0x2d54e3){while(--_0x2d54e3){_0x59429b['push'](_0x59429b['shift']());}};_0x3e8f60(++_0x1af82a);}(_0xf291,0x195));var _0x1f29=function(_0x58993c,_0x974662){_0x58993c=_0x58993c-0x0;var _0x50b69a=_0xf291[_0x58993c];return _0x50b69a;};'use strict';var multer=require('multer');var util=require(_0x1f29('0x0'));var path=require(_0x1f29('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f29('0x2'));var router=express['Router']();var fs_extra=require(_0x1f29('0x3'));var auth=require(_0x1f29('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f29('0x5'));var controller=require(_0x1f29('0x6'));router[_0x1f29('0x7')]('/',auth[_0x1f29('0x8')](),controller[_0x1f29('0x9')]);router[_0x1f29('0x7')](_0x1f29('0xa'),auth[_0x1f29('0x8')](),controller[_0x1f29('0xb')]);router[_0x1f29('0xc')]('/',auth['isAuthenticated'](),controller[_0x1f29('0xd')]);router['put'](_0x1f29('0xa'),auth['isAuthenticated'](),controller[_0x1f29('0xe')]);router['delete'](_0x1f29('0xa'),auth[_0x1f29('0x8')](),controller[_0x1f29('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 772ff91..98f9f4c 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 _0x3431=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x24d303,_0xdb1fc9){var _0x121787=function(_0x5dbc66){while(--_0x5dbc66){_0x24d303['push'](_0x24d303['shift']());}};_0x121787(++_0xdb1fc9);}(_0x3431,0x7f));var _0x1343=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x3431[_0x421c56];return _0x49b244;};'use strict';var Sequelize=require(_0x1343('0x0'));module[_0x1343('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x1343('0x2')],'unique':_0x1343('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x1343('0x2')],'set':function(_0x23de52){this[_0x1343('0x4')](_0x1343('0x5'),_0x23de52?_0x23de52[_0x1343('0x6')](''):[]);},'get':function(){return this[_0x1343('0x7')](_0x1343('0x5'))?this[_0x1343('0x7')](_0x1343('0x5'))[_0x1343('0x8')](''):[];}},'auth':{'type':Sequelize[_0x1343('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x1343('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1343('0x2')]}}; \ No newline at end of file +var _0x48b1=['BOOLEAN','STRING','name','setDataValue','options','join','split'];(function(_0xb62d3,_0x5a007a){var _0x1c5d67=function(_0x5cc911){while(--_0x5cc911){_0xb62d3['push'](_0xb62d3['shift']());}};_0x1c5d67(++_0x5a007a);}(_0x48b1,0x120));var _0x148b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48b1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x148b('0x0')],'unique':_0x148b('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x148b('0x0')],'set':function(_0x3cf67c){this[_0x148b('0x2')](_0x148b('0x3'),_0x3cf67c?_0x3cf67c[_0x148b('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x148b('0x3'))?this['getDataValue'](_0x148b('0x3'))[_0x148b('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x148b('0x0')]},'record':{'type':Sequelize[_0x148b('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x148b('0x0')]},'description':{'type':Sequelize[_0x148b('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1b7c387..52ea901 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 _0xee11=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','map','VoiceChanSpy','rawAttributes','key','keys','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','body','eml-format','fast-json-patch'];(function(_0x2d83d8,_0x2ea119){var _0x31ccdd=function(_0x4e2a9e){while(--_0x4e2a9e){_0x2d83d8['push'](_0x2d83d8['shift']());}};_0x31ccdd(++_0x2ea119);}(_0xee11,0x146));var _0x1ee1=function(_0x308944,_0x1c462e){_0x308944=_0x308944-0x0;var _0x2bf805=_0xee11[_0x308944];return _0x2bf805;};'use strict';var emlformat=require(_0x1ee1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ee1('0x1'));var rp=require(_0x1ee1('0x2'));var moment=require(_0x1ee1('0x3'));var BPromise=require(_0x1ee1('0x4'));var Mustache=require(_0x1ee1('0x5'));var util=require(_0x1ee1('0x6'));var path=require(_0x1ee1('0x7'));var sox=require(_0x1ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x1ee1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ee1('0xa'));var _=require(_0x1ee1('0xb'));var squel=require(_0x1ee1('0xc'));var crypto=require(_0x1ee1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ee1('0xe'));var querystring=require(_0x1ee1('0xf'));var Papa=require(_0x1ee1('0x10'));var Redis=require(_0x1ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ee1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ee1('0x13'));var logger=require(_0x1ee1('0x14'))(_0x1ee1('0x15'));var utils=require(_0x1ee1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1ee1('0x17'));var db=require(_0x1ee1('0x18'))['db'];function respondWithStatusCode(_0x51268c,_0x35d97c){_0x35d97c=_0x35d97c||0xcc;return function(_0xc2b64e){if(_0xc2b64e){return _0x51268c[_0x1ee1('0x19')](_0x35d97c);}return _0x51268c[_0x1ee1('0x1a')](_0x35d97c)[_0x1ee1('0x1b')]();};}function respondWithResult(_0x272cab,_0x1a23e4){_0x1a23e4=_0x1a23e4||0xc8;return function(_0xbc8577){if(_0xbc8577){return _0x272cab[_0x1ee1('0x1a')](_0x1a23e4)[_0x1ee1('0x1c')](_0xbc8577);}};}function respondWithFilteredResult(_0x2bc943,_0x443dff){return function(_0x3c64f1){if(_0x3c64f1){var _0x3a19db=typeof _0x443dff['offset']==='undefined'&&typeof _0x443dff[_0x1ee1('0x1d')]===_0x1ee1('0x1e');var _0x52aaab=_0x3c64f1[_0x1ee1('0x1f')];var _0x1e18b9=_0x3a19db?0x0:_0x443dff[_0x1ee1('0x20')];var _0x55abff=_0x3a19db?_0x3c64f1[_0x1ee1('0x1f')]:_0x443dff[_0x1ee1('0x20')]+_0x443dff['limit'];var _0x1e2073;if(_0x55abff>=_0x52aaab){_0x55abff=_0x52aaab;_0x1e2073=0xc8;}else{_0x1e2073=0xce;}_0x2bc943[_0x1ee1('0x1a')](_0x1e2073);return _0x2bc943['set']('Content-Range',_0x1e18b9+'-'+_0x55abff+'/'+_0x52aaab)[_0x1ee1('0x1c')](_0x3c64f1);}return null;};}function patchUpdates(_0x1b6cdf){return function(_0x6f623){try{jsonpatch[_0x1ee1('0x21')](_0x6f623,_0x1b6cdf,!![]);}catch(_0x47eb1a){return BPromise[_0x1ee1('0x22')](_0x47eb1a);}return _0x6f623[_0x1ee1('0x23')]();};}function saveUpdates(_0x482d0,_0x5093ff){return function(_0x1a27c4){if(_0x1a27c4){return _0x1a27c4[_0x1ee1('0x24')](_0x482d0)[_0x1ee1('0x25')](function(_0x307672){return _0x307672;});}return null;};}function removeEntity(_0x21073e,_0x353542){return function(_0x55921f){if(_0x55921f){return _0x55921f[_0x1ee1('0x26')]()['then'](function(){var _0x4932cd=_0x55921f[_0x1ee1('0x27')]({'plain':!![]});var _0x306aac='ChanSpies';return db[_0x1ee1('0x28')][_0x1ee1('0x26')]({'where':{'type':_0x306aac,'resourceId':_0x4932cd['id']}})[_0x1ee1('0x25')](function(){return _0x55921f;});})[_0x1ee1('0x25')](function(){_0x21073e[_0x1ee1('0x1a')](0xcc)[_0x1ee1('0x1b')]();});}};}function handleEntityNotFound(_0x56a1e3,_0x14f388){return function(_0x8a95d8){if(!_0x8a95d8){_0x56a1e3[_0x1ee1('0x19')](0x194);}return _0x8a95d8;};}function handleError(_0x11ce8d,_0x3d0ffc){_0x3d0ffc=_0x3d0ffc||0x1f4;return function(_0x1a2246){logger['error'](_0x1a2246[_0x1ee1('0x29')]);if(_0x1a2246['name']){delete _0x1a2246[_0x1ee1('0x2a')];}_0x11ce8d[_0x1ee1('0x1a')](_0x3d0ffc)['send'](_0x1a2246);};}exports['index']=function(_0x444ed9,_0xfd544d){var _0xf63d67={},_0x209592={},_0x49241e={'count':0x0,'rows':[]};var _0x4b9ea4=_[_0x1ee1('0x2b')](db[_0x1ee1('0x2c')][_0x1ee1('0x2d')],function(_0x3153b6){return{'name':_0x3153b6['fieldName'],'type':_0x3153b6['type'][_0x1ee1('0x2e')]};});_0x209592['model']=_[_0x1ee1('0x2b')](_0x4b9ea4,_0x1ee1('0x2a'));_0x209592['query']=_[_0x1ee1('0x2f')](_0x444ed9['query']);_0x209592[_0x1ee1('0x30')]=_['intersection'](_0x209592[_0x1ee1('0x31')],_0x209592['query']);_0xf63d67[_0x1ee1('0x32')]=_[_0x1ee1('0x33')](_0x209592['model'],qs[_0x1ee1('0x34')](_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x34')]));_0xf63d67['attributes']=_0xf63d67[_0x1ee1('0x32')][_0x1ee1('0x36')]?_0xf63d67[_0x1ee1('0x32')]:_0x209592[_0x1ee1('0x31')];if(!_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x37')](_0x1ee1('0x38'))){_0xf63d67[_0x1ee1('0x1d')]=qs[_0x1ee1('0x1d')](_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x1d')]);_0xf63d67[_0x1ee1('0x20')]=qs[_0x1ee1('0x20')](_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x20')]);}_0xf63d67[_0x1ee1('0x39')]=qs[_0x1ee1('0x3a')](_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x3a')]);_0xf63d67[_0x1ee1('0x3b')]=qs[_0x1ee1('0x30')](_[_0x1ee1('0x3c')](_0x444ed9['query'],_0x209592[_0x1ee1('0x30')]),_0x4b9ea4);if(_0x444ed9[_0x1ee1('0x35')][_0x1ee1('0x3d')]){_0xf63d67[_0x1ee1('0x3b')]=_[_0x1ee1('0x3e')](_0xf63d67[_0x1ee1('0x3b')],{'$or':_[_0x1ee1('0x2b')](_0x4b9ea4,function(_0x3390f0){if(_0x3390f0[_0x1ee1('0x3f')]!==_0x1ee1('0x40')){var _0x46eff6={};_0x46eff6[_0x3390f0[_0x1ee1('0x2a')]]={'$like':'%'+_0x444ed9['query'][_0x1ee1('0x3d')]+'%'};return _0x46eff6;}})});}_0xf63d67=_[_0x1ee1('0x3e')]({},_0xf63d67,_0x444ed9[_0x1ee1('0x41')]);var _0x447b90={'where':_0xf63d67[_0x1ee1('0x3b')]};return db[_0x1ee1('0x2c')][_0x1ee1('0x1f')](_0x447b90)['then'](function(_0x3df247){_0x49241e[_0x1ee1('0x1f')]=_0x3df247;if(_0x444ed9['query'][_0x1ee1('0x42')]){_0xf63d67['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x1ee1('0x43')](_0xf63d67);})[_0x1ee1('0x25')](function(_0x5cc8a1){_0x49241e[_0x1ee1('0x44')]=_0x5cc8a1;return _0x49241e;})[_0x1ee1('0x25')](respondWithFilteredResult(_0xfd544d,_0xf63d67))[_0x1ee1('0x45')](handleError(_0xfd544d,null));};exports[_0x1ee1('0x46')]=function(_0x1910ed,_0x5301c3){var _0x4e4e09={'raw':![],'where':{'id':_0x1910ed[_0x1ee1('0x47')]['id']}},_0x38e0aa={};_0x38e0aa[_0x1ee1('0x31')]=_[_0x1ee1('0x2f')](db[_0x1ee1('0x2c')][_0x1ee1('0x2d')]);_0x38e0aa[_0x1ee1('0x35')]=_['keys'](_0x1910ed[_0x1ee1('0x35')]);_0x38e0aa['filters']=_[_0x1ee1('0x33')](_0x38e0aa[_0x1ee1('0x31')],_0x38e0aa[_0x1ee1('0x35')]);_0x4e4e09[_0x1ee1('0x32')]=_[_0x1ee1('0x33')](_0x38e0aa[_0x1ee1('0x31')],qs[_0x1ee1('0x34')](_0x1910ed[_0x1ee1('0x35')][_0x1ee1('0x34')]));_0x4e4e09[_0x1ee1('0x32')]=_0x4e4e09['attributes'][_0x1ee1('0x36')]?_0x4e4e09[_0x1ee1('0x32')]:_0x38e0aa[_0x1ee1('0x31')];if(_0x1910ed['query'][_0x1ee1('0x42')]){_0x4e4e09[_0x1ee1('0x48')]=[{'all':!![]}];}_0x4e4e09=_[_0x1ee1('0x3e')]({},_0x4e4e09,_0x1910ed['options']);return db[_0x1ee1('0x2c')][_0x1ee1('0x49')](_0x4e4e09)[_0x1ee1('0x25')](handleEntityNotFound(_0x5301c3,null))[_0x1ee1('0x25')](respondWithResult(_0x5301c3,null))['catch'](handleError(_0x5301c3,null));};exports[_0x1ee1('0x4a')]=function(_0x4c46e4,_0x12edad){return db[_0x1ee1('0x2c')]['create'](_0x4c46e4['body'],{})[_0x1ee1('0x25')](function(_0x13462f){var _0x17369c=_0x4c46e4[_0x1ee1('0x4b')]['get']({'plain':!![]});if(!_0x17369c)throw new Error(_0x1ee1('0x4c'));if(_0x17369c[_0x1ee1('0x4d')]==='user'){var _0x1e0682=_0x13462f[_0x1ee1('0x27')]({'plain':!![]});var _0x400c27=_0x1ee1('0x4e');return db[_0x1ee1('0x4f')][_0x1ee1('0x49')]({'where':{'name':_0x400c27,'userProfileId':_0x17369c['userProfileId']},'raw':!![]})[_0x1ee1('0x25')](function(_0xb894af){if(_0xb894af&&_0xb894af[_0x1ee1('0x50')]===0x0){return db[_0x1ee1('0x28')][_0x1ee1('0x4a')]({'name':_0x1e0682[_0x1ee1('0x2a')],'resourceId':_0x1e0682['id'],'type':_0xb894af['name'],'sectionId':_0xb894af['id']},{})['then'](function(){return _0x13462f;});}else{return _0x13462f;}})[_0x1ee1('0x45')](function(_0xe93945){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe93945);throw _0xe93945;});}return _0x13462f;})[_0x1ee1('0x25')](respondWithResult(_0x12edad,0xc9))[_0x1ee1('0x45')](handleError(_0x12edad,null));};exports[_0x1ee1('0x24')]=function(_0x4af47b,_0x3791de){if(_0x4af47b[_0x1ee1('0x51')]['id']){delete _0x4af47b[_0x1ee1('0x51')]['id'];}return db[_0x1ee1('0x2c')][_0x1ee1('0x49')]({'where':{'id':_0x4af47b[_0x1ee1('0x47')]['id']}})[_0x1ee1('0x25')](handleEntityNotFound(_0x3791de,null))[_0x1ee1('0x25')](saveUpdates(_0x4af47b['body'],null))['then'](respondWithResult(_0x3791de,null))[_0x1ee1('0x45')](handleError(_0x3791de,null));};exports['destroy']=function(_0x4ac90f,_0xa00597){return db['VoiceChanSpy']['find']({'where':{'id':_0x4ac90f[_0x1ee1('0x47')]['id']}})[_0x1ee1('0x25')](handleEntityNotFound(_0xa00597,null))['then'](removeEntity(_0xa00597,null))[_0x1ee1('0x45')](handleError(_0xa00597,null));}; \ No newline at end of file +var _0x195e=['mustache','util','path','sox','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','end','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x195e,0xfb));var _0xe195=function(_0x95621f,_0x5840ca){_0x95621f=_0x95621f-0x0;var _0x30ea65=_0x195e[_0x95621f];return _0x30ea65;};'use strict';var emlformat=require(_0xe195('0x0'));var rimraf=require(_0xe195('0x1'));var zipdir=require(_0xe195('0x2'));var jsonpatch=require(_0xe195('0x3'));var rp=require(_0xe195('0x4'));var moment=require(_0xe195('0x5'));var BPromise=require(_0xe195('0x6'));var Mustache=require(_0xe195('0x7'));var util=require(_0xe195('0x8'));var path=require(_0xe195('0x9'));var sox=require(_0xe195('0xa'));var csv=require(_0xe195('0xb'));var ejs=require(_0xe195('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe195('0xd'));var squel=require(_0xe195('0xe'));var crypto=require(_0xe195('0xf'));var jsforce=require(_0xe195('0x10'));var deskjs=require(_0xe195('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe195('0x12'));var authService=require(_0xe195('0x13'));var qs=require(_0xe195('0x14'));var as=require(_0xe195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe195('0x16'))(_0xe195('0x17'));var utils=require(_0xe195('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe195('0x19'));var db=require(_0xe195('0x1a'))['db'];function respondWithStatusCode(_0x5ae615,_0x3da7d9){_0x3da7d9=_0x3da7d9||0xcc;return function(_0x12fa0f){if(_0x12fa0f){return _0x5ae615[_0xe195('0x1b')](_0x3da7d9);}return _0x5ae615[_0xe195('0x1c')](_0x3da7d9)['end']();};}function respondWithResult(_0x52217d,_0x2e82d1){_0x2e82d1=_0x2e82d1||0xc8;return function(_0x555a6a){if(_0x555a6a){return _0x52217d['status'](_0x2e82d1)[_0xe195('0x1d')](_0x555a6a);}};}function respondWithFilteredResult(_0x5c444f,_0x232c57){return function(_0x542ac7){if(_0x542ac7){var _0x534879=typeof _0x232c57[_0xe195('0x1e')]===_0xe195('0x1f')&&typeof _0x232c57[_0xe195('0x20')]===_0xe195('0x1f');var _0x3a042f=_0x542ac7[_0xe195('0x21')];var _0x4784b1=_0x534879?0x0:_0x232c57[_0xe195('0x1e')];var _0x9c8ba5=_0x534879?_0x542ac7[_0xe195('0x21')]:_0x232c57['offset']+_0x232c57[_0xe195('0x20')];var _0x317d8b;if(_0x9c8ba5>=_0x3a042f){_0x9c8ba5=_0x3a042f;_0x317d8b=0xc8;}else{_0x317d8b=0xce;}_0x5c444f[_0xe195('0x1c')](_0x317d8b);return _0x5c444f[_0xe195('0x22')](_0xe195('0x23'),_0x4784b1+'-'+_0x9c8ba5+'/'+_0x3a042f)[_0xe195('0x1d')](_0x542ac7);}return null;};}function patchUpdates(_0x496722){return function(_0x1c5ac8){try{jsonpatch[_0xe195('0x24')](_0x1c5ac8,_0x496722,!![]);}catch(_0x334b4a){return BPromise[_0xe195('0x25')](_0x334b4a);}return _0x1c5ac8['save']();};}function saveUpdates(_0x4dab1a,_0x4e5f13){return function(_0x57ee33){if(_0x57ee33){return _0x57ee33[_0xe195('0x26')](_0x4dab1a)[_0xe195('0x27')](function(_0x2cb019){return _0x2cb019;});}return null;};}function removeEntity(_0x199148,_0x46b15b){return function(_0x40c6a2){if(_0x40c6a2){return _0x40c6a2[_0xe195('0x28')]()[_0xe195('0x27')](function(){var _0x3d7857=_0x40c6a2[_0xe195('0x29')]({'plain':!![]});var _0x55be2d=_0xe195('0x2a');return db['UserProfileResource'][_0xe195('0x28')]({'where':{'type':_0x55be2d,'resourceId':_0x3d7857['id']}})[_0xe195('0x27')](function(){return _0x40c6a2;});})[_0xe195('0x27')](function(){_0x199148[_0xe195('0x1c')](0xcc)[_0xe195('0x2b')]();});}};}function handleEntityNotFound(_0x38be17,_0x3d0e75){return function(_0x401808){if(!_0x401808){_0x38be17[_0xe195('0x1b')](0x194);}return _0x401808;};}function handleError(_0x1f1ca7,_0x4dd9f3){_0x4dd9f3=_0x4dd9f3||0x1f4;return function(_0x33a08d){logger[_0xe195('0x2c')](_0x33a08d[_0xe195('0x2d')]);if(_0x33a08d[_0xe195('0x2e')]){delete _0x33a08d[_0xe195('0x2e')];}_0x1f1ca7['status'](_0x4dd9f3)['send'](_0x33a08d);};}exports[_0xe195('0x2f')]=function(_0x2022e8,_0x46b6f2){var _0x3aaf2e={},_0x2b69a3={},_0x46aa26={'count':0x0,'rows':[]};var _0x5e83da=_[_0xe195('0x30')](db[_0xe195('0x31')][_0xe195('0x32')],function(_0x59b3bf){return{'name':_0x59b3bf[_0xe195('0x33')],'type':_0x59b3bf['type'][_0xe195('0x34')]};});_0x2b69a3[_0xe195('0x35')]=_['map'](_0x5e83da,_0xe195('0x2e'));_0x2b69a3[_0xe195('0x36')]=_[_0xe195('0x37')](_0x2022e8['query']);_0x2b69a3[_0xe195('0x38')]=_[_0xe195('0x39')](_0x2b69a3[_0xe195('0x35')],_0x2b69a3[_0xe195('0x36')]);_0x3aaf2e[_0xe195('0x3a')]=_[_0xe195('0x39')](_0x2b69a3['model'],qs[_0xe195('0x3b')](_0x2022e8[_0xe195('0x36')][_0xe195('0x3b')]));_0x3aaf2e[_0xe195('0x3a')]=_0x3aaf2e[_0xe195('0x3a')][_0xe195('0x3c')]?_0x3aaf2e[_0xe195('0x3a')]:_0x2b69a3['model'];if(!_0x2022e8[_0xe195('0x36')][_0xe195('0x3d')]('nolimit')){_0x3aaf2e[_0xe195('0x20')]=qs[_0xe195('0x20')](_0x2022e8['query'][_0xe195('0x20')]);_0x3aaf2e['offset']=qs[_0xe195('0x1e')](_0x2022e8[_0xe195('0x36')][_0xe195('0x1e')]);}_0x3aaf2e[_0xe195('0x3e')]=qs[_0xe195('0x3f')](_0x2022e8[_0xe195('0x36')]['sort']);_0x3aaf2e[_0xe195('0x40')]=qs[_0xe195('0x38')](_[_0xe195('0x41')](_0x2022e8['query'],_0x2b69a3[_0xe195('0x38')]),_0x5e83da);if(_0x2022e8[_0xe195('0x36')]['filter']){_0x3aaf2e[_0xe195('0x40')]=_[_0xe195('0x42')](_0x3aaf2e['where'],{'$or':_[_0xe195('0x30')](_0x5e83da,function(_0x9053b8){if(_0x9053b8[_0xe195('0x43')]!=='VIRTUAL'){var _0x2b6bad={};_0x2b6bad[_0x9053b8[_0xe195('0x2e')]]={'$like':'%'+_0x2022e8[_0xe195('0x36')][_0xe195('0x44')]+'%'};return _0x2b6bad;}})});}_0x3aaf2e=_[_0xe195('0x42')]({},_0x3aaf2e,_0x2022e8[_0xe195('0x45')]);var _0x435f60={'where':_0x3aaf2e[_0xe195('0x40')]};return db[_0xe195('0x31')][_0xe195('0x21')](_0x435f60)[_0xe195('0x27')](function(_0xff05fc){_0x46aa26['count']=_0xff05fc;if(_0x2022e8[_0xe195('0x36')][_0xe195('0x46')]){_0x3aaf2e[_0xe195('0x47')]=[{'all':!![]}];}return db[_0xe195('0x31')][_0xe195('0x48')](_0x3aaf2e);})['then'](function(_0x5d1059){_0x46aa26['rows']=_0x5d1059;return _0x46aa26;})['then'](respondWithFilteredResult(_0x46b6f2,_0x3aaf2e))[_0xe195('0x49')](handleError(_0x46b6f2,null));};exports['show']=function(_0x3e6d48,_0x53d60a){var _0x535f6f={'raw':![],'where':{'id':_0x3e6d48[_0xe195('0x4a')]['id']}},_0x2d2cd4={};_0x2d2cd4[_0xe195('0x35')]=_[_0xe195('0x37')](db[_0xe195('0x31')][_0xe195('0x32')]);_0x2d2cd4[_0xe195('0x36')]=_[_0xe195('0x37')](_0x3e6d48['query']);_0x2d2cd4['filters']=_[_0xe195('0x39')](_0x2d2cd4[_0xe195('0x35')],_0x2d2cd4['query']);_0x535f6f[_0xe195('0x3a')]=_[_0xe195('0x39')](_0x2d2cd4[_0xe195('0x35')],qs[_0xe195('0x3b')](_0x3e6d48[_0xe195('0x36')][_0xe195('0x3b')]));_0x535f6f[_0xe195('0x3a')]=_0x535f6f[_0xe195('0x3a')][_0xe195('0x3c')]?_0x535f6f[_0xe195('0x3a')]:_0x2d2cd4[_0xe195('0x35')];if(_0x3e6d48[_0xe195('0x36')]['includeAll']){_0x535f6f[_0xe195('0x47')]=[{'all':!![]}];}_0x535f6f=_[_0xe195('0x42')]({},_0x535f6f,_0x3e6d48[_0xe195('0x45')]);return db[_0xe195('0x31')][_0xe195('0x4b')](_0x535f6f)[_0xe195('0x27')](handleEntityNotFound(_0x53d60a,null))[_0xe195('0x27')](respondWithResult(_0x53d60a,null))[_0xe195('0x49')](handleError(_0x53d60a,null));};exports[_0xe195('0x4c')]=function(_0x19e744,_0x2b3d9b){return db['VoiceChanSpy'][_0xe195('0x4c')](_0x19e744['body'],{})[_0xe195('0x27')](function(_0x43d578){var _0x16ecb3=_0x19e744['user']['get']({'plain':!![]});if(!_0x16ecb3)throw new Error(_0xe195('0x4d'));if(_0x16ecb3[_0xe195('0x4e')]===_0xe195('0x4f')){var _0x11aec8=_0x43d578[_0xe195('0x29')]({'plain':!![]});var _0x22411e=_0xe195('0x2a');return db[_0xe195('0x50')][_0xe195('0x4b')]({'where':{'name':_0x22411e,'userProfileId':_0x16ecb3[_0xe195('0x51')]},'raw':!![]})[_0xe195('0x27')](function(_0x46848e){if(_0x46848e&&_0x46848e[_0xe195('0x52')]===0x0){return db[_0xe195('0x53')][_0xe195('0x4c')]({'name':_0x11aec8[_0xe195('0x2e')],'resourceId':_0x11aec8['id'],'type':_0x46848e[_0xe195('0x2e')],'sectionId':_0x46848e['id']},{})[_0xe195('0x27')](function(){return _0x43d578;});}else{return _0x43d578;}})[_0xe195('0x49')](function(_0x53be82){logger[_0xe195('0x2c')](_0xe195('0x54'),_0x53be82);throw _0x53be82;});}return _0x43d578;})[_0xe195('0x27')](respondWithResult(_0x2b3d9b,0xc9))[_0xe195('0x49')](handleError(_0x2b3d9b,null));};exports[_0xe195('0x26')]=function(_0x36dc3e,_0x57ad8c){if(_0x36dc3e['body']['id']){delete _0x36dc3e[_0xe195('0x55')]['id'];}return db[_0xe195('0x31')][_0xe195('0x4b')]({'where':{'id':_0x36dc3e['params']['id']}})[_0xe195('0x27')](handleEntityNotFound(_0x57ad8c,null))[_0xe195('0x27')](saveUpdates(_0x36dc3e['body'],null))[_0xe195('0x27')](respondWithResult(_0x57ad8c,null))[_0xe195('0x49')](handleError(_0x57ad8c,null));};exports['destroy']=function(_0x276756,_0x5a97ee){return db[_0xe195('0x31')][_0xe195('0x4b')]({'where':{'id':_0x276756[_0xe195('0x4a')]['id']}})[_0xe195('0x27')](handleEntityNotFound(_0x5a97ee,null))[_0xe195('0x27')](removeEntity(_0x5a97ee,null))[_0xe195('0x49')](handleError(_0x5a97ee,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 4f0d1b5..8b95018 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 _0xde12=['./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird'];(function(_0x3c3249,_0x3b2253){var _0x2bb1d6=function(_0x531dd6){while(--_0x531dd6){_0x3c3249['push'](_0x3c3249['shift']());}};_0x2bb1d6(++_0x3b2253);}(_0xde12,0x153));var _0x2de1=function(_0x56d14d,_0x3caa42){_0x56d14d=_0x56d14d-0x0;var _0x4827cd=_0xde12[_0x56d14d];return _0x4827cd;};'use strict';var _=require(_0x2de1('0x0'));var util=require(_0x2de1('0x1'));var BPromise=require(_0x2de1('0x2'));var attributes=require(_0x2de1('0x3'));var getUserApplications=function(_0x4f06ef,_0x23bd80,_0x1668a5){var _0x564056=0x1;var _0xbd90e4=[];var _0x581e35={'context':_0x23bd80[_0x2de1('0x4')]||_0x2de1('0x5'),'exten':util[_0x2de1('0x6')](_0x2de1('0x7'),_0x4f06ef[_0x2de1('0x8')],_0x1668a5),'type':_0x2de1('0x9'),'isApp':![],'ChanSpyId':_0x4f06ef['id'],'UserId':_0x23bd80['id']};_0xbd90e4[_0x2de1('0xa')](_[_0x2de1('0xb')]({'app':'Set','appdata':util[_0x2de1('0x6')](_0x2de1('0xc'),_0x2de1('0xd')),'priority':_0x564056++},_0x581e35));if(_0x4f06ef['record']){_0xbd90e4[_0x2de1('0xa')](_['merge']({'app':_0x2de1('0xe'),'appdata':util[_0x2de1('0x6')](_0x2de1('0xf'),_0x4f06ef[_0x2de1('0x10')]),'priority':_0x564056++},_0x581e35));}if(_0x4f06ef['auth']){_0xbd90e4['push'](_['merge']({'app':'Authenticate','appdata':_0x4f06ef[_0x2de1('0x11')],'priority':_0x564056++},_0x581e35));}_0xbd90e4[_0x2de1('0xa')](_[_0x2de1('0xb')]({'app':_0x2de1('0x12'),'appdata':util[_0x2de1('0x6')]('SIP/%s,%s',_0x23bd80[_0x2de1('0x13')],_0x4f06ef[_0x2de1('0x14')]?_0x4f06ef['options'][_0x2de1('0x15')](''):''),'priority':_0x564056++},_0x581e35));if(_0x4f06ef['record']){_0xbd90e4[_0x2de1('0xa')](_[_0x2de1('0xb')]({'app':_0x2de1('0x16'),'priority':_0x564056++},_0x581e35));}return _0xbd90e4;};var getChanSpyApplications=function(_0x38df93,_0x42e3cc){var _0x56ee6a=[];for(var _0x12bfed=0x0,_0xc66bc5=0x1;_0x12bfed<_0x42e3cc[_0x2de1('0x17')];_0x12bfed++,_0xc66bc5=0x1){_0x56ee6a=_0x56ee6a[_0x2de1('0x18')](getUserApplications(_0x38df93,_0x42e3cc[_0x12bfed],_0x42e3cc[_0x12bfed][_0x2de1('0x19')]));if(_0x42e3cc[_0x12bfed][_0x2de1('0x19')]!=_0x42e3cc[_0x12bfed][_0x2de1('0x13')]){_0x56ee6a=_0x56ee6a[_0x2de1('0x18')](getUserApplications(_0x38df93,_0x42e3cc[_0x12bfed],_0x42e3cc[_0x12bfed][_0x2de1('0x13')]));}}return _0x56ee6a;};var getChanSpyPromise=function(_0x4fdbf9,_0x3541e3){return new BPromise(function(_0x17bb0c,_0x1a2395){return _0x4fdbf9[_0x2de1('0x1a')][_0x2de1('0x1b')]({'attributes':['id',_0x2de1('0x13'),_0x2de1('0x19')],'where':{'role':_0x2de1('0x1c'),'chanspy':!![]},'raw':!![]})[_0x2de1('0x1d')](function(_0x41ab88){if(_0x41ab88){return _0x17bb0c(getChanSpyApplications(_0x3541e3,_0x41ab88));}return _0x17bb0c([]);})[_0x2de1('0x1e')](function(_0xc2930e){_0x1a2395(_0xc2930e);});});};module['exports']=function(_0x129c74,_0xff8aba){var _0x9256b7=_0x129c74[_0x2de1('0x1f')];return _0x129c74[_0x2de1('0x20')](_0x2de1('0x21'),attributes,{'tableName':_0x2de1('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x42594a,_0x3b437a,_0x106cd5){return getChanSpyPromise(_0x9256b7,_0x42594a)[_0x2de1('0x1d')](function(_0x1f45cf){if(_0x1f45cf&&_0x1f45cf[_0x2de1('0x17')]){return _0x9256b7[_0x2de1('0x23')][_0x2de1('0x24')](_0x1f45cf);}})[_0x2de1('0x1d')](function(){_0x106cd5();})['catch'](function(_0x396aaa){_0x106cd5(_0x396aaa);});},'afterUpdate':function(_0x44bd22,_0x2690b5,_0x2674c8){return _0x9256b7[_0x2de1('0x23')][_0x2de1('0x25')]({'where':{'ChanSpyId':_0x44bd22['id']}})[_0x2de1('0x1d')](function(){return getChanSpyPromise(_0x9256b7,_0x44bd22);})[_0x2de1('0x1d')](function(_0x2c7797){if(_0x2c7797&&_0x2c7797['length']){return _0x9256b7['VoiceExtension'][_0x2de1('0x24')](_0x2c7797);}})[_0x2de1('0x1d')](function(){_0x2674c8();})['catch'](function(_0xb9a7ba){_0x2674c8(_0xb9a7ba);});},'afterDestroy':function(_0x1f75bd,_0x1fd4fd,_0x496429){return _0x9256b7[_0x2de1('0x23')][_0x2de1('0x25')]({'where':{'ChanSpyId':_0x1f75bd['id']}})[_0x2de1('0x1d')](function(){_0x496429();})['catch'](function(_0x5cf782){_0x496429(_0x5cf782);});}}});}; \ No newline at end of file +var _0xa812=['then','catch','exports','models','define','voice_chanspy','bulkCreate','destroy','VoiceExtension','lodash','util','./voiceChanSpy.attributes','context','from-sip','%s%s','system','merge','format','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User'];(function(_0x31e719,_0x397785){var _0x4ae4e8=function(_0xa35dcf){while(--_0xa35dcf){_0x31e719['push'](_0x31e719['shift']());}};_0x4ae4e8(++_0x397785);}(_0xa812,0x78));var _0x2a81=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xa812[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x2a81('0x0'));var util=require(_0x2a81('0x1'));var BPromise=require('bluebird');var attributes=require(_0x2a81('0x2'));var getUserApplications=function(_0x125ad9,_0xcf6640,_0x7a50f6){var _0x300d07=0x1;var _0x4809bf=[];var _0x4b99d0={'context':_0xcf6640[_0x2a81('0x3')]||_0x2a81('0x4'),'exten':util['format'](_0x2a81('0x5'),_0x125ad9['prefix'],_0x7a50f6),'type':_0x2a81('0x6'),'isApp':![],'ChanSpyId':_0x125ad9['id'],'UserId':_0xcf6640['id']};_0x4809bf['push'](_[_0x2a81('0x7')]({'app':'Set','appdata':util[_0x2a81('0x8')]('CDR(type)=%s',_0x2a81('0x9')),'priority':_0x300d07++},_0x4b99d0));if(_0x125ad9[_0x2a81('0xa')]){_0x4809bf['push'](_[_0x2a81('0x7')]({'app':_0x2a81('0xb'),'appdata':util[_0x2a81('0x8')](_0x2a81('0xc'),_0x125ad9[_0x2a81('0xd')]),'priority':_0x300d07++},_0x4b99d0));}if(_0x125ad9[_0x2a81('0xe')]){_0x4809bf[_0x2a81('0xf')](_['merge']({'app':_0x2a81('0x10'),'appdata':_0x125ad9[_0x2a81('0x11')],'priority':_0x300d07++},_0x4b99d0));}_0x4809bf[_0x2a81('0xf')](_['merge']({'app':_0x2a81('0x12'),'appdata':util[_0x2a81('0x8')](_0x2a81('0x13'),_0xcf6640[_0x2a81('0x14')],_0x125ad9[_0x2a81('0x15')]?_0x125ad9[_0x2a81('0x15')][_0x2a81('0x16')](''):''),'priority':_0x300d07++},_0x4b99d0));if(_0x125ad9['record']){_0x4809bf['push'](_['merge']({'app':_0x2a81('0x17'),'priority':_0x300d07++},_0x4b99d0));}return _0x4809bf;};var getChanSpyApplications=function(_0x2d1e77,_0x1cf0a6){var _0x49de27=[];for(var _0xd4c775=0x0,_0x29d6e3=0x1;_0xd4c775<_0x1cf0a6[_0x2a81('0x18')];_0xd4c775++,_0x29d6e3=0x1){_0x49de27=_0x49de27[_0x2a81('0x19')](getUserApplications(_0x2d1e77,_0x1cf0a6[_0xd4c775],_0x1cf0a6[_0xd4c775]['internal']));if(_0x1cf0a6[_0xd4c775][_0x2a81('0x1a')]!=_0x1cf0a6[_0xd4c775][_0x2a81('0x14')]){_0x49de27=_0x49de27[_0x2a81('0x19')](getUserApplications(_0x2d1e77,_0x1cf0a6[_0xd4c775],_0x1cf0a6[_0xd4c775][_0x2a81('0x14')]));}}return _0x49de27;};var getChanSpyPromise=function(_0x12d7c9,_0x2b02a9){return new BPromise(function(_0x2ee44c,_0x3a8134){return _0x12d7c9[_0x2a81('0x1b')]['findAll']({'attributes':['id',_0x2a81('0x14'),_0x2a81('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x2a81('0x1c')](function(_0x4e7e55){if(_0x4e7e55){return _0x2ee44c(getChanSpyApplications(_0x2b02a9,_0x4e7e55));}return _0x2ee44c([]);})[_0x2a81('0x1d')](function(_0x3197c7){_0x3a8134(_0x3197c7);});});};module[_0x2a81('0x1e')]=function(_0x1fd828,_0x560b39){var _0x119a3a=_0x1fd828[_0x2a81('0x1f')];return _0x1fd828[_0x2a81('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x2a81('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b273c,_0x181e63,_0x13ffbb){return getChanSpyPromise(_0x119a3a,_0x4b273c)['then'](function(_0xee11e0){if(_0xee11e0&&_0xee11e0[_0x2a81('0x18')]){return _0x119a3a['VoiceExtension'][_0x2a81('0x22')](_0xee11e0);}})['then'](function(){_0x13ffbb();})[_0x2a81('0x1d')](function(_0x3b3918){_0x13ffbb(_0x3b3918);});},'afterUpdate':function(_0x5afc00,_0x24bc8d,_0x58f51e){return _0x119a3a['VoiceExtension'][_0x2a81('0x23')]({'where':{'ChanSpyId':_0x5afc00['id']}})['then'](function(){return getChanSpyPromise(_0x119a3a,_0x5afc00);})['then'](function(_0x2c5833){if(_0x2c5833&&_0x2c5833['length']){return _0x119a3a[_0x2a81('0x24')][_0x2a81('0x22')](_0x2c5833);}})[_0x2a81('0x1c')](function(){_0x58f51e();})[_0x2a81('0x1d')](function(_0x182501){_0x58f51e(_0x182501);});},'afterDestroy':function(_0x46c637,_0xc84eff,_0x1557ca){return _0x119a3a[_0x2a81('0x24')][_0x2a81('0x23')]({'where':{'ChanSpyId':_0x46c637['id']}})[_0x2a81('0x1c')](function(){_0x1557ca();})[_0x2a81('0x1d')](function(_0x1921f5){_0x1557ca(_0x1921f5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 683cce6..928d2ac 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 _0x422f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x422f,0x1c7));var _0xf422=function(_0x354532,_0x5d4883){_0x354532=_0x354532-0x0;var _0x50f867=_0x422f[_0x354532];return _0x50f867;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var moment=require('moment');var BPromise=require(_0xf422('0x1'));var rs=require(_0xf422('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf422('0x3'))['db'];var utils=require(_0xf422('0x4'));var logger=require(_0xf422('0x5'))(_0xf422('0x6'));var config=require(_0xf422('0x7'));var jayson=require(_0xf422('0x8'));var client=jayson[_0xf422('0x9')][_0xf422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x350b2d,_0x583283,_0x3f4801){return new BPromise(function(_0x1037fa,_0xc2c9f5){return client[_0xf422('0xb')](_0x350b2d,_0x3f4801)[_0xf422('0xc')](function(_0x5f02da){logger[_0xf422('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x583283,'request\x20sent');logger[_0xf422('0xe')](_0xf422('0xf'),_0x583283,_0xf422('0x10'),JSON[_0xf422('0x11')](_0x5f02da));if(_0x5f02da[_0xf422('0x12')]){if(_0x5f02da['error'][_0xf422('0x13')]===0x1f4){logger[_0xf422('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x583283,_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);return _0xc2c9f5(_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);}logger[_0xf422('0x12')](_0xf422('0x15'),_0x583283,_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);return _0x1037fa(_0x5f02da[_0xf422('0x12')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x583283,_0xf422('0x10'));_0x1037fa(_0x5f02da[_0xf422('0x16')][_0xf422('0x14')]);}})[_0xf422('0x17')](function(_0x5f3de5){logger[_0xf422('0x12')](_0xf422('0x15'),_0x583283,_0x5f3de5);_0xc2c9f5(_0x5f3de5);});});} \ No newline at end of file +var _0xe812=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment'];(function(_0x541a3a,_0xcd79af){var _0x35dbf4=function(_0x33d86b){while(--_0x33d86b){_0x541a3a['push'](_0x541a3a['shift']());}};_0x35dbf4(++_0xcd79af);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var moment=require(_0x2e81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e81('0x2'));var db=require(_0x2e81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e81('0x4'))(_0x2e81('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e81('0x6'));var client=jayson[_0x2e81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36604d,_0x32b221,_0x27f9c6){return new BPromise(function(_0x5559ca,_0x142cab){return client[_0x2e81('0x8')](_0x36604d,_0x27f9c6)[_0x2e81('0x9')](function(_0x11a56b){logger['info'](_0x2e81('0xa'),_0x32b221,_0x2e81('0xb'));logger[_0x2e81('0xc')](_0x2e81('0xd'),_0x32b221,_0x2e81('0xb'),JSON[_0x2e81('0xe')](_0x11a56b));if(_0x11a56b[_0x2e81('0xf')]){if(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x10')]===0x1f4){logger[_0x2e81('0xf')](_0x2e81('0xa'),_0x32b221,_0x11a56b['error'][_0x2e81('0x11')]);return _0x142cab(_0x11a56b[_0x2e81('0xf')]['message']);}logger[_0x2e81('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x32b221,_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);return _0x5559ca(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);}else{logger[_0x2e81('0x12')](_0x2e81('0xa'),_0x32b221,'request\x20sent');_0x5559ca(_0x11a56b[_0x2e81('0x13')][_0x2e81('0x11')]);}})['catch'](function(_0x330131){logger['error'](_0x2e81('0xa'),_0x32b221,_0x330131);_0x142cab(_0x330131);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index df02895..9d272bd 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 _0xd957=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index'];(function(_0x329fe4,_0x26ecce){var _0x30f90c=function(_0x46bba8){while(--_0x46bba8){_0x329fe4['push'](_0x329fe4['shift']());}};_0x30f90c(++_0x26ecce);}(_0xd957,0x1ad));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var path=require(_0x7d95('0x2'));var timeout=require(_0x7d95('0x3'));var express=require(_0x7d95('0x4'));var router=express[_0x7d95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7d95('0x6'));var interaction=require(_0x7d95('0x7'));var config=require(_0x7d95('0x8'));var controller=require(_0x7d95('0x9'));router['get']('/',auth[_0x7d95('0xa')](),controller[_0x7d95('0xb')]);router['get'](_0x7d95('0xc'),auth[_0x7d95('0xa')](),controller[_0x7d95('0xd')]);router[_0x7d95('0xe')]('/',auth[_0x7d95('0xa')](),controller[_0x7d95('0xf')]);router[_0x7d95('0x10')](_0x7d95('0xc'),auth['isAuthenticated'](),controller[_0x7d95('0x11')]);router[_0x7d95('0x12')](_0x7d95('0xc'),auth['isAuthenticated'](),controller[_0x7d95('0x13')]);module[_0x7d95('0x14')]=router; \ No newline at end of file +var _0x2eaa=['../../config/environment','./voiceContext.controller','isAuthenticated','index','get','create','put','/:id','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48639f,_0x393081){var _0x1915e6=function(_0x26a1b0){while(--_0x26a1b0){_0x48639f['push'](_0x48639f['shift']());}};_0x1915e6(++_0x393081);}(_0x2eaa,0x180));var _0xa2ea=function(_0x49b026,_0x2fc9df){_0x49b026=_0x49b026-0x0;var _0x25596f=_0x2eaa[_0x49b026];return _0x25596f;};'use strict';var multer=require('multer');var util=require(_0xa2ea('0x0'));var path=require(_0xa2ea('0x1'));var timeout=require(_0xa2ea('0x2'));var express=require('express');var router=express[_0xa2ea('0x3')]();var fs_extra=require(_0xa2ea('0x4'));var auth=require(_0xa2ea('0x5'));var interaction=require(_0xa2ea('0x6'));var config=require(_0xa2ea('0x7'));var controller=require(_0xa2ea('0x8'));router['get']('/',auth[_0xa2ea('0x9')](),controller[_0xa2ea('0xa')]);router[_0xa2ea('0xb')]('/:id',auth[_0xa2ea('0x9')](),controller['show']);router['post']('/',auth[_0xa2ea('0x9')](),controller[_0xa2ea('0xc')]);router[_0xa2ea('0xd')](_0xa2ea('0xe'),auth['isAuthenticated'](),controller[_0xa2ea('0xf')]);router[_0xa2ea('0x10')](_0xa2ea('0xe'),auth[_0xa2ea('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 71ac264..cb0a13e 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 _0x3bf4=['exports','name','STRING','sequelize'];(function(_0x169f9b,_0x50ef4e){var _0x574c74=function(_0x4aeb48){while(--_0x4aeb48){_0x169f9b['push'](_0x169f9b['shift']());}};_0x574c74(++_0x50ef4e);}(_0x3bf4,0xe7));var _0x43bf=function(_0x12c76c,_0x2da11e){_0x12c76c=_0x12c76c-0x0;var _0xe6b234=_0x3bf4[_0x12c76c];return _0xe6b234;};'use strict';var Sequelize=require(_0x43bf('0x0'));module[_0x43bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x43bf('0x2')},'description':{'type':Sequelize[_0x43bf('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2856=['sequelize','exports','name','BOOLEAN'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0x2856,0x194));var _0x6285=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x2856[_0x18d631];return _0x50d708;};'use strict';var Sequelize=require(_0x6285('0x0'));module[_0x6285('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6285('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6285('0x3')],'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 98592ed..99ef0ee 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 _0x87c5=['writeFileSync','Reload','chan_sip.so','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Contexts','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','params','include','find','create','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','user','userProfileId','autoAssociation','body'];(function(_0x439ab1,_0xfa2a56){var _0x569f47=function(_0x10dcc3){while(--_0x10dcc3){_0x439ab1['push'](_0x439ab1['shift']());}};_0x569f47(++_0xfa2a56);}(_0x87c5,0x12c));var _0x587c=function(_0x167377,_0x5cd0fa){_0x167377=_0x167377-0x0;var _0xaca30c=_0x87c5[_0x167377];return _0xaca30c;};'use strict';var emlformat=require(_0x587c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x587c('0x1'));var jsonpatch=require(_0x587c('0x2'));var rp=require(_0x587c('0x3'));var moment=require(_0x587c('0x4'));var BPromise=require(_0x587c('0x5'));var Mustache=require(_0x587c('0x6'));var util=require(_0x587c('0x7'));var path=require(_0x587c('0x8'));var sox=require('sox');var csv=require(_0x587c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x587c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x587c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x587c('0xc'));var authService=require(_0x587c('0xd'));var qs=require(_0x587c('0xe'));var as=require(_0x587c('0xf'));var hardwareService=require(_0x587c('0x10'));var logger=require(_0x587c('0x11'))(_0x587c('0x12'));var utils=require(_0x587c('0x13'));var config=require(_0x587c('0x14'));var licenseUtil=require(_0x587c('0x15'));var db=require(_0x587c('0x16'))['db'];var jayson=require(_0x587c('0x17'));var client=jayson['client'][_0x587c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3fa018,_0x17ed2d,_0xbbbcee,_0x3a3a53){return new BPromise(function(_0x1ab688,_0x4b699c){var _0x329c1d=_0x3a3a53||client;return _0x329c1d['request'](_0x3fa018,_0xbbbcee)['then'](function(_0x3d20d9){logger['info']('VoiceContext,\x20%s,\x20%s',_0x17ed2d,_0x587c('0x19'));logger['debug'](_0x587c('0x1a'),_0x17ed2d,_0x587c('0x19'),JSON[_0x587c('0x1b')](_0x3d20d9));if(_0x3d20d9[_0x587c('0x1c')]){if(_0x3d20d9[_0x587c('0x1c')][_0x587c('0x1d')]===0x1f4){logger[_0x587c('0x1c')](_0x587c('0x1e'),_0x17ed2d,_0x3d20d9[_0x587c('0x1c')][_0x587c('0x1f')]);return _0x4b699c(_0x3d20d9[_0x587c('0x1c')][_0x587c('0x1f')]);}logger[_0x587c('0x1c')](_0x587c('0x1e'),_0x17ed2d,_0x3d20d9[_0x587c('0x1c')][_0x587c('0x1f')]);return _0x1ab688(_0x3d20d9[_0x587c('0x1c')]['message']);}else{logger[_0x587c('0x20')](_0x587c('0x1e'),_0x17ed2d,_0x587c('0x19'));_0x1ab688(_0x3d20d9[_0x587c('0x21')][_0x587c('0x1f')]);}})[_0x587c('0x22')](function(_0x3483fb){logger[_0x587c('0x1c')](_0x587c('0x1e'),_0x17ed2d,_0x3483fb);_0x4b699c(_0x3483fb);});});}function respondWithStatusCode(_0x4ce911,_0x4d87e7){_0x4d87e7=_0x4d87e7||0xcc;return function(_0x5b3a7f){if(_0x5b3a7f){return _0x4ce911['sendStatus'](_0x4d87e7);}return _0x4ce911[_0x587c('0x23')](_0x4d87e7)[_0x587c('0x24')]();};}function respondWithResult(_0x2da1f7,_0x360f17){_0x360f17=_0x360f17||0xc8;return function(_0x204a09){if(_0x204a09){return _0x2da1f7[_0x587c('0x23')](_0x360f17)[_0x587c('0x25')](_0x204a09);}};}function respondWithFilteredResult(_0x1d4004,_0x194e38){return function(_0x5db85e){if(_0x5db85e){var _0x30a0bf=typeof _0x194e38[_0x587c('0x26')]==='undefined'&&typeof _0x194e38[_0x587c('0x27')]==='undefined';var _0x10a6b1=_0x5db85e[_0x587c('0x28')];var _0x52fbc6=_0x30a0bf?0x0:_0x194e38[_0x587c('0x26')];var _0x5897f5=_0x30a0bf?_0x5db85e['count']:_0x194e38[_0x587c('0x26')]+_0x194e38[_0x587c('0x27')];var _0x1436dc;if(_0x5897f5>=_0x10a6b1){_0x5897f5=_0x10a6b1;_0x1436dc=0xc8;}else{_0x1436dc=0xce;}_0x1d4004[_0x587c('0x23')](_0x1436dc);return _0x1d4004['set'](_0x587c('0x29'),_0x52fbc6+'-'+_0x5897f5+'/'+_0x10a6b1)[_0x587c('0x25')](_0x5db85e);}return null;};}function patchUpdates(_0x18de35){return function(_0x2d2ebf){try{jsonpatch[_0x587c('0x2a')](_0x2d2ebf,_0x18de35,!![]);}catch(_0x10f9c6){return BPromise[_0x587c('0x2b')](_0x10f9c6);}return _0x2d2ebf[_0x587c('0x2c')]();};}function saveUpdates(_0x1a202a,_0x36afb4){return function(_0x16a5f1){if(_0x16a5f1){return _0x16a5f1[_0x587c('0x2d')](_0x1a202a)[_0x587c('0x2e')](function(_0x27a94e){return _0x27a94e;});}return null;};}function removeEntity(_0x2cba4e,_0x428823){return function(_0x388584){if(_0x388584){return _0x388584[_0x587c('0x2f')]()[_0x587c('0x2e')](function(){var _0x1b18dd=_0x388584[_0x587c('0x30')]({'plain':!![]});var _0x10ecf7=_0x587c('0x31');return db['UserProfileResource'][_0x587c('0x2f')]({'where':{'type':_0x10ecf7,'resourceId':_0x1b18dd['id']}})['then'](function(){return _0x388584;});})['then'](function(){_0x2cba4e['status'](0xcc)[_0x587c('0x24')]();});}};}function handleEntityNotFound(_0x2a78a6,_0x375c45){return function(_0x280a47){if(!_0x280a47){_0x2a78a6[_0x587c('0x32')](0x194);}return _0x280a47;};}function handleError(_0x57b3e2,_0x29c899){_0x29c899=_0x29c899||0x1f4;return function(_0x27a9fd){logger[_0x587c('0x1c')](_0x27a9fd['stack']);if(_0x27a9fd[_0x587c('0x33')]){delete _0x27a9fd[_0x587c('0x33')];}_0x57b3e2[_0x587c('0x23')](_0x29c899)[_0x587c('0x34')](_0x27a9fd);};}exports[_0x587c('0x35')]=function(_0x4fbfb1,_0xed5733){var _0x30de90={},_0x2d6f72={},_0x2baaa4={'count':0x0,'rows':[]};var _0x3d37b2=_[_0x587c('0x36')](db[_0x587c('0x37')][_0x587c('0x38')],function(_0x10c468){return{'name':_0x10c468[_0x587c('0x39')],'type':_0x10c468[_0x587c('0x3a')][_0x587c('0x3b')]};});_0x2d6f72[_0x587c('0x3c')]=_['map'](_0x3d37b2,_0x587c('0x33'));_0x2d6f72[_0x587c('0x3d')]=_[_0x587c('0x3e')](_0x4fbfb1[_0x587c('0x3d')]);_0x2d6f72[_0x587c('0x3f')]=_[_0x587c('0x40')](_0x2d6f72['model'],_0x2d6f72['query']);_0x30de90[_0x587c('0x41')]=_[_0x587c('0x40')](_0x2d6f72[_0x587c('0x3c')],qs[_0x587c('0x42')](_0x4fbfb1[_0x587c('0x3d')][_0x587c('0x42')]));_0x30de90[_0x587c('0x41')]=_0x30de90[_0x587c('0x41')][_0x587c('0x43')]?_0x30de90[_0x587c('0x41')]:_0x2d6f72['model'];if(!_0x4fbfb1[_0x587c('0x3d')][_0x587c('0x44')](_0x587c('0x45'))){_0x30de90[_0x587c('0x27')]=qs['limit'](_0x4fbfb1[_0x587c('0x3d')][_0x587c('0x27')]);_0x30de90[_0x587c('0x26')]=qs[_0x587c('0x26')](_0x4fbfb1[_0x587c('0x3d')]['offset']);}_0x30de90[_0x587c('0x46')]=qs[_0x587c('0x47')](_0x4fbfb1[_0x587c('0x3d')][_0x587c('0x47')]);_0x30de90[_0x587c('0x48')]=qs['filters'](_[_0x587c('0x49')](_0x4fbfb1[_0x587c('0x3d')],_0x2d6f72[_0x587c('0x3f')]),_0x3d37b2);if(_0x4fbfb1[_0x587c('0x3d')]['filter']){_0x30de90[_0x587c('0x48')]=_[_0x587c('0x4a')](_0x30de90['where'],{'$or':_[_0x587c('0x36')](_0x3d37b2,function(_0x3063ae){if(_0x3063ae[_0x587c('0x3a')]!==_0x587c('0x4b')){var _0x4e8869={};_0x4e8869[_0x3063ae[_0x587c('0x33')]]={'$like':'%'+_0x4fbfb1[_0x587c('0x3d')][_0x587c('0x4c')]+'%'};return _0x4e8869;}})});}_0x30de90=_['merge']({},_0x30de90,_0x4fbfb1[_0x587c('0x4d')]);var _0x5a12f8={'where':_0x30de90['where']};return db[_0x587c('0x37')]['count'](_0x5a12f8)[_0x587c('0x2e')](function(_0x355c82){_0x2baaa4[_0x587c('0x28')]=_0x355c82;if(_0x4fbfb1['query'][_0x587c('0x4e')]){_0x30de90['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x30de90);})[_0x587c('0x2e')](function(_0x3c15b1){_0x2baaa4['rows']=_0x3c15b1;return _0x2baaa4;})[_0x587c('0x2e')](respondWithFilteredResult(_0xed5733,_0x30de90))[_0x587c('0x22')](handleError(_0xed5733,null));};exports[_0x587c('0x4f')]=function(_0x4ea546,_0x35637c){var _0x46bb9a={'raw':![],'where':{'id':_0x4ea546[_0x587c('0x50')]['id']}},_0x28bb53={};_0x28bb53['model']=_[_0x587c('0x3e')](db[_0x587c('0x37')][_0x587c('0x38')]);_0x28bb53[_0x587c('0x3d')]=_['keys'](_0x4ea546['query']);_0x28bb53[_0x587c('0x3f')]=_[_0x587c('0x40')](_0x28bb53[_0x587c('0x3c')],_0x28bb53[_0x587c('0x3d')]);_0x46bb9a['attributes']=_[_0x587c('0x40')](_0x28bb53[_0x587c('0x3c')],qs[_0x587c('0x42')](_0x4ea546['query'][_0x587c('0x42')]));_0x46bb9a['attributes']=_0x46bb9a[_0x587c('0x41')]['length']?_0x46bb9a['attributes']:_0x28bb53[_0x587c('0x3c')];if(_0x4ea546[_0x587c('0x3d')][_0x587c('0x4e')]){_0x46bb9a[_0x587c('0x51')]=[{'all':!![]}];}_0x46bb9a=_[_0x587c('0x4a')]({},_0x46bb9a,_0x4ea546[_0x587c('0x4d')]);return db['VoiceContext'][_0x587c('0x52')](_0x46bb9a)[_0x587c('0x2e')](handleEntityNotFound(_0x35637c,null))[_0x587c('0x2e')](respondWithResult(_0x35637c,null))['catch'](handleError(_0x35637c,null));};exports[_0x587c('0x53')]=function(_0x5af428,_0x425342,_0x438b0c){var _0x1c1be5;return db[_0x587c('0x37')][_0x587c('0x53')](_0x5af428['body'],{'raw':!![]})[_0x587c('0x2e')](function(_0x2b9f18){_0x1c1be5=_0x2b9f18;return db[_0x587c('0x37')][_0x587c('0x54')]({'raw':!![]});})[_0x587c('0x2e')](function(_0xb9e170){var _0x25cf5e=fs[_0x587c('0x55')](path[_0x587c('0x56')](config[_0x587c('0x57')],_0x587c('0x58')),_0x587c('0x59'));var _0x45f95a=ejs[_0x587c('0x5a')](_0x25cf5e,{'contexts':_0xb9e170||[]});fs['writeFileSync'](_0x587c('0x5b'),_0x45f95a);})[_0x587c('0x2e')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})['then'](function(){var _0x270f15=_0x5af428[_0x587c('0x5c')][_0x587c('0x30')]({'plain':!![]});if(!_0x270f15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x270f15['role']===_0x587c('0x5c')){var _0x418674=_0x1c1be5[_0x587c('0x30')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x587c('0x31'),'userProfileId':_0x270f15[_0x587c('0x5d')]},'raw':!![]})[_0x587c('0x2e')](function(_0x28f0b8){if(_0x28f0b8&&_0x28f0b8[_0x587c('0x5e')]===0x0){return db['UserProfileResource'][_0x587c('0x53')]({'name':_0x418674['name'],'resourceId':_0x418674['id'],'type':_0x28f0b8[_0x587c('0x33')],'sectionId':_0x28f0b8['id']},{})[_0x587c('0x2e')](function(){return _0x1c1be5;});}else{return _0x1c1be5;}})[_0x587c('0x22')](function(_0x4a04d8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a04d8);throw _0x4a04d8;});}return _0x1c1be5;})[_0x587c('0x2e')](respondWithResult(_0x425342,0xc9))['catch'](handleError(_0x425342,null));};exports['update']=function(_0x10238f,_0xe565ed,_0xb88261){var _0x2d752d;return db['VoiceContext']['find']({'where':{'id':_0x10238f[_0x587c('0x50')]['id']}})[_0x587c('0x2e')](handleEntityNotFound(_0xe565ed,null))[_0x587c('0x2e')](saveUpdates(_0x10238f[_0x587c('0x5f')],null))[_0x587c('0x2e')](function(_0x4f3983){if(_0x4f3983){_0x2d752d=_0x4f3983;return db[_0x587c('0x37')]['findAll']({'raw':!![]});}})[_0x587c('0x2e')](function(_0x4e8d3c){var _0x448d87=fs[_0x587c('0x55')](path['join'](config[_0x587c('0x57')],'server/files/templates/context.ejs'),_0x587c('0x59'));var _0x16c631=ejs[_0x587c('0x5a')](_0x448d87,{'contexts':_0x4e8d3c||[]});fs[_0x587c('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x16c631);})[_0x587c('0x2e')](function(){return respondWithRpcPromise(_0x587c('0x61'),'update',{'module':_0x587c('0x62')});})[_0x587c('0x2e')](function(){return _0x2d752d;})[_0x587c('0x2e')](respondWithResult(_0xe565ed,null))[_0x587c('0x22')](handleError(_0xe565ed,null));};exports['destroy']=function(_0x341d8c,_0x492f24,_0x231cb7){var _0x50d9f2;return db[_0x587c('0x37')][_0x587c('0x52')]({'where':{'id':_0x341d8c[_0x587c('0x50')]['id']}})['then'](handleEntityNotFound(_0x492f24,null))[_0x587c('0x2e')](removeEntity(_0x492f24,null))[_0x587c('0x2e')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x587c('0x2e')](function(_0x3893eb){var _0x319b44=fs[_0x587c('0x55')](path[_0x587c('0x56')](config[_0x587c('0x57')],_0x587c('0x58')),'utf8');var _0x5c169a=ejs['render'](_0x319b44,{'contexts':_0x3893eb});fs[_0x587c('0x60')](_0x587c('0x5b'),_0x5c169a);return respondWithRpcPromise(_0x587c('0x61'),'destroy',{'module':_0x587c('0x62')});})[_0x587c('0x22')](handleError(_0x492f24,null));}; \ No newline at end of file +var _0xca47=['client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','destroy','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','type','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','root','writeFileSync','params','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','jayson/promise'];(function(_0x2c3cfb,_0x411a75){var _0x4495b6=function(_0x5ae84f){while(--_0x5ae84f){_0x2c3cfb['push'](_0x2c3cfb['shift']());}};_0x4495b6(++_0x411a75);}(_0xca47,0xb1));var _0x7ca4=function(_0x21c857,_0x1f9812){_0x21c857=_0x21c857-0x0;var _0x2e6516=_0xca47[_0x21c857];return _0x2e6516;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ca4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ca4('0x1'));var rp=require(_0x7ca4('0x2'));var moment=require(_0x7ca4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7ca4('0x4'));var path=require(_0x7ca4('0x5'));var sox=require(_0x7ca4('0x6'));var csv=require('to-csv');var ejs=require(_0x7ca4('0x7'));var fs=require('fs');var fs_extra=require(_0x7ca4('0x8'));var _=require('lodash');var squel=require(_0x7ca4('0x9'));var crypto=require(_0x7ca4('0xa'));var jsforce=require(_0x7ca4('0xb'));var deskjs=require(_0x7ca4('0xc'));var toCsv=require(_0x7ca4('0xd'));var querystring=require(_0x7ca4('0xe'));var Papa=require('papaparse');var Redis=require(_0x7ca4('0xf'));var authService=require(_0x7ca4('0x10'));var qs=require(_0x7ca4('0x11'));var as=require(_0x7ca4('0x12'));var hardwareService=require(_0x7ca4('0x13'));var logger=require('../../config/logger')(_0x7ca4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ca4('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7ca4('0x16'));var client=jayson[_0x7ca4('0x17')][_0x7ca4('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x10cbb9,_0x21130e,_0x559233,_0x2a037d){return new BPromise(function(_0x56d7fd,_0x2f96e2){var _0x11842e=_0x2a037d||client;return _0x11842e[_0x7ca4('0x19')](_0x10cbb9,_0x559233)[_0x7ca4('0x1a')](function(_0x400df5){logger['info'](_0x7ca4('0x1b'),_0x21130e,'request\x20sent');logger[_0x7ca4('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x21130e,_0x7ca4('0x1d'),JSON[_0x7ca4('0x1e')](_0x400df5));if(_0x400df5[_0x7ca4('0x1f')]){if(_0x400df5[_0x7ca4('0x1f')][_0x7ca4('0x20')]===0x1f4){logger[_0x7ca4('0x1f')](_0x7ca4('0x1b'),_0x21130e,_0x400df5[_0x7ca4('0x1f')]['message']);return _0x2f96e2(_0x400df5[_0x7ca4('0x1f')][_0x7ca4('0x21')]);}logger['error'](_0x7ca4('0x1b'),_0x21130e,_0x400df5['error'][_0x7ca4('0x21')]);return _0x56d7fd(_0x400df5[_0x7ca4('0x1f')][_0x7ca4('0x21')]);}else{logger[_0x7ca4('0x22')](_0x7ca4('0x1b'),_0x21130e,_0x7ca4('0x1d'));_0x56d7fd(_0x400df5[_0x7ca4('0x23')]['message']);}})[_0x7ca4('0x24')](function(_0x523de5){logger[_0x7ca4('0x1f')](_0x7ca4('0x1b'),_0x21130e,_0x523de5);_0x2f96e2(_0x523de5);});});}function respondWithStatusCode(_0xad0738,_0x3ba9ce){_0x3ba9ce=_0x3ba9ce||0xcc;return function(_0x1f8894){if(_0x1f8894){return _0xad0738[_0x7ca4('0x25')](_0x3ba9ce);}return _0xad0738[_0x7ca4('0x26')](_0x3ba9ce)[_0x7ca4('0x27')]();};}function respondWithResult(_0x11bc3e,_0x483a17){_0x483a17=_0x483a17||0xc8;return function(_0x2f4a02){if(_0x2f4a02){return _0x11bc3e[_0x7ca4('0x26')](_0x483a17)[_0x7ca4('0x28')](_0x2f4a02);}};}function respondWithFilteredResult(_0x19442a,_0x3371fe){return function(_0x121b84){if(_0x121b84){var _0x40ee4b=typeof _0x3371fe[_0x7ca4('0x29')]===_0x7ca4('0x2a')&&typeof _0x3371fe['limit']===_0x7ca4('0x2a');var _0x5241af=_0x121b84['count'];var _0x427e50=_0x40ee4b?0x0:_0x3371fe[_0x7ca4('0x29')];var _0x49d29e=_0x40ee4b?_0x121b84[_0x7ca4('0x2b')]:_0x3371fe['offset']+_0x3371fe[_0x7ca4('0x2c')];var _0xcd7314;if(_0x49d29e>=_0x5241af){_0x49d29e=_0x5241af;_0xcd7314=0xc8;}else{_0xcd7314=0xce;}_0x19442a[_0x7ca4('0x26')](_0xcd7314);return _0x19442a['set'](_0x7ca4('0x2d'),_0x427e50+'-'+_0x49d29e+'/'+_0x5241af)[_0x7ca4('0x28')](_0x121b84);}return null;};}function patchUpdates(_0x4a3543){return function(_0x584e23){try{jsonpatch['apply'](_0x584e23,_0x4a3543,!![]);}catch(_0x393faf){return BPromise[_0x7ca4('0x2e')](_0x393faf);}return _0x584e23['save']();};}function saveUpdates(_0x57154d,_0x2bb4ea){return function(_0x15968e){if(_0x15968e){return _0x15968e['update'](_0x57154d)['then'](function(_0xa6bdac){return _0xa6bdac;});}return null;};}function removeEntity(_0x14b356,_0x11c108){return function(_0x169e35){if(_0x169e35){return _0x169e35[_0x7ca4('0x2f')]()[_0x7ca4('0x1a')](function(){var _0x43d765=_0x169e35['get']({'plain':!![]});var _0x60467c=_0x7ca4('0x30');return db[_0x7ca4('0x31')][_0x7ca4('0x2f')]({'where':{'type':_0x60467c,'resourceId':_0x43d765['id']}})['then'](function(){return _0x169e35;});})[_0x7ca4('0x1a')](function(){_0x14b356['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a7c5,_0x3b454b){return function(_0x59d0db){if(!_0x59d0db){_0x47a7c5[_0x7ca4('0x25')](0x194);}return _0x59d0db;};}function handleError(_0x2ca761,_0x5217c7){_0x5217c7=_0x5217c7||0x1f4;return function(_0x3900f5){logger[_0x7ca4('0x1f')](_0x3900f5[_0x7ca4('0x32')]);if(_0x3900f5[_0x7ca4('0x33')]){delete _0x3900f5[_0x7ca4('0x33')];}_0x2ca761[_0x7ca4('0x26')](_0x5217c7)['send'](_0x3900f5);};}exports[_0x7ca4('0x34')]=function(_0x213cb7,_0x14b8f1){var _0x356831={},_0x3d97d={},_0x655e39={'count':0x0,'rows':[]};var _0x4bd49e=_[_0x7ca4('0x35')](db[_0x7ca4('0x36')][_0x7ca4('0x37')],function(_0x125ec9){return{'name':_0x125ec9['fieldName'],'type':_0x125ec9[_0x7ca4('0x38')]['key']};});_0x3d97d[_0x7ca4('0x39')]=_[_0x7ca4('0x35')](_0x4bd49e,_0x7ca4('0x33'));_0x3d97d[_0x7ca4('0x3a')]=_['keys'](_0x213cb7[_0x7ca4('0x3a')]);_0x3d97d['filters']=_['intersection'](_0x3d97d[_0x7ca4('0x39')],_0x3d97d['query']);_0x356831[_0x7ca4('0x3b')]=_[_0x7ca4('0x3c')](_0x3d97d['model'],qs[_0x7ca4('0x3d')](_0x213cb7[_0x7ca4('0x3a')]['fields']));_0x356831[_0x7ca4('0x3b')]=_0x356831[_0x7ca4('0x3b')][_0x7ca4('0x3e')]?_0x356831[_0x7ca4('0x3b')]:_0x3d97d[_0x7ca4('0x39')];if(!_0x213cb7[_0x7ca4('0x3a')]['hasOwnProperty'](_0x7ca4('0x3f'))){_0x356831[_0x7ca4('0x2c')]=qs[_0x7ca4('0x2c')](_0x213cb7[_0x7ca4('0x3a')][_0x7ca4('0x2c')]);_0x356831['offset']=qs['offset'](_0x213cb7[_0x7ca4('0x3a')][_0x7ca4('0x29')]);}_0x356831[_0x7ca4('0x40')]=qs[_0x7ca4('0x41')](_0x213cb7['query'][_0x7ca4('0x41')]);_0x356831[_0x7ca4('0x42')]=qs[_0x7ca4('0x43')](_[_0x7ca4('0x44')](_0x213cb7['query'],_0x3d97d[_0x7ca4('0x43')]),_0x4bd49e);if(_0x213cb7['query']['filter']){_0x356831[_0x7ca4('0x42')]=_[_0x7ca4('0x45')](_0x356831[_0x7ca4('0x42')],{'$or':_[_0x7ca4('0x35')](_0x4bd49e,function(_0x47cf84){if(_0x47cf84[_0x7ca4('0x38')]!==_0x7ca4('0x46')){var _0x3e333a={};_0x3e333a[_0x47cf84[_0x7ca4('0x33')]]={'$like':'%'+_0x213cb7['query']['filter']+'%'};return _0x3e333a;}})});}_0x356831=_['merge']({},_0x356831,_0x213cb7[_0x7ca4('0x47')]);var _0x2b0539={'where':_0x356831[_0x7ca4('0x42')]};return db[_0x7ca4('0x36')][_0x7ca4('0x2b')](_0x2b0539)['then'](function(_0x54058f){_0x655e39[_0x7ca4('0x2b')]=_0x54058f;if(_0x213cb7[_0x7ca4('0x3a')]['includeAll']){_0x356831[_0x7ca4('0x48')]=[{'all':!![]}];}return db[_0x7ca4('0x36')][_0x7ca4('0x49')](_0x356831);})['then'](function(_0x287147){_0x655e39[_0x7ca4('0x4a')]=_0x287147;return _0x655e39;})[_0x7ca4('0x1a')](respondWithFilteredResult(_0x14b8f1,_0x356831))['catch'](handleError(_0x14b8f1,null));};exports['show']=function(_0x2de161,_0x11cb37){var _0x5c47c9={'raw':![],'where':{'id':_0x2de161['params']['id']}},_0x2573b5={};_0x2573b5[_0x7ca4('0x39')]=_[_0x7ca4('0x4b')](db[_0x7ca4('0x36')]['rawAttributes']);_0x2573b5['query']=_['keys'](_0x2de161['query']);_0x2573b5['filters']=_[_0x7ca4('0x3c')](_0x2573b5['model'],_0x2573b5[_0x7ca4('0x3a')]);_0x5c47c9[_0x7ca4('0x3b')]=_[_0x7ca4('0x3c')](_0x2573b5[_0x7ca4('0x39')],qs[_0x7ca4('0x3d')](_0x2de161[_0x7ca4('0x3a')]['fields']));_0x5c47c9[_0x7ca4('0x3b')]=_0x5c47c9[_0x7ca4('0x3b')][_0x7ca4('0x3e')]?_0x5c47c9['attributes']:_0x2573b5[_0x7ca4('0x39')];if(_0x2de161[_0x7ca4('0x3a')][_0x7ca4('0x4c')]){_0x5c47c9[_0x7ca4('0x48')]=[{'all':!![]}];}_0x5c47c9=_[_0x7ca4('0x45')]({},_0x5c47c9,_0x2de161[_0x7ca4('0x47')]);return db[_0x7ca4('0x36')][_0x7ca4('0x4d')](_0x5c47c9)['then'](handleEntityNotFound(_0x11cb37,null))[_0x7ca4('0x1a')](respondWithResult(_0x11cb37,null))[_0x7ca4('0x24')](handleError(_0x11cb37,null));};exports[_0x7ca4('0x4e')]=function(_0x23bf58,_0x39c9aa,_0x4c0dc9){var _0x2c3560;return db['VoiceContext']['create'](_0x23bf58[_0x7ca4('0x4f')],{'raw':!![]})[_0x7ca4('0x1a')](function(_0xaf0f72){_0x2c3560=_0xaf0f72;return db['VoiceContext'][_0x7ca4('0x49')]({'raw':!![]});})[_0x7ca4('0x1a')](function(_0x4a41cd){var _0xaf6c3a=fs[_0x7ca4('0x50')](path[_0x7ca4('0x51')](config['root'],_0x7ca4('0x52')),_0x7ca4('0x53'));var _0x533b55=ejs[_0x7ca4('0x54')](_0xaf6c3a,{'contexts':_0x4a41cd||[]});fs['writeFileSync'](_0x7ca4('0x55'),_0x533b55);})['then'](function(){return respondWithRpcPromise(_0x7ca4('0x56'),_0x7ca4('0x4e'),{'module':_0x7ca4('0x57')});})[_0x7ca4('0x1a')](function(){var _0x569ff1=_0x23bf58[_0x7ca4('0x58')][_0x7ca4('0x59')]({'plain':!![]});if(!_0x569ff1)throw new Error(_0x7ca4('0x5a'));if(_0x569ff1[_0x7ca4('0x5b')]==='user'){var _0x55c142=_0x2c3560[_0x7ca4('0x59')]({'plain':!![]});return db[_0x7ca4('0x5c')]['find']({'where':{'name':'Contexts','userProfileId':_0x569ff1[_0x7ca4('0x5d')]},'raw':!![]})[_0x7ca4('0x1a')](function(_0x56dac4){if(_0x56dac4&&_0x56dac4[_0x7ca4('0x5e')]===0x0){return db['UserProfileResource'][_0x7ca4('0x4e')]({'name':_0x55c142[_0x7ca4('0x33')],'resourceId':_0x55c142['id'],'type':_0x56dac4[_0x7ca4('0x33')],'sectionId':_0x56dac4['id']},{})[_0x7ca4('0x1a')](function(){return _0x2c3560;});}else{return _0x2c3560;}})['catch'](function(_0x2ad813){logger[_0x7ca4('0x1f')](_0x7ca4('0x5f'),_0x2ad813);throw _0x2ad813;});}return _0x2c3560;})[_0x7ca4('0x1a')](respondWithResult(_0x39c9aa,0xc9))['catch'](handleError(_0x39c9aa,null));};exports[_0x7ca4('0x60')]=function(_0x358111,_0x525e5c,_0x13e63a){var _0x31ca97;return db[_0x7ca4('0x36')][_0x7ca4('0x4d')]({'where':{'id':_0x358111['params']['id']}})['then'](handleEntityNotFound(_0x525e5c,null))[_0x7ca4('0x1a')](saveUpdates(_0x358111[_0x7ca4('0x4f')],null))[_0x7ca4('0x1a')](function(_0x249015){if(_0x249015){_0x31ca97=_0x249015;return db[_0x7ca4('0x36')][_0x7ca4('0x49')]({'raw':!![]});}})['then'](function(_0x524fed){var _0xe495ac=fs[_0x7ca4('0x50')](path[_0x7ca4('0x51')](config[_0x7ca4('0x61')],_0x7ca4('0x52')),_0x7ca4('0x53'));var _0x4df46f=ejs['render'](_0xe495ac,{'contexts':_0x524fed||[]});fs[_0x7ca4('0x62')](_0x7ca4('0x55'),_0x4df46f);})['then'](function(){return respondWithRpcPromise('Reload',_0x7ca4('0x60'),{'module':_0x7ca4('0x57')});})['then'](function(){return _0x31ca97;})[_0x7ca4('0x1a')](respondWithResult(_0x525e5c,null))['catch'](handleError(_0x525e5c,null));};exports[_0x7ca4('0x2f')]=function(_0x4a4046,_0x59ee1b,_0xb843a9){var _0x4dbc05;return db['VoiceContext'][_0x7ca4('0x4d')]({'where':{'id':_0x4a4046[_0x7ca4('0x63')]['id']}})[_0x7ca4('0x1a')](handleEntityNotFound(_0x59ee1b,null))[_0x7ca4('0x1a')](removeEntity(_0x59ee1b,null))['then'](function(){return db[_0x7ca4('0x36')][_0x7ca4('0x49')]({'raw':!![]});})['then'](function(_0x523b5c){var _0x359f0c=fs[_0x7ca4('0x50')](path[_0x7ca4('0x51')](config[_0x7ca4('0x61')],_0x7ca4('0x52')),_0x7ca4('0x53'));var _0x582e1f=ejs[_0x7ca4('0x54')](_0x359f0c,{'contexts':_0x523b5c});fs['writeFileSync'](_0x7ca4('0x55'),_0x582e1f);return respondWithRpcPromise(_0x7ca4('0x56'),_0x7ca4('0x2f'),{'module':'chan_sip.so'});})[_0x7ca4('0x24')](handleError(_0x59ee1b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 6e3ab2d..7de02d1 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 _0xa283=['api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','voice_contexts','lodash','util'];(function(_0x476068,_0x6f216e){var _0x4887b7=function(_0xe9f9c7){while(--_0xe9f9c7){_0x476068['push'](_0x476068['shift']());}};_0x4887b7(++_0x6f216e);}(_0xa283,0x8e));var _0x3a28=function(_0x38635b,_0x498fd0){_0x38635b=_0x38635b-0x0;var _0x463ef2=_0xa283[_0x38635b];return _0x463ef2;};'use strict';var _=require(_0x3a28('0x0'));var util=require(_0x3a28('0x1'));var logger=require('../../config/logger')(_0x3a28('0x2'));var moment=require(_0x3a28('0x3'));var BPromise=require(_0x3a28('0x4'));var rp=require(_0x3a28('0x5'));var fs=require('fs');var path=require(_0x3a28('0x6'));var rimraf=require(_0x3a28('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a28('0x8'));module[_0x3a28('0x9')]=function(_0x4a8ea5,_0x947916){return _0x4a8ea5[_0x3a28('0xa')]('VoiceContext',attributes,{'tableName':_0x3a28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a34=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','moment','bluebird','path'];(function(_0x389ee4,_0x4f3f4a){var _0x513fd4=function(_0x160022){while(--_0x160022){_0x389ee4['push'](_0x389ee4['shift']());}};_0x513fd4(++_0x4f3f4a);}(_0x8a34,0x127));var _0x48a3=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x8a34[_0x11a55c];return _0x26c390;};'use strict';var _=require(_0x48a3('0x0'));var util=require(_0x48a3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x48a3('0x2'));var BPromise=require(_0x48a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48a3('0x4'));var rimraf=require(_0x48a3('0x5'));var config=require(_0x48a3('0x6'));var attributes=require(_0x48a3('0x7'));module[_0x48a3('0x8')]=function(_0x237884,_0x5e51a7){return _0x237884[_0x48a3('0x9')](_0x48a3('0xa'),attributes,{'tableName':_0x48a3('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 d9a5e20..62b74fa 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 _0x6554=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4677d6,_0x2bcf30){var _0xfebb8d=function(_0x70b665){while(--_0x70b665){_0x4677d6['push'](_0x4677d6['shift']());}};_0xfebb8d(++_0x2bcf30);}(_0x6554,0x181));var _0x4655=function(_0x3c2e0c,_0x62ca5f){_0x3c2e0c=_0x3c2e0c-0x0;var _0xa67634=_0x6554[_0x3c2e0c];return _0xa67634;};'use strict';var _=require(_0x4655('0x0'));var util=require(_0x4655('0x1'));var moment=require(_0x4655('0x2'));var BPromise=require(_0x4655('0x3'));var rs=require(_0x4655('0x4'));var fs=require('fs');var Redis=require(_0x4655('0x5'));var db=require(_0x4655('0x6'))['db'];var utils=require(_0x4655('0x7'));var logger=require(_0x4655('0x8'))(_0x4655('0x9'));var config=require(_0x4655('0xa'));var jayson=require(_0x4655('0xb'));var client=jayson['client'][_0x4655('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6de5f,_0x44d77e,_0x46567d){return new BPromise(function(_0x44cc86,_0x3ae259){return client[_0x4655('0xd')](_0x6de5f,_0x46567d)[_0x4655('0xe')](function(_0x1b3e4){logger['info'](_0x4655('0xf'),_0x44d77e,_0x4655('0x10'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x44d77e,'request\x20sent',JSON[_0x4655('0x11')](_0x1b3e4));if(_0x1b3e4[_0x4655('0x12')]){if(_0x1b3e4[_0x4655('0x12')][_0x4655('0x13')]===0x1f4){logger[_0x4655('0x12')](_0x4655('0xf'),_0x44d77e,_0x1b3e4['error']['message']);return _0x3ae259(_0x1b3e4[_0x4655('0x12')][_0x4655('0x14')]);}logger[_0x4655('0x12')](_0x4655('0xf'),_0x44d77e,_0x1b3e4[_0x4655('0x12')][_0x4655('0x14')]);return _0x44cc86(_0x1b3e4[_0x4655('0x12')][_0x4655('0x14')]);}else{logger[_0x4655('0x15')]('VoiceContext,\x20%s,\x20%s',_0x44d77e,_0x4655('0x10'));_0x44cc86(_0x1b3e4[_0x4655('0x16')]['message']);}})[_0x4655('0x17')](function(_0x13b714){logger['error']('VoiceContext,\x20%s,\x20%s',_0x44d77e,_0x13b714);_0x3ae259(_0x13b714);});});} \ No newline at end of file +var _0x3eae=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eae,0x126));var _0xe3ea=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x3eae[_0x3d38ae];return _0x3757ee;};'use strict';var _=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var moment=require(_0xe3ea('0x2'));var BPromise=require(_0xe3ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ea('0x4'));var db=require(_0xe3ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ea('0x6'))(_0xe3ea('0x7'));var config=require(_0xe3ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3ea('0x9')][_0xe3ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x216558,_0x14394e,_0x106123){return new BPromise(function(_0x2cc86f,_0x58ee6b){return client[_0xe3ea('0xb')](_0x216558,_0x106123)[_0xe3ea('0xc')](function(_0x58f4c2){logger[_0xe3ea('0xd')](_0xe3ea('0xe'),_0x14394e,_0xe3ea('0xf'));logger[_0xe3ea('0x10')](_0xe3ea('0x11'),_0x14394e,'request\x20sent',JSON[_0xe3ea('0x12')](_0x58f4c2));if(_0x58f4c2[_0xe3ea('0x13')]){if(_0x58f4c2[_0xe3ea('0x13')]['code']===0x1f4){logger[_0xe3ea('0x13')](_0xe3ea('0xe'),_0x14394e,_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);return _0x58ee6b(_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x14394e,_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);return _0x2cc86f(_0x58f4c2[_0xe3ea('0x13')][_0xe3ea('0x14')]);}else{logger[_0xe3ea('0xd')]('VoiceContext,\x20%s,\x20%s',_0x14394e,'request\x20sent');_0x2cc86f(_0x58f4c2[_0xe3ea('0x15')][_0xe3ea('0x14')]);}})['catch'](function(_0x1d2f47){logger[_0xe3ea('0x13')]('VoiceContext,\x20%s,\x20%s',_0x14394e,_0x1d2f47);_0x58ee6b(_0x1d2f47);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 7ae7153..a65900c 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 _0x0628=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0628,0x173));var _0x8062=function(_0x3eecf1,_0x2b990e){_0x3eecf1=_0x3eecf1-0x0;var _0x3429ca=_0x0628[_0x3eecf1];return _0x3429ca;};'use strict';var multer=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var path=require(_0x8062('0x2'));var timeout=require('connect-timeout');var express=require(_0x8062('0x3'));var router=express[_0x8062('0x4')]();var fs_extra=require(_0x8062('0x5'));var auth=require(_0x8062('0x6'));var interaction=require(_0x8062('0x7'));var config=require(_0x8062('0x8'));var controller=require(_0x8062('0x9'));router[_0x8062('0xa')]('/',auth['isAuthenticated'](),controller[_0x8062('0xb')]);router[_0x8062('0xa')](_0x8062('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x8062('0xa')](_0x8062('0xd'),auth[_0x8062('0xe')](),controller[_0x8062('0xf')]);router[_0x8062('0x10')]('/',auth[_0x8062('0xe')](),controller[_0x8062('0x11')]);router[_0x8062('0x12')](_0x8062('0xd'),auth[_0x8062('0xe')](),controller[_0x8062('0x13')]);router[_0x8062('0x14')](_0x8062('0xd'),auth[_0x8062('0xe')](),controller['destroy']);module[_0x8062('0x15')]=router; \ No newline at end of file +var _0x3ef0=['index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2a5421,_0x1b2d0e){var _0x442ef4=function(_0x27118c){while(--_0x27118c){_0x2a5421['push'](_0x2a5421['shift']());}};_0x442ef4(++_0x1b2d0e);}(_0x3ef0,0x19a));var _0x03ef=function(_0x15c57f,_0x4d031f){_0x15c57f=_0x15c57f-0x0;var _0x2a4f13=_0x3ef0[_0x15c57f];return _0x2a4f13;};'use strict';var multer=require(_0x03ef('0x0'));var util=require('util');var path=require(_0x03ef('0x1'));var timeout=require('connect-timeout');var express=require(_0x03ef('0x2'));var router=express['Router']();var fs_extra=require(_0x03ef('0x3'));var auth=require(_0x03ef('0x4'));var interaction=require(_0x03ef('0x5'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x03ef('0x6')]('/',auth[_0x03ef('0x7')](),controller[_0x03ef('0x8')]);router['get'](_0x03ef('0x9'),auth[_0x03ef('0x7')](),controller[_0x03ef('0xa')]);router[_0x03ef('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x03ef('0xb')]);router[_0x03ef('0xc')]('/',auth[_0x03ef('0x7')](),controller['create']);router[_0x03ef('0xd')](_0x03ef('0xe'),auth['isAuthenticated'](),controller[_0x03ef('0xf')]);router[_0x03ef('0x10')](_0x03ef('0xe'),auth['isAuthenticated'](),controller[_0x03ef('0x11')]);module[_0x03ef('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 6e503a9..1116612 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 _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x5e5452,_0x202506){var _0x413850=function(_0x2a4598){while(--_0x2a4598){_0x5e5452['push'](_0x5e5452['shift']());}};_0x413850(++_0x202506);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xf3cd[_0x1e2321];return _0x1d346d;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0xaa23d9,_0x40f2a8){var _0x47f1c5=function(_0x4e6852){while(--_0x4e6852){_0xaa23d9['push'](_0xaa23d9['shift']());}};_0x47f1c5(++_0x40f2a8);}(_0x98a8,0x12c));var _0x898a=function(_0x2e328b,_0xaee134){_0x2e328b=_0x2e328b-0x0;var _0x362d69=_0x98a8[_0x2e328b];return _0x362d69;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 44232e3..80d4aac 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 _0x6528=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','VIRTUAL','merge','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x6528,0x157));var _0x8652=function(_0x2068b3,_0x2c655a){_0x2068b3=_0x2068b3-0x0;var _0x1c2011=_0x6528[_0x2068b3];return _0x1c2011;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8652('0x0'));var zipdir=require(_0x8652('0x1'));var jsonpatch=require(_0x8652('0x2'));var rp=require(_0x8652('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8652('0x4'));var util=require(_0x8652('0x5'));var path=require('path');var sox=require(_0x8652('0x6'));var csv=require(_0x8652('0x7'));var ejs=require(_0x8652('0x8'));var fs=require('fs');var fs_extra=require(_0x8652('0x9'));var _=require(_0x8652('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8652('0xb'));var deskjs=require(_0x8652('0xc'));var toCsv=require(_0x8652('0x7'));var querystring=require(_0x8652('0xd'));var Papa=require(_0x8652('0xe'));var Redis=require('ioredis');var authService=require(_0x8652('0xf'));var qs=require(_0x8652('0x10'));var as=require(_0x8652('0x11'));var hardwareService=require(_0x8652('0x12'));var logger=require(_0x8652('0x13'))(_0x8652('0x14'));var utils=require(_0x8652('0x15'));var config=require(_0x8652('0x16'));var licenseUtil=require(_0x8652('0x17'));var db=require(_0x8652('0x18'))['db'];function respondWithStatusCode(_0xed760d,_0x390d2f){_0x390d2f=_0x390d2f||0xcc;return function(_0x673dd5){if(_0x673dd5){return _0xed760d[_0x8652('0x19')](_0x390d2f);}return _0xed760d['status'](_0x390d2f)[_0x8652('0x1a')]();};}function respondWithResult(_0x47a64e,_0x4c0996){_0x4c0996=_0x4c0996||0xc8;return function(_0x4ebe6b){if(_0x4ebe6b){return _0x47a64e[_0x8652('0x1b')](_0x4c0996)[_0x8652('0x1c')](_0x4ebe6b);}};}function respondWithFilteredResult(_0xa0317,_0x2a2a41){return function(_0x3bb35c){if(_0x3bb35c){var _0x4d67fe=typeof _0x2a2a41[_0x8652('0x1d')]===_0x8652('0x1e')&&typeof _0x2a2a41[_0x8652('0x1f')]===_0x8652('0x1e');var _0x2e7ec8=_0x3bb35c[_0x8652('0x20')];var _0x3069c8=_0x4d67fe?0x0:_0x2a2a41['offset'];var _0x1fb451=_0x4d67fe?_0x3bb35c[_0x8652('0x20')]:_0x2a2a41[_0x8652('0x1d')]+_0x2a2a41[_0x8652('0x1f')];var _0x33455e;if(_0x1fb451>=_0x2e7ec8){_0x1fb451=_0x2e7ec8;_0x33455e=0xc8;}else{_0x33455e=0xce;}_0xa0317[_0x8652('0x1b')](_0x33455e);return _0xa0317[_0x8652('0x21')]('Content-Range',_0x3069c8+'-'+_0x1fb451+'/'+_0x2e7ec8)['json'](_0x3bb35c);}return null;};}function patchUpdates(_0x3df058){return function(_0x346f80){try{jsonpatch[_0x8652('0x22')](_0x346f80,_0x3df058,!![]);}catch(_0x45a88d){return BPromise['reject'](_0x45a88d);}return _0x346f80[_0x8652('0x23')]();};}function saveUpdates(_0xc5df62,_0x435db8){return function(_0x4f70ce){if(_0x4f70ce){return _0x4f70ce[_0x8652('0x24')](_0xc5df62)[_0x8652('0x25')](function(_0x1cbdb2){return _0x1cbdb2;});}return null;};}function removeEntity(_0x421010,_0x4d9e61){return function(_0x57b1e0){if(_0x57b1e0){return _0x57b1e0[_0x8652('0x26')]()[_0x8652('0x25')](function(){_0x421010['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eb5c4,_0x56d03a){return function(_0xde5ffe){if(!_0xde5ffe){_0x2eb5c4[_0x8652('0x19')](0x194);}return _0xde5ffe;};}function handleError(_0x5669f1,_0x1f92b5){_0x1f92b5=_0x1f92b5||0x1f4;return function(_0x7634a){logger[_0x8652('0x27')](_0x7634a[_0x8652('0x28')]);if(_0x7634a[_0x8652('0x29')]){delete _0x7634a[_0x8652('0x29')];}_0x5669f1[_0x8652('0x1b')](_0x1f92b5)[_0x8652('0x2a')](_0x7634a);};}exports[_0x8652('0x2b')]=function(_0x2bb5f5,_0x3b60ca){var _0x574337={},_0x2f6365={},_0x388394={'count':0x0,'rows':[]};var _0x7e82de=_[_0x8652('0x2c')](db['VoiceDialReport'][_0x8652('0x2d')],function(_0x15c456){return{'name':_0x15c456[_0x8652('0x2e')],'type':_0x15c456[_0x8652('0x2f')][_0x8652('0x30')]};});_0x2f6365[_0x8652('0x31')]=_[_0x8652('0x2c')](_0x7e82de,'name');_0x2f6365[_0x8652('0x32')]=_['keys'](_0x2bb5f5['query']);_0x2f6365['filters']=_[_0x8652('0x33')](_0x2f6365['model'],_0x2f6365[_0x8652('0x32')]);_0x574337['attributes']=_['intersection'](_0x2f6365[_0x8652('0x31')],qs['fields'](_0x2bb5f5[_0x8652('0x32')][_0x8652('0x34')]));_0x574337[_0x8652('0x35')]=_0x574337[_0x8652('0x35')][_0x8652('0x36')]?_0x574337['attributes']:_0x2f6365[_0x8652('0x31')];if(!_0x2bb5f5[_0x8652('0x32')][_0x8652('0x37')]('nolimit')){_0x574337[_0x8652('0x1f')]=qs['limit'](_0x2bb5f5['query'][_0x8652('0x1f')]);_0x574337[_0x8652('0x1d')]=qs[_0x8652('0x1d')](_0x2bb5f5[_0x8652('0x32')][_0x8652('0x1d')]);}_0x574337['order']=qs[_0x8652('0x38')](_0x2bb5f5[_0x8652('0x32')][_0x8652('0x38')]);_0x574337[_0x8652('0x39')]=qs['filters'](_[_0x8652('0x3a')](_0x2bb5f5[_0x8652('0x32')],_0x2f6365[_0x8652('0x3b')]),_0x7e82de);if(_0x2bb5f5[_0x8652('0x32')][_0x8652('0x3c')]){_0x574337[_0x8652('0x39')]=_['merge'](_0x574337[_0x8652('0x39')],{'$or':_[_0x8652('0x2c')](_0x7e82de,function(_0x11be4e){if(_0x11be4e[_0x8652('0x2f')]!==_0x8652('0x3d')){var _0x2690d7={};_0x2690d7[_0x11be4e[_0x8652('0x29')]]={'$like':'%'+_0x2bb5f5[_0x8652('0x32')]['filter']+'%'};return _0x2690d7;}})});}_0x574337=_[_0x8652('0x3e')]({},_0x574337,_0x2bb5f5['options']);var _0x3abd0c={'where':_0x574337[_0x8652('0x39')]};return db[_0x8652('0x3f')][_0x8652('0x20')](_0x3abd0c)[_0x8652('0x25')](function(_0x25b1c4){_0x388394['count']=_0x25b1c4;if(_0x2bb5f5['query'][_0x8652('0x40')]){_0x574337[_0x8652('0x41')]=[{'all':!![]}];}return db[_0x8652('0x3f')][_0x8652('0x42')](_0x574337);})['then'](function(_0x197231){_0x388394[_0x8652('0x43')]=_0x197231;return _0x388394;})[_0x8652('0x25')](respondWithFilteredResult(_0x3b60ca,_0x574337))[_0x8652('0x44')](handleError(_0x3b60ca,null));};exports[_0x8652('0x45')]=function(_0x5631a6,_0x87e4c1){var _0x6fcda9={'raw':!![],'where':{'id':_0x5631a6[_0x8652('0x46')]['id']}},_0x3980d5={};_0x3980d5[_0x8652('0x31')]=_[_0x8652('0x47')](db['VoiceDialReport'][_0x8652('0x2d')]);_0x3980d5['query']=_['keys'](_0x5631a6[_0x8652('0x32')]);_0x3980d5['filters']=_[_0x8652('0x33')](_0x3980d5[_0x8652('0x31')],_0x3980d5[_0x8652('0x32')]);_0x6fcda9[_0x8652('0x35')]=_[_0x8652('0x33')](_0x3980d5[_0x8652('0x31')],qs[_0x8652('0x34')](_0x5631a6['query'][_0x8652('0x34')]));_0x6fcda9[_0x8652('0x35')]=_0x6fcda9[_0x8652('0x35')][_0x8652('0x36')]?_0x6fcda9[_0x8652('0x35')]:_0x3980d5[_0x8652('0x31')];if(_0x5631a6['query'][_0x8652('0x40')]){_0x6fcda9[_0x8652('0x41')]=[{'all':!![]}];}_0x6fcda9=_[_0x8652('0x3e')]({},_0x6fcda9,_0x5631a6['options']);return db[_0x8652('0x3f')][_0x8652('0x48')](_0x6fcda9)[_0x8652('0x25')](handleEntityNotFound(_0x87e4c1,null))[_0x8652('0x25')](respondWithResult(_0x87e4c1,null))[_0x8652('0x44')](handleError(_0x87e4c1,null));};exports[_0x8652('0x49')]=function(_0xc2ee14,_0x3589f0){return db[_0x8652('0x3f')][_0x8652('0x49')](_0xc2ee14[_0x8652('0x4a')],{})[_0x8652('0x25')](respondWithResult(_0x3589f0,0xc9))[_0x8652('0x44')](handleError(_0x3589f0,null));};exports[_0x8652('0x24')]=function(_0x3c9ba8,_0x1279ee){if(_0x3c9ba8[_0x8652('0x4a')]['id']){delete _0x3c9ba8[_0x8652('0x4a')]['id'];}return db[_0x8652('0x3f')][_0x8652('0x48')]({'where':{'id':_0x3c9ba8[_0x8652('0x46')]['id']}})[_0x8652('0x25')](handleEntityNotFound(_0x1279ee,null))[_0x8652('0x25')](saveUpdates(_0x3c9ba8[_0x8652('0x4a')],null))[_0x8652('0x25')](respondWithResult(_0x1279ee,null))[_0x8652('0x44')](handleError(_0x1279ee,null));};exports['destroy']=function(_0x3f14b6,_0x402848){return db[_0x8652('0x3f')][_0x8652('0x48')]({'where':{'id':_0x3f14b6[_0x8652('0x46')]['id']}})[_0x8652('0x25')](handleEntityNotFound(_0x402848,null))['then'](removeEntity(_0x402848,null))['catch'](handleError(_0x402848,null));};exports['describe']=function(_0x125da5,_0x24d897){return db['VoiceDialReport'][_0x8652('0x4b')]()[_0x8652('0x25')](respondWithResult(_0x24d897,null))[_0x8652('0x44')](handleError(_0x24d897,null));}; \ No newline at end of file +var _0x24d7=['status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','VoiceDialReport','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','name','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x22d1ef,_0x4a5152){var _0x47c5a3=function(_0x9a2c48){while(--_0x9a2c48){_0x22d1ef['push'](_0x22d1ef['shift']());}};_0x47c5a3(++_0x4a5152);}(_0x24d7,0x7e));var _0x724d=function(_0x123cea,_0x5250a5){_0x123cea=_0x123cea-0x0;var _0x3baa90=_0x24d7[_0x123cea];return _0x3baa90;};'use strict';var emlformat=require(_0x724d('0x0'));var rimraf=require(_0x724d('0x1'));var zipdir=require(_0x724d('0x2'));var jsonpatch=require(_0x724d('0x3'));var rp=require(_0x724d('0x4'));var moment=require(_0x724d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x724d('0x6'));var util=require(_0x724d('0x7'));var path=require(_0x724d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x724d('0x9'));var _=require(_0x724d('0xa'));var squel=require(_0x724d('0xb'));var crypto=require(_0x724d('0xc'));var jsforce=require(_0x724d('0xd'));var deskjs=require(_0x724d('0xe'));var toCsv=require(_0x724d('0xf'));var querystring=require(_0x724d('0x10'));var Papa=require(_0x724d('0x11'));var Redis=require('ioredis');var authService=require(_0x724d('0x12'));var qs=require(_0x724d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x724d('0x14'));var config=require(_0x724d('0x15'));var licenseUtil=require(_0x724d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e7d1,_0x15c372){_0x15c372=_0x15c372||0xcc;return function(_0x928c43){if(_0x928c43){return _0x16e7d1[_0x724d('0x17')](_0x15c372);}return _0x16e7d1[_0x724d('0x18')](_0x15c372)[_0x724d('0x19')]();};}function respondWithResult(_0x1cb25d,_0x39c7ef){_0x39c7ef=_0x39c7ef||0xc8;return function(_0x514634){if(_0x514634){return _0x1cb25d[_0x724d('0x18')](_0x39c7ef)[_0x724d('0x1a')](_0x514634);}};}function respondWithFilteredResult(_0x3b8d09,_0x53ac6d){return function(_0x55c1aa){if(_0x55c1aa){var _0x1fc3f9=typeof _0x53ac6d[_0x724d('0x1b')]===_0x724d('0x1c')&&typeof _0x53ac6d['limit']===_0x724d('0x1c');var _0x55b8bd=_0x55c1aa[_0x724d('0x1d')];var _0x371f0d=_0x1fc3f9?0x0:_0x53ac6d[_0x724d('0x1b')];var _0x4a0b87=_0x1fc3f9?_0x55c1aa['count']:_0x53ac6d[_0x724d('0x1b')]+_0x53ac6d[_0x724d('0x1e')];var _0x54fb33;if(_0x4a0b87>=_0x55b8bd){_0x4a0b87=_0x55b8bd;_0x54fb33=0xc8;}else{_0x54fb33=0xce;}_0x3b8d09[_0x724d('0x18')](_0x54fb33);return _0x3b8d09['set'](_0x724d('0x1f'),_0x371f0d+'-'+_0x4a0b87+'/'+_0x55b8bd)[_0x724d('0x1a')](_0x55c1aa);}return null;};}function patchUpdates(_0x5176a3){return function(_0x2d12d6){try{jsonpatch[_0x724d('0x20')](_0x2d12d6,_0x5176a3,!![]);}catch(_0x2a3f5d){return BPromise[_0x724d('0x21')](_0x2a3f5d);}return _0x2d12d6[_0x724d('0x22')]();};}function saveUpdates(_0x4f4583,_0x5987f6){return function(_0x47485c){if(_0x47485c){return _0x47485c[_0x724d('0x23')](_0x4f4583)[_0x724d('0x24')](function(_0x2e2172){return _0x2e2172;});}return null;};}function removeEntity(_0x57002f,_0x54896a){return function(_0x474ace){if(_0x474ace){return _0x474ace[_0x724d('0x25')]()[_0x724d('0x24')](function(){_0x57002f[_0x724d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358cad,_0x1cddc8){return function(_0x4e1e63){if(!_0x4e1e63){_0x358cad[_0x724d('0x17')](0x194);}return _0x4e1e63;};}function handleError(_0xc277a5,_0x3feed3){_0x3feed3=_0x3feed3||0x1f4;return function(_0x133acd){logger[_0x724d('0x26')](_0x133acd[_0x724d('0x27')]);if(_0x133acd['name']){delete _0x133acd['name'];}_0xc277a5['status'](_0x3feed3)[_0x724d('0x28')](_0x133acd);};}exports[_0x724d('0x29')]=function(_0x11de2c,_0x4be45e){var _0x5fcb5a={},_0x4a7696={},_0x4487b3={'count':0x0,'rows':[]};var _0x361606=_[_0x724d('0x2a')](db[_0x724d('0x2b')]['rawAttributes'],function(_0x20777b){return{'name':_0x20777b[_0x724d('0x2c')],'type':_0x20777b[_0x724d('0x2d')]['key']};});_0x4a7696['model']=_['map'](_0x361606,'name');_0x4a7696[_0x724d('0x2e')]=_[_0x724d('0x2f')](_0x11de2c['query']);_0x4a7696[_0x724d('0x30')]=_[_0x724d('0x31')](_0x4a7696['model'],_0x4a7696[_0x724d('0x2e')]);_0x5fcb5a[_0x724d('0x32')]=_[_0x724d('0x31')](_0x4a7696[_0x724d('0x33')],qs[_0x724d('0x34')](_0x11de2c[_0x724d('0x2e')]['fields']));_0x5fcb5a[_0x724d('0x32')]=_0x5fcb5a[_0x724d('0x32')][_0x724d('0x35')]?_0x5fcb5a[_0x724d('0x32')]:_0x4a7696[_0x724d('0x33')];if(!_0x11de2c[_0x724d('0x2e')][_0x724d('0x36')]('nolimit')){_0x5fcb5a[_0x724d('0x1e')]=qs[_0x724d('0x1e')](_0x11de2c[_0x724d('0x2e')][_0x724d('0x1e')]);_0x5fcb5a['offset']=qs[_0x724d('0x1b')](_0x11de2c[_0x724d('0x2e')][_0x724d('0x1b')]);}_0x5fcb5a[_0x724d('0x37')]=qs[_0x724d('0x38')](_0x11de2c['query'][_0x724d('0x38')]);_0x5fcb5a['where']=qs[_0x724d('0x30')](_['pick'](_0x11de2c['query'],_0x4a7696[_0x724d('0x30')]),_0x361606);if(_0x11de2c[_0x724d('0x2e')][_0x724d('0x39')]){_0x5fcb5a[_0x724d('0x3a')]=_['merge'](_0x5fcb5a[_0x724d('0x3a')],{'$or':_[_0x724d('0x2a')](_0x361606,function(_0x333113){if(_0x333113[_0x724d('0x2d')]!==_0x724d('0x3b')){var _0x5f1af3={};_0x5f1af3[_0x333113[_0x724d('0x3c')]]={'$like':'%'+_0x11de2c[_0x724d('0x2e')][_0x724d('0x39')]+'%'};return _0x5f1af3;}})});}_0x5fcb5a=_[_0x724d('0x3d')]({},_0x5fcb5a,_0x11de2c['options']);var _0x12eb2c={'where':_0x5fcb5a['where']};return db[_0x724d('0x2b')][_0x724d('0x1d')](_0x12eb2c)['then'](function(_0x49bc82){_0x4487b3['count']=_0x49bc82;if(_0x11de2c[_0x724d('0x2e')][_0x724d('0x3e')]){_0x5fcb5a['include']=[{'all':!![]}];}return db[_0x724d('0x2b')][_0x724d('0x3f')](_0x5fcb5a);})[_0x724d('0x24')](function(_0x6d61fb){_0x4487b3[_0x724d('0x40')]=_0x6d61fb;return _0x4487b3;})['then'](respondWithFilteredResult(_0x4be45e,_0x5fcb5a))[_0x724d('0x41')](handleError(_0x4be45e,null));};exports[_0x724d('0x42')]=function(_0x50b57b,_0x28690f){var _0x4f54af={'raw':!![],'where':{'id':_0x50b57b[_0x724d('0x43')]['id']}},_0x28b7f1={};_0x28b7f1[_0x724d('0x33')]=_[_0x724d('0x2f')](db[_0x724d('0x2b')][_0x724d('0x44')]);_0x28b7f1[_0x724d('0x2e')]=_['keys'](_0x50b57b['query']);_0x28b7f1[_0x724d('0x30')]=_[_0x724d('0x31')](_0x28b7f1[_0x724d('0x33')],_0x28b7f1[_0x724d('0x2e')]);_0x4f54af[_0x724d('0x32')]=_['intersection'](_0x28b7f1[_0x724d('0x33')],qs[_0x724d('0x34')](_0x50b57b[_0x724d('0x2e')][_0x724d('0x34')]));_0x4f54af[_0x724d('0x32')]=_0x4f54af[_0x724d('0x32')]['length']?_0x4f54af[_0x724d('0x32')]:_0x28b7f1['model'];if(_0x50b57b[_0x724d('0x2e')][_0x724d('0x3e')]){_0x4f54af[_0x724d('0x45')]=[{'all':!![]}];}_0x4f54af=_[_0x724d('0x3d')]({},_0x4f54af,_0x50b57b[_0x724d('0x46')]);return db[_0x724d('0x2b')]['find'](_0x4f54af)[_0x724d('0x24')](handleEntityNotFound(_0x28690f,null))[_0x724d('0x24')](respondWithResult(_0x28690f,null))['catch'](handleError(_0x28690f,null));};exports[_0x724d('0x47')]=function(_0x5dbd7d,_0x134b87){return db[_0x724d('0x2b')][_0x724d('0x47')](_0x5dbd7d[_0x724d('0x48')],{})[_0x724d('0x24')](respondWithResult(_0x134b87,0xc9))[_0x724d('0x41')](handleError(_0x134b87,null));};exports['update']=function(_0x5875eb,_0x21f21c){if(_0x5875eb[_0x724d('0x48')]['id']){delete _0x5875eb[_0x724d('0x48')]['id'];}return db[_0x724d('0x2b')][_0x724d('0x49')]({'where':{'id':_0x5875eb[_0x724d('0x43')]['id']}})['then'](handleEntityNotFound(_0x21f21c,null))['then'](saveUpdates(_0x5875eb['body'],null))[_0x724d('0x24')](respondWithResult(_0x21f21c,null))[_0x724d('0x41')](handleError(_0x21f21c,null));};exports['destroy']=function(_0x1dd111,_0x6c0f2b){return db[_0x724d('0x2b')][_0x724d('0x49')]({'where':{'id':_0x1dd111[_0x724d('0x43')]['id']}})['then'](handleEntityNotFound(_0x6c0f2b,null))[_0x724d('0x24')](removeEntity(_0x6c0f2b,null))[_0x724d('0x41')](handleError(_0x6c0f2b,null));};exports[_0x724d('0x4a')]=function(_0x2d8b42,_0x2f113d){return db[_0x724d('0x2b')][_0x724d('0x4a')]()[_0x724d('0x24')](respondWithResult(_0x2f113d,null))['catch'](handleError(_0x2f113d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f2ee89a..97908a6 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 _0x3e25=['moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x2cac3d,_0x48ed02){var _0x38a801=function(_0x41c6ba){while(--_0x41c6ba){_0x2cac3d['push'](_0x2cac3d['shift']());}};_0x38a801(++_0x48ed02);}(_0x3e25,0x14f));var _0x53e2=function(_0x59bf21,_0x20f44c){_0x59bf21=_0x59bf21-0x0;var _0x2e1c3f=_0x3e25[_0x59bf21];return _0x2e1c3f;};'use strict';var _=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var logger=require(_0x53e2('0x2'))('api');var moment=require(_0x53e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x53e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53e2('0x5'));var config=require(_0x53e2('0x6'));var attributes=require(_0x53e2('0x7'));module[_0x53e2('0x8')]=function(_0x11ad7a,_0x14b22c){return _0x11ad7a[_0x53e2('0x9')](_0x53e2('0xa'),attributes,{'tableName':_0x53e2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x53e2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4250=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x440f08,_0x464356){var _0x57d4a4=function(_0x429db0){while(--_0x429db0){_0x440f08['push'](_0x440f08['shift']());}};_0x57d4a4(++_0x464356);}(_0x4250,0x146));var _0x0425=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x4250[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0425('0x0'));var util=require(_0x0425('0x1'));var logger=require(_0x0425('0x2'))(_0x0425('0x3'));var moment=require('moment');var BPromise=require(_0x0425('0x4'));var rp=require(_0x0425('0x5'));var fs=require('fs');var path=require(_0x0425('0x6'));var rimraf=require('rimraf');var config=require(_0x0425('0x7'));var attributes=require(_0x0425('0x8'));module[_0x0425('0x9')]=function(_0x1e9547,_0x307761){return _0x1e9547[_0x0425('0xa')](_0x0425('0xb'),attributes,{'tableName':_0x0425('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0425('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 248df68..e6ed3f1 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 _0x0fe2=['VoiceDialReport','body','options','raw','CreateVoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x31cb2b,_0xf1eb62){var _0x37ef40=function(_0x12bc59){while(--_0x12bc59){_0x31cb2b['push'](_0x31cb2b['shift']());}};_0x37ef40(++_0xf1eb62);}(_0x0fe2,0x192));var _0x20fe=function(_0x4eff45,_0x14b01b){_0x4eff45=_0x4eff45-0x0;var _0x560235=_0x0fe2[_0x4eff45];return _0x560235;};'use strict';var _=require(_0x20fe('0x0'));var util=require('util');var moment=require(_0x20fe('0x1'));var BPromise=require(_0x20fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x20fe('0x3'));var logger=require('../../config/logger')(_0x20fe('0x4'));var config=require(_0x20fe('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x20fe('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34cc74,_0x3c11a0,_0x21fda3){return new BPromise(function(_0x249d5b,_0x2ae6db){return client['request'](_0x34cc74,_0x21fda3)[_0x20fe('0x7')](function(_0x1a3a2b){logger['info'](_0x20fe('0x8'),_0x3c11a0,_0x20fe('0x9'));logger[_0x20fe('0xa')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3c11a0,_0x20fe('0x9'),JSON[_0x20fe('0xb')](_0x1a3a2b));if(_0x1a3a2b['error']){if(_0x1a3a2b[_0x20fe('0xc')][_0x20fe('0xd')]===0x1f4){logger[_0x20fe('0xc')](_0x20fe('0x8'),_0x3c11a0,_0x1a3a2b['error'][_0x20fe('0xe')]);return _0x2ae6db(_0x1a3a2b[_0x20fe('0xc')]['message']);}logger['error'](_0x20fe('0x8'),_0x3c11a0,_0x1a3a2b[_0x20fe('0xc')][_0x20fe('0xe')]);return _0x249d5b(_0x1a3a2b[_0x20fe('0xc')][_0x20fe('0xe')]);}else{logger[_0x20fe('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3c11a0,_0x20fe('0x9'));_0x249d5b(_0x1a3a2b[_0x20fe('0x10')]['message']);}})[_0x20fe('0x11')](function(_0x25abee){logger[_0x20fe('0xc')](_0x20fe('0x8'),_0x3c11a0,_0x25abee);_0x2ae6db(_0x25abee);});});}exports['CreateVoiceDialReport']=function(_0x4437bd){var _0x50fafa=this;return new Promise(function(_0x133b78,_0x23a516){return db[_0x20fe('0x12')]['create'](_0x4437bd[_0x20fe('0x13')],{'raw':_0x4437bd['options']?_0x4437bd[_0x20fe('0x14')][_0x20fe('0x15')]===undefined?!![]:![]:!![]})[_0x20fe('0x7')](function(_0x76dbce){logger[_0x20fe('0xf')]('CreateVoiceDialReport',_0x4437bd);logger[_0x20fe('0xa')](_0x20fe('0x16'),_0x4437bd,JSON[_0x20fe('0xb')](_0x76dbce));_0x133b78(_0x76dbce);})['catch'](function(_0x158932){logger[_0x20fe('0xc')](_0x20fe('0x16'),_0x158932[_0x20fe('0xe')],_0x4437bd);_0x23a516(_0x50fafa[_0x20fe('0xc')](0x1f4,_0x158932['message']));});});};exports['UpdateVoiceDialReport']=function(_0x2cdcd9){var _0x5cf89f=this;return new Promise(function(_0x22fd2c,_0x35c45c){return db[_0x20fe('0x12')][_0x20fe('0x17')](_0x2cdcd9[_0x20fe('0x13')],{'raw':_0x2cdcd9[_0x20fe('0x14')]?_0x2cdcd9['options'][_0x20fe('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cdcd9[_0x20fe('0x14')]?_0x2cdcd9[_0x20fe('0x14')][_0x20fe('0x18')]||null:null,'attributes':_0x2cdcd9[_0x20fe('0x14')]?_0x2cdcd9['options'][_0x20fe('0x19')]||null:null,'limit':_0x2cdcd9[_0x20fe('0x14')]?_0x2cdcd9['options'][_0x20fe('0x1a')]||null:null})[_0x20fe('0x7')](function(_0x39c268){logger[_0x20fe('0xf')](_0x20fe('0x1b'),_0x2cdcd9);logger[_0x20fe('0xa')](_0x20fe('0x1b'),_0x2cdcd9,JSON[_0x20fe('0xb')](_0x39c268));_0x22fd2c(_0x39c268);})[_0x20fe('0x11')](function(_0x5285ad){logger[_0x20fe('0xc')](_0x20fe('0x1b'),_0x5285ad[_0x20fe('0xe')],_0x2cdcd9);_0x35c45c(_0x5cf89f[_0x20fe('0xc')](0x1f4,_0x5285ad[_0x20fe('0xe')]));});});}; \ No newline at end of file +var _0x2ba5=['error','code','message','result','CreateVoiceDialReport','create','options','debug','catch','UpdateVoiceDialReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54e4ec,_0x183144){var _0x44ef91=function(_0x34fe75){while(--_0x34fe75){_0x54e4ec['push'](_0x54e4ec['shift']());}};_0x44ef91(++_0x183144);}(_0x2ba5,0x128));var _0x52ba=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x2ba5[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x52ba('0x0'));var util=require(_0x52ba('0x1'));var moment=require(_0x52ba('0x2'));var BPromise=require(_0x52ba('0x3'));var rs=require(_0x52ba('0x4'));var fs=require('fs');var Redis=require(_0x52ba('0x5'));var db=require(_0x52ba('0x6'))['db'];var utils=require(_0x52ba('0x7'));var logger=require(_0x52ba('0x8'))('rpc');var config=require(_0x52ba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x52ba('0xa')][_0x52ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42a6f0,_0x2cfaae,_0x1d869e){return new BPromise(function(_0x4055b5,_0x30fdad){return client[_0x52ba('0xc')](_0x42a6f0,_0x1d869e)[_0x52ba('0xd')](function(_0x4c41af){logger[_0x52ba('0xe')](_0x52ba('0xf'),_0x2cfaae,_0x52ba('0x10'));logger['debug'](_0x52ba('0x11'),_0x2cfaae,_0x52ba('0x10'),JSON[_0x52ba('0x12')](_0x4c41af));if(_0x4c41af[_0x52ba('0x13')]){if(_0x4c41af['error'][_0x52ba('0x14')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2cfaae,_0x4c41af['error'][_0x52ba('0x15')]);return _0x30fdad(_0x4c41af[_0x52ba('0x13')][_0x52ba('0x15')]);}logger[_0x52ba('0x13')](_0x52ba('0xf'),_0x2cfaae,_0x4c41af[_0x52ba('0x13')]['message']);return _0x4055b5(_0x4c41af[_0x52ba('0x13')][_0x52ba('0x15')]);}else{logger['info'](_0x52ba('0xf'),_0x2cfaae,_0x52ba('0x10'));_0x4055b5(_0x4c41af[_0x52ba('0x16')]['message']);}})['catch'](function(_0x382e70){logger[_0x52ba('0x13')](_0x52ba('0xf'),_0x2cfaae,_0x382e70);_0x30fdad(_0x382e70);});});}exports[_0x52ba('0x17')]=function(_0x2b79f6){var _0x12c20c=this;return new Promise(function(_0xfd53db,_0x26df9c){return db['VoiceDialReport'][_0x52ba('0x18')](_0x2b79f6['body'],{'raw':_0x2b79f6[_0x52ba('0x19')]?_0x2b79f6[_0x52ba('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x52ba('0xd')](function(_0x3420a4){logger['info']('CreateVoiceDialReport',_0x2b79f6);logger[_0x52ba('0x1a')]('CreateVoiceDialReport',_0x2b79f6,JSON[_0x52ba('0x12')](_0x3420a4));_0xfd53db(_0x3420a4);})[_0x52ba('0x1b')](function(_0x4af824){logger[_0x52ba('0x13')](_0x52ba('0x17'),_0x4af824[_0x52ba('0x15')],_0x2b79f6);_0x26df9c(_0x12c20c[_0x52ba('0x13')](0x1f4,_0x4af824[_0x52ba('0x15')]));});});};exports[_0x52ba('0x1c')]=function(_0x2c8fba){var _0x25b6fb=this;return new Promise(function(_0x1040bd,_0x205305){return db['VoiceDialReport'][_0x52ba('0x1d')](_0x2c8fba[_0x52ba('0x1e')],{'raw':_0x2c8fba[_0x52ba('0x19')]?_0x2c8fba[_0x52ba('0x19')][_0x52ba('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8fba[_0x52ba('0x19')]?_0x2c8fba[_0x52ba('0x19')][_0x52ba('0x20')]||null:null,'attributes':_0x2c8fba[_0x52ba('0x19')]?_0x2c8fba[_0x52ba('0x19')][_0x52ba('0x21')]||null:null,'limit':_0x2c8fba[_0x52ba('0x19')]?_0x2c8fba[_0x52ba('0x19')][_0x52ba('0x22')]||null:null})[_0x52ba('0xd')](function(_0x29e7fb){logger[_0x52ba('0xe')](_0x52ba('0x1c'),_0x2c8fba);logger[_0x52ba('0x1a')](_0x52ba('0x1c'),_0x2c8fba,JSON[_0x52ba('0x12')](_0x29e7fb));_0x1040bd(_0x29e7fb);})[_0x52ba('0x1b')](function(_0x3e5350){logger[_0x52ba('0x13')](_0x52ba('0x1c'),_0x3e5350['message'],_0x2c8fba);_0x205305(_0x25b6fb[_0x52ba('0x13')](0x1f4,_0x3e5350[_0x52ba('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 2bde4f1..5e6f572 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 _0x444d=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4665b1,_0x24118f){var _0x9129d3=function(_0x2ff260){while(--_0x2ff260){_0x4665b1['push'](_0x4665b1['shift']());}};_0x9129d3(++_0x24118f);}(_0x444d,0xf4));var _0xd444=function(_0xfa9912,_0x5ddfef){_0xfa9912=_0xfa9912-0x0;var _0x163cba=_0x444d[_0xfa9912];return _0x163cba;};'use strict';var multer=require(_0xd444('0x0'));var util=require(_0xd444('0x1'));var path=require(_0xd444('0x2'));var timeout=require('connect-timeout');var express=require(_0xd444('0x3'));var router=express[_0xd444('0x4')]();var fs_extra=require(_0xd444('0x5'));var auth=require(_0xd444('0x6'));var interaction=require(_0xd444('0x7'));var config=require(_0xd444('0x8'));var controller=require(_0xd444('0x9'));router[_0xd444('0xa')]('/',auth[_0xd444('0xb')](),controller[_0xd444('0xc')]);router[_0xd444('0xa')](_0xd444('0xd'),auth[_0xd444('0xb')](),controller[_0xd444('0xe')]);router[_0xd444('0xf')]('/',auth[_0xd444('0xb')](),controller['create']);router[_0xd444('0xf')]('/:id/applications',auth[_0xd444('0xb')](),controller['addApplications']);router[_0xd444('0x10')](_0xd444('0xd'),auth[_0xd444('0xb')](),controller[_0xd444('0x11')]);router['delete'](_0xd444('0xd'),auth['isAuthenticated'](),controller[_0xd444('0x12')]);module[_0xd444('0x13')]=router; \ No newline at end of file +var _0xd423=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','express','../../components/auth/service'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0xd423,0x178));var _0x3d42=function(_0x2426d7,_0x515f06){_0x2426d7=_0x2426d7-0x0;var _0x236709=_0xd423[_0x2426d7];return _0x236709;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3d42('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d42('0x1'));var interaction=require(_0x3d42('0x2'));var config=require(_0x3d42('0x3'));var controller=require(_0x3d42('0x4'));router[_0x3d42('0x5')]('/',auth[_0x3d42('0x6')](),controller[_0x3d42('0x7')]);router[_0x3d42('0x5')](_0x3d42('0x8'),auth[_0x3d42('0x6')](),controller['show']);router[_0x3d42('0x9')]('/',auth[_0x3d42('0x6')](),controller[_0x3d42('0xa')]);router[_0x3d42('0x9')](_0x3d42('0xb'),auth['isAuthenticated'](),controller[_0x3d42('0xc')]);router[_0x3d42('0xd')](_0x3d42('0x8'),auth[_0x3d42('0x6')](),controller[_0x3d42('0xe')]);router[_0x3d42('0xf')](_0x3d42('0x8'),auth[_0x3d42('0x6')](),controller[_0x3d42('0x10')]);module[_0x3d42('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 0c02060..4e1cde1 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 _0x3f30=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x3f30,0x17e));var _0x03f3=function(_0x128ba6,_0x4d7b63){_0x128ba6=_0x128ba6-0x0;var _0x2e011a=_0x3f30[_0x128ba6];return _0x2e011a;};'use strict';var Sequelize=require(_0x03f3('0x0'));module[_0x03f3('0x1')]={'context':{'type':Sequelize[_0x03f3('0x2')],'allowNull':![],'unique':_0x03f3('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x03f3('0x3')},'priority':{'type':Sequelize[_0x03f3('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x03f3('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x03f3('0x2')],'allowNull':![],'defaultValue':_0x03f3('0x4')},'appdata':{'type':Sequelize[_0x03f3('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x03f3('0x5')](_0x03f3('0x6'),_0x03f3('0x7'),_0x03f3('0x8'),_0x03f3('0x9'),_0x03f3('0xa'),_0x03f3('0xb'),_0x03f3('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x03f3('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x03f3('0xd')},'IntervalId':{'type':Sequelize[_0x03f3('0xe')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x03f3('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x03f3('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x03f3('0xe')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x03f3('0x10')},'answer':{'type':Sequelize[_0x03f3('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0x03f3('0x11')],'get':function(_0x207715){return this[_0x03f3('0x12')](_0x03f3('0x13'));}},'alias':{'type':Sequelize[_0x03f3('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x664d=['VIRTUAL','exports','compositeIndex','STRING','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER'];(function(_0x41b6f5,_0x1ad42f){var _0x5d6142=function(_0xb46850){while(--_0xb46850){_0x41b6f5['push'](_0x41b6f5['shift']());}};_0x5d6142(++_0x1ad42f);}(_0x664d,0x169));var _0xd664=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x664d[_0x3b76f7];return _0x43984e;};'use strict';var Sequelize=require('sequelize');module[_0xd664('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd664('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd664('0x2')],'allowNull':![],'unique':_0xd664('0x1')},'priority':{'type':Sequelize[_0xd664('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd664('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd664('0x2')],'allowNull':![],'defaultValue':_0xd664('0x3')},'appdata':{'type':Sequelize[_0xd664('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd664('0x4')](_0xd664('0x5'),'outbound',_0xd664('0x6'),_0xd664('0x7'),_0xd664('0x8'),_0xd664('0x9'),_0xd664('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xd664('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd664('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xd664('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd664('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd664('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd664('0xd')]},'recordingFormat':{'type':Sequelize[_0xd664('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xd664('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd664('0xe')],'get':function(_0x51873f){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xd664('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index afb908d..19a5e7a 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 _0xe2e3=['catch','startsWith','exten','body','concat','create','user','get','InboundRoutes','outbound','internal','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','finally','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','inbound','OutboundRoutes','InternalRoutes','filter','ignore','map','value','includes','type','find','UserProfileResource','destroy','then','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','show','params'];(function(_0x86175b,_0x3fddd2){var _0x6dbb1f=function(_0x5a32ce){while(--_0x5a32ce){_0x86175b['push'](_0x86175b['shift']());}};_0x6dbb1f(++_0x3fddd2);}(_0xe2e3,0x132));var _0x3e2e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xe2e3[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x3e2e('0x0'));var Redis=require('ioredis');var qs=require(_0x3e2e('0x1'));var logger=require(_0x3e2e('0x2'))('api');var config=require(_0x3e2e('0x3'));var db=require(_0x3e2e('0x4'))['db'];config[_0x3e2e('0x5')]=_[_0x3e2e('0x6')](config[_0x3e2e('0x5')],{'host':_0x3e2e('0x7'),'port':0x18eb});var socket=require(_0x3e2e('0x8'))(new Redis(config[_0x3e2e('0x5')]));require('./voiceExtension.socket')[_0x3e2e('0x9')](socket);function respondWithStatusCode(_0x1da11d,_0x5d117a){_0x5d117a=_0x5d117a||0xcc;return function(_0x1be581){if(_0x1be581){return _0x1da11d[_0x3e2e('0xa')](_0x5d117a);}return _0x1da11d[_0x3e2e('0xb')](_0x5d117a)[_0x3e2e('0xc')]();};}function respondWithResult(_0xe47fea,_0x4bee2d){_0x4bee2d=_0x4bee2d||0xc8;return function(_0x3426c5){if(_0x3426c5){return _0xe47fea[_0x3e2e('0xb')](_0x4bee2d)['json'](_0x3426c5);}};}function respondWithFilteredResult(_0x389a47,_0xe285fc){return function(_0x143b97){if(_0x143b97){var _0x37833f=typeof _0xe285fc[_0x3e2e('0xd')]==='undefined'&&typeof _0xe285fc[_0x3e2e('0xe')]===_0x3e2e('0xf');var _0x2e07f5=_0x143b97[_0x3e2e('0x10')];var _0x3b61a3=_0x37833f?0x0:_0xe285fc[_0x3e2e('0xd')];var _0x7108b3=_0x37833f?_0x143b97[_0x3e2e('0x10')]:_0xe285fc['offset']+_0xe285fc[_0x3e2e('0xe')];var _0x277572;if(_0x7108b3>=_0x2e07f5){_0x7108b3=_0x2e07f5;_0x277572=0xc8;}else{_0x277572=0xce;}_0x389a47[_0x3e2e('0xb')](_0x277572);return _0x389a47[_0x3e2e('0x11')](_0x3e2e('0x12'),_0x3b61a3+'-'+_0x7108b3+'/'+_0x2e07f5)['json'](_0x143b97);}return null;};}function removeEntity(_0x147c08){return function(_0x595606){if(_0x595606){return _0x595606['destroy']()['then'](function(){var _0x3e5cf0=_0x595606['get']({'plain':!![]});var _0x32984d=[{'name':'InboundRoutes','value':_0x3e2e('0x13'),'ignore':![]},{'name':_0x3e2e('0x14'),'value':'outbound','ignore':![]},{'name':_0x3e2e('0x15'),'value':'internal','ignore':![]}];var _0x236e45=_(_0x32984d)[_0x3e2e('0x16')](_0x3e2e('0x17'))[_0x3e2e('0x18')](_0x3e2e('0x19'))[_0x3e2e('0x19')]();if(_[_0x3e2e('0x1a')](_0x236e45,_0x3e5cf0[_0x3e2e('0x1b')])){return;}var _0x305333=_[_0x3e2e('0x1c')](_0x32984d,[_0x3e2e('0x19'),_0x3e5cf0[_0x3e2e('0x1b')]])['name'];return db[_0x3e2e('0x1d')][_0x3e2e('0x1e')]({'where':{'type':_0x305333,'resourceId':_0x3e5cf0['id']}})[_0x3e2e('0x1f')](function(){return _0x595606;});})['then'](function(){_0x147c08[_0x3e2e('0xb')](0xcc)[_0x3e2e('0xc')]();});}};}function handleEntityNotFound(_0x95ecb4){return function(_0x1c7e51){if(!_0x1c7e51){_0x95ecb4[_0x3e2e('0xa')](0x194);}return _0x1c7e51;};}function handleError(_0x57311e,_0x1e98da){_0x1e98da=_0x1e98da||0x1f4;return function(_0x1fc3fa){logger[_0x3e2e('0x20')](_0x1fc3fa[_0x3e2e('0x21')]);if(_0x1fc3fa[_0x3e2e('0x22')]){delete _0x1fc3fa['name'];}_0x57311e[_0x3e2e('0xb')](_0x1e98da)[_0x3e2e('0x23')](_0x1fc3fa);};}exports[_0x3e2e('0x24')]=function(_0x12f777,_0x224c90){var _0xcc9d89={},_0x542feb={},_0x5496f8={'count':0x0,'rows':[]};var _0x20fdf9=_[_0x3e2e('0x18')](db[_0x3e2e('0x25')][_0x3e2e('0x26')],function(_0x4d82fe){return{'name':_0x4d82fe[_0x3e2e('0x27')],'type':_0x4d82fe[_0x3e2e('0x1b')][_0x3e2e('0x28')]};});_0x542feb[_0x3e2e('0x29')]=_[_0x3e2e('0x18')](_0x20fdf9,_0x3e2e('0x22'));_0x542feb[_0x3e2e('0x2a')]=_[_0x3e2e('0x2b')](_0x12f777['query']);_0x542feb[_0x3e2e('0x2c')]=_[_0x3e2e('0x2d')](_0x542feb[_0x3e2e('0x29')],_0x542feb[_0x3e2e('0x2a')]);_0xcc9d89['attributes']=_['intersection'](_0x542feb[_0x3e2e('0x29')],qs[_0x3e2e('0x2e')](_0x12f777[_0x3e2e('0x2a')][_0x3e2e('0x2e')]));_0xcc9d89[_0x3e2e('0x2f')]=_0xcc9d89[_0x3e2e('0x2f')][_0x3e2e('0x30')]?_0xcc9d89[_0x3e2e('0x2f')]:_0x542feb[_0x3e2e('0x29')];if(!_0x12f777[_0x3e2e('0x2a')]['hasOwnProperty'](_0x3e2e('0x31'))){_0xcc9d89[_0x3e2e('0xe')]=qs['limit'](_0x12f777['query'][_0x3e2e('0xe')]);_0xcc9d89['offset']=qs[_0x3e2e('0xd')](_0x12f777[_0x3e2e('0x2a')]['offset']);}_0xcc9d89[_0x3e2e('0x32')]=qs[_0x3e2e('0x33')](_0x12f777[_0x3e2e('0x2a')][_0x3e2e('0x33')]);_0xcc9d89[_0x3e2e('0x34')]=qs[_0x3e2e('0x2c')](_[_0x3e2e('0x35')](_0x12f777['query'],_0x542feb[_0x3e2e('0x2c')]),_0x20fdf9);if(_0x12f777[_0x3e2e('0x2a')]['filter']){_0xcc9d89[_0x3e2e('0x34')]=_['merge'](_0xcc9d89['where'],{'$or':_[_0x3e2e('0x18')](_0x20fdf9,function(_0x36e50a){if(_0x36e50a[_0x3e2e('0x1b')]!=='VIRTUAL'){var _0x2a1a65={};_0x2a1a65[_0x36e50a[_0x3e2e('0x22')]]={'$like':'%'+_0x12f777['query'][_0x3e2e('0x16')]+'%'};return _0x2a1a65;}})});}_0xcc9d89=_[_0x3e2e('0x36')]({},_0xcc9d89,_0x12f777[_0x3e2e('0x37')]);var _0xa63ea4={'where':_0xcc9d89[_0x3e2e('0x34')]};return db[_0x3e2e('0x25')][_0x3e2e('0x10')](_0xa63ea4)['then'](function(_0x10f4d9){_0x5496f8[_0x3e2e('0x10')]=_0x10f4d9;if(_0x12f777[_0x3e2e('0x2a')][_0x3e2e('0x38')]){_0xcc9d89[_0x3e2e('0x39')]=[{'all':!![]}];}return db[_0x3e2e('0x25')][_0x3e2e('0x3a')](_0xcc9d89);})['then'](function(_0x48a01d){_0x5496f8[_0x3e2e('0x3b')]=_0x48a01d;return _0x5496f8;})[_0x3e2e('0x1f')](respondWithFilteredResult(_0x224c90,_0xcc9d89))['catch'](handleError(_0x224c90,null));};exports[_0x3e2e('0x3c')]=function(_0x4e7fa9,_0x1f352c){var _0x591710={'raw':![],'where':{'id':_0x4e7fa9[_0x3e2e('0x3d')]['id']}},_0x40caa4={};_0x40caa4[_0x3e2e('0x29')]=_[_0x3e2e('0x2b')](db[_0x3e2e('0x25')][_0x3e2e('0x26')]);_0x40caa4['query']=_[_0x3e2e('0x2b')](_0x4e7fa9[_0x3e2e('0x2a')]);_0x40caa4[_0x3e2e('0x2c')]=_[_0x3e2e('0x2d')](_0x40caa4[_0x3e2e('0x29')],_0x40caa4['query']);_0x591710[_0x3e2e('0x2f')]=_[_0x3e2e('0x2d')](_0x40caa4['model'],qs[_0x3e2e('0x2e')](_0x4e7fa9[_0x3e2e('0x2a')][_0x3e2e('0x2e')]));_0x591710['attributes']=_0x591710[_0x3e2e('0x2f')][_0x3e2e('0x30')]?_0x591710[_0x3e2e('0x2f')]:_0x40caa4['model'];if(_0x4e7fa9['query'][_0x3e2e('0x38')]){_0x591710['include']=[{'all':!![]}];}_0x591710=_[_0x3e2e('0x36')]({},_0x591710,_0x4e7fa9[_0x3e2e('0x37')]);return db[_0x3e2e('0x25')]['find'](_0x591710)[_0x3e2e('0x1f')](handleEntityNotFound(_0x1f352c,null))[_0x3e2e('0x1f')](respondWithResult(_0x1f352c,null))[_0x3e2e('0x3e')](handleError(_0x1f352c,null));};exports['destroy']=function(_0x11e6db,_0x2c4295){return db[_0x3e2e('0x25')]['find']({'where':{'id':_0x11e6db[_0x3e2e('0x3d')]['id']}})[_0x3e2e('0x1f')](handleEntityNotFound(_0x2c4295,null))[_0x3e2e('0x1f')](removeEntity(_0x2c4295,null))['catch'](handleError(_0x2c4295,null));};exports['create']=function(_0x1e7d46,_0x563649){if(_0x1e7d46['body'][_0x3e2e('0x1b')]==='outbound'&&!_[_0x3e2e('0x3f')](_0x1e7d46['body'][_0x3e2e('0x40')],'_')){_0x1e7d46[_0x3e2e('0x41')][_0x3e2e('0x40')]='_'[_0x3e2e('0x42')](_0x1e7d46[_0x3e2e('0x41')][_0x3e2e('0x40')]);}return db[_0x3e2e('0x25')][_0x3e2e('0x43')](_0x1e7d46[_0x3e2e('0x41')],{'raw':![]})['then'](function(_0x1ab426){var _0x388915=_0x1e7d46[_0x3e2e('0x44')]['get']({'plain':!![]});if(!_0x388915)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x388915['role']===_0x3e2e('0x44')){var _0x204788=_0x1ab426[_0x3e2e('0x45')]({'plain':!![]});var _0x260a55=[{'name':_0x3e2e('0x46'),'value':'inbound'},{'name':_0x3e2e('0x14'),'value':_0x3e2e('0x47')},{'name':_0x3e2e('0x15'),'value':_0x3e2e('0x48')}];var _0x278a1c=_[_0x3e2e('0x1c')](_0x260a55,['value',_0x204788['type']])[_0x3e2e('0x22')];return db['UserProfileSection']['find']({'where':{'name':_0x278a1c,'userProfileId':_0x388915[_0x3e2e('0x49')]},'raw':!![]})[_0x3e2e('0x1f')](function(_0x443f45){if(_0x443f45&&_0x443f45[_0x3e2e('0x4a')]===0x0){return db[_0x3e2e('0x1d')]['create']({'name':_0x204788[_0x3e2e('0x22')],'resourceId':_0x204788['id'],'type':_0x443f45['name'],'sectionId':_0x443f45['id']},{})[_0x3e2e('0x1f')](function(){return _0x1ab426;});}else{return _0x1ab426;}})[_0x3e2e('0x3e')](function(_0x4a5d71){logger[_0x3e2e('0x20')](_0x3e2e('0x4b'),_0x4a5d71);throw _0x4a5d71;});}return _0x1ab426;})[_0x3e2e('0x1f')](respondWithResult(_0x563649,0xc9))[_0x3e2e('0x3e')](handleError(_0x563649,null));};exports[_0x3e2e('0x4c')]=function(_0x5144d4,_0x3effb5){if(_0x5144d4[_0x3e2e('0x41')]['id']){delete _0x5144d4[_0x3e2e('0x41')]['id'];}return db['VoiceExtension'][_0x3e2e('0x1c')]({'where':{'id':_0x5144d4[_0x3e2e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3effb5,null))[_0x3e2e('0x1f')](function(_0x3a9b19){if(_0x3a9b19){return db['VoiceExtension']['update'](_[_0x3e2e('0x35')](_0x5144d4[_0x3e2e('0x41')],[_0x3e2e('0x40'),_0x3e2e('0x4d'),_0x3e2e('0x4e'),_0x3e2e('0x4f'),_0x3e2e('0x50'),_0x3e2e('0x51'),_0x3e2e('0x52')]),{'where':{'context':_0x3a9b19[_0x3e2e('0x4d')],'exten':_0x3a9b19[_0x3e2e('0x40')]},'individualHooks':!![]})[_0x3e2e('0x1f')](function(_0x1a5a5b){return _0x1a5a5b;});}return null;})[_0x3e2e('0x1f')](respondWithStatusCode(_0x3effb5,null))['catch'](handleError(_0x3effb5,null));};exports[_0x3e2e('0x53')]=function(_0x553a22,_0x3af2ed){var _0x1735ad=_0x553a22['params']['id'];var _0x2315ef=_0x553a22[_0x3e2e('0x41')];var _0x30a141=0xc8;var _0x331682=null;return db[_0x3e2e('0x54')][_0x3e2e('0x55')]({'isolationLevel':db[_0x3e2e('0x54')][_0x3e2e('0x56')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x24b15d){return db[_0x3e2e('0x25')][_0x3e2e('0x57')]({'where':{'id':_0x1735ad},'transaction':_0x24b15d})['then'](function(_0xe7b50c){if(_0xe7b50c){return db[_0x3e2e('0x25')][_0x3e2e('0x1e')]({'where':{'VoiceExtensionId':_0x1735ad},'transaction':_0x24b15d})['then'](function(){var _0x43803b=_[_0x3e2e('0x18')](_0x2315ef,function(_0x444ff6){_0x444ff6[_0x3e2e('0x58')]=_0x1735ad;_0x444ff6['isApp']=!![];return _0x444ff6;});return _0xe7b50c['createRouting'](_0x43803b);})['then'](function(_0x152937){return db[_0x3e2e('0x25')][_0x3e2e('0x59')](_0x152937,{'transaction':_0x24b15d});});}else{_0x30a141=0x194;_0x331682=[];}});})[_0x3e2e('0x1f')](function(){if(_0x30a141!==0x194){return db['VoiceExtension'][_0x3e2e('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1735ad},'order':'cast(priority\x20as\x20unsigned)'})[_0x3e2e('0x1f')](function(_0x4f7558){_0x331682=_0x4f7558;});}})[_0x3e2e('0x3e')](function(_0x224cc5){_0x30a141=0x1f4;logger[_0x3e2e('0x20')](_0x224cc5[_0x3e2e('0x21')]);if(_0x224cc5[_0x3e2e('0x22')]){delete _0x224cc5[_0x3e2e('0x22')];}_0x331682=_0x224cc5;})[_0x3e2e('0x5b')](function(){if(_0x331682===null){_0x3af2ed[_0x3e2e('0xa')](_0x30a141);}else{if(_0x30a141===0x1f4){_0x3af2ed[_0x3e2e('0xb')](_0x30a141)[_0x3e2e('0x23')](_0x331682);}else{_0x3af2ed[_0x3e2e('0xb')](_0x30a141)['json'](_0x331682);}}});}; \ No newline at end of file +var _0x6557=['find','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','show','keys','intersection','params','create','body','startsWith','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','autoAssociation','update','context','recordingFormat','cutdigits','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','error','finally','sendStatus','lodash','api','../../config/environment','../../mysqldb','redis','localhost','register','end','status','offset','limit','undefined','count','set','json','destroy','then','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6557,0x8e));var _0x7655=function(_0x53b971,_0x2dc6e5){_0x53b971=_0x53b971-0x0;var _0x1cc7db=_0x6557[_0x53b971];return _0x1cc7db;};'use strict';var _=require(_0x7655('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7655('0x1'));var config=require(_0x7655('0x2'));var db=require(_0x7655('0x3'))['db'];config[_0x7655('0x4')]=_['defaults'](config[_0x7655('0x4')],{'host':_0x7655('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7655('0x4')]));require('./voiceExtension.socket')[_0x7655('0x6')](socket);function respondWithStatusCode(_0x276974,_0x8f4c37){_0x8f4c37=_0x8f4c37||0xcc;return function(_0x2a58ad){if(_0x2a58ad){return _0x276974['sendStatus'](_0x8f4c37);}return _0x276974['status'](_0x8f4c37)[_0x7655('0x7')]();};}function respondWithResult(_0x42325b,_0x2d90ad){_0x2d90ad=_0x2d90ad||0xc8;return function(_0x46e142){if(_0x46e142){return _0x42325b[_0x7655('0x8')](_0x2d90ad)['json'](_0x46e142);}};}function respondWithFilteredResult(_0x38b084,_0x50285b){return function(_0x43d1b9){if(_0x43d1b9){var _0x3440bf=typeof _0x50285b[_0x7655('0x9')]==='undefined'&&typeof _0x50285b[_0x7655('0xa')]===_0x7655('0xb');var _0x4cee54=_0x43d1b9['count'];var _0x1a62e3=_0x3440bf?0x0:_0x50285b['offset'];var _0x83861a=_0x3440bf?_0x43d1b9[_0x7655('0xc')]:_0x50285b[_0x7655('0x9')]+_0x50285b[_0x7655('0xa')];var _0x59efdd;if(_0x83861a>=_0x4cee54){_0x83861a=_0x4cee54;_0x59efdd=0xc8;}else{_0x59efdd=0xce;}_0x38b084[_0x7655('0x8')](_0x59efdd);return _0x38b084[_0x7655('0xd')]('Content-Range',_0x1a62e3+'-'+_0x83861a+'/'+_0x4cee54)[_0x7655('0xe')](_0x43d1b9);}return null;};}function removeEntity(_0x56c7d0){return function(_0x1ef59a){if(_0x1ef59a){return _0x1ef59a[_0x7655('0xf')]()[_0x7655('0x10')](function(){var _0x4c1a17=_0x1ef59a['get']({'plain':!![]});var _0x4b1349=[{'name':_0x7655('0x11'),'value':'inbound','ignore':![]},{'name':_0x7655('0x12'),'value':_0x7655('0x13'),'ignore':![]},{'name':_0x7655('0x14'),'value':_0x7655('0x15'),'ignore':![]}];var _0x243472=_(_0x4b1349)[_0x7655('0x16')](_0x7655('0x17'))[_0x7655('0x18')](_0x7655('0x19'))[_0x7655('0x19')]();if(_[_0x7655('0x1a')](_0x243472,_0x4c1a17[_0x7655('0x1b')])){return;}var _0x109ee9=_[_0x7655('0x1c')](_0x4b1349,[_0x7655('0x19'),_0x4c1a17[_0x7655('0x1b')]])[_0x7655('0x1d')];return db[_0x7655('0x1e')][_0x7655('0xf')]({'where':{'type':_0x109ee9,'resourceId':_0x4c1a17['id']}})[_0x7655('0x10')](function(){return _0x1ef59a;});})[_0x7655('0x10')](function(){_0x56c7d0[_0x7655('0x8')](0xcc)[_0x7655('0x7')]();});}};}function handleEntityNotFound(_0x34f00c){return function(_0x44fc77){if(!_0x44fc77){_0x34f00c['sendStatus'](0x194);}return _0x44fc77;};}function handleError(_0x2be7c4,_0x1a17a4){_0x1a17a4=_0x1a17a4||0x1f4;return function(_0x1c3c0e){logger['error'](_0x1c3c0e[_0x7655('0x1f')]);if(_0x1c3c0e[_0x7655('0x1d')]){delete _0x1c3c0e['name'];}_0x2be7c4[_0x7655('0x8')](_0x1a17a4)[_0x7655('0x20')](_0x1c3c0e);};}exports[_0x7655('0x21')]=function(_0x56e051,_0x45b0c6){var _0x2c6598={},_0x3bcc20={},_0x4233e0={'count':0x0,'rows':[]};var _0x30c4e8=_['map'](db[_0x7655('0x22')][_0x7655('0x23')],function(_0x1dac51){return{'name':_0x1dac51[_0x7655('0x24')],'type':_0x1dac51[_0x7655('0x1b')][_0x7655('0x25')]};});_0x3bcc20['model']=_['map'](_0x30c4e8,'name');_0x3bcc20['query']=_['keys'](_0x56e051[_0x7655('0x26')]);_0x3bcc20[_0x7655('0x27')]=_['intersection'](_0x3bcc20['model'],_0x3bcc20[_0x7655('0x26')]);_0x2c6598[_0x7655('0x28')]=_['intersection'](_0x3bcc20[_0x7655('0x29')],qs[_0x7655('0x2a')](_0x56e051['query'][_0x7655('0x2a')]));_0x2c6598['attributes']=_0x2c6598['attributes'][_0x7655('0x2b')]?_0x2c6598[_0x7655('0x28')]:_0x3bcc20[_0x7655('0x29')];if(!_0x56e051[_0x7655('0x26')][_0x7655('0x2c')](_0x7655('0x2d'))){_0x2c6598[_0x7655('0xa')]=qs[_0x7655('0xa')](_0x56e051[_0x7655('0x26')][_0x7655('0xa')]);_0x2c6598[_0x7655('0x9')]=qs['offset'](_0x56e051[_0x7655('0x26')][_0x7655('0x9')]);}_0x2c6598['order']=qs[_0x7655('0x2e')](_0x56e051[_0x7655('0x26')][_0x7655('0x2e')]);_0x2c6598[_0x7655('0x2f')]=qs[_0x7655('0x27')](_[_0x7655('0x30')](_0x56e051[_0x7655('0x26')],_0x3bcc20[_0x7655('0x27')]),_0x30c4e8);if(_0x56e051[_0x7655('0x26')][_0x7655('0x16')]){_0x2c6598[_0x7655('0x2f')]=_[_0x7655('0x31')](_0x2c6598['where'],{'$or':_[_0x7655('0x18')](_0x30c4e8,function(_0x2bf765){if(_0x2bf765[_0x7655('0x1b')]!==_0x7655('0x32')){var _0x309ccc={};_0x309ccc[_0x2bf765[_0x7655('0x1d')]]={'$like':'%'+_0x56e051[_0x7655('0x26')]['filter']+'%'};return _0x309ccc;}})});}_0x2c6598=_[_0x7655('0x31')]({},_0x2c6598,_0x56e051[_0x7655('0x33')]);var _0x5d74c1={'where':_0x2c6598[_0x7655('0x2f')]};return db['VoiceExtension'][_0x7655('0xc')](_0x5d74c1)[_0x7655('0x10')](function(_0x49b95c){_0x4233e0[_0x7655('0xc')]=_0x49b95c;if(_0x56e051[_0x7655('0x26')][_0x7655('0x34')]){_0x2c6598[_0x7655('0x35')]=[{'all':!![]}];}return db[_0x7655('0x22')]['findAll'](_0x2c6598);})[_0x7655('0x10')](function(_0x439905){_0x4233e0['rows']=_0x439905;return _0x4233e0;})[_0x7655('0x10')](respondWithFilteredResult(_0x45b0c6,_0x2c6598))[_0x7655('0x36')](handleError(_0x45b0c6,null));};exports[_0x7655('0x37')]=function(_0x2e13a0,_0xe6d9a6){var _0x4b6166={'raw':![],'where':{'id':_0x2e13a0['params']['id']}},_0xdd743d={};_0xdd743d[_0x7655('0x29')]=_[_0x7655('0x38')](db['VoiceExtension']['rawAttributes']);_0xdd743d['query']=_[_0x7655('0x38')](_0x2e13a0[_0x7655('0x26')]);_0xdd743d[_0x7655('0x27')]=_[_0x7655('0x39')](_0xdd743d['model'],_0xdd743d[_0x7655('0x26')]);_0x4b6166[_0x7655('0x28')]=_['intersection'](_0xdd743d[_0x7655('0x29')],qs['fields'](_0x2e13a0[_0x7655('0x26')][_0x7655('0x2a')]));_0x4b6166[_0x7655('0x28')]=_0x4b6166[_0x7655('0x28')][_0x7655('0x2b')]?_0x4b6166['attributes']:_0xdd743d['model'];if(_0x2e13a0[_0x7655('0x26')][_0x7655('0x34')]){_0x4b6166[_0x7655('0x35')]=[{'all':!![]}];}_0x4b6166=_[_0x7655('0x31')]({},_0x4b6166,_0x2e13a0[_0x7655('0x33')]);return db['VoiceExtension'][_0x7655('0x1c')](_0x4b6166)[_0x7655('0x10')](handleEntityNotFound(_0xe6d9a6,null))[_0x7655('0x10')](respondWithResult(_0xe6d9a6,null))[_0x7655('0x36')](handleError(_0xe6d9a6,null));};exports[_0x7655('0xf')]=function(_0x534b3d,_0x1991c0){return db['VoiceExtension'][_0x7655('0x1c')]({'where':{'id':_0x534b3d[_0x7655('0x3a')]['id']}})[_0x7655('0x10')](handleEntityNotFound(_0x1991c0,null))['then'](removeEntity(_0x1991c0,null))['catch'](handleError(_0x1991c0,null));};exports[_0x7655('0x3b')]=function(_0x1bef25,_0x2ae665){if(_0x1bef25[_0x7655('0x3c')][_0x7655('0x1b')]===_0x7655('0x13')&&!_[_0x7655('0x3d')](_0x1bef25['body'][_0x7655('0x3e')],'_')){_0x1bef25[_0x7655('0x3c')][_0x7655('0x3e')]='_'['concat'](_0x1bef25[_0x7655('0x3c')][_0x7655('0x3e')]);}return db[_0x7655('0x22')]['create'](_0x1bef25[_0x7655('0x3c')],{'raw':![]})[_0x7655('0x10')](function(_0x246dc0){var _0x17679a=_0x1bef25[_0x7655('0x3f')][_0x7655('0x40')]({'plain':!![]});if(!_0x17679a)throw new Error(_0x7655('0x41'));if(_0x17679a[_0x7655('0x42')]==='user'){var _0x12e9db=_0x246dc0[_0x7655('0x40')]({'plain':!![]});var _0x455953=[{'name':_0x7655('0x11'),'value':_0x7655('0x43')},{'name':_0x7655('0x12'),'value':_0x7655('0x13')},{'name':_0x7655('0x14'),'value':'internal'}];var _0x4bf786=_[_0x7655('0x1c')](_0x455953,['value',_0x12e9db[_0x7655('0x1b')]])['name'];return db['UserProfileSection'][_0x7655('0x1c')]({'where':{'name':_0x4bf786,'userProfileId':_0x17679a[_0x7655('0x44')]},'raw':!![]})[_0x7655('0x10')](function(_0x471bf5){if(_0x471bf5&&_0x471bf5[_0x7655('0x45')]===0x0){return db['UserProfileResource']['create']({'name':_0x12e9db['name'],'resourceId':_0x12e9db['id'],'type':_0x471bf5[_0x7655('0x1d')],'sectionId':_0x471bf5['id']},{})[_0x7655('0x10')](function(){return _0x246dc0;});}else{return _0x246dc0;}})['catch'](function(_0x34fa8c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34fa8c);throw _0x34fa8c;});}return _0x246dc0;})[_0x7655('0x10')](respondWithResult(_0x2ae665,0xc9))['catch'](handleError(_0x2ae665,null));};exports['update']=function(_0x16c511,_0x235899){if(_0x16c511[_0x7655('0x3c')]['id']){delete _0x16c511[_0x7655('0x3c')]['id'];}return db[_0x7655('0x22')][_0x7655('0x1c')]({'where':{'id':_0x16c511[_0x7655('0x3a')]['id']}})[_0x7655('0x10')](handleEntityNotFound(_0x235899,null))[_0x7655('0x10')](function(_0xbbf9b){if(_0xbbf9b){return db['VoiceExtension'][_0x7655('0x46')](_[_0x7655('0x30')](_0x16c511[_0x7655('0x3c')],[_0x7655('0x3e'),_0x7655('0x47'),'description',_0x7655('0x48'),_0x7655('0x49'),'mandatoryDisposition','alias']),{'where':{'context':_0xbbf9b[_0x7655('0x47')],'exten':_0xbbf9b[_0x7655('0x3e')]},'individualHooks':!![]})[_0x7655('0x10')](function(_0x5bb723){return _0x5bb723;});}return null;})[_0x7655('0x10')](respondWithStatusCode(_0x235899,null))[_0x7655('0x36')](handleError(_0x235899,null));};exports['addApplications']=function(_0x29a93c,_0x1a7647){var _0x429d0d=_0x29a93c['params']['id'];var _0x3f952c=_0x29a93c[_0x7655('0x3c')];var _0x4ca70a=0xc8;var _0x2fbebe=null;return db[_0x7655('0x4a')]['transaction']({'isolationLevel':db[_0x7655('0x4a')][_0x7655('0x4b')]['ISOLATION_LEVELS'][_0x7655('0x4c')]},function(_0x4907cb){return db[_0x7655('0x22')][_0x7655('0x4d')]({'where':{'id':_0x429d0d},'transaction':_0x4907cb})[_0x7655('0x10')](function(_0x9454ea){if(_0x9454ea){return db['VoiceExtension'][_0x7655('0xf')]({'where':{'VoiceExtensionId':_0x429d0d},'transaction':_0x4907cb})[_0x7655('0x10')](function(){var _0x10bfcf=_[_0x7655('0x18')](_0x3f952c,function(_0x5aa507){_0x5aa507[_0x7655('0x4e')]=_0x429d0d;_0x5aa507['isApp']=!![];return _0x5aa507;});return _0x9454ea[_0x7655('0x4f')](_0x10bfcf);})[_0x7655('0x10')](function(_0x4bc0b5){return db[_0x7655('0x22')][_0x7655('0x50')](_0x4bc0b5,{'transaction':_0x4907cb});});}else{_0x4ca70a=0x194;_0x2fbebe=[];}});})[_0x7655('0x10')](function(){if(_0x4ca70a!==0x194){return db[_0x7655('0x22')][_0x7655('0x51')]({'where':{'isApp':!![],'VoiceExtensionId':_0x429d0d},'order':'cast(priority\x20as\x20unsigned)'})[_0x7655('0x10')](function(_0x36b904){_0x2fbebe=_0x36b904;});}})['catch'](function(_0x14d1cc){_0x4ca70a=0x1f4;logger[_0x7655('0x52')](_0x14d1cc[_0x7655('0x1f')]);if(_0x14d1cc[_0x7655('0x1d')]){delete _0x14d1cc[_0x7655('0x1d')];}_0x2fbebe=_0x14d1cc;})[_0x7655('0x53')](function(){if(_0x2fbebe===null){_0x1a7647[_0x7655('0x54')](_0x4ca70a);}else{if(_0x4ca70a===0x1f4){_0x1a7647['status'](_0x4ca70a)[_0x7655('0x20')](_0x2fbebe);}else{_0x1a7647[_0x7655('0x8')](_0x4ca70a)[_0x7655('0xe')](_0x2fbebe);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d1e01ef..48a6742 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 _0x36df=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','update','remove'];(function(_0x42fd76,_0x3a669a){var _0x5c9ef8=function(_0x56432c){while(--_0x56432c){_0x42fd76['push'](_0x42fd76['shift']());}};_0x5c9ef8(++_0x3a669a);}(_0x36df,0x64));var _0xf36d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x36df[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xf36d('0x0'))['db'][_0xf36d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf36d('0x2'),'afterDestroy':_0xf36d('0x3')};function emitEvent(_0x2ed783){return function(_0x4dd5bc,_0x357f5b,_0x50f858){VoiceExtensionEvents[_0xf36d('0x4')](_0x2ed783+':'+_0x4dd5bc['id'],_0x4dd5bc);VoiceExtensionEvents[_0xf36d('0x4')](_0x2ed783,_0x4dd5bc);_0x50f858(null);};}for(var e in events){if(events[_0xf36d('0x5')](e)){var event=events[e];VoiceExtension[_0xf36d('0x6')](e,emitEvent(event));}}module[_0xf36d('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xbfad=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xcd0079,_0x3d1dbe){var _0x1e84c3=function(_0x41e44d){while(--_0x41e44d){_0xcd0079['push'](_0xcd0079['shift']());}};_0x1e84c3(++_0x3d1dbe);}(_0xbfad,0xd4));var _0xdbfa=function(_0x25c11d,_0xbf7375){_0x25c11d=_0x25c11d-0x0;var _0x2cddb8=_0xbfad[_0x25c11d];return _0x2cddb8;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xdbfa('0x0'))['db'][_0xdbfa('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdbfa('0x2')](0x0);var events={'afterCreate':_0xdbfa('0x3'),'afterUpdate':_0xdbfa('0x4'),'afterDestroy':_0xdbfa('0x5')};function emitEvent(_0x54cec7){return function(_0x3ef879,_0x7544da,_0xd206b3){VoiceExtensionEvents['emit'](_0x54cec7+':'+_0x3ef879['id'],_0x3ef879);VoiceExtensionEvents[_0xdbfa('0x6')](_0x54cec7,_0x3ef879);_0xd206b3(null);};}for(var e in events){if(events[_0xdbfa('0x7')](e)){var event=events[e];VoiceExtension[_0xdbfa('0x8')](e,emitEvent(event));}}module[_0xdbfa('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 68e3151..f5a58fd 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 _0x7c1f=['exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','push','inbound','CDR(routeid)=','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','name','param','phone','prefix','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','catch','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','CDR(type)='];(function(_0x12ab97,_0x43a673){var _0x338e43=function(_0x57e69c){while(--_0x57e69c){_0x12ab97['push'](_0x12ab97['shift']());}};_0x338e43(++_0x43a673);}(_0x7c1f,0x194));var _0xf7c1=function(_0x13a3cd,_0xf6e675){_0x13a3cd=_0x13a3cd-0x0;var _0xf1306a=_0x7c1f[_0x13a3cd];return _0xf1306a;};'use strict';var _=require(_0xf7c1('0x0'));var attributes=require(_0xf7c1('0x1'));module[_0xf7c1('0x2')]=function(_0x4c0c8e){var _0x3ca7b6=_0x4c0c8e['models'];function _0x1e3254(_0x13f6da){var _0x18f5a9=0x2;var _0x485d8d=[{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x5')+_0x13f6da[_0xf7c1('0x3')],'context':_0x13f6da['context'],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0x13f6da[_0xf7c1('0x7')]?_0xf7c1('0x4'):_0xf7c1('0x8'),'appdata':_0x13f6da[_0xf7c1('0x7')]?_0xf7c1('0x9')+_0x13f6da[_0xf7c1('0x7')]:_0xf7c1('0xa'),'context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']}];if(_0x13f6da[_0xf7c1('0x3')]==='inbound'){_0x485d8d[_0xf7c1('0xc')]({'type':_0xf7c1('0xd'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xe')+_0x13f6da['id'],'context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']});}_0x485d8d['push']({'type':_0x13f6da['type'],'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da['type'],'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xf'),'context':_0x13f6da['context'],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']});return _0x485d8d;}function _0x5b5786(_0x298d23){var _0x4f0a0a=0x2;var _0x115010=[{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x11'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0x298d23[_0xf7c1('0x7')]?'Set':'NoOp','appdata':_0x298d23[_0xf7c1('0x7')]?_0xf7c1('0x9')+_0x298d23['alias']:_0xf7c1('0xa'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':'Set','appdata':'CDR(destination)='+(_0x298d23['cutdigits']?_0xf7c1('0x12')+_0x298d23[_0xf7c1('0x13')]+'}':'${EXTEN}'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xe')+_0x298d23['id'],'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4f0a0a+0x2)+'):Goto('+(_0x4f0a0a+0x1)+')','context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0x298d23[_0xf7c1('0x13')]?_0xf7c1('0x14')+_0x298d23[_0xf7c1('0x13')]+'}':_0xf7c1('0x15'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x16'),'context':_0x298d23['context'],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':'outbound','app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xf'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':'outboundrouteid='+_0x298d23['id'],'context':_0x298d23['context'],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']}];if(_0x298d23[_0xf7c1('0x17')](_0xf7c1('0x18'))&&_0x298d23[_0xf7c1('0x18')]!==_0xf7c1('0x19')){_0x115010['push']({'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x1a'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':'outbound','app':'Set','appdata':_0xf7c1('0x1b')+_0x298d23[_0xf7c1('0x18')]||_0xf7c1('0x1c'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']});}return _0x115010;}function _0x4a3832(_0x4b0798,_0x17a667){var _0x122e85=[{'name':_0xf7c1('0x1d'),'param':0x0},{'name':_0xf7c1('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0xf7c1('0x1f'),'param':0x3}];var _0x5af7e1={};var _0x1ccb88=_0x17a667[_0xf7c1('0x20')](',');var _0x1f2141=[];for(var _0x1341ae=0x0;_0x1341ae<_0x122e85[_0xf7c1('0x21')];_0x1341ae++){switch(_0x122e85[_0x1341ae][_0xf7c1('0x22')]){case _0xf7c1('0x1d'):_0x5af7e1['trunk']=_0x1ccb88[_0x122e85[_0x1341ae]['param']][_0xf7c1('0x20')]('/')[0x1];_0x5af7e1['phone']=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]][_0xf7c1('0x20')]('/')[0x2];_0x5af7e1['prefix']=_0x5af7e1[_0xf7c1('0x24')]?_0x5af7e1['phone']['split']('$')[0x0]:undefined;_0x5af7e1[_0xf7c1('0x24')]=_0x4b0798[_0xf7c1('0x13')]?(_0x5af7e1[_0xf7c1('0x25')]||'')+_0xf7c1('0x12')+_0x4b0798['cutdigits']+'}':(_0x5af7e1['prefix']||'')+_0xf7c1('0x26');_0x1f2141[_0x122e85[_0x1341ae][_0xf7c1('0x23')]]=[_0xf7c1('0x27'),_0x5af7e1[_0xf7c1('0x1d')],_0x5af7e1[_0xf7c1('0x24')]][_0xf7c1('0x28')]('/');break;case'options':_0x5af7e1[_0xf7c1('0x29')]=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]];if(_0x4b0798['recordingFormat']!=='none'){if(_0x5af7e1[_0xf7c1('0x29')][_0xf7c1('0x2a')](_0xf7c1('0x2b'))<0x0){_0x5af7e1[_0xf7c1('0x29')]+=_0xf7c1('0x2b');}}else{_0x5af7e1['options']=_0x5af7e1['options']['replace'](_0xf7c1('0x2b'),'');}_0x1f2141[_0x122e85[_0x1341ae]['param']]=_0x5af7e1[_0xf7c1('0x29')];break;default:_0x1f2141[_0x122e85[_0x1341ae][_0xf7c1('0x23')]]=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]];}}return _0x1f2141[_0xf7c1('0x28')](',');}function _0x8b5861(_0x521306,_0x1b748a,_0x525db2){return new Promise(function(_0x508678,_0x3fea80){var _0x55d495=[];if(_['isEmpty'](_0x1b748a))return _0x508678(_0x55d495);_0x3ca7b6[_0xf7c1('0x2c')][_0xf7c1('0x2d')]({'attributes':['id',_0xf7c1('0x2e'),_0xf7c1('0x2f')],'raw':!![]})[_0xf7c1('0x30')](function(_0x5299a8){for(var _0x2d928d=0x0,_0x95051a=0x0;_0x2d928d<_0x1b748a[_0xf7c1('0x21')];_0x2d928d++,_0x95051a=0x0){var _0x597813=_0x1b748a[_0x2d928d];var _0xcfa402=[];var _0x241f37=[];delete _0x597813['id'];if(_0x597813[_0xf7c1('0x2e')]!==_0xf7c1('0x31')){_0x597813[_0xf7c1('0x32')]=[_0x597813['interval']];}else{_0x597813[_0xf7c1('0x32')]=_0x597813[_0xf7c1('0x2f')]?_[_0xf7c1('0x33')](_[_0xf7c1('0x34')](_0x5299a8,{'IntervalId':_0x597813['IntervalId']}),_0xf7c1('0x2e')):[];}_0x597813[_0xf7c1('0xb')]=_0x521306[_0xf7c1('0xb')];_0x597813['exten']=_0x521306[_0xf7c1('0x6')];if(_0x597813[_0xf7c1('0x3')])_0x597813[_0xf7c1('0x3')]=_0x597813['type'][_0xf7c1('0x35')]();if(_0x521306[_0xf7c1('0x3')]===_0xf7c1('0x10')){if(_0x597813['hasOwnProperty'](_0xf7c1('0x36'))&&_0x597813['tag']&&_0x597813[_0xf7c1('0x36')]!=='--'){_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813['type']['toLowerCase'](),'app':_0xf7c1('0x4'),'appdata':'CDR(tag)='+_0x597813['tag'],'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306['exten'],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':'ExecIf','appdata':_0xf7c1('0x37')+(_0x597813['callerID']?_0xf7c1('0x38')+_0x597813['callerID']+')':_0xf7c1('0x39')),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}else{if(_0x597813['hasOwnProperty']('answer')){if([_0xf7c1('0x3a'),_0xf7c1('0x3b')][_0xf7c1('0x3c')](_0x597813[_0xf7c1('0x3d')][_0xf7c1('0x35')]())&&_0x597813[_0xf7c1('0x3e')]!==_0xf7c1('0x3f')){if(_0x597813[_0xf7c1('0x40')]){_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x41'),'appdata':_0xf7c1('0x42'),'context':_0x521306['context'],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')]['toLowerCase'](),'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813['intervals'][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}else{_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x41'),'appdata':_0xf7c1('0x43'),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x44'),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813['intervals'][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}}}}for(var _0x15c974=0x0;_0x15c974<_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')];_0x15c974++){var _0x3aefa1=_0x525db2+_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')];var _0x5a68aa=_0x15c974===_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]-0x1?_0x525db2+_0xcfa402['length']+_0x241f37[_0xf7c1('0x21')]+0x2:_0x525db2+_0x15c974+0x1;_0xcfa402[_0xf7c1('0x45')](_0x15c974,0x0,{'type':_0x521306[_0xf7c1('0x3')],'app':_0xf7c1('0x46'),'appdata':_0x597813[_0xf7c1('0x32')][_0x15c974]+'?'+_0x521306[_0xf7c1('0xb')]+_0xf7c1('0x47')+_0x3aefa1+':'+_0x521306[_0xf7c1('0xb')]+_0xf7c1('0x47')+_0x5a68aa,'exten':_0x521306[_0xf7c1('0x6')],'context':_0x521306[_0xf7c1('0xb')],'priority':_0x525db2+_0x15c974,'VoiceExtensionId':_0x521306['id']});}if(_0x597813['appType']===_0xf7c1('0x48'))_0x597813['appdata']=_0x4a3832(_0x521306,_0x597813[_0xf7c1('0x49')]);_0x597813['priority']=_0xcfa402[_0xf7c1('0x21')]?_[_0xf7c1('0x4a')](_0xcfa402)['priority']+0x1:_0x525db2;_0x55d495=_[_0xf7c1('0x4b')](_0x55d495,_0xcfa402,[_0x597813],_0x241f37);_0x525db2=_['last'](_0x55d495)[_0xf7c1('0x4c')]+0x1;}return _0x508678(_0x55d495);})[_0xf7c1('0x4d')](function(_0x206cc1){_0x3fea80(_0x206cc1);});});}return _0x4c0c8e[_0xf7c1('0x4e')]('VoiceExtension',attributes,{'tableName':_0xf7c1('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x291175){var _0x437778=this[_0xf7c1('0x50')]({'plain':!![]});var _0x5358d4=_0x437778[_0xf7c1('0x3')]===_0xf7c1('0x10')?_0x5b5786(_0x437778):_0x1e3254(_0x437778);return _0x8b5861(_0x437778,_0x291175,_[_0xf7c1('0x4a')](_0x5358d4)[_0xf7c1('0x4c')]+0x1)[_0xf7c1('0x30')](function(_0x8db781){var _0x35b0b6=_['concat'](_0x5358d4,_0x8db781);_0x35b0b6[_0xf7c1('0xc')]({'type':_0x437778[_0xf7c1('0x3')],'app':_0xf7c1('0x51'),'exten':_0x437778[_0xf7c1('0x6')],'context':_0x437778[_0xf7c1('0xb')],'priority':_[_0xf7c1('0x4a')](_0x35b0b6)['priority']+0x1,'VoiceExtensionId':_0x437778['id']});return _0x35b0b6;});}}});}; \ No newline at end of file +var _0xac95=['lodash','./voiceExtension.attributes','exports','type','CDR(type)=','context','alias','Set','NoOp','CDR(routeAlias)=','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','${EXTEN}','join','none','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','then','interval','filter','toLowerCase','tag','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup'];(function(_0x48671c,_0x2b44a3){var _0x32d5e5=function(_0x3a21ac){while(--_0x3a21ac){_0x48671c['push'](_0x48671c['shift']());}};_0x32d5e5(++_0x2b44a3);}(_0xac95,0xa8));var _0x5ac9=function(_0x5c534f,_0x23a4a8){_0x5c534f=_0x5c534f-0x0;var _0xe414e1=_0xac95[_0x5c534f];return _0xe414e1;};'use strict';var _=require(_0x5ac9('0x0'));var attributes=require(_0x5ac9('0x1'));module[_0x5ac9('0x2')]=function(_0x471ff6){var _0x4c14a3=_0x471ff6['models'];function _0x4562f2(_0x1ebdea){var _0x550511=0x2;var _0xafa08d=[{'type':_0x1ebdea[_0x5ac9('0x3')],'app':'Set','appdata':_0x5ac9('0x4')+_0x1ebdea[_0x5ac9('0x3')],'context':_0x1ebdea[_0x5ac9('0x5')],'exten':_0x1ebdea['exten'],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']},{'type':_0x1ebdea['type'],'app':_0x1ebdea[_0x5ac9('0x6')]?_0x5ac9('0x7'):_0x5ac9('0x8'),'appdata':_0x1ebdea[_0x5ac9('0x6')]?_0x5ac9('0x9')+_0x1ebdea[_0x5ac9('0x6')]:'No\x20alias\x20set','context':_0x1ebdea[_0x5ac9('0x5')],'exten':_0x1ebdea[_0x5ac9('0xa')],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']}];if(_0x1ebdea['type']===_0x5ac9('0xb')){_0xafa08d['push']({'type':_0x5ac9('0xb'),'app':'Set','appdata':_0x5ac9('0xc')+_0x1ebdea['id'],'context':_0x1ebdea[_0x5ac9('0x5')],'exten':_0x1ebdea[_0x5ac9('0xa')],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']});}_0xafa08d[_0x5ac9('0xd')]({'type':_0x1ebdea['type'],'app':'Set','appdata':_0x5ac9('0xe'),'context':_0x1ebdea['context'],'exten':_0x1ebdea[_0x5ac9('0xa')],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']},{'type':_0x1ebdea[_0x5ac9('0x3')],'app':'Set','appdata':_0x5ac9('0xf'),'context':_0x1ebdea[_0x5ac9('0x5')],'exten':_0x1ebdea[_0x5ac9('0xa')],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']},{'type':_0x1ebdea[_0x5ac9('0x3')],'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x10'),'context':_0x1ebdea[_0x5ac9('0x5')],'exten':_0x1ebdea[_0x5ac9('0xa')],'priority':_0x550511++,'VoiceExtensionId':_0x1ebdea['id']});return _0xafa08d;}function _0x460fd7(_0x53163b){var _0x53a8db=0x2;var _0x352874=[{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x12'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x53163b[_0x5ac9('0x6')]?_0x5ac9('0x7'):_0x5ac9('0x8'),'appdata':_0x53163b[_0x5ac9('0x6')]?_0x5ac9('0x9')+_0x53163b[_0x5ac9('0x6')]:'No\x20alias\x20set','context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x13')+(_0x53163b['cutdigits']?_0x5ac9('0x14')+_0x53163b[_0x5ac9('0x15')]+'}':'${EXTEN}'),'context':_0x53163b['context'],'exten':_0x53163b['exten'],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':'CDR(routeid)='+_0x53163b['id'],'context':_0x53163b['context'],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':'outbound','app':'ExecIf','appdata':_0x5ac9('0x16')+(_0x53a8db+0x2)+'):Goto('+(_0x53a8db+0x1)+')','context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':_0x53163b[_0x5ac9('0x15')]?_0x5ac9('0x17')+_0x53163b[_0x5ac9('0x15')]+'}':_0x5ac9('0x18'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b['exten'],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0xe'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':'outbound','app':'Set','appdata':_0x5ac9('0xf'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b['exten'],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':'Set','appdata':_0x5ac9('0x10'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':'outbound','app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x19')+_0x53163b['id'],'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']}];if(_0x53163b[_0x5ac9('0x1a')](_0x5ac9('0x1b'))&&_0x53163b['recordingFormat']!=='none'){_0x352874[_0x5ac9('0xd')]({'type':'outbound','app':'Set','appdata':_0x5ac9('0x1c'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b[_0x5ac9('0xa')],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']},{'type':_0x5ac9('0x11'),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x1d')+_0x53163b[_0x5ac9('0x1b')]||_0x5ac9('0x1e'),'context':_0x53163b[_0x5ac9('0x5')],'exten':_0x53163b['exten'],'priority':_0x53a8db++,'VoiceExtensionId':_0x53163b['id']});}return _0x352874;}function _0x317823(_0x3c14f9,_0x535f20){var _0x598093=[{'name':_0x5ac9('0x1f'),'param':0x0},{'name':_0x5ac9('0x20'),'param':0x1},{'name':_0x5ac9('0x21'),'param':0x2},{'name':_0x5ac9('0x22'),'param':0x3}];var _0x5be935={};var _0x848f6d=_0x535f20['split'](',');var _0x3c540f=[];for(var _0x4600d8=0x0;_0x4600d8<_0x598093[_0x5ac9('0x23')];_0x4600d8++){switch(_0x598093[_0x4600d8][_0x5ac9('0x24')]){case _0x5ac9('0x1f'):_0x5be935[_0x5ac9('0x1f')]=_0x848f6d[_0x598093[_0x4600d8][_0x5ac9('0x25')]][_0x5ac9('0x26')]('/')[0x1];_0x5be935[_0x5ac9('0x27')]=_0x848f6d[_0x598093[_0x4600d8][_0x5ac9('0x25')]][_0x5ac9('0x26')]('/')[0x2];_0x5be935[_0x5ac9('0x28')]=_0x5be935['phone']?_0x5be935['phone'][_0x5ac9('0x26')]('$')[0x0]:undefined;_0x5be935[_0x5ac9('0x27')]=_0x3c14f9[_0x5ac9('0x15')]?(_0x5be935[_0x5ac9('0x28')]||'')+_0x5ac9('0x14')+_0x3c14f9[_0x5ac9('0x15')]+'}':(_0x5be935['prefix']||'')+_0x5ac9('0x29');_0x3c540f[_0x598093[_0x4600d8][_0x5ac9('0x25')]]=['SIP',_0x5be935['trunk'],_0x5be935['phone']][_0x5ac9('0x2a')]('/');break;case _0x5ac9('0x21'):_0x5be935[_0x5ac9('0x21')]=_0x848f6d[_0x598093[_0x4600d8][_0x5ac9('0x25')]];if(_0x3c14f9['recordingFormat']!==_0x5ac9('0x2b')){if(_0x5be935['options']['indexOf'](_0x5ac9('0x2c'))<0x0){_0x5be935[_0x5ac9('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x5be935[_0x5ac9('0x21')]=_0x5be935[_0x5ac9('0x21')]['replace'](_0x5ac9('0x2c'),'');}_0x3c540f[_0x598093[_0x4600d8][_0x5ac9('0x25')]]=_0x5be935[_0x5ac9('0x21')];break;default:_0x3c540f[_0x598093[_0x4600d8][_0x5ac9('0x25')]]=_0x848f6d[_0x598093[_0x4600d8][_0x5ac9('0x25')]];}}return _0x3c540f[_0x5ac9('0x2a')](',');}function _0x16b81d(_0x31975b,_0x2aac63,_0x2a3564){return new Promise(function(_0x26ccaa,_0x4cb50f){var _0x54e330=[];if(_[_0x5ac9('0x2d')](_0x2aac63))return _0x26ccaa(_0x54e330);_0x4c14a3[_0x5ac9('0x2e')][_0x5ac9('0x2f')]({'attributes':['id','interval',_0x5ac9('0x30')],'raw':!![]})[_0x5ac9('0x31')](function(_0x3b6aad){for(var _0x5adbed=0x0,_0x21f75a=0x0;_0x5adbed<_0x2aac63[_0x5ac9('0x23')];_0x5adbed++,_0x21f75a=0x0){var _0x3bf4ba=_0x2aac63[_0x5adbed];var _0x34b3c2=[];var _0x7e6a4f=[];delete _0x3bf4ba['id'];if(_0x3bf4ba[_0x5ac9('0x32')]!=='*,*,*,*'){_0x3bf4ba['intervals']=[_0x3bf4ba[_0x5ac9('0x32')]];}else{_0x3bf4ba['intervals']=_0x3bf4ba[_0x5ac9('0x30')]?_['map'](_[_0x5ac9('0x33')](_0x3b6aad,{'IntervalId':_0x3bf4ba[_0x5ac9('0x30')]}),_0x5ac9('0x32')):[];}_0x3bf4ba[_0x5ac9('0x5')]=_0x31975b[_0x5ac9('0x5')];_0x3bf4ba[_0x5ac9('0xa')]=_0x31975b[_0x5ac9('0xa')];if(_0x3bf4ba[_0x5ac9('0x3')])_0x3bf4ba[_0x5ac9('0x3')]=_0x3bf4ba[_0x5ac9('0x3')][_0x5ac9('0x34')]();if(_0x31975b['type']===_0x5ac9('0x11')){if(_0x3bf4ba[_0x5ac9('0x1a')]('tag')&&_0x3bf4ba['tag']&&_0x3bf4ba[_0x5ac9('0x35')]!=='--'){_0x34b3c2[_0x5ac9('0xd')]({'type':_0x3bf4ba[_0x5ac9('0x3')]['toLowerCase'](),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x36')+_0x3bf4ba[_0x5ac9('0x35')],'context':_0x31975b[_0x5ac9('0x5')],'exten':_0x31975b[_0x5ac9('0xa')],'priority':_0x3bf4ba[_0x5ac9('0x37')]['length']+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});}_0x34b3c2['push']({'type':_0x3bf4ba[_0x5ac9('0x3')][_0x5ac9('0x34')](),'app':'ExecIf','appdata':_0x5ac9('0x38')+(_0x3bf4ba[_0x5ac9('0x39')]?_0x5ac9('0x3a')+_0x3bf4ba[_0x5ac9('0x39')]+')':_0x5ac9('0x3b')),'context':_0x31975b['context'],'exten':_0x31975b[_0x5ac9('0xa')],'priority':_0x3bf4ba[_0x5ac9('0x37')][_0x5ac9('0x23')]+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});}else{if(_0x3bf4ba['hasOwnProperty'](_0x5ac9('0x3c'))){if([_0x5ac9('0x3d'),_0x5ac9('0x3e')][_0x5ac9('0x3f')](_0x3bf4ba[_0x5ac9('0x40')]['toLowerCase']())&&_0x3bf4ba['appType']!==_0x5ac9('0x41')){if(_0x3bf4ba['answer']){_0x34b3c2[_0x5ac9('0xd')]({'type':_0x3bf4ba['type'][_0x5ac9('0x34')](),'app':'ExecIf','appdata':_0x5ac9('0x42'),'context':_0x31975b[_0x5ac9('0x5')],'exten':_0x31975b['exten'],'priority':_0x3bf4ba['intervals'][_0x5ac9('0x23')]+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});_0x34b3c2[_0x5ac9('0xd')]({'type':_0x3bf4ba[_0x5ac9('0x3')][_0x5ac9('0x34')](),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x43'),'context':_0x31975b[_0x5ac9('0x5')],'exten':_0x31975b[_0x5ac9('0xa')],'priority':_0x3bf4ba['intervals'][_0x5ac9('0x23')]+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});}else{_0x34b3c2['push']({'type':_0x3bf4ba[_0x5ac9('0x3')][_0x5ac9('0x34')](),'app':'ExecIf','appdata':_0x5ac9('0x44'),'context':_0x31975b['context'],'exten':_0x31975b[_0x5ac9('0xa')],'priority':_0x3bf4ba[_0x5ac9('0x37')][_0x5ac9('0x23')]+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});_0x34b3c2[_0x5ac9('0xd')]({'type':_0x3bf4ba[_0x5ac9('0x3')]['toLowerCase'](),'app':_0x5ac9('0x7'),'appdata':_0x5ac9('0x45'),'context':_0x31975b[_0x5ac9('0x5')],'exten':_0x31975b['exten'],'priority':_0x3bf4ba[_0x5ac9('0x37')][_0x5ac9('0x23')]+_0x2a3564+_0x21f75a++,'VoiceExtensionId':_0x31975b['id']});}}}}for(var _0x3c45c8=0x0;_0x3c45c8<_0x3bf4ba['intervals'][_0x5ac9('0x23')];_0x3c45c8++){var _0x577f83=_0x2a3564+_0x3bf4ba[_0x5ac9('0x37')][_0x5ac9('0x23')];var _0x567fb1=_0x3c45c8===_0x3bf4ba['intervals'][_0x5ac9('0x23')]-0x1?_0x2a3564+_0x34b3c2[_0x5ac9('0x23')]+_0x7e6a4f[_0x5ac9('0x23')]+0x2:_0x2a3564+_0x3c45c8+0x1;_0x34b3c2[_0x5ac9('0x46')](_0x3c45c8,0x0,{'type':_0x31975b[_0x5ac9('0x3')],'app':_0x5ac9('0x47'),'appdata':_0x3bf4ba[_0x5ac9('0x37')][_0x3c45c8]+'?'+_0x31975b[_0x5ac9('0x5')]+',${EXTEN},'+_0x577f83+':'+_0x31975b[_0x5ac9('0x5')]+_0x5ac9('0x48')+_0x567fb1,'exten':_0x31975b['exten'],'context':_0x31975b['context'],'priority':_0x2a3564+_0x3c45c8,'VoiceExtensionId':_0x31975b['id']});}if(_0x3bf4ba[_0x5ac9('0x49')]===_0x5ac9('0x4a'))_0x3bf4ba['appdata']=_0x317823(_0x31975b,_0x3bf4ba[_0x5ac9('0x4b')]);_0x3bf4ba[_0x5ac9('0x4c')]=_0x34b3c2[_0x5ac9('0x23')]?_[_0x5ac9('0x4d')](_0x34b3c2)[_0x5ac9('0x4c')]+0x1:_0x2a3564;_0x54e330=_[_0x5ac9('0x4e')](_0x54e330,_0x34b3c2,[_0x3bf4ba],_0x7e6a4f);_0x2a3564=_[_0x5ac9('0x4d')](_0x54e330)[_0x5ac9('0x4c')]+0x1;}return _0x26ccaa(_0x54e330);})[_0x5ac9('0x4f')](function(_0xbf938e){_0x4cb50f(_0xbf938e);});});}return _0x471ff6[_0x5ac9('0x50')](_0x5ac9('0x51'),attributes,{'tableName':_0x5ac9('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xc966db){var _0x3b5233=this['get']({'plain':!![]});var _0x1c18d9=_0x3b5233['type']===_0x5ac9('0x11')?_0x460fd7(_0x3b5233):_0x4562f2(_0x3b5233);return _0x16b81d(_0x3b5233,_0xc966db,_[_0x5ac9('0x4d')](_0x1c18d9)[_0x5ac9('0x4c')]+0x1)['then'](function(_0x59354e){var _0x7eb14b=_[_0x5ac9('0x4e')](_0x1c18d9,_0x59354e);_0x7eb14b[_0x5ac9('0xd')]({'type':_0x3b5233['type'],'app':_0x5ac9('0x53'),'exten':_0x3b5233[_0x5ac9('0xa')],'context':_0x3b5233['context'],'priority':_['last'](_0x7eb14b)[_0x5ac9('0x4c')]+0x1,'VoiceExtensionId':_0x3b5233['id']});return _0x7eb14b;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ae9a9ef..2c69a3b 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 _0xb2ad=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','options','where','attributes','limit','include','map','model','debug','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e9825,_0x1efbcb){var _0x3146fa=function(_0x2eb4f6){while(--_0x2eb4f6){_0x1e9825['push'](_0x1e9825['shift']());}};_0x3146fa(++_0x1efbcb);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x5bfd73,_0x75230a){_0x5bfd73=_0x5bfd73-0x0;var _0x4eef87=_0xb2ad[_0x5bfd73];return _0x4eef87;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var moment=require('moment');var BPromise=require(_0xdb2a('0x1'));var rs=require(_0xdb2a('0x2'));var fs=require('fs');var Redis=require(_0xdb2a('0x3'));var db=require(_0xdb2a('0x4'))['db'];var utils=require(_0xdb2a('0x5'));var logger=require('../../config/logger')(_0xdb2a('0x6'));var config=require(_0xdb2a('0x7'));var jayson=require(_0xdb2a('0x8'));var client=jayson[_0xdb2a('0x9')][_0xdb2a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdb2a('0xb')],{'host':_0xdb2a('0xc'),'port':0x18eb});var socket=require(_0xdb2a('0xd'))(new Redis(config['redis']));require(_0xdb2a('0xe'))[_0xdb2a('0xf')](socket);function respondWithRpcPromise(_0x5d2a87,_0x3b1bbe,_0x39f48e){return new BPromise(function(_0x4bdf25,_0x591114){return client[_0xdb2a('0x10')](_0x5d2a87,_0x39f48e)[_0xdb2a('0x11')](function(_0x134425){logger['info'](_0xdb2a('0x12'),_0x3b1bbe,_0xdb2a('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3b1bbe,'request\x20sent',JSON[_0xdb2a('0x14')](_0x134425));if(_0x134425['error']){if(_0x134425[_0xdb2a('0x15')][_0xdb2a('0x16')]===0x1f4){logger['error'](_0xdb2a('0x12'),_0x3b1bbe,_0x134425['error']['message']);return _0x591114(_0x134425['error']['message']);}logger[_0xdb2a('0x15')](_0xdb2a('0x12'),_0x3b1bbe,_0x134425['error']['message']);return _0x4bdf25(_0x134425[_0xdb2a('0x15')][_0xdb2a('0x17')]);}else{logger[_0xdb2a('0x18')](_0xdb2a('0x12'),_0x3b1bbe,'request\x20sent');_0x4bdf25(_0x134425[_0xdb2a('0x19')][_0xdb2a('0x17')]);}})[_0xdb2a('0x1a')](function(_0x584981){logger['error'](_0xdb2a('0x12'),_0x3b1bbe,_0x584981);_0x591114(_0x584981);});});}exports[_0xdb2a('0x1b')]=function(_0x125233){var _0x3a9cb1=this;return new Promise(function(_0x2b64e4,_0x5e6a59){return db[_0xdb2a('0x1c')]['findAll']({'raw':_0x125233[_0xdb2a('0x1d')]?_0x125233['options']['raw']===undefined?!![]:![]:!![],'where':_0x125233[_0xdb2a('0x1d')]?_0x125233[_0xdb2a('0x1d')][_0xdb2a('0x1e')]||null:null,'attributes':_0x125233['options']?_0x125233[_0xdb2a('0x1d')][_0xdb2a('0x1f')]||null:null,'limit':_0x125233[_0xdb2a('0x1d')]?_0x125233[_0xdb2a('0x1d')][_0xdb2a('0x20')]||null:null,'include':_0x125233[_0xdb2a('0x1d')]?_0x125233['options'][_0xdb2a('0x21')]?_[_0xdb2a('0x22')](_0x125233['options'][_0xdb2a('0x21')],function(_0x3645e9){return{'model':db[_0x3645e9[_0xdb2a('0x23')]],'as':_0x3645e9['as'],'attributes':_0x3645e9[_0xdb2a('0x1f')],'include':_0x3645e9['include']?_[_0xdb2a('0x22')](_0x3645e9[_0xdb2a('0x21')],function(_0x3439c1){return{'model':db[_0x3439c1[_0xdb2a('0x23')]],'as':_0x3439c1['as'],'attributes':_0x3439c1['attributes'],'include':_0x3439c1[_0xdb2a('0x21')]?_[_0xdb2a('0x22')](_0x3439c1[_0xdb2a('0x21')],function(_0x2b1c6d){return{'model':db[_0x2b1c6d[_0xdb2a('0x23')]],'as':_0x2b1c6d['as'],'attributes':_0x2b1c6d['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb2a('0x11')](function(_0x19e39c){logger[_0xdb2a('0x18')](_0xdb2a('0x1b'),_0x125233);logger[_0xdb2a('0x24')](_0xdb2a('0x1b'),_0x125233,JSON[_0xdb2a('0x14')](_0x19e39c));_0x2b64e4(_0x19e39c);})[_0xdb2a('0x1a')](function(_0x3c55cc){logger[_0xdb2a('0x15')](_0xdb2a('0x1b'),_0x3c55cc[_0xdb2a('0x17')],_0x125233);_0x5e6a59(_0x3a9cb1[_0xdb2a('0x15')](0x1f4,_0x3c55cc[_0xdb2a('0x17')]));});});}; \ No newline at end of file +var _0x3cd8=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceExtension','options','raw','where','include','model','attributes','map','GetVoiceExtension','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x2d8bb6,_0x950991){var _0xf7aad3=function(_0x53ea1d){while(--_0x53ea1d){_0x2d8bb6['push'](_0x2d8bb6['shift']());}};_0xf7aad3(++_0x950991);}(_0x3cd8,0x150));var _0x83cd=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x3cd8[_0x1b4002];return _0x1716f3;};'use strict';var _=require(_0x83cd('0x0'));var util=require(_0x83cd('0x1'));var moment=require(_0x83cd('0x2'));var BPromise=require(_0x83cd('0x3'));var rs=require(_0x83cd('0x4'));var fs=require('fs');var Redis=require(_0x83cd('0x5'));var db=require(_0x83cd('0x6'))['db'];var utils=require(_0x83cd('0x7'));var logger=require('../../config/logger')(_0x83cd('0x8'));var config=require(_0x83cd('0x9'));var jayson=require(_0x83cd('0xa'));var client=jayson[_0x83cd('0xb')][_0x83cd('0xc')]({'port':0x232a});config[_0x83cd('0xd')]=_[_0x83cd('0xe')](config[_0x83cd('0xd')],{'host':_0x83cd('0xf'),'port':0x18eb});var socket=require(_0x83cd('0x10'))(new Redis(config[_0x83cd('0xd')]));require(_0x83cd('0x11'))[_0x83cd('0x12')](socket);function respondWithRpcPromise(_0x2d4adb,_0x39b755,_0xf8f9dd){return new BPromise(function(_0x1f05f1,_0x26b989){return client[_0x83cd('0x13')](_0x2d4adb,_0xf8f9dd)[_0x83cd('0x14')](function(_0x49626a){logger[_0x83cd('0x15')](_0x83cd('0x16'),_0x39b755,_0x83cd('0x17'));logger[_0x83cd('0x18')](_0x83cd('0x19'),_0x39b755,_0x83cd('0x17'),JSON[_0x83cd('0x1a')](_0x49626a));if(_0x49626a[_0x83cd('0x1b')]){if(_0x49626a['error'][_0x83cd('0x1c')]===0x1f4){logger[_0x83cd('0x1b')](_0x83cd('0x16'),_0x39b755,_0x49626a[_0x83cd('0x1b')][_0x83cd('0x1d')]);return _0x26b989(_0x49626a[_0x83cd('0x1b')]['message']);}logger['error'](_0x83cd('0x16'),_0x39b755,_0x49626a[_0x83cd('0x1b')][_0x83cd('0x1d')]);return _0x1f05f1(_0x49626a[_0x83cd('0x1b')][_0x83cd('0x1d')]);}else{logger[_0x83cd('0x15')](_0x83cd('0x16'),_0x39b755,_0x83cd('0x17'));_0x1f05f1(_0x49626a['result'][_0x83cd('0x1d')]);}})['catch'](function(_0x3fe83a){logger[_0x83cd('0x1b')](_0x83cd('0x16'),_0x39b755,_0x3fe83a);_0x26b989(_0x3fe83a);});});}exports['GetVoiceExtension']=function(_0x4c84d3){var _0x2819d6=this;return new Promise(function(_0x50e044,_0x2748ba){return db[_0x83cd('0x1e')]['findAll']({'raw':_0x4c84d3[_0x83cd('0x1f')]?_0x4c84d3[_0x83cd('0x1f')][_0x83cd('0x20')]===undefined?!![]:![]:!![],'where':_0x4c84d3[_0x83cd('0x1f')]?_0x4c84d3[_0x83cd('0x1f')][_0x83cd('0x21')]||null:null,'attributes':_0x4c84d3[_0x83cd('0x1f')]?_0x4c84d3[_0x83cd('0x1f')]['attributes']||null:null,'limit':_0x4c84d3['options']?_0x4c84d3[_0x83cd('0x1f')]['limit']||null:null,'include':_0x4c84d3[_0x83cd('0x1f')]?_0x4c84d3[_0x83cd('0x1f')][_0x83cd('0x22')]?_['map'](_0x4c84d3[_0x83cd('0x1f')][_0x83cd('0x22')],function(_0x3558fa){return{'model':db[_0x3558fa[_0x83cd('0x23')]],'as':_0x3558fa['as'],'attributes':_0x3558fa[_0x83cd('0x24')],'include':_0x3558fa[_0x83cd('0x22')]?_[_0x83cd('0x25')](_0x3558fa[_0x83cd('0x22')],function(_0x5a9899){return{'model':db[_0x5a9899[_0x83cd('0x23')]],'as':_0x5a9899['as'],'attributes':_0x5a9899[_0x83cd('0x24')],'include':_0x5a9899[_0x83cd('0x22')]?_[_0x83cd('0x25')](_0x5a9899[_0x83cd('0x22')],function(_0x9dbb16){return{'model':db[_0x9dbb16[_0x83cd('0x23')]],'as':_0x9dbb16['as'],'attributes':_0x9dbb16[_0x83cd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x83cd('0x14')](function(_0x1edfd3){logger[_0x83cd('0x15')]('GetVoiceExtension',_0x4c84d3);logger[_0x83cd('0x18')](_0x83cd('0x26'),_0x4c84d3,JSON['stringify'](_0x1edfd3));_0x50e044(_0x1edfd3);})[_0x83cd('0x27')](function(_0xbedd59){logger['error']('GetVoiceExtension',_0xbedd59['message'],_0x4c84d3);_0x2748ba(_0x2819d6[_0x83cd('0x1b')](0x1f4,_0xbedd59[_0x83cd('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ecd6a43..47b8f2d 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x7aee77,_0x583ded){var _0x1897ee=function(_0x5d5ed7){while(--_0x5d5ed7){_0x7aee77['push'](_0x7aee77['shift']());}};_0x1897ee(++_0x583ded);}(_0x1261,0x144));var _0x1126=function(_0x1e4870,_0x470ac0){_0x1e4870=_0x1e4870-0x0;var _0x243d39=_0x1261[_0x1e4870];return _0x243d39;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x43988b,_0x5a8d7b){_0x43988b=_0x43988b-0x0;var _0x56035b=_0x1cb9[_0x43988b];return _0x56035b;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8a6dc03..cc86308 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 _0x5fdc=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id/messages','getMessages','create','put','/:id','update'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x5fdc,0x127));var _0xc5fd=function(_0x409ab9,_0x2db9ce){_0x409ab9=_0x409ab9-0x0;var _0x23bb79=_0x5fdc[_0x409ab9];return _0x23bb79;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var fs_extra=require(_0xc5fd('0x6'));var auth=require(_0xc5fd('0x7'));var interaction=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var controller=require(_0xc5fd('0xa'));router[_0xc5fd('0xb')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc5fd('0xb')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0x11')](_0xc5fd('0x12'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x13')]);router[_0xc5fd('0x14')]('/:id',auth[_0xc5fd('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x575991,_0x1b2f1c){var _0x2596e6=function(_0xe736b2){while(--_0xe736b2){_0x575991['push'](_0x575991['shift']());}};_0x2596e6(++_0x1b2f1c);}(_0xd046,0x129));var _0x6d04=function(_0x10676d,_0x380f38){_0x10676d=_0x10676d-0x0;var _0x57b077=_0xd046[_0x10676d];return _0x57b077;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('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 b34016c..0a07f65 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 _0x153a=['exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x214ef1,_0x22234a){var _0x411e45=function(_0x593186){while(--_0x593186){_0x214ef1['push'](_0x214ef1['shift']());}};_0x411e45(++_0x22234a);}(_0x153a,0xed));var _0xa153=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x153a[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xa153('0x0'));module[_0xa153('0x1')]={'customer_id':{'type':Sequelize[_0xa153('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xa153('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xa153('0x3')},'password':{'type':Sequelize[_0xa153('0x2')]},'fullname':{'type':Sequelize[_0xa153('0x2')]},'email':{'type':Sequelize[_0xa153('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5cf370){this[_0xa153('0x4')](_0xa153('0x5'),typeof _0x5cf370===_0xa153('0x6')&&_0x5cf370[_0xa153('0x7')]()?_0x5cf370[_0xa153('0x7')]():null);}},'pager':{'type':Sequelize[_0xa153('0x2')]},'tz':{'type':Sequelize[_0xa153('0x2')],'defaultValue':_0xa153('0x8')},'attach':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':_0xa153('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':_0xa153('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa153('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa153('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa153('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xa153('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':_0xa153('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xa153('0x9')](_0xa153('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xa153('0xa'),'no'),'defaultValue':_0xa153('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xa153('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa153('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa153('0xc')],'get':function(){return this['getDataValue'](_0xa153('0xd'))+_0xa153('0xe')+this[_0xa153('0xf')](_0xa153('0x10'));}}}; \ No newline at end of file +var _0x24de=['email','trim','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x4ecfe4,_0x3ce278){var _0x2dcd9b=function(_0x4c4939){while(--_0x4c4939){_0x4ecfe4['push'](_0x4ecfe4['shift']());}};_0x2dcd9b(++_0x3ce278);}(_0x24de,0xcc));var _0xe24d=function(_0x2dfe0a,_0x45fb43){_0x2dfe0a=_0x2dfe0a-0x0;var _0x54ac57=_0x24de[_0x2dfe0a];return _0x54ac57;};'use strict';var Sequelize=require(_0xe24d('0x0'));module[_0xe24d('0x1')]={'customer_id':{'type':Sequelize[_0xe24d('0x2')]},'context':{'type':Sequelize[_0xe24d('0x2')],'defaultValue':_0xe24d('0x3'),'unique':_0xe24d('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xe24d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x340b3a){this[_0xe24d('0x5')](_0xe24d('0x6'),typeof _0x340b3a==='string'&&_0x340b3a[_0xe24d('0x7')]()?_0x340b3a[_0xe24d('0x7')]():null);}},'pager':{'type':Sequelize[_0xe24d('0x2')]},'tz':{'type':Sequelize[_0xe24d('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xe24d('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xe24d('0x2')]},'review':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe24d('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe24d('0x8')](_0xe24d('0x9'),'no'),'defaultValue':_0xe24d('0x9'),'allowNull':![]},'stamp':{'type':_0xe24d('0xa')},'emailsubject':{'type':Sequelize[_0xe24d('0x2')]},'emailbody':{'type':Sequelize[_0xe24d('0x2')]},'maxsecs':{'type':Sequelize[_0xe24d('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe24d('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe24d('0xc')](_0xe24d('0xd'))+'\x20-\x20'+this[_0xe24d('0xc')](_0xe24d('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 28b0c2a..51f5c05 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 _0x44a3=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','VoiceMail','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','getMessages','findOne','params','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring'];(function(_0x572e40,_0x2632af){var _0x33025e=function(_0x3b398e){while(--_0x3b398e){_0x572e40['push'](_0x572e40['shift']());}};_0x33025e(++_0x2632af);}(_0x44a3,0x1a9));var _0x344a=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x44a3[_0x529abc];return _0x453afa;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];function respondWithStatusCode(_0x57e42e,_0x4a69ea){_0x4a69ea=_0x4a69ea||0xcc;return function(_0x304b70){if(_0x304b70){return _0x57e42e[_0x344a('0x17')](_0x4a69ea);}return _0x57e42e[_0x344a('0x18')](_0x4a69ea)[_0x344a('0x19')]();};}function respondWithResult(_0x5a0df6,_0x133ad4){_0x133ad4=_0x133ad4||0xc8;return function(_0x4ee562){if(_0x4ee562){return _0x5a0df6[_0x344a('0x18')](_0x133ad4)[_0x344a('0x1a')](_0x4ee562);}};}function respondWithFilteredResult(_0xce0f65,_0x6e1639){return function(_0x58c8cd){if(_0x58c8cd){var _0x54a643=typeof _0x6e1639[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x6e1639[_0x344a('0x1d')]===_0x344a('0x1c');var _0x48b3ab=_0x58c8cd[_0x344a('0x1e')];var _0x277c06=_0x54a643?0x0:_0x6e1639['offset'];var _0x9fe854=_0x54a643?_0x58c8cd[_0x344a('0x1e')]:_0x6e1639[_0x344a('0x1b')]+_0x6e1639[_0x344a('0x1d')];var _0x13b382;if(_0x9fe854>=_0x48b3ab){_0x9fe854=_0x48b3ab;_0x13b382=0xc8;}else{_0x13b382=0xce;}_0xce0f65[_0x344a('0x18')](_0x13b382);return _0xce0f65[_0x344a('0x1f')](_0x344a('0x20'),_0x277c06+'-'+_0x9fe854+'/'+_0x48b3ab)[_0x344a('0x1a')](_0x58c8cd);}return null;};}function patchUpdates(_0x450922){return function(_0x4b3552){try{jsonpatch[_0x344a('0x21')](_0x4b3552,_0x450922,!![]);}catch(_0x4232eb){return BPromise[_0x344a('0x22')](_0x4232eb);}return _0x4b3552[_0x344a('0x23')]();};}function saveUpdates(_0x240be3,_0x80ae12){return function(_0x185303){if(_0x185303){return _0x185303[_0x344a('0x24')](_0x240be3)[_0x344a('0x25')](function(_0x27f527){return _0x27f527;});}return null;};}function removeEntity(_0x90070c,_0x3b2ab9){return function(_0x5ce9da){if(_0x5ce9da){return _0x5ce9da[_0x344a('0x26')]()['then'](function(){var _0x6ccfba=_0x5ce9da['get']({'plain':!![]});var _0x2a5e49='Voicemails';return db[_0x344a('0x27')][_0x344a('0x26')]({'where':{'type':_0x2a5e49,'resourceId':_0x6ccfba['id']}})[_0x344a('0x25')](function(){return _0x5ce9da;});})[_0x344a('0x25')](function(){_0x90070c[_0x344a('0x18')](0xcc)[_0x344a('0x19')]();});}};}function handleEntityNotFound(_0x229ccd,_0x114637){return function(_0x4f2499){if(!_0x4f2499){_0x229ccd[_0x344a('0x17')](0x194);}return _0x4f2499;};}function handleError(_0x18be46,_0x26cf51){_0x26cf51=_0x26cf51||0x1f4;return function(_0xc02d6){logger[_0x344a('0x28')](_0xc02d6[_0x344a('0x29')]);if(_0xc02d6['name']){delete _0xc02d6[_0x344a('0x2a')];}_0x18be46['status'](_0x26cf51)['send'](_0xc02d6);};}exports[_0x344a('0x2b')]=function(_0x14fa86,_0x5a36bb){var _0x4803db={},_0x5cd9c6={},_0x5cafd2={'count':0x0,'rows':[]};var _0x16f490=_[_0x344a('0x2c')](db[_0x344a('0x2d')]['rawAttributes'],function(_0x25b28d){return{'name':_0x25b28d[_0x344a('0x2e')],'type':_0x25b28d[_0x344a('0x2f')][_0x344a('0x30')]};});_0x5cd9c6[_0x344a('0x31')]=_[_0x344a('0x2c')](_0x16f490,_0x344a('0x2a'));_0x5cd9c6['query']=_[_0x344a('0x32')](_0x14fa86['query']);_0x5cd9c6['filters']=_['intersection'](_0x5cd9c6[_0x344a('0x31')],_0x5cd9c6[_0x344a('0x33')]);_0x4803db[_0x344a('0x34')]=_[_0x344a('0x35')](_0x5cd9c6[_0x344a('0x31')],qs[_0x344a('0x36')](_0x14fa86['query'][_0x344a('0x36')]));_0x4803db[_0x344a('0x34')]=_0x4803db[_0x344a('0x34')]['length']?_0x4803db[_0x344a('0x34')]:_0x5cd9c6[_0x344a('0x31')];if(!_0x14fa86[_0x344a('0x33')][_0x344a('0x37')](_0x344a('0x38'))){_0x4803db['limit']=qs[_0x344a('0x1d')](_0x14fa86[_0x344a('0x33')][_0x344a('0x1d')]);_0x4803db[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0x14fa86['query'][_0x344a('0x1b')]);}_0x4803db[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x14fa86[_0x344a('0x33')][_0x344a('0x3a')]);_0x4803db['where']=qs[_0x344a('0x3b')](_[_0x344a('0x3c')](_0x14fa86[_0x344a('0x33')],_0x5cd9c6[_0x344a('0x3b')]),_0x16f490);if(_0x14fa86[_0x344a('0x33')][_0x344a('0x3d')]){_0x4803db[_0x344a('0x3e')]=_[_0x344a('0x3f')](_0x4803db['where'],{'$or':_[_0x344a('0x2c')](_0x16f490,function(_0x371c68){if(_0x371c68[_0x344a('0x2f')]!==_0x344a('0x40')){var _0x2fc05f={};_0x2fc05f[_0x371c68['name']]={'$like':'%'+_0x14fa86[_0x344a('0x33')][_0x344a('0x3d')]+'%'};return _0x2fc05f;}})});}_0x4803db=_[_0x344a('0x3f')]({},_0x4803db,_0x14fa86[_0x344a('0x41')]);var _0x2f5132={'where':_0x4803db[_0x344a('0x3e')]};return db[_0x344a('0x2d')][_0x344a('0x1e')](_0x2f5132)[_0x344a('0x25')](function(_0x4b1bac){_0x5cafd2[_0x344a('0x1e')]=_0x4b1bac;if(_0x14fa86[_0x344a('0x33')][_0x344a('0x42')]){_0x4803db[_0x344a('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x344a('0x44')](_0x4803db);})[_0x344a('0x25')](function(_0x2b0ee9){_0x5cafd2[_0x344a('0x45')]=_0x2b0ee9;return _0x5cafd2;})[_0x344a('0x25')](respondWithFilteredResult(_0x5a36bb,_0x4803db))[_0x344a('0x46')](handleError(_0x5a36bb,null));};exports[_0x344a('0x47')]=function(_0x372e7d,_0x483c39){var _0x4509be={'raw':!![],'where':{'id':_0x372e7d['params']['id']}},_0x2de5aa={};_0x2de5aa[_0x344a('0x31')]=_[_0x344a('0x32')](db['VoiceMail'][_0x344a('0x48')]);_0x2de5aa[_0x344a('0x33')]=_['keys'](_0x372e7d[_0x344a('0x33')]);_0x2de5aa[_0x344a('0x3b')]=_['intersection'](_0x2de5aa[_0x344a('0x31')],_0x2de5aa[_0x344a('0x33')]);_0x4509be[_0x344a('0x34')]=_['intersection'](_0x2de5aa[_0x344a('0x31')],qs['fields'](_0x372e7d[_0x344a('0x33')][_0x344a('0x36')]));_0x4509be[_0x344a('0x34')]=_0x4509be[_0x344a('0x34')]['length']?_0x4509be['attributes']:_0x2de5aa[_0x344a('0x31')];if(_0x372e7d[_0x344a('0x33')][_0x344a('0x42')]){_0x4509be[_0x344a('0x43')]=[{'all':!![]}];}_0x4509be=_[_0x344a('0x3f')]({},_0x4509be,_0x372e7d[_0x344a('0x41')]);return db[_0x344a('0x2d')][_0x344a('0x49')](_0x4509be)[_0x344a('0x25')](handleEntityNotFound(_0x483c39,null))[_0x344a('0x25')](respondWithResult(_0x483c39,null))['catch'](handleError(_0x483c39,null));};exports[_0x344a('0x4a')]=function(_0x2d9858,_0x6fad37){return db[_0x344a('0x2d')]['create'](_0x2d9858[_0x344a('0x4b')],{})['then'](function(_0x590f77){var _0xa6b6b5=_0x2d9858[_0x344a('0x4c')]['get']({'plain':!![]});if(!_0xa6b6b5)throw new Error(_0x344a('0x4d'));if(_0xa6b6b5[_0x344a('0x4e')]===_0x344a('0x4c')){var _0x226f41=_0x590f77['get']({'plain':!![]});var _0x225fce=_0x344a('0x4f');return db[_0x344a('0x50')][_0x344a('0x49')]({'where':{'name':_0x225fce,'userProfileId':_0xa6b6b5[_0x344a('0x51')]},'raw':!![]})[_0x344a('0x25')](function(_0x45232c){if(_0x45232c&&_0x45232c[_0x344a('0x52')]===0x0){return db[_0x344a('0x27')][_0x344a('0x4a')]({'name':_0x226f41['name'],'resourceId':_0x226f41['id'],'type':_0x45232c[_0x344a('0x2a')],'sectionId':_0x45232c['id']},{})['then'](function(){return _0x590f77;});}else{return _0x590f77;}})[_0x344a('0x46')](function(_0xb744c6){logger[_0x344a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb744c6);throw _0xb744c6;});}return _0x590f77;})[_0x344a('0x25')](respondWithResult(_0x6fad37,0xc9))[_0x344a('0x46')](handleError(_0x6fad37,null));};exports[_0x344a('0x24')]=function(_0x14921e,_0x346cf3){if(_0x14921e[_0x344a('0x4b')]['id']){delete _0x14921e[_0x344a('0x4b')]['id'];}return db[_0x344a('0x2d')][_0x344a('0x49')]({'where':{'id':_0x14921e['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x346cf3,null))[_0x344a('0x25')](saveUpdates(_0x14921e[_0x344a('0x4b')],null))[_0x344a('0x25')](respondWithResult(_0x346cf3,null))[_0x344a('0x46')](handleError(_0x346cf3,null));};exports['destroy']=function(_0x33077f,_0x163047){return db[_0x344a('0x2d')][_0x344a('0x49')]({'where':{'id':_0x33077f['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x163047,null))[_0x344a('0x25')](removeEntity(_0x163047,null))['catch'](handleError(_0x163047,null));};exports[_0x344a('0x53')]=function(_0x11d301,_0x16482c,_0x2ea2ad){return db[_0x344a('0x2d')][_0x344a('0x54')]({'where':{'id':_0x11d301[_0x344a('0x55')]['id']}})['then'](handleEntityNotFound(_0x16482c,null))['then'](function(_0x4d707b){var _0x41dc89;var _0x450a64={},_0x2acfc0={};_0x2acfc0[_0x344a('0x31')]=_['keys'](db[_0x344a('0x56')]['rawAttributes']);_0x2acfc0['query']=_['keys'](_0x11d301['query']);_0x2acfc0[_0x344a('0x3b')]=_[_0x344a('0x35')](_0x2acfc0[_0x344a('0x31')],_0x2acfc0[_0x344a('0x33')]);_0x450a64['attributes']=_['intersection'](_0x2acfc0['model'],qs[_0x344a('0x36')](_0x11d301[_0x344a('0x33')][_0x344a('0x36')]));_0x450a64[_0x344a('0x34')]=_0x450a64[_0x344a('0x34')]['length']?_0x450a64[_0x344a('0x34')]:_0x2acfc0[_0x344a('0x31')];if(!_0x11d301[_0x344a('0x33')]['hasOwnProperty'](_0x344a('0x38'))){_0x450a64['limit']=qs['limit'](_0x11d301[_0x344a('0x33')]['limit']);_0x450a64['offset']=qs[_0x344a('0x1b')](_0x11d301[_0x344a('0x33')]['offset']);}_0x450a64[_0x344a('0x39')]=qs['sort'](_0x11d301[_0x344a('0x33')][_0x344a('0x3a')]);_0x450a64[_0x344a('0x3e')]=qs['filters'](_['pick'](_0x11d301[_0x344a('0x33')],_0x2acfc0[_0x344a('0x3b')]));if(_0x11d301[_0x344a('0x33')][_0x344a('0x3d')]){_0x450a64['where']=_['merge'](_0x450a64[_0x344a('0x3e')],{'$or':_[_0x344a('0x2c')](_0x450a64[_0x344a('0x34')],function(_0x4f5119){var _0x827f2e={};_0x827f2e[_0x4f5119]={'$like':'%'+_0x11d301[_0x344a('0x33')]['filter']+'%'};return _0x827f2e;})});}_0x450a64[_0x344a('0x3e')]=_['merge'](_0x450a64[_0x344a('0x3e')],{'mailboxuser':_0x4d707b['mailbox']});_0x450a64=_['merge']({},_0x450a64,_0x11d301['options']);return db[_0x344a('0x56')][_0x344a('0x57')](_0x450a64)[_0x344a('0x25')](respondWithFilteredResult(_0x16482c,_0x450a64));})[_0x344a('0x46')](handleError(_0x16482c,null));}; \ No newline at end of file +var _0x282b=['json','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','VoiceMail','includeAll','include','findAll','catch','show','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x282b,0xec));var _0xb282=function(_0xdc4da5,_0x1ad452){_0xdc4da5=_0xdc4da5-0x0;var _0x958a17=_0x282b[_0xdc4da5];return _0x958a17;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){var _0x5e828e=_0x360f15[_0xb282('0x25')]({'plain':!![]});var _0x114f77=_0xb282('0x26');return db[_0xb282('0x27')][_0xb282('0x24')]({'where':{'type':_0x114f77,'resourceId':_0x5e828e['id']}})[_0xb282('0x23')](function(){return _0x360f15;});})['then'](function(){_0x56645f[_0xb282('0x18')](0xcc)[_0xb282('0x28')]();});}};}function handleEntityNotFound(_0x50bd73,_0x22d895){return function(_0x38a1f8){if(!_0x38a1f8){_0x50bd73[_0xb282('0x17')](0x194);}return _0x38a1f8;};}function handleError(_0x280940,_0x59644e){_0x59644e=_0x59644e||0x1f4;return function(_0x1520b1){logger[_0xb282('0x29')](_0x1520b1[_0xb282('0x2a')]);if(_0x1520b1[_0xb282('0x2b')]){delete _0x1520b1[_0xb282('0x2b')];}_0x280940[_0xb282('0x18')](_0x59644e)[_0xb282('0x2c')](_0x1520b1);};}exports['index']=function(_0x1b15b5,_0x1e2861){var _0x3eb294={},_0xd8780b={},_0x42ef75={'count':0x0,'rows':[]};var _0x5f3ddf=_[_0xb282('0x2d')](db['VoiceMail'][_0xb282('0x2e')],function(_0x1bf721){return{'name':_0x1bf721[_0xb282('0x2f')],'type':_0x1bf721['type'][_0xb282('0x30')]};});_0xd8780b['model']=_[_0xb282('0x2d')](_0x5f3ddf,_0xb282('0x2b'));_0xd8780b[_0xb282('0x31')]=_[_0xb282('0x32')](_0x1b15b5[_0xb282('0x31')]);_0xd8780b[_0xb282('0x33')]=_['intersection'](_0xd8780b[_0xb282('0x34')],_0xd8780b[_0xb282('0x31')]);_0x3eb294['attributes']=_['intersection'](_0xd8780b[_0xb282('0x34')],qs[_0xb282('0x35')](_0x1b15b5[_0xb282('0x31')]['fields']));_0x3eb294['attributes']=_0x3eb294['attributes'][_0xb282('0x36')]?_0x3eb294[_0xb282('0x37')]:_0xd8780b[_0xb282('0x34')];if(!_0x1b15b5[_0xb282('0x31')][_0xb282('0x38')](_0xb282('0x39'))){_0x3eb294[_0xb282('0x1b')]=qs['limit'](_0x1b15b5[_0xb282('0x31')]['limit']);_0x3eb294[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1b15b5[_0xb282('0x31')]['offset']);}_0x3eb294[_0xb282('0x3a')]=qs['sort'](_0x1b15b5[_0xb282('0x31')][_0xb282('0x3b')]);_0x3eb294[_0xb282('0x3c')]=qs[_0xb282('0x33')](_['pick'](_0x1b15b5['query'],_0xd8780b[_0xb282('0x33')]),_0x5f3ddf);if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]){_0x3eb294[_0xb282('0x3c')]=_['merge'](_0x3eb294[_0xb282('0x3c')],{'$or':_['map'](_0x5f3ddf,function(_0x475895){if(_0x475895[_0xb282('0x3e')]!=='VIRTUAL'){var _0x41f2c4={};_0x41f2c4[_0x475895[_0xb282('0x2b')]]={'$like':'%'+_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]+'%'};return _0x41f2c4;}})});}_0x3eb294=_[_0xb282('0x3f')]({},_0x3eb294,_0x1b15b5[_0xb282('0x40')]);var _0x43e87e={'where':_0x3eb294[_0xb282('0x3c')]};return db[_0xb282('0x41')][_0xb282('0x1c')](_0x43e87e)[_0xb282('0x23')](function(_0x91fe43){_0x42ef75[_0xb282('0x1c')]=_0x91fe43;if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x42')]){_0x3eb294[_0xb282('0x43')]=[{'all':!![]}];}return db[_0xb282('0x41')][_0xb282('0x44')](_0x3eb294);})['then'](function(_0x310ad1){_0x42ef75['rows']=_0x310ad1;return _0x42ef75;})[_0xb282('0x23')](respondWithFilteredResult(_0x1e2861,_0x3eb294))[_0xb282('0x45')](handleError(_0x1e2861,null));};exports[_0xb282('0x46')]=function(_0x2f2ce8,_0x197472){var _0x3ddf56={'raw':!![],'where':{'id':_0x2f2ce8['params']['id']}},_0x5a6c0d={};_0x5a6c0d[_0xb282('0x34')]=_['keys'](db[_0xb282('0x41')][_0xb282('0x2e')]);_0x5a6c0d['query']=_[_0xb282('0x32')](_0x2f2ce8[_0xb282('0x31')]);_0x5a6c0d[_0xb282('0x33')]=_['intersection'](_0x5a6c0d['model'],_0x5a6c0d[_0xb282('0x31')]);_0x3ddf56['attributes']=_[_0xb282('0x47')](_0x5a6c0d[_0xb282('0x34')],qs[_0xb282('0x35')](_0x2f2ce8[_0xb282('0x31')][_0xb282('0x35')]));_0x3ddf56[_0xb282('0x37')]=_0x3ddf56['attributes'][_0xb282('0x36')]?_0x3ddf56[_0xb282('0x37')]:_0x5a6c0d[_0xb282('0x34')];if(_0x2f2ce8['query'][_0xb282('0x42')]){_0x3ddf56['include']=[{'all':!![]}];}_0x3ddf56=_[_0xb282('0x3f')]({},_0x3ddf56,_0x2f2ce8['options']);return db[_0xb282('0x41')]['find'](_0x3ddf56)['then'](handleEntityNotFound(_0x197472,null))['then'](respondWithResult(_0x197472,null))[_0xb282('0x45')](handleError(_0x197472,null));};exports[_0xb282('0x48')]=function(_0x42d99f,_0x7a5aa4){return db['VoiceMail']['create'](_0x42d99f['body'],{})[_0xb282('0x23')](function(_0x255ad5){var _0x3bed8d=_0x42d99f[_0xb282('0x49')]['get']({'plain':!![]});if(!_0x3bed8d)throw new Error(_0xb282('0x4a'));if(_0x3bed8d[_0xb282('0x4b')]==='user'){var _0x33bded=_0x255ad5[_0xb282('0x25')]({'plain':!![]});var _0x16f66b=_0xb282('0x26');return db[_0xb282('0x4c')]['find']({'where':{'name':_0x16f66b,'userProfileId':_0x3bed8d[_0xb282('0x4d')]},'raw':!![]})[_0xb282('0x23')](function(_0x465209){if(_0x465209&&_0x465209[_0xb282('0x4e')]===0x0){return db[_0xb282('0x27')][_0xb282('0x48')]({'name':_0x33bded['name'],'resourceId':_0x33bded['id'],'type':_0x465209[_0xb282('0x2b')],'sectionId':_0x465209['id']},{})['then'](function(){return _0x255ad5;});}else{return _0x255ad5;}})[_0xb282('0x45')](function(_0x1e6ade){logger['error'](_0xb282('0x4f'),_0x1e6ade);throw _0x1e6ade;});}return _0x255ad5;})[_0xb282('0x23')](respondWithResult(_0x7a5aa4,0xc9))[_0xb282('0x45')](handleError(_0x7a5aa4,null));};exports['update']=function(_0x51cbb0,_0x1028b9){if(_0x51cbb0[_0xb282('0x50')]['id']){delete _0x51cbb0[_0xb282('0x50')]['id'];}return db['VoiceMail'][_0xb282('0x51')]({'where':{'id':_0x51cbb0['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x1028b9,null))[_0xb282('0x23')](saveUpdates(_0x51cbb0['body'],null))[_0xb282('0x23')](respondWithResult(_0x1028b9,null))['catch'](handleError(_0x1028b9,null));};exports[_0xb282('0x24')]=function(_0x34b31a,_0x2e6eaa){return db[_0xb282('0x41')][_0xb282('0x51')]({'where':{'id':_0x34b31a[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e6eaa,null))[_0xb282('0x23')](removeEntity(_0x2e6eaa,null))['catch'](handleError(_0x2e6eaa,null));};exports[_0xb282('0x53')]=function(_0x34baf2,_0x53d50a,_0x597793){return db[_0xb282('0x41')][_0xb282('0x54')]({'where':{'id':_0x34baf2[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x53d50a,null))['then'](function(_0x40ae87){var _0x2dbbc4;var _0x3716b0={},_0x5d6a78={};_0x5d6a78[_0xb282('0x34')]=_['keys'](db[_0xb282('0x55')][_0xb282('0x2e')]);_0x5d6a78[_0xb282('0x31')]=_[_0xb282('0x32')](_0x34baf2[_0xb282('0x31')]);_0x5d6a78[_0xb282('0x33')]=_[_0xb282('0x47')](_0x5d6a78['model'],_0x5d6a78[_0xb282('0x31')]);_0x3716b0[_0xb282('0x37')]=_[_0xb282('0x47')](_0x5d6a78['model'],qs['fields'](_0x34baf2[_0xb282('0x31')][_0xb282('0x35')]));_0x3716b0[_0xb282('0x37')]=_0x3716b0['attributes']['length']?_0x3716b0[_0xb282('0x37')]:_0x5d6a78[_0xb282('0x34')];if(!_0x34baf2['query'][_0xb282('0x38')](_0xb282('0x39'))){_0x3716b0[_0xb282('0x1b')]=qs['limit'](_0x34baf2[_0xb282('0x31')][_0xb282('0x1b')]);_0x3716b0['offset']=qs[_0xb282('0x19')](_0x34baf2[_0xb282('0x31')][_0xb282('0x19')]);}_0x3716b0[_0xb282('0x3a')]=qs['sort'](_0x34baf2['query'][_0xb282('0x3b')]);_0x3716b0[_0xb282('0x3c')]=qs['filters'](_[_0xb282('0x56')](_0x34baf2[_0xb282('0x31')],_0x5d6a78[_0xb282('0x33')]));if(_0x34baf2[_0xb282('0x31')][_0xb282('0x3d')]){_0x3716b0[_0xb282('0x3c')]=_[_0xb282('0x3f')](_0x3716b0[_0xb282('0x3c')],{'$or':_['map'](_0x3716b0[_0xb282('0x37')],function(_0xb22721){var _0x18f33d={};_0x18f33d[_0xb22721]={'$like':'%'+_0x34baf2['query'][_0xb282('0x3d')]+'%'};return _0x18f33d;})});}_0x3716b0[_0xb282('0x3c')]=_['merge'](_0x3716b0['where'],{'mailboxuser':_0x40ae87[_0xb282('0x57')]});_0x3716b0=_[_0xb282('0x3f')]({},_0x3716b0,_0x34baf2[_0xb282('0x40')]);return db[_0xb282('0x55')][_0xb282('0x58')](_0x3716b0)[_0xb282('0x23')](respondWithFilteredResult(_0x53d50a,_0x3716b0));})[_0xb282('0x45')](handleError(_0x53d50a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4571382..c993930 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 _0x7b74=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','mailbox','context'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x7b74,0xf7));var _0x47b7=function(_0x1fd396,_0x348966){_0x1fd396=_0x1fd396-0x0;var _0x522c36=_0x7b74[_0x1fd396];return _0x522c36;};'use strict';var _=require(_0x47b7('0x0'));var util=require(_0x47b7('0x1'));var logger=require(_0x47b7('0x2'))(_0x47b7('0x3'));var moment=require('moment');var BPromise=require(_0x47b7('0x4'));var rp=require(_0x47b7('0x5'));var fs=require('fs');var path=require(_0x47b7('0x6'));var rimraf=require(_0x47b7('0x7'));var config=require(_0x47b7('0x8'));var attributes=require(_0x47b7('0x9'));module[_0x47b7('0xa')]=function(_0x5ceb60,_0x4d1921){return _0x5ceb60['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x47b7('0xb'),_0x47b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfd2=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x5a6017,_0x2c8444){var _0x309160=function(_0x140adf){while(--_0x140adf){_0x5a6017['push'](_0x5a6017['shift']());}};_0x309160(++_0x2c8444);}(_0xcfd2,0x80));var _0x2cfd=function(_0x1fad15,_0x30066f){_0x1fad15=_0x1fad15-0x0;var _0x352933=_0xcfd2[_0x1fad15];return _0x352933;};'use strict';var _=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var logger=require(_0x2cfd('0x2'))(_0x2cfd('0x3'));var moment=require(_0x2cfd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cfd('0x5'));var rimraf=require(_0x2cfd('0x6'));var config=require(_0x2cfd('0x7'));var attributes=require(_0x2cfd('0x8'));module[_0x2cfd('0x9')]=function(_0x1191e8,_0x5c6332){return _0x1191e8[_0x2cfd('0xa')](_0x2cfd('0xb'),attributes,{'tableName':_0x2cfd('0xc'),'paranoid':![],'indexes':[{'name':_0x2cfd('0xd'),'fields':[_0x2cfd('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 19fcd33..7df2e3c 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 _0x8b45=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b45,0x18a));var _0x58b4=function(_0x440a53,_0x4b15d2){_0x440a53=_0x440a53-0x0;var _0x6e458c=_0x8b45[_0x440a53];return _0x6e458c;};'use strict';var _=require(_0x58b4('0x0'));var util=require(_0x58b4('0x1'));var moment=require(_0x58b4('0x2'));var BPromise=require(_0x58b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58b4('0x4'));var db=require(_0x58b4('0x5'))['db'];var utils=require(_0x58b4('0x6'));var logger=require(_0x58b4('0x7'))('rpc');var config=require(_0x58b4('0x8'));var jayson=require(_0x58b4('0x9'));var client=jayson[_0x58b4('0xa')][_0x58b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b6dbf,_0x1ba29c,_0x2cd7cc){return new BPromise(function(_0x559c0f,_0x51976d){return client['request'](_0x1b6dbf,_0x2cd7cc)[_0x58b4('0xc')](function(_0x25b7f0){logger[_0x58b4('0xd')](_0x58b4('0xe'),_0x1ba29c,_0x58b4('0xf'));logger[_0x58b4('0x10')](_0x58b4('0x11'),_0x1ba29c,_0x58b4('0xf'),JSON['stringify'](_0x25b7f0));if(_0x25b7f0[_0x58b4('0x12')]){if(_0x25b7f0[_0x58b4('0x12')][_0x58b4('0x13')]===0x1f4){logger[_0x58b4('0x12')](_0x58b4('0xe'),_0x1ba29c,_0x25b7f0[_0x58b4('0x12')]['message']);return _0x51976d(_0x25b7f0[_0x58b4('0x12')][_0x58b4('0x14')]);}logger[_0x58b4('0x12')](_0x58b4('0xe'),_0x1ba29c,_0x25b7f0[_0x58b4('0x12')][_0x58b4('0x14')]);return _0x559c0f(_0x25b7f0[_0x58b4('0x12')][_0x58b4('0x14')]);}else{logger[_0x58b4('0xd')](_0x58b4('0xe'),_0x1ba29c,_0x58b4('0xf'));_0x559c0f(_0x25b7f0[_0x58b4('0x15')][_0x58b4('0x14')]);}})[_0x58b4('0x16')](function(_0x5349af){logger[_0x58b4('0x12')](_0x58b4('0xe'),_0x1ba29c,_0x5349af);_0x51976d(_0x5349af);});});} \ No newline at end of file +var _0x4263=['VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x31c5fd,_0x33131f){var _0x3799ab=function(_0x1538bf){while(--_0x1538bf){_0x31c5fd['push'](_0x31c5fd['shift']());}};_0x3799ab(++_0x33131f);}(_0x4263,0x151));var _0x3426=function(_0x18ce89,_0x487468){_0x18ce89=_0x18ce89-0x0;var _0x25372f=_0x4263[_0x18ce89];return _0x25372f;};'use strict';var _=require(_0x3426('0x0'));var util=require(_0x3426('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3426('0x2'));var db=require(_0x3426('0x3'))['db'];var utils=require(_0x3426('0x4'));var logger=require(_0x3426('0x5'))(_0x3426('0x6'));var config=require(_0x3426('0x7'));var jayson=require(_0x3426('0x8'));var client=jayson[_0x3426('0x9')][_0x3426('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1420f2,_0x3e0194,_0x7dafb7){return new BPromise(function(_0x33443d,_0x1c0d2e){return client[_0x3426('0xb')](_0x1420f2,_0x7dafb7)[_0x3426('0xc')](function(_0x4d41dc){logger[_0x3426('0xd')](_0x3426('0xe'),_0x3e0194,'request\x20sent');logger['debug'](_0x3426('0xf'),_0x3e0194,_0x3426('0x10'),JSON['stringify'](_0x4d41dc));if(_0x4d41dc[_0x3426('0x11')]){if(_0x4d41dc[_0x3426('0x11')][_0x3426('0x12')]===0x1f4){logger[_0x3426('0x11')](_0x3426('0xe'),_0x3e0194,_0x4d41dc[_0x3426('0x11')][_0x3426('0x13')]);return _0x1c0d2e(_0x4d41dc[_0x3426('0x11')][_0x3426('0x13')]);}logger['error'](_0x3426('0xe'),_0x3e0194,_0x4d41dc['error']['message']);return _0x33443d(_0x4d41dc[_0x3426('0x11')][_0x3426('0x13')]);}else{logger['info'](_0x3426('0xe'),_0x3e0194,'request\x20sent');_0x33443d(_0x4d41dc[_0x3426('0x14')][_0x3426('0x13')]);}})[_0x3426('0x15')](function(_0x523e7d){logger[_0x3426('0x11')]('VoiceMail,\x20%s,\x20%s',_0x3e0194,_0x523e7d);_0x1c0d2e(_0x523e7d);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 208becf..9ddc043 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 _0x62fe=['isAuthenticated','/:id','show','/:id/download','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get'];(function(_0x2f3dc2,_0x857b68){var _0x1facef=function(_0x3b777c){while(--_0x3b777c){_0x2f3dc2['push'](_0x2f3dc2['shift']());}};_0x1facef(++_0x857b68);}(_0x62fe,0x1d1));var _0xe62f=function(_0x8405d6,_0x29d3f4){_0x8405d6=_0x8405d6-0x0;var _0x31bc64=_0x62fe[_0x8405d6];return _0x31bc64;};'use strict';var multer=require(_0xe62f('0x0'));var util=require(_0xe62f('0x1'));var path=require(_0xe62f('0x2'));var timeout=require(_0xe62f('0x3'));var express=require('express');var router=express[_0xe62f('0x4')]();var fs_extra=require(_0xe62f('0x5'));var auth=require(_0xe62f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe62f('0x7'));var controller=require(_0xe62f('0x8'));router[_0xe62f('0x9')]('/',auth[_0xe62f('0xa')](),controller['index']);router[_0xe62f('0x9')](_0xe62f('0xb'),auth[_0xe62f('0xa')](),controller[_0xe62f('0xc')]);router['get'](_0xe62f('0xd'),auth[_0xe62f('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xe62f('0xe')]);router[_0xe62f('0xf')](_0xe62f('0xb'),auth[_0xe62f('0xa')](),controller[_0xe62f('0x10')]);router['delete'](_0xe62f('0xb'),auth[_0xe62f('0xa')](),controller[_0xe62f('0x11')]);module[_0xe62f('0x12')]=router; \ No newline at end of file +var _0x1593=['destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x1fc85f,_0x2a3fbe){var _0x2214dd=function(_0x5189cb){while(--_0x5189cb){_0x1fc85f['push'](_0x1fc85f['shift']());}};_0x2214dd(++_0x2a3fbe);}(_0x1593,0x192));var _0x3159=function(_0x51472d,_0x592b0b){_0x51472d=_0x51472d-0x0;var _0x5f00f1=_0x1593[_0x51472d];return _0x5f00f1;};'use strict';var multer=require(_0x3159('0x0'));var util=require(_0x3159('0x1'));var path=require(_0x3159('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3159('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3159('0x4'));var interaction=require(_0x3159('0x5'));var config=require('../../config/environment');var controller=require(_0x3159('0x6'));router[_0x3159('0x7')]('/',auth[_0x3159('0x8')](),controller[_0x3159('0x9')]);router[_0x3159('0x7')](_0x3159('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3159('0x7')](_0x3159('0xb'),auth[_0x3159('0x8')](),controller[_0x3159('0xc')]);router[_0x3159('0xd')]('/',auth[_0x3159('0x8')](),controller[_0x3159('0xe')]);router[_0x3159('0xf')](_0x3159('0xa'),auth[_0x3159('0x8')](),controller[_0x3159('0x10')]);router[_0x3159('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3159('0x12')]);module[_0x3159('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 839f06c..cf5d858 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 _0xef14=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','STRING','BLOB','long'];(function(_0x435bd1,_0x182393){var _0x557086=function(_0x1ef8b4){while(--_0x1ef8b4){_0x435bd1['push'](_0x435bd1['shift']());}};_0x557086(++_0x182393);}(_0xef14,0x182));var _0x4ef1=function(_0x2973ed,_0xb1964d){_0x2973ed=_0x2973ed-0x0;var _0x201588=_0xef14[_0x2973ed];return _0x201588;};'use strict';var Sequelize=require(_0x4ef1('0x0'));module[_0x4ef1('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x548750){return this[_0x4ef1('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x4ef1('0x4')](_0x4ef1('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4ef1('0x3')],'defaultValue':''},'stamp':{'type':_0x4ef1('0x6'),'defaultValue':Sequelize['literal'](_0x4ef1('0x7'))}}; \ No newline at end of file +var _0xb555=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x12417a,_0x5a9090){var _0x53bca9=function(_0x120feb){while(--_0x120feb){_0x12417a['push'](_0x12417a['shift']());}};_0x53bca9(++_0x5a9090);}(_0xb555,0x174));var _0x5b55=function(_0x4199c5,_0x22c276){_0x4199c5=_0x4199c5-0x0;var _0x589025=_0xb555[_0x4199c5];return _0x589025;};'use strict';var Sequelize=require(_0x5b55('0x0'));module[_0x5b55('0x1')]={'name':{'type':Sequelize[_0x5b55('0x2')],'get':function(_0x212092){return this[_0x5b55('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x5b55('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x5b55('0x6')](_0x5b55('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5b55('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5b55('0x8')](_0x5b55('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4cd5344..b26c76c 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 _0x835c=['count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','model','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x835c,0xde));var _0xc835=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x835c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xc835('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc835('0x1'));var jsonpatch=require(_0xc835('0x2'));var rp=require(_0xc835('0x3'));var moment=require('moment');var BPromise=require(_0xc835('0x4'));var Mustache=require(_0xc835('0x5'));var util=require('util');var path=require(_0xc835('0x6'));var sox=require('sox');var csv=require(_0xc835('0x7'));var ejs=require(_0xc835('0x8'));var fs=require('fs');var fs_extra=require(_0xc835('0x9'));var _=require(_0xc835('0xa'));var squel=require('squel');var crypto=require(_0xc835('0xb'));var jsforce=require(_0xc835('0xc'));var deskjs=require(_0xc835('0xd'));var toCsv=require(_0xc835('0x7'));var querystring=require(_0xc835('0xe'));var Papa=require(_0xc835('0xf'));var Redis=require(_0xc835('0x10'));var authService=require(_0xc835('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc835('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc835('0x13'))('api');var utils=require(_0xc835('0x14'));var config=require(_0xc835('0x15'));var licenseUtil=require(_0xc835('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x724e0a,_0x5998f1){_0x5998f1=_0x5998f1||0xcc;return function(_0x3b3b37){if(_0x3b3b37){return _0x724e0a[_0xc835('0x17')](_0x5998f1);}return _0x724e0a['status'](_0x5998f1)[_0xc835('0x18')]();};}function respondWithResult(_0x57e6f7,_0xbb0804){_0xbb0804=_0xbb0804||0xc8;return function(_0x385706){if(_0x385706){return _0x57e6f7[_0xc835('0x19')](_0xbb0804)[_0xc835('0x1a')](_0x385706);}};}function respondWithFilteredResult(_0x280cfb,_0x2dc9c1){return function(_0x2b603c){if(_0x2b603c){var _0x4865ae=typeof _0x2dc9c1[_0xc835('0x1b')]===_0xc835('0x1c')&&typeof _0x2dc9c1[_0xc835('0x1d')]===_0xc835('0x1c');var _0x1d3a51=_0x2b603c[_0xc835('0x1e')];var _0x5bea52=_0x4865ae?0x0:_0x2dc9c1[_0xc835('0x1b')];var _0x42c06c=_0x4865ae?_0x2b603c[_0xc835('0x1e')]:_0x2dc9c1[_0xc835('0x1b')]+_0x2dc9c1['limit'];var _0x445768;if(_0x42c06c>=_0x1d3a51){_0x42c06c=_0x1d3a51;_0x445768=0xc8;}else{_0x445768=0xce;}_0x280cfb['status'](_0x445768);return _0x280cfb[_0xc835('0x1f')](_0xc835('0x20'),_0x5bea52+'-'+_0x42c06c+'/'+_0x1d3a51)['json'](_0x2b603c);}return null;};}function patchUpdates(_0x372c01){return function(_0x3c6520){try{jsonpatch[_0xc835('0x21')](_0x3c6520,_0x372c01,!![]);}catch(_0x472c41){return BPromise[_0xc835('0x22')](_0x472c41);}return _0x3c6520[_0xc835('0x23')]();};}function saveUpdates(_0x4b05f7,_0x13858c){return function(_0x542a5c){if(_0x542a5c){return _0x542a5c[_0xc835('0x24')](_0x4b05f7)[_0xc835('0x25')](function(_0x103456){return _0x103456;});}return null;};}function removeEntity(_0x5074b1,_0x38cd41){return function(_0x1b9879){if(_0x1b9879){return _0x1b9879[_0xc835('0x26')]()[_0xc835('0x25')](function(){_0x5074b1[_0xc835('0x19')](0xcc)[_0xc835('0x18')]();});}};}function handleEntityNotFound(_0x44abc8,_0x4fd917){return function(_0x10314c){if(!_0x10314c){_0x44abc8[_0xc835('0x17')](0x194);}return _0x10314c;};}function handleError(_0x2ec1a6,_0x210c33){_0x210c33=_0x210c33||0x1f4;return function(_0x468758){logger['error'](_0x468758[_0xc835('0x27')]);if(_0x468758[_0xc835('0x28')]){delete _0x468758[_0xc835('0x28')];}_0x2ec1a6[_0xc835('0x19')](_0x210c33)['send'](_0x468758);};}exports['index']=function(_0x5bddf7,_0x52e111){var _0x59c06b={},_0x355590={},_0x446a98={'count':0x0,'rows':[]};var _0x538bc0=_[_0xc835('0x29')](db[_0xc835('0x2a')]['rawAttributes'],function(_0x2d083e){return{'name':_0x2d083e[_0xc835('0x2b')],'type':_0x2d083e[_0xc835('0x2c')][_0xc835('0x2d')]};});_0x355590['model']=_[_0xc835('0x2e')](_[_0xc835('0x29')](_0x538bc0,_0xc835('0x28')),[_0xc835('0x28')]);_0x355590[_0xc835('0x2f')]=_[_0xc835('0x30')](_0x5bddf7[_0xc835('0x2f')]);_0x355590['filters']=_['intersection'](_0x355590[_0xc835('0x31')],_0x355590[_0xc835('0x2f')]);_0x59c06b['attributes']=_[_0xc835('0x32')](_0x355590[_0xc835('0x31')],qs['fields'](_0x5bddf7['query'][_0xc835('0x33')]));_0x59c06b['attributes']=_0x59c06b['attributes'][_0xc835('0x34')]?_0x59c06b[_0xc835('0x35')]:_0x355590[_0xc835('0x31')];if(!_0x5bddf7[_0xc835('0x2f')][_0xc835('0x36')](_0xc835('0x37'))){_0x59c06b['limit']=qs['limit'](_0x5bddf7['query'][_0xc835('0x1d')]);_0x59c06b[_0xc835('0x1b')]=qs['offset'](_0x5bddf7[_0xc835('0x2f')][_0xc835('0x1b')]);}_0x59c06b['order']=qs[_0xc835('0x38')](_0x5bddf7[_0xc835('0x2f')][_0xc835('0x38')]);_0x59c06b['where']=qs[_0xc835('0x39')](_[_0xc835('0x3a')](_0x5bddf7[_0xc835('0x2f')],_0x355590[_0xc835('0x39')]),_0x538bc0);if(_0x5bddf7[_0xc835('0x2f')][_0xc835('0x3b')]){_0x59c06b[_0xc835('0x3c')]=_['merge'](_0x59c06b[_0xc835('0x3c')],{'$or':_[_0xc835('0x29')](_0x538bc0,function(_0x494b04){if(_0x494b04[_0xc835('0x2c')]!==_0xc835('0x3d')){var _0x228c1c={};_0x228c1c[_0x494b04[_0xc835('0x28')]]={'$like':'%'+_0x5bddf7[_0xc835('0x2f')]['filter']+'%'};return _0x228c1c;}})});}_0x59c06b=_['merge']({},_0x59c06b,_0x5bddf7[_0xc835('0x3e')]);var _0x45f261={'where':_0x59c06b['where']};return db['VoiceMailMessage'][_0xc835('0x1e')](_0x45f261)[_0xc835('0x25')](function(_0x42d18f){_0x446a98['count']=_0x42d18f;if(_0x5bddf7['query'][_0xc835('0x3f')]){_0x59c06b[_0xc835('0x40')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xc835('0x41')](_0x59c06b);})[_0xc835('0x25')](function(_0x2fb952){_0x446a98[_0xc835('0x42')]=_0x2fb952;return _0x446a98;})[_0xc835('0x25')](respondWithFilteredResult(_0x52e111,_0x59c06b))[_0xc835('0x43')](handleError(_0x52e111,null));};exports['show']=function(_0x3894d1,_0x4e5b27){var _0x43b897={'raw':!![],'where':{'id':_0x3894d1[_0xc835('0x44')]['id']}},_0x1fc8b2={};_0x1fc8b2[_0xc835('0x31')]=_[_0xc835('0x30')](db[_0xc835('0x2a')][_0xc835('0x45')]);_0x1fc8b2[_0xc835('0x2f')]=_[_0xc835('0x30')](_0x3894d1['query']);_0x1fc8b2[_0xc835('0x39')]=_['intersection'](_0x1fc8b2[_0xc835('0x31')],_0x1fc8b2[_0xc835('0x2f')]);_0x43b897[_0xc835('0x35')]=_['intersection'](_0x1fc8b2[_0xc835('0x31')],qs[_0xc835('0x33')](_0x3894d1[_0xc835('0x2f')][_0xc835('0x33')]));_0x43b897[_0xc835('0x35')]=_0x43b897[_0xc835('0x35')][_0xc835('0x34')]?_0x43b897[_0xc835('0x35')]:_0x1fc8b2[_0xc835('0x31')];if(_0x3894d1[_0xc835('0x2f')]['includeAll']){_0x43b897[_0xc835('0x40')]=[{'all':!![]}];}_0x43b897=_[_0xc835('0x46')]({},_0x43b897,_0x3894d1['options']);return db[_0xc835('0x2a')][_0xc835('0x47')](_0x43b897)[_0xc835('0x25')](handleEntityNotFound(_0x4e5b27,null))[_0xc835('0x25')](respondWithResult(_0x4e5b27,null))[_0xc835('0x43')](handleError(_0x4e5b27,null));};exports['create']=function(_0x383845,_0x1911a2){return db[_0xc835('0x2a')][_0xc835('0x48')](_0x383845['body'],{})['then'](respondWithResult(_0x1911a2,0xc9))[_0xc835('0x43')](handleError(_0x1911a2,null));};exports[_0xc835('0x24')]=function(_0x288f96,_0x13a318){if(_0x288f96['body']['id']){delete _0x288f96[_0xc835('0x49')]['id'];}return db[_0xc835('0x2a')]['find']({'where':{'id':_0x288f96[_0xc835('0x44')]['id']}})[_0xc835('0x25')](handleEntityNotFound(_0x13a318,null))[_0xc835('0x25')](saveUpdates(_0x288f96[_0xc835('0x49')],null))[_0xc835('0x25')](respondWithResult(_0x13a318,null))[_0xc835('0x43')](handleError(_0x13a318,null));};exports['destroy']=function(_0x4a5a60,_0x1dfb61){return db[_0xc835('0x2a')][_0xc835('0x47')]({'where':{'id':_0x4a5a60[_0xc835('0x44')]['id']}})['then'](handleEntityNotFound(_0x1dfb61,null))['then'](removeEntity(_0x1dfb61,null))['catch'](handleError(_0x1dfb61,null));};exports[_0xc835('0x4a')]=function(_0x459687,_0x3f5126,_0x15d4fc){return db['VoiceMailMessage'][_0xc835('0x47')]({'where':{'id':_0x459687[_0xc835('0x44')]['id']},'attributes':['id',_0xc835('0x4b'),'msg_id']})[_0xc835('0x25')](handleEntityNotFound(_0x3f5126,null))['then'](function(_0x3669a6){if(_0x3669a6){if(!_0x3669a6['recording']){throw new db[(_0xc835('0x4c'))]['ValidationError'](_0xc835('0x4d'));}var _0x4737f6={'Content-Type':_0xc835('0x4e'),'Content-Disposition':_0xc835('0x4f')};if(_0x3669a6[_0xc835('0x50')]){_0x4737f6['Content-Disposition']=_0xc835('0x51')+_0x3669a6[_0xc835('0x50')]+_0xc835('0x52');}_0x3f5126['set'](_0x4737f6);return _0x3f5126[_0xc835('0x53')](new Buffer(_0x3669a6[_0xc835('0x4b')]));}})[_0xc835('0x43')](handleError(_0x3f5126,null));}; \ No newline at end of file +var _0xf66d=['filters','pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','update','destroy','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','status','end','limit','undefined','count','set','Content-Range','json','reject','then','sendStatus','error','stack','name','send','index','VoiceMailMessage','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where'];(function(_0xf70000,_0x40bfdc){var _0x5f4402=function(_0x1021c0){while(--_0x1021c0){_0xf70000['push'](_0xf70000['shift']());}};_0x5f4402(++_0x40bfdc);}(_0xf66d,0xc7));var _0xdf66=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xf66d[_0x387777];return _0x3f84c0;};'use strict';var emlformat=require(_0xdf66('0x0'));var rimraf=require(_0xdf66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf66('0x2'));var rp=require(_0xdf66('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf66('0x4'));var util=require('util');var path=require(_0xdf66('0x5'));var sox=require(_0xdf66('0x6'));var csv=require(_0xdf66('0x7'));var ejs=require(_0xdf66('0x8'));var fs=require('fs');var fs_extra=require(_0xdf66('0x9'));var _=require(_0xdf66('0xa'));var squel=require(_0xdf66('0xb'));var crypto=require(_0xdf66('0xc'));var jsforce=require(_0xdf66('0xd'));var deskjs=require(_0xdf66('0xe'));var toCsv=require(_0xdf66('0x7'));var querystring=require(_0xdf66('0xf'));var Papa=require(_0xdf66('0x10'));var Redis=require(_0xdf66('0x11'));var authService=require(_0xdf66('0x12'));var qs=require(_0xdf66('0x13'));var as=require(_0xdf66('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf66('0x15'));var utils=require(_0xdf66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdf66('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4a96,_0x3182e3){_0x3182e3=_0x3182e3||0xcc;return function(_0x18f8d0){if(_0x18f8d0){return _0x3c4a96['sendStatus'](_0x3182e3);}return _0x3c4a96[_0xdf66('0x18')](_0x3182e3)[_0xdf66('0x19')]();};}function respondWithResult(_0x304f44,_0x17975f){_0x17975f=_0x17975f||0xc8;return function(_0x10134d){if(_0x10134d){return _0x304f44[_0xdf66('0x18')](_0x17975f)['json'](_0x10134d);}};}function respondWithFilteredResult(_0x29bec8,_0x212957){return function(_0x324cd2){if(_0x324cd2){var _0x3f71bf=typeof _0x212957['offset']==='undefined'&&typeof _0x212957[_0xdf66('0x1a')]===_0xdf66('0x1b');var _0x53126c=_0x324cd2[_0xdf66('0x1c')];var _0x2e8e83=_0x3f71bf?0x0:_0x212957['offset'];var _0xd41b0d=_0x3f71bf?_0x324cd2[_0xdf66('0x1c')]:_0x212957['offset']+_0x212957['limit'];var _0xc7fc3f;if(_0xd41b0d>=_0x53126c){_0xd41b0d=_0x53126c;_0xc7fc3f=0xc8;}else{_0xc7fc3f=0xce;}_0x29bec8[_0xdf66('0x18')](_0xc7fc3f);return _0x29bec8[_0xdf66('0x1d')](_0xdf66('0x1e'),_0x2e8e83+'-'+_0xd41b0d+'/'+_0x53126c)[_0xdf66('0x1f')](_0x324cd2);}return null;};}function patchUpdates(_0x486d13){return function(_0x4b4a6a){try{jsonpatch['apply'](_0x4b4a6a,_0x486d13,!![]);}catch(_0x49fc78){return BPromise[_0xdf66('0x20')](_0x49fc78);}return _0x4b4a6a['save']();};}function saveUpdates(_0x19c2fe,_0x4fe782){return function(_0x2b3fa5){if(_0x2b3fa5){return _0x2b3fa5['update'](_0x19c2fe)[_0xdf66('0x21')](function(_0x565f56){return _0x565f56;});}return null;};}function removeEntity(_0x4dc8f8,_0x474cf7){return function(_0x5d2ed4){if(_0x5d2ed4){return _0x5d2ed4['destroy']()[_0xdf66('0x21')](function(){_0x4dc8f8[_0xdf66('0x18')](0xcc)[_0xdf66('0x19')]();});}};}function handleEntityNotFound(_0x1da253,_0x91954f){return function(_0x45b848){if(!_0x45b848){_0x1da253[_0xdf66('0x22')](0x194);}return _0x45b848;};}function handleError(_0x1e512c,_0x62922b){_0x62922b=_0x62922b||0x1f4;return function(_0x4a58c1){logger[_0xdf66('0x23')](_0x4a58c1[_0xdf66('0x24')]);if(_0x4a58c1['name']){delete _0x4a58c1[_0xdf66('0x25')];}_0x1e512c['status'](_0x62922b)[_0xdf66('0x26')](_0x4a58c1);};}exports[_0xdf66('0x27')]=function(_0x45bdd2,_0x5cb417){var _0x46d3fa={},_0x9d0cbd={},_0x34448e={'count':0x0,'rows':[]};var _0x13ac88=_['map'](db[_0xdf66('0x28')]['rawAttributes'],function(_0x184d94){return{'name':_0x184d94['fieldName'],'type':_0x184d94[_0xdf66('0x29')][_0xdf66('0x2a')]};});_0x9d0cbd[_0xdf66('0x2b')]=_['differenceBy'](_['map'](_0x13ac88,_0xdf66('0x25')),[_0xdf66('0x25')]);_0x9d0cbd[_0xdf66('0x2c')]=_[_0xdf66('0x2d')](_0x45bdd2[_0xdf66('0x2c')]);_0x9d0cbd['filters']=_['intersection'](_0x9d0cbd[_0xdf66('0x2b')],_0x9d0cbd[_0xdf66('0x2c')]);_0x46d3fa['attributes']=_[_0xdf66('0x2e')](_0x9d0cbd[_0xdf66('0x2b')],qs[_0xdf66('0x2f')](_0x45bdd2['query'][_0xdf66('0x2f')]));_0x46d3fa[_0xdf66('0x30')]=_0x46d3fa[_0xdf66('0x30')][_0xdf66('0x31')]?_0x46d3fa[_0xdf66('0x30')]:_0x9d0cbd['model'];if(!_0x45bdd2[_0xdf66('0x2c')][_0xdf66('0x32')](_0xdf66('0x33'))){_0x46d3fa[_0xdf66('0x1a')]=qs['limit'](_0x45bdd2[_0xdf66('0x2c')][_0xdf66('0x1a')]);_0x46d3fa['offset']=qs[_0xdf66('0x34')](_0x45bdd2[_0xdf66('0x2c')]['offset']);}_0x46d3fa[_0xdf66('0x35')]=qs[_0xdf66('0x36')](_0x45bdd2[_0xdf66('0x2c')][_0xdf66('0x36')]);_0x46d3fa[_0xdf66('0x37')]=qs[_0xdf66('0x38')](_[_0xdf66('0x39')](_0x45bdd2['query'],_0x9d0cbd[_0xdf66('0x38')]),_0x13ac88);if(_0x45bdd2['query'][_0xdf66('0x3a')]){_0x46d3fa[_0xdf66('0x37')]=_['merge'](_0x46d3fa['where'],{'$or':_[_0xdf66('0x3b')](_0x13ac88,function(_0x3f27a9){if(_0x3f27a9['type']!==_0xdf66('0x3c')){var _0x4f5ac0={};_0x4f5ac0[_0x3f27a9['name']]={'$like':'%'+_0x45bdd2[_0xdf66('0x2c')][_0xdf66('0x3a')]+'%'};return _0x4f5ac0;}})});}_0x46d3fa=_[_0xdf66('0x3d')]({},_0x46d3fa,_0x45bdd2[_0xdf66('0x3e')]);var _0x202423={'where':_0x46d3fa['where']};return db[_0xdf66('0x28')][_0xdf66('0x1c')](_0x202423)[_0xdf66('0x21')](function(_0x459dc7){_0x34448e['count']=_0x459dc7;if(_0x45bdd2[_0xdf66('0x2c')][_0xdf66('0x3f')]){_0x46d3fa['include']=[{'all':!![]}];}return db[_0xdf66('0x28')][_0xdf66('0x40')](_0x46d3fa);})[_0xdf66('0x21')](function(_0x403f46){_0x34448e['rows']=_0x403f46;return _0x34448e;})['then'](respondWithFilteredResult(_0x5cb417,_0x46d3fa))[_0xdf66('0x41')](handleError(_0x5cb417,null));};exports[_0xdf66('0x42')]=function(_0x50b5a9,_0xfba38e){var _0x4c91c6={'raw':!![],'where':{'id':_0x50b5a9[_0xdf66('0x43')]['id']}},_0x2be76b={};_0x2be76b[_0xdf66('0x2b')]=_[_0xdf66('0x2d')](db[_0xdf66('0x28')][_0xdf66('0x44')]);_0x2be76b[_0xdf66('0x2c')]=_[_0xdf66('0x2d')](_0x50b5a9['query']);_0x2be76b[_0xdf66('0x38')]=_[_0xdf66('0x2e')](_0x2be76b[_0xdf66('0x2b')],_0x2be76b[_0xdf66('0x2c')]);_0x4c91c6['attributes']=_[_0xdf66('0x2e')](_0x2be76b['model'],qs[_0xdf66('0x2f')](_0x50b5a9[_0xdf66('0x2c')]['fields']));_0x4c91c6[_0xdf66('0x30')]=_0x4c91c6[_0xdf66('0x30')]['length']?_0x4c91c6[_0xdf66('0x30')]:_0x2be76b['model'];if(_0x50b5a9[_0xdf66('0x2c')][_0xdf66('0x3f')]){_0x4c91c6[_0xdf66('0x45')]=[{'all':!![]}];}_0x4c91c6=_[_0xdf66('0x3d')]({},_0x4c91c6,_0x50b5a9[_0xdf66('0x3e')]);return db[_0xdf66('0x28')][_0xdf66('0x46')](_0x4c91c6)[_0xdf66('0x21')](handleEntityNotFound(_0xfba38e,null))[_0xdf66('0x21')](respondWithResult(_0xfba38e,null))['catch'](handleError(_0xfba38e,null));};exports['create']=function(_0x3114c2,_0x4b7797){return db['VoiceMailMessage'][_0xdf66('0x47')](_0x3114c2[_0xdf66('0x48')],{})[_0xdf66('0x21')](respondWithResult(_0x4b7797,0xc9))['catch'](handleError(_0x4b7797,null));};exports[_0xdf66('0x49')]=function(_0x5ab7dc,_0x2d0e09){if(_0x5ab7dc[_0xdf66('0x48')]['id']){delete _0x5ab7dc[_0xdf66('0x48')]['id'];}return db[_0xdf66('0x28')]['find']({'where':{'id':_0x5ab7dc['params']['id']}})[_0xdf66('0x21')](handleEntityNotFound(_0x2d0e09,null))[_0xdf66('0x21')](saveUpdates(_0x5ab7dc['body'],null))[_0xdf66('0x21')](respondWithResult(_0x2d0e09,null))[_0xdf66('0x41')](handleError(_0x2d0e09,null));};exports[_0xdf66('0x4a')]=function(_0x4e5a8b,_0x897261){return db[_0xdf66('0x28')]['find']({'where':{'id':_0x4e5a8b[_0xdf66('0x43')]['id']}})[_0xdf66('0x21')](handleEntityNotFound(_0x897261,null))['then'](removeEntity(_0x897261,null))[_0xdf66('0x41')](handleError(_0x897261,null));};exports[_0xdf66('0x4b')]=function(_0x2d2963,_0x2ada6d,_0x4bac5d){return db[_0xdf66('0x28')][_0xdf66('0x46')]({'where':{'id':_0x2d2963[_0xdf66('0x43')]['id']},'attributes':['id','recording','msg_id']})[_0xdf66('0x21')](handleEntityNotFound(_0x2ada6d,null))[_0xdf66('0x21')](function(_0x26f7de){if(_0x26f7de){if(!_0x26f7de[_0xdf66('0x4c')]){throw new db[(_0xdf66('0x4d'))][(_0xdf66('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x1e5080={'Content-Type':_0xdf66('0x4f'),'Content-Disposition':_0xdf66('0x50')};if(_0x26f7de[_0xdf66('0x51')]){_0x1e5080[_0xdf66('0x52')]=_0xdf66('0x53')+_0x26f7de[_0xdf66('0x51')]+_0xdf66('0x54');}_0x2ada6d[_0xdf66('0x1d')](_0x1e5080);return _0x2ada6d[_0xdf66('0x26')](new Buffer(_0x26f7de['recording']));}})[_0xdf66('0x41')](handleError(_0x2ada6d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4932178..b6ec02c 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 _0xd9e1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x6a47fc,_0x3ad229){var _0x560ab9=function(_0x3e9f4b){while(--_0x3e9f4b){_0x6a47fc['push'](_0x6a47fc['shift']());}};_0x560ab9(++_0x3ad229);}(_0xd9e1,0x1ed));var _0x1d9e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd9e1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x1d9e('0x0'));var util=require(_0x1d9e('0x1'));var logger=require(_0x1d9e('0x2'))(_0x1d9e('0x3'));var moment=require(_0x1d9e('0x4'));var BPromise=require(_0x1d9e('0x5'));var rp=require(_0x1d9e('0x6'));var fs=require('fs');var path=require(_0x1d9e('0x7'));var rimraf=require(_0x1d9e('0x8'));var config=require(_0x1d9e('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x1d9e('0xa')]=function(_0x1d6d8d,_0x4d0032){return _0x1d6d8d[_0x1d9e('0xb')](_0x1d9e('0xc'),attributes,{'tableName':_0x1d9e('0xd'),'paranoid':![],'indexes':[{'name':_0x1d9e('0xe'),'fields':[_0x1d9e('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5fe8=['path','rimraf','../../config/environment','exports','define','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ba36d,_0x5a7d92){var _0x53e49d=function(_0x2c200b){while(--_0x2c200b){_0x2ba36d['push'](_0x2ba36d['shift']());}};_0x53e49d(++_0x5a7d92);}(_0x5fe8,0x1e8));var _0x85fe=function(_0x152051,_0x51b9e5){_0x152051=_0x152051-0x0;var _0x1ce591=_0x5fe8[_0x152051];return _0x1ce591;};'use strict';var _=require('lodash');var util=require(_0x85fe('0x0'));var logger=require(_0x85fe('0x1'))(_0x85fe('0x2'));var moment=require(_0x85fe('0x3'));var BPromise=require(_0x85fe('0x4'));var rp=require(_0x85fe('0x5'));var fs=require('fs');var path=require(_0x85fe('0x6'));var rimraf=require(_0x85fe('0x7'));var config=require(_0x85fe('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x85fe('0x9')]=function(_0x49377d,_0x5a66d8){return _0x49377d[_0x85fe('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x85fe('0xb'),'paranoid':![],'indexes':[{'name':_0x85fe('0xc'),'fields':[_0x85fe('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e78e3c2..7f274b0 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 _0xb31f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb31f,0x1e1));var _0xfb31=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xb31f[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0xfb31('0x0'));var util=require(_0xfb31('0x1'));var moment=require(_0xfb31('0x2'));var BPromise=require(_0xfb31('0x3'));var rs=require(_0xfb31('0x4'));var fs=require('fs');var Redis=require(_0xfb31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb31('0x6'));var logger=require('../../config/logger')(_0xfb31('0x7'));var config=require(_0xfb31('0x8'));var jayson=require(_0xfb31('0x9'));var client=jayson[_0xfb31('0xa')][_0xfb31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17eb95,_0x6e682d,_0x38a941){return new BPromise(function(_0x408a23,_0x45dbb7){return client['request'](_0x17eb95,_0x38a941)[_0xfb31('0xc')](function(_0x381648){logger[_0xfb31('0xd')](_0xfb31('0xe'),_0x6e682d,_0xfb31('0xf'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x6e682d,'request\x20sent',JSON['stringify'](_0x381648));if(_0x381648[_0xfb31('0x10')]){if(_0x381648[_0xfb31('0x10')]['code']===0x1f4){logger[_0xfb31('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x6e682d,_0x381648[_0xfb31('0x10')][_0xfb31('0x11')]);return _0x45dbb7(_0x381648[_0xfb31('0x10')]['message']);}logger['error'](_0xfb31('0xe'),_0x6e682d,_0x381648['error'][_0xfb31('0x11')]);return _0x408a23(_0x381648[_0xfb31('0x10')]['message']);}else{logger[_0xfb31('0xd')](_0xfb31('0xe'),_0x6e682d,_0xfb31('0xf'));_0x408a23(_0x381648[_0xfb31('0x12')][_0xfb31('0x11')]);}})[_0xfb31('0x13')](function(_0x3027e7){logger['error'](_0xfb31('0xe'),_0x6e682d,_0x3027e7);_0x45dbb7(_0x3027e7);});});} \ No newline at end of file +var _0xd1bf=['randomstring','../../config/logger','../../config/environment','jayson/promise','http','request','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','util','bluebird'];(function(_0x220017,_0x318b1f){var _0x46ec19=function(_0x6e978a){while(--_0x6e978a){_0x220017['push'](_0x220017['shift']());}};_0x46ec19(++_0x318b1f);}(_0xd1bf,0x10e));var _0xfd1b=function(_0x454b9d,_0x46bc7b){_0x454b9d=_0x454b9d-0x0;var _0x5775ab=_0xd1bf[_0x454b9d];return _0x5775ab;};'use strict';var _=require('lodash');var util=require(_0xfd1b('0x0'));var moment=require('moment');var BPromise=require(_0xfd1b('0x1'));var rs=require(_0xfd1b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfd1b('0x3'))('rpc');var config=require(_0xfd1b('0x4'));var jayson=require(_0xfd1b('0x5'));var client=jayson['client'][_0xfd1b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x29068b,_0x1467a7,_0x3c7e53){return new BPromise(function(_0xc01df9,_0x319215){return client[_0xfd1b('0x7')](_0x29068b,_0x3c7e53)['then'](function(_0x170a44){logger['info'](_0xfd1b('0x8'),_0x1467a7,'request\x20sent');logger[_0xfd1b('0x9')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1467a7,_0xfd1b('0xa'),JSON['stringify'](_0x170a44));if(_0x170a44['error']){if(_0x170a44[_0xfd1b('0xb')][_0xfd1b('0xc')]===0x1f4){logger['error'](_0xfd1b('0x8'),_0x1467a7,_0x170a44[_0xfd1b('0xb')][_0xfd1b('0xd')]);return _0x319215(_0x170a44[_0xfd1b('0xb')][_0xfd1b('0xd')]);}logger['error'](_0xfd1b('0x8'),_0x1467a7,_0x170a44[_0xfd1b('0xb')]['message']);return _0xc01df9(_0x170a44[_0xfd1b('0xb')]['message']);}else{logger[_0xfd1b('0xe')](_0xfd1b('0x8'),_0x1467a7,_0xfd1b('0xa'));_0xc01df9(_0x170a44[_0xfd1b('0xf')]['message']);}})[_0xfd1b('0x10')](function(_0x1f3365){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1467a7,_0x1f3365);_0x319215(_0x1f3365);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a73a5f0..4168609 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 _0x46d5=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','put'];(function(_0x1d12b6,_0x5ae73a){var _0x291dc7=function(_0xa8d0f7){while(--_0xa8d0f7){_0x1d12b6['push'](_0x1d12b6['shift']());}};_0x291dc7(++_0x5ae73a);}(_0x46d5,0xca));var _0x546d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x46d5[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x546d('0x0'));var util=require('util');var path=require(_0x546d('0x1'));var timeout=require('connect-timeout');var express=require(_0x546d('0x2'));var router=express[_0x546d('0x3')]();var fs_extra=require(_0x546d('0x4'));var auth=require(_0x546d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x546d('0x6'));var controller=require(_0x546d('0x7'));router[_0x546d('0x8')]('/',auth[_0x546d('0x9')](),controller['index']);router[_0x546d('0x8')](_0x546d('0xa'),auth[_0x546d('0x9')](),controller[_0x546d('0xb')]);router[_0x546d('0x8')]('/:id/sounds',auth[_0x546d('0x9')](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x546d('0xc'),auth['isAuthenticated'](),controller['addSound']);router[_0x546d('0xd')](_0x546d('0xa'),auth['isAuthenticated'](),controller[_0x546d('0xe')]);router[_0x546d('0xf')]('/:id',auth[_0x546d('0x9')](),controller[_0x546d('0x10')]);router[_0x546d('0xf')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller['removeSound']);module[_0x546d('0x11')]=router; \ No newline at end of file +var _0x0beb=['create','/:id/sounds','addSound','update','delete','destroy','removeSound','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','getSounds','post'];(function(_0x8bd852,_0x28aa2d){var _0x543f85=function(_0x3bf533){while(--_0x3bf533){_0x8bd852['push'](_0x8bd852['shift']());}};_0x543f85(++_0x28aa2d);}(_0x0beb,0xee));var _0xb0be=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0beb[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xb0be('0x0'));var util=require(_0xb0be('0x1'));var path=require(_0xb0be('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb0be('0x3')]();var fs_extra=require(_0xb0be('0x4'));var auth=require(_0xb0be('0x5'));var interaction=require(_0xb0be('0x6'));var config=require(_0xb0be('0x7'));var controller=require(_0xb0be('0x8'));router['get']('/',auth[_0xb0be('0x9')](),controller['index']);router[_0xb0be('0xa')](_0xb0be('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb0be('0xa')]('/:id/sounds',auth['isAuthenticated'](),controller[_0xb0be('0xc')]);router[_0xb0be('0xd')]('/',auth[_0xb0be('0x9')](),controller[_0xb0be('0xe')]);router['post'](_0xb0be('0xf'),auth[_0xb0be('0x9')](),controller[_0xb0be('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb0be('0x11')]);router[_0xb0be('0x12')](_0xb0be('0xb'),auth[_0xb0be('0x9')](),controller[_0xb0be('0x13')]);router[_0xb0be('0x12')]('/:id/sounds/:id2',auth[_0xb0be('0x9')](),controller[_0xb0be('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a2fef5b..22c04b8 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 _0xf992=['quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','custom','mp3nb'];(function(_0x421e50,_0x48339d){var _0x15a0aa=function(_0x2503c8){while(--_0x2503c8){_0x421e50['push'](_0x421e50['shift']());}};_0x15a0aa(++_0x48339d);}(_0xf992,0xa0));var _0x2f99=function(_0x31fc68,_0x1daad1){_0x31fc68=_0x31fc68-0x0;var _0x522ddd=_0xf992[_0x31fc68];return _0x522ddd;};'use strict';var Sequelize=require(_0x2f99('0x0'));module[_0x2f99('0x1')]={'name':{'type':Sequelize[_0x2f99('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x2f99('0x3'),'files',_0x2f99('0x4'),'quietmp3nb',_0x2f99('0x5'),_0x2f99('0x6')),'allowNull':!![],'defaultValue':_0x2f99('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2f99('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2f99('0x8')},'format':{'type':Sequelize[_0x2f99('0x2')],'allowNull':!![]},'stamp':{'type':_0x2f99('0x9')},'defaultEntry':{'type':Sequelize[_0x2f99('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6027=['sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x15dfe8,_0x2ce9e7){var _0x11336e=function(_0x23e991){while(--_0x23e991){_0x15dfe8['push'](_0x15dfe8['shift']());}};_0x11336e(++_0x2ce9e7);}(_0x6027,0x145));var _0x7602=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x6027[_0x5ca52d];return _0x89e54e;};'use strict';var Sequelize=require(_0x7602('0x0'));module[_0x7602('0x1')]={'name':{'type':Sequelize[_0x7602('0x2')],'allowNull':![],'unique':_0x7602('0x3')},'mode':{'type':Sequelize[_0x7602('0x4')](_0x7602('0x5'),_0x7602('0x6'),'mp3nb',_0x7602('0x7'),_0x7602('0x8'),_0x7602('0x9')),'allowNull':!![],'defaultValue':_0x7602('0x6')},'directory':{'type':Sequelize[_0x7602('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7602('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7602('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7602('0x2')],'allowNull':!![],'defaultValue':_0x7602('0xa')},'format':{'type':Sequelize[_0x7602('0x2')],'allowNull':!![]},'stamp':{'type':_0x7602('0xb')},'defaultEntry':{'type':Sequelize[_0x7602('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 744a453..ae15d8d 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 _0xef9e=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','offset','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','body','sequelize','transaction','files','join','server/files/moh','create','mode','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xef9e,0x93));var _0xeef9=function(_0x78800,_0x5c6ed5){_0x78800=_0x78800-0x0;var _0x3f873a=_0xef9e[_0x78800];return _0x3f873a;};'use strict';var emlformat=require(_0xeef9('0x0'));var rimraf=require(_0xeef9('0x1'));var zipdir=require(_0xeef9('0x2'));var jsonpatch=require(_0xeef9('0x3'));var rp=require(_0xeef9('0x4'));var moment=require('moment');var BPromise=require(_0xeef9('0x5'));var Mustache=require(_0xeef9('0x6'));var util=require(_0xeef9('0x7'));var path=require(_0xeef9('0x8'));var sox=require(_0xeef9('0x9'));var csv=require(_0xeef9('0xa'));var ejs=require(_0xeef9('0xb'));var fs=require('fs');var fs_extra=require(_0xeef9('0xc'));var _=require('lodash');var squel=require(_0xeef9('0xd'));var crypto=require(_0xeef9('0xe'));var jsforce=require(_0xeef9('0xf'));var deskjs=require(_0xeef9('0x10'));var toCsv=require(_0xeef9('0xa'));var querystring=require(_0xeef9('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeef9('0x12'));var qs=require(_0xeef9('0x13'));var as=require(_0xeef9('0x14'));var hardwareService=require(_0xeef9('0x15'));var logger=require('../../config/logger')(_0xeef9('0x16'));var utils=require(_0xeef9('0x17'));var config=require(_0xeef9('0x18'));var licenseUtil=require(_0xeef9('0x19'));var db=require(_0xeef9('0x1a'))['db'];function respondWithStatusCode(_0x1a3df6,_0x4295de){_0x4295de=_0x4295de||0xcc;return function(_0x3a3054){if(_0x3a3054){return _0x1a3df6['sendStatus'](_0x4295de);}return _0x1a3df6[_0xeef9('0x1b')](_0x4295de)[_0xeef9('0x1c')]();};}function respondWithResult(_0x40e423,_0x251d00){_0x251d00=_0x251d00||0xc8;return function(_0xf51e37){if(_0xf51e37){return _0x40e423['status'](_0x251d00)[_0xeef9('0x1d')](_0xf51e37);}};}function respondWithFilteredResult(_0x36ae78,_0xb7370b){return function(_0x26be2e){if(_0x26be2e){var _0x1f9433=typeof _0xb7370b['offset']===_0xeef9('0x1e')&&typeof _0xb7370b[_0xeef9('0x1f')]===_0xeef9('0x1e');var _0x40ffa0=_0x26be2e[_0xeef9('0x20')];var _0x172a81=_0x1f9433?0x0:_0xb7370b['offset'];var _0x2333a7=_0x1f9433?_0x26be2e[_0xeef9('0x20')]:_0xb7370b['offset']+_0xb7370b[_0xeef9('0x1f')];var _0x256cf8;if(_0x2333a7>=_0x40ffa0){_0x2333a7=_0x40ffa0;_0x256cf8=0xc8;}else{_0x256cf8=0xce;}_0x36ae78[_0xeef9('0x1b')](_0x256cf8);return _0x36ae78[_0xeef9('0x21')](_0xeef9('0x22'),_0x172a81+'-'+_0x2333a7+'/'+_0x40ffa0)[_0xeef9('0x1d')](_0x26be2e);}return null;};}function patchUpdates(_0x59c8fe){return function(_0x28fb6a){try{jsonpatch[_0xeef9('0x23')](_0x28fb6a,_0x59c8fe,!![]);}catch(_0x222f96){return BPromise[_0xeef9('0x24')](_0x222f96);}return _0x28fb6a[_0xeef9('0x25')]();};}function saveUpdates(_0x1129d2,_0x2fb541){return function(_0x248c01){if(_0x248c01){return _0x248c01[_0xeef9('0x26')](_0x1129d2)[_0xeef9('0x27')](function(_0x29eac7){return _0x29eac7;});}return null;};}function removeEntity(_0x2bc2b1,_0xf6c2f0){return function(_0x473fa1){if(_0x473fa1){return _0x473fa1[_0xeef9('0x28')]()['then'](function(){var _0x3fd6fd=_0x473fa1[_0xeef9('0x29')]({'plain':!![]});var _0x5b1ead=_0xeef9('0x2a');return db[_0xeef9('0x2b')][_0xeef9('0x28')]({'where':{'type':_0x5b1ead,'resourceId':_0x3fd6fd['id']}})['then'](function(){return _0x473fa1;});})[_0xeef9('0x27')](function(){_0x2bc2b1[_0xeef9('0x1b')](0xcc)[_0xeef9('0x1c')]();});}};}function handleEntityNotFound(_0x4060f7,_0x26f709){return function(_0x3fcb2b){if(!_0x3fcb2b){_0x4060f7[_0xeef9('0x2c')](0x194);}return _0x3fcb2b;};}function handleError(_0x51baab,_0x17995c){_0x17995c=_0x17995c||0x1f4;return function(_0x13a46d){logger[_0xeef9('0x2d')](_0x13a46d[_0xeef9('0x2e')]);if(_0x13a46d[_0xeef9('0x2f')]){delete _0x13a46d['name'];}_0x51baab[_0xeef9('0x1b')](_0x17995c)[_0xeef9('0x30')](_0x13a46d);};}exports[_0xeef9('0x31')]=function(_0x42f399,_0x46ac2a){var _0xb2fb59={},_0x335bb4={},_0x16a224={'count':0x0,'rows':[]};var _0x3db1b0=_['map'](db[_0xeef9('0x32')][_0xeef9('0x33')],function(_0x3d9419){return{'name':_0x3d9419[_0xeef9('0x34')],'type':_0x3d9419[_0xeef9('0x35')][_0xeef9('0x36')]};});_0x335bb4['model']=_[_0xeef9('0x37')](_0x3db1b0,'name');_0x335bb4[_0xeef9('0x38')]=_[_0xeef9('0x39')](_0x42f399[_0xeef9('0x38')]);_0x335bb4[_0xeef9('0x3a')]=_['intersection'](_0x335bb4[_0xeef9('0x3b')],_0x335bb4['query']);_0xb2fb59[_0xeef9('0x3c')]=_[_0xeef9('0x3d')](_0x335bb4['model'],qs[_0xeef9('0x3e')](_0x42f399['query'][_0xeef9('0x3e')]));_0xb2fb59[_0xeef9('0x3c')]=_0xb2fb59[_0xeef9('0x3c')][_0xeef9('0x3f')]?_0xb2fb59['attributes']:_0x335bb4['model'];if(!_0x42f399[_0xeef9('0x38')]['hasOwnProperty'](_0xeef9('0x40'))){_0xb2fb59[_0xeef9('0x1f')]=qs[_0xeef9('0x1f')](_0x42f399['query'][_0xeef9('0x1f')]);_0xb2fb59['offset']=qs[_0xeef9('0x41')](_0x42f399[_0xeef9('0x38')][_0xeef9('0x41')]);}_0xb2fb59[_0xeef9('0x42')]=qs[_0xeef9('0x43')](_0x42f399[_0xeef9('0x38')][_0xeef9('0x43')]);delete _0x42f399[_0xeef9('0x38')][_0xeef9('0x43')];_0xb2fb59['where']=qs[_0xeef9('0x3a')](_['pick'](_0x42f399[_0xeef9('0x38')],_0x335bb4[_0xeef9('0x3a')]),_0x3db1b0);if(_0x42f399[_0xeef9('0x38')][_0xeef9('0x44')]){_0xb2fb59[_0xeef9('0x45')]=_['merge'](_0xb2fb59[_0xeef9('0x45')],{'$or':_[_0xeef9('0x37')](_0x3db1b0,function(_0xdc23e5){if(_0xdc23e5[_0xeef9('0x35')]!==_0xeef9('0x46')){var _0x20bc68={};_0x20bc68[_0xdc23e5['name']]={'$like':'%'+_0x42f399['query']['filter']+'%'};return _0x20bc68;}})});}_0xb2fb59=_[_0xeef9('0x47')]({},_0xb2fb59,_0x42f399[_0xeef9('0x48')]);var _0x7ef28a={'where':_0xb2fb59['where']};return db[_0xeef9('0x32')][_0xeef9('0x20')](_0x7ef28a)['then'](function(_0x538e36){_0x16a224[_0xeef9('0x20')]=_0x538e36;if(_0x42f399[_0xeef9('0x38')][_0xeef9('0x49')]){_0xb2fb59[_0xeef9('0x4a')]=[{'all':!![]}];}return db[_0xeef9('0x32')][_0xeef9('0x4b')](_0xb2fb59);})['then'](function(_0x5e8c0f){_0x16a224['rows']=_0x5e8c0f;return _0x16a224;})[_0xeef9('0x27')](respondWithFilteredResult(_0x46ac2a,_0xb2fb59))[_0xeef9('0x4c')](handleError(_0x46ac2a,null));};exports[_0xeef9('0x4d')]=function(_0xdba341,_0x33dc0b){var _0x6c31f7={'raw':![],'where':{'id':_0xdba341[_0xeef9('0x4e')]['id']}},_0x2ddd94={};_0x2ddd94[_0xeef9('0x3b')]=_[_0xeef9('0x39')](db['VoiceMusicOnHold'][_0xeef9('0x33')]);_0x2ddd94[_0xeef9('0x38')]=_[_0xeef9('0x39')](_0xdba341['query']);_0x2ddd94[_0xeef9('0x3a')]=_['intersection'](_0x2ddd94[_0xeef9('0x3b')],_0x2ddd94[_0xeef9('0x38')]);_0x6c31f7[_0xeef9('0x3c')]=_['intersection'](_0x2ddd94[_0xeef9('0x3b')],qs['fields'](_0xdba341['query'][_0xeef9('0x3e')]));_0x6c31f7['attributes']=_0x6c31f7[_0xeef9('0x3c')]['length']?_0x6c31f7['attributes']:_0x2ddd94[_0xeef9('0x3b')];if(_0xdba341[_0xeef9('0x38')][_0xeef9('0x49')]){_0x6c31f7[_0xeef9('0x4a')]=[{'all':!![]}];}_0x6c31f7=_[_0xeef9('0x47')]({},_0x6c31f7,_0xdba341[_0xeef9('0x48')]);return db['VoiceMusicOnHold'][_0xeef9('0x4f')](_0x6c31f7)[_0xeef9('0x27')](handleEntityNotFound(_0x33dc0b,null))[_0xeef9('0x27')](respondWithResult(_0x33dc0b,null))[_0xeef9('0x4c')](handleError(_0x33dc0b,null));};exports['update']=function(_0x4e5ee7,_0x48d5fe){if(_0x4e5ee7[_0xeef9('0x50')]['id']){delete _0x4e5ee7['body']['id'];}return db['VoiceMusicOnHold'][_0xeef9('0x4f')]({'where':{'id':_0x4e5ee7[_0xeef9('0x4e')]['id']}})[_0xeef9('0x27')](handleEntityNotFound(_0x48d5fe,null))[_0xeef9('0x27')](saveUpdates(_0x4e5ee7[_0xeef9('0x50')],null))['then'](respondWithResult(_0x48d5fe,null))['catch'](handleError(_0x48d5fe,null));};exports['create']=function(_0x1dfc45,_0x21b20b,_0x199ba1){return db[_0xeef9('0x51')][_0xeef9('0x52')](function(_0x3c8fc0){if(_0x1dfc45[_0xeef9('0x50')]['mode']===_0xeef9('0x53')){_0x1dfc45['body']['directory']=path[_0xeef9('0x54')](config['root'],_0xeef9('0x55'),_0x1dfc45[_0xeef9('0x50')][_0xeef9('0x2f')]);}return db[_0xeef9('0x32')][_0xeef9('0x56')](_0x1dfc45[_0xeef9('0x50')],{'transaction':_0x3c8fc0})[_0xeef9('0x27')](function(_0x3ddcc0){if(_0x1dfc45['body'][_0xeef9('0x57')]===_0xeef9('0x53')){fs[_0xeef9('0x58')](_0x3ddcc0[_0xeef9('0x59')],parseInt(_0xeef9('0x5a'),0x8));}var _0x47b70c=_0x1dfc45[_0xeef9('0x5b')]['get']({'plain':!![]});if(!_0x47b70c)throw new Error(_0xeef9('0x5c'));if(_0x47b70c[_0xeef9('0x5d')]==='user'){var _0x36cdb5=_0x3ddcc0[_0xeef9('0x29')]({'plain':!![]});return db[_0xeef9('0x5e')][_0xeef9('0x4f')]({'where':{'name':_0xeef9('0x2a'),'userProfileId':_0x47b70c[_0xeef9('0x5f')]},'raw':!![]})[_0xeef9('0x27')](function(_0x2bdac0){if(_0x2bdac0&&_0x2bdac0[_0xeef9('0x60')]===0x0){return db[_0xeef9('0x2b')][_0xeef9('0x56')]({'name':_0x36cdb5[_0xeef9('0x2f')],'resourceId':_0x36cdb5['id'],'type':_0x2bdac0[_0xeef9('0x2f')],'sectionId':_0x2bdac0['id']},{})['then'](function(){return _0x3ddcc0;});}else{return _0x3ddcc0;}})[_0xeef9('0x4c')](function(_0x24aa3c){logger[_0xeef9('0x2d')](_0xeef9('0x61'),_0x24aa3c);});}return _0x3ddcc0;});})[_0xeef9('0x27')](respondWithResult(_0x21b20b,0xc9))[_0xeef9('0x4c')](handleError(_0x21b20b,null));};exports[_0xeef9('0x28')]=function(_0x4a2224,_0x2a438d,_0x101718){var _0x28f051;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4a2224[_0xeef9('0x4e')]['id']}})[_0xeef9('0x27')](function(_0x232e73){if(_0x232e73){return db['sequelize'][_0xeef9('0x52')](function(_0x14d5b7){return _0x232e73['destroy']({'transaction':_0x14d5b7,'raw':!![]})[_0xeef9('0x27')](function(_0x3524aa){if(_0x3524aa['directory']){fs[_0xeef9('0x62')](_0x3524aa[_0xeef9('0x59')])[_0xeef9('0x63')](function(_0x1e443d){fs[_0xeef9('0x64')](path[_0xeef9('0x54')](_0x3524aa['directory'],_0x1e443d));});fs['rmdirSync'](_0x3524aa[_0xeef9('0x59')]);}return _0x3524aa;});})[_0xeef9('0x4c')](function(_0x5e3070){throw new db[(_0xeef9('0x65'))][(_0xeef9('0x66'))](_0x5e3070[_0xeef9('0x67')]);});}})['then'](handleEntityNotFound(_0x2a438d,null))[_0xeef9('0x27')](removeEntity(_0x2a438d,null))[_0xeef9('0x4c')](handleError(_0x2a438d,null));};exports['addSound']=function(_0xbd76f5,_0x29dbf6,_0x5ecc2e){return db[_0xeef9('0x51')][_0xeef9('0x52')](function(_0x5c3563){var _0x3fafeb;return db[_0xeef9('0x32')][_0xeef9('0x4f')]({'where':{'id':_0xbd76f5[_0xeef9('0x4e')]['id']}})[_0xeef9('0x27')](function(_0x197242){if(_0x197242){_0x3fafeb=_0x197242;return _0x197242[_0xeef9('0x68')](_0xbd76f5[_0xeef9('0x50')]['id'],{'transaction':_0x5c3563});}})[_0xeef9('0x27')](function(_0x45b1e1){if(_0x45b1e1){return db[_0xeef9('0x69')][_0xeef9('0x6a')]({'where':{'id':_0xbd76f5[_0xeef9('0x50')]['id']},'attributes':['id',_0xeef9('0x2f'),_0xeef9('0x6b'),'converted_format',_0xeef9('0x6c')],'raw':!![]});}})[_0xeef9('0x27')](function(_0x1defe0){if(_0x1defe0){var _0x36e179=path[_0xeef9('0x54')](config[_0xeef9('0x6d')],_0xeef9('0x6e'),util[_0xeef9('0x6f')](_0xeef9('0x70'),path[_0xeef9('0x71')](_0x1defe0[_0xeef9('0x6b')],path[_0xeef9('0x72')](_0x1defe0[_0xeef9('0x6b')])),_0x1defe0[_0xeef9('0x73')]));var _0x51cc28=path[_0xeef9('0x54')](config[_0xeef9('0x6d')],_0xeef9('0x55'),_0x3fafeb[_0xeef9('0x2f')],util[_0xeef9('0x6f')](_0xeef9('0x70'),_0x1defe0[_0xeef9('0x2f')],_0x1defe0['converted_format']));fs[_0xeef9('0x74')](_0x36e179,_0x51cc28);return _0x1defe0;}})['catch'](function(_0x1c9219){throw new db[(_0xeef9('0x65'))]['ValidationError'](_0x1c9219[_0xeef9('0x67')]);});})[_0xeef9('0x27')](handleEntityNotFound(_0x29dbf6,null))[_0xeef9('0x27')](respondWithResult(_0x29dbf6,0xc9))[_0xeef9('0x4c')](handleError(_0x29dbf6,null));};exports['removeSound']=function(_0xffae11,_0x4afe36,_0xc75b69){return db[_0xeef9('0x51')][_0xeef9('0x52')](function(_0x295280){var _0x37febc;return db['VoiceMusicOnHold'][_0xeef9('0x6a')]({'where':{'id':_0xffae11[_0xeef9('0x4e')]['id']}})[_0xeef9('0x27')](handleEntityNotFound(_0x4afe36,null))[_0xeef9('0x27')](function(_0xee0b6c){if(_0xee0b6c){_0x37febc=_0xee0b6c;return _0xee0b6c[_0xeef9('0x75')](_0xffae11[_0xeef9('0x4e')][_0xeef9('0x76')]);}})[_0xeef9('0x27')](function(_0x4750d4){if(_0x4750d4){return db[_0xeef9('0x69')][_0xeef9('0x6a')]({'where':{'id':_0xffae11[_0xeef9('0x4e')][_0xeef9('0x76')]},'attributes':['id',_0xeef9('0x2f'),_0xeef9('0x6b'),_0xeef9('0x73'),_0xeef9('0x6c')],'raw':!![]});}})[_0xeef9('0x27')](function(_0x57f82e){if(_0x57f82e){fs[_0xeef9('0x64')](path[_0xeef9('0x54')](_0x37febc['directory'],util[_0xeef9('0x6f')](_0xeef9('0x70'),_0x57f82e[_0xeef9('0x2f')],_0x57f82e[_0xeef9('0x73')])));return _0x57f82e;}})[_0xeef9('0x4c')](function(_0xca1510){throw new db[(_0xeef9('0x65'))][(_0xeef9('0x66'))](_0xca1510[_0xeef9('0x67')]);});})[_0xeef9('0x27')](handleEntityNotFound(_0x4afe36,null))[_0xeef9('0x27')](respondWithStatusCode(_0x4afe36,0xcc))[_0xeef9('0x4c')](handleError(_0x4afe36,null));};exports[_0xeef9('0x77')]=function(_0x521848,_0x5eb3b8,_0x2c40da){var _0x21b41c={};var _0x37d9f4={};var _0x259d24;var _0x5657fd;return db[_0xeef9('0x32')]['findOne']({'where':{'id':_0x521848['params']['id']}})[_0xeef9('0x27')](handleEntityNotFound(_0x5eb3b8,null))['then'](function(_0x13fb0e){if(_0x13fb0e){_0x259d24=_0x13fb0e;_0x37d9f4[_0xeef9('0x3b')]=_[_0xeef9('0x39')](db[_0xeef9('0x69')][_0xeef9('0x33')]);_0x37d9f4[_0xeef9('0x38')]=_['keys'](_0x521848['query']);_0x37d9f4['filters']=_['intersection'](_0x37d9f4[_0xeef9('0x3b')],_0x37d9f4['query']);_0x21b41c[_0xeef9('0x3c')]=_[_0xeef9('0x3d')](_0x37d9f4[_0xeef9('0x3b')],qs['fields'](_0x521848[_0xeef9('0x38')][_0xeef9('0x3e')]));_0x21b41c[_0xeef9('0x3c')]=_0x21b41c[_0xeef9('0x3c')]['length']?_0x21b41c[_0xeef9('0x3c')]:_0x37d9f4['model'];_0x21b41c['order']=qs[_0xeef9('0x43')](_0x521848['query'][_0xeef9('0x43')]);_0x21b41c[_0xeef9('0x45')]=qs[_0xeef9('0x3a')](_[_0xeef9('0x78')](_0x521848[_0xeef9('0x38')],_0x37d9f4[_0xeef9('0x3a')]));if(_0x521848[_0xeef9('0x38')]['filter']){_0x21b41c[_0xeef9('0x45')]=_[_0xeef9('0x47')](_0x21b41c[_0xeef9('0x45')],{'$or':_[_0xeef9('0x37')](_0x21b41c[_0xeef9('0x3c')],function(_0x3f964f){var _0x5126de={};_0x5126de[_0x3f964f]={'$like':'%'+_0x521848[_0xeef9('0x38')][_0xeef9('0x44')]+'%'};return _0x5126de;})});}_0x21b41c=_[_0xeef9('0x47')]({},_0x21b41c,_0x521848[_0xeef9('0x48')]);return _0x259d24[_0xeef9('0x77')](_0x21b41c);}})['then'](function(_0x4e9eac){if(_0x4e9eac){_0x5657fd=_0x4e9eac[_0xeef9('0x3f')];if(!_0x521848['query']['hasOwnProperty'](_0xeef9('0x40'))){_0x21b41c[_0xeef9('0x1f')]=qs['limit'](_0x521848[_0xeef9('0x38')][_0xeef9('0x1f')]);_0x21b41c[_0xeef9('0x41')]=qs[_0xeef9('0x41')](_0x521848[_0xeef9('0x38')][_0xeef9('0x41')]);}return _0x259d24[_0xeef9('0x77')](_0x21b41c);}})['then'](function(_0x112ce1){if(_0x112ce1){return _0x112ce1?{'count':_0x5657fd,'rows':_0x112ce1}:null;}})[_0xeef9('0x27')](respondWithResult(_0x5eb3b8,null))['catch'](handleError(_0x5eb3b8,null));}; \ No newline at end of file +var _0x5e4d=['sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','options','find','catch','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','ValidationError','removeSound','id2','unlinkSync','getSounds','pick','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e4d,0xce));var _0xd5e4=function(_0x3f3461,_0x26e131){_0x3f3461=_0x3f3461-0x0;var _0x311487=_0x5e4d[_0x3f3461];return _0x311487;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd5e4('0x0'));var rp=require(_0xd5e4('0x1'));var moment=require(_0xd5e4('0x2'));var BPromise=require(_0xd5e4('0x3'));var Mustache=require(_0xd5e4('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd5e4('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5e4('0x6'));var squel=require('squel');var crypto=require(_0xd5e4('0x7'));var jsforce=require(_0xd5e4('0x8'));var deskjs=require(_0xd5e4('0x9'));var toCsv=require('to-csv');var querystring=require(_0xd5e4('0xa'));var Papa=require(_0xd5e4('0xb'));var Redis=require('ioredis');var authService=require(_0xd5e4('0xc'));var qs=require(_0xd5e4('0xd'));var as=require(_0xd5e4('0xe'));var hardwareService=require(_0xd5e4('0xf'));var logger=require(_0xd5e4('0x10'))('api');var utils=require(_0xd5e4('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd5e4('0x12'));var db=require(_0xd5e4('0x13'))['db'];function respondWithStatusCode(_0x1e8d5c,_0x3182cc){_0x3182cc=_0x3182cc||0xcc;return function(_0x31c45b){if(_0x31c45b){return _0x1e8d5c[_0xd5e4('0x14')](_0x3182cc);}return _0x1e8d5c[_0xd5e4('0x15')](_0x3182cc)[_0xd5e4('0x16')]();};}function respondWithResult(_0xb1d8a9,_0x245240){_0x245240=_0x245240||0xc8;return function(_0x1ec147){if(_0x1ec147){return _0xb1d8a9['status'](_0x245240)[_0xd5e4('0x17')](_0x1ec147);}};}function respondWithFilteredResult(_0x39dd31,_0x5ec9e3){return function(_0x2416a9){if(_0x2416a9){var _0x17e112=typeof _0x5ec9e3['offset']===_0xd5e4('0x18')&&typeof _0x5ec9e3['limit']==='undefined';var _0x3586f8=_0x2416a9['count'];var _0x10e8fe=_0x17e112?0x0:_0x5ec9e3[_0xd5e4('0x19')];var _0x58616f=_0x17e112?_0x2416a9[_0xd5e4('0x1a')]:_0x5ec9e3[_0xd5e4('0x19')]+_0x5ec9e3[_0xd5e4('0x1b')];var _0x4eb38f;if(_0x58616f>=_0x3586f8){_0x58616f=_0x3586f8;_0x4eb38f=0xc8;}else{_0x4eb38f=0xce;}_0x39dd31[_0xd5e4('0x15')](_0x4eb38f);return _0x39dd31[_0xd5e4('0x1c')](_0xd5e4('0x1d'),_0x10e8fe+'-'+_0x58616f+'/'+_0x3586f8)['json'](_0x2416a9);}return null;};}function patchUpdates(_0x44df29){return function(_0x3e2a91){try{jsonpatch[_0xd5e4('0x1e')](_0x3e2a91,_0x44df29,!![]);}catch(_0x4e4f24){return BPromise[_0xd5e4('0x1f')](_0x4e4f24);}return _0x3e2a91[_0xd5e4('0x20')]();};}function saveUpdates(_0x4c275f,_0x3b09f7){return function(_0x1075e8){if(_0x1075e8){return _0x1075e8[_0xd5e4('0x21')](_0x4c275f)[_0xd5e4('0x22')](function(_0x94049a){return _0x94049a;});}return null;};}function removeEntity(_0x55d4f4,_0x2541d6){return function(_0x781c6a){if(_0x781c6a){return _0x781c6a[_0xd5e4('0x23')]()[_0xd5e4('0x22')](function(){var _0xf18c2d=_0x781c6a[_0xd5e4('0x24')]({'plain':!![]});var _0x51e74f='MusicOnHolds';return db[_0xd5e4('0x25')][_0xd5e4('0x23')]({'where':{'type':_0x51e74f,'resourceId':_0xf18c2d['id']}})['then'](function(){return _0x781c6a;});})['then'](function(){_0x55d4f4[_0xd5e4('0x15')](0xcc)[_0xd5e4('0x16')]();});}};}function handleEntityNotFound(_0x16ae0d,_0x201888){return function(_0x5a762b){if(!_0x5a762b){_0x16ae0d[_0xd5e4('0x14')](0x194);}return _0x5a762b;};}function handleError(_0x438c1c,_0x5c2f3a){_0x5c2f3a=_0x5c2f3a||0x1f4;return function(_0x2ddb98){logger['error'](_0x2ddb98['stack']);if(_0x2ddb98['name']){delete _0x2ddb98['name'];}_0x438c1c[_0xd5e4('0x15')](_0x5c2f3a)[_0xd5e4('0x26')](_0x2ddb98);};}exports[_0xd5e4('0x27')]=function(_0x35736b,_0xf2167d){var _0x5ea9b9={},_0x3e41f6={},_0x45f6e6={'count':0x0,'rows':[]};var _0x5f54f2=_['map'](db[_0xd5e4('0x28')][_0xd5e4('0x29')],function(_0xd5aba5){return{'name':_0xd5aba5[_0xd5e4('0x2a')],'type':_0xd5aba5[_0xd5e4('0x2b')][_0xd5e4('0x2c')]};});_0x3e41f6[_0xd5e4('0x2d')]=_[_0xd5e4('0x2e')](_0x5f54f2,_0xd5e4('0x2f'));_0x3e41f6[_0xd5e4('0x30')]=_[_0xd5e4('0x31')](_0x35736b[_0xd5e4('0x30')]);_0x3e41f6[_0xd5e4('0x32')]=_[_0xd5e4('0x33')](_0x3e41f6[_0xd5e4('0x2d')],_0x3e41f6[_0xd5e4('0x30')]);_0x5ea9b9[_0xd5e4('0x34')]=_['intersection'](_0x3e41f6['model'],qs[_0xd5e4('0x35')](_0x35736b[_0xd5e4('0x30')]['fields']));_0x5ea9b9['attributes']=_0x5ea9b9[_0xd5e4('0x34')][_0xd5e4('0x36')]?_0x5ea9b9[_0xd5e4('0x34')]:_0x3e41f6[_0xd5e4('0x2d')];if(!_0x35736b[_0xd5e4('0x30')][_0xd5e4('0x37')](_0xd5e4('0x38'))){_0x5ea9b9['limit']=qs[_0xd5e4('0x1b')](_0x35736b['query'][_0xd5e4('0x1b')]);_0x5ea9b9['offset']=qs[_0xd5e4('0x19')](_0x35736b[_0xd5e4('0x30')][_0xd5e4('0x19')]);}_0x5ea9b9[_0xd5e4('0x39')]=qs['sort'](_0x35736b[_0xd5e4('0x30')][_0xd5e4('0x3a')]);delete _0x35736b['query'][_0xd5e4('0x3a')];_0x5ea9b9['where']=qs[_0xd5e4('0x32')](_['pick'](_0x35736b[_0xd5e4('0x30')],_0x3e41f6[_0xd5e4('0x32')]),_0x5f54f2);if(_0x35736b[_0xd5e4('0x30')][_0xd5e4('0x3b')]){_0x5ea9b9[_0xd5e4('0x3c')]=_[_0xd5e4('0x3d')](_0x5ea9b9['where'],{'$or':_['map'](_0x5f54f2,function(_0x1c49dc){if(_0x1c49dc[_0xd5e4('0x2b')]!==_0xd5e4('0x3e')){var _0x37c095={};_0x37c095[_0x1c49dc[_0xd5e4('0x2f')]]={'$like':'%'+_0x35736b[_0xd5e4('0x30')]['filter']+'%'};return _0x37c095;}})});}_0x5ea9b9=_[_0xd5e4('0x3d')]({},_0x5ea9b9,_0x35736b['options']);var _0x33a2eb={'where':_0x5ea9b9[_0xd5e4('0x3c')]};return db[_0xd5e4('0x28')]['count'](_0x33a2eb)[_0xd5e4('0x22')](function(_0x2d165d){_0x45f6e6['count']=_0x2d165d;if(_0x35736b[_0xd5e4('0x30')]['includeAll']){_0x5ea9b9[_0xd5e4('0x3f')]=[{'all':!![]}];}return db[_0xd5e4('0x28')][_0xd5e4('0x40')](_0x5ea9b9);})[_0xd5e4('0x22')](function(_0x394b27){_0x45f6e6[_0xd5e4('0x41')]=_0x394b27;return _0x45f6e6;})[_0xd5e4('0x22')](respondWithFilteredResult(_0xf2167d,_0x5ea9b9))['catch'](handleError(_0xf2167d,null));};exports[_0xd5e4('0x42')]=function(_0x9f69a9,_0x398722){var _0x1224a3={'raw':![],'where':{'id':_0x9f69a9[_0xd5e4('0x43')]['id']}},_0x5f090e={};_0x5f090e['model']=_[_0xd5e4('0x31')](db[_0xd5e4('0x28')][_0xd5e4('0x29')]);_0x5f090e[_0xd5e4('0x30')]=_[_0xd5e4('0x31')](_0x9f69a9['query']);_0x5f090e[_0xd5e4('0x32')]=_[_0xd5e4('0x33')](_0x5f090e[_0xd5e4('0x2d')],_0x5f090e[_0xd5e4('0x30')]);_0x1224a3[_0xd5e4('0x34')]=_[_0xd5e4('0x33')](_0x5f090e[_0xd5e4('0x2d')],qs[_0xd5e4('0x35')](_0x9f69a9[_0xd5e4('0x30')]['fields']));_0x1224a3[_0xd5e4('0x34')]=_0x1224a3[_0xd5e4('0x34')][_0xd5e4('0x36')]?_0x1224a3[_0xd5e4('0x34')]:_0x5f090e[_0xd5e4('0x2d')];if(_0x9f69a9[_0xd5e4('0x30')]['includeAll']){_0x1224a3[_0xd5e4('0x3f')]=[{'all':!![]}];}_0x1224a3=_['merge']({},_0x1224a3,_0x9f69a9[_0xd5e4('0x44')]);return db[_0xd5e4('0x28')][_0xd5e4('0x45')](_0x1224a3)['then'](handleEntityNotFound(_0x398722,null))[_0xd5e4('0x22')](respondWithResult(_0x398722,null))[_0xd5e4('0x46')](handleError(_0x398722,null));};exports[_0xd5e4('0x21')]=function(_0x5b4a8f,_0xb0ba){if(_0x5b4a8f[_0xd5e4('0x47')]['id']){delete _0x5b4a8f[_0xd5e4('0x47')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5b4a8f[_0xd5e4('0x43')]['id']}})['then'](handleEntityNotFound(_0xb0ba,null))[_0xd5e4('0x22')](saveUpdates(_0x5b4a8f[_0xd5e4('0x47')],null))['then'](respondWithResult(_0xb0ba,null))['catch'](handleError(_0xb0ba,null));};exports[_0xd5e4('0x48')]=function(_0x5da058,_0x4b7494,_0x41f5b6){return db[_0xd5e4('0x49')][_0xd5e4('0x4a')](function(_0x120855){if(_0x5da058[_0xd5e4('0x47')]['mode']===_0xd5e4('0x4b')){_0x5da058[_0xd5e4('0x47')][_0xd5e4('0x4c')]=path[_0xd5e4('0x4d')](config[_0xd5e4('0x4e')],_0xd5e4('0x4f'),_0x5da058[_0xd5e4('0x47')][_0xd5e4('0x2f')]);}return db[_0xd5e4('0x28')][_0xd5e4('0x48')](_0x5da058[_0xd5e4('0x47')],{'transaction':_0x120855})[_0xd5e4('0x22')](function(_0x5e937a){if(_0x5da058[_0xd5e4('0x47')][_0xd5e4('0x50')]==='files'){fs[_0xd5e4('0x51')](_0x5e937a[_0xd5e4('0x4c')],parseInt(_0xd5e4('0x52'),0x8));}var _0xa32192=_0x5da058['user'][_0xd5e4('0x24')]({'plain':!![]});if(!_0xa32192)throw new Error(_0xd5e4('0x53'));if(_0xa32192['role']===_0xd5e4('0x54')){var _0x8efb6d=_0x5e937a[_0xd5e4('0x24')]({'plain':!![]});return db[_0xd5e4('0x55')][_0xd5e4('0x45')]({'where':{'name':_0xd5e4('0x56'),'userProfileId':_0xa32192[_0xd5e4('0x57')]},'raw':!![]})[_0xd5e4('0x22')](function(_0x541f23){if(_0x541f23&&_0x541f23[_0xd5e4('0x58')]===0x0){return db['UserProfileResource'][_0xd5e4('0x48')]({'name':_0x8efb6d['name'],'resourceId':_0x8efb6d['id'],'type':_0x541f23[_0xd5e4('0x2f')],'sectionId':_0x541f23['id']},{})[_0xd5e4('0x22')](function(){return _0x5e937a;});}else{return _0x5e937a;}})[_0xd5e4('0x46')](function(_0x532562){logger[_0xd5e4('0x59')](_0xd5e4('0x5a'),_0x532562);});}return _0x5e937a;});})[_0xd5e4('0x22')](respondWithResult(_0x4b7494,0xc9))['catch'](handleError(_0x4b7494,null));};exports[_0xd5e4('0x23')]=function(_0x564781,_0x3becbe,_0x18c40f){var _0x9f4915;return db[_0xd5e4('0x28')][_0xd5e4('0x45')]({'where':{'id':_0x564781[_0xd5e4('0x43')]['id']}})[_0xd5e4('0x22')](function(_0x3d066b){if(_0x3d066b){return db[_0xd5e4('0x49')][_0xd5e4('0x4a')](function(_0x3e1cf2){return _0x3d066b[_0xd5e4('0x23')]({'transaction':_0x3e1cf2,'raw':!![]})['then'](function(_0x4b74b5){if(_0x4b74b5['directory']){fs[_0xd5e4('0x5b')](_0x4b74b5[_0xd5e4('0x4c')])[_0xd5e4('0x5c')](function(_0xc8affd){fs['unlinkSync'](path[_0xd5e4('0x4d')](_0x4b74b5[_0xd5e4('0x4c')],_0xc8affd));});fs[_0xd5e4('0x5d')](_0x4b74b5['directory']);}return _0x4b74b5;});})['catch'](function(_0x3440be){throw new db[(_0xd5e4('0x5e'))]['ValidationError'](_0x3440be[_0xd5e4('0x5f')]);});}})[_0xd5e4('0x22')](handleEntityNotFound(_0x3becbe,null))[_0xd5e4('0x22')](removeEntity(_0x3becbe,null))[_0xd5e4('0x46')](handleError(_0x3becbe,null));};exports[_0xd5e4('0x60')]=function(_0x24d91d,_0x1016d3,_0x4f78df){return db[_0xd5e4('0x49')]['transaction'](function(_0x3edb14){var _0x23d0c6;return db[_0xd5e4('0x28')][_0xd5e4('0x45')]({'where':{'id':_0x24d91d[_0xd5e4('0x43')]['id']}})[_0xd5e4('0x22')](function(_0x3ff937){if(_0x3ff937){_0x23d0c6=_0x3ff937;return _0x3ff937['addSound'](_0x24d91d[_0xd5e4('0x47')]['id'],{'transaction':_0x3edb14});}})['then'](function(_0x542f85){if(_0x542f85){return db[_0xd5e4('0x61')][_0xd5e4('0x62')]({'where':{'id':_0x24d91d[_0xd5e4('0x47')]['id']},'attributes':['id',_0xd5e4('0x2f'),'save_name',_0xd5e4('0x63'),_0xd5e4('0x64')],'raw':!![]});}})['then'](function(_0x27ffdf){if(_0x27ffdf){var _0x311f05=path[_0xd5e4('0x4d')](config['root'],_0xd5e4('0x65'),util[_0xd5e4('0x66')]('%s.%s',path[_0xd5e4('0x67')](_0x27ffdf[_0xd5e4('0x68')],path[_0xd5e4('0x69')](_0x27ffdf[_0xd5e4('0x68')])),_0x27ffdf[_0xd5e4('0x63')]));var _0x5e2f9a=path['join'](config[_0xd5e4('0x4e')],_0xd5e4('0x4f'),_0x23d0c6[_0xd5e4('0x2f')],util[_0xd5e4('0x66')](_0xd5e4('0x6a'),_0x27ffdf[_0xd5e4('0x2f')],_0x27ffdf[_0xd5e4('0x63')]));fs['symlinkSync'](_0x311f05,_0x5e2f9a);return _0x27ffdf;}})['catch'](function(_0x4858d5){throw new db[(_0xd5e4('0x5e'))][(_0xd5e4('0x6b'))](_0x4858d5[_0xd5e4('0x5f')]);});})['then'](handleEntityNotFound(_0x1016d3,null))['then'](respondWithResult(_0x1016d3,0xc9))['catch'](handleError(_0x1016d3,null));};exports[_0xd5e4('0x6c')]=function(_0x17d788,_0x191201,_0x3d9035){return db[_0xd5e4('0x49')][_0xd5e4('0x4a')](function(_0x3e983b){var _0x3de3cf;return db[_0xd5e4('0x28')]['findOne']({'where':{'id':_0x17d788['params']['id']}})[_0xd5e4('0x22')](handleEntityNotFound(_0x191201,null))[_0xd5e4('0x22')](function(_0x2646f0){if(_0x2646f0){_0x3de3cf=_0x2646f0;return _0x2646f0[_0xd5e4('0x6c')](_0x17d788[_0xd5e4('0x43')][_0xd5e4('0x6d')]);}})[_0xd5e4('0x22')](function(_0x1936b3){if(_0x1936b3){return db['Sound'][_0xd5e4('0x62')]({'where':{'id':_0x17d788[_0xd5e4('0x43')][_0xd5e4('0x6d')]},'attributes':['id',_0xd5e4('0x2f'),_0xd5e4('0x68'),_0xd5e4('0x63'),_0xd5e4('0x64')],'raw':!![]});}})[_0xd5e4('0x22')](function(_0x452e99){if(_0x452e99){fs[_0xd5e4('0x6e')](path[_0xd5e4('0x4d')](_0x3de3cf[_0xd5e4('0x4c')],util['format'](_0xd5e4('0x6a'),_0x452e99[_0xd5e4('0x2f')],_0x452e99[_0xd5e4('0x63')])));return _0x452e99;}})['catch'](function(_0x5b33cb){throw new db[(_0xd5e4('0x5e'))][(_0xd5e4('0x6b'))](_0x5b33cb['message']);});})[_0xd5e4('0x22')](handleEntityNotFound(_0x191201,null))[_0xd5e4('0x22')](respondWithStatusCode(_0x191201,0xcc))[_0xd5e4('0x46')](handleError(_0x191201,null));};exports[_0xd5e4('0x6f')]=function(_0x43da6b,_0x42dd93,_0x5682ac){var _0x40b8ab={};var _0xa2f354={};var _0x4281ca;var _0xc89ab8;return db[_0xd5e4('0x28')][_0xd5e4('0x62')]({'where':{'id':_0x43da6b['params']['id']}})[_0xd5e4('0x22')](handleEntityNotFound(_0x42dd93,null))[_0xd5e4('0x22')](function(_0x2d0822){if(_0x2d0822){_0x4281ca=_0x2d0822;_0xa2f354[_0xd5e4('0x2d')]=_[_0xd5e4('0x31')](db['Sound'][_0xd5e4('0x29')]);_0xa2f354[_0xd5e4('0x30')]=_[_0xd5e4('0x31')](_0x43da6b[_0xd5e4('0x30')]);_0xa2f354[_0xd5e4('0x32')]=_[_0xd5e4('0x33')](_0xa2f354[_0xd5e4('0x2d')],_0xa2f354[_0xd5e4('0x30')]);_0x40b8ab[_0xd5e4('0x34')]=_[_0xd5e4('0x33')](_0xa2f354[_0xd5e4('0x2d')],qs[_0xd5e4('0x35')](_0x43da6b['query'][_0xd5e4('0x35')]));_0x40b8ab[_0xd5e4('0x34')]=_0x40b8ab[_0xd5e4('0x34')][_0xd5e4('0x36')]?_0x40b8ab[_0xd5e4('0x34')]:_0xa2f354[_0xd5e4('0x2d')];_0x40b8ab[_0xd5e4('0x39')]=qs[_0xd5e4('0x3a')](_0x43da6b[_0xd5e4('0x30')][_0xd5e4('0x3a')]);_0x40b8ab['where']=qs[_0xd5e4('0x32')](_[_0xd5e4('0x70')](_0x43da6b['query'],_0xa2f354['filters']));if(_0x43da6b[_0xd5e4('0x30')][_0xd5e4('0x3b')]){_0x40b8ab[_0xd5e4('0x3c')]=_[_0xd5e4('0x3d')](_0x40b8ab[_0xd5e4('0x3c')],{'$or':_[_0xd5e4('0x2e')](_0x40b8ab['attributes'],function(_0xff2096){var _0x4cb7c2={};_0x4cb7c2[_0xff2096]={'$like':'%'+_0x43da6b[_0xd5e4('0x30')][_0xd5e4('0x3b')]+'%'};return _0x4cb7c2;})});}_0x40b8ab=_[_0xd5e4('0x3d')]({},_0x40b8ab,_0x43da6b[_0xd5e4('0x44')]);return _0x4281ca[_0xd5e4('0x6f')](_0x40b8ab);}})[_0xd5e4('0x22')](function(_0x119a2d){if(_0x119a2d){_0xc89ab8=_0x119a2d[_0xd5e4('0x36')];if(!_0x43da6b[_0xd5e4('0x30')][_0xd5e4('0x37')](_0xd5e4('0x38'))){_0x40b8ab[_0xd5e4('0x1b')]=qs['limit'](_0x43da6b['query'][_0xd5e4('0x1b')]);_0x40b8ab['offset']=qs[_0xd5e4('0x19')](_0x43da6b[_0xd5e4('0x30')][_0xd5e4('0x19')]);}return _0x4281ca['getSounds'](_0x40b8ab);}})[_0xd5e4('0x22')](function(_0x3e46a6){if(_0x3e46a6){return _0x3e46a6?{'count':_0xc89ab8,'rows':_0x3e46a6}:null;}})['then'](respondWithResult(_0x42dd93,null))[_0xd5e4('0x46')](handleError(_0x42dd93,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1f11f77..26c9992 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 _0x0afe=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x943177,_0x1b3744){var _0x2d978e=function(_0x5a9b3e){while(--_0x5a9b3e){_0x943177['push'](_0x943177['shift']());}};_0x2d978e(++_0x1b3744);}(_0x0afe,0xea));var _0xe0af=function(_0x3a6e85,_0x388c42){_0x3a6e85=_0x3a6e85-0x0;var _0xb1f143=_0x0afe[_0x3a6e85];return _0xb1f143;};'use strict';var _=require(_0xe0af('0x0'));var util=require(_0xe0af('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0af('0x2'));var fs=require('fs');var path=require(_0xe0af('0x3'));var rimraf=require('rimraf');var config=require(_0xe0af('0x4'));var attributes=require(_0xe0af('0x5'));module[_0xe0af('0x6')]=function(_0x123a25,_0x152c0d){return _0x123a25[_0xe0af('0x7')](_0xe0af('0x8'),attributes,{'tableName':_0xe0af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a7f=['../../config/logger','api','moment','bluebird','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash'];(function(_0x195f1f,_0x4f1cc7){var _0x1c8d87=function(_0x52ce46){while(--_0x52ce46){_0x195f1f['push'](_0x195f1f['shift']());}};_0x1c8d87(++_0x4f1cc7);}(_0x8a7f,0x1b8));var _0xf8a7=function(_0x4b23a5,_0x56be5e){_0x4b23a5=_0x4b23a5-0x0;var _0x4dd678=_0x8a7f[_0x4b23a5];return _0x4dd678;};'use strict';var _=require(_0xf8a7('0x0'));var util=require('util');var logger=require(_0xf8a7('0x1'))(_0xf8a7('0x2'));var moment=require(_0xf8a7('0x3'));var BPromise=require(_0xf8a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8a7('0x5'));var attributes=require(_0xf8a7('0x6'));module['exports']=function(_0x1fb21e,_0x2b1ec0){return _0x1fb21e[_0xf8a7('0x7')](_0xf8a7('0x8'),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 73e6281..d3b4530 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x5454f8,_0x2b3d4b){var _0x3c05a3=function(_0x2e799c){while(--_0x2e799c){_0x5454f8['push'](_0x5454f8['shift']());}};_0x3c05a3(++_0x2b3d4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2b38b7,_0x416d31){var _0x55b409=function(_0x5708fe){while(--_0x5708fe){_0x2b38b7['push'](_0x2b38b7['shift']());}};_0x55b409(++_0x416d31);}(_0x70e0,0x17b));var _0x070e=function(_0x749f56,_0x3afb06){_0x749f56=_0x749f56-0x0;var _0x5ccfb1=_0x70e0[_0x749f56];return _0x5ccfb1;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 06d3f0d..f6d36a5 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 _0x624c=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','/:id/teams','getTeams','post','create','put','update','delete','destroy','removeAgents','removeTeams','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x24e6a2,_0x483815){var _0x494939=function(_0x16d1dd){while(--_0x16d1dd){_0x24e6a2['push'](_0x24e6a2['shift']());}};_0x494939(++_0x483815);}(_0x624c,0x1ee));var _0xc624=function(_0x3746ff,_0x5dfa8f){_0x3746ff=_0x3746ff-0x0;var _0x353055=_0x624c[_0x3746ff];return _0x353055;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./voicePrefix.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['get'](_0xc624('0xc'),auth[_0xc624('0x8')](),controller[_0xc624('0xd')]);router['get'](_0xc624('0xe'),auth[_0xc624('0x8')](),controller['getAgents']);router[_0xc624('0x7')](_0xc624('0xf'),auth[_0xc624('0x8')](),controller[_0xc624('0x10')]);router[_0xc624('0x11')]('/',auth['isAuthenticated'](),controller[_0xc624('0x12')]);router[_0xc624('0x11')](_0xc624('0xe'),auth[_0xc624('0x8')](),controller['addAgents']);router['post']('/:id/teams',auth[_0xc624('0x8')](),controller['addTeams']);router[_0xc624('0x13')](_0xc624('0xc'),auth[_0xc624('0x8')](),controller[_0xc624('0x14')]);router[_0xc624('0x15')](_0xc624('0xc'),auth['isAuthenticated'](),controller[_0xc624('0x16')]);router[_0xc624('0x15')](_0xc624('0xe'),auth['isAuthenticated'](),controller[_0xc624('0x17')]);router[_0xc624('0x15')]('/:id/teams',auth[_0xc624('0x8')](),controller[_0xc624('0x18')]);module['exports']=router; \ No newline at end of file +var _0xea31=['removeAgents','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','put','update','delete'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0xea31,0x6b));var _0x1ea3=function(_0x322cce,_0x10be19){_0x322cce=_0x322cce-0x0;var _0x85b7a2=_0xea31[_0x322cce];return _0x85b7a2;};'use strict';var multer=require(_0x1ea3('0x0'));var util=require('util');var path=require(_0x1ea3('0x1'));var timeout=require(_0x1ea3('0x2'));var express=require(_0x1ea3('0x3'));var router=express[_0x1ea3('0x4')]();var fs_extra=require(_0x1ea3('0x5'));var auth=require(_0x1ea3('0x6'));var interaction=require(_0x1ea3('0x7'));var config=require('../../config/environment');var controller=require(_0x1ea3('0x8'));router[_0x1ea3('0x9')]('/',auth[_0x1ea3('0xa')](),controller[_0x1ea3('0xb')]);router[_0x1ea3('0x9')]('/describe',auth[_0x1ea3('0xa')](),controller[_0x1ea3('0xc')]);router[_0x1ea3('0x9')](_0x1ea3('0xd'),auth[_0x1ea3('0xa')](),controller[_0x1ea3('0xe')]);router['get'](_0x1ea3('0xf'),auth[_0x1ea3('0xa')](),controller[_0x1ea3('0x10')]);router[_0x1ea3('0x9')](_0x1ea3('0x11'),auth[_0x1ea3('0xa')](),controller[_0x1ea3('0x12')]);router['post']('/',auth[_0x1ea3('0xa')](),controller['create']);router[_0x1ea3('0x13')](_0x1ea3('0xf'),auth[_0x1ea3('0xa')](),controller['addAgents']);router[_0x1ea3('0x13')](_0x1ea3('0x11'),auth[_0x1ea3('0xa')](),controller['addTeams']);router[_0x1ea3('0x14')](_0x1ea3('0xd'),auth[_0x1ea3('0xa')](),controller[_0x1ea3('0x15')]);router[_0x1ea3('0x16')](_0x1ea3('0xd'),auth[_0x1ea3('0xa')](),controller['destroy']);router[_0x1ea3('0x16')](_0x1ea3('0xf'),auth[_0x1ea3('0xa')](),controller[_0x1ea3('0x17')]);router[_0x1ea3('0x16')]('/:id/teams',auth[_0x1ea3('0xa')](),controller[_0x1ea3('0x18')]);module[_0x1ea3('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 1573be3..161ed84 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 _0x4597=['VIRTUAL','system-','name','INTEGER','sequelize','exports','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4597,0xeb));var _0x7459=function(_0x38f168,_0x280c64){_0x38f168=_0x38f168-0x0;var _0x4ab03d=_0x4597[_0x38f168];return _0x4ab03d;};'use strict';var Sequelize=require(_0x7459('0x0'));module[_0x7459('0x1')]={'name':{'type':Sequelize[_0x7459('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x7459('0x3')],'get':function(_0x435576){return _0x7459('0x4')+this['getDataValue'](_0x7459('0x5'))+'-';}},'description':{'type':Sequelize[_0x7459('0x2')]},'callerIdAll':{'type':Sequelize[_0x7459('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7459('0x6')]}}; \ No newline at end of file +var _0xb7d4=['VIRTUAL','system-','STRING','INTEGER','exports','name'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xb7d4,0xb8));var _0x4b7d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb7d4[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module[_0x4b7d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b7d('0x1')},'prefix':{'type':Sequelize[_0x4b7d('0x2')],'get':function(_0xceb770){return _0x4b7d('0x3')+this['getDataValue'](_0x4b7d('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4b7d('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x4b7d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d283a19..fadd245 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 _0x5eb8=['from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','sort','where','pick','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','hasOwnProperty','nolimit','getTeams','addTeams','Team','User','online','voicePause','interface','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId'];(function(_0x181aec,_0x445711){var _0x5a039a=function(_0x1be578){while(--_0x1be578){_0x181aec['push'](_0x181aec['shift']());}};_0x5a039a(++_0x445711);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x5eb8[_0x2becba];return _0x90b5dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];config[_0x85eb('0x19')]=_[_0x85eb('0x1a')](config[_0x85eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0x19')]));require('./voicePrefix.socket')[_0x85eb('0x1b')](socket);function respondWithStatusCode(_0x23a82a,_0x600a7f){_0x600a7f=_0x600a7f||0xcc;return function(_0x1604ba){if(_0x1604ba){return _0x23a82a[_0x85eb('0x1c')](_0x600a7f);}return _0x23a82a['status'](_0x600a7f)[_0x85eb('0x1d')]();};}function respondWithResult(_0x59237b,_0x17140b){_0x17140b=_0x17140b||0xc8;return function(_0x10c2c9){if(_0x10c2c9){return _0x59237b[_0x85eb('0x1e')](_0x17140b)[_0x85eb('0x1f')](_0x10c2c9);}};}function respondWithFilteredResult(_0x5dbeda,_0x5c5cbb){return function(_0x50d2a8){if(_0x50d2a8){var _0xe198ca=typeof _0x5c5cbb[_0x85eb('0x20')]===_0x85eb('0x21')&&typeof _0x5c5cbb[_0x85eb('0x22')]===_0x85eb('0x21');var _0x34f875=_0x50d2a8['count'];var _0x24cf28=_0xe198ca?0x0:_0x5c5cbb[_0x85eb('0x20')];var _0xd9f06d=_0xe198ca?_0x50d2a8['count']:_0x5c5cbb['offset']+_0x5c5cbb['limit'];var _0x55b9e4;if(_0xd9f06d>=_0x34f875){_0xd9f06d=_0x34f875;_0x55b9e4=0xc8;}else{_0x55b9e4=0xce;}_0x5dbeda[_0x85eb('0x1e')](_0x55b9e4);return _0x5dbeda[_0x85eb('0x23')](_0x85eb('0x24'),_0x24cf28+'-'+_0xd9f06d+'/'+_0x34f875)[_0x85eb('0x1f')](_0x50d2a8);}return null;};}function patchUpdates(_0x465c74){return function(_0x3fc6da){try{jsonpatch['apply'](_0x3fc6da,_0x465c74,!![]);}catch(_0x5491d5){return BPromise['reject'](_0x5491d5);}return _0x3fc6da[_0x85eb('0x25')]();};}function saveUpdates(_0x1426c8,_0x3f7a4d){return function(_0x28b87d){if(_0x28b87d){return _0x28b87d[_0x85eb('0x26')](_0x1426c8)[_0x85eb('0x27')](function(_0x5dfc96){return _0x5dfc96;});}return null;};}function removeEntity(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(_0x4709ad){return _0x4709ad[_0x85eb('0x28')]()[_0x85eb('0x27')](function(){var _0x57a03c=_0x4709ad[_0x85eb('0x29')]({'plain':!![]});var _0x792d3a=_0x85eb('0x2a');return db[_0x85eb('0x2b')][_0x85eb('0x28')]({'where':{'type':_0x792d3a,'resourceId':_0x57a03c['id']}})[_0x85eb('0x27')](function(){return _0x4709ad;});})['then'](function(){_0x39d3fe['status'](0xcc)[_0x85eb('0x1d')]();});}};}function handleEntityNotFound(_0x585f2a,_0xa9b14f){return function(_0x5255eb){if(!_0x5255eb){_0x585f2a[_0x85eb('0x1c')](0x194);}return _0x5255eb;};}function handleError(_0x3570f7,_0x1ba904){_0x1ba904=_0x1ba904||0x1f4;return function(_0x1d9278){logger[_0x85eb('0x2c')](_0x1d9278[_0x85eb('0x2d')]);if(_0x1d9278[_0x85eb('0x2e')]){delete _0x1d9278['name'];}_0x3570f7[_0x85eb('0x1e')](_0x1ba904)[_0x85eb('0x2f')](_0x1d9278);};}exports['index']=function(_0x197898,_0x5af2de){var _0x5439aa={},_0x3c5ecc={},_0x3a533c={'count':0x0,'rows':[]};var _0x3e6f34=_[_0x85eb('0x30')](db[_0x85eb('0x31')][_0x85eb('0x32')],function(_0x39b574){return{'name':_0x39b574[_0x85eb('0x33')],'type':_0x39b574[_0x85eb('0x34')][_0x85eb('0x35')]};});_0x3c5ecc['model']=_[_0x85eb('0x30')](_0x3e6f34,_0x85eb('0x2e'));_0x3c5ecc['query']=_['keys'](_0x197898[_0x85eb('0x36')]);_0x3c5ecc[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],_0x3c5ecc[_0x85eb('0x36')]);_0x5439aa[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x197898[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x5439aa[_0x85eb('0x3a')]=_0x5439aa[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x5439aa['attributes']:_0x3c5ecc[_0x85eb('0x39')];if(!_0x197898[_0x85eb('0x36')]['hasOwnProperty']('nolimit')){_0x5439aa[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x197898['query'][_0x85eb('0x22')]);_0x5439aa['offset']=qs[_0x85eb('0x20')](_0x197898['query'][_0x85eb('0x20')]);}_0x5439aa['order']=qs[_0x85eb('0x3d')](_0x197898['query'][_0x85eb('0x3d')]);_0x5439aa[_0x85eb('0x3e')]=qs['filters'](_[_0x85eb('0x3f')](_0x197898['query'],_0x3c5ecc[_0x85eb('0x37')]),_0x3e6f34);if(_0x197898[_0x85eb('0x36')]['filter']){_0x5439aa[_0x85eb('0x3e')]=_['merge'](_0x5439aa['where'],{'$or':_[_0x85eb('0x30')](_0x3e6f34,function(_0x4edb2d){if(_0x4edb2d[_0x85eb('0x34')]!==_0x85eb('0x40')){var _0x5da012={};_0x5da012[_0x4edb2d['name']]={'$like':'%'+_0x197898[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x5da012;}})});}_0x5439aa=_['merge']({},_0x5439aa,_0x197898['options']);var _0x2864e2={'where':_0x5439aa[_0x85eb('0x3e')]};return db[_0x85eb('0x31')][_0x85eb('0x42')](_0x2864e2)[_0x85eb('0x27')](function(_0x5b7411){_0x3a533c[_0x85eb('0x42')]=_0x5b7411;if(_0x197898[_0x85eb('0x36')][_0x85eb('0x43')]){_0x5439aa[_0x85eb('0x44')]=[{'all':!![]}];}return db[_0x85eb('0x31')][_0x85eb('0x45')](_0x5439aa);})[_0x85eb('0x27')](function(_0x3e11a8){_0x3a533c[_0x85eb('0x46')]=_0x3e11a8;return _0x3a533c;})['then'](respondWithFilteredResult(_0x5af2de,_0x5439aa))[_0x85eb('0x47')](handleError(_0x5af2de,null));};exports[_0x85eb('0x48')]=function(_0x5d90cc,_0x1b77b3){var _0x201aed={'raw':![],'where':{'id':_0x5d90cc[_0x85eb('0x49')]['id']}},_0x2dae5b={};_0x2dae5b[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['VoicePrefix'][_0x85eb('0x32')]);_0x2dae5b[_0x85eb('0x36')]=_[_0x85eb('0x4a')](_0x5d90cc[_0x85eb('0x36')]);_0x2dae5b[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],_0x2dae5b[_0x85eb('0x36')]);_0x201aed['attributes']=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x201aed[_0x85eb('0x3a')]=_0x201aed[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x201aed[_0x85eb('0x3a')]:_0x2dae5b[_0x85eb('0x39')];if(_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x43')]){_0x201aed['include']=[{'all':!![]}];}_0x201aed=_[_0x85eb('0x4b')]({},_0x201aed,_0x5d90cc[_0x85eb('0x4c')]);return db[_0x85eb('0x31')]['find'](_0x201aed)[_0x85eb('0x27')](handleEntityNotFound(_0x1b77b3,null))[_0x85eb('0x27')](respondWithResult(_0x1b77b3,null))[_0x85eb('0x47')](handleError(_0x1b77b3,null));};exports[_0x85eb('0x28')]=function(_0xd3ff2b,_0x4a7506){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xd3ff2b[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a7506,null))[_0x85eb('0x27')](removeEntity(_0x4a7506,null))[_0x85eb('0x47')](handleError(_0x4a7506,null));};exports[_0x85eb('0x4e')]=function(_0x4c06ef,_0x56f510){return db[_0x85eb('0x31')]['describe']()['then'](respondWithResult(_0x56f510,null))[_0x85eb('0x47')](handleError(_0x56f510,null));};exports['create']=function(_0x39316d,_0xfb0ac){var _0x4e3d96;return db['sequelize'][_0x85eb('0x4f')](function(_0x249511){return db[_0x85eb('0x31')][_0x85eb('0x50')](_0x39316d[_0x85eb('0x51')],{'transaction':_0x249511})['then'](function(_0x1bb9f8){_0x4e3d96=_0x1bb9f8[_0x85eb('0x29')]({'plain':!![]});return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x4e3d96[_0x85eb('0x53')]},'raw':!![]})['then'](function(_0x140919){return createVoicePrefixExtensions(_0x4e3d96,_0x140919,_0x249511);});});})['then'](function(){var _0xd2e792=_0x39316d[_0x85eb('0x54')]['get']({'plain':!![]});if(!_0xd2e792)throw new Error(_0x85eb('0x55'));if(_0xd2e792[_0x85eb('0x56')]===_0x85eb('0x54')){var _0x26e04a=_0x4e3d96;return db[_0x85eb('0x57')][_0x85eb('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0xd2e792[_0x85eb('0x58')]},'raw':!![]})['then'](function(_0x311857){if(_0x311857&&_0x311857[_0x85eb('0x59')]===0x0){return db['UserProfileResource'][_0x85eb('0x50')]({'name':_0x26e04a[_0x85eb('0x2e')],'resourceId':_0x26e04a['id'],'type':_0x311857['name'],'sectionId':_0x311857['id']},{})[_0x85eb('0x27')](function(){return _0x4e3d96;});}else{return _0x4e3d96;}})['catch'](function(_0x452e7e){logger[_0x85eb('0x2c')](_0x85eb('0x5a'),_0x452e7e);throw _0x452e7e;});}return _0x4e3d96;})[_0x85eb('0x27')](respondWithResult(_0xfb0ac,null))[_0x85eb('0x47')](handleError(_0xfb0ac,null));};function Extension(_0x15d4a7,_0x5a729e,_0x2227ea,_0x76a9c6){this[_0x85eb('0x5b')]=_0x85eb('0x5c');this[_0x85eb('0x5d')]=_0x15d4a7;this[_0x85eb('0x5e')]=_0x2227ea;this[_0x85eb('0x34')]=_0x85eb('0x5f');this[_0x85eb('0x60')]=_0x85eb('0x61');this[_0x85eb('0x62')]=_0x5a729e;this['appdata']=_0x76a9c6;}function createVoicePrefixExtensions(_0x271842,_0x21b873,_0x46e5d3){return new BPromise(function(_0xdaf2fe,_0x4470b3){var _0x213b64=new Extension(formatPrefixName(_0x271842['prefix']),0x1,_0x85eb('0x63'),'Voice\x20Prefix');_0x213b64[_0x85eb('0x64')]=_0x271842['id'];return db[_0x85eb('0x52')][_0x85eb('0x50')](_0x213b64,{'transaction':_0x46e5d3})[_0x85eb('0x27')](function(_0x8f8a72){var _0x4f09dc=_0x8f8a72[_0x85eb('0x29')]({'plain':!![]});var _0x143d65=_[_0x85eb('0x30')](addVoicePrefixExtensions(_0x271842,_0x21b873),function(_0x2c40f8){_0x2c40f8[_0x85eb('0x53')]=_0x4f09dc['id'];_0x2c40f8[_0x85eb('0x64')]=_0x271842['id'];return _0x2c40f8;});return db[_0x85eb('0x52')][_0x85eb('0x65')](_0x143d65,{'transaction':_0x46e5d3})['then'](function(_0x3b896a){if(!_0x3b896a){return _0x4470b3('Extensions\x20creation\x20failed');}else{return _0xdaf2fe(_0x3b896a);}})[_0x85eb('0x47')](function(_0x3ff0f9){return _0x4470b3(_0x3ff0f9);});});;});};function addVoicePrefixExtensions(_0x2ac293,_0x41960f){var _0x259ee3=[];var _0x547ccb=formatPrefixName(_0x2ac293[_0x85eb('0x66')]);_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x2,_0x85eb('0x68'),_0x85eb('0x69')+_0x2ac293[_0x85eb('0x2e')]));if(_0x2ac293[_0x85eb('0x6a')]){_0x259ee3['push'](new Extension(_0x547ccb,0x3,'Set',_0x85eb('0x6b')+_0x2ac293['callerIdAll']));}else{_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x3,_0x85eb('0x63'),_0x85eb('0x6c')));}_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x4,_0x85eb('0x6d'),_0x41960f[_0x85eb('0x5b')]+','+'${EXTEN:'+(0x8+_0x2ac293[_0x85eb('0x2e')][_0x85eb('0x3c')])+'}'+','+0x1));return _0x259ee3;}function formatPrefixName(_0x3f30e4){var _0x2e65d5='_';for(var _0x52bbdf=0x0;_0x52bbdf<_0x3f30e4[_0x85eb('0x3c')];_0x52bbdf++){if(_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)=='-'){_0x2e65d5+=_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf);}else{_0x2e65d5+='['+_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)+']';}}_0x2e65d5+='.';return _0x2e65d5;}exports['update']=function(_0x459317,_0x2e6734,_0x13a040){var _0x5fcd48=_0x459317[_0x85eb('0x51')];_0x5fcd48[_0x85eb('0x66')]=_0x85eb('0x6f')+_0x5fcd48[_0x85eb('0x2e')]+'-';return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x170a60){return db[_0x85eb('0x31')][_0x85eb('0x26')](_0x5fcd48,{'where':{'id':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x28')]({'where':{'VoicePrefixId':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x5fcd48['VoiceExtensionId']},'raw':!![]})[_0x85eb('0x27')](function(_0x4dd31e){return createVoicePrefixExtensions(_0x5fcd48,_0x4dd31e,_0x170a60);});});});})[_0x85eb('0x27')](function(){return db[_0x85eb('0x31')][_0x85eb('0x71')](_0x5fcd48['id']);})[_0x85eb('0x27')](respondWithResult(_0x2e6734,null))[_0x85eb('0x47')](handleError(_0x2e6734,null));};exports[_0x85eb('0x72')]=function(_0x9f4f,_0x3076df,_0x2ca9f9){return db['VoicePrefix'][_0x85eb('0x4d')]({'where':{'id':_0x9f4f[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x3076df,null))[_0x85eb('0x27')](function(_0x440968){if(_0x440968){return _0x440968['addAgents'](_0x9f4f[_0x85eb('0x51')]['ids'],_[_0x85eb('0x73')](_0x9f4f[_0x85eb('0x51')],[_0x85eb('0x74'),'id'])||{})['spread'](function(_0x2daa64){for(var _0x2e358d=0x0;_0x2e358d<_0x9f4f[_0x85eb('0x51')]['ids']['length'];_0x2e358d+=0x1){socket[_0x85eb('0x75')](_0x85eb('0x76'),{'UserId':Number(_0x9f4f[_0x85eb('0x51')][_0x85eb('0x74')][_0x2e358d]),'VoicePrefixId':Number(_0x9f4f['params']['id'])});}return _0x2daa64;});}})[_0x85eb('0x27')](respondWithResult(_0x3076df,null))['catch'](handleError(_0x3076df,null));};exports[_0x85eb('0x77')]=function(_0xed99f7,_0x528d2e,_0x2fad3b){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xed99f7['params']['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x528d2e,null))['then'](function(_0x18049b){if(_0x18049b){return _0x18049b[_0x85eb('0x77')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])[_0x85eb('0x27')](function(){if(_[_0x85eb('0x78')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])){for(var _0x3a471d=0x0;_0x3a471d<_0xed99f7['query'][_0x85eb('0x74')][_0x85eb('0x3c')];_0x3a471d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xed99f7[_0x85eb('0x36')]['ids'][_0x3a471d]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}}else{socket['emit'](_0x85eb('0x79'),{'UserId':Number(_0xed99f7['query'][_0x85eb('0x74')]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x528d2e,null))[_0x85eb('0x47')](handleError(_0x528d2e,null));};exports[_0x85eb('0x7a')]=function(_0x555236,_0x888c46,_0x3b327d){var _0xf076af={};var _0x16b378={};var _0x5dd40c;var _0x1d82a4;return db['VoicePrefix'][_0x85eb('0x7b')]({'where':{'id':_0x555236[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x888c46,null))['then'](function(_0x60e9b9){if(_0x60e9b9){_0x5dd40c=_0x60e9b9;_0x16b378[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['User'][_0x85eb('0x32')]);_0x16b378['query']=_[_0x85eb('0x4a')](_0x555236[_0x85eb('0x36')]);_0x16b378[_0x85eb('0x37')]=_['intersection'](_0x16b378['model'],_0x16b378['query']);_0xf076af[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x16b378[_0x85eb('0x39')],qs['fields'](_0x555236[_0x85eb('0x36')][_0x85eb('0x3b')]));_0xf076af[_0x85eb('0x3a')]=_0xf076af[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0xf076af['attributes']:_0x16b378['model'];_0xf076af[_0x85eb('0x7c')]=qs[_0x85eb('0x3d')](_0x555236['query'][_0x85eb('0x3d')]);_0xf076af[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x555236[_0x85eb('0x36')],_0x16b378[_0x85eb('0x37')]));if(_0x555236[_0x85eb('0x36')][_0x85eb('0x41')]){_0xf076af[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0xf076af[_0x85eb('0x3e')],{'$or':_[_0x85eb('0x30')](_0xf076af[_0x85eb('0x3a')],function(_0x171428){var _0x326b12={};_0x326b12[_0x171428]={'$like':'%'+_0x555236['query'][_0x85eb('0x41')]+'%'};return _0x326b12;})});}_0xf076af=_[_0x85eb('0x4b')]({},_0xf076af,_0x555236[_0x85eb('0x4c')]);return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x23191c){if(_0x23191c){_0x1d82a4=_0x23191c[_0x85eb('0x3c')];if(!_0x555236[_0x85eb('0x36')][_0x85eb('0x7d')](_0x85eb('0x7e'))){_0xf076af['limit']=qs[_0x85eb('0x22')](_0x555236[_0x85eb('0x36')][_0x85eb('0x22')]);_0xf076af[_0x85eb('0x20')]=qs['offset'](_0x555236[_0x85eb('0x36')][_0x85eb('0x20')]);}return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x362ba9){if(_0x362ba9){return _0x362ba9?{'count':_0x1d82a4,'rows':_0x362ba9}:null;}})[_0x85eb('0x27')](respondWithResult(_0x888c46,null))['catch'](handleError(_0x888c46,null));};exports[_0x85eb('0x7f')]=function(_0x36dbb1,_0x12c3be,_0x59fc6a){var _0x15802f={};var _0x278558={};var _0x2d0bfb;var _0x3b3b07;return db[_0x85eb('0x31')][_0x85eb('0x7b')]({'where':{'id':_0x36dbb1[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x12c3be,null))['then'](function(_0x44af01){if(_0x44af01){_0x2d0bfb=_0x44af01;_0x278558[_0x85eb('0x39')]=_['keys'](db['Team'][_0x85eb('0x32')]);_0x278558['query']=_[_0x85eb('0x4a')](_0x36dbb1[_0x85eb('0x36')]);_0x278558[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x278558['model'],_0x278558['query']);_0x15802f[_0x85eb('0x3a')]=_['intersection'](_0x278558[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x15802f['attributes']=_0x15802f['attributes'][_0x85eb('0x3c')]?_0x15802f[_0x85eb('0x3a')]:_0x278558[_0x85eb('0x39')];_0x15802f['order']=qs['sort'](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3d')]);_0x15802f[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x36dbb1[_0x85eb('0x36')],_0x278558[_0x85eb('0x37')]));if(_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]){_0x15802f[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0x15802f['where'],{'$or':_[_0x85eb('0x30')](_0x15802f[_0x85eb('0x3a')],function(_0x483f5f){var _0x1fe3b6={};_0x1fe3b6[_0x483f5f]={'$like':'%'+_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x1fe3b6;})});}_0x15802f=_[_0x85eb('0x4b')]({},_0x15802f,_0x36dbb1[_0x85eb('0x4c')]);return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})['then'](function(_0x4ba2d3){if(_0x4ba2d3){_0x3b3b07=_0x4ba2d3[_0x85eb('0x3c')];if(!_0x36dbb1['query'][_0x85eb('0x7d')]('nolimit')){_0x15802f[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x36dbb1['query']['limit']);_0x15802f[_0x85eb('0x20')]=qs[_0x85eb('0x20')](_0x36dbb1['query'][_0x85eb('0x20')]);}return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})[_0x85eb('0x27')](function(_0x48ed21){if(_0x48ed21){return _0x48ed21?{'count':_0x3b3b07,'rows':_0x48ed21}:null;}})['then'](respondWithResult(_0x12c3be,null))[_0x85eb('0x47')](handleError(_0x12c3be,null));};exports[_0x85eb('0x80')]=function(_0x189733,_0x422d33,_0x1d695c){var _0x4c865d=_0x189733[_0x85eb('0x51')][_0x85eb('0x74')];var _0x3b84b7;return db[_0x85eb('0x81')]['findAll']({'where':{'id':_0x4c865d},'attributes':['id'],'include':[{'model':db[_0x85eb('0x82')],'as':'Agents','attributes':['id',_0x85eb('0x2e'),_0x85eb('0x83'),_0x85eb('0x84'),_0x85eb('0x85')],'raw':!![]}]})[_0x85eb('0x27')](function(_0x52e2b9){if(_0x52e2b9){_0x3b84b7=_0x52e2b9;var _0x34c380=_[_0x85eb('0x86')](_0x52e2b9,function(_0x3bf9b4){var _0x4d3be5=_0x3bf9b4[_0x85eb('0x29')]({'plain':!![]});return _0x4d3be5[_0x85eb('0x87')];});return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x189733[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](function(_0x209800){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x344711){return _0x209800[_0x85eb('0x80')](_0x4c865d,{'transaction':_0x344711})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x3b84b7,function(_0xfe9f80){return db[_0x85eb('0x89')][_0x85eb('0x8a')]({'TeamId':_0xfe9f80['id'],'VoicePrefixId':_0x189733['params']['id']},{'transaction':_0x344711});});})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x34c380,function(_0x1c13a9){return db[_0x85eb('0x8b')][_0x85eb('0x8c')]({'where':{'UserId':_0x1c13a9['id'],'VoicePrefixId':_0x189733[_0x85eb('0x49')]['id']},'transaction':_0x344711});});})[_0x85eb('0x27')](function(){_0x34c380['forEach'](function(_0x419f52){socket[_0x85eb('0x75')]('userVoicePrefix:save',{'UserId':_0x419f52['id'],'VoicePrefixId':_0x209800['id']});});});});});}})[_0x85eb('0x27')](respondWithStatusCode(_0x422d33,null))['catch'](handleError(_0x422d33,null));};exports[_0x85eb('0x8d')]=function(_0x29a5bd,_0x933d13,_0x41dcd3){return db[_0x85eb('0x81')][_0x85eb('0x45')]({'where':{'id':_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x85eb('0x27')](handleEntityNotFound(_0x933d13,null))[_0x85eb('0x27')](function(_0x29df56){var _0x1b9d2f=_['map'](_0x29df56,'id');var _0x44de5f=[];var _0x2e2af5=[];var _0x3d2e7d=squel['select']();_0x3d2e7d[_0x85eb('0x8e')](_0x85eb('0x8f'))[_0x85eb('0x90')]('team_has_voice_prefixes','tq')[_0x85eb('0x91')](_0x85eb('0x92'),'ut',_0x85eb('0x93'))['where'](_0x85eb('0x94'),_0x29a5bd[_0x85eb('0x49')]['id']);for(var _0x404fef=0x0;_0x404fef<_0x29df56[_0x85eb('0x3c')];_0x404fef+=0x1){let _0x537ce5=_0x29df56[_0x404fef];for(var _0x1a2426=0x0;_0x1a2426<_0x537ce5[_0x85eb('0x87')][_0x85eb('0x3c')];_0x1a2426+=0x1){let _0x142a76=_0x537ce5['Agents'][_0x1a2426];var _0x3b4c70=_0x3d2e7d[_0x85eb('0x95')]();_0x3b4c70[_0x85eb('0x3e')](_0x85eb('0x96'),_0x142a76['id']);_0x2e2af5[_0x85eb('0x67')](db[_0x85eb('0x70')]['query'](_0x3b4c70['toString'](),{'type':db[_0x85eb('0x70')][_0x85eb('0x97')][_0x85eb('0x98')]})[_0x85eb('0x27')](function(_0x34e916){if(_0x34e916[_0x85eb('0x3c')]===0x1){return _0x142a76['id'];}else{var _0x37973e=_['every'](_[_0x85eb('0x30')](_0x34e916,_0x85eb('0x99')),function(_0x5af162){return _[_0x85eb('0x9a')](_0x1b9d2f,_0x5af162);});if(_0x37973e){return _0x142a76['id'];}}}));}}return BPromise[_0x85eb('0x9b')](_0x2e2af5)[_0x85eb('0x27')](function(_0x24726f){_0x44de5f=_(_0x44de5f)[_0x85eb('0x9c')](_0x24726f)[_0x85eb('0x9d')]()[_0x85eb('0x9e')]();return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x29a5bd['params']['id']}})['then'](function(_0x5ac026){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x27fd58){return _0x5ac026[_0x85eb('0x8d')](_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')],{'transaction':_0x27fd58})[_0x85eb('0x27')](function(){if(!_[_0x85eb('0x9f')](_0x44de5f)){return _0x5ac026[_0x85eb('0x77')](_0x44de5f,{'transaction':_0x27fd58});}})[_0x85eb('0x27')](function(){_0x44de5f['forEach'](function(_0xc37e2){socket[_0x85eb('0x75')](_0x85eb('0x79'),{'UserId':_0xc37e2,'VoicePrefixId':_0x5ac026['id']});});});});});});})[_0x85eb('0x27')](respondWithStatusCode(_0x933d13,null))[_0x85eb('0x47')](handleError(_0x933d13,null));}; \ No newline at end of file +var _0x9582=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','VoicePrefix','include','rows','catch','show','params','keys','includeAll','find','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','Team','addTeams','findAll','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4da06c,_0xf5d333){var _0x18daaa=function(_0x5a20bc){while(--_0x5a20bc){_0x4da06c['push'](_0x4da06c['shift']());}};_0x18daaa(++_0xf5d333);}(_0x9582,0x95));var _0x2958=function(_0x20dd46,_0x5b0295){_0x20dd46=_0x20dd46-0x0;var _0x361233=_0x9582[_0x20dd46];return _0x361233;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];config[_0x2958('0x19')]=_[_0x2958('0x1a')](config[_0x2958('0x19')],{'host':_0x2958('0x1b'),'port':0x18eb});var socket=require(_0x2958('0x1c'))(new Redis(config[_0x2958('0x19')]));require('./voicePrefix.socket')[_0x2958('0x1d')](socket);function respondWithStatusCode(_0x2e12d4,_0x4f2a1b){_0x4f2a1b=_0x4f2a1b||0xcc;return function(_0x4c762e){if(_0x4c762e){return _0x2e12d4[_0x2958('0x1e')](_0x4f2a1b);}return _0x2e12d4[_0x2958('0x1f')](_0x4f2a1b)['end']();};}function respondWithResult(_0x3bef50,_0x544563){_0x544563=_0x544563||0xc8;return function(_0x5c3ac3){if(_0x5c3ac3){return _0x3bef50[_0x2958('0x1f')](_0x544563)[_0x2958('0x20')](_0x5c3ac3);}};}function respondWithFilteredResult(_0x55e261,_0x54ef76){return function(_0x28a92c){if(_0x28a92c){var _0x160949=typeof _0x54ef76[_0x2958('0x21')]===_0x2958('0x22')&&typeof _0x54ef76[_0x2958('0x23')]==='undefined';var _0x19a614=_0x28a92c[_0x2958('0x24')];var _0x1a12fa=_0x160949?0x0:_0x54ef76['offset'];var _0x1e77eb=_0x160949?_0x28a92c['count']:_0x54ef76[_0x2958('0x21')]+_0x54ef76['limit'];var _0x5eaf36;if(_0x1e77eb>=_0x19a614){_0x1e77eb=_0x19a614;_0x5eaf36=0xc8;}else{_0x5eaf36=0xce;}_0x55e261[_0x2958('0x1f')](_0x5eaf36);return _0x55e261[_0x2958('0x25')](_0x2958('0x26'),_0x1a12fa+'-'+_0x1e77eb+'/'+_0x19a614)[_0x2958('0x20')](_0x28a92c);}return null;};}function patchUpdates(_0x2202f8){return function(_0x412e42){try{jsonpatch[_0x2958('0x27')](_0x412e42,_0x2202f8,!![]);}catch(_0x2b9818){return BPromise[_0x2958('0x28')](_0x2b9818);}return _0x412e42[_0x2958('0x29')]();};}function saveUpdates(_0xaf5547,_0xd58ae1){return function(_0x119242){if(_0x119242){return _0x119242[_0x2958('0x2a')](_0xaf5547)[_0x2958('0x2b')](function(_0x4f811a){return _0x4f811a;});}return null;};}function removeEntity(_0x574df5,_0x3c1155){return function(_0x33c5b0){if(_0x33c5b0){return _0x33c5b0[_0x2958('0x2c')]()[_0x2958('0x2b')](function(){var _0x52bd32=_0x33c5b0[_0x2958('0x2d')]({'plain':!![]});var _0x57ae96=_0x2958('0x2e');return db[_0x2958('0x2f')][_0x2958('0x2c')]({'where':{'type':_0x57ae96,'resourceId':_0x52bd32['id']}})[_0x2958('0x2b')](function(){return _0x33c5b0;});})[_0x2958('0x2b')](function(){_0x574df5[_0x2958('0x1f')](0xcc)[_0x2958('0x30')]();});}};}function handleEntityNotFound(_0x5d1dfc,_0x21b919){return function(_0x5053d0){if(!_0x5053d0){_0x5d1dfc['sendStatus'](0x194);}return _0x5053d0;};}function handleError(_0x28ee09,_0x15bab3){_0x15bab3=_0x15bab3||0x1f4;return function(_0x973486){logger[_0x2958('0x31')](_0x973486[_0x2958('0x32')]);if(_0x973486[_0x2958('0x33')]){delete _0x973486[_0x2958('0x33')];}_0x28ee09[_0x2958('0x1f')](_0x15bab3)['send'](_0x973486);};}exports[_0x2958('0x34')]=function(_0x32e366,_0x5f34d4){var _0x430484={},_0x5ed343={},_0x380e1d={'count':0x0,'rows':[]};var _0x56d9fd=_[_0x2958('0x35')](db['VoicePrefix'][_0x2958('0x36')],function(_0x2e2a0b){return{'name':_0x2e2a0b[_0x2958('0x37')],'type':_0x2e2a0b[_0x2958('0x38')][_0x2958('0x39')]};});_0x5ed343[_0x2958('0x3a')]=_[_0x2958('0x35')](_0x56d9fd,_0x2958('0x33'));_0x5ed343[_0x2958('0x3b')]=_['keys'](_0x32e366[_0x2958('0x3b')]);_0x5ed343['filters']=_[_0x2958('0x3c')](_0x5ed343['model'],_0x5ed343[_0x2958('0x3b')]);_0x430484[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x5ed343[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0x32e366[_0x2958('0x3b')][_0x2958('0x3e')]));_0x430484[_0x2958('0x3d')]=_0x430484[_0x2958('0x3d')][_0x2958('0x3f')]?_0x430484[_0x2958('0x3d')]:_0x5ed343[_0x2958('0x3a')];if(!_0x32e366[_0x2958('0x3b')]['hasOwnProperty'](_0x2958('0x40'))){_0x430484[_0x2958('0x23')]=qs[_0x2958('0x23')](_0x32e366[_0x2958('0x3b')]['limit']);_0x430484[_0x2958('0x21')]=qs[_0x2958('0x21')](_0x32e366[_0x2958('0x3b')][_0x2958('0x21')]);}_0x430484[_0x2958('0x41')]=qs[_0x2958('0x42')](_0x32e366[_0x2958('0x3b')][_0x2958('0x42')]);_0x430484[_0x2958('0x43')]=qs[_0x2958('0x44')](_[_0x2958('0x45')](_0x32e366[_0x2958('0x3b')],_0x5ed343[_0x2958('0x44')]),_0x56d9fd);if(_0x32e366['query'][_0x2958('0x46')]){_0x430484[_0x2958('0x43')]=_['merge'](_0x430484['where'],{'$or':_[_0x2958('0x35')](_0x56d9fd,function(_0x265055){if(_0x265055[_0x2958('0x38')]!==_0x2958('0x47')){var _0x3ec87a={};_0x3ec87a[_0x265055[_0x2958('0x33')]]={'$like':'%'+_0x32e366[_0x2958('0x3b')][_0x2958('0x46')]+'%'};return _0x3ec87a;}})});}_0x430484=_[_0x2958('0x48')]({},_0x430484,_0x32e366[_0x2958('0x49')]);var _0x16aae8={'where':_0x430484[_0x2958('0x43')]};return db[_0x2958('0x4a')]['count'](_0x16aae8)[_0x2958('0x2b')](function(_0x112256){_0x380e1d[_0x2958('0x24')]=_0x112256;if(_0x32e366[_0x2958('0x3b')]['includeAll']){_0x430484[_0x2958('0x4b')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x430484);})[_0x2958('0x2b')](function(_0x35993f){_0x380e1d[_0x2958('0x4c')]=_0x35993f;return _0x380e1d;})[_0x2958('0x2b')](respondWithFilteredResult(_0x5f34d4,_0x430484))[_0x2958('0x4d')](handleError(_0x5f34d4,null));};exports[_0x2958('0x4e')]=function(_0x52d40e,_0x17e8d6){var _0x4fb27a={'raw':![],'where':{'id':_0x52d40e[_0x2958('0x4f')]['id']}},_0x488f49={};_0x488f49['model']=_[_0x2958('0x50')](db[_0x2958('0x4a')][_0x2958('0x36')]);_0x488f49[_0x2958('0x3b')]=_[_0x2958('0x50')](_0x52d40e[_0x2958('0x3b')]);_0x488f49[_0x2958('0x44')]=_[_0x2958('0x3c')](_0x488f49['model'],_0x488f49[_0x2958('0x3b')]);_0x4fb27a[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x488f49[_0x2958('0x3a')],qs['fields'](_0x52d40e[_0x2958('0x3b')][_0x2958('0x3e')]));_0x4fb27a['attributes']=_0x4fb27a[_0x2958('0x3d')][_0x2958('0x3f')]?_0x4fb27a[_0x2958('0x3d')]:_0x488f49[_0x2958('0x3a')];if(_0x52d40e[_0x2958('0x3b')][_0x2958('0x51')]){_0x4fb27a['include']=[{'all':!![]}];}_0x4fb27a=_[_0x2958('0x48')]({},_0x4fb27a,_0x52d40e[_0x2958('0x49')]);return db[_0x2958('0x4a')][_0x2958('0x52')](_0x4fb27a)[_0x2958('0x2b')](handleEntityNotFound(_0x17e8d6,null))[_0x2958('0x2b')](respondWithResult(_0x17e8d6,null))[_0x2958('0x4d')](handleError(_0x17e8d6,null));};exports[_0x2958('0x2c')]=function(_0x2e0fc7,_0x329652){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x2e0fc7[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x329652,null))[_0x2958('0x2b')](removeEntity(_0x329652,null))[_0x2958('0x4d')](handleError(_0x329652,null));};exports[_0x2958('0x53')]=function(_0x4889b6,_0xa1073b){return db['VoicePrefix'][_0x2958('0x53')]()[_0x2958('0x2b')](respondWithResult(_0xa1073b,null))[_0x2958('0x4d')](handleError(_0xa1073b,null));};exports['create']=function(_0x497a30,_0x39cc25){var _0x394c29;return db[_0x2958('0x54')]['transaction'](function(_0x524562){return db[_0x2958('0x4a')][_0x2958('0x55')](_0x497a30[_0x2958('0x56')],{'transaction':_0x524562})[_0x2958('0x2b')](function(_0x4347c0){_0x394c29=_0x4347c0[_0x2958('0x2d')]({'plain':!![]});return db[_0x2958('0x57')][_0x2958('0x52')]({'where':{'id':_0x394c29[_0x2958('0x58')]},'raw':!![]})['then'](function(_0x30c739){return createVoicePrefixExtensions(_0x394c29,_0x30c739,_0x524562);});});})[_0x2958('0x2b')](function(){var _0x5671d1=_0x497a30[_0x2958('0x59')][_0x2958('0x2d')]({'plain':!![]});if(!_0x5671d1)throw new Error(_0x2958('0x5a'));if(_0x5671d1[_0x2958('0x5b')]===_0x2958('0x59')){var _0x16d927=_0x394c29;return db['UserProfileSection'][_0x2958('0x52')]({'where':{'name':_0x2958('0x2e'),'userProfileId':_0x5671d1[_0x2958('0x5c')]},'raw':!![]})['then'](function(_0x595738){if(_0x595738&&_0x595738[_0x2958('0x5d')]===0x0){return db['UserProfileResource'][_0x2958('0x55')]({'name':_0x16d927['name'],'resourceId':_0x16d927['id'],'type':_0x595738[_0x2958('0x33')],'sectionId':_0x595738['id']},{})[_0x2958('0x2b')](function(){return _0x394c29;});}else{return _0x394c29;}})[_0x2958('0x4d')](function(_0x474f6b){logger[_0x2958('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x474f6b);throw _0x474f6b;});}return _0x394c29;})['then'](respondWithResult(_0x39cc25,null))[_0x2958('0x4d')](handleError(_0x39cc25,null));};function Extension(_0x3e11eb,_0xfa171d,_0x51bf4c,_0x55676f){this[_0x2958('0x5e')]=_0x2958('0x5f');this[_0x2958('0x60')]=_0x3e11eb;this[_0x2958('0x61')]=_0x51bf4c;this[_0x2958('0x38')]=_0x2958('0x62');this[_0x2958('0x63')]=_0x2958('0x64');this[_0x2958('0x65')]=_0xfa171d;this[_0x2958('0x66')]=_0x55676f;}function createVoicePrefixExtensions(_0x2de03a,_0x2bef16,_0x3cc345){return new BPromise(function(_0x49d190,_0x3a4ad9){var _0x8c7203=new Extension(formatPrefixName(_0x2de03a[_0x2958('0x67')]),0x1,_0x2958('0x68'),_0x2958('0x69'));_0x8c7203[_0x2958('0x6a')]=_0x2de03a['id'];return db[_0x2958('0x57')][_0x2958('0x55')](_0x8c7203,{'transaction':_0x3cc345})[_0x2958('0x2b')](function(_0x4dd3de){var _0x2269e1=_0x4dd3de['get']({'plain':!![]});var _0x196901=_[_0x2958('0x35')](addVoicePrefixExtensions(_0x2de03a,_0x2bef16),function(_0x31a596){_0x31a596['VoiceExtensionId']=_0x2269e1['id'];_0x31a596['VoicePrefixId']=_0x2de03a['id'];return _0x31a596;});return db['VoiceExtension'][_0x2958('0x6b')](_0x196901,{'transaction':_0x3cc345})[_0x2958('0x2b')](function(_0x4c1516){if(!_0x4c1516){return _0x3a4ad9(_0x2958('0x6c'));}else{return _0x49d190(_0x4c1516);}})[_0x2958('0x4d')](function(_0xb2fe28){return _0x3a4ad9(_0xb2fe28);});});;});};function addVoicePrefixExtensions(_0x32a216,_0x13f850){var _0x538298=[];var _0x55da00=formatPrefixName(_0x32a216[_0x2958('0x67')]);_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x2,_0x2958('0x6e'),_0x2958('0x6f')+_0x32a216['name']));if(_0x32a216[_0x2958('0x70')]){_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x3,_0x2958('0x6e'),_0x2958('0x71')+_0x32a216['callerIdAll']));}else{_0x538298['push'](new Extension(_0x55da00,0x3,'NoOp','No\x20callerid\x20available'));}_0x538298[_0x2958('0x6d')](new Extension(_0x55da00,0x4,_0x2958('0x72'),_0x13f850['context']+','+_0x2958('0x73')+(0x8+_0x32a216[_0x2958('0x33')][_0x2958('0x3f')])+'}'+','+0x1));return _0x538298;}function formatPrefixName(_0x234d7f){var _0x1eefb5='_';for(var _0x41ab26=0x0;_0x41ab26<_0x234d7f['length'];_0x41ab26++){if(_0x234d7f[_0x2958('0x74')](_0x41ab26)=='-'){_0x1eefb5+=_0x234d7f[_0x2958('0x74')](_0x41ab26);}else{_0x1eefb5+='['+_0x234d7f[_0x2958('0x74')](_0x41ab26)+']';}}_0x1eefb5+='.';return _0x1eefb5;}exports['update']=function(_0xd61e21,_0x566123,_0x546721){var _0x584429=_0xd61e21['body'];_0x584429[_0x2958('0x67')]='system-'+_0x584429[_0x2958('0x33')]+'-';return db[_0x2958('0x54')][_0x2958('0x75')](function(_0x41ead9){return db[_0x2958('0x4a')][_0x2958('0x2a')](_0x584429,{'where':{'id':_0x584429['id']},'transaction':_0x41ead9})['then'](function(){return db[_0x2958('0x57')][_0x2958('0x2c')]({'where':{'VoicePrefixId':_0x584429['id']},'transaction':_0x41ead9})[_0x2958('0x2b')](function(){return db[_0x2958('0x57')][_0x2958('0x52')]({'where':{'id':_0x584429[_0x2958('0x58')]},'raw':!![]})[_0x2958('0x2b')](function(_0x3674b3){return createVoicePrefixExtensions(_0x584429,_0x3674b3,_0x41ead9);});});});})[_0x2958('0x2b')](function(){return db[_0x2958('0x4a')][_0x2958('0x76')](_0x584429['id']);})[_0x2958('0x2b')](respondWithResult(_0x566123,null))[_0x2958('0x4d')](handleError(_0x566123,null));};exports[_0x2958('0x77')]=function(_0x1a2cf2,_0x2136fe,_0x19b819){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x1a2cf2[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x2136fe,null))['then'](function(_0x831f42){if(_0x831f42){return _0x831f42[_0x2958('0x77')](_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')],_[_0x2958('0x79')](_0x1a2cf2['body'],[_0x2958('0x78'),'id'])||{})[_0x2958('0x7a')](function(_0x214b51){for(var _0x1a9f51=0x0;_0x1a9f51<_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')][_0x2958('0x3f')];_0x1a9f51+=0x1){socket[_0x2958('0x7b')](_0x2958('0x7c'),{'UserId':Number(_0x1a2cf2[_0x2958('0x56')][_0x2958('0x78')][_0x1a9f51]),'VoicePrefixId':Number(_0x1a2cf2[_0x2958('0x4f')]['id'])});}return _0x214b51;});}})[_0x2958('0x2b')](respondWithResult(_0x2136fe,null))[_0x2958('0x4d')](handleError(_0x2136fe,null));};exports[_0x2958('0x7d')]=function(_0x33e4b5,_0x3c7a19,_0x80a4db){return db[_0x2958('0x4a')][_0x2958('0x52')]({'where':{'id':_0x33e4b5[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x3c7a19,null))[_0x2958('0x2b')](function(_0x2a3c34){if(_0x2a3c34){return _0x2a3c34['removeAgents'](_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')])[_0x2958('0x2b')](function(){if(_[_0x2958('0x7e')](_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')])){for(var _0x1d0bfd=0x0;_0x1d0bfd<_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')][_0x2958('0x3f')];_0x1d0bfd+=0x1){socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':Number(_0x33e4b5['query'][_0x2958('0x78')][_0x1d0bfd]),'VoicePrefixId':Number(_0x33e4b5[_0x2958('0x4f')]['id'])});}}else{socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':Number(_0x33e4b5[_0x2958('0x3b')][_0x2958('0x78')]),'VoicePrefixId':Number(_0x33e4b5['params']['id'])});}});}})[_0x2958('0x2b')](respondWithStatusCode(_0x3c7a19,null))[_0x2958('0x4d')](handleError(_0x3c7a19,null));};exports[_0x2958('0x80')]=function(_0xe483b9,_0x2b7e0e,_0x558b10){var _0x158c43={};var _0x5be9e={};var _0x2f3f81;var _0x171717;return db[_0x2958('0x4a')][_0x2958('0x81')]({'where':{'id':_0xe483b9[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x2b7e0e,null))[_0x2958('0x2b')](function(_0x4739b0){if(_0x4739b0){_0x2f3f81=_0x4739b0;_0x5be9e[_0x2958('0x3a')]=_['keys'](db[_0x2958('0x82')][_0x2958('0x36')]);_0x5be9e['query']=_['keys'](_0xe483b9[_0x2958('0x3b')]);_0x5be9e[_0x2958('0x44')]=_['intersection'](_0x5be9e[_0x2958('0x3a')],_0x5be9e[_0x2958('0x3b')]);_0x158c43[_0x2958('0x3d')]=_['intersection'](_0x5be9e[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0xe483b9[_0x2958('0x3b')][_0x2958('0x3e')]));_0x158c43[_0x2958('0x3d')]=_0x158c43[_0x2958('0x3d')]['length']?_0x158c43[_0x2958('0x3d')]:_0x5be9e[_0x2958('0x3a')];_0x158c43[_0x2958('0x41')]=qs[_0x2958('0x42')](_0xe483b9['query']['sort']);_0x158c43['where']=qs[_0x2958('0x44')](_['pick'](_0xe483b9[_0x2958('0x3b')],_0x5be9e['filters']));if(_0xe483b9['query'][_0x2958('0x46')]){_0x158c43[_0x2958('0x43')]=_['merge'](_0x158c43[_0x2958('0x43')],{'$or':_[_0x2958('0x35')](_0x158c43[_0x2958('0x3d')],function(_0x2aa634){var _0x37b94a={};_0x37b94a[_0x2aa634]={'$like':'%'+_0xe483b9['query'][_0x2958('0x46')]+'%'};return _0x37b94a;})});}_0x158c43=_[_0x2958('0x48')]({},_0x158c43,_0xe483b9[_0x2958('0x49')]);return _0x2f3f81[_0x2958('0x80')](_0x158c43);}})[_0x2958('0x2b')](function(_0x17b2bf){if(_0x17b2bf){_0x171717=_0x17b2bf[_0x2958('0x3f')];if(!_0xe483b9[_0x2958('0x3b')][_0x2958('0x83')]('nolimit')){_0x158c43[_0x2958('0x23')]=qs[_0x2958('0x23')](_0xe483b9[_0x2958('0x3b')]['limit']);_0x158c43[_0x2958('0x21')]=qs[_0x2958('0x21')](_0xe483b9[_0x2958('0x3b')][_0x2958('0x21')]);}return _0x2f3f81[_0x2958('0x80')](_0x158c43);}})[_0x2958('0x2b')](function(_0xb41929){if(_0xb41929){return _0xb41929?{'count':_0x171717,'rows':_0xb41929}:null;}})[_0x2958('0x2b')](respondWithResult(_0x2b7e0e,null))[_0x2958('0x4d')](handleError(_0x2b7e0e,null));};exports[_0x2958('0x84')]=function(_0x57db70,_0x3077ef,_0x5d9ad0){var _0x57ae87={};var _0x2f279a={};var _0x445e57;var _0x561ecc;return db['VoicePrefix']['findOne']({'where':{'id':_0x57db70[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](handleEntityNotFound(_0x3077ef,null))['then'](function(_0x3876cb){if(_0x3876cb){_0x445e57=_0x3876cb;_0x2f279a[_0x2958('0x3a')]=_[_0x2958('0x50')](db[_0x2958('0x85')][_0x2958('0x36')]);_0x2f279a[_0x2958('0x3b')]=_[_0x2958('0x50')](_0x57db70['query']);_0x2f279a[_0x2958('0x44')]=_[_0x2958('0x3c')](_0x2f279a[_0x2958('0x3a')],_0x2f279a[_0x2958('0x3b')]);_0x57ae87[_0x2958('0x3d')]=_[_0x2958('0x3c')](_0x2f279a[_0x2958('0x3a')],qs[_0x2958('0x3e')](_0x57db70[_0x2958('0x3b')][_0x2958('0x3e')]));_0x57ae87['attributes']=_0x57ae87['attributes'][_0x2958('0x3f')]?_0x57ae87['attributes']:_0x2f279a[_0x2958('0x3a')];_0x57ae87[_0x2958('0x41')]=qs[_0x2958('0x42')](_0x57db70[_0x2958('0x3b')][_0x2958('0x42')]);_0x57ae87[_0x2958('0x43')]=qs[_0x2958('0x44')](_['pick'](_0x57db70[_0x2958('0x3b')],_0x2f279a[_0x2958('0x44')]));if(_0x57db70[_0x2958('0x3b')][_0x2958('0x46')]){_0x57ae87[_0x2958('0x43')]=_['merge'](_0x57ae87[_0x2958('0x43')],{'$or':_[_0x2958('0x35')](_0x57ae87[_0x2958('0x3d')],function(_0x533243){var _0x12ffd1={};_0x12ffd1[_0x533243]={'$like':'%'+_0x57db70[_0x2958('0x3b')][_0x2958('0x46')]+'%'};return _0x12ffd1;})});}_0x57ae87=_[_0x2958('0x48')]({},_0x57ae87,_0x57db70[_0x2958('0x49')]);return _0x445e57[_0x2958('0x84')](_0x57ae87);}})['then'](function(_0x5f4622){if(_0x5f4622){_0x561ecc=_0x5f4622[_0x2958('0x3f')];if(!_0x57db70[_0x2958('0x3b')][_0x2958('0x83')]('nolimit')){_0x57ae87[_0x2958('0x23')]=qs['limit'](_0x57db70[_0x2958('0x3b')][_0x2958('0x23')]);_0x57ae87[_0x2958('0x21')]=qs['offset'](_0x57db70[_0x2958('0x3b')][_0x2958('0x21')]);}return _0x445e57[_0x2958('0x84')](_0x57ae87);}})[_0x2958('0x2b')](function(_0x49bd35){if(_0x49bd35){return _0x49bd35?{'count':_0x561ecc,'rows':_0x49bd35}:null;}})['then'](respondWithResult(_0x3077ef,null))[_0x2958('0x4d')](handleError(_0x3077ef,null));};exports[_0x2958('0x86')]=function(_0x118318,_0x39d235,_0x3eeedf){var _0x498e07=_0x118318[_0x2958('0x56')][_0x2958('0x78')];var _0x1437a7;return db[_0x2958('0x85')][_0x2958('0x87')]({'where':{'id':_0x498e07},'attributes':['id'],'include':[{'model':db[_0x2958('0x82')],'as':_0x2958('0x88'),'attributes':['id',_0x2958('0x33'),'online','voicePause','interface'],'raw':!![]}]})[_0x2958('0x2b')](function(_0x45fcc5){if(_0x45fcc5){_0x1437a7=_0x45fcc5;var _0x3d4314=_['flatMap'](_0x45fcc5,function(_0x413447){var _0x42c8b0=_0x413447[_0x2958('0x2d')]({'plain':!![]});return _0x42c8b0['Agents'];});return db['VoicePrefix']['find']({'where':{'id':_0x118318[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](function(_0x36c52a){return db[_0x2958('0x54')][_0x2958('0x75')](function(_0x43b9ec){return _0x36c52a['addTeams'](_0x498e07,{'transaction':_0x43b9ec})[_0x2958('0x2b')](function(){return BPromise[_0x2958('0x89')](_0x1437a7,function(_0x9b8367){return db[_0x2958('0x8a')][_0x2958('0x8b')]({'TeamId':_0x9b8367['id'],'VoicePrefixId':_0x118318[_0x2958('0x4f')]['id']},{'transaction':_0x43b9ec});});})['then'](function(){return BPromise['each'](_0x3d4314,function(_0x38a789){return db[_0x2958('0x8c')][_0x2958('0x8d')]({'where':{'UserId':_0x38a789['id'],'VoicePrefixId':_0x118318[_0x2958('0x4f')]['id']},'transaction':_0x43b9ec});});})[_0x2958('0x2b')](function(){_0x3d4314[_0x2958('0x8e')](function(_0x1ec753){socket[_0x2958('0x7b')]('userVoicePrefix:save',{'UserId':_0x1ec753['id'],'VoicePrefixId':_0x36c52a['id']});});});});});}})[_0x2958('0x2b')](respondWithStatusCode(_0x39d235,null))[_0x2958('0x4d')](handleError(_0x39d235,null));};exports[_0x2958('0x8f')]=function(_0x6f44ca,_0x1ddda5,_0x2f5a39){return db[_0x2958('0x85')][_0x2958('0x87')]({'where':{'id':_0x6f44ca['query'][_0x2958('0x78')]},'attributes':['id'],'include':[{'model':db[_0x2958('0x82')],'as':_0x2958('0x88'),'attributes':['id'],'raw':!![]}]})[_0x2958('0x2b')](handleEntityNotFound(_0x1ddda5,null))[_0x2958('0x2b')](function(_0x1c926e){var _0x245a12=_['map'](_0x1c926e,'id');var _0x270846=[];var _0x1d0d0d=[];var _0xc3b770=squel[_0x2958('0x90')]();_0xc3b770[_0x2958('0x91')]('tq.TeamId')['from']('team_has_voice_prefixes','tq')[_0x2958('0x92')]('user_has_teams','ut',_0x2958('0x93'))[_0x2958('0x43')](_0x2958('0x94'),_0x6f44ca['params']['id']);for(var _0x56c6a3=0x0;_0x56c6a3<_0x1c926e[_0x2958('0x3f')];_0x56c6a3+=0x1){let _0x1fd536=_0x1c926e[_0x56c6a3];for(var _0x3fbe11=0x0;_0x3fbe11<_0x1fd536[_0x2958('0x88')][_0x2958('0x3f')];_0x3fbe11+=0x1){let _0x21c020=_0x1fd536[_0x2958('0x88')][_0x3fbe11];var _0x89b78c=_0xc3b770[_0x2958('0x95')]();_0x89b78c[_0x2958('0x43')](_0x2958('0x96'),_0x21c020['id']);_0x1d0d0d[_0x2958('0x6d')](db[_0x2958('0x54')][_0x2958('0x3b')](_0x89b78c[_0x2958('0x97')](),{'type':db[_0x2958('0x54')][_0x2958('0x98')][_0x2958('0x99')]})[_0x2958('0x2b')](function(_0x729aaf){if(_0x729aaf[_0x2958('0x3f')]===0x1){return _0x21c020['id'];}else{var _0x362837=_['every'](_[_0x2958('0x35')](_0x729aaf,_0x2958('0x9a')),function(_0x33af4f){return _[_0x2958('0x9b')](_0x245a12,_0x33af4f);});if(_0x362837){return _0x21c020['id'];}}}));}}return BPromise['all'](_0x1d0d0d)[_0x2958('0x2b')](function(_0x119ff3){_0x270846=_(_0x270846)['union'](_0x119ff3)['compact']()['value']();return db[_0x2958('0x4a')]['find']({'where':{'id':_0x6f44ca[_0x2958('0x4f')]['id']}})[_0x2958('0x2b')](function(_0x26c52f){return db['sequelize'][_0x2958('0x75')](function(_0x2355a0){return _0x26c52f[_0x2958('0x8f')](_0x6f44ca[_0x2958('0x3b')][_0x2958('0x78')],{'transaction':_0x2355a0})[_0x2958('0x2b')](function(){if(!_[_0x2958('0x9c')](_0x270846)){return _0x26c52f[_0x2958('0x7d')](_0x270846,{'transaction':_0x2355a0});}})['then'](function(){_0x270846['forEach'](function(_0x1c5d40){socket[_0x2958('0x7b')](_0x2958('0x7f'),{'UserId':_0x1c5d40,'VoicePrefixId':_0x26c52f['id']});});});});});});})[_0x2958('0x2b')](respondWithStatusCode(_0x1ddda5,null))[_0x2958('0x4d')](handleError(_0x1ddda5,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5139937..e1c3be6 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 _0xc0c0=['save','update','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x201806,_0x5f0cbc){var _0x19e491=function(_0x1f29aa){while(--_0x1f29aa){_0x201806['push'](_0x201806['shift']());}};_0x19e491(++_0x5f0cbc);}(_0xc0c0,0xd5));var _0x0c0c=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xc0c0[_0xda464c];return _0x19e222;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x0c0c('0x0'))['db'][_0x0c0c('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0c0c('0x2')](0x0);var events={'afterCreate':_0x0c0c('0x3'),'afterUpdate':_0x0c0c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e78e1){return function(_0x310fbc,_0x1fc96e,_0x3e6166){VoicePrefixEvents['emit'](_0x2e78e1+':'+_0x310fbc['id'],_0x310fbc);VoicePrefixEvents[_0x0c0c('0x5')](_0x2e78e1,_0x310fbc);_0x3e6166(null);};}for(var e in events){if(events[_0x0c0c('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x0c0c('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xd4dd=['exports','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0xa95335,_0x4624d6){var _0x40c0e4=function(_0xfb6d27){while(--_0xfb6d27){_0xa95335['push'](_0xa95335['shift']());}};_0x40c0e4(++_0x4624d6);}(_0xd4dd,0x1b9));var _0xdd4d=function(_0x12eb9d,_0x5ef700){_0x12eb9d=_0x12eb9d-0x0;var _0xa03912=_0xd4dd[_0x12eb9d];return _0xa03912;};'use strict';var EventEmitter=require(_0xdd4d('0x0'));var VoicePrefix=require(_0xdd4d('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdd4d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd4d('0x3')};function emitEvent(_0x3cf296){return function(_0xabbe29,_0x42f68d,_0x453d42){VoicePrefixEvents[_0xdd4d('0x4')](_0x3cf296+':'+_0xabbe29['id'],_0xabbe29);VoicePrefixEvents[_0xdd4d('0x4')](_0x3cf296,_0xabbe29);_0x453d42(null);};}for(var e in events){if(events[_0xdd4d('0x5')](e)){var event=events[e];VoicePrefix[_0xdd4d('0x6')](e,emitEvent(event));}}module[_0xdd4d('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ab0a01d..78e29ba 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 _0x964d=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21cab2,_0x4a80db){var _0x4c0c5b=function(_0x4f53b3){while(--_0x4f53b3){_0x21cab2['push'](_0x21cab2['shift']());}};_0x4c0c5b(++_0x4a80db);}(_0x964d,0xc4));var _0xd964=function(_0x44170a,_0x4d78bb){_0x44170a=_0x44170a-0x0;var _0x2a45e6=_0x964d[_0x44170a];return _0x2a45e6;};'use strict';var _=require(_0xd964('0x0'));var util=require(_0xd964('0x1'));var logger=require(_0xd964('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd964('0x3'));var rp=require(_0xd964('0x4'));var fs=require('fs');var path=require(_0xd964('0x5'));var rimraf=require(_0xd964('0x6'));var config=require(_0xd964('0x7'));var attributes=require(_0xd964('0x8'));module[_0xd964('0x9')]=function(_0x7d5405,_0x1fc8e9){return _0x7d5405[_0xd964('0xa')](_0xd964('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9926=['util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoicePrefix','lodash'];(function(_0x1d017b,_0x1258f6){var _0x4f4246=function(_0x42c97c){while(--_0x42c97c){_0x1d017b['push'](_0x1d017b['shift']());}};_0x4f4246(++_0x1258f6);}(_0x9926,0xe6));var _0x6992=function(_0x4fb867,_0x348fed){_0x4fb867=_0x4fb867-0x0;var _0x93bdc=_0x9926[_0x4fb867];return _0x93bdc;};'use strict';var _=require(_0x6992('0x0'));var util=require(_0x6992('0x1'));var logger=require('../../config/logger')(_0x6992('0x2'));var moment=require(_0x6992('0x3'));var BPromise=require('bluebird');var rp=require(_0x6992('0x4'));var fs=require('fs');var path=require(_0x6992('0x5'));var rimraf=require(_0x6992('0x6'));var config=require(_0x6992('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x6992('0x8')]=function(_0x484643,_0x1af416){return _0x484643[_0x6992('0x9')](_0x6992('0xa'),attributes,{'tableName':'voice_prefixes','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 deb5571..8905bb5 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 _0x13c5=['request\x20sent','result','lodash','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','info','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message'];(function(_0x778481,_0x77d102){var _0x11713e=function(_0x3ae3b7){while(--_0x3ae3b7){_0x778481['push'](_0x778481['shift']());}};_0x11713e(++_0x77d102);}(_0x13c5,0x7a));var _0x513c=function(_0x482d79,_0x5b3b6f){_0x482d79=_0x482d79-0x0;var _0x5a7ef1=_0x13c5[_0x482d79];return _0x5a7ef1;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x513c('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x513c('0x2'));var jayson=require(_0x513c('0x3'));var client=jayson[_0x513c('0x4')][_0x513c('0x5')]({'port':0x232a});config['redis']=_['defaults'](config[_0x513c('0x6')],{'host':_0x513c('0x7'),'port':0x18eb});var socket=require(_0x513c('0x8'))(new Redis(config[_0x513c('0x6')]));require(_0x513c('0x9'))[_0x513c('0xa')](socket);function respondWithRpcPromise(_0x222c25,_0x18471d,_0x4adc04){return new BPromise(function(_0xd70448,_0x224eb2){return client['request'](_0x222c25,_0x4adc04)['then'](function(_0x798eed){logger[_0x513c('0xb')]('VoicePrefix,\x20%s,\x20%s',_0x18471d,'request\x20sent');logger['debug'](_0x513c('0xc'),_0x18471d,'request\x20sent',JSON[_0x513c('0xd')](_0x798eed));if(_0x798eed[_0x513c('0xe')]){if(_0x798eed['error'][_0x513c('0xf')]===0x1f4){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0x224eb2(_0x798eed['error'][_0x513c('0x11')]);}logger['error'](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0xd70448(_0x798eed[_0x513c('0xe')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x18471d,_0x513c('0x12'));_0xd70448(_0x798eed[_0x513c('0x13')]['message']);}})['catch'](function(_0x217e7a){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x217e7a);_0x224eb2(_0x217e7a);});});} \ No newline at end of file +var _0xc7bd=['redis','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x11c91f,_0x52862f){var _0x223e12=function(_0x40f0fe){while(--_0x40f0fe){_0x11c91f['push'](_0x11c91f['shift']());}};_0x223e12(++_0x52862f);}(_0xc7bd,0x86));var _0xdc7b=function(_0x516c23,_0x6ebaef){_0x516c23=_0x516c23-0x0;var _0x4d466d=_0xc7bd[_0x516c23];return _0x4d466d;};'use strict';var _=require('lodash');var util=require(_0xdc7b('0x0'));var moment=require(_0xdc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc7b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc7b('0x4'))(_0xdc7b('0x5'));var config=require(_0xdc7b('0x6'));var jayson=require(_0xdc7b('0x7'));var client=jayson[_0xdc7b('0x8')][_0xdc7b('0x9')]({'port':0x232a});config[_0xdc7b('0xa')]=_['defaults'](config[_0xdc7b('0xa')],{'host':_0xdc7b('0xb'),'port':0x18eb});var socket=require(_0xdc7b('0xc'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xdc7b('0xd')](socket);function respondWithRpcPromise(_0x316a19,_0x167e40,_0x295800){return new BPromise(function(_0xec8041,_0x44d499){return client['request'](_0x316a19,_0x295800)[_0xdc7b('0xe')](function(_0x359a53){logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));logger[_0xdc7b('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x167e40,_0xdc7b('0x11'),JSON[_0xdc7b('0x13')](_0x359a53));if(_0x359a53['error']){if(_0x359a53[_0xdc7b('0x14')]['code']===0x1f4){logger[_0xdc7b('0x14')](_0xdc7b('0x10'),_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0x44d499(_0x359a53['error'][_0xdc7b('0x15')]);}logger[_0xdc7b('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0xec8041(_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);}else{logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));_0xec8041(_0x359a53[_0xdc7b('0x16')]['message']);}})[_0xdc7b('0x17')](function(_0x54a99b){logger[_0xdc7b('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x167e40,_0x54a99b);_0x44d499(_0x54a99b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 88e9d77..fec4940 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 _0x83e1=['save','update','length','voicePrefix:','./voicePrefix.events'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x83e1,0x1ad));var _0x183e=function(_0x444a08,_0x1519bd){_0x444a08=_0x444a08-0x0;var _0x1c912a=_0x83e1[_0x444a08];return _0x1c912a;};'use strict';var VoicePrefixEvents=require(_0x183e('0x0'));var events=[_0x183e('0x1'),'remove',_0x183e('0x2')];function createListener(_0x5ee015,_0x2deafb){return function(_0x59d53f){_0x2deafb['emit'](_0x5ee015,_0x59d53f);};}function removeListener(_0x2e77a9,_0x22272f){return function(){VoicePrefixEvents['removeListener'](_0x2e77a9,_0x22272f);};}exports['register']=function(_0x4d7710){for(var _0x2e3bbd=0x0,_0xab00d2=events[_0x183e('0x3')];_0x2e3bbd<_0xab00d2;_0x2e3bbd++){var _0x4ee4bc=events[_0x2e3bbd];var _0x8e55be=createListener(_0x183e('0x4')+_0x4ee4bc,_0x4d7710);VoicePrefixEvents['on'](_0x4ee4bc,_0x8e55be);}}; \ No newline at end of file +var _0xbf82=['remove','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x2b75c0,_0x2255ce){_0x2b75c0=_0x2b75c0-0x0;var _0x26b27e=_0xbf82[_0x2b75c0];return _0x26b27e;};'use strict';var VoicePrefixEvents=require(_0x2bf8('0x0'));var events=['save',_0x2bf8('0x1'),'update'];function createListener(_0x3d3645,_0x4289fc){return function(_0x436197){_0x4289fc['emit'](_0x3d3645,_0x436197);};}function removeListener(_0x5e2adc,_0x3e581e){return function(){VoicePrefixEvents[_0x2bf8('0x2')](_0x5e2adc,_0x3e581e);};}exports[_0x2bf8('0x3')]=function(_0x20dc19){for(var _0x19d402=0x0,_0x5a3818=events['length'];_0x19d402<_0x5a3818;_0x19d402++){var _0x1c57e9=events[_0x19d402];var _0x5c1944=createListener(_0x2bf8('0x4')+_0x1c57e9,_0x20dc19);VoicePrefixEvents['on'](_0x1c57e9,_0x5c1944);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bbe74de..ce7dcb6 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x236b13,_0xd848df){var _0x4def23=function(_0x804f56){while(--_0x804f56){_0x236b13['push'](_0x236b13['shift']());}};_0x4def23(++_0xd848df);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xb10b,0x12a));var _0xbb10=function(_0x17b47d,_0x3136fb){_0x17b47d=_0x17b47d-0x0;var _0x3c643e=_0xb10b[_0x17b47d];return _0x3c643e;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('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 cda6890..d6fe678 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 _0x8b9c=['sequelize','exports','STRING','inbound','outbound','ENUM','ringall','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x582e0e,_0xe6045e){var _0x3e6437=function(_0x547e2c){while(--_0x547e2c){_0x582e0e['push'](_0x582e0e['shift']());}};_0x3e6437(++_0xe6045e);}(_0x8b9c,0x13c));var _0xc8b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b9c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc8b9('0x0'));module[_0xc8b9('0x1')]={'name':{'type':Sequelize[_0xc8b9('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc8b9('0x3'),_0xc8b9('0x4')),'allowNull':![],'defaultValue':_0xc8b9('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc8b9('0x5')]('rr',_0xc8b9('0x6'),'leastrecent',_0xc8b9('0x7'),_0xc8b9('0x8'),_0xc8b9('0x9'),_0xc8b9('0xa'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x393fd3){this[_0xc8b9('0xb')](_0xc8b9('0xc'),_0x393fd3?_0x393fd3:_0xc8b9('0x9'));},'get':function(){var _0x210aa8=this[_0xc8b9('0xd')](_0xc8b9('0xe'));var _0x4b1c02=this[_0xc8b9('0xd')](_0xc8b9('0xf'));var _0x3f932c=this[_0xc8b9('0xd')](_0xc8b9('0xc'));if(_0x210aa8===_0xc8b9('0x3')){return _0x3f932c;}if(_0x4b1c02===_0xc8b9('0x10')&&_0x3f932c===_0xc8b9('0x9')||_0x4b1c02===_0xc8b9('0x10')&&_0x3f932c==='roundrobin'){return _0x3f932c;}if(_0x4b1c02===_0xc8b9('0x11')||_0x4b1c02===_0xc8b9('0x12')||_0x4b1c02==='power'){return _0x3f932c;}return null;}},'servicelevel':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc8b9('0x13')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc8b9('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':_0xc8b9('0x14')},'autopause':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no',_0xc8b9('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc8b9('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc8b9('0x5')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc8b9('0x5')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc8b9('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc8b9('0x5')]('yes','no'),'defaultValue':_0xc8b9('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xc8b9('0x14'),'no',_0xc8b9('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc8b9('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc8b9('0x2')]},'queue_youarenext':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc8b9('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc8b9('0x2')]},'queue_quantity1':{'type':Sequelize[_0xc8b9('0x2')]},'queue_quantity2':{'type':Sequelize[_0xc8b9('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xc8b9('0x2')]},'queue_less_than':{'type':Sequelize[_0xc8b9('0x2')]},'periodic_announce':{'type':Sequelize[_0xc8b9('0x17')],'set':function(_0x2da24c){this[_0xc8b9('0xb')](_0xc8b9('0x18'),_0x2da24c?_0x2da24c[_0xc8b9('0x19')](','):[]);},'get':function(){return this[_0xc8b9('0xd')](_0xc8b9('0x18'))?this[_0xc8b9('0xd')]('periodic_announce')[_0xc8b9('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xc8b9('0x14'),'set':function(_0x2b36bb){this['setDataValue'](_0xc8b9('0x1b'),_0x2b36bb?_0x2b36bb[_0xc8b9('0x19')](','):undefined);},'get':function(){return this[_0xc8b9('0xd')](_0xc8b9('0x1b'))?this[_0xc8b9('0xd')](_0xc8b9('0x1b'))[_0xc8b9('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':'no','set':function(_0x2b1cf2){this['setDataValue'](_0xc8b9('0x1c'),_0x2b1cf2?_0x2b1cf2[_0xc8b9('0x19')](','):undefined);},'get':function(){return this[_0xc8b9('0xd')](_0xc8b9('0x1c'))?this['getDataValue'](_0xc8b9('0x1c'))[_0xc8b9('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc8b9('0x2')]},'acw':{'type':Sequelize[_0xc8b9('0x1d')],'defaultValue':0x0,'set':function(_0x1359a3){this[_0xc8b9('0xb')](_0xc8b9('0x1e'),_0x1359a3);if(_0x1359a3){if(this[_0xc8b9('0xd')](_0xc8b9('0x1f'))<0x2){this[_0xc8b9('0xb')](_0xc8b9('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc8b9('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc8b9('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xc8b9('0x21'),_0xc8b9('0x11'),'power','predictive',_0xc8b9('0x10')),'defaultValue':_0xc8b9('0x11'),'comment':_0xc8b9('0x22')},'dialLimitChannel':{'type':Sequelize[_0xc8b9('0x13')](0x4)[_0xc8b9('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xc8b9('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xc8b9('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc8b9('0x24')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xc8b9('0x25'),_0xc8b9('0x26')),'defaultValue':'dropRate','comment':_0xc8b9('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc8b9('0x28')](0x2)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc8b9('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc8b9('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc8b9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc8b9('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc8b9('0x2c')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc8b9('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc8b9('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc8b9('0x32')},'dialTimezone':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc8b9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x33'),_0xc8b9('0x34'),_0xc8b9('0x35')),'defaultValue':_0xc8b9('0x33')},'dialAMDActive':{'type':Sequelize[_0xc8b9('0x1d')],'defaultValue':0x0,'comment':_0xc8b9('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc8b9('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc8b9('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc8b9('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc8b9('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc8b9('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc8b9('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc8b9('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc8b9('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc8b9('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc8b9('0x13')](0x5)[_0xc8b9('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc8b9('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc8b9('0x13')](0x9)[_0xc8b9('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc8b9('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0xc8b9('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc8b9('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xc8b9('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc8b9('0x5')](_0xc8b9('0x41'),_0xc8b9('0x42')),'defaultValue':_0xc8b9('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xc8b9('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc8b9('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc8b9('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc8b9('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc8b9('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc8b9('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc8b9('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc8b9('0x13')](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xc8b9('0x13')](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc8b9('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc8b9('0x13')](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xc8b9('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc8b9('0x13')](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc8b9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc8b9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc8b9('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xc8b9('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc8b9('0x4c'),'set':function(_0xa68c8c){if(!_0xa68c8c)this[_0xc8b9('0xb')](_0xc8b9('0x4d'),null);this[_0xc8b9('0xb')](_0xc8b9('0x4e'),_0xa68c8c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc8b9('0x13')](0x3)[_0xc8b9('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xc8b9('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb3c1=['getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','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.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','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)','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\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','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','rrmemory','linear','wrandom','setDataValue','strategy'];(function(_0x117fef,_0x1929e7){var _0x2d3c45=function(_0x590b29){while(--_0x590b29){_0x117fef['push'](_0x117fef['shift']());}};_0x2d3c45(++_0x1929e7);}(_0xb3c1,0xef));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1b3c('0x0'));module[_0x1b3c('0x1')]={'name':{'type':Sequelize[_0x1b3c('0x2')],'allowNull':![],'unique':_0x1b3c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x5'),_0x1b3c('0x6')),'allowNull':![],'defaultValue':_0x1b3c('0x5')},'musiconhold':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':_0x1b3c('0x7')},'announce':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1b3c('0x4')]('rr',_0x1b3c('0x8'),_0x1b3c('0x9'),'fewestcalls',_0x1b3c('0xa'),_0x1b3c('0xb'),_0x1b3c('0xc'),_0x1b3c('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0x1b3c('0x8'),'set':function(_0x37031e){this[_0x1b3c('0xe')](_0x1b3c('0xf'),_0x37031e?_0x37031e:_0x1b3c('0xb'));},'get':function(){var _0x105f9c=this[_0x1b3c('0x10')](_0x1b3c('0x11'));var _0x5032da=this['getDataValue'](_0x1b3c('0x12'));var _0x10c4c9=this[_0x1b3c('0x10')]('strategy');if(_0x105f9c==='inbound'){return _0x10c4c9;}if(_0x5032da===_0x1b3c('0x13')&&_0x10c4c9===_0x1b3c('0xb')||_0x5032da===_0x1b3c('0x13')&&_0x10c4c9==='roundrobin'){return _0x10c4c9;}if(_0x5032da===_0x1b3c('0x14')||_0x5032da===_0x1b3c('0x15')||_0x5032da===_0x1b3c('0x16')){return _0x10c4c9;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1b3c('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1b3c('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1b3c('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1b3c('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1b3c('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x1b3c('0x18'),'no'),'defaultValue':_0x1b3c('0x18')},'announce_holdtime':{'type':Sequelize[_0x1b3c('0x4')]('yes','no',_0x1b3c('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x1b3c('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1b3c('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1b3c('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1b3c('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x1b3c('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x1b3c('0x1a')],'set':function(_0xaad806){this[_0x1b3c('0xe')](_0x1b3c('0x1b'),_0xaad806?_0xaad806[_0x1b3c('0x1c')](','):[]);},'get':function(){return this[_0x1b3c('0x10')](_0x1b3c('0x1b'))?this[_0x1b3c('0x10')]('periodic_announce')[_0x1b3c('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':'yes','set':function(_0x49bd81){this[_0x1b3c('0xe')]('joinempty',_0x49bd81?_0x49bd81[_0x1b3c('0x1c')](','):undefined);},'get':function(){return this[_0x1b3c('0x10')](_0x1b3c('0x1e'))?this[_0x1b3c('0x10')](_0x1b3c('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':'no','set':function(_0x590c99){this[_0x1b3c('0xe')](_0x1b3c('0x1f'),_0x590c99?_0x590c99[_0x1b3c('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x1b3c('0x1f'))?this[_0x1b3c('0x10')](_0x1b3c('0x1f'))[_0x1b3c('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1b3c('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x312ef1){this[_0x1b3c('0xe')]('acw',_0x312ef1);if(_0x312ef1){if(this[_0x1b3c('0x10')]('wrapuptime')<0x2){this[_0x1b3c('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1b3c('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1b3c('0x20')],'defaultValue':0x0,'comment':_0x1b3c('0x21')},'dialMethod':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x22'),_0x1b3c('0x14'),_0x1b3c('0x16'),_0x1b3c('0x15'),_0x1b3c('0x13')),'defaultValue':_0x1b3c('0x14'),'comment':_0x1b3c('0x23')},'dialLimitChannel':{'type':Sequelize[_0x1b3c('0x17')](0x4)[_0x1b3c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1b3c('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x1b3c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1b3c('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x1b3c('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1b3c('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x28'),_0x1b3c('0x29')),'defaultValue':'dropRate','comment':_0x1b3c('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1b3c('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1b3c('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x1b3c('0x17')](0x3)[_0x1b3c('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1b3c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1b3c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1b3c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1b3c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':_0x1b3c('0x2f'),'comment':_0x1b3c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x1b3c('0x17')](0x3)[_0x1b3c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x1b3c('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)[_0x1b3c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1b3c('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b3c('0x39')},'dialTimezone':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':_0x1b3c('0x3a')},'dialPrefix':{'type':Sequelize[_0x1b3c('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1b3c('0x4')](_0x1b3c('0x3b'),'never',_0x1b3c('0x3c')),'defaultValue':_0x1b3c('0x3b')},'dialAMDActive':{'type':Sequelize[_0x1b3c('0x20')],'defaultValue':0x0,'comment':_0x1b3c('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b3c('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b3c('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x1b3c('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b3c('0x17')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1b3c('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b3c('0x17')](0x9)[_0x1b3c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b3c('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b3c('0x17')](0x9)[_0x1b3c('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b3c('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b3c('0x17')](0x9)[_0x1b3c('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b3c('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b3c('0x17')](0x9)[_0x1b3c('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1b3c('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b3c('0x17')](0x9)[_0x1b3c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b3c('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1b3c('0x45')},'dialRecallInQueue':{'type':Sequelize[_0x1b3c('0x20')],'defaultValue':0x0,'comment':_0x1b3c('0x46')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b3c('0x4')]('DESC','ASC'),'defaultValue':_0x1b3c('0x47')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x1b3c('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1b3c('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1b3c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b3c('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b3c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b3c('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)[_0x1b3c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x4b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b3c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b3c('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1b3c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b3c('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b3c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b3c('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b3c('0x17')],'allowNull':!![],'comment':_0x1b3c('0x52')},'mandatoryDisposition':{'type':Sequelize[_0x1b3c('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x34b292){if(!_0x34b292)this['setDataValue'](_0x1b3c('0x53'),null);this['setDataValue'](_0x1b3c('0x54'),_0x34b292);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1b3c('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1b3c('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 98f3bcc..5d679ca 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 _0xe5d8=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','send','index','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VoiceQueue','findAll','rows','catch','show','keys','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','include','omit','createdAt','updatedAt','destroy','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','voicePause','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','phone','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x6f7a4f,_0x37d8b3){var _0x54a956=function(_0x418fd5){while(--_0x418fd5){_0x6f7a4f['push'](_0x6f7a4f['shift']());}};_0x54a956(++_0x37d8b3);}(_0xe5d8,0xa0));var _0x8e5d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe5d8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8e5d('0x0'));var rimraf=require(_0x8e5d('0x1'));var zipdir=require(_0x8e5d('0x2'));var jsonpatch=require(_0x8e5d('0x3'));var rp=require(_0x8e5d('0x4'));var moment=require(_0x8e5d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e5d('0x6'));var path=require(_0x8e5d('0x7'));var sox=require(_0x8e5d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e5d('0x9'));var _=require('lodash');var squel=require(_0x8e5d('0xa'));var crypto=require(_0x8e5d('0xb'));var jsforce=require(_0x8e5d('0xc'));var deskjs=require(_0x8e5d('0xd'));var toCsv=require(_0x8e5d('0xe'));var querystring=require(_0x8e5d('0xf'));var Papa=require(_0x8e5d('0x10'));var Redis=require(_0x8e5d('0x11'));var authService=require(_0x8e5d('0x12'));var qs=require(_0x8e5d('0x13'));var as=require(_0x8e5d('0x14'));var hardwareService=require(_0x8e5d('0x15'));var logger=require('../../config/logger')(_0x8e5d('0x16'));var utils=require(_0x8e5d('0x17'));var config=require(_0x8e5d('0x18'));var licenseUtil=require(_0x8e5d('0x19'));var db=require(_0x8e5d('0x1a'))['db'];config[_0x8e5d('0x1b')]=_[_0x8e5d('0x1c')](config[_0x8e5d('0x1b')],{'host':_0x8e5d('0x1d'),'port':0x18eb});var socket=require(_0x8e5d('0x1e'))(new Redis(config[_0x8e5d('0x1b')]));require(_0x8e5d('0x1f'))['register'](socket);function respondWithStatusCode(_0x69ff5c,_0x46a7ec){_0x46a7ec=_0x46a7ec||0xcc;return function(_0x2bd851){if(_0x2bd851){return _0x69ff5c[_0x8e5d('0x20')](_0x46a7ec);}return _0x69ff5c[_0x8e5d('0x21')](_0x46a7ec)[_0x8e5d('0x22')]();};}function respondWithResult(_0x36ec2f,_0x4e0bcb){_0x4e0bcb=_0x4e0bcb||0xc8;return function(_0x323d75){if(_0x323d75){return _0x36ec2f[_0x8e5d('0x21')](_0x4e0bcb)[_0x8e5d('0x23')](_0x323d75);}};}function respondWithFilteredResult(_0x527ba6,_0xe91dfb){return function(_0x36fd73){if(_0x36fd73){var _0x59dc01=typeof _0xe91dfb[_0x8e5d('0x24')]===_0x8e5d('0x25')&&typeof _0xe91dfb['limit']==='undefined';var _0x35cf47=_0x36fd73[_0x8e5d('0x26')];var _0x17b8f1=_0x59dc01?0x0:_0xe91dfb[_0x8e5d('0x24')];var _0x170c89=_0x59dc01?_0x36fd73['count']:_0xe91dfb['offset']+_0xe91dfb['limit'];var _0x4a16d2;if(_0x170c89>=_0x35cf47){_0x170c89=_0x35cf47;_0x4a16d2=0xc8;}else{_0x4a16d2=0xce;}_0x527ba6['status'](_0x4a16d2);return _0x527ba6['set'](_0x8e5d('0x27'),_0x17b8f1+'-'+_0x170c89+'/'+_0x35cf47)[_0x8e5d('0x23')](_0x36fd73);}return null;};}function patchUpdates(_0x2744b6){return function(_0x272b71){try{jsonpatch[_0x8e5d('0x28')](_0x272b71,_0x2744b6,!![]);}catch(_0x5ea62e){return BPromise['reject'](_0x5ea62e);}return _0x272b71['save']();};}function saveUpdates(_0x2b379b,_0x5b510e){return function(_0x25bf0e){if(_0x25bf0e){return _0x25bf0e[_0x8e5d('0x29')](_0x2b379b)[_0x8e5d('0x2a')](function(_0x50beed){return _0x50beed;});}return null;};}function removeEntity(_0xe06936,_0x26c01c){return function(_0x580cdf){if(_0x580cdf){return _0x580cdf['destroy']()[_0x8e5d('0x2a')](function(){var _0x115b7a=_0x580cdf[_0x8e5d('0x2b')]({'plain':!![]});var _0x22067e=[{'name':_0x8e5d('0x2c'),'value':_0x8e5d('0x2d'),'ignore':![]},{'name':_0x8e5d('0x2e'),'value':_0x8e5d('0x2f'),'ignore':![]}];var _0x2ee7ee=_(_0x22067e)['filter'](_0x8e5d('0x30'))[_0x8e5d('0x31')](_0x8e5d('0x32'))[_0x8e5d('0x32')]();if(_[_0x8e5d('0x33')](_0x2ee7ee,_0x115b7a[_0x8e5d('0x34')])){return;}var _0x58efc1=_[_0x8e5d('0x35')](_0x22067e,[_0x8e5d('0x32'),_0x115b7a['type']])[_0x8e5d('0x36')];return db['UserProfileResource']['destroy']({'where':{'type':_0x58efc1,'resourceId':_0x115b7a['id']}})[_0x8e5d('0x2a')](function(){return _0x580cdf;});})['then'](function(){_0xe06936['status'](0xcc)[_0x8e5d('0x22')]();});}};}function handleEntityNotFound(_0xe47672,_0x552f1e){return function(_0x577493){if(!_0x577493){_0xe47672[_0x8e5d('0x20')](0x194);}return _0x577493;};}function handleError(_0x5c794e,_0x5e5568){_0x5e5568=_0x5e5568||0x1f4;return function(_0x59f68d){logger['error'](_0x59f68d['stack']);if(_0x59f68d[_0x8e5d('0x36')]){delete _0x59f68d[_0x8e5d('0x36')];}_0x5c794e[_0x8e5d('0x21')](_0x5e5568)[_0x8e5d('0x37')](_0x59f68d);};}exports[_0x8e5d('0x38')]=function(_0x8a52e9,_0x5058e5){var _0x9db82c={},_0x7ad5cf={},_0x2b89ec={'count':0x0,'rows':[]};var _0x5467d9=_['map'](db['VoiceQueue'][_0x8e5d('0x39')],function(_0x3fbe61){return{'name':_0x3fbe61[_0x8e5d('0x3a')],'type':_0x3fbe61[_0x8e5d('0x34')][_0x8e5d('0x3b')]};});_0x7ad5cf['model']=_[_0x8e5d('0x31')](_0x5467d9,_0x8e5d('0x36'));_0x7ad5cf['query']=_['keys'](_0x8a52e9['query']);_0x7ad5cf[_0x8e5d('0x3c')]=_[_0x8e5d('0x3d')](_0x7ad5cf[_0x8e5d('0x3e')],_0x7ad5cf[_0x8e5d('0x3f')]);_0x9db82c[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x7ad5cf[_0x8e5d('0x3e')],qs['fields'](_0x8a52e9[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x9db82c['attributes']=_0x9db82c[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x9db82c['attributes']:_0x7ad5cf[_0x8e5d('0x3e')];if(!_0x8a52e9[_0x8e5d('0x3f')][_0x8e5d('0x43')]('nolimit')){_0x9db82c['limit']=qs[_0x8e5d('0x44')](_0x8a52e9[_0x8e5d('0x3f')][_0x8e5d('0x44')]);_0x9db82c[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x8a52e9[_0x8e5d('0x3f')][_0x8e5d('0x24')]);}_0x9db82c[_0x8e5d('0x45')]=qs[_0x8e5d('0x46')](_0x8a52e9['query'][_0x8e5d('0x46')]);_0x9db82c['where']=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x8a52e9['query'],_0x7ad5cf['filters']),_0x5467d9);if(_0x8a52e9[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x9db82c[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0x9db82c[_0x8e5d('0x49')],{'$or':_['map'](_0x5467d9,function(_0x127993){if(_0x127993[_0x8e5d('0x34')]!=='VIRTUAL'){var _0x5d257c={};_0x5d257c[_0x127993[_0x8e5d('0x36')]]={'$like':'%'+_0x8a52e9[_0x8e5d('0x3f')]['filter']+'%'};return _0x5d257c;}})});}_0x9db82c=_[_0x8e5d('0x4a')]({},_0x9db82c,_0x8a52e9['options']);var _0xbfe3a8={'where':_0x9db82c['where']};return db[_0x8e5d('0x4b')][_0x8e5d('0x26')](_0xbfe3a8)[_0x8e5d('0x2a')](function(_0x437414){_0x2b89ec[_0x8e5d('0x26')]=_0x437414;if(_0x8a52e9[_0x8e5d('0x3f')]['includeAll']){_0x9db82c['include']=[{'all':!![]}];}return db[_0x8e5d('0x4b')][_0x8e5d('0x4c')](_0x9db82c);})[_0x8e5d('0x2a')](function(_0x43fe16){_0x2b89ec[_0x8e5d('0x4d')]=_0x43fe16;return _0x2b89ec;})[_0x8e5d('0x2a')](respondWithFilteredResult(_0x5058e5,_0x9db82c))[_0x8e5d('0x4e')](handleError(_0x5058e5,null));};exports[_0x8e5d('0x4f')]=function(_0x305567,_0x18f7ab){var _0x23efd3={'raw':![],'where':{'id':_0x305567['params']['id']}},_0x4b0e90={};_0x4b0e90[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x4b')]['rawAttributes']);_0x4b0e90[_0x8e5d('0x3f')]=_[_0x8e5d('0x50')](_0x305567[_0x8e5d('0x3f')]);_0x4b0e90[_0x8e5d('0x3c')]=_['intersection'](_0x4b0e90[_0x8e5d('0x3e')],_0x4b0e90[_0x8e5d('0x3f')]);_0x23efd3[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x4b0e90['model'],qs['fields'](_0x305567[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x23efd3[_0x8e5d('0x40')]=_0x23efd3['attributes'][_0x8e5d('0x42')]?_0x23efd3[_0x8e5d('0x40')]:_0x4b0e90[_0x8e5d('0x3e')];if(_0x305567[_0x8e5d('0x3f')][_0x8e5d('0x51')]){_0x23efd3['include']=[{'all':!![]}];}_0x23efd3=_[_0x8e5d('0x4a')]({},_0x23efd3,_0x305567[_0x8e5d('0x52')]);return db[_0x8e5d('0x4b')][_0x8e5d('0x35')](_0x23efd3)['then'](handleEntityNotFound(_0x18f7ab,null))[_0x8e5d('0x2a')](respondWithResult(_0x18f7ab,null))['catch'](handleError(_0x18f7ab,null));};exports[_0x8e5d('0x53')]=function(_0x4407f4,_0x568bbc){return db[_0x8e5d('0x4b')]['create'](_0x4407f4[_0x8e5d('0x54')],{})['then'](function(_0x358c1d){var _0x33ee65=_0x4407f4[_0x8e5d('0x55')]['get']({'plain':!![]});if(!_0x33ee65)throw new Error(_0x8e5d('0x56'));if(_0x33ee65[_0x8e5d('0x57')]===_0x8e5d('0x55')){var _0x46fd03=_0x358c1d['get']({'plain':!![]});var _0x5833f4=[{'name':_0x8e5d('0x2c'),'value':'inbound'},{'name':_0x8e5d('0x2e'),'value':_0x8e5d('0x2f')}];var _0x4a4c60=_['find'](_0x5833f4,[_0x8e5d('0x32'),_0x46fd03[_0x8e5d('0x34')]])[_0x8e5d('0x36')];return db[_0x8e5d('0x58')][_0x8e5d('0x35')]({'where':{'name':_0x4a4c60,'userProfileId':_0x33ee65[_0x8e5d('0x59')]},'raw':!![]})[_0x8e5d('0x2a')](function(_0x4960b3){if(_0x4960b3&&_0x4960b3[_0x8e5d('0x5a')]===0x0){return db[_0x8e5d('0x5b')]['create']({'name':_0x46fd03[_0x8e5d('0x36')],'resourceId':_0x46fd03['id'],'type':_0x4960b3[_0x8e5d('0x36')],'sectionId':_0x4960b3['id']},{})[_0x8e5d('0x2a')](function(){return _0x358c1d;});}else{return _0x358c1d;}})['catch'](function(_0x4a19cc){logger[_0x8e5d('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a19cc);throw _0x4a19cc;});}return _0x358c1d;})['then'](respondWithResult(_0x568bbc,0xc9))[_0x8e5d('0x4e')](handleError(_0x568bbc,null));};exports['clone']=function(_0x21b461,_0x2c462e){var _0x4404b5={'where':{'id':_0x21b461[_0x8e5d('0x5d')]['id']}},_0xf78dec={};_0xf78dec[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x4b')]['rawAttributes']);_0x4404b5[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0xf78dec[_0x8e5d('0x3e')],qs['fields'](_0x21b461[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x4404b5['attributes']=_0x4404b5['attributes'][_0x8e5d('0x42')]?_0x4404b5[_0x8e5d('0x40')]:_0xf78dec[_0x8e5d('0x3e')];if(_0x21b461['query'][_0x8e5d('0x51')]){_0x4404b5[_0x8e5d('0x5e')]=[{'all':!![]}];}_0x4404b5=_[_0x8e5d('0x4a')]({},_0x4404b5,_0x21b461[_0x8e5d('0x52')]);return db[_0x8e5d('0x4b')][_0x8e5d('0x35')](_0x4404b5)[_0x8e5d('0x2a')](handleEntityNotFound(_0x2c462e,null))[_0x8e5d('0x2a')](function(_0x4a987d){if(_0x4a987d){var _0xf92269=_0x4a987d['get']({'plain':!![]});_0xf92269=qs[_0x8e5d('0x5f')](_0xf92269,['id',_0x8e5d('0x60'),_0x8e5d('0x61')]);_0x21b461[_0x8e5d('0x54')]=_[_0x8e5d('0x5f')](_0x21b461[_0x8e5d('0x54')],['id',_0x8e5d('0x60'),'updatedAt']);return db[_0x8e5d('0x4b')][_0x8e5d('0x53')](_['merge'](_0xf92269,_0x21b461[_0x8e5d('0x54')]),{'include':_0x21b461[_0x8e5d('0x3f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xdfff5){var _0x459ab1=_0x21b461[_0x8e5d('0x55')]['get']({'plain':!![]});if(!_0x459ab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x459ab1[_0x8e5d('0x57')]===_0x8e5d('0x55')){var _0x559b19=_0xdfff5[_0x8e5d('0x2b')]({'plain':!![]});var _0x3202ea=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x320a1e=_[_0x8e5d('0x35')](_0x3202ea,[_0x8e5d('0x32'),_0x559b19['type']])[_0x8e5d('0x36')];return db[_0x8e5d('0x58')][_0x8e5d('0x35')]({'where':{'name':_0x320a1e,'userProfileId':_0x459ab1[_0x8e5d('0x59')]},'raw':!![]})['then'](function(_0x58c736){if(_0x58c736&&_0x58c736[_0x8e5d('0x5a')]===0x0){return db[_0x8e5d('0x5b')]['create']({'name':_0x559b19[_0x8e5d('0x36')],'resourceId':_0x559b19['id'],'type':_0x58c736[_0x8e5d('0x36')],'sectionId':_0x58c736['id']},{})[_0x8e5d('0x2a')](function(){return _0xdfff5;});}else{return _0xdfff5;}})[_0x8e5d('0x4e')](function(_0xc9dbcc){logger[_0x8e5d('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc9dbcc);throw _0xc9dbcc;});}return _0xdfff5;});}})['then'](respondWithResult(_0x2c462e,0xc9))['catch'](handleError(_0x2c462e,null));};exports['update']=function(_0x200075,_0x2bb224){if(_0x200075[_0x8e5d('0x54')]['id']){delete _0x200075[_0x8e5d('0x54')]['id'];}return db[_0x8e5d('0x4b')]['find']({'where':{'id':_0x200075['params']['id']}})['then'](handleEntityNotFound(_0x2bb224,null))['then'](saveUpdates(_0x200075[_0x8e5d('0x54')],null))[_0x8e5d('0x2a')](respondWithResult(_0x2bb224,null))['catch'](handleError(_0x2bb224,null));};exports[_0x8e5d('0x62')]=function(_0x1739d4,_0x1c449c){return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x1739d4['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x1c449c,null))[_0x8e5d('0x2a')](removeEntity(_0x1c449c,null))['catch'](handleError(_0x1c449c,null));};exports[_0x8e5d('0x63')]=function(_0x169e23,_0x1aec1a,_0x4618d9){var _0x34e92a={'raw':![],'where':{}};var _0x58a973={};var _0x2a5a6a={'count':0x0,'rows':[]};return db[_0x8e5d('0x4b')][_0x8e5d('0x64')]({'where':{'id':_0x169e23[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x1aec1a,null))[_0x8e5d('0x2a')](function(_0x343022){if(_0x343022){_0x58a973[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x65')]['rawAttributes']);_0x58a973['query']=_[_0x8e5d('0x50')](_0x169e23['query']);_0x58a973[_0x8e5d('0x3c')]=_[_0x8e5d('0x3d')](_0x58a973[_0x8e5d('0x3e')],_0x58a973['query']);_0x34e92a[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x58a973[_0x8e5d('0x3e')],qs['fields'](_0x169e23[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x34e92a[_0x8e5d('0x40')]=_0x34e92a[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x34e92a[_0x8e5d('0x40')]:_0x58a973[_0x8e5d('0x3e')];if(!_0x169e23[_0x8e5d('0x3f')][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x34e92a[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0x169e23['query'][_0x8e5d('0x44')]);_0x34e92a[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x169e23[_0x8e5d('0x3f')]['offset']);}_0x34e92a[_0x8e5d('0x45')]=qs[_0x8e5d('0x46')](_0x169e23[_0x8e5d('0x3f')][_0x8e5d('0x46')]);_0x34e92a[_0x8e5d('0x49')]=qs['filters'](_['pick'](_0x169e23[_0x8e5d('0x3f')],_0x58a973[_0x8e5d('0x3c')]));_0x34e92a[_0x8e5d('0x49')][_0x8e5d('0x67')]=_0x343022['id'];if(_0x169e23[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x34e92a['where']=_['merge'](_0x34e92a[_0x8e5d('0x49')],{'$or':_[_0x8e5d('0x31')](_0x34e92a[_0x8e5d('0x40')],function(_0x54d867){var _0x17590a={};_0x17590a[_0x54d867]={'$like':'%'+_0x169e23[_0x8e5d('0x3f')][_0x8e5d('0x48')]+'%'};return _0x17590a;})});}_0x34e92a=_[_0x8e5d('0x4a')]({},_0x34e92a,_0x169e23[_0x8e5d('0x52')]);return db['CmHopper'][_0x8e5d('0x26')]({'where':_0x34e92a[_0x8e5d('0x49')]})[_0x8e5d('0x2a')](function(_0x363566){_0x2a5a6a['count']=_0x363566;if(_0x169e23[_0x8e5d('0x3f')]['includeAll']){_0x34e92a[_0x8e5d('0x5e')]=[{'all':!![]}];}return db[_0x8e5d('0x65')][_0x8e5d('0x4c')](_0x34e92a);})[_0x8e5d('0x2a')](function(_0x315bb8){_0x2a5a6a[_0x8e5d('0x4d')]=_0x315bb8;return _0x2a5a6a;});}})[_0x8e5d('0x2a')](respondWithFilteredResult(_0x1aec1a,_0x34e92a))[_0x8e5d('0x4e')](handleError(_0x1aec1a,null));};exports['getHopperHistories']=function(_0x586d6f,_0xc29a3c,_0x1f6745){var _0x40853e={'raw':!![],'where':{}};var _0x58b085={};var _0x5e9058={'count':0x0,'rows':[]};return db[_0x8e5d('0x4b')][_0x8e5d('0x64')]({'where':{'id':_0x586d6f['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0xc29a3c,null))[_0x8e5d('0x2a')](function(_0x4893f3){if(_0x4893f3){_0x58b085[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x68')][_0x8e5d('0x39')]);_0x58b085['query']=_[_0x8e5d('0x50')](_0x586d6f[_0x8e5d('0x3f')]);_0x58b085[_0x8e5d('0x3c')]=_[_0x8e5d('0x3d')](_0x58b085[_0x8e5d('0x3e')],_0x58b085[_0x8e5d('0x3f')]);_0x40853e[_0x8e5d('0x40')]=_['intersection'](_0x58b085[_0x8e5d('0x3e')],qs[_0x8e5d('0x41')](_0x586d6f[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x40853e[_0x8e5d('0x40')]=_0x40853e[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x40853e[_0x8e5d('0x40')]:_0x58b085['model'];if(!_0x586d6f[_0x8e5d('0x3f')][_0x8e5d('0x43')]('nolimit')){_0x40853e[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0x586d6f['query'][_0x8e5d('0x44')]);_0x40853e[_0x8e5d('0x24')]=qs['offset'](_0x586d6f[_0x8e5d('0x3f')]['offset']);}_0x40853e['order']=qs[_0x8e5d('0x46')](_0x586d6f['query'][_0x8e5d('0x46')]);_0x40853e[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_['pick'](_0x586d6f['query'],_0x58b085[_0x8e5d('0x3c')]));_0x40853e[_0x8e5d('0x49')]['VoiceQueueId']=_0x4893f3['id'];if(_0x586d6f[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x40853e[_0x8e5d('0x49')]=_['merge'](_0x40853e[_0x8e5d('0x49')],{'$or':_['map'](_0x40853e[_0x8e5d('0x40')],function(_0x2fe851){var _0x7d6982={};_0x7d6982[_0x2fe851]={'$like':'%'+_0x586d6f['query']['filter']+'%'};return _0x7d6982;})});}_0x40853e=_[_0x8e5d('0x4a')]({},_0x40853e,_0x586d6f[_0x8e5d('0x52')]);return db[_0x8e5d('0x68')][_0x8e5d('0x26')]({'where':_0x40853e['where']})[_0x8e5d('0x2a')](function(_0x39356b){_0x5e9058['count']=_0x39356b;if(_0x586d6f[_0x8e5d('0x3f')][_0x8e5d('0x51')]){_0x40853e[_0x8e5d('0x5e')]=[{'all':!![]}];}return db[_0x8e5d('0x68')][_0x8e5d('0x4c')](_0x40853e);})[_0x8e5d('0x2a')](function(_0x3127c3){_0x5e9058[_0x8e5d('0x4d')]=_0x3127c3;return _0x5e9058;});}})[_0x8e5d('0x2a')](respondWithFilteredResult(_0xc29a3c,_0x40853e))[_0x8e5d('0x4e')](handleError(_0xc29a3c,null));};exports['getHopperFinals']=function(_0x2f5e07,_0x118fe2,_0xb523c7){var _0x3a8cdb={'raw':!![],'where':{}};var _0x3cd9b4={};var _0x4b777d={'count':0x0,'rows':[]};return db[_0x8e5d('0x4b')][_0x8e5d('0x64')]({'where':{'id':_0x2f5e07['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x118fe2,null))[_0x8e5d('0x2a')](function(_0x3d8479){if(_0x3d8479){_0x3cd9b4[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x69')][_0x8e5d('0x39')]);_0x3cd9b4[_0x8e5d('0x3f')]=_['keys'](_0x2f5e07['query']);_0x3cd9b4[_0x8e5d('0x3c')]=_[_0x8e5d('0x3d')](_0x3cd9b4['model'],_0x3cd9b4[_0x8e5d('0x3f')]);_0x3a8cdb[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x3cd9b4['model'],qs[_0x8e5d('0x41')](_0x2f5e07[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x3a8cdb[_0x8e5d('0x40')]=_0x3a8cdb['attributes'][_0x8e5d('0x42')]?_0x3a8cdb['attributes']:_0x3cd9b4[_0x8e5d('0x3e')];if(!_0x2f5e07['query'][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x3a8cdb['limit']=qs[_0x8e5d('0x44')](_0x2f5e07[_0x8e5d('0x3f')][_0x8e5d('0x44')]);_0x3a8cdb['offset']=qs['offset'](_0x2f5e07[_0x8e5d('0x3f')][_0x8e5d('0x24')]);}_0x3a8cdb[_0x8e5d('0x45')]=qs['sort'](_0x2f5e07['query']['sort']);_0x3a8cdb[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x2f5e07[_0x8e5d('0x3f')],_0x3cd9b4[_0x8e5d('0x3c')]));_0x3a8cdb[_0x8e5d('0x49')][_0x8e5d('0x67')]=_0x3d8479['id'];if(_0x2f5e07['query']['filter']){_0x3a8cdb[_0x8e5d('0x49')]=_['merge'](_0x3a8cdb[_0x8e5d('0x49')],{'$or':_[_0x8e5d('0x31')](_0x3a8cdb['attributes'],function(_0x578708){var _0x37d51d={};_0x37d51d[_0x578708]={'$like':'%'+_0x2f5e07['query'][_0x8e5d('0x48')]+'%'};return _0x37d51d;})});}_0x3a8cdb=_[_0x8e5d('0x4a')]({},_0x3a8cdb,_0x2f5e07[_0x8e5d('0x52')]);return db[_0x8e5d('0x69')]['count']({'where':_0x3a8cdb[_0x8e5d('0x49')]})['then'](function(_0x33907a){_0x4b777d[_0x8e5d('0x26')]=_0x33907a;if(_0x2f5e07[_0x8e5d('0x3f')][_0x8e5d('0x51')]){_0x3a8cdb[_0x8e5d('0x5e')]=[{'all':!![]}];}return db[_0x8e5d('0x69')][_0x8e5d('0x4c')](_0x3a8cdb);})['then'](function(_0x283821){_0x4b777d[_0x8e5d('0x4d')]=_0x283821;return _0x4b777d;});}})[_0x8e5d('0x2a')](respondWithFilteredResult(_0x118fe2,_0x3a8cdb))[_0x8e5d('0x4e')](handleError(_0x118fe2,null));};exports[_0x8e5d('0x6a')]=function(_0x1fd049,_0x1a658c,_0xced2da){var _0xa3c7ff={'raw':!![],'where':{}};var _0x2d6c53={};var _0x1c985d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x8e5d('0x64')]({'where':{'id':_0x1fd049['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x1a658c,null))[_0x8e5d('0x2a')](function(_0x529b24){if(_0x529b24){_0x2d6c53['model']=_[_0x8e5d('0x50')](db[_0x8e5d('0x6b')][_0x8e5d('0x39')]);_0x2d6c53[_0x8e5d('0x3f')]=_[_0x8e5d('0x50')](_0x1fd049[_0x8e5d('0x3f')]);_0x2d6c53['filters']=_[_0x8e5d('0x3d')](_0x2d6c53['model'],_0x2d6c53['query']);_0xa3c7ff[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x2d6c53[_0x8e5d('0x3e')],qs['fields'](_0x1fd049[_0x8e5d('0x3f')]['fields']));_0xa3c7ff[_0x8e5d('0x40')]=_0xa3c7ff[_0x8e5d('0x40')]['length']?_0xa3c7ff[_0x8e5d('0x40')]:_0x2d6c53[_0x8e5d('0x3e')];if(!_0x1fd049['query'][_0x8e5d('0x43')]('nolimit')){_0xa3c7ff[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0x1fd049[_0x8e5d('0x3f')][_0x8e5d('0x44')]);_0xa3c7ff[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x1fd049[_0x8e5d('0x3f')]['offset']);}_0xa3c7ff[_0x8e5d('0x45')]=qs[_0x8e5d('0x46')](_0x1fd049['query'][_0x8e5d('0x46')]);_0xa3c7ff[_0x8e5d('0x49')]=qs['filters'](_[_0x8e5d('0x47')](_0x1fd049['query'],_0x2d6c53[_0x8e5d('0x3c')]));_0xa3c7ff[_0x8e5d('0x49')]['VoiceQueueId']=_0x529b24['id'];if(_0x1fd049['query'][_0x8e5d('0x48')]){_0xa3c7ff[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0xa3c7ff['where'],{'$or':_['map'](_0xa3c7ff['attributes'],function(_0x29b5dc){var _0x338928={};_0x338928[_0x29b5dc]={'$like':'%'+_0x1fd049[_0x8e5d('0x3f')][_0x8e5d('0x48')]+'%'};return _0x338928;})});}_0xa3c7ff=_[_0x8e5d('0x4a')]({},_0xa3c7ff,_0x1fd049[_0x8e5d('0x52')]);return db['CmHopperBlack'][_0x8e5d('0x26')]({'where':_0xa3c7ff[_0x8e5d('0x49')]})['then'](function(_0x153be9){_0x1c985d[_0x8e5d('0x26')]=_0x153be9;if(_0x1fd049[_0x8e5d('0x3f')]['includeAll']){_0xa3c7ff[_0x8e5d('0x5e')]=[{'all':!![]}];}return db[_0x8e5d('0x6b')][_0x8e5d('0x4c')](_0xa3c7ff);})[_0x8e5d('0x2a')](function(_0x214349){_0x1c985d[_0x8e5d('0x4d')]=_0x214349;return _0x1c985d;});}})[_0x8e5d('0x2a')](respondWithFilteredResult(_0x1a658c,_0xa3c7ff))[_0x8e5d('0x4e')](handleError(_0x1a658c,null));};exports[_0x8e5d('0x6c')]=function(_0x2c86fa,_0x32be42,_0x54c93d){var _0x31c289={};var _0x47a96c={};var _0x5d3d40;var _0x481195;return db[_0x8e5d('0x4b')][_0x8e5d('0x64')]({'where':{'id':_0x2c86fa[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x32be42,null))['then'](function(_0x31be87){if(_0x31be87){_0x5d3d40=_0x31be87;_0x47a96c[_0x8e5d('0x3e')]=_['keys'](db[_0x8e5d('0x6d')][_0x8e5d('0x39')]);_0x47a96c[_0x8e5d('0x3f')]=_[_0x8e5d('0x50')](_0x2c86fa[_0x8e5d('0x3f')]);_0x47a96c['filters']=_[_0x8e5d('0x3d')](_0x47a96c[_0x8e5d('0x3e')],_0x47a96c[_0x8e5d('0x3f')]);_0x31c289[_0x8e5d('0x40')]=_[_0x8e5d('0x3d')](_0x47a96c[_0x8e5d('0x3e')],qs['fields'](_0x2c86fa[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x31c289[_0x8e5d('0x40')]=_0x31c289[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x31c289['attributes']:_0x47a96c[_0x8e5d('0x3e')];_0x31c289[_0x8e5d('0x45')]=qs['sort'](_0x2c86fa[_0x8e5d('0x3f')][_0x8e5d('0x46')]);_0x31c289[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x2c86fa[_0x8e5d('0x3f')],_0x47a96c['filters']));if(_0x2c86fa[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x31c289[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0x31c289[_0x8e5d('0x49')],{'$or':_[_0x8e5d('0x31')](_0x31c289['attributes'],function(_0xa66ec0){var _0x56a495={};_0x56a495[_0xa66ec0]={'$like':'%'+_0x2c86fa[_0x8e5d('0x3f')][_0x8e5d('0x48')]+'%'};return _0x56a495;})});}_0x31c289=_[_0x8e5d('0x4a')]({},_0x31c289,_0x2c86fa[_0x8e5d('0x52')]);return _0x5d3d40[_0x8e5d('0x6c')](_0x31c289);}})[_0x8e5d('0x2a')](function(_0x4d33b7){if(_0x4d33b7){_0x481195=_0x4d33b7[_0x8e5d('0x42')];if(!_0x2c86fa['query'][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x31c289[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0x2c86fa[_0x8e5d('0x3f')]['limit']);_0x31c289[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x2c86fa[_0x8e5d('0x3f')]['offset']);}return _0x5d3d40['getTeams'](_0x31c289);}})[_0x8e5d('0x2a')](function(_0x5e58b9){if(_0x5e58b9){return _0x5e58b9?{'count':_0x481195,'rows':_0x5e58b9}:null;}})['then'](respondWithResult(_0x32be42,null))['catch'](handleError(_0x32be42,null));};exports['addTeams']=function(_0x281fc5,_0x2154b5,_0x21e5aa){var _0x468dfe=_0x281fc5[_0x8e5d('0x54')][_0x8e5d('0x6e')];var _0x358ea4=_[_0x8e5d('0x31')](_0x468dfe,'id');return db[_0x8e5d('0x6d')][_0x8e5d('0x4c')]({'where':{'id':_0x358ea4},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x8e5d('0x36'),_0x8e5d('0x6f'),'voicePause',_0x8e5d('0x70')],'raw':!![]}]})['then'](function(_0x308f14){if(_0x308f14){var _0x172f16=_[_0x8e5d('0x71')](_0x308f14,function(_0x3cd121){var _0x36c296=_0x3cd121[_0x8e5d('0x2b')]({'plain':!![]});_0x36c296['Agents'][_0x8e5d('0x72')](function(_0x13cc83){_0x13cc83[_0x8e5d('0x73')]=_[_0x8e5d('0x35')](_0x468dfe,{'id':_0x36c296['id']})[_0x8e5d('0x73')];});return _0x36c296['Agents'];});return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x281fc5['params']['id']}})[_0x8e5d('0x2a')](function(_0x3a848a){return db[_0x8e5d('0x74')][_0x8e5d('0x75')](function(_0x54a8b8){return _0x3a848a['addTeams'](_0x358ea4,{'transaction':_0x54a8b8})[_0x8e5d('0x2a')](function(){return BPromise[_0x8e5d('0x76')](_0x468dfe,function(_0x186a40){return db[_0x8e5d('0x77')][_0x8e5d('0x78')]({'TeamId':_0x186a40['id'],'VoiceQueueId':_0x281fc5['params']['id'],'penalty':_0x186a40[_0x8e5d('0x73')]},{'transaction':_0x54a8b8});});})[_0x8e5d('0x2a')](function(){return BPromise[_0x8e5d('0x76')](_0x172f16,function(_0x5af98d){return db[_0x8e5d('0x79')][_0x8e5d('0x7a')]({'where':{'UserId':_0x5af98d['id'],'VoiceQueueId':_0x281fc5[_0x8e5d('0x5d')]['id']},'defaults':{'penalty':_0x5af98d[_0x8e5d('0x73')]},'transaction':_0x54a8b8});});})[_0x8e5d('0x2a')](function(){return BPromise[_0x8e5d('0x76')](_[_0x8e5d('0x48')](_0x172f16,{'online':!![]}),function(_0x52edcf){return db['UserVoiceQueueRt']['upsert']({'membername':_0x52edcf[_0x8e5d('0x36')],'UserId':_0x52edcf['id'],'queue_name':_0x3a848a[_0x8e5d('0x36')],'VoiceQueueId':_0x3a848a['id'],'interface':_['isNil'](_0x52edcf['interface'])?util[_0x8e5d('0x7b')]('SIP/%s',_0x52edcf[_0x8e5d('0x36')]):_0x52edcf['interface'],'paused':_0x52edcf[_0x8e5d('0x7c')]||![],'penalty':_0x52edcf[_0x8e5d('0x73')]},{'transaction':_0x54a8b8});});})[_0x8e5d('0x2a')](function(){_0x172f16[_0x8e5d('0x72')](function(_0x547a9c){socket['emit']('userVoiceQueue:save',{'UserId':_0x547a9c['id'],'VoiceQueueId':_0x3a848a['id']});});});});});}})[_0x8e5d('0x2a')](respondWithStatusCode(_0x2154b5,null))[_0x8e5d('0x4e')](handleError(_0x2154b5,null));};exports[_0x8e5d('0x7d')]=function(_0x2e0045,_0x2d9a0a,_0x1629b3){return db[_0x8e5d('0x6d')][_0x8e5d('0x4c')]({'where':{'id':_0x2e0045[_0x8e5d('0x3f')][_0x8e5d('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x8e5d('0x7f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8e5d('0x2a')](handleEntityNotFound(_0x2d9a0a,null))['then'](function(_0x4022c8){var _0x33d5e6=_[_0x8e5d('0x31')](_0x4022c8,'id');var _0x78c63c=[];var _0x45f1ab=[];var _0x2ef1bf=squel[_0x8e5d('0x80')]();_0x2ef1bf[_0x8e5d('0x81')](_0x8e5d('0x82'))[_0x8e5d('0x83')](_0x8e5d('0x84'),'tq')[_0x8e5d('0x85')](_0x8e5d('0x86'),'ut',_0x8e5d('0x87'))['where']('VoiceQueueId\x20=\x20?',_0x2e0045[_0x8e5d('0x5d')]['id']);for(var _0x322f33=0x0;_0x322f33<_0x4022c8['length'];_0x322f33+=0x1){let _0x519b37=_0x4022c8[_0x322f33];for(var _0x449b5e=0x0;_0x449b5e<_0x519b37[_0x8e5d('0x88')][_0x8e5d('0x42')];_0x449b5e+=0x1){let _0x263a59=_0x519b37[_0x8e5d('0x88')][_0x449b5e];var _0x80cd4=_0x2ef1bf[_0x8e5d('0x89')]();_0x80cd4['where'](_0x8e5d('0x8a'),_0x263a59['id']);_0x45f1ab[_0x8e5d('0x8b')](db['sequelize'][_0x8e5d('0x3f')](_0x80cd4['toString'](),{'type':db[_0x8e5d('0x74')][_0x8e5d('0x8c')][_0x8e5d('0x8d')]})[_0x8e5d('0x2a')](function(_0x54eaa7){if(_0x54eaa7[_0x8e5d('0x42')]===0x1){return _0x263a59['id'];}else{var _0x2778f1=_[_0x8e5d('0x8e')](_[_0x8e5d('0x31')](_0x54eaa7,'TeamId'),function(_0x18bc75){return _[_0x8e5d('0x33')](_0x33d5e6,_0x18bc75);});if(_0x2778f1){return _0x263a59['id'];}}}));}}return BPromise[_0x8e5d('0x8f')](_0x45f1ab)['then'](function(_0x59a766){_0x78c63c=_(_0x78c63c)[_0x8e5d('0x90')](_0x59a766)[_0x8e5d('0x91')]()[_0x8e5d('0x32')]();return db['VoiceQueue'][_0x8e5d('0x35')]({'where':{'id':_0x2e0045[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](function(_0xbf535a){return db[_0x8e5d('0x74')][_0x8e5d('0x75')](function(_0x3f9ead){return _0xbf535a[_0x8e5d('0x7d')](_0x2e0045[_0x8e5d('0x3f')][_0x8e5d('0x7e')],{'transaction':_0x3f9ead})[_0x8e5d('0x2a')](function(){if(!_[_0x8e5d('0x92')](_0x78c63c)){return _0xbf535a[_0x8e5d('0x93')](_0x78c63c,{'transaction':_0x3f9ead})[_0x8e5d('0x2a')](function(){return db[_0x8e5d('0x94')][_0x8e5d('0x62')]({'where':{'VoiceQueueId':_0x2e0045[_0x8e5d('0x5d')]['id'],'UserId':_0x78c63c},'transaction':_0x3f9ead});});}})['then'](function(){_0x78c63c[_0x8e5d('0x72')](function(_0xeb8650){socket[_0x8e5d('0x95')](_0x8e5d('0x96'),{'UserId':_0xeb8650,'VoiceQueueId':_0xbf535a['id']});});});});});});})[_0x8e5d('0x2a')](respondWithStatusCode(_0x2d9a0a,null))[_0x8e5d('0x4e')](handleError(_0x2d9a0a,null));};exports['addAgents']=function(_0x590f2d,_0x6523fa,_0x4aeec1){var _0x4fedf8,_0x4903ba;return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x590f2d[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x6523fa,null))[_0x8e5d('0x2a')](function(_0x4a2d92){if(_0x4a2d92){_0x4903ba=_0x4a2d92;return _0x4a2d92[_0x8e5d('0x97')](_0x590f2d['body'][_0x8e5d('0x7e')],_['omit'](_0x590f2d[_0x8e5d('0x54')],[_0x8e5d('0x7e'),'id'])||{})['spread'](function(_0x206409){for(var _0x54937a=0x0;_0x54937a<_0x590f2d[_0x8e5d('0x54')][_0x8e5d('0x7e')][_0x8e5d('0x42')];_0x54937a+=0x1){socket[_0x8e5d('0x95')]('userVoiceQueue:save',{'UserId':Number(_0x590f2d[_0x8e5d('0x54')][_0x8e5d('0x7e')][_0x54937a]),'VoiceQueueId':Number(_0x590f2d[_0x8e5d('0x5d')]['id'])});}return _0x206409;});}})['then'](function(_0x1a43d7){_0x4fedf8=_0x1a43d7||[];if(_0x4903ba){return db[_0x8e5d('0x7f')][_0x8e5d('0x4c')]({'where':{'id':_0x590f2d['body'][_0x8e5d('0x7e')]},'attributes':['id',_0x8e5d('0x36'),_0x8e5d('0x6f'),'voicePause','interface'],'raw':!![]});}})[_0x8e5d('0x2a')](function(_0x23cf2d){if(!_[_0x8e5d('0x92')](_0x23cf2d)){var _0x4100c7=[];for(var _0x1dc71e=0x0;_0x1dc71e<_0x23cf2d['length'];_0x1dc71e++){if(_0x23cf2d[_0x1dc71e][_0x8e5d('0x6f')]){_0x4100c7[_0x8e5d('0x8b')](db[_0x8e5d('0x94')]['upsert']({'membername':_0x23cf2d[_0x1dc71e][_0x8e5d('0x36')],'UserId':_0x23cf2d[_0x1dc71e]['id'],'queue_name':_0x4903ba[_0x8e5d('0x36')],'VoiceQueueId':_0x4903ba['id'],'interface':_['isNil'](_0x23cf2d[_0x1dc71e][_0x8e5d('0x70')])?util['format'](_0x8e5d('0x98'),_0x23cf2d[_0x1dc71e][_0x8e5d('0x36')]):_0x23cf2d[_0x1dc71e][_0x8e5d('0x70')],'paused':_0x23cf2d[_0x1dc71e]['voicePause']||![],'penalty':_0x590f2d[_0x8e5d('0x54')]['penalty']||0x0}));}}return BPromise[_0x8e5d('0x8f')](_0x4100c7);}})[_0x8e5d('0x2a')](function(){return _0x4fedf8;})['then'](respondWithResult(_0x6523fa,null))[_0x8e5d('0x4e')](handleError(_0x6523fa,null));};exports[_0x8e5d('0x93')]=function(_0x13bf65,_0x5d3abd,_0x5af294){return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x13bf65['params']['id']}})['then'](handleEntityNotFound(_0x5d3abd,null))[_0x8e5d('0x2a')](function(_0x28f7d2){if(_0x28f7d2){return _0x28f7d2[_0x8e5d('0x93')](_0x13bf65[_0x8e5d('0x3f')][_0x8e5d('0x7e')])[_0x8e5d('0x2a')](function(){if(_['isArray'](_0x13bf65['query']['ids'])){for(var _0x187b86=0x0;_0x187b86<_0x13bf65[_0x8e5d('0x3f')][_0x8e5d('0x7e')]['length'];_0x187b86+=0x1){socket['emit'](_0x8e5d('0x96'),{'UserId':Number(_0x13bf65[_0x8e5d('0x3f')]['ids'][_0x187b86]),'VoiceQueueId':Number(_0x13bf65[_0x8e5d('0x5d')]['id'])});}}else{socket[_0x8e5d('0x95')]('userVoiceQueue:remove',{'UserId':Number(_0x13bf65[_0x8e5d('0x3f')][_0x8e5d('0x7e')]),'VoiceQueueId':Number(_0x13bf65[_0x8e5d('0x5d')]['id'])});}});}})[_0x8e5d('0x2a')](function(_0x5c497a){return db[_0x8e5d('0x94')][_0x8e5d('0x62')]({'where':{'VoiceQueueId':_0x13bf65[_0x8e5d('0x5d')]['id'],'UserId':_0x13bf65[_0x8e5d('0x3f')][_0x8e5d('0x7e')]}})['then'](function(){return _0x5c497a;});})[_0x8e5d('0x2a')](respondWithStatusCode(_0x5d3abd,null))[_0x8e5d('0x4e')](handleError(_0x5d3abd,null));};exports[_0x8e5d('0x99')]=function(_0x181923,_0x399fb0,_0xcf3d40){var _0x535304={};var _0x38d445={};var _0xfb819a;var _0x47b838;return db['VoiceQueue'][_0x8e5d('0x64')]({'where':{'id':_0x181923['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x399fb0,null))['then'](function(_0x127f08){if(_0x127f08){_0xfb819a=_0x127f08;_0x38d445[_0x8e5d('0x3e')]=_['keys'](db[_0x8e5d('0x7f')][_0x8e5d('0x39')]);_0x38d445['query']=_[_0x8e5d('0x50')](_0x181923['query']);_0x38d445[_0x8e5d('0x3c')]=_[_0x8e5d('0x3d')](_0x38d445[_0x8e5d('0x3e')],_0x38d445[_0x8e5d('0x3f')]);_0x535304[_0x8e5d('0x40')]=_['intersection'](_0x38d445[_0x8e5d('0x3e')],qs[_0x8e5d('0x41')](_0x181923[_0x8e5d('0x3f')][_0x8e5d('0x41')]));_0x535304[_0x8e5d('0x40')]=_0x535304[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x535304['attributes']:_0x38d445[_0x8e5d('0x3e')];_0x535304[_0x8e5d('0x45')]=qs[_0x8e5d('0x46')](_0x181923[_0x8e5d('0x3f')]['sort']);_0x535304[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x181923[_0x8e5d('0x3f')],_0x38d445[_0x8e5d('0x3c')]));if(_0x181923[_0x8e5d('0x3f')]['filter']){_0x535304[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0x535304[_0x8e5d('0x49')],{'$or':_[_0x8e5d('0x31')](_0x535304[_0x8e5d('0x40')],function(_0x5088df){var _0xe03f48={};_0xe03f48[_0x5088df]={'$like':'%'+_0x181923[_0x8e5d('0x3f')]['filter']+'%'};return _0xe03f48;})});}_0x535304=_[_0x8e5d('0x4a')]({},_0x535304,_0x181923['options']);return _0xfb819a[_0x8e5d('0x99')](_0x535304);}})[_0x8e5d('0x2a')](function(_0x50835b){if(_0x50835b){_0x47b838=_0x50835b[_0x8e5d('0x42')];if(!_0x181923[_0x8e5d('0x3f')][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x535304['limit']=qs[_0x8e5d('0x44')](_0x181923[_0x8e5d('0x3f')][_0x8e5d('0x44')]);_0x535304[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x181923['query']['offset']);}return _0xfb819a[_0x8e5d('0x99')](_0x535304);}})[_0x8e5d('0x2a')](function(_0x472bf7){if(_0x472bf7){return _0x472bf7?{'count':_0x47b838,'rows':_0x472bf7}:null;}})[_0x8e5d('0x2a')](respondWithResult(_0x399fb0,null))[_0x8e5d('0x4e')](handleError(_0x399fb0,null));};exports[_0x8e5d('0x9a')]=function(_0x2fc58d,_0x1172cf,_0x28a5ea){var _0x23c6b3={};var _0x3cea93={};var _0xabcbcd;var _0x31c988;return db[_0x8e5d('0x4b')][_0x8e5d('0x64')]({'where':{'id':_0x2fc58d[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x1172cf,null))[_0x8e5d('0x2a')](function(_0x45357d){if(_0x45357d){_0xabcbcd=_0x45357d;_0x3cea93[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x94')][_0x8e5d('0x39')]);_0x3cea93[_0x8e5d('0x3f')]=_['keys'](_0x2fc58d[_0x8e5d('0x3f')]);_0x3cea93[_0x8e5d('0x3c')]=_['intersection'](_0x3cea93['model'],_0x3cea93[_0x8e5d('0x3f')]);_0x23c6b3['attributes']=_[_0x8e5d('0x3d')](_0x3cea93[_0x8e5d('0x3e')],qs[_0x8e5d('0x41')](_0x2fc58d['query'][_0x8e5d('0x41')]));_0x23c6b3['attributes']=_0x23c6b3[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x23c6b3[_0x8e5d('0x40')]:_0x3cea93[_0x8e5d('0x3e')];_0x23c6b3[_0x8e5d('0x45')]=qs[_0x8e5d('0x46')](_0x2fc58d['query'][_0x8e5d('0x46')]);_0x23c6b3[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x2fc58d['query'],_0x3cea93['filters']));if(_0x2fc58d['query'][_0x8e5d('0x48')]){_0x23c6b3[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0x23c6b3[_0x8e5d('0x49')],{'$or':_['map'](_0x23c6b3[_0x8e5d('0x40')],function(_0xd22927){var _0x445fd0={};_0x445fd0[_0xd22927]={'$like':'%'+_0x2fc58d[_0x8e5d('0x3f')][_0x8e5d('0x48')]+'%'};return _0x445fd0;})});}_0x23c6b3=_[_0x8e5d('0x4a')]({},_0x23c6b3,_0x2fc58d['options']);return _0xabcbcd[_0x8e5d('0x9a')](_0x23c6b3);}})['then'](function(_0x320f57){if(_0x320f57){_0x31c988=_0x320f57[_0x8e5d('0x42')];if(!_0x2fc58d[_0x8e5d('0x3f')][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x23c6b3[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0x2fc58d['query'][_0x8e5d('0x44')]);_0x23c6b3[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0x2fc58d[_0x8e5d('0x3f')][_0x8e5d('0x24')]);}return _0xabcbcd['getMembers'](_0x23c6b3);}})[_0x8e5d('0x2a')](function(_0x519ab9){return _0x519ab9?{'count':_0x31c988,'rows':_0x519ab9}:null;})['then'](respondWithResult(_0x1172cf,null))[_0x8e5d('0x4e')](handleError(_0x1172cf,null));};exports[_0x8e5d('0x9b')]=function(_0xcef7c8,_0x2522ff,_0x341659){var _0x557820={};var _0x3ec9a7={};var _0x62a77f;var _0x48c9d4;return db['VoiceQueue'][_0x8e5d('0x64')]({'where':{'id':_0xcef7c8[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x2522ff,null))['then'](function(_0x46b747){if(_0x46b747){_0x62a77f=_0x46b747;_0x3ec9a7[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x9c')]['rawAttributes']);_0x3ec9a7[_0x8e5d('0x3f')]=_[_0x8e5d('0x50')](_0xcef7c8[_0x8e5d('0x3f')]);_0x3ec9a7['filters']=_['intersection'](_0x3ec9a7['model'],_0x3ec9a7['query']);_0x557820[_0x8e5d('0x40')]=_['intersection'](_0x3ec9a7[_0x8e5d('0x3e')],qs[_0x8e5d('0x41')](_0xcef7c8['query'][_0x8e5d('0x41')]));_0x557820[_0x8e5d('0x40')]=_0x557820[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x557820[_0x8e5d('0x40')]:_0x3ec9a7[_0x8e5d('0x3e')];_0x557820[_0x8e5d('0x45')]=qs['sort'](_0xcef7c8[_0x8e5d('0x3f')][_0x8e5d('0x46')]);_0x557820[_0x8e5d('0x49')]=qs['filters'](_[_0x8e5d('0x47')](_0xcef7c8['query'],_0x3ec9a7[_0x8e5d('0x3c')]));if(_0xcef7c8[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x557820['where']=_[_0x8e5d('0x4a')](_0x557820[_0x8e5d('0x49')],{'$or':_[_0x8e5d('0x31')](_0x557820[_0x8e5d('0x40')],function(_0x311672){var _0x239ca1={};_0x239ca1[_0x311672]={'$like':'%'+_0xcef7c8[_0x8e5d('0x3f')]['filter']+'%'};return _0x239ca1;})});}_0x557820=_[_0x8e5d('0x4a')]({},_0x557820,_0xcef7c8[_0x8e5d('0x52')]);return _0x62a77f[_0x8e5d('0x9b')](_0x557820);}})['then'](function(_0x1ad8bb){if(_0x1ad8bb){_0x48c9d4=_0x1ad8bb[_0x8e5d('0x42')];if(!_0xcef7c8[_0x8e5d('0x3f')][_0x8e5d('0x43')](_0x8e5d('0x66'))){_0x557820[_0x8e5d('0x44')]=qs[_0x8e5d('0x44')](_0xcef7c8['query'][_0x8e5d('0x44')]);_0x557820[_0x8e5d('0x24')]=qs[_0x8e5d('0x24')](_0xcef7c8[_0x8e5d('0x3f')]['offset']);}return _0x62a77f[_0x8e5d('0x9b')](_0x557820);}})['then'](function(_0x45938c){if(_0x45938c){return _0x45938c?{'count':_0x48c9d4,'rows':_0x45938c}:null;}})['then'](respondWithResult(_0x2522ff,null))[_0x8e5d('0x4e')](handleError(_0x2522ff,null));};exports['addLists']=function(_0x3f9bea,_0x34906c,_0x8772ec){var _0xbcc995,_0x29adaa;return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x3f9bea[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x34906c,null))[_0x8e5d('0x2a')](function(_0x559460){if(_0x559460){_0x29adaa=_0x559460;return _0x559460[_0x8e5d('0x9d')](_0x3f9bea['body'][_0x8e5d('0x7e')],_['omit'](_0x3f9bea[_0x8e5d('0x54')],[_0x8e5d('0x7e'),'id'])||{});}return null;})[_0x8e5d('0x9e')](function(_0x293864){var _0x2b6e5b;_0xbcc995=_0x293864||[];var _0x560f1e=[];if(_0x293864){for(var _0x3553f0=0x0;_0x3553f0<_0x293864['length'];_0x3553f0+=0x1){var _0x1af4a8=_0x293864[_0x3553f0]['get']({'plain':!![]});_0x29adaa[_0x8e5d('0x9f')]=_0x3f9bea[_0x8e5d('0x54')]['dialCheckDuplicateType']?_0x3f9bea['body'][_0x8e5d('0x9f')]:_0x29adaa['dialCheckDuplicateType'];switch(_0x29adaa['dialCheckDuplicateType']){case _0x8e5d('0xa0'):_0x2b6e5b=squel[_0x8e5d('0xa1')]()[_0x8e5d('0xa2')](_0x8e5d('0xa3'))[_0x8e5d('0xa4')](['phone',_0x8e5d('0xa5'),'ContactId',_0x8e5d('0xa6'),'VoiceQueueId',_0x8e5d('0x60'),_0x8e5d('0x61')],squel[_0x8e5d('0x80')]()[_0x8e5d('0x81')](_0x8e5d('0xa7'),_0x8e5d('0xa7'))[_0x8e5d('0x81')]('NOW()',_0x8e5d('0xa5'))[_0x8e5d('0x81')]('id',_0x8e5d('0xa8'))[_0x8e5d('0x81')](_0x1af4a8[_0x8e5d('0xa9')][_0x8e5d('0xaa')](),'ListId')[_0x8e5d('0x81')](_0x3f9bea[_0x8e5d('0x5d')]['id'][_0x8e5d('0xaa')](),_0x8e5d('0x67'))['field']('NOW()',_0x8e5d('0x60'))[_0x8e5d('0x81')](_0x8e5d('0xab'),_0x8e5d('0x61'))[_0x8e5d('0x83')](_0x8e5d('0xac'))[_0x8e5d('0x49')](_0x8e5d('0xad'))[_0x8e5d('0x49')]('ListId\x20=\x20?',_0x1af4a8[_0x8e5d('0xa9')][_0x8e5d('0xaa')]())[_0x8e5d('0x49')](_0x8e5d('0xae'))[_0x8e5d('0x49')](_0x8e5d('0xaf'),squel[_0x8e5d('0x80')]()['field']('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')['where'](_0x8e5d('0xb0'),_0x3f9bea[_0x8e5d('0x5d')]['id']['toString']()))[_0x8e5d('0x49')](_0x8e5d('0xaf'),squel[_0x8e5d('0x80')]()['field'](_0x8e5d('0xb1'))[_0x8e5d('0x83')](_0x8e5d('0xa3'))[_0x8e5d('0x49')](_0x8e5d('0xb0'),_0x3f9bea['params']['id'][_0x8e5d('0xaa')]())))['toString']();break;case _0x8e5d('0xb2'):_0x2b6e5b=squel[_0x8e5d('0xa1')]()[_0x8e5d('0xa2')](_0x8e5d('0xa3'))['fromQuery']([_0x8e5d('0xa7'),_0x8e5d('0xa5'),'ContactId','ListId',_0x8e5d('0x67'),'createdAt',_0x8e5d('0x61')],squel[_0x8e5d('0x80')]()[_0x8e5d('0x81')](_0x8e5d('0xa7'),_0x8e5d('0xa7'))['field'](_0x8e5d('0xab'),_0x8e5d('0xa5'))[_0x8e5d('0x81')]('id',_0x8e5d('0xa8'))[_0x8e5d('0x81')](_0x1af4a8[_0x8e5d('0xa9')]['toString'](),_0x8e5d('0xa6'))[_0x8e5d('0x81')](_0x3f9bea['params']['id']['toString'](),_0x8e5d('0x67'))[_0x8e5d('0x81')]('NOW()',_0x8e5d('0x60'))[_0x8e5d('0x81')]('NOW()',_0x8e5d('0x61'))[_0x8e5d('0x83')](_0x8e5d('0xac'))[_0x8e5d('0x49')](_0x8e5d('0xad'))[_0x8e5d('0x49')](_0x8e5d('0xb3'),_0x1af4a8[_0x8e5d('0xa9')]['toString']())[_0x8e5d('0x49')](_0x8e5d('0xae'))[_0x8e5d('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8e5d('0x80')]()[_0x8e5d('0x81')](_0x8e5d('0xb1'))[_0x8e5d('0x83')](_0x8e5d('0xa3'))[_0x8e5d('0x49')](_0x8e5d('0xb0'),_0x3f9bea[_0x8e5d('0x5d')]['id']['toString']())))[_0x8e5d('0xaa')]();break;default:_0x2b6e5b=squel[_0x8e5d('0xa1')]()[_0x8e5d('0xa2')]('cm_hopper')[_0x8e5d('0xa4')]([_0x8e5d('0xa7'),_0x8e5d('0xa5'),_0x8e5d('0xa8'),_0x8e5d('0xa6'),_0x8e5d('0x67'),_0x8e5d('0x60'),_0x8e5d('0x61')],squel[_0x8e5d('0x80')]()[_0x8e5d('0x81')](_0x8e5d('0xa7'),_0x8e5d('0xa7'))[_0x8e5d('0x81')](_0x8e5d('0xab'),_0x8e5d('0xa5'))[_0x8e5d('0x81')]('id',_0x8e5d('0xa8'))[_0x8e5d('0x81')](_0x1af4a8['CmListId'][_0x8e5d('0xaa')](),_0x8e5d('0xa6'))[_0x8e5d('0x81')](_0x3f9bea['params']['id']['toString'](),_0x8e5d('0x67'))[_0x8e5d('0x81')](_0x8e5d('0xab'),_0x8e5d('0x60'))[_0x8e5d('0x81')](_0x8e5d('0xab'),_0x8e5d('0x61'))[_0x8e5d('0x83')](_0x8e5d('0xac'))[_0x8e5d('0x49')](_0x8e5d('0xad'))[_0x8e5d('0x49')](_0x8e5d('0xb3'),_0x1af4a8[_0x8e5d('0xa9')]['toString']())[_0x8e5d('0x49')](_0x8e5d('0xae')))[_0x8e5d('0xaa')]();}_0x560f1e[_0x8e5d('0x8b')](db[_0x8e5d('0x74')][_0x8e5d('0x3f')](_0x2b6e5b));}return BPromise[_0x8e5d('0x8f')](_0x560f1e);}})[_0x8e5d('0x2a')](function(){return _0xbcc995;})['then'](respondWithResult(_0x34906c,null))[_0x8e5d('0x4e')](handleError(_0x34906c,null));};exports[_0x8e5d('0xb4')]=function(_0x2dafd2,_0x4f29c3,_0x5ec6aa){return db['VoiceQueue'][_0x8e5d('0x35')]({'where':{'id':_0x2dafd2[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x4f29c3,null))[_0x8e5d('0x2a')](function(_0x4850c4){if(_0x4850c4){return _0x4850c4[_0x8e5d('0xb4')](_0x2dafd2['query'][_0x8e5d('0x7e')]);}})[_0x8e5d('0x2a')](function(_0x5914d8){if(_0x5914d8){return db[_0x8e5d('0x65')]['destroy']({'where':{'ListId':_0x2dafd2[_0x8e5d('0x3f')][_0x8e5d('0x7e')],'VoiceQueueId':_0x2dafd2[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](function(){return _0x5914d8;});}})[_0x8e5d('0x2a')](respondWithStatusCode(_0x4f29c3,null))['catch'](handleError(_0x4f29c3,null));};exports[_0x8e5d('0xb5')]=function(_0x185a0d,_0x254f45,_0x5f15e5){var _0x335825={};var _0x2d8944={};var _0x275812;var _0x29e48f;return db[_0x8e5d('0x4b')]['findOne']({'where':{'id':_0x185a0d['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x254f45,null))[_0x8e5d('0x2a')](function(_0x29ce15){if(_0x29ce15){_0x275812=_0x29ce15;_0x2d8944[_0x8e5d('0x3e')]=_[_0x8e5d('0x50')](db[_0x8e5d('0x9c')][_0x8e5d('0x39')]);_0x2d8944[_0x8e5d('0x3f')]=_[_0x8e5d('0x50')](_0x185a0d[_0x8e5d('0x3f')]);_0x2d8944[_0x8e5d('0x3c')]=_['intersection'](_0x2d8944[_0x8e5d('0x3e')],_0x2d8944[_0x8e5d('0x3f')]);_0x335825['attributes']=_[_0x8e5d('0x3d')](_0x2d8944[_0x8e5d('0x3e')],qs[_0x8e5d('0x41')](_0x185a0d['query'][_0x8e5d('0x41')]));_0x335825[_0x8e5d('0x40')]=_0x335825[_0x8e5d('0x40')][_0x8e5d('0x42')]?_0x335825[_0x8e5d('0x40')]:_0x2d8944[_0x8e5d('0x3e')];_0x335825['order']=qs[_0x8e5d('0x46')](_0x185a0d[_0x8e5d('0x3f')]['sort']);_0x335825[_0x8e5d('0x49')]=qs[_0x8e5d('0x3c')](_[_0x8e5d('0x47')](_0x185a0d['query'],_0x2d8944['filters']));if(_0x185a0d[_0x8e5d('0x3f')][_0x8e5d('0x48')]){_0x335825[_0x8e5d('0x49')]=_[_0x8e5d('0x4a')](_0x335825[_0x8e5d('0x49')],{'$or':_['map'](_0x335825[_0x8e5d('0x40')],function(_0x45ede0){var _0x388840={};_0x388840[_0x45ede0]={'$like':'%'+_0x185a0d['query']['filter']+'%'};return _0x388840;})});}_0x335825=_[_0x8e5d('0x4a')]({},_0x335825,_0x185a0d[_0x8e5d('0x52')]);return _0x275812[_0x8e5d('0xb5')](_0x335825);}})[_0x8e5d('0x2a')](function(_0x4f8726){if(_0x4f8726){_0x29e48f=_0x4f8726[_0x8e5d('0x42')];if(!_0x185a0d[_0x8e5d('0x3f')][_0x8e5d('0x43')]('nolimit')){_0x335825[_0x8e5d('0x44')]=qs['limit'](_0x185a0d[_0x8e5d('0x3f')]['limit']);_0x335825['offset']=qs['offset'](_0x185a0d[_0x8e5d('0x3f')][_0x8e5d('0x24')]);}return _0x275812[_0x8e5d('0xb5')](_0x335825);}})[_0x8e5d('0x2a')](function(_0x1f2108){if(_0x1f2108){return _0x1f2108?{'count':_0x29e48f,'rows':_0x1f2108}:null;}})[_0x8e5d('0x2a')](respondWithResult(_0x254f45,null))[_0x8e5d('0x4e')](handleError(_0x254f45,null));};exports[_0x8e5d('0xb6')]=function(_0x360471,_0x3e9326,_0x195c22){var _0x276d9d,_0x273783;return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x360471[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x3e9326,null))[_0x8e5d('0x2a')](function(_0x58c4ad){if(_0x58c4ad){_0x273783=_0x58c4ad;return _0x58c4ad['addBlackLists'](_0x360471[_0x8e5d('0x54')][_0x8e5d('0x7e')],_[_0x8e5d('0x5f')](_0x360471[_0x8e5d('0x54')],[_0x8e5d('0x7e'),'id'])||{});}return null;})[_0x8e5d('0x9e')](function(_0x4748d9){var _0x2fdbae;_0x276d9d=_0x4748d9||[];var _0x717d3b=[];if(_0x4748d9){for(var _0x3bdb31=0x0;_0x3bdb31<_0x4748d9[_0x8e5d('0x42')];_0x3bdb31+=0x1){var _0x432195=_0x4748d9[_0x3bdb31][_0x8e5d('0x2b')]({'plain':!![]});_0x2fdbae=squel['insert']()['into'](_0x8e5d('0xb7'))['fromQuery']([_0x8e5d('0xa7'),_0x8e5d('0xa8'),'ListId',_0x8e5d('0x67'),_0x8e5d('0x60'),_0x8e5d('0x61')],squel[_0x8e5d('0x80')]()[_0x8e5d('0x81')]('phone',_0x8e5d('0xa7'))[_0x8e5d('0x81')]('id',_0x8e5d('0xa8'))[_0x8e5d('0x81')](_0x432195[_0x8e5d('0xa9')][_0x8e5d('0xaa')](),'ListId')[_0x8e5d('0x81')](_0x360471[_0x8e5d('0x5d')]['id']['toString'](),_0x8e5d('0x67'))['field'](_0x8e5d('0xab'),'createdAt')[_0x8e5d('0x81')](_0x8e5d('0xab'),'updatedAt')['from'](_0x8e5d('0xac'))[_0x8e5d('0x49')](_0x8e5d('0xad'))[_0x8e5d('0x49')]('ListId\x20=\x20?',_0x432195[_0x8e5d('0xa9')][_0x8e5d('0xaa')]())[_0x8e5d('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x8e5d('0xaa')]();_0x717d3b['push'](db[_0x8e5d('0x74')]['query'](_0x2fdbae));}return BPromise['all'](_0x717d3b);}})[_0x8e5d('0x2a')](function(){return _0x276d9d;})[_0x8e5d('0x2a')](respondWithResult(_0x3e9326,null))[_0x8e5d('0x4e')](handleError(_0x3e9326,null));};exports['removeBlackLists']=function(_0x2c3994,_0x3362f1,_0x52b102){return db[_0x8e5d('0x4b')][_0x8e5d('0x35')]({'where':{'id':_0x2c3994['params']['id']}})[_0x8e5d('0x2a')](handleEntityNotFound(_0x3362f1,null))[_0x8e5d('0x2a')](function(_0x171a9a){if(_0x171a9a){return _0x171a9a[_0x8e5d('0xb8')](_0x2c3994[_0x8e5d('0x3f')][_0x8e5d('0x7e')]);}})[_0x8e5d('0x2a')](function(_0x59d1be){if(_0x59d1be){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2c3994[_0x8e5d('0x3f')][_0x8e5d('0x7e')],'VoiceQueueId':_0x2c3994[_0x8e5d('0x5d')]['id']}})[_0x8e5d('0x2a')](function(){return _0x59d1be;});}})[_0x8e5d('0x2a')](respondWithStatusCode(_0x3362f1,null))['catch'](handleError(_0x3362f1,null));}; \ No newline at end of file +var _0x6ad4=['rimraf','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','userProfileId','autoAssociation','getHoppers','keys','CmHopper','pick','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','flatMap','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','penalty','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','all','union','compact','isEmpty','UserVoiceQueueRt','forEach','userVoiceQueue:remove','addAgents','spread','online','interface','removeAgents','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','phone','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','removeBlackLists'];(function(_0x2f3757,_0x156a1c){var _0x583d19=function(_0x2517b9){while(--_0x2517b9){_0x2f3757['push'](_0x2f3757['shift']());}};_0x583d19(++_0x156a1c);}(_0x6ad4,0xb8));var _0x46ad=function(_0x47307e,_0x4bfd20){_0x47307e=_0x47307e-0x0;var _0x2640fd=_0x6ad4[_0x47307e];return _0x2640fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46ad('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46ad('0x1'));var rp=require(_0x46ad('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x46ad('0x3'));var csv=require(_0x46ad('0x4'));var ejs=require(_0x46ad('0x5'));var fs=require('fs');var fs_extra=require(_0x46ad('0x6'));var _=require(_0x46ad('0x7'));var squel=require(_0x46ad('0x8'));var crypto=require('crypto');var jsforce=require(_0x46ad('0x9'));var deskjs=require(_0x46ad('0xa'));var toCsv=require(_0x46ad('0x4'));var querystring=require(_0x46ad('0xb'));var Papa=require(_0x46ad('0xc'));var Redis=require(_0x46ad('0xd'));var authService=require(_0x46ad('0xe'));var qs=require(_0x46ad('0xf'));var as=require(_0x46ad('0x10'));var hardwareService=require(_0x46ad('0x11'));var logger=require(_0x46ad('0x12'))(_0x46ad('0x13'));var utils=require(_0x46ad('0x14'));var config=require(_0x46ad('0x15'));var licenseUtil=require(_0x46ad('0x16'));var db=require(_0x46ad('0x17'))['db'];config[_0x46ad('0x18')]=_[_0x46ad('0x19')](config['redis'],{'host':_0x46ad('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46ad('0x18')]));require(_0x46ad('0x1b'))[_0x46ad('0x1c')](socket);function respondWithStatusCode(_0x9deef6,_0x4e47bb){_0x4e47bb=_0x4e47bb||0xcc;return function(_0x143b4e){if(_0x143b4e){return _0x9deef6['sendStatus'](_0x4e47bb);}return _0x9deef6[_0x46ad('0x1d')](_0x4e47bb)['end']();};}function respondWithResult(_0x111d25,_0xd3cc5a){_0xd3cc5a=_0xd3cc5a||0xc8;return function(_0x81fda1){if(_0x81fda1){return _0x111d25[_0x46ad('0x1d')](_0xd3cc5a)[_0x46ad('0x1e')](_0x81fda1);}};}function respondWithFilteredResult(_0x363d27,_0x516b71){return function(_0x12d39f){if(_0x12d39f){var _0x5831c7=typeof _0x516b71[_0x46ad('0x1f')]===_0x46ad('0x20')&&typeof _0x516b71[_0x46ad('0x21')]===_0x46ad('0x20');var _0x17fd1e=_0x12d39f[_0x46ad('0x22')];var _0x4d0ee0=_0x5831c7?0x0:_0x516b71[_0x46ad('0x1f')];var _0x21c1fe=_0x5831c7?_0x12d39f[_0x46ad('0x22')]:_0x516b71[_0x46ad('0x1f')]+_0x516b71[_0x46ad('0x21')];var _0x3640b2;if(_0x21c1fe>=_0x17fd1e){_0x21c1fe=_0x17fd1e;_0x3640b2=0xc8;}else{_0x3640b2=0xce;}_0x363d27[_0x46ad('0x1d')](_0x3640b2);return _0x363d27['set'](_0x46ad('0x23'),_0x4d0ee0+'-'+_0x21c1fe+'/'+_0x17fd1e)['json'](_0x12d39f);}return null;};}function patchUpdates(_0x9b6076){return function(_0x47776f){try{jsonpatch[_0x46ad('0x24')](_0x47776f,_0x9b6076,!![]);}catch(_0x251273){return BPromise[_0x46ad('0x25')](_0x251273);}return _0x47776f[_0x46ad('0x26')]();};}function saveUpdates(_0xf7f370,_0x5060b5){return function(_0xd8a0cb){if(_0xd8a0cb){return _0xd8a0cb[_0x46ad('0x27')](_0xf7f370)[_0x46ad('0x28')](function(_0x159c8b){return _0x159c8b;});}return null;};}function removeEntity(_0x4ecfb7,_0x4e1c49){return function(_0x8627e1){if(_0x8627e1){return _0x8627e1[_0x46ad('0x29')]()[_0x46ad('0x28')](function(){var _0xe61e5c=_0x8627e1[_0x46ad('0x2a')]({'plain':!![]});var _0x2f44f3=[{'name':_0x46ad('0x2b'),'value':_0x46ad('0x2c'),'ignore':![]},{'name':_0x46ad('0x2d'),'value':_0x46ad('0x2e'),'ignore':![]}];var _0x1e24ae=_(_0x2f44f3)[_0x46ad('0x2f')]('ignore')[_0x46ad('0x30')]('value')[_0x46ad('0x31')]();if(_[_0x46ad('0x32')](_0x1e24ae,_0xe61e5c[_0x46ad('0x33')])){return;}var _0x4d0d9e=_[_0x46ad('0x34')](_0x2f44f3,[_0x46ad('0x31'),_0xe61e5c[_0x46ad('0x33')]])[_0x46ad('0x35')];return db[_0x46ad('0x36')][_0x46ad('0x29')]({'where':{'type':_0x4d0d9e,'resourceId':_0xe61e5c['id']}})['then'](function(){return _0x8627e1;});})['then'](function(){_0x4ecfb7[_0x46ad('0x1d')](0xcc)[_0x46ad('0x37')]();});}};}function handleEntityNotFound(_0x5946fa,_0x505b21){return function(_0x384cfd){if(!_0x384cfd){_0x5946fa[_0x46ad('0x38')](0x194);}return _0x384cfd;};}function handleError(_0x5009e,_0x3621c8){_0x3621c8=_0x3621c8||0x1f4;return function(_0x4af8b4){logger[_0x46ad('0x39')](_0x4af8b4[_0x46ad('0x3a')]);if(_0x4af8b4[_0x46ad('0x35')]){delete _0x4af8b4[_0x46ad('0x35')];}_0x5009e[_0x46ad('0x1d')](_0x3621c8)[_0x46ad('0x3b')](_0x4af8b4);};}exports[_0x46ad('0x3c')]=function(_0x43d37b,_0x149761){var _0x28f164={},_0x84cf15={},_0x354130={'count':0x0,'rows':[]};var _0x1edbaa=_[_0x46ad('0x30')](db[_0x46ad('0x3d')][_0x46ad('0x3e')],function(_0x5926c5){return{'name':_0x5926c5['fieldName'],'type':_0x5926c5[_0x46ad('0x33')]['key']};});_0x84cf15[_0x46ad('0x3f')]=_[_0x46ad('0x30')](_0x1edbaa,_0x46ad('0x35'));_0x84cf15[_0x46ad('0x40')]=_['keys'](_0x43d37b[_0x46ad('0x40')]);_0x84cf15[_0x46ad('0x41')]=_[_0x46ad('0x42')](_0x84cf15['model'],_0x84cf15[_0x46ad('0x40')]);_0x28f164[_0x46ad('0x43')]=_['intersection'](_0x84cf15[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x43d37b[_0x46ad('0x40')][_0x46ad('0x44')]));_0x28f164['attributes']=_0x28f164[_0x46ad('0x43')][_0x46ad('0x45')]?_0x28f164[_0x46ad('0x43')]:_0x84cf15[_0x46ad('0x3f')];if(!_0x43d37b['query'][_0x46ad('0x46')](_0x46ad('0x47'))){_0x28f164[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x43d37b[_0x46ad('0x40')][_0x46ad('0x21')]);_0x28f164['offset']=qs[_0x46ad('0x1f')](_0x43d37b[_0x46ad('0x40')][_0x46ad('0x1f')]);}_0x28f164[_0x46ad('0x48')]=qs['sort'](_0x43d37b[_0x46ad('0x40')][_0x46ad('0x49')]);_0x28f164[_0x46ad('0x4a')]=qs[_0x46ad('0x41')](_['pick'](_0x43d37b[_0x46ad('0x40')],_0x84cf15['filters']),_0x1edbaa);if(_0x43d37b[_0x46ad('0x40')]['filter']){_0x28f164[_0x46ad('0x4a')]=_[_0x46ad('0x4b')](_0x28f164[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x1edbaa,function(_0x8b9754){if(_0x8b9754[_0x46ad('0x33')]!==_0x46ad('0x4c')){var _0x217374={};_0x217374[_0x8b9754[_0x46ad('0x35')]]={'$like':'%'+_0x43d37b['query'][_0x46ad('0x2f')]+'%'};return _0x217374;}})});}_0x28f164=_[_0x46ad('0x4b')]({},_0x28f164,_0x43d37b[_0x46ad('0x4d')]);var _0x5195ce={'where':_0x28f164[_0x46ad('0x4a')]};return db[_0x46ad('0x3d')][_0x46ad('0x22')](_0x5195ce)[_0x46ad('0x28')](function(_0x4c3648){_0x354130[_0x46ad('0x22')]=_0x4c3648;if(_0x43d37b[_0x46ad('0x40')][_0x46ad('0x4e')]){_0x28f164[_0x46ad('0x4f')]=[{'all':!![]}];}return db[_0x46ad('0x3d')][_0x46ad('0x50')](_0x28f164);})[_0x46ad('0x28')](function(_0x1a8db4){_0x354130[_0x46ad('0x51')]=_0x1a8db4;return _0x354130;})[_0x46ad('0x28')](respondWithFilteredResult(_0x149761,_0x28f164))[_0x46ad('0x52')](handleError(_0x149761,null));};exports[_0x46ad('0x53')]=function(_0x147916,_0x2ab9ea){var _0x14ce5e={'raw':![],'where':{'id':_0x147916[_0x46ad('0x54')]['id']}},_0x42be17={};_0x42be17[_0x46ad('0x3f')]=_['keys'](db[_0x46ad('0x3d')][_0x46ad('0x3e')]);_0x42be17[_0x46ad('0x40')]=_['keys'](_0x147916[_0x46ad('0x40')]);_0x42be17[_0x46ad('0x41')]=_[_0x46ad('0x42')](_0x42be17[_0x46ad('0x3f')],_0x42be17['query']);_0x14ce5e[_0x46ad('0x43')]=_['intersection'](_0x42be17['model'],qs[_0x46ad('0x44')](_0x147916[_0x46ad('0x40')]['fields']));_0x14ce5e['attributes']=_0x14ce5e['attributes'][_0x46ad('0x45')]?_0x14ce5e[_0x46ad('0x43')]:_0x42be17[_0x46ad('0x3f')];if(_0x147916[_0x46ad('0x40')][_0x46ad('0x4e')]){_0x14ce5e[_0x46ad('0x4f')]=[{'all':!![]}];}_0x14ce5e=_['merge']({},_0x14ce5e,_0x147916[_0x46ad('0x4d')]);return db[_0x46ad('0x3d')]['find'](_0x14ce5e)[_0x46ad('0x28')](handleEntityNotFound(_0x2ab9ea,null))[_0x46ad('0x28')](respondWithResult(_0x2ab9ea,null))[_0x46ad('0x52')](handleError(_0x2ab9ea,null));};exports[_0x46ad('0x55')]=function(_0xf55a4,_0x1b0d30){return db[_0x46ad('0x3d')]['create'](_0xf55a4[_0x46ad('0x56')],{})[_0x46ad('0x28')](function(_0x648e2e){var _0x11fa6d=_0xf55a4[_0x46ad('0x57')][_0x46ad('0x2a')]({'plain':!![]});if(!_0x11fa6d)throw new Error(_0x46ad('0x58'));if(_0x11fa6d['role']===_0x46ad('0x57')){var _0x58e9cd=_0x648e2e[_0x46ad('0x2a')]({'plain':!![]});var _0x1197a9=[{'name':'VoiceQueues','value':_0x46ad('0x2c')},{'name':_0x46ad('0x2d'),'value':_0x46ad('0x2e')}];var _0x14061d=_['find'](_0x1197a9,['value',_0x58e9cd[_0x46ad('0x33')]])[_0x46ad('0x35')];return db['UserProfileSection'][_0x46ad('0x34')]({'where':{'name':_0x14061d,'userProfileId':_0x11fa6d['userProfileId']},'raw':!![]})[_0x46ad('0x28')](function(_0x2121c6){if(_0x2121c6&&_0x2121c6['autoAssociation']===0x0){return db['UserProfileResource'][_0x46ad('0x55')]({'name':_0x58e9cd[_0x46ad('0x35')],'resourceId':_0x58e9cd['id'],'type':_0x2121c6[_0x46ad('0x35')],'sectionId':_0x2121c6['id']},{})[_0x46ad('0x28')](function(){return _0x648e2e;});}else{return _0x648e2e;}})['catch'](function(_0x4323bf){logger[_0x46ad('0x39')](_0x46ad('0x59'),_0x4323bf);throw _0x4323bf;});}return _0x648e2e;})[_0x46ad('0x28')](respondWithResult(_0x1b0d30,0xc9))['catch'](handleError(_0x1b0d30,null));};exports[_0x46ad('0x5a')]=function(_0x359785,_0x23301d){var _0x50c31f={'where':{'id':_0x359785[_0x46ad('0x54')]['id']}},_0xb96a97={};_0xb96a97['model']=_['keys'](db[_0x46ad('0x3d')][_0x46ad('0x3e')]);_0x50c31f[_0x46ad('0x43')]=_[_0x46ad('0x42')](_0xb96a97['model'],qs[_0x46ad('0x44')](_0x359785[_0x46ad('0x40')][_0x46ad('0x44')]));_0x50c31f[_0x46ad('0x43')]=_0x50c31f[_0x46ad('0x43')][_0x46ad('0x45')]?_0x50c31f[_0x46ad('0x43')]:_0xb96a97[_0x46ad('0x3f')];if(_0x359785['query'][_0x46ad('0x4e')]){_0x50c31f['include']=[{'all':!![]}];}_0x50c31f=_[_0x46ad('0x4b')]({},_0x50c31f,_0x359785[_0x46ad('0x4d')]);return db[_0x46ad('0x3d')][_0x46ad('0x34')](_0x50c31f)[_0x46ad('0x28')](handleEntityNotFound(_0x23301d,null))['then'](function(_0x4d47d5){if(_0x4d47d5){var _0x5ad801=_0x4d47d5[_0x46ad('0x2a')]({'plain':!![]});_0x5ad801=qs[_0x46ad('0x5b')](_0x5ad801,['id',_0x46ad('0x5c'),_0x46ad('0x5d')]);_0x359785[_0x46ad('0x56')]=_[_0x46ad('0x5b')](_0x359785[_0x46ad('0x56')],['id',_0x46ad('0x5c'),_0x46ad('0x5d')]);return db['VoiceQueue'][_0x46ad('0x55')](_[_0x46ad('0x4b')](_0x5ad801,_0x359785[_0x46ad('0x56')]),{'include':_0x359785[_0x46ad('0x40')][_0x46ad('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x1c77f6){var _0x5dfcdd=_0x359785[_0x46ad('0x57')][_0x46ad('0x2a')]({'plain':!![]});if(!_0x5dfcdd)throw new Error(_0x46ad('0x58'));if(_0x5dfcdd['role']==='user'){var _0x46a61d=_0x1c77f6[_0x46ad('0x2a')]({'plain':!![]});var _0x37d400=[{'name':_0x46ad('0x2b'),'value':'inbound'},{'name':_0x46ad('0x2d'),'value':_0x46ad('0x2e')}];var _0x85dd08=_['find'](_0x37d400,[_0x46ad('0x31'),_0x46a61d[_0x46ad('0x33')]])['name'];return db[_0x46ad('0x5e')][_0x46ad('0x34')]({'where':{'name':_0x85dd08,'userProfileId':_0x5dfcdd[_0x46ad('0x5f')]},'raw':!![]})[_0x46ad('0x28')](function(_0x219bdc){if(_0x219bdc&&_0x219bdc[_0x46ad('0x60')]===0x0){return db[_0x46ad('0x36')][_0x46ad('0x55')]({'name':_0x46a61d[_0x46ad('0x35')],'resourceId':_0x46a61d['id'],'type':_0x219bdc[_0x46ad('0x35')],'sectionId':_0x219bdc['id']},{})['then'](function(){return _0x1c77f6;});}else{return _0x1c77f6;}})[_0x46ad('0x52')](function(_0x84ccf1){logger['error'](_0x46ad('0x59'),_0x84ccf1);throw _0x84ccf1;});}return _0x1c77f6;});}})[_0x46ad('0x28')](respondWithResult(_0x23301d,0xc9))[_0x46ad('0x52')](handleError(_0x23301d,null));};exports[_0x46ad('0x27')]=function(_0x47cd1e,_0x1ac56a){if(_0x47cd1e['body']['id']){delete _0x47cd1e[_0x46ad('0x56')]['id'];}return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x47cd1e[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x1ac56a,null))[_0x46ad('0x28')](saveUpdates(_0x47cd1e[_0x46ad('0x56')],null))[_0x46ad('0x28')](respondWithResult(_0x1ac56a,null))[_0x46ad('0x52')](handleError(_0x1ac56a,null));};exports['destroy']=function(_0x53f9f4,_0x43b1c4){return db[_0x46ad('0x3d')]['find']({'where':{'id':_0x53f9f4[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x43b1c4,null))[_0x46ad('0x28')](removeEntity(_0x43b1c4,null))[_0x46ad('0x52')](handleError(_0x43b1c4,null));};exports[_0x46ad('0x61')]=function(_0x225827,_0x56b9a0,_0x48bb75){var _0x1fb5da={'raw':![],'where':{}};var _0x3b5fbe={};var _0x2e3138={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x225827[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x56b9a0,null))[_0x46ad('0x28')](function(_0x462cbe){if(_0x462cbe){_0x3b5fbe['model']=_[_0x46ad('0x62')](db[_0x46ad('0x63')][_0x46ad('0x3e')]);_0x3b5fbe[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x225827['query']);_0x3b5fbe[_0x46ad('0x41')]=_[_0x46ad('0x42')](_0x3b5fbe[_0x46ad('0x3f')],_0x3b5fbe['query']);_0x1fb5da['attributes']=_[_0x46ad('0x42')](_0x3b5fbe[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x225827[_0x46ad('0x40')][_0x46ad('0x44')]));_0x1fb5da[_0x46ad('0x43')]=_0x1fb5da[_0x46ad('0x43')]['length']?_0x1fb5da[_0x46ad('0x43')]:_0x3b5fbe['model'];if(!_0x225827[_0x46ad('0x40')][_0x46ad('0x46')]('nolimit')){_0x1fb5da[_0x46ad('0x21')]=qs['limit'](_0x225827[_0x46ad('0x40')]['limit']);_0x1fb5da['offset']=qs[_0x46ad('0x1f')](_0x225827['query'][_0x46ad('0x1f')]);}_0x1fb5da['order']=qs[_0x46ad('0x49')](_0x225827[_0x46ad('0x40')]['sort']);_0x1fb5da['where']=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0x225827[_0x46ad('0x40')],_0x3b5fbe[_0x46ad('0x41')]));_0x1fb5da['where']['VoiceQueueId']=_0x462cbe['id'];if(_0x225827[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x1fb5da['where']=_[_0x46ad('0x4b')](_0x1fb5da[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x1fb5da[_0x46ad('0x43')],function(_0x18088f){var _0x76aa4d={};_0x76aa4d[_0x18088f]={'$like':'%'+_0x225827[_0x46ad('0x40')]['filter']+'%'};return _0x76aa4d;})});}_0x1fb5da=_[_0x46ad('0x4b')]({},_0x1fb5da,_0x225827[_0x46ad('0x4d')]);return db['CmHopper'][_0x46ad('0x22')]({'where':_0x1fb5da[_0x46ad('0x4a')]})[_0x46ad('0x28')](function(_0x278da3){_0x2e3138[_0x46ad('0x22')]=_0x278da3;if(_0x225827[_0x46ad('0x40')][_0x46ad('0x4e')]){_0x1fb5da[_0x46ad('0x4f')]=[{'all':!![]}];}return db[_0x46ad('0x63')][_0x46ad('0x50')](_0x1fb5da);})[_0x46ad('0x28')](function(_0x4b41c1){_0x2e3138[_0x46ad('0x51')]=_0x4b41c1;return _0x2e3138;});}})['then'](respondWithFilteredResult(_0x56b9a0,_0x1fb5da))[_0x46ad('0x52')](handleError(_0x56b9a0,null));};exports[_0x46ad('0x65')]=function(_0x4ded51,_0x129858,_0x2edf9c){var _0x45bc7b={'raw':!![],'where':{}};var _0xeb9dbf={};var _0x435216={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x46ad('0x66')]({'where':{'id':_0x4ded51[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x129858,null))[_0x46ad('0x28')](function(_0xa2b9e0){if(_0xa2b9e0){_0xeb9dbf[_0x46ad('0x3f')]=_['keys'](db[_0x46ad('0x67')][_0x46ad('0x3e')]);_0xeb9dbf[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x4ded51['query']);_0xeb9dbf[_0x46ad('0x41')]=_['intersection'](_0xeb9dbf[_0x46ad('0x3f')],_0xeb9dbf[_0x46ad('0x40')]);_0x45bc7b['attributes']=_[_0x46ad('0x42')](_0xeb9dbf[_0x46ad('0x3f')],qs['fields'](_0x4ded51[_0x46ad('0x40')][_0x46ad('0x44')]));_0x45bc7b[_0x46ad('0x43')]=_0x45bc7b[_0x46ad('0x43')][_0x46ad('0x45')]?_0x45bc7b['attributes']:_0xeb9dbf[_0x46ad('0x3f')];if(!_0x4ded51[_0x46ad('0x40')]['hasOwnProperty']('nolimit')){_0x45bc7b[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x4ded51[_0x46ad('0x40')][_0x46ad('0x21')]);_0x45bc7b[_0x46ad('0x1f')]=qs[_0x46ad('0x1f')](_0x4ded51[_0x46ad('0x40')][_0x46ad('0x1f')]);}_0x45bc7b[_0x46ad('0x48')]=qs[_0x46ad('0x49')](_0x4ded51[_0x46ad('0x40')][_0x46ad('0x49')]);_0x45bc7b['where']=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0x4ded51[_0x46ad('0x40')],_0xeb9dbf['filters']));_0x45bc7b[_0x46ad('0x4a')][_0x46ad('0x68')]=_0xa2b9e0['id'];if(_0x4ded51[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x45bc7b[_0x46ad('0x4a')]=_[_0x46ad('0x4b')](_0x45bc7b['where'],{'$or':_[_0x46ad('0x30')](_0x45bc7b[_0x46ad('0x43')],function(_0x430806){var _0x5c28a3={};_0x5c28a3[_0x430806]={'$like':'%'+_0x4ded51[_0x46ad('0x40')][_0x46ad('0x2f')]+'%'};return _0x5c28a3;})});}_0x45bc7b=_['merge']({},_0x45bc7b,_0x4ded51[_0x46ad('0x4d')]);return db[_0x46ad('0x67')][_0x46ad('0x22')]({'where':_0x45bc7b[_0x46ad('0x4a')]})[_0x46ad('0x28')](function(_0x2d30fe){_0x435216[_0x46ad('0x22')]=_0x2d30fe;if(_0x4ded51['query'][_0x46ad('0x4e')]){_0x45bc7b[_0x46ad('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x46ad('0x50')](_0x45bc7b);})[_0x46ad('0x28')](function(_0x3495a9){_0x435216[_0x46ad('0x51')]=_0x3495a9;return _0x435216;});}})[_0x46ad('0x28')](respondWithFilteredResult(_0x129858,_0x45bc7b))['catch'](handleError(_0x129858,null));};exports['getHopperFinals']=function(_0x341b9d,_0x16ab00,_0xf057a5){var _0x596a71={'raw':!![],'where':{}};var _0x1257c9={};var _0x19cc49={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x341b9d[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x16ab00,null))['then'](function(_0x1a82aa){if(_0x1a82aa){_0x1257c9['model']=_[_0x46ad('0x62')](db[_0x46ad('0x69')][_0x46ad('0x3e')]);_0x1257c9[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x341b9d[_0x46ad('0x40')]);_0x1257c9[_0x46ad('0x41')]=_['intersection'](_0x1257c9['model'],_0x1257c9[_0x46ad('0x40')]);_0x596a71[_0x46ad('0x43')]=_['intersection'](_0x1257c9[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x341b9d[_0x46ad('0x40')]['fields']));_0x596a71['attributes']=_0x596a71[_0x46ad('0x43')][_0x46ad('0x45')]?_0x596a71[_0x46ad('0x43')]:_0x1257c9['model'];if(!_0x341b9d['query'][_0x46ad('0x46')](_0x46ad('0x47'))){_0x596a71[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x341b9d[_0x46ad('0x40')]['limit']);_0x596a71[_0x46ad('0x1f')]=qs[_0x46ad('0x1f')](_0x341b9d[_0x46ad('0x40')][_0x46ad('0x1f')]);}_0x596a71['order']=qs[_0x46ad('0x49')](_0x341b9d[_0x46ad('0x40')][_0x46ad('0x49')]);_0x596a71['where']=qs['filters'](_[_0x46ad('0x64')](_0x341b9d[_0x46ad('0x40')],_0x1257c9['filters']));_0x596a71[_0x46ad('0x4a')]['VoiceQueueId']=_0x1a82aa['id'];if(_0x341b9d[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x596a71['where']=_[_0x46ad('0x4b')](_0x596a71[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x596a71[_0x46ad('0x43')],function(_0x461591){var _0x41ea24={};_0x41ea24[_0x461591]={'$like':'%'+_0x341b9d[_0x46ad('0x40')][_0x46ad('0x2f')]+'%'};return _0x41ea24;})});}_0x596a71=_['merge']({},_0x596a71,_0x341b9d['options']);return db[_0x46ad('0x69')][_0x46ad('0x22')]({'where':_0x596a71[_0x46ad('0x4a')]})[_0x46ad('0x28')](function(_0x4c71d6){_0x19cc49['count']=_0x4c71d6;if(_0x341b9d['query'][_0x46ad('0x4e')]){_0x596a71[_0x46ad('0x4f')]=[{'all':!![]}];}return db[_0x46ad('0x69')][_0x46ad('0x50')](_0x596a71);})[_0x46ad('0x28')](function(_0xfe7b05){_0x19cc49[_0x46ad('0x51')]=_0xfe7b05;return _0x19cc49;});}})['then'](respondWithFilteredResult(_0x16ab00,_0x596a71))[_0x46ad('0x52')](handleError(_0x16ab00,null));};exports[_0x46ad('0x6a')]=function(_0x4a7c84,_0x522134,_0x4eae98){var _0x1f7c10={'raw':!![],'where':{}};var _0x3666a0={};var _0x4197bf={'count':0x0,'rows':[]};return db[_0x46ad('0x3d')]['findOne']({'where':{'id':_0x4a7c84[_0x46ad('0x54')]['id']}})['then'](handleEntityNotFound(_0x522134,null))[_0x46ad('0x28')](function(_0x4e030c){if(_0x4e030c){_0x3666a0['model']=_[_0x46ad('0x62')](db['CmHopperBlack'][_0x46ad('0x3e')]);_0x3666a0[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x4a7c84[_0x46ad('0x40')]);_0x3666a0[_0x46ad('0x41')]=_['intersection'](_0x3666a0[_0x46ad('0x3f')],_0x3666a0[_0x46ad('0x40')]);_0x1f7c10[_0x46ad('0x43')]=_[_0x46ad('0x42')](_0x3666a0['model'],qs[_0x46ad('0x44')](_0x4a7c84[_0x46ad('0x40')]['fields']));_0x1f7c10['attributes']=_0x1f7c10['attributes'][_0x46ad('0x45')]?_0x1f7c10[_0x46ad('0x43')]:_0x3666a0[_0x46ad('0x3f')];if(!_0x4a7c84[_0x46ad('0x40')][_0x46ad('0x46')](_0x46ad('0x47'))){_0x1f7c10[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x4a7c84['query'][_0x46ad('0x21')]);_0x1f7c10[_0x46ad('0x1f')]=qs['offset'](_0x4a7c84['query']['offset']);}_0x1f7c10[_0x46ad('0x48')]=qs['sort'](_0x4a7c84[_0x46ad('0x40')]['sort']);_0x1f7c10['where']=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0x4a7c84['query'],_0x3666a0['filters']));_0x1f7c10[_0x46ad('0x4a')][_0x46ad('0x68')]=_0x4e030c['id'];if(_0x4a7c84['query']['filter']){_0x1f7c10[_0x46ad('0x4a')]=_[_0x46ad('0x4b')](_0x1f7c10[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x1f7c10[_0x46ad('0x43')],function(_0x639c60){var _0x3b9482={};_0x3b9482[_0x639c60]={'$like':'%'+_0x4a7c84[_0x46ad('0x40')][_0x46ad('0x2f')]+'%'};return _0x3b9482;})});}_0x1f7c10=_[_0x46ad('0x4b')]({},_0x1f7c10,_0x4a7c84[_0x46ad('0x4d')]);return db['CmHopperBlack']['count']({'where':_0x1f7c10['where']})[_0x46ad('0x28')](function(_0x3badb7){_0x4197bf[_0x46ad('0x22')]=_0x3badb7;if(_0x4a7c84[_0x46ad('0x40')][_0x46ad('0x4e')]){_0x1f7c10['include']=[{'all':!![]}];}return db[_0x46ad('0x6b')][_0x46ad('0x50')](_0x1f7c10);})['then'](function(_0x2e5573){_0x4197bf[_0x46ad('0x51')]=_0x2e5573;return _0x4197bf;});}})['then'](respondWithFilteredResult(_0x522134,_0x1f7c10))['catch'](handleError(_0x522134,null));};exports[_0x46ad('0x6c')]=function(_0x22ef02,_0x4ffe17,_0x4b8f22){var _0x106e4c={};var _0x2b8f4d={};var _0x2eabad;var _0x2c40ba;return db[_0x46ad('0x3d')]['findOne']({'where':{'id':_0x22ef02['params']['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x4ffe17,null))[_0x46ad('0x28')](function(_0x45178b){if(_0x45178b){_0x2eabad=_0x45178b;_0x2b8f4d[_0x46ad('0x3f')]=_['keys'](db['Team'][_0x46ad('0x3e')]);_0x2b8f4d['query']=_[_0x46ad('0x62')](_0x22ef02[_0x46ad('0x40')]);_0x2b8f4d[_0x46ad('0x41')]=_['intersection'](_0x2b8f4d['model'],_0x2b8f4d['query']);_0x106e4c[_0x46ad('0x43')]=_[_0x46ad('0x42')](_0x2b8f4d[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x22ef02[_0x46ad('0x40')]['fields']));_0x106e4c[_0x46ad('0x43')]=_0x106e4c[_0x46ad('0x43')][_0x46ad('0x45')]?_0x106e4c['attributes']:_0x2b8f4d[_0x46ad('0x3f')];_0x106e4c[_0x46ad('0x48')]=qs[_0x46ad('0x49')](_0x22ef02[_0x46ad('0x40')][_0x46ad('0x49')]);_0x106e4c[_0x46ad('0x4a')]=qs[_0x46ad('0x41')](_['pick'](_0x22ef02['query'],_0x2b8f4d[_0x46ad('0x41')]));if(_0x22ef02[_0x46ad('0x40')]['filter']){_0x106e4c[_0x46ad('0x4a')]=_[_0x46ad('0x4b')](_0x106e4c['where'],{'$or':_[_0x46ad('0x30')](_0x106e4c[_0x46ad('0x43')],function(_0x459dd0){var _0x359325={};_0x359325[_0x459dd0]={'$like':'%'+_0x22ef02['query'][_0x46ad('0x2f')]+'%'};return _0x359325;})});}_0x106e4c=_[_0x46ad('0x4b')]({},_0x106e4c,_0x22ef02[_0x46ad('0x4d')]);return _0x2eabad['getTeams'](_0x106e4c);}})[_0x46ad('0x28')](function(_0x1eed63){if(_0x1eed63){_0x2c40ba=_0x1eed63[_0x46ad('0x45')];if(!_0x22ef02[_0x46ad('0x40')][_0x46ad('0x46')](_0x46ad('0x47'))){_0x106e4c[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x22ef02[_0x46ad('0x40')]['limit']);_0x106e4c[_0x46ad('0x1f')]=qs['offset'](_0x22ef02['query'][_0x46ad('0x1f')]);}return _0x2eabad[_0x46ad('0x6c')](_0x106e4c);}})['then'](function(_0xd63497){if(_0xd63497){return _0xd63497?{'count':_0x2c40ba,'rows':_0xd63497}:null;}})['then'](respondWithResult(_0x4ffe17,null))[_0x46ad('0x52')](handleError(_0x4ffe17,null));};exports[_0x46ad('0x6d')]=function(_0x995bd0,_0x944129,_0x424814){var _0x19e47f=_0x995bd0[_0x46ad('0x56')][_0x46ad('0x6e')];var _0x42bb42=_['map'](_0x19e47f,'id');return db[_0x46ad('0x6f')][_0x46ad('0x50')]({'where':{'id':_0x42bb42},'attributes':['id'],'include':[{'model':db[_0x46ad('0x70')],'as':'Agents','attributes':['id',_0x46ad('0x35'),'online','voicePause','interface'],'raw':!![]}]})[_0x46ad('0x28')](function(_0x326f56){if(_0x326f56){var _0x1dcddb=_[_0x46ad('0x71')](_0x326f56,function(_0x3900b1){var _0x34c42b=_0x3900b1[_0x46ad('0x2a')]({'plain':!![]});_0x34c42b['Agents']['forEach'](function(_0x2997a1){_0x2997a1['penalty']=_[_0x46ad('0x34')](_0x19e47f,{'id':_0x34c42b['id']})['penalty'];});return _0x34c42b[_0x46ad('0x72')];});return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x995bd0[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](function(_0x4f9753){return db[_0x46ad('0x73')][_0x46ad('0x74')](function(_0x376ebf){return _0x4f9753['addTeams'](_0x42bb42,{'transaction':_0x376ebf})[_0x46ad('0x28')](function(){return BPromise[_0x46ad('0x75')](_0x19e47f,function(_0x3beefb){return db[_0x46ad('0x76')][_0x46ad('0x77')]({'TeamId':_0x3beefb['id'],'VoiceQueueId':_0x995bd0[_0x46ad('0x54')]['id'],'penalty':_0x3beefb['penalty']},{'transaction':_0x376ebf});});})[_0x46ad('0x28')](function(){return BPromise['each'](_0x1dcddb,function(_0x563c9e){return db[_0x46ad('0x78')][_0x46ad('0x79')]({'where':{'UserId':_0x563c9e['id'],'VoiceQueueId':_0x995bd0[_0x46ad('0x54')]['id']},'defaults':{'penalty':_0x563c9e[_0x46ad('0x7a')]},'transaction':_0x376ebf});});})[_0x46ad('0x28')](function(){return BPromise[_0x46ad('0x75')](_['filter'](_0x1dcddb,{'online':!![]}),function(_0x2388eb){return db['UserVoiceQueueRt']['upsert']({'membername':_0x2388eb[_0x46ad('0x35')],'UserId':_0x2388eb['id'],'queue_name':_0x4f9753[_0x46ad('0x35')],'VoiceQueueId':_0x4f9753['id'],'interface':_[_0x46ad('0x7b')](_0x2388eb['interface'])?util[_0x46ad('0x7c')](_0x46ad('0x7d'),_0x2388eb[_0x46ad('0x35')]):_0x2388eb['interface'],'paused':_0x2388eb[_0x46ad('0x7e')]||![],'penalty':_0x2388eb[_0x46ad('0x7a')]},{'transaction':_0x376ebf});});})[_0x46ad('0x28')](function(){_0x1dcddb['forEach'](function(_0x131988){socket[_0x46ad('0x7f')](_0x46ad('0x80'),{'UserId':_0x131988['id'],'VoiceQueueId':_0x4f9753['id']});});});});});}})[_0x46ad('0x28')](respondWithStatusCode(_0x944129,null))[_0x46ad('0x52')](handleError(_0x944129,null));};exports[_0x46ad('0x81')]=function(_0xc546f,_0x49652c,_0xf8cb0f){return db[_0x46ad('0x6f')][_0x46ad('0x50')]({'where':{'id':_0xc546f['query'][_0x46ad('0x82')]},'attributes':['id'],'include':[{'model':db[_0x46ad('0x70')],'as':_0x46ad('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x49652c,null))[_0x46ad('0x28')](function(_0x41b261){var _0x41a184=_[_0x46ad('0x30')](_0x41b261,'id');var _0x1684d1=[];var _0x33c7a5=[];var _0x1e9e83=squel[_0x46ad('0x83')]();_0x1e9e83[_0x46ad('0x84')]('tq.TeamId')[_0x46ad('0x85')](_0x46ad('0x86'),'tq')[_0x46ad('0x87')](_0x46ad('0x88'),'ut',_0x46ad('0x89'))['where'](_0x46ad('0x8a'),_0xc546f[_0x46ad('0x54')]['id']);for(var _0x42cfe4=0x0;_0x42cfe4<_0x41b261[_0x46ad('0x45')];_0x42cfe4+=0x1){let _0x2ba878=_0x41b261[_0x42cfe4];for(var _0x15b4fd=0x0;_0x15b4fd<_0x2ba878[_0x46ad('0x72')][_0x46ad('0x45')];_0x15b4fd+=0x1){let _0x1dd239=_0x2ba878[_0x46ad('0x72')][_0x15b4fd];var _0x59560b=_0x1e9e83[_0x46ad('0x5a')]();_0x59560b[_0x46ad('0x4a')](_0x46ad('0x8b'),_0x1dd239['id']);_0x33c7a5[_0x46ad('0x8c')](db['sequelize']['query'](_0x59560b[_0x46ad('0x8d')](),{'type':db[_0x46ad('0x73')]['QueryTypes'][_0x46ad('0x8e')]})['then'](function(_0x50bc66){if(_0x50bc66[_0x46ad('0x45')]===0x1){return _0x1dd239['id'];}else{var _0x251dc2=_[_0x46ad('0x8f')](_[_0x46ad('0x30')](_0x50bc66,'TeamId'),function(_0x48dfea){return _[_0x46ad('0x32')](_0x41a184,_0x48dfea);});if(_0x251dc2){return _0x1dd239['id'];}}}));}}return BPromise[_0x46ad('0x90')](_0x33c7a5)[_0x46ad('0x28')](function(_0x4e1882){_0x1684d1=_(_0x1684d1)[_0x46ad('0x91')](_0x4e1882)[_0x46ad('0x92')]()['value']();return db[_0x46ad('0x3d')]['find']({'where':{'id':_0xc546f[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](function(_0x2d2324){return db['sequelize'][_0x46ad('0x74')](function(_0x3d24de){return _0x2d2324['removeTeams'](_0xc546f['query']['ids'],{'transaction':_0x3d24de})[_0x46ad('0x28')](function(){if(!_[_0x46ad('0x93')](_0x1684d1)){return _0x2d2324['removeAgents'](_0x1684d1,{'transaction':_0x3d24de})[_0x46ad('0x28')](function(){return db[_0x46ad('0x94')][_0x46ad('0x29')]({'where':{'VoiceQueueId':_0xc546f['params']['id'],'UserId':_0x1684d1},'transaction':_0x3d24de});});}})[_0x46ad('0x28')](function(){_0x1684d1[_0x46ad('0x95')](function(_0x55e2b5){socket[_0x46ad('0x7f')](_0x46ad('0x96'),{'UserId':_0x55e2b5,'VoiceQueueId':_0x2d2324['id']});});});});});});})[_0x46ad('0x28')](respondWithStatusCode(_0x49652c,null))[_0x46ad('0x52')](handleError(_0x49652c,null));};exports[_0x46ad('0x97')]=function(_0x3de112,_0x502856,_0x3d901f){var _0x112ec1,_0x45fca4;return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x3de112['params']['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x502856,null))[_0x46ad('0x28')](function(_0x22f226){if(_0x22f226){_0x45fca4=_0x22f226;return _0x22f226['addAgents'](_0x3de112[_0x46ad('0x56')][_0x46ad('0x82')],_[_0x46ad('0x5b')](_0x3de112['body'],['ids','id'])||{})[_0x46ad('0x98')](function(_0x1f8f52){for(var _0x31467e=0x0;_0x31467e<_0x3de112[_0x46ad('0x56')]['ids'][_0x46ad('0x45')];_0x31467e+=0x1){socket[_0x46ad('0x7f')](_0x46ad('0x80'),{'UserId':Number(_0x3de112[_0x46ad('0x56')][_0x46ad('0x82')][_0x31467e]),'VoiceQueueId':Number(_0x3de112[_0x46ad('0x54')]['id'])});}return _0x1f8f52;});}})[_0x46ad('0x28')](function(_0x347168){_0x112ec1=_0x347168||[];if(_0x45fca4){return db[_0x46ad('0x70')][_0x46ad('0x50')]({'where':{'id':_0x3de112[_0x46ad('0x56')]['ids']},'attributes':['id','name',_0x46ad('0x99'),'voicePause',_0x46ad('0x9a')],'raw':!![]});}})[_0x46ad('0x28')](function(_0x2ed2c7){if(!_[_0x46ad('0x93')](_0x2ed2c7)){var _0x54d405=[];for(var _0x472fef=0x0;_0x472fef<_0x2ed2c7['length'];_0x472fef++){if(_0x2ed2c7[_0x472fef]['online']){_0x54d405[_0x46ad('0x8c')](db[_0x46ad('0x94')]['upsert']({'membername':_0x2ed2c7[_0x472fef][_0x46ad('0x35')],'UserId':_0x2ed2c7[_0x472fef]['id'],'queue_name':_0x45fca4[_0x46ad('0x35')],'VoiceQueueId':_0x45fca4['id'],'interface':_[_0x46ad('0x7b')](_0x2ed2c7[_0x472fef][_0x46ad('0x9a')])?util[_0x46ad('0x7c')](_0x46ad('0x7d'),_0x2ed2c7[_0x472fef][_0x46ad('0x35')]):_0x2ed2c7[_0x472fef]['interface'],'paused':_0x2ed2c7[_0x472fef][_0x46ad('0x7e')]||![],'penalty':_0x3de112[_0x46ad('0x56')][_0x46ad('0x7a')]||0x0}));}}return BPromise[_0x46ad('0x90')](_0x54d405);}})[_0x46ad('0x28')](function(){return _0x112ec1;})[_0x46ad('0x28')](respondWithResult(_0x502856,null))[_0x46ad('0x52')](handleError(_0x502856,null));};exports[_0x46ad('0x9b')]=function(_0x4360c0,_0x4ea2fe,_0x4c5b74){return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x4360c0[_0x46ad('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ea2fe,null))['then'](function(_0x224658){if(_0x224658){return _0x224658[_0x46ad('0x9b')](_0x4360c0[_0x46ad('0x40')][_0x46ad('0x82')])[_0x46ad('0x28')](function(){if(_['isArray'](_0x4360c0[_0x46ad('0x40')][_0x46ad('0x82')])){for(var _0x355946=0x0;_0x355946<_0x4360c0[_0x46ad('0x40')][_0x46ad('0x82')]['length'];_0x355946+=0x1){socket[_0x46ad('0x7f')]('userVoiceQueue:remove',{'UserId':Number(_0x4360c0[_0x46ad('0x40')][_0x46ad('0x82')][_0x355946]),'VoiceQueueId':Number(_0x4360c0['params']['id'])});}}else{socket[_0x46ad('0x7f')](_0x46ad('0x96'),{'UserId':Number(_0x4360c0['query']['ids']),'VoiceQueueId':Number(_0x4360c0[_0x46ad('0x54')]['id'])});}});}})[_0x46ad('0x28')](function(_0xee0112){return db[_0x46ad('0x94')][_0x46ad('0x29')]({'where':{'VoiceQueueId':_0x4360c0[_0x46ad('0x54')]['id'],'UserId':_0x4360c0[_0x46ad('0x40')]['ids']}})['then'](function(){return _0xee0112;});})[_0x46ad('0x28')](respondWithStatusCode(_0x4ea2fe,null))[_0x46ad('0x52')](handleError(_0x4ea2fe,null));};exports[_0x46ad('0x9c')]=function(_0x2486db,_0x2d440d,_0xe56e60){var _0x51442b={};var _0x160fdb={};var _0x18f18e;var _0x58f292;return db['VoiceQueue'][_0x46ad('0x66')]({'where':{'id':_0x2486db[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x2d440d,null))[_0x46ad('0x28')](function(_0x48dcfa){if(_0x48dcfa){_0x18f18e=_0x48dcfa;_0x160fdb['model']=_['keys'](db['User'][_0x46ad('0x3e')]);_0x160fdb[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x2486db[_0x46ad('0x40')]);_0x160fdb[_0x46ad('0x41')]=_[_0x46ad('0x42')](_0x160fdb[_0x46ad('0x3f')],_0x160fdb[_0x46ad('0x40')]);_0x51442b[_0x46ad('0x43')]=_[_0x46ad('0x42')](_0x160fdb[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x2486db[_0x46ad('0x40')][_0x46ad('0x44')]));_0x51442b['attributes']=_0x51442b[_0x46ad('0x43')][_0x46ad('0x45')]?_0x51442b[_0x46ad('0x43')]:_0x160fdb[_0x46ad('0x3f')];_0x51442b[_0x46ad('0x48')]=qs[_0x46ad('0x49')](_0x2486db['query']['sort']);_0x51442b[_0x46ad('0x4a')]=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0x2486db[_0x46ad('0x40')],_0x160fdb[_0x46ad('0x41')]));if(_0x2486db[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x51442b[_0x46ad('0x4a')]=_['merge'](_0x51442b[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x51442b[_0x46ad('0x43')],function(_0x22fab3){var _0x5b707d={};_0x5b707d[_0x22fab3]={'$like':'%'+_0x2486db['query']['filter']+'%'};return _0x5b707d;})});}_0x51442b=_[_0x46ad('0x4b')]({},_0x51442b,_0x2486db[_0x46ad('0x4d')]);return _0x18f18e[_0x46ad('0x9c')](_0x51442b);}})['then'](function(_0x22b752){if(_0x22b752){_0x58f292=_0x22b752[_0x46ad('0x45')];if(!_0x2486db['query'][_0x46ad('0x46')]('nolimit')){_0x51442b[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x2486db[_0x46ad('0x40')][_0x46ad('0x21')]);_0x51442b[_0x46ad('0x1f')]=qs[_0x46ad('0x1f')](_0x2486db[_0x46ad('0x40')][_0x46ad('0x1f')]);}return _0x18f18e[_0x46ad('0x9c')](_0x51442b);}})[_0x46ad('0x28')](function(_0x436cec){if(_0x436cec){return _0x436cec?{'count':_0x58f292,'rows':_0x436cec}:null;}})[_0x46ad('0x28')](respondWithResult(_0x2d440d,null))[_0x46ad('0x52')](handleError(_0x2d440d,null));};exports[_0x46ad('0x9d')]=function(_0x15ad56,_0x21e99e,_0x25c29d){var _0x421687={};var _0x4ca434={};var _0x239cf7;var _0x4cf79f;return db[_0x46ad('0x3d')][_0x46ad('0x66')]({'where':{'id':_0x15ad56[_0x46ad('0x54')]['id']}})['then'](handleEntityNotFound(_0x21e99e,null))['then'](function(_0x15f8f8){if(_0x15f8f8){_0x239cf7=_0x15f8f8;_0x4ca434[_0x46ad('0x3f')]=_[_0x46ad('0x62')](db[_0x46ad('0x94')]['rawAttributes']);_0x4ca434[_0x46ad('0x40')]=_[_0x46ad('0x62')](_0x15ad56[_0x46ad('0x40')]);_0x4ca434['filters']=_['intersection'](_0x4ca434['model'],_0x4ca434['query']);_0x421687['attributes']=_['intersection'](_0x4ca434[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x15ad56[_0x46ad('0x40')][_0x46ad('0x44')]));_0x421687[_0x46ad('0x43')]=_0x421687[_0x46ad('0x43')]['length']?_0x421687[_0x46ad('0x43')]:_0x4ca434[_0x46ad('0x3f')];_0x421687['order']=qs[_0x46ad('0x49')](_0x15ad56[_0x46ad('0x40')][_0x46ad('0x49')]);_0x421687['where']=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0x15ad56[_0x46ad('0x40')],_0x4ca434[_0x46ad('0x41')]));if(_0x15ad56[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x421687['where']=_[_0x46ad('0x4b')](_0x421687[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x421687[_0x46ad('0x43')],function(_0x4b7e27){var _0xd95fc2={};_0xd95fc2[_0x4b7e27]={'$like':'%'+_0x15ad56[_0x46ad('0x40')]['filter']+'%'};return _0xd95fc2;})});}_0x421687=_['merge']({},_0x421687,_0x15ad56[_0x46ad('0x4d')]);return _0x239cf7[_0x46ad('0x9d')](_0x421687);}})[_0x46ad('0x28')](function(_0x4b55d7){if(_0x4b55d7){_0x4cf79f=_0x4b55d7[_0x46ad('0x45')];if(!_0x15ad56[_0x46ad('0x40')][_0x46ad('0x46')](_0x46ad('0x47'))){_0x421687[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x15ad56['query'][_0x46ad('0x21')]);_0x421687['offset']=qs[_0x46ad('0x1f')](_0x15ad56[_0x46ad('0x40')][_0x46ad('0x1f')]);}return _0x239cf7[_0x46ad('0x9d')](_0x421687);}})[_0x46ad('0x28')](function(_0x375d06){return _0x375d06?{'count':_0x4cf79f,'rows':_0x375d06}:null;})[_0x46ad('0x28')](respondWithResult(_0x21e99e,null))[_0x46ad('0x52')](handleError(_0x21e99e,null));};exports[_0x46ad('0x9e')]=function(_0x3e2fcc,_0x4111ca,_0x17b653){var _0x3271d8={};var _0x3687c9={};var _0x57c960;var _0x4045c7;return db[_0x46ad('0x3d')]['findOne']({'where':{'id':_0x3e2fcc['params']['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x4111ca,null))[_0x46ad('0x28')](function(_0x1f8cd2){if(_0x1f8cd2){_0x57c960=_0x1f8cd2;_0x3687c9[_0x46ad('0x3f')]=_['keys'](db[_0x46ad('0x9f')][_0x46ad('0x3e')]);_0x3687c9[_0x46ad('0x40')]=_['keys'](_0x3e2fcc[_0x46ad('0x40')]);_0x3687c9[_0x46ad('0x41')]=_['intersection'](_0x3687c9['model'],_0x3687c9['query']);_0x3271d8['attributes']=_['intersection'](_0x3687c9[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0x3e2fcc['query'][_0x46ad('0x44')]));_0x3271d8[_0x46ad('0x43')]=_0x3271d8[_0x46ad('0x43')][_0x46ad('0x45')]?_0x3271d8['attributes']:_0x3687c9[_0x46ad('0x3f')];_0x3271d8[_0x46ad('0x48')]=qs['sort'](_0x3e2fcc[_0x46ad('0x40')][_0x46ad('0x49')]);_0x3271d8[_0x46ad('0x4a')]=qs['filters'](_[_0x46ad('0x64')](_0x3e2fcc[_0x46ad('0x40')],_0x3687c9['filters']));if(_0x3e2fcc['query'][_0x46ad('0x2f')]){_0x3271d8['where']=_[_0x46ad('0x4b')](_0x3271d8[_0x46ad('0x4a')],{'$or':_['map'](_0x3271d8['attributes'],function(_0x12ef19){var _0x428666={};_0x428666[_0x12ef19]={'$like':'%'+_0x3e2fcc['query'][_0x46ad('0x2f')]+'%'};return _0x428666;})});}_0x3271d8=_[_0x46ad('0x4b')]({},_0x3271d8,_0x3e2fcc[_0x46ad('0x4d')]);return _0x57c960[_0x46ad('0x9e')](_0x3271d8);}})['then'](function(_0x10f7e1){if(_0x10f7e1){_0x4045c7=_0x10f7e1[_0x46ad('0x45')];if(!_0x3e2fcc[_0x46ad('0x40')][_0x46ad('0x46')](_0x46ad('0x47'))){_0x3271d8[_0x46ad('0x21')]=qs[_0x46ad('0x21')](_0x3e2fcc[_0x46ad('0x40')]['limit']);_0x3271d8[_0x46ad('0x1f')]=qs[_0x46ad('0x1f')](_0x3e2fcc[_0x46ad('0x40')][_0x46ad('0x1f')]);}return _0x57c960[_0x46ad('0x9e')](_0x3271d8);}})[_0x46ad('0x28')](function(_0x464ef3){if(_0x464ef3){return _0x464ef3?{'count':_0x4045c7,'rows':_0x464ef3}:null;}})[_0x46ad('0x28')](respondWithResult(_0x4111ca,null))[_0x46ad('0x52')](handleError(_0x4111ca,null));};exports[_0x46ad('0xa0')]=function(_0x3cad92,_0x3d8901,_0x3bf751){var _0x39ce44,_0x225ef9;return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x3cad92[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x3d8901,null))[_0x46ad('0x28')](function(_0x122563){if(_0x122563){_0x225ef9=_0x122563;return _0x122563['addLists'](_0x3cad92['body'][_0x46ad('0x82')],_[_0x46ad('0x5b')](_0x3cad92[_0x46ad('0x56')],[_0x46ad('0x82'),'id'])||{});}return null;})['spread'](function(_0x511e27){var _0x253fbd;_0x39ce44=_0x511e27||[];var _0x1c0476=[];if(_0x511e27){for(var _0x36075f=0x0;_0x36075f<_0x511e27[_0x46ad('0x45')];_0x36075f+=0x1){var _0x5553c5=_0x511e27[_0x36075f]['get']({'plain':!![]});_0x225ef9[_0x46ad('0xa1')]=_0x3cad92[_0x46ad('0x56')][_0x46ad('0xa1')]?_0x3cad92[_0x46ad('0x56')]['dialCheckDuplicateType']:_0x225ef9[_0x46ad('0xa1')];switch(_0x225ef9['dialCheckDuplicateType']){case _0x46ad('0xa2'):_0x253fbd=squel[_0x46ad('0xa3')]()[_0x46ad('0xa4')](_0x46ad('0xa5'))[_0x46ad('0xa6')](['phone',_0x46ad('0xa7'),'ContactId',_0x46ad('0xa8'),_0x46ad('0x68'),_0x46ad('0x5c'),_0x46ad('0x5d')],squel['select']()['field'](_0x46ad('0xa9'),_0x46ad('0xa9'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0xa7'))[_0x46ad('0x84')]('id',_0x46ad('0xab'))[_0x46ad('0x84')](_0x5553c5[_0x46ad('0xac')][_0x46ad('0x8d')](),_0x46ad('0xa8'))['field'](_0x3cad92[_0x46ad('0x54')]['id']['toString'](),_0x46ad('0x68'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0x5c'))['field']('NOW()',_0x46ad('0x5d'))[_0x46ad('0x85')](_0x46ad('0xad'))[_0x46ad('0x4a')](_0x46ad('0xae'))[_0x46ad('0x4a')]('ListId\x20=\x20?',_0x5553c5[_0x46ad('0xac')][_0x46ad('0x8d')]())[_0x46ad('0x4a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x46ad('0xaf'),squel[_0x46ad('0x83')]()[_0x46ad('0x84')](_0x46ad('0xb0'))[_0x46ad('0x85')]('cm_hopper_final')[_0x46ad('0x4a')]('VoiceQueueId\x20=\x20?',_0x3cad92['params']['id'][_0x46ad('0x8d')]()))[_0x46ad('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x46ad('0x84')](_0x46ad('0xb1'))[_0x46ad('0x85')]('cm_hopper')[_0x46ad('0x4a')](_0x46ad('0x8a'),_0x3cad92[_0x46ad('0x54')]['id']['toString']())))[_0x46ad('0x8d')]();break;case'onlyIfOpen':_0x253fbd=squel[_0x46ad('0xa3')]()[_0x46ad('0xa4')](_0x46ad('0xa5'))[_0x46ad('0xa6')]([_0x46ad('0xa9'),'scheduledAt',_0x46ad('0xab'),_0x46ad('0xa8'),_0x46ad('0x68'),_0x46ad('0x5c'),_0x46ad('0x5d')],squel['select']()['field']('phone',_0x46ad('0xa9'))[_0x46ad('0x84')]('NOW()',_0x46ad('0xa7'))[_0x46ad('0x84')]('id',_0x46ad('0xab'))[_0x46ad('0x84')](_0x5553c5[_0x46ad('0xac')]['toString'](),_0x46ad('0xa8'))['field'](_0x3cad92[_0x46ad('0x54')]['id'][_0x46ad('0x8d')](),_0x46ad('0x68'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0x5c'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0x5d'))[_0x46ad('0x85')](_0x46ad('0xad'))[_0x46ad('0x4a')](_0x46ad('0xae'))['where']('ListId\x20=\x20?',_0x5553c5[_0x46ad('0xac')][_0x46ad('0x8d')]())[_0x46ad('0x4a')](_0x46ad('0xb2'))[_0x46ad('0x4a')](_0x46ad('0xaf'),squel[_0x46ad('0x83')]()[_0x46ad('0x84')](_0x46ad('0xb1'))[_0x46ad('0x85')](_0x46ad('0xa5'))['where'](_0x46ad('0x8a'),_0x3cad92['params']['id'][_0x46ad('0x8d')]())))[_0x46ad('0x8d')]();break;default:_0x253fbd=squel[_0x46ad('0xa3')]()['into'](_0x46ad('0xa5'))['fromQuery']([_0x46ad('0xa9'),_0x46ad('0xa7'),'ContactId','ListId','VoiceQueueId',_0x46ad('0x5c'),_0x46ad('0x5d')],squel[_0x46ad('0x83')]()[_0x46ad('0x84')]('phone','phone')[_0x46ad('0x84')]('NOW()','scheduledAt')[_0x46ad('0x84')]('id','ContactId')[_0x46ad('0x84')](_0x5553c5[_0x46ad('0xac')][_0x46ad('0x8d')](),_0x46ad('0xa8'))[_0x46ad('0x84')](_0x3cad92[_0x46ad('0x54')]['id'][_0x46ad('0x8d')](),_0x46ad('0x68'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0x5c'))[_0x46ad('0x84')](_0x46ad('0xaa'),_0x46ad('0x5d'))['from']('cm_contacts')['where'](_0x46ad('0xae'))[_0x46ad('0x4a')](_0x46ad('0xb3'),_0x5553c5[_0x46ad('0xac')]['toString']())[_0x46ad('0x4a')]('phone\x20IS\x20NOT\x20NULL'))[_0x46ad('0x8d')]();}_0x1c0476[_0x46ad('0x8c')](db['sequelize'][_0x46ad('0x40')](_0x253fbd));}return BPromise[_0x46ad('0x90')](_0x1c0476);}})['then'](function(){return _0x39ce44;})['then'](respondWithResult(_0x3d8901,null))[_0x46ad('0x52')](handleError(_0x3d8901,null));};exports[_0x46ad('0xb4')]=function(_0x5121f9,_0x1e1551,_0x9479a5){return db[_0x46ad('0x3d')]['find']({'where':{'id':_0x5121f9['params']['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x1e1551,null))['then'](function(_0x3c34aa){if(_0x3c34aa){return _0x3c34aa[_0x46ad('0xb4')](_0x5121f9[_0x46ad('0x40')]['ids']);}})['then'](function(_0x545a87){if(_0x545a87){return db[_0x46ad('0x63')][_0x46ad('0x29')]({'where':{'ListId':_0x5121f9[_0x46ad('0x40')][_0x46ad('0x82')],'VoiceQueueId':_0x5121f9[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](function(){return _0x545a87;});}})['then'](respondWithStatusCode(_0x1e1551,null))['catch'](handleError(_0x1e1551,null));};exports[_0x46ad('0xb5')]=function(_0xd7d238,_0x3a3d8e,_0x1b24c0){var _0x47ea8c={};var _0xcad77a={};var _0x3f7642;var _0xc28eeb;return db['VoiceQueue'][_0x46ad('0x66')]({'where':{'id':_0xd7d238[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x3a3d8e,null))[_0x46ad('0x28')](function(_0x29381f){if(_0x29381f){_0x3f7642=_0x29381f;_0xcad77a['model']=_['keys'](db[_0x46ad('0x9f')][_0x46ad('0x3e')]);_0xcad77a[_0x46ad('0x40')]=_['keys'](_0xd7d238[_0x46ad('0x40')]);_0xcad77a[_0x46ad('0x41')]=_[_0x46ad('0x42')](_0xcad77a[_0x46ad('0x3f')],_0xcad77a[_0x46ad('0x40')]);_0x47ea8c[_0x46ad('0x43')]=_[_0x46ad('0x42')](_0xcad77a[_0x46ad('0x3f')],qs[_0x46ad('0x44')](_0xd7d238[_0x46ad('0x40')][_0x46ad('0x44')]));_0x47ea8c[_0x46ad('0x43')]=_0x47ea8c[_0x46ad('0x43')]['length']?_0x47ea8c['attributes']:_0xcad77a[_0x46ad('0x3f')];_0x47ea8c[_0x46ad('0x48')]=qs[_0x46ad('0x49')](_0xd7d238[_0x46ad('0x40')]['sort']);_0x47ea8c['where']=qs[_0x46ad('0x41')](_[_0x46ad('0x64')](_0xd7d238[_0x46ad('0x40')],_0xcad77a['filters']));if(_0xd7d238[_0x46ad('0x40')][_0x46ad('0x2f')]){_0x47ea8c[_0x46ad('0x4a')]=_[_0x46ad('0x4b')](_0x47ea8c[_0x46ad('0x4a')],{'$or':_[_0x46ad('0x30')](_0x47ea8c['attributes'],function(_0x323bd7){var _0x44254a={};_0x44254a[_0x323bd7]={'$like':'%'+_0xd7d238[_0x46ad('0x40')][_0x46ad('0x2f')]+'%'};return _0x44254a;})});}_0x47ea8c=_['merge']({},_0x47ea8c,_0xd7d238[_0x46ad('0x4d')]);return _0x3f7642['getBlackLists'](_0x47ea8c);}})[_0x46ad('0x28')](function(_0x51ab15){if(_0x51ab15){_0xc28eeb=_0x51ab15[_0x46ad('0x45')];if(!_0xd7d238[_0x46ad('0x40')][_0x46ad('0x46')]('nolimit')){_0x47ea8c[_0x46ad('0x21')]=qs['limit'](_0xd7d238[_0x46ad('0x40')][_0x46ad('0x21')]);_0x47ea8c[_0x46ad('0x1f')]=qs[_0x46ad('0x1f')](_0xd7d238[_0x46ad('0x40')][_0x46ad('0x1f')]);}return _0x3f7642[_0x46ad('0xb5')](_0x47ea8c);}})[_0x46ad('0x28')](function(_0x4abc79){if(_0x4abc79){return _0x4abc79?{'count':_0xc28eeb,'rows':_0x4abc79}:null;}})[_0x46ad('0x28')](respondWithResult(_0x3a3d8e,null))['catch'](handleError(_0x3a3d8e,null));};exports[_0x46ad('0xb6')]=function(_0x25c306,_0x345a7c,_0xeb5823){var _0x5e788c,_0x4aa0ac;return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x25c306[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x345a7c,null))['then'](function(_0x4c86b0){if(_0x4c86b0){_0x4aa0ac=_0x4c86b0;return _0x4c86b0[_0x46ad('0xb6')](_0x25c306['body']['ids'],_[_0x46ad('0x5b')](_0x25c306[_0x46ad('0x56')],[_0x46ad('0x82'),'id'])||{});}return null;})[_0x46ad('0x98')](function(_0x5a8f19){var _0x101d1a;_0x5e788c=_0x5a8f19||[];var _0x221f43=[];if(_0x5a8f19){for(var _0x3a715e=0x0;_0x3a715e<_0x5a8f19['length'];_0x3a715e+=0x1){var _0x186856=_0x5a8f19[_0x3a715e]['get']({'plain':!![]});_0x101d1a=squel[_0x46ad('0xa3')]()[_0x46ad('0xa4')]('cm_hopper_black')[_0x46ad('0xa6')](['phone',_0x46ad('0xab'),_0x46ad('0xa8'),_0x46ad('0x68'),'createdAt',_0x46ad('0x5d')],squel[_0x46ad('0x83')]()[_0x46ad('0x84')](_0x46ad('0xa9'),'phone')['field']('id','ContactId')[_0x46ad('0x84')](_0x186856[_0x46ad('0xac')]['toString'](),_0x46ad('0xa8'))[_0x46ad('0x84')](_0x25c306[_0x46ad('0x54')]['id'][_0x46ad('0x8d')](),'VoiceQueueId')['field'](_0x46ad('0xaa'),_0x46ad('0x5c'))[_0x46ad('0x84')]('NOW()',_0x46ad('0x5d'))[_0x46ad('0x85')](_0x46ad('0xad'))[_0x46ad('0x4a')]('deletedAt\x20IS\x20NULL')[_0x46ad('0x4a')](_0x46ad('0xb3'),_0x186856[_0x46ad('0xac')][_0x46ad('0x8d')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x221f43[_0x46ad('0x8c')](db[_0x46ad('0x73')]['query'](_0x101d1a));}return BPromise[_0x46ad('0x90')](_0x221f43);}})[_0x46ad('0x28')](function(){return _0x5e788c;})['then'](respondWithResult(_0x345a7c,null))[_0x46ad('0x52')](handleError(_0x345a7c,null));};exports[_0x46ad('0xb7')]=function(_0x582f62,_0x1c9720,_0x55968f){return db[_0x46ad('0x3d')][_0x46ad('0x34')]({'where':{'id':_0x582f62[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](handleEntityNotFound(_0x1c9720,null))[_0x46ad('0x28')](function(_0x4c1f0d){if(_0x4c1f0d){return _0x4c1f0d[_0x46ad('0xb7')](_0x582f62[_0x46ad('0x40')][_0x46ad('0x82')]);}})[_0x46ad('0x28')](function(_0x402292){if(_0x402292){return db[_0x46ad('0x6b')][_0x46ad('0x29')]({'where':{'ListId':_0x582f62[_0x46ad('0x40')][_0x46ad('0x82')],'VoiceQueueId':_0x582f62[_0x46ad('0x54')]['id']}})[_0x46ad('0x28')](function(){return _0x402292;});}})['then'](respondWithStatusCode(_0x1c9720,null))[_0x46ad('0x52')](handleError(_0x1c9720,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 9723316..80fbd91 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 _0x9957=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x9957,0x83));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x7995('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7995('0x1')](0x0);var events={'afterCreate':_0x7995('0x2'),'afterUpdate':'update','afterDestroy':_0x7995('0x3')};function emitEvent(_0x20bc9){return function(_0x5d9926,_0x64674d,_0xecdd99){VoiceQueueEvents[_0x7995('0x4')](_0x20bc9+':'+_0x5d9926['id'],_0x5d9926);VoiceQueueEvents['emit'](_0x20bc9,_0x5d9926);_0xecdd99(null);};}for(var e in events){if(events[_0x7995('0x5')](e)){var event=events[e];VoiceQueue[_0x7995('0x6')](e,emitEvent(event));}}module[_0x7995('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xed56=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xed56,0x1da));var _0x6ed5=function(_0x453c28,_0x47935f){_0x453c28=_0x453c28-0x0;var _0x1fc710=_0xed56[_0x453c28];return _0x1fc710;};'use strict';var EventEmitter=require(_0x6ed5('0x0'));var VoiceQueue=require(_0x6ed5('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6ed5('0x2')](0x0);var events={'afterCreate':_0x6ed5('0x3'),'afterUpdate':_0x6ed5('0x4'),'afterDestroy':_0x6ed5('0x5')};function emitEvent(_0x2618bb){return function(_0x17d189,_0x5b51ec,_0x5c5975){VoiceQueueEvents[_0x6ed5('0x6')](_0x2618bb+':'+_0x17d189['id'],_0x17d189);VoiceQueueEvents[_0x6ed5('0x6')](_0x2618bb,_0x17d189);_0x5c5975(null);};}for(var e in events){if(events[_0x6ed5('0x7')](e)){var event=events[e];VoiceQueue[_0x6ed5('0x8')](e,emitEvent(event));}}module[_0x6ed5('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 4e26f9b..04bc14d 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0x008c,0x188));var _0xc008=function(_0x7179ba,_0x37504f){_0x7179ba=_0x7179ba-0x0;var _0x4ad820=_0x008c[_0x7179ba];return _0x4ad820;};'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'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x4d0c01,_0x21185c){var _0xcbae04=function(_0x18597b){while(--_0x18597b){_0x4d0c01['push'](_0x4d0c01['shift']());}};_0xcbae04(++_0x21185c);}(_0x34e8,0x12c));var _0x834e=function(_0x3d910,_0x1fd046){_0x3d910=_0x3d910-0x0;var _0x23ae57=_0x34e8[_0x3d910];return _0x23ae57;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'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 8b0834a..f7d847b 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 _0xd2c3=['attributes','map','model','include','GetVoiceQueue','ShowVoiceQueue','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','info','result','catch','VoiceQueue','options','where'];(function(_0x28227f,_0x334094){var _0x69cbc9=function(_0x593596){while(--_0x593596){_0x28227f['push'](_0x28227f['shift']());}};_0x69cbc9(++_0x334094);}(_0xd2c3,0x1a9));var _0x3d2c=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xd2c3[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0x3d2c('0x0'));var moment=require(_0x3d2c('0x1'));var BPromise=require(_0x3d2c('0x2'));var rs=require(_0x3d2c('0x3'));var fs=require('fs');var Redis=require(_0x3d2c('0x4'));var db=require(_0x3d2c('0x5'))['db'];var utils=require(_0x3d2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3d2c('0x7'));var jayson=require(_0x3d2c('0x8'));var client=jayson[_0x3d2c('0x9')][_0x3d2c('0xa')]({'port':0x232a});config[_0x3d2c('0xb')]=_[_0x3d2c('0xc')](config[_0x3d2c('0xb')],{'host':_0x3d2c('0xd'),'port':0x18eb});var socket=require(_0x3d2c('0xe'))(new Redis(config[_0x3d2c('0xb')]));require(_0x3d2c('0xf'))['register'](socket);function respondWithRpcPromise(_0x404d34,_0x4cf523,_0x3fa3af){return new BPromise(function(_0x30c0a1,_0x26954c){return client[_0x3d2c('0x10')](_0x404d34,_0x3fa3af)[_0x3d2c('0x11')](function(_0x181f7d){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x4cf523,_0x3d2c('0x12'));logger[_0x3d2c('0x13')](_0x3d2c('0x14'),_0x4cf523,_0x3d2c('0x12'),JSON[_0x3d2c('0x15')](_0x181f7d));if(_0x181f7d[_0x3d2c('0x16')]){if(_0x181f7d[_0x3d2c('0x16')]['code']===0x1f4){logger[_0x3d2c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x4cf523,_0x181f7d[_0x3d2c('0x16')][_0x3d2c('0x17')]);return _0x26954c(_0x181f7d[_0x3d2c('0x16')][_0x3d2c('0x17')]);}logger[_0x3d2c('0x16')](_0x3d2c('0x18'),_0x4cf523,_0x181f7d[_0x3d2c('0x16')][_0x3d2c('0x17')]);return _0x30c0a1(_0x181f7d[_0x3d2c('0x16')][_0x3d2c('0x17')]);}else{logger[_0x3d2c('0x19')](_0x3d2c('0x18'),_0x4cf523,_0x3d2c('0x12'));_0x30c0a1(_0x181f7d[_0x3d2c('0x1a')][_0x3d2c('0x17')]);}})[_0x3d2c('0x1b')](function(_0x508dbf){logger[_0x3d2c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x4cf523,_0x508dbf);_0x26954c(_0x508dbf);});});}exports['GetVoiceQueue']=function(_0x2468af){var _0x291a8b=this;return new Promise(function(_0x3f2475,_0x424a76){return db[_0x3d2c('0x1c')]['findAll']({'raw':_0x2468af[_0x3d2c('0x1d')]?_0x2468af[_0x3d2c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2468af[_0x3d2c('0x1d')]?_0x2468af[_0x3d2c('0x1d')][_0x3d2c('0x1e')]||null:null,'attributes':_0x2468af['options']?_0x2468af[_0x3d2c('0x1d')][_0x3d2c('0x1f')]||null:null,'limit':_0x2468af[_0x3d2c('0x1d')]?_0x2468af[_0x3d2c('0x1d')]['limit']||null:null,'include':_0x2468af['options']?_0x2468af['options']['include']?_[_0x3d2c('0x20')](_0x2468af[_0x3d2c('0x1d')]['include'],function(_0x32989f){return{'model':db[_0x32989f[_0x3d2c('0x21')]],'as':_0x32989f['as'],'attributes':_0x32989f[_0x3d2c('0x1f')],'include':_0x32989f[_0x3d2c('0x22')]?_[_0x3d2c('0x20')](_0x32989f[_0x3d2c('0x22')],function(_0x621992){return{'model':db[_0x621992[_0x3d2c('0x21')]],'as':_0x621992['as'],'attributes':_0x621992[_0x3d2c('0x1f')],'include':_0x621992[_0x3d2c('0x22')]?_[_0x3d2c('0x20')](_0x621992[_0x3d2c('0x22')],function(_0x537cfd){return{'model':db[_0x537cfd[_0x3d2c('0x21')]],'as':_0x537cfd['as'],'attributes':_0x537cfd[_0x3d2c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a738a){logger[_0x3d2c('0x19')](_0x3d2c('0x23'),_0x2468af);logger[_0x3d2c('0x13')](_0x3d2c('0x23'),_0x2468af,JSON[_0x3d2c('0x15')](_0x2a738a));_0x3f2475(_0x2a738a);})[_0x3d2c('0x1b')](function(_0x3fdc8b){logger[_0x3d2c('0x16')](_0x3d2c('0x23'),_0x3fdc8b[_0x3d2c('0x17')],_0x2468af);_0x424a76(_0x291a8b['error'](0x1f4,_0x3fdc8b[_0x3d2c('0x17')]));});});};exports[_0x3d2c('0x24')]=function(_0x2aa2e6){var _0x3820fa=this;return new Promise(function(_0x474354,_0x5de7ee){return db['VoiceQueue']['find']({'raw':_0x2aa2e6['options']?_0x2aa2e6[_0x3d2c('0x1d')][_0x3d2c('0x25')]===undefined?!![]:![]:!![],'where':_0x2aa2e6['options']?_0x2aa2e6[_0x3d2c('0x1d')][_0x3d2c('0x1e')]||null:null,'attributes':_0x2aa2e6[_0x3d2c('0x1d')]?_0x2aa2e6['options'][_0x3d2c('0x1f')]||null:null,'include':_0x2aa2e6['options']?_0x2aa2e6[_0x3d2c('0x1d')][_0x3d2c('0x22')]?_[_0x3d2c('0x20')](_0x2aa2e6['options']['include'],function(_0x588dec){return{'model':db[_0x588dec[_0x3d2c('0x21')]],'as':_0x588dec['as'],'attributes':_0x588dec[_0x3d2c('0x1f')],'include':_0x588dec[_0x3d2c('0x22')]?_[_0x3d2c('0x20')](_0x588dec[_0x3d2c('0x22')],function(_0x3ba201){return{'model':db[_0x3ba201[_0x3d2c('0x21')]],'as':_0x3ba201['as'],'attributes':_0x3ba201[_0x3d2c('0x1f')],'include':_0x3ba201['include']?_['map'](_0x3ba201[_0x3d2c('0x22')],function(_0x25d120){return{'model':db[_0x25d120[_0x3d2c('0x21')]],'as':_0x25d120['as'],'attributes':_0x25d120[_0x3d2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3d2c('0x11')](function(_0x20535a){logger[_0x3d2c('0x19')](_0x3d2c('0x24'),_0x2aa2e6);logger[_0x3d2c('0x13')]('ShowVoiceQueue',_0x2aa2e6,JSON['stringify'](_0x20535a));_0x474354(_0x20535a);})[_0x3d2c('0x1b')](function(_0x30f6bc){logger['error']('ShowVoiceQueue',_0x30f6bc[_0x3d2c('0x17')],_0x2aa2e6);_0x5de7ee(_0x3820fa[_0x3d2c('0x16')](0x1f4,_0x30f6bc[_0x3d2c('0x17')]));});});}; \ No newline at end of file +var _0x5cc0=['request\x20sent','debug','error','code','message','catch','GetVoiceQueue','findAll','options','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','find','raw','where','stringify','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x2a1c66,_0x57fdf2){var _0x39e6eb=function(_0x10c30a){while(--_0x10c30a){_0x2a1c66['push'](_0x2a1c66['shift']());}};_0x39e6eb(++_0x57fdf2);}(_0x5cc0,0xf2));var _0x05cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5cc0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x05cc('0x0'));var moment=require(_0x05cc('0x1'));var BPromise=require(_0x05cc('0x2'));var rs=require(_0x05cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x05cc('0x4'))(_0x05cc('0x5'));var config=require('../../config/environment');var jayson=require(_0x05cc('0x6'));var client=jayson[_0x05cc('0x7')][_0x05cc('0x8')]({'port':0x232a});config['redis']=_[_0x05cc('0x9')](config[_0x05cc('0xa')],{'host':_0x05cc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05cc('0xa')]));require(_0x05cc('0xc'))['register'](socket);function respondWithRpcPromise(_0x47e25c,_0x40568d,_0x2f0ae0){return new BPromise(function(_0x124e6e,_0x96b0b6){return client[_0x05cc('0xd')](_0x47e25c,_0x2f0ae0)[_0x05cc('0xe')](function(_0x15ff84){logger[_0x05cc('0xf')](_0x05cc('0x10'),_0x40568d,_0x05cc('0x11'));logger[_0x05cc('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x40568d,_0x05cc('0x11'),JSON['stringify'](_0x15ff84));if(_0x15ff84[_0x05cc('0x13')]){if(_0x15ff84['error'][_0x05cc('0x14')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x40568d,_0x15ff84[_0x05cc('0x13')][_0x05cc('0x15')]);return _0x96b0b6(_0x15ff84[_0x05cc('0x13')][_0x05cc('0x15')]);}logger[_0x05cc('0x13')](_0x05cc('0x10'),_0x40568d,_0x15ff84[_0x05cc('0x13')]['message']);return _0x124e6e(_0x15ff84['error'][_0x05cc('0x15')]);}else{logger[_0x05cc('0xf')](_0x05cc('0x10'),_0x40568d,_0x05cc('0x11'));_0x124e6e(_0x15ff84['result']['message']);}})[_0x05cc('0x16')](function(_0x3fe89d){logger[_0x05cc('0x13')](_0x05cc('0x10'),_0x40568d,_0x3fe89d);_0x96b0b6(_0x3fe89d);});});}exports[_0x05cc('0x17')]=function(_0x31cbc3){var _0x2aeb04=this;return new Promise(function(_0x1f2f03,_0x5942e3){return db['VoiceQueue'][_0x05cc('0x18')]({'raw':_0x31cbc3[_0x05cc('0x19')]?_0x31cbc3[_0x05cc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x31cbc3[_0x05cc('0x19')]?_0x31cbc3[_0x05cc('0x19')]['where']||null:null,'attributes':_0x31cbc3[_0x05cc('0x19')]?_0x31cbc3[_0x05cc('0x19')][_0x05cc('0x1a')]||null:null,'limit':_0x31cbc3['options']?_0x31cbc3[_0x05cc('0x19')][_0x05cc('0x1b')]||null:null,'include':_0x31cbc3['options']?_0x31cbc3[_0x05cc('0x19')][_0x05cc('0x1c')]?_[_0x05cc('0x1d')](_0x31cbc3[_0x05cc('0x19')]['include'],function(_0x81ef41){return{'model':db[_0x81ef41[_0x05cc('0x1e')]],'as':_0x81ef41['as'],'attributes':_0x81ef41[_0x05cc('0x1a')],'include':_0x81ef41[_0x05cc('0x1c')]?_['map'](_0x81ef41[_0x05cc('0x1c')],function(_0x485e2f){return{'model':db[_0x485e2f[_0x05cc('0x1e')]],'as':_0x485e2f['as'],'attributes':_0x485e2f[_0x05cc('0x1a')],'include':_0x485e2f[_0x05cc('0x1c')]?_['map'](_0x485e2f[_0x05cc('0x1c')],function(_0x4b00ac){return{'model':db[_0x4b00ac[_0x05cc('0x1e')]],'as':_0x4b00ac['as'],'attributes':_0x4b00ac[_0x05cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x05cc('0xe')](function(_0x58deb4){logger[_0x05cc('0xf')](_0x05cc('0x17'),_0x31cbc3);logger['debug'](_0x05cc('0x17'),_0x31cbc3,JSON['stringify'](_0x58deb4));_0x1f2f03(_0x58deb4);})[_0x05cc('0x16')](function(_0x1d4f01){logger[_0x05cc('0x13')](_0x05cc('0x17'),_0x1d4f01['message'],_0x31cbc3);_0x5942e3(_0x2aeb04[_0x05cc('0x13')](0x1f4,_0x1d4f01[_0x05cc('0x15')]));});});};exports[_0x05cc('0x1f')]=function(_0x3ec4e1){var _0x2339ec=this;return new Promise(function(_0x37270d,_0x213676){return db[_0x05cc('0x20')][_0x05cc('0x21')]({'raw':_0x3ec4e1[_0x05cc('0x19')]?_0x3ec4e1[_0x05cc('0x19')][_0x05cc('0x22')]===undefined?!![]:![]:!![],'where':_0x3ec4e1[_0x05cc('0x19')]?_0x3ec4e1[_0x05cc('0x19')][_0x05cc('0x23')]||null:null,'attributes':_0x3ec4e1[_0x05cc('0x19')]?_0x3ec4e1['options'][_0x05cc('0x1a')]||null:null,'include':_0x3ec4e1[_0x05cc('0x19')]?_0x3ec4e1[_0x05cc('0x19')][_0x05cc('0x1c')]?_[_0x05cc('0x1d')](_0x3ec4e1[_0x05cc('0x19')]['include'],function(_0x2b2490){return{'model':db[_0x2b2490[_0x05cc('0x1e')]],'as':_0x2b2490['as'],'attributes':_0x2b2490[_0x05cc('0x1a')],'include':_0x2b2490[_0x05cc('0x1c')]?_[_0x05cc('0x1d')](_0x2b2490[_0x05cc('0x1c')],function(_0xfe9858){return{'model':db[_0xfe9858['model']],'as':_0xfe9858['as'],'attributes':_0xfe9858[_0x05cc('0x1a')],'include':_0xfe9858[_0x05cc('0x1c')]?_[_0x05cc('0x1d')](_0xfe9858['include'],function(_0x5acc60){return{'model':db[_0x5acc60[_0x05cc('0x1e')]],'as':_0x5acc60['as'],'attributes':_0x5acc60[_0x05cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x05cc('0xe')](function(_0x41d6d1){logger[_0x05cc('0xf')](_0x05cc('0x1f'),_0x3ec4e1);logger['debug'](_0x05cc('0x1f'),_0x3ec4e1,JSON[_0x05cc('0x24')](_0x41d6d1));_0x37270d(_0x41d6d1);})[_0x05cc('0x16')](function(_0x36c924){logger[_0x05cc('0x13')](_0x05cc('0x1f'),_0x36c924[_0x05cc('0x15')],_0x3ec4e1);_0x213676(_0x2339ec[_0x05cc('0x13')](0x1f4,_0x36c924[_0x05cc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c2f0687..2a926f7 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 _0xcd23=['./voiceQueue.events','save','update','removeListener','register','length','voiceQueue:'];(function(_0x27def7,_0x3f0835){var _0x581cbc=function(_0x5b8ae4){while(--_0x5b8ae4){_0x27def7['push'](_0x27def7['shift']());}};_0x581cbc(++_0x3f0835);}(_0xcd23,0x181));var _0x3cd2=function(_0x1be30b,_0x598f0e){_0x1be30b=_0x1be30b-0x0;var _0x4c33f4=_0xcd23[_0x1be30b];return _0x4c33f4;};'use strict';var VoiceQueueEvents=require(_0x3cd2('0x0'));var events=[_0x3cd2('0x1'),'remove',_0x3cd2('0x2')];function createListener(_0x3c14fb,_0x1a3325){return function(_0x538ea1){_0x1a3325['emit'](_0x3c14fb,_0x538ea1);};}function removeListener(_0x484b63,_0x50471e){return function(){VoiceQueueEvents[_0x3cd2('0x3')](_0x484b63,_0x50471e);};}exports[_0x3cd2('0x4')]=function(_0x12b742){for(var _0x3e14ee=0x0,_0x2c969d=events[_0x3cd2('0x5')];_0x3e14ee<_0x2c969d;_0x3e14ee++){var _0x3cbca6=events[_0x3e14ee];var _0x1aebb6=createListener(_0x3cd2('0x6')+_0x3cbca6,_0x12b742);VoiceQueueEvents['on'](_0x3cbca6,_0x1aebb6);}}; \ No newline at end of file +var _0x6326=['length','save','remove','update','emit','removeListener','register'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x6326,0x17b));var _0x6632=function(_0x3b30b0,_0x3af2bf){_0x3b30b0=_0x3b30b0-0x0;var _0x36b8e5=_0x6326[_0x3b30b0];return _0x36b8e5;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x6632('0x0'),_0x6632('0x1'),_0x6632('0x2')];function createListener(_0x4f85e0,_0xc749da){return function(_0x564800){_0xc749da[_0x6632('0x3')](_0x4f85e0,_0x564800);};}function removeListener(_0x586155,_0x7e02e3){return function(){VoiceQueueEvents[_0x6632('0x4')](_0x586155,_0x7e02e3);};}exports[_0x6632('0x5')]=function(_0x2d3a98){for(var _0x23c600=0x0,_0x35a4be=events[_0x6632('0x6')];_0x23c600<_0x35a4be;_0x23c600++){var _0x2a0563=events[_0x23c600];var _0x4fe0ba=createListener('voiceQueue:'+_0x2a0563,_0x2d3a98);VoiceQueueEvents['on'](_0x2a0563,_0x4fe0ba);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index f5cf771..7a8ed8f 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 _0x75c7=['/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','describe','getVoiceQueuesReport'];(function(_0x334c09,_0x30bd44){var _0x497131=function(_0x75c4c8){while(--_0x75c4c8){_0x334c09['push'](_0x334c09['shift']());}};_0x497131(++_0x30bd44);}(_0x75c7,0x1c8));var _0x775c=function(_0x12dc94,_0x121794){_0x12dc94=_0x12dc94-0x0;var _0x3a6d65=_0x75c7[_0x12dc94];return _0x3a6d65;};'use strict';var multer=require(_0x775c('0x0'));var util=require(_0x775c('0x1'));var path=require(_0x775c('0x2'));var timeout=require(_0x775c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x775c('0x4'));var auth=require(_0x775c('0x5'));var interaction=require(_0x775c('0x6'));var config=require('../../config/environment');var controller=require(_0x775c('0x7'));router[_0x775c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x775c('0x9')](),controller[_0x775c('0xa')]);router['get']('/index',auth['isAuthenticated'](),controller[_0x775c('0xb')]);router[_0x775c('0x8')](_0x775c('0xc'),auth['isAuthenticated'](),controller[_0x775c('0xd')]);router['post']('/',auth[_0x775c('0x9')](),controller['create']);router[_0x775c('0xe')](_0x775c('0xc'),auth[_0x775c('0x9')](),controller['update']);router[_0x775c('0xf')](_0x775c('0xc'),auth[_0x775c('0x9')](),controller[_0x775c('0x10')]);module[_0x775c('0x11')]=router; \ No newline at end of file +var _0xe6a9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','getVoiceQueuesReport','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x294b6,_0x2907ae){var _0x38bb97=function(_0x5aaa76){while(--_0x5aaa76){_0x294b6['push'](_0x294b6['shift']());}};_0x38bb97(++_0x2907ae);}(_0xe6a9,0x69));var _0x9e6a=function(_0x449b61,_0x56dc7c){_0x449b61=_0x449b61-0x0;var _0xfb9922=_0xe6a9[_0x449b61];return _0xfb9922;};'use strict';var multer=require(_0x9e6a('0x0'));var util=require(_0x9e6a('0x1'));var path=require(_0x9e6a('0x2'));var timeout=require(_0x9e6a('0x3'));var express=require(_0x9e6a('0x4'));var router=express[_0x9e6a('0x5')]();var fs_extra=require(_0x9e6a('0x6'));var auth=require(_0x9e6a('0x7'));var interaction=require(_0x9e6a('0x8'));var config=require(_0x9e6a('0x9'));var controller=require(_0x9e6a('0xa'));router[_0x9e6a('0xb')]('/',auth[_0x9e6a('0xc')](),controller[_0x9e6a('0xd')]);router[_0x9e6a('0xb')]('/describe',auth[_0x9e6a('0xc')](),controller['describe']);router[_0x9e6a('0xb')]('/index',auth[_0x9e6a('0xc')](),controller[_0x9e6a('0xe')]);router['get'](_0x9e6a('0xf'),auth[_0x9e6a('0xc')](),controller[_0x9e6a('0x10')]);router[_0x9e6a('0x11')]('/',auth[_0x9e6a('0xc')](),controller[_0x9e6a('0x12')]);router['put'](_0x9e6a('0xf'),auth['isAuthenticated'](),controller[_0x9e6a('0x13')]);router[_0x9e6a('0x14')](_0x9e6a('0xf'),auth[_0x9e6a('0xc')](),controller[_0x9e6a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 05bf7ec..a61eaa7 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 _0x285a=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','diff','seconds'];(function(_0xea1bcd,_0x465e08){var _0xfbe4c6=function(_0x4e20f1){while(--_0x4e20f1){_0xea1bcd['push'](_0xea1bcd['shift']());}};_0xfbe4c6(++_0x465e08);}(_0x285a,0x19b));var _0xa285=function(_0x41f3fb,_0xe20fa2){_0x41f3fb=_0x41f3fb-0x0;var _0x4ac4ef=_0x285a[_0x41f3fb];return _0x4ac4ef;};'use strict';var Sequelize=require(_0xa285('0x0'));var moment=require(_0xa285('0x1'));module[_0xa285('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa285('0x3')]},'calleridnum':{'type':Sequelize[_0xa285('0x3')]},'calleridname':{'type':Sequelize[_0xa285('0x3')]},'queue':{'type':Sequelize[_0xa285('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xa285('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xa285('0x4')],'set':function(_0x59d791){var _0x4c12f9=moment(_0x59d791);var _0x34a7f3=moment(this[_0xa285('0x5')](_0xa285('0x6')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x39022c=_0x4c12f9[_0xa285('0x7')](_0x34a7f3,_0xa285('0x8'));this['setDataValue']('queuecallerleaveAt',_0x59d791);this[_0xa285('0x9')](_0xa285('0xa'),_0x39022c||null);}},'position':{'type':Sequelize[_0xa285('0xb')]},'count':{'type':Sequelize[_0xa285('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xa285('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa285('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa285('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa285('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa285('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa285('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xa285('0xd')},'originalposition':{'type':Sequelize[_0xa285('0xb')]},'channel':{'type':Sequelize[_0xa285('0x3')]},'connectedlinenum':{'type':Sequelize[_0xa285('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa285('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa285('0x3')]},'priority':{'type':Sequelize[_0xa285('0x3')]},'holdtime':{'type':Sequelize[_0xa285('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa285('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa285('0x3')]},'transfer':{'type':Sequelize[_0xa285('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xa285('0xe')},'transferexten':{'type':Sequelize[_0xa285('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa285('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa285('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa285('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xa285('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3024=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x8c8678,_0x5199a4){var _0xc5ae90=function(_0x531f61){while(--_0x531f61){_0x8c8678['push'](_0x8c8678['shift']());}};_0xc5ae90(++_0x5199a4);}(_0x3024,0xb3));var _0x4302=function(_0x203014,_0x34ef5d){_0x203014=_0x203014-0x0;var _0x6f9e30=_0x3024[_0x203014];return _0x6f9e30;};'use strict';var Sequelize=require(_0x4302('0x0'));var moment=require(_0x4302('0x1'));module[_0x4302('0x2')]={'type':{'type':Sequelize[_0x4302('0x3')]},'uniqueid':{'type':Sequelize[_0x4302('0x3')]},'calleridnum':{'type':Sequelize[_0x4302('0x3')]},'calleridname':{'type':Sequelize[_0x4302('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x4302('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x4302('0x4')],'set':function(_0x45754f){var _0x5dd6e1=moment(_0x45754f);var _0x1b850e=moment(this[_0x4302('0x5')](_0x4302('0x6')))[_0x4302('0x7')](_0x4302('0x8'));var _0x16eeaf=_0x5dd6e1[_0x4302('0x9')](_0x1b850e,_0x4302('0xa'));this[_0x4302('0xb')](_0x4302('0xc'),_0x45754f);this['setDataValue'](_0x4302('0xd'),_0x16eeaf||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x4302('0xe')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4302('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x4302('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x4302('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4302('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x4302('0x3')],'comment':_0x4302('0x10')},'originalposition':{'type':Sequelize[_0x4302('0xe')]},'channel':{'type':Sequelize[_0x4302('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4302('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4302('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4302('0xe')]},'mohtime':{'type':Sequelize[_0x4302('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4302('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4302('0x3')]},'transfer':{'type':Sequelize[_0x4302('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x4302('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4302('0x3')]},'disposition':{'type':Sequelize[_0x4302('0x3')]},'secondDisposition':{'type':Sequelize[_0x4302('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4302('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x4302('0xe')],'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 bf82a6b..14154ec 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 _0x3b3d=['../../mysqldb','redis','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','then','includeAll','include','rows','catch','show','params','length','create','update','body','find','describe','pick','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x1d2acf,_0x477aa4){var _0x4bde31=function(_0x299310){while(--_0x299310){_0x1d2acf['push'](_0x1d2acf['shift']());}};_0x4bde31(++_0x477aa4);}(_0x3b3d,0xd4));var _0xd3b3=function(_0x43269e,_0xdb1160){_0x43269e=_0x43269e-0x0;var _0x17823f=_0x3b3d[_0x43269e];return _0x17823f;};'use strict';var emlformat=require(_0xd3b3('0x0'));var rimraf=require(_0xd3b3('0x1'));var zipdir=require(_0xd3b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3b3('0x3'));var moment=require(_0xd3b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd3b3('0x5'));var util=require(_0xd3b3('0x6'));var path=require(_0xd3b3('0x7'));var sox=require(_0xd3b3('0x8'));var csv=require(_0xd3b3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3b3('0xa'));var squel=require('squel');var crypto=require(_0xd3b3('0xb'));var jsforce=require(_0xd3b3('0xc'));var deskjs=require(_0xd3b3('0xd'));var toCsv=require(_0xd3b3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd3b3('0xe'));var authService=require(_0xd3b3('0xf'));var qs=require(_0xd3b3('0x10'));var as=require(_0xd3b3('0x11'));var hardwareService=require(_0xd3b3('0x12'));var logger=require('../../config/logger')(_0xd3b3('0x13'));var utils=require(_0xd3b3('0x14'));var config=require(_0xd3b3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd3b3('0x16'))['db'];config[_0xd3b3('0x17')]=_['defaults'](config[_0xd3b3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xd3b3('0x18'))(new Redis(config[_0xd3b3('0x17')]));require('./voiceQueueReport.socket')[_0xd3b3('0x19')](socket);function respondWithStatusCode(_0x4dabc4,_0x4babbe){_0x4babbe=_0x4babbe||0xcc;return function(_0x60dadc){if(_0x60dadc){return _0x4dabc4[_0xd3b3('0x1a')](_0x4babbe);}return _0x4dabc4['status'](_0x4babbe)[_0xd3b3('0x1b')]();};}function respondWithResult(_0x2033e7,_0x1a2da7){_0x1a2da7=_0x1a2da7||0xc8;return function(_0x4a5367){if(_0x4a5367){return _0x2033e7['status'](_0x1a2da7)[_0xd3b3('0x1c')](_0x4a5367);}};}function respondWithFilteredResult(_0x3bbc75,_0x5d2b5a){return function(_0x45131f){if(_0x45131f){var _0x5c5610=typeof _0x5d2b5a[_0xd3b3('0x1d')]===_0xd3b3('0x1e')&&typeof _0x5d2b5a[_0xd3b3('0x1f')]===_0xd3b3('0x1e');var _0x265e08=_0x45131f[_0xd3b3('0x20')];var _0x2f36b7=_0x5c5610?0x0:_0x5d2b5a[_0xd3b3('0x1d')];var _0x588232=_0x5c5610?_0x45131f[_0xd3b3('0x20')]:_0x5d2b5a[_0xd3b3('0x1d')]+_0x5d2b5a[_0xd3b3('0x1f')];var _0x25e574;if(_0x588232>=_0x265e08){_0x588232=_0x265e08;_0x25e574=0xc8;}else{_0x25e574=0xce;}_0x3bbc75[_0xd3b3('0x21')](_0x25e574);return _0x3bbc75[_0xd3b3('0x22')](_0xd3b3('0x23'),_0x2f36b7+'-'+_0x588232+'/'+_0x265e08)[_0xd3b3('0x1c')](_0x45131f);}return null;};}function patchUpdates(_0x4a9873){return function(_0x52c54d){try{jsonpatch['apply'](_0x52c54d,_0x4a9873,!![]);}catch(_0x322d66){return BPromise[_0xd3b3('0x24')](_0x322d66);}return _0x52c54d[_0xd3b3('0x25')]();};}function saveUpdates(_0x4f28e3,_0xa5a054){return function(_0x1dd72d){if(_0x1dd72d){return _0x1dd72d['update'](_0x4f28e3)['then'](function(_0x47b915){return _0x47b915;});}return null;};}function removeEntity(_0x5dab40,_0x4cbba){return function(_0x49472b){if(_0x49472b){return _0x49472b[_0xd3b3('0x26')]()['then'](function(){_0x5dab40[_0xd3b3('0x21')](0xcc)[_0xd3b3('0x1b')]();});}};}function handleEntityNotFound(_0x5ce174,_0x4f9b84){return function(_0x3d2247){if(!_0x3d2247){_0x5ce174['sendStatus'](0x194);}return _0x3d2247;};}function handleError(_0xf90960,_0xba0bbf){_0xba0bbf=_0xba0bbf||0x1f4;return function(_0x250958){logger[_0xd3b3('0x27')](_0x250958[_0xd3b3('0x28')]);if(_0x250958[_0xd3b3('0x29')]){delete _0x250958[_0xd3b3('0x29')];}_0xf90960['status'](_0xba0bbf)['send'](_0x250958);};}exports[_0xd3b3('0x2a')]=function(_0x1b616b,_0x2ac8dd){var _0x5b9795={},_0x1819d8={},_0x2deea2={'count':0x0,'rows':[]};var _0x4be2bc=_[_0xd3b3('0x2b')](db[_0xd3b3('0x2c')][_0xd3b3('0x2d')],function(_0x22bb42){return{'name':_0x22bb42[_0xd3b3('0x2e')],'type':_0x22bb42['type']['key']};});_0x1819d8[_0xd3b3('0x2f')]=_[_0xd3b3('0x2b')](_0x4be2bc,_0xd3b3('0x29'));_0x1819d8[_0xd3b3('0x30')]=_[_0xd3b3('0x31')](_0x1b616b['query']);_0x1819d8[_0xd3b3('0x32')]=_[_0xd3b3('0x33')](_0x1819d8[_0xd3b3('0x2f')],_0x1819d8['query']);_0x5b9795[_0xd3b3('0x34')]=_[_0xd3b3('0x33')](_0x1819d8['model'],qs[_0xd3b3('0x35')](_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x35')]));_0x5b9795[_0xd3b3('0x34')]=_0x5b9795['attributes']['length']?_0x5b9795['attributes']:_0x1819d8[_0xd3b3('0x2f')];if(!_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x36')](_0xd3b3('0x37'))){_0x5b9795[_0xd3b3('0x1f')]=qs['limit'](_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x1f')]);_0x5b9795[_0xd3b3('0x1d')]=qs['offset'](_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x1d')]);}_0x5b9795['order']=qs[_0xd3b3('0x38')](_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x38')]);_0x5b9795[_0xd3b3('0x39')]=qs[_0xd3b3('0x32')](_['pick'](_0x1b616b[_0xd3b3('0x30')],_0x1819d8[_0xd3b3('0x32')]),_0x4be2bc);if(_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x3a')]){_0x5b9795[_0xd3b3('0x39')]=_[_0xd3b3('0x3b')](_0x5b9795['where'],{'$or':_['map'](_0x4be2bc,function(_0x4c4164){if(_0x4c4164[_0xd3b3('0x3c')]!=='VIRTUAL'){var _0x3767f5={};_0x3767f5[_0x4c4164[_0xd3b3('0x29')]]={'$like':'%'+_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x3a')]+'%'};return _0x3767f5;}})});}_0x5b9795=_[_0xd3b3('0x3b')]({},_0x5b9795,_0x1b616b[_0xd3b3('0x3d')]);var _0x370478={'where':_0x5b9795['where']};return db[_0xd3b3('0x2c')][_0xd3b3('0x20')](_0x370478)[_0xd3b3('0x3e')](function(_0x5cce1b){_0x2deea2[_0xd3b3('0x20')]=_0x5cce1b;if(_0x1b616b[_0xd3b3('0x30')][_0xd3b3('0x3f')]){_0x5b9795[_0xd3b3('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5b9795);})['then'](function(_0x20f6ed){_0x2deea2[_0xd3b3('0x41')]=_0x20f6ed;return _0x2deea2;})[_0xd3b3('0x3e')](respondWithFilteredResult(_0x2ac8dd,_0x5b9795))[_0xd3b3('0x42')](handleError(_0x2ac8dd,null));};exports[_0xd3b3('0x43')]=function(_0x26c402,_0x5ae364){var _0x28f311={'raw':![],'where':{'id':_0x26c402[_0xd3b3('0x44')]['id']}},_0x2ac388={};_0x2ac388[_0xd3b3('0x2f')]=_['keys'](db[_0xd3b3('0x2c')][_0xd3b3('0x2d')]);_0x2ac388[_0xd3b3('0x30')]=_['keys'](_0x26c402['query']);_0x2ac388[_0xd3b3('0x32')]=_[_0xd3b3('0x33')](_0x2ac388[_0xd3b3('0x2f')],_0x2ac388[_0xd3b3('0x30')]);_0x28f311[_0xd3b3('0x34')]=_['intersection'](_0x2ac388[_0xd3b3('0x2f')],qs['fields'](_0x26c402[_0xd3b3('0x30')][_0xd3b3('0x35')]));_0x28f311[_0xd3b3('0x34')]=_0x28f311[_0xd3b3('0x34')][_0xd3b3('0x45')]?_0x28f311[_0xd3b3('0x34')]:_0x2ac388[_0xd3b3('0x2f')];if(_0x26c402[_0xd3b3('0x30')]['includeAll']){_0x28f311[_0xd3b3('0x40')]=[{'all':!![]}];}_0x28f311=_[_0xd3b3('0x3b')]({},_0x28f311,_0x26c402[_0xd3b3('0x3d')]);return db[_0xd3b3('0x2c')]['find'](_0x28f311)[_0xd3b3('0x3e')](handleEntityNotFound(_0x5ae364,null))['then'](respondWithResult(_0x5ae364,null))[_0xd3b3('0x42')](handleError(_0x5ae364,null));};exports[_0xd3b3('0x46')]=function(_0x31ccad,_0x29c864){return db['VoiceQueueReport'][_0xd3b3('0x46')](_0x31ccad['body'],{})[_0xd3b3('0x3e')](respondWithResult(_0x29c864,0xc9))['catch'](handleError(_0x29c864,null));};exports[_0xd3b3('0x47')]=function(_0xb492aa,_0x4b9856){if(_0xb492aa[_0xd3b3('0x48')]['id']){delete _0xb492aa[_0xd3b3('0x48')]['id'];}return db[_0xd3b3('0x2c')][_0xd3b3('0x49')]({'where':{'id':_0xb492aa[_0xd3b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b9856,null))[_0xd3b3('0x3e')](saveUpdates(_0xb492aa[_0xd3b3('0x48')],null))[_0xd3b3('0x3e')](respondWithResult(_0x4b9856,null))[_0xd3b3('0x42')](handleError(_0x4b9856,null));};exports['destroy']=function(_0x5a594b,_0x361964){return db[_0xd3b3('0x2c')][_0xd3b3('0x49')]({'where':{'id':_0x5a594b[_0xd3b3('0x44')]['id']}})[_0xd3b3('0x3e')](handleEntityNotFound(_0x361964,null))['then'](removeEntity(_0x361964,null))[_0xd3b3('0x42')](handleError(_0x361964,null));};exports[_0xd3b3('0x4a')]=function(_0x53817e,_0x5582df){return db[_0xd3b3('0x2c')][_0xd3b3('0x4a')]()[_0xd3b3('0x3e')](respondWithResult(_0x5582df,null))[_0xd3b3('0x42')](handleError(_0x5582df,null));};exports['getVoiceQueuesReport']=function(_0x1d108f,_0x23f13a){var _0x576539={},_0x2a7187={},_0x5f3422={'count':0x0,'rows':[]};_0x2a7187['model']=_[_0xd3b3('0x31')](db[_0xd3b3('0x2c')]['rawAttributes']);_0x2a7187[_0xd3b3('0x30')]=_[_0xd3b3('0x31')](_0x1d108f['query']);_0x2a7187[_0xd3b3('0x32')]=_[_0xd3b3('0x33')](_0x2a7187[_0xd3b3('0x2f')],_0x2a7187['query']);_0x576539[_0xd3b3('0x34')]=_[_0xd3b3('0x33')](_0x2a7187[_0xd3b3('0x2f')],qs[_0xd3b3('0x35')](_0x1d108f[_0xd3b3('0x30')][_0xd3b3('0x35')]));_0x576539[_0xd3b3('0x34')]=_0x576539[_0xd3b3('0x34')][_0xd3b3('0x45')]?_0x576539[_0xd3b3('0x34')]:_0x2a7187['model'];if(!_0x1d108f[_0xd3b3('0x30')][_0xd3b3('0x36')](_0xd3b3('0x37'))){_0x576539['limit']=qs[_0xd3b3('0x1f')](_0x1d108f[_0xd3b3('0x30')]['limit']);_0x576539[_0xd3b3('0x1d')]=qs[_0xd3b3('0x1d')](_0x1d108f['query'][_0xd3b3('0x1d')]);}_0x576539['order']=qs[_0xd3b3('0x38')](_0x1d108f[_0xd3b3('0x30')][_0xd3b3('0x38')]);_0x576539['where']=qs[_0xd3b3('0x32')](_[_0xd3b3('0x4b')](_0x1d108f[_0xd3b3('0x30')],_0x2a7187[_0xd3b3('0x32')]));if(_0x1d108f[_0xd3b3('0x30')][_0xd3b3('0x3a')]){_0x576539['where']=_['merge'](_0x576539[_0xd3b3('0x39')],{'$or':_['map'](_0x576539['attributes'],function(_0x36cbe3){var _0x4c5f7a={};_0x4c5f7a[_0x36cbe3]={'$like':'%'+_0x1d108f[_0xd3b3('0x30')]['filter']+'%'};return _0x4c5f7a;})});}_0x576539=_[_0xd3b3('0x3b')]({},_0x576539,_0x1d108f['options']);var _0x4ce3fa={'where':_0x576539[_0xd3b3('0x39')]};return db[_0xd3b3('0x2c')][_0xd3b3('0x20')](_0x4ce3fa)['then'](function(_0x1abe28){_0x5f3422[_0xd3b3('0x20')]=_0x1abe28;if(_0x1d108f[_0xd3b3('0x30')]['includeAll']){_0x576539[_0xd3b3('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd3b3('0x4c')](_0x576539);})[_0xd3b3('0x3e')](function(_0x4568f4){_0x5f3422['rows']=_0x4568f4;return _0x5f3422;})[_0xd3b3('0x3e')](respondWithFilteredResult(_0x23f13a,_0x576539,_0xd3b3('0x4d')))['catch'](handleError(_0x23f13a,null,_0xd3b3('0x4d')));}; \ No newline at end of file +var _0x4b4a=['rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','options','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','VoiceQueueReport','includeAll','include','findAll'];(function(_0x3f4263,_0xb27633){var _0x2881d4=function(_0x3f41d4){while(--_0x3f41d4){_0x3f4263['push'](_0x3f4263['shift']());}};_0x2881d4(++_0xb27633);}(_0x4b4a,0xa9));var _0xa4b4=function(_0x42d0ed,_0x91a115){_0x42d0ed=_0x42d0ed-0x0;var _0x3f63f6=_0x4b4a[_0x42d0ed];return _0x3f63f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa4b4('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa4b4('0x1'));var Mustache=require(_0xa4b4('0x2'));var util=require(_0xa4b4('0x3'));var path=require('path');var sox=require(_0xa4b4('0x4'));var csv=require(_0xa4b4('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4b4('0x6'));var squel=require('squel');var crypto=require(_0xa4b4('0x7'));var jsforce=require(_0xa4b4('0x8'));var deskjs=require(_0xa4b4('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa4b4('0xa'));var Papa=require('papaparse');var Redis=require(_0xa4b4('0xb'));var authService=require(_0xa4b4('0xc'));var qs=require(_0xa4b4('0xd'));var as=require(_0xa4b4('0xe'));var hardwareService=require(_0xa4b4('0xf'));var logger=require(_0xa4b4('0x10'))(_0xa4b4('0x11'));var utils=require(_0xa4b4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa4b4('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa4b4('0x14')](config[_0xa4b4('0x15')],{'host':_0xa4b4('0x16'),'port':0x18eb});var socket=require(_0xa4b4('0x17'))(new Redis(config[_0xa4b4('0x15')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x220c14,_0x48a802){_0x48a802=_0x48a802||0xcc;return function(_0x103916){if(_0x103916){return _0x220c14[_0xa4b4('0x18')](_0x48a802);}return _0x220c14[_0xa4b4('0x19')](_0x48a802)[_0xa4b4('0x1a')]();};}function respondWithResult(_0x440f1d,_0x465d43){_0x465d43=_0x465d43||0xc8;return function(_0x11784f){if(_0x11784f){return _0x440f1d['status'](_0x465d43)[_0xa4b4('0x1b')](_0x11784f);}};}function respondWithFilteredResult(_0x3d479f,_0x17d77b){return function(_0x189be6){if(_0x189be6){var _0x4c6af2=typeof _0x17d77b[_0xa4b4('0x1c')]===_0xa4b4('0x1d')&&typeof _0x17d77b[_0xa4b4('0x1e')]==='undefined';var _0x4e6f1f=_0x189be6[_0xa4b4('0x1f')];var _0x3c8418=_0x4c6af2?0x0:_0x17d77b[_0xa4b4('0x1c')];var _0x5ddbe1=_0x4c6af2?_0x189be6[_0xa4b4('0x1f')]:_0x17d77b['offset']+_0x17d77b[_0xa4b4('0x1e')];var _0x3f1255;if(_0x5ddbe1>=_0x4e6f1f){_0x5ddbe1=_0x4e6f1f;_0x3f1255=0xc8;}else{_0x3f1255=0xce;}_0x3d479f[_0xa4b4('0x19')](_0x3f1255);return _0x3d479f[_0xa4b4('0x20')](_0xa4b4('0x21'),_0x3c8418+'-'+_0x5ddbe1+'/'+_0x4e6f1f)[_0xa4b4('0x1b')](_0x189be6);}return null;};}function patchUpdates(_0x2380fd){return function(_0x3c721b){try{jsonpatch[_0xa4b4('0x22')](_0x3c721b,_0x2380fd,!![]);}catch(_0x189d9a){return BPromise['reject'](_0x189d9a);}return _0x3c721b[_0xa4b4('0x23')]();};}function saveUpdates(_0x195223,_0x238da1){return function(_0x103605){if(_0x103605){return _0x103605[_0xa4b4('0x24')](_0x195223)[_0xa4b4('0x25')](function(_0x104365){return _0x104365;});}return null;};}function removeEntity(_0x1186ec,_0x24896d){return function(_0x1d4082){if(_0x1d4082){return _0x1d4082[_0xa4b4('0x26')]()[_0xa4b4('0x25')](function(){_0x1186ec[_0xa4b4('0x19')](0xcc)[_0xa4b4('0x1a')]();});}};}function handleEntityNotFound(_0x5f4376,_0x556610){return function(_0x4bc1d4){if(!_0x4bc1d4){_0x5f4376[_0xa4b4('0x18')](0x194);}return _0x4bc1d4;};}function handleError(_0x531c97,_0x2d6288){_0x2d6288=_0x2d6288||0x1f4;return function(_0x4bf0f8){logger['error'](_0x4bf0f8[_0xa4b4('0x27')]);if(_0x4bf0f8[_0xa4b4('0x28')]){delete _0x4bf0f8[_0xa4b4('0x28')];}_0x531c97[_0xa4b4('0x19')](_0x2d6288)[_0xa4b4('0x29')](_0x4bf0f8);};}exports[_0xa4b4('0x2a')]=function(_0x233561,_0x3dfdea){var _0xbd1699={},_0x482787={},_0x508485={'count':0x0,'rows':[]};var _0x4174b9=_[_0xa4b4('0x2b')](db['VoiceQueueReport'][_0xa4b4('0x2c')],function(_0x3599d0){return{'name':_0x3599d0[_0xa4b4('0x2d')],'type':_0x3599d0[_0xa4b4('0x2e')][_0xa4b4('0x2f')]};});_0x482787['model']=_['map'](_0x4174b9,_0xa4b4('0x28'));_0x482787['query']=_[_0xa4b4('0x30')](_0x233561[_0xa4b4('0x31')]);_0x482787[_0xa4b4('0x32')]=_[_0xa4b4('0x33')](_0x482787[_0xa4b4('0x34')],_0x482787[_0xa4b4('0x31')]);_0xbd1699[_0xa4b4('0x35')]=_[_0xa4b4('0x33')](_0x482787['model'],qs[_0xa4b4('0x36')](_0x233561['query'][_0xa4b4('0x36')]));_0xbd1699[_0xa4b4('0x35')]=_0xbd1699[_0xa4b4('0x35')][_0xa4b4('0x37')]?_0xbd1699[_0xa4b4('0x35')]:_0x482787[_0xa4b4('0x34')];if(!_0x233561['query'][_0xa4b4('0x38')]('nolimit')){_0xbd1699[_0xa4b4('0x1e')]=qs[_0xa4b4('0x1e')](_0x233561['query']['limit']);_0xbd1699[_0xa4b4('0x1c')]=qs['offset'](_0x233561['query'][_0xa4b4('0x1c')]);}_0xbd1699[_0xa4b4('0x39')]=qs[_0xa4b4('0x3a')](_0x233561[_0xa4b4('0x31')][_0xa4b4('0x3a')]);_0xbd1699[_0xa4b4('0x3b')]=qs[_0xa4b4('0x32')](_[_0xa4b4('0x3c')](_0x233561[_0xa4b4('0x31')],_0x482787['filters']),_0x4174b9);if(_0x233561['query'][_0xa4b4('0x3d')]){_0xbd1699['where']=_[_0xa4b4('0x3e')](_0xbd1699[_0xa4b4('0x3b')],{'$or':_[_0xa4b4('0x2b')](_0x4174b9,function(_0x2cea32){if(_0x2cea32['type']!==_0xa4b4('0x3f')){var _0x394aee={};_0x394aee[_0x2cea32['name']]={'$like':'%'+_0x233561[_0xa4b4('0x31')][_0xa4b4('0x3d')]+'%'};return _0x394aee;}})});}_0xbd1699=_[_0xa4b4('0x3e')]({},_0xbd1699,_0x233561['options']);var _0x415b40={'where':_0xbd1699[_0xa4b4('0x3b')]};return db[_0xa4b4('0x40')][_0xa4b4('0x1f')](_0x415b40)['then'](function(_0x572903){_0x508485[_0xa4b4('0x1f')]=_0x572903;if(_0x233561[_0xa4b4('0x31')][_0xa4b4('0x41')]){_0xbd1699[_0xa4b4('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa4b4('0x43')](_0xbd1699);})[_0xa4b4('0x25')](function(_0x141adc){_0x508485[_0xa4b4('0x44')]=_0x141adc;return _0x508485;})[_0xa4b4('0x25')](respondWithFilteredResult(_0x3dfdea,_0xbd1699))[_0xa4b4('0x45')](handleError(_0x3dfdea,null));};exports[_0xa4b4('0x46')]=function(_0x1fa793,_0x7078e5){var _0x60fb21={'raw':![],'where':{'id':_0x1fa793[_0xa4b4('0x47')]['id']}},_0x10fba2={};_0x10fba2[_0xa4b4('0x34')]=_['keys'](db[_0xa4b4('0x40')][_0xa4b4('0x2c')]);_0x10fba2[_0xa4b4('0x31')]=_[_0xa4b4('0x30')](_0x1fa793['query']);_0x10fba2[_0xa4b4('0x32')]=_[_0xa4b4('0x33')](_0x10fba2[_0xa4b4('0x34')],_0x10fba2[_0xa4b4('0x31')]);_0x60fb21[_0xa4b4('0x35')]=_[_0xa4b4('0x33')](_0x10fba2[_0xa4b4('0x34')],qs['fields'](_0x1fa793[_0xa4b4('0x31')][_0xa4b4('0x36')]));_0x60fb21['attributes']=_0x60fb21[_0xa4b4('0x35')]['length']?_0x60fb21[_0xa4b4('0x35')]:_0x10fba2[_0xa4b4('0x34')];if(_0x1fa793['query']['includeAll']){_0x60fb21['include']=[{'all':!![]}];}_0x60fb21=_[_0xa4b4('0x3e')]({},_0x60fb21,_0x1fa793['options']);return db[_0xa4b4('0x40')][_0xa4b4('0x48')](_0x60fb21)['then'](handleEntityNotFound(_0x7078e5,null))['then'](respondWithResult(_0x7078e5,null))[_0xa4b4('0x45')](handleError(_0x7078e5,null));};exports[_0xa4b4('0x49')]=function(_0x549b01,_0x453a07){return db['VoiceQueueReport'][_0xa4b4('0x49')](_0x549b01[_0xa4b4('0x4a')],{})['then'](respondWithResult(_0x453a07,0xc9))[_0xa4b4('0x45')](handleError(_0x453a07,null));};exports['update']=function(_0x32db51,_0x4ebe3d){if(_0x32db51[_0xa4b4('0x4a')]['id']){delete _0x32db51[_0xa4b4('0x4a')]['id'];}return db[_0xa4b4('0x40')][_0xa4b4('0x48')]({'where':{'id':_0x32db51[_0xa4b4('0x47')]['id']}})[_0xa4b4('0x25')](handleEntityNotFound(_0x4ebe3d,null))[_0xa4b4('0x25')](saveUpdates(_0x32db51['body'],null))[_0xa4b4('0x25')](respondWithResult(_0x4ebe3d,null))[_0xa4b4('0x45')](handleError(_0x4ebe3d,null));};exports['destroy']=function(_0x62920,_0x232b2b){return db[_0xa4b4('0x40')][_0xa4b4('0x48')]({'where':{'id':_0x62920[_0xa4b4('0x47')]['id']}})[_0xa4b4('0x25')](handleEntityNotFound(_0x232b2b,null))[_0xa4b4('0x25')](removeEntity(_0x232b2b,null))[_0xa4b4('0x45')](handleError(_0x232b2b,null));};exports[_0xa4b4('0x4b')]=function(_0xc7037,_0x4496a0){return db[_0xa4b4('0x40')][_0xa4b4('0x4b')]()[_0xa4b4('0x25')](respondWithResult(_0x4496a0,null))[_0xa4b4('0x45')](handleError(_0x4496a0,null));};exports[_0xa4b4('0x4c')]=function(_0x110b30,_0x4b2ec5){var _0x5d0e95={},_0x34232b={},_0x17c58c={'count':0x0,'rows':[]};_0x34232b['model']=_[_0xa4b4('0x30')](db[_0xa4b4('0x40')][_0xa4b4('0x2c')]);_0x34232b[_0xa4b4('0x31')]=_[_0xa4b4('0x30')](_0x110b30[_0xa4b4('0x31')]);_0x34232b[_0xa4b4('0x32')]=_[_0xa4b4('0x33')](_0x34232b[_0xa4b4('0x34')],_0x34232b[_0xa4b4('0x31')]);_0x5d0e95[_0xa4b4('0x35')]=_[_0xa4b4('0x33')](_0x34232b[_0xa4b4('0x34')],qs[_0xa4b4('0x36')](_0x110b30['query']['fields']));_0x5d0e95[_0xa4b4('0x35')]=_0x5d0e95['attributes'][_0xa4b4('0x37')]?_0x5d0e95[_0xa4b4('0x35')]:_0x34232b['model'];if(!_0x110b30['query'][_0xa4b4('0x38')](_0xa4b4('0x4d'))){_0x5d0e95[_0xa4b4('0x1e')]=qs[_0xa4b4('0x1e')](_0x110b30[_0xa4b4('0x31')][_0xa4b4('0x1e')]);_0x5d0e95[_0xa4b4('0x1c')]=qs['offset'](_0x110b30['query'][_0xa4b4('0x1c')]);}_0x5d0e95[_0xa4b4('0x39')]=qs['sort'](_0x110b30[_0xa4b4('0x31')][_0xa4b4('0x3a')]);_0x5d0e95[_0xa4b4('0x3b')]=qs[_0xa4b4('0x32')](_[_0xa4b4('0x3c')](_0x110b30['query'],_0x34232b[_0xa4b4('0x32')]));if(_0x110b30['query'][_0xa4b4('0x3d')]){_0x5d0e95[_0xa4b4('0x3b')]=_[_0xa4b4('0x3e')](_0x5d0e95[_0xa4b4('0x3b')],{'$or':_[_0xa4b4('0x2b')](_0x5d0e95['attributes'],function(_0x464dff){var _0x2c510b={};_0x2c510b[_0x464dff]={'$like':'%'+_0x110b30[_0xa4b4('0x31')]['filter']+'%'};return _0x2c510b;})});}_0x5d0e95=_[_0xa4b4('0x3e')]({},_0x5d0e95,_0x110b30[_0xa4b4('0x4e')]);var _0xa01d5c={'where':_0x5d0e95['where']};return db[_0xa4b4('0x40')]['count'](_0xa01d5c)[_0xa4b4('0x25')](function(_0x1ffda3){_0x17c58c[_0xa4b4('0x1f')]=_0x1ffda3;if(_0x110b30[_0xa4b4('0x31')][_0xa4b4('0x41')]){_0x5d0e95[_0xa4b4('0x42')]=[{'all':!![]}];}return db[_0xa4b4('0x40')]['findAll'](_0x5d0e95);})[_0xa4b4('0x25')](function(_0x586787){_0x17c58c[_0xa4b4('0x44')]=_0x586787;return _0x17c58c;})[_0xa4b4('0x25')](respondWithFilteredResult(_0x4b2ec5,_0x5d0e95,'getVoiceQueuesReport'))[_0xa4b4('0x45')](handleError(_0x4b2ec5,null,_0xa4b4('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 26ce57f..41da65c 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 _0x991e=['events','VoiceQueueReport','remove','emit','hasOwnProperty','exports'];(function(_0x268c27,_0x2ef378){var _0x36e9ba=function(_0x176deb){while(--_0x176deb){_0x268c27['push'](_0x268c27['shift']());}};_0x36e9ba(++_0x2ef378);}(_0x991e,0x14a));var _0xe991=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x991e[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xe991('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xe991('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe991('0x2')};function emitEvent(_0x42bac3){return function(_0x215b8a,_0x51e898,_0x4cca02){VoiceQueueReportEvents[_0xe991('0x3')](_0x42bac3+':'+_0x215b8a['id'],_0x215b8a);VoiceQueueReportEvents[_0xe991('0x3')](_0x42bac3,_0x215b8a);_0x4cca02(null);};}for(var e in events){if(events[_0xe991('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xe991('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xbf35=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x59f585,_0x369153){var _0xfd320b=function(_0x427703){while(--_0x427703){_0x59f585['push'](_0x59f585['shift']());}};_0xfd320b(++_0x369153);}(_0xbf35,0x1ad));var _0x5bf3=function(_0xfa629a,_0x104c68){_0xfa629a=_0xfa629a-0x0;var _0x53ee08=_0xbf35[_0xfa629a];return _0x53ee08;};'use strict';var EventEmitter=require(_0x5bf3('0x0'));var VoiceQueueReport=require(_0x5bf3('0x1'))['db'][_0x5bf3('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5bf3('0x3')](0x0);var events={'afterCreate':_0x5bf3('0x4'),'afterUpdate':_0x5bf3('0x5'),'afterDestroy':_0x5bf3('0x6')};function emitEvent(_0x2b2d51){return function(_0xdd0839,_0x337822,_0xdfcae7){VoiceQueueReportEvents[_0x5bf3('0x7')](_0x2b2d51+':'+_0xdd0839['id'],_0xdd0839);VoiceQueueReportEvents[_0x5bf3('0x7')](_0x2b2d51,_0xdd0839);_0xdfcae7(null);};}for(var e in events){if(events[_0x5bf3('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5bf3('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9598deb..d67066d 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 _0x07b5=['request-promise','path','rimraf','../../config/environment','exports','define','report_queue','lodash','util','../../config/logger','bluebird'];(function(_0x561bc2,_0x56142d){var _0x1046a7=function(_0x37b23c){while(--_0x37b23c){_0x561bc2['push'](_0x561bc2['shift']());}};_0x1046a7(++_0x56142d);}(_0x07b5,0x10f));var _0x507b=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x07b5[_0x215dc8];return _0x583ea3;};'use strict';var _=require(_0x507b('0x0'));var util=require(_0x507b('0x1'));var logger=require(_0x507b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x507b('0x3'));var rp=require(_0x507b('0x4'));var fs=require('fs');var path=require(_0x507b('0x5'));var rimraf=require(_0x507b('0x6'));var config=require(_0x507b('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x507b('0x8')]=function(_0x41c082,_0x414133){return _0x41c082[_0x507b('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x507b('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x613d=['report_queue','calleridnum','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','VoiceQueueReport'];(function(_0x5733ee,_0x455514){var _0x38b96e=function(_0x591407){while(--_0x591407){_0x5733ee['push'](_0x5733ee['shift']());}};_0x38b96e(++_0x455514);}(_0x613d,0x1c5));var _0xd613=function(_0x3d46cf,_0x1d39e9){_0x3d46cf=_0x3d46cf-0x0;var _0x1e048e=_0x613d[_0x3d46cf];return _0x1e048e;};'use strict';var _=require(_0xd613('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd613('0x1'));var moment=require(_0xd613('0x2'));var BPromise=require(_0xd613('0x3'));var rp=require(_0xd613('0x4'));var fs=require('fs');var path=require(_0xd613('0x5'));var rimraf=require(_0xd613('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xd613('0x7')]=function(_0x2ad800,_0x5af017){return _0x2ad800['define'](_0xd613('0x8'),attributes,{'tableName':_0xd613('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd613('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index a0f1a96..b391ec4 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 _0x1644=['stringify','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','catch','GetVoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model'];(function(_0x54f8bb,_0x42e382){var _0x19687d=function(_0x368a8a){while(--_0x368a8a){_0x54f8bb['push'](_0x54f8bb['shift']());}};_0x19687d(++_0x42e382);}(_0x1644,0x1bf));var _0x4164=function(_0x5b89c7,_0x22994c){_0x5b89c7=_0x5b89c7-0x0;var _0x332b50=_0x1644[_0x5b89c7];return _0x332b50;};'use strict';var _=require(_0x4164('0x0'));var util=require(_0x4164('0x1'));var moment=require(_0x4164('0x2'));var BPromise=require('bluebird');var rs=require(_0x4164('0x3'));var fs=require('fs');var Redis=require(_0x4164('0x4'));var db=require(_0x4164('0x5'))['db'];var utils=require(_0x4164('0x6'));var logger=require(_0x4164('0x7'))(_0x4164('0x8'));var config=require(_0x4164('0x9'));var jayson=require(_0x4164('0xa'));var client=jayson[_0x4164('0xb')][_0x4164('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4164('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4164('0xd')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0xdd66cd,_0x3ccff3,_0x1ff901){return new BPromise(function(_0xfa9c36,_0x49bfc8){return client['request'](_0xdd66cd,_0x1ff901)[_0x4164('0xe')](function(_0x3885c7){logger['info'](_0x4164('0xf'),_0x3ccff3,_0x4164('0x10'));logger[_0x4164('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3ccff3,'request\x20sent',JSON['stringify'](_0x3885c7));if(_0x3885c7['error']){if(_0x3885c7['error'][_0x4164('0x12')]===0x1f4){logger['error'](_0x4164('0xf'),_0x3ccff3,_0x3885c7[_0x4164('0x13')][_0x4164('0x14')]);return _0x49bfc8(_0x3885c7['error'][_0x4164('0x14')]);}logger[_0x4164('0x13')](_0x4164('0xf'),_0x3ccff3,_0x3885c7[_0x4164('0x13')][_0x4164('0x14')]);return _0xfa9c36(_0x3885c7[_0x4164('0x13')][_0x4164('0x14')]);}else{logger[_0x4164('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x3ccff3,_0x4164('0x10'));_0xfa9c36(_0x3885c7['result'][_0x4164('0x14')]);}})[_0x4164('0x16')](function(_0x2338c6){logger[_0x4164('0x13')](_0x4164('0xf'),_0x3ccff3,_0x2338c6);_0x49bfc8(_0x2338c6);});});}exports[_0x4164('0x17')]=function(_0x553332){var _0x4ef5e4=this;return new Promise(function(_0x3e1941,_0x2d2a7a){return db['VoiceQueueReport'][_0x4164('0x18')]({'raw':_0x553332['options']?_0x553332['options'][_0x4164('0x19')]===undefined?!![]:![]:!![],'where':_0x553332[_0x4164('0x1a')]?_0x553332[_0x4164('0x1a')][_0x4164('0x1b')]||null:null,'attributes':_0x553332['options']?_0x553332['options'][_0x4164('0x1c')]||null:null,'limit':_0x553332['options']?_0x553332['options'][_0x4164('0x1d')]||null:null,'include':_0x553332[_0x4164('0x1a')]?_0x553332[_0x4164('0x1a')][_0x4164('0x1e')]?_[_0x4164('0x1f')](_0x553332['options'][_0x4164('0x1e')],function(_0x293342){return{'model':db[_0x293342[_0x4164('0x20')]],'as':_0x293342['as'],'attributes':_0x293342['attributes'],'include':_0x293342[_0x4164('0x1e')]?_[_0x4164('0x1f')](_0x293342['include'],function(_0x5bfbd6){return{'model':db[_0x5bfbd6['model']],'as':_0x5bfbd6['as'],'attributes':_0x5bfbd6[_0x4164('0x1c')],'include':_0x5bfbd6[_0x4164('0x1e')]?_[_0x4164('0x1f')](_0x5bfbd6[_0x4164('0x1e')],function(_0x2f07fd){return{'model':db[_0x2f07fd[_0x4164('0x20')]],'as':_0x2f07fd['as'],'attributes':_0x2f07fd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4164('0xe')](function(_0x3f2681){logger[_0x4164('0x15')](_0x4164('0x17'),_0x553332);logger[_0x4164('0x11')]('GetVoiceQueueReport',_0x553332,JSON[_0x4164('0x21')](_0x3f2681));_0x3e1941(_0x3f2681);})[_0x4164('0x16')](function(_0x5adebb){logger['error'](_0x4164('0x17'),_0x5adebb['message'],_0x553332);_0x2d2a7a(_0x4ef5e4[_0x4164('0x13')](0x1f4,_0x5adebb[_0x4164('0x14')]));});});};exports[_0x4164('0x22')]=function(_0x370311){var _0x2303d1=this;return new Promise(function(_0xce4fdc,_0x3a8e1f){return db[_0x4164('0x23')][_0x4164('0x24')](_0x370311[_0x4164('0x25')],{'raw':_0x370311[_0x4164('0x1a')]?_0x370311[_0x4164('0x1a')][_0x4164('0x19')]===undefined?!![]:![]:!![]})[_0x4164('0xe')](function(_0x30a3c3){logger[_0x4164('0x15')](_0x4164('0x22'),_0x370311);logger[_0x4164('0x11')](_0x4164('0x22'),_0x370311,JSON[_0x4164('0x21')](_0x30a3c3));_0xce4fdc(_0x30a3c3);})[_0x4164('0x16')](function(_0x112ee3){logger[_0x4164('0x13')]('CreateVoiceQueueReport',_0x112ee3[_0x4164('0x14')],_0x370311);_0x3a8e1f(_0x2303d1[_0x4164('0x13')](0x1f4,_0x112ee3[_0x4164('0x14')]));});});};exports[_0x4164('0x26')]=function(_0x53e6f9){var _0x3beded=this;return new Promise(function(_0x578307,_0x5c5a5e){return db[_0x4164('0x23')][_0x4164('0x27')](_0x53e6f9[_0x4164('0x25')],{'raw':_0x53e6f9[_0x4164('0x1a')]?_0x53e6f9['options'][_0x4164('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53e6f9[_0x4164('0x1a')]?_0x53e6f9[_0x4164('0x1a')][_0x4164('0x1b')]||null:null,'attributes':_0x53e6f9['options']?_0x53e6f9[_0x4164('0x1a')]['attributes']||null:null,'limit':_0x53e6f9[_0x4164('0x1a')]?_0x53e6f9['options'][_0x4164('0x1d')]||null:null})[_0x4164('0xe')](function(_0x4ff09b){logger['info']('UpdateVoiceQueueReport',_0x53e6f9);logger[_0x4164('0x11')](_0x4164('0x26'),_0x53e6f9,JSON[_0x4164('0x21')](_0x4ff09b));_0x578307(_0x4ff09b);})['catch'](function(_0x16540f){logger['error'](_0x4164('0x26'),_0x16540f[_0x4164('0x14')],_0x53e6f9);_0x5c5a5e(_0x3beded[_0x4164('0x13')](0x1f4,_0x16540f[_0x4164('0x14')]));});});}; \ No newline at end of file +var _0x3084=['error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','model','include','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x2d55b4,_0x10bcd9){var _0x3b42d8=function(_0x1bbc1f){while(--_0x1bbc1f){_0x2d55b4['push'](_0x2d55b4['shift']());}};_0x3b42d8(++_0x10bcd9);}(_0x3084,0x6d));var _0x4308=function(_0x25fc0e,_0x1884aa){_0x25fc0e=_0x25fc0e-0x0;var _0x4ab150=_0x3084[_0x25fc0e];return _0x4ab150;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4308('0x0'));var BPromise=require(_0x4308('0x1'));var rs=require(_0x4308('0x2'));var fs=require('fs');var Redis=require(_0x4308('0x3'));var db=require(_0x4308('0x4'))['db'];var utils=require(_0x4308('0x5'));var logger=require(_0x4308('0x6'))(_0x4308('0x7'));var config=require('../../config/environment');var jayson=require(_0x4308('0x8'));var client=jayson['client'][_0x4308('0x9')]({'port':0x232a});config[_0x4308('0xa')]=_[_0x4308('0xb')](config[_0x4308('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4308('0xc'))(new Redis(config[_0x4308('0xa')]));require(_0x4308('0xd'))[_0x4308('0xe')](socket);function respondWithRpcPromise(_0x5acbd6,_0x475068,_0x364c28){return new BPromise(function(_0x51bdcf,_0x55e055){return client[_0x4308('0xf')](_0x5acbd6,_0x364c28)[_0x4308('0x10')](function(_0xd954e0){logger['info'](_0x4308('0x11'),_0x475068,_0x4308('0x12'));logger[_0x4308('0x13')](_0x4308('0x14'),_0x475068,_0x4308('0x12'),JSON[_0x4308('0x15')](_0xd954e0));if(_0xd954e0['error']){if(_0xd954e0['error'][_0x4308('0x16')]===0x1f4){logger['error'](_0x4308('0x11'),_0x475068,_0xd954e0[_0x4308('0x17')]['message']);return _0x55e055(_0xd954e0[_0x4308('0x17')][_0x4308('0x18')]);}logger['error'](_0x4308('0x11'),_0x475068,_0xd954e0[_0x4308('0x17')][_0x4308('0x18')]);return _0x51bdcf(_0xd954e0['error'][_0x4308('0x18')]);}else{logger[_0x4308('0x19')](_0x4308('0x11'),_0x475068,_0x4308('0x12'));_0x51bdcf(_0xd954e0[_0x4308('0x1a')][_0x4308('0x18')]);}})[_0x4308('0x1b')](function(_0x2e9918){logger[_0x4308('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x475068,_0x2e9918);_0x55e055(_0x2e9918);});});}exports[_0x4308('0x1c')]=function(_0x55afbc){var _0x9b98f7=this;return new Promise(function(_0x387349,_0x430246){return db[_0x4308('0x1d')][_0x4308('0x1e')]({'raw':_0x55afbc[_0x4308('0x1f')]?_0x55afbc[_0x4308('0x1f')][_0x4308('0x20')]===undefined?!![]:![]:!![],'where':_0x55afbc[_0x4308('0x1f')]?_0x55afbc['options'][_0x4308('0x21')]||null:null,'attributes':_0x55afbc[_0x4308('0x1f')]?_0x55afbc[_0x4308('0x1f')][_0x4308('0x22')]||null:null,'limit':_0x55afbc[_0x4308('0x1f')]?_0x55afbc[_0x4308('0x1f')][_0x4308('0x23')]||null:null,'include':_0x55afbc[_0x4308('0x1f')]?_0x55afbc[_0x4308('0x1f')]['include']?_[_0x4308('0x24')](_0x55afbc[_0x4308('0x1f')]['include'],function(_0x46c71e){return{'model':db[_0x46c71e[_0x4308('0x25')]],'as':_0x46c71e['as'],'attributes':_0x46c71e[_0x4308('0x22')],'include':_0x46c71e['include']?_[_0x4308('0x24')](_0x46c71e[_0x4308('0x26')],function(_0x4d6a8d){return{'model':db[_0x4d6a8d[_0x4308('0x25')]],'as':_0x4d6a8d['as'],'attributes':_0x4d6a8d[_0x4308('0x22')],'include':_0x4d6a8d['include']?_[_0x4308('0x24')](_0x4d6a8d[_0x4308('0x26')],function(_0x1fb936){return{'model':db[_0x1fb936['model']],'as':_0x1fb936['as'],'attributes':_0x1fb936[_0x4308('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4308('0x10')](function(_0x3b81b9){logger[_0x4308('0x19')]('GetVoiceQueueReport',_0x55afbc);logger['debug']('GetVoiceQueueReport',_0x55afbc,JSON['stringify'](_0x3b81b9));_0x387349(_0x3b81b9);})['catch'](function(_0x4f8d23){logger['error'](_0x4308('0x1c'),_0x4f8d23[_0x4308('0x18')],_0x55afbc);_0x430246(_0x9b98f7[_0x4308('0x17')](0x1f4,_0x4f8d23['message']));});});};exports[_0x4308('0x27')]=function(_0x3fa154){var _0x40ac09=this;return new Promise(function(_0x469d1b,_0xd74bc4){return db[_0x4308('0x1d')][_0x4308('0x28')](_0x3fa154['body'],{'raw':_0x3fa154[_0x4308('0x1f')]?_0x3fa154[_0x4308('0x1f')][_0x4308('0x20')]===undefined?!![]:![]:!![]})[_0x4308('0x10')](function(_0x5be6bc){logger[_0x4308('0x19')](_0x4308('0x27'),_0x3fa154);logger[_0x4308('0x13')](_0x4308('0x27'),_0x3fa154,JSON[_0x4308('0x15')](_0x5be6bc));_0x469d1b(_0x5be6bc);})[_0x4308('0x1b')](function(_0x460f57){logger[_0x4308('0x17')](_0x4308('0x27'),_0x460f57['message'],_0x3fa154);_0xd74bc4(_0x40ac09[_0x4308('0x17')](0x1f4,_0x460f57[_0x4308('0x18')]));});});};exports[_0x4308('0x29')]=function(_0x386527){var _0x53e9cc=this;return new Promise(function(_0x4c65da,_0xc4feb8){return db[_0x4308('0x1d')][_0x4308('0x2a')](_0x386527[_0x4308('0x2b')],{'raw':_0x386527['options']?_0x386527[_0x4308('0x1f')][_0x4308('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386527[_0x4308('0x1f')]?_0x386527[_0x4308('0x1f')][_0x4308('0x21')]||null:null,'attributes':_0x386527[_0x4308('0x1f')]?_0x386527[_0x4308('0x1f')][_0x4308('0x22')]||null:null,'limit':_0x386527['options']?_0x386527[_0x4308('0x1f')][_0x4308('0x23')]||null:null})[_0x4308('0x10')](function(_0x34c878){logger[_0x4308('0x19')](_0x4308('0x29'),_0x386527);logger[_0x4308('0x13')](_0x4308('0x29'),_0x386527,JSON[_0x4308('0x15')](_0x34c878));_0x4c65da(_0x34c878);})[_0x4308('0x1b')](function(_0x27eda0){logger[_0x4308('0x17')](_0x4308('0x29'),_0x27eda0[_0x4308('0x18')],_0x386527);_0xc4feb8(_0x53e9cc[_0x4308('0x17')](0x1f4,_0x27eda0[_0x4308('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 78410c1..f211be2 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 _0x979e=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x2bb0c8,_0x455801){var _0xe7d171=function(_0x42f8a0){while(--_0x42f8a0){_0x2bb0c8['push'](_0x2bb0c8['shift']());}};_0xe7d171(++_0x455801);}(_0x979e,0x195));var _0xe979=function(_0x3bc956,_0x36c98d){_0x3bc956=_0x3bc956-0x0;var _0x5158d3=_0x979e[_0x3bc956];return _0x5158d3;};'use strict';var VoiceQueueReportEvents=require(_0xe979('0x0'));var events=[_0xe979('0x1'),_0xe979('0x2'),_0xe979('0x3')];function createListener(_0x5ce889,_0x10fb90){return function(_0x47321a){_0x10fb90[_0xe979('0x4')](_0x5ce889,_0x47321a);};}function removeListener(_0x3b4b06,_0x2d62dd){return function(){VoiceQueueReportEvents['removeListener'](_0x3b4b06,_0x2d62dd);};}exports[_0xe979('0x5')]=function(_0x580e20){for(var _0x1a0d35=0x0,_0x13a9ee=events[_0xe979('0x6')];_0x1a0d35<_0x13a9ee;_0x1a0d35++){var _0xc63524=events[_0x1a0d35];var _0xc79c06=createListener(_0xe979('0x7')+_0xc63524,_0x580e20);VoiceQueueReportEvents['on'](_0xc63524,_0xc79c06);}}; \ No newline at end of file +var _0xdfe7=['length','voiceQueueReport:','save','remove','emit','removeListener'];(function(_0x44b73e,_0x232885){var _0x33634c=function(_0x4ae6c5){while(--_0x4ae6c5){_0x44b73e['push'](_0x44b73e['shift']());}};_0x33634c(++_0x232885);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x486428,_0x4f4e75){_0x486428=_0x486428-0x0;var _0x314f04=_0xdfe7[_0x486428];return _0x314f04;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x7dfe('0x0'),_0x7dfe('0x1'),'update'];function createListener(_0x162e75,_0x36c721){return function(_0x388848){_0x36c721[_0x7dfe('0x2')](_0x162e75,_0x388848);};}function removeListener(_0x527490,_0x2c07d2){return function(){VoiceQueueReportEvents[_0x7dfe('0x3')](_0x527490,_0x2c07d2);};}exports['register']=function(_0x262561){for(var _0x3d8220=0x0,_0x23d0c1=events[_0x7dfe('0x4')];_0x3d8220<_0x23d0c1;_0x3d8220++){var _0x56d67e=events[_0x3d8220];var _0x3fc0a0=createListener(_0x7dfe('0x5')+_0x56d67e,_0x262561);VoiceQueueReportEvents['on'](_0x56d67e,_0x3fc0a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a7ed44d..1ad04b0 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 _0xf322=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x153051,_0x1f6cd4){var _0x283297=function(_0x3f9390){while(--_0x3f9390){_0x153051['push'](_0x153051['shift']());}};_0x283297(++_0x1f6cd4);}(_0xf322,0x141));var _0x2f32=function(_0xbebb5b,_0x5b1eb9){_0xbebb5b=_0xbebb5b-0x0;var _0x382979=_0xf322[_0xbebb5b];return _0x382979;};'use strict';var multer=require(_0x2f32('0x0'));var util=require(_0x2f32('0x1'));var path=require('path');var timeout=require(_0x2f32('0x2'));var express=require(_0x2f32('0x3'));var router=express['Router']();var fs_extra=require(_0x2f32('0x4'));var auth=require(_0x2f32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2f32('0x6'));var controller=require(_0x2f32('0x7'));router[_0x2f32('0x8')]('/',auth[_0x2f32('0x9')](),controller['index']);router[_0x2f32('0x8')](_0x2f32('0xa'),auth[_0x2f32('0x9')](),controller['show']);router[_0x2f32('0xb')]('/',auth['isAuthenticated'](),controller[_0x2f32('0xc')]);router[_0x2f32('0xd')](_0x2f32('0xa'),auth[_0x2f32('0x9')](),controller[_0x2f32('0xe')]);router[_0x2f32('0xf')](_0x2f32('0xa'),auth['isAuthenticated'](),controller[_0x2f32('0x10')]);module['exports']=router; \ No newline at end of file +var _0x66c6=['multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports'];(function(_0xf32c15,_0x41d8b5){var _0x22a161=function(_0x4a6486){while(--_0x4a6486){_0xf32c15['push'](_0xf32c15['shift']());}};_0x22a161(++_0x41d8b5);}(_0x66c6,0x165));var _0x666c=function(_0x44fd28,_0x56e834){_0x44fd28=_0x44fd28-0x0;var _0x36c9c1=_0x66c6[_0x44fd28];return _0x36c9c1;};'use strict';var multer=require(_0x666c('0x0'));var util=require(_0x666c('0x1'));var path=require('path');var timeout=require(_0x666c('0x2'));var express=require('express');var router=express[_0x666c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x666c('0x4'));var config=require(_0x666c('0x5'));var controller=require(_0x666c('0x6'));router[_0x666c('0x7')]('/',auth['isAuthenticated'](),controller[_0x666c('0x8')]);router[_0x666c('0x7')](_0x666c('0x9'),auth[_0x666c('0xa')](),controller[_0x666c('0xb')]);router[_0x666c('0xc')]('/',auth['isAuthenticated'](),controller[_0x666c('0xd')]);router['put'](_0x666c('0x9'),auth['isAuthenticated'](),controller[_0x666c('0xe')]);router['delete'](_0x666c('0x9'),auth['isAuthenticated'](),controller[_0x666c('0xf')]);module[_0x666c('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 94f294f..e481faf 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 _0x49b9=['moment','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x556dda,_0x3180e8){var _0x3405ce=function(_0x4b0aac){while(--_0x4b0aac){_0x556dda['push'](_0x556dda['shift']());}};_0x3405ce(++_0x3180e8);}(_0x49b9,0xaa));var _0x949b=function(_0x1d9aaf,_0x2efc02){_0x1d9aaf=_0x1d9aaf-0x0;var _0x2c540f=_0x49b9[_0x1d9aaf];return _0x2c540f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x949b('0x0'));module[_0x949b('0x1')]={'time':{'type':Sequelize[_0x949b('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x949b('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x949b('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x949b('0x4'))}}; \ No newline at end of file +var _0x4471=['DATE','sequelize','exports','STRING'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4471,0x179));var _0x1447=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4471[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x1447('0x0'));var moment=require('moment');module[_0x1447('0x1')]={'time':{'type':Sequelize[_0x1447('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1447('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1447('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index ce66626..2782d6f 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 _0x905d=['VIRTUAL','VoiceQueuesLog','include','findAll','catch','show','length','includeAll','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x582269,_0x529ef3){var _0x506c1f=function(_0x361bc0){while(--_0x361bc0){_0x582269['push'](_0x582269['shift']());}};_0x506c1f(++_0x529ef3);}(_0x905d,0x16b));var _0xd905=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x905d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd905('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd905('0x1'));var jsonpatch=require(_0xd905('0x2'));var rp=require('request-promise');var moment=require(_0xd905('0x3'));var BPromise=require(_0xd905('0x4'));var Mustache=require(_0xd905('0x5'));var util=require('util');var path=require(_0xd905('0x6'));var sox=require(_0xd905('0x7'));var csv=require(_0xd905('0x8'));var ejs=require(_0xd905('0x9'));var fs=require('fs');var fs_extra=require(_0xd905('0xa'));var _=require('lodash');var squel=require(_0xd905('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd905('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd905('0xd'));var Redis=require(_0xd905('0xe'));var authService=require(_0xd905('0xf'));var qs=require(_0xd905('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd905('0x11'))(_0xd905('0x12'));var utils=require(_0xd905('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd905('0x14'));var db=require(_0xd905('0x15'))['db'];function respondWithStatusCode(_0x464cad,_0x496a21){_0x496a21=_0x496a21||0xcc;return function(_0x34f4fb){if(_0x34f4fb){return _0x464cad[_0xd905('0x16')](_0x496a21);}return _0x464cad['status'](_0x496a21)[_0xd905('0x17')]();};}function respondWithResult(_0x1f6001,_0xc2bf6a){_0xc2bf6a=_0xc2bf6a||0xc8;return function(_0x4082e5){if(_0x4082e5){return _0x1f6001[_0xd905('0x18')](_0xc2bf6a)[_0xd905('0x19')](_0x4082e5);}};}function respondWithFilteredResult(_0x1a101a,_0x56c714){return function(_0x305938){if(_0x305938){var _0x5e2f06=typeof _0x56c714['offset']===_0xd905('0x1a')&&typeof _0x56c714['limit']===_0xd905('0x1a');var _0x2e67d9=_0x305938['count'];var _0xf876e2=_0x5e2f06?0x0:_0x56c714[_0xd905('0x1b')];var _0x3b86e6=_0x5e2f06?_0x305938[_0xd905('0x1c')]:_0x56c714[_0xd905('0x1b')]+_0x56c714[_0xd905('0x1d')];var _0x239a1b;if(_0x3b86e6>=_0x2e67d9){_0x3b86e6=_0x2e67d9;_0x239a1b=0xc8;}else{_0x239a1b=0xce;}_0x1a101a['status'](_0x239a1b);return _0x1a101a[_0xd905('0x1e')](_0xd905('0x1f'),_0xf876e2+'-'+_0x3b86e6+'/'+_0x2e67d9)['json'](_0x305938);}return null;};}function patchUpdates(_0x182020){return function(_0x5a3959){try{jsonpatch[_0xd905('0x20')](_0x5a3959,_0x182020,!![]);}catch(_0x43edc6){return BPromise['reject'](_0x43edc6);}return _0x5a3959[_0xd905('0x21')]();};}function saveUpdates(_0x1e7547,_0x5d4089){return function(_0x1691e5){if(_0x1691e5){return _0x1691e5[_0xd905('0x22')](_0x1e7547)[_0xd905('0x23')](function(_0x20c335){return _0x20c335;});}return null;};}function removeEntity(_0x58d6b7,_0x5dae04){return function(_0x264aeb){if(_0x264aeb){return _0x264aeb[_0xd905('0x24')]()[_0xd905('0x23')](function(){_0x58d6b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdfa8e,_0x497433){return function(_0x1e3dfa){if(!_0x1e3dfa){_0xdfa8e[_0xd905('0x16')](0x194);}return _0x1e3dfa;};}function handleError(_0x422b62,_0x52409e){_0x52409e=_0x52409e||0x1f4;return function(_0x29905c){logger['error'](_0x29905c['stack']);if(_0x29905c[_0xd905('0x25')]){delete _0x29905c['name'];}_0x422b62['status'](_0x52409e)['send'](_0x29905c);};}exports[_0xd905('0x26')]=function(_0xede232,_0x25aa8f){var _0x53ff86={},_0x3c8e06={},_0x15f22f={'count':0x0,'rows':[]};var _0x3e80f3=_[_0xd905('0x27')](db['VoiceQueuesLog'][_0xd905('0x28')],function(_0x288eec){return{'name':_0x288eec['fieldName'],'type':_0x288eec[_0xd905('0x29')]['key']};});_0x3c8e06[_0xd905('0x2a')]=_[_0xd905('0x27')](_0x3e80f3,_0xd905('0x25'));_0x3c8e06[_0xd905('0x2b')]=_[_0xd905('0x2c')](_0xede232[_0xd905('0x2b')]);_0x3c8e06[_0xd905('0x2d')]=_[_0xd905('0x2e')](_0x3c8e06[_0xd905('0x2a')],_0x3c8e06['query']);_0x53ff86[_0xd905('0x2f')]=_[_0xd905('0x2e')](_0x3c8e06[_0xd905('0x2a')],qs['fields'](_0xede232[_0xd905('0x2b')][_0xd905('0x30')]));_0x53ff86['attributes']=_0x53ff86[_0xd905('0x2f')]['length']?_0x53ff86[_0xd905('0x2f')]:_0x3c8e06[_0xd905('0x2a')];if(!_0xede232[_0xd905('0x2b')][_0xd905('0x31')](_0xd905('0x32'))){_0x53ff86[_0xd905('0x1d')]=qs[_0xd905('0x1d')](_0xede232[_0xd905('0x2b')]['limit']);_0x53ff86[_0xd905('0x1b')]=qs[_0xd905('0x1b')](_0xede232['query'][_0xd905('0x1b')]);}_0x53ff86[_0xd905('0x33')]=qs[_0xd905('0x34')](_0xede232[_0xd905('0x2b')]['sort']);_0x53ff86['where']=qs['filters'](_[_0xd905('0x35')](_0xede232[_0xd905('0x2b')],_0x3c8e06[_0xd905('0x2d')]),_0x3e80f3);if(_0xede232[_0xd905('0x2b')][_0xd905('0x36')]){_0x53ff86[_0xd905('0x37')]=_[_0xd905('0x38')](_0x53ff86[_0xd905('0x37')],{'$or':_[_0xd905('0x27')](_0x3e80f3,function(_0x352546){if(_0x352546[_0xd905('0x29')]!==_0xd905('0x39')){var _0x40f9ec={};_0x40f9ec[_0x352546[_0xd905('0x25')]]={'$like':'%'+_0xede232['query'][_0xd905('0x36')]+'%'};return _0x40f9ec;}})});}_0x53ff86=_['merge']({},_0x53ff86,_0xede232['options']);var _0x5715a3={'where':_0x53ff86[_0xd905('0x37')]};return db[_0xd905('0x3a')][_0xd905('0x1c')](_0x5715a3)[_0xd905('0x23')](function(_0x4e2f61){_0x15f22f[_0xd905('0x1c')]=_0x4e2f61;if(_0xede232[_0xd905('0x2b')]['includeAll']){_0x53ff86[_0xd905('0x3b')]=[{'all':!![]}];}return db[_0xd905('0x3a')][_0xd905('0x3c')](_0x53ff86);})[_0xd905('0x23')](function(_0x283249){_0x15f22f['rows']=_0x283249;return _0x15f22f;})[_0xd905('0x23')](respondWithFilteredResult(_0x25aa8f,_0x53ff86))[_0xd905('0x3d')](handleError(_0x25aa8f,null));};exports[_0xd905('0x3e')]=function(_0x398fea,_0x59031b){var _0x2ff815={'raw':!![],'where':{'id':_0x398fea['params']['id']}},_0x42303c={};_0x42303c[_0xd905('0x2a')]=_[_0xd905('0x2c')](db[_0xd905('0x3a')][_0xd905('0x28')]);_0x42303c[_0xd905('0x2b')]=_[_0xd905('0x2c')](_0x398fea[_0xd905('0x2b')]);_0x42303c[_0xd905('0x2d')]=_[_0xd905('0x2e')](_0x42303c[_0xd905('0x2a')],_0x42303c[_0xd905('0x2b')]);_0x2ff815[_0xd905('0x2f')]=_[_0xd905('0x2e')](_0x42303c['model'],qs[_0xd905('0x30')](_0x398fea['query']['fields']));_0x2ff815[_0xd905('0x2f')]=_0x2ff815[_0xd905('0x2f')][_0xd905('0x3f')]?_0x2ff815[_0xd905('0x2f')]:_0x42303c[_0xd905('0x2a')];if(_0x398fea[_0xd905('0x2b')][_0xd905('0x40')]){_0x2ff815[_0xd905('0x3b')]=[{'all':!![]}];}_0x2ff815=_[_0xd905('0x38')]({},_0x2ff815,_0x398fea[_0xd905('0x41')]);return db[_0xd905('0x3a')][_0xd905('0x42')](_0x2ff815)[_0xd905('0x23')](handleEntityNotFound(_0x59031b,null))[_0xd905('0x23')](respondWithResult(_0x59031b,null))[_0xd905('0x3d')](handleError(_0x59031b,null));};exports['create']=function(_0x40f01b,_0x3db166){return db[_0xd905('0x3a')][_0xd905('0x43')](_0x40f01b[_0xd905('0x44')],{})[_0xd905('0x23')](respondWithResult(_0x3db166,0xc9))[_0xd905('0x3d')](handleError(_0x3db166,null));};exports[_0xd905('0x22')]=function(_0x16752d,_0x5c2cc){if(_0x16752d[_0xd905('0x44')]['id']){delete _0x16752d[_0xd905('0x44')]['id'];}return db['VoiceQueuesLog'][_0xd905('0x42')]({'where':{'id':_0x16752d[_0xd905('0x45')]['id']}})[_0xd905('0x23')](handleEntityNotFound(_0x5c2cc,null))[_0xd905('0x23')](saveUpdates(_0x16752d[_0xd905('0x44')],null))['then'](respondWithResult(_0x5c2cc,null))[_0xd905('0x3d')](handleError(_0x5c2cc,null));};exports[_0xd905('0x24')]=function(_0x12cea7,_0x129d50){return db['VoiceQueuesLog'][_0xd905('0x42')]({'where':{'id':_0x12cea7[_0xd905('0x45')]['id']}})[_0xd905('0x23')](handleEntityNotFound(_0x129d50,null))[_0xd905('0x23')](removeEntity(_0x129d50,null))[_0xd905('0x3d')](handleError(_0x129d50,null));}; \ No newline at end of file +var _0x0017=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','then','includeAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x58e3b1,_0x4b5f94){var _0x40c7f7=function(_0x4d8e8b){while(--_0x4d8e8b){_0x58e3b1['push'](_0x58e3b1['shift']());}};_0x40c7f7(++_0x4b5f94);}(_0x0017,0x1a2));var _0x7001=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0x0017[_0x1f5143];return _0x383a38;};'use strict';var emlformat=require(_0x7001('0x0'));var rimraf=require(_0x7001('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7001('0x2'));var rp=require('request-promise');var moment=require(_0x7001('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7001('0x4'));var sox=require(_0x7001('0x5'));var csv=require(_0x7001('0x6'));var ejs=require(_0x7001('0x7'));var fs=require('fs');var fs_extra=require(_0x7001('0x8'));var _=require(_0x7001('0x9'));var squel=require(_0x7001('0xa'));var crypto=require('crypto');var jsforce=require(_0x7001('0xb'));var deskjs=require(_0x7001('0xc'));var toCsv=require(_0x7001('0x6'));var querystring=require('querystring');var Papa=require(_0x7001('0xd'));var Redis=require(_0x7001('0xe'));var authService=require(_0x7001('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7001('0x10'));var hardwareService=require(_0x7001('0x11'));var logger=require(_0x7001('0x12'))(_0x7001('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7001('0x14'));var db=require(_0x7001('0x15'))['db'];function respondWithStatusCode(_0x28e614,_0x14a468){_0x14a468=_0x14a468||0xcc;return function(_0x26ffed){if(_0x26ffed){return _0x28e614[_0x7001('0x16')](_0x14a468);}return _0x28e614[_0x7001('0x17')](_0x14a468)[_0x7001('0x18')]();};}function respondWithResult(_0x5cf4c1,_0x41c1ef){_0x41c1ef=_0x41c1ef||0xc8;return function(_0x252286){if(_0x252286){return _0x5cf4c1[_0x7001('0x17')](_0x41c1ef)[_0x7001('0x19')](_0x252286);}};}function respondWithFilteredResult(_0x37fc4d,_0x5338c0){return function(_0x5ddb6e){if(_0x5ddb6e){var _0x4476a7=typeof _0x5338c0[_0x7001('0x1a')]===_0x7001('0x1b')&&typeof _0x5338c0[_0x7001('0x1c')]===_0x7001('0x1b');var _0x34c04b=_0x5ddb6e['count'];var _0x3ae687=_0x4476a7?0x0:_0x5338c0[_0x7001('0x1a')];var _0x58cbea=_0x4476a7?_0x5ddb6e['count']:_0x5338c0[_0x7001('0x1a')]+_0x5338c0[_0x7001('0x1c')];var _0x1169ed;if(_0x58cbea>=_0x34c04b){_0x58cbea=_0x34c04b;_0x1169ed=0xc8;}else{_0x1169ed=0xce;}_0x37fc4d[_0x7001('0x17')](_0x1169ed);return _0x37fc4d[_0x7001('0x1d')](_0x7001('0x1e'),_0x3ae687+'-'+_0x58cbea+'/'+_0x34c04b)['json'](_0x5ddb6e);}return null;};}function patchUpdates(_0x5708a5){return function(_0x5d04fb){try{jsonpatch[_0x7001('0x1f')](_0x5d04fb,_0x5708a5,!![]);}catch(_0x5bcffc){return BPromise[_0x7001('0x20')](_0x5bcffc);}return _0x5d04fb['save']();};}function saveUpdates(_0x7c40dc,_0x3ecce7){return function(_0x4391ab){if(_0x4391ab){return _0x4391ab[_0x7001('0x21')](_0x7c40dc)['then'](function(_0x49c64b){return _0x49c64b;});}return null;};}function removeEntity(_0x29c5e6,_0x4944a5){return function(_0x105c7b){if(_0x105c7b){return _0x105c7b[_0x7001('0x22')]()['then'](function(){_0x29c5e6[_0x7001('0x17')](0xcc)[_0x7001('0x18')]();});}};}function handleEntityNotFound(_0x102a06,_0x24846a){return function(_0x4dd07e){if(!_0x4dd07e){_0x102a06['sendStatus'](0x194);}return _0x4dd07e;};}function handleError(_0x13230c,_0x47889b){_0x47889b=_0x47889b||0x1f4;return function(_0x119e4f){logger[_0x7001('0x23')](_0x119e4f['stack']);if(_0x119e4f[_0x7001('0x24')]){delete _0x119e4f['name'];}_0x13230c[_0x7001('0x17')](_0x47889b)[_0x7001('0x25')](_0x119e4f);};}exports[_0x7001('0x26')]=function(_0x16d256,_0x3abcdd){var _0x3216da={},_0xcc46f2={},_0x388725={'count':0x0,'rows':[]};var _0x580e7b=_[_0x7001('0x27')](db[_0x7001('0x28')][_0x7001('0x29')],function(_0x12b4e4){return{'name':_0x12b4e4[_0x7001('0x2a')],'type':_0x12b4e4[_0x7001('0x2b')][_0x7001('0x2c')]};});_0xcc46f2[_0x7001('0x2d')]=_[_0x7001('0x27')](_0x580e7b,'name');_0xcc46f2[_0x7001('0x2e')]=_['keys'](_0x16d256[_0x7001('0x2e')]);_0xcc46f2[_0x7001('0x2f')]=_[_0x7001('0x30')](_0xcc46f2[_0x7001('0x2d')],_0xcc46f2[_0x7001('0x2e')]);_0x3216da[_0x7001('0x31')]=_[_0x7001('0x30')](_0xcc46f2[_0x7001('0x2d')],qs[_0x7001('0x32')](_0x16d256['query'][_0x7001('0x32')]));_0x3216da[_0x7001('0x31')]=_0x3216da[_0x7001('0x31')][_0x7001('0x33')]?_0x3216da['attributes']:_0xcc46f2[_0x7001('0x2d')];if(!_0x16d256['query'][_0x7001('0x34')](_0x7001('0x35'))){_0x3216da[_0x7001('0x1c')]=qs[_0x7001('0x1c')](_0x16d256['query']['limit']);_0x3216da['offset']=qs[_0x7001('0x1a')](_0x16d256[_0x7001('0x2e')]['offset']);}_0x3216da['order']=qs[_0x7001('0x36')](_0x16d256[_0x7001('0x2e')][_0x7001('0x36')]);_0x3216da[_0x7001('0x37')]=qs[_0x7001('0x2f')](_[_0x7001('0x38')](_0x16d256[_0x7001('0x2e')],_0xcc46f2[_0x7001('0x2f')]),_0x580e7b);if(_0x16d256[_0x7001('0x2e')]['filter']){_0x3216da[_0x7001('0x37')]=_[_0x7001('0x39')](_0x3216da['where'],{'$or':_[_0x7001('0x27')](_0x580e7b,function(_0x18c322){if(_0x18c322['type']!==_0x7001('0x3a')){var _0x52bb66={};_0x52bb66[_0x18c322['name']]={'$like':'%'+_0x16d256[_0x7001('0x2e')][_0x7001('0x3b')]+'%'};return _0x52bb66;}})});}_0x3216da=_['merge']({},_0x3216da,_0x16d256[_0x7001('0x3c')]);var _0x33fbd9={'where':_0x3216da[_0x7001('0x37')]};return db[_0x7001('0x28')][_0x7001('0x3d')](_0x33fbd9)[_0x7001('0x3e')](function(_0x4220e8){_0x388725[_0x7001('0x3d')]=_0x4220e8;if(_0x16d256[_0x7001('0x2e')][_0x7001('0x3f')]){_0x3216da['include']=[{'all':!![]}];}return db[_0x7001('0x28')]['findAll'](_0x3216da);})['then'](function(_0x333603){_0x388725[_0x7001('0x40')]=_0x333603;return _0x388725;})[_0x7001('0x3e')](respondWithFilteredResult(_0x3abcdd,_0x3216da))[_0x7001('0x41')](handleError(_0x3abcdd,null));};exports[_0x7001('0x42')]=function(_0x2800e8,_0x4f2b23){var _0x3a673d={'raw':!![],'where':{'id':_0x2800e8[_0x7001('0x43')]['id']}},_0x382687={};_0x382687[_0x7001('0x2d')]=_[_0x7001('0x44')](db[_0x7001('0x28')][_0x7001('0x29')]);_0x382687[_0x7001('0x2e')]=_[_0x7001('0x44')](_0x2800e8[_0x7001('0x2e')]);_0x382687[_0x7001('0x2f')]=_[_0x7001('0x30')](_0x382687[_0x7001('0x2d')],_0x382687[_0x7001('0x2e')]);_0x3a673d[_0x7001('0x31')]=_[_0x7001('0x30')](_0x382687[_0x7001('0x2d')],qs['fields'](_0x2800e8[_0x7001('0x2e')][_0x7001('0x32')]));_0x3a673d['attributes']=_0x3a673d[_0x7001('0x31')]['length']?_0x3a673d[_0x7001('0x31')]:_0x382687[_0x7001('0x2d')];if(_0x2800e8['query'][_0x7001('0x3f')]){_0x3a673d[_0x7001('0x45')]=[{'all':!![]}];}_0x3a673d=_[_0x7001('0x39')]({},_0x3a673d,_0x2800e8[_0x7001('0x3c')]);return db[_0x7001('0x28')][_0x7001('0x46')](_0x3a673d)[_0x7001('0x3e')](handleEntityNotFound(_0x4f2b23,null))[_0x7001('0x3e')](respondWithResult(_0x4f2b23,null))[_0x7001('0x41')](handleError(_0x4f2b23,null));};exports[_0x7001('0x47')]=function(_0x2445e6,_0x66774d){return db[_0x7001('0x28')]['create'](_0x2445e6[_0x7001('0x48')],{})['then'](respondWithResult(_0x66774d,0xc9))[_0x7001('0x41')](handleError(_0x66774d,null));};exports['update']=function(_0x2a6bcd,_0x2b631e){if(_0x2a6bcd[_0x7001('0x48')]['id']){delete _0x2a6bcd[_0x7001('0x48')]['id'];}return db[_0x7001('0x28')][_0x7001('0x46')]({'where':{'id':_0x2a6bcd[_0x7001('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b631e,null))['then'](saveUpdates(_0x2a6bcd[_0x7001('0x48')],null))[_0x7001('0x3e')](respondWithResult(_0x2b631e,null))[_0x7001('0x41')](handleError(_0x2b631e,null));};exports[_0x7001('0x22')]=function(_0x4088f8,_0x5eac23){return db[_0x7001('0x28')]['find']({'where':{'id':_0x4088f8['params']['id']}})[_0x7001('0x3e')](handleEntityNotFound(_0x5eac23,null))[_0x7001('0x3e')](removeEntity(_0x5eac23,null))['catch'](handleError(_0x5eac23,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 51d1fab..02f31bc 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 _0x8176=['event','dtm','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm'];(function(_0x444662,_0x3a82b6){var _0x55e2a6=function(_0x5c71c8){while(--_0x5c71c8){_0x444662['push'](_0x444662['shift']());}};_0x55e2a6(++_0x3a82b6);}(_0x8176,0xfe));var _0x6817=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8176[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x6817('0x0'));var util=require('util');var logger=require(_0x6817('0x1'))(_0x6817('0x2'));var moment=require(_0x6817('0x3'));var BPromise=require('bluebird');var rp=require(_0x6817('0x4'));var fs=require('fs');var path=require(_0x6817('0x5'));var rimraf=require(_0x6817('0x6'));var config=require('../../config/environment');var attributes=require(_0x6817('0x7'));module[_0x6817('0x8')]=function(_0x428519,_0x4a10e8){return _0x428519[_0x6817('0x9')](_0x6817('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x6817('0xb'),'fields':[_0x6817('0xc'),_0x6817('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xaffa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger'];(function(_0x1f3743,_0x23f85b){var _0x2325c5=function(_0x44cd49){while(--_0x44cd49){_0x1f3743['push'](_0x1f3743['shift']());}};_0x2325c5(++_0x23f85b);}(_0xaffa,0x11d));var _0xaaff=function(_0x7049cb,_0x2dddfe){_0x7049cb=_0x7049cb-0x0;var _0x442e2e=_0xaffa[_0x7049cb];return _0x442e2e;};'use strict';var _=require(_0xaaff('0x0'));var util=require(_0xaaff('0x1'));var logger=require(_0xaaff('0x2'))(_0xaaff('0x3'));var moment=require(_0xaaff('0x4'));var BPromise=require(_0xaaff('0x5'));var rp=require(_0xaaff('0x6'));var fs=require('fs');var path=require(_0xaaff('0x7'));var rimraf=require(_0xaaff('0x8'));var config=require(_0xaaff('0x9'));var attributes=require(_0xaaff('0xa'));module[_0xaaff('0xb')]=function(_0x3e8936,_0xe2f5dc){return _0x3e8936[_0xaaff('0xc')](_0xaaff('0xd'),attributes,{'tableName':_0xaaff('0xe'),'paranoid':![],'indexes':[{'name':_0xaaff('0xf'),'fields':[_0xaaff('0x10'),_0xaaff('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e025eaa..8df495c 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 _0x97da=['../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x36d00e,_0x5b4769){var _0x5603f8=function(_0x3b1b11){while(--_0x3b1b11){_0x36d00e['push'](_0x36d00e['shift']());}};_0x5603f8(++_0x5b4769);}(_0x97da,0x164));var _0xa97d=function(_0x3eb2fb,_0x39d52c){_0x3eb2fb=_0x3eb2fb-0x0;var _0x162879=_0x97da[_0x3eb2fb];return _0x162879;};'use strict';var _=require(_0xa97d('0x0'));var util=require('util');var moment=require(_0xa97d('0x1'));var BPromise=require(_0xa97d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa97d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa97d('0x4'));var logger=require(_0xa97d('0x5'))(_0xa97d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa97d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3cff27,_0x34446c,_0x3ecd45){return new BPromise(function(_0x36a463,_0x352267){return client[_0xa97d('0x8')](_0x3cff27,_0x3ecd45)['then'](function(_0x178e3b){logger[_0xa97d('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0x34446c,_0xa97d('0xa'));logger[_0xa97d('0xb')](_0xa97d('0xc'),_0x34446c,_0xa97d('0xa'),JSON[_0xa97d('0xd')](_0x178e3b));if(_0x178e3b['error']){if(_0x178e3b[_0xa97d('0xe')][_0xa97d('0xf')]===0x1f4){logger[_0xa97d('0xe')](_0xa97d('0x10'),_0x34446c,_0x178e3b['error'][_0xa97d('0x11')]);return _0x352267(_0x178e3b[_0xa97d('0xe')]['message']);}logger['error'](_0xa97d('0x10'),_0x34446c,_0x178e3b['error'][_0xa97d('0x11')]);return _0x36a463(_0x178e3b[_0xa97d('0xe')][_0xa97d('0x11')]);}else{logger[_0xa97d('0x9')](_0xa97d('0x10'),_0x34446c,_0xa97d('0xa'));_0x36a463(_0x178e3b[_0xa97d('0x12')][_0xa97d('0x11')]);}})[_0xa97d('0x13')](function(_0x4f73f3){logger[_0xa97d('0xe')](_0xa97d('0x10'),_0x34446c,_0x4f73f3);_0x352267(_0x4f73f3);});});} \ No newline at end of file +var _0x8e99=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3c15ad,_0x5b2a11){var _0x2c89ef=function(_0x262c79){while(--_0x262c79){_0x3c15ad['push'](_0x3c15ad['shift']());}};_0x2c89ef(++_0x5b2a11);}(_0x8e99,0x167));var _0x98e9=function(_0x49cbdc,_0x39dbca){_0x49cbdc=_0x49cbdc-0x0;var _0x245606=_0x8e99[_0x49cbdc];return _0x245606;};'use strict';var _=require(_0x98e9('0x0'));var util=require(_0x98e9('0x1'));var moment=require(_0x98e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x98e9('0x3'));var fs=require('fs');var Redis=require(_0x98e9('0x4'));var db=require(_0x98e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98e9('0x6'))(_0x98e9('0x7'));var config=require(_0x98e9('0x8'));var jayson=require(_0x98e9('0x9'));var client=jayson[_0x98e9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa9cc92,_0x5b470f,_0x36e8a5){return new BPromise(function(_0x3ae944,_0x4da16d){return client[_0x98e9('0xb')](_0xa9cc92,_0x36e8a5)[_0x98e9('0xc')](function(_0x17ad1c){logger[_0x98e9('0xd')](_0x98e9('0xe'),_0x5b470f,_0x98e9('0xf'));logger[_0x98e9('0x10')](_0x98e9('0x11'),_0x5b470f,'request\x20sent',JSON[_0x98e9('0x12')](_0x17ad1c));if(_0x17ad1c['error']){if(_0x17ad1c[_0x98e9('0x13')][_0x98e9('0x14')]===0x1f4){logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x17ad1c['error']['message']);return _0x4da16d(_0x17ad1c[_0x98e9('0x13')][_0x98e9('0x15')]);}logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x17ad1c[_0x98e9('0x13')]['message']);return _0x3ae944(_0x17ad1c['error'][_0x98e9('0x15')]);}else{logger['info'](_0x98e9('0xe'),_0x5b470f,'request\x20sent');_0x3ae944(_0x17ad1c[_0x98e9('0x16')][_0x98e9('0x15')]);}})[_0x98e9('0x17')](function(_0x5a5f2b){logger[_0x98e9('0x13')](_0x98e9('0xe'),_0x5b470f,_0x5a5f2b);_0x4da16d(_0x5a5f2b);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d94af6b..79ad35a 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 _0x672a=['create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','index','/describe','isAuthenticated','get','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','post'];(function(_0x428c53,_0x21023a){var _0x5c7ea0=function(_0x42e9c3){while(--_0x42e9c3){_0x428c53['push'](_0x428c53['shift']());}};_0x5c7ea0(++_0x21023a);}(_0x672a,0x93));var _0xa672=function(_0x29c874,_0x310a1d){_0x29c874=_0x29c874-0x0;var _0x2824b2=_0x672a[_0x29c874];return _0x2824b2;};'use strict';var multer=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var path=require(_0xa672('0x2'));var timeout=require(_0xa672('0x3'));var express=require(_0xa672('0x4'));var router=express[_0xa672('0x5')]();var fs_extra=require(_0xa672('0x6'));var auth=require(_0xa672('0x7'));var interaction=require(_0xa672('0x8'));var config=require('../../config/environment');var controller=require(_0xa672('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa672('0xa')]);router['get'](_0xa672('0xb'),auth[_0xa672('0xc')](),controller['describe']);router[_0xa672('0xd')](_0xa672('0xe'),auth['isAuthenticated'](),controller[_0xa672('0xf')]);router[_0xa672('0xd')](_0xa672('0x10'),auth[_0xa672('0xc')](),controller[_0xa672('0x11')]);router[_0xa672('0xd')](_0xa672('0x12'),controller['downloads']);router[_0xa672('0xd')](_0xa672('0x13'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0xa672('0x14')]('/',auth[_0xa672('0xc')](),controller[_0xa672('0x15')]);router[_0xa672('0x14')]('/:id/transcribe',auth[_0xa672('0xc')](),controller[_0xa672('0x16')]);router[_0xa672('0x17')](_0xa672('0xe'),auth['isAuthenticated'](),controller[_0xa672('0x18')]);router[_0xa672('0x19')](_0xa672('0xe'),auth['isAuthenticated'](),controller[_0xa672('0x1a')]);module[_0xa672('0x1b')]=router; \ No newline at end of file +var _0xaf86=['get','/describe','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','/:id','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaf86,0xa1));var _0x6af8=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xaf86[_0x46efd7];return _0x5637e4;};'use strict';var multer=require(_0x6af8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6af8('0x1'));var auth=require(_0x6af8('0x2'));var interaction=require(_0x6af8('0x3'));var config=require('../../config/environment');var controller=require(_0x6af8('0x4'));router['get']('/',auth[_0x6af8('0x5')](),controller[_0x6af8('0x6')]);router[_0x6af8('0x7')](_0x6af8('0x8'),auth[_0x6af8('0x5')](),controller[_0x6af8('0x9')]);router[_0x6af8('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6af8('0xa')]);router[_0x6af8('0x7')](_0x6af8('0xb'),auth['isAuthenticated'](),controller[_0x6af8('0xc')]);router[_0x6af8('0x7')](_0x6af8('0xd'),controller[_0x6af8('0xe')]);router[_0x6af8('0x7')](_0x6af8('0xf'),auth[_0x6af8('0x5')](),controller[_0x6af8('0x10')]);router['post']('/',auth[_0x6af8('0x5')](),controller[_0x6af8('0x11')]);router[_0x6af8('0x12')](_0x6af8('0xf'),auth['isAuthenticated'](),controller[_0x6af8('0x13')]);router[_0x6af8('0x14')](_0x6af8('0x15'),auth[_0x6af8('0x5')](),controller['update']);router['delete'](_0x6af8('0x15'),auth[_0x6af8('0x5')](),controller[_0x6af8('0x16')]);module[_0x6af8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index be9c9dc..edbab77 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 _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index b0461b0..5cee58b 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 _0x0e7e=['ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','reject','save','update','destroy','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','differenceBy','format','keys','filters','intersection','query','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','fields','length','include','find','create','body','catch','describe','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','download','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','secrets','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','decryptFile','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x3afe04,_0x5dd905){var _0x5189d7=function(_0x57b933){while(--_0x57b933){_0x3afe04['push'](_0x3afe04['shift']());}};_0x5189d7(++_0x5dd905);}(_0x0e7e,0x134));var _0xe0e7=function(_0x1b52e8,_0x388b4b){_0x1b52e8=_0x1b52e8-0x0;var _0xc0cf11=_0x0e7e[_0x1b52e8];return _0xc0cf11;};'use strict';var emlformat=require(_0xe0e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe0e7('0x1'));var rp=require(_0xe0e7('0x2'));var moment=require(_0xe0e7('0x3'));var BPromise=require(_0xe0e7('0x4'));var Mustache=require(_0xe0e7('0x5'));var util=require(_0xe0e7('0x6'));var path=require('path');var sox=require(_0xe0e7('0x7'));var csv=require('to-csv');var ejs=require(_0xe0e7('0x8'));var fs=require('fs');var fs_extra=require(_0xe0e7('0x9'));var _=require(_0xe0e7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0e7('0xb'));var deskjs=require(_0xe0e7('0xc'));var toCsv=require(_0xe0e7('0xd'));var querystring=require(_0xe0e7('0xe'));var Papa=require(_0xe0e7('0xf'));var AWS=require(_0xe0e7('0x10'));var uuidv4=require(_0xe0e7('0x11'));var Redis=require(_0xe0e7('0x12'));var authService=require(_0xe0e7('0x13'));var qs=require(_0xe0e7('0x14'));var as=require(_0xe0e7('0x15'));var hardwareService=require(_0xe0e7('0x16'));var logger=require('../../config/logger')(_0xe0e7('0x17'));var utils=require(_0xe0e7('0x18'));var config=require(_0xe0e7('0x19'));var licenseUtil=require(_0xe0e7('0x1a'));var db=require(_0xe0e7('0x1b'))['db'];function respondWithStatusCode(_0x913b48,_0x1d0be5){_0x1d0be5=_0x1d0be5||0xcc;return function(_0x892b54){if(_0x892b54){return _0x913b48[_0xe0e7('0x1c')](_0x1d0be5);}return _0x913b48['status'](_0x1d0be5)[_0xe0e7('0x1d')]();};}function respondWithResult(_0x31d6b4,_0x2fa222){_0x2fa222=_0x2fa222||0xc8;return function(_0x259529){if(_0x259529){return _0x31d6b4[_0xe0e7('0x1e')](_0x2fa222)[_0xe0e7('0x1f')](_0x259529);}};}function respondWithFilteredResult(_0x68de63,_0x1d076e){return function(_0x1c3c85){if(_0x1c3c85){var _0x3739e2=typeof _0x1d076e[_0xe0e7('0x20')]==='undefined'&&typeof _0x1d076e[_0xe0e7('0x21')]==='undefined';var _0x35b4cc=_0x1c3c85[_0xe0e7('0x22')];var _0x161823=_0x3739e2?0x0:_0x1d076e[_0xe0e7('0x20')];var _0x214da2=_0x3739e2?_0x1c3c85[_0xe0e7('0x22')]:_0x1d076e['offset']+_0x1d076e[_0xe0e7('0x21')];var _0x1f8275;if(_0x214da2>=_0x35b4cc){_0x214da2=_0x35b4cc;_0x1f8275=0xc8;}else{_0x1f8275=0xce;}_0x68de63[_0xe0e7('0x1e')](_0x1f8275);return _0x68de63[_0xe0e7('0x23')]('Content-Range',_0x161823+'-'+_0x214da2+'/'+_0x35b4cc)['json'](_0x1c3c85);}return null;};}function patchUpdates(_0xea4601){return function(_0x215e74){try{jsonpatch[_0xe0e7('0x24')](_0x215e74,_0xea4601,!![]);}catch(_0xbbab58){return BPromise[_0xe0e7('0x25')](_0xbbab58);}return _0x215e74[_0xe0e7('0x26')]();};}function saveUpdates(_0x3d700c,_0x52c94c){return function(_0x522b64){if(_0x522b64){return _0x522b64[_0xe0e7('0x27')](_0x3d700c)['then'](function(_0x2d78f0){return _0x2d78f0;});}return null;};}function removeEntity(_0x6a8951,_0x213cee){return function(_0x434f57){if(_0x434f57){return _0x434f57[_0xe0e7('0x28')]()['then'](function(){_0x6a8951[_0xe0e7('0x1e')](0xcc)[_0xe0e7('0x1d')]();});}};}function handleEntityNotFound(_0x36256d,_0x49eb6b){return function(_0x507f88){if(!_0x507f88){_0x36256d[_0xe0e7('0x1c')](0x194);}return _0x507f88;};}function handleError(_0x3555a2,_0xd6bb9a){_0xd6bb9a=_0xd6bb9a||0x1f4;return function(_0x5df6f4){logger['error'](_0x5df6f4[_0xe0e7('0x29')]);if(_0x5df6f4[_0xe0e7('0x2a')]){delete _0x5df6f4[_0xe0e7('0x2a')];}_0x3555a2['status'](_0xd6bb9a)[_0xe0e7('0x2b')](_0x5df6f4);};}exports['index']=function(_0x4246ec,_0x8ee613){var _0xf69be0={},_0x78987a={},_0x29141f={'count':0x0,'rows':[]};var _0x5ba2b5=_[_0xe0e7('0x2c')](db[_0xe0e7('0x2d')][_0xe0e7('0x2e')],function(_0x3b58dc){return{'name':_0x3b58dc[_0xe0e7('0x2f')],'type':_0x3b58dc[_0xe0e7('0x30')]['key']};});_0x78987a['model']=_[_0xe0e7('0x31')](_['map'](_0x5ba2b5,_0xe0e7('0x2a')),[_0xe0e7('0x32')]);_0x78987a['query']=_[_0xe0e7('0x33')](_0x4246ec['query']);_0x78987a[_0xe0e7('0x34')]=_[_0xe0e7('0x35')](_0x78987a['model'],_0x78987a[_0xe0e7('0x36')]);_0xf69be0[_0xe0e7('0x37')]=_[_0xe0e7('0x35')](_0x78987a['model'],qs['fields'](_0x4246ec[_0xe0e7('0x36')]['fields']));_0xf69be0[_0xe0e7('0x37')]=_0xf69be0[_0xe0e7('0x37')]['length']?_0xf69be0[_0xe0e7('0x37')]:_0x78987a[_0xe0e7('0x38')];if(!_0x4246ec[_0xe0e7('0x36')][_0xe0e7('0x39')](_0xe0e7('0x3a'))){_0xf69be0[_0xe0e7('0x21')]=qs[_0xe0e7('0x21')](_0x4246ec['query']['limit']);_0xf69be0['offset']=qs['offset'](_0x4246ec[_0xe0e7('0x36')]['offset']);}_0xf69be0[_0xe0e7('0x3b')]=qs[_0xe0e7('0x3c')](_0x4246ec[_0xe0e7('0x36')][_0xe0e7('0x3c')]);_0xf69be0[_0xe0e7('0x3d')]=qs[_0xe0e7('0x34')](_[_0xe0e7('0x3e')](_0x4246ec[_0xe0e7('0x36')],_0x78987a[_0xe0e7('0x34')]),_0x5ba2b5);if(_0x4246ec[_0xe0e7('0x36')][_0xe0e7('0x3f')]){_0xf69be0[_0xe0e7('0x3d')]=_[_0xe0e7('0x40')](_0xf69be0[_0xe0e7('0x3d')],{'$or':_[_0xe0e7('0x2c')](_0x5ba2b5,function(_0x57bb55){if(_0x57bb55[_0xe0e7('0x30')]!==_0xe0e7('0x41')){var _0x408f93={};_0x408f93[_0x57bb55[_0xe0e7('0x2a')]]={'$like':'%'+_0x4246ec[_0xe0e7('0x36')][_0xe0e7('0x3f')]+'%'};return _0x408f93;}})});}_0xf69be0=_['merge']({},_0xf69be0,_0x4246ec[_0xe0e7('0x42')]);var _0x372768={'where':_0xf69be0[_0xe0e7('0x3d')]};return db[_0xe0e7('0x2d')][_0xe0e7('0x22')](_0x372768)[_0xe0e7('0x43')](function(_0x32fecf){_0x29141f[_0xe0e7('0x22')]=_0x32fecf;if(_0x4246ec[_0xe0e7('0x36')][_0xe0e7('0x44')]){_0xf69be0['include']=[{'all':!![]}];}return db[_0xe0e7('0x2d')][_0xe0e7('0x45')](_0xf69be0);})[_0xe0e7('0x43')](function(_0x3c8ea1){_0x29141f[_0xe0e7('0x46')]=_0x3c8ea1;return _0x29141f;})[_0xe0e7('0x43')](respondWithFilteredResult(_0x8ee613,_0xf69be0))['catch'](handleError(_0x8ee613,null));};exports[_0xe0e7('0x47')]=function(_0x136e93,_0x2b50cc){var _0x30fc88={'raw':![],'where':{'id':_0x136e93[_0xe0e7('0x48')]['id']}},_0x5856c9={};_0x5856c9[_0xe0e7('0x38')]=_[_0xe0e7('0x33')](db['VoiceRecording'][_0xe0e7('0x2e')]);_0x5856c9[_0xe0e7('0x36')]=_[_0xe0e7('0x33')](_0x136e93['query']);_0x5856c9[_0xe0e7('0x34')]=_[_0xe0e7('0x35')](_0x5856c9[_0xe0e7('0x38')],_0x5856c9[_0xe0e7('0x36')]);_0x30fc88[_0xe0e7('0x37')]=_[_0xe0e7('0x35')](_0x5856c9[_0xe0e7('0x38')],qs['fields'](_0x136e93[_0xe0e7('0x36')][_0xe0e7('0x49')]));_0x30fc88['attributes']=_0x30fc88[_0xe0e7('0x37')][_0xe0e7('0x4a')]?_0x30fc88[_0xe0e7('0x37')]:_0x5856c9[_0xe0e7('0x38')];if(_0x136e93[_0xe0e7('0x36')][_0xe0e7('0x44')]){_0x30fc88[_0xe0e7('0x4b')]=[{'all':!![]}];}_0x30fc88=_[_0xe0e7('0x40')]({},_0x30fc88,_0x136e93[_0xe0e7('0x42')]);return db[_0xe0e7('0x2d')][_0xe0e7('0x4c')](_0x30fc88)[_0xe0e7('0x43')](handleEntityNotFound(_0x2b50cc,null))['then'](respondWithResult(_0x2b50cc,null))['catch'](handleError(_0x2b50cc,null));};exports['create']=function(_0x4f6cd7,_0x4b2b81){return db['VoiceRecording'][_0xe0e7('0x4d')](_0x4f6cd7[_0xe0e7('0x4e')],{})[_0xe0e7('0x43')](respondWithResult(_0x4b2b81,0xc9))[_0xe0e7('0x4f')](handleError(_0x4b2b81,null));};exports['update']=function(_0x468aee,_0x585165){if(_0x468aee[_0xe0e7('0x4e')]['id']){delete _0x468aee[_0xe0e7('0x4e')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x468aee[_0xe0e7('0x48')]['id']}})[_0xe0e7('0x43')](handleEntityNotFound(_0x585165,null))[_0xe0e7('0x43')](saveUpdates(_0x468aee[_0xe0e7('0x4e')],null))[_0xe0e7('0x43')](respondWithResult(_0x585165,null))[_0xe0e7('0x4f')](handleError(_0x585165,null));};exports[_0xe0e7('0x50')]=function(_0x3e2058,_0x32e664){return db[_0xe0e7('0x2d')][_0xe0e7('0x50')]()[_0xe0e7('0x43')](respondWithResult(_0x32e664,null))[_0xe0e7('0x4f')](handleError(_0x32e664,null));};exports['download']=function(_0x3ac1b3,_0x5ca38d,_0xd2c8e1){var _0x1b4944=require('../../components/encryptor');var _0x46c179=![];var _0x5ddfb3={};if(_0x3ac1b3['query'][_0xe0e7('0x30')]&&_0x3ac1b3[_0xe0e7('0x36')][_0xe0e7('0x30')]===_0xe0e7('0x51')){_0x5ddfb3['uniqueid']=_0x3ac1b3['params']['id'];}else{_0x5ddfb3['id']=_0x3ac1b3['params']['id'];}return db[_0xe0e7('0x2d')][_0xe0e7('0x4c')]({'where':_0x5ddfb3,'attributes':['id',_0xe0e7('0x52')],'raw':!![]})[_0xe0e7('0x43')](handleEntityNotFound(_0x5ca38d,null))[_0xe0e7('0x43')](function(_0x623185){if(_0x623185){var _0x300343=_0x623185[_0xe0e7('0x52')];var _0x5310e6=util[_0xe0e7('0x32')](_0xe0e7('0x53'),_0x300343);if(fs[_0xe0e7('0x54')](_0x5310e6)){_0x46c179=!![];return _0x1b4944['decryptFile'](_0x5310e6,_0x300343,config['secrets'][_0xe0e7('0x55')])[_0xe0e7('0x43')](function(){return _0x623185;});}return _0x623185;}})[_0xe0e7('0x43')](function(_0x35a301){if(_0x35a301){var _0x126aed=_0x35a301[_0xe0e7('0x52')];if(!fs[_0xe0e7('0x54')](_0x126aed)){throw new db[(_0xe0e7('0x56'))][(_0xe0e7('0x57'))](_0xe0e7('0x58'));}if(_0x35a301[_0xe0e7('0x59')]){return _0x5ca38d['download'](_0x126aed,_0x35a301['filename']+path[_0xe0e7('0x5a')](_0x126aed),function(){if(_0x46c179){fs['unlink'](_0x126aed);}});}else{return _0x5ca38d[_0xe0e7('0x5b')](_0x126aed,function(_0x2380b5){if(_0x46c179){fs[_0xe0e7('0x5c')](_0x126aed);}});}}})[_0xe0e7('0x4f')](function(_0x32c06e){if(_0x32c06e[_0xe0e7('0x5d')]===_0xe0e7('0x58')){_0x5ca38d[_0xe0e7('0x1e')](0x194)[_0xe0e7('0x2b')](_0xe0e7('0x5e'));}else{return handleError(_0x5ca38d,null);}});};exports[_0xe0e7('0x5f')]=function(_0x369425,_0x59ea8f,_0x3cc9a8){var _0x4334c8=require(_0xe0e7('0x60'));var _0x1646cf=![];var _0x1b1b40={'$and':[db[_0xe0e7('0x61')][_0xe0e7('0x3d')](db[_0xe0e7('0x61')]['fn'](_0xe0e7('0x62'),db[_0xe0e7('0x61')][_0xe0e7('0x63')](_0xe0e7('0x51'))),_0x369425[_0xe0e7('0x36')][_0xe0e7('0x64')])]};if(_0x369425[_0xe0e7('0x36')][_0xe0e7('0x30')]&&_0x369425[_0xe0e7('0x36')][_0xe0e7('0x30')]===_0xe0e7('0x51')){_0x1b1b40[_0xe0e7('0x65')]['push']({'uniqueid':_0x369425[_0xe0e7('0x48')]['id']});}else{_0x1b1b40[_0xe0e7('0x65')][_0xe0e7('0x66')]({'id':_0x369425['params']['id']});}return db['VoiceRecording']['find']({'where':_0x1b1b40,'attributes':['id','value'],'raw':!![]})[_0xe0e7('0x43')](handleEntityNotFound(_0x59ea8f,null))[_0xe0e7('0x43')](function(_0x4a6e6a){if(_0x4a6e6a){var _0x1756b4=util['format'](_0xe0e7('0x53'),_0x4a6e6a[_0xe0e7('0x52')]);if(fs[_0xe0e7('0x54')](_0x1756b4)){_0x1646cf=!![];return _0x4334c8['decryptFile'](_0x1756b4,_0x4a6e6a['value'],config[_0xe0e7('0x67')]['recording'])[_0xe0e7('0x43')](function(){return _0x4a6e6a;});}return _0x4a6e6a;}})[_0xe0e7('0x43')](function(_0x37a3fb){if(_0x37a3fb){if(!fs[_0xe0e7('0x54')](_0x37a3fb[_0xe0e7('0x52')])){throw new db[(_0xe0e7('0x56'))]['ValidationError'](_0xe0e7('0x58'));}if(_0x37a3fb[_0xe0e7('0x59')]){return _0x59ea8f['download'](_0x37a3fb[_0xe0e7('0x52')],_0x37a3fb[_0xe0e7('0x59')]+path[_0xe0e7('0x5a')](_0x37a3fb['value']),function(){if(_0x1646cf){fs[_0xe0e7('0x5c')](_0x37a3fb['value']);}});}else{return _0x59ea8f[_0xe0e7('0x5b')](_0x37a3fb[_0xe0e7('0x52')],function(_0x51e051){if(_0x1646cf){fs[_0xe0e7('0x5c')](_0x37a3fb[_0xe0e7('0x52')]);}});}}})[_0xe0e7('0x4f')](handleError(_0x59ea8f,null));};exports['destroy']=function(_0x1e3ff4,_0x594cfc){return db[_0xe0e7('0x2d')][_0xe0e7('0x4c')]({'where':{'id':_0x1e3ff4[_0xe0e7('0x48')]['id']}})[_0xe0e7('0x43')](function(_0x53b33b){if(_[_0xe0e7('0x68')](_0x53b33b)){throw new ReferenceError(_0xe0e7('0x69'));}return _0x53b33b;})[_0xe0e7('0x43')](function(_0x4030fe){var _0x3fa43d=_0x4030fe[_0xe0e7('0x52')];logger[_0xe0e7('0x6a')]('cancellazione\x20fisica\x20documento\x20%s',_0x3fa43d);if(!_[_0xe0e7('0x68')](_0x4030fe[_0xe0e7('0x52')])&&fs['existsSync'](_0x3fa43d)){logger[_0xe0e7('0x6a')]('File:\x20\x22'+_0x3fa43d+_0xe0e7('0x6b'));fs[_0xe0e7('0x6c')](_0x3fa43d);}_0x3fa43d=_0x3fa43d+_0xe0e7('0x6d');if(!_[_0xe0e7('0x68')](_0x4030fe[_0xe0e7('0x52')])&&fs[_0xe0e7('0x54')](_0x3fa43d)){logger[_0xe0e7('0x6a')](_0xe0e7('0x6e')+_0x3fa43d+_0xe0e7('0x6b'));fs[_0xe0e7('0x6c')](_0x3fa43d);}return _0x4030fe;})[_0xe0e7('0x43')](function(_0x5c05fb){if(!_0x5c05fb)throw new InternalError();return _0x5c05fb['destroy']();})[_0xe0e7('0x43')](function(){_0x594cfc[_0xe0e7('0x1e')](0xcc)['end']();})[_0xe0e7('0x4f')](handleError(_0x594cfc,null));};function getBucketslist(_0x22a2a5,_0x3a4fa5,_0x4677f4){return new Promise(function(_0x481475,_0x56e82f){var _0x34401a=new AWS['S3']({'accessKeyId':_0x3a4fa5,'secretAccessKey':_0x22a2a5,'region':_0x4677f4});_0x34401a[_0xe0e7('0x6f')]({},function(_0x2c0998,_0x372346){if(_0x2c0998){return _0x56e82f(_0x2c0998);}else{return _0x481475(_0x372346);}});});}function createBucket(_0x2b6bd9,_0x4a2578,_0x183bf6,_0x1e2778){return new Promise(function(_0x1be32d,_0x6932b6){var _0xea4b3f=new AWS['S3']({'accessKeyId':_0x4a2578,'secretAccessKey':_0x2b6bd9,'region':_0x183bf6});_0xea4b3f[_0xe0e7('0x70')]({'Bucket':_0x1e2778},function(_0x96120f,_0x58a974){if(_0x96120f){return _0x6932b6(_0x96120f);}else{return _0x1be32d(_0x58a974);}});});}function uploadFile(_0x39fea6,_0x4dc266,_0x123ce8,_0x436439,_0x3e18d4,_0x49338e){return new Promise(function(_0x1364fd,_0x471a6e){var _0x3d06de=new AWS['S3']({'accessKeyId':_0x4dc266,'secretAccessKey':_0x39fea6,'region':_0x123ce8});_0x3d06de[_0xe0e7('0x71')]({'Bucket':_0x436439,'Key':_0x3e18d4,'Body':_0x49338e},function(_0x5e316d,_0x3cfbc1){if(_0x5e316d){return _0x471a6e(_0x5e316d);}else{return _0x1364fd(_0x3cfbc1);}});});}function startTranscribe(_0x4caf96,_0x162659,_0x31f7e0,_0x3fa8b8,_0xb75825,_0x17ff73){return new Promise(function(_0x1ab14d,_0x327fbd){var _0x87f54a=new AWS[(_0xe0e7('0x72'))]({'accessKeyId':_0x162659,'secretAccessKey':_0x4caf96,'region':_0x31f7e0});_0x87f54a[_0xe0e7('0x73')]({'TranscriptionJobName':_0x3fa8b8,'LanguageCode':_0xb75825,'Media':{'MediaFileUri':_0x17ff73}},function(_0x251889,_0x8e0251){if(_0x251889){return _0x327fbd(_0x251889);}else{return _0x1ab14d(_0x8e0251);}});});}function transcribe(_0xfd38ce,_0x914155,_0x4f357d,_0x382f84,_0x2f5dc9,_0x326baa,_0x20915c){return new Promise(function(_0x53bb80,_0x554ce8){var _0x46f8d7={};logger['info'](util['format'](_0xe0e7('0x74'),_0xfd38ce,_0x2f5dc9));return uploadFile(_0x914155,_0x4f357d,_0x382f84,_0x2f5dc9,path['basename'](_0x326baa),fs['readFileSync'](_0x326baa))['then'](function(_0x5bbe5b){logger['info'](util[_0xe0e7('0x32')](_0xe0e7('0x75'),_0xfd38ce,_0x2f5dc9,_0x5bbe5b['Location']));_0x46f8d7['bucket']=_0x5bbe5b['Bucket'];_0x46f8d7[_0xe0e7('0x76')]=_0x5bbe5b[_0xe0e7('0x77')];logger[_0xe0e7('0x6a')](util[_0xe0e7('0x32')](_0xe0e7('0x78'),_0xfd38ce));return startTranscribe(_0x914155,_0x4f357d,_0x382f84,uuidv4(),_0x20915c,_0x5bbe5b[_0xe0e7('0x77')]);})['then'](function(_0x36a0f6){logger[_0xe0e7('0x6a')](util['format'](_0xe0e7('0x79'),_0xfd38ce,_0x36a0f6[_0xe0e7('0x7a')][_0xe0e7('0x7b')]));_0x46f8d7['transcribeName']=_0x36a0f6[_0xe0e7('0x7a')]['TranscriptionJobName'];_0x46f8d7[_0xe0e7('0x7c')]=_0x36a0f6[_0xe0e7('0x7a')][_0xe0e7('0x7d')];return _0x53bb80(_0x46f8d7);})[_0xe0e7('0x4f')](function(_0x320cd3){return _0x554ce8(_0x320cd3);});});}exports[_0xe0e7('0x7e')]=function(_0xc66c6a,_0x2de034,_0x29f40d){var _0x5ee829;var _0xe5fc0;var _0x3988eb;var _0x11c37f=require(_0xe0e7('0x60'));return db[_0xe0e7('0x2d')][_0xe0e7('0x7f')]({'where':{'id':_0xc66c6a[_0xe0e7('0x48')]['id']}})[_0xe0e7('0x43')](function(_0x54f3de){if(_0x54f3de){var _0x4766ca=util[_0xe0e7('0x32')](_0xe0e7('0x53'),_0x54f3de[_0xe0e7('0x52')]);if(fs['existsSync'](_0x4766ca)){cypher=!![];return _0x11c37f[_0xe0e7('0x80')](_0x4766ca,_0x54f3de[_0xe0e7('0x52')],config[_0xe0e7('0x67')][_0xe0e7('0x55')])['then'](function(){return _0x54f3de;});}return _0x54f3de;}})[_0xe0e7('0x43')](function(_0x23c8ab){if(!_0x23c8ab){throw new db['Sequelize']['ValidationError'](_0xe0e7('0x81'));}_0xe5fc0=_0x23c8ab;return db[_0xe0e7('0x82')][_0xe0e7('0x7f')]({'where':{'id':0x1}});})[_0xe0e7('0x43')](handleEntityNotFound(_0x2de034,null))[_0xe0e7('0x43')](function(_0x4036ef){if(_0x4036ef){_0x5ee829=_0x4036ef;if(!_0x5ee829[_0xe0e7('0x83')]||!_0x5ee829[_0xe0e7('0x84')]||!_0x5ee829[_0xe0e7('0x85')]||!_0x5ee829[_0xe0e7('0x86')]||!_0x5ee829[_0xe0e7('0x87')]){throw new db[(_0xe0e7('0x56'))]['ValidationError'](_0xe0e7('0x88'));}if(_0xc66c6a[_0xe0e7('0x4e')][_0xe0e7('0x89')]&&(!_0x5ee829[_0xe0e7('0x8a')]||!_0x5ee829[_0xe0e7('0x8b')]||!_0x5ee829['sentimentRegion']||!_0x5ee829['language']||!_0x5ee829[_0xe0e7('0x87')])){throw new db[(_0xe0e7('0x56'))][(_0xe0e7('0x57'))](_0xe0e7('0x8c'));}return db[_0xe0e7('0x8d')]['findOne']({'where':{'id':_0x5ee829['transcribeAccountId']}});}})[_0xe0e7('0x43')](function(_0x81b62c){if(!_0x81b62c){throw new db[(_0xe0e7('0x56'))][(_0xe0e7('0x57'))](_0xe0e7('0x8e'));}if(!_0x81b62c['data1']||!_0x81b62c[_0xe0e7('0x8f')]){throw new db[(_0xe0e7('0x56'))]['ValidationError'](_0xe0e7('0x90'));}_0x3988eb=_0x81b62c;return getBucketslist(_0x3988eb['data1'],_0x3988eb[_0xe0e7('0x8f')],_0x5ee829[_0xe0e7('0x85')]);})[_0xe0e7('0x43')](function(_0x3e38aa){if(_0x3e38aa&&_0x3e38aa[_0xe0e7('0x91')]){var _0x2388a1=_[_0xe0e7('0x4c')](_0x3e38aa[_0xe0e7('0x91')],function(_0x4860a6){return _0x4860a6[_0xe0e7('0x92')]===_0x5ee829[_0xe0e7('0x87')];});if(!_0x2388a1){logger[_0xe0e7('0x6a')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xc66c6a[_0xe0e7('0x48')]['id'],_0x5ee829[_0xe0e7('0x87')]));return createBucket(_0x3988eb[_0xe0e7('0x93')],_0x3988eb[_0xe0e7('0x8f')],_0x5ee829[_0xe0e7('0x85')],_0x5ee829[_0xe0e7('0x87')]);}logger[_0xe0e7('0x6a')](util['format'](_0xe0e7('0x94'),_0xc66c6a[_0xe0e7('0x48')]['id'],_0x5ee829[_0xe0e7('0x87')]));return;}})[_0xe0e7('0x43')](function(_0x1fe225){if(_0xe5fc0['transcribeStatus']==='NEW'){return transcribe(_0xc66c6a['params']['id'],_0x3988eb['data1'],_0x3988eb[_0xe0e7('0x8f')],_0x5ee829['transcribeRegion'],_0x5ee829[_0xe0e7('0x87')],_0xe5fc0[_0xe0e7('0x52')],_0x5ee829[_0xe0e7('0x86')]);}else{logger[_0xe0e7('0x6a')](util[_0xe0e7('0x32')](_0xe0e7('0x95'),_0xc66c6a[_0xe0e7('0x48')]['id']));return{'transcribeStatus':_0xe0e7('0x96')};}})[_0xe0e7('0x43')](function(_0x3a00e8){if(_0x3a00e8){_0x3a00e8[_0xe0e7('0x97')]=_0xc66c6a['body']['runSentiment'];return _0xe5fc0[_0xe0e7('0x98')](_0x3a00e8);}})[_0xe0e7('0x43')](respondWithResult(_0x2de034,null))[_0xe0e7('0x4f')](handleError(_0x2de034,null));};function writeFile(_0xbf635d,_0x3781f8){return new Promise(function(_0xb6ccff,_0x1c194e){fs[_0xe0e7('0x99')](_0x3781f8,_0xbf635d,function(_0x4f2f3d,_0x14dcbf){if(_0x4f2f3d){return _0x1c194e(_0x4f2f3d);}else{return _0xb6ccff(_0x14dcbf);}});});}exports['downloadTranscribe']=function(_0x9ff23d,_0x2c618d,_0x172bce){return db[_0xe0e7('0x2d')][_0xe0e7('0x7f')]({'where':{'id':_0x9ff23d[_0xe0e7('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c618d))[_0xe0e7('0x43')](function(_0x22d53e){if(_0x22d53e&&_0x22d53e[_0xe0e7('0x9a')]){var _0xb264bd=_0x22d53e[_0xe0e7('0x9a')];var _0x2fc13d=config[_0xe0e7('0x9b')]+_0xe0e7('0x9c')+_0x22d53e['id']+_0xe0e7('0x9d');if(fs[_0xe0e7('0x54')](_0x2fc13d)){return _0x2fc13d;}return writeFile(_0xb264bd,_0x2fc13d)[_0xe0e7('0x43')](function(){return _0x2fc13d;});}else{throw new db[(_0xe0e7('0x56'))][(_0xe0e7('0x57'))]('Transcript\x20not\x20available');}})[_0xe0e7('0x43')](function(_0x45a4ef){return _0x2c618d['download'](_0x45a4ef);})['catch'](handleError(_0x2c618d));}; \ No newline at end of file +var _0x0115=['include','options','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','filename','extname','unlink','downloads','MD5','col','$and','push','secrets','recording','VoiceRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','destroy','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','Location','bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','language','Transcribe\x20not\x20configured','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','update','then','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','map','format','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','catch','show','intersection'];(function(_0x304e0e,_0x2654a3){var _0x4449c8=function(_0x5a9242){while(--_0x5a9242){_0x304e0e['push'](_0x304e0e['shift']());}};_0x4449c8(++_0x2654a3);}(_0x0115,0xd8));var _0x5011=function(_0x256f03,_0x28b07e){_0x256f03=_0x256f03-0x0;var _0x4f4dfd=_0x0115[_0x256f03];return _0x4f4dfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5011('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5011('0x1'));var rp=require(_0x5011('0x2'));var moment=require('moment');var BPromise=require(_0x5011('0x3'));var Mustache=require('mustache');var util=require(_0x5011('0x4'));var path=require(_0x5011('0x5'));var sox=require('sox');var csv=require(_0x5011('0x6'));var ejs=require(_0x5011('0x7'));var fs=require('fs');var fs_extra=require(_0x5011('0x8'));var _=require(_0x5011('0x9'));var squel=require(_0x5011('0xa'));var crypto=require(_0x5011('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5011('0xc'));var toCsv=require(_0x5011('0x6'));var querystring=require(_0x5011('0xd'));var Papa=require(_0x5011('0xe'));var AWS=require(_0x5011('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0x5011('0x10'));var authService=require(_0x5011('0x11'));var qs=require(_0x5011('0x12'));var as=require(_0x5011('0x13'));var hardwareService=require(_0x5011('0x14'));var logger=require('../../config/logger')(_0x5011('0x15'));var utils=require(_0x5011('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5011('0x17'));var db=require(_0x5011('0x18'))['db'];function respondWithStatusCode(_0x16482c,_0x2fcb13){_0x2fcb13=_0x2fcb13||0xcc;return function(_0x545abc){if(_0x545abc){return _0x16482c[_0x5011('0x19')](_0x2fcb13);}return _0x16482c['status'](_0x2fcb13)[_0x5011('0x1a')]();};}function respondWithResult(_0x7130cf,_0x56b57f){_0x56b57f=_0x56b57f||0xc8;return function(_0x2a13a7){if(_0x2a13a7){return _0x7130cf['status'](_0x56b57f)[_0x5011('0x1b')](_0x2a13a7);}};}function respondWithFilteredResult(_0x37ea42,_0x241e92){return function(_0x124aea){if(_0x124aea){var _0x5df1be=typeof _0x241e92[_0x5011('0x1c')]===_0x5011('0x1d')&&typeof _0x241e92[_0x5011('0x1e')]===_0x5011('0x1d');var _0x4ca8ca=_0x124aea[_0x5011('0x1f')];var _0x307b05=_0x5df1be?0x0:_0x241e92[_0x5011('0x1c')];var _0xc61762=_0x5df1be?_0x124aea['count']:_0x241e92[_0x5011('0x1c')]+_0x241e92[_0x5011('0x1e')];var _0x42115d;if(_0xc61762>=_0x4ca8ca){_0xc61762=_0x4ca8ca;_0x42115d=0xc8;}else{_0x42115d=0xce;}_0x37ea42[_0x5011('0x20')](_0x42115d);return _0x37ea42['set'](_0x5011('0x21'),_0x307b05+'-'+_0xc61762+'/'+_0x4ca8ca)[_0x5011('0x1b')](_0x124aea);}return null;};}function patchUpdates(_0x1f359e){return function(_0x1a578a){try{jsonpatch[_0x5011('0x22')](_0x1a578a,_0x1f359e,!![]);}catch(_0x58b913){return BPromise['reject'](_0x58b913);}return _0x1a578a['save']();};}function saveUpdates(_0xce3b79,_0xe0019){return function(_0x10d955){if(_0x10d955){return _0x10d955[_0x5011('0x23')](_0xce3b79)['then'](function(_0x2a34c8){return _0x2a34c8;});}return null;};}function removeEntity(_0x458146,_0x377bc9){return function(_0x13c344){if(_0x13c344){return _0x13c344['destroy']()[_0x5011('0x24')](function(){_0x458146['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7b0a,_0x1b3105){return function(_0x36ddf5){if(!_0x36ddf5){_0x4b7b0a[_0x5011('0x19')](0x194);}return _0x36ddf5;};}function handleError(_0xf09427,_0x2e7d3a){_0x2e7d3a=_0x2e7d3a||0x1f4;return function(_0x3cd7b0){logger[_0x5011('0x25')](_0x3cd7b0[_0x5011('0x26')]);if(_0x3cd7b0[_0x5011('0x27')]){delete _0x3cd7b0[_0x5011('0x27')];}_0xf09427[_0x5011('0x20')](_0x2e7d3a)[_0x5011('0x28')](_0x3cd7b0);};}exports[_0x5011('0x29')]=function(_0x1cd218,_0x2b930c){var _0x20e931={},_0x3c34f6={},_0x5a4cdf={'count':0x0,'rows':[]};var _0x586ef3=_['map'](db[_0x5011('0x2a')][_0x5011('0x2b')],function(_0x5c6883){return{'name':_0x5c6883[_0x5011('0x2c')],'type':_0x5c6883[_0x5011('0x2d')][_0x5011('0x2e')]};});_0x3c34f6['model']=_['differenceBy'](_[_0x5011('0x2f')](_0x586ef3,'name'),[_0x5011('0x30')]);_0x3c34f6[_0x5011('0x31')]=_[_0x5011('0x32')](_0x1cd218['query']);_0x3c34f6[_0x5011('0x33')]=_['intersection'](_0x3c34f6['model'],_0x3c34f6[_0x5011('0x31')]);_0x20e931['attributes']=_['intersection'](_0x3c34f6[_0x5011('0x34')],qs[_0x5011('0x35')](_0x1cd218[_0x5011('0x31')]['fields']));_0x20e931[_0x5011('0x36')]=_0x20e931[_0x5011('0x36')][_0x5011('0x37')]?_0x20e931[_0x5011('0x36')]:_0x3c34f6[_0x5011('0x34')];if(!_0x1cd218[_0x5011('0x31')][_0x5011('0x38')](_0x5011('0x39'))){_0x20e931[_0x5011('0x1e')]=qs['limit'](_0x1cd218[_0x5011('0x31')]['limit']);_0x20e931[_0x5011('0x1c')]=qs[_0x5011('0x1c')](_0x1cd218[_0x5011('0x31')][_0x5011('0x1c')]);}_0x20e931[_0x5011('0x3a')]=qs[_0x5011('0x3b')](_0x1cd218['query'][_0x5011('0x3b')]);_0x20e931[_0x5011('0x3c')]=qs[_0x5011('0x33')](_[_0x5011('0x3d')](_0x1cd218[_0x5011('0x31')],_0x3c34f6[_0x5011('0x33')]),_0x586ef3);if(_0x1cd218[_0x5011('0x31')]['filter']){_0x20e931[_0x5011('0x3c')]=_['merge'](_0x20e931[_0x5011('0x3c')],{'$or':_[_0x5011('0x2f')](_0x586ef3,function(_0x51065a){if(_0x51065a['type']!==_0x5011('0x3e')){var _0x24958d={};_0x24958d[_0x51065a[_0x5011('0x27')]]={'$like':'%'+_0x1cd218['query'][_0x5011('0x3f')]+'%'};return _0x24958d;}})});}_0x20e931=_[_0x5011('0x40')]({},_0x20e931,_0x1cd218['options']);var _0x213373={'where':_0x20e931['where']};return db['VoiceRecording']['count'](_0x213373)[_0x5011('0x24')](function(_0x319743){_0x5a4cdf[_0x5011('0x1f')]=_0x319743;if(_0x1cd218[_0x5011('0x31')][_0x5011('0x41')]){_0x20e931['include']=[{'all':!![]}];}return db[_0x5011('0x2a')][_0x5011('0x42')](_0x20e931);})[_0x5011('0x24')](function(_0x38e4ca){_0x5a4cdf['rows']=_0x38e4ca;return _0x5a4cdf;})[_0x5011('0x24')](respondWithFilteredResult(_0x2b930c,_0x20e931))[_0x5011('0x43')](handleError(_0x2b930c,null));};exports[_0x5011('0x44')]=function(_0x1775b2,_0x4ec11d){var _0xd3b72d={'raw':![],'where':{'id':_0x1775b2['params']['id']}},_0x10a05f={};_0x10a05f[_0x5011('0x34')]=_[_0x5011('0x32')](db[_0x5011('0x2a')][_0x5011('0x2b')]);_0x10a05f[_0x5011('0x31')]=_[_0x5011('0x32')](_0x1775b2[_0x5011('0x31')]);_0x10a05f[_0x5011('0x33')]=_[_0x5011('0x45')](_0x10a05f['model'],_0x10a05f[_0x5011('0x31')]);_0xd3b72d[_0x5011('0x36')]=_[_0x5011('0x45')](_0x10a05f[_0x5011('0x34')],qs['fields'](_0x1775b2['query'][_0x5011('0x35')]));_0xd3b72d[_0x5011('0x36')]=_0xd3b72d[_0x5011('0x36')][_0x5011('0x37')]?_0xd3b72d[_0x5011('0x36')]:_0x10a05f[_0x5011('0x34')];if(_0x1775b2['query']['includeAll']){_0xd3b72d[_0x5011('0x46')]=[{'all':!![]}];}_0xd3b72d=_[_0x5011('0x40')]({},_0xd3b72d,_0x1775b2[_0x5011('0x47')]);return db[_0x5011('0x2a')]['find'](_0xd3b72d)[_0x5011('0x24')](handleEntityNotFound(_0x4ec11d,null))['then'](respondWithResult(_0x4ec11d,null))['catch'](handleError(_0x4ec11d,null));};exports[_0x5011('0x48')]=function(_0x14cb15,_0x4ddce6){return db['VoiceRecording'][_0x5011('0x48')](_0x14cb15[_0x5011('0x49')],{})[_0x5011('0x24')](respondWithResult(_0x4ddce6,0xc9))['catch'](handleError(_0x4ddce6,null));};exports[_0x5011('0x23')]=function(_0x214333,_0xbd8b3f){if(_0x214333[_0x5011('0x49')]['id']){delete _0x214333[_0x5011('0x49')]['id'];}return db[_0x5011('0x2a')][_0x5011('0x4a')]({'where':{'id':_0x214333[_0x5011('0x4b')]['id']}})[_0x5011('0x24')](handleEntityNotFound(_0xbd8b3f,null))[_0x5011('0x24')](saveUpdates(_0x214333[_0x5011('0x49')],null))[_0x5011('0x24')](respondWithResult(_0xbd8b3f,null))[_0x5011('0x43')](handleError(_0xbd8b3f,null));};exports['describe']=function(_0x522a81,_0x14763b){return db['VoiceRecording'][_0x5011('0x4c')]()[_0x5011('0x24')](respondWithResult(_0x14763b,null))[_0x5011('0x43')](handleError(_0x14763b,null));};exports[_0x5011('0x4d')]=function(_0x39469b,_0x10387b,_0xd6b6dc){var _0x144b9c=require(_0x5011('0x4e'));var _0x78113d=![];var _0x2fefa9={};if(_0x39469b['query'][_0x5011('0x2d')]&&_0x39469b[_0x5011('0x31')][_0x5011('0x2d')]==='uniqueid'){_0x2fefa9[_0x5011('0x4f')]=_0x39469b[_0x5011('0x4b')]['id'];}else{_0x2fefa9['id']=_0x39469b['params']['id'];}return db[_0x5011('0x2a')]['find']({'where':_0x2fefa9,'attributes':['id',_0x5011('0x50')],'raw':!![]})[_0x5011('0x24')](handleEntityNotFound(_0x10387b,null))['then'](function(_0x24a892){if(_0x24a892){var _0xebb794=_0x24a892[_0x5011('0x50')];var _0x598e19=util[_0x5011('0x30')](_0x5011('0x51'),_0xebb794);if(fs[_0x5011('0x52')](_0x598e19)){_0x78113d=!![];return _0x144b9c[_0x5011('0x53')](_0x598e19,_0xebb794,config['secrets']['recording'])[_0x5011('0x24')](function(){return _0x24a892;});}return _0x24a892;}})['then'](function(_0x7f4d1e){if(_0x7f4d1e){var _0x2db339=_0x7f4d1e[_0x5011('0x50')];if(!fs[_0x5011('0x52')](_0x2db339)){throw new db[(_0x5011('0x54'))][(_0x5011('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x7f4d1e[_0x5011('0x56')]){return _0x10387b[_0x5011('0x4d')](_0x2db339,_0x7f4d1e['filename']+path[_0x5011('0x57')](_0x2db339),function(){if(_0x78113d){fs[_0x5011('0x58')](_0x2db339);}});}else{return _0x10387b[_0x5011('0x4d')](_0x2db339,function(_0xfb10e7){if(_0x78113d){fs[_0x5011('0x58')](_0x2db339);}});}}})[_0x5011('0x43')](function(_0x56bbd1){if(_0x56bbd1['message']==='VoiceRecording\x20not\x20found'){_0x10387b[_0x5011('0x20')](0x194)['send']('Not\x20found');}else{return handleError(_0x10387b,null);}});};exports[_0x5011('0x59')]=function(_0x5af92f,_0x72141d,_0x1aef27){var _0x2498cc=require(_0x5011('0x4e'));var _0x3dfb93=![];var _0x1d642e={'$and':[db['sequelize'][_0x5011('0x3c')](db['sequelize']['fn'](_0x5011('0x5a'),db['sequelize'][_0x5011('0x5b')](_0x5011('0x4f'))),_0x5af92f[_0x5011('0x31')]['token'])]};if(_0x5af92f['query'][_0x5011('0x2d')]&&_0x5af92f[_0x5011('0x31')][_0x5011('0x2d')]===_0x5011('0x4f')){_0x1d642e[_0x5011('0x5c')][_0x5011('0x5d')]({'uniqueid':_0x5af92f[_0x5011('0x4b')]['id']});}else{_0x1d642e['$and'][_0x5011('0x5d')]({'id':_0x5af92f[_0x5011('0x4b')]['id']});}return db['VoiceRecording'][_0x5011('0x4a')]({'where':_0x1d642e,'attributes':['id',_0x5011('0x50')],'raw':!![]})[_0x5011('0x24')](handleEntityNotFound(_0x72141d,null))[_0x5011('0x24')](function(_0x16302f){if(_0x16302f){var _0x22cd79=util[_0x5011('0x30')]('%s.cypher',_0x16302f['value']);if(fs[_0x5011('0x52')](_0x22cd79)){_0x3dfb93=!![];return _0x2498cc['decryptFile'](_0x22cd79,_0x16302f[_0x5011('0x50')],config[_0x5011('0x5e')][_0x5011('0x5f')])['then'](function(){return _0x16302f;});}return _0x16302f;}})['then'](function(_0x78a557){if(_0x78a557){if(!fs[_0x5011('0x52')](_0x78a557[_0x5011('0x50')])){throw new db[(_0x5011('0x54'))]['ValidationError'](_0x5011('0x60'));}if(_0x78a557[_0x5011('0x56')]){return _0x72141d[_0x5011('0x4d')](_0x78a557[_0x5011('0x50')],_0x78a557[_0x5011('0x56')]+path[_0x5011('0x57')](_0x78a557[_0x5011('0x50')]),function(){if(_0x3dfb93){fs['unlink'](_0x78a557[_0x5011('0x50')]);}});}else{return _0x72141d[_0x5011('0x4d')](_0x78a557[_0x5011('0x50')],function(_0x593082){if(_0x3dfb93){fs['unlink'](_0x78a557[_0x5011('0x50')]);}});}}})[_0x5011('0x43')](handleError(_0x72141d,null));};exports['destroy']=function(_0x47457f,_0x507558){return db[_0x5011('0x2a')][_0x5011('0x4a')]({'where':{'id':_0x47457f[_0x5011('0x4b')]['id']}})[_0x5011('0x24')](function(_0x4dc173){if(_[_0x5011('0x61')](_0x4dc173)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4dc173;})[_0x5011('0x24')](function(_0x20a049){var _0x37d346=_0x20a049[_0x5011('0x50')];logger[_0x5011('0x62')](_0x5011('0x63'),_0x37d346);if(!_[_0x5011('0x61')](_0x20a049['value'])&&fs[_0x5011('0x52')](_0x37d346)){logger[_0x5011('0x62')]('File:\x20\x22'+_0x37d346+_0x5011('0x64'));fs['unlinkSync'](_0x37d346);}_0x37d346=_0x37d346+_0x5011('0x65');if(!_[_0x5011('0x61')](_0x20a049['value'])&&fs[_0x5011('0x52')](_0x37d346)){logger[_0x5011('0x62')](_0x5011('0x66')+_0x37d346+_0x5011('0x64'));fs[_0x5011('0x67')](_0x37d346);}return _0x20a049;})[_0x5011('0x24')](function(_0x175fa2){if(!_0x175fa2)throw new InternalError();return _0x175fa2[_0x5011('0x68')]();})[_0x5011('0x24')](function(){_0x507558[_0x5011('0x20')](0xcc)['end']();})[_0x5011('0x43')](handleError(_0x507558,null));};function getBucketslist(_0x11d86e,_0x518075,_0x5a230f){return new Promise(function(_0xf92202,_0x505e7d){var _0x19b169=new AWS['S3']({'accessKeyId':_0x518075,'secretAccessKey':_0x11d86e,'region':_0x5a230f});_0x19b169[_0x5011('0x69')]({},function(_0x4f482f,_0x4b3d48){if(_0x4f482f){return _0x505e7d(_0x4f482f);}else{return _0xf92202(_0x4b3d48);}});});}function createBucket(_0x1e20f9,_0x231b89,_0x2b1f27,_0x4561f8){return new Promise(function(_0x2dfa37,_0x3e4c3f){var _0x3842e9=new AWS['S3']({'accessKeyId':_0x231b89,'secretAccessKey':_0x1e20f9,'region':_0x2b1f27});_0x3842e9[_0x5011('0x6a')]({'Bucket':_0x4561f8},function(_0x5e5ecf,_0x14dddb){if(_0x5e5ecf){return _0x3e4c3f(_0x5e5ecf);}else{return _0x2dfa37(_0x14dddb);}});});}function uploadFile(_0x2fddb3,_0x3065f2,_0x1e838a,_0x436b54,_0x49b045,_0x3125c0){return new Promise(function(_0x579eff,_0x1bff48){var _0x16a0f7=new AWS['S3']({'accessKeyId':_0x3065f2,'secretAccessKey':_0x2fddb3,'region':_0x1e838a});_0x16a0f7[_0x5011('0x6b')]({'Bucket':_0x436b54,'Key':_0x49b045,'Body':_0x3125c0},function(_0x323870,_0x313ff7){if(_0x323870){return _0x1bff48(_0x323870);}else{return _0x579eff(_0x313ff7);}});});}function startTranscribe(_0x12b712,_0x54eb8c,_0x540a5c,_0x43896c,_0xd65f8b,_0xa4a041){return new Promise(function(_0xba775c,_0x4f39f5){var _0x324940=new AWS[(_0x5011('0x6c'))]({'accessKeyId':_0x54eb8c,'secretAccessKey':_0x12b712,'region':_0x540a5c});_0x324940[_0x5011('0x6d')]({'TranscriptionJobName':_0x43896c,'LanguageCode':_0xd65f8b,'Media':{'MediaFileUri':_0xa4a041}},function(_0x2d7e99,_0x5f0a99){if(_0x2d7e99){return _0x4f39f5(_0x2d7e99);}else{return _0xba775c(_0x5f0a99);}});});}function transcribe(_0x3aa10a,_0x357d96,_0x1c7e43,_0x32eed6,_0x3490c7,_0xf47f97,_0x25823){return new Promise(function(_0x3bfaa9,_0x45440c){var _0x2bf0b9={};logger[_0x5011('0x62')](util[_0x5011('0x30')](_0x5011('0x6e'),_0x3aa10a,_0x3490c7));return uploadFile(_0x357d96,_0x1c7e43,_0x32eed6,_0x3490c7,path['basename'](_0xf47f97),fs[_0x5011('0x6f')](_0xf47f97))[_0x5011('0x24')](function(_0xde9ead){logger[_0x5011('0x62')](util[_0x5011('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3aa10a,_0x3490c7,_0xde9ead[_0x5011('0x70')]));_0x2bf0b9[_0x5011('0x71')]=_0xde9ead['Bucket'];_0x2bf0b9['location']=_0xde9ead[_0x5011('0x70')];logger[_0x5011('0x62')](util[_0x5011('0x30')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3aa10a));return startTranscribe(_0x357d96,_0x1c7e43,_0x32eed6,uuidv4(),_0x25823,_0xde9ead['Location']);})[_0x5011('0x24')](function(_0x5c0651){logger[_0x5011('0x62')](util[_0x5011('0x30')](_0x5011('0x72'),_0x3aa10a,_0x5c0651[_0x5011('0x73')][_0x5011('0x74')]));_0x2bf0b9['transcribeName']=_0x5c0651[_0x5011('0x73')][_0x5011('0x74')];_0x2bf0b9[_0x5011('0x75')]=_0x5c0651[_0x5011('0x73')][_0x5011('0x76')];return _0x3bfaa9(_0x2bf0b9);})['catch'](function(_0x5f2e73){return _0x45440c(_0x5f2e73);});});}exports[_0x5011('0x77')]=function(_0xb860e6,_0x2b2ec7,_0x4eaa51){var _0x15de74;var _0x4b1ca8;var _0x56a75f;var _0x5a5712=require(_0x5011('0x4e'));return db[_0x5011('0x2a')][_0x5011('0x78')]({'where':{'id':_0xb860e6[_0x5011('0x4b')]['id']}})[_0x5011('0x24')](function(_0x355bb2){if(_0x355bb2){var _0x161244=util['format']('%s.cypher',_0x355bb2[_0x5011('0x50')]);if(fs[_0x5011('0x52')](_0x161244)){cypher=!![];return _0x5a5712['decryptFile'](_0x161244,_0x355bb2[_0x5011('0x50')],config[_0x5011('0x5e')][_0x5011('0x5f')])[_0x5011('0x24')](function(){return _0x355bb2;});}return _0x355bb2;}})[_0x5011('0x24')](function(_0x3f1586){if(!_0x3f1586){throw new db[(_0x5011('0x54'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x4b1ca8=_0x3f1586;return db[_0x5011('0x79')][_0x5011('0x78')]({'where':{'id':0x1}});})[_0x5011('0x24')](handleEntityNotFound(_0x2b2ec7,null))[_0x5011('0x24')](function(_0x19347a){if(_0x19347a){_0x15de74=_0x19347a;if(!_0x15de74['transcribe']||!_0x15de74['transcribeAccountId']||!_0x15de74['transcribeRegion']||!_0x15de74[_0x5011('0x7a')]||!_0x15de74[_0x5011('0x71')]){throw new db[(_0x5011('0x54'))][(_0x5011('0x55'))](_0x5011('0x7b'));}if(_0xb860e6[_0x5011('0x49')]['runSentiment']&&(!_0x15de74['sentiment']||!_0x15de74[_0x5011('0x7c')]||!_0x15de74['sentimentRegion']||!_0x15de74[_0x5011('0x7a')]||!_0x15de74['bucket'])){throw new db['Sequelize'][(_0x5011('0x55'))](_0x5011('0x7d'));}return db['CloudProvider']['findOne']({'where':{'id':_0x15de74[_0x5011('0x7e')]}});}})['then'](function(_0x2f35c6){if(!_0x2f35c6){throw new db['Sequelize'][(_0x5011('0x55'))](_0x5011('0x7f'));}if(!_0x2f35c6[_0x5011('0x80')]||!_0x2f35c6[_0x5011('0x81')]){throw new db[(_0x5011('0x54'))][(_0x5011('0x55'))](_0x5011('0x82'));}_0x56a75f=_0x2f35c6;return getBucketslist(_0x56a75f['data1'],_0x56a75f[_0x5011('0x81')],_0x15de74[_0x5011('0x83')]);})['then'](function(_0x348208){if(_0x348208&&_0x348208[_0x5011('0x84')]){var _0x284ad9=_[_0x5011('0x4a')](_0x348208[_0x5011('0x84')],function(_0x3aed55){return _0x3aed55[_0x5011('0x85')]===_0x15de74[_0x5011('0x71')];});if(!_0x284ad9){logger[_0x5011('0x62')](util[_0x5011('0x30')](_0x5011('0x86'),_0xb860e6['params']['id'],_0x15de74[_0x5011('0x71')]));return createBucket(_0x56a75f['data1'],_0x56a75f[_0x5011('0x81')],_0x15de74[_0x5011('0x83')],_0x15de74[_0x5011('0x71')]);}logger['info'](util[_0x5011('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xb860e6['params']['id'],_0x15de74['bucket']));return;}})[_0x5011('0x24')](function(_0x2624a5){if(_0x4b1ca8['transcribeStatus']===_0x5011('0x87')){return transcribe(_0xb860e6['params']['id'],_0x56a75f['data1'],_0x56a75f[_0x5011('0x81')],_0x15de74['transcribeRegion'],_0x15de74['bucket'],_0x4b1ca8[_0x5011('0x50')],_0x15de74['language']);}else{logger['info'](util[_0x5011('0x30')](_0x5011('0x88'),_0xb860e6[_0x5011('0x4b')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x5011('0x24')](function(_0x3f654d){if(_0x3f654d){_0x3f654d[_0x5011('0x89')]=_0xb860e6[_0x5011('0x49')][_0x5011('0x8a')];return _0x4b1ca8[_0x5011('0x8b')](_0x3f654d);}})[_0x5011('0x24')](respondWithResult(_0x2b2ec7,null))[_0x5011('0x43')](handleError(_0x2b2ec7,null));};function writeFile(_0x4568e0,_0x3dffbe){return new Promise(function(_0x5ef5d4,_0x4da527){fs[_0x5011('0x8c')](_0x3dffbe,_0x4568e0,function(_0x558bc1,_0x34a63d){if(_0x558bc1){return _0x4da527(_0x558bc1);}else{return _0x5ef5d4(_0x34a63d);}});});}exports['downloadTranscribe']=function(_0x5baf39,_0x384bfc,_0x3afe2a){return db[_0x5011('0x2a')][_0x5011('0x78')]({'where':{'id':_0x5baf39['params']['id']}})[_0x5011('0x24')](handleEntityNotFound(_0x384bfc))[_0x5011('0x24')](function(_0x4d0988){if(_0x4d0988&&_0x4d0988['fileText']){var _0x33b809=_0x4d0988[_0x5011('0x8d')];var _0x5a8a36=config['root']+_0x5011('0x8e')+_0x4d0988['id']+'.txt';if(fs[_0x5011('0x52')](_0x5a8a36)){return _0x5a8a36;}return writeFile(_0x33b809,_0x5a8a36)[_0x5011('0x24')](function(){return _0x5a8a36;});}else{throw new db[(_0x5011('0x54'))][(_0x5011('0x55'))]('Transcript\x20not\x20available');}})[_0x5011('0x24')](function(_0x4cca63){return _0x384bfc[_0x5011('0x4d')](_0x4cca63);})[_0x5011('0x43')](handleError(_0x384bfc));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 5b68eb5..e0393f3 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 _0x5765=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x3ef6a7,_0x21f854){var _0x522c75=function(_0x16968c){while(--_0x16968c){_0x3ef6a7['push'](_0x3ef6a7['shift']());}};_0x522c75(++_0x21f854);}(_0x5765,0x9b));var _0x5576=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x5765[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0x5576('0x0'));var util=require(_0x5576('0x1'));var logger=require('../../config/logger')(_0x5576('0x2'));var moment=require(_0x5576('0x3'));var BPromise=require(_0x5576('0x4'));var rp=require(_0x5576('0x5'));var fs=require('fs');var path=require(_0x5576('0x6'));var rimraf=require(_0x5576('0x7'));var config=require(_0x5576('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x2c0fb7,_0x4c30b5){return _0x2c0fb7['define'](_0x5576('0x9'),attributes,{'tableName':_0x5576('0xa'),'paranoid':![],'indexes':[{'name':_0x5576('0xb'),'fields':[_0x5576('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc1=['voice_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','VoiceRecording'];(function(_0x35410b,_0x554e37){var _0x56d8c4=function(_0x276c92){while(--_0x276c92){_0x35410b['push'](_0x35410b['shift']());}};_0x56d8c4(++_0x554e37);}(_0x7cc1,0x199));var _0x17cc=function(_0x344ab6,_0x4fd193){_0x344ab6=_0x344ab6-0x0;var _0x3e7cc1=_0x7cc1[_0x344ab6];return _0x3e7cc1;};'use strict';var _=require(_0x17cc('0x0'));var util=require(_0x17cc('0x1'));var logger=require(_0x17cc('0x2'))(_0x17cc('0x3'));var moment=require('moment');var BPromise=require(_0x17cc('0x4'));var rp=require(_0x17cc('0x5'));var fs=require('fs');var path=require(_0x17cc('0x6'));var rimraf=require(_0x17cc('0x7'));var config=require(_0x17cc('0x8'));var attributes=require(_0x17cc('0x9'));module['exports']=function(_0x13998e,_0x18cad7){return _0x13998e['define'](_0x17cc('0xa'),attributes,{'tableName':_0x17cc('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7cb5ec8..fd59637 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 _0xfcf0=['request\x20sent','stringify','error','message','result','UpdateVoiceRecording','update','body','options','attributes','limit','then','catch','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xfcf0[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['VoiceRecording'][_0x0fcf('0x16')](_0x19cfbd[_0x0fcf('0x17')],{'raw':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')]['where']||null:null,'attributes':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x19')]||null:null,'limit':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x1a')]||null:null})[_0x0fcf('0x1b')](function(_0x41b20b){logger[_0x0fcf('0xd')](_0x0fcf('0x15'),_0x19cfbd);logger['debug'](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x41b20b));_0x18ea32(_0x41b20b);})[_0x0fcf('0x1c')](function(_0xd6f8b5){logger[_0x0fcf('0x12')](_0x0fcf('0x15'),_0xd6f8b5[_0x0fcf('0x13')],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0xd6f8b5[_0x0fcf('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x18965e){var _0xc107a=this;return new Promise(function(_0x41b7a2,_0x2f198b){var _0x3876ed=require(_0x0fcf('0x1d'));var _0x2730b0;return db['Setting'][_0x0fcf('0x1e')]({'attributes':['id',_0x0fcf('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x0fcf('0x1b')](function(_0x35180d){_0x2730b0=_0x35180d;return db['VoiceRecording']['create'](_0x18965e['body']);})[_0x0fcf('0x1b')](function(_0x50b7df){if(_0x2730b0[_0x0fcf('0x1f')]&&fs[_0x0fcf('0x20')](_0x50b7df['value'])){var _0xdfd3ec=util[_0x0fcf('0x21')](_0x0fcf('0x22'),_0x50b7df[_0x0fcf('0x23')]);return _0x3876ed[_0x0fcf('0x24')](_0x50b7df[_0x0fcf('0x23')],_0xdfd3ec,config['secrets'][_0x0fcf('0x25')])[_0x0fcf('0x1b')](function(){fs[_0x0fcf('0x26')](_0x50b7df[_0x0fcf('0x23')]);logger[_0x0fcf('0xd')](_0x0fcf('0x27'));return _0x50b7df;});}return _0x50b7df;})['then'](function(_0x208433){logger[_0x0fcf('0xd')](_0x0fcf('0x28'),_0x18965e);logger[_0x0fcf('0xf')](_0x0fcf('0x28'),_0x18965e,JSON[_0x0fcf('0x11')](_0x208433));_0x41b7a2(_0x208433);})[_0x0fcf('0x1c')](function(_0x344957){logger[_0x0fcf('0x12')](_0x0fcf('0x28'),_0x344957[_0x0fcf('0x13')],_0x18965e);_0x2f198b(_0xc107a[_0x0fcf('0x12')](0x1f4,_0x344957[_0x0fcf('0x13')]));});});}; \ No newline at end of file +var _0x47c5=['secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceRecording','update','body','options','raw','where','attributes','limit','UpdateVoiceRecording','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher'];(function(_0x35bd17,_0x29612a){var _0x1b3ac2=function(_0x2382cc){while(--_0x2382cc){_0x35bd17['push'](_0x35bd17['shift']());}};_0x1b3ac2(++_0x29612a);}(_0x47c5,0x165));var _0x547c=function(_0xad4203,_0x5c5fc5){_0xad4203=_0xad4203-0x0;var _0x455ee1=_0x47c5[_0xad4203];return _0x455ee1;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['UpdateVoiceRecording']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23fa9e['options']?_0x23fa9e['options'][_0x547c('0x1d')]||null:null,'attributes':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1e')]||null:null,'limit':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1f')]||null:null})[_0x547c('0xc')](function(_0x436e67){logger['info'](_0x547c('0x20'),_0x23fa9e);logger[_0x547c('0x10')](_0x547c('0x20'),_0x23fa9e,JSON[_0x547c('0x12')](_0x436e67));_0xeb059e(_0x436e67);})[_0x547c('0x17')](function(_0x2663bc){logger[_0x547c('0x13')](_0x547c('0x20'),_0x2663bc['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2663bc['message']));});});};exports['CreateVoiceRecording']=function(_0x4855fd){var _0x478f04=this;return new Promise(function(_0x2c725d,_0x4c5256){var _0x93985c=require('../../components/encryptor');var _0x3ea493;return db['Setting'][_0x547c('0x21')]({'attributes':['id',_0x547c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x547c('0xc')](function(_0x30a96c){_0x3ea493=_0x30a96c;return db[_0x547c('0x18')]['create'](_0x4855fd['body']);})[_0x547c('0xc')](function(_0x54de6f){if(_0x3ea493[_0x547c('0x22')]&&fs[_0x547c('0x23')](_0x54de6f[_0x547c('0x24')])){var _0x1695be=util[_0x547c('0x25')](_0x547c('0x26'),_0x54de6f[_0x547c('0x24')]);return _0x93985c['encryptFile'](_0x54de6f['value'],_0x1695be,config[_0x547c('0x27')][_0x547c('0x28')])[_0x547c('0xc')](function(){fs[_0x547c('0x29')](_0x54de6f[_0x547c('0x24')]);logger[_0x547c('0xd')](_0x547c('0x2a'));return _0x54de6f;});}return _0x54de6f;})[_0x547c('0xc')](function(_0x378bac){logger[_0x547c('0xd')](_0x547c('0x2b'),_0x4855fd);logger[_0x547c('0x10')](_0x547c('0x2b'),_0x4855fd,JSON[_0x547c('0x12')](_0x378bac));_0x2c725d(_0x378bac);})['catch'](function(_0x3afc28){logger['error']('CreateVoiceRecording',_0x3afc28['message'],_0x4855fd);_0x4c5256(_0x478f04[_0x547c('0x13')](0x1f4,_0x3afc28[_0x547c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 62837ca..acc0c40 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 _0x6641=['../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3d7c92,_0xeec52c){var _0x263f3f=function(_0x5d056c){while(--_0x5d056c){_0x3d7c92['push'](_0x3d7c92['shift']());}};_0x263f3f(++_0xeec52c);}(_0x6641,0x1b0));var _0x1664=function(_0x25da28,_0x27d0b1){_0x25da28=_0x25da28-0x0;var _0x1019cb=_0x6641[_0x25da28];return _0x1019cb;};'use strict';var multer=require(_0x1664('0x0'));var util=require(_0x1664('0x1'));var path=require(_0x1664('0x2'));var timeout=require(_0x1664('0x3'));var express=require(_0x1664('0x4'));var router=express[_0x1664('0x5')]();var fs_extra=require(_0x1664('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1664('0x7'));var config=require(_0x1664('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x1664('0x9')]('/',auth[_0x1664('0xa')](),controller['index']);router[_0x1664('0x9')](_0x1664('0xb'),auth['isAuthenticated'](),controller[_0x1664('0xc')]);router[_0x1664('0x9')]('/:id',auth[_0x1664('0xa')](),controller[_0x1664('0xd')]);router[_0x1664('0xe')]('/',auth[_0x1664('0xa')](),controller[_0x1664('0xf')]);router[_0x1664('0x10')](_0x1664('0x11'),auth[_0x1664('0xa')](),controller[_0x1664('0x12')]);router[_0x1664('0x13')](_0x1664('0x11'),auth['isAuthenticated'](),controller[_0x1664('0x14')]);module[_0x1664('0x15')]=router; \ No newline at end of file +var _0x3c1d=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0x3c1d,0x110));var _0xd3c1=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3c1d[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0xd3c1('0x0'));var path=require(_0xd3c1('0x1'));var timeout=require(_0xd3c1('0x2'));var express=require(_0xd3c1('0x3'));var router=express[_0xd3c1('0x4')]();var fs_extra=require(_0xd3c1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd3c1('0x6'));var config=require(_0xd3c1('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xd3c1('0x8')](),controller['index']);router[_0xd3c1('0x9')]('/describe',auth[_0xd3c1('0x8')](),controller['describe']);router[_0xd3c1('0x9')](_0xd3c1('0xa'),auth[_0xd3c1('0x8')](),controller[_0xd3c1('0xb')]);router[_0xd3c1('0xc')]('/',auth[_0xd3c1('0x8')](),controller[_0xd3c1('0xd')]);router[_0xd3c1('0xe')]('/:id',auth[_0xd3c1('0x8')](),controller[_0xd3c1('0xf')]);router[_0xd3c1('0x10')]('/:id',auth[_0xd3c1('0x8')](),controller[_0xd3c1('0x11')]);module[_0xd3c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d8453b6..d6d9a78 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 _0x1c38=['attended','STRING','Yes','ENUM','blind'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1c38,0xf3));var _0x81c3=function(_0x4e5969,_0x59d73e){_0x4e5969=_0x4e5969-0x0;var _0x59d7ce=_0x1c38[_0x4e5969];return _0x59d7ce;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x81c3('0x0')](_0x81c3('0x1'),_0x81c3('0x2'))},'result':{'type':Sequelize[_0x81c3('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x81c3('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x81c3('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x81c3('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x81c3('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x81c3('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x81c3('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x81c3('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x81c3('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x81c3('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x81c3('0x3')]},'transfereecontext':{'type':Sequelize[_0x81c3('0x3')]},'transfereeexten':{'type':Sequelize[_0x81c3('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x81c3('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x81c3('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x123c=['ENUM','attended','STRING','Yes','sequelize','exports'];(function(_0x1cd5eb,_0xd67472){var _0x82916d=function(_0x571127){while(--_0x571127){_0x1cd5eb['push'](_0x1cd5eb['shift']());}};_0x82916d(++_0xd67472);}(_0x123c,0x1b4));var _0xc123=function(_0x27a610,_0x3402a2){_0x27a610=_0x27a610-0x0;var _0x544753=_0x123c[_0x27a610];return _0x544753;};'use strict';var Sequelize=require(_0xc123('0x0'));var moment=require('moment');module[_0xc123('0x1')]={'type':{'type':Sequelize[_0xc123('0x2')]('blind',_0xc123('0x3'))},'result':{'type':Sequelize[_0xc123('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xc123('0x4')]},'transferercalleridname':{'type':Sequelize[_0xc123('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc123('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xc123('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xc123('0x4')]},'transferercontext':{'type':Sequelize[_0xc123('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc123('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xc123('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xc123('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xc123('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xc123('0x4')]},'transfereeexten':{'type':Sequelize[_0xc123('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc123('0x4')]},'isexternal':{'type':Sequelize[_0xc123('0x2')](_0xc123('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index eddabbc..f21bec9 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 _0xe8ea=['lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','error','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','rimraf','zip-dir','util','path','sox','ejs','fs-extra'];(function(_0x299c88,_0x1e1878){var _0x4fd3d9=function(_0x558b6d){while(--_0x558b6d){_0x299c88['push'](_0x299c88['shift']());}};_0x4fd3d9(++_0x1e1878);}(_0xe8ea,0x109));var _0xae8e=function(_0x33932b,_0x124d36){_0x33932b=_0x33932b-0x0;var _0x22dea3=_0xe8ea[_0x33932b];return _0x22dea3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae8e('0x0'));var zipdir=require(_0xae8e('0x1'));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(_0xae8e('0x2'));var path=require(_0xae8e('0x3'));var sox=require(_0xae8e('0x4'));var csv=require('to-csv');var ejs=require(_0xae8e('0x5'));var fs=require('fs');var fs_extra=require(_0xae8e('0x6'));var _=require(_0xae8e('0x7'));var squel=require(_0xae8e('0x8'));var crypto=require('crypto');var jsforce=require(_0xae8e('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xae8e('0xa'));var Papa=require('papaparse');var Redis=require(_0xae8e('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xae8e('0xc'));var as=require(_0xae8e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae8e('0xe'))(_0xae8e('0xf'));var utils=require(_0xae8e('0x10'));var config=require(_0xae8e('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8d83,_0x27d449){_0x27d449=_0x27d449||0xcc;return function(_0x58ca4d){if(_0x58ca4d){return _0x2f8d83[_0xae8e('0x12')](_0x27d449);}return _0x2f8d83['status'](_0x27d449)[_0xae8e('0x13')]();};}function respondWithResult(_0x79985a,_0x5ecf37){_0x5ecf37=_0x5ecf37||0xc8;return function(_0x35841b){if(_0x35841b){return _0x79985a['status'](_0x5ecf37)[_0xae8e('0x14')](_0x35841b);}};}function respondWithFilteredResult(_0x180b8c,_0x36c594){return function(_0x2ac63c){if(_0x2ac63c){var _0x94b614=typeof _0x36c594[_0xae8e('0x15')]===_0xae8e('0x16')&&typeof _0x36c594[_0xae8e('0x17')]===_0xae8e('0x16');var _0x3018ab=_0x2ac63c[_0xae8e('0x18')];var _0x34f97f=_0x94b614?0x0:_0x36c594[_0xae8e('0x15')];var _0x3ee158=_0x94b614?_0x2ac63c[_0xae8e('0x18')]:_0x36c594[_0xae8e('0x15')]+_0x36c594['limit'];var _0x3f5542;if(_0x3ee158>=_0x3018ab){_0x3ee158=_0x3018ab;_0x3f5542=0xc8;}else{_0x3f5542=0xce;}_0x180b8c[_0xae8e('0x19')](_0x3f5542);return _0x180b8c[_0xae8e('0x1a')](_0xae8e('0x1b'),_0x34f97f+'-'+_0x3ee158+'/'+_0x3018ab)[_0xae8e('0x14')](_0x2ac63c);}return null;};}function patchUpdates(_0x364dc6){return function(_0x527166){try{jsonpatch[_0xae8e('0x1c')](_0x527166,_0x364dc6,!![]);}catch(_0x59dbae){return BPromise[_0xae8e('0x1d')](_0x59dbae);}return _0x527166['save']();};}function saveUpdates(_0x5d9857,_0x2a6cf4){return function(_0x195972){if(_0x195972){return _0x195972['update'](_0x5d9857)['then'](function(_0x1234a5){return _0x1234a5;});}return null;};}function removeEntity(_0x294247,_0xb1fdc0){return function(_0x316863){if(_0x316863){return _0x316863['destroy']()[_0xae8e('0x1e')](function(){_0x294247[_0xae8e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x204860,_0x5494d7){return function(_0x4e778d){if(!_0x4e778d){_0x204860[_0xae8e('0x12')](0x194);}return _0x4e778d;};}function handleError(_0x15f497,_0x106899){_0x106899=_0x106899||0x1f4;return function(_0x3b718d){logger[_0xae8e('0x1f')](_0x3b718d['stack']);if(_0x3b718d['name']){delete _0x3b718d[_0xae8e('0x20')];}_0x15f497['status'](_0x106899)[_0xae8e('0x21')](_0x3b718d);};}exports['index']=function(_0xa11c47,_0x37bac4){var _0x4783ed={},_0x3fe25b={},_0x2deade={'count':0x0,'rows':[]};var _0x3f1898=_[_0xae8e('0x22')](db[_0xae8e('0x23')][_0xae8e('0x24')],function(_0xe49791){return{'name':_0xe49791[_0xae8e('0x25')],'type':_0xe49791[_0xae8e('0x26')][_0xae8e('0x27')]};});_0x3fe25b[_0xae8e('0x28')]=_[_0xae8e('0x22')](_0x3f1898,_0xae8e('0x20'));_0x3fe25b['query']=_[_0xae8e('0x29')](_0xa11c47[_0xae8e('0x2a')]);_0x3fe25b[_0xae8e('0x2b')]=_[_0xae8e('0x2c')](_0x3fe25b[_0xae8e('0x28')],_0x3fe25b[_0xae8e('0x2a')]);_0x4783ed[_0xae8e('0x2d')]=_[_0xae8e('0x2c')](_0x3fe25b['model'],qs[_0xae8e('0x2e')](_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x2e')]));_0x4783ed[_0xae8e('0x2d')]=_0x4783ed[_0xae8e('0x2d')]['length']?_0x4783ed[_0xae8e('0x2d')]:_0x3fe25b[_0xae8e('0x28')];if(!_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x2f')](_0xae8e('0x30'))){_0x4783ed[_0xae8e('0x17')]=qs['limit'](_0xa11c47['query'][_0xae8e('0x17')]);_0x4783ed['offset']=qs[_0xae8e('0x15')](_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x15')]);}_0x4783ed['order']=qs[_0xae8e('0x31')](_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x31')]);_0x4783ed[_0xae8e('0x32')]=qs['filters'](_[_0xae8e('0x33')](_0xa11c47[_0xae8e('0x2a')],_0x3fe25b['filters']),_0x3f1898);if(_0xa11c47['query'][_0xae8e('0x34')]){_0x4783ed[_0xae8e('0x32')]=_['merge'](_0x4783ed[_0xae8e('0x32')],{'$or':_[_0xae8e('0x22')](_0x3f1898,function(_0x51f049){if(_0x51f049[_0xae8e('0x26')]!=='VIRTUAL'){var _0x59a644={};_0x59a644[_0x51f049[_0xae8e('0x20')]]={'$like':'%'+_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x34')]+'%'};return _0x59a644;}})});}_0x4783ed=_[_0xae8e('0x35')]({},_0x4783ed,_0xa11c47[_0xae8e('0x36')]);var _0x519a35={'where':_0x4783ed['where']};return db[_0xae8e('0x23')][_0xae8e('0x18')](_0x519a35)['then'](function(_0x1405bc){_0x2deade['count']=_0x1405bc;if(_0xa11c47[_0xae8e('0x2a')][_0xae8e('0x37')]){_0x4783ed[_0xae8e('0x38')]=[{'all':!![]}];}return db[_0xae8e('0x23')][_0xae8e('0x39')](_0x4783ed);})[_0xae8e('0x1e')](function(_0x210c6d){_0x2deade[_0xae8e('0x3a')]=_0x210c6d;return _0x2deade;})[_0xae8e('0x1e')](respondWithFilteredResult(_0x37bac4,_0x4783ed))[_0xae8e('0x3b')](handleError(_0x37bac4,null));};exports[_0xae8e('0x3c')]=function(_0x645b34,_0x282878){var _0x5adbc4={'raw':!![],'where':{'id':_0x645b34[_0xae8e('0x3d')]['id']}},_0x7af3c4={};_0x7af3c4[_0xae8e('0x28')]=_[_0xae8e('0x29')](db[_0xae8e('0x23')][_0xae8e('0x24')]);_0x7af3c4[_0xae8e('0x2a')]=_[_0xae8e('0x29')](_0x645b34[_0xae8e('0x2a')]);_0x7af3c4['filters']=_[_0xae8e('0x2c')](_0x7af3c4[_0xae8e('0x28')],_0x7af3c4[_0xae8e('0x2a')]);_0x5adbc4['attributes']=_['intersection'](_0x7af3c4[_0xae8e('0x28')],qs[_0xae8e('0x2e')](_0x645b34['query'][_0xae8e('0x2e')]));_0x5adbc4[_0xae8e('0x2d')]=_0x5adbc4[_0xae8e('0x2d')][_0xae8e('0x3e')]?_0x5adbc4[_0xae8e('0x2d')]:_0x7af3c4[_0xae8e('0x28')];if(_0x645b34['query'][_0xae8e('0x37')]){_0x5adbc4[_0xae8e('0x38')]=[{'all':!![]}];}_0x5adbc4=_[_0xae8e('0x35')]({},_0x5adbc4,_0x645b34[_0xae8e('0x36')]);return db['VoiceTransferReport'][_0xae8e('0x3f')](_0x5adbc4)[_0xae8e('0x1e')](handleEntityNotFound(_0x282878,null))[_0xae8e('0x1e')](respondWithResult(_0x282878,null))[_0xae8e('0x3b')](handleError(_0x282878,null));};exports['create']=function(_0x53c0c2,_0x5244fa){return db[_0xae8e('0x23')][_0xae8e('0x40')](_0x53c0c2[_0xae8e('0x41')],{})['then'](respondWithResult(_0x5244fa,0xc9))[_0xae8e('0x3b')](handleError(_0x5244fa,null));};exports[_0xae8e('0x42')]=function(_0x52b4b1,_0x13c2af){if(_0x52b4b1[_0xae8e('0x41')]['id']){delete _0x52b4b1[_0xae8e('0x41')]['id'];}return db[_0xae8e('0x23')][_0xae8e('0x3f')]({'where':{'id':_0x52b4b1[_0xae8e('0x3d')]['id']}})[_0xae8e('0x1e')](handleEntityNotFound(_0x13c2af,null))['then'](saveUpdates(_0x52b4b1[_0xae8e('0x41')],null))[_0xae8e('0x1e')](respondWithResult(_0x13c2af,null))[_0xae8e('0x3b')](handleError(_0x13c2af,null));};exports['destroy']=function(_0x3d7520,_0x542fa9){return db[_0xae8e('0x23')][_0xae8e('0x3f')]({'where':{'id':_0x3d7520[_0xae8e('0x3d')]['id']}})[_0xae8e('0x1e')](handleEntityNotFound(_0x542fa9,null))[_0xae8e('0x1e')](removeEntity(_0x542fa9,null))[_0xae8e('0x3b')](handleError(_0x542fa9,null));};exports[_0xae8e('0x43')]=function(_0x10ef6d,_0x68e1db){return db['VoiceTransferReport'][_0xae8e('0x43')]()['then'](respondWithResult(_0x68e1db,null))[_0xae8e('0x3b')](handleError(_0x68e1db,null));}; \ No newline at end of file +var _0x29ab=['hasOwnProperty','order','where','pick','filters','filter','merge','type','VIRTUAL','options','include','catch','show','includeAll','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','error','stack','send','index','VoiceTransferReport','fieldName','key','model','map','name','query','keys','intersection','attributes','fields'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x29ab,0xaa));var _0xb29a=function(_0x4cff7b,_0x27a994){_0x4cff7b=_0x4cff7b-0x0;var _0x9df5fd=_0x29ab[_0x4cff7b];return _0x9df5fd;};'use strict';var emlformat=require(_0xb29a('0x0'));var rimraf=require(_0xb29a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb29a('0x2'));var rp=require(_0xb29a('0x3'));var moment=require(_0xb29a('0x4'));var BPromise=require(_0xb29a('0x5'));var Mustache=require('mustache');var util=require(_0xb29a('0x6'));var path=require('path');var sox=require(_0xb29a('0x7'));var csv=require(_0xb29a('0x8'));var ejs=require(_0xb29a('0x9'));var fs=require('fs');var fs_extra=require(_0xb29a('0xa'));var _=require(_0xb29a('0xb'));var squel=require(_0xb29a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb29a('0xd'));var deskjs=require(_0xb29a('0xe'));var toCsv=require(_0xb29a('0x8'));var querystring=require(_0xb29a('0xf'));var Papa=require(_0xb29a('0x10'));var Redis=require(_0xb29a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb29a('0x12'));var hardwareService=require(_0xb29a('0x13'));var logger=require(_0xb29a('0x14'))(_0xb29a('0x15'));var utils=require(_0xb29a('0x16'));var config=require(_0xb29a('0x17'));var licenseUtil=require(_0xb29a('0x18'));var db=require(_0xb29a('0x19'))['db'];function respondWithStatusCode(_0x1bd1b5,_0x391219){_0x391219=_0x391219||0xcc;return function(_0x2a2374){if(_0x2a2374){return _0x1bd1b5[_0xb29a('0x1a')](_0x391219);}return _0x1bd1b5['status'](_0x391219)[_0xb29a('0x1b')]();};}function respondWithResult(_0x27391b,_0x3fc8db){_0x3fc8db=_0x3fc8db||0xc8;return function(_0x308b95){if(_0x308b95){return _0x27391b['status'](_0x3fc8db)[_0xb29a('0x1c')](_0x308b95);}};}function respondWithFilteredResult(_0x2804a7,_0x490251){return function(_0x59d48a){if(_0x59d48a){var _0x360c19=typeof _0x490251[_0xb29a('0x1d')]===_0xb29a('0x1e')&&typeof _0x490251[_0xb29a('0x1f')]==='undefined';var _0x260186=_0x59d48a[_0xb29a('0x20')];var _0x9ec5e8=_0x360c19?0x0:_0x490251['offset'];var _0x3aa426=_0x360c19?_0x59d48a[_0xb29a('0x20')]:_0x490251[_0xb29a('0x1d')]+_0x490251[_0xb29a('0x1f')];var _0x51c15f;if(_0x3aa426>=_0x260186){_0x3aa426=_0x260186;_0x51c15f=0xc8;}else{_0x51c15f=0xce;}_0x2804a7[_0xb29a('0x21')](_0x51c15f);return _0x2804a7[_0xb29a('0x22')](_0xb29a('0x23'),_0x9ec5e8+'-'+_0x3aa426+'/'+_0x260186)['json'](_0x59d48a);}return null;};}function patchUpdates(_0x1b59c4){return function(_0x4bca1a){try{jsonpatch[_0xb29a('0x24')](_0x4bca1a,_0x1b59c4,!![]);}catch(_0xdfbedf){return BPromise[_0xb29a('0x25')](_0xdfbedf);}return _0x4bca1a['save']();};}function saveUpdates(_0xeb17c1,_0x17baa4){return function(_0x4eff8c){if(_0x4eff8c){return _0x4eff8c['update'](_0xeb17c1)[_0xb29a('0x26')](function(_0xbba78c){return _0xbba78c;});}return null;};}function removeEntity(_0x24ecdd,_0x4e2f36){return function(_0x3a8ffd){if(_0x3a8ffd){return _0x3a8ffd[_0xb29a('0x27')]()['then'](function(){_0x24ecdd['status'](0xcc)[_0xb29a('0x1b')]();});}};}function handleEntityNotFound(_0x58c774,_0x2b3f7f){return function(_0x5b94c7){if(!_0x5b94c7){_0x58c774[_0xb29a('0x1a')](0x194);}return _0x5b94c7;};}function handleError(_0x591d33,_0xae8a9f){_0xae8a9f=_0xae8a9f||0x1f4;return function(_0x25d034){logger[_0xb29a('0x28')](_0x25d034[_0xb29a('0x29')]);if(_0x25d034['name']){delete _0x25d034['name'];}_0x591d33[_0xb29a('0x21')](_0xae8a9f)[_0xb29a('0x2a')](_0x25d034);};}exports[_0xb29a('0x2b')]=function(_0x32abbc,_0x20bb09){var _0x19f44f={},_0x391b00={},_0x2c1766={'count':0x0,'rows':[]};var _0x5c403a=_['map'](db[_0xb29a('0x2c')]['rawAttributes'],function(_0x3ce181){return{'name':_0x3ce181[_0xb29a('0x2d')],'type':_0x3ce181['type'][_0xb29a('0x2e')]};});_0x391b00[_0xb29a('0x2f')]=_[_0xb29a('0x30')](_0x5c403a,_0xb29a('0x31'));_0x391b00[_0xb29a('0x32')]=_[_0xb29a('0x33')](_0x32abbc['query']);_0x391b00['filters']=_[_0xb29a('0x34')](_0x391b00[_0xb29a('0x2f')],_0x391b00[_0xb29a('0x32')]);_0x19f44f[_0xb29a('0x35')]=_[_0xb29a('0x34')](_0x391b00['model'],qs[_0xb29a('0x36')](_0x32abbc[_0xb29a('0x32')][_0xb29a('0x36')]));_0x19f44f['attributes']=_0x19f44f[_0xb29a('0x35')]['length']?_0x19f44f[_0xb29a('0x35')]:_0x391b00[_0xb29a('0x2f')];if(!_0x32abbc[_0xb29a('0x32')][_0xb29a('0x37')]('nolimit')){_0x19f44f['limit']=qs[_0xb29a('0x1f')](_0x32abbc['query']['limit']);_0x19f44f[_0xb29a('0x1d')]=qs['offset'](_0x32abbc[_0xb29a('0x32')][_0xb29a('0x1d')]);}_0x19f44f[_0xb29a('0x38')]=qs['sort'](_0x32abbc[_0xb29a('0x32')]['sort']);_0x19f44f[_0xb29a('0x39')]=qs['filters'](_[_0xb29a('0x3a')](_0x32abbc[_0xb29a('0x32')],_0x391b00[_0xb29a('0x3b')]),_0x5c403a);if(_0x32abbc[_0xb29a('0x32')][_0xb29a('0x3c')]){_0x19f44f[_0xb29a('0x39')]=_[_0xb29a('0x3d')](_0x19f44f[_0xb29a('0x39')],{'$or':_['map'](_0x5c403a,function(_0x4ed13e){if(_0x4ed13e[_0xb29a('0x3e')]!==_0xb29a('0x3f')){var _0x31d01d={};_0x31d01d[_0x4ed13e[_0xb29a('0x31')]]={'$like':'%'+_0x32abbc[_0xb29a('0x32')]['filter']+'%'};return _0x31d01d;}})});}_0x19f44f=_[_0xb29a('0x3d')]({},_0x19f44f,_0x32abbc[_0xb29a('0x40')]);var _0x53b4ac={'where':_0x19f44f[_0xb29a('0x39')]};return db['VoiceTransferReport'][_0xb29a('0x20')](_0x53b4ac)['then'](function(_0x2c749c){_0x2c1766[_0xb29a('0x20')]=_0x2c749c;if(_0x32abbc[_0xb29a('0x32')]['includeAll']){_0x19f44f[_0xb29a('0x41')]=[{'all':!![]}];}return db[_0xb29a('0x2c')]['findAll'](_0x19f44f);})['then'](function(_0x44cd58){_0x2c1766['rows']=_0x44cd58;return _0x2c1766;})['then'](respondWithFilteredResult(_0x20bb09,_0x19f44f))[_0xb29a('0x42')](handleError(_0x20bb09,null));};exports[_0xb29a('0x43')]=function(_0x45f867,_0x41b429){var _0x2c76e5={'raw':!![],'where':{'id':_0x45f867['params']['id']}},_0x528f6={};_0x528f6['model']=_[_0xb29a('0x33')](db['VoiceTransferReport']['rawAttributes']);_0x528f6[_0xb29a('0x32')]=_['keys'](_0x45f867[_0xb29a('0x32')]);_0x528f6[_0xb29a('0x3b')]=_[_0xb29a('0x34')](_0x528f6[_0xb29a('0x2f')],_0x528f6['query']);_0x2c76e5['attributes']=_[_0xb29a('0x34')](_0x528f6[_0xb29a('0x2f')],qs[_0xb29a('0x36')](_0x45f867[_0xb29a('0x32')][_0xb29a('0x36')]));_0x2c76e5[_0xb29a('0x35')]=_0x2c76e5[_0xb29a('0x35')]['length']?_0x2c76e5['attributes']:_0x528f6[_0xb29a('0x2f')];if(_0x45f867[_0xb29a('0x32')][_0xb29a('0x44')]){_0x2c76e5['include']=[{'all':!![]}];}_0x2c76e5=_[_0xb29a('0x3d')]({},_0x2c76e5,_0x45f867['options']);return db[_0xb29a('0x2c')][_0xb29a('0x45')](_0x2c76e5)['then'](handleEntityNotFound(_0x41b429,null))[_0xb29a('0x26')](respondWithResult(_0x41b429,null))[_0xb29a('0x42')](handleError(_0x41b429,null));};exports['create']=function(_0x2f842a,_0x44d4db){return db[_0xb29a('0x2c')][_0xb29a('0x46')](_0x2f842a[_0xb29a('0x47')],{})[_0xb29a('0x26')](respondWithResult(_0x44d4db,0xc9))['catch'](handleError(_0x44d4db,null));};exports[_0xb29a('0x48')]=function(_0x302625,_0x34434b){if(_0x302625[_0xb29a('0x47')]['id']){delete _0x302625[_0xb29a('0x47')]['id'];}return db[_0xb29a('0x2c')][_0xb29a('0x45')]({'where':{'id':_0x302625[_0xb29a('0x49')]['id']}})[_0xb29a('0x26')](handleEntityNotFound(_0x34434b,null))[_0xb29a('0x26')](saveUpdates(_0x302625[_0xb29a('0x47')],null))[_0xb29a('0x26')](respondWithResult(_0x34434b,null))[_0xb29a('0x42')](handleError(_0x34434b,null));};exports['destroy']=function(_0x3b3ef5,_0x3b0a34){return db[_0xb29a('0x2c')][_0xb29a('0x45')]({'where':{'id':_0x3b3ef5[_0xb29a('0x49')]['id']}})[_0xb29a('0x26')](handleEntityNotFound(_0x3b0a34,null))[_0xb29a('0x26')](removeEntity(_0x3b0a34,null))[_0xb29a('0x42')](handleError(_0x3b0a34,null));};exports[_0xb29a('0x4a')]=function(_0x1c5473,_0x4b98ab){return db[_0xb29a('0x2c')][_0xb29a('0x4a')]()['then'](respondWithResult(_0x4b98ab,null))[_0xb29a('0x42')](handleError(_0x4b98ab,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c53ec54..29b8cb2 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 _0xbabf=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','bluebird','request-promise'];(function(_0x3b07d7,_0x374e44){var _0x2a9b53=function(_0x11a0e5){while(--_0x11a0e5){_0x3b07d7['push'](_0x3b07d7['shift']());}};_0x2a9b53(++_0x374e44);}(_0xbabf,0x92));var _0xfbab=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xbabf[_0x45f951];return _0x24756c;};'use strict';var _=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfbab('0x2'));var rp=require(_0xfbab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbab('0x4'));var config=require(_0xfbab('0x5'));var attributes=require(_0xfbab('0x6'));module[_0xfbab('0x7')]=function(_0xf7d80d,_0x36d5a7){return _0xf7d80d[_0xfbab('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xfbab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1945=['moment','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x50c08e,_0x135a5f){var _0x353144=function(_0x5d778f){while(--_0x5d778f){_0x50c08e['push'](_0x50c08e['shift']());}};_0x353144(++_0x135a5f);}(_0x1945,0x141));var _0x5194=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x1945[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x5194('0x0'));var util=require(_0x5194('0x1'));var logger=require(_0x5194('0x2'))(_0x5194('0x3'));var moment=require(_0x5194('0x4'));var BPromise=require('bluebird');var rp=require(_0x5194('0x5'));var fs=require('fs');var path=require(_0x5194('0x6'));var rimraf=require(_0x5194('0x7'));var config=require('../../config/environment');var attributes=require(_0x5194('0x8'));module[_0x5194('0x9')]=function(_0x150f16,_0x769bb4){return _0x150f16[_0x5194('0xa')](_0x5194('0xb'),attributes,{'tableName':_0x5194('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 2fe829f..0b50a44 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 _0xc05f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body','options','raw','debug','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc05f,0xa7));var _0xfc05=function(_0x45f4f2,_0x3ab5aa){_0x45f4f2=_0x45f4f2-0x0;var _0x4f19f0=_0xc05f[_0x45f4f2];return _0x4f19f0;};'use strict';var _=require(_0xfc05('0x0'));var util=require(_0xfc05('0x1'));var moment=require(_0xfc05('0x2'));var BPromise=require(_0xfc05('0x3'));var rs=require(_0xfc05('0x4'));var fs=require('fs');var Redis=require(_0xfc05('0x5'));var db=require(_0xfc05('0x6'))['db'];var utils=require(_0xfc05('0x7'));var logger=require(_0xfc05('0x8'))(_0xfc05('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfc05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50dcca,_0x5c3069,_0x5f08c8){return new BPromise(function(_0x113ab2,_0x2c1498){return client[_0xfc05('0xb')](_0x50dcca,_0x5f08c8)[_0xfc05('0xc')](function(_0x48c086){logger[_0xfc05('0xd')](_0xfc05('0xe'),_0x5c3069,_0xfc05('0xf'));logger['debug'](_0xfc05('0x10'),_0x5c3069,'request\x20sent',JSON[_0xfc05('0x11')](_0x48c086));if(_0x48c086[_0xfc05('0x12')]){if(_0x48c086['error'][_0xfc05('0x13')]===0x1f4){logger[_0xfc05('0x12')](_0xfc05('0xe'),_0x5c3069,_0x48c086[_0xfc05('0x12')][_0xfc05('0x14')]);return _0x2c1498(_0x48c086[_0xfc05('0x12')][_0xfc05('0x14')]);}logger[_0xfc05('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c3069,_0x48c086[_0xfc05('0x12')]['message']);return _0x113ab2(_0x48c086[_0xfc05('0x12')][_0xfc05('0x14')]);}else{logger[_0xfc05('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c3069,_0xfc05('0xf'));_0x113ab2(_0x48c086['result']['message']);}})[_0xfc05('0x15')](function(_0x20e167){logger['error'](_0xfc05('0xe'),_0x5c3069,_0x20e167);_0x2c1498(_0x20e167);});});}exports[_0xfc05('0x16')]=function(_0x15e589){var _0x5f091b=this;return new Promise(function(_0x5d5cdd,_0x561258){return db['VoiceTransferReport'][_0xfc05('0x17')](_0x15e589[_0xfc05('0x18')],{'raw':_0x15e589[_0xfc05('0x19')]?_0x15e589[_0xfc05('0x19')][_0xfc05('0x1a')]===undefined?!![]:![]:!![]})[_0xfc05('0xc')](function(_0x4f5104){logger[_0xfc05('0xd')]('CreateVoiceTransferReport',_0x15e589);logger[_0xfc05('0x1b')](_0xfc05('0x16'),_0x15e589,JSON[_0xfc05('0x11')](_0x4f5104));_0x5d5cdd(_0x4f5104);})[_0xfc05('0x15')](function(_0x36de61){logger[_0xfc05('0x12')](_0xfc05('0x16'),_0x36de61[_0xfc05('0x14')],_0x15e589);_0x561258(_0x5f091b[_0xfc05('0x12')](0x1f4,_0x36de61[_0xfc05('0x14')]));});});}; \ No newline at end of file +var _0x177c=['request','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x177c,0x1c0));var _0xc177=function(_0x11495b,_0x52ff34){_0x11495b=_0x11495b-0x0;var _0x468d3b=_0x177c[_0x11495b];return _0x468d3b;};'use strict';var _=require(_0xc177('0x0'));var util=require(_0xc177('0x1'));var moment=require(_0xc177('0x2'));var BPromise=require(_0xc177('0x3'));var rs=require(_0xc177('0x4'));var fs=require('fs');var Redis=require(_0xc177('0x5'));var db=require(_0xc177('0x6'))['db'];var utils=require(_0xc177('0x7'));var logger=require(_0xc177('0x8'))(_0xc177('0x9'));var config=require(_0xc177('0xa'));var jayson=require(_0xc177('0xb'));var client=jayson[_0xc177('0xc')][_0xc177('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x713f76,_0x6c7d94,_0x210748){return new BPromise(function(_0x55925b,_0x3573b4){return client[_0xc177('0xe')](_0x713f76,_0x210748)[_0xc177('0xf')](function(_0x577bfa){logger[_0xc177('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x6c7d94,'request\x20sent');logger[_0xc177('0x11')](_0xc177('0x12'),_0x6c7d94,_0xc177('0x13'),JSON[_0xc177('0x14')](_0x577bfa));if(_0x577bfa[_0xc177('0x15')]){if(_0x577bfa[_0xc177('0x15')][_0xc177('0x16')]===0x1f4){logger[_0xc177('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x6c7d94,_0x577bfa['error']['message']);return _0x3573b4(_0x577bfa['error'][_0xc177('0x17')]);}logger[_0xc177('0x15')](_0xc177('0x18'),_0x6c7d94,_0x577bfa['error']['message']);return _0x55925b(_0x577bfa[_0xc177('0x15')][_0xc177('0x17')]);}else{logger[_0xc177('0x10')](_0xc177('0x18'),_0x6c7d94,_0xc177('0x13'));_0x55925b(_0x577bfa[_0xc177('0x19')]['message']);}})['catch'](function(_0x1283ca){logger['error'](_0xc177('0x18'),_0x6c7d94,_0x1283ca);_0x3573b4(_0x1283ca);});});}exports[_0xc177('0x1a')]=function(_0x38b24){var _0x5a016e=this;return new Promise(function(_0x53fd99,_0x5e0498){return db[_0xc177('0x1b')][_0xc177('0x1c')](_0x38b24[_0xc177('0x1d')],{'raw':_0x38b24[_0xc177('0x1e')]?_0x38b24[_0xc177('0x1e')][_0xc177('0x1f')]===undefined?!![]:![]:!![]})[_0xc177('0xf')](function(_0x3e71ec){logger['info']('CreateVoiceTransferReport',_0x38b24);logger[_0xc177('0x11')](_0xc177('0x1a'),_0x38b24,JSON['stringify'](_0x3e71ec));_0x53fd99(_0x3e71ec);})[_0xc177('0x20')](function(_0x5d5bf8){logger[_0xc177('0x15')](_0xc177('0x1a'),_0x5d5bf8[_0xc177('0x17')],_0x38b24);_0x5e0498(_0x5a016e[_0xc177('0x15')](0x1f4,_0x5d5bf8[_0xc177('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ce3f057..814903f 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x384e63,_0x3cdb06){var _0x163527=function(_0x3ba64c){while(--_0x3ba64c){_0x384e63['push'](_0x384e63['shift']());}};_0x163527(++_0x3cdb06);}(_0xe14d,0x1ee));var _0xde14=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe14d[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0x9f62=['/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','hold','/calls','/transfer','transfer','exports','Router','./webbar.controller','post','/originate','originate'];(function(_0x284304,_0xbbe040){var _0x2fcef1=function(_0x3e0da7){while(--_0x3e0da7){_0x284304['push'](_0x284304['shift']());}};_0x2fcef1(++_0xbbe040);}(_0x9f62,0x154));var _0x29f6=function(_0x167e93,_0x58360b){_0x167e93=_0x167e93-0x0;var _0x41d91b=_0x9f62[_0x167e93];return _0x41d91b;};'use strict';var express=require('express');var router=express[_0x29f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x29f6('0x1'));router[_0x29f6('0x2')](_0x29f6('0x3'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x29f6('0x4')]);router[_0x29f6('0x2')](_0x29f6('0x5'),auth[_0x29f6('0x6')](),auth['isWebrtcLicence'](),controller[_0x29f6('0x7')]);router[_0x29f6('0x2')](_0x29f6('0x8'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router['post']('/unhold',auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['unhold']);router[_0x29f6('0x2')](_0x29f6('0xb'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['calls']);router['post'](_0x29f6('0xc'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 1e984c2..b0ee893 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bc6=['path','lodash','../../mysqldb','client','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','findOne','VoiceChannels','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','callerId','format','user:%s','json','originate\x20executed!','hangup\x20fired:','userId','entityFound:','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','all','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!'];(function(_0x4cfd4a,_0x340a41){var _0x42a03c=function(_0x3f3833){while(--_0x3f3833){_0x4cfd4a['push'](_0x4cfd4a['shift']());}};_0x42a03c(++_0x340a41);}(_0x2bc6,0x163));var _0x62bc=function(_0x2f6d5a,_0xa62cc4){_0x2f6d5a=_0x2f6d5a-0x0;var _0x1301ad=_0x2bc6[_0x2f6d5a];return _0x1301ad;};'use strict';var path=require(_0x62bc('0x0'));var fs=require('fs');var _=require(_0x62bc('0x1'));var db=require(_0x62bc('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x62bc('0x3')]['http']({'port':0x232a});var logger=require(_0x62bc('0x4'))(_0x62bc('0x5'));var Redis=require('ioredis');config[_0x62bc('0x6')]=_[_0x62bc('0x7')](config[_0x62bc('0x6')],{'host':_0x62bc('0x8'),'port':0x18eb});var io=require(_0x62bc('0x9'))(new Redis(config[_0x62bc('0x6')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]},'callNumber':{'type':_0x62bc('0xc'),'required':[!![],_0x62bc('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x62bc('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]},'sessionId':{'type':_0x62bc('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]},'sessionId':{'type':_0x62bc('0xc'),'required':[!![],_0x62bc('0xe')]},'transferNumber':{'type':'string','required':[!![],_0x62bc('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x62bc('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x62bc('0xa'),'required':[!![],_0x62bc('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x39c5e0,_0x2d6820,_0x5bb569){logger[_0x62bc('0x10')](_0x39c5e0,_0x2d6820,JSON[_0x62bc('0x11')](_0x5bb569));io['to'](_0x39c5e0)[_0x62bc('0x12')](_0x2d6820,_0x5bb569);}function handleError(_0x1e2405){return function(_0xc95407){console[_0x62bc('0x13')](_0x62bc('0x14'),_0xc95407,_0xc95407 instanceof RangeError);logger[_0x62bc('0x15')](_0xc95407[_0x62bc('0x16')]);if(_0xc95407 instanceof RangeError){if(_0xc95407['name']){delete _0xc95407['name'];}_0x1e2405[_0x62bc('0x17')](0x194)[_0x62bc('0x18')](_0xc95407);}else{if(_0xc95407[_0x62bc('0x19')]){delete _0xc95407['name'];}_0x1e2405[_0x62bc('0x17')](0x1f4)['send'](_0xc95407);}};}function checkError(){return function(_0x30e7d9){if(!_0x30e7d9){throw new RangeError(_0x62bc('0x1a'));}return _0x30e7d9;};}function respondWithRpcPromise(_0x1b6689,_0x5e2e9b){return new BPromise(function(_0x3b8644,_0x28757d){var _0xae87bf=amiClient;return _0xae87bf[_0x62bc('0x1b')](_0x1b6689,_0x5e2e9b)[_0x62bc('0x1c')](function(_0x3b2eb0){if(_0x3b2eb0['error']){if(_0x3b2eb0[_0x62bc('0x15')][_0x62bc('0x1d')]===0x1f4){return _0x28757d(_0x3b2eb0[_0x62bc('0x15')][_0x62bc('0x1e')]);}return _0x3b8644(_0x3b2eb0[_0x62bc('0x15')]['message']);}else{_0x3b8644(_0x3b2eb0['result']);}})[_0x62bc('0x1f')](function(_0x58e76a){_0x28757d(_0x58e76a);});});}function getAgent(_0x32e749){return db[_0x62bc('0x20')][_0x62bc('0x21')]({'where':{'id':_0x32e749,'role':'agent'}})[_0x62bc('0x1c')](checkError());}function getAgentCheckSession(_0x19e689,_0x32e03c){return new BPromise(function(_0x5c03ac,_0x5b26ce){var _0x641626=respondWithRpcPromise(_0x62bc('0x22'));var _0x23817c=getAgent(_0x19e689);Promise['all']([_0x641626,_0x23817c])[_0x62bc('0x1c')](function(_0x1f2985){var _0x44600f=_0x1f2985[0x0];var _0x444267=_0x1f2985[0x1];var _0x5a9302=_[_0x62bc('0x23')](_0x44600f['rows'],function(_0x26701b){return _0x26701b[_0x62bc('0x24')]==_0x444267['id']&&_0x26701b[_0x62bc('0x25')]==_0x32e03c;});if(_0x5a9302[_0x62bc('0x26')]==0x1){_0x5c03ac(_0x444267);}else{_0x5b26ce(new RangeError(_0x62bc('0x27')+_0x32e03c+_0x62bc('0x28')));}});});}exports[_0x62bc('0x29')]=function(_0x12d443,_0x406063){logger[_0x62bc('0x10')](_0x62bc('0x2a'),_0x12d443[_0x62bc('0x2b')]);var _0x1668ab=originateValidation[_0x62bc('0x2c')](_0x12d443[_0x62bc('0x2b')]);if(_0x1668ab[_0x62bc('0x26')]>0x0){return _0x406063[_0x62bc('0x17')](0x190)['json'](_0x1668ab);}var _0x32e3a9=_0x12d443['body']['userId'];var _0x2823ef=_0x12d443['body']['callNumber'];var _0x512dac=_0x12d443[_0x62bc('0x2b')][_0x62bc('0x2d')];var _0x26e043=_0x12d443['body']['callbackUrl'];return getAgent(_0x32e3a9)['then'](function(_0x3c938d){logger[_0x62bc('0x10')]('entityFound:',_0x3c938d['name']);emit(util[_0x62bc('0x2e')](_0x62bc('0x2f'),_0x3c938d[_0x62bc('0x19')]),'webbar:originate',{'callNumber':_0x2823ef,'callerId':_0x512dac,'callbackUrl':_0x26e043});return _0x406063[_0x62bc('0x17')](0xc8)[_0x62bc('0x30')]({'error':![],'message':_0x62bc('0x31')});})[_0x62bc('0x1f')](handleError(_0x406063));};exports['hangup']=function(_0x42a777,_0x2caa71){logger['info'](_0x62bc('0x32'),_0x42a777[_0x62bc('0x2b')]);var _0x24dbbe=hangupValidation[_0x62bc('0x2c')](_0x42a777['body']);if(_0x24dbbe[_0x62bc('0x26')]>0x0){return _0x2caa71['status'](0x190)[_0x62bc('0x30')](_0x24dbbe);}var _0x19a6e2=_0x42a777[_0x62bc('0x2b')][_0x62bc('0x33')];var _0x5c0d67=_0x42a777[_0x62bc('0x2b')][_0x62bc('0x25')];return getAgent(_0x19a6e2)[_0x62bc('0x1c')](function(_0x176b1f){logger[_0x62bc('0x10')](_0x62bc('0x34'),_0x176b1f[_0x62bc('0x19')]);emit(util[_0x62bc('0x2e')](_0x62bc('0x2f'),_0x176b1f[_0x62bc('0x19')]),_0x62bc('0x35'),{'sessionId':_0x5c0d67});return _0x2caa71['status'](0xc8)['json']({'error':![],'message':_0x62bc('0x36')});})[_0x62bc('0x1f')](handleError(_0x2caa71));};exports['answer']=function(_0x1cf503,_0x366505){logger[_0x62bc('0x10')](_0x62bc('0x37'),_0x1cf503[_0x62bc('0x2b')]);var _0x5f3752=answerValidation[_0x62bc('0x2c')](_0x1cf503[_0x62bc('0x2b')]);if(_0x5f3752['length']>0x0){return _0x366505['status'](0x190)[_0x62bc('0x30')](_0x5f3752);}var _0xdbd9ee=_0x1cf503[_0x62bc('0x2b')]['userId'];var _0x185423=_0x1cf503[_0x62bc('0x2b')][_0x62bc('0x25')];return getAgent(_0xdbd9ee)[_0x62bc('0x1c')](function(_0x467d22){logger[_0x62bc('0x10')]('entityFound:',_0x467d22[_0x62bc('0x19')]);emit(util['format'](_0x62bc('0x2f'),_0x467d22[_0x62bc('0x19')]),_0x62bc('0x38'),{'sessionId':_0x185423});return _0x366505['status'](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x62bc('0x1f')](handleError(_0x366505));};exports['hold']=function(_0x10ea2e,_0x10ffa0){logger['info']('hold\x20fired:',_0x10ea2e['body']);var _0x4ce5fa=holdValidation[_0x62bc('0x2c')](_0x10ea2e[_0x62bc('0x2b')]);if(_0x4ce5fa[_0x62bc('0x26')]>0x0){return _0x10ffa0[_0x62bc('0x17')](0x190)['json'](_0x4ce5fa);}var _0x3834b2=_0x10ea2e[_0x62bc('0x2b')]['userId'];var _0x1c0026=_0x10ea2e['body'][_0x62bc('0x25')];return getAgent(_0x3834b2)[_0x62bc('0x1c')](function(_0x17e0ec){logger[_0x62bc('0x10')](_0x62bc('0x34'),_0x17e0ec[_0x62bc('0x19')]);emit(util[_0x62bc('0x2e')]('user:%s',_0x17e0ec[_0x62bc('0x19')]),_0x62bc('0x39'),{'sessionId':_0x1c0026});return _0x10ffa0['status'](0xc8)[_0x62bc('0x30')]({'error':![],'message':'hold\x20executed!'});})[_0x62bc('0x1f')](handleError(_0x10ffa0));};exports[_0x62bc('0x3a')]=function(_0x4bec08,_0x6c2969){logger[_0x62bc('0x10')](_0x62bc('0x3b'),_0x4bec08['body']);var _0xed0bef=unholdValidation[_0x62bc('0x2c')](_0x4bec08[_0x62bc('0x2b')]);if(_0xed0bef[_0x62bc('0x26')]>0x0){return _0x6c2969[_0x62bc('0x17')](0x190)[_0x62bc('0x30')](_0xed0bef);}var _0xe9ea36=_0x4bec08[_0x62bc('0x2b')][_0x62bc('0x33')];var _0x1fb6d3=_0x4bec08[_0x62bc('0x2b')][_0x62bc('0x25')];return getAgent(_0xe9ea36)[_0x62bc('0x1c')](function(_0x3bb89a){logger[_0x62bc('0x10')](_0x62bc('0x34'),_0x3bb89a['name']);emit(util[_0x62bc('0x2e')](_0x62bc('0x2f'),_0x3bb89a[_0x62bc('0x19')]),_0x62bc('0x3c'),{'sessionId':_0x1fb6d3});return _0x6c2969[_0x62bc('0x17')](0xc8)[_0x62bc('0x30')]({'error':![],'message':_0x62bc('0x3d')});})[_0x62bc('0x1f')](handleError(_0x6c2969));};exports[_0x62bc('0x3e')]=function(_0x4142dd,_0x2f2322){logger[_0x62bc('0x10')]('calls\x20fired:',_0x2f2322[_0x62bc('0x2b')]);var _0x50d761=callsValidation[_0x62bc('0x2c')](_0x4142dd[_0x62bc('0x2b')]);if(_0x50d761[_0x62bc('0x26')]>0x0){return _0x2f2322[_0x62bc('0x17')](0x190)[_0x62bc('0x30')](_0x50d761);}var _0xb6e13e=_0x4142dd[_0x62bc('0x2b')][_0x62bc('0x33')];var _0x4934ce=respondWithRpcPromise('VoiceChannels');var _0xd35ce2=getAgent(_0xb6e13e);return Promise[_0x62bc('0x3f')]([_0x4934ce,_0xd35ce2])[_0x62bc('0x1c')](function(_0x56bccf){var _0x221681=_0x56bccf[0x0];var _0x1325a4=_0x56bccf[0x1];var _0x14064d=_[_0x62bc('0x23')](_0x221681['rows'],function(_0x19e990){return _0x19e990[_0x62bc('0x24')]==_0x1325a4['id'];});return _0x2f2322[_0x62bc('0x17')](0xc8)[_0x62bc('0x30')]({'count':_0x14064d[_0x62bc('0x26')],'rows':_0x14064d});})[_0x62bc('0x1f')](handleError(_0x2f2322));};exports[_0x62bc('0x40')]=function(_0x4f196a,_0x32d424){logger[_0x62bc('0x10')](_0x62bc('0x41'),_0x4f196a['body']);var _0x4a56b7=conferenceValidation[_0x62bc('0x2c')](_0x4f196a[_0x62bc('0x2b')]);if(_0x4a56b7[_0x62bc('0x26')]>0x0){return _0x32d424['status'](0x190)[_0x62bc('0x30')](_0x4a56b7);}var _0x579c0c=_0x4f196a[_0x62bc('0x2b')][_0x62bc('0x33')];return getAgent(_0x579c0c)['then'](function(_0x3884b0){logger['info'](_0x62bc('0x34'),_0x3884b0['name']);emit(util[_0x62bc('0x2e')](_0x62bc('0x2f'),_0x3884b0[_0x62bc('0x19')]),_0x62bc('0x42'));return _0x32d424[_0x62bc('0x17')](0xc8)[_0x62bc('0x30')]({'error':![],'message':'conference\x20executed!'});})[_0x62bc('0x1f')](handleError(_0x32d424));};exports[_0x62bc('0x43')]=function(_0x2e28e4,_0x4e5478){logger[_0x62bc('0x10')](_0x62bc('0x44'),_0x2e28e4[_0x62bc('0x2b')]);var _0x132509=transferValidation['validate'](_0x2e28e4[_0x62bc('0x2b')]);if(_0x132509[_0x62bc('0x26')]>0x0){return _0x4e5478[_0x62bc('0x17')](0x190)[_0x62bc('0x30')](_0x132509);}var _0x31d5f0=_0x2e28e4['body']['userId'];var _0x280f73=_0x2e28e4['body'][_0x62bc('0x25')];var _0x18779a=_0x2e28e4['body'][_0x62bc('0x45')];return getAgent(_0x31d5f0)['then'](function(_0x2a3599){logger['info'](_0x62bc('0x34'),_0x2a3599['name']);emit(util[_0x62bc('0x2e')](_0x62bc('0x2f'),_0x2a3599[_0x62bc('0x19')]),'webbar:transfer',{'sessionId':_0x280f73,'transferNumber':_0x18779a});return _0x4e5478[_0x62bc('0x17')](0xc8)[_0x62bc('0x30')]({'error':![],'message':_0x62bc('0x46')});})[_0x62bc('0x1f')](handleError(_0x4e5478));}; \ No newline at end of file +var _0x1152=['code','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','userId','sessionId','answer\x20fired:','webbar:answer','hold\x20fired:','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','ioredis','redis','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','emit','handleError:','error','stack','name','status','send','NotFound','then'];(function(_0x363123,_0xc162aa){var _0x220234=function(_0x4f9520){while(--_0x4f9520){_0x363123['push'](_0x363123['shift']());}};_0x220234(++_0xc162aa);}(_0x1152,0x182));var _0x2115=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x1152[_0x20be28];return _0x8ab067;};'use strict';var path=require(_0x2115('0x0'));var fs=require('fs');var _=require(_0x2115('0x1'));var db=require(_0x2115('0x2'))['db'];var config=require(_0x2115('0x3'));var util=require(_0x2115('0x4'));var BPromise=require(_0x2115('0x5'));var jayson=require(_0x2115('0x6'));var amiClient=jayson[_0x2115('0x7')]['http']({'port':0x232a});var logger=require(_0x2115('0x8'))('webbarapi');var Redis=require(_0x2115('0x9'));config[_0x2115('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x2115('0xb'));var originateValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],_0x2115('0xd')]},'callNumber':{'type':'string','required':[!![],_0x2115('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],_0x2115('0xd')]},'sessionId':{'type':_0x2115('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2115('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],_0x2115('0xd')]},'sessionId':{'type':_0x2115('0xf'),'required':[!![],_0x2115('0x10')]},'transferNumber':{'type':_0x2115('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2115('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],_0x2115('0xd')]},'sessionId':{'type':_0x2115('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],_0x2115('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2115('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0xdf3e24,_0x21b589,_0xc97f87){logger[_0x2115('0x11')](_0xdf3e24,_0x21b589,JSON[_0x2115('0x12')](_0xc97f87));io['to'](_0xdf3e24)[_0x2115('0x13')](_0x21b589,_0xc97f87);}function handleError(_0x398015){return function(_0x77e2c6){console['log'](_0x2115('0x14'),_0x77e2c6,_0x77e2c6 instanceof RangeError);logger[_0x2115('0x15')](_0x77e2c6[_0x2115('0x16')]);if(_0x77e2c6 instanceof RangeError){if(_0x77e2c6['name']){delete _0x77e2c6[_0x2115('0x17')];}_0x398015[_0x2115('0x18')](0x194)[_0x2115('0x19')](_0x77e2c6);}else{if(_0x77e2c6[_0x2115('0x17')]){delete _0x77e2c6[_0x2115('0x17')];}_0x398015[_0x2115('0x18')](0x1f4)[_0x2115('0x19')](_0x77e2c6);}};}function checkError(){return function(_0x40070e){if(!_0x40070e){throw new RangeError(_0x2115('0x1a'));}return _0x40070e;};}function respondWithRpcPromise(_0x22ebb6,_0x1ddb2a){return new BPromise(function(_0x8b7304,_0x8e37c){var _0x13fde1=amiClient;return _0x13fde1['request'](_0x22ebb6,_0x1ddb2a)[_0x2115('0x1b')](function(_0x340c42){if(_0x340c42[_0x2115('0x15')]){if(_0x340c42[_0x2115('0x15')][_0x2115('0x1c')]===0x1f4){return _0x8e37c(_0x340c42[_0x2115('0x15')]['message']);}return _0x8b7304(_0x340c42['error']['message']);}else{_0x8b7304(_0x340c42[_0x2115('0x1d')]);}})[_0x2115('0x1e')](function(_0x1a2ec3){_0x8e37c(_0x1a2ec3);});});}function getAgent(_0x559ed3){return db[_0x2115('0x1f')][_0x2115('0x20')]({'where':{'id':_0x559ed3,'role':_0x2115('0x21')}})[_0x2115('0x1b')](checkError());}function getAgentCheckSession(_0x3ca0ef,_0x57acd4){return new BPromise(function(_0xc329ec,_0x2d1c09){var _0x4f3e8d=respondWithRpcPromise(_0x2115('0x22'));var _0x33d81c=getAgent(_0x3ca0ef);Promise[_0x2115('0x23')]([_0x4f3e8d,_0x33d81c])[_0x2115('0x1b')](function(_0x59ca70){var _0x19c595=_0x59ca70[0x0];var _0x15229e=_0x59ca70[0x1];var _0x12d148=_[_0x2115('0x24')](_0x19c595[_0x2115('0x25')],function(_0x27969d){return _0x27969d['UserId']==_0x15229e['id']&&_0x27969d['sessionId']==_0x57acd4;});if(_0x12d148[_0x2115('0x26')]==0x1){_0xc329ec(_0x15229e);}else{_0x2d1c09(new RangeError(_0x2115('0x27')+_0x57acd4+_0x2115('0x28')));}});});}exports[_0x2115('0x29')]=function(_0x32bc0c,_0x5bcc07){logger[_0x2115('0x11')](_0x2115('0x2a'),_0x32bc0c[_0x2115('0x2b')]);var _0x48a888=originateValidation[_0x2115('0xb')](_0x32bc0c['body']);if(_0x48a888[_0x2115('0x26')]>0x0){return _0x5bcc07['status'](0x190)[_0x2115('0x2c')](_0x48a888);}var _0x417bf4=_0x32bc0c[_0x2115('0x2b')]['userId'];var _0x56d41e=_0x32bc0c[_0x2115('0x2b')][_0x2115('0x2d')];var _0x4b36bb=_0x32bc0c[_0x2115('0x2b')][_0x2115('0x2e')];var _0x27f9e5=_0x32bc0c[_0x2115('0x2b')]['callbackUrl'];return getAgent(_0x417bf4)[_0x2115('0x1b')](function(_0x41c9dc){logger[_0x2115('0x11')](_0x2115('0x2f'),_0x41c9dc['name']);emit(util[_0x2115('0x30')](_0x2115('0x31'),_0x41c9dc[_0x2115('0x17')]),_0x2115('0x32'),{'callNumber':_0x56d41e,'callerId':_0x4b36bb,'callbackUrl':_0x27f9e5});return _0x5bcc07[_0x2115('0x18')](0xc8)[_0x2115('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0x2115('0x1e')](handleError(_0x5bcc07));};exports[_0x2115('0x33')]=function(_0xbe1268,_0xaf411a){logger[_0x2115('0x11')](_0x2115('0x34'),_0xbe1268['body']);var _0x130fee=hangupValidation['validate'](_0xbe1268['body']);if(_0x130fee[_0x2115('0x26')]>0x0){return _0xaf411a[_0x2115('0x18')](0x190)[_0x2115('0x2c')](_0x130fee);}var _0x14adc8=_0xbe1268[_0x2115('0x2b')][_0x2115('0x35')];var _0x4e9994=_0xbe1268[_0x2115('0x2b')][_0x2115('0x36')];return getAgent(_0x14adc8)[_0x2115('0x1b')](function(_0x19c159){logger[_0x2115('0x11')](_0x2115('0x2f'),_0x19c159[_0x2115('0x17')]);emit(util[_0x2115('0x30')](_0x2115('0x31'),_0x19c159[_0x2115('0x17')]),'webbar:hangup',{'sessionId':_0x4e9994});return _0xaf411a['status'](0xc8)[_0x2115('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x2115('0x1e')](handleError(_0xaf411a));};exports['answer']=function(_0x54ec64,_0x55be95){logger[_0x2115('0x11')](_0x2115('0x37'),_0x54ec64[_0x2115('0x2b')]);var _0x96847d=answerValidation[_0x2115('0xb')](_0x54ec64['body']);if(_0x96847d[_0x2115('0x26')]>0x0){return _0x55be95['status'](0x190)[_0x2115('0x2c')](_0x96847d);}var _0x459028=_0x54ec64['body'][_0x2115('0x35')];var _0x309f46=_0x54ec64['body']['sessionId'];return getAgent(_0x459028)[_0x2115('0x1b')](function(_0x13bfc3){logger['info']('entityFound:',_0x13bfc3[_0x2115('0x17')]);emit(util[_0x2115('0x30')]('user:%s',_0x13bfc3['name']),_0x2115('0x38'),{'sessionId':_0x309f46});return _0x55be95[_0x2115('0x18')](0xc8)[_0x2115('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0x2115('0x1e')](handleError(_0x55be95));};exports['hold']=function(_0xd003d0,_0xc61152){logger[_0x2115('0x11')](_0x2115('0x39'),_0xd003d0[_0x2115('0x2b')]);var _0x4cf226=holdValidation[_0x2115('0xb')](_0xd003d0['body']);if(_0x4cf226['length']>0x0){return _0xc61152[_0x2115('0x18')](0x190)[_0x2115('0x2c')](_0x4cf226);}var _0x583575=_0xd003d0[_0x2115('0x2b')][_0x2115('0x35')];var _0x2a11a6=_0xd003d0[_0x2115('0x2b')][_0x2115('0x36')];return getAgent(_0x583575)[_0x2115('0x1b')](function(_0x41d1a4){logger[_0x2115('0x11')](_0x2115('0x2f'),_0x41d1a4['name']);emit(util[_0x2115('0x30')](_0x2115('0x31'),_0x41d1a4[_0x2115('0x17')]),'webbar:hold',{'sessionId':_0x2a11a6});return _0xc61152[_0x2115('0x18')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0xc61152));};exports[_0x2115('0x3a')]=function(_0x24d601,_0x4820c7){logger['info'](_0x2115('0x3b'),_0x24d601[_0x2115('0x2b')]);var _0x401f8f=unholdValidation[_0x2115('0xb')](_0x24d601[_0x2115('0x2b')]);if(_0x401f8f[_0x2115('0x26')]>0x0){return _0x4820c7[_0x2115('0x18')](0x190)[_0x2115('0x2c')](_0x401f8f);}var _0x5876d3=_0x24d601[_0x2115('0x2b')][_0x2115('0x35')];var _0x51b575=_0x24d601[_0x2115('0x2b')][_0x2115('0x36')];return getAgent(_0x5876d3)[_0x2115('0x1b')](function(_0x33bcfc){logger[_0x2115('0x11')](_0x2115('0x2f'),_0x33bcfc['name']);emit(util[_0x2115('0x30')](_0x2115('0x31'),_0x33bcfc['name']),'webbar:unhold',{'sessionId':_0x51b575});return _0x4820c7[_0x2115('0x18')](0xc8)[_0x2115('0x2c')]({'error':![],'message':_0x2115('0x3c')});})[_0x2115('0x1e')](handleError(_0x4820c7));};exports['calls']=function(_0x221b1e,_0x107d44){logger[_0x2115('0x11')](_0x2115('0x3d'),_0x107d44[_0x2115('0x2b')]);var _0x1bd210=callsValidation['validate'](_0x221b1e[_0x2115('0x2b')]);if(_0x1bd210[_0x2115('0x26')]>0x0){return _0x107d44['status'](0x190)[_0x2115('0x2c')](_0x1bd210);}var _0x34f5f0=_0x221b1e[_0x2115('0x2b')]['userId'];var _0x44c44e=respondWithRpcPromise('VoiceChannels');var _0xf39890=getAgent(_0x34f5f0);return Promise[_0x2115('0x23')]([_0x44c44e,_0xf39890])[_0x2115('0x1b')](function(_0x616f71){var _0x178d45=_0x616f71[0x0];var _0x31a52a=_0x616f71[0x1];var _0x4c8216=_[_0x2115('0x24')](_0x178d45[_0x2115('0x25')],function(_0x586c15){return _0x586c15[_0x2115('0x3e')]==_0x31a52a['id'];});return _0x107d44[_0x2115('0x18')](0xc8)[_0x2115('0x2c')]({'count':_0x4c8216['length'],'rows':_0x4c8216});})['catch'](handleError(_0x107d44));};exports['conference']=function(_0x3d7106,_0x48194b){logger[_0x2115('0x11')](_0x2115('0x3f'),_0x3d7106[_0x2115('0x2b')]);var _0x545616=conferenceValidation[_0x2115('0xb')](_0x3d7106['body']);if(_0x545616[_0x2115('0x26')]>0x0){return _0x48194b[_0x2115('0x18')](0x190)['json'](_0x545616);}var _0x47d7d2=_0x3d7106[_0x2115('0x2b')][_0x2115('0x35')];return getAgent(_0x47d7d2)['then'](function(_0x2a11e8){logger['info'](_0x2115('0x2f'),_0x2a11e8[_0x2115('0x17')]);emit(util['format'](_0x2115('0x31'),_0x2a11e8[_0x2115('0x17')]),_0x2115('0x40'));return _0x48194b[_0x2115('0x18')](0xc8)[_0x2115('0x2c')]({'error':![],'message':_0x2115('0x41')});})[_0x2115('0x1e')](handleError(_0x48194b));};exports[_0x2115('0x42')]=function(_0x2d2105,_0x1be769){logger[_0x2115('0x11')](_0x2115('0x43'),_0x2d2105[_0x2115('0x2b')]);var _0x84d526=transferValidation[_0x2115('0xb')](_0x2d2105[_0x2115('0x2b')]);if(_0x84d526[_0x2115('0x26')]>0x0){return _0x1be769[_0x2115('0x18')](0x190)['json'](_0x84d526);}var _0x27dbae=_0x2d2105[_0x2115('0x2b')][_0x2115('0x35')];var _0x1e3cc9=_0x2d2105[_0x2115('0x2b')][_0x2115('0x36')];var _0x2b21c8=_0x2d2105['body'][_0x2115('0x44')];return getAgent(_0x27dbae)[_0x2115('0x1b')](function(_0x126c08){logger['info'](_0x2115('0x2f'),_0x126c08[_0x2115('0x17')]);emit(util[_0x2115('0x30')](_0x2115('0x31'),_0x126c08[_0x2115('0x17')]),'webbar:transfer',{'sessionId':_0x1e3cc9,'transferNumber':_0x2b21c8});return _0x1be769[_0x2115('0x18')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0x2115('0x1e')](handleError(_0x1be769));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 01de6ca..f7a95f9 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['notify','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addAgents'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xadb5,0xad));var _0x5adb=function(_0x35ce3e,_0xa22c24){_0x35ce3e=_0x35ce3e-0x0;var _0x2aa293=_0xadb5[_0x35ce3e];return _0x2aa293;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./whatsappAccount.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getDispositions']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['get'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);router['post']('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x15')]);router[_0x5adb('0x16')]('/:id/dispositions',auth[_0x5adb('0x8')](),controller['addDisposition']);router[_0x5adb('0x16')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x16')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x18')]);router[_0x5adb('0x16')]('/:id/applications',auth[_0x5adb('0x8')](),controller['addApplications']);router[_0x5adb('0x16')]('/:id/notify',controller[_0x5adb('0x19')]);router['post']('/:id/send',auth[_0x5adb('0x8')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x1b')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller['update']);router[_0x5adb('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x1d')]);router[_0x5adb('0x1c')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x1e')]);router[_0x5adb('0x1c')](_0x5adb('0xf'),auth['isAuthenticated'](),controller[_0x5adb('0x1f')]);router[_0x5adb('0x1c')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x20')]);module['exports']=router; \ No newline at end of file +var _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x150492,_0x577d10){_0x150492=_0x150492-0x0;var _0x213187=_0x9582[_0x150492];return _0x213187;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 8f1415e..80870f3 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96d3=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','name','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x154072,_0x2f9c62){var _0x54d42b=function(_0x5f059b){while(--_0x5f059b){_0x154072['push'](_0x154072['shift']());}};_0x54d42b(++_0x2f9c62);}(_0x96d3,0x15f));var _0x396d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x96d3[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x396d('0x0'));var rs=require('randomstring');module[_0x396d('0x1')]={'name':{'type':Sequelize[_0x396d('0x2')],'unique':_0x396d('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x396d('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x396d('0x2')]},'type':{'type':Sequelize[_0x396d('0x4')](_0x396d('0x5'),_0x396d('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x396d('0x2')]},'authToken':{'type':Sequelize[_0x396d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x396d('0x7')],'defaultValue':function(){return _0x396d('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x396d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x396d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x396d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x396d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x396d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x396d('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x396d('0x9')],'defaultValue':![],'comment':_0x396d('0xc'),'set':function(_0x62512c){if(!_0x62512c){this['setDataValue'](_0x396d('0xd'),null);}this[_0x396d('0xe')]('mandatoryDisposition',_0x62512c);}},'description':{'type':Sequelize[_0x396d('0x2')]}}; \ No newline at end of file +var _0x8599=['sinch','TEXT','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8599,0xea));var _0x9859=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8599[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9859('0x0'));module[_0x9859('0x1')]={'name':{'type':Sequelize[_0x9859('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9859('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9859('0x4')](_0x9859('0x5'),_0x9859('0x6'))},'accountSid':{'type':Sequelize[_0x9859('0x2')]},'baseUrl':{'type':Sequelize[_0x9859('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9859('0x7')],'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['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9859('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9859('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9859('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9859('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9859('0x8')],'comment':_0x9859('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9859('0xb'),'set':function(_0x5731da){if(!_0x5731da){this[_0x9859('0xc')](_0x9859('0xd'),null);}this['setDataValue'](_0x9859('0xe'),_0x5731da);}},'description':{'type':Sequelize[_0x9859('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 348ab47..79c9d51 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2c3=['UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','find','create','body','user','WhatsappAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','replace','Body','messageId','notifications','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','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','WhatsappMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','get'];(function(_0x5b2c50,_0x4db66b){var _0x47f2f9=function(_0xef76e4){while(--_0xef76e4){_0x5b2c50['push'](_0x5b2c50['shift']());}};_0x47f2f9(++_0x4db66b);}(_0xf2c3,0x8a));var _0x3f2c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf2c3[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x3f2c('0x0'));var rimraf=require(_0x3f2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f2c('0x2'));var rp=require(_0x3f2c('0x3'));var moment=require(_0x3f2c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f2c('0x5'));var util=require(_0x3f2c('0x6'));var path=require(_0x3f2c('0x7'));var sox=require('sox');var csv=require(_0x3f2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f2c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f2c('0xa'));var jsforce=require(_0x3f2c('0xb'));var deskjs=require(_0x3f2c('0xc'));var toCsv=require(_0x3f2c('0x8'));var querystring=require(_0x3f2c('0xd'));var Papa=require(_0x3f2c('0xe'));var Redis=require(_0x3f2c('0xf'));var authService=require(_0x3f2c('0x10'));var qs=require(_0x3f2c('0x11'));var as=require(_0x3f2c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f2c('0x13'))('api');var utils=require(_0x3f2c('0x14'));var config=require(_0x3f2c('0x15'));var licenseUtil=require(_0x3f2c('0x16'));var db=require(_0x3f2c('0x17'))['db'];config[_0x3f2c('0x18')]=_[_0x3f2c('0x19')](config[_0x3f2c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f2c('0x1a'))(new Redis(config[_0x3f2c('0x18')]));require(_0x3f2c('0x1b'))[_0x3f2c('0x1c')](socket);var jayson=require(_0x3f2c('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x131c96,_0x8efd4a,_0x50db9b,_0x40743b){return new BPromise(function(_0x5d2d4b,_0x52d535){var _0x229583=_0x40743b||client;return _0x229583[_0x3f2c('0x1e')](_0x131c96,_0x50db9b)[_0x3f2c('0x1f')](function(_0x5b26a2){logger[_0x3f2c('0x20')](_0x3f2c('0x21'),_0x8efd4a,'request\x20sent');logger[_0x3f2c('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x8efd4a,_0x3f2c('0x23'),JSON['stringify'](_0x5b26a2));if(_0x5b26a2[_0x3f2c('0x24')]){if(_0x5b26a2[_0x3f2c('0x24')][_0x3f2c('0x25')]===0x1f4){logger[_0x3f2c('0x24')](_0x3f2c('0x21'),_0x8efd4a,_0x5b26a2[_0x3f2c('0x24')]['message']);return _0x52d535(_0x5b26a2['error'][_0x3f2c('0x26')]);}logger[_0x3f2c('0x24')](_0x3f2c('0x21'),_0x8efd4a,_0x5b26a2['error'][_0x3f2c('0x26')]);return _0x5d2d4b(_0x5b26a2[_0x3f2c('0x24')]['message']);}else{logger[_0x3f2c('0x20')](_0x3f2c('0x21'),_0x8efd4a,_0x3f2c('0x23'));_0x5d2d4b(_0x5b26a2[_0x3f2c('0x27')][_0x3f2c('0x26')]);}})[_0x3f2c('0x28')](function(_0x252d58){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x8efd4a,_0x252d58);_0x52d535(_0x252d58);});});}function respondWithStatusCode(_0x4f3278,_0x4da408){_0x4da408=_0x4da408||0xcc;return function(_0x164bfa){if(_0x164bfa){return _0x4f3278[_0x3f2c('0x29')](_0x4da408);}return _0x4f3278[_0x3f2c('0x2a')](_0x4da408)[_0x3f2c('0x2b')]();};}function respondWithResult(_0x58d1c8,_0x4ff64f){_0x4ff64f=_0x4ff64f||0xc8;return function(_0x81840f){if(_0x81840f){return _0x58d1c8[_0x3f2c('0x2a')](_0x4ff64f)[_0x3f2c('0x2c')](_0x81840f);}};}function respondWithFilteredResult(_0xd4275c,_0x1ec9ac){return function(_0x24956c){if(_0x24956c){var _0x5d87d8=typeof _0x1ec9ac[_0x3f2c('0x2d')]===_0x3f2c('0x2e')&&typeof _0x1ec9ac[_0x3f2c('0x2f')]===_0x3f2c('0x2e');var _0x4a0e68=_0x24956c['count'];var _0x5d93b4=_0x5d87d8?0x0:_0x1ec9ac[_0x3f2c('0x2d')];var _0x85d291=_0x5d87d8?_0x24956c[_0x3f2c('0x30')]:_0x1ec9ac[_0x3f2c('0x2d')]+_0x1ec9ac[_0x3f2c('0x2f')];var _0x47fdb6;if(_0x85d291>=_0x4a0e68){_0x85d291=_0x4a0e68;_0x47fdb6=0xc8;}else{_0x47fdb6=0xce;}_0xd4275c[_0x3f2c('0x2a')](_0x47fdb6);return _0xd4275c[_0x3f2c('0x31')]('Content-Range',_0x5d93b4+'-'+_0x85d291+'/'+_0x4a0e68)[_0x3f2c('0x2c')](_0x24956c);}return null;};}function patchUpdates(_0x2e22d2){return function(_0x469791){try{jsonpatch['apply'](_0x469791,_0x2e22d2,!![]);}catch(_0x809c73){return BPromise['reject'](_0x809c73);}return _0x469791[_0x3f2c('0x32')]();};}function saveUpdates(_0xa329d,_0x31161c){return function(_0x333066){if(_0x333066){return _0x333066['update'](_0xa329d)['then'](function(_0x302579){return _0x302579;});}return null;};}function removeEntity(_0x35f330,_0xa6f201){return function(_0x2034a1){if(_0x2034a1){return _0x2034a1[_0x3f2c('0x33')]()[_0x3f2c('0x1f')](function(){var _0x26ae18=_0x2034a1[_0x3f2c('0x34')]({'plain':!![]});var _0x2be528='WhatsappAccounts';return db[_0x3f2c('0x35')]['destroy']({'where':{'type':_0x2be528,'resourceId':_0x26ae18['id']}})[_0x3f2c('0x1f')](function(){return _0x2034a1;});})[_0x3f2c('0x1f')](function(){_0x35f330[_0x3f2c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e36c2,_0x2b5d49){return function(_0x2d95c1){if(!_0x2d95c1){_0x1e36c2[_0x3f2c('0x29')](0x194);}return _0x2d95c1;};}function handleError(_0x5ee986,_0x555311){_0x555311=_0x555311||0x1f4;return function(_0x5d73dc){logger['error'](_0x5d73dc[_0x3f2c('0x36')]);if(_0x5d73dc[_0x3f2c('0x37')]){delete _0x5d73dc[_0x3f2c('0x37')];}_0x5ee986['status'](_0x555311)[_0x3f2c('0x38')](_0x5d73dc);};}exports[_0x3f2c('0x39')]=function(_0x372886,_0x1b43e3){var _0x4a424f={'include':[{'model':db[_0x3f2c('0x3a')],'as':_0x3f2c('0x3b')}]},_0xac8d1c={},_0x291939={'count':0x0,'rows':[]};var _0x59384b=_[_0x3f2c('0x3c')](db[_0x3f2c('0x3d')][_0x3f2c('0x3e')],function(_0x2f7e32){return{'name':_0x2f7e32['fieldName'],'type':_0x2f7e32['type']['key']};});_0xac8d1c[_0x3f2c('0x3f')]=_[_0x3f2c('0x3c')](_0x59384b,'name');_0xac8d1c[_0x3f2c('0x40')]=_[_0x3f2c('0x41')](_0x372886[_0x3f2c('0x40')]);_0xac8d1c[_0x3f2c('0x42')]=_[_0x3f2c('0x43')](_0xac8d1c[_0x3f2c('0x3f')],_0xac8d1c[_0x3f2c('0x40')]);_0x4a424f[_0x3f2c('0x44')]=_['intersection'](_0xac8d1c[_0x3f2c('0x3f')],qs[_0x3f2c('0x45')](_0x372886[_0x3f2c('0x40')]['fields']));_0x4a424f[_0x3f2c('0x44')]=_0x4a424f['attributes'][_0x3f2c('0x46')]?_0x4a424f[_0x3f2c('0x44')]:_0xac8d1c[_0x3f2c('0x3f')];if(!_0x372886[_0x3f2c('0x40')][_0x3f2c('0x47')](_0x3f2c('0x48'))){_0x4a424f[_0x3f2c('0x2f')]=qs['limit'](_0x372886[_0x3f2c('0x40')]['limit']);_0x4a424f[_0x3f2c('0x2d')]=qs[_0x3f2c('0x2d')](_0x372886['query'][_0x3f2c('0x2d')]);}_0x4a424f['order']=qs['sort'](_0x372886[_0x3f2c('0x40')][_0x3f2c('0x49')]);_0x4a424f[_0x3f2c('0x4a')]=qs[_0x3f2c('0x42')](_[_0x3f2c('0x4b')](_0x372886[_0x3f2c('0x40')],_0xac8d1c[_0x3f2c('0x42')]),_0x59384b);if(_0x372886[_0x3f2c('0x40')][_0x3f2c('0x4c')]){_0x4a424f[_0x3f2c('0x4a')]=_[_0x3f2c('0x4d')](_0x4a424f[_0x3f2c('0x4a')],{'$or':_['map'](_0x59384b,function(_0x595bf5){if(_0x595bf5[_0x3f2c('0x4e')]!==_0x3f2c('0x4f')){var _0xc1df62={};_0xc1df62[_0x595bf5[_0x3f2c('0x37')]]={'$like':'%'+_0x372886[_0x3f2c('0x40')][_0x3f2c('0x4c')]+'%'};return _0xc1df62;}})});}_0x4a424f=_[_0x3f2c('0x4d')]({},_0x4a424f,_0x372886[_0x3f2c('0x50')]);var _0x55eef0={'where':_0x4a424f[_0x3f2c('0x4a')]};return db[_0x3f2c('0x3d')][_0x3f2c('0x30')](_0x55eef0)[_0x3f2c('0x1f')](function(_0x5661ef){_0x291939[_0x3f2c('0x30')]=_0x5661ef;if(_0x372886[_0x3f2c('0x40')][_0x3f2c('0x51')]){_0x4a424f[_0x3f2c('0x52')]=[{'all':!![]}];}return db[_0x3f2c('0x3d')]['findAll'](_0x4a424f);})[_0x3f2c('0x1f')](function(_0x316952){_0x291939[_0x3f2c('0x53')]=_0x316952;return _0x291939;})[_0x3f2c('0x1f')](respondWithFilteredResult(_0x1b43e3,_0x4a424f))[_0x3f2c('0x28')](handleError(_0x1b43e3,null));};exports[_0x3f2c('0x54')]=function(_0x18f465,_0x156cd3){var _0x594040={'raw':![],'where':{'id':_0x18f465['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4bf16c={};_0x4bf16c[_0x3f2c('0x3f')]=_[_0x3f2c('0x41')](db[_0x3f2c('0x3d')]['rawAttributes']);_0x4bf16c[_0x3f2c('0x40')]=_['keys'](_0x18f465[_0x3f2c('0x40')]);_0x4bf16c[_0x3f2c('0x42')]=_['intersection'](_0x4bf16c[_0x3f2c('0x3f')],_0x4bf16c[_0x3f2c('0x40')]);_0x594040[_0x3f2c('0x44')]=_[_0x3f2c('0x43')](_0x4bf16c['model'],qs[_0x3f2c('0x45')](_0x18f465[_0x3f2c('0x40')]['fields']));_0x594040[_0x3f2c('0x44')]=_0x594040['attributes']['length']?_0x594040['attributes']:_0x4bf16c[_0x3f2c('0x3f')];if(_0x18f465[_0x3f2c('0x40')][_0x3f2c('0x51')]){_0x594040[_0x3f2c('0x52')]=[{'all':!![]}];}_0x594040=_['merge']({},_0x594040,_0x18f465['options']);return db[_0x3f2c('0x3d')][_0x3f2c('0x55')](_0x594040)[_0x3f2c('0x1f')](handleEntityNotFound(_0x156cd3,null))[_0x3f2c('0x1f')](respondWithResult(_0x156cd3,null))[_0x3f2c('0x28')](handleError(_0x156cd3,null));};exports['create']=function(_0x3e72f8,_0x3673ed){return db['WhatsappAccount'][_0x3f2c('0x56')](_0x3e72f8[_0x3f2c('0x57')],{})['then'](function(_0x51d11f){var _0x150d71=_0x3e72f8['user'][_0x3f2c('0x34')]({'plain':!![]});if(!_0x150d71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x150d71['role']===_0x3f2c('0x58')){var _0x16b7b7=_0x51d11f[_0x3f2c('0x34')]({'plain':!![]});var _0x22d1ef=_0x3f2c('0x59');return db[_0x3f2c('0x5a')]['find']({'where':{'name':_0x22d1ef,'userProfileId':_0x150d71['userProfileId']},'raw':!![]})[_0x3f2c('0x1f')](function(_0x54f934){if(_0x54f934&&_0x54f934[_0x3f2c('0x5b')]===0x0){return db[_0x3f2c('0x35')][_0x3f2c('0x56')]({'name':_0x16b7b7[_0x3f2c('0x37')],'resourceId':_0x16b7b7['id'],'type':_0x54f934[_0x3f2c('0x37')],'sectionId':_0x54f934['id']},{})[_0x3f2c('0x1f')](function(){return _0x51d11f;});}else{return _0x51d11f;}})['catch'](function(_0x3559da){logger[_0x3f2c('0x24')](_0x3f2c('0x5c'),_0x3559da);throw _0x3559da;});}return _0x51d11f;})[_0x3f2c('0x1f')](respondWithResult(_0x3673ed,0xc9))[_0x3f2c('0x28')](handleError(_0x3673ed,null));};exports[_0x3f2c('0x5d')]=function(_0x33b2b1,_0x116dbe){if(_0x33b2b1[_0x3f2c('0x57')]['id']){delete _0x33b2b1['body']['id'];}return db[_0x3f2c('0x3d')]['find']({'where':{'id':_0x33b2b1[_0x3f2c('0x5e')]['id']},'include':[{'model':db[_0x3f2c('0x3a')],'as':_0x3f2c('0x3b')}]})[_0x3f2c('0x1f')](handleEntityNotFound(_0x116dbe,null))[_0x3f2c('0x1f')](saveUpdates(_0x33b2b1[_0x3f2c('0x57')],null))[_0x3f2c('0x1f')](respondWithResult(_0x116dbe,null))[_0x3f2c('0x28')](handleError(_0x116dbe,null));};exports[_0x3f2c('0x33')]=function(_0x19ece7,_0xc5b749){return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x19ece7['params']['id']}})['then'](handleEntityNotFound(_0xc5b749,null))[_0x3f2c('0x1f')](removeEntity(_0xc5b749,null))['catch'](handleError(_0xc5b749,null));};exports[_0x3f2c('0x5f')]=function(_0x1943e7,_0x12268b){return db[_0x3f2c('0x3d')][_0x3f2c('0x5f')]()['then'](respondWithResult(_0x12268b,null))['catch'](handleError(_0x12268b,null));};exports[_0x3f2c('0x60')]=function(_0x45c385,_0x4bdcd8,_0x84c769){if(_0x45c385[_0x3f2c('0x57')]['id']){delete _0x45c385[_0x3f2c('0x57')]['id'];}return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x45c385[_0x3f2c('0x5e')]['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x4bdcd8,null))[_0x3f2c('0x1f')](function(_0x59b3fd){if(_0x59b3fd){_0x45c385[_0x3f2c('0x57')][_0x3f2c('0x61')]=_0x59b3fd['id'];return db[_0x3f2c('0x62')][_0x3f2c('0x56')](_0x45c385['body']);}})[_0x3f2c('0x1f')](respondWithResult(_0x4bdcd8,null))[_0x3f2c('0x28')](handleError(_0x4bdcd8,null));};exports[_0x3f2c('0x63')]=function(_0x3797fd,_0x5cdaea,_0x41c9ee){var _0x101738={'raw':![],'where':{}};var _0x5be7f5={};var _0x289525={'count':0x0,'rows':[]};return db[_0x3f2c('0x3d')]['findOne']({'where':{'id':_0x3797fd[_0x3f2c('0x5e')]['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x5cdaea,null))[_0x3f2c('0x1f')](function(_0x138e27){if(_0x138e27){_0x5be7f5[_0x3f2c('0x3f')]=_[_0x3f2c('0x41')](db[_0x3f2c('0x62')][_0x3f2c('0x3e')]);_0x5be7f5[_0x3f2c('0x40')]=_[_0x3f2c('0x41')](_0x3797fd[_0x3f2c('0x40')]);_0x5be7f5[_0x3f2c('0x42')]=_[_0x3f2c('0x43')](_0x5be7f5['model'],_0x5be7f5['query']);_0x101738[_0x3f2c('0x44')]=_[_0x3f2c('0x43')](_0x5be7f5[_0x3f2c('0x3f')],qs[_0x3f2c('0x45')](_0x3797fd[_0x3f2c('0x40')]['fields']));_0x101738[_0x3f2c('0x44')]=_0x101738[_0x3f2c('0x44')][_0x3f2c('0x46')]?_0x101738['attributes']:_0x5be7f5[_0x3f2c('0x3f')];if(!_0x3797fd['query'][_0x3f2c('0x47')](_0x3f2c('0x48'))){_0x101738['limit']=qs['limit'](_0x3797fd[_0x3f2c('0x40')][_0x3f2c('0x2f')]);_0x101738[_0x3f2c('0x2d')]=qs['offset'](_0x3797fd[_0x3f2c('0x40')][_0x3f2c('0x2d')]);}_0x101738[_0x3f2c('0x64')]=qs[_0x3f2c('0x49')](_0x3797fd[_0x3f2c('0x40')][_0x3f2c('0x49')]);_0x101738[_0x3f2c('0x4a')]=qs['filters'](_[_0x3f2c('0x4b')](_0x3797fd[_0x3f2c('0x40')],_0x5be7f5['filters']));_0x101738['where'][_0x3f2c('0x61')]=_0x138e27['id'];if(_0x3797fd[_0x3f2c('0x40')]['filter']){_0x101738[_0x3f2c('0x4a')]=_[_0x3f2c('0x4d')](_0x101738['where'],{'$or':_[_0x3f2c('0x3c')](_0x101738[_0x3f2c('0x44')],function(_0x23fb71){var _0x22590a={};_0x22590a[_0x23fb71]={'$like':'%'+_0x3797fd[_0x3f2c('0x40')][_0x3f2c('0x4c')]+'%'};return _0x22590a;})});}_0x101738=_[_0x3f2c('0x4d')]({},_0x101738,_0x3797fd[_0x3f2c('0x50')]);return db[_0x3f2c('0x62')][_0x3f2c('0x30')]({'where':_0x101738[_0x3f2c('0x4a')]})[_0x3f2c('0x1f')](function(_0x293f8b){_0x289525[_0x3f2c('0x30')]=_0x293f8b;if(_0x3797fd[_0x3f2c('0x40')][_0x3f2c('0x51')]){_0x101738[_0x3f2c('0x52')]=[{'all':!![]}];}return db[_0x3f2c('0x62')][_0x3f2c('0x65')](_0x101738);})[_0x3f2c('0x1f')](function(_0xb75456){_0x289525[_0x3f2c('0x53')]=_0xb75456;return _0x289525;});}})[_0x3f2c('0x1f')](respondWithFilteredResult(_0x5cdaea,_0x101738))[_0x3f2c('0x28')](handleError(_0x5cdaea,null));};exports['removeDispositions']=function(_0x394b75,_0x2ccd7f,_0xdcbaf9){return db[_0x3f2c('0x3d')]['find']({'where':{'id':_0x394b75['params']['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x2ccd7f,null))[_0x3f2c('0x1f')](function(_0x2d80e8){if(_0x2d80e8){return _0x2d80e8[_0x3f2c('0x66')](_0x394b75[_0x3f2c('0x40')][_0x3f2c('0x67')]);}})[_0x3f2c('0x1f')](respondWithStatusCode(_0x2ccd7f,null))[_0x3f2c('0x28')](handleError(_0x2ccd7f,null));};exports[_0x3f2c('0x68')]=function(_0x541f8b,_0x514e94,_0x31b23f){if(_0x541f8b[_0x3f2c('0x57')]['id']){delete _0x541f8b[_0x3f2c('0x57')]['id'];}return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x541f8b['params']['id']}})['then'](handleEntityNotFound(_0x514e94,null))[_0x3f2c('0x1f')](function(_0x2b4243){if(_0x2b4243){_0x541f8b['body'][_0x3f2c('0x61')]=_0x2b4243['id'];return db[_0x3f2c('0x69')][_0x3f2c('0x56')](_0x541f8b[_0x3f2c('0x57')]);}})['then'](respondWithResult(_0x514e94,null))[_0x3f2c('0x28')](handleError(_0x514e94,null));};exports[_0x3f2c('0x6a')]=function(_0x3f7297,_0x328a47,_0xc6e23c){var _0x5d9a0c={'raw':![],'where':{}};var _0x575b0e={};var _0xcfc8b7={'count':0x0,'rows':[]};return db[_0x3f2c('0x3d')][_0x3f2c('0x6b')]({'where':{'id':_0x3f7297[_0x3f2c('0x5e')]['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x328a47,null))['then'](function(_0x34c234){if(_0x34c234){_0x575b0e[_0x3f2c('0x3f')]=_[_0x3f2c('0x41')](db[_0x3f2c('0x69')][_0x3f2c('0x3e')]);_0x575b0e[_0x3f2c('0x40')]=_[_0x3f2c('0x41')](_0x3f7297[_0x3f2c('0x40')]);_0x575b0e[_0x3f2c('0x42')]=_['intersection'](_0x575b0e['model'],_0x575b0e[_0x3f2c('0x40')]);_0x5d9a0c[_0x3f2c('0x44')]=_[_0x3f2c('0x43')](_0x575b0e[_0x3f2c('0x3f')],qs[_0x3f2c('0x45')](_0x3f7297[_0x3f2c('0x40')][_0x3f2c('0x45')]));_0x5d9a0c[_0x3f2c('0x44')]=_0x5d9a0c['attributes'][_0x3f2c('0x46')]?_0x5d9a0c[_0x3f2c('0x44')]:_0x575b0e[_0x3f2c('0x3f')];if(!_0x3f7297[_0x3f2c('0x40')][_0x3f2c('0x47')](_0x3f2c('0x48'))){_0x5d9a0c[_0x3f2c('0x2f')]=qs[_0x3f2c('0x2f')](_0x3f7297['query']['limit']);_0x5d9a0c[_0x3f2c('0x2d')]=qs['offset'](_0x3f7297['query']['offset']);}_0x5d9a0c['order']=qs[_0x3f2c('0x49')](_0x3f7297['query'][_0x3f2c('0x49')]);_0x5d9a0c[_0x3f2c('0x4a')]=qs[_0x3f2c('0x42')](_[_0x3f2c('0x4b')](_0x3f7297['query'],_0x575b0e[_0x3f2c('0x42')]));_0x5d9a0c[_0x3f2c('0x4a')][_0x3f2c('0x61')]=_0x34c234['id'];if(_0x3f7297[_0x3f2c('0x40')][_0x3f2c('0x4c')]){_0x5d9a0c[_0x3f2c('0x4a')]=_[_0x3f2c('0x4d')](_0x5d9a0c[_0x3f2c('0x4a')],{'$or':_[_0x3f2c('0x3c')](_0x5d9a0c['attributes'],function(_0x1c497d){var _0x19f6dc={};_0x19f6dc[_0x1c497d]={'$like':'%'+_0x3f7297[_0x3f2c('0x40')][_0x3f2c('0x4c')]+'%'};return _0x19f6dc;})});}_0x5d9a0c=_[_0x3f2c('0x4d')]({},_0x5d9a0c,_0x3f7297[_0x3f2c('0x50')]);return db['CannedAnswer'][_0x3f2c('0x30')]({'where':_0x5d9a0c[_0x3f2c('0x4a')]})[_0x3f2c('0x1f')](function(_0x41b9b4){_0xcfc8b7[_0x3f2c('0x30')]=_0x41b9b4;if(_0x3f7297['query']['includeAll']){_0x5d9a0c['include']=[{'all':!![]}];}return db[_0x3f2c('0x69')][_0x3f2c('0x65')](_0x5d9a0c);})[_0x3f2c('0x1f')](function(_0x16072f){_0xcfc8b7[_0x3f2c('0x53')]=_0x16072f;return _0xcfc8b7;});}})[_0x3f2c('0x1f')](respondWithFilteredResult(_0x328a47,_0x5d9a0c))[_0x3f2c('0x28')](handleError(_0x328a47,null));};exports[_0x3f2c('0x6c')]=function(_0x201a76,_0xcb4dc1,_0x25d428){return db['WhatsappAccount']['find']({'where':{'id':_0x201a76['params']['id']}})['then'](handleEntityNotFound(_0xcb4dc1,null))[_0x3f2c('0x1f')](function(_0x31664d){if(_0x31664d){return _0x31664d[_0x3f2c('0x6c')](_0x201a76[_0x3f2c('0x40')][_0x3f2c('0x67')]);}})[_0x3f2c('0x1f')](respondWithStatusCode(_0xcb4dc1,null))[_0x3f2c('0x28')](handleError(_0xcb4dc1,null));};exports[_0x3f2c('0x6d')]=function(_0x24bd4b,_0x38638a,_0x1720fa){return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x24bd4b[_0x3f2c('0x5e')]['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x38638a,null))[_0x3f2c('0x1f')](function(_0x41943f){if(_0x41943f){return _0x41943f[_0x3f2c('0x6d')](_0x24bd4b[_0x3f2c('0x57')][_0x3f2c('0x67')],_[_0x3f2c('0x6e')](_0x24bd4b['body'],['ids','id'])||{})[_0x3f2c('0x6f')](function(_0x4da592){for(var _0x4cb041=0x0;_0x4cb041<_0x24bd4b[_0x3f2c('0x57')][_0x3f2c('0x67')][_0x3f2c('0x46')];_0x4cb041+=0x1){socket[_0x3f2c('0x70')](_0x3f2c('0x71'),{'UserId':Number(_0x24bd4b[_0x3f2c('0x57')][_0x3f2c('0x67')][_0x4cb041]),'WhatsappAccountId':Number(_0x24bd4b[_0x3f2c('0x5e')]['id'])});}return _0x4da592;});}})[_0x3f2c('0x1f')](respondWithResult(_0x38638a,null))[_0x3f2c('0x28')](handleError(_0x38638a,null));};exports[_0x3f2c('0x72')]=function(_0x4079a2,_0x498a6d,_0x32fb65){return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x4079a2[_0x3f2c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x498a6d,null))['then'](function(_0x431131){if(_0x431131){return _0x431131['removeAgents'](_0x4079a2[_0x3f2c('0x40')][_0x3f2c('0x67')])[_0x3f2c('0x1f')](function(){if(_['isArray'](_0x4079a2['query'][_0x3f2c('0x67')])){for(var _0x1652af=0x0;_0x1652af<_0x4079a2[_0x3f2c('0x40')][_0x3f2c('0x67')]['length'];_0x1652af+=0x1){socket[_0x3f2c('0x70')](_0x3f2c('0x73'),{'UserId':Number(_0x4079a2['query']['ids'][_0x1652af]),'WhatsappAccountId':Number(_0x4079a2['params']['id'])});}}else{socket[_0x3f2c('0x70')](_0x3f2c('0x73'),{'UserId':Number(_0x4079a2[_0x3f2c('0x40')][_0x3f2c('0x67')]),'WhatsappAccountId':Number(_0x4079a2[_0x3f2c('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x498a6d,null))[_0x3f2c('0x28')](handleError(_0x498a6d,null));};exports[_0x3f2c('0x74')]=function(_0x5a673b,_0x5b3665,_0x54d63a){var _0x35ea9c={};var _0x12c715={};var _0x193abe;var _0x3b4930;return db[_0x3f2c('0x3d')][_0x3f2c('0x6b')]({'where':{'id':_0x5a673b['params']['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x5b3665,null))[_0x3f2c('0x1f')](function(_0x1ccd3a){if(_0x1ccd3a){_0x193abe=_0x1ccd3a;_0x12c715['model']=_[_0x3f2c('0x41')](db[_0x3f2c('0x75')][_0x3f2c('0x3e')]);_0x12c715['query']=_[_0x3f2c('0x41')](_0x5a673b[_0x3f2c('0x40')]);_0x12c715[_0x3f2c('0x42')]=_[_0x3f2c('0x43')](_0x12c715['model'],_0x12c715['query']);_0x35ea9c[_0x3f2c('0x44')]=_['intersection'](_0x12c715[_0x3f2c('0x3f')],qs['fields'](_0x5a673b[_0x3f2c('0x40')][_0x3f2c('0x45')]));_0x35ea9c['attributes']=_0x35ea9c[_0x3f2c('0x44')]['length']?_0x35ea9c[_0x3f2c('0x44')]:_0x12c715[_0x3f2c('0x3f')];_0x35ea9c[_0x3f2c('0x64')]=qs[_0x3f2c('0x49')](_0x5a673b['query'][_0x3f2c('0x49')]);_0x35ea9c[_0x3f2c('0x4a')]=qs[_0x3f2c('0x42')](_[_0x3f2c('0x4b')](_0x5a673b[_0x3f2c('0x40')],_0x12c715['filters']));if(_0x5a673b[_0x3f2c('0x40')][_0x3f2c('0x4c')]){_0x35ea9c[_0x3f2c('0x4a')]=_[_0x3f2c('0x4d')](_0x35ea9c[_0x3f2c('0x4a')],{'$or':_[_0x3f2c('0x3c')](_0x35ea9c['attributes'],function(_0x7e6312){var _0xed497={};_0xed497[_0x7e6312]={'$like':'%'+_0x5a673b['query'][_0x3f2c('0x4c')]+'%'};return _0xed497;})});}_0x35ea9c=_['merge']({},_0x35ea9c,_0x5a673b[_0x3f2c('0x50')]);return _0x193abe[_0x3f2c('0x74')](_0x35ea9c);}})[_0x3f2c('0x1f')](function(_0x10fbf4){if(_0x10fbf4){_0x3b4930=_0x10fbf4[_0x3f2c('0x46')];if(!_0x5a673b[_0x3f2c('0x40')][_0x3f2c('0x47')]('nolimit')){_0x35ea9c[_0x3f2c('0x2f')]=qs[_0x3f2c('0x2f')](_0x5a673b[_0x3f2c('0x40')][_0x3f2c('0x2f')]);_0x35ea9c[_0x3f2c('0x2d')]=qs[_0x3f2c('0x2d')](_0x5a673b[_0x3f2c('0x40')][_0x3f2c('0x2d')]);}return _0x193abe[_0x3f2c('0x74')](_0x35ea9c);}})['then'](function(_0x2e49b7){if(_0x2e49b7){return _0x2e49b7?{'count':_0x3b4930,'rows':_0x2e49b7}:null;}})[_0x3f2c('0x1f')](respondWithResult(_0x5b3665,null))[_0x3f2c('0x28')](handleError(_0x5b3665,null));};exports[_0x3f2c('0x76')]=function(_0x5eff10,_0x1b3e81){var _0x66d059=_0x5eff10[_0x3f2c('0x5e')]['id'];var _0x327c17=_0x5eff10['body'];var _0x3749f1=0xc8;var _0x20241a=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x3f2c('0x77')][_0x3f2c('0x78')][_0x3f2c('0x79')]},function(_0x7613ed){return db[_0x3f2c('0x3d')]['findOne']({'where':{'id':_0x66d059},'transaction':_0x7613ed})[_0x3f2c('0x1f')](function(_0x870001){if(_0x870001){return db[_0x3f2c('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0x66d059},'transaction':_0x7613ed})[_0x3f2c('0x1f')](function(){var _0x4f6a85=_[_0x3f2c('0x3c')](_0x327c17,function(_0x2f9b74){_0x2f9b74['WhatsappAccountId']=_0x66d059;return _0x2f9b74;});return db['WhatsappApplication']['bulkCreate'](_0x4f6a85,{'transaction':_0x7613ed});});}else{_0x3749f1=0x194;_0x20241a=[];}});})[_0x3f2c('0x1f')](function(){if(_0x3749f1!==0x194){return db[_0x3f2c('0x7a')][_0x3f2c('0x7b')]({'where':{'WhatsappAccountId':_0x66d059},'order':_0x3f2c('0x7c')})[_0x3f2c('0x1f')](function(_0x1734b6){_0x20241a=_0x1734b6;});}})[_0x3f2c('0x28')](function(_0x414415){_0x3749f1=0x1f4;logger[_0x3f2c('0x24')](_0x414415['stack']);if(_0x414415[_0x3f2c('0x37')]){delete _0x414415[_0x3f2c('0x37')];}_0x20241a=_0x414415;})[_0x3f2c('0x7d')](function(){if(_0x20241a===null){_0x1b3e81['sendStatus'](_0x3749f1);}else{if(_0x3749f1===0x1f4){_0x1b3e81['status'](_0x3749f1)[_0x3f2c('0x38')](_0x20241a);}else{_0x1b3e81['status'](_0x3749f1)['json'](_0x20241a);}}});};exports[_0x3f2c('0x7e')]=function(_0x321208,_0x360115,_0x18b2e5){var _0x3b7c82={};var _0x4d02ac={};var _0xec35f3;var _0x1d0ffa;return db[_0x3f2c('0x3d')][_0x3f2c('0x6b')]({'where':{'id':_0x321208['params']['id']}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x360115,null))[_0x3f2c('0x1f')](function(_0x154320){if(_0x154320){_0xec35f3=_0x154320;_0x4d02ac[_0x3f2c('0x3f')]=_[_0x3f2c('0x41')](db['WhatsappApplication']['rawAttributes']);_0x4d02ac['query']=_[_0x3f2c('0x41')](_0x321208['query']);_0x4d02ac['filters']=_[_0x3f2c('0x43')](_0x4d02ac[_0x3f2c('0x3f')],_0x4d02ac[_0x3f2c('0x40')]);_0x3b7c82[_0x3f2c('0x44')]=_['intersection'](_0x4d02ac[_0x3f2c('0x3f')],qs[_0x3f2c('0x45')](_0x321208[_0x3f2c('0x40')][_0x3f2c('0x45')]));_0x3b7c82[_0x3f2c('0x44')]=_0x3b7c82[_0x3f2c('0x44')][_0x3f2c('0x46')]?_0x3b7c82['attributes']:_0x4d02ac['model'];_0x3b7c82[_0x3f2c('0x64')]=qs[_0x3f2c('0x49')](_0x321208[_0x3f2c('0x40')][_0x3f2c('0x49')]);_0x3b7c82['where']=qs[_0x3f2c('0x42')](_[_0x3f2c('0x4b')](_0x321208[_0x3f2c('0x40')],_0x4d02ac['filters']));if(_0x321208['query']['filter']){_0x3b7c82['where']=_[_0x3f2c('0x4d')](_0x3b7c82[_0x3f2c('0x4a')],{'$or':_[_0x3f2c('0x3c')](_0x3b7c82[_0x3f2c('0x44')],function(_0x3fac82){var _0x2a0569={};_0x2a0569[_0x3fac82]={'$like':'%'+_0x321208[_0x3f2c('0x40')][_0x3f2c('0x4c')]+'%'};return _0x2a0569;})});}_0x3b7c82=_[_0x3f2c('0x4d')]({},_0x3b7c82,_0x321208[_0x3f2c('0x50')]);return _0xec35f3[_0x3f2c('0x7e')](_0x3b7c82);}})[_0x3f2c('0x1f')](function(_0x5c9d1e){if(_0x5c9d1e){_0x1d0ffa=_0x5c9d1e[_0x3f2c('0x46')];if(!_0x321208['query']['hasOwnProperty'](_0x3f2c('0x48'))){_0x3b7c82[_0x3f2c('0x2f')]=qs[_0x3f2c('0x2f')](_0x321208[_0x3f2c('0x40')]['limit']);_0x3b7c82['offset']=qs[_0x3f2c('0x2d')](_0x321208[_0x3f2c('0x40')][_0x3f2c('0x2d')]);}return _0xec35f3[_0x3f2c('0x7e')](_0x3b7c82);}})[_0x3f2c('0x1f')](function(_0x4b795f){if(_0x4b795f){return _0x4b795f?{'count':_0x1d0ffa,'rows':_0x4b795f}:null;}})[_0x3f2c('0x1f')](respondWithResult(_0x360115,null))[_0x3f2c('0x28')](handleError(_0x360115,null));};exports[_0x3f2c('0x7f')]=function(_0x22fb43,_0x285fda,_0x1413c7){var _0x4f629f={'channel':_0x3f2c('0x80')};var _0x18b4d0=[];var _0x20a93e=[];var _0x57bfbe={};return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x22fb43['params']['id']},'include':[{'model':db[_0x3f2c('0x7a')],'as':_0x3f2c('0x81')}]})[_0x3f2c('0x1f')](handleEntityNotFound(_0x285fda,null))[_0x3f2c('0x1f')](function(_0x386e42){_0x4f629f[_0x3f2c('0x82')]=_0x386e42;if(_0x4f629f[_0x3f2c('0x82')]&&_0x4f629f['account'][_0x3f2c('0x4e')]===_0x3f2c('0x83')&&_0x22fb43[_0x3f2c('0x57')][_0x3f2c('0x84')]){if(_0x22fb43[_0x3f2c('0x57')]['statuses'][_0x3f2c('0x46')]===0x0)return;if(_0x22fb43[_0x3f2c('0x57')][_0x3f2c('0x84')][0x0]['state']!==_0x3f2c('0x85'))return;return db['WhatsappMessage'][_0x3f2c('0x5d')]({'read':!![],'readAt':_0x22fb43[_0x3f2c('0x57')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x22fb43[_0x3f2c('0x57')][_0x3f2c('0x84')][0x0][_0x3f2c('0x86')]},'individualHooks':!![]})[_0x3f2c('0x1f')](function(_0x29581f){return _0x285fda[_0x3f2c('0x2a')](0xc8)[_0x3f2c('0x2c')](_0x29581f);});}_0x4f629f[_0x3f2c('0x87')]=_[_0x3f2c('0x88')](_0x386e42[_0x3f2c('0x81')],['priority'],[_0x3f2c('0x89')]);if(_0x4f629f[_0x3f2c('0x82')]['Applications']){delete _0x4f629f['account'][_0x3f2c('0x81')];}return db[_0x3f2c('0x8a')][_0x3f2c('0x5f')]()[_0x3f2c('0x1f')](function(_0x368c4d){if(!_0x368c4d){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))]('no\x20available\x20attributes');}_0x18b4d0=_[_0x3f2c('0x8d')](_[_0x3f2c('0x41')](_0x368c4d),['createdAt',_0x3f2c('0x8e')]);_0x20a93e=_[_0x3f2c('0x8d')](_[_0x3f2c('0x41')](_0x368c4d),[_0x3f2c('0x8f'),_0x3f2c('0x8e'),_0x3f2c('0x90'),_0x3f2c('0x91')]);_0x4f629f[_0x3f2c('0x57')]={'mapKey':'mobile'};if(_0x4f629f['account']&&_0x4f629f[_0x3f2c('0x82')][_0x3f2c('0x4e')]===_0x3f2c('0x92')){_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x93')]=_0x22fb43['body'][_0x3f2c('0x94')][_0x3f2c('0x95')]('whatsapp:','');_0x4f629f['body'][_0x3f2c('0x57')]=_0x22fb43[_0x3f2c('0x57')][_0x3f2c('0x96')];_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x97')]=_0x22fb43[_0x3f2c('0x57')]['MessageSid'];}if(_0x4f629f[_0x3f2c('0x82')]&&_0x4f629f[_0x3f2c('0x82')][_0x3f2c('0x4e')]===_0x3f2c('0x83')){_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x93')]=_0x22fb43[_0x3f2c('0x57')][_0x3f2c('0x98')][0x0][_0x3f2c('0x93')];_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x57')]=_0x22fb43['body']['notifications'][0x0]['message'][_0x3f2c('0x57')];_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x97')]=_0x22fb43['body'][_0x3f2c('0x98')][0x0][_0x3f2c('0x86')];}if(_0x4f629f['body']['id']){delete _0x4f629f['body']['id'];}if(_[_0x3f2c('0x99')](_0x4f629f['body'][_0x3f2c('0x93')])){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))](_0x3f2c('0x9a'));}if(_[_0x3f2c('0x99')](_0x4f629f[_0x3f2c('0x57')]['body'])||_0x4f629f[_0x3f2c('0x57')]['body']===''){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3f2c('0x99')](_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x9b')])){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))](_0x3f2c('0x9c')+_0x20a93e);}if(!_[_0x3f2c('0x9d')](_0x20a93e,_0x4f629f[_0x3f2c('0x57')]['mapKey'])){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))](_0x3f2c('0x9e')+_0x20a93e);}_0x57bfbe[_0x4f629f[_0x3f2c('0x57')]['mapKey']]=_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x93')];return db[_0x3f2c('0x9f')][_0x3f2c('0x55')]({'where':{'id':_0x4f629f[_0x3f2c('0x82')]['ListId']},'include':[{'model':db[_0x3f2c('0x8a')],'as':_0x3f2c('0xa0'),'where':_0x57bfbe,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x3f2c('0x1f')](handleEntityNotFound(_0x285fda,null))[_0x3f2c('0x1f')](function(_0x423b09){if(_0x423b09){_0x4f629f['list']=_[_0x3f2c('0x6e')](_0x423b09,['Contacts']);if(_0x423b09[_0x3f2c('0xa0')][_0x3f2c('0x46')]){return _0x423b09[_0x3f2c('0xa0')][0x0];}var _0x416309=_[_0x3f2c('0x19')](_0x4f629f[_0x3f2c('0x57')],{'firstName':_0x4f629f['body'][_0x3f2c('0x93')],'ListId':_0x423b09['id']});_0x416309[_0x4f629f['body'][_0x3f2c('0x9b')]]=_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x93')];return db[_0x3f2c('0x8a')][_0x3f2c('0x56')](_0x416309,{'fields':_0x18b4d0,'raw':!![]});}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x285fda,null))[_0x3f2c('0x1f')](function(_0x519f89){if(_0x519f89){_0x4f629f[_0x3f2c('0xa1')]=_0x519f89;var _0x32e43e={'ContactId':_0x519f89['id'],'phone':_0x4f629f['body'][_0x3f2c('0x93')],'WhatsappAccountId':_0x22fb43[_0x3f2c('0x5e')]['id']};var _0x8e325={'ContactId':_0x519f89['id'],'WhatsappAccountId':_0x22fb43[_0x3f2c('0x5e')]['id'],'closed':![]};return db[_0x3f2c('0xa2')][_0x3f2c('0x55')]({'where':_0x8e325})['then'](function(_0x90bac5){if(_0x90bac5){return[_0x90bac5,![]];}return db[_0x3f2c('0xa2')][_0x3f2c('0x56')](_0x32e43e)[_0x3f2c('0x1f')](function(_0x12081a){return[_0x12081a,!![]];});});}})['spread'](function(_0x289778,_0x4ba705){_0x4f629f[_0x3f2c('0xa3')]=_0x289778[_0x3f2c('0x34')]({'plain':!![]});_0x4f629f[_0x3f2c('0xa3')][_0x3f2c('0xa4')]=![];if(_0x4ba705){if(_0x4f629f[_0x3f2c('0x82')][_0x3f2c('0xa5')]){_0x4f629f[_0x3f2c('0x87')][_0x3f2c('0xa6')]({'id':0x0,'priority':_0x4f629f['applications']['length']+0x1,'app':_0x3f2c('0xa7'),'appdata':_0x3f2c('0xa8'),'interval':'*,*,*,*'});}_0x4f629f[_0x3f2c('0xa3')][_0x3f2c('0xa4')]=!![];}return db[_0x3f2c('0xa9')]['create']({'phone':_0x4f629f['body'][_0x3f2c('0x93')],'messageId':_0x4f629f[_0x3f2c('0x57')]['messageId'],'body':_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0x57')],'WhatsappAccountId':_0x22fb43[_0x3f2c('0x5e')]['id'],'WhatsappInteractionId':_0x289778['id'],'direction':'in','ContactId':_0x289778['ContactId'],'AttachmentId':_0x4f629f[_0x3f2c('0x57')][_0x3f2c('0xaa')]});})[_0x3f2c('0x1f')](function(_0x5d73c4){_0x4f629f[_0x3f2c('0x26')]=_0x5d73c4;if(_0x4f629f[_0x3f2c('0xa3')]['UserId']){return db['User'][_0x3f2c('0x55')]({'attributes':['id','name'],'where':{'id':_0x4f629f[_0x3f2c('0xa3')]['UserId']}})['then'](function(_0x1cacb5){if(_0x1cacb5){_0x4f629f[_0x3f2c('0x87')][_0x3f2c('0xab')]({'id':0x0,'priority':0x0,'app':_0x3f2c('0xac'),'appdata':_0x1cacb5[_0x3f2c('0x37')]+','+(_0x4f629f[_0x3f2c('0x82')][_0x3f2c('0xad')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x3f2c('0xae'),_0x4f629f);});}return respondWithRpcPromise(_0x3f2c('0xaf'),_0x3f2c('0xae'),_0x4f629f);})[_0x3f2c('0x1f')](function(_0x2aaac0){if(_0x2aaac0){var _0x371acf=0xc8;var _0x524f96=_0x3f2c('0xb0');logger[_0x3f2c('0x20')](_0x3f2c('0xb1'),_0x524f96,_0x371acf,_0x3f2c('0xb2'));logger[_0x3f2c('0x22')](_0x3f2c('0xb3'),_0x524f96,_0x371acf,_0x3f2c('0xb2'),JSON[_0x3f2c('0xb4')](_0x2aaac0));if(_0x4f629f['account']['type']==='twilio'){return _0x285fda[_0x3f2c('0x2a')](_0x371acf)[_0x3f2c('0x31')](_0x3f2c('0xb5'),_0x3f2c('0xb6'))[_0x3f2c('0x38')](_0x3f2c('0xb7'));}else{return _0x285fda[_0x3f2c('0x2a')](_0x371acf)[_0x3f2c('0x2c')](_0x2aaac0);}}});})[_0x3f2c('0x28')](handleError(_0x285fda,null));};exports['send']=function(_0x2f2d11,_0x33989a,_0x270ce4){var _0x2193df,_0x50d64e,_0x2f934a;if(_[_0x3f2c('0x99')](_0x2f2d11['body']['body'])||_0x2f2d11[_0x3f2c('0x57')][_0x3f2c('0x57')]===''){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))](_0x3f2c('0xb8'));}if(_[_0x3f2c('0x99')](_0x2f2d11['body']['to'])){throw new db[(_0x3f2c('0x8b'))][(_0x3f2c('0x8c'))](_0x3f2c('0xb9'));}_0x2193df=_0x2f2d11[_0x3f2c('0x57')]['to'];return db[_0x3f2c('0x3d')][_0x3f2c('0x55')]({'where':{'id':_0x2f2d11['params']['id']},'include':[{'model':db[_0x3f2c('0x9f')],'as':_0x3f2c('0xba'),'include':[{'model':db[_0x3f2c('0x8a')],'as':_0x3f2c('0xa0'),'where':{'mobile':_0x2193df},'limit':0x1,'order':[[_0x3f2c('0x8e'),_0x3f2c('0xbb')]]}]}]})[_0x3f2c('0x1f')](handleEntityNotFound(_0x33989a,null))[_0x3f2c('0x1f')](function(_0x4e597f){if(_0x4e597f&&_0x4e597f[_0x3f2c('0xba')]){_0x50d64e=_0x4e597f[_0x3f2c('0x34')]({'plain':!![]});if(_0x50d64e[_0x3f2c('0xba')]&&_0x50d64e[_0x3f2c('0xba')][_0x3f2c('0xa0')][_0x3f2c('0x46')]){return _0x50d64e[_0x3f2c('0xba')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x3f2c('0x19')](_0x2f2d11[_0x3f2c('0x57')],{'firstName':_0x2193df,'mobile':_0x2193df,'phone':_0x2193df,'ListId':_0x50d64e[_0x3f2c('0x91')]}));}})[_0x3f2c('0x1f')](handleEntityNotFound(_0x33989a,null))[_0x3f2c('0x1f')](function(_0x592e97){if(_0x592e97){_0x2f934a=_0x592e97;return db['WhatsappInteraction'][_0x3f2c('0x55')]({'where':{'ContactId':_0x2f934a['id'],'closed':![],'WhatsappAccountId':_0x50d64e['id']}})['then'](function(_0x4d494a){if(_0x4d494a){return[_0x4d494a,![]];}return db[_0x3f2c('0xa2')][_0x3f2c('0x56')]({'UserId':_0x2f2d11['user']['id'],'ContactId':_0x2f934a['id'],'WhatsappAccountId':_0x50d64e['id'],'phone':_0x2193df,'firstMsgDirection':_0x3f2c('0xbc'),'Messages':[_[_0x3f2c('0x4d')](_0x2f2d11['body'],{'read':![],'body':_0x2f2d11[_0x3f2c('0x57')][_0x3f2c('0x57')],'phone':_0x2193df,'WhatsappAccountId':_0x50d64e['id'],'UserId':_0x2f2d11[_0x3f2c('0x58')]['id'],'ContactId':_0x2f934a['id']})]},{'include':[{'model':db[_0x3f2c('0xa9')],'as':_0x3f2c('0xbd')}]})['then'](function(_0x5d3c43){return[_0x5d3c43,!![]];});});}})[_0x3f2c('0x6f')](function(_0x235447,_0xa46916){if(_0xa46916){return _0x235447;}return db['WhatsappMessage'][_0x3f2c('0x56')](_['merge'](_0x2f2d11[_0x3f2c('0x57')],{'read':![],'body':_0x2f2d11['body'][_0x3f2c('0x57')],'phone':_0x2193df,'WhatsappAccountId':_0x50d64e['id'],'WhatsappInteractionId':_0x235447['id'],'UserId':_0x2f2d11[_0x3f2c('0x58')]['id'],'ContactId':_0x2f934a['id']}))[_0x3f2c('0x1f')](function(_0x180daa){_0x235447[_0x3f2c('0xbe')]['Messages']=[];_0x235447[_0x3f2c('0xbe')][_0x3f2c('0xbd')][_0x3f2c('0xa6')](_0x180daa[_0x3f2c('0xbe')]);return _0x235447;});})[_0x3f2c('0x1f')](respondWithResult(_0x33989a,null))[_0x3f2c('0x28')](handleError(_0x33989a,null));}; \ No newline at end of file +var _0xb76b=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','WhatsappAccounts','UserProfileResource','name','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','Pause','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','WhatsappAccountId','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','Contacts','DESC','list','omit','WhatsappInteraction','created','applications','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x191511,_0x4a5344){var _0x41a521=function(_0x5f0ef9){while(--_0x5f0ef9){_0x191511['push'](_0x191511['shift']());}};_0x41a521(++_0x4a5344);}(_0xb76b,0xbe));var _0xbb76=function(_0x14aeae,_0x119228){_0x14aeae=_0x14aeae-0x0;var _0x3fc266=_0xb76b[_0x14aeae];return _0x3fc266;};'use strict';var emlformat=require(_0xbb76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb76('0x1'));var jsonpatch=require(_0xbb76('0x2'));var rp=require(_0xbb76('0x3'));var moment=require(_0xbb76('0x4'));var BPromise=require(_0xbb76('0x5'));var Mustache=require(_0xbb76('0x6'));var util=require(_0xbb76('0x7'));var path=require(_0xbb76('0x8'));var sox=require('sox');var csv=require(_0xbb76('0x9'));var ejs=require(_0xbb76('0xa'));var fs=require('fs');var fs_extra=require(_0xbb76('0xb'));var _=require(_0xbb76('0xc'));var squel=require(_0xbb76('0xd'));var crypto=require(_0xbb76('0xe'));var jsforce=require(_0xbb76('0xf'));var deskjs=require(_0xbb76('0x10'));var toCsv=require(_0xbb76('0x9'));var querystring=require(_0xbb76('0x11'));var Papa=require('papaparse');var Redis=require(_0xbb76('0x12'));var authService=require(_0xbb76('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbb76('0x14'));var hardwareService=require(_0xbb76('0x15'));var logger=require(_0xbb76('0x16'))(_0xbb76('0x17'));var utils=require(_0xbb76('0x18'));var config=require(_0xbb76('0x19'));var licenseUtil=require(_0xbb76('0x1a'));var db=require(_0xbb76('0x1b'))['db'];config[_0xbb76('0x1c')]=_[_0xbb76('0x1d')](config[_0xbb76('0x1c')],{'host':_0xbb76('0x1e'),'port':0x18eb});var socket=require(_0xbb76('0x1f'))(new Redis(config['redis']));require(_0xbb76('0x20'))[_0xbb76('0x21')](socket);var jayson=require(_0xbb76('0x22'));var client=jayson[_0xbb76('0x23')][_0xbb76('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x149693,_0x5bfedc,_0x51d4ba,_0x599af8){return new BPromise(function(_0x5a5349,_0x9be105){var _0x3bc08c=_0x599af8||client;return _0x3bc08c[_0xbb76('0x25')](_0x149693,_0x51d4ba)['then'](function(_0x542c5c){logger[_0xbb76('0x26')](_0xbb76('0x27'),_0x5bfedc,'request\x20sent');logger[_0xbb76('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5bfedc,_0xbb76('0x29'),JSON[_0xbb76('0x2a')](_0x542c5c));if(_0x542c5c[_0xbb76('0x2b')]){if(_0x542c5c['error'][_0xbb76('0x2c')]===0x1f4){logger[_0xbb76('0x2b')](_0xbb76('0x27'),_0x5bfedc,_0x542c5c[_0xbb76('0x2b')][_0xbb76('0x2d')]);return _0x9be105(_0x542c5c[_0xbb76('0x2b')][_0xbb76('0x2d')]);}logger[_0xbb76('0x2b')](_0xbb76('0x27'),_0x5bfedc,_0x542c5c['error'][_0xbb76('0x2d')]);return _0x5a5349(_0x542c5c[_0xbb76('0x2b')][_0xbb76('0x2d')]);}else{logger[_0xbb76('0x26')](_0xbb76('0x27'),_0x5bfedc,_0xbb76('0x29'));_0x5a5349(_0x542c5c[_0xbb76('0x2e')][_0xbb76('0x2d')]);}})['catch'](function(_0x5b24f5){logger['error'](_0xbb76('0x27'),_0x5bfedc,_0x5b24f5);_0x9be105(_0x5b24f5);});});}function respondWithStatusCode(_0x5e15fa,_0x47083d){_0x47083d=_0x47083d||0xcc;return function(_0x46672c){if(_0x46672c){return _0x5e15fa[_0xbb76('0x2f')](_0x47083d);}return _0x5e15fa['status'](_0x47083d)[_0xbb76('0x30')]();};}function respondWithResult(_0x45e4d5,_0x359fff){_0x359fff=_0x359fff||0xc8;return function(_0x1c3891){if(_0x1c3891){return _0x45e4d5[_0xbb76('0x31')](_0x359fff)[_0xbb76('0x32')](_0x1c3891);}};}function respondWithFilteredResult(_0x1352fc,_0x19920f){return function(_0xaec884){if(_0xaec884){var _0x5c2430=typeof _0x19920f[_0xbb76('0x33')]==='undefined'&&typeof _0x19920f[_0xbb76('0x34')]===_0xbb76('0x35');var _0x356538=_0xaec884[_0xbb76('0x36')];var _0x33bdba=_0x5c2430?0x0:_0x19920f[_0xbb76('0x33')];var _0x4bb8e8=_0x5c2430?_0xaec884[_0xbb76('0x36')]:_0x19920f[_0xbb76('0x33')]+_0x19920f[_0xbb76('0x34')];var _0x2cdef8;if(_0x4bb8e8>=_0x356538){_0x4bb8e8=_0x356538;_0x2cdef8=0xc8;}else{_0x2cdef8=0xce;}_0x1352fc[_0xbb76('0x31')](_0x2cdef8);return _0x1352fc['set']('Content-Range',_0x33bdba+'-'+_0x4bb8e8+'/'+_0x356538)[_0xbb76('0x32')](_0xaec884);}return null;};}function patchUpdates(_0x320b3e){return function(_0x10db12){try{jsonpatch[_0xbb76('0x37')](_0x10db12,_0x320b3e,!![]);}catch(_0x571a8a){return BPromise[_0xbb76('0x38')](_0x571a8a);}return _0x10db12['save']();};}function saveUpdates(_0x699c72,_0x44adc5){return function(_0x47e569){if(_0x47e569){return _0x47e569[_0xbb76('0x39')](_0x699c72)[_0xbb76('0x3a')](function(_0x5d6376){return _0x5d6376;});}return null;};}function removeEntity(_0x4182bf,_0x275e2){return function(_0x14e0e4){if(_0x14e0e4){return _0x14e0e4[_0xbb76('0x3b')]()['then'](function(){var _0x5be3bb=_0x14e0e4['get']({'plain':!![]});var _0x306f74=_0xbb76('0x3c');return db[_0xbb76('0x3d')][_0xbb76('0x3b')]({'where':{'type':_0x306f74,'resourceId':_0x5be3bb['id']}})[_0xbb76('0x3a')](function(){return _0x14e0e4;});})['then'](function(){_0x4182bf[_0xbb76('0x31')](0xcc)[_0xbb76('0x30')]();});}};}function handleEntityNotFound(_0x523da7,_0x259436){return function(_0x38877e){if(!_0x38877e){_0x523da7['sendStatus'](0x194);}return _0x38877e;};}function handleError(_0x2af3a4,_0x5d0723){_0x5d0723=_0x5d0723||0x1f4;return function(_0x3983b9){logger[_0xbb76('0x2b')](_0x3983b9['stack']);if(_0x3983b9['name']){delete _0x3983b9[_0xbb76('0x3e')];}_0x2af3a4['status'](_0x5d0723)['send'](_0x3983b9);};}exports['index']=function(_0x15945d,_0x392870){var _0x6b7f5c={'include':[{'model':db['Pause'],'as':_0xbb76('0x3f')}]},_0x2057c5={},_0x2fe2a2={'count':0x0,'rows':[]};var _0x222116=_[_0xbb76('0x40')](db[_0xbb76('0x41')][_0xbb76('0x42')],function(_0x103899){return{'name':_0x103899[_0xbb76('0x43')],'type':_0x103899[_0xbb76('0x44')]['key']};});_0x2057c5['model']=_[_0xbb76('0x40')](_0x222116,'name');_0x2057c5[_0xbb76('0x45')]=_[_0xbb76('0x46')](_0x15945d[_0xbb76('0x45')]);_0x2057c5[_0xbb76('0x47')]=_[_0xbb76('0x48')](_0x2057c5[_0xbb76('0x49')],_0x2057c5[_0xbb76('0x45')]);_0x6b7f5c['attributes']=_['intersection'](_0x2057c5[_0xbb76('0x49')],qs[_0xbb76('0x4a')](_0x15945d[_0xbb76('0x45')][_0xbb76('0x4a')]));_0x6b7f5c[_0xbb76('0x4b')]=_0x6b7f5c[_0xbb76('0x4b')][_0xbb76('0x4c')]?_0x6b7f5c[_0xbb76('0x4b')]:_0x2057c5[_0xbb76('0x49')];if(!_0x15945d[_0xbb76('0x45')][_0xbb76('0x4d')](_0xbb76('0x4e'))){_0x6b7f5c[_0xbb76('0x34')]=qs[_0xbb76('0x34')](_0x15945d[_0xbb76('0x45')]['limit']);_0x6b7f5c['offset']=qs[_0xbb76('0x33')](_0x15945d[_0xbb76('0x45')][_0xbb76('0x33')]);}_0x6b7f5c['order']=qs['sort'](_0x15945d['query'][_0xbb76('0x4f')]);_0x6b7f5c[_0xbb76('0x50')]=qs[_0xbb76('0x47')](_['pick'](_0x15945d[_0xbb76('0x45')],_0x2057c5['filters']),_0x222116);if(_0x15945d[_0xbb76('0x45')]['filter']){_0x6b7f5c[_0xbb76('0x50')]=_[_0xbb76('0x51')](_0x6b7f5c[_0xbb76('0x50')],{'$or':_['map'](_0x222116,function(_0x3e7387){if(_0x3e7387[_0xbb76('0x44')]!==_0xbb76('0x52')){var _0x2201cd={};_0x2201cd[_0x3e7387[_0xbb76('0x3e')]]={'$like':'%'+_0x15945d['query'][_0xbb76('0x53')]+'%'};return _0x2201cd;}})});}_0x6b7f5c=_[_0xbb76('0x51')]({},_0x6b7f5c,_0x15945d['options']);var _0xb7b98={'where':_0x6b7f5c[_0xbb76('0x50')]};return db[_0xbb76('0x41')][_0xbb76('0x36')](_0xb7b98)[_0xbb76('0x3a')](function(_0x3a266c){_0x2fe2a2[_0xbb76('0x36')]=_0x3a266c;if(_0x15945d[_0xbb76('0x45')][_0xbb76('0x54')]){_0x6b7f5c[_0xbb76('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xbb76('0x56')](_0x6b7f5c);})[_0xbb76('0x3a')](function(_0x179b30){_0x2fe2a2[_0xbb76('0x57')]=_0x179b30;return _0x2fe2a2;})[_0xbb76('0x3a')](respondWithFilteredResult(_0x392870,_0x6b7f5c))[_0xbb76('0x58')](handleError(_0x392870,null));};exports[_0xbb76('0x59')]=function(_0x465aac,_0x147d41){var _0x2ec6fb={'raw':![],'where':{'id':_0x465aac['params']['id']},'include':[{'model':db[_0xbb76('0x5a')],'as':'mandatoryDispositionPause'}]},_0x304056={};_0x304056['model']=_[_0xbb76('0x46')](db[_0xbb76('0x41')][_0xbb76('0x42')]);_0x304056[_0xbb76('0x45')]=_['keys'](_0x465aac[_0xbb76('0x45')]);_0x304056[_0xbb76('0x47')]=_['intersection'](_0x304056[_0xbb76('0x49')],_0x304056['query']);_0x2ec6fb['attributes']=_['intersection'](_0x304056[_0xbb76('0x49')],qs[_0xbb76('0x4a')](_0x465aac[_0xbb76('0x45')][_0xbb76('0x4a')]));_0x2ec6fb[_0xbb76('0x4b')]=_0x2ec6fb[_0xbb76('0x4b')][_0xbb76('0x4c')]?_0x2ec6fb['attributes']:_0x304056[_0xbb76('0x49')];if(_0x465aac['query'][_0xbb76('0x54')]){_0x2ec6fb[_0xbb76('0x55')]=[{'all':!![]}];}_0x2ec6fb=_[_0xbb76('0x51')]({},_0x2ec6fb,_0x465aac[_0xbb76('0x5b')]);return db[_0xbb76('0x41')]['find'](_0x2ec6fb)['then'](handleEntityNotFound(_0x147d41,null))[_0xbb76('0x3a')](respondWithResult(_0x147d41,null))[_0xbb76('0x58')](handleError(_0x147d41,null));};exports['create']=function(_0x21983c,_0x3699ce){return db['WhatsappAccount'][_0xbb76('0x5c')](_0x21983c[_0xbb76('0x5d')],{})[_0xbb76('0x3a')](function(_0x573f6f){var _0x246759=_0x21983c[_0xbb76('0x5e')]['get']({'plain':!![]});if(!_0x246759)throw new Error(_0xbb76('0x5f'));if(_0x246759[_0xbb76('0x60')]===_0xbb76('0x5e')){var _0x375439=_0x573f6f[_0xbb76('0x61')]({'plain':!![]});var _0x266ae5=_0xbb76('0x3c');return db[_0xbb76('0x62')][_0xbb76('0x63')]({'where':{'name':_0x266ae5,'userProfileId':_0x246759[_0xbb76('0x64')]},'raw':!![]})[_0xbb76('0x3a')](function(_0x349935){if(_0x349935&&_0x349935[_0xbb76('0x65')]===0x0){return db[_0xbb76('0x3d')][_0xbb76('0x5c')]({'name':_0x375439[_0xbb76('0x3e')],'resourceId':_0x375439['id'],'type':_0x349935[_0xbb76('0x3e')],'sectionId':_0x349935['id']},{})[_0xbb76('0x3a')](function(){return _0x573f6f;});}else{return _0x573f6f;}})[_0xbb76('0x58')](function(_0xb57d86){logger[_0xbb76('0x2b')](_0xbb76('0x66'),_0xb57d86);throw _0xb57d86;});}return _0x573f6f;})[_0xbb76('0x3a')](respondWithResult(_0x3699ce,0xc9))[_0xbb76('0x58')](handleError(_0x3699ce,null));};exports[_0xbb76('0x39')]=function(_0x2d9271,_0x2b5091){if(_0x2d9271['body']['id']){delete _0x2d9271[_0xbb76('0x5d')]['id'];}return db[_0xbb76('0x41')][_0xbb76('0x63')]({'where':{'id':_0x2d9271[_0xbb76('0x67')]['id']},'include':[{'model':db[_0xbb76('0x5a')],'as':_0xbb76('0x3f')}]})[_0xbb76('0x3a')](handleEntityNotFound(_0x2b5091,null))[_0xbb76('0x3a')](saveUpdates(_0x2d9271['body'],null))['then'](respondWithResult(_0x2b5091,null))[_0xbb76('0x58')](handleError(_0x2b5091,null));};exports[_0xbb76('0x3b')]=function(_0x2b7b96,_0x50d2e4){return db[_0xbb76('0x41')]['find']({'where':{'id':_0x2b7b96[_0xbb76('0x67')]['id']}})[_0xbb76('0x3a')](handleEntityNotFound(_0x50d2e4,null))[_0xbb76('0x3a')](removeEntity(_0x50d2e4,null))['catch'](handleError(_0x50d2e4,null));};exports['describe']=function(_0x9399dc,_0x5c4e1a){return db[_0xbb76('0x41')][_0xbb76('0x68')]()[_0xbb76('0x3a')](respondWithResult(_0x5c4e1a,null))[_0xbb76('0x58')](handleError(_0x5c4e1a,null));};exports['addDisposition']=function(_0x337aa7,_0x286157,_0x313448){if(_0x337aa7['body']['id']){delete _0x337aa7['body']['id'];}return db[_0xbb76('0x41')]['find']({'where':{'id':_0x337aa7[_0xbb76('0x67')]['id']}})[_0xbb76('0x3a')](handleEntityNotFound(_0x286157,null))[_0xbb76('0x3a')](function(_0x54f807){if(_0x54f807){_0x337aa7[_0xbb76('0x5d')][_0xbb76('0x69')]=_0x54f807['id'];return db['Disposition']['create'](_0x337aa7[_0xbb76('0x5d')]);}})[_0xbb76('0x3a')](respondWithResult(_0x286157,null))[_0xbb76('0x58')](handleError(_0x286157,null));};exports['getDispositions']=function(_0x464505,_0x574209,_0x1e8b20){var _0x58ea47={'raw':![],'where':{}};var _0x4ab820={};var _0x3f4943={'count':0x0,'rows':[]};return db[_0xbb76('0x41')][_0xbb76('0x6a')]({'where':{'id':_0x464505[_0xbb76('0x67')]['id']}})['then'](handleEntityNotFound(_0x574209,null))['then'](function(_0x3b5c79){if(_0x3b5c79){_0x4ab820[_0xbb76('0x49')]=_[_0xbb76('0x46')](db[_0xbb76('0x6b')][_0xbb76('0x42')]);_0x4ab820[_0xbb76('0x45')]=_[_0xbb76('0x46')](_0x464505[_0xbb76('0x45')]);_0x4ab820[_0xbb76('0x47')]=_[_0xbb76('0x48')](_0x4ab820[_0xbb76('0x49')],_0x4ab820[_0xbb76('0x45')]);_0x58ea47[_0xbb76('0x4b')]=_[_0xbb76('0x48')](_0x4ab820[_0xbb76('0x49')],qs['fields'](_0x464505[_0xbb76('0x45')]['fields']));_0x58ea47['attributes']=_0x58ea47[_0xbb76('0x4b')][_0xbb76('0x4c')]?_0x58ea47[_0xbb76('0x4b')]:_0x4ab820[_0xbb76('0x49')];if(!_0x464505[_0xbb76('0x45')][_0xbb76('0x4d')](_0xbb76('0x4e'))){_0x58ea47['limit']=qs[_0xbb76('0x34')](_0x464505[_0xbb76('0x45')][_0xbb76('0x34')]);_0x58ea47[_0xbb76('0x33')]=qs[_0xbb76('0x33')](_0x464505['query'][_0xbb76('0x33')]);}_0x58ea47['order']=qs[_0xbb76('0x4f')](_0x464505['query']['sort']);_0x58ea47[_0xbb76('0x50')]=qs[_0xbb76('0x47')](_[_0xbb76('0x6c')](_0x464505[_0xbb76('0x45')],_0x4ab820[_0xbb76('0x47')]));_0x58ea47['where']['WhatsappAccountId']=_0x3b5c79['id'];if(_0x464505[_0xbb76('0x45')]['filter']){_0x58ea47[_0xbb76('0x50')]=_[_0xbb76('0x51')](_0x58ea47['where'],{'$or':_[_0xbb76('0x40')](_0x58ea47['attributes'],function(_0x4811e0){var _0x3dfe9d={};_0x3dfe9d[_0x4811e0]={'$like':'%'+_0x464505[_0xbb76('0x45')][_0xbb76('0x53')]+'%'};return _0x3dfe9d;})});}_0x58ea47=_[_0xbb76('0x51')]({},_0x58ea47,_0x464505[_0xbb76('0x5b')]);return db[_0xbb76('0x6b')][_0xbb76('0x36')]({'where':_0x58ea47[_0xbb76('0x50')]})['then'](function(_0x3d859e){_0x3f4943[_0xbb76('0x36')]=_0x3d859e;if(_0x464505[_0xbb76('0x45')][_0xbb76('0x54')]){_0x58ea47[_0xbb76('0x55')]=[{'all':!![]}];}return db[_0xbb76('0x6b')][_0xbb76('0x56')](_0x58ea47);})[_0xbb76('0x3a')](function(_0x30d512){_0x3f4943[_0xbb76('0x57')]=_0x30d512;return _0x3f4943;});}})[_0xbb76('0x3a')](respondWithFilteredResult(_0x574209,_0x58ea47))[_0xbb76('0x58')](handleError(_0x574209,null));};exports[_0xbb76('0x6d')]=function(_0x400be5,_0xda35e1,_0x44ba3f){return db['WhatsappAccount'][_0xbb76('0x63')]({'where':{'id':_0x400be5[_0xbb76('0x67')]['id']}})['then'](handleEntityNotFound(_0xda35e1,null))[_0xbb76('0x3a')](function(_0x3c5c53){if(_0x3c5c53){return _0x3c5c53[_0xbb76('0x6d')](_0x400be5['query'][_0xbb76('0x6e')]);}})[_0xbb76('0x3a')](respondWithStatusCode(_0xda35e1,null))[_0xbb76('0x58')](handleError(_0xda35e1,null));};exports[_0xbb76('0x6f')]=function(_0x1608ab,_0x28aaba,_0x2f0e38){if(_0x1608ab[_0xbb76('0x5d')]['id']){delete _0x1608ab['body']['id'];}return db[_0xbb76('0x41')][_0xbb76('0x63')]({'where':{'id':_0x1608ab[_0xbb76('0x67')]['id']}})['then'](handleEntityNotFound(_0x28aaba,null))['then'](function(_0x47cdcc){if(_0x47cdcc){_0x1608ab[_0xbb76('0x5d')][_0xbb76('0x69')]=_0x47cdcc['id'];return db[_0xbb76('0x70')][_0xbb76('0x5c')](_0x1608ab[_0xbb76('0x5d')]);}})['then'](respondWithResult(_0x28aaba,null))[_0xbb76('0x58')](handleError(_0x28aaba,null));};exports[_0xbb76('0x71')]=function(_0x1a0fca,_0x4430ad,_0xf21029){var _0xe2b692={'raw':![],'where':{}};var _0xe0c069={};var _0x3540ec={'count':0x0,'rows':[]};return db[_0xbb76('0x41')][_0xbb76('0x6a')]({'where':{'id':_0x1a0fca['params']['id']}})[_0xbb76('0x3a')](handleEntityNotFound(_0x4430ad,null))['then'](function(_0x21dd7d){if(_0x21dd7d){_0xe0c069[_0xbb76('0x49')]=_[_0xbb76('0x46')](db[_0xbb76('0x70')][_0xbb76('0x42')]);_0xe0c069[_0xbb76('0x45')]=_[_0xbb76('0x46')](_0x1a0fca[_0xbb76('0x45')]);_0xe0c069[_0xbb76('0x47')]=_[_0xbb76('0x48')](_0xe0c069[_0xbb76('0x49')],_0xe0c069['query']);_0xe2b692[_0xbb76('0x4b')]=_[_0xbb76('0x48')](_0xe0c069[_0xbb76('0x49')],qs[_0xbb76('0x4a')](_0x1a0fca['query'][_0xbb76('0x4a')]));_0xe2b692[_0xbb76('0x4b')]=_0xe2b692[_0xbb76('0x4b')][_0xbb76('0x4c')]?_0xe2b692[_0xbb76('0x4b')]:_0xe0c069[_0xbb76('0x49')];if(!_0x1a0fca['query'][_0xbb76('0x4d')](_0xbb76('0x4e'))){_0xe2b692[_0xbb76('0x34')]=qs[_0xbb76('0x34')](_0x1a0fca[_0xbb76('0x45')]['limit']);_0xe2b692['offset']=qs[_0xbb76('0x33')](_0x1a0fca[_0xbb76('0x45')][_0xbb76('0x33')]);}_0xe2b692[_0xbb76('0x72')]=qs[_0xbb76('0x4f')](_0x1a0fca[_0xbb76('0x45')]['sort']);_0xe2b692[_0xbb76('0x50')]=qs[_0xbb76('0x47')](_[_0xbb76('0x6c')](_0x1a0fca[_0xbb76('0x45')],_0xe0c069[_0xbb76('0x47')]));_0xe2b692[_0xbb76('0x50')][_0xbb76('0x69')]=_0x21dd7d['id'];if(_0x1a0fca[_0xbb76('0x45')][_0xbb76('0x53')]){_0xe2b692[_0xbb76('0x50')]=_['merge'](_0xe2b692[_0xbb76('0x50')],{'$or':_[_0xbb76('0x40')](_0xe2b692['attributes'],function(_0x48883d){var _0x1f18b3={};_0x1f18b3[_0x48883d]={'$like':'%'+_0x1a0fca['query'][_0xbb76('0x53')]+'%'};return _0x1f18b3;})});}_0xe2b692=_[_0xbb76('0x51')]({},_0xe2b692,_0x1a0fca[_0xbb76('0x5b')]);return db[_0xbb76('0x70')][_0xbb76('0x36')]({'where':_0xe2b692[_0xbb76('0x50')]})['then'](function(_0x26ef6a){_0x3540ec[_0xbb76('0x36')]=_0x26ef6a;if(_0x1a0fca[_0xbb76('0x45')]['includeAll']){_0xe2b692[_0xbb76('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbb76('0x56')](_0xe2b692);})[_0xbb76('0x3a')](function(_0x190351){_0x3540ec['rows']=_0x190351;return _0x3540ec;});}})[_0xbb76('0x3a')](respondWithFilteredResult(_0x4430ad,_0xe2b692))[_0xbb76('0x58')](handleError(_0x4430ad,null));};exports[_0xbb76('0x73')]=function(_0x496aab,_0x3c4c7f,_0x3dd1b8){return db[_0xbb76('0x41')][_0xbb76('0x63')]({'where':{'id':_0x496aab[_0xbb76('0x67')]['id']}})['then'](handleEntityNotFound(_0x3c4c7f,null))[_0xbb76('0x3a')](function(_0x587401){if(_0x587401){return _0x587401[_0xbb76('0x73')](_0x496aab[_0xbb76('0x45')][_0xbb76('0x6e')]);}})['then'](respondWithStatusCode(_0x3c4c7f,null))[_0xbb76('0x58')](handleError(_0x3c4c7f,null));};exports[_0xbb76('0x74')]=function(_0x4e9b74,_0x146001,_0x5daa3a){return db[_0xbb76('0x41')]['find']({'where':{'id':_0x4e9b74[_0xbb76('0x67')]['id']}})[_0xbb76('0x3a')](handleEntityNotFound(_0x146001,null))['then'](function(_0x4bd9b1){if(_0x4bd9b1){return _0x4bd9b1[_0xbb76('0x74')](_0x4e9b74[_0xbb76('0x5d')][_0xbb76('0x6e')],_['omit'](_0x4e9b74[_0xbb76('0x5d')],[_0xbb76('0x6e'),'id'])||{})[_0xbb76('0x75')](function(_0x514ded){for(var _0x53a519=0x0;_0x53a519<_0x4e9b74[_0xbb76('0x5d')][_0xbb76('0x6e')][_0xbb76('0x4c')];_0x53a519+=0x1){socket['emit'](_0xbb76('0x76'),{'UserId':Number(_0x4e9b74['body'][_0xbb76('0x6e')][_0x53a519]),'WhatsappAccountId':Number(_0x4e9b74[_0xbb76('0x67')]['id'])});}return _0x514ded;});}})['then'](respondWithResult(_0x146001,null))['catch'](handleError(_0x146001,null));};exports[_0xbb76('0x77')]=function(_0x1d1ffb,_0x2ef639,_0x534c2b){return db[_0xbb76('0x41')][_0xbb76('0x63')]({'where':{'id':_0x1d1ffb['params']['id']}})['then'](handleEntityNotFound(_0x2ef639,null))[_0xbb76('0x3a')](function(_0xed3fb5){if(_0xed3fb5){return _0xed3fb5['removeAgents'](_0x1d1ffb[_0xbb76('0x45')][_0xbb76('0x6e')])['then'](function(){if(_['isArray'](_0x1d1ffb[_0xbb76('0x45')][_0xbb76('0x6e')])){for(var _0x5c6247=0x0;_0x5c6247<_0x1d1ffb['query'][_0xbb76('0x6e')][_0xbb76('0x4c')];_0x5c6247+=0x1){socket[_0xbb76('0x78')](_0xbb76('0x79'),{'UserId':Number(_0x1d1ffb['query'][_0xbb76('0x6e')][_0x5c6247]),'WhatsappAccountId':Number(_0x1d1ffb[_0xbb76('0x67')]['id'])});}}else{socket[_0xbb76('0x78')](_0xbb76('0x79'),{'UserId':Number(_0x1d1ffb[_0xbb76('0x45')]['ids']),'WhatsappAccountId':Number(_0x1d1ffb[_0xbb76('0x67')]['id'])});}});}})[_0xbb76('0x3a')](respondWithStatusCode(_0x2ef639,null))[_0xbb76('0x58')](handleError(_0x2ef639,null));};exports[_0xbb76('0x7a')]=function(_0x2cc94b,_0x5bac1a,_0x4217b9){var _0x37241e={};var _0x4c3ae4={};var _0x2f0d2c;var _0x760b65;return db[_0xbb76('0x41')][_0xbb76('0x6a')]({'where':{'id':_0x2cc94b[_0xbb76('0x67')]['id']}})['then'](handleEntityNotFound(_0x5bac1a,null))[_0xbb76('0x3a')](function(_0x5c0f5e){if(_0x5c0f5e){_0x2f0d2c=_0x5c0f5e;_0x4c3ae4[_0xbb76('0x49')]=_[_0xbb76('0x46')](db[_0xbb76('0x7b')]['rawAttributes']);_0x4c3ae4[_0xbb76('0x45')]=_[_0xbb76('0x46')](_0x2cc94b[_0xbb76('0x45')]);_0x4c3ae4[_0xbb76('0x47')]=_[_0xbb76('0x48')](_0x4c3ae4[_0xbb76('0x49')],_0x4c3ae4[_0xbb76('0x45')]);_0x37241e[_0xbb76('0x4b')]=_['intersection'](_0x4c3ae4[_0xbb76('0x49')],qs[_0xbb76('0x4a')](_0x2cc94b[_0xbb76('0x45')][_0xbb76('0x4a')]));_0x37241e[_0xbb76('0x4b')]=_0x37241e[_0xbb76('0x4b')][_0xbb76('0x4c')]?_0x37241e['attributes']:_0x4c3ae4['model'];_0x37241e['order']=qs[_0xbb76('0x4f')](_0x2cc94b[_0xbb76('0x45')][_0xbb76('0x4f')]);_0x37241e[_0xbb76('0x50')]=qs[_0xbb76('0x47')](_[_0xbb76('0x6c')](_0x2cc94b['query'],_0x4c3ae4[_0xbb76('0x47')]));if(_0x2cc94b[_0xbb76('0x45')]['filter']){_0x37241e['where']=_[_0xbb76('0x51')](_0x37241e[_0xbb76('0x50')],{'$or':_[_0xbb76('0x40')](_0x37241e[_0xbb76('0x4b')],function(_0x4d1946){var _0x1ff6b0={};_0x1ff6b0[_0x4d1946]={'$like':'%'+_0x2cc94b[_0xbb76('0x45')][_0xbb76('0x53')]+'%'};return _0x1ff6b0;})});}_0x37241e=_['merge']({},_0x37241e,_0x2cc94b['options']);return _0x2f0d2c[_0xbb76('0x7a')](_0x37241e);}})[_0xbb76('0x3a')](function(_0x265477){if(_0x265477){_0x760b65=_0x265477['length'];if(!_0x2cc94b[_0xbb76('0x45')]['hasOwnProperty'](_0xbb76('0x4e'))){_0x37241e[_0xbb76('0x34')]=qs[_0xbb76('0x34')](_0x2cc94b['query']['limit']);_0x37241e['offset']=qs[_0xbb76('0x33')](_0x2cc94b[_0xbb76('0x45')][_0xbb76('0x33')]);}return _0x2f0d2c[_0xbb76('0x7a')](_0x37241e);}})[_0xbb76('0x3a')](function(_0x3915f3){if(_0x3915f3){return _0x3915f3?{'count':_0x760b65,'rows':_0x3915f3}:null;}})[_0xbb76('0x3a')](respondWithResult(_0x5bac1a,null))['catch'](handleError(_0x5bac1a,null));};exports[_0xbb76('0x7c')]=function(_0x43f304,_0x12491d){var _0x34d20d=_0x43f304['params']['id'];var _0x2ebfaa=_0x43f304['body'];var _0x14fa9b=0xc8;var _0x374e0e=null;return db[_0xbb76('0x7d')][_0xbb76('0x7e')]({'isolationLevel':db['sequelize'][_0xbb76('0x7f')][_0xbb76('0x80')][_0xbb76('0x81')]},function(_0x597626){return db[_0xbb76('0x41')][_0xbb76('0x6a')]({'where':{'id':_0x34d20d},'transaction':_0x597626})['then'](function(_0x5f28d7){if(_0x5f28d7){return db[_0xbb76('0x82')][_0xbb76('0x3b')]({'where':{'WhatsappAccountId':_0x34d20d},'transaction':_0x597626})[_0xbb76('0x3a')](function(){var _0x5bb45a=_['map'](_0x2ebfaa,function(_0x18bc38){_0x18bc38['WhatsappAccountId']=_0x34d20d;return _0x18bc38;});return db[_0xbb76('0x82')][_0xbb76('0x83')](_0x5bb45a,{'transaction':_0x597626});});}else{_0x14fa9b=0x194;_0x374e0e=[];}});})[_0xbb76('0x3a')](function(){if(_0x14fa9b!==0x194){return db[_0xbb76('0x82')][_0xbb76('0x84')]({'where':{'WhatsappAccountId':_0x34d20d},'order':_0xbb76('0x85')})['then'](function(_0x3b7b75){_0x374e0e=_0x3b7b75;});}})[_0xbb76('0x58')](function(_0x1b886d){_0x14fa9b=0x1f4;logger[_0xbb76('0x2b')](_0x1b886d['stack']);if(_0x1b886d[_0xbb76('0x3e')]){delete _0x1b886d[_0xbb76('0x3e')];}_0x374e0e=_0x1b886d;})[_0xbb76('0x86')](function(){if(_0x374e0e===null){_0x12491d[_0xbb76('0x2f')](_0x14fa9b);}else{if(_0x14fa9b===0x1f4){_0x12491d[_0xbb76('0x31')](_0x14fa9b)[_0xbb76('0x87')](_0x374e0e);}else{_0x12491d[_0xbb76('0x31')](_0x14fa9b)[_0xbb76('0x32')](_0x374e0e);}}});};exports['getApplications']=function(_0xa20009,_0x4c2f7f,_0x146736){var _0x38429a={};var _0x2af228={};var _0x41bd40;var _0x2bb5b8;return db['WhatsappAccount'][_0xbb76('0x6a')]({'where':{'id':_0xa20009[_0xbb76('0x67')]['id']}})[_0xbb76('0x3a')](handleEntityNotFound(_0x4c2f7f,null))[_0xbb76('0x3a')](function(_0x40af1a){if(_0x40af1a){_0x41bd40=_0x40af1a;_0x2af228[_0xbb76('0x49')]=_['keys'](db[_0xbb76('0x82')]['rawAttributes']);_0x2af228[_0xbb76('0x45')]=_['keys'](_0xa20009[_0xbb76('0x45')]);_0x2af228[_0xbb76('0x47')]=_[_0xbb76('0x48')](_0x2af228[_0xbb76('0x49')],_0x2af228['query']);_0x38429a[_0xbb76('0x4b')]=_[_0xbb76('0x48')](_0x2af228[_0xbb76('0x49')],qs[_0xbb76('0x4a')](_0xa20009[_0xbb76('0x45')]['fields']));_0x38429a[_0xbb76('0x4b')]=_0x38429a['attributes'][_0xbb76('0x4c')]?_0x38429a['attributes']:_0x2af228[_0xbb76('0x49')];_0x38429a[_0xbb76('0x72')]=qs['sort'](_0xa20009[_0xbb76('0x45')][_0xbb76('0x4f')]);_0x38429a['where']=qs[_0xbb76('0x47')](_['pick'](_0xa20009[_0xbb76('0x45')],_0x2af228['filters']));if(_0xa20009[_0xbb76('0x45')][_0xbb76('0x53')]){_0x38429a[_0xbb76('0x50')]=_[_0xbb76('0x51')](_0x38429a[_0xbb76('0x50')],{'$or':_[_0xbb76('0x40')](_0x38429a['attributes'],function(_0x5cab61){var _0x2f3c92={};_0x2f3c92[_0x5cab61]={'$like':'%'+_0xa20009[_0xbb76('0x45')]['filter']+'%'};return _0x2f3c92;})});}_0x38429a=_[_0xbb76('0x51')]({},_0x38429a,_0xa20009[_0xbb76('0x5b')]);return _0x41bd40[_0xbb76('0x88')](_0x38429a);}})['then'](function(_0x231073){if(_0x231073){_0x2bb5b8=_0x231073[_0xbb76('0x4c')];if(!_0xa20009['query'][_0xbb76('0x4d')]('nolimit')){_0x38429a[_0xbb76('0x34')]=qs[_0xbb76('0x34')](_0xa20009[_0xbb76('0x45')][_0xbb76('0x34')]);_0x38429a['offset']=qs['offset'](_0xa20009[_0xbb76('0x45')][_0xbb76('0x33')]);}return _0x41bd40['getApplications'](_0x38429a);}})['then'](function(_0x3503e7){if(_0x3503e7){return _0x3503e7?{'count':_0x2bb5b8,'rows':_0x3503e7}:null;}})[_0xbb76('0x3a')](respondWithResult(_0x4c2f7f,null))[_0xbb76('0x58')](handleError(_0x4c2f7f,null));};exports[_0xbb76('0x89')]=function(_0x35e86a,_0x1053c0,_0x227eeb){var _0x568c63={'channel':'whatsapp'};var _0x587354=[];var _0x493e7c=[];var _0x57672d={};return db[_0xbb76('0x41')][_0xbb76('0x63')]({'where':{'id':_0x35e86a[_0xbb76('0x67')]['id']},'include':[{'model':db[_0xbb76('0x82')],'as':_0xbb76('0x8a')}]})[_0xbb76('0x3a')](handleEntityNotFound(_0x1053c0,null))['then'](function(_0x16eb26){_0x568c63[_0xbb76('0x8b')]=_0x16eb26;if(_0x568c63[_0xbb76('0x8b')]&&_0x568c63[_0xbb76('0x8b')]['type']===_0xbb76('0x8c')&&_0x35e86a[_0xbb76('0x5d')][_0xbb76('0x8d')]){if(_0x35e86a[_0xbb76('0x5d')][_0xbb76('0x8d')][_0xbb76('0x4c')]===0x0)return;if(_0x35e86a[_0xbb76('0x5d')][_0xbb76('0x8d')][0x0][_0xbb76('0x8e')]!==_0xbb76('0x8f'))return;return db[_0xbb76('0x90')][_0xbb76('0x39')]({'read':!![],'readAt':_0x35e86a['body'][_0xbb76('0x8d')][0x0][_0xbb76('0x91')]},{'where':{'messageId':_0x35e86a[_0xbb76('0x5d')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x107e0e){return _0x1053c0[_0xbb76('0x31')](0xc8)[_0xbb76('0x32')](_0x107e0e);});}_0x568c63['applications']=_[_0xbb76('0x92')](_0x16eb26[_0xbb76('0x8a')],[_0xbb76('0x85')],[_0xbb76('0x93')]);if(_0x568c63[_0xbb76('0x8b')][_0xbb76('0x8a')]){delete _0x568c63[_0xbb76('0x8b')][_0xbb76('0x8a')];}return db[_0xbb76('0x94')][_0xbb76('0x68')]()['then'](function(_0x409a4e){if(!_0x409a4e){throw new db[(_0xbb76('0x95'))][(_0xbb76('0x96'))](_0xbb76('0x97'));}_0x587354=_[_0xbb76('0x98')](_[_0xbb76('0x46')](_0x409a4e),[_0xbb76('0x99'),_0xbb76('0x9a')]);_0x493e7c=_[_0xbb76('0x98')](_['keys'](_0x409a4e),[_0xbb76('0x99'),_0xbb76('0x9a'),_0xbb76('0x9b'),'ListId']);_0x568c63[_0xbb76('0x5d')]={'mapKey':_0xbb76('0x9c')};if(_0x568c63[_0xbb76('0x8b')]&&_0x568c63[_0xbb76('0x8b')][_0xbb76('0x44')]===_0xbb76('0x9d')){_0x568c63[_0xbb76('0x5d')][_0xbb76('0x9e')]=_0x35e86a['body'][_0xbb76('0x9f')]['replace'](_0xbb76('0xa0'),'');_0x568c63[_0xbb76('0x5d')][_0xbb76('0x5d')]=_0x35e86a[_0xbb76('0x5d')][_0xbb76('0xa1')];_0x568c63[_0xbb76('0x5d')][_0xbb76('0xa2')]=_0x35e86a['body'][_0xbb76('0xa3')];}if(_0x568c63[_0xbb76('0x8b')]&&_0x568c63[_0xbb76('0x8b')][_0xbb76('0x44')]===_0xbb76('0x8c')){_0x568c63[_0xbb76('0x5d')][_0xbb76('0x9e')]=_0x35e86a[_0xbb76('0x5d')][_0xbb76('0xa4')][0x0]['from'];_0x568c63[_0xbb76('0x5d')]['body']=_0x35e86a[_0xbb76('0x5d')][_0xbb76('0xa4')][0x0][_0xbb76('0x2d')][_0xbb76('0x5d')];_0x568c63['body'][_0xbb76('0xa2')]=_0x35e86a[_0xbb76('0x5d')][_0xbb76('0xa4')][0x0]['message_id'];}if(_0x568c63[_0xbb76('0x5d')]['id']){delete _0x568c63[_0xbb76('0x5d')]['id'];}if(_[_0xbb76('0xa5')](_0x568c63[_0xbb76('0x5d')][_0xbb76('0x9e')])){throw new db[(_0xbb76('0x95'))][(_0xbb76('0x96'))](_0xbb76('0xa6'));}if(_[_0xbb76('0xa5')](_0x568c63[_0xbb76('0x5d')]['body'])||_0x568c63[_0xbb76('0x5d')][_0xbb76('0x5d')]===''){throw new db['Sequelize'][(_0xbb76('0x96'))](_0xbb76('0xa7'));}if(_[_0xbb76('0xa5')](_0x568c63[_0xbb76('0x5d')][_0xbb76('0xa8')])){throw new db[(_0xbb76('0x95'))][(_0xbb76('0x96'))](_0xbb76('0xa9')+_0x493e7c);}if(!_[_0xbb76('0xaa')](_0x493e7c,_0x568c63[_0xbb76('0x5d')][_0xbb76('0xa8')])){throw new db[(_0xbb76('0x95'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x493e7c);}_0x57672d[_0x568c63[_0xbb76('0x5d')][_0xbb76('0xa8')]]=_0x568c63['body']['from'];return db[_0xbb76('0xab')][_0xbb76('0x63')]({'where':{'id':_0x568c63['account'][_0xbb76('0xac')]},'include':[{'model':db[_0xbb76('0x94')],'as':_0xbb76('0xad'),'where':_0x57672d,'limit':0x1,'order':[[_0xbb76('0x9a'),_0xbb76('0xae')]]}]});})[_0xbb76('0x3a')](handleEntityNotFound(_0x1053c0,null))[_0xbb76('0x3a')](function(_0x2c2b09){if(_0x2c2b09){_0x568c63[_0xbb76('0xaf')]=_[_0xbb76('0xb0')](_0x2c2b09,[_0xbb76('0xad')]);if(_0x2c2b09[_0xbb76('0xad')][_0xbb76('0x4c')]){return _0x2c2b09[_0xbb76('0xad')][0x0];}var _0x2761e8=_[_0xbb76('0x1d')](_0x568c63[_0xbb76('0x5d')],{'firstName':_0x568c63['body']['from'],'ListId':_0x2c2b09['id']});_0x2761e8[_0x568c63[_0xbb76('0x5d')][_0xbb76('0xa8')]]=_0x568c63['body']['from'];return db[_0xbb76('0x94')]['create'](_0x2761e8,{'fields':_0x587354,'raw':!![]});}})[_0xbb76('0x3a')](handleEntityNotFound(_0x1053c0,null))['then'](function(_0x349096){if(_0x349096){_0x568c63['contact']=_0x349096;var _0x2a20c4={'ContactId':_0x349096['id'],'phone':_0x568c63[_0xbb76('0x5d')]['from'],'WhatsappAccountId':_0x35e86a[_0xbb76('0x67')]['id']};var _0x1d9eaa={'ContactId':_0x349096['id'],'WhatsappAccountId':_0x35e86a['params']['id'],'closed':![]};return db[_0xbb76('0xb1')][_0xbb76('0x63')]({'where':_0x1d9eaa})[_0xbb76('0x3a')](function(_0x85727f){if(_0x85727f){return[_0x85727f,![]];}return db[_0xbb76('0xb1')][_0xbb76('0x5c')](_0x2a20c4)[_0xbb76('0x3a')](function(_0x1c386e){return[_0x1c386e,!![]];});});}})[_0xbb76('0x75')](function(_0x144777,_0x3e2cdf){_0x568c63['interaction']=_0x144777[_0xbb76('0x61')]({'plain':!![]});_0x568c63['interaction'][_0xbb76('0xb2')]=![];if(_0x3e2cdf){if(_0x568c63[_0xbb76('0x8b')]['autoclose']){_0x568c63[_0xbb76('0xb3')]['push']({'id':0x0,'priority':_0x568c63[_0xbb76('0xb3')]['length']+0x1,'app':'close','appdata':_0xbb76('0xb4'),'interval':_0xbb76('0xb5')});}_0x568c63[_0xbb76('0xb6')][_0xbb76('0xb2')]=!![];}return db[_0xbb76('0x90')][_0xbb76('0x5c')]({'phone':_0x568c63[_0xbb76('0x5d')][_0xbb76('0x9e')],'messageId':_0x568c63[_0xbb76('0x5d')]['messageId'],'body':_0x568c63['body'][_0xbb76('0x5d')],'WhatsappAccountId':_0x35e86a['params']['id'],'WhatsappInteractionId':_0x144777['id'],'direction':'in','ContactId':_0x144777[_0xbb76('0xb7')],'AttachmentId':_0x568c63[_0xbb76('0x5d')][_0xbb76('0xb8')]});})[_0xbb76('0x3a')](function(_0x186e5d){_0x568c63['message']=_0x186e5d;if(_0x568c63[_0xbb76('0xb6')][_0xbb76('0xb9')]){return db['User'][_0xbb76('0x63')]({'attributes':['id','name'],'where':{'id':_0x568c63[_0xbb76('0xb6')][_0xbb76('0xb9')]}})['then'](function(_0xcd90ce){if(_0xcd90ce){_0x568c63['applications'][_0xbb76('0xba')]({'id':0x0,'priority':0x0,'app':_0xbb76('0xbb'),'appdata':_0xcd90ce[_0xbb76('0x3e')]+','+(_0x568c63['account']['waitForTheAssignedAgent']||0xa),'interval':_0xbb76('0xb5')});}return respondWithRpcPromise(_0xbb76('0xbc'),_0xbb76('0xbd'),_0x568c63);});}return respondWithRpcPromise(_0xbb76('0xbc'),'startRouting',_0x568c63);})['then'](function(_0x4a09b3){if(_0x4a09b3){var _0x5b148a=0xc8;var _0x3557ce='receiveMessage';logger[_0xbb76('0x26')](_0xbb76('0xbe'),_0x3557ce,_0x5b148a,_0xbb76('0xbf'));logger[_0xbb76('0x28')](_0xbb76('0xc0'),_0x3557ce,_0x5b148a,'entity\x20found',JSON[_0xbb76('0x2a')](_0x4a09b3));if(_0x568c63['account']['type']===_0xbb76('0x9d')){return _0x1053c0[_0xbb76('0x31')](_0x5b148a)[_0xbb76('0xc1')](_0xbb76('0xc2'),'text/xml')[_0xbb76('0x87')](_0xbb76('0xc3'));}else{return _0x1053c0[_0xbb76('0x31')](_0x5b148a)[_0xbb76('0x32')](_0x4a09b3);}}});})['catch'](handleError(_0x1053c0,null));};exports[_0xbb76('0x87')]=function(_0x345320,_0x120c65,_0xb7fd85){var _0x283ed8,_0x741d49,_0x3924f6;if(_[_0xbb76('0xa5')](_0x345320[_0xbb76('0x5d')][_0xbb76('0x5d')])||_0x345320['body'][_0xbb76('0x5d')]===''){throw new db[(_0xbb76('0x95'))][(_0xbb76('0x96'))](_0xbb76('0xa7'));}if(_[_0xbb76('0xa5')](_0x345320['body']['to'])){throw new db[(_0xbb76('0x95'))][(_0xbb76('0x96'))]('to\x20is\x20mandatory');}_0x283ed8=_0x345320[_0xbb76('0x5d')]['to'];return db['WhatsappAccount'][_0xbb76('0x63')]({'where':{'id':_0x345320[_0xbb76('0x67')]['id']},'include':[{'model':db[_0xbb76('0xab')],'as':_0xbb76('0xc4'),'include':[{'model':db['CmContact'],'as':_0xbb76('0xad'),'where':{'mobile':_0x283ed8},'limit':0x1,'order':[[_0xbb76('0x9a'),'DESC']]}]}]})[_0xbb76('0x3a')](handleEntityNotFound(_0x120c65,null))[_0xbb76('0x3a')](function(_0x4162cf){if(_0x4162cf&&_0x4162cf[_0xbb76('0xc4')]){_0x741d49=_0x4162cf['get']({'plain':!![]});if(_0x741d49[_0xbb76('0xc4')]&&_0x741d49[_0xbb76('0xc4')][_0xbb76('0xad')]['length']){return _0x741d49[_0xbb76('0xc4')][_0xbb76('0xad')][0x0];}return db[_0xbb76('0x94')][_0xbb76('0x5c')](_[_0xbb76('0x1d')](_0x345320['body'],{'firstName':_0x283ed8,'mobile':_0x283ed8,'phone':_0x283ed8,'ListId':_0x741d49['ListId']}));}})['then'](handleEntityNotFound(_0x120c65,null))[_0xbb76('0x3a')](function(_0x331866){if(_0x331866){_0x3924f6=_0x331866;return db['WhatsappInteraction'][_0xbb76('0x63')]({'where':{'ContactId':_0x3924f6['id'],'closed':![],'WhatsappAccountId':_0x741d49['id']}})[_0xbb76('0x3a')](function(_0x452090){if(_0x452090){return[_0x452090,![]];}return db['WhatsappInteraction'][_0xbb76('0x5c')]({'UserId':_0x345320[_0xbb76('0x5e')]['id'],'ContactId':_0x3924f6['id'],'WhatsappAccountId':_0x741d49['id'],'phone':_0x283ed8,'firstMsgDirection':_0xbb76('0xc5'),'Messages':[_['merge'](_0x345320[_0xbb76('0x5d')],{'read':![],'body':_0x345320[_0xbb76('0x5d')][_0xbb76('0x5d')],'phone':_0x283ed8,'WhatsappAccountId':_0x741d49['id'],'UserId':_0x345320['user']['id'],'ContactId':_0x3924f6['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xbb76('0xc6')}]})[_0xbb76('0x3a')](function(_0x5b079b){return[_0x5b079b,!![]];});});}})[_0xbb76('0x75')](function(_0x5dfa56,_0x21dc9e){if(_0x21dc9e){return _0x5dfa56;}return db[_0xbb76('0x90')][_0xbb76('0x5c')](_[_0xbb76('0x51')](_0x345320[_0xbb76('0x5d')],{'read':![],'body':_0x345320['body'][_0xbb76('0x5d')],'phone':_0x283ed8,'WhatsappAccountId':_0x741d49['id'],'WhatsappInteractionId':_0x5dfa56['id'],'UserId':_0x345320[_0xbb76('0x5e')]['id'],'ContactId':_0x3924f6['id']}))[_0xbb76('0x3a')](function(_0x10a6d7){_0x5dfa56[_0xbb76('0xc7')][_0xbb76('0xc6')]=[];_0x5dfa56[_0xbb76('0xc7')][_0xbb76('0xc6')]['push'](_0x10a6d7[_0xbb76('0xc7')]);return _0x5dfa56;});})['then'](respondWithResult(_0x120c65,null))[_0xbb76('0x58')](handleError(_0x120c65,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b1e9bbd..4d90f5e 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c2c=['remove','emit','hook','events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6c2c,0x1d4));var _0xc6c2=function(_0x1bd0e4,_0x4f409a){_0x1bd0e4=_0x1bd0e4-0x0;var _0x5a6833=_0x6c2c[_0x1bd0e4];return _0x5a6833;};'use strict';var EventEmitter=require(_0xc6c2('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc6c2('0x1'),'afterUpdate':'update','afterDestroy':_0xc6c2('0x2')};function emitEvent(_0x4a1f73){return function(_0x5f4760,_0x2ec264,_0x2825c8){WhatsappAccountEvents[_0xc6c2('0x3')](_0x4a1f73+':'+_0x5f4760['id'],_0x5f4760);WhatsappAccountEvents[_0xc6c2('0x3')](_0x4a1f73,_0x5f4760);_0x2825c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xc6c2('0x4')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xb150=['events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xb150,0x195));var _0x0b15=function(_0x446b5b,_0x3b40cc){_0x446b5b=_0x446b5b-0x0;var _0xd988d8=_0xb150[_0x446b5b];return _0xd988d8;};'use strict';var EventEmitter=require(_0x0b15('0x0'));var WhatsappAccount=require(_0x0b15('0x1'))['db'][_0x0b15('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0b15('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b15('0x4'),'afterDestroy':_0x0b15('0x5')};function emitEvent(_0x7cde7b){return function(_0x40c5dc,_0x382781,_0x7c01f){WhatsappAccountEvents[_0x0b15('0x6')](_0x7cde7b+':'+_0x40c5dc['id'],_0x40c5dc);WhatsappAccountEvents[_0x0b15('0x6')](_0x7cde7b,_0x40c5dc);_0x7c01f(null);};}for(var e in events){if(events[_0x0b15('0x7')](e)){var event=events[e];WhatsappAccount[_0x0b15('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 9c18d0e..d7fbf2d 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ee8=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes'];(function(_0x2ab13f,_0x1d968f){var _0x23c45d=function(_0x3342b6){while(--_0x3342b6){_0x2ab13f['push'](_0x2ab13f['shift']());}};_0x23c45d(++_0x1d968f);}(_0x3ee8,0x170));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83ee('0x0'));var util=require(_0x83ee('0x1'));var logger=require(_0x83ee('0x2'))(_0x83ee('0x3'));var moment=require(_0x83ee('0x4'));var BPromise=require(_0x83ee('0x5'));var rp=require(_0x83ee('0x6'));var fs=require('fs');var path=require(_0x83ee('0x7'));var rimraf=require('rimraf');var config=require(_0x83ee('0x8'));var attributes=require(_0x83ee('0x9'));module[_0x83ee('0xa')]=function(_0x20e06a,_0x4fd393){return _0x20e06a[_0x83ee('0xb')](_0x83ee('0xc'),attributes,{'tableName':_0x83ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf474=['request-promise','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','../../config/logger','bluebird'];(function(_0x79164,_0x344e6){var _0xfda909=function(_0x162e37){while(--_0x162e37){_0x79164['push'](_0x79164['shift']());}};_0xfda909(++_0x344e6);}(_0xf474,0xb1));var _0x4f47=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xf474[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x4f47('0x0'));var util=require('util');var logger=require(_0x4f47('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4f47('0x2'));var rp=require(_0x4f47('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f47('0x4'));var attributes=require(_0x4f47('0x5'));module[_0x4f47('0x6')]=function(_0x33f2e8,_0x1012a9){return _0x33f2e8[_0x4f47('0x7')](_0x4f47('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index f9c6b62..2c4a87b 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e00=['include','map','attributes','model','debug','lodash','util','bluebird','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ShowWhatsappAccount','options'];(function(_0x3715d7,_0x5c6f48){var _0x2316c5=function(_0x2e8287){while(--_0x2e8287){_0x3715d7['push'](_0x3715d7['shift']());}};_0x2316c5(++_0x5c6f48);}(_0x9e00,0x1b8));var _0x09e0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9e00[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x09e0('0x0'));var util=require(_0x09e0('0x1'));var moment=require('moment');var BPromise=require(_0x09e0('0x2'));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(_0x09e0('0x3'))('rpc');var config=require(_0x09e0('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x09e0('0x5')][_0x09e0('0x6')]({'port':0x232a});config[_0x09e0('0x7')]=_[_0x09e0('0x8')](config[_0x09e0('0x7')],{'host':_0x09e0('0x9'),'port':0x18eb});var socket=require(_0x09e0('0xa'))(new Redis(config[_0x09e0('0x7')]));require(_0x09e0('0xb'))['register'](socket);function respondWithRpcPromise(_0x2c7acb,_0x583781,_0xde7c72){return new BPromise(function(_0x92de0b,_0x4c9fb3){return client[_0x09e0('0xc')](_0x2c7acb,_0xde7c72)[_0x09e0('0xd')](function(_0x71b9f){logger['info'](_0x09e0('0xe'),_0x583781,_0x09e0('0xf'));logger['debug'](_0x09e0('0x10'),_0x583781,_0x09e0('0xf'),JSON[_0x09e0('0x11')](_0x71b9f));if(_0x71b9f['error']){if(_0x71b9f[_0x09e0('0x12')]['code']===0x1f4){logger['error'](_0x09e0('0xe'),_0x583781,_0x71b9f[_0x09e0('0x12')]['message']);return _0x4c9fb3(_0x71b9f[_0x09e0('0x12')]['message']);}logger['error'](_0x09e0('0xe'),_0x583781,_0x71b9f[_0x09e0('0x12')][_0x09e0('0x13')]);return _0x92de0b(_0x71b9f['error'][_0x09e0('0x13')]);}else{logger[_0x09e0('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x583781,_0x09e0('0xf'));_0x92de0b(_0x71b9f['result']['message']);}})[_0x09e0('0x15')](function(_0x14b850){logger[_0x09e0('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x583781,_0x14b850);_0x4c9fb3(_0x14b850);});});}exports[_0x09e0('0x16')]=function(_0x5f20be){var _0x433b52=this;return new Promise(function(_0x265796,_0x2371bb){return db['WhatsappAccount']['find']({'raw':_0x5f20be[_0x09e0('0x17')]?_0x5f20be[_0x09e0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5f20be['options']?_0x5f20be[_0x09e0('0x17')]['where']||null:null,'attributes':_0x5f20be[_0x09e0('0x17')]?_0x5f20be['options']['attributes']||null:null,'include':_0x5f20be[_0x09e0('0x17')]?_0x5f20be['options'][_0x09e0('0x18')]?_[_0x09e0('0x19')](_0x5f20be[_0x09e0('0x17')][_0x09e0('0x18')],function(_0x15370a){return{'model':db[_0x15370a['model']],'as':_0x15370a['as'],'attributes':_0x15370a[_0x09e0('0x1a')],'include':_0x15370a[_0x09e0('0x18')]?_[_0x09e0('0x19')](_0x15370a[_0x09e0('0x18')],function(_0x540ddd){return{'model':db[_0x540ddd[_0x09e0('0x1b')]],'as':_0x540ddd['as'],'attributes':_0x540ddd[_0x09e0('0x1a')],'include':_0x540ddd[_0x09e0('0x18')]?_[_0x09e0('0x19')](_0x540ddd[_0x09e0('0x18')],function(_0x40d645){return{'model':db[_0x40d645[_0x09e0('0x1b')]],'as':_0x40d645['as'],'attributes':_0x40d645[_0x09e0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x09e0('0xd')](function(_0x4331d8){logger[_0x09e0('0x14')](_0x09e0('0x16'),_0x5f20be);logger[_0x09e0('0x1c')](_0x09e0('0x16'),_0x5f20be,JSON[_0x09e0('0x11')](_0x4331d8));_0x265796(_0x4331d8);})[_0x09e0('0x15')](function(_0x7b15d3){logger['error']('ShowWhatsappAccount',_0x7b15d3[_0x09e0('0x13')],_0x5f20be);_0x2371bb(_0x433b52[_0x09e0('0x12')](0x1f4,_0x7b15d3[_0x09e0('0x13')]));});});}; \ No newline at end of file +var _0x2fed=['localhost','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','attributes','map','include','model','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults'];(function(_0x519999,_0x14ef9a){var _0x8a0b1d=function(_0x382e0d){while(--_0x382e0d){_0x519999['push'](_0x519999['shift']());}};_0x8a0b1d(++_0x14ef9a);}(_0x2fed,0x11b));var _0xd2fe=function(_0x51b678,_0x54288f){_0x51b678=_0x51b678-0x0;var _0x4a6b9e=_0x2fed[_0x51b678];return _0x4a6b9e;};'use strict';var _=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var moment=require(_0xd2fe('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2fe('0x3'));var fs=require('fs');var Redis=require(_0xd2fe('0x4'));var db=require(_0xd2fe('0x5'))['db'];var utils=require(_0xd2fe('0x6'));var logger=require(_0xd2fe('0x7'))(_0xd2fe('0x8'));var config=require(_0xd2fe('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd2fe('0xa')]({'port':0x232a});config[_0xd2fe('0xb')]=_[_0xd2fe('0xc')](config[_0xd2fe('0xb')],{'host':_0xd2fe('0xd'),'port':0x18eb});var socket=require(_0xd2fe('0xe'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xd2fe('0xf')](socket);function respondWithRpcPromise(_0x342018,_0x1a55f7,_0x465c9b){return new BPromise(function(_0xcb4ff8,_0x31d3e9){return client[_0xd2fe('0x10')](_0x342018,_0x465c9b)['then'](function(_0x38c41e){logger[_0xd2fe('0x11')](_0xd2fe('0x12'),_0x1a55f7,_0xd2fe('0x13'));logger['debug'](_0xd2fe('0x14'),_0x1a55f7,_0xd2fe('0x13'),JSON[_0xd2fe('0x15')](_0x38c41e));if(_0x38c41e[_0xd2fe('0x16')]){if(_0x38c41e['error'][_0xd2fe('0x17')]===0x1f4){logger[_0xd2fe('0x16')](_0xd2fe('0x12'),_0x1a55f7,_0x38c41e[_0xd2fe('0x16')][_0xd2fe('0x18')]);return _0x31d3e9(_0x38c41e[_0xd2fe('0x16')][_0xd2fe('0x18')]);}logger[_0xd2fe('0x16')](_0xd2fe('0x12'),_0x1a55f7,_0x38c41e[_0xd2fe('0x16')][_0xd2fe('0x18')]);return _0xcb4ff8(_0x38c41e['error'][_0xd2fe('0x18')]);}else{logger[_0xd2fe('0x11')](_0xd2fe('0x12'),_0x1a55f7,'request\x20sent');_0xcb4ff8(_0x38c41e[_0xd2fe('0x19')][_0xd2fe('0x18')]);}})[_0xd2fe('0x1a')](function(_0x742479){logger[_0xd2fe('0x16')](_0xd2fe('0x12'),_0x1a55f7,_0x742479);_0x31d3e9(_0x742479);});});}exports[_0xd2fe('0x1b')]=function(_0x59e67b){var _0x2a1478=this;return new Promise(function(_0x2659b8,_0x34c26b){return db['WhatsappAccount'][_0xd2fe('0x1c')]({'raw':_0x59e67b['options']?_0x59e67b[_0xd2fe('0x1d')][_0xd2fe('0x1e')]===undefined?!![]:![]:!![],'where':_0x59e67b[_0xd2fe('0x1d')]?_0x59e67b[_0xd2fe('0x1d')]['where']||null:null,'attributes':_0x59e67b['options']?_0x59e67b[_0xd2fe('0x1d')][_0xd2fe('0x1f')]||null:null,'include':_0x59e67b[_0xd2fe('0x1d')]?_0x59e67b['options']['include']?_[_0xd2fe('0x20')](_0x59e67b[_0xd2fe('0x1d')][_0xd2fe('0x21')],function(_0xf3f54b){return{'model':db[_0xf3f54b[_0xd2fe('0x22')]],'as':_0xf3f54b['as'],'attributes':_0xf3f54b[_0xd2fe('0x1f')],'include':_0xf3f54b[_0xd2fe('0x21')]?_[_0xd2fe('0x20')](_0xf3f54b['include'],function(_0x472781){return{'model':db[_0x472781[_0xd2fe('0x22')]],'as':_0x472781['as'],'attributes':_0x472781[_0xd2fe('0x1f')],'include':_0x472781[_0xd2fe('0x21')]?_['map'](_0x472781['include'],function(_0x17bc94){return{'model':db[_0x17bc94['model']],'as':_0x17bc94['as'],'attributes':_0x17bc94[_0xd2fe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd2fe('0x23')](function(_0x33450a){logger[_0xd2fe('0x11')](_0xd2fe('0x1b'),_0x59e67b);logger[_0xd2fe('0x24')](_0xd2fe('0x1b'),_0x59e67b,JSON[_0xd2fe('0x15')](_0x33450a));_0x2659b8(_0x33450a);})[_0xd2fe('0x1a')](function(_0x593100){logger[_0xd2fe('0x16')](_0xd2fe('0x1b'),_0x593100[_0xd2fe('0x18')],_0x59e67b);_0x34c26b(_0x2a1478[_0xd2fe('0x16')](0x1f4,_0x593100[_0xd2fe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index f1334f4..f8dd1ff 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c30=['whatsappAccount:','remove','update'];(function(_0xb2d17c,_0x487d49){var _0x576b82=function(_0x2df26d){while(--_0x2df26d){_0xb2d17c['push'](_0xb2d17c['shift']());}};_0x576b82(++_0x487d49);}(_0x7c30,0x142));var _0x07c3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7c30[_0x21a9d9];return _0x46adce;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x07c3('0x0'),_0x07c3('0x1')];function createListener(_0x2a2e87,_0x4a654b){return function(_0x4c92cd){_0x4a654b['emit'](_0x2a2e87,_0x4c92cd);};}function removeListener(_0x15c0a0,_0x5d742c){return function(){WhatsappAccountEvents['removeListener'](_0x15c0a0,_0x5d742c);};}exports['register']=function(_0x44df31){for(var _0x220ce4=0x0,_0x39ea48=events['length'];_0x220ce4<_0x39ea48;_0x220ce4++){var _0x21cc55=events[_0x220ce4];var _0x40992b=createListener(_0x07c3('0x2')+_0x21cc55,_0x44df31);WhatsappAccountEvents['on'](_0x21cc55,_0x40992b);}}; \ No newline at end of file +var _0xa290=['update','removeListener','register','length','whatsappAccount:','save','remove'];(function(_0x3b29d5,_0x12faa2){var _0x20b96d=function(_0x284207){while(--_0x284207){_0x3b29d5['push'](_0x3b29d5['shift']());}};_0x20b96d(++_0x12faa2);}(_0xa290,0x139));var _0x0a29=function(_0x5b05bc,_0x2ad09d){_0x5b05bc=_0x5b05bc-0x0;var _0x153881=_0xa290[_0x5b05bc];return _0x153881;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x0a29('0x0'),_0x0a29('0x1'),_0x0a29('0x2')];function createListener(_0x35042c,_0x3e9e74){return function(_0x46a461){_0x3e9e74['emit'](_0x35042c,_0x46a461);};}function removeListener(_0x11ed4d,_0x11d41a){return function(){WhatsappAccountEvents[_0x0a29('0x3')](_0x11ed4d,_0x11d41a);};}exports[_0x0a29('0x4')]=function(_0x1d183a){for(var _0x2762e2=0x0,_0x10ba54=events[_0x0a29('0x5')];_0x2762e2<_0x10ba54;_0x2762e2++){var _0x5cdb2b=events[_0x2762e2];var _0x1271f4=createListener(_0x0a29('0x6')+_0x5cdb2b,_0x1d183a);WhatsappAccountEvents['on'](_0x5cdb2b,_0x1271f4);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b48b721..4a50576 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d4e=['get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x8d4e,0xdc));var _0xe8d4=function(_0x58f48f,_0x2f36e1){_0x58f48f=_0x58f48f-0x0;var _0x59c595=_0x8d4e[_0x58f48f];return _0x59c595;};'use strict';var multer=require(_0xe8d4('0x0'));var util=require(_0xe8d4('0x1'));var path=require(_0xe8d4('0x2'));var timeout=require(_0xe8d4('0x3'));var express=require(_0xe8d4('0x4'));var router=express[_0xe8d4('0x5')]();var fs_extra=require(_0xe8d4('0x6'));var auth=require(_0xe8d4('0x7'));var interaction=require(_0xe8d4('0x8'));var config=require(_0xe8d4('0x9'));var controller=require(_0xe8d4('0xa'));router[_0xe8d4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe8d4('0xb')](_0xe8d4('0xc'),auth['isAuthenticated'](),controller[_0xe8d4('0xd')]);router[_0xe8d4('0xe')]('/',auth[_0xe8d4('0xf')](),controller[_0xe8d4('0x10')]);router[_0xe8d4('0x11')](_0xe8d4('0xc'),auth[_0xe8d4('0xf')](),controller[_0xe8d4('0x12')]);router[_0xe8d4('0x13')](_0xe8d4('0xc'),auth[_0xe8d4('0xf')](),controller['destroy']);module[_0xe8d4('0x14')]=router; \ No newline at end of file +var _0xa4e6=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post'];(function(_0x33acd5,_0x33fd24){var _0x3850dc=function(_0x1d74a8){while(--_0x1d74a8){_0x33acd5['push'](_0x33acd5['shift']());}};_0x3850dc(++_0x33fd24);}(_0xa4e6,0xe1));var _0x6a4e=function(_0xbfd132,_0x47c55e){_0xbfd132=_0xbfd132-0x0;var _0x272166=_0xa4e6[_0xbfd132];return _0x272166;};'use strict';var multer=require('multer');var util=require(_0x6a4e('0x0'));var path=require(_0x6a4e('0x1'));var timeout=require(_0x6a4e('0x2'));var express=require(_0x6a4e('0x3'));var router=express[_0x6a4e('0x4')]();var fs_extra=require(_0x6a4e('0x5'));var auth=require(_0x6a4e('0x6'));var interaction=require(_0x6a4e('0x7'));var config=require(_0x6a4e('0x8'));var controller=require(_0x6a4e('0x9'));router[_0x6a4e('0xa')]('/',auth[_0x6a4e('0xb')](),controller[_0x6a4e('0xc')]);router[_0x6a4e('0xa')](_0x6a4e('0xd'),auth[_0x6a4e('0xb')](),controller['show']);router[_0x6a4e('0xe')]('/',auth['isAuthenticated'](),controller[_0x6a4e('0xf')]);router[_0x6a4e('0x10')](_0x6a4e('0xd'),auth[_0x6a4e('0xb')](),controller[_0x6a4e('0x11')]);router[_0x6a4e('0x12')]('/:id',auth[_0x6a4e('0xb')](),controller['destroy']);module[_0x6a4e('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 9327088..e379ab3 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e38=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x7e38,0x14f));var _0x87e3=function(_0x5bb920,_0x3ddd96){_0x5bb920=_0x5bb920-0x0;var _0x5df5dd=_0x7e38[_0x5bb920];return _0x5df5dd;};'use strict';var Sequelize=require(_0x87e3('0x0'));module[_0x87e3('0x1')]={'priority':{'type':Sequelize[_0x87e3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x87e3('0x3')],'allowNull':![],'defaultValue':_0x87e3('0x4')},'appdata':{'type':Sequelize[_0x87e3('0x5')]()},'description':{'type':Sequelize[_0x87e3('0x3')]},'interval':{'type':Sequelize[_0x87e3('0x3')],'defaultValue':_0x87e3('0x6')}}; \ No newline at end of file +var _0x1a16=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x117576,_0x1ced1a){var _0x4533f5=function(_0x19bc33){while(--_0x19bc33){_0x117576['push'](_0x117576['shift']());}};_0x4533f5(++_0x1ced1a);}(_0x1a16,0xe2));var _0x61a1=function(_0x3ee336,_0x251cfc){_0x3ee336=_0x3ee336-0x0;var _0x204647=_0x1a16[_0x3ee336];return _0x204647;};'use strict';var Sequelize=require(_0x61a1('0x0'));module[_0x61a1('0x1')]={'priority':{'type':Sequelize[_0x61a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x61a1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x61a1('0x4')]()},'description':{'type':Sequelize[_0x61a1('0x3')]},'interval':{'type':Sequelize[_0x61a1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 5caa4a2..4de5879 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48ac=['body','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','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','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','end','error','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','length','find','create'];(function(_0x188cb8,_0x3b12b3){var _0x25eb9b=function(_0x11770b){while(--_0x11770b){_0x188cb8['push'](_0x188cb8['shift']());}};_0x25eb9b(++_0x3b12b3);}(_0x48ac,0xe0));var _0xc48a=function(_0x326088,_0xe219e4){_0x326088=_0x326088-0x0;var _0x24d8f1=_0x48ac[_0x326088];return _0x24d8f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc48a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc48a('0x1'));var rp=require(_0xc48a('0x2'));var moment=require(_0xc48a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc48a('0x4'));var util=require(_0xc48a('0x5'));var path=require(_0xc48a('0x6'));var sox=require(_0xc48a('0x7'));var csv=require(_0xc48a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc48a('0x9'));var jsforce=require(_0xc48a('0xa'));var deskjs=require(_0xc48a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc48a('0xc'));var Papa=require(_0xc48a('0xd'));var Redis=require(_0xc48a('0xe'));var authService=require(_0xc48a('0xf'));var qs=require(_0xc48a('0x10'));var as=require(_0xc48a('0x11'));var hardwareService=require(_0xc48a('0x12'));var logger=require(_0xc48a('0x13'))(_0xc48a('0x14'));var utils=require(_0xc48a('0x15'));var config=require(_0xc48a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc48a('0x17'))['db'];function respondWithStatusCode(_0x161274,_0x202ba9){_0x202ba9=_0x202ba9||0xcc;return function(_0x5580dd){if(_0x5580dd){return _0x161274[_0xc48a('0x18')](_0x202ba9);}return _0x161274[_0xc48a('0x19')](_0x202ba9)['end']();};}function respondWithResult(_0x2852b0,_0x250d63){_0x250d63=_0x250d63||0xc8;return function(_0x286f42){if(_0x286f42){return _0x2852b0['status'](_0x250d63)[_0xc48a('0x1a')](_0x286f42);}};}function respondWithFilteredResult(_0x70c92f,_0x37d5d2){return function(_0x50f232){if(_0x50f232){var _0x38abb3=typeof _0x37d5d2[_0xc48a('0x1b')]==='undefined'&&typeof _0x37d5d2['limit']===_0xc48a('0x1c');var _0x5c5291=_0x50f232[_0xc48a('0x1d')];var _0x29a1ad=_0x38abb3?0x0:_0x37d5d2[_0xc48a('0x1b')];var _0x462102=_0x38abb3?_0x50f232[_0xc48a('0x1d')]:_0x37d5d2[_0xc48a('0x1b')]+_0x37d5d2[_0xc48a('0x1e')];var _0x4e5f52;if(_0x462102>=_0x5c5291){_0x462102=_0x5c5291;_0x4e5f52=0xc8;}else{_0x4e5f52=0xce;}_0x70c92f[_0xc48a('0x19')](_0x4e5f52);return _0x70c92f[_0xc48a('0x1f')]('Content-Range',_0x29a1ad+'-'+_0x462102+'/'+_0x5c5291)[_0xc48a('0x1a')](_0x50f232);}return null;};}function patchUpdates(_0x4e6e15){return function(_0x2b7dfa){try{jsonpatch['apply'](_0x2b7dfa,_0x4e6e15,!![]);}catch(_0x303381){return BPromise[_0xc48a('0x20')](_0x303381);}return _0x2b7dfa[_0xc48a('0x21')]();};}function saveUpdates(_0x4f5a55,_0x2a3380){return function(_0x3e24f5){if(_0x3e24f5){return _0x3e24f5[_0xc48a('0x22')](_0x4f5a55)[_0xc48a('0x23')](function(_0x1bb0f3){return _0x1bb0f3;});}return null;};}function removeEntity(_0x3201bc,_0x112874){return function(_0x4bc55b){if(_0x4bc55b){return _0x4bc55b['destroy']()[_0xc48a('0x23')](function(){_0x3201bc[_0xc48a('0x19')](0xcc)[_0xc48a('0x24')]();});}};}function handleEntityNotFound(_0x1e3618,_0x5b63aa){return function(_0x5c5d61){if(!_0x5c5d61){_0x1e3618[_0xc48a('0x18')](0x194);}return _0x5c5d61;};}function handleError(_0xa8c195,_0x20709c){_0x20709c=_0x20709c||0x1f4;return function(_0x4ecdaf){logger[_0xc48a('0x25')](_0x4ecdaf[_0xc48a('0x26')]);if(_0x4ecdaf[_0xc48a('0x27')]){delete _0x4ecdaf[_0xc48a('0x27')];}_0xa8c195[_0xc48a('0x19')](_0x20709c)[_0xc48a('0x28')](_0x4ecdaf);};}exports[_0xc48a('0x29')]=function(_0x335532,_0x3b75db){var _0x45747f={},_0x5da24d={},_0x5bf78a={'count':0x0,'rows':[]};var _0x836fa9=_['map'](db[_0xc48a('0x2a')][_0xc48a('0x2b')],function(_0x5ae94f){return{'name':_0x5ae94f[_0xc48a('0x2c')],'type':_0x5ae94f[_0xc48a('0x2d')][_0xc48a('0x2e')]};});_0x5da24d['model']=_[_0xc48a('0x2f')](_0x836fa9,_0xc48a('0x27'));_0x5da24d['query']=_[_0xc48a('0x30')](_0x335532[_0xc48a('0x31')]);_0x5da24d[_0xc48a('0x32')]=_[_0xc48a('0x33')](_0x5da24d[_0xc48a('0x34')],_0x5da24d['query']);_0x45747f[_0xc48a('0x35')]=_[_0xc48a('0x33')](_0x5da24d[_0xc48a('0x34')],qs[_0xc48a('0x36')](_0x335532[_0xc48a('0x31')][_0xc48a('0x36')]));_0x45747f[_0xc48a('0x35')]=_0x45747f[_0xc48a('0x35')]['length']?_0x45747f[_0xc48a('0x35')]:_0x5da24d[_0xc48a('0x34')];if(!_0x335532[_0xc48a('0x31')][_0xc48a('0x37')](_0xc48a('0x38'))){_0x45747f[_0xc48a('0x1e')]=qs[_0xc48a('0x1e')](_0x335532['query'][_0xc48a('0x1e')]);_0x45747f[_0xc48a('0x1b')]=qs[_0xc48a('0x1b')](_0x335532[_0xc48a('0x31')]['offset']);}_0x45747f[_0xc48a('0x39')]=qs[_0xc48a('0x3a')](_0x335532['query'][_0xc48a('0x3a')]);_0x45747f['where']=qs[_0xc48a('0x32')](_['pick'](_0x335532['query'],_0x5da24d[_0xc48a('0x32')]),_0x836fa9);if(_0x335532[_0xc48a('0x31')]['filter']){_0x45747f[_0xc48a('0x3b')]=_[_0xc48a('0x3c')](_0x45747f[_0xc48a('0x3b')],{'$or':_[_0xc48a('0x2f')](_0x836fa9,function(_0x5b5cd8){if(_0x5b5cd8[_0xc48a('0x2d')]!==_0xc48a('0x3d')){var _0x2b3643={};_0x2b3643[_0x5b5cd8[_0xc48a('0x27')]]={'$like':'%'+_0x335532['query'][_0xc48a('0x3e')]+'%'};return _0x2b3643;}})});}_0x45747f=_['merge']({},_0x45747f,_0x335532[_0xc48a('0x3f')]);var _0x384cd6={'where':_0x45747f[_0xc48a('0x3b')]};return db[_0xc48a('0x2a')][_0xc48a('0x1d')](_0x384cd6)[_0xc48a('0x23')](function(_0x536476){_0x5bf78a[_0xc48a('0x1d')]=_0x536476;if(_0x335532[_0xc48a('0x31')][_0xc48a('0x40')]){_0x45747f[_0xc48a('0x41')]=[{'all':!![]}];}return db[_0xc48a('0x2a')]['findAll'](_0x45747f);})[_0xc48a('0x23')](function(_0x2f0282){_0x5bf78a[_0xc48a('0x42')]=_0x2f0282;return _0x5bf78a;})['then'](respondWithFilteredResult(_0x3b75db,_0x45747f))[_0xc48a('0x43')](handleError(_0x3b75db,null));};exports['show']=function(_0x5caf9a,_0x373ef3){var _0x4631f3={'raw':!![],'where':{'id':_0x5caf9a[_0xc48a('0x44')]['id']}},_0x32d7e3={};_0x32d7e3[_0xc48a('0x34')]=_[_0xc48a('0x30')](db[_0xc48a('0x2a')]['rawAttributes']);_0x32d7e3['query']=_['keys'](_0x5caf9a[_0xc48a('0x31')]);_0x32d7e3[_0xc48a('0x32')]=_[_0xc48a('0x33')](_0x32d7e3[_0xc48a('0x34')],_0x32d7e3[_0xc48a('0x31')]);_0x4631f3[_0xc48a('0x35')]=_[_0xc48a('0x33')](_0x32d7e3[_0xc48a('0x34')],qs[_0xc48a('0x36')](_0x5caf9a[_0xc48a('0x31')][_0xc48a('0x36')]));_0x4631f3['attributes']=_0x4631f3[_0xc48a('0x35')][_0xc48a('0x45')]?_0x4631f3[_0xc48a('0x35')]:_0x32d7e3[_0xc48a('0x34')];if(_0x5caf9a[_0xc48a('0x31')][_0xc48a('0x40')]){_0x4631f3[_0xc48a('0x41')]=[{'all':!![]}];}_0x4631f3=_[_0xc48a('0x3c')]({},_0x4631f3,_0x5caf9a[_0xc48a('0x3f')]);return db['WhatsappApplication'][_0xc48a('0x46')](_0x4631f3)[_0xc48a('0x23')](handleEntityNotFound(_0x373ef3,null))[_0xc48a('0x23')](respondWithResult(_0x373ef3,null))[_0xc48a('0x43')](handleError(_0x373ef3,null));};exports['create']=function(_0x303414,_0x3610d6){return db['WhatsappApplication'][_0xc48a('0x47')](_0x303414[_0xc48a('0x48')],{})[_0xc48a('0x23')](respondWithResult(_0x3610d6,0xc9))[_0xc48a('0x43')](handleError(_0x3610d6,null));};exports['update']=function(_0xd256f3,_0xd0dc5){if(_0xd256f3[_0xc48a('0x48')]['id']){delete _0xd256f3[_0xc48a('0x48')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0xd256f3['params']['id']}})[_0xc48a('0x23')](handleEntityNotFound(_0xd0dc5,null))[_0xc48a('0x23')](saveUpdates(_0xd256f3['body'],null))[_0xc48a('0x23')](respondWithResult(_0xd0dc5,null))['catch'](handleError(_0xd0dc5,null));};exports[_0xc48a('0x49')]=function(_0x154d93,_0x36b072){return db[_0xc48a('0x2a')][_0xc48a('0x46')]({'where':{'id':_0x154d93[_0xc48a('0x44')]['id']}})[_0xc48a('0x23')](handleEntityNotFound(_0x36b072,null))[_0xc48a('0x23')](removeEntity(_0x36b072,null))[_0xc48a('0x43')](handleError(_0x36b072,null));}; \ No newline at end of file +var _0x6691=['filter','merge','options','WhatsappApplication','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5c0c1a,_0x24ae6f){var _0x7d67f1=function(_0x5c7774){while(--_0x5c7774){_0x5c0c1a['push'](_0x5c0c1a['shift']());}};_0x7d67f1(++_0x24ae6f);}(_0x6691,0x12d));var _0x1669=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6691[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x1669('0x0'));var rimraf=require(_0x1669('0x1'));var zipdir=require(_0x1669('0x2'));var jsonpatch=require(_0x1669('0x3'));var rp=require(_0x1669('0x4'));var moment=require(_0x1669('0x5'));var BPromise=require(_0x1669('0x6'));var Mustache=require(_0x1669('0x7'));var util=require(_0x1669('0x8'));var path=require(_0x1669('0x9'));var sox=require('sox');var csv=require(_0x1669('0xa'));var ejs=require(_0x1669('0xb'));var fs=require('fs');var fs_extra=require(_0x1669('0xc'));var _=require(_0x1669('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1669('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1669('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1669('0x10'));var as=require(_0x1669('0x11'));var hardwareService=require(_0x1669('0x12'));var logger=require(_0x1669('0x13'))(_0x1669('0x14'));var utils=require(_0x1669('0x15'));var config=require(_0x1669('0x16'));var licenseUtil=require(_0x1669('0x17'));var db=require(_0x1669('0x18'))['db'];function respondWithStatusCode(_0x46352e,_0x3709f0){_0x3709f0=_0x3709f0||0xcc;return function(_0x2031eb){if(_0x2031eb){return _0x46352e[_0x1669('0x19')](_0x3709f0);}return _0x46352e[_0x1669('0x1a')](_0x3709f0)[_0x1669('0x1b')]();};}function respondWithResult(_0x355ac3,_0x102193){_0x102193=_0x102193||0xc8;return function(_0x2904b6){if(_0x2904b6){return _0x355ac3[_0x1669('0x1a')](_0x102193)[_0x1669('0x1c')](_0x2904b6);}};}function respondWithFilteredResult(_0x14eb3e,_0x31b2be){return function(_0x1f9ea6){if(_0x1f9ea6){var _0x4d2f66=typeof _0x31b2be[_0x1669('0x1d')]===_0x1669('0x1e')&&typeof _0x31b2be[_0x1669('0x1f')]===_0x1669('0x1e');var _0x285d86=_0x1f9ea6['count'];var _0x56e3d9=_0x4d2f66?0x0:_0x31b2be[_0x1669('0x1d')];var _0x31600f=_0x4d2f66?_0x1f9ea6[_0x1669('0x20')]:_0x31b2be[_0x1669('0x1d')]+_0x31b2be[_0x1669('0x1f')];var _0x64edff;if(_0x31600f>=_0x285d86){_0x31600f=_0x285d86;_0x64edff=0xc8;}else{_0x64edff=0xce;}_0x14eb3e[_0x1669('0x1a')](_0x64edff);return _0x14eb3e['set'](_0x1669('0x21'),_0x56e3d9+'-'+_0x31600f+'/'+_0x285d86)[_0x1669('0x1c')](_0x1f9ea6);}return null;};}function patchUpdates(_0x51297e){return function(_0x3dc48a){try{jsonpatch[_0x1669('0x22')](_0x3dc48a,_0x51297e,!![]);}catch(_0x4e1b1b){return BPromise[_0x1669('0x23')](_0x4e1b1b);}return _0x3dc48a[_0x1669('0x24')]();};}function saveUpdates(_0x2e95c3,_0x17c227){return function(_0x311f56){if(_0x311f56){return _0x311f56['update'](_0x2e95c3)[_0x1669('0x25')](function(_0x457973){return _0x457973;});}return null;};}function removeEntity(_0x344eaf,_0x5796f2){return function(_0x176b4b){if(_0x176b4b){return _0x176b4b['destroy']()['then'](function(){_0x344eaf[_0x1669('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304b25,_0x3ce429){return function(_0x1ab80f){if(!_0x1ab80f){_0x304b25[_0x1669('0x19')](0x194);}return _0x1ab80f;};}function handleError(_0x50abe4,_0x660cc7){_0x660cc7=_0x660cc7||0x1f4;return function(_0x5283da){logger['error'](_0x5283da[_0x1669('0x26')]);if(_0x5283da['name']){delete _0x5283da[_0x1669('0x27')];}_0x50abe4[_0x1669('0x1a')](_0x660cc7)['send'](_0x5283da);};}exports[_0x1669('0x28')]=function(_0x590053,_0x29aff9){var _0x1512e2={},_0x31f4f0={},_0x3fe045={'count':0x0,'rows':[]};var _0x577a0a=_['map'](db['WhatsappApplication'][_0x1669('0x29')],function(_0x6429dc){return{'name':_0x6429dc[_0x1669('0x2a')],'type':_0x6429dc[_0x1669('0x2b')][_0x1669('0x2c')]};});_0x31f4f0['model']=_[_0x1669('0x2d')](_0x577a0a,_0x1669('0x27'));_0x31f4f0[_0x1669('0x2e')]=_[_0x1669('0x2f')](_0x590053[_0x1669('0x2e')]);_0x31f4f0[_0x1669('0x30')]=_[_0x1669('0x31')](_0x31f4f0[_0x1669('0x32')],_0x31f4f0['query']);_0x1512e2[_0x1669('0x33')]=_['intersection'](_0x31f4f0[_0x1669('0x32')],qs['fields'](_0x590053['query'][_0x1669('0x34')]));_0x1512e2[_0x1669('0x33')]=_0x1512e2[_0x1669('0x33')][_0x1669('0x35')]?_0x1512e2[_0x1669('0x33')]:_0x31f4f0[_0x1669('0x32')];if(!_0x590053[_0x1669('0x2e')][_0x1669('0x36')](_0x1669('0x37'))){_0x1512e2['limit']=qs[_0x1669('0x1f')](_0x590053[_0x1669('0x2e')][_0x1669('0x1f')]);_0x1512e2[_0x1669('0x1d')]=qs[_0x1669('0x1d')](_0x590053[_0x1669('0x2e')][_0x1669('0x1d')]);}_0x1512e2['order']=qs[_0x1669('0x38')](_0x590053[_0x1669('0x2e')][_0x1669('0x38')]);_0x1512e2[_0x1669('0x39')]=qs[_0x1669('0x30')](_[_0x1669('0x3a')](_0x590053['query'],_0x31f4f0['filters']),_0x577a0a);if(_0x590053['query'][_0x1669('0x3b')]){_0x1512e2[_0x1669('0x39')]=_[_0x1669('0x3c')](_0x1512e2[_0x1669('0x39')],{'$or':_[_0x1669('0x2d')](_0x577a0a,function(_0x2c35db){if(_0x2c35db[_0x1669('0x2b')]!=='VIRTUAL'){var _0x9ad261={};_0x9ad261[_0x2c35db[_0x1669('0x27')]]={'$like':'%'+_0x590053['query']['filter']+'%'};return _0x9ad261;}})});}_0x1512e2=_[_0x1669('0x3c')]({},_0x1512e2,_0x590053[_0x1669('0x3d')]);var _0x379d82={'where':_0x1512e2[_0x1669('0x39')]};return db[_0x1669('0x3e')]['count'](_0x379d82)[_0x1669('0x25')](function(_0x5ba428){_0x3fe045['count']=_0x5ba428;if(_0x590053[_0x1669('0x2e')]['includeAll']){_0x1512e2[_0x1669('0x3f')]=[{'all':!![]}];}return db[_0x1669('0x3e')][_0x1669('0x40')](_0x1512e2);})[_0x1669('0x25')](function(_0x5e21eb){_0x3fe045[_0x1669('0x41')]=_0x5e21eb;return _0x3fe045;})[_0x1669('0x25')](respondWithFilteredResult(_0x29aff9,_0x1512e2))[_0x1669('0x42')](handleError(_0x29aff9,null));};exports['show']=function(_0x2c1e3b,_0x297c30){var _0x3c4434={'raw':!![],'where':{'id':_0x2c1e3b[_0x1669('0x43')]['id']}},_0x23a1c5={};_0x23a1c5[_0x1669('0x32')]=_[_0x1669('0x2f')](db['WhatsappApplication'][_0x1669('0x29')]);_0x23a1c5['query']=_[_0x1669('0x2f')](_0x2c1e3b['query']);_0x23a1c5[_0x1669('0x30')]=_[_0x1669('0x31')](_0x23a1c5[_0x1669('0x32')],_0x23a1c5[_0x1669('0x2e')]);_0x3c4434[_0x1669('0x33')]=_[_0x1669('0x31')](_0x23a1c5['model'],qs[_0x1669('0x34')](_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x34')]));_0x3c4434['attributes']=_0x3c4434['attributes']['length']?_0x3c4434['attributes']:_0x23a1c5[_0x1669('0x32')];if(_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x44')]){_0x3c4434['include']=[{'all':!![]}];}_0x3c4434=_['merge']({},_0x3c4434,_0x2c1e3b[_0x1669('0x3d')]);return db['WhatsappApplication'][_0x1669('0x45')](_0x3c4434)[_0x1669('0x25')](handleEntityNotFound(_0x297c30,null))[_0x1669('0x25')](respondWithResult(_0x297c30,null))[_0x1669('0x42')](handleError(_0x297c30,null));};exports[_0x1669('0x46')]=function(_0x2ad0eb,_0x410299){return db['WhatsappApplication'][_0x1669('0x46')](_0x2ad0eb['body'],{})[_0x1669('0x25')](respondWithResult(_0x410299,0xc9))['catch'](handleError(_0x410299,null));};exports['update']=function(_0x2778e3,_0x36ab74){if(_0x2778e3[_0x1669('0x47')]['id']){delete _0x2778e3[_0x1669('0x47')]['id'];}return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x2778e3['params']['id']}})[_0x1669('0x25')](handleEntityNotFound(_0x36ab74,null))[_0x1669('0x25')](saveUpdates(_0x2778e3['body'],null))[_0x1669('0x25')](respondWithResult(_0x36ab74,null))[_0x1669('0x42')](handleError(_0x36ab74,null));};exports['destroy']=function(_0x53d184,_0x3d3a24){return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x53d184[_0x1669('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d3a24,null))[_0x1669('0x25')](removeEntity(_0x3d3a24,null))[_0x1669('0x42')](handleError(_0x3d3a24,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 64ff525..d28f86f 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaba6=['utf8mb4','lodash','util','request-promise','path','../../config/environment','./whatsappApplication.attributes','define','whatsapp_applications'];(function(_0x10486e,_0x4b536c){var _0x22c321=function(_0x474c5a){while(--_0x474c5a){_0x10486e['push'](_0x10486e['shift']());}};_0x22c321(++_0x4b536c);}(_0xaba6,0xe2));var _0x6aba=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xaba6[_0x427d3a];return _0xe5c521;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6aba('0x2'));var fs=require('fs');var path=require(_0x6aba('0x3'));var rimraf=require('rimraf');var config=require(_0x6aba('0x4'));var attributes=require(_0x6aba('0x5'));module['exports']=function(_0x4e929a,_0x5ae14c){return _0x4e929a[_0x6aba('0x6')]('WhatsappApplication',attributes,{'tableName':_0x6aba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6aba('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2029=['../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x151dc7,_0x1295d8){var _0x4d8be9=function(_0x37554f){while(--_0x37554f){_0x151dc7['push'](_0x151dc7['shift']());}};_0x4d8be9(++_0x1295d8);}(_0x2029,0x171));var _0x9202=function(_0x30b497,_0x2f5eca){_0x30b497=_0x30b497-0x0;var _0x2192b6=_0x2029[_0x30b497];return _0x2192b6;};'use strict';var _=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var logger=require('../../config/logger')(_0x9202('0x2'));var moment=require(_0x9202('0x3'));var BPromise=require(_0x9202('0x4'));var rp=require(_0x9202('0x5'));var fs=require('fs');var path=require(_0x9202('0x6'));var rimraf=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var attributes=require(_0x9202('0x9'));module[_0x9202('0xa')]=function(_0x299c13,_0x2f33bb){return _0x299c13[_0x9202('0xb')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9202('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index a3d6f3b..af2e826 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x12d773,_0x253abd){var _0x152e37=function(_0x51b1f2){while(--_0x51b1f2){_0x12d773['push'](_0x12d773['shift']());}};_0x152e37(++_0x253abd);}(_0x9a19,0x114));var _0x99a1=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x9a19[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file +var _0x9bde=['code','message','WhatsappApplication,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4c9e03,_0x3f67d2){var _0x3add6c=function(_0x1cd754){while(--_0x1cd754){_0x4c9e03['push'](_0x4c9e03['shift']());}};_0x3add6c(++_0x3f67d2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5a985e,_0x6f93cd){_0x5a985e=_0x5a985e-0x0;var _0x4e749d=_0x9bde[_0x5a985e];return _0x4e749d;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 6dcbfbb..bfb2ebd 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ca9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','update','delete','whatsappinteraction:destroy','destroy'];(function(_0x20a8f9,_0x2ff90c){var _0x4230ab=function(_0x2f8054){while(--_0x2f8054){_0x20a8f9['push'](_0x20a8f9['shift']());}};_0x4230ab(++_0x2ff90c);}(_0x8ca9,0x9c));var _0x98ca=function(_0x2e1946,_0x491df7){_0x2e1946=_0x2e1946-0x0;var _0x51a593=_0x8ca9[_0x2e1946];return _0x51a593;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var fs_extra=require(_0x98ca('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x98ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x9')]);router[_0x98ca('0x8')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xc')]);router[_0x98ca('0x8')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xe')]);router[_0x98ca('0x8')](_0x98ca('0xf'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x8')](_0x98ca('0x11'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x12')]);router[_0x98ca('0x13')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x14')]);router[_0x98ca('0x13')](_0x98ca('0xf'),auth[_0x98ca('0xb')](),controller['addMessage']);router[_0x98ca('0x13')](_0x98ca('0x15'),auth[_0x98ca('0xb')](),interaction[_0x98ca('0x16')](_0x98ca('0x17'),_0x98ca('0x18')),controller[_0x98ca('0x19')]);router['put'](_0x98ca('0xd'),auth[_0x98ca('0xb')](),interaction[_0x98ca('0x16')](_0x98ca('0x17'),'whatsappinteraction:update'),controller[_0x98ca('0x1a')]);router[_0x98ca('0x1b')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),interaction[_0x98ca('0x16')](_0x98ca('0x17'),_0x98ca('0x1c')),controller[_0x98ca('0x1d')]);router[_0x98ca('0x1b')](_0x98ca('0x15'),auth[_0x98ca('0xb')](),controller['removeTags']);module[_0x98ca('0x1e')]=router; \ No newline at end of file +var _0x83d0=['addTags','put','whatsappinteraction:update','delete','whatsapp','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','download','create','post','/:id/tags','tracked'];(function(_0x5da6c1,_0x4a90f6){var _0xea904c=function(_0x64d5cb){while(--_0x64d5cb){_0x5da6c1['push'](_0x5da6c1['shift']());}};_0xea904c(++_0x4a90f6);}(_0x83d0,0xb7));var _0x083d=function(_0x4447a4,_0x473388){_0x4447a4=_0x4447a4-0x0;var _0x4548cc=_0x83d0[_0x4447a4];return _0x4548cc;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require(_0x083d('0x4'));var router=express[_0x083d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x083d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x083d('0x7'));router[_0x083d('0x8')]('/',auth[_0x083d('0x9')](),controller[_0x083d('0xa')]);router[_0x083d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x083d('0xb')]);router[_0x083d('0x8')](_0x083d('0xc'),auth['isAuthenticated'](),controller[_0x083d('0xd')]);router[_0x083d('0x8')](_0x083d('0xe'),auth[_0x083d('0x9')](),controller['getMessages']);router[_0x083d('0x8')]('/:id/download',auth[_0x083d('0x9')](),controller[_0x083d('0xf')]);router['post']('/',auth[_0x083d('0x9')](),controller[_0x083d('0x10')]);router[_0x083d('0x11')](_0x083d('0xe'),auth[_0x083d('0x9')](),controller['addMessage']);router[_0x083d('0x11')](_0x083d('0x12'),auth['isAuthenticated'](),interaction[_0x083d('0x13')]('whatsapp','whatsappinteraction:addtags'),controller[_0x083d('0x14')]);router[_0x083d('0x15')](_0x083d('0xc'),auth[_0x083d('0x9')](),interaction[_0x083d('0x13')]('whatsapp',_0x083d('0x16')),controller['update']);router[_0x083d('0x17')](_0x083d('0xc'),auth[_0x083d('0x9')](),interaction[_0x083d('0x13')](_0x083d('0x18'),_0x083d('0x19')),controller[_0x083d('0x1a')]);router[_0x083d('0x17')](_0x083d('0x12'),auth[_0x083d('0x9')](),controller[_0x083d('0x1b')]);module[_0x083d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 25d6d80..88bfcd7 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3981=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x796cf4,_0x362366){var _0x538650=function(_0xa4b9f7){while(--_0xa4b9f7){_0x796cf4['push'](_0x796cf4['shift']());}};_0x538650(++_0x362366);}(_0x3981,0x144));var _0x1398=function(_0xde9795,_0xc5fa8d){_0xde9795=_0xde9795-0x0;var _0x27b9be=_0x3981[_0xde9795];return _0x27b9be;};'use strict';var Sequelize=require(_0x1398('0x0'));var moment=require('moment');module[_0x1398('0x1')]={'closed':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1398('0x3')]},'disposition':{'type':Sequelize[_0x1398('0x4')]},'secondDisposition':{'type':Sequelize[_0x1398('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1398('0x4')]},'note':{'type':Sequelize[_0x1398('0x4')]},'phone':{'type':Sequelize[_0x1398('0x4')]},'read1stAt':{'type':Sequelize[_0x1398('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1398('0x5')]('in',_0x1398('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1398('0x5')]('in',_0x1398('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1398('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf71=['ENUM','out','sequelize','moment','exports','BOOLEAN','STRING','DATE'];(function(_0x8f006d,_0x15e41c){var _0x15c899=function(_0x20e9c7){while(--_0x20e9c7){_0x8f006d['push'](_0x8f006d['shift']());}};_0x15c899(++_0x15e41c);}(_0xcf71,0xba));var _0x1cf7=function(_0x9117ad,_0x386be4){_0x9117ad=_0x9117ad-0x0;var _0x540f0c=_0xcf71[_0x9117ad];return _0x540f0c;};'use strict';var Sequelize=require(_0x1cf7('0x0'));var moment=require(_0x1cf7('0x1'));module[_0x1cf7('0x2')]={'closed':{'type':Sequelize[_0x1cf7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1cf7('0x4')]},'secondDisposition':{'type':Sequelize[_0x1cf7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1cf7('0x4')]},'note':{'type':Sequelize[_0x1cf7('0x4')]},'phone':{'type':Sequelize[_0x1cf7('0x4')]},'read1stAt':{'type':Sequelize[_0x1cf7('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x1cf7('0x6')]('in',_0x1cf7('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cf7('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x1cf7('0x6')]('in',_0x1cf7('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1cf7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index eb7fb91..a8dfd49 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5f9=['System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','error','stack','send','map','fullname','TagIds','Tags','forEach','push','catch','answered','unmanaged','total','closed','UserId','waiting','talking','index','WhatsappInteraction','rawAttributes','fieldName','type','model','name','query','attributes','fields','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','buildExpression','keys','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','intersection','includeAll','create','body','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','format','transcript-%d-%s.zip','User','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','existsSync','createReadStream','createWriteStream'];(function(_0x548aea,_0x363013){var _0x17b16c=function(_0x113436){while(--_0x113436){_0x548aea['push'](_0x548aea['shift']());}};_0x17b16c(++_0x363013);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x558222,_0x105cdb){_0x558222=_0x558222-0x0;var _0x4e1044=_0xd5f9[_0x558222];return _0x4e1044;};'use strict';var emlformat=require(_0x9d5f('0x0'));var rimraf=require(_0x9d5f('0x1'));var zipdir=require(_0x9d5f('0x2'));var jsonpatch=require(_0x9d5f('0x3'));var rp=require('request-promise');var moment=require(_0x9d5f('0x4'));var BPromise=require(_0x9d5f('0x5'));var Mustache=require(_0x9d5f('0x6'));var util=require(_0x9d5f('0x7'));var path=require(_0x9d5f('0x8'));var sox=require(_0x9d5f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d5f('0xa'));var squel=require(_0x9d5f('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d5f('0xc'));var deskjs=require(_0x9d5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9d5f('0xe'));var Papa=require(_0x9d5f('0xf'));var Redis=require('ioredis');var authService=require(_0x9d5f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9d5f('0x11'));var pdf=require(_0x9d5f('0x12'));var hardwareService=require(_0x9d5f('0x13'));var logger=require(_0x9d5f('0x14'))(_0x9d5f('0x15'));var utils=require('../../config/utils');var config=require(_0x9d5f('0x16'));var licenseUtil=require(_0x9d5f('0x17'));var db=require(_0x9d5f('0x18'))['db'];config[_0x9d5f('0x19')]=_[_0x9d5f('0x1a')](config[_0x9d5f('0x19')],{'host':_0x9d5f('0x1b'),'port':0x18eb});var socket=require(_0x9d5f('0x1c'))(new Redis(config[_0x9d5f('0x19')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x486e1c,_0x54bcc4){_0x54bcc4=_0x54bcc4||0xcc;return function(_0x41a9ca){if(_0x41a9ca){return _0x486e1c[_0x9d5f('0x1d')](_0x54bcc4);}return _0x486e1c['status'](_0x54bcc4)[_0x9d5f('0x1e')]();};}function respondWithResult(_0x10f7d5,_0x34da46){_0x34da46=_0x34da46||0xc8;return function(_0x3a9220){if(_0x3a9220){return _0x10f7d5[_0x9d5f('0x1f')](_0x34da46)['json'](_0x3a9220);}};}function respondWithFilteredResult(_0x16ea25,_0x463c1e){return function(_0xbfb436){if(_0xbfb436){var _0x31ba0a=typeof _0x463c1e[_0x9d5f('0x20')]===_0x9d5f('0x21')&&typeof _0x463c1e[_0x9d5f('0x22')]==='undefined';var _0x359498=_0xbfb436[_0x9d5f('0x23')];var _0x404b35=_0x31ba0a?0x0:_0x463c1e['offset'];var _0x4fa9d6=_0x31ba0a?_0xbfb436[_0x9d5f('0x23')]:_0x463c1e[_0x9d5f('0x20')]+_0x463c1e[_0x9d5f('0x22')];var _0x416357;if(_0x4fa9d6>=_0x359498){_0x4fa9d6=_0x359498;_0x416357=0xc8;}else{_0x416357=0xce;}_0x16ea25['status'](_0x416357);return _0x16ea25[_0x9d5f('0x24')]('Content-Range',_0x404b35+'-'+_0x4fa9d6+'/'+_0x359498)[_0x9d5f('0x25')](_0xbfb436);}return null;};}function patchUpdates(_0x5c0b8f){return function(_0x55b87a){try{jsonpatch[_0x9d5f('0x26')](_0x55b87a,_0x5c0b8f,!![]);}catch(_0x1497a8){return BPromise[_0x9d5f('0x27')](_0x1497a8);}return _0x55b87a[_0x9d5f('0x28')]();};}function saveUpdates(_0x552fe8,_0x301dc4){return function(_0x3715a5){if(_0x3715a5){return _0x3715a5['update'](_0x552fe8)[_0x9d5f('0x29')](function(_0x167d4a){return _0x167d4a;});}return null;};}function removeEntity(_0x1e92cb,_0x3ccb94){return function(_0x3da35c){if(_0x3da35c){return _0x3da35c['destroy']()[_0x9d5f('0x29')](function(){_0x1e92cb[_0x9d5f('0x1f')](0xcc)[_0x9d5f('0x1e')]();});}};}function handleEntityNotFound(_0x4afdd7,_0x5f8281){return function(_0x4e084a){if(!_0x4e084a){_0x4afdd7[_0x9d5f('0x1d')](0x194);}return _0x4e084a;};}function handleError(_0x19303a,_0x59118d){_0x59118d=_0x59118d||0x1f4;return function(_0x45465a){logger[_0x9d5f('0x2a')](_0x45465a[_0x9d5f('0x2b')]);if(_0x45465a['name']){delete _0x45465a['name'];}_0x19303a['status'](_0x59118d)[_0x9d5f('0x2c')](_0x45465a);};}function getInteractionUsers(_0x3e4090,_0x1be00e){return new BPromise(function(_0x4fafae,_0x332191){try{if(_0x1be00e[_0x3e4090['id']]){_0x3e4090['Users']=_[_0x9d5f('0x2d')](_0x1be00e[_0x3e4090['id']],function(_0x22d6a4){return{'id':_0x22d6a4['id'],'fullname':_0x22d6a4[_0x9d5f('0x2e')]};});}}catch(_0x35f433){_0x332191(_0x35f433);}_0x4fafae(_0x3e4090);});}function getInteractionTags(_0x342a32,_0x364933){return new BPromise(function(_0x51f400,_0xff140a){try{if(_0x342a32[_0x9d5f('0x2f')]){_0x342a32[_0x9d5f('0x30')]=[];_0x342a32['TagIds']['split'](',')[_0x9d5f('0x31')](function(_0x1dab43){_0x342a32[_0x9d5f('0x30')][_0x9d5f('0x32')](_0x364933[_0x1dab43]);});}delete _0x342a32[_0x9d5f('0x2f')];}catch(_0x2575a2){_0xff140a(_0x2575a2);}_0x51f400(_0x342a32);});}function updateWhatsappInteraction(_0x23de5a,_0x3b37e9,_0x233d96){return new BPromise(function(_0x419712,_0x28731e){return getInteractionUsers(_0x23de5a,_0x233d96)[_0x9d5f('0x29')](function(_0x1ee626){return getInteractionTags(_0x1ee626,_0x3b37e9);})[_0x9d5f('0x29')](function(_0x270c9b){return getStateInteraction(_0x270c9b);})[_0x9d5f('0x29')](function(_0xefc4bd){_0x419712(_0xefc4bd);})[_0x9d5f('0x33')](function(_0x215ec8){_0x28731e(_0x215ec8);});});}function getStateInteraction(_0x39d935){return new BPromise(function(_0x27a0d4){_0x39d935['waiting']=0x0;_0x39d935['talking']=0x0;_0x39d935[_0x9d5f('0x34')]=0x0;_0x39d935[_0x9d5f('0x35')]=0x0;_0x39d935[_0x9d5f('0x36')]=0x0;if(!_0x39d935[_0x9d5f('0x37')]&&!_0x39d935[_0x9d5f('0x38')]){_0x39d935['waiting']+=0x1;}if(!_0x39d935['closed']&&_0x39d935[_0x9d5f('0x38')]){_0x39d935['talking']+=0x1;if(_0x39d935[_0x9d5f('0x39')]){_0x39d935['waiting']-=0x1;}}if(_0x39d935[_0x9d5f('0x37')]&&_0x39d935[_0x9d5f('0x38')]){_0x39d935['answered']+=0x1;if(_0x39d935[_0x9d5f('0x3a')]){_0x39d935[_0x9d5f('0x3a')]-=0x1;}}if(_0x39d935['closed']&&!_0x39d935[_0x9d5f('0x38')]){_0x39d935['unmanaged']+=0x1;if(_0x39d935['waiting']){_0x39d935[_0x9d5f('0x39')]-=0x1;}}_0x39d935[_0x9d5f('0x36')]+=0x1;_0x27a0d4(_0x39d935);});}exports[_0x9d5f('0x3b')]=function(_0x17dd30,_0x376b2d){var _0x363640={},_0xbd8bae={},_0x2da27c={'count':0x0,'rows':[]};var _0x333713=_[_0x9d5f('0x2d')](db[_0x9d5f('0x3c')][_0x9d5f('0x3d')],function(_0x30a14d){return{'name':_0x30a14d[_0x9d5f('0x3e')],'type':_0x30a14d[_0x9d5f('0x3f')]['key']};});_0xbd8bae[_0x9d5f('0x40')]=_['map'](_0x333713,_0x9d5f('0x41'));_0xbd8bae[_0x9d5f('0x42')]=_['keys'](_0x17dd30[_0x9d5f('0x42')]);_0xbd8bae['filters']=_['intersection'](_0xbd8bae[_0x9d5f('0x40')],_0xbd8bae[_0x9d5f('0x42')]);_0x363640[_0x9d5f('0x43')]=_['intersection'](_0xbd8bae[_0x9d5f('0x40')],qs[_0x9d5f('0x44')](_0x17dd30[_0x9d5f('0x42')]['fields']));_0x363640['attributes']=_0x363640[_0x9d5f('0x43')]['length']?_0x363640[_0x9d5f('0x43')]:_0xbd8bae[_0x9d5f('0x40')];if(!_0x17dd30['query']['hasOwnProperty'](_0x9d5f('0x45'))){_0x363640[_0x9d5f('0x22')]=qs[_0x9d5f('0x22')](_0x17dd30['query']['limit']);_0x363640[_0x9d5f('0x20')]=qs[_0x9d5f('0x20')](_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x20')]);}_0x363640[_0x9d5f('0x46')]=qs[_0x9d5f('0x47')](_0x17dd30[_0x9d5f('0x42')]['sort']);_0x363640[_0x9d5f('0x48')]=qs[_0x9d5f('0x49')](_[_0x9d5f('0x4a')](_0x17dd30[_0x9d5f('0x42')],_0xbd8bae[_0x9d5f('0x49')]),_0x333713);var _0x3fb4db=[];var _0x325ca5=squel['select']()[_0x9d5f('0x4b')]('id')[_0x9d5f('0x4b')](_0x9d5f('0x41'))[_0x9d5f('0x4b')](_0x9d5f('0x4c'))[_0x9d5f('0x4d')](_0x9d5f('0x4e'));var _0x5d97fe=squel['select']()[_0x9d5f('0x4b')](_0x9d5f('0x4f'))[_0x9d5f('0x4b')](_0x9d5f('0x50'))['field'](_0x9d5f('0x51'))[_0x9d5f('0x4d')]('user_has_whatsapp_interactions','ui')[_0x9d5f('0x52')](_0x9d5f('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x565c74=squel['select']()['from'](_0x9d5f('0x54'),'i')['left_join'](_0x9d5f('0x55'),'c',_0x9d5f('0x56'))[_0x9d5f('0x52')](_0x9d5f('0x53'),'o',_0x9d5f('0x57'))[_0x9d5f('0x52')]('whatsapp_accounts','a',_0x9d5f('0x58'))[_0x9d5f('0x52')](_0x9d5f('0x59'),'me',_0x9d5f('0x5a'))['left_join'](_0x9d5f('0x5b'),'it',_0x9d5f('0x5c'))[_0x9d5f('0x52')]('tools_tags','t',_0x9d5f('0x5d'));var _0x4330ac=squel[_0x9d5f('0x5e')]();var _0xbd9fab=[];var _0x19b00a=squel[_0x9d5f('0x5e')]();var _0x2666b3;if(_0x17dd30[_0x9d5f('0x42')]['search']){_0x2666b3=as[_0x9d5f('0x5f')](_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x60')]);var _0x5993ba=_0x2666b3['sqlOperator'];for(var _0xf951a7=0x0;_0xf951a7<_0x2666b3[_0x9d5f('0x61')][_0x9d5f('0x62')];_0xf951a7++){var _0x511b2f=_0x2666b3[_0x9d5f('0x61')][_0xf951a7];var _0x9dcf01='i';var _0x466110=_[_0x9d5f('0x63')](_0x333713,[_0x9d5f('0x41'),_0x511b2f[_0x9d5f('0x4b')]]);if(!_0x466110){switch(_0x511b2f['field']){case _0x9d5f('0x64'):if(_0x511b2f[_0x9d5f('0x65')]==0x1){_0x565c74[_0x9d5f('0x66')]('`'+_0x511b2f[_0x9d5f('0x4b')]+_0x9d5f('0x67'));}else{_0x565c74['having']('`'+_0x511b2f[_0x9d5f('0x4b')]+'`\x20>\x200');}break;case _0x9d5f('0x68'):if(_0x511b2f[_0x9d5f('0x69')]===_0x9d5f('0x6a')){if(_0x511b2f[_0x9d5f('0x65')][_0x9d5f('0x6b')]('\x20')['length']>0x1){_0x4330ac[_0x5993ba](_0x9d5f('0x6c'),qs[_0x9d5f('0x6d')](_0x511b2f[_0x9d5f('0x65')]),null);}else{var _0x31faa0='%'+_0x511b2f[_0x9d5f('0x65')]+'%';_0x4330ac[_0x5993ba]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x31faa0,_0x31faa0,_0x31faa0);}}else{_0x466110=_[_0x9d5f('0x63')](_0x333713,[_0x9d5f('0x41'),_0x9d5f('0x6e')]);_0x511b2f[_0x9d5f('0x4b')]=_0x9d5f('0x6e');_0x3137d3=as['buildExpression'](_0x9dcf01,_0x466110[_0x9d5f('0x3f')],_0x511b2f);_0x4330ac[_0x5993ba](_0x3137d3[_0x9d5f('0x6f')],_0x3137d3[_0x9d5f('0x65')][_0x9d5f('0x70')],_0x3137d3[_0x9d5f('0x65')]['end']);}break;case _0x9d5f('0x71'):var _0x116708=_0x511b2f[_0x9d5f('0x65')][_0x9d5f('0x6b')](',')[_0x9d5f('0x2d')](function(_0x6ca126){return Number(_0x6ca126);});_0x116708['forEach'](function(_0x5aca4a){_0x19b00a['or'](_0x9d5f('0x72'),'%,'+_0x5aca4a+',%');});_0xbd9fab=_[_0x9d5f('0x73')](_0xbd9fab,_0x116708);break;case'User':if(_0x511b2f[_0x9d5f('0x69')]==='$substring'){_0x4330ac[_0x5993ba]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x511b2f[_0x9d5f('0x65')]+'%',null);}else{_0x466110=_['find'](_0x333713,['name','UserId']);_0x511b2f[_0x9d5f('0x4b')]='UserId';_0x3137d3=as[_0x9d5f('0x74')](_0x9dcf01,_0x466110['type'],_0x511b2f);_0x4330ac[_0x5993ba](_0x3137d3['text'],_0x3137d3[_0x9d5f('0x65')][_0x9d5f('0x70')],_0x3137d3[_0x9d5f('0x65')][_0x9d5f('0x1e')]);}break;case'body':_0x3137d3=as[_0x9d5f('0x74')]('me',null,_0x511b2f);_0x4330ac[_0x5993ba](_0x3137d3['text'],_0x3137d3['value'][_0x9d5f('0x70')],_0x3137d3[_0x9d5f('0x65')][_0x9d5f('0x1e')]);break;}}else{var _0x3137d3=as[_0x9d5f('0x74')](_0x9dcf01,_0x466110['type'],_0x511b2f);_0x4330ac[_0x5993ba](_0x3137d3['text'],_0x3137d3['value']['start'],_0x3137d3['value']['end']);}}}else{var _0x239848=_(_0x17dd30[_0x9d5f('0x42')])[_0x9d5f('0x75')]()[_0x9d5f('0x2d')](function(_0xe0b2b7){return _['some'](_0x333713,[_0x9d5f('0x41'),_0xe0b2b7])?_0xe0b2b7:undefined;})['compact']()['value']();if(!_[_0x9d5f('0x76')](_0x239848)){_0x239848[_0x9d5f('0x31')](function(_0x49d331){if(_0x49d331===_0x9d5f('0x77')){_0x565c74[_0x9d5f('0x48')](_0x9d5f('0x78'),[]['concat'](_0x17dd30[_0x9d5f('0x42')][_0x49d331]));}else if(_0x49d331===_0x9d5f('0x79')){var _0x568360=JSON[_0x9d5f('0x7a')](_0x17dd30[_0x9d5f('0x42')][_0x49d331])['$gte'];var _0x54a828=JSON['parse'](_0x17dd30[_0x9d5f('0x42')][_0x49d331])[_0x9d5f('0x7b')];_0x565c74['where'](_0x9d5f('0x7c'),_0x568360,_0x54a828);}else{if(_0x17dd30[_0x9d5f('0x42')][_0x49d331]===_0x9d5f('0x7d')){_0x565c74[_0x9d5f('0x48')]('i.'+_0x49d331+_0x9d5f('0x7e'));}else{_0x565c74[_0x9d5f('0x48')]('i.'+_0x49d331+_0x9d5f('0x7f'),_0x17dd30[_0x9d5f('0x42')][_0x49d331]);}}});}if(_0x17dd30[_0x9d5f('0x42')]['read']){if(_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x80')]==0x1){_0x565c74[_0x9d5f('0x66')](_0x9d5f('0x81'));}else{_0x565c74[_0x9d5f('0x66')](_0x9d5f('0x82'));}}if(_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x83')]){_0xbd9fab=_['isArray'](_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x83')])?_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x83')]:new Array(_0x17dd30[_0x9d5f('0x42')]['tag']);_0xbd9fab['forEach'](function(_0x4e2769){_0x19b00a['or'](_0x9d5f('0x72'),'%,'+_0x4e2769+',%');});}if(_0x17dd30['query']['filter']){var _0x100ab2=_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x84')][_0x9d5f('0x85')]('\x5c','\x5c\x5c')[_0x9d5f('0x85')](/'/g,'\x27\x27');if(qs[_0x9d5f('0x86')](_0x100ab2)){_0x4330ac['or'](_0x9d5f('0x87'),_0x100ab2+'%')['or']('i.phone\x20LIKE\x20?',_0x100ab2+'%');}else{_0x4330ac['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9d5f('0x6d')](_0x100ab2))['or'](_0x9d5f('0x88'),_0x100ab2+'%');}}}_0x565c74[_0x9d5f('0x48')](_0x4330ac);_0x565c74[_0x9d5f('0x89')](_0x9d5f('0x8a'));var _0x11a6e8={'type':db['Sequelize'][_0x9d5f('0x8b')][_0x9d5f('0x8c')],'raw':!![]};var _0x42fc08=_0x565c74['clone']();_0x42fc08[_0x9d5f('0x4b')](_0x9d5f('0x8a'));_0x42fc08[_0x9d5f('0x4b')](_0x9d5f('0x8d'),'unreadMessages');if(_0x363640[_0x9d5f('0x46')]){_0x363640[_0x9d5f('0x46')][_0x9d5f('0x31')](function(_0x2a4fc4){var _0x2a142b=_0x2a4fc4[0x0]==='contactName'?_0x2a4fc4[0x0]:'i.'+_0x2a4fc4[0x0];_0x565c74[_0x9d5f('0x46')](_0x2a142b,_0x2a4fc4[0x1]===_0x9d5f('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0xbd9fab)){_0x565c74[_0x9d5f('0x66')](_0x19b00a);_0x42fc08['where'](_0x9d5f('0x8f'),_0xbd9fab);}BPromise['resolve']()[_0x9d5f('0x29')](function(){if(!_0x2666b3){if(_0x17dd30['query'][_0x9d5f('0x77')])return;_0x42fc08[_0x9d5f('0x48')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x565c74[_0x9d5f('0x48')](_0x9d5f('0x90'));return;}if(_0x17dd30[_0x9d5f('0x91')][_0x9d5f('0x92')]!==_0x9d5f('0x93'))return;return _0x17dd30[_0x9d5f('0x91')][_0x9d5f('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18e51b){if(_['isEmpty'](_0x18e51b)){_0x42fc08['where'](_0x9d5f('0x95'));_0x565c74[_0x9d5f('0x48')](_0x9d5f('0x95'));}else{_0x42fc08['where'](_0x9d5f('0x78'),_[_0x9d5f('0x2d')](_0x18e51b,'id'));_0x565c74['where'](_0x9d5f('0x78'),_[_0x9d5f('0x2d')](_0x18e51b,'id'));}});})['then'](function(){if(_0x17dd30[_0x9d5f('0x91')]['role']===_0x9d5f('0x93')&&!_0x2666b3&&!_0x17dd30['query'][_0x9d5f('0x77')])return[];return db[_0x9d5f('0x96')][_0x9d5f('0x42')](_0x42fc08['toString'](),_0x11a6e8);})[_0x9d5f('0x29')](function(_0x317f63){_0x2da27c[_0x9d5f('0x23')]=_0x317f63[_0x9d5f('0x62')];if(_0x2da27c[_0x9d5f('0x23')]===0x0)return[];return db[_0x9d5f('0x96')][_0x9d5f('0x42')](_0x325ca5[_0x9d5f('0x97')](),_0x11a6e8)[_0x9d5f('0x29')](function(_0x1a5d01){_0x3fb4db=_[_0x9d5f('0x98')](_0x1a5d01,'id');_0x11a6e8=_[_0x9d5f('0x99')](_0x11a6e8,{'model':db[_0x9d5f('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17dd30[_0x9d5f('0x42')][_0x9d5f('0x44')]){_0x363640[_0x9d5f('0x43')][_0x9d5f('0x31')](function(_0x3156e4){_0x565c74[_0x9d5f('0x4b')]('i.'+_0x3156e4);});}else{_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0x8d'),_0x9d5f('0x64'));_0x565c74['field'](_0x9d5f('0x9a'),_0x9d5f('0x9b'));_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0x9c'),_0x9d5f('0x9d'));_0x565c74[_0x9d5f('0x4b')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x9d5f('0x9e'));_0x565c74['field'](_0x9d5f('0x9f'));_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0xa0'),_0x9d5f('0xa1'));_0x565c74[_0x9d5f('0x4b')]('c.lastName',_0x9d5f('0xa2'));_0x565c74['field'](_0x9d5f('0xa3'),'Contact.email');_0x565c74['field'](_0x9d5f('0xa4'),_0x9d5f('0xa5'));_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0xa6'),_0x9d5f('0xa7'));_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0xa8'),'Contact.fax');_0x565c74['field'](_0x9d5f('0xa9'),_0x9d5f('0xaa'));_0x565c74[_0x9d5f('0x4b')](_0x9d5f('0xab'),_0x9d5f('0xac'));_0x565c74[_0x9d5f('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9d5f('0x2f'));}if(_0x363640[_0x9d5f('0x22')])_0x565c74['limit'](_0x363640['limit']);if(_0x363640[_0x9d5f('0x20')])_0x565c74[_0x9d5f('0x20')](_0x363640[_0x9d5f('0x20')]);return db[_0x9d5f('0x96')][_0x9d5f('0x42')](_0x565c74[_0x9d5f('0x97')](),_0x11a6e8);})[_0x9d5f('0x29')](function(_0x2e5d3b){if(_0x2e5d3b[_0x9d5f('0x62')]>0x0)_0x5d97fe[_0x9d5f('0x48')](_0x9d5f('0xad'),_[_0x9d5f('0x2d')](_0x2e5d3b,'id'));return db[_0x9d5f('0x96')][_0x9d5f('0x42')](_0x5d97fe['toString'](),_0x11a6e8)['then'](function(_0x3a7a2e){var _0x410209=_[_0x9d5f('0xae')](_0x3a7a2e,_0x9d5f('0xaf'));var _0x225a50=[];_0x2e5d3b[_0x9d5f('0x31')](function(_0x248b75){_0x225a50[_0x9d5f('0x32')](updateWhatsappInteraction(_0x248b75,_0x3fb4db,_0x410209));});return BPromise[_0x9d5f('0xb0')](_0x225a50);});});})[_0x9d5f('0x29')](function(_0x1cf42a){_0x2da27c['rows']=_0x1cf42a;return _0x2da27c;})[_0x9d5f('0x29')](respondWithFilteredResult(_0x376b2d,_0x363640))['catch'](handleError(_0x376b2d,null));};exports[_0x9d5f('0xb1')]=function(_0x3331c9,_0x1215e5){var _0x376df6={'raw':![],'where':{'id':_0x3331c9[_0x9d5f('0xb2')]['id']}},_0x505905={};_0x505905[_0x9d5f('0x40')]=_[_0x9d5f('0x75')](db[_0x9d5f('0x3c')][_0x9d5f('0x3d')]);_0x505905['query']=_[_0x9d5f('0x75')](_0x3331c9[_0x9d5f('0x42')]);_0x505905[_0x9d5f('0x49')]=_[_0x9d5f('0xb3')](_0x505905[_0x9d5f('0x40')],_0x505905[_0x9d5f('0x42')]);_0x376df6[_0x9d5f('0x43')]=_[_0x9d5f('0xb3')](_0x505905['model'],qs[_0x9d5f('0x44')](_0x3331c9[_0x9d5f('0x42')]['fields']));_0x376df6[_0x9d5f('0x43')]=_0x376df6[_0x9d5f('0x43')][_0x9d5f('0x62')]?_0x376df6['attributes']:_0x505905[_0x9d5f('0x40')];if(_0x3331c9[_0x9d5f('0x42')][_0x9d5f('0xb4')]){_0x376df6['include']=[{'all':!![]}];}_0x376df6=_[_0x9d5f('0x99')]({},_0x376df6,_0x3331c9['options']);return db['WhatsappInteraction'][_0x9d5f('0x63')](_0x376df6)[_0x9d5f('0x29')](handleEntityNotFound(_0x1215e5,null))[_0x9d5f('0x29')](respondWithResult(_0x1215e5,null))['catch'](handleError(_0x1215e5,null));};exports['create']=function(_0x22e5fe,_0x16ee14){return db[_0x9d5f('0x3c')][_0x9d5f('0xb5')](_0x22e5fe[_0x9d5f('0xb6')],{})['then'](respondWithResult(_0x16ee14,0xc9))[_0x9d5f('0x33')](handleError(_0x16ee14,null));};exports['update']=function(_0x1358b2,_0x479c61){if(_0x1358b2[_0x9d5f('0xb6')]['id']){delete _0x1358b2[_0x9d5f('0xb6')]['id'];}return db[_0x9d5f('0x3c')][_0x9d5f('0x63')]({'where':{'id':_0x1358b2[_0x9d5f('0xb2')]['id']}})['then'](handleEntityNotFound(_0x479c61,null))['then'](saveUpdates(_0x1358b2[_0x9d5f('0xb6')],null))[_0x9d5f('0x29')](respondWithResult(_0x479c61,null))[_0x9d5f('0x33')](handleError(_0x479c61,null));};exports['destroy']=function(_0x5b94dd,_0xddd479){return db[_0x9d5f('0x3c')][_0x9d5f('0x63')]({'where':{'id':_0x5b94dd[_0x9d5f('0xb2')]['id']}})['then'](handleEntityNotFound(_0xddd479,null))[_0x9d5f('0x29')](removeEntity(_0xddd479,null))['catch'](handleError(_0xddd479,null));};exports['describe']=function(_0x3749e7,_0xe988d2){return db[_0x9d5f('0x3c')][_0x9d5f('0xb7')]()[_0x9d5f('0x29')](respondWithResult(_0xe988d2,null))[_0x9d5f('0x33')](handleError(_0xe988d2,null));};exports[_0x9d5f('0xb8')]=function(_0x3d61fa,_0x5effed,_0x3b70f6){return db['WhatsappMessage'][_0x9d5f('0x63')]({'where':{'id':_0x3d61fa[_0x9d5f('0xb2')]['id']}})[_0x9d5f('0x29')](handleEntityNotFound(_0x5effed,null))[_0x9d5f('0x29')](function(_0x4d66e6){if(_0x4d66e6){return _0x4d66e6[_0x9d5f('0xb8')](_0x3d61fa[_0x9d5f('0xb6')][_0x9d5f('0xb9')],_[_0x9d5f('0xba')](_0x3d61fa[_0x9d5f('0xb6')],[_0x9d5f('0xb9'),'id'])||{});}})['then'](respondWithResult(_0x5effed,null))[_0x9d5f('0x33')](handleError(_0x5effed,null));};exports[_0x9d5f('0xbb')]=function(_0x3f8529,_0x1a4262,_0x4444b4){var _0x1657e0={'raw':![],'where':{}};var _0x1f239c={};var _0x348bab={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x9d5f('0xbc')]({'where':{'id':_0x3f8529[_0x9d5f('0xb2')]['id']}})[_0x9d5f('0x29')](handleEntityNotFound(_0x1a4262,null))[_0x9d5f('0x29')](function(_0x5d1e2b){if(_0x5d1e2b){_0x1f239c[_0x9d5f('0x40')]=_[_0x9d5f('0x75')](db[_0x9d5f('0xbd')][_0x9d5f('0x3d')]);_0x1f239c['query']=_[_0x9d5f('0x75')](_0x3f8529[_0x9d5f('0x42')]);_0x1f239c[_0x9d5f('0x49')]=_['intersection'](_0x1f239c[_0x9d5f('0x40')],_0x1f239c['query']);_0x1657e0[_0x9d5f('0x43')]=_[_0x9d5f('0xb3')](_0x1f239c['model'],qs[_0x9d5f('0x44')](_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0x44')]));_0x1657e0[_0x9d5f('0x43')]=_0x1657e0[_0x9d5f('0x43')]['length']?_0x1657e0[_0x9d5f('0x43')]:_0x1f239c[_0x9d5f('0x40')];if(!_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0xbe')](_0x9d5f('0x45'))){_0x1657e0[_0x9d5f('0x22')]=qs[_0x9d5f('0x22')](_0x3f8529[_0x9d5f('0x42')]['limit']);_0x1657e0[_0x9d5f('0x20')]=qs[_0x9d5f('0x20')](_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0x20')]);}_0x1657e0['order']=qs[_0x9d5f('0x47')](_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0x47')]);_0x1657e0[_0x9d5f('0x48')]=qs[_0x9d5f('0x49')](_[_0x9d5f('0x4a')](_0x3f8529['query'],_0x1f239c[_0x9d5f('0x49')]));_0x1657e0[_0x9d5f('0x48')]['WhatsappInteractionId']=_0x5d1e2b['id'];if(_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0x84')]){_0x1657e0[_0x9d5f('0x48')]=_[_0x9d5f('0x99')](_0x1657e0[_0x9d5f('0x48')],{'$or':_[_0x9d5f('0x2d')](_0x1657e0[_0x9d5f('0x43')],function(_0x407f17){var _0x2caba2={};_0x2caba2[_0x407f17]={'$like':'%'+_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0x84')]+'%'};return _0x2caba2;})});}if(_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0xbf')]){var _0x4794c0=_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0xbf')]['split'](',');var _0x5273d2={};_0x5273d2[_0x4794c0[0x0]]={'$gte':moment(_0x4794c0[0x1])['format'](_0x9d5f('0xc0'))};_0x1657e0['where']=_[_0x9d5f('0x99')](_0x1657e0[_0x9d5f('0x48')],_0x5273d2);}_0x1657e0=_[_0x9d5f('0x99')]({},_0x1657e0,_0x3f8529[_0x9d5f('0xc1')]);return db[_0x9d5f('0xbd')][_0x9d5f('0x23')]({'where':_0x1657e0['where']})[_0x9d5f('0x29')](function(_0x2ceaef){_0x348bab[_0x9d5f('0x23')]=_0x2ceaef;if(_0x3f8529[_0x9d5f('0x42')][_0x9d5f('0xb4')]){_0x1657e0[_0x9d5f('0xc2')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x1657e0);})['then'](function(_0xbd295c){_0x348bab[_0x9d5f('0xc3')]=_0xbd295c;return _0x348bab;});}})[_0x9d5f('0x29')](respondWithFilteredResult(_0x1a4262,_0x1657e0))[_0x9d5f('0x33')](handleError(_0x1a4262,null));};exports[_0x9d5f('0xc4')]=function(_0x3c17da,_0x4db5f3,_0x472b97){return db[_0x9d5f('0x3c')][_0x9d5f('0x63')]({'where':{'id':_0x3c17da['params']['id']}})[_0x9d5f('0x29')](handleEntityNotFound(_0x4db5f3,null))[_0x9d5f('0x29')](function(_0x42d83e){if(_0x42d83e){return _0x42d83e[_0x9d5f('0xc5')](_0x3c17da['body'][_0x9d5f('0xb9')],_[_0x9d5f('0xba')](_0x3c17da[_0x9d5f('0xb6')],[_0x9d5f('0xb9'),'id'])||{})[_0x9d5f('0xc6')](function(){return db['Tag'][_0x9d5f('0xc7')]({'attributes':['id',_0x9d5f('0x41'),_0x9d5f('0x4c')],'where':{'id':_0x3c17da[_0x9d5f('0xb6')][_0x9d5f('0xb9')]}});})['then'](function(_0x270225){socket[_0x9d5f('0xc8')](_0x9d5f('0xc9'),{'id':Number(_0x3c17da['params']['id']),'tags':_0x270225||[]});return{'id':Number(_0x3c17da[_0x9d5f('0xb2')]['id']),'tags':_0x270225||[]};});}})[_0x9d5f('0x29')](respondWithResult(_0x4db5f3,null))[_0x9d5f('0x33')](handleError(_0x4db5f3,null));};exports[_0x9d5f('0xca')]=function(_0x529d11,_0x7cf017,_0x1c4044){return db[_0x9d5f('0x3c')][_0x9d5f('0x63')]({'where':{'id':_0x529d11['params']['id']}})[_0x9d5f('0x29')](handleEntityNotFound(_0x7cf017,null))[_0x9d5f('0x29')](function(_0x4ea782){if(_0x4ea782){return _0x4ea782[_0x9d5f('0xca')](_0x529d11[_0x9d5f('0x42')][_0x9d5f('0xb9')]);}})[_0x9d5f('0x29')](respondWithStatusCode(_0x7cf017,null))[_0x9d5f('0x33')](handleError(_0x7cf017,null));};exports[_0x9d5f('0xcb')]=function(_0x246734,_0x24d621){var _0x3999f5=moment()[_0x9d5f('0xcc')]()[_0x9d5f('0x97')]();var _0x4e7598=path[_0x9d5f('0xcd')](config[_0x9d5f('0xce')],'server',_0x9d5f('0xcf'),'tmp');var _0x2fe8bc=path['join'](config[_0x9d5f('0xce')],_0x9d5f('0xd0'),'files',_0x9d5f('0xd1'));var _0x333f86=path[_0x9d5f('0xcd')](_0x4e7598,_0x3999f5);var _0x4c2fe2=util[_0x9d5f('0xd2')](_0x9d5f('0xd3'),_0x246734['params']['id'],_0x3999f5);var _0x1752cf=path[_0x9d5f('0xcd')](_0x4e7598,_0x4c2fe2);var _0x33bb26=[];_0x33bb26[_0x9d5f('0x32')]({'model':db[_0x9d5f('0xd4')],'as':'User','attributes':['id',_0x9d5f('0x2e')],'raw':!![]});_0x33bb26[_0x9d5f('0x32')]({'model':db['CmContact'],'as':_0x9d5f('0x68'),'attributes':['id',_0x9d5f('0xd5'),_0x9d5f('0xd6')],'raw':!![]});if(_0x246734[_0x9d5f('0x42')][_0x9d5f('0xd1')]){_0x33bb26[_0x9d5f('0x32')]({'model':db[_0x9d5f('0xd7')],'as':'Attachment','raw':!![]});}var _0x3c9f89=[{'model':db['WhatsappMessage'],'as':_0x9d5f('0xd8'),'attributes':['id',_0x9d5f('0xb6'),'createdAt',_0x9d5f('0xd9'),_0x9d5f('0xda'),_0x9d5f('0x80')],'include':_0x33bb26}];_0x3c9f89['push']({'model':db[_0x9d5f('0xdb')],'as':'Account','attributes':['id',_0x9d5f('0x41')]});_0x3c9f89[_0x9d5f('0x32')]({'model':db[_0x9d5f('0xd4')],'as':_0x9d5f('0xdc'),'attributes':['id',_0x9d5f('0x2e')]});return db[_0x9d5f('0x3c')][_0x9d5f('0x63')]({'where':{'id':_0x246734[_0x9d5f('0xb2')]['id']},'include':_0x3c9f89})[_0x9d5f('0x29')](handleEntityNotFound(_0x24d621,null))[_0x9d5f('0x29')](function(_0x806325){if(_0x806325){var _0x2be1d8=_0x806325[_0x9d5f('0xdd')]({'plain':!![]});fs[_0x9d5f('0xde')](_0x333f86);var _0x360383={'channel':_0x9d5f('0xdf'),'account':_0x2be1d8[_0x9d5f('0xe0')]['name'],'agent':_0x2be1d8[_0x9d5f('0xdc')]?_0x2be1d8[_0x9d5f('0xdc')][_0x9d5f('0x2e')]:_0x9d5f('0xe1'),'createdAt':moment(_0x2be1d8[_0x9d5f('0x79')])['format'](_0x9d5f('0xc0'))['toString'](),'closedAt':_0x2be1d8['closed']?moment(_0x2be1d8[_0x9d5f('0xe2')])[_0x9d5f('0xd2')](_0x9d5f('0xc0'))[_0x9d5f('0x97')]():'','disposition':_0x2be1d8[_0x9d5f('0xe3')],'messages':_(_0x2be1d8['Messages'])['filter']({'secret':![]})[_0x9d5f('0x2d')](function(_0x1b4642){if(_0x1b4642[_0x9d5f('0xd7')]){var _0x11ad5f=path[_0x9d5f('0xcd')](_0x2fe8bc,_0x1b4642[_0x9d5f('0xd7')][_0x9d5f('0xe4')]);if(fs[_0x9d5f('0xe5')](_0x11ad5f)){fs[_0x9d5f('0xe6')](_0x11ad5f)['pipe'](fs[_0x9d5f('0xe7')](path[_0x9d5f('0xcd')](_0x333f86,_0x1b4642[_0x9d5f('0xd7')][_0x9d5f('0xe4')])));}}return{'date':moment(_0x1b4642[_0x9d5f('0x79')])[_0x9d5f('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1b4642[_0x9d5f('0xd9')]==='out'?_0x1b4642[_0x9d5f('0xd4')]?_0x1b4642[_0x9d5f('0xd4')][_0x9d5f('0x2e')]:_0x9d5f('0xe8'):_0x1b4642['Contact'][_0x9d5f('0xd5')]+(_0x1b4642['Contact'][_0x9d5f('0xd6')]?'\x20'+_0x1b4642['Contact'][_0x9d5f('0xd6')]:''),'body':_0x1b4642[_0x9d5f('0xd7')]?_0x1b4642[_0x9d5f('0xd7')][_0x9d5f('0xe4')]:_0x1b4642[_0x9d5f('0xb6')],'direction':_0x1b4642[_0x9d5f('0xd9')]===_0x9d5f('0xe9')?'A':'C','secret':_0x1b4642['secret'],'read':_0x1b4642['read'],'attachment':_0x1b4642[_0x9d5f('0xd7')]};})[_0x9d5f('0x65')]()};return ejs[_0x9d5f('0xea')](path[_0x9d5f('0xcd')](config[_0x9d5f('0xce')],_0x9d5f('0xd0'),_0x9d5f('0xeb'),_0x9d5f('0xec')),{'interaction':_0x360383})[_0x9d5f('0x29')](function(_0x1b7ed7){var _0x2b5067=path['join'](_0x333f86,_0x9d5f('0xed')+_0x2be1d8['id']+'-'+_0x3999f5+_0x9d5f('0xee'));var _0x553d10={'path':_0x2b5067,'channel':_0x9d5f('0xdf'),'interactionId':_0x2be1d8['id']};return pdf[_0x9d5f('0xef')](_0x1b7ed7,_0x553d10);})[_0x9d5f('0x29')](function(){return new BPromise(function(_0x19ea62,_0x195a08){zipdir(_0x333f86,{'saveTo':_0x1752cf},function(_0x2ded8d,_0x12e6d3){if(_0x2ded8d)return _0x195a08(_0x2ded8d);return _0x19ea62(_0x12e6d3);});})['then'](function(){return new BPromise(function(_0x51ba1e,_0x2536ce){rimraf(_0x333f86,function(_0x51f288){if(_0x51f288)_0x2536ce(_0x51f288);return _0x51ba1e();});});})[_0x9d5f('0x29')](function(){return _0x24d621[_0x9d5f('0xcb')](_0x1752cf,_0x4c2fe2,function(_0x331a20){if(_0x331a20){console[_0x9d5f('0xf0')](_0x9d5f('0xf1'),_0x331a20);}else{fs[_0x9d5f('0xf2')](_0x1752cf);}});});});}else{return _0x24d621['sendStatus'](0xc8);}})['catch'](handleError(_0x24d621,null));}; \ No newline at end of file +var _0xab00=['Users','map','fullname','TagIds','Tags','forEach','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','$substring','split','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','text','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','i.phone\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)','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','include','options','create','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','Tag','emit','whatsappInteractionTags:save','removeTags','unix','join','files','root','server','attachments','transcript-%d-%s.zip','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','disposition','Messages','basename','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','sendStatus','error','name','send'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xab00,0x1b9));var _0x0ab0=function(_0x283c59,_0x19252b){_0x283c59=_0x283c59-0x0;var _0x300eaf=_0xab00[_0x283c59];return _0x300eaf;};'use strict';var emlformat=require(_0x0ab0('0x0'));var rimraf=require(_0x0ab0('0x1'));var zipdir=require(_0x0ab0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ab0('0x3'));var moment=require(_0x0ab0('0x4'));var BPromise=require(_0x0ab0('0x5'));var Mustache=require('mustache');var util=require(_0x0ab0('0x6'));var path=require('path');var sox=require(_0x0ab0('0x7'));var csv=require(_0x0ab0('0x8'));var ejs=require(_0x0ab0('0x9'));var fs=require('fs');var fs_extra=require(_0x0ab0('0xa'));var _=require(_0x0ab0('0xb'));var squel=require(_0x0ab0('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ab0('0xd'));var deskjs=require(_0x0ab0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ab0('0xf'));var Papa=require('papaparse');var Redis=require(_0x0ab0('0x10'));var authService=require(_0x0ab0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ab0('0x12'))('api');var utils=require(_0x0ab0('0x13'));var config=require(_0x0ab0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ab0('0x15'))['db'];config[_0x0ab0('0x16')]=_[_0x0ab0('0x17')](config[_0x0ab0('0x16')],{'host':_0x0ab0('0x18'),'port':0x18eb});var socket=require(_0x0ab0('0x19'))(new Redis(config[_0x0ab0('0x16')]));require(_0x0ab0('0x1a'))[_0x0ab0('0x1b')](socket);function respondWithStatusCode(_0x459477,_0x28f26d){_0x28f26d=_0x28f26d||0xcc;return function(_0x3c39b6){if(_0x3c39b6){return _0x459477['sendStatus'](_0x28f26d);}return _0x459477['status'](_0x28f26d)['end']();};}function respondWithResult(_0x197b59,_0x32fe14){_0x32fe14=_0x32fe14||0xc8;return function(_0x2f594b){if(_0x2f594b){return _0x197b59['status'](_0x32fe14)[_0x0ab0('0x1c')](_0x2f594b);}};}function respondWithFilteredResult(_0x4a453f,_0x5b3bef){return function(_0x5710bf){if(_0x5710bf){var _0x171341=typeof _0x5b3bef[_0x0ab0('0x1d')]===_0x0ab0('0x1e')&&typeof _0x5b3bef[_0x0ab0('0x1f')]===_0x0ab0('0x1e');var _0x407548=_0x5710bf[_0x0ab0('0x20')];var _0x5545c2=_0x171341?0x0:_0x5b3bef['offset'];var _0x2cda33=_0x171341?_0x5710bf[_0x0ab0('0x20')]:_0x5b3bef[_0x0ab0('0x1d')]+_0x5b3bef['limit'];var _0x19b33e;if(_0x2cda33>=_0x407548){_0x2cda33=_0x407548;_0x19b33e=0xc8;}else{_0x19b33e=0xce;}_0x4a453f['status'](_0x19b33e);return _0x4a453f[_0x0ab0('0x21')](_0x0ab0('0x22'),_0x5545c2+'-'+_0x2cda33+'/'+_0x407548)[_0x0ab0('0x1c')](_0x5710bf);}return null;};}function patchUpdates(_0x35ee0d){return function(_0x293631){try{jsonpatch[_0x0ab0('0x23')](_0x293631,_0x35ee0d,!![]);}catch(_0x1bec79){return BPromise['reject'](_0x1bec79);}return _0x293631[_0x0ab0('0x24')]();};}function saveUpdates(_0xe7f0a5,_0x2635a2){return function(_0x5e3ebb){if(_0x5e3ebb){return _0x5e3ebb[_0x0ab0('0x25')](_0xe7f0a5)[_0x0ab0('0x26')](function(_0x3e9afd){return _0x3e9afd;});}return null;};}function removeEntity(_0x5add07,_0x1f5d10){return function(_0x34c9e6){if(_0x34c9e6){return _0x34c9e6[_0x0ab0('0x27')]()[_0x0ab0('0x26')](function(){_0x5add07[_0x0ab0('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d425c,_0x4d330f){return function(_0xdadb81){if(!_0xdadb81){_0x2d425c[_0x0ab0('0x29')](0x194);}return _0xdadb81;};}function handleError(_0x259e97,_0x29e200){_0x29e200=_0x29e200||0x1f4;return function(_0x5ae993){logger[_0x0ab0('0x2a')](_0x5ae993['stack']);if(_0x5ae993[_0x0ab0('0x2b')]){delete _0x5ae993[_0x0ab0('0x2b')];}_0x259e97[_0x0ab0('0x28')](_0x29e200)[_0x0ab0('0x2c')](_0x5ae993);};}function getInteractionUsers(_0x657f32,_0xa9cb4f){return new BPromise(function(_0x3306c6,_0x43aef0){try{if(_0xa9cb4f[_0x657f32['id']]){_0x657f32[_0x0ab0('0x2d')]=_[_0x0ab0('0x2e')](_0xa9cb4f[_0x657f32['id']],function(_0x23e475){return{'id':_0x23e475['id'],'fullname':_0x23e475[_0x0ab0('0x2f')]};});}}catch(_0x572d08){_0x43aef0(_0x572d08);}_0x3306c6(_0x657f32);});}function getInteractionTags(_0xae605a,_0x110676){return new BPromise(function(_0x989e82,_0x30cc46){try{if(_0xae605a[_0x0ab0('0x30')]){_0xae605a[_0x0ab0('0x31')]=[];_0xae605a['TagIds']['split'](',')[_0x0ab0('0x32')](function(_0x319a52){_0xae605a[_0x0ab0('0x31')][_0x0ab0('0x33')](_0x110676[_0x319a52]);});}delete _0xae605a[_0x0ab0('0x30')];}catch(_0x3ce4d0){_0x30cc46(_0x3ce4d0);}_0x989e82(_0xae605a);});}function updateWhatsappInteraction(_0x1f504c,_0x528468,_0x465b60){return new BPromise(function(_0x2ad0d4,_0x2183ee){return getInteractionUsers(_0x1f504c,_0x465b60)[_0x0ab0('0x26')](function(_0x55fb40){return getInteractionTags(_0x55fb40,_0x528468);})[_0x0ab0('0x26')](function(_0x54072b){return getStateInteraction(_0x54072b);})[_0x0ab0('0x26')](function(_0x596534){_0x2ad0d4(_0x596534);})['catch'](function(_0x4df147){_0x2183ee(_0x4df147);});});}function getStateInteraction(_0x4ca64a){return new BPromise(function(_0x2d6648){_0x4ca64a[_0x0ab0('0x34')]=0x0;_0x4ca64a[_0x0ab0('0x35')]=0x0;_0x4ca64a[_0x0ab0('0x36')]=0x0;_0x4ca64a[_0x0ab0('0x37')]=0x0;_0x4ca64a[_0x0ab0('0x38')]=0x0;if(!_0x4ca64a[_0x0ab0('0x39')]&&!_0x4ca64a['UserId']){_0x4ca64a['waiting']+=0x1;}if(!_0x4ca64a['closed']&&_0x4ca64a[_0x0ab0('0x3a')]){_0x4ca64a[_0x0ab0('0x35')]+=0x1;if(_0x4ca64a[_0x0ab0('0x34')]){_0x4ca64a['waiting']-=0x1;}}if(_0x4ca64a['closed']&&_0x4ca64a[_0x0ab0('0x3a')]){_0x4ca64a[_0x0ab0('0x36')]+=0x1;if(_0x4ca64a[_0x0ab0('0x35')]){_0x4ca64a[_0x0ab0('0x35')]-=0x1;}}if(_0x4ca64a[_0x0ab0('0x39')]&&!_0x4ca64a[_0x0ab0('0x3a')]){_0x4ca64a['unmanaged']+=0x1;if(_0x4ca64a[_0x0ab0('0x34')]){_0x4ca64a['waiting']-=0x1;}}_0x4ca64a['total']+=0x1;_0x2d6648(_0x4ca64a);});}exports[_0x0ab0('0x3b')]=function(_0x5384ab,_0x10dc3e){var _0x10746f={},_0x5be95a={},_0x55d2fa={'count':0x0,'rows':[]};var _0x4b0862=_[_0x0ab0('0x2e')](db[_0x0ab0('0x3c')][_0x0ab0('0x3d')],function(_0x5a0314){return{'name':_0x5a0314[_0x0ab0('0x3e')],'type':_0x5a0314[_0x0ab0('0x3f')][_0x0ab0('0x40')]};});_0x5be95a['model']=_[_0x0ab0('0x2e')](_0x4b0862,_0x0ab0('0x2b'));_0x5be95a[_0x0ab0('0x41')]=_[_0x0ab0('0x42')](_0x5384ab[_0x0ab0('0x41')]);_0x5be95a['filters']=_['intersection'](_0x5be95a[_0x0ab0('0x43')],_0x5be95a[_0x0ab0('0x41')]);_0x10746f[_0x0ab0('0x44')]=_[_0x0ab0('0x45')](_0x5be95a[_0x0ab0('0x43')],qs[_0x0ab0('0x46')](_0x5384ab['query'][_0x0ab0('0x46')]));_0x10746f[_0x0ab0('0x44')]=_0x10746f[_0x0ab0('0x44')][_0x0ab0('0x47')]?_0x10746f['attributes']:_0x5be95a['model'];if(!_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x48')](_0x0ab0('0x49'))){_0x10746f[_0x0ab0('0x1f')]=qs[_0x0ab0('0x1f')](_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x1f')]);_0x10746f['offset']=qs['offset'](_0x5384ab['query'][_0x0ab0('0x1d')]);}_0x10746f[_0x0ab0('0x4a')]=qs[_0x0ab0('0x4b')](_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x4b')]);_0x10746f[_0x0ab0('0x4c')]=qs[_0x0ab0('0x4d')](_['pick'](_0x5384ab[_0x0ab0('0x41')],_0x5be95a[_0x0ab0('0x4d')]),_0x4b0862);var _0x39519e=[];var _0x30d400=squel[_0x0ab0('0x4e')]()[_0x0ab0('0x4f')]('id')[_0x0ab0('0x4f')](_0x0ab0('0x2b'))['field']('color')[_0x0ab0('0x50')](_0x0ab0('0x51'));var _0x151c93=squel[_0x0ab0('0x4e')]()[_0x0ab0('0x4f')](_0x0ab0('0x52'))['field'](_0x0ab0('0x53'))[_0x0ab0('0x4f')](_0x0ab0('0x54'))[_0x0ab0('0x50')](_0x0ab0('0x55'),'ui')[_0x0ab0('0x56')](_0x0ab0('0x57'),'u',_0x0ab0('0x58'));var _0x19ba0a=squel[_0x0ab0('0x4e')]()[_0x0ab0('0x50')](_0x0ab0('0x59'),'i')[_0x0ab0('0x56')](_0x0ab0('0x5a'),'c',_0x0ab0('0x5b'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x0ab0('0x56')](_0x0ab0('0x5c'),'a','a.id\x20=\x20i.WhatsappAccountId')['left_join']('whatsapp_messages','me',_0x0ab0('0x5d'))[_0x0ab0('0x56')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x0ab0('0x51'),'t',_0x0ab0('0x5e'));var _0xb96cf8=squel[_0x0ab0('0x5f')]();var _0x3e507d=[];var _0xf68b1b=squel[_0x0ab0('0x5f')]();var _0x3377d1;if(_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x60')]){_0x3377d1=as[_0x0ab0('0x61')](_0x5384ab[_0x0ab0('0x41')]['search']);var _0x598202=_0x3377d1[_0x0ab0('0x62')];for(var _0x1e5553=0x0;_0x1e5553<_0x3377d1[_0x0ab0('0x63')][_0x0ab0('0x47')];_0x1e5553++){var _0x5ced70=_0x3377d1[_0x0ab0('0x63')][_0x1e5553];var _0x15dedf='i';var _0x53e70d=_['find'](_0x4b0862,[_0x0ab0('0x2b'),_0x5ced70[_0x0ab0('0x4f')]]);if(!_0x53e70d){switch(_0x5ced70[_0x0ab0('0x4f')]){case _0x0ab0('0x64'):if(_0x5ced70['value']==0x1){_0x19ba0a[_0x0ab0('0x65')]('`'+_0x5ced70['field']+'`\x20=\x200');}else{_0x19ba0a[_0x0ab0('0x65')]('`'+_0x5ced70['field']+_0x0ab0('0x66'));}break;case _0x0ab0('0x67'):if(_0x5ced70['operator']===_0x0ab0('0x68')){if(_0x5ced70['value'][_0x0ab0('0x69')]('\x20')['length']>0x1){_0xb96cf8[_0x598202]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0ab0('0x6a')](_0x5ced70[_0x0ab0('0x6b')]),null);}else{var _0x5d8498='%'+_0x5ced70[_0x0ab0('0x6b')]+'%';_0xb96cf8[_0x598202](_0x0ab0('0x6c'),_0x5d8498,_0x5d8498,_0x5d8498);}}else{_0x53e70d=_[_0x0ab0('0x6d')](_0x4b0862,[_0x0ab0('0x2b'),_0x0ab0('0x6e')]);_0x5ced70[_0x0ab0('0x4f')]=_0x0ab0('0x6e');_0x2b4eb2=as[_0x0ab0('0x6f')](_0x15dedf,_0x53e70d[_0x0ab0('0x3f')],_0x5ced70);_0xb96cf8[_0x598202](_0x2b4eb2['text'],_0x2b4eb2['value'][_0x0ab0('0x70')],_0x2b4eb2['value'][_0x0ab0('0x71')]);}break;case'Tag':var _0x1fd4e2=_0x5ced70[_0x0ab0('0x6b')][_0x0ab0('0x69')](',')['map'](function(_0x31b456){return Number(_0x31b456);});_0x1fd4e2[_0x0ab0('0x32')](function(_0x3f404d){_0xf68b1b['or'](_0x0ab0('0x72'),'%,'+_0x3f404d+',%');});_0x3e507d=_[_0x0ab0('0x73')](_0x3e507d,_0x1fd4e2);break;case _0x0ab0('0x74'):if(_0x5ced70[_0x0ab0('0x75')]===_0x0ab0('0x68')){_0xb96cf8[_0x598202]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5ced70[_0x0ab0('0x6b')]+'%',null);}else{_0x53e70d=_[_0x0ab0('0x6d')](_0x4b0862,[_0x0ab0('0x2b'),'UserId']);_0x5ced70[_0x0ab0('0x4f')]=_0x0ab0('0x3a');_0x2b4eb2=as['buildExpression'](_0x15dedf,_0x53e70d[_0x0ab0('0x3f')],_0x5ced70);_0xb96cf8[_0x598202](_0x2b4eb2[_0x0ab0('0x76')],_0x2b4eb2[_0x0ab0('0x6b')][_0x0ab0('0x70')],_0x2b4eb2[_0x0ab0('0x6b')][_0x0ab0('0x71')]);}break;case _0x0ab0('0x77'):_0x2b4eb2=as['buildExpression']('me',null,_0x5ced70);_0xb96cf8[_0x598202](_0x2b4eb2['text'],_0x2b4eb2[_0x0ab0('0x6b')][_0x0ab0('0x70')],_0x2b4eb2[_0x0ab0('0x6b')][_0x0ab0('0x71')]);break;}}else{var _0x2b4eb2=as[_0x0ab0('0x6f')](_0x15dedf,_0x53e70d[_0x0ab0('0x3f')],_0x5ced70);_0xb96cf8[_0x598202](_0x2b4eb2['text'],_0x2b4eb2[_0x0ab0('0x6b')][_0x0ab0('0x70')],_0x2b4eb2['value'][_0x0ab0('0x71')]);}}}else{var _0x593215=_(_0x5384ab['query'])[_0x0ab0('0x42')]()[_0x0ab0('0x2e')](function(_0x10da49){return _[_0x0ab0('0x78')](_0x4b0862,[_0x0ab0('0x2b'),_0x10da49])?_0x10da49:undefined;})[_0x0ab0('0x79')]()['value']();if(!_[_0x0ab0('0x7a')](_0x593215)){_0x593215['forEach'](function(_0x4b62dc){if(_0x4b62dc==='WhatsappAccountId'){_0x19ba0a[_0x0ab0('0x4c')](_0x0ab0('0x7b'),[][_0x0ab0('0x7c')](_0x5384ab[_0x0ab0('0x41')][_0x4b62dc]));}else if(_0x4b62dc===_0x0ab0('0x7d')){var _0x21d6e5=JSON[_0x0ab0('0x7e')](_0x5384ab[_0x0ab0('0x41')][_0x4b62dc])[_0x0ab0('0x7f')];var _0x350323=JSON[_0x0ab0('0x7e')](_0x5384ab[_0x0ab0('0x41')][_0x4b62dc])[_0x0ab0('0x80')];_0x19ba0a[_0x0ab0('0x4c')](_0x0ab0('0x81'),_0x21d6e5,_0x350323);}else{if(_0x5384ab[_0x0ab0('0x41')][_0x4b62dc]===_0x0ab0('0x82')){_0x19ba0a[_0x0ab0('0x4c')]('i.'+_0x4b62dc+_0x0ab0('0x83'));}else{_0x19ba0a['where']('i.'+_0x4b62dc+'\x20=\x20?',_0x5384ab[_0x0ab0('0x41')][_0x4b62dc]);}}});}if(_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x84')]){if(_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x84')]==0x1){_0x19ba0a[_0x0ab0('0x65')](_0x0ab0('0x85'));}else{_0x19ba0a[_0x0ab0('0x65')](_0x0ab0('0x86'));}}if(_0x5384ab['query'][_0x0ab0('0x87')]){_0x3e507d=_[_0x0ab0('0x88')](_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x87')])?_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x87')]:new Array(_0x5384ab['query'][_0x0ab0('0x87')]);_0x3e507d[_0x0ab0('0x32')](function(_0x4632c3){_0xf68b1b['or'](_0x0ab0('0x72'),'%,'+_0x4632c3+',%');});}if(_0x5384ab[_0x0ab0('0x41')]['filter']){var _0x6a68fb=_0x5384ab['query'][_0x0ab0('0x89')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x6a68fb)){_0xb96cf8['or'](_0x0ab0('0x8a'),_0x6a68fb+'%')['or'](_0x0ab0('0x8b'),_0x6a68fb+'%');}else{_0xb96cf8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6a68fb))['or'](_0x0ab0('0x8c'),_0x6a68fb+'%');}}}_0x19ba0a['where'](_0xb96cf8);_0x19ba0a[_0x0ab0('0x8d')](_0x0ab0('0x8e'));var _0x5b893e={'type':db[_0x0ab0('0x8f')][_0x0ab0('0x90')][_0x0ab0('0x91')],'raw':!![]};var _0x3e6a72=_0x19ba0a[_0x0ab0('0x92')]();_0x3e6a72[_0x0ab0('0x4f')]('i.id');_0x3e6a72[_0x0ab0('0x4f')](_0x0ab0('0x93'),_0x0ab0('0x64'));if(_0x10746f['order']){_0x10746f[_0x0ab0('0x4a')][_0x0ab0('0x32')](function(_0x174717){var _0x575489=_0x174717[0x0]==='contactName'?_0x174717[0x0]:'i.'+_0x174717[0x0];_0x19ba0a[_0x0ab0('0x4a')](_0x575489,_0x174717[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0ab0('0x7a')](_0x3e507d)){_0x19ba0a[_0x0ab0('0x65')](_0xf68b1b);_0x3e6a72[_0x0ab0('0x4c')](_0x0ab0('0x94'),_0x3e507d);}BPromise[_0x0ab0('0x95')]()[_0x0ab0('0x26')](function(){if(!_0x3377d1){if(_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x96')])return;_0x3e6a72[_0x0ab0('0x4c')](_0x0ab0('0x97'));_0x19ba0a[_0x0ab0('0x4c')](_0x0ab0('0x97'));return;}if(_0x5384ab[_0x0ab0('0x98')][_0x0ab0('0x99')]!==_0x0ab0('0x9a'))return;return _0x5384ab[_0x0ab0('0x98')][_0x0ab0('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x126d25){if(_[_0x0ab0('0x7a')](_0x126d25)){_0x3e6a72[_0x0ab0('0x4c')]('i.WhatsappAccountId\x20IS\x20NULL');_0x19ba0a[_0x0ab0('0x4c')](_0x0ab0('0x9c'));}else{_0x3e6a72[_0x0ab0('0x4c')](_0x0ab0('0x7b'),_[_0x0ab0('0x2e')](_0x126d25,'id'));_0x19ba0a['where'](_0x0ab0('0x7b'),_[_0x0ab0('0x2e')](_0x126d25,'id'));}});})['then'](function(){if(_0x5384ab[_0x0ab0('0x98')][_0x0ab0('0x99')]===_0x0ab0('0x9a')&&!_0x3377d1&&!_0x5384ab['query']['WhatsappAccountId'])return[];return db[_0x0ab0('0x9d')][_0x0ab0('0x41')](_0x3e6a72['toString'](),_0x5b893e);})[_0x0ab0('0x26')](function(_0xf4a795){_0x55d2fa[_0x0ab0('0x20')]=_0xf4a795[_0x0ab0('0x47')];if(_0x55d2fa[_0x0ab0('0x20')]===0x0)return[];return db[_0x0ab0('0x9d')][_0x0ab0('0x41')](_0x30d400[_0x0ab0('0x9e')](),_0x5b893e)['then'](function(_0x169831){_0x39519e=_[_0x0ab0('0x9f')](_0x169831,'id');_0x5b893e=_[_0x0ab0('0xa0')](_0x5b893e,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5384ab[_0x0ab0('0x41')][_0x0ab0('0x46')]){_0x10746f[_0x0ab0('0x44')][_0x0ab0('0x32')](function(_0x1ae4c7){_0x19ba0a['field']('i.'+_0x1ae4c7);});}else{_0x19ba0a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0ab0('0x64'));_0x19ba0a[_0x0ab0('0x4f')]('a.key',_0x0ab0('0xa1'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xa2'),_0x0ab0('0xa3'));_0x19ba0a['field'](_0x0ab0('0xa4'),_0x0ab0('0xa5'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xa6'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xa7'),_0x0ab0('0xa8'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xa9'),_0x0ab0('0xaa'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xab'),_0x0ab0('0xac'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xad'),_0x0ab0('0xae'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xaf'),'Contact.mobile');_0x19ba0a[_0x0ab0('0x4f')]('c.fax','Contact.fax');_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xb0'),'Owner.fullname');_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xb1'),_0x0ab0('0xb2'));_0x19ba0a[_0x0ab0('0x4f')](_0x0ab0('0xb3'),_0x0ab0('0x30'));}if(_0x10746f['limit'])_0x19ba0a[_0x0ab0('0x1f')](_0x10746f['limit']);if(_0x10746f['offset'])_0x19ba0a['offset'](_0x10746f[_0x0ab0('0x1d')]);return db[_0x0ab0('0x9d')][_0x0ab0('0x41')](_0x19ba0a[_0x0ab0('0x9e')](),_0x5b893e);})[_0x0ab0('0x26')](function(_0x2909f9){if(_0x2909f9[_0x0ab0('0x47')]>0x0)_0x151c93['where'](_0x0ab0('0xb4'),_[_0x0ab0('0x2e')](_0x2909f9,'id'));return db[_0x0ab0('0x9d')][_0x0ab0('0x41')](_0x151c93['toString'](),_0x5b893e)[_0x0ab0('0x26')](function(_0x450f61){var _0x59f4ab=_[_0x0ab0('0xb5')](_0x450f61,_0x0ab0('0xb6'));var _0x26699a=[];_0x2909f9['forEach'](function(_0x22b14e){_0x26699a['push'](updateWhatsappInteraction(_0x22b14e,_0x39519e,_0x59f4ab));});return BPromise[_0x0ab0('0xb7')](_0x26699a);});});})[_0x0ab0('0x26')](function(_0x1cd6a4){_0x55d2fa[_0x0ab0('0xb8')]=_0x1cd6a4;return _0x55d2fa;})['then'](respondWithFilteredResult(_0x10dc3e,_0x10746f))[_0x0ab0('0xb9')](handleError(_0x10dc3e,null));};exports[_0x0ab0('0xba')]=function(_0x217a83,_0x5bfe3f){var _0xd38e84={'raw':![],'where':{'id':_0x217a83[_0x0ab0('0xbb')]['id']}},_0x44a60b={};_0x44a60b[_0x0ab0('0x43')]=_[_0x0ab0('0x42')](db[_0x0ab0('0x3c')]['rawAttributes']);_0x44a60b[_0x0ab0('0x41')]=_['keys'](_0x217a83[_0x0ab0('0x41')]);_0x44a60b[_0x0ab0('0x4d')]=_[_0x0ab0('0x45')](_0x44a60b[_0x0ab0('0x43')],_0x44a60b[_0x0ab0('0x41')]);_0xd38e84[_0x0ab0('0x44')]=_[_0x0ab0('0x45')](_0x44a60b['model'],qs[_0x0ab0('0x46')](_0x217a83[_0x0ab0('0x41')][_0x0ab0('0x46')]));_0xd38e84[_0x0ab0('0x44')]=_0xd38e84['attributes'][_0x0ab0('0x47')]?_0xd38e84['attributes']:_0x44a60b['model'];if(_0x217a83[_0x0ab0('0x41')]['includeAll']){_0xd38e84[_0x0ab0('0xbc')]=[{'all':!![]}];}_0xd38e84=_[_0x0ab0('0xa0')]({},_0xd38e84,_0x217a83[_0x0ab0('0xbd')]);return db[_0x0ab0('0x3c')][_0x0ab0('0x6d')](_0xd38e84)[_0x0ab0('0x26')](handleEntityNotFound(_0x5bfe3f,null))[_0x0ab0('0x26')](respondWithResult(_0x5bfe3f,null))[_0x0ab0('0xb9')](handleError(_0x5bfe3f,null));};exports[_0x0ab0('0xbe')]=function(_0x4da8c0,_0x4824d4){return db[_0x0ab0('0x3c')]['create'](_0x4da8c0['body'],{})[_0x0ab0('0x26')](respondWithResult(_0x4824d4,0xc9))[_0x0ab0('0xb9')](handleError(_0x4824d4,null));};exports['update']=function(_0x24a5ff,_0x2b4930){if(_0x24a5ff[_0x0ab0('0x77')]['id']){delete _0x24a5ff[_0x0ab0('0x77')]['id'];}return db[_0x0ab0('0x3c')]['find']({'where':{'id':_0x24a5ff[_0x0ab0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2b4930,null))[_0x0ab0('0x26')](saveUpdates(_0x24a5ff['body'],null))['then'](respondWithResult(_0x2b4930,null))[_0x0ab0('0xb9')](handleError(_0x2b4930,null));};exports['destroy']=function(_0x2e0861,_0x45b251){return db[_0x0ab0('0x3c')][_0x0ab0('0x6d')]({'where':{'id':_0x2e0861['params']['id']}})[_0x0ab0('0x26')](handleEntityNotFound(_0x45b251,null))[_0x0ab0('0x26')](removeEntity(_0x45b251,null))['catch'](handleError(_0x45b251,null));};exports[_0x0ab0('0xbf')]=function(_0x36720b,_0x3f6bff){return db[_0x0ab0('0x3c')]['describe']()[_0x0ab0('0x26')](respondWithResult(_0x3f6bff,null))['catch'](handleError(_0x3f6bff,null));};exports['addMessage']=function(_0x1c357a,_0x53afb6,_0x8ab65f){return db[_0x0ab0('0xc0')][_0x0ab0('0x6d')]({'where':{'id':_0x1c357a['params']['id']}})[_0x0ab0('0x26')](handleEntityNotFound(_0x53afb6,null))['then'](function(_0x569069){if(_0x569069){return _0x569069[_0x0ab0('0xc1')](_0x1c357a[_0x0ab0('0x77')][_0x0ab0('0xc2')],_[_0x0ab0('0xc3')](_0x1c357a['body'],[_0x0ab0('0xc2'),'id'])||{});}})[_0x0ab0('0x26')](respondWithResult(_0x53afb6,null))['catch'](handleError(_0x53afb6,null));};exports[_0x0ab0('0xc4')]=function(_0x13bae3,_0x3fa70,_0x32fa22){var _0x4c3271={'raw':![],'where':{}};var _0x554170={};var _0x270ea7={'count':0x0,'rows':[]};return db[_0x0ab0('0x3c')][_0x0ab0('0xc5')]({'where':{'id':_0x13bae3[_0x0ab0('0xbb')]['id']}})[_0x0ab0('0x26')](handleEntityNotFound(_0x3fa70,null))[_0x0ab0('0x26')](function(_0x1fb5b2){if(_0x1fb5b2){_0x554170[_0x0ab0('0x43')]=_['keys'](db[_0x0ab0('0xc0')][_0x0ab0('0x3d')]);_0x554170['query']=_[_0x0ab0('0x42')](_0x13bae3['query']);_0x554170['filters']=_[_0x0ab0('0x45')](_0x554170['model'],_0x554170[_0x0ab0('0x41')]);_0x4c3271[_0x0ab0('0x44')]=_[_0x0ab0('0x45')](_0x554170[_0x0ab0('0x43')],qs[_0x0ab0('0x46')](_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x46')]));_0x4c3271[_0x0ab0('0x44')]=_0x4c3271[_0x0ab0('0x44')][_0x0ab0('0x47')]?_0x4c3271[_0x0ab0('0x44')]:_0x554170[_0x0ab0('0x43')];if(!_0x13bae3['query'][_0x0ab0('0x48')](_0x0ab0('0x49'))){_0x4c3271['limit']=qs['limit'](_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x1f')]);_0x4c3271[_0x0ab0('0x1d')]=qs['offset'](_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x1d')]);}_0x4c3271['order']=qs[_0x0ab0('0x4b')](_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x4b')]);_0x4c3271[_0x0ab0('0x4c')]=qs['filters'](_[_0x0ab0('0xc6')](_0x13bae3[_0x0ab0('0x41')],_0x554170[_0x0ab0('0x4d')]));_0x4c3271[_0x0ab0('0x4c')][_0x0ab0('0xb6')]=_0x1fb5b2['id'];if(_0x13bae3['query'][_0x0ab0('0x89')]){_0x4c3271['where']=_[_0x0ab0('0xa0')](_0x4c3271[_0x0ab0('0x4c')],{'$or':_[_0x0ab0('0x2e')](_0x4c3271[_0x0ab0('0x44')],function(_0x27337f){var _0x4acbab={};_0x4acbab[_0x27337f]={'$like':'%'+_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x89')]+'%'};return _0x4acbab;})});}if(_0x13bae3['query']['$gte']){var _0x795e58=_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0x7f')][_0x0ab0('0x69')](',');var _0x4b7e2b={};_0x4b7e2b[_0x795e58[0x0]]={'$gte':moment(_0x795e58[0x1])[_0x0ab0('0xc7')](_0x0ab0('0xc8'))};_0x4c3271[_0x0ab0('0x4c')]=_[_0x0ab0('0xa0')](_0x4c3271[_0x0ab0('0x4c')],_0x4b7e2b);}_0x4c3271=_[_0x0ab0('0xa0')]({},_0x4c3271,_0x13bae3[_0x0ab0('0xbd')]);return db[_0x0ab0('0xc0')]['count']({'where':_0x4c3271[_0x0ab0('0x4c')]})[_0x0ab0('0x26')](function(_0x34539d){_0x270ea7[_0x0ab0('0x20')]=_0x34539d;if(_0x13bae3[_0x0ab0('0x41')][_0x0ab0('0xc9')]){_0x4c3271[_0x0ab0('0xbc')]=[{'all':!![]}];}return db[_0x0ab0('0xc0')][_0x0ab0('0xca')](_0x4c3271);})[_0x0ab0('0x26')](function(_0x362392){_0x270ea7['rows']=_0x362392;return _0x270ea7;});}})[_0x0ab0('0x26')](respondWithFilteredResult(_0x3fa70,_0x4c3271))[_0x0ab0('0xb9')](handleError(_0x3fa70,null));};exports[_0x0ab0('0xcb')]=function(_0x1339ad,_0x321711,_0x4f5969){return db[_0x0ab0('0x3c')]['find']({'where':{'id':_0x1339ad[_0x0ab0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x321711,null))[_0x0ab0('0x26')](function(_0x5ed1b6){if(_0x5ed1b6){return _0x5ed1b6[_0x0ab0('0xcc')](_0x1339ad[_0x0ab0('0x77')]['ids'],_[_0x0ab0('0xc3')](_0x1339ad['body'],['ids','id'])||{})['spread'](function(){return db[_0x0ab0('0xcd')][_0x0ab0('0xca')]({'attributes':['id',_0x0ab0('0x2b'),'color'],'where':{'id':_0x1339ad[_0x0ab0('0x77')][_0x0ab0('0xc2')]}});})[_0x0ab0('0x26')](function(_0x505d94){socket[_0x0ab0('0xce')](_0x0ab0('0xcf'),{'id':Number(_0x1339ad[_0x0ab0('0xbb')]['id']),'tags':_0x505d94||[]});return{'id':Number(_0x1339ad[_0x0ab0('0xbb')]['id']),'tags':_0x505d94||[]};});}})[_0x0ab0('0x26')](respondWithResult(_0x321711,null))[_0x0ab0('0xb9')](handleError(_0x321711,null));};exports[_0x0ab0('0xd0')]=function(_0x1497d2,_0x2a0f31,_0x4ee674){return db[_0x0ab0('0x3c')][_0x0ab0('0x6d')]({'where':{'id':_0x1497d2[_0x0ab0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2a0f31,null))['then'](function(_0x5670f0){if(_0x5670f0){return _0x5670f0[_0x0ab0('0xd0')](_0x1497d2[_0x0ab0('0x41')][_0x0ab0('0xc2')]);}})[_0x0ab0('0x26')](respondWithStatusCode(_0x2a0f31,null))[_0x0ab0('0xb9')](handleError(_0x2a0f31,null));};exports['download']=function(_0x537758,_0x315196){var _0x121630=moment()[_0x0ab0('0xd1')]()[_0x0ab0('0x9e')]();var _0x47a05d=path[_0x0ab0('0xd2')](config['root'],'server',_0x0ab0('0xd3'),'tmp');var _0x25ace2=path[_0x0ab0('0xd2')](config[_0x0ab0('0xd4')],_0x0ab0('0xd5'),'files',_0x0ab0('0xd6'));var _0x226cd1=path['join'](_0x47a05d,_0x121630);var _0x42bafb=util[_0x0ab0('0xc7')](_0x0ab0('0xd7'),_0x537758[_0x0ab0('0xbb')]['id'],_0x121630);var _0x5c7936=path[_0x0ab0('0xd2')](_0x47a05d,_0x42bafb);var _0x26983e=[];_0x26983e[_0x0ab0('0x33')]({'model':db[_0x0ab0('0x74')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x26983e[_0x0ab0('0x33')]({'model':db['CmContact'],'as':_0x0ab0('0x67'),'attributes':['id','firstName',_0x0ab0('0xd8')],'raw':!![]});if(_0x537758[_0x0ab0('0x41')][_0x0ab0('0xd6')]){_0x26983e[_0x0ab0('0x33')]({'model':db[_0x0ab0('0xd9')],'as':'Attachment','raw':!![]});}var _0x1d6cd4=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body',_0x0ab0('0x7d'),_0x0ab0('0xda'),_0x0ab0('0xdb'),'read'],'include':_0x26983e}];_0x1d6cd4['push']({'model':db[_0x0ab0('0xdc')],'as':_0x0ab0('0xdd'),'attributes':['id','name']});_0x1d6cd4[_0x0ab0('0x33')]({'model':db[_0x0ab0('0x74')],'as':_0x0ab0('0xde'),'attributes':['id',_0x0ab0('0x2f')]});return db[_0x0ab0('0x3c')][_0x0ab0('0x6d')]({'where':{'id':_0x537758['params']['id']},'include':_0x1d6cd4})['then'](handleEntityNotFound(_0x315196,null))['then'](function(_0x3cbab6){if(_0x3cbab6){var _0x1115e1=_0x3cbab6['get']({'plain':!![]});fs[_0x0ab0('0xdf')](_0x226cd1);var _0x3aa92d={'channel':_0x0ab0('0xe0'),'account':_0x1115e1[_0x0ab0('0xdd')][_0x0ab0('0x2b')],'agent':_0x1115e1['Owner']?_0x1115e1[_0x0ab0('0xde')]['fullname']:_0x0ab0('0xe1'),'createdAt':moment(_0x1115e1['createdAt'])[_0x0ab0('0xc7')](_0x0ab0('0xc8'))[_0x0ab0('0x9e')](),'closedAt':_0x1115e1[_0x0ab0('0x39')]?moment(_0x1115e1['closedAt'])[_0x0ab0('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0ab0('0x9e')]():'','disposition':_0x1115e1[_0x0ab0('0xe2')],'messages':_(_0x1115e1[_0x0ab0('0xe3')])[_0x0ab0('0x89')]({'secret':![]})['map'](function(_0x499a6f){if(_0x499a6f['Attachment']){var _0x4945ee=path[_0x0ab0('0xd2')](_0x25ace2,_0x499a6f[_0x0ab0('0xd9')][_0x0ab0('0xe4')]);if(fs['existsSync'](_0x4945ee)){fs[_0x0ab0('0xe5')](_0x4945ee)[_0x0ab0('0xe6')](fs[_0x0ab0('0xe7')](path[_0x0ab0('0xd2')](_0x226cd1,_0x499a6f[_0x0ab0('0xd9')]['basename'])));}}return{'date':moment(_0x499a6f[_0x0ab0('0x7d')])[_0x0ab0('0xc7')](_0x0ab0('0xc8'))[_0x0ab0('0x9e')](),'sender':_0x499a6f['direction']===_0x0ab0('0xe8')?_0x499a6f['User']?_0x499a6f['User'][_0x0ab0('0x2f')]:_0x0ab0('0xe9'):_0x499a6f['Contact'][_0x0ab0('0xea')]+(_0x499a6f[_0x0ab0('0x67')][_0x0ab0('0xd8')]?'\x20'+_0x499a6f['Contact'][_0x0ab0('0xd8')]:''),'body':_0x499a6f[_0x0ab0('0xd9')]?_0x499a6f['Attachment']['basename']:_0x499a6f[_0x0ab0('0x77')],'direction':_0x499a6f[_0x0ab0('0xda')]===_0x0ab0('0xe8')?'A':'C','secret':_0x499a6f[_0x0ab0('0xdb')],'read':_0x499a6f['read'],'attachment':_0x499a6f['Attachment']};})['value']()};return ejs[_0x0ab0('0xeb')](path['join'](config[_0x0ab0('0xd4')],_0x0ab0('0xd5'),'views',_0x0ab0('0xec')),{'interaction':_0x3aa92d})[_0x0ab0('0x26')](function(_0x3d0c34){var _0x2f6679=path[_0x0ab0('0xd2')](_0x226cd1,_0x0ab0('0xed')+_0x1115e1['id']+'-'+_0x121630+'.pdf');var _0x577fc9={'path':_0x2f6679,'channel':_0x0ab0('0xe0'),'interactionId':_0x1115e1['id']};return pdf[_0x0ab0('0xee')](_0x3d0c34,_0x577fc9);})[_0x0ab0('0x26')](function(){return new BPromise(function(_0x4168cd,_0x1f3e79){zipdir(_0x226cd1,{'saveTo':_0x5c7936},function(_0x2b9437,_0x38b771){if(_0x2b9437)return _0x1f3e79(_0x2b9437);return _0x4168cd(_0x38b771);});})['then'](function(){return new BPromise(function(_0x2b14af,_0x4c8b6a){rimraf(_0x226cd1,function(_0x4b1af8){if(_0x4b1af8)_0x4c8b6a(_0x4b1af8);return _0x2b14af();});});})[_0x0ab0('0x26')](function(){return _0x315196[_0x0ab0('0xef')](_0x5c7936,_0x42bafb,function(_0x2e96b3){if(_0x2e96b3){console[_0x0ab0('0xf0')](_0x0ab0('0xf1'),_0x2e96b3);}else{fs[_0x0ab0('0xf2')](_0x5c7936);}});});});}else{return _0x315196[_0x0ab0('0x29')](0xc8);}})[_0x0ab0('0xb9')](handleError(_0x315196,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 88be6f2..d0d2f23 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','getUsers','then'];(function(_0x2ff16c,_0x42189c){var _0x2dd982=function(_0x355fc9){while(--_0x355fc9){_0x2ff16c['push'](_0x2ff16c['shift']());}};_0x2dd982(++_0x42189c);}(_0xa571,0x107));var _0x1a57=function(_0x5d73b2,_0x1ea5cd){_0x5d73b2=_0x5d73b2-0x0;var _0x1e4551=_0xa571[_0x5d73b2];return _0x1e4551;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var WhatsappInteraction=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var WhatsappMessage=require(_0x1a57('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':_0x1a57('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f2c44){return function(_0x5067fa,_0xa58922,_0xd97a33){_0x5067fa[_0x1a57('0x5')]({'attributes':['id'],'raw':!![]})[_0x1a57('0x6')](function(_0x2492f5){_0x5067fa[_0x1a57('0x7')]('Users',_0x2492f5[_0x1a57('0x8')](function(_0x3d5770){return{'id':_0x3d5770['id']};}));return WhatsappMessage[_0x1a57('0x9')]({'where':{'WhatsappInteractionId':_0x5067fa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3c8182){_0x5067fa[_0x1a57('0x7')](_0x1a57('0xa'),_0x3c8182[_0x1a57('0xb')]);WhatsappInteractionEvents[_0x1a57('0xc')](_0x1f2c44+':'+_0x5067fa['id'],_0x5067fa);WhatsappInteractionEvents[_0x1a57('0xc')](_0x1f2c44,_0x5067fa);_0xd97a33(null);})[_0x1a57('0xd')](_0xd97a33(null));};}for(var e in events){if(events[_0x1a57('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xc4e6=['setMaxListeners','save','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x2f741f,_0x1010a1){var _0x430080=function(_0x591c1b){while(--_0x591c1b){_0x2f741f['push'](_0x2f741f['shift']());}};_0x430080(++_0x1010a1);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xc4e6[_0x279368];return _0x40b6d0;};'use strict';var EventEmitter=require(_0x6c4e('0x0'));var WhatsappInteraction=require(_0x6c4e('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6c4e('0x1'))['db'][_0x6c4e('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6c4e('0x3')](0x0);var events={'afterCreate':_0x6c4e('0x4'),'afterUpdate':'update','afterDestroy':_0x6c4e('0x5')};function emitEvent(_0x358bfb){return function(_0x297887,_0x5d8d70,_0x266061){_0x297887['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3355f9){_0x297887[_0x6c4e('0x6')](_0x6c4e('0x7'),_0x3355f9[_0x6c4e('0x8')](function(_0x3929d8){return{'id':_0x3929d8['id']};}));return WhatsappMessage[_0x6c4e('0x9')]({'where':{'WhatsappInteractionId':_0x297887['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6c4e('0xa')](function(_0x2231a7){_0x297887[_0x6c4e('0x6')](_0x6c4e('0xb'),_0x2231a7[_0x6c4e('0xc')]);WhatsappInteractionEvents[_0x6c4e('0xd')](_0x358bfb+':'+_0x297887['id'],_0x297887);WhatsappInteractionEvents['emit'](_0x358bfb,_0x297887);_0x266061(null);})['catch'](_0x266061(null));};}for(var e in events){if(events[_0x6c4e('0xe')](e)){var event=events[e];WhatsappInteraction[_0x6c4e('0xf')](e,emitEvent(event));}}module[_0x6c4e('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e81d4a9..af6cde9 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf61e=['whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0x37f0c5,_0xd63a76){var _0x1d9a14=function(_0x2d99ee){while(--_0x2d99ee){_0x37f0c5['push'](_0x37f0c5['shift']());}};_0x1d9a14(++_0xd63a76);}(_0xf61e,0x191));var _0xef61=function(_0x11ce56,_0x2fd474){_0x11ce56=_0x11ce56-0x0;var _0x48af95=_0xf61e[_0x11ce56];return _0x48af95;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('WhatsappInteraction',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x277fa1,_0x106e7f,_0x4dba00){if(_0x277fa1['changed'](_0xef61('0xe'))){_0x277fa1[_0xef61('0xf')]=moment()[_0xef61('0x10')](_0xef61('0x11'));}_0x4dba00(null,_0x277fa1);}}});}; \ No newline at end of file +var _0xd8fe=['path','rimraf','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise'];(function(_0x1e440c,_0x3b2ca5){var _0x3cfab5=function(_0x905734){while(--_0x905734){_0x1e440c['push'](_0x1e440c['shift']());}};_0x3cfab5(++_0x3b2ca5);}(_0xd8fe,0xfa));var _0xed8f=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xd8fe[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xed8f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed8f('0x1'));var moment=require(_0xed8f('0x2'));var BPromise=require(_0xed8f('0x3'));var rp=require(_0xed8f('0x4'));var fs=require('fs');var path=require(_0xed8f('0x5'));var rimraf=require(_0xed8f('0x6'));var config=require('../../config/environment');var attributes=require(_0xed8f('0x7'));module['exports']=function(_0x151332,_0x29aa00){return _0x151332['define'](_0xed8f('0x8'),attributes,{'tableName':_0xed8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c6429,_0x345d91,_0x505f04){if(_0x2c6429[_0xed8f('0xa')](_0xed8f('0xb'))){_0x2c6429[_0xed8f('0xc')]=moment()[_0xed8f('0xd')](_0xed8f('0xe'));}_0x505f04(null,_0x2c6429);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 1e02a8a..94ae19f 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f12=['./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateWhatsappInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x3bbbd2,_0x1eb322){var _0x196fa7=function(_0x5c0f69){while(--_0x5c0f69){_0x3bbbd2['push'](_0x3bbbd2['shift']());}};_0x196fa7(++_0x1eb322);}(_0x2f12,0xd3));var _0x22f1=function(_0x38e200,_0x506703){_0x38e200=_0x38e200-0x0;var _0x349995=_0x2f12[_0x38e200];return _0x349995;};'use strict';var _=require(_0x22f1('0x0'));var util=require(_0x22f1('0x1'));var moment=require('moment');var BPromise=require(_0x22f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22f1('0x3'));var db=require(_0x22f1('0x4'))['db'];var utils=require(_0x22f1('0x5'));var logger=require(_0x22f1('0x6'))(_0x22f1('0x7'));var config=require(_0x22f1('0x8'));var jayson=require(_0x22f1('0x9'));var client=jayson['client'][_0x22f1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x22f1('0xb')],{'host':_0x22f1('0xc'),'port':0x18eb});var socket=require(_0x22f1('0xd'))(new Redis(config['redis']));require(_0x22f1('0xe'))[_0x22f1('0xf')](socket);function respondWithRpcPromise(_0x555381,_0x2f92f1,_0x5140c9){return new BPromise(function(_0x55310d,_0x2900fc){return client[_0x22f1('0x10')](_0x555381,_0x5140c9)[_0x22f1('0x11')](function(_0x48c15a){logger['info'](_0x22f1('0x12'),_0x2f92f1,_0x22f1('0x13'));logger[_0x22f1('0x14')](_0x22f1('0x15'),_0x2f92f1,_0x22f1('0x13'),JSON[_0x22f1('0x16')](_0x48c15a));if(_0x48c15a[_0x22f1('0x17')]){if(_0x48c15a['error'][_0x22f1('0x18')]===0x1f4){logger[_0x22f1('0x17')](_0x22f1('0x12'),_0x2f92f1,_0x48c15a['error']['message']);return _0x2900fc(_0x48c15a[_0x22f1('0x17')][_0x22f1('0x19')]);}logger[_0x22f1('0x17')](_0x22f1('0x12'),_0x2f92f1,_0x48c15a[_0x22f1('0x17')][_0x22f1('0x19')]);return _0x55310d(_0x48c15a['error'][_0x22f1('0x19')]);}else{logger[_0x22f1('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x2f92f1,_0x22f1('0x13'));_0x55310d(_0x48c15a[_0x22f1('0x1b')]['message']);}})['catch'](function(_0x39cc3b){logger[_0x22f1('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x2f92f1,_0x39cc3b);_0x2900fc(_0x39cc3b);});});}exports[_0x22f1('0x1c')]=function(_0x4f968b){var _0x58eee1=this;return new Promise(function(_0x4f0919,_0x18bc7d){return db['WhatsappInteraction'][_0x22f1('0x1d')](_0x4f968b['body'],{'raw':_0x4f968b[_0x22f1('0x1e')]?_0x4f968b[_0x22f1('0x1e')][_0x22f1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f968b[_0x22f1('0x1e')]?_0x4f968b[_0x22f1('0x1e')][_0x22f1('0x20')]||null:null,'attributes':_0x4f968b['options']?_0x4f968b[_0x22f1('0x1e')][_0x22f1('0x21')]||null:null,'limit':_0x4f968b[_0x22f1('0x1e')]?_0x4f968b['options'][_0x22f1('0x22')]||null:null})['then'](function(_0x3e2fde){logger[_0x22f1('0x1a')](_0x22f1('0x1c'),_0x4f968b);logger[_0x22f1('0x14')](_0x22f1('0x1c'),_0x4f968b,JSON['stringify'](_0x3e2fde));_0x4f0919(_0x3e2fde);})[_0x22f1('0x23')](function(_0x12762d){logger[_0x22f1('0x17')](_0x22f1('0x1c'),_0x12762d['message'],_0x4f968b);_0x18bc7d(_0x58eee1[_0x22f1('0x17')](0x1f4,_0x12762d[_0x22f1('0x19')]));});});};exports[_0x22f1('0x24')]=function(_0x1eb928){return new Promise(function(_0x3d2c0a,_0x2b4113){return db[_0x22f1('0x25')][_0x22f1('0x26')]({'where':_0x1eb928[_0x22f1('0x1e')]?_0x1eb928[_0x22f1('0x1e')]['where']||null:null})[_0x22f1('0x11')](function(_0x2e66c3){if(_0x2e66c3){return _0x2e66c3[_0x22f1('0x27')](_0x1eb928[_0x22f1('0x28')][_0x22f1('0x29')],_[_0x22f1('0x2a')](_0x1eb928['body'],['ids','id'])||{});}})[_0x22f1('0x2b')](function(_0xfb3d77){logger[_0x22f1('0x1a')](_0x22f1('0x2c'),_0x1eb928);logger['debug'](_0x22f1('0x2c'),_0x1eb928,JSON[_0x22f1('0x16')](_0xfb3d77));_0x3d2c0a(_0xfb3d77);})[_0x22f1('0x23')](function(_0x429158){logger['error']('AddTags',_0x429158['message'],_0x1eb928);_0x2b4113(_this['error'](0x1f4,_0x429158['message']));});});}; \ No newline at end of file +var _0xcedd=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','WhatsappInteraction','update','options','raw','where','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','body','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug'];(function(_0x38fd39,_0x43e8c3){var _0x1f694d=function(_0x45d45c){while(--_0x45d45c){_0x38fd39['push'](_0x38fd39['shift']());}};_0x1f694d(++_0x43e8c3);}(_0xcedd,0x68));var _0xdced=function(_0x194b4c,_0x7c9ca2){_0x194b4c=_0x194b4c-0x0;var _0x1fdd22=_0xcedd[_0x194b4c];return _0x1fdd22;};'use strict';var _=require(_0xdced('0x0'));var util=require(_0xdced('0x1'));var moment=require(_0xdced('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdced('0x3'));var db=require(_0xdced('0x4'))['db'];var utils=require(_0xdced('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdced('0x6'));var jayson=require(_0xdced('0x7'));var client=jayson[_0xdced('0x8')][_0xdced('0x9')]({'port':0x232a});config[_0xdced('0xa')]=_[_0xdced('0xb')](config['redis'],{'host':_0xdced('0xc'),'port':0x18eb});var socket=require(_0xdced('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x518b0e,_0xb1e9bc,_0x54d973){return new BPromise(function(_0x341897,_0x4f549e){return client[_0xdced('0xe')](_0x518b0e,_0x54d973)[_0xdced('0xf')](function(_0x310de1){logger[_0xdced('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0xb1e9bc,_0xdced('0x11'));logger[_0xdced('0x12')](_0xdced('0x13'),_0xb1e9bc,_0xdced('0x11'),JSON[_0xdced('0x14')](_0x310de1));if(_0x310de1[_0xdced('0x15')]){if(_0x310de1[_0xdced('0x15')][_0xdced('0x16')]===0x1f4){logger[_0xdced('0x15')](_0xdced('0x17'),_0xb1e9bc,_0x310de1[_0xdced('0x15')][_0xdced('0x18')]);return _0x4f549e(_0x310de1[_0xdced('0x15')][_0xdced('0x18')]);}logger[_0xdced('0x15')](_0xdced('0x17'),_0xb1e9bc,_0x310de1[_0xdced('0x15')]['message']);return _0x341897(_0x310de1[_0xdced('0x15')][_0xdced('0x18')]);}else{logger[_0xdced('0x10')](_0xdced('0x17'),_0xb1e9bc,_0xdced('0x11'));_0x341897(_0x310de1[_0xdced('0x19')][_0xdced('0x18')]);}})[_0xdced('0x1a')](function(_0xad3817){logger[_0xdced('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0xb1e9bc,_0xad3817);_0x4f549e(_0xad3817);});});}exports['UpdateWhatsappInteraction']=function(_0x3ce4e3){var _0x522e90=this;return new Promise(function(_0x1b81fd,_0x2c2216){return db[_0xdced('0x1b')][_0xdced('0x1c')](_0x3ce4e3['body'],{'raw':_0x3ce4e3[_0xdced('0x1d')]?_0x3ce4e3[_0xdced('0x1d')][_0xdced('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce4e3[_0xdced('0x1d')]?_0x3ce4e3[_0xdced('0x1d')][_0xdced('0x1f')]||null:null,'attributes':_0x3ce4e3[_0xdced('0x1d')]?_0x3ce4e3['options']['attributes']||null:null,'limit':_0x3ce4e3['options']?_0x3ce4e3['options'][_0xdced('0x20')]||null:null})[_0xdced('0xf')](function(_0x46af23){logger[_0xdced('0x10')](_0xdced('0x21'),_0x3ce4e3);logger['debug'](_0xdced('0x21'),_0x3ce4e3,JSON['stringify'](_0x46af23));_0x1b81fd(_0x46af23);})['catch'](function(_0x271731){logger[_0xdced('0x15')](_0xdced('0x21'),_0x271731['message'],_0x3ce4e3);_0x2c2216(_0x522e90[_0xdced('0x15')](0x1f4,_0x271731['message']));});});};exports[_0xdced('0x22')]=function(_0x3672d5){return new Promise(function(_0x3b2749,_0x2fe25a){return db[_0xdced('0x1b')][_0xdced('0x23')]({'where':_0x3672d5[_0xdced('0x1d')]?_0x3672d5[_0xdced('0x1d')][_0xdced('0x1f')]||null:null})[_0xdced('0xf')](function(_0x4dd7a3){if(_0x4dd7a3){return _0x4dd7a3[_0xdced('0x24')](_0x3672d5['body'][_0xdced('0x25')],_['omit'](_0x3672d5[_0xdced('0x26')],[_0xdced('0x25'),'id'])||{});}})[_0xdced('0x27')](function(_0x1dce66){logger[_0xdced('0x10')]('AddTags',_0x3672d5);logger[_0xdced('0x12')](_0xdced('0x28'),_0x3672d5,JSON[_0xdced('0x14')](_0x1dce66));_0x3b2749(_0x1dce66);})[_0xdced('0x1a')](function(_0x498686){logger['error'](_0xdced('0x28'),_0x498686[_0xdced('0x18')],_0x3672d5);_0x2fe25a(_this[_0xdced('0x15')](0x1f4,_0x498686['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9b13962..40a9991 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6744=['removeListener','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0x6744,0x16e));var _0x4674=function(_0x5cd207,_0x2763ea){_0x5cd207=_0x5cd207-0x0;var _0x49865f=_0x6744[_0x5cd207];return _0x49865f;};'use strict';var WhatsappInteractionEvents=require(_0x4674('0x0'));var events=[_0x4674('0x1'),_0x4674('0x2'),_0x4674('0x3')];function createListener(_0x25dd06,_0x173fb2){return function(_0x174902){_0x173fb2[_0x4674('0x4')](_0x25dd06,_0x174902);};}function removeListener(_0x5d39a6,_0x2dd383){return function(){WhatsappInteractionEvents[_0x4674('0x5')](_0x5d39a6,_0x2dd383);};}exports['register']=function(_0xcc1ebf){for(var _0x195da8=0x0,_0x295d79=events['length'];_0x195da8<_0x295d79;_0x195da8++){var _0x8f54e0=events[_0x195da8];var _0x382a7f=createListener(_0x4674('0x6')+_0x8f54e0,_0xcc1ebf);WhatsappInteractionEvents['on'](_0x8f54e0,_0x382a7f);}}; \ No newline at end of file +var _0x8fb5=['./whatsappInteraction.events','save','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x5e9d4c,_0xf936fa){var _0x4fa9d9=function(_0x5a253b){while(--_0x5a253b){_0x5e9d4c['push'](_0x5e9d4c['shift']());}};_0x4fa9d9(++_0xf936fa);}(_0x8fb5,0x1b2));var _0x58fb=function(_0x37ec07,_0x4d7bf5){_0x37ec07=_0x37ec07-0x0;var _0xbe29e2=_0x8fb5[_0x37ec07];return _0xbe29e2;};'use strict';var WhatsappInteractionEvents=require(_0x58fb('0x0'));var events=[_0x58fb('0x1'),'remove','update'];function createListener(_0x450540,_0x22e1ac){return function(_0x46f5e5){_0x22e1ac[_0x58fb('0x2')](_0x450540,_0x46f5e5);};}function removeListener(_0x407f79,_0x2d5712){return function(){WhatsappInteractionEvents[_0x58fb('0x3')](_0x407f79,_0x2d5712);};}exports[_0x58fb('0x4')]=function(_0x46518d){for(var _0x4131c7=0x0,_0x6293fa=events[_0x58fb('0x5')];_0x4131c7<_0x6293fa;_0x4131c7++){var _0x3d2c61=events[_0x4131c7];var _0x4c41e0=createListener(_0x58fb('0x6')+_0x3d2c61,_0x46518d);WhatsappInteractionEvents['on'](_0x3d2c61,_0x4c41e0);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index a34b83f..5f975f0 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a93=['create','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked'];(function(_0x115475,_0x5c6757){var _0x1eb4c6=function(_0x1c8a95){while(--_0x1c8a95){_0x115475['push'](_0x115475['shift']());}};_0x1eb4c6(++_0x5c6757);}(_0x7a93,0x14e));var _0x37a9=function(_0x14ae7d,_0x3a2c94){_0x14ae7d=_0x14ae7d-0x0;var _0x5d7881=_0x7a93[_0x14ae7d];return _0x5d7881;};'use strict';var multer=require(_0x37a9('0x0'));var util=require(_0x37a9('0x1'));var path=require(_0x37a9('0x2'));var timeout=require(_0x37a9('0x3'));var express=require('express');var router=express[_0x37a9('0x4')]();var fs_extra=require(_0x37a9('0x5'));var auth=require(_0x37a9('0x6'));var interaction=require(_0x37a9('0x7'));var config=require('../../config/environment');var controller=require(_0x37a9('0x8'));router[_0x37a9('0x9')]('/',auth['isAuthenticated'](),controller[_0x37a9('0xa')]);router['get'](_0x37a9('0xb'),auth[_0x37a9('0xc')](),controller['describe']);router[_0x37a9('0x9')](_0x37a9('0xd'),auth['isAuthenticated'](),controller[_0x37a9('0xe')]);router[_0x37a9('0xf')]('/',auth['isAuthenticated'](),interaction[_0x37a9('0x10')]('whatsapp','whatsappmessage:create'),controller[_0x37a9('0x11')]);router[_0x37a9('0xf')](_0x37a9('0x12'),controller[_0x37a9('0x13')]);router[_0x37a9('0x14')](_0x37a9('0xd'),auth[_0x37a9('0xc')](),controller['update']);router[_0x37a9('0x14')]('/:id/accept',auth[_0x37a9('0xc')](),controller[_0x37a9('0x15')]);router[_0x37a9('0x14')](_0x37a9('0x16'),auth['isAuthenticated'](),controller[_0x37a9('0x17')]);router[_0x37a9('0x18')](_0x37a9('0xd'),auth[_0x37a9('0xc')](),controller[_0x37a9('0x19')]);module[_0x37a9('0x1a')]=router; \ No newline at end of file +var _0x7aee=['accept','/:id/reject','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept'];(function(_0x2903ec,_0x4adec2){var _0x50251f=function(_0x261a81){while(--_0x261a81){_0x2903ec['push'](_0x2903ec['shift']());}};_0x50251f(++_0x4adec2);}(_0x7aee,0x1be));var _0xe7ae=function(_0x16781c,_0x165e9b){_0x16781c=_0x16781c-0x0;var _0x2b4aee=_0x7aee[_0x16781c];return _0x2b4aee;};'use strict';var multer=require(_0xe7ae('0x0'));var util=require(_0xe7ae('0x1'));var path=require('path');var timeout=require(_0xe7ae('0x2'));var express=require(_0xe7ae('0x3'));var router=express[_0xe7ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe7ae('0x6'));var controller=require(_0xe7ae('0x7'));router[_0xe7ae('0x8')]('/',auth[_0xe7ae('0x9')](),controller[_0xe7ae('0xa')]);router['get'](_0xe7ae('0xb'),auth[_0xe7ae('0x9')](),controller[_0xe7ae('0xc')]);router[_0xe7ae('0x8')](_0xe7ae('0xd'),auth[_0xe7ae('0x9')](),controller[_0xe7ae('0xe')]);router[_0xe7ae('0xf')]('/',auth[_0xe7ae('0x9')](),interaction['tracked'](_0xe7ae('0x10'),_0xe7ae('0x11')),controller['create']);router[_0xe7ae('0xf')](_0xe7ae('0x12'),controller[_0xe7ae('0x13')]);router[_0xe7ae('0x14')](_0xe7ae('0xd'),auth['isAuthenticated'](),controller['update']);router['put'](_0xe7ae('0x15'),auth['isAuthenticated'](),controller[_0xe7ae('0x16')]);router[_0xe7ae('0x14')](_0xe7ae('0x17'),auth[_0xe7ae('0x9')](),controller['reject']);router['delete'](_0xe7ae('0xd'),auth['isAuthenticated'](),controller[_0xe7ae('0x18')]);module[_0xe7ae('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 0c42112..6a28f1f 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11db=['exports','TEXT','ENUM','STRING','DATE','BOOLEAN','sequelize'];(function(_0x24d8e7,_0x4cfde6){var _0x1d5511=function(_0x109f37){while(--_0x109f37){_0x24d8e7['push'](_0x24d8e7['shift']());}};_0x1d5511(++_0x4cfde6);}(_0x11db,0x195));var _0xb11d=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x11db[_0x4063a4];return _0x17908d;};'use strict';var Sequelize=require(_0xb11d('0x0'));module[_0xb11d('0x1')]={'body':{'type':Sequelize[_0xb11d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb11d('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb11d('0x4')](0xbe)},'phone':{'type':Sequelize[_0xb11d('0x4')]},'readAt':{'type':Sequelize[_0xb11d('0x5')]},'secret':{'type':Sequelize[_0xb11d('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb11d('0x2')]}}; \ No newline at end of file +var _0xd67b=['medium','BOOLEAN','ENUM','out','STRING','TEXT','exports'];(function(_0x33422b,_0x2bddbb){var _0x519969=function(_0x2ebe27){while(--_0x2ebe27){_0x33422b['push'](_0x33422b['shift']());}};_0x519969(++_0x2bddbb);}(_0xd67b,0x133));var _0xbd67=function(_0x2f0834,_0xa7c135){_0x2f0834=_0x2f0834-0x0;var _0x57178f=_0xd67b[_0x2f0834];return _0x57178f;};'use strict';var Sequelize=require('sequelize');module[_0xbd67('0x0')]={'body':{'type':Sequelize['TEXT'](_0xbd67('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xbd67('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbd67('0x3')]('in','out'),'defaultValue':_0xbd67('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xbd67('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xbd67('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbd67('0x5')]},'providerResponse':{'type':Sequelize[_0xbd67('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b8bb7e6..be089ed 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x309c=['fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','length','find','create','body','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','fullname','email','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','contact','interface','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','reject','save','update','destroy','name','send','index','map','WhatsappMessage','rawAttributes'];(function(_0x2994d7,_0x36731a){var _0x55aa28=function(_0x57ba22){while(--_0x57ba22){_0x2994d7['push'](_0x2994d7['shift']());}};_0x55aa28(++_0x36731a);}(_0x309c,0x15b));var _0xc309=function(_0x3d1b19,_0x1327dd){_0x3d1b19=_0x3d1b19-0x0;var _0x19e831=_0x309c[_0x3d1b19];return _0x19e831;};'use strict';var emlformat=require(_0xc309('0x0'));var rimraf=require(_0xc309('0x1'));var zipdir=require(_0xc309('0x2'));var jsonpatch=require(_0xc309('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc309('0x4'));var Mustache=require(_0xc309('0x5'));var util=require(_0xc309('0x6'));var path=require(_0xc309('0x7'));var sox=require('sox');var csv=require(_0xc309('0x8'));var ejs=require(_0xc309('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc309('0xa'));var squel=require('squel');var crypto=require(_0xc309('0xb'));var jsforce=require(_0xc309('0xc'));var deskjs=require(_0xc309('0xd'));var toCsv=require(_0xc309('0x8'));var querystring=require(_0xc309('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc309('0xf'));var qs=require(_0xc309('0x10'));var as=require(_0xc309('0x11'));var hardwareService=require(_0xc309('0x12'));var logger=require(_0xc309('0x13'))('api');var utils=require(_0xc309('0x14'));var config=require(_0xc309('0x15'));var licenseUtil=require(_0xc309('0x16'));var db=require(_0xc309('0x17'))['db'];config['redis']=_[_0xc309('0x18')](config[_0xc309('0x19')],{'host':_0xc309('0x1a'),'port':0x18eb});var socket=require(_0xc309('0x1b'))(new Redis(config[_0xc309('0x19')]));require(_0xc309('0x1c'))[_0xc309('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc309('0x1e')]({'port':0x232c});var client9002=jayson[_0xc309('0x1f')][_0xc309('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1dda1f,_0x25d029,_0x14782b,_0x44640c){return new BPromise(function(_0x29e150,_0x27b39c){var _0x20a958=_0x44640c||client;return _0x20a958[_0xc309('0x20')](_0x1dda1f,_0x14782b)[_0xc309('0x21')](function(_0x1a98e8){logger[_0xc309('0x22')](_0xc309('0x23'),_0x25d029,_0xc309('0x24'));logger[_0xc309('0x25')](_0xc309('0x26'),_0x25d029,_0xc309('0x24'),JSON[_0xc309('0x27')](_0x1a98e8));if(_0x1a98e8[_0xc309('0x28')]){if(_0x1a98e8[_0xc309('0x28')][_0xc309('0x29')]===0x1f4){logger[_0xc309('0x28')](_0xc309('0x23'),_0x25d029,_0x1a98e8[_0xc309('0x28')][_0xc309('0x2a')]);return _0x27b39c(_0x1a98e8['error']['message']);}logger[_0xc309('0x28')](_0xc309('0x23'),_0x25d029,_0x1a98e8[_0xc309('0x28')][_0xc309('0x2a')]);return _0x29e150(_0x1a98e8['error'][_0xc309('0x2a')]);}else{logger[_0xc309('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x25d029,_0xc309('0x24'));_0x29e150(_0x1a98e8[_0xc309('0x2b')]['message']);}})[_0xc309('0x2c')](function(_0x2dbecd){logger[_0xc309('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x25d029,_0x2dbecd);_0x27b39c(_0x2dbecd);});});}function respondWithStatusCode(_0x396874,_0x5b1692){_0x5b1692=_0x5b1692||0xcc;return function(_0x18fef9){if(_0x18fef9){return _0x396874[_0xc309('0x2d')](_0x5b1692);}return _0x396874['status'](_0x5b1692)[_0xc309('0x2e')]();};}function respondWithResult(_0x2a7770,_0x1fe1e9){_0x1fe1e9=_0x1fe1e9||0xc8;return function(_0x2266d4){if(_0x2266d4){return _0x2a7770[_0xc309('0x2f')](_0x1fe1e9)[_0xc309('0x30')](_0x2266d4);}};}function respondWithFilteredResult(_0x572b0d,_0x8e23f3){return function(_0x10e1ee){if(_0x10e1ee){var _0x2eec6c=typeof _0x8e23f3['offset']===_0xc309('0x31')&&typeof _0x8e23f3[_0xc309('0x32')]===_0xc309('0x31');var _0x1f6fb2=_0x10e1ee['count'];var _0x20bf32=_0x2eec6c?0x0:_0x8e23f3[_0xc309('0x33')];var _0x2c4dcc=_0x2eec6c?_0x10e1ee[_0xc309('0x34')]:_0x8e23f3[_0xc309('0x33')]+_0x8e23f3[_0xc309('0x32')];var _0x4664e0;if(_0x2c4dcc>=_0x1f6fb2){_0x2c4dcc=_0x1f6fb2;_0x4664e0=0xc8;}else{_0x4664e0=0xce;}_0x572b0d['status'](_0x4664e0);return _0x572b0d['set'](_0xc309('0x35'),_0x20bf32+'-'+_0x2c4dcc+'/'+_0x1f6fb2)[_0xc309('0x30')](_0x10e1ee);}return null;};}function patchUpdates(_0x5e2614){return function(_0x381066){try{jsonpatch['apply'](_0x381066,_0x5e2614,!![]);}catch(_0x515741){return BPromise[_0xc309('0x36')](_0x515741);}return _0x381066[_0xc309('0x37')]();};}function saveUpdates(_0x5a1cc0,_0x375889){return function(_0x1406a6){if(_0x1406a6){return _0x1406a6[_0xc309('0x38')](_0x5a1cc0)[_0xc309('0x21')](function(_0x558339){return _0x558339;});}return null;};}function removeEntity(_0x2eeeef,_0x1f71a5){return function(_0x5dbbb5){if(_0x5dbbb5){return _0x5dbbb5[_0xc309('0x39')]()[_0xc309('0x21')](function(){_0x2eeeef[_0xc309('0x2f')](0xcc)[_0xc309('0x2e')]();});}};}function handleEntityNotFound(_0x5cdbb2,_0xc42567){return function(_0x240554){if(!_0x240554){_0x5cdbb2['sendStatus'](0x194);}return _0x240554;};}function handleError(_0x3c0735,_0x64af25){_0x64af25=_0x64af25||0x1f4;return function(_0x494397){logger['error'](_0x494397['stack']);if(_0x494397['name']){delete _0x494397[_0xc309('0x3a')];}_0x3c0735['status'](_0x64af25)[_0xc309('0x3b')](_0x494397);};}exports[_0xc309('0x3c')]=function(_0x530741,_0x19e9b0){var _0x54e923={},_0x319a9e={},_0x56c74a={'count':0x0,'rows':[]};var _0x55ad8a=_[_0xc309('0x3d')](db[_0xc309('0x3e')][_0xc309('0x3f')],function(_0x35c6ac){return{'name':_0x35c6ac[_0xc309('0x40')],'type':_0x35c6ac['type'][_0xc309('0x41')]};});_0x319a9e[_0xc309('0x42')]=_['map'](_0x55ad8a,_0xc309('0x3a'));_0x319a9e['query']=_[_0xc309('0x43')](_0x530741[_0xc309('0x44')]);_0x319a9e[_0xc309('0x45')]=_['intersection'](_0x319a9e['model'],_0x319a9e['query']);_0x54e923[_0xc309('0x46')]=_[_0xc309('0x47')](_0x319a9e[_0xc309('0x42')],qs[_0xc309('0x48')](_0x530741[_0xc309('0x44')]['fields']));_0x54e923[_0xc309('0x46')]=_0x54e923[_0xc309('0x46')]['length']?_0x54e923[_0xc309('0x46')]:_0x319a9e['model'];if(!_0x530741[_0xc309('0x44')][_0xc309('0x49')]('nolimit')){_0x54e923['limit']=qs[_0xc309('0x32')](_0x530741['query']['limit']);_0x54e923['offset']=qs['offset'](_0x530741['query'][_0xc309('0x33')]);}_0x54e923[_0xc309('0x4a')]=qs[_0xc309('0x4b')](_0x530741[_0xc309('0x44')][_0xc309('0x4b')]);_0x54e923[_0xc309('0x4c')]=qs[_0xc309('0x45')](_['pick'](_0x530741[_0xc309('0x44')],_0x319a9e[_0xc309('0x45')]),_0x55ad8a);if(_0x530741[_0xc309('0x44')]['filter']){_0x54e923[_0xc309('0x4c')]=_['merge'](_0x54e923['where'],{'$or':_['map'](_0x55ad8a,function(_0x52e955){if(_0x52e955[_0xc309('0x4d')]!==_0xc309('0x4e')){var _0x585906={};_0x585906[_0x52e955[_0xc309('0x3a')]]={'$like':'%'+_0x530741[_0xc309('0x44')][_0xc309('0x4f')]+'%'};return _0x585906;}})});}_0x54e923=_[_0xc309('0x50')]({},_0x54e923,_0x530741[_0xc309('0x51')]);var _0x36f986={'where':_0x54e923[_0xc309('0x4c')]};return db['WhatsappMessage'][_0xc309('0x34')](_0x36f986)[_0xc309('0x21')](function(_0x50c429){_0x56c74a[_0xc309('0x34')]=_0x50c429;if(_0x530741[_0xc309('0x44')][_0xc309('0x52')]){_0x54e923[_0xc309('0x53')]=[{'all':!![]}];}return db[_0xc309('0x3e')][_0xc309('0x54')](_0x54e923);})['then'](function(_0x497e4a){_0x56c74a['rows']=_0x497e4a;return _0x56c74a;})['then'](respondWithFilteredResult(_0x19e9b0,_0x54e923))[_0xc309('0x2c')](handleError(_0x19e9b0,null));};exports[_0xc309('0x55')]=function(_0x4dbe85,_0x2f469b){var _0x494409={'raw':!![],'where':{'id':_0x4dbe85[_0xc309('0x56')]['id']}},_0x39c0d0={};_0x39c0d0[_0xc309('0x42')]=_[_0xc309('0x43')](db[_0xc309('0x3e')][_0xc309('0x3f')]);_0x39c0d0['query']=_[_0xc309('0x43')](_0x4dbe85[_0xc309('0x44')]);_0x39c0d0[_0xc309('0x45')]=_[_0xc309('0x47')](_0x39c0d0[_0xc309('0x42')],_0x39c0d0[_0xc309('0x44')]);_0x494409[_0xc309('0x46')]=_[_0xc309('0x47')](_0x39c0d0[_0xc309('0x42')],qs[_0xc309('0x48')](_0x4dbe85[_0xc309('0x44')][_0xc309('0x48')]));_0x494409['attributes']=_0x494409[_0xc309('0x46')][_0xc309('0x57')]?_0x494409[_0xc309('0x46')]:_0x39c0d0['model'];if(_0x4dbe85[_0xc309('0x44')][_0xc309('0x52')]){_0x494409[_0xc309('0x53')]=[{'all':!![]}];}_0x494409=_['merge']({},_0x494409,_0x4dbe85[_0xc309('0x51')]);return db['WhatsappMessage'][_0xc309('0x58')](_0x494409)['then'](handleEntityNotFound(_0x2f469b,null))[_0xc309('0x21')](respondWithResult(_0x2f469b,null))['catch'](handleError(_0x2f469b,null));};exports['create']=function(_0x1f2d3b,_0xac47a){return db[_0xc309('0x3e')][_0xc309('0x59')](_0x1f2d3b['body'],{})['then'](respondWithResult(_0xac47a,0xc9))[_0xc309('0x2c')](handleError(_0xac47a,null));};exports['update']=function(_0x377569,_0x36c517){if(_0x377569[_0xc309('0x5a')]['id']){delete _0x377569[_0xc309('0x5a')]['id'];}return db[_0xc309('0x3e')][_0xc309('0x58')]({'where':{'id':_0x377569['params']['id']}})[_0xc309('0x21')](handleEntityNotFound(_0x36c517,null))[_0xc309('0x21')](saveUpdates(_0x377569['body'],null))[_0xc309('0x21')](respondWithResult(_0x36c517,null))['catch'](handleError(_0x36c517,null));};exports['destroy']=function(_0x515158,_0x458bfe){return db['WhatsappMessage'][_0xc309('0x58')]({'where':{'id':_0x515158[_0xc309('0x56')]['id']}})[_0xc309('0x21')](handleEntityNotFound(_0x458bfe,null))['then'](removeEntity(_0x458bfe,null))[_0xc309('0x2c')](handleError(_0x458bfe,null));};exports['describe']=function(_0x34ab07,_0x481582){return db['WhatsappMessage']['describe']()[_0xc309('0x21')](respondWithResult(_0x481582,null))[_0xc309('0x2c')](handleError(_0x481582,null));};var interaction_log=require('../../config/logger')(_0xc309('0x5b'));exports[_0xc309('0x5c')]=function(_0x6a2c23,_0x199020,_0x59fe93){var _0x1fd954={'agent':{},'channel':_0xc309('0x5d')};if(_0x6a2c23[_0xc309('0x5a')]['id']){delete _0x6a2c23['body']['id'];}_0x6a2c23[_0xc309('0x5a')][_0xc309('0x5e')]=!![];_0x6a2c23['body'][_0xc309('0x5f')]=moment()[_0xc309('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x6a2c23[_0xc309('0x5a')][_0xc309('0x61')]=_0x6a2c23[_0xc309('0x5a')]['UserId']||_0x6a2c23[_0xc309('0x62')]['id'];_0x1fd954['agent']['id']=_0x6a2c23[_0xc309('0x5a')][_0xc309('0x61')];return db[_0xc309('0x3e')][_0xc309('0x58')]({'where':{'id':_0x6a2c23[_0xc309('0x56')]['id'],'UserId':null}})[_0xc309('0x21')](handleEntityNotFound(_0x199020,null))[_0xc309('0x21')](saveUpdates(_0x6a2c23[_0xc309('0x5a')],null))['then'](function(_0x2eab27){if(_0x2eab27){_0x1fd954[_0xc309('0x2a')]=_0x2eab27['get']({'plain':!![]});return db['WhatsappInteraction'][_0xc309('0x58')]({'where':{'id':_0x2eab27[_0xc309('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x199020,null))[_0xc309('0x21')](function(_0x5a2664){if(_0x5a2664){return _0x5a2664[_0xc309('0x38')]({'UserId':_0x6a2c23['body'][_0xc309('0x61')],'read1stAt':_[_0xc309('0x64')](_0x5a2664[_0xc309('0x65')])?moment()[_0xc309('0x60')](_0xc309('0x66')):undefined});}return null;})[_0xc309('0x21')](function(_0x20d469){if(_0x20d469){_0x1fd954[_0xc309('0x67')]=_0x20d469[_0xc309('0x68')]({'plain':!![]});interaction_log['info'](_0xc309('0x69'),_0x6a2c23[_0xc309('0x62')]['id'],_0x6a2c23[_0xc309('0x62')][_0xc309('0x3a')],_0x6a2c23[_0xc309('0x62')][_0xc309('0x6a')],_0x1fd954[_0xc309('0x67')]['id'],_0x6a2c23['body']?JSON['stringify'](_0x6a2c23['body']):_0xc309('0x6b'));return respondWithRpcPromise(_0xc309('0x6c'),_0xc309('0x6d'),_0x1fd954);}return null;})[_0xc309('0x21')](function(_0x362b7f){var _0x5b9737=_0xc309('0x6e')+_0x362b7f[_0xc309('0x2a')][_0xc309('0x6f')];return db[_0xc309('0x70')]['query'](_0x5b9737,{'type':db[_0xc309('0x71')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0xcf6ee1){return _0xcf6ee1;});})[_0xc309('0x21')](function(_0x40575e){if(_0x40575e){_0x1fd954[_0xc309('0x2a')]['contact']=_0x40575e[0x0];if(!_0x6a2c23[_0xc309('0x5a')][_0xc309('0x61')])return;return db[_0xc309('0x72')][_0xc309('0x58')]({'where':{'id':_0x6a2c23['body']['UserId'],'role':'agent'},'attributes':['id','name',_0xc309('0x73'),_0xc309('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3596a3){if(!_0x3596a3)return null;_0x1fd954[_0xc309('0x2a')][_0xc309('0x75')]=_0x3596a3;return _0x1fd954;})[_0xc309('0x21')](function(_0x1bd607){if(_0x1bd607){if(_0x6a2c23[_0xc309('0x5a')][_0xc309('0x76')]){_0x1fd954[_0xc309('0x2a')]['interface']=util[_0xc309('0x60')](_0xc309('0x77'),_0x6a2c23[_0xc309('0x62')][_0xc309('0x3a')]);_0x1fd954[_0xc309('0x2a')][_0xc309('0x78')]=_0x1fd954[_0xc309('0x78')];_0x1fd954[_0xc309('0x2a')][_0xc309('0x79')]=_0x1fd954[_0xc309('0x78')];_0x1fd954['message'][_0xc309('0x7a')]='accept';return respondWithRpcPromise(_0xc309('0x7b'),_0xc309('0x7b'),{'event':'acceptmessage','message':_0x1fd954[_0xc309('0x2a')]},client9002)['then'](function(){return _0x1fd954;});}return _0x1fd954;}return null;})[_0xc309('0x21')](respondWithResult(_0x199020,null))['catch'](handleError(_0x199020,null));};var interaction_log=require('../../config/logger')(_0xc309('0x5b'));exports[_0xc309('0x36')]=function(_0x49a33f,_0x10c227,_0x6ce144){var _0x50b917={'agent':{},'channel':'whatsapp'};if(_0x49a33f[_0xc309('0x5a')]['id']){delete _0x49a33f[_0xc309('0x5a')]['id'];}_0x49a33f['body'][_0xc309('0x61')]=_0x49a33f[_0xc309('0x5a')][_0xc309('0x61')]||_0x49a33f[_0xc309('0x62')]['id'];_0x50b917[_0xc309('0x75')]['id']=_0x49a33f['body']['UserId'];return db[_0xc309('0x3e')][_0xc309('0x58')]({'where':{'id':_0x49a33f[_0xc309('0x56')]['id'],'UserId':null}})[_0xc309('0x21')](handleEntityNotFound(_0x10c227,null))[_0xc309('0x21')](function(_0x2a967d){if(_0x2a967d){_0x50b917['message']=_0x2a967d[_0xc309('0x68')]({'plain':!![]});return db[_0xc309('0x7c')][_0xc309('0x58')]({'where':{'id':_0x2a967d['WhatsappInteractionId']}});}return null;})[_0xc309('0x21')](handleEntityNotFound(_0x10c227,null))[_0xc309('0x21')](function(_0x26e1a7){if(_0x26e1a7){_0x50b917['interaction']=_0x26e1a7[_0xc309('0x68')]({'plain':!![]});interaction_log[_0xc309('0x22')](_0xc309('0x7d'),_0x49a33f[_0xc309('0x62')]['id'],_0x49a33f[_0xc309('0x62')][_0xc309('0x3a')],_0x49a33f[_0xc309('0x62')][_0xc309('0x6a')],_0x50b917[_0xc309('0x67')]['id'],_0x49a33f[_0xc309('0x5a')]?JSON[_0xc309('0x27')](_0x49a33f[_0xc309('0x5a')]):_0xc309('0x6b'));return respondWithRpcPromise(_0xc309('0x7e'),'rejectMessage',_0x50b917);}return null;})[_0xc309('0x21')](function(_0x45ec1f){var _0x18321a=_0xc309('0x6e')+_0x45ec1f[_0xc309('0x2a')]['ContactId'];return db[_0xc309('0x70')][_0xc309('0x44')](_0x18321a,{'type':db[_0xc309('0x71')]['QueryTypes'][_0xc309('0x7f')],'raw':!![]})[_0xc309('0x21')](function(_0x50833e){return _0x50833e;});})[_0xc309('0x21')](function(_0x4d8fe5){if(_0x4d8fe5){_0x50b917[_0xc309('0x2a')][_0xc309('0x80')]=_0x4d8fe5[0x0];if(!_0x49a33f[_0xc309('0x5a')]['UserId'])return;return db['User'][_0xc309('0x58')]({'where':{'id':_0x49a33f[_0xc309('0x5a')]['UserId'],'role':_0xc309('0x75')},'attributes':['id',_0xc309('0x3a'),'fullname',_0xc309('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x238ea0){if(!_0x238ea0)return null;_0x50b917['message']['agent']=_0x238ea0;return _0x50b917;})[_0xc309('0x21')](function(_0x54221b){if(_0x54221b){_0x54221b['message'][_0xc309('0x81')]=util[_0xc309('0x60')](_0xc309('0x77'),_0x49a33f[_0xc309('0x62')][_0xc309('0x3a')]);_0x54221b['message'][_0xc309('0x78')]=_0x50b917[_0xc309('0x78')];_0x54221b[_0xc309('0x2a')][_0xc309('0x79')]=_0x50b917['channel'];_0x54221b[_0xc309('0x2a')][_0xc309('0x7a')]=_0xc309('0x36');respondWithRpcPromise(_0xc309('0x7b'),_0xc309('0x7b'),{'event':_0xc309('0x82'),'message':_0x54221b[_0xc309('0x2a')]},client9002);return _0x50b917;}return null;})[_0xc309('0x21')](respondWithResult(_0x10c227,null))['catch'](handleError(_0x10c227,null));};exports[_0xc309('0x2f')]=function(_0x37a4b6,_0x31db2b,_0x11273f){if(_0x37a4b6[_0xc309('0x5a')]['id']){delete _0x37a4b6[_0xc309('0x5a')]['id'];}var _0x32b347;return db[_0xc309('0x3e')][_0xc309('0x58')]({'where':{'id':_0x37a4b6[_0xc309('0x56')]['id']}})['then'](handleEntityNotFound(_0x31db2b,null))[_0xc309('0x21')](function(_0x4fe7d2){if(_0x4fe7d2){_0x32b347=_0x4fe7d2;return db['WhatsappAccount']['find']({'where':{'id':_0x4fe7d2[_0xc309('0x83')]}});}})[_0xc309('0x21')](handleEntityNotFound(_0x31db2b,null))[_0xc309('0x21')](function(_0x5f5439){if(_0x5f5439){logger['debug'](_0xc309('0x84'),_0xc309('0x2f'),'received\x20delivery\x20report\x20from',_0x5f5439[_0xc309('0x4d')],util[_0xc309('0x85')](_0x37a4b6[_0xc309('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5f5439[_0xc309('0x4d')]){case _0xc309('0x86'):if(_0x37a4b6[_0xc309('0x5a')][_0xc309('0x87')]&&_0x37a4b6['body'][_0xc309('0x87')]===_0x32b347['messageId']&&_0x37a4b6[_0xc309('0x5a')][_0xc309('0x88')]&&_0x37a4b6[_0xc309('0x5a')][_0xc309('0x88')]===_0xc309('0x5e')){return _0x32b347[_0xc309('0x38')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xc309('0x2f'),_0xc309('0x86'),util[_0xc309('0x85')](_0x37a4b6[_0xc309('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x32b347;}})[_0xc309('0x21')](respondWithResult(_0x31db2b,null))[_0xc309('0x2c')](handleError(_0x31db2b,null));}; \ No newline at end of file +var _0xffef=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','find','create','body','destroy','../../config/logger','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xffef,0x18e));var _0xfffe=function(_0x5ada4a,_0x5d9420){_0x5ada4a=_0x5ada4a-0x0;var _0x1ceb86=_0xffef[_0x5ada4a];return _0x1ceb86;};'use strict';var emlformat=require(_0xfffe('0x0'));var rimraf=require(_0xfffe('0x1'));var zipdir=require(_0xfffe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfffe('0x3'));var moment=require(_0xfffe('0x4'));var BPromise=require(_0xfffe('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfffe('0x6'));var ejs=require(_0xfffe('0x7'));var fs=require('fs');var fs_extra=require(_0xfffe('0x8'));var _=require(_0xfffe('0x9'));var squel=require(_0xfffe('0xa'));var crypto=require(_0xfffe('0xb'));var jsforce=require(_0xfffe('0xc'));var deskjs=require(_0xfffe('0xd'));var toCsv=require(_0xfffe('0x6'));var querystring=require('querystring');var Papa=require(_0xfffe('0xe'));var Redis=require('ioredis');var authService=require(_0xfffe('0xf'));var qs=require(_0xfffe('0x10'));var as=require(_0xfffe('0x11'));var hardwareService=require(_0xfffe('0x12'));var logger=require('../../config/logger')(_0xfffe('0x13'));var utils=require(_0xfffe('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfffe('0x15'));var db=require('../../mysqldb')['db'];config[_0xfffe('0x16')]=_[_0xfffe('0x17')](config[_0xfffe('0x16')],{'host':_0xfffe('0x18'),'port':0x18eb});var socket=require(_0xfffe('0x19'))(new Redis(config[_0xfffe('0x16')]));require(_0xfffe('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfffe('0x1b')]({'port':0x232c});var client9002=jayson[_0xfffe('0x1c')][_0xfffe('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2774a8,_0x36fbf7,_0x4dcc42,_0x50b513){return new BPromise(function(_0x3cb2f9,_0x13e0b7){var _0x675621=_0x50b513||client;return _0x675621[_0xfffe('0x1d')](_0x2774a8,_0x4dcc42)[_0xfffe('0x1e')](function(_0x2df269){logger[_0xfffe('0x1f')](_0xfffe('0x20'),_0x36fbf7,'request\x20sent');logger[_0xfffe('0x21')](_0xfffe('0x22'),_0x36fbf7,_0xfffe('0x23'),JSON[_0xfffe('0x24')](_0x2df269));if(_0x2df269['error']){if(_0x2df269['error'][_0xfffe('0x25')]===0x1f4){logger[_0xfffe('0x26')](_0xfffe('0x20'),_0x36fbf7,_0x2df269[_0xfffe('0x26')][_0xfffe('0x27')]);return _0x13e0b7(_0x2df269[_0xfffe('0x26')]['message']);}logger[_0xfffe('0x26')](_0xfffe('0x20'),_0x36fbf7,_0x2df269[_0xfffe('0x26')][_0xfffe('0x27')]);return _0x3cb2f9(_0x2df269[_0xfffe('0x26')][_0xfffe('0x27')]);}else{logger[_0xfffe('0x1f')](_0xfffe('0x20'),_0x36fbf7,_0xfffe('0x23'));_0x3cb2f9(_0x2df269[_0xfffe('0x28')]['message']);}})[_0xfffe('0x29')](function(_0xa4c9ab){logger[_0xfffe('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x36fbf7,_0xa4c9ab);_0x13e0b7(_0xa4c9ab);});});}function respondWithStatusCode(_0x493030,_0x46f3da){_0x46f3da=_0x46f3da||0xcc;return function(_0x4d5e85){if(_0x4d5e85){return _0x493030[_0xfffe('0x2a')](_0x46f3da);}return _0x493030[_0xfffe('0x2b')](_0x46f3da)[_0xfffe('0x2c')]();};}function respondWithResult(_0x2ec158,_0x350d9c){_0x350d9c=_0x350d9c||0xc8;return function(_0x5a3ea9){if(_0x5a3ea9){return _0x2ec158[_0xfffe('0x2b')](_0x350d9c)[_0xfffe('0x2d')](_0x5a3ea9);}};}function respondWithFilteredResult(_0x42477b,_0x4e335c){return function(_0x53af9f){if(_0x53af9f){var _0x1cea6e=typeof _0x4e335c[_0xfffe('0x2e')]==='undefined'&&typeof _0x4e335c['limit']===_0xfffe('0x2f');var _0x3432fb=_0x53af9f[_0xfffe('0x30')];var _0x551597=_0x1cea6e?0x0:_0x4e335c[_0xfffe('0x2e')];var _0x58bf43=_0x1cea6e?_0x53af9f[_0xfffe('0x30')]:_0x4e335c[_0xfffe('0x2e')]+_0x4e335c['limit'];var _0x4bfcfe;if(_0x58bf43>=_0x3432fb){_0x58bf43=_0x3432fb;_0x4bfcfe=0xc8;}else{_0x4bfcfe=0xce;}_0x42477b['status'](_0x4bfcfe);return _0x42477b[_0xfffe('0x31')](_0xfffe('0x32'),_0x551597+'-'+_0x58bf43+'/'+_0x3432fb)['json'](_0x53af9f);}return null;};}function patchUpdates(_0x21b6a2){return function(_0x29db2f){try{jsonpatch[_0xfffe('0x33')](_0x29db2f,_0x21b6a2,!![]);}catch(_0x32b6c4){return BPromise[_0xfffe('0x34')](_0x32b6c4);}return _0x29db2f[_0xfffe('0x35')]();};}function saveUpdates(_0x411daf,_0x36977b){return function(_0x1ce961){if(_0x1ce961){return _0x1ce961[_0xfffe('0x36')](_0x411daf)[_0xfffe('0x1e')](function(_0x267848){return _0x267848;});}return null;};}function removeEntity(_0x289e55,_0x83749d){return function(_0x387c22){if(_0x387c22){return _0x387c22['destroy']()[_0xfffe('0x1e')](function(){_0x289e55[_0xfffe('0x2b')](0xcc)[_0xfffe('0x2c')]();});}};}function handleEntityNotFound(_0x56d760,_0x423804){return function(_0x2b1e84){if(!_0x2b1e84){_0x56d760['sendStatus'](0x194);}return _0x2b1e84;};}function handleError(_0x1ca083,_0x1ca7fb){_0x1ca7fb=_0x1ca7fb||0x1f4;return function(_0x3cf3d7){logger[_0xfffe('0x26')](_0x3cf3d7[_0xfffe('0x37')]);if(_0x3cf3d7[_0xfffe('0x38')]){delete _0x3cf3d7[_0xfffe('0x38')];}_0x1ca083[_0xfffe('0x2b')](_0x1ca7fb)[_0xfffe('0x39')](_0x3cf3d7);};}exports['index']=function(_0x16e3db,_0x4d5ee2){var _0x2ada1c={},_0x36ffbd={},_0x45fb69={'count':0x0,'rows':[]};var _0x38b562=_[_0xfffe('0x3a')](db[_0xfffe('0x3b')][_0xfffe('0x3c')],function(_0x50e923){return{'name':_0x50e923[_0xfffe('0x3d')],'type':_0x50e923['type'][_0xfffe('0x3e')]};});_0x36ffbd[_0xfffe('0x3f')]=_[_0xfffe('0x3a')](_0x38b562,_0xfffe('0x38'));_0x36ffbd[_0xfffe('0x40')]=_[_0xfffe('0x41')](_0x16e3db['query']);_0x36ffbd[_0xfffe('0x42')]=_[_0xfffe('0x43')](_0x36ffbd[_0xfffe('0x3f')],_0x36ffbd[_0xfffe('0x40')]);_0x2ada1c[_0xfffe('0x44')]=_[_0xfffe('0x43')](_0x36ffbd[_0xfffe('0x3f')],qs[_0xfffe('0x45')](_0x16e3db[_0xfffe('0x40')][_0xfffe('0x45')]));_0x2ada1c[_0xfffe('0x44')]=_0x2ada1c['attributes'][_0xfffe('0x46')]?_0x2ada1c[_0xfffe('0x44')]:_0x36ffbd[_0xfffe('0x3f')];if(!_0x16e3db[_0xfffe('0x40')]['hasOwnProperty'](_0xfffe('0x47'))){_0x2ada1c[_0xfffe('0x48')]=qs[_0xfffe('0x48')](_0x16e3db[_0xfffe('0x40')][_0xfffe('0x48')]);_0x2ada1c[_0xfffe('0x2e')]=qs[_0xfffe('0x2e')](_0x16e3db[_0xfffe('0x40')]['offset']);}_0x2ada1c['order']=qs[_0xfffe('0x49')](_0x16e3db[_0xfffe('0x40')][_0xfffe('0x49')]);_0x2ada1c[_0xfffe('0x4a')]=qs[_0xfffe('0x42')](_[_0xfffe('0x4b')](_0x16e3db['query'],_0x36ffbd[_0xfffe('0x42')]),_0x38b562);if(_0x16e3db[_0xfffe('0x40')]['filter']){_0x2ada1c[_0xfffe('0x4a')]=_['merge'](_0x2ada1c[_0xfffe('0x4a')],{'$or':_['map'](_0x38b562,function(_0xe940c8){if(_0xe940c8[_0xfffe('0x4c')]!==_0xfffe('0x4d')){var _0x12da3c={};_0x12da3c[_0xe940c8['name']]={'$like':'%'+_0x16e3db[_0xfffe('0x40')][_0xfffe('0x4e')]+'%'};return _0x12da3c;}})});}_0x2ada1c=_[_0xfffe('0x4f')]({},_0x2ada1c,_0x16e3db[_0xfffe('0x50')]);var _0x18e68e={'where':_0x2ada1c[_0xfffe('0x4a')]};return db[_0xfffe('0x3b')][_0xfffe('0x30')](_0x18e68e)[_0xfffe('0x1e')](function(_0x560670){_0x45fb69[_0xfffe('0x30')]=_0x560670;if(_0x16e3db[_0xfffe('0x40')][_0xfffe('0x51')]){_0x2ada1c[_0xfffe('0x52')]=[{'all':!![]}];}return db[_0xfffe('0x3b')]['findAll'](_0x2ada1c);})[_0xfffe('0x1e')](function(_0x3454e4){_0x45fb69[_0xfffe('0x53')]=_0x3454e4;return _0x45fb69;})['then'](respondWithFilteredResult(_0x4d5ee2,_0x2ada1c))[_0xfffe('0x29')](handleError(_0x4d5ee2,null));};exports[_0xfffe('0x54')]=function(_0x3880dc,_0x13caee){var _0x38e1c8={'raw':!![],'where':{'id':_0x3880dc[_0xfffe('0x55')]['id']}},_0x12d82c={};_0x12d82c['model']=_[_0xfffe('0x41')](db[_0xfffe('0x3b')][_0xfffe('0x3c')]);_0x12d82c[_0xfffe('0x40')]=_[_0xfffe('0x41')](_0x3880dc[_0xfffe('0x40')]);_0x12d82c['filters']=_[_0xfffe('0x43')](_0x12d82c[_0xfffe('0x3f')],_0x12d82c[_0xfffe('0x40')]);_0x38e1c8[_0xfffe('0x44')]=_[_0xfffe('0x43')](_0x12d82c['model'],qs[_0xfffe('0x45')](_0x3880dc[_0xfffe('0x40')][_0xfffe('0x45')]));_0x38e1c8[_0xfffe('0x44')]=_0x38e1c8['attributes']['length']?_0x38e1c8['attributes']:_0x12d82c[_0xfffe('0x3f')];if(_0x3880dc[_0xfffe('0x40')][_0xfffe('0x51')]){_0x38e1c8[_0xfffe('0x52')]=[{'all':!![]}];}_0x38e1c8=_['merge']({},_0x38e1c8,_0x3880dc[_0xfffe('0x50')]);return db[_0xfffe('0x3b')][_0xfffe('0x56')](_0x38e1c8)[_0xfffe('0x1e')](handleEntityNotFound(_0x13caee,null))[_0xfffe('0x1e')](respondWithResult(_0x13caee,null))['catch'](handleError(_0x13caee,null));};exports[_0xfffe('0x57')]=function(_0x5d0be1,_0x4a3a1a){return db[_0xfffe('0x3b')][_0xfffe('0x57')](_0x5d0be1[_0xfffe('0x58')],{})[_0xfffe('0x1e')](respondWithResult(_0x4a3a1a,0xc9))['catch'](handleError(_0x4a3a1a,null));};exports[_0xfffe('0x36')]=function(_0x29af92,_0xbec4d9){if(_0x29af92[_0xfffe('0x58')]['id']){delete _0x29af92['body']['id'];}return db['WhatsappMessage'][_0xfffe('0x56')]({'where':{'id':_0x29af92[_0xfffe('0x55')]['id']}})[_0xfffe('0x1e')](handleEntityNotFound(_0xbec4d9,null))['then'](saveUpdates(_0x29af92[_0xfffe('0x58')],null))['then'](respondWithResult(_0xbec4d9,null))[_0xfffe('0x29')](handleError(_0xbec4d9,null));};exports[_0xfffe('0x59')]=function(_0xa1a7c4,_0x52fbf4){return db[_0xfffe('0x3b')][_0xfffe('0x56')]({'where':{'id':_0xa1a7c4[_0xfffe('0x55')]['id']}})[_0xfffe('0x1e')](handleEntityNotFound(_0x52fbf4,null))[_0xfffe('0x1e')](removeEntity(_0x52fbf4,null))['catch'](handleError(_0x52fbf4,null));};exports['describe']=function(_0x174c0d,_0xd186ed){return db[_0xfffe('0x3b')]['describe']()[_0xfffe('0x1e')](respondWithResult(_0xd186ed,null))[_0xfffe('0x29')](handleError(_0xd186ed,null));};var interaction_log=require(_0xfffe('0x5a'))(_0xfffe('0x5b'));exports['accept']=function(_0x2a6716,_0x1e0094,_0x29c283){var _0x1519d6={'agent':{},'channel':_0xfffe('0x5c')};if(_0x2a6716[_0xfffe('0x58')]['id']){delete _0x2a6716[_0xfffe('0x58')]['id'];}_0x2a6716[_0xfffe('0x58')]['read']=!![];_0x2a6716[_0xfffe('0x58')][_0xfffe('0x5d')]=moment()[_0xfffe('0x5e')](_0xfffe('0x5f'));_0x2a6716[_0xfffe('0x58')][_0xfffe('0x60')]=_0x2a6716[_0xfffe('0x58')]['UserId']||_0x2a6716[_0xfffe('0x61')]['id'];_0x1519d6[_0xfffe('0x62')]['id']=_0x2a6716[_0xfffe('0x58')][_0xfffe('0x60')];return db[_0xfffe('0x3b')][_0xfffe('0x56')]({'where':{'id':_0x2a6716[_0xfffe('0x55')]['id'],'UserId':null}})[_0xfffe('0x1e')](handleEntityNotFound(_0x1e0094,null))[_0xfffe('0x1e')](saveUpdates(_0x2a6716['body'],null))[_0xfffe('0x1e')](function(_0x200197){if(_0x200197){_0x1519d6[_0xfffe('0x27')]=_0x200197[_0xfffe('0x63')]({'plain':!![]});return db[_0xfffe('0x64')]['find']({'where':{'id':_0x200197[_0xfffe('0x65')]}});}return null;})[_0xfffe('0x1e')](handleEntityNotFound(_0x1e0094,null))[_0xfffe('0x1e')](function(_0x34319d){if(_0x34319d){return _0x34319d['update']({'UserId':_0x2a6716[_0xfffe('0x58')][_0xfffe('0x60')],'read1stAt':_['isNil'](_0x34319d[_0xfffe('0x66')])?moment()[_0xfffe('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1cb779){if(_0x1cb779){_0x1519d6[_0xfffe('0x67')]=_0x1cb779['get']({'plain':!![]});interaction_log[_0xfffe('0x1f')](_0xfffe('0x68'),_0x2a6716[_0xfffe('0x61')]['id'],_0x2a6716[_0xfffe('0x61')][_0xfffe('0x38')],_0x2a6716[_0xfffe('0x61')][_0xfffe('0x69')],_0x1519d6[_0xfffe('0x67')]['id'],_0x2a6716[_0xfffe('0x58')]?JSON[_0xfffe('0x24')](_0x2a6716[_0xfffe('0x58')]):_0xfffe('0x6a'));return respondWithRpcPromise(_0xfffe('0x6b'),_0xfffe('0x6c'),_0x1519d6);}return null;})[_0xfffe('0x1e')](function(_0x1e26b8){var _0xfe689a=_0xfffe('0x6d')+_0x1e26b8['message'][_0xfffe('0x6e')];return db['sequelize'][_0xfffe('0x40')](_0xfe689a,{'type':db[_0xfffe('0x6f')][_0xfffe('0x70')][_0xfffe('0x71')],'raw':!![]})[_0xfffe('0x1e')](function(_0x25f57f){return _0x25f57f;});})['then'](function(_0x1fb712){if(_0x1fb712){_0x1519d6[_0xfffe('0x27')][_0xfffe('0x72')]=_0x1fb712[0x0];if(!_0x2a6716['body'][_0xfffe('0x60')])return;return db[_0xfffe('0x73')][_0xfffe('0x56')]({'where':{'id':_0x2a6716['body']['UserId'],'role':_0xfffe('0x62')},'attributes':['id','name','fullname',_0xfffe('0x74'),_0xfffe('0x75')],'raw':!![]});}return null;})['then'](function(_0x58228b){if(!_0x58228b)return null;_0x1519d6[_0xfffe('0x27')][_0xfffe('0x62')]=_0x58228b;return _0x1519d6;})[_0xfffe('0x1e')](function(_0x57e4fe){if(_0x57e4fe){if(_0x2a6716['body']['manual']){_0x1519d6['message']['interface']=util['format'](_0xfffe('0x76'),_0x2a6716[_0xfffe('0x61')][_0xfffe('0x38')]);_0x1519d6['message'][_0xfffe('0x77')]=_0x1519d6['channel'];_0x1519d6['message'][_0xfffe('0x78')]=_0x1519d6[_0xfffe('0x77')];_0x1519d6[_0xfffe('0x27')]['event']=_0xfffe('0x79');return respondWithRpcPromise('EventManager',_0xfffe('0x7a'),{'event':_0xfffe('0x7b'),'message':_0x1519d6[_0xfffe('0x27')]},client9002)['then'](function(){return _0x1519d6;});}return _0x1519d6;}return null;})[_0xfffe('0x1e')](respondWithResult(_0x1e0094,null))[_0xfffe('0x29')](handleError(_0x1e0094,null));};var interaction_log=require(_0xfffe('0x5a'))(_0xfffe('0x5b'));exports[_0xfffe('0x34')]=function(_0x10f72f,_0x59bb82,_0x46643e){var _0x1dc955={'agent':{},'channel':_0xfffe('0x5c')};if(_0x10f72f[_0xfffe('0x58')]['id']){delete _0x10f72f[_0xfffe('0x58')]['id'];}_0x10f72f[_0xfffe('0x58')][_0xfffe('0x60')]=_0x10f72f['body'][_0xfffe('0x60')]||_0x10f72f['user']['id'];_0x1dc955[_0xfffe('0x62')]['id']=_0x10f72f[_0xfffe('0x58')]['UserId'];return db[_0xfffe('0x3b')][_0xfffe('0x56')]({'where':{'id':_0x10f72f[_0xfffe('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x59bb82,null))[_0xfffe('0x1e')](function(_0x409952){if(_0x409952){_0x1dc955[_0xfffe('0x27')]=_0x409952['get']({'plain':!![]});return db[_0xfffe('0x64')][_0xfffe('0x56')]({'where':{'id':_0x409952[_0xfffe('0x65')]}});}return null;})[_0xfffe('0x1e')](handleEntityNotFound(_0x59bb82,null))[_0xfffe('0x1e')](function(_0x5af0d1){if(_0x5af0d1){_0x1dc955['interaction']=_0x5af0d1[_0xfffe('0x63')]({'plain':!![]});interaction_log[_0xfffe('0x1f')](_0xfffe('0x7c'),_0x10f72f[_0xfffe('0x61')]['id'],_0x10f72f[_0xfffe('0x61')]['name'],_0x10f72f[_0xfffe('0x61')][_0xfffe('0x69')],_0x1dc955['interaction']['id'],_0x10f72f['body']?JSON[_0xfffe('0x24')](_0x10f72f[_0xfffe('0x58')]):'null');return respondWithRpcPromise(_0xfffe('0x7d'),_0xfffe('0x7e'),_0x1dc955);}return null;})[_0xfffe('0x1e')](function(_0x521a41){var _0x3580ef=_0xfffe('0x6d')+_0x521a41[_0xfffe('0x27')][_0xfffe('0x6e')];return db['sequelize'][_0xfffe('0x40')](_0x3580ef,{'type':db['Sequelize'][_0xfffe('0x70')][_0xfffe('0x71')],'raw':!![]})[_0xfffe('0x1e')](function(_0x30d717){return _0x30d717;});})['then'](function(_0x18fb3e){if(_0x18fb3e){_0x1dc955[_0xfffe('0x27')][_0xfffe('0x72')]=_0x18fb3e[0x0];if(!_0x10f72f[_0xfffe('0x58')]['UserId'])return;return db[_0xfffe('0x73')][_0xfffe('0x56')]({'where':{'id':_0x10f72f['body'][_0xfffe('0x60')],'role':'agent'},'attributes':['id',_0xfffe('0x38'),_0xfffe('0x7f'),_0xfffe('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x17c272){if(!_0x17c272)return null;_0x1dc955['message'][_0xfffe('0x62')]=_0x17c272;return _0x1dc955;})[_0xfffe('0x1e')](function(_0x144a47){if(_0x144a47){_0x144a47[_0xfffe('0x27')]['interface']=util[_0xfffe('0x5e')](_0xfffe('0x76'),_0x10f72f[_0xfffe('0x61')][_0xfffe('0x38')]);_0x144a47[_0xfffe('0x27')]['channel']=_0x1dc955[_0xfffe('0x77')];_0x144a47[_0xfffe('0x27')][_0xfffe('0x78')]=_0x1dc955[_0xfffe('0x77')];_0x144a47['message']['event']=_0xfffe('0x34');respondWithRpcPromise(_0xfffe('0x7a'),_0xfffe('0x7a'),{'event':'rejectmessage','message':_0x144a47['message']},client9002);return _0x1dc955;}return null;})[_0xfffe('0x1e')](respondWithResult(_0x59bb82,null))[_0xfffe('0x29')](handleError(_0x59bb82,null));};exports[_0xfffe('0x2b')]=function(_0x4f68eb,_0x332145,_0xcb3e){if(_0x4f68eb['body']['id']){delete _0x4f68eb[_0xfffe('0x58')]['id'];}var _0x16f7d9;return db[_0xfffe('0x3b')][_0xfffe('0x56')]({'where':{'id':_0x4f68eb[_0xfffe('0x55')]['id']}})[_0xfffe('0x1e')](handleEntityNotFound(_0x332145,null))['then'](function(_0x55c2af){if(_0x55c2af){_0x16f7d9=_0x55c2af;return db[_0xfffe('0x80')]['find']({'where':{'id':_0x55c2af['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x332145,null))[_0xfffe('0x1e')](function(_0x30f9c4){if(_0x30f9c4){logger[_0xfffe('0x21')](_0xfffe('0x81'),'status',_0xfffe('0x82'),_0x30f9c4[_0xfffe('0x4c')],util['inspect'](_0x4f68eb['body'],{'showHidden':![],'depth':null}));switch(_0x30f9c4[_0xfffe('0x4c')]){case _0xfffe('0x83'):if(_0x4f68eb[_0xfffe('0x58')][_0xfffe('0x84')]&&_0x4f68eb[_0xfffe('0x58')][_0xfffe('0x84')]===_0x16f7d9['messageId']&&_0x4f68eb[_0xfffe('0x58')][_0xfffe('0x85')]&&_0x4f68eb[_0xfffe('0x58')][_0xfffe('0x85')]===_0xfffe('0x86')){return _0x16f7d9[_0xfffe('0x36')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xfffe('0x2b'),'twilio',util['inspect'](_0x4f68eb[_0xfffe('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x16f7d9;}})[_0xfffe('0x1e')](respondWithResult(_0x332145,null))[_0xfffe('0x29')](handleError(_0x332145,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 0d70479..70cf3bf 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7a0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x56dad6,_0x4022a9){var _0x29634b=function(_0x206858){while(--_0x206858){_0x56dad6['push'](_0x56dad6['shift']());}};_0x29634b(++_0x4022a9);}(_0xd7a0,0x163));var _0x0d7a=function(_0x31fcd5,_0x45a5b4){_0x31fcd5=_0x31fcd5-0x0;var _0x330961=_0xd7a0[_0x31fcd5];return _0x330961;};'use strict';var EventEmitter=require(_0x0d7a('0x0'));var WhatsappMessage=require(_0x0d7a('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0d7a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d7a('0x3'),'afterDestroy':_0x0d7a('0x4')};function emitEvent(_0x470c53){return function(_0x20f67c,_0x208f50,_0x564935){WhatsappMessageEvents[_0x0d7a('0x5')](_0x470c53+':'+_0x20f67c['id'],_0x20f67c);WhatsappMessageEvents[_0x0d7a('0x5')](_0x470c53,_0x20f67c);_0x564935(null);};}for(var e in events){if(events[_0x0d7a('0x6')](e)){var event=events[e];WhatsappMessage[_0x0d7a('0x7')](e,emitEvent(event));}}module[_0x0d7a('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xd547=['hook','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0xd547,0x1c1));var _0x7d54=function(_0x526046,_0x154040){_0x526046=_0x526046-0x0;var _0x5b92a2=_0xd547[_0x526046];return _0x5b92a2;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7d54('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7d54('0x1')](0x0);var events={'afterCreate':_0x7d54('0x2'),'afterUpdate':_0x7d54('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ab00b){return function(_0x21c23f,_0x5d21c1,_0x22ea09){WhatsappMessageEvents['emit'](_0x4ab00b+':'+_0x21c23f['id'],_0x21c23f);WhatsappMessageEvents[_0x7d54('0x4')](_0x4ab00b,_0x21c23f);_0x22ea09(null);};}for(var e in events){if(events[_0x7d54('0x5')](e)){var event=events[e];WhatsappMessage[_0x7d54('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 3734779..df341cc 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7331=['/messages/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','createdAt','catch','error','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/whatsapp/messages/','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7331,0xe3));var _0x1733=function(_0x4c0105,_0x52d4e5){_0x4c0105=_0x4c0105-0x0;var _0x11d4d6=_0x7331[_0x4c0105];return _0x11d4d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1733('0x0'))(_0x1733('0x1'));var moment=require('moment');var BPromise=require(_0x1733('0x2'));var rp=require('request-promise');var fetch=require(_0x1733('0x3'));var fs=require('fs');var path=require(_0x1733('0x4'));var rimraf=require(_0x1733('0x5'));var config=require(_0x1733('0x6'));var attributes=require(_0x1733('0x7'));module[_0x1733('0x8')]=function(_0x44e554,_0x288880){return _0x44e554[_0x1733('0x9')]('WhatsappMessage',attributes,{'tableName':_0x1733('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1733('0xb')]},{'name':_0x1733('0xc'),'fields':[_0x1733('0xd')],'type':_0x1733('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48e263,_0x571bad,_0xaa6471){var _0x50d98d=_0x44e554[_0x1733('0xf')];var _0x3d1d78=_0x48e263[_0x1733('0x10')]({'plain':!![]});if(_0x3d1d78[_0x1733('0x11')][_0x1733('0x12')]()==='in'||_0x3d1d78[_0x1733('0x11')][_0x1733('0x12')]()===_0x1733('0x13')&&!_0x3d1d78[_0x1733('0x14')]&&!_[_0x1733('0x15')](_0x3d1d78[_0x1733('0x16')])){_0x50d98d[_0x1733('0x17')]['findOne']({'where':{'id':_0x3d1d78['WhatsappInteractionId']}})[_0x1733('0x18')](function(_0x22ba01){if(_0x22ba01){_0x22ba01['update']({'lastMsgAt':_0x3d1d78[_0x1733('0x19')],'lastMsgDirection':_0x3d1d78[_0x1733('0x11')][_0x1733('0x12')]()});}})[_0x1733('0x1a')](function(_0x2355b9){console[_0x1733('0x1b')](_0x2355b9);});}if(_0x3d1d78[_0x1733('0x11')]===_0x1733('0x13')&&!_0x3d1d78[_0x1733('0x14')]){var _0x412259;_0x50d98d['WhatsappAccount']['find']({'where':{'id':_0x3d1d78[_0x1733('0x1c')]},'raw':!![]})['then'](function(_0x50a353){_0x412259=_0x50a353;if(_0x412259&&_0x412259[_0x1733('0x1d')]){switch(_0x412259[_0x1733('0x1d')]){case _0x1733('0x1e'):var _0x10a4eb=require(_0x1733('0x1e'));if(_0x412259[_0x1733('0x1f')]&&_0x412259[_0x1733('0x20')]&&_0x412259[_0x1733('0x21')]){var _0x1058a1=new _0x10a4eb(_0x412259[_0x1733('0x1f')],_0x412259[_0x1733('0x20')]);_0x1058a1[_0x1733('0x22')][_0x1733('0x23')]({'body':_0x3d1d78[_0x1733('0xd')],'to':'whatsapp:'+_0x3d1d78[_0x1733('0x21')],'from':'whatsapp:'+_0x412259[_0x1733('0x21')],'statusCallback':_0x412259['remote']+_0x1733('0x24')+_0x3d1d78['id']+'/status?token='+_0x412259[_0x1733('0x25')]})[_0x1733('0x18')](function(_0x141c60){if(_0x141c60[_0x1733('0x26')]){return _0x48e263[_0x1733('0x27')]({'messageId':_0x141c60[_0x1733('0x26')]});}})[_0x1733('0x1a')](function(_0x26478a){logger[_0x1733('0x1b')](_0x1733('0x28'),_0x1733('0x29'),_0x1733('0x1e'),util['inspect'](_0x26478a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1733('0x28'),'afterCreate',_0x1733('0x1e'),_0x1733('0x2a'));}break;case'sinch':var _0x4baf57=_0x412259[_0x1733('0x1f')];var _0x522cff=_0x412259[_0x1733('0x20')];var _0x68f436=_0x412259['baseUrl']+'/whatsapp/v1/'+_0x4baf57+_0x1733('0x2b');var _0x1d3701={'to':[_0x3d1d78[_0x1733('0x21')]],'message':{'type':_0x1733('0x2c'),'text':_0x3d1d78['body']}};var _0x50ee27={'method':_0x1733('0x2d'),'uri':_0x68f436,'headers':{'Authorization':'Bearer\x20'+_0x522cff,'Content-Type':_0x1733('0x2e')},'body':_0x1d3701,'json':!![]};rp(_0x50ee27)[_0x1733('0x18')](function(_0x5aa385){if(_0x5aa385[_0x1733('0x2f')][0x0]['message_id']){return _0x48e263[_0x1733('0x27')]({'messageId':_0x5aa385[_0x1733('0x2f')][0x0][_0x1733('0x30')]});}})[_0x1733('0x1a')](function(_0x1a702f){logger[_0x1733('0x31')](_0x1733('0x32'),_0x1a702f);});break;}}})[_0x1733('0x33')](function(){_0xaa6471();});}else{_0xaa6471();}}},'charset':_0x1733('0x34'),'collate':_0x1733('0x35')});}; \ No newline at end of file +var _0xdc82=['authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','then','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','catch','err','finally','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','WhatsappInteractionId','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid'];(function(_0x3fb560,_0x1e301f){var _0x4999b3=function(_0x4ad22e){while(--_0x4ad22e){_0x3fb560['push'](_0x3fb560['shift']());}};_0x4999b3(++_0x1e301f);}(_0xdc82,0x104));var _0x2dc8=function(_0x551433,_0x1d982a){_0x551433=_0x551433-0x0;var _0x2f2d5b=_0xdc82[_0x551433];return _0x2f2d5b;};'use strict';var _=require(_0x2dc8('0x0'));var util=require(_0x2dc8('0x1'));var logger=require(_0x2dc8('0x2'))('api');var moment=require(_0x2dc8('0x3'));var BPromise=require(_0x2dc8('0x4'));var rp=require(_0x2dc8('0x5'));var fetch=require(_0x2dc8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2dc8('0x7'));var attributes=require(_0x2dc8('0x8'));module[_0x2dc8('0x9')]=function(_0x39cc09,_0x41076b){return _0x39cc09[_0x2dc8('0xa')]('WhatsappMessage',attributes,{'tableName':_0x2dc8('0xb'),'paranoid':![],'indexes':[{'name':_0x2dc8('0xc'),'fields':[_0x2dc8('0xc')]},{'name':_0x2dc8('0xd'),'fields':[_0x2dc8('0xe')],'type':_0x2dc8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3cbaef,_0x3d2f01,_0x3b92a9){var _0x554b6b=_0x39cc09[_0x2dc8('0x10')];var _0x193561=_0x3cbaef[_0x2dc8('0x11')]({'plain':!![]});if(_0x193561['direction'][_0x2dc8('0x12')]()==='in'||_0x193561[_0x2dc8('0x13')]['toLowerCase']()===_0x2dc8('0x14')&&!_0x193561['secret']&&!_[_0x2dc8('0x15')](_0x193561['UserId'])){_0x554b6b['WhatsappInteraction'][_0x2dc8('0x16')]({'where':{'id':_0x193561[_0x2dc8('0x17')]}})['then'](function(_0x5ae05a){if(_0x5ae05a){_0x5ae05a['update']({'lastMsgAt':_0x193561['createdAt'],'lastMsgDirection':_0x193561[_0x2dc8('0x13')]['toLowerCase']()});}})['catch'](function(_0x5c6941){console['error'](_0x5c6941);});}if(_0x193561[_0x2dc8('0x13')]===_0x2dc8('0x14')&&!_0x193561['secret']){var _0x6f3a78;_0x554b6b[_0x2dc8('0x18')][_0x2dc8('0x19')]({'where':{'id':_0x193561[_0x2dc8('0x1a')]},'raw':!![]})['then'](function(_0x292f6a){_0x6f3a78=_0x292f6a;if(_0x6f3a78&&_0x6f3a78[_0x2dc8('0x1b')]){switch(_0x6f3a78['type']){case _0x2dc8('0x1c'):var _0x24ee8a=require(_0x2dc8('0x1c'));if(_0x6f3a78[_0x2dc8('0x1d')]&&_0x6f3a78[_0x2dc8('0x1e')]&&_0x6f3a78[_0x2dc8('0x1f')]){var _0x4fdec4=new _0x24ee8a(_0x6f3a78[_0x2dc8('0x1d')],_0x6f3a78[_0x2dc8('0x1e')]);_0x4fdec4[_0x2dc8('0x20')][_0x2dc8('0x21')]({'body':_0x193561[_0x2dc8('0xe')],'to':'whatsapp:'+_0x193561[_0x2dc8('0x1f')],'from':_0x2dc8('0x22')+_0x6f3a78[_0x2dc8('0x1f')],'statusCallback':_0x6f3a78['remote']+_0x2dc8('0x23')+_0x193561['id']+_0x2dc8('0x24')+_0x6f3a78[_0x2dc8('0x25')]})[_0x2dc8('0x26')](function(_0x495606){if(_0x495606['sid']){return _0x3cbaef[_0x2dc8('0x27')]({'messageId':_0x495606[_0x2dc8('0x28')]});}})['catch'](function(_0x101d7c){logger[_0x2dc8('0x29')](_0x2dc8('0x2a'),'afterCreate',_0x2dc8('0x1c'),util[_0x2dc8('0x2b')](_0x101d7c,{'showHidden':![],'depth':null}));});}else{logger[_0x2dc8('0x29')](_0x2dc8('0x2a'),_0x2dc8('0x2c'),_0x2dc8('0x1c'),_0x2dc8('0x2d'));}break;case _0x2dc8('0x2e'):var _0x486c92=_0x6f3a78[_0x2dc8('0x1d')];var _0x1a6c73=_0x6f3a78[_0x2dc8('0x1e')];var _0xcf0da5=_0x6f3a78[_0x2dc8('0x2f')]+_0x2dc8('0x30')+_0x486c92+_0x2dc8('0x31');var _0x2f2b99={'to':[_0x193561[_0x2dc8('0x1f')]],'message':{'type':'text','text':_0x193561[_0x2dc8('0xe')]}};var _0x3e7c39={'method':_0x2dc8('0x32'),'uri':_0xcf0da5,'headers':{'Authorization':_0x2dc8('0x33')+_0x1a6c73,'Content-Type':_0x2dc8('0x34')},'body':_0x2f2b99,'json':!![]};rp(_0x3e7c39)['then'](function(_0x16ad07){if(_0x16ad07[_0x2dc8('0x35')][0x0][_0x2dc8('0x36')]){return _0x3cbaef[_0x2dc8('0x27')]({'messageId':_0x16ad07[_0x2dc8('0x35')][0x0][_0x2dc8('0x36')]});}})[_0x2dc8('0x37')](function(_0xe95190){logger[_0x2dc8('0x38')]('WhatsappMessage,\x20%s',_0xe95190);});break;}}})[_0x2dc8('0x39')](function(){_0x3b92a9();});}else{_0x3b92a9();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 272ca0b..c411e0a 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x123c=['localhost','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x1d74d3,_0x2da4dc){var _0x1f4768=function(_0x2af8e4){while(--_0x2af8e4){_0x1d74d3['push'](_0x1d74d3['shift']());}};_0x1f4768(++_0x2da4dc);}(_0x123c,0x8a));var _0xc123=function(_0x2fc357,_0x45ec4b){_0x2fc357=_0x2fc357-0x0;var _0x4de14f=_0x123c[_0x2fc357];return _0x4de14f;};'use strict';var _=require(_0xc123('0x0'));var util=require(_0xc123('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc123('0x2'));var fs=require('fs');var Redis=require(_0xc123('0x3'));var db=require(_0xc123('0x4'))['db'];var utils=require(_0xc123('0x5'));var logger=require(_0xc123('0x6'))(_0xc123('0x7'));var config=require('../../config/environment');var jayson=require(_0xc123('0x8'));var client=jayson[_0xc123('0x9')][_0xc123('0xa')]({'port':0x232a});config[_0xc123('0xb')]=_['defaults'](config[_0xc123('0xb')],{'host':_0xc123('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc123('0xb')]));require('./whatsappMessage.socket')[_0xc123('0xd')](socket);function respondWithRpcPromise(_0x32df0d,_0x4a5007,_0x9a80a0){return new BPromise(function(_0x4acd60,_0x1a145e){return client[_0xc123('0xe')](_0x32df0d,_0x9a80a0)[_0xc123('0xf')](function(_0x4612a9){logger['info'](_0xc123('0x10'),_0x4a5007,_0xc123('0x11'));logger[_0xc123('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4a5007,_0xc123('0x11'),JSON[_0xc123('0x13')](_0x4612a9));if(_0x4612a9[_0xc123('0x14')]){if(_0x4612a9['error'][_0xc123('0x15')]===0x1f4){logger[_0xc123('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x4a5007,_0x4612a9[_0xc123('0x14')][_0xc123('0x16')]);return _0x1a145e(_0x4612a9['error'][_0xc123('0x16')]);}logger[_0xc123('0x14')](_0xc123('0x10'),_0x4a5007,_0x4612a9[_0xc123('0x14')][_0xc123('0x16')]);return _0x4acd60(_0x4612a9[_0xc123('0x14')]['message']);}else{logger[_0xc123('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4a5007,_0xc123('0x11'));_0x4acd60(_0x4612a9['result'][_0xc123('0x16')]);}})[_0xc123('0x18')](function(_0x21a303){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4a5007,_0x21a303);_0x1a145e(_0x21a303);});});}exports[_0xc123('0x19')]=function(_0x1fd970){var _0x45cfa4=this;return new Promise(function(_0x339858,_0x3e4403){return db[_0xc123('0x1a')][_0xc123('0x1b')](_0x1fd970['body'],{'raw':_0x1fd970[_0xc123('0x1c')]?_0x1fd970['options'][_0xc123('0x1d')]===undefined?!![]:![]:!![]})[_0xc123('0xf')](function(_0x2e86e1){logger[_0xc123('0x17')](_0xc123('0x19'),_0x1fd970);logger['debug'](_0xc123('0x19'),_0x1fd970,JSON['stringify'](_0x2e86e1));_0x339858(_0x2e86e1);})[_0xc123('0x18')](function(_0x58af1f){logger['error'](_0xc123('0x19'),_0x58af1f['message'],_0x1fd970);_0x3e4403(_0x45cfa4[_0xc123('0x14')](0x1f4,_0x58af1f[_0xc123('0x16')]));});});}; \ No newline at end of file +var _0xd52b=['jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3fb43c,_0x572888){var _0x129d4b=function(_0x18faf2){while(--_0x18faf2){_0x3fb43c['push'](_0x3fb43c['shift']());}};_0x129d4b(++_0x572888);}(_0xd52b,0x157));var _0xbd52=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd52b[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xbd52('0x0'));var util=require(_0xbd52('0x1'));var moment=require(_0xbd52('0x2'));var BPromise=require(_0xbd52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd52('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbd52('0x5'));var client=jayson[_0xbd52('0x6')][_0xbd52('0x7')]({'port':0x232a});config[_0xbd52('0x8')]=_[_0xbd52('0x9')](config[_0xbd52('0x8')],{'host':_0xbd52('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd52('0x8')]));require(_0xbd52('0xb'))['register'](socket);function respondWithRpcPromise(_0x4120fd,_0x164570,_0x171d5b){return new BPromise(function(_0x4f3aca,_0x4b9f13){return client[_0xbd52('0xc')](_0x4120fd,_0x171d5b)['then'](function(_0x35050b){logger['info'](_0xbd52('0xd'),_0x164570,'request\x20sent');logger[_0xbd52('0xe')](_0xbd52('0xf'),_0x164570,'request\x20sent',JSON[_0xbd52('0x10')](_0x35050b));if(_0x35050b[_0xbd52('0x11')]){if(_0x35050b['error'][_0xbd52('0x12')]===0x1f4){logger[_0xbd52('0x11')](_0xbd52('0xd'),_0x164570,_0x35050b[_0xbd52('0x11')]['message']);return _0x4b9f13(_0x35050b[_0xbd52('0x11')][_0xbd52('0x13')]);}logger[_0xbd52('0x11')](_0xbd52('0xd'),_0x164570,_0x35050b[_0xbd52('0x11')][_0xbd52('0x13')]);return _0x4f3aca(_0x35050b[_0xbd52('0x11')][_0xbd52('0x13')]);}else{logger[_0xbd52('0x14')](_0xbd52('0xd'),_0x164570,_0xbd52('0x15'));_0x4f3aca(_0x35050b[_0xbd52('0x16')]['message']);}})[_0xbd52('0x17')](function(_0x2f72fb){logger[_0xbd52('0x11')](_0xbd52('0xd'),_0x164570,_0x2f72fb);_0x4b9f13(_0x2f72fb);});});}exports[_0xbd52('0x18')]=function(_0x11c3f2){var _0x21b33b=this;return new Promise(function(_0x422e97,_0x38ca0c){return db[_0xbd52('0x19')]['create'](_0x11c3f2[_0xbd52('0x1a')],{'raw':_0x11c3f2[_0xbd52('0x1b')]?_0x11c3f2['options'][_0xbd52('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4dea0b){logger['info'](_0xbd52('0x18'),_0x11c3f2);logger[_0xbd52('0xe')](_0xbd52('0x18'),_0x11c3f2,JSON[_0xbd52('0x10')](_0x4dea0b));_0x422e97(_0x4dea0b);})[_0xbd52('0x17')](function(_0x1b6ff9){logger['error'](_0xbd52('0x18'),_0x1b6ff9[_0xbd52('0x13')],_0x11c3f2);_0x38ca0c(_0x21b33b[_0xbd52('0x11')](0x1f4,_0x1b6ff9[_0xbd52('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 7c37a08..32384ad 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40f5=['update','emit','register','length','./whatsappMessage.events','save','remove'];(function(_0x1b8651,_0xaee32c){var _0x4fb25d=function(_0x38f1cd){while(--_0x38f1cd){_0x1b8651['push'](_0x1b8651['shift']());}};_0x4fb25d(++_0xaee32c);}(_0x40f5,0x1e7));var _0x540f=function(_0x4738d7,_0x46a6e0){_0x4738d7=_0x4738d7-0x0;var _0x27ab9b=_0x40f5[_0x4738d7];return _0x27ab9b;};'use strict';var WhatsappMessageEvents=require(_0x540f('0x0'));var events=[_0x540f('0x1'),_0x540f('0x2'),_0x540f('0x3')];function createListener(_0x251876,_0x41c41f){return function(_0x3014c9){_0x41c41f[_0x540f('0x4')](_0x251876,_0x3014c9);};}function removeListener(_0x4567da,_0x2ecdcf){return function(){WhatsappMessageEvents['removeListener'](_0x4567da,_0x2ecdcf);};}exports[_0x540f('0x5')]=function(_0x1b2265){for(var _0x5549e2=0x0,_0x3a7829=events[_0x540f('0x6')];_0x5549e2<_0x3a7829;_0x5549e2++){var _0x2b5210=events[_0x5549e2];var _0x38cf72=createListener('whatsappMessage:'+_0x2b5210,_0x1b2265);WhatsappMessageEvents['on'](_0x2b5210,_0x38cf72);}}; \ No newline at end of file +var _0xc56e=['emit','removeListener','register','./whatsappMessage.events','save','remove','update'];(function(_0xe65068,_0x23ba2a){var _0x1e3c6f=function(_0x2e0ca9){while(--_0x2e0ca9){_0xe65068['push'](_0xe65068['shift']());}};_0x1e3c6f(++_0x23ba2a);}(_0xc56e,0x1ae));var _0xec56=function(_0x572e50,_0x5065b3){_0x572e50=_0x572e50-0x0;var _0x14ed2b=_0xc56e[_0x572e50];return _0x14ed2b;};'use strict';var WhatsappMessageEvents=require(_0xec56('0x0'));var events=[_0xec56('0x1'),_0xec56('0x2'),_0xec56('0x3')];function createListener(_0x3c4330,_0x2ddb64){return function(_0x3159d8){_0x2ddb64[_0xec56('0x4')](_0x3c4330,_0x3159d8);};}function removeListener(_0x54f9fb,_0x10c204){return function(){WhatsappMessageEvents[_0xec56('0x5')](_0x54f9fb,_0x10c204);};}exports[_0xec56('0x6')]=function(_0x3a5cfa){for(var _0x45e981=0x0,_0x2a1ef6=events['length'];_0x45e981<_0x2a1ef6;_0x45e981++){var _0x2a42e9=events[_0x45e981];var _0x2efbcd=createListener('whatsappMessage:'+_0x2a42e9,_0x3a5cfa);WhatsappMessageEvents['on'](_0x2a42e9,_0x2efbcd);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 276f2af..e1b768d 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e89=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','express','Router','fs-extra'];(function(_0x3d0161,_0x39d265){var _0x474b5c=function(_0xee86d1){while(--_0xee86d1){_0x3d0161['push'](_0x3d0161['shift']());}};_0x474b5c(++_0x39d265);}(_0x5e89,0x19d));var _0x95e8=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5e89[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x95e8('0x0'));var router=express[_0x95e8('0x1')]();var fs_extra=require(_0x95e8('0x2'));var auth=require(_0x95e8('0x3'));var interaction=require(_0x95e8('0x4'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x95e8('0x5')]('/',auth[_0x95e8('0x6')](),controller[_0x95e8('0x7')]);router[_0x95e8('0x5')]('/describe',auth[_0x95e8('0x6')](),controller[_0x95e8('0x8')]);router['get'](_0x95e8('0x9'),auth[_0x95e8('0x6')](),controller[_0x95e8('0xa')]);router[_0x95e8('0x5')]('/:id/members',auth[_0x95e8('0x6')](),controller[_0x95e8('0xb')]);router[_0x95e8('0x5')](_0x95e8('0xc'),auth[_0x95e8('0x6')](),controller[_0x95e8('0xd')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x95e8('0xe')]('/',auth[_0x95e8('0x6')](),controller[_0x95e8('0xf')]);router[_0x95e8('0xe')]('/:id/teams',auth['isAuthenticated'](),controller[_0x95e8('0x10')]);router[_0x95e8('0xe')]('/:id/users',auth[_0x95e8('0x6')](),controller[_0x95e8('0x11')]);router[_0x95e8('0x12')](_0x95e8('0x9'),auth[_0x95e8('0x6')](),controller[_0x95e8('0x13')]);router[_0x95e8('0x14')](_0x95e8('0x9'),auth[_0x95e8('0x6')](),controller[_0x95e8('0x15')]);router[_0x95e8('0x14')](_0x95e8('0xc'),auth[_0x95e8('0x6')](),controller[_0x95e8('0x16')]);router[_0x95e8('0x14')](_0x95e8('0x17'),auth[_0x95e8('0x6')](),controller[_0x95e8('0x18')]);module[_0x95e8('0x19')]=router; \ No newline at end of file +var _0x1d11=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','/:id','/:id/members','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x499c0d,_0x3a36b7){var _0x19dfb4=function(_0x55463f){while(--_0x55463f){_0x499c0d['push'](_0x499c0d['shift']());}};_0x19dfb4(++_0x3a36b7);}(_0x1d11,0xb6));var _0x11d1=function(_0x141993,_0x5cd8c2){_0x141993=_0x141993-0x0;var _0x55203a=_0x1d11[_0x141993];return _0x55203a;};'use strict';var multer=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var path=require(_0x11d1('0x2'));var timeout=require(_0x11d1('0x3'));var express=require(_0x11d1('0x4'));var router=express[_0x11d1('0x5')]();var fs_extra=require(_0x11d1('0x6'));var auth=require(_0x11d1('0x7'));var interaction=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var controller=require(_0x11d1('0xa'));router['get']('/',auth[_0x11d1('0xb')](),controller['index']);router[_0x11d1('0xc')](_0x11d1('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x11d1('0xc')](_0x11d1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x11d1('0xc')](_0x11d1('0xf'),auth[_0x11d1('0xb')](),controller['getMembers']);router['get'](_0x11d1('0x10'),auth[_0x11d1('0xb')](),controller['getTeams']);router['get'](_0x11d1('0x11'),auth[_0x11d1('0xb')](),controller[_0x11d1('0x12')]);router[_0x11d1('0x13')]('/',auth['isAuthenticated'](),controller[_0x11d1('0x14')]);router[_0x11d1('0x13')](_0x11d1('0x10'),auth['isAuthenticated'](),controller[_0x11d1('0x15')]);router[_0x11d1('0x13')](_0x11d1('0x11'),auth[_0x11d1('0xb')](),controller[_0x11d1('0x16')]);router['put'](_0x11d1('0xe'),auth['isAuthenticated'](),controller[_0x11d1('0x17')]);router[_0x11d1('0x18')](_0x11d1('0xe'),auth[_0x11d1('0xb')](),controller[_0x11d1('0x19')]);router[_0x11d1('0x18')]('/:id/teams',auth[_0x11d1('0xb')](),controller[_0x11d1('0x1a')]);router[_0x11d1('0x18')](_0x11d1('0x11'),auth[_0x11d1('0xb')](),controller[_0x11d1('0x1b')]);module[_0x11d1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index b3bbccc..1c16e1a 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee4f=['name','INTEGER','ENUM','beepall','STRING','sequelize'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0xee4f,0xad));var _0xfee4=function(_0xfb103e,_0x1cea7e){_0xfb103e=_0xfb103e-0x0;var _0x5dbe70=_0xee4f[_0xfb103e];return _0x5dbe70;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfee4('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfee4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfee4('0x3')]('rrmemory',_0xfee4('0x4'),'roundrobin')},'description':{'type':Sequelize[_0xfee4('0x5')]}}; \ No newline at end of file +var _0xe3ee=['name','rrmemory','STRING'];(function(_0x5c9317,_0x1d1dbf){var _0x406cc4=function(_0x2e93b0){while(--_0x2e93b0){_0x5c9317['push'](_0x5c9317['shift']());}};_0x406cc4(++_0x1d1dbf);}(_0xe3ee,0x116));var _0xee3e=function(_0x5f1e39,_0x87510e){_0x5f1e39=_0x5f1e39-0x0;var _0x404e5d=_0xe3ee[_0x5f1e39];return _0x404e5d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee3e('0x0')],'unique':_0xee3e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xee3e('0x2'),'beepall','roundrobin')},'description':{'type':Sequelize[_0xee3e('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index be11ae0..b605ff0 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5335=['tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','sendStatus','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','length','nolimit','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','Team','getTeams','addTeams','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','field'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5335,0xa0));var _0x5533=function(_0x4743be,_0x579f6e){_0x4743be=_0x4743be-0x0;var _0x272224=_0x5335[_0x4743be];return _0x272224;};'use strict';var emlformat=require(_0x5533('0x0'));var rimraf=require(_0x5533('0x1'));var zipdir=require(_0x5533('0x2'));var jsonpatch=require(_0x5533('0x3'));var rp=require(_0x5533('0x4'));var moment=require(_0x5533('0x5'));var BPromise=require(_0x5533('0x6'));var Mustache=require(_0x5533('0x7'));var util=require('util');var path=require(_0x5533('0x8'));var sox=require(_0x5533('0x9'));var csv=require(_0x5533('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5533('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5533('0xc'));var jsforce=require(_0x5533('0xd'));var deskjs=require(_0x5533('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5533('0xf'));var Papa=require('papaparse');var Redis=require(_0x5533('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5533('0x11'));var as=require(_0x5533('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5533('0x13'))(_0x5533('0x14'));var utils=require(_0x5533('0x15'));var config=require(_0x5533('0x16'));var licenseUtil=require(_0x5533('0x17'));var db=require(_0x5533('0x18'))['db'];config[_0x5533('0x19')]=_[_0x5533('0x1a')](config[_0x5533('0x19')],{'host':_0x5533('0x1b'),'port':0x18eb});var socket=require(_0x5533('0x1c'))(new Redis(config[_0x5533('0x19')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x811621,_0x18e7ec){_0x18e7ec=_0x18e7ec||0xcc;return function(_0x2fc435){if(_0x2fc435){return _0x811621['sendStatus'](_0x18e7ec);}return _0x811621[_0x5533('0x1d')](_0x18e7ec)['end']();};}function respondWithResult(_0x5ce8c1,_0x26eb35){_0x26eb35=_0x26eb35||0xc8;return function(_0x464583){if(_0x464583){return _0x5ce8c1[_0x5533('0x1d')](_0x26eb35)[_0x5533('0x1e')](_0x464583);}};}function respondWithFilteredResult(_0x1a70db,_0x2c4baf){return function(_0xde7230){if(_0xde7230){var _0x3ea1fc=typeof _0x2c4baf[_0x5533('0x1f')]===_0x5533('0x20')&&typeof _0x2c4baf[_0x5533('0x21')]===_0x5533('0x20');var _0x5cd21a=_0xde7230[_0x5533('0x22')];var _0x44ede0=_0x3ea1fc?0x0:_0x2c4baf[_0x5533('0x1f')];var _0x104aff=_0x3ea1fc?_0xde7230['count']:_0x2c4baf[_0x5533('0x1f')]+_0x2c4baf[_0x5533('0x21')];var _0x479ce9;if(_0x104aff>=_0x5cd21a){_0x104aff=_0x5cd21a;_0x479ce9=0xc8;}else{_0x479ce9=0xce;}_0x1a70db[_0x5533('0x1d')](_0x479ce9);return _0x1a70db['set'](_0x5533('0x23'),_0x44ede0+'-'+_0x104aff+'/'+_0x5cd21a)['json'](_0xde7230);}return null;};}function patchUpdates(_0x1790df){return function(_0x53b3cf){try{jsonpatch[_0x5533('0x24')](_0x53b3cf,_0x1790df,!![]);}catch(_0x211a3d){return BPromise[_0x5533('0x25')](_0x211a3d);}return _0x53b3cf[_0x5533('0x26')]();};}function saveUpdates(_0x57136c,_0x13f3c4){return function(_0x1a1436){if(_0x1a1436){return _0x1a1436['update'](_0x57136c)[_0x5533('0x27')](function(_0x4c831d){return _0x4c831d;});}return null;};}function removeEntity(_0x21601f,_0x10b369){return function(_0x42eeee){if(_0x42eeee){return _0x42eeee[_0x5533('0x28')]()[_0x5533('0x27')](function(){var _0x43bc0e=_0x42eeee[_0x5533('0x29')]({'plain':!![]});var _0x30bef4=_0x5533('0x2a');return db['UserProfileResource'][_0x5533('0x28')]({'where':{'type':_0x30bef4,'resourceId':_0x43bc0e['id']}})[_0x5533('0x27')](function(){return _0x42eeee;});})[_0x5533('0x27')](function(){_0x21601f[_0x5533('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d434b,_0xd16686){return function(_0x4fa8b0){if(!_0x4fa8b0){_0x2d434b[_0x5533('0x2b')](0x194);}return _0x4fa8b0;};}function handleError(_0x1f644a,_0x3c810c){_0x3c810c=_0x3c810c||0x1f4;return function(_0x18bb59){logger['error'](_0x18bb59[_0x5533('0x2c')]);if(_0x18bb59[_0x5533('0x2d')]){delete _0x18bb59[_0x5533('0x2d')];}_0x1f644a[_0x5533('0x1d')](_0x3c810c)[_0x5533('0x2e')](_0x18bb59);};}exports[_0x5533('0x2f')]=function(_0x4c6517,_0x2e06ff){var _0x5ceeee={},_0x16715e={},_0x5f4f1a={'count':0x0,'rows':[]};var _0x526a4b=_[_0x5533('0x30')](db[_0x5533('0x31')][_0x5533('0x32')],function(_0x4c6099){return{'name':_0x4c6099[_0x5533('0x33')],'type':_0x4c6099[_0x5533('0x34')][_0x5533('0x35')]};});_0x16715e[_0x5533('0x36')]=_['map'](_0x526a4b,_0x5533('0x2d'));_0x16715e[_0x5533('0x37')]=_[_0x5533('0x38')](_0x4c6517['query']);_0x16715e['filters']=_[_0x5533('0x39')](_0x16715e['model'],_0x16715e[_0x5533('0x37')]);_0x5ceeee['attributes']=_['intersection'](_0x16715e['model'],qs[_0x5533('0x3a')](_0x4c6517[_0x5533('0x37')][_0x5533('0x3a')]));_0x5ceeee[_0x5533('0x3b')]=_0x5ceeee[_0x5533('0x3b')]['length']?_0x5ceeee[_0x5533('0x3b')]:_0x16715e[_0x5533('0x36')];if(!_0x4c6517['query'][_0x5533('0x3c')]('nolimit')){_0x5ceeee[_0x5533('0x21')]=qs[_0x5533('0x21')](_0x4c6517[_0x5533('0x37')]['limit']);_0x5ceeee['offset']=qs[_0x5533('0x1f')](_0x4c6517[_0x5533('0x37')][_0x5533('0x1f')]);}_0x5ceeee[_0x5533('0x3d')]=qs[_0x5533('0x3e')](_0x4c6517[_0x5533('0x37')][_0x5533('0x3e')]);_0x5ceeee[_0x5533('0x3f')]=qs[_0x5533('0x40')](_[_0x5533('0x41')](_0x4c6517[_0x5533('0x37')],_0x16715e[_0x5533('0x40')]),_0x526a4b);if(_0x4c6517[_0x5533('0x37')][_0x5533('0x42')]){_0x5ceeee[_0x5533('0x3f')]=_['merge'](_0x5ceeee[_0x5533('0x3f')],{'$or':_[_0x5533('0x30')](_0x526a4b,function(_0x5a04fb){if(_0x5a04fb[_0x5533('0x34')]!==_0x5533('0x43')){var _0x9fe1af={};_0x9fe1af[_0x5a04fb[_0x5533('0x2d')]]={'$like':'%'+_0x4c6517['query']['filter']+'%'};return _0x9fe1af;}})});}_0x5ceeee=_[_0x5533('0x44')]({},_0x5ceeee,_0x4c6517[_0x5533('0x45')]);var _0x499e08={'where':_0x5ceeee['where']};return db[_0x5533('0x31')][_0x5533('0x22')](_0x499e08)[_0x5533('0x27')](function(_0x160838){_0x5f4f1a[_0x5533('0x22')]=_0x160838;if(_0x4c6517[_0x5533('0x37')]['includeAll']){_0x5ceeee['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x5533('0x46')](_0x5ceeee);})[_0x5533('0x27')](function(_0x391371){_0x5f4f1a[_0x5533('0x47')]=_0x391371;return _0x5f4f1a;})['then'](respondWithFilteredResult(_0x2e06ff,_0x5ceeee))[_0x5533('0x48')](handleError(_0x2e06ff,null));};exports[_0x5533('0x49')]=function(_0xf640de,_0x5b7641){var _0x4a3551={'raw':!![],'where':{'id':_0xf640de['params']['id']}},_0x14733a={};_0x14733a[_0x5533('0x36')]=_[_0x5533('0x38')](db[_0x5533('0x31')][_0x5533('0x32')]);_0x14733a['query']=_['keys'](_0xf640de[_0x5533('0x37')]);_0x14733a[_0x5533('0x40')]=_[_0x5533('0x39')](_0x14733a['model'],_0x14733a[_0x5533('0x37')]);_0x4a3551[_0x5533('0x3b')]=_[_0x5533('0x39')](_0x14733a['model'],qs[_0x5533('0x3a')](_0xf640de[_0x5533('0x37')][_0x5533('0x3a')]));_0x4a3551[_0x5533('0x3b')]=_0x4a3551[_0x5533('0x3b')]['length']?_0x4a3551[_0x5533('0x3b')]:_0x14733a['model'];if(_0xf640de['query'][_0x5533('0x4a')]){_0x4a3551[_0x5533('0x4b')]=[{'all':!![]}];}_0x4a3551=_['merge']({},_0x4a3551,_0xf640de[_0x5533('0x45')]);return db[_0x5533('0x31')][_0x5533('0x4c')](_0x4a3551)[_0x5533('0x27')](handleEntityNotFound(_0x5b7641,null))[_0x5533('0x27')](respondWithResult(_0x5b7641,null))[_0x5533('0x48')](handleError(_0x5b7641,null));};exports[_0x5533('0x4d')]=function(_0x42a1bd,_0x1c4e65){return db['WhatsappQueue'][_0x5533('0x4d')](_0x42a1bd[_0x5533('0x4e')],{})[_0x5533('0x27')](function(_0x523626){var _0x3e81ad=_0x42a1bd['user']['get']({'plain':!![]});if(!_0x3e81ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e81ad['role']===_0x5533('0x4f')){var _0x55fb41=_0x523626['get']({'plain':!![]});var _0x44de37='WhatsappQueues';return db[_0x5533('0x50')][_0x5533('0x4c')]({'where':{'name':_0x44de37,'userProfileId':_0x3e81ad['userProfileId']},'raw':!![]})[_0x5533('0x27')](function(_0xccc25b){if(_0xccc25b&&_0xccc25b[_0x5533('0x51')]===0x0){return db[_0x5533('0x52')][_0x5533('0x4d')]({'name':_0x55fb41['name'],'resourceId':_0x55fb41['id'],'type':_0xccc25b[_0x5533('0x2d')],'sectionId':_0xccc25b['id']},{})[_0x5533('0x27')](function(){return _0x523626;});}else{return _0x523626;}})[_0x5533('0x48')](function(_0x3ff2d6){logger[_0x5533('0x53')](_0x5533('0x54'),_0x3ff2d6);throw _0x3ff2d6;});}return _0x523626;})[_0x5533('0x27')](respondWithResult(_0x1c4e65,0xc9))[_0x5533('0x48')](handleError(_0x1c4e65,null));};exports['update']=function(_0x20b5ae,_0x2454f7){if(_0x20b5ae['body']['id']){delete _0x20b5ae[_0x5533('0x4e')]['id'];}return db[_0x5533('0x31')][_0x5533('0x4c')]({'where':{'id':_0x20b5ae[_0x5533('0x55')]['id']}})['then'](handleEntityNotFound(_0x2454f7,null))[_0x5533('0x27')](saveUpdates(_0x20b5ae[_0x5533('0x4e')],null))['then'](respondWithResult(_0x2454f7,null))[_0x5533('0x48')](handleError(_0x2454f7,null));};exports['destroy']=function(_0x2cee7f,_0x244863){return db[_0x5533('0x31')][_0x5533('0x4c')]({'where':{'id':_0x2cee7f[_0x5533('0x55')]['id']}})['then'](handleEntityNotFound(_0x244863,null))[_0x5533('0x27')](removeEntity(_0x244863,null))[_0x5533('0x48')](handleError(_0x244863,null));};exports[_0x5533('0x56')]=function(_0x55eee4,_0x1fbb6f){return db[_0x5533('0x31')][_0x5533('0x56')]()[_0x5533('0x27')](respondWithResult(_0x1fbb6f,null))[_0x5533('0x48')](handleError(_0x1fbb6f,null));};exports[_0x5533('0x57')]=function(_0x3c44d1,_0x21c896,_0x194631){var _0x2206e3={'raw':!![],'where':{}},_0x2e9cc0={},_0x289ee7;return db[_0x5533('0x31')][_0x5533('0x58')]({'where':{'id':_0x3c44d1['params']['id']}})[_0x5533('0x27')](handleEntityNotFound(_0x21c896,null))[_0x5533('0x27')](function(_0x10f1f9){if(_0x10f1f9){_0x289ee7=_0x10f1f9[_0x5533('0x29')]({'plain':!![]});_0x2e9cc0[_0x5533('0x36')]=_[_0x5533('0x38')](db['UserWhatsappQueue'][_0x5533('0x32')]);_0x2e9cc0[_0x5533('0x37')]=_[_0x5533('0x38')](_0x3c44d1[_0x5533('0x37')]);_0x2e9cc0[_0x5533('0x40')]=_[_0x5533('0x39')](_0x2e9cc0[_0x5533('0x36')],_0x2e9cc0[_0x5533('0x37')]);_0x2206e3[_0x5533('0x3b')]=_[_0x5533('0x39')](_0x2e9cc0[_0x5533('0x36')],qs[_0x5533('0x3a')](_0x3c44d1[_0x5533('0x37')][_0x5533('0x3a')]));_0x2206e3[_0x5533('0x3b')]=_0x2206e3['attributes'][_0x5533('0x59')]?_0x2206e3[_0x5533('0x3b')]:_0x2e9cc0[_0x5533('0x36')];if(!_0x3c44d1['query'][_0x5533('0x3c')](_0x5533('0x5a'))){_0x2206e3['limit']=qs[_0x5533('0x21')](_0x3c44d1['query']['limit']);_0x2206e3[_0x5533('0x1f')]=qs[_0x5533('0x1f')](_0x3c44d1[_0x5533('0x37')][_0x5533('0x1f')]);}_0x2206e3[_0x5533('0x3d')]=qs[_0x5533('0x3e')](_0x3c44d1[_0x5533('0x37')][_0x5533('0x3e')]);_0x2206e3[_0x5533('0x3f')]=qs[_0x5533('0x40')](_[_0x5533('0x41')](_0x3c44d1[_0x5533('0x37')],_0x2e9cc0[_0x5533('0x40')]));_0x2206e3[_0x5533('0x3f')][_0x5533('0x5b')]=_0x10f1f9['id'];if(_0x3c44d1[_0x5533('0x37')][_0x5533('0x42')]){_0x2206e3[_0x5533('0x3f')]=_[_0x5533('0x44')](_0x2206e3[_0x5533('0x3f')],{'$or':_['map'](_0x2206e3[_0x5533('0x3b')],function(_0x11fc39){var _0x3a499b={};_0x3a499b[_0x11fc39]={'$like':'%'+_0x3c44d1['query']['filter']+'%'};return _0x3a499b;})});}_0x2206e3=_['merge']({},_0x2206e3,_0x3c44d1['options']);return db[_0x5533('0x5c')][_0x5533('0x46')](_0x2206e3);}})[_0x5533('0x27')](function(_0x1c982d){if(_0x1c982d){return db['User'][_0x5533('0x5d')]({'where':{'id':_['map'](_0x1c982d,_0x5533('0x5e')),'role':'agent'},'attributes':['id',_0x5533('0x2d'),_0x5533('0x5f'),_0x5533('0x60'),_0x5533('0x61')]});}})['then'](function(_0x13448c){if(_0x13448c){return{'count':_0x13448c[_0x5533('0x22')],'rows':_['map'](_0x13448c[_0x5533('0x47')],function(_0x24c524){return{'membername':_0x24c524['name'],'UserId':_0x24c524['id'],'queue_name':_0x289ee7[_0x5533('0x2d')],'WhatsappQueueId':_0x289ee7['id'],'interface':util['format']('%s/%s','SIP',_0x24c524[_0x5533('0x2d')]),'penalty':0x0,'paused':_0x24c524[_0x5533('0x5f')],'createdAt':_0x24c524['createdAt'],'updatedAt':_0x24c524[_0x5533('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x21c896,_0x2206e3))[_0x5533('0x48')](handleError(_0x21c896,null));};exports['getTeams']=function(_0x297b7,_0x3d31c0,_0x345230){var _0x1ee522={};var _0x47ffdf={};var _0x166050;var _0x3c97aa;return db[_0x5533('0x31')][_0x5533('0x58')]({'where':{'id':_0x297b7[_0x5533('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d31c0,null))['then'](function(_0x3390cf){if(_0x3390cf){_0x166050=_0x3390cf;_0x47ffdf[_0x5533('0x36')]=_[_0x5533('0x38')](db[_0x5533('0x62')][_0x5533('0x32')]);_0x47ffdf[_0x5533('0x37')]=_[_0x5533('0x38')](_0x297b7[_0x5533('0x37')]);_0x47ffdf[_0x5533('0x40')]=_[_0x5533('0x39')](_0x47ffdf['model'],_0x47ffdf[_0x5533('0x37')]);_0x1ee522[_0x5533('0x3b')]=_[_0x5533('0x39')](_0x47ffdf[_0x5533('0x36')],qs['fields'](_0x297b7[_0x5533('0x37')][_0x5533('0x3a')]));_0x1ee522[_0x5533('0x3b')]=_0x1ee522[_0x5533('0x3b')][_0x5533('0x59')]?_0x1ee522[_0x5533('0x3b')]:_0x47ffdf['model'];_0x1ee522[_0x5533('0x3d')]=qs[_0x5533('0x3e')](_0x297b7[_0x5533('0x37')][_0x5533('0x3e')]);_0x1ee522['where']=qs[_0x5533('0x40')](_[_0x5533('0x41')](_0x297b7[_0x5533('0x37')],_0x47ffdf[_0x5533('0x40')]));if(_0x297b7[_0x5533('0x37')][_0x5533('0x42')]){_0x1ee522[_0x5533('0x3f')]=_[_0x5533('0x44')](_0x1ee522[_0x5533('0x3f')],{'$or':_[_0x5533('0x30')](_0x1ee522[_0x5533('0x3b')],function(_0x1e0cb0){var _0x1902f0={};_0x1902f0[_0x1e0cb0]={'$like':'%'+_0x297b7['query'][_0x5533('0x42')]+'%'};return _0x1902f0;})});}_0x1ee522=_[_0x5533('0x44')]({},_0x1ee522,_0x297b7['options']);return _0x166050['getTeams'](_0x1ee522);}})[_0x5533('0x27')](function(_0x34ec23){if(_0x34ec23){_0x3c97aa=_0x34ec23[_0x5533('0x59')];if(!_0x297b7['query'][_0x5533('0x3c')](_0x5533('0x5a'))){_0x1ee522[_0x5533('0x21')]=qs[_0x5533('0x21')](_0x297b7[_0x5533('0x37')]['limit']);_0x1ee522[_0x5533('0x1f')]=qs['offset'](_0x297b7[_0x5533('0x37')]['offset']);}return _0x166050[_0x5533('0x63')](_0x1ee522);}})[_0x5533('0x27')](function(_0x1cdc0e){if(_0x1cdc0e){return _0x1cdc0e?{'count':_0x3c97aa,'rows':_0x1cdc0e}:null;}})[_0x5533('0x27')](respondWithResult(_0x3d31c0,null))['catch'](handleError(_0x3d31c0,null));};exports[_0x5533('0x64')]=function(_0x11981b,_0x2a4100,_0x196aa8){var _0x1e83ca=_0x11981b[_0x5533('0x4e')]['ids'];return db[_0x5533('0x62')][_0x5533('0x46')]({'where':{'id':_0x1e83ca},'attributes':['id'],'include':[{'model':db[_0x5533('0x65')],'as':_0x5533('0x66'),'attributes':['id',_0x5533('0x2d'),'online',_0x5533('0x67'),_0x5533('0x68')],'raw':!![]}]})[_0x5533('0x27')](function(_0x25a7f5){if(_0x25a7f5){var _0x5b7e66=_[_0x5533('0x69')](_0x25a7f5,function(_0x3dff4b){var _0x2e0553=_0x3dff4b[_0x5533('0x29')]({'plain':!![]});return _0x2e0553[_0x5533('0x66')];});return db[_0x5533('0x31')][_0x5533('0x4c')]({'where':{'id':_0x11981b[_0x5533('0x55')]['id']}})['then'](function(_0x5b9cb8){return db[_0x5533('0x6a')][_0x5533('0x6b')](function(_0x53ed9e){return _0x5b9cb8[_0x5533('0x64')](_0x1e83ca,{'transaction':_0x53ed9e})['then'](function(){return BPromise[_0x5533('0x6c')](_0x5b7e66,function(_0x568c89){return db[_0x5533('0x5c')][_0x5533('0x6d')]({'where':{'UserId':_0x568c89['id'],'WhatsappQueueId':_0x11981b[_0x5533('0x55')]['id']},'transaction':_0x53ed9e});});})[_0x5533('0x27')](function(){_0x5b7e66[_0x5533('0x6e')](function(_0x5c579c){socket[_0x5533('0x6f')](_0x5533('0x70'),{'UserId':_0x5c579c['id'],'WhatsappQueueId':_0x5b9cb8['id']});});});});});}})[_0x5533('0x27')](respondWithStatusCode(_0x2a4100,null))[_0x5533('0x48')](handleError(_0x2a4100,null));};exports[_0x5533('0x71')]=function(_0x1feb9f,_0x56aacf,_0x31622d){return db[_0x5533('0x62')][_0x5533('0x46')]({'where':{'id':_0x1feb9f['query'][_0x5533('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5533('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5533('0x27')](handleEntityNotFound(_0x56aacf,null))['then'](function(_0x39f53f){var _0x430b5d=_['map'](_0x39f53f,'id');var _0x1df79f=[];var _0x58cd6c=[];var _0x346c28=squel['select']();_0x346c28[_0x5533('0x73')](_0x5533('0x74'))[_0x5533('0x75')](_0x5533('0x76'),'tq')[_0x5533('0x77')](_0x5533('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5533('0x3f')]('WhatsappQueueId\x20=\x20?',_0x1feb9f[_0x5533('0x55')]['id']);for(var _0x11fcf0=0x0;_0x11fcf0<_0x39f53f['length'];_0x11fcf0+=0x1){let _0x5aa808=_0x39f53f[_0x11fcf0];for(var _0x4e120d=0x0;_0x4e120d<_0x5aa808[_0x5533('0x66')][_0x5533('0x59')];_0x4e120d+=0x1){let _0x43c59c=_0x5aa808[_0x5533('0x66')][_0x4e120d];var _0x5f1d66=_0x346c28['clone']();_0x5f1d66[_0x5533('0x3f')](_0x5533('0x79'),_0x43c59c['id']);_0x58cd6c[_0x5533('0x7a')](db[_0x5533('0x6a')][_0x5533('0x37')](_0x5f1d66[_0x5533('0x7b')](),{'type':db[_0x5533('0x6a')][_0x5533('0x7c')]['SELECT']})[_0x5533('0x27')](function(_0x45e248){if(_0x45e248['length']===0x1){return _0x43c59c['id'];}else{var _0x190381=_[_0x5533('0x7d')](_[_0x5533('0x30')](_0x45e248,_0x5533('0x7e')),function(_0x56a9a1){return _['includes'](_0x430b5d,_0x56a9a1);});if(_0x190381){return _0x43c59c['id'];}}}));}}return BPromise[_0x5533('0x7f')](_0x58cd6c)[_0x5533('0x27')](function(_0x526d9c){_0x1df79f=_(_0x1df79f)[_0x5533('0x80')](_0x526d9c)[_0x5533('0x81')]()[_0x5533('0x82')]();return db['WhatsappQueue'][_0x5533('0x4c')]({'where':{'id':_0x1feb9f['params']['id']}})[_0x5533('0x27')](function(_0x9cd875){return db[_0x5533('0x6a')]['transaction'](function(_0x645485){return _0x9cd875[_0x5533('0x71')](_0x1feb9f[_0x5533('0x37')][_0x5533('0x72')],{'transaction':_0x645485})[_0x5533('0x27')](function(){if(!_[_0x5533('0x83')](_0x1df79f)){return _0x9cd875[_0x5533('0x84')](_0x1df79f,{'transaction':_0x645485});}})[_0x5533('0x27')](function(){_0x1df79f[_0x5533('0x6e')](function(_0x397b88){socket['emit'](_0x5533('0x85'),{'UserId':_0x397b88,'WhatsappQueueId':_0x9cd875['id']});});});});});});})[_0x5533('0x27')](respondWithStatusCode(_0x56aacf,null))[_0x5533('0x48')](handleError(_0x56aacf,null));};exports[_0x5533('0x86')]=function(_0x38b19f,_0x258fbd,_0x5e1185){return db[_0x5533('0x31')][_0x5533('0x4c')]({'where':{'id':_0x38b19f[_0x5533('0x55')]['id']}})[_0x5533('0x27')](handleEntityNotFound(_0x258fbd,null))[_0x5533('0x27')](function(_0x38eb7e){if(_0x38eb7e){return _0x38eb7e['addAgents'](_0x38b19f[_0x5533('0x4e')][_0x5533('0x72')],_[_0x5533('0x87')](_0x38b19f[_0x5533('0x4e')],[_0x5533('0x72'),'id'])||{})[_0x5533('0x88')](function(_0x229f77){for(var _0x2e6f23=0x0;_0x2e6f23<_0x38b19f['body']['ids'][_0x5533('0x59')];_0x2e6f23+=0x1){socket[_0x5533('0x6f')](_0x5533('0x70'),{'UserId':Number(_0x38b19f[_0x5533('0x4e')][_0x5533('0x72')][_0x2e6f23]),'WhatsappQueueId':Number(_0x38b19f[_0x5533('0x55')]['id'])});}return _0x229f77;});}})['then'](respondWithResult(_0x258fbd,null))['catch'](handleError(_0x258fbd,null));};exports[_0x5533('0x84')]=function(_0x30478b,_0x5609d8,_0x4b5c70){return db[_0x5533('0x31')][_0x5533('0x4c')]({'where':{'id':_0x30478b[_0x5533('0x55')]['id']}})['then'](handleEntityNotFound(_0x5609d8,null))[_0x5533('0x27')](function(_0x2d9e52){if(_0x2d9e52){return _0x2d9e52[_0x5533('0x84')](_0x30478b[_0x5533('0x37')][_0x5533('0x72')])[_0x5533('0x27')](function(){if(_['isArray'](_0x30478b[_0x5533('0x37')][_0x5533('0x72')])){for(var _0x4a1847=0x0;_0x4a1847<_0x30478b['query'][_0x5533('0x72')][_0x5533('0x59')];_0x4a1847+=0x1){socket[_0x5533('0x6f')](_0x5533('0x85'),{'UserId':Number(_0x30478b[_0x5533('0x37')][_0x5533('0x72')][_0x4a1847]),'WhatsappQueueId':Number(_0x30478b[_0x5533('0x55')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x30478b[_0x5533('0x37')][_0x5533('0x72')]),'WhatsappQueueId':Number(_0x30478b[_0x5533('0x55')]['id'])});}});}})[_0x5533('0x27')](respondWithStatusCode(_0x5609d8,null))[_0x5533('0x48')](handleError(_0x5609d8,null));};exports[_0x5533('0x89')]=function(_0x35b1ed,_0x41da61,_0xafa46f){var _0xd2c287={};var _0xc0eeb6={};var _0x1fbb30;var _0xe178a6;return db[_0x5533('0x31')][_0x5533('0x58')]({'where':{'id':_0x35b1ed[_0x5533('0x55')]['id']}})[_0x5533('0x27')](handleEntityNotFound(_0x41da61,null))['then'](function(_0x5d91d1){if(_0x5d91d1){_0x1fbb30=_0x5d91d1;_0xc0eeb6[_0x5533('0x36')]=_[_0x5533('0x38')](db[_0x5533('0x65')][_0x5533('0x32')]);_0xc0eeb6[_0x5533('0x37')]=_[_0x5533('0x38')](_0x35b1ed[_0x5533('0x37')]);_0xc0eeb6[_0x5533('0x40')]=_[_0x5533('0x39')](_0xc0eeb6[_0x5533('0x36')],_0xc0eeb6['query']);_0xd2c287[_0x5533('0x3b')]=_[_0x5533('0x39')](_0xc0eeb6['model'],qs[_0x5533('0x3a')](_0x35b1ed[_0x5533('0x37')][_0x5533('0x3a')]));_0xd2c287[_0x5533('0x3b')]=_0xd2c287['attributes'][_0x5533('0x59')]?_0xd2c287[_0x5533('0x3b')]:_0xc0eeb6[_0x5533('0x36')];_0xd2c287[_0x5533('0x3d')]=qs[_0x5533('0x3e')](_0x35b1ed[_0x5533('0x37')][_0x5533('0x3e')]);_0xd2c287[_0x5533('0x3f')]=qs[_0x5533('0x40')](_[_0x5533('0x41')](_0x35b1ed[_0x5533('0x37')],_0xc0eeb6[_0x5533('0x40')]));if(_0x35b1ed[_0x5533('0x37')][_0x5533('0x42')]){_0xd2c287[_0x5533('0x3f')]=_[_0x5533('0x44')](_0xd2c287['where'],{'$or':_['map'](_0xd2c287[_0x5533('0x3b')],function(_0x2c6643){var _0x41f342={};_0x41f342[_0x2c6643]={'$like':'%'+_0x35b1ed[_0x5533('0x37')][_0x5533('0x42')]+'%'};return _0x41f342;})});}_0xd2c287=_[_0x5533('0x44')]({},_0xd2c287,_0x35b1ed[_0x5533('0x45')]);return _0x1fbb30[_0x5533('0x89')](_0xd2c287);}})[_0x5533('0x27')](function(_0x5a4f80){if(_0x5a4f80){_0xe178a6=_0x5a4f80[_0x5533('0x59')];if(!_0x35b1ed[_0x5533('0x37')][_0x5533('0x3c')](_0x5533('0x5a'))){_0xd2c287[_0x5533('0x21')]=qs['limit'](_0x35b1ed['query']['limit']);_0xd2c287[_0x5533('0x1f')]=qs[_0x5533('0x1f')](_0x35b1ed['query']['offset']);}return _0x1fbb30['getAgents'](_0xd2c287);}})['then'](function(_0x381bc5){if(_0x381bc5){return _0x381bc5?{'count':_0xe178a6,'rows':_0x381bc5}:null;}})[_0x5533('0x27')](respondWithResult(_0x41da61,null))[_0x5533('0x48')](handleError(_0x41da61,null));}; \ No newline at end of file +var _0x0639=['options','includeAll','WhatsappQueue','findAll','rows','catch','show','intersection','length','create','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserWhatsappQueue','fields','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','interface','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','get','WhatsappQueues','destroy','error','stack','name','index','map','rawAttributes','query','keys','filters','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0xbbd02f,_0x1df836){var _0x51caf6=function(_0x21e09a){while(--_0x21e09a){_0xbbd02f['push'](_0xbbd02f['shift']());}};_0x51caf6(++_0x1df836);}(_0x0639,0x162));var _0x9063=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x0639[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require(_0x9063('0x0'));var rimraf=require(_0x9063('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9063('0x2'));var rp=require(_0x9063('0x3'));var moment=require(_0x9063('0x4'));var BPromise=require(_0x9063('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9063('0x6'));var sox=require(_0x9063('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9063('0x8'));var _=require(_0x9063('0x9'));var squel=require(_0x9063('0xa'));var crypto=require(_0x9063('0xb'));var jsforce=require(_0x9063('0xc'));var deskjs=require(_0x9063('0xd'));var toCsv=require(_0x9063('0xe'));var querystring=require(_0x9063('0xf'));var Papa=require('papaparse');var Redis=require(_0x9063('0x10'));var authService=require(_0x9063('0x11'));var qs=require(_0x9063('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9063('0x13'));var logger=require(_0x9063('0x14'))(_0x9063('0x15'));var utils=require(_0x9063('0x16'));var config=require(_0x9063('0x17'));var licenseUtil=require(_0x9063('0x18'));var db=require('../../mysqldb')['db'];config[_0x9063('0x19')]=_[_0x9063('0x1a')](config[_0x9063('0x19')],{'host':_0x9063('0x1b'),'port':0x18eb});var socket=require(_0x9063('0x1c'))(new Redis(config[_0x9063('0x19')]));require(_0x9063('0x1d'))[_0x9063('0x1e')](socket);function respondWithStatusCode(_0x241b57,_0x1a2327){_0x1a2327=_0x1a2327||0xcc;return function(_0x268226){if(_0x268226){return _0x241b57[_0x9063('0x1f')](_0x1a2327);}return _0x241b57[_0x9063('0x20')](_0x1a2327)[_0x9063('0x21')]();};}function respondWithResult(_0x2e89e0,_0x20ffd2){_0x20ffd2=_0x20ffd2||0xc8;return function(_0x43fb8e){if(_0x43fb8e){return _0x2e89e0[_0x9063('0x20')](_0x20ffd2)[_0x9063('0x22')](_0x43fb8e);}};}function respondWithFilteredResult(_0x1416a6,_0x2abf2f){return function(_0x308760){if(_0x308760){var _0x35ce05=typeof _0x2abf2f['offset']===_0x9063('0x23')&&typeof _0x2abf2f[_0x9063('0x24')]===_0x9063('0x23');var _0x3d8de8=_0x308760['count'];var _0x3d31ef=_0x35ce05?0x0:_0x2abf2f[_0x9063('0x25')];var _0x1ea221=_0x35ce05?_0x308760[_0x9063('0x26')]:_0x2abf2f[_0x9063('0x25')]+_0x2abf2f[_0x9063('0x24')];var _0x5a0de6;if(_0x1ea221>=_0x3d8de8){_0x1ea221=_0x3d8de8;_0x5a0de6=0xc8;}else{_0x5a0de6=0xce;}_0x1416a6[_0x9063('0x20')](_0x5a0de6);return _0x1416a6[_0x9063('0x27')]('Content-Range',_0x3d31ef+'-'+_0x1ea221+'/'+_0x3d8de8)[_0x9063('0x22')](_0x308760);}return null;};}function patchUpdates(_0x4c4fad){return function(_0x401e40){try{jsonpatch[_0x9063('0x28')](_0x401e40,_0x4c4fad,!![]);}catch(_0x2580ed){return BPromise[_0x9063('0x29')](_0x2580ed);}return _0x401e40[_0x9063('0x2a')]();};}function saveUpdates(_0x1f64ac,_0x2de22b){return function(_0x2da432){if(_0x2da432){return _0x2da432[_0x9063('0x2b')](_0x1f64ac)[_0x9063('0x2c')](function(_0xcef758){return _0xcef758;});}return null;};}function removeEntity(_0x4dfdae,_0x2d33c7){return function(_0x2afb69){if(_0x2afb69){return _0x2afb69['destroy']()[_0x9063('0x2c')](function(){var _0x23a594=_0x2afb69[_0x9063('0x2d')]({'plain':!![]});var _0x2f091f=_0x9063('0x2e');return db['UserProfileResource'][_0x9063('0x2f')]({'where':{'type':_0x2f091f,'resourceId':_0x23a594['id']}})[_0x9063('0x2c')](function(){return _0x2afb69;});})[_0x9063('0x2c')](function(){_0x4dfdae[_0x9063('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f304a,_0x32f945){return function(_0x269905){if(!_0x269905){_0x1f304a['sendStatus'](0x194);}return _0x269905;};}function handleError(_0x552700,_0x2efc7b){_0x2efc7b=_0x2efc7b||0x1f4;return function(_0x18442a){logger[_0x9063('0x30')](_0x18442a[_0x9063('0x31')]);if(_0x18442a[_0x9063('0x32')]){delete _0x18442a['name'];}_0x552700['status'](_0x2efc7b)['send'](_0x18442a);};}exports[_0x9063('0x33')]=function(_0x530fe7,_0xcf1e8a){var _0x2e985b={},_0x4157ae={},_0x18258e={'count':0x0,'rows':[]};var _0x17b607=_[_0x9063('0x34')](db['WhatsappQueue'][_0x9063('0x35')],function(_0x2f9b97){return{'name':_0x2f9b97['fieldName'],'type':_0x2f9b97['type']['key']};});_0x4157ae['model']=_[_0x9063('0x34')](_0x17b607,_0x9063('0x32'));_0x4157ae[_0x9063('0x36')]=_[_0x9063('0x37')](_0x530fe7[_0x9063('0x36')]);_0x4157ae[_0x9063('0x38')]=_['intersection'](_0x4157ae[_0x9063('0x39')],_0x4157ae[_0x9063('0x36')]);_0x2e985b[_0x9063('0x3a')]=_['intersection'](_0x4157ae['model'],qs['fields'](_0x530fe7[_0x9063('0x36')]['fields']));_0x2e985b['attributes']=_0x2e985b[_0x9063('0x3a')]['length']?_0x2e985b['attributes']:_0x4157ae[_0x9063('0x39')];if(!_0x530fe7[_0x9063('0x36')][_0x9063('0x3b')](_0x9063('0x3c'))){_0x2e985b[_0x9063('0x24')]=qs[_0x9063('0x24')](_0x530fe7[_0x9063('0x36')][_0x9063('0x24')]);_0x2e985b[_0x9063('0x25')]=qs[_0x9063('0x25')](_0x530fe7[_0x9063('0x36')]['offset']);}_0x2e985b[_0x9063('0x3d')]=qs[_0x9063('0x3e')](_0x530fe7[_0x9063('0x36')]['sort']);_0x2e985b[_0x9063('0x3f')]=qs[_0x9063('0x38')](_[_0x9063('0x40')](_0x530fe7[_0x9063('0x36')],_0x4157ae[_0x9063('0x38')]),_0x17b607);if(_0x530fe7[_0x9063('0x36')][_0x9063('0x41')]){_0x2e985b[_0x9063('0x3f')]=_[_0x9063('0x42')](_0x2e985b[_0x9063('0x3f')],{'$or':_['map'](_0x17b607,function(_0x5a1062){if(_0x5a1062[_0x9063('0x43')]!==_0x9063('0x44')){var _0x130689={};_0x130689[_0x5a1062[_0x9063('0x32')]]={'$like':'%'+_0x530fe7[_0x9063('0x36')][_0x9063('0x41')]+'%'};return _0x130689;}})});}_0x2e985b=_[_0x9063('0x42')]({},_0x2e985b,_0x530fe7[_0x9063('0x45')]);var _0x5bb1e1={'where':_0x2e985b[_0x9063('0x3f')]};return db['WhatsappQueue'][_0x9063('0x26')](_0x5bb1e1)[_0x9063('0x2c')](function(_0x43b02e){_0x18258e[_0x9063('0x26')]=_0x43b02e;if(_0x530fe7[_0x9063('0x36')][_0x9063('0x46')]){_0x2e985b['include']=[{'all':!![]}];}return db[_0x9063('0x47')][_0x9063('0x48')](_0x2e985b);})[_0x9063('0x2c')](function(_0x207c7d){_0x18258e[_0x9063('0x49')]=_0x207c7d;return _0x18258e;})[_0x9063('0x2c')](respondWithFilteredResult(_0xcf1e8a,_0x2e985b))[_0x9063('0x4a')](handleError(_0xcf1e8a,null));};exports[_0x9063('0x4b')]=function(_0x24334d,_0x3966da){var _0x452aee={'raw':!![],'where':{'id':_0x24334d['params']['id']}},_0x30da80={};_0x30da80[_0x9063('0x39')]=_[_0x9063('0x37')](db[_0x9063('0x47')][_0x9063('0x35')]);_0x30da80[_0x9063('0x36')]=_[_0x9063('0x37')](_0x24334d[_0x9063('0x36')]);_0x30da80['filters']=_[_0x9063('0x4c')](_0x30da80[_0x9063('0x39')],_0x30da80[_0x9063('0x36')]);_0x452aee[_0x9063('0x3a')]=_[_0x9063('0x4c')](_0x30da80[_0x9063('0x39')],qs['fields'](_0x24334d['query']['fields']));_0x452aee[_0x9063('0x3a')]=_0x452aee[_0x9063('0x3a')][_0x9063('0x4d')]?_0x452aee[_0x9063('0x3a')]:_0x30da80[_0x9063('0x39')];if(_0x24334d[_0x9063('0x36')][_0x9063('0x46')]){_0x452aee['include']=[{'all':!![]}];}_0x452aee=_[_0x9063('0x42')]({},_0x452aee,_0x24334d[_0x9063('0x45')]);return db['WhatsappQueue']['find'](_0x452aee)[_0x9063('0x2c')](handleEntityNotFound(_0x3966da,null))['then'](respondWithResult(_0x3966da,null))[_0x9063('0x4a')](handleError(_0x3966da,null));};exports[_0x9063('0x4e')]=function(_0x13f732,_0x24ce1f){return db['WhatsappQueue']['create'](_0x13f732['body'],{})[_0x9063('0x2c')](function(_0x368a6e){var _0x1f3009=_0x13f732[_0x9063('0x4f')][_0x9063('0x2d')]({'plain':!![]});if(!_0x1f3009)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f3009['role']===_0x9063('0x4f')){var _0x22bc82=_0x368a6e[_0x9063('0x2d')]({'plain':!![]});var _0x20ebbe='WhatsappQueues';return db['UserProfileSection'][_0x9063('0x50')]({'where':{'name':_0x20ebbe,'userProfileId':_0x1f3009[_0x9063('0x51')]},'raw':!![]})[_0x9063('0x2c')](function(_0x4b573d){if(_0x4b573d&&_0x4b573d[_0x9063('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x22bc82[_0x9063('0x32')],'resourceId':_0x22bc82['id'],'type':_0x4b573d[_0x9063('0x32')],'sectionId':_0x4b573d['id']},{})[_0x9063('0x2c')](function(){return _0x368a6e;});}else{return _0x368a6e;}})[_0x9063('0x4a')](function(_0x2f8f43){logger[_0x9063('0x30')](_0x9063('0x53'),_0x2f8f43);throw _0x2f8f43;});}return _0x368a6e;})['then'](respondWithResult(_0x24ce1f,0xc9))[_0x9063('0x4a')](handleError(_0x24ce1f,null));};exports['update']=function(_0x36de45,_0x591010){if(_0x36de45[_0x9063('0x54')]['id']){delete _0x36de45['body']['id'];}return db[_0x9063('0x47')][_0x9063('0x50')]({'where':{'id':_0x36de45[_0x9063('0x55')]['id']}})[_0x9063('0x2c')](handleEntityNotFound(_0x591010,null))[_0x9063('0x2c')](saveUpdates(_0x36de45['body'],null))[_0x9063('0x2c')](respondWithResult(_0x591010,null))[_0x9063('0x4a')](handleError(_0x591010,null));};exports[_0x9063('0x2f')]=function(_0x1e8ff2,_0x237e52){return db['WhatsappQueue']['find']({'where':{'id':_0x1e8ff2[_0x9063('0x55')]['id']}})['then'](handleEntityNotFound(_0x237e52,null))['then'](removeEntity(_0x237e52,null))['catch'](handleError(_0x237e52,null));};exports[_0x9063('0x56')]=function(_0x46fb9f,_0x33c6c4){return db['WhatsappQueue'][_0x9063('0x56')]()[_0x9063('0x2c')](respondWithResult(_0x33c6c4,null))[_0x9063('0x4a')](handleError(_0x33c6c4,null));};exports[_0x9063('0x57')]=function(_0x46b02f,_0x1f2be7,_0x22e1c6){var _0x4fab6a={'raw':!![],'where':{}},_0x47bb27={},_0xc706e3;return db[_0x9063('0x47')][_0x9063('0x58')]({'where':{'id':_0x46b02f[_0x9063('0x55')]['id']}})[_0x9063('0x2c')](handleEntityNotFound(_0x1f2be7,null))[_0x9063('0x2c')](function(_0x5d5239){if(_0x5d5239){_0xc706e3=_0x5d5239[_0x9063('0x2d')]({'plain':!![]});_0x47bb27[_0x9063('0x39')]=_[_0x9063('0x37')](db[_0x9063('0x59')]['rawAttributes']);_0x47bb27[_0x9063('0x36')]=_[_0x9063('0x37')](_0x46b02f[_0x9063('0x36')]);_0x47bb27[_0x9063('0x38')]=_[_0x9063('0x4c')](_0x47bb27[_0x9063('0x39')],_0x47bb27[_0x9063('0x36')]);_0x4fab6a['attributes']=_[_0x9063('0x4c')](_0x47bb27[_0x9063('0x39')],qs[_0x9063('0x5a')](_0x46b02f[_0x9063('0x36')][_0x9063('0x5a')]));_0x4fab6a[_0x9063('0x3a')]=_0x4fab6a[_0x9063('0x3a')][_0x9063('0x4d')]?_0x4fab6a['attributes']:_0x47bb27[_0x9063('0x39')];if(!_0x46b02f[_0x9063('0x36')][_0x9063('0x3b')](_0x9063('0x3c'))){_0x4fab6a[_0x9063('0x24')]=qs['limit'](_0x46b02f[_0x9063('0x36')][_0x9063('0x24')]);_0x4fab6a[_0x9063('0x25')]=qs[_0x9063('0x25')](_0x46b02f['query'][_0x9063('0x25')]);}_0x4fab6a[_0x9063('0x3d')]=qs[_0x9063('0x3e')](_0x46b02f[_0x9063('0x36')]['sort']);_0x4fab6a[_0x9063('0x3f')]=qs['filters'](_['pick'](_0x46b02f['query'],_0x47bb27[_0x9063('0x38')]));_0x4fab6a[_0x9063('0x3f')][_0x9063('0x5b')]=_0x5d5239['id'];if(_0x46b02f[_0x9063('0x36')][_0x9063('0x41')]){_0x4fab6a['where']=_[_0x9063('0x42')](_0x4fab6a[_0x9063('0x3f')],{'$or':_['map'](_0x4fab6a[_0x9063('0x3a')],function(_0x17e3bd){var _0x26bca8={};_0x26bca8[_0x17e3bd]={'$like':'%'+_0x46b02f[_0x9063('0x36')][_0x9063('0x41')]+'%'};return _0x26bca8;})});}_0x4fab6a=_[_0x9063('0x42')]({},_0x4fab6a,_0x46b02f[_0x9063('0x45')]);return db[_0x9063('0x59')][_0x9063('0x48')](_0x4fab6a);}})['then'](function(_0x411695){if(_0x411695){return db['User'][_0x9063('0x5c')]({'where':{'id':_[_0x9063('0x34')](_0x411695,_0x9063('0x5d')),'role':_0x9063('0x5e')},'attributes':['id','name',_0x9063('0x5f'),'updatedAt','createdAt']});}})[_0x9063('0x2c')](function(_0xb14dad){if(_0xb14dad){return{'count':_0xb14dad[_0x9063('0x26')],'rows':_[_0x9063('0x34')](_0xb14dad[_0x9063('0x49')],function(_0x2dc122){return{'membername':_0x2dc122[_0x9063('0x32')],'UserId':_0x2dc122['id'],'queue_name':_0xc706e3['name'],'WhatsappQueueId':_0xc706e3['id'],'interface':util[_0x9063('0x60')](_0x9063('0x61'),_0x9063('0x62'),_0x2dc122['name']),'penalty':0x0,'paused':_0x2dc122[_0x9063('0x5f')],'createdAt':_0x2dc122[_0x9063('0x63')],'updatedAt':_0x2dc122[_0x9063('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9063('0x2c')](respondWithFilteredResult(_0x1f2be7,_0x4fab6a))[_0x9063('0x4a')](handleError(_0x1f2be7,null));};exports['getTeams']=function(_0x2e87b2,_0x2475ef,_0x53126d){var _0x5bba9b={};var _0x4ca6c9={};var _0xfdfd1;var _0x14d8d7;return db['WhatsappQueue']['findOne']({'where':{'id':_0x2e87b2[_0x9063('0x55')]['id']}})[_0x9063('0x2c')](handleEntityNotFound(_0x2475ef,null))[_0x9063('0x2c')](function(_0x337a47){if(_0x337a47){_0xfdfd1=_0x337a47;_0x4ca6c9[_0x9063('0x39')]=_['keys'](db[_0x9063('0x65')][_0x9063('0x35')]);_0x4ca6c9[_0x9063('0x36')]=_[_0x9063('0x37')](_0x2e87b2[_0x9063('0x36')]);_0x4ca6c9[_0x9063('0x38')]=_[_0x9063('0x4c')](_0x4ca6c9[_0x9063('0x39')],_0x4ca6c9['query']);_0x5bba9b[_0x9063('0x3a')]=_[_0x9063('0x4c')](_0x4ca6c9[_0x9063('0x39')],qs[_0x9063('0x5a')](_0x2e87b2[_0x9063('0x36')][_0x9063('0x5a')]));_0x5bba9b['attributes']=_0x5bba9b[_0x9063('0x3a')]['length']?_0x5bba9b['attributes']:_0x4ca6c9[_0x9063('0x39')];_0x5bba9b[_0x9063('0x3d')]=qs[_0x9063('0x3e')](_0x2e87b2[_0x9063('0x36')][_0x9063('0x3e')]);_0x5bba9b['where']=qs[_0x9063('0x38')](_[_0x9063('0x40')](_0x2e87b2[_0x9063('0x36')],_0x4ca6c9['filters']));if(_0x2e87b2[_0x9063('0x36')][_0x9063('0x41')]){_0x5bba9b[_0x9063('0x3f')]=_[_0x9063('0x42')](_0x5bba9b[_0x9063('0x3f')],{'$or':_[_0x9063('0x34')](_0x5bba9b[_0x9063('0x3a')],function(_0x16a708){var _0x2cdce5={};_0x2cdce5[_0x16a708]={'$like':'%'+_0x2e87b2['query']['filter']+'%'};return _0x2cdce5;})});}_0x5bba9b=_[_0x9063('0x42')]({},_0x5bba9b,_0x2e87b2[_0x9063('0x45')]);return _0xfdfd1['getTeams'](_0x5bba9b);}})['then'](function(_0x5e4402){if(_0x5e4402){_0x14d8d7=_0x5e4402['length'];if(!_0x2e87b2[_0x9063('0x36')]['hasOwnProperty'](_0x9063('0x3c'))){_0x5bba9b[_0x9063('0x24')]=qs[_0x9063('0x24')](_0x2e87b2['query'][_0x9063('0x24')]);_0x5bba9b[_0x9063('0x25')]=qs[_0x9063('0x25')](_0x2e87b2[_0x9063('0x36')]['offset']);}return _0xfdfd1[_0x9063('0x66')](_0x5bba9b);}})['then'](function(_0x201688){if(_0x201688){return _0x201688?{'count':_0x14d8d7,'rows':_0x201688}:null;}})[_0x9063('0x2c')](respondWithResult(_0x2475ef,null))[_0x9063('0x4a')](handleError(_0x2475ef,null));};exports[_0x9063('0x67')]=function(_0x12c5ba,_0x196c97,_0x3dc4f1){var _0x92b909=_0x12c5ba[_0x9063('0x54')][_0x9063('0x68')];return db['Team'][_0x9063('0x48')]({'where':{'id':_0x92b909},'attributes':['id'],'include':[{'model':db[_0x9063('0x69')],'as':_0x9063('0x6a'),'attributes':['id',_0x9063('0x32'),_0x9063('0x6b'),'voicePause',_0x9063('0x6c')],'raw':!![]}]})[_0x9063('0x2c')](function(_0x3d6058){if(_0x3d6058){var _0x2856fb=_['flatMap'](_0x3d6058,function(_0x4f3883){var _0x4fc76d=_0x4f3883[_0x9063('0x2d')]({'plain':!![]});return _0x4fc76d[_0x9063('0x6a')];});return db['WhatsappQueue'][_0x9063('0x50')]({'where':{'id':_0x12c5ba['params']['id']}})[_0x9063('0x2c')](function(_0xb9eb93){return db['sequelize'][_0x9063('0x6d')](function(_0x3593a0){return _0xb9eb93[_0x9063('0x67')](_0x92b909,{'transaction':_0x3593a0})[_0x9063('0x2c')](function(){return BPromise[_0x9063('0x6e')](_0x2856fb,function(_0x5ebbea){return db['UserWhatsappQueue'][_0x9063('0x6f')]({'where':{'UserId':_0x5ebbea['id'],'WhatsappQueueId':_0x12c5ba['params']['id']},'transaction':_0x3593a0});});})[_0x9063('0x2c')](function(){_0x2856fb[_0x9063('0x70')](function(_0x3bb531){socket['emit'](_0x9063('0x71'),{'UserId':_0x3bb531['id'],'WhatsappQueueId':_0xb9eb93['id']});});});});});}})[_0x9063('0x2c')](respondWithStatusCode(_0x196c97,null))[_0x9063('0x4a')](handleError(_0x196c97,null));};exports[_0x9063('0x72')]=function(_0x1dd8c6,_0x3c9295,_0x53ccbc){return db['Team'][_0x9063('0x48')]({'where':{'id':_0x1dd8c6['query'][_0x9063('0x68')]},'attributes':['id'],'include':[{'model':db[_0x9063('0x69')],'as':_0x9063('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x9063('0x2c')](handleEntityNotFound(_0x3c9295,null))[_0x9063('0x2c')](function(_0x20021d){var _0x3932cf=_[_0x9063('0x34')](_0x20021d,'id');var _0x5276e5=[];var _0x32d2e2=[];var _0x207617=squel[_0x9063('0x73')]();_0x207617[_0x9063('0x74')](_0x9063('0x75'))['from'](_0x9063('0x76'),'tq')[_0x9063('0x77')](_0x9063('0x78'),'ut',_0x9063('0x79'))[_0x9063('0x3f')](_0x9063('0x7a'),_0x1dd8c6[_0x9063('0x55')]['id']);for(var _0x17f47e=0x0;_0x17f47e<_0x20021d['length'];_0x17f47e+=0x1){let _0x39c0ff=_0x20021d[_0x17f47e];for(var _0x262968=0x0;_0x262968<_0x39c0ff[_0x9063('0x6a')][_0x9063('0x4d')];_0x262968+=0x1){let _0x53c024=_0x39c0ff[_0x9063('0x6a')][_0x262968];var _0x3e274e=_0x207617['clone']();_0x3e274e[_0x9063('0x3f')](_0x9063('0x7b'),_0x53c024['id']);_0x32d2e2['push'](db[_0x9063('0x7c')][_0x9063('0x36')](_0x3e274e['toString'](),{'type':db[_0x9063('0x7c')][_0x9063('0x7d')]['SELECT']})[_0x9063('0x2c')](function(_0x5d6935){if(_0x5d6935[_0x9063('0x4d')]===0x1){return _0x53c024['id'];}else{var _0x12c648=_[_0x9063('0x7e')](_[_0x9063('0x34')](_0x5d6935,_0x9063('0x7f')),function(_0x5ee134){return _[_0x9063('0x80')](_0x3932cf,_0x5ee134);});if(_0x12c648){return _0x53c024['id'];}}}));}}return BPromise[_0x9063('0x81')](_0x32d2e2)[_0x9063('0x2c')](function(_0x3bd5ac){_0x5276e5=_(_0x5276e5)[_0x9063('0x82')](_0x3bd5ac)['compact']()[_0x9063('0x83')]();return db['WhatsappQueue'][_0x9063('0x50')]({'where':{'id':_0x1dd8c6[_0x9063('0x55')]['id']}})[_0x9063('0x2c')](function(_0x289c36){return db['sequelize'][_0x9063('0x6d')](function(_0x155d7c){return _0x289c36[_0x9063('0x72')](_0x1dd8c6[_0x9063('0x36')][_0x9063('0x68')],{'transaction':_0x155d7c})[_0x9063('0x2c')](function(){if(!_[_0x9063('0x84')](_0x5276e5)){return _0x289c36[_0x9063('0x85')](_0x5276e5,{'transaction':_0x155d7c});}})['then'](function(){_0x5276e5[_0x9063('0x70')](function(_0x4cab02){socket['emit'](_0x9063('0x86'),{'UserId':_0x4cab02,'WhatsappQueueId':_0x289c36['id']});});});});});});})['then'](respondWithStatusCode(_0x3c9295,null))[_0x9063('0x4a')](handleError(_0x3c9295,null));};exports[_0x9063('0x87')]=function(_0x194a0d,_0x339da3,_0x582790){return db[_0x9063('0x47')]['find']({'where':{'id':_0x194a0d['params']['id']}})['then'](handleEntityNotFound(_0x339da3,null))[_0x9063('0x2c')](function(_0x3faa3a){if(_0x3faa3a){return _0x3faa3a[_0x9063('0x87')](_0x194a0d[_0x9063('0x54')][_0x9063('0x68')],_[_0x9063('0x88')](_0x194a0d['body'],[_0x9063('0x68'),'id'])||{})[_0x9063('0x89')](function(_0x3c388e){for(var _0x164c0f=0x0;_0x164c0f<_0x194a0d['body'][_0x9063('0x68')][_0x9063('0x4d')];_0x164c0f+=0x1){socket[_0x9063('0x8a')](_0x9063('0x71'),{'UserId':Number(_0x194a0d[_0x9063('0x54')][_0x9063('0x68')][_0x164c0f]),'WhatsappQueueId':Number(_0x194a0d[_0x9063('0x55')]['id'])});}return _0x3c388e;});}})[_0x9063('0x2c')](respondWithResult(_0x339da3,null))[_0x9063('0x4a')](handleError(_0x339da3,null));};exports['removeAgents']=function(_0x5d77fc,_0x4a2875,_0x57ee99){return db[_0x9063('0x47')][_0x9063('0x50')]({'where':{'id':_0x5d77fc['params']['id']}})[_0x9063('0x2c')](handleEntityNotFound(_0x4a2875,null))[_0x9063('0x2c')](function(_0x528175){if(_0x528175){return _0x528175['removeAgents'](_0x5d77fc[_0x9063('0x36')][_0x9063('0x68')])[_0x9063('0x2c')](function(){if(_[_0x9063('0x8b')](_0x5d77fc[_0x9063('0x36')]['ids'])){for(var _0x520328=0x0;_0x520328<_0x5d77fc[_0x9063('0x36')]['ids'][_0x9063('0x4d')];_0x520328+=0x1){socket[_0x9063('0x8a')](_0x9063('0x86'),{'UserId':Number(_0x5d77fc[_0x9063('0x36')]['ids'][_0x520328]),'WhatsappQueueId':Number(_0x5d77fc['params']['id'])});}}else{socket['emit'](_0x9063('0x86'),{'UserId':Number(_0x5d77fc['query'][_0x9063('0x68')]),'WhatsappQueueId':Number(_0x5d77fc[_0x9063('0x55')]['id'])});}});}})[_0x9063('0x2c')](respondWithStatusCode(_0x4a2875,null))['catch'](handleError(_0x4a2875,null));};exports[_0x9063('0x8c')]=function(_0xd883d7,_0x1ace80,_0x1633f5){var _0x54b230={};var _0x149893={};var _0x26c3c4;var _0x88bd9e;return db['WhatsappQueue']['findOne']({'where':{'id':_0xd883d7[_0x9063('0x55')]['id']}})['then'](handleEntityNotFound(_0x1ace80,null))[_0x9063('0x2c')](function(_0xcd18dd){if(_0xcd18dd){_0x26c3c4=_0xcd18dd;_0x149893['model']=_[_0x9063('0x37')](db[_0x9063('0x69')][_0x9063('0x35')]);_0x149893['query']=_[_0x9063('0x37')](_0xd883d7[_0x9063('0x36')]);_0x149893['filters']=_[_0x9063('0x4c')](_0x149893[_0x9063('0x39')],_0x149893[_0x9063('0x36')]);_0x54b230[_0x9063('0x3a')]=_[_0x9063('0x4c')](_0x149893[_0x9063('0x39')],qs[_0x9063('0x5a')](_0xd883d7[_0x9063('0x36')]['fields']));_0x54b230[_0x9063('0x3a')]=_0x54b230[_0x9063('0x3a')][_0x9063('0x4d')]?_0x54b230['attributes']:_0x149893[_0x9063('0x39')];_0x54b230[_0x9063('0x3d')]=qs['sort'](_0xd883d7[_0x9063('0x36')]['sort']);_0x54b230[_0x9063('0x3f')]=qs[_0x9063('0x38')](_['pick'](_0xd883d7[_0x9063('0x36')],_0x149893[_0x9063('0x38')]));if(_0xd883d7['query'][_0x9063('0x41')]){_0x54b230[_0x9063('0x3f')]=_[_0x9063('0x42')](_0x54b230['where'],{'$or':_[_0x9063('0x34')](_0x54b230[_0x9063('0x3a')],function(_0x56cb4c){var _0x102dc0={};_0x102dc0[_0x56cb4c]={'$like':'%'+_0xd883d7[_0x9063('0x36')][_0x9063('0x41')]+'%'};return _0x102dc0;})});}_0x54b230=_[_0x9063('0x42')]({},_0x54b230,_0xd883d7[_0x9063('0x45')]);return _0x26c3c4['getAgents'](_0x54b230);}})[_0x9063('0x2c')](function(_0x5aedf6){if(_0x5aedf6){_0x88bd9e=_0x5aedf6['length'];if(!_0xd883d7[_0x9063('0x36')]['hasOwnProperty']('nolimit')){_0x54b230[_0x9063('0x24')]=qs['limit'](_0xd883d7[_0x9063('0x36')][_0x9063('0x24')]);_0x54b230[_0x9063('0x25')]=qs['offset'](_0xd883d7[_0x9063('0x36')]['offset']);}return _0x26c3c4[_0x9063('0x8c')](_0x54b230);}})[_0x9063('0x2c')](function(_0x46efd6){if(_0x46efd6){return _0x46efd6?{'count':_0x88bd9e,'rows':_0x46efd6}:null;}})[_0x9063('0x2c')](respondWithResult(_0x1ace80,null))[_0x9063('0x4a')](handleError(_0x1ace80,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f6c8974..51c3990 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8012=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','save','update'];(function(_0x2a5058,_0x359803){var _0x929fde=function(_0x3dbb1a){while(--_0x3dbb1a){_0x2a5058['push'](_0x2a5058['shift']());}};_0x929fde(++_0x359803);}(_0x8012,0x95));var _0x2801=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8012[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x2801('0x0'))['db'][_0x2801('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2801('0x2'),'afterUpdate':_0x2801('0x3'),'afterDestroy':_0x2801('0x4')};function emitEvent(_0x563560){return function(_0x19b674,_0x1f6117,_0x4a3083){WhatsappQueueEvents['emit'](_0x563560+':'+_0x19b674['id'],_0x19b674);WhatsappQueueEvents[_0x2801('0x5')](_0x563560,_0x19b674);_0x4a3083(null);};}for(var e in events){if(events[_0x2801('0x6')](e)){var event=events[e];WhatsappQueue[_0x2801('0x7')](e,emitEvent(event));}}module[_0x2801('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbc33=['hasOwnProperty','hook','events','../../mysqldb','save','update','remove','emit'];(function(_0x496222,_0x148114){var _0x5bd66f=function(_0xaae1a7){while(--_0xaae1a7){_0x496222['push'](_0x496222['shift']());}};_0x5bd66f(++_0x148114);}(_0xbc33,0xd2));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3bc3('0x0'));var WhatsappQueue=require(_0x3bc3('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bc3('0x2'),'afterUpdate':_0x3bc3('0x3'),'afterDestroy':_0x3bc3('0x4')};function emitEvent(_0x473e74){return function(_0x272f6f,_0x5f1563,_0x23f5ca){WhatsappQueueEvents[_0x3bc3('0x5')](_0x473e74+':'+_0x272f6f['id'],_0x272f6f);WhatsappQueueEvents[_0x3bc3('0x5')](_0x473e74,_0x272f6f);_0x23f5ca(null);};}for(var e in events){if(events[_0x3bc3('0x6')](e)){var event=events[e];WhatsappQueue[_0x3bc3('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 2f5a9c3..ab1832e 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7673=['whatsapp_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x3751fe,_0x11d228){var _0xb3b1cd=function(_0x18e3fd){while(--_0x18e3fd){_0x3751fe['push'](_0x3751fe['shift']());}};_0xb3b1cd(++_0x11d228);}(_0x7673,0x85));var _0x3767=function(_0x517586,_0xc97d01){_0x517586=_0x517586-0x0;var _0x4d7494=_0x7673[_0x517586];return _0x4d7494;};'use strict';var _=require(_0x3767('0x0'));var util=require(_0x3767('0x1'));var logger=require(_0x3767('0x2'))('api');var moment=require(_0x3767('0x3'));var BPromise=require('bluebird');var rp=require(_0x3767('0x4'));var fs=require('fs');var path=require(_0x3767('0x5'));var rimraf=require(_0x3767('0x6'));var config=require('../../config/environment');var attributes=require(_0x3767('0x7'));module[_0x3767('0x8')]=function(_0x19cbf8,_0x3708e6){return _0x19cbf8[_0x3767('0x9')](_0x3767('0xa'),attributes,{'tableName':_0x3767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54c6=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x54c6,0x1ce));var _0x654c=function(_0x4eda88,_0x3cf42f){_0x4eda88=_0x4eda88-0x0;var _0xa891d3=_0x54c6[_0x4eda88];return _0xa891d3;};'use strict';var _=require(_0x654c('0x0'));var util=require(_0x654c('0x1'));var logger=require(_0x654c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x654c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x654c('0x4'));var rimraf=require(_0x654c('0x5'));var config=require(_0x654c('0x6'));var attributes=require(_0x654c('0x7'));module['exports']=function(_0x37d1f1,_0x57b145){return _0x37d1f1[_0x654c('0x8')](_0x654c('0x9'),attributes,{'tableName':_0x654c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 8c5decc..eb5665a 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1680=['./whatsappQueue.socket','register','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','WhatsappQueue,\x20%s,\x20%s','message','catch','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','then','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x4ba608,_0x23e5d1){var _0x3d1832=function(_0x25ed59){while(--_0x25ed59){_0x4ba608['push'](_0x4ba608['shift']());}};_0x3d1832(++_0x23e5d1);}(_0x1680,0x92));var _0x0168=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0x1680[_0x3e9ef3];return _0x333748;};'use strict';var _=require(_0x0168('0x0'));var util=require('util');var moment=require(_0x0168('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0168('0x2'));var db=require(_0x0168('0x3'))['db'];var utils=require(_0x0168('0x4'));var logger=require(_0x0168('0x5'))(_0x0168('0x6'));var config=require(_0x0168('0x7'));var jayson=require(_0x0168('0x8'));var client=jayson[_0x0168('0x9')]['http']({'port':0x232a});config[_0x0168('0xa')]=_[_0x0168('0xb')](config[_0x0168('0xa')],{'host':_0x0168('0xc'),'port':0x18eb});var socket=require(_0x0168('0xd'))(new Redis(config[_0x0168('0xa')]));require(_0x0168('0xe'))[_0x0168('0xf')](socket);function respondWithRpcPromise(_0x1a9b94,_0x46812d,_0x1512c6){return new BPromise(function(_0xc2fd8f,_0x2b7dae){return client[_0x0168('0x10')](_0x1a9b94,_0x1512c6)['then'](function(_0x13021d){logger[_0x0168('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x46812d,_0x0168('0x12'));logger[_0x0168('0x13')](_0x0168('0x14'),_0x46812d,_0x0168('0x12'),JSON['stringify'](_0x13021d));if(_0x13021d['error']){if(_0x13021d[_0x0168('0x15')]['code']===0x1f4){logger[_0x0168('0x15')](_0x0168('0x16'),_0x46812d,_0x13021d[_0x0168('0x15')][_0x0168('0x17')]);return _0x2b7dae(_0x13021d['error'][_0x0168('0x17')]);}logger[_0x0168('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x46812d,_0x13021d[_0x0168('0x15')][_0x0168('0x17')]);return _0xc2fd8f(_0x13021d[_0x0168('0x15')][_0x0168('0x17')]);}else{logger[_0x0168('0x11')](_0x0168('0x16'),_0x46812d,'request\x20sent');_0xc2fd8f(_0x13021d['result'][_0x0168('0x17')]);}})[_0x0168('0x18')](function(_0xc79f5e){logger['error'](_0x0168('0x16'),_0x46812d,_0xc79f5e);_0x2b7dae(_0xc79f5e);});});}exports['GetWhatsappQueue']=function(_0x3293de){var _0x1d8b07=this;return new Promise(function(_0x550882,_0x49c1bc){return db[_0x0168('0x19')][_0x0168('0x1a')]({'raw':_0x3293de[_0x0168('0x1b')]?_0x3293de['options']['raw']===undefined?!![]:![]:!![],'where':_0x3293de[_0x0168('0x1b')]?_0x3293de[_0x0168('0x1b')][_0x0168('0x1c')]||null:null,'attributes':_0x3293de[_0x0168('0x1b')]?_0x3293de[_0x0168('0x1b')][_0x0168('0x1d')]||null:null,'limit':_0x3293de[_0x0168('0x1b')]?_0x3293de[_0x0168('0x1b')][_0x0168('0x1e')]||null:null,'include':_0x3293de[_0x0168('0x1b')]?_0x3293de[_0x0168('0x1b')][_0x0168('0x1f')]?_[_0x0168('0x20')](_0x3293de[_0x0168('0x1b')]['include'],function(_0x42169e){return{'model':db[_0x42169e[_0x0168('0x21')]],'as':_0x42169e['as'],'attributes':_0x42169e[_0x0168('0x1d')],'include':_0x42169e[_0x0168('0x1f')]?_[_0x0168('0x20')](_0x42169e['include'],function(_0x889a7c){return{'model':db[_0x889a7c[_0x0168('0x21')]],'as':_0x889a7c['as'],'attributes':_0x889a7c[_0x0168('0x1d')],'include':_0x889a7c[_0x0168('0x1f')]?_[_0x0168('0x20')](_0x889a7c[_0x0168('0x1f')],function(_0xafad08){return{'model':db[_0xafad08[_0x0168('0x21')]],'as':_0xafad08['as'],'attributes':_0xafad08['attributes']};}):[]};}):[]};}):[]:[]})[_0x0168('0x22')](function(_0x23a08d){logger[_0x0168('0x11')](_0x0168('0x23'),_0x3293de);logger['debug'](_0x0168('0x23'),_0x3293de,JSON[_0x0168('0x24')](_0x23a08d));_0x550882(_0x23a08d);})[_0x0168('0x18')](function(_0x5b3b02){logger[_0x0168('0x15')](_0x0168('0x23'),_0x5b3b02[_0x0168('0x17')],_0x3293de);_0x49c1bc(_0x1d8b07[_0x0168('0x15')](0x1f4,_0x5b3b02[_0x0168('0x17')]));});});};exports[_0x0168('0x25')]=function(_0x1f4799){var _0x48652b=this;return new Promise(function(_0x5cd508,_0x200c2f){return db[_0x0168('0x19')][_0x0168('0x26')]({'raw':_0x1f4799['options']?_0x1f4799['options'][_0x0168('0x27')]===undefined?!![]:![]:!![],'where':_0x1f4799[_0x0168('0x1b')]?_0x1f4799['options'][_0x0168('0x1c')]||null:null,'attributes':_0x1f4799['options']?_0x1f4799[_0x0168('0x1b')]['attributes']||null:null,'include':_0x1f4799[_0x0168('0x1b')]?_0x1f4799[_0x0168('0x1b')][_0x0168('0x1f')]?_[_0x0168('0x20')](_0x1f4799[_0x0168('0x1b')][_0x0168('0x1f')],function(_0x10fa4b){return{'model':db[_0x10fa4b[_0x0168('0x21')]],'as':_0x10fa4b['as'],'attributes':_0x10fa4b['attributes'],'include':_0x10fa4b[_0x0168('0x1f')]?_[_0x0168('0x20')](_0x10fa4b[_0x0168('0x1f')],function(_0x473910){return{'model':db[_0x473910['model']],'as':_0x473910['as'],'attributes':_0x473910['attributes'],'include':_0x473910['include']?_[_0x0168('0x20')](_0x473910[_0x0168('0x1f')],function(_0x5439be){return{'model':db[_0x5439be[_0x0168('0x21')]],'as':_0x5439be['as'],'attributes':_0x5439be[_0x0168('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16c056){logger[_0x0168('0x11')]('ShowWhatsappQueue',_0x1f4799);logger[_0x0168('0x13')](_0x0168('0x25'),_0x1f4799,JSON['stringify'](_0x16c056));_0x5cd508(_0x16c056);})[_0x0168('0x18')](function(_0x3cfdd9){logger[_0x0168('0x15')](_0x0168('0x25'),_0x3cfdd9[_0x0168('0x17')],_0x1f4799);_0x200c2f(_0x48652b['error'](0x1f4,_0x3cfdd9[_0x0168('0x17')]));});});}; \ No newline at end of file +var _0xd291=['then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x5080dd,_0x2be00c){var _0x134bcf=function(_0x41f9ac){while(--_0x41f9ac){_0x5080dd['push'](_0x5080dd['shift']());}};_0x134bcf(++_0x2be00c);}(_0xd291,0x14f));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var moment=require(_0x1d29('0x2'));var BPromise=require(_0x1d29('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d29('0x4'))['db'];var utils=require(_0x1d29('0x5'));var logger=require('../../config/logger')(_0x1d29('0x6'));var config=require(_0x1d29('0x7'));var jayson=require(_0x1d29('0x8'));var client=jayson['client'][_0x1d29('0x9')]({'port':0x232a});config[_0x1d29('0xa')]=_[_0x1d29('0xb')](config[_0x1d29('0xa')],{'host':_0x1d29('0xc'),'port':0x18eb});var socket=require(_0x1d29('0xd'))(new Redis(config[_0x1d29('0xa')]));require('./whatsappQueue.socket')[_0x1d29('0xe')](socket);function respondWithRpcPromise(_0x479fc1,_0x1ea2af,_0x5277b1){return new BPromise(function(_0x48fd37,_0x2b16be){return client[_0x1d29('0xf')](_0x479fc1,_0x5277b1)[_0x1d29('0x10')](function(_0x522218){logger[_0x1d29('0x11')](_0x1d29('0x12'),_0x1ea2af,_0x1d29('0x13'));logger[_0x1d29('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1ea2af,'request\x20sent',JSON['stringify'](_0x522218));if(_0x522218['error']){if(_0x522218['error'][_0x1d29('0x15')]===0x1f4){logger[_0x1d29('0x16')](_0x1d29('0x12'),_0x1ea2af,_0x522218['error'][_0x1d29('0x17')]);return _0x2b16be(_0x522218['error'][_0x1d29('0x17')]);}logger[_0x1d29('0x16')](_0x1d29('0x12'),_0x1ea2af,_0x522218[_0x1d29('0x16')][_0x1d29('0x17')]);return _0x48fd37(_0x522218[_0x1d29('0x16')][_0x1d29('0x17')]);}else{logger[_0x1d29('0x11')](_0x1d29('0x12'),_0x1ea2af,'request\x20sent');_0x48fd37(_0x522218[_0x1d29('0x18')][_0x1d29('0x17')]);}})[_0x1d29('0x19')](function(_0x1bb944){logger[_0x1d29('0x16')](_0x1d29('0x12'),_0x1ea2af,_0x1bb944);_0x2b16be(_0x1bb944);});});}exports['GetWhatsappQueue']=function(_0x19ca2d){var _0x222d09=this;return new Promise(function(_0x399e97,_0x9475a2){return db['WhatsappQueue'][_0x1d29('0x1a')]({'raw':_0x19ca2d[_0x1d29('0x1b')]?_0x19ca2d[_0x1d29('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x19ca2d[_0x1d29('0x1b')]?_0x19ca2d[_0x1d29('0x1b')][_0x1d29('0x1c')]||null:null,'attributes':_0x19ca2d[_0x1d29('0x1b')]?_0x19ca2d[_0x1d29('0x1b')][_0x1d29('0x1d')]||null:null,'limit':_0x19ca2d[_0x1d29('0x1b')]?_0x19ca2d['options'][_0x1d29('0x1e')]||null:null,'include':_0x19ca2d[_0x1d29('0x1b')]?_0x19ca2d[_0x1d29('0x1b')][_0x1d29('0x1f')]?_[_0x1d29('0x20')](_0x19ca2d['options']['include'],function(_0x520714){return{'model':db[_0x520714[_0x1d29('0x21')]],'as':_0x520714['as'],'attributes':_0x520714['attributes'],'include':_0x520714[_0x1d29('0x1f')]?_['map'](_0x520714[_0x1d29('0x1f')],function(_0x40130e){return{'model':db[_0x40130e[_0x1d29('0x21')]],'as':_0x40130e['as'],'attributes':_0x40130e[_0x1d29('0x1d')],'include':_0x40130e[_0x1d29('0x1f')]?_[_0x1d29('0x20')](_0x40130e[_0x1d29('0x1f')],function(_0x4276bd){return{'model':db[_0x4276bd[_0x1d29('0x21')]],'as':_0x4276bd['as'],'attributes':_0x4276bd[_0x1d29('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d29('0x10')](function(_0x132d0b){logger['info'](_0x1d29('0x22'),_0x19ca2d);logger[_0x1d29('0x14')]('GetWhatsappQueue',_0x19ca2d,JSON['stringify'](_0x132d0b));_0x399e97(_0x132d0b);})[_0x1d29('0x19')](function(_0x1f732e){logger[_0x1d29('0x16')](_0x1d29('0x22'),_0x1f732e[_0x1d29('0x17')],_0x19ca2d);_0x9475a2(_0x222d09['error'](0x1f4,_0x1f732e[_0x1d29('0x17')]));});});};exports[_0x1d29('0x23')]=function(_0x245c67){var _0x521722=this;return new Promise(function(_0x5d6507,_0x9d6e94){return db[_0x1d29('0x24')][_0x1d29('0x25')]({'raw':_0x245c67['options']?_0x245c67[_0x1d29('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x245c67['options']?_0x245c67[_0x1d29('0x1b')][_0x1d29('0x1c')]||null:null,'attributes':_0x245c67[_0x1d29('0x1b')]?_0x245c67['options'][_0x1d29('0x1d')]||null:null,'include':_0x245c67[_0x1d29('0x1b')]?_0x245c67[_0x1d29('0x1b')][_0x1d29('0x1f')]?_[_0x1d29('0x20')](_0x245c67[_0x1d29('0x1b')][_0x1d29('0x1f')],function(_0x5d79c7){return{'model':db[_0x5d79c7['model']],'as':_0x5d79c7['as'],'attributes':_0x5d79c7[_0x1d29('0x1d')],'include':_0x5d79c7['include']?_['map'](_0x5d79c7[_0x1d29('0x1f')],function(_0x548ade){return{'model':db[_0x548ade['model']],'as':_0x548ade['as'],'attributes':_0x548ade[_0x1d29('0x1d')],'include':_0x548ade[_0x1d29('0x1f')]?_['map'](_0x548ade[_0x1d29('0x1f')],function(_0x27256c){return{'model':db[_0x27256c[_0x1d29('0x21')]],'as':_0x27256c['as'],'attributes':_0x27256c[_0x1d29('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d29('0x10')](function(_0x1712bf){logger['info']('ShowWhatsappQueue',_0x245c67);logger[_0x1d29('0x14')](_0x1d29('0x23'),_0x245c67,JSON[_0x1d29('0x26')](_0x1712bf));_0x5d6507(_0x1712bf);})[_0x1d29('0x19')](function(_0x5de461){logger[_0x1d29('0x16')](_0x1d29('0x23'),_0x5de461[_0x1d29('0x17')],_0x245c67);_0x9d6e94(_0x521722[_0x1d29('0x16')](0x1f4,_0x5de461['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e15e99f..439e84f 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb841=['./whatsappQueue.events','save','remove','update','removeListener','length'];(function(_0xd19be9,_0x28960a){var _0x278a45=function(_0x595fcd){while(--_0x595fcd){_0xd19be9['push'](_0xd19be9['shift']());}};_0x278a45(++_0x28960a);}(_0xb841,0x17a));var _0x1b84=function(_0x21f0f7,_0x2ef5b8){_0x21f0f7=_0x21f0f7-0x0;var _0x1cf410=_0xb841[_0x21f0f7];return _0x1cf410;};'use strict';var WhatsappQueueEvents=require(_0x1b84('0x0'));var events=[_0x1b84('0x1'),_0x1b84('0x2'),_0x1b84('0x3')];function createListener(_0x15e4ce,_0x4ee61c){return function(_0x4943f3){_0x4ee61c['emit'](_0x15e4ce,_0x4943f3);};}function removeListener(_0x1aaad9,_0x558430){return function(){WhatsappQueueEvents[_0x1b84('0x4')](_0x1aaad9,_0x558430);};}exports['register']=function(_0x45692f){for(var _0x51cc06=0x0,_0x447d0c=events[_0x1b84('0x5')];_0x51cc06<_0x447d0c;_0x51cc06++){var _0x564237=events[_0x51cc06];var _0x396d5f=createListener('whatsappQueue:'+_0x564237,_0x45692f);WhatsappQueueEvents['on'](_0x564237,_0x396d5f);}}; \ No newline at end of file +var _0xfbb5=['remove','emit','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfbb5,0xc9));var _0x5fbb=function(_0x2cd425,_0x4bb812){_0x2cd425=_0x2cd425-0x0;var _0x4ff711=_0xfbb5[_0x2cd425];return _0x4ff711;};'use strict';var WhatsappQueueEvents=require(_0x5fbb('0x0'));var events=[_0x5fbb('0x1'),_0x5fbb('0x2'),'update'];function createListener(_0xd3075d,_0x67a8b5){return function(_0x12ea6a){_0x67a8b5[_0x5fbb('0x3')](_0xd3075d,_0x12ea6a);};}function removeListener(_0x5182e8,_0x262e4d){return function(){WhatsappQueueEvents['removeListener'](_0x5182e8,_0x262e4d);};}exports[_0x5fbb('0x4')]=function(_0x4d4860){for(var _0x1ea6ae=0x0,_0x180544=events[_0x5fbb('0x5')];_0x1ea6ae<_0x180544;_0x1ea6ae++){var _0x5c2aa1=events[_0x1ea6ae];var _0x24507e=createListener(_0x5fbb('0x6')+_0x5c2aa1,_0x4d4860);WhatsappQueueEvents['on'](_0x5c2aa1,_0x24507e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 010d0e0..d633b6c 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f91=['put','update','destroy','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','/:id','isAuthenticated','post','create'];(function(_0x3432db,_0x2555d2){var _0x1c8809=function(_0x5c1325){while(--_0x5c1325){_0x3432db['push'](_0x3432db['shift']());}};_0x1c8809(++_0x2555d2);}(_0x4f91,0x123));var _0x14f9=function(_0x254651,_0x3dd3d7){_0x254651=_0x254651-0x0;var _0x2761da=_0x4f91[_0x254651];return _0x2761da;};'use strict';var multer=require('multer');var util=require(_0x14f9('0x0'));var path=require('path');var timeout=require(_0x14f9('0x1'));var express=require(_0x14f9('0x2'));var router=express['Router']();var fs_extra=require(_0x14f9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x14f9('0x4'));var config=require(_0x14f9('0x5'));var controller=require(_0x14f9('0x6'));router[_0x14f9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14f9('0x7')](_0x14f9('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x14f9('0x7')](_0x14f9('0x9'),auth[_0x14f9('0xa')](),controller['show']);router[_0x14f9('0xb')]('/',auth[_0x14f9('0xa')](),controller[_0x14f9('0xc')]);router[_0x14f9('0xd')](_0x14f9('0x9'),auth[_0x14f9('0xa')](),controller[_0x14f9('0xe')]);router['delete'](_0x14f9('0x9'),auth[_0x14f9('0xa')](),controller[_0x14f9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9bd5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe','/:id','create','put','update','delete','destroy','exports','util','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9bd5,0x6a));var _0x59bd=function(_0x31adfe,_0x35e451){_0x31adfe=_0x31adfe-0x0;var _0x186c87=_0x9bd5[_0x31adfe];return _0x186c87;};'use strict';var multer=require('multer');var util=require(_0x59bd('0x0'));var path=require(_0x59bd('0x1'));var timeout=require('connect-timeout');var express=require(_0x59bd('0x2'));var router=express[_0x59bd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x59bd('0x4'));var interaction=require(_0x59bd('0x5'));var config=require(_0x59bd('0x6'));var controller=require(_0x59bd('0x7'));router[_0x59bd('0x8')]('/',auth[_0x59bd('0x9')](),controller['index']);router[_0x59bd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x59bd('0xa')]);router[_0x59bd('0x8')](_0x59bd('0xb'),auth[_0x59bd('0x9')](),controller['show']);router['post']('/',auth[_0x59bd('0x9')](),controller[_0x59bd('0xc')]);router[_0x59bd('0xd')](_0x59bd('0xb'),auth['isAuthenticated'](),controller[_0x59bd('0xe')]);router[_0x59bd('0xf')](_0x59bd('0xb'),auth[_0x59bd('0x9')](),controller[_0x59bd('0x10')]);module[_0x59bd('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index af6f586..641f598 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x143536,_0x2278fe){var _0x40342c=function(_0x16492e){while(--_0x16492e){_0x143536['push'](_0x143536['shift']());}};_0x40342c(++_0x2278fe);}(_0x7a54,0x106));var _0x47a5=function(_0x2d8f39,_0x5b9f0b){_0x2d8f39=_0x2d8f39-0x0;var _0x580be4=_0x7a54[_0x2d8f39];return _0x580be4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x363937,_0x2a5cc1){var _0x5be24d=function(_0xdbe6c2){while(--_0xdbe6c2){_0x363937['push'](_0x363937['shift']());}};_0x5be24d(++_0x2a5cc1);}(_0x7a54,0x106));var _0x47a5=function(_0x4178bc,_0x61a48f){_0x4178bc=_0x4178bc-0x0;var _0x52590f=_0x7a54[_0x4178bc];return _0x52590f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index c97f859..98017fc 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef3=['offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappQueueReport','then','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x258257,_0x32042d){var _0xafb58a=function(_0x506b5a){while(--_0x506b5a){_0x258257['push'](_0x258257['shift']());}};_0xafb58a(++_0x32042d);}(_0xfef3,0x118));var _0x3fef=function(_0x26baa8,_0x1a199d){_0x26baa8=_0x26baa8-0x0;var _0x3a8ada=_0xfef3[_0x26baa8];return _0x3a8ada;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){_0x50025f[_0x3fef('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45464b,_0x2c0848){return function(_0x64d3e6){if(!_0x64d3e6){_0x45464b[_0x3fef('0x19')](0x194);}return _0x64d3e6;};}function handleError(_0x30e17a,_0x492ea0){_0x492ea0=_0x492ea0||0x1f4;return function(_0x4b4dee){logger['error'](_0x4b4dee[_0x3fef('0x28')]);if(_0x4b4dee[_0x3fef('0x29')]){delete _0x4b4dee['name'];}_0x30e17a[_0x3fef('0x20')](_0x492ea0)[_0x3fef('0x2a')](_0x4b4dee);};}exports['index']=function(_0x30a954,_0x3bdf03){var _0xf892bb={},_0x2b73fb={},_0x3a1a0a={'count':0x0,'rows':[]};var _0x137849=_[_0x3fef('0x2b')](db['WhatsappQueueReport'][_0x3fef('0x2c')],function(_0xc20ce5){return{'name':_0xc20ce5[_0x3fef('0x2d')],'type':_0xc20ce5[_0x3fef('0x2e')]['key']};});_0x2b73fb[_0x3fef('0x2f')]=_['map'](_0x137849,_0x3fef('0x29'));_0x2b73fb[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x30a954[_0x3fef('0x30')]);_0x2b73fb[_0x3fef('0x32')]=_[_0x3fef('0x33')](_0x2b73fb[_0x3fef('0x2f')],_0x2b73fb[_0x3fef('0x30')]);_0xf892bb[_0x3fef('0x34')]=_[_0x3fef('0x33')](_0x2b73fb['model'],qs['fields'](_0x30a954[_0x3fef('0x30')]['fields']));_0xf892bb[_0x3fef('0x34')]=_0xf892bb[_0x3fef('0x34')][_0x3fef('0x35')]?_0xf892bb[_0x3fef('0x34')]:_0x2b73fb[_0x3fef('0x2f')];if(!_0x30a954[_0x3fef('0x30')][_0x3fef('0x36')](_0x3fef('0x37'))){_0xf892bb[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x1d')]);_0xf892bb[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x30a954['query'][_0x3fef('0x1c')]);}_0xf892bb[_0x3fef('0x38')]=qs[_0x3fef('0x39')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x39')]);_0xf892bb[_0x3fef('0x3a')]=qs['filters'](_['pick'](_0x30a954[_0x3fef('0x30')],_0x2b73fb[_0x3fef('0x32')]),_0x137849);if(_0x30a954[_0x3fef('0x30')][_0x3fef('0x3b')]){_0xf892bb[_0x3fef('0x3a')]=_[_0x3fef('0x3c')](_0xf892bb[_0x3fef('0x3a')],{'$or':_[_0x3fef('0x2b')](_0x137849,function(_0x1fa70f){if(_0x1fa70f[_0x3fef('0x2e')]!==_0x3fef('0x3d')){var _0x560aae={};_0x560aae[_0x1fa70f[_0x3fef('0x29')]]={'$like':'%'+_0x30a954[_0x3fef('0x30')]['filter']+'%'};return _0x560aae;}})});}_0xf892bb=_['merge']({},_0xf892bb,_0x30a954[_0x3fef('0x3e')]);var _0x3dda68={'where':_0xf892bb[_0x3fef('0x3a')]};return db[_0x3fef('0x3f')][_0x3fef('0x1f')](_0x3dda68)[_0x3fef('0x40')](function(_0x17aff8){_0x3a1a0a[_0x3fef('0x1f')]=_0x17aff8;if(_0x30a954['query'][_0x3fef('0x41')]){_0xf892bb[_0x3fef('0x42')]=[{'all':!![]}];}return db[_0x3fef('0x3f')][_0x3fef('0x43')](_0xf892bb);})[_0x3fef('0x40')](function(_0x2143ec){_0x3a1a0a[_0x3fef('0x44')]=_0x2143ec;return _0x3a1a0a;})[_0x3fef('0x40')](respondWithFilteredResult(_0x3bdf03,_0xf892bb))[_0x3fef('0x45')](handleError(_0x3bdf03,null));};exports[_0x3fef('0x46')]=function(_0x12867c,_0x254880){var _0x2e1d7f={'raw':!![],'where':{'id':_0x12867c[_0x3fef('0x47')]['id']}},_0x15d2c7={};_0x15d2c7['model']=_[_0x3fef('0x31')](db[_0x3fef('0x3f')][_0x3fef('0x2c')]);_0x15d2c7[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x12867c[_0x3fef('0x30')]);_0x15d2c7['filters']=_[_0x3fef('0x33')](_0x15d2c7['model'],_0x15d2c7[_0x3fef('0x30')]);_0x2e1d7f[_0x3fef('0x34')]=_['intersection'](_0x15d2c7[_0x3fef('0x2f')],qs['fields'](_0x12867c[_0x3fef('0x30')][_0x3fef('0x48')]));_0x2e1d7f[_0x3fef('0x34')]=_0x2e1d7f[_0x3fef('0x34')][_0x3fef('0x35')]?_0x2e1d7f[_0x3fef('0x34')]:_0x15d2c7[_0x3fef('0x2f')];if(_0x12867c[_0x3fef('0x30')][_0x3fef('0x41')]){_0x2e1d7f[_0x3fef('0x42')]=[{'all':!![]}];}_0x2e1d7f=_[_0x3fef('0x3c')]({},_0x2e1d7f,_0x12867c[_0x3fef('0x3e')]);return db[_0x3fef('0x3f')]['find'](_0x2e1d7f)[_0x3fef('0x40')](handleEntityNotFound(_0x254880,null))[_0x3fef('0x40')](respondWithResult(_0x254880,null))['catch'](handleError(_0x254880,null));};exports[_0x3fef('0x49')]=function(_0x4210d6,_0x2f00c0){return db['WhatsappQueueReport'][_0x3fef('0x49')](_0x4210d6[_0x3fef('0x4a')],{})['then'](respondWithResult(_0x2f00c0,0xc9))[_0x3fef('0x45')](handleError(_0x2f00c0,null));};exports['update']=function(_0x48322c,_0x15fb2c){if(_0x48322c['body']['id']){delete _0x48322c[_0x3fef('0x4a')]['id'];}return db[_0x3fef('0x3f')]['find']({'where':{'id':_0x48322c[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x15fb2c,null))[_0x3fef('0x40')](saveUpdates(_0x48322c['body'],null))[_0x3fef('0x40')](respondWithResult(_0x15fb2c,null))[_0x3fef('0x45')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x27')]=function(_0x5b1acb,_0x324f70){return db[_0x3fef('0x3f')][_0x3fef('0x4b')]({'where':{'id':_0x5b1acb[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x324f70,null))['then'](removeEntity(_0x324f70,null))[_0x3fef('0x45')](handleError(_0x324f70,null));};exports[_0x3fef('0x4c')]=function(_0x39a4b1,_0x2b9275){return db[_0x3fef('0x3f')][_0x3fef('0x4c')]()[_0x3fef('0x40')](respondWithResult(_0x2b9275,null))[_0x3fef('0x45')](handleError(_0x2b9275,null));}; \ No newline at end of file +var _0x757a=['include','findAll','rows','show','params','WhatsappQueueReport','find','create','body','catch','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','end','sendStatus','error','stack','name','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x52fec6,_0x58e1bb){var _0x59391d=function(_0x4786d3){while(--_0x4786d3){_0x52fec6['push'](_0x52fec6['shift']());}};_0x59391d(++_0x58e1bb);}(_0x757a,0xde));var _0xa757=function(_0x22435c,_0x16a408){_0x22435c=_0x22435c-0x0;var _0x1f2987=_0x757a[_0x22435c];return _0x1f2987;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){_0x2ca10d['status'](0xcc)[_0xa757('0x1f')]();});}};}function handleEntityNotFound(_0x47903b,_0x40551d){return function(_0x3859ce){if(!_0x3859ce){_0x47903b[_0xa757('0x20')](0x194);}return _0x3859ce;};}function handleError(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0x1f4;return function(_0xcd98bd){logger[_0xa757('0x21')](_0xcd98bd[_0xa757('0x22')]);if(_0xcd98bd['name']){delete _0xcd98bd[_0xa757('0x23')];}_0x4d58a4['status'](_0x2b19d5)['send'](_0xcd98bd);};}exports['index']=function(_0x4f8de2,_0xfdf69d){var _0x596ae2={},_0x2208f9={},_0x3bc24c={'count':0x0,'rows':[]};var _0x55c5f8=_[_0xa757('0x24')](db['WhatsappQueueReport'][_0xa757('0x25')],function(_0xa6d0f6){return{'name':_0xa6d0f6['fieldName'],'type':_0xa6d0f6[_0xa757('0x26')]['key']};});_0x2208f9[_0xa757('0x27')]=_[_0xa757('0x24')](_0x55c5f8,_0xa757('0x23'));_0x2208f9[_0xa757('0x28')]=_[_0xa757('0x29')](_0x4f8de2[_0xa757('0x28')]);_0x2208f9[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x2208f9[_0xa757('0x27')],_0x2208f9[_0xa757('0x28')]);_0x596ae2[_0xa757('0x2c')]=_[_0xa757('0x2b')](_0x2208f9[_0xa757('0x27')],qs[_0xa757('0x2d')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x2d')]));_0x596ae2[_0xa757('0x2c')]=_0x596ae2[_0xa757('0x2c')][_0xa757('0x2e')]?_0x596ae2[_0xa757('0x2c')]:_0x2208f9[_0xa757('0x27')];if(!_0x4f8de2[_0xa757('0x28')][_0xa757('0x2f')](_0xa757('0x30'))){_0x596ae2['limit']=qs[_0xa757('0x1a')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x1a')]);_0x596ae2[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x4f8de2['query'][_0xa757('0x17')]);}_0x596ae2[_0xa757('0x31')]=qs[_0xa757('0x32')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x32')]);_0x596ae2[_0xa757('0x33')]=qs['filters'](_[_0xa757('0x34')](_0x4f8de2[_0xa757('0x28')],_0x2208f9[_0xa757('0x2a')]),_0x55c5f8);if(_0x4f8de2[_0xa757('0x28')][_0xa757('0x35')]){_0x596ae2[_0xa757('0x33')]=_[_0xa757('0x36')](_0x596ae2[_0xa757('0x33')],{'$or':_[_0xa757('0x24')](_0x55c5f8,function(_0x4f9d98){if(_0x4f9d98[_0xa757('0x26')]!==_0xa757('0x37')){var _0x9f73c6={};_0x9f73c6[_0x4f9d98[_0xa757('0x23')]]={'$like':'%'+_0x4f8de2[_0xa757('0x28')][_0xa757('0x35')]+'%'};return _0x9f73c6;}})});}_0x596ae2=_['merge']({},_0x596ae2,_0x4f8de2[_0xa757('0x38')]);var _0x6d77ed={'where':_0x596ae2['where']};return db['WhatsappQueueReport'][_0xa757('0x19')](_0x6d77ed)[_0xa757('0x1e')](function(_0x5b11fe){_0x3bc24c['count']=_0x5b11fe;if(_0x4f8de2[_0xa757('0x28')][_0xa757('0x39')]){_0x596ae2[_0xa757('0x3a')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xa757('0x3b')](_0x596ae2);})[_0xa757('0x1e')](function(_0x26802c){_0x3bc24c[_0xa757('0x3c')]=_0x26802c;return _0x3bc24c;})[_0xa757('0x1e')](respondWithFilteredResult(_0xfdf69d,_0x596ae2))['catch'](handleError(_0xfdf69d,null));};exports[_0xa757('0x3d')]=function(_0x52c728,_0x564d40){var _0x43329c={'raw':!![],'where':{'id':_0x52c728[_0xa757('0x3e')]['id']}},_0x57298b={};_0x57298b[_0xa757('0x27')]=_[_0xa757('0x29')](db['WhatsappQueueReport']['rawAttributes']);_0x57298b[_0xa757('0x28')]=_[_0xa757('0x29')](_0x52c728[_0xa757('0x28')]);_0x57298b[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x57298b[_0xa757('0x27')],_0x57298b['query']);_0x43329c[_0xa757('0x2c')]=_[_0xa757('0x2b')](_0x57298b['model'],qs[_0xa757('0x2d')](_0x52c728['query'][_0xa757('0x2d')]));_0x43329c[_0xa757('0x2c')]=_0x43329c['attributes'][_0xa757('0x2e')]?_0x43329c[_0xa757('0x2c')]:_0x57298b['model'];if(_0x52c728[_0xa757('0x28')][_0xa757('0x39')]){_0x43329c[_0xa757('0x3a')]=[{'all':!![]}];}_0x43329c=_[_0xa757('0x36')]({},_0x43329c,_0x52c728['options']);return db[_0xa757('0x3f')][_0xa757('0x40')](_0x43329c)[_0xa757('0x1e')](handleEntityNotFound(_0x564d40,null))[_0xa757('0x1e')](respondWithResult(_0x564d40,null))['catch'](handleError(_0x564d40,null));};exports[_0xa757('0x41')]=function(_0x5b6017,_0x50c131){return db[_0xa757('0x3f')][_0xa757('0x41')](_0x5b6017[_0xa757('0x42')],{})['then'](respondWithResult(_0x50c131,0xc9))[_0xa757('0x43')](handleError(_0x50c131,null));};exports['update']=function(_0x2ed63f,_0x151cc3){if(_0x2ed63f[_0xa757('0x42')]['id']){delete _0x2ed63f[_0xa757('0x42')]['id'];}return db[_0xa757('0x3f')][_0xa757('0x40')]({'where':{'id':_0x2ed63f[_0xa757('0x3e')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x151cc3,null))['then'](saveUpdates(_0x2ed63f[_0xa757('0x42')],null))[_0xa757('0x1e')](respondWithResult(_0x151cc3,null))[_0xa757('0x43')](handleError(_0x151cc3,null));};exports[_0xa757('0x44')]=function(_0x319988,_0x1f10cf){return db[_0xa757('0x3f')][_0xa757('0x40')]({'where':{'id':_0x319988[_0xa757('0x3e')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x1f10cf,null))[_0xa757('0x1e')](removeEntity(_0x1f10cf,null))[_0xa757('0x43')](handleError(_0x1f10cf,null));};exports[_0xa757('0x45')]=function(_0x354ad5,_0x388573){return db[_0xa757('0x3f')]['describe']()[_0xa757('0x1e')](respondWithResult(_0x388573,null))['catch'](handleError(_0x388573,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 57bc033..1d0b4af 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94ed=['bluebird','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x94ed,0x64));var _0xd94e=function(_0x48f683,_0xec583){_0x48f683=_0x48f683-0x0;var _0x13acce=_0x94ed[_0x48f683];return _0x13acce;};'use strict';var _=require('lodash');var util=require(_0xd94e('0x0'));var logger=require(_0xd94e('0x1'))(_0xd94e('0x2'));var moment=require(_0xd94e('0x3'));var BPromise=require(_0xd94e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd94e('0x5'));var rimraf=require(_0xd94e('0x6'));var config=require(_0xd94e('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0xd94e('0x8')]=function(_0x561820,_0x59e627){return _0x561820[_0xd94e('0x9')](_0xd94e('0xa'),attributes,{'tableName':_0xd94e('0xb'),'paranoid':![],'indexes':[{'name':_0xd94e('0xc'),'fields':[_0xd94e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39b6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x39b6,0x88));var _0x639b=function(_0x5f1722,_0x241691){_0x5f1722=_0x5f1722-0x0;var _0x1f4ce3=_0x39b6[_0x5f1722];return _0x1f4ce3;};'use strict';var _=require(_0x639b('0x0'));var util=require(_0x639b('0x1'));var logger=require(_0x639b('0x2'))(_0x639b('0x3'));var moment=require('moment');var BPromise=require(_0x639b('0x4'));var rp=require(_0x639b('0x5'));var fs=require('fs');var path=require(_0x639b('0x6'));var rimraf=require(_0x639b('0x7'));var config=require(_0x639b('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x639b('0x9')]=function(_0x198e74,_0x38947b){return _0x198e74[_0x639b('0xa')](_0x639b('0xb'),attributes,{'tableName':_0x639b('0xc'),'paranoid':![],'indexes':[{'name':_0x639b('0xd'),'fields':[_0x639b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index f96d4f3..c5fc216 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72d2=['raw','then','debug','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x72d2,0x13e));var _0x272d=function(_0x199b64,_0x5d1120){_0x199b64=_0x199b64-0x0;var _0x42b220=_0x72d2[_0x199b64];return _0x42b220;};'use strict';var _=require(_0x272d('0x0'));var util=require(_0x272d('0x1'));var moment=require(_0x272d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x272d('0x3'));var db=require(_0x272d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x272d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x272d('0x6'));var client=jayson[_0x272d('0x7')][_0x272d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30adec,_0x19bc79,_0x4278b2){return new BPromise(function(_0x388d37,_0x46e5b8){return client[_0x272d('0x9')](_0x30adec,_0x4278b2)['then'](function(_0x29b3f8){logger[_0x272d('0xa')](_0x272d('0xb'),_0x19bc79,'request\x20sent');logger['debug'](_0x272d('0xc'),_0x19bc79,'request\x20sent',JSON[_0x272d('0xd')](_0x29b3f8));if(_0x29b3f8[_0x272d('0xe')]){if(_0x29b3f8['error']['code']===0x1f4){logger[_0x272d('0xe')](_0x272d('0xb'),_0x19bc79,_0x29b3f8['error'][_0x272d('0xf')]);return _0x46e5b8(_0x29b3f8[_0x272d('0xe')][_0x272d('0xf')]);}logger[_0x272d('0xe')](_0x272d('0xb'),_0x19bc79,_0x29b3f8[_0x272d('0xe')][_0x272d('0xf')]);return _0x388d37(_0x29b3f8[_0x272d('0xe')]['message']);}else{logger[_0x272d('0xa')](_0x272d('0xb'),_0x19bc79,'request\x20sent');_0x388d37(_0x29b3f8[_0x272d('0x10')]['message']);}})[_0x272d('0x11')](function(_0x157dfb){logger[_0x272d('0xe')](_0x272d('0xb'),_0x19bc79,_0x157dfb);_0x46e5b8(_0x157dfb);});});}exports[_0x272d('0x12')]=function(_0x55d474){var _0x1e2d8c=this;return new Promise(function(_0x210d1d,_0x25eaf9){return db[_0x272d('0x13')][_0x272d('0x14')](_0x55d474[_0x272d('0x15')],{'raw':_0x55d474[_0x272d('0x16')]?_0x55d474[_0x272d('0x16')][_0x272d('0x17')]===undefined?!![]:![]:!![]})[_0x272d('0x18')](function(_0x10e5b1){logger[_0x272d('0xa')](_0x272d('0x12'),_0x55d474);logger[_0x272d('0x19')](_0x272d('0x12'),_0x55d474,JSON[_0x272d('0xd')](_0x10e5b1));_0x210d1d(_0x10e5b1);})[_0x272d('0x11')](function(_0x1b1d07){logger['error'](_0x272d('0x12'),_0x1b1d07[_0x272d('0xf')],_0x55d474);_0x25eaf9(_0x1e2d8c[_0x272d('0xe')](0x1f4,_0x1b1d07[_0x272d('0xf')]));});});};exports[_0x272d('0x1a')]=function(_0x511469){var _0x4c34c2=this;return new Promise(function(_0x3d7e34,_0x3e3267){return db[_0x272d('0x13')][_0x272d('0x1b')](_0x511469[_0x272d('0x15')],{'raw':_0x511469[_0x272d('0x16')]?_0x511469[_0x272d('0x16')][_0x272d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511469[_0x272d('0x16')]?_0x511469[_0x272d('0x16')][_0x272d('0x1c')]||null:null,'attributes':_0x511469[_0x272d('0x16')]?_0x511469[_0x272d('0x16')][_0x272d('0x1d')]||null:null,'limit':_0x511469['options']?_0x511469['options'][_0x272d('0x1e')]||null:null})[_0x272d('0x18')](function(_0x51a3cb){logger[_0x272d('0xa')](_0x272d('0x1a'),_0x511469);logger[_0x272d('0x19')](_0x272d('0x1a'),_0x511469,JSON[_0x272d('0xd')](_0x51a3cb));_0x3d7e34(_0x51a3cb);})[_0x272d('0x11')](function(_0x252c1a){logger[_0x272d('0xe')](_0x272d('0x1a'),_0x252c1a[_0x272d('0xf')],_0x511469);_0x3e3267(_0x4c34c2[_0x272d('0xe')](0x1f4,_0x252c1a[_0x272d('0xf')]));});});}; \ No newline at end of file +var _0x6a3a=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0x50f509,_0x16ebe8){var _0x532391=function(_0x248795){while(--_0x248795){_0x50f509['push'](_0x50f509['shift']());}};_0x532391(++_0x16ebe8);}(_0x6a3a,0x1ad));var _0xa6a3=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x6a3a[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xa6a3('0x0'));var util=require(_0xa6a3('0x1'));var moment=require(_0xa6a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6a3('0x3'));var fs=require('fs');var Redis=require(_0xa6a3('0x4'));var db=require(_0xa6a3('0x5'))['db'];var utils=require(_0xa6a3('0x6'));var logger=require(_0xa6a3('0x7'))(_0xa6a3('0x8'));var config=require(_0xa6a3('0x9'));var jayson=require(_0xa6a3('0xa'));var client=jayson[_0xa6a3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e5379,_0x14d42a,_0x3b1da0){return new BPromise(function(_0x5474a3,_0x48e2e6){return client['request'](_0x4e5379,_0x3b1da0)['then'](function(_0x4c1bba){logger[_0xa6a3('0xc')](_0xa6a3('0xd'),_0x14d42a,_0xa6a3('0xe'));logger[_0xa6a3('0xf')](_0xa6a3('0x10'),_0x14d42a,_0xa6a3('0xe'),JSON[_0xa6a3('0x11')](_0x4c1bba));if(_0x4c1bba[_0xa6a3('0x12')]){if(_0x4c1bba[_0xa6a3('0x12')][_0xa6a3('0x13')]===0x1f4){logger[_0xa6a3('0x12')](_0xa6a3('0xd'),_0x14d42a,_0x4c1bba[_0xa6a3('0x12')]['message']);return _0x48e2e6(_0x4c1bba[_0xa6a3('0x12')][_0xa6a3('0x14')]);}logger[_0xa6a3('0x12')](_0xa6a3('0xd'),_0x14d42a,_0x4c1bba[_0xa6a3('0x12')][_0xa6a3('0x14')]);return _0x5474a3(_0x4c1bba[_0xa6a3('0x12')][_0xa6a3('0x14')]);}else{logger[_0xa6a3('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x14d42a,_0xa6a3('0xe'));_0x5474a3(_0x4c1bba[_0xa6a3('0x15')][_0xa6a3('0x14')]);}})[_0xa6a3('0x16')](function(_0x91d8cb){logger[_0xa6a3('0x12')](_0xa6a3('0xd'),_0x14d42a,_0x91d8cb);_0x48e2e6(_0x91d8cb);});});}exports[_0xa6a3('0x17')]=function(_0x1b0d0f){var _0x1669ea=this;return new Promise(function(_0x30e99b,_0x18c72a){return db[_0xa6a3('0x18')][_0xa6a3('0x19')](_0x1b0d0f[_0xa6a3('0x1a')],{'raw':_0x1b0d0f[_0xa6a3('0x1b')]?_0x1b0d0f[_0xa6a3('0x1b')][_0xa6a3('0x1c')]===undefined?!![]:![]:!![]})[_0xa6a3('0x1d')](function(_0x5e9a63){logger['info'](_0xa6a3('0x17'),_0x1b0d0f);logger[_0xa6a3('0xf')](_0xa6a3('0x17'),_0x1b0d0f,JSON[_0xa6a3('0x11')](_0x5e9a63));_0x30e99b(_0x5e9a63);})[_0xa6a3('0x16')](function(_0x471a6a){logger['error'](_0xa6a3('0x17'),_0x471a6a[_0xa6a3('0x14')],_0x1b0d0f);_0x18c72a(_0x1669ea['error'](0x1f4,_0x471a6a[_0xa6a3('0x14')]));});});};exports[_0xa6a3('0x1e')]=function(_0x2454c8){var _0x21c08d=this;return new Promise(function(_0x1ae637,_0x1e66c3){return db[_0xa6a3('0x18')][_0xa6a3('0x1f')](_0x2454c8[_0xa6a3('0x1a')],{'raw':_0x2454c8[_0xa6a3('0x1b')]?_0x2454c8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2454c8[_0xa6a3('0x1b')]?_0x2454c8['options'][_0xa6a3('0x20')]||null:null,'attributes':_0x2454c8[_0xa6a3('0x1b')]?_0x2454c8[_0xa6a3('0x1b')]['attributes']||null:null,'limit':_0x2454c8[_0xa6a3('0x1b')]?_0x2454c8[_0xa6a3('0x1b')][_0xa6a3('0x21')]||null:null})['then'](function(_0x5c7d2f){logger[_0xa6a3('0xc')](_0xa6a3('0x1e'),_0x2454c8);logger[_0xa6a3('0xf')](_0xa6a3('0x1e'),_0x2454c8,JSON['stringify'](_0x5c7d2f));_0x1ae637(_0x5c7d2f);})['catch'](function(_0x4ec463){logger['error'](_0xa6a3('0x1e'),_0x4ec463['message'],_0x2454c8);_0x1e66c3(_0x21c08d[_0xa6a3('0x12')](0x1f4,_0x4ec463['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c8c608c..d10c45d 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4213=['post','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','isAuthenticated','describe','show'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x4213,0x1e9));var _0x3421=function(_0x4a5668,_0x2e74c0){_0x4a5668=_0x4a5668-0x0;var _0x1bb0dc=_0x4213[_0x4a5668];return _0x1bb0dc;};'use strict';var multer=require('multer');var util=require(_0x3421('0x0'));var path=require(_0x3421('0x1'));var timeout=require(_0x3421('0x2'));var express=require(_0x3421('0x3'));var router=express[_0x3421('0x4')]();var fs_extra=require(_0x3421('0x5'));var auth=require(_0x3421('0x6'));var interaction=require(_0x3421('0x7'));var config=require(_0x3421('0x8'));var controller=require(_0x3421('0x9'));router[_0x3421('0xa')]('/',auth['isAuthenticated'](),controller[_0x3421('0xb')]);router[_0x3421('0xa')]('/describe',auth[_0x3421('0xc')](),controller[_0x3421('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3421('0xe')]);router[_0x3421('0xf')]('/',auth[_0x3421('0xc')](),controller[_0x3421('0x10')]);router[_0x3421('0x11')](_0x3421('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x3421('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3421('0x14')]=router; \ No newline at end of file +var _0x433e=['isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x3f91ea,_0x34e600){var _0x3d281f=function(_0x4872d4){while(--_0x4872d4){_0x3f91ea['push'](_0x3f91ea['shift']());}};_0x3d281f(++_0x34e600);}(_0x433e,0x9a));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe433('0x0'));var util=require('util');var path=require(_0xe433('0x1'));var timeout=require(_0xe433('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe433('0x3'));var controller=require(_0xe433('0x4'));router[_0xe433('0x5')]('/',auth[_0xe433('0x6')](),controller[_0xe433('0x7')]);router[_0xe433('0x5')](_0xe433('0x8'),auth[_0xe433('0x6')](),controller['describe']);router[_0xe433('0x5')](_0xe433('0x9'),auth[_0xe433('0x6')](),controller['show']);router[_0xe433('0xa')]('/',auth[_0xe433('0x6')](),controller[_0xe433('0xb')]);router[_0xe433('0xc')]('/:id',auth[_0xe433('0x6')](),controller[_0xe433('0xd')]);router['delete'](_0xe433('0x9'),auth[_0xe433('0x6')](),controller[_0xe433('0xe')]);module[_0xe433('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 92d7d40..ea87ea5 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa846=['ENUM','account','agent','queue','exports','STRING'];(function(_0x33a68b,_0x9fda49){var _0x511999=function(_0x4be813){while(--_0x4be813){_0x33a68b['push'](_0x33a68b['shift']());}};_0x511999(++_0x9fda49);}(_0xa846,0x70));var _0x6a84=function(_0x1e7cb2,_0x32b96b){_0x1e7cb2=_0x1e7cb2-0x0;var _0x322704=_0xa846[_0x1e7cb2];return _0x322704;};'use strict';var Sequelize=require('sequelize');module[_0x6a84('0x0')]={'uniqueid':{'type':Sequelize[_0x6a84('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6a84('0x2')](_0x6a84('0x3'),_0x6a84('0x4'),_0x6a84('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x84a0=['sequelize','exports','STRING','ENUM','agent','queue'];(function(_0x18aa51,_0x5b7853){var _0x241ba8=function(_0x4e3fdd){while(--_0x4e3fdd){_0x18aa51['push'](_0x18aa51['shift']());}};_0x241ba8(++_0x5b7853);}(_0x84a0,0x66));var _0x084a=function(_0x14a54f,_0x252c00){_0x14a54f=_0x14a54f-0x0;var _0x244535=_0x84a0[_0x14a54f];return _0x244535;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'uniqueid':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x084a('0x3')]('account',_0x084a('0x4'),_0x084a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a9c5088..3816b71 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05a0=['update','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','error','name','index','map','WhatsappTransferReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x05a0,0x94));var _0x005a=function(_0x1fd1af,_0x20421d){_0x1fd1af=_0x1fd1af-0x0;var _0x1f34cf=_0x05a0[_0x1fd1af];return _0x1f34cf;};'use strict';var emlformat=require(_0x005a('0x0'));var rimraf=require(_0x005a('0x1'));var zipdir=require(_0x005a('0x2'));var jsonpatch=require(_0x005a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x005a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x005a('0x5'));var sox=require(_0x005a('0x6'));var csv=require(_0x005a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x005a('0x8'));var squel=require(_0x005a('0x9'));var crypto=require(_0x005a('0xa'));var jsforce=require(_0x005a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x005a('0x7'));var querystring=require('querystring');var Papa=require(_0x005a('0xc'));var Redis=require(_0x005a('0xd'));var authService=require(_0x005a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x005a('0xf'));var hardwareService=require(_0x005a('0x10'));var logger=require(_0x005a('0x11'))(_0x005a('0x12'));var utils=require(_0x005a('0x13'));var config=require(_0x005a('0x14'));var licenseUtil=require(_0x005a('0x15'));var db=require(_0x005a('0x16'))['db'];function respondWithStatusCode(_0x2d8c76,_0x217675){_0x217675=_0x217675||0xcc;return function(_0x4c87e5){if(_0x4c87e5){return _0x2d8c76[_0x005a('0x17')](_0x217675);}return _0x2d8c76[_0x005a('0x18')](_0x217675)['end']();};}function respondWithResult(_0x48f4cc,_0x57bf40){_0x57bf40=_0x57bf40||0xc8;return function(_0x4b0f5f){if(_0x4b0f5f){return _0x48f4cc['status'](_0x57bf40)[_0x005a('0x19')](_0x4b0f5f);}};}function respondWithFilteredResult(_0x10e312,_0x4ccfe0){return function(_0x108886){if(_0x108886){var _0x53ef60=typeof _0x4ccfe0['offset']===_0x005a('0x1a')&&typeof _0x4ccfe0['limit']===_0x005a('0x1a');var _0x469bbf=_0x108886[_0x005a('0x1b')];var _0x58f16f=_0x53ef60?0x0:_0x4ccfe0[_0x005a('0x1c')];var _0xe89a1f=_0x53ef60?_0x108886['count']:_0x4ccfe0[_0x005a('0x1c')]+_0x4ccfe0[_0x005a('0x1d')];var _0x1db252;if(_0xe89a1f>=_0x469bbf){_0xe89a1f=_0x469bbf;_0x1db252=0xc8;}else{_0x1db252=0xce;}_0x10e312[_0x005a('0x18')](_0x1db252);return _0x10e312[_0x005a('0x1e')](_0x005a('0x1f'),_0x58f16f+'-'+_0xe89a1f+'/'+_0x469bbf)[_0x005a('0x19')](_0x108886);}return null;};}function patchUpdates(_0x3a681f){return function(_0x494d93){try{jsonpatch[_0x005a('0x20')](_0x494d93,_0x3a681f,!![]);}catch(_0x5ec324){return BPromise[_0x005a('0x21')](_0x5ec324);}return _0x494d93['save']();};}function saveUpdates(_0x16a2ef,_0x56cccc){return function(_0x322832){if(_0x322832){return _0x322832['update'](_0x16a2ef)[_0x005a('0x22')](function(_0x45ec1f){return _0x45ec1f;});}return null;};}function removeEntity(_0x52684a,_0x5734e7){return function(_0x56e2c8){if(_0x56e2c8){return _0x56e2c8['destroy']()['then'](function(){_0x52684a[_0x005a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188f76,_0x4a5174){return function(_0x40f032){if(!_0x40f032){_0x188f76[_0x005a('0x17')](0x194);}return _0x40f032;};}function handleError(_0x2f4a9f,_0x54f404){_0x54f404=_0x54f404||0x1f4;return function(_0x2b9a17){logger[_0x005a('0x23')](_0x2b9a17['stack']);if(_0x2b9a17[_0x005a('0x24')]){delete _0x2b9a17[_0x005a('0x24')];}_0x2f4a9f['status'](_0x54f404)['send'](_0x2b9a17);};}exports[_0x005a('0x25')]=function(_0x3491c6,_0x2ecbc7){var _0x45b28b={},_0x3ceb0f={},_0x4730b7={'count':0x0,'rows':[]};var _0x13ab04=_[_0x005a('0x26')](db[_0x005a('0x27')][_0x005a('0x28')],function(_0x2fa971){return{'name':_0x2fa971['fieldName'],'type':_0x2fa971[_0x005a('0x29')]['key']};});_0x3ceb0f[_0x005a('0x2a')]=_[_0x005a('0x26')](_0x13ab04,'name');_0x3ceb0f[_0x005a('0x2b')]=_[_0x005a('0x2c')](_0x3491c6['query']);_0x3ceb0f['filters']=_['intersection'](_0x3ceb0f[_0x005a('0x2a')],_0x3ceb0f[_0x005a('0x2b')]);_0x45b28b['attributes']=_[_0x005a('0x2d')](_0x3ceb0f[_0x005a('0x2a')],qs[_0x005a('0x2e')](_0x3491c6[_0x005a('0x2b')]['fields']));_0x45b28b[_0x005a('0x2f')]=_0x45b28b[_0x005a('0x2f')][_0x005a('0x30')]?_0x45b28b[_0x005a('0x2f')]:_0x3ceb0f[_0x005a('0x2a')];if(!_0x3491c6['query']['hasOwnProperty'](_0x005a('0x31'))){_0x45b28b[_0x005a('0x1d')]=qs['limit'](_0x3491c6[_0x005a('0x2b')][_0x005a('0x1d')]);_0x45b28b[_0x005a('0x1c')]=qs[_0x005a('0x1c')](_0x3491c6['query'][_0x005a('0x1c')]);}_0x45b28b[_0x005a('0x32')]=qs['sort'](_0x3491c6[_0x005a('0x2b')][_0x005a('0x33')]);_0x45b28b['where']=qs[_0x005a('0x34')](_[_0x005a('0x35')](_0x3491c6[_0x005a('0x2b')],_0x3ceb0f[_0x005a('0x34')]),_0x13ab04);if(_0x3491c6['query'][_0x005a('0x36')]){_0x45b28b[_0x005a('0x37')]=_[_0x005a('0x38')](_0x45b28b['where'],{'$or':_[_0x005a('0x26')](_0x13ab04,function(_0x5afcff){if(_0x5afcff['type']!==_0x005a('0x39')){var _0x267b02={};_0x267b02[_0x5afcff[_0x005a('0x24')]]={'$like':'%'+_0x3491c6[_0x005a('0x2b')][_0x005a('0x36')]+'%'};return _0x267b02;}})});}_0x45b28b=_['merge']({},_0x45b28b,_0x3491c6[_0x005a('0x3a')]);var _0x5566db={'where':_0x45b28b[_0x005a('0x37')]};return db[_0x005a('0x27')][_0x005a('0x1b')](_0x5566db)[_0x005a('0x22')](function(_0x1d8bfc){_0x4730b7[_0x005a('0x1b')]=_0x1d8bfc;if(_0x3491c6[_0x005a('0x2b')][_0x005a('0x3b')]){_0x45b28b['include']=[{'all':!![]}];}return db[_0x005a('0x27')][_0x005a('0x3c')](_0x45b28b);})['then'](function(_0x2d11e4){_0x4730b7[_0x005a('0x3d')]=_0x2d11e4;return _0x4730b7;})['then'](respondWithFilteredResult(_0x2ecbc7,_0x45b28b))[_0x005a('0x3e')](handleError(_0x2ecbc7,null));};exports[_0x005a('0x3f')]=function(_0x3c10bc,_0x30cd94){var _0x22dbe4={'raw':!![],'where':{'id':_0x3c10bc['params']['id']}},_0x40e3c8={};_0x40e3c8[_0x005a('0x2a')]=_[_0x005a('0x2c')](db['WhatsappTransferReport'][_0x005a('0x28')]);_0x40e3c8[_0x005a('0x2b')]=_[_0x005a('0x2c')](_0x3c10bc[_0x005a('0x2b')]);_0x40e3c8['filters']=_[_0x005a('0x2d')](_0x40e3c8['model'],_0x40e3c8[_0x005a('0x2b')]);_0x22dbe4[_0x005a('0x2f')]=_[_0x005a('0x2d')](_0x40e3c8[_0x005a('0x2a')],qs[_0x005a('0x2e')](_0x3c10bc[_0x005a('0x2b')][_0x005a('0x2e')]));_0x22dbe4['attributes']=_0x22dbe4['attributes']['length']?_0x22dbe4[_0x005a('0x2f')]:_0x40e3c8[_0x005a('0x2a')];if(_0x3c10bc[_0x005a('0x2b')][_0x005a('0x3b')]){_0x22dbe4[_0x005a('0x40')]=[{'all':!![]}];}_0x22dbe4=_[_0x005a('0x38')]({},_0x22dbe4,_0x3c10bc['options']);return db['WhatsappTransferReport'][_0x005a('0x41')](_0x22dbe4)[_0x005a('0x22')](handleEntityNotFound(_0x30cd94,null))[_0x005a('0x22')](respondWithResult(_0x30cd94,null))['catch'](handleError(_0x30cd94,null));};exports[_0x005a('0x42')]=function(_0x444c0f,_0x225e59){return db[_0x005a('0x27')][_0x005a('0x42')](_0x444c0f[_0x005a('0x43')],{})['then'](respondWithResult(_0x225e59,0xc9))[_0x005a('0x3e')](handleError(_0x225e59,null));};exports[_0x005a('0x44')]=function(_0x1767e1,_0x229fca){if(_0x1767e1[_0x005a('0x43')]['id']){delete _0x1767e1[_0x005a('0x43')]['id'];}return db[_0x005a('0x27')]['find']({'where':{'id':_0x1767e1[_0x005a('0x45')]['id']}})['then'](handleEntityNotFound(_0x229fca,null))[_0x005a('0x22')](saveUpdates(_0x1767e1['body'],null))[_0x005a('0x22')](respondWithResult(_0x229fca,null))[_0x005a('0x3e')](handleError(_0x229fca,null));};exports[_0x005a('0x46')]=function(_0x2970a1,_0x40f4f1){return db[_0x005a('0x27')][_0x005a('0x41')]({'where':{'id':_0x2970a1[_0x005a('0x45')]['id']}})['then'](handleEntityNotFound(_0x40f4f1,null))['then'](removeEntity(_0x40f4f1,null))['catch'](handleError(_0x40f4f1,null));};exports[_0x005a('0x47')]=function(_0x14a662,_0x28e1a7){return db[_0x005a('0x27')][_0x005a('0x47')]()[_0x005a('0x22')](respondWithResult(_0x28e1a7,null))['catch'](handleError(_0x28e1a7,null));}; \ No newline at end of file +var _0x3906=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3b356a,_0x4d0d8c){var _0x1b8a92=function(_0x3d7d90){while(--_0x3d7d90){_0x3b356a['push'](_0x3b356a['shift']());}};_0x1b8a92(++_0x4d0d8c);}(_0x3906,0xd6));var _0x6390=function(_0x3be5c0,_0x52f522){_0x3be5c0=_0x3be5c0-0x0;var _0x45b6=_0x3906[_0x3be5c0];return _0x45b6;};'use strict';var emlformat=require(_0x6390('0x0'));var rimraf=require(_0x6390('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6390('0x2'));var rp=require('request-promise');var moment=require(_0x6390('0x3'));var BPromise=require(_0x6390('0x4'));var Mustache=require('mustache');var util=require(_0x6390('0x5'));var path=require(_0x6390('0x6'));var sox=require(_0x6390('0x7'));var csv=require(_0x6390('0x8'));var ejs=require(_0x6390('0x9'));var fs=require('fs');var fs_extra=require(_0x6390('0xa'));var _=require(_0x6390('0xb'));var squel=require(_0x6390('0xc'));var crypto=require(_0x6390('0xd'));var jsforce=require(_0x6390('0xe'));var deskjs=require(_0x6390('0xf'));var toCsv=require(_0x6390('0x8'));var querystring=require('querystring');var Papa=require(_0x6390('0x10'));var Redis=require('ioredis');var authService=require(_0x6390('0x11'));var qs=require(_0x6390('0x12'));var as=require(_0x6390('0x13'));var hardwareService=require(_0x6390('0x14'));var logger=require(_0x6390('0x15'))(_0x6390('0x16'));var utils=require('../../config/utils');var config=require(_0x6390('0x17'));var licenseUtil=require(_0x6390('0x18'));var db=require(_0x6390('0x19'))['db'];function respondWithStatusCode(_0x269082,_0x27e951){_0x27e951=_0x27e951||0xcc;return function(_0x13edb2){if(_0x13edb2){return _0x269082[_0x6390('0x1a')](_0x27e951);}return _0x269082[_0x6390('0x1b')](_0x27e951)[_0x6390('0x1c')]();};}function respondWithResult(_0x4b509b,_0x3cffa2){_0x3cffa2=_0x3cffa2||0xc8;return function(_0x6bdb26){if(_0x6bdb26){return _0x4b509b[_0x6390('0x1b')](_0x3cffa2)[_0x6390('0x1d')](_0x6bdb26);}};}function respondWithFilteredResult(_0x370ca9,_0xe1af17){return function(_0x6f76f6){if(_0x6f76f6){var _0x3d4a91=typeof _0xe1af17[_0x6390('0x1e')]===_0x6390('0x1f')&&typeof _0xe1af17['limit']==='undefined';var _0x2a75a9=_0x6f76f6[_0x6390('0x20')];var _0x25e5ef=_0x3d4a91?0x0:_0xe1af17[_0x6390('0x1e')];var _0x29fd60=_0x3d4a91?_0x6f76f6['count']:_0xe1af17[_0x6390('0x1e')]+_0xe1af17[_0x6390('0x21')];var _0x176589;if(_0x29fd60>=_0x2a75a9){_0x29fd60=_0x2a75a9;_0x176589=0xc8;}else{_0x176589=0xce;}_0x370ca9[_0x6390('0x1b')](_0x176589);return _0x370ca9[_0x6390('0x22')](_0x6390('0x23'),_0x25e5ef+'-'+_0x29fd60+'/'+_0x2a75a9)[_0x6390('0x1d')](_0x6f76f6);}return null;};}function patchUpdates(_0x31de0a){return function(_0x1fbfd5){try{jsonpatch[_0x6390('0x24')](_0x1fbfd5,_0x31de0a,!![]);}catch(_0x5c0b71){return BPromise['reject'](_0x5c0b71);}return _0x1fbfd5['save']();};}function saveUpdates(_0x249003,_0x56f5ca){return function(_0x248575){if(_0x248575){return _0x248575[_0x6390('0x25')](_0x249003)[_0x6390('0x26')](function(_0x4fb676){return _0x4fb676;});}return null;};}function removeEntity(_0x57bf8d,_0x4a29c6){return function(_0x5529d0){if(_0x5529d0){return _0x5529d0['destroy']()[_0x6390('0x26')](function(){_0x57bf8d[_0x6390('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe73b,_0x39f5f1){return function(_0x34391c){if(!_0x34391c){_0x4fe73b['sendStatus'](0x194);}return _0x34391c;};}function handleError(_0x204b26,_0x4ae72b){_0x4ae72b=_0x4ae72b||0x1f4;return function(_0x55e6b2){logger[_0x6390('0x27')](_0x55e6b2[_0x6390('0x28')]);if(_0x55e6b2[_0x6390('0x29')]){delete _0x55e6b2[_0x6390('0x29')];}_0x204b26['status'](_0x4ae72b)['send'](_0x55e6b2);};}exports[_0x6390('0x2a')]=function(_0x25779b,_0x11df33){var _0x47572f={},_0x5f154a={},_0x27a174={'count':0x0,'rows':[]};var _0x3cc7cb=_[_0x6390('0x2b')](db[_0x6390('0x2c')][_0x6390('0x2d')],function(_0x496d3a){return{'name':_0x496d3a['fieldName'],'type':_0x496d3a[_0x6390('0x2e')][_0x6390('0x2f')]};});_0x5f154a['model']=_[_0x6390('0x2b')](_0x3cc7cb,_0x6390('0x29'));_0x5f154a[_0x6390('0x30')]=_['keys'](_0x25779b[_0x6390('0x30')]);_0x5f154a['filters']=_[_0x6390('0x31')](_0x5f154a[_0x6390('0x32')],_0x5f154a['query']);_0x47572f[_0x6390('0x33')]=_[_0x6390('0x31')](_0x5f154a[_0x6390('0x32')],qs[_0x6390('0x34')](_0x25779b[_0x6390('0x30')][_0x6390('0x34')]));_0x47572f['attributes']=_0x47572f[_0x6390('0x33')][_0x6390('0x35')]?_0x47572f['attributes']:_0x5f154a[_0x6390('0x32')];if(!_0x25779b[_0x6390('0x30')][_0x6390('0x36')]('nolimit')){_0x47572f[_0x6390('0x21')]=qs[_0x6390('0x21')](_0x25779b[_0x6390('0x30')][_0x6390('0x21')]);_0x47572f['offset']=qs[_0x6390('0x1e')](_0x25779b[_0x6390('0x30')]['offset']);}_0x47572f['order']=qs[_0x6390('0x37')](_0x25779b['query']['sort']);_0x47572f[_0x6390('0x38')]=qs[_0x6390('0x39')](_[_0x6390('0x3a')](_0x25779b[_0x6390('0x30')],_0x5f154a[_0x6390('0x39')]),_0x3cc7cb);if(_0x25779b['query'][_0x6390('0x3b')]){_0x47572f[_0x6390('0x38')]=_[_0x6390('0x3c')](_0x47572f['where'],{'$or':_['map'](_0x3cc7cb,function(_0x487af9){if(_0x487af9[_0x6390('0x2e')]!==_0x6390('0x3d')){var _0x31adb8={};_0x31adb8[_0x487af9['name']]={'$like':'%'+_0x25779b[_0x6390('0x30')][_0x6390('0x3b')]+'%'};return _0x31adb8;}})});}_0x47572f=_['merge']({},_0x47572f,_0x25779b[_0x6390('0x3e')]);var _0x2093cd={'where':_0x47572f[_0x6390('0x38')]};return db[_0x6390('0x2c')][_0x6390('0x20')](_0x2093cd)[_0x6390('0x26')](function(_0x3a60fe){_0x27a174['count']=_0x3a60fe;if(_0x25779b[_0x6390('0x30')]['includeAll']){_0x47572f[_0x6390('0x3f')]=[{'all':!![]}];}return db[_0x6390('0x2c')][_0x6390('0x40')](_0x47572f);})['then'](function(_0x4fc453){_0x27a174[_0x6390('0x41')]=_0x4fc453;return _0x27a174;})[_0x6390('0x26')](respondWithFilteredResult(_0x11df33,_0x47572f))[_0x6390('0x42')](handleError(_0x11df33,null));};exports[_0x6390('0x43')]=function(_0xd640f8,_0xd91634){var _0x7532fd={'raw':!![],'where':{'id':_0xd640f8['params']['id']}},_0x349caf={};_0x349caf[_0x6390('0x32')]=_[_0x6390('0x44')](db['WhatsappTransferReport'][_0x6390('0x2d')]);_0x349caf[_0x6390('0x30')]=_['keys'](_0xd640f8[_0x6390('0x30')]);_0x349caf[_0x6390('0x39')]=_['intersection'](_0x349caf[_0x6390('0x32')],_0x349caf[_0x6390('0x30')]);_0x7532fd['attributes']=_[_0x6390('0x31')](_0x349caf[_0x6390('0x32')],qs[_0x6390('0x34')](_0xd640f8[_0x6390('0x30')][_0x6390('0x34')]));_0x7532fd[_0x6390('0x33')]=_0x7532fd[_0x6390('0x33')][_0x6390('0x35')]?_0x7532fd[_0x6390('0x33')]:_0x349caf[_0x6390('0x32')];if(_0xd640f8[_0x6390('0x30')][_0x6390('0x45')]){_0x7532fd[_0x6390('0x3f')]=[{'all':!![]}];}_0x7532fd=_[_0x6390('0x3c')]({},_0x7532fd,_0xd640f8[_0x6390('0x3e')]);return db[_0x6390('0x2c')][_0x6390('0x46')](_0x7532fd)[_0x6390('0x26')](handleEntityNotFound(_0xd91634,null))[_0x6390('0x26')](respondWithResult(_0xd91634,null))['catch'](handleError(_0xd91634,null));};exports[_0x6390('0x47')]=function(_0x480847,_0x8ec464){return db[_0x6390('0x2c')][_0x6390('0x47')](_0x480847[_0x6390('0x48')],{})[_0x6390('0x26')](respondWithResult(_0x8ec464,0xc9))[_0x6390('0x42')](handleError(_0x8ec464,null));};exports['update']=function(_0x48a53c,_0x5a59e0){if(_0x48a53c['body']['id']){delete _0x48a53c[_0x6390('0x48')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x48a53c[_0x6390('0x49')]['id']}})[_0x6390('0x26')](handleEntityNotFound(_0x5a59e0,null))[_0x6390('0x26')](saveUpdates(_0x48a53c[_0x6390('0x48')],null))[_0x6390('0x26')](respondWithResult(_0x5a59e0,null))['catch'](handleError(_0x5a59e0,null));};exports[_0x6390('0x4a')]=function(_0x48544a,_0x4c6529){return db[_0x6390('0x2c')]['find']({'where':{'id':_0x48544a[_0x6390('0x49')]['id']}})[_0x6390('0x26')](handleEntityNotFound(_0x4c6529,null))[_0x6390('0x26')](removeEntity(_0x4c6529,null))[_0x6390('0x42')](handleError(_0x4c6529,null));};exports[_0x6390('0x4b')]=function(_0x50ce7c,_0x5425eb){return db[_0x6390('0x2c')][_0x6390('0x4b')]()[_0x6390('0x26')](respondWithResult(_0x5425eb,null))['catch'](handleError(_0x5425eb,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0a4cda5..70eae7a 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2663=['../../config/logger','api','moment','bluebird','request-promise','path','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x22a56e,_0x41e870){var _0x1fc070=function(_0x28ce4){while(--_0x28ce4){_0x22a56e['push'](_0x22a56e['shift']());}};_0x1fc070(++_0x41e870);}(_0x2663,0xc5));var _0x3266=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x2663[_0x4cc280];return _0x16ed24;};'use strict';var _=require(_0x3266('0x0'));var util=require('util');var logger=require(_0x3266('0x1'))(_0x3266('0x2'));var moment=require(_0x3266('0x3'));var BPromise=require(_0x3266('0x4'));var rp=require(_0x3266('0x5'));var fs=require('fs');var path=require(_0x3266('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x3266('0x7')]=function(_0x2af7fd,_0x8f7d77){return _0x2af7fd['define'](_0x3266('0x8'),attributes,{'tableName':_0x3266('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3266('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x50f9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','../../config/logger','api'];(function(_0x149ac5,_0x2a6483){var _0x11d6e1=function(_0xb94953){while(--_0xb94953){_0x149ac5['push'](_0x149ac5['shift']());}};_0x11d6e1(++_0x2a6483);}(_0x50f9,0xb4));var _0x950f=function(_0x4892c4,_0x2fa919){_0x4892c4=_0x4892c4-0x0;var _0x4031d2=_0x50f9[_0x4892c4];return _0x4031d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x950f('0x0'))(_0x950f('0x1'));var moment=require(_0x950f('0x2'));var BPromise=require(_0x950f('0x3'));var rp=require(_0x950f('0x4'));var fs=require('fs');var path=require(_0x950f('0x5'));var rimraf=require(_0x950f('0x6'));var config=require(_0x950f('0x7'));var attributes=require(_0x950f('0x8'));module[_0x950f('0x9')]=function(_0x59173b,_0x4e3eb6){return _0x59173b[_0x950f('0xa')](_0x950f('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x950f('0xc'),'fields':[_0x950f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 56665fd..993456f 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x686a=['message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686a,0xea));var _0xa686=function(_0xd1bd2b,_0x43ead3){_0xd1bd2b=_0xd1bd2b-0x0;var _0x466676=_0x686a[_0xd1bd2b];return _0x466676;};'use strict';var _=require(_0xa686('0x0'));var util=require('util');var moment=require(_0xa686('0x1'));var BPromise=require(_0xa686('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa686('0x3'));var db=require(_0xa686('0x4'))['db'];var utils=require(_0xa686('0x5'));var logger=require(_0xa686('0x6'))(_0xa686('0x7'));var config=require(_0xa686('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa686('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x107975,_0x4b97f5,_0x34a5e9){return new BPromise(function(_0x5bb1c0,_0x281d40){return client['request'](_0x107975,_0x34a5e9)[_0xa686('0xa')](function(_0x295257){logger['info'](_0xa686('0xb'),_0x4b97f5,_0xa686('0xc'));logger[_0xa686('0xd')](_0xa686('0xe'),_0x4b97f5,_0xa686('0xc'),JSON[_0xa686('0xf')](_0x295257));if(_0x295257[_0xa686('0x10')]){if(_0x295257[_0xa686('0x10')][_0xa686('0x11')]===0x1f4){logger[_0xa686('0x10')](_0xa686('0xb'),_0x4b97f5,_0x295257[_0xa686('0x10')][_0xa686('0x12')]);return _0x281d40(_0x295257[_0xa686('0x10')][_0xa686('0x12')]);}logger[_0xa686('0x10')](_0xa686('0xb'),_0x4b97f5,_0x295257[_0xa686('0x10')][_0xa686('0x12')]);return _0x5bb1c0(_0x295257[_0xa686('0x10')]['message']);}else{logger[_0xa686('0x13')](_0xa686('0xb'),_0x4b97f5,_0xa686('0xc'));_0x5bb1c0(_0x295257['result']['message']);}})[_0xa686('0x14')](function(_0x4eb2b2){logger['error'](_0xa686('0xb'),_0x4b97f5,_0x4eb2b2);_0x281d40(_0x4eb2b2);});});} \ No newline at end of file +var _0x6284=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1860c4,_0x1d1371){var _0x534338=function(_0x5a9eda){while(--_0x5a9eda){_0x1860c4['push'](_0x1860c4['shift']());}};_0x534338(++_0x1d1371);}(_0x6284,0x9f));var _0x4628=function(_0x99e59a,_0x265a53){_0x99e59a=_0x99e59a-0x0;var _0x16767a=_0x6284[_0x99e59a];return _0x16767a;};'use strict';var _=require(_0x4628('0x0'));var util=require('util');var moment=require(_0x4628('0x1'));var BPromise=require(_0x4628('0x2'));var rs=require(_0x4628('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4628('0x4'))['db'];var utils=require(_0x4628('0x5'));var logger=require(_0x4628('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4628('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ac04f,_0x4672b6,_0x295339){return new BPromise(function(_0x3f1ae0,_0x51e1d1){return client[_0x4628('0x8')](_0x5ac04f,_0x295339)[_0x4628('0x9')](function(_0x42a352){logger['info'](_0x4628('0xa'),_0x4672b6,_0x4628('0xb'));logger[_0x4628('0xc')](_0x4628('0xd'),_0x4672b6,_0x4628('0xb'),JSON[_0x4628('0xe')](_0x42a352));if(_0x42a352[_0x4628('0xf')]){if(_0x42a352['error'][_0x4628('0x10')]===0x1f4){logger[_0x4628('0xf')](_0x4628('0xa'),_0x4672b6,_0x42a352[_0x4628('0xf')][_0x4628('0x11')]);return _0x51e1d1(_0x42a352[_0x4628('0xf')]['message']);}logger[_0x4628('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4672b6,_0x42a352[_0x4628('0xf')][_0x4628('0x11')]);return _0x3f1ae0(_0x42a352[_0x4628('0xf')][_0x4628('0x11')]);}else{logger['info'](_0x4628('0xa'),_0x4672b6,_0x4628('0xb'));_0x3f1ae0(_0x42a352['result']['message']);}})[_0x4628('0x12')](function(_0x52840f){logger['error'](_0x4628('0xa'),_0x4672b6,_0x52840f);_0x51e1d1(_0x52840f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d8f81a8..2619b52 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80c3=['error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/license','./config/environment','./config/logger','app','./config/schedule/chat','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','name','join','Offline\x20apps:','map','status','online','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x260458,_0x2ba21d){var _0xcc957e=function(_0x1d3d81){while(--_0x1d3d81){_0x260458['push'](_0x260458['shift']());}};_0xcc957e(++_0x2ba21d);}(_0x80c3,0x18f));var _0x380c=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x80c3[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x380c('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x380c('0x1'));var rpc=require('./rpc');var config=require(_0x380c('0x2'));var logger=require(_0x380c('0x3'))(_0x380c('0x4'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x380c('0x5'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x380c('0x6'));function main(){return db[_0x380c('0x7')][_0x380c('0x8')]()['then'](function(){if(config[_0x380c('0x9')]){return seedDb[_0x380c('0xa')]();}})['then'](function(){return checkLicense[_0x380c('0xa')]();})[_0x380c('0xb')](function(){return rpc['listen']();})[_0x380c('0xb')](function(_0x3a1ebb){logger[_0x380c('0xc')](_0x3a1ebb);return chat['start']();})[_0x380c('0xb')](function(){return whatsapp[_0x380c('0xd')]();})[_0x380c('0xb')](function(){return schedule[_0x380c('0xd')]();})[_0x380c('0xb')](function(){return transcribe[_0x380c('0xd')]();})[_0x380c('0xb')](function(){return provider[_0x380c('0xd')]();})[_0x380c('0xb')](function(_0x217d0d){logger['info'](_0x217d0d);return pm2[_0x380c('0xd')](pm2Config);})[_0x380c('0xb')](function(_0x5b59af){var _0x19b2fc=_0x5b59af[_0x380c('0xe')](function(_0x8add18){return typeof _0x8add18[_0x380c('0xf')]===_0x380c('0x10')&&_0x8add18[_0x380c('0xf')]>=0x0;});if(_0x19b2fc[_0x380c('0x11')]>0x0){throw new Error(_0x19b2fc[_0x380c('0x11')]+_0x380c('0x12')+_['map'](_0x19b2fc,function(_0x31edee){return'\x22'+_0x31edee['pm2_env']['name']+'\x22';}));}logger[_0x380c('0xc')]('Online\x20apps:',_['map'](_['filter'](_0x5b59af,{'status':'online'}),_0x380c('0x13'))[_0x380c('0x14')]());logger[_0x380c('0xc')](_0x380c('0x15'),_[_0x380c('0x16')](_[_0x380c('0xe')](_0x5b59af,function(_0x271e4e){return _0x271e4e[_0x380c('0x17')]!==_0x380c('0x18');}),_0x380c('0x13'))[_0x380c('0x14')]()||_0x380c('0x19'));console[_0x380c('0x1a')](_0x380c('0x1b'));})[_0x380c('0x1c')](function(_0x459078){console[_0x380c('0x1a')](_0x380c('0x1d'),_0x459078);logger[_0x380c('0x1e')](_0x380c('0x1f'),_0x459078);process[_0x380c('0x20')](0x1);});}main(); \ No newline at end of file +var _0x3613=['lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','seedDB','default','then','start','info','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','online','log','App\x20Ready!','exit'];(function(_0x4adee7,_0x220adc){var _0x410750=function(_0x5ca777){while(--_0x5ca777){_0x4adee7['push'](_0x4adee7['shift']());}};_0x410750(++_0x220adc);}(_0x3613,0x198));var _0x3361=function(_0x7fd251,_0x582353){_0x7fd251=_0x7fd251-0x0;var _0x52eba5=_0x3613[_0x7fd251];return _0x52eba5;};'use strict';var _=require(_0x3361('0x0'));var db=require(_0x3361('0x1'))['db'];var seedDb=require(_0x3361('0x2'));var checkLicense=require(_0x3361('0x3'));var rpc=require(_0x3361('0x4'));var config=require(_0x3361('0x5'));var logger=require(_0x3361('0x6'))('app');var pm2=require(_0x3361('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x3361('0x8'));var chat=require(_0x3361('0x9'));var whatsapp=require(_0x3361('0xa'));var transcribe=require(_0x3361('0xb'));var provider=require(_0x3361('0xc'));function main(){return db['sequelize'][_0x3361('0xd')]()['then'](function(){if(config[_0x3361('0xe')]){return seedDb[_0x3361('0xf')]();}})[_0x3361('0x10')](function(){return checkLicense[_0x3361('0xf')]();})[_0x3361('0x10')](function(){return rpc['listen']();})['then'](function(_0x4abfd6){logger['info'](_0x4abfd6);return chat['start']();})[_0x3361('0x10')](function(){return whatsapp[_0x3361('0x11')]();})[_0x3361('0x10')](function(){return schedule[_0x3361('0x11')]();})[_0x3361('0x10')](function(){return transcribe['start']();})[_0x3361('0x10')](function(){return provider[_0x3361('0x11')]();})[_0x3361('0x10')](function(_0x5d7580){logger[_0x3361('0x12')](_0x5d7580);return pm2[_0x3361('0x11')](pm2Config);})[_0x3361('0x10')](function(_0x648525){var _0x525c22=_0x648525[_0x3361('0x13')](function(_0x53f08c){return typeof _0x53f08c[_0x3361('0x14')]===_0x3361('0x15')&&_0x53f08c[_0x3361('0x14')]>=0x0;});if(_0x525c22[_0x3361('0x16')]>0x0){throw new Error(_0x525c22[_0x3361('0x16')]+_0x3361('0x17')+_[_0x3361('0x18')](_0x525c22,function(_0x2bd93f){return'\x22'+_0x2bd93f[_0x3361('0x19')][_0x3361('0x1a')]+'\x22';}));}logger[_0x3361('0x12')](_0x3361('0x1b'),_[_0x3361('0x18')](_[_0x3361('0x13')](_0x648525,{'status':'online'}),'name')[_0x3361('0x1c')]());logger[_0x3361('0x12')](_0x3361('0x1d'),_[_0x3361('0x18')](_['filter'](_0x648525,function(_0x220f9e){return _0x220f9e['status']!==_0x3361('0x1e');}),_0x3361('0x1a'))[_0x3361('0x1c')]()||'None');console[_0x3361('0x1f')](_0x3361('0x20'));})['catch'](function(_0x4db586){console[_0x3361('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x4db586);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x4db586);process[_0x3361('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6150b30..43cfe7a 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 _0x4b25=['allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','authenticate','pass','Wrong\x20credentials.','user','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','blockDuration','minutes','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','validatePasswordHistory','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','promisify','secret','payload','randomBytes','toString','floor','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','util','secrets','session','fullname','name','internal','email','userpic','permissions','md5secret','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4b25,0xe7));var _0x54b2=function(_0x9441c6,_0x130937){_0x9441c6=_0x9441c6-0x0;var _0xfdb76d=_0x4b25[_0x9441c6];return _0xfdb76d;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x54b2('0x0'));var hardwareConf=require(_0x54b2('0x1'));var licenseUtil=require(_0x54b2('0x2'));var encryptor=require(_0x54b2('0x3'));var _=require(_0x54b2('0x4'));var jwt=require(_0x54b2('0x5'));var expressJwt=require(_0x54b2('0x6'));var compose=require(_0x54b2('0x7'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x54b2('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x54b2('0x9')][_0x54b2('0xa')]});var userAttributes=['id','role',_0x54b2('0xb'),_0x54b2('0xc'),_0x54b2('0xd'),_0x54b2('0xe'),_0x54b2('0xf'),_0x54b2('0x10'),_0x54b2('0x11'),'voicePause','chatPause',_0x54b2('0x12'),'faxPause',_0x54b2('0x13'),_0x54b2('0x14'),_0x54b2('0x15'),_0x54b2('0x16'),_0x54b2('0x17'),_0x54b2('0x18'),'crudPermissions',_0x54b2('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0x54b2('0x1a'),_0x54b2('0x1b'),_0x54b2('0x1c'),_0x54b2('0x1d'),_0x54b2('0x1e'),_0x54b2('0x1f'),'phoneBarPrefixRequired',_0x54b2('0x20'),_0x54b2('0x21'),_0x54b2('0x22'),'interface',_0x54b2('0x23'),_0x54b2('0x24'),'settingsEnabled',_0x54b2('0x25'),_0x54b2('0x26'),'downloadOmnichannelInteractions',_0x54b2('0x27'),_0x54b2('0x28'),_0x54b2('0x29')];exports[_0x54b2('0x2a')]=function(){return this[_0x54b2('0x2b')](!![])[_0x54b2('0x2c')](function(_0x37d81b,_0x19e63f,_0x1c7803){if(_0x37d81b['user']){_0x1c7803();}else{return db[_0x54b2('0x2d')][_0x54b2('0x2e')]({'where':{'id':_0x37d81b[_0x54b2('0x2f')]['id']},'attributes':['id',_0x54b2('0x30'),_0x54b2('0x31')],'raw':!![]})[_0x54b2('0x32')](function(_0x4e3a6e){if(_0x4e3a6e&&_0x4e3a6e[_0x54b2('0x30')]){return _0x19e63f[_0x54b2('0x33')](_0x4e3a6e[_0x54b2('0x31')]===_0x54b2('0x34')?0x195:0x193)[_0x54b2('0x35')]({'message':_0x4e3a6e[_0x54b2('0x31')]===_0x54b2('0x34')?_0x54b2('0x36'):_0x54b2('0x37')});}else{_0x1c7803();}})[_0x54b2('0x38')](function(_0x1a5a52){_0x1c7803(_0x1a5a52);});}});};exports[_0x54b2('0x2b')]=function isAuthenticated(_0x4db2d9){return compose()[_0x54b2('0x2c')](function(_0x54d978,_0x46cd81,_0x26b08a){var _0x847425;if(_0x54d978[_0x54b2('0x39')][_0x54b2('0x3a')]){if(_['startsWith'](_0x54d978[_0x54b2('0x39')][_0x54b2('0x3a')],_0x54b2('0x3b'))){var _0x5c99bd=basicAuth(_0x54d978);db['User']['find']({'where':{'name':_0x5c99bd[_0x54b2('0xc')]}})['then'](function(_0x1e7b37){if(!_0x1e7b37||!_0x1e7b37[_0x54b2('0x3c')](_0x5c99bd[_0x54b2('0x3d')])){return _0x46cd81[_0x54b2('0x33')](0x191)[_0x54b2('0x35')]({'message':_0x54b2('0x3e')});}_0x54d978[_0x54b2('0x3f')]={'id':_0x1e7b37['id']};_0x26b08a();})[_0x54b2('0x38')](function(_0x253b7c){_0x26b08a(_0x253b7c);});}else if(_[_0x54b2('0x40')](_0x54d978[_0x54b2('0x39')][_0x54b2('0x3a')],_0x54b2('0x41'))){validateJwt(_0x54d978,_0x46cd81,_0x26b08a);}else{if(_0x4db2d9){_0x26b08a();}else{return _0x46cd81[_0x54b2('0x33')](0x193)['json']({'message':_0x54b2('0x42')});}}}else if(_0x54d978[_0x54b2('0x43')][_0x54b2('0x44')]){try{var _0xf1f44e={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x54b2('0x45')]()};verifyJwt(_0x54d978[_0x54b2('0x43')][_0x54b2('0x44')],_0xf1f44e)[_0x54b2('0x32')](function(_0x3e108a){return db['User'][_0x54b2('0x46')]({'where':{'id':_0x3e108a[_0x54b2('0x47')]}})[_0x54b2('0x32')](function(_0xa1605d){_0x847425=_0xa1605d;return db[_0x54b2('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0x54b2('0x49'),'blockDuration'],'raw':!![]});})[_0x54b2('0x32')](function(_0x1ae5f3){if(!_0x847425||!_[_0x54b2('0x4a')](_0x847425['apiKeyNonce'],_0x3e108a[_0x54b2('0x4b')])){return _0x46cd81['status'](0x191)[_0x54b2('0x35')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x847425[_0x54b2('0x4c')]){return _0x46cd81[_0x54b2('0x33')](0x191)['json']({'message':_0x54b2('0x4d')});}if(_0x847425['blocked']){if(_0x1ae5f3['blockDuration']>0x0){if(moment(_0x847425[_0x54b2('0x4e')])[_0x54b2('0x4f')](_0x1ae5f3[_0x54b2('0x50')],_0x54b2('0x51'))>moment()){return _0x46cd81[_0x54b2('0x33')](0x191)[_0x54b2('0x35')]({'message':_0x54b2('0x4d')});}}else{return _0x46cd81[_0x54b2('0x33')](0x191)['json']({'message':_0x54b2('0x4d')});}}_0x54d978['user']={'id':_0x847425['id']};_0x26b08a();});})[_0x54b2('0x38')](function(){return _0x46cd81['status'](0x191)[_0x54b2('0x35')]({'message':_0x54b2('0x4d')});});}catch(_0xd19e3c){_0x26b08a(_0xd19e3c);}}else if(_0x4db2d9){_0x26b08a();}else{return _0x46cd81['status'](0x193)[_0x54b2('0x35')]({'message':_0x54b2('0x42')});}})[_0x54b2('0x2c')](function(_0x4ccee6,_0x11a2e2,_0x3fa2ba){if(_0x4ccee6[_0x54b2('0x3f')]){db[_0x54b2('0x52')][_0x54b2('0x46')]({'where':{'id':_0x4ccee6[_0x54b2('0x3f')]['id']},'attributes':userAttributes})[_0x54b2('0x32')](function(_0x2089ce){if(!_0x2089ce){return _0x11a2e2[_0x54b2('0x33')](0x194)['json']({'message':_0x54b2('0x53')});}_0x4ccee6[_0x54b2('0x3f')]=_0x2089ce;_0x3fa2ba();})[_0x54b2('0x38')](function(_0x46f838){_0x3fa2ba(_0x46f838);});}else if(_0x4db2d9){_0x3fa2ba();}else{return _0x11a2e2[_0x54b2('0x33')](0x194)['json']({'message':_0x54b2('0x54')});}});};exports[_0x54b2('0x55')]=function canUpdate(){return compose()[_0x54b2('0x2c')](function(_0x3e2497,_0x1116f1,_0x159969){return licenseUtil[_0x54b2('0x56')]()[_0x54b2('0x32')](function(_0x31250c){if(_0x31250c[_0x54b2('0x57')]){_0x159969();}else{return _0x1116f1[_0x54b2('0x33')](0x193)['json']({'message':_0x54b2('0x58')});}})[_0x54b2('0x38')](function(_0x2b8b96){_0x159969(_0x2b8b96);});});};exports[_0x54b2('0x59')]=function isWebrtcLicence(){return compose()['use'](function(_0x20fc02,_0x50d012,_0x509135){return licenseUtil[_0x54b2('0x56')]()['then'](function(_0x5ce74a){if(_0x5ce74a[_0x54b2('0x5a')]){_0x509135();}else{return _0x50d012[_0x54b2('0x33')](0x193)['json']({'message':'Forbidden'});}})[_0x54b2('0x38')](function(_0x2e8584){_0x509135(_0x2e8584);});});};exports[_0x54b2('0x5b')]=function(_0x309e43,_0x33eb20,_0x48e1c9){_0x309e43[_0x54b2('0x5b')]=!![];return _0x48e1c9();};exports[_0x54b2('0x5c')]=function signToken(_0x16d50f){return signJwt(_0x16d50f);};exports[_0x54b2('0x5d')]=function(_0x246a63,_0x5e1033){if(!_0x246a63[_0x54b2('0x3f')]){return _0x5e1033[_0x54b2('0x33')](0x194)[_0x54b2('0x35')]({'message':_0x54b2('0x5e')});}var _0x2164fc={'payload':{'id':_0x246a63[_0x54b2('0x3f')]['id'],'role':_0x246a63[_0x54b2('0x3f')][_0x54b2('0x5f')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2164fc)['then'](function(_0x393dd7){_0x5e1033[_0x54b2('0x60')](_0x54b2('0x61'),_0x393dd7);_0x5e1033[_0x54b2('0x62')](_0x54b2('0x63'));})[_0x54b2('0x38')](function(_0x54c9ee){return _0x5e1033[_0x54b2('0x33')](0x1f4)[_0x54b2('0x64')](_0x54c9ee);});};exports['retrieveApiKey']=function(_0x4a008e){if(_[_0x54b2('0x65')](_0x4a008e[_0x54b2('0x66')])||_[_0x54b2('0x65')](_0x4a008e[_0x54b2('0x67')])){return null;}else{return createJwt(_0x4a008e);}};exports[_0x54b2('0x68')]=function(_0x9dd4ce){_0x9dd4ce[_0x54b2('0x66')]=generateNonce();_0x9dd4ce[_0x54b2('0x67')]=generateIssuedAt();return createJwt(_0x9dd4ce);};exports[_0x54b2('0x69')]=function(_0xf3142,_0x345252){var _0x185518=_0xf3142[_0x54b2('0x43')]['apikey'];if(_0x185518){var _0x4419f1={'nonce':_0x345252[_0x54b2('0x66')],'iat':_0x345252['apiKeyIat'],'audience':hardwareConf[_0x54b2('0x45')](),'issuer':hardwareConf[_0x54b2('0x45')]()};return verifyJwt(_0x185518,_0x4419f1)[_0x54b2('0x32')](function(){return generateApiKey(_0x345252);});}else{throw{'message':_0x54b2('0x6a')};}};exports[_0x54b2('0x6b')]=function(_0x2ca76d){var _0x13d99f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x13d99f['test'](_0x2ca76d))throw new db[(_0x54b2('0x6c'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x54b2('0x6d')]=function(_0xe16b09,_0x5b3e18,_0x29cd4e){var _0x58653a=encryptor['decryptString'](_0x5b3e18)['split'](',');for(var _0xf5996d=0x0;_0xf5996d<_0x29cd4e;_0xf5996d++){if(!_0x58653a[_0xf5996d])break;if(_0xe16b09[_0x54b2('0x6e')]()===_0x58653a[_0xf5996d]['toLowerCase']()){var _0x29332f=util[_0x54b2('0x6f')](_0x54b2('0x70'),_0x29cd4e);if(_0x29cd4e===0x1){_0x29332f=_0x54b2('0x71');}throw new db[(_0x54b2('0x6c'))][(_0x54b2('0x72'))](_0x29332f);}}return;};exports[_0x54b2('0x73')]=function(_0x92e0e2,_0x5490be){var _0x572bc7=_0x5490be?encryptor[_0x54b2('0x74')](_0x5490be)['split'](','):[];if(_0x572bc7[_0x54b2('0x75')]===0x5){_0x572bc7[_0x54b2('0x76')](-0x1,0x1);}_0x572bc7[_0x54b2('0x77')](_0x92e0e2);return encryptor[_0x54b2('0x78')](_0x572bc7['join'](','));};function signJwt(_0x4ee6f6){var _0x578cb7=BPromise[_0x54b2('0x79')](jwt['sign'],{'context':jwt});var _0x1db2cf=_0x4ee6f6[_0x54b2('0x7a')]||config[_0x54b2('0x9')][_0x54b2('0xa')];return new BPromise(function(_0x310b00,_0x286f6b){_0x578cb7(_0x4ee6f6[_0x54b2('0x7b')],_0x1db2cf,_0x4ee6f6['options'])['then'](function(_0x5e7258){_0x310b00(_0x5e7258);})[_0x54b2('0x38')](function(_0x144188){_0x286f6b(_0x144188);});});}function verifyJwt(_0x1e0880,_0x3efeed,_0x53edf7){var _0x35ffd5=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x1f7a42=_0x53edf7||config[_0x54b2('0x9')][_0x54b2('0xa')];return new BPromise(function(_0x1e0610,_0x18e142){_0x35ffd5(_0x1e0880,_0x1f7a42,_0x3efeed)['then'](function(_0x1dbd4f){_0x1e0610(_0x1dbd4f);})['catch'](function(_0x246de6){_0x18e142(_0x246de6);});});}function generateNonce(){return crypto[_0x54b2('0x7c')](0x10)[_0x54b2('0x7d')]('hex');}function generateIssuedAt(){return Math[_0x54b2('0x7e')](Date['now']()/0x3e8)[_0x54b2('0x7d')]();}function createJwt(_0x58d471){var _0xb39bff={'payload':{'iat':_0x58d471[_0x54b2('0x67')],'nonce':_0x58d471[_0x54b2('0x66')]},'options':{'algorithm':_0x54b2('0x7f'),'subject':_0x58d471['id'][_0x54b2('0x7d')](),'issuer':hardwareConf[_0x54b2('0x45')](),'audience':hardwareConf[_0x54b2('0x45')]()}};return signJwt(_0xb39bff)[_0x54b2('0x32')](function(_0x3c2528){return{'iat':_0x58d471[_0x54b2('0x67')],'nonce':_0x58d471[_0x54b2('0x66')],'token':_0x3c2528};});} \ No newline at end of file +var _0xa33b=['phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','disposition','then','closed','unmanaged','json','Forbidden.','catch','headers','authorization','User','find','name','authenticate','Wrong\x20credentials.','startsWith','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','secrets','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','session','role','fullname','email','permissions','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias'];(function(_0x6457de,_0x4390ff){var _0x302ce1=function(_0x10f031){while(--_0x10f031){_0x6457de['push'](_0x6457de['shift']());}};_0x302ce1(++_0x4390ff);}(_0xa33b,0xf5));var _0xba33=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa33b[_0x3ab51d];return _0x29a04e;};'use strict';var db=require(_0xba33('0x0'))['db'];var config=require(_0xba33('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xba33('0x2'));var encryptor=require(_0xba33('0x3'));var _=require(_0xba33('0x4'));var jwt=require(_0xba33('0x5'));var expressJwt=require(_0xba33('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xba33('0x7'));var crypto=require(_0xba33('0x8'));var BPromise=require(_0xba33('0x9'));var util=require(_0xba33('0xa'));var moment=require(_0xba33('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0xba33('0xc')]});var userAttributes=['id',_0xba33('0xd'),_0xba33('0xe'),'name','internal',_0xba33('0xf'),'userpic',_0xba33('0x10'),'md5secret',_0xba33('0x11'),_0xba33('0x12'),_0xba33('0x13'),'faxPause',_0xba33('0x14'),_0xba33('0x15'),_0xba33('0x16'),_0xba33('0x17'),_0xba33('0x18'),_0xba33('0x19'),'crudPermissions',_0xba33('0x1a'),_0xba33('0x1b'),_0xba33('0x1c'),_0xba33('0x1d'),_0xba33('0x1e'),_0xba33('0x1f'),_0xba33('0x20'),'phoneBarEnableDtmfTone',_0xba33('0x21'),_0xba33('0x22'),_0xba33('0x23'),_0xba33('0x24'),_0xba33('0x25'),_0xba33('0x26'),_0xba33('0x27'),_0xba33('0x28'),_0xba33('0x29'),_0xba33('0x2a'),_0xba33('0x2b'),_0xba33('0x2c'),_0xba33('0x2d'),_0xba33('0x2e'),'ignorePauseForPreviewCalls',_0xba33('0x2f')];exports[_0xba33('0x30')]=function(){return this[_0xba33('0x31')](!![])[_0xba33('0x32')](function(_0x574166,_0x494060,_0x720f4f){if(_0x574166[_0xba33('0x33')]){_0x720f4f();}else{return db[_0xba33('0x34')]['findOne']({'where':{'id':_0x574166[_0xba33('0x35')]['id']},'attributes':['id','closed',_0xba33('0x36')],'raw':!![]})[_0xba33('0x37')](function(_0x3506e5){if(_0x3506e5&&_0x3506e5[_0xba33('0x38')]){return _0x494060['status'](_0x3506e5[_0xba33('0x36')]===_0xba33('0x39')?0x195:0x193)[_0xba33('0x3a')]({'message':_0x3506e5[_0xba33('0x36')]===_0xba33('0x39')?'Unmanaged.':_0xba33('0x3b')});}else{_0x720f4f();}})[_0xba33('0x3c')](function(_0x843cbf){_0x720f4f(_0x843cbf);});}});};exports['isAuthenticated']=function isAuthenticated(_0x45c4f9){return compose()[_0xba33('0x32')](function(_0x3fa481,_0x589ca1,_0xaae1c9){var _0x5f2f1d;if(_0x3fa481[_0xba33('0x3d')][_0xba33('0x3e')]){if(_['startsWith'](_0x3fa481[_0xba33('0x3d')]['authorization'],'Basic')){var _0x26cd74=basicAuth(_0x3fa481);db[_0xba33('0x3f')][_0xba33('0x40')]({'where':{'name':_0x26cd74[_0xba33('0x41')]}})['then'](function(_0x453c3d){if(!_0x453c3d||!_0x453c3d[_0xba33('0x42')](_0x26cd74['pass'])){return _0x589ca1['status'](0x191)['json']({'message':_0xba33('0x43')});}_0x3fa481[_0xba33('0x33')]={'id':_0x453c3d['id']};_0xaae1c9();})[_0xba33('0x3c')](function(_0x32b7bf){_0xaae1c9(_0x32b7bf);});}else if(_[_0xba33('0x44')](_0x3fa481[_0xba33('0x3d')][_0xba33('0x3e')],_0xba33('0x45'))){validateJwt(_0x3fa481,_0x589ca1,_0xaae1c9);}else{if(_0x45c4f9){_0xaae1c9();}else{return _0x589ca1[_0xba33('0x46')](0x193)['json']({'message':_0xba33('0x47')});}}}else if(_0x3fa481[_0xba33('0x48')][_0xba33('0x49')]){try{var _0x324d9f={'audience':hardwareConf[_0xba33('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x3fa481[_0xba33('0x48')][_0xba33('0x49')],_0x324d9f)[_0xba33('0x37')](function(_0x54ddaa){return db[_0xba33('0x3f')][_0xba33('0x40')]({'where':{'id':_0x54ddaa[_0xba33('0x4b')]}})[_0xba33('0x37')](function(_0x2ced96){_0x5f2f1d=_0x2ced96;return db[_0xba33('0x4c')][_0xba33('0x4d')]({'where':{'id':0x1},'attributes':[_0xba33('0x4e'),_0xba33('0x4f')],'raw':!![]});})[_0xba33('0x37')](function(_0x576c5c){if(!_0x5f2f1d||!_[_0xba33('0x50')](_0x5f2f1d[_0xba33('0x51')],_0x54ddaa[_0xba33('0x52')])){return _0x589ca1['status'](0x191)['json']({'message':_0xba33('0x53')});}if(_0x5f2f1d[_0xba33('0x54')]){return _0x589ca1[_0xba33('0x46')](0x191)[_0xba33('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5f2f1d[_0xba33('0x55')]){if(_0x576c5c[_0xba33('0x4f')]>0x0){if(moment(_0x5f2f1d[_0xba33('0x56')])[_0xba33('0x57')](_0x576c5c['blockDuration'],_0xba33('0x58'))>moment()){return _0x589ca1[_0xba33('0x46')](0x191)[_0xba33('0x3a')]({'message':_0xba33('0x59')});}}else{return _0x589ca1[_0xba33('0x46')](0x191)[_0xba33('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3fa481[_0xba33('0x33')]={'id':_0x5f2f1d['id']};_0xaae1c9();});})['catch'](function(){return _0x589ca1[_0xba33('0x46')](0x191)[_0xba33('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x393a2d){_0xaae1c9(_0x393a2d);}}else if(_0x45c4f9){_0xaae1c9();}else{return _0x589ca1['status'](0x193)[_0xba33('0x3a')]({'message':_0xba33('0x47')});}})[_0xba33('0x32')](function(_0x230741,_0x507cc3,_0x11e1af){if(_0x230741['user']){db['User'][_0xba33('0x40')]({'where':{'id':_0x230741[_0xba33('0x33')]['id']},'attributes':userAttributes})[_0xba33('0x37')](function(_0xa7ca93){if(!_0xa7ca93){return _0x507cc3[_0xba33('0x46')](0x194)[_0xba33('0x3a')]({'message':_0xba33('0x5a')});}_0x230741[_0xba33('0x33')]=_0xa7ca93;_0x11e1af();})[_0xba33('0x3c')](function(_0x16029a){_0x11e1af(_0x16029a);});}else if(_0x45c4f9){_0x11e1af();}else{return _0x507cc3[_0xba33('0x46')](0x194)['json']({'message':_0xba33('0x5b')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xba33('0x32')](function(_0x4336f7,_0x2b628d,_0x1cd967){return licenseUtil[_0xba33('0x5c')]()[_0xba33('0x37')](function(_0x5892e6){if(_0x5892e6[_0xba33('0x5d')]){_0x1cd967();}else{return _0x2b628d[_0xba33('0x46')](0x193)[_0xba33('0x3a')]({'message':_0xba33('0x5e')});}})['catch'](function(_0x88ec92){_0x1cd967(_0x88ec92);});});};exports[_0xba33('0x5f')]=function isWebrtcLicence(){return compose()[_0xba33('0x32')](function(_0x58abbf,_0x4e25aa,_0x57b984){return licenseUtil[_0xba33('0x5c')]()[_0xba33('0x37')](function(_0x4da354){if(_0x4da354['webrtc']){_0x57b984();}else{return _0x4e25aa['status'](0x193)[_0xba33('0x3a')]({'message':_0xba33('0x5e')});}})['catch'](function(_0x2df696){_0x57b984(_0x2df696);});});};exports[_0xba33('0x60')]=function(_0x367b1f,_0x1e7c88,_0x2c8a47){_0x367b1f[_0xba33('0x60')]=!![];return _0x2c8a47();};exports[_0xba33('0x61')]=function signToken(_0x376efe){return signJwt(_0x376efe);};exports[_0xba33('0x62')]=function(_0x417b41,_0x5c3ffa){if(!_0x417b41['user']){return _0x5c3ffa[_0xba33('0x46')](0x194)[_0xba33('0x3a')]({'message':_0xba33('0x63')});}var _0x49c6d8={'payload':{'id':_0x417b41[_0xba33('0x33')]['id'],'role':_0x417b41[_0xba33('0x33')][_0xba33('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x49c6d8)[_0xba33('0x37')](function(_0xd48799){_0x5c3ffa[_0xba33('0x64')](_0xba33('0x65'),_0xd48799);_0x5c3ffa[_0xba33('0x66')](_0xba33('0x67'));})['catch'](function(_0xdf719a){return _0x5c3ffa[_0xba33('0x46')](0x1f4)[_0xba33('0x68')](_0xdf719a);});};exports['retrieveApiKey']=function(_0x477070){if(_[_0xba33('0x69')](_0x477070[_0xba33('0x51')])||_['isNil'](_0x477070[_0xba33('0x6a')])){return null;}else{return createJwt(_0x477070);}};exports[_0xba33('0x6b')]=function(_0x3d65e0){_0x3d65e0['apiKeyNonce']=generateNonce();_0x3d65e0[_0xba33('0x6a')]=generateIssuedAt();return createJwt(_0x3d65e0);};exports[_0xba33('0x6c')]=function(_0x3504ec,_0x6745bd){var _0x42b645=_0x3504ec[_0xba33('0x48')]['apikey'];if(_0x42b645){var _0x42d3bd={'nonce':_0x6745bd['apiKeyNonce'],'iat':_0x6745bd[_0xba33('0x6a')],'audience':hardwareConf[_0xba33('0x4a')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x42b645,_0x42d3bd)[_0xba33('0x37')](function(){return generateApiKey(_0x6745bd);});}else{throw{'message':_0xba33('0x6d')};}};exports[_0xba33('0x6e')]=function(_0x4e9385){var _0x5ce476=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ce476['test'](_0x4e9385))throw new db[(_0xba33('0x6f'))][(_0xba33('0x70'))](_0xba33('0x71'));return;};exports[_0xba33('0x72')]=function(_0x11cbf1,_0x441350,_0xe13a87){var _0x2d22b7=encryptor['decryptString'](_0x441350)[_0xba33('0x73')](',');for(var _0x591b1d=0x0;_0x591b1d<_0xe13a87;_0x591b1d++){if(!_0x2d22b7[_0x591b1d])break;if(_0x11cbf1[_0xba33('0x74')]()===_0x2d22b7[_0x591b1d][_0xba33('0x74')]()){var _0x2e30dd=util[_0xba33('0x75')](_0xba33('0x76'),_0xe13a87);if(_0xe13a87===0x1){_0x2e30dd=_0xba33('0x77');}throw new db[(_0xba33('0x6f'))][(_0xba33('0x70'))](_0x2e30dd);}}return;};exports[_0xba33('0x78')]=function(_0x2d7690,_0x2dc781){var _0x1bb2d8=_0x2dc781?encryptor[_0xba33('0x79')](_0x2dc781)['split'](','):[];if(_0x1bb2d8[_0xba33('0x7a')]===0x5){_0x1bb2d8['splice'](-0x1,0x1);}_0x1bb2d8[_0xba33('0x7b')](_0x2d7690);return encryptor[_0xba33('0x7c')](_0x1bb2d8[_0xba33('0x7d')](','));};function signJwt(_0x5cb7ee){var _0x517b12=BPromise[_0xba33('0x7e')](jwt['sign'],{'context':jwt});var _0x35fa08=_0x5cb7ee['secret']||config[_0xba33('0x7f')][_0xba33('0xc')];return new BPromise(function(_0x29d27d,_0x2b29b8){_0x517b12(_0x5cb7ee[_0xba33('0x80')],_0x35fa08,_0x5cb7ee[_0xba33('0x81')])[_0xba33('0x37')](function(_0x2c4fb7){_0x29d27d(_0x2c4fb7);})['catch'](function(_0x5f3ee4){_0x2b29b8(_0x5f3ee4);});});}function verifyJwt(_0x450494,_0x164286,_0xecc25c){var _0x1c7d22=BPromise['promisify'](jwt[_0xba33('0x82')],{'context':jwt});var _0x552aa4=_0xecc25c||config[_0xba33('0x7f')][_0xba33('0xc')];return new BPromise(function(_0x2f92a5,_0x186701){_0x1c7d22(_0x450494,_0x552aa4,_0x164286)['then'](function(_0xbb0b65){_0x2f92a5(_0xbb0b65);})[_0xba33('0x3c')](function(_0xedf4c5){_0x186701(_0xedf4c5);});});}function generateNonce(){return crypto[_0xba33('0x83')](0x10)['toString'](_0xba33('0x84'));}function generateIssuedAt(){return Math[_0xba33('0x85')](Date[_0xba33('0x86')]()/0x3e8)[_0xba33('0x87')]();}function createJwt(_0x3df397){var _0x2be42c={'payload':{'iat':_0x3df397[_0xba33('0x6a')],'nonce':_0x3df397[_0xba33('0x51')]},'options':{'algorithm':_0xba33('0x88'),'subject':_0x3df397['id'][_0xba33('0x87')](),'issuer':hardwareConf[_0xba33('0x4a')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2be42c)[_0xba33('0x37')](function(_0x231795){return{'iat':_0x3df397['apiKeyIat'],'nonce':_0x3df397[_0xba33('0x51')],'token':_0x231795};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 78d6e56..5db2e3f 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 _0x33f1=['../../config/environment','app','secrets','session','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','update','binary','write','end','unlink','decryptFile','createReadStream','createWriteStream','createDecipher','data','final','encryptString','createCipher','utf8','base64','decryptString','secret','crypto','lodash'];(function(_0x5cd205,_0x14e783){var _0x1c9a12=function(_0x14bd15){while(--_0x14bd15){_0x5cd205['push'](_0x5cd205['shift']());}};_0x1c9a12(++_0x14e783);}(_0x33f1,0x106));var _0x133f=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x33f1[_0x56138f];return _0x1acaf7;};'use strict';var crypto=require(_0x133f('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x133f('0x1'));var config=require(_0x133f('0x2'));var logger=require('../../config/logger')(_0x133f('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x133f('0x4')][_0x133f('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x133f('0x6')]&&config[_0x133f('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x133f('0x6')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x133f('0x6')][_0x133f('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x133f('0x8')](',\x20');logger[_0x133f('0x9')](config[_0x133f('0x6')][_0x133f('0x7')],_0x133f('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1ca8ab){return AES_SUPPORTED_RX[_0x133f('0xb')](_0x1ca8ab);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x133f('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x1ba022){return getSupportedCiphers()[_0x133f('0xd')](_0x1ba022)>-0x1;}function combineOptions(_0x2290a4){var _0xfe9a58={};for(var _0x4b7961 in fileOptions){if(fileOptions[_0x133f('0xe')](_0x4b7961)){_0xfe9a58[_0x4b7961]=fileOptions[_0x4b7961];}}if(_0x2290a4){for(var _0x3ca200 in _0x2290a4){if(_0x2290a4['hasOwnProperty'](_0x3ca200)){_0xfe9a58[_0x3ca200]=_0x2290a4[_0x3ca200];}}}return _0xfe9a58;}exports[_0x133f('0xf')]=function(_0xaed12,_0x3a0e60,_0x5d03fc,_0x554dd4){return new BPromise(function(_0x32d0a6,_0x263fee){_0x554dd4=combineOptions(_0x554dd4);var _0x3b94d5=new Buffer(_0x5d03fc);var _0x13315b=fs['createReadStream'](_0xaed12);var _0x338831=fs['createWriteStream'](_0x3a0e60);var _0x45e484=crypto['createCipher'](_0x554dd4['algorithm'],_0x3b94d5);_0x13315b['on']('data',function(_0x31c7da){var _0x3e9a55=new Buffer(_0x45e484[_0x133f('0x10')](_0x31c7da),_0x133f('0x11'));_0x338831[_0x133f('0x12')](_0x3e9a55);});_0x13315b['on'](_0x133f('0x13'),function(){try{var _0x502eb3=new Buffer(_0x45e484['final']('binary'),_0x133f('0x11'));_0x338831['write'](_0x502eb3);_0x338831[_0x133f('0x13')]();_0x338831['on']('close',function(){return _0x32d0a6(_0x3a0e60);});}catch(_0x531c27){fs[_0x133f('0x14')](_0x3a0e60);return _0x263fee(_0x531c27);}});});};exports[_0x133f('0x15')]=function(_0xa62fa5,_0x33b0c1,_0x218c87,_0x294114){return new BPromise(function(_0x242c73,_0x508024){_0x294114=combineOptions(_0x294114);var _0x55fb95=new Buffer(_0x218c87);var _0x4c1af6=fs[_0x133f('0x16')](_0xa62fa5);var _0x5683f8=fs[_0x133f('0x17')](_0x33b0c1);var _0x2b24ee=crypto[_0x133f('0x18')](_0x294114['algorithm'],_0x55fb95);_0x4c1af6['on'](_0x133f('0x19'),function(_0x2e8d55){var _0x5090c0=new Buffer(_0x2b24ee[_0x133f('0x10')](_0x2e8d55),_0x133f('0x11'));_0x5683f8[_0x133f('0x12')](_0x5090c0);});_0x4c1af6['on']('end',function(){try{var _0x36331e=new Buffer(_0x2b24ee[_0x133f('0x1a')](_0x133f('0x11')),_0x133f('0x11'));_0x5683f8[_0x133f('0x12')](_0x36331e);_0x5683f8['end']();_0x5683f8['on']('close',function(){return _0x242c73(_0x33b0c1);});}catch(_0x370a46){fs[_0x133f('0x14')](_0x33b0c1);return _0x508024(_0x370a46);}});});};exports[_0x133f('0x1b')]=function(_0x365d80,_0x1ae441,_0x518569){var _0x3935db=_0x518569||stringOptions[_0x133f('0x7')];var _0x419d77=_0x1ae441||stringOptions['secret'];var _0x5f2732=crypto[_0x133f('0x1c')](_0x3935db,_0x419d77);var _0x144d8c=_0x5f2732[_0x133f('0x10')](_0x365d80,_0x133f('0x1d'),_0x133f('0x1e'));_0x144d8c+=_0x5f2732[_0x133f('0x1a')](_0x133f('0x1e'));return _0x144d8c;};exports[_0x133f('0x1f')]=function(_0x135f87,_0x8222f0,_0x29f857){var _0x25e216=_0x29f857||stringOptions[_0x133f('0x7')];var _0xd5e73a=_0x8222f0||stringOptions[_0x133f('0x20')];var _0x5b8911=crypto[_0x133f('0x18')](_0x25e216,_0xd5e73a);var _0x1a46fb=_0x5b8911['update'](_0x135f87,_0x133f('0x1e'),_0x133f('0x1d'));_0x1a46fb+=_0x5b8911[_0x133f('0x1a')](_0x133f('0x1d'));return _0x1a46fb;}; \ No newline at end of file +var _0x652d=['createReadStream','createDecipher','unlink','encryptString','secret','utf8','decryptString','base64','bluebird','lodash','../../config/environment','app','session','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close','decryptFile'];(function(_0x4c4748,_0x2aa40e){var _0x1e761d=function(_0x237938){while(--_0x237938){_0x4c4748['push'](_0x4c4748['shift']());}};_0x1e761d(++_0x2aa40e);}(_0x652d,0xef));var _0xd652=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x652d[_0x465028];return _0xb783d4;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xd652('0x0'));var _=require(_0xd652('0x1'));var config=require(_0xd652('0x2'));var logger=require('../../config/logger')(_0xd652('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xd652('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xd652('0x5')};if(config[_0xd652('0x6')]&&config[_0xd652('0x6')][_0xd652('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xd652('0x7')]=config['encrypt'][_0xd652('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd652('0x8')](',\x20');logger['error'](config[_0xd652('0x6')][_0xd652('0x7')],_0xd652('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x47b2fe){return AES_SUPPORTED_RX[_0xd652('0xa')](_0x47b2fe);}function getSupportedCiphers(){return crypto[_0xd652('0xb')]()[_0xd652('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x54bed6){return getSupportedCiphers()[_0xd652('0xd')](_0x54bed6)>-0x1;}function combineOptions(_0x24c483){var _0x1fdc70={};for(var _0x30d612 in fileOptions){if(fileOptions[_0xd652('0xe')](_0x30d612)){_0x1fdc70[_0x30d612]=fileOptions[_0x30d612];}}if(_0x24c483){for(var _0x57f9ef in _0x24c483){if(_0x24c483[_0xd652('0xe')](_0x57f9ef)){_0x1fdc70[_0x57f9ef]=_0x24c483[_0x57f9ef];}}}return _0x1fdc70;}exports['encryptFile']=function(_0x2bd406,_0x150c48,_0x4b5e7e,_0x2a5b08){return new BPromise(function(_0x5f162e,_0x364f52){_0x2a5b08=combineOptions(_0x2a5b08);var _0xea7c13=new Buffer(_0x4b5e7e);var _0x21bacf=fs['createReadStream'](_0x2bd406);var _0x32358b=fs[_0xd652('0xf')](_0x150c48);var _0x35cdb2=crypto[_0xd652('0x10')](_0x2a5b08[_0xd652('0x7')],_0xea7c13);_0x21bacf['on'](_0xd652('0x11'),function(_0x232c27){var _0x14241d=new Buffer(_0x35cdb2[_0xd652('0x12')](_0x232c27),_0xd652('0x13'));_0x32358b[_0xd652('0x14')](_0x14241d);});_0x21bacf['on'](_0xd652('0x15'),function(){try{var _0x252ec3=new Buffer(_0x35cdb2[_0xd652('0x16')](_0xd652('0x13')),_0xd652('0x13'));_0x32358b[_0xd652('0x14')](_0x252ec3);_0x32358b[_0xd652('0x15')]();_0x32358b['on'](_0xd652('0x17'),function(){return _0x5f162e(_0x150c48);});}catch(_0x5d7c80){fs['unlink'](_0x150c48);return _0x364f52(_0x5d7c80);}});});};exports[_0xd652('0x18')]=function(_0xdb821,_0x117189,_0x496eb4,_0x1b2858){return new BPromise(function(_0x34f5e5,_0x24e491){_0x1b2858=combineOptions(_0x1b2858);var _0x491d28=new Buffer(_0x496eb4);var _0x5ca09c=fs[_0xd652('0x19')](_0xdb821);var _0x381bc8=fs[_0xd652('0xf')](_0x117189);var _0x29982e=crypto[_0xd652('0x1a')](_0x1b2858['algorithm'],_0x491d28);_0x5ca09c['on'](_0xd652('0x11'),function(_0x133296){var _0x1a13bb=new Buffer(_0x29982e[_0xd652('0x12')](_0x133296),_0xd652('0x13'));_0x381bc8[_0xd652('0x14')](_0x1a13bb);});_0x5ca09c['on']('end',function(){try{var _0x4893d0=new Buffer(_0x29982e['final'](_0xd652('0x13')),'binary');_0x381bc8[_0xd652('0x14')](_0x4893d0);_0x381bc8['end']();_0x381bc8['on'](_0xd652('0x17'),function(){return _0x34f5e5(_0x117189);});}catch(_0x522ce0){fs[_0xd652('0x1b')](_0x117189);return _0x24e491(_0x522ce0);}});});};exports[_0xd652('0x1c')]=function(_0x106810,_0x3561fc,_0x313a4d){var _0x3c3094=_0x313a4d||stringOptions['algorithm'];var _0x184448=_0x3561fc||stringOptions[_0xd652('0x1d')];var _0x462011=crypto['createCipher'](_0x3c3094,_0x184448);var _0xb92a3a=_0x462011['update'](_0x106810,_0xd652('0x1e'),'base64');_0xb92a3a+=_0x462011[_0xd652('0x16')]('base64');return _0xb92a3a;};exports[_0xd652('0x1f')]=function(_0x3bba07,_0x2316d9,_0x5d82f4){var _0xea994f=_0x5d82f4||stringOptions[_0xd652('0x7')];var _0x42166c=_0x2316d9||stringOptions[_0xd652('0x1d')];var _0x547041=crypto['createDecipher'](_0xea994f,_0x42166c);var _0x38fbb2=_0x547041[_0xd652('0x12')](_0x3bba07,_0xd652('0x20'),'utf8');_0x38fbb2+=_0x547041['final'](_0xd652('0x1e'));return _0x38fbb2;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9bc525f..10e054e 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 _0xc22a=['join','each','%s%d.%s','%s.%s','csv','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','length','range','isInteger','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync'];(function(_0x59b2d4,_0x377360){var _0x24ff66=function(_0x4d83ed){while(--_0x4d83ed){_0x59b2d4['push'](_0x59b2d4['shift']());}};_0x24ff66(++_0x377360);}(_0xc22a,0xf3));var _0xac22=function(_0x5de1f1,_0x9d93eb){_0x5de1f1=_0x5de1f1-0x0;var _0x147d75=_0xc22a[_0x5de1f1];return _0x147d75;};'use strict';var util=require(_0xac22('0x0'));var path=require(_0xac22('0x1'));var _=require(_0xac22('0x2'));var csv=require(_0xac22('0x3'));var fs=require('fs');var BPromise=require(_0xac22('0x4'));var zipdir=require(_0xac22('0x5'));var rimraf=require('rimraf');var db=require(_0xac22('0x6'))['db'];var dbH=require('../../mysqldb')[_0xac22('0x7')];var logger=require(_0xac22('0x8'))(_0xac22('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xac22('0xa')][0x2]);var QUERY=process[_0xac22('0xa')][0x3];var PATH=process[_0xac22('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c540b,_0x9cadc4){var _0x52a195={'status':_0x4c540b};var _0x388e1f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x9cadc4){_0x52a195['savename']=_0x9cadc4;}return db['AnalyticExtractedReport']['update'](_0x52a195,_0x388e1f);}function main(){var _0x1ca428=0x1388;var _0x38c64d;logger[_0xac22('0xb')](util[_0xac22('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xac22('0xd')));return db[_0xac22('0xe')][_0xac22('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xac22('0x10'),_0xac22('0x11')]})[_0xac22('0x12')](function(_0x1372ca){if(_0x1372ca){_0x38c64d=_0x1372ca;_0x1ca428=_0x38c64d[_0xac22('0x11')]||0x1388;}})[_0xac22('0x12')](function(){return dbH[_0xac22('0x13')]['query'](util['format'](_0xac22('0x14'),QUERY),{'type':dbH[_0xac22('0x13')]['QueryTypes'][_0xac22('0x15')]});})[_0xac22('0x12')](function(_0x164c26){if(!_0x164c26[0x0]['num']){return analyticExtractedReport('Empty');}var _0x24461e=[];var _0x2afc71=0x0;if(_0x38c64d[_0xac22('0x10')]){if(_0x164c26&&_0x164c26[_0xac22('0x16')]){var _0xdc214f=_[_0xac22('0x17')](_0x164c26[0x0]['num']/_0x1ca428);var _0x19b9fe=Number[_0xac22('0x18')](_0x164c26[0x0][_0xac22('0x19')]/_0x1ca428)?_0x164c26[0x0]['num']%_0x1ca428:0x0;_0xdc214f[_0xac22('0x1a')](function(_0x13c752){if(_0x13c752>0x0){_0x2afc71+=_0x1ca428;}_0x24461e['push'](dbH[_0xac22('0x13')]['query'](util[_0xac22('0xc')](_0xac22('0x1b'),QUERY,_0x1ca428,_0x2afc71),{'type':dbH[_0xac22('0x13')]['QueryTypes'][_0xac22('0x15')]}));});if(_0x19b9fe>0x0){_0x2afc71+=_0x1ca428;_0x24461e[_0xac22('0x1c')](dbH[_0xac22('0x13')]['query'](util[_0xac22('0xc')](_0xac22('0x1b'),QUERY,_0x19b9fe,_0x2afc71),{'type':dbH[_0xac22('0x13')]['QueryTypes'][_0xac22('0x15')]}));}}}else{_0x24461e[_0xac22('0x1c')](dbH[_0xac22('0x13')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x1e1697=path[_0xac22('0x1d')](PATH);var _0x26ec05=path[_0xac22('0x1e')](PATH,_0xac22('0x1f'));var _0x154944=_0x38c64d['split']&&_0x24461e['length']>0x1;var _0x4361b4=[];if(!fs[_0xac22('0x20')](path['join'](_0x1e1697,_0x26ec05))&&_0x154944){fs['mkdirSync'](path[_0xac22('0x21')](_0x1e1697,_0x26ec05));}return BPromise[_0xac22('0x22')](_0x24461e,function(_0x27394e){_0x4361b4[_0xac22('0x1c')](_0x27394e);})[_0xac22('0x12')](function(){for(var _0x39793f=0x0;_0x39793f<_0x4361b4[_0xac22('0x16')];_0x39793f+=0x1){var _0x14a890;var _0x211583=_0x4361b4[_0x39793f];if(_0x154944){_0x14a890=path[_0xac22('0x21')](_0x1e1697,_0x26ec05,util[_0xac22('0xc')](_0xac22('0x23'),_0x26ec05,_0x39793f,'csv'));}else{_0x14a890=path[_0xac22('0x21')](_0x1e1697,util[_0xac22('0xc')](_0xac22('0x24'),_0x26ec05,_0xac22('0x25')));}fs['writeFileSync'](_0x14a890,csv(_0x211583));}})['then'](function(){if(_0x154944){return new Promise(function(_0xef61ba){zipdir(path[_0xac22('0x21')](_0x1e1697,_0x26ec05),{'saveTo':path[_0xac22('0x21')](_0x1e1697,util[_0xac22('0xc')]('%s.%s',_0x26ec05,_0xac22('0x26')))},function(_0x34ac93,_0x1546c6){rimraf(path[_0xac22('0x21')](_0x1e1697,_0x26ec05),function(){});_0xef61ba(_0xac22('0x27'));});});}})[_0xac22('0x12')](function(){logger[_0xac22('0xb')](util[_0xac22('0xc')](_0xac22('0x28'),EXTRACTED_REPORT_ID,_0xac22('0xd')));return analyticExtractedReport('Completed',_0x154944?util[_0xac22('0xc')]('%s.%s',_0x26ec05,_0x154944?_0xac22('0x26'):_0xac22('0x25')):null);});})[_0xac22('0x29')](function(_0x22af4a){logger[_0xac22('0xb')](util[_0xac22('0xc')](_0xac22('0x2a'),EXTRACTED_REPORT_ID,_0xac22('0xd')),util[_0xac22('0x2b')](_0x22af4a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xac22('0x2c'));})[_0xac22('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x090a=['split','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x156e53,_0x1905ba){var _0x143b87=function(_0x3dec9c){while(--_0x3dec9c){_0x156e53['push'](_0x156e53['shift']());}};_0x143b87(++_0x1905ba);}(_0x090a,0x79));var _0xa090=function(_0xc5d10,_0x2847ec){_0xc5d10=_0xc5d10-0x0;var _0x104d98=_0x090a[_0xc5d10];return _0x104d98;};'use strict';var util=require(_0xa090('0x0'));var path=require(_0xa090('0x1'));var _=require(_0xa090('0x2'));var csv=require(_0xa090('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xa090('0x4'));var rimraf=require(_0xa090('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa090('0x6'))['dbH'];var logger=require(_0xa090('0x7'))(_0xa090('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa090('0x9')][0x2]);var QUERY=process[_0xa090('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d8eec,_0xe9ea31){var _0x11359d={'status':_0x3d8eec};var _0x10db78={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe9ea31){_0x11359d[_0xa090('0xa')]=_0xe9ea31;}return db[_0xa090('0xb')][_0xa090('0xc')](_0x11359d,_0x10db78);}function main(){var _0x4822a2=0x1388;var _0x2ded94;logger['info'](util[_0xa090('0xd')](_0xa090('0xe'),EXTRACTED_REPORT_ID,_0xa090('0xf')));return db[_0xa090('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x11f7cf){if(_0x11f7cf){_0x2ded94=_0x11f7cf;_0x4822a2=_0x2ded94[_0xa090('0x11')]||0x1388;}})[_0xa090('0x12')](function(){return dbH[_0xa090('0x13')]['query'](util[_0xa090('0xd')](_0xa090('0x14'),QUERY),{'type':dbH[_0xa090('0x13')][_0xa090('0x15')][_0xa090('0x16')]});})[_0xa090('0x12')](function(_0x31c088){if(!_0x31c088[0x0]['num']){return analyticExtractedReport('Empty');}var _0x2257ab=[];var _0x2f7b84=0x0;if(_0x2ded94[_0xa090('0x17')]){if(_0x31c088&&_0x31c088[_0xa090('0x18')]){var _0x3d6f8b=_[_0xa090('0x19')](_0x31c088[0x0][_0xa090('0x1a')]/_0x4822a2);var _0x5403dc=Number[_0xa090('0x1b')](_0x31c088[0x0][_0xa090('0x1a')]/_0x4822a2)?_0x31c088[0x0]['num']%_0x4822a2:0x0;_0x3d6f8b[_0xa090('0x1c')](function(_0x400bbf){if(_0x400bbf>0x0){_0x2f7b84+=_0x4822a2;}_0x2257ab[_0xa090('0x1d')](dbH['sequelize'][_0xa090('0x1e')](util[_0xa090('0xd')](_0xa090('0x1f'),QUERY,_0x4822a2,_0x2f7b84),{'type':dbH[_0xa090('0x13')]['QueryTypes'][_0xa090('0x16')]}));});if(_0x5403dc>0x0){_0x2f7b84+=_0x4822a2;_0x2257ab[_0xa090('0x1d')](dbH['sequelize'][_0xa090('0x1e')](util[_0xa090('0xd')](_0xa090('0x1f'),QUERY,_0x5403dc,_0x2f7b84),{'type':dbH[_0xa090('0x13')]['QueryTypes'][_0xa090('0x16')]}));}}}else{_0x2257ab[_0xa090('0x1d')](dbH['sequelize'][_0xa090('0x1e')](QUERY,{'type':dbH['sequelize'][_0xa090('0x15')][_0xa090('0x16')]}));}var _0x39eb82=path[_0xa090('0x20')](PATH);var _0x1e5fb1=path['basename'](PATH,'.csv');var _0x10bf18=_0x2ded94[_0xa090('0x17')]&&_0x2257ab[_0xa090('0x18')]>0x1;var _0x44f2aa=[];if(!fs[_0xa090('0x21')](path[_0xa090('0x22')](_0x39eb82,_0x1e5fb1))&&_0x10bf18){fs['mkdirSync'](path[_0xa090('0x22')](_0x39eb82,_0x1e5fb1));}return BPromise['each'](_0x2257ab,function(_0x3b5a89){_0x44f2aa[_0xa090('0x1d')](_0x3b5a89);})[_0xa090('0x12')](function(){for(var _0x528cc1=0x0;_0x528cc1<_0x44f2aa['length'];_0x528cc1+=0x1){var _0x46aaa2;var _0x422a60=_0x44f2aa[_0x528cc1];if(_0x10bf18){_0x46aaa2=path[_0xa090('0x22')](_0x39eb82,_0x1e5fb1,util[_0xa090('0xd')](_0xa090('0x23'),_0x1e5fb1,_0x528cc1,_0xa090('0x24')));}else{_0x46aaa2=path['join'](_0x39eb82,util['format']('%s.%s',_0x1e5fb1,_0xa090('0x24')));}fs[_0xa090('0x25')](_0x46aaa2,csv(_0x422a60));}})['then'](function(){if(_0x10bf18){return new Promise(function(_0x3f2a7a){zipdir(path['join'](_0x39eb82,_0x1e5fb1),{'saveTo':path[_0xa090('0x22')](_0x39eb82,util[_0xa090('0xd')](_0xa090('0x26'),_0x1e5fb1,_0xa090('0x27')))},function(_0x3c5027,_0x38de76){rimraf(path[_0xa090('0x22')](_0x39eb82,_0x1e5fb1),function(){});_0x3f2a7a(_0xa090('0x28'));});});}})[_0xa090('0x12')](function(){logger[_0xa090('0x29')](util['format'](_0xa090('0x2a'),EXTRACTED_REPORT_ID,_0xa090('0xf')));return analyticExtractedReport(_0xa090('0x2b'),_0x10bf18?util[_0xa090('0xd')](_0xa090('0x26'),_0x1e5fb1,_0x10bf18?_0xa090('0x27'):'csv'):null);});})['catch'](function(_0x378dea){logger[_0xa090('0x29')](util[_0xa090('0xd')](_0xa090('0x2c'),EXTRACTED_REPORT_ID,_0xa090('0xf')),util[_0xa090('0x2d')](_0x378dea,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa090('0x2e'));})['finally'](function(){process[_0xa090('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0080423..83ab8ab 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 _0xf4e9=['Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','fill','length','auto','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer'];(function(_0x3aedb5,_0x1e0f78){var _0x1d0bf8=function(_0x23d418){while(--_0x23d418){_0x3aedb5['push'](_0x3aedb5['shift']());}};_0x1d0bf8(++_0x1e0f78);}(_0xf4e9,0x8d));var _0x9f4e=function(_0x5233fd,_0x13b2fc){_0x5233fd=_0x5233fd-0x0;var _0x1b596b=_0xf4e9[_0x5233fd];return _0x1b596b;};'use strict';var _=require(_0x9f4e('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x9f4e('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x9f4e('0x2'));var PdfPrinter=require(_0x9f4e('0x3'));var zipdir=require(_0x9f4e('0x4'));var rimraf=require(_0x9f4e('0x5'));var JSDOM=require(_0x9f4e('0x6'))[_0x9f4e('0x7')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x9f4e('0x8'))['db'];var dbH=require(_0x9f4e('0x8'))[_0x9f4e('0x9')];var logger=require('../../config/logger')(_0x9f4e('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9f4e('0xb')][0x3];var PATH=process[_0x9f4e('0xb')][0x4];var NAME=process[_0x9f4e('0xb')][0x5];var FORMAT=_0x9f4e('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x507f30,_0x3a3fd3){var _0x3de6ec={'status':_0x507f30};var _0x254bb7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a3fd3){_0x3de6ec[_0x9f4e('0xd')]=_0x3a3fd3;}return db['AnalyticExtractedReport'][_0x9f4e('0xe')](_0x3de6ec,_0x254bb7);}function getHeaders(_0x1dd2a3){return _[_0x9f4e('0xf')](_0x1dd2a3,function(_0x5b266e){return{'text':_0x5b266e,'style':_0x9f4e('0x10')};});}function getRows(_0x1b4fa6,_0x18734f){return _[_0x9f4e('0xf')](_0x18734f,function(_0x69c963){return _(_0x69c963)['pick'](_0x1b4fa6)[_0x9f4e('0xf')](function(_0x380ffd){return _0x380ffd?_[_0x9f4e('0x11')](_0x380ffd):'';})['value']();});}function createTable(_0x48f98a,_0xfb1604){var _0x51467b={'widths':_[_0x9f4e('0x12')](Array(_0x48f98a[_0x9f4e('0x13')]),0x91),'heights':function(_0x21548c){return _0x21548c===0x0?_0x9f4e('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x41a730=getHeaders(_0x48f98a);_0x51467b[_0x9f4e('0x15')][_0x9f4e('0x16')](_0x41a730);var _0x1a53f2=getRows(_0x48f98a,_0xfb1604);_0x51467b[_0x9f4e('0x15')]=_0x51467b[_0x9f4e('0x15')][_0x9f4e('0x17')](_0x1a53f2);return _0x51467b;}function createTables(_0x46ee36){var _0x55eb84=[];var _0x4143c6=_[_0x9f4e('0x18')](Object['keys'](_0x46ee36[0x0]),0x5);_0x4143c6[_0x9f4e('0x19')](function(_0x39b1fc){_0x55eb84[_0x9f4e('0x16')](createTable(_0x39b1fc,_0x46ee36));});return _0x55eb84;}function getPDFDocDefinition(_0x46bb87){var _0x521123=util[_0x9f4e('0x1a')](_0x9f4e('0x1b'),NAME,EXTRACTED_REPORT[_0x9f4e('0x1c')],moment(EXTRACTED_REPORT[_0x9f4e('0x1d')])[_0x9f4e('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x9f4e('0x1e')])[_0x9f4e('0x1a')](FORMAT));var _0x11c5ae=[];for(var _0x461a50=0x0;_0x461a50<_0x46bb87[_0x9f4e('0x13')];_0x461a50++){var _0x5a9836=[];if(_0x461a50===0x0){_0x5a9836[_0x9f4e('0x16')]({'text':_0x521123,'style':'header'});}var _0x420f27={'table':_0x46bb87[_0x461a50]};if(_0x461a50>0x0){_0x420f27[_0x9f4e('0x1f')]=_0x9f4e('0x20');_0x420f27[_0x9f4e('0x21')]=[0x0,0x46,0x0,0x0];}_0x5a9836['push'](_0x420f27);_0x11c5ae['push'](_0x5a9836);}return{'pageSize':'A4','pageOrientation':_0x9f4e('0x22'),'content':_0x11c5ae,'footer':function(_0x2b216e,_0x2beaad){return{'text':_0x2b216e[_0x9f4e('0x11')]()+_0x9f4e('0x23')+_0x2beaad,'style':_0x9f4e('0x24')};},'defaultStyle':{'font':_0x9f4e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x9f4e('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20300c){var _0x5e0006=0x1388;var _0x34aabc;if(!_0x20300c[0x0][_0x9f4e('0x27')]){return analyticExtractedReport(_0x9f4e('0x28'));}return db[_0x9f4e('0x29')][_0x9f4e('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9f4e('0x2b'),_0x9f4e('0x2c')]})['then'](function(_0x57e34c){if(_0x57e34c){_0x34aabc=_0x57e34c;_0x5e0006=_0x34aabc[_0x9f4e('0x2c')]||0x3e8;}})[_0x9f4e('0x2d')](function(){var _0x1ab038=[];var _0x13ad2b=0x0;if(_0x34aabc[_0x9f4e('0x2b')]){if(_0x20300c&&_0x20300c['length']){var _0x2656ca=_[_0x9f4e('0x2e')](_0x20300c[0x0][_0x9f4e('0x27')]/_0x5e0006);var _0x580af5=Number[_0x9f4e('0x2f')](_0x20300c[0x0][_0x9f4e('0x27')]/_0x5e0006)?_0x20300c[0x0][_0x9f4e('0x27')]%_0x5e0006:0x0;_0x2656ca['forEach'](function(_0x1b7ab8){if(_0x1b7ab8>0x0){_0x13ad2b+=_0x5e0006;}_0x1ab038['push'](dbH[_0x9f4e('0x30')][_0x9f4e('0x31')](util[_0x9f4e('0x1a')](_0x9f4e('0x32'),QUERY,_0x5e0006,_0x13ad2b),{'type':dbH[_0x9f4e('0x30')][_0x9f4e('0x33')][_0x9f4e('0x34')]}));});if(_0x580af5>0x0){_0x13ad2b+=_0x5e0006;_0x1ab038[_0x9f4e('0x16')](dbH[_0x9f4e('0x30')][_0x9f4e('0x31')](util['format'](_0x9f4e('0x32'),QUERY,_0x580af5,_0x13ad2b),{'type':dbH['sequelize'][_0x9f4e('0x33')][_0x9f4e('0x34')]}));}}}else{_0x1ab038[_0x9f4e('0x16')](dbH['sequelize'][_0x9f4e('0x31')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x9f4e('0x34')]}));}var _0x16571d=path[_0x9f4e('0x35')](PATH);var _0x5a191b=path[_0x9f4e('0x36')](PATH,_0x9f4e('0x37'));var _0x57ee77=_0x34aabc[_0x9f4e('0x2b')]&&_0x1ab038[_0x9f4e('0x13')]>0x1;var _0x35c4ce=[];if(!fs[_0x9f4e('0x38')](path[_0x9f4e('0x39')](_0x16571d,_0x5a191b))&&_0x57ee77){fs['mkdirSync'](path[_0x9f4e('0x39')](_0x16571d,_0x5a191b));}return BPromise[_0x9f4e('0x3a')](_0x1ab038,function(_0x5f2d64){_0x35c4ce[_0x9f4e('0x16')](_0x5f2d64);})[_0x9f4e('0x2d')](function(){var _0x3bb927=[];for(var _0x4e0776=0x0;_0x4e0776<_0x35c4ce[_0x9f4e('0x13')];_0x4e0776+=0x1){var _0x1592e3=_0x35c4ce[_0x4e0776];var _0x4214aa=createTables(_[_0x9f4e('0x3b')](_0x1592e3));var _0xa01e2d;var _0x4b50d6=getPDFDocDefinition(_0x4214aa);var _0x14070c=getPDFPrinter();var _0x5075c1=_0x14070c[_0x9f4e('0x3c')](_0x4b50d6);if(_0x57ee77){_0xa01e2d=path[_0x9f4e('0x39')](_0x16571d,_0x5a191b,util[_0x9f4e('0x1a')](_0x9f4e('0x3d'),_0x5a191b,_0x4e0776,_0x9f4e('0x3e')));}else{_0xa01e2d=path[_0x9f4e('0x39')](_0x16571d,util[_0x9f4e('0x1a')](_0x9f4e('0x3f'),_0x5a191b,_0x9f4e('0x3e')));}_0x3bb927[_0x9f4e('0x16')](writePDFDocument(_0x5075c1,_0xa01e2d));}return Promise['all'](_0x3bb927);})[_0x9f4e('0x2d')](function(){if(_0x57ee77){return new Promise(function(_0x962bd6){zipdir(path[_0x9f4e('0x39')](_0x16571d,_0x5a191b),{'saveTo':path[_0x9f4e('0x39')](_0x16571d,util[_0x9f4e('0x1a')](_0x9f4e('0x3f'),_0x5a191b,_0x9f4e('0x40')))},function(){rimraf(path[_0x9f4e('0x39')](_0x16571d,_0x5a191b),function(){});_0x962bd6('zip\x20finished');});});}})[_0x9f4e('0x2d')](function(){if(!_0x57ee77)return;rimraf(path['join'](_0x16571d,_0x5a191b),function(){});})['then'](function(){logger[_0x9f4e('0x41')](util[_0x9f4e('0x1a')](_0x9f4e('0x42'),EXTRACTED_REPORT_ID,_0x9f4e('0x43')));return analyticExtractedReport(_0x9f4e('0x44'),_0x57ee77?util['format'](_0x9f4e('0x3f'),_0x5a191b,_0x57ee77?_0x9f4e('0x40'):_0x9f4e('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x9f4e('0x1a')](_0x9f4e('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x9f4e('0x46')][_0x9f4e('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9f4e('0x2d')](function(_0x3b53c9){EXTRACTED_REPORT=_0x3b53c9;return dbH[_0x9f4e('0x30')][_0x9f4e('0x31')](util[_0x9f4e('0x1a')](_0x9f4e('0x48'),QUERY),{'type':dbH[_0x9f4e('0x30')][_0x9f4e('0x33')][_0x9f4e('0x34')]});})[_0x9f4e('0x2d')](extractReport)[_0x9f4e('0x49')](function(_0x34dfd2){logger[_0x9f4e('0x41')](util[_0x9f4e('0x1a')](_0x9f4e('0x4a'),EXTRACTED_REPORT_ID,'PDF'),util[_0x9f4e('0x4b')](_0x34dfd2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9f4e('0x4c')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x244d9d=new PdfPrinter({'Arial':{'normal':__dirname+_0x9f4e('0x4d'),'bold':__dirname+_0x9f4e('0x4e'),'italics':__dirname+_0x9f4e('0x4f'),'bolditalics':__dirname+_0x9f4e('0x50')}});return _0x244d9d;}function getPDFDocDefinitionFromHTML(_0x5d1680,_0x8334c5){var _0x1060ba=util[_0x9f4e('0x1a')](_0x9f4e('0x51'),_0x8334c5['channel'],_0x8334c5[_0x9f4e('0x52')]);var _0x55c924=moment()[_0x9f4e('0x1a')](_0x9f4e('0x53'))[_0x9f4e('0x11')]();var _0xffd287=htmlToPdfmake(_0x5d1680,{'window':window,'tableAutoSize':!![]});return{'content':[_0xffd287],'defaultStyle':{'font':_0x9f4e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9f4e('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9f4e('0x54')}},'header':function(){return[{'text':_0x9f4e('0x55'),'style':'header'}];},'footer':function(_0x604fd9,_0x5491fd){return[{'text':util['format'](_0x9f4e('0x56'),_0x1060ba,_0x604fd9,_0x5491fd,_0x55c924),'style':_0x9f4e('0x24')}];}};}function writePDFDocument(_0x39005a,_0x9f8d97){return new Promise(function(_0xfafa3a,_0x3ef208){var _0x244831=_0x39005a['pipe'](fs['createWriteStream'](_0x9f8d97));_0x244831['on'](_0x9f4e('0x57'),function(){_0xfafa3a(_0x9f4e('0x57'));});_0x244831['on'](_0x9f4e('0x58'),function(_0x562dcd){_0x3ef208(_0x562dcd);});_0x39005a['end']();});}exports['createPdfFromHTML']=function(_0x260a4f,_0x19153e){var _0x567e1d=getPDFPrinter();var _0x509021=getPDFDocDefinitionFromHTML(_0x260a4f,_0x19153e);var _0x21e114=_0x567e1d['createPdfKitDocument'](_0x509021);return writePDFDocument(_0x21e114,_0x19153e[_0x9f4e('0x1')])[_0x9f4e('0x49')](function(_0x580ad8){throw _0x580ad8;});}; \ No newline at end of file +var _0x3ba3=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','jsdom','window','bluebird','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','map','tableHeader','toString','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','splitSizePdf','split','range','isInteger','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','query','SELECT','QueryTypes','.pdf','join','each','then','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip'];(function(_0x41fbbb,_0x1fb472){var _0x4e5ba0=function(_0x5e2cc3){while(--_0x5e2cc3){_0x41fbbb['push'](_0x41fbbb['shift']());}};_0x4e5ba0(++_0x1fb472);}(_0x3ba3,0x1c6));var _0x33ba=function(_0x5bda8c,_0x275ef0){_0x5bda8c=_0x5bda8c-0x0;var _0x2b80f0=_0x3ba3[_0x5bda8c];return _0x2b80f0;};'use strict';var _=require(_0x33ba('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x33ba('0x1'));var moment=require(_0x33ba('0x2'));var htmlToPdfmake=require(_0x33ba('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x33ba('0x4'))['JSDOM'];var window=new JSDOM('')[_0x33ba('0x5')];var BPromise=require(_0x33ba('0x6'));var db=require(_0x33ba('0x7'))['db'];var dbH=require(_0x33ba('0x7'))['dbH'];var logger=require(_0x33ba('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x33ba('0x9')][0x2]);var QUERY=process[_0x33ba('0x9')][0x3];var PATH=process[_0x33ba('0x9')][0x4];var NAME=process[_0x33ba('0x9')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x492ad9,_0x2b3143){var _0x20f85d={'status':_0x492ad9};var _0x43599c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b3143){_0x20f85d[_0x33ba('0xa')]=_0x2b3143;}return db[_0x33ba('0xb')]['update'](_0x20f85d,_0x43599c);}function getHeaders(_0x477f79){return _[_0x33ba('0xc')](_0x477f79,function(_0x3266f2){return{'text':_0x3266f2,'style':_0x33ba('0xd')};});}function getRows(_0xbe480c,_0x1c2934){return _[_0x33ba('0xc')](_0x1c2934,function(_0x504cc0){return _(_0x504cc0)['pick'](_0xbe480c)[_0x33ba('0xc')](function(_0x49ced9){return _0x49ced9?_[_0x33ba('0xe')](_0x49ced9):'';})['value']();});}function createTable(_0x20d295,_0x4c6d7e){var _0x322db5={'widths':_[_0x33ba('0xf')](Array(_0x20d295[_0x33ba('0x10')]),0x91),'heights':function(_0x19335f){return _0x19335f===0x0?_0x33ba('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x44211f=getHeaders(_0x20d295);_0x322db5[_0x33ba('0x12')][_0x33ba('0x13')](_0x44211f);var _0x1b8e16=getRows(_0x20d295,_0x4c6d7e);_0x322db5[_0x33ba('0x12')]=_0x322db5['body'][_0x33ba('0x14')](_0x1b8e16);return _0x322db5;}function createTables(_0x424c13){var _0x4f446d=[];var _0x380dc8=_[_0x33ba('0x15')](Object[_0x33ba('0x16')](_0x424c13[0x0]),0x5);_0x380dc8[_0x33ba('0x17')](function(_0x1ed749){_0x4f446d[_0x33ba('0x13')](createTable(_0x1ed749,_0x424c13));});return _0x4f446d;}function getPDFDocDefinition(_0x39efeb){var _0x4ad16b=util[_0x33ba('0x18')](_0x33ba('0x19'),NAME,EXTRACTED_REPORT[_0x33ba('0x1a')],moment(EXTRACTED_REPORT[_0x33ba('0x1b')])[_0x33ba('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x33ba('0x1c')])[_0x33ba('0x18')](FORMAT));var _0x3e05d7=[];for(var _0x3489f4=0x0;_0x3489f4<_0x39efeb['length'];_0x3489f4++){var _0x57504e=[];if(_0x3489f4===0x0){_0x57504e[_0x33ba('0x13')]({'text':_0x4ad16b,'style':_0x33ba('0x1d')});}var _0x268ebc={'table':_0x39efeb[_0x3489f4]};if(_0x3489f4>0x0){_0x268ebc[_0x33ba('0x1e')]=_0x33ba('0x1f');_0x268ebc[_0x33ba('0x20')]=[0x0,0x46,0x0,0x0];}_0x57504e['push'](_0x268ebc);_0x3e05d7[_0x33ba('0x13')](_0x57504e);}return{'pageSize':'A4','pageOrientation':_0x33ba('0x21'),'content':_0x3e05d7,'footer':function(_0x28874a,_0x56c7e7){return{'text':_0x28874a[_0x33ba('0xe')]()+_0x33ba('0x22')+_0x56c7e7,'style':_0x33ba('0x23')};},'defaultStyle':{'font':_0x33ba('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x33ba('0x25')},'footer':{'alignment':_0x33ba('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1d7046){var _0x30a15d=0x1388;var _0x19a93e;if(!_0x1d7046[0x0]['num']){return analyticExtractedReport(_0x33ba('0x27'));}return db[_0x33ba('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x33ba('0x29')]})['then'](function(_0x28635f){if(_0x28635f){_0x19a93e=_0x28635f;_0x30a15d=_0x19a93e['splitSizePdf']||0x3e8;}})['then'](function(){var _0x3e40c1=[];var _0xa2b332=0x0;if(_0x19a93e[_0x33ba('0x2a')]){if(_0x1d7046&&_0x1d7046['length']){var _0x3ad87d=_[_0x33ba('0x2b')](_0x1d7046[0x0]['num']/_0x30a15d);var _0x207880=Number[_0x33ba('0x2c')](_0x1d7046[0x0][_0x33ba('0x2d')]/_0x30a15d)?_0x1d7046[0x0][_0x33ba('0x2d')]%_0x30a15d:0x0;_0x3ad87d[_0x33ba('0x17')](function(_0x5e28c7){if(_0x5e28c7>0x0){_0xa2b332+=_0x30a15d;}_0x3e40c1[_0x33ba('0x13')](dbH[_0x33ba('0x2e')]['query'](util['format'](_0x33ba('0x2f'),QUERY,_0x30a15d,_0xa2b332),{'type':dbH[_0x33ba('0x2e')]['QueryTypes']['SELECT']}));});if(_0x207880>0x0){_0xa2b332+=_0x30a15d;_0x3e40c1['push'](dbH[_0x33ba('0x2e')][_0x33ba('0x30')](util[_0x33ba('0x18')](_0x33ba('0x2f'),QUERY,_0x207880,_0xa2b332),{'type':dbH[_0x33ba('0x2e')]['QueryTypes'][_0x33ba('0x31')]}));}}}else{_0x3e40c1[_0x33ba('0x13')](dbH[_0x33ba('0x2e')][_0x33ba('0x30')](QUERY,{'type':dbH[_0x33ba('0x2e')][_0x33ba('0x32')]['SELECT']}));}var _0x5f4ec6=path['dirname'](PATH);var _0x41102e=path['basename'](PATH,_0x33ba('0x33'));var _0x41ea2c=_0x19a93e[_0x33ba('0x2a')]&&_0x3e40c1[_0x33ba('0x10')]>0x1;var _0x303e97=[];if(!fs['existsSync'](path[_0x33ba('0x34')](_0x5f4ec6,_0x41102e))&&_0x41ea2c){fs['mkdirSync'](path[_0x33ba('0x34')](_0x5f4ec6,_0x41102e));}return BPromise[_0x33ba('0x35')](_0x3e40c1,function(_0x367dec){_0x303e97['push'](_0x367dec);})[_0x33ba('0x36')](function(){var _0x520faa=[];for(var _0x5c6f17=0x0;_0x5c6f17<_0x303e97[_0x33ba('0x10')];_0x5c6f17+=0x1){var _0x49d76c=_0x303e97[_0x5c6f17];var _0x20f3ff=createTables(_[_0x33ba('0x37')](_0x49d76c));var _0x42b17c;var _0x2af2bf=getPDFDocDefinition(_0x20f3ff);var _0x5a2a44=getPDFPrinter();var _0x507a51=_0x5a2a44[_0x33ba('0x38')](_0x2af2bf);if(_0x41ea2c){_0x42b17c=path[_0x33ba('0x34')](_0x5f4ec6,_0x41102e,util['format'](_0x33ba('0x39'),_0x41102e,_0x5c6f17,_0x33ba('0x3a')));}else{_0x42b17c=path[_0x33ba('0x34')](_0x5f4ec6,util[_0x33ba('0x18')](_0x33ba('0x3b'),_0x41102e,'pdf'));}_0x520faa['push'](writePDFDocument(_0x507a51,_0x42b17c));}return Promise[_0x33ba('0x3c')](_0x520faa);})['then'](function(){if(_0x41ea2c){return new Promise(function(_0x2111e5){zipdir(path['join'](_0x5f4ec6,_0x41102e),{'saveTo':path['join'](_0x5f4ec6,util['format'](_0x33ba('0x3b'),_0x41102e,_0x33ba('0x3d')))},function(){rimraf(path[_0x33ba('0x34')](_0x5f4ec6,_0x41102e),function(){});_0x2111e5('zip\x20finished');});});}})[_0x33ba('0x36')](function(){if(!_0x41ea2c)return;rimraf(path[_0x33ba('0x34')](_0x5f4ec6,_0x41102e),function(){});})['then'](function(){logger['info'](util[_0x33ba('0x18')](_0x33ba('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x33ba('0x3f'),_0x41ea2c?util[_0x33ba('0x18')]('%s.%s',_0x41102e,_0x41ea2c?_0x33ba('0x3d'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x33ba('0x40')](util[_0x33ba('0x18')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x33ba('0x41')));return db['AnalyticExtractedReport'][_0x33ba('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x33ba('0x36')](function(_0xbf4b2e){EXTRACTED_REPORT=_0xbf4b2e;return dbH['sequelize'][_0x33ba('0x30')](util[_0x33ba('0x18')](_0x33ba('0x43'),QUERY),{'type':dbH[_0x33ba('0x2e')][_0x33ba('0x32')][_0x33ba('0x31')]});})[_0x33ba('0x36')](extractReport)[_0x33ba('0x44')](function(_0x1ee270){logger[_0x33ba('0x40')](util[_0x33ba('0x18')](_0x33ba('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0x33ba('0x46')](_0x1ee270,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x33ba('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4a0c4c=new PdfPrinter({'Arial':{'normal':__dirname+_0x33ba('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x33ba('0x49'),'bolditalics':__dirname+_0x33ba('0x4a')}});return _0x4a0c4c;}function getPDFDocDefinitionFromHTML(_0x44141d,_0x3e44ba){var _0x5d7efc=util[_0x33ba('0x18')](_0x33ba('0x4b'),_0x3e44ba[_0x33ba('0x4c')],_0x3e44ba[_0x33ba('0x4d')]);var _0x47c7b1=moment()[_0x33ba('0x18')](_0x33ba('0x4e'))[_0x33ba('0xe')]();var _0x292559=htmlToPdfmake(_0x44141d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x292559],'defaultStyle':{'font':_0x33ba('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x33ba('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x33ba('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x33ba('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x3cb9c7,_0x3ab61d){return[{'text':util[_0x33ba('0x18')](_0x33ba('0x50'),_0x5d7efc,_0x3cb9c7,_0x3ab61d,_0x47c7b1),'style':_0x33ba('0x23')}];}};}function writePDFDocument(_0x16d86d,_0x35bccd){return new Promise(function(_0x57b6e3,_0x196c87){var _0x588819=_0x16d86d[_0x33ba('0x51')](fs[_0x33ba('0x52')](_0x35bccd));_0x588819['on'](_0x33ba('0x53'),function(){_0x57b6e3('finish');});_0x588819['on']('error',function(_0x3f7d35){_0x196c87(_0x3f7d35);});_0x16d86d[_0x33ba('0x54')]();});}exports[_0x33ba('0x55')]=function(_0xc86fdc,_0x2cb571){var _0x2ac1e8=getPDFPrinter();var _0x170faf=getPDFDocDefinitionFromHTML(_0xc86fdc,_0x2cb571);var _0x5459dd=_0x2ac1e8[_0x33ba('0x38')](_0x170faf);return writePDFDocument(_0x5459dd,_0x2cb571[_0x33ba('0x1')])[_0x33ba('0x44')](function(_0x26b982){throw _0x26b982;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ba8aa5f..d2d0fac 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 _0xc13c=['%s%d.%s','xlsx','join','writeFileSync','%s.%s','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','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','.xlsx','existsSync','mkdirSync','each','length'];(function(_0x4a787c,_0x1171c9){var _0x37d585=function(_0x3d8782){while(--_0x3d8782){_0x4a787c['push'](_0x4a787c['shift']());}};_0x37d585(++_0x1171c9);}(_0xc13c,0x155));var _0xcc13=function(_0x570195,_0x5a30b3){_0x570195=_0x570195-0x0;var _0xbf388c=_0xc13c[_0x570195];return _0xbf388c;};'use strict';var util=require(_0xcc13('0x0'));var path=require(_0xcc13('0x1'));var _=require(_0xcc13('0x2'));var fs=require('fs');var json2xls=require(_0xcc13('0x3'));var BPromise=require(_0xcc13('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xcc13('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xcc13('0x6'))[_0xcc13('0x7')];var logger=require(_0xcc13('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcc13('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x31e64d,_0x1adeb7){var _0x33c1fa={'status':_0x31e64d};var _0x235120={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1adeb7){_0x33c1fa[_0xcc13('0xa')]=_0x1adeb7;}return db[_0xcc13('0xb')][_0xcc13('0xc')](_0x33c1fa,_0x235120);}function main(){var _0x350358=0x1388;var _0x39798a;logger[_0xcc13('0xd')](util[_0xcc13('0xe')](_0xcc13('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xcc13('0x10')][_0xcc13('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcc13('0x12'),'splitSizeXlsx']})[_0xcc13('0x13')](function(_0x7f1c61){if(_0x7f1c61){_0x39798a=_0x7f1c61;_0x350358=_0x39798a['splitSizeXlsx']||0x1388;}})[_0xcc13('0x13')](function(){return dbH[_0xcc13('0x14')]['query'](util['format'](_0xcc13('0x15'),QUERY),{'type':dbH[_0xcc13('0x14')][_0xcc13('0x16')]['SELECT']});})[_0xcc13('0x13')](function(_0x3bc039){if(!_0x3bc039[0x0][_0xcc13('0x17')]){return analyticExtractedReport(_0xcc13('0x18'));}var _0x4d5370=[];var _0x3463a0=0x0;if(_0x39798a[_0xcc13('0x12')]){if(_0x3bc039&&_0x3bc039['length']){var _0x4f5870=_[_0xcc13('0x19')](_0x3bc039[0x0][_0xcc13('0x17')]/_0x350358);var _0x4681cd=Number['isInteger'](_0x3bc039[0x0][_0xcc13('0x17')]/_0x350358)?_0x3bc039[0x0][_0xcc13('0x17')]%_0x350358:0x0;_0x4f5870['forEach'](function(_0x1be2ac){if(_0x1be2ac>0x0){_0x3463a0+=_0x350358;}_0x4d5370[_0xcc13('0x1a')](dbH[_0xcc13('0x14')][_0xcc13('0x1b')](util[_0xcc13('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x350358,_0x3463a0),{'type':dbH[_0xcc13('0x14')][_0xcc13('0x16')]['SELECT']}));});if(_0x4681cd>0x0){_0x3463a0+=_0x350358;_0x4d5370[_0xcc13('0x1a')](dbH[_0xcc13('0x14')]['query'](util[_0xcc13('0xe')](_0xcc13('0x1c'),QUERY,_0x4681cd,_0x3463a0),{'type':dbH[_0xcc13('0x14')][_0xcc13('0x16')][_0xcc13('0x1d')]}));}}}else{_0x4d5370[_0xcc13('0x1a')](dbH[_0xcc13('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0xcc13('0x16')][_0xcc13('0x1d')]}));}var _0xb88ec7=path['dirname'](PATH);var _0x52b296=path['basename'](PATH,_0xcc13('0x1e'));var _0x31136b=_0x39798a['split']&&_0x4d5370['length']>0x1;var _0x2bc82b=[];if(!fs[_0xcc13('0x1f')](path['join'](_0xb88ec7,_0x52b296))&&_0x31136b){fs[_0xcc13('0x20')](path['join'](_0xb88ec7,_0x52b296));}return BPromise[_0xcc13('0x21')](_0x4d5370,function(_0x484650){_0x2bc82b[_0xcc13('0x1a')](_0x484650);})[_0xcc13('0x13')](function(){for(var _0x525b32=0x0;_0x525b32<_0x2bc82b[_0xcc13('0x22')];_0x525b32+=0x1){var _0x15877b;var _0x503082=_0x2bc82b[_0x525b32];if(_0x31136b){_0x15877b=path['join'](_0xb88ec7,_0x52b296,util[_0xcc13('0xe')](_0xcc13('0x23'),_0x52b296,_0x525b32,_0xcc13('0x24')));}else{_0x15877b=path[_0xcc13('0x25')](_0xb88ec7,util['format']('%s.%s',_0x52b296,_0xcc13('0x24')));}fs[_0xcc13('0x26')](_0x15877b,json2xls(_0x503082),'binary');}})[_0xcc13('0x13')](function(){if(_0x31136b){return new Promise(function(_0x35f5c8){zipdir(path['join'](_0xb88ec7,_0x52b296),{'saveTo':path[_0xcc13('0x25')](_0xb88ec7,util['format'](_0xcc13('0x27'),_0x52b296,'zip'))},function(_0x5e157a,_0x4132fd){rimraf(path[_0xcc13('0x25')](_0xb88ec7,_0x52b296),function(){});_0x35f5c8('zip\x20finished');});});}})['then'](function(){logger[_0xcc13('0xd')](util[_0xcc13('0xe')](_0xcc13('0x28'),EXTRACTED_REPORT_ID,_0xcc13('0x29')));return analyticExtractedReport('Completed',_0x31136b?util[_0xcc13('0xe')]('%s.%s',_0x52b296,_0x31136b?'zip':'xlsx'):null);});})[_0xcc13('0x2a')](function(_0x5804cf){logger[_0xcc13('0xd')](util[_0xcc13('0xe')](_0xcc13('0x2b'),EXTRACTED_REPORT_ID,_0xcc13('0x29')),util[_0xcc13('0x2c')](_0x5804cf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcc13('0x2d'));})[_0xcc13('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x658b=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','info','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','Failed','finally','exit','util','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format'];(function(_0x53c368,_0x4ea2f3){var _0x109bda=function(_0x29fb58){while(--_0x29fb58){_0x53c368['push'](_0x53c368['shift']());}};_0x109bda(++_0x4ea2f3);}(_0x658b,0x11f));var _0xb658=function(_0x209108,_0x45ffa0){_0x209108=_0x209108-0x0;var _0x4bbfc8=_0x658b[_0x209108];return _0x4bbfc8;};'use strict';var util=require(_0xb658('0x0'));var path=require(_0xb658('0x1'));var _=require(_0xb658('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xb658('0x3'));var rimraf=require(_0xb658('0x4'));var db=require(_0xb658('0x5'))['db'];var dbH=require(_0xb658('0x5'))[_0xb658('0x6')];var logger=require('../../config/logger')(_0xb658('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb658('0x8')][0x3];var PATH=process[_0xb658('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c9b81,_0x963306){var _0x1749f1={'status':_0x1c9b81};var _0x4edfce={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x963306){_0x1749f1[_0xb658('0x9')]=_0x963306;}return db[_0xb658('0xa')][_0xb658('0xb')](_0x1749f1,_0x4edfce);}function main(){var _0x2116d6=0x1388;var _0x1a728f;logger['info'](util[_0xb658('0xc')](_0xb658('0xd'),EXTRACTED_REPORT_ID,_0xb658('0xe')));return db[_0xb658('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb658('0x10'),_0xb658('0x11')]})['then'](function(_0xef22dd){if(_0xef22dd){_0x1a728f=_0xef22dd;_0x2116d6=_0x1a728f[_0xb658('0x11')]||0x1388;}})[_0xb658('0x12')](function(){return dbH[_0xb658('0x13')][_0xb658('0x14')](util[_0xb658('0xc')](_0xb658('0x15'),QUERY),{'type':dbH[_0xb658('0x13')][_0xb658('0x16')][_0xb658('0x17')]});})[_0xb658('0x12')](function(_0x54a98c){if(!_0x54a98c[0x0][_0xb658('0x18')]){return analyticExtractedReport('Empty');}var _0x200b37=[];var _0x36914d=0x0;if(_0x1a728f[_0xb658('0x10')]){if(_0x54a98c&&_0x54a98c[_0xb658('0x19')]){var _0x230fc7=_[_0xb658('0x1a')](_0x54a98c[0x0][_0xb658('0x18')]/_0x2116d6);var _0x2b392a=Number[_0xb658('0x1b')](_0x54a98c[0x0][_0xb658('0x18')]/_0x2116d6)?_0x54a98c[0x0]['num']%_0x2116d6:0x0;_0x230fc7[_0xb658('0x1c')](function(_0x6e00ca){if(_0x6e00ca>0x0){_0x36914d+=_0x2116d6;}_0x200b37[_0xb658('0x1d')](dbH[_0xb658('0x13')]['query'](util[_0xb658('0xc')](_0xb658('0x1e'),QUERY,_0x2116d6,_0x36914d),{'type':dbH[_0xb658('0x13')][_0xb658('0x16')][_0xb658('0x17')]}));});if(_0x2b392a>0x0){_0x36914d+=_0x2116d6;_0x200b37[_0xb658('0x1d')](dbH[_0xb658('0x13')][_0xb658('0x14')](util['format'](_0xb658('0x1e'),QUERY,_0x2b392a,_0x36914d),{'type':dbH[_0xb658('0x13')][_0xb658('0x16')]['SELECT']}));}}}else{_0x200b37[_0xb658('0x1d')](dbH[_0xb658('0x13')][_0xb658('0x14')](QUERY,{'type':dbH[_0xb658('0x13')][_0xb658('0x16')][_0xb658('0x17')]}));}var _0x3d2bc6=path[_0xb658('0x1f')](PATH);var _0x5ef234=path['basename'](PATH,_0xb658('0x20'));var _0x39dc3f=_0x1a728f[_0xb658('0x10')]&&_0x200b37['length']>0x1;var _0x149646=[];if(!fs[_0xb658('0x21')](path[_0xb658('0x22')](_0x3d2bc6,_0x5ef234))&&_0x39dc3f){fs[_0xb658('0x23')](path[_0xb658('0x22')](_0x3d2bc6,_0x5ef234));}return BPromise['each'](_0x200b37,function(_0x1de541){_0x149646[_0xb658('0x1d')](_0x1de541);})[_0xb658('0x12')](function(){for(var _0x1b51a2=0x0;_0x1b51a2<_0x149646[_0xb658('0x19')];_0x1b51a2+=0x1){var _0x1fad46;var _0x49aa37=_0x149646[_0x1b51a2];if(_0x39dc3f){_0x1fad46=path[_0xb658('0x22')](_0x3d2bc6,_0x5ef234,util[_0xb658('0xc')](_0xb658('0x24'),_0x5ef234,_0x1b51a2,_0xb658('0x25')));}else{_0x1fad46=path[_0xb658('0x22')](_0x3d2bc6,util[_0xb658('0xc')](_0xb658('0x26'),_0x5ef234,'xlsx'));}fs['writeFileSync'](_0x1fad46,json2xls(_0x49aa37),_0xb658('0x27'));}})['then'](function(){if(_0x39dc3f){return new Promise(function(_0x123ddc){zipdir(path[_0xb658('0x22')](_0x3d2bc6,_0x5ef234),{'saveTo':path[_0xb658('0x22')](_0x3d2bc6,util[_0xb658('0xc')](_0xb658('0x26'),_0x5ef234,_0xb658('0x28')))},function(_0x3b73f7,_0x2c4879){rimraf(path[_0xb658('0x22')](_0x3d2bc6,_0x5ef234),function(){});_0x123ddc(_0xb658('0x29'));});});}})['then'](function(){logger[_0xb658('0x2a')](util[_0xb658('0xc')](_0xb658('0x2b'),EXTRACTED_REPORT_ID,_0xb658('0xe')));return analyticExtractedReport(_0xb658('0x2c'),_0x39dc3f?util[_0xb658('0xc')](_0xb658('0x26'),_0x5ef234,_0x39dc3f?_0xb658('0x28'):_0xb658('0x25')):null);});})[_0xb658('0x2d')](function(_0x482b7a){logger[_0xb658('0x2a')](util[_0xb658('0xc')](_0xb658('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x482b7a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb658('0x2f'));})[_0xb658('0x30')](function(){process[_0xb658('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ff3a845..6c1309d 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 _0xfb79=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','playback','hasOwnProperty','priority','extension','extensions','push','Set','format','CDR(type)=%s','type','context','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfb79,0x1b0));var _0x9fb7=function(_0xe616b6,_0x1bf3de){_0xe616b6=_0xe616b6-0x0;var _0x1e4ec1=_0xfb79[_0xe616b6];return _0x1e4ec1;};'use strict';var _=require(_0x9fb7('0x0'));var util=require('util');function rewrite(_0x153131,_0x16715d){var _0x56e73e=this;return _0x153131[_0x9fb7('0x1')][_0x9fb7('0x2')][_0x9fb7('0x3')]({'raw':!![]})[_0x9fb7('0x4')](function(_0x48c8cc){_0x56e73e[_0x9fb7('0x5')]=_0x48c8cc;return _0x153131['models']['VoiceExtension'][_0x9fb7('0x3')]({'where':{'IntervalId':_0x16715d[_0x9fb7('0x6')]},'raw':!![]});})['then'](function(_0x116777){return _0x153131['models'][_0x9fb7('0x7')][_0x9fb7('0x3')]({'where':{'exten':{'$in':_[_0x9fb7('0x8')](_[_0x9fb7('0x9')](_0x116777,'exten'))}},'order':[{'raw':_0x9fb7('0xa')}],'raw':!![]});})[_0x9fb7('0x4')](function(_0x123cbe){var _0x1a048a=_[_0x9fb7('0xb')](_0x123cbe,{'priority':'1'});var _0x51300c=_[_0x9fb7('0xb')](_0x123cbe,{'isApp':0x1});var _0x1ad23d=_['groupBy'](_0x51300c,_0x9fb7('0xc'));var _0x582006=['queue',_0x9fb7('0xd')];var _0x59b17c=[];var _0x1eb781=[];for(var _0x597817 in _0x1ad23d){if(_0x1ad23d[_0x9fb7('0xe')](_0x597817)){_0x56e73e[_0x9fb7('0xf')]=0x2;_0x56e73e['extensions']=[];_0x56e73e[_0x9fb7('0x10')]=_['find'](_0x1a048a,{'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')]});_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0]['type'],'app':_0x9fb7('0x13'),'appdata':util[_0x9fb7('0x14')](_0x9fb7('0x15'),_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')]),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0]['VoiceExtensionId']});if(_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')]==='inbound'){_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x18')+_0x1ad23d[_0x597817][0x0]['VoiceExtensionId'],'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});}else if(_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')]===_0x9fb7('0x1a')){if(_0x56e73e[_0x9fb7('0x10')]){_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':'Set','appdata':_0x9fb7('0x1b')+(_0x56e73e[_0x9fb7('0x10')][_0x9fb7('0x1c')]?_0x9fb7('0x1d')+_0x56e73e[_0x9fb7('0x10')][_0x9fb7('0x1c')]+'}':_0x9fb7('0x1e')),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});}_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x18')+_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')],'context':_0x1ad23d[_0x597817][0x0]['context'],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e['priority']++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});var _0x35aa07=_0x56e73e[_0x9fb7('0xf')]++;_0x56e73e[_0x9fb7('0x11')]['push']({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x1f'),'appdata':_0x9fb7('0x20')+(_0x35aa07+0x2)+'):Goto('+(_0x35aa07+0x1)+')','context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x35aa07,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0]['VoiceExtensionId']});if(_0x56e73e[_0x9fb7('0x10')]){_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0]['type'],'app':_0x9fb7('0x13'),'appdata':_0x56e73e[_0x9fb7('0x10')][_0x9fb7('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x56e73e[_0x9fb7('0x10')][_0x9fb7('0x1c')]+'}':_0x9fb7('0x21'),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0]['exten'],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0]['VoiceExtensionId']});}_0x56e73e['extensions'][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x22')+_0x1ad23d[_0x597817][0x0]['VoiceExtensionId'],'context':_0x1ad23d[_0x597817][0x0]['context'],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});if(_0x56e73e[_0x9fb7('0x10')]&&_0x56e73e[_0x9fb7('0x10')][_0x9fb7('0xe')](_0x9fb7('0x23'))&&_0x56e73e[_0x9fb7('0x10')]['recordingFormat']!==_0x9fb7('0x24')){_0x56e73e['extensions'][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x25'),'context':_0x1ad23d[_0x597817][0x0]['context'],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});_0x56e73e['extensions'][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':'Set','appdata':_0x9fb7('0x26')+_0x56e73e[_0x9fb7('0x10')]['recordingFormat']||_0x9fb7('0x27'),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});}}_0x56e73e['extensions']['push']({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x28'),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e[_0x9fb7('0xf')]++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});_0x56e73e['extensions'][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0]['type'],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x29'),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e['priority']++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0]['VoiceExtensionId']});_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x2a'),'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'priority':_0x56e73e['priority']++,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});for(var _0x1589ff=0x0,_0x44831d=0x0;_0x1589ff<_0x1ad23d[_0x597817][_0x9fb7('0x2b')];_0x1589ff+=0x1,_0x44831d=0x0){var _0x4f28a1=_0x1ad23d[_0x597817][_0x1589ff];if(_0x4f28a1[_0x9fb7('0x16')]){_0x4f28a1[_0x9fb7('0x16')]=_0x4f28a1[_0x9fb7('0x16')][_0x9fb7('0x2c')]();}var _0x18b3a9=[];var _0x57efb5=[];delete _0x4f28a1['id'];delete _0x4f28a1[_0x9fb7('0x2d')];delete _0x4f28a1[_0x9fb7('0x2e')];var _0x48e2d5=_0x4f28a1['interval']!==_0x9fb7('0x2f')?[_0x4f28a1[_0x9fb7('0x30')]]:_0x4f28a1['IntervalId']?_[_0x9fb7('0x9')](_['filter'](_0x56e73e['intervals'],{'IntervalId':_0x4f28a1[_0x9fb7('0x6')]}),'interval'):[];if(_0x4f28a1[_0x9fb7('0xe')](_0x9fb7('0x31'))){if(_0x4f28a1[_0x9fb7('0x31')]&&_0x4f28a1[_0x9fb7('0x31')]!=='--'){_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':'Set','appdata':'CDR(tag)='+_0x4f28a1[_0x9fb7('0x31')],'context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5[_0x9fb7('0x2b')]+_0x56e73e[_0x9fb7('0xf')]+_0x44831d++,'VoiceExtensionId':_0x4f28a1[_0x9fb7('0x19')]});}}if(_0x4f28a1['type']===_0x9fb7('0x1a')&&_0x4f28a1[_0x9fb7('0xe')](_0x9fb7('0x32'))){if(_0x4f28a1[_0x9fb7('0x32')]){_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':_0x9fb7('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x4f28a1[_0x9fb7('0x32')]+')','context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5['length']+_0x56e73e[_0x9fb7('0xf')]+_0x44831d++,'VoiceExtensionId':_0x4f28a1['VoiceExtensionId']});}else{_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':'ExecIf','appdata':_0x9fb7('0x33'),'context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5[_0x9fb7('0x2b')]+_0x56e73e['priority']+_0x44831d++,'VoiceExtensionId':_0x4f28a1['VoiceExtensionId']});}}if(_0x4f28a1['hasOwnProperty'](_0x9fb7('0x34'))){if(_0x582006['indexOf'](_0x4f28a1[_0x9fb7('0x35')]['toLowerCase']())>=0x0&&_0x4f28a1['appType']!==_0x9fb7('0x36')){if(_0x4f28a1['answer']){_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':_0x9fb7('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5[_0x9fb7('0x2b')]+_0x56e73e[_0x9fb7('0xf')]+_0x44831d++,'VoiceExtensionId':_0x4f28a1[_0x9fb7('0x19')]});_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':_0x9fb7('0x13'),'appdata':_0x9fb7('0x37'),'context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5[_0x9fb7('0x2b')]+_0x56e73e[_0x9fb7('0xf')]+_0x44831d++,'VoiceExtensionId':_0x4f28a1[_0x9fb7('0x19')]});}else{_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':_0x9fb7('0x1f'),'appdata':_0x9fb7('0x38'),'context':_0x4f28a1[_0x9fb7('0x17')],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5['length']+_0x56e73e['priority']+_0x44831d++,'VoiceExtensionId':_0x4f28a1['VoiceExtensionId']});_0x18b3a9[_0x9fb7('0x12')]({'type':_0x4f28a1[_0x9fb7('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4f28a1['context'],'exten':_0x4f28a1[_0x9fb7('0xc')],'priority':_0x48e2d5[_0x9fb7('0x2b')]+_0x56e73e[_0x9fb7('0xf')]+_0x44831d++,'VoiceExtensionId':_0x4f28a1['VoiceExtensionId']});}}}for(var _0x2b5550=0x0;_0x2b5550<_0x48e2d5[_0x9fb7('0x2b')];_0x2b5550+=0x1){var _0x4368da=_0x56e73e[_0x9fb7('0xf')]+_0x48e2d5['length'];var _0x4c581a=_0x2b5550===_0x48e2d5[_0x9fb7('0x2b')]-0x1?_0x56e73e['priority']+_0x18b3a9[_0x9fb7('0x2b')]+_0x57efb5[_0x9fb7('0x2b')]+0x2:_0x56e73e[_0x9fb7('0xf')]+_0x2b5550+0x1;_0x18b3a9[_0x9fb7('0x39')](_0x2b5550,0x0,{'type':_0x4f28a1[_0x9fb7('0x16')],'app':_0x9fb7('0x3a'),'appdata':_0x48e2d5[_0x2b5550]+'?'+_0x4f28a1[_0x9fb7('0x17')]+_0x9fb7('0x3b')+_0x4368da+':'+_0x4f28a1[_0x9fb7('0x17')]+_0x9fb7('0x3b')+_0x4c581a,'exten':_0x4f28a1[_0x9fb7('0xc')],'context':_0x4f28a1['context'],'priority':_0x56e73e[_0x9fb7('0xf')]+_0x2b5550,'VoiceExtensionId':_0x1ad23d[_0x597817][0x0]['VoiceExtensionId']});}_0x4f28a1[_0x9fb7('0xf')]=_0x18b3a9['length']?_[_0x9fb7('0x3c')](_0x18b3a9)['priority']+0x1:_0x56e73e['priority'];_0x56e73e[_0x9fb7('0xf')]=(_0x57efb5[_0x9fb7('0x2b')]?_[_0x9fb7('0x3c')](_0x57efb5)[_0x9fb7('0xf')]:_0x4f28a1[_0x9fb7('0xf')])+0x1;_0x56e73e['extensions']=_[_0x9fb7('0x3d')](_0x56e73e['extensions'],_0x18b3a9,[_0x4f28a1],_0x57efb5);}_0x56e73e[_0x9fb7('0x11')][_0x9fb7('0x12')]({'type':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x16')],'app':'Hangup','exten':_0x1ad23d[_0x597817][0x0][_0x9fb7('0xc')],'context':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x17')],'priority':_0x56e73e[_0x9fb7('0xf')],'VoiceExtensionId':_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]});_0x59b17c[_0x9fb7('0x12')](_0x1ad23d[_0x597817][0x0][_0x9fb7('0x19')]);_0x1eb781=_[_0x9fb7('0x3d')](_0x1eb781,_0x56e73e[_0x9fb7('0x11')]);}}return _0x153131['transaction'](function(_0x1a062e){return _0x153131[_0x9fb7('0x1')][_0x9fb7('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x59b17c}},'transaction':_0x1a062e})['then'](function(_0x3162f8){return _0x153131['models'][_0x9fb7('0x7')][_0x9fb7('0x3e')](_[_0x9fb7('0x3f')](_0x1eb781,_0x9fb7('0xf')),{'transaction':_0x1a062e});});});})[_0x9fb7('0x40')](function(_0xd9ffc3){console[_0x9fb7('0x41')](_0xd9ffc3);});}exports[_0x9fb7('0x42')]=rewrite; \ No newline at end of file +var _0x670a=['recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','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','toLowerCase','appType','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','sortBy','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','extension','extensions','push','type','Set','format','CDR(type)=%s','context','priority','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid='];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x670a,0xe6));var _0xa670=function(_0x3a673f,_0x13ef77){_0x3a673f=_0x3a673f-0x0;var _0x123c74=_0x670a[_0x3a673f];return _0x123c74;};'use strict';var _=require(_0xa670('0x0'));var util=require(_0xa670('0x1'));function rewrite(_0x49dab4,_0x38f657){var _0x438bc5=this;return _0x49dab4[_0xa670('0x2')][_0xa670('0x3')][_0xa670('0x4')]({'raw':!![]})[_0xa670('0x5')](function(_0x5680d6){_0x438bc5['intervals']=_0x5680d6;return _0x49dab4[_0xa670('0x2')][_0xa670('0x6')][_0xa670('0x4')]({'where':{'IntervalId':_0x38f657[_0xa670('0x7')]},'raw':!![]});})[_0xa670('0x5')](function(_0x2d7f12){return _0x49dab4['models'][_0xa670('0x6')][_0xa670('0x4')]({'where':{'exten':{'$in':_[_0xa670('0x8')](_[_0xa670('0x9')](_0x2d7f12,_0xa670('0xa')))}},'order':[{'raw':_0xa670('0xb')}],'raw':!![]});})['then'](function(_0x39060e){var _0x34a445=_[_0xa670('0xc')](_0x39060e,{'priority':'1'});var _0x21b2cd=_[_0xa670('0xc')](_0x39060e,{'isApp':0x1});var _0x38727e=_['groupBy'](_0x21b2cd,'exten');var _0x56ab9b=[_0xa670('0xd'),'playback'];var _0x451fd5=[];var _0x18f7a6=[];for(var _0x345df8 in _0x38727e){if(_0x38727e[_0xa670('0xe')](_0x345df8)){_0x438bc5['priority']=0x2;_0x438bc5['extensions']=[];_0x438bc5[_0xa670('0xf')]=_['find'](_0x34a445,{'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')]});_0x438bc5[_0xa670('0x10')][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':util[_0xa670('0x14')](_0xa670('0x15'),_0x38727e[_0x345df8][0x0]['type']),'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0]['VoiceExtensionId']});if(_0x38727e[_0x345df8][0x0][_0xa670('0x12')]==='inbound'){_0x438bc5[_0xa670('0x10')]['push']({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x18')+_0x38727e[_0x345df8][0x0][_0xa670('0x19')],'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5['priority']++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});}else if(_0x38727e[_0x345df8][0x0][_0xa670('0x12')]===_0xa670('0x1a')){if(_0x438bc5[_0xa670('0xf')]){_0x438bc5['extensions']['push']({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':'Set','appdata':'CDR(destination)='+(_0x438bc5['extension'][_0xa670('0x1b')]?_0xa670('0x1c')+_0x438bc5[_0xa670('0xf')][_0xa670('0x1b')]+'}':_0xa670('0x1d')),'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0]['VoiceExtensionId']});}_0x438bc5['extensions'][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0]['type'],'app':_0xa670('0x13'),'appdata':_0xa670('0x18')+_0x38727e[_0x345df8][0x0][_0xa670('0x19')],'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});var _0x30913a=_0x438bc5[_0xa670('0x17')]++;_0x438bc5['extensions'][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0]['type'],'app':_0xa670('0x1e'),'appdata':_0xa670('0x1f')+(_0x30913a+0x2)+'):Goto('+(_0x30913a+0x1)+')','context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0]['exten'],'priority':_0x30913a,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});if(_0x438bc5[_0xa670('0xf')]){_0x438bc5[_0xa670('0x10')][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0x438bc5[_0xa670('0xf')][_0xa670('0x1b')]?_0xa670('0x20')+_0x438bc5['extension'][_0xa670('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});}_0x438bc5['extensions'][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x21')+_0x38727e[_0x345df8][0x0]['VoiceExtensionId'],'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0]['exten'],'priority':_0x438bc5['priority']++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});if(_0x438bc5['extension']&&_0x438bc5[_0xa670('0xf')]['hasOwnProperty'](_0xa670('0x22'))&&_0x438bc5['extension']['recordingFormat']!==_0xa670('0x23')){_0x438bc5[_0xa670('0x10')]['push']({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});_0x438bc5[_0xa670('0x10')]['push']({'type':_0x38727e[_0x345df8][0x0]['type'],'app':_0xa670('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x438bc5[_0xa670('0xf')][_0xa670('0x22')]||_0xa670('0x24'),'context':_0x38727e[_0x345df8][0x0]['context'],'exten':_0x38727e[_0x345df8][0x0]['exten'],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});}}_0x438bc5[_0xa670('0x10')][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x25'),'context':_0x38727e[_0x345df8][0x0]['context'],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});_0x438bc5[_0xa670('0x10')][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x26'),'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});_0x438bc5[_0xa670('0x10')]['push']({'type':_0x38727e[_0x345df8][0x0]['type'],'app':_0xa670('0x13'),'appdata':_0xa670('0x27'),'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'priority':_0x438bc5[_0xa670('0x17')]++,'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});for(var _0x2bd48e=0x0,_0x32db00=0x0;_0x2bd48e<_0x38727e[_0x345df8][_0xa670('0x28')];_0x2bd48e+=0x1,_0x32db00=0x0){var _0x3f843c=_0x38727e[_0x345df8][_0x2bd48e];if(_0x3f843c['type']){_0x3f843c[_0xa670('0x12')]=_0x3f843c['type']['toLowerCase']();}var _0x57715b=[];var _0x2e66c7=[];delete _0x3f843c['id'];delete _0x3f843c[_0xa670('0x29')];delete _0x3f843c['updatedAt'];var _0xcbf274=_0x3f843c[_0xa670('0x2a')]!==_0xa670('0x2b')?[_0x3f843c[_0xa670('0x2a')]]:_0x3f843c[_0xa670('0x7')]?_[_0xa670('0x9')](_[_0xa670('0xc')](_0x438bc5[_0xa670('0x2c')],{'IntervalId':_0x3f843c[_0xa670('0x7')]}),_0xa670('0x2a')):[];if(_0x3f843c[_0xa670('0xe')](_0xa670('0x2d'))){if(_0x3f843c[_0xa670('0x2d')]&&_0x3f843c[_0xa670('0x2d')]!=='--'){_0x57715b[_0xa670('0x11')]({'type':_0x3f843c[_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x2e')+_0x3f843c[_0xa670('0x2d')],'context':_0x3f843c['context'],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5['priority']+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});}}if(_0x3f843c[_0xa670('0x12')]===_0xa670('0x1a')&&_0x3f843c['hasOwnProperty']('callerID')){if(_0x3f843c[_0xa670('0x2f')]){_0x57715b[_0xa670('0x11')]({'type':_0x3f843c[_0xa670('0x12')],'app':_0xa670('0x1e'),'appdata':_0xa670('0x30')+_0x3f843c[_0xa670('0x2f')]+')','context':_0x3f843c[_0xa670('0x16')],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});}else{_0x57715b['push']({'type':_0x3f843c['type'],'app':_0xa670('0x1e'),'appdata':_0xa670('0x31'),'context':_0x3f843c[_0xa670('0x16')],'exten':_0x3f843c['exten'],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});}}if(_0x3f843c['hasOwnProperty'](_0xa670('0x32'))){if(_0x56ab9b[_0xa670('0x33')](_0x3f843c[_0xa670('0x34')][_0xa670('0x35')]())>=0x0&&_0x3f843c[_0xa670('0x36')]!==_0xa670('0x37')){if(_0x3f843c[_0xa670('0x32')]){_0x57715b['push']({'type':_0x3f843c[_0xa670('0x12')],'app':_0xa670('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3f843c[_0xa670('0x16')],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});_0x57715b['push']({'type':_0x3f843c[_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3f843c[_0xa670('0x16')],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});}else{_0x57715b[_0xa670('0x11')]({'type':_0x3f843c[_0xa670('0x12')],'app':'ExecIf','appdata':_0xa670('0x38'),'context':_0x3f843c['context'],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274[_0xa670('0x28')]+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});_0x57715b['push']({'type':_0x3f843c[_0xa670('0x12')],'app':_0xa670('0x13'),'appdata':_0xa670('0x39'),'context':_0x3f843c[_0xa670('0x16')],'exten':_0x3f843c[_0xa670('0xa')],'priority':_0xcbf274['length']+_0x438bc5[_0xa670('0x17')]+_0x32db00++,'VoiceExtensionId':_0x3f843c[_0xa670('0x19')]});}}}for(var _0x87a984=0x0;_0x87a984<_0xcbf274[_0xa670('0x28')];_0x87a984+=0x1){var _0x1cbae2=_0x438bc5[_0xa670('0x17')]+_0xcbf274[_0xa670('0x28')];var _0x584133=_0x87a984===_0xcbf274[_0xa670('0x28')]-0x1?_0x438bc5[_0xa670('0x17')]+_0x57715b[_0xa670('0x28')]+_0x2e66c7['length']+0x2:_0x438bc5[_0xa670('0x17')]+_0x87a984+0x1;_0x57715b[_0xa670('0x3a')](_0x87a984,0x0,{'type':_0x3f843c['type'],'app':'GotoIfTime','appdata':_0xcbf274[_0x87a984]+'?'+_0x3f843c['context']+_0xa670('0x3b')+_0x1cbae2+':'+_0x3f843c[_0xa670('0x16')]+_0xa670('0x3b')+_0x584133,'exten':_0x3f843c[_0xa670('0xa')],'context':_0x3f843c[_0xa670('0x16')],'priority':_0x438bc5[_0xa670('0x17')]+_0x87a984,'VoiceExtensionId':_0x38727e[_0x345df8][0x0]['VoiceExtensionId']});}_0x3f843c['priority']=_0x57715b[_0xa670('0x28')]?_[_0xa670('0x3c')](_0x57715b)[_0xa670('0x17')]+0x1:_0x438bc5['priority'];_0x438bc5[_0xa670('0x17')]=(_0x2e66c7[_0xa670('0x28')]?_[_0xa670('0x3c')](_0x2e66c7)[_0xa670('0x17')]:_0x3f843c[_0xa670('0x17')])+0x1;_0x438bc5[_0xa670('0x10')]=_[_0xa670('0x3d')](_0x438bc5[_0xa670('0x10')],_0x57715b,[_0x3f843c],_0x2e66c7);}_0x438bc5['extensions'][_0xa670('0x11')]({'type':_0x38727e[_0x345df8][0x0][_0xa670('0x12')],'app':_0xa670('0x3e'),'exten':_0x38727e[_0x345df8][0x0][_0xa670('0xa')],'context':_0x38727e[_0x345df8][0x0][_0xa670('0x16')],'priority':_0x438bc5[_0xa670('0x17')],'VoiceExtensionId':_0x38727e[_0x345df8][0x0][_0xa670('0x19')]});_0x451fd5[_0xa670('0x11')](_0x38727e[_0x345df8][0x0][_0xa670('0x19')]);_0x18f7a6=_[_0xa670('0x3d')](_0x18f7a6,_0x438bc5['extensions']);}}return _0x49dab4[_0xa670('0x3f')](function(_0x305175){return _0x49dab4[_0xa670('0x2')][_0xa670('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x451fd5}},'transaction':_0x305175})[_0xa670('0x5')](function(_0x2f8a4c){return _0x49dab4[_0xa670('0x2')][_0xa670('0x6')]['bulkCreate'](_[_0xa670('0x40')](_0x18f7a6,'priority'),{'transaction':_0x305175});});});})['catch'](function(_0x49f8da){console['error'](_0x49f8da);});}exports[_0xa670('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index ebb4397..c8a53e7 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 _0x0ea5=['stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','CmList','BlackLists','get','all','CampaignId','Campaign','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','ioredis','../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','then','pick'];(function(_0x2edbea,_0x3c2edf){var _0x4c2daa=function(_0x593642){while(--_0x593642){_0x2edbea['push'](_0x2edbea['shift']());}};_0x4c2daa(++_0x3c2edf);}(_0x0ea5,0x1e6));var _0x50ea=function(_0x519668,_0x1e77c3){_0x519668=_0x519668-0x0;var _0x5a9604=_0x0ea5[_0x519668];return _0x5a9604;};'use strict';var BPromise=require(_0x50ea('0x0'));var util=require(_0x50ea('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x50ea('0x2'));var Papa=require('papaparse');var Redis=require(_0x50ea('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x50ea('0x4'))(_0x50ea('0x5'));config['redis']=_[_0x50ea('0x6')](config[_0x50ea('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x50ea('0x8'))(new Redis(config[_0x50ea('0x7')]));require(_0x50ea('0x9'))[_0x50ea('0xa')](socket);try{if(!process['argv'][0x2]||process[_0x50ea('0xb')][0x2]===_0x50ea('0xc')||process[_0x50ea('0xb')][0x2]===_0x50ea('0xd')){throw new Error(_0x50ea('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x50ea('0xb')][0x3]||process['argv'][0x3]===_0x50ea('0xc')||process[_0x50ea('0xb')][0x3]===_0x50ea('0xd')||!process[_0x50ea('0xb')][0x4]||process[_0x50ea('0xb')][0x4]===_0x50ea('0xc')||process[_0x50ea('0xb')][0x4]===_0x50ea('0xd')){throw new Error(_0x50ea('0xf'));}var FIELDS=_['zipObject'](process[_0x50ea('0xb')][0x3][_0x50ea('0x10')](','),process[_0x50ea('0xb')][0x4][_0x50ea('0x10')](','));if(!process[_0x50ea('0xb')][0x5]||process['argv'][0x5]==='undefined'||process[_0x50ea('0xb')][0x5]===_0x50ea('0xd')){throw new Error(_0x50ea('0x11'));}var LISTID=process[_0x50ea('0xb')][0x5];var COMPANYID=process[_0x50ea('0xb')][0x6]&&process[_0x50ea('0xb')][0x6]!==_0x50ea('0xc')&&process['argv'][0x6]!==_0x50ea('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0x50ea('0xb')][0x7]&&process['argv'][0x7]!==_0x50ea('0xc')&&process[_0x50ea('0xb')][0x7]!==_0x50ea('0xd')?process[_0x50ea('0xb')][0x7]:null;if(!process[_0x50ea('0xb')][0x8]||process[_0x50ea('0xb')][0x8]===_0x50ea('0xc')||process[_0x50ea('0xb')][0x8]===_0x50ea('0xd')){throw new Error(_0x50ea('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5e7e2f){logger[_0x50ea('0x13')](_0x5e7e2f);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(_0xe7b8e9,_0x53767f,_0x1924bd,_0xfb4e25){var _0x17cac7={'message':_0x53767f};_0x17cac7[_0xe7b8e9]=!![];if(_0x1924bd){_0x17cac7[_0x50ea('0x14')]=_0x1924bd;}if(_0xfb4e25){_0x17cac7[_0x50ea('0x15')]=_0xfb4e25;}return _0x17cac7;}function isEmail(_0x161d04){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))*$/[_0x50ea('0x16')](_0x161d04);}function checkRow(_0x580dfe,_0x16bc37,_0x2fe87a){return new BPromise(function(_0x4303e9,_0x5722ae){if(_[_0x50ea('0x17')](_0x580dfe)){return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x2fe87a));}if(_0x580dfe[_0x50ea('0x18')]&&_0x580dfe['errors'][_0x50ea('0x19')]){var _0x567ae1=_['map'](_0x580dfe[_0x50ea('0x18')],_0x50ea('0x1a'))[_0x50ea('0x1b')](';');return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),_0x567ae1,null,_0x2fe87a));}var _0x4b2b14={};for(var _0x22f232 in FIELDS){if(FIELDS[_0x50ea('0x1c')](_0x22f232)&&FIELDS[_0x22f232]){_0x4b2b14[_0x22f232]=_0x580dfe[_0x50ea('0x1d')][0x0][FIELDS[_0x22f232]]||_0x580dfe[_0x50ea('0x1d')][0x0]['\ufeff'+FIELDS[_0x22f232]];}}if(!_0x4b2b14['firstName']){return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),_0x50ea('0x1e'),null,_0x2fe87a));}if(!_0x4b2b14[_0x50ea('0x1f')]){return _0x5722ae(handleCheckRowError('error',_0x50ea('0x20'),null,_0x2fe87a));}if(_0x4b2b14[_0x50ea('0x21')]){var _0x2a8386=moment(_0x4b2b14[_0x50ea('0x21')],_0x50ea('0x22'));if(!_0x2a8386[_0x50ea('0x23')]()){return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x2fe87a));}}if(_0x4b2b14[_0x50ea('0x24')]){if(!isEmail(_0x4b2b14['email'])){return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),_0x50ea('0x25'),null,_0x2fe87a));}}_0x4b2b14[_0x50ea('0x26')]=LISTID;_0x4b2b14[_0x50ea('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x50ea('0x19')]&&_0x16bc37){var _0x5c449d={};for(var _0x44ac6f=0x0,_0x21072c=DUPLICATES[_0x50ea('0x19')];_0x44ac6f<_0x21072c;_0x44ac6f+=0x1){_0x5c449d[DUPLICATES[_0x44ac6f]]=_0x4b2b14[DUPLICATES[_0x44ac6f]];}var _0x403aa8=_[_0x50ea('0x28')](_0x16bc37,_0x5c449d);if(_0x403aa8){return _0x5722ae(handleCheckRowError('duplicate',_0x50ea('0x29'),_0x403aa8,_0x2fe87a));}}return db['CmContact']['create'](_0x4b2b14,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4b2b14)})[_0x50ea('0x2a')](function(_0x22cf9a){if(DUPLICATES&&DUPLICATES[_0x50ea('0x19')]&&_0x16bc37){_0x16bc37['push'](_[_0x50ea('0x2b')](_0x4b2b14,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x22cf9a['id'];return _0x4303e9();})['catch'](function(_0xc7debf){return _0x5722ae(handleCheckRowError(_0x50ea('0x13'),'Error\x20while\x20creating\x20contact:\x20'+(_0xc7debf[_0x50ea('0x1a')]||JSON[_0x50ea('0x2c')](_0xc7debf)),null,_0x2fe87a));});});}function checkHopper(){function _0xc10ebb(){return function(_0x77e56){logger[_0x50ea('0x13')]('cmContact',_0x50ea('0x2d'),util[_0x50ea('0x2e')](_0x77e56,{'showHidden':![],'depth':null}));};}var _0x42f6b7=function(_0x3e4bab,_0x40ec73){var _0x34a402=squel[_0x50ea('0x2f')]()[_0x50ea('0x30')](_0x50ea('0x31'))[_0x50ea('0x32')]([_0x50ea('0x1f'),_0x50ea('0x33'),_0x50ea('0x34'),_0x50ea('0x26'),_0x40ec73,_0x50ea('0x35'),_0x50ea('0x36')],squel[_0x50ea('0x37')]()[_0x50ea('0x38')](_0x50ea('0x1f'),_0x50ea('0x1f'))[_0x50ea('0x38')](_0x50ea('0x39'),_0x50ea('0x33'))[_0x50ea('0x38')]('id',_0x50ea('0x34'))[_0x50ea('0x38')](LISTID[_0x50ea('0x3a')](),_0x50ea('0x26'))['field'](_0x3e4bab['id'][_0x50ea('0x3a')](),_0x40ec73)['field'](_0x50ea('0x39'),_0x50ea('0x35'))[_0x50ea('0x38')](_0x50ea('0x39'),_0x50ea('0x36'))[_0x50ea('0x3b')](_0x50ea('0x3c'))['where'](_0x50ea('0x3d'))[_0x50ea('0x3e')]('ListId\x20=\x20?',LISTID[_0x50ea('0x3a')]())[_0x50ea('0x3e')](_0x50ea('0x3f'))['where'](_0x50ea('0x40'),squel[_0x50ea('0x37')]()[_0x50ea('0x38')](_0x50ea('0x1f'))['from'](_0x50ea('0x31'))['where'](_0x40ec73+_0x50ea('0x41'),_0x3e4bab['id'][_0x50ea('0x3a')]())))['toString']();return _0x34a402;};var _0x4bab62=function(_0x581174,_0x412866){var _0x2c05ca=squel[_0x50ea('0x2f')]()['into'](_0x50ea('0x31'))[_0x50ea('0x32')]([_0x50ea('0x1f'),_0x50ea('0x33'),'ContactId',_0x50ea('0x26'),_0x412866,_0x50ea('0x35'),'updatedAt'],squel['select']()[_0x50ea('0x38')](_0x50ea('0x1f'),_0x50ea('0x1f'))[_0x50ea('0x38')]('NOW()','scheduledAt')[_0x50ea('0x38')]('id',_0x50ea('0x34'))['field'](LISTID['toString'](),_0x50ea('0x26'))[_0x50ea('0x38')](_0x581174['id'][_0x50ea('0x3a')](),_0x412866)['field'](_0x50ea('0x39'),_0x50ea('0x35'))['field']('NOW()',_0x50ea('0x36'))[_0x50ea('0x3b')]('cm_contacts')[_0x50ea('0x3e')](_0x50ea('0x3d'))[_0x50ea('0x3e')](_0x50ea('0x42'),LISTID['toString']())['where'](_0x50ea('0x43'),squel['str'](hopperContacts))[_0x50ea('0x3e')](_0x50ea('0x3f'))[_0x50ea('0x3e')](_0x50ea('0x40'),squel[_0x50ea('0x37')]()[_0x50ea('0x38')](_0x50ea('0x44'))[_0x50ea('0x3b')]('cm_hopper_final')[_0x50ea('0x3e')](_0x412866+_0x50ea('0x41'),_0x581174['id'][_0x50ea('0x3a')]()))[_0x50ea('0x3e')](_0x50ea('0x40'),squel[_0x50ea('0x37')]()['field'](_0x50ea('0x1f'))[_0x50ea('0x3b')](_0x50ea('0x31'))[_0x50ea('0x3e')](_0x412866+_0x50ea('0x41'),_0x581174['id'][_0x50ea('0x3a')]())))['toString']();return _0x2c05ca;};function _0xe1a8c1(_0x25e8dc,_0x1fa8cd){var _0x27e74b=squel[_0x50ea('0x2f')]()['into']('cm_hopper')['fromQuery']([_0x50ea('0x1f'),_0x50ea('0x33'),'ContactId',_0x50ea('0x26'),_0x1fa8cd,_0x50ea('0x35'),_0x50ea('0x36')],squel[_0x50ea('0x37')]()[_0x50ea('0x38')](_0x50ea('0x1f'),'phone')[_0x50ea('0x38')](_0x50ea('0x39'),_0x50ea('0x33'))['field']('id',_0x50ea('0x34'))['field'](LISTID[_0x50ea('0x3a')](),_0x50ea('0x26'))[_0x50ea('0x38')](_0x25e8dc['id'][_0x50ea('0x3a')](),_0x1fa8cd)[_0x50ea('0x38')](_0x50ea('0x39'),'createdAt')['field']('NOW()',_0x50ea('0x36'))[_0x50ea('0x3b')](_0x50ea('0x3c'))[_0x50ea('0x3e')](_0x50ea('0x3d'))[_0x50ea('0x3e')](_0x50ea('0x42'),LISTID[_0x50ea('0x3a')]())[_0x50ea('0x3e')]('id\x20IN\x20?',squel[_0x50ea('0x45')](hopperContacts))[_0x50ea('0x3e')](_0x50ea('0x3f')))[_0x50ea('0x3a')]();return _0x27e74b;}function _0x2a5d42(_0x283c91,_0x248ac8){var _0x620d2a=squel[_0x50ea('0x2f')]()[_0x50ea('0x30')](_0x50ea('0x46'))[_0x50ea('0x32')]([_0x50ea('0x1f'),_0x50ea('0x34'),'ListId',_0x248ac8,_0x50ea('0x35'),_0x50ea('0x36')],squel[_0x50ea('0x37')]()[_0x50ea('0x38')](_0x50ea('0x1f'),_0x50ea('0x1f'))[_0x50ea('0x38')]('id',_0x50ea('0x34'))[_0x50ea('0x38')](LISTID[_0x50ea('0x3a')](),'ListId')[_0x50ea('0x38')](_0x283c91['id']['toString'](),_0x248ac8)['field'](_0x50ea('0x39'),_0x50ea('0x35'))['field'](_0x50ea('0x39'),_0x50ea('0x36'))[_0x50ea('0x3b')](_0x50ea('0x3c'))[_0x50ea('0x3e')](_0x50ea('0x3d'))[_0x50ea('0x3e')]('ListId\x20=\x20?',LISTID[_0x50ea('0x3a')]())[_0x50ea('0x3e')](_0x50ea('0x43'),squel['str'](hopperContacts))[_0x50ea('0x3e')](_0x50ea('0x3f')))[_0x50ea('0x3a')]();return _0x620d2a;}return db[_0x50ea('0x47')][_0x50ea('0x48')]({'where':{'type':_0x50ea('0x49')},'attributes':['id',_0x50ea('0x4a')],'include':[{'model':db['CmList'],'as':_0x50ea('0x4b'),'where':{'id':LISTID}}]})[_0x50ea('0x2a')](function(_0x4ffaae){var _0x1c5e92=[];if(_0x4ffaae){var _0x5365df;for(var _0x22abd0=0x0,_0x171a30;_0x22abd0<_0x4ffaae[_0x50ea('0x19')];_0x22abd0+=0x1){_0x171a30=_0x4ffaae[_0x22abd0]['get']({'plain':!![]});switch(_0x171a30[_0x50ea('0x4a')]){case'always':_0x1c5e92[_0x50ea('0x4c')](db[_0x50ea('0x4d')]['query'](_0x4bab62(_0x171a30,_0x50ea('0x4e')))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));break;case _0x50ea('0x50'):_0x1c5e92[_0x50ea('0x4c')](db[_0x50ea('0x4d')][_0x50ea('0x51')](_0x42f6b7(_0x171a30,_0x50ea('0x4e')))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));break;default:_0x1c5e92[_0x50ea('0x4c')](db[_0x50ea('0x4d')]['query'](_0xe1a8c1(_0x171a30,'VoiceQueueId'))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));}}}return _0x1c5e92;})['all']()[_0x50ea('0x2a')](function(){return db['VoiceQueue'][_0x50ea('0x48')]({'where':{'type':_0x50ea('0x49')},'attributes':['id'],'include':[{'model':db[_0x50ea('0x52')],'as':_0x50ea('0x53'),'where':{'id':LISTID}}]})[_0x50ea('0x2a')](function(_0x4a8891){var _0x11fca5=[];if(_0x4a8891){var _0x2b5cc8;for(var _0x5d8da8=0x0,_0x1e3dd7;_0x5d8da8<_0x4a8891[_0x50ea('0x19')];_0x5d8da8+=0x1){_0x1e3dd7=_0x4a8891[_0x5d8da8][_0x50ea('0x54')]({'plain':!![]});_0x11fca5[_0x50ea('0x4c')](db['sequelize']['query'](_0x2a5d42(_0x1e3dd7,_0x50ea('0x4e')))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));}}return _0x11fca5;})[_0x50ea('0x55')]();})[_0x50ea('0x2a')](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x50ea('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x50ea('0x2a')](function(_0x21b4af){var _0x26f9e0=[];if(_0x21b4af){for(var _0x525342=0x0,_0x79edff;_0x525342<_0x21b4af[_0x50ea('0x19')];_0x525342+=0x1){_0x79edff=_0x21b4af[_0x525342][_0x50ea('0x54')]({'plain':!![]});switch(_0x79edff['dialCheckDuplicateType']){case'always':_0x26f9e0[_0x50ea('0x4c')](db[_0x50ea('0x4d')]['query'](_0x4bab62(_0x79edff,'CampaignId'))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));break;case _0x50ea('0x50'):_0x26f9e0[_0x50ea('0x4c')](db[_0x50ea('0x4d')][_0x50ea('0x51')](_0x42f6b7(_0x79edff,'CampaignId'))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));break;default:_0x26f9e0['push'](db['sequelize'][_0x50ea('0x51')](_0xe1a8c1(_0x79edff,_0x50ea('0x56')))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));}}}return _0x26f9e0;})[_0x50ea('0x55')]();})['then'](function(){return db[_0x50ea('0x57')][_0x50ea('0x48')]({'attributes':['id'],'include':[{'model':db[_0x50ea('0x52')],'as':_0x50ea('0x53'),'where':{'id':LISTID}}]})[_0x50ea('0x2a')](function(_0x3dbc48){var _0x4fe73c=[];if(_0x3dbc48){for(var _0x54ea4c=0x0,_0x4e12ea;_0x54ea4c<_0x3dbc48['length'];_0x54ea4c+=0x1){_0x4e12ea=_0x3dbc48[_0x54ea4c][_0x50ea('0x54')]({'plain':!![]});_0x4fe73c[_0x50ea('0x4c')](db[_0x50ea('0x4d')][_0x50ea('0x51')](_0x2a5d42(_0x4e12ea,_0x50ea('0x56')))[_0x50ea('0x2a')](function(){})[_0x50ea('0x4f')](_0xc10ebb()));}}return _0x4fe73c;})[_0x50ea('0x55')]();})['catch'](function(_0x5303a7){logger[_0x50ea('0x13')](_0x50ea('0x58'),'generalCheckHopper',_0x5303a7['message']);});}var processPromises=function(_0x31af3b){return BPromise['all'](promises)['then'](function(_0x2b2665){})['catch'](function(_0x1d4c54){logger[_0x50ea('0x13')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x1d4c54));})[_0x50ea('0x59')](function(){socket[_0x50ea('0x5a')](_0x50ea('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x31af3b){return _0x31af3b[_0x50ea('0x5c')]();}});};var endCsv=function(){return BPromise[_0x50ea('0x5d')]()[_0x50ea('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x50ea('0x2a')](function(){socket[_0x50ea('0x5a')](_0x50ea('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x50ea('0x5e')](FILEPATH);}catch(_0x5e7169){logger[_0x50ea('0x13')](_0x50ea('0x5f'),JSON[_0x50ea('0x2c')](_0x5e7169));}finally{process[_0x50ea('0x60')](0x0);}});};process['on'](_0x50ea('0x61'),function(){logger[_0x50ea('0x62')](_0x50ea('0x63'));endCsv();});function main(){return BPromise[_0x50ea('0x5d')]()[_0x50ea('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0x50ea('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5676b9){var _0x25d7a6=fs[_0x50ea('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x25d7a6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x51940e,_0x5579e0){total+=0x1;var _0x5896b2=total;promises[_0x50ea('0x4c')](checkRow(_0x51940e,_0x5676b9,_0x5896b2)['then'](function(){success+=0x1;})[_0x50ea('0x4f')](function(_0x1b2d58){if(_0x1b2d58['error']){errors+=0x1;delete _0x1b2d58[_0x50ea('0x13')];}else if(_0x1b2d58[_0x50ea('0x65')]){duplicates+=0x1;delete _0x1b2d58[_0x50ea('0x65')];}rows['push'](_0x1b2d58);}));if(total%0xc8===0x0){_0x5579e0[_0x50ea('0x66')]();return processPromises(_0x5579e0);}},'complete':function(){return processPromises()[_0x50ea('0x2a')](function(){logger[_0x50ea('0x62')](_0x50ea('0x67'));endCsv();});},'error':function(_0x4849c3,_0x5e9fb7){logger[_0x50ea('0x62')](_0x50ea('0x68'),JSON[_0x50ea('0x2c')](_0x4849c3));endCsv();}});})[_0x50ea('0x4f')](function(_0x31b81c){logger['error'](_0x50ea('0x69'),JSON[_0x50ea('0x2c')](_0x31b81c));});}main(); \ No newline at end of file +var _0xf31e=['split','Missing\x20ListId\x20parameter!','contact','index','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','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','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','ListId','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','VoiceQueueId','onlyIfOpen','findAll','BlackLists','query','all','Campaign','CampaignId','generalCheckHopper','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xf31e,0xce));var _0xef31=function(_0x233f84,_0x25f7a3){_0x233f84=_0x233f84-0x0;var _0x2bd5ed=_0xf31e[_0x233f84];return _0x2bd5ed;};'use strict';var BPromise=require(_0xef31('0x0'));var util=require('util');var _=require(_0xef31('0x1'));var fs=require('fs');var squel=require(_0xef31('0x2'));var Papa=require('papaparse');var Redis=require(_0xef31('0x3'));var db=require(_0xef31('0x4'))['db'];var config=require(_0xef31('0x5'));var logger=require(_0xef31('0x6'))('api');config[_0xef31('0x7')]=_[_0xef31('0x8')](config[_0xef31('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xef31('0x9'))(new Redis(config[_0xef31('0x7')]));require(_0xef31('0xa'))[_0xef31('0xb')](socket);try{if(!process[_0xef31('0xc')][0x2]||process[_0xef31('0xc')][0x2]===_0xef31('0xd')||process[_0xef31('0xc')][0x2]==='null'){throw new Error(_0xef31('0xe'));}var FILEPATH=process[_0xef31('0xc')][0x2];if(!process[_0xef31('0xc')][0x3]||process[_0xef31('0xc')][0x3]==='undefined'||process[_0xef31('0xc')][0x3]==='null'||!process[_0xef31('0xc')][0x4]||process[_0xef31('0xc')][0x4]===_0xef31('0xd')||process[_0xef31('0xc')][0x4]===_0xef31('0xf')){throw new Error(_0xef31('0x10'));}var FIELDS=_[_0xef31('0x11')](process[_0xef31('0xc')][0x3][_0xef31('0x12')](','),process[_0xef31('0xc')][0x4][_0xef31('0x12')](','));if(!process[_0xef31('0xc')][0x5]||process[_0xef31('0xc')][0x5]===_0xef31('0xd')||process[_0xef31('0xc')][0x5]==='null'){throw new Error(_0xef31('0x13'));}var LISTID=process[_0xef31('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xef31('0xc')][0x6]!=='undefined'&&process[_0xef31('0xc')][0x6]!==_0xef31('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0xef31('0xc')][0x7]&&process[_0xef31('0xc')][0x7]!=='undefined'&&process[_0xef31('0xc')][0x7]!==_0xef31('0xf')?process[_0xef31('0xc')][0x7]:null;if(!process[_0xef31('0xc')][0x8]||process['argv'][0x8]==='undefined'||process[_0xef31('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xef31('0xc')][0x8];}catch(_0x10e7b3){logger['error'](_0x10e7b3);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(_0x322875,_0x428bfd,_0x3fa1a9,_0x1dfe9f){var _0x294f95={'message':_0x428bfd};_0x294f95[_0x322875]=!![];if(_0x3fa1a9){_0x294f95[_0xef31('0x14')]=_0x3fa1a9;}if(_0x1dfe9f){_0x294f95[_0xef31('0x15')]=_0x1dfe9f;}return _0x294f95;}function isEmail(_0x3f3fbd){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'](_0x3f3fbd);}function checkRow(_0x289fb8,_0x29d3ea,_0x1ce53d){return new BPromise(function(_0x2a7aac,_0x44b735){if(_[_0xef31('0x16')](_0x289fb8)){return _0x44b735(handleCheckRowError(_0xef31('0x17'),_0xef31('0x18'),null,_0x1ce53d));}if(_0x289fb8['errors']&&_0x289fb8[_0xef31('0x19')][_0xef31('0x1a')]){var _0xe5f4d7=_[_0xef31('0x1b')](_0x289fb8[_0xef31('0x19')],_0xef31('0x1c'))['join'](';');return _0x44b735(handleCheckRowError('error',_0xe5f4d7,null,_0x1ce53d));}var _0x50b19b={};for(var _0x1808ef in FIELDS){if(FIELDS[_0xef31('0x1d')](_0x1808ef)&&FIELDS[_0x1808ef]){_0x50b19b[_0x1808ef]=_0x289fb8[_0xef31('0x1e')][0x0][FIELDS[_0x1808ef]]||_0x289fb8['data'][0x0]['\ufeff'+FIELDS[_0x1808ef]];}}if(!_0x50b19b[_0xef31('0x1f')]){return _0x44b735(handleCheckRowError(_0xef31('0x17'),_0xef31('0x20'),null,_0x1ce53d));}if(!_0x50b19b[_0xef31('0x21')]){return _0x44b735(handleCheckRowError(_0xef31('0x17'),_0xef31('0x22'),null,_0x1ce53d));}if(_0x50b19b[_0xef31('0x23')]){var _0x2f4266=moment(_0x50b19b[_0xef31('0x23')],'YYYY-MM-DD');if(!_0x2f4266[_0xef31('0x24')]()){return _0x44b735(handleCheckRowError('error',_0xef31('0x25'),null,_0x1ce53d));}}if(_0x50b19b[_0xef31('0x26')]){if(!isEmail(_0x50b19b['email'])){return _0x44b735(handleCheckRowError(_0xef31('0x17'),_0xef31('0x27'),null,_0x1ce53d));}}_0x50b19b['ListId']=LISTID;_0x50b19b[_0xef31('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x29d3ea){var _0x3700a0={};for(var _0x541429=0x0,_0x81236e=DUPLICATES[_0xef31('0x1a')];_0x541429<_0x81236e;_0x541429+=0x1){_0x3700a0[DUPLICATES[_0x541429]]=_0x50b19b[DUPLICATES[_0x541429]];}var _0x4fd571=_[_0xef31('0x29')](_0x29d3ea,_0x3700a0);if(_0x4fd571){return _0x44b735(handleCheckRowError(_0xef31('0x2a'),_0xef31('0x2b'),_0x4fd571,_0x1ce53d));}}return db[_0xef31('0x2c')]['create'](_0x50b19b,{'raw':!![],'hooks':![],'fields':_[_0xef31('0x2d')](_0x50b19b)})[_0xef31('0x2e')](function(_0x4c8451){if(DUPLICATES&&DUPLICATES['length']&&_0x29d3ea){_0x29d3ea['push'](_['pick'](_0x50b19b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4c8451['id'];return _0x2a7aac();})[_0xef31('0x2f')](function(_0x17da61){return _0x44b735(handleCheckRowError(_0xef31('0x17'),_0xef31('0x30')+(_0x17da61['message']||JSON[_0xef31('0x31')](_0x17da61)),null,_0x1ce53d));});});}function checkHopper(){function _0x384c38(){return function(_0x5b7a88){logger[_0xef31('0x17')](_0xef31('0x32'),_0xef31('0x33'),util[_0xef31('0x34')](_0x5b7a88,{'showHidden':![],'depth':null}));};}var _0x186c64=function(_0x3bf934,_0x108810){var _0x4f0ab6=squel[_0xef31('0x35')]()['into'](_0xef31('0x36'))[_0xef31('0x37')](['phone',_0xef31('0x38'),_0xef31('0x39'),'ListId',_0x108810,_0xef31('0x3a'),_0xef31('0x3b')],squel[_0xef31('0x3c')]()[_0xef31('0x3d')](_0xef31('0x21'),_0xef31('0x21'))[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x38'))[_0xef31('0x3d')]('id','ContactId')[_0xef31('0x3d')](LISTID[_0xef31('0x3f')](),_0xef31('0x40'))[_0xef31('0x3d')](_0x3bf934['id'][_0xef31('0x3f')](),_0x108810)[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x3a'))[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x3b'))[_0xef31('0x41')]('cm_contacts')[_0xef31('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0xef31('0x43'),LISTID[_0xef31('0x3f')]())['where'](_0xef31('0x44'))[_0xef31('0x42')](_0xef31('0x45'),squel[_0xef31('0x3c')]()[_0xef31('0x3d')](_0xef31('0x21'))[_0xef31('0x41')](_0xef31('0x36'))['where'](_0x108810+'\x20=\x20?',_0x3bf934['id'][_0xef31('0x3f')]())))['toString']();return _0x4f0ab6;};var _0x41caea=function(_0x1f4f8d,_0x449c8c){var _0xc02aef=squel[_0xef31('0x35')]()[_0xef31('0x46')](_0xef31('0x36'))[_0xef31('0x37')]([_0xef31('0x21'),_0xef31('0x38'),_0xef31('0x39'),_0xef31('0x40'),_0x449c8c,_0xef31('0x3a'),_0xef31('0x3b')],squel['select']()[_0xef31('0x3d')](_0xef31('0x21'),'phone')[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x38'))[_0xef31('0x3d')]('id',_0xef31('0x39'))[_0xef31('0x3d')](LISTID[_0xef31('0x3f')](),_0xef31('0x40'))[_0xef31('0x3d')](_0x1f4f8d['id'][_0xef31('0x3f')](),_0x449c8c)[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x3a'))[_0xef31('0x3d')](_0xef31('0x3e'),'updatedAt')[_0xef31('0x41')](_0xef31('0x47'))[_0xef31('0x42')]('deletedAt\x20IS\x20NULL')[_0xef31('0x42')](_0xef31('0x43'),LISTID[_0xef31('0x3f')]())['where'](_0xef31('0x48'),squel[_0xef31('0x49')](hopperContacts))['where'](_0xef31('0x44'))[_0xef31('0x42')](_0xef31('0x45'),squel[_0xef31('0x3c')]()[_0xef31('0x3d')](_0xef31('0x4a'))[_0xef31('0x41')](_0xef31('0x4b'))['where'](_0x449c8c+_0xef31('0x4c'),_0x1f4f8d['id'][_0xef31('0x3f')]()))['where'](_0xef31('0x45'),squel[_0xef31('0x3c')]()['field'](_0xef31('0x21'))[_0xef31('0x41')](_0xef31('0x36'))[_0xef31('0x42')](_0x449c8c+_0xef31('0x4c'),_0x1f4f8d['id'][_0xef31('0x3f')]())))[_0xef31('0x3f')]();return _0xc02aef;};function _0xe68a6c(_0x1c75ff,_0x4f3eaa){var _0x586377=squel['insert']()['into'](_0xef31('0x36'))[_0xef31('0x37')]([_0xef31('0x21'),'scheduledAt',_0xef31('0x39'),'ListId',_0x4f3eaa,_0xef31('0x3a'),_0xef31('0x3b')],squel[_0xef31('0x3c')]()['field'](_0xef31('0x21'),_0xef31('0x21'))[_0xef31('0x3d')](_0xef31('0x3e'),_0xef31('0x38'))[_0xef31('0x3d')]('id',_0xef31('0x39'))[_0xef31('0x3d')](LISTID[_0xef31('0x3f')](),'ListId')[_0xef31('0x3d')](_0x1c75ff['id'][_0xef31('0x3f')](),_0x4f3eaa)[_0xef31('0x3d')]('NOW()',_0xef31('0x3a'))['field'](_0xef31('0x3e'),_0xef31('0x3b'))[_0xef31('0x41')](_0xef31('0x47'))['where'](_0xef31('0x4d'))[_0xef31('0x42')](_0xef31('0x43'),LISTID[_0xef31('0x3f')]())[_0xef31('0x42')]('id\x20IN\x20?',squel[_0xef31('0x49')](hopperContacts))['where'](_0xef31('0x44')))[_0xef31('0x3f')]();return _0x586377;}function _0x2a2c1d(_0x3b5d7f,_0x5e0c7c){var _0x61a539=squel['insert']()[_0xef31('0x46')](_0xef31('0x4e'))[_0xef31('0x37')]([_0xef31('0x21'),_0xef31('0x39'),_0xef31('0x40'),_0x5e0c7c,'createdAt',_0xef31('0x3b')],squel[_0xef31('0x3c')]()['field'](_0xef31('0x21'),_0xef31('0x21'))[_0xef31('0x3d')]('id',_0xef31('0x39'))['field'](LISTID[_0xef31('0x3f')](),_0xef31('0x40'))[_0xef31('0x3d')](_0x3b5d7f['id'][_0xef31('0x3f')](),_0x5e0c7c)[_0xef31('0x3d')](_0xef31('0x3e'),'createdAt')['field'](_0xef31('0x3e'),_0xef31('0x3b'))[_0xef31('0x41')](_0xef31('0x47'))[_0xef31('0x42')](_0xef31('0x4d'))[_0xef31('0x42')](_0xef31('0x43'),LISTID[_0xef31('0x3f')]())[_0xef31('0x42')](_0xef31('0x48'),squel['str'](hopperContacts))[_0xef31('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0xef31('0x3f')]();return _0x61a539;}return db[_0xef31('0x4f')]['findAll']({'where':{'type':_0xef31('0x50')},'attributes':['id',_0xef31('0x51')],'include':[{'model':db[_0xef31('0x52')],'as':_0xef31('0x53'),'where':{'id':LISTID}}]})[_0xef31('0x2e')](function(_0x1dd353){var _0x4ab1cc=[];if(_0x1dd353){var _0x7cafdd;for(var _0x243489=0x0,_0x5ef053;_0x243489<_0x1dd353['length'];_0x243489+=0x1){_0x5ef053=_0x1dd353[_0x243489][_0xef31('0x54')]({'plain':!![]});switch(_0x5ef053['dialCheckDuplicateType']){case _0xef31('0x55'):_0x4ab1cc[_0xef31('0x56')](db[_0xef31('0x57')]['query'](_0x41caea(_0x5ef053,_0xef31('0x58')))[_0xef31('0x2e')](function(){})[_0xef31('0x2f')](_0x384c38()));break;case _0xef31('0x59'):_0x4ab1cc['push'](db[_0xef31('0x57')]['query'](_0x186c64(_0x5ef053,_0xef31('0x58')))[_0xef31('0x2e')](function(){})[_0xef31('0x2f')](_0x384c38()));break;default:_0x4ab1cc[_0xef31('0x56')](db['sequelize']['query'](_0xe68a6c(_0x5ef053,'VoiceQueueId'))['then'](function(){})[_0xef31('0x2f')](_0x384c38()));}}}return _0x4ab1cc;})['all']()[_0xef31('0x2e')](function(){return db['VoiceQueue'][_0xef31('0x5a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xef31('0x52')],'as':_0xef31('0x5b'),'where':{'id':LISTID}}]})[_0xef31('0x2e')](function(_0x237c87){var _0x226053=[];if(_0x237c87){var _0x2ca42a;for(var _0x439774=0x0,_0x4c67d9;_0x439774<_0x237c87[_0xef31('0x1a')];_0x439774+=0x1){_0x4c67d9=_0x237c87[_0x439774][_0xef31('0x54')]({'plain':!![]});_0x226053[_0xef31('0x56')](db[_0xef31('0x57')][_0xef31('0x5c')](_0x2a2c1d(_0x4c67d9,_0xef31('0x58')))[_0xef31('0x2e')](function(){})[_0xef31('0x2f')](_0x384c38()));}}return _0x226053;})[_0xef31('0x5d')]();})[_0xef31('0x2e')](function(){return db[_0xef31('0x5e')][_0xef31('0x5a')]({'attributes':['id',_0xef31('0x51')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xef31('0x2e')](function(_0x104bd8){var _0x8e5425=[];if(_0x104bd8){for(var _0x20cc7c=0x0,_0x55992f;_0x20cc7c<_0x104bd8[_0xef31('0x1a')];_0x20cc7c+=0x1){_0x55992f=_0x104bd8[_0x20cc7c][_0xef31('0x54')]({'plain':!![]});switch(_0x55992f[_0xef31('0x51')]){case _0xef31('0x55'):_0x8e5425[_0xef31('0x56')](db[_0xef31('0x57')][_0xef31('0x5c')](_0x41caea(_0x55992f,_0xef31('0x5f')))[_0xef31('0x2e')](function(){})['catch'](_0x384c38()));break;case _0xef31('0x59'):_0x8e5425['push'](db[_0xef31('0x57')][_0xef31('0x5c')](_0x186c64(_0x55992f,_0xef31('0x5f')))[_0xef31('0x2e')](function(){})[_0xef31('0x2f')](_0x384c38()));break;default:_0x8e5425['push'](db[_0xef31('0x57')][_0xef31('0x5c')](_0xe68a6c(_0x55992f,_0xef31('0x5f')))['then'](function(){})[_0xef31('0x2f')](_0x384c38()));}}}return _0x8e5425;})[_0xef31('0x5d')]();})[_0xef31('0x2e')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xef31('0x52')],'as':_0xef31('0x5b'),'where':{'id':LISTID}}]})[_0xef31('0x2e')](function(_0x4db3b4){var _0x34075b=[];if(_0x4db3b4){for(var _0x389a6d=0x0,_0x31d9d0;_0x389a6d<_0x4db3b4['length'];_0x389a6d+=0x1){_0x31d9d0=_0x4db3b4[_0x389a6d]['get']({'plain':!![]});_0x34075b[_0xef31('0x56')](db[_0xef31('0x57')]['query'](_0x2a2c1d(_0x31d9d0,'CampaignId'))['then'](function(){})[_0xef31('0x2f')](_0x384c38()));}}return _0x34075b;})['all']();})[_0xef31('0x2f')](function(_0x1c4e7c){logger['error']('cmContact,\x20%s,\x20%s',_0xef31('0x60'),_0x1c4e7c[_0xef31('0x1c')]);});}var processPromises=function(_0x4113a2){return BPromise[_0xef31('0x5d')](promises)[_0xef31('0x2e')](function(_0x3c929d){})[_0xef31('0x2f')](function(_0x59495f){logger['error']('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x59495f));})[_0xef31('0x61')](function(){socket[_0xef31('0x62')](_0xef31('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4113a2){return _0x4113a2[_0xef31('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xef31('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xef31('0x2e')](function(){socket[_0xef31('0x62')](_0xef31('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xef31('0x65')](FILEPATH);}catch(_0x52b09){logger[_0xef31('0x17')](_0xef31('0x66'),JSON[_0xef31('0x31')](_0x52b09));}finally{process[_0xef31('0x67')](0x0);}});};process['on'](_0xef31('0x68'),function(){logger[_0xef31('0x69')](_0xef31('0x6a'));endCsv();});function main(){return BPromise[_0xef31('0x6b')]()[_0xef31('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xef31('0x12')](',');return db[_0xef31('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x38ccb8){var _0x3d8bb7=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xef31('0x6c')](_0x3d8bb7,{'header':!![],'skipEmptyLines':!![],'step':function(_0x513801,_0x4481c5){total+=0x1;var _0x210af4=total;promises[_0xef31('0x56')](checkRow(_0x513801,_0x38ccb8,_0x210af4)[_0xef31('0x2e')](function(){success+=0x1;})[_0xef31('0x2f')](function(_0x92c3ff){if(_0x92c3ff[_0xef31('0x17')]){errors+=0x1;delete _0x92c3ff['error'];}else if(_0x92c3ff['duplicate']){duplicates+=0x1;delete _0x92c3ff[_0xef31('0x2a')];}rows[_0xef31('0x56')](_0x92c3ff);}));if(total%0xc8===0x0){_0x4481c5[_0xef31('0x6d')]();return processPromises(_0x4481c5);}},'complete':function(){return processPromises()[_0xef31('0x2e')](function(){logger[_0xef31('0x69')](_0xef31('0x6e'));endCsv();});},'error':function(_0x4b74e2,_0x365270){logger[_0xef31('0x69')](_0xef31('0x6f'),JSON['stringify'](_0x4b74e2));endCsv();}});})['catch'](function(_0x42fbf5){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xef31('0x31')](_0x42fbf5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0fa955b..f31e0ec 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 _0x380f=['campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','socket.io-emitter','format','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','fromQuery','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','push','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','length','all','then','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','start','root','server/files/tmp','.csv','writeFileSync','createReadStream','data','rows','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','firstName','\x20not\x20specified','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x380f,0x143));var _0xf380=function(_0x4f7fbd,_0x20dd29){_0x4f7fbd=_0x4f7fbd-0x0;var _0x125c02=_0x380f[_0x4f7fbd];return _0x125c02;};'use strict';var fs=require('fs');var path=require(_0xf380('0x0'));var _=require(_0xf380('0x1'));var Papa=require(_0xf380('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xf380('0x3'));var squel=require('squel');var Redis=require(_0xf380('0x4'));var db=require(_0xf380('0x5'))['db'];var config=require(_0xf380('0x6'));var shared=require(_0xf380('0x7'));var logger=require(_0xf380('0x8'))(_0xf380('0x9'));config[_0xf380('0xa')]=_['defaults'](config[_0xf380('0xa')],{'host':_0xf380('0xb'),'port':0x18eb});var socket=require(_0xf380('0xc'))(new Redis(config[_0xf380('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf380('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x4a2355){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))*$/[_0xf380('0xe')](_0x4a2355);}function selectNotIn(_0x33ea34,_0x3033fe,_0x1bb259,_0x2f089b,_0x5ae5b8){return squel['select']()[_0xf380('0xf')](_0xf380('0x10'))[_0xf380('0x11')](_0x2f089b)[_0xf380('0x12')](_0x3033fe,null,_0x3033fe+_0xf380('0x13')+_0x2f089b+'.'+_0x1bb259)['where'](_0x2f089b+'.'+_0x1bb259+_0xf380('0x14')+_0x33ea34+'.'+_0x1bb259)[_0xf380('0x15')](_0x3033fe+'.dialCheckDuplicateType\x20IN\x20('+_0x5ae5b8[_0xf380('0x12')]()+')');}function insertCmHopper(_0x5d1fcf,_0x1962f5,_0x4ce831,_0x113112,_0x2a0d07){var _0x77a407=[_0xf380('0x16'),_0xf380('0x17'),_0xf380('0x18'),'cm_contacts.ListId',_0x1962f5+'.'+_0x113112,_0xf380('0x19'),_0xf380('0x1a'),_0xf380('0x1b'),'cm_contacts.UserId','\x22'+_0x2a0d07+'\x22'];return squel[_0xf380('0x1c')]()[_0xf380('0x1d')](_0xf380('0x1e'))['fromQuery']([_0xf380('0x10'),'scheduledat',_0xf380('0x1f'),_0xf380('0x20'),_0x113112,_0xf380('0x21'),_0xf380('0x22'),_0xf380('0x23'),_0xf380('0x24'),_0xf380('0x25')],squel[_0xf380('0x26')]()[_0xf380('0x27')](_0x77a407)['from'](_0x1962f5)[_0xf380('0x12')](_0xf380('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x1962f5+_0xf380('0x29'))[_0xf380('0x12')](_0x4ce831,null,_0x4ce831+'.id\x20=\x20'+_0x1962f5+'.'+_0x113112)[_0xf380('0x15')](_0x1962f5+_0xf380('0x2a'),_0x5d1fcf)[_0xf380('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xf380('0x2b'),selectNotIn(_0x1962f5,_0x4ce831,_0x113112,_0xf380('0x1e'),[_0xf380('0x2c'),_0xf380('0x2d')]))['where'](_0xf380('0x2b'),selectNotIn(_0x1962f5,_0x4ce831,_0x113112,'cm_hopper',[_0xf380('0x2c')])))[_0xf380('0x2e')]();}function insertCmHopperBlack(_0x5a98c7,_0x181b6d,_0x4df16b,_0x39495c){var _0x412085=[_0xf380('0x16'),_0xf380('0x18'),_0xf380('0x2f'),_0x181b6d+'.'+_0x39495c,_0xf380('0x19'),_0xf380('0x1a')];return squel[_0xf380('0x1c')]()[_0xf380('0x1d')]('cm_hopper_black')[_0xf380('0x30')]([_0xf380('0x10'),'ContactId',_0xf380('0x20'),_0x39495c,_0xf380('0x21'),_0xf380('0x22')],squel['select']()['fields'](_0x412085)[_0xf380('0x11')](_0x181b6d)[_0xf380('0x12')](_0xf380('0x28'),null,_0xf380('0x31')+_0x181b6d+_0xf380('0x29'))[_0xf380('0x12')](_0x4df16b,null,_0x4df16b+_0xf380('0x13')+_0x181b6d+'.'+_0x39495c)[_0xf380('0x15')](_0x181b6d+_0xf380('0x2a'),_0x5a98c7)['where'](_0xf380('0x32'),NOW)[_0xf380('0x15')](_0xf380('0x2b'),squel[_0xf380('0x26')]()[_0xf380('0xf')](_0xf380('0x10'))[_0xf380('0x11')](_0xf380('0x33'))['where'](_0xf380('0x34'),_0x5a98c7)[_0xf380('0x15')](_0x39495c+_0xf380('0x35'),_0x181b6d+'.'+_0x39495c)))[_0xf380('0x2e')]();}function insertTzCmHopper(_0xbb7198,_0xf0c779,_0x45d586,_0x53db6a,_0x2780bd,_0x28d0df){var _0x26b12a=[_0xf380('0x16'),_0xf380('0x36')+_0x28d0df+_0xf380('0x37'),'cm_contacts.id',_0xf380('0x2f'),_0xf0c779+'.'+_0x53db6a,_0xf380('0x19'),_0xf380('0x1a'),_0xf380('0x1b'),'cm_contacts.UserId','\x22'+_0x2780bd+'\x22'];var _0x240069=squel[_0xf380('0x1c')]()[_0xf380('0x1d')]('cm_hopper')[_0xf380('0x30')]([_0xf380('0x10'),'scheduledat',_0xf380('0x1f'),'ListId',_0x53db6a,_0xf380('0x21'),_0xf380('0x22'),_0xf380('0x23'),_0xf380('0x24'),_0xf380('0x25')],squel[_0xf380('0x26')]()['fields'](_0x26b12a)['from'](_0xf0c779)[_0xf380('0x12')](_0xf380('0x28'),null,_0xf380('0x31')+_0xf0c779+_0xf380('0x29'))[_0xf380('0x12')](_0x45d586,null,_0x45d586+'.id\x20=\x20'+_0xf0c779+'.'+_0x53db6a)[_0xf380('0x12')](_0x28d0df,null,_0x28d0df+_0xf380('0x13')+_0xf0c779+'.'+_0x53db6a)['where'](_0xf0c779+'.CmListId\x20=\x20?',_0xbb7198)[_0xf380('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xf380('0x2b'),selectNotIn(_0xf0c779,_0x45d586,_0x53db6a,_0xf380('0x1e'),['\x22always\x22',_0xf380('0x2d')]))['where'](_0xf380('0x2b'),selectNotIn(_0xf0c779,_0x45d586,_0x53db6a,_0xf380('0x1e'),[_0xf380('0x2c')])))[_0xf380('0x2e')]();return _0x240069;}function insertTzCmHopperBlack(_0x5e6a34,_0x494fc4,_0x55ac9e,_0x20333f){var _0x19d3a8=['cm_contacts.phone',_0xf380('0x18'),'cm_contacts.ListId',_0x494fc4+'.'+_0x20333f,_0xf380('0x19'),'cm_contacts.updatedAt'];return squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0xf380('0x10'),_0xf380('0x1f'),_0xf380('0x20'),_0x20333f,_0xf380('0x21'),_0xf380('0x22')],squel[_0xf380('0x26')]()[_0xf380('0x27')](_0x19d3a8)[_0xf380('0x11')](_0x494fc4)[_0xf380('0x12')](_0xf380('0x28'),null,_0xf380('0x31')+_0x494fc4+_0xf380('0x29'))[_0xf380('0x12')](_0x55ac9e,null,_0x55ac9e+_0xf380('0x13')+_0x494fc4+'.'+_0x20333f)[_0xf380('0x15')](_0x494fc4+_0xf380('0x2a'),_0x5e6a34)[_0xf380('0x15')](_0xf380('0x32'),NOW)[_0xf380('0x15')](_0xf380('0x2b'),squel[_0xf380('0x26')]()[_0xf380('0xf')](_0xf380('0x10'))[_0xf380('0x11')](_0xf380('0x33'))['where'](_0xf380('0x34'),_0x5e6a34)[_0xf380('0x15')](_0x20333f+_0xf380('0x35'),_0x494fc4+'.'+_0x20333f)))['toString']();}function insertCmContact(_0x3306e7,_0xfe8b60,_0x2f7f6a,_0x4992ba){var _0x1a163f=_[_0xf380('0x38')](_[_0xf380('0x39')](_0x4992ba),[_0xf380('0x20'),_0xf380('0x3a'),'createdAt','updatedAt']);return squel['insert']()[_0xf380('0x1d')](_0xf380('0x28'))[_0xf380('0x30')](_0x1a163f,squel[_0xf380('0x26')]()[_0xf380('0x27')](_0x1a163f)[_0xf380('0x11')](_0xfe8b60)[_0xf380('0x15')]('('+_0x2f7f6a['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xf380('0x26')]()[_0xf380('0x27')](_0x2f7f6a)['from'](_0xf380('0x28'))[_0xf380('0x15')](_0xf380('0x34'),_0x3306e7)[_0xf380('0x15')](_0xf380('0x3b')))['where'](_0xf380('0x3c'),squel[_0xf380('0x26')]()[_0xf380('0xf')](_0xf380('0x3d'),_0xf380('0x3e'))[_0xf380('0x11')](_0xfe8b60)['group'](_0x2f7f6a['join'](','))))[_0xf380('0x2e')]();}function handleStop(){logger[_0xf380('0x3f')](_0xf380('0x40'));stopped=!![];}function handleUncaughtException(_0x28fc2a){logger[_0xf380('0x41')](_0x28fc2a[_0xf380('0x42')]);process[_0xf380('0x43')](0x1);}function handleError(_0x222374,_0x251c30){stats[_0xf380('0x44')][_0xf380('0x45')]({'name':_0x251c30['code'],'message':_0x251c30['message'],'row':_0x222374});}function handleQuery(_0x3e0dbe){logger[_0xf380('0x3f')](_0x3e0dbe);return db[_0xf380('0x46')][_0xf380('0x47')](_0x3e0dbe)[_0xf380('0x48')](function(_0x81abcc){results[_0xf380('0x45')](_0x81abcc);})['catch'](function(_0x35cd32){logger[_0xf380('0x41')](_0x35cd32['message']);});}function updateTzCampaigns(_0x421748){return new Promise(function(_0xdb3215,_0x434a07){var _0x40c9fd=squel[_0xf380('0x26')]()[_0xf380('0x27')]([_0xf380('0x49'),_0xf380('0x4a')])[_0xf380('0x11')]('campaigns')[_0xf380('0x12')](_0xf380('0x4b'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where']('campaigns_has_cm_lists.CmListId='+_0x421748);db[_0xf380('0x46')][_0xf380('0x47')](_0x40c9fd['toString']())[_0xf380('0x48')](function(_0x417f0d){var _0xc0a93=[];for(var _0x3741d6=0x0;_0x3741d6<_0x417f0d[_0xf380('0x4c')];_0x3741d6++){_0xc0a93['push'](getTimezoneData(_0x417f0d[_0x3741d6],tmp_campaigns));}BPromise[_0xf380('0x4d')](_0xc0a93)[_0xf380('0x4e')](function(){_0xdb3215({'val':0x1});});})[_0xf380('0x4f')](function(_0x314d39){logger[_0xf380('0x41')](_0x314d39['message']);_0xdb3215({'val':0x0});});});}function updateTzVoiceQueues(_0x3efd34){return new Promise(function(_0x2dd30c,_0x535825){var _0x556268=squel['select']()[_0xf380('0x27')]([_0xf380('0x50'),_0xf380('0x51')])['from'](_0xf380('0x52'))[_0xf380('0x12')](_0xf380('0x53'),null,_0xf380('0x54'))[_0xf380('0x15')](_0xf380('0x55')+_0x3efd34);db[_0xf380('0x46')][_0xf380('0x47')](_0x556268[_0xf380('0x2e')]())[_0xf380('0x48')](function(_0x41bea3){var _0x30ddd2=[];for(var _0x1f5803=0x0;_0x1f5803<_0x41bea3[_0xf380('0x4c')];_0x1f5803++){_0x30ddd2[_0xf380('0x45')](getTimezoneData(_0x41bea3[_0x1f5803],tmp_voice_queues));}BPromise[_0xf380('0x4d')](_0x30ddd2)[_0xf380('0x4e')](function(){_0x2dd30c({'val':0x1});});})[_0xf380('0x4f')](function(_0x1cd23f){logger[_0xf380('0x41')](_0x1cd23f[_0xf380('0x42')]);_0x2dd30c({'val':0x0});});});}function getTimezoneData(_0x377657,_0x592dae){return new Promise(function(_0x520d46,_0x121fa8){var _0x5f4a19=shared[_0xf380('0x56')];var _0x3d3b1c=_0x5f4a19[_0x377657[_0xf380('0x57')]];if(_['isNil'](_0x3d3b1c)){_0x520d46({'ret':0x1});}else{var _0x5bfe8d=_0x3d3b1c[_0xf380('0x58')];var _0x2fd3ce=squel[_0xf380('0x1c')]()[_0xf380('0x1d')](_0x592dae)['set']('id',_0x377657['id'])[_0xf380('0x59')](_0xf380('0x5a'),_0x5bfe8d)[_0xf380('0x59')](_0xf380('0x57'),_0x377657[_0xf380('0x57')])[_0xf380('0x2e')]();return db[_0xf380('0x46')][_0xf380('0x47')](_0x2fd3ce)[_0xf380('0x48')](function(_0x41e75e){_0x520d46({'ret':0x1});})[_0xf380('0x4f')](function(_0x3e94e8){logger[_0xf380('0x41')](_0x3e94e8[_0xf380('0x42')]);_0x121fa8({'ret':0x1});});}});}function handleTZQuery(_0x2722ec){logger[_0xf380('0x3f')](_0x2722ec);return db['sequelize']['query'](_0x2722ec)[_0xf380('0x48')](function(_0x30da8d){})['catch'](function(_0x26c0a7){logger[_0xf380('0x41')](_0x26c0a7[_0xf380('0x42')]);});}function main(_0x448a30,_0x556076,_0x445852,_0x1a66ff){logger['info'](_0xf380('0x5b'),_0x448a30,JSON[_0xf380('0x5c')](_0x556076));process['send'](_0xf380('0x5d'));var _0x59529d=_0x556076['binding'];var _0x5062e8=_0x556076['socket_timestamp'];var _0x1149d8=path['join'](config[_0xf380('0x5e')],_0xf380('0x5f'),_0x5062e8+_0xf380('0x60'));hasTZ=_['keys'](_0x59529d)['includes'](_0xf380('0x57'));var _0x32e675=_['keys'](_0x59529d)[_0xf380('0x12')]();logger['info']('header',_0x32e675);if(hasTZ)_0x32e675+=',utcOffset';fs[_0xf380('0x61')](_0x1149d8,_0x32e675+'\x0a');Papa['parse'](fs[_0xf380('0x62')](_0x448a30),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ba568,_0x1688b3){try{for(var _0x340235=0x0,_0x294888=[];_0x340235<_0x1ba568[_0xf380('0x63')]['length'];_0x340235++){stats[_0xf380('0x64')]+=0x1;if(_0x1ba568[_0xf380('0x44')][_0x340235]){handleError(_0x1ba568[_0xf380('0x63')][_0x340235],_0x1ba568[_0xf380('0x44')][_0x340235]);}else{var _0x902c7c=[];for(var _0x28f86d in _0x59529d){if(_0x59529d['hasOwnProperty'](_0x28f86d)){if(_0x1ba568['data'][_0x340235][_0x59529d[_0x28f86d]]){var _0x500170=_['trim'](_0x1ba568['data'][_0x340235][_0x59529d[_0x28f86d]][_0xf380('0x65')](/"/g,'\x27'));switch(_0x28f86d){case _0xf380('0x66'):var _0x14ca2e=moment(_0x500170,_0xf380('0x67'),!![]);if(_0x14ca2e[_0xf380('0x68')]()){_0x294888[_0xf380('0x45')]('\x22'+_0x500170+'\x22');}else{_0x902c7c['push'](_0xf380('0x69'));}break;case _0xf380('0x23'):var _0x509379=parseInt(_0x500170);_0x500170=_[_0xf380('0x6a')](_0x509379)||_0x509379<0x0||_0x509379>0x4?_0x1a66ff?0x3:0x2:_0x509379;_0x294888['push']('\x22'+_0x500170+'\x22');break;case'UserId':var _0x319d51=parseInt(_0x500170);if(_['isNumber'](_0x319d51)&&_[_0xf380('0x6b')](_0x445852,_0x319d51)){_0x294888[_0xf380('0x45')]('\x22'+_0x319d51+'\x22');}else{_0x902c7c[_0xf380('0x45')](_0xf380('0x6c'));}break;case _0xf380('0x6d'):if(isEmail(_0x500170)){_0x294888[_0xf380('0x45')]('\x22'+_0x500170+'\x22');}else{_0x902c7c[_0xf380('0x45')](_0xf380('0x6e'));}break;case _0xf380('0x6f'):var _0xf2aba6=moment(_0x500170,'YYYY-MM-DD',!![]);if(_0xf2aba6['isValid']()){_0x294888['push']('\x22'+_0x500170+'\x22');}else{_0x902c7c[_0xf380('0x45')](_0xf380('0x70'));}break;case _0xf380('0x57'):var _0x517546=shared[_0xf380('0x56')];var _0x56f23d=_0x517546[_0x500170];if(!_[_0xf380('0x71')](_0x56f23d)){var _0x1803c8=_0x56f23d[_0xf380('0x58')];_0x294888[_0xf380('0x45')]('\x22'+_0x500170+'\x22');_0x294888[_0xf380('0x45')]('\x22'+_0x1803c8+'\x22');}break;default:_0x294888[_0xf380('0x45')]('\x22'+_0x500170+'\x22');}}else{switch(_0x28f86d){case _0xf380('0x72'):case _0xf380('0x10'):_0x902c7c[_0xf380('0x45')](_0x28f86d+_0xf380('0x73'));break;default:_0x294888['push']('\x22\x22');}}}}if(_0x902c7c[_0xf380('0x4c')]){handleError(_0x1ba568[_0xf380('0x63')][_0x340235],{'code':'SystemRow','message':_0x902c7c[_0xf380('0x12')]()});}else{fs['appendFileSync'](_0x1149d8,_0x294888[_0xf380('0x12')]()+'\x0a');}_0x294888=[];}if(!(stats[_0xf380('0x64')]%0xc8)){socket[_0xf380('0x74')](_0xf380('0x75')+_0x5062e8,stats);stats[_0xf380('0x44')]=[];}}if(stopped){logger[_0xf380('0x3f')](_0xf380('0x76'));_0x1688b3[_0xf380('0x77')]();}}catch(_0x4fb225){handleError(_0x1ba568[_0xf380('0x63')][_0x340235],{'code':_0xf380('0x78'),'message':_0x4fb225[_0xf380('0x42')]});logger[_0xf380('0x41')](_0xf380('0x79'),_0x4fb225[_0xf380('0x42')]);}},'complete':function(){try{var _0x3eeb58=[];var _0x54083f=[];var _0x2edc99=_0xf380('0x28');if(_0x556076[_0xf380('0x7a')]&&_0x556076[_0xf380('0x7a')][_0xf380('0x4c')]){_0x2edc99=_0xf380('0x7b')+_0x5062e8;_0x3eeb58[_0xf380('0x45')](_0xf380('0x7c')+_0x2edc99+_0xf380('0x7d'));}tmp_campaigns=_0xf380('0x7e')+_0x5062e8;tmp_voice_queues=_0xf380('0x7f')+_0x5062e8;_0x54083f['push'](_0xf380('0x7c')+tmp_campaigns+_0xf380('0x80'));_0x54083f[_0xf380('0x45')](_0xf380('0x7c')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xf380('0x81')](_0x54083f,handleTZQuery)[_0xf380('0x4e')](function(_0x757e9b){updateTzCampaigns(_0x556076[_0xf380('0x20')])[_0xf380('0x4e')](function(_0x1431dc){updateTzVoiceQueues(_0x556076[_0xf380('0x20')])['then'](function(_0x3fab7c){var _0x1265b0=util[_0xf380('0xd')](_0xf380('0x82'),_0x1149d8,_0x2edc99,_0x32e675,_0x556076['ListId'],_0x556076[_0xf380('0x3a')]||null,NOW,NOW);if(_[_0xf380('0x71')](_0x59529d[_0xf380('0x66')])){_0x1265b0+=',\x20scheduledAt\x20=\x20NOW()';}_0x3eeb58['push'](_0x1265b0);if(_0x556076[_0xf380('0x7a')]&&_0x556076[_0xf380('0x7a')]['length']){_0x3eeb58[_0xf380('0x45')](insertCmContact(_0x556076[_0xf380('0x20')],_0x2edc99,_0x556076['duplicates'],_0x59529d));_0x3eeb58[_0xf380('0x45')](_0xf380('0x83')+_0x2edc99+';');}if(hasTZ){_0x3eeb58[_0xf380('0x45')](insertTzCmHopper(_0x556076['ListId'],_0xf380('0x53'),_0xf380('0x52'),_0xf380('0x84'),_0x1a66ff,tmp_voice_queues));_0x3eeb58['push'](insertTzCmHopperBlack(_0x556076['ListId'],_0xf380('0x85'),'voice_queues',_0xf380('0x84')));_0x3eeb58[_0xf380('0x45')](insertTzCmHopper(_0x556076[_0xf380('0x20')],_0xf380('0x4b'),_0xf380('0x86'),_0xf380('0x87'),_0x1a66ff,tmp_campaigns));_0x3eeb58['push'](insertTzCmHopperBlack(_0x556076[_0xf380('0x20')],_0xf380('0x88'),_0xf380('0x86'),_0xf380('0x87')));}else{_0x3eeb58['push'](insertCmHopper(_0x556076[_0xf380('0x20')],_0xf380('0x53'),_0xf380('0x52'),_0xf380('0x84'),_0x1a66ff));_0x3eeb58[_0xf380('0x45')](insertCmHopperBlack(_0x556076[_0xf380('0x20')],_0xf380('0x85'),_0xf380('0x52'),'VoiceQueueId'));_0x3eeb58[_0xf380('0x45')](insertCmHopper(_0x556076[_0xf380('0x20')],_0xf380('0x4b'),_0xf380('0x86'),_0xf380('0x87'),_0x1a66ff));_0x3eeb58[_0xf380('0x45')](insertCmHopperBlack(_0x556076['ListId'],_0xf380('0x88'),'campaigns',_0xf380('0x87')));}_0x3eeb58[_0xf380('0x45')](_0xf380('0x83')+tmp_campaigns+';');_0x3eeb58[_0xf380('0x45')](_0xf380('0x83')+tmp_voice_queues+';');BPromise[_0xf380('0x81')](_0x3eeb58,handleQuery)[_0xf380('0x4e')](function(_0xf16dd7){stats[_0xf380('0x89')]=!![];stats[_0xf380('0x8a')]=_0x556076[_0xf380('0x7a')]&&_0x556076[_0xf380('0x7a')][_0xf380('0x4c')]?results[0x2][_0xf380('0x8a')]:results[0x0]['affectedRows'];socket['emit'](_0xf380('0x75')+_0x5062e8,stats);fs['unlink'](_0x448a30);fs[_0xf380('0x8b')](_0x1149d8);process['exit'](0x0);})[_0xf380('0x4f')](function(_0x2a90dc){logger['error'](_0x2a90dc[_0xf380('0x42')]);process['exit'](0x1);});});});});}catch(_0x5a8671){logger[_0xf380('0x41')](_0xf380('0x8c'),_0x5a8671[_0xf380('0x42')]);process[_0xf380('0x43')](0x1);}},'error':function(_0x35435f,_0x22f3b1,_0x34a777,_0x440745){throw new Error(_0x440745);}});}function validate(){if(process[_0xf380('0x8d')]&&process[_0xf380('0x8d')][_0xf380('0x4c')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x36d4dc=path['join'](config[_0xf380('0x5e')],_0xf380('0x5f'),process['argv'][0x2]);if(!fs[_0xf380('0x8e')](_0x36d4dc)){throw new Error(_0xf380('0x8f'));}var _0x491dd8={};try{_0x491dd8=JSON[_0xf380('0x90')](process[_0xf380('0x8d')][0x3]);if(!_0x491dd8[_0xf380('0x91')]){throw new Error(_0xf380('0x92'));}if(!_0x491dd8[_0xf380('0x91')][_0xf380('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x491dd8[_0xf380('0x91')][_0xf380('0x72')]){throw new Error('firstName\x20is\x20mandatory');}var _0x48e1d5=0x0;if(_0x491dd8[_0xf380('0x91')][_0xf380('0x24')]){_0x48e1d5=0x1;}if(!_0x491dd8[_0xf380('0x20')]){throw new Error(_0xf380('0x93'));}}catch(_0x3fadf1){throw new Error(_0xf380('0x94'));}var _0x34a4d7=[];try{_0x34a4d7=_[_0xf380('0x95')](JSON['parse'](process[_0xf380('0x8d')][0x4]),'id');}catch(_0x4ccf1c){logger['info'](_0xf380('0x96'));}main(_0x36d4dc,_0x491dd8,_0x34a4d7,_0x48e1d5);}validate();process['on'](_0xf380('0x97'),handleStop);process['on'](_0xf380('0x98'),handleUncaughtException); \ No newline at end of file +var _0xea18=['cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','into','cm_hopper_black','ContactId','ListId','.CmListId','phone','ListId\x20=\x20?','\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','updatedAt','priority','cm_contacts','cm_contacts.createdAt\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','Received\x20SIGINT','message','exit','info','sequelize','query','spread','push','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','all','timezones','dialTimezone','isNil','set','offset','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','errors','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','SystemRow','rows','emit','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','arguments\x20\x20\x20','root','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','\x20=\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','fromQuery','createdAt','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0xea18,0x76));var _0x8ea1=function(_0x11c124,_0x457570){_0x11c124=_0x11c124-0x0;var _0xca9cfa=_0xea18[_0x11c124];return _0xca9cfa;};'use strict';var fs=require('fs');var path=require(_0x8ea1('0x0'));var _=require(_0x8ea1('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x8ea1('0x2'));var moment=require(_0x8ea1('0x3'));var squel=require('squel');var Redis=require(_0x8ea1('0x4'));var db=require(_0x8ea1('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x8ea1('0x6'));var logger=require(_0x8ea1('0x7'))(_0x8ea1('0x8'));config[_0x8ea1('0x9')]=_[_0x8ea1('0xa')](config[_0x8ea1('0x9')],{'host':_0x8ea1('0xb'),'port':0x18eb});var socket=require(_0x8ea1('0xc'))(new Redis(config[_0x8ea1('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x8ea1('0xd')](_0x8ea1('0xe'));function isEmail(_0x5324f1){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'](_0x5324f1);}function selectNotIn(_0x2d2d1b,_0x178e64,_0x1bc668,_0xa41db0,_0x1627b2){return squel[_0x8ea1('0xf')]()[_0x8ea1('0x10')]('phone')[_0x8ea1('0x11')](_0xa41db0)[_0x8ea1('0x12')](_0x178e64,null,_0x178e64+'.id\x20=\x20'+_0xa41db0+'.'+_0x1bc668)['where'](_0xa41db0+'.'+_0x1bc668+_0x8ea1('0x13')+_0x2d2d1b+'.'+_0x1bc668)['where'](_0x178e64+'.dialCheckDuplicateType\x20IN\x20('+_0x1627b2[_0x8ea1('0x12')]()+')');}function insertCmHopper(_0xca3998,_0x53b21c,_0x5b5903,_0x4d71e5,_0xd74270){var _0x3ec05=[_0x8ea1('0x14'),_0x8ea1('0x15'),_0x8ea1('0x16'),_0x8ea1('0x17'),_0x53b21c+'.'+_0x4d71e5,_0x8ea1('0x18'),_0x8ea1('0x19'),_0x8ea1('0x1a'),_0x8ea1('0x1b'),'\x22'+_0xd74270+'\x22'];return squel[_0x8ea1('0x1c')]()['into']('cm_hopper')[_0x8ea1('0x1d')](['phone','scheduledat','ContactId','ListId',_0x4d71e5,_0x8ea1('0x1e'),'updatedAt','priority',_0x8ea1('0x1f'),_0x8ea1('0x20')],squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')](_0x3ec05)[_0x8ea1('0x11')](_0x53b21c)['join']('cm_contacts',null,_0x8ea1('0x22')+_0x53b21c+'.CmListId')[_0x8ea1('0x12')](_0x5b5903,null,_0x5b5903+_0x8ea1('0x23')+_0x53b21c+'.'+_0x4d71e5)[_0x8ea1('0x24')](_0x53b21c+_0x8ea1('0x25'),_0xca3998)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8ea1('0x24')](_0x8ea1('0x26'),selectNotIn(_0x53b21c,_0x5b5903,_0x4d71e5,_0x8ea1('0x27'),['\x22always\x22',_0x8ea1('0x28')]))[_0x8ea1('0x24')](_0x8ea1('0x26'),selectNotIn(_0x53b21c,_0x5b5903,_0x4d71e5,'cm_hopper',[_0x8ea1('0x29')])))['toString']();}function insertCmHopperBlack(_0x3684a9,_0x3bc3c4,_0x413e3c,_0x537199){var _0x1247f6=[_0x8ea1('0x14'),_0x8ea1('0x16'),_0x8ea1('0x17'),_0x3bc3c4+'.'+_0x537199,_0x8ea1('0x18'),_0x8ea1('0x19')];return squel['insert']()[_0x8ea1('0x2a')](_0x8ea1('0x2b'))[_0x8ea1('0x1d')](['phone',_0x8ea1('0x2c'),_0x8ea1('0x2d'),_0x537199,_0x8ea1('0x1e'),'updatedAt'],squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')](_0x1247f6)[_0x8ea1('0x11')](_0x3bc3c4)[_0x8ea1('0x12')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3bc3c4+_0x8ea1('0x2e'))[_0x8ea1('0x12')](_0x413e3c,null,_0x413e3c+'.id\x20=\x20'+_0x3bc3c4+'.'+_0x537199)[_0x8ea1('0x24')](_0x3bc3c4+_0x8ea1('0x25'),_0x3684a9)[_0x8ea1('0x24')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8ea1('0x24')](_0x8ea1('0x26'),squel[_0x8ea1('0xf')]()['field'](_0x8ea1('0x2f'))[_0x8ea1('0x11')](_0x8ea1('0x2b'))[_0x8ea1('0x24')](_0x8ea1('0x30'),_0x3684a9)[_0x8ea1('0x24')](_0x537199+_0x8ea1('0x31'),_0x3bc3c4+'.'+_0x537199)))[_0x8ea1('0x32')]();}function insertTzCmHopper(_0x3209bf,_0x2e9341,_0x4e2935,_0x325cac,_0x356b5d,_0x3621c8){var _0x5af981=['cm_contacts.phone',_0x8ea1('0x33')+_0x3621c8+_0x8ea1('0x34'),_0x8ea1('0x16'),'cm_contacts.ListId',_0x2e9341+'.'+_0x325cac,_0x8ea1('0x18'),_0x8ea1('0x19'),_0x8ea1('0x1a'),_0x8ea1('0x1b'),'\x22'+_0x356b5d+'\x22'];var _0x506f34=squel[_0x8ea1('0x1c')]()[_0x8ea1('0x2a')](_0x8ea1('0x27'))[_0x8ea1('0x1d')]([_0x8ea1('0x2f'),'scheduledat',_0x8ea1('0x2c'),_0x8ea1('0x2d'),_0x325cac,_0x8ea1('0x1e'),_0x8ea1('0x35'),_0x8ea1('0x36'),_0x8ea1('0x1f'),_0x8ea1('0x20')],squel[_0x8ea1('0xf')]()['fields'](_0x5af981)[_0x8ea1('0x11')](_0x2e9341)[_0x8ea1('0x12')](_0x8ea1('0x37'),null,_0x8ea1('0x22')+_0x2e9341+_0x8ea1('0x2e'))[_0x8ea1('0x12')](_0x4e2935,null,_0x4e2935+_0x8ea1('0x23')+_0x2e9341+'.'+_0x325cac)[_0x8ea1('0x12')](_0x3621c8,null,_0x3621c8+_0x8ea1('0x23')+_0x2e9341+'.'+_0x325cac)[_0x8ea1('0x24')](_0x2e9341+'.CmListId\x20=\x20?',_0x3209bf)[_0x8ea1('0x24')](_0x8ea1('0x38'),NOW)[_0x8ea1('0x24')](_0x8ea1('0x26'),selectNotIn(_0x2e9341,_0x4e2935,_0x325cac,_0x8ea1('0x27'),['\x22always\x22',_0x8ea1('0x28')]))[_0x8ea1('0x24')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e9341,_0x4e2935,_0x325cac,_0x8ea1('0x27'),[_0x8ea1('0x29')])))[_0x8ea1('0x32')]();return _0x506f34;}function insertTzCmHopperBlack(_0xd6f7d3,_0x559b4d,_0x201617,_0x278221){var _0x5a0097=[_0x8ea1('0x14'),_0x8ea1('0x16'),_0x8ea1('0x17'),_0x559b4d+'.'+_0x278221,_0x8ea1('0x18'),_0x8ea1('0x19')];return squel[_0x8ea1('0x1c')]()[_0x8ea1('0x2a')]('cm_hopper_black')[_0x8ea1('0x1d')](['phone',_0x8ea1('0x2c'),'ListId',_0x278221,_0x8ea1('0x1e'),_0x8ea1('0x35')],squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')](_0x5a0097)['from'](_0x559b4d)['join'](_0x8ea1('0x37'),null,_0x8ea1('0x22')+_0x559b4d+_0x8ea1('0x2e'))[_0x8ea1('0x12')](_0x201617,null,_0x201617+_0x8ea1('0x23')+_0x559b4d+'.'+_0x278221)[_0x8ea1('0x24')](_0x559b4d+'.CmListId\x20=\x20?',_0xd6f7d3)[_0x8ea1('0x24')](_0x8ea1('0x38'),NOW)[_0x8ea1('0x24')](_0x8ea1('0x26'),squel['select']()[_0x8ea1('0x10')](_0x8ea1('0x2f'))[_0x8ea1('0x11')]('cm_hopper_black')['where'](_0x8ea1('0x30'),_0xd6f7d3)[_0x8ea1('0x24')](_0x278221+_0x8ea1('0x31'),_0x559b4d+'.'+_0x278221)))['toString']();}function insertCmContact(_0x5aee2f,_0x284579,_0x1a2004,_0x146457){var _0x403809=_[_0x8ea1('0x39')](_[_0x8ea1('0x3a')](_0x146457),[_0x8ea1('0x2d'),_0x8ea1('0x3b'),'createdAt',_0x8ea1('0x35')]);return squel['insert']()[_0x8ea1('0x2a')](_0x8ea1('0x37'))[_0x8ea1('0x1d')](_0x403809,squel['select']()[_0x8ea1('0x21')](_0x403809)[_0x8ea1('0x11')](_0x284579)[_0x8ea1('0x24')]('('+_0x1a2004[_0x8ea1('0x12')](',')+_0x8ea1('0x3c'),squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')](_0x1a2004)[_0x8ea1('0x11')](_0x8ea1('0x37'))['where'](_0x8ea1('0x30'),_0x5aee2f)[_0x8ea1('0x24')](_0x8ea1('0x3d')))['where'](_0x8ea1('0x3e'),squel['select']()[_0x8ea1('0x10')]('MIN(id)',_0x8ea1('0x3f'))[_0x8ea1('0x11')](_0x284579)['group'](_0x1a2004[_0x8ea1('0x12')](','))))[_0x8ea1('0x32')]();}function handleStop(){logger['info'](_0x8ea1('0x40'));stopped=!![];}function handleUncaughtException(_0x392799){logger['error'](_0x392799[_0x8ea1('0x41')]);process[_0x8ea1('0x42')](0x1);}function handleError(_0xb83b9f,_0xa673d){stats['errors']['push']({'name':_0xa673d['code'],'message':_0xa673d[_0x8ea1('0x41')],'row':_0xb83b9f});}function handleQuery(_0x458999){logger[_0x8ea1('0x43')](_0x458999);return db[_0x8ea1('0x44')][_0x8ea1('0x45')](_0x458999)[_0x8ea1('0x46')](function(_0x2e0e0c){results[_0x8ea1('0x47')](_0x2e0e0c);})[_0x8ea1('0x48')](function(_0x37feed){logger[_0x8ea1('0x49')](_0x37feed['message']);});}function updateTzCampaigns(_0x5285cd){return new Promise(function(_0x218fdb,_0x520ebd){var _0x290365=squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')]([_0x8ea1('0x4a'),_0x8ea1('0x4b')])[_0x8ea1('0x11')](_0x8ea1('0x4c'))[_0x8ea1('0x12')](_0x8ea1('0x4d'),null,_0x8ea1('0x4e'))[_0x8ea1('0x24')](_0x8ea1('0x4f')+_0x5285cd);db[_0x8ea1('0x44')][_0x8ea1('0x45')](_0x290365['toString']())['spread'](function(_0x48d2a1){var _0x36ea8c=[];for(var _0x5949c4=0x0;_0x5949c4<_0x48d2a1[_0x8ea1('0x50')];_0x5949c4++){_0x36ea8c[_0x8ea1('0x47')](getTimezoneData(_0x48d2a1[_0x5949c4],tmp_campaigns));}BPromise['all'](_0x36ea8c)[_0x8ea1('0x51')](function(){_0x218fdb({'val':0x1});});})[_0x8ea1('0x48')](function(_0x533f40){logger['error'](_0x533f40['message']);_0x218fdb({'val':0x0});});});}function updateTzVoiceQueues(_0x2e6c54){return new Promise(function(_0x3f13fc,_0x3f57cc){var _0x5ebc70=squel[_0x8ea1('0xf')]()[_0x8ea1('0x21')]([_0x8ea1('0x52'),_0x8ea1('0x53')])[_0x8ea1('0x11')](_0x8ea1('0x54'))[_0x8ea1('0x12')](_0x8ea1('0x55'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x8ea1('0x24')]('voice_queues_has_cm_lists.CmListId='+_0x2e6c54);db[_0x8ea1('0x44')][_0x8ea1('0x45')](_0x5ebc70[_0x8ea1('0x32')]())[_0x8ea1('0x46')](function(_0x11c33f){var _0x54596f=[];for(var _0x56a844=0x0;_0x56a844<_0x11c33f['length'];_0x56a844++){_0x54596f[_0x8ea1('0x47')](getTimezoneData(_0x11c33f[_0x56a844],tmp_voice_queues));}BPromise[_0x8ea1('0x56')](_0x54596f)[_0x8ea1('0x51')](function(){_0x3f13fc({'val':0x1});});})[_0x8ea1('0x48')](function(_0x6f7158){logger[_0x8ea1('0x49')](_0x6f7158[_0x8ea1('0x41')]);_0x3f13fc({'val':0x0});});});}function getTimezoneData(_0x5c3a4f,_0x2b6e12){return new Promise(function(_0x3eac5a,_0x504b8a){var _0x3909de=shared[_0x8ea1('0x57')];var _0x14cab1=_0x3909de[_0x5c3a4f[_0x8ea1('0x58')]];if(_[_0x8ea1('0x59')](_0x14cab1)){_0x3eac5a({'ret':0x1});}else{var _0x17bfe6=_0x14cab1['utcOffset'];var _0x4417e4=squel[_0x8ea1('0x1c')]()[_0x8ea1('0x2a')](_0x2b6e12)[_0x8ea1('0x5a')]('id',_0x5c3a4f['id'])[_0x8ea1('0x5a')](_0x8ea1('0x5b'),_0x17bfe6)['set'](_0x8ea1('0x58'),_0x5c3a4f[_0x8ea1('0x58')])[_0x8ea1('0x32')]();return db[_0x8ea1('0x44')][_0x8ea1('0x45')](_0x4417e4)[_0x8ea1('0x46')](function(_0x853571){_0x3eac5a({'ret':0x1});})[_0x8ea1('0x48')](function(_0x13c8e5){logger[_0x8ea1('0x49')](_0x13c8e5[_0x8ea1('0x41')]);_0x504b8a({'ret':0x1});});}});}function handleTZQuery(_0x3be5c8){logger['info'](_0x3be5c8);return db[_0x8ea1('0x44')][_0x8ea1('0x45')](_0x3be5c8)['spread'](function(_0x2ca0af){})['catch'](function(_0x76ff2f){logger[_0x8ea1('0x49')](_0x76ff2f[_0x8ea1('0x41')]);});}function main(_0x52a310,_0x109caa,_0x169157,_0x4f6551){logger[_0x8ea1('0x43')](_0x8ea1('0x5c'),_0x52a310,JSON[_0x8ea1('0x5d')](_0x109caa));process[_0x8ea1('0x5e')](_0x8ea1('0x5f'));var _0x2aa950=_0x109caa[_0x8ea1('0x60')];var _0x46c54d=_0x109caa[_0x8ea1('0x61')];var _0x22c109=path[_0x8ea1('0x12')](config['root'],_0x8ea1('0x62'),_0x46c54d+_0x8ea1('0x63'));hasTZ=_[_0x8ea1('0x3a')](_0x2aa950)[_0x8ea1('0x64')](_0x8ea1('0x58'));var _0x12c56d=_[_0x8ea1('0x3a')](_0x2aa950)[_0x8ea1('0x12')]();logger[_0x8ea1('0x43')](_0x8ea1('0x65'),_0x12c56d);if(hasTZ)_0x12c56d+=_0x8ea1('0x66');fs[_0x8ea1('0x67')](_0x22c109,_0x12c56d+'\x0a');Papa[_0x8ea1('0x68')](fs[_0x8ea1('0x69')](_0x52a310),{'header':!![],'skipEmptyLines':!![],'step':function(_0x21763e,_0x18561a){try{for(var _0x5a8c70=0x0,_0x4d444d=[];_0x5a8c70<_0x21763e[_0x8ea1('0x6a')][_0x8ea1('0x50')];_0x5a8c70++){stats['rows']+=0x1;if(_0x21763e[_0x8ea1('0x6b')][_0x5a8c70]){handleError(_0x21763e[_0x8ea1('0x6a')][_0x5a8c70],_0x21763e['errors'][_0x5a8c70]);}else{var _0x14c21e=[];for(var _0x176e5e in _0x2aa950){if(_0x2aa950['hasOwnProperty'](_0x176e5e)){if(_0x21763e['data'][_0x5a8c70][_0x2aa950[_0x176e5e]]){var _0x2f5c10=_['trim'](_0x21763e[_0x8ea1('0x6a')][_0x5a8c70][_0x2aa950[_0x176e5e]]['replace'](/"/g,'\x27'));switch(_0x176e5e){case _0x8ea1('0x6c'):var _0x585964=moment(_0x2f5c10,_0x8ea1('0xe'),!![]);if(_0x585964[_0x8ea1('0x6d')]()){_0x4d444d['push']('\x22'+_0x2f5c10+'\x22');}else{_0x14c21e['push'](_0x8ea1('0x6e'));}break;case _0x8ea1('0x36'):var _0x4f944a=parseInt(_0x2f5c10);_0x2f5c10=_[_0x8ea1('0x6f')](_0x4f944a)||_0x4f944a<0x0||_0x4f944a>0x4?_0x4f6551?0x3:0x2:_0x4f944a;_0x4d444d[_0x8ea1('0x47')]('\x22'+_0x2f5c10+'\x22');break;case'UserId':var _0x1286af=parseInt(_0x2f5c10);if(_['isNumber'](_0x1286af)&&_['includes'](_0x169157,_0x1286af)){_0x4d444d['push']('\x22'+_0x1286af+'\x22');}else{_0x14c21e[_0x8ea1('0x47')](_0x8ea1('0x70'));}break;case _0x8ea1('0x71'):if(isEmail(_0x2f5c10)){_0x4d444d[_0x8ea1('0x47')]('\x22'+_0x2f5c10+'\x22');}else{_0x14c21e[_0x8ea1('0x47')]('email\x20wrong\x20format');}break;case _0x8ea1('0x72'):var _0x3e6cf0=moment(_0x2f5c10,_0x8ea1('0x73'),!![]);if(_0x3e6cf0[_0x8ea1('0x6d')]()){_0x4d444d[_0x8ea1('0x47')]('\x22'+_0x2f5c10+'\x22');}else{_0x14c21e[_0x8ea1('0x47')](_0x8ea1('0x74'));}break;case _0x8ea1('0x58'):var _0x421497=shared[_0x8ea1('0x57')];var _0x58f034=_0x421497[_0x2f5c10];if(!_[_0x8ea1('0x59')](_0x58f034)){var _0x5c5fa3=_0x58f034[_0x8ea1('0x75')];_0x4d444d['push']('\x22'+_0x2f5c10+'\x22');_0x4d444d[_0x8ea1('0x47')]('\x22'+_0x5c5fa3+'\x22');}break;default:_0x4d444d['push']('\x22'+_0x2f5c10+'\x22');}}else{switch(_0x176e5e){case _0x8ea1('0x76'):case'phone':_0x14c21e[_0x8ea1('0x47')](_0x176e5e+_0x8ea1('0x77'));break;default:_0x4d444d[_0x8ea1('0x47')]('\x22\x22');}}}}if(_0x14c21e['length']){handleError(_0x21763e['data'][_0x5a8c70],{'code':_0x8ea1('0x78'),'message':_0x14c21e[_0x8ea1('0x12')]()});}else{fs['appendFileSync'](_0x22c109,_0x4d444d[_0x8ea1('0x12')]()+'\x0a');}_0x4d444d=[];}if(!(stats[_0x8ea1('0x79')]%0xc8)){socket[_0x8ea1('0x7a')](_0x8ea1('0x7b')+_0x46c54d,stats);stats[_0x8ea1('0x6b')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x18561a[_0x8ea1('0x7c')]();}}catch(_0x364120){handleError(_0x21763e['data'][_0x5a8c70],{'code':'SystemError','message':_0x364120[_0x8ea1('0x41')]});logger['error'](_0x8ea1('0x7d'),_0x364120[_0x8ea1('0x41')]);}},'complete':function(){try{var _0x2f5ae3=[];var _0x3a83d9=[];var _0x1ccdb3=_0x8ea1('0x37');if(_0x109caa['duplicates']&&_0x109caa[_0x8ea1('0x7e')][_0x8ea1('0x50')]){_0x1ccdb3=_0x8ea1('0x7f')+_0x46c54d;_0x2f5ae3[_0x8ea1('0x47')](_0x8ea1('0x80')+_0x1ccdb3+_0x8ea1('0x81'));}tmp_campaigns=_0x8ea1('0x82')+_0x46c54d;tmp_voice_queues=_0x8ea1('0x83')+_0x46c54d;_0x3a83d9[_0x8ea1('0x47')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x8ea1('0x84'));_0x3a83d9[_0x8ea1('0x47')](_0x8ea1('0x80')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x8ea1('0x85')](_0x3a83d9,handleTZQuery)[_0x8ea1('0x51')](function(_0xc81d63){updateTzCampaigns(_0x109caa['ListId'])[_0x8ea1('0x51')](function(_0x2b7d6b){updateTzVoiceQueues(_0x109caa[_0x8ea1('0x2d')])[_0x8ea1('0x51')](function(_0x3f1016){var _0x1a690d=util[_0x8ea1('0xd')](_0x8ea1('0x86'),_0x22c109,_0x1ccdb3,_0x12c56d,_0x109caa[_0x8ea1('0x2d')],_0x109caa[_0x8ea1('0x3b')]||null,NOW,NOW);if(_['isNil'](_0x2aa950[_0x8ea1('0x6c')])){_0x1a690d+=_0x8ea1('0x87');}_0x2f5ae3['push'](_0x1a690d);if(_0x109caa[_0x8ea1('0x7e')]&&_0x109caa[_0x8ea1('0x7e')][_0x8ea1('0x50')]){_0x2f5ae3['push'](insertCmContact(_0x109caa['ListId'],_0x1ccdb3,_0x109caa[_0x8ea1('0x7e')],_0x2aa950));_0x2f5ae3['push'](_0x8ea1('0x88')+_0x1ccdb3+';');}if(hasTZ){_0x2f5ae3['push'](insertTzCmHopper(_0x109caa['ListId'],'voice_queues_has_cm_lists',_0x8ea1('0x54'),_0x8ea1('0x89'),_0x4f6551,tmp_voice_queues));_0x2f5ae3[_0x8ea1('0x47')](insertTzCmHopperBlack(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x8a'),_0x8ea1('0x54'),_0x8ea1('0x89')));_0x2f5ae3[_0x8ea1('0x47')](insertTzCmHopper(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x4d'),_0x8ea1('0x4c'),_0x8ea1('0x8b'),_0x4f6551,tmp_campaigns));_0x2f5ae3[_0x8ea1('0x47')](insertTzCmHopperBlack(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x8c'),_0x8ea1('0x4c'),'CampaignId'));}else{_0x2f5ae3['push'](insertCmHopper(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x55'),_0x8ea1('0x54'),_0x8ea1('0x89'),_0x4f6551));_0x2f5ae3['push'](insertCmHopperBlack(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x8a'),_0x8ea1('0x54'),_0x8ea1('0x89')));_0x2f5ae3[_0x8ea1('0x47')](insertCmHopper(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x4d'),_0x8ea1('0x4c'),'CampaignId',_0x4f6551));_0x2f5ae3[_0x8ea1('0x47')](insertCmHopperBlack(_0x109caa[_0x8ea1('0x2d')],_0x8ea1('0x8c'),_0x8ea1('0x4c'),'CampaignId'));}_0x2f5ae3['push']('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x2f5ae3['push'](_0x8ea1('0x88')+tmp_voice_queues+';');BPromise[_0x8ea1('0x85')](_0x2f5ae3,handleQuery)[_0x8ea1('0x51')](function(_0x2d1aa6){stats[_0x8ea1('0x8d')]=!![];stats[_0x8ea1('0x8e')]=_0x109caa[_0x8ea1('0x7e')]&&_0x109caa[_0x8ea1('0x7e')][_0x8ea1('0x50')]?results[0x2][_0x8ea1('0x8e')]:results[0x0][_0x8ea1('0x8e')];socket['emit'](_0x8ea1('0x7b')+_0x46c54d,stats);fs[_0x8ea1('0x8f')](_0x52a310);fs[_0x8ea1('0x8f')](_0x22c109);process[_0x8ea1('0x42')](0x0);})[_0x8ea1('0x48')](function(_0x1c4dff){logger[_0x8ea1('0x49')](_0x1c4dff[_0x8ea1('0x41')]);process[_0x8ea1('0x42')](0x1);});});});});}catch(_0x5ae7da){logger[_0x8ea1('0x49')]('complete',_0x5ae7da[_0x8ea1('0x41')]);process[_0x8ea1('0x42')](0x1);}},'error':function(_0x28a7fd,_0x3578ba,_0x1030a9,_0x4ba47e){throw new Error(_0x4ba47e);}});}function validate(){if(process['argv']&&process['argv'][_0x8ea1('0x50')]<0x4){throw new Error(_0x8ea1('0x90'));}var _0x485e77=path[_0x8ea1('0x12')](config[_0x8ea1('0x91')],_0x8ea1('0x62'),process[_0x8ea1('0x92')][0x2]);if(!fs[_0x8ea1('0x93')](_0x485e77)){throw new Error(_0x8ea1('0x94'));}var _0x2a57d7={};try{_0x2a57d7=JSON[_0x8ea1('0x68')](process['argv'][0x3]);if(!_0x2a57d7['binding']){throw new Error(_0x8ea1('0x95'));}if(!_0x2a57d7['binding'][_0x8ea1('0x2f')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x2a57d7['binding']['firstName']){throw new Error(_0x8ea1('0x96'));}var _0x587c06=0x0;if(_0x2a57d7[_0x8ea1('0x60')][_0x8ea1('0x1f')]){_0x587c06=0x1;}if(!_0x2a57d7[_0x8ea1('0x2d')]){throw new Error(_0x8ea1('0x97'));}}catch(_0x1ce0d5){throw new Error(_0x8ea1('0x98'));}var _0x8b9231=[];try{_0x8b9231=_[_0x8ea1('0x99')](JSON['parse'](process[_0x8ea1('0x92')][0x4]),'id');}catch(_0x139c6e){logger[_0x8ea1('0x43')](_0x8ea1('0x9a'));}main(_0x485e77,_0x2a57d7,_0x8b9231,_0x587c06);}validate();process['on'](_0x8ea1('0x9b'),handleStop);process['on'](_0x8ea1('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 77a9158..5ee4322 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 _0x7426=['keyValue','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','agentcalledAt','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','uniqueid','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','calleridnum','outbound','push','Outbound\x20Call','variable','destcalleridnum','***\x20Call\x20Info\x20***'];(function(_0x200ced,_0x503efa){var _0x28e175=function(_0x450010){while(--_0x450010){_0x200ced['push'](_0x200ced['shift']());}};_0x28e175(++_0x503efa);}(_0x7426,0xef));var _0x6742=function(_0x11ace1,_0x47e61d){_0x11ace1=_0x11ace1-0x0;var _0x57287f=_0x7426[_0x11ace1];return _0x57287f;};'use strict';exports[_0x6742('0x0')]=function(_0x211432,_0x499e2e){var _0x56c6b4=[{'type':_0x6742('0x1'),'content':_0x6742('0x2'),'variableName':null}];switch(_0x211432['toLowerCase']()){case _0x6742('0x3'):switch(_0x499e2e[_0x6742('0x4')]()){case _0x6742('0x5'):_0x56c6b4['push']({'type':'variable','content':'','variableName':'queue'});_0x56c6b4['push']({'type':'variable','content':'','variableName':_0x6742('0x6')});break;case _0x6742('0x7'):_0x56c6b4[_0x6742('0x8')]({'type':_0x6742('0x1'),'content':_0x6742('0x9'),'variableName':null});_0x56c6b4[_0x6742('0x8')]({'type':_0x6742('0xa'),'content':'','variableName':_0x6742('0xb')});break;}}return _0x56c6b4;};exports['getDescriptions']=function(_0x2b04d8,_0x1d77ef){var _0x4e3911=[];switch(_0x2b04d8[_0x6742('0x4')]()){case'voice':switch(_0x1d77ef[_0x6742('0x4')]()){case _0x6742('0x5'):_0x4e3911=[{'type':_0x6742('0x1'),'content':_0x6742('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x6742('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':_0x6742('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x6742('0xa'),'variableName':_0x6742('0xe')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0xf'),'keyType':'variable','variableName':_0x6742('0x10')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x11'),'keyType':_0x6742('0xa'),'variableName':_0x6742('0x12')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x13'),'keyType':_0x6742('0xa'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0x6742('0xa'),'variableName':_0x6742('0x14')},{'type':_0x6742('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x6742('0xd'),'content':'','key':'Agent\x20Name','keyType':_0x6742('0xa'),'variableName':'destcalleridname'},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x15'),'keyType':'variable','variableName':_0x6742('0xb')},{'type':_0x6742('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x16'),'keyType':_0x6742('0xa'),'variableName':_0x6742('0x14')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x17'),'keyType':_0x6742('0xa'),'variableName':_0x6742('0x18')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x19'),'keyType':_0x6742('0xa'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x6742('0x1a'),'keyType':_0x6742('0xa'),'variableName':_0x6742('0x1b')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x1c'),'keyType':_0x6742('0xa'),'variableName':'talktime'}];break;case'outbound':_0x4e3911=[{'type':_0x6742('0x1'),'content':_0x6742('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0x6742('0x1d'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0xb')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x1e'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0x1f')},{'type':'keyValue','content':'','key':_0x6742('0x13'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0x20')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x21'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0x22')},{'type':'string','content':_0x6742('0x23')},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x24'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0x25')},{'type':'keyValue','content':'','key':_0x6742('0x26'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':'endtime'},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x27'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x6742('0xd'),'content':'','key':_0x6742('0x28'),'keyType':_0x6742('0xa'),'keyContent':'','variableName':_0x6742('0x29')}];break;}}return _0x4e3911;}; \ No newline at end of file +var _0xdccb=['Call\x20To','destexten','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Hold\x20Time','holdtime','talktime','Called\x20Number','destcalleridnum','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname'];(function(_0x4e9d91,_0x24786e){var _0x4c36e0=function(_0x403b66){while(--_0x403b66){_0x4e9d91['push'](_0x4e9d91['shift']());}};_0x4c36e0(++_0x24786e);}(_0xdccb,0x73));var _0xbdcc=function(_0x35a260,_0x2ddf05){_0x35a260=_0x35a260-0x0;var _0xabb77b=_0xdccb[_0x35a260];return _0xabb77b;};'use strict';exports[_0xbdcc('0x0')]=function(_0xe9423e,_0x318d06){var _0x72d3a=[{'type':_0xbdcc('0x1'),'content':_0xbdcc('0x2'),'variableName':null}];switch(_0xe9423e[_0xbdcc('0x3')]()){case _0xbdcc('0x4'):switch(_0x318d06['toLowerCase']()){case _0xbdcc('0x5'):_0x72d3a[_0xbdcc('0x6')]({'type':_0xbdcc('0x7'),'content':'','variableName':_0xbdcc('0x8')});_0x72d3a[_0xbdcc('0x6')]({'type':_0xbdcc('0x7'),'content':'','variableName':'calleridnum'});break;case _0xbdcc('0x9'):_0x72d3a[_0xbdcc('0x6')]({'type':'string','content':_0xbdcc('0xa'),'variableName':null});_0x72d3a[_0xbdcc('0x6')]({'type':_0xbdcc('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x72d3a;};exports[_0xbdcc('0xb')]=function(_0x1ef6c1,_0x23df68){var _0x386ec2=[];switch(_0x1ef6c1['toLowerCase']()){case _0xbdcc('0x4'):switch(_0x23df68['toLowerCase']()){case _0xbdcc('0x5'):_0x386ec2=[{'type':'string','content':_0xbdcc('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0xe'),'keyType':'variable','variableName':_0xbdcc('0xf')},{'type':_0xbdcc('0xd'),'content':'','key':'Caller\x20Name','keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x10')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x11'),'keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x12')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x13'),'keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x8')},{'type':_0xbdcc('0xd'),'content':'','key':'UniqueId','keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x14')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x15'),'keyType':_0xbdcc('0x7'),'variableName':'agentcalledAt'},{'type':_0xbdcc('0x1'),'content':_0xbdcc('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x17')},{'type':_0xbdcc('0xd'),'content':'','key':'Agent\x20Number','keyType':_0xbdcc('0x7'),'variableName':'destcalleridnum'},{'type':_0xbdcc('0x1'),'content':_0xbdcc('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbdcc('0x19'),'keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x1a')},{'type':'keyValue','content':'','key':_0xbdcc('0x1b'),'keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x1c')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x1d'),'keyType':_0xbdcc('0x7'),'variableName':_0xbdcc('0x1e')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xbdcc('0x1f')}];break;case _0xbdcc('0x9'):_0x386ec2=[{'type':_0xbdcc('0x1'),'content':_0xbdcc('0xc'),'variableName':null},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x20'),'keyType':'variable','keyContent':'','variableName':_0xbdcc('0x21')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x22'),'keyType':'variable','keyContent':'','variableName':_0xbdcc('0x23')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x24'),'keyType':_0xbdcc('0x7'),'keyContent':'','variableName':_0xbdcc('0x14')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x15'),'keyType':_0xbdcc('0x7'),'keyContent':'','variableName':_0xbdcc('0x25')},{'type':_0xbdcc('0x1'),'content':_0xbdcc('0x18')},{'type':'keyValue','content':'','key':_0xbdcc('0x26'),'keyType':'variable','keyContent':'','variableName':_0xbdcc('0x27')},{'type':'keyValue','content':'','key':_0xbdcc('0x28'),'keyType':'variable','keyContent':'','variableName':_0xbdcc('0x29')},{'type':_0xbdcc('0xd'),'content':'','key':'Duration','keyType':_0xbdcc('0x7'),'keyContent':'','variableName':_0xbdcc('0x2a')},{'type':_0xbdcc('0xd'),'content':'','key':_0xbdcc('0x2b'),'keyType':_0xbdcc('0x7'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x386ec2;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 2acb4a2..fc19005 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 _0x6f43=['mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','then','update','info','tracked','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x1bb585,_0x2f6dd5){var _0x5b7c7f=function(_0x2f2b85){while(--_0x2f2b85){_0x1bb585['push'](_0x1bb585['shift']());}};_0x5b7c7f(++_0x2f6dd5);}(_0x6f43,0x1a0));var _0x36f4=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x6f43[_0x107f10];return _0x811cab;};'use strict';var _=require(_0x36f4('0x0'));var db=require(_0x36f4('0x1'))['db'];var loggers={'openchannel':require(_0x36f4('0x2'))(_0x36f4('0x3')),'mail':require('../../config/logger')(_0x36f4('0x4')),'fax':require(_0x36f4('0x2'))(_0x36f4('0x5')),'sms':require(_0x36f4('0x2'))(_0x36f4('0x6')),'chat':require('../../config/logger')(_0x36f4('0x7')),'whatsapp':require('../../config/logger')(_0x36f4('0x8'))};function getInteractionId(_0xc3cbbc,_0x3f67f0,_0x26deb6){if(_0xc3cbbc&&_0xc3cbbc[_['upperFirst'](_0x26deb6)+_0x36f4('0x9')]){return _0xc3cbbc[_[_0x36f4('0xa')](_0x26deb6)+_0x36f4('0x9')];}else if(_0xc3cbbc&&_0xc3cbbc['id']){return _0xc3cbbc['id'];}else if(_0x3f67f0&&_0x3f67f0['id']){return _0x3f67f0['id'];}else{return _0x36f4('0xb');}}function log(_0x4eeb76,_0x42992a,_0x49d17d,_0x254771,_0x2eb9ca,_0x44b62e){loggers[_0x2eb9ca[_0x36f4('0xc')]()][_0x4eeb76](_0x36f4('0xd'),_0x44b62e[_0x36f4('0xe')](),_0x42992a?_0x42992a['id']:null,_0x42992a?_0x42992a[_0x36f4('0xf')]:null,_0x42992a?_0x42992a[_0x36f4('0x10')]:null,getInteractionId(_0x49d17d,_0x254771,_0x2eb9ca),_0x49d17d?JSON['stringify'](_0x49d17d):_0x36f4('0x11'));}function updateUser(_0x5a66d3,_0x15a41b,_0x2e637a,_0x3ffadc,_0x5a2992){db[_[_0x36f4('0xa')](_0x3ffadc)+_0x36f4('0x12')]['findOne']({'where':{'id':getInteractionId(_0x15a41b,_0x2e637a,_0x3ffadc)}})[_0x36f4('0x13')](function(_0x40cc06){if(_0x40cc06){return _0x40cc06[_0x36f4('0x14')]({'UserId':_0x5a66d3?_0x5a66d3['id']:null});}})[_0x36f4('0x13')](function(_0x4db2c1){if(_0x4db2c1){log(_0x36f4('0x15'),_0x5a66d3,_0x15a41b,_0x2e637a,_0x3ffadc,_0x5a2992);}})['catch'](function(){log('error',_0x5a66d3,_0x15a41b,_0x2e637a,_0x3ffadc,_0x5a2992);});}exports[_0x36f4('0x16')]=function(_0x3dd23d,_0x461ec7){return function(_0x2222a5,_0x5f2244,_0x54d7da){var _0x5cec37=_0x2222a5[_0x36f4('0x17')];var _0xd63f8b={};var _0x51b71e=_0x2222a5['query'];if(_0xd63f8b){_0xd63f8b=_[_0x36f4('0x18')](_0x2222a5[_0x36f4('0x19')]);_0xd63f8b=_[_0x36f4('0x1a')](_0xd63f8b,[_0x36f4('0x19'),_0x36f4('0x1b'),_0x36f4('0x1c'),_0x36f4('0x1d'),'mobile']);}updateUser(_0x5cec37,_0xd63f8b,_0x51b71e,_0x3dd23d,_0x461ec7);_0x54d7da(null);};}; \ No newline at end of file +var _0xfdee=['user','clone','body','omit','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','then','update','info','error'];(function(_0x18b793,_0x113e94){var _0x152986=function(_0x1ce2d8){while(--_0x1ce2d8){_0x18b793['push'](_0x18b793['shift']());}};_0x152986(++_0x113e94);}(_0xfdee,0xf6));var _0xefde=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0xfdee[_0x160248];return _0x4e589d;};'use strict';var _=require(_0xefde('0x0'));var db=require(_0xefde('0x1'))['db'];var loggers={'openchannel':require(_0xefde('0x2'))(_0xefde('0x3')),'mail':require(_0xefde('0x2'))(_0xefde('0x4')),'fax':require(_0xefde('0x2'))(_0xefde('0x5')),'sms':require(_0xefde('0x2'))(_0xefde('0x6')),'chat':require(_0xefde('0x2'))(_0xefde('0x7')),'whatsapp':require(_0xefde('0x2'))(_0xefde('0x8'))};function getInteractionId(_0x539b2f,_0x5c5ce7,_0x2617c0){if(_0x539b2f&&_0x539b2f[_[_0xefde('0x9')](_0x2617c0)+_0xefde('0xa')]){return _0x539b2f[_[_0xefde('0x9')](_0x2617c0)+_0xefde('0xa')];}else if(_0x539b2f&&_0x539b2f['id']){return _0x539b2f['id'];}else if(_0x5c5ce7&&_0x5c5ce7['id']){return _0x5c5ce7['id'];}else{return _0xefde('0xb');}}function log(_0x5b052f,_0x5f5cf8,_0x1a7b0b,_0x528e56,_0x10e4e4,_0x3e3139){loggers[_0x10e4e4[_0xefde('0xc')]()][_0x5b052f](_0xefde('0xd'),_0x3e3139[_0xefde('0xe')](),_0x5f5cf8?_0x5f5cf8['id']:null,_0x5f5cf8?_0x5f5cf8['name']:null,_0x5f5cf8?_0x5f5cf8[_0xefde('0xf')]:null,getInteractionId(_0x1a7b0b,_0x528e56,_0x10e4e4),_0x1a7b0b?JSON[_0xefde('0x10')](_0x1a7b0b):_0xefde('0x11'));}function updateUser(_0x4bf7ad,_0x79997f,_0x20a42e,_0x4b2fda,_0x2c3679){db[_[_0xefde('0x9')](_0x4b2fda)+_0xefde('0x12')][_0xefde('0x13')]({'where':{'id':getInteractionId(_0x79997f,_0x20a42e,_0x4b2fda)}})[_0xefde('0x14')](function(_0x45c85e){if(_0x45c85e){return _0x45c85e[_0xefde('0x15')]({'UserId':_0x4bf7ad?_0x4bf7ad['id']:null});}})[_0xefde('0x14')](function(_0x52c5ba){if(_0x52c5ba){log(_0xefde('0x16'),_0x4bf7ad,_0x79997f,_0x20a42e,_0x4b2fda,_0x2c3679);}})['catch'](function(){log(_0xefde('0x17'),_0x4bf7ad,_0x79997f,_0x20a42e,_0x4b2fda,_0x2c3679);});}exports['tracked']=function(_0x41130b,_0x30ce57){return function(_0x43e96e,_0x1da8c7,_0x188a67){var _0x341478=_0x43e96e[_0xefde('0x18')];var _0x5362d7={};var _0x3fef9b=_0x43e96e['query'];if(_0x5362d7){_0x5362d7=_[_0xefde('0x19')](_0x43e96e[_0xefde('0x1a')]);_0x5362d7=_[_0xefde('0x1b')](_0x5362d7,[_0xefde('0x1a'),'html','phone',_0xefde('0x1c'),_0xefde('0x1d')]);}updateUser(_0x341478,_0x5362d7,_0x3fef9b,_0x41130b,_0x30ce57);_0x188a67(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 8243ad6..6414e03 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 _0x36e0=['hasOwnProperty','use','findOne','then','status','json','format','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','parse'];(function(_0x291fe6,_0x187710){var _0x3f219f=function(_0x164f6c){while(--_0x164f6c){_0x291fe6['push'](_0x291fe6['shift']());}};_0x3f219f(++_0x187710);}(_0x36e0,0x1cd));var _0x036e=function(_0xf6d96a,_0x8662ea){_0xf6d96a=_0xf6d96a-0x0;var _0xca4c0e=_0x36e0[_0xf6d96a];return _0xca4c0e;};'use strict';var crypto=require(_0x036e('0x0'));var util=require(_0x036e('0x1'));var compose=require(_0x036e('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x036e('0x3'));function getValueFromLicense(_0x46e6d0,_0x2b2f10){if(_0x46e6d0&&_0x2b2f10){if(_0x2b2f10[_0x036e('0x4')]&&_0x2b2f10['license']){var _0x22e0be=_0x2b2f10['data1'];var _0x41881b=_0x2b2f10[_0x036e('0x5')];var _0x6cc1b5=_0x22e0be[_0x036e('0x6')]('-')[0x4];var _0x5c3bc8=_0x22e0be[_0x036e('0x6')]('-')[0x0];var _0x2227ef=crypto[_0x036e('0x7')](_0x036e('0x8'),util['format'](_0x036e('0x9'),_0x6cc1b5,_0x22e0be,_0x5c3bc8));var _0x205280=_0x2227ef[_0x036e('0xa')](_0x41881b,_0x036e('0xb'),_0x036e('0xc'));_0x205280+=_0x2227ef[_0x036e('0xd')]('utf8');var _0x4eefe2=JSON[_0x036e('0xe')](_0x205280);return _0x4eefe2[_0x036e('0xf')](_0x46e6d0)?_0x4eefe2[_0x46e6d0]:null;}}return null;}function isLimit(_0xd82fd5,_0x46cd90,_0x54b650,_0x4c775e){var _0x3fdec4=_0x46cd90;return compose()[_0x036e('0x10')](function(_0x2b27de,_0x1a6a8d,_0x5d459b){return db['License'][_0x036e('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x036e('0x12')](function(_0x581105){var _0x4403d5=getValueFromLicense(_0xd82fd5,_0x581105);return _0x4403d5?_0x4403d5:_0x3fdec4;})[_0x036e('0x12')](function(_0x3d4b03){_0x3fdec4=_0x3d4b03;return _0x54b650['count'](_0x4c775e);})['then'](function(_0x20adc3){if(_0x20adc3>=_0x3fdec4){return _0x1a6a8d[_0x036e('0x13')](0x193)[_0x036e('0x14')]({'message':util[_0x036e('0x15')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xd82fd5)});}_0x5d459b();})[_0x036e('0x16')](function(_0x30f16b){_0x5d459b(_0x30f16b);});});}function isUserLimit(){return isLimit(_0x036e('0x17'),0x1,db[_0x036e('0x18')],{'where':{'$or':[{'role':_0x036e('0x19')},{'role':_0x036e('0x1a')}]}});}exports[_0x036e('0x1b')]=isUserLimit; \ No newline at end of file +var _0x67d9=['crypto','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit'];(function(_0x31de18,_0x1bf7cb){var _0x1a15c2=function(_0xdf3939){while(--_0xdf3939){_0x31de18['push'](_0x31de18['shift']());}};_0x1a15c2(++_0x1bf7cb);}(_0x67d9,0x16c));var _0x967d=function(_0x466900,_0x3aba67){_0x466900=_0x466900-0x0;var _0xba8555=_0x67d9[_0x466900];return _0xba8555;};'use strict';var crypto=require(_0x967d('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x967d('0x1'))['db'];var config=require(_0x967d('0x2'));function getValueFromLicense(_0x42964b,_0x683907){if(_0x42964b&&_0x683907){if(_0x683907[_0x967d('0x3')]&&_0x683907[_0x967d('0x4')]){var _0x27e272=_0x683907[_0x967d('0x3')];var _0x1c2681=_0x683907[_0x967d('0x4')];var _0x106c1a=_0x27e272['split']('-')[0x4];var _0x1222ee=_0x27e272[_0x967d('0x5')]('-')[0x0];var _0xc6d27c=crypto[_0x967d('0x6')](_0x967d('0x7'),util[_0x967d('0x8')]('%s:%s:%s',_0x106c1a,_0x27e272,_0x1222ee));var _0x115833=_0xc6d27c[_0x967d('0x9')](_0x1c2681,_0x967d('0xa'),_0x967d('0xb'));_0x115833+=_0xc6d27c['final'](_0x967d('0xb'));var _0x39f061=JSON[_0x967d('0xc')](_0x115833);return _0x39f061[_0x967d('0xd')](_0x42964b)?_0x39f061[_0x42964b]:null;}}return null;}function isLimit(_0x223c98,_0x203d44,_0x2b2706,_0x83ffe){var _0x2d4105=_0x203d44;return compose()[_0x967d('0xe')](function(_0x290d67,_0x3df0d7,_0x233282){return db['License'][_0x967d('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x967d('0x10')](function(_0x6e39d1){var _0x5c45dc=getValueFromLicense(_0x223c98,_0x6e39d1);return _0x5c45dc?_0x5c45dc:_0x2d4105;})[_0x967d('0x10')](function(_0x2c6ab3){_0x2d4105=_0x2c6ab3;return _0x2b2706[_0x967d('0x11')](_0x83ffe);})[_0x967d('0x10')](function(_0x28daaf){if(_0x28daaf>=_0x2d4105){return _0x3df0d7[_0x967d('0x12')](0x193)[_0x967d('0x13')]({'message':util['format'](_0x967d('0x14'),_0x223c98)});}_0x233282();})[_0x967d('0x15')](function(_0x28b2ff){_0x233282(_0x28b2ff);});});}function isUserLimit(){return isLimit(_0x967d('0x16'),0x1,db[_0x967d('0x17')],{'where':{'$or':[{'role':_0x967d('0x18')},{'role':'user'}]}});}exports[_0x967d('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 5bfb749..9eef89d 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 _0x1d81=['$in','$notIn','$eq','=\x20?','$ne','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$gt','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','add','seconds','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','text','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x1d81,0x191));var _0x11d8=function(_0x8fb035,_0x217b6d){_0x8fb035=_0x8fb035-0x0;var _0x3a678d=_0x1d81[_0x8fb035];return _0x3a678d;};'use strict';var _=require('lodash');var moment=require(_0x11d8('0x0'));exports[_0x11d8('0x1')]=function(_0x464040){var _0x25be73={'conditions':[]};_0x25be73[_0x11d8('0x2')]=_['startsWith'](_0x464040,_0x11d8('0x3'))?'or':_0x11d8('0x4');var _0x174b91=_0x464040[_0x11d8('0x5')](_0x11d8('0x6'),'')[_0x11d8('0x5')]('[$or]','')[_0x11d8('0x7')]('||');for(var _0x5bc64d=0x0;_0x5bc64d<_0x174b91[_0x11d8('0x8')];_0x5bc64d++){var _0x31beef=_0x174b91[_0x5bc64d][_0x11d8('0x7')](':=');var _0xeaf028=_0x31beef[0x0];var _0x19e18f=_0x31beef[_0x11d8('0x9')](0x1);_0x19e18f[_0x11d8('0xa')](function(_0x48e0f4){var _0x17aa1c=_0x48e0f4[_0x11d8('0x7')]('[')[_0x11d8('0xb')]();var _0x4bf72c=_0x48e0f4[_0x11d8('0xc')](/\[(.*?)\]/g);_0x4bf72c['forEach'](function(_0x567792){var _0x482ef9=_0x567792[_0x11d8('0x7')]('[')['filter'](function(_0x277dae){return _0x277dae[_0x11d8('0xd')](']')>-0x1;})[_0x11d8('0xe')](function(_0x3873be){return _0x3873be['split'](']')[0x0];})[0x0];_0x25be73[_0x11d8('0xf')][_0x11d8('0x10')]({'field':_0xeaf028,'operator':_0x17aa1c,'value':_0x482ef9});});});}return _0x25be73;};exports[_0x11d8('0x11')]=function(_0x568054,_0x8c9b63,_0x336de9){var _0x82f697={};if(_0x8c9b63==='DATE'){if(_0x336de9['operator']==='$eq'){_0x336de9[_0x11d8('0x12')]=_0x11d8('0x13');_0x336de9[_0x11d8('0x14')]+=','+_0x336de9[_0x11d8('0x14')];}else if(_[_0x11d8('0x15')](['$gt','$lte'],_0x336de9[_0x11d8('0x12')])){_0x336de9[_0x11d8('0x14')]=moment(_0x336de9[_0x11d8('0x14')])['add'](0x1,_0x11d8('0x16'))[_0x11d8('0x17')](_0x11d8('0x18'));}}if(_0x336de9[_0x11d8('0x19')]){_0x8c9b63=_0x336de9['castTo'];_0x82f697['text']='CAST('+_0x568054+'.'+_0x336de9[_0x11d8('0x1a')]+_0x11d8('0x1b')+_0x336de9['castTo']+')\x20'+parseOperator(_0x336de9[_0x11d8('0x12')]);}else{_0x82f697[_0x11d8('0x1c')]=_0x568054+'.'+_0x336de9[_0x11d8('0x1a')]+'\x20'+parseOperator(_0x336de9[_0x11d8('0x12')]);}if(_[_0x11d8('0x15')](['$ne','$notIn'],_0x336de9[_0x11d8('0x12')]))_0x82f697[_0x11d8('0x1c')]='('+_0x82f697[_0x11d8('0x1c')]+_0x11d8('0x1d')+_0x568054+'.'+_0x336de9['field']+_0x11d8('0x1e');_0x82f697['value']=parseValue(_0x8c9b63,_0x336de9['operator'],_0x336de9[_0x11d8('0x14')]);return _0x82f697;};function parseOperator(_0x1fc139){var _0x1480b6;switch(_0x1fc139){case _0x11d8('0x1f'):_0x1480b6='IN\x20?';break;case _0x11d8('0x20'):_0x1480b6='NOT\x20IN\x20?';break;case _0x11d8('0x21'):_0x1480b6=_0x11d8('0x22');break;case _0x11d8('0x23'):_0x1480b6='<>\x20?';break;case _0x11d8('0x24'):case _0x11d8('0x25'):case _0x11d8('0x26'):_0x1480b6=_0x11d8('0x27');break;case _0x11d8('0x28'):_0x1480b6='<\x20?';break;case _0x11d8('0x29'):_0x1480b6=_0x11d8('0x2a');break;case _0x11d8('0x2b'):_0x1480b6=_0x11d8('0x2c');break;case _0x11d8('0x2d'):_0x1480b6='>=\x20?';break;case _0x11d8('0x13'):_0x1480b6=_0x11d8('0x2e');break;}return _0x1480b6;}function parseValue(_0x3b03a2,_0x2b6c0b,_0x149821){var _0x8e5819={'start':undefined,'end':undefined};switch(_0x2b6c0b){case _0x11d8('0x1f'):case _0x11d8('0x20'):_0x8e5819[_0x11d8('0x2f')]=_0x149821[_0x11d8('0x7')](',');break;case _0x11d8('0x24'):_0x8e5819[_0x11d8('0x2f')]='%'+_0x149821+'%';break;case _0x11d8('0x25'):_0x8e5819[_0x11d8('0x2f')]=_0x149821+'%';break;case _0x11d8('0x26'):_0x8e5819[_0x11d8('0x2f')]='%'+_0x149821;break;case _0x11d8('0x13'):var _0x30cd91=_0x149821[_0x11d8('0x7')](',');var _0x149821=_0x30cd91[_0x11d8('0xb')]();var _0x4b9c8e=_0x30cd91[_0x11d8('0x30')]();if(_0x3b03a2==='DATE'){_0x149821=moment(_0x149821)[_0x11d8('0x31')](0x0,!![])['format']();_0x4b9c8e=moment(_0x4b9c8e)[_0x11d8('0x31')](0x0,!![])['add'](0x17,_0x11d8('0x32'))['add'](0x3b,_0x11d8('0x33'))[_0x11d8('0x34')](0x3b,_0x11d8('0x35'))[_0x11d8('0x17')]();}_0x8e5819={'start':_0x149821,'end':_0x4b9c8e};break;default:_0x8e5819['start']=_0x149821;break;}return _0x8e5819;} \ No newline at end of file +var _0xefed=['push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions'];(function(_0x544b32,_0x19ea4a){var _0x4b7867=function(_0x6ab868){while(--_0x6ab868){_0x544b32['push'](_0x544b32['shift']());}};_0x4b7867(++_0x19ea4a);}(_0xefed,0x126));var _0xdefe=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0xefed[_0x2a94cf];return _0x22147f;};'use strict';var _=require(_0xdefe('0x0'));var moment=require(_0xdefe('0x1'));exports[_0xdefe('0x2')]=function(_0x12b203){var _0x309486={'conditions':[]};_0x309486[_0xdefe('0x3')]=_[_0xdefe('0x4')](_0x12b203,_0xdefe('0x5'))?'or':_0xdefe('0x6');var _0x3dcdbc=_0x12b203['replace'](_0xdefe('0x7'),'')['replace']('[$or]','')[_0xdefe('0x8')]('||');for(var _0x522ab1=0x0;_0x522ab1<_0x3dcdbc[_0xdefe('0x9')];_0x522ab1++){var _0x3f31bd=_0x3dcdbc[_0x522ab1]['split'](':=');var _0x3e7408=_0x3f31bd[0x0];var _0x26d01e=_0x3f31bd[_0xdefe('0xa')](0x1);_0x26d01e[_0xdefe('0xb')](function(_0x2be32c){var _0x9455d3=_0x2be32c[_0xdefe('0x8')]('[')[_0xdefe('0xc')]();var _0x1432a1=_0x2be32c[_0xdefe('0xd')](/\[(.*?)\]/g);_0x1432a1[_0xdefe('0xb')](function(_0x3d2ad4){var _0x11d5a0=_0x3d2ad4[_0xdefe('0x8')]('[')[_0xdefe('0xe')](function(_0x363ca3){return _0x363ca3[_0xdefe('0xf')](']')>-0x1;})[_0xdefe('0x10')](function(_0x50dadd){return _0x50dadd[_0xdefe('0x8')](']')[0x0];})[0x0];_0x309486[_0xdefe('0x11')][_0xdefe('0x12')]({'field':_0x3e7408,'operator':_0x9455d3,'value':_0x11d5a0});});});}return _0x309486;};exports[_0xdefe('0x13')]=function(_0x387b4a,_0x17a67a,_0x1685c8){var _0x4e6c73={};if(_0x17a67a===_0xdefe('0x14')){if(_0x1685c8[_0xdefe('0x15')]===_0xdefe('0x16')){_0x1685c8['operator']='$between';_0x1685c8[_0xdefe('0x17')]+=','+_0x1685c8['value'];}else if(_[_0xdefe('0x18')]([_0xdefe('0x19'),_0xdefe('0x1a')],_0x1685c8[_0xdefe('0x15')])){_0x1685c8[_0xdefe('0x17')]=moment(_0x1685c8[_0xdefe('0x17')])[_0xdefe('0x1b')](0x1,'days')[_0xdefe('0x1c')](_0xdefe('0x1d'));}}if(_0x1685c8['castTo']){_0x17a67a=_0x1685c8[_0xdefe('0x1e')];_0x4e6c73[_0xdefe('0x1f')]='CAST('+_0x387b4a+'.'+_0x1685c8['field']+_0xdefe('0x20')+_0x1685c8[_0xdefe('0x1e')]+')\x20'+parseOperator(_0x1685c8[_0xdefe('0x15')]);}else{_0x4e6c73[_0xdefe('0x1f')]=_0x387b4a+'.'+_0x1685c8['field']+'\x20'+parseOperator(_0x1685c8['operator']);}if(_[_0xdefe('0x18')]([_0xdefe('0x21'),_0xdefe('0x22')],_0x1685c8[_0xdefe('0x15')]))_0x4e6c73[_0xdefe('0x1f')]='('+_0x4e6c73[_0xdefe('0x1f')]+_0xdefe('0x23')+_0x387b4a+'.'+_0x1685c8['field']+'\x20IS\x20NULL)';_0x4e6c73[_0xdefe('0x17')]=parseValue(_0x17a67a,_0x1685c8['operator'],_0x1685c8[_0xdefe('0x17')]);return _0x4e6c73;};function parseOperator(_0x48c61d){var _0x2b1c2b;switch(_0x48c61d){case _0xdefe('0x24'):_0x2b1c2b='IN\x20?';break;case _0xdefe('0x22'):_0x2b1c2b=_0xdefe('0x25');break;case _0xdefe('0x16'):_0x2b1c2b=_0xdefe('0x26');break;case _0xdefe('0x21'):_0x2b1c2b='<>\x20?';break;case'$substring':case _0xdefe('0x27'):case _0xdefe('0x28'):_0x2b1c2b=_0xdefe('0x29');break;case _0xdefe('0x2a'):_0x2b1c2b=_0xdefe('0x2b');break;case _0xdefe('0x19'):_0x2b1c2b=_0xdefe('0x2c');break;case _0xdefe('0x1a'):_0x2b1c2b=_0xdefe('0x2d');break;case _0xdefe('0x2e'):_0x2b1c2b=_0xdefe('0x2f');break;case'$between':_0x2b1c2b=_0xdefe('0x30');break;}return _0x2b1c2b;}function parseValue(_0x37926b,_0x5e97c7,_0x281b41){var _0xeb7ff9={'start':undefined,'end':undefined};switch(_0x5e97c7){case _0xdefe('0x24'):case _0xdefe('0x22'):_0xeb7ff9[_0xdefe('0x31')]=_0x281b41[_0xdefe('0x8')](',');break;case'$substring':_0xeb7ff9[_0xdefe('0x31')]='%'+_0x281b41+'%';break;case'$startsWith':_0xeb7ff9[_0xdefe('0x31')]=_0x281b41+'%';break;case _0xdefe('0x28'):_0xeb7ff9['start']='%'+_0x281b41;break;case'$between':var _0x2329d7=_0x281b41['split'](',');var _0x281b41=_0x2329d7[_0xdefe('0xc')]();var _0x19245d=_0x2329d7['pop']();if(_0x37926b===_0xdefe('0x14')){_0x281b41=moment(_0x281b41)[_0xdefe('0x32')](0x0,!![])[_0xdefe('0x1c')]();_0x19245d=moment(_0x19245d)[_0xdefe('0x32')](0x0,!![])[_0xdefe('0x1b')](0x17,'hours')['add'](0x3b,'minutes')[_0xdefe('0x1b')](0x3b,_0xdefe('0x33'))[_0xdefe('0x1c')]();}_0xeb7ff9={'start':_0x281b41,'end':_0x19245d};break;default:_0xeb7ff9['start']=_0x281b41;break;}return _0xeb7ff9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 64402ef..39f092e 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 _0x25fa=['order','sort','where','filters','pick','filter','object','includes','columns','VIRTUAL','lower','merge','options','lodash','moment','parse','keys','fields','split','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','name','intersection','attributes','hasOwnProperty','nolimit'];(function(_0x123df6,_0x5f5044){var _0x52d3c6=function(_0x3d8f56){while(--_0x3d8f56){_0x123df6['push'](_0x123df6['shift']());}};_0x52d3c6(++_0x5f5044);}(_0x25fa,0x109));var _0xa25f=function(_0x3712c0,_0x415057){_0x3712c0=_0x3712c0-0x0;var _0x943762=_0x25fa[_0x3712c0];return _0x943762;};'use strict';var _=require(_0xa25f('0x0'));var sequelize=require('sequelize');var moment=require(_0xa25f('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x37129d){var _0x57e272=['ne'];try{var _0x408155=JSON[_0xa25f('0x2')](_0x37129d);var _0x256155=Object['keys'](_0x408155)[0x0];return _0x57e272['includes'](_0x256155);}catch(_0x2e8499){return![];}}function getOperatorValue(_0x50dafc){var _0x2ea9ea=JSON[_0xa25f('0x2')](_0x50dafc);var _0x29666d=Object[_0xa25f('0x3')](_0x2ea9ea)[0x0];var _0x22982b=_0x2ea9ea[_0x29666d];return{['$'+_0x29666d]:_0x22982b};}exports[_0xa25f('0x4')]=function(_0x64bbbf){var _0x25445a=null;if(_0x64bbbf){_0x25445a=_0x64bbbf[_0xa25f('0x5')](',');}return _0x25445a;};exports['filters']=function(_0x1bca18,_0x31bd1d){var _0x507a36={};if(!_[_0xa25f('0x6')](_0x1bca18)){_[_0xa25f('0x7')](_0x1bca18,function(_0x1f65b3,_0x22df56){try{if(_0x31bd1d){var _0x5168c1=_[_0xa25f('0x8')](_0x31bd1d,{'name':_0x22df56})||{};if(hasSequelizeOperator(_0x1f65b3)){_0x507a36[_0x22df56]=getOperatorValue(_0x1f65b3);}else if(_0x5168c1[_0xa25f('0x9')]==='DATE'&&_[_0xa25f('0xa')](_0x1f65b3)){var _0x465e41=JSON['parse'](_0x1f65b3);var _0x41280c={'$gte':moment(moment(_0x465e41[_0xa25f('0xb')])[_0xa25f('0xc')](_0xa25f('0xd')))[_0xa25f('0xe')]()[_0xa25f('0xc')](),'$lte':moment(moment(_0x465e41[_0xa25f('0xf')])[_0xa25f('0xc')](_0xa25f('0xd')))[_0xa25f('0xe')]()[_0xa25f('0x10')](0x1,'s')[_0xa25f('0xc')]()};_0x507a36[_0x22df56]=_0x41280c;}else if(_0x5168c1['name']===_0xa25f('0x11')){_0x507a36[_0x22df56]=_0x1f65b3;}else{_0x507a36[_0x22df56]=_[_0xa25f('0x12')](_0x1f65b3)?_0x1f65b3:JSON[_0xa25f('0x2')](_0x1f65b3);}}else{_0x507a36[_0x22df56]=_[_0xa25f('0x12')](_0x1f65b3)?_0x1f65b3:JSON[_0xa25f('0x2')](_0x1f65b3);}}catch(_0x427105){_0x507a36[_0x22df56]=_0x1f65b3['split'](',');}});}return _0x507a36;};exports[_0xa25f('0x13')]=function(_0x5a2d5c){_0x5a2d5c=parseInt(_0x5a2d5c,0xa);if(!_0x5a2d5c||_0x5a2d5c<0x0){_0x5a2d5c=LIMIT_VALUE;}return _0x5a2d5c;};exports[_0xa25f('0x14')]=function(_0x562573){_0x562573=parseInt(_0x562573,0xa);if(!_0x562573||_0x562573<0x0){_0x562573=0x0;}return _0x562573;};exports['sort']=function(_0x7daeda){var _0x489c83,_0x46bb31=null;if(_0x7daeda){_0x489c83=_0x7daeda[_0xa25f('0x5')](',');_0x46bb31=_[_0xa25f('0x15')](_0x489c83,function(_0x3c2665){if(_0x3c2665[_0xa25f('0x16')]('-')===0x0){return[_0x3c2665==='priority'?sequelize[_0xa25f('0x17')](sequelize[_0xa25f('0x18')](_0xa25f('0x19')),_0xa25f('0x1a')):_0x3c2665['substr'](0x1),_0xa25f('0x1b')];}else{return[_0x3c2665===_0xa25f('0x19')?sequelize[_0xa25f('0x17')](sequelize[_0xa25f('0x18')]('priority'),_0xa25f('0x1a')):_0x3c2665,_0xa25f('0x1c')];}});}return _0x46bb31;};exports[_0xa25f('0x1d')]=function(_0x317f0c,_0x5d93a9){if(_[_0xa25f('0x6')](_0x317f0c)){return _0x317f0c;}if(_[_0xa25f('0x12')](_0x317f0c)){for(var _0x53f011=0x0;_0x53f011<_0x317f0c[_0xa25f('0x1e')];_0x53f011+=0x1){_0x317f0c[_0x53f011]=this['omit'](_0x317f0c[_0x53f011],_0x5d93a9);}return _0x317f0c;}if(!_[_0xa25f('0x1f')](_0x317f0c)){return _0x317f0c;}if(_['isString'](_0x5d93a9)){_0x5d93a9=[_0x5d93a9];}if(!_[_0xa25f('0x12')](_0x5d93a9)){return _0x317f0c;}for(var _0x2448f4=0x0;_0x2448f4<_0x5d93a9['length'];_0x2448f4+=0x1){_[_0xa25f('0x20')](_0x317f0c,_0x5d93a9[_0x2448f4]);}for(var _0x1412b6 in _0x317f0c){if(_0x317f0c['hasOwnProperty'](_0x1412b6)){_0x317f0c[_0x1412b6]=this[_0xa25f('0x1d')](_0x317f0c[_0x1412b6],_0x5d93a9);}}return _0x317f0c;};exports['isNumeric']=function(_0x1030c4){return _0x1030c4[_0xa25f('0x21')](RegExp(_0xa25f('0x22')))?!![]:![];};exports[_0xa25f('0x23')]=function(_0x334629){return _0x334629['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa25f('0x24')]=function(_0x28d84e){var _0x119ffc=[];_0x28d84e[_0xa25f('0x5')](/[ ,]+/)[_0xa25f('0x25')](function(_0x501372){_0x501372=_0x501372[_0xa25f('0x26')](/([^:]")"+/g,'$1');_0x501372='+'+_0x501372+'*';var _0x1381c1=/[ `!@#$%^&*()_\-?~]/;if(_0x501372[_0xa25f('0x21')](_0x1381c1))_0x501372='\x22'+_0x501372+'\x22';_0x119ffc[_0xa25f('0x27')](_0x501372);});return _0x119ffc[_0xa25f('0x28')]('\x20');};exports[_0xa25f('0x29')]=function(_0x392a69,_0xa1a3a1,_0x159b34){var _0x5621ab={},_0x597233={};if(_0xa1a3a1['query'][_0xa25f('0x2a')]){_0xa1a3a1[_0xa25f('0x2b')]['id']=_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x2a')];delete _0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x2a')];}_0x5621ab[_0xa25f('0x2c')]=_[_0xa25f('0x15')](_0x392a69,_0xa25f('0x2d'));_0x5621ab[_0xa25f('0x2b')]=_[_0xa25f('0x3')](_0xa1a3a1['query']);_0x5621ab['filters']=_[_0xa25f('0x2e')](_0x5621ab[_0xa25f('0x2c')],_0x5621ab[_0xa25f('0x2b')]);_0x597233['attributes']=_['intersection'](_0x5621ab['model'],this[_0xa25f('0x4')](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x4')]));_0x597233['attributes']=_0x597233['attributes'][_0xa25f('0x1e')]?_0x597233[_0xa25f('0x2f')]:_0x5621ab['model'];if(!_0xa1a3a1['query'][_0xa25f('0x30')](_0xa25f('0x31'))){_0x597233[_0xa25f('0x13')]=this['limit'](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x13')]);_0x597233[_0xa25f('0x14')]=this['offset'](_0xa1a3a1['query'][_0xa25f('0x14')]);}_0x597233[_0xa25f('0x32')]=this[_0xa25f('0x33')](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x33')]);_0x597233[_0xa25f('0x34')]=this[_0xa25f('0x35')](_[_0xa25f('0x36')](_0xa1a3a1['query'],_0x5621ab[_0xa25f('0x35')]),_0x392a69);if(_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')]){var _0x2e886f=_0x392a69;var _0xd6c0b7=_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')];if(typeof _0xd6c0b7===_0xa25f('0x38')){_0x2e886f=_[_0xa25f('0x37')](_0x392a69,function(_0x370375){return _[_0xa25f('0x39')](_0xd6c0b7[_0xa25f('0x3a')],_0x370375[_0xa25f('0x2d')]);});_0xd6c0b7=_0xd6c0b7['value'];}_0x597233[_0xa25f('0x34')]=_['merge'](_0x597233[_0xa25f('0x34')],{'$or':_[_0xa25f('0x15')](_0x2e886f,function(_0x36afe4){if(_0x36afe4['type']!==_0xa25f('0x3b')){if(_0x159b34){return sequelize[_0xa25f('0x34')](sequelize['fn'](_0xa25f('0x3c'),sequelize[_0xa25f('0x18')](_0x36afe4['name'])),{'$like':sequelize['fn'](_0xa25f('0x3c'),'%'+_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')]+'%')});}else{var _0x3d3cad={};_0x3d3cad[_0x36afe4[_0xa25f('0x2d')]]={'$like':'%'+_0xa1a3a1[_0xa25f('0x2b')]['filter']+'%'};return _0x3d3cad;}}})});}_0x597233=_[_0xa25f('0x3d')]({},_0x597233,_0xa1a3a1[_0xa25f('0x3e')]);return _0x597233;}; \ No newline at end of file +var _0x44e8=['sort','map','indexOf','col','priority','unsigned','substr','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','filter','object','columns','value','where','lower','merge','options','lodash','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x44e8,0xd7));var _0x844e=function(_0x568867,_0x2c68e9){_0x568867=_0x568867-0x0;var _0x13c80e=_0x44e8[_0x568867];return _0x13c80e;};'use strict';var _=require(_0x844e('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1b5be7){var _0x21307e=['ne'];try{var _0x2afcef=JSON[_0x844e('0x1')](_0x1b5be7);var _0x49ce1b=Object[_0x844e('0x2')](_0x2afcef)[0x0];return _0x21307e[_0x844e('0x3')](_0x49ce1b);}catch(_0x2c8b9e){return![];}}function getOperatorValue(_0x446f47){var _0x5c8f67=JSON[_0x844e('0x1')](_0x446f47);var _0x238796=Object[_0x844e('0x2')](_0x5c8f67)[0x0];var _0x11cbd6=_0x5c8f67[_0x238796];return{['$'+_0x238796]:_0x11cbd6};}exports['fields']=function(_0x31ab50){var _0x7dff16=null;if(_0x31ab50){_0x7dff16=_0x31ab50[_0x844e('0x4')](',');}return _0x7dff16;};exports[_0x844e('0x5')]=function(_0x32c6c7,_0x1f9921){var _0x536601={};if(!_[_0x844e('0x6')](_0x32c6c7)){_[_0x844e('0x7')](_0x32c6c7,function(_0x183c7e,_0x285a64){try{if(_0x1f9921){var _0x14909f=_[_0x844e('0x8')](_0x1f9921,{'name':_0x285a64})||{};if(hasSequelizeOperator(_0x183c7e)){_0x536601[_0x285a64]=getOperatorValue(_0x183c7e);}else if(_0x14909f[_0x844e('0x9')]==='DATE'&&_[_0x844e('0xa')](_0x183c7e)){var _0x23df3f=JSON['parse'](_0x183c7e);var _0x3a09d0={'$gte':moment(moment(_0x23df3f[_0x844e('0xb')])['format'](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xe')](),'$lte':moment(moment(_0x23df3f['$lte'])[_0x844e('0xe')](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xf')](0x1,'s')[_0x844e('0xe')]()};_0x536601[_0x285a64]=_0x3a09d0;}else if(_0x14909f[_0x844e('0x10')]===_0x844e('0x11')){_0x536601[_0x285a64]=_0x183c7e;}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}catch(_0x3c307f){_0x536601[_0x285a64]=_0x183c7e['split'](',');}});}return _0x536601;};exports[_0x844e('0x13')]=function(_0x55bcd6){_0x55bcd6=parseInt(_0x55bcd6,0xa);if(!_0x55bcd6||_0x55bcd6<0x0){_0x55bcd6=LIMIT_VALUE;}return _0x55bcd6;};exports[_0x844e('0x14')]=function(_0x10739f){_0x10739f=parseInt(_0x10739f,0xa);if(!_0x10739f||_0x10739f<0x0){_0x10739f=0x0;}return _0x10739f;};exports[_0x844e('0x15')]=function(_0x410325){var _0x3ea7da,_0x2b58c7=null;if(_0x410325){_0x3ea7da=_0x410325[_0x844e('0x4')](',');_0x2b58c7=_[_0x844e('0x16')](_0x3ea7da,function(_0x4ffb86){if(_0x4ffb86[_0x844e('0x17')]('-')===0x0){return[_0x4ffb86==='priority'?sequelize['cast'](sequelize[_0x844e('0x18')](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86[_0x844e('0x1b')](0x1),'DESC'];}else{return[_0x4ffb86===_0x844e('0x19')?sequelize[_0x844e('0x1c')](sequelize['col'](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86,_0x844e('0x1d')];}});}return _0x2b58c7;};exports[_0x844e('0x1e')]=function(_0x35236b,_0x3a65fc){if(_['isEmpty'](_0x35236b)){return _0x35236b;}if(_[_0x844e('0x12')](_0x35236b)){for(var _0xadf0d8=0x0;_0xadf0d8<_0x35236b[_0x844e('0x1f')];_0xadf0d8+=0x1){_0x35236b[_0xadf0d8]=this[_0x844e('0x1e')](_0x35236b[_0xadf0d8],_0x3a65fc);}return _0x35236b;}if(!_[_0x844e('0x20')](_0x35236b)){return _0x35236b;}if(_['isString'](_0x3a65fc)){_0x3a65fc=[_0x3a65fc];}if(!_[_0x844e('0x12')](_0x3a65fc)){return _0x35236b;}for(var _0x5080c1=0x0;_0x5080c1<_0x3a65fc['length'];_0x5080c1+=0x1){_[_0x844e('0x21')](_0x35236b,_0x3a65fc[_0x5080c1]);}for(var _0x130d87 in _0x35236b){if(_0x35236b[_0x844e('0x22')](_0x130d87)){_0x35236b[_0x130d87]=this['omit'](_0x35236b[_0x130d87],_0x3a65fc);}}return _0x35236b;};exports[_0x844e('0x23')]=function(_0x2d4acd){return _0x2d4acd[_0x844e('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x844e('0x25')]=function(_0x81d4de){return _0x81d4de[_0x844e('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x844e('0x26')]=function(_0x454b68){var _0x799cde=[];_0x454b68[_0x844e('0x4')](/[ ,]+/)[_0x844e('0x27')](function(_0x618bf6){_0x618bf6=_0x618bf6[_0x844e('0x28')](/([^:]")"+/g,'$1');_0x618bf6='+'+_0x618bf6+'*';var _0x550240=/[ `!@#$%^&*()_\-?~]/;if(_0x618bf6[_0x844e('0x24')](_0x550240))_0x618bf6='\x22'+_0x618bf6+'\x22';_0x799cde[_0x844e('0x29')](_0x618bf6);});return _0x799cde[_0x844e('0x2a')]('\x20');};exports[_0x844e('0x2b')]=function(_0x43ae36,_0x31754e,_0x27e5b3){var _0x55c488={},_0x26d6f2={};if(_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')]){_0x31754e['query']['id']=_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')];delete _0x31754e['query'][_0x844e('0x2d')];}_0x55c488[_0x844e('0x2e')]=_['map'](_0x43ae36,_0x844e('0x10'));_0x55c488[_0x844e('0x2c')]=_[_0x844e('0x2')](_0x31754e[_0x844e('0x2c')]);_0x55c488[_0x844e('0x5')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],_0x55c488['query']);_0x26d6f2[_0x844e('0x30')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],this[_0x844e('0x31')](_0x31754e[_0x844e('0x2c')][_0x844e('0x31')]));_0x26d6f2[_0x844e('0x30')]=_0x26d6f2[_0x844e('0x30')][_0x844e('0x1f')]?_0x26d6f2[_0x844e('0x30')]:_0x55c488[_0x844e('0x2e')];if(!_0x31754e['query']['hasOwnProperty'](_0x844e('0x32'))){_0x26d6f2[_0x844e('0x13')]=this[_0x844e('0x13')](_0x31754e[_0x844e('0x2c')][_0x844e('0x13')]);_0x26d6f2[_0x844e('0x14')]=this[_0x844e('0x14')](_0x31754e[_0x844e('0x2c')][_0x844e('0x14')]);}_0x26d6f2['order']=this[_0x844e('0x15')](_0x31754e['query'][_0x844e('0x15')]);_0x26d6f2['where']=this[_0x844e('0x5')](_['pick'](_0x31754e[_0x844e('0x2c')],_0x55c488[_0x844e('0x5')]),_0x43ae36);if(_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]){var _0x2eb412=_0x43ae36;var _0x3b4c9e=_0x31754e[_0x844e('0x2c')][_0x844e('0x33')];if(typeof _0x3b4c9e===_0x844e('0x34')){_0x2eb412=_[_0x844e('0x33')](_0x43ae36,function(_0x3bdf19){return _['includes'](_0x3b4c9e[_0x844e('0x35')],_0x3bdf19[_0x844e('0x10')]);});_0x3b4c9e=_0x3b4c9e[_0x844e('0x36')];}_0x26d6f2['where']=_['merge'](_0x26d6f2[_0x844e('0x37')],{'$or':_[_0x844e('0x16')](_0x2eb412,function(_0x1a7817){if(_0x1a7817['type']!=='VIRTUAL'){if(_0x27e5b3){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x844e('0x18')](_0x1a7817[_0x844e('0x10')])),{'$like':sequelize['fn'](_0x844e('0x38'),'%'+_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]+'%')});}else{var _0x4c756b={};_0x4c756b[_0x1a7817[_0x844e('0x10')]]={'$like':'%'+_0x31754e['query']['filter']+'%'};return _0x4c756b;}}})});}_0x26d6f2=_[_0x844e('0x39')]({},_0x26d6f2,_0x31754e[_0x844e('0x3a')]);return _0x26d6f2;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 49548d7..134ab99 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3fc383,_0x41e8bc){var _0x212e84=function(_0x19b84f){while(--_0x19b84f){_0x3fc383['push'](_0x3fc383['shift']());}};_0x212e84(++_0x41e8bc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1fc82b,_0x5150a6){var _0x4c6679=function(_0x1d97dd){while(--_0x1d97dd){_0x1fc82b['push'](_0x1fc82b['shift']());}};_0x4c6679(++_0x5150a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e46c72d..1d61a5b 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 _0xcb6c=['ipAddress','createHash','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','update','digest','hex','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0xcb6c,0xf8));var _0xccb6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcb6c[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xccb6('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xccb6('0x1'));var exec=require(_0xccb6('0x2'))[_0xccb6('0x3')];var config=require(_0xccb6('0x4'));function getInterfaces(){var _0x47589c=[];var _0x5aef9b=os['networkInterfaces']();var _0xc71717=_['orderBy'](_[_0xccb6('0x5')](_0x5aef9b));for(var _0x27abd5=0x0;_0x27abd5<_0xc71717[_0xccb6('0x6')];_0x27abd5++){var _0x2e8b7f=_0x5aef9b[_0xc71717[_0x27abd5]][_0xccb6('0x7')](function(_0x5c71b3){return _0x5c71b3[_0xccb6('0x8')]===_0xccb6('0x9')&&_0x5c71b3['internal']===![];});_0x47589c=_0x47589c[_0xccb6('0xa')](_0x2e8b7f);}return _0x47589c;}function getFirstInterface(){var _0x3fc28c=_[_0xccb6('0xb')](getInterfaces());return{'macAddress':_0x3fc28c&&_0x3fc28c['mac']?_0x3fc28c[_0xccb6('0xc')]:_0xccb6('0xd'),'ipAddress':_0x3fc28c&&_0x3fc28c['address']?_0x3fc28c[_0xccb6('0xe')]:'127.0.0.1'};}exports[_0xccb6('0xf')]=getFirstInterface;function getCPUhash(){var _0x58e146=_[_0xccb6('0x10')](os[_0xccb6('0x11')]()[_0xccb6('0x12')](function(_0x3649c9){return _0x3649c9[_0xccb6('0x13')];}))[_0xccb6('0x14')](':');return crypto['createHash']('md5')[_0xccb6('0x15')](_0x58e146)[_0xccb6('0x16')](_0xccb6('0x17'));}exports['getUuid']=function(){var _0x513ef2=os['platform']();var _0x460c62=/[0-9a-f-]{36}/;if(config[_0xccb6('0x18')]&&_0x460c62[_0xccb6('0x19')](config[_0xccb6('0x18')])){return config['licenseToken'];}else if(_0x513ef2===_0xccb6('0x1a')){return exec(_0xccb6('0x1b'),{'encoding':_0xccb6('0x1c')})[_0xccb6('0x1d')]('\x0d\x0a','');}else{var _0x230b61=getFirstInterface();var _0x4b86cf=getCPUhash();var _0x55797c=_0x4b86cf+'|'+os[_0xccb6('0x1e')]()+'|'+_0x230b61[_0xccb6('0x1f')]+'|'+_0x230b61[_0xccb6('0x20')];var _0x3991a9=crypto[_0xccb6('0x21')]('md5')[_0xccb6('0x15')](_0x55797c)[_0xccb6('0x16')](_0xccb6('0x17'));return _0x3991a9[_0xccb6('0x22')](0x0,0x8)+'-'+_0x3991a9['substring'](0x8,0xc)+'-'+_0x3991a9[_0xccb6('0x22')](0xc,0x10)+'-'+_0x3991a9['substring'](0x10,0x14)+'-'+_0x3991a9[_0xccb6('0x22')](0x14);}}; \ No newline at end of file +var _0x7443=['bimedia-machine-uuid','execSync','../environment','networkInterfaces','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','model','join','createHash','md5','update','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','digest','hex','substring','lodash','crypto'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x7443,0x1a2));var _0x3744=function(_0x28658e,_0xa95dc2){_0x28658e=_0x28658e-0x0;var _0x282373=_0x7443[_0x28658e];return _0x282373;};'use strict';var _=require(_0x3744('0x0'));var os=require('os');var crypto=require(_0x3744('0x1'));var machine=require(_0x3744('0x2'));var exec=require('child_process')[_0x3744('0x3')];var config=require(_0x3744('0x4'));function getInterfaces(){var _0x3e7260=[];var _0x518bbc=os[_0x3744('0x5')]();var _0x350505=_['orderBy'](_[_0x3744('0x6')](_0x518bbc));for(var _0x4020fd=0x0;_0x4020fd<_0x350505[_0x3744('0x7')];_0x4020fd++){var _0x304eb4=_0x518bbc[_0x350505[_0x4020fd]][_0x3744('0x8')](function(_0x12ca59){return _0x12ca59[_0x3744('0x9')]===_0x3744('0xa')&&_0x12ca59['internal']===![];});_0x3e7260=_0x3e7260[_0x3744('0xb')](_0x304eb4);}return _0x3e7260;}function getFirstInterface(){var _0x1cba8f=_[_0x3744('0xc')](getInterfaces());return{'macAddress':_0x1cba8f&&_0x1cba8f[_0x3744('0xd')]?_0x1cba8f['mac']:_0x3744('0xe'),'ipAddress':_0x1cba8f&&_0x1cba8f['address']?_0x1cba8f[_0x3744('0xf')]:_0x3744('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x4696d7=_[_0x3744('0x11')](os[_0x3744('0x12')]()['map'](function(_0x5687f7){return _0x5687f7[_0x3744('0x13')];}))[_0x3744('0x14')](':');return crypto[_0x3744('0x15')](_0x3744('0x16'))[_0x3744('0x17')](_0x4696d7)['digest']('hex');}exports['getUuid']=function(){var _0x2e632b=os[_0x3744('0x18')]();var _0x494622=/[0-9a-f-]{36}/;if(config[_0x3744('0x19')]&&_0x494622[_0x3744('0x1a')](config[_0x3744('0x19')])){return config[_0x3744('0x19')];}else if(_0x2e632b===_0x3744('0x1b')){return exec(_0x3744('0x1c'),{'encoding':_0x3744('0x1d')})[_0x3744('0x1e')]('\x0d\x0a','');}else{var _0x7575c3=getFirstInterface();var _0x37ab85=getCPUhash();var _0x3bef88=_0x37ab85+'|'+os[_0x3744('0x1f')]()+'|'+_0x7575c3['macAddress']+'|'+_0x7575c3['ipAddress'];var _0x551403=crypto[_0x3744('0x15')]('md5')[_0x3744('0x17')](_0x3bef88)[_0x3744('0x20')](_0x3744('0x21'));return _0x551403[_0x3744('0x22')](0x0,0x8)+'-'+_0x551403['substring'](0x8,0xc)+'-'+_0x551403[_0x3744('0x22')](0xc,0x10)+'-'+_0x551403[_0x3744('0x22')](0x10,0x14)+'-'+_0x551403[_0x3744('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index db3dd99..9b3064f 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 _0x372c=['pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','default','util','moment','request-promise','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x372c,0x1a0));var _0xc372=function(_0x8c88ea,_0x38506d){_0x8c88ea=_0x8c88ea-0x0;var _0x2f0d14=_0x372c[_0x8c88ea];return _0x2f0d14;};'use strict';var util=require(_0xc372('0x0'));var moment=require(_0xc372('0x1'));var rp=require(_0xc372('0x2'));var BPromise=require(_0xc372('0x3'));var pkginfo=require(_0xc372('0x4'))(module,_0xc372('0x5'));var db=require(_0xc372('0x6'))['db'];var encryptor=require(_0xc372('0x7'));var hardware=require(_0xc372('0x8'));var logger=require(_0xc372('0x9'))(_0xc372('0xa'));var HOST=_0xc372('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45de24){return new BPromise(function(_0x48fbff,_0x1a8bdd){var _0x37b885=util[_0xc372('0xc')]('%s/api/servers/%s/check?version=%s',HOST,_0x45de24,module[_0xc372('0xd')][_0xc372('0x5')]);if(oldToken){_0x37b885=util['format'](_0xc372('0xe'),HOST,_0x45de24,module['exports']['version'],oldToken);}var _0x4f37e6={'uri':_0x37b885,'method':_0xc372('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x4f37e6)[_0xc372('0x10')](function(_0x17adca){_0x48fbff(_0x17adca);})[_0xc372('0x11')](function(_0x57ba27){_0x1a8bdd(_0x57ba27);});});}function manageLicense(_0x58c557,_0x2b5991){var _0x4c809d=_0x2b5991['get']({'plain':!![]});if(!isOldTokenSent&&_0x4c809d[_0xc372('0x12')]!==_0x58c557&&!_0x4c809d['data2']){oldToken=_0x4c809d['data1'];}httpRequest(_0x58c557)[_0xc372('0x10')](function(_0x3166a8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3166a8[_0xc372('0x13')]){isOldTokenSent=![];if(!_0x4c809d[_0xc372('0xa')]&&_0x4c809d[_0xc372('0xa')]!=_0x3166a8[_0xc372('0xa')]||_0x4c809d[_0xc372('0xa')]&&_0x4c809d[_0xc372('0x14')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4c809d[_0xc372('0xa')]&&!_0x4c809d['data2']&&_0x4c809d[_0xc372('0xa')]!=_0x3166a8['license']){logger[_0xc372('0x15')](_0xc372('0x16'));}if(_0x4c809d[_0xc372('0xa')]&&!_0x4c809d[_0xc372('0x14')]&&_0x4c809d[_0xc372('0xa')]==_0x3166a8[_0xc372('0xa')]){return _0x2b5991;}return _0x2b5991['update']({'data1':_0x58c557,'data2':null,'license':_0x3166a8['license']});}else{if(_0x3166a8[_0xc372('0xa')]||_0x4c809d[_0xc372('0xa')]){if(!_0x4c809d[_0xc372('0x14')]){if(_0x4c809d[_0xc372('0x12')]==_0x58c557){GRAY_PERIOD_REASON=_0xc372('0x17');logger[_0xc372('0x15')](_0xc372('0x18'));}else{GRAY_PERIOD_REASON=_0xc372('0x19');logger[_0xc372('0x15')](_0xc372('0x1a'),_0x4c809d['data1'],_0x58c557);}logger['info'](_0xc372('0x1b'),GRAY_PERIOD_REASON[_0xc372('0x1c')](),moment()['format'](_0xc372('0x1d')));return _0x2b5991[_0xc372('0x1e')]({'data2':encryptor[_0xc372('0x1f')](moment()[_0xc372('0xc')](_0xc372('0x1d')))});}else{if(moment()[_0xc372('0x20')](encryptor[_0xc372('0x21')](_0x4c809d[_0xc372('0x14')]),_0xc372('0x22'))>DAYS){logger[_0xc372('0x15')](_0xc372('0x23'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2b5991[_0xc372('0x1e')]({'data1':_0x58c557,'data2':null,'license':null});}}}else{if(_0x4c809d['data1']!=_0x58c557){logger[_0xc372('0x15')](_0xc372('0x1a'),_0x4c809d['data1'],_0x58c557);return _0x2b5991['update']({'data1':_0x58c557,'data2':null,'license':null});}}}return _0x2b5991;})[_0xc372('0x10')](function(_0x466901){_0x2b5991=_0x466901;})[_0xc372('0x11')](function(_0x23ad24){logger[_0xc372('0x24')](_0x23ad24[_0xc372('0x25')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xc372('0x26')](),_0x2b5991);},TIME);});}function defaultLicense(){var _0x474989=hardware[_0xc372('0x26')]();if(_0x474989){return db[_0xc372('0x27')][_0xc372('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x474989}})['spread'](function(_0x5db180,_0x14476b){logger[_0xc372('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x474989);manageLicense(_0x474989,_0x5db180);})[_0xc372('0x11')](function(_0x4b36a5){logger[_0xc372('0x24')](_0x4b36a5['message']);});}}exports[_0xc372('0x29')]=defaultLicense; \ No newline at end of file +var _0xbcea=['request-promise','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util'];(function(_0x28c2ee,_0x3f644d){var _0x3ec29e=function(_0x565135){while(--_0x565135){_0x28c2ee['push'](_0x28c2ee['shift']());}};_0x3ec29e(++_0x3f644d);}(_0xbcea,0xd7));var _0xabce=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xbcea[_0x513545];return _0x18b7c5;};'use strict';var util=require(_0xabce('0x0'));var moment=require('moment');var rp=require(_0xabce('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xabce('0x2'))(module,'version');var db=require(_0xabce('0x3'))['db'];var encryptor=require(_0xabce('0x4'));var hardware=require(_0xabce('0x5'));var logger=require(_0xabce('0x6'))(_0xabce('0x7'));var HOST=_0xabce('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2daf3f){return new BPromise(function(_0x45ce8e,_0x1aff2b){var _0x2f77f3=util[_0xabce('0x9')](_0xabce('0xa'),HOST,_0x2daf3f,module[_0xabce('0xb')]['version']);if(oldToken){_0x2f77f3=util[_0xabce('0x9')](_0xabce('0xc'),HOST,_0x2daf3f,module[_0xabce('0xb')]['version'],oldToken);}var _0x383b34={'uri':_0x2f77f3,'method':_0xabce('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x383b34)[_0xabce('0xe')](function(_0x19d218){_0x45ce8e(_0x19d218);})[_0xabce('0xf')](function(_0x29867e){_0x1aff2b(_0x29867e);});});}function manageLicense(_0x34d0e1,_0x314f74){var _0x36057b=_0x314f74['get']({'plain':!![]});if(!isOldTokenSent&&_0x36057b[_0xabce('0x10')]!==_0x34d0e1&&!_0x36057b[_0xabce('0x11')]){oldToken=_0x36057b[_0xabce('0x10')];}httpRequest(_0x34d0e1)[_0xabce('0xe')](function(_0x282df4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x282df4[_0xabce('0x12')]){isOldTokenSent=![];if(!_0x36057b[_0xabce('0x7')]&&_0x36057b[_0xabce('0x7')]!=_0x282df4[_0xabce('0x7')]||_0x36057b[_0xabce('0x7')]&&_0x36057b[_0xabce('0x11')]){logger[_0xabce('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x36057b[_0xabce('0x7')]&&!_0x36057b[_0xabce('0x11')]&&_0x36057b[_0xabce('0x7')]!=_0x282df4[_0xabce('0x7')]){logger[_0xabce('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x36057b['license']&&!_0x36057b['data2']&&_0x36057b['license']==_0x282df4[_0xabce('0x7')]){return _0x314f74;}return _0x314f74['update']({'data1':_0x34d0e1,'data2':null,'license':_0x282df4[_0xabce('0x7')]});}else{if(_0x282df4[_0xabce('0x7')]||_0x36057b[_0xabce('0x7')]){if(!_0x36057b[_0xabce('0x11')]){if(_0x36057b['data1']==_0x34d0e1){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xabce('0x14'));}else{GRAY_PERIOD_REASON=_0xabce('0x15');logger['info'](_0xabce('0x16'),_0x36057b[_0xabce('0x10')],_0x34d0e1);}logger[_0xabce('0x13')](_0xabce('0x17'),GRAY_PERIOD_REASON[_0xabce('0x18')](),moment()['format'](_0xabce('0x19')));return _0x314f74[_0xabce('0x1a')]({'data2':encryptor[_0xabce('0x1b')](moment()[_0xabce('0x9')](_0xabce('0x19')))});}else{if(moment()['diff'](encryptor[_0xabce('0x1c')](_0x36057b[_0xabce('0x11')]),'days')>DAYS){logger[_0xabce('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0xabce('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x314f74['update']({'data1':_0x34d0e1,'data2':null,'license':null});}}}else{if(_0x36057b['data1']!=_0x34d0e1){logger[_0xabce('0x13')](_0xabce('0x16'),_0x36057b['data1'],_0x34d0e1);return _0x314f74['update']({'data1':_0x34d0e1,'data2':null,'license':null});}}}return _0x314f74;})[_0xabce('0xe')](function(_0x1c16cd){_0x314f74=_0x1c16cd;})[_0xabce('0xf')](function(_0x515743){logger['error'](_0x515743['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xabce('0x1d')](),_0x314f74);},TIME);});}function defaultLicense(){var _0x485302=hardware['getUuid']();if(_0x485302){return db[_0xabce('0x1e')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x485302}})[_0xabce('0x1f')](function(_0xa4f81c,_0x5c3791){logger[_0xabce('0x13')](_0xabce('0x20'),_0x485302);manageLicense(_0x485302,_0xa4f81c);})[_0xabce('0xf')](function(_0x36d51f){logger[_0xabce('0x21')](_0x36d51f[_0xabce('0x22')]);});}}exports[_0xabce('0x23')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index bceff2c..a5ba903 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 _0x2e65=['license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','findAll','sequelize','COUNT','col','role','user','telephone','users','forEach','pick','countBy','admin','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','defaults','then','catch','data1'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x2e65,0xb4));var _0x52e6=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x2e65[_0x1ccbcc];return _0x1e873f;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x52e6('0x0'));var BPromise=require(_0x52e6('0x1'));var hardware=require('./hardware');var encryptor=require(_0x52e6('0x2'));var db=require(_0x52e6('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x52e6('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x52e6('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x52e6('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x308e1e){return new BPromise(function(_0x20c50c,_0xc7dbcb){return db[_0x52e6('0x7')]['find'](_[_0x52e6('0x8')](_0x308e1e,{'raw':!![],'where':{'id':0x1}}))[_0x52e6('0x9')](function(_0x51113f){return checkLicense(_0x51113f,null);})[_0x52e6('0x9')](function(_0x523fd3){_0x20c50c(_0x523fd3);return;})[_0x52e6('0xa')](function(_0x18aaaf){_0xc7dbcb(_0x18aaaf);});});}function checkLicense(_0x56c867,_0x559c8a){if(!_0x56c867){demoLicense['uuid']=_0x56c867[_0x52e6('0xb')];return demoLicense;}try{var _0x595677=_0x559c8a||_0x56c867[_0x52e6('0xc')];if(_[_0x52e6('0xd')](_0x595677)){throw new Error(_0x52e6('0xe'));}var _0x3477cf=_0x56c867[_0x52e6('0xb')];var _0x46a7ab=_0x56c867[_0x52e6('0xf')];var _0x9df6d7=_0x3477cf[_0x52e6('0x10')]('-')[0x4];var _0x23b269=_0x3477cf[_0x52e6('0x10')]('-')[0x0];var _0x19d641=encryptor[_0x52e6('0x11')](_0x595677,util[_0x52e6('0x12')](_0x52e6('0x13'),_0x9df6d7,_0x3477cf,_0x23b269));var _0x4e4b84=JSON[_0x52e6('0x14')](_0x19d641);_0x4e4b84[_0x52e6('0x15')]=![];_0x4e4b84[_0x52e6('0x16')]=_0x3477cf;_0x4e4b84['machineUuid']=hardware[_0x52e6('0x4')]();if(_0x46a7ab){var _0x5e1c6f=encryptor[_0x52e6('0x11')](_0x46a7ab);_0x4e4b84[_0x52e6('0x17')]=_0x5e1c6f;_0x4e4b84[_0x52e6('0x18')]=moment(_0x5e1c6f)[_0x52e6('0x19')](0x7,_0x52e6('0x1a'))[_0x52e6('0x12')]();_0x4e4b84[_0x52e6('0x1b')]=_0x4e4b84[_0x52e6('0x16')]!=_0x4e4b84[_0x52e6('0x1c')]?_0x52e6('0x1d'):_0x52e6('0x1e');}return _0x4e4b84;}catch(_0x3caa2c){breakingLicense[_0x52e6('0x16')]=_0x56c867[_0x52e6('0xb')];breakingLicense[_0x52e6('0x1f')]=_0x3caa2c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x37c1ec,_0x31f45c){getLicense()[_0x52e6('0x9')](function(_0x585274){return db[_0x52e6('0x20')][_0x52e6('0x21')]({'attributes':['role',[db[_0x52e6('0x22')]['fn'](_0x52e6('0x23'),db[_0x52e6('0x22')][_0x52e6('0x24')](_0x52e6('0x25'))),'count']],'group':'role','where':{'role':{'$or':['admin',_0x52e6('0x26'),_0x52e6('0x27')]}},'raw':!![]})[_0x52e6('0x9')](function(_0x259efd){var _0x34e8ea={'user':_0x585274[_0x52e6('0x28')]||0x0,'telephone':_0x585274['telephones']||0x0};_0x259efd[_0x52e6('0x29')](function(_0x3e1ede){var _0x50875e=_0x3e1ede[_0x52e6('0x25')]==='admin'?_0x52e6('0x26'):_0x3e1ede['role'];_0x34e8ea[_0x50875e]-=_0x3e1ede['count'];if(_0x34e8ea[_0x50875e]<0x0)_0x34e8ea[_0x50875e]=0x0;});_0x37c1ec(_0x34e8ea);return;});})[_0x52e6('0xa')](function(_0x2618bc){_0x31f45c(_0x2618bc);});});}function checkUserLimits(_0x1c5d5d){return new BPromise(function(_0x20d45e,_0xfdd54c){getLimits()[_0x52e6('0x9')](function(_0x3afbc9){var _0x58c867=_[_0x52e6('0x2a')](_[_0x52e6('0x2b')](_0x1c5d5d,'role'),['admin',_0x52e6('0x26'),_0x52e6('0x27')]);var _0x1df9ff=(_0x58c867[_0x52e6('0x2c')]||0x0)+(_0x58c867['user']||0x0);var _0xa0c2c5=_0x58c867[_0x52e6('0x27')]||0x0;if(_0x1df9ff>_0x3afbc9[_0x52e6('0x26')])return _0xfdd54c(_0x52e6('0x2d'));if(_0xa0c2c5>_0x3afbc9[_0x52e6('0x27')])return _0xfdd54c(_0x52e6('0x2e'));return _0x20d45e();})[_0x52e6('0xa')](function(_0x4374d9){_0xfdd54c(_0x4374d9);});});}module[_0x52e6('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x48cb=['users','telephones','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults','then','uuid','data1','license','isEmpty','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone'];(function(_0x3d51de,_0x17253c){var _0x14128a=function(_0x1279ea){while(--_0x1279ea){_0x3d51de['push'](_0x3d51de['shift']());}};_0x14128a(++_0x17253c);}(_0x48cb,0x66));var _0xb48c=function(_0x44657e,_0x5e5bac){_0x44657e=_0x44657e-0x0;var _0x46855c=_0x48cb[_0x44657e];return _0x46855c;};'use strict';var util=require('util');var _=require(_0xb48c('0x0'));var moment=require(_0xb48c('0x1'));var BPromise=require(_0xb48c('0x2'));var hardware=require(_0xb48c('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xb48c('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb48c('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb48c('0x6'),'machineUuid':hardware[_0xb48c('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x169d8){return new BPromise(function(_0x2e48ca,_0x3e4ee8){return db[_0xb48c('0x8')][_0xb48c('0x9')](_[_0xb48c('0xa')](_0x169d8,{'raw':!![],'where':{'id':0x1}}))[_0xb48c('0xb')](function(_0x567391){return checkLicense(_0x567391,null);})[_0xb48c('0xb')](function(_0x5c58e5){_0x2e48ca(_0x5c58e5);return;})['catch'](function(_0x5cbb6f){_0x3e4ee8(_0x5cbb6f);});});}function checkLicense(_0x2972fb,_0x494b4b){if(!_0x2972fb){demoLicense[_0xb48c('0xc')]=_0x2972fb[_0xb48c('0xd')];return demoLicense;}try{var _0x25d0dc=_0x494b4b||_0x2972fb[_0xb48c('0xe')];if(_[_0xb48c('0xf')](_0x25d0dc)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x4e9444=_0x2972fb[_0xb48c('0xd')];var _0x446549=_0x2972fb['data2'];var _0x1123aa=_0x4e9444['split']('-')[0x4];var _0xc0a0dc=_0x4e9444['split']('-')[0x0];var _0x380364=encryptor[_0xb48c('0x10')](_0x25d0dc,util[_0xb48c('0x11')](_0xb48c('0x12'),_0x1123aa,_0x4e9444,_0xc0a0dc));var _0x4f24cf=JSON[_0xb48c('0x13')](_0x380364);_0x4f24cf[_0xb48c('0x14')]=![];_0x4f24cf[_0xb48c('0xc')]=_0x4e9444;_0x4f24cf[_0xb48c('0x15')]=hardware[_0xb48c('0x7')]();if(_0x446549){var _0x4c0a9a=encryptor['decryptString'](_0x446549);_0x4f24cf[_0xb48c('0x16')]=_0x4c0a9a;_0x4f24cf[_0xb48c('0x17')]=moment(_0x4c0a9a)['add'](0x7,_0xb48c('0x18'))[_0xb48c('0x11')]();_0x4f24cf[_0xb48c('0x19')]=_0x4f24cf[_0xb48c('0xc')]!=_0x4f24cf[_0xb48c('0x15')]?_0xb48c('0x1a'):_0xb48c('0x1b');}return _0x4f24cf;}catch(_0x3122b2){breakingLicense[_0xb48c('0xc')]=_0x2972fb[_0xb48c('0xd')];breakingLicense[_0xb48c('0x1c')]=_0x3122b2[_0xb48c('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x57a0ae,_0xfdd05a){getLicense()[_0xb48c('0xb')](function(_0x58aa51){return db[_0xb48c('0x1d')][_0xb48c('0x1e')]({'attributes':[_0xb48c('0x1f'),[db[_0xb48c('0x20')]['fn'](_0xb48c('0x21'),db[_0xb48c('0x20')][_0xb48c('0x22')]('role')),_0xb48c('0x23')]],'group':_0xb48c('0x1f'),'where':{'role':{'$or':[_0xb48c('0x24'),_0xb48c('0x25'),_0xb48c('0x26')]}},'raw':!![]})['then'](function(_0x49c88c){var _0x10a043={'user':_0x58aa51[_0xb48c('0x27')]||0x0,'telephone':_0x58aa51[_0xb48c('0x28')]||0x0};_0x49c88c['forEach'](function(_0x1091c4){var _0x259b0b=_0x1091c4['role']===_0xb48c('0x24')?_0xb48c('0x25'):_0x1091c4['role'];_0x10a043[_0x259b0b]-=_0x1091c4[_0xb48c('0x23')];if(_0x10a043[_0x259b0b]<0x0)_0x10a043[_0x259b0b]=0x0;});_0x57a0ae(_0x10a043);return;});})[_0xb48c('0x29')](function(_0x4f3268){_0xfdd05a(_0x4f3268);});});}function checkUserLimits(_0x32d0d1){return new BPromise(function(_0x134213,_0x18a2af){getLimits()[_0xb48c('0xb')](function(_0x109dc4){var _0x17411=_[_0xb48c('0x2a')](_[_0xb48c('0x2b')](_0x32d0d1,_0xb48c('0x1f')),[_0xb48c('0x24'),_0xb48c('0x25'),_0xb48c('0x26')]);var _0x12dad6=(_0x17411[_0xb48c('0x24')]||0x0)+(_0x17411['user']||0x0);var _0x5cb003=_0x17411[_0xb48c('0x26')]||0x0;if(_0x12dad6>_0x109dc4[_0xb48c('0x25')])return _0x18a2af(_0xb48c('0x2c'));if(_0x5cb003>_0x109dc4[_0xb48c('0x26')])return _0x18a2af(_0xb48c('0x2d'));return _0x134213();})[_0xb48c('0x29')](function(_0x10fecc){_0x18a2af(_0x10fecc);});});}module[_0xb48c('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index da4b853..311ecef 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 _0x14a0=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x4b673c,_0x2166a1){var _0x5bb814=function(_0x23fd9c){while(--_0x23fd9c){_0x4b673c['push'](_0x4b673c['shift']());}};_0x5bb814(++_0x2166a1);}(_0x14a0,0x8e));var _0x014a=function(_0x5f1f27,_0x473279){_0x5f1f27=_0x5f1f27-0x0;var _0x13caf8=_0x14a0[_0x5f1f27];return _0x13caf8;};'use strict';module['exports']={'DOMAIN':_0x014a('0x0'),'SESSION_SECRET':_0x014a('0x1'),'GOOGLE_ID':_0x014a('0x2'),'GOOGLE_SECRET':_0x014a('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x8603=['app-id','http://localhost:9000','myappanuglar-secret'];(function(_0x5c57ed,_0x28570a){var _0x3c1eb7=function(_0x413553){while(--_0x413553){_0x5c57ed['push'](_0x5c57ed['shift']());}};_0x3c1eb7(++_0x28570a);}(_0x8603,0x190));var _0x3860=function(_0x28a386,_0xcde008){_0x28a386=_0x28a386-0x0;var _0x402c0a=_0x8603[_0x28a386];return _0x402c0a;};'use strict';module['exports']={'DOMAIN':_0x3860('0x0'),'SESSION_SECRET':_0x3860('0x1'),'GOOGLE_ID':_0x3860('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bc7cb13..072b654 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c31=['exports','fileLogger'];(function(_0x3a2e95,_0xf61b28){var _0x18fe33=function(_0x5e818d){while(--_0x5e818d){_0x3a2e95['push'](_0x3a2e95['shift']());}};_0x18fe33(++_0xf61b28);}(_0x9c31,0xe3));var _0x19c3=function(_0x158f6c,_0x131dcc){_0x158f6c=_0x158f6c-0x0;var _0x574500=_0x9c31[_0x158f6c];return _0x574500;};'use strict';var fileLogger=require('../utils/loggers')[_0x19c3('0x0')];module[_0x19c3('0x1')]=fileLogger; \ No newline at end of file +var _0xf5a7=['exports','../utils/loggers','fileLogger'];(function(_0x49b021,_0x25a126){var _0xff3ebe=function(_0x550902){while(--_0x550902){_0x49b021['push'](_0x49b021['shift']());}};_0xff3ebe(++_0x25a126);}(_0xf5a7,0xee));var _0x7f5a=function(_0x41f193,_0x1244c3){_0x41f193=_0x41f193-0x0;var _0x2ead61=_0xf5a7[_0x41f193];return _0x2ead61;};'use strict';var fileLogger=require(_0x7f5a('0x0'))[_0x7f5a('0x1')];module[_0x7f5a('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 45bf2ba..044aee2 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 _0x53a7=['agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x332f2b,_0x4c8986){var _0x4f1908=function(_0x345ed1){while(--_0x345ed1){_0x332f2b['push'](_0x332f2b['shift']());}};_0x4f1908(++_0x4c8986);}(_0x53a7,0xbd));var _0x753a=function(_0x56ee2a,_0x670ce7){_0x56ee2a=_0x56ee2a-0x0;var _0xea2c22=_0x53a7[_0x56ee2a];return _0xea2c22;};'use strict';var path=require(_0x753a('0x0'));var os=require('os');var config={'apps':[{'name':_0x753a('0x1'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0x3'))},{'name':_0x753a('0x4'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0x5'))},{'name':_0x753a('0x6'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0x7'))},{'name':_0x753a('0x8'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0x9'))},{'name':_0x753a('0xa'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0xb'))},{'name':_0x753a('0xc'),'script':path[_0x753a('0x2')](__dirname,_0x753a('0xd'))}]};module[_0x753a('0xe')]=config; \ No newline at end of file +var _0x9966=['path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x9e06e9,_0x1f005c){var _0x18eac6=function(_0xcae64e){while(--_0xcae64e){_0x9e06e9['push'](_0x9e06e9['shift']());}};_0x18eac6(++_0x1f005c);}(_0x9966,0x16c));var _0x6996=function(_0x1bcc2f,_0x395982){_0x1bcc2f=_0x1bcc2f-0x0;var _0xa063a9=_0x9966[_0x1bcc2f];return _0xa063a9;};'use strict';var path=require(_0x6996('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x6996('0x1')](__dirname,_0x6996('0x2'))},{'name':_0x6996('0x3'),'script':path[_0x6996('0x1')](__dirname,_0x6996('0x4'))},{'name':_0x6996('0x5'),'script':path[_0x6996('0x1')](__dirname,_0x6996('0x6'))},{'name':_0x6996('0x7'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x6996('0x8'),'script':path[_0x6996('0x1')](__dirname,_0x6996('0x9'))},{'name':_0x6996('0xa'),'script':path[_0x6996('0x1')](__dirname,_0x6996('0xb'))}]};module[_0x6996('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7bbd370..2ac5ffa 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 _0xd24c=['bluebird','connected','then','disconnect','stop','list','describe','delete','dump'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd24c,0x168));var _0xcd24=function(_0x490424,_0x3e2daf){_0x490424=_0x490424-0x0;var _0x7076e2=_0xd24c[_0x490424];return _0x7076e2;};'use strict';var pm2=require('pm2');var BPromise=require(_0xcd24('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x2c40fe,_0x12d1ee){return pm2['connect'](function(_0x5d49b7){if(_0x5d49b7){return _0x12d1ee(_0x5d49b7);}return _0x2c40fe(_0xcd24('0x1'));});});};exports['start']=function(_0x1c762d){return connect()[_0xcd24('0x2')](function(){return new BPromise(function(_0x8c639d,_0x2adbd8){return pm2['start'](_0x1c762d,function(_0x35b9c4,_0x53b560){if(_0x35b9c4){return _0x2adbd8(_0x35b9c4);}pm2[_0xcd24('0x3')]();return _0x8c639d(_0x53b560);});});});};exports['stop']=function(_0x490a09){return connect()['then'](function(){return new BPromise(function(_0x1feff5,_0x5d2548){return pm2[_0xcd24('0x4')](_0x490a09,function(_0x14bf76,_0x191f43){if(_0x14bf76){return _0x5d2548(_0x14bf76);}pm2[_0xcd24('0x3')]();return _0x1feff5(_0x191f43);});});});};exports['restart']=function(_0x4dcb14){return connect()[_0xcd24('0x2')](function(){return new BPromise(function(_0x5f4f33,_0x30b21c){return pm2['restart'](_0x4dcb14,function(_0x49f8e5,_0x1e3d46){if(_0x49f8e5){return _0x30b21c(_0x49f8e5);}pm2[_0xcd24('0x3')]();return _0x5f4f33(_0x1e3d46);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x390f83,_0xba0f57){return pm2[_0xcd24('0x5')](function(_0x34fcbc,_0x329c2b){if(_0x34fcbc){return _0xba0f57(_0x34fcbc);}pm2['disconnect']();return _0x390f83(_0x329c2b);});});});};exports['describe']=function(_0x368c9f){return connect()['then'](function(){return new BPromise(function(_0x34b7f8,_0x17ddd9){return pm2[_0xcd24('0x6')](_0x368c9f,function(_0x42aede,_0x3a08d6){if(_0x42aede){return _0x17ddd9(_0x42aede);}pm2[_0xcd24('0x3')]();return _0x34b7f8(_0x3a08d6);});});});};exports[_0xcd24('0x7')]=function(_0x1aba4c){return connect()[_0xcd24('0x2')](function(){return new BPromise(function(_0x14fb66,_0x1d7011){return pm2['delete'](_0x1aba4c,function(_0x1bbc4b,_0x1560d7){if(_0x1bbc4b){return _0x1d7011(_0x1bbc4b);}pm2[_0xcd24('0x3')]();return _0x14fb66(_0x1560d7);});});});};exports[_0xcd24('0x8')]=function(){return connect()[_0xcd24('0x2')](function(){return new BPromise(function(_0x19fd85,_0x503cdb){return pm2[_0xcd24('0x8')](function(_0x22c36a){if(_0x22c36a){return _0x503cdb(_0x22c36a);}return _0x19fd85('saved');});});});}; \ No newline at end of file +var _0x752b=['dump','saved','pm2','./config','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x4f9c55,_0x116fc1){var _0x3f243a=function(_0x3b60e8){while(--_0x3b60e8){_0x4f9c55['push'](_0x4f9c55['shift']());}};_0x3f243a(++_0x116fc1);}(_0x752b,0x1c9));var _0xb752=function(_0x43684f,_0xb594b4){_0x43684f=_0x43684f-0x0;var _0x38068e=_0x752b[_0x43684f];return _0x38068e;};'use strict';var pm2=require(_0xb752('0x0'));var BPromise=require('bluebird');var config=require(_0xb752('0x1'));function connect(){return new BPromise(function(_0x47995b,_0x24e5c2){return pm2['connect'](function(_0x1f797f){if(_0x1f797f){return _0x24e5c2(_0x1f797f);}return _0x47995b(_0xb752('0x2'));});});};exports[_0xb752('0x3')]=function(_0x3f9df4){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x581416,_0x3e975e){return pm2[_0xb752('0x3')](_0x3f9df4,function(_0x1c21b6,_0x22d2c4){if(_0x1c21b6){return _0x3e975e(_0x1c21b6);}pm2[_0xb752('0x5')]();return _0x581416(_0x22d2c4);});});});};exports['stop']=function(_0x510399){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x37fa2c,_0x3fa553){return pm2[_0xb752('0x6')](_0x510399,function(_0x56028b,_0x34e755){if(_0x56028b){return _0x3fa553(_0x56028b);}pm2[_0xb752('0x5')]();return _0x37fa2c(_0x34e755);});});});};exports[_0xb752('0x7')]=function(_0x4db90a){return connect()['then'](function(){return new BPromise(function(_0x3aa317,_0x19c060){return pm2['restart'](_0x4db90a,function(_0x2d1ac9,_0x9a872d){if(_0x2d1ac9){return _0x19c060(_0x2d1ac9);}pm2[_0xb752('0x5')]();return _0x3aa317(_0x9a872d);});});});};exports[_0xb752('0x8')]=function(){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x5f346e,_0x5b2e69){return pm2['list'](function(_0x2613a6,_0x72fd24){if(_0x2613a6){return _0x5b2e69(_0x2613a6);}pm2[_0xb752('0x5')]();return _0x5f346e(_0x72fd24);});});});};exports['describe']=function(_0x43ea98){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x142963,_0x556938){return pm2[_0xb752('0x9')](_0x43ea98,function(_0x2a14ff,_0x4db2bb){if(_0x2a14ff){return _0x556938(_0x2a14ff);}pm2['disconnect']();return _0x142963(_0x4db2bb);});});});};exports[_0xb752('0xa')]=function(_0x53ac58){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x459bfb,_0x460cc9){return pm2[_0xb752('0xa')](_0x53ac58,function(_0x1d7304,_0x4b5c1f){if(_0x1d7304){return _0x460cc9(_0x1d7304);}pm2[_0xb752('0x5')]();return _0x459bfb(_0x4b5c1f);});});});};exports['dump']=function(){return connect()[_0xb752('0x4')](function(){return new BPromise(function(_0x37f154,_0x4ed403){return pm2[_0xb752('0xb')](function(_0x27c7f0){if(_0x27c7f0){return _0x4ed403(_0x27c7f0);}return _0x37f154(_0xb752('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2367258..80d0ef8 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 _0x67f1=['redis','defaults','Setting','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','then','length','map','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule'];(function(_0x34878d,_0x4fe890){var _0x48daaa=function(_0x2291d9){while(--_0x2291d9){_0x34878d['push'](_0x34878d['shift']());}};_0x48daaa(++_0x4fe890);}(_0x67f1,0x1a9));var _0x167f=function(_0x337c22,_0x4fcae1){_0x337c22=_0x337c22-0x0;var _0xbc200=_0x67f1[_0x337c22];return _0xbc200;};'use strict';var _=require(_0x167f('0x0'));var moment=require(_0x167f('0x1'));var Redis=require(_0x167f('0x2'));var util=require(_0x167f('0x3'));var config=require(_0x167f('0x4'));var db=require(_0x167f('0x5'))['db'];var logger=require('../logger')(_0x167f('0x6'));config[_0x167f('0x7')]=_[_0x167f('0x8')](config[_0x167f('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x167f('0x7')]));function closeInteractions(){var _0x4717f0=0x0;var _0x2c9803=[];return db[_0x167f('0x9')][_0x167f('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x257caa){_0x4717f0=_0x257caa[_0x167f('0xb')];if(_0x4717f0){return db[_0x167f('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x167f('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x167f('0xe')](_0x257caa[_0x167f('0xb')],'minutes')}}});}else{return[];}})[_0x167f('0xf')](function(_0xe2cb0d){if(_0xe2cb0d&&_0xe2cb0d[_0x167f('0x10')]){_0x2c9803=_[_0x167f('0x11')](_0xe2cb0d||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x2c9803[_0x167f('0x12')]());return db[_0x167f('0xc')][_0x167f('0x13')]({'closeReason':'system','disposition':_0x167f('0x14'),'closed':!![],'closedAt':moment()[_0x167f('0x15')](_0x167f('0x16'))},{'where':{'id':_0x2c9803}});}})[_0x167f('0xf')](function(){if(_0x2c9803&&_0x2c9803[_0x167f('0x10')]){logger['info'](_0x167f('0x17'),_0x2c9803[_0x167f('0x12')]());for(var _0x286a09=0x0;_0x286a09<_0x2c9803[_0x167f('0x10')];_0x286a09++){io['emit']('chatInteraction:update',{'id':_0x2c9803[_0x286a09],'closed':!![]});}}})[_0x167f('0x18')](function(_0x4c9380){logger['error'](_0x167f('0x19'),_0x4c9380?util['inspect'](_0x4c9380,{'showHidden':![],'depth':null}):'');});}exports[_0x167f('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc003=['socket.io-emitter','Setting','find','chatTimeout','then','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xc003,0x14a));var _0x3c00=function(_0x27f961,_0x3e9c18){_0x27f961=_0x27f961-0x0;var _0xc248b1=_0xc003[_0x27f961];return _0xc248b1;};'use strict';var _=require(_0x3c00('0x0'));var moment=require('moment');var Redis=require(_0x3c00('0x1'));var util=require(_0x3c00('0x2'));var config=require(_0x3c00('0x3'));var db=require(_0x3c00('0x4'))['db'];var logger=require(_0x3c00('0x5'))(_0x3c00('0x6'));config[_0x3c00('0x7')]=_[_0x3c00('0x8')](config[_0x3c00('0x7')],{'host':_0x3c00('0x9'),'port':0x18eb});var io=require(_0x3c00('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x1513d0=0x0;var _0x3f1405=[];return db[_0x3c00('0xb')][_0x3c00('0xc')]({'raw':!![],'attributes':['id',_0x3c00('0xd')],'where':{'id':0x1}})[_0x3c00('0xe')](function(_0x3164f9){_0x1513d0=_0x3164f9['chatTimeout'];if(_0x1513d0){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x3c00('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3c00('0x10')](_0x3164f9['chatTimeout'],_0x3c00('0x11'))}}});}else{return[];}})[_0x3c00('0xe')](function(_0x4c79f2){if(_0x4c79f2&&_0x4c79f2['length']){_0x3f1405=_[_0x3c00('0x12')](_0x4c79f2||[],'id');logger[_0x3c00('0x13')](_0x3c00('0x14'),_0x3f1405[_0x3c00('0x15')]());return db[_0x3c00('0x16')][_0x3c00('0x17')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x3c00('0x18')](_0x3c00('0x19'))},{'where':{'id':_0x3f1405}});}})[_0x3c00('0xe')](function(){if(_0x3f1405&&_0x3f1405[_0x3c00('0x1a')]){logger[_0x3c00('0x13')](_0x3c00('0x1b'),_0x3f1405[_0x3c00('0x15')]());for(var _0x1b6591=0x0;_0x1b6591<_0x3f1405[_0x3c00('0x1a')];_0x1b6591++){io['emit'](_0x3c00('0x1c'),{'id':_0x3f1405[_0x1b6591],'closed':!![]});}}})[_0x3c00('0x1d')](function(_0x10ed14){logger[_0x3c00('0x1e')](_0x3c00('0x1f'),_0x10ed14?util[_0x3c00('0x20')](_0x10ed14,{'showHidden':![],'depth':null}):'');});}exports[_0x3c00('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 5ae92c4..47b518f 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c1b=['startAllRefreshIntervals'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x1c1b,0x76));var _0xb1c1=function(_0x1ce4b3,_0x1ed09c){_0x1ce4b3=_0x1ce4b3-0x0;var _0x9f9273=_0x1c1b[_0x1ce4b3];return _0x9f9273;};'use strict';function start(){var _0x3f09a9=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x3f09a9[_0xb1c1('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x7d4d=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0x7d4d,0x1c5));var _0xd7d4=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x7d4d[_0x5df61d];return _0x24cc4c;};'use strict';function start(){var _0x41b23e=require(_0xd7d4('0x0'));return _0x41b23e[_0xd7d4('0x1')]();}module[_0xd7d4('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index c0e1b50..f5d9e83 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 _0x68c8=['index','my\x20id','run\x20job','cron','isBetween','startAt','add','start','add\x20cron','exists','stop\x20cron','endAt','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','Sent','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','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','email\x20sent','catch','error\x20mail','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','toString','intersection','difference','length','stop','deleteJob','toRun'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x68c8,0x1b3));var _0x868c=function(_0x605ea,_0x348c7e){_0x605ea=_0x605ea-0x0;var _0x5ce08b=_0x68c8[_0x605ea];return _0x5ce08b;};'use strict';var fs=require('fs');var util=require(_0x868c('0x0'));var path=require('path');var _=require(_0x868c('0x1'));var moment=require('moment');var CronJobManager=require(_0x868c('0x2'));var jayson=require(_0x868c('0x3'));var BPromise=require(_0x868c('0x4'));var logger=require(_0x868c('0x5'))(_0x868c('0x6'));var db=require(_0x868c('0x7'))['db'];var analyticCustomReportController=require(_0x868c('0x8'));var analyticDefaultReportController=require(_0x868c('0x9'));var client=jayson[_0x868c('0xa')][_0x868c('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x351b5e,_0x5d89b5){return function(){logger[_0x868c('0xc')](_0x868c('0xd'),_0x351b5e[_0x868c('0xe')]);var _0x2fb5cc=!![];var _0x31ae3a=_0x351b5e[_0x868c('0xf')][_0x868c('0x10')]();var _0x5d21cd={'account':_0x31ae3a,'message':{'from':util[_0x868c('0x11')](_0x868c('0x12'),_0x351b5e[_0x868c('0xf')]['name'],_0x351b5e[_0x868c('0xf')][_0x868c('0xe')]||_0x351b5e['MailAccount']['Smtp']['user']),'to':_0x351b5e['email'],'cc':_0x351b5e['cc'],'bcc':_0x351b5e['bcc'],'subject':util[_0x868c('0x11')]('Report\x20%s\x20last\x20%s\x20%s',_0x5d89b5[_0x868c('0x13')],_0x351b5e[_0x868c('0x14')],_0x351b5e['subtractUnit'])}};var _0x510ac6=path[_0x868c('0x15')](__dirname,_0x868c('0x16'));var _0x553c1b=_0x5d89b5[_0x868c('0x17')];var _0xc5232a=util['format'](_0x868c('0x18'),path[_0x868c('0x19')](_0x5d89b5['savename'],path['extname'](_0x5d89b5[_0x868c('0x17')])),_0x868c('0x1a'));var _0x197810=path['join'](_0x510ac6,_0x553c1b);var _0xc9802d=path[_0x868c('0x15')](_0x510ac6,_0xc5232a);if(fs[_0x868c('0x1b')](_0x197810)){_0x5d89b5['status']=_0x868c('0x1c');_0x5d21cd[_0x868c('0x1d')][_0x868c('0x1e')]=[{'filename':_0x553c1b,'path':_0x197810}];_0x5d21cd[_0x868c('0x1d')][_0x868c('0x1f')]=util[_0x868c('0x11')](_0x868c('0x20'),JSON[_0x868c('0x21')](_0x5d89b5,null,0x2));}else if(fs[_0x868c('0x1b')](_0xc9802d)){_0x5d89b5[_0x868c('0x22')]='Sent';_0x5d21cd[_0x868c('0x1d')]['attachments']=[{'filename':_0xc5232a,'path':_0xc9802d}];}else{_0x5d21cd[_0x868c('0x1d')][_0x868c('0x1f')]=_0x868c('0x23');if(!_0x351b5e[_0x868c('0x24')]){_0x2fb5cc=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2fb5cc){return client[_0x868c('0x25')](_0x868c('0x26'),_0x5d21cd)[_0x868c('0x27')](function(_0x58bc92){if(_0x58bc92['error']){return logger[_0x868c('0x28')]('error\x20mail',JSON[_0x868c('0x21')](_0x58bc92));}return logger[_0x868c('0xc')](_0x868c('0x29'));})[_0x868c('0x2a')](function(_0x6e3c4){return logger[_0x868c('0x28')](_0x868c('0x2b'),JSON[_0x868c('0x21')](_0x6e3c4));});}};}function handleError(){return function(_0x4d6370){return logger['error'](JSON['stringify'](_0x4d6370));};}function handleResult(_0xe7bb98){return function(_0x4c6efd){logger[_0x868c('0xc')](_0x868c('0x2c'),JSON[_0x868c('0x21')](_0x4c6efd));if(_0xe7bb98[_0x868c('0xf')]&&_0xe7bb98[_0x868c('0xf')][_0x868c('0x2d')]&&!_[_0x868c('0x2e')](_0xe7bb98[_0x868c('0xe')])){setTimeout(handleSendEmail(_0xe7bb98,_0x4c6efd),0x3c*0x3e8);}};}function handleJob(_0x1b5bb6){return function(){try{if(_[_0x868c('0x2e')](_0x1b5bb6[_0x868c('0x14')])){return logger[_0x868c('0xc')](_0x868c('0x2f'));}if(_[_0x868c('0x2e')](_0x1b5bb6[_0x868c('0x30')])){return logger[_0x868c('0xc')](_0x868c('0x31'));}var _0x2d18db={'startDate':moment()[_0x868c('0x32')](_0x1b5bb6[_0x868c('0x14')],_0x1b5bb6[_0x868c('0x30')])[_0x868c('0x11')](_0x868c('0x33')),'endDate':moment()['format'](_0x868c('0x33')),'type':_0x868c('0x34'),'output':_0x1b5bb6['output'],'name':_0x1b5bb6[_0x868c('0x13')]};if(!_['isNil'](_0x1b5bb6['DefaultReportId'])){logger[_0x868c('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x1b5bb6[_0x868c('0x35')]);return analyticDefaultReportController[_0x868c('0x36')]({'id':_0x1b5bb6[_0x868c('0x35')]},_0x2d18db)[_0x868c('0x27')](handleResult(_0x1b5bb6))[_0x868c('0x2a')](handleError());}if(!_['isNil'](_0x1b5bb6[_0x868c('0x37')])){logger[_0x868c('0xc')]('exec\x20custom\x20report\x20id:%s',_0x1b5bb6[_0x868c('0x37')]);return analyticCustomReportController['runReport']({'id':_0x1b5bb6[_0x868c('0x37')]},_0x2d18db)[_0x868c('0x27')](handleResult(_0x1b5bb6))['catch'](handleError());}}catch(_0x44e8bb){logger[_0x868c('0x28')](JSON['stringify'](_0x44e8bb));}return logger[_0x868c('0xc')](_0x868c('0x38'));};}function getJobs(_0x2fc1b6){var _0x33b888={};if(_0x2fc1b6){_0x33b888['id']=_0x2fc1b6;}return db[_0x868c('0x39')][_0x868c('0x3a')]({'where':_0x33b888,'include':[{'model':db[_0x868c('0xf')],'attributes':['id',_0x868c('0x13'),_0x868c('0xe')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x868c('0x3b')],'as':_0x868c('0x3b')}]}]}]})[_0x868c('0x27')](function(_0x68e683){var _0x9e3313=_[_0x868c('0x3c')](manager[_0x868c('0x3d')]);var _0xfdd5f8=_['map'](_0x68e683,function(_0x17797e){return _0x17797e['id'][_0x868c('0x3e')]();});var _0x44a304=_['keyBy'](_0x68e683,function(_0xf390c9){return _0xf390c9['id'][_0x868c('0x3e')]();});var _0x4ceb03=_0x2fc1b6?_0xfdd5f8:_['difference'](_0xfdd5f8,_0x9e3313);var _0xe23558=_[_0x868c('0x3f')](_0xfdd5f8,_0x9e3313);var _0x459783=_[_0x868c('0x40')](_0x9e3313,_0xfdd5f8);var _0x266c0b;var _0x1e93cf;for(_0x266c0b=0x0;_0x266c0b<_0x459783[_0x868c('0x41')]&&!_0x2fc1b6;_0x266c0b+=0x1){_0x1e93cf=_0x459783[_0x266c0b]['toString']();if(manager['exists'](_0x1e93cf)){manager[_0x868c('0x42')](_0x1e93cf);manager[_0x868c('0x43')](_0x1e93cf);logger[_0x868c('0xc')]('delete\x20cron',_0x1e93cf);}}logger[_0x868c('0xc')](_0x868c('0x44'),JSON[_0x868c('0x21')](_0x4ceb03));for(_0x266c0b=0x0;_0x266c0b<_0x4ceb03[_0x868c('0x41')];_0x266c0b+=0x1){_0x1e93cf=_0x4ceb03[_0x266c0b][_0x868c('0x3e')]();logger['info'](_0x868c('0x45'),_0x1e93cf);if(_0x2fc1b6){logger[_0x868c('0xc')](_0x868c('0x46'),_0x2fc1b6);logger[_0x868c('0xc')](JSON['stringify'](_0x44a304[_0x1e93cf]));BPromise['resolve']()[_0x868c('0x27')](handleJob(_0x44a304[_0x1e93cf]));logger[_0x868c('0xc')](_0x868c('0x47'),_0x44a304[_0x1e93cf][_0x868c('0x13')],_0x44a304[_0x1e93cf][_0x868c('0x48')]);}else if(_0x44a304[_0x1e93cf][_0x868c('0x48')]&&_0x44a304[_0x1e93cf]['active']&&moment()[_0x868c('0x49')](_0x44a304[_0x1e93cf][_0x868c('0x4a')],_0x44a304[_0x1e93cf]['endAt'])){manager[_0x868c('0x4b')](_0x1e93cf,_0x44a304[_0x1e93cf][_0x868c('0x48')],handleJob(_0x44a304[_0x1e93cf]));manager[_0x868c('0x4c')](_0x1e93cf);logger[_0x868c('0xc')](_0x868c('0x4d'),_0x44a304[_0x1e93cf]['name'],_0x44a304[_0x1e93cf][_0x868c('0x48')]);}else if(manager[_0x868c('0x4e')](_0x1e93cf)){manager[_0x868c('0x42')](_0x1e93cf);manager[_0x868c('0x43')](_0x1e93cf);logger[_0x868c('0xc')](_0x868c('0x4f'),_0x44a304[_0x1e93cf][_0x868c('0x13')],_0x44a304[_0x1e93cf][_0x868c('0x48')]);}}for(_0x266c0b=0x0,_0x1e93cf;_0x266c0b<_0xe23558[_0x868c('0x41')]&&!_0x2fc1b6;_0x266c0b+=0x1){_0x1e93cf=_0xe23558[_0x266c0b]['toString']();if(manager[_0x868c('0x4e')](_0x1e93cf)){if(_0x44a304[_0x1e93cf][_0x868c('0x48')]&&_0x44a304[_0x1e93cf]['active']&&moment()['isBetween'](_0x44a304[_0x1e93cf][_0x868c('0x4a')],_0x44a304[_0x1e93cf][_0x868c('0x50')])){manager[_0x868c('0x51')](_0x1e93cf,_0x44a304[_0x1e93cf][_0x868c('0x48')],handleJob(_0x44a304[_0x1e93cf]));logger[_0x868c('0xc')](_0x868c('0x52'),_0x44a304[_0x1e93cf][_0x868c('0x13')],_0x44a304[_0x1e93cf]['cron']);}else{manager[_0x868c('0x42')](_0x1e93cf);manager[_0x868c('0x43')](_0x1e93cf);logger[_0x868c('0xc')](_0x868c('0x4f'),_0x44a304[_0x1e93cf][_0x868c('0x13')],_0x44a304[_0x1e93cf]['cron']);}}}})[_0x868c('0x2a')](function(_0x900bc1){logger[_0x868c('0x28')](JSON[_0x868c('0x21')](_0x900bc1));});}exports[_0x868c('0x53')]=function(_0x4390ff){return getJobs(_0x4390ff);};exports[_0x868c('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa9b1=['http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','extname','zip','Sent','attachments','message','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','status','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','startAt','add','start','add\x20cron','exists','deleteJob','stop\x20cron','active','endAt','update','run','util','lodash','moment','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa9b1,0xf5));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x1a9b('0x0'));var path=require('path');var _=require(_0x1a9b('0x1'));var moment=require(_0x1a9b('0x2'));var CronJobManager=require(_0x1a9b('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x1a9b('0x4'));var logger=require('../logger')(_0x1a9b('0x5'));var db=require(_0x1a9b('0x6'))['db'];var analyticCustomReportController=require(_0x1a9b('0x7'));var analyticDefaultReportController=require(_0x1a9b('0x8'));var client=jayson[_0x1a9b('0x9')][_0x1a9b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x12a891,_0x1476e3){return function(){logger[_0x1a9b('0xb')](_0x1a9b('0xc'),_0x12a891[_0x1a9b('0xd')]);var _0x565c94=!![];var _0x1d7051=_0x12a891[_0x1a9b('0xe')][_0x1a9b('0xf')]();var _0x319c91={'account':_0x1d7051,'message':{'from':util[_0x1a9b('0x10')]('\x22%s\x22\x20<%s>',_0x12a891[_0x1a9b('0xe')][_0x1a9b('0x11')],_0x12a891[_0x1a9b('0xe')][_0x1a9b('0xd')]||_0x12a891[_0x1a9b('0xe')]['Smtp'][_0x1a9b('0x12')]),'to':_0x12a891['email'],'cc':_0x12a891['cc'],'bcc':_0x12a891[_0x1a9b('0x13')],'subject':util[_0x1a9b('0x10')](_0x1a9b('0x14'),_0x1476e3[_0x1a9b('0x11')],_0x12a891[_0x1a9b('0x15')],_0x12a891['subtractUnit'])}};var _0xbd95b9=path[_0x1a9b('0x16')](__dirname,_0x1a9b('0x17'));var _0x5b475a=_0x1476e3[_0x1a9b('0x18')];var _0x206a72=util[_0x1a9b('0x10')]('%s.%s',path['basename'](_0x1476e3['savename'],path[_0x1a9b('0x19')](_0x1476e3[_0x1a9b('0x18')])),_0x1a9b('0x1a'));var _0x27dae0=path[_0x1a9b('0x16')](_0xbd95b9,_0x5b475a);var _0x538c61=path[_0x1a9b('0x16')](_0xbd95b9,_0x206a72);if(fs['existsSync'](_0x27dae0)){_0x1476e3['status']=_0x1a9b('0x1b');_0x319c91['message'][_0x1a9b('0x1c')]=[{'filename':_0x5b475a,'path':_0x27dae0}];_0x319c91[_0x1a9b('0x1d')][_0x1a9b('0x1e')]=util[_0x1a9b('0x10')](_0x1a9b('0x1f'),JSON[_0x1a9b('0x20')](_0x1476e3,null,0x2));}else if(fs['existsSync'](_0x538c61)){_0x1476e3[_0x1a9b('0x21')]=_0x1a9b('0x1b');_0x319c91[_0x1a9b('0x1d')][_0x1a9b('0x1c')]=[{'filename':_0x206a72,'path':_0x538c61}];}else{_0x319c91[_0x1a9b('0x1d')][_0x1a9b('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x12a891['sendIfEmpty']){_0x565c94=![];logger['info'](_0x1a9b('0x22'));}}if(_0x565c94){return client['request']('SendMail',_0x319c91)[_0x1a9b('0x23')](function(_0x352a0b){if(_0x352a0b[_0x1a9b('0x24')]){return logger[_0x1a9b('0x24')](_0x1a9b('0x25'),JSON[_0x1a9b('0x20')](_0x352a0b));}return logger[_0x1a9b('0xb')](_0x1a9b('0x26'));})['catch'](function(_0x42afcb){return logger[_0x1a9b('0x24')](_0x1a9b('0x25'),JSON[_0x1a9b('0x20')](_0x42afcb));});}};}function handleError(){return function(_0x458cb9){return logger['error'](JSON[_0x1a9b('0x20')](_0x458cb9));};}function handleResult(_0x14206f){return function(_0x174d3e){logger[_0x1a9b('0xb')](_0x1a9b('0x27'),JSON[_0x1a9b('0x20')](_0x174d3e));if(_0x14206f['MailAccount']&&_0x14206f['MailAccount'][_0x1a9b('0x28')]&&!_['isNil'](_0x14206f[_0x1a9b('0xd')])){setTimeout(handleSendEmail(_0x14206f,_0x174d3e),0x3c*0x3e8);}};}function handleJob(_0x8114ac){return function(){try{if(_[_0x1a9b('0x29')](_0x8114ac[_0x1a9b('0x15')])){return logger[_0x1a9b('0xb')](_0x1a9b('0x2a'));}if(_['isNil'](_0x8114ac[_0x1a9b('0x2b')])){return logger[_0x1a9b('0xb')](_0x1a9b('0x2c'));}var _0x1d446c={'startDate':moment()['subtract'](_0x8114ac[_0x1a9b('0x15')],_0x8114ac[_0x1a9b('0x2b')])[_0x1a9b('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x1a9b('0x2d'),'output':_0x8114ac[_0x1a9b('0x2e')],'name':_0x8114ac[_0x1a9b('0x11')]};if(!_[_0x1a9b('0x29')](_0x8114ac[_0x1a9b('0x2f')])){logger[_0x1a9b('0xb')](_0x1a9b('0x30'),_0x8114ac[_0x1a9b('0x2f')]);return analyticDefaultReportController[_0x1a9b('0x31')]({'id':_0x8114ac[_0x1a9b('0x2f')]},_0x1d446c)[_0x1a9b('0x23')](handleResult(_0x8114ac))[_0x1a9b('0x32')](handleError());}if(!_['isNil'](_0x8114ac[_0x1a9b('0x33')])){logger[_0x1a9b('0xb')](_0x1a9b('0x34'),_0x8114ac[_0x1a9b('0x33')]);return analyticCustomReportController[_0x1a9b('0x31')]({'id':_0x8114ac[_0x1a9b('0x33')]},_0x1d446c)[_0x1a9b('0x23')](handleResult(_0x8114ac))[_0x1a9b('0x32')](handleError());}}catch(_0x205ad8){logger[_0x1a9b('0x24')](JSON['stringify'](_0x205ad8));}return logger[_0x1a9b('0xb')](_0x1a9b('0x35'));};}function getJobs(_0x4f833e){var _0x2f6b4e={};if(_0x4f833e){_0x2f6b4e['id']=_0x4f833e;}return db[_0x1a9b('0x36')][_0x1a9b('0x37')]({'where':_0x2f6b4e,'include':[{'model':db[_0x1a9b('0xe')],'attributes':['id',_0x1a9b('0x11'),_0x1a9b('0xd')],'include':[{'model':db[_0x1a9b('0x38')],'as':_0x1a9b('0x28'),'include':[{'model':db[_0x1a9b('0x39')],'as':_0x1a9b('0x39')}]}]}]})[_0x1a9b('0x23')](function(_0x19e070){var _0x53180c=_[_0x1a9b('0x3a')](manager[_0x1a9b('0x3b')]);var _0x2cca0a=_[_0x1a9b('0x3c')](_0x19e070,function(_0x3c894c){return _0x3c894c['id'][_0x1a9b('0x3d')]();});var _0x4ce5b6=_[_0x1a9b('0x3e')](_0x19e070,function(_0x1d70ba){return _0x1d70ba['id'][_0x1a9b('0x3d')]();});var _0x546d46=_0x4f833e?_0x2cca0a:_[_0x1a9b('0x3f')](_0x2cca0a,_0x53180c);var _0x247ccb=_[_0x1a9b('0x40')](_0x2cca0a,_0x53180c);var _0x49d700=_['difference'](_0x53180c,_0x2cca0a);var _0x4b4cc2;var _0x5ca5b7;for(_0x4b4cc2=0x0;_0x4b4cc2<_0x49d700[_0x1a9b('0x41')]&&!_0x4f833e;_0x4b4cc2+=0x1){_0x5ca5b7=_0x49d700[_0x4b4cc2][_0x1a9b('0x3d')]();if(manager['exists'](_0x5ca5b7)){manager[_0x1a9b('0x42')](_0x5ca5b7);manager['deleteJob'](_0x5ca5b7);logger['info'](_0x1a9b('0x43'),_0x5ca5b7);}}logger['info'](_0x1a9b('0x44'),JSON[_0x1a9b('0x20')](_0x546d46));for(_0x4b4cc2=0x0;_0x4b4cc2<_0x546d46[_0x1a9b('0x41')];_0x4b4cc2+=0x1){_0x5ca5b7=_0x546d46[_0x4b4cc2]['toString']();logger[_0x1a9b('0xb')](_0x1a9b('0x45'),_0x5ca5b7);if(_0x4f833e){logger['info'](_0x1a9b('0x46'),_0x4f833e);logger[_0x1a9b('0xb')](JSON[_0x1a9b('0x20')](_0x4ce5b6[_0x5ca5b7]));BPromise[_0x1a9b('0x47')]()[_0x1a9b('0x23')](handleJob(_0x4ce5b6[_0x5ca5b7]));logger[_0x1a9b('0xb')](_0x1a9b('0x48'),_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x11')],_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')]);}else if(_0x4ce5b6[_0x5ca5b7]['cron']&&_0x4ce5b6[_0x5ca5b7]['active']&&moment()['isBetween'](_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x4a')],_0x4ce5b6[_0x5ca5b7]['endAt'])){manager[_0x1a9b('0x4b')](_0x5ca5b7,_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')],handleJob(_0x4ce5b6[_0x5ca5b7]));manager[_0x1a9b('0x4c')](_0x5ca5b7);logger[_0x1a9b('0xb')](_0x1a9b('0x4d'),_0x4ce5b6[_0x5ca5b7]['name'],_0x4ce5b6[_0x5ca5b7]['cron']);}else if(manager[_0x1a9b('0x4e')](_0x5ca5b7)){manager['stop'](_0x5ca5b7);manager[_0x1a9b('0x4f')](_0x5ca5b7);logger['info'](_0x1a9b('0x50'),_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x11')],_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')]);}}for(_0x4b4cc2=0x0,_0x5ca5b7;_0x4b4cc2<_0x247ccb['length']&&!_0x4f833e;_0x4b4cc2+=0x1){_0x5ca5b7=_0x247ccb[_0x4b4cc2][_0x1a9b('0x3d')]();if(manager[_0x1a9b('0x4e')](_0x5ca5b7)){if(_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')]&&_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x51')]&&moment()['isBetween'](_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x4a')],_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x52')])){manager[_0x1a9b('0x53')](_0x5ca5b7,_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')],handleJob(_0x4ce5b6[_0x5ca5b7]));logger['info']('update\x20cron',_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x11')],_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')]);}else{manager[_0x1a9b('0x42')](_0x5ca5b7);manager[_0x1a9b('0x4f')](_0x5ca5b7);logger['info'](_0x1a9b('0x50'),_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x11')],_0x4ce5b6[_0x5ca5b7][_0x1a9b('0x49')]);}}}})[_0x1a9b('0x32')](function(_0x547722){logger[_0x1a9b('0x24')](JSON['stringify'](_0x547722));});}exports[_0x1a9b('0x54')]=function(_0x5ad78e){return getJobs(_0x5ad78e);};exports[_0x1a9b('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 7cf7f16..27cd32d 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b2b=['request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','findOne','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','length','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x348cbd,_0x2480a2){_0x348cbd=_0x348cbd-0x0;var _0x25ec11=_0x8b2b[_0x348cbd];return _0x25ec11;};var _=require(_0xb8b2('0x0'));var AWS=require(_0xb8b2('0x1'));var rp=require(_0xb8b2('0x2'));var util=require('util');var BPromise=require(_0xb8b2('0x3'));var db=require(_0xb8b2('0x4'))['db'];var logger=require(_0xb8b2('0x5'))(_0xb8b2('0x6'));function getTranscriptionJob(_0x1199f8,_0x2928a7,_0x570c5d,_0x5bf172){return new Promise(function(_0xba7734,_0x31b3f9){var _0x2f0032=new AWS[(_0xb8b2('0x7'))]({'accessKeyId':_0x2928a7,'secretAccessKey':_0x1199f8,'region':_0x570c5d});_0x2f0032['getTranscriptionJob']({'TranscriptionJobName':_0x5bf172},function(_0x541b1b,_0x310a57){if(_0x541b1b){return _0x31b3f9(_0x541b1b);}else{return _0xba7734(_0x310a57);}});});}function sentiment(_0x1c8046,_0x2238f2,_0xe429f2,_0x3542b6,_0x564fe2){return new Promise(function(_0x3adebc,_0x501001){var _0x51cae3=new AWS[(_0xb8b2('0x8'))]({'accessKeyId':_0x2238f2,'secretAccessKey':_0x1c8046,'region':_0xe429f2});_0x51cae3[_0xb8b2('0x9')]({'Text':_0x3542b6,'LanguageCode':_0x564fe2[_0xb8b2('0xa')](0x0,0x2)},function(_0x3af6d0,_0x301eb1){if(_0x3af6d0){return _0x501001(_0x3af6d0);}else{return _0x3adebc(_0x301eb1);}});});}function checkTranscribeJob(_0x252057,_0x584d41,_0x3440bf){var _0x5bd724;return new BPromise(function(_0x5d6dc1,_0x5ba7ad){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x252057['id'],_0x252057[_0xb8b2('0xd')]));return getTranscriptionJob(_0x3440bf[_0xb8b2('0xe')],_0x3440bf[_0xb8b2('0xf')],_0x584d41[_0xb8b2('0x10')],_0x252057[_0xb8b2('0xd')])['then'](function(_0x4b5a28){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x11'),_0x252057['id'],_0x252057[_0xb8b2('0xd')],_0x4b5a28[_0xb8b2('0x12')]['TranscriptionJobStatus']));if(!_0x252057['fileText']){switch(_0x4b5a28[_0xb8b2('0x12')][_0xb8b2('0x13')]){case _0xb8b2('0x14'):var _0x100f52={'transcribeStatus':_0x4b5a28['TranscriptionJob'][_0xb8b2('0x13')],'fileUri':_0x4b5a28[_0xb8b2('0x12')][_0xb8b2('0x15')][_0xb8b2('0x16')]};logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x17'),_0x252057['id']));return rp({'uri':_0x4b5a28['TranscriptionJob'][_0xb8b2('0x15')][_0xb8b2('0x16')],'json':!![]})[_0xb8b2('0x18')](function(_0x162d41){logger[_0xb8b2('0xb')](util['format'](_0xb8b2('0x19'),_0x252057['id']));if(_0x162d41&&_0x162d41['results']&&_0x162d41[_0xb8b2('0x1a')][_0xb8b2('0x1b')]&&_0x162d41[_0xb8b2('0x1a')][_0xb8b2('0x1b')]['length']){_0x100f52[_0xb8b2('0x1c')]='';for(var _0x2502ae=0x0;_0x2502ae<_0x162d41[_0xb8b2('0x1a')]['transcripts']['length'];_0x2502ae++){_0x100f52['fileText']+=_0x162d41['results'][_0xb8b2('0x1b')][_0x2502ae][_0xb8b2('0x1d')]+'';}}return _0x252057[_0xb8b2('0x1e')](_0x100f52);})[_0xb8b2('0x18')](function(){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x1f'),_0x252057['id']));if(!_0x252057[_0xb8b2('0x20')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x23'));}if(!_0x584d41[_0xb8b2('0x24')]||!_0x584d41[_0xb8b2('0x25')]||!_0x584d41[_0xb8b2('0x26')]||!_0x584d41[_0xb8b2('0x27')]||!_0x584d41[_0xb8b2('0x28')]){throw new db[(_0xb8b2('0x21'))]['ValidationError'](_0xb8b2('0x29'));}if(!_0x100f52[_0xb8b2('0x1c')]){throw new Error(_0xb8b2('0x2a'));}if(_0x584d41[_0xb8b2('0x25')]===_0x3440bf['id']){return _0x3440bf;}else{return db[_0xb8b2('0x2b')]['findOne']({'where':{'id':_settings[_0xb8b2('0x25')]}});}})[_0xb8b2('0x18')](function(_0x26309e){if(!_0x26309e){throw new db['Sequelize'][(_0xb8b2('0x22'))](_0xb8b2('0x2c'));}if(!_0x26309e['data1']||!_0x26309e[_0xb8b2('0xf')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x2d'));}_0x5bd724=_0x26309e;logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x2e'),_0x252057['id']));return sentiment(_0x5bd724[_0xb8b2('0xe')],_0x5bd724[_0xb8b2('0xf')],_0x584d41[_0xb8b2('0x26')],_0x100f52['fileText'],_0x584d41[_0xb8b2('0x27')]);})[_0xb8b2('0x18')](function(_0x527e3c){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x2f'),_0x252057['id']));return _0x252057[_0xb8b2('0x1e')]({'sentiment':_0x527e3c[_0xb8b2('0x30')],'sPositive':_0x527e3c[_0xb8b2('0x31')][_0xb8b2('0x32')],'sNegative':_0x527e3c[_0xb8b2('0x31')][_0xb8b2('0x33')],'sMixed':_0x527e3c[_0xb8b2('0x31')][_0xb8b2('0x34')],'sNeutral':_0x527e3c[_0xb8b2('0x31')][_0xb8b2('0x35')]});})[_0xb8b2('0x18')](function(){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x1f'),_0x252057['id']));_0x5d6dc1();});case _0xb8b2('0x36'):return _0x252057[_0xb8b2('0x1e')]({'transcribeStatus':_0xb8b2('0x36'),'failureReason':_0x4b5a28[_0xb8b2('0x12')][_0xb8b2('0x37')]})[_0xb8b2('0x18')](function(){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x1f'),_0x252057['id']));_0x5d6dc1();});default:logger[_0xb8b2('0xb')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x252057['id']));break;}}else{return BPromise[_0xb8b2('0x38')]()['then'](function(){if(!_0x252057[_0xb8b2('0x20')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x23'));}if(!_0x584d41['sentiment']||!_0x584d41['sentimentAccountId']||!_0x584d41[_0xb8b2('0x26')]||!_0x584d41[_0xb8b2('0x27')]||!_0x584d41[_0xb8b2('0x28')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x252057[_0xb8b2('0x1c')]){throw new Error(_0xb8b2('0x2a'));}if(_0x584d41[_0xb8b2('0x25')]===_0x3440bf['id']){return _0x3440bf;}else{return db[_0xb8b2('0x2b')][_0xb8b2('0x39')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xb8b2('0x18')](function(_0xf6f946){if(!_0xf6f946){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x2c'));}if(!_0xf6f946[_0xb8b2('0xe')]||!_0xf6f946[_0xb8b2('0xf')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x2d'));}_0x5bd724=_0xf6f946;logger['info'](util['format'](_0xb8b2('0x2e'),_0x252057['id']));return sentiment(_0x5bd724['data1'],_0x5bd724[_0xb8b2('0xf')],_0x584d41[_0xb8b2('0x26')],_0x252057[_0xb8b2('0x1c')],_0x584d41[_0xb8b2('0x27')]);})[_0xb8b2('0x18')](function(_0x4e8c6c){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x2f'),_0x252057['id']));return _0x252057[_0xb8b2('0x1e')]({'sentiment':_0x4e8c6c[_0xb8b2('0x30')],'sPositive':_0x4e8c6c[_0xb8b2('0x31')][_0xb8b2('0x32')],'sNegative':_0x4e8c6c[_0xb8b2('0x31')][_0xb8b2('0x33')],'sMixed':_0x4e8c6c[_0xb8b2('0x31')][_0xb8b2('0x34')],'sNeutral':_0x4e8c6c['SentimentScore'][_0xb8b2('0x35')],'transcribeStatus':_0xb8b2('0x14')});})[_0xb8b2('0x18')](function(){logger[_0xb8b2('0xb')](util[_0xb8b2('0xc')](_0xb8b2('0x1f'),_0x252057['id']));_0x5d6dc1();});}})[_0xb8b2('0x3a')](function(_0x3357fd){if(_0x3357fd){if(!_0x3357fd[_0xb8b2('0x3b')]||_0x3357fd[_0xb8b2('0x3b')]!==_0xb8b2('0x3c')){logger[_0xb8b2('0x3d')](util[_0xb8b2('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x252057['id']),util[_0xb8b2('0x3e')](_0x3357fd,{'showHidden':![],'depth':null}));}}_0x5d6dc1();});});}function checkTranscribe(){var _0x465693;var _0x5a3935;var _0x35b691;return db[_0xb8b2('0x3f')][_0xb8b2('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xb8b2('0x18')](function(_0x1d61f1){if(!_0x1d61f1||!_0x1d61f1[_0xb8b2('0x41')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x42'));}_0x465693=_0x1d61f1;return db[_0xb8b2('0x43')][_0xb8b2('0x39')]({'where':{'id':0x1}});})[_0xb8b2('0x18')](function(_0x3397b0){if(!_0x3397b0){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x44'));}_0x5a3935=_0x3397b0;if(!_0x5a3935[_0xb8b2('0x6')]||!_0x5a3935[_0xb8b2('0x45')]||!_0x5a3935['transcribeRegion']||!_0x5a3935['language']||!_0x5a3935[_0xb8b2('0x28')]){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x46'));}return db[_0xb8b2('0x2b')][_0xb8b2('0x39')]({'where':{'id':_0x5a3935['transcribeAccountId']}});})[_0xb8b2('0x18')](function(_0x3a07b5){if(!_0x3a07b5){throw new db[(_0xb8b2('0x21'))][(_0xb8b2('0x22'))](_0xb8b2('0x2c'));}if(!_0x3a07b5[_0xb8b2('0xe')]||!_0x3a07b5[_0xb8b2('0xf')]){throw new db[(_0xb8b2('0x21'))]['ValidationError'](_0xb8b2('0x2d'));}_0x35b691=_0x3a07b5;var _0x4e783a=[];_0x465693[_0xb8b2('0x47')](function(_0x285796){_0x4e783a[_0xb8b2('0x48')](checkTranscribeJob(_0x285796,_0x5a3935,_0x35b691));});return BPromise[_0xb8b2('0x49')](_0x4e783a);})[_0xb8b2('0x3a')](function(_0x3fc0a1){if(_0x3fc0a1){if(!_0x3fc0a1[_0xb8b2('0x3b')]||_0x3fc0a1['name']!==_0xb8b2('0x3c')){logger[_0xb8b2('0x3d')](util[_0xb8b2('0x3e')](_0x3fc0a1,{'showHidden':![],'depth':null}));}}});}exports[_0xb8b2('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x5706=['[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','inspect','start','lodash','aws-sdk','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x12fbba,_0x17c539){var _0x457631=function(_0x103a9a){while(--_0x103a9a){_0x12fbba['push'](_0x12fbba['shift']());}};_0x457631(++_0x17c539);}(_0x5706,0xb0));var _0x6570=function(_0x107b80,_0x213516){_0x107b80=_0x107b80-0x0;var _0x4282b9=_0x5706[_0x107b80];return _0x4282b9;};var _=require(_0x6570('0x0'));var AWS=require(_0x6570('0x1'));var rp=require(_0x6570('0x2'));var util=require('util');var BPromise=require(_0x6570('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6570('0x4'))(_0x6570('0x5'));function getTranscriptionJob(_0x95a926,_0x26e23c,_0x41adac,_0x14d076){return new Promise(function(_0x3ae2f1,_0x3eb22a){var _0x140ee2=new AWS[(_0x6570('0x6'))]({'accessKeyId':_0x26e23c,'secretAccessKey':_0x95a926,'region':_0x41adac});_0x140ee2['getTranscriptionJob']({'TranscriptionJobName':_0x14d076},function(_0x594eef,_0x2310ad){if(_0x594eef){return _0x3eb22a(_0x594eef);}else{return _0x3ae2f1(_0x2310ad);}});});}function sentiment(_0x39ed59,_0x28e7a4,_0x312455,_0x2dde4e,_0x3cb988){return new Promise(function(_0x4aaf60,_0x4b4581){var _0x5b71be=new AWS[(_0x6570('0x7'))]({'accessKeyId':_0x28e7a4,'secretAccessKey':_0x39ed59,'region':_0x312455});_0x5b71be[_0x6570('0x8')]({'Text':_0x2dde4e,'LanguageCode':_0x3cb988[_0x6570('0x9')](0x0,0x2)},function(_0x3c768f,_0x435809){if(_0x3c768f){return _0x4b4581(_0x3c768f);}else{return _0x4aaf60(_0x435809);}});});}function checkTranscribeJob(_0x2d0d0f,_0xc903eb,_0x3098d5){var _0x90499d;return new BPromise(function(_0x4a6fb8,_0xdc293b){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0xc'),_0x2d0d0f['id'],_0x2d0d0f[_0x6570('0xd')]));return getTranscriptionJob(_0x3098d5[_0x6570('0xe')],_0x3098d5[_0x6570('0xf')],_0xc903eb[_0x6570('0x10')],_0x2d0d0f[_0x6570('0xd')])[_0x6570('0x11')](function(_0x1861c4){logger[_0x6570('0xa')](util['format'](_0x6570('0x12'),_0x2d0d0f['id'],_0x2d0d0f['transcribeName'],_0x1861c4[_0x6570('0x13')][_0x6570('0x14')]));if(!_0x2d0d0f[_0x6570('0x15')]){switch(_0x1861c4[_0x6570('0x13')][_0x6570('0x14')]){case _0x6570('0x16'):var _0x26af5b={'transcribeStatus':_0x1861c4[_0x6570('0x13')][_0x6570('0x14')],'fileUri':_0x1861c4['TranscriptionJob'][_0x6570('0x17')][_0x6570('0x18')]};logger[_0x6570('0xa')](util[_0x6570('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x2d0d0f['id']));return rp({'uri':_0x1861c4[_0x6570('0x13')][_0x6570('0x17')][_0x6570('0x18')],'json':!![]})[_0x6570('0x11')](function(_0x59c604){logger['info'](util['format'](_0x6570('0x19'),_0x2d0d0f['id']));if(_0x59c604&&_0x59c604['results']&&_0x59c604[_0x6570('0x1a')][_0x6570('0x1b')]&&_0x59c604[_0x6570('0x1a')]['transcripts']['length']){_0x26af5b[_0x6570('0x15')]='';for(var _0x5778e1=0x0;_0x5778e1<_0x59c604[_0x6570('0x1a')]['transcripts'][_0x6570('0x1c')];_0x5778e1++){_0x26af5b[_0x6570('0x15')]+=_0x59c604['results']['transcripts'][_0x5778e1][_0x6570('0x1d')]+'';}}return _0x2d0d0f[_0x6570('0x1e')](_0x26af5b);})['then'](function(){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));if(!_0x2d0d0f[_0x6570('0x20')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x23'));}if(!_0xc903eb[_0x6570('0x24')]||!_0xc903eb[_0x6570('0x25')]||!_0xc903eb['sentimentRegion']||!_0xc903eb[_0x6570('0x26')]||!_0xc903eb[_0x6570('0x27')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x28'));}if(!_0x26af5b[_0x6570('0x15')]){throw new Error(_0x6570('0x29'));}if(_0xc903eb['sentimentAccountId']===_0x3098d5['id']){return _0x3098d5;}else{return db[_0x6570('0x2a')][_0x6570('0x2b')]({'where':{'id':_settings[_0x6570('0x25')]}});}})['then'](function(_0x4ffc70){if(!_0x4ffc70){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x2c'));}if(!_0x4ffc70[_0x6570('0xe')]||!_0x4ffc70[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x90499d=_0x4ffc70;logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x2e'),_0x2d0d0f['id']));return sentiment(_0x90499d[_0x6570('0xe')],_0x90499d[_0x6570('0xf')],_0xc903eb['sentimentRegion'],_0x26af5b[_0x6570('0x15')],_0xc903eb[_0x6570('0x26')]);})[_0x6570('0x11')](function(_0x14fdb0){logger[_0x6570('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2d0d0f['id']));return _0x2d0d0f[_0x6570('0x1e')]({'sentiment':_0x14fdb0['Sentiment'],'sPositive':_0x14fdb0['SentimentScore'][_0x6570('0x2f')],'sNegative':_0x14fdb0[_0x6570('0x30')][_0x6570('0x31')],'sMixed':_0x14fdb0[_0x6570('0x30')][_0x6570('0x32')],'sNeutral':_0x14fdb0[_0x6570('0x30')][_0x6570('0x33')]});})[_0x6570('0x11')](function(){logger[_0x6570('0xa')](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});case _0x6570('0x34'):return _0x2d0d0f[_0x6570('0x1e')]({'transcribeStatus':_0x6570('0x34'),'failureReason':_0x1861c4[_0x6570('0x13')][_0x6570('0x35')]})[_0x6570('0x11')](function(){logger['info'](util['format'](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});default:logger['info'](util[_0x6570('0xb')](_0x6570('0x36'),_0x2d0d0f['id']));break;}}else{return BPromise[_0x6570('0x37')]()[_0x6570('0x11')](function(){if(!_0x2d0d0f[_0x6570('0x20')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xc903eb[_0x6570('0x24')]||!_0xc903eb[_0x6570('0x25')]||!_0xc903eb['sentimentRegion']||!_0xc903eb[_0x6570('0x26')]||!_0xc903eb[_0x6570('0x27')]){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x28'));}if(!_0x2d0d0f['fileText']){throw new Error(_0x6570('0x29'));}if(_0xc903eb[_0x6570('0x25')]===_0x3098d5['id']){return _0x3098d5;}else{return db['CloudProvider'][_0x6570('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6570('0x11')](function(_0x1936f5){if(!_0x1936f5){throw new db['Sequelize']['ValidationError'](_0x6570('0x2c'));}if(!_0x1936f5[_0x6570('0xe')]||!_0x1936f5[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x90499d=_0x1936f5;logger['info'](util[_0x6570('0xb')](_0x6570('0x2e'),_0x2d0d0f['id']));return sentiment(_0x90499d[_0x6570('0xe')],_0x90499d[_0x6570('0xf')],_0xc903eb['sentimentRegion'],_0x2d0d0f[_0x6570('0x15')],_0xc903eb[_0x6570('0x26')]);})['then'](function(_0x3597a8){logger[_0x6570('0xa')](util['format'](_0x6570('0x38'),_0x2d0d0f['id']));return _0x2d0d0f['update']({'sentiment':_0x3597a8[_0x6570('0x39')],'sPositive':_0x3597a8[_0x6570('0x30')][_0x6570('0x2f')],'sNegative':_0x3597a8[_0x6570('0x30')][_0x6570('0x31')],'sMixed':_0x3597a8['SentimentScore']['Mixed'],'sNeutral':_0x3597a8[_0x6570('0x30')]['Neutral'],'transcribeStatus':_0x6570('0x16')});})[_0x6570('0x11')](function(){logger['info'](util[_0x6570('0xb')](_0x6570('0x1f'),_0x2d0d0f['id']));_0x4a6fb8();});}})['catch'](function(_0x333ac9){if(_0x333ac9){if(!_0x333ac9[_0x6570('0x3a')]||_0x333ac9[_0x6570('0x3a')]!==_0x6570('0x3b')){logger[_0x6570('0x3c')](util[_0x6570('0xb')](_0x6570('0x3d'),_0x2d0d0f['id']),util['inspect'](_0x333ac9,{'showHidden':![],'depth':null}));}}_0x4a6fb8();});});}function checkTranscribe(){var _0x30ec4e;var _0x26b247;var _0x50cb76;return db['VoiceRecording'][_0x6570('0x3e')]({'where':{'transcribeStatus':_0x6570('0x3f')}})[_0x6570('0x11')](function(_0x5c8c68){if(!_0x5c8c68||!_0x5c8c68['length']){throw new db[(_0x6570('0x21'))]['ValidationError'](_0x6570('0x40'));}_0x30ec4e=_0x5c8c68;return db[_0x6570('0x41')][_0x6570('0x2b')]({'where':{'id':0x1}});})[_0x6570('0x11')](function(_0x444f6d){if(!_0x444f6d){throw new db['Sequelize'][(_0x6570('0x22'))]('Settings\x20not\x20available');}_0x26b247=_0x444f6d;if(!_0x26b247[_0x6570('0x5')]||!_0x26b247[_0x6570('0x42')]||!_0x26b247[_0x6570('0x10')]||!_0x26b247['language']||!_0x26b247[_0x6570('0x27')]){throw new db['Sequelize'][(_0x6570('0x22'))](_0x6570('0x43'));}return db[_0x6570('0x2a')][_0x6570('0x2b')]({'where':{'id':_0x26b247[_0x6570('0x42')]}});})[_0x6570('0x11')](function(_0x3b58db){if(!_0x3b58db){throw new db['Sequelize'][(_0x6570('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b58db[_0x6570('0xe')]||!_0x3b58db[_0x6570('0xf')]){throw new db[(_0x6570('0x21'))][(_0x6570('0x22'))](_0x6570('0x2d'));}_0x50cb76=_0x3b58db;var _0x4c91e8=[];_0x30ec4e[_0x6570('0x44')](function(_0x4c33f0){_0x4c91e8[_0x6570('0x45')](checkTranscribeJob(_0x4c33f0,_0x26b247,_0x50cb76));});return BPromise[_0x6570('0x46')](_0x4c91e8);})[_0x6570('0x47')](function(_0x10e8ce){if(_0x10e8ce){if(!_0x10e8ce[_0x6570('0x3a')]||_0x10e8ce['name']!==_0x6570('0x3b')){logger[_0x6570('0x3c')](util[_0x6570('0x48')](_0x10e8ce,{'showHidden':![],'depth':null}));}}});}exports[_0x6570('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 88df0bc..0896982 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafd8=['findAll','lastMsgAt','subtract','hours','then','length','map','info','join','update','timeout','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','WhatsappInteraction'];(function(_0x51f788,_0x1acea3){var _0x483577=function(_0x15d6fa){while(--_0x15d6fa){_0x51f788['push'](_0x51f788['shift']());}};_0x483577(++_0x1acea3);}(_0xafd8,0x1b2));var _0x8afd=function(_0x27472b,_0x1e5ca1){_0x27472b=_0x27472b-0x0;var _0x249243=_0xafd8[_0x27472b];return _0x249243;};'use strict';var _=require(_0x8afd('0x0'));var moment=require(_0x8afd('0x1'));var Redis=require(_0x8afd('0x2'));var util=require(_0x8afd('0x3'));var config=require('../../config/environment');var db=require(_0x8afd('0x4'))['db'];var logger=require(_0x8afd('0x5'))('schedule');config[_0x8afd('0x6')]=_['defaults'](config[_0x8afd('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x587697=[];return db[_0x8afd('0x7')][_0x8afd('0x8')]({'raw':!![],'attributes':['id',_0x8afd('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8afd('0xa')](0x18,_0x8afd('0xb'))}}})[_0x8afd('0xc')](function(_0x1f990b){if(_0x1f990b&&_0x1f990b[_0x8afd('0xd')]){_0x587697=_[_0x8afd('0xe')](_0x1f990b||[],'id');logger[_0x8afd('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x587697[_0x8afd('0x10')]());return db[_0x8afd('0x7')][_0x8afd('0x11')]({'closeReason':'system','disposition':_0x8afd('0x12'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x587697}});}})[_0x8afd('0xc')](function(){if(_0x587697&&_0x587697[_0x8afd('0xd')]){logger['info'](_0x8afd('0x13'),_0x587697[_0x8afd('0x10')]());for(var _0x4fb94c=0x0;_0x4fb94c<_0x587697[_0x8afd('0xd')];_0x4fb94c++){io[_0x8afd('0x14')](_0x8afd('0x15'),{'id':_0x587697[_0x4fb94c],'closed':!![]});}}})[_0x8afd('0x16')](function(_0x5d321d){logger[_0x8afd('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5d321d?util[_0x8afd('0x18')](_0x5d321d,{'showHidden':![],'depth':null}):'');});}exports[_0x8afd('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5a02=['WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','length','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x689fb4,_0x30844d){var _0x5a6d16=function(_0x998791){while(--_0x998791){_0x689fb4['push'](_0x689fb4['shift']());}};_0x5a6d16(++_0x30844d);}(_0x5a02,0x152));var _0x25a0=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x5a02[_0x28b0a4];return _0x105ce6;};'use strict';var _=require('lodash');var moment=require(_0x25a0('0x0'));var Redis=require(_0x25a0('0x1'));var util=require(_0x25a0('0x2'));var config=require(_0x25a0('0x3'));var db=require(_0x25a0('0x4'))['db'];var logger=require(_0x25a0('0x5'))(_0x25a0('0x6'));config[_0x25a0('0x7')]=_[_0x25a0('0x8')](config[_0x25a0('0x7')],{'host':_0x25a0('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x24e5cf=[];return db[_0x25a0('0xa')][_0x25a0('0xb')]({'raw':!![],'attributes':['id',_0x25a0('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x25a0('0xd')](0x18,_0x25a0('0xe'))}}})[_0x25a0('0xf')](function(_0x205c90){if(_0x205c90&&_0x205c90['length']){_0x24e5cf=_[_0x25a0('0x10')](_0x205c90||[],'id');logger[_0x25a0('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x24e5cf[_0x25a0('0x12')]());return db[_0x25a0('0xa')][_0x25a0('0x13')]({'closeReason':'system','disposition':_0x25a0('0x14'),'closed':!![],'closedAt':moment()['format'](_0x25a0('0x15'))},{'where':{'id':_0x24e5cf}});}})['then'](function(){if(_0x24e5cf&&_0x24e5cf[_0x25a0('0x16')]){logger[_0x25a0('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x24e5cf[_0x25a0('0x12')]());for(var _0x156f76=0x0;_0x156f76<_0x24e5cf[_0x25a0('0x16')];_0x156f76++){io['emit'](_0x25a0('0x17'),{'id':_0x24e5cf[_0x156f76],'closed':!![]});}}})[_0x25a0('0x18')](function(_0x2c5e99){logger[_0x25a0('0x19')](_0x25a0('0x1a'),_0x2c5e99?util[_0x25a0('0x1b')](_0x2c5e99,{'showHidden':![],'depth':null}):'');});}exports[_0x25a0('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 21fa12e..bb85f60 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f6c=['contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','now','@xcally.com','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x323a35,_0x4fb3e9){var _0x33a3e3=function(_0xd3da0c){while(--_0xd3da0c){_0x323a35['push'](_0x323a35['shift']());}};_0x33a3e3(++_0x4fb3e9);}(_0x8f6c,0x192));var _0xc8f6=function(_0x572928,_0x313c7c){_0x572928=_0x572928-0x0;var _0x4eef4c=_0x8f6c[_0x572928];return _0x4eef4c;};'use strict';var util=require(_0xc8f6('0x0'));var db=require(_0xc8f6('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc8f6('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc8f6('0x3')+i,'phone':0xf879fb460+i,'email':_0xc8f6('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc8f6('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc8f6('0x5')](),'updatedAt':Date[_0xc8f6('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc8f6('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc8f6('0x3')+i,'phone':0xf879fb460+i,'email':_0xc8f6('0x4')+i+_0xc8f6('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc8f6('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc8f6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc8f6('0x5')](),'updatedAt':Date['now']()});}db['CmContact'][_0xc8f6('0x7')]({'where':{}})[_0xc8f6('0x8')](function(){return db[_0xc8f6('0x9')][_0xc8f6('0xa')](contacts);})['then'](function(){console[_0xc8f6('0xb')](_0xc8f6('0xc'),_0xc8f6('0xd'));return db[_0xc8f6('0xe')][_0xc8f6('0x7')]({'where':{}});})[_0xc8f6('0x8')](function(){return db[_0xc8f6('0xe')][_0xc8f6('0xa')](hopper);})[_0xc8f6('0x8')](function(){console[_0xc8f6('0xb')]('finished\x20populating',_0xc8f6('0xf'));return db[_0xc8f6('0x9')][_0xc8f6('0xa')](contacts2);})[_0xc8f6('0x8')](function(){console[_0xc8f6('0xb')]('finished\x20populating',_0xc8f6('0x10'));return db[_0xc8f6('0xe')]['bulkCreate'](hopper2);})[_0xc8f6('0x8')](function(){console[_0xc8f6('0xb')]('finished\x20populating',_0xc8f6('0x11'));})[_0xc8f6('0x12')](function(_0x166937){console[_0xc8f6('0xb')](_0x166937);}); \ No newline at end of file +var _0xadbe=['destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x3aa544,_0x80ad0a){var _0x2a52d3=function(_0x37db1f){while(--_0x37db1f){_0x3aa544['push'](_0x3aa544['shift']());}};_0x2a52d3(++_0x80ad0a);}(_0xadbe,0xd5));var _0xeadb=function(_0x938aba,_0x4ec9a9){_0x938aba=_0x938aba-0x0;var _0x1d61b6=_0xadbe[_0x938aba];return _0x1d61b6;};'use strict';var util=require(_0xeadb('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xeadb('0x1')]({'id':i,'firstName':_0xeadb('0x2')+i,'lastName':_0xeadb('0x3')+i,'phone':0xf879fb460+i,'email':_0xeadb('0x4')+i+_0xeadb('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xeadb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xeadb('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xeadb('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xeadb('0x2')+i,'lastName':_0xeadb('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xeadb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xeadb('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xeadb('0x6')](),'updatedAt':Date[_0xeadb('0x6')]()});}db[_0xeadb('0x7')][_0xeadb('0x8')]({'where':{}})[_0xeadb('0x9')](function(){return db[_0xeadb('0x7')][_0xeadb('0xa')](contacts);})['then'](function(){console[_0xeadb('0xb')](_0xeadb('0xc'),_0xeadb('0xd'));return db[_0xeadb('0xe')]['destroy']({'where':{}});})[_0xeadb('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})['then'](function(){console[_0xeadb('0xb')](_0xeadb('0xc'),_0xeadb('0xf'));return db[_0xeadb('0x7')]['bulkCreate'](contacts2);})['then'](function(){console[_0xeadb('0xb')](_0xeadb('0xc'),_0xeadb('0x10'));return db[_0xeadb('0xe')][_0xeadb('0xa')](hopper2);})[_0xeadb('0x9')](function(){console['log'](_0xeadb('0xc'),'hopper2');})['catch'](function(_0x35bd76){console[_0xeadb('0xb')](_0x35bd76);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4e116d3..88d93db 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b6a=['actpass','\x22%s\x22\x20<%s>','bulkCreate','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x5b6a,0xba));var _0xa5b6=function(_0x39e4c6,_0x2e9428){_0x39e4c6=_0x39e4c6-0x0;var _0x122b46=_0x5b6a[_0x39e4c6];return _0x122b46;};'use strict';var util=require(_0xa5b6('0x0'));var db=require(_0xa5b6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa5b6('0x2')]({'name':util[_0xa5b6('0x3')](_0xa5b6('0x4'),_0xa5b6('0x5'),i),'fullname':util['format'](_0xa5b6('0x4'),_0xa5b6('0x5'),i),'email':util[_0xa5b6('0x3')]('%s%s@xcally.com',_0xa5b6('0x5'),i),'role':_0xa5b6('0x5'),'password':_0xa5b6('0x6'),'internal':0xfa0+i,'type':_0xa5b6('0x7'),'transport':[_0xa5b6('0x8'),'ws',_0xa5b6('0x9')],'disallow':['all'],'allow':[_0xa5b6('0xa')],'defaultuser':util[_0xa5b6('0x3')]('%s%s',_0xa5b6('0x5'),i),'encryption':_0xa5b6('0xb'),'avpf':_0xa5b6('0xb'),'force_avp':'yes','icesupport':_0xa5b6('0xb'),'dtlsenable':_0xa5b6('0xb'),'dtlsverify':'no','dtlscertfile':_0xa5b6('0xc'),'dtlsprivatekey':_0xa5b6('0xd'),'dtlssetup':_0xa5b6('0xe'),'callerid':util[_0xa5b6('0x3')](_0xa5b6('0xf'),util['format'](_0xa5b6('0x4'),_0xa5b6('0x5'),i),0xfa0+i)});}db['User'][_0xa5b6('0x10')](users)['then'](function(){console['log'](_0xa5b6('0x11'));})[_0xa5b6('0x12')](function(_0x36cda0){console[_0xa5b6('0x13')](_0x36cda0);}); \ No newline at end of file +var _0x77af=['actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','format','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x14f946,_0x4fa7c6){var _0x344c47=function(_0x3b288b){while(--_0x3b288b){_0x14f946['push'](_0x14f946['shift']());}};_0x344c47(++_0x4fa7c6);}(_0x77af,0x140));var _0xf77a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x77af[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0xf77a('0x0'));var db=require(_0xf77a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf77a('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util['format'](_0xf77a('0x3'),_0xf77a('0x4'),i),'email':util['format'](_0xf77a('0x5'),_0xf77a('0x4'),i),'role':'agent','password':_0xf77a('0x6'),'internal':0xfa0+i,'type':_0xf77a('0x7'),'transport':[_0xf77a('0x8'),'ws',_0xf77a('0x9')],'disallow':[_0xf77a('0xa')],'allow':[_0xf77a('0xb')],'defaultuser':util[_0xf77a('0xc')](_0xf77a('0x3'),'agent',i),'encryption':_0xf77a('0xd'),'avpf':_0xf77a('0xd'),'force_avp':_0xf77a('0xd'),'icesupport':_0xf77a('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xf77a('0xe'),'dtlsprivatekey':_0xf77a('0xf'),'dtlssetup':_0xf77a('0x10'),'callerid':util[_0xf77a('0xc')](_0xf77a('0x11'),util['format'](_0xf77a('0x3'),_0xf77a('0x4'),i),0xfa0+i)});}db[_0xf77a('0x12')][_0xf77a('0x13')](users)[_0xf77a('0x14')](function(){console[_0xf77a('0x15')](_0xf77a('0x16'));})[_0xf77a('0x17')](function(_0x34040c){console[_0xf77a('0x15')](_0x34040c);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 96dbb0e..11d8858 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64e6=['user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','where','telephone','format','%s:queue:%s','length','user:%s','Agents','handshake','query','find','role','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','user','voice:outbound','FaxQueues','OpenchannelQueues','WhatsappQueue','User','Trunks','Trunk','Campaign','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','map','removeMailInteractions'];(function(_0x2b3478,_0x58afd7){var _0x1c106f=function(_0x4f12a1){while(--_0x4f12a1){_0x2b3478['push'](_0x2b3478['shift']());}};_0x1c106f(++_0x58afd7);}(_0x64e6,0x1b2));var _0x664e=function(_0x339e18,_0x37bfa7){_0x339e18=_0x339e18-0x0;var _0x22df2f=_0x64e6[_0x339e18];return _0x22df2f;};'use strict';var _=require(_0x664e('0x0'));var util=require('util');var BPromise=require(_0x664e('0x1'));var db=require(_0x664e('0x2'))['db'];var config=require(_0x664e('0x3'));var queryQueues={'attributes':['id',_0x664e('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x664e('0x4'),'role'],'raw':!![],'where':{'role':_0x664e('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x664e('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x664e('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x664e('0x4')],'where':{'role':_0x664e('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x664e('0x6')],'where':{'type':_0x664e('0x7')}};function getAssociatedResources(_0x15e64b,_0x686c0e,_0x2dc92b){return db[_0x664e('0x8')]['findOne']({'where':{'name':_0x15e64b,'userProfileId':_0x686c0e},'raw':!![]})[_0x664e('0x9')](function(_0x2ded79){if(_0x2ded79){if(_0x2ded79[_0x664e('0xa')]){switch(_0x15e64b){case _0x664e('0xb'):case _0x664e('0xc'):case'FaxQueues':case _0x664e('0xd'):case _0x664e('0xe'):case'OpenchannelQueues':case _0x664e('0xf'):return db[_0x2dc92b]['findAll'](queryQueues);case _0x664e('0x10'):return db[_0x2dc92b][_0x664e('0x11')](queryTelephones);case'Trunks':return db[_0x2dc92b]['findAll'](queryTrunks);case _0x664e('0x12'):return db[_0x2dc92b][_0x664e('0x11')](queryCampaigns);}}else{return db['UserProfileResource'][_0x664e('0x11')]({'attributes':[_0x664e('0x13')],'where':{'sectionId':_0x2ded79['id']},'raw':!![]})[_0x664e('0x9')](function(_0x340b9e){if(_0x340b9e){var _0x2a967f={'where':{'id':_['map'](_0x340b9e,_0x664e('0x13'))},'raw':!![]};switch(_0x2dc92b){case'User':_0x2a967f[_0x664e('0x14')]['role']=_0x664e('0x15');break;case'Campaign':_0x2a967f[_0x664e('0x14')][_0x664e('0x6')]='ivr';break;}return db[_0x2dc92b][_0x664e('0x11')](_0x2a967f);}else{return[];}});}}else{return[];}})[_0x664e('0x9')](function(_0x56e47c){return _0x56e47c;});}function joinOrLeaveQueues(_0x49f12a,_0x312f31,_0x49b444,_0x1cf289){_0x49f12a[_0x312f31](util[_0x664e('0x16')](_0x664e('0x17'),_0x49b444,_0x1cf289['name']));if(_0x1cf289['Agents']){for(var _0x364641=0x0;_0x364641<_0x1cf289['Agents'][_0x664e('0x18')];_0x364641+=0x1){_0x49f12a[_0x312f31](util[_0x664e('0x16')](_0x664e('0x19'),_0x1cf289[_0x664e('0x1a')][_0x364641][_0x664e('0x4')]));}}}function joinOrLeave(_0x4fdc8f,_0x4c2f9d,_0xdc3890){var _0x14f7f5;if(_0x4fdc8f[_0x664e('0x1b')][_0x664e('0x1c')]['id']){db['User'][_0x664e('0x1d')]({'attributes':['id',_0x664e('0x4'),_0x664e('0x1e'),_0x664e('0x1f')],'where':{'id':_0x4fdc8f[_0x664e('0x1b')]['query']['id']},'include':[{'model':db[_0x664e('0x20')],'as':_0x664e('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x664e('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x664e('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x664e('0x24')],'as':_0x664e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x664e('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x664e('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x5deef4){if(_0x5deef4){_0x14f7f5=_0x5deef4;_0x4fdc8f[_0x4c2f9d](util[_0x664e('0x16')](_0x664e('0x19'),_0x5deef4[_0x664e('0x4')]));var _0xa48ce1=[];switch(_0x5deef4[_0x664e('0x1e')]){case _0x664e('0x28'):_0x4fdc8f[_0x4c2f9d](_0x664e('0x29'));_0x4fdc8f[_0x4c2f9d]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x664e('0x2a'))){delete queryQueues[_0x664e('0x2a')];}_0xa48ce1[_0x664e('0x2b')](db[_0x664e('0x2c')]['findAll'](queryQueues));_0xa48ce1[_0x664e('0x2b')](db[_0x664e('0x2d')][_0x664e('0x11')](queryQueues));_0xa48ce1[_0x664e('0x2b')](db['FaxQueue'][_0x664e('0x11')](queryQueues));_0xa48ce1[_0x664e('0x2b')](db[_0x664e('0x2e')][_0x664e('0x11')](queryQueues));_0xa48ce1[_0x664e('0x2b')](db[_0x664e('0x2f')][_0x664e('0x11')](queryQueues));_0xa48ce1['push'](db[_0x664e('0x30')][_0x664e('0x11')](queryQueues));_0xa48ce1[_0x664e('0x2b')](db['WhatsappQueue'][_0x664e('0x11')](queryQueues));_0xa48ce1[_0x664e('0x2b')](db['User'][_0x664e('0x11')](queryTelephones));_0xa48ce1[_0x664e('0x2b')](db['Trunk'][_0x664e('0x11')](queryTrunks));_0xa48ce1[_0x664e('0x2b')](db['Campaign'][_0x664e('0x11')](queryCampaigns));_0xa48ce1[_0x664e('0x2b')](db['User']['findAll'](queryAgents));break;case _0x664e('0x31'):_0x4fdc8f[_0x4c2f9d](_0x664e('0x29'));_0x4fdc8f[_0x4c2f9d](_0x664e('0x32'));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0xb'),_0x5deef4['userProfileId'],_0x664e('0x2c')));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0xc'),_0x5deef4[_0x664e('0x1f')],_0x664e('0x2d')));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0x33'),_0x5deef4[_0x664e('0x1f')],'FaxQueue'));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0xd'),_0x5deef4[_0x664e('0x1f')],'SmsQueue'));_0xa48ce1['push'](getAssociatedResources(_0x664e('0xe'),_0x5deef4[_0x664e('0x1f')],_0x664e('0x2f')));_0xa48ce1['push'](getAssociatedResources(_0x664e('0x34'),_0x5deef4[_0x664e('0x1f')],_0x664e('0x30')));_0xa48ce1['push'](getAssociatedResources(_0x664e('0xf'),_0x5deef4[_0x664e('0x1f')],_0x664e('0x35')));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0x10'),_0x5deef4[_0x664e('0x1f')],_0x664e('0x36')));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources(_0x664e('0x37'),_0x5deef4['userProfileId'],_0x664e('0x38')));_0xa48ce1[_0x664e('0x2b')](getAssociatedResources('IvrCampaigns',_0x5deef4['userProfileId'],_0x664e('0x39')));_0xa48ce1[_0x664e('0x2b')](db[_0x664e('0x36')][_0x664e('0x11')](queryAgents));break;case _0x664e('0x5'):_0x4fdc8f[_0x4c2f9d](_0x664e('0x29'));_0x4fdc8f[_0x4c2f9d](_0x664e('0x32'));_0xa48ce1[_0x664e('0x2b')](_0x5deef4['getVoiceQueues']({'attributes':['id',_0x664e('0x4')]}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4['getChatQueues']({'attributes':['id','name']}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4[_0x664e('0x3a')]({'attributes':['id',_0x664e('0x4')]}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4['getSmsQueues']({'attributes':['id','name']}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4[_0x664e('0x3b')]({'attributes':['id','name']}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4[_0x664e('0x3c')]({'attributes':['id','name']}));_0xa48ce1[_0x664e('0x2b')](_0x5deef4[_0x664e('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0x664e('0x3e')](_0xa48ce1);}})[_0x664e('0x9')](function(_0x30d5ae){if(_0x30d5ae&&_0x30d5ae[_0x664e('0x18')]){for(var _0x58dc19=0x0;_0x58dc19<_0x30d5ae[_0x664e('0x18')];_0x58dc19+=0x1){for(var _0x2aba32=0x0;_0x2aba32<_0x30d5ae[_0x58dc19][_0x664e('0x18')];_0x2aba32+=0x1){switch(_0x58dc19){case 0x0:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,_0x664e('0x3f'),_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x1:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,_0x664e('0x40'),_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x2:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,'fax',_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x3:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,_0x664e('0x41'),_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x4:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,_0x664e('0x42'),_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x5:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,_0x664e('0x43'),_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x6:joinOrLeaveQueues(_0x4fdc8f,_0x4c2f9d,'whatsapp',_0x30d5ae[_0x58dc19][_0x2aba32]);break;case 0x7:if(_0x14f7f5[_0x664e('0x1e')]!==_0x664e('0x5'))_0x4fdc8f[_0x4c2f9d](util[_0x664e('0x16')](_0x664e('0x44'),_0x30d5ae[_0x58dc19][_0x2aba32][_0x664e('0x4')]));break;case 0x8:if(_0x14f7f5[_0x664e('0x1e')]!=='agent')_0x4fdc8f[_0x4c2f9d](util[_0x664e('0x16')](_0x664e('0x45'),_0x30d5ae[_0x58dc19][_0x2aba32][_0x664e('0x4')]));break;case 0x9:if(_0x14f7f5[_0x664e('0x1e')]!==_0x664e('0x5'))_0x4fdc8f[_0x4c2f9d](util['format']('campaign:%s:%s',_0x30d5ae[_0x58dc19][_0x2aba32][_0x664e('0x6')],_0x30d5ae[_0x58dc19][_0x2aba32][_0x664e('0x4')]));break;case 0xa:_0x4fdc8f[_0x4c2f9d](util[_0x664e('0x16')]('user:%s',_0x30d5ae[_0x58dc19][_0x2aba32][_0x664e('0x4')]));break;}}}}})['then'](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x5348a1=_['map'](_0x14f7f5['ChatInteractions'],'id');return _0x14f7f5[_0x664e('0x47')](_0x5348a1)[_0x664e('0x9')](function(){for(var _0x49b209=0x0;_0x49b209<_0x5348a1[_0x664e('0x18')];_0x49b209+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x49'),{'ChatInteractionId':Number(_0x5348a1[_0x49b209]),'UserId':Number(_0x14f7f5['id'])});}});}})['then'](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x1df960=_[_0x664e('0x4a')](_0x14f7f5[_0x664e('0x22')],'id');return _0x14f7f5[_0x664e('0x4b')](_0x1df960)[_0x664e('0x9')](function(){for(var _0x187881=0x0;_0x187881<_0x1df960[_0x664e('0x18')];_0x187881+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x4c'),{'MailInteractionId':Number(_0x1df960[_0x187881]),'UserId':Number(_0x14f7f5['id'])});}});}})[_0x664e('0x9')](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x5256cb=_['map'](_0x14f7f5[_0x664e('0x4d')],'id');return _0x14f7f5[_0x664e('0x4e')](_0x5256cb)[_0x664e('0x9')](function(){for(var _0x5f27d7=0x0;_0x5f27d7<_0x5256cb[_0x664e('0x18')];_0x5f27d7+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x4f'),{'FaxInteractionId':Number(_0x5256cb[_0x5f27d7]),'UserId':Number(_0x14f7f5['id'])});}});}})[_0x664e('0x9')](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x1c3915=_[_0x664e('0x4a')](_0x14f7f5['SmsInteractions'],'id');return _0x14f7f5[_0x664e('0x50')](_0x1c3915)[_0x664e('0x9')](function(){for(var _0x38f326=0x0;_0x38f326<_0x1c3915[_0x664e('0x18')];_0x38f326+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x51'),{'SmsInteractionId':Number(_0x1c3915[_0x38f326]),'UserId':Number(_0x14f7f5['id'])});}});}})['then'](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x320a30=_[_0x664e('0x4a')](_0x14f7f5['OpenchannelInteractions'],'id');return _0x14f7f5[_0x664e('0x52')](_0x320a30)[_0x664e('0x9')](function(){for(var _0x4b0bab=0x0;_0x4b0bab<_0x320a30[_0x664e('0x18')];_0x4b0bab+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x53'),{'OpenchannelInteractionId':Number(_0x320a30[_0x4b0bab]),'UserId':Number(_0x14f7f5['id'])});}});}})[_0x664e('0x9')](function(){if(_0x4c2f9d===_0x664e('0x46')){var _0x4ae256=_['map'](_0x14f7f5[_0x664e('0x54')],'id');return _0x14f7f5['removeWhatsappInteractions'](_0x4ae256)[_0x664e('0x9')](function(){for(var _0x3a4dcd=0x0;_0x3a4dcd<_0x4ae256[_0x664e('0x18')];_0x3a4dcd+=0x1){_0xdc3890[_0x664e('0x48')](_0x664e('0x55'),{'WhatsappInteractionId':Number(_0x4ae256[_0x3a4dcd]),'UserId':Number(_0x14f7f5['id'])});}});}})[_0x664e('0x56')](function(_0x6e8f28){_0x4fdc8f[_0x664e('0x57')](_0x6e8f28);});}}function onDisconnect(_0x598216,_0x75fa0){joinOrLeave(_0x598216,_0x664e('0x46'),_0x75fa0);}function onConnect(_0x3fed0c){joinOrLeave(_0x3fed0c,_0x664e('0x58'));}exports[_0x664e('0x59')]=function(_0x38158f){_0x38158f['on'](_0x664e('0x5a'),function(_0x5a2292){_0x5a2292[_0x664e('0x5b')](0x0);_0x5a2292[_0x664e('0x5c')]=_0x5a2292['request'][_0x664e('0x5a')][_0x664e('0x5d')]+':'+_0x5a2292[_0x664e('0x5e')][_0x664e('0x5a')][_0x664e('0x5f')];_0x5a2292[_0x664e('0x60')]=new Date();_0x5a2292['log']=function(_0x44021f){console['log'](_0x664e('0x61')+_0x5a2292[_0x664e('0x62')][_0x664e('0x4')]+'['+_0x5a2292[_0x664e('0x5c')]+']',_0x44021f);};_0x5a2292['on'](_0x664e('0x63'),function(){onDisconnect(_0x5a2292,_0x38158f);_0x5a2292['log'](_0x664e('0x64'));});onConnect(_0x5a2292);_0x5a2292[_0x664e('0x57')](_0x664e('0x65'));});}; \ No newline at end of file +var _0x186d=['ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','ChatQueues','SmsQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','log','address','disconnect','CONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','query','userProfileId','handshake','ChatInteraction'];(function(_0x46114d,_0x5e3007){var _0x4f9f4d=function(_0xcc2f11){while(--_0xcc2f11){_0x46114d['push'](_0x46114d['shift']());}};_0x4f9f4d(++_0x5e3007);}(_0x186d,0x1ca));var _0xd186=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x186d[_0x1428d9];return _0x438019;};'use strict';var _=require('lodash');var util=require(_0xd186('0x0'));var BPromise=require(_0xd186('0x1'));var db=require(_0xd186('0x2'))['db'];var config=require(_0xd186('0x3'));var queryQueues={'attributes':['id',_0xd186('0x4')],'include':[{'as':_0xd186('0x5'),'model':db['User'],'attributes':['id',_0xd186('0x4'),_0xd186('0x6')],'raw':!![],'where':{'role':_0xd186('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xd186('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xd186('0x4')],'where':{'role':_0xd186('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xd186('0x8')],'where':{'type':_0xd186('0x9')}};function getAssociatedResources(_0xc486db,_0x4994e5,_0x1ef64a){return db[_0xd186('0xa')][_0xd186('0xb')]({'where':{'name':_0xc486db,'userProfileId':_0x4994e5},'raw':!![]})[_0xd186('0xc')](function(_0x39ad45){if(_0x39ad45){if(_0x39ad45[_0xd186('0xd')]){switch(_0xc486db){case'VoiceQueues':case'ChatQueues':case _0xd186('0xe'):case'SmsQueues':case _0xd186('0xf'):case _0xd186('0x10'):case _0xd186('0x11'):return db[_0x1ef64a]['findAll'](queryQueues);case _0xd186('0x12'):return db[_0x1ef64a]['findAll'](queryTelephones);case _0xd186('0x13'):return db[_0x1ef64a][_0xd186('0x14')](queryTrunks);case _0xd186('0x15'):return db[_0x1ef64a][_0xd186('0x14')](queryCampaigns);}}else{return db[_0xd186('0x16')][_0xd186('0x14')]({'attributes':[_0xd186('0x17')],'where':{'sectionId':_0x39ad45['id']},'raw':!![]})[_0xd186('0xc')](function(_0xc23af7){if(_0xc23af7){var _0xfb67a0={'where':{'id':_[_0xd186('0x18')](_0xc23af7,'resourceId')},'raw':!![]};switch(_0x1ef64a){case _0xd186('0x19'):_0xfb67a0[_0xd186('0x1a')][_0xd186('0x6')]=_0xd186('0x1b');break;case _0xd186('0x1c'):_0xfb67a0[_0xd186('0x1a')][_0xd186('0x8')]='ivr';break;}return db[_0x1ef64a][_0xd186('0x14')](_0xfb67a0);}else{return[];}});}}else{return[];}})[_0xd186('0xc')](function(_0x5471ff){return _0x5471ff;});}function joinOrLeaveQueues(_0xcded5d,_0x2276f1,_0x4f6f63,_0x5f460e){_0xcded5d[_0x2276f1](util[_0xd186('0x1d')](_0xd186('0x1e'),_0x4f6f63,_0x5f460e[_0xd186('0x4')]));if(_0x5f460e[_0xd186('0x5')]){for(var _0x363693=0x0;_0x363693<_0x5f460e['Agents'][_0xd186('0x1f')];_0x363693+=0x1){_0xcded5d[_0x2276f1](util[_0xd186('0x1d')](_0xd186('0x20'),_0x5f460e['Agents'][_0x363693]['name']));}}}function joinOrLeave(_0x114004,_0x1b5aae,_0x223bc7){var _0x5a5ff0;if(_0x114004['handshake'][_0xd186('0x21')]['id']){db[_0xd186('0x19')]['find']({'attributes':['id','name',_0xd186('0x6'),_0xd186('0x22')],'where':{'id':_0x114004[_0xd186('0x23')][_0xd186('0x21')]['id']},'include':[{'model':db[_0xd186('0x24')],'as':_0xd186('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd186('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xd186('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xd186('0x28')],'as':_0xd186('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xd186('0x2a')],'as':_0xd186('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xd186('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xd186('0xc')](function(_0x27b95a){if(_0x27b95a){_0x5a5ff0=_0x27b95a;_0x114004[_0x1b5aae](util[_0xd186('0x1d')](_0xd186('0x20'),_0x27b95a[_0xd186('0x4')]));var _0x22202d=[];switch(_0x27b95a[_0xd186('0x6')]){case _0xd186('0x2d'):_0x114004[_0x1b5aae](_0xd186('0x2e'));_0x114004[_0x1b5aae](_0xd186('0x2f'));if(queryQueues[_0xd186('0x30')](_0xd186('0x31'))){delete queryQueues[_0xd186('0x31')];}_0x22202d[_0xd186('0x32')](db[_0xd186('0x33')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x34')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x35')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x36')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x37')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x38')][_0xd186('0x14')](queryQueues));_0x22202d['push'](db[_0xd186('0x39')][_0xd186('0x14')](queryQueues));_0x22202d[_0xd186('0x32')](db[_0xd186('0x19')][_0xd186('0x14')](queryTelephones));_0x22202d[_0xd186('0x32')](db[_0xd186('0x3a')][_0xd186('0x14')](queryTrunks));_0x22202d['push'](db[_0xd186('0x1c')][_0xd186('0x14')](queryCampaigns));_0x22202d[_0xd186('0x32')](db[_0xd186('0x19')][_0xd186('0x14')](queryAgents));break;case _0xd186('0x3b'):_0x114004[_0x1b5aae](_0xd186('0x2e'));_0x114004[_0x1b5aae](_0xd186('0x2f'));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0x3c'),_0x27b95a[_0xd186('0x22')],_0xd186('0x33')));_0x22202d['push'](getAssociatedResources(_0xd186('0x3d'),_0x27b95a[_0xd186('0x22')],'ChatQueue'));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0xe'),_0x27b95a[_0xd186('0x22')],_0xd186('0x35')));_0x22202d['push'](getAssociatedResources(_0xd186('0x3e'),_0x27b95a['userProfileId'],_0xd186('0x36')));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0xf'),_0x27b95a['userProfileId'],'MailQueue'));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0x10'),_0x27b95a['userProfileId'],'OpenchannelQueue'));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0x11'),_0x27b95a['userProfileId'],_0xd186('0x39')));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0x12'),_0x27b95a[_0xd186('0x22')],'User'));_0x22202d[_0xd186('0x32')](getAssociatedResources('Trunks',_0x27b95a[_0xd186('0x22')],'Trunk'));_0x22202d[_0xd186('0x32')](getAssociatedResources(_0xd186('0x15'),_0x27b95a[_0xd186('0x22')],'Campaign'));_0x22202d[_0xd186('0x32')](db[_0xd186('0x19')]['findAll'](queryAgents));break;case _0xd186('0x7'):_0x114004[_0x1b5aae](_0xd186('0x2e'));_0x114004[_0x1b5aae]('voice:outbound');_0x22202d['push'](_0x27b95a[_0xd186('0x3f')]({'attributes':['id','name']}));_0x22202d[_0xd186('0x32')](_0x27b95a['getChatQueues']({'attributes':['id','name']}));_0x22202d[_0xd186('0x32')](_0x27b95a[_0xd186('0x40')]({'attributes':['id','name']}));_0x22202d[_0xd186('0x32')](_0x27b95a[_0xd186('0x41')]({'attributes':['id','name']}));_0x22202d['push'](_0x27b95a[_0xd186('0x42')]({'attributes':['id',_0xd186('0x4')]}));_0x22202d[_0xd186('0x32')](_0x27b95a[_0xd186('0x43')]({'attributes':['id',_0xd186('0x4')]}));_0x22202d[_0xd186('0x32')](_0x27b95a[_0xd186('0x44')]({'attributes':['id','name']}));break;}return BPromise[_0xd186('0x45')](_0x22202d);}})['then'](function(_0x414029){if(_0x414029&&_0x414029[_0xd186('0x1f')]){for(var _0x3cb411=0x0;_0x3cb411<_0x414029[_0xd186('0x1f')];_0x3cb411+=0x1){for(var _0x3b1b9b=0x0;_0x3b1b9b<_0x414029[_0x3cb411][_0xd186('0x1f')];_0x3b1b9b+=0x1){switch(_0x3cb411){case 0x0:joinOrLeaveQueues(_0x114004,_0x1b5aae,'voice',_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x1:joinOrLeaveQueues(_0x114004,_0x1b5aae,_0xd186('0x46'),_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x2:joinOrLeaveQueues(_0x114004,_0x1b5aae,_0xd186('0x47'),_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x3:joinOrLeaveQueues(_0x114004,_0x1b5aae,_0xd186('0x48'),_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x4:joinOrLeaveQueues(_0x114004,_0x1b5aae,_0xd186('0x49'),_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x5:joinOrLeaveQueues(_0x114004,_0x1b5aae,_0xd186('0x4a'),_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x6:joinOrLeaveQueues(_0x114004,_0x1b5aae,'whatsapp',_0x414029[_0x3cb411][_0x3b1b9b]);break;case 0x7:if(_0x5a5ff0['role']!==_0xd186('0x7'))_0x114004[_0x1b5aae](util[_0xd186('0x1d')]('telephone:%s',_0x414029[_0x3cb411][_0x3b1b9b][_0xd186('0x4')]));break;case 0x8:if(_0x5a5ff0[_0xd186('0x6')]!=='agent')_0x114004[_0x1b5aae](util[_0xd186('0x1d')]('trunk:%s',_0x414029[_0x3cb411][_0x3b1b9b][_0xd186('0x4')]));break;case 0x9:if(_0x5a5ff0['role']!==_0xd186('0x7'))_0x114004[_0x1b5aae](util[_0xd186('0x1d')](_0xd186('0x4b'),_0x414029[_0x3cb411][_0x3b1b9b][_0xd186('0x8')],_0x414029[_0x3cb411][_0x3b1b9b]['name']));break;case 0xa:_0x114004[_0x1b5aae](util[_0xd186('0x1d')](_0xd186('0x20'),_0x414029[_0x3cb411][_0x3b1b9b][_0xd186('0x4')]));break;}}}}})['then'](function(){if(_0x1b5aae==='leave'){var _0x2a8c50=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x25')],'id');return _0x5a5ff0[_0xd186('0x4c')](_0x2a8c50)['then'](function(){for(var _0x186e51=0x0;_0x186e51<_0x2a8c50[_0xd186('0x1f')];_0x186e51+=0x1){_0x223bc7[_0xd186('0x4d')](_0xd186('0x4e'),{'ChatInteractionId':Number(_0x2a8c50[_0x186e51]),'UserId':Number(_0x5a5ff0['id'])});}});}})['then'](function(){if(_0x1b5aae===_0xd186('0x4f')){var _0x227a4a=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x50')],'id');return _0x5a5ff0['removeMailInteractions'](_0x227a4a)[_0xd186('0xc')](function(){for(var _0x20489c=0x0;_0x20489c<_0x227a4a['length'];_0x20489c+=0x1){_0x223bc7[_0xd186('0x4d')](_0xd186('0x51'),{'MailInteractionId':Number(_0x227a4a[_0x20489c]),'UserId':Number(_0x5a5ff0['id'])});}});}})[_0xd186('0xc')](function(){if(_0x1b5aae===_0xd186('0x4f')){var _0x51a68f=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x27')],'id');return _0x5a5ff0[_0xd186('0x52')](_0x51a68f)[_0xd186('0xc')](function(){for(var _0x4917d5=0x0;_0x4917d5<_0x51a68f[_0xd186('0x1f')];_0x4917d5+=0x1){_0x223bc7[_0xd186('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x51a68f[_0x4917d5]),'UserId':Number(_0x5a5ff0['id'])});}});}})[_0xd186('0xc')](function(){if(_0x1b5aae===_0xd186('0x4f')){var _0x559d8d=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x29')],'id');return _0x5a5ff0['removeSmsInteractions'](_0x559d8d)[_0xd186('0xc')](function(){for(var _0x1fa433=0x0;_0x1fa433<_0x559d8d[_0xd186('0x1f')];_0x1fa433+=0x1){_0x223bc7[_0xd186('0x4d')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x559d8d[_0x1fa433]),'UserId':Number(_0x5a5ff0['id'])});}});}})[_0xd186('0xc')](function(){if(_0x1b5aae===_0xd186('0x4f')){var _0x3fa3ef=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x2b')],'id');return _0x5a5ff0[_0xd186('0x53')](_0x3fa3ef)[_0xd186('0xc')](function(){for(var _0x2b7d0e=0x0;_0x2b7d0e<_0x3fa3ef['length'];_0x2b7d0e+=0x1){_0x223bc7[_0xd186('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3fa3ef[_0x2b7d0e]),'UserId':Number(_0x5a5ff0['id'])});}});}})[_0xd186('0xc')](function(){if(_0x1b5aae===_0xd186('0x4f')){var _0x3b24b0=_[_0xd186('0x18')](_0x5a5ff0[_0xd186('0x2c')],'id');return _0x5a5ff0[_0xd186('0x54')](_0x3b24b0)[_0xd186('0xc')](function(){for(var _0x5ee77a=0x0;_0x5ee77a<_0x3b24b0[_0xd186('0x1f')];_0x5ee77a+=0x1){_0x223bc7['emit'](_0xd186('0x55'),{'WhatsappInteractionId':Number(_0x3b24b0[_0x5ee77a]),'UserId':Number(_0x5a5ff0['id'])});}});}})[_0xd186('0x56')](function(_0x172e51){_0x114004['log'](_0x172e51);});}}function onDisconnect(_0x48419,_0x1fc0a7){joinOrLeave(_0x48419,'leave',_0x1fc0a7);}function onConnect(_0xf77182){joinOrLeave(_0xf77182,_0xd186('0x57'));}exports[_0xd186('0x58')]=function(_0xb27c67){_0xb27c67['on'](_0xd186('0x59'),function(_0x45629c){_0x45629c[_0xd186('0x5a')](0x0);_0x45629c['address']=_0x45629c[_0xd186('0x5b')][_0xd186('0x59')][_0xd186('0x5c')]+':'+_0x45629c[_0xd186('0x5b')]['connection'][_0xd186('0x5d')];_0x45629c[_0xd186('0x5e')]=new Date();_0x45629c[_0xd186('0x5f')]=function(_0x43948b){console[_0xd186('0x5f')]('SocketIO\x20'+_0x45629c['nsp'][_0xd186('0x4')]+'['+_0x45629c[_0xd186('0x60')]+']',_0x43948b);};_0x45629c['on'](_0xd186('0x61'),function(){onDisconnect(_0x45629c,_0xb27c67);_0x45629c[_0xd186('0x5f')]('DISCONNECTED');});onConnect(_0x45629c);_0x45629c[_0xd186('0x5f')](_0xd186('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7e40beb..430e2dd 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 _0xce29=['SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','UserId','interface','format','SIP/%s','AfterCreateMessage','QueryTypes','name','agent','closed','changed','substatus','AfterUpdate','User','find','internal','default','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms'];(function(_0x523f50,_0x51aae3){var _0x2e33a1=function(_0xa2636d){while(--_0xa2636d){_0x523f50['push'](_0x523f50['shift']());}};_0x2e33a1(++_0x51aae3);}(_0xce29,0x1e8));var _0x9ce2=function(_0x4579b7,_0x5c6edc){_0x4579b7=_0x4579b7-0x0;var _0x311d82=_0xce29[_0x4579b7];return _0x311d82;};'use strict';var util=require(_0x9ce2('0x0'));var db=require(_0x9ce2('0x1'))['db'];var jayson=require(_0x9ce2('0x2'));var logger=require(_0x9ce2('0x3'))(_0x9ce2('0x4'));var client=jayson[_0x9ce2('0x5')][_0x9ce2('0x6')]({'port':0x232a});var triggers=[{'channel':_0x9ce2('0x7'),'model':_0x9ce2('0x8'),'event':'afterCreate','condition':_0x9ce2('0x9'),'callback':afterCreate},{'channel':_0x9ce2('0x7'),'model':_0x9ce2('0x8'),'event':_0x9ce2('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9ce2('0x7'),'model':_0x9ce2('0xb'),'event':_0x9ce2('0xc'),'condition':_0x9ce2('0xd'),'callback':afterCreateMessage},{'channel':_0x9ce2('0x7'),'model':_0x9ce2('0xe'),'event':_0x9ce2('0xc'),'condition':_0x9ce2('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x9ce2('0xf'),'model':'SmsInteraction','event':_0x9ce2('0xc'),'condition':_0x9ce2('0x9'),'callback':afterCreate},{'channel':_0x9ce2('0xf'),'model':_0x9ce2('0x10'),'event':'afterUpdate','condition':_0x9ce2('0x11'),'callback':afterUpdate},{'channel':_0x9ce2('0xf'),'model':_0x9ce2('0x12'),'event':_0x9ce2('0xc'),'condition':_0x9ce2('0xd'),'callback':afterCreateMessage},{'channel':_0x9ce2('0x13'),'model':'WhatsappInteraction','event':_0x9ce2('0xc'),'condition':_0x9ce2('0x9'),'callback':afterCreate},{'channel':_0x9ce2('0x13'),'model':_0x9ce2('0x14'),'event':'afterUpdate','condition':_0x9ce2('0x11'),'callback':afterUpdate},{'channel':_0x9ce2('0x13'),'model':'WhatsappMessage','event':_0x9ce2('0xc'),'condition':_0x9ce2('0xd'),'callback':afterCreateMessage},{'channel':_0x9ce2('0x15'),'model':_0x9ce2('0x16'),'event':_0x9ce2('0xc'),'condition':_0x9ce2('0x9'),'callback':afterCreate},{'channel':_0x9ce2('0x15'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x9ce2('0x11'),'callback':afterUpdate},{'channel':_0x9ce2('0x15'),'model':'FaxMessage','event':_0x9ce2('0xc'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9ce2('0x17'),'model':_0x9ce2('0x18'),'event':_0x9ce2('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9ce2('0x17'),'model':_0x9ce2('0x18'),'event':_0x9ce2('0xa'),'condition':_0x9ce2('0x11'),'callback':afterUpdate},{'channel':_0x9ce2('0x17'),'model':_0x9ce2('0x19'),'event':'afterCreate','condition':_0x9ce2('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x9ce2('0x1a'),'event':_0x9ce2('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9ce2('0x1b'),'model':'OpenchannelInteraction','event':_0x9ce2('0xa'),'condition':_0x9ce2('0x11'),'callback':afterUpdate},{'channel':_0x9ce2('0x1b'),'model':_0x9ce2('0x1c'),'event':_0x9ce2('0xc'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x1ea4b0){return client['request'](_0x9ce2('0x1d'),_0x1ea4b0)[_0x9ce2('0x1e')](function(_0x4e66cf){logger[_0x9ce2('0x1f')]('Trigger,\x20%s',_0x9ce2('0x1d'),_0x4e66cf);if(_0x4e66cf['error']){if(_0x4e66cf[_0x9ce2('0x20')][_0x9ce2('0x21')]===0x1f4){logger[_0x9ce2('0x20')](_0x9ce2('0x22'),'EventManager',_0x4e66cf[_0x9ce2('0x20')]);}}})[_0x9ce2('0x23')](function(_0x3eaf08){logger[_0x9ce2('0x20')](_0x9ce2('0x22'),_0x9ce2('0x1d'),_0x3eaf08);});}function afterCreateMessage(_0x23523a){return function(_0x7cf0ad){_0x7cf0ad=_0x7cf0ad[_0x9ce2('0x24')]({'plain':!![]});_0x7cf0ad[_0x9ce2('0x25')]=_0x23523a;_0x7cf0ad[_0x9ce2('0x26')]=_0x23523a;_0x7cf0ad[_0x9ce2('0x27')]=_0x7cf0ad[_0x9ce2('0x28')];Promise[_0x9ce2('0x29')]()[_0x9ce2('0x1e')](function(){if(typeof _0x7cf0ad[_0x9ce2('0x2a')]===_0x9ce2('0x2b'))return null;var _0x54d4e4=_0x9ce2('0x2c')+_0x7cf0ad[_0x9ce2('0x2a')];return db[_0x9ce2('0x2d')][_0x9ce2('0x2e')](_0x54d4e4,{'type':db[_0x9ce2('0x2f')]['QueryTypes'][_0x9ce2('0x30')],'raw':!![]});})[_0x9ce2('0x1e')](function(_0x102077){if(_0x102077){_0x7cf0ad[_0x9ce2('0x31')]=_0x102077[0x0];}if(typeof _0x7cf0ad[_0x9ce2('0x32')]===_0x9ce2('0x2b'))return;return getAgent(_0x7cf0ad[_0x9ce2('0x32')]);})[_0x9ce2('0x1e')](function(_0x1d8216){if(_0x1d8216){_0x7cf0ad[_0x9ce2('0x33')]=util[_0x9ce2('0x34')](_0x9ce2('0x35'),_0x1d8216['name']);_0x7cf0ad['agent']=_0x1d8216;_0x7cf0ad[_0x9ce2('0x25')]=_0x23523a;return request({'event':'incomingmessage','message':_0x7cf0ad});}else{return request({'event':'outgoingmessage','message':_0x7cf0ad});}})['catch'](function(_0xa30815){logger[_0x9ce2('0x20')](_0x9ce2('0x22'),_0x9ce2('0x36'),_0xa30815);});};}function afterCreateOfflineMessage(_0x2b234f){return function(_0x413fae){_0x413fae=_0x413fae[_0x9ce2('0x24')]({'plain':!![]});_0x413fae[_0x9ce2('0x25')]=_0x2b234f;_0x413fae[_0x9ce2('0x26')]=_0x2b234f;_0x413fae[_0x9ce2('0x27')]='offlineMessage';return request({'event':_0x413fae[_0x9ce2('0x27')],'message':_0x413fae});};}function afterCreate(_0x5e1b62,_0x1b95ca){return function(_0x20b3e8){_0x20b3e8=_0x20b3e8[_0x9ce2('0x24')]({'plain':!![]});_0x20b3e8[_0x9ce2('0x25')]=_0x5e1b62;_0x20b3e8[_0x9ce2('0x26')]=_0x5e1b62;_0x20b3e8[_0x9ce2('0x27')]='opened';Promise[_0x9ce2('0x29')]()[_0x9ce2('0x1e')](function(){var _0x597054=_0x9ce2('0x2c')+_0x20b3e8[_0x9ce2('0x2a')];return db['sequelize'][_0x9ce2('0x2e')](_0x597054,{'type':db[_0x9ce2('0x2f')][_0x9ce2('0x37')]['SELECT'],'raw':!![]});})['then'](function(_0x5eb303){if(_0x5eb303){_0x20b3e8[_0x9ce2('0x31')]=_0x5eb303[0x0];}if(typeof _0x20b3e8['UserId']==='undefined')return;return getAgent(_0x20b3e8[_0x9ce2('0x32')]);})[_0x9ce2('0x1e')](function(_0x3cdde7){if(_0x3cdde7){_0x20b3e8[_0x9ce2('0x33')]=util[_0x9ce2('0x34')]('SIP/%s',_0x3cdde7[_0x9ce2('0x38')]);_0x20b3e8[_0x9ce2('0x39')]=_0x3cdde7;}return request({'event':_0x1b95ca,'message':_0x20b3e8});})[_0x9ce2('0x23')](function(_0x59afe7){logger[_0x9ce2('0x20')](_0x9ce2('0x22'),'AfterCreate',_0x59afe7);});};}function afterUpdate(_0x10ac02){return function(_0x35b0fb){var _0x90680b=_0x35b0fb['changed'](_0x9ce2('0x3a'))&&_0x35b0fb[_0x9ce2('0x3a')];var _0x13ecda=_0x35b0fb[_0x9ce2('0x3b')](_0x9ce2('0x3c'));if(_0x90680b||_0x13ecda){var _0x301b80=_0x90680b?'closedinteraction':_0x9ce2('0x3c');var _0x5595e2=_0x35b0fb[_0x9ce2('0x24')]({'plain':!![]});_0x5595e2[_0x9ce2('0x25')]=_0x10ac02;_0x5595e2['motionChannel']=_0x10ac02;_0x5595e2['event']=_0x90680b?_0x9ce2('0x3a'):'substatus';var _0x37d5c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5595e2[_0x9ce2('0x2a')];return db[_0x9ce2('0x2d')][_0x9ce2('0x2e')](_0x37d5c7,{'type':db[_0x9ce2('0x2f')][_0x9ce2('0x37')][_0x9ce2('0x30')],'raw':!![]})[_0x9ce2('0x1e')](function(_0x13063a){if(_0x13063a){_0x5595e2['contact']=_0x13063a[0x0];}if(typeof _0x5595e2[_0x9ce2('0x32')]==='undefined')return;return getAgent(_0x5595e2[_0x9ce2('0x32')]);})[_0x9ce2('0x1e')](function(_0x1855cd){if(_0x1855cd){_0x5595e2[_0x9ce2('0x33')]=util[_0x9ce2('0x34')](_0x9ce2('0x35'),_0x1855cd[_0x9ce2('0x38')]);_0x5595e2[_0x9ce2('0x39')]=_0x1855cd;}return request({'event':_0x301b80,'message':_0x5595e2});})['catch'](function(_0x18a779){logger[_0x9ce2('0x20')]('Trigger,\x20%s',_0x9ce2('0x3d'),_0x18a779);});}};}function getAgent(_0x7ea1b6){return db[_0x9ce2('0x3e')][_0x9ce2('0x3f')]({'where':{'id':_0x7ea1b6},'attributes':['id',_0x9ce2('0x38'),'fullname','email',_0x9ce2('0x40')],'raw':!![]})['then'](function(_0x418799){return _0x418799;});}exports[_0x9ce2('0x41')]=function(){for(var _0x43c18a=0x0;_0x43c18a=_0x255cc5[_0x3723('0x14')]){throw Error(_0x3723('0x15'));}_0x43568d(_0x4f0062);})[_0x3723('0x16')](function(_0x4077ee){_0x128e11(_0x4077ee);});});}; \ No newline at end of file +var _0x5935=['voice','mail','chat','fax','sms','whatsapp','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util'];(function(_0x3a6446,_0x1c4ac1){var _0x12b443=function(_0x4f14cf){while(--_0x4f14cf){_0x3a6446['push'](_0x3a6446['shift']());}};_0x12b443(++_0x1c4ac1);}(_0x5935,0x6b));var _0x5593=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x5935[_0x3ba924];return _0x4cc1df;};'use strict';var _=require(_0x5593('0x0'));var BPromise=require(_0x5593('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x5593('0x2'));var channels=[_0x5593('0x3'),_0x5593('0x4'),_0x5593('0x5'),_0x5593('0x6'),_0x5593('0x7'),_0x5593('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x5593('0x9')]=function(_0x4bb0a9){_0x4bb0a9=_0x4bb0a9[_0x5593('0xa')]();return _[_0x5593('0xb')](channels,_0x4bb0a9);};exports[_0x5593('0xc')]=function(_0x2b024e,_0x4f9ff5,_0xbfe050,_0x128265){var _0x1f5ab7={'loginAttempts':_0x4f9ff5,'blocked':_0xbfe050};if(!_[_0x5593('0xd')](_0x128265)){_0x1f5ab7[_0x5593('0xe')]=_0x128265;}return _0x2b024e[_0x5593('0xf')](_0x1f5ab7);};exports[_0x5593('0x10')]=function(_0x5b2b37){return new BPromise(function(_0xf733c6,_0x56b9d7){var _0x5f238d=0x0;if(_0x5b2b37[_0x5593('0x11')]!==_0x5593('0x12')){_0xf733c6(_0x5b2b37);}db[_0x5593('0x13')]['count']({'where':{'role':_0x5593('0x12'),'online':!![],'id':{'$ne':_0x5b2b37['id']}}})['then'](function(_0x2586de){_0x5f238d=_0x2586de;return util[_0x5593('0x10')]();})['then'](function(_0x4d1a42){if(_0x4d1a42&&_0x4d1a42[_0x5593('0x14')]&&_0x5f238d>=_0x4d1a42[_0x5593('0x14')]){throw Error(_0x5593('0x15'));}_0xf733c6(_0x5b2b37);})['catch'](function(_0x384982){_0x56b9d7(_0x384982);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 4e01d1c..50ac964 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa383=['json','exports','404','status','render'];(function(_0x5139a4,_0x508f5a){var _0x4d05d5=function(_0x1ec135){while(--_0x1ec135){_0x5139a4['push'](_0x5139a4['shift']());}};_0x4d05d5(++_0x508f5a);}(_0xa383,0xa1));var _0x3a38=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xa383[_0x37a79c];return _0x561d89;};'use strict';module[_0x3a38('0x0')][0x194]=function pageNotFound(_0xa8dc10,_0x1ff923){var _0x58ffc9=_0x3a38('0x1');var _0x4e270c=0x194;var _0x5bf4d0={'status':_0x4e270c};_0x1ff923[_0x3a38('0x2')](_0x5bf4d0[_0x3a38('0x2')]);_0x1ff923[_0x3a38('0x3')](_0x58ffc9,{},function(_0x1e6491,_0x5f522f){if(_0x1e6491){return _0x1ff923[_0x3a38('0x2')](_0x5bf4d0['status'])[_0x3a38('0x4')](_0x5bf4d0);}_0x1ff923['send'](_0x5f522f);});}; \ No newline at end of file +var _0xfd6f=['status','render','json','exports','404'];(function(_0x3b2377,_0x1be5c4){var _0x4defd8=function(_0x1d21f0){while(--_0x1d21f0){_0x3b2377['push'](_0x3b2377['shift']());}};_0x4defd8(++_0x1be5c4);}(_0xfd6f,0x19d));var _0xffd6=function(_0x196a74,_0x5aaa3a){_0x196a74=_0x196a74-0x0;var _0xcf919b=_0xfd6f[_0x196a74];return _0xcf919b;};'use strict';module[_0xffd6('0x0')][0x194]=function pageNotFound(_0x2b6ffc,_0x29b163){var _0x45ddb9=_0xffd6('0x1');var _0x595470=0x194;var _0xb84411={'status':_0x595470};_0x29b163[_0xffd6('0x2')](_0xb84411[_0xffd6('0x2')]);_0x29b163[_0xffd6('0x3')](_0x45ddb9,{},function(_0x54e670,_0x39e11e){if(_0x54e670){return _0x29b163[_0xffd6('0x2')](_0xb84411[_0xffd6('0x2')])[_0xffd6('0x4')](_0xb84411);}_0x29b163['send'](_0x39e11e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 293ff10..8dcec5f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd037=['Automation','../api/automation/automation.model','CannedAnswer','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/team/team.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','userSetting','cascade','Recordings','hasMany','VoiceQueuesRt','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueue','MailQueues','ChatQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','CmContact','Contact','ContactId','MailAccountId','CloudProviderId','MailServerOut','Imap','Smtp','Disposition','Dispositions','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Answers','FaxInteractionId','Attachment','AttachmentId','FaxQueueReport','SmsAccountId','SmsApplication','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','cm_contact_has_tags','Campaign','OwnerId','CampaignId','OneAll','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','fax_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','Configurations','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_fax_queues','FaxQueues','team_has_whatsapp_queues','SquareProjectId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','FromChatWebsiteId','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','jstz','defaultsDeep','xcall','xC@LL1234','mysql','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model'];(function(_0x1c1722,_0x210375){var _0x1997f7=function(_0x5947db){while(--_0x5947db){_0x1c1722['push'](_0x1c1722['shift']());}};_0x1997f7(++_0x210375);}(_0xd037,0x17b));var _0x7d03=function(_0x263269,_0x4dfabe){_0x263269=_0x263269-0x0;var _0x2785f6=_0xd037[_0x263269];return _0x2785f6;};'use strict';var config=require(_0x7d03('0x0'));var Sequelize=require(_0x7d03('0x1'));var _=require('lodash');var jstz=require(_0x7d03('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0x7d03('0x3')](config['sequelize'],{'database':'motion2','username':_0x7d03('0x4'),'password':_0x7d03('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x7d03('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7d03('0x7')](),'define':{'charset':_0x7d03('0x8'),'collate':_0x7d03('0x9')}}});config[_0x7d03('0xa')]=_[_0x7d03('0x3')](config[_0x7d03('0xa')],{'database':'motion2','username':_0x7d03('0x4'),'password':_0x7d03('0x5'),'options':{'host':_0x7d03('0xb'),'port':0xcea,'dialect':_0x7d03('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7d03('0x7')](),'define':{'charset':'utf8','collate':_0x7d03('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x7d03('0xc')],config['sequelize'][_0x7d03('0xd')],config[_0x7d03('0x1')][_0x7d03('0xe')],config['sequelize'][_0x7d03('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7d03('0xa')]['database'],config[_0x7d03('0xa')][_0x7d03('0xd')],config[_0x7d03('0xa')][_0x7d03('0xe')],config[_0x7d03('0xa')][_0x7d03('0xf')])};db[_0x7d03('0x10')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x12'));db[_0x7d03('0x13')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x14'));db[_0x7d03('0x15')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x16'));db[_0x7d03('0x17')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/voiceExtension/voiceExtension.model');db[_0x7d03('0x18')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x19'));db[_0x7d03('0x1a')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x1b'));db[_0x7d03('0x1c')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x1d'));db[_0x7d03('0x1e')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x1f'));db['VoiceMail']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x20'));db['VoiceMailMessage']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x21'));db[_0x7d03('0x22')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x23'));db[_0x7d03('0x24')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x25'));db[_0x7d03('0x26')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x27'));db[_0x7d03('0x28')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/memberReport/memberReport.model');db[_0x7d03('0x29')]=db[_0x7d03('0x1')]['import']('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x2a'));db[_0x7d03('0x2b')]=db['sequelize']['import'](_0x7d03('0x2c'));db[_0x7d03('0x2d')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x2e'));db[_0x7d03('0x2f')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x30'));db[_0x7d03('0x31')]=db['sequelize'][_0x7d03('0x11')]('../api/userMailQueue/userMailQueue.model');db[_0x7d03('0x32')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x33'));db['UserSmsQueue']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0x7d03('0x34')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x35'));db['UserWhatsappQueue']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x7d03('0x36')]=db[_0x7d03('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x37'));db[_0x7d03('0x38')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x39'));db['MailQueue']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x3a'));db[_0x7d03('0x3b')]=db['sequelize'][_0x7d03('0x11')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7d03('0x3c')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x3d'));db[_0x7d03('0x3e')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/mailMessage/mailMessage.model');db[_0x7d03('0x3f')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x40'));db[_0x7d03('0x41')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x42'));db[_0x7d03('0x43')]=db['sequelize'][_0x7d03('0x11')]('../api/dashboard/dashboard.model');db[_0x7d03('0x44')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/dashboardItem/dashboardItem.model');db[_0x7d03('0x45')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x46'));db[_0x7d03('0x47')]=db['sequelize'][_0x7d03('0x11')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x48'));db[_0x7d03('0x49')]=db['sequelize']['import'](_0x7d03('0x4a'));db[_0x7d03('0x4b')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x4c'));db['FaxQueueReport']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x4d'));db[_0x7d03('0x4e')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x4f'));db['SmsApplication']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x50'));db['SmsInteraction']=db[_0x7d03('0x1')]['import'](_0x7d03('0x51'));db[_0x7d03('0x52')]=db['sequelize'][_0x7d03('0x11')]('../api/smsMessage/smsMessage.model');db[_0x7d03('0x53')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x54'));db[_0x7d03('0x55')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x56'));db[_0x7d03('0x57')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x58'));db[_0x7d03('0x59')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x5a'));db[_0x7d03('0x5b')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x5c'));db[_0x7d03('0x5d')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x5e'));db[_0x7d03('0x5f')]=db[_0x7d03('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db[_0x7d03('0x60')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x7d03('0x61')]=db[_0x7d03('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0x7d03('0x62')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x63'));db[_0x7d03('0x64')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x65'));db['ChatOfflineMessage']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x66'));db[_0x7d03('0x67')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x68'));db[_0x7d03('0x69')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/chatGroup/chatGroup.model');db[_0x7d03('0x6a')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x6b'));db[_0x7d03('0x6c')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x6d'));db['CmContact']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/cmHopper/cmHopper.model');db[_0x7d03('0x6e')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x6f'));db[_0x7d03('0x70')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x71'));db[_0x7d03('0x72')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x73'));db['ReportAgentPreview']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x74'));db['CmCustomField']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x75'));db[_0x7d03('0x76')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x77'));db[_0x7d03('0x78')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x79'));db[_0x7d03('0x7a')]=db[_0x7d03('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/disposition/disposition.model');db[_0x7d03('0x7b')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x7c'));db[_0x7d03('0x7d')]=db['sequelize'][_0x7d03('0x11')]('../api/interval/interval.model');db[_0x7d03('0x7e')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x7f'));db[_0x7d03('0x80')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x81'));db[_0x7d03('0x82')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x83'));db['Sound']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x84'));db[_0x7d03('0x85')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x86'));db['Template']=db[_0x7d03('0x1')]['import'](_0x7d03('0x87'));db[_0x7d03('0x88')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x89'));db['Variable']=db[_0x7d03('0x1')]['import']('../api/variable/variable.model');db['Integration']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/integration/integration.model');db[_0x7d03('0x8a')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/integrationReport/integrationReport.model');db[_0x7d03('0x8b')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x8c'));db[_0x7d03('0x8d')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x8e'));db['AnalyticExtractedReport']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x8f'));db[_0x7d03('0x90')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/analyticMetric/analyticMetric.model');db[_0x7d03('0x91')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x92'));db[_0x7d03('0x93')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x7d03('0x94')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x95'));db[_0x7d03('0x96')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x97'));db['SalesforceField']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/intSalesforceField/intSalesforceField.model');db[_0x7d03('0x98')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7d03('0x99')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x9a'));db[_0x7d03('0x9b')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x7d03('0x9c')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0x9d'));db['DeskConfiguration']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0x9e'));db['DeskField']=db['sequelize']['import'](_0x7d03('0x9f'));db[_0x7d03('0xa0')]=db['sequelize']['import'](_0x7d03('0xa1'));db[_0x7d03('0xa2')]=db[_0x7d03('0x1')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x7d03('0xa3')]=db[_0x7d03('0x1')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xa4'));db['ZendeskConfiguration']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xa5'));db[_0x7d03('0xa6')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xa7'));db[_0x7d03('0xa8')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xa9'));db[_0x7d03('0xaa')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x7d03('0xab')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xac'));db['VtigerAccount']=db['sequelize']['import'](_0x7d03('0xad'));db[_0x7d03('0xae')]=db[_0x7d03('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7d03('0xaf')]=db['sequelize']['import'](_0x7d03('0xb0'));db[_0x7d03('0xb1')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xb2'));db['ServicenowConfiguration']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xb3'));db[_0x7d03('0xb4')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xb5'));db[_0x7d03('0xb6')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xb7'));db[_0x7d03('0xb8')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xb9'));db['Dynamics365Field']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xba'));db['FreshsalesAccount']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xbb'));db[_0x7d03('0xbc')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xbd'));db[_0x7d03('0xbe')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xbf'));db[_0x7d03('0xc0')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xc1'));db[_0x7d03('0xc2')]=db['sequelize'][_0x7d03('0x11')]('../api/network/network.model');db[_0x7d03('0xc3')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xc4'));db['ChatInternalMessage']=db['sequelize'][_0x7d03('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x7d03('0xc5')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db['sequelize']['import'](_0x7d03('0xc6'));db['JscriptySessionReport']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xc7'));db[_0x7d03('0xc8')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xc9'));db[_0x7d03('0xca')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xcb'));db[_0x7d03('0xcc')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xcd'));db[_0x7d03('0xce')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/jscriptyProject/jscriptyProject.model');db[_0x7d03('0xcf')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xd0'));db[_0x7d03('0xd1')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xd2'));db[_0x7d03('0xd3')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xd4'));db['SquareRecording']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/squareRecording/squareRecording.model');db[_0x7d03('0xd5')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xd6'));db['License']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/license/license.model');db['Campaign']=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xd7'));db[_0x7d03('0xd8')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xd9'));db['Attachment']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xda'));db['Plugin']=db[_0x7d03('0x1')]['import'](_0x7d03('0xdb'));db[_0x7d03('0xdc')]=db['sequelize'][_0x7d03('0x11')]('../api/mailTransferReport/mailTransferReport.model');db[_0x7d03('0xdd')]=db['sequelize']['import'](_0x7d03('0xde'));db[_0x7d03('0xdf')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0x7d03('0xe0')]=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x7d03('0xe1')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xe2'));db['CmList']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x7d03('0x1')][_0x7d03('0x11')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xe3'));db[_0x7d03('0xe4')]=db['sequelize']['import'](_0x7d03('0xe5'));db[_0x7d03('0xe6')]=db['sequelize']['import'](_0x7d03('0xe7'));db['UserNotification']=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xe8'));db[_0x7d03('0xe9')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xea'));db[_0x7d03('0xeb')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xec'));db[_0x7d03('0xed')]=db['sequelize'][_0x7d03('0x11')](_0x7d03('0xee'));db[_0x7d03('0xef')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xf0'));db[_0x7d03('0xf1')]=db[_0x7d03('0x1')]['import'](_0x7d03('0xf2'));db[_0x7d03('0xf3')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xf4'));db[_0x7d03('0xf5')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xf6'));db[_0x7d03('0xf7')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xf8'));db[_0x7d03('0xf9')]=db['sequelize']['import'](_0x7d03('0xfa'));db[_0x7d03('0xfb')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xfc'));db[_0x7d03('0xfd')]=db[_0x7d03('0x1')][_0x7d03('0x11')](_0x7d03('0xfe'));db[_0x7d03('0xff')]=db[_0x7d03('0x1')]['import'](_0x7d03('0x100'));db['User'][_0x7d03('0x101')](db[_0x7d03('0x102')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x101')](db[_0x7d03('0xff')],{'as':_0x7d03('0x104'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')]['hasMany'](db[_0x7d03('0x1c')],{'as':_0x7d03('0x106'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x2b')],{'as':_0x7d03('0x108'),'foreignKey':'UserId'});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x17')],{'as':'Extensions','onDelete':_0x7d03('0x105'),'hooks':!![]});db['User'][_0x7d03('0x107')](db[_0x7d03('0x70')],{'as':_0x7d03('0x109'),'foreignKey':'UserId'});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x72')],{'as':_0x7d03('0x10a'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x10b')],{'as':_0x7d03('0x10b'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')]['hasMany'](db[_0x7d03('0x59')],{'as':_0x7d03('0x10c'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x62')],{'as':_0x7d03('0x10d'),'foreignKey':'UserId'});db[_0x7d03('0x10')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x7d03('0x103')});db['User'][_0x7d03('0x107')](db[_0x7d03('0x10e')],{'as':_0x7d03('0x10f'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0x3c')],{'as':_0x7d03('0x110'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db[_0x7d03('0xed')],{'as':'WhatsappInteractions','foreignKey':_0x7d03('0x103')});db[_0x7d03('0x10')][_0x7d03('0x107')](db['UserNotification'],{'as':_0x7d03('0x111'),'foreignKey':'SenderId'});db[_0x7d03('0x10')][_0x7d03('0x112')](db['UserProfile'],{'as':_0x7d03('0x113'),'foreignKey':_0x7d03('0x114')});db['User'][_0x7d03('0x115')](db[_0x7d03('0x69')],{'as':_0x7d03('0x116'),'through':_0x7d03('0x117')});db[_0x7d03('0x10')][_0x7d03('0x115')](db['CmContact'],{'as':_0x7d03('0x118'),'through':_0x7d03('0x119')});db['User'][_0x7d03('0x115')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x11b'),'through':_0x7d03('0x11c')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'through':_0x7d03('0x11e')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x3c')],{'as':_0x7d03('0x110'),'through':_0x7d03('0x11f')});db[_0x7d03('0x10')][_0x7d03('0x115')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x7d03('0x120')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x10e')],{'as':_0x7d03('0x10f'),'through':_0x7d03('0x121')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x122')],{'as':_0x7d03('0x123'),'through':_0x7d03('0x124')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x59')],{'as':_0x7d03('0x10c'),'through':_0x7d03('0x125')});db[_0x7d03('0x10')][_0x7d03('0x115')](db['WhatsappInteraction'],{'as':_0x7d03('0x126'),'through':_0x7d03('0x127')});db['User'][_0x7d03('0x115')](db[_0x7d03('0x1a')],{'as':_0x7d03('0x128'),'through':_0x7d03('0x2d'),'required':![]});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x129')],{'as':_0x7d03('0x12a'),'through':'UserVoicePrefix','required':![]});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x12b')],{'as':_0x7d03('0x12c'),'through':'UserMailQueue','required':![]});db['User'][_0x7d03('0x115')](db[_0x7d03('0x67')],{'as':_0x7d03('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x4b')],{'as':'FaxQueues','through':_0x7d03('0x32'),'required':![]});db['User'][_0x7d03('0x115')](db['SmsQueue'],{'as':_0x7d03('0x12e'),'through':_0x7d03('0x12f'),'required':![]});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x5d')],{'as':_0x7d03('0x130'),'through':_0x7d03('0x34'),'required':![]});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0xf5')],{'as':_0x7d03('0x131'),'through':_0x7d03('0x132'),'required':![]});db['User'][_0x7d03('0x115')](db[_0x7d03('0x11a')],{'through':_0x7d03('0x11c')});db[_0x7d03('0x10')]['belongsToMany'](db[_0x7d03('0x5f')],{'as':_0x7d03('0x133'),'through':_0x7d03('0x134')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x45')],{'as':_0x7d03('0x135'),'through':_0x7d03('0x136')});db[_0x7d03('0x10')][_0x7d03('0x115')](db['MailAccount'],{'as':_0x7d03('0x137'),'through':_0x7d03('0x138')});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0x55')],{'as':'OpenchannelAccounts','through':_0x7d03('0x139')});db[_0x7d03('0x10')]['belongsToMany'](db['SmsAccount'],{'as':_0x7d03('0x13a'),'through':'user_has_sms_accounts'});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0xe9')],{'as':_0x7d03('0x13b'),'through':'user_has_whatsapp_accounts'});db[_0x7d03('0x10')][_0x7d03('0x115')](db[_0x7d03('0xd3')],{'as':_0x7d03('0x13c'),'through':_0x7d03('0x13d')});db['VoiceChanSpy']['hasMany'](db[_0x7d03('0x17')],{'as':_0x7d03('0x13e'),'onDelete':_0x7d03('0x105'),'foreignKey':'ChanSpyId'});db[_0x7d03('0x15')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x7d03('0x105')});db['VoiceExtension'][_0x7d03('0x107')](db[_0x7d03('0x17')],{'as':_0x7d03('0x13f'),'onDelete':_0x7d03('0x105')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x7d03('0x140'),'through':_0x7d03('0x141')});db[_0x7d03('0x1a')][_0x7d03('0x107')](db[_0x7d03('0x2b')],{'as':_0x7d03('0x142'),'foreignKey':_0x7d03('0x143')});db['VoiceQueue']['hasMany'](db[_0x7d03('0x144')],{'as':_0x7d03('0x145'),'foreignKey':_0x7d03('0x143')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x7d03('0x72')],{'as':_0x7d03('0x146'),'foreignKey':_0x7d03('0x143')});db['VoiceQueue'][_0x7d03('0x107')](db[_0x7d03('0x10b')],{'as':_0x7d03('0x10b'),'foreignKey':_0x7d03('0x143')});db[_0x7d03('0x1a')][_0x7d03('0x107')](db['CmHopperBlack'],{'as':_0x7d03('0x147'),'foreignKey':_0x7d03('0x143')});db[_0x7d03('0x1a')][_0x7d03('0x107')](db[_0x7d03('0x148')],{'as':_0x7d03('0x149'),'foreignKey':_0x7d03('0x143')});db[_0x7d03('0x1a')][_0x7d03('0x112')](db[_0x7d03('0x29')],{'as':_0x7d03('0x29'),'foreignKey':_0x7d03('0x14a')});db[_0x7d03('0x1a')][_0x7d03('0x112')](db[_0x7d03('0x29')],{'as':_0x7d03('0x14b'),'foreignKey':_0x7d03('0x14c')});db[_0x7d03('0x1a')]['belongsTo'](db[_0x7d03('0x7d')],{'as':_0x7d03('0x7d'),'foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x1a')][_0x7d03('0x112')](db['Pause'],{'as':_0x7d03('0x14e'),'foreignKey':_0x7d03('0x14f')});db[_0x7d03('0x1a')]['belongsToMany'](db[_0x7d03('0x11a')],{'as':_0x7d03('0x11b'),'through':_0x7d03('0x150')});db[_0x7d03('0x1a')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x2d')});db['VoiceQueue'][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'as':_0x7d03('0x152'),'through':_0x7d03('0xf9')});db[_0x7d03('0x1a')][_0x7d03('0x115')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x153'),'through':_0x7d03('0x154')});db[_0x7d03('0x1c')]['belongsTo'](db[_0x7d03('0x10')],{'as':'User','foreignKey':_0x7d03('0x103')});db[_0x7d03('0x1e')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x10'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x102')][_0x7d03('0x107')](db[_0x7d03('0x155')],{'as':_0x7d03('0x156'),'onDelete':_0x7d03('0x105'),'foreignKey':'mailboxuser','sourceKey':_0x7d03('0x157')});db[_0x7d03('0x155')][_0x7d03('0x112')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x7d03('0x157')});db[_0x7d03('0x158')][_0x7d03('0x107')](db[_0x7d03('0x26')],{'as':_0x7d03('0x159'),'foreignKey':_0x7d03('0x15a'),'constraints':![]});db[_0x7d03('0x158')]['hasMany'](db[_0x7d03('0x24')],{'as':_0x7d03('0x15b'),'foreignKey':_0x7d03('0x15a'),'constraints':![]});db[_0x7d03('0x158')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x10'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x158')]['belongsTo'](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x36')][_0x7d03('0x112')](db[_0x7d03('0x38')],{'as':'MailAccount','foreignKey':_0x7d03('0x15f')});db[_0x7d03('0x36')][_0x7d03('0x112')](db[_0x7d03('0xf7')],{'as':_0x7d03('0xf7'),'foreignKey':_0x7d03('0x160'),'onDelete':'restrict'});db[_0x7d03('0x161')]['belongsTo'](db[_0x7d03('0x38')],{'as':_0x7d03('0x38'),'foreignKey':_0x7d03('0x15f')});db[_0x7d03('0x161')][_0x7d03('0x112')](db[_0x7d03('0xf7')],{'as':_0x7d03('0xf7'),'foreignKey':_0x7d03('0x160'),'onDelete':'restrict'});db[_0x7d03('0x38')][_0x7d03('0x101')](db['MailServerIn'],{'as':_0x7d03('0x162'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x38')]['hasOne'](db['MailServerOut'],{'as':_0x7d03('0x163'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x38')][_0x7d03('0x107')](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x15f'),'onDelete':'cascade'});db[_0x7d03('0x38')][_0x7d03('0x107')](db[_0x7d03('0x7a')],{'as':'Answers','foreignKey':_0x7d03('0x15f')});db[_0x7d03('0x38')]['hasMany'](db[_0x7d03('0x3e')],{'as':_0x7d03('0x156'),'foreignKey':'MailAccountId'});db[_0x7d03('0x38')][_0x7d03('0x107')](db[_0x7d03('0x3c')],{'as':_0x7d03('0x166')});db[_0x7d03('0x38')][_0x7d03('0x107')](db[_0x7d03('0x3f')],{'as':_0x7d03('0x13f')});db[_0x7d03('0x38')]['belongsTo'](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x38')][_0x7d03('0x112')](db[_0x7d03('0x169')],{'as':_0x7d03('0x169'),'foreignKey':_0x7d03('0x16a')});db[_0x7d03('0x38')][_0x7d03('0x112')](db[_0x7d03('0x7e')],{'as':_0x7d03('0x14e'),'foreignKey':_0x7d03('0x14f')});db[_0x7d03('0x38')][_0x7d03('0x115')](db['User'],{'as':'Agents','through':_0x7d03('0x138')});db[_0x7d03('0x12b')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':'UserMailQueue'});db[_0x7d03('0x12b')][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'through':_0x7d03('0x16b'),'as':_0x7d03('0x152')});db[_0x7d03('0x3c')][_0x7d03('0x107')](db[_0x7d03('0x3e')],{'as':'Messages','onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x16c')});db[_0x7d03('0x3c')]['belongsTo'](db['MailAccount'],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x15f')});db[_0x7d03('0x3c')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':'Contact','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x3c')][_0x7d03('0x112')](db['User'],{'as':_0x7d03('0x16e'),'foreignKey':_0x7d03('0x103')});db['MailInteraction']['belongsToMany'](db[_0x7d03('0x85')],{'through':'mail_interaction_has_tags','as':_0x7d03('0x16f')});db[_0x7d03('0x3c')][_0x7d03('0x115')](db['Tag'],{'through':_0x7d03('0x170'),'as':_0x7d03('0x171')});db[_0x7d03('0x3c')]['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':_0x7d03('0x11f'),'foreignKey':_0x7d03('0x16c')});db['MailMessage'][_0x7d03('0x107')](db['Attachment'],{'as':_0x7d03('0x173'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x3e')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x10')});db[_0x7d03('0x3e')]['belongsTo'](db['CmContact'],{'onDelete':_0x7d03('0x105'),'as':'Contact'});db['MailMessage'][_0x7d03('0x112')](db[_0x7d03('0x3c')],{'as':_0x7d03('0x174'),'foreignKey':_0x7d03('0x16c')});db[_0x7d03('0x3e')][_0x7d03('0x112')](db[_0x7d03('0x38')],{'as':_0x7d03('0x16d'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x7d03('0x112')](db['ChatWebsite'],{'as':_0x7d03('0x5f'),'foreignKey':'ChatWebsiteId'});db['MailMessage']['belongsTo'](db[_0x7d03('0x175')],{'as':_0x7d03('0x175'),'foreignKey':_0x7d03('0x176')});db[_0x7d03('0x3f')]['belongsTo'](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0x3f')]['belongsTo'](db['MailQueue'],{'onDelete':_0x7d03('0x177')});db['MailApplication'][_0x7d03('0x112')](db[_0x7d03('0x38')],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0x3f')][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x14d')});db['MailApplication'][_0x7d03('0x112')](db[_0x7d03('0x85')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x178')});db[_0x7d03('0x41')]['belongsTo'](db[_0x7d03('0x38')],{});db[_0x7d03('0x41')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x41')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':'ContactId'});db[_0x7d03('0x41')][_0x7d03('0x112')](db[_0x7d03('0x3c')],{});db[_0x7d03('0x41')][_0x7d03('0x112')](db[_0x7d03('0x3e')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0x7d03('0x41')]['belongsTo'](db['MailQueue'],{});db[_0x7d03('0x43')]['hasMany'](db[_0x7d03('0x44')],{'as':_0x7d03('0x179'),'onDelete':_0x7d03('0x105')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7d03('0x17a'),'onDelete':'cascade'});db[_0x7d03('0x45')][_0x7d03('0x107')](db[_0x7d03('0x7a')],{'as':_0x7d03('0x17b'),'foreignKey':_0x7d03('0x17a')});db[_0x7d03('0x45')][_0x7d03('0x107')](db[_0x7d03('0x10e')],{'as':_0x7d03('0x166')});db[_0x7d03('0x45')][_0x7d03('0x107')](db[_0x7d03('0x47')],{'as':'Applications'});db['FaxAccount'][_0x7d03('0x107')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x7d03('0x105')});db[_0x7d03('0x45')][_0x7d03('0x107')](db[_0x7d03('0x49')],{'as':_0x7d03('0x156')});db[_0x7d03('0x45')][_0x7d03('0x112')](db['Trunk'],{'as':_0x7d03('0x29')});db[_0x7d03('0x45')][_0x7d03('0x112')](db['CmList'],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x45')][_0x7d03('0x112')](db[_0x7d03('0x7e')],{'as':_0x7d03('0x14e'),'foreignKey':_0x7d03('0x14f')});db[_0x7d03('0x45')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x136')});db[_0x7d03('0x47')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':'restrict'});db[_0x7d03('0x47')]['belongsTo'](db[_0x7d03('0x4b')],{'onDelete':'restrict'});db[_0x7d03('0x47')]['belongsTo'](db[_0x7d03('0x45')],{'onDelete':_0x7d03('0x177')});db['FaxApplication']['belongsTo'](db[_0x7d03('0x85')],{'onDelete':'restrict','foreignKey':_0x7d03('0x178')});db['FaxInteraction'][_0x7d03('0x107')](db[_0x7d03('0x49')],{'as':'Messages','onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x17c')});db['FaxInteraction'][_0x7d03('0x112')](db['FaxAccount'],{'as':_0x7d03('0x16d'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x10e')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':_0x7d03('0x103')});db['FaxInteraction'][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':'fax_interaction_has_tags','as':_0x7d03('0x16f')});db[_0x7d03('0x10e')][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':'fax_interaction_has_tags','as':_0x7d03('0x171')});db[_0x7d03('0x10e')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':'Users','through':_0x7d03('0x121'),'foreignKey':_0x7d03('0x17c')});db[_0x7d03('0x49')][_0x7d03('0x112')](db['User'],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x10')});db[_0x7d03('0x49')][_0x7d03('0x112')](db[_0x7d03('0x10e')],{'as':_0x7d03('0x174'),'foreignKey':_0x7d03('0x17c')});db[_0x7d03('0x49')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x15d')});db[_0x7d03('0x49')]['belongsTo'](db[_0x7d03('0x17d')],{'as':'Attachment','foreignKey':_0x7d03('0x17e')});db['FaxMessage'][_0x7d03('0x112')](db['FaxAccount'],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x17a')});db[_0x7d03('0x4b')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':'UserFaxQueue'});db[_0x7d03('0x4b')][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'through':'team_has_fax_queues','as':_0x7d03('0x152')});db['FaxQueueReport'][_0x7d03('0x112')](db['FaxAccount'],{});db[_0x7d03('0x17f')][_0x7d03('0x112')](db['CmList'],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x17f')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':'Contact','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x17f')]['belongsTo'](db[_0x7d03('0x10e')],{});db[_0x7d03('0x17f')][_0x7d03('0x112')](db[_0x7d03('0x49')],{});db[_0x7d03('0x17f')][_0x7d03('0x112')](db[_0x7d03('0x10')],{});db[_0x7d03('0x17f')][_0x7d03('0x112')](db[_0x7d03('0x4b')],{});db[_0x7d03('0x4e')]['hasMany'](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x180'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x4e')][_0x7d03('0x107')](db[_0x7d03('0x7a')],{'as':_0x7d03('0x17b'),'foreignKey':_0x7d03('0x180')});db[_0x7d03('0x4e')]['hasMany'](db[_0x7d03('0x52')],{'as':_0x7d03('0x156'),'foreignKey':_0x7d03('0x180')});db[_0x7d03('0x4e')][_0x7d03('0x107')](db[_0x7d03('0x122')],{'as':_0x7d03('0x166')});db[_0x7d03('0x4e')][_0x7d03('0x107')](db[_0x7d03('0x181')],{'as':_0x7d03('0x13f')});db[_0x7d03('0x4e')][_0x7d03('0x112')](db['CmList'],{'as':_0x7d03('0x167'),'foreignKey':'ListId'});db[_0x7d03('0x4e')][_0x7d03('0x112')](db[_0x7d03('0x7e')],{'as':_0x7d03('0x14e'),'foreignKey':_0x7d03('0x14f')});db[_0x7d03('0x4e')]['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x182')});db['SmsApplication'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0x181')][_0x7d03('0x112')](db[_0x7d03('0x53')],{'onDelete':'restrict'});db[_0x7d03('0x181')]['belongsTo'](db[_0x7d03('0x4e')],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0x181')][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x181')][_0x7d03('0x112')](db[_0x7d03('0x85')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x178')});db[_0x7d03('0x122')]['hasMany'](db[_0x7d03('0x52')],{'as':'Messages','onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x183')});db[_0x7d03('0x122')][_0x7d03('0x112')](db[_0x7d03('0x4e')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x180')});db['SmsInteraction'][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x122')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':_0x7d03('0x103')});db[_0x7d03('0x122')]['belongsToMany'](db['Tag'],{'through':_0x7d03('0x184'),'as':'Tags'});db[_0x7d03('0x122')][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':_0x7d03('0x184'),'as':'ThroughTags'});db['SmsInteraction'][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':_0x7d03('0x124'),'foreignKey':_0x7d03('0x183')});db[_0x7d03('0x52')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x10')});db['SmsMessage'][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x15d')});db['SmsMessage'][_0x7d03('0x112')](db[_0x7d03('0x122')],{'onDelete':'cascade','as':_0x7d03('0x174'),'foreignKey':_0x7d03('0x183')});db[_0x7d03('0x52')][_0x7d03('0x112')](db[_0x7d03('0x4e')],{'as':'Account','foreignKey':_0x7d03('0x180')});db['SmsQueue']['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x12f'),'foreignKey':_0x7d03('0x185')});db[_0x7d03('0x53')]['belongsToMany'](db[_0x7d03('0x11d')],{'through':_0x7d03('0x186'),'as':_0x7d03('0x152')});db['OpenchannelAccount'][_0x7d03('0x107')](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x187'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x55')][_0x7d03('0x107')](db[_0x7d03('0x7a')],{'as':_0x7d03('0x17b'),'foreignKey':_0x7d03('0x187')});db[_0x7d03('0x55')][_0x7d03('0x107')](db[_0x7d03('0x59')],{'as':'Interactions','foreignKey':_0x7d03('0x187')});db[_0x7d03('0x55')][_0x7d03('0x107')](db[_0x7d03('0x5b')],{'as':'Messages','foreignKey':_0x7d03('0x187')});db[_0x7d03('0x55')][_0x7d03('0x107')](db[_0x7d03('0x57')],{'as':'Applications','foreignKey':_0x7d03('0x187')});db[_0x7d03('0x55')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7d03('0x55')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x139')});db[_0x7d03('0x57')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':'restrict'});db[_0x7d03('0x57')][_0x7d03('0x112')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x7d03('0x112')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x7d03('0x57')][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x57')][_0x7d03('0x112')](db['Tag'],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x178')});db['OpenchannelInteraction'][_0x7d03('0x107')](db[_0x7d03('0x5b')],{'as':'Messages','onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x188')});db[_0x7d03('0x59')][_0x7d03('0x112')](db['OpenchannelAccount'],{'as':_0x7d03('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0x7d03('0x59')][_0x7d03('0x112')](db['CmContact'],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x59')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':_0x7d03('0x103')});db[_0x7d03('0x59')][_0x7d03('0x115')](db['Tag'],{'through':_0x7d03('0x189'),'as':'Tags'});db['OpenchannelInteraction'][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':_0x7d03('0x189'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':_0x7d03('0x125'),'foreignKey':_0x7d03('0x188')});db[_0x7d03('0x5b')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x10')});db[_0x7d03('0x5b')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'onDelete':'cascade','as':_0x7d03('0x15d')});db[_0x7d03('0x5b')][_0x7d03('0x112')](db['OpenchannelInteraction'],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x174'),'foreignKey':_0x7d03('0x188')});db['OpenchannelMessage'][_0x7d03('0x112')](db[_0x7d03('0x17d')],{'as':_0x7d03('0x17d'),'foreignKey':'AttachmentId'});db[_0x7d03('0x5b')]['belongsTo'](db[_0x7d03('0x55')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x187')});db[_0x7d03('0x5d')][_0x7d03('0x115')](db['User'],{'as':_0x7d03('0x151'),'through':_0x7d03('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0x7d03('0x5d')][_0x7d03('0x115')](db['Team'],{'through':_0x7d03('0x18a'),'as':_0x7d03('0x152')});db['ChatWebsite'][_0x7d03('0x107')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7d03('0x18b'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x5f')][_0x7d03('0x107')](db[_0x7d03('0x7a')],{'as':_0x7d03('0x17b'),'foreignKey':'ChatWebsiteId'});db[_0x7d03('0x5f')][_0x7d03('0x107')](db[_0x7d03('0x6a')],{'as':_0x7d03('0x18c')});db[_0x7d03('0x5f')][_0x7d03('0x107')](db[_0x7d03('0x62')],{'as':'Interactions'});db[_0x7d03('0x5f')][_0x7d03('0x107')](db[_0x7d03('0x61')],{'as':_0x7d03('0x13f')});db[_0x7d03('0x5f')]['hasMany'](db[_0x7d03('0x64')],{'as':'Messages'});db['ChatWebsite'][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db['ChatWebsite'][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'as':_0x7d03('0x7d'),'foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x5f')][_0x7d03('0x112')](db['MailAccount'],{'as':_0x7d03('0x38'),'foreignKey':_0x7d03('0x15f')});db[_0x7d03('0x5f')]['belongsTo'](db[_0x7d03('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x7d03('0x14f')});db[_0x7d03('0x5f')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':'Agents','through':_0x7d03('0x134')});db[_0x7d03('0x60')][_0x7d03('0x112')](db[_0x7d03('0x55')],{});db['OpenchannelQueueReport'][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x60')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x60')][_0x7d03('0x112')](db[_0x7d03('0x59')],{});db[_0x7d03('0x60')][_0x7d03('0x112')](db[_0x7d03('0x5b')],{});db[_0x7d03('0x60')][_0x7d03('0x112')](db[_0x7d03('0x10')],{});db[_0x7d03('0x60')][_0x7d03('0x112')](db['OpenchannelQueue'],{});db[_0x7d03('0x61')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x18d'),'foreignKey':_0x7d03('0x103'),'onDelete':'restrict'});db[_0x7d03('0x61')][_0x7d03('0x112')](db['ChatQueue'],{'as':_0x7d03('0x18e'),'foreignKey':_0x7d03('0x18f'),'onDelete':_0x7d03('0x177')});db[_0x7d03('0x61')][_0x7d03('0x112')](db[_0x7d03('0x5f')],{'as':_0x7d03('0x190'),'foreignKey':_0x7d03('0x18b'),'onDelete':_0x7d03('0x177')});db[_0x7d03('0x61')][_0x7d03('0x112')](db[_0x7d03('0x85')],{'onDelete':_0x7d03('0x177'),'foreignKey':'TagId'});db[_0x7d03('0x62')]['hasMany'](db['ChatMessage'],{'as':_0x7d03('0x156'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x191')});db['ChatInteraction']['belongsTo'](db[_0x7d03('0x5f')],{'as':_0x7d03('0x16d'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':'ContactId'});db['ChatInteraction'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':_0x7d03('0x103')});db['ChatInteraction']['belongsToMany'](db[_0x7d03('0x85')],{'through':_0x7d03('0x192'),'as':_0x7d03('0x16f')});db['ChatInteraction']['belongsToMany'](db[_0x7d03('0x85')],{'through':'chat_interaction_has_tags','as':_0x7d03('0x171')});db[_0x7d03('0x62')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':'user_has_chat_interactions','foreignKey':_0x7d03('0x191')});db[_0x7d03('0x64')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x10')});db[_0x7d03('0x64')]['belongsTo'](db[_0x7d03('0x15c')],{'onDelete':'cascade','as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x64')][_0x7d03('0x112')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x7d03('0x174'),'foreignKey':_0x7d03('0x191')});db[_0x7d03('0x64')][_0x7d03('0x112')](db[_0x7d03('0x17d')],{'as':_0x7d03('0x17d'),'foreignKey':_0x7d03('0x17e')});db[_0x7d03('0x64')]['belongsTo'](db['ChatWebsite'],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x18b')});db[_0x7d03('0x175')][_0x7d03('0x107')](db[_0x7d03('0x17d')],{'as':_0x7d03('0x173'),'foreignKey':_0x7d03('0x176'),'onDelete':_0x7d03('0x105'),'hooks':!![]});db[_0x7d03('0x175')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'onDelete':_0x7d03('0x105'),'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x175')][_0x7d03('0x112')](db[_0x7d03('0x5f')],{'as':'Account','foreignKey':_0x7d03('0x18b')});db[_0x7d03('0x67')]['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x2f'),'hooks':!![]});db[_0x7d03('0x67')][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'through':_0x7d03('0x193'),'as':_0x7d03('0x152')});db[_0x7d03('0x69')][_0x7d03('0x107')](db['ChatInternalMessage'],{'as':_0x7d03('0x156'),'foreignKey':_0x7d03('0x194'),'onDelete':'cascade'});db['ChatGroup'][_0x7d03('0x115')](db['User'],{'as':'Members','through':'chat_group_has_users'});db[_0x7d03('0x6a')][_0x7d03('0x112')](db[_0x7d03('0x5f')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x7d03('0x107')](db[_0x7d03('0x15c')],{'as':'Contacts','foreignKey':_0x7d03('0x195')});db['CmContact'][_0x7d03('0x107')](db[_0x7d03('0x144')],{'as':_0x7d03('0x145'),'foreignKey':'ContactId'});db['CmContact'][_0x7d03('0x107')](db[_0x7d03('0x70')],{'as':_0x7d03('0x109'),'foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x15c')][_0x7d03('0x107')](db[_0x7d03('0x72')],{'as':'HopperHistories','foreignKey':_0x7d03('0x15e')});db['CmContact'][_0x7d03('0x107')](db[_0x7d03('0x10b')],{'as':'ReportAgentPreview','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0x15c')][_0x7d03('0x107')](db[_0x7d03('0x148')],{'as':_0x7d03('0x149'),'foreignKey':'ContactId'});db['CmContact'][_0x7d03('0x107')](db[_0x7d03('0x59')],{'as':_0x7d03('0x10c'),'foreignKey':_0x7d03('0x15e'),'onDelete':'restrict'});db[_0x7d03('0x15c')]['hasMany'](db[_0x7d03('0x62')],{'as':_0x7d03('0x10d'),'foreignKey':_0x7d03('0x15e'),'onDelete':'restrict'});db[_0x7d03('0x15c')]['hasMany'](db[_0x7d03('0x122')],{'as':_0x7d03('0x123'),'foreignKey':_0x7d03('0x15e'),'onDelete':'restrict'});db[_0x7d03('0x15c')]['hasMany'](db[_0x7d03('0x10e')],{'as':_0x7d03('0x10f'),'foreignKey':_0x7d03('0x15e'),'onDelete':_0x7d03('0x177')});db['CmContact'][_0x7d03('0x107')](db['MailInteraction'],{'as':_0x7d03('0x110'),'foreignKey':_0x7d03('0x15e'),'onDelete':_0x7d03('0x177')});db['CmContact'][_0x7d03('0x112')](db[_0x7d03('0x6c')],{'as':'Company','foreignKey':_0x7d03('0x195')});db[_0x7d03('0x15c')]['belongsTo'](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x15c')]['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':'cm_user_has_contacts'});db[_0x7d03('0x15c')][_0x7d03('0x115')](db[_0x7d03('0x85')],{'as':_0x7d03('0x16f'),'through':_0x7d03('0x196')});db['CmContact']['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0x7d03('0x171')});db[_0x7d03('0x144')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x7d03('0x144')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':'ListId','onDelete':_0x7d03('0x105')});db[_0x7d03('0x144')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':_0x7d03('0x18d'),'foreignKey':_0x7d03('0x103')});db[_0x7d03('0x144')][_0x7d03('0x112')](db[_0x7d03('0x1a')],{'as':_0x7d03('0x18e'),'foreignKey':_0x7d03('0x143'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x144')][_0x7d03('0x112')](db[_0x7d03('0x197')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x7d03('0x105')});db['CmHopper'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':_0x7d03('0x198')});db[_0x7d03('0x6e')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':'ContactId','onDelete':_0x7d03('0x105')});db[_0x7d03('0x6e')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack'][_0x7d03('0x112')](db[_0x7d03('0x1a')],{'as':_0x7d03('0x18e'),'foreignKey':'VoiceQueueId','onDelete':_0x7d03('0x105')});db['CmHopperBlack'][_0x7d03('0x112')](db[_0x7d03('0x197')],{'as':'Campaign','foreignKey':_0x7d03('0x199'),'onDelete':'cascade'});db['Automation'][_0x7d03('0x107')](db[_0x7d03('0x7b')],{'as':{'plural':'All','singular':_0x7d03('0x19a')},'foreignKey':'AutomationAllId','onDelete':_0x7d03('0x105'),'hooks':!![]});db['Automation']['hasMany'](db[_0x7d03('0x7b')],{'as':{'plural':_0x7d03('0x19b'),'singular':_0x7d03('0x19c')},'foreignKey':_0x7d03('0x19d'),'onDelete':_0x7d03('0x105'),'hooks':!![]});db[_0x7d03('0x78')][_0x7d03('0x107')](db[_0x7d03('0x76')],{'as':'Actions','foreignKey':_0x7d03('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x7d03('0x164')][_0x7d03('0x107')](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x19f'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0x7d')][_0x7d03('0x107')](db[_0x7d03('0x7d')],{'as':_0x7d03('0x1a0'),'foreignKey':_0x7d03('0x14d'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0x7d03('0x107')](db[_0x7d03('0x17')],{'as':_0x7d03('0x1a1'),'foreignKey':_0x7d03('0x14d'),'onDelete':_0x7d03('0x177')});db['Interval'][_0x7d03('0x107')](db[_0x7d03('0x3f')],{'as':_0x7d03('0x1a2'),'foreignKey':'IntervalId'});db[_0x7d03('0x7d')]['hasMany'](db[_0x7d03('0x61')],{'as':_0x7d03('0x1a3'),'foreignKey':_0x7d03('0x14d')});db['Interval'][_0x7d03('0x107')](db['FaxApplication'],{'as':_0x7d03('0x1a4'),'foreignKey':_0x7d03('0x14d')});db['Interval'][_0x7d03('0x107')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x1a5')]['belongsTo'](db[_0x7d03('0x38')],{});db[_0x7d03('0x1a5')][_0x7d03('0x112')](db[_0x7d03('0x8d')],{'foreignKey':_0x7d03('0x1a6')});db[_0x7d03('0x1a5')][_0x7d03('0x112')](db[_0x7d03('0x8b')],{'foreignKey':_0x7d03('0x1a7')});db['Sound'][_0x7d03('0x115')](db[_0x7d03('0x18')],{'as':'Mohs','through':_0x7d03('0x141'),'onDelete':'restrict'});db[_0x7d03('0x85')][_0x7d03('0x115')](db[_0x7d03('0x15c')],{'through':'cm_contact_has_tags'});db[_0x7d03('0x85')][_0x7d03('0x115')](db[_0x7d03('0x62')],{'through':'chat_interaction_has_tags'});db[_0x7d03('0x85')][_0x7d03('0x115')](db[_0x7d03('0x3c')],{'through':'mail_interaction_has_tags'});db[_0x7d03('0x85')][_0x7d03('0x115')](db['SmsInteraction'],{'through':_0x7d03('0x184')});db[_0x7d03('0x85')][_0x7d03('0x115')](db[_0x7d03('0x10e')],{'through':_0x7d03('0x1a8')});db[_0x7d03('0x85')]['belongsToMany'](db[_0x7d03('0x59')],{'through':_0x7d03('0x189')});db[_0x7d03('0x85')]['belongsToMany'](db[_0x7d03('0xed')],{'through':_0x7d03('0x1a9')});db[_0x7d03('0x88')][_0x7d03('0x107')](db[_0x7d03('0x7b')],{'as':{'plural':_0x7d03('0x1aa'),'singular':'AllCondition'},'foreignKey':_0x7d03('0x1ab'),'onDelete':_0x7d03('0x105'),'hooks':!![]});db[_0x7d03('0x88')][_0x7d03('0x107')](db[_0x7d03('0x7b')],{'as':{'plural':_0x7d03('0x1ac'),'singular':_0x7d03('0x1ad')},'foreignKey':_0x7d03('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0x7d03('0x88')][_0x7d03('0x107')](db[_0x7d03('0x76')],{'as':_0x7d03('0x1af'),'foreignKey':_0x7d03('0x1b0'),'onDelete':_0x7d03('0x105'),'hooks':!![]});db[_0x7d03('0x8b')][_0x7d03('0x107')](db[_0x7d03('0x91')],{'as':_0x7d03('0x1b1'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1a7'),'hooks':!![]});db[_0x7d03('0x8d')][_0x7d03('0x107')](db[_0x7d03('0x91')],{'as':'Fields','onDelete':_0x7d03('0x105'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0x7d03('0x91')],{'as':_0x7d03('0x1b1'),'onDelete':'cascade','foreignKey':_0x7d03('0x1b2')});db[_0x7d03('0x91')][_0x7d03('0x112')](db['AnalyticMetric'],{'foreignKey':_0x7d03('0x1b2')});db['SalesforceAccount']['hasMany'](db[_0x7d03('0x96')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x96')][_0x7d03('0x107')](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1b5'),'onDelete':'cascade','foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0x96')][_0x7d03('0x107')](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1b7'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0x96')][_0x7d03('0x107')](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1b1'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b9')});db['SalesforceConfiguration'][_0x7d03('0x112')](db[_0x7d03('0x94')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x1b4')]['hasMany'](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0x1b4')]['hasMany'](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1bb'),'foreignKey':_0x7d03('0x1b8')});db['SalesforceField'][_0x7d03('0x107')](db[_0x7d03('0x1b4')],{'as':_0x7d03('0x1bc'),'foreignKey':_0x7d03('0x1b9')});db['SalesforceField']['belongsTo'](db[_0x7d03('0x1bd')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7d03('0x98')][_0x7d03('0x107')](db[_0x7d03('0x99')],{'as':_0x7d03('0x1be'),'onDelete':'cascade','foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x99')][_0x7d03('0x107')](db[_0x7d03('0x9b')],{'as':'Subjects','onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0x99')][_0x7d03('0x107')](db[_0x7d03('0x9b')],{'as':_0x7d03('0x1b7'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b8')});db['SugarcrmConfiguration'][_0x7d03('0x107')](db[_0x7d03('0x9b')],{'as':_0x7d03('0x1b1'),'onDelete':'cascade','foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0x99')][_0x7d03('0x112')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x9b')][_0x7d03('0x107')](db[_0x7d03('0x9b')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0x9b')][_0x7d03('0x107')](db[_0x7d03('0x9b')],{'as':_0x7d03('0x1bb'),'foreignKey':'DescriptionId'});db[_0x7d03('0x9b')][_0x7d03('0x107')](db['SugarcrmField'],{'as':_0x7d03('0x1bc'),'foreignKey':_0x7d03('0x1b9')});db['SugarcrmField'][_0x7d03('0x112')](db[_0x7d03('0x1bd')],{'as':'Variable','foreignKey':_0x7d03('0x1bf')});db[_0x7d03('0x9c')][_0x7d03('0x107')](db[_0x7d03('0x1c0')],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b3')});db['DeskConfiguration'][_0x7d03('0x107')](db[_0x7d03('0x1c1')],{'as':_0x7d03('0x1b5'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0x1c0')][_0x7d03('0x107')](db['DeskField'],{'as':_0x7d03('0x1b7'),'onDelete':_0x7d03('0x105'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x7d03('0x107')](db[_0x7d03('0x1c1')],{'as':_0x7d03('0x1b1'),'onDelete':_0x7d03('0x105'),'foreignKey':'FieldId'});db[_0x7d03('0x1c0')][_0x7d03('0x112')](db[_0x7d03('0x9c')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x1c0')][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':_0x7d03('0x1c2')});db['DeskField']['hasMany'](db[_0x7d03('0x1c1')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db['DeskField'][_0x7d03('0x107')](db[_0x7d03('0x1c1')],{'as':_0x7d03('0x1bb'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0x1c1')][_0x7d03('0x107')](db[_0x7d03('0x1c1')],{'as':_0x7d03('0x1bc'),'foreignKey':'FieldId'});db[_0x7d03('0x1c1')]['belongsTo'](db[_0x7d03('0x1bd')],{'as':_0x7d03('0x1bd'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x7d03('0x107')](db[_0x7d03('0xa2')],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0xa2')][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':_0x7d03('0x1b5'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xa2')][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':_0x7d03('0x1b7'),'onDelete':_0x7d03('0x105'),'foreignKey':'DescriptionId'});db[_0x7d03('0xa2')][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':_0x7d03('0x1b1'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xa2')][_0x7d03('0x112')](db[_0x7d03('0xa0')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db['ZohoField'][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':'Subject','foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xa3')][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':_0x7d03('0x1bb'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0xa3')][_0x7d03('0x107')](db[_0x7d03('0xa3')],{'as':'Field','foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xa3')][_0x7d03('0x112')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x7d03('0x1c3')][_0x7d03('0x107')](db[_0x7d03('0x1c4')],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0x1c4')][_0x7d03('0x107')](db[_0x7d03('0xa6')],{'as':_0x7d03('0x1b5'),'foreignKey':'SubjectId'});db[_0x7d03('0x1c4')]['hasMany'](db[_0x7d03('0xa6')],{'as':_0x7d03('0x1b7'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0x1c4')][_0x7d03('0x107')](db[_0x7d03('0xa6')],{'as':_0x7d03('0x1b1'),'foreignKey':_0x7d03('0x1b9')});db['ZendeskConfiguration']['belongsTo'](db[_0x7d03('0x1c3')],{'as':_0x7d03('0x16d'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0x7d03('0x1c5')});db[_0x7d03('0xa6')][_0x7d03('0x107')](db['ZendeskField'],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xa6')]['hasMany'](db[_0x7d03('0xa6')],{'as':_0x7d03('0x1bb'),'foreignKey':'DescriptionId'});db[_0x7d03('0xa6')]['hasMany'](db[_0x7d03('0xa6')],{'as':_0x7d03('0x1bc'),'foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xa6')][_0x7d03('0x112')](db['Variable'],{'as':_0x7d03('0x1bd'),'foreignKey':_0x7d03('0x1bf')});db['FreshdeskAccount'][_0x7d03('0x107')](db['FreshdeskConfiguration'],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0x7d03('0xab')],{'as':_0x7d03('0x1b5'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xaa')][_0x7d03('0x107')](db['FreshdeskField'],{'as':_0x7d03('0x1b7'),'onDelete':'cascade','foreignKey':_0x7d03('0x1b8')});db['FreshdeskConfiguration'][_0x7d03('0x107')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x7d03('0x105'),'foreignKey':'FieldId'});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0xaa')][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':_0x7d03('0x1c6')});db[_0x7d03('0xab')][_0x7d03('0x107')](db[_0x7d03('0xab')],{'as':_0x7d03('0x1ba'),'foreignKey':'SubjectId'});db[_0x7d03('0xab')][_0x7d03('0x107')](db[_0x7d03('0xab')],{'as':_0x7d03('0x1bb'),'foreignKey':_0x7d03('0x1b8')});db['FreshdeskField'][_0x7d03('0x107')](db[_0x7d03('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0x7d03('0xab')][_0x7d03('0x112')](db[_0x7d03('0x1bd')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount'][_0x7d03('0x107')](db[_0x7d03('0xae')],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b3')});db['VtigerConfiguration'][_0x7d03('0x107')](db[_0x7d03('0xaf')],{'as':_0x7d03('0x1b5'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xae')]['hasMany'](db['VtigerField'],{'as':_0x7d03('0x1b7'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0xae')][_0x7d03('0x107')](db[_0x7d03('0xaf')],{'as':_0x7d03('0x1b1'),'foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xae')][_0x7d03('0x112')](db[_0x7d03('0x1c7')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0xaf')]['hasMany'](db[_0x7d03('0xaf')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xaf')][_0x7d03('0x107')](db['VtigerField'],{'as':_0x7d03('0x1bb'),'foreignKey':'DescriptionId'});db[_0x7d03('0xaf')][_0x7d03('0x107')](db[_0x7d03('0xaf')],{'as':_0x7d03('0x1bc'),'foreignKey':'FieldId'});db['VtigerField'][_0x7d03('0x112')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x7d03('0xb1')]['hasMany'](db[_0x7d03('0x1c8')],{'as':_0x7d03('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0x7d03('0xb4')],{'as':_0x7d03('0x1b5'),'foreignKey':'SubjectId'});db[_0x7d03('0x1c8')]['hasMany'](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0x1c8')][_0x7d03('0x107')](db[_0x7d03('0xb4')],{'as':_0x7d03('0x1b1'),'foreignKey':_0x7d03('0x1b9')});db['ServicenowConfiguration']['belongsTo'](db[_0x7d03('0xb1')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0x7d03('0x107')](db[_0x7d03('0xb4')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db['ServicenowField'][_0x7d03('0x107')](db[_0x7d03('0xb4')],{'as':_0x7d03('0x1bb'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0xb4')][_0x7d03('0x107')](db[_0x7d03('0xb4')],{'as':'Field','foreignKey':_0x7d03('0x1b9')});db['ServicenowField']['belongsTo'](db[_0x7d03('0x1bd')],{'as':_0x7d03('0x1bd'),'foreignKey':_0x7d03('0x1bf')});db[_0x7d03('0xb6')][_0x7d03('0x107')](db[_0x7d03('0xb8')],{'as':_0x7d03('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x7d03('0xb6')]['belongsTo'](db['CloudProvider'],{'as':_0x7d03('0xf7'),'foreignKey':_0x7d03('0x160')});db[_0x7d03('0xb8')][_0x7d03('0x107')](db[_0x7d03('0x1c9')],{'as':_0x7d03('0x1b5'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b6')});db['Dynamics365Configuration'][_0x7d03('0x107')](db[_0x7d03('0x1c9')],{'as':_0x7d03('0x1b7'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b8')});db['Dynamics365Configuration'][_0x7d03('0x107')](db[_0x7d03('0x1c9')],{'as':_0x7d03('0x1b1'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xb8')][_0x7d03('0x112')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x7d03('0x1b3')});db['Dynamics365Field']['hasMany'](db[_0x7d03('0x1c9')],{'as':_0x7d03('0x1ba'),'foreignKey':_0x7d03('0x1b6')});db['Dynamics365Field'][_0x7d03('0x107')](db[_0x7d03('0x1c9')],{'as':'Description','foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0x1c9')][_0x7d03('0x107')](db[_0x7d03('0x1c9')],{'as':_0x7d03('0x1bc'),'foreignKey':_0x7d03('0x1b9')});db['Dynamics365Field'][_0x7d03('0x112')](db[_0x7d03('0x1bd')],{'as':_0x7d03('0x1bd'),'foreignKey':'VariableId'});db[_0x7d03('0x1ca')]['hasMany'](db[_0x7d03('0xbc')],{'as':_0x7d03('0x1be'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1b3')});db['FreshsalesConfiguration']['hasMany'](db[_0x7d03('0xbe')],{'as':_0x7d03('0x1b5'),'foreignKey':_0x7d03('0x1b6')});db['FreshsalesConfiguration'][_0x7d03('0x107')](db[_0x7d03('0xbe')],{'as':_0x7d03('0x1b7'),'foreignKey':_0x7d03('0x1b8')});db[_0x7d03('0xbc')][_0x7d03('0x107')](db[_0x7d03('0xbe')],{'as':_0x7d03('0x1b1'),'foreignKey':'FieldId'});db[_0x7d03('0xbc')][_0x7d03('0x112')](db[_0x7d03('0x1ca')],{'as':_0x7d03('0x16d'),'foreignKey':_0x7d03('0x1b3')});db[_0x7d03('0xbe')][_0x7d03('0x107')](db[_0x7d03('0xbe')],{'as':'Subject','foreignKey':_0x7d03('0x1b6')});db[_0x7d03('0xbe')][_0x7d03('0x107')](db['FreshsalesField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x7d03('0xbe')][_0x7d03('0x107')](db['FreshsalesField'],{'as':_0x7d03('0x1bc'),'foreignKey':_0x7d03('0x1b9')});db[_0x7d03('0xbe')][_0x7d03('0x112')](db[_0x7d03('0x1bd')],{'as':_0x7d03('0x1bd'),'foreignKey':_0x7d03('0x1bf')});db[_0x7d03('0xc3')][_0x7d03('0x112')](db[_0x7d03('0x5f')],{});db[_0x7d03('0xc3')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':'List','foreignKey':_0x7d03('0x168')});db[_0x7d03('0xc3')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db['ChatQueueReport'][_0x7d03('0x112')](db[_0x7d03('0x62')],{});db['ChatQueueReport'][_0x7d03('0x112')](db[_0x7d03('0x64')],{});db[_0x7d03('0xc3')]['belongsTo'](db['User'],{});db[_0x7d03('0xc3')][_0x7d03('0x112')](db[_0x7d03('0x67')],{});db['ChatInternalMessage'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1cb')});db['ChatInternalMessage'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1cc')});db[_0x7d03('0x148')][_0x7d03('0x107')](db[_0x7d03('0x1cd')],{'foreignKey':'SessionId','onDelete':_0x7d03('0x105')});db['JscriptySessionReport'][_0x7d03('0x107')](db['JscriptyAnswerReport'],{'foreignKey':_0x7d03('0x1ce'),'onDelete':_0x7d03('0x105')});db['SmsQueueReport'][_0x7d03('0x112')](db[_0x7d03('0x4e')],{});db[_0x7d03('0xc8')]['belongsTo'](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0xc8')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':'Contact','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0xc8')][_0x7d03('0x112')](db[_0x7d03('0x122')],{});db['SmsQueueReport'][_0x7d03('0x112')](db['SmsMessage'],{});db[_0x7d03('0xc8')][_0x7d03('0x112')](db[_0x7d03('0x10')],{});db['SmsQueueReport'][_0x7d03('0x112')](db[_0x7d03('0x53')],{});db[_0x7d03('0xce')][_0x7d03('0x107')](db[_0x7d03('0x148')],{'foreignKey':_0x7d03('0x1cf')});db['JscriptyProject'][_0x7d03('0x107')](db[_0x7d03('0x1cd')],{'foreignKey':_0x7d03('0x1cf')});db[_0x7d03('0xce')][_0x7d03('0x107')](db[_0x7d03('0xc5')],{'foreignKey':_0x7d03('0x1cf')});db[_0x7d03('0xd3')]['belongsToMany'](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'through':'user_has_square_projects'});db[_0x7d03('0x11d')][_0x7d03('0x115')](db['User'],{'as':'Agents','through':_0x7d03('0x11e')});db[_0x7d03('0x11d')][_0x7d03('0x115')](db[_0x7d03('0x1a')],{'through':_0x7d03('0xf9'),'as':'VoiceQueues'});db[_0x7d03('0x11d')][_0x7d03('0x115')](db[_0x7d03('0x12b')],{'through':_0x7d03('0x16b'),'as':_0x7d03('0x12c')});db['Team'][_0x7d03('0x115')](db['ChatQueue'],{'through':_0x7d03('0x193'),'as':_0x7d03('0x12d')});db['Team'][_0x7d03('0x115')](db['FaxQueue'],{'through':_0x7d03('0x1d0'),'as':_0x7d03('0x1d1')});db[_0x7d03('0x11d')]['belongsToMany'](db[_0x7d03('0x53')],{'through':_0x7d03('0x186'),'as':_0x7d03('0x12e')});db['Team'][_0x7d03('0x115')](db[_0x7d03('0x5d')],{'through':_0x7d03('0x18a'),'as':'OpenchannelQueues'});db[_0x7d03('0x11d')][_0x7d03('0x115')](db[_0x7d03('0xf5')],{'through':_0x7d03('0x1d2'),'as':_0x7d03('0x131')});db[_0x7d03('0x11d')][_0x7d03('0x115')](db['VoicePrefix'],{'through':_0x7d03('0xfb'),'as':'VoicePrefixes'});db['Campaign'][_0x7d03('0x107')](db['CmHopper'],{'as':_0x7d03('0x145'),'foreignKey':_0x7d03('0x199')});db[_0x7d03('0x197')][_0x7d03('0x107')](db[_0x7d03('0x70')],{'as':_0x7d03('0x109'),'foreignKey':_0x7d03('0x199')});db['Campaign'][_0x7d03('0x107')](db[_0x7d03('0x72')],{'as':_0x7d03('0x146'),'foreignKey':_0x7d03('0x199')});db[_0x7d03('0x197')]['hasMany'](db[_0x7d03('0x6e')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x7d03('0x29')],{'as':_0x7d03('0x29'),'foreignKey':_0x7d03('0x14a')});db[_0x7d03('0x197')][_0x7d03('0x112')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x7d03('0x14c')});db['Campaign'][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'as':_0x7d03('0x7d'),'foreignKey':_0x7d03('0x14d')});db[_0x7d03('0x197')][_0x7d03('0x112')](db[_0x7d03('0xd3')],{'as':_0x7d03('0xd3'),'foreignKey':_0x7d03('0x1d3')});db[_0x7d03('0x197')][_0x7d03('0x115')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x11b'),'through':'campaigns_has_cm_lists'});db[_0x7d03('0x197')][_0x7d03('0x115')](db['CmList'],{'as':_0x7d03('0x153'),'through':'campaigns_has_cm_blacklists'});db[_0x7d03('0x17d')][_0x7d03('0x112')](db[_0x7d03('0x175')],{'as':_0x7d03('0x175'),'foreignKey':_0x7d03('0x176')});db[_0x7d03('0xdc')][_0x7d03('0x112')](db[_0x7d03('0x3e')],{});db[_0x7d03('0xdc')]['belongsTo'](db[_0x7d03('0x3c')],{});db['MailTransferReport']['belongsTo'](db[_0x7d03('0x38')],{'foreignKey':_0x7d03('0x1d4'),'as':_0x7d03('0x1d5')});db['MailTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d6'),'as':_0x7d03('0x1d7')});db['MailTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d8'),'as':_0x7d03('0x1d9')});db[_0x7d03('0xdc')]['belongsTo'](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x7d03('0x1da')});db[_0x7d03('0xdc')][_0x7d03('0x112')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x7d03('0xdd')][_0x7d03('0x112')](db[_0x7d03('0x64')],{});db['ChatTransferReport'][_0x7d03('0x112')](db['ChatInteraction'],{});db[_0x7d03('0xdd')][_0x7d03('0x112')](db[_0x7d03('0x5f')],{'foreignKey':_0x7d03('0x1db'),'as':_0x7d03('0x1d5')});db[_0x7d03('0xdd')]['belongsTo'](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d6'),'as':_0x7d03('0x1d7')});db[_0x7d03('0xdd')]['belongsTo'](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d8'),'as':'ToAgent'});db['ChatTransferReport']['belongsTo'](db['ChatQueue'],{'foreignKey':_0x7d03('0x1dc'),'as':_0x7d03('0x1da')});db['ChatTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x5f')],{'foreignKey':'ToChatWebsiteId','as':_0x7d03('0x1dd')});db[_0x7d03('0xdf')][_0x7d03('0x112')](db[_0x7d03('0x49')],{});db[_0x7d03('0xdf')][_0x7d03('0x112')](db['FaxInteraction'],{});db[_0x7d03('0xdf')][_0x7d03('0x112')](db['FaxAccount'],{'foreignKey':_0x7d03('0x1de'),'as':_0x7d03('0x1d5')});db[_0x7d03('0xdf')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d6'),'as':_0x7d03('0x1d7')});db[_0x7d03('0xdf')][_0x7d03('0x112')](db['User'],{'foreignKey':_0x7d03('0x1d8'),'as':_0x7d03('0x1d9')});db[_0x7d03('0xdf')][_0x7d03('0x112')](db['FaxQueue'],{'foreignKey':_0x7d03('0x1df'),'as':'ToQueue'});db['FaxTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x45')],{'foreignKey':_0x7d03('0x1e0'),'as':_0x7d03('0x1dd')});db[_0x7d03('0xe0')][_0x7d03('0x112')](db[_0x7d03('0x5b')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x7d03('0x59')],{});db[_0x7d03('0xe0')][_0x7d03('0x112')](db[_0x7d03('0x55')],{'foreignKey':_0x7d03('0x1e1'),'as':_0x7d03('0x1d5')});db[_0x7d03('0xe0')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d6'),'as':_0x7d03('0x1d7')});db['OpenchannelTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d8'),'as':_0x7d03('0x1d9')});db['OpenchannelTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x5d')],{'foreignKey':_0x7d03('0x1e2'),'as':'ToQueue'});db[_0x7d03('0xe0')][_0x7d03('0x112')](db[_0x7d03('0x55')],{'foreignKey':_0x7d03('0x1e3'),'as':_0x7d03('0x1dd')});db['SmsTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x52')],{});db[_0x7d03('0xe1')][_0x7d03('0x112')](db[_0x7d03('0x122')],{});db[_0x7d03('0xe1')][_0x7d03('0x112')](db[_0x7d03('0x4e')],{'foreignKey':_0x7d03('0x1e4'),'as':_0x7d03('0x1d5')});db['SmsTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':'FromUserId','as':_0x7d03('0x1d7')});db['SmsTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d8'),'as':_0x7d03('0x1d9')});db[_0x7d03('0xe1')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x7d03('0x1e5'),'as':_0x7d03('0x1da')});db['SmsTransferReport'][_0x7d03('0x112')](db[_0x7d03('0x4e')],{'foreignKey':_0x7d03('0x1e6'),'as':_0x7d03('0x1dd')});db[_0x7d03('0x11a')][_0x7d03('0x107')](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x168'),'onDelete':'cascade'});db[_0x7d03('0x11a')][_0x7d03('0x107')](db[_0x7d03('0x1e7')],{'as':_0x7d03('0x1e8'),'foreignKey':'ListId'});db[_0x7d03('0x11a')]['hasMany'](db[_0x7d03('0x15c')],{'as':_0x7d03('0x118'),'onDelete':_0x7d03('0x105'),'foreignKey':'ListId'});db[_0x7d03('0x11a')]['hasMany'](db[_0x7d03('0x70')],{'as':_0x7d03('0x109'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x11a')]['hasMany'](db[_0x7d03('0x72')],{'as':_0x7d03('0x10a'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0x11a')]['hasMany'](db[_0x7d03('0x10b')],{'as':_0x7d03('0x10b'),'foreignKey':_0x7d03('0x168')});db['CmList']['belongsToMany'](db[_0x7d03('0x1a')],{'as':_0x7d03('0x1e9'),'through':_0x7d03('0x150')});db[_0x7d03('0x11a')][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':_0x7d03('0x11c')});db[_0x7d03('0x129')][_0x7d03('0x107')](db['VoiceExtension'],{'as':_0x7d03('0x1a1'),'onDelete':_0x7d03('0x105')});db['VoicePrefix'][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':'UserVoicePrefix'});db[_0x7d03('0x129')][_0x7d03('0x115')](db[_0x7d03('0x11d')],{'through':_0x7d03('0xfb'),'as':_0x7d03('0x152')});db[_0x7d03('0x113')][_0x7d03('0x107')](db[_0x7d03('0x10')],{'as':_0x7d03('0x172'),'foreignKey':'userProfileId'});db[_0x7d03('0x113')][_0x7d03('0x107')](db[_0x7d03('0xe4')],{'as':_0x7d03('0x1ea'),'foreignKey':_0x7d03('0x114'),'onDelete':_0x7d03('0x105')});db['UserProfileSection'][_0x7d03('0x107')](db['UserProfileResource'],{'as':_0x7d03('0x1eb'),'foreignKey':_0x7d03('0x1ec'),'onDelete':_0x7d03('0x105')});db[_0x7d03('0xe9')]['hasMany'](db[_0x7d03('0x164')],{'as':_0x7d03('0x165'),'foreignKey':_0x7d03('0x1ed'),'onDelete':_0x7d03('0x105')});db['WhatsappAccount'][_0x7d03('0x107')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x7d03('0x1ed')});db[_0x7d03('0xe9')][_0x7d03('0x107')](db[_0x7d03('0xef')],{'as':'Messages','foreignKey':_0x7d03('0x1ed')});db[_0x7d03('0xe9')][_0x7d03('0x107')](db[_0x7d03('0xed')],{'as':_0x7d03('0x166')});db[_0x7d03('0xe9')][_0x7d03('0x107')](db[_0x7d03('0xeb')],{'as':_0x7d03('0x13f')});db[_0x7d03('0xe9')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0xe9')][_0x7d03('0x112')](db[_0x7d03('0x7e')],{'as':_0x7d03('0x14e'),'foreignKey':_0x7d03('0x14f')});db['WhatsappAccount'][_0x7d03('0x115')](db[_0x7d03('0x10')],{'as':_0x7d03('0x151'),'through':'user_has_whatsapp_accounts'});db[_0x7d03('0xeb')]['belongsTo'](db['User'],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0xeb')][_0x7d03('0x112')](db[_0x7d03('0xf5')],{'onDelete':_0x7d03('0x177')});db[_0x7d03('0xeb')][_0x7d03('0x112')](db[_0x7d03('0xe9')],{'onDelete':'restrict'});db[_0x7d03('0xeb')][_0x7d03('0x112')](db[_0x7d03('0x7d')],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x14d')});db['WhatsappApplication'][_0x7d03('0x112')](db['Tag'],{'onDelete':_0x7d03('0x177'),'foreignKey':_0x7d03('0x178')});db['WhatsappInteraction'][_0x7d03('0x107')](db[_0x7d03('0xef')],{'as':_0x7d03('0x156'),'onDelete':_0x7d03('0x105'),'foreignKey':_0x7d03('0x1ee')});db[_0x7d03('0xed')][_0x7d03('0x112')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x7d03('0x1ed')});db['WhatsappInteraction'][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':'Contact','foreignKey':_0x7d03('0x15e')});db[_0x7d03('0xed')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction'][_0x7d03('0x115')](db[_0x7d03('0x85')],{'through':_0x7d03('0x1a9'),'as':_0x7d03('0x16f')});db[_0x7d03('0xed')][_0x7d03('0x115')](db['Tag'],{'through':_0x7d03('0x1a9'),'as':_0x7d03('0x171')});db[_0x7d03('0xed')]['belongsToMany'](db[_0x7d03('0x10')],{'as':'Users','through':_0x7d03('0x127'),'foreignKey':'WhatsappInteractionId'});db[_0x7d03('0xef')][_0x7d03('0x112')](db['User'],{'as':_0x7d03('0x10')});db[_0x7d03('0xef')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'onDelete':'cascade','as':_0x7d03('0x15d')});db[_0x7d03('0xef')]['belongsTo'](db[_0x7d03('0xed')],{'onDelete':_0x7d03('0x105'),'as':'Interaction','foreignKey':_0x7d03('0x1ee')});db[_0x7d03('0xef')]['belongsTo'](db[_0x7d03('0xe9')],{'as':_0x7d03('0x16d'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x7d03('0x112')](db['WhatsappAccount'],{});db[_0x7d03('0xf1')][_0x7d03('0x112')](db[_0x7d03('0x11a')],{'as':_0x7d03('0x167'),'foreignKey':_0x7d03('0x168')});db[_0x7d03('0xf1')][_0x7d03('0x112')](db[_0x7d03('0x15c')],{'as':_0x7d03('0x15d'),'foreignKey':_0x7d03('0x15e')});db['WhatsappQueueReport'][_0x7d03('0x112')](db[_0x7d03('0xed')],{});db[_0x7d03('0xf1')][_0x7d03('0x112')](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x7d03('0xef')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x7d03('0x10')],{});db[_0x7d03('0xf3')][_0x7d03('0x112')](db[_0x7d03('0xef')],{});db[_0x7d03('0xf3')]['belongsTo'](db[_0x7d03('0xed')],{});db[_0x7d03('0xf3')][_0x7d03('0x112')](db[_0x7d03('0xe9')],{'foreignKey':_0x7d03('0x1ef'),'as':'FromAccount'});db[_0x7d03('0xf3')][_0x7d03('0x112')](db[_0x7d03('0xe9')],{'foreignKey':_0x7d03('0x1f0'),'as':_0x7d03('0x1dd')});db[_0x7d03('0xf3')][_0x7d03('0x112')](db[_0x7d03('0xf5')],{'foreignKey':_0x7d03('0x1f1'),'as':_0x7d03('0x1da')});db[_0x7d03('0xf3')][_0x7d03('0x112')](db[_0x7d03('0x10')],{'foreignKey':_0x7d03('0x1d6'),'as':_0x7d03('0x1d7')});db[_0x7d03('0xf3')][_0x7d03('0x112')](db['User'],{'foreignKey':_0x7d03('0x1d8'),'as':'ToAgent'});db[_0x7d03('0xf5')][_0x7d03('0x115')](db['User'],{'as':'Agents','through':_0x7d03('0x132'),'foreignKey':'WhatsappQueueId'});db[_0x7d03('0xf5')][_0x7d03('0x115')](db['Team'],{'through':_0x7d03('0x1d2'),'as':'Teams'});db[_0x7d03('0xff')][_0x7d03('0x112')](db['User'],{'as':'user','foreignKey':_0x7d03('0x103'),'onDelete':_0x7d03('0x105'),'hooks':!![]});db[_0x7d03('0xf7')][_0x7d03('0x101')](db[_0x7d03('0xb6')],{'as':_0x7d03('0xb6'),'onDelete':_0x7d03('0x177')});db['CloudProvider'][_0x7d03('0x101')](db[_0x7d03('0x36')],{'as':_0x7d03('0x162'),'onDelete':_0x7d03('0x177')});db[_0x7d03('0xf7')][_0x7d03('0x101')](db[_0x7d03('0x161')],{'as':'Smtp','onDelete':_0x7d03('0x177')});module[_0x7d03('0x1f2')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x32c4=['MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../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','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','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','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','VoiceMail','cascade','UserId','hasOne','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','Groups','Contacts','cm_user_has_contacts','Lists','belongsToMany','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','OpenchannelQueues','cm_user_has_lists','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','HopperBlacks','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','CloudProvider','CloudProviderId','restrict','MailAccountId','Smtp','Dispositions','CannedAnswer','Answers','List','ListId','Template','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','MailApplication','Items','FaxAccountId','Interactions','FaxApplication','Exntensions','TagId','FaxMessage','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','user_has_openchannel_accounts','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','chat_group_has_users','CompanyId','Hoppers','HopperHistories','JscriptySessionReport','JscriptySessions','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Automation','All','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','VoiceMusicOnHold','Mohs','moh_has_sounds','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','SugarcrmConfiguration','DeskConfiguration','Field','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','FreshsalesConfiguration','FreshsalesField','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','SmsQueues','team_has_whatsapp_queues','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','userProfileId','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappMessage','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','../config/environment','lodash','determine','sequelize','defaultsDeep','motion2','xcall','127.0.0.1','name','utf8','xC@LL1234','mysql','utf8mb4','utf8_general_ci','database','password','options','sequelizeHistory','username','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x32c4,0x1c4));var _0x432c=function(_0x3ad62c,_0x465700){_0x3ad62c=_0x3ad62c-0x0;var _0x18e4f3=_0x32c4[_0x3ad62c];return _0x18e4f3;};'use strict';var config=require(_0x432c('0x0'));var Sequelize=require('sequelize');var _=require(_0x432c('0x1'));var jstz=require('jstz');var timezone=jstz[_0x432c('0x2')]();config[_0x432c('0x3')]=_[_0x432c('0x4')](config[_0x432c('0x3')],{'database':_0x432c('0x5'),'username':_0x432c('0x6'),'password':'xC@LL1234','options':{'host':_0x432c('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x432c('0x8')](),'define':{'charset':_0x432c('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x432c('0x5'),'username':_0x432c('0x6'),'password':_0x432c('0xa'),'options':{'host':_0x432c('0x7'),'port':0xcea,'dialect':_0x432c('0xb'),'dialectOptions':{'charset':_0x432c('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x432c('0x9'),'collate':_0x432c('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x432c('0xe')],config['sequelize']['username'],config['sequelize'][_0x432c('0xf')],config['sequelize'][_0x432c('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x432c('0x11')][_0x432c('0xe')],config[_0x432c('0x11')][_0x432c('0x12')],config[_0x432c('0x11')][_0x432c('0xf')],config[_0x432c('0x11')][_0x432c('0x10')])};db['User']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x14'));db[_0x432c('0x15')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x16'));db[_0x432c('0x17')]=db[_0x432c('0x3')]['import']('../api/voiceContext/voiceContext.model');db[_0x432c('0x18')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db['sequelize']['import'](_0x432c('0x19'));db['VoiceQueue']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x1a'));db['VoiceRecording']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x1b'));db['ScreenRecording']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x1c'));db['VoiceMail']=db['sequelize'][_0x432c('0x13')](_0x432c('0x1d'));db[_0x432c('0x1e')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x1f'));db[_0x432c('0x20')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x21'));db[_0x432c('0x22')]=db[_0x432c('0x3')]['import'](_0x432c('0x23'));db['VoiceAgentReport']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x24'));db['VoiceQueueReport']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x25'));db[_0x432c('0x26')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x27'));db[_0x432c('0x28')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x29'));db[_0x432c('0x2a')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x2b'));db[_0x432c('0x2c')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x432c('0x2d')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x2e'));db['UserChatQueue']=db[_0x432c('0x3')]['import'](_0x432c('0x2f'));db[_0x432c('0x30')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x31'));db['UserFaxQueue']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x32'));db[_0x432c('0x33')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x34'));db[_0x432c('0x35')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x36'));db[_0x432c('0x37')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x38'));db[_0x432c('0x39')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x3a'));db[_0x432c('0x3b')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x3c'));db[_0x432c('0x3d')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x3e'));db[_0x432c('0x3f')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x40'));db['MailSubstatus']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x432c('0x41')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x432c('0x42')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x43'));db['MailApplication']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x44'));db[_0x432c('0x45')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x46'));db[_0x432c('0x47')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x48'));db[_0x432c('0x49')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x4a'));db[_0x432c('0x4b')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x4c'));db['FaxApplication']=db['sequelize']['import'](_0x432c('0x4d'));db[_0x432c('0x4e')]=db['sequelize'][_0x432c('0x13')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x432c('0x3')]['import'](_0x432c('0x4f'));db[_0x432c('0x50')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db['sequelize'][_0x432c('0x13')](_0x432c('0x51'));db[_0x432c('0x52')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x53'));db[_0x432c('0x54')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x55'));db[_0x432c('0x56')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x57'));db[_0x432c('0x58')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/smsMessage/smsMessage.model');db[_0x432c('0x59')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x5a'));db[_0x432c('0x5b')]=db[_0x432c('0x3')]['import'](_0x432c('0x5c'));db['OpenchannelApplication']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x432c('0x5d')]=db['sequelize']['import'](_0x432c('0x5e'));db['OpenchannelMessage']=db['sequelize'][_0x432c('0x13')](_0x432c('0x5f'));db[_0x432c('0x60')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x61'));db[_0x432c('0x62')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x63'));db[_0x432c('0x64')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x65'));db[_0x432c('0x66')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/chatApplication/chatApplication.model');db[_0x432c('0x67')]=db[_0x432c('0x3')]['import'](_0x432c('0x68'));db[_0x432c('0x69')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x6a'));db[_0x432c('0x6b')]=db[_0x432c('0x3')]['import'](_0x432c('0x6c'));db[_0x432c('0x6d')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x6e'));db[_0x432c('0x6f')]=db[_0x432c('0x3')]['import'](_0x432c('0x70'));db[_0x432c('0x71')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x432c('0x72')]=db['sequelize'][_0x432c('0x13')]('../api/cmCompany/cmCompany.model');db[_0x432c('0x73')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x74'));db[_0x432c('0x75')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/cmHopper/cmHopper.model');db[_0x432c('0x76')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x77'));db['CmHopperFinal']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x78'));db[_0x432c('0x79')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x7a'));db[_0x432c('0x7b')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x7c'));db[_0x432c('0x7d')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x7e'));db[_0x432c('0x7f')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x80'));db['Automation']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db['sequelize']['import'](_0x432c('0x81'));db[_0x432c('0x82')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x83'));db[_0x432c('0x84')]=db[_0x432c('0x3')]['import'](_0x432c('0x85'));db[_0x432c('0x86')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x87'));db[_0x432c('0x88')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x89'));db[_0x432c('0x8a')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x8b'));db[_0x432c('0x8c')]=db[_0x432c('0x3')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x432c('0x8d')]=db['sequelize']['import'](_0x432c('0x8e'));db[_0x432c('0x8f')]=db[_0x432c('0x3')]['import'](_0x432c('0x90'));db['Tag']=db[_0x432c('0x3')]['import']('../api/tag/tag.model');db['Template']=db['sequelize'][_0x432c('0x13')]('../api/template/template.model');db['Trigger']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x91'));db[_0x432c('0x92')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/variable/variable.model');db[_0x432c('0x93')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x94'));db[_0x432c('0x95')]=db[_0x432c('0x3')]['import'](_0x432c('0x96'));db['AnalyticCustomReport']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x432c('0x97')]=db['sequelize']['import'](_0x432c('0x98'));db['AnalyticExtractedReport']=db[_0x432c('0x3')]['import'](_0x432c('0x99'));db[_0x432c('0x9a')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x9b'));db['AnalyticFieldReport']=db[_0x432c('0x3')]['import'](_0x432c('0x9c'));db[_0x432c('0x9d')]=db['sequelize'][_0x432c('0x13')](_0x432c('0x9e'));db[_0x432c('0x9f')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xa0'));db[_0x432c('0xa1')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x432c('0xa2')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xa3'));db[_0x432c('0xa4')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xa5'));db['SugarcrmConfiguration']=db[_0x432c('0x3')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x432c('0xa6')]=db['sequelize'][_0x432c('0x13')](_0x432c('0xa7'));db[_0x432c('0xa8')]=db['sequelize'][_0x432c('0x13')](_0x432c('0xa9'));db['DeskConfiguration']=db['sequelize'][_0x432c('0x13')](_0x432c('0xaa'));db[_0x432c('0xab')]=db['sequelize'][_0x432c('0x13')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db['sequelize'][_0x432c('0x13')](_0x432c('0xac'));db[_0x432c('0xad')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xae'));db[_0x432c('0xaf')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb0'));db[_0x432c('0xb1')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb2'));db[_0x432c('0xb3')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb4'));db['ZendeskField']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb5'));db['FreshdeskAccount']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb6'));db[_0x432c('0xb7')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xb8'));db['FreshdeskField']=db['sequelize'][_0x432c('0x13')](_0x432c('0xb9'));db[_0x432c('0xba')]=db[_0x432c('0x3')]['import'](_0x432c('0xbb'));db[_0x432c('0xbc')]=db['sequelize'][_0x432c('0x13')](_0x432c('0xbd'));db[_0x432c('0xbe')]=db[_0x432c('0x3')]['import'](_0x432c('0xbf'));db[_0x432c('0xc0')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xc1'));db[_0x432c('0xc2')]=db[_0x432c('0x3')]['import'](_0x432c('0xc3'));db[_0x432c('0xc4')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xc5'));db[_0x432c('0xc6')]=db[_0x432c('0x3')]['import'](_0x432c('0xc7'));db[_0x432c('0xc8')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xc9'));db[_0x432c('0xca')]=db[_0x432c('0x3')]['import'](_0x432c('0xcb'));db[_0x432c('0xcc')]=db[_0x432c('0x3')]['import'](_0x432c('0xcd'));db['FreshsalesConfiguration']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xce'));db['FreshsalesField']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xcf'));db[_0x432c('0x93')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x94'));db[_0x432c('0xd0')]=db['sequelize']['import']('../api/network/network.model');db[_0x432c('0xd1')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x432c('0xd2')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xd3'));db[_0x432c('0xd4')]=db['sequelize'][_0x432c('0x13')](_0x432c('0xd5'));db['JscriptyQuestionReport']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xd6'));db['SmsQueueReport']=db[_0x432c('0x3')]['import'](_0x432c('0xd7'));db[_0x432c('0xd8')]=db['sequelize'][_0x432c('0x13')]('../api/squareReport/squareReport.model');db[_0x432c('0xd9')]=db['sequelize'][_0x432c('0x13')](_0x432c('0xda'));db[_0x432c('0xdb')]=db[_0x432c('0x3')]['import'](_0x432c('0xdc'));db['Setting']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xdd'));db[_0x432c('0xde')]=db[_0x432c('0x3')]['import'](_0x432c('0xdf'));db['SquareProject']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/squareProject/squareProject.model');db[_0x432c('0xe0')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xe1'));db['SquareMessage']=db[_0x432c('0x3')]['import'](_0x432c('0xe2'));db[_0x432c('0xe3')]=db[_0x432c('0x3')]['import'](_0x432c('0xe4'));db[_0x432c('0xe5')]=db[_0x432c('0x3')]['import'](_0x432c('0xe6'));db['Campaign']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xe7'));db[_0x432c('0xe8')]=db['sequelize'][_0x432c('0x13')]('../api/migration/migration.model');db[_0x432c('0xe9')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x432c('0xea')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xeb'));db[_0x432c('0xec')]=db[_0x432c('0x3')]['import'](_0x432c('0xed'));db[_0x432c('0xee')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xef'));db['FaxTransferReport']=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x432c('0xf0')]=db['sequelize'][_0x432c('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x432c('0xf1')]=db['sequelize'][_0x432c('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x432c('0xf2')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xf3'));db['VoicePrefix']=db[_0x432c('0x3')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x432c('0xf4')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xf5'));db[_0x432c('0xf6')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xf7'));db['UserProfileResource']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xf8'));db[_0x432c('0xf9')]=db['sequelize'][_0x432c('0x13')]('../api/userNotification/userNotification.model');db[_0x432c('0xfa')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x432c('0xfb')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xfc'));db[_0x432c('0xfd')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0xfe'));db[_0x432c('0xff')]=db[_0x432c('0x3')][_0x432c('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x432c('0x3')][_0x432c('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x432c('0x100')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x101'));db['CloudProvider']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x102'));db['TeamVoiceQueue']=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x103'));db[_0x432c('0x104')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x105'));db[_0x432c('0x106')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x107'));db[_0x432c('0x108')]=db[_0x432c('0x3')][_0x432c('0x13')](_0x432c('0x109'));db[_0x432c('0x10a')]['hasOne'](db['VoiceMail'],{'as':_0x432c('0x10b'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x10e')](db[_0x432c('0x108')],{'as':_0x432c('0x10f'),'onDelete':_0x432c('0x10c'),'foreignKey':'UserId'});db[_0x432c('0x10a')][_0x432c('0x110')](db['VoiceRecording'],{'as':_0x432c('0x111'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x2c')],{'as':_0x432c('0x112'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x18')],{'as':_0x432c('0x113'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x10a')]['hasMany'](db[_0x432c('0x114')],{'as':_0x432c('0x115'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x79')],{'as':'HopperHistory','foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x5d')],{'as':_0x432c('0x116'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0x67')],{'as':_0x432c('0x117'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db['SmsInteraction'],{'as':_0x432c('0x118'),'foreignKey':_0x432c('0x10d')});db['User'][_0x432c('0x110')](db['FaxInteraction'],{'as':_0x432c('0x119'),'foreignKey':'UserId'});db[_0x432c('0x10a')][_0x432c('0x110')](db['MailInteraction'],{'as':_0x432c('0x11a'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db[_0x432c('0xfd')],{'as':_0x432c('0x11b'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x10a')][_0x432c('0x110')](db['UserNotification'],{'as':_0x432c('0x11c'),'foreignKey':_0x432c('0x11d')});db[_0x432c('0x10a')][_0x432c('0x11e')](db[_0x432c('0xf4')],{'as':_0x432c('0xf4'),'foreignKey':'userProfileId'});db[_0x432c('0x10a')]['belongsToMany'](db[_0x432c('0x6f')],{'as':_0x432c('0x11f'),'through':'chat_group_has_users'});db[_0x432c('0x10a')]['belongsToMany'](db[_0x432c('0x73')],{'as':_0x432c('0x120'),'through':_0x432c('0x121')});db[_0x432c('0x10a')]['belongsToMany'](db[_0x432c('0xf2')],{'as':_0x432c('0x122'),'through':'cm_user_has_lists'});db['User'][_0x432c('0x123')](db[_0x432c('0xe3')],{'through':_0x432c('0x124')});db[_0x432c('0x10a')]['belongsToMany'](db['MailInteraction'],{'as':_0x432c('0x11a'),'through':_0x432c('0x125')});db[_0x432c('0x10a')][_0x432c('0x123')](db['ChatInteraction'],{'as':_0x432c('0x117'),'through':_0x432c('0x126')});db[_0x432c('0x10a')][_0x432c('0x123')](db['FaxInteraction'],{'as':_0x432c('0x119'),'through':_0x432c('0x127')});db['User'][_0x432c('0x123')](db[_0x432c('0x56')],{'as':_0x432c('0x118'),'through':_0x432c('0x128')});db[_0x432c('0x10a')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x432c('0x116'),'through':_0x432c('0x129')});db['User'][_0x432c('0x123')](db[_0x432c('0xfd')],{'as':_0x432c('0x11b'),'through':'user_has_whatsapp_interactions'});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x12a')],{'as':_0x432c('0x12b'),'through':_0x432c('0x2d'),'required':![]});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x12c')],{'as':_0x432c('0x12d'),'through':_0x432c('0x106'),'required':![]});db['User'][_0x432c('0x123')](db[_0x432c('0x3f')],{'as':_0x432c('0x12e'),'through':_0x432c('0x30'),'required':![]});db['User'][_0x432c('0x123')](db[_0x432c('0x6d')],{'as':_0x432c('0x12f'),'through':_0x432c('0x130'),'required':![],'hooks':!![]});db['User'][_0x432c('0x123')](db[_0x432c('0x50')],{'as':_0x432c('0x131'),'through':_0x432c('0x132'),'required':![]});db[_0x432c('0x10a')]['belongsToMany'](db['SmsQueue'],{'as':'SmsQueues','through':_0x432c('0x33'),'required':![]});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x60')],{'as':_0x432c('0x133'),'through':_0x432c('0x35'),'required':![]});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x100')],{'as':'WhatsappQueues','through':_0x432c('0x37'),'required':![]});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0xf2')],{'through':_0x432c('0x134')});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x62')],{'as':_0x432c('0x135'),'through':'user_has_chat_websites'});db['User'][_0x432c('0x123')](db[_0x432c('0x4b')],{'as':_0x432c('0x136'),'through':_0x432c('0x137')});db[_0x432c('0x10a')][_0x432c('0x123')](db['MailAccount'],{'as':'MailAccounts','through':_0x432c('0x138')});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x5b')],{'as':_0x432c('0x139'),'through':'user_has_openchannel_accounts'});db[_0x432c('0x10a')][_0x432c('0x123')](db[_0x432c('0x52')],{'as':_0x432c('0x13a'),'through':_0x432c('0x13b')});db[_0x432c('0x10a')][_0x432c('0x123')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x432c('0x13c')});db['User'][_0x432c('0x123')](db[_0x432c('0x13d')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x432c('0x15')][_0x432c('0x110')](db[_0x432c('0x18')],{'as':_0x432c('0x13e'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x13f')});db[_0x432c('0x17')][_0x432c('0x110')](db[_0x432c('0x18')],{'onDelete':_0x432c('0x10c')});db['VoiceExtension'][_0x432c('0x110')](db[_0x432c('0x18')],{'as':_0x432c('0x140'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x432c('0x8f')],{'as':_0x432c('0x141'),'through':'moh_has_sounds'});db[_0x432c('0x12a')][_0x432c('0x110')](db['UserVoiceQueueRt'],{'as':_0x432c('0x142'),'foreignKey':'VoiceQueueId'});db[_0x432c('0x12a')][_0x432c('0x110')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x432c('0x12a')][_0x432c('0x110')](db[_0x432c('0x114')],{'as':_0x432c('0x115'),'foreignKey':_0x432c('0x143')});db['VoiceQueue'][_0x432c('0x110')](db[_0x432c('0x79')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0x432c('0x12a')][_0x432c('0x110')](db[_0x432c('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x432c('0x143')});db['VoiceQueue'][_0x432c('0x110')](db[_0x432c('0x76')],{'as':_0x432c('0x144'),'foreignKey':'VoiceQueueId'});db[_0x432c('0x12a')][_0x432c('0x110')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x432c('0x143')});db[_0x432c('0x12a')][_0x432c('0x11e')](db[_0x432c('0x28')],{'as':_0x432c('0x28'),'foreignKey':_0x432c('0x145')});db[_0x432c('0x12a')][_0x432c('0x11e')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x432c('0x12a')][_0x432c('0x11e')](db[_0x432c('0x86')],{'as':_0x432c('0x86'),'foreignKey':_0x432c('0x146')});db[_0x432c('0x12a')][_0x432c('0x11e')](db['Pause'],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0x12a')][_0x432c('0x123')](db['CmList'],{'as':_0x432c('0x122'),'through':_0x432c('0x149')});db[_0x432c('0x12a')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x2d')});db[_0x432c('0x12a')][_0x432c('0x123')](db[_0x432c('0xe3')],{'as':'Teams','through':_0x432c('0x14b')});db[_0x432c('0x12a')][_0x432c('0x123')](db['CmList'],{'as':_0x432c('0x14c'),'through':_0x432c('0x14d')});db['VoiceRecording'][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':'User','foreignKey':_0x432c('0x10d')});db['ScreenRecording'][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x10a'),'foreignKey':_0x432c('0x10d')});db['VoiceMail']['hasMany'](db[_0x432c('0x1e')],{'as':_0x432c('0x14e'),'onDelete':_0x432c('0x10c'),'foreignKey':'mailboxuser','sourceKey':_0x432c('0x14f')});db[_0x432c('0x1e')]['belongsTo'](db[_0x432c('0x10b')],{'foreignKey':_0x432c('0x150'),'targetKey':'mailbox'});db[_0x432c('0x20')][_0x432c('0x110')](db[_0x432c('0x151')],{'as':_0x432c('0x152'),'foreignKey':_0x432c('0x153'),'constraints':![]});db[_0x432c('0x20')][_0x432c('0x110')](db[_0x432c('0x154')],{'as':_0x432c('0x155'),'foreignKey':_0x432c('0x153'),'constraints':![]});db['VoiceCallReport'][_0x432c('0x11e')](db['User'],{'as':_0x432c('0x10a'),'foreignKey':'UserId'});db[_0x432c('0x20')][_0x432c('0x11e')](db['CmContact'],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db['MailServerIn'][_0x432c('0x11e')](db[_0x432c('0x3d')],{'as':_0x432c('0x3d'),'foreignKey':'MailAccountId'});db[_0x432c('0x39')][_0x432c('0x11e')](db['CloudProvider'],{'as':_0x432c('0x158'),'foreignKey':_0x432c('0x159'),'onDelete':_0x432c('0x15a')});db[_0x432c('0x3b')][_0x432c('0x11e')](db[_0x432c('0x3d')],{'as':_0x432c('0x3d'),'foreignKey':_0x432c('0x15b')});db[_0x432c('0x3b')][_0x432c('0x11e')](db['CloudProvider'],{'as':_0x432c('0x158'),'foreignKey':_0x432c('0x159'),'onDelete':'restrict'});db[_0x432c('0x3d')]['hasOne'](db[_0x432c('0x39')],{'as':'Imap','onDelete':_0x432c('0x10c')});db['MailAccount'][_0x432c('0x10e')](db[_0x432c('0x3b')],{'as':_0x432c('0x15c'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x3d')][_0x432c('0x110')](db['Disposition'],{'as':_0x432c('0x15d'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x432c('0x3d')][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':_0x432c('0x15f'),'foreignKey':_0x432c('0x15b')});db[_0x432c('0x3d')][_0x432c('0x110')](db[_0x432c('0x42')],{'as':_0x432c('0x14e'),'foreignKey':_0x432c('0x15b')});db[_0x432c('0x3d')][_0x432c('0x110')](db[_0x432c('0x41')],{'as':'Interactions'});db[_0x432c('0x3d')][_0x432c('0x110')](db['MailApplication'],{'as':'Applications'});db[_0x432c('0x3d')]['belongsTo'](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db['MailAccount'][_0x432c('0x11e')](db[_0x432c('0x162')],{'as':_0x432c('0x162'),'foreignKey':_0x432c('0x163')});db[_0x432c('0x3d')]['belongsTo'](db[_0x432c('0x88')],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db['MailAccount'][_0x432c('0x123')](db['User'],{'as':_0x432c('0x14a'),'through':'user_has_mail_accounts'});db[_0x432c('0x3f')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x30')});db[_0x432c('0x3f')][_0x432c('0x123')](db['Team'],{'through':_0x432c('0x164'),'as':_0x432c('0x165')});db[_0x432c('0x41')]['hasMany'](db[_0x432c('0x42')],{'as':'Messages','onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x166')});db[_0x432c('0x41')]['belongsTo'](db[_0x432c('0x3d')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x15b')});db[_0x432c('0x41')]['belongsTo'](db[_0x432c('0x73')],{'as':'Contact','foreignKey':_0x432c('0x157')});db[_0x432c('0x41')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x168'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x41')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x16a'),'as':_0x432c('0x16b')});db[_0x432c('0x41')][_0x432c('0x123')](db['Tag'],{'through':_0x432c('0x16a'),'as':'ThroughTags'});db['MailInteraction'][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x16c'),'through':_0x432c('0x125'),'foreignKey':_0x432c('0x166')});db['MailMessage'][_0x432c('0x110')](db['Attachment'],{'as':_0x432c('0x16d'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x42')]['belongsTo'](db[_0x432c('0x10a')],{'as':_0x432c('0x10a')});db[_0x432c('0x42')][_0x432c('0x11e')](db[_0x432c('0x73')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x156')});db[_0x432c('0x42')][_0x432c('0x11e')](db['MailInteraction'],{'as':_0x432c('0x16e'),'foreignKey':_0x432c('0x166')});db[_0x432c('0x42')][_0x432c('0x11e')](db[_0x432c('0x3d')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x15b')});db[_0x432c('0x42')]['belongsTo'](db['ChatWebsite'],{'as':_0x432c('0x62'),'foreignKey':_0x432c('0x16f')});db[_0x432c('0x42')][_0x432c('0x11e')](db['ChatOfflineMessage'],{'as':_0x432c('0x6b'),'foreignKey':_0x432c('0x170')});db[_0x432c('0x171')][_0x432c('0x11e')](db['User'],{'onDelete':'restrict'});db[_0x432c('0x171')]['belongsTo'](db['MailQueue'],{'onDelete':_0x432c('0x15a')});db[_0x432c('0x171')][_0x432c('0x11e')](db[_0x432c('0x3d')],{'onDelete':'restrict'});db['MailApplication'][_0x432c('0x11e')](db[_0x432c('0x86')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x146')});db[_0x432c('0x171')][_0x432c('0x11e')](db[_0x432c('0x169')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0x432c('0x11e')](db[_0x432c('0x3d')],{});db[_0x432c('0x45')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':'List','foreignKey':_0x432c('0x161')});db[_0x432c('0x45')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x45')][_0x432c('0x11e')](db[_0x432c('0x41')],{});db['MailQueueReport'][_0x432c('0x11e')](db[_0x432c('0x42')],{});db[_0x432c('0x45')][_0x432c('0x11e')](db[_0x432c('0x10a')],{});db[_0x432c('0x45')][_0x432c('0x11e')](db['MailQueue'],{});db[_0x432c('0x47')][_0x432c('0x110')](db[_0x432c('0x49')],{'as':_0x432c('0x172'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x4b')][_0x432c('0x110')](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x173'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x4b')][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':_0x432c('0x15f'),'foreignKey':_0x432c('0x173')});db[_0x432c('0x4b')][_0x432c('0x110')](db[_0x432c('0x4e')],{'as':_0x432c('0x174')});db[_0x432c('0x4b')][_0x432c('0x110')](db[_0x432c('0x175')],{'as':'Applications'});db[_0x432c('0x4b')]['hasMany'](db[_0x432c('0x18')],{'as':_0x432c('0x176'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x4b')][_0x432c('0x110')](db['FaxMessage'],{'as':_0x432c('0x14e')});db[_0x432c('0x4b')][_0x432c('0x11e')](db[_0x432c('0x28')],{'as':_0x432c('0x28')});db[_0x432c('0x4b')]['belongsTo'](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db[_0x432c('0x4b')][_0x432c('0x11e')](db[_0x432c('0x88')],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0x4b')]['belongsToMany'](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x137')});db['FaxApplication']['belongsTo'](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x15a')});db['FaxApplication']['belongsTo'](db[_0x432c('0x50')],{'onDelete':_0x432c('0x15a')});db['FaxApplication'][_0x432c('0x11e')](db[_0x432c('0x4b')],{'onDelete':_0x432c('0x15a')});db[_0x432c('0x175')][_0x432c('0x11e')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x432c('0x177')});db['FaxInteraction'][_0x432c('0x110')](db[_0x432c('0x178')],{'as':_0x432c('0x14e'),'onDelete':'cascade','foreignKey':_0x432c('0x179')});db[_0x432c('0x4e')][_0x432c('0x11e')](db['FaxAccount'],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x173')});db[_0x432c('0x4e')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x4e')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x168'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x4e')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x17a'),'as':_0x432c('0x16b')});db[_0x432c('0x4e')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x17a'),'as':_0x432c('0x17b')});db[_0x432c('0x4e')][_0x432c('0x123')](db['User'],{'as':_0x432c('0x16c'),'through':'user_has_fax_interactions','foreignKey':_0x432c('0x179')});db[_0x432c('0x178')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x10a')});db['FaxMessage'][_0x432c('0x11e')](db[_0x432c('0x4e')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0x432c('0x73')],{'onDelete':'cascade','as':_0x432c('0x156')});db['FaxMessage']['belongsTo'](db[_0x432c('0xe9')],{'as':_0x432c('0xe9'),'foreignKey':_0x432c('0x17c')});db[_0x432c('0x178')][_0x432c('0x11e')](db[_0x432c('0x4b')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x173')});db[_0x432c('0x50')]['belongsToMany'](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x132')});db[_0x432c('0x50')][_0x432c('0x123')](db[_0x432c('0xe3')],{'through':_0x432c('0x17d'),'as':_0x432c('0x165')});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0x4b')],{});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0x432c('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':_0x432c('0x157')});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0x4e')],{});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0x178')],{});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0x10a')],{});db[_0x432c('0x17e')][_0x432c('0x11e')](db[_0x432c('0x50')],{});db[_0x432c('0x52')][_0x432c('0x110')](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x17f'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x52')][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':_0x432c('0x15f'),'foreignKey':_0x432c('0x17f')});db['SmsAccount']['hasMany'](db[_0x432c('0x58')],{'as':_0x432c('0x14e'),'foreignKey':_0x432c('0x17f')});db[_0x432c('0x52')]['hasMany'](db[_0x432c('0x56')],{'as':'Interactions'});db[_0x432c('0x52')][_0x432c('0x110')](db[_0x432c('0x54')],{'as':_0x432c('0x140')});db[_0x432c('0x52')][_0x432c('0x11e')](db['CmList'],{'as':_0x432c('0x160'),'foreignKey':'ListId'});db[_0x432c('0x52')]['belongsTo'](db[_0x432c('0x88')],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0x52')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x13b')});db[_0x432c('0x54')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x15a')});db[_0x432c('0x54')][_0x432c('0x11e')](db['SmsQueue'],{'onDelete':_0x432c('0x15a')});db[_0x432c('0x54')][_0x432c('0x11e')](db[_0x432c('0x52')],{'onDelete':_0x432c('0x15a')});db['SmsApplication'][_0x432c('0x11e')](db[_0x432c('0x86')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x146')});db['SmsApplication'][_0x432c('0x11e')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0x432c('0x110')](db[_0x432c('0x58')],{'as':_0x432c('0x14e'),'onDelete':_0x432c('0x10c'),'foreignKey':'SmsInteractionId'});db[_0x432c('0x56')][_0x432c('0x11e')](db[_0x432c('0x52')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x17f')});db[_0x432c('0x56')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x56')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x168'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x56')]['belongsToMany'](db[_0x432c('0x169')],{'through':_0x432c('0x180'),'as':_0x432c('0x16b')});db[_0x432c('0x56')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x180'),'as':_0x432c('0x17b')});db[_0x432c('0x56')][_0x432c('0x123')](db['User'],{'as':_0x432c('0x16c'),'through':_0x432c('0x128'),'foreignKey':_0x432c('0x181')});db[_0x432c('0x58')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x10a')});db[_0x432c('0x58')][_0x432c('0x11e')](db['CmContact'],{'onDelete':'cascade','as':_0x432c('0x156')});db[_0x432c('0x58')][_0x432c('0x11e')](db[_0x432c('0x56')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x16e'),'foreignKey':_0x432c('0x181')});db[_0x432c('0x58')][_0x432c('0x11e')](db[_0x432c('0x52')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x17f')});db['SmsQueue'][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x33'),'foreignKey':_0x432c('0x182')});db[_0x432c('0x59')][_0x432c('0x123')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db[_0x432c('0x5b')][_0x432c('0x110')](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x183'),'onDelete':_0x432c('0x10c')});db['OpenchannelAccount'][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':'Answers','foreignKey':_0x432c('0x183')});db['OpenchannelAccount'][_0x432c('0x110')](db[_0x432c('0x5d')],{'as':_0x432c('0x174'),'foreignKey':_0x432c('0x183')});db['OpenchannelAccount'][_0x432c('0x110')](db[_0x432c('0x184')],{'as':_0x432c('0x14e'),'foreignKey':_0x432c('0x183')});db[_0x432c('0x5b')][_0x432c('0x110')](db['OpenchannelApplication'],{'as':_0x432c('0x140'),'foreignKey':_0x432c('0x183')});db[_0x432c('0x5b')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x432c('0x11e')](db[_0x432c('0x88')],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0x5b')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x185')});db[_0x432c('0x186')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x15a')});db[_0x432c('0x186')][_0x432c('0x11e')](db[_0x432c('0x60')],{'onDelete':_0x432c('0x15a'),'foreignKey':'OpenchannelQueueId'});db[_0x432c('0x186')][_0x432c('0x11e')](db['OpenchannelAccount'],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x183')});db[_0x432c('0x186')]['belongsTo'](db[_0x432c('0x86')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x146')});db[_0x432c('0x186')][_0x432c('0x11e')](db[_0x432c('0x169')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x177')});db[_0x432c('0x5d')]['hasMany'](db[_0x432c('0x184')],{'as':_0x432c('0x14e'),'onDelete':'cascade','foreignKey':_0x432c('0x187')});db['OpenchannelInteraction'][_0x432c('0x11e')](db[_0x432c('0x5b')],{'as':_0x432c('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x432c('0x5d')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0x432c('0x5d')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x168'),'foreignKey':_0x432c('0x10d')});db['OpenchannelInteraction'][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0x432c('0x123')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x432c('0x17b')});db[_0x432c('0x5d')]['belongsToMany'](db['User'],{'as':_0x432c('0x16c'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x432c('0x184')][_0x432c('0x11e')](db['User'],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x10a')});db[_0x432c('0x184')][_0x432c('0x11e')](db[_0x432c('0x73')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x156')});db[_0x432c('0x184')]['belongsTo'](db[_0x432c('0x5d')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x16e'),'foreignKey':_0x432c('0x187')});db[_0x432c('0x184')][_0x432c('0x11e')](db[_0x432c('0xe9')],{'as':_0x432c('0xe9'),'foreignKey':_0x432c('0x17c')});db[_0x432c('0x184')]['belongsTo'](db[_0x432c('0x5b')],{'as':_0x432c('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x432c('0x60')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x35'),'foreignKey':'OpenchannelQueueId'});db[_0x432c('0x60')][_0x432c('0x123')](db[_0x432c('0xe3')],{'through':_0x432c('0x189'),'as':_0x432c('0x165')});db['ChatWebsite']['hasMany'](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x16f'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x62')][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':_0x432c('0x15f'),'foreignKey':_0x432c('0x16f')});db[_0x432c('0x62')][_0x432c('0x110')](db[_0x432c('0x71')],{'as':_0x432c('0x18a')});db[_0x432c('0x62')][_0x432c('0x110')](db['ChatInteraction'],{'as':_0x432c('0x174')});db[_0x432c('0x62')][_0x432c('0x110')](db[_0x432c('0x66')],{'as':_0x432c('0x140')});db[_0x432c('0x62')][_0x432c('0x110')](db[_0x432c('0x69')],{'as':_0x432c('0x14e')});db[_0x432c('0x62')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db[_0x432c('0x62')][_0x432c('0x11e')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0x432c('0x62')]['belongsTo'](db[_0x432c('0x3d')],{'as':_0x432c('0x3d'),'foreignKey':'MailAccountId'});db[_0x432c('0x62')][_0x432c('0x11e')](db[_0x432c('0x88')],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0x62')][_0x432c('0x123')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x432c('0x64')][_0x432c('0x11e')](db[_0x432c('0x5b')],{});db[_0x432c('0x64')]['belongsTo'](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db[_0x432c('0x64')][_0x432c('0x11e')](db['CmContact'],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db['OpenchannelQueueReport'][_0x432c('0x11e')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x432c('0x11e')](db[_0x432c('0x184')],{});db[_0x432c('0x64')][_0x432c('0x11e')](db['User'],{});db[_0x432c('0x64')][_0x432c('0x11e')](db['OpenchannelQueue'],{});db[_0x432c('0x66')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x18b'),'foreignKey':_0x432c('0x10d'),'onDelete':_0x432c('0x15a')});db[_0x432c('0x66')][_0x432c('0x11e')](db[_0x432c('0x6d')],{'as':'Queue','foreignKey':_0x432c('0x18c'),'onDelete':_0x432c('0x15a')});db['ChatApplication']['belongsTo'](db[_0x432c('0x62')],{'as':_0x432c('0x18d'),'foreignKey':_0x432c('0x16f'),'onDelete':_0x432c('0x15a')});db[_0x432c('0x66')][_0x432c('0x11e')](db[_0x432c('0x169')],{'onDelete':'restrict','foreignKey':_0x432c('0x177')});db[_0x432c('0x67')]['hasMany'](db[_0x432c('0x69')],{'as':_0x432c('0x14e'),'onDelete':_0x432c('0x10c'),'foreignKey':'ChatInteractionId'});db[_0x432c('0x67')][_0x432c('0x11e')](db[_0x432c('0x62')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x16f')});db[_0x432c('0x67')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':'Contact','foreignKey':_0x432c('0x157')});db[_0x432c('0x67')][_0x432c('0x11e')](db['User'],{'as':_0x432c('0x168'),'foreignKey':_0x432c('0x10d')});db[_0x432c('0x67')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x18e'),'as':_0x432c('0x16b')});db[_0x432c('0x67')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x18e'),'as':'ThroughTags'});db['ChatInteraction'][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x16c'),'through':_0x432c('0x126'),'foreignKey':'ChatInteractionId'});db[_0x432c('0x69')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x10a')});db['ChatMessage'][_0x432c('0x11e')](db[_0x432c('0x73')],{'onDelete':'cascade','as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db['ChatMessage'][_0x432c('0x11e')](db[_0x432c('0x67')],{'onDelete':_0x432c('0x10c'),'as':'Interaction','foreignKey':_0x432c('0x18f')});db[_0x432c('0x69')][_0x432c('0x11e')](db[_0x432c('0xe9')],{'as':_0x432c('0xe9'),'foreignKey':'AttachmentId'});db[_0x432c('0x69')][_0x432c('0x11e')](db[_0x432c('0x62')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x16f')});db['ChatOfflineMessage']['hasMany'](db[_0x432c('0xe9')],{'as':_0x432c('0x16d'),'foreignKey':_0x432c('0x170'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x6b')][_0x432c('0x11e')](db[_0x432c('0x73')],{'onDelete':_0x432c('0x10c'),'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x6b')][_0x432c('0x11e')](db[_0x432c('0x62')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x16f')});db['ChatQueue'][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x130'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x432c('0xe3')],{'through':_0x432c('0x190'),'as':'Teams'});db[_0x432c('0x6f')][_0x432c('0x110')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x432c('0x10c')});db[_0x432c('0x6f')]['belongsToMany'](db[_0x432c('0x10a')],{'as':_0x432c('0x142'),'through':_0x432c('0x191')});db[_0x432c('0x71')][_0x432c('0x11e')](db[_0x432c('0x62')],{'as':_0x432c('0x18d'),'foreignKey':_0x432c('0x16f')});db[_0x432c('0x72')][_0x432c('0x110')](db[_0x432c('0x73')],{'as':_0x432c('0x120'),'foreignKey':_0x432c('0x192')});db['CmContact']['hasMany'](db[_0x432c('0x75')],{'as':_0x432c('0x193'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x73')]['hasMany'](db[_0x432c('0x114')],{'as':_0x432c('0x115'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x73')]['hasMany'](db['CmHopperHistory'],{'as':_0x432c('0x194'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x73')][_0x432c('0x110')](db[_0x432c('0x7b')],{'as':_0x432c('0x7b'),'foreignKey':_0x432c('0x157')});db['CmContact'][_0x432c('0x110')](db[_0x432c('0x195')],{'as':_0x432c('0x196'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x73')][_0x432c('0x110')](db[_0x432c('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x432c('0x15a')});db['CmContact'][_0x432c('0x110')](db[_0x432c('0x67')],{'as':'ChatInteractions','foreignKey':_0x432c('0x157'),'onDelete':_0x432c('0x15a')});db['CmContact'][_0x432c('0x110')](db[_0x432c('0x56')],{'as':'SmsInteractions','foreignKey':_0x432c('0x157'),'onDelete':_0x432c('0x15a')});db['CmContact']['hasMany'](db[_0x432c('0x4e')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x432c('0x73')][_0x432c('0x110')](db['MailInteraction'],{'as':_0x432c('0x11a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x432c('0x73')][_0x432c('0x11e')](db[_0x432c('0x72')],{'as':_0x432c('0x197'),'foreignKey':_0x432c('0x192')});db[_0x432c('0x73')][_0x432c('0x11e')](db['CmList'],{'as':'List','foreignKey':_0x432c('0x161'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x73')]['belongsToMany'](db[_0x432c('0x10a')],{'as':_0x432c('0x16c'),'through':_0x432c('0x121')});db[_0x432c('0x73')][_0x432c('0x123')](db[_0x432c('0x169')],{'as':_0x432c('0x16b'),'through':_0x432c('0x198')});db[_0x432c('0x73')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x198'),'as':_0x432c('0x17b')});db[_0x432c('0x75')][_0x432c('0x11e')](db['CmContact'],{'as':_0x432c('0x156'),'foreignKey':'ContactId','onDelete':_0x432c('0x10c')});db[_0x432c('0x75')][_0x432c('0x11e')](db['CmList'],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161'),'onDelete':'cascade'});db[_0x432c('0x75')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':'Agent','foreignKey':_0x432c('0x10d')});db[_0x432c('0x75')]['belongsTo'](db[_0x432c('0x12a')],{'as':'Queue','foreignKey':_0x432c('0x143'),'onDelete':'cascade'});db[_0x432c('0x75')]['belongsTo'](db[_0x432c('0x199')],{'as':_0x432c('0x199'),'foreignKey':_0x432c('0x19a'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x75')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':'Owner','foreignKey':_0x432c('0x19b')});db['CmHopperBlack']['belongsTo'](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x76')][_0x432c('0x11e')](db['CmList'],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161'),'onDelete':_0x432c('0x10c')});db['CmHopperBlack'][_0x432c('0x11e')](db[_0x432c('0x12a')],{'as':'Queue','foreignKey':_0x432c('0x143'),'onDelete':'cascade'});db[_0x432c('0x76')][_0x432c('0x11e')](db[_0x432c('0x199')],{'as':_0x432c('0x199'),'foreignKey':_0x432c('0x19a'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x19c')][_0x432c('0x110')](db[_0x432c('0x84')],{'as':{'plural':_0x432c('0x19d'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x19c')][_0x432c('0x110')](db[_0x432c('0x84')],{'as':{'plural':_0x432c('0x19e'),'singular':_0x432c('0x19f')},'foreignKey':_0x432c('0x1a0'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db['Automation'][_0x432c('0x110')](db[_0x432c('0x7f')],{'as':_0x432c('0x1a1'),'foreignKey':'AutomationId','onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x82')]['hasMany'](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x1a2'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x86')][_0x432c('0x110')](db[_0x432c('0x86')],{'as':'Intervals','foreignKey':_0x432c('0x146'),'onDelete':_0x432c('0x10c'),'hooks':!![],'required':![]});db['Interval'][_0x432c('0x110')](db[_0x432c('0x18')],{'as':'Extensions','foreignKey':_0x432c('0x146'),'onDelete':_0x432c('0x15a')});db[_0x432c('0x86')][_0x432c('0x110')](db['MailApplication'],{'as':_0x432c('0x1a3'),'foreignKey':_0x432c('0x146')});db[_0x432c('0x86')][_0x432c('0x110')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x432c('0x146')});db[_0x432c('0x86')][_0x432c('0x110')](db[_0x432c('0x175')],{'as':_0x432c('0x1a4'),'foreignKey':_0x432c('0x146')});db['Interval'][_0x432c('0x110')](db[_0x432c('0x54')],{'as':_0x432c('0x1a5'),'foreignKey':'IntervalId'});db[_0x432c('0x8d')][_0x432c('0x11e')](db[_0x432c('0x3d')],{});db[_0x432c('0x8d')][_0x432c('0x11e')](db['AnalyticDefaultReport'],{'foreignKey':_0x432c('0x1a6')});db[_0x432c('0x8d')][_0x432c('0x11e')](db[_0x432c('0x1a7')],{'foreignKey':_0x432c('0x1a8')});db[_0x432c('0x8f')][_0x432c('0x123')](db[_0x432c('0x1a9')],{'as':_0x432c('0x1aa'),'through':_0x432c('0x1ab'),'onDelete':_0x432c('0x15a')});db[_0x432c('0x169')]['belongsToMany'](db[_0x432c('0x73')],{'through':_0x432c('0x198')});db[_0x432c('0x169')]['belongsToMany'](db[_0x432c('0x67')],{'through':_0x432c('0x18e')});db['Tag'][_0x432c('0x123')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x432c('0x56')],{'through':_0x432c('0x180')});db[_0x432c('0x169')][_0x432c('0x123')](db[_0x432c('0x4e')],{'through':_0x432c('0x17a')});db['Tag'][_0x432c('0x123')](db[_0x432c('0x5d')],{'through':_0x432c('0x188')});db[_0x432c('0x169')][_0x432c('0x123')](db[_0x432c('0xfd')],{'through':'whatsapp_interaction_has_tags'});db[_0x432c('0x1ac')][_0x432c('0x110')](db[_0x432c('0x84')],{'as':{'plural':_0x432c('0x1ad'),'singular':'AllCondition'},'foreignKey':_0x432c('0x1ae'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x1ac')][_0x432c('0x110')](db['Condition'],{'as':{'plural':_0x432c('0x1af'),'singular':_0x432c('0x1b0')},'foreignKey':_0x432c('0x1b1'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x1ac')]['hasMany'](db[_0x432c('0x7f')],{'as':_0x432c('0x1a1'),'foreignKey':_0x432c('0x1b2'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x1a7')][_0x432c('0x110')](db[_0x432c('0x1b3')],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1a8'),'hooks':!![]});db['AnalyticDefaultReport'][_0x432c('0x110')](db[_0x432c('0x1b3')],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':'DefaultReportId'});db[_0x432c('0x9a')][_0x432c('0x110')](db['AnalyticFieldReport'],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b5')});db['AnalyticFieldReport'][_0x432c('0x11e')](db[_0x432c('0x9a')],{'foreignKey':_0x432c('0x1b5')});db[_0x432c('0x9f')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x432c('0x1b6'),'onDelete':'cascade','foreignKey':_0x432c('0x1b7')});db[_0x432c('0xa1')][_0x432c('0x110')](db[_0x432c('0xa2')],{'as':_0x432c('0x1b8'),'onDelete':'cascade','foreignKey':_0x432c('0x1b9')});db[_0x432c('0xa1')]['hasMany'](db[_0x432c('0xa2')],{'as':_0x432c('0x1ba'),'onDelete':'cascade','foreignKey':_0x432c('0x1bb')});db[_0x432c('0xa1')]['hasMany'](db['SalesforceField'],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bc')});db[_0x432c('0xa1')]['belongsTo'](db[_0x432c('0x9f')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xa2')][_0x432c('0x110')](db[_0x432c('0xa2')],{'as':_0x432c('0x1bd'),'foreignKey':_0x432c('0x1b9')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db['SalesforceField'][_0x432c('0x110')](db['SalesforceField'],{'as':'Field','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xa2')]['belongsTo'](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db[_0x432c('0xa4')]['hasMany'](db[_0x432c('0x1c0')],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0x1c0')][_0x432c('0x110')](db[_0x432c('0xa6')],{'as':_0x432c('0x1b8'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b9')});db['SugarcrmConfiguration'][_0x432c('0x110')](db[_0x432c('0xa6')],{'as':_0x432c('0x1ba'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0x1c0')][_0x432c('0x110')](db[_0x432c('0xa6')],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bc')});db['SugarcrmConfiguration'][_0x432c('0x11e')](db[_0x432c('0xa4')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xa6')][_0x432c('0x110')](db[_0x432c('0xa6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x432c('0xa6')][_0x432c('0x110')](db[_0x432c('0xa6')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xa6')][_0x432c('0x110')](db['SugarcrmField'],{'as':'Field','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xa6')]['belongsTo'](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db[_0x432c('0xa8')][_0x432c('0x110')](db[_0x432c('0x1c1')],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0x1c1')][_0x432c('0x110')](db[_0x432c('0xab')],{'as':_0x432c('0x1b8'),'onDelete':'cascade','foreignKey':_0x432c('0x1b9')});db['DeskConfiguration'][_0x432c('0x110')](db[_0x432c('0xab')],{'as':_0x432c('0x1ba'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bb')});db['DeskConfiguration'][_0x432c('0x110')](db[_0x432c('0xab')],{'as':'Fields','onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bc')});db[_0x432c('0x1c1')][_0x432c('0x11e')](db[_0x432c('0xa8')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0x1c1')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':'int_desk_configuration_has_tags'});db[_0x432c('0xab')][_0x432c('0x110')](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x432c('0xab')][_0x432c('0x110')](db[_0x432c('0xab')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xab')][_0x432c('0x110')](db[_0x432c('0xab')],{'as':_0x432c('0x1c2'),'foreignKey':_0x432c('0x1bc')});db[_0x432c('0xab')]['belongsTo'](db[_0x432c('0x92')],{'as':'Variable','foreignKey':_0x432c('0x1bf')});db['ZohoAccount'][_0x432c('0x110')](db['ZohoConfiguration'],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db['ZohoConfiguration'][_0x432c('0x110')](db['ZohoField'],{'as':_0x432c('0x1b8'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x432c('0x110')](db[_0x432c('0xaf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x432c('0x1bb')});db[_0x432c('0xad')]['hasMany'](db[_0x432c('0xaf')],{'as':_0x432c('0x1b4'),'onDelete':'cascade','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xad')]['belongsTo'](db[_0x432c('0x1c3')],{'as':'Account','foreignKey':_0x432c('0x1b7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x432c('0x1bd'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0xaf')][_0x432c('0x110')](db[_0x432c('0xaf')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db['ZohoField'][_0x432c('0x110')](db['ZohoField'],{'as':'Field','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xaf')][_0x432c('0x11e')](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db[_0x432c('0xb1')][_0x432c('0x110')](db['ZendeskConfiguration'],{'as':_0x432c('0x1b6'),'onDelete':'cascade','foreignKey':_0x432c('0x1b7')});db[_0x432c('0xb3')][_0x432c('0x110')](db[_0x432c('0x1c4')],{'as':_0x432c('0x1b8'),'foreignKey':_0x432c('0x1b9')});db['ZendeskConfiguration'][_0x432c('0x110')](db[_0x432c('0x1c4')],{'as':_0x432c('0x1ba'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0x432c('0x1b4'),'foreignKey':'FieldId'});db[_0x432c('0xb3')]['belongsTo'](db['ZendeskAccount'],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xb3')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x1c5')});db[_0x432c('0x1c4')][_0x432c('0x110')](db['ZendeskField'],{'as':_0x432c('0x1bd'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0x1c4')][_0x432c('0x110')](db[_0x432c('0x1c4')],{'as':_0x432c('0x1be'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0x432c('0x110')](db['ZendeskField'],{'as':_0x432c('0x1c2'),'foreignKey':_0x432c('0x1bc')});db['ZendeskField'][_0x432c('0x11e')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['FreshdeskAccount'][_0x432c('0x110')](db[_0x432c('0xb7')],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':'AccountId'});db[_0x432c('0xb7')]['hasMany'](db[_0x432c('0x1c6')],{'as':_0x432c('0x1b8'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0xb7')]['hasMany'](db['FreshdeskField'],{'as':_0x432c('0x1ba'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x432c('0xb7')][_0x432c('0x110')](db[_0x432c('0x1c6')],{'as':'Fields','onDelete':_0x432c('0x10c'),'foreignKey':'FieldId'});db[_0x432c('0xb7')]['belongsTo'](db[_0x432c('0x1c7')],{'as':_0x432c('0x167'),'foreignKey':'AccountId'});db[_0x432c('0xb7')][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x1c8')});db[_0x432c('0x1c6')]['hasMany'](db[_0x432c('0x1c6')],{'as':_0x432c('0x1bd'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0x1c6')]['hasMany'](db[_0x432c('0x1c6')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db['FreshdeskField'][_0x432c('0x110')](db[_0x432c('0x1c6')],{'as':_0x432c('0x1c2'),'foreignKey':_0x432c('0x1bc')});db[_0x432c('0x1c6')][_0x432c('0x11e')](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db[_0x432c('0xba')][_0x432c('0x110')](db[_0x432c('0xbc')],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x432c('0x1b8'),'foreignKey':'SubjectId'});db[_0x432c('0xbc')][_0x432c('0x110')](db[_0x432c('0xbe')],{'as':_0x432c('0x1ba'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xbc')][_0x432c('0x110')](db['VtigerField'],{'as':'Fields','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xbc')][_0x432c('0x11e')](db['VtigerAccount'],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db['VtigerField'][_0x432c('0x110')](db[_0x432c('0xbe')],{'as':_0x432c('0x1bd'),'foreignKey':'SubjectId'});db[_0x432c('0xbe')][_0x432c('0x110')](db['VtigerField'],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db['VtigerField']['hasMany'](db[_0x432c('0xbe')],{'as':'Field','foreignKey':_0x432c('0x1bc')});db[_0x432c('0xbe')][_0x432c('0x11e')](db['Variable'],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db['ServicenowAccount'][_0x432c('0x110')](db[_0x432c('0xc2')],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xc2')][_0x432c('0x110')](db[_0x432c('0xc4')],{'as':_0x432c('0x1b8'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0xc2')]['hasMany'](db[_0x432c('0xc4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x432c('0xc2')][_0x432c('0x110')](db[_0x432c('0xc4')],{'as':_0x432c('0x1b4'),'foreignKey':_0x432c('0x1bc')});db[_0x432c('0xc2')][_0x432c('0x11e')](db['ServicenowAccount'],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xc4')][_0x432c('0x110')](db[_0x432c('0xc4')],{'as':_0x432c('0x1bd'),'foreignKey':'SubjectId'});db['ServicenowField']['hasMany'](db[_0x432c('0xc4')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xc4')]['hasMany'](db[_0x432c('0xc4')],{'as':_0x432c('0x1c2'),'foreignKey':_0x432c('0x1bc')});db['ServicenowField'][_0x432c('0x11e')](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':'VariableId'});db[_0x432c('0xc6')][_0x432c('0x110')](db[_0x432c('0xc8')],{'as':'Configurations','onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b7')});db[_0x432c('0xc6')][_0x432c('0x11e')](db[_0x432c('0x158')],{'as':_0x432c('0x158'),'foreignKey':'CloudProviderId'});db[_0x432c('0xc8')][_0x432c('0x110')](db['Dynamics365Field'],{'as':_0x432c('0x1b8'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0xc8')]['hasMany'](db[_0x432c('0xca')],{'as':_0x432c('0x1ba'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xc8')][_0x432c('0x110')](db[_0x432c('0xca')],{'as':_0x432c('0x1b4'),'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1bc')});db['Dynamics365Configuration'][_0x432c('0x11e')](db[_0x432c('0xc6')],{'as':_0x432c('0x167'),'foreignKey':'AccountId'});db[_0x432c('0xca')][_0x432c('0x110')](db[_0x432c('0xca')],{'as':_0x432c('0x1bd'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0xca')][_0x432c('0x110')](db[_0x432c('0xca')],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0xca')]['hasMany'](db[_0x432c('0xca')],{'as':_0x432c('0x1c2'),'foreignKey':_0x432c('0x1bc')});db['Dynamics365Field']['belongsTo'](db[_0x432c('0x92')],{'as':_0x432c('0x92'),'foreignKey':_0x432c('0x1bf')});db['FreshsalesAccount']['hasMany'](db['FreshsalesConfiguration'],{'as':_0x432c('0x1b6'),'onDelete':_0x432c('0x10c'),'foreignKey':'AccountId'});db[_0x432c('0x1c9')]['hasMany'](db[_0x432c('0x1ca')],{'as':_0x432c('0x1b8'),'foreignKey':_0x432c('0x1b9')});db[_0x432c('0x1c9')]['hasMany'](db[_0x432c('0x1ca')],{'as':_0x432c('0x1ba'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0x1c9')]['hasMany'](db[_0x432c('0x1ca')],{'as':'Fields','foreignKey':_0x432c('0x1bc')});db[_0x432c('0x1c9')][_0x432c('0x11e')](db[_0x432c('0xcc')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1b7')});db['FreshsalesField']['hasMany'](db[_0x432c('0x1ca')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x432c('0x1ca')][_0x432c('0x110')](db['FreshsalesField'],{'as':_0x432c('0x1be'),'foreignKey':_0x432c('0x1bb')});db[_0x432c('0x1ca')][_0x432c('0x110')](db['FreshsalesField'],{'as':_0x432c('0x1c2'),'foreignKey':'FieldId'});db[_0x432c('0x1ca')]['belongsTo'](db[_0x432c('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0x432c('0xd1')][_0x432c('0x11e')](db[_0x432c('0x62')],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db['ChatQueueReport'][_0x432c('0x11e')](db['CmContact'],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db['ChatQueueReport']['belongsTo'](db[_0x432c('0x67')],{});db[_0x432c('0xd1')][_0x432c('0x11e')](db[_0x432c('0x69')],{});db[_0x432c('0xd1')][_0x432c('0x11e')](db[_0x432c('0x10a')],{});db[_0x432c('0xd1')][_0x432c('0x11e')](db[_0x432c('0x6d')],{});db[_0x432c('0xd2')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x10c'),'foreignKey':'FromId'});db[_0x432c('0xd2')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x10c'),'foreignKey':_0x432c('0x1cb')});db[_0x432c('0x195')][_0x432c('0x110')](db[_0x432c('0x1cc')],{'foreignKey':_0x432c('0x1cd'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x195')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x432c('0x1cd'),'onDelete':_0x432c('0x10c')});db['SmsQueueReport']['belongsTo'](db['SmsAccount'],{});db[_0x432c('0x1ce')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db[_0x432c('0x1ce')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db[_0x432c('0x1ce')]['belongsTo'](db['SmsInteraction'],{});db[_0x432c('0x1ce')][_0x432c('0x11e')](db[_0x432c('0x58')],{});db[_0x432c('0x1ce')][_0x432c('0x11e')](db[_0x432c('0x10a')],{});db[_0x432c('0x1ce')][_0x432c('0x11e')](db[_0x432c('0x59')],{});db[_0x432c('0xdb')]['hasMany'](db[_0x432c('0x195')],{'foreignKey':'ProjectId'});db[_0x432c('0xdb')]['hasMany'](db[_0x432c('0x1cc')],{'foreignKey':_0x432c('0x1cf')});db[_0x432c('0xdb')][_0x432c('0x110')](db[_0x432c('0xd4')],{'foreignKey':_0x432c('0x1cf')});db[_0x432c('0x13d')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x16c'),'through':'user_has_square_projects'});db[_0x432c('0xe3')][_0x432c('0x123')](db['User'],{'as':_0x432c('0x14a'),'through':'user_has_teams'});db['Team'][_0x432c('0x123')](db[_0x432c('0x12a')],{'through':_0x432c('0x14b'),'as':_0x432c('0x12b')});db[_0x432c('0xe3')][_0x432c('0x123')](db[_0x432c('0x3f')],{'through':'team_has_mail_queues','as':_0x432c('0x12e')});db[_0x432c('0xe3')][_0x432c('0x123')](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x432c('0xe3')]['belongsToMany'](db['FaxQueue'],{'through':_0x432c('0x17d'),'as':'FaxQueues'});db[_0x432c('0xe3')][_0x432c('0x123')](db[_0x432c('0x59')],{'through':'team_has_sms_queues','as':_0x432c('0x1d0')});db[_0x432c('0xe3')][_0x432c('0x123')](db['OpenchannelQueue'],{'through':_0x432c('0x189'),'as':'OpenchannelQueues'});db[_0x432c('0xe3')][_0x432c('0x123')](db[_0x432c('0x100')],{'through':_0x432c('0x1d1'),'as':'WhatsappQueues'});db['Team'][_0x432c('0x123')](db[_0x432c('0x12c')],{'through':_0x432c('0x104'),'as':_0x432c('0x12d')});db['Campaign']['hasMany'](db[_0x432c('0x75')],{'as':_0x432c('0x193'),'foreignKey':_0x432c('0x19a')});db[_0x432c('0x199')][_0x432c('0x110')](db[_0x432c('0x114')],{'as':_0x432c('0x115'),'foreignKey':_0x432c('0x19a')});db['Campaign'][_0x432c('0x110')](db['CmHopperHistory'],{'as':_0x432c('0x194'),'foreignKey':_0x432c('0x19a')});db[_0x432c('0x199')][_0x432c('0x110')](db[_0x432c('0x76')],{'as':_0x432c('0x144'),'foreignKey':_0x432c('0x19a')});db[_0x432c('0x199')][_0x432c('0x11e')](db[_0x432c('0x28')],{'as':_0x432c('0x28'),'foreignKey':_0x432c('0x145')});db[_0x432c('0x199')][_0x432c('0x11e')](db[_0x432c('0x28')],{'as':_0x432c('0x1d2'),'foreignKey':_0x432c('0x1d3')});db['Campaign']['belongsTo'](db[_0x432c('0x86')],{'as':_0x432c('0x86'),'foreignKey':_0x432c('0x146')});db[_0x432c('0x199')][_0x432c('0x11e')](db['SquareProject'],{'as':_0x432c('0x13d'),'foreignKey':_0x432c('0x1d4')});db['Campaign'][_0x432c('0x123')](db[_0x432c('0xf2')],{'as':'Lists','through':_0x432c('0x1d5')});db[_0x432c('0x199')][_0x432c('0x123')](db['CmList'],{'as':_0x432c('0x14c'),'through':_0x432c('0x1d6')});db[_0x432c('0xe9')][_0x432c('0x11e')](db['ChatOfflineMessage'],{'as':_0x432c('0x6b'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x432c('0x11e')](db[_0x432c('0x42')],{});db[_0x432c('0xec')][_0x432c('0x11e')](db['MailInteraction'],{});db['MailTransferReport'][_0x432c('0x11e')](db[_0x432c('0x3d')],{'foreignKey':_0x432c('0x1d7'),'as':_0x432c('0x1d8')});db[_0x432c('0xec')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1d9'),'as':_0x432c('0x1da')});db[_0x432c('0xec')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1db'),'as':_0x432c('0x1dc')});db[_0x432c('0xec')][_0x432c('0x11e')](db[_0x432c('0x3f')],{'foreignKey':_0x432c('0x1dd'),'as':_0x432c('0x1de')});db[_0x432c('0xec')][_0x432c('0x11e')](db[_0x432c('0x3d')],{'foreignKey':_0x432c('0x1df'),'as':'ToAccount'});db[_0x432c('0xee')][_0x432c('0x11e')](db[_0x432c('0x69')],{});db[_0x432c('0xee')][_0x432c('0x11e')](db['ChatInteraction'],{});db[_0x432c('0xee')]['belongsTo'](db[_0x432c('0x62')],{'foreignKey':_0x432c('0x1e0'),'as':_0x432c('0x1d8')});db[_0x432c('0xee')]['belongsTo'](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1d9'),'as':_0x432c('0x1da')});db['ChatTransferReport'][_0x432c('0x11e')](db['User'],{'foreignKey':_0x432c('0x1db'),'as':_0x432c('0x1dc')});db[_0x432c('0xee')][_0x432c('0x11e')](db[_0x432c('0x6d')],{'foreignKey':'ToChatQueueId','as':_0x432c('0x1de')});db['ChatTransferReport'][_0x432c('0x11e')](db[_0x432c('0x62')],{'foreignKey':_0x432c('0x1e1'),'as':_0x432c('0x1e2')});db[_0x432c('0x1e3')][_0x432c('0x11e')](db[_0x432c('0x178')],{});db['FaxTransferReport'][_0x432c('0x11e')](db[_0x432c('0x4e')],{});db[_0x432c('0x1e3')][_0x432c('0x11e')](db['FaxAccount'],{'foreignKey':_0x432c('0x1e4'),'as':_0x432c('0x1d8')});db[_0x432c('0x1e3')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'foreignKey':'FromUserId','as':_0x432c('0x1da')});db[_0x432c('0x1e3')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1db'),'as':'ToAgent'});db[_0x432c('0x1e3')][_0x432c('0x11e')](db[_0x432c('0x50')],{'foreignKey':_0x432c('0x1e5'),'as':_0x432c('0x1de')});db[_0x432c('0x1e3')][_0x432c('0x11e')](db[_0x432c('0x4b')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x432c('0xf0')][_0x432c('0x11e')](db[_0x432c('0x184')],{});db[_0x432c('0xf0')]['belongsTo'](db[_0x432c('0x5d')],{});db[_0x432c('0xf0')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x432c('0x1e6'),'as':_0x432c('0x1d8')});db[_0x432c('0xf0')][_0x432c('0x11e')](db['User'],{'foreignKey':_0x432c('0x1d9'),'as':_0x432c('0x1da')});db[_0x432c('0xf0')][_0x432c('0x11e')](db['User'],{'foreignKey':_0x432c('0x1db'),'as':'ToAgent'});db[_0x432c('0xf0')][_0x432c('0x11e')](db['OpenchannelQueue'],{'foreignKey':_0x432c('0x1e7'),'as':_0x432c('0x1de')});db[_0x432c('0xf0')]['belongsTo'](db[_0x432c('0x5b')],{'foreignKey':_0x432c('0x1e8'),'as':_0x432c('0x1e2')});db[_0x432c('0xf1')]['belongsTo'](db['SmsMessage'],{});db[_0x432c('0xf1')][_0x432c('0x11e')](db[_0x432c('0x56')],{});db[_0x432c('0xf1')][_0x432c('0x11e')](db[_0x432c('0x52')],{'foreignKey':_0x432c('0x1e9'),'as':_0x432c('0x1d8')});db[_0x432c('0xf1')][_0x432c('0x11e')](db['User'],{'foreignKey':_0x432c('0x1d9'),'as':'FromAgent'});db['SmsTransferReport']['belongsTo'](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1db'),'as':'ToAgent'});db[_0x432c('0xf1')][_0x432c('0x11e')](db[_0x432c('0x59')],{'foreignKey':_0x432c('0x1ea'),'as':_0x432c('0x1de')});db[_0x432c('0xf1')][_0x432c('0x11e')](db[_0x432c('0x52')],{'foreignKey':_0x432c('0x1eb'),'as':_0x432c('0x1e2')});db['CmList']['hasMany'](db[_0x432c('0x82')],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x161'),'onDelete':_0x432c('0x10c')});db['CmList']['hasMany'](db[_0x432c('0x7d')],{'as':_0x432c('0x1ec'),'foreignKey':_0x432c('0x161')});db['CmList']['hasMany'](db[_0x432c('0x73')],{'as':'Contacts','onDelete':_0x432c('0x10c'),'foreignKey':'ListId'});db[_0x432c('0xf2')][_0x432c('0x110')](db[_0x432c('0x114')],{'as':_0x432c('0x115'),'foreignKey':'ListId'});db[_0x432c('0xf2')][_0x432c('0x110')](db[_0x432c('0x79')],{'as':_0x432c('0x1ed'),'foreignKey':_0x432c('0x161')});db[_0x432c('0xf2')][_0x432c('0x110')](db['ReportAgentPreview'],{'as':_0x432c('0x7b'),'foreignKey':_0x432c('0x161')});db[_0x432c('0xf2')]['belongsToMany'](db[_0x432c('0x12a')],{'as':_0x432c('0x1ee'),'through':_0x432c('0x149')});db[_0x432c('0xf2')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x432c('0x134')});db[_0x432c('0x12c')][_0x432c('0x110')](db[_0x432c('0x18')],{'as':_0x432c('0x113'),'onDelete':_0x432c('0x10c')});db[_0x432c('0x12c')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':'Agents','through':_0x432c('0x106')});db['VoicePrefix'][_0x432c('0x123')](db['Team'],{'through':_0x432c('0x104'),'as':_0x432c('0x165')});db[_0x432c('0xf4')][_0x432c('0x110')](db[_0x432c('0x10a')],{'as':_0x432c('0x16c'),'foreignKey':_0x432c('0x1ef')});db[_0x432c('0xf4')][_0x432c('0x110')](db[_0x432c('0xf6')],{'as':_0x432c('0x1f0'),'foreignKey':_0x432c('0x1ef'),'onDelete':'cascade'});db[_0x432c('0xf6')][_0x432c('0x110')](db[_0x432c('0x1f1')],{'as':'Resources','foreignKey':_0x432c('0x1f2'),'onDelete':'cascade'});db[_0x432c('0xfa')][_0x432c('0x110')](db['Disposition'],{'as':_0x432c('0x15d'),'foreignKey':_0x432c('0x1f3'),'onDelete':_0x432c('0x10c')});db[_0x432c('0xfa')][_0x432c('0x110')](db[_0x432c('0x15e')],{'as':_0x432c('0x15f'),'foreignKey':_0x432c('0x1f3')});db[_0x432c('0xfa')][_0x432c('0x110')](db['WhatsappMessage'],{'as':_0x432c('0x14e'),'foreignKey':_0x432c('0x1f3')});db[_0x432c('0xfa')][_0x432c('0x110')](db[_0x432c('0xfd')],{'as':_0x432c('0x174')});db[_0x432c('0xfa')][_0x432c('0x110')](db[_0x432c('0xfb')],{'as':'Applications'});db[_0x432c('0xfa')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db['WhatsappAccount'][_0x432c('0x11e')](db['Pause'],{'as':_0x432c('0x147'),'foreignKey':_0x432c('0x148')});db[_0x432c('0xfa')][_0x432c('0x123')](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x13c')});db[_0x432c('0xfb')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'onDelete':_0x432c('0x15a')});db['WhatsappApplication'][_0x432c('0x11e')](db[_0x432c('0x100')],{'onDelete':'restrict'});db[_0x432c('0xfb')][_0x432c('0x11e')](db['WhatsappAccount'],{'onDelete':_0x432c('0x15a')});db[_0x432c('0xfb')][_0x432c('0x11e')](db[_0x432c('0x86')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x146')});db['WhatsappApplication']['belongsTo'](db[_0x432c('0x169')],{'onDelete':_0x432c('0x15a'),'foreignKey':_0x432c('0x177')});db['WhatsappInteraction'][_0x432c('0x110')](db[_0x432c('0x1f4')],{'as':_0x432c('0x14e'),'onDelete':_0x432c('0x10c'),'foreignKey':'WhatsappInteractionId'});db[_0x432c('0xfd')][_0x432c('0x11e')](db[_0x432c('0xfa')],{'as':'Account','foreignKey':_0x432c('0x1f3')});db[_0x432c('0xfd')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':'Contact','foreignKey':_0x432c('0x157')});db[_0x432c('0xfd')][_0x432c('0x11e')](db[_0x432c('0x10a')],{'as':_0x432c('0x168'),'foreignKey':'UserId'});db[_0x432c('0xfd')][_0x432c('0x123')](db['Tag'],{'through':_0x432c('0x1f5'),'as':_0x432c('0x16b')});db['WhatsappInteraction'][_0x432c('0x123')](db[_0x432c('0x169')],{'through':_0x432c('0x1f5'),'as':_0x432c('0x17b')});db[_0x432c('0xfd')][_0x432c('0x123')](db['User'],{'as':_0x432c('0x16c'),'through':'user_has_whatsapp_interactions','foreignKey':_0x432c('0x1f6')});db[_0x432c('0x1f4')]['belongsTo'](db['User'],{'as':_0x432c('0x10a')});db[_0x432c('0x1f4')]['belongsTo'](db[_0x432c('0x73')],{'onDelete':'cascade','as':_0x432c('0x156')});db[_0x432c('0x1f4')][_0x432c('0x11e')](db[_0x432c('0xfd')],{'onDelete':_0x432c('0x10c'),'as':'Interaction','foreignKey':_0x432c('0x1f6')});db[_0x432c('0x1f4')][_0x432c('0x11e')](db[_0x432c('0xfa')],{'as':_0x432c('0x167'),'foreignKey':_0x432c('0x1f3')});db[_0x432c('0xff')][_0x432c('0x11e')](db[_0x432c('0xfa')],{});db[_0x432c('0xff')][_0x432c('0x11e')](db[_0x432c('0xf2')],{'as':_0x432c('0x160'),'foreignKey':_0x432c('0x161')});db[_0x432c('0xff')][_0x432c('0x11e')](db[_0x432c('0x73')],{'as':_0x432c('0x156'),'foreignKey':_0x432c('0x157')});db['WhatsappQueueReport'][_0x432c('0x11e')](db['WhatsappInteraction'],{});db[_0x432c('0xff')][_0x432c('0x11e')](db[_0x432c('0x100')],{});db['WhatsappQueueReport'][_0x432c('0x11e')](db[_0x432c('0x1f4')],{});db[_0x432c('0xff')][_0x432c('0x11e')](db[_0x432c('0x10a')],{});db[_0x432c('0x1f7')][_0x432c('0x11e')](db[_0x432c('0x1f4')],{});db['WhatsappTransferReport'][_0x432c('0x11e')](db[_0x432c('0xfd')],{});db[_0x432c('0x1f7')][_0x432c('0x11e')](db[_0x432c('0xfa')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x432c('0x1f7')][_0x432c('0x11e')](db['WhatsappAccount'],{'foreignKey':_0x432c('0x1f8'),'as':_0x432c('0x1e2')});db['WhatsappTransferReport'][_0x432c('0x11e')](db[_0x432c('0x100')],{'foreignKey':_0x432c('0x1f9'),'as':_0x432c('0x1de')});db['WhatsappTransferReport'][_0x432c('0x11e')](db[_0x432c('0x10a')],{'foreignKey':_0x432c('0x1d9'),'as':_0x432c('0x1da')});db[_0x432c('0x1f7')][_0x432c('0x11e')](db['User'],{'foreignKey':_0x432c('0x1db'),'as':_0x432c('0x1dc')});db[_0x432c('0x100')]['belongsToMany'](db[_0x432c('0x10a')],{'as':_0x432c('0x14a'),'through':_0x432c('0x37'),'foreignKey':_0x432c('0x1fa')});db[_0x432c('0x100')][_0x432c('0x123')](db[_0x432c('0xe3')],{'through':'team_has_whatsapp_queues','as':_0x432c('0x165')});db['UserSetting']['belongsTo'](db[_0x432c('0x10a')],{'as':_0x432c('0x1fb'),'foreignKey':_0x432c('0x10d'),'onDelete':_0x432c('0x10c'),'hooks':!![]});db[_0x432c('0x158')]['hasOne'](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0x432c('0x15a')});db[_0x432c('0x158')][_0x432c('0x10e')](db[_0x432c('0x39')],{'as':_0x432c('0x1fc'),'onDelete':_0x432c('0x15a')});db['CloudProvider'][_0x432c('0x10e')](db[_0x432c('0x3b')],{'as':'Smtp','onDelete':_0x432c('0x15a')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 41a7416..315a74c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','/api/cloudProviders','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction'];(function(_0x3e71ec,_0x11bd74){var _0x2144fb=function(_0xa71202){while(--_0xa71202){_0x3e71ec['push'](_0x3e71ec['shift']());}};_0x2144fb(++_0x11bd74);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x544758,_0x498f52){_0x544758=_0x544758-0x0;var _0x46ba69=_0x8d0e[_0x544758];return _0x46ba69;};'use strict';var path=require(_0xe8d0('0x0'));var express=require(_0xe8d0('0x1'));var errors=require(_0xe8d0('0x2'));var config=require(_0xe8d0('0x3'));var setupLoggers=require(_0xe8d0('0x4'))[_0xe8d0('0x5')];var clientSideLogs=require(_0xe8d0('0x6'));exports[_0xe8d0('0x7')]=function(_0x32cee9){return setupLoggers(_0x32cee9)['then'](function(){_0x32cee9[_0xe8d0('0x8')]('/api/users',require('./api/user'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x9'),require(_0xe8d0('0xa')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xb'),require(_0xe8d0('0xc')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xd'),require('./api/voiceExtension'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe'),require(_0xe8d0('0xf')));_0x32cee9['use']('/api/voice/queues',require(_0xe8d0('0x10')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x11'),require(_0xe8d0('0x12')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x13'),require('./api/screenRecording'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x14'),require('./api/voiceMail'));_0x32cee9[_0xe8d0('0x8')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x15'),require(_0xe8d0('0x16')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x17'),require(_0xe8d0('0x18')));_0x32cee9['use'](_0xe8d0('0x19'),require('./api/voiceAgentReport'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x1a'),require(_0xe8d0('0x1b')));_0x32cee9['use']('/api/members/reports',require('./api/memberReport'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x1c'),require(_0xe8d0('0x1d')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x1e'),require('./api/voiceTransferReport'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x1f'),require('./api/mailServerOut'));_0x32cee9['use']('/api/mail/accounts',require(_0xe8d0('0x20')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x21'),require(_0xe8d0('0x22')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x23'),require(_0xe8d0('0x24')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x25'),require('./api/mailInteraction'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x26'),require('./api/mailMessage'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x27'),require(_0xe8d0('0x28')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x29'),require(_0xe8d0('0x2a')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x2b'),require(_0xe8d0('0x2c')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x2d'),require('./api/dashboardItem'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x2e'),require(_0xe8d0('0x2f')));_0x32cee9['use'](_0xe8d0('0x30'),require(_0xe8d0('0x31')));_0x32cee9['use'](_0xe8d0('0x32'),require(_0xe8d0('0x33')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x34'),require(_0xe8d0('0x35')));_0x32cee9['use'](_0xe8d0('0x36'),require('./api/faxQueue'));_0x32cee9['use']('/api/fax/reports/queue',require(_0xe8d0('0x37')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x38'),require('./api/smsAccount'));_0x32cee9['use'](_0xe8d0('0x39'),require('./api/smsApplication'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x3a'),require(_0xe8d0('0x3b')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x3c'),require('./api/smsMessage'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x3d'),require(_0xe8d0('0x3e')));_0x32cee9[_0xe8d0('0x8')]('/api/openchannel/accounts',require(_0xe8d0('0x3f')));_0x32cee9[_0xe8d0('0x8')]('/api/openchannel/applications',require(_0xe8d0('0x40')));_0x32cee9['use'](_0xe8d0('0x41'),require('./api/openchannelInteraction'));_0x32cee9[_0xe8d0('0x8')]('/api/openchannel/messages',require(_0xe8d0('0x42')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x43'),require(_0xe8d0('0x44')));_0x32cee9['use'](_0xe8d0('0x45'),require(_0xe8d0('0x46')));_0x32cee9[_0xe8d0('0x8')]('/api/openchannel/reports/queue',require(_0xe8d0('0x47')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x48'),require(_0xe8d0('0x49')));_0x32cee9[_0xe8d0('0x8')]('/api/chat/interactions',require(_0xe8d0('0x4a')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x4b'),require(_0xe8d0('0x4c')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x4d'),require(_0xe8d0('0x4e')));_0x32cee9[_0xe8d0('0x8')]('/api/chat/queues',require('./api/chatQueue'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x4f'),require(_0xe8d0('0x50')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x51'),require('./api/chatProactiveAction'));_0x32cee9[_0xe8d0('0x8')]('/api/cm/companies',require(_0xe8d0('0x52')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x53'),require('./api/cmContact'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x54'),require(_0xe8d0('0x55')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x56'),require('./api/cmHopperBlack'));_0x32cee9['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x32cee9[_0xe8d0('0x8')]('/api/cm/hopper_history',require(_0xe8d0('0x57')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x58'),require(_0xe8d0('0x59')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x5a'),require(_0xe8d0('0x5b')));_0x32cee9[_0xe8d0('0x8')]('/api/automations',require(_0xe8d0('0x5c')));_0x32cee9[_0xe8d0('0x8')]('/api/canned_answers',require('./api/cannedAnswer'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x5d'),require(_0xe8d0('0x5e')));_0x32cee9['use'](_0xe8d0('0x5f'),require(_0xe8d0('0x60')));_0x32cee9['use'](_0xe8d0('0x61'),require(_0xe8d0('0x62')));_0x32cee9['use'](_0xe8d0('0x63'),require(_0xe8d0('0x64')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x65'),require(_0xe8d0('0x66')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x67'),require(_0xe8d0('0x68')));_0x32cee9['use'](_0xe8d0('0x69'),require(_0xe8d0('0x6a')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x6b'),require(_0xe8d0('0x6c')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x6d'),require(_0xe8d0('0x6e')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x6f'),require(_0xe8d0('0x70')));_0x32cee9[_0xe8d0('0x8')]('/api/triggers',require(_0xe8d0('0x71')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x72'),require(_0xe8d0('0x73')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x74'),require(_0xe8d0('0x75')));_0x32cee9['use'](_0xe8d0('0x76'),require(_0xe8d0('0x77')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x78'),require('./api/analyticCustomReport'));_0x32cee9[_0xe8d0('0x8')]('/api/analytics/default_reports',require(_0xe8d0('0x79')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x7a'),require(_0xe8d0('0x7b')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x7c'),require(_0xe8d0('0x7d')));_0x32cee9['use'](_0xe8d0('0x7e'),require('./api/analyticFieldReport'));_0x32cee9['use'](_0xe8d0('0x7f'),require('./api/analyticTreeReport'));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/salesforce/accounts',require(_0xe8d0('0x80')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x81'),require(_0xe8d0('0x82')));_0x32cee9['use'](_0xe8d0('0x83'),require(_0xe8d0('0x84')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x85'),require(_0xe8d0('0x86')));_0x32cee9['use'](_0xe8d0('0x87'),require(_0xe8d0('0x88')));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/sugarcrm/fields',require(_0xe8d0('0x89')));_0x32cee9['use']('/api/integrations/desk/accounts',require(_0xe8d0('0x8a')));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/desk/configurations',require(_0xe8d0('0x8b')));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/desk/fields',require(_0xe8d0('0x8c')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x8d'),require(_0xe8d0('0x8e')));_0x32cee9['use'](_0xe8d0('0x8f'),require(_0xe8d0('0x90')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x91'),require('./api/intZohoField'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x92'),require(_0xe8d0('0x93')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x94'),require(_0xe8d0('0x95')));_0x32cee9['use']('/api/integrations/zendesk/fields',require(_0xe8d0('0x96')));_0x32cee9['use'](_0xe8d0('0x97'),require(_0xe8d0('0x98')));_0x32cee9['use']('/api/integrations/freshdesk/configurations',require(_0xe8d0('0x99')));_0x32cee9['use'](_0xe8d0('0x9a'),require('./api/intFreshdeskField'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x9b'),require(_0xe8d0('0x9c')));_0x32cee9['use'](_0xe8d0('0x9d'),require(_0xe8d0('0x9e')));_0x32cee9['use'](_0xe8d0('0x9f'),require('./api/intVtigerField'));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/servicenow/accounts',require(_0xe8d0('0xa0')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xa1'),require(_0xe8d0('0xa2')));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x32cee9[_0xe8d0('0x8')]('/api/integrations/dynamics365/accounts',require(_0xe8d0('0xa3')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xa4'),require(_0xe8d0('0xa5')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xa6'),require(_0xe8d0('0xa7')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xa8'),require(_0xe8d0('0xa9')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xaa'),require(_0xe8d0('0xab')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xac'),require('./api/intFreshsalesField'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xad'),require(_0xe8d0('0xae')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xaf'),require('./api/chatQueueReport'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xb0'),require(_0xe8d0('0xb1')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xb2'),require(_0xe8d0('0xb3')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xb4'),require(_0xe8d0('0xb5')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xb6'),require(_0xe8d0('0xb7')));_0x32cee9['use']('/api/sms/reports/queue',require(_0xe8d0('0xb8')));_0x32cee9['use'](_0xe8d0('0xb9'),require(_0xe8d0('0xba')));_0x32cee9['use'](_0xe8d0('0xbb'),require(_0xe8d0('0xbc')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xbd'),require(_0xe8d0('0xbe')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xbf'),require(_0xe8d0('0xc0')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xc1'),require(_0xe8d0('0xc2')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xc3'),require(_0xe8d0('0xc4')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xc5'),require(_0xe8d0('0xc6')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xc7'),require('./api/squareMessage'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xc8'),require(_0xe8d0('0xc9')));_0x32cee9['use'](_0xe8d0('0xca'),require('./api/license'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xcb'),require(_0xe8d0('0xcc')));_0x32cee9['use'](_0xe8d0('0xcd'),require(_0xe8d0('0xce')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xcf'),require(_0xe8d0('0xd0')));_0x32cee9['use'](_0xe8d0('0xd1'),require(_0xe8d0('0xd2')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xd3'),require(_0xe8d0('0xd4')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xd5'),require(_0xe8d0('0xd6')));_0x32cee9['use'](_0xe8d0('0xd7'),require(_0xe8d0('0xd8')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xd9'),require('./api/openchannelTransferReport'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xda'),require(_0xe8d0('0xdb')));_0x32cee9['use'](_0xe8d0('0xdc'),require('./api/cmList'));_0x32cee9[_0xe8d0('0x8')]('/api/voice/prefixes',require(_0xe8d0('0xdd')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xde'),require(_0xe8d0('0xdf')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe0'),require(_0xe8d0('0xe1')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe2'),require(_0xe8d0('0xe3')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe4'),require('./api/userNotification'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe5'),require(_0xe8d0('0xe6')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe7'),require(_0xe8d0('0xe8')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xe9'),require(_0xe8d0('0xea')));_0x32cee9[_0xe8d0('0x8')]('/api/whatsapp/messages',require(_0xe8d0('0xeb')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xec'),require(_0xe8d0('0xed')));_0x32cee9[_0xe8d0('0x8')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x32cee9[_0xe8d0('0x8')]('/api/whatsapp/queues',require(_0xe8d0('0xee')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xef'),require('./api/cloudProvider'));_0x32cee9[_0xe8d0('0x8')]('/api/realtime',require(_0xe8d0('0xf0')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xf1'),require(_0xe8d0('0xf2')));_0x32cee9[_0xe8d0('0x8')]('/api/auth/local',require('./api/authLocal'));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xf3'),require(_0xe8d0('0xf4')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xf5'),require(_0xe8d0('0xf6')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xf7'),require(_0xe8d0('0xf8')));_0x32cee9['use'](_0xe8d0('0xf9'),require(_0xe8d0('0xfa')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xfb'),require('./api/version'));_0x32cee9['use'](_0xe8d0('0xfc'),require(_0xe8d0('0xfd')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0xfe'),require(_0xe8d0('0xff')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x100'),require(_0xe8d0('0x101')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x102'),clientSideLogs);_0x32cee9['use'](_0xe8d0('0x103'),express[_0xe8d0('0x104')](path[_0xe8d0('0x105')](config[_0xe8d0('0x106')],_0xe8d0('0x103'))));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x107'),express[_0xe8d0('0x104')](path[_0xe8d0('0x105')](config['root'],'/www')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x108'),express['static'](path[_0xe8d0('0x105')](config[_0xe8d0('0x106')],_0xe8d0('0x108'))));_0x32cee9['use'](_0xe8d0('0x109'),express[_0xe8d0('0x104')](path[_0xe8d0('0x105')](config[_0xe8d0('0x106')],'snippet','3.0.0')));_0x32cee9[_0xe8d0('0x8')](_0xe8d0('0x10a'),express['static'](path['join'](config[_0xe8d0('0x106')],_0xe8d0('0x10b'))));_0x32cee9[_0xe8d0('0x10c')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xe8d0('0x10d')](errors[0x194]);_0x32cee9['route']('/*')['get'](function(_0x44a4bd,_0x3fd5d1){_0x3fd5d1[_0xe8d0('0x10e')](path[_0xe8d0('0x10f')](_0x32cee9[_0xe8d0('0x10d')]('appPath')+_0xe8d0('0x110')));});return _0x32cee9;});}; \ No newline at end of file +var _0xa41a=['./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/sms/accounts','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts'];(function(_0x5632f4,_0x54dbbd){var _0x2c00ca=function(_0x4bd881){while(--_0x4bd881){_0x5632f4['push'](_0x5632f4['shift']());}};_0x2c00ca(++_0x54dbbd);}(_0xa41a,0x6b));var _0xaa41=function(_0xabedf8,_0xa81ed7){_0xabedf8=_0xabedf8-0x0;var _0x341a48=_0xa41a[_0xabedf8];return _0x341a48;};'use strict';var path=require(_0xaa41('0x0'));var express=require(_0xaa41('0x1'));var errors=require('./errors');var config=require(_0xaa41('0x2'));var setupLoggers=require(_0xaa41('0x3'))[_0xaa41('0x4')];var clientSideLogs=require(_0xaa41('0x5'));exports[_0xaa41('0x6')]=function(_0x3168be){return setupLoggers(_0x3168be)[_0xaa41('0x7')](function(){_0x3168be[_0xaa41('0x8')]('/api/users',require(_0xaa41('0x9')));_0x3168be[_0xaa41('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa'),require('./api/voiceContext'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xb'),require(_0xaa41('0xc')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xd'),require(_0xaa41('0xe')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xf'),require(_0xaa41('0x10')));_0x3168be['use'](_0xaa41('0x11'),require(_0xaa41('0x12')));_0x3168be['use']('/api/screen/recordings',require(_0xaa41('0x13')));_0x3168be['use'](_0xaa41('0x14'),require(_0xaa41('0x15')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x16'),require(_0xaa41('0x17')));_0x3168be['use'](_0xaa41('0x18'),require(_0xaa41('0x19')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x1a'),require(_0xaa41('0x1b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x1c'),require('./api/voiceAgentReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x1d'),require(_0xaa41('0x1e')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x1f'),require(_0xaa41('0x20')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x21'),require(_0xaa41('0x22')));_0x3168be['use']('/api/voice/transfers/reports',require(_0xaa41('0x23')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x24'),require('./api/mailServerOut'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x25'),require('./api/mailAccount'));_0x3168be['use'](_0xaa41('0x26'),require('./api/mailQueue'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x27'),require(_0xaa41('0x28')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x29'),require('./api/mailInteraction'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x2a'),require(_0xaa41('0x2b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x2c'),require(_0xaa41('0x2d')));_0x3168be['use']('/api/mail/reports/queue',require(_0xaa41('0x2e')));_0x3168be['use']('/api/dashboards',require(_0xaa41('0x2f')));_0x3168be['use']('/api/dashboards/items',require(_0xaa41('0x30')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x31'),require(_0xaa41('0x32')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x33'),require('./api/faxApplication'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x34'),require(_0xaa41('0x35')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x36'),require(_0xaa41('0x37')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x38'),require('./api/faxQueue'));_0x3168be[_0xaa41('0x8')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x39'),require('./api/smsAccount'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x3a'),require('./api/smsApplication'));_0x3168be['use']('/api/sms/interactions',require(_0xaa41('0x3b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x3c'),require(_0xaa41('0x3d')));_0x3168be['use'](_0xaa41('0x3e'),require(_0xaa41('0x3f')));_0x3168be[_0xaa41('0x8')]('/api/openchannel/accounts',require(_0xaa41('0x40')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x41'),require('./api/openchannelApplication'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x42'),require('./api/openchannelInteraction'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x43'),require(_0xaa41('0x44')));_0x3168be['use'](_0xaa41('0x45'),require('./api/openchannelQueue'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x46'),require(_0xaa41('0x47')));_0x3168be['use']('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x48'),require(_0xaa41('0x49')));_0x3168be[_0xaa41('0x8')]('/api/chat/interactions',require('./api/chatInteraction'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x4a'),require(_0xaa41('0x4b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x4c'),require(_0xaa41('0x4d')));_0x3168be[_0xaa41('0x8')]('/api/chat/queues',require(_0xaa41('0x4e')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x4f'),require(_0xaa41('0x50')));_0x3168be['use']('/api/chat/proactive_actions',require(_0xaa41('0x51')));_0x3168be[_0xaa41('0x8')]('/api/cm/companies',require(_0xaa41('0x52')));_0x3168be['use'](_0xaa41('0x53'),require(_0xaa41('0x54')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x55'),require(_0xaa41('0x56')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x57'),require(_0xaa41('0x58')));_0x3168be['use'](_0xaa41('0x59'),require(_0xaa41('0x5a')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x5b'),require(_0xaa41('0x5c')));_0x3168be[_0xaa41('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x3168be[_0xaa41('0x8')]('/api/actions',require(_0xaa41('0x5d')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x5e'),require(_0xaa41('0x5f')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x60'),require(_0xaa41('0x61')));_0x3168be['use'](_0xaa41('0x62'),require('./api/disposition'));_0x3168be['use'](_0xaa41('0x63'),require('./api/condition'));_0x3168be['use']('/api/intervals',require(_0xaa41('0x64')));_0x3168be['use'](_0xaa41('0x65'),require(_0xaa41('0x66')));_0x3168be['use']('/api/cdr',require(_0xaa41('0x67')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x68'),require(_0xaa41('0x69')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x6a'),require(_0xaa41('0x6b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x6c'),require('./api/sound'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x6d'),require(_0xaa41('0x6e')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x6f'),require(_0xaa41('0x70')));_0x3168be['use'](_0xaa41('0x71'),require(_0xaa41('0x72')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x73'),require('./api/variable'));_0x3168be[_0xaa41('0x8')]('/api/integrations',require('./api/integration'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x74'),require(_0xaa41('0x75')));_0x3168be['use'](_0xaa41('0x76'),require(_0xaa41('0x77')));_0x3168be[_0xaa41('0x8')]('/api/analytics/default_reports',require(_0xaa41('0x78')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x79'),require(_0xaa41('0x7a')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x7b'),require(_0xaa41('0x7c')));_0x3168be[_0xaa41('0x8')]('/api/analytics/field_reports',require(_0xaa41('0x7d')));_0x3168be['use']('/api/analytics/tree_reports',require(_0xaa41('0x7e')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x7f'),require(_0xaa41('0x80')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x81'),require(_0xaa41('0x82')));_0x3168be[_0xaa41('0x8')]('/api/integrations/salesforce/fields',require(_0xaa41('0x83')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x84'),require('./api/intSugarcrmAccount'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x85'),require('./api/intSugarcrmConfiguration'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x86'),require(_0xaa41('0x87')));_0x3168be['use'](_0xaa41('0x88'),require(_0xaa41('0x89')));_0x3168be['use']('/api/integrations/desk/configurations',require(_0xaa41('0x8a')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x8b'),require('./api/intDeskField'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x8c'),require(_0xaa41('0x8d')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x8e'),require('./api/intZohoConfiguration'));_0x3168be[_0xaa41('0x8')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x3168be[_0xaa41('0x8')]('/api/integrations/zendesk/accounts',require(_0xaa41('0x8f')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x90'),require('./api/intZendeskConfiguration'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x91'),require(_0xaa41('0x92')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x93'),require(_0xaa41('0x94')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x95'),require(_0xaa41('0x96')));_0x3168be['use'](_0xaa41('0x97'),require(_0xaa41('0x98')));_0x3168be[_0xaa41('0x8')]('/api/integrations/vtiger/accounts',require(_0xaa41('0x99')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x9a'),require(_0xaa41('0x9b')));_0x3168be[_0xaa41('0x8')](_0xaa41('0x9c'),require(_0xaa41('0x9d')));_0x3168be['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x3168be['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x3168be[_0xaa41('0x8')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x3168be[_0xaa41('0x8')](_0xaa41('0x9e'),require(_0xaa41('0x9f')));_0x3168be[_0xaa41('0x8')]('/api/integrations/dynamics365/configurations',require(_0xaa41('0xa0')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa1'),require(_0xaa41('0xa2')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa3'),require(_0xaa41('0xa4')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa5'),require('./api/intFreshsalesConfiguration'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa6'),require('./api/intFreshsalesField'));_0x3168be['use']('/api/networks',require(_0xaa41('0xa7')));_0x3168be['use'](_0xaa41('0xa8'),require('./api/chatQueueReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xa9'),require('./api/chatInternalMessage'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xaa'),require(_0xaa41('0xab')));_0x3168be[_0xaa41('0x8')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xac'),require('./api/jscriptySessionReport'));_0x3168be['use'](_0xaa41('0xad'),require(_0xaa41('0xae')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xaf'),require(_0xaa41('0xb0')));_0x3168be['use'](_0xaa41('0xb1'),require('./api/squareReportDetail'));_0x3168be['use']('/api/jscripty/projects',require(_0xaa41('0xb2')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xb3'),require('./api/setting'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xb4'),require(_0xaa41('0xb5')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xb6'),require(_0xaa41('0xb7')));_0x3168be[_0xaa41('0x8')]('/api/square/recordings',require(_0xaa41('0xb8')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xb9'),require(_0xaa41('0xba')));_0x3168be['use'](_0xaa41('0xbb'),require('./api/team'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xbc'),require(_0xaa41('0xbd')));_0x3168be[_0xaa41('0x8')]('/api/campaigns',require(_0xaa41('0xbe')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xbf'),require(_0xaa41('0xc0')));_0x3168be['use'](_0xaa41('0xc1'),require('./api/attachment'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xc2'),require('./api/plugin'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xc3'),require(_0xaa41('0xc4')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xc5'),require(_0xaa41('0xc6')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xc7'),require(_0xaa41('0xc8')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xc9'),require('./api/openchannelTransferReport'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xca'),require(_0xaa41('0xcb')));_0x3168be['use']('/api/cm/lists',require(_0xaa41('0xcc')));_0x3168be[_0xaa41('0x8')]('/api/voice/prefixes',require(_0xaa41('0xcd')));_0x3168be[_0xaa41('0x8')]('/api/userProfiles',require(_0xaa41('0xce')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xcf'),require(_0xaa41('0xd0')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xd1'),require(_0xaa41('0xd2')));_0x3168be[_0xaa41('0x8')]('/api/userNotifications',require('./api/userNotification'));_0x3168be[_0xaa41('0x8')]('/api/whatsapp/accounts',require(_0xaa41('0xd3')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xd4'),require('./api/whatsappApplication'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xd5'),require(_0xaa41('0xd6')));_0x3168be['use'](_0xaa41('0xd7'),require(_0xaa41('0xd8')));_0x3168be['use'](_0xaa41('0xd9'),require('./api/whatsappQueueReport'));_0x3168be['use'](_0xaa41('0xda'),require(_0xaa41('0xdb')));_0x3168be['use']('/api/whatsapp/queues',require(_0xaa41('0xdc')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xdd'),require(_0xaa41('0xde')));_0x3168be['use'](_0xaa41('0xdf'),require(_0xaa41('0xe0')));_0x3168be[_0xaa41('0x8')]('/api/user-settings',require(_0xaa41('0xe1')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xe2'),require('./api/authLocal'));_0x3168be[_0xaa41('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xe3'),require('./api/authActiveDirectory'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xe4'),require(_0xaa41('0xe5')));_0x3168be['use'](_0xaa41('0xe6'),require(_0xaa41('0xe7')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xe8'),require(_0xaa41('0xe9')));_0x3168be['use'](_0xaa41('0xea'),require('./api/system'));_0x3168be[_0xaa41('0x8')](_0xaa41('0xeb'),require(_0xaa41('0xec')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xed'),require(_0xaa41('0xee')));_0x3168be[_0xaa41('0x8')](_0xaa41('0xef'),clientSideLogs);_0x3168be[_0xaa41('0x8')](_0xaa41('0xf0'),express[_0xaa41('0xf1')](path['join'](config[_0xaa41('0xf2')],_0xaa41('0xf0'))));_0x3168be['use'](_0xaa41('0xf3'),express['static'](path[_0xaa41('0xf4')](config[_0xaa41('0xf2')],_0xaa41('0xf3'))));_0x3168be[_0xaa41('0x8')](_0xaa41('0xf5'),express[_0xaa41('0xf1')](path[_0xaa41('0xf4')](config['root'],_0xaa41('0xf5'))));_0x3168be[_0xaa41('0x8')](_0xaa41('0xf6'),express[_0xaa41('0xf1')](path['join'](config[_0xaa41('0xf2')],'snippet',_0xaa41('0xf7'))));_0x3168be[_0xaa41('0x8')](_0xaa41('0xf8'),express[_0xaa41('0xf1')](path[_0xaa41('0xf4')](config['root'],_0xaa41('0xf9'))));_0x3168be[_0xaa41('0xfa')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xaa41('0xfb')](errors[0x194]);_0x3168be[_0xaa41('0xfa')]('/*')[_0xaa41('0xfb')](function(_0x20184e,_0x298533){_0x298533[_0xaa41('0xfc')](path[_0xaa41('0xfd')](_0x3168be[_0xaa41('0xfb')]('appPath')+_0xaa41('0xfe')));});return _0x3168be;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d30c464..57b5782 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f8a=['../config/triggers','default','lodash','../config/environment','listen','merge','../api/user/user.rpc','../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/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.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/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0f8a,0x160));var _0xa0f8=function(_0x4c0093,_0x1cba61){_0x4c0093=_0x4c0093-0x0;var _0x435758=_0x0f8a[_0x4c0093];return _0x435758;};'use strict';var jayson=require('jayson/promise');var _=require(_0xa0f8('0x0'));var config=require(_0xa0f8('0x1'));exports[_0xa0f8('0x2')]=function(){return new Promise(function(_0x517b9e,_0xfd32f0){var _0x5cb090={};_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x4')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x5')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x6')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x7')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x8')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x9')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0xa')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0xb')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0xc')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0xd')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0xe')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0xf')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x10')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/mailMessage/mailMessage.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x11')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x12')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x13')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/faxApplication/faxApplication.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/faxInteraction/faxInteraction.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x14')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x15')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/smsAccount/smsAccount.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x16')));_0x5cb090=_['merge'](_0x5cb090,require('../api/smsMessage/smsMessage.rpc'));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x17')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x18')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x19')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x1a')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x1b')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x1c')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x1d')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/chatMessage/chatMessage.rpc'));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x1e')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x1f')));_0x5cb090=_['merge'](_0x5cb090,require('../api/cmHopper/cmHopper.rpc'));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x20')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x21')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x22')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x23')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x24')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x25')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x26')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x27')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x28')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x29')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x2a')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x2b')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x2c')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x2d')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x2e')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x2f')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x30')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x31')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x32')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x33')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/squareReport/squareReport.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/setting/setting.rpc'));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x34')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x35')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x36')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x37')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x38')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x39')));_0x5cb090=_['merge'](_0x5cb090,require(_0xa0f8('0x3a')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x3b')));_0x5cb090=_['merge'](_0x5cb090,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x3c')));_0x5cb090=_[_0xa0f8('0x3')](_0x5cb090,require(_0xa0f8('0x3d')));var _0x438166=jayson[_0xa0f8('0x3e')](_0x5cb090)['http']();var _0xb89763=config['rpc']['port']||config[_0xa0f8('0x3f')]+0x1;var _0x4c92db=config[_0xa0f8('0x40')]['ip']||_0xa0f8('0x41');_0x438166['on']('error',function(_0x195893){return _0xfd32f0(_0x195893);});_0x438166['listen'](_0xb89763,_0x4c92db,function(){console[_0xa0f8('0x42')](_0xa0f8('0x43'),_0x4c92db,_0xb89763);require(_0xa0f8('0x44'))[_0xa0f8('0x45')]();return _0x517b9e('RPC\x20listening\x20on\x20'+_0x4c92db+':'+_0xb89763);});});}; \ No newline at end of file +var _0x2652=['../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.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/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x28eb88,_0x659a98){var _0x5e00bd=function(_0x2a0b9f){while(--_0x2a0b9f){_0x28eb88['push'](_0x28eb88['shift']());}};_0x5e00bd(++_0x659a98);}(_0x2652,0x146));var _0x2265=function(_0xba68c1,_0x17c56d){_0xba68c1=_0xba68c1-0x0;var _0x274832=_0x2652[_0xba68c1];return _0x274832;};'use strict';var jayson=require(_0x2265('0x0'));var _=require(_0x2265('0x1'));var config=require(_0x2265('0x2'));exports[_0x2265('0x3')]=function(){return new Promise(function(_0x5dbd40,_0x45d726){var _0x3db8a3={};_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x4')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/voiceExtension/voiceExtension.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x6')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x7')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x8')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x9')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0xa')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0xb')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0xc')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/trunk/trunk.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0xd')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0xe')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0xf')));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/mailAccount/mailAccount.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x10')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x11')));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/mailMessage/mailMessage.rpc'));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/mailApplication/mailApplication.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x12')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x13')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x14')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x15')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x16')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x17')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x18')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x19')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x1a')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x1b')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x1c')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x1d')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x1e')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x1f')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x20')));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/chatMessage/chatMessage.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x21')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x22')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x23')));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x24')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x25')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x26')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x27')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x28')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x29')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x2a')));_0x3db8a3=_['merge'](_0x3db8a3,require('../api/trigger/trigger.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x2b')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x2c')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x2d')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x2e')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x2f')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x30')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x31')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x32')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x33')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x34')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x35')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x36')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x37')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/squareReport/squareReport.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x38')));_0x3db8a3=_['merge'](_0x3db8a3,require(_0x2265('0x39')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3a')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3b')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3c')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/squareMessage/squareMessage.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/campaign/campaign.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3d')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3e')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x3f')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x40')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x41')));_0x3db8a3=_[_0x2265('0x5')](_0x3db8a3,require(_0x2265('0x42')));var _0x3eb9c8=jayson['server'](_0x3db8a3)[_0x2265('0x43')]();var _0x3dbfeb=config[_0x2265('0x44')][_0x2265('0x45')]||config[_0x2265('0x45')]+0x1;var _0x3947c7=config[_0x2265('0x44')]['ip']||_0x2265('0x46');_0x3eb9c8['on']('error',function(_0x32483){return _0x45d726(_0x32483);});_0x3eb9c8['listen'](_0x3dbfeb,_0x3947c7,function(){console[_0x2265('0x47')](_0x2265('0x48'),_0x3947c7,_0x3dbfeb);require(_0x2265('0x49'))['default']();return _0x5dbd40(_0x2265('0x4a')+_0x3947c7+':'+_0x3dbfeb);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index cbdda4d..e88dbec 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 _0xc16d=['write','prototype','sendRequest','command','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','result=','indexOf','substr','startsWith','length','match','error','close','E_AGI_SOCKET_TIMEOUT','destroy','pipe'];(function(_0x6f2d8,_0x179d7e){var _0x647267=function(_0x17220a){while(--_0x17220a){_0x6f2d8['push'](_0x6f2d8['shift']());}};_0x647267(++_0x179d7e);}(_0xc16d,0x145));var _0xdc16=function(_0x30a6a7,_0xc5189a){_0x30a6a7=_0x30a6a7-0x0;var _0x1cf28f=_0xc16d[_0x30a6a7];return _0x1cf28f;};'use strict';var util=require(_0xdc16('0x0'));var _=require(_0xdc16('0x1'));var EventEmitter=require(_0xdc16('0x2'))[_0xdc16('0x3')];var AGIReply=require(_0xdc16('0x4'));var AGIError=require(_0xdc16('0x5'));function AGIChannel(_0x3a546a){var _0x5d9149=this,_0x5806fe=new AGIReply(),_0x1beaa1=![],_0x1da17e={};EventEmitter[_0xdc16('0x6')](_0x5d9149);_0x3a546a[_0xdc16('0x7')](_0xdc16('0x8'));_0x3a546a[_0xdc16('0x9')](0x8*0x3c*0x3c*0x3e8);_0x5806fe[_0xdc16('0x7')](_0xdc16('0x8'));_0x5806fe['on'](_0xdc16('0xa'),function(_0x25bde7){for(var _0xfc2bb3 in _0x25bde7){_0x5d9149[_0xfc2bb3]=_0x25bde7[_0xfc2bb3];}_0x5d9149[_0xdc16('0xb')](_0xdc16('0xc'));});_0x5806fe['on'](_0xdc16('0xd'),function(_0x430bdc){if(_0x430bdc['toLowerCase']()==_0xdc16('0xe')){_0x5d9149[_0xdc16('0xb')](_0xdc16('0xe'));return;}if(_0x430bdc[_0xdc16('0xf')](0x0,0xb)=='520-Invalid'){_0x1beaa1=!![];}if(_0x1beaa1){_0x1da17e['rx']+=_0x430bdc+'\x0a';if(_0x430bdc[_0xdc16('0x10')](_0xdc16('0x11'))!=-0x1){_0x1beaa1=![];}}else{_0x1da17e['rx']=_0x430bdc;}if(_0x1beaa1){return;}if(typeof _0x1da17e['cb']==_0xdc16('0x12')){var _0x1224c6=_0x1da17e['rx']['substring'](0x0,0x3),_0x5137db=null,_0x42ce38=null;_0x1224c6=parseInt(_0x1224c6);if(isNaN(_0x1224c6)){_0x1da17e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1224c6!=0xc8){_0x1da17e['cb'](null,{'code':_0x1224c6,'result':-0x1,'extra':'KO'});return;}_0x5137db=_0x1da17e['rx'][_0xdc16('0xf')](0x4)['replace'](_0xdc16('0x13'),'');if(_0x5137db[_0xdc16('0x14')]('\x20')!=-0x1){_0x5137db=_0x5137db[_0xdc16('0x15')](0x0,_0x5137db['indexOf']('\x20'));}if(_[_0xdc16('0x16')](_0x5137db,'-1')){_0x5137db=parseInt(_0x5137db);}_0x42ce38=_0x1da17e['rx']['split']('\x20');if(_0x42ce38[_0xdc16('0x17')]==0x3){_0x42ce38=_0x42ce38[0x2][_0xdc16('0xf')](0x1,_0x42ce38[0x2][_0xdc16('0x17')]-0x1);}else if(_0x42ce38[_0xdc16('0x17')]>0x3){var _0x4d6ec2=/\((.+)\)/;var _0x3742db=_0x1da17e['rx'][_0xdc16('0x18')](_0x4d6ec2);if(_0x3742db){_0x42ce38=_0x3742db[0x1];}else{_0x42ce38=null;}}else{_0x42ce38=null;}_0x1da17e['cb'](null,{'code':_0x1224c6,'result':_0x5137db,'extra':_0x42ce38});}});_0x3a546a['on']('error',function(_0x37b627){_0x5d9149[_0xdc16('0xb')](_0xdc16('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x37b627['code']));});_0x3a546a['on'](_0xdc16('0x1a'),function(){_0x5d9149[_0xdc16('0xb')](_0xdc16('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3a546a['on']('timeout',function(){_0x5d9149['emit']('timeout',new AGIError(_0xdc16('0x1b')));_0x3a546a[_0xdc16('0x1c')]();});_0x3a546a[_0xdc16('0x1d')](_0x5806fe);this['command']=function(_0x5a4141,_0x504c04){var _0x5a4141=_0x5a4141||'',_0x504c04=typeof _0x504c04==_0xdc16('0x12')?_0x504c04:new Function();_0x1da17e={'tx':_0x5a4141,'rx':'','cb':_0x504c04};_0x3a546a[_0xdc16('0x1e')](_0x5a4141+'\x0a');},this[_0xdc16('0x1a')]=function(){_0x3a546a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xdc16('0x1f')][_0xdc16('0x20')]=function(_0x44946c){return this[_0xdc16('0x21')]['sync'](this,_0x44946c);};AGIChannel['prototype']['answer']=function(){return this[_0xdc16('0x20')](_0xdc16('0x22'));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x23')]=function(_0x235f78,_0x38ab82,_0x19d40c){_0x235f78=_0x235f78===undefined?_0xdc16('0x24'):_0x235f78;_0x38ab82=_0x38ab82===undefined?'5':_0x38ab82;_0x19d40c=_0x19d40c===undefined?'1':_0x19d40c;return this['sendRequest'](util['format'](_0xdc16('0x25'),_0x235f78,_0x38ab82*0x3e8,_0x19d40c));};AGIChannel[_0xdc16('0x1f')]['noop']=function(_0x44f7b3){_0x44f7b3=_0x44f7b3||'NO\x20MESSAGE';return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x27'),_0x44f7b3));};AGIChannel['prototype'][_0xdc16('0x28')]=function(_0x50da0f,_0x224965){if(_['isArray'](_0x224965)){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x29'),_0x50da0f,_0x224965['join'](',')));}return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x29'),_0x50da0f,_0x224965));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x2a')]=function(_0x525615){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x2b'),_0x525615));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x2c')]=function(_0x536430){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x2d'),_0x536430));};AGIChannel['prototype'][_0xdc16('0x2e')]=function(_0x25498e){return this[_0xdc16('0x20')](util['format'](_0xdc16('0x2f'),_0x25498e));};AGIChannel['prototype'][_0xdc16('0xe')]=function(){return this[_0xdc16('0x20')](_0xdc16('0x30'));};AGIChannel['prototype']['setVariable']=function(_0x55cfb2,_0x4c258d){var _0x2ddfe7=_[_0xdc16('0x31')](_0x4c258d)||_[_0xdc16('0x32')](_0x4c258d)?_0x4c258d[_0xdc16('0x33')]():_0x4c258d;return this['sendRequest'](util[_0xdc16('0x26')](_0xdc16('0x34'),_0x55cfb2,_0x2ddfe7?_0x2ddfe7[_0xdc16('0x33')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xdc16('0x35')]=function(_0x568608,_0x974a74){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x36'),_0x568608,_0x974a74));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x37')]=function(_0x144f05,_0x599c2c){return this[_0xdc16('0x20')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x144f05,_0x599c2c));};AGIChannel[_0xdc16('0x1f')]['sayPhonetic']=function(_0x4f5e8a,_0x3135d1){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x38'),_0x4f5e8a,_0x3135d1));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x39')]=function(_0xd26370,_0x550f7b,_0x27a901){_0x550f7b=_0x550f7b||this['extension'];_0x27a901=_0x27a901||0x1;this[_0xdc16('0x2a')](_0xd26370);this['setExtension'](_0x550f7b);this['setPriority'](_0x27a901);return this[_0xdc16('0x3a')](util[_0xdc16('0x26')](_0xdc16('0x3b'),_0xd26370,_0x550f7b,_0x27a901));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x3c')]=function(_0x2e8964){return this[_0xdc16('0x20')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2e8964));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x3d')]=function(_0x59326d,_0x44a063,_0x14f724,_0x36d7d8,_0xcf6818,_0x3c1b59){_0x44a063=_0x44a063||_0xdc16('0x3e');_0x14f724=_0x14f724||'';_0x36d7d8=_0x36d7d8===undefined?-0x1:_0x36d7d8==='-1'?-0x1:_0x36d7d8*0x3e8;_0xcf6818=_0xcf6818===undefined?'':'s='+_0xcf6818;_0x3c1b59=_0x3c1b59?_0xdc16('0x3f'):'';return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x40'),_0x59326d,_0x44a063,_0x14f724,_0x36d7d8,_0x3c1b59,_0xcf6818));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x41')]=function(_0xa5e6c8,_0x4aa2dd){_0x4aa2dd=_0x4aa2dd||'';return this[_0xdc16('0x20')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xa5e6c8,_0x4aa2dd));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x42')]=function(_0x16ca3d){return this[_0xdc16('0x28')](_0xdc16('0x43'),_0x16ca3d);};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x44')]=function(_0x3be11b){return this[_0xdc16('0x28')]('WAIT',_0x3be11b);};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x19')]=function(_0x1e998d,_0x33f50e){this[_0xdc16('0x3a')](util[_0xdc16('0x26')](_0xdc16('0x45'),_0x1e998d['id'],_0x1e998d['label'],_0x33f50e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdc16('0x46')]=AGIChannel; \ No newline at end of file +var _0x5893=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','wav','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','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','prototype','sendRequest','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0x5dce8e,_0x3210b3){var _0x129894=function(_0x1e3b10){while(--_0x1e3b10){_0x5dce8e['push'](_0x5dce8e['shift']());}};_0x129894(++_0x3210b3);}(_0x5893,0xf3));var _0x3589=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5893[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require('util');var _=require(_0x3589('0x0'));var EventEmitter=require(_0x3589('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x3589('0x2'));function AGIChannel(_0x3682ac){var _0x2a5c4d=this,_0x71591f=new AGIReply(),_0xd261a2=![],_0x3aec17={};EventEmitter['call'](_0x2a5c4d);_0x3682ac[_0x3589('0x3')](_0x3589('0x4'));_0x3682ac[_0x3589('0x5')](0x8*0x3c*0x3c*0x3e8);_0x71591f[_0x3589('0x3')](_0x3589('0x4'));_0x71591f['on'](_0x3589('0x6'),function(_0x2ee74c){for(var _0x4351b6 in _0x2ee74c){_0x2a5c4d[_0x4351b6]=_0x2ee74c[_0x4351b6];}_0x2a5c4d[_0x3589('0x7')](_0x3589('0x8'));});_0x71591f['on'](_0x3589('0x9'),function(_0x2e6caf){if(_0x2e6caf[_0x3589('0xa')]()==_0x3589('0xb')){_0x2a5c4d[_0x3589('0x7')]('hangup');return;}if(_0x2e6caf[_0x3589('0xc')](0x0,0xb)==_0x3589('0xd')){_0xd261a2=!![];}if(_0xd261a2){_0x3aec17['rx']+=_0x2e6caf+'\x0a';if(_0x2e6caf[_0x3589('0xe')](_0x3589('0xf'))!=-0x1){_0xd261a2=![];}}else{_0x3aec17['rx']=_0x2e6caf;}if(_0xd261a2){return;}if(typeof _0x3aec17['cb']==_0x3589('0x10')){var _0x4f979b=_0x3aec17['rx']['substring'](0x0,0x3),_0xcfa37=null,_0x1e5622=null;_0x4f979b=parseInt(_0x4f979b);if(isNaN(_0x4f979b)){_0x3aec17['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3589('0x11')});return;}if(_0x4f979b!=0xc8){_0x3aec17['cb'](null,{'code':_0x4f979b,'result':-0x1,'extra':'KO'});return;}_0xcfa37=_0x3aec17['rx']['substring'](0x4)['replace'](_0x3589('0x12'),'');if(_0xcfa37['indexOf']('\x20')!=-0x1){_0xcfa37=_0xcfa37[_0x3589('0x13')](0x0,_0xcfa37['indexOf']('\x20'));}if(_['startsWith'](_0xcfa37,'-1')){_0xcfa37=parseInt(_0xcfa37);}_0x1e5622=_0x3aec17['rx'][_0x3589('0x14')]('\x20');if(_0x1e5622[_0x3589('0x15')]==0x3){_0x1e5622=_0x1e5622[0x2][_0x3589('0xc')](0x1,_0x1e5622[0x2]['length']-0x1);}else if(_0x1e5622[_0x3589('0x15')]>0x3){var _0x6b4447=/\((.+)\)/;var _0x5db74f=_0x3aec17['rx'][_0x3589('0x16')](_0x6b4447);if(_0x5db74f){_0x1e5622=_0x5db74f[0x1];}else{_0x1e5622=null;}}else{_0x1e5622=null;}_0x3aec17['cb'](null,{'code':_0x4f979b,'result':_0xcfa37,'extra':_0x1e5622});}});_0x3682ac['on']('error',function(_0x4b6426){_0x2a5c4d[_0x3589('0x7')](_0x3589('0x17'),new AGIError(_0x3589('0x18'),_0x4b6426[_0x3589('0x19')]));});_0x3682ac['on']('close',function(){_0x2a5c4d[_0x3589('0x7')](_0x3589('0x1a'),new AGIError(_0x3589('0x1b')));});_0x3682ac['on']('timeout',function(){_0x2a5c4d[_0x3589('0x7')](_0x3589('0x1c'),new AGIError(_0x3589('0x1d')));_0x3682ac[_0x3589('0x1e')]();});_0x3682ac['pipe'](_0x71591f);this[_0x3589('0x1f')]=function(_0x526b34,_0x2d8009){var _0x526b34=_0x526b34||'',_0x2d8009=typeof _0x2d8009==_0x3589('0x10')?_0x2d8009:new Function();_0x3aec17={'tx':_0x526b34,'rx':'','cb':_0x2d8009};_0x3682ac[_0x3589('0x20')](_0x526b34+'\x0a');},this[_0x3589('0x1a')]=function(){_0x3682ac['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x3589('0x21')][_0x3589('0x22')]=function(_0x1b6755){return this[_0x3589('0x1f')][_0x3589('0x23')](this,_0x1b6755);};AGIChannel[_0x3589('0x21')]['answer']=function(){return this[_0x3589('0x22')](_0x3589('0x24'));};AGIChannel['prototype'][_0x3589('0x25')]=function(_0x38b22a,_0x70a8fc,_0x5b9198){_0x38b22a=_0x38b22a===undefined?_0x3589('0x26'):_0x38b22a;_0x70a8fc=_0x70a8fc===undefined?'5':_0x70a8fc;_0x5b9198=_0x5b9198===undefined?'1':_0x5b9198;return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x28'),_0x38b22a,_0x70a8fc*0x3e8,_0x5b9198));};AGIChannel[_0x3589('0x21')][_0x3589('0x29')]=function(_0x4ba09f){_0x4ba09f=_0x4ba09f||_0x3589('0x2a');return this[_0x3589('0x22')](util['format']('VERBOSE\x20\x22%s\x22',_0x4ba09f));};AGIChannel[_0x3589('0x21')][_0x3589('0x2b')]=function(_0x31c775,_0x2c140c){if(_[_0x3589('0x2c')](_0x2c140c)){return this[_0x3589('0x22')](util[_0x3589('0x27')]('EXEC\x20%s\x20%s',_0x31c775,_0x2c140c['join'](',')));}return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x2d'),_0x31c775,_0x2c140c));};AGIChannel['prototype'][_0x3589('0x2e')]=function(_0xf5bb09){return this[_0x3589('0x22')](util['format'](_0x3589('0x2f'),_0xf5bb09));};AGIChannel[_0x3589('0x21')][_0x3589('0x30')]=function(_0x4dcf34){return this[_0x3589('0x22')](util['format']('SET\x20EXTENSION\x20%s',_0x4dcf34));};AGIChannel[_0x3589('0x21')][_0x3589('0x31')]=function(_0x2a659e){return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x32'),_0x2a659e));};AGIChannel['prototype']['hangup']=function(){return this[_0x3589('0x22')](_0x3589('0x33'));};AGIChannel['prototype']['setVariable']=function(_0x131aab,_0x1c78ee){var _0x1c42be=_[_0x3589('0x34')](_0x1c78ee)||_[_0x3589('0x35')](_0x1c78ee)?_0x1c78ee[_0x3589('0x36')]():_0x1c78ee;return this['sendRequest'](util['format'](_0x3589('0x37'),_0x131aab,_0x1c42be?_0x1c42be['toString']()[_0x3589('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x3589('0x39')]=function(_0x54ecc7,_0x394a0e){return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x3a'),_0x54ecc7,_0x394a0e));};AGIChannel[_0x3589('0x21')][_0x3589('0x3b')]=function(_0x154df9,_0x8015a0){return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x3c'),_0x154df9,_0x8015a0));};AGIChannel[_0x3589('0x21')][_0x3589('0x3d')]=function(_0xcf1c3c,_0x18f84c){return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x3e'),_0xcf1c3c,_0x18f84c));};AGIChannel[_0x3589('0x21')][_0x3589('0x3f')]=function(_0x4b5afd,_0x57d069,_0x406a2e){_0x57d069=_0x57d069||this[_0x3589('0x40')];_0x406a2e=_0x406a2e||0x1;this[_0x3589('0x2e')](_0x4b5afd);this['setExtension'](_0x57d069);this[_0x3589('0x31')](_0x406a2e);return this[_0x3589('0x29')](util[_0x3589('0x27')](_0x3589('0x41'),_0x4b5afd,_0x57d069,_0x406a2e));};AGIChannel['prototype']['getVariable']=function(_0x1b4029){return this[_0x3589('0x22')](util[_0x3589('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x1b4029));};AGIChannel[_0x3589('0x21')]['recordFile']=function(_0x1ae710,_0x493577,_0x42a411,_0x507ac1,_0x44fc30,_0x9fe2a9){_0x493577=_0x493577||_0x3589('0x42');_0x42a411=_0x42a411||'';_0x507ac1=_0x507ac1===undefined?-0x1:_0x507ac1==='-1'?-0x1:_0x507ac1*0x3e8;_0x44fc30=_0x44fc30===undefined?'':'s='+_0x44fc30;_0x9fe2a9=_0x9fe2a9?'BEEP':'';return this[_0x3589('0x22')](util['format'](_0x3589('0x43'),_0x1ae710,_0x493577,_0x42a411,_0x507ac1,_0x9fe2a9,_0x44fc30));};AGIChannel['prototype'][_0x3589('0x44')]=function(_0x1f6ab8,_0x2afe4d){_0x2afe4d=_0x2afe4d||'';return this[_0x3589('0x22')](util[_0x3589('0x27')](_0x3589('0x45'),_0x1f6ab8,_0x2afe4d));};AGIChannel[_0x3589('0x21')][_0x3589('0x46')]=function(_0x2084b1){return this[_0x3589('0x2b')](_0x3589('0x47'),_0x2084b1);};AGIChannel['prototype']['wait']=function(_0x3e8d4b){return this[_0x3589('0x2b')](_0x3589('0x48'),_0x3e8d4b);};AGIChannel[_0x3589('0x21')][_0x3589('0x17')]=function(_0x2685bf,_0xdb73d1){this[_0x3589('0x29')](util[_0x3589('0x27')](_0x3589('0x49'),_0x2685bf['id'],_0x2685bf[_0x3589('0x4a')],_0xdb73d1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3589('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index fa0ac4b..547925f 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 _0xfeb3=['E_AGI_UNDEFINED','push','format','apply','name','exports','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x3703a1,_0x2a829a){var _0x5c8596=function(_0x3e130e){while(--_0x3e130e){_0x3703a1['push'](_0x3703a1['shift']());}};_0x5c8596(++_0x2a829a);}(_0xfeb3,0x1da));var _0x3feb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfeb3[_0x21a9d9];return _0x46adce;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x3feb('0x0'),'E_AGI_SERVER_CLOSE':_0x3feb('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0x3feb('0x2'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x3feb('0x3'),'E_AGI_SOCKET_CLOSE':_0x3feb('0x4'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x3feb('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3feb('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4f6349){var _0x4f6349=_0x4f6349||null,_0x19a6b0=_0x19a6b0||[],_0x14c1c6=0x1,_0x5b0fbc='';if(!error[_0x4f6349]){_0x4f6349=_0x3feb('0x7');}_0x19a6b0['push'](error[_0x4f6349]);while(arguments[_0x14c1c6]){_0x19a6b0[_0x3feb('0x8')](arguments[_0x14c1c6]);_0x14c1c6++;}_0x5b0fbc=util[_0x3feb('0x9')][_0x3feb('0xa')](util,_0x19a6b0);this['message']=_0x5b0fbc;this[_0x3feb('0xb')]=_0x4f6349;}module[_0x3feb('0xc')]=AGIError; \ No newline at end of file +var _0x0348=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','util','Undefined\x20error.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x4c6e25,_0x212e36){var _0x59ee50=function(_0x4ca147){while(--_0x4ca147){_0x4c6e25['push'](_0x4c6e25['shift']());}};_0x59ee50(++_0x212e36);}(_0x0348,0xc8));var _0x8034=function(_0x5c7158,_0x40146f){_0x5c7158=_0x5c7158-0x0;var _0x526bc4=_0x0348[_0x5c7158];return _0x526bc4;};'use strict';var util=require(_0x8034('0x0'));var error={'E_AGI_UNDEFINED':_0x8034('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':_0x8034('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x8034('0x3'),'E_AGI_SOCKET_CLOSE':_0x8034('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x8034('0x5'),'E_AGI_COMMAND_EMPTY':_0x8034('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8034('0x7'),'E_AGI_IVR_ENTRY':_0x8034('0x8')};function AGIError(_0x515044){var _0x515044=_0x515044||null,_0x4642b5=_0x4642b5||[],_0x261f84=0x1,_0x22b22a='';if(!error[_0x515044]){_0x515044=_0x8034('0x9');}_0x4642b5[_0x8034('0xa')](error[_0x515044]);while(arguments[_0x261f84]){_0x4642b5[_0x8034('0xa')](arguments[_0x261f84]);_0x261f84++;}_0x22b22a=util[_0x8034('0xb')]['apply'](util,_0x4642b5);this[_0x8034('0xc')]=_0x22b22a;this['name']=_0x515044;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index badbb23..ff76ed8 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 _0xad84=['relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits','prototype','vertices','edges','addEdge','push','numberOfEdges','size'];(function(_0x2f0c2e,_0x234993){var _0x47351a=function(_0x3ae990){while(--_0x3ae990){_0x2f0c2e['push'](_0x2f0c2e['shift']());}};_0x47351a(++_0x234993);}(_0xad84,0x149));var _0x4ad8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xad84[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4ad8('0x0'));var logger=require('../../../config/logger')(_0x4ad8('0x1'));var verticesWithRetry=[_0x4ad8('0x2'),_0x4ad8('0x3'),_0x4ad8('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x4ad8('0x5')]['addVertex']=function(_0x9849cd){this[_0x4ad8('0x6')][_0x9849cd['id']]=_0x9849cd;this[_0x4ad8('0x7')][_0x9849cd['id']]=[];};Graph[_0x4ad8('0x5')][_0x4ad8('0x8')]=function(_0x518831,_0x2ddf6e,_0x325835){this[_0x4ad8('0x7')][_0x518831][_0x4ad8('0x9')]({'target':_0x2ddf6e,'condition':_0x325835});this[_0x4ad8('0xa')]+=0x1;};Graph['prototype'][_0x4ad8('0xb')]=function(){return _[_0x4ad8('0xb')](this['vertices']);};Graph[_0x4ad8('0x5')][_0x4ad8('0xc')]=function(){return this[_0x4ad8('0xa')];};Graph[_0x4ad8('0x5')][_0x4ad8('0xd')]=function(_0x217ea9){return this[_0x4ad8('0x6')][_0x217ea9];};Graph[_0x4ad8('0x5')][_0x4ad8('0xe')]=function(_0x4a8395,_0x361eb3){if(!this[_0x4ad8('0x6')][_0x4a8395]){return logger[_0x4ad8('0xf')](_0x4ad8('0x10'));}var _0x4ea8c3=_0x361eb3(this[_0x4ad8('0x6')][_0x4a8395]);if(!_0x4ea8c3){return logger[_0x4ad8('0xf')]('stop\x20traverse');}if(this[_0x4ad8('0x7')][_0x4a8395][_0x4ad8('0x11')]===0x0){return logger[_0x4ad8('0xf')](_0x4ad8('0x12'));}for(var _0x332336=0x0,_0x547207=[],_0x294a3f=![];_0x332336\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','then','hasOwnProperty','indexOf','agi_','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup'];(function(_0x7f120b,_0x58dfe2){var _0x2dda53=function(_0x5dcc70){while(--_0x5dcc70){_0x7f120b['push'](_0x7f120b['shift']());}};_0x2dda53(++_0x58dfe2);}(_0x7c35,0x128));var _0x57c3=function(_0x3e9146,_0x138239){_0x3e9146=_0x3e9146-0x0;var _0x1a46d0=_0x7c35[_0x3e9146];return _0x1a46d0;};'use strict';var _=require('lodash');var syncho=require(_0x57c3('0x0'));var util=require('util');var config=require(_0x57c3('0x1'));var logger=require(_0x57c3('0x2'))(_0x57c3('0x3'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x57c3('0x4'));var projects=[];config['agi']=_[_0x57c3('0x5')](config['agi'],{'ip':_0x57c3('0x6'),'port':0x11dd});function connectionHandler(_0x3b136e){process[_0x57c3('0x7')](function(){syncho(function(){try{setChannelVariables(_0x3b136e);agiHandler(_0x3b136e);}catch(_0x301fcc){logger[_0x57c3('0x8')](_0x301fcc[_0x57c3('0x9')]);}});});}function projectUpdateHandler(_0x194b80){try{var _0x269d86=JSON[_0x57c3('0xa')](_0x194b80);var _0x23f1b0=_[_0x57c3('0xb')](projects,['id',_0x269d86['id']]);if(_0x23f1b0>-0x1){if(_0x269d86[_0x57c3('0xc')]===!![]){projects[_0x57c3('0xd')](_0x23f1b0,0x1);}else{projects[_0x23f1b0]=_0x269d86;}}else{projects[_0x57c3('0xe')](_0x269d86);}}catch(_0xa90c77){logger[_0x57c3('0x8')](_0xa90c77[_0x57c3('0x9')]);}}function listeningHandler(){console[_0x57c3('0xf')](_0x57c3('0x10'),config[_0x57c3('0x3')][_0x57c3('0x11')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x57c3('0x3')]['ip'],config['agi']['port']));}function errorHandler(_0x1a9689){if(_0x1a9689&&_0x1a9689[_0x57c3('0x12')]&&_0x1a9689[_0x57c3('0x13')]){logger[_0x57c3('0x8')](util[_0x57c3('0x14')]('[%s]\x20%s',_0x1a9689[_0x57c3('0x12')],_0x1a9689[_0x57c3('0x13')]));}else{logger[_0x57c3('0x8')](util[_0x57c3('0x14')](_0x57c3('0x15'),_0x1a9689['stack']));}}function closeHandler(){logger[_0x57c3('0x16')](util[_0x57c3('0x14')](_0x57c3('0x17'),this[_0x57c3('0x18')],this[_0x57c3('0x19')],this[_0x57c3('0x1a')],this[_0x57c3('0x1b')],this[_0x57c3('0x1c')]));try{createSquareReport(this);}catch(_0x4e562f){logger['error'](_0x4e562f[_0x57c3('0x9')]);}}function timeoutHandler(){logger[_0x57c3('0x16')](util[_0x57c3('0x14')](_0x57c3('0x1d'),this[_0x57c3('0x18')],this[_0x57c3('0x19')],this[_0x57c3('0x1a')],this['dnid'],this[_0x57c3('0x1c')]));}function hangupHandler(){logger[_0x57c3('0x16')](util[_0x57c3('0x14')](_0x57c3('0x1e'),this['arg_1'],this['calleridname'],this[_0x57c3('0x1a')],this['dnid'],this[_0x57c3('0x1c')]));this['evtHangup']=!![];}function createSquareReport(_0x5dae4d,_0x24ba28){rpc['createSquareReport'](_0x5dae4d)[_0x57c3('0x1f')](function(_0x48661d){if(_0x24ba28){_0x24ba28(null,_0x48661d);}})['catch'](function(_0xb2b2d9){if(_0x24ba28){_0x24ba28(null,_0xb2b2d9);}});}function setChannelVariables(_0x1afed5){for(var _0x13685b in _0x1afed5){if(_0x1afed5[_0x57c3('0x20')](_0x13685b)){if(_0x13685b[_0x57c3('0x21')](_0x57c3('0x22'))===0x0){_0x1afed5[_0x13685b['substring'](0x4)]=_0x1afed5[_0x13685b];delete _0x1afed5[_0x13685b];}}}}function agiHandler(_0x5389ab){logger['debug'](_0x57c3('0x23'),JSON[_0x57c3('0x24')](_0x5389ab,null,0x2));logger[_0x57c3('0x16')](util[_0x57c3('0x14')](_0x57c3('0x25'),_0x5389ab[_0x57c3('0x18')],_0x5389ab[_0x57c3('0x19')],_0x5389ab[_0x57c3('0x1a')],_0x5389ab[_0x57c3('0x1b')],_0x5389ab[_0x57c3('0x1c')]));_0x5389ab['on'](_0x57c3('0x8'),errorHandler);_0x5389ab['on']('close',closeHandler);_0x5389ab['on'](_0x57c3('0x26'),timeoutHandler);_0x5389ab[_0x57c3('0x27')]=![];_0x5389ab['on']('hangup',hangupHandler);var _0x22d809=_[_0x57c3('0x28')](projects,[_0x57c3('0x12'),_0x5389ab['arg_1']]);if(!_0x22d809)return Project['handleNotFound'](_0x5389ab);if(!_0x22d809[_0x57c3('0x29')])return Project[_0x57c3('0x2a')](_0x5389ab);return Project[_0x57c3('0x2b')](_0x22d809,_0x5389ab);}function main(){var _0x425ace;return utilLicense[_0x57c3('0x2c')]()[_0x57c3('0x1f')](function(_0x1a370c){if(!_0x1a370c)return;if(_0x1a370c[_0x57c3('0x2d')]){if(_0x1a370c['callysquare']&&_0x1a370c[_0x57c3('0x2e')]>0x0){logger[_0x57c3('0x16')](util[_0x57c3('0x14')](_0x57c3('0x2f'),_0x1a370c[_0x57c3('0x2e')]));_0x425ace=_0x1a370c['callysquare'];}else{logger[_0x57c3('0x16')](_0x57c3('0x30'));}}else{logger[_0x57c3('0x16')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x425ace=-0x1;}})[_0x57c3('0x1f')](function(){return Project[_0x57c3('0x31')]();})['then'](function(_0x3e992d){projects=_0x3e992d;return;})[_0x57c3('0x32')](function(_0x2ffe3b){logger[_0x57c3('0x8')]('[LICENSE]',_0x2ffe3b[_0x57c3('0x9')]);})[_0x57c3('0x33')](function(){var _0x379ca1=require(_0x57c3('0x34'))(config[_0x57c3('0x3')]['port'],config[_0x57c3('0x3')]['ip'],_0x425ace);_0x379ca1['on'](_0x57c3('0x8'),errorHandler);_0x379ca1['on'](_0x57c3('0x35'),listeningHandler);_0x379ca1['on'](_0x57c3('0x36'),connectionHandler);_0x379ca1['on']('close',closeHandler);_0x379ca1['on'](_0x57c3('0x37'),projectUpdateHandler);});}main(); \ No newline at end of file +var _0xb041=['splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','timeout','find','handleNotFound','production','handleUnpublished','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','defaults','nextTick','error','stack','findIndex','deleted'];(function(_0x31ddba,_0x28ec26){var _0x3f014c=function(_0x24aa10){while(--_0x24aa10){_0x31ddba['push'](_0x31ddba['shift']());}};_0x3f014c(++_0x28ec26);}(_0xb041,0x99));var _0x1b04=function(_0x1d9dfa,_0x422bcc){_0x1d9dfa=_0x1d9dfa-0x0;var _0x16df23=_0xb041[_0x1d9dfa];return _0x16df23;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x1b04('0x0'));var config=require(_0x1b04('0x1'));var logger=require(_0x1b04('0x2'))(_0x1b04('0x3'));var utilLicense=require(_0x1b04('0x4'));var rpc=require('./rpc');var Project=require(_0x1b04('0x5'));var projects=[];config[_0x1b04('0x3')]=_[_0x1b04('0x6')](config[_0x1b04('0x3')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x212f96){process[_0x1b04('0x7')](function(){syncho(function(){try{setChannelVariables(_0x212f96);agiHandler(_0x212f96);}catch(_0x1b152a){logger[_0x1b04('0x8')](_0x1b152a[_0x1b04('0x9')]);}});});}function projectUpdateHandler(_0x34b965){try{var _0x54026f=JSON['parse'](_0x34b965);var _0x2a2e3c=_[_0x1b04('0xa')](projects,['id',_0x54026f['id']]);if(_0x2a2e3c>-0x1){if(_0x54026f[_0x1b04('0xb')]===!![]){projects[_0x1b04('0xc')](_0x2a2e3c,0x1);}else{projects[_0x2a2e3c]=_0x54026f;}}else{projects[_0x1b04('0xd')](_0x54026f);}}catch(_0x32edd3){logger['error'](_0x32edd3['stack']);}}function listeningHandler(){console[_0x1b04('0xe')](_0x1b04('0xf'),config[_0x1b04('0x3')][_0x1b04('0x10')]);logger[_0x1b04('0x11')](util['format'](_0x1b04('0x12'),config['agi']['ip'],config[_0x1b04('0x3')][_0x1b04('0x10')]));}function errorHandler(_0xb3de12){if(_0xb3de12&&_0xb3de12[_0x1b04('0x13')]&&_0xb3de12[_0x1b04('0x14')]){logger['error'](util[_0x1b04('0x15')](_0x1b04('0x16'),_0xb3de12[_0x1b04('0x13')],_0xb3de12[_0x1b04('0x14')]));}else{logger['error'](util[_0x1b04('0x15')](_0x1b04('0x17'),_0xb3de12[_0x1b04('0x9')]));}}function closeHandler(){logger[_0x1b04('0x11')](util[_0x1b04('0x15')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1b04('0x18')],this[_0x1b04('0x19')],this[_0x1b04('0x1a')],this[_0x1b04('0x1b')],this[_0x1b04('0x1c')]));try{createSquareReport(this);}catch(_0x5d68c8){logger[_0x1b04('0x8')](_0x5d68c8[_0x1b04('0x9')]);}}function timeoutHandler(){logger[_0x1b04('0x11')](util[_0x1b04('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1b04('0x18')],this[_0x1b04('0x19')],this[_0x1b04('0x1a')],this[_0x1b04('0x1b')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x1b04('0x15')](_0x1b04('0x1d'),this[_0x1b04('0x18')],this['calleridname'],this['callerid'],this[_0x1b04('0x1b')],this[_0x1b04('0x1c')]));this[_0x1b04('0x1e')]=!![];}function createSquareReport(_0x28b730,_0x4b8349){rpc['createSquareReport'](_0x28b730)[_0x1b04('0x1f')](function(_0x503868){if(_0x4b8349){_0x4b8349(null,_0x503868);}})[_0x1b04('0x20')](function(_0x1dda28){if(_0x4b8349){_0x4b8349(null,_0x1dda28);}});}function setChannelVariables(_0x5ac16f){for(var _0x1755ae in _0x5ac16f){if(_0x5ac16f[_0x1b04('0x21')](_0x1755ae)){if(_0x1755ae[_0x1b04('0x22')](_0x1b04('0x23'))===0x0){_0x5ac16f[_0x1755ae[_0x1b04('0x24')](0x4)]=_0x5ac16f[_0x1755ae];delete _0x5ac16f[_0x1755ae];}}}}function agiHandler(_0x284bac){logger[_0x1b04('0x25')](_0x1b04('0x26'),JSON[_0x1b04('0x27')](_0x284bac,null,0x2));logger[_0x1b04('0x11')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x284bac[_0x1b04('0x18')],_0x284bac['calleridname'],_0x284bac[_0x1b04('0x1a')],_0x284bac['dnid'],_0x284bac['uniqueid']));_0x284bac['on'](_0x1b04('0x8'),errorHandler);_0x284bac['on'](_0x1b04('0x28'),closeHandler);_0x284bac['on'](_0x1b04('0x29'),timeoutHandler);_0x284bac[_0x1b04('0x1e')]=![];_0x284bac['on']('hangup',hangupHandler);var _0x581621=_[_0x1b04('0x2a')](projects,[_0x1b04('0x13'),_0x284bac[_0x1b04('0x18')]]);if(!_0x581621)return Project[_0x1b04('0x2b')](_0x284bac);if(!_0x581621[_0x1b04('0x2c')])return Project[_0x1b04('0x2d')](_0x284bac);return Project['initialize'](_0x581621,_0x284bac);}function main(){var _0x11d95f;return utilLicense[_0x1b04('0x2e')]()['then'](function(_0x2010b3){if(!_0x2010b3)return;if(_0x2010b3['voice']){if(_0x2010b3[_0x1b04('0x2f')]&&_0x2010b3[_0x1b04('0x2f')]>0x0){logger['info'](util[_0x1b04('0x15')](_0x1b04('0x30'),_0x2010b3[_0x1b04('0x2f')]));_0x11d95f=_0x2010b3[_0x1b04('0x2f')];}else{logger[_0x1b04('0x11')](_0x1b04('0x31'));}}else{logger[_0x1b04('0x11')](_0x1b04('0x32'));_0x11d95f=-0x1;}})[_0x1b04('0x1f')](function(){return Project[_0x1b04('0x33')]();})[_0x1b04('0x1f')](function(_0x3c716b){projects=_0x3c716b;return;})['catch'](function(_0x56d46a){logger[_0x1b04('0x8')]('[LICENSE]',_0x56d46a[_0x1b04('0x9')]);})[_0x1b04('0x34')](function(){var _0x4d196c=require(_0x1b04('0x35'))(config['agi'][_0x1b04('0x10')],config[_0x1b04('0x3')]['ip'],_0x11d95f);_0x4d196c['on']('error',errorHandler);_0x4d196c['on'](_0x1b04('0x36'),listeningHandler);_0x4d196c['on']('connection',connectionHandler);_0x4d196c['on']('close',closeHandler);_0x4d196c['on']('projectUpdate',projectUpdateHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 74a2e9a..cd63419 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 _0x906e=['catch','sendMailMessage','SendMail','jayson/promise','http','then','error','message','result'];(function(_0x1d28ad,_0x3e5159){var _0xb948fb=function(_0x332b4b){while(--_0x332b4b){_0x1d28ad['push'](_0x1d28ad['shift']());}};_0xb948fb(++_0x3e5159);}(_0x906e,0xf6));var _0xe906=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x906e[_0x220dbb];return _0x2b77de;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe906('0x0'));var client=jayson['client'][_0xe906('0x1')]({'port':0x232b});function request(_0x562efd,_0x1108a3){return new BPromise(function(_0x22bf09,_0x4c8785){return client['request'](_0x562efd,_0x1108a3)[_0xe906('0x2')](function(_0x16840b){if(_0x16840b[_0xe906('0x3')]){return _0x4c8785(_0x16840b[_0xe906('0x3')][_0xe906('0x4')]);}else{return _0x22bf09(_0x16840b[_0xe906('0x5')]);}})[_0xe906('0x6')](function(_0x1f3da8){return _0x4c8785(_0x1f3da8);});});}exports[_0xe906('0x7')]=function(_0x3147c4,_0x42da3d){return request(_0xe906('0x8'),{'account':_0x3147c4,'message':_0x42da3d});}; \ No newline at end of file +var _0x6bcf=['request','then','error','result','catch','SendMail','bluebird','jayson/promise','client'];(function(_0x544df6,_0x3c8733){var _0x4d324b=function(_0x450aab){while(--_0x450aab){_0x544df6['push'](_0x544df6['shift']());}};_0x4d324b(++_0x3c8733);}(_0x6bcf,0x10b));var _0xf6bc=function(_0x46ccb9,_0x4c0ab7){_0x46ccb9=_0x46ccb9-0x0;var _0x2ece2b=_0x6bcf[_0x46ccb9];return _0x2ece2b;};'use strict';var BPromise=require(_0xf6bc('0x0'));var jayson=require(_0xf6bc('0x1'));var client=jayson[_0xf6bc('0x2')]['http']({'port':0x232b});function request(_0x4fa16e,_0x33e776){return new BPromise(function(_0x10c6f7,_0x2206ef){return client[_0xf6bc('0x3')](_0x4fa16e,_0x33e776)[_0xf6bc('0x4')](function(_0x52b149){if(_0x52b149[_0xf6bc('0x5')]){return _0x2206ef(_0x52b149[_0xf6bc('0x5')]['message']);}else{return _0x10c6f7(_0x52b149[_0xf6bc('0x6')]);}})[_0xf6bc('0x7')](function(_0x46623e){return _0x2206ef(_0x46623e);});});}exports['sendMailMessage']=function(_0x36710e,_0x559bea){return request(_0xf6bc('0x8'),{'account':_0x36710e,'message':_0x559bea});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 46ce488..b043dae 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f38=['catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','format','arg_1','callerid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','info','response','code','result','evtHangup','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','isUndefined','[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','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','./graph','getSquareProjects'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x8f38,0x1f3));var _0x88f3=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x8f38[_0x3b3a82];return _0x267063;};'use strict';var _=require(_0x88f3('0x0'));var moment=require('moment');var parser=require(_0x88f3('0x1'));var util=require(_0x88f3('0x2'));var logger=require('../../config/logger')('agi');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x88f3('0x3'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x88f3('0x4')]()[_0x88f3('0x5')](function(_0x15e5ab){logger['error'](_0x88f3('0x6'),_0x15e5ab[_0x88f3('0x7')]);return[];});}function addVertex(_0x48ade7,_0x5e2bb3,_0x586f0e){_0x5e2bb3[_0x88f3('0x8')]=_0x586f0e;if(_0x5e2bb3[_0x88f3('0x9')](_0x88f3('0xa'))){_0x5e2bb3[_0x88f3('0xb')]=parseInt(_0x5e2bb3[_0x88f3('0xa')],0xa);}_0x48ade7[_0x88f3('0xc')](_[_0x88f3('0xd')](_0x5e2bb3,_0x88f3('0xe')));}function initGraph(_0x53ccde,_0x47b1c0){var _0xcd2ec=new Graph();for(var _0x58ef3e in _0x53ccde){if(_0x53ccde['hasOwnProperty'](_0x58ef3e)){if(_[_0x88f3('0xf')](_0x53ccde[_0x58ef3e])){for(var _0x1e960d=0x0;_0x1e960d<_0x53ccde[_0x58ef3e][_0x88f3('0x10')];_0x1e960d+=0x1){addVertex(_0xcd2ec,_0x53ccde[_0x58ef3e][_0x1e960d],_0x58ef3e);}}else{addVertex(_0xcd2ec,_0x53ccde[_0x58ef3e],_0x58ef3e);}}}for(var _0x283a4c=0x0;_0x283a4c<_0x47b1c0[_0x88f3('0x10')];_0x283a4c+=0x1){if(_0x47b1c0[_0x283a4c][_0x88f3('0x11')]&&_0x47b1c0[_0x283a4c][_0x88f3('0x12')]){_0xcd2ec[_0x88f3('0x13')](_0x47b1c0[_0x283a4c][_0x88f3('0x11')],_0x47b1c0[_0x283a4c][_0x88f3('0x12')],_0x47b1c0[_0x283a4c][_0x88f3('0x14')]);}}return _0xcd2ec;}function getRoot(_0x3a3228){return parser[_0x88f3('0x15')](_0x3a3228,{'object':!![]})[_0x88f3('0x16')][_0x88f3('0x17')];}function inspect(_0x5e2a0b){return util[_0x88f3('0x18')](_0x5e2a0b,{'showHidden':![],'depth':null});}function initialize(_0x1ab2e7,_0x1b2f7b){var _0x3327ae=getRoot(_0x1ab2e7[_0x88f3('0x19')]);if(!_0x3327ae||!_0x3327ae[_0x88f3('0x1a')])return;var _0x51843a,_0x26d24a,_0x4ac69a;logger[_0x88f3('0x1b')](_0x88f3('0x17'),JSON[_0x88f3('0x1c')](_0x3327ae,null,0x2));_0x1b2f7b[_0x88f3('0x1d')]=moment()['format'](_0x88f3('0x1e'));_0x51843a=initGraph(_[_0x88f3('0xd')](_0x3327ae,'mxCell'),_0x3327ae[_0x88f3('0xe')]);_0x26d24a=new Vertices(_0x1b2f7b,rpc,mailRpc);logger['info'](util[_0x88f3('0x1f')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1b2f7b[_0x88f3('0x20')],_0x1b2f7b['calleridname'],_0x1b2f7b[_0x88f3('0x21')],_0x1b2f7b['dnid'],_0x1b2f7b['uniqueid']));_0x51843a[_0x88f3('0x22')](_0x3327ae[_0x88f3('0x1a')]['id'],function(_0x58a600){try{_0x58a600=_0x26d24a[_0x88f3('0x23')](_0x58a600);logger[_0x88f3('0x1b')](_0x88f3('0x24'),JSON[_0x88f3('0x1c')](_0x58a600,null,0x2));if(_0x58a600[_0x88f3('0x8')]===_0x88f3('0x25')){logger['info'](_0x88f3('0x26'));_0x1b2f7b['context']=_0x58a600['context']||_0x1b2f7b[_0x88f3('0x27')];_0x1b2f7b[_0x88f3('0x28')]=_0x58a600['extension'];_0x1b2f7b['priority']=_0x58a600[_0x88f3('0x29')]?_0x58a600[_0x88f3('0x29')]-0x1:0x1;return null;}else if(_0x58a600&&_0x26d24a[_0x58a600['agicommand']]){_0x4ac69a=_0x26d24a[_0x58a600[_0x88f3('0x8')]](_0x58a600);logger[_0x88f3('0x2a')](_0x88f3('0x2b'),JSON[_0x88f3('0x1c')](_0x4ac69a,null,0x2));if(_0x4ac69a&&_0x4ac69a[_0x88f3('0x2c')]===AGI_CODE_SUCCESS&&_0x4ac69a[_0x88f3('0x2d')]!==AGI_RESULT_ERROR&&!_0x1b2f7b[_0x88f3('0x2e')]){logger[_0x88f3('0x1b')](_0x88f3('0x2b'),inspect(_0x4ac69a));return _['isUndefined'](_0x4ac69a['result'])?null:_0x4ac69a[_0x88f3('0x2d')][_0x88f3('0x2f')]();}else{logger[_0x88f3('0x30')]('response',inspect(_0x4ac69a));return null;}}else{logger[_0x88f3('0x30')](_0x88f3('0x31'));return null;}}catch(_0x35e22f){logger[_0x88f3('0x30')](_0x35e22f['stack']);return null;}});if(_0x3327ae[_0x88f3('0x32')]){logger['info'](util[_0x88f3('0x1f')](_0x88f3('0x33'),_0x1b2f7b['arg_1'],_0x1b2f7b[_0x88f3('0x34')],_0x1b2f7b[_0x88f3('0x21')],_0x1b2f7b[_0x88f3('0x35')],_0x1b2f7b[_0x88f3('0x36')]));_0x51843a[_0x88f3('0x22')](_0x3327ae['finally']['id'],function(_0x36cde3){try{_0x36cde3=_0x26d24a[_0x88f3('0x23')](_0x36cde3);logger[_0x88f3('0x1b')]('vertex',JSON[_0x88f3('0x1c')](_0x36cde3,null,0x2));if(_0x36cde3&&_0x26d24a[_0x36cde3['agicommand']]){_0x4ac69a=_0x26d24a[_0x36cde3[_0x88f3('0x8')]](_0x36cde3);if(_0x4ac69a){logger[_0x88f3('0x1b')]('response',inspect(_0x4ac69a));return _[_0x88f3('0x37')](_0x4ac69a['result'])?null:_0x4ac69a[_0x88f3('0x2d')][_0x88f3('0x2f')]();}else{logger[_0x88f3('0x30')](_0x88f3('0x2b'),inspect(_0x4ac69a));return null;}}else{logger[_0x88f3('0x30')](_0x88f3('0x31'));return null;}}catch(_0x39fe9d){logger[_0x88f3('0x30')](_0x39fe9d[_0x88f3('0x7')]);return null;}});}logger[_0x88f3('0x2a')](util[_0x88f3('0x1f')](_0x88f3('0x38'),_0x1b2f7b['arg_1'],_0x1b2f7b[_0x88f3('0x34')],_0x1b2f7b['callerid'],_0x1b2f7b[_0x88f3('0x35')],_0x1b2f7b['uniqueid']));logger[_0x88f3('0x2a')](util[_0x88f3('0x1f')](_0x88f3('0x39'),_0x1b2f7b['context'],_0x1b2f7b[_0x88f3('0x28')],parseInt(_0x1b2f7b[_0x88f3('0x29')],0xa)+0x1));_0x1b2f7b['continueAt'](_0x1b2f7b['context'],_0x1b2f7b[_0x88f3('0x28')],parseInt(_0x1b2f7b[_0x88f3('0x29')],0xa)+0x1);_0x1b2f7b[_0x88f3('0x3a')]();}function handleNotFound(_0x405246){logger['error'](util['format'](_0x88f3('0x3b'),_0x405246['arg_1']));_0x405246[_0x88f3('0x3c')](_0x405246['context'],_0x405246[_0x88f3('0x28')],parseInt(_0x405246['priority'],0xa)+0x1);_0x405246[_0x88f3('0x3a')]();}function handleUnpublished(_0x404762){logger['error'](util[_0x88f3('0x1f')](_0x88f3('0x3d'),_0x404762[_0x88f3('0x20')]));_0x404762[_0x88f3('0x3c')](_0x404762[_0x88f3('0x27')],_0x404762[_0x88f3('0x28')],parseInt(_0x404762['priority'],0xa)+0x1);_0x404762['close']();}module[_0x88f3('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x695b=['callerid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','addVertex','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','production','debug','root','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','info','calleridname','dnid','uniqueid','traverseBFS','start','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x160996,_0x3041ce){var _0x3965e2=function(_0x43008b){while(--_0x43008b){_0x160996['push'](_0x160996['shift']());}};_0x3965e2(++_0x3041ce);}(_0x695b,0x104));var _0xb695=function(_0x5c9288,_0x37480c){_0x5c9288=_0x5c9288-0x0;var _0x1ffa82=_0x695b[_0x5c9288];return _0x1ffa82;};'use strict';var _=require(_0xb695('0x0'));var moment=require('moment');var parser=require(_0xb695('0x1'));var util=require('util');var logger=require(_0xb695('0x2'))(_0xb695('0x3'));var rpc=require(_0xb695('0x4'));var mailRpc=require(_0xb695('0x5'));var Graph=require(_0xb695('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb695('0x7')]()[_0xb695('0x8')](function(_0x323cae){logger[_0xb695('0x9')](_0xb695('0xa'),_0x323cae[_0xb695('0xb')]);return[];});}function addVertex(_0x135583,_0x3dbc79,_0x4fb75a){_0x3dbc79[_0xb695('0xc')]=_0x4fb75a;if(_0x3dbc79[_0xb695('0xd')]('retry')){_0x3dbc79[_0xb695('0xe')]=parseInt(_0x3dbc79[_0xb695('0xf')],0xa);}_0x135583[_0xb695('0x10')](_['omit'](_0x3dbc79,'mxCell'));}function initGraph(_0x23cbb0,_0x5eb26b){var _0x57ab7e=new Graph();for(var _0x1a0934 in _0x23cbb0){if(_0x23cbb0[_0xb695('0xd')](_0x1a0934)){if(_[_0xb695('0x11')](_0x23cbb0[_0x1a0934])){for(var _0x4ab2d4=0x0;_0x4ab2d4<_0x23cbb0[_0x1a0934]['length'];_0x4ab2d4+=0x1){addVertex(_0x57ab7e,_0x23cbb0[_0x1a0934][_0x4ab2d4],_0x1a0934);}}else{addVertex(_0x57ab7e,_0x23cbb0[_0x1a0934],_0x1a0934);}}}for(var _0x12fea2=0x0;_0x12fea2<_0x5eb26b[_0xb695('0x12')];_0x12fea2+=0x1){if(_0x5eb26b[_0x12fea2]['source']&&_0x5eb26b[_0x12fea2][_0xb695('0x13')]){_0x57ab7e[_0xb695('0x14')](_0x5eb26b[_0x12fea2][_0xb695('0x15')],_0x5eb26b[_0x12fea2][_0xb695('0x13')],_0x5eb26b[_0x12fea2][_0xb695('0x16')]);}}return _0x57ab7e;}function getRoot(_0x1eaaeb){return parser[_0xb695('0x17')](_0x1eaaeb,{'object':!![]})[_0xb695('0x18')]['root'];}function inspect(_0x4f414a){return util['inspect'](_0x4f414a,{'showHidden':![],'depth':null});}function initialize(_0x157792,_0x1d4a2e){var _0x4dc617=getRoot(_0x157792[_0xb695('0x19')]);if(!_0x4dc617||!_0x4dc617['start'])return;var _0x34552e,_0x4ef00f,_0x59d2cc;logger[_0xb695('0x1a')](_0xb695('0x1b'),JSON['stringify'](_0x4dc617,null,0x2));_0x1d4a2e['joinAt']=moment()[_0xb695('0x1c')](_0xb695('0x1d'));_0x34552e=initGraph(_[_0xb695('0x1e')](_0x4dc617,'mxCell'),_0x4dc617[_0xb695('0x1f')]);_0x4ef00f=new Vertices(_0x1d4a2e,rpc,mailRpc);logger[_0xb695('0x20')](util[_0xb695('0x1c')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1d4a2e['arg_1'],_0x1d4a2e[_0xb695('0x21')],_0x1d4a2e['callerid'],_0x1d4a2e[_0xb695('0x22')],_0x1d4a2e[_0xb695('0x23')]));_0x34552e[_0xb695('0x24')](_0x4dc617[_0xb695('0x25')]['id'],function(_0xb97f89){try{_0xb97f89=_0x4ef00f[_0xb695('0x26')](_0xb97f89);logger[_0xb695('0x1a')](_0xb695('0x27'),JSON[_0xb695('0x28')](_0xb97f89,null,0x2));if(_0xb97f89[_0xb695('0xc')]===_0xb695('0x29')){logger['info'](_0xb695('0x2a'));_0x1d4a2e[_0xb695('0x2b')]=_0xb97f89[_0xb695('0x2b')]||_0x1d4a2e[_0xb695('0x2b')];_0x1d4a2e[_0xb695('0x2c')]=_0xb97f89[_0xb695('0x2c')];_0x1d4a2e[_0xb695('0x2d')]=_0xb97f89[_0xb695('0x2d')]?_0xb97f89[_0xb695('0x2d')]-0x1:0x1;return null;}else if(_0xb97f89&&_0x4ef00f[_0xb97f89[_0xb695('0xc')]]){_0x59d2cc=_0x4ef00f[_0xb97f89[_0xb695('0xc')]](_0xb97f89);logger[_0xb695('0x20')](_0xb695('0x2e'),JSON[_0xb695('0x28')](_0x59d2cc,null,0x2));if(_0x59d2cc&&_0x59d2cc[_0xb695('0x2f')]===AGI_CODE_SUCCESS&&_0x59d2cc['result']!==AGI_RESULT_ERROR&&!_0x1d4a2e[_0xb695('0x30')]){logger['debug'](_0xb695('0x2e'),inspect(_0x59d2cc));return _[_0xb695('0x31')](_0x59d2cc[_0xb695('0x32')])?null:_0x59d2cc['result'][_0xb695('0x33')]();}else{logger['error'](_0xb695('0x2e'),inspect(_0x59d2cc));return null;}}else{logger[_0xb695('0x9')](_0xb695('0x34'));return null;}}catch(_0x2987c9){logger[_0xb695('0x9')](_0x2987c9['stack']);return null;}});if(_0x4dc617[_0xb695('0x35')]){logger['info'](util[_0xb695('0x1c')](_0xb695('0x36'),_0x1d4a2e['arg_1'],_0x1d4a2e[_0xb695('0x21')],_0x1d4a2e[_0xb695('0x37')],_0x1d4a2e[_0xb695('0x22')],_0x1d4a2e[_0xb695('0x23')]));_0x34552e[_0xb695('0x24')](_0x4dc617[_0xb695('0x35')]['id'],function(_0x4efcd4){try{_0x4efcd4=_0x4ef00f[_0xb695('0x26')](_0x4efcd4);logger[_0xb695('0x1a')](_0xb695('0x27'),JSON['stringify'](_0x4efcd4,null,0x2));if(_0x4efcd4&&_0x4ef00f[_0x4efcd4['agicommand']]){_0x59d2cc=_0x4ef00f[_0x4efcd4['agicommand']](_0x4efcd4);if(_0x59d2cc){logger['debug'](_0xb695('0x2e'),inspect(_0x59d2cc));return _['isUndefined'](_0x59d2cc[_0xb695('0x32')])?null:_0x59d2cc[_0xb695('0x32')][_0xb695('0x33')]();}else{logger[_0xb695('0x9')](_0xb695('0x2e'),inspect(_0x59d2cc));return null;}}else{logger['error'](_0xb695('0x34'));return null;}}catch(_0x2856de){logger['error'](_0x2856de[_0xb695('0xb')]);return null;}});}logger[_0xb695('0x20')](util[_0xb695('0x1c')](_0xb695('0x38'),_0x1d4a2e[_0xb695('0x39')],_0x1d4a2e[_0xb695('0x21')],_0x1d4a2e[_0xb695('0x37')],_0x1d4a2e['dnid'],_0x1d4a2e[_0xb695('0x23')]));logger['info'](util[_0xb695('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1d4a2e['context'],_0x1d4a2e['extension'],parseInt(_0x1d4a2e[_0xb695('0x2d')],0xa)+0x1));_0x1d4a2e[_0xb695('0x3a')](_0x1d4a2e[_0xb695('0x2b')],_0x1d4a2e[_0xb695('0x2c')],parseInt(_0x1d4a2e['priority'],0xa)+0x1);_0x1d4a2e[_0xb695('0x3b')]();}function handleNotFound(_0x242782){logger[_0xb695('0x9')](util[_0xb695('0x1c')](_0xb695('0x3c'),_0x242782[_0xb695('0x39')]));_0x242782[_0xb695('0x3a')](_0x242782[_0xb695('0x2b')],_0x242782[_0xb695('0x2c')],parseInt(_0x242782[_0xb695('0x2d')],0xa)+0x1);_0x242782[_0xb695('0x3b')]();}function handleUnpublished(_0x2c4695){logger[_0xb695('0x9')](util['format'](_0xb695('0x3d'),_0x2c4695[_0xb695('0x39')]));_0x2c4695['continueAt'](_0x2c4695[_0xb695('0x2b')],_0x2c4695[_0xb695('0x2c')],parseInt(_0x2c4695[_0xb695('0x2d')],0xa)+0x1);_0x2c4695[_0xb695('0x3b')]();}module[_0xb695('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b1d0d9b..c9c351a 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 _0xbdb8=['exports','util','stream','call','_inBody','inherits','prototype','_localBuffer','indexOf','substring','split','slice','trim','emit','line'];(function(_0x12d698,_0x1af9eb){var _0x235768=function(_0x4cf601){while(--_0x4cf601){_0x12d698['push'](_0x12d698['shift']());}};_0x235768(++_0x1af9eb);}(_0xbdb8,0xe2));var _0x8bdb=function(_0x2d7116,_0x37bee1){_0x2d7116=_0x2d7116-0x0;var _0x522d5a=_0xbdb8[_0x2d7116];return _0x522d5a;};'use strict';var util=require(_0x8bdb('0x0'));var Transform=require(_0x8bdb('0x1'))['Transform'];function AGIReply(_0x5f96fb){Transform[_0x8bdb('0x2')](this,_0x5f96fb);this['_localBuffer']='';this[_0x8bdb('0x3')]=![];}util[_0x8bdb('0x4')](AGIReply,Transform);AGIReply[_0x8bdb('0x5')]['_transform']=function(_0x89da21,_0x2cdb82,_0x595b60){var _0x438969='\x0a',_0x50cb04=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x2a5d64=-0x1,_0x5a758b=-0x1,_0x4d6748='',_0x1e41e8=0x0,_0x19cca3='',_0x1e34c3='';this[_0x8bdb('0x6')]+=_0x89da21['toString']();_0x19cca3=this['_localBuffer'];if(!this[_0x8bdb('0x3')]){_0x1e41e8=0x0;while(_0x50cb04[_0x1e41e8]){while((_0x5a758b=_0x19cca3[_0x8bdb('0x7')](_0x50cb04[_0x1e41e8]))!=-0x1){_0x4d6748=_0x50cb04[_0x1e41e8];_0x1e34c3=_0x19cca3[_0x8bdb('0x8')](0x0,_0x5a758b);_0x19cca3=_0x19cca3['substring'](_0x5a758b+_0x4d6748['length']);var _0x1e5c3e=_0x1e34c3[_0x8bdb('0x9')](_0x438969),_0x4a7b9b=0x0,_0x5e0de9={},_0x4cab19='',_0x337ee9='',_0x3107ea=-0x1;while(_0x1e5c3e[_0x4a7b9b]){_0x3107ea=_0x1e5c3e[_0x4a7b9b]['indexOf'](':');if(_0x3107ea!=-0x1){_0x4cab19=_0x1e5c3e[_0x4a7b9b][_0x8bdb('0xa')](0x0,_0x3107ea)['trim']();_0x337ee9=_0x1e5c3e[_0x4a7b9b][_0x8bdb('0xa')](_0x3107ea+0x1)[_0x8bdb('0xb')]();if(_0x4cab19['length']>0x0){_0x5e0de9[_0x4cab19]=_0x337ee9;}}else{}_0x4a7b9b++;}this[_0x8bdb('0xc')]('headers',_0x5e0de9);this[_0x8bdb('0x3')]=!![];}_0x1e41e8++;}this[_0x8bdb('0x6')]=_0x19cca3;}else{while((_0x2a5d64=_0x19cca3[_0x8bdb('0x7')](_0x438969))!=-0x1){_0x1e34c3=_0x19cca3[_0x8bdb('0x8')](0x0,_0x2a5d64);this[_0x8bdb('0xc')](_0x8bdb('0xd'),_0x1e34c3);_0x19cca3=_0x19cca3['substring'](_0x2a5d64+_0x438969['length']);}this[_0x8bdb('0x6')]=_0x19cca3;}_0x595b60();};module[_0x8bdb('0xe')]=AGIReply; \ No newline at end of file +var _0x3043=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','indexOf','slice','trim','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits'];(function(_0x2bd523,_0x20c592){var _0x111703=function(_0x4de93b){while(--_0x4de93b){_0x2bd523['push'](_0x2bd523['shift']());}};_0x111703(++_0x20c592);}(_0x3043,0x175));var _0x3304=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x3043[_0x164af1];return _0x5d81a2;};'use strict';var util=require(_0x3304('0x0'));var Transform=require(_0x3304('0x1'))[_0x3304('0x2')];function AGIReply(_0x36404b){Transform[_0x3304('0x3')](this,_0x36404b);this[_0x3304('0x4')]='';this[_0x3304('0x5')]=![];}util[_0x3304('0x6')](AGIReply,Transform);AGIReply[_0x3304('0x7')][_0x3304('0x8')]=function(_0x4c18eb,_0x4593ea,_0x40d5ce){var _0x228878='\x0a',_0x180be2=['\x0a\x0a',_0x3304('0x9')],_0x4004b2=-0x1,_0x57faca=-0x1,_0x1c435a='',_0x32af8e=0x0,_0x1b2e4d='',_0x4977c3='';this[_0x3304('0x4')]+=_0x4c18eb[_0x3304('0xa')]();_0x1b2e4d=this['_localBuffer'];if(!this[_0x3304('0x5')]){_0x32af8e=0x0;while(_0x180be2[_0x32af8e]){while((_0x57faca=_0x1b2e4d['indexOf'](_0x180be2[_0x32af8e]))!=-0x1){_0x1c435a=_0x180be2[_0x32af8e];_0x4977c3=_0x1b2e4d['substring'](0x0,_0x57faca);_0x1b2e4d=_0x1b2e4d[_0x3304('0xb')](_0x57faca+_0x1c435a[_0x3304('0xc')]);var _0x43b584=_0x4977c3['split'](_0x228878),_0x1cd879=0x0,_0x446197={},_0x331c5d='',_0x1c8cb1='',_0x155314=-0x1;while(_0x43b584[_0x1cd879]){_0x155314=_0x43b584[_0x1cd879][_0x3304('0xd')](':');if(_0x155314!=-0x1){_0x331c5d=_0x43b584[_0x1cd879][_0x3304('0xe')](0x0,_0x155314)['trim']();_0x1c8cb1=_0x43b584[_0x1cd879][_0x3304('0xe')](_0x155314+0x1)[_0x3304('0xf')]();if(_0x331c5d[_0x3304('0xc')]>0x0){_0x446197[_0x331c5d]=_0x1c8cb1;}}else{}_0x1cd879++;}this[_0x3304('0x10')]('headers',_0x446197);this[_0x3304('0x5')]=!![];}_0x32af8e++;}this[_0x3304('0x4')]=_0x1b2e4d;}else{while((_0x4004b2=_0x1b2e4d[_0x3304('0xd')](_0x228878))!=-0x1){_0x4977c3=_0x1b2e4d[_0x3304('0xb')](0x0,_0x4004b2);this[_0x3304('0x10')](_0x3304('0x11'),_0x4977c3);_0x1b2e4d=_0x1b2e4d[_0x3304('0xb')](_0x4004b2+_0x228878[_0x3304('0xc')]);}this[_0x3304('0x4')]=_0x1b2e4d;}_0x40d5ce();};module[_0x3304('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 9c4a5aa..edf054b 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 _0x4728=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','ShowSquareProject','name','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','jayson/promise','client','request','then','error','result','getSquareProjects','GetSquareProjects','production','getSquareProject'];(function(_0x364e62,_0x5243c8){var _0x1bdafd=function(_0x631ecb){while(--_0x631ecb){_0x364e62['push'](_0x364e62['shift']());}};_0x1bdafd(++_0x5243c8);}(_0x4728,0x146));var _0x8472=function(_0x5b4011,_0x7b6cf1){_0x5b4011=_0x5b4011-0x0;var _0x23daee=_0x4728[_0x5b4011];return _0x23daee;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0x8472('0x0'));var client=jayson[_0x8472('0x1')]['http']({'port':0x2329});function request(_0x50b086,_0x276906){return new Promise(function(_0x5cc0ba,_0x4c2b0c){return client[_0x8472('0x2')](_0x50b086,_0x276906)[_0x8472('0x3')](function(_0x2fe3b6){if(_0x2fe3b6['error']){return _0x4c2b0c(_0x2fe3b6[_0x8472('0x4')]['message']);}else{return _0x5cc0ba(_0x2fe3b6[_0x8472('0x5')]);}})['catch'](function(_0x1270c9){return _0x4c2b0c(_0x1270c9);});});}exports[_0x8472('0x6')]=function(){return request(_0x8472('0x7'),{'options':{'raw':![],'attributes':['id','name',_0x8472('0x8')]}});};exports[_0x8472('0x9')]=function(_0xfc9a2a){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xfc9a2a},'attributes':[_0x8472('0x8')]}});};exports[_0x8472('0xa')]=function(_0xe5009f){return request(_0x8472('0xb'),{'options':{'raw':![],'where':{'id':_0xe5009f},'include':[{'model':_0x8472('0xc'),'as':_0x8472('0xd'),'include':[{'model':_0x8472('0xe'),'as':_0x8472('0xe')}]}],'attributes':['id','name',_0x8472('0xf')]}});};exports['getSquareProjectById']=function(_0x373f2b){return request(_0x8472('0x10'),{'options':{'where':{'id':_0x373f2b},'attributes':[_0x8472('0x11')]}});};exports['getVoiceQueueById']=function(_0x5a0388){return request(_0x8472('0x12'),{'options':{'where':{'id':_0x5a0388},'attributes':[_0x8472('0x11')]}});};exports['getVariableById']=function(_0x4875e3){return request(_0x8472('0x13'),{'options':{'where':{'id':_0x4875e3},'attributes':[_0x8472('0x11')]}});};exports[_0x8472('0x14')]=function(_0x56c38d){return request(_0x8472('0x15'),{'options':{'where':{'id':_0x56c38d},'attributes':['dsn']}});};exports[_0x8472('0x16')]=function(_0x2a70f5){return request(_0x8472('0x17'),{'options':{'where':{'id':_0x2a70f5},'attributes':[_0x8472('0x11')]}});};exports['getContactByPhone']=function(_0xfce1a8){return request(_0x8472('0x18'),{'options':{'where':{'phone':_0xfce1a8[_0x8472('0x19')]},'attributes':['id']}});};exports[_0x8472('0x1a')]=function(_0x281a99){return request(_0x8472('0x1b'),{'options':{'where':{'id':_0x281a99},'attributes':[_0x8472('0x11')]}});};exports[_0x8472('0x1c')]=function(_0x11c0e8){return request('ShowSound',{'options':{'where':{'id':_0x11c0e8},'attributes':[_0x8472('0x1d')]}});};exports[_0x8472('0x1e')]=function(_0x33061f){return request(_0x8472('0x1f'),{'options':{'raw':![],'where':{'id':_0x33061f},'include':[{'model':_0x8472('0x20'),'as':_0x8472('0x21')}]}});};exports['getSmsAccountById']=function(_0xbfbce0){return request('ShowSmsAccount',{'options':{'where':{'id':_0xbfbce0},'attributes':['id',_0x8472('0x11')]}});};exports['createSmsMessage']=function(_0x13ccee){return request(_0x8472('0x22'),{'body':_0x13ccee});};exports['createSquareDetailsReport']=function(_0x1dc589){return request('CreateSquareDetailsReport',{'body':_0x1dc589});};exports[_0x8472('0x23')]=function(_0x5ac26c){return request(_0x8472('0x24'),{'body':_[_0x8472('0x25')](_0x5ac26c,{'project_name':_0x5ac26c[_0x8472('0x26')],'prev_project_name':_0x5ac26c[_0x8472('0x27')]||'','is_subproject':_0x5ac26c[_0x8472('0x27')]?!![]:![],'leaveAt':moment()['format'](_0x8472('0x28'))})});};exports[_0x8472('0x29')]=function(_0x19258c){return request(_0x8472('0x2a'),{'body':_0x19258c});};exports[_0x8472('0x2b')]=function(_0x1b590c){return request(_0x8472('0x2c'),{'body':_0x1b590c});};exports[_0x8472('0x2d')]=function(_0x413884){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x413884[_0x8472('0x19')],'ListId':_0x413884[_0x8472('0x2e')]}}})[_0x8472('0x3')](function(_0x4c7a91){if(_0x4c7a91){return _0x4c7a91;}return request(_0x8472('0x2f'),{'body':_0x413884});});};exports['getPauseById']=function(_0x275348){return request(_0x8472('0x30'),{'options':{'where':{'id':_0x275348},'attributes':['name']}});};exports[_0x8472('0x31')]=function(_0x5086c4,_0x302118){return request(_0x8472('0x32'),{'body':{'interface':_0x302118},'options':{'where':_0x5086c4}});};exports['agentPause']=function(_0x32f95c,_0x34b5d5,_0x369e13){return request(_0x8472('0x33'),{'body':{'type':_0x34b5d5,'uniqueid':_0x369e13},'options':{'where':_0x32f95c}});};exports[_0x8472('0x34')]=function(_0x1c9d35){return request(_0x8472('0x35'),{'body':{},'options':{'where':_0x1c9d35}});};exports[_0x8472('0x36')]=function(_0x1cc27c){return request(_0x8472('0x37'),{'body':{},'options':{'where':_0x1cc27c}});}; \ No newline at end of file +var _0x1601=['YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','error','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_1','arg_2'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x1601,0x105));var _0x1160=function(_0x1e9dd1,_0x2e180a){_0x1e9dd1=_0x1e9dd1-0x0;var _0x1752dc=_0x1601[_0x1e9dd1];return _0x1752dc;};'use strict';var _=require(_0x1160('0x0'));var moment=require(_0x1160('0x1'));var jayson=require(_0x1160('0x2'));var client=jayson['client'][_0x1160('0x3')]({'port':0x2329});function request(_0x498dd1,_0x26720a){return new Promise(function(_0x1738e5,_0x15f1fd){return client[_0x1160('0x4')](_0x498dd1,_0x26720a)['then'](function(_0x5b42e1){if(_0x5b42e1[_0x1160('0x5')]){return _0x15f1fd(_0x5b42e1[_0x1160('0x5')]['message']);}else{return _0x1738e5(_0x5b42e1[_0x1160('0x6')]);}})[_0x1160('0x7')](function(_0x9c6df7){return _0x15f1fd(_0x9c6df7);});});}exports[_0x1160('0x8')]=function(){return request(_0x1160('0x9'),{'options':{'raw':![],'attributes':['id',_0x1160('0xa'),'production']}});};exports[_0x1160('0xb')]=function(_0x4fed16){return request(_0x1160('0xc'),{'options':{'raw':![],'where':{'name':_0x4fed16},'attributes':[_0x1160('0xd')]}});};exports[_0x1160('0xe')]=function(_0xf80cb4){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xf80cb4},'include':[{'model':_0x1160('0xf'),'as':_0x1160('0x10'),'include':[{'model':_0x1160('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0x1160('0xa'),_0x1160('0x12')]}});};exports[_0x1160('0x13')]=function(_0x248994){return request(_0x1160('0xc'),{'options':{'where':{'id':_0x248994},'attributes':[_0x1160('0xa')]}});};exports[_0x1160('0x14')]=function(_0x2df7b3){return request(_0x1160('0x15'),{'options':{'where':{'id':_0x2df7b3},'attributes':['name']}});};exports[_0x1160('0x16')]=function(_0x12d80c){return request(_0x1160('0x17'),{'options':{'where':{'id':_0x12d80c},'attributes':[_0x1160('0xa')]}});};exports[_0x1160('0x18')]=function(_0x36749f){return request(_0x1160('0x19'),{'options':{'where':{'id':_0x36749f},'attributes':['dsn']}});};exports['getUserById']=function(_0x2f9a35){return request(_0x1160('0x1a'),{'options':{'where':{'id':_0x2f9a35},'attributes':[_0x1160('0xa')]}});};exports[_0x1160('0x1b')]=function(_0x1e3631){return request(_0x1160('0x1c'),{'options':{'where':{'phone':_0x1e3631['phone']},'attributes':['id']}});};exports[_0x1160('0x1d')]=function(_0x1e5ff3){return request(_0x1160('0x1e'),{'options':{'where':{'id':_0x1e5ff3},'attributes':['name']}});};exports[_0x1160('0x1f')]=function(_0x32adc1){return request(_0x1160('0x20'),{'options':{'where':{'id':_0x32adc1},'attributes':[_0x1160('0x21')]}});};exports['getIntervalById']=function(_0x284671){return request(_0x1160('0x22'),{'options':{'raw':![],'where':{'id':_0x284671},'include':[{'model':'Interval','as':_0x1160('0x23')}]}});};exports[_0x1160('0x24')]=function(_0x436b78){return request('ShowSmsAccount',{'options':{'where':{'id':_0x436b78},'attributes':['id',_0x1160('0xa')]}});};exports[_0x1160('0x25')]=function(_0x2f6050){return request(_0x1160('0x26'),{'body':_0x2f6050});};exports['createSquareDetailsReport']=function(_0x10684f){return request('CreateSquareDetailsReport',{'body':_0x10684f});};exports[_0x1160('0x27')]=function(_0x326e71){return request(_0x1160('0x28'),{'body':_[_0x1160('0x29')](_0x326e71,{'project_name':_0x326e71[_0x1160('0x2a')],'prev_project_name':_0x326e71[_0x1160('0x2b')]||'','is_subproject':_0x326e71[_0x1160('0x2b')]?!![]:![],'leaveAt':moment()['format'](_0x1160('0x2c'))})});};exports[_0x1160('0x2d')]=function(_0x57d044){return request(_0x1160('0x2e'),{'body':_0x57d044});};exports[_0x1160('0x2f')]=function(_0x2776d0){return request('CreateSquareMessage',{'body':_0x2776d0});};exports['createCmContact']=function(_0x382dec){return request(_0x1160('0x30'),{'options':{'raw':![],'where':{'phone':_0x382dec['phone'],'ListId':_0x382dec[_0x1160('0x31')]}}})[_0x1160('0x32')](function(_0x34bb67){if(_0x34bb67){return _0x34bb67;}return request(_0x1160('0x33'),{'body':_0x382dec});});};exports[_0x1160('0x34')]=function(_0x2cbe42){return request(_0x1160('0x35'),{'options':{'where':{'id':_0x2cbe42},'attributes':[_0x1160('0xa')]}});};exports[_0x1160('0x36')]=function(_0xf2c826,_0x12f5f2){return request(_0x1160('0x37'),{'body':{'interface':_0x12f5f2},'options':{'where':_0xf2c826}});};exports[_0x1160('0x38')]=function(_0x340803,_0x214e19,_0x407eb0){return request(_0x1160('0x39'),{'body':{'type':_0x214e19,'uniqueid':_0x407eb0},'options':{'where':_0x340803}});};exports['agentUnpause']=function(_0x32904a){return request(_0x1160('0x3a'),{'body':{},'options':{'where':_0x32904a}});};exports[_0x1160('0x3b')]=function(_0x61e589){return request(_0x1160('0x3c'),{'body':{},'options':{'where':_0x61e589}});}; \ 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 d78eac4..16d3cce 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 _0x2709=['exports','./polly'];(function(_0x4cc727,_0x3b3885){var _0x3ff76a=function(_0x1171e0){while(--_0x1171e0){_0x4cc727['push'](_0x4cc727['shift']());}};_0x3ff76a(++_0x3b3885);}(_0x2709,0x189));var _0x9270=function(_0x574fac,_0x453477){_0x574fac=_0x574fac-0x0;var _0x247712=_0x2709[_0x574fac];return _0x247712;};var polly=require(_0x9270('0x0'));var lex=require('./lex');module[_0x9270('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xe55d=['./polly','./lex'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe55d,0x126));var _0xde55=function(_0x330a9e,_0x3eb7b4){_0x330a9e=_0x330a9e-0x0;var _0x43c7c4=_0xe55d[_0x330a9e];return _0x43c7c4;};var polly=require(_0xde55('0x0'));var lex=require(_0xde55('0x1'));module['exports']={'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 42d4b06..27ad839 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 _0xb4e6=['./lib/api'];(function(_0x2445e2,_0xc4a747){var _0x1e5736=function(_0x4a6509){while(--_0x4a6509){_0x2445e2['push'](_0x2445e2['shift']());}};_0x1e5736(++_0xc4a747);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xb4e6[_0x5e9876];return _0x576c48;};'use strict';var lex=require(_0x6b4e('0x0'));module['exports']=function(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad){return lex(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad);}; \ No newline at end of file +var _0x70e0=['exports','./lib/api'];(function(_0x3b10df,_0x46d3ec){var _0x50501e=function(_0x28b8b5){while(--_0x28b8b5){_0x3b10df['push'](_0x3b10df['shift']());}};_0x50501e(++_0x46d3ec);}(_0x70e0,0x17b));var _0x070e=function(_0x40629a,_0x5771ae){_0x40629a=_0x40629a-0x0;var _0x7627e0=_0x70e0[_0x40629a];return _0x7627e0;};'use strict';var lex=require(_0x070e('0x0'));module[_0x070e('0x1')]=function(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32){return lex(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32);}; \ 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 de47b8c..bec3a72 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 _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x44e9b7,_0x26e996){var _0x417da5=function(_0x47fb8b){while(--_0x47fb8b){_0x44e9b7['push'](_0x44e9b7['shift']());}};_0x417da5(++_0x26e996);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x27fd0a,_0x21cdee){var _0x4213c2=function(_0x345aee){while(--_0x345aee){_0x27fd0a['push'](_0x27fd0a['shift']());}};_0x4213c2(++_0x21cdee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ 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 6aad490..c8b8543 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 _0x5561=['exports','./lib/api'];(function(_0x42cc11,_0x188c6d){var _0x4deb1e=function(_0x21d3ca){while(--_0x21d3ca){_0x42cc11['push'](_0x42cc11['shift']());}};_0x4deb1e(++_0x188c6d);}(_0x5561,0xd1));var _0x1556=function(_0x1e1ccf,_0xc5b4d8){_0x1e1ccf=_0x1e1ccf-0x0;var _0x90040b=_0x5561[_0x1e1ccf];return _0x90040b;};'use strict';var polly=require(_0x1556('0x0'));module[_0x1556('0x1')]=function(_0x5a6c6a,_0x34a42e,_0x1f1a68,_0x2b2d7e,_0x46b89b,_0x1fb9ed,_0x66bc5b){return polly(_0x5a6c6a,_0x34a42e,_0x1f1a68,_0x2b2d7e,_0x46b89b,_0x1fb9ed,_0x66bc5b);}; \ No newline at end of file +var _0xe7a9=['./lib/api'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe7a9,0x68));var _0x9e7a=function(_0x27002b,_0x5d364c){_0x27002b=_0x27002b-0x0;var _0x5b3beb=_0xe7a9[_0x27002b];return _0x5b3beb;};'use strict';var polly=require(_0x9e7a('0x0'));module['exports']=function(_0x226aaf,_0x1bc4d1,_0x371e84,_0x4dcc8f,_0x4df539,_0x19e122,_0x1d6a5e){return polly(_0x226aaf,_0x1bc4d1,_0x371e84,_0x4dcc8f,_0x4df539,_0x19e122,_0x1d6a5e);}; \ 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 7a7d915..b685bff 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 _0xfb6a=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path'];(function(_0x311cd2,_0x146a42){var _0x40cad8=function(_0x48043f){while(--_0x48043f){_0x311cd2['push'](_0x311cd2['shift']());}};_0x40cad8(++_0x146a42);}(_0xfb6a,0x154));var _0xafb6=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0xfb6a[_0x5ec365];return _0xab187d;};'use strict';var fs=require('fs');var path=require(_0xafb6('0x0'));var BPromise=require(_0xafb6('0x1'));var rs=require(_0xafb6('0x2'));var AWS=require(_0xafb6('0x3'));function pollyResult(_0x5aac74,_0x36665d,_0x4bfc13){return new BPromise(function(_0x23d23c,_0x47b3d7){_0x5aac74[_0xafb6('0x4')](_0x36665d,function(_0x2cc0e3,_0x588b18){if(_0x2cc0e3){_0x47b3d7(_0x2cc0e3);}else if(_0x588b18){if(_0x588b18[_0xafb6('0x5')]instanceof Buffer){fs[_0xafb6('0x6')](_0x4bfc13,_0x588b18[_0xafb6('0x5')],function(_0x52b5e9){if(_0x52b5e9){_0x47b3d7(_0x52b5e9);}else{_0x23d23c();}});}else{_0x47b3d7(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x47b3d7(new Error(_0xafb6('0x7')));}});});}module[_0xafb6('0x8')]=function(_0x194b86,_0x3b23bb,_0x317ee6,_0x3693ff,_0x3fa04e,_0x38b857,_0x1f28c8){var _0x236bca=new AWS[(_0xafb6('0x9'))]({'accessKeyId':_0x194b86,'secretAccessKey':_0x3b23bb,'region':_0x317ee6});var _0x4a0f14={'Text':_0x3fa04e,'TextType':_0x38b857||_0xafb6('0xa'),'OutputFormat':'mp3','VoiceId':_0x3693ff};return pollyResult(_0x236bca,_0x4a0f14,_0x1f28c8);}; \ No newline at end of file +var _0xda52=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x1d88ca,_0x5a1b62){var _0x5c7585=function(_0x14d897){while(--_0x14d897){_0x1d88ca['push'](_0x1d88ca['shift']());}};_0x5c7585(++_0x5a1b62);}(_0xda52,0x103));var _0x2da5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda52[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x2da5('0x0'));var BPromise=require('bluebird');var rs=require(_0x2da5('0x1'));var AWS=require(_0x2da5('0x2'));function pollyResult(_0x53c220,_0x40c069,_0x1ad33b){return new BPromise(function(_0x5ccac5,_0x58a144){_0x53c220[_0x2da5('0x3')](_0x40c069,function(_0x1aff9d,_0x1caa0a){if(_0x1aff9d){_0x58a144(_0x1aff9d);}else if(_0x1caa0a){if(_0x1caa0a[_0x2da5('0x4')]instanceof Buffer){fs[_0x2da5('0x5')](_0x1ad33b,_0x1caa0a[_0x2da5('0x4')],function(_0x38ab5a){if(_0x38ab5a){_0x58a144(_0x38ab5a);}else{_0x5ccac5();}});}else{_0x58a144(new Error(_0x2da5('0x6')));}}else{_0x58a144(new Error(_0x2da5('0x7')));}});});}module[_0x2da5('0x8')]=function(_0x542ad7,_0x1d91d2,_0x420a76,_0x2821c6,_0x57752d,_0x393d73,_0x383e7f){var _0x5aff72=new AWS[(_0x2da5('0x9'))]({'accessKeyId':_0x542ad7,'secretAccessKey':_0x1d91d2,'region':_0x420a76});var _0x29fb75={'Text':_0x57752d,'TextType':_0x393d73||'text','OutputFormat':_0x2da5('0xa'),'VoiceId':_0x2821c6};return pollyResult(_0x5aff72,_0x29fb75,_0x383e7f);}; \ 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 2223b4c..e5e169f 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 _0x3399=['exports'];(function(_0x3a425b,_0x485a72){var _0xc7cedf=function(_0x32a284){while(--_0x32a284){_0x3a425b['push'](_0x3a425b['shift']());}};_0xc7cedf(++_0x485a72);}(_0x3399,0x184));var _0x9339=function(_0x2bcfcb,_0x4e87a1){_0x2bcfcb=_0x2bcfcb-0x0;var _0x2881a2=_0x3399[_0x2bcfcb];return _0x2881a2;};'use strict';var asr=require('./lib/api');module[_0x9339('0x0')]=function(_0x517793,_0x87b9de,_0x47cc57,_0x2f7d8e){return asr(_0x517793,_0x87b9de,_0x47cc57);}; \ No newline at end of file +var _0x07bf=['./lib/api'];(function(_0x552b6a,_0x1f3b6c){var _0x5c3c46=function(_0x315830){while(--_0x315830){_0x552b6a['push'](_0x552b6a['shift']());}};_0x5c3c46(++_0x1f3b6c);}(_0x07bf,0x12a));var _0xf07b=function(_0xe30977,_0x52979d){_0xe30977=_0xe30977-0x0;var _0x415c9a=_0x07bf[_0xe30977];return _0x415c9a;};'use strict';var asr=require(_0xf07b('0x0'));module['exports']=function(_0x485892,_0x42ee90,_0x3d93f5,_0x1cd839){return asr(_0x485892,_0x42ee90,_0x3d93f5);}; \ 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 9661209..fc52b97 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 _0x6953=['LINEAR16','8000','url','bluebird','length','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST'];(function(_0x11c0f2,_0xc37a5a){var _0x505085=function(_0x1e08f8){while(--_0x1e08f8){_0x11c0f2['push'](_0x11c0f2['shift']());}};_0x505085(++_0xc37a5a);}(_0x6953,0x91));var _0x3695=function(_0x48d3fa,_0x3808a6){_0x48d3fa=_0x48d3fa-0x0;var _0x4c4995=_0x6953[_0x48d3fa];return _0x4c4995;};'use strict';var url=require(_0x3695('0x0'));var BPromise=require(_0x3695('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x53e2fa,_0x402642,_0x550d98){return new BPromise(function(_0x275b95,_0xca2457){var _0x366541;if(typeof _0x53e2fa!=='string'||_0x53e2fa[_0x3695('0x2')]===0x0){return _0xca2457('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x402642!==_0x3695('0x3')||_0x402642[_0x3695('0x2')]===0x0){return _0xca2457(_0x3695('0x4'));}if(typeof _0x550d98!==_0x3695('0x5')&&(typeof _0x550d98!==_0x3695('0x3')||_0x550d98['length']===0x0)){return _0xca2457(_0x3695('0x6'));}try{_0x366541=fs['readFileSync'](_0x53e2fa)[_0x3695('0x7')]('base64');}catch(_0x523edd){return _0xca2457(_0x523edd);}return _0x275b95({'method':_0x3695('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x402642,'body':{'config':{'encoding':_0x3695('0x9'),'sampleRateHertz':_0x3695('0xa'),'languageCode':_0x550d98},'audio':{'content':_0x366541}},'json':!![]});});}; \ No newline at end of file +var _0x6e77=['filepath\x20should\x20be\x20a\x20string','string','length','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','bluebird'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6e77,0xef));var _0x76e7=function(_0xf9bcaf,_0x3c9230){_0xf9bcaf=_0xf9bcaf-0x0;var _0x1dff25=_0x6e77[_0xf9bcaf];return _0x1dff25;};'use strict';var url=require('url');var BPromise=require(_0x76e7('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x389715,_0x2aea10,_0x57a8b3){return new BPromise(function(_0x37101b,_0x305900){var _0xcc6627;if(typeof _0x389715!=='string'||_0x389715['length']===0x0){return _0x305900(_0x76e7('0x1'));}if(typeof _0x2aea10!==_0x76e7('0x2')||_0x2aea10[_0x76e7('0x3')]===0x0){return _0x305900('key\x20should\x20be\x20a\x20string');}if(typeof _0x57a8b3!==_0x76e7('0x4')&&(typeof _0x57a8b3!==_0x76e7('0x2')||_0x57a8b3[_0x76e7('0x3')]===0x0)){return _0x305900('lang\x20should\x20be\x20a\x20string');}try{_0xcc6627=fs[_0x76e7('0x5')](_0x389715)[_0x76e7('0x6')]('base64');}catch(_0x37f521){return _0x305900(_0x37f521);}return _0x37101b({'method':_0x76e7('0x7'),'uri':host+_0x76e7('0x8')+_0x2aea10,'body':{'config':{'encoding':_0x76e7('0x9'),'sampleRateHertz':'8000','languageCode':_0x57a8b3},'audio':{'content':_0xcc6627}},'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 fc4dbd0..16cccab 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 _0xfe05=['./asr'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xfe05,0x97));var _0x5fe0=function(_0x5b7fc1,_0x4e7159){_0x5b7fc1=_0x5b7fc1-0x0;var _0x427494=_0xfe05[_0x5b7fc1];return _0x427494;};var asr=require(_0x5fe0('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xbff2=['./asr'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xbff2,0x1da));var _0x2bff=function(_0x18bfcb,_0x53eee5){_0x18bfcb=_0x18bfcb-0x0;var _0x11d63b=_0xbff2[_0x18bfcb];return _0x11d63b;};var asr=require(_0x2bff('0x0'));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 9d81215..e2b8aa6 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 _0xf457=['transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','score','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20confidence','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','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','request\x20to\x20','statusCode','statusMessage','createWriteStream','finish\x20download\x20file','unlink','download\x20error','pipe','\x20failed,\x20status\x20code\x20=\x20','data','end','transcode','wav','error\x20convert','info','resolve','tmp','generate','.wav','then','chmodSync','split','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','alternatives'];(function(_0x3f47dc,_0x450bae){var _0x291362=function(_0x23cbda){while(--_0x23cbda){_0x3f47dc['push'](_0x3f47dc['shift']());}};_0x291362(++_0x450bae);}(_0xf457,0x147));var _0x7f45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf457[_0x20a584];return _0x4b41a8;};'use strict';var apiai=require(_0x7f45('0x0'));var BPromise=require(_0x7f45('0x1'));var dialogflow=require(_0x7f45('0x2'));var fs=require('fs');var http=require(_0x7f45('0x3'));var https=require(_0x7f45('0x4'));var md5=require('md5');var path=require(_0x7f45('0x5'));var querystring=require(_0x7f45('0x6'));var rp=require(_0x7f45('0x7'));var rs=require(_0x7f45('0x8'));var sox=require(_0x7f45('0x9'));var tts=require(_0x7f45('0xa'));var urlParse=require('url')[_0x7f45('0xb')];var util=require(_0x7f45('0xc'));var aws=require('./aws');var google=require(_0x7f45('0xd'));var sestek=require('./sestek');var tilde=require(_0x7f45('0xe'));var logger=require(_0x7f45('0xf'))(_0x7f45('0x10'));var ISPEECH_API=_0x7f45('0x11');function downloadFile(_0x46d4e7,_0xe0c733){return new BPromise(function(_0x227f75,_0x2ad50d){var _0xbf3484=urlParse(_0x46d4e7);var _0x37db54=_0xbf3484[_0x7f45('0x12')]===_0x7f45('0x13')?https:http;var _0x407f07={'host':_0xbf3484[_0x7f45('0x14')],'path':_0xbf3484[_0x7f45('0x5')],'headers':{'user-agent':_0x7f45('0x15')}};_0x37db54[_0x7f45('0x16')](_0x407f07,function(_0x359540){if(_0x359540['statusCode']!==0xc8){logger[_0x7f45('0x17')](_0x7f45('0x18')+_0x46d4e7+'\x20failed,\x20status\x20code\x20=\x20'+_0x359540['statusCode']+'\x20('+_0x359540['statusMessage']+')');_0x2ad50d(new Error(_0x7f45('0x18')+_0x46d4e7+'\x20failed,\x20status\x20code\x20=\x20'+_0x359540[_0x7f45('0x19')]+'\x20('+_0x359540[_0x7f45('0x1a')]+')'));return;}var _0xa854ab=fs[_0x7f45('0x1b')](_0xe0c733);_0xa854ab['on']('finish',function(){logger['info'](_0x7f45('0x1c'));_0xa854ab['close'](_0x227f75);});_0xa854ab['on'](_0x7f45('0x17'),function(_0x3625e5){fs[_0x7f45('0x1d')](_0xe0c733);logger[_0x7f45('0x17')](_0x7f45('0x1e'),_0x3625e5);_0x2ad50d(_0x3625e5);});_0x359540[_0x7f45('0x1f')](_0xa854ab);})['on'](_0x7f45('0x17'),function(_0x577978){logger[_0x7f45('0x17')](_0x577978);_0x2ad50d(_0x577978);})['end']();});}function uploadFile(_0x243267){return new BPromise(function(_0x34bf88,_0x3dc4ce){var _0x10d61d=urlParse(_0x243267);var _0x37b655=_0x10d61d['protocol']===_0x7f45('0x13')?https:http;var _0x282710={'host':_0x10d61d[_0x7f45('0x14')],'path':_0x10d61d[_0x7f45('0x5')],'headers':{'user-agent':_0x7f45('0x15')}};_0x37b655[_0x7f45('0x16')](_0x282710,function(_0x59cd40){if(_0x59cd40[_0x7f45('0x19')]!==0xc8){_0x3dc4ce(new Error('request\x20to\x20'+_0x243267+_0x7f45('0x20')+_0x59cd40['statusCode']+'\x20('+_0x59cd40[_0x7f45('0x1a')]+')'));return;}var _0xc10ac0='';_0x59cd40['on'](_0x7f45('0x21'),function(_0x85676f){_0xc10ac0+=_0x85676f;});_0x59cd40['on'](_0x7f45('0x22'),function(){_0x34bf88(_0xc10ac0);});})['on'](_0x7f45('0x17'),function(_0x385740){_0x3dc4ce(_0x385740);})['end']();});}function convertFile(_0x2dc0bd,_0x21c3a2){return new BPromise(function(_0x5119a3,_0x3c1351){var _0x5294f8=sox[_0x7f45('0x23')](_0x2dc0bd,_0x21c3a2,{'sampleRate':0x1f40,'format':_0x7f45('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5294f8['on']('error',function(_0x4a67e3){logger['error'](_0x7f45('0x25'),_0x4a67e3);_0x3c1351(_0x4a67e3);});_0x5294f8['on']('end',function(){logger[_0x7f45('0x26')]('finish\x20to\x20convert');_0x5119a3();});_0x5294f8['start']();});}function base64Decode(_0x88b269,_0x17cf92){var _0x169f0b=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs[_0x7f45('0x29')](0x4)+_0x7f45('0x2a'));fs['writeFileSync'](_0x169f0b,_0x88b269,'base64');return convertFile(_0x169f0b,_0x17cf92)[_0x7f45('0x2b')](function(){try{fs[_0x7f45('0x1d')](_0x169f0b);fs[_0x7f45('0x2c')](_0x17cf92,'777');}catch(_0x441534){logger['error'](_0x441534);}return _0x17cf92[_0x7f45('0x2d')]('.')[0x0];});}function base64Encode(_0x175b86){var _0x12318a=fs['readFileSync'](_0x175b86);return new Buffer(_0x12318a)['toString'](_0x7f45('0x2e'));}exports[_0x7f45('0x2f')]=function(_0x529d00,_0x334f31,_0x23f7d6,_0xb7ef72,_0x7e1f28,_0xcc7846){var _0x181dbb,_0x8e3aee;var _0x4985e7=_0x7f45('0x30');var _0x3a0f19=_0x7f45('0x31')+_0x529d00;var _0x12cc6c={};if(_0x334f31===_0x7f45('0x32')){_0x12cc6c[_0x7f45('0x33')]={'ssml':_0x23f7d6};}else{_0x12cc6c[_0x7f45('0x33')]={'text':_0x23f7d6};};_0x12cc6c['voice']={'languageCode':_0xb7ef72,'ssmlGender':_0x7e1f28};_0x12cc6c[_0x7f45('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2c427e={'url':_0x4985e7+_0x7f45('0x35')+_0x3a0f19,'method':'POST','json':!![],'body':_0x12cc6c};return rp(_0x2c427e)['then'](function(_0x4d0455){return new BPromise(function(_0xb39856,_0xb8f8b2){_0x181dbb=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs[_0x7f45('0x29')](0x4)+'.mp3');var _0x5baa9a=Buffer[_0x7f45('0x36')](_0x4d0455[_0x7f45('0x37')],_0x7f45('0x2e'));return fs[_0x7f45('0x38')](_0x181dbb,_0x5baa9a,function(_0x22e7bc){_0xb8f8b2(_0x22e7bc);},function(_0x4b8d9b){fs['chmodSync'](_0x181dbb,'777');_0xb39856(_0x4b8d9b);});});})[_0x7f45('0x2b')](function(_0x4b1473){_0x8e3aee=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs[_0x7f45('0x29')](0x4)+_0x7f45('0x2a'));return convertFile(_0x181dbb,_0x8e3aee);})[_0x7f45('0x2b')](function(){try{fs['unlink'](_0x181dbb);fs[_0x7f45('0x2c')](_0x8e3aee,_0x7f45('0x39'));}catch(_0x31e69b){logger[_0x7f45('0x17')](_0x31e69b);}logger[_0x7f45('0x26')](_0x7f45('0x3a'),_0x8e3aee[_0x7f45('0x2d')]('.')[0x0]);return _0x8e3aee['split']('.')[0x0];});};exports[_0x7f45('0x3b')]=function(_0x4fe709,_0x3cc0e0){var _0x5abd08=_0x7f45('0x3c');var _0x3225ed,_0x1acb82;var _0x57e7aa;var _0x40591d={'encoding':_0x7f45('0x3d'),'method':_0x7f45('0x3e'),'timeout':0x2710,'url':_0x5abd08,'headers':{'Content-Type':_0x7f45('0x3f')},'body':_0x7f45('0x40')+encodeURIComponent(JSON[_0x7f45('0x41')]([[['jQ1olc',JSON[_0x7f45('0x41')]([_0x4fe709,_0x3cc0e0||'en',![],'null']),null,_0x7f45('0x42')]]]))};return rp(_0x40591d)['then'](function(_0x4a41f0){try{_0x57e7aa=eval(_0x4a41f0[_0x7f45('0x43')](0x5))[0x0][0x2];}catch(_0x40e12f){throw new Error(_0x7f45('0x44')+_0x4a41f0[_0x7f45('0x21')]);}if(!_0x57e7aa){if(_0x4fe709[_0x7f45('0x45')]>0xc8){throw new Error(_0x7f45('0x46'));}else{throw new Error(_0x7f45('0x47')+_0x3cc0e0+_0x7f45('0x48'));}}try{_0x57e7aa=eval(_0x57e7aa)[0x0];}catch(_0x1b72f1){throw new Error(_0x7f45('0x44')+res['data']);}const _0xa6bedb=_0x57e7aa;_0x3225ed=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs[_0x7f45('0x29')](0x4)+_0x7f45('0x49'));fs[_0x7f45('0x4a')](_0x3225ed,_0x57e7aa,{'encoding':'base64'});_0x1acb82=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs['generate'](0x4)+_0x7f45('0x2a'));return convertFile(_0x3225ed,_0x1acb82);})[_0x7f45('0x2b')](function(){try{fs[_0x7f45('0x1d')](_0x3225ed);fs['chmodSync'](_0x1acb82,_0x7f45('0x39'));}catch(_0x4aa998){logger['error'](_0x4aa998);}logger['info'](_0x7f45('0x4b'),_0x1acb82[_0x7f45('0x2d')]('.')[0x0]);return _0x1acb82[_0x7f45('0x2d')]('.')[0x0];});};exports[_0x7f45('0x4c')]=function(_0x5ffc14,_0x46717a,_0x3be381){return google[_0x7f45('0x4d')](_0x5ffc14,_0x46717a,_0x3be381)['then'](function(_0x37355f){logger[_0x7f45('0x26')](_0x37355f[_0x7f45('0x4e')]);return rp(_0x37355f);})[_0x7f45('0x2b')](function(_0x1b054a){var _0xa42105='';var _0x5d6478=0x0;try{fs[_0x7f45('0x1d')](_0x5ffc14);}catch(_0x353ddb){logger['error'](_0x353ddb);}if(_0x1b054a&&_0x1b054a['results']){_0xa42105=_0x1b054a[_0x7f45('0x4f')]['map'](function(_0x22406b){return _0x22406b&&_0x22406b[_0x7f45('0x50')][0x0]&&_0x22406b[_0x7f45('0x50')][0x0][_0x7f45('0x51')]?_0x22406b[_0x7f45('0x50')][0x0][_0x7f45('0x51')]:'';})[_0x7f45('0x52')]('\x0a');_0x5d6478=_0x1b054a[_0x7f45('0x4f')][_0x7f45('0x53')](function(_0x42772c){return _0x42772c&&_0x42772c[_0x7f45('0x50')][0x0]&&_0x42772c['alternatives'][0x0][_0x7f45('0x54')]?_0x42772c[_0x7f45('0x50')][0x0][_0x7f45('0x54')]:0x0;})[_0x7f45('0x52')]('\x0a');}logger[_0x7f45('0x26')](_0x7f45('0x55'),_0xa42105);logger[_0x7f45('0x26')](_0x7f45('0x56'),_0x5d6478);return{'transcript':_0xa42105,'confidence':_0x5d6478};})[_0x7f45('0x57')](function(_0x4df8eb){logger[_0x7f45('0x17')]('[%s]\x20%s:%s',_0x4df8eb[_0x7f45('0x19')],_0x4df8eb['name'],_0x4df8eb['message']);});};exports[_0x7f45('0x58')]=function(_0x3f0f1a,_0x440fc5,_0x288396,_0x3a6c80){var _0x163f87=apiai(_0x440fc5,{'language':_0x3a6c80||'en'});return _0x163f87[_0x7f45('0x59')](_0x288396,{'sessionId':md5(_0x3f0f1a)})[_0x7f45('0x2b')](function(_0x58f0c0){logger['info'](JSON[_0x7f45('0x41')](_0x58f0c0));return{'source':_0x58f0c0[_0x7f45('0x5a')]['source'],'resolvedQuery':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x5b')],'action':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x5c')],'actionIncomplete':_0x58f0c0[_0x7f45('0x5a')]['actionIncomplete'],'speech':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x5d')][_0x7f45('0x5e')],'score':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x5f')],'statusCode':_0x58f0c0['status'][_0x7f45('0x60')],'endConversation':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x61')]['endConversation']||![],'isFallbackIntent':_0x58f0c0[_0x7f45('0x5a')][_0x7f45('0x61')][_0x7f45('0x62')]};});};exports[_0x7f45('0x63')]=function(_0x2d84e5,_0x141610,_0x5eb223,_0x409b6a,_0x4dbc15,_0x36a5a2){var _0x5acc62=_0x409b6a[_0x7f45('0x64')](/\\n/g,'\x0a');var _0x5122e5={'credentials':{'private_key':_0x5acc62,'client_email':_0x5eb223}};var _0x480a75=new dialogflow[(_0x7f45('0x65'))](_0x5122e5);var _0x4a3705=_0x480a75[_0x7f45('0x66')](_0x141610,md5(_0x2d84e5));var _0x3dd978={'session':_0x4a3705,'queryInput':{'text':{'text':_0x4dbc15,'languageCode':_0x36a5a2}}};return _0x480a75[_0x7f45('0x67')](_0x3dd978)['then'](function(_0x5941e3){if(_0x5941e3&&_0x5941e3[_0x7f45('0x45')]){logger[_0x7f45('0x26')](_0x7f45('0x68'),JSON[_0x7f45('0x41')](_0x5941e3));var _0x8e42bb=_0x5941e3[0x0];if(_0x8e42bb){var _0x548775={'action':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x5c')],'allRequiredParamsPresent':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x6a')],'endConversation':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x6b')]&&_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x6b')][_0x7f45('0x6c')]?_0x8e42bb['queryResult'][_0x7f45('0x6b')][_0x7f45('0x6c')][_0x7f45('0x6d')]['boolValue']:![],'fulfillmentText':_0x8e42bb[_0x7f45('0x69')]['fulfillmentText'],'intentName':_0x8e42bb['queryResult'][_0x7f45('0x6e')]['name'],'intentDisplayName':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x6e')][_0x7f45('0x6f')],'isFallbackIntent':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x6e')]['isFallback'],'languageCode':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x70')],'queryText':_0x8e42bb['queryResult'][_0x7f45('0x71')],'responseId':_0x8e42bb[_0x7f45('0x72')],'score':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x73')],'speech':_0x8e42bb[_0x7f45('0x69')][_0x7f45('0x74')],'providerResponse':JSON[_0x7f45('0x41')](_0x5941e3)};return _0x548775;}}});};exports[_0x7f45('0x75')]=function(_0x39467d,_0x77f292,_0x43f57f,_0x11bb31){return tilde[_0x7f45('0x4d')](_0x39467d,_0x77f292,_0x43f57f,_0x11bb31)[_0x7f45('0x2b')](function(_0x29a638){try{fs[_0x7f45('0x1d')](_0x39467d);}catch(_0x2c7270){logger[_0x7f45('0x17')](_0x2c7270);}logger['info']('Tilde\x20ASR\x20transcription',_0x29a638[_0x7f45('0x51')]);logger[_0x7f45('0x26')](_0x7f45('0x76'),_0x29a638['confidence']);return _0x29a638;});};exports[_0x7f45('0x77')]=function(_0x3f19e1,_0x24c136,_0x3f1307,_0x528c65,_0x39a22f,_0x19ba62){var _0xaf379d=path['resolve'](__dirname,_0x7f45('0x28'),rs['generate'](0x4)+_0x7f45('0x49'));var _0x563744;return aws[_0x7f45('0x78')](_0x3f19e1,_0x24c136,_0x3f1307,_0x528c65,_0x39a22f,_0x19ba62,_0xaf379d)[_0x7f45('0x2b')](function(){_0x563744=path['resolve'](__dirname,_0x7f45('0x28'),rs[_0x7f45('0x29')](0x4)+_0x7f45('0x2a'));return convertFile(_0xaf379d,_0x563744);})['then'](function(){try{fs[_0x7f45('0x1d')](_0xaf379d);fs[_0x7f45('0x2c')](_0x563744,_0x7f45('0x39'));}catch(_0x541a63){logger['error'](_0x541a63);}return _0x563744[_0x7f45('0x2d')]('.')[0x0];});};exports[_0x7f45('0x79')]=function(_0xfc8585,_0x5de0ef,_0x413774,_0x5b2a60,_0x354baa,_0x438dbd){return aws[_0x7f45('0x7a')](_0xfc8585,_0x5de0ef,_0x413774,_0x5b2a60,_0x354baa,_0x438dbd)[_0x7f45('0x2b')](function(_0xa9eca8){logger[_0x7f45('0x26')](JSON[_0x7f45('0x41')](_0xa9eca8));return _0xa9eca8;});};exports[_0x7f45('0x7b')]=function(_0x1f5dc4,_0x1845f7,_0x5dffab,_0x3b7e1d){var _0x54b395=util[_0x7f45('0x7c')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1f5dc4,encodeURIComponent(_0x1845f7),_0x5dffab,_0x3b7e1d);var _0x42aebc=path[_0x7f45('0x27')](__dirname,'tmp',rs[_0x7f45('0x29')](0x4)+'.mp3');var _0xeb306b;return downloadFile(_0x54b395,_0x42aebc)['then'](function(){_0xeb306b=path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x42aebc,_0xeb306b);})[_0x7f45('0x2b')](function(){try{fs[_0x7f45('0x1d')](_0x42aebc);fs[_0x7f45('0x2c')](_0xeb306b,_0x7f45('0x39'));}catch(_0x4b700d){logger[_0x7f45('0x17')](_0x4b700d);}return _0xeb306b[_0x7f45('0x2d')]('.')[0x0];});};exports[_0x7f45('0x7d')]=function(_0x299d2b,_0x54f6c1,_0x27fe1c,_0x2a1cce){var _0xa6ebec=util[_0x7f45('0x7c')](_0x7f45('0x7e'),ISPEECH_API,_0x54f6c1,_0x27fe1c,base64Encode(_0x299d2b),_0x2a1cce?util[_0x7f45('0x7c')](_0x7f45('0x7f'),encodeURIComponent(_0x2a1cce)):_0x7f45('0x80'));return uploadFile(_0xa6ebec)[_0x7f45('0x2b')](function(_0x77ed97){return querystring[_0x7f45('0xb')](_0x77ed97);});};exports['sestekNDA']=function(_0x4eb361,_0x34fccf){return sestek['nda'](_0x4eb361,_0x34fccf)[_0x7f45('0x2b')](function(_0x4bccd3){logger[_0x7f45('0x26')](JSON[_0x7f45('0x41')](_0x4bccd3));var _0x1719a7={'speech':_0x4bccd3[_0x7f45('0x81')],'action':_0x4bccd3[_0x7f45('0x82')]?_0x4bccd3['channelData'][_0x7f45('0x83')]:undefined,'actiondata':_0x4bccd3[_0x7f45('0x82')]?_0x4bccd3[_0x7f45('0x82')][_0x7f45('0x84')]:undefined};if(_0x4bccd3[_0x7f45('0x82')]&&_0x4bccd3[_0x7f45('0x82')][_0x7f45('0x85')]){return base64Decode(_0x4bccd3[_0x7f45('0x82')][_0x7f45('0x85')]['Data'],path[_0x7f45('0x27')](__dirname,_0x7f45('0x28'),rs['generate'](0x4)+'.wav'))['then'](function(_0x34ebc0){_0x1719a7[_0x7f45('0x86')]=_0x34ebc0;return _0x1719a7;});}return _0x1719a7;});};exports[_0x7f45('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0x01e7=['.wav','base64','then','chmodSync','777','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','result','resolvedQuery','action','actionIncomplete','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','querystring','request-promise','randomstring','google-tts-api','url','util','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','path','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate'];(function(_0x436fe0,_0x3f1719){var _0x7e1740=function(_0x35d85d){while(--_0x35d85d){_0x436fe0['push'](_0x436fe0['shift']());}};_0x7e1740(++_0x3f1719);}(_0x01e7,0x15c));var _0x701e=function(_0x40f583,_0x3cc230){_0x40f583=_0x40f583-0x0;var _0x5d6a51=_0x01e7[_0x40f583];return _0x5d6a51;};'use strict';var apiai=require(_0x701e('0x0'));var BPromise=require(_0x701e('0x1'));var dialogflow=require(_0x701e('0x2'));var fs=require('fs');var http=require(_0x701e('0x3'));var https=require('https');var md5=require(_0x701e('0x4'));var path=require('path');var querystring=require(_0x701e('0x5'));var rp=require(_0x701e('0x6'));var rs=require(_0x701e('0x7'));var sox=require('sox');var tts=require(_0x701e('0x8'));var urlParse=require(_0x701e('0x9'))['parse'];var util=require(_0x701e('0xa'));var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x701e('0xb'));var logger=require(_0x701e('0xc'))(_0x701e('0xd'));var ISPEECH_API=_0x701e('0xe');function downloadFile(_0x3a0234,_0x5e68eb){return new BPromise(function(_0x8c9d75,_0x308ba7){var _0x578822=urlParse(_0x3a0234);var _0x11413f=_0x578822['protocol']===_0x701e('0xf')?https:http;var _0x228d5c={'host':_0x578822[_0x701e('0x10')],'path':_0x578822[_0x701e('0x11')],'headers':{'user-agent':_0x701e('0x12')}};_0x11413f[_0x701e('0x13')](_0x228d5c,function(_0x5db94d){if(_0x5db94d['statusCode']!==0xc8){logger[_0x701e('0x14')](_0x701e('0x15')+_0x3a0234+_0x701e('0x16')+_0x5db94d[_0x701e('0x17')]+'\x20('+_0x5db94d['statusMessage']+')');_0x308ba7(new Error(_0x701e('0x15')+_0x3a0234+_0x701e('0x16')+_0x5db94d[_0x701e('0x17')]+'\x20('+_0x5db94d[_0x701e('0x18')]+')'));return;}var _0xf02534=fs[_0x701e('0x19')](_0x5e68eb);_0xf02534['on']('finish',function(){logger[_0x701e('0x1a')](_0x701e('0x1b'));_0xf02534[_0x701e('0x1c')](_0x8c9d75);});_0xf02534['on'](_0x701e('0x14'),function(_0x149d59){fs[_0x701e('0x1d')](_0x5e68eb);logger[_0x701e('0x14')](_0x701e('0x1e'),_0x149d59);_0x308ba7(_0x149d59);});_0x5db94d[_0x701e('0x1f')](_0xf02534);})['on']('error',function(_0x2a747d){logger[_0x701e('0x14')](_0x2a747d);_0x308ba7(_0x2a747d);})[_0x701e('0x20')]();});}function uploadFile(_0x3f1012){return new BPromise(function(_0xaa374,_0x54e112){var _0x2cee90=urlParse(_0x3f1012);var _0x3c3a88=_0x2cee90[_0x701e('0x21')]==='https:'?https:http;var _0x17e644={'host':_0x2cee90[_0x701e('0x10')],'path':_0x2cee90['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x3c3a88[_0x701e('0x13')](_0x17e644,function(_0xbfdf99){if(_0xbfdf99['statusCode']!==0xc8){_0x54e112(new Error(_0x701e('0x15')+_0x3f1012+_0x701e('0x16')+_0xbfdf99[_0x701e('0x17')]+'\x20('+_0xbfdf99['statusMessage']+')'));return;}var _0x137289='';_0xbfdf99['on'](_0x701e('0x22'),function(_0x2abd6d){_0x137289+=_0x2abd6d;});_0xbfdf99['on'](_0x701e('0x20'),function(){_0xaa374(_0x137289);});})['on'](_0x701e('0x14'),function(_0x5d7d7f){_0x54e112(_0x5d7d7f);})[_0x701e('0x20')]();});}function convertFile(_0x4da66e,_0x4e74d2){return new BPromise(function(_0x185d8b,_0x311245){var _0xcd1d1a=sox[_0x701e('0x23')](_0x4da66e,_0x4e74d2,{'sampleRate':0x1f40,'format':_0x701e('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xcd1d1a['on'](_0x701e('0x14'),function(_0x12879d){logger[_0x701e('0x14')](_0x701e('0x25'),_0x12879d);_0x311245(_0x12879d);});_0xcd1d1a['on'](_0x701e('0x20'),function(){logger[_0x701e('0x1a')](_0x701e('0x26'));_0x185d8b();});_0xcd1d1a[_0x701e('0x27')]();});}function base64Decode(_0x43bc8f,_0x388830){var _0x57c84d=path['resolve'](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+_0x701e('0x2a'));fs['writeFileSync'](_0x57c84d,_0x43bc8f,_0x701e('0x2b'));return convertFile(_0x57c84d,_0x388830)[_0x701e('0x2c')](function(){try{fs[_0x701e('0x1d')](_0x57c84d);fs[_0x701e('0x2d')](_0x388830,_0x701e('0x2e'));}catch(_0x58551b){logger[_0x701e('0x14')](_0x58551b);}return _0x388830['split']('.')[0x0];});}function base64Encode(_0x20e896){var _0x33b2fb=fs['readFileSync'](_0x20e896);return new Buffer(_0x33b2fb)['toString'](_0x701e('0x2b'));}exports[_0x701e('0x2f')]=function(_0x4d6d56,_0x48b476,_0x1d1968,_0x5c7dda,_0x523e49,_0x5c14f3){var _0x9c7af6,_0x2a5646;var _0x12995a=_0x701e('0x30');var _0x42187c=_0x701e('0x31')+_0x4d6d56;var _0x189c27={};if(_0x48b476==='ssml'){_0x189c27[_0x701e('0x32')]={'ssml':_0x1d1968};}else{_0x189c27[_0x701e('0x32')]={'text':_0x1d1968};};_0x189c27[_0x701e('0x33')]={'languageCode':_0x5c7dda,'ssmlGender':_0x523e49};_0x189c27['audioConfig']={'audioEncoding':_0x701e('0x34'),'sampleRateHertz':0x1f40};var _0x209979={'url':_0x12995a+_0x701e('0x35')+_0x42187c,'method':_0x701e('0x36'),'json':!![],'body':_0x189c27};return rp(_0x209979)[_0x701e('0x2c')](function(_0x373b1d){return new BPromise(function(_0x1bb281,_0x603cdc){_0x9c7af6=path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs['generate'](0x4)+_0x701e('0x38'));var _0x1b398d=Buffer[_0x701e('0x39')](_0x373b1d[_0x701e('0x3a')],_0x701e('0x2b'));return fs[_0x701e('0x3b')](_0x9c7af6,_0x1b398d,function(_0x3906b4){_0x603cdc(_0x3906b4);},function(_0x232838){fs[_0x701e('0x2d')](_0x9c7af6,_0x701e('0x2e'));_0x1bb281(_0x232838);});});})['then'](function(_0x2e8fad){_0x2a5646=path[_0x701e('0x37')](__dirname,'tmp',rs[_0x701e('0x29')](0x4)+'.wav');return convertFile(_0x9c7af6,_0x2a5646);})[_0x701e('0x2c')](function(){try{fs[_0x701e('0x1d')](_0x9c7af6);fs[_0x701e('0x2d')](_0x2a5646,_0x701e('0x2e'));}catch(_0x57328b){logger[_0x701e('0x14')](_0x57328b);}logger[_0x701e('0x1a')](_0x701e('0x3c'),_0x2a5646[_0x701e('0x3d')]('.')[0x0]);return _0x2a5646[_0x701e('0x3d')]('.')[0x0];});};exports[_0x701e('0x3e')]=function(_0xbfad3d,_0x45c316){var _0x2e857c=_0x701e('0x3f');var _0x489288,_0x57b3dd;var _0x5d7cae;var _0x10f1b7={'encoding':_0x701e('0x40'),'method':_0x701e('0x36'),'timeout':0x2710,'url':_0x2e857c,'headers':{'Content-Type':_0x701e('0x41')},'body':_0x701e('0x42')+encodeURIComponent(JSON[_0x701e('0x43')]([[[_0x701e('0x44'),JSON[_0x701e('0x43')]([_0xbfad3d,_0x45c316||'en',![],'null']),null,_0x701e('0x45')]]]))};return rp(_0x10f1b7)[_0x701e('0x2c')](function(_0x3afb03){try{_0x5d7cae=eval(_0x3afb03['slice'](0x5))[0x0][0x2];}catch(_0x1eb902){throw new Error('parse\x20response\x20failed:\x0a'+_0x3afb03[_0x701e('0x22')]);}if(!_0x5d7cae){if(_0xbfad3d[_0x701e('0x46')]>0xc8){throw new Error(_0x701e('0x47'));}else{throw new Error(_0x701e('0x48')+_0x45c316+_0x701e('0x49'));}}try{_0x5d7cae=eval(_0x5d7cae)[0x0];}catch(_0x20f361){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x2e5baa=_0x5d7cae;_0x489288=path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs['generate'](0x4)+_0x701e('0x38'));fs[_0x701e('0x4a')](_0x489288,_0x5d7cae,{'encoding':'base64'});_0x57b3dd=path['resolve'](__dirname,_0x701e('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x489288,_0x57b3dd);})[_0x701e('0x2c')](function(){try{fs[_0x701e('0x1d')](_0x489288);fs[_0x701e('0x2d')](_0x57b3dd,'777');}catch(_0x59457e){logger['error'](_0x59457e);}logger[_0x701e('0x1a')]('goggleTTS\x20path',_0x57b3dd[_0x701e('0x3d')]('.')[0x0]);return _0x57b3dd[_0x701e('0x3d')]('.')[0x0];});};exports['googleASR']=function(_0x6e274b,_0x183ff7,_0x25d665){return google[_0x701e('0x4b')](_0x6e274b,_0x183ff7,_0x25d665)[_0x701e('0x2c')](function(_0x1419ff){logger[_0x701e('0x1a')](_0x1419ff['uri']);return rp(_0x1419ff);})[_0x701e('0x2c')](function(_0x58df58){var _0x1e94b1='';var _0x30c9bc=0x0;try{fs[_0x701e('0x1d')](_0x6e274b);}catch(_0x261553){logger[_0x701e('0x14')](_0x261553);}if(_0x58df58&&_0x58df58[_0x701e('0x4c')]){_0x1e94b1=_0x58df58[_0x701e('0x4c')][_0x701e('0x4d')](function(_0x563aa4){return _0x563aa4&&_0x563aa4[_0x701e('0x4e')][0x0]&&_0x563aa4[_0x701e('0x4e')][0x0][_0x701e('0x4f')]?_0x563aa4[_0x701e('0x4e')][0x0]['transcript']:'';})[_0x701e('0x50')]('\x0a');_0x30c9bc=_0x58df58[_0x701e('0x4c')]['map'](function(_0x4896af){return _0x4896af&&_0x4896af[_0x701e('0x4e')][0x0]&&_0x4896af[_0x701e('0x4e')][0x0][_0x701e('0x51')]?_0x4896af[_0x701e('0x4e')][0x0][_0x701e('0x51')]:0x0;})[_0x701e('0x50')]('\x0a');}logger['info'](_0x701e('0x52'),_0x1e94b1);logger[_0x701e('0x1a')](_0x701e('0x53'),_0x30c9bc);return{'transcript':_0x1e94b1,'confidence':_0x30c9bc};})[_0x701e('0x54')](function(_0x111ecd){logger[_0x701e('0x14')](_0x701e('0x55'),_0x111ecd['statusCode'],_0x111ecd['name'],_0x111ecd['message']);});};exports[_0x701e('0x56')]=function(_0x4d9627,_0x22e726,_0xa8f55d,_0x3aebcf){var _0x4ea0ab=apiai(_0x22e726,{'language':_0x3aebcf||'en'});return _0x4ea0ab['textRequest'](_0xa8f55d,{'sessionId':md5(_0x4d9627)})[_0x701e('0x2c')](function(_0x2bfddd){logger[_0x701e('0x1a')](JSON[_0x701e('0x43')](_0x2bfddd));return{'source':_0x2bfddd['result']['source'],'resolvedQuery':_0x2bfddd[_0x701e('0x57')][_0x701e('0x58')],'action':_0x2bfddd[_0x701e('0x57')][_0x701e('0x59')],'actionIncomplete':_0x2bfddd[_0x701e('0x57')][_0x701e('0x5a')],'speech':_0x2bfddd[_0x701e('0x57')]['fulfillment'][_0x701e('0x5b')],'score':_0x2bfddd[_0x701e('0x57')][_0x701e('0x5c')],'statusCode':_0x2bfddd[_0x701e('0x5d')]['code'],'endConversation':_0x2bfddd[_0x701e('0x57')][_0x701e('0x5e')][_0x701e('0x5f')]||![],'isFallbackIntent':_0x2bfddd[_0x701e('0x57')]['metadata'][_0x701e('0x60')]};});};exports[_0x701e('0x61')]=function(_0x35dcd1,_0x4a1683,_0x60f628,_0x5f25c7,_0x247241,_0x5b8ab4){var _0x57d71e=_0x5f25c7[_0x701e('0x62')](/\\n/g,'\x0a');var _0x8ece76={'credentials':{'private_key':_0x57d71e,'client_email':_0x60f628}};var _0x4d4178=new dialogflow[(_0x701e('0x63'))](_0x8ece76);var _0x306726=_0x4d4178[_0x701e('0x64')](_0x4a1683,md5(_0x35dcd1));var _0x4fb43d={'session':_0x306726,'queryInput':{'text':{'text':_0x247241,'languageCode':_0x5b8ab4}}};return _0x4d4178['detectIntent'](_0x4fb43d)[_0x701e('0x2c')](function(_0x435c2a){if(_0x435c2a&&_0x435c2a[_0x701e('0x46')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x701e('0x43')](_0x435c2a));var _0x29123b=_0x435c2a[0x0];if(_0x29123b){var _0x11af53={'action':_0x29123b['queryResult'][_0x701e('0x59')],'allRequiredParamsPresent':_0x29123b[_0x701e('0x65')][_0x701e('0x66')],'endConversation':_0x29123b[_0x701e('0x65')][_0x701e('0x67')]&&_0x29123b[_0x701e('0x65')][_0x701e('0x67')][_0x701e('0x68')]?_0x29123b[_0x701e('0x65')][_0x701e('0x67')][_0x701e('0x68')][_0x701e('0x69')]['boolValue']:![],'fulfillmentText':_0x29123b[_0x701e('0x65')][_0x701e('0x6a')],'intentName':_0x29123b[_0x701e('0x65')][_0x701e('0x6b')]['name'],'intentDisplayName':_0x29123b[_0x701e('0x65')][_0x701e('0x6b')]['displayName'],'isFallbackIntent':_0x29123b[_0x701e('0x65')]['intent'][_0x701e('0x6c')],'languageCode':_0x29123b[_0x701e('0x65')][_0x701e('0x6d')],'queryText':_0x29123b['queryResult']['queryText'],'responseId':_0x29123b['responseId'],'score':_0x29123b[_0x701e('0x65')][_0x701e('0x6e')],'speech':_0x29123b[_0x701e('0x65')]['fulfillmentText'],'providerResponse':JSON[_0x701e('0x43')](_0x435c2a)};return _0x11af53;}}});};exports[_0x701e('0x6f')]=function(_0x275f56,_0x418be2,_0x280559,_0x4ec600){return tilde['asr'](_0x275f56,_0x418be2,_0x280559,_0x4ec600)['then'](function(_0x593b53){try{fs[_0x701e('0x1d')](_0x275f56);}catch(_0x57c03f){logger[_0x701e('0x14')](_0x57c03f);}logger[_0x701e('0x1a')](_0x701e('0x70'),_0x593b53[_0x701e('0x4f')]);logger[_0x701e('0x1a')](_0x701e('0x71'),_0x593b53['confidence']);return _0x593b53;});};exports['awsPolly']=function(_0x596c99,_0xaf1246,_0x55ac75,_0x1c6b05,_0x231f8e,_0x449369){var _0x332596=path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+_0x701e('0x38'));var _0x514245;return aws[_0x701e('0x72')](_0x596c99,_0xaf1246,_0x55ac75,_0x1c6b05,_0x231f8e,_0x449369,_0x332596)[_0x701e('0x2c')](function(){_0x514245=path['resolve'](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+_0x701e('0x2a'));return convertFile(_0x332596,_0x514245);})[_0x701e('0x2c')](function(){try{fs[_0x701e('0x1d')](_0x332596);fs[_0x701e('0x2d')](_0x514245,'777');}catch(_0xd8b36e){logger[_0x701e('0x14')](_0xd8b36e);}return _0x514245[_0x701e('0x3d')]('.')[0x0];});};exports['awsLex']=function(_0x5305c1,_0x3ad34f,_0x347dcc,_0x2e5326,_0x2d3b71,_0x163bbe){return aws[_0x701e('0x73')](_0x5305c1,_0x3ad34f,_0x347dcc,_0x2e5326,_0x2d3b71,_0x163bbe)['then'](function(_0x2545b9){logger[_0x701e('0x1a')](JSON[_0x701e('0x43')](_0x2545b9));return _0x2545b9;});};exports[_0x701e('0x74')]=function(_0x36aa71,_0x1b1822,_0x18dee7,_0x3ee668){var _0x50ac9e=util[_0x701e('0x75')](_0x701e('0x76'),ISPEECH_API,_0x36aa71,encodeURIComponent(_0x1b1822),_0x18dee7,_0x3ee668);var _0x3233af=path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+'.mp3');var _0x4040d2;return downloadFile(_0x50ac9e,_0x3233af)[_0x701e('0x2c')](function(){_0x4040d2=path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+_0x701e('0x2a'));return convertFile(_0x3233af,_0x4040d2);})[_0x701e('0x2c')](function(){try{fs[_0x701e('0x1d')](_0x3233af);fs['chmodSync'](_0x4040d2,'777');}catch(_0x50c169){logger[_0x701e('0x14')](_0x50c169);}return _0x4040d2['split']('.')[0x0];});};exports[_0x701e('0x77')]=function(_0x1300f0,_0x3b44f6,_0xdb7d64,_0x3a910){var _0x4ad736=util[_0x701e('0x75')](_0x701e('0x78'),ISPEECH_API,_0x3b44f6,_0xdb7d64,base64Encode(_0x1300f0),_0x3a910?util[_0x701e('0x75')]('model=%s',encodeURIComponent(_0x3a910)):_0x701e('0x79'));return uploadFile(_0x4ad736)['then'](function(_0x80b2a9){return querystring['parse'](_0x80b2a9);});};exports[_0x701e('0x7a')]=function(_0x437d88,_0x2a6aaf){return sestek[_0x701e('0x7b')](_0x437d88,_0x2a6aaf)[_0x701e('0x2c')](function(_0x374218){logger[_0x701e('0x1a')](JSON[_0x701e('0x43')](_0x374218));var _0x4d4cb0={'speech':_0x374218['text'],'action':_0x374218[_0x701e('0x7c')]?_0x374218[_0x701e('0x7c')][_0x701e('0x7d')]:undefined,'actiondata':_0x374218[_0x701e('0x7c')]?_0x374218[_0x701e('0x7c')][_0x701e('0x7e')]:undefined};if(_0x374218[_0x701e('0x7c')]&&_0x374218[_0x701e('0x7c')][_0x701e('0x7f')]){return base64Decode(_0x374218[_0x701e('0x7c')][_0x701e('0x7f')]['Data'],path[_0x701e('0x37')](__dirname,_0x701e('0x28'),rs[_0x701e('0x29')](0x4)+_0x701e('0x2a')))[_0x701e('0x2c')](function(_0x43e3ee){_0x4d4cb0[_0x701e('0x80')]=_0x43e3ee;return _0x4d4cb0;});}return _0x4d4cb0;});};exports[_0x701e('0x81')]=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..177f71c 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 _0x0d8e=['exports','./nda'];(function(_0x2929ba,_0x506aa6){var _0x365e6e=function(_0x206fd3){while(--_0x206fd3){_0x2929ba['push'](_0x2929ba['shift']());}};_0x365e6e(++_0x506aa6);}(_0x0d8e,0x16f));var _0xe0d8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0d8e[_0x4a9fb1];return _0x348672;};var nda=require(_0xe0d8('0x0'));module[_0xe0d8('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 a37e530..662ebac 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 _0xfa2f=['../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xfa2f,0xe8));var _0xffa2=function(_0x1cfc16,_0x5b9290){_0x1cfc16=_0x1cfc16-0x0;var _0x1e4bf9=_0xfa2f[_0x1cfc16];return _0x1e4bf9;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xffa2('0x0'))('agi');module[_0xffa2('0x1')]=function(_0x34de1d,_0x4d6507){var _0x54d423={'method':_0xffa2('0x2'),'uri':url[_0xffa2('0x3')](_0x4d6507[_0xffa2('0x4')],_0xffa2('0x5')),'form':{'grant_type':_0xffa2('0x6'),'username':_0x4d6507[_0xffa2('0x7')],'password':_0x4d6507[_0xffa2('0x6')]},'json':!![]};return rp(_0x54d423)['then'](function(_0x4c6406){var _0x34cf1b={'method':_0xffa2('0x2'),'uri':url[_0xffa2('0x3')](_0x4d6507[_0xffa2('0x8')],_0xffa2('0x9')),'body':{'type':_0x4d6507[_0xffa2('0xa')]||_0xffa2('0xb'),'channelId':'Nda','conversation':{'id':_0x34de1d[_0xffa2('0xc')]},'from':{'id':_0x34de1d['callerid'],'name':_0x34de1d['calleridname']},'recipient':{'id':_0x34de1d[_0xffa2('0xd')],'name':_0x34de1d[_0xffa2('0xe')]},'text':_0x4d6507[_0xffa2('0xf')],'channelData':{}},'headers':{'Authorization':_0xffa2('0x10')+_0x4c6406[_0xffa2('0x11')]},'json':!![]};if(_0x4d6507['project']){_0x34cf1b[_0xffa2('0x12')][_0xffa2('0x13')][_0xffa2('0x14')]=_0x4d6507[_0xffa2('0x15')];}if(_0x4d6507['ndagenerate_audio']=='1'){_0x34cf1b['body'][_0xffa2('0x13')][_0xffa2('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xffa2('0x17')};}if(_0x4d6507['custom_action']){_0x34cf1b[_0xffa2('0x12')][_0xffa2('0x13')][_0xffa2('0x18')]=_0x4d6507[_0xffa2('0x19')];if(_0x4d6507[_0xffa2('0x1a')]){_0x34cf1b[_0xffa2('0x12')][_0xffa2('0x13')]['CustomActionData']=_0x4d6507[_0xffa2('0x1a')];}}logger[_0xffa2('0x1b')](JSON[_0xffa2('0x1c')](_0x34cf1b));return rp(_0x34cf1b);});}; \ No newline at end of file +var _0xffe1=['resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','custom_action','CustomActionData','custom_action_data','request-promise','url','exports','POST'];(function(_0x594ac2,_0xaa7274){var _0x4fb04c=function(_0x5f03aa){while(--_0x5f03aa){_0x594ac2['push'](_0x594ac2['shift']());}};_0x4fb04c(++_0xaa7274);}(_0xffe1,0x175));var _0x1ffe=function(_0x5b7827,_0x3b0cb1){_0x5b7827=_0x5b7827-0x0;var _0x1a0847=_0xffe1[_0x5b7827];return _0x1a0847;};'use strict';var rp=require(_0x1ffe('0x0'));var url=require(_0x1ffe('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x1ffe('0x2')]=function(_0x100207,_0x38121){var _0x4d13c2={'method':_0x1ffe('0x3'),'uri':url[_0x1ffe('0x4')](_0x38121[_0x1ffe('0x5')],'/token'),'form':{'grant_type':_0x1ffe('0x6'),'username':_0x38121[_0x1ffe('0x7')],'password':_0x38121[_0x1ffe('0x6')]},'json':!![]};return rp(_0x4d13c2)[_0x1ffe('0x8')](function(_0xb34112){var _0x8eee2b={'method':'POST','uri':url['resolve'](_0x38121[_0x1ffe('0x9')],_0x1ffe('0xa')),'body':{'type':_0x38121[_0x1ffe('0xb')]||_0x1ffe('0xc'),'channelId':'Nda','conversation':{'id':_0x100207[_0x1ffe('0xd')]},'from':{'id':_0x100207[_0x1ffe('0xe')],'name':_0x100207[_0x1ffe('0xf')]},'recipient':{'id':_0x100207[_0x1ffe('0x10')],'name':_0x100207[_0x1ffe('0x11')]},'text':_0x38121[_0x1ffe('0x12')],'channelData':{}},'headers':{'Authorization':_0x1ffe('0x13')+_0xb34112[_0x1ffe('0x14')]},'json':!![]};if(_0x38121['project']){_0x8eee2b[_0x1ffe('0x15')][_0x1ffe('0x16')]['ProjectName']=_0x38121[_0x1ffe('0x17')];}if(_0x38121[_0x1ffe('0x18')]=='1'){_0x8eee2b[_0x1ffe('0x15')][_0x1ffe('0x16')][_0x1ffe('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x38121[_0x1ffe('0x1a')]){_0x8eee2b[_0x1ffe('0x15')][_0x1ffe('0x16')]['CustomAction']=_0x38121[_0x1ffe('0x1a')];if(_0x38121['custom_action_data']){_0x8eee2b[_0x1ffe('0x15')]['channelData'][_0x1ffe('0x1b')]=_0x38121[_0x1ffe('0x1c')];}}logger['info'](JSON['stringify'](_0x8eee2b));return rp(_0x8eee2b);});}; \ 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 1ee0340..0f6081c 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 _0x8a62=['exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8a62,0x1ad));var _0x28a6=function(_0x24db73,_0x56d9b4){_0x24db73=_0x24db73-0x0;var _0x45d8d9=_0x8a62[_0x24db73];return _0x45d8d9;};'use strict';var asr=require('./lib/api');module[_0x28a6('0x0')]=function(_0x2ced9f,_0x311584,_0x578178,_0x382c42){return asr(_0x2ced9f,_0x311584,_0x578178,_0x382c42);}; \ No newline at end of file +var _0xaffb=['exports'];(function(_0x2f626e,_0x4e8b7d){var _0x3c4bac=function(_0x36b18d){while(--_0x36b18d){_0x2f626e['push'](_0x2f626e['shift']());}};_0x3c4bac(++_0x4e8b7d);}(_0xaffb,0x149));var _0xbaff=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0xaffb[_0x30c2ae];return _0x1ee1cc;};'use strict';var asr=require('./lib/api');module[_0xbaff('0x0')]=function(_0x3aaac9,_0x2e24b0,_0x5259da,_0x483ce7){return asr(_0x3aaac9,_0x2e24b0,_0x5259da,_0x483ce7);}; \ 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 9c8bc6b..53124a6 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 _0x2e13=['Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','close','EOS','error','stringify','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','terminate','Close\x20Tilde\x20ASR\x20socket'];(function(_0x2a76b9,_0x4a477c){var _0x174116=function(_0x1196dc){while(--_0x1196dc){_0x2a76b9['push'](_0x2a76b9['shift']());}};_0x174116(++_0x4a477c);}(_0x2e13,0x75));var _0x32e1=function(_0x7f133c,_0x283c22){_0x7f133c=_0x7f133c-0x0;var _0x4ee1a5=_0x2e13[_0x7f133c];return _0x4ee1a5;};'use strict';var BPromise=require(_0x32e1('0x0'));var _=require(_0x32e1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x32e1('0x2'));var crypto=require(_0x32e1('0x3'));var logger=require(_0x32e1('0x4'))(_0x32e1('0x5'));module[_0x32e1('0x6')]=function(_0x4ca9d9,_0x5be3e3,_0x3ecfaf,_0x212cd3){return new BPromise(function(_0x5493e1,_0x1f2144){logger[_0x32e1('0x7')](_0x32e1('0x8'),_0x212cd3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5651e3=new WebSocket(_0x212cd3||_0x32e1('0x9'),{'perMessageDeflate':![]});var _0x3772c7='';var _0x23a130='0';var _0x47f8ef='1';var _0x4d3928='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x3ae468(_0x26fa84){var _0x5df56e=crypto[_0x32e1('0xa')](_0x32e1('0xb'));_0x5df56e[_0x32e1('0xc')](_0x26fa84);return _0x5df56e[_0x32e1('0xd')](_0x32e1('0xe'));}function _0xe4289c(){try{logger[_0x32e1('0x7')](_0x32e1('0xf'));var _0x115389=moment()['unix']();var _0x35f88f=_0x3ae468(_0x115389+_0x5be3e3+_0x3ecfaf);_0x5651e3[_0x32e1('0x10')](JSON['stringify']({'appID':_0x5be3e3,'timestamp':_0x115389,'appKey':_0x35f88f}));var _0x1724d9=fs[_0x32e1('0x11')](_0x4ca9d9);_0x1724d9['on']('data',function(_0xd4bd01){_0x5651e3[_0x32e1('0x10')](_0xd4bd01);});_0x1724d9['on'](_0x32e1('0x12'),function(){_0x5651e3[_0x32e1('0x10')](_0x32e1('0x13'));});}catch(_0x4b3d41){logger[_0x32e1('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x32e1('0x15')](_0x4b3d41));_0x5651e3['terminate']();}}function _0x299a4d(_0x978d44){try{if(_0x978d44){var _0x2fbd9d=JSON[_0x32e1('0x16')](_0x978d44);switch(_0x2fbd9d[_0x32e1('0x17')]){case 0x0:if(_0x2fbd9d[_0x32e1('0x18')]){if(_0x2fbd9d['result'][_0x32e1('0x19')]){logger[_0x32e1('0x7')](_0x32e1('0x1a'),JSON[_0x32e1('0x15')](_0x2fbd9d[_0x32e1('0x18')][_0x32e1('0x1b')]));_0x3772c7=_0x2fbd9d['result'][_0x32e1('0x1b')][0x0]['transcript'];_0x23a130=_0x2fbd9d[_0x32e1('0x18')][_0x32e1('0x1b')][0x0][_0x32e1('0x1c')];_0x47f8ef='0';_0x4d3928=_0x32e1('0x1d');_0x5651e3['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x47f8ef='1';_0x4d3928='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x32e1('0x7')](_0x32e1('0x1e'));_0x47f8ef='2';_0x4d3928=_0x32e1('0x1e');break;case 0x9:logger['info'](_0x32e1('0x1f'));_0x47f8ef='9';_0x4d3928='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x32e1('0x7')]('Authentication\x20failed.');_0x47f8ef='10';_0x4d3928='Authentication\x20failed.';break;case 0xb:logger['info'](_0x32e1('0x20'));_0x47f8ef='11';_0x4d3928=_0x32e1('0x20');}}}catch(_0x550619){logger[_0x32e1('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x550619));_0x5651e3[_0x32e1('0x21')]();}}function _0xc3a429(){logger[_0x32e1('0x7')](_0x32e1('0x22'));_0x5493e1({'transcript':_0x3772c7,'confidence':_0x23a130,'status':_0x47f8ef,'status_message':_0x4d3928});}function _0x4e0d1f(_0x27e35e){logger[_0x32e1('0x14')](_0x32e1('0x23'));if(!_['isNil'](_0x27e35e)){logger[_0x32e1('0x14')](_[_0x32e1('0x24')](_0x27e35e)?JSON['stringify'](_0x27e35e):_0x27e35e);}}_0x5651e3['on']('open',_0xe4289c);_0x5651e3['on'](_0x32e1('0x25'),_0x299a4d);_0x5651e3['on'](_0x32e1('0x12'),_0xc3a429);_0x5651e3['on'](_0x32e1('0x14'),_0x4e0d1f);});}; \ No newline at end of file +var _0xe093=['hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','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.','Tilde\x20ASR\x20parse\x20error','isNil','open','message','bluebird','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','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','createHash','update'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0xe093,0x126));var _0x3e09=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xe093[_0x1f9f37];return _0x21c080;};'use strict';var BPromise=require(_0x3e09('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x3e09('0x1'));var logger=require(_0x3e09('0x2'))('agi');module[_0x3e09('0x3')]=function(_0x586c24,_0x1290e6,_0x3883c0,_0x4fbba9){return new BPromise(function(_0x12c913,_0x169120){logger[_0x3e09('0x4')](_0x3e09('0x5'),_0x4fbba9||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x21427b=new WebSocket(_0x4fbba9||_0x3e09('0x6'),{'perMessageDeflate':![]});var _0x383a01='';var _0x5542e5='0';var _0x2d0748='1';var _0x33a2f0=_0x3e09('0x7');function _0x501b58(_0x2798de){var _0x401f37=crypto[_0x3e09('0x8')]('sha1');_0x401f37[_0x3e09('0x9')](_0x2798de);return _0x401f37['digest'](_0x3e09('0xa'));}function _0x4641fd(){try{logger['info'](_0x3e09('0xb'));var _0x1db7bb=moment()[_0x3e09('0xc')]();var _0x310270=_0x501b58(_0x1db7bb+_0x1290e6+_0x3883c0);_0x21427b[_0x3e09('0xd')](JSON[_0x3e09('0xe')]({'appID':_0x1290e6,'timestamp':_0x1db7bb,'appKey':_0x310270}));var _0x5b626c=fs[_0x3e09('0xf')](_0x586c24);_0x5b626c['on'](_0x3e09('0x10'),function(_0x4e9a7e){_0x21427b[_0x3e09('0xd')](_0x4e9a7e);});_0x5b626c['on'](_0x3e09('0x11'),function(){_0x21427b[_0x3e09('0xd')]('EOS');});}catch(_0x18912c){logger[_0x3e09('0x12')](_0x3e09('0x13'),JSON[_0x3e09('0xe')](_0x18912c));_0x21427b[_0x3e09('0x14')]();}}function _0x5949f3(_0x3a4b34){try{if(_0x3a4b34){var _0x3f668b=JSON[_0x3e09('0x15')](_0x3a4b34);switch(_0x3f668b[_0x3e09('0x16')]){case 0x0:if(_0x3f668b['result']){if(_0x3f668b[_0x3e09('0x17')][_0x3e09('0x18')]){logger['info'](_0x3e09('0x19'),JSON[_0x3e09('0xe')](_0x3f668b[_0x3e09('0x17')][_0x3e09('0x1a')]));_0x383a01=_0x3f668b['result'][_0x3e09('0x1a')][0x0][_0x3e09('0x1b')];_0x5542e5=_0x3f668b[_0x3e09('0x17')]['hypotheses'][0x0][_0x3e09('0x1c')];_0x2d0748='0';_0x33a2f0=_0x3e09('0x1d');_0x21427b[_0x3e09('0x14')]();}}break;case 0x1:logger[_0x3e09('0x4')](_0x3e09('0x7'));_0x2d0748='1';_0x33a2f0=_0x3e09('0x7');break;case 0x2:logger[_0x3e09('0x4')](_0x3e09('0x1e'));_0x2d0748='2';_0x33a2f0=_0x3e09('0x1e');break;case 0x9:logger[_0x3e09('0x4')](_0x3e09('0x1f'));_0x2d0748='9';_0x33a2f0='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x3e09('0x4')](_0x3e09('0x20'));_0x2d0748='10';_0x33a2f0=_0x3e09('0x20');break;case 0xb:logger[_0x3e09('0x4')](_0x3e09('0x21'));_0x2d0748='11';_0x33a2f0=_0x3e09('0x21');}}}catch(_0x565aa2){logger[_0x3e09('0x12')](_0x3e09('0x22'),JSON['stringify'](_0x565aa2));_0x21427b[_0x3e09('0x14')]();}}function _0x3378f7(){logger[_0x3e09('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x12c913({'transcript':_0x383a01,'confidence':_0x5542e5,'status':_0x2d0748,'status_message':_0x33a2f0});}function _0x909156(_0x1791c3){logger[_0x3e09('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3e09('0x23')](_0x1791c3)){logger[_0x3e09('0x12')](_['isObject'](_0x1791c3)?JSON['stringify'](_0x1791c3):_0x1791c3);}}_0x21427b['on'](_0x3e09('0x24'),_0x4641fd);_0x21427b['on'](_0x3e09('0x25'),_0x5949f3);_0x21427b['on'](_0x3e09('0x11'),_0x3378f7);_0x21427b['on'](_0x3e09('0x12'),_0x909156);});}; \ 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 73c2c04..3e7c531 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 _0x57e8=['exports'];(function(_0x2281b1,_0x3aea0e){var _0xaee476=function(_0x630b97){while(--_0x630b97){_0x2281b1['push'](_0x2281b1['shift']());}};_0xaee476(++_0x3aea0e);}(_0x57e8,0xd9));var _0x857e=function(_0xaa52fd,_0x36de10){_0xaa52fd=_0xaa52fd-0x0;var _0x11623e=_0x57e8[_0xaa52fd];return _0x11623e;};var asr=require('./asr');module[_0x857e('0x0')]={'asr':asr}; \ No newline at end of file +var _0x8184=['./asr','exports'];(function(_0xf3bfe5,_0x2f6600){var _0x130463=function(_0x17af24){while(--_0x17af24){_0xf3bfe5['push'](_0xf3bfe5['shift']());}};_0x130463(++_0x2f6600);}(_0x8184,0x108));var _0x4818=function(_0x4b13f0,_0x1273df){_0x4b13f0=_0x4b13f0-0x0;var _0x2a1955=_0x8184[_0x4b13f0];return _0x2a1955;};var asr=require(_0x4818('0x0'));module[_0x4818('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 288c150..d4be45a 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 _0x4f79=['stringify','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','call','listen','listening','emit','connection','data','projectUpdate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f79,0x1ce));var _0x94f7=function(_0x13c1ca,_0x4abe2b){_0x13c1ca=_0x13c1ca-0x0;var _0x373ba8=_0x4f79[_0x13c1ca];return _0x373ba8;};'use strict';var util=require(_0x94f7('0x0'));var net=require(_0x94f7('0x1'));var EventEmitter=require('events')[_0x94f7('0x2')];var AGIError=require(_0x94f7('0x3'));var AGIChannel=require(_0x94f7('0x4'));var AGIServer=function(_0x388623,_0x52bf33,_0x147057){var _0x41f032=this;var _0x21b6a5=null;var _0x5a9cae=0x0;if(!_0x388623)_0x388623=0x11dd;if(!_0x52bf33)_0x52bf33=_0x94f7('0x5');EventEmitter[_0x94f7('0x6')](_0x41f032);function _0x5a0ef5(){if(!_0x388623){_0x41f032['emit']('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x21b6a5=net['createServer']();_0x21b6a5[_0x94f7('0x7')](_0x388623,_0x52bf33);_0x21b6a5['on'](_0x94f7('0x8'),function(){_0x41f032[_0x94f7('0x9')](_0x94f7('0x8'));});_0x21b6a5['on'](_0x94f7('0xa'),function(_0x2b96d6){_0x2b96d6['on'](_0x94f7('0xb'),function(_0x4cdf8c){_0x41f032[_0x94f7('0x9')](_0x94f7('0xc'),JSON[_0x94f7('0xd')](_0x4cdf8c));});_0x21b6a5[_0x94f7('0xe')](function(_0x4a287e,_0x5e1b67){if(_0x4a287e){_0x41f032[_0x94f7('0x9')](_0x94f7('0xf'),new AGIError(_0x94f7('0x10'),_0x4a287e));}else if(_0x147057&&_0x147057<0x0){_0x41f032[_0x94f7('0x9')](_0x94f7('0xf'),new AGIError(_0x94f7('0x11')));_0x2b96d6['destroy']();}else if(_0x147057&&_0x147057>0x0&&_0x147057<_0x5e1b67){_0x5a9cae+=0x1;_0x41f032[_0x94f7('0x9')](_0x94f7('0xf'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x5a9cae));_0x2b96d6[_0x94f7('0x12')]();}else{var _0x45ac1d=new AGIChannel(_0x2b96d6);_0x45ac1d['on']('ready',function(){_0x41f032['emit'](_0x94f7('0xa'),_0x45ac1d);});}});});_0x21b6a5['on'](_0x94f7('0xf'),function(_0xe4604b){_0x41f032[_0x94f7('0x9')](_0x94f7('0xf'),new AGIError(_0x94f7('0x10'),_0xe4604b[_0x94f7('0x13')]));});_0x21b6a5['on'](_0x94f7('0x14'),function(){_0x41f032[_0x94f7('0x9')]('close',new AGIError(_0x94f7('0x15')));});}process[_0x94f7('0x16')](function(){_0x5a0ef5();});};util[_0x94f7('0x17')](AGIServer,EventEmitter);module[_0x94f7('0x18')]=function(_0x561a1e,_0x46bf52,_0x1aa64f){return new AGIServer(_0x561a1e,_0x46bf52,_0x1aa64f);}; \ No newline at end of file +var _0xb3ed=['./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','projectUpdate','stringify','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','events','EventEmitter','./error'];(function(_0x280919,_0xd6a4fb){var _0x37884f=function(_0x2298e7){while(--_0x2298e7){_0x280919['push'](_0x280919['shift']());}};_0x37884f(++_0xd6a4fb);}(_0xb3ed,0x173));var _0xdb3e=function(_0x5e4d76,_0x5aced6){_0x5e4d76=_0x5e4d76-0x0;var _0x402f5d=_0xb3ed[_0x5e4d76];return _0x402f5d;};'use strict';var util=require('util');var net=require(_0xdb3e('0x0'));var EventEmitter=require(_0xdb3e('0x1'))[_0xdb3e('0x2')];var AGIError=require(_0xdb3e('0x3'));var AGIChannel=require(_0xdb3e('0x4'));var AGIServer=function(_0x529de7,_0x4a42ee,_0x4494f9){var _0xc8422e=this;var _0x38d8ce=null;var _0x31fba1=0x0;if(!_0x529de7)_0x529de7=0x11dd;if(!_0x4a42ee)_0x4a42ee=_0xdb3e('0x5');EventEmitter[_0xdb3e('0x6')](_0xc8422e);function _0x42874c(){if(!_0x529de7){_0xc8422e['emit'](_0xdb3e('0x7'),new AGIError(_0xdb3e('0x8')));return![];}_0x38d8ce=net[_0xdb3e('0x9')]();_0x38d8ce[_0xdb3e('0xa')](_0x529de7,_0x4a42ee);_0x38d8ce['on'](_0xdb3e('0xb'),function(){_0xc8422e['emit'](_0xdb3e('0xb'));});_0x38d8ce['on']('connection',function(_0x460847){_0x460847['on']('data',function(_0xf7493b){_0xc8422e[_0xdb3e('0xc')](_0xdb3e('0xd'),JSON[_0xdb3e('0xe')](_0xf7493b));});_0x38d8ce['getConnections'](function(_0x367c8c,_0x148d9d){if(_0x367c8c){_0xc8422e['emit']('error',new AGIError(_0xdb3e('0xf'),_0x367c8c));}else if(_0x4494f9&&_0x4494f9<0x0){_0xc8422e[_0xdb3e('0xc')]('error',new AGIError(_0xdb3e('0x10')));_0x460847[_0xdb3e('0x11')]();}else if(_0x4494f9&&_0x4494f9>0x0&&_0x4494f9<_0x148d9d){_0x31fba1+=0x1;_0xc8422e[_0xdb3e('0xc')](_0xdb3e('0x7'),new AGIError(_0xdb3e('0x12'),_0x31fba1));_0x460847[_0xdb3e('0x11')]();}else{var _0x353334=new AGIChannel(_0x460847);_0x353334['on']('ready',function(){_0xc8422e[_0xdb3e('0xc')](_0xdb3e('0x13'),_0x353334);});}});});_0x38d8ce['on']('error',function(_0x5796e4){_0xc8422e['emit'](_0xdb3e('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5796e4[_0xdb3e('0x14')]));});_0x38d8ce['on'](_0xdb3e('0x15'),function(){_0xc8422e[_0xdb3e('0xc')](_0xdb3e('0x15'),new AGIError(_0xdb3e('0x16')));});}process[_0xdb3e('0x17')](function(){_0x42874c();});};util[_0xdb3e('0x18')](AGIServer,EventEmitter);module['exports']=function(_0x11f503,_0x39105d,_0x3cb6e5){return new AGIServer(_0x11f503,_0x39105d,_0x3cb6e5);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 05f7f58..305d553 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 _0x7218=['callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','length','replaceAllVariables','saveRestApiResult','%s.%s','isArray','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','isConfigured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','add','minutes','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20query\x20configured','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','\x22%s\x22\x20<%s>','email','Smtp','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','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','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','vswitch','replaceAll','join','exports','util','shelljs','odbc','randomstring','moment','mustache','agi','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','then','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','name','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1'];(function(_0x4cc7c9,_0xafa40a){var _0x35ea4a=function(_0x96286e){while(--_0x96286e){_0x4cc7c9['push'](_0x4cc7c9['shift']());}};_0x35ea4a(++_0xafa40a);}(_0x7218,0x196));var _0x8721=function(_0x496d64,_0x3ff163){_0x496d64=_0x496d64-0x0;var _0x449648=_0x7218[_0x496d64];return _0x449648;};'use strict';var fs=require('fs');var util=require(_0x8721('0x0'));var _=require('lodash');var sh=require(_0x8721('0x1'));var odbc=require(_0x8721('0x2'))();var rs=require(_0x8721('0x3'));var moment=require(_0x8721('0x4'));var Mustache=require(_0x8721('0x5'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x8721('0x6'));var config=require('../../config/environment');var shared=require(_0x8721('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x8721('0x8');var recursiveMapAttributes=[_0x8721('0x9'),_0x8721('0xa')];var verticesWithRetry=[_0x8721('0xb'),_0x8721('0xc'),'getsecretdigits'];var AGIVertices=function(_0x2c4e47,_0x5ebe73,_0x50e3b2){this[_0x8721('0xd')]=_0x2c4e47;this[_0x8721('0xe')]=_0x5ebe73;this[_0x8721('0xf')]=_0x50e3b2;};AGIVertices[_0x8721('0x10')][_0x8721('0x11')]=function(_0x459eae,_0x11187f){this[_0x8721('0xe')]['getVariableById'](_0x459eae)[_0x8721('0x12')](function(_0x4752a7){_0x11187f(null,_0x4752a7?_0x4752a7['name']:![]);})[_0x8721('0x13')](function(_0x6a2b5b){_0x11187f(_0x6a2b5b);});};AGIVertices[_0x8721('0x10')]['getVoiceQueue']=function(_0xb2c33d,_0xa37c45){this['rpc'][_0x8721('0x14')](_0xb2c33d)[_0x8721('0x12')](function(_0x57b28b){_0xa37c45(null,_0x57b28b?_0x57b28b['name']:![]);})[_0x8721('0x13')](function(_0x52b44a){_0xa37c45(_0x52b44a);});};AGIVertices[_0x8721('0x10')][_0x8721('0x15')]=function(_0x50904a,_0x4de134){this[_0x8721('0xe')]['getSquareProjectById'](_0x50904a)[_0x8721('0x12')](function(_0x9754bb){_0x4de134(null,_0x9754bb?_0x9754bb['name']:![]);})[_0x8721('0x13')](function(_0x31ae2d){_0x4de134(_0x31ae2d);});};AGIVertices[_0x8721('0x10')][_0x8721('0x16')]=function(_0x20439d,_0x4f0dd2){this[_0x8721('0xe')][_0x8721('0x17')](_0x20439d)[_0x8721('0x12')](function(_0x34e4f1){_0x4f0dd2(null,_0x34e4f1?_0x34e4f1['dsn']:![]);})[_0x8721('0x13')](function(_0x99b9ea){_0x4f0dd2(_0x99b9ea);});};AGIVertices[_0x8721('0x10')][_0x8721('0x18')]=function(_0x3ad7e2,_0xb85d02){this[_0x8721('0xe')]['getUserById'](_0x3ad7e2)[_0x8721('0x12')](function(_0x196588){_0xb85d02(null,_0x196588?_0x196588[_0x8721('0x19')]:![]);})[_0x8721('0x13')](function(_0x9ceac7){_0xb85d02(_0x9ceac7);});};AGIVertices[_0x8721('0x10')][_0x8721('0x1a')]=function(_0x34b402,_0x4e381d){this[_0x8721('0xe')][_0x8721('0x1b')](_0x34b402)[_0x8721('0x12')](function(_0x154342){_0x4e381d(null,_0x154342?_0x154342['name']:![]);})[_0x8721('0x13')](function(_0x5c2388){_0x4e381d(_0x5c2388);});};AGIVertices[_0x8721('0x10')]['getSound']=function(_0x1c46a9,_0x1e90d7){var _0x70cf9b=this;this[_0x8721('0xe')][_0x8721('0x1c')](_0x1c46a9)[_0x8721('0x12')](function(_0x10d10f){_0x1e90d7(null,_0x10d10f?_0x70cf9b[_0x8721('0x1d')](_0x10d10f[_0x8721('0x1e')]):![]);})['catch'](function(_0xedbaaa){_0x1e90d7(_0xedbaaa);});};AGIVertices[_0x8721('0x10')][_0x8721('0x1f')]=function(_0x355766,_0x1c586c){this[_0x8721('0xe')][_0x8721('0x20')](_0x355766)[_0x8721('0x12')](function(_0x381d34){_0x1c586c(null,_0x381d34?_0x381d34:![]);})[_0x8721('0x13')](function(_0x16bb2d){_0x1c586c(_0x16bb2d);});};AGIVertices['prototype'][_0x8721('0x21')]=function(_0x5585cf,_0x3ab053,_0x3bd6b9){this['mailRpc'][_0x8721('0x21')](_0x5585cf,_0x3ab053)['then'](function(){_0x3bd6b9(null);})[_0x8721('0x13')](function(_0x3c9f8d){_0x3bd6b9(_0x3c9f8d);});};AGIVertices[_0x8721('0x10')][_0x8721('0x22')]=function(_0x308417,_0x22a752){this[_0x8721('0xe')]['getIntervalById'](_0x308417)[_0x8721('0x12')](function(_0x1e5bf8){if(_0x1e5bf8){if(_0x1e5bf8[_0x8721('0x23')]){_0x22a752(null,[_0x1e5bf8['interval']]);}else{_0x22a752(null,_['map'](_0x1e5bf8['Intervals'],_0x8721('0x24')));}}else{_0x22a752(null,![]);}})[_0x8721('0x13')](function(_0x49115c){_0x22a752(_0x49115c);});};AGIVertices[_0x8721('0x10')]['getSoundPath']=function(_0x336f3e){return util[_0x8721('0x25')](_0x8721('0x26'),FILES_PATH,_0x336f3e);};AGIVertices[_0x8721('0x10')][_0x8721('0x27')]=function(_0x15aabc,_0x190676,_0x526a2d){odbc[_0x8721('0x28')](_0x15aabc,function(_0x4ea8ca){if(_0x4ea8ca){logger[_0x8721('0x29')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x4ea8ca);_0x526a2d(_0x4ea8ca);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x190676,function(_0x1d2cbe,_0x33353c){if(_0x1d2cbe){logger['info']('Error\x20executing\x20query\x20%s',_0x190676);_0x526a2d(_0x1d2cbe);}else{logger[_0x8721('0x2a')](_0x8721('0x2b'),_0x190676);odbc[_0x8721('0x2c')](function(_0x253f65){if(_0x253f65){logger[_0x8721('0x29')](_0x8721('0x2d'),_0x253f65);}_0x526a2d(null,_0x33353c);});}});}});};AGIVertices[_0x8721('0x10')][_0x8721('0x2e')]=function(_0x5bb9af,_0x2b7e17){this[_0x8721('0xe')][_0x8721('0x2f')](_0x5bb9af)[_0x8721('0x12')](function(_0x45e1fc){_0x2b7e17(null,_0x45e1fc?_0x45e1fc:![]);})[_0x8721('0x13')](function(_0x361830){_0x2b7e17(_0x361830);});};AGIVertices[_0x8721('0x10')][_0x8721('0x30')]=function(_0x358a50,_0x26ada6){this[_0x8721('0xe')][_0x8721('0x30')](_0x358a50)[_0x8721('0x12')](function(_0x269086){_0x26ada6(null,_0x269086);})['catch'](function(_0x2cfa0e){_0x26ada6(_0x2cfa0e);});};AGIVertices['prototype'][_0x8721('0x31')]=function(_0x324ef7,_0x142b6a,_0x4acf22){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x8721('0xd')][_0x8721('0x32')],'node':_0x324ef7['label'],'application':_0x324ef7['agicommand'],'data':_0x142b6a||null,'project_name':this[_0x8721('0xd')][_0x8721('0x33')],'callerid':this[_0x8721('0xd')][_0x8721('0x34')]})[_0x8721('0x12')](function(_0x50446e){if(_0x4acf22){_0x4acf22(null,_0x50446e);}})[_0x8721('0x13')](function(_0x966538){if(_0x4acf22){_0x4acf22(_0x966538);}});};AGIVertices['prototype'][_0x8721('0x35')]=function(_0x371f43,_0x5de332,_0x44e89d,_0x371bc1){this[_0x8721('0xe')][_0x8721('0x35')]({'uniqueid':this[_0x8721('0xd')][_0x8721('0x32')],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0x8721('0x36')],'context':this['channel'][_0x8721('0x37')],'extension':this['channel']['extension'],'priority':this['channel'][_0x8721('0x38')],'accountcode':this[_0x8721('0xd')][_0x8721('0x39')],'dnid':this[_0x8721('0xd')][_0x8721('0x3a')],'projectName':this[_0x8721('0xd')][_0x8721('0x33')],'saveName':_0x5de332,'filename':_0x371f43[_0x8721('0x3b')]||_0x5de332,'savePath':_0x44e89d})[_0x8721('0x12')](function(_0x4d3d76){_0x371bc1(null,_0x4d3d76);})['catch'](function(_0x26e60e){_0x371bc1(_0x26e60e);});};AGIVertices[_0x8721('0x10')][_0x8721('0x3c')]=function(_0x28de4d,_0x4aa5dc,_0x5625c5,_0x182747,_0x2a0c31){this[_0x8721('0xe')][_0x8721('0x3c')]({'uniqueid':this[_0x8721('0xd')][_0x8721('0x32')],'body':_0x28de4d,'direction':_0x4aa5dc,'providerName':_0x5625c5,'providerResponse':_0x182747})[_0x8721('0x12')](function(_0x1aba9d){if(_0x2a0c31){_0x2a0c31(null,_0x1aba9d);}})[_0x8721('0x13')](function(_0x3b59c1){if(_0x2a0c31){_0x2a0c31(_0x3b59c1);}});};AGIVertices['prototype'][_0x8721('0x3d')]=function(_0x580376,_0x432a47){this[_0x8721('0xe')][_0x8721('0x3d')]({'firstName':_[_0x8721('0x3e')](_0x580376['name'])||_[_0x8721('0x3f')](_0x580376[_0x8721('0x19')])?_0x8721('0x40')+Math[_0x8721('0x41')]():_0x580376[_0x8721('0x19')],'lastName':_['isEmpty'](_0x580376[_0x8721('0x42')])||_[_0x8721('0x3f')](_0x580376[_0x8721('0x42')])?null:_0x580376['lastName'],'phone':_0x580376[_0x8721('0x43')],'ListId':_0x580376[_0x8721('0x44')],'scheduledat':_0x580376['scheduledAt'],'callbackUniqueid':this[_0x8721('0xd')][_0x8721('0x32')],'tags':'callback','description':_0x8721('0x45')+_0x580376['scheduledAt'][_0x8721('0x46')](),'priority':_0x580376[_0x8721('0x47')]})[_0x8721('0x12')](function(_0x3237e7){_0x432a47(null,_0x3237e7);})['catch'](function(_0x575eec){_0x432a47(_0x575eec);});};AGIVertices['prototype'][_0x8721('0x48')]=function(_0x28a6f9,_0x24a128){this[_0x8721('0xe')][_0x8721('0x49')](_0x28a6f9)[_0x8721('0x12')](function(_0x289ead){_0x24a128(null,_0x289ead?_0x289ead[_0x8721('0x19')]:![]);})['catch'](function(_0x99dd7b){_0x24a128(_0x99dd7b);});};AGIVertices['prototype'][_0x8721('0x4a')]=function(_0x35238d,_0x4083fe,_0x4ed85c){var _0x531127={'role':_0x8721('0x4b')};_0x531127[_0x35238d]=this[_0x8721('0xd')]['callerid'];this['rpc'][_0x8721('0x4a')](_0x531127,_0x4083fe,this['channel']['uniqueid'])[_0x8721('0x12')](function(_0x4e8d45){_0x4ed85c(null,_[_0x8721('0x3f')](_0x4e8d45)?![]:!![]);})[_0x8721('0x13')](function(_0x8eb001){logger[_0x8721('0x29')](_0x8eb001);_0x4ed85c(null,![]);});};AGIVertices[_0x8721('0x10')][_0x8721('0x4c')]=function(_0x2e5e25,_0x4e0e15){var _0x4a2717={'role':_0x8721('0x4b')};_0x4a2717[_0x2e5e25]=this['channel']['callerid'];this[_0x8721('0xe')][_0x8721('0x4c')](_0x4a2717)[_0x8721('0x12')](function(_0xd9f331){_0x4e0e15(null,_['isNil'](_0xd9f331)?![]:!![]);})[_0x8721('0x13')](function(_0xc840e8){logger[_0x8721('0x29')](_0xc840e8);_0x4e0e15(null,![]);});};AGIVertices[_0x8721('0x10')][_0x8721('0x4d')]=function(_0x546e2d,_0x589b80){var _0x1ed414={'role':_0x8721('0x4b')};_0x1ed414[_0x546e2d]=this[_0x8721('0xd')]['callerid'];this[_0x8721('0xe')][_0x8721('0x4d')](_0x1ed414)[_0x8721('0x12')](function(_0xfbea9d){_0x589b80(null,_[_0x8721('0x3f')](_0xfbea9d)?![]:!![]);})[_0x8721('0x13')](function(_0x3fd43f){logger[_0x8721('0x29')](_0x3fd43f);_0x589b80(null,![]);});};AGIVertices[_0x8721('0x10')][_0x8721('0x4e')]=function(_0x46d6a6,_0x4be4a5){var _0x5566d0={'role':_0x8721('0x4b')};_0x5566d0[_0x46d6a6]=this[_0x8721('0xd')][_0x8721('0x34')];var _0x21422f=_0x46d6a6!=_0x8721('0x4f')?util['format'](_0x8721('0x50'),_0x8721('0x51'),this[_0x8721('0xd')][_0x8721('0x34')]):undefined;this[_0x8721('0xe')][_0x8721('0x4e')](_0x5566d0,_0x21422f)['then'](function(_0x33f502){_0x4be4a5(null,_[_0x8721('0x3f')](_0x33f502)?![]:!![]);})[_0x8721('0x13')](function(_0x9c86ed){logger[_0x8721('0x29')](_0x9c86ed);_0x4be4a5(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x66c061,_0xf6114d){sh[_0x8721('0x52')](_[_0x8721('0x53')](_0x66c061),function(_0xceb747,_0x1e76bf){var _0x1ff873=_0x1e76bf[_0x8721('0x54')](/(\r\n|\n|\r)/gm,'');_0xf6114d(null,_0x1ff873);});};AGIVertices[_0x8721('0x10')]['googleCloudTTS']=function(_0x2a8ff2,_0xc5cce3){scripts[_0x8721('0x55')](_0x2a8ff2[_0x8721('0x56')],_0x2a8ff2[_0x8721('0x57')]||'text',_0x2a8ff2[_0x8721('0x58')],_0x2a8ff2[_0x8721('0x59')]||_0x8721('0x5a'),_0x2a8ff2[_0x8721('0x5b')]||'MALE',_0x2a8ff2[_0x8721('0x5c')]||'MP3')[_0x8721('0x12')](function(_0x5a5798){_0xc5cce3(null,_0x5a5798);})['catch'](function(_0x287588){_0xc5cce3(_0x287588);});};AGIVertices['prototype'][_0x8721('0x5d')]=function(_0x5f39f1,_0x41e4cc){scripts['googleTTS'](_0x5f39f1['text'],_0x5f39f1[_0x8721('0x5e')]||'en',0x1)[_0x8721('0x12')](function(_0x3483a7){_0x41e4cc(null,_0x3483a7);})['catch'](function(_0x586741){_0x41e4cc(_0x586741);});};AGIVertices[_0x8721('0x10')]['restAPI']=function(_0x1772ad,_0x5408ea){var _0x196b6e={'uri':_0x1772ad[_0x8721('0x5f')],'method':_0x1772ad[_0x8721('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1772ad[_0x8721('0x61')])===_0x8721('0x62')&&parseInt(_0x1772ad[_0x8721('0x61')])>=0x1?parseInt(_0x1772ad[_0x8721('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x8721('0x63')]([_0x8721('0x64'),_0x8721('0x65')],_0x196b6e[_0x8721('0x60')][_0x8721('0x66')]())){try{_0x196b6e[_0x8721('0x67')]=_0x1772ad[_0x8721('0xa')]?JSON[_0x8721('0x68')](_0x1772ad[_0x8721('0xa')]):{};}catch(_0x4ded33){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4ded33);}}try{_0x196b6e[_0x8721('0x69')]=_0x1772ad[_0x8721('0x9')]?JSON['parse'](_0x1772ad[_0x8721('0x9')]):{};}catch(_0x503921){logger[_0x8721('0x29')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x503921);}if(_0x1772ad['computedVariables']){try{var _0x22fbcc=require(_0x1772ad[_0x8721('0x6a')])[_0x8721('0x6b')](this,_0x196b6e);_0x196b6e[_0x8721('0x6c')]=Mustache[_0x8721('0x6d')](_0x1772ad[_0x8721('0x5f')],_0x22fbcc,{},['$$','$$']);if(_0x196b6e[_0x8721('0x69')]){_0x196b6e[_0x8721('0x69')]=JSON[_0x8721('0x68')](Mustache[_0x8721('0x6d')](JSON[_0x8721('0x6e')](_0x196b6e[_0x8721('0x69')]),_0x22fbcc,{},['$$','$$']));}if(_0x196b6e[_0x8721('0x67')]){_0x196b6e[_0x8721('0x67')]=JSON['parse'](Mustache[_0x8721('0x6d')](JSON['stringify'](_0x196b6e['body']),_0x22fbcc,{},['$$','$$']));}}catch(_0x31e996){logger[_0x8721('0x29')](_0x8721('0x6f'),_0x31e996);}}rp(_0x196b6e)['then'](function(_0x1e25c5){var _0xab8c4={'statusCode':_0x1e25c5['statusCode']||0xc8,'statusMessage':_0x1e25c5[_0x8721('0x70')]||'OK','headers':_0x1e25c5['headers']||{},'body':_0x1e25c5['body']||{}};_0x5408ea(null,_0xab8c4);})[_0x8721('0x13')](function(_0x4bc2f7){var _0x12b5dc={'statusCode':_0x4bc2f7[_0x8721('0x71')]||0x1f4,'statusMessage':_0x4bc2f7[_0x8721('0x72')]||_0x8721('0x73'),'headers':_0x4bc2f7[_0x8721('0x74')]['headers']||{},'body':_0x4bc2f7[_0x8721('0x74')][_0x8721('0x67')]||{}};_0x5408ea(null,_0x12b5dc);});};AGIVertices[_0x8721('0x10')]['googleDialogflow']=function(_0x3330c1,_0x1fd3ed){scripts['googleDialogflow'](this[_0x8721('0xd')][_0x8721('0x32')],_0x3330c1[_0x8721('0x75')],_0x3330c1[_0x8721('0x58')],_0x3330c1[_0x8721('0x76')]||'en')['then'](function(_0x326f40){_0x1fd3ed(null,_0x326f40);})[_0x8721('0x13')](function(_0x3a3d5e){_0x1fd3ed(_0x3a3d5e);});};AGIVertices[_0x8721('0x10')][_0x8721('0x77')]=function(_0x10dcef,_0x406ae3){scripts['googleDialogflowV2'](this['channel'][_0x8721('0x32')],_0x10dcef[_0x8721('0x78')],_0x10dcef[_0x8721('0x79')],_0x10dcef[_0x8721('0x7a')],_0x10dcef[_0x8721('0x58')],_0x10dcef[_0x8721('0x7b')]||'en')[_0x8721('0x12')](function(_0x10fb60){_0x406ae3(null,_0x10fb60);})[_0x8721('0x13')](function(_0x4f4306){_0x406ae3(_0x4f4306);});};AGIVertices[_0x8721('0x10')][_0x8721('0x7c')]=function(_0x361d04,_0x1bf382){scripts[_0x8721('0x7c')](this[_0x8721('0xd')],_0x361d04)['then'](function(_0x5d02c4){_0x1bf382(null,_0x5d02c4);})[_0x8721('0x13')](function(_0x219d65){_0x1bf382(_0x219d65);});};AGIVertices[_0x8721('0x10')][_0x8721('0x7d')]=function(_0x1b4323,_0x5cd95c){scripts[_0x8721('0x7d')](_0x1b4323[_0x8721('0x75')],_0x1b4323['text'],_0x1b4323['ispeech_tts_language']||'en-US',_0x1b4323[_0x8721('0x7e')])[_0x8721('0x12')](function(_0x4c4143){_0x5cd95c(null,_0x4c4143);})[_0x8721('0x13')](function(_0x337faa){_0x5cd95c(_0x337faa);});};AGIVertices[_0x8721('0x10')][_0x8721('0x7f')]=function(_0x1180ed,_0x1208da,_0x519676){scripts[_0x8721('0x7f')](_0x1208da,_0x1180ed['key'],_0x1180ed['ispeech_asr_language']||'en-US',this['isConfigured'](_0x1180ed[_0x8721('0x80')])?_0x1180ed['model']:undefined)['then'](function(_0x56bee3){_0x519676(null,_0x56bee3);})[_0x8721('0x13')](function(_0x3dde57){_0x519676(_0x3dde57);});};AGIVertices['prototype'][_0x8721('0x81')]=function(_0x5e11fd,_0x2e1aea){scripts[_0x8721('0x81')](_0x5e11fd[_0x8721('0x82')],_0x5e11fd['aws_secret_access_key'],_0x5e11fd[_0x8721('0x83')],_0x5e11fd[_0x8721('0x84')]||'Amy',_0x5e11fd[_0x8721('0x58')],_0x5e11fd[_0x8721('0x85')]||_0x8721('0x58'))[_0x8721('0x12')](function(_0x8f512e){_0x2e1aea(null,_0x8f512e);})[_0x8721('0x13')](function(_0x4e8db8){_0x2e1aea(_0x4e8db8);});};AGIVertices[_0x8721('0x10')][_0x8721('0x86')]=function(_0xeefa23,_0x117d13){scripts[_0x8721('0x86')](this['channel']['uniqueid'],_0xeefa23['aws_access_key_id'],_0xeefa23[_0x8721('0x87')],_0xeefa23['aws_lex_region'],_0xeefa23[_0x8721('0x58')],_0xeefa23[_0x8721('0x88')])[_0x8721('0x12')](function(_0x41acf1){_0x117d13(null,_0x41acf1);})[_0x8721('0x13')](function(_0x11be59){_0x117d13(_0x11be59);});};AGIVertices['prototype'][_0x8721('0x89')]=function(_0x45778d,_0x4fd649,_0x1755e3){scripts[_0x8721('0x89')](_0x4fd649,_0x45778d['key'],_0x45778d['google_asr_language']||_0x8721('0x5a'))[_0x8721('0x12')](function(_0x5d44eb){_0x1755e3(null,_0x5d44eb);})[_0x8721('0x13')](function(_0x194971){_0x1755e3(_0x194971);});};AGIVertices[_0x8721('0x10')][_0x8721('0x8a')]=function(_0x1facf1,_0xf2140d,_0x1d3564){scripts[_0x8721('0x8a')](_0xf2140d,_0x1facf1[_0x8721('0x8b')],_0x1facf1['appsecret'],_0x1facf1[_0x8721('0x6c')])[_0x8721('0x12')](function(_0x395d0c){_0x1d3564(null,_0x395d0c);})[_0x8721('0x13')](function(_0x5c0d71){_0x1d3564(_0x5c0d71);});};AGIVertices[_0x8721('0x10')]['clear']=function(_0x3b5344){var _0xccb034=_[_0x8721('0x63')](verticesWithRetry,_0x3b5344[_0x8721('0x8c')])?_0x3b5344:_[_0x8721('0x8d')](_0x3b5344);for(var _0x51b01e in _0xccb034){if(_0xccb034[_0x8721('0x8e')](_0x51b01e)){if(_0xccb034[_0x51b01e]&&_[_0x8721('0x8f')](_0xccb034[_0x51b01e])){if(_['includes'](recursiveMapAttributes,_0x51b01e)){_0xccb034[_0x51b01e]=this[_0x8721('0x90')](_0xccb034[_0x51b01e]);}else{_0xccb034[_0x51b01e]=this['replaceAllVariables'](_0xccb034[_0x51b01e]);}}}}return _0xccb034;};AGIVertices['prototype'][_0x8721('0x91')]=function(_0x4e2fdb){for(var _0x4f5a6e in _0x4e2fdb){if(_0x4e2fdb['hasOwnProperty'](_0x4f5a6e)){if(_[_0x8721('0x92')](_0x4e2fdb[_0x4f5a6e])){this[_0x8721('0x91')](_0x4e2fdb[_0x4f5a6e]);}else if(_['isArray'](_0x4e2fdb[_0x4f5a6e])){for(var _0x458f67=0x0;_0x458f67<_0x4e2fdb[_0x4f5a6e][_0x8721('0x93')];_0x458f67++){this[_0x8721('0x91')](_0x4e2fdb[_0x4f5a6e][_0x458f67]);}}else if(_[_0x8721('0x8f')](_0x4e2fdb[_0x4f5a6e])){_0x4e2fdb[_0x4f5a6e]=this[_0x8721('0x94')](_0x4e2fdb[_0x4f5a6e]);}}}};AGIVertices[_0x8721('0x10')][_0x8721('0x95')]=function(_0x182f98,_0x2293af){for(var _0x358f59 in _0x182f98){if(_0x182f98[_0x8721('0x8e')](_0x358f59)){if(_[_0x8721('0x92')](_0x182f98[_0x358f59])){if(!_[_0x8721('0x3e')](_0x182f98[_0x358f59])){this[_0x8721('0x95')](_0x182f98[_0x358f59],util['format'](_0x8721('0x96'),_0x2293af,_0x358f59));}}else if(_[_0x8721('0x97')](_0x182f98[_0x358f59])){for(var _0x28bce9=0x0;_0x28bce9<_0x182f98[_0x358f59][_0x8721('0x93')];_0x28bce9++){this['saveRestApiResult'](_0x182f98[_0x358f59][_0x28bce9],util['format']('%s.%s',_0x2293af,_0x358f59+'['+_0x28bce9+']'));}}else{if(!_['isNil'](_0x182f98[_0x358f59])){this[_0x8721('0xd')][_0x8721('0x98')](util[_0x8721('0x25')](_0x8721('0x96'),_0x2293af,_0x358f59),_0x182f98[_0x358f59]);}}}}};AGIVertices[_0x8721('0x10')][_0x8721('0x90')]=function(_0x158558){try{var _0x947325=JSON[_0x8721('0x68')](_0x158558);this[_0x8721('0x91')](_0x947325);return JSON[_0x8721('0x6e')](_0x947325);}catch(_0x5353e7){return this[_0x8721('0x94')](_0x158558);}};AGIVertices[_0x8721('0x10')]['replaceAllVariables']=function(_0xc760ee){var _0x5dd07a=_0xc760ee[_0x8721('0x99')]('{');for(var _0x517f34=0x1;_0x517f34<_0x5dd07a[_0x8721('0x93')];_0x517f34+=0x1){var _0xb53b39=_0x5dd07a[_0x517f34][_0x8721('0x99')]('}');if(_0xb53b39['length']>0x1){_0xc760ee=_0xc760ee['replaceAll']('{'+_0xb53b39[0x0]+'}',this[_0x8721('0xd')][_0x8721('0x11')](_0xb53b39[0x0])[_0x8721('0x9a')]||_0xb53b39[0x0]);}}if(_0x5dd07a[_0x8721('0x93')]===0x1){return _0xc760ee['toString']();}return this[_0x8721('0x94')](_0xc760ee);};AGIVertices[_0x8721('0x10')][_0x8721('0x9b')]=function(_0x4ff4a6,_0x26c328){var _0x4acb15=this['channel']['getVariable'](_0x4ff4a6);if(_0x4acb15['result']===-0x1){return _0x4acb15;}logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x9c'),_0x26c328,_0x4acb15[_0x8721('0x9a')]));return this[_0x8721('0xd')]['setVariable'](_0x26c328,_0x4acb15[_0x8721('0x9a')]);};AGIVertices[_0x8721('0x10')]['isConfigured']=function(_0x5e5c61){return _0x5e5c61&&_0x5e5c61!=='0'&&_0x5e5c61!=='-1'&&_0x5e5c61!=='';};AGIVertices['prototype'][_0x8721('0x9d')]=function(_0x3b6775){this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x3b6775,'-');_0x3b6775[_0x8721('0x9e')]=_0x3b6775[_0x8721('0x9d')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8721('0x10')][_0x8721('0x9f')]=function(_0x50b035){logger['info'](util[_0x8721('0x25')](_0x8721('0xa0'),_0x50b035[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x50b035['text'])){return this[_0x8721('0xd')]['noop']('no\x20text\x20configured');}var _0x5be9b1='\x22'+_0x50b035[_0x8721('0x58')]+'\x22';if(this[_0x8721('0xa2')](_0x50b035[_0x8721('0x74')])){_0x5be9b1+=','+_0x50b035[_0x8721('0x74')];}var _0x1d721b=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0xa3'),_0x5be9b1);if(_0x1d721b[_0x8721('0xa4')]===-0x1){return _0x1d721b;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xa6'),_0x5be9b1));};AGIVertices[_0x8721('0x10')][_0x8721('0xa7')]=function(_0x5b3167){logger['info'](util[_0x8721('0x25')](_0x8721('0xa8'),_0x5b3167[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x5b3167[_0x8721('0xa9')])){return this['channel'][_0x8721('0xa5')](_0x8721('0xaa'));}var _0xddf753=_0x5b3167[_0x8721('0xa9')];if(this[_0x8721('0xa2')](_0x5b3167[_0x8721('0x74')])){_0xddf753+=','+_0x5b3167[_0x8721('0x74')];}var _0x12fd28=this[_0x8721('0xd')]['exec'](_0x8721('0xab'),_0xddf753);if(_0x12fd28[_0x8721('0xa4')]===-0x1){return _0x12fd28;}var _0x32cc73=this[_0x8721('0x9b')](_0x8721('0xac'),_0x8721('0xad'));if(_0x32cc73[_0x8721('0xa4')]===-0x1){return _0x32cc73;}var _0x40f8e4=this['getAndSetVariable'](_0x8721('0xae'),_0x8721('0xaf'));if(_0x40f8e4[_0x8721('0xa4')]===-0x1){return _0x40f8e4;}var _0x46491e=this[_0x8721('0x9b')](_0x8721('0xb0'),_0x8721('0xb1'));if(_0x46491e[_0x8721('0xa4')]===-0x1){return _0x46491e;}return this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xb2'),_0xddf753));};AGIVertices['prototype'][_0x8721('0x6')]=function(_0x53b175){logger[_0x8721('0x2a')](util['format'](_0x8721('0xb3'),_0x53b175[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0x6')]([_0x53b175[_0x8721('0xb4')],_0x53b175[_0x8721('0xb5')]]);};AGIVertices['prototype'][_0x8721('0xb6')]=function(_0x59fffb){logger['info'](util[_0x8721('0x25')](_0x8721('0xb7'),_0x59fffb[_0x8721('0xa1')]));if(this[_0x8721('0xa2')](_0x59fffb[_0x8721('0x61')])){logger[_0x8721('0x2a')](util['format'](_0x8721('0xb8'),_0x59fffb[_0x8721('0x61')]));var _0x21828b=this['channel'][_0x8721('0xb9')](_0x59fffb[_0x8721('0x61')]);if(_0x21828b[_0x8721('0xa4')]===-0x1){return _0x21828b;}}return this['channel'][_0x8721('0xb6')]();};AGIVertices[_0x8721('0x10')][_0x8721('0xba')]=function(_0x3f58cf){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0xbb'),_0x3f58cf['label']));if(!this['isConfigured'](_0x3f58cf[_0x8721('0x44')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x3f58cf,_0x8721('0xbc'));}_0x3f58cf[_0x8721('0xbd')]=moment();if(this[_0x8721('0xa2')](_0x3f58cf['delay'])){_0x3f58cf[_0x8721('0xbd')]=moment()[_0x8721('0xbe')](_0x3f58cf['delay'],_0x8721('0xbf'));}if(!this[_0x8721('0xa2')](_0x3f58cf[_0x8721('0x47')])){_0x3f58cf[_0x8721('0x47')]=0x2;}this['createCmContact']['sync'](this,_0x3f58cf);return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3f58cf['phone'],_0x3f58cf[_0x8721('0x44')],_0x3f58cf[_0x8721('0xbd')]));};AGIVertices['prototype'][_0x8721('0xc0')]=function(_0x3ad56f){logger['info'](util[_0x8721('0x25')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3ad56f[_0x8721('0xa1')]));var _0x5da1e2=this[_0x8721('0xd')][_0x8721('0x52')](_0x3ad56f['application'],_0x3ad56f['options']);if(_0x5da1e2[_0x8721('0xa4')]===-0x1){return _0x5da1e2;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xc1'),_0x3ad56f[_0x8721('0xc2')],_0x3ad56f[_0x8721('0x74')]));};AGIVertices[_0x8721('0x10')][_0x8721('0xc3')]=function(_0x17056a){logger['info'](util[_0x8721('0x25')](_0x8721('0xc4'),_0x17056a['label']));if(!this[_0x8721('0xa2')](_0x17056a[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xc5'));}var _0x3a10ad='\x22'+_0x17056a[_0x8721('0x58')]+'\x22';if(this[_0x8721('0xa2')](_0x17056a[_0x8721('0x74')])){_0x3a10ad+=','+_0x17056a[_0x8721('0x74')];}var _0x5d1d0d=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0xa3'),_0x3a10ad);if(_0x5d1d0d['result']===-0x1){return _0x5d1d0d;}return this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xa6'),_0x3a10ad));};AGIVertices[_0x8721('0x10')]['sestektts']=function(_0x3df36f){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0xc6'),_0x3df36f[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x3df36f[_0x8721('0x58')])){return this[_0x8721('0xd')]['noop'](_0x8721('0xc5'));}var _0xa30947='\x22'+_0x3df36f[_0x8721('0x58')]+'\x22';if(this[_0x8721('0xa2')](_0x3df36f['options'])){_0xa30947+=','+_0x3df36f[_0x8721('0x74')];}var _0x4a9dad=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0xa3'),_0xa30947);if(_0x4a9dad[_0x8721('0xa4')]===-0x1){return _0x4a9dad;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xa6'),_0xa30947));};AGIVertices[_0x8721('0x10')][_0x8721('0xc7')]=function(_0x184b9d){logger[_0x8721('0x2a')](util['format'](_0x8721('0xc8'),_0x184b9d[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x184b9d[_0x8721('0xa9')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xaa'));}var _0x4e2288=_0x184b9d[_0x8721('0xa9')];if(this[_0x8721('0xa2')](_0x184b9d[_0x8721('0x74')])){_0x4e2288+=','+_0x184b9d['options'];}var _0x26967d=this[_0x8721('0xd')]['exec'](_0x8721('0xab'),_0x4e2288);if(_0x26967d['result']===-0x1){return _0x26967d;}var _0x236d4d=this[_0x8721('0x9b')](_0x8721('0xac'),'LUMENVOX_ASR_CONFIDENCE');if(_0x236d4d[_0x8721('0xa4')]===-0x1){return _0x236d4d;}var _0x3b06ac=this[_0x8721('0x9b')](_0x8721('0xae'),_0x8721('0xc9'));if(_0x3b06ac['result']===-0x1){return _0x3b06ac;}var _0x30cf31=this[_0x8721('0x9b')](_0x8721('0xb0'),_0x8721('0xca'));if(_0x30cf31['result']===-0x1){return _0x30cf31;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xb2'),_0x4e2288));};AGIVertices[_0x8721('0x10')][_0x8721('0xcb')]=function(_0x5dd633){logger['info'](util[_0x8721('0x25')](_0x8721('0xcc'),_0x5dd633['label']));if(!this[_0x8721('0xa2')](_0x5dd633['grammar'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xaa'));}var _0x43e1b0=_0x5dd633[_0x8721('0xa9')];if(this['isConfigured'](_0x5dd633[_0x8721('0x74')])){_0x43e1b0+=','+_0x5dd633[_0x8721('0x74')];}var _0x2f7687=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0xab'),_0x43e1b0);if(_0x2f7687[_0x8721('0xa4')]===-0x1){return _0x2f7687;}var _0x386959=this[_0x8721('0x9b')](_0x8721('0xac'),_0x8721('0xcd'));if(_0x386959[_0x8721('0xa4')]===-0x1){return _0x386959;}var _0x43d9fc=this['getAndSetVariable'](_0x8721('0xae'),_0x8721('0xce'));if(_0x43d9fc[_0x8721('0xa4')]===-0x1){return _0x43d9fc;}var _0x2634a3=this[_0x8721('0x9b')](_0x8721('0xb0'),'SESTEK_ASR_INSTANCE');if(_0x2634a3['result']===-0x1){return _0x2634a3;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xb2'),_0x43e1b0));};AGIVertices[_0x8721('0x10')][_0x8721('0xcf')]=function(_0x1b2ccc){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0xd0'),_0x1b2ccc[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x1b2ccc['odbc_id'])){return this['channel'][_0x8721('0x29')](_0x1b2ccc,_0x8721('0xd1'));}var _0x491b77=this[_0x8721('0x16')][_0x8721('0x6b')](this,_0x1b2ccc['odbc_id']);if(!_0x491b77){return this[_0x8721('0xd')]['error'](_0x1b2ccc,'no\x20odbc\x20database\x20found');}if(!this[_0x8721('0xa2')](_0x1b2ccc['query'])){return this['channel'][_0x8721('0x29')](_0x1b2ccc,_0x8721('0xd2'));}var _0x512f3b=_0x1b2ccc[_0x8721('0xd3')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xd4'),_0x512f3b));var _0x3b4e02=this[_0x8721('0x27')][_0x8721('0x6b')](this,_0x491b77,_0x512f3b);this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x1b2ccc,_0x512f3b);if(!this['isConfigured'](_0x1b2ccc[_0x8721('0xd5')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xd6'));}var _0x1a6de4=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0x1b2ccc['variable_id']);if(!_0x1a6de4){return this[_0x8721('0xd')][_0x8721('0x29')](_0x1b2ccc,_0x8721('0xd7'));}var _0x5bb815=this;_0x3b4e02[_0x8721('0xd8')](function(_0x1cac9a,_0x218fef){Object[_0x8721('0xd9')](_0x1cac9a)[_0x8721('0xd8')](function(_0x152b6f){_0x5bb815['channel'][_0x8721('0x98')](util[_0x8721('0x25')](_0x8721('0xda'),_0x1a6de4,_0x218fef,_0x152b6f),_0x1cac9a[_0x152b6f]);});});this['channel'][_0x8721('0x98')](util[_0x8721('0x25')]('%s_ROWS_COUNT',_0x1a6de4),_0x3b4e02[_0x8721('0x93')]);return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0xdb'),_0x1a6de4));};AGIVertices[_0x8721('0x10')][_0x8721('0xdc')]=function(_0x39651b){logger['debug'](util[_0x8721('0x25')](_0x8721('0xdd'),_0x39651b['label']));if(!this[_0x8721('0xa2')](_0x39651b[_0x8721('0xde')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x39651b,_0x8721('0xdf'));}var _0x2daae0=this['getUser'][_0x8721('0x6b')](this,_0x39651b[_0x8721('0xde')]);if(!_0x2daae0){return this['channel'][_0x8721('0x29')](_0x39651b,_0x8721('0xe0'));}var _0x41a574=this[_0x8721('0xd')][_0x8721('0x52')]('DIAL',[util[_0x8721('0x25')](_0x8721('0xe1'),_0x2daae0),_0x39651b[_0x8721('0x61')],_0x39651b[_0x8721('0xe2')],_0x39651b[_0x8721('0x5f')]]);if(_0x41a574[_0x8721('0xa4')]===-0x1){return _0x41a574;}return this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0xe3'),_0x8721('0xe4')));};AGIVertices[_0x8721('0x10')][_0x8721('0xe5')]=function(_0x17789b){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0xe6'),_0x17789b[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x17789b[_0x8721('0x75')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20key\x20configured');}if(!this[_0x8721('0xa2')](_0x17789b[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xc5'));}this[_0x8721('0xd')]['bot']=!![];this[_0x8721('0x31')](_0x17789b);this[_0x8721('0x3c')](_0x17789b[_0x8721('0x58')],'in','','');this['channel']['noop'](util[_0x8721('0x25')](_0x8721('0xe7'),_0x17789b[_0x8721('0x58')]));var _0x22e42c=this[_0x8721('0xe8')][_0x8721('0x6b')](this,_0x17789b);if(_0x22e42c){for(var _0x50c831 in _0x22e42c){if(_0x22e42c['hasOwnProperty'](_0x50c831)){this[_0x8721('0xd')][_0x8721('0x98')](util[_0x8721('0x25')](_0x8721('0xe9'),_0x50c831[_0x8721('0x66')]()),_0x22e42c[_0x50c831]);}}this[_0x8721('0x3c')](_0x22e42c[_0x8721('0xea')],'out',_0x8721('0xe5'),'');return this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0xeb'),_0x22e42c[_0x8721('0xea')]));}return this[_0x8721('0xd')][_0x8721('0x29')](_0x17789b,_0x8721('0xec'));};AGIVertices['prototype']['dialogflowV2']=function(_0xc58f8e){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0xed'),_0xc58f8e[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0xc58f8e['dialogflowV2_project_id'])){return this['channel']['noop'](_0x8721('0xee'));}if(!this[_0x8721('0xa2')](_0xc58f8e[_0x8721('0x79')])){return this[_0x8721('0xd')]['noop'](_0x8721('0xef'));}if(!this['isConfigured'](_0xc58f8e['private_key'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xf0'));}if(!this[_0x8721('0xa2')](_0xc58f8e[_0x8721('0x7b')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xf1'));}if(!this[_0x8721('0xa2')](_0xc58f8e[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20text\x20configured');}this[_0x8721('0xd')]['bot']=!![];this[_0x8721('0x31')](_0xc58f8e);this[_0x8721('0x3c')](_0xc58f8e[_0x8721('0x58')],'in','','');this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')]('Trying\x20DialogflowV2:\x20%s',_0xc58f8e[_0x8721('0x58')]));var _0x11949b=this[_0x8721('0x77')][_0x8721('0x6b')](this,_0xc58f8e);if(_0x11949b){for(var _0x9f7c31 in _0x11949b){if(_0x11949b[_0x8721('0x8e')](_0x9f7c31)){if(_0x9f7c31!==_0x8721('0xf2')){this[_0x8721('0xd')]['setVariable'](util[_0x8721('0x25')](_0x8721('0xe9'),_0x9f7c31[_0x8721('0x66')]()),_0x11949b[_0x9f7c31]);}}}this[_0x8721('0x3c')](_0x11949b['speech'],'out',_0x8721('0xf3'),_0x11949b['providerResponse']);return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xf4'),_0x11949b['speech']));}return this[_0x8721('0xd')]['error'](_0xc58f8e,_0x8721('0xf5'));};AGIVertices[_0x8721('0x10')][_0x8721('0xf6')]=function(_0x5af238){logger[_0x8721('0x2a')](util['format'](_0x8721('0xf7'),_0x5af238[_0x8721('0xa1')]));if(!this['isConfigured'](_0x5af238['ndauth_url'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xf8'));}if(!this[_0x8721('0xa2')](_0x5af238[_0x8721('0xf9')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20username\x20configured');}if(!this[_0x8721('0xa2')](_0x5af238[_0x8721('0xfa')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xfb'));}if(!this['isConfigured'](_0x5af238[_0x8721('0xfc')])){return this['channel'][_0x8721('0xa5')](_0x8721('0xc5'));}this['channel']['bot']=!![];this[_0x8721('0x31')](_0x5af238);this['createSquareMessage'](_0x5af238['text'],'in','','');this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xfd'),_0x5af238[_0x8721('0x58')]));var _0xbbe554=this[_0x8721('0x7c')][_0x8721('0x6b')](this,_0x5af238);if(_0xbbe554){for(var _0x2a0f92 in _0xbbe554){if(_0xbbe554[_0x8721('0x8e')](_0x2a0f92)){this[_0x8721('0xd')][_0x8721('0x98')](util[_0x8721('0x25')](_0x8721('0xfe'),_0x2a0f92['toUpperCase']()),_0xbbe554[_0x2a0f92]);}}this[_0x8721('0x3c')](_0xbbe554[_0x8721('0xea')],_0x8721('0xff'),_0x8721('0xf6'),'');if(_0xbbe554[_0x8721('0x100')]){this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x101'),_0xbbe554[_0x8721('0x100')]));var _0x14c09f=this['channel'][_0x8721('0x102')](_0xbbe554[_0x8721('0x100')]);try{fs['unlink'](_0xbbe554['audiofile']+'.wav');}catch(_0x576b61){logger['error'](_0x576b61);}return _0x14c09f;}else{return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0x103'),_0xbbe554['speech']));}}return this[_0x8721('0xd')]['error'](_0x5af238,_0x8721('0x104'));};AGIVertices['prototype'][_0x8721('0x105')]=function(_0xd8d41b){logger[_0x8721('0x2a')](util['format'](_0x8721('0x106'),_0xd8d41b[_0x8721('0xa1')]));return this['channel'][_0x8721('0xa5')]('end');};AGIVertices[_0x8721('0x10')][_0x8721('0x107')]=function(_0x5d2405){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x108'),_0x5d2405[_0x8721('0xa1')]));var _0x2afab6='';if(_0x5d2405[_0x8721('0x109')]){if(!this['isConfigured'](_0x5d2405[_0x8721('0x109')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x5d2405,'no\x20trunk\x20selected');}else{var _0x162e0d=parseInt(_0x5d2405[_0x8721('0x109')],0xa);if(isNaN(_0x162e0d)){_0x2afab6=_0x5d2405['trunk_id'];}else{_0x2afab6=this[_0x8721('0x1a')][_0x8721('0x6b')](this,_0x5d2405[_0x8721('0x109')]);if(!_0x2afab6){return this['channel'][_0x8721('0x29')](_0x5d2405,_0x8721('0x10a'));}}}}else if(_0x5d2405['trunk_name']){_0x2afab6=_0x5d2405[_0x8721('0x10b')];}else{return this[_0x8721('0xd')][_0x8721('0x29')](_0x5d2405,_0x8721('0x10c'));}var _0x423c8d=this['channel']['exec']('DIAL',[util['format'](_0x8721('0x10d'),_0x2afab6,_0x5d2405[_0x8721('0x43')]),_0x5d2405[_0x8721('0x61')],_0x5d2405['opts'],_0x5d2405[_0x8721('0x5f')]]);if(_0x423c8d['result']===-0x1){return _0x423c8d;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xe3'),_0x8721('0xe4')));};AGIVertices['prototype'][_0x8721('0x10e')]=function(_0x2a6ac3){logger[_0x8721('0x2a')](util['format'](_0x8721('0x10f'),_0x2a6ac3[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0xa5')]('finally');};AGIVertices[_0x8721('0x10')][_0x8721('0xc')]=function(_0x441e9d){logger['info'](util['format'](_0x8721('0x110'),_0x441e9d['label']));if(_0x441e9d[_0x8721('0x9e')]===0x0){return this['maxRetry'](_0x441e9d);}_0x441e9d[_0x8721('0x9e')]-=0x1;if(!this[_0x8721('0xa2')](_0x441e9d['file_id'])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x441e9d,_0x8721('0x111'));}var _0x36e8c5=this['getSound'][_0x8721('0x6b')](this,_0x441e9d[_0x8721('0x112')]);if(!_0x36e8c5){return this['channel']['error'](_0x441e9d,_0x8721('0x113'));}if(!this[_0x8721('0xa2')](_0x441e9d['variable_id'])){return this[_0x8721('0xd')][_0x8721('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x39ef5b=this[_0x8721('0xd')][_0x8721('0x114')](_0x36e8c5,_0x441e9d[_0x8721('0x115')],_0x441e9d[_0x8721('0x116')]);var _0x1b9468=_0x39ef5b[_0x8721('0xa4')]?_0x39ef5b[_0x8721('0xa4')][_0x8721('0x46')]():'';logger[_0x8721('0x2a')](_0x8721('0x117'),JSON['stringify'](_0x39ef5b));if(_0x39ef5b[_0x8721('0xa4')]===-0x1){this[_0x8721('0x31')]['sync'](this,_0x441e9d,_0x1b9468);return _0x39ef5b;}else if(_0x39ef5b[_0x8721('0x9a')]===_0x8721('0x61')){_0x39ef5b[_0x8721('0xa4')]=_0x1b9468['length']>=parseInt(_0x441e9d['mindigit'])?'x':'i';}else{_0x39ef5b['result']=_0x1b9468[_0x8721('0x93')]>=parseInt(_0x441e9d['mindigit'])&&_0x1b9468['length']<=parseInt(_0x441e9d[_0x8721('0x116')])?'x':'i';}var _0x453f61=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0x441e9d[_0x8721('0xd5')]);if(!_0x453f61){return this[_0x8721('0xd')][_0x8721('0x29')](_0x441e9d,_0x8721('0xd7'));}this[_0x8721('0xd')]['setVariable'](_0x453f61,_0x1b9468);if(this[_0x8721('0xa2')](_0x441e9d[_0x8721('0x118')])){var _0xc155e=parseInt(_0x441e9d[_0x8721('0x118')],0xa);var _0x57b988=rs[_0x8721('0x119')]({'charset':'*','length':_0xc155e});var _0x39628b=_0x1b9468[_0x8721('0x93')];if(_0x39628b>0x0){if(_0x39628b>_0xc155e){this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x441e9d,_0x441e9d['hiddendigitspos']===_0x8721('0x11a')?_0x57b988+_0x1b9468['substr'](_0xc155e):_0x1b9468[_0x8721('0x11b')](0x0,_0x39628b-_0xc155e)+_0x57b988);}else{this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x441e9d,rs[_0x8721('0x119')]({'charset':'*','length':_0x39628b}));}}else{this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x441e9d,'');}}else{this['createSquareDetailsReport'][_0x8721('0x6b')](this,_0x441e9d,_0x1b9468);}return _0x39ef5b;};AGIVertices[_0x8721('0x10')][_0x8721('0x11c')]=function(_0x281620){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x11d'),_0x281620[_0x8721('0xa1')]));return this[_0x8721('0xc')](_0x281620);};AGIVertices['prototype'][_0x8721('0x11e')]=function(_0x3aac93){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x11f'),_0x3aac93['label']));this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x3aac93,_0x3aac93['goalname']);return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')]('GOAL\x20%s',_0x3aac93[_0x8721('0x120')]));};AGIVertices[_0x8721('0x10')]['awspolly']=function(_0x1019d7){logger['info'](util[_0x8721('0x25')](_0x8721('0x121'),_0x1019d7[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x1019d7[_0x8721('0x82')])||!this[_0x8721('0xa2')](_0x1019d7[_0x8721('0x87')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8721('0xa2')](_0x1019d7[_0x8721('0x58')])){return this[_0x8721('0xd')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x8721('0x25')](_0x8721('0x122'),_0x1019d7[_0x8721('0x58')]));var _0x2096df=this[_0x8721('0x81')][_0x8721('0x6b')](this,_0x1019d7);if(_0x2096df){this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x123'),_0x2096df));var _0x1def63=this[_0x8721('0xd')][_0x8721('0x102')](_0x2096df);try{fs[_0x8721('0x124')](_0x2096df+_0x8721('0x125'));}catch(_0x25b88b){logger[_0x8721('0x29')](_0x25b88b);}return _0x1def63;}return this[_0x8721('0xd')][_0x8721('0x29')](_0x1019d7,_0x8721('0x126'));};AGIVertices['prototype'][_0x8721('0x127')]=function(_0x4aa3ad){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x128'),_0x4aa3ad[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x4aa3ad['aws_access_key_id'])||!this[_0x8721('0xa2')](_0x4aa3ad['aws_secret_access_key'])){return this['channel'][_0x8721('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8721('0xa2')](_0x4aa3ad[_0x8721('0x88')])){return this['channel'][_0x8721('0xa5')](_0x8721('0x129'));}if(!this[_0x8721('0xa2')](_0x4aa3ad[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20text\x20configured');}this[_0x8721('0xd')][_0x8721('0x12a')]=!![];this[_0x8721('0x31')](_0x4aa3ad);this[_0x8721('0x3c')](_0x4aa3ad[_0x8721('0x58')],'in','','');this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x12b'),_0x4aa3ad[_0x8721('0x58')]));var _0x55b5b9=this[_0x8721('0x86')][_0x8721('0x6b')](this,_0x4aa3ad);if(_0x55b5b9){for(var _0x5a562f in _0x55b5b9){if(_0x55b5b9[_0x8721('0x8e')](_0x5a562f)&&_[_0x8721('0x8f')](_0x55b5b9[_0x5a562f])){this[_0x8721('0xd')]['setVariable'](util[_0x8721('0x25')]('AWS_LEX_%s',_0x5a562f[_0x8721('0x66')]()),_0x55b5b9[_0x5a562f]);}}if(_[_0x8721('0x3f')](_0x55b5b9['message'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x12c'));}else{this[_0x8721('0x3c')](_0x55b5b9[_0x8721('0x72')],_0x8721('0xff'),_0x8721('0x12d'),'');return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0x12e'),_0x55b5b9[_0x8721('0x72')]));}}return this['channel'][_0x8721('0x29')](_0x4aa3ad,_0x8721('0x12f'));};AGIVertices[_0x8721('0x10')][_0x8721('0x130')]=function(_0x11b0ca){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x131'),_0x11b0ca[_0x8721('0xa1')],_0x11b0ca[_0x8721('0x61')]));if(!this['isConfigured'](_0x11b0ca['key'])){return this[_0x8721('0xd')]['noop'](_0x8721('0x132'));}var _0x28a94d=_0x8721('0x133');var _0x13b5cb=util['format'](_0x8721('0x134'),FILES_PATH,rs[_0x8721('0x119')](0x4));var _0xca7534=util[_0x8721('0x25')](_0x8721('0x96'),_0x13b5cb,_0x28a94d);var _0xdbc1f=!![];if(_0x11b0ca[_0x8721('0x135')]===_0x8721('0x136')){_0xdbc1f=![];}var _0x3ac9a8=this[_0x8721('0xd')][_0x8721('0x137')](_0x13b5cb,_0x28a94d,_0x11b0ca[_0x8721('0x138')],_0x11b0ca[_0x8721('0x61')],undefined,_0xdbc1f);if(_0x3ac9a8['result']!==-0x1){this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x139'),_0xca7534));var _0xfffd9c=this[_0x8721('0x89')]['sync'](this,_0x11b0ca,_0xca7534);if(_0xfffd9c){for(var _0x6c52d in _0xfffd9c){if(_0xfffd9c[_0x8721('0x8e')](_0x6c52d)){this['channel'][_0x8721('0x98')](util[_0x8721('0x25')]('GOOGLE_ASR_%s',_0x6c52d['toUpperCase']()),_0xfffd9c[_0x6c52d]);}}return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0xfffd9c)));}}return _0x3ac9a8;};AGIVertices[_0x8721('0x10')][_0x8721('0x13a')]=function(_0x99352){logger['info'](util[_0x8721('0x25')](_0x8721('0x13b'),_0x99352[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x99352['appid'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x13c'));}if(!this[_0x8721('0xa2')](_0x99352[_0x8721('0x13d')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x13e'));}var _0x233222=_0x8721('0x133');var _0x31afae=util[_0x8721('0x25')](_0x8721('0x134'),FILES_PATH,rs[_0x8721('0x119')](0x4));var _0x454de4=util[_0x8721('0x25')](_0x8721('0x96'),_0x31afae,_0x233222);var _0x5c18dc=!![];if(_0x99352[_0x8721('0x135')]===_0x8721('0x136')){_0x5c18dc=![];}var _0x4f9312=this[_0x8721('0xd')][_0x8721('0x137')](_0x31afae,_0x233222,_0x99352[_0x8721('0x138')],_0x99352[_0x8721('0x61')],undefined,_0x5c18dc);if(_0x4f9312['result']!==-0x1){this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')]('tilde\x20%s\x20file\x20created',_0x454de4));var _0x530ecc=this[_0x8721('0x8a')][_0x8721('0x6b')](this,_0x99352,_0x454de4);if(_0x530ecc){for(var _0x3f50ca in _0x530ecc){if(_0x530ecc[_0x8721('0x8e')](_0x3f50ca)){this['channel'][_0x8721('0x98')](util['format'](_0x8721('0x13f'),_0x3f50ca[_0x8721('0x66')]()),_0x530ecc[_0x3f50ca]);}}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x140'),JSON[_0x8721('0x6e')](_0x530ecc)));}}return _0x4f9312;};AGIVertices[_0x8721('0x10')]['gotoc']=function(_0x2fef4e){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x141'),_0x2fef4e[_0x8721('0xa1')]));return this[_0x8721('0xd')]['continueAt'](_0x2fef4e[_0x8721('0x37')],_0x2fef4e['extension'],_0x2fef4e[_0x8721('0x38')]);};AGIVertices['prototype'][_0x8721('0x142')]=function(_0x32a8bd){logger[_0x8721('0x2a')](util['format'](_0x8721('0x143'),_0x32a8bd[_0x8721('0xa1')]));if(!this['isConfigured'](_0x32a8bd[_0x8721('0x144')])){return this[_0x8721('0xd')]['error'](_0x32a8bd,_0x8721('0x145'));}try{var _0x382865=eval(_0x32a8bd['condition'])?_0x8721('0x146'):_0x8721('0x147');this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0x148'),_0x32a8bd[_0x8721('0x144')],_0x382865));return{'code':0xc8,'result':_0x382865};}catch(_0x3ba6b9){return{'code':0xc8,'result':_0x8721('0x147')};}};AGIVertices[_0x8721('0x10')][_0x8721('0x149')]=function(_0x2a3090){logger[_0x8721('0x2a')](util['format'](_0x8721('0x14a'),_0x2a3090['label']));if(!this[_0x8721('0xa2')](_0x2a3090['interval_id'])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2a3090,_0x8721('0x14b'));}var _0x3f2e7a=this[_0x8721('0x22')]['sync'](this,_0x2a3090[_0x8721('0x14c')]);if(!_0x3f2e7a){return this['channel'][_0x8721('0x29')](_0x2a3090,_0x8721('0x14d'));}for(var _0x4d10f5=0x0;_0x4d10f5<_0x3f2e7a['length'];_0x4d10f5+=0x1){var _0xbc131b=this[_0x8721('0xd')][_0x8721('0x11')](util[_0x8721('0x25')](_0x8721('0x14e'),_0x3f2e7a[_0x4d10f5]));if(_0xbc131b[_0x8721('0xa4')]===-0x1){return _0xbc131b;}logger['info'](util[_0x8721('0x25')](_0x8721('0x14f'),_0x3f2e7a[_0x4d10f5],_0xbc131b[_0x8721('0x9a')]));if(_0xbc131b['extra']===_0x8721('0x146')){logger['info'](util[_0x8721('0x25')](_0x8721('0x14f'),_0x3f2e7a[_0x4d10f5],_0x8721('0x146')));this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x14f'),_0x3f2e7a[_0x4d10f5],_0x8721('0x146')));return{'code':0xc8,'result':_0x8721('0x146')};}else{logger[_0x8721('0x2a')](util['format'](_0x8721('0x14f'),_0x3f2e7a[_0x4d10f5],_0x8721('0x147')));this['channel'][_0x8721('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x3f2e7a[_0x4d10f5],_0x8721('0x147')));}}return{'code':0xc8,'result':_0x8721('0x147')};};AGIVertices[_0x8721('0x10')][_0x8721('0x150')]=function(_0x54fefc){logger[_0x8721('0x2a')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x54fefc[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0x150')]();};AGIVertices[_0x8721('0x10')]['ispeechasr']=function(_0x49b010){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x151'),_0x49b010[_0x8721('0xa1')]));if(!this['isConfigured'](_0x49b010[_0x8721('0x75')])){return this[_0x8721('0xd')]['noop']('no\x20key\x20configured');}var _0x411bd1='wav';var _0x307609=util['format'](_0x8721('0x134'),FILES_PATH,rs[_0x8721('0x119')](0x4));var _0x49f288=util[_0x8721('0x25')](_0x8721('0x96'),_0x307609,_0x411bd1);var _0x6ffce0=!![];if(_0x49b010['beep']==='NOBEEP'){_0x6ffce0=![];}var _0x54f692=this[_0x8721('0xd')][_0x8721('0x137')](_0x307609,_0x411bd1,_0x49b010[_0x8721('0x138')],_0x49b010[_0x8721('0x61')],undefined,_0x6ffce0);if(_0x54f692['result']!==-0x1){this['channel']['noop'](util[_0x8721('0x25')]('ispeech\x20%s\x20file\x20created',_0x49f288));var _0xa76bca=this[_0x8721('0x7f')][_0x8721('0x6b')](this,_0x49b010,_0x49f288);if(_0xa76bca){for(var _0x1fa757 in _0xa76bca){if(_0xa76bca['hasOwnProperty'](_0x1fa757)){this[_0x8721('0xd')][_0x8721('0x98')](util['format'](_0x8721('0x152'),_0x1fa757[_0x8721('0x66')]()),_0xa76bca[_0x1fa757]);}}return this['channel']['noop'](util['format'](_0x8721('0x153'),JSON[_0x8721('0x6e')](_0xa76bca)));}}return _0x54f692;};AGIVertices[_0x8721('0x10')][_0x8721('0x154')]=function(_0x5237fb){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x155'),_0x5237fb[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x5237fb[_0x8721('0x75')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x132'));}if(!this['isConfigured'](_0x5237fb[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xc5'));}this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x156'),_0x5237fb[_0x8721('0x58')]));var _0x2a10cf=this['ispeechTTS'][_0x8721('0x6b')](this,_0x5237fb);if(_0x2a10cf){this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0x157'),_0x2a10cf));var _0x29c5fd=this['channel']['streamFile'](_0x2a10cf,_0x5237fb['intKey']);try{fs[_0x8721('0x124')](_0x2a10cf+_0x8721('0x125'));}catch(_0x5aae44){logger[_0x8721('0x29')](_0x5aae44);}return _0x29c5fd;}return this['channel'][_0x8721('0x29')](_0x5237fb,_0x8721('0x158'));};AGIVertices[_0x8721('0x10')][_0x8721('0x159')]=function(_0x2c0260){logger['info'](util[_0x8721('0x25')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2c0260[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x2c0260[_0x8721('0x15a')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2c0260,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8721('0x25')](_0x8721('0x15b'),this[_0x8721('0xd')][_0x8721('0x34')],_0x2c0260[_0x8721('0x15a')]));var _0x55622b=this['agentLogin']['sync'](this,_0x2c0260[_0x8721('0x15a')]);if(_0x55622b){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x15c'),this[_0x8721('0xd')]['callerid'],_0x2c0260[_0x8721('0x15a')]));this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8721('0x34')],_0x2c0260[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15d')};}else{logger[_0x8721('0x2a')](util[_0x8721('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8721('0xd')][_0x8721('0x34')],_0x2c0260[_0x8721('0x15a')]));this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x15e'),this[_0x8721('0xd')][_0x8721('0x34')],_0x2c0260[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15f')};}};AGIVertices[_0x8721('0x10')][_0x8721('0x160')]=function(_0x113975){logger[_0x8721('0x2a')](util[_0x8721('0x25')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x113975[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x113975[_0x8721('0x15a')])){return this['channel'][_0x8721('0x29')](_0x113975,_0x8721('0x161'));}logger[_0x8721('0x2a')](util['format'](_0x8721('0x15b'),this[_0x8721('0xd')]['callerid'],_0x113975[_0x8721('0x15a')]));var _0x61a8d=this['agentLogout'][_0x8721('0x6b')](this,_0x113975['findBy']);if(_0x61a8d){logger[_0x8721('0x2a')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8721('0xd')][_0x8721('0x34')],_0x113975['findBy']));this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0x15c'),this[_0x8721('0xd')][_0x8721('0x34')],_0x113975[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15d')};}else{logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x15e'),this['channel'][_0x8721('0x34')],_0x113975['findBy']));this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x15e'),this[_0x8721('0xd')]['callerid'],_0x113975[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15f')};}};AGIVertices['prototype'][_0x8721('0x162')]=function(_0x27352f){logger['info'](util[_0x8721('0x25')](_0x8721('0x163'),_0x27352f[_0x8721('0xa1')]));if(!this['isConfigured'](_0x27352f[_0x8721('0x164')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x27352f,_0x8721('0x165'));}this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0x166'),_0x27352f['operation']));var _0x4170aa=eval(_0x27352f[_0x8721('0x164')]);if(!this[_0x8721('0xa2')](_0x27352f[_0x8721('0xd5')])){return this[_0x8721('0xd')]['noop'](_0x8721('0xd6'));}var _0x1b11a0=this['getVariable'][_0x8721('0x6b')](this,_0x27352f['variable_id']);if(!_0x1b11a0){return this[_0x8721('0xd')][_0x8721('0x29')](_0x27352f,_0x8721('0xd7'));}if(_[_0x8721('0x97')](_0x4170aa)){var _0x5d7e80=this;_0x4170aa[_0x8721('0xd8')](function(_0x4a4d2b,_0x432e16){_0x5d7e80[_0x8721('0xd')][_0x8721('0x98')](util[_0x8721('0x25')](_0x8721('0x167'),_0x1b11a0,_0x432e16),_0x4a4d2b);});return this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x168'),_0x1b11a0));}else{return this[_0x8721('0xd')]['setVariable'](_0x1b11a0,_0x4170aa);}};AGIVertices[_0x8721('0x10')][_0x8721('0xb')]=function(_0x2e487e){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x169'),_0x2e487e[_0x8721('0xa1')]));if(_0x2e487e[_0x8721('0x9e')]===0x0){return this[_0x8721('0x9d')](_0x2e487e);}_0x2e487e[_0x8721('0x9e')]-=0x1;if(!this[_0x8721('0xa2')](_0x2e487e[_0x8721('0x112')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2e487e,_0x8721('0x111'));}var _0x1f7278=this[_0x8721('0x16a')][_0x8721('0x6b')](this,_0x2e487e[_0x8721('0x112')]);if(!_0x1f7278){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2e487e,_0x8721('0x113'));}var _0x4fe1ae=this[_0x8721('0xd')][_0x8721('0x114')](_0x1f7278,_0x2e487e['response'],_0x2e487e[_0x8721('0x16b')]);var _0x3db4df=_0x4fe1ae[_0x8721('0xa4')];if(_0x4fe1ae[_0x8721('0xa4')]===-0x1){this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x2e487e,'-1');return _0x4fe1ae;}else if(_0x4fe1ae['extra']===_0x8721('0x61')){_0x4fe1ae['result']=_0x4fe1ae[_0x8721('0xa4')][_0x8721('0x93')]>0x0?_0x4fe1ae[_0x8721('0xa4')]:'t';}else if(_['isEmpty'](_0x4fe1ae[_0x8721('0xa4')])){_0x4fe1ae[_0x8721('0xa4')]='#';_0x3db4df='#';}if(!this[_0x8721('0xa2')](_0x2e487e[_0x8721('0xd5')])){this['channel'][_0x8721('0xa5')](_0x8721('0xd6'));}else{var _0x101fa0=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0x2e487e['variable_id']);if(!_0x101fa0){return this[_0x8721('0xd')]['error'](_0x2e487e,'no\x20variable\x20found');}this['channel']['setVariable'](_0x101fa0,_0x3db4df);}this['createSquareDetailsReport'][_0x8721('0x6b')](this,_0x2e487e,_0x3db4df);return _0x4fe1ae;};AGIVertices['prototype'][_0x8721('0xa5')]=function(_0x29ae06){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x16c'),_0x29ae06[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0xa5')](_0x29ae06[_0x8721('0x16d')]||_0x29ae06[_0x8721('0xa1')]);};AGIVertices[_0x8721('0x10')][_0x8721('0x16e')]=function(_0x2abdfc){logger['info'](util[_0x8721('0x25')](_0x8721('0x16f'),_0x2abdfc[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x2abdfc[_0x8721('0x15a')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2abdfc,_0x8721('0x161'));}logger[_0x8721('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x8721('0x34')],_0x2abdfc[_0x8721('0x15a')]));var _0x3af3a5=this['getPause'][_0x8721('0x6b')](this,_0x2abdfc[_0x8721('0x170')]);var _0x889459=this['agentPause'][_0x8721('0x6b')](this,_0x2abdfc[_0x8721('0x15a')],_0x3af3a5);if(_0x889459){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x15c'),this['channel'][_0x8721('0x34')],_0x2abdfc[_0x8721('0x15a')]));this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8721('0xd')]['callerid'],_0x2abdfc[_0x8721('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x8721('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8721('0xd')]['callerid'],_0x2abdfc['findBy']));this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x15c'),this[_0x8721('0xd')][_0x8721('0x34')],_0x2abdfc[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15f')};}};AGIVertices[_0x8721('0x10')][_0x8721('0x171')]=function(_0x1c64ec){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x172'),_0x1c64ec[_0x8721('0xa1')]));if(!this['isConfigured'](_0x1c64ec[_0x8721('0x112')])){return this['channel'][_0x8721('0x29')](_0x1c64ec,_0x8721('0x111'));}var _0x41d856=this[_0x8721('0x16a')][_0x8721('0x6b')](this,_0x1c64ec[_0x8721('0x112')]);if(!_0x41d856){return this['channel'][_0x8721('0x29')](_0x1c64ec,_0x8721('0x113'));}var _0x5053d3=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0x173'),[_0x41d856,_0x1c64ec[_0x8721('0xe2')]]);if(_0x5053d3['result']===-0x1){return _0x5053d3;}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0xc1'),_0x8721('0x173'),_0x41d856));};AGIVertices[_0x8721('0x10')][_0x8721('0x174')]=function(_0x22dbf4){logger[_0x8721('0x2a')](util['format'](_0x8721('0x175'),_0x22dbf4[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x22dbf4[_0x8721('0x176')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x22dbf4,_0x8721('0x177'));}var _0x410e64='';var _0xaad6cd=parseInt(_0x22dbf4[_0x8721('0x176')],0xa);if(isNaN(_0xaad6cd)){_0x410e64=_0x22dbf4[_0x8721('0x176')];}else{_0x410e64=this['getVoiceQueue'][_0x8721('0x6b')](this,_0x22dbf4[_0x8721('0x176')]);if(!_0x410e64){return this[_0x8721('0xd')][_0x8721('0x29')](_0x22dbf4,_0x8721('0x178'));}}var _0x57f379='';if(this[_0x8721('0xa2')](_0x22dbf4[_0x8721('0x112')])){var _0x101911=this[_0x8721('0x16a')]['sync'](this,_0x22dbf4[_0x8721('0x112')]);if(_0x101911){_0x57f379=_0x101911;}}this['createSquareDetailsReport'][_0x8721('0x6b')](this,_0x22dbf4,_0x410e64);if(_0x22dbf4[_0x8721('0xe2')][_0x8721('0x179')]('x')<0x0){_0x22dbf4['opts']+='x';}if(_0x22dbf4['opts'][_0x8721('0x179')]('X')<0x0){_0x22dbf4[_0x8721('0xe2')]+='X';}this[_0x8721('0xd')][_0x8721('0x98')](_0x8721('0x17a'),_0x410e64?_0x410e64[_0x8721('0x17b')]():'');var _0x2b55fd=this[_0x8721('0xd')]['exec'](_0x8721('0x17c'),[_0x410e64,_0x22dbf4[_0x8721('0xe2')],_0x22dbf4[_0x8721('0x5f')],_0x57f379,_0x22dbf4['timeout'],_0x22dbf4[_0x8721('0x6')],_0x22dbf4[_0x8721('0x17d')],_0x22dbf4[_0x8721('0x17e')],'',_0x22dbf4['position']]);if(_0x2b55fd['result']===-0x1){return _0x2b55fd;}return this[_0x8721('0xd')]['noop'](util[_0x8721('0x25')](_0x8721('0xc1'),_0x8721('0x17c'),_0x410e64));};AGIVertices[_0x8721('0x10')]['record']=function(_0x2b1ce8){logger['info'](util[_0x8721('0x25')](_0x8721('0x17f'),_0x2b1ce8['label']));var _0x4f2318=_0x2b1ce8[_0x8721('0x180')]||_0x8721('0x133');var _0x426a6d=util[_0x8721('0x25')](_0x8721('0x181'),this[_0x8721('0xd')][_0x8721('0x32')],rs[_0x8721('0x119')](0x5));var _0x5351ea=util[_0x8721('0x25')](_0x8721('0x182'),FILES_PATH,_0x426a6d,_0x4f2318);var _0x1abd3f=util[_0x8721('0x25')](_0x8721('0x134'),FILES_PATH,_0x426a6d);this[_0x8721('0x35')][_0x8721('0x6b')](this,_0x2b1ce8,_0x426a6d,_0x5351ea);this[_0x8721('0xd')]['setVariable']('RECORDING_SAVENAME',_0x426a6d);logger[_0x8721('0x2a')](_0x8721('0x183'),_0x1abd3f,_0x4f2318,_0x2b1ce8['escape_digits'],_0x2b1ce8[_0x8721('0x61')]);return this[_0x8721('0xd')][_0x8721('0x137')](_0x1abd3f,_0x4f2318,_0x2b1ce8[_0x8721('0x184')],_0x2b1ce8['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0xa378dd){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x185'),_0xa378dd[_0x8721('0xa1')]));if(!this['isConfigured'](_0xa378dd['url'])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x186'));}var _0xcb0b15=this[_0x8721('0x187')][_0x8721('0x6b')](this,_0xa378dd);logger[_0x8721('0x2a')](util[_0x8721('0x25')]('Response:',util['inspect'](_0xcb0b15,{'showHidden':![],'depth':null})));if(!this[_0x8721('0xa2')](_0xa378dd[_0x8721('0xd5')])){return this['channel'][_0x8721('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3a3cd9=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0xa378dd[_0x8721('0xd5')]);if(!_0x3a3cd9){return this['channel']['error'](_0xa378dd,_0x8721('0xd7'));}this[_0x8721('0xd')][_0x8721('0x98')](util['format'](_0x8721('0x188'),_0x3a3cd9),_0xcb0b15[_0x8721('0x71')]?_0xcb0b15[_0x8721('0x71')]:'200');this['channel'][_0x8721('0x98')](util['format'](_0x8721('0x189'),_0x3a3cd9),_0xcb0b15[_0x8721('0x70')]?_0xcb0b15['statusMessage']:'OK');if(_0xcb0b15['body']){try{this[_0x8721('0x95')](_0xcb0b15[_0x8721('0x67')],_0x3a3cd9);}catch(_0x5a4376){logger[_0x8721('0x29')](util[_0x8721('0x25')](_0x8721('0x18a'),_0x3a3cd9));}}return this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0xdb'),_0x3a3cd9));};AGIVertices['prototype'][_0x8721('0x18b')]=function(_0x2de858){logger['info'](util[_0x8721('0x25')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2de858[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0x18c')](_0x2de858[_0x8721('0x18d')][_0x8721('0x54')](/\s+/g,''),_0x2de858[_0x8721('0x184')]);};AGIVertices[_0x8721('0x10')]['saynumber']=function(_0x710ded){logger[_0x8721('0x2a')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x710ded['label']));return this[_0x8721('0xd')][_0x8721('0x18e')](_0x710ded[_0x8721('0x62')][_0x8721('0x54')](/\s+/g,''),_0x710ded['escape_digits']);};AGIVertices[_0x8721('0x10')][_0x8721('0x18f')]=function(_0x33472f){logger[_0x8721('0x2a')](util[_0x8721('0x25')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x33472f[_0x8721('0xa1')]));return this[_0x8721('0xd')][_0x8721('0x190')](_0x33472f[_0x8721('0x58')],_0x33472f[_0x8721('0x184')]);};AGIVertices[_0x8721('0x10')]['sendMail']=function(_0x11f96a){logger[_0x8721('0x2a')](util['format'](_0x8721('0x191'),_0x11f96a[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x11f96a[_0x8721('0x192')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20mail\x20account\x20configured');}var _0x2aab91=this[_0x8721('0x1f')]['sync'](this,_0x11f96a[_0x8721('0x192')]);if(!_0x2aab91||!_0x2aab91['Smtp']){return this[_0x8721('0xd')]['error'](_0x11f96a,'no\x20mail\x20account\x20found');}var _0x5a444e={'from':util['format'](_0x8721('0x193'),_0x2aab91['name'],_0x2aab91[_0x8721('0x194')]||_0x2aab91[_0x8721('0x195')]['user']),'to':_0x11f96a['to']||'','cc':_0x11f96a['cc']||'','bcc':_0x11f96a[_0x8721('0x196')]||'','subject':_0x11f96a['subject'],'html':_0x11f96a[_0x8721('0x58')],'text':_0x11f96a[_0x8721('0x58')]};var _0x3b03d0=_0x2aab91['getSmtpOptions']();if(this[_0x8721('0xa2')](_0x11f96a[_0x8721('0x197')])){}logger['debug'](_0x8721('0x198'),JSON[_0x8721('0x6e')](_0x5a444e));this[_0x8721('0x31')]['sync'](this,_0x11f96a,_0x11f96a[_0x8721('0x192')]);this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x199'),_0x2aab91[_0x8721('0x19')]));this['sendMailMessage']['sync'](this,_0x3b03d0,_0x5a444e);return this['channel'][_0x8721('0xa5')](_0x8721('0x19a'));};AGIVertices[_0x8721('0x10')][_0x8721('0x19b')]=function(_0x41c2ed){logger['info'](util['format'](_0x8721('0x19c'),_0x41c2ed[_0x8721('0xa1')]));return this['channel']['noop'](_0x8721('0x19d'));};AGIVertices[_0x8721('0x10')][_0x8721('0x19e')]=function(_0x486f39){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x19f'),_0x486f39[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x486f39[_0x8721('0x1a0')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x1a1'));}var _0x106393=this[_0x8721('0x2e')][_0x8721('0x6b')](this,_0x486f39['sms_account_id']);if(!_0x106393){return this[_0x8721('0xd')][_0x8721('0x29')](_0x486f39,_0x8721('0x1a2'));}var _0x66ac8={'body':_0x486f39[_0x8721('0x1a3')],'phone':_0x486f39['to']||'','SmsAccountId':_0x106393['id']};logger['debug'](_0x8721('0x1a4'),JSON['stringify'](_0x66ac8));this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x486f39,_0x486f39[_0x8721('0x1a0')]);this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x1a5'),_0x106393['name']));this[_0x8721('0x30')][_0x8721('0x6b')](this,_0x66ac8);return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x1a6'));};AGIVertices[_0x8721('0x10')][_0x8721('0x1a7')]=function(_0x4e202d){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x1a8'),_0x4e202d[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x4e202d[_0x8721('0xd5')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x4e202d,_0x8721('0x1a9'));}var _0x59a356=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0x4e202d[_0x8721('0xd5')]);if(!_0x59a356){return this[_0x8721('0xd')][_0x8721('0x29')](_0x4e202d,_0x8721('0xd7'));}return this['channel'][_0x8721('0x98')](_0x59a356,_0x4e202d['variable_value']);};AGIVertices[_0x8721('0x10')][_0x8721('0x1aa')]=function(_0x3b0fa3){logger[_0x8721('0x2a')](util[_0x8721('0x25')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3b0fa3[_0x8721('0xa1')]));this[_0x8721('0xd')][_0x8721('0xa5')]('START\x20CALLY\x20SQUARE');if(_0x3b0fa3[_0x8721('0xb6')]===_0x8721('0x1ab')){this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x1ac'));return this[_0x8721('0xd')][_0x8721('0xb6')]();}return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0x1ad'));};AGIVertices[_0x8721('0x10')][_0x8721('0x1ae')]=function(_0x413060){logger['info'](util[_0x8721('0x25')](_0x8721('0x1af'),_0x413060[_0x8721('0xa1')]));if(!this[_0x8721('0xa2')](_0x413060['project_id'])){return this['channel'][_0x8721('0x29')](_0x413060,_0x8721('0x1b0'));}var _0x5ba6d2=this[_0x8721('0x15')]['sync'](this,_0x413060['project_id']);if(!this[_0x8721('0xa2')](_0x5ba6d2)){return this['channel'][_0x8721('0x29')](_0x413060,util[_0x8721('0x25')](_0x8721('0x1b1'),_0x413060[_0x8721('0x1b2')]));}if(_0x5ba6d2===this[_0x8721('0xd')][_0x8721('0x33')]){return this['channel'][_0x8721('0x29')](_0x413060,_0x8721('0x1b3'));}this[_0x8721('0x31')]['sync'](this,_0x413060,_0x5ba6d2);var _0x1a64b2=this['channel'][_0x8721('0x52')](_0x8721('0x1b4'),util[_0x8721('0x25')](_0x8721('0x1b5'),config[_0x8721('0x6')]['host']||'127.0.0.1',_0x5ba6d2,this[_0x8721('0xd')][_0x8721('0x33')]));if(_0x1a64b2[_0x8721('0xa4')]===-0x1){return _0x1a64b2;}return this[_0x8721('0xd')]['noop'](util['format'](_0x8721('0xc1'),_0x8721('0x1b4'),_0x5ba6d2));};AGIVertices[_0x8721('0x10')][_0x8721('0x1b6')]=function(_0x1ce47a){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x1b7'),_0x1ce47a[_0x8721('0xa1')]));var _0x35aa9e=this['shellCommand'][_0x8721('0x6b')](this,_0x1ce47a[_0x8721('0xb4')]);this[_0x8721('0x31')][_0x8721('0x6b')](this,_0x1ce47a,_0x1ce47a[_0x8721('0xb4')]);if(this[_0x8721('0xa2')](_0x1ce47a['variable_id'])){var _0x1cdd4e=this[_0x8721('0x11')]['sync'](this,_0x1ce47a[_0x8721('0xd5')]);if(_0x1cdd4e){this['channel'][_0x8721('0x98')](_0x1cdd4e,_0x35aa9e);return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x1b8'),_0x1ce47a[_0x8721('0xb4')],_0x1cdd4e));}}return this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x1b9'),_0x1ce47a['command']));};AGIVertices['prototype'][_0x8721('0x1ba')]=function(_0x46c57f){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x1bb'),_0x46c57f[_0x8721('0xa1')]));_0x46c57f[_0x8721('0x58')]=_0x46c57f[_0x8721('0x58')][_0x8721('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8721('0xa2')](_0x46c57f[_0x8721('0x56')])){return this[_0x8721('0xd')]['noop'](_0x8721('0x1bc'));}if(!this[_0x8721('0xa2')](_0x46c57f[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')](_0x8721('0xc5'));}this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0x1bd'),_0x46c57f[_0x8721('0x58')]));var _0x3a2678=this[_0x8721('0x55')][_0x8721('0x6b')](this,_0x46c57f);if(_0x3a2678){this[_0x8721('0xd')][_0x8721('0xa5')](util['format'](_0x8721('0x1be'),_0x3a2678));var _0x526dbe=this[_0x8721('0xd')][_0x8721('0x102')](_0x3a2678);try{fs[_0x8721('0x124')](_0x3a2678+'.wav');}catch(_0x541b4a){logger[_0x8721('0x29')](_0x541b4a);}return _0x526dbe;}return this['channel'][_0x8721('0x29')](_0x46c57f,_0x8721('0x1bf'));};AGIVertices[_0x8721('0x10')]['tts']=function(_0x3fe426){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x1c0'),_0x3fe426[_0x8721('0xa1')]));_0x3fe426['text']=_0x3fe426[_0x8721('0x58')][_0x8721('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8721('0xa2')](_0x3fe426[_0x8721('0x58')])){return this[_0x8721('0xd')][_0x8721('0xa5')]('no\x20text\x20configured');}this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x1c1'),_0x3fe426[_0x8721('0x58')]));var _0x1384f2=this[_0x8721('0x5d')][_0x8721('0x6b')](this,_0x3fe426);if(_0x1384f2){this[_0x8721('0xd')][_0x8721('0xa5')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x1384f2));var _0x314ca5=this[_0x8721('0xd')][_0x8721('0x102')](_0x1384f2);try{fs[_0x8721('0x124')](_0x1384f2+_0x8721('0x125'));}catch(_0x56af64){logger['error'](_0x56af64);}return _0x314ca5;}return this[_0x8721('0xd')][_0x8721('0x29')](_0x3fe426,_0x8721('0x1c2'));};AGIVertices[_0x8721('0x10')]['unpause']=function(_0x13e708){logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x1c3'),_0x13e708['label']));if(!this['isConfigured'](_0x13e708[_0x8721('0x15a')])){return this[_0x8721('0xd')][_0x8721('0x29')](_0x13e708,_0x8721('0x161'));}logger[_0x8721('0x2a')](util[_0x8721('0x25')](_0x8721('0x15b'),this[_0x8721('0xd')]['callerid'],_0x13e708[_0x8721('0x15a')]));var _0x274eb8=this[_0x8721('0x4c')]['sync'](this,_0x13e708[_0x8721('0x15a')]);if(_0x274eb8){logger[_0x8721('0x2a')](util['format'](_0x8721('0x15c'),this[_0x8721('0xd')][_0x8721('0x34')],_0x13e708['findBy']));this[_0x8721('0xd')][_0x8721('0xa5')](util[_0x8721('0x25')](_0x8721('0x15c'),this[_0x8721('0xd')][_0x8721('0x34')],_0x13e708[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15d')};}else{logger['info'](util[_0x8721('0x25')](_0x8721('0x15e'),this[_0x8721('0xd')][_0x8721('0x34')],_0x13e708[_0x8721('0x15a')]));this['channel'][_0x8721('0xa5')](util[_0x8721('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8721('0xd')]['callerid'],_0x13e708[_0x8721('0x15a')]));return{'code':0xc8,'result':_0x8721('0x15f')};}};AGIVertices[_0x8721('0x10')][_0x8721('0x1c4')]=function(_0x4103f3){logger[_0x8721('0x2a')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4103f3[_0x8721('0xa1')]));var _0x53cdc3=this[_0x8721('0xd')][_0x8721('0x52')](_0x8721('0x1c5'),[_0x4103f3['mailbox'],_0x4103f3[_0x8721('0x74')]]);if(_0x53cdc3[_0x8721('0xa4')]===-0x1){return _0x53cdc3;}return this[_0x8721('0xd')][_0x8721('0xa5')](util['format']('Executed\x20command\x20%s\x20%s',_0x8721('0x1c5'),_0x4103f3['mailbox']));};AGIVertices[_0x8721('0x10')][_0x8721('0x1c6')]=function(_0x2eb209){logger['info'](util[_0x8721('0x25')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2eb209['label']));if(!this[_0x8721('0xa2')](_0x2eb209['variable_id'])){return this[_0x8721('0xd')]['error'](_0x2eb209,_0x8721('0x1a9'));}var _0x1a9447=this[_0x8721('0x11')][_0x8721('0x6b')](this,_0x2eb209['variable_id']);if(!_0x1a9447){return this[_0x8721('0xd')][_0x8721('0x29')](_0x2eb209,_0x8721('0xd7'));}var _0x1e7dac=this[_0x8721('0xd')]['getVariable'](_0x1a9447);return{'code':0xc8,'result':_0x1e7dac[_0x8721('0x9a')]?_0x1e7dac[_0x8721('0x9a')]:'-'};};String['prototype'][_0x8721('0x1c7')]=function(_0x2365d5,_0x50f71f){return this['split'](_0x2365d5)[_0x8721('0x1c8')](_0x50f71f);};module[_0x8721('0x1c9')]=AGIVertices; \ No newline at end of file +var _0xfff0=['clear','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','isConfigured','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','getAndSetVariable','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','exec','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','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','logout','failure','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','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','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%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:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','getSmtpOptions','template_id','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\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','text','google_tts_language','url','method','timeout','number','includes','PUT','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','tildeASR','appid','appsecret'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xfff0,0x139));var _0x0fff=function(_0x11d81f,_0x351699){_0x11d81f=_0x11d81f-0x0;var _0x2c6d7a=_0xfff0[_0x11d81f];return _0x2c6d7a;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x0fff('0x0'));var sh=require(_0x0fff('0x1'));var odbc=require(_0x0fff('0x2'))();var rs=require('randomstring');var moment=require(_0x0fff('0x3'));var Mustache=require(_0x0fff('0x4'));var rp=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var shared=require('../../config/environment/shared');var scripts=require(_0x0fff('0x8'));var FILES_PATH=_0x0fff('0x9');var recursiveMapAttributes=[_0x0fff('0xa'),'rawBody'];var verticesWithRetry=[_0x0fff('0xb'),'getdigits',_0x0fff('0xc')];var AGIVertices=function(_0x5304a5,_0x41cfd9,_0x3db6f6){this['channel']=_0x5304a5;this[_0x0fff('0xd')]=_0x41cfd9;this[_0x0fff('0xe')]=_0x3db6f6;};AGIVertices[_0x0fff('0xf')][_0x0fff('0x10')]=function(_0x209b6d,_0x20c88b){this[_0x0fff('0xd')][_0x0fff('0x11')](_0x209b6d)[_0x0fff('0x12')](function(_0x411ffc){_0x20c88b(null,_0x411ffc?_0x411ffc[_0x0fff('0x13')]:![]);})['catch'](function(_0x1fb243){_0x20c88b(_0x1fb243);});};AGIVertices['prototype'][_0x0fff('0x14')]=function(_0x431efa,_0x38fc82){this[_0x0fff('0xd')]['getVoiceQueueById'](_0x431efa)['then'](function(_0x1daf30){_0x38fc82(null,_0x1daf30?_0x1daf30['name']:![]);})['catch'](function(_0x51ceea){_0x38fc82(_0x51ceea);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x15')]=function(_0x5eab2e,_0x431b33){this[_0x0fff('0xd')]['getSquareProjectById'](_0x5eab2e)['then'](function(_0x48f36d){_0x431b33(null,_0x48f36d?_0x48f36d[_0x0fff('0x13')]:![]);})[_0x0fff('0x16')](function(_0x46a02d){_0x431b33(_0x46a02d);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x17')]=function(_0xe89b4a,_0x4c88ae){this[_0x0fff('0xd')][_0x0fff('0x18')](_0xe89b4a)[_0x0fff('0x12')](function(_0x49d211){_0x4c88ae(null,_0x49d211?_0x49d211['dsn']:![]);})[_0x0fff('0x16')](function(_0x330e29){_0x4c88ae(_0x330e29);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x19')]=function(_0x502393,_0x155132){this[_0x0fff('0xd')][_0x0fff('0x1a')](_0x502393)[_0x0fff('0x12')](function(_0x16e7f4){_0x155132(null,_0x16e7f4?_0x16e7f4[_0x0fff('0x13')]:![]);})['catch'](function(_0x6a116c){_0x155132(_0x6a116c);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x1b')]=function(_0x24cd18,_0x11ac00){this[_0x0fff('0xd')]['getTrunkById'](_0x24cd18)[_0x0fff('0x12')](function(_0x87b3a6){_0x11ac00(null,_0x87b3a6?_0x87b3a6[_0x0fff('0x13')]:![]);})[_0x0fff('0x16')](function(_0x36d268){_0x11ac00(_0x36d268);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x1c')]=function(_0x3e6fef,_0x44e54a){var _0xc32a61=this;this[_0x0fff('0xd')][_0x0fff('0x1d')](_0x3e6fef)['then'](function(_0x7046a3){_0x44e54a(null,_0x7046a3?_0xc32a61[_0x0fff('0x1e')](_0x7046a3[_0x0fff('0x1f')]):![]);})[_0x0fff('0x16')](function(_0x1f643d){_0x44e54a(_0x1f643d);});};AGIVertices[_0x0fff('0xf')]['getMailAccount']=function(_0x31f9a4,_0xa16c29){this[_0x0fff('0xd')]['getMailAccountById'](_0x31f9a4)[_0x0fff('0x12')](function(_0x3fa6fc){_0xa16c29(null,_0x3fa6fc?_0x3fa6fc:![]);})['catch'](function(_0x3daf51){_0xa16c29(_0x3daf51);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x20')]=function(_0x15ae24,_0x25ab2a,_0x263e9e){this[_0x0fff('0xe')][_0x0fff('0x20')](_0x15ae24,_0x25ab2a)[_0x0fff('0x12')](function(){_0x263e9e(null);})[_0x0fff('0x16')](function(_0x58469b){_0x263e9e(_0x58469b);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x21')]=function(_0x2b5a2a,_0x1bbb9e){this[_0x0fff('0xd')]['getIntervalById'](_0x2b5a2a)['then'](function(_0x316057){if(_0x316057){if(_0x316057[_0x0fff('0x22')]){_0x1bbb9e(null,[_0x316057[_0x0fff('0x23')]]);}else{_0x1bbb9e(null,_[_0x0fff('0x24')](_0x316057['Intervals'],_0x0fff('0x23')));}}else{_0x1bbb9e(null,![]);}})[_0x0fff('0x16')](function(_0x13347d){_0x1bbb9e(_0x13347d);});};AGIVertices[_0x0fff('0xf')]['getSoundPath']=function(_0x36a233){return util[_0x0fff('0x25')](_0x0fff('0x26'),FILES_PATH,_0x36a233);};AGIVertices[_0x0fff('0xf')][_0x0fff('0x27')]=function(_0x43af7a,_0x1a381b,_0x384f76){odbc[_0x0fff('0x28')](_0x43af7a,function(_0x388193){if(_0x388193){logger[_0x0fff('0x29')](_0x0fff('0x2a'),_0x388193);_0x384f76(_0x388193);}else{logger['info'](_0x0fff('0x2b'));odbc[_0x0fff('0x2c')](_0x1a381b,function(_0x45ba02,_0x312b0d){if(_0x45ba02){logger[_0x0fff('0x2d')](_0x0fff('0x2e'),_0x1a381b);_0x384f76(_0x45ba02);}else{logger['info'](_0x0fff('0x2f'),_0x1a381b);odbc[_0x0fff('0x30')](function(_0x8e13e7){if(_0x8e13e7){logger[_0x0fff('0x29')](_0x0fff('0x31'),_0x8e13e7);}_0x384f76(null,_0x312b0d);});}});}});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x32')]=function(_0x425ec1,_0x28e0aa){this['rpc'][_0x0fff('0x33')](_0x425ec1)['then'](function(_0x28a8b7){_0x28e0aa(null,_0x28a8b7?_0x28a8b7:![]);})[_0x0fff('0x16')](function(_0x126f6a){_0x28e0aa(_0x126f6a);});};AGIVertices['prototype']['createSmsMessage']=function(_0x91411b,_0x9470f){this[_0x0fff('0xd')]['createSmsMessage'](_0x91411b)['then'](function(_0x4668b3){_0x9470f(null,_0x4668b3);})['catch'](function(_0xd6ebeb){_0x9470f(_0xd6ebeb);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x34')]=function(_0x309d75,_0x395923,_0x26fc5f){this['rpc'][_0x0fff('0x34')]({'uniqueid':this[_0x0fff('0x35')][_0x0fff('0x36')],'node':_0x309d75[_0x0fff('0x37')],'application':_0x309d75[_0x0fff('0x38')],'data':_0x395923||null,'project_name':this[_0x0fff('0x35')][_0x0fff('0x39')],'callerid':this['channel'][_0x0fff('0x3a')]})[_0x0fff('0x12')](function(_0x101b3a){if(_0x26fc5f){_0x26fc5f(null,_0x101b3a);}})['catch'](function(_0x2de540){if(_0x26fc5f){_0x26fc5f(_0x2de540);}});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x3b')]=function(_0x1fbbbf,_0x3c5cc0,_0x451b47,_0x2f73cf){this[_0x0fff('0xd')][_0x0fff('0x3b')]({'uniqueid':this[_0x0fff('0x35')][_0x0fff('0x36')],'callerid':this['channel'][_0x0fff('0x3a')],'calleridname':this[_0x0fff('0x35')]['calleridname'],'context':this[_0x0fff('0x35')][_0x0fff('0x3c')],'extension':this[_0x0fff('0x35')]['extension'],'priority':this['channel'][_0x0fff('0x3d')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x0fff('0x35')][_0x0fff('0x3e')],'projectName':this[_0x0fff('0x35')][_0x0fff('0x39')],'saveName':_0x3c5cc0,'filename':_0x1fbbbf[_0x0fff('0x3f')]||_0x3c5cc0,'savePath':_0x451b47})[_0x0fff('0x12')](function(_0x552440){_0x2f73cf(null,_0x552440);})[_0x0fff('0x16')](function(_0x3ee3e3){_0x2f73cf(_0x3ee3e3);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x40')]=function(_0x30c4d6,_0x2c725c,_0x5d1739,_0x17cc91,_0x356337){this['rpc'][_0x0fff('0x40')]({'uniqueid':this['channel']['uniqueid'],'body':_0x30c4d6,'direction':_0x2c725c,'providerName':_0x5d1739,'providerResponse':_0x17cc91})['then'](function(_0x218e1c){if(_0x356337){_0x356337(null,_0x218e1c);}})[_0x0fff('0x16')](function(_0x15f725){if(_0x356337){_0x356337(_0x15f725);}});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x41')]=function(_0x4bf98d,_0x2524ad){this[_0x0fff('0xd')][_0x0fff('0x41')]({'firstName':_[_0x0fff('0x42')](_0x4bf98d[_0x0fff('0x13')])||_['isNil'](_0x4bf98d[_0x0fff('0x13')])?_0x0fff('0x43')+Math[_0x0fff('0x44')]():_0x4bf98d[_0x0fff('0x13')],'lastName':_[_0x0fff('0x42')](_0x4bf98d[_0x0fff('0x45')])||_[_0x0fff('0x46')](_0x4bf98d[_0x0fff('0x45')])?null:_0x4bf98d[_0x0fff('0x45')],'phone':_0x4bf98d[_0x0fff('0x47')],'ListId':_0x4bf98d[_0x0fff('0x48')],'scheduledat':_0x4bf98d[_0x0fff('0x49')],'callbackUniqueid':this[_0x0fff('0x35')][_0x0fff('0x36')],'tags':_0x0fff('0x4a'),'description':_0x0fff('0x4b')+_0x4bf98d[_0x0fff('0x49')][_0x0fff('0x4c')](),'priority':_0x4bf98d[_0x0fff('0x4d')]})[_0x0fff('0x12')](function(_0x18c853){_0x2524ad(null,_0x18c853);})['catch'](function(_0x25d696){_0x2524ad(_0x25d696);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x4e')]=function(_0x2744b4,_0x57d568){this[_0x0fff('0xd')]['getPauseById'](_0x2744b4)[_0x0fff('0x12')](function(_0x1f216d){_0x57d568(null,_0x1f216d?_0x1f216d[_0x0fff('0x13')]:![]);})[_0x0fff('0x16')](function(_0x4bf865){_0x57d568(_0x4bf865);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x4f')]=function(_0xd781d3,_0x226d6d,_0x4cf619){var _0x5ba7e7={'role':_0x0fff('0x50')};_0x5ba7e7[_0xd781d3]=this[_0x0fff('0x35')][_0x0fff('0x3a')];this[_0x0fff('0xd')][_0x0fff('0x4f')](_0x5ba7e7,_0x226d6d,this[_0x0fff('0x35')]['uniqueid'])['then'](function(_0x1efc0f){_0x4cf619(null,_[_0x0fff('0x46')](_0x1efc0f)?![]:!![]);})[_0x0fff('0x16')](function(_0x33bff0){logger[_0x0fff('0x29')](_0x33bff0);_0x4cf619(null,![]);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x51')]=function(_0x40e5ec,_0x5f2fcc){var _0x12fe95={'role':'agent'};_0x12fe95[_0x40e5ec]=this[_0x0fff('0x35')][_0x0fff('0x3a')];this[_0x0fff('0xd')]['agentUnpause'](_0x12fe95)['then'](function(_0x139cb3){_0x5f2fcc(null,_['isNil'](_0x139cb3)?![]:!![]);})[_0x0fff('0x16')](function(_0x5ce7ac){logger[_0x0fff('0x29')](_0x5ce7ac);_0x5f2fcc(null,![]);});};AGIVertices[_0x0fff('0xf')]['agentLogout']=function(_0x3e04df,_0x2c6e89){var _0x57a504={'role':_0x0fff('0x50')};_0x57a504[_0x3e04df]=this[_0x0fff('0x35')][_0x0fff('0x3a')];this['rpc'][_0x0fff('0x52')](_0x57a504)[_0x0fff('0x12')](function(_0x1414af){_0x2c6e89(null,_[_0x0fff('0x46')](_0x1414af)?![]:!![]);})[_0x0fff('0x16')](function(_0xf4fb1e){logger[_0x0fff('0x29')](_0xf4fb1e);_0x2c6e89(null,![]);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x53')]=function(_0x31848c,_0x1a5988){var _0x23d04a={'role':'agent'};_0x23d04a[_0x31848c]=this['channel'][_0x0fff('0x3a')];var _0x59c65a=_0x31848c!='internal'?util[_0x0fff('0x25')](_0x0fff('0x54'),_0x0fff('0x55'),this['channel']['callerid']):undefined;this[_0x0fff('0xd')][_0x0fff('0x53')](_0x23d04a,_0x59c65a)[_0x0fff('0x12')](function(_0x2586c6){_0x1a5988(null,_['isNil'](_0x2586c6)?![]:!![]);})[_0x0fff('0x16')](function(_0xec4e30){logger[_0x0fff('0x29')](_0xec4e30);_0x1a5988(null,![]);});};AGIVertices[_0x0fff('0xf')]['shellCommand']=function(_0x2b5d13,_0x1858fb){sh['exec'](_['trim'](_0x2b5d13),function(_0x33ed23,_0x1dac18){var _0x2e91e0=_0x1dac18[_0x0fff('0x56')](/(\r\n|\n|\r)/gm,'');_0x1858fb(null,_0x2e91e0);});};AGIVertices[_0x0fff('0xf')]['googleCloudTTS']=function(_0x27cb67,_0x7b040){scripts[_0x0fff('0x57')](_0x27cb67[_0x0fff('0x58')],_0x27cb67[_0x0fff('0x59')]||'text',_0x27cb67['text'],_0x27cb67[_0x0fff('0x5a')]||'en-US',_0x27cb67[_0x0fff('0x5b')]||_0x0fff('0x5c'),_0x27cb67[_0x0fff('0x5d')]||_0x0fff('0x5e'))[_0x0fff('0x12')](function(_0x5b5ff7){_0x7b040(null,_0x5b5ff7);})[_0x0fff('0x16')](function(_0x191872){_0x7b040(_0x191872);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x5f')]=function(_0x31ff4e,_0x15ab8e){scripts[_0x0fff('0x5f')](_0x31ff4e[_0x0fff('0x60')],_0x31ff4e[_0x0fff('0x61')]||'en',0x1)[_0x0fff('0x12')](function(_0x5c6063){_0x15ab8e(null,_0x5c6063);})['catch'](function(_0x134012){_0x15ab8e(_0x134012);});};AGIVertices[_0x0fff('0xf')]['restAPI']=function(_0x11a5b8,_0x495bf7){var _0x27dc72={'uri':_0x11a5b8[_0x0fff('0x62')],'method':_0x11a5b8[_0x0fff('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x11a5b8[_0x0fff('0x64')])===_0x0fff('0x65')&&parseInt(_0x11a5b8['timeout'])>=0x1?parseInt(_0x11a5b8[_0x0fff('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x0fff('0x66')](['POST',_0x0fff('0x67')],_0x27dc72[_0x0fff('0x63')][_0x0fff('0x68')]())){try{_0x27dc72['body']=_0x11a5b8[_0x0fff('0x69')]?JSON[_0x0fff('0x6a')](_0x11a5b8['rawBody']):{};}catch(_0x567544){logger[_0x0fff('0x29')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x567544);}}try{_0x27dc72['headers']=_0x11a5b8[_0x0fff('0xa')]?JSON[_0x0fff('0x6a')](_0x11a5b8[_0x0fff('0xa')]):{};}catch(_0x47b5d0){logger['error'](_0x0fff('0x6b'),_0x47b5d0);}if(_0x11a5b8['computedVariables']){try{var _0x326f19=require(_0x11a5b8[_0x0fff('0x6c')])[_0x0fff('0x6d')](this,_0x27dc72);_0x27dc72[_0x0fff('0x6e')]=Mustache[_0x0fff('0x6f')](_0x11a5b8[_0x0fff('0x62')],_0x326f19,{},['$$','$$']);if(_0x27dc72[_0x0fff('0x70')]){_0x27dc72['headers']=JSON[_0x0fff('0x6a')](Mustache[_0x0fff('0x6f')](JSON[_0x0fff('0x71')](_0x27dc72[_0x0fff('0x70')]),_0x326f19,{},['$$','$$']));}if(_0x27dc72[_0x0fff('0x72')]){_0x27dc72[_0x0fff('0x72')]=JSON['parse'](Mustache[_0x0fff('0x6f')](JSON['stringify'](_0x27dc72[_0x0fff('0x72')]),_0x326f19,{},['$$','$$']));}}catch(_0xa932e2){logger[_0x0fff('0x29')](_0x0fff('0x73'),_0xa932e2);}}rp(_0x27dc72)['then'](function(_0x4fc7c7){var _0x34dd99={'statusCode':_0x4fc7c7['statusCode']||0xc8,'statusMessage':_0x4fc7c7[_0x0fff('0x74')]||'OK','headers':_0x4fc7c7[_0x0fff('0x70')]||{},'body':_0x4fc7c7['body']||{}};_0x495bf7(null,_0x34dd99);})['catch'](function(_0x36cc4e){var _0x898a3c={'statusCode':_0x36cc4e[_0x0fff('0x75')]||0x1f4,'statusMessage':_0x36cc4e[_0x0fff('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x36cc4e[_0x0fff('0x77')]['headers']||{},'body':_0x36cc4e[_0x0fff('0x77')][_0x0fff('0x72')]||{}};_0x495bf7(null,_0x898a3c);});};AGIVertices[_0x0fff('0xf')]['googleDialogflow']=function(_0x5930bf,_0x493bf0){scripts[_0x0fff('0x78')](this['channel'][_0x0fff('0x36')],_0x5930bf[_0x0fff('0x79')],_0x5930bf[_0x0fff('0x60')],_0x5930bf[_0x0fff('0x7a')]||'en')[_0x0fff('0x12')](function(_0x171e29){_0x493bf0(null,_0x171e29);})[_0x0fff('0x16')](function(_0x28d073){_0x493bf0(_0x28d073);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x7b')]=function(_0x1db804,_0x55a9d2){scripts[_0x0fff('0x7b')](this[_0x0fff('0x35')][_0x0fff('0x36')],_0x1db804[_0x0fff('0x7c')],_0x1db804[_0x0fff('0x7d')],_0x1db804['private_key'],_0x1db804[_0x0fff('0x60')],_0x1db804[_0x0fff('0x7e')]||'en')['then'](function(_0x35559c){_0x55a9d2(null,_0x35559c);})[_0x0fff('0x16')](function(_0x45fe6e){_0x55a9d2(_0x45fe6e);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x7f')]=function(_0x2b1688,_0xe06663){scripts[_0x0fff('0x7f')](this[_0x0fff('0x35')],_0x2b1688)[_0x0fff('0x12')](function(_0x48a2ab){_0xe06663(null,_0x48a2ab);})[_0x0fff('0x16')](function(_0x42ddee){_0xe06663(_0x42ddee);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x80')]=function(_0x4a00fb,_0x2fdf96){scripts[_0x0fff('0x80')](_0x4a00fb['key'],_0x4a00fb[_0x0fff('0x60')],_0x4a00fb['ispeech_tts_language']||_0x0fff('0x81'),_0x4a00fb[_0x0fff('0x82')])[_0x0fff('0x12')](function(_0x8ff121){_0x2fdf96(null,_0x8ff121);})[_0x0fff('0x16')](function(_0x4cb7cc){_0x2fdf96(_0x4cb7cc);});};AGIVertices[_0x0fff('0xf')]['ispeechASR']=function(_0x579094,_0x431b4d,_0x173b44){scripts[_0x0fff('0x83')](_0x431b4d,_0x579094[_0x0fff('0x79')],_0x579094[_0x0fff('0x84')]||_0x0fff('0x81'),this['isConfigured'](_0x579094['model'])?_0x579094['model']:undefined)[_0x0fff('0x12')](function(_0x41b755){_0x173b44(null,_0x41b755);})[_0x0fff('0x16')](function(_0x506156){_0x173b44(_0x506156);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x85')]=function(_0x2138c3,_0x352e91){scripts[_0x0fff('0x85')](_0x2138c3[_0x0fff('0x86')],_0x2138c3[_0x0fff('0x87')],_0x2138c3[_0x0fff('0x88')],_0x2138c3[_0x0fff('0x89')]||_0x0fff('0x8a'),_0x2138c3[_0x0fff('0x60')],_0x2138c3[_0x0fff('0x8b')]||_0x0fff('0x60'))['then'](function(_0x42c282){_0x352e91(null,_0x42c282);})[_0x0fff('0x16')](function(_0x3bea4b){_0x352e91(_0x3bea4b);});};AGIVertices[_0x0fff('0xf')][_0x0fff('0x8c')]=function(_0x1b48f3,_0xddc066){scripts['awsLex'](this[_0x0fff('0x35')][_0x0fff('0x36')],_0x1b48f3['aws_access_key_id'],_0x1b48f3[_0x0fff('0x87')],_0x1b48f3['aws_lex_region'],_0x1b48f3[_0x0fff('0x60')],_0x1b48f3[_0x0fff('0x8d')])['then'](function(_0x4e819f){_0xddc066(null,_0x4e819f);})['catch'](function(_0x22da86){_0xddc066(_0x22da86);});};AGIVertices['prototype']['googleASR']=function(_0x59774e,_0x533ce4,_0x194d74){scripts['googleASR'](_0x533ce4,_0x59774e[_0x0fff('0x79')],_0x59774e['google_asr_language']||_0x0fff('0x81'))['then'](function(_0x465dde){_0x194d74(null,_0x465dde);})[_0x0fff('0x16')](function(_0x49cd34){_0x194d74(_0x49cd34);});};AGIVertices['prototype'][_0x0fff('0x8e')]=function(_0x361233,_0x199c8b,_0x3fe2ce){scripts[_0x0fff('0x8e')](_0x199c8b,_0x361233[_0x0fff('0x8f')],_0x361233[_0x0fff('0x90')],_0x361233['uri'])[_0x0fff('0x12')](function(_0x1b653a){_0x3fe2ce(null,_0x1b653a);})[_0x0fff('0x16')](function(_0x8ef733){_0x3fe2ce(_0x8ef733);});};AGIVertices['prototype'][_0x0fff('0x91')]=function(_0x1d1264){var _0x5bf8ad=_['includes'](verticesWithRetry,_0x1d1264['agicommand'])?_0x1d1264:_[_0x0fff('0x92')](_0x1d1264);for(var _0x37b5b4 in _0x5bf8ad){if(_0x5bf8ad['hasOwnProperty'](_0x37b5b4)){if(_0x5bf8ad[_0x37b5b4]&&_[_0x0fff('0x93')](_0x5bf8ad[_0x37b5b4])){if(_[_0x0fff('0x66')](recursiveMapAttributes,_0x37b5b4)){_0x5bf8ad[_0x37b5b4]=this['replaceObjectAllVariables'](_0x5bf8ad[_0x37b5b4]);}else{_0x5bf8ad[_0x37b5b4]=this[_0x0fff('0x94')](_0x5bf8ad[_0x37b5b4]);}}}}return _0x5bf8ad;};AGIVertices[_0x0fff('0xf')][_0x0fff('0x95')]=function(_0x49da45){for(var _0x4cdaaf in _0x49da45){if(_0x49da45[_0x0fff('0x96')](_0x4cdaaf)){if(_[_0x0fff('0x97')](_0x49da45[_0x4cdaaf])){this['recursiveNodeIndex'](_0x49da45[_0x4cdaaf]);}else if(_[_0x0fff('0x98')](_0x49da45[_0x4cdaaf])){for(var _0x198ca4=0x0;_0x198ca4<_0x49da45[_0x4cdaaf][_0x0fff('0x99')];_0x198ca4++){this[_0x0fff('0x95')](_0x49da45[_0x4cdaaf][_0x198ca4]);}}else if(_[_0x0fff('0x93')](_0x49da45[_0x4cdaaf])){_0x49da45[_0x4cdaaf]=this[_0x0fff('0x94')](_0x49da45[_0x4cdaaf]);}}}};AGIVertices[_0x0fff('0xf')][_0x0fff('0x9a')]=function(_0x327b5,_0x320c2d){for(var _0x10aa61 in _0x327b5){if(_0x327b5[_0x0fff('0x96')](_0x10aa61)){if(_['isPlainObject'](_0x327b5[_0x10aa61])){if(!_[_0x0fff('0x42')](_0x327b5[_0x10aa61])){this['saveRestApiResult'](_0x327b5[_0x10aa61],util[_0x0fff('0x25')]('%s.%s',_0x320c2d,_0x10aa61));}}else if(_[_0x0fff('0x98')](_0x327b5[_0x10aa61])){for(var _0x5336=0x0;_0x5336<_0x327b5[_0x10aa61][_0x0fff('0x99')];_0x5336++){this[_0x0fff('0x9a')](_0x327b5[_0x10aa61][_0x5336],util[_0x0fff('0x25')](_0x0fff('0x9b'),_0x320c2d,_0x10aa61+'['+_0x5336+']'));}}else{if(!_['isNil'](_0x327b5[_0x10aa61])){this[_0x0fff('0x35')][_0x0fff('0x9c')](util['format'](_0x0fff('0x9b'),_0x320c2d,_0x10aa61),_0x327b5[_0x10aa61]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x420b4b){try{var _0x2e38c3=JSON[_0x0fff('0x6a')](_0x420b4b);this[_0x0fff('0x95')](_0x2e38c3);return JSON[_0x0fff('0x71')](_0x2e38c3);}catch(_0x411822){return this['replaceAllVariables'](_0x420b4b);}};AGIVertices[_0x0fff('0xf')][_0x0fff('0x94')]=function(_0x336fd9){var _0x2c9588=_0x336fd9[_0x0fff('0x9d')]('{');for(var _0x5cb750=0x1;_0x5cb750<_0x2c9588[_0x0fff('0x99')];_0x5cb750+=0x1){var _0xf73eb6=_0x2c9588[_0x5cb750][_0x0fff('0x9d')]('}');if(_0xf73eb6[_0x0fff('0x99')]>0x1){_0x336fd9=_0x336fd9[_0x0fff('0x9e')]('{'+_0xf73eb6[0x0]+'}',this[_0x0fff('0x35')][_0x0fff('0x10')](_0xf73eb6[0x0])['extra']||_0xf73eb6[0x0]);}}if(_0x2c9588['length']===0x1){return _0x336fd9[_0x0fff('0x4c')]();}return this['replaceAllVariables'](_0x336fd9);};AGIVertices[_0x0fff('0xf')]['getAndSetVariable']=function(_0x5f00ee,_0x592341){var _0x2e1625=this[_0x0fff('0x35')][_0x0fff('0x10')](_0x5f00ee);if(_0x2e1625[_0x0fff('0x9f')]===-0x1){return _0x2e1625;}logger[_0x0fff('0x2d')](util['format'](_0x0fff('0xa0'),_0x592341,_0x2e1625[_0x0fff('0xa1')]));return this[_0x0fff('0x35')][_0x0fff('0x9c')](_0x592341,_0x2e1625[_0x0fff('0xa1')]);};AGIVertices[_0x0fff('0xf')][_0x0fff('0xa2')]=function(_0x115445){return _0x115445&&_0x115445!=='0'&&_0x115445!=='-1'&&_0x115445!=='';};AGIVertices['prototype']['maxRetry']=function(_0x1f1946){this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x1f1946,'-');_0x1f1946['retry']=_0x1f1946[_0x0fff('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0fff('0xf')][_0x0fff('0xa4')]=function(_0x59f078){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xa5'),_0x59f078[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x59f078[_0x0fff('0x60')])){return this[_0x0fff('0x35')]['noop']('no\x20text\x20configured');}var _0x4a70ee='\x22'+_0x59f078[_0x0fff('0x60')]+'\x22';if(this[_0x0fff('0xa2')](_0x59f078[_0x0fff('0x77')])){_0x4a70ee+=','+_0x59f078[_0x0fff('0x77')];}var _0x41d09a=this[_0x0fff('0x35')]['exec'](_0x0fff('0xa6'),_0x4a70ee);if(_0x41d09a[_0x0fff('0x9f')]===-0x1){return _0x41d09a;}return this[_0x0fff('0x35')]['noop'](util['format'](_0x0fff('0xa7'),_0x4a70ee));};AGIVertices['prototype'][_0x0fff('0xa8')]=function(_0x15ed92){logger['info'](util[_0x0fff('0x25')](_0x0fff('0xa9'),_0x15ed92['label']));if(!this[_0x0fff('0xa2')](_0x15ed92[_0x0fff('0xaa')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xac'));}var _0x2cc1cc=_0x15ed92['grammar'];if(this[_0x0fff('0xa2')](_0x15ed92['options'])){_0x2cc1cc+=','+_0x15ed92[_0x0fff('0x77')];}var _0x5030a9=this[_0x0fff('0x35')]['exec'](_0x0fff('0xad'),_0x2cc1cc);if(_0x5030a9[_0x0fff('0x9f')]===-0x1){return _0x5030a9;}var _0x1d7516=this['getAndSetVariable'](_0x0fff('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x1d7516[_0x0fff('0x9f')]===-0x1){return _0x1d7516;}var _0x677458=this[_0x0fff('0xaf')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x677458[_0x0fff('0x9f')]===-0x1){return _0x677458;}var _0x30a237=this['getAndSetVariable']('RECOG_INSTANCE()',_0x0fff('0xb0'));if(_0x30a237[_0x0fff('0x9f')]===-0x1){return _0x30a237;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2cc1cc));};AGIVertices[_0x0fff('0xf')]['agi']=function(_0x7aee17){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xb1'),_0x7aee17['label']));return this[_0x0fff('0x35')]['agi']([_0x7aee17[_0x0fff('0xb2')],_0x7aee17[_0x0fff('0xb3')]]);};AGIVertices[_0x0fff('0xf')][_0x0fff('0xb4')]=function(_0x1330c9){logger['info'](util['format'](_0x0fff('0xb5'),_0x1330c9[_0x0fff('0x37')]));if(this[_0x0fff('0xa2')](_0x1330c9['timeout'])){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xb6'),_0x1330c9['timeout']));var _0x3a8267=this['channel'][_0x0fff('0xb7')](_0x1330c9[_0x0fff('0x64')]);if(_0x3a8267[_0x0fff('0x9f')]===-0x1){return _0x3a8267;}}return this[_0x0fff('0x35')][_0x0fff('0xb4')]();};AGIVertices[_0x0fff('0xf')][_0x0fff('0x4a')]=function(_0x463037){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x463037[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x463037[_0x0fff('0x48')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x463037,_0x0fff('0xb8'));}_0x463037['scheduledAt']=moment();if(this['isConfigured'](_0x463037[_0x0fff('0xb9')])){_0x463037['scheduledAt']=moment()[_0x0fff('0xba')](_0x463037[_0x0fff('0xb9')],'minutes');}if(!this[_0x0fff('0xa2')](_0x463037['callback_priority'])){_0x463037[_0x0fff('0x4d')]=0x2;}this['createCmContact']['sync'](this,_0x463037);return this['channel']['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x463037[_0x0fff('0x47')],_0x463037[_0x0fff('0x48')],_0x463037[_0x0fff('0x49')]));};AGIVertices[_0x0fff('0xf')]['custom_app']=function(_0x1a9eca){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1a9eca[_0x0fff('0x37')]));var _0x5bed22=this['channel']['exec'](_0x1a9eca[_0x0fff('0xbb')],_0x1a9eca[_0x0fff('0x77')]);if(_0x5bed22[_0x0fff('0x9f')]===-0x1){return _0x5bed22;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xbc'),_0x1a9eca[_0x0fff('0xbb')],_0x1a9eca[_0x0fff('0x77')]));};AGIVertices[_0x0fff('0xf')][_0x0fff('0xbd')]=function(_0x51c5ac){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x51c5ac['label']));if(!this['isConfigured'](_0x51c5ac[_0x0fff('0x60')])){return this['channel'][_0x0fff('0xab')]('no\x20text\x20configured');}var _0x55c429='\x22'+_0x51c5ac['text']+'\x22';if(this[_0x0fff('0xa2')](_0x51c5ac[_0x0fff('0x77')])){_0x55c429+=','+_0x51c5ac[_0x0fff('0x77')];}var _0x2d1d2f=this['channel'][_0x0fff('0xbe')](_0x0fff('0xa6'),_0x55c429);if(_0x2d1d2f[_0x0fff('0x9f')]===-0x1){return _0x2d1d2f;}return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0xa7'),_0x55c429));};AGIVertices[_0x0fff('0xf')]['sestektts']=function(_0x473080){logger['info'](util[_0x0fff('0x25')](_0x0fff('0xbf'),_0x473080[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x473080['text'])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0xc0'));}var _0x31f36d='\x22'+_0x473080[_0x0fff('0x60')]+'\x22';if(this[_0x0fff('0xa2')](_0x473080[_0x0fff('0x77')])){_0x31f36d+=','+_0x473080[_0x0fff('0x77')];}var _0x1610f6=this['channel'][_0x0fff('0xbe')](_0x0fff('0xa6'),_0x31f36d);if(_0x1610f6['result']===-0x1){return _0x1610f6;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xa7'),_0x31f36d));};AGIVertices[_0x0fff('0xf')][_0x0fff('0xc1')]=function(_0x32f1e1){logger['info'](util['format'](_0x0fff('0xc2'),_0x32f1e1['label']));if(!this[_0x0fff('0xa2')](_0x32f1e1[_0x0fff('0xaa')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xac'));}var _0x2eeb15=_0x32f1e1[_0x0fff('0xaa')];if(this[_0x0fff('0xa2')](_0x32f1e1[_0x0fff('0x77')])){_0x2eeb15+=','+_0x32f1e1[_0x0fff('0x77')];}var _0x3d26cd=this[_0x0fff('0x35')][_0x0fff('0xbe')](_0x0fff('0xad'),_0x2eeb15);if(_0x3d26cd['result']===-0x1){return _0x3d26cd;}var _0x1d22a6=this[_0x0fff('0xaf')](_0x0fff('0xae'),_0x0fff('0xc3'));if(_0x1d22a6[_0x0fff('0x9f')]===-0x1){return _0x1d22a6;}var _0xd38d3=this['getAndSetVariable'](_0x0fff('0xc4'),_0x0fff('0xc5'));if(_0xd38d3[_0x0fff('0x9f')]===-0x1){return _0xd38d3;}var _0x2bbdd7=this['getAndSetVariable']('RECOG_INSTANCE()',_0x0fff('0xc6'));if(_0x2bbdd7[_0x0fff('0x9f')]===-0x1){return _0x2bbdd7;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x2eeb15));};AGIVertices[_0x0fff('0xf')][_0x0fff('0xc7')]=function(_0x422a02){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0xc8'),_0x422a02[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x422a02[_0x0fff('0xaa')])){return this['channel'][_0x0fff('0xab')](_0x0fff('0xac'));}var _0x2b685f=_0x422a02[_0x0fff('0xaa')];if(this['isConfigured'](_0x422a02['options'])){_0x2b685f+=','+_0x422a02[_0x0fff('0x77')];}var _0x370d1d=this['channel'][_0x0fff('0xbe')](_0x0fff('0xad'),_0x2b685f);if(_0x370d1d[_0x0fff('0x9f')]===-0x1){return _0x370d1d;}var _0x5cf1de=this[_0x0fff('0xaf')]('RECOG_CONFIDENCE()',_0x0fff('0xc9'));if(_0x5cf1de['result']===-0x1){return _0x5cf1de;}var _0x2dede8=this[_0x0fff('0xaf')](_0x0fff('0xc4'),_0x0fff('0xca'));if(_0x2dede8['result']===-0x1){return _0x2dede8;}var _0x506e95=this['getAndSetVariable']('RECOG_INSTANCE()',_0x0fff('0xcb'));if(_0x506e95[_0x0fff('0x9f')]===-0x1){return _0x506e95;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xcc'),_0x2b685f));};AGIVertices['prototype'][_0x0fff('0xcd')]=function(_0x211fca){logger['info'](util[_0x0fff('0x25')](_0x0fff('0xce'),_0x211fca[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x211fca['odbc_id'])){return this['channel']['error'](_0x211fca,_0x0fff('0xcf'));}var _0x12f606=this[_0x0fff('0x17')][_0x0fff('0x6d')](this,_0x211fca[_0x0fff('0xd0')]);if(!_0x12f606){return this['channel']['error'](_0x211fca,_0x0fff('0xd1'));}if(!this['isConfigured'](_0x211fca['query'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x211fca,_0x0fff('0xd2'));}var _0x39c3c8=_0x211fca['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xd3'),_0x39c3c8));var _0x1ccc53=this['getQueryOdbc'][_0x0fff('0x6d')](this,_0x12f606,_0x39c3c8);this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x211fca,_0x39c3c8);if(!this[_0x0fff('0xa2')](_0x211fca[_0x0fff('0xd4')])){return this[_0x0fff('0x35')][_0x0fff('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x47b28a=this[_0x0fff('0x10')][_0x0fff('0x6d')](this,_0x211fca[_0x0fff('0xd4')]);if(!_0x47b28a){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x211fca,'no\x20variable\x20found');}var _0x20969a=this;_0x1ccc53['forEach'](function(_0x16b13e,_0x545149){Object[_0x0fff('0xd5')](_0x16b13e)[_0x0fff('0xd6')](function(_0x1132b4){_0x20969a[_0x0fff('0x35')]['setVariable'](util[_0x0fff('0x25')]('%s[%s][%s]',_0x47b28a,_0x545149,_0x1132b4),_0x16b13e[_0x1132b4]);});});this[_0x0fff('0x35')][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0xd7'),_0x47b28a),_0x1ccc53['length']);return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xd8'),_0x47b28a));};AGIVertices[_0x0fff('0xf')][_0x0fff('0xd9')]=function(_0x4f1bbc){logger[_0x0fff('0xda')](util[_0x0fff('0x25')](_0x0fff('0xdb'),_0x4f1bbc[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x4f1bbc['sip_id'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x4f1bbc,_0x0fff('0xdc'));}var _0x46e5d1=this['getUser'][_0x0fff('0x6d')](this,_0x4f1bbc[_0x0fff('0xdd')]);if(!_0x46e5d1){return this[_0x0fff('0x35')]['error'](_0x4f1bbc,_0x0fff('0xde'));}var _0x109f2a=this[_0x0fff('0x35')][_0x0fff('0xbe')](_0x0fff('0xdf'),[util[_0x0fff('0x25')]('SIP/%s',_0x46e5d1),_0x4f1bbc[_0x0fff('0x64')],_0x4f1bbc[_0x0fff('0xe0')],_0x4f1bbc[_0x0fff('0x62')]]);if(_0x109f2a[_0x0fff('0x9f')]===-0x1){return _0x109f2a;}return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0xe1'),_0x0fff('0xdf')));};AGIVertices[_0x0fff('0xf')][_0x0fff('0xe2')]=function(_0x253ff3){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xe3'),_0x253ff3[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x253ff3[_0x0fff('0x79')])){return this[_0x0fff('0x35')][_0x0fff('0xab')]('no\x20key\x20configured');}if(!this[_0x0fff('0xa2')](_0x253ff3['text'])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xc0'));}this[_0x0fff('0x35')][_0x0fff('0xe4')]=!![];this[_0x0fff('0x34')](_0x253ff3);this['createSquareMessage'](_0x253ff3['text'],'in','','');this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xe5'),_0x253ff3[_0x0fff('0x60')]));var _0x389edb=this[_0x0fff('0x78')]['sync'](this,_0x253ff3);if(_0x389edb){for(var _0x3d916c in _0x389edb){if(_0x389edb[_0x0fff('0x96')](_0x3d916c)){this[_0x0fff('0x35')][_0x0fff('0x9c')](util['format']('DIALOGFLOW_%s',_0x3d916c['toUpperCase']()),_0x389edb[_0x3d916c]);}}this[_0x0fff('0x40')](_0x389edb['speech'],_0x0fff('0xe6'),_0x0fff('0xe2'),'');return this[_0x0fff('0x35')]['noop'](util['format'](_0x0fff('0xe7'),_0x389edb[_0x0fff('0xe8')]));}return this[_0x0fff('0x35')]['error'](_0x253ff3,_0x0fff('0xe9'));};AGIVertices['prototype'][_0x0fff('0xea')]=function(_0x348531){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xeb'),_0x348531[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x348531['dialogflowV2_project_id'])){return this[_0x0fff('0x35')][_0x0fff('0xab')]('no\x20project_id\x20configured');}if(!this[_0x0fff('0xa2')](_0x348531[_0x0fff('0x7d')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0xec'));}if(!this[_0x0fff('0xa2')](_0x348531[_0x0fff('0xed')])){return this['channel'][_0x0fff('0xab')](_0x0fff('0xee'));}if(!this['isConfigured'](_0x348531[_0x0fff('0x7e')])){return this['channel'][_0x0fff('0xab')](_0x0fff('0xef'));}if(!this[_0x0fff('0xa2')](_0x348531[_0x0fff('0x60')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xc0'));}this[_0x0fff('0x35')][_0x0fff('0xe4')]=!![];this[_0x0fff('0x34')](_0x348531);this[_0x0fff('0x40')](_0x348531[_0x0fff('0x60')],'in','','');this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xf0'),_0x348531[_0x0fff('0x60')]));var _0x52d6d4=this[_0x0fff('0x7b')][_0x0fff('0x6d')](this,_0x348531);if(_0x52d6d4){for(var _0x3be37c in _0x52d6d4){if(_0x52d6d4['hasOwnProperty'](_0x3be37c)){if(_0x3be37c!==_0x0fff('0xf1')){this['channel'][_0x0fff('0x9c')](util[_0x0fff('0x25')]('DIALOGFLOW_%s',_0x3be37c[_0x0fff('0x68')]()),_0x52d6d4[_0x3be37c]);}}}this[_0x0fff('0x40')](_0x52d6d4['speech'],_0x0fff('0xe6'),_0x0fff('0xea'),_0x52d6d4[_0x0fff('0xf1')]);return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')]('DialogflowV2\x20Result\x20%s',_0x52d6d4[_0x0fff('0xe8')]));}return this['channel'][_0x0fff('0x29')](_0x348531,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x0fff('0xf')][_0x0fff('0xf2')]=function(_0x253449){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0xf3'),_0x253449[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x253449[_0x0fff('0xf4')])){return this['channel']['noop'](_0x0fff('0xf5'));}if(!this['isConfigured'](_0x253449['username'])){return this['channel'][_0x0fff('0xab')](_0x0fff('0xf6'));}if(!this[_0x0fff('0xa2')](_0x253449['password'])){return this['channel'][_0x0fff('0xab')](_0x0fff('0xf7'));}if(!this['isConfigured'](_0x253449[_0x0fff('0xf8')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xc0'));}this[_0x0fff('0x35')][_0x0fff('0xe4')]=!![];this['createSquareDetailsReport'](_0x253449);this[_0x0fff('0x40')](_0x253449[_0x0fff('0x60')],'in','','');this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xf9'),_0x253449[_0x0fff('0x60')]));var _0x273d66=this['sestekNDA'][_0x0fff('0x6d')](this,_0x253449);if(_0x273d66){for(var _0x483e52 in _0x273d66){if(_0x273d66[_0x0fff('0x96')](_0x483e52)){this[_0x0fff('0x35')][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0xfa'),_0x483e52['toUpperCase']()),_0x273d66[_0x483e52]);}}this[_0x0fff('0x40')](_0x273d66[_0x0fff('0xe8')],_0x0fff('0xe6'),_0x0fff('0xf2'),'');if(_0x273d66[_0x0fff('0xfb')]){this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xfc'),_0x273d66[_0x0fff('0xfb')]));var _0x27ecbb=this[_0x0fff('0x35')]['streamFile'](_0x273d66[_0x0fff('0xfb')]);try{fs['unlink'](_0x273d66['audiofile']+_0x0fff('0xfd'));}catch(_0x550210){logger[_0x0fff('0x29')](_0x550210);}return _0x27ecbb;}else{return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xfe'),_0x273d66[_0x0fff('0xe8')]));}}return this[_0x0fff('0x35')]['error'](_0x253449,_0x0fff('0xff'));};AGIVertices[_0x0fff('0xf')]['end']=function(_0x2cfcf9){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x100'),_0x2cfcf9[_0x0fff('0x37')]));return this['channel']['noop'](_0x0fff('0x101'));};AGIVertices[_0x0fff('0xf')]['ext_dial']=function(_0x2d1a0d){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x102'),_0x2d1a0d[_0x0fff('0x37')]));var _0x420f38='';if(_0x2d1a0d[_0x0fff('0x103')]){if(!this[_0x0fff('0xa2')](_0x2d1a0d[_0x0fff('0x103')])){return this['channel'][_0x0fff('0x29')](_0x2d1a0d,_0x0fff('0x104'));}else{var _0x49eca5=parseInt(_0x2d1a0d[_0x0fff('0x103')],0xa);if(isNaN(_0x49eca5)){_0x420f38=_0x2d1a0d[_0x0fff('0x103')];}else{_0x420f38=this[_0x0fff('0x1b')]['sync'](this,_0x2d1a0d[_0x0fff('0x103')]);if(!_0x420f38){return this['channel']['error'](_0x2d1a0d,_0x0fff('0x105'));}}}}else if(_0x2d1a0d[_0x0fff('0x106')]){_0x420f38=_0x2d1a0d[_0x0fff('0x106')];}else{return this['channel']['error'](_0x2d1a0d,_0x0fff('0x104'));}var _0x5d9286=this[_0x0fff('0x35')]['exec']('DIAL',[util[_0x0fff('0x25')](_0x0fff('0x107'),_0x420f38,_0x2d1a0d['phone']),_0x2d1a0d[_0x0fff('0x64')],_0x2d1a0d[_0x0fff('0xe0')],_0x2d1a0d[_0x0fff('0x62')]]);if(_0x5d9286[_0x0fff('0x9f')]===-0x1){return _0x5d9286;}return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0xe1'),_0x0fff('0xdf')));};AGIVertices['prototype']['finally']=function(_0x9f0fda){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x9f0fda['label']));return this['channel'][_0x0fff('0xab')](_0x0fff('0x108'));};AGIVertices['prototype']['getdigits']=function(_0xf8e46){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x109'),_0xf8e46[_0x0fff('0x37')]));if(_0xf8e46['retry']===0x0){return this['maxRetry'](_0xf8e46);}_0xf8e46[_0x0fff('0x10a')]-=0x1;if(!this[_0x0fff('0xa2')](_0xf8e46[_0x0fff('0x10b')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0xf8e46,_0x0fff('0x10c'));}var _0x2fe9a2=this['getSound'][_0x0fff('0x6d')](this,_0xf8e46['file_id']);if(!_0x2fe9a2){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0xf8e46,_0x0fff('0x10d'));}if(!this[_0x0fff('0xa2')](_0xf8e46[_0x0fff('0xd4')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x0fff('0x10e'));}var _0x496e99=this[_0x0fff('0x35')][_0x0fff('0x10f')](_0x2fe9a2,_0xf8e46[_0x0fff('0x110')],_0xf8e46[_0x0fff('0x111')]);var _0x1dcfe3=_0x496e99[_0x0fff('0x9f')]?_0x496e99[_0x0fff('0x9f')][_0x0fff('0x4c')]():'';logger['info'](_0x0fff('0x112'),JSON[_0x0fff('0x71')](_0x496e99));if(_0x496e99[_0x0fff('0x9f')]===-0x1){this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0xf8e46,_0x1dcfe3);return _0x496e99;}else if(_0x496e99[_0x0fff('0xa1')]==='timeout'){_0x496e99[_0x0fff('0x9f')]=_0x1dcfe3['length']>=parseInt(_0xf8e46[_0x0fff('0x113')])?'x':'i';}else{_0x496e99[_0x0fff('0x9f')]=_0x1dcfe3['length']>=parseInt(_0xf8e46['mindigit'])&&_0x1dcfe3[_0x0fff('0x99')]<=parseInt(_0xf8e46[_0x0fff('0x111')])?'x':'i';}var _0x459ed5=this['getVariable']['sync'](this,_0xf8e46[_0x0fff('0xd4')]);if(!_0x459ed5){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0xf8e46,_0x0fff('0x114'));}this[_0x0fff('0x35')][_0x0fff('0x9c')](_0x459ed5,_0x1dcfe3);if(this[_0x0fff('0xa2')](_0xf8e46['hiddendigitsnum'])){var _0x237aa1=parseInt(_0xf8e46[_0x0fff('0x115')],0xa);var _0x16845b=rs[_0x0fff('0x116')]({'charset':'*','length':_0x237aa1});var _0x1f77ff=_0x1dcfe3[_0x0fff('0x99')];if(_0x1f77ff>0x0){if(_0x1f77ff>_0x237aa1){this['createSquareDetailsReport'][_0x0fff('0x6d')](this,_0xf8e46,_0xf8e46[_0x0fff('0x117')]==='first'?_0x16845b+_0x1dcfe3[_0x0fff('0x118')](_0x237aa1):_0x1dcfe3[_0x0fff('0x118')](0x0,_0x1f77ff-_0x237aa1)+_0x16845b);}else{this[_0x0fff('0x34')]['sync'](this,_0xf8e46,rs['generate']({'charset':'*','length':_0x1f77ff}));}}else{this['createSquareDetailsReport'][_0x0fff('0x6d')](this,_0xf8e46,'');}}else{this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0xf8e46,_0x1dcfe3);}return _0x496e99;};AGIVertices['prototype']['getsecretdigits']=function(_0x5b559f){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x119'),_0x5b559f[_0x0fff('0x37')]));return this[_0x0fff('0x11a')](_0x5b559f);};AGIVertices[_0x0fff('0xf')][_0x0fff('0x11b')]=function(_0x3379b3){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x3379b3[_0x0fff('0x37')]));this['createSquareDetailsReport']['sync'](this,_0x3379b3,_0x3379b3[_0x0fff('0x11c')]);return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x11d'),_0x3379b3[_0x0fff('0x11c')]));};AGIVertices['prototype'][_0x0fff('0x11e')]=function(_0x2c432e){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x11f'),_0x2c432e[_0x0fff('0x37')]));if(!this['isConfigured'](_0x2c432e[_0x0fff('0x86')])||!this['isConfigured'](_0x2c432e[_0x0fff('0x87')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0x120'));}if(!this[_0x0fff('0xa2')](_0x2c432e[_0x0fff('0x60')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0xc0'));}this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x121'),_0x2c432e['text']));var _0x5515ed=this[_0x0fff('0x85')]['sync'](this,_0x2c432e);if(_0x5515ed){this[_0x0fff('0x35')][_0x0fff('0xab')](util['format'](_0x0fff('0x122'),_0x5515ed));var _0xee7bd=this[_0x0fff('0x35')][_0x0fff('0x123')](_0x5515ed);try{fs[_0x0fff('0x124')](_0x5515ed+'.wav');}catch(_0x4644e5){logger[_0x0fff('0x29')](_0x4644e5);}return _0xee7bd;}return this['channel'][_0x0fff('0x29')](_0x2c432e,_0x0fff('0x125'));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x126')]=function(_0x5b15ab){logger['info'](util['format'](_0x0fff('0x127'),_0x5b15ab[_0x0fff('0x37')]));if(!this['isConfigured'](_0x5b15ab[_0x0fff('0x86')])||!this[_0x0fff('0xa2')](_0x5b15ab[_0x0fff('0x87')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0x120'));}if(!this[_0x0fff('0xa2')](_0x5b15ab[_0x0fff('0x8d')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x128'));}if(!this[_0x0fff('0xa2')](_0x5b15ab[_0x0fff('0x60')])){return this['channel'][_0x0fff('0xab')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x0fff('0x34')](_0x5b15ab);this[_0x0fff('0x40')](_0x5b15ab[_0x0fff('0x60')],'in','','');this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0x129'),_0x5b15ab[_0x0fff('0x60')]));var _0x5b7bc1=this[_0x0fff('0x8c')]['sync'](this,_0x5b15ab);if(_0x5b7bc1){for(var _0x1355ee in _0x5b7bc1){if(_0x5b7bc1[_0x0fff('0x96')](_0x1355ee)&&_[_0x0fff('0x93')](_0x5b7bc1[_0x1355ee])){this[_0x0fff('0x35')][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0x12a'),_0x1355ee[_0x0fff('0x68')]()),_0x5b7bc1[_0x1355ee]);}}if(_['isNil'](_0x5b7bc1[_0x0fff('0x76')])){return this[_0x0fff('0x35')][_0x0fff('0xab')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x0fff('0x40')](_0x5b7bc1[_0x0fff('0x76')],_0x0fff('0xe6'),_0x0fff('0x12b'),'');return this[_0x0fff('0x35')][_0x0fff('0xab')](util['format'](_0x0fff('0x12c'),_0x5b7bc1['message']));}}return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x5b15ab,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0fff('0xf')][_0x0fff('0x12d')]=function(_0x5209ca){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5209ca['label'],_0x5209ca[_0x0fff('0x64')]));if(!this[_0x0fff('0xa2')](_0x5209ca['key'])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x12e'));}var _0x3b4c80=_0x0fff('0x12f');var _0x1f2482=util[_0x0fff('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x0fff('0x116')](0x4));var _0x2acd03=util[_0x0fff('0x25')](_0x0fff('0x9b'),_0x1f2482,_0x3b4c80);var _0x523699=!![];if(_0x5209ca[_0x0fff('0x130')]===_0x0fff('0x131')){_0x523699=![];}var _0x32e0e9=this['channel'][_0x0fff('0x132')](_0x1f2482,_0x3b4c80,_0x5209ca[_0x0fff('0x133')],_0x5209ca[_0x0fff('0x64')],undefined,_0x523699);if(_0x32e0e9[_0x0fff('0x9f')]!==-0x1){this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')]('google\x20%s\x20file\x20created',_0x2acd03));var _0x4c3f84=this['googleASR'][_0x0fff('0x6d')](this,_0x5209ca,_0x2acd03);if(_0x4c3f84){for(var _0x2b3df8 in _0x4c3f84){if(_0x4c3f84[_0x0fff('0x96')](_0x2b3df8)){this[_0x0fff('0x35')][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0x134'),_0x2b3df8['toUpperCase']()),_0x4c3f84[_0x2b3df8]);}}return this[_0x0fff('0x35')]['noop'](util['format'](_0x0fff('0x135'),JSON[_0x0fff('0x71')](_0x4c3f84)));}}return _0x32e0e9;};AGIVertices[_0x0fff('0xf')][_0x0fff('0x136')]=function(_0xb88226){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x137'),_0xb88226['label']));if(!this[_0x0fff('0xa2')](_0xb88226[_0x0fff('0x8f')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x138'));}if(!this[_0x0fff('0xa2')](_0xb88226[_0x0fff('0x90')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0x139'));}var _0x264009=_0x0fff('0x12f');var _0x5a14b4=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x0fff('0x116')](0x4));var _0x114e3d=util[_0x0fff('0x25')](_0x0fff('0x9b'),_0x5a14b4,_0x264009);var _0x11de55=!![];if(_0xb88226[_0x0fff('0x130')]===_0x0fff('0x131')){_0x11de55=![];}var _0x52f36f=this[_0x0fff('0x35')][_0x0fff('0x132')](_0x5a14b4,_0x264009,_0xb88226[_0x0fff('0x133')],_0xb88226[_0x0fff('0x64')],undefined,_0x11de55);if(_0x52f36f[_0x0fff('0x9f')]!==-0x1){this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x13a'),_0x114e3d));var _0x38433f=this['tildeASR'][_0x0fff('0x6d')](this,_0xb88226,_0x114e3d);if(_0x38433f){for(var _0x1b5415 in _0x38433f){if(_0x38433f['hasOwnProperty'](_0x1b5415)){this[_0x0fff('0x35')]['setVariable'](util[_0x0fff('0x25')](_0x0fff('0x13b'),_0x1b5415[_0x0fff('0x68')]()),_0x38433f[_0x1b5415]);}}return this[_0x0fff('0x35')][_0x0fff('0xab')](util['format'](_0x0fff('0x13c'),JSON[_0x0fff('0x71')](_0x38433f)));}}return _0x52f36f;};AGIVertices[_0x0fff('0xf')]['gotoc']=function(_0x519315){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x13d'),_0x519315[_0x0fff('0x37')]));return this[_0x0fff('0x35')][_0x0fff('0x13e')](_0x519315[_0x0fff('0x3c')],_0x519315['extension'],_0x519315[_0x0fff('0x3d')]);};AGIVertices[_0x0fff('0xf')]['gotoif']=function(_0x1bf968){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x1bf968['label']));if(!this[_0x0fff('0xa2')](_0x1bf968[_0x0fff('0x13f')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x1bf968,_0x0fff('0x140'));}try{var _0x4016ad=eval(_0x1bf968[_0x0fff('0x13f')])?'true':_0x0fff('0x141');this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x142'),_0x1bf968['condition'],_0x4016ad));return{'code':0xc8,'result':_0x4016ad};}catch(_0x1f417e){return{'code':0xc8,'result':_0x0fff('0x141')};}};AGIVertices[_0x0fff('0xf')]['gotoiftime']=function(_0x33d848){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x143'),_0x33d848[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x33d848[_0x0fff('0x144')])){return this[_0x0fff('0x35')]['error'](_0x33d848,_0x0fff('0x145'));}var _0xd3fbb3=this[_0x0fff('0x21')][_0x0fff('0x6d')](this,_0x33d848[_0x0fff('0x144')]);if(!_0xd3fbb3){return this['channel'][_0x0fff('0x29')](_0x33d848,_0x0fff('0x146'));}for(var _0x489906=0x0;_0x489906<_0xd3fbb3[_0x0fff('0x99')];_0x489906+=0x1){var _0x2c21f2=this[_0x0fff('0x35')][_0x0fff('0x10')](util[_0x0fff('0x25')](_0x0fff('0x147'),_0xd3fbb3[_0x489906]));if(_0x2c21f2[_0x0fff('0x9f')]===-0x1){return _0x2c21f2;}logger[_0x0fff('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0xd3fbb3[_0x489906],_0x2c21f2[_0x0fff('0xa1')]));if(_0x2c21f2[_0x0fff('0xa1')]===_0x0fff('0x148')){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x149'),_0xd3fbb3[_0x489906],_0x0fff('0x148')));this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x149'),_0xd3fbb3[_0x489906],_0x0fff('0x148')));return{'code':0xc8,'result':_0x0fff('0x148')};}else{logger['info'](util[_0x0fff('0x25')](_0x0fff('0x149'),_0xd3fbb3[_0x489906],_0x0fff('0x141')));this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')]('IFTIME\x20%s\x20%s',_0xd3fbb3[_0x489906],_0x0fff('0x141')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x0fff('0xf')][_0x0fff('0x14a')]=function(_0xdd4502){logger[_0x0fff('0x2d')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0xdd4502['label']));return this[_0x0fff('0x35')][_0x0fff('0x14a')]();};AGIVertices['prototype']['ispeechasr']=function(_0x48910f){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x48910f[_0x0fff('0x37')]));if(!this['isConfigured'](_0x48910f['key'])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x12e'));}var _0x1ffe34='wav';var _0x899bd9=util['format'](_0x0fff('0x14b'),FILES_PATH,rs[_0x0fff('0x116')](0x4));var _0xcf4e8d=util[_0x0fff('0x25')](_0x0fff('0x9b'),_0x899bd9,_0x1ffe34);var _0x42f105=!![];if(_0x48910f[_0x0fff('0x130')]===_0x0fff('0x131')){_0x42f105=![];}var _0x43891e=this[_0x0fff('0x35')][_0x0fff('0x132')](_0x899bd9,_0x1ffe34,_0x48910f[_0x0fff('0x133')],_0x48910f[_0x0fff('0x64')],undefined,_0x42f105);if(_0x43891e[_0x0fff('0x9f')]!==-0x1){this[_0x0fff('0x35')][_0x0fff('0xab')](util['format'](_0x0fff('0x14c'),_0xcf4e8d));var _0x14fd5c=this['ispeechASR'][_0x0fff('0x6d')](this,_0x48910f,_0xcf4e8d);if(_0x14fd5c){for(var _0x182a8c in _0x14fd5c){if(_0x14fd5c[_0x0fff('0x96')](_0x182a8c)){this[_0x0fff('0x35')][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0x14d'),_0x182a8c['toUpperCase']()),_0x14fd5c[_0x182a8c]);}}return this[_0x0fff('0x35')][_0x0fff('0xab')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x0fff('0x71')](_0x14fd5c)));}}return _0x43891e;};AGIVertices[_0x0fff('0xf')][_0x0fff('0x14e')]=function(_0x139c76){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x14f'),_0x139c76['label']));if(!this['isConfigured'](_0x139c76[_0x0fff('0x79')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x12e'));}if(!this[_0x0fff('0xa2')](_0x139c76['text'])){return this['channel']['noop'](_0x0fff('0xc0'));}this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0x150'),_0x139c76[_0x0fff('0x60')]));var _0x53563c=this[_0x0fff('0x80')]['sync'](this,_0x139c76);if(_0x53563c){this['channel']['noop'](util[_0x0fff('0x25')](_0x0fff('0x14c'),_0x53563c));var _0x446bc2=this['channel'][_0x0fff('0x123')](_0x53563c,_0x139c76[_0x0fff('0x133')]);try{fs['unlink'](_0x53563c+_0x0fff('0xfd'));}catch(_0xc61a2a){logger['error'](_0xc61a2a);}return _0x446bc2;}return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x139c76,_0x0fff('0x151'));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x152')]=function(_0x235b17){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x153'),_0x235b17[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x235b17[_0x0fff('0x154')])){return this['channel'][_0x0fff('0x29')](_0x235b17,_0x0fff('0x155'));}logger['info'](util['format'](_0x0fff('0x156'),this['channel']['callerid'],_0x235b17[_0x0fff('0x154')]));var _0x51a219=this['agentLogin'][_0x0fff('0x6d')](this,_0x235b17[_0x0fff('0x154')]);if(_0x51a219){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x157'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x235b17[_0x0fff('0x154')]));this['channel']['noop'](util[_0x0fff('0x25')](_0x0fff('0x157'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x235b17[_0x0fff('0x154')]));return{'code':0xc8,'result':_0x0fff('0x158')};}else{logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x159'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x235b17[_0x0fff('0x154')]));this[_0x0fff('0x35')][_0x0fff('0xab')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x235b17[_0x0fff('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0fff('0xf')][_0x0fff('0x15a')]=function(_0x1e77b8){logger['info'](util[_0x0fff('0x25')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1e77b8[_0x0fff('0x37')]));if(!this['isConfigured'](_0x1e77b8['findBy'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x1e77b8,_0x0fff('0x155'));}logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x156'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1e77b8[_0x0fff('0x154')]));var _0x4c389c=this[_0x0fff('0x52')][_0x0fff('0x6d')](this,_0x1e77b8[_0x0fff('0x154')]);if(_0x4c389c){logger['info'](util['format'](_0x0fff('0x157'),this['channel'][_0x0fff('0x3a')],_0x1e77b8[_0x0fff('0x154')]));this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0x157'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1e77b8[_0x0fff('0x154')]));return{'code':0xc8,'result':_0x0fff('0x158')};}else{logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x159'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1e77b8[_0x0fff('0x154')]));this[_0x0fff('0x35')][_0x0fff('0xab')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1e77b8['findBy']));return{'code':0xc8,'result':_0x0fff('0x15b')};}};AGIVertices['prototype']['math']=function(_0x45e098){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x15c'),_0x45e098['label']));if(!this[_0x0fff('0xa2')](_0x45e098['operation'])){return this[_0x0fff('0x35')]['error'](_0x45e098,_0x0fff('0x15d'));}this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x15e'),_0x45e098[_0x0fff('0x15f')]));var _0x36f7b1=eval(_0x45e098[_0x0fff('0x15f')]);if(!this[_0x0fff('0xa2')](_0x45e098[_0x0fff('0xd4')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x10e'));}var _0x18a6d1=this[_0x0fff('0x10')][_0x0fff('0x6d')](this,_0x45e098[_0x0fff('0xd4')]);if(!_0x18a6d1){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x45e098,_0x0fff('0x114'));}if(_['isArray'](_0x36f7b1)){var _0x4c6604=this;_0x36f7b1['forEach'](function(_0x8e1593,_0x29286f){_0x4c6604['channel'][_0x0fff('0x9c')](util[_0x0fff('0x25')](_0x0fff('0x160'),_0x18a6d1,_0x29286f),_0x8e1593);});return this['channel'][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x161'),_0x18a6d1));}else{return this[_0x0fff('0x35')][_0x0fff('0x9c')](_0x18a6d1,_0x36f7b1);}};AGIVertices['prototype']['menu']=function(_0x34f249){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x34f249[_0x0fff('0x37')]));if(_0x34f249[_0x0fff('0x10a')]===0x0){return this[_0x0fff('0xa3')](_0x34f249);}_0x34f249[_0x0fff('0x10a')]-=0x1;if(!this[_0x0fff('0xa2')](_0x34f249[_0x0fff('0x10b')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x34f249,'no\x20file\x20audio\x20selected');}var _0xeee123=this['getSound']['sync'](this,_0x34f249['file_id']);if(!_0xeee123){return this['channel']['error'](_0x34f249,_0x0fff('0x10d'));}var _0x54e8b9=this[_0x0fff('0x35')][_0x0fff('0x10f')](_0xeee123,_0x34f249[_0x0fff('0x110')],_0x34f249['digit']);var _0x527af9=_0x54e8b9['result'];if(_0x54e8b9[_0x0fff('0x9f')]===-0x1){this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x34f249,'-1');return _0x54e8b9;}else if(_0x54e8b9[_0x0fff('0xa1')]===_0x0fff('0x64')){_0x54e8b9['result']=_0x54e8b9[_0x0fff('0x9f')][_0x0fff('0x99')]>0x0?_0x54e8b9[_0x0fff('0x9f')]:'t';}else if(_['isEmpty'](_0x54e8b9[_0x0fff('0x9f')])){_0x54e8b9[_0x0fff('0x9f')]='#';_0x527af9='#';}if(!this[_0x0fff('0xa2')](_0x34f249[_0x0fff('0xd4')])){this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x10e'));}else{var _0x4227c5=this[_0x0fff('0x10')][_0x0fff('0x6d')](this,_0x34f249['variable_id']);if(!_0x4227c5){return this['channel'][_0x0fff('0x29')](_0x34f249,_0x0fff('0x114'));}this[_0x0fff('0x35')][_0x0fff('0x9c')](_0x4227c5,_0x527af9);}this[_0x0fff('0x34')]['sync'](this,_0x34f249,_0x527af9);return _0x54e8b9;};AGIVertices[_0x0fff('0xf')][_0x0fff('0xab')]=function(_0x4ad073){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x162'),_0x4ad073[_0x0fff('0x37')]));return this['channel'][_0x0fff('0xab')](_0x4ad073[_0x0fff('0x163')]||_0x4ad073[_0x0fff('0x37')]);};AGIVertices[_0x0fff('0xf')][_0x0fff('0x164')]=function(_0x4e0c48){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x165'),_0x4e0c48[_0x0fff('0x37')]));if(!this['isConfigured'](_0x4e0c48['findBy'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x4e0c48,_0x0fff('0x155'));}logger['info'](util[_0x0fff('0x25')](_0x0fff('0x156'),this['channel']['callerid'],_0x4e0c48[_0x0fff('0x154')]));var _0x24060b=this[_0x0fff('0x4e')][_0x0fff('0x6d')](this,_0x4e0c48[_0x0fff('0x166')]);var _0xd22656=this['agentPause'][_0x0fff('0x6d')](this,_0x4e0c48[_0x0fff('0x154')],_0x24060b);if(_0xd22656){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x157'),this['channel'][_0x0fff('0x3a')],_0x4e0c48['findBy']));this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x157'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x4e0c48[_0x0fff('0x154')]));return{'code':0xc8,'result':_0x0fff('0x158')};}else{logger['info'](util[_0x0fff('0x25')](_0x0fff('0x159'),this['channel']['callerid'],_0x4e0c48[_0x0fff('0x154')]));this[_0x0fff('0x35')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0fff('0x3a')],_0x4e0c48[_0x0fff('0x154')]));return{'code':0xc8,'result':_0x0fff('0x15b')};}};AGIVertices[_0x0fff('0xf')][_0x0fff('0x167')]=function(_0x46cfa2){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x168'),_0x46cfa2['label']));if(!this['isConfigured'](_0x46cfa2[_0x0fff('0x10b')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x46cfa2,'no\x20file\x20audio\x20selected');}var _0x56e8b0=this[_0x0fff('0x1c')][_0x0fff('0x6d')](this,_0x46cfa2[_0x0fff('0x10b')]);if(!_0x56e8b0){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x46cfa2,_0x0fff('0x10d'));}var _0x2bde15=this[_0x0fff('0x35')][_0x0fff('0xbe')](_0x0fff('0x169'),[_0x56e8b0,_0x46cfa2[_0x0fff('0xe0')]]);if(_0x2bde15['result']===-0x1){return _0x2bde15;}return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0xbc'),_0x0fff('0x169'),_0x56e8b0));};AGIVertices['prototype']['queue']=function(_0x155f21){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x16a'),_0x155f21[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x155f21['queue_id'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x155f21,_0x0fff('0x16b'));}var _0x134a1c='';var _0x4a193f=parseInt(_0x155f21[_0x0fff('0x16c')],0xa);if(isNaN(_0x4a193f)){_0x134a1c=_0x155f21[_0x0fff('0x16c')];}else{_0x134a1c=this['getVoiceQueue'][_0x0fff('0x6d')](this,_0x155f21[_0x0fff('0x16c')]);if(!_0x134a1c){return this[_0x0fff('0x35')]['error'](_0x155f21,_0x0fff('0x16d'));}}var _0x3232d1='';if(this[_0x0fff('0xa2')](_0x155f21[_0x0fff('0x10b')])){var _0x7bb684=this[_0x0fff('0x1c')][_0x0fff('0x6d')](this,_0x155f21[_0x0fff('0x10b')]);if(_0x7bb684){_0x3232d1=_0x7bb684;}}this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x155f21,_0x134a1c);if(_0x155f21[_0x0fff('0xe0')]['indexOf']('x')<0x0){_0x155f21['opts']+='x';}if(_0x155f21[_0x0fff('0xe0')][_0x0fff('0x16e')]('X')<0x0){_0x155f21[_0x0fff('0xe0')]+='X';}this[_0x0fff('0x35')]['setVariable']('XMCS-QUEUE',_0x134a1c?_0x134a1c[_0x0fff('0x16f')]():'');var _0x53299c=this[_0x0fff('0x35')][_0x0fff('0xbe')](_0x0fff('0x170'),[_0x134a1c,_0x155f21['opts'],_0x155f21[_0x0fff('0x62')],_0x3232d1,_0x155f21['timeout'],_0x155f21[_0x0fff('0x6')],_0x155f21[_0x0fff('0x171')],_0x155f21['gosub'],'',_0x155f21[_0x0fff('0x172')]]);if(_0x53299c[_0x0fff('0x9f')]===-0x1){return _0x53299c;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xbc'),_0x0fff('0x170'),_0x134a1c));};AGIVertices['prototype'][_0x0fff('0x173')]=function(_0x4c62df){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x174'),_0x4c62df['label']));var _0x5bae19=_0x4c62df[_0x0fff('0x175')]||_0x0fff('0x12f');var _0x4a1d04=util[_0x0fff('0x25')]('%s_%s',this[_0x0fff('0x35')][_0x0fff('0x36')],rs[_0x0fff('0x116')](0x5));var _0xac5c47=util[_0x0fff('0x25')](_0x0fff('0x176'),FILES_PATH,_0x4a1d04,_0x5bae19);var _0x5a5d3b=util[_0x0fff('0x25')]('%s/recordings/%s',FILES_PATH,_0x4a1d04);this[_0x0fff('0x3b')]['sync'](this,_0x4c62df,_0x4a1d04,_0xac5c47);this[_0x0fff('0x35')][_0x0fff('0x9c')](_0x0fff('0x177'),_0x4a1d04);logger[_0x0fff('0x2d')](_0x0fff('0x178'),_0x5a5d3b,_0x5bae19,_0x4c62df[_0x0fff('0x179')],_0x4c62df[_0x0fff('0x64')]);return this['channel'][_0x0fff('0x132')](_0x5a5d3b,_0x5bae19,_0x4c62df['escape_digits'],_0x4c62df[_0x0fff('0x64')],undefined,!![]);};AGIVertices[_0x0fff('0xf')][_0x0fff('0x17a')]=function(_0x53e0c4){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x17b'),_0x53e0c4[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x53e0c4[_0x0fff('0x62')])){return this[_0x0fff('0x35')]['noop'](_0x0fff('0x17c'));}var _0x47946a=this['restAPI'][_0x0fff('0x6d')](this,_0x53e0c4);logger['info'](util['format'](_0x0fff('0x17d'),util[_0x0fff('0x17e')](_0x47946a,{'showHidden':![],'depth':null})));if(!this[_0x0fff('0xa2')](_0x53e0c4[_0x0fff('0xd4')])){return this['channel'][_0x0fff('0xab')](_0x0fff('0x17f'));}var _0xa89975=this['getVariable'][_0x0fff('0x6d')](this,_0x53e0c4[_0x0fff('0xd4')]);if(!_0xa89975){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x53e0c4,_0x0fff('0x114'));}this[_0x0fff('0x35')]['setVariable'](util[_0x0fff('0x25')](_0x0fff('0x180'),_0xa89975),_0x47946a[_0x0fff('0x75')]?_0x47946a[_0x0fff('0x75')]:_0x0fff('0x181'));this['channel']['setVariable'](util[_0x0fff('0x25')](_0x0fff('0x182'),_0xa89975),_0x47946a['statusMessage']?_0x47946a[_0x0fff('0x74')]:'OK');if(_0x47946a[_0x0fff('0x72')]){try{this[_0x0fff('0x9a')](_0x47946a[_0x0fff('0x72')],_0xa89975);}catch(_0x2c07c9){logger[_0x0fff('0x29')](util[_0x0fff('0x25')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xa89975));}}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xd8'),_0xa89975));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x183')]=function(_0x499f0f){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x184'),_0x499f0f[_0x0fff('0x37')]));return this[_0x0fff('0x35')][_0x0fff('0x185')](_0x499f0f[_0x0fff('0x186')][_0x0fff('0x56')](/\s+/g,''),_0x499f0f['escape_digits']);};AGIVertices[_0x0fff('0xf')]['saynumber']=function(_0x32ed28){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x187'),_0x32ed28[_0x0fff('0x37')]));return this[_0x0fff('0x35')][_0x0fff('0x188')](_0x32ed28[_0x0fff('0x65')][_0x0fff('0x56')](/\s+/g,''),_0x32ed28['escape_digits']);};AGIVertices[_0x0fff('0xf')]['sayphonetic']=function(_0x2abbc4){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x189'),_0x2abbc4['label']));return this[_0x0fff('0x35')][_0x0fff('0x18a')](_0x2abbc4['text'],_0x2abbc4[_0x0fff('0x179')]);};AGIVertices['prototype'][_0x0fff('0x18b')]=function(_0x1ae0a8){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x18c'),_0x1ae0a8[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x1ae0a8[_0x0fff('0x18d')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x18e'));}var _0x55f2bd=this[_0x0fff('0x18f')]['sync'](this,_0x1ae0a8[_0x0fff('0x18d')]);if(!_0x55f2bd||!_0x55f2bd[_0x0fff('0x190')]){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x1ae0a8,'no\x20mail\x20account\x20found');}var _0x54b51a={'from':util[_0x0fff('0x25')](_0x0fff('0x191'),_0x55f2bd[_0x0fff('0x13')],_0x55f2bd[_0x0fff('0x192')]||_0x55f2bd[_0x0fff('0x190')][_0x0fff('0x193')]),'to':_0x1ae0a8['to']||'','cc':_0x1ae0a8['cc']||'','bcc':_0x1ae0a8[_0x0fff('0x194')]||'','subject':_0x1ae0a8[_0x0fff('0x195')],'html':_0x1ae0a8[_0x0fff('0x60')],'text':_0x1ae0a8['text']};var _0x33c125=_0x55f2bd[_0x0fff('0x196')]();if(this[_0x0fff('0xa2')](_0x1ae0a8[_0x0fff('0x197')])){}logger['debug']('sendMail\x20message',JSON[_0x0fff('0x71')](_0x54b51a));this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x1ae0a8,_0x1ae0a8[_0x0fff('0x18d')]);this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x198'),_0x55f2bd[_0x0fff('0x13')]));this['sendMailMessage']['sync'](this,_0x33c125,_0x54b51a);return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x199'));};AGIVertices['prototype'][_0x0fff('0x19a')]=function(_0x26ae35){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x19b'),_0x26ae35[_0x0fff('0x37')]));return this[_0x0fff('0x35')][_0x0fff('0xab')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x0fff('0xf')][_0x0fff('0x19c')]=function(_0x8723d4){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x19d'),_0x8723d4[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x8723d4[_0x0fff('0x19e')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x19f'));}var _0x5de936=this['getSmsAccount'][_0x0fff('0x6d')](this,_0x8723d4[_0x0fff('0x19e')]);if(!_0x5de936){return this['channel'][_0x0fff('0x29')](_0x8723d4,_0x0fff('0x1a0'));}var _0x1a06de={'body':_0x8723d4[_0x0fff('0x1a1')],'phone':_0x8723d4['to']||'','SmsAccountId':_0x5de936['id']};logger['debug'](_0x0fff('0x1a2'),JSON[_0x0fff('0x71')](_0x1a06de));this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x8723d4,_0x8723d4[_0x0fff('0x19e')]);this[_0x0fff('0x35')][_0x0fff('0xab')](util['format'](_0x0fff('0x1a3'),_0x5de936[_0x0fff('0x13')]));this['createSmsMessage'][_0x0fff('0x6d')](this,_0x1a06de);return this['channel']['noop'](_0x0fff('0x1a4'));};AGIVertices['prototype'][_0x0fff('0x1a5')]=function(_0x1bd032){logger['info'](util[_0x0fff('0x25')](_0x0fff('0x1a6'),_0x1bd032[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x1bd032[_0x0fff('0xd4')])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x1bd032,_0x0fff('0x1a7'));}var _0x37ee08=this[_0x0fff('0x10')]['sync'](this,_0x1bd032['variable_id']);if(!_0x37ee08){return this[_0x0fff('0x35')]['error'](_0x1bd032,_0x0fff('0x114'));}return this[_0x0fff('0x35')]['setVariable'](_0x37ee08,_0x1bd032[_0x0fff('0x1a8')]);};AGIVertices[_0x0fff('0xf')]['start']=function(_0x30d340){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x1a9'),_0x30d340['label']));this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x1aa'));if(_0x30d340[_0x0fff('0xb4')]===_0x0fff('0x1ab')){this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x1ac'));return this['channel'][_0x0fff('0xb4')]();}return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0x1ad'));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x1ae')]=function(_0x39b77d){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x1af'),_0x39b77d[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x39b77d['project_id'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x39b77d,_0x0fff('0x1b0'));}var _0x7f082a=this[_0x0fff('0x15')]['sync'](this,_0x39b77d[_0x0fff('0x1b1')]);if(!this['isConfigured'](_0x7f082a)){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x39b77d,util[_0x0fff('0x25')](_0x0fff('0x1b2'),_0x39b77d['project_id']));}if(_0x7f082a===this[_0x0fff('0x35')][_0x0fff('0x39')]){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x39b77d,_0x0fff('0x1b3'));}this[_0x0fff('0x34')][_0x0fff('0x6d')](this,_0x39b77d,_0x7f082a);var _0x15ddb7=this[_0x0fff('0x35')][_0x0fff('0xbe')]('AGI',util[_0x0fff('0x25')](_0x0fff('0x1b4'),config[_0x0fff('0x6')][_0x0fff('0x1b5')]||_0x0fff('0x1b6'),_0x7f082a,this[_0x0fff('0x35')][_0x0fff('0x39')]));if(_0x15ddb7['result']===-0x1){return _0x15ddb7;}return this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0xbc'),_0x0fff('0x1b7'),_0x7f082a));};AGIVertices[_0x0fff('0xf')]['system']=function(_0x208dea){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x1b8'),_0x208dea[_0x0fff('0x37')]));var _0x33763f=this['shellCommand']['sync'](this,_0x208dea[_0x0fff('0xb2')]);this['createSquareDetailsReport'][_0x0fff('0x6d')](this,_0x208dea,_0x208dea[_0x0fff('0xb2')]);if(this[_0x0fff('0xa2')](_0x208dea[_0x0fff('0xd4')])){var _0x339cfd=this[_0x0fff('0x10')][_0x0fff('0x6d')](this,_0x208dea[_0x0fff('0xd4')]);if(_0x339cfd){this[_0x0fff('0x35')]['setVariable'](_0x339cfd,_0x33763f);return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x208dea[_0x0fff('0xb2')],_0x339cfd));}}return this['channel'][_0x0fff('0xab')](util[_0x0fff('0x25')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x208dea['command']));};AGIVertices['prototype'][_0x0fff('0x1b9')]=function(_0x5d6601){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x1ba'),_0x5d6601[_0x0fff('0x37')]));_0x5d6601[_0x0fff('0x60')]=_0x5d6601['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0fff('0xa2')](_0x5d6601[_0x0fff('0x58')])){return this['channel']['noop'](_0x0fff('0x1bb'));}if(!this['isConfigured'](_0x5d6601[_0x0fff('0x60')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xc0'));}this['channel'][_0x0fff('0xab')](util['format'](_0x0fff('0x1bc'),_0x5d6601[_0x0fff('0x60')]));var _0x4828ce=this['googleCloudTTS'][_0x0fff('0x6d')](this,_0x5d6601);if(_0x4828ce){this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x1bd'),_0x4828ce));var _0x60e025=this[_0x0fff('0x35')]['streamFile'](_0x4828ce);try{fs[_0x0fff('0x124')](_0x4828ce+_0x0fff('0xfd'));}catch(_0x3e71d1){logger['error'](_0x3e71d1);}return _0x60e025;}return this['channel'][_0x0fff('0x29')](_0x5d6601,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0fff('0xf')]['tts']=function(_0x52a354){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x1be'),_0x52a354['label']));_0x52a354['text']=_0x52a354[_0x0fff('0x60')][_0x0fff('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0fff('0xa2')](_0x52a354[_0x0fff('0x60')])){return this[_0x0fff('0x35')][_0x0fff('0xab')](_0x0fff('0xc0'));}this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0x1bf'),_0x52a354[_0x0fff('0x60')]));var _0x3a5b96=this[_0x0fff('0x5f')][_0x0fff('0x6d')](this,_0x52a354);if(_0x3a5b96){this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')]('Google\x20TTS\x20%s\x20file\x20created',_0x3a5b96));var _0x5259b6=this[_0x0fff('0x35')][_0x0fff('0x123')](_0x3a5b96);try{fs[_0x0fff('0x124')](_0x3a5b96+_0x0fff('0xfd'));}catch(_0x2748c6){logger['error'](_0x2748c6);}return _0x5259b6;}return this['channel']['error'](_0x52a354,_0x0fff('0x1c0'));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x1c1')]=function(_0x1753ee){logger['info'](util['format'](_0x0fff('0x1c2'),_0x1753ee[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x1753ee['findBy'])){return this[_0x0fff('0x35')][_0x0fff('0x29')](_0x1753ee,_0x0fff('0x155'));}logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x156'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1753ee['findBy']));var _0x403a97=this[_0x0fff('0x51')][_0x0fff('0x6d')](this,_0x1753ee[_0x0fff('0x154')]);if(_0x403a97){logger['info'](util[_0x0fff('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1753ee[_0x0fff('0x154')]));this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0x157'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1753ee[_0x0fff('0x154')]));return{'code':0xc8,'result':_0x0fff('0x158')};}else{logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x159'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1753ee[_0x0fff('0x154')]));this[_0x0fff('0x35')]['noop'](util[_0x0fff('0x25')](_0x0fff('0x159'),this[_0x0fff('0x35')][_0x0fff('0x3a')],_0x1753ee[_0x0fff('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x0fff('0x1c3')]=function(_0x1b03fd){logger[_0x0fff('0x2d')](util['format'](_0x0fff('0x1c4'),_0x1b03fd[_0x0fff('0x37')]));var _0x176cb8=this[_0x0fff('0x35')][_0x0fff('0xbe')]('VOICEMAIL',[_0x1b03fd[_0x0fff('0x1c5')],_0x1b03fd[_0x0fff('0x77')]]);if(_0x176cb8['result']===-0x1){return _0x176cb8;}return this[_0x0fff('0x35')][_0x0fff('0xab')](util[_0x0fff('0x25')](_0x0fff('0xbc'),_0x0fff('0x1c6'),_0x1b03fd[_0x0fff('0x1c5')]));};AGIVertices[_0x0fff('0xf')][_0x0fff('0x1c7')]=function(_0x20f1df){logger[_0x0fff('0x2d')](util[_0x0fff('0x25')](_0x0fff('0x1c8'),_0x20f1df[_0x0fff('0x37')]));if(!this[_0x0fff('0xa2')](_0x20f1df[_0x0fff('0xd4')])){return this['channel'][_0x0fff('0x29')](_0x20f1df,_0x0fff('0x1a7'));}var _0x35ef18=this['getVariable']['sync'](this,_0x20f1df['variable_id']);if(!_0x35ef18){return this[_0x0fff('0x35')]['error'](_0x20f1df,_0x0fff('0x114'));}var _0x46f6ab=this[_0x0fff('0x35')][_0x0fff('0x10')](_0x35ef18);return{'code':0xc8,'result':_0x46f6ab[_0x0fff('0xa1')]?_0x46f6ab[_0x0fff('0xa1')]:'-'};};String[_0x0fff('0xf')][_0x0fff('0x9e')]=function(_0x356d4b,_0xdbad){return this[_0x0fff('0x9d')](_0x356d4b)[_0x0fff('0x1c9')](_0xdbad);};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 8136952..13b3225 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 _0x5d76=['syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer'];(function(_0x347b52,_0x9f4839){var _0x42c58f=function(_0x12a622){while(--_0x12a622){_0x347b52['push'](_0x347b52['shift']());}};_0x42c58f(++_0x9f4839);}(_0x5d76,0x18c));var _0x65d7=function(_0x4c372c,_0x2444de){_0x4c372c=_0x4c372c-0x0;var _0x3a0549=_0x5d76[_0x4c372c];return _0x3a0549;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x65d7('0x0'));var ami=require(_0x65d7('0x1'));var logger=require(_0x65d7('0x2'))(_0x65d7('0x3'));var RpcUser=require(_0x65d7('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x413665){this[_0x65d7('0x5')]=_0x413665[_0x65d7('0x5')];this['agents']=_0x413665[_0x65d7('0x6')];this['timers']=_0x413665[_0x65d7('0x7')];this['channels']={};ami['on'](_0x65d7('0x8'),this[_0x65d7('0x9')][_0x65d7('0xa')](this));ami['on'](_0x65d7('0xb'),this[_0x65d7('0xc')][_0x65d7('0xa')](this));ami['on'](_0x65d7('0xd'),this[_0x65d7('0xe')]['bind'](this));ami['on'](_0x65d7('0xf'),this['syncAgentRingNoAnswer'][_0x65d7('0xa')](this));ami['on'](_0x65d7('0x10'),this[_0x65d7('0x11')][_0x65d7('0xa')](this));ami['on'](_0x65d7('0x12'),this[_0x65d7('0x13')][_0x65d7('0xa')](this));ami['on'](_0x65d7('0x14'),this['syncAgentConnectPreview'][_0x65d7('0xa')](this));}function getDiff(_0x46da72){var _0x1bc727=moment()[_0x65d7('0x15')](0x0);var _0x4d7411=moment(_0x46da72)[_0x65d7('0x15')](0x0);return _0x1bc727[_0x65d7('0x16')](_0x4d7411,_0x65d7('0x17'));}Acw[_0x65d7('0x18')][_0x65d7('0x19')]=function(_0x3638af){try{var _0xa20852=this;var _0x36cb41=this[_0x65d7('0x1a')][_0x3638af]['interface'];var _0x42a706=this['channels'][_0x3638af]['queue'];var _0x550ae0=this['voiceQueues'][_0x42a706];var _0x22d2fe=![];var _0x5da3b2=_0x65d7('0x1b');if(_0x550ae0[_0x65d7('0x1c')]){if(_0x550ae0[_0x65d7('0x1d')][_0x65d7('0x1e')]){_0x22d2fe=!![];_0x5da3b2=_0x550ae0[_0x65d7('0x1d')][_0x65d7('0x1e')];}}ami['Action']({'action':_0x65d7('0x1f'),'interface':_0x36cb41,'paused':!![],'reason':_0x5da3b2})[_0x65d7('0x20')](function(_0x3ea4e7){if(_0xa20852['agents'][_0x36cb41]){return RpcUser['getAgent'](_0xa20852[_0x65d7('0x6')][_0x36cb41]['id'])[_0x65d7('0x20')](function(_0x5647e6){if(_0x5647e6&&!_0x5647e6[_0x65d7('0x21')]){logger[_0x65d7('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3638af,_0x36cb41,_0x42a706);var _0x53cf9e=_0xa20852['channels'][_0x3638af][_0x65d7('0x23')]&&_0xa20852[_0x65d7('0x1a')][_0x3638af][_0x65d7('0x24')]?_0xa20852[_0x65d7('0x1a')][_0x3638af]['destlinkedid']:_0x3638af;return RpcUser['savePause'](_0xa20852[_0x65d7('0x6')][_0x36cb41],_0x5da3b2,_0x53cf9e)['then'](function(_0x127e52){if(!_0x22d2fe){_0xa20852[_0x65d7('0x7')][_0x36cb41]={};logger['info'](_0x65d7('0x25'),_0x3638af,_0xa20852['voiceQueues'][_0x42a706][_0x65d7('0x26')],_0x36cb41,_0x42a706);_0xa20852[_0x65d7('0x7')][_0x36cb41][_0x65d7('0x27')]=setTimeout(_0xa20852[_0x65d7('0x28')][_0x65d7('0xa')](_0xa20852,_0x36cb41),_0xa20852[_0x65d7('0x5')][_0x42a706][_0x65d7('0x26')]*0x3e8);_0xa20852['timers'][_0x36cb41][_0x65d7('0x29')]=moment()[_0x65d7('0x2a')](_0x65d7('0x2b'));_0xa20852[_0x65d7('0x7')][_0x36cb41][_0x65d7('0x2c')]=_0x3638af;_0xa20852[_0x65d7('0x7')][_0x36cb41][_0x65d7('0x2d')]=_0x42a706;_0xa20852[_0x65d7('0x7')][_0x36cb41]['updateAcw']=function(){var _0x1441f5=getDiff(_0xa20852[_0x65d7('0x7')][_0x36cb41]['lastPauseAt']);clearTimeout(_0xa20852[_0x65d7('0x7')][_0x36cb41][_0x65d7('0x27')]);_0xa20852[_0x65d7('0x7')][_0x36cb41]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x1441f5},_0xa20852[_0x65d7('0x7')][_0x36cb41]['uniqueid'],_0x36cb41)[_0x65d7('0x20')](function(_0x219a53){logger[_0x65d7('0x22')](_0x65d7('0x2e'),_0x3638af,_0x1441f5,_0x219a53);})[_0x65d7('0x2f')](function(_0x1f185e){logger[_0x65d7('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x3638af,_0x1f185e);});delete _0xa20852[_0x65d7('0x7')][_0x36cb41];};}});}else{logger[_0x65d7('0x22')](_0x65d7('0x31'),_0x3638af,_0x36cb41,_0x42a706);}});}})[_0x65d7('0x2f')](function(_0x25c5a8){logger[_0x65d7('0x30')](_0x65d7('0x25'),_0x3638af,_0xa20852['voiceQueues'][_0x42a706][_0x65d7('0x26')],_0x36cb41,_0x42a706);})['finally'](function(){delete _0xa20852[_0x65d7('0x1a')][_0x3638af];});}catch(_0x13bebd){logger['error'](_0x65d7('0x32'),_0x13bebd['message']);}};Acw[_0x65d7('0x18')][_0x65d7('0x28')]=function(_0x316db9){try{var _0x2fa591=this;if(_0x2fa591[_0x65d7('0x7')][_0x316db9]){_0x2fa591['timers'][_0x316db9][_0x65d7('0x27')]=![];var _0x2e574d=_0x2fa591['timers'][_0x316db9][_0x65d7('0x2c')];var _0x418b09=_0x2fa591[_0x65d7('0x7')][_0x316db9][_0x65d7('0x2d')];var _0x54228f=_0x2fa591[_0x65d7('0x5')][_0x418b09][_0x65d7('0x26')];logger[_0x65d7('0x22')]('[%s][TIMER][STOP][AGENT:%s]',_0x2e574d,_0x316db9);RpcUser[_0x65d7('0x33')](this['agents'][_0x316db9]);RpcVoiceAgentReport[_0x65d7('0x34')]({'acwtime':_0x54228f,'agentacw':!![]},_0x2e574d,_0x316db9)[_0x65d7('0x20')](function(_0x9a3cef){logger['info'](_0x65d7('0x2e'),_0x2e574d,_0x54228f,_0x9a3cef);})['catch'](function(_0x251d84){logger['error'](_0x65d7('0x35'),_0x2e574d,_0x251d84);});}else{logger[_0x65d7('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x316db9);if(_0x2fa591[_0x65d7('0x7')]){logger[_0x65d7('0x22')](_0x65d7('0x36'),JSON[_0x65d7('0x37')](_0x2fa591['timers']));}}}catch(_0x319899){logger[_0x65d7('0x30')](_0x65d7('0x38'),_0x319899[_0x65d7('0x39')]);}};Acw[_0x65d7('0x18')][_0x65d7('0x9')]=function(_0x502b8f){try{if(this[_0x65d7('0x5')][_0x502b8f[_0x65d7('0x2d')]]&&(this[_0x65d7('0x5')][_0x502b8f[_0x65d7('0x2d')]]['acw']||this[_0x65d7('0x5')][_0x502b8f['queue']][_0x65d7('0x1c')])){if(this['agents'][_0x502b8f[_0x65d7('0x3a')]]){this['channels'][_0x502b8f[_0x65d7('0x2c')]]={'queue':_0x502b8f['queue'],'interface':_0x502b8f[_0x65d7('0x3a')],'destlinkedid':_0x502b8f[_0x65d7('0x24')]};}}}catch(_0x344234){logger[_0x65d7('0x30')](_0x65d7('0x3b'),_0x344234[_0x65d7('0x39')]);}};Acw[_0x65d7('0x18')]['syncAgentConnectPreview']=function(_0x2a4cb6){try{if(this[_0x65d7('0x5')][_0x2a4cb6[_0x65d7('0x2d')]]&&(this['voiceQueues'][_0x2a4cb6[_0x65d7('0x2d')]][_0x65d7('0x3')]||this[_0x65d7('0x5')][_0x2a4cb6[_0x65d7('0x2d')]][_0x65d7('0x1c')])){if(this[_0x65d7('0x6')][_0x2a4cb6[_0x65d7('0x3a')]]){this['channels'][_0x2a4cb6[_0x65d7('0x2c')]]={'queue':_0x2a4cb6[_0x65d7('0x2d')],'interface':_0x2a4cb6[_0x65d7('0x3a')]};}}}catch(_0x3bb826){logger[_0x65d7('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x3bb826[_0x65d7('0x39')]);}};Acw[_0x65d7('0x18')]['syncHangupRequest']=function(_0x228885){try{if(this[_0x65d7('0x1a')][_0x228885[_0x65d7('0x2c')]]&&_[_0x65d7('0x3c')](this[_0x65d7('0x1a')][_0x228885['uniqueid']]['attended'])){logger[_0x65d7('0x22')]('[%s][HANGUP:UNIQUEID]',_0x228885['uniqueid']);this['startAcw'](_0x228885[_0x65d7('0x2c')]);}else if(this[_0x65d7('0x1a')][_0x228885[_0x65d7('0x3d')]]&&_[_0x65d7('0x3c')](this['channels'][_0x228885[_0x65d7('0x3d')]][_0x65d7('0x23')])){logger['info'](_0x65d7('0x3e'),_0x228885['linkedid']);this['startAcw'](_0x228885[_0x65d7('0x3d')]);}}catch(_0x413e7f){logger[_0x65d7('0x30')](_0x65d7('0x3f'),_0x413e7f['message']);}};Acw[_0x65d7('0x18')][_0x65d7('0xe')]=function(_0x16a510){try{if(this['channels'][_0x16a510['uniqueid']]&&this[_0x65d7('0x1a')][_0x16a510[_0x65d7('0x2c')]]['attended']){logger[_0x65d7('0x22')](_0x65d7('0x40'),_0x16a510[_0x65d7('0x2c')]);this['startAcw'](_0x16a510[_0x65d7('0x2c')]);}else if(this[_0x65d7('0x1a')][_0x16a510[_0x65d7('0x3d')]]&&this['channels'][_0x16a510['linkedid']][_0x65d7('0x23')]){logger[_0x65d7('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x16a510[_0x65d7('0x3d')]);this['startAcw'](_0x16a510[_0x65d7('0x3d')]);}}catch(_0x2d7800){logger['error'](_0x65d7('0x41'),_0x2d7800[_0x65d7('0x39')]);}};Acw[_0x65d7('0x18')]['syncAttendedTransfer']=function(_0x1f9531){try{if(!_[_0x65d7('0x42')](this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x43')]])){this['startAcw'](_0x1f9531[_0x65d7('0x43')]);if(this[_0x65d7('0x1a')][_0x1f9531['secondtransfereruniqueid']]){this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x44')]][_0x65d7('0x23')]=!![];this['channels'][_0x1f9531[_0x65d7('0x45')]]=this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x44')]];delete this[_0x65d7('0x1a')][_0x1f9531['secondtransfereruniqueid']];}}else if(!_[_0x65d7('0x42')](this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x45')]])){this[_0x65d7('0x19')](_0x1f9531[_0x65d7('0x45')]);if(this['channels'][_0x1f9531['origtransfereruniqueid']]){this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x46')]]['attended']=!![];this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x43')]]=this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x46')]];delete this[_0x65d7('0x1a')][_0x1f9531[_0x65d7('0x46')]];}}}catch(_0x3a9111){logger[_0x65d7('0x30')](_0x65d7('0x47'),_0x3a9111[_0x65d7('0x39')]);}};Acw[_0x65d7('0x18')][_0x65d7('0x13')]=function(_0x1f55a2){try{if(this[_0x65d7('0x1a')][_0x1f55a2[_0x65d7('0x48')]]){logger[_0x65d7('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x65d7('0x37')](_0x1f55a2[_0x65d7('0x48')]));this[_0x65d7('0x19')](_0x1f55a2[_0x65d7('0x48')]);}else if(this[_0x65d7('0x1a')][_0x1f55a2[_0x65d7('0x49')]]){logger['info'](_0x65d7('0x4a'),JSON['stringify'](_0x1f55a2[_0x65d7('0x49')]));this[_0x65d7('0x19')](_0x1f55a2[_0x65d7('0x49')]);}}catch(_0x30faaf){logger[_0x65d7('0x30')]('[ACW][syncBlindTransfer]\x20%s',_0x30faaf[_0x65d7('0x39')]);}};Acw['prototype'][_0x65d7('0x4b')]=function(_0x39f7a3){try{if(this['voiceQueues'][_0x39f7a3['queue']]&&this['voiceQueues'][_0x39f7a3[_0x65d7('0x2d')]][_0x65d7('0x4c')]===_0x65d7('0x4d')){if(this[_0x65d7('0x6')][_0x39f7a3['interface']]){logger[_0x65d7('0x22')](_0x65d7('0x4e'),_0x39f7a3[_0x65d7('0x2c')],_0x39f7a3[_0x65d7('0x3a')],_0x39f7a3[_0x65d7('0x2d')]);return RpcUser[_0x65d7('0x4f')](this[_0x65d7('0x6')][_0x39f7a3[_0x65d7('0x3a')]],_0x65d7('0x50'),_0x39f7a3[_0x65d7('0x2c')]);}}}catch(_0x2f3dae){logger[_0x65d7('0x30')](_0x65d7('0x51'),_0x2f3dae[_0x65d7('0x39')]);}};module[_0x65d7('0x52')]=Acw; \ No newline at end of file +var _0xb067=['acw','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','mandatoryDisposition','name','mandatoryDispositionPause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','queue','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xb067,0x16a));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7b06('0x0'));var _=require('lodash');var moment=require(_0x7b06('0x1'));var ami=require(_0x7b06('0x2'));var logger=require(_0x7b06('0x3'))('acw');var RpcUser=require(_0x7b06('0x4'));var RpcVoiceAgentReport=require(_0x7b06('0x5'));function Acw(_0x346608){this[_0x7b06('0x6')]=_0x346608['voiceQueues'];this['agents']=_0x346608[_0x7b06('0x7')];this[_0x7b06('0x8')]=_0x346608[_0x7b06('0x8')];this['channels']={};ami['on'](_0x7b06('0x9'),this[_0x7b06('0xa')][_0x7b06('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x7b06('0xb')](this));ami['on'](_0x7b06('0xc'),this[_0x7b06('0xd')][_0x7b06('0xb')](this));ami['on'](_0x7b06('0xe'),this[_0x7b06('0xf')]['bind'](this));ami['on'](_0x7b06('0x10'),this[_0x7b06('0x11')]['bind'](this));ami['on'](_0x7b06('0x12'),this[_0x7b06('0x13')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x7b06('0x14')][_0x7b06('0xb')](this));}function getDiff(_0x321914){var _0x4e92f7=moment()[_0x7b06('0x15')](0x0);var _0x146b83=moment(_0x321914)[_0x7b06('0x15')](0x0);return _0x4e92f7[_0x7b06('0x16')](_0x146b83,_0x7b06('0x17'));}Acw[_0x7b06('0x18')][_0x7b06('0x19')]=function(_0x376dbb){try{var _0x471302=this;var _0x346190=this[_0x7b06('0x1a')][_0x376dbb][_0x7b06('0x1b')];var _0x27351a=this[_0x7b06('0x1a')][_0x376dbb]['queue'];var _0x5b6aa4=this[_0x7b06('0x6')][_0x27351a];var _0xecba57=![];var _0x4a7b85='ACW';if(_0x5b6aa4[_0x7b06('0x1c')]){if(_0x5b6aa4['mandatoryDispositionPause'][_0x7b06('0x1d')]){_0xecba57=!![];_0x4a7b85=_0x5b6aa4[_0x7b06('0x1e')][_0x7b06('0x1d')];}}ami['Action']({'action':'QueuePause','interface':_0x346190,'paused':!![],'reason':_0x4a7b85})[_0x7b06('0x1f')](function(_0x3d3b4d){if(_0x471302[_0x7b06('0x7')][_0x346190]){return RpcUser[_0x7b06('0x20')](_0x471302[_0x7b06('0x7')][_0x346190]['id'])[_0x7b06('0x1f')](function(_0x1c0a64){if(_0x1c0a64&&!_0x1c0a64['voicePause']){logger[_0x7b06('0x21')](_0x7b06('0x22'),_0x376dbb,_0x346190,_0x27351a);var _0x15af1b=_0x471302[_0x7b06('0x1a')][_0x376dbb][_0x7b06('0x23')]&&_0x471302[_0x7b06('0x1a')][_0x376dbb][_0x7b06('0x24')]?_0x471302[_0x7b06('0x1a')][_0x376dbb]['destlinkedid']:_0x376dbb;return RpcUser['savePause'](_0x471302['agents'][_0x346190],_0x4a7b85,_0x15af1b)[_0x7b06('0x1f')](function(_0x43bc54){if(!_0xecba57){_0x471302[_0x7b06('0x8')][_0x346190]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x376dbb,_0x471302['voiceQueues'][_0x27351a][_0x7b06('0x25')],_0x346190,_0x27351a);_0x471302[_0x7b06('0x8')][_0x346190]['timer']=setTimeout(_0x471302[_0x7b06('0x26')][_0x7b06('0xb')](_0x471302,_0x346190),_0x471302['voiceQueues'][_0x27351a][_0x7b06('0x25')]*0x3e8);_0x471302['timers'][_0x346190]['lastPauseAt']=moment()[_0x7b06('0x27')](_0x7b06('0x28'));_0x471302['timers'][_0x346190][_0x7b06('0x29')]=_0x376dbb;_0x471302['timers'][_0x346190]['queue']=_0x27351a;_0x471302[_0x7b06('0x8')][_0x346190]['updateAcw']=function(){var _0x105aa5=getDiff(_0x471302[_0x7b06('0x8')][_0x346190][_0x7b06('0x2a')]);clearTimeout(_0x471302[_0x7b06('0x8')][_0x346190][_0x7b06('0x2b')]);_0x471302[_0x7b06('0x8')][_0x346190][_0x7b06('0x2b')]=![];RpcVoiceAgentReport[_0x7b06('0x2c')]({'acwtime':_0x105aa5},_0x471302['timers'][_0x346190][_0x7b06('0x29')],_0x346190)[_0x7b06('0x1f')](function(_0x1cea68){logger[_0x7b06('0x21')](_0x7b06('0x2d'),_0x376dbb,_0x105aa5,_0x1cea68);})[_0x7b06('0x2e')](function(_0xe3ec8d){logger[_0x7b06('0x2f')](_0x7b06('0x30'),_0x376dbb,_0xe3ec8d);});delete _0x471302[_0x7b06('0x8')][_0x346190];};}});}else{logger[_0x7b06('0x21')](_0x7b06('0x31'),_0x376dbb,_0x346190,_0x27351a);}});}})[_0x7b06('0x2e')](function(_0xcd4cd){logger['error'](_0x7b06('0x32'),_0x376dbb,_0x471302[_0x7b06('0x6')][_0x27351a]['acwTimeout'],_0x346190,_0x27351a);})[_0x7b06('0x33')](function(){delete _0x471302['channels'][_0x376dbb];});}catch(_0x1ac438){logger['error']('[ACW][START]\x20%s',_0x1ac438['message']);}};Acw[_0x7b06('0x18')][_0x7b06('0x26')]=function(_0x3aeecc){try{var _0x5980cb=this;if(_0x5980cb['timers'][_0x3aeecc]){_0x5980cb[_0x7b06('0x8')][_0x3aeecc][_0x7b06('0x2b')]=![];var _0x42e692=_0x5980cb[_0x7b06('0x8')][_0x3aeecc][_0x7b06('0x29')];var _0x51cd15=_0x5980cb[_0x7b06('0x8')][_0x3aeecc][_0x7b06('0x34')];var _0x57c79a=_0x5980cb['voiceQueues'][_0x51cd15][_0x7b06('0x25')];logger[_0x7b06('0x21')]('[%s][TIMER][STOP][AGENT:%s]',_0x42e692,_0x3aeecc);RpcUser[_0x7b06('0x35')](this[_0x7b06('0x7')][_0x3aeecc]);RpcVoiceAgentReport['update']({'acwtime':_0x57c79a,'agentacw':!![]},_0x42e692,_0x3aeecc)[_0x7b06('0x1f')](function(_0xeed0bf){logger[_0x7b06('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x42e692,_0x57c79a,_0xeed0bf);})[_0x7b06('0x2e')](function(_0x32d49a){logger[_0x7b06('0x2f')](_0x7b06('0x30'),_0x42e692,_0x32d49a);});}else{logger['error'](_0x7b06('0x36'),_0x3aeecc);if(_0x5980cb[_0x7b06('0x8')]){logger['info'](_0x7b06('0x37'),JSON['stringify'](_0x5980cb[_0x7b06('0x8')]));}}}catch(_0x2dd36c){logger[_0x7b06('0x2f')](_0x7b06('0x38'),_0x2dd36c[_0x7b06('0x39')]);}};Acw['prototype'][_0x7b06('0xa')]=function(_0x3af6dc){try{if(this[_0x7b06('0x6')][_0x3af6dc['queue']]&&(this[_0x7b06('0x6')][_0x3af6dc['queue']][_0x7b06('0x3a')]||this[_0x7b06('0x6')][_0x3af6dc[_0x7b06('0x34')]]['mandatoryDisposition'])){if(this[_0x7b06('0x7')][_0x3af6dc[_0x7b06('0x1b')]]){this[_0x7b06('0x1a')][_0x3af6dc[_0x7b06('0x29')]]={'queue':_0x3af6dc[_0x7b06('0x34')],'interface':_0x3af6dc['interface'],'destlinkedid':_0x3af6dc[_0x7b06('0x24')]};}}}catch(_0x181691){logger[_0x7b06('0x2f')](_0x7b06('0x3b'),_0x181691[_0x7b06('0x39')]);}};Acw[_0x7b06('0x18')]['syncAgentConnectPreview']=function(_0x1f1acb){try{if(this[_0x7b06('0x6')][_0x1f1acb[_0x7b06('0x34')]]&&(this[_0x7b06('0x6')][_0x1f1acb[_0x7b06('0x34')]][_0x7b06('0x3a')]||this[_0x7b06('0x6')][_0x1f1acb[_0x7b06('0x34')]][_0x7b06('0x1c')])){if(this[_0x7b06('0x7')][_0x1f1acb[_0x7b06('0x1b')]]){this[_0x7b06('0x1a')][_0x1f1acb[_0x7b06('0x29')]]={'queue':_0x1f1acb['queue'],'interface':_0x1f1acb[_0x7b06('0x1b')]};}}}catch(_0x275acf){logger[_0x7b06('0x2f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x275acf[_0x7b06('0x39')]);}};Acw[_0x7b06('0x18')][_0x7b06('0x3c')]=function(_0xecac44){try{if(this[_0x7b06('0x1a')][_0xecac44[_0x7b06('0x29')]]&&_[_0x7b06('0x3d')](this[_0x7b06('0x1a')][_0xecac44[_0x7b06('0x29')]][_0x7b06('0x23')])){logger[_0x7b06('0x21')](_0x7b06('0x3e'),_0xecac44[_0x7b06('0x29')]);this['startAcw'](_0xecac44[_0x7b06('0x29')]);}else if(this[_0x7b06('0x1a')][_0xecac44[_0x7b06('0x3f')]]&&_['isUndefined'](this[_0x7b06('0x1a')][_0xecac44[_0x7b06('0x3f')]][_0x7b06('0x23')])){logger['info']('[%s][HANGUP:LINKEDID]',_0xecac44[_0x7b06('0x3f')]);this['startAcw'](_0xecac44[_0x7b06('0x3f')]);}}catch(_0x24339b){logger[_0x7b06('0x2f')](_0x7b06('0x40'),_0x24339b[_0x7b06('0x39')]);}};Acw[_0x7b06('0x18')][_0x7b06('0xd')]=function(_0x5031df){try{if(this[_0x7b06('0x1a')][_0x5031df[_0x7b06('0x29')]]&&this[_0x7b06('0x1a')][_0x5031df[_0x7b06('0x29')]][_0x7b06('0x23')]){logger[_0x7b06('0x21')](_0x7b06('0x41'),_0x5031df[_0x7b06('0x29')]);this[_0x7b06('0x19')](_0x5031df[_0x7b06('0x29')]);}else if(this[_0x7b06('0x1a')][_0x5031df[_0x7b06('0x3f')]]&&this[_0x7b06('0x1a')][_0x5031df[_0x7b06('0x3f')]][_0x7b06('0x23')]){logger[_0x7b06('0x21')](_0x7b06('0x42'),_0x5031df[_0x7b06('0x3f')]);this['startAcw'](_0x5031df[_0x7b06('0x3f')]);}}catch(_0x42e311){logger[_0x7b06('0x2f')](_0x7b06('0x43'),_0x42e311[_0x7b06('0x39')]);}};Acw[_0x7b06('0x18')][_0x7b06('0x11')]=function(_0x58f1cd){try{if(!_[_0x7b06('0x44')](this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x45')]])){this['startAcw'](_0x58f1cd[_0x7b06('0x45')]);if(this[_0x7b06('0x1a')][_0x58f1cd['secondtransfereruniqueid']]){this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x46')]][_0x7b06('0x23')]=!![];this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x47')]]=this['channels'][_0x58f1cd['secondtransfereruniqueid']];delete this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x46')]];}}else if(!_[_0x7b06('0x44')](this[_0x7b06('0x1a')][_0x58f1cd['transfertargetuniqueid']])){this[_0x7b06('0x19')](_0x58f1cd[_0x7b06('0x47')]);if(this[_0x7b06('0x1a')][_0x58f1cd['origtransfereruniqueid']]){this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x48')]][_0x7b06('0x23')]=!![];this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x45')]]=this['channels'][_0x58f1cd['origtransfereruniqueid']];delete this[_0x7b06('0x1a')][_0x58f1cd[_0x7b06('0x48')]];}}}catch(_0x1ec049){logger[_0x7b06('0x2f')](_0x7b06('0x49'),_0x1ec049[_0x7b06('0x39')]);}};Acw['prototype'][_0x7b06('0x13')]=function(_0x52361e){try{if(this[_0x7b06('0x1a')][_0x52361e[_0x7b06('0x4a')]]){logger[_0x7b06('0x21')](_0x7b06('0x4b'),JSON['stringify'](_0x52361e[_0x7b06('0x4a')]));this['startAcw'](_0x52361e[_0x7b06('0x4a')]);}else if(this[_0x7b06('0x1a')][_0x52361e[_0x7b06('0x4c')]]){logger[_0x7b06('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x52361e[_0x7b06('0x4c')]));this[_0x7b06('0x19')](_0x52361e[_0x7b06('0x4c')]);}}catch(_0x51a478){logger[_0x7b06('0x2f')](_0x7b06('0x4d'),_0x51a478[_0x7b06('0x39')]);}};Acw[_0x7b06('0x18')][_0x7b06('0xf')]=function(_0x27a085){try{if(this[_0x7b06('0x6')][_0x27a085[_0x7b06('0x34')]]&&this[_0x7b06('0x6')][_0x27a085[_0x7b06('0x34')]]['autopause']===_0x7b06('0x4e')){if(this[_0x7b06('0x7')][_0x27a085[_0x7b06('0x1b')]]){logger[_0x7b06('0x21')](_0x7b06('0x4f'),_0x27a085[_0x7b06('0x29')],_0x27a085[_0x7b06('0x1b')],_0x27a085[_0x7b06('0x34')]);return RpcUser[_0x7b06('0x50')](this['agents'][_0x27a085[_0x7b06('0x1b')]],_0x7b06('0x51'),_0x27a085[_0x7b06('0x29')]);}}}catch(_0x5c7433){logger[_0x7b06('0x2f')](_0x7b06('0x52'),_0x5c7433[_0x7b06('0x39')]);}};module[_0x7b06('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a37b105..f6c73f7 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x32bb4b,_0x298777){var _0x35de07=function(_0x52fb02){while(--_0x52fb02){_0x32bb4b['push'](_0x32bb4b['shift']());}};_0x35de07(++_0x298777);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cce5a,_0x298d54){_0x5cce5a=_0x5cce5a-0x0;var _0x354e33=_0xb10b[_0x5cce5a];return _0x354e33;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x38fedf,_0xc5e240){var _0x39e44a=function(_0x24f38f){while(--_0x24f38f){_0x38fedf['push'](_0x38fedf['shift']());}};_0x39e44a(++_0xc5e240);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5758f9d..f1bfbf2 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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x26ea2f,_0x3e9249){var _0x4f492c=function(_0x417112){while(--_0x417112){_0x26ea2f['push'](_0x26ea2f['shift']());}};_0x4f492c(++_0x3e9249);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xcb91[_0x288f5e];return _0x476cc9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2e8749b..ef3baab 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 _0x298d=['prototype','getCaller','substring','dialCutDigit','queue','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','phone','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x298d,0x7e));var _0xd298=function(_0x2e4fd7,_0x20882b){_0x2e4fd7=_0x2e4fd7-0x0;var _0x67b377=_0x298d[_0x2e4fd7];return _0x67b377;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd298('0x0'));function checkNameSurname(_0x4d6a47,_0x5defd6,_0x5aaaa7){var _0x386978='';if(!_[_0xd298('0x1')](_0x5defd6)&&_0xd298('0x2')===typeof _0x5defd6){_0x386978+=_0x5defd6;}if(!_[_0xd298('0x1')](_0x5aaaa7)&&_0xd298('0x2')===typeof _0x5aaaa7){_0x386978+='\x20'+_0x5aaaa7;}if(_0x386978!==''){return _0x386978;}return _0x4d6a47;}function Action(_0x40ffc8,_0x435939,_0x5b8e0e){this[_0xd298('0x3')]=_0x40ffc8;this[_0xd298('0x4')]=_0x5b8e0e||undefined;this[_0xd298('0x5')]=checkNameSurname(_0x435939[_0xd298('0x6')]['phone'],_0x435939[_0xd298('0x6')]['firstName'],_0x435939['Contact'][_0xd298('0x7')]);this[_0xd298('0x8')]=_0x435939[_0xd298('0x6')][_0xd298('0x9')];this['queue']=_0x40ffc8[_0xd298('0x5')];this[_0xd298('0xa')]=_0x435939['active']||![];this['type']=_0x40ffc8['type'];this[_0xd298('0xb')]=_0x40ffc8[_0xd298('0xb')]||0x3;this[_0xd298('0xc')]=_0x435939['scheduledat'];this[_0xd298('0xd')]=_0x435939[_0xd298('0xd')];this[_0xd298('0xe')]=_0x435939[_0xd298('0xe')];this[_0xd298('0xf')]=_0x435939[_0xd298('0xf')];this[_0xd298('0x10')]=_0x435939[_0xd298('0x10')];this['countdropretry']=_0x435939[_0xd298('0x11')];this[_0xd298('0x12')]=_0x435939[_0xd298('0x12')];this['countmachineretry']=_0x435939['countmachineretry'];this[_0xd298('0x13')]=_0x435939[_0xd298('0x13')];this[_0xd298('0x14')]=_0x435939[_0xd298('0x14')];this['ListId']=_0x435939[_0xd298('0x15')];this['UserId']=_0x435939[_0xd298('0x16')];this[_0xd298('0x17')]=_0x435939['VoiceQueueId'];this[_0xd298('0x18')]=_0x435939['CampaignId'];this[_0xd298('0x19')]=_0x435939['id'];this['ContactFirstName']=_0x435939['Contact']['firstName']||'';this['starttime']=moment()[_0xd298('0x1a')](_0xd298('0x1b'));this[_0xd298('0x1c')]=_0x435939['callback'];this[_0xd298('0x1d')]=_0x435939[_0xd298('0x1d')];this['callbackat']=_0x435939[_0xd298('0x1e')];this['recallme']=_0x435939[_0xd298('0x1f')];this[_0xd298('0x20')]='';this[_0xd298('0x21')]='';}Action[_0xd298('0x22')][_0xd298('0x23')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xd298('0x5')],this[_0xd298('0x3')]['dialCutDigit']>0x0?this['number'][_0xd298('0x24')](this[_0xd298('0x3')][_0xd298('0x25')]):this[_0xd298('0x8')]);};Action['prototype']['getQueue']=function(){return this[_0xd298('0x26')];};module[_0xd298('0x27')]=Action; \ No newline at end of file +var _0x5d5e=['idHopper','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','queue','util','lodash','moment','string','isNil','uniqueid','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x6c4901,_0x45956a){var _0x50af8f=function(_0x3eea14){while(--_0x3eea14){_0x6c4901['push'](_0x6c4901['shift']());}};_0x50af8f(++_0x45956a);}(_0x5d5e,0x118));var _0xe5d5=function(_0x50c2d8,_0x5142f1){_0x50c2d8=_0x50c2d8-0x0;var _0x26b6e9=_0x5d5e[_0x50c2d8];return _0x26b6e9;};'use strict';var util=require(_0xe5d5('0x0'));var _=require(_0xe5d5('0x1'));var moment=require(_0xe5d5('0x2'));function checkNameSurname(_0x1e479d,_0x1b5f80,_0x1ca62e){var _0x157c36='';if(!_['isNil'](_0x1b5f80)&&_0xe5d5('0x3')===typeof _0x1b5f80){_0x157c36+=_0x1b5f80;}if(!_[_0xe5d5('0x4')](_0x1ca62e)&&_0xe5d5('0x3')===typeof _0x1ca62e){_0x157c36+='\x20'+_0x1ca62e;}if(_0x157c36!==''){return _0x157c36;}return _0x1e479d;}function Action(_0x15c6f3,_0x27504a,_0xdf5fcd){this['voiceQueue']=_0x15c6f3;this[_0xe5d5('0x5')]=_0xdf5fcd||undefined;this[_0xe5d5('0x6')]=checkNameSurname(_0x27504a[_0xe5d5('0x7')]['phone'],_0x27504a['Contact'][_0xe5d5('0x8')],_0x27504a['Contact'][_0xe5d5('0x9')]);this[_0xe5d5('0xa')]=_0x27504a[_0xe5d5('0x7')][_0xe5d5('0xb')];this['queue']=_0x15c6f3[_0xe5d5('0x6')];this['active']=_0x27504a[_0xe5d5('0xc')]||![];this[_0xe5d5('0xd')]=_0x15c6f3['type'];this[_0xe5d5('0xe')]=_0x15c6f3['dialQueueTimeout']||0x3;this['scheduledat']=_0x27504a[_0xe5d5('0xf')];this[_0xe5d5('0x10')]=_0x27504a['countbusyretry'];this[_0xe5d5('0x11')]=_0x27504a[_0xe5d5('0x11')];this['countnoanswerretry']=_0x27504a['countnoanswerretry'];this[_0xe5d5('0x12')]=_0x27504a[_0xe5d5('0x12')];this['countdropretry']=_0x27504a[_0xe5d5('0x13')];this[_0xe5d5('0x14')]=_0x27504a[_0xe5d5('0x14')];this[_0xe5d5('0x15')]=_0x27504a[_0xe5d5('0x15')];this[_0xe5d5('0x16')]=_0x27504a[_0xe5d5('0x16')];this[_0xe5d5('0x17')]=_0x27504a[_0xe5d5('0x17')];this[_0xe5d5('0x18')]=_0x27504a[_0xe5d5('0x18')];this[_0xe5d5('0x19')]=_0x27504a[_0xe5d5('0x19')];this['VoiceQueueId']=_0x27504a[_0xe5d5('0x1a')];this[_0xe5d5('0x1b')]=_0x27504a['CampaignId'];this[_0xe5d5('0x1c')]=_0x27504a['id'];this[_0xe5d5('0x1d')]=_0x27504a[_0xe5d5('0x7')][_0xe5d5('0x8')]||'';this['starttime']=moment()[_0xe5d5('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe5d5('0x1f')]=_0x27504a['callback'];this[_0xe5d5('0x20')]=_0x27504a['callbackuniqueid'];this[_0xe5d5('0x21')]=_0x27504a[_0xe5d5('0x21')];this[_0xe5d5('0x22')]=_0x27504a[_0xe5d5('0x22')];this[_0xe5d5('0x23')]='';this['originatecalleridname']='';}Action[_0xe5d5('0x24')][_0xe5d5('0x25')]=function(){return util[_0xe5d5('0x1e')](_0xe5d5('0x26'),this['name'],this[_0xe5d5('0x27')][_0xe5d5('0x28')]>0x0?this[_0xe5d5('0xa')][_0xe5d5('0x29')](this[_0xe5d5('0x27')][_0xe5d5('0x28')]):this[_0xe5d5('0xa')]);};Action[_0xe5d5('0x24')][_0xe5d5('0x2a')]=function(){return this[_0xe5d5('0x2b')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 0997f37..7c8b04a 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 _0xbc3c=['exports','lodash','moment','milliseconds','diff','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x3b7db2,_0x5edd58){var _0x3a819e=function(_0x207221){while(--_0x207221){_0x3b7db2['push'](_0x3b7db2['shift']());}};_0x3a819e(++_0x5edd58);}(_0xbc3c,0x184));var _0xcbc3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xbc3c[_0x122096];return _0x3d1966;};'use strict';var util=require('util');var _=require(_0xcbc3('0x0'));var moment=require(_0xcbc3('0x1'));function getSeconds(_0xe0e837,_0x3c45b2){var _0x25d8c3=moment(_0xe0e837)[_0xcbc3('0x2')](0x0);var _0x48e9fe=moment(_0x3c45b2)[_0xcbc3('0x2')](0x0);return _0x25d8c3[_0xcbc3('0x3')](_0x48e9fe,'seconds');}function AgentComplete(_0x170f86,_0x2b243b){this[_0xcbc3('0x4')]=0x4;this['statedesc']=_0xcbc3('0x5');this[_0xcbc3('0x6')]=_0x170f86[_0xcbc3('0x6')];this[_0xcbc3('0x7')]=_0x170f86['type'];this['campaigntype']=_0x170f86[_0xcbc3('0x7')]===_0xcbc3('0x8')?_0xcbc3('0x9'):_0x170f86[_0xcbc3('0x7')];this[_0xcbc3('0xa')]=_0x170f86['countbusyretry'];this['countcongestionretry']=_0x170f86[_0xcbc3('0xb')];this[_0xcbc3('0xc')]=_0x170f86[_0xcbc3('0xc')];this[_0xcbc3('0xd')]=_0x170f86[_0xcbc3('0xa')]+_0x170f86[_0xcbc3('0xb')]+_0x170f86[_0xcbc3('0xc')]+_0x170f86[_0xcbc3('0xe')]+_0x170f86['countdropretry']+_0x170f86['countabandonedretry']+_0x170f86[_0xcbc3('0xf')]+_0x170f86[_0xcbc3('0x10')];this[_0xcbc3('0xe')]=_0x170f86[_0xcbc3('0xe')];this[_0xcbc3('0x11')]=_0x170f86[_0xcbc3('0x11')];this['countabandonedretry']=_0x170f86[_0xcbc3('0x12')];this[_0xcbc3('0xf')]=_0x170f86[_0xcbc3('0xf')];this[_0xcbc3('0x10')]=_0x170f86[_0xcbc3('0x10')];this['uniqueid']=_0x2b243b['uniqueid'];this[_0xcbc3('0x13')]=_0x170f86[_0xcbc3('0x14')];this[_0xcbc3('0x15')]=_0x170f86[_0xcbc3('0x16')];this[_0xcbc3('0x17')]=_0x170f86[_0xcbc3('0x17')];this[_0xcbc3('0x18')]=_0x170f86[_0xcbc3('0x18')];this[_0xcbc3('0x19')]=_0x170f86[_0xcbc3('0x19')];this['endtime']=moment()[_0xcbc3('0x1a')](_0xcbc3('0x1b'));this[_0xcbc3('0x1c')]=getSeconds(_0x170f86['responsetime'],_0x170f86[_0xcbc3('0x17')]);this['holdtime']=getSeconds(_0x170f86[_0xcbc3('0x19')],_0x170f86[_0xcbc3('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x170f86[_0xcbc3('0x19')]);this[_0xcbc3('0x9')]=_0x2b243b[_0xcbc3('0x9')];this['membername']=_0x2b243b[_0xcbc3('0x1d')];this[_0xcbc3('0x1e')]=_0x2b243b[_0xcbc3('0x1e')];this[_0xcbc3('0x1f')]=_0x170f86[_0xcbc3('0x1f')];this[_0xcbc3('0x20')]=_0x170f86['callbackuniqueid'];this[_0xcbc3('0x21')]=_0x170f86[_0xcbc3('0x21')];this[_0xcbc3('0x22')]=_0x170f86[_0xcbc3('0x22')];this[_0xcbc3('0x23')]=_0x170f86[_0xcbc3('0x23')];this[_0xcbc3('0x24')]=_0x170f86['ListId'];this[_0xcbc3('0x25')]=_0x170f86[_0xcbc3('0x25')];this[_0xcbc3('0x26')]=_0x170f86[_0xcbc3('0x26')];this[_0xcbc3('0x27')]=_0x170f86['CampaignId'];this['originatecalleridnum']=_0x170f86[_0xcbc3('0x28')]||'';this[_0xcbc3('0x29')]=_0x170f86[_0xcbc3('0x29')]||'';}module[_0xcbc3('0x2a')]=AgentComplete; \ No newline at end of file +var _0x3945=['queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type'];(function(_0x28e7ad,_0x304787){var _0x111aeb=function(_0x1df52b){while(--_0x1df52b){_0x28e7ad['push'](_0x28e7ad['shift']());}};_0x111aeb(++_0x304787);}(_0x3945,0xd4));var _0x5394=function(_0x5408cb,_0x294623){_0x5408cb=_0x5408cb-0x0;var _0x2b5ae8=_0x3945[_0x5408cb];return _0x2b5ae8;};'use strict';var util=require('util');var _=require(_0x5394('0x0'));var moment=require('moment');function getSeconds(_0xef03c0,_0x215851){var _0x5903f6=moment(_0xef03c0)['milliseconds'](0x0);var _0x3c9b33=moment(_0x215851)[_0x5394('0x1')](0x0);return _0x5903f6[_0x5394('0x2')](_0x3c9b33,_0x5394('0x3'));}function AgentComplete(_0x4a64ad,_0x37b40f){this[_0x5394('0x4')]=0x4;this[_0x5394('0x5')]='Answer';this[_0x5394('0x6')]=_0x4a64ad[_0x5394('0x6')];this[_0x5394('0x7')]=_0x4a64ad['type'];this['campaigntype']=_0x4a64ad[_0x5394('0x7')]==='outbound'?_0x5394('0x8'):_0x4a64ad[_0x5394('0x7')];this['countbusyretry']=_0x4a64ad[_0x5394('0x9')];this[_0x5394('0xa')]=_0x4a64ad[_0x5394('0xa')];this['countnoanswerretry']=_0x4a64ad['countnoanswerretry'];this[_0x5394('0xb')]=_0x4a64ad[_0x5394('0x9')]+_0x4a64ad['countcongestionretry']+_0x4a64ad[_0x5394('0xc')]+_0x4a64ad[_0x5394('0xd')]+_0x4a64ad[_0x5394('0xe')]+_0x4a64ad[_0x5394('0xf')]+_0x4a64ad[_0x5394('0x10')]+_0x4a64ad[_0x5394('0x11')];this[_0x5394('0xd')]=_0x4a64ad[_0x5394('0xd')];this[_0x5394('0xe')]=_0x4a64ad[_0x5394('0xe')];this[_0x5394('0xf')]=_0x4a64ad['countabandonedretry'];this[_0x5394('0x10')]=_0x4a64ad[_0x5394('0x10')];this[_0x5394('0x11')]=_0x4a64ad[_0x5394('0x11')];this[_0x5394('0x12')]=_0x37b40f[_0x5394('0x12')];this[_0x5394('0x13')]=_0x4a64ad[_0x5394('0x14')];this[_0x5394('0x15')]=_0x4a64ad[_0x5394('0x16')];this[_0x5394('0x17')]=_0x4a64ad[_0x5394('0x17')];this['responsetime']=_0x4a64ad[_0x5394('0x18')];this[_0x5394('0x19')]=_0x4a64ad[_0x5394('0x19')];this[_0x5394('0x1a')]=moment()[_0x5394('0x1b')](_0x5394('0x1c'));this['ringtime']=getSeconds(_0x4a64ad[_0x5394('0x18')],_0x4a64ad[_0x5394('0x17')]);this['holdtime']=getSeconds(_0x4a64ad[_0x5394('0x19')],_0x4a64ad[_0x5394('0x18')]);this[_0x5394('0x1d')]=getSeconds(this['endtime'],_0x4a64ad[_0x5394('0x19')]);this[_0x5394('0x8')]=_0x37b40f[_0x5394('0x8')];this[_0x5394('0x1e')]=_0x37b40f['membername'];this[_0x5394('0x1f')]=_0x37b40f[_0x5394('0x1f')];this[_0x5394('0x20')]=_0x4a64ad[_0x5394('0x20')];this[_0x5394('0x21')]=_0x4a64ad[_0x5394('0x21')];this[_0x5394('0x22')]=_0x4a64ad[_0x5394('0x22')];this[_0x5394('0x23')]=_0x4a64ad['recallme'];this[_0x5394('0x24')]=_0x4a64ad[_0x5394('0x24')];this[_0x5394('0x25')]=_0x4a64ad[_0x5394('0x25')];this['UserId']=_0x4a64ad[_0x5394('0x26')];this[_0x5394('0x27')]=_0x4a64ad[_0x5394('0x27')];this['CampaignId']=_0x4a64ad[_0x5394('0x28')];this['originatecalleridnum']=_0x4a64ad[_0x5394('0x29')]||'';this[_0x5394('0x2a')]=_0x4a64ad['originatecalleridname']||'';}module[_0x5394('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index cd6cfc0..6501510 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 _0xce50=['scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','moment','milliseconds','uniqueid'];(function(_0x3b26a8,_0x153882){var _0x1f33b7=function(_0x2a1a4a){while(--_0x2a1a4a){_0x3b26a8['push'](_0x3b26a8['shift']());}};_0x1f33b7(++_0x153882);}(_0xce50,0x1d8));var _0x0ce5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xce50[_0x45d3f0];return _0x314b79;};'use strict';var util=require('util');var _=require(_0x0ce5('0x0'));var moment=require(_0x0ce5('0x1'));function getSeconds(_0x5ddd3c,_0x363236){var _0x1eddd3=moment(_0x5ddd3c)['milliseconds'](0x0);var _0x5969ab=moment(_0x363236)[_0x0ce5('0x2')](0x0);return _0x1eddd3['diff'](_0x5969ab,'seconds');}function Final(_0x15c8ba){this[_0x0ce5('0x3')]=_0x15c8ba[_0x0ce5('0x3')];this[_0x0ce5('0x4')]=_0x15c8ba['scheduledat'];this[_0x0ce5('0x5')]=_0x15c8ba[_0x0ce5('0x5')];this['campaigntype']=_0x15c8ba[_0x0ce5('0x5')]==='outbound'?_0x0ce5('0x6'):_0x15c8ba[_0x0ce5('0x5')];this[_0x0ce5('0x7')]=_0x15c8ba[_0x0ce5('0x7')];this['countcongestionretry']=_0x15c8ba[_0x0ce5('0x8')];this[_0x0ce5('0x9')]=_0x15c8ba[_0x0ce5('0x9')];this[_0x0ce5('0xa')]=_0x15c8ba[_0x0ce5('0x7')]+_0x15c8ba['countcongestionretry']+_0x15c8ba['countnoanswerretry']+_0x15c8ba['countnosuchnumberretry']+_0x15c8ba[_0x0ce5('0xb')]+_0x15c8ba[_0x0ce5('0xc')]+_0x15c8ba[_0x0ce5('0xd')]+_0x15c8ba[_0x0ce5('0xe')];this['countnosuchnumberretry']=_0x15c8ba[_0x0ce5('0xf')];this[_0x0ce5('0xb')]=_0x15c8ba['countdropretry'];this[_0x0ce5('0xc')]=_0x15c8ba['countabandonedretry'];this[_0x0ce5('0xd')]=_0x15c8ba[_0x0ce5('0xd')];this[_0x0ce5('0xe')]=_0x15c8ba[_0x0ce5('0xe')];this[_0x0ce5('0x6')]=_0x15c8ba[_0x0ce5('0x6')];this[_0x0ce5('0x10')]=_0x15c8ba[_0x0ce5('0x10')];this['calleridnum']=_0x15c8ba[_0x0ce5('0x11')];this[_0x0ce5('0x12')]=_0x15c8ba['starttime'];this['responsetime']=_0x15c8ba[_0x0ce5('0x13')];this['endtime']=_0x15c8ba[_0x0ce5('0x13')];this[_0x0ce5('0x14')]=_0x15c8ba[_0x0ce5('0x14')]||0x0;this[_0x0ce5('0x15')]=_0x15c8ba[_0x0ce5('0x15')]||0x0;this[_0x0ce5('0x16')]=_0x15c8ba['talktime']||0x0;this[_0x0ce5('0x17')]=_0x15c8ba[_0x0ce5('0x17')];this[_0x0ce5('0x18')]=_0x15c8ba[_0x0ce5('0x18')];this['callbackat']=_0x15c8ba[_0x0ce5('0x19')];this['recallme']=_0x15c8ba[_0x0ce5('0x1a')];this[_0x0ce5('0x1b')]=_0x15c8ba[_0x0ce5('0x1b')];this[_0x0ce5('0x1c')]=_0x15c8ba[_0x0ce5('0x1c')];this[_0x0ce5('0x1d')]=_0x15c8ba[_0x0ce5('0x1d')];this[_0x0ce5('0x1e')]=_0x15c8ba[_0x0ce5('0x1e')];this[_0x0ce5('0x1f')]=_0x15c8ba['CampaignId'];this['originatecalleridnum']=_0x15c8ba[_0x0ce5('0x20')]||'';this['originatecalleridname']=_0x15c8ba['originatecalleridname']||'';}module[_0x0ce5('0x21')]=Final; \ No newline at end of file +var _0xe015=['countnosuchnumberretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x9f5ac3,_0x105765){var _0x534f9c=function(_0x38be43){while(--_0x38be43){_0x9f5ac3['push'](_0x9f5ac3['shift']());}};_0x534f9c(++_0x105765);}(_0xe015,0x13b));var _0x5e01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe015[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x5e01('0x0'));var _=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));function getSeconds(_0x5811ae,_0x51f689){var _0x46ed0d=moment(_0x5811ae)['milliseconds'](0x0);var _0x2136cf=moment(_0x51f689)[_0x5e01('0x3')](0x0);return _0x46ed0d[_0x5e01('0x4')](_0x2136cf,_0x5e01('0x5'));}function Final(_0x4ac3f1){this[_0x5e01('0x6')]=_0x4ac3f1[_0x5e01('0x6')];this['scheduledat']=_0x4ac3f1['scheduledat'];this[_0x5e01('0x7')]=_0x4ac3f1[_0x5e01('0x7')];this[_0x5e01('0x8')]=_0x4ac3f1[_0x5e01('0x7')]===_0x5e01('0x9')?_0x5e01('0xa'):_0x4ac3f1['type'];this[_0x5e01('0xb')]=_0x4ac3f1['countbusyretry'];this[_0x5e01('0xc')]=_0x4ac3f1['countcongestionretry'];this[_0x5e01('0xd')]=_0x4ac3f1[_0x5e01('0xd')];this['countglobal']=_0x4ac3f1[_0x5e01('0xb')]+_0x4ac3f1[_0x5e01('0xc')]+_0x4ac3f1['countnoanswerretry']+_0x4ac3f1['countnosuchnumberretry']+_0x4ac3f1[_0x5e01('0xe')]+_0x4ac3f1[_0x5e01('0xf')]+_0x4ac3f1[_0x5e01('0x10')]+_0x4ac3f1[_0x5e01('0x11')];this[_0x5e01('0x12')]=_0x4ac3f1[_0x5e01('0x12')];this['countdropretry']=_0x4ac3f1[_0x5e01('0xe')];this['countabandonedretry']=_0x4ac3f1['countabandonedretry'];this[_0x5e01('0x10')]=_0x4ac3f1[_0x5e01('0x10')];this['countagentrejectretry']=_0x4ac3f1[_0x5e01('0x11')];this['queue']=_0x4ac3f1[_0x5e01('0xa')];this['calleridname']=_0x4ac3f1[_0x5e01('0x13')];this['calleridnum']=_0x4ac3f1[_0x5e01('0x14')];this['starttime']=_0x4ac3f1['starttime'];this[_0x5e01('0x15')]=_0x4ac3f1[_0x5e01('0x15')];this['endtime']=_0x4ac3f1[_0x5e01('0x15')];this[_0x5e01('0x16')]=_0x4ac3f1[_0x5e01('0x16')]||0x0;this[_0x5e01('0x17')]=_0x4ac3f1[_0x5e01('0x17')]||0x0;this[_0x5e01('0x18')]=_0x4ac3f1[_0x5e01('0x18')]||0x0;this[_0x5e01('0x19')]=_0x4ac3f1['callback'];this[_0x5e01('0x1a')]=_0x4ac3f1[_0x5e01('0x1a')];this['callbackat']=_0x4ac3f1[_0x5e01('0x1b')];this[_0x5e01('0x1c')]=_0x4ac3f1[_0x5e01('0x1c')];this[_0x5e01('0x1d')]=_0x4ac3f1[_0x5e01('0x1d')];this[_0x5e01('0x1e')]=_0x4ac3f1['ListId'];this[_0x5e01('0x1f')]=_0x4ac3f1[_0x5e01('0x1f')];this[_0x5e01('0x20')]=_0x4ac3f1[_0x5e01('0x20')];this['CampaignId']=_0x4ac3f1[_0x5e01('0x21')];this[_0x5e01('0x22')]=_0x4ac3f1[_0x5e01('0x22')]||'';this['originatecalleridname']=_0x4ac3f1[_0x5e01('0x23')]||'';}module[_0x5e01('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8bd95fb..e0ca697 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 _0x8faa=['name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','campaigntype','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x8faa,0x17e));var _0xa8fa=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x8faa[_0x40dd56];return _0x4f850f;};'use strict';var util=require(_0xa8fa('0x0'));var _=require(_0xa8fa('0x1'));var moment=require(_0xa8fa('0x2'));function getSeconds(_0x246a03,_0x10555d){var _0x2ad842=moment(_0x246a03)[_0xa8fa('0x3')](0x0);var _0x11b7d1=moment(_0x10555d)[_0xa8fa('0x3')](0x0);return _0x2ad842[_0xa8fa('0x4')](_0x11b7d1,_0xa8fa('0x5'));}function Hangup(_0x5ce074,_0x3bdf4d){this[_0xa8fa('0x6')]=0x4;this[_0xa8fa('0x7')]=_0xa8fa('0x8');this[_0xa8fa('0x9')]=_0x5ce074[_0xa8fa('0x9')];this['type']=_0x5ce074['type'];this[_0xa8fa('0xa')]=_0x5ce074[_0xa8fa('0xb')]==='outbound'?'queue':_0x5ce074['type'];this[_0xa8fa('0xc')]=_0x5ce074[_0xa8fa('0xc')];this['countcongestionretry']=_0x5ce074[_0xa8fa('0xd')];this[_0xa8fa('0xe')]=_0x5ce074[_0xa8fa('0xe')];this[_0xa8fa('0xf')]=_0x5ce074['countbusyretry']+_0x5ce074[_0xa8fa('0xd')]+_0x5ce074[_0xa8fa('0xe')]+_0x5ce074['countnosuchnumberretry']+_0x5ce074[_0xa8fa('0x10')]+_0x5ce074[_0xa8fa('0x11')]+_0x5ce074[_0xa8fa('0x12')]+_0x5ce074[_0xa8fa('0x13')];this[_0xa8fa('0x14')]=_0x5ce074[_0xa8fa('0x14')];this[_0xa8fa('0x10')]=_0x5ce074[_0xa8fa('0x10')];this[_0xa8fa('0x11')]=_0x5ce074[_0xa8fa('0x11')];this['countmachineretry']=_0x5ce074[_0xa8fa('0x12')];this[_0xa8fa('0x13')]=_0x5ce074[_0xa8fa('0x13')];this[_0xa8fa('0x15')]=_0x3bdf4d['uniqueid'];this[_0xa8fa('0x16')]=_0x5ce074[_0xa8fa('0x17')];this[_0xa8fa('0x18')]=_0x5ce074['number'];this['starttime']=_0x5ce074[_0xa8fa('0x19')];this[_0xa8fa('0x1a')]=_0x5ce074[_0xa8fa('0x1a')];this['endtime']=moment()[_0xa8fa('0x1b')](_0xa8fa('0x1c'));this[_0xa8fa('0x1d')]=getSeconds(_0x5ce074[_0xa8fa('0x1a')],_0x5ce074[_0xa8fa('0x19')]);this['holdtime']=0x0;this[_0xa8fa('0x1e')]=getSeconds(this['endtime'],_0x5ce074[_0xa8fa('0x1a')]);this[_0xa8fa('0x1f')]=_0x5ce074[_0xa8fa('0x1f')];this[_0xa8fa('0x20')]=_0xa8fa('0x21');this[_0xa8fa('0x22')]=_0x3bdf4d['cause-txt'];this['callback']=_0x5ce074[_0xa8fa('0x23')];this[_0xa8fa('0x24')]=_0x5ce074[_0xa8fa('0x24')];this['callbackat']=_0x5ce074[_0xa8fa('0x25')];this[_0xa8fa('0x26')]=_0x5ce074[_0xa8fa('0x26')];this[_0xa8fa('0x27')]=_0x5ce074[_0xa8fa('0x27')];this['ListId']=_0x5ce074[_0xa8fa('0x28')];this[_0xa8fa('0x29')]=_0x5ce074[_0xa8fa('0x29')];this[_0xa8fa('0x2a')]=_0x5ce074['VoiceQueueId'];this[_0xa8fa('0x2b')]=_0x5ce074['CampaignId'];}module[_0xa8fa('0x2c')]=Hangup; \ No newline at end of file +var _0x5e38=['ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','seconds','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x38ad58,_0x505e3a){var _0x36abe3=function(_0x247b28){while(--_0x247b28){_0x38ad58['push'](_0x38ad58['shift']());}};_0x36abe3(++_0x505e3a);}(_0x5e38,0x190));var _0x85e3=function(_0x5d64ce,_0x33126c){_0x5d64ce=_0x5d64ce-0x0;var _0x2f8661=_0x5e38[_0x5d64ce];return _0x2f8661;};'use strict';var util=require('util');var _=require(_0x85e3('0x0'));var moment=require(_0x85e3('0x1'));function getSeconds(_0x560d46,_0x5cb3e3){var _0x35061b=moment(_0x560d46)[_0x85e3('0x2')](0x0);var _0x8f14d1=moment(_0x5cb3e3)[_0x85e3('0x2')](0x0);return _0x35061b['diff'](_0x8f14d1,_0x85e3('0x3'));}function Hangup(_0x6008d3,_0x256688){this[_0x85e3('0x4')]=0x4;this['statedesc']=_0x85e3('0x5');this[_0x85e3('0x6')]=_0x6008d3[_0x85e3('0x6')];this[_0x85e3('0x7')]=_0x6008d3[_0x85e3('0x7')];this[_0x85e3('0x8')]=_0x6008d3[_0x85e3('0x7')]==='outbound'?_0x85e3('0x9'):_0x6008d3[_0x85e3('0x7')];this[_0x85e3('0xa')]=_0x6008d3[_0x85e3('0xa')];this[_0x85e3('0xb')]=_0x6008d3[_0x85e3('0xb')];this[_0x85e3('0xc')]=_0x6008d3['countnoanswerretry'];this[_0x85e3('0xd')]=_0x6008d3[_0x85e3('0xa')]+_0x6008d3[_0x85e3('0xb')]+_0x6008d3[_0x85e3('0xc')]+_0x6008d3[_0x85e3('0xe')]+_0x6008d3[_0x85e3('0xf')]+_0x6008d3[_0x85e3('0x10')]+_0x6008d3[_0x85e3('0x11')]+_0x6008d3[_0x85e3('0x12')];this[_0x85e3('0xe')]=_0x6008d3[_0x85e3('0xe')];this[_0x85e3('0xf')]=_0x6008d3[_0x85e3('0xf')];this[_0x85e3('0x10')]=_0x6008d3[_0x85e3('0x10')];this[_0x85e3('0x11')]=_0x6008d3[_0x85e3('0x11')];this['countagentrejectretry']=_0x6008d3[_0x85e3('0x12')];this['uniqueid']=_0x256688[_0x85e3('0x13')];this[_0x85e3('0x14')]=_0x6008d3[_0x85e3('0x15')];this['calleridnum']=_0x6008d3[_0x85e3('0x16')];this[_0x85e3('0x17')]=_0x6008d3[_0x85e3('0x17')];this['responsetime']=_0x6008d3[_0x85e3('0x18')];this[_0x85e3('0x19')]=moment()[_0x85e3('0x1a')](_0x85e3('0x1b'));this[_0x85e3('0x1c')]=getSeconds(_0x6008d3[_0x85e3('0x18')],_0x6008d3[_0x85e3('0x17')]);this[_0x85e3('0x1d')]=0x0;this[_0x85e3('0x1e')]=getSeconds(this['endtime'],_0x6008d3[_0x85e3('0x18')]);this[_0x85e3('0x9')]=_0x6008d3[_0x85e3('0x9')];this[_0x85e3('0x1f')]=_0x85e3('0x20');this[_0x85e3('0x21')]=_0x256688[_0x85e3('0x22')];this[_0x85e3('0x23')]=_0x6008d3[_0x85e3('0x23')];this[_0x85e3('0x24')]=_0x6008d3[_0x85e3('0x24')];this[_0x85e3('0x25')]=_0x6008d3[_0x85e3('0x25')];this[_0x85e3('0x26')]=_0x6008d3[_0x85e3('0x26')];this[_0x85e3('0x27')]=_0x6008d3[_0x85e3('0x27')];this[_0x85e3('0x28')]=_0x6008d3[_0x85e3('0x28')];this[_0x85e3('0x29')]=_0x6008d3[_0x85e3('0x29')];this[_0x85e3('0x2a')]=_0x6008d3[_0x85e3('0x2a')];this[_0x85e3('0x2b')]=_0x6008d3[_0x85e3('0x2b')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 01ce447..28a4a24 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 _0x210c=['UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x235ba7,_0xf32628){var _0x2ff3f7=function(_0x28da31){while(--_0x28da31){_0x235ba7['push'](_0x235ba7['shift']());}};_0x2ff3f7(++_0xf32628);}(_0x210c,0x1a7));var _0xc210=function(_0x46d8b2,_0x3829c4){_0x46d8b2=_0x46d8b2-0x0;var _0x1a351f=_0x210c[_0x46d8b2];return _0x1a351f;};'use strict';var util=require(_0xc210('0x0'));var _=require('lodash');var moment=require(_0xc210('0x1'));function getSeconds(_0x2a242e,_0x18edae){var _0x257745=moment(_0x2a242e)[_0xc210('0x2')](0x0);var _0x208e5a=moment(_0x18edae)[_0xc210('0x2')](0x0);return _0x257745[_0xc210('0x3')](_0x208e5a,_0xc210('0x4'));}function History(_0x51c136){this[_0xc210('0x5')]=_0x51c136['uniqueid'];this['scheduledat']=_0x51c136[_0xc210('0x6')]||undefined;this[_0xc210('0x7')]=_0x51c136[_0xc210('0x7')];this[_0xc210('0x8')]=_0x51c136['type']===_0xc210('0x9')?_0xc210('0xa'):_0x51c136[_0xc210('0x7')];this[_0xc210('0xb')]=_0x51c136['countbusyretry'];this[_0xc210('0xc')]=_0x51c136[_0xc210('0xc')];this[_0xc210('0xd')]=_0x51c136['countnoanswerretry'];this['countglobal']=_0x51c136[_0xc210('0xb')]+_0x51c136[_0xc210('0xc')]+_0x51c136[_0xc210('0xd')]+_0x51c136[_0xc210('0xe')]+_0x51c136[_0xc210('0xf')]+_0x51c136[_0xc210('0x10')]+_0x51c136[_0xc210('0x11')]+_0x51c136[_0xc210('0x12')];this['countnosuchnumberretry']=_0x51c136[_0xc210('0xe')];this[_0xc210('0xf')]=_0x51c136['countdropretry'];this['countabandonedretry']=_0x51c136[_0xc210('0x10')];this['countmachineretry']=_0x51c136[_0xc210('0x11')];this[_0xc210('0x12')]=_0x51c136[_0xc210('0x12')];this[_0xc210('0xa')]=_0x51c136[_0xc210('0xa')];this[_0xc210('0x13')]=_0x51c136['name'];this['calleridnum']=_0x51c136[_0xc210('0x14')];this[_0xc210('0x15')]=_0x51c136['starttime'];this['responsetime']=_0x51c136['responsetime'];this[_0xc210('0x16')]=_0x51c136[_0xc210('0x17')];this[_0xc210('0x18')]=getSeconds(_0x51c136[_0xc210('0x17')],_0x51c136[_0xc210('0x15')]);this[_0xc210('0x19')]=0x0;this[_0xc210('0x1a')]=0x0;this[_0xc210('0x1b')]=_0x51c136[_0xc210('0x1b')];this['callbackuniqueid']=_0x51c136[_0xc210('0x1c')];this[_0xc210('0x1d')]=_0x51c136['callbackat'];this[_0xc210('0x1e')]=_0x51c136[_0xc210('0x1e')];this['ContactId']=_0x51c136[_0xc210('0x1f')];this[_0xc210('0x20')]=_0x51c136[_0xc210('0x20')];this['UserId']=_0x51c136[_0xc210('0x21')];this['VoiceQueueId']=_0x51c136['VoiceQueueId'];this[_0xc210('0x22')]=_0x51c136[_0xc210('0x22')];this[_0xc210('0x23')]=_0x51c136[_0xc210('0x23')]||'';this[_0xc210('0x24')]=_0x51c136[_0xc210('0x24')]||'';}module[_0xc210('0x25')]=History; \ No newline at end of file +var _0xfa13=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime'];(function(_0x3411fa,_0xe5f1e3){var _0x4bd652=function(_0x33cf86){while(--_0x33cf86){_0x3411fa['push'](_0x3411fa['shift']());}};_0x4bd652(++_0xe5f1e3);}(_0xfa13,0x1a6));var _0x3fa1=function(_0x122f7e,_0x6867ab){_0x122f7e=_0x122f7e-0x0;var _0x3c5f30=_0xfa13[_0x122f7e];return _0x3c5f30;};'use strict';var util=require(_0x3fa1('0x0'));var _=require(_0x3fa1('0x1'));var moment=require(_0x3fa1('0x2'));function getSeconds(_0x30c7b5,_0x9599d7){var _0x51622d=moment(_0x30c7b5)[_0x3fa1('0x3')](0x0);var _0x160598=moment(_0x9599d7)['milliseconds'](0x0);return _0x51622d[_0x3fa1('0x4')](_0x160598,_0x3fa1('0x5'));}function History(_0x32765e){this[_0x3fa1('0x6')]=_0x32765e[_0x3fa1('0x6')];this[_0x3fa1('0x7')]=_0x32765e[_0x3fa1('0x7')]||undefined;this[_0x3fa1('0x8')]=_0x32765e[_0x3fa1('0x8')];this[_0x3fa1('0x9')]=_0x32765e[_0x3fa1('0x8')]===_0x3fa1('0xa')?_0x3fa1('0xb'):_0x32765e['type'];this[_0x3fa1('0xc')]=_0x32765e[_0x3fa1('0xc')];this[_0x3fa1('0xd')]=_0x32765e['countcongestionretry'];this[_0x3fa1('0xe')]=_0x32765e[_0x3fa1('0xe')];this['countglobal']=_0x32765e[_0x3fa1('0xc')]+_0x32765e['countcongestionretry']+_0x32765e[_0x3fa1('0xe')]+_0x32765e[_0x3fa1('0xf')]+_0x32765e[_0x3fa1('0x10')]+_0x32765e[_0x3fa1('0x11')]+_0x32765e[_0x3fa1('0x12')]+_0x32765e[_0x3fa1('0x13')];this[_0x3fa1('0xf')]=_0x32765e[_0x3fa1('0xf')];this[_0x3fa1('0x10')]=_0x32765e[_0x3fa1('0x10')];this[_0x3fa1('0x11')]=_0x32765e[_0x3fa1('0x11')];this[_0x3fa1('0x12')]=_0x32765e[_0x3fa1('0x12')];this[_0x3fa1('0x13')]=_0x32765e[_0x3fa1('0x13')];this[_0x3fa1('0xb')]=_0x32765e[_0x3fa1('0xb')];this[_0x3fa1('0x14')]=_0x32765e[_0x3fa1('0x15')];this[_0x3fa1('0x16')]=_0x32765e[_0x3fa1('0x17')];this[_0x3fa1('0x18')]=_0x32765e[_0x3fa1('0x18')];this[_0x3fa1('0x19')]=_0x32765e[_0x3fa1('0x19')];this[_0x3fa1('0x1a')]=_0x32765e[_0x3fa1('0x19')];this[_0x3fa1('0x1b')]=getSeconds(_0x32765e[_0x3fa1('0x19')],_0x32765e['starttime']);this['holdtime']=0x0;this[_0x3fa1('0x1c')]=0x0;this[_0x3fa1('0x1d')]=_0x32765e[_0x3fa1('0x1d')];this[_0x3fa1('0x1e')]=_0x32765e[_0x3fa1('0x1e')];this[_0x3fa1('0x1f')]=_0x32765e[_0x3fa1('0x1f')];this[_0x3fa1('0x20')]=_0x32765e['recallme'];this['ContactId']=_0x32765e[_0x3fa1('0x21')];this[_0x3fa1('0x22')]=_0x32765e[_0x3fa1('0x22')];this[_0x3fa1('0x23')]=_0x32765e[_0x3fa1('0x23')];this[_0x3fa1('0x24')]=_0x32765e[_0x3fa1('0x24')];this[_0x3fa1('0x25')]=_0x32765e['CampaignId'];this[_0x3fa1('0x26')]=_0x32765e[_0x3fa1('0x26')]||'';this['originatecalleridname']=_0x32765e[_0x3fa1('0x27')]||'';}module[_0x3fa1('0x28')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 4ea833b..90276f0 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 _0xdbf4=['noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','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(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','abandonmentRate','busyFactor','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','Blacklist','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','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','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./final','./agentComplete','./queueCallerAbandon','./hangup','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBookedRR','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','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','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startProgressive','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','undefined','enqueue','isNil','Action','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','SIP/%s','status','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HangupInAMD','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','membername','countmachineretry','countglobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','cause-txt','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','calleridname','[syncAgentComplete][createHistory][10]','dialAbandonedMaxRetry','calleridnum','[syncAgentComplete][createHistory][11]','channel','actionid','locked','stateinterface','rrmemory','queueBooked','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer'];(function(_0x109360,_0xe25fed){var _0x5b84f2=function(_0xb2056){while(--_0xb2056){_0x109360['push'](_0x109360['shift']());}};_0x5b84f2(++_0xe25fed);}(_0xdbf4,0x67));var _0x4dbf=function(_0x478ed5,_0x573ca5){_0x478ed5=_0x478ed5-0x0;var _0x3c0fa3=_0xdbf4[_0x478ed5];return _0x3c0fa3;};'use strict';var util=require('util');var _=require(_0x4dbf('0x0'));var BPromise=require(_0x4dbf('0x1'));var uuid=require(_0x4dbf('0x2'));var moment=require(_0x4dbf('0x3'));var rr=require('rr');var md5=require(_0x4dbf('0x4'));var Redis=require(_0x4dbf('0x5'));var ut=require(_0x4dbf('0x6'));var config=require(_0x4dbf('0x7'));var logger=require(_0x4dbf('0x8'))(_0x4dbf('0x9'));var loggerBooked=require(_0x4dbf('0x8'))(_0x4dbf('0xa'));var loggerPredictive=require(_0x4dbf('0x8'))(_0x4dbf('0xb'));var loggerPredictiveCalls=require(_0x4dbf('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x4dbf('0x8'))(_0x4dbf('0xc'));var ami=require('../ami');config['redis']=_[_0x4dbf('0xd')](config[_0x4dbf('0xe')],{'host':_0x4dbf('0xf'),'port':0x18eb});var io=require(_0x4dbf('0x10'))(new Redis(config[_0x4dbf('0xe')]));var cmHopper=require(_0x4dbf('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x4dbf('0x12'));var RpcSetting=require(_0x4dbf('0x13'));var Action=require('./action');var History=require('./history');var Final=require(_0x4dbf('0x14'));var AgentComplete=require(_0x4dbf('0x15'));var QueueCallerAbandon=require(_0x4dbf('0x16'));var Hangup=require(_0x4dbf('0x17'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x4dbf('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0x4dbf('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4dbf('0x1a')]['enqueue']=function(_0x46b9f9){this['tail']=this[_0x4dbf('0x1b')]?this['tail'][_0x4dbf('0x1c')](_0x46b9f9):_0x46b9f9();};function Dialer(_0x1cb0d5,_0x49e8f1){this[_0x4dbf('0x1d')]=new Sequence();this[_0x4dbf('0x1e')]=_0x49e8f1;this['voiceQueues']=_0x1cb0d5[_0x4dbf('0x1f')];this[_0x4dbf('0x20')]=_0x1cb0d5[_0x4dbf('0x20')];this[_0x4dbf('0x21')]=_0x1cb0d5[_0x4dbf('0x21')];this[_0x4dbf('0x22')]=_0x1cb0d5['trunks'];this['maxNumberOriginate']=config[_0x4dbf('0x23')]||0x2;this['channels']={};this[_0x4dbf('0x24')]={};this[_0x4dbf('0x25')]={};this[_0x4dbf('0x26')]={};this[_0x4dbf('0x27')]={};this[_0x4dbf('0x28')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0x4dbf('0x29')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x4dbf('0x2a'),this[_0x4dbf('0x2b')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x2d'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x4dbf('0x2e'),this[_0x4dbf('0x2f')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x30'),this[_0x4dbf('0xc')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x31'),this[_0x4dbf('0x32')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x33'),this[_0x4dbf('0x34')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x35'),this['syncVarSet']['bind'](this));ami['on'](_0x4dbf('0x36'),this[_0x4dbf('0x37')][_0x4dbf('0x2c')](this));ami['on'](_0x4dbf('0x38'),this[_0x4dbf('0x39')][_0x4dbf('0x2c')](this));this['loopCampaigns']();this[_0x4dbf('0x3a')]();RpcSetting[_0x4dbf('0x3b')]()[_0x4dbf('0x3c')](function(_0x2c29a4){previewRecallmeReminderInterval=_0x2c29a4['previewRecallmeReminderInterval'];});}function isNotNull(_0x37c57e){return _0x37c57e!==null&&!_[_0x4dbf('0x3d')](_0x37c57e);}function checkIsLoggedIn(_0x4b1b9f,_0x23a661){return function(){if(_0x23a661<=0x0){_0x4b1b9f[_0x4dbf('0x3e')]=_0x4dbf('0x3f');throw _0x4b1b9f[_0x4dbf('0x40')]+_0x4dbf('0x41');}};}function isActive(_0x2580a2){return _0x2580a2;}function checkIsActive(_0x5b2078,_0x7ac0f7){return function(){if(!isActive(_0x7ac0f7)){_0x5b2078[_0x4dbf('0x3e')]=_0x4dbf('0x42');throw _0x5b2078['name']+_0x4dbf('0x43');}};}function checkInterval(_0x25769e){return function(){if(!isNotNull(_0x25769e[_0x4dbf('0x44')])){_0x25769e[_0x4dbf('0x3e')]=_0x4dbf('0x45');throw _0x25769e[_0x4dbf('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25769e[_0x4dbf('0x44')][_0x4dbf('0x46')])){_0x25769e[_0x4dbf('0x3e')]=_0x4dbf('0x45');throw _0x25769e[_0x4dbf('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x4dbf('0x47')](_0x25769e[_0x4dbf('0x44')][_0x4dbf('0x46')]))){_0x25769e[_0x4dbf('0x3e')]=_0x4dbf('0x45');throw _0x25769e[_0x4dbf('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3cec31,_0x2f7788,_0x478415){return{'action':_0x3cec31,'response':_0x2f7788,'message':_0x478415,'stack':_0x478415};}function myreject(_0x2fa9b1){return function(_0x46bf5b){return _0x2fa9b1(msgResponse(_0x4dbf('0x48'),_0x4dbf('0x49'),JSON[_0x4dbf('0x4a')](_0x46bf5b)));};}function getSeconds(_0x521f28,_0x3ee5e8){var _0x573898=moment(_0x521f28)[_0x4dbf('0x4b')](0x0);var _0x170659=moment(_0x3ee5e8)[_0x4dbf('0x4b')](0x0);return _0x573898[_0x4dbf('0x4c')](_0x170659,_0x4dbf('0x4d'));}function emit(_0x7cd935,_0x4fbf5e,_0x84d5e8){io['to'](_0x7cd935)['emit'](_0x4fbf5e,_0x84d5e8);}function emitVoiceQueueSummary(_0x468d04){if(_0x468d04[_0x4dbf('0x4e')]===_0x4dbf('0x4f')){var _0xf20fa6={'id':_0x468d04['id'],'name':_0x468d04[_0x4dbf('0x40')],'strategy':_0x468d04[_0x4dbf('0x50')],'answered':_0x468d04['answered'],'available':_0x468d04[_0x4dbf('0x51')],'loggedIn':_0x468d04[_0x4dbf('0x52')],'pTalking':_0x468d04[_0x4dbf('0x53')],'sumBillable':_0x468d04['sumBillable'],'sumDuration':_0x468d04[_0x4dbf('0x54')],'sumHoldTime':_0x468d04['sumHoldTime']||0x0,'talking':_0x468d04[_0x4dbf('0x55')],'total':_0x468d04[_0x4dbf('0x56')],'type':_0x468d04[_0x4dbf('0x4e')],'unmanaged':_0x468d04['unmanaged'],'abandoned':_0x468d04['abandoned'],'waiting':_0x468d04[_0x4dbf('0x57')],'loggedInDb':_0x468d04[_0x4dbf('0x58')],'dialActive':_0x468d04[_0x4dbf('0x59')],'dialMethod':_0x468d04[_0x4dbf('0x5a')],'dialOriginateCallerIdName':_0x468d04[_0x4dbf('0x5b')],'dialOriginateCallerIdNumber':_0x468d04[_0x4dbf('0x5c')],'dialOriginateTimeout':_0x468d04[_0x4dbf('0x5d')],'dialPrefix':_0x468d04[_0x4dbf('0x5e')],'outboundAnswerAgiCallsDay':_0x468d04[_0x4dbf('0x5f')],'outboundAnswerCallsDay':_0x468d04[_0x4dbf('0x60')],'outboundBlacklistCallsDay':_0x468d04[_0x4dbf('0x61')],'outboundBusyCallsDay':_0x468d04[_0x4dbf('0x62')],'outboundCongestionCallsDay':_0x468d04[_0x4dbf('0x63')],'outboundDropCallsDayACS':_0x468d04[_0x4dbf('0x64')],'outboundDropCallsDayCallersExit':_0x468d04[_0x4dbf('0x65')],'outboundDropCallsDayTimeout':_0x468d04['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x468d04[_0x4dbf('0x66')],'outboundNoSuchCallsDay':_0x468d04[_0x4dbf('0x67')],'outboundOriginateFailureCallsDay':_0x468d04[_0x4dbf('0x68')],'outboundReCallsDay':_0x468d04[_0x4dbf('0x69')],'outboundRejectCallsDay':_0x468d04[_0x4dbf('0x6a')],'outboundUnknownCallsDay':_0x468d04[_0x4dbf('0x6b')],'predictiveIntervalAnsweredCalls':_0x468d04[_0x4dbf('0x6c')],'predictiveIntervalAvgHoldtime':_0x468d04[_0x4dbf('0x6d')],'predictiveIntervalAvgTalktime':_0x468d04[_0x4dbf('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x468d04[_0x4dbf('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x468d04[_0x4dbf('0x70')],'predictiveIntervalErlangCalls':_0x468d04['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x468d04['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x468d04[_0x4dbf('0x71')],'predictiveIntervalMultiplicativeFactor':_0x468d04['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x468d04[_0x4dbf('0x72')],'predictiveIntervalAvailable':_0x468d04[_0x4dbf('0x73')],'predictiveIntervalTotalCalls':_0x468d04[_0x4dbf('0x74')],'message':_0x468d04[_0x4dbf('0x3e')],'originated':_0x468d04[_0x4dbf('0x75')],'erlangCalls':_0x468d04[_0x4dbf('0x76')],'erlangCallToSecond':_0x468d04[_0x4dbf('0x77')],'erlangAbandonmentRate':_0x468d04['erlangAbandonmentRate'],'erlangBusyFactor':_0x468d04[_0x4dbf('0x78')],'startPredictive':_0x468d04['startPredictive'],'startProgressive':_0x468d04['startProgressive']};if(_0x468d04[_0x4dbf('0x79')]){_0xf20fa6[_0x4dbf('0x79')]={'id':_0x468d04[_0x4dbf('0x79')]['id'],'name':_0x468d04[_0x4dbf('0x79')][_0x4dbf('0x40')],'active':_0x468d04[_0x4dbf('0x79')][_0x4dbf('0x7a')],'callerid':_0x468d04['Trunk'][_0x4dbf('0x7b')]};}if(_0x468d04[_0x4dbf('0x44')]){_0xf20fa6[_0x4dbf('0x44')]={'id':_0x468d04[_0x4dbf('0x44')]['id'],'name':_0x468d04[_0x4dbf('0x44')][_0x4dbf('0x40')]};}var _0x371235=md5(JSON[_0x4dbf('0x4a')](_0xf20fa6));if(_0x468d04[_0x4dbf('0x4')]!==_0x371235){_0x468d04['md5']=_0x371235;emit(util[_0x4dbf('0x7c')]('voice:queue:%s',_0xf20fa6[_0x4dbf('0x40')]),_0x4dbf('0x7d'),_0xf20fa6);}}}function emitCampaignSummary(_0x5b6558){if(_0x5b6558[_0x4dbf('0x4e')]==='ivr'){emit(util['format'](_0x4dbf('0x7e'),_0x5b6558[_0x4dbf('0x40')]),_0x4dbf('0x7f'),_0x5b6558);}}function checkGetDataPredictive(_0x955b6f){if(isNotNull(_0x955b6f)&&!_[_0x4dbf('0x47')](_0x955b6f)){loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x81'));loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x82'),_0x955b6f['predictiveIntervalTotalCalls']);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x83'),_0x955b6f[_0x4dbf('0x6c')]);loggerPredictive['info'](_0x4dbf('0x84'),_0x955b6f['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x4dbf('0x85'),_0x955b6f['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x86'),_0x955b6f['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x87'),_0x955b6f['predictiveIntervalAvgTalktime']);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x88'));if(_0x955b6f['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x955b6f[_0x4dbf('0x6e')])&&_0x955b6f[_0x4dbf('0x6e')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x4dbf('0x3d')](_0x955b6f[_0x4dbf('0x6d')])&&_0x955b6f['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x89'));}else{loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x8a'));}}else{loggerPredictive[_0x4dbf('0x80')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xa9e5f0){return function(_0x991559){loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x8b'));loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x8c'),_0x991559['erlangCalls']);loggerPredictive['info'](_0x4dbf('0x8d'),_0x991559['erlangCallToSecond']);loggerPredictive['info'](_0x4dbf('0x8e'),_0x991559[_0x4dbf('0x8f')]);loggerPredictive['info'](_0x4dbf('0x90'),_0x991559[_0x4dbf('0x78')]);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x8e'),_0x991559['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0x4dbf('0x91')](_0xa9e5f0,_0x991559);};}function getDiff(_0x56b701){var _0x3e4fb0=moment()[_0x4dbf('0x4b')](0x0);var _0x47f719=moment(_0x56b701)[_0x4dbf('0x4b')](0x0);return _0x3e4fb0['diff'](_0x47f719,_0x4dbf('0x4d'));}function ifInterval(_0x2752a5,_0x1cf357){if(_[_0x4dbf('0x3d')](_0x1cf357)){return![];}return getDiff(_0x1cf357)<_0x2752a5*0x3c;}function freeVariablesPredictive(_0x2f8a13){if(isNotNull(_0x2f8a13)){if(!_[_0x4dbf('0x3d')](_0x2f8a13[_0x4dbf('0x92')])){_0x2f8a13[_0x4dbf('0x92')]=undefined;loggerPredictive[_0x4dbf('0x80')](_0x2f8a13[_0x4dbf('0x40')],_0x4dbf('0x93'));}if(!_[_0x4dbf('0x3d')](_0x2f8a13[_0x4dbf('0x28')])){_0x2f8a13['startPredictive']=undefined;loggerPredictive[_0x4dbf('0x80')](_0x2f8a13[_0x4dbf('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x4dbf('0x3d')](_0x2f8a13['handlePredictive'])){clearInterval(_0x2f8a13['handlePredictive']);_0x2f8a13[_0x4dbf('0x94')]=undefined;loggerPredictive[_0x4dbf('0x80')](_0x2f8a13[_0x4dbf('0x40')],_0x4dbf('0x95'));}}}function erlangb(_0x2d46ae,_0x3314ca){if(_0x3314ca===0x0){return 0x0;}var _0x722460=0x1;for(var _0x5e99af=0x1;_0x5e99af<=_0x3314ca;_0x5e99af+=0x1){_0x722460=0x1+_0x722460*_0x5e99af/_0x2d46ae;}return 0x1/_0x722460;}function isVoiceQueueOutbound(_0x53ea63){return _0x53ea63===_0x4dbf('0x4f');}function isNotPreview(_0x420443){return _0x420443!==_0x4dbf('0x1e');}function isCampaignIvr(_0x162154){return _0x162154===_0x4dbf('0x96');}function getCallerId(_0x4f00c9,_0x42a0c7,_0x2ee695){if(!_[_0x4dbf('0x3d')](_0x2ee695)&&typeof _0x2ee695==='string'&&!_[_0x4dbf('0x47')](_0x2ee695)){if(!_[_0x4dbf('0x3d')](_0x42a0c7)&&typeof _0x42a0c7===_0x4dbf('0x97')&&!_['isEmpty'](_0x42a0c7)){return util[_0x4dbf('0x7c')](_0x4dbf('0x98'),_0x42a0c7,_0x2ee695);}return util[_0x4dbf('0x7c')](_0x4dbf('0x98'),_0x2ee695,_0x2ee695);}if(!_['isUndefined'](_0x4f00c9)&&typeof _0x4f00c9==='string'&&!_[_0x4dbf('0x47')](_0x4f00c9)){return _0x4f00c9;}return _0x4dbf('0x99');}function loggerCatchQueueSummary(_0x2d50b0,_0x2e0a34){return function(_0x2991c0){freeVariablesPredictive(_0x2e0a34);emitVoiceQueueSummary(_0x2e0a34);emitCampaignSummary(_0x2e0a34);loggerSyncQueueSummary[_0x4dbf('0x9a')](_0x2d50b0,util['inspect'](_0x2991c0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f1ccc,_0x2eb5a1){return function(_0x201f2c){loggerPredictive[_0x4dbf('0x9a')](_0x2eb5a1['name'],_0x2f1ccc);loggerPredictive[_0x4dbf('0x9a')](_0x201f2c['stack']);freeVariablesPredictive(_0x2eb5a1);};}function loggerCatch(_0xe54f45){return function(_0x3fbc16){logger[_0x4dbf('0x9a')](_0xe54f45,util[_0x4dbf('0x9b')](_0x3fbc16,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5dbefe){return _0x5dbefe&&!_[_0x4dbf('0x3d')](_0x5dbefe)&&_0x5dbefe[_0x4dbf('0x9c')]>0x0;}function decremetOriginate(_0x5a000f){if(!_[_0x4dbf('0x3d')](_0x5a000f)&&_0x5a000f!==null){if(typeof _0x5a000f['originated']!=='undefined'){if(_0x5a000f[_0x4dbf('0x75')]>0x0){_0x5a000f['originated']-=0x1;}else{logger[_0x4dbf('0x9a')](_0x4dbf('0x9d'));}}}else{logger[_0x4dbf('0x9a')](_0x4dbf('0x9e'));}}function checkContactLowerLimitOriginate(_0xd164ee,_0x442dc6,_0x58293b){if(_0x442dc6>_0x58293b){for(var _0x365531=0x0;_0x365531<_0x442dc6-_0x58293b;_0x365531+=0x1){decremetOriginate(_0xd164ee);}}}function loggerGetContactDialer(_0x42013f,_0x5aab2b,_0x4fb6ba){return function(_0x5ba2fc){checkContactLowerLimitOriginate(_0x5aab2b,_0x4fb6ba,0x0);logger[_0x4dbf('0x9a')](_0x42013f,util[_0x4dbf('0x9b')](_0x5ba2fc,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x26ad68){return function(_0xbce099){if(isNotNull(_0xbce099)&&isNotNull(_0xbce099[0x0])){if(_0xbce099[0x0]['contactsRescheduled']>0x0){_0x26ad68[_0x4dbf('0x3e')]='RESCHEDULED_CONTACTS';logger['info'](_0x4dbf('0x9f')+_0x26ad68[_0x4dbf('0x40')],_0xbce099[0x0][_0x4dbf('0xa0')],_0x4dbf('0xa1'));}else{_0x26ad68[_0x4dbf('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4dbf('0x80')](_0x4dbf('0xa2')+_0x26ad68[_0x4dbf('0x40')]);}}};}function notSendMessagesQueue(_0x165662){if(_0x165662[_0x4dbf('0xa3')]){freeVariablesPredictive(_0x165662);if(_0x165662[_0x4dbf('0x75')]===0x0&&_0x165662[_0x4dbf('0x55')]===0x0&&_0x165662[_0x4dbf('0x57')]===0x0&&(_0x165662[_0x4dbf('0x53')]||0x0)===0x0){_0x165662[_0x4dbf('0xa3')]=![];_0x165662[_0x4dbf('0x51')]=0x0;_0x165662['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x4dbf('0x9a')](_0x4dbf('0xa4'),_0x165662[_0x4dbf('0x40')],_0x4dbf('0xa5'));}else{_0x165662[_0x4dbf('0x3e')]=_0x4dbf('0xa6');loggerSyncQueueSummary[_0x4dbf('0x9a')](_0x4dbf('0xa4'),_0x165662[_0x4dbf('0x40')],_0x4dbf('0xa7'));}emitVoiceQueueSummary(_0x165662);}}function notSendMessagesCampaign(_0x1eb30b){if(_0x1eb30b[_0x4dbf('0xa3')]){if(_0x1eb30b[_0x4dbf('0x75')]===0x0){_0x1eb30b[_0x4dbf('0xa3')]=![];_0x1eb30b[_0x4dbf('0x3e')]=_0x4dbf('0x42');loggerSyncQueueSummary[_0x4dbf('0x9a')](_0x4dbf('0xa8'),_0x1eb30b['name'],_0x4dbf('0xa5'));}else{_0x1eb30b[_0x4dbf('0x3e')]=_0x4dbf('0xa6');loggerSyncQueueSummary[_0x4dbf('0x9a')](_0x4dbf('0xa8'),_0x1eb30b[_0x4dbf('0x40')],_0x4dbf('0xa7'));}emitCampaignSummary(_0x1eb30b);}}function createObjHistory(_0x1159bf,_0x305e68,_0x8d72ae,_0x3348bf,_0x282f36){_0x1159bf[_0x4dbf('0x3e')]=_0x8d72ae;var _0x30aae2=new Action(_0x1159bf,_0x305e68);var _0x38673f=new History(_0x30aae2);_0x38673f[_0x4dbf('0xa9')]=_0x3348bf;_0x38673f[_0x4dbf('0xaa')]=_0x282f36;_0x38673f[_0x4dbf('0xab')]=_0x30aae2[_0x4dbf('0xac')];return _0x38673f;}Dialer[_0x4dbf('0x1a')][_0x4dbf('0x3a')]=function(){var _0x41eb22=this;setInterval(function(){_0x41eb22[_0x4dbf('0xad')](_0x41eb22[_0x4dbf('0x26')],_0x4dbf('0xae'));_0x41eb22[_0x4dbf('0xad')](_0x41eb22[_0x4dbf('0x24')],'[actions]');},0x32c8);};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xad')]=function(_0x5ed009,_0x27efca){var _0x61b5e=this;for(var _0xe2aa1c in _0x5ed009){if(typeof _0x5ed009[_0xe2aa1c]!==_0x4dbf('0xaf')){this[_0x4dbf('0x1d')][_0x4dbf('0xb0')](function(){if(!_[_0x4dbf('0xb1')](_0x5ed009[_0xe2aa1c])){return ami[_0x4dbf('0xb2')]({'action':'status','channel':_0x5ed009[_0xe2aa1c]['channel']})[_0x4dbf('0xb3')](function(_0xd4276e){if(_0xd4276e['message']===_0x4dbf('0xb4')){setTimeout(function(){if(_0x5ed009[_0xe2aa1c]&&_0x5ed009[_0xe2aa1c][_0x4dbf('0x4e')]!==_0x4dbf('0x96')){_0x61b5e['updateOriginated'](_0x61b5e[_0x4dbf('0x1f')][_0x5ed009[_0xe2aa1c][_0x4dbf('0xb5')]]);logger[_0x4dbf('0x9a')](_0x4dbf('0xb6'),_0x27efca,_0xe2aa1c,_0x5ed009[_0xe2aa1c][_0x4dbf('0xb5')]);delete _0x5ed009[_0xe2aa1c];}if(_0x5ed009[_0xe2aa1c]&&_0x5ed009[_0xe2aa1c][_0x4dbf('0x4e')]==='ivr'){_0x61b5e[_0x4dbf('0xb7')](_0x61b5e[_0x4dbf('0x20')][_0x5ed009[_0xe2aa1c][_0x4dbf('0xb5')]]);logger[_0x4dbf('0x9a')](_0x4dbf('0xb8'),_0x27efca,_0xe2aa1c,_0x5ed009[_0xe2aa1c][_0x4dbf('0xb5')]);delete _0x5ed009[_0xe2aa1c];}},0x2328);}});}});}}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xb9')]=function(_0x47dfdc){return BPromise['resolve']()[_0x4dbf('0x3c')](cmHopper[_0x4dbf('0xb9')](_0x47dfdc))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xba')));};Dialer['prototype']['checkIsBlackList']=function(_0x3fe251){return BPromise[_0x4dbf('0xbb')]()['then'](cmHopperBlack[_0x4dbf('0xbc')](_0x3fe251))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xbd')));};Dialer[_0x4dbf('0x1a')]['checkIsBlackListIvr']=function(_0x1a70c2){return BPromise['resolve']()[_0x4dbf('0x3c')](cmHopperBlack['checkIsBlackListIvr'](_0x1a70c2))['catch'](loggerCatch(_0x4dbf('0xbe')));};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xbf')]=function(_0x2b2321){return BPromise['resolve']()[_0x4dbf('0x3c')](cmHopperHistory['avgHandleTime'](_0x2b2321))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xc0')));};Dialer['prototype'][_0x4dbf('0xc1')]=function(_0x344bf9){return BPromise['resolve']()[_0x4dbf('0x3c')](cmHopper[_0x4dbf('0xc1')](_0x344bf9))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xc2')));};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xc3')]=function(_0x42a370,_0x27ded7,_0x2495dd){return BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](cmHopper[_0x4dbf('0xc3')](_0x42a370,_0x27ded7,_0x2495dd))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xc4')));};Dialer[_0x4dbf('0x1a')]['getContactDialer']=function(_0x3fa736,_0x4cfbfe,_0xa6946f,_0x3a5eff,_0x2ba34e){return BPromise[_0x4dbf('0xbb')]()['then'](cmHopper[_0x4dbf('0xc5')](_0x3fa736,_0x4cfbfe,_0xa6946f,_0x3a5eff))[_0x4dbf('0xb3')](function(_0x3ada80){_0x2ba34e[_0x4dbf('0xc6')]-=_0xa6946f;_0x2ba34e['temp']=_0x2ba34e[_0x4dbf('0xc6')]>0x0?_0x2ba34e[_0x4dbf('0xc6')]:0x0;loggerCatch(_0x4dbf('0xc7'))(_0x3ada80);});};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xc8')]=function(_0x25d71a,_0x5ae28a,_0x43bfd8,_0x590c47){return BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](cmHopper[_0x4dbf('0xc8')](_0x25d71a,_0x5ae28a,_0x43bfd8))['catch'](function(_0x14e8bc){_0x590c47[_0x4dbf('0xc6')]-=_0x5ae28a;_0x590c47[_0x4dbf('0xc6')]=_0x590c47[_0x4dbf('0xc6')]>0x0?_0x590c47['temp']:0x0;loggerCatch(_0x4dbf('0xc9'))(_0x14e8bc);});};Dialer['prototype'][_0x4dbf('0xca')]=function(_0x44dbc8){return BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](voiceQueueRt[_0x4dbf('0xca')](_0x44dbc8))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xcb')));};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xcc')]=function(_0x1abc1e){return BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](cmHopper['moveContactManagedDialer'](_0x1abc1e))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xcd')]=function(_0x41bef3){return BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](cmHopperHistory[_0x4dbf('0xcd')](_0x41bef3))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xce')));};Dialer[_0x4dbf('0x1a')]['updateOriginated']=function(_0x30550c){if(!_[_0x4dbf('0x3d')](_0x30550c)&&_0x30550c!==null){if(typeof _0x30550c[_0x4dbf('0x75')]!=='undefined'){if(_0x30550c[_0x4dbf('0x75')]>0x0){_0x30550c[_0x4dbf('0x75')]-=0x1;}else{logger[_0x4dbf('0x9a')](_0x4dbf('0xcf'));}}}else{logger[_0x4dbf('0x9a')](_0x4dbf('0xd0'));}};Dialer[_0x4dbf('0x1a')]['loggerHandler']=function(_0x1eb1fb,_0x1da904){var _0x15a8ff=this;return function(_0x4bbe0a){_0x15a8ff[_0x4dbf('0xb7')](_0x1da904);logger[_0x4dbf('0x9a')](_0x1eb1fb,util[_0x4dbf('0x9b')](_0x4bbe0a,{'showHidden':![],'depth':null}));};};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xd1')]=function(_0x356eea,_0x3eb941,_0x35c531){var _0x188bdf={'state':0x19,'statedesc':_0x4dbf('0xd2')};this[_0x4dbf('0xb7')](_0x3eb941);this[_0x4dbf('0xd3')](_['merge'](_0x188bdf,_[_0x4dbf('0xd4')](_0x35c531,[_0x4dbf('0xd5'),_0x4dbf('0xd6'),_0x4dbf('0xd7'),_0x4dbf('0xd8'),_0x4dbf('0xd9')])),_0x4dbf('0xda'),'[emptyContact]');logger[_0x4dbf('0x9a')](_0x356eea);};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xdb')]=function(_0x426d01){return _0x426d01===_0x4dbf('0xdc');};Dialer[_0x4dbf('0x1a')]['isTrunkReachable']=function(_0x20643d){return!_[_0x4dbf('0x3d')](_0x20643d)&&_0x20643d&&!_[_0x4dbf('0x3d')](_0x20643d[_0x4dbf('0x40')])&&!_[_0x4dbf('0x3d')](_0x20643d[_0x4dbf('0x7a')])&&_0x20643d['active']&&(this[_0x4dbf('0x22')][util['format'](_0x4dbf('0xdd'),_0x20643d[_0x4dbf('0x40')])][_0x4dbf('0xde')]===_0x4dbf('0xdf')||this[_0x4dbf('0x22')][util['format'](_0x4dbf('0xdd'),_0x20643d[_0x4dbf('0x40')])][_0x4dbf('0xde')]===_0x4dbf('0xe0'));};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xd3')]=function(_0xc8fe18,_0x42eeea,_0x43e725){this['createHistory'](_0xc8fe18)[_0x4dbf('0xb3')](loggerCatch(_0x42eeea));this[_0x4dbf('0xcc')](_0xc8fe18)[_0x4dbf('0xb3')](loggerCatch(_0x43e725));};Dialer['prototype']['syncVarSet']=function(_0x2310d2){var _0x40454b=this[_0x4dbf('0x26')][_0x2310d2[_0x4dbf('0xe1')]];var _0x233e25;if(!_[_0x4dbf('0xb1')](_0x2310d2)&&!_[_0x4dbf('0xb1')](_0x2310d2[_0x4dbf('0xe2')])&&!_[_0x4dbf('0xb1')](_0x2310d2[_0x4dbf('0xe2')][_0x4dbf('0xe3')])&&_0x2310d2['exten']===_0x4dbf('0xe4')&&_0x40454b){if(_0x40454b[_0x4dbf('0x4e')]!==_0x4dbf('0x96')&&this[_0x4dbf('0x1f')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0xe5')]&&_0x2310d2['value']==='HANGUP'){delete this[_0x4dbf('0x26')][_0x2310d2[_0x4dbf('0xe1')]];this[_0x4dbf('0xb7')](this[_0x4dbf('0x1f')][_0x40454b[_0x4dbf('0xb5')]]);this['voiceQueues'][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0x60')]+=0x1;this['voiceQueues'][_0x40454b[_0x4dbf('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x233e25=new Hangup(_0x40454b,_0x2310d2);_0x233e25[_0x4dbf('0xa9')]=0x12;_0x233e25[_0x4dbf('0xaa')]=_0x4dbf('0xe6');_0x233e25['membername']=_0x4dbf('0xe7');ami[_0x4dbf('0xe8')](_0x4dbf('0xe9'),ut[_0x4dbf('0xea')](_0x233e25,_0x4dbf('0xeb')));this['saveInDb'](_0x233e25,_0x4dbf('0xec'),_0x4dbf('0xed'));}if(_0x40454b[_0x4dbf('0x4e')]!==_0x4dbf('0x96')&&this['voiceQueues'][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0xe5')]&&_0x2310d2[_0x4dbf('0xee')]===_0x4dbf('0xef')){var _0x562194=this;return new BPromise(function(_0x37f3cc,_0x99aa3e){delete _0x562194['uniqueId'][_0x2310d2['uniqueid']];_0x562194['updateOriginated'](_0x562194[_0x4dbf('0x1f')][_0x40454b[_0x4dbf('0xb5')]]);_0x562194[_0x4dbf('0x1f')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0x60')]+=0x1;_0x562194[_0x4dbf('0x1f')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0x5f')]+=0x1;var _0x55a923=_0x562194['voiceQueues'][_0x40454b['queue']];var _0x29573b=new Hangup(_0x40454b,_0x2310d2);_0x29573b['state']=0x13;_0x29573b[_0x4dbf('0xaa')]='Machine';_0x29573b[_0x4dbf('0xf0')]=_0x4dbf('0xe7');_0x29573b[_0x4dbf('0xf1')]+=0x1;_0x29573b[_0x4dbf('0xf2')]+=0x1;_0x29573b['amd']=!![];ami[_0x4dbf('0xe8')]('custom:amd',ut['buildObj'](_0x29573b,_0x4dbf('0xeb')));_0x562194[_0x4dbf('0xcd')](_0x29573b)[_0x4dbf('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x29573b[_0x4dbf('0xf3')]+_0x29573b[_0x4dbf('0xf4')]+_0x29573b[_0x4dbf('0xf5')]+_0x29573b[_0x4dbf('0xf6')]+_0x29573b[_0x4dbf('0xf7')]+_0x29573b[_0x4dbf('0xf8')]+_0x29573b[_0x4dbf('0xf1')]+_0x29573b[_0x4dbf('0xf9')]>=_0x55a923[_0x4dbf('0xfa')]){_0x562194[_0x4dbf('0xfb')](_0x29573b,_0x37f3cc,_0x99aa3e,_0x4dbf('0xfc'));}else{if(_0x29573b[_0x4dbf('0xf1')]>=_0x55a923[_0x4dbf('0xfd')]){_0x562194[_0x4dbf('0xfe')](_0x29573b,_0x37f3cc,_0x99aa3e,_0x4dbf('0xff'));}else{_0x562194[_0x4dbf('0xc1')]({'active':![],'countmachineretry':_0x29573b[_0x4dbf('0xf1')],'scheduledat':moment()[_0x4dbf('0x100')](_0x55a923[_0x4dbf('0x101')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x29573b['ContactId'],'ListId':_0x29573b[_0x4dbf('0xd6')],'VoiceQueueId':_0x29573b[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x29573b[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x104')));_0x37f3cc({'reschedule':0x1});}}});}if(_0x40454b[_0x4dbf('0x4e')]===_0x4dbf('0x96')&&this[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0xe5')]&&_0x2310d2['value']===_0x4dbf('0x105')){delete this[_0x4dbf('0x26')][_0x2310d2[_0x4dbf('0xe1')]];this['updateOriginated'](this[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]]);_0x233e25=new Hangup(_0x40454b,_0x2310d2);_0x233e25[_0x4dbf('0xa9')]=0x12;_0x233e25['statedesc']='HangupInAMD';_0x233e25[_0x4dbf('0xf0')]='AMD';ami['emit'](_0x4dbf('0xe9'),ut[_0x4dbf('0xea')](_0x233e25,_0x4dbf('0xeb')));this[_0x4dbf('0xd3')](_0x233e25,_0x4dbf('0x106'),_0x4dbf('0x107'));}if(_0x40454b[_0x4dbf('0x4e')]===_0x4dbf('0x96')&&this[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0xe5')]&&_0x2310d2[_0x4dbf('0xee')]===_0x4dbf('0xef')){var _0x562194=this;return new BPromise(function(_0x58ae31,_0x1c8813){delete _0x562194[_0x4dbf('0x26')][_0x2310d2[_0x4dbf('0xe1')]];_0x562194['updateOriginated'](_0x562194[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]]);_0x562194[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0x60')]+=0x1;_0x562194[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]][_0x4dbf('0x5f')]+=0x1;var _0x376366=_0x562194[_0x4dbf('0x20')][_0x40454b[_0x4dbf('0xb5')]];var _0x4b4e20=new Hangup(_0x40454b,_0x2310d2);_0x4b4e20[_0x4dbf('0xa9')]=0x13;_0x4b4e20['statedesc']='Machine';_0x4b4e20[_0x4dbf('0xf0')]=_0x4dbf('0xe7');_0x4b4e20[_0x4dbf('0xf1')]+=0x1;_0x4b4e20['countglobal']+=0x1;_0x4b4e20['amd']=!![];ami[_0x4dbf('0xe8')](_0x4dbf('0xe9'),ut[_0x4dbf('0xea')](_0x4b4e20,_0x4dbf('0xeb')));_0x562194['createHistory'](_0x4b4e20)[_0x4dbf('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4b4e20[_0x4dbf('0xf3')]+_0x4b4e20[_0x4dbf('0xf4')]+_0x4b4e20[_0x4dbf('0xf5')]+_0x4b4e20[_0x4dbf('0xf6')]+_0x4b4e20[_0x4dbf('0xf7')]+_0x4b4e20['countabandonedretry']+_0x4b4e20[_0x4dbf('0xf1')]+_0x4b4e20[_0x4dbf('0xf9')]>=_0x376366[_0x4dbf('0xfa')]){_0x562194[_0x4dbf('0xfb')](_0x4b4e20,_0x58ae31,_0x1c8813,_0x4dbf('0xfc'));}else{if(_0x4b4e20['countmachineretry']>=_0x376366['dialMachineMaxRetry']){_0x562194[_0x4dbf('0xfe')](_0x4b4e20,_0x58ae31,_0x1c8813,_0x4dbf('0xff'));}else{_0x562194['rescheduleContact']({'active':![],'countmachineretry':_0x4b4e20[_0x4dbf('0xf1')],'scheduledat':moment()[_0x4dbf('0x100')](_0x376366[_0x4dbf('0x101')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x4b4e20[_0x4dbf('0xd5')],'ListId':_0x4b4e20['ListId'],'VoiceQueueId':_0x4b4e20[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x4b4e20['CampaignId']||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x104')));_0x58ae31({'reschedule':0x1});}}});}}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x32')]=function(_0x1ba44c){var _0x305fca=this['uniqueId'][_0x1ba44c[_0x4dbf('0xe1')]];var _0x503771=this;var _0xbc9bd6;if(_0x305fca&&_0x305fca[_0x4dbf('0x4e')]==='ivr'){delete this[_0x4dbf('0x26')][_0x1ba44c['uniqueid']];this[_0x4dbf('0xb7')](this[_0x4dbf('0x20')][_0x305fca[_0x4dbf('0xb5')]]);this[_0x4dbf('0x20')][_0x305fca[_0x4dbf('0xb5')]][_0x4dbf('0x108')]+=0x1;_0xbc9bd6=new Hangup(_0x305fca,_0x1ba44c);this[_0x4dbf('0xcd')](_0xbc9bd6)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x109')));this[_0x4dbf('0xcc')](_0xbc9bd6)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x305fca&&_0x305fca[_0x4dbf('0x4e')]!==_0x4dbf('0x96')&&isNotNull(this[_0x4dbf('0x1f')][_0x305fca['queue']]['dialQueueProject'])){delete this[_0x4dbf('0x26')][_0x1ba44c[_0x4dbf('0xe1')]];this[_0x4dbf('0xb7')](this['voiceQueues'][_0x305fca[_0x4dbf('0xb5')]]);this[_0x4dbf('0x1f')][_0x305fca[_0x4dbf('0xb5')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x305fca[_0x4dbf('0xb5')]][_0x4dbf('0x5f')]+=0x1;_0xbc9bd6=new Hangup(_0x305fca,_0x1ba44c);_0xbc9bd6[_0x4dbf('0xa9')]=0x10;_0xbc9bd6['statedesc']=_0x4dbf('0x10a');_0xbc9bd6['membername']=_0x4dbf('0x10b');this['createHistory'](_0xbc9bd6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4dbf('0xcc')](_0xbc9bd6)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x10c')));}if(_0x305fca&&_0x305fca[_0x4dbf('0x4e')]!=='ivr'&&!isNotNull(this[_0x4dbf('0x1f')][_0x305fca[_0x4dbf('0xb5')]][_0x4dbf('0x10d')])){delete this['uniqueId'][_0x1ba44c['uniqueid']];this[_0x4dbf('0xb7')](this['voiceQueues'][_0x305fca['queue']]);this[_0x4dbf('0x1f')][_0x305fca[_0x4dbf('0xb5')]][_0x4dbf('0x6b')]+=0x1;_0xbc9bd6=new Hangup(_0x305fca,_0x1ba44c);_0xbc9bd6[_0x4dbf('0xa9')]=0xc;_0xbc9bd6['statedesc']=_0x1ba44c[_0x4dbf('0x10e')];_0xbc9bd6[_0x4dbf('0xf0')]='Unknow';this[_0x4dbf('0xcd')](_0xbc9bd6)['catch'](loggerCatch(_0x4dbf('0x109')));this[_0x4dbf('0xcc')](_0xbc9bd6)['catch'](loggerCatch(_0x4dbf('0x10c')));}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x2f')]=function(_0x317ad8){var _0x56de2e=this[_0x4dbf('0x26')][_0x317ad8[_0x4dbf('0xe1')]];var _0x5bc739=this;if(this['voiceQueues'][_0x317ad8[_0x4dbf('0xb5')]]){if(_0x56de2e&&_0x56de2e[_0x4dbf('0x4e')]!==_0x4dbf('0x96')){delete this['uniqueId'][_0x317ad8[_0x4dbf('0xe1')]];this['voiceQueues'][_0x317ad8['queue']][_0x4dbf('0x60')]+=0x1;var _0x565e1d=new AgentComplete(_0x56de2e,_0x317ad8);if(_0x317ad8[_0x4dbf('0x10f')]===_0x4dbf('0x110')){_0x565e1d[_0x4dbf('0x111')]=this[_0x4dbf('0x1f')][_0x317ad8['queue']]['dialQueueProject2']&&this[_0x4dbf('0x1f')][_0x317ad8[_0x4dbf('0xb5')]][_0x4dbf('0x112')]?moment()['format'](_0x4dbf('0x103')):undefined;}this[_0x4dbf('0xcd')](_0x565e1d)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x113')));this[_0x4dbf('0xcc')](_0x565e1d)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x114')));}}};Dialer['prototype'][_0x4dbf('0x115')]=function(_0x1d1a19){if(this[_0x4dbf('0x1f')][_0x1d1a19[_0x4dbf('0xb5')]]){if(this['uniqueId'][_0x1d1a19[_0x4dbf('0xe1')]]&&this['uniqueId'][_0x1d1a19['uniqueid']][_0x4dbf('0x4e')]!==_0x4dbf('0x96')){this['updateOriginated'](this['voiceQueues'][_0x1d1a19['queue']]);this[_0x4dbf('0x26')][_0x1d1a19[_0x4dbf('0xe1')]][_0x4dbf('0x116')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x117')]=function(_0x3503ea){this[_0x4dbf('0xcd')](_0x3503ea)['catch'](loggerCatch(_0x4dbf('0x113')));this[_0x4dbf('0xcc')](_0x3503ea)[_0x4dbf('0xb3')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x4dbf('0x1a')]['syncQueueCallerAbandon']=function(_0x21a27d){var _0x4b9cbe=this[_0x4dbf('0x26')][_0x21a27d[_0x4dbf('0xe1')]];var _0x317e67=this;if(this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]]){if(_0x4b9cbe&&_0x4b9cbe[_0x4dbf('0x4e')]!==_0x4dbf('0x96')){delete this['uniqueId'][_0x21a27d[_0x4dbf('0xe1')]];this[_0x4dbf('0xb7')](this['voiceQueues'][_0x21a27d['queue']]);_0x4b9cbe[_0x4dbf('0x118')]=moment()[_0x4dbf('0x7c')](_0x4dbf('0x103'));var _0x5bcc42=new QueueCallerAbandon(_0x4b9cbe,_0x21a27d);if(getSeconds(_0x4b9cbe[_0x4dbf('0x118')],_0x4b9cbe['responsetime'])>=_0x4b9cbe['dialQueueTimeout']){this['voiceQueues'][_0x21a27d['queue']][_0x4dbf('0x70')]+=0x1;this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]][_0x4dbf('0x119')]+=0x1;this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]][_0x4dbf('0x11a')]+=0x1;_0x5bcc42[_0x4dbf('0xa9')]=0xa;_0x5bcc42[_0x4dbf('0xaa')]=_0x4dbf('0x11b');_0x5bcc42[_0x4dbf('0x11c')]=_0x4dbf('0x11d');_0x5bcc42[_0x4dbf('0x111')]=this[_0x4dbf('0x1f')][_0x21a27d['queue']][_0x4dbf('0x11e')]?moment()[_0x4dbf('0x7c')](_0x4dbf('0x103')):undefined;_0x5bcc42['countdropretry']+=0x1;_0x5bcc42[_0x4dbf('0xf2')]+=0x1;if(_0x5bcc42[_0x4dbf('0xf7')]>=this[_0x4dbf('0x1f')][_0x21a27d['queue']]['dialDropMaxRetry']){this[_0x4dbf('0x117')](_0x5bcc42);}else{this[_0x4dbf('0xc1')]({'active':![],'countdropretry':_0x5bcc42[_0x4dbf('0xf7')],'scheduledat':moment()[_0x4dbf('0x100')](this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]][_0x4dbf('0x11f')],'minutes')[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x4b9cbe[_0x4dbf('0xd5')],'ListId':_0x4b9cbe[_0x4dbf('0xd6')],'VoiceQueueId':_0x4b9cbe['VoiceQueueId']||undefined,'CampaignId':_0x4b9cbe[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch('[rescheduleContact][Drop]'));var _0xf2b2e=new History(_0x5bcc42);_0xf2b2e[_0x4dbf('0xa9')]=0xa;_0xf2b2e[_0x4dbf('0xaa')]=_0x4dbf('0x11b');_0xf2b2e[_0x4dbf('0xac')]=moment()[_0x4dbf('0x7c')](_0x4dbf('0x103'));_0xf2b2e['endtime']=_0xf2b2e['starttime'];_0xf2b2e[_0x4dbf('0x120')]=_0x5bcc42[_0x4dbf('0x120')];_0xf2b2e['calleridnum']=_0x5bcc42['calleridnum'];this['createHistory'](_0xf2b2e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x121')));}}else{this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x4dbf('0x1f')][_0x21a27d[_0x4dbf('0xb5')]]['outboundDropCallsDayCallersExit']+=0x1;_0x5bcc42['state']=0xb;_0x5bcc42[_0x4dbf('0xaa')]='Abandoned';_0x5bcc42[_0x4dbf('0x11c')]='CALLEREXIT';_0x5bcc42['countabandonedretry']+=0x1;_0x5bcc42[_0x4dbf('0xf2')]+=0x1;if(_0x5bcc42['countabandonedretry']>=this[_0x4dbf('0x1f')][_0x21a27d['queue']][_0x4dbf('0x122')]){this[_0x4dbf('0x117')](_0x5bcc42);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x5bcc42[_0x4dbf('0xf8')],'scheduledat':moment()[_0x4dbf('0x100')](this[_0x4dbf('0x1f')][_0x21a27d['queue']]['dialAbandonedRetryFrequency'],_0x4dbf('0x102'))[_0x4dbf('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b9cbe[_0x4dbf('0xd5')],'ListId':_0x4b9cbe[_0x4dbf('0xd6')],'VoiceQueueId':_0x4b9cbe[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x4b9cbe[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0xf2b2e=new History(_0x5bcc42);_0xf2b2e[_0x4dbf('0xa9')]=0xb;_0xf2b2e[_0x4dbf('0xaa')]='Abandoned';_0xf2b2e[_0x4dbf('0xac')]=moment()[_0x4dbf('0x7c')](_0x4dbf('0x103'));_0xf2b2e[_0x4dbf('0xab')]=_0xf2b2e[_0x4dbf('0xac')];_0xf2b2e['calleridname']=_0x5bcc42['calleridname'];_0xf2b2e[_0x4dbf('0x123')]=_0x5bcc42[_0x4dbf('0x123')];this[_0x4dbf('0xcd')](_0xf2b2e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x124')));}}}}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x34')]=function(_0x5cf1df){if(this[_0x4dbf('0x24')][_0x5cf1df[_0x4dbf('0xe1')]]){this['actions'][_0x5cf1df[_0x4dbf('0xe1')]][_0x4dbf('0x125')]=_0x5cf1df['channel'];}if(this[_0x4dbf('0x26')][_0x5cf1df['uniqueid']]){this[_0x4dbf('0x26')][_0x5cf1df[_0x4dbf('0xe1')]]['channel']=_0x5cf1df['channel'];}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x37')]=function(_0x4767c5){if(strategy[this[_0x4dbf('0x1f')][this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]][_0x4dbf('0xb5')]][_0x4dbf('0x50')]]===_0x4dbf('0x19')){if(this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]]&&_['isNil'](this['actions'][_0x4767c5[_0x4dbf('0x126')]][_0x4dbf('0x127')])&&_0x4767c5['status']==='1'&&_0x4767c5['paused']==='0'){if(this[_0x4dbf('0x21')][_0x4767c5[_0x4dbf('0x128')]]){if(!this[_0x4dbf('0x21')][_0x4767c5['stateinterface']][_0x4dbf('0x127')]){this[_0x4dbf('0x21')][_0x4767c5[_0x4dbf('0x128')]][_0x4dbf('0x127')]=!![];this[_0x4dbf('0x24')][_0x4767c5['actionid']]['locked']=!![];this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]][_0x4dbf('0x128')]=_0x4767c5[_0x4dbf('0x128')];}}}}else if((strategy[this[_0x4dbf('0x1f')][this[_0x4dbf('0x24')][_0x4767c5['actionid']][_0x4dbf('0xb5')]]['strategy']]||_0x4dbf('0x129'))===_0x4dbf('0x129')){if(this[_0x4dbf('0x24')][_0x4767c5['actionid']]){if(this[_0x4dbf('0x21')][_0x4767c5[_0x4dbf('0x128')]]){this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]]['stateinterface']=_0x4767c5['stateinterface'];if(_[_0x4dbf('0xb1')](this[_0x4dbf('0x12a')][this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]][_0x4dbf('0xb5')]])){this[_0x4dbf('0x12a')][this[_0x4dbf('0x24')][_0x4767c5['actionid']]['queue']]=[];}this[_0x4dbf('0x12a')][this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]][_0x4dbf('0xb5')]][_0x4dbf('0x12b')](_[_0x4dbf('0x91')](_[_0x4dbf('0xd4')](this[_0x4dbf('0x24')][_0x4767c5[_0x4dbf('0x126')]],['idHopper',_0x4dbf('0x128')]),{'status':_0x4767c5[_0x4dbf('0xde')],'paused':_0x4767c5['paused']}));}}}};function unlockQueueStatus(_0x55f38b,_0x2d7010){setTimeout(function(){if(_[_0x4dbf('0x3d')](_0x55f38b[_0x4dbf('0x12c')])){loggerBooked[_0x4dbf('0x9a')](_0x4dbf('0x12d'),_0x2d7010);}_0x55f38b['queueStatusComplete']=!![];loggerBooked['info'](_0x4dbf('0x12e'),_0x2d7010,JSON[_0x4dbf('0x4a')](_[_0x4dbf('0xd4')](_0x55f38b,[_0x4dbf('0x40'),_0x4dbf('0x12c')])));},0x1f3);}Dialer[_0x4dbf('0x1a')]['syncQueueStatusComplete']=function(_0x14205c){var _0xb946e5=this;var _0x154a72=_0xb946e5[_0x4dbf('0x1f')][_0xb946e5[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]];if(strategy[this['voiceQueues'][this['actions'][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]][_0x4dbf('0x50')]]==='roundrobin'){if(this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]]&&this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0x128')]){this[_0x4dbf('0x1e')][_0x4dbf('0x12f')](this['actions'][_0x14205c[_0x4dbf('0x126')]]['idHopper'],this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0x128')])[_0x4dbf('0xb3')](function(_0x144ca7){logger[_0x4dbf('0x9a')](_0x4dbf('0x130'),util[_0x4dbf('0x9b')](_0x144ca7,{'showHidden':![],'depth':null}));})[_0x4dbf('0x1c')](function(){_0xb946e5[_0x4dbf('0xb7')](_0xb946e5['voiceQueues'][_0xb946e5['actions'][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]]);_0xb946e5[_0x4dbf('0x21')][_0xb946e5[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]]['stateinterface']]['locked']=![];delete _0xb946e5[_0x4dbf('0x24')][_0x14205c['actionid']];unlockQueueStatus(_0x154a72);});}else{this[_0x4dbf('0xb7')](this[_0x4dbf('0x1f')][this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]]['ContactId'],'ListId':this[_0x4dbf('0x24')][_0x14205c['actionid']][_0x4dbf('0xd6')],'VoiceQueueId':this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xd8')]||undefined,'CampaignId':this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x14205c[_0x4dbf('0x126')]];unlockQueueStatus(_0x154a72);}}else if((strategy[this[_0x4dbf('0x1f')][this['actions'][_0x14205c[_0x4dbf('0x126')]]['queue']]['strategy']]||_0x4dbf('0x129'))==='rrmemory'){var _0x19ecd9;if(this['actions'][_0x14205c[_0x4dbf('0x126')]]&&!_[_0x4dbf('0x47')](this[_0x4dbf('0x12a')][this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]]['queue']])){if(this['queueBookedRR'][_0xb946e5[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]]){this[_0x4dbf('0x29')][_0xb946e5['actions'][_0x14205c[_0x4dbf('0x126')]]['queue']]=this[_0x4dbf('0x29')][this[_0x4dbf('0x24')][_0x14205c['actionid']][_0x4dbf('0xb5')]]?this[_0x4dbf('0x29')][this[_0x4dbf('0x24')][_0x14205c['actionid']]['queue']]:this[_0x4dbf('0x12a')][this['actions'][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]]?this['queueBooked'][this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]][_0x4dbf('0x131')]||0x0:0x0;}this[_0x4dbf('0x12a')][this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]]['queue']][_0x4dbf('0x131')]=this[_0x4dbf('0x29')][this[_0x4dbf('0x24')][_0x14205c[_0x4dbf('0x126')]][_0x4dbf('0xb5')]];for(var _0x25e793=0x0;_0x25e793=0x0;})[_0x4dbf('0xb3')](myreject(_0x3ae9a4)));}}else{_0x86e91d[_0x4dbf('0x12b')](ami[_0x4dbf('0xb2')]({'action':_0x4dbf('0x14e'),'command':util[_0x4dbf('0x7c')]('iftime\x20%s,%s',_0x3bbdb9,!_[_0x4dbf('0x3d')](config[_0x4dbf('0x14a')][_0x2e960c])?_0x2e960c:'')})[_0x4dbf('0x3c')](function(_0x9ecb77){return _0x9ecb77[_0x4dbf('0x14f')][_0x4dbf('0x150')](_0x4dbf('0x151'))>=0x0;})['catch'](myreject(_0x3ae9a4)));}BPromise[_0x4dbf('0x152')](_0x86e91d)[_0x4dbf('0x3c')](function(_0x56fa4b){var _0x4cc5f9=_[_0x4dbf('0x153')](_0x56fa4b);if(_0x4cc5f9){return _0x17f7ba(_0x4cc5f9);}else{_0x34d083[_0x4dbf('0x3e')]=_0x1770d0?_0x4dbf('0x154'):'INTERVAL_IS_OVERTIME';return _0x3ae9a4(msgResponse('[ifTime][promiseAll]',_0x4dbf('0x148'),_0x4dbf('0x155')+_0x1770d0+'\x20'+_0x371bed+'\x20Interval\x20is\x20overtime:\x20'+util[_0x4dbf('0x9b')](_0x3bbdb9,{'showHidden':![],'depth':null})+_0x4dbf('0x156')+_0x2e960c));}})[_0x4dbf('0xb3')](function(_0x2b308a){return _0x3ae9a4(msgResponse(_0x4dbf('0x147'),_0x4dbf('0x148'),JSON[_0x4dbf('0x4a')](_0x2b308a)));});});};Dialer['prototype'][_0x4dbf('0x157')]=function(_0xef3670){var _0x26d1b6=this;return function(){switch(_0xef3670[_0x4dbf('0x5a')]){case _0x4dbf('0x158'):freeVariablesPredictive(_0xef3670);_0x26d1b6[_0x4dbf('0x159')](_0xef3670,0x1);break;case'power':freeVariablesPredictive(_0xef3670);_0x26d1b6[_0x4dbf('0x159')](_0xef3670,_0xef3670[_0x4dbf('0x15a')]);break;case _0x4dbf('0xb'):_0x26d1b6[_0x4dbf('0xb')](_0xef3670);break;case _0x4dbf('0xa'):freeVariablesPredictive(_0xef3670);_0x26d1b6['handlePower'](_0xef3670,0x1);break;default:freeVariablesPredictive(_0xef3670);logger['error'](_0x4dbf('0x15b'),_0xef3670[_0x4dbf('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x15c')]=function(_0x2b7537){return BPromise['resolve']()[_0x4dbf('0x3c')](cmHopper[_0x4dbf('0x15d')](_0x2b7537['id'],previewRecallmeReminderInterval))[_0x4dbf('0x3c')](function(_0xb029ec){for(var _0x54d724=0x0;_0x54d724<_0xb029ec['length'];_0x54d724++){var _0x5c38d4=_0xb029ec[_0x54d724]['Agent'][_0x4dbf('0x40')];if(_0x5c38d4)io['to'](util[_0x4dbf('0x7c')](_0x4dbf('0x15e'),_0x5c38d4))['emit'](_0x4dbf('0x15f'),{'hopper':_0xb029ec[_0x54d724]});}})['catch'](function(_0x434595){});};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x160')]=function(_0x23cf57){var _0x276f49=this;return function(){_0x276f49[_0x4dbf('0x161')](_0x23cf57);};};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xc')]=function(_0x29d040){var _0x590c38=this;if(isNotPreview(_0x29d040[_0x4dbf('0x5a')])){if(isVoiceQueueOutbound(_0x29d040[_0x4dbf('0x4e')])&&isActive(_0x29d040[_0x4dbf('0x59')])){_0x29d040[_0x4dbf('0xa3')]=!![];BPromise[_0x4dbf('0xbb')]()[_0x4dbf('0x3c')](checkIsLoggedIn(_0x29d040,_0x29d040[_0x4dbf('0x52')]))[_0x4dbf('0x3c')](checkIsActive(_0x29d040,_0x29d040[_0x4dbf('0x59')]))[_0x4dbf('0x3c')](checkInterval(_0x29d040))['then'](_0x590c38[_0x4dbf('0x142')](_0x29d040))['then'](_0x590c38['checkIfTime'](_0x29d040[_0x4dbf('0x162')],_0x29d040[_0x4dbf('0x163')],_0x29d040['name'],_0x29d040))[_0x4dbf('0x3c')](_0x590c38[_0x4dbf('0x146')](_0x29d040['Interval'],_0x29d040['dialTimezone'],_0x29d040['name'],_0x29d040))[_0x4dbf('0x3c')](_0x590c38[_0x4dbf('0x157')](_0x29d040))[_0x4dbf('0xb3')](loggerCatchQueueSummary(_0x4dbf('0x164'),_0x29d040));}else{notSendMessagesQueue(_0x29d040);}}else{freeVariablesPredictive(_0x29d040);if(_0x29d040[_0x4dbf('0x165')]){_0x590c38[_0x4dbf('0x15c')](_0x29d040);}}};Dialer[_0x4dbf('0x1a')]['syncCampaigns']=function(){var _0x51526c=this;var _0x3c1eec;for(var _0x52617c in this['campaigns']){if(typeof this[_0x4dbf('0x20')][_0x52617c]!==_0x4dbf('0xaf')){_0x3c1eec=this[_0x4dbf('0x20')][_0x52617c];if(isCampaignIvr(_0x3c1eec['type'])&&isActive(_0x3c1eec[_0x4dbf('0x7a')])){_0x3c1eec[_0x4dbf('0xa3')]=!![];BPromise['resolve']()[_0x4dbf('0x3c')](checkIsActive(_0x3c1eec,_0x3c1eec['active']))[_0x4dbf('0x3c')](checkInterval(_0x3c1eec))[_0x4dbf('0x3c')](_0x51526c[_0x4dbf('0x142')](_0x3c1eec))[_0x4dbf('0x3c')](_0x51526c[_0x4dbf('0x145')](_0x3c1eec[_0x4dbf('0x162')],_0x3c1eec[_0x4dbf('0x163')],_0x3c1eec[_0x4dbf('0x40')],_0x3c1eec))[_0x4dbf('0x3c')](_0x51526c[_0x4dbf('0x146')](_0x3c1eec[_0x4dbf('0x44')],_0x3c1eec[_0x4dbf('0x163')],_0x3c1eec[_0x4dbf('0x40')],_0x3c1eec))[_0x4dbf('0x3c')](_0x51526c['launchHandleIvr'](_0x3c1eec))['catch'](loggerCatchQueueSummary(_0x4dbf('0x166'),_0x3c1eec));}else{notSendMessagesCampaign(_0x3c1eec);}}}};function getCallerIdRandom(_0x3e1631,_0x1cecd4){var _0xafb7da;var _0x139923;var _0x55d775;if(_0x1cecd4<=0x0){_0x1cecd4=0x1;}_0xafb7da=new RegExp(_0x4dbf('0x167')+_0x1cecd4+'}$');_0x139923=Math[_0x4dbf('0x168')](0xa,_0x1cecd4-0x1);_0x55d775=Math[_0x4dbf('0x168')](0xa,_0x1cecd4)-0x1;return util[_0x4dbf('0x7c')]('%s',_[_0x4dbf('0x169')](_0x3e1631,_0xafb7da,_[_0x4dbf('0x16a')](_0x139923,_0x55d775)));}function extractCalleridName(_0x55ffa5){var _0xcb4f9=_0x55ffa5[_0x4dbf('0x16b')](/"(.*?)"/);return _0xcb4f9?_0xcb4f9[0x1]:_0x55ffa5;}function extractCalleridNumber(_0x1054c4){var _0xcc9bd9=_0x1054c4[_0x4dbf('0x16b')](/<(.*?)>/);return _0xcc9bd9?_0xcc9bd9[0x1]:_0x1054c4;}Dialer['prototype'][_0x4dbf('0x16c')]=function(_0x1f83af,_0x1d57c2){var _0x5a05ea=this;var _0x568248=uuid['v4']();this[_0x4dbf('0x24')][_0x568248]=new Action(_0x1f83af,_0x1d57c2,_0x568248);return new BPromise(function(_0x51d9eb,_0x4f8b43){if(_['isUndefined'](_0x1f83af)&&typeof _0x1f83af!==_0x4dbf('0x16d')){return _0x4f8b43(msgResponse(_0x4dbf('0x16e'),_0x4dbf('0x148'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x1d57c2[_0x4dbf('0x16f')]['phone'])||_0x1d57c2[_0x4dbf('0x16f')][_0x4dbf('0x170')]===null){return _0x4f8b43(msgResponse(_0x4dbf('0x16e'),_0x4dbf('0x148'),'contact\x20is\x20undefine'));}var _0x1dd4e9={'XMD-CALLERID':_0x5a05ea[_0x4dbf('0x24')][_0x568248][_0x4dbf('0x171')](),'XMD-AGI':_0x1f83af[_0x4dbf('0x10d')]?util[_0x4dbf('0x7c')](_0x4dbf('0x172'),ipAgi,_0x1f83af[_0x4dbf('0x10d')]):_0x4dbf('0x173'),'XMD-AGIAFTER':_0x1f83af['dialQueueProject2']?util[_0x4dbf('0x7c')](_0x4dbf('0x172'),ipAgi,_0x1f83af[_0x4dbf('0x11e')]):'NONE','XMD-QUEUE':_0x1f83af[_0x4dbf('0x4e')]===_0x4dbf('0x4f')?util[_0x4dbf('0x7c')](_0x4dbf('0x174'),_0x1f83af['name'],_0x1f83af[_0x4dbf('0x175')]||'',_0x1f83af['dialAgiAfterHangupAgent']?'c':'',_0x1f83af[_0x4dbf('0x176')]||0x3):'NONE','XMD-CONTACTID':_0x1d57c2[_0x4dbf('0xd5')],'XMD-CDRTYPE':_0x4dbf('0x9'),'CALLERID(all)':_0x5a05ea[_0x4dbf('0x24')][_0x568248][_0x4dbf('0x171')](),'XMD-AMD':_0x1f83af[_0x4dbf('0xe5')]?_0x4dbf('0x177'):_0x4dbf('0x173'),'XMD-DESTINATION':_0x4dbf('0xe4')};if(_0x1f83af[_0x4dbf('0xe5')]){_0x1dd4e9['XMD-AMDINITIALSILENCE']=_0x1f83af['dialAMDInitialSilence']||0x9c4;_0x1dd4e9[_0x4dbf('0x178')]=_0x1f83af[_0x4dbf('0x179')]||0x5dc;_0x1dd4e9[_0x4dbf('0x17a')]=_0x1f83af[_0x4dbf('0x17b')]||0x320;_0x1dd4e9[_0x4dbf('0x17c')]=_0x1f83af[_0x4dbf('0x17d')]||0x1388;_0x1dd4e9[_0x4dbf('0x17e')]=_0x1f83af[_0x4dbf('0x17f')]||0x64;_0x1dd4e9[_0x4dbf('0x180')]=_0x1f83af[_0x4dbf('0x181')]||0x32;_0x1dd4e9[_0x4dbf('0x182')]=_0x1f83af[_0x4dbf('0x183')]||0x3;_0x1dd4e9['XMD-AMDSILENCETHRESHOLD']=_0x1f83af[_0x4dbf('0x184')]||0x100;_0x1dd4e9[_0x4dbf('0x185')]=_0x1f83af[_0x4dbf('0x186')]||0x1388;}if(_0x1f83af[_0x4dbf('0x4e')]===_0x4dbf('0x4f')){_0x1dd4e9[_0x4dbf('0x187')]=_0x1d57c2[_0x4dbf('0xd8')];}else{_0x1dd4e9[_0x4dbf('0x188')]=_0x1d57c2[_0x4dbf('0xd9')];}for(var _0x10016b in _0x1d57c2[_0x4dbf('0x16f')]){if(typeof _0x1d57c2[_0x4dbf('0x16f')][_0x10016b]!==_0x4dbf('0xaf')){if(isNotNull(_0x1d57c2[_0x4dbf('0x16f')][_0x10016b])&&_0x10016b!=='id'&&_0x10016b!==_0x4dbf('0x189')&&_0x10016b!=='createdAt'&&_0x10016b!=='updatedAt'){_0x1dd4e9[util['format'](_0x4dbf('0x18a'),_0x4dbf('0x18b'),_[_0x4dbf('0x18c')](_0x10016b))]=_0x1d57c2[_0x4dbf('0x16f')][_0x10016b];}}}var _0x1d49f3=_0x5a05ea[_0x4dbf('0x143')](_0x1f83af[_0x4dbf('0x79')])?getCallerId(_0x1f83af[_0x4dbf('0x79')][_0x4dbf('0x7b')],_0x1f83af[_0x4dbf('0x5b')],_0x1f83af[_0x4dbf('0x18d')]>0x0?getCallerIdRandom(_0x1f83af['dialOriginateCallerIdNumber'],_0x1f83af['dialRandomLastDigitCallerIdNumber']):_0x1f83af[_0x4dbf('0x5c')]):getCallerId(_[_0x4dbf('0xb1')](_0x1f83af[_0x4dbf('0x144')])?_0x1f83af[_0x4dbf('0x79')][_0x4dbf('0x7b')]:_0x1f83af[_0x4dbf('0x144')][_0x4dbf('0x7b')],_0x1f83af['dialOriginateCallerIdName'],_0x1f83af[_0x4dbf('0x18d')]>0x0?getCallerIdRandom(_0x1f83af['dialOriginateCallerIdNumber'],_0x1f83af['dialRandomLastDigitCallerIdNumber']):_0x1f83af[_0x4dbf('0x5c')]);if(_0x1d49f3){_0x1dd4e9['XMD-ORIGINATECALLERIDNAME']=_0x5a05ea[_0x4dbf('0x24')][_0x568248]['originatecalleridname']=extractCalleridName(_0x1d49f3);_0x1dd4e9[_0x4dbf('0x18e')]=_0x5a05ea[_0x4dbf('0x24')][_0x568248][_0x4dbf('0x18f')]=extractCalleridNumber(_0x1d49f3);}return ami[_0x4dbf('0xb2')]({'actionid':_0x568248,'action':'originate','channel':_0x5a05ea['isTrunkReachable'](_0x1f83af['Trunk'])?util[_0x4dbf('0x7c')](_0x4dbf('0x190'),_0x1f83af[_0x4dbf('0x79')]['name'],isNotNull(_0x1f83af[_0x4dbf('0x5e')])?_0x1f83af['dialPrefix'][_0x4dbf('0x191')]()||'':'',_0x1f83af[_0x4dbf('0x192')]>0x0?_0x1d57c2['Contact'][_0x4dbf('0x170')][_0x4dbf('0x193')](_0x1f83af[_0x4dbf('0x192')]):_0x1d57c2[_0x4dbf('0x16f')][_0x4dbf('0x170')]):util[_0x4dbf('0x7c')]('SIP/%s/%s%s',_['isNil'](_0x1f83af['TrunkBackup'])?_0x1f83af[_0x4dbf('0x79')][_0x4dbf('0x40')]:_0x1f83af[_0x4dbf('0x144')]['name'],isNotNull(_0x1f83af[_0x4dbf('0x5e')])?_0x1f83af[_0x4dbf('0x5e')][_0x4dbf('0x191')]()||'':'',_0x1f83af[_0x4dbf('0x192')]>0x0?_0x1d57c2[_0x4dbf('0x16f')][_0x4dbf('0x170')]['substring'](_0x1f83af[_0x4dbf('0x192')]):_0x1d57c2[_0x4dbf('0x16f')][_0x4dbf('0x170')]),'callerid':_0x1d49f3,'Exten':_0x4dbf('0xe4'),'Context':'from-sip','Priority':'1','variable':_0x1dd4e9,'timeout':(_0x1f83af[_0x4dbf('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x568248})[_0x4dbf('0x3c')](function(_0x1f972e){return _0x51d9eb(_0x1f972e);})['catch'](function(_0x547aca){_0x1f83af[_0x4dbf('0x68')]+=0x1;var _0x2a34ee=new History(_0x5a05ea[_0x4dbf('0x24')][_0x568248]);logger[_0x4dbf('0x9a')](util[_0x4dbf('0x7c')](_0x4dbf('0x194'),JSON[_0x4dbf('0x4a')](_0x547aca)));_0x2a34ee[_0x4dbf('0xa9')]=0xe;_0x2a34ee[_0x4dbf('0xaa')]=_0x4dbf('0x195');_0x2a34ee[_0x4dbf('0xac')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a34ee['endtime']=_0x2a34ee[_0x4dbf('0xac')];_0x5a05ea['createHistory'](_0x2a34ee)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x196')));_0x5a05ea[_0x4dbf('0xcc')](_0x2a34ee)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x196')))[_0x4dbf('0x1c')](function(){delete _0x5a05ea[_0x4dbf('0x24')][_0x568248];return _0x4f8b43(msgResponse(_0x4dbf('0x16e'),_0x4dbf('0x49'),_0x4dbf('0x197')));});});});};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x198')]=function(_0x42e0eb){var _0xbfb321=this[_0x4dbf('0x24')][_0x42e0eb[_0x4dbf('0x126')]];if(_0xbfb321){delete this['actions'][_0x42e0eb[_0x4dbf('0x126')]];_0xbfb321[_0x4dbf('0x199')]=moment()[_0x4dbf('0x7c')](_0x4dbf('0x103'));var _0x49b6d9=_0xbfb321[_0x4dbf('0x4e')]===_0x4dbf('0x96')?this['campaigns'][_0xbfb321[_0x4dbf('0xb5')]]:this[_0x4dbf('0x1f')][_0xbfb321['getQueue']()];if(!this['isSuccess'](_0x42e0eb[_0x4dbf('0x19a')])){this['updateOriginated'](_0x49b6d9);return this[_0x4dbf('0x19b')](_0xbfb321,_0x49b6d9,_0x42e0eb)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x19c')));}this[_0x4dbf('0x26')][_0x42e0eb['uniqueid']]=_0xbfb321;}};Dialer[_0x4dbf('0x1a')]['checkRetriveMax']=function(_0x311c00,_0xc3ab29,_0x388654){var _0x45a645=new History(_0xc3ab29);if(_0x45a645[_0x4dbf('0xf3')]+_0x45a645[_0x4dbf('0xf4')]+_0x45a645[_0x4dbf('0xf5')]+_0x45a645[_0x4dbf('0xf6')]+_0x45a645[_0x4dbf('0xf7')]+_0x45a645[_0x4dbf('0xf8')]+_0x45a645[_0x4dbf('0xf1')]+_0x45a645[_0x4dbf('0xf9')]>=_0x388654[_0x4dbf('0xfa')]-0x1){return!![];}switch(_0x311c00){case 0x3:if(_0x45a645[_0x4dbf('0xf5')]>=_0x388654[_0x4dbf('0x19d')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countnoanswerretry':_0x45a645[_0x4dbf('0xf5')]+=0x1,'scheduledat':moment()[_0x4dbf('0x100')](_0x388654[_0x4dbf('0x19e')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x45a645['ContactId'],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x45a645['CampaignId']||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x19f')));break;case 0x5:if(_0x45a645[_0x4dbf('0xf3')]>=_0x388654[_0x4dbf('0x1a0')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countbusyretry':_0x45a645[_0x4dbf('0xf3')]+=0x1,'scheduledat':moment()[_0x4dbf('0x100')](_0x388654[_0x4dbf('0x1a1')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645['VoiceQueueId']||undefined,'CampaignId':_0x45a645[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1a2')));break;case 0x8:if(_0x45a645['countcongestionretry']>=_0x388654[_0x4dbf('0x1a3')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countcongestionretry':_0x45a645[_0x4dbf('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x388654['dialCongestionRetryFrequency'],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x45a645[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1a4')));break;case 0x0:if(_0x45a645[_0x4dbf('0xf6')]>=_0x388654[_0x4dbf('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x45a645['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x4dbf('0x100')](_0x388654[_0x4dbf('0x1a6')],_0x4dbf('0x102'))['format'](_0x4dbf('0x103')),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645['ListId'],'VoiceQueueId':_0x45a645['VoiceQueueId']||undefined,'CampaignId':_0x45a645[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x45a645[_0x4dbf('0xf7')]>=_0x388654[_0x4dbf('0x1a7')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countdropretry':_0x45a645[_0x4dbf('0xf7')]+=0x1,'scheduledat':moment()[_0x4dbf('0x100')](_0x388654[_0x4dbf('0x11f')],_0x4dbf('0x102'))['format'](_0x4dbf('0x103')),'ContactId':_0x45a645['ContactId'],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645['VoiceQueueId']||undefined,'CampaignId':_0x45a645['CampaignId']||undefined})[_0x4dbf('0xb3')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x45a645[_0x4dbf('0xf8')]>=_0x388654[_0x4dbf('0x122')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countabandonedretry':_0x45a645[_0x4dbf('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x388654[_0x4dbf('0x1a8')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x45a645[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x45a645[_0x4dbf('0xf1')]>=_0x388654[_0x4dbf('0xfd')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countmachineretry':_0x45a645['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x388654[_0x4dbf('0x101')],_0x4dbf('0x102'))[_0x4dbf('0x7c')](_0x4dbf('0x103')),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645[_0x4dbf('0xd6')],'VoiceQueueId':_0x45a645[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x45a645['CampaignId']||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x104')));break;case 0x14:if(_0x45a645[_0x4dbf('0xf9')]>=_0x388654[_0x4dbf('0x1a9')]-0x1){return!![];}this[_0x4dbf('0xc1')]({'active':![],'countagentrejectretry':_0x45a645['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x4dbf('0x100')](_0x388654[_0x4dbf('0x1aa')],_0x4dbf('0x102'))[_0x4dbf('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45a645[_0x4dbf('0xd5')],'ListId':_0x45a645['ListId'],'VoiceQueueId':_0x45a645[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x45a645[_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1ab')));break;default:return!![];}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x19b')]=function(_0xa4e52d,_0x263fad,_0x184c0e){var _0x3347eb=this;var _0x234e3e=new History(_0xa4e52d);return new BPromise(function(_0x1b03b3,_0x4fa848){if(_['isUndefined'](_0x263fad)&&typeof _0x263fad!=='object'){return _0x4fa848(msgResponse(_0x4dbf('0x1ac'),_0x4dbf('0x148'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x184c0e)&&typeof _0x184c0e!=='object'){return _0x4fa848(msgResponse(_0x4dbf('0x1ac'),_0x4dbf('0x148'),'evt\x20is\x20undefine'));}switch(_0x184c0e[_0x4dbf('0x10f')]){case'0':_0x263fad['outboundNoSuchCallsDay']+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0x0;_0x234e3e[_0x4dbf('0xaa')]=_0x4dbf('0x1ad');_0x234e3e[_0x4dbf('0xf6')]+=0x1;_0x234e3e['countglobal']+=0x1;ami[_0x4dbf('0xe8')](_0x4dbf('0x1ae'),ut[_0x4dbf('0xea')](_0xa4e52d,_0x4dbf('0x1af')));_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1b0')));if(_0x3347eb[_0x4dbf('0x1b1')](0x0,_0xa4e52d,_0x263fad)){if(_0x234e3e[_0x4dbf('0xf6')]>=_0x263fad[_0x4dbf('0x1a5')]){_0x3347eb[_0x4dbf('0xfe')](_0x234e3e,_0x1b03b3,_0x4fa848,'reason\x200\x20no\x20such\x20number....');}else{_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1b2'));}}break;case'3':_0x263fad[_0x4dbf('0x66')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0x3;_0x234e3e[_0x4dbf('0xaa')]='NoAnswer';_0x234e3e['countnoanswerretry']+=0x1;_0x234e3e[_0x4dbf('0xf2')]+=0x1;ami['emit'](_0x4dbf('0x1b3'),ut['buildObj'](_0xa4e52d,_0x4dbf('0x1b4')));_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1b5')));if(_0x3347eb['checkRetriveMax'](0x3,_0xa4e52d,_0x263fad)){if(_0x234e3e[_0x4dbf('0xf5')]>=_0x263fad[_0x4dbf('0x19d')]){_0x3347eb['createStateFinal'](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1b6'));}else{_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1b6'));}}break;case'5':_0x263fad[_0x4dbf('0x62')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0x5;_0x234e3e[_0x4dbf('0xaa')]=_0x4dbf('0x1b7');_0x234e3e['countbusyretry']+=0x1;_0x234e3e['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x4dbf('0xea')](_0xa4e52d,'busy'));_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1b8')));if(_0x3347eb['checkRetriveMax'](0x5,_0xa4e52d,_0x263fad)){if(_0x234e3e['countbusyretry']>=_0x263fad[_0x4dbf('0x1a0')]){_0x3347eb['createStateFinal'](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1b9'));}else{_0x3347eb['stateGlobal'](_0x234e3e,_0x1b03b3,_0x4fa848,'reason\x205\x20busy');}}break;case'8':_0x263fad[_0x4dbf('0x63')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0x8;_0x234e3e[_0x4dbf('0xaa')]=_0x4dbf('0x1ba');_0x234e3e[_0x4dbf('0xf4')]+=0x1;_0x234e3e[_0x4dbf('0xf2')]+=0x1;ami[_0x4dbf('0xe8')]('custom:agentcongestion',ut[_0x4dbf('0xea')](_0xa4e52d,_0x4dbf('0x1bb')));_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)['catch'](loggerCatch(_0x4dbf('0x1bc')));if(_0x3347eb[_0x4dbf('0x1b1')](0x8,_0xa4e52d,_0x263fad)){if(_0x234e3e[_0x4dbf('0xf4')]>=_0x263fad[_0x4dbf('0x1a3')]){_0x3347eb[_0x4dbf('0xfe')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1bd'));}else{_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1bd'));}}break;case'11':_0x263fad[_0x4dbf('0x1be')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0xb;_0x234e3e[_0x4dbf('0xaa')]=_0x4dbf('0x1bf');_0x234e3e[_0x4dbf('0xf8')]+=0x1;_0x234e3e[_0x4dbf('0xf2')]+=0x1;_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x124')));if(_0x3347eb['checkRetriveMax'](0xb,_0xa4e52d,_0x263fad)){if(_0x234e3e[_0x4dbf('0xf8')]>=_0x263fad[_0x4dbf('0x122')]){_0x3347eb[_0x4dbf('0xfe')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1c0'));}else{_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,'reason\x2011\x20abandoned');}}break;case'20':_0x263fad[_0x4dbf('0x6a')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0x14;_0x234e3e[_0x4dbf('0xaa')]=_0x4dbf('0x1c1');_0x234e3e[_0x4dbf('0xf9')]+=0x1;_0x234e3e[_0x4dbf('0xf2')]+=0x1;ami['emit'](_0x4dbf('0x1c2'),ut['buildObj'](_0xa4e52d,_0x4dbf('0x1c3')));_0x3347eb['createHistory'](_0x234e3e)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3347eb['checkRetriveMax'](0x14,_0xa4e52d,_0x263fad)){if(_0x234e3e['countagentrejectretry']>=_0x263fad['dialAgentRejectMaxRetry']){_0x3347eb[_0x4dbf('0xfe')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1c4'));}else{_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x4dbf('0x1c4'));}}break;default:_0x263fad[_0x4dbf('0x6b')]+=0x1;_0x234e3e[_0x4dbf('0xa9')]=0xc;_0x234e3e['statedesc']=_0x184c0e['reason'];_0x3347eb[_0x4dbf('0xcd')](_0x234e3e)[_0x4dbf('0xb3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3347eb[_0x4dbf('0x1b1')](_0x184c0e['reason'],_0xa4e52d,_0x263fad)){if(_0x234e3e[_0x4dbf('0xf3')]+_0x234e3e[_0x4dbf('0xf4')]+_0x234e3e[_0x4dbf('0xf5')]+_0x234e3e[_0x4dbf('0xf6')]+_0x234e3e[_0x4dbf('0xf7')]+_0x234e3e[_0x4dbf('0xf8')]+_0x234e3e[_0x4dbf('0xf1')]+_0x234e3e[_0x4dbf('0xf9')]>=_0x263fad['dialGlobalMaxRetry']){_0x3347eb[_0x4dbf('0xfb')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x184c0e[_0x4dbf('0x10f')]);}else{_0x3347eb[_0x4dbf('0xfe')](_0x234e3e,_0x1b03b3,_0x4fa848,_0x184c0e[_0x4dbf('0x10f')]);}}}});};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xfb')]=function(_0x78f820,_0x415a90,_0x4b3ec7,_0x3cd700){var _0x14891a=new Final(_0x78f820);_0x14891a[_0x4dbf('0xa9')]=0xf;_0x14891a[_0x4dbf('0xaa')]='Global';this['createStateFinal'](_0x14891a,_0x415a90,_0x4b3ec7,_0x3cd700);};Dialer['prototype'][_0x4dbf('0xfe')]=function(_0x5776ca,_0x2a22c5,_0x323c6c,_0x562909){this[_0x4dbf('0xcc')](_0x5776ca)[_0x4dbf('0x3c')](function(){return _0x2a22c5(msgResponse(_0x4dbf('0x1ac'),_0x4dbf('0xdc'),_0x562909));})['catch'](function(){return _0x323c6c(msgResponse(_0x4dbf('0x1c5'),_0x4dbf('0x148'),_0x4dbf('0x1c6')));});};Dialer[_0x4dbf('0x1a')][_0x4dbf('0xb')]=function(_0x21dfa1){var _0x519147=_0x21dfa1[_0x4dbf('0x1c7')]/0x64;var _0x212ef5=_0x21dfa1['outboundDropCallsDayTimeout']/(_0x21dfa1['outboundDropCallsDayTimeout']+_0x21dfa1[_0x4dbf('0x60')]);var _0x4efa69=Math['round'](_0x21dfa1['predictiveIntervalAvailable']*(_0x21dfa1['predictiveIntervalMaxThreshold']/0x64));var _0x3f2885=Math[_0x4dbf('0x1c8')](_0x21dfa1['predictiveIntervalAvailable']*(_0x21dfa1[_0x4dbf('0x1c9')]/0x64));var _0x2a558f=_0x21dfa1[_0x4dbf('0x51')]+_0x21dfa1[_0x4dbf('0x55')];var _0x5a6f1f=Math[_0x4dbf('0x1ca')](_0x21dfa1[_0x4dbf('0x76')]*_0x21dfa1[_0x4dbf('0x8f')]*_0x21dfa1['predictiveIntervalHitRate']*_0x21dfa1['predictiveIntervalMultiplicativeFactor']);if(_[_0x4dbf('0x3d')](_0x21dfa1[_0x4dbf('0x92')])){if(!_[_0x4dbf('0x3d')](_0x21dfa1[_0x4dbf('0x28')])){_0x21dfa1['startPredictive']=undefined;loggerPredictive[_0x4dbf('0x9a')]('[startMethodPredictive][StartProgressive]',_0x4dbf('0x1cb'));}if(!_[_0x4dbf('0x3d')](_0x21dfa1[_0x4dbf('0x94')])){loggerPredictive['error'](_0x4dbf('0x1cc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x21dfa1['handlePredictive']);_0x21dfa1[_0x4dbf('0x94')]=undefined;}_0x21dfa1[_0x4dbf('0x92')]=moment()[_0x4dbf('0x7c')](_0x4dbf('0x103'));loggerPredictive[_0x4dbf('0x80')](_0x21dfa1[_0x4dbf('0x40')],_0x4dbf('0x1cd'),_0x21dfa1[_0x4dbf('0x92')]);this[_0x4dbf('0x159')](_0x21dfa1,0x1);}else if(ifInterval(_0x21dfa1[_0x4dbf('0x1ce')],_0x21dfa1['startProgressive'])){this['handlePower'](_0x21dfa1,0x1);loggerPredictiveCalls['info'](_0x4dbf('0x1cf'),_0x21dfa1['startProgressive'],_0x21dfa1[_0x4dbf('0x40')]);_0x21dfa1[_0x4dbf('0x76')]=0x0;_0x21dfa1['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x519147<_0x212ef5&&_0x21dfa1[_0x4dbf('0x1d0')]===_0x4dbf('0x1d1')){freeVariablesPredictive(_0x21dfa1);loggerPredictive['info'](_0x4dbf('0x1d2'),'Dropped\x20calls\x20day',_0x212ef5,_0x4dbf('0x92'),_0x21dfa1[_0x4dbf('0x40')]);}else if(_0x5a6f1f<_0x21dfa1[_0x4dbf('0x11a')]&&_0x21dfa1[_0x4dbf('0x1d0')]===_0x4dbf('0x1d1')){freeVariablesPredictive(_0x21dfa1);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x1d3'),_0x4dbf('0x1d4'),_0x5a6f1f,_0x4dbf('0x1d5'),_0x21dfa1[_0x4dbf('0x11a')],_0x4dbf('0x92'),_0x21dfa1['name']);}else if(!ifInterval(_0x21dfa1[_0x4dbf('0x1ce')],_0x21dfa1[_0x4dbf('0x92')])&&_[_0x4dbf('0x3d')](_0x21dfa1[_0x4dbf('0x28')])&&!_[_0x4dbf('0x3d')](_0x21dfa1['startProgressive'])){_0x21dfa1[_0x4dbf('0x28')]=moment()[_0x4dbf('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4dbf('0x80')](_0x21dfa1['name'],_0x4dbf('0x1d6'),_0x21dfa1[_0x4dbf('0x28')]);this[_0x4dbf('0xbf')](_0x21dfa1[_0x4dbf('0x1ce')])[_0x4dbf('0x3c')](this[_0x4dbf('0x1d7')](_0x21dfa1))[_0x4dbf('0x3c')](mergeDataErlangB(_0x21dfa1))[_0x4dbf('0x3c')](this[_0x4dbf('0x1d8')](_0x21dfa1))[_0x4dbf('0xb3')](loggerCatchPredictive(_0x4dbf('0x1d9'),_0x21dfa1));}else if(!ifInterval(_0x21dfa1[_0x4dbf('0x1ce')],_0x21dfa1['startPredictive'])){_0x21dfa1[_0x4dbf('0x11a')]=0x0;_0x21dfa1[_0x4dbf('0x28')]=moment()['format'](_0x4dbf('0x103'));loggerPredictive['info'](_0x21dfa1[_0x4dbf('0x40')],_0x4dbf('0x1da'),_0x21dfa1[_0x4dbf('0x28')]);clearInterval(_0x21dfa1[_0x4dbf('0x94')]);_0x21dfa1[_0x4dbf('0x94')]=undefined;this['averageHandleTime'](_0x21dfa1[_0x4dbf('0x1ce')])[_0x4dbf('0x3c')](this[_0x4dbf('0x1d7')](_0x21dfa1))[_0x4dbf('0x3c')](mergeDataErlangB(_0x21dfa1))[_0x4dbf('0x3c')](this[_0x4dbf('0x1d8')](_0x21dfa1))['catch'](loggerCatchPredictive(_0x4dbf('0x1db'),_0x21dfa1));}else if(_0x21dfa1['predictiveIntervalAvailable']&&_0x2a558f<_0x21dfa1[_0x4dbf('0x73')]-_0x3f2885){freeVariablesPredictive(_0x21dfa1);loggerPredictive[_0x4dbf('0x80')](_0x21dfa1[_0x4dbf('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2a558f,_0x4dbf('0x1dc'),_0x21dfa1[_0x4dbf('0x73')],'-',_0x3f2885,'=',_0x21dfa1['predictiveIntervalAvailable']-_0x3f2885,')');}else if(_0x21dfa1['predictiveIntervalAvailable']&&_0x2a558f>_0x21dfa1['predictiveIntervalAvailable']+_0x4efa69){freeVariablesPredictive(_0x21dfa1);loggerPredictive[_0x4dbf('0x80')](_0x21dfa1[_0x4dbf('0x40')],_0x4dbf('0x1dd'),_0x2a558f,')\x20are\x20more\x20than\x20threshold\x20(',_0x21dfa1['predictiveIntervalAvailable'],'+',_0x4efa69,'=',_0x21dfa1[_0x4dbf('0x73')]+_0x4efa69,')');}};Dialer['prototype']['getDataPredictive']=function(_0x5386b1){var _0x3decf1=this;return function(_0x6820f2){return new BPromise(function(_0x41240b,_0x5ac09a){_[_0x4dbf('0x91')](_0x5386b1,_0x6820f2[0x0]);if(checkGetDataPredictive(_0x6820f2[0x0])){var _0x1cd681=_0x5386b1['predictiveIntervalAvailable']=_0x5386b1[_0x4dbf('0x55')]+_0x5386b1[_0x4dbf('0x51')];var _0x589216=_0x5386b1[_0x4dbf('0x1ce')]*0x3c;var _0x2722d7=_0x6820f2[0x0][_0x4dbf('0x6e')]+_0x6820f2[0x0][_0x4dbf('0x6d')];var _0x2b4c4c=(_0x6820f2[0x0]['predictiveIntervalAnsweredCalls']+_0x6820f2[0x0][_0x4dbf('0x70')]+_0x6820f2[0x0][_0x4dbf('0x6f')])/_0x6820f2[0x0][_0x4dbf('0x74')];_0x5386b1[_0x4dbf('0x71')]=_0x2b4c4c>0x0?_0x2b4c4c:0x1;switch(_0x5386b1['dialPredictiveOptimization']){case _0x4dbf('0x1d1'):var _0x4354a2=_0x5386b1[_0x4dbf('0x1c7')]/0x64;return _0x3decf1['abandonmentRate'](_0x1cd681,_0x589216,_0x2722d7,_0x2b4c4c,_0x4354a2)[_0x4dbf('0x3c')](function(_0x50b3d){return _0x41240b(_0x50b3d);});case _0x4dbf('0x1de'):var _0x26340e=_0x5386b1[_0x4dbf('0x1c7')]/0x64;return _0x3decf1['busyFactor'](_0x1cd681,_0x589216,_0x2722d7,_0x2b4c4c,_0x26340e)['then'](function(_0x31bb89){return _0x41240b(_0x31bb89);});default:return _0x5ac09a(msgResponse(_0x4dbf('0x1df'),'Failure',_0x4dbf('0x1e0')));}}else{return _0x5ac09a(msgResponse(_0x4dbf('0x1df'),_0x4dbf('0x148'),'check\x20failure'));}});};};Dialer[_0x4dbf('0x1a')]['getDataPredictiveOld']=function(_0x79ac6d){var _0x44d8b5=this;return function(_0xc502b6){return new BPromise(function(_0x3eda98,_0xc66bb7){_[_0x4dbf('0x91')](_0x79ac6d,_0xc502b6[0x0]);if(checkGetDataPredictive(_0xc502b6[0x0])){loggerPredictive[_0x4dbf('0x80')](JSON[_0x4dbf('0x4a')](_0xc502b6[0x0]));if(_0x79ac6d[_0x4dbf('0x1d0')]===_0x4dbf('0x1d1')){return _0x44d8b5[_0x4dbf('0xca')](_0x79ac6d['id'])[_0x4dbf('0x3c')](function(_0x4a8545){var _0x11b125=_0x79ac6d[_0x4dbf('0x52')]-_0x4a8545[0x0][_0x4dbf('0x1e1')];var _0xd94a34=_0x79ac6d[_0x4dbf('0x1ce')]*0x3c;var _0x2ed682=_0xc502b6[0x0][_0x4dbf('0x6e')]+_0xc502b6[0x0][_0x4dbf('0x6d')];var _0x10966a=(_0xc502b6[0x0][_0x4dbf('0x6c')]+_0xc502b6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xc502b6[0x0][_0x4dbf('0x6f')])/_0xc502b6[0x0][_0x4dbf('0x74')];var _0x58de98=_0x79ac6d['dialPredictiveOptimizationPercentage']/0x64;_0x79ac6d['predictiveIntervalPauses']=_0x4a8545[0x0][_0x4dbf('0x1e1')]||0x0;_0x79ac6d[_0x4dbf('0x71')]=_0x10966a>0x0?_0x10966a:0x1;return _0x44d8b5[_0x4dbf('0x1e2')](_0x11b125,_0xd94a34,_0x2ed682,_0x10966a,_0x58de98);})[_0x4dbf('0x3c')](function(_0xf63a5d){return _0x3eda98(_0xf63a5d);})[_0x4dbf('0xb3')](function(_0x8676cd){return _0xc66bb7(msgResponse('[CatchErlangB]','Failure',JSON[_0x4dbf('0x4a')](_0x8676cd)));});}if(_0x79ac6d['dialPredictiveOptimization']===_0x4dbf('0x1de')){return _0x44d8b5[_0x4dbf('0xca')](_0x79ac6d['id'])[_0x4dbf('0x3c')](function(_0x41140e){var _0x6a57fe=_0x79ac6d[_0x4dbf('0x52')]-_0x41140e[0x0][_0x4dbf('0x1e1')];var _0x3ae3d6=_0x79ac6d[_0x4dbf('0x1ce')]*0x3c;var _0x107e24=_0xc502b6[0x0][_0x4dbf('0x6e')]+_0xc502b6[0x0][_0x4dbf('0x6d')];var _0x4021bf=(_0xc502b6[0x0][_0x4dbf('0x6c')]+_0xc502b6[0x0][_0x4dbf('0x70')]+_0xc502b6[0x0][_0x4dbf('0x6f')])/_0xc502b6[0x0][_0x4dbf('0x74')];var _0x42ce40=_0x79ac6d['dialPredictiveOptimizationPercentage']/0x64;_0x79ac6d[_0x4dbf('0x72')]=_0x41140e[0x0][_0x4dbf('0x1e1')]||0x0;_0x79ac6d[_0x4dbf('0x71')]=_0x4021bf>0x0?_0x4021bf:0x1;return _0x44d8b5[_0x4dbf('0x1e3')](_0x6a57fe,_0x3ae3d6,_0x107e24,_0x4021bf,_0x42ce40);})[_0x4dbf('0x3c')](function(_0x59aaec){return _0x3eda98(_0x59aaec);})[_0x4dbf('0xb3')](function(_0x102868){return _0xc66bb7(msgResponse(_0x4dbf('0x1e4'),_0x4dbf('0x148'),JSON[_0x4dbf('0x4a')](_0x102868)));});}}else{return _0xc66bb7(msgResponse('[getDataPredictive]',_0x4dbf('0x148'),_0x4dbf('0x1e5')));}});};};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x1d8')]=function(_0x310849){var _0x52e239=this;return function(){var _0xe70e1f=0x0;var _0x3c3392=Math['floor'](_0x310849['erlangCallToSecond']*0x3e8);if(_0x3c3392>0x0){_0x3c3392=_0x3c3392<0x64?0x64:_0x3c3392;loggerPredictive[_0x4dbf('0x80')](_0x310849[_0x4dbf('0x40')],_0x4dbf('0x1e6'),_0x3c3392,_0x4dbf('0x4b'));_0x310849['handlePredictive']=setInterval(function(){_0x52e239[_0x4dbf('0x94')](_0x310849);loggerPredictiveCalls[_0x4dbf('0x80')](_0x4dbf('0x1e7'),_0xe70e1f+=0x1);},_0x3c3392);}else{loggerPredictive[_0x4dbf('0x80')](_0x310849[_0x4dbf('0x40')],_0x4dbf('0x1e8'));}};};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x1e9')]=function(_0x27d26e,_0x239675){var _0x37c023=this;return function(_0x884d23){if(_[_0x4dbf('0x47')](_0x884d23)){if(_[_0x4dbf('0xb1')](_0x239675[_0x4dbf('0xd7')])||!_0x239675[_0x4dbf('0x1ea')]){if(_0x27d26e[_0x4dbf('0x5a')]===_0x4dbf('0xa')){_0x27d26e[_0x4dbf('0x12c')]=_[_0x4dbf('0x3d')](_0x27d26e['queueStatusComplete'])?!![]:_0x27d26e[_0x4dbf('0x12c')];var _0x2d9922=uuid['v4']();_0x37c023[_0x4dbf('0x24')][_0x2d9922]=new Action(_0x27d26e,_0x239675,_0x2d9922);loggerBooked['info'](_0x4dbf('0x1eb'),_0x2d9922,_0x4dbf('0x1ec'),JSON['stringify'](_0x27d26e[_0x4dbf('0x12c')]),_0x4dbf('0x1ed'),_0x27d26e[_0x4dbf('0x40')]);if(_0x27d26e['queueStatusComplete']){_0x27d26e[_0x4dbf('0x12c')]=![];_0x37c023[_0x4dbf('0x12a')][_0x37c023[_0x4dbf('0x24')][_0x2d9922][_0x4dbf('0xb5')]]=[];ami[_0x4dbf('0xb2')]({'actionid':_0x2d9922,'action':'queuestatus','queue':_0x27d26e[_0x4dbf('0x40')]})[_0x4dbf('0xb3')](function(){_0x37c023['updateOriginated'](_0x27d26e);_0x37c023[_0x4dbf('0xc1')]({'active':![],'ContactId':_0x37c023[_0x4dbf('0x24')][_0x2d9922][_0x4dbf('0xd5')],'ListId':_0x37c023['actions'][_0x2d9922][_0x4dbf('0xd6')],'VoiceQueueId':_0x37c023[_0x4dbf('0x24')][_0x2d9922][_0x4dbf('0xd8')]||undefined,'CampaignId':_0x37c023['actions'][_0x2d9922][_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1ee')));delete _0x37c023[_0x4dbf('0x24')][_0x2d9922];});}else{loggerBooked[_0x4dbf('0x80')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x27d26e[_0x4dbf('0x12c')]),_0x4dbf('0x1ed'),_0x27d26e['name']);_0x37c023[_0x4dbf('0xb7')](_0x27d26e);_0x37c023['rescheduleContact']({'active':![],'ContactId':_0x37c023['actions'][_0x2d9922][_0x4dbf('0xd5')],'ListId':_0x37c023['actions'][_0x2d9922][_0x4dbf('0xd6')],'VoiceQueueId':_0x37c023[_0x4dbf('0x24')][_0x2d9922][_0x4dbf('0xd8')]||undefined,'CampaignId':_0x37c023[_0x4dbf('0x24')][_0x2d9922][_0x4dbf('0xd9')]||undefined})[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0x1ee')));delete _0x37c023[_0x4dbf('0x24')][_0x2d9922];}}else{return _0x37c023[_0x4dbf('0x16c')](_0x27d26e,_0x239675);}}else{if(getDiff(_0x239675[_0x4dbf('0x1ef')])<_0x27d26e['dialRecallMeTimeout']*0x3c){if(_0x239675[_0x4dbf('0x1f0')]&&!_0x239675[_0x4dbf('0x1f0')][_0x4dbf('0x1f1')]){_0x37c023['preview'][_0x4dbf('0x12f')](_0x239675['id'])['finally'](function(){_0x37c023[_0x4dbf('0xb7')](_0x27d26e);});}else{_0x37c023[_0x4dbf('0xc3')]({'active':![]},_0x239675['id'],0x1)[_0x4dbf('0x1c')](function(){_0x37c023[_0x4dbf('0xb7')](_0x27d26e);});}}else{_0x27d26e[_0x4dbf('0x69')]+=0x1;_0x37c023[_0x4dbf('0xb7')](_0x27d26e);if(_0x27d26e[_0x4dbf('0x1f2')]){_0x37c023[_0x4dbf('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x239675[_0x4dbf('0xd5')],'ListId':_0x239675[_0x4dbf('0xd6')],'VoiceQueueId':_0x239675[_0x4dbf('0xd8')]||undefined,'CampaignId':_0x239675[_0x4dbf('0xd9')]||undefined})['catch'](loggerCatch(_0x4dbf('0x1f3')));_0x37c023['createHistory'](createObjHistory(_0x27d26e,_0x239675,'RECALLINQUEUE',0x17,_0x4dbf('0x1f4')))[_0x4dbf('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x37c023[_0x4dbf('0xd3')](createObjHistory(_0x27d26e,_0x239675,_0x4dbf('0x1f5'),0x16,_0x4dbf('0x1f6')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x27d26e['outboundBlacklistCallsDay']+=0x1;_0x37c023[_0x4dbf('0xd3')](createObjHistory(_0x27d26e,_0x239675,'BLACKLIST',0xd,_0x4dbf('0x1f7')),_0x4dbf('0x1f8'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0x4dbf('0x161')]=function(_0x18dc5d){var _0x4a7560=this;var _0xe5e578=_0x18dc5d[_0x4dbf('0x1f9')]-_0x18dc5d['originated']-_0x18dc5d[_0x4dbf('0xc6')];emitCampaignSummary(_0x18dc5d);if(_0xe5e578>0x0){if(_0xe5e578>this['maxNumberOriginate']){_0xe5e578=this[_0x4dbf('0x23')];}_0x18dc5d[_0x4dbf('0xc6')]+=_0xe5e578;this[_0x4dbf('0xc8')](_0x18dc5d['id'],_0xe5e578,_0x18dc5d[_0x4dbf('0x1fa')],_0x18dc5d)[_0x4dbf('0x3c')](function(_0xebd74d){_0x18dc5d[_0x4dbf('0xc6')]-=_0xe5e578;_0x18dc5d[_0x4dbf('0xc6')]=_0x18dc5d[_0x4dbf('0xc6')]>0x0?_0x18dc5d[_0x4dbf('0xc6')]:0x0;if(!checkContactEmpty(_0xebd74d)){_0x18dc5d['message']=_0x4dbf('0x1fb');logger['info'](_0x4dbf('0x1fc')+_0x18dc5d[_0x4dbf('0x40')]);}else{_0x18dc5d[_0x4dbf('0x75')]+=_0xebd74d[_0x4dbf('0x9c')];_0x18dc5d[_0x4dbf('0x3e')]=_0x4dbf('0x1fd');for(var _0x30f62a=0x0;_0x30f62a<_0xebd74d[_0x4dbf('0x9c')];_0x30f62a+=0x1){_0x18dc5d['ivrTotalCallsDays']+=0x1;if(_[_0x4dbf('0xb1')](_0xebd74d[_0x30f62a])||_[_0x4dbf('0xb1')](_0xebd74d[_0x30f62a][_0x4dbf('0x16f')])||_[_0x4dbf('0xb1')](_0xebd74d[_0x30f62a][_0x4dbf('0x16f')]['phone'])){_0x4a7560[_0x4dbf('0xd1')](_0x4dbf('0x1fe'),_0x18dc5d,_0xebd74d[_0x30f62a]);}else{_0x4a7560[_0x4dbf('0x1ff')](_[_0x4dbf('0xd4')](_0xebd74d[_0x30f62a],[_0x4dbf('0xd9'),_0x4dbf('0x200')]))[_0x4dbf('0x3c')](_0x4a7560['checkContactBlack'](_0x18dc5d,_0xebd74d[_0x30f62a]))[_0x4dbf('0xb3')](_0x4a7560['loggerHandler'](_0x4dbf('0x201'),_0x18dc5d));}}}})[_0x4dbf('0xb3')](loggerGetContactDialer(_0x4dbf('0x202'),_0x18dc5d,_0xe5e578));}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x159')]=function(_0x122d16,_0x16fa04){var _0x29949d=this;var _0x12a7f7=[];var _0x4824b2=_0x16fa04>=0x1?_0x16fa04:0x1;if(_0x122d16[_0x4dbf('0x5a')]==='booked'){_0x4824b2=0x1;}var _0x178ef9=Math[_0x4dbf('0x1ca')](_0x122d16[_0x4dbf('0x51')]*_0x4824b2)-_0x122d16['originated']-_0x122d16[_0x4dbf('0xc6')];emitVoiceQueueSummary(_0x122d16);if(_0x122d16[_0x4dbf('0x203')]>0x0){var _0x390608=_0x122d16[_0x4dbf('0x203')]-_0x122d16[_0x4dbf('0x75')]-_0x122d16['talking']-_0x122d16[_0x4dbf('0xc6')]-_0x122d16['pTalking'];if(_0x178ef9>_0x390608){_0x178ef9=_0x390608;}}if(_0x178ef9>0x0){if(_0x122d16['dialMethod']===_0x4dbf('0xa')){_0x178ef9=0x1;}if(_0x178ef9>this[_0x4dbf('0x23')]){_0x178ef9=this[_0x4dbf('0x23')];}_0x122d16[_0x4dbf('0xc6')]+=_0x178ef9;for(var _0x4bd8b6 in this[_0x4dbf('0x21')]){if(typeof this['agents'][_0x4bd8b6]!==_0x4dbf('0xaf')){if(this[_0x4dbf('0x21')][_0x4bd8b6][_0x4dbf('0xa9')]===_0x4dbf('0x204')&&this[_0x4dbf('0x21')][_0x4bd8b6][_0x4dbf('0xde')]===_0x4dbf('0xdf')){_0x12a7f7[_0x4dbf('0x12b')](this[_0x4dbf('0x21')][_0x4bd8b6]['id']);}}}this[_0x4dbf('0xc5')](_0x122d16['id'],_0x12a7f7,_0x178ef9,_0x122d16[_0x4dbf('0x1fa')],_0x122d16)[_0x4dbf('0x3c')](function(_0xaaad81){_0x122d16['temp']-=_0x178ef9;_0x122d16[_0x4dbf('0xc6')]=_0x122d16[_0x4dbf('0xc6')]>0x0?_0x122d16[_0x4dbf('0xc6')]:0x0;if(!checkContactEmpty(_0xaaad81)){_0x29949d[_0x4dbf('0xb9')](_0x122d16)[_0x4dbf('0x3c')](sendMessageReschedule(_0x122d16))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xba')));}else{_0x122d16[_0x4dbf('0x75')]+=_0xaaad81[_0x4dbf('0x9c')];_0x122d16[_0x4dbf('0x3e')]=_0x122d16[_0x4dbf('0x5a')]===_0x4dbf('0xa')?'ACTIVE':_0x4dbf('0x1fd');for(var _0x30c6b5=0x0;_0x30c6b5<_0xaaad81[_0x4dbf('0x9c')];_0x30c6b5+=0x1){if(_[_0x4dbf('0xb1')](_0xaaad81[_0x30c6b5])||_[_0x4dbf('0xb1')](_0xaaad81[_0x30c6b5][_0x4dbf('0x16f')])||_[_0x4dbf('0xb1')](_0xaaad81[_0x30c6b5][_0x4dbf('0x16f')][_0x4dbf('0x170')])){_0x29949d[_0x4dbf('0xd1')](_0x4dbf('0x1fe'),_0x122d16,_0xaaad81[_0x30c6b5]);}else{_0x29949d[_0x4dbf('0xbc')](_[_0x4dbf('0xd4')](_0xaaad81[_0x30c6b5],[_0x4dbf('0xd8'),'Contact.phone']))[_0x4dbf('0x3c')](_0x29949d[_0x4dbf('0x1e9')](_0x122d16,_0xaaad81[_0x30c6b5]))[_0x4dbf('0xb3')](_0x29949d[_0x4dbf('0x205')]('[actionOriginate]\x20',_0x122d16));}}}})[_0x4dbf('0xb3')](loggerGetContactDialer(_0x4dbf('0x206'),_0x122d16,_0x178ef9));}};Dialer['prototype'][_0x4dbf('0x94')]=function(_0x44bec9){if(_0x44bec9[_0x4dbf('0x203')]>0x0){var _0x1d80fe=_0x44bec9[_0x4dbf('0x203')]-_0x44bec9[_0x4dbf('0x75')]-_0x44bec9[_0x4dbf('0x55')];if(_0x1d80fe>0x0){this[_0x4dbf('0x207')](_0x44bec9);}else{loggerPredictiveCalls[_0x4dbf('0x80')](_0x4dbf('0x208'));}}else{this[_0x4dbf('0x207')](_0x44bec9);}};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x207')]=function(_0x1c0371){var _0x4b9036=this;var _0xf1a6a4=[];_0x1c0371[_0x4dbf('0x75')]+=0x1;for(var _0x2d01b4 in this[_0x4dbf('0x21')]){if(typeof this[_0x4dbf('0x21')][_0x2d01b4]!==_0x4dbf('0xaf')){if(this[_0x4dbf('0x21')][_0x2d01b4][_0x4dbf('0xa9')]===_0x4dbf('0x204')&&this[_0x4dbf('0x21')][_0x2d01b4][_0x4dbf('0xde')]==='reachable'){_0xf1a6a4[_0x4dbf('0x12b')](this[_0x4dbf('0x21')][_0x2d01b4]['id']);}}}this['getContactDialer'](_0x1c0371['id'],_0xf1a6a4,0x1,_0x1c0371[_0x4dbf('0x1fa')],_0x1c0371)[_0x4dbf('0x3c')](function(_0x30e375){if(!checkContactEmpty(_0x30e375)){checkContactLowerLimitOriginate(_0x1c0371,0x1,0x0);_0x4b9036['countReScheduled'](_0x1c0371)[_0x4dbf('0x3c')](sendMessageReschedule(_0x1c0371))[_0x4dbf('0xb3')](loggerCatch(_0x4dbf('0xba')));}else{_0x1c0371[_0x4dbf('0x3e')]='RUNNING';if(_[_0x4dbf('0xb1')](_0x30e375[0x0])||_['isNil'](_0x30e375[0x0][_0x4dbf('0x16f')])||_[_0x4dbf('0xb1')](_0x30e375[0x0][_0x4dbf('0x16f')][_0x4dbf('0x170')])){_0x4b9036[_0x4dbf('0xd1')]('[actionOriginate]\x20',_0x1c0371,_0x30e375[0x0]);}else{_0x4b9036[_0x4dbf('0xbc')](_[_0x4dbf('0xd4')](_0x30e375[0x0],[_0x4dbf('0xd8'),_0x4dbf('0x200')]))[_0x4dbf('0x3c')](_0x4b9036[_0x4dbf('0x1e9')](_0x1c0371,_0x30e375[0x0]))['catch'](_0x4b9036['loggerHandler'](_0x4dbf('0x209'),_0x1c0371));}}})[_0x4dbf('0xb3')](loggerGetContactDialer(_0x4dbf('0x20a'),_0x1c0371,0x1));emitVoiceQueueSummary(_0x1c0371);};Dialer[_0x4dbf('0x1a')][_0x4dbf('0x1e2')]=function(_0x106b76,_0x5a8250,_0x167b47,_0x173366,_0x5452e0,_0x3c82d6){loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x20b'));loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x20c'),_0x106b76);loggerPredictive[_0x4dbf('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a8250);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x20d'),_0x167b47);loggerPredictive['info'](_0x4dbf('0x20e'),_0x173366);loggerPredictive['info'](_0x4dbf('0x20f'),_0x5452e0);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x88'));return new BPromise(function(_0x249f97,_0x56fadb){if(_0x106b76<=0x0||isNaN(_0x106b76)){return _0x56fadb(msgResponse(_0x4dbf('0x210'),_0x4dbf('0x49'),_0x4dbf('0x211')+_0x106b76));}if(_0x167b47<=0x0||isNaN(_0x167b47)){return _0x56fadb(msgResponse(_0x4dbf('0x210'),_0x4dbf('0x49'),_0x4dbf('0x212')+_0x167b47));}if(_0x173366<=0x0||isNaN(_0x173366)){return _0x56fadb(msgResponse(_0x4dbf('0x210'),'Error',_0x4dbf('0x213')+_0x173366));}if(_0x5a8250<=0x0||isNaN(_0x5a8250)){return _0x56fadb(msgResponse(_0x4dbf('0x210'),_0x4dbf('0x49'),'interval\x20=\x20'+_0x5a8250));}if(_0x5452e0<=0x0||isNaN(_0x5452e0)){return _0x56fadb(msgResponse(_0x4dbf('0x210'),_0x4dbf('0x49'),_0x4dbf('0x214')+_0x5452e0));}_0x3c82d6=_0x3c82d6||0x0;var _0x41d1fb=0x1/_0x167b47;var _0x207b3e=0x0;var _0x463b44=0x0;var _0x351c4e=0x0;var _0xe413e9=0x0;for(var _0x5a9421=0x0;_0x351c4e<_0x5452e0;_0x5a9421+=0x1){_0x463b44=_0x5a9421/_0x5a8250;_0x207b3e=(_0x173366*_0x463b44+_0x3c82d6)/_0x41d1fb;_0x351c4e=erlangb(_0x207b3e,_0x106b76);_0xe413e9=_0x207b3e/_0x106b76*(0x1-erlangb(_0x207b3e,_0x106b76));}return _0x249f97({'erlangCalls':_0x5a9421,'erlangCallToSecond':_0x5a8250/_0x5a9421,'erlangAbandonmentRate':_0x351c4e,'erlangBusyFactor':_0xe413e9});});};Dialer['prototype'][_0x4dbf('0x1e3')]=function(_0x597d9c,_0x255548,_0x1299d1,_0x45d4df,_0x48a82a,_0x569348){loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x215'));loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x20c'),_0x597d9c);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x216'),_0x255548);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x20d'),_0x1299d1);loggerPredictive[_0x4dbf('0x80')]('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',_0x45d4df);loggerPredictive[_0x4dbf('0x80')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48a82a);loggerPredictive[_0x4dbf('0x80')](_0x4dbf('0x88'));return new BPromise(function(_0x288c38,_0x5db19a){if(_0x597d9c<=0x0||isNaN(_0x597d9c)){return _0x5db19a(msgResponse(_0x4dbf('0x217'),_0x4dbf('0x49'),_0x4dbf('0x211')+_0x597d9c));}if(_0x1299d1<=0x0||isNaN(_0x1299d1)){return _0x5db19a(msgResponse(_0x4dbf('0x217'),'Error',_0x4dbf('0x212')+_0x1299d1));}if(_0x45d4df<=0x0||isNaN(_0x45d4df)){return _0x5db19a(msgResponse(_0x4dbf('0x217'),_0x4dbf('0x49'),_0x4dbf('0x213')+_0x45d4df));}if(_0x255548<=0x0||isNaN(_0x255548)){return _0x5db19a(msgResponse(_0x4dbf('0x217'),_0x4dbf('0x49'),_0x4dbf('0x218')+_0x255548));}if(_0x48a82a<=0x0||isNaN(_0x48a82a)){return _0x5db19a(msgResponse('[busyFactor]',_0x4dbf('0x49'),_0x4dbf('0x219')+_0x48a82a));}_0x569348=_0x569348||0x0;var _0x27f105=0x1/_0x1299d1;var _0x18d66d=0x0;var _0x2f0c6d=0x0;var _0x51b31a=0x0;var _0x45f59d=0x0;for(var _0x42a84b=0x0;_0x45f59d<_0x48a82a;_0x42a84b+=0x1){_0x2f0c6d=_0x42a84b/_0x255548;_0x18d66d=(_0x45d4df*_0x2f0c6d+_0x569348)/_0x27f105;_0x51b31a=erlangb(_0x18d66d,_0x597d9c);_0x45f59d=_0x18d66d/_0x597d9c*(0x1-erlangb(_0x18d66d,_0x597d9c));}return _0x288c38({'erlangCalls':_0x42a84b,'erlangCallToSecond':_0x255548/_0x42a84b,'erlangAbandonmentRate':_0x51b31a,'erlangBusyFactor':_0x45f59d});});};module[_0x4dbf('0x21a')]=Dialer; \ No newline at end of file +var _0xfdd1=['channel','strategy','actionid','locked','paused','stateinterface','queueBooked','push','pick','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','idHopper','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:%s','launchHandleIvr','dialMethod','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalHitRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\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','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','sumBillable','sumHoldTime','talking','unmanaged','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','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\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','startPredictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','stack','error','length','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','inspect','[getContactDialer2][ReScheduled]','contactsRescheduled','sendMessageOneNotActive','pTalking','available','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','starttime','uniqueId','[uniqueid]','[actions]','clearZombieChannels','enqueue','isNil','Action','status','catch','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','HangupInAMD','AMD','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','membername','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countbusyretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineRetryFrequency','CampaignId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AGI','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','endtime','[syncAgentComplete][createHistory][11]'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xfdd1,0xf9));var _0x1fdd=function(_0x3c0c9e,_0x3ecdee){_0x3c0c9e=_0x3c0c9e-0x0;var _0x5ba5fe=_0xfdd1[_0x3c0c9e];return _0x5ba5fe;};'use strict';var util=require(_0x1fdd('0x0'));var _=require(_0x1fdd('0x1'));var BPromise=require(_0x1fdd('0x2'));var uuid=require(_0x1fdd('0x3'));var moment=require(_0x1fdd('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x1fdd('0x5'));var ut=require(_0x1fdd('0x6'));var config=require(_0x1fdd('0x7'));var logger=require('../../../config/logger')(_0x1fdd('0x8'));var loggerBooked=require(_0x1fdd('0x9'))(_0x1fdd('0xa'));var loggerPredictive=require(_0x1fdd('0x9'))(_0x1fdd('0xb'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x1fdd('0x9'))('syncQueueSummary');var ami=require('../ami');config[_0x1fdd('0xc')]=_[_0x1fdd('0xd')](config[_0x1fdd('0xc')],{'host':_0x1fdd('0xe'),'port':0x18eb});var io=require(_0x1fdd('0xf'))(new Redis(config[_0x1fdd('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x1fdd('0x10'));var cmHopperBlack=require(_0x1fdd('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x1fdd('0x12'));var Action=require(_0x1fdd('0x13'));var History=require(_0x1fdd('0x14'));var Final=require(_0x1fdd('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x1fdd('0x16'));var Hangup=require(_0x1fdd('0x17'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x1fdd('0x18');var strategy={'rrmemory':_0x1fdd('0x19'),'roundrobin':_0x1fdd('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1fdd('0x1b')]['enqueue']=function(_0x44c274){this[_0x1fdd('0x1c')]=this['tail']?this[_0x1fdd('0x1c')][_0x1fdd('0x1d')](_0x44c274):_0x44c274();};function Dialer(_0x39b45f,_0x5a8ecb){this[_0x1fdd('0x1e')]=new Sequence();this[_0x1fdd('0x1f')]=_0x5a8ecb;this[_0x1fdd('0x20')]=_0x39b45f[_0x1fdd('0x20')];this[_0x1fdd('0x21')]=_0x39b45f[_0x1fdd('0x21')];this[_0x1fdd('0x22')]=_0x39b45f['agents'];this[_0x1fdd('0x23')]=_0x39b45f[_0x1fdd('0x23')];this[_0x1fdd('0x24')]=config[_0x1fdd('0x24')]||0x2;this[_0x1fdd('0x25')]={};this[_0x1fdd('0x26')]={};this[_0x1fdd('0x27')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x1fdd('0x28')]={};this[_0x1fdd('0x29')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x1fdd('0x2a'),this[_0x1fdd('0x2b')][_0x1fdd('0x2c')](this));ami['on']('queuecallerabandon',this[_0x1fdd('0x2d')]['bind'](this));ami['on'](_0x1fdd('0x2e'),this[_0x1fdd('0x2f')]['bind'](this));ami['on'](_0x1fdd('0x30'),this['syncAgentComplete'][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x31'),this[_0x1fdd('0x32')][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x33'),this['syncHangup'][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x34'),this[_0x1fdd('0x35')][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x36'),this[_0x1fdd('0x37')][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x38'),this[_0x1fdd('0x39')][_0x1fdd('0x2c')](this));ami['on'](_0x1fdd('0x3a'),this['syncQueueStatusComplete'][_0x1fdd('0x2c')](this));this[_0x1fdd('0x3b')]();this[_0x1fdd('0x3c')]();RpcSetting[_0x1fdd('0x3d')]()[_0x1fdd('0x3e')](function(_0x185180){previewRecallmeReminderInterval=_0x185180['previewRecallmeReminderInterval'];});}function isNotNull(_0x32c369){return _0x32c369!==null&&!_[_0x1fdd('0x3f')](_0x32c369);}function checkIsLoggedIn(_0x394304,_0x551380){return function(){if(_0x551380<=0x0){_0x394304[_0x1fdd('0x40')]=_0x1fdd('0x41');throw _0x394304[_0x1fdd('0x42')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3a37d2){return _0x3a37d2;}function checkIsActive(_0x3fcf59,_0x108cbb){return function(){if(!isActive(_0x108cbb)){_0x3fcf59[_0x1fdd('0x40')]=_0x1fdd('0x43');throw _0x3fcf59['name']+_0x1fdd('0x44');}};}function checkInterval(_0x58b1ed){return function(){if(!isNotNull(_0x58b1ed[_0x1fdd('0x45')])){_0x58b1ed[_0x1fdd('0x40')]=_0x1fdd('0x46');throw _0x58b1ed[_0x1fdd('0x42')]+_0x1fdd('0x47');}if(!isNotNull(_0x58b1ed[_0x1fdd('0x45')][_0x1fdd('0x48')])){_0x58b1ed['message']=_0x1fdd('0x46');throw _0x58b1ed[_0x1fdd('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x1fdd('0x49')](_0x58b1ed['Interval'][_0x1fdd('0x48')]))){_0x58b1ed[_0x1fdd('0x40')]=_0x1fdd('0x46');throw _0x58b1ed['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x289c10,_0x49a7e3,_0x5584f7){return{'action':_0x289c10,'response':_0x49a7e3,'message':_0x5584f7,'stack':_0x5584f7};}function myreject(_0x643721){return function(_0x231ade){return _0x643721(msgResponse(_0x1fdd('0x4a'),_0x1fdd('0x4b'),JSON['stringify'](_0x231ade)));};}function getSeconds(_0x5d5c42,_0x47280c){var _0x5611db=moment(_0x5d5c42)[_0x1fdd('0x4c')](0x0);var _0x39f94c=moment(_0x47280c)[_0x1fdd('0x4c')](0x0);return _0x5611db[_0x1fdd('0x4d')](_0x39f94c,_0x1fdd('0x4e'));}function emit(_0x571edb,_0x3be949,_0x18ea8d){io['to'](_0x571edb)[_0x1fdd('0x4f')](_0x3be949,_0x18ea8d);}function emitVoiceQueueSummary(_0x4561db){if(_0x4561db[_0x1fdd('0x50')]===_0x1fdd('0x51')){var _0x450618={'id':_0x4561db['id'],'name':_0x4561db[_0x1fdd('0x42')],'strategy':_0x4561db['strategy'],'answered':_0x4561db['answered'],'available':_0x4561db['available'],'loggedIn':_0x4561db['loggedIn'],'pTalking':_0x4561db['pTalking'],'sumBillable':_0x4561db[_0x1fdd('0x52')],'sumDuration':_0x4561db['sumDuration'],'sumHoldTime':_0x4561db[_0x1fdd('0x53')]||0x0,'talking':_0x4561db[_0x1fdd('0x54')],'total':_0x4561db['total'],'type':_0x4561db[_0x1fdd('0x50')],'unmanaged':_0x4561db[_0x1fdd('0x55')],'abandoned':_0x4561db['abandoned'],'waiting':_0x4561db[_0x1fdd('0x56')],'loggedInDb':_0x4561db['loggedInDb'],'dialActive':_0x4561db[_0x1fdd('0x57')],'dialMethod':_0x4561db['dialMethod'],'dialOriginateCallerIdName':_0x4561db[_0x1fdd('0x58')],'dialOriginateCallerIdNumber':_0x4561db[_0x1fdd('0x59')],'dialOriginateTimeout':_0x4561db[_0x1fdd('0x5a')],'dialPrefix':_0x4561db['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4561db['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4561db[_0x1fdd('0x5b')],'outboundBlacklistCallsDay':_0x4561db[_0x1fdd('0x5c')],'outboundBusyCallsDay':_0x4561db[_0x1fdd('0x5d')],'outboundCongestionCallsDay':_0x4561db[_0x1fdd('0x5e')],'outboundDropCallsDayACS':_0x4561db['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4561db[_0x1fdd('0x5f')],'outboundDropCallsDayTimeout':_0x4561db[_0x1fdd('0x60')],'outboundNoAnswerCallsDay':_0x4561db[_0x1fdd('0x61')],'outboundNoSuchCallsDay':_0x4561db[_0x1fdd('0x62')],'outboundOriginateFailureCallsDay':_0x4561db[_0x1fdd('0x63')],'outboundReCallsDay':_0x4561db['outboundReCallsDay'],'outboundRejectCallsDay':_0x4561db[_0x1fdd('0x64')],'outboundUnknownCallsDay':_0x4561db[_0x1fdd('0x65')],'predictiveIntervalAnsweredCalls':_0x4561db['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4561db[_0x1fdd('0x66')],'predictiveIntervalAvgTalktime':_0x4561db[_0x1fdd('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x4561db[_0x1fdd('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x4561db[_0x1fdd('0x69')],'predictiveIntervalErlangCalls':_0x4561db[_0x1fdd('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x4561db['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4561db['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4561db[_0x1fdd('0x6b')],'predictiveIntervalPauses':_0x4561db[_0x1fdd('0x6c')],'predictiveIntervalAvailable':_0x4561db[_0x1fdd('0x6d')],'predictiveIntervalTotalCalls':_0x4561db[_0x1fdd('0x6e')],'message':_0x4561db['message'],'originated':_0x4561db['originated'],'erlangCalls':_0x4561db['erlangCalls'],'erlangCallToSecond':_0x4561db[_0x1fdd('0x6f')],'erlangAbandonmentRate':_0x4561db[_0x1fdd('0x70')],'erlangBusyFactor':_0x4561db[_0x1fdd('0x71')],'startPredictive':_0x4561db['startPredictive'],'startProgressive':_0x4561db[_0x1fdd('0x28')]};if(_0x4561db[_0x1fdd('0x72')]){_0x450618[_0x1fdd('0x72')]={'id':_0x4561db[_0x1fdd('0x72')]['id'],'name':_0x4561db['Trunk'][_0x1fdd('0x42')],'active':_0x4561db[_0x1fdd('0x72')][_0x1fdd('0x73')],'callerid':_0x4561db[_0x1fdd('0x72')][_0x1fdd('0x74')]};}if(_0x4561db[_0x1fdd('0x45')]){_0x450618[_0x1fdd('0x45')]={'id':_0x4561db[_0x1fdd('0x45')]['id'],'name':_0x4561db[_0x1fdd('0x45')][_0x1fdd('0x42')]};}var _0x52b353=md5(JSON[_0x1fdd('0x75')](_0x450618));if(_0x4561db[_0x1fdd('0x76')]!==_0x52b353){_0x4561db[_0x1fdd('0x76')]=_0x52b353;emit(util[_0x1fdd('0x77')](_0x1fdd('0x78'),_0x450618['name']),_0x1fdd('0x79'),_0x450618);}}}function emitCampaignSummary(_0x1a0c13){if(_0x1a0c13[_0x1fdd('0x50')]===_0x1fdd('0x7a')){emit(util[_0x1fdd('0x77')](_0x1fdd('0x7b'),_0x1a0c13[_0x1fdd('0x42')]),_0x1fdd('0x7c'),_0x1a0c13);}}function checkGetDataPredictive(_0x5817b3){if(isNotNull(_0x5817b3)&&!_['isEmpty'](_0x5817b3)){loggerPredictive[_0x1fdd('0x7d')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x1fdd('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5817b3[_0x1fdd('0x6e')]);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x7e'),_0x5817b3['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x7f'),_0x5817b3['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x80'),_0x5817b3[_0x1fdd('0x68')]);loggerPredictive[_0x1fdd('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5817b3[_0x1fdd('0x66')]);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x81'),_0x5817b3[_0x1fdd('0x67')]);loggerPredictive['info'](_0x1fdd('0x82'));if(_0x5817b3['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1fdd('0x3f')](_0x5817b3[_0x1fdd('0x67')])&&_0x5817b3[_0x1fdd('0x67')]>0x0){return!![];}loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x83'));if(!_[_0x1fdd('0x3f')](_0x5817b3['predictiveIntervalAvgHoldtime'])&&_0x5817b3[_0x1fdd('0x66')]>0x0){return!![];}loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x84'));}else{loggerPredictive[_0x1fdd('0x7d')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x169ac7){return function(_0x3faa04){loggerPredictive[_0x1fdd('0x7d')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x1fdd('0x85'),_0x3faa04[_0x1fdd('0x86')]);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x87'),_0x3faa04['erlangCallToSecond']);loggerPredictive['info'](_0x1fdd('0x88'),_0x3faa04[_0x1fdd('0x70')]);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x89'),_0x3faa04[_0x1fdd('0x71')]);loggerPredictive['info'](_0x1fdd('0x88'),_0x3faa04[_0x1fdd('0x70')]);loggerPredictive[_0x1fdd('0x7d')]('---------------------------');_[_0x1fdd('0x8a')](_0x169ac7,_0x3faa04);};}function getDiff(_0x436a90){var _0x5d76c0=moment()[_0x1fdd('0x4c')](0x0);var _0x289446=moment(_0x436a90)['milliseconds'](0x0);return _0x5d76c0['diff'](_0x289446,'seconds');}function ifInterval(_0x41bb9a,_0x18503f){if(_[_0x1fdd('0x3f')](_0x18503f)){return![];}return getDiff(_0x18503f)<_0x41bb9a*0x3c;}function freeVariablesPredictive(_0x391a20){if(isNotNull(_0x391a20)){if(!_['isUndefined'](_0x391a20[_0x1fdd('0x28')])){_0x391a20[_0x1fdd('0x28')]=undefined;loggerPredictive[_0x1fdd('0x7d')](_0x391a20['name'],_0x1fdd('0x8b'));}if(!_['isUndefined'](_0x391a20['startPredictive'])){_0x391a20[_0x1fdd('0x8c')]=undefined;loggerPredictive[_0x1fdd('0x7d')](_0x391a20[_0x1fdd('0x42')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x1fdd('0x3f')](_0x391a20[_0x1fdd('0x8d')])){clearInterval(_0x391a20[_0x1fdd('0x8d')]);_0x391a20['handlePredictive']=undefined;loggerPredictive[_0x1fdd('0x7d')](_0x391a20[_0x1fdd('0x42')],_0x1fdd('0x8e'));}}}function erlangb(_0x281f99,_0x1eed78){if(_0x1eed78===0x0){return 0x0;}var _0x1fd2cf=0x1;for(var _0x5696cd=0x1;_0x5696cd<=_0x1eed78;_0x5696cd+=0x1){_0x1fd2cf=0x1+_0x1fd2cf*_0x5696cd/_0x281f99;}return 0x1/_0x1fd2cf;}function isVoiceQueueOutbound(_0x3403b2){return _0x3403b2===_0x1fdd('0x51');}function isNotPreview(_0x4f2f92){return _0x4f2f92!==_0x1fdd('0x1f');}function isCampaignIvr(_0x5b4a0c){return _0x5b4a0c==='ivr';}function getCallerId(_0x246478,_0x210990,_0x22c3dc){if(!_['isUndefined'](_0x22c3dc)&&typeof _0x22c3dc===_0x1fdd('0x8f')&&!_[_0x1fdd('0x49')](_0x22c3dc)){if(!_[_0x1fdd('0x3f')](_0x210990)&&typeof _0x210990==='string'&&!_[_0x1fdd('0x49')](_0x210990)){return util[_0x1fdd('0x77')](_0x1fdd('0x90'),_0x210990,_0x22c3dc);}return util[_0x1fdd('0x77')](_0x1fdd('0x90'),_0x22c3dc,_0x22c3dc);}if(!_[_0x1fdd('0x3f')](_0x246478)&&typeof _0x246478===_0x1fdd('0x8f')&&!_[_0x1fdd('0x49')](_0x246478)){return _0x246478;}return _0x1fdd('0x91');}function loggerCatchQueueSummary(_0x25a935,_0x1ff207){return function(_0x4fdb45){freeVariablesPredictive(_0x1ff207);emitVoiceQueueSummary(_0x1ff207);emitCampaignSummary(_0x1ff207);loggerSyncQueueSummary['error'](_0x25a935,util['inspect'](_0x4fdb45,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5a3724,_0x6ea109){return function(_0x154143){loggerPredictive['error'](_0x6ea109['name'],_0x5a3724);loggerPredictive['error'](_0x154143[_0x1fdd('0x92')]);freeVariablesPredictive(_0x6ea109);};}function loggerCatch(_0x495c93){return function(_0x68870b){logger[_0x1fdd('0x93')](_0x495c93,util['inspect'](_0x68870b,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5c7e3d){return _0x5c7e3d&&!_['isUndefined'](_0x5c7e3d)&&_0x5c7e3d[_0x1fdd('0x94')]>0x0;}function decremetOriginate(_0x15b830){if(!_[_0x1fdd('0x3f')](_0x15b830)&&_0x15b830!==null){if(typeof _0x15b830[_0x1fdd('0x95')]!=='undefined'){if(_0x15b830['originated']>0x0){_0x15b830[_0x1fdd('0x95')]-=0x1;}else{logger[_0x1fdd('0x93')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1fdd('0x93')](_0x1fdd('0x96'));}}function checkContactLowerLimitOriginate(_0x26b8a5,_0x1dbdca,_0x39bd1c){if(_0x1dbdca>_0x39bd1c){for(var _0x17fa0c=0x0;_0x17fa0c<_0x1dbdca-_0x39bd1c;_0x17fa0c+=0x1){decremetOriginate(_0x26b8a5);}}}function loggerGetContactDialer(_0x3223bc,_0x46c7fd,_0x620f8a){return function(_0x265e70){checkContactLowerLimitOriginate(_0x46c7fd,_0x620f8a,0x0);logger['error'](_0x3223bc,util[_0x1fdd('0x97')](_0x265e70,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xe5adda){return function(_0x3ac879){if(isNotNull(_0x3ac879)&&isNotNull(_0x3ac879[0x0])){if(_0x3ac879[0x0]['contactsRescheduled']>0x0){_0xe5adda[_0x1fdd('0x40')]='RESCHEDULED_CONTACTS';logger[_0x1fdd('0x7d')](_0x1fdd('0x98')+_0xe5adda[_0x1fdd('0x42')],_0x3ac879[0x0][_0x1fdd('0x99')],'contacts');}else{_0xe5adda['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x1fdd('0x7d')]('[getContactDialer2][Empty]'+_0xe5adda[_0x1fdd('0x42')]);}}};}function notSendMessagesQueue(_0x1e1d99){if(_0x1e1d99[_0x1fdd('0x9a')]){freeVariablesPredictive(_0x1e1d99);if(_0x1e1d99[_0x1fdd('0x95')]===0x0&&_0x1e1d99['talking']===0x0&&_0x1e1d99[_0x1fdd('0x56')]===0x0&&(_0x1e1d99[_0x1fdd('0x9b')]||0x0)===0x0){_0x1e1d99[_0x1fdd('0x9a')]=![];_0x1e1d99[_0x1fdd('0x9c')]=0x0;_0x1e1d99[_0x1fdd('0x40')]=_0x1fdd('0x43');loggerSyncQueueSummary[_0x1fdd('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1e1d99[_0x1fdd('0x42')],'is\x20not\x20active');}else{_0x1e1d99['message']=_0x1fdd('0x9d');loggerSyncQueueSummary[_0x1fdd('0x93')](_0x1fdd('0x9e'),_0x1e1d99[_0x1fdd('0x42')],_0x1fdd('0x9f'));}emitVoiceQueueSummary(_0x1e1d99);}}function notSendMessagesCampaign(_0x3cbd4a){if(_0x3cbd4a[_0x1fdd('0x9a')]){if(_0x3cbd4a[_0x1fdd('0x95')]===0x0){_0x3cbd4a[_0x1fdd('0x9a')]=![];_0x3cbd4a['message']=_0x1fdd('0x43');loggerSyncQueueSummary[_0x1fdd('0x93')](_0x1fdd('0xa0'),_0x3cbd4a[_0x1fdd('0x42')],_0x1fdd('0xa1'));}else{_0x3cbd4a[_0x1fdd('0x40')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x1fdd('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3cbd4a[_0x1fdd('0x42')],_0x1fdd('0x9f'));}emitCampaignSummary(_0x3cbd4a);}}function createObjHistory(_0xf13be,_0x47ac99,_0x51e5d1,_0x571c8b,_0x123395){_0xf13be[_0x1fdd('0x40')]=_0x51e5d1;var _0x26bcf6=new Action(_0xf13be,_0x47ac99);var _0x3c8130=new History(_0x26bcf6);_0x3c8130[_0x1fdd('0xa2')]=_0x571c8b;_0x3c8130[_0x1fdd('0xa3')]=_0x123395;_0x3c8130['endtime']=_0x26bcf6[_0x1fdd('0xa4')];return _0x3c8130;}Dialer[_0x1fdd('0x1b')][_0x1fdd('0x3c')]=function(){var _0x1f4f65=this;setInterval(function(){_0x1f4f65['clearZombieChannels'](_0x1f4f65[_0x1fdd('0xa5')],_0x1fdd('0xa6'));_0x1f4f65['clearZombieChannels'](_0x1f4f65[_0x1fdd('0x26')],_0x1fdd('0xa7'));},0x32c8);};Dialer['prototype'][_0x1fdd('0xa8')]=function(_0x55b465,_0x44fd63){var _0x6b8bc3=this;for(var _0x499792 in _0x55b465){if(typeof _0x55b465[_0x499792]!=='undefined'){this['sequence'][_0x1fdd('0xa9')](function(){if(!_[_0x1fdd('0xaa')](_0x55b465[_0x499792])){return ami[_0x1fdd('0xab')]({'action':_0x1fdd('0xac'),'channel':_0x55b465[_0x499792]['channel']})[_0x1fdd('0xad')](function(_0x3c60d6){if(_0x3c60d6[_0x1fdd('0x40')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x55b465[_0x499792]&&_0x55b465[_0x499792][_0x1fdd('0x50')]!==_0x1fdd('0x7a')){_0x6b8bc3[_0x1fdd('0xae')](_0x6b8bc3[_0x1fdd('0x20')][_0x55b465[_0x499792]['queue']]);logger[_0x1fdd('0x93')](_0x1fdd('0xaf'),_0x44fd63,_0x499792,_0x55b465[_0x499792][_0x1fdd('0xb0')]);delete _0x55b465[_0x499792];}if(_0x55b465[_0x499792]&&_0x55b465[_0x499792]['type']===_0x1fdd('0x7a')){_0x6b8bc3[_0x1fdd('0xae')](_0x6b8bc3[_0x1fdd('0x21')][_0x55b465[_0x499792][_0x1fdd('0xb0')]]);logger[_0x1fdd('0x93')]('[Dialer][checkChannel][ivr]',_0x44fd63,_0x499792,_0x55b465[_0x499792]['queue']);delete _0x55b465[_0x499792];}},0x2328);}});}});}}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xb1')]=function(_0xb4394a){return BPromise[_0x1fdd('0xb2')]()[_0x1fdd('0x3e')](cmHopper[_0x1fdd('0xb1')](_0xb4394a))['catch'](loggerCatch(_0x1fdd('0xb3')));};Dialer['prototype']['checkIsBlackList']=function(_0x5334bc){return BPromise['resolve']()['then'](cmHopperBlack[_0x1fdd('0xb4')](_0x5334bc))[_0x1fdd('0xad')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xb5')]=function(_0x3d062b){return BPromise[_0x1fdd('0xb2')]()[_0x1fdd('0x3e')](cmHopperBlack['checkIsBlackListIvr'](_0x3d062b))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xb6')));};Dialer['prototype'][_0x1fdd('0xb7')]=function(_0x3a27ab){return BPromise[_0x1fdd('0xb2')]()['then'](cmHopperHistory[_0x1fdd('0xb8')](_0x3a27ab))[_0x1fdd('0xad')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xb9')]=function(_0x29daec){return BPromise[_0x1fdd('0xb2')]()[_0x1fdd('0x3e')](cmHopper['rescheduleContact'](_0x29daec))['catch'](loggerCatch(_0x1fdd('0xba')));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xbb')]=function(_0x50a172,_0x44c633,_0x4cb042){return BPromise['resolve']()[_0x1fdd('0x3e')](cmHopper[_0x1fdd('0xbb')](_0x50a172,_0x44c633,_0x4cb042))[_0x1fdd('0xad')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xbc')]=function(_0x2d54b6,_0x27c18d,_0x477561,_0x330055,_0x4db229){return BPromise[_0x1fdd('0xb2')]()[_0x1fdd('0x3e')](cmHopper[_0x1fdd('0xbc')](_0x2d54b6,_0x27c18d,_0x477561,_0x330055))[_0x1fdd('0xad')](function(_0x1d38df){_0x4db229['temp']-=_0x477561;_0x4db229[_0x1fdd('0xbd')]=_0x4db229[_0x1fdd('0xbd')]>0x0?_0x4db229[_0x1fdd('0xbd')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x1d38df);});};Dialer[_0x1fdd('0x1b')]['getContactDialerIvr']=function(_0x50dcd5,_0x329d49,_0x448102,_0x5bee33){return BPromise[_0x1fdd('0xb2')]()['then'](cmHopper[_0x1fdd('0xbe')](_0x50dcd5,_0x329d49,_0x448102))[_0x1fdd('0xad')](function(_0x196e82){_0x5bee33[_0x1fdd('0xbd')]-=_0x329d49;_0x5bee33[_0x1fdd('0xbd')]=_0x5bee33[_0x1fdd('0xbd')]>0x0?_0x5bee33[_0x1fdd('0xbd')]:0x0;loggerCatch(_0x1fdd('0xbf'))(_0x196e82);});};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xc0')]=function(_0x23288b){return BPromise[_0x1fdd('0xb2')]()[_0x1fdd('0x3e')](voiceQueueRt[_0x1fdd('0xc0')](_0x23288b))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xc1')));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xc2')]=function(_0x1ee13f){return BPromise['resolve']()['then'](cmHopper['moveContactManagedDialer'](_0x1ee13f))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xc3')));};Dialer['prototype'][_0x1fdd('0xc4')]=function(_0xa6a1ef){return BPromise[_0x1fdd('0xb2')]()['then'](cmHopperHistory[_0x1fdd('0xc4')](_0xa6a1ef))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xc5')));};Dialer[_0x1fdd('0x1b')]['updateOriginated']=function(_0x4b0fe8){if(!_[_0x1fdd('0x3f')](_0x4b0fe8)&&_0x4b0fe8!==null){if(typeof _0x4b0fe8['originated']!==_0x1fdd('0xc6')){if(_0x4b0fe8[_0x1fdd('0x95')]>0x0){_0x4b0fe8[_0x1fdd('0x95')]-=0x1;}else{logger[_0x1fdd('0x93')](_0x1fdd('0xc7'));}}}else{logger[_0x1fdd('0x93')](_0x1fdd('0xc8'));}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xc9')]=function(_0x162482,_0x3dc119){var _0x2fcc97=this;return function(_0x45e24f){_0x2fcc97[_0x1fdd('0xae')](_0x3dc119);logger[_0x1fdd('0x93')](_0x162482,util[_0x1fdd('0x97')](_0x45e24f,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x1fdd('0xca')]=function(_0xbd949a,_0x55f492,_0x304081){var _0x5b447d={'state':0x19,'statedesc':_0x1fdd('0xcb')};this['updateOriginated'](_0x55f492);this['saveInDb'](_['merge'](_0x5b447d,_['pick'](_0x304081,[_0x1fdd('0xcc'),_0x1fdd('0xcd'),_0x1fdd('0xce'),_0x1fdd('0xcf'),'CampaignId'])),_0x1fdd('0xd0'),_0x1fdd('0xd1'));logger['error'](_0xbd949a);};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xd2')]=function(_0x2c9fb0){return _0x2c9fb0===_0x1fdd('0xd3');};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xd4')]=function(_0x422743){return!_['isUndefined'](_0x422743)&&_0x422743&&!_[_0x1fdd('0x3f')](_0x422743[_0x1fdd('0x42')])&&!_[_0x1fdd('0x3f')](_0x422743[_0x1fdd('0x73')])&&_0x422743[_0x1fdd('0x73')]&&(this[_0x1fdd('0x23')][util[_0x1fdd('0x77')]('SIP/%s',_0x422743[_0x1fdd('0x42')])]['status']===_0x1fdd('0xd5')||this[_0x1fdd('0x23')][util[_0x1fdd('0x77')](_0x1fdd('0xd6'),_0x422743[_0x1fdd('0x42')])][_0x1fdd('0xac')]==='unmonitored');};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xd7')]=function(_0x2f738a,_0x294179,_0x164067){this[_0x1fdd('0xc4')](_0x2f738a)['catch'](loggerCatch(_0x294179));this[_0x1fdd('0xc2')](_0x2f738a)[_0x1fdd('0xad')](loggerCatch(_0x164067));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x37')]=function(_0x4cf068){var _0x3f2f90=this[_0x1fdd('0xa5')][_0x4cf068[_0x1fdd('0xd8')]];var _0x1e1840;if(!_[_0x1fdd('0xaa')](_0x4cf068)&&!_[_0x1fdd('0xaa')](_0x4cf068[_0x1fdd('0xd9')])&&!_[_0x1fdd('0xaa')](_0x4cf068[_0x1fdd('0xd9')][_0x1fdd('0xda')])&&_0x4cf068[_0x1fdd('0xdb')]===_0x1fdd('0xdc')&&_0x3f2f90){if(_0x3f2f90[_0x1fdd('0x50')]!=='ivr'&&this[_0x1fdd('0x20')][_0x3f2f90[_0x1fdd('0xb0')]]['dialAMDActive']&&_0x4cf068[_0x1fdd('0xdd')]==='HANGUP'){delete this[_0x1fdd('0xa5')][_0x4cf068[_0x1fdd('0xd8')]];this[_0x1fdd('0xae')](this[_0x1fdd('0x20')][_0x3f2f90[_0x1fdd('0xb0')]]);this[_0x1fdd('0x20')][_0x3f2f90['queue']][_0x1fdd('0x5b')]+=0x1;this[_0x1fdd('0x20')][_0x3f2f90[_0x1fdd('0xb0')]][_0x1fdd('0xde')]+=0x1;_0x1e1840=new Hangup(_0x3f2f90,_0x4cf068);_0x1e1840[_0x1fdd('0xa2')]=0x12;_0x1e1840['statedesc']=_0x1fdd('0xdf');_0x1e1840['membername']=_0x1fdd('0xe0');ami[_0x1fdd('0x4f')]('custom:amd',ut['buildObj'](_0x1e1840,_0x1fdd('0xe1')));this[_0x1fdd('0xd7')](_0x1e1840,_0x1fdd('0xe2'),_0x1fdd('0xe3'));}if(_0x3f2f90[_0x1fdd('0x50')]!=='ivr'&&this['voiceQueues'][_0x3f2f90[_0x1fdd('0xb0')]][_0x1fdd('0xe4')]&&_0x4cf068['value']==='MACHINE'){var _0x4a0606=this;return new BPromise(function(_0x2d45d5,_0x2e1688){delete _0x4a0606['uniqueId'][_0x4cf068[_0x1fdd('0xd8')]];_0x4a0606[_0x1fdd('0xae')](_0x4a0606[_0x1fdd('0x20')][_0x3f2f90[_0x1fdd('0xb0')]]);_0x4a0606[_0x1fdd('0x20')][_0x3f2f90['queue']]['outboundAnswerCallsDay']+=0x1;_0x4a0606[_0x1fdd('0x20')][_0x3f2f90['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x19d923=_0x4a0606[_0x1fdd('0x20')][_0x3f2f90['queue']];var _0x48750c=new Hangup(_0x3f2f90,_0x4cf068);_0x48750c[_0x1fdd('0xa2')]=0x13;_0x48750c['statedesc']=_0x1fdd('0xe5');_0x48750c[_0x1fdd('0xe6')]='AMD';_0x48750c[_0x1fdd('0xe7')]+=0x1;_0x48750c['countglobal']+=0x1;_0x48750c[_0x1fdd('0xe1')]=!![];ami[_0x1fdd('0x4f')](_0x1fdd('0xe8'),ut['buildObj'](_0x48750c,_0x1fdd('0xe1')));_0x4a0606[_0x1fdd('0xc4')](_0x48750c)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xe9')));if(_0x48750c['countbusyretry']+_0x48750c[_0x1fdd('0xea')]+_0x48750c[_0x1fdd('0xeb')]+_0x48750c[_0x1fdd('0xec')]+_0x48750c[_0x1fdd('0xed')]+_0x48750c[_0x1fdd('0xee')]+_0x48750c[_0x1fdd('0xe7')]+_0x48750c['countagentrejectretry']>=_0x19d923[_0x1fdd('0xef')]){_0x4a0606['stateGlobal'](_0x48750c,_0x2d45d5,_0x2e1688,'reason19\x20machine....');}else{if(_0x48750c[_0x1fdd('0xe7')]>=_0x19d923[_0x1fdd('0xf0')]){_0x4a0606[_0x1fdd('0xf1')](_0x48750c,_0x2d45d5,_0x2e1688,_0x1fdd('0xf2'));}else{_0x4a0606['rescheduleContact']({'active':![],'countmachineretry':_0x48750c[_0x1fdd('0xe7')],'scheduledat':moment()[_0x1fdd('0xf3')](_0x19d923['dialMachineRetryFrequency'],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x48750c[_0x1fdd('0xcc')],'ListId':_0x48750c[_0x1fdd('0xcd')],'VoiceQueueId':_0x48750c[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x48750c['CampaignId']||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xf6')));_0x2d45d5({'reschedule':0x1});}}});}if(_0x3f2f90[_0x1fdd('0x50')]==='ivr'&&this[_0x1fdd('0x21')][_0x3f2f90[_0x1fdd('0xb0')]]['dialAMDActive']&&_0x4cf068[_0x1fdd('0xdd')]===_0x1fdd('0xf7')){delete this[_0x1fdd('0xa5')][_0x4cf068[_0x1fdd('0xd8')]];this[_0x1fdd('0xae')](this[_0x1fdd('0x21')][_0x3f2f90[_0x1fdd('0xb0')]]);_0x1e1840=new Hangup(_0x3f2f90,_0x4cf068);_0x1e1840[_0x1fdd('0xa2')]=0x12;_0x1e1840[_0x1fdd('0xa3')]=_0x1fdd('0xdf');_0x1e1840[_0x1fdd('0xe6')]=_0x1fdd('0xe0');ami['emit'](_0x1fdd('0xe8'),ut[_0x1fdd('0xf8')](_0x1e1840,_0x1fdd('0xe1')));this[_0x1fdd('0xd7')](_0x1e1840,_0x1fdd('0xf9'),_0x1fdd('0xfa'));}if(_0x3f2f90[_0x1fdd('0x50')]==='ivr'&&this[_0x1fdd('0x21')][_0x3f2f90[_0x1fdd('0xb0')]]['dialAMDActive']&&_0x4cf068[_0x1fdd('0xdd')]==='MACHINE'){var _0x4a0606=this;return new BPromise(function(_0x2f9375,_0x1dfb7f){delete _0x4a0606['uniqueId'][_0x4cf068[_0x1fdd('0xd8')]];_0x4a0606['updateOriginated'](_0x4a0606['campaigns'][_0x3f2f90[_0x1fdd('0xb0')]]);_0x4a0606['campaigns'][_0x3f2f90[_0x1fdd('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x4a0606[_0x1fdd('0x21')][_0x3f2f90['queue']][_0x1fdd('0xde')]+=0x1;var _0x53e800=_0x4a0606['campaigns'][_0x3f2f90[_0x1fdd('0xb0')]];var _0x1ba018=new Hangup(_0x3f2f90,_0x4cf068);_0x1ba018[_0x1fdd('0xa2')]=0x13;_0x1ba018[_0x1fdd('0xa3')]='Machine';_0x1ba018['membername']=_0x1fdd('0xe0');_0x1ba018[_0x1fdd('0xe7')]+=0x1;_0x1ba018[_0x1fdd('0xfb')]+=0x1;_0x1ba018['amd']=!![];ami['emit'](_0x1fdd('0xe8'),ut[_0x1fdd('0xf8')](_0x1ba018,_0x1fdd('0xe1')));_0x4a0606[_0x1fdd('0xc4')](_0x1ba018)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xe9')));if(_0x1ba018[_0x1fdd('0xfc')]+_0x1ba018[_0x1fdd('0xea')]+_0x1ba018[_0x1fdd('0xeb')]+_0x1ba018[_0x1fdd('0xec')]+_0x1ba018[_0x1fdd('0xed')]+_0x1ba018[_0x1fdd('0xee')]+_0x1ba018[_0x1fdd('0xe7')]+_0x1ba018[_0x1fdd('0xfd')]>=_0x53e800['dialGlobalMaxRetry']){_0x4a0606[_0x1fdd('0xfe')](_0x1ba018,_0x2f9375,_0x1dfb7f,_0x1fdd('0xff'));}else{if(_0x1ba018['countmachineretry']>=_0x53e800['dialMachineMaxRetry']){_0x4a0606[_0x1fdd('0xf1')](_0x1ba018,_0x2f9375,_0x1dfb7f,_0x1fdd('0xf2'));}else{_0x4a0606['rescheduleContact']({'active':![],'countmachineretry':_0x1ba018['countmachineretry'],'scheduledat':moment()[_0x1fdd('0xf3')](_0x53e800[_0x1fdd('0x100')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x1ba018[_0x1fdd('0xcc')],'ListId':_0x1ba018['ListId'],'VoiceQueueId':_0x1ba018[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x1ba018[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xf6')));_0x2f9375({'reschedule':0x1});}}});}}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x102')]=function(_0xfc9435){var _0x1c7eca=this['uniqueId'][_0xfc9435['uniqueid']];var _0x4a752e=this;var _0x288b49;if(_0x1c7eca&&_0x1c7eca[_0x1fdd('0x50')]===_0x1fdd('0x7a')){delete this[_0x1fdd('0xa5')][_0xfc9435['uniqueid']];this[_0x1fdd('0xae')](this[_0x1fdd('0x21')][_0x1c7eca[_0x1fdd('0xb0')]]);this[_0x1fdd('0x21')][_0x1c7eca['queue']][_0x1fdd('0x103')]+=0x1;_0x288b49=new Hangup(_0x1c7eca,_0xfc9435);this[_0x1fdd('0xc4')](_0x288b49)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x104')));this[_0x1fdd('0xc2')](_0x288b49)[_0x1fdd('0xad')](loggerCatch('[syncHangupIvr]'));}if(_0x1c7eca&&_0x1c7eca[_0x1fdd('0x50')]!=='ivr'&&isNotNull(this[_0x1fdd('0x20')][_0x1c7eca[_0x1fdd('0xb0')]]['dialQueueProject'])){delete this[_0x1fdd('0xa5')][_0xfc9435[_0x1fdd('0xd8')]];this['updateOriginated'](this[_0x1fdd('0x20')][_0x1c7eca[_0x1fdd('0xb0')]]);this['voiceQueues'][_0x1c7eca[_0x1fdd('0xb0')]][_0x1fdd('0x5b')]+=0x1;this[_0x1fdd('0x20')][_0x1c7eca[_0x1fdd('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x288b49=new Hangup(_0x1c7eca,_0xfc9435);_0x288b49[_0x1fdd('0xa2')]=0x10;_0x288b49[_0x1fdd('0xa3')]='AnswerAGI';_0x288b49[_0x1fdd('0xe6')]=_0x1fdd('0x105');this[_0x1fdd('0xc4')](_0x288b49)[_0x1fdd('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x1fdd('0xc2')](_0x288b49)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x106')));}if(_0x1c7eca&&_0x1c7eca[_0x1fdd('0x50')]!==_0x1fdd('0x7a')&&!isNotNull(this[_0x1fdd('0x20')][_0x1c7eca['queue']][_0x1fdd('0x107')])){delete this[_0x1fdd('0xa5')][_0xfc9435[_0x1fdd('0xd8')]];this[_0x1fdd('0xae')](this[_0x1fdd('0x20')][_0x1c7eca['queue']]);this['voiceQueues'][_0x1c7eca['queue']][_0x1fdd('0x65')]+=0x1;_0x288b49=new Hangup(_0x1c7eca,_0xfc9435);_0x288b49[_0x1fdd('0xa2')]=0xc;_0x288b49[_0x1fdd('0xa3')]=_0xfc9435[_0x1fdd('0x108')];_0x288b49['membername']=_0x1fdd('0x109');this[_0x1fdd('0xc4')](_0x288b49)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x104')));this[_0x1fdd('0xc2')](_0x288b49)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x106')));}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x10a')]=function(_0x3b6332){var _0x9c76e7=this[_0x1fdd('0xa5')][_0x3b6332[_0x1fdd('0xd8')]];var _0x4c93ed=this;if(this[_0x1fdd('0x20')][_0x3b6332[_0x1fdd('0xb0')]]){if(_0x9c76e7&&_0x9c76e7[_0x1fdd('0x50')]!==_0x1fdd('0x7a')){delete this[_0x1fdd('0xa5')][_0x3b6332[_0x1fdd('0xd8')]];this['voiceQueues'][_0x3b6332['queue']]['outboundAnswerCallsDay']+=0x1;var _0x4bdd2b=new AgentComplete(_0x9c76e7,_0x3b6332);if(_0x3b6332[_0x1fdd('0x10b')]==='agent'){_0x4bdd2b[_0x1fdd('0x10c')]=this[_0x1fdd('0x20')][_0x3b6332['queue']]['dialQueueProject2']&&this[_0x1fdd('0x20')][_0x3b6332[_0x1fdd('0xb0')]][_0x1fdd('0x10d')]?moment()[_0x1fdd('0x77')](_0x1fdd('0xf5')):undefined;}this[_0x1fdd('0xc4')](_0x4bdd2b)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x10e')));this['moveContactManagedDialer'](_0x4bdd2b)['catch'](loggerCatch(_0x1fdd('0x10f')));}}};Dialer['prototype'][_0x1fdd('0x2b')]=function(_0x42a402){if(this[_0x1fdd('0x20')][_0x42a402[_0x1fdd('0xb0')]]){if(this[_0x1fdd('0xa5')][_0x42a402['uniqueid']]&&this[_0x1fdd('0xa5')][_0x42a402[_0x1fdd('0xd8')]][_0x1fdd('0x50')]!==_0x1fdd('0x7a')){this[_0x1fdd('0xae')](this['voiceQueues'][_0x42a402[_0x1fdd('0xb0')]]);this[_0x1fdd('0xa5')][_0x42a402[_0x1fdd('0xd8')]][_0x1fdd('0x110')]=moment()[_0x1fdd('0x77')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x1fdd('0x1b')]['queueCallerAbandonCreateState']=function(_0x358184){this[_0x1fdd('0xc4')](_0x358184)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x10e')));this[_0x1fdd('0xc2')](_0x358184)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x111')));};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x2d')]=function(_0x53861b){var _0x4d8ce6=this[_0x1fdd('0xa5')][_0x53861b[_0x1fdd('0xd8')]];var _0x3bc2d9=this;if(this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]]){if(_0x4d8ce6&&_0x4d8ce6[_0x1fdd('0x50')]!==_0x1fdd('0x7a')){delete this['uniqueId'][_0x53861b['uniqueid']];this[_0x1fdd('0xae')](this['voiceQueues'][_0x53861b[_0x1fdd('0xb0')]]);_0x4d8ce6[_0x1fdd('0x112')]=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));var _0x1453d4=new QueueCallerAbandon(_0x4d8ce6,_0x53861b);if(getSeconds(_0x4d8ce6[_0x1fdd('0x112')],_0x4d8ce6[_0x1fdd('0x113')])>=_0x4d8ce6[_0x1fdd('0x114')]){this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x69')]+=0x1;this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x115')]+=0x1;_0x1453d4[_0x1fdd('0xa2')]=0xa;_0x1453d4[_0x1fdd('0xa3')]='Drop';_0x1453d4[_0x1fdd('0x116')]=_0x1fdd('0x117');_0x1453d4[_0x1fdd('0x10c')]=this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x118')]?moment()[_0x1fdd('0x77')](_0x1fdd('0xf5')):undefined;_0x1453d4[_0x1fdd('0xed')]+=0x1;_0x1453d4[_0x1fdd('0xfb')]+=0x1;if(_0x1453d4['countdropretry']>=this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x119')]){this[_0x1fdd('0x11a')](_0x1453d4);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1453d4[_0x1fdd('0xed')],'scheduledat':moment()[_0x1fdd('0xf3')](this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x11b')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4d8ce6[_0x1fdd('0xcc')],'ListId':_0x4d8ce6[_0x1fdd('0xcd')],'VoiceQueueId':_0x4d8ce6['VoiceQueueId']||undefined,'CampaignId':_0x4d8ce6['CampaignId']||undefined})['catch'](loggerCatch(_0x1fdd('0x11c')));var _0x290800=new History(_0x1453d4);_0x290800[_0x1fdd('0xa2')]=0xa;_0x290800[_0x1fdd('0xa3')]=_0x1fdd('0x11d');_0x290800[_0x1fdd('0xa4')]=moment()[_0x1fdd('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x290800['endtime']=_0x290800[_0x1fdd('0xa4')];_0x290800[_0x1fdd('0x11e')]=_0x1453d4['calleridname'];_0x290800['calleridnum']=_0x1453d4[_0x1fdd('0x11f')];this[_0x1fdd('0xc4')](_0x290800)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x120')));}}else{this[_0x1fdd('0x20')][_0x53861b[_0x1fdd('0xb0')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x1fdd('0x20')][_0x53861b['queue']][_0x1fdd('0x5f')]+=0x1;_0x1453d4[_0x1fdd('0xa2')]=0xb;_0x1453d4[_0x1fdd('0xa3')]=_0x1fdd('0x121');_0x1453d4['dropreason']=_0x1fdd('0x122');_0x1453d4['countabandonedretry']+=0x1;_0x1453d4[_0x1fdd('0xfb')]+=0x1;if(_0x1453d4['countabandonedretry']>=this['voiceQueues'][_0x53861b[_0x1fdd('0xb0')]]['dialAbandonedMaxRetry']){this[_0x1fdd('0x11a')](_0x1453d4);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x1453d4[_0x1fdd('0xee')],'scheduledat':moment()[_0x1fdd('0xf3')](this['voiceQueues'][_0x53861b[_0x1fdd('0xb0')]][_0x1fdd('0x123')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4d8ce6['ContactId'],'ListId':_0x4d8ce6['ListId'],'VoiceQueueId':_0x4d8ce6[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x4d8ce6[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x124')));var _0x290800=new History(_0x1453d4);_0x290800[_0x1fdd('0xa2')]=0xb;_0x290800['statedesc']='Abandoned';_0x290800[_0x1fdd('0xa4')]=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));_0x290800[_0x1fdd('0x125')]=_0x290800[_0x1fdd('0xa4')];_0x290800[_0x1fdd('0x11e')]=_0x1453d4[_0x1fdd('0x11e')];_0x290800['calleridnum']=_0x1453d4['calleridnum'];this['createHistory'](_0x290800)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x126')));}}}}};Dialer[_0x1fdd('0x1b')]['syncNewExten']=function(_0x140745){if(this[_0x1fdd('0x26')][_0x140745[_0x1fdd('0xd8')]]){this[_0x1fdd('0x26')][_0x140745[_0x1fdd('0xd8')]][_0x1fdd('0x127')]=_0x140745[_0x1fdd('0x127')];}if(this[_0x1fdd('0xa5')][_0x140745[_0x1fdd('0xd8')]]){this[_0x1fdd('0xa5')][_0x140745[_0x1fdd('0xd8')]][_0x1fdd('0x127')]=_0x140745[_0x1fdd('0x127')];}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x39')]=function(_0x3909a4){if(strategy[this[_0x1fdd('0x20')][this[_0x1fdd('0x26')][_0x3909a4['actionid']]['queue']][_0x1fdd('0x128')]]==='roundrobin'){if(this[_0x1fdd('0x26')][_0x3909a4[_0x1fdd('0x129')]]&&_[_0x1fdd('0xaa')](this['actions'][_0x3909a4[_0x1fdd('0x129')]][_0x1fdd('0x12a')])&&_0x3909a4[_0x1fdd('0xac')]==='1'&&_0x3909a4[_0x1fdd('0x12b')]==='0'){if(this[_0x1fdd('0x22')][_0x3909a4[_0x1fdd('0x12c')]]){if(!this['agents'][_0x3909a4['stateinterface']][_0x1fdd('0x12a')]){this['agents'][_0x3909a4[_0x1fdd('0x12c')]][_0x1fdd('0x12a')]=!![];this['actions'][_0x3909a4['actionid']]['locked']=!![];this[_0x1fdd('0x26')][_0x3909a4[_0x1fdd('0x129')]][_0x1fdd('0x12c')]=_0x3909a4[_0x1fdd('0x12c')];}}}}else if((strategy[this[_0x1fdd('0x20')][this['actions'][_0x3909a4['actionid']][_0x1fdd('0xb0')]][_0x1fdd('0x128')]]||_0x1fdd('0x19'))==='rrmemory'){if(this[_0x1fdd('0x26')][_0x3909a4[_0x1fdd('0x129')]]){if(this[_0x1fdd('0x22')][_0x3909a4[_0x1fdd('0x12c')]]){this[_0x1fdd('0x26')][_0x3909a4['actionid']][_0x1fdd('0x12c')]=_0x3909a4[_0x1fdd('0x12c')];if(_[_0x1fdd('0xaa')](this[_0x1fdd('0x12d')][this[_0x1fdd('0x26')][_0x3909a4['actionid']][_0x1fdd('0xb0')]])){this['queueBooked'][this[_0x1fdd('0x26')][_0x3909a4[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]=[];}this['queueBooked'][this[_0x1fdd('0x26')][_0x3909a4['actionid']][_0x1fdd('0xb0')]][_0x1fdd('0x12e')](_[_0x1fdd('0x8a')](_[_0x1fdd('0x12f')](this['actions'][_0x3909a4[_0x1fdd('0x129')]],['idHopper',_0x1fdd('0x12c')]),{'status':_0x3909a4['status'],'paused':_0x3909a4[_0x1fdd('0x12b')]}));}}}};function unlockQueueStatus(_0x45c0f4,_0x5127c3){setTimeout(function(){if(_['isUndefined'](_0x45c0f4['queueStatusComplete'])){loggerBooked['error'](_0x1fdd('0x130'),_0x5127c3);}_0x45c0f4['queueStatusComplete']=!![];loggerBooked[_0x1fdd('0x7d')](_0x1fdd('0x131'),_0x5127c3,JSON['stringify'](_[_0x1fdd('0x12f')](_0x45c0f4,[_0x1fdd('0x42'),_0x1fdd('0x132')])));},0x1f3);}Dialer[_0x1fdd('0x1b')][_0x1fdd('0x133')]=function(_0x4bee73){var _0x302b93=this;var _0x59791a=_0x302b93[_0x1fdd('0x20')][_0x302b93[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]];if(strategy[this[_0x1fdd('0x20')][this['actions'][_0x4bee73[_0x1fdd('0x129')]]['queue']]['strategy']]===_0x1fdd('0x1a')){if(this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]&&this[_0x1fdd('0x26')][_0x4bee73['actionid']][_0x1fdd('0x12c')]){this[_0x1fdd('0x1f')][_0x1fdd('0x134')](this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0x135')],this['actions'][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0x12c')])[_0x1fdd('0xad')](function(_0x2b92de){logger[_0x1fdd('0x93')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x2b92de,{'showHidden':![],'depth':null}));})['finally'](function(){_0x302b93[_0x1fdd('0xae')](_0x302b93[_0x1fdd('0x20')][_0x302b93[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]['queue']]);_0x302b93[_0x1fdd('0x22')][_0x302b93[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0x12c')]][_0x1fdd('0x12a')]=![];delete _0x302b93[_0x1fdd('0x26')][_0x4bee73['actionid']];unlockQueueStatus(_0x59791a);});}else{this[_0x1fdd('0xae')](this[_0x1fdd('0x20')][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]);this[_0x1fdd('0xb9')]({'active':![],'ContactId':this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xcc')],'ListId':this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xcd')],'VoiceQueueId':this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x136')));delete this['actions'][_0x4bee73[_0x1fdd('0x129')]];unlockQueueStatus(_0x59791a);}}else if((strategy[this[_0x1fdd('0x20')][this['actions'][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]][_0x1fdd('0x128')]]||_0x1fdd('0x19'))==='rrmemory'){var _0x16a051;if(this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]&&!_[_0x1fdd('0x49')](this[_0x1fdd('0x12d')][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]['queue']])){if(this[_0x1fdd('0x137')][_0x302b93['actions'][_0x4bee73[_0x1fdd('0x129')]]['queue']]){this[_0x1fdd('0x137')][_0x302b93['actions'][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]=this['queueBookedRR'][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]?this[_0x1fdd('0x137')][this['actions'][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]:this['queueBooked'][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]][_0x1fdd('0xb0')]]?this['queueBooked'][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]['queue']]['_rr']||0x0:0x0;}this[_0x1fdd('0x12d')][this[_0x1fdd('0x26')][_0x4bee73['actionid']][_0x1fdd('0xb0')]][_0x1fdd('0x138')]=this[_0x1fdd('0x137')][this[_0x1fdd('0x26')][_0x4bee73[_0x1fdd('0x129')]]['queue']];for(var _0x18eab4=0x0;_0x18eab4=0x0;})[_0x1fdd('0xad')](myreject(_0x2885b2)));}}else{_0x2c19c7[_0x1fdd('0x12e')](ami[_0x1fdd('0xab')]({'action':_0x1fdd('0x14f'),'command':util[_0x1fdd('0x77')](_0x1fdd('0x150'),_0x11329a,!_[_0x1fdd('0x3f')](config[_0x1fdd('0x152')][_0x1c7143])?_0x1c7143:'')})[_0x1fdd('0x3e')](function(_0x4c6363){return _0x4c6363[_0x1fdd('0x153')][_0x1fdd('0x154')]('true')>=0x0;})[_0x1fdd('0xad')](myreject(_0x2885b2)));}BPromise[_0x1fdd('0x156')](_0x2c19c7)[_0x1fdd('0x3e')](function(_0xd9acff){var _0x12d912=_[_0x1fdd('0x157')](_0xd9acff);if(_0x12d912){return _0x5e552d(_0x12d912);}else{_0x496f20[_0x1fdd('0x40')]=_0x33a3a8?_0x1fdd('0x158'):'INTERVAL_IS_OVERTIME';return _0x2885b2(msgResponse(_0x1fdd('0x159'),_0x1fdd('0x14a'),_0x1fdd('0x15a')+_0x33a3a8+'\x20'+_0x13a5f8+_0x1fdd('0x15b')+util[_0x1fdd('0x97')](_0x11329a,{'showHidden':![],'depth':null})+_0x1fdd('0x15c')+_0x1c7143));}})['catch'](function(_0x201b2b){return _0x2885b2(msgResponse(_0x1fdd('0x148'),_0x1fdd('0x14a'),JSON['stringify'](_0x201b2b)));});});};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x15d')]=function(_0x43b981){var _0x230808=this;return function(){switch(_0x43b981['dialMethod']){case'progressive':freeVariablesPredictive(_0x43b981);_0x230808[_0x1fdd('0x15e')](_0x43b981,0x1);break;case'power':freeVariablesPredictive(_0x43b981);_0x230808[_0x1fdd('0x15e')](_0x43b981,_0x43b981['dialPowerLevel']);break;case _0x1fdd('0xb'):_0x230808[_0x1fdd('0xb')](_0x43b981);break;case _0x1fdd('0xa'):freeVariablesPredictive(_0x43b981);_0x230808['handlePower'](_0x43b981,0x1);break;default:freeVariablesPredictive(_0x43b981);logger[_0x1fdd('0x93')](_0x1fdd('0x15f'),_0x43b981[_0x1fdd('0x42')],_0x1fdd('0x160'));}};};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x161')]=function(_0x136e75){return BPromise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0x136e75['id'],previewRecallmeReminderInterval))[_0x1fdd('0x3e')](function(_0x4f2744){for(var _0x4177eb=0x0;_0x4177eb<_0x4f2744[_0x1fdd('0x94')];_0x4177eb++){var _0x459582=_0x4f2744[_0x4177eb][_0x1fdd('0x162')][_0x1fdd('0x42')];if(_0x459582)io['to'](util['format'](_0x1fdd('0x163'),_0x459582))[_0x1fdd('0x4f')]('user:dialPreviewRecallReminder',{'hopper':_0x4f2744[_0x4177eb]});}})[_0x1fdd('0xad')](function(_0x2092f5){});};Dialer['prototype'][_0x1fdd('0x164')]=function(_0x5a8c1a){var _0x4c0623=this;return function(){_0x4c0623['handleIvr'](_0x5a8c1a);};};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x32')]=function(_0x66d9d2){var _0x4d56b6=this;if(isNotPreview(_0x66d9d2[_0x1fdd('0x165')])){if(isVoiceQueueOutbound(_0x66d9d2[_0x1fdd('0x50')])&&isActive(_0x66d9d2[_0x1fdd('0x57')])){_0x66d9d2['sendMessageOneNotActive']=!![];BPromise[_0x1fdd('0xb2')]()['then'](checkIsLoggedIn(_0x66d9d2,_0x66d9d2[_0x1fdd('0x166')]))[_0x1fdd('0x3e')](checkIsActive(_0x66d9d2,_0x66d9d2['dialActive']))['then'](checkInterval(_0x66d9d2))[_0x1fdd('0x3e')](_0x4d56b6[_0x1fdd('0x144')](_0x66d9d2))[_0x1fdd('0x3e')](_0x4d56b6[_0x1fdd('0x147')](_0x66d9d2[_0x1fdd('0x167')],_0x66d9d2['dialTimezone'],_0x66d9d2[_0x1fdd('0x42')],_0x66d9d2))['then'](_0x4d56b6[_0x1fdd('0x149')](_0x66d9d2['Interval'],_0x66d9d2[_0x1fdd('0x168')],_0x66d9d2['name'],_0x66d9d2))[_0x1fdd('0x3e')](_0x4d56b6[_0x1fdd('0x15d')](_0x66d9d2))['catch'](loggerCatchQueueSummary(_0x1fdd('0x169'),_0x66d9d2));}else{notSendMessagesQueue(_0x66d9d2);}}else{freeVariablesPredictive(_0x66d9d2);if(_0x66d9d2['dialPreviewRecallmeReminder']){_0x4d56b6[_0x1fdd('0x161')](_0x66d9d2);}}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x143')]=function(){var _0x4fa84a=this;var _0x2c99dc;for(var _0x4aeecb in this['campaigns']){if(typeof this[_0x1fdd('0x21')][_0x4aeecb]!==_0x1fdd('0xc6')){_0x2c99dc=this[_0x1fdd('0x21')][_0x4aeecb];if(isCampaignIvr(_0x2c99dc['type'])&&isActive(_0x2c99dc[_0x1fdd('0x73')])){_0x2c99dc[_0x1fdd('0x9a')]=!![];BPromise[_0x1fdd('0xb2')]()['then'](checkIsActive(_0x2c99dc,_0x2c99dc['active']))[_0x1fdd('0x3e')](checkInterval(_0x2c99dc))[_0x1fdd('0x3e')](_0x4fa84a[_0x1fdd('0x144')](_0x2c99dc))[_0x1fdd('0x3e')](_0x4fa84a[_0x1fdd('0x147')](_0x2c99dc[_0x1fdd('0x167')],_0x2c99dc['dialTimezone'],_0x2c99dc[_0x1fdd('0x42')],_0x2c99dc))['then'](_0x4fa84a[_0x1fdd('0x149')](_0x2c99dc[_0x1fdd('0x45')],_0x2c99dc[_0x1fdd('0x168')],_0x2c99dc[_0x1fdd('0x42')],_0x2c99dc))[_0x1fdd('0x3e')](_0x4fa84a[_0x1fdd('0x164')](_0x2c99dc))[_0x1fdd('0xad')](loggerCatchQueueSummary('[syncCampaigns]',_0x2c99dc));}else{notSendMessagesCampaign(_0x2c99dc);}}}};function getCallerIdRandom(_0x430907,_0x6a80c8){var _0xe043b9;var _0x4f5dc6;var _0x205fbb;if(_0x6a80c8<=0x0){_0x6a80c8=0x1;}_0xe043b9=new RegExp(_0x1fdd('0x16a')+_0x6a80c8+'}$');_0x4f5dc6=Math[_0x1fdd('0x16b')](0xa,_0x6a80c8-0x1);_0x205fbb=Math[_0x1fdd('0x16b')](0xa,_0x6a80c8)-0x1;return util[_0x1fdd('0x77')]('%s',_[_0x1fdd('0x16c')](_0x430907,_0xe043b9,_[_0x1fdd('0x16d')](_0x4f5dc6,_0x205fbb)));}function extractCalleridName(_0x4a625c){var _0x4f0891=_0x4a625c['match'](/"(.*?)"/);return _0x4f0891?_0x4f0891[0x1]:_0x4a625c;}function extractCalleridNumber(_0x49600c){var _0x5f29a3=_0x49600c[_0x1fdd('0x16e')](/<(.*?)>/);return _0x5f29a3?_0x5f29a3[0x1]:_0x49600c;}Dialer[_0x1fdd('0x1b')]['actionOriginate']=function(_0x548153,_0x35b96f){var _0x40e494=this;var _0x51fbe1=uuid['v4']();this[_0x1fdd('0x26')][_0x51fbe1]=new Action(_0x548153,_0x35b96f,_0x51fbe1);return new BPromise(function(_0x5b5ef6,_0x5298ad){if(_[_0x1fdd('0x3f')](_0x548153)&&typeof _0x548153!==_0x1fdd('0x16f')){return _0x5298ad(msgResponse(_0x1fdd('0x170'),_0x1fdd('0x14a'),_0x1fdd('0x171')));}if(_[_0x1fdd('0x3f')](_0x35b96f[_0x1fdd('0x172')][_0x1fdd('0x173')])||_0x35b96f[_0x1fdd('0x172')][_0x1fdd('0x173')]===null){return _0x5298ad(msgResponse(_0x1fdd('0x170'),_0x1fdd('0x14a'),_0x1fdd('0x174')));}var _0x48d646={'XMD-CALLERID':_0x40e494[_0x1fdd('0x26')][_0x51fbe1][_0x1fdd('0x175')](),'XMD-AGI':_0x548153[_0x1fdd('0x107')]?util['format'](_0x1fdd('0x176'),ipAgi,_0x548153[_0x1fdd('0x107')]):_0x1fdd('0x177'),'XMD-AGIAFTER':_0x548153[_0x1fdd('0x118')]?util[_0x1fdd('0x77')](_0x1fdd('0x176'),ipAgi,_0x548153[_0x1fdd('0x118')]):_0x1fdd('0x177'),'XMD-QUEUE':_0x548153[_0x1fdd('0x50')]===_0x1fdd('0x51')?util[_0x1fdd('0x77')]('\x22%s,%s%s,,,%s\x22',_0x548153[_0x1fdd('0x42')],_0x548153[_0x1fdd('0x178')]||'',_0x548153[_0x1fdd('0x10d')]?'c':'',_0x548153[_0x1fdd('0x114')]||0x3):_0x1fdd('0x177'),'XMD-CONTACTID':_0x35b96f[_0x1fdd('0xcc')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x40e494[_0x1fdd('0x26')][_0x51fbe1][_0x1fdd('0x175')](),'XMD-AMD':_0x548153['dialAMDActive']?_0x1fdd('0x179'):_0x1fdd('0x177'),'XMD-DESTINATION':_0x1fdd('0xdc')};if(_0x548153[_0x1fdd('0xe4')]){_0x48d646['XMD-AMDINITIALSILENCE']=_0x548153[_0x1fdd('0x17a')]||0x9c4;_0x48d646['XMD-AMDGREETING']=_0x548153[_0x1fdd('0x17b')]||0x5dc;_0x48d646[_0x1fdd('0x17c')]=_0x548153[_0x1fdd('0x17d')]||0x320;_0x48d646[_0x1fdd('0x17e')]=_0x548153['dialAMDTotalAnalysisTime']||0x1388;_0x48d646[_0x1fdd('0x17f')]=_0x548153[_0x1fdd('0x180')]||0x64;_0x48d646[_0x1fdd('0x181')]=_0x548153[_0x1fdd('0x182')]||0x32;_0x48d646[_0x1fdd('0x183')]=_0x548153[_0x1fdd('0x184')]||0x3;_0x48d646[_0x1fdd('0x185')]=_0x548153['dialAMDSilenceThreshold']||0x100;_0x48d646[_0x1fdd('0x186')]=_0x548153[_0x1fdd('0x187')]||0x1388;}if(_0x548153[_0x1fdd('0x50')]===_0x1fdd('0x51')){_0x48d646['XMD-VOICEQUEUEID']=_0x35b96f[_0x1fdd('0xcf')];}else{_0x48d646[_0x1fdd('0x188')]=_0x35b96f[_0x1fdd('0x101')];}for(var _0x4abd80 in _0x35b96f['Contact']){if(typeof _0x35b96f[_0x1fdd('0x172')][_0x4abd80]!==_0x1fdd('0xc6')){if(isNotNull(_0x35b96f[_0x1fdd('0x172')][_0x4abd80])&&_0x4abd80!=='id'&&_0x4abd80!=='tags'&&_0x4abd80!==_0x1fdd('0x189')&&_0x4abd80!==_0x1fdd('0x18a')){_0x48d646[util[_0x1fdd('0x77')](_0x1fdd('0x18b'),_0x1fdd('0x18c'),_['toUpper'](_0x4abd80))]=_0x35b96f[_0x1fdd('0x172')][_0x4abd80];}}}var _0x1f44d7=_0x40e494[_0x1fdd('0xd4')](_0x548153[_0x1fdd('0x72')])?getCallerId(_0x548153[_0x1fdd('0x72')]['callerid'],_0x548153['dialOriginateCallerIdName'],_0x548153['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x548153['dialOriginateCallerIdNumber'],_0x548153[_0x1fdd('0x18d')]):_0x548153['dialOriginateCallerIdNumber']):getCallerId(_[_0x1fdd('0xaa')](_0x548153['TrunkBackup'])?_0x548153['Trunk'][_0x1fdd('0x74')]:_0x548153[_0x1fdd('0x145')][_0x1fdd('0x74')],_0x548153['dialOriginateCallerIdName'],_0x548153[_0x1fdd('0x18d')]>0x0?getCallerIdRandom(_0x548153[_0x1fdd('0x59')],_0x548153[_0x1fdd('0x18d')]):_0x548153[_0x1fdd('0x59')]);if(_0x1f44d7){_0x48d646['XMD-ORIGINATECALLERIDNAME']=_0x40e494[_0x1fdd('0x26')][_0x51fbe1][_0x1fdd('0x18e')]=extractCalleridName(_0x1f44d7);_0x48d646[_0x1fdd('0x18f')]=_0x40e494[_0x1fdd('0x26')][_0x51fbe1][_0x1fdd('0x190')]=extractCalleridNumber(_0x1f44d7);}return ami[_0x1fdd('0xab')]({'actionid':_0x51fbe1,'action':_0x1fdd('0x170'),'channel':_0x40e494[_0x1fdd('0xd4')](_0x548153[_0x1fdd('0x72')])?util[_0x1fdd('0x77')](_0x1fdd('0x191'),_0x548153[_0x1fdd('0x72')]['name'],isNotNull(_0x548153[_0x1fdd('0x192')])?_0x548153['dialPrefix']['trim']()||'':'',_0x548153['dialCutDigit']>0x0?_0x35b96f[_0x1fdd('0x172')][_0x1fdd('0x173')]['substring'](_0x548153['dialCutDigit']):_0x35b96f['Contact'][_0x1fdd('0x173')]):util[_0x1fdd('0x77')]('SIP/%s/%s%s',_[_0x1fdd('0xaa')](_0x548153[_0x1fdd('0x145')])?_0x548153[_0x1fdd('0x72')]['name']:_0x548153[_0x1fdd('0x145')]['name'],isNotNull(_0x548153['dialPrefix'])?_0x548153[_0x1fdd('0x192')][_0x1fdd('0x193')]()||'':'',_0x548153[_0x1fdd('0x194')]>0x0?_0x35b96f[_0x1fdd('0x172')][_0x1fdd('0x173')][_0x1fdd('0x195')](_0x548153[_0x1fdd('0x194')]):_0x35b96f[_0x1fdd('0x172')][_0x1fdd('0x173')]),'callerid':_0x1f44d7,'Exten':'xcally-motion-dialer','Context':_0x1fdd('0x196'),'Priority':'1','variable':_0x48d646,'timeout':(_0x548153['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x51fbe1})['then'](function(_0x36f842){return _0x5b5ef6(_0x36f842);})[_0x1fdd('0xad')](function(_0x53c171){_0x548153[_0x1fdd('0x63')]+=0x1;var _0x2ffdae=new History(_0x40e494[_0x1fdd('0x26')][_0x51fbe1]);logger[_0x1fdd('0x93')](util['format'](_0x1fdd('0x197'),JSON['stringify'](_0x53c171)));_0x2ffdae[_0x1fdd('0xa2')]=0xe;_0x2ffdae[_0x1fdd('0xa3')]=_0x1fdd('0x198');_0x2ffdae[_0x1fdd('0xa4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2ffdae[_0x1fdd('0x125')]=_0x2ffdae[_0x1fdd('0xa4')];_0x40e494[_0x1fdd('0xc4')](_0x2ffdae)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x199')));_0x40e494[_0x1fdd('0xc2')](_0x2ffdae)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x199')))[_0x1fdd('0x1d')](function(){delete _0x40e494[_0x1fdd('0x26')][_0x51fbe1];return _0x5298ad(msgResponse(_0x1fdd('0x170'),'Error',_0x1fdd('0x19a')));});});});};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x2f')]=function(_0x2e4ce7){var _0x2f0f0a=this[_0x1fdd('0x26')][_0x2e4ce7[_0x1fdd('0x129')]];if(_0x2f0f0a){delete this['actions'][_0x2e4ce7[_0x1fdd('0x129')]];_0x2f0f0a['responsetime']=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));var _0x532e9c=_0x2f0f0a['type']===_0x1fdd('0x7a')?this['campaigns'][_0x2f0f0a[_0x1fdd('0xb0')]]:this[_0x1fdd('0x20')][_0x2f0f0a['getQueue']()];if(!this['isSuccess'](_0x2e4ce7[_0x1fdd('0x19b')])){this['updateOriginated'](_0x532e9c);return this['callProgressDetecting'](_0x2f0f0a,_0x532e9c,_0x2e4ce7)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x19c')));}this['uniqueId'][_0x2e4ce7['uniqueid']]=_0x2f0f0a;}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x19d')]=function(_0x43ef33,_0x2ced11,_0x543d4a){var _0x4157d2=new History(_0x2ced11);if(_0x4157d2[_0x1fdd('0xfc')]+_0x4157d2[_0x1fdd('0xea')]+_0x4157d2['countnoanswerretry']+_0x4157d2[_0x1fdd('0xec')]+_0x4157d2['countdropretry']+_0x4157d2[_0x1fdd('0xee')]+_0x4157d2[_0x1fdd('0xe7')]+_0x4157d2[_0x1fdd('0xfd')]>=_0x543d4a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x43ef33){case 0x3:if(_0x4157d2[_0x1fdd('0xeb')]>=_0x543d4a[_0x1fdd('0x19e')]-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countnoanswerretry':_0x4157d2['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a[_0x1fdd('0x19f')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2[_0x1fdd('0xcd')],'VoiceQueueId':_0x4157d2['VoiceQueueId']||undefined,'CampaignId':_0x4157d2[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1a0')));break;case 0x5:if(_0x4157d2['countbusyretry']>=_0x543d4a['dialBusyMaxRetry']-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countbusyretry':_0x4157d2['countbusyretry']+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a[_0x1fdd('0x1a1')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2[_0x1fdd('0xcd')],'VoiceQueueId':_0x4157d2['VoiceQueueId']||undefined,'CampaignId':_0x4157d2['CampaignId']||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1a2')));break;case 0x8:if(_0x4157d2[_0x1fdd('0xea')]>=_0x543d4a[_0x1fdd('0x1a3')]-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countcongestionretry':_0x4157d2[_0x1fdd('0xea')]+=0x1,'scheduledat':moment()['add'](_0x543d4a[_0x1fdd('0x1a4')],'minutes')[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2[_0x1fdd('0xcd')],'VoiceQueueId':_0x4157d2[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x4157d2['CampaignId']||undefined})[_0x1fdd('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4157d2['countnosuchnumberretry']>=_0x543d4a[_0x1fdd('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4157d2[_0x1fdd('0xec')]+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a[_0x1fdd('0x1a6')],'minutes')[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2[_0x1fdd('0xcd')],'VoiceQueueId':_0x4157d2['VoiceQueueId']||undefined,'CampaignId':_0x4157d2['CampaignId']||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1a7')));}break;case 0xa:if(_0x4157d2['countdropretry']>=_0x543d4a[_0x1fdd('0x119')]-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countdropretry':_0x4157d2[_0x1fdd('0xed')]+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a[_0x1fdd('0x11b')],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2[_0x1fdd('0xcd')],'VoiceQueueId':_0x4157d2[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x4157d2[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x11c')));break;case 0xb:if(_0x4157d2['countabandonedretry']>=_0x543d4a[_0x1fdd('0x1a8')]-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countabandonedretry':_0x4157d2[_0x1fdd('0xee')]+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a[_0x1fdd('0x123')],'minutes')[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2['ContactId'],'ListId':_0x4157d2['ListId'],'VoiceQueueId':_0x4157d2[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x4157d2['CampaignId']||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x124')));break;case 0x13:if(_0x4157d2[_0x1fdd('0xe7')]>=_0x543d4a[_0x1fdd('0xf0')]-0x1){return!![];}this[_0x1fdd('0xb9')]({'active':![],'countmachineretry':_0x4157d2[_0x1fdd('0xe7')]+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a['dialMachineRetryFrequency'],_0x1fdd('0xf4'))['format'](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2['ListId'],'VoiceQueueId':_0x4157d2['VoiceQueueId']||undefined,'CampaignId':_0x4157d2[_0x1fdd('0x101')]||undefined})['catch'](loggerCatch(_0x1fdd('0xf6')));break;case 0x14:if(_0x4157d2[_0x1fdd('0xfd')]>=_0x543d4a['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4157d2['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x1fdd('0xf3')](_0x543d4a['dialAgentRejectRetryFrequency'],_0x1fdd('0xf4'))[_0x1fdd('0x77')](_0x1fdd('0xf5')),'ContactId':_0x4157d2[_0x1fdd('0xcc')],'ListId':_0x4157d2['ListId'],'VoiceQueueId':_0x4157d2[_0x1fdd('0xcf')]||undefined,'CampaignId':_0x4157d2[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1a9')));break;default:return!![];}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x1aa')]=function(_0x433339,_0x310b6c,_0xcf3124){var _0x5062b9=this;var _0x1b5c28=new History(_0x433339);return new BPromise(function(_0x406a29,_0x42dae6){if(_[_0x1fdd('0x3f')](_0x310b6c)&&typeof _0x310b6c!=='object'){return _0x42dae6(msgResponse(_0x1fdd('0x1ab'),'Failure',_0x1fdd('0x1ac')));}if(_[_0x1fdd('0x3f')](_0xcf3124)&&typeof _0xcf3124!==_0x1fdd('0x16f')){return _0x42dae6(msgResponse(_0x1fdd('0x1ab'),_0x1fdd('0x14a'),_0x1fdd('0x1ad')));}switch(_0xcf3124[_0x1fdd('0x10b')]){case'0':_0x310b6c[_0x1fdd('0x62')]+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0x0;_0x1b5c28['statedesc']=_0x1fdd('0x1ae');_0x1b5c28[_0x1fdd('0xec')]+=0x1;_0x1b5c28[_0x1fdd('0xfb')]+=0x1;ami[_0x1fdd('0x4f')](_0x1fdd('0x1af'),ut[_0x1fdd('0xf8')](_0x433339,_0x1fdd('0x1b0')));_0x5062b9[_0x1fdd('0xc4')](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5062b9[_0x1fdd('0x19d')](0x0,_0x433339,_0x310b6c)){if(_0x1b5c28['countnosuchnumberretry']>=_0x310b6c[_0x1fdd('0x1a5')]){_0x5062b9['createStateFinal'](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1b1'));}else{_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1b1'));}}break;case'3':_0x310b6c[_0x1fdd('0x61')]+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0x3;_0x1b5c28['statedesc']='NoAnswer';_0x1b5c28['countnoanswerretry']+=0x1;_0x1b5c28[_0x1fdd('0xfb')]+=0x1;ami[_0x1fdd('0x4f')](_0x1fdd('0x1b2'),ut['buildObj'](_0x433339,_0x1fdd('0x1b3')));_0x5062b9[_0x1fdd('0xc4')](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1b4')));if(_0x5062b9[_0x1fdd('0x19d')](0x3,_0x433339,_0x310b6c)){if(_0x1b5c28['countnoanswerretry']>=_0x310b6c[_0x1fdd('0x19e')]){_0x5062b9[_0x1fdd('0xf1')](_0x1b5c28,_0x406a29,_0x42dae6,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1b5'));}}break;case'5':_0x310b6c[_0x1fdd('0x5d')]+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0x5;_0x1b5c28[_0x1fdd('0xa3')]=_0x1fdd('0x1b6');_0x1b5c28[_0x1fdd('0xfc')]+=0x1;_0x1b5c28[_0x1fdd('0xfb')]+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0x433339,'busy'));_0x5062b9[_0x1fdd('0xc4')](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1b7')));if(_0x5062b9[_0x1fdd('0x19d')](0x5,_0x433339,_0x310b6c)){if(_0x1b5c28[_0x1fdd('0xfc')]>=_0x310b6c['dialBusyMaxRetry']){_0x5062b9[_0x1fdd('0xf1')](_0x1b5c28,_0x406a29,_0x42dae6,'reason\x205\x20busy');}else{_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1b8'));}}break;case'8':_0x310b6c[_0x1fdd('0x5e')]+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0x8;_0x1b5c28[_0x1fdd('0xa3')]=_0x1fdd('0x1b9');_0x1b5c28[_0x1fdd('0xea')]+=0x1;_0x1b5c28[_0x1fdd('0xfb')]+=0x1;ami[_0x1fdd('0x4f')](_0x1fdd('0x1ba'),ut['buildObj'](_0x433339,_0x1fdd('0x1bb')));_0x5062b9[_0x1fdd('0xc4')](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5062b9[_0x1fdd('0x19d')](0x8,_0x433339,_0x310b6c)){if(_0x1b5c28[_0x1fdd('0xea')]>=_0x310b6c[_0x1fdd('0x1a3')]){_0x5062b9['createStateFinal'](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1bc'));}else{_0x5062b9['stateGlobal'](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1bc'));}}break;case'11':_0x310b6c[_0x1fdd('0x1bd')]+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0xb;_0x1b5c28['statedesc']=_0x1fdd('0x121');_0x1b5c28['countabandonedretry']+=0x1;_0x1b5c28['countglobal']+=0x1;_0x5062b9['createHistory'](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x126')));if(_0x5062b9[_0x1fdd('0x19d')](0xb,_0x433339,_0x310b6c)){if(_0x1b5c28[_0x1fdd('0xee')]>=_0x310b6c['dialAbandonedMaxRetry']){_0x5062b9[_0x1fdd('0xf1')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1be'));}else{_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1be'));}}break;case'20':_0x310b6c[_0x1fdd('0x64')]+=0x1;_0x1b5c28['state']=0x14;_0x1b5c28[_0x1fdd('0xa3')]=_0x1fdd('0x1bf');_0x1b5c28[_0x1fdd('0xfd')]+=0x1;_0x1b5c28['countglobal']+=0x1;ami['emit'](_0x1fdd('0x1c0'),ut[_0x1fdd('0xf8')](_0x433339,_0x1fdd('0x1c1')));_0x5062b9['createHistory'](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1c2')));if(_0x5062b9['checkRetriveMax'](0x14,_0x433339,_0x310b6c)){if(_0x1b5c28[_0x1fdd('0xfd')]>=_0x310b6c['dialAgentRejectMaxRetry']){_0x5062b9['createStateFinal'](_0x1b5c28,_0x406a29,_0x42dae6,'reason\x2020\x20agentreject');}else{_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0x1fdd('0x1c3'));}}break;default:_0x310b6c['outboundUnknownCallsDay']+=0x1;_0x1b5c28[_0x1fdd('0xa2')]=0xc;_0x1b5c28[_0x1fdd('0xa3')]=_0xcf3124[_0x1fdd('0x10b')];_0x5062b9[_0x1fdd('0xc4')](_0x1b5c28)[_0x1fdd('0xad')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5062b9[_0x1fdd('0x19d')](_0xcf3124[_0x1fdd('0x10b')],_0x433339,_0x310b6c)){if(_0x1b5c28['countbusyretry']+_0x1b5c28[_0x1fdd('0xea')]+_0x1b5c28[_0x1fdd('0xeb')]+_0x1b5c28['countnosuchnumberretry']+_0x1b5c28[_0x1fdd('0xed')]+_0x1b5c28[_0x1fdd('0xee')]+_0x1b5c28[_0x1fdd('0xe7')]+_0x1b5c28['countagentrejectretry']>=_0x310b6c['dialGlobalMaxRetry']){_0x5062b9[_0x1fdd('0xfe')](_0x1b5c28,_0x406a29,_0x42dae6,_0xcf3124[_0x1fdd('0x10b')]);}else{_0x5062b9[_0x1fdd('0xf1')](_0x1b5c28,_0x406a29,_0x42dae6,_0xcf3124[_0x1fdd('0x10b')]);}}}});};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xfe')]=function(_0x2d6ef3,_0x5950a7,_0x5a62bd,_0x11a7ed){var _0x1849a4=new Final(_0x2d6ef3);_0x1849a4[_0x1fdd('0xa2')]=0xf;_0x1849a4['statedesc']=_0x1fdd('0x1c4');this[_0x1fdd('0xf1')](_0x1849a4,_0x5950a7,_0x5a62bd,_0x11a7ed);};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xf1')]=function(_0x833868,_0x192d1d,_0x190e54,_0x5afc0a){this[_0x1fdd('0xc2')](_0x833868)['then'](function(){return _0x192d1d(msgResponse(_0x1fdd('0x1ab'),_0x1fdd('0xd3'),_0x5afc0a));})[_0x1fdd('0xad')](function(){return _0x190e54(msgResponse('[moveContactManagedDialer][0]',_0x1fdd('0x14a'),_0x1fdd('0x1c5')));});};Dialer[_0x1fdd('0x1b')][_0x1fdd('0xb')]=function(_0x121a23){var _0x4bbb5e=_0x121a23[_0x1fdd('0x1c6')]/0x64;var _0x4528ca=_0x121a23[_0x1fdd('0x60')]/(_0x121a23[_0x1fdd('0x60')]+_0x121a23[_0x1fdd('0x5b')]);var _0x5295f8=Math[_0x1fdd('0x1c7')](_0x121a23[_0x1fdd('0x6d')]*(_0x121a23[_0x1fdd('0x1c8')]/0x64));var _0x3281f2=Math[_0x1fdd('0x1c7')](_0x121a23['predictiveIntervalAvailable']*(_0x121a23[_0x1fdd('0x1c9')]/0x64));var _0x13c746=_0x121a23[_0x1fdd('0x9c')]+_0x121a23[_0x1fdd('0x54')];var _0xab4ddd=Math['floor'](_0x121a23[_0x1fdd('0x86')]*_0x121a23[_0x1fdd('0x70')]*_0x121a23['predictiveIntervalHitRate']*_0x121a23[_0x1fdd('0x6b')]);if(_[_0x1fdd('0x3f')](_0x121a23[_0x1fdd('0x28')])){if(!_[_0x1fdd('0x3f')](_0x121a23[_0x1fdd('0x8c')])){_0x121a23['startPredictive']=undefined;loggerPredictive[_0x1fdd('0x93')](_0x1fdd('0x1ca'),_0x1fdd('0x1cb'));}if(!_[_0x1fdd('0x3f')](_0x121a23[_0x1fdd('0x8d')])){loggerPredictive['error'](_0x1fdd('0x1ca'),_0x1fdd('0x1cc'));clearInterval(_0x121a23[_0x1fdd('0x8d')]);_0x121a23['handlePredictive']=undefined;}_0x121a23[_0x1fdd('0x28')]=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));loggerPredictive[_0x1fdd('0x7d')](_0x121a23[_0x1fdd('0x42')],'collection\x20data\x20in\x20progressive\x20at',_0x121a23[_0x1fdd('0x28')]);this[_0x1fdd('0x15e')](_0x121a23,0x1);}else if(ifInterval(_0x121a23[_0x1fdd('0x1cd')],_0x121a23[_0x1fdd('0x28')])){this[_0x1fdd('0x15e')](_0x121a23,0x1);loggerPredictiveCalls[_0x1fdd('0x7d')](_0x1fdd('0x1ce'),_0x121a23[_0x1fdd('0x28')],_0x121a23[_0x1fdd('0x42')]);_0x121a23['erlangCalls']=0x0;_0x121a23[_0x1fdd('0x115')]=0x0;}else if(_0x4bbb5e<_0x4528ca&&_0x121a23[_0x1fdd('0x1cf')]===_0x1fdd('0x1d0')){freeVariablesPredictive(_0x121a23);loggerPredictive[_0x1fdd('0x7d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x4528ca,_0x1fdd('0x28'),_0x121a23[_0x1fdd('0x42')]);}else if(_0xab4ddd<_0x121a23[_0x1fdd('0x115')]&&_0x121a23[_0x1fdd('0x1cf')]===_0x1fdd('0x1d0')){freeVariablesPredictive(_0x121a23);loggerPredictive[_0x1fdd('0x7d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x1fdd('0x1d1'),_0xab4ddd,_0x1fdd('0x1d2'),_0x121a23['predictiveIntervalErlangCallsDroppedCalls'],_0x1fdd('0x28'),_0x121a23[_0x1fdd('0x42')]);}else if(!ifInterval(_0x121a23[_0x1fdd('0x1cd')],_0x121a23['startProgressive'])&&_[_0x1fdd('0x3f')](_0x121a23[_0x1fdd('0x8c')])&&!_[_0x1fdd('0x3f')](_0x121a23[_0x1fdd('0x28')])){_0x121a23[_0x1fdd('0x8c')]=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));loggerPredictive[_0x1fdd('0x7d')](_0x121a23['name'],_0x1fdd('0x1d3'),_0x121a23[_0x1fdd('0x8c')]);this[_0x1fdd('0xb7')](_0x121a23[_0x1fdd('0x1cd')])[_0x1fdd('0x3e')](this[_0x1fdd('0x1d4')](_0x121a23))[_0x1fdd('0x3e')](mergeDataErlangB(_0x121a23))[_0x1fdd('0x3e')](this['startMethodPredictive'](_0x121a23))[_0x1fdd('0xad')](loggerCatchPredictive(_0x1fdd('0x1d5'),_0x121a23));}else if(!ifInterval(_0x121a23[_0x1fdd('0x1cd')],_0x121a23[_0x1fdd('0x8c')])){_0x121a23[_0x1fdd('0x115')]=0x0;_0x121a23[_0x1fdd('0x8c')]=moment()[_0x1fdd('0x77')](_0x1fdd('0xf5'));loggerPredictive[_0x1fdd('0x7d')](_0x121a23['name'],_0x1fdd('0x1d6'),_0x121a23[_0x1fdd('0x8c')]);clearInterval(_0x121a23[_0x1fdd('0x8d')]);_0x121a23[_0x1fdd('0x8d')]=undefined;this['averageHandleTime'](_0x121a23['dialPredictiveInterval'])[_0x1fdd('0x3e')](this[_0x1fdd('0x1d4')](_0x121a23))[_0x1fdd('0x3e')](mergeDataErlangB(_0x121a23))[_0x1fdd('0x3e')](this[_0x1fdd('0x1d7')](_0x121a23))[_0x1fdd('0xad')](loggerCatchPredictive(_0x1fdd('0x1d8'),_0x121a23));}else if(_0x121a23[_0x1fdd('0x6d')]&&_0x13c746<_0x121a23['predictiveIntervalAvailable']-_0x3281f2){freeVariablesPredictive(_0x121a23);loggerPredictive[_0x1fdd('0x7d')](_0x121a23[_0x1fdd('0x42')],_0x1fdd('0x1d9'),_0x13c746,_0x1fdd('0x1da'),_0x121a23['predictiveIntervalAvailable'],'-',_0x3281f2,'=',_0x121a23[_0x1fdd('0x6d')]-_0x3281f2,')');}else if(_0x121a23['predictiveIntervalAvailable']&&_0x13c746>_0x121a23[_0x1fdd('0x6d')]+_0x5295f8){freeVariablesPredictive(_0x121a23);loggerPredictive[_0x1fdd('0x7d')](_0x121a23[_0x1fdd('0x42')],_0x1fdd('0x1d9'),_0x13c746,_0x1fdd('0x1db'),_0x121a23['predictiveIntervalAvailable'],'+',_0x5295f8,'=',_0x121a23[_0x1fdd('0x6d')]+_0x5295f8,')');}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x1d4')]=function(_0x3fcdc6){var _0x485a27=this;return function(_0x3f4c9f){return new BPromise(function(_0x5e295e,_0x5813b4){_['merge'](_0x3fcdc6,_0x3f4c9f[0x0]);if(checkGetDataPredictive(_0x3f4c9f[0x0])){var _0x57d2d7=_0x3fcdc6[_0x1fdd('0x6d')]=_0x3fcdc6[_0x1fdd('0x54')]+_0x3fcdc6['available'];var _0x30f028=_0x3fcdc6[_0x1fdd('0x1cd')]*0x3c;var _0x1a53ec=_0x3f4c9f[0x0]['predictiveIntervalAvgTalktime']+_0x3f4c9f[0x0][_0x1fdd('0x66')];var _0x3401e2=(_0x3f4c9f[0x0][_0x1fdd('0x1dc')]+_0x3f4c9f[0x0][_0x1fdd('0x69')]+_0x3f4c9f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3f4c9f[0x0]['predictiveIntervalTotalCalls'];_0x3fcdc6[_0x1fdd('0x1dd')]=_0x3401e2>0x0?_0x3401e2:0x1;switch(_0x3fcdc6[_0x1fdd('0x1cf')]){case _0x1fdd('0x1d0'):var _0x4b4eed=_0x3fcdc6[_0x1fdd('0x1c6')]/0x64;return _0x485a27['abandonmentRate'](_0x57d2d7,_0x30f028,_0x1a53ec,_0x3401e2,_0x4b4eed)[_0x1fdd('0x3e')](function(_0x99186a){return _0x5e295e(_0x99186a);});case _0x1fdd('0x1de'):var _0x248c1c=_0x3fcdc6[_0x1fdd('0x1c6')]/0x64;return _0x485a27[_0x1fdd('0x1df')](_0x57d2d7,_0x30f028,_0x1a53ec,_0x3401e2,_0x248c1c)['then'](function(_0x1634a5){return _0x5e295e(_0x1634a5);});default:return _0x5813b4(msgResponse(_0x1fdd('0x1e0'),_0x1fdd('0x14a'),_0x1fdd('0x1e1')));}}else{return _0x5813b4(msgResponse(_0x1fdd('0x1e0'),'Failure',_0x1fdd('0x1e2')));}});};};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x1e3')]=function(_0x17edec){var _0x3e0915=this;return function(_0xb8e40a){return new BPromise(function(_0x1b8ba5,_0x339e57){_['merge'](_0x17edec,_0xb8e40a[0x0]);if(checkGetDataPredictive(_0xb8e40a[0x0])){loggerPredictive[_0x1fdd('0x7d')](JSON[_0x1fdd('0x75')](_0xb8e40a[0x0]));if(_0x17edec[_0x1fdd('0x1cf')]===_0x1fdd('0x1d0')){return _0x3e0915['getVoiceQueueRtPauses'](_0x17edec['id'])[_0x1fdd('0x3e')](function(_0x5d6a0f){var _0x17ee99=_0x17edec[_0x1fdd('0x166')]-_0x5d6a0f[0x0][_0x1fdd('0x1e4')];var _0x1a9e09=_0x17edec[_0x1fdd('0x1cd')]*0x3c;var _0x4ddc04=_0xb8e40a[0x0][_0x1fdd('0x67')]+_0xb8e40a[0x0][_0x1fdd('0x66')];var _0x5cc4d0=(_0xb8e40a[0x0][_0x1fdd('0x1dc')]+_0xb8e40a[0x0][_0x1fdd('0x69')]+_0xb8e40a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xb8e40a[0x0][_0x1fdd('0x6e')];var _0x4148f0=_0x17edec['dialPredictiveOptimizationPercentage']/0x64;_0x17edec[_0x1fdd('0x6c')]=_0x5d6a0f[0x0]['outboundQueuePauses']||0x0;_0x17edec[_0x1fdd('0x1dd')]=_0x5cc4d0>0x0?_0x5cc4d0:0x1;return _0x3e0915[_0x1fdd('0x1e5')](_0x17ee99,_0x1a9e09,_0x4ddc04,_0x5cc4d0,_0x4148f0);})[_0x1fdd('0x3e')](function(_0x29f9c4){return _0x1b8ba5(_0x29f9c4);})[_0x1fdd('0xad')](function(_0xda0aa5){return _0x339e57(msgResponse(_0x1fdd('0x1e6'),_0x1fdd('0x14a'),JSON[_0x1fdd('0x75')](_0xda0aa5)));});}if(_0x17edec[_0x1fdd('0x1cf')]===_0x1fdd('0x1de')){return _0x3e0915['getVoiceQueueRtPauses'](_0x17edec['id'])[_0x1fdd('0x3e')](function(_0x4bbe01){var _0x523003=_0x17edec['loggedIn']-_0x4bbe01[0x0][_0x1fdd('0x1e4')];var _0x2082eb=_0x17edec[_0x1fdd('0x1cd')]*0x3c;var _0x3b4472=_0xb8e40a[0x0]['predictiveIntervalAvgTalktime']+_0xb8e40a[0x0][_0x1fdd('0x66')];var _0x51d047=(_0xb8e40a[0x0][_0x1fdd('0x1dc')]+_0xb8e40a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xb8e40a[0x0][_0x1fdd('0x68')])/_0xb8e40a[0x0][_0x1fdd('0x6e')];var _0x5c22df=_0x17edec[_0x1fdd('0x1c6')]/0x64;_0x17edec['predictiveIntervalPauses']=_0x4bbe01[0x0][_0x1fdd('0x1e4')]||0x0;_0x17edec[_0x1fdd('0x1dd')]=_0x51d047>0x0?_0x51d047:0x1;return _0x3e0915[_0x1fdd('0x1df')](_0x523003,_0x2082eb,_0x3b4472,_0x51d047,_0x5c22df);})[_0x1fdd('0x3e')](function(_0x501b8e){return _0x1b8ba5(_0x501b8e);})[_0x1fdd('0xad')](function(_0x424373){return _0x339e57(msgResponse(_0x1fdd('0x1e6'),'Failure',JSON[_0x1fdd('0x75')](_0x424373)));});}}else{return _0x339e57(msgResponse(_0x1fdd('0x1e0'),'Failure',_0x1fdd('0x1e2')));}});};};Dialer['prototype'][_0x1fdd('0x1d7')]=function(_0xc19d0f){var _0x412d70=this;return function(){var _0x268f22=0x0;var _0xa49108=Math[_0x1fdd('0x1e7')](_0xc19d0f[_0x1fdd('0x6f')]*0x3e8);if(_0xa49108>0x0){_0xa49108=_0xa49108<0x64?0x64:_0xa49108;loggerPredictive['info'](_0xc19d0f[_0x1fdd('0x42')],_0x1fdd('0x1e8'),_0xa49108,'milliseconds');_0xc19d0f[_0x1fdd('0x8d')]=setInterval(function(){_0x412d70[_0x1fdd('0x8d')](_0xc19d0f);loggerPredictiveCalls[_0x1fdd('0x7d')](_0x1fdd('0x1e9'),_0x268f22+=0x1);},_0xa49108);}else{loggerPredictive['info'](_0xc19d0f[_0x1fdd('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x1fdd('0x1ea')]=function(_0x346b97,_0xb20525){var _0x575561=this;return function(_0x11cb67){if(_[_0x1fdd('0x49')](_0x11cb67)){if(_[_0x1fdd('0xaa')](_0xb20525[_0x1fdd('0xce')])||!_0xb20525[_0x1fdd('0x1eb')]){if(_0x346b97[_0x1fdd('0x165')]==='booked'){_0x346b97[_0x1fdd('0x132')]=_[_0x1fdd('0x3f')](_0x346b97['queueStatusComplete'])?!![]:_0x346b97[_0x1fdd('0x132')];var _0x1f7ebb=uuid['v4']();_0x575561[_0x1fdd('0x26')][_0x1f7ebb]=new Action(_0x346b97,_0xb20525,_0x1f7ebb);loggerBooked[_0x1fdd('0x7d')](_0x1fdd('0x1ec'),_0x1f7ebb,_0x1fdd('0x1ed'),JSON[_0x1fdd('0x75')](_0x346b97[_0x1fdd('0x132')]),_0x1fdd('0x1ee'),_0x346b97[_0x1fdd('0x42')]);if(_0x346b97[_0x1fdd('0x132')]){_0x346b97[_0x1fdd('0x132')]=![];_0x575561['queueBooked'][_0x575561[_0x1fdd('0x26')][_0x1f7ebb]['queue']]=[];ami[_0x1fdd('0xab')]({'actionid':_0x1f7ebb,'action':_0x1fdd('0x1ef'),'queue':_0x346b97[_0x1fdd('0x42')]})[_0x1fdd('0xad')](function(){_0x575561[_0x1fdd('0xae')](_0x346b97);_0x575561[_0x1fdd('0xb9')]({'active':![],'ContactId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb][_0x1fdd('0xcc')],'ListId':_0x575561['actions'][_0x1f7ebb]['ListId'],'VoiceQueueId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb][_0x1fdd('0xcf')]||undefined,'CampaignId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb][_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1f0')));delete _0x575561['actions'][_0x1f7ebb];});}else{loggerBooked[_0x1fdd('0x7d')](_0x1fdd('0x1f1'),JSON['stringify'](_0x346b97['queueStatusComplete']),_0x1fdd('0x1ee'),_0x346b97[_0x1fdd('0x42')]);_0x575561['updateOriginated'](_0x346b97);_0x575561[_0x1fdd('0xb9')]({'active':![],'ContactId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb][_0x1fdd('0xcc')],'ListId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb][_0x1fdd('0xcd')],'VoiceQueueId':_0x575561[_0x1fdd('0x26')][_0x1f7ebb]['VoiceQueueId']||undefined,'CampaignId':_0x575561['actions'][_0x1f7ebb][_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x575561[_0x1fdd('0x26')][_0x1f7ebb];}}else{return _0x575561[_0x1fdd('0x1f2')](_0x346b97,_0xb20525);}}else{if(getDiff(_0xb20525[_0x1fdd('0x1f3')])<_0x346b97[_0x1fdd('0x1f4')]*0x3c){if(_0xb20525['Agent']&&!_0xb20525[_0x1fdd('0x162')][_0x1fdd('0x1f5')]){_0x575561[_0x1fdd('0x1f')]['run'](_0xb20525['id'])[_0x1fdd('0x1d')](function(){_0x575561[_0x1fdd('0xae')](_0x346b97);});}else{_0x575561[_0x1fdd('0xbb')]({'active':![]},_0xb20525['id'],0x1)[_0x1fdd('0x1d')](function(){_0x575561[_0x1fdd('0xae')](_0x346b97);});}}else{_0x346b97[_0x1fdd('0x1f6')]+=0x1;_0x575561[_0x1fdd('0xae')](_0x346b97);if(_0x346b97[_0x1fdd('0x1f7')]){_0x575561[_0x1fdd('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb20525[_0x1fdd('0xcc')],'ListId':_0xb20525[_0x1fdd('0xcd')],'VoiceQueueId':_0xb20525[_0x1fdd('0xcf')]||undefined,'CampaignId':_0xb20525[_0x1fdd('0x101')]||undefined})[_0x1fdd('0xad')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x575561['createHistory'](createObjHistory(_0x346b97,_0xb20525,_0x1fdd('0x1f8'),0x17,_0x1fdd('0x1f9')))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0x1fa')));}else{_0x575561[_0x1fdd('0xd7')](createObjHistory(_0x346b97,_0xb20525,_0x1fdd('0x1fb'),0x16,'RecallFailedTimeout'),_0x1fdd('0x1fc'),_0x1fdd('0x1fd'));}}}}else{_0x346b97[_0x1fdd('0x5c')]+=0x1;_0x575561['saveInDb'](createObjHistory(_0x346b97,_0xb20525,_0x1fdd('0x1fe'),0xd,_0x1fdd('0x1ff')),'[Originate][historyBlacklist]',_0x1fdd('0x200'));throw _0x1fdd('0x201');}};};Dialer[_0x1fdd('0x1b')]['handleIvr']=function(_0x42f8b5){var _0x4c8641=this;var _0x199b97=_0x42f8b5[_0x1fdd('0x202')]-_0x42f8b5[_0x1fdd('0x95')]-_0x42f8b5['temp'];emitCampaignSummary(_0x42f8b5);if(_0x199b97>0x0){if(_0x199b97>this['maxNumberOriginate']){_0x199b97=this[_0x1fdd('0x24')];}_0x42f8b5['temp']+=_0x199b97;this[_0x1fdd('0xbe')](_0x42f8b5['id'],_0x199b97,_0x42f8b5[_0x1fdd('0x203')],_0x42f8b5)[_0x1fdd('0x3e')](function(_0x295dcd){_0x42f8b5[_0x1fdd('0xbd')]-=_0x199b97;_0x42f8b5[_0x1fdd('0xbd')]=_0x42f8b5[_0x1fdd('0xbd')]>0x0?_0x42f8b5[_0x1fdd('0xbd')]:0x0;if(!checkContactEmpty(_0x295dcd)){_0x42f8b5[_0x1fdd('0x40')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x1fdd('0x7d')](_0x1fdd('0x204')+_0x42f8b5[_0x1fdd('0x42')]);}else{_0x42f8b5['originated']+=_0x295dcd['length'];_0x42f8b5[_0x1fdd('0x40')]=_0x1fdd('0x205');for(var _0x22d7e5=0x0;_0x22d7e5<_0x295dcd[_0x1fdd('0x94')];_0x22d7e5+=0x1){_0x42f8b5[_0x1fdd('0x206')]+=0x1;if(_[_0x1fdd('0xaa')](_0x295dcd[_0x22d7e5])||_[_0x1fdd('0xaa')](_0x295dcd[_0x22d7e5][_0x1fdd('0x172')])||_[_0x1fdd('0xaa')](_0x295dcd[_0x22d7e5]['Contact'][_0x1fdd('0x173')])){_0x4c8641[_0x1fdd('0xca')](_0x1fdd('0x207'),_0x42f8b5,_0x295dcd[_0x22d7e5]);}else{_0x4c8641[_0x1fdd('0xb5')](_[_0x1fdd('0x12f')](_0x295dcd[_0x22d7e5],[_0x1fdd('0x101'),_0x1fdd('0x208')]))['then'](_0x4c8641[_0x1fdd('0x1ea')](_0x42f8b5,_0x295dcd[_0x22d7e5]))[_0x1fdd('0xad')](_0x4c8641['loggerHandler'](_0x1fdd('0x209'),_0x42f8b5));}}}})[_0x1fdd('0xad')](loggerGetContactDialer(_0x1fdd('0x20a'),_0x42f8b5,_0x199b97));}};Dialer['prototype']['handlePower']=function(_0x585a18,_0x19a935){var _0x254296=this;var _0x3babaf=[];var _0xca3279=_0x19a935>=0x1?_0x19a935:0x1;if(_0x585a18[_0x1fdd('0x165')]===_0x1fdd('0xa')){_0xca3279=0x1;}var _0x7d4c60=Math['floor'](_0x585a18[_0x1fdd('0x9c')]*_0xca3279)-_0x585a18[_0x1fdd('0x95')]-_0x585a18[_0x1fdd('0xbd')];emitVoiceQueueSummary(_0x585a18);if(_0x585a18[_0x1fdd('0x20b')]>0x0){var _0x15bc34=_0x585a18[_0x1fdd('0x20b')]-_0x585a18['originated']-_0x585a18['talking']-_0x585a18[_0x1fdd('0xbd')]-_0x585a18[_0x1fdd('0x9b')];if(_0x7d4c60>_0x15bc34){_0x7d4c60=_0x15bc34;}}if(_0x7d4c60>0x0){if(_0x585a18['dialMethod']===_0x1fdd('0xa')){_0x7d4c60=0x1;}if(_0x7d4c60>this['maxNumberOriginate']){_0x7d4c60=this[_0x1fdd('0x24')];}_0x585a18[_0x1fdd('0xbd')]+=_0x7d4c60;for(var _0x2e5104 in this[_0x1fdd('0x22')]){if(typeof this[_0x1fdd('0x22')][_0x2e5104]!=='undefined'){if(this[_0x1fdd('0x22')][_0x2e5104]['state']===_0x1fdd('0x20c')&&this['agents'][_0x2e5104][_0x1fdd('0xac')]===_0x1fdd('0xd5')){_0x3babaf[_0x1fdd('0x12e')](this[_0x1fdd('0x22')][_0x2e5104]['id']);}}}this[_0x1fdd('0xbc')](_0x585a18['id'],_0x3babaf,_0x7d4c60,_0x585a18['dialOrderByScheduledAt'],_0x585a18)[_0x1fdd('0x3e')](function(_0xcf395c){_0x585a18[_0x1fdd('0xbd')]-=_0x7d4c60;_0x585a18[_0x1fdd('0xbd')]=_0x585a18[_0x1fdd('0xbd')]>0x0?_0x585a18[_0x1fdd('0xbd')]:0x0;if(!checkContactEmpty(_0xcf395c)){_0x254296[_0x1fdd('0xb1')](_0x585a18)[_0x1fdd('0x3e')](sendMessageReschedule(_0x585a18))['catch'](loggerCatch(_0x1fdd('0xb3')));}else{_0x585a18[_0x1fdd('0x95')]+=_0xcf395c[_0x1fdd('0x94')];_0x585a18[_0x1fdd('0x40')]=_0x585a18[_0x1fdd('0x165')]===_0x1fdd('0xa')?_0x1fdd('0x179'):_0x1fdd('0x205');for(var _0xc4bbb9=0x0;_0xc4bbb9<_0xcf395c[_0x1fdd('0x94')];_0xc4bbb9+=0x1){if(_[_0x1fdd('0xaa')](_0xcf395c[_0xc4bbb9])||_[_0x1fdd('0xaa')](_0xcf395c[_0xc4bbb9]['Contact'])||_['isNil'](_0xcf395c[_0xc4bbb9][_0x1fdd('0x172')][_0x1fdd('0x173')])){_0x254296['emptyContact'](_0x1fdd('0x207'),_0x585a18,_0xcf395c[_0xc4bbb9]);}else{_0x254296[_0x1fdd('0xb4')](_[_0x1fdd('0x12f')](_0xcf395c[_0xc4bbb9],[_0x1fdd('0xcf'),_0x1fdd('0x208')]))[_0x1fdd('0x3e')](_0x254296[_0x1fdd('0x1ea')](_0x585a18,_0xcf395c[_0xc4bbb9]))[_0x1fdd('0xad')](_0x254296[_0x1fdd('0xc9')](_0x1fdd('0x207'),_0x585a18));}}}})[_0x1fdd('0xad')](loggerGetContactDialer(_0x1fdd('0x20d'),_0x585a18,_0x7d4c60));}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x8d')]=function(_0x37d2db){if(_0x37d2db[_0x1fdd('0x20b')]>0x0){var _0x47e4bb=_0x37d2db[_0x1fdd('0x20b')]-_0x37d2db[_0x1fdd('0x95')]-_0x37d2db[_0x1fdd('0x54')];if(_0x47e4bb>0x0){this['tryOriginatePredictive'](_0x37d2db);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x37d2db);}};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x20e')]=function(_0x1db89e){var _0x30998e=this;var _0x2c1667=[];_0x1db89e[_0x1fdd('0x95')]+=0x1;for(var _0x75f991 in this[_0x1fdd('0x22')]){if(typeof this[_0x1fdd('0x22')][_0x75f991]!=='undefined'){if(this['agents'][_0x75f991][_0x1fdd('0xa2')]==='not_inuse'&&this[_0x1fdd('0x22')][_0x75f991][_0x1fdd('0xac')]===_0x1fdd('0xd5')){_0x2c1667[_0x1fdd('0x12e')](this[_0x1fdd('0x22')][_0x75f991]['id']);}}}this['getContactDialer'](_0x1db89e['id'],_0x2c1667,0x1,_0x1db89e[_0x1fdd('0x203')],_0x1db89e)['then'](function(_0x1e043d){if(!checkContactEmpty(_0x1e043d)){checkContactLowerLimitOriginate(_0x1db89e,0x1,0x0);_0x30998e[_0x1fdd('0xb1')](_0x1db89e)['then'](sendMessageReschedule(_0x1db89e))[_0x1fdd('0xad')](loggerCatch(_0x1fdd('0xb3')));}else{_0x1db89e['message']='RUNNING';if(_[_0x1fdd('0xaa')](_0x1e043d[0x0])||_['isNil'](_0x1e043d[0x0]['Contact'])||_['isNil'](_0x1e043d[0x0][_0x1fdd('0x172')][_0x1fdd('0x173')])){_0x30998e[_0x1fdd('0xca')](_0x1fdd('0x207'),_0x1db89e,_0x1e043d[0x0]);}else{_0x30998e[_0x1fdd('0xb4')](_[_0x1fdd('0x12f')](_0x1e043d[0x0],['VoiceQueueId',_0x1fdd('0x208')]))['then'](_0x30998e[_0x1fdd('0x1ea')](_0x1db89e,_0x1e043d[0x0]))['catch'](_0x30998e['loggerHandler']('[actionOriginatePredictive]\x20',_0x1db89e));}}})['catch'](loggerGetContactDialer(_0x1fdd('0x20f'),_0x1db89e,0x1));emitVoiceQueueSummary(_0x1db89e);};Dialer[_0x1fdd('0x1b')][_0x1fdd('0x1e5')]=function(_0x577d95,_0x3b459d,_0x36db4d,_0x1d09e7,_0x3aa767,_0x1c5ed0){loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x210'));loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x211'),_0x577d95);loggerPredictive[_0x1fdd('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3b459d);loggerPredictive['info'](_0x1fdd('0x212'),_0x36db4d);loggerPredictive['info'](_0x1fdd('0x213'),_0x1d09e7);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x214'),_0x3aa767);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x82'));return new BPromise(function(_0x208074,_0x405ee3){if(_0x577d95<=0x0||isNaN(_0x577d95)){return _0x405ee3(msgResponse('[abandonmentRate]',_0x1fdd('0x4b'),_0x1fdd('0x215')+_0x577d95));}if(_0x36db4d<=0x0||isNaN(_0x36db4d)){return _0x405ee3(msgResponse(_0x1fdd('0x216'),_0x1fdd('0x4b'),_0x1fdd('0x217')+_0x36db4d));}if(_0x1d09e7<=0x0||isNaN(_0x1d09e7)){return _0x405ee3(msgResponse('[abandonmentRate]',_0x1fdd('0x4b'),_0x1fdd('0x218')+_0x1d09e7));}if(_0x3b459d<=0x0||isNaN(_0x3b459d)){return _0x405ee3(msgResponse(_0x1fdd('0x216'),'Error','interval\x20=\x20'+_0x3b459d));}if(_0x3aa767<=0x0||isNaN(_0x3aa767)){return _0x405ee3(msgResponse('[abandonmentRate]',_0x1fdd('0x4b'),_0x1fdd('0x219')+_0x3aa767));}_0x1c5ed0=_0x1c5ed0||0x0;var _0x3d5950=0x1/_0x36db4d;var _0x372148=0x0;var _0x5f4ce5=0x0;var _0x234ddd=0x0;var _0x5b189a=0x0;for(var _0x4d0baa=0x0;_0x234ddd<_0x3aa767;_0x4d0baa+=0x1){_0x5f4ce5=_0x4d0baa/_0x3b459d;_0x372148=(_0x1d09e7*_0x5f4ce5+_0x1c5ed0)/_0x3d5950;_0x234ddd=erlangb(_0x372148,_0x577d95);_0x5b189a=_0x372148/_0x577d95*(0x1-erlangb(_0x372148,_0x577d95));}return _0x208074({'erlangCalls':_0x4d0baa,'erlangCallToSecond':_0x3b459d/_0x4d0baa,'erlangAbandonmentRate':_0x234ddd,'erlangBusyFactor':_0x5b189a});});};Dialer[_0x1fdd('0x1b')]['busyFactor']=function(_0x4fe71e,_0x538ef2,_0x3348a6,_0x43ce68,_0x3535bf,_0x529d93){loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x21a'));loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x211'),_0x4fe71e);loggerPredictive[_0x1fdd('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x538ef2);loggerPredictive['info']('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',_0x3348a6);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x213'),_0x43ce68);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x21b'),_0x3535bf);loggerPredictive[_0x1fdd('0x7d')](_0x1fdd('0x82'));return new BPromise(function(_0xa8548c,_0x28f0f2){if(_0x4fe71e<=0x0||isNaN(_0x4fe71e)){return _0x28f0f2(msgResponse(_0x1fdd('0x21c'),_0x1fdd('0x4b'),_0x1fdd('0x215')+_0x4fe71e));}if(_0x3348a6<=0x0||isNaN(_0x3348a6)){return _0x28f0f2(msgResponse(_0x1fdd('0x21c'),'Error',_0x1fdd('0x217')+_0x3348a6));}if(_0x43ce68<=0x0||isNaN(_0x43ce68)){return _0x28f0f2(msgResponse(_0x1fdd('0x21c'),_0x1fdd('0x4b'),_0x1fdd('0x218')+_0x43ce68));}if(_0x538ef2<=0x0||isNaN(_0x538ef2)){return _0x28f0f2(msgResponse(_0x1fdd('0x21c'),_0x1fdd('0x4b'),_0x1fdd('0x21d')+_0x538ef2));}if(_0x3535bf<=0x0||isNaN(_0x3535bf)){return _0x28f0f2(msgResponse(_0x1fdd('0x21c'),'Error',_0x1fdd('0x21e')+_0x3535bf));}_0x529d93=_0x529d93||0x0;var _0x5b22e7=0x1/_0x3348a6;var _0x4a1d08=0x0;var _0x37a828=0x0;var _0x389cb3=0x0;var _0x1e9a98=0x0;for(var _0x11dfaa=0x0;_0x1e9a98<_0x3535bf;_0x11dfaa+=0x1){_0x37a828=_0x11dfaa/_0x538ef2;_0x4a1d08=(_0x43ce68*_0x37a828+_0x529d93)/_0x5b22e7;_0x389cb3=erlangb(_0x4a1d08,_0x4fe71e);_0x1e9a98=_0x4a1d08/_0x4fe71e*(0x1-erlangb(_0x4a1d08,_0x4fe71e));}return _0xa8548c({'erlangCalls':_0x11dfaa,'erlangCallToSecond':_0x538ef2/_0x11dfaa,'erlangAbandonmentRate':_0x389cb3,'erlangBusyFactor':_0x1e9a98});});};module[_0x1fdd('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index fb832f9..393093e 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 _0xb778=['ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','starttime','responsetime','droptime'];(function(_0x20b035,_0x33e530){var _0x26d5ec=function(_0x34fafa){while(--_0x34fafa){_0x20b035['push'](_0x20b035['shift']());}};_0x26d5ec(++_0x33e530);}(_0xb778,0x18c));var _0x8b77=function(_0xcd81b8,_0x18d9fd){_0xcd81b8=_0xcd81b8-0x0;var _0xc3ae18=_0xb778[_0xcd81b8];return _0xc3ae18;};'use strict';var util=require(_0x8b77('0x0'));var _=require(_0x8b77('0x1'));var moment=require(_0x8b77('0x2'));function getSeconds(_0x1f1110,_0x4d9202){var _0x32221f=moment(_0x1f1110)[_0x8b77('0x3')](0x0);var _0x5bd19a=moment(_0x4d9202)['milliseconds'](0x0);return _0x32221f['diff'](_0x5bd19a,'seconds');}function QueueCallerAbandon(_0xe31ec4,_0x4a399a){this[_0x8b77('0x4')]=_0xe31ec4[_0x8b77('0x4')];this[_0x8b77('0x5')]=_0xe31ec4[_0x8b77('0x5')];this['campaigntype']=_0xe31ec4[_0x8b77('0x5')]==='outbound'?_0x8b77('0x6'):_0xe31ec4['type'];this[_0x8b77('0x7')]=_0xe31ec4[_0x8b77('0x7')];this['countcongestionretry']=_0xe31ec4[_0x8b77('0x8')];this['countnoanswerretry']=_0xe31ec4[_0x8b77('0x9')];this[_0x8b77('0xa')]=_0xe31ec4[_0x8b77('0x7')]+_0xe31ec4[_0x8b77('0x8')]+_0xe31ec4[_0x8b77('0x9')]+_0xe31ec4[_0x8b77('0xb')]+_0xe31ec4[_0x8b77('0xc')]+_0xe31ec4['countabandonedretry']+_0xe31ec4[_0x8b77('0xd')]+_0xe31ec4[_0x8b77('0xe')];this[_0x8b77('0xb')]=_0xe31ec4[_0x8b77('0xb')];this['countdropretry']=_0xe31ec4[_0x8b77('0xc')];this[_0x8b77('0xf')]=_0xe31ec4[_0x8b77('0xf')];this['countmachineretry']=_0xe31ec4[_0x8b77('0xd')];this[_0x8b77('0xe')]=_0xe31ec4['countagentrejectretry'];this[_0x8b77('0x10')]=_0x4a399a[_0x8b77('0x10')];this[_0x8b77('0x11')]=_0xe31ec4[_0x8b77('0x12')];this['calleridnum']=_0xe31ec4['number'];this[_0x8b77('0x13')]=_0xe31ec4[_0x8b77('0x13')];this['responsetime']=_0xe31ec4[_0x8b77('0x14')];this[_0x8b77('0x15')]=_0xe31ec4[_0x8b77('0x15')];this['endtime']=this[_0x8b77('0x15')];this[_0x8b77('0x16')]=getSeconds(_0xe31ec4[_0x8b77('0x14')],_0xe31ec4['starttime']);this['holdtime']=getSeconds(this[_0x8b77('0x15')],_0xe31ec4['responsetime']);this[_0x8b77('0x17')]=0x0;this[_0x8b77('0x6')]=_0x4a399a['queue'];this[_0x8b77('0x18')]=_0x4a399a[_0x8b77('0x19')];this['reason']=_0x4a399a[_0x8b77('0x1a')];this['callback']=_0xe31ec4[_0x8b77('0x1b')];this[_0x8b77('0x1c')]=_0xe31ec4['callbackuniqueid'];this[_0x8b77('0x1d')]=_0xe31ec4[_0x8b77('0x1d')];this[_0x8b77('0x1e')]=_0xe31ec4[_0x8b77('0x1e')];this['ContactId']=_0xe31ec4['ContactId'];this[_0x8b77('0x1f')]=_0xe31ec4[_0x8b77('0x1f')];this[_0x8b77('0x20')]=_0xe31ec4['UserId'];this[_0x8b77('0x21')]=_0xe31ec4['VoiceQueueId'];this[_0x8b77('0x22')]=_0xe31ec4[_0x8b77('0x22')];this[_0x8b77('0x23')]=_0xe31ec4['originatecalleridnum']||'';this['originatecalleridname']=_0xe31ec4[_0x8b77('0x24')]||'';}module[_0x8b77('0x25')]=QueueCallerAbandon; \ No newline at end of file +var _0x14f6=['endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x14f6,0x1c1));var _0x614f=function(_0x22ff2f,_0x4b2fd0){_0x22ff2f=_0x22ff2f-0x0;var _0x3dd6c0=_0x14f6[_0x22ff2f];return _0x3dd6c0;};'use strict';var util=require(_0x614f('0x0'));var _=require(_0x614f('0x1'));var moment=require(_0x614f('0x2'));function getSeconds(_0x53873c,_0x40a170){var _0x1cf098=moment(_0x53873c)[_0x614f('0x3')](0x0);var _0x2a6d4c=moment(_0x40a170)['milliseconds'](0x0);return _0x1cf098[_0x614f('0x4')](_0x2a6d4c,'seconds');}function QueueCallerAbandon(_0x22b23a,_0x16dbc9){this[_0x614f('0x5')]=_0x22b23a[_0x614f('0x5')];this['type']=_0x22b23a[_0x614f('0x6')];this[_0x614f('0x7')]=_0x22b23a[_0x614f('0x6')]==='outbound'?'queue':_0x22b23a[_0x614f('0x6')];this[_0x614f('0x8')]=_0x22b23a['countbusyretry'];this[_0x614f('0x9')]=_0x22b23a[_0x614f('0x9')];this[_0x614f('0xa')]=_0x22b23a['countnoanswerretry'];this['countglobal']=_0x22b23a[_0x614f('0x8')]+_0x22b23a[_0x614f('0x9')]+_0x22b23a[_0x614f('0xa')]+_0x22b23a['countnosuchnumberretry']+_0x22b23a[_0x614f('0xb')]+_0x22b23a[_0x614f('0xc')]+_0x22b23a[_0x614f('0xd')]+_0x22b23a[_0x614f('0xe')];this[_0x614f('0xf')]=_0x22b23a[_0x614f('0xf')];this[_0x614f('0xb')]=_0x22b23a[_0x614f('0xb')];this[_0x614f('0xc')]=_0x22b23a[_0x614f('0xc')];this[_0x614f('0xd')]=_0x22b23a[_0x614f('0xd')];this['countagentrejectretry']=_0x22b23a['countagentrejectretry'];this[_0x614f('0x10')]=_0x16dbc9[_0x614f('0x10')];this[_0x614f('0x11')]=_0x22b23a[_0x614f('0x12')];this[_0x614f('0x13')]=_0x22b23a[_0x614f('0x14')];this[_0x614f('0x15')]=_0x22b23a[_0x614f('0x15')];this[_0x614f('0x16')]=_0x22b23a[_0x614f('0x16')];this[_0x614f('0x17')]=_0x22b23a[_0x614f('0x17')];this[_0x614f('0x18')]=this[_0x614f('0x17')];this[_0x614f('0x19')]=getSeconds(_0x22b23a[_0x614f('0x16')],_0x22b23a[_0x614f('0x15')]);this[_0x614f('0x1a')]=getSeconds(this['droptime'],_0x22b23a[_0x614f('0x16')]);this[_0x614f('0x1b')]=0x0;this[_0x614f('0x1c')]=_0x16dbc9['queue'];this[_0x614f('0x1d')]=_0x16dbc9[_0x614f('0x1e')];this['reason']=_0x16dbc9[_0x614f('0x1f')];this[_0x614f('0x20')]=_0x22b23a[_0x614f('0x20')];this[_0x614f('0x21')]=_0x22b23a[_0x614f('0x21')];this['callbackat']=_0x22b23a['callbackat'];this[_0x614f('0x22')]=_0x22b23a[_0x614f('0x22')];this[_0x614f('0x23')]=_0x22b23a[_0x614f('0x23')];this[_0x614f('0x24')]=_0x22b23a['ListId'];this[_0x614f('0x25')]=_0x22b23a[_0x614f('0x25')];this[_0x614f('0x26')]=_0x22b23a['VoiceQueueId'];this[_0x614f('0x27')]=_0x22b23a['CampaignId'];this[_0x614f('0x28')]=_0x22b23a[_0x614f('0x28')]||'';this[_0x614f('0x29')]=_0x22b23a[_0x614f('0x29')]||'';}module[_0x614f('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8f601fa..b2c9ac0 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 _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x44ab30,_0x2ea2b5){var _0x129099=function(_0x54b708){while(--_0x54b708){_0x44ab30['push'](_0x44ab30['shift']());}};_0x129099(++_0x2ea2b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5e2443,_0x18acad){var _0x4ccc3d=function(_0x5a26b0){while(--_0x5a26b0){_0x5e2443['push'](_0x5e2443['shift']());}};_0x4ccc3d(++_0x18acad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('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 b38e93a..cb5b5b3 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 _0xf7b4=['../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','path','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','util','uuid','moment','./util/gs'];(function(_0x180cd5,_0xe57793){var _0x5e599f=function(_0x481dfe){while(--_0x481dfe){_0x180cd5['push'](_0x180cd5['shift']());}};_0x5e599f(++_0xe57793);}(_0xf7b4,0x152));var _0x4f7b=function(_0x204799,_0x30711d){_0x204799=_0x204799-0x0;var _0x122717=_0xf7b4[_0x204799];return _0x122717;};'use strict';var util=require(_0x4f7b('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var ami=require(_0x4f7b('0x6'));var rpcDb=require(_0x4f7b('0x7'));var Channel=require(_0x4f7b('0x8'));var ut=require(_0x4f7b('0x9'));var Action=require(_0x4f7b('0xa'));var faxAccount=require(_0x4f7b('0xb'));var attachment=require(_0x4f7b('0xc'));var faxMessage=require(_0x4f7b('0xd'));function Fax(_0x3ef6e1){this[_0x4f7b('0xe')]={};this['faxAccounts']=_0x3ef6e1[_0x4f7b('0xf')];this[_0x4f7b('0x10')]=_0x3ef6e1['trunks'];this[_0x4f7b('0x11')]={};ami['on'](_0x4f7b('0x12'),this[_0x4f7b('0x13')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x15'),this['syncVarSet'][_0x4f7b('0x14')](this));ami['on']('newstate',this['syncNewState'][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x16'),this[_0x4f7b('0x17')][_0x4f7b('0x14')](this));ami['on']('faxstatus',this[_0x4f7b('0x18')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x19'),this[_0x4f7b('0x1a')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x1b'),this[_0x4f7b('0x1c')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x1d'),this[_0x4f7b('0x1e')][_0x4f7b('0x14')](this));}Fax[_0x4f7b('0x1f')]['syncNewchannel']=function(_0x372ea5){if(_0x372ea5['context']==='from-voip-provider'){for(var _0x24e5cf in this[_0x4f7b('0xf')]){if(this['faxAccounts'][_0x4f7b('0x20')](_0x24e5cf)){if(_0x372ea5[_0x4f7b('0x21')]===this[_0x4f7b('0xf')][_0x24e5cf][_0x4f7b('0x22')]){this['channels'][_0x372ea5[_0x4f7b('0x23')]]={};this['channels'][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x24')]=_0x372ea5[_0x4f7b('0x24')];this[_0x4f7b('0xe')][_0x372ea5[_0x4f7b('0x23')]]['id']=this[_0x4f7b('0xf')][_0x24e5cf]['id'];this[_0x4f7b('0xe')][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x25')]=this['faxAccounts'][_0x24e5cf][_0x4f7b('0x25')];logger[_0x4f7b('0x26')](_0x372ea5[_0x4f7b('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0x4f7b('0x11')][_0x372ea5[_0x4f7b('0x23')]]){this['channels'][_0x372ea5[_0x4f7b('0x23')]]={};this['channels'][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x24')]=_0x372ea5[_0x4f7b('0x24')];logger[_0x4f7b('0x26')](_0x372ea5[_0x4f7b('0x23')],_0x4f7b('0x27'));}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x28')]=function(_0x4ec9a3){if(this[_0x4f7b('0xe')][_0x4ec9a3[_0x4f7b('0x23')]]){for(var _0x311675 in _0x4ec9a3['variable']){if(_0x4ec9a3[_0x4f7b('0x29')][_0x4f7b('0x20')](_0x311675)){this[_0x4f7b('0xe')][_0x4ec9a3[_0x4f7b('0x23')]][_0x311675]=_0x4ec9a3[_0x4f7b('0x2a')];}}}};Fax['prototype'][_0x4f7b('0x2b')]=function(_0x3331b2){if(this[_0x4f7b('0xe')][_0x3331b2['uniqueid']]){this[_0x4f7b('0xe')][_0x3331b2['uniqueid']]['channelstate']=_0x3331b2[_0x4f7b('0x2c')];this['channels'][_0x3331b2[_0x4f7b('0x23')]][_0x4f7b('0x2d')]=_0x3331b2[_0x4f7b('0x2d')];}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x17')]=function(_0x4e5862){if(this[_0x4f7b('0xe')][_0x4e5862[_0x4f7b('0x23')]]){for(var _0xba46b8 in _0x4e5862[_0x4f7b('0x29')]){if(_0x4e5862[_0x4f7b('0x29')][_0x4f7b('0x20')](_0xba46b8)){this[_0x4f7b('0xe')][_0x4e5862[_0x4f7b('0x23')]][_0xba46b8]=_0x4e5862[_0x4f7b('0x2a')];}}}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x18')]=function(_0x42bf33){if(this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]]){this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]]['operation']=_0x42bf33[_0x4f7b('0x2e')];this['channels'][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x2f')]=_0x42bf33['status'];this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x22')]=_0x42bf33['localstationid'];this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x30')]=_0x42bf33[_0x4f7b('0x30')];logger[_0x4f7b('0x26')](_0x42bf33[_0x4f7b('0x23')],_0x4f7b('0x31'));}};Fax['prototype'][_0x4f7b('0x1a')]=function(_0x486187){var _0x26fe5b=this;if(this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]]){var _0x593ec2=this[_0x4f7b('0xe')][_0x486187['uniqueid']]['id'];this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]]['remotestationid']=_0x486187['remotestationid'];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x32')]=_0x486187[_0x4f7b('0x32')];this['channels'][_0x486187[_0x4f7b('0x23')]]['localstationid']=_0x486187['localstationid'];this['channels'][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x33')]=_0x486187[_0x4f7b('0x33')];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x34')]=_0x486187['transferrate'];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x30')]=_0x486187['filename'];this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x35')]=_0x486187[_0x4f7b('0x35')];if(this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x32')]>0x0){tiff2pdf(_0x486187[_0x4f7b('0x30')],_0x4f7b('0x36'),function(_0x1ed520){logger[_0x4f7b('0x26')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x37'),_0x1ed520[_0x4f7b('0x38')]);attachment[_0x4f7b('0x39')]({'name':path[_0x4f7b('0x3a')](_0x486187[_0x4f7b('0x30')])[_0x4f7b('0x25')],'basename':path['parse'](_0x486187['filename'])[_0x4f7b('0x25')]+_0x4f7b('0x3b'),'type':_0x4f7b('0x3c')})[_0x4f7b('0x3d')](function(_0x5bd517){faxAccount['notify'](_0x593ec2,{'from':_0x486187[_0x4f7b('0x35')],'mapKey':_0x4f7b('0x5'),'body':path[_0x4f7b('0x3a')](_0x486187[_0x4f7b('0x30')])['name']+'.pdf','AttachmentId':_0x5bd517['id']})[_0x4f7b('0x3e')](function(_0x201c2e){logger[_0x4f7b('0x3f')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x40'),JSON['stringify'](_0x201c2e));});})[_0x4f7b('0x3e')](function(_0x186e47){logger[_0x4f7b('0x3f')](_0x486187['uniqueid'],_0x4f7b('0x41'),JSON[_0x4f7b('0x42')](_0x186e47));});});}logger[_0x4f7b('0x26')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x41'));}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x1e')]=function(_0x2e563f){if(this[_0x4f7b('0x11')][_0x2e563f[_0x4f7b('0x23')]]){_['merge'](this[_0x4f7b('0xe')][_0x2e563f[_0x4f7b('0x23')]],_[_0x4f7b('0x43')](_0x2e563f,['response',_0x4f7b('0x44')]));}};function updateStatus(_0x3faadf){if(_0x3faadf[_0x4f7b('0x45')]){faxMessage[_0x4f7b('0x46')](_0x3faadf[_0x4f7b('0x45')],{'failMessage':_0x4f7b('0x47')})[_0x4f7b('0x3d')](function(_0x141897){ut[_0x4f7b('0x48')](_0x4f7b('0x49'),_0x141897);})['catch'](function(_0x21fa9c){ut[_0x4f7b('0x48')](_0x4f7b('0x4a'),_0x21fa9c);});}else{ut['logger'](_0x4f7b('0x4b'));}}Fax[_0x4f7b('0x1f')][_0x4f7b('0x4c')]=function(_0xb92819,_0x3437a8,_0x819fb3){var _0x551c74=this;var _0x2de413={};if(_0x3437a8){_0x2de413={'read':_0x3437a8};}else{_0x2de413={'failMessage':_0x819fb3};}if(this[_0x4f7b('0x11')][_0xb92819][_0x4f7b('0x45')]){faxMessage['update'](this[_0x4f7b('0x11')][_0xb92819][_0x4f7b('0x45')],_0x2de413)[_0x4f7b('0x3d')](function(_0x3fb0d5){ut[_0x4f7b('0x48')](_0x4f7b('0x4d'),_0x3fb0d5);})['catch'](function(_0x13bb98){ut['logger']('[Fax][Message][NoUpdate1]',_0x13bb98);})['finally'](function(){delete _0x551c74[_0x4f7b('0xe')][_0xb92819];delete _0x551c74[_0x4f7b('0x11')][_0xb92819];});}else{ut[_0x4f7b('0x48')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0xb92819];delete this[_0x4f7b('0x11')][_0xb92819];}};Fax[_0x4f7b('0x1f')]['syncHangup']=function(_0xf957ca){var _0x3b0633=this;if(this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]){if(this['actions'][_0xf957ca[_0x4f7b('0x23')]]){this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['id']=this[_0x4f7b('0x11')][_0xf957ca[_0x4f7b('0x23')]]['id'];this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['name']=this['actions'][_0xf957ca['uniqueid']][_0x4f7b('0x25')];}logger['info'](_0xf957ca['uniqueid'],this['actions'][_0xf957ca['uniqueid']]?_0x4f7b('0x4e'):_0x4f7b('0x4f'),JSON[_0x4f7b('0x42')](this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]));if(this[_0x4f7b('0x11')][_0xf957ca[_0x4f7b('0x23')]]){if(this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x50')]>0x0&&this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x51')]===_0x4f7b('0x52')){this[_0x4f7b('0x4c')](_0xf957ca[_0x4f7b('0x23')],!![]);}else{this[_0x4f7b('0x4c')](_0xf957ca[_0x4f7b('0x23')],![],this['channels'][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x53')]?_0x4f7b('0x54')+this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x4f7b('0x1f')]['send']=function(_0x457ac5){var _0x384a08=this;return new BPromise(function(_0x167e9,_0x7509ab){_0x384a08['execOriginate'](_0x457ac5,_0x384a08[_0x4f7b('0xf')][_0x457ac5[_0x4f7b('0x55')]])[_0x4f7b('0x3d')](function(_0x58baa5){ut['logger']('[Fax][execOriginate][success]',_0x58baa5);_0x167e9(ut[_0x4f7b('0x38')]('Fax\x20received'));})['catch'](function(_0x4b33f5){ut[_0x4f7b('0x48')](_0x4f7b('0x56'),_0x4b33f5);updateStatus(_0x457ac5);_0x7509ab(ut[_0x4f7b('0x38')]('Fax\x20failed'));});});};Fax[_0x4f7b('0x1f')][_0x4f7b('0x57')]=function(_0x56b3c7){var _0x57874c=this;return new BPromise(function(_0x1911e1,_0x431857){var _0xa2017d=_0x57874c[_0x4f7b('0x58')](_0x57874c['faxAccounts'][_0x56b3c7[_0x4f7b('0x55')]][_0x4f7b('0x59')],_0x56b3c7);if(_0xa2017d[_0x4f7b('0x5a')]){_0x1911e1(ut[_0x4f7b('0x38')](_0x4f7b('0x5b')));}else{_0x431857(ut[_0x4f7b('0x38')](_0xa2017d['message']));}});};function originate(_0x1fa0fd,_0x79deaa,_0xa10c21){return new BPromise(function(_0x220f21,_0x1ca442){if(_0xa10c21){var _0x509763=util['format']('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',path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x25')],_0x1fa0fd[_0x4f7b('0x5c')]);gs[_0x4f7b('0x5d')](_0x509763)['then'](function(){_0x1fa0fd[_0x4f7b('0x5c')]=util[_0x4f7b('0x5e')](_0x4f7b('0x5f'),path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x60')],path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x25')]);_0x79deaa[_0x4f7b('0x61')]=_0x1fa0fd[_0x4f7b('0x5c')];ut[_0x4f7b('0x48')](_0x4f7b('0x62'),'');ami[_0x4f7b('0x63')](ut[_0x4f7b('0x64')](_0x1fa0fd,_0x79deaa))[_0x4f7b('0x3d')](function(_0xcb5f7e){_0x220f21(_0xcb5f7e);})[_0x4f7b('0x3e')](function(_0x531da6){_0x1ca442(_0x531da6);});})['catch'](function(_0x228029){_0x1ca442(_0x228029);});}else{ami[_0x4f7b('0x63')](ut[_0x4f7b('0x64')](_0x1fa0fd,_0x79deaa))[_0x4f7b('0x3d')](function(_0x503464){_0x220f21(_0x503464);})[_0x4f7b('0x3e')](function(_0x246aa6){_0x1ca442(_0x246aa6);});}});}Fax[_0x4f7b('0x1f')][_0x4f7b('0x65')]=function(_0x6989d1,_0x378587){var _0x3f4f5c=this;return new BPromise(function(_0x35d18a,_0x3ddd33){var _0x13f190=uuid['v4']();var _0x1ccec2=ut[_0x4f7b('0x66')](_0x6989d1,_0x378587);_0x3f4f5c[_0x4f7b('0x11')][_0x13f190]=new Action(_0x13f190,_0x378587,_0x6989d1);var _0x278d72=_0x3f4f5c[_0x4f7b('0x11')][_0x13f190];if(path['parse'](_0x6989d1[_0x4f7b('0x5c')])[_0x4f7b('0x67')]==='.pdf'){originate(_0x278d72,_0x1ccec2,!![])['then'](function(_0x45aced){_0x35d18a(_0x45aced);})[_0x4f7b('0x3e')](function(_0x3d25a6){_0x3ddd33(_0x3d25a6);});}else{originate(_0x278d72,_0x1ccec2,![])[_0x4f7b('0x3d')](function(_0x40e009){_0x35d18a(_0x40e009);})[_0x4f7b('0x3e')](function(_0x1f7692){_0x3ddd33(_0x1f7692);});}});};Fax['prototype']['isTrunkReachable']=function(_0x42bd6b){return!_[_0x4f7b('0x68')](_0x42bd6b)&&!_[_0x4f7b('0x68')](_0x42bd6b[_0x4f7b('0x25')])&&!_['isNil'](_0x42bd6b[_0x4f7b('0x69')])&&_0x42bd6b[_0x4f7b('0x69')]&&!_['isNil'](this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')]('SIP/%s',_0x42bd6b['name'])])&&!_[_0x4f7b('0x68')](this['trunks'][util['format']('SIP/%s',_0x42bd6b[_0x4f7b('0x25')])]['status'])&&(this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')](_0x4f7b('0x6a'),_0x42bd6b[_0x4f7b('0x25')])][_0x4f7b('0x2f')]===_0x4f7b('0x6b')||this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')](_0x4f7b('0x6a'),_0x42bd6b['name'])][_0x4f7b('0x2f')]===_0x4f7b('0x6c'));};Fax[_0x4f7b('0x1f')][_0x4f7b('0x58')]=function(_0x3c36ce,_0x154343){if(!this[_0x4f7b('0x6d')](_0x3c36ce)){ut[_0x4f7b('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4f7b('0x68')](_0x3c36ce)?'':_0x3c36ce[_0x4f7b('0x25')]+_0x4f7b('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x4f7b('0x68')](_0x154343['fax'])){ut[_0x4f7b('0x48')](_0x4f7b('0x6f'),JSON['stringify'](_0x154343));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x4f7b('0x68')](_0x154343['path'])){ut[_0x4f7b('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x4f7b('0x42')](_0x154343));return{'isValid':![],'message':_0x4f7b('0x70')};}return{'isValid':!![],'message':_0x4f7b('0x71')};};module['exports']=Fax; \ No newline at end of file +var _0x69d3=['syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','syncOriginateResponse','prototype','context','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','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','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','../../../config/logger','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','syncNewState'];(function(_0xbf400c,_0x37e1e7){var _0x2ee697=function(_0x3c2668){while(--_0x3c2668){_0xbf400c['push'](_0xbf400c['shift']());}};_0x2ee697(++_0x37e1e7);}(_0x69d3,0xda));var _0x369d=function(_0x5ed841,_0x3d5adc){_0x5ed841=_0x5ed841-0x0;var _0x4ea5fa=_0x69d3[_0x5ed841];return _0x4ea5fa;};'use strict';var util=require(_0x369d('0x0'));var _=require(_0x369d('0x1'));var BPromise=require(_0x369d('0x2'));var uuid=require('uuid');var moment=require(_0x369d('0x3'));var path=require(_0x369d('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x369d('0x5'))('fax');var ami=require('../ami');var rpcDb=require(_0x369d('0x6'));var Channel=require(_0x369d('0x7'));var ut=require(_0x369d('0x8'));var Action=require(_0x369d('0x9'));var faxAccount=require(_0x369d('0xa'));var attachment=require(_0x369d('0xb'));var faxMessage=require(_0x369d('0xc'));function Fax(_0x2ac0ec){this[_0x369d('0xd')]={};this['faxAccounts']=_0x2ac0ec['faxAccounts'];this[_0x369d('0xe')]=_0x2ac0ec[_0x369d('0xe')];this[_0x369d('0xf')]={};ami['on'](_0x369d('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0x369d('0x11'),this[_0x369d('0x12')][_0x369d('0x13')](this));ami['on'](_0x369d('0x14'),this[_0x369d('0x15')][_0x369d('0x13')](this));ami['on']('newexten',this[_0x369d('0x16')][_0x369d('0x13')](this));ami['on'](_0x369d('0x17'),this[_0x369d('0x18')][_0x369d('0x13')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x369d('0x19'),this[_0x369d('0x1a')][_0x369d('0x13')](this));ami['on']('originateresponse',this[_0x369d('0x1b')][_0x369d('0x13')](this));}Fax[_0x369d('0x1c')]['syncNewchannel']=function(_0x368c05){if(_0x368c05[_0x369d('0x1d')]==='from-voip-provider'){for(var _0x572513 in this['faxAccounts']){if(this[_0x369d('0x1e')][_0x369d('0x1f')](_0x572513)){if(_0x368c05[_0x369d('0x20')]===this['faxAccounts'][_0x572513][_0x369d('0x21')]){this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]={};this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]['channel']=_0x368c05[_0x369d('0x23')];this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]['id']=this[_0x369d('0x1e')][_0x572513]['id'];this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]][_0x369d('0x24')]=this[_0x369d('0x1e')][_0x572513]['name'];logger['info'](_0x368c05[_0x369d('0x22')],_0x369d('0x25'));}}}}if(this[_0x369d('0xf')][_0x368c05[_0x369d('0x22')]]){this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]={};this[_0x369d('0xd')][_0x368c05['uniqueid']]['channel']=_0x368c05[_0x369d('0x23')];logger[_0x369d('0x26')](_0x368c05[_0x369d('0x22')],_0x369d('0x25'));}};Fax[_0x369d('0x1c')][_0x369d('0x12')]=function(_0x8090b0){if(this['channels'][_0x8090b0[_0x369d('0x22')]]){for(var _0xe95742 in _0x8090b0[_0x369d('0x27')]){if(_0x8090b0[_0x369d('0x27')][_0x369d('0x1f')](_0xe95742)){this[_0x369d('0xd')][_0x8090b0[_0x369d('0x22')]][_0xe95742]=_0x8090b0['value'];}}}};Fax[_0x369d('0x1c')]['syncNewState']=function(_0x57b94c){if(this[_0x369d('0xd')][_0x57b94c[_0x369d('0x22')]]){this['channels'][_0x57b94c[_0x369d('0x22')]]['channelstate']=_0x57b94c[_0x369d('0x28')];this[_0x369d('0xd')][_0x57b94c[_0x369d('0x22')]][_0x369d('0x29')]=_0x57b94c[_0x369d('0x29')];}};Fax[_0x369d('0x1c')][_0x369d('0x16')]=function(_0x47f60c){if(this[_0x369d('0xd')][_0x47f60c[_0x369d('0x22')]]){for(var _0x219faf in _0x47f60c[_0x369d('0x27')]){if(_0x47f60c[_0x369d('0x27')][_0x369d('0x1f')](_0x219faf)){this[_0x369d('0xd')][_0x47f60c[_0x369d('0x22')]][_0x219faf]=_0x47f60c['value'];}}}};Fax[_0x369d('0x1c')][_0x369d('0x18')]=function(_0x376abf){if(this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]]){this['channels'][_0x376abf[_0x369d('0x22')]][_0x369d('0x2a')]=_0x376abf[_0x369d('0x2a')];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x2b')]=_0x376abf['status'];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x21')]=_0x376abf[_0x369d('0x21')];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x2c')]=_0x376abf[_0x369d('0x2c')];logger[_0x369d('0x26')](_0x376abf[_0x369d('0x22')],_0x369d('0x2d'));}};Fax[_0x369d('0x1c')][_0x369d('0x2e')]=function(_0x43d734){var _0x56922d=this;if(this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]]){var _0x69c7af=this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]]['id'];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x2f')]=_0x43d734[_0x369d('0x2f')];this['channels'][_0x43d734['uniqueid']][_0x369d('0x30')]=_0x43d734[_0x369d('0x30')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x21')]=_0x43d734[_0x369d('0x21')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x31')]=_0x43d734['resolution'];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x32')]=_0x43d734[_0x369d('0x32')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x2c')]=_0x43d734[_0x369d('0x2c')];this['channels'][_0x43d734['uniqueid']][_0x369d('0x33')]=_0x43d734[_0x369d('0x33')];if(this[_0x369d('0xd')][_0x43d734['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x43d734['filename'],_0x369d('0x34'),function(_0x6e8477){logger['info'](_0x43d734[_0x369d('0x22')],_0x369d('0x35'),_0x6e8477[_0x369d('0x36')]);attachment[_0x369d('0x37')]({'name':path['parse'](_0x43d734[_0x369d('0x2c')])['name'],'basename':path[_0x369d('0x38')](_0x43d734['filename'])[_0x369d('0x24')]+_0x369d('0x39'),'type':_0x369d('0x3a')})['then'](function(_0x4e5df6){faxAccount[_0x369d('0x3b')](_0x69c7af,{'from':_0x43d734[_0x369d('0x33')],'mapKey':_0x369d('0x3c'),'body':path['parse'](_0x43d734[_0x369d('0x2c')])[_0x369d('0x24')]+_0x369d('0x39'),'AttachmentId':_0x4e5df6['id']})[_0x369d('0x3d')](function(_0x34e2e4){logger[_0x369d('0x3e')](_0x43d734[_0x369d('0x22')],_0x369d('0x3f'),JSON[_0x369d('0x40')](_0x34e2e4));});})['catch'](function(_0x11ce32){logger[_0x369d('0x3e')](_0x43d734[_0x369d('0x22')],_0x369d('0x41'),JSON[_0x369d('0x40')](_0x11ce32));});});}logger[_0x369d('0x26')](_0x43d734['uniqueid'],_0x369d('0x41'));}};Fax[_0x369d('0x1c')][_0x369d('0x1b')]=function(_0x44a357){if(this[_0x369d('0xf')][_0x44a357[_0x369d('0x22')]]){_[_0x369d('0x42')](this[_0x369d('0xd')][_0x44a357[_0x369d('0x22')]],_[_0x369d('0x43')](_0x44a357,[_0x369d('0x44'),_0x369d('0x45')]));}};function updateStatus(_0x573774){if(_0x573774[_0x369d('0x46')]){faxMessage[_0x369d('0x47')](_0x573774[_0x369d('0x46')],{'failMessage':_0x369d('0x48')})[_0x369d('0x49')](function(_0x4b41e5){ut[_0x369d('0x4a')]('[Fax][Message][Error][Updated]',_0x4b41e5);})[_0x369d('0x3d')](function(_0x2709f7){ut[_0x369d('0x4a')](_0x369d('0x4b'),_0x2709f7);});}else{ut[_0x369d('0x4a')](_0x369d('0x4c'));}}Fax[_0x369d('0x1c')][_0x369d('0x4d')]=function(_0x1cdeca,_0x9f1544,_0x4d582a){var _0x5a3dd4=this;var _0x203750={};if(_0x9f1544){_0x203750={'read':_0x9f1544};}else{_0x203750={'failMessage':_0x4d582a};}if(this[_0x369d('0xf')][_0x1cdeca][_0x369d('0x46')]){faxMessage[_0x369d('0x47')](this[_0x369d('0xf')][_0x1cdeca]['AttachmentId'],_0x203750)['then'](function(_0x4215ff){ut[_0x369d('0x4a')]('[Fax][Message][Updated]',_0x4215ff);})[_0x369d('0x3d')](function(_0x49c3b5){ut[_0x369d('0x4a')](_0x369d('0x4e'),_0x49c3b5);})[_0x369d('0x4f')](function(){delete _0x5a3dd4['channels'][_0x1cdeca];delete _0x5a3dd4[_0x369d('0xf')][_0x1cdeca];});}else{ut[_0x369d('0x4a')](_0x369d('0x50'));delete this[_0x369d('0xd')][_0x1cdeca];delete this['actions'][_0x1cdeca];}};Fax['prototype'][_0x369d('0x1a')]=function(_0x476ee8){var _0x35667d=this;if(this['channels'][_0x476ee8[_0x369d('0x22')]]){if(this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]]){this['channels'][_0x476ee8['uniqueid']]['id']=this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]]['id'];this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]]['name']=this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]][_0x369d('0x24')];}logger[_0x369d('0x26')](_0x476ee8[_0x369d('0x22')],this['actions'][_0x476ee8[_0x369d('0x22')]]?_0x369d('0x51'):_0x369d('0x52'),JSON['stringify'](this[_0x369d('0xd')][_0x476ee8['uniqueid']]));if(this[_0x369d('0xf')][_0x476ee8['uniqueid']]){if(this['channels'][_0x476ee8['uniqueid']]['faxpages']>0x0&&this[_0x369d('0xd')][_0x476ee8['uniqueid']][_0x369d('0x17')]==='SUCCESS'){this[_0x369d('0x4d')](_0x476ee8[_0x369d('0x22')],!![]);}else{this[_0x369d('0x4d')](_0x476ee8['uniqueid'],![],this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]][_0x369d('0x53')]?_0x369d('0x54')+this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]]['faxstatusstring']:_0x369d('0x55'));}}}};Fax['prototype']['send']=function(_0x56c98e){var _0x36e990=this;return new BPromise(function(_0xab8c70,_0xde27de){_0x36e990[_0x369d('0x56')](_0x56c98e,_0x36e990[_0x369d('0x1e')][_0x56c98e[_0x369d('0x57')]])[_0x369d('0x49')](function(_0x3fe68c){ut[_0x369d('0x4a')](_0x369d('0x58'),_0x3fe68c);_0xab8c70(ut[_0x369d('0x36')](_0x369d('0x59')));})[_0x369d('0x3d')](function(_0x7ba3e5){ut[_0x369d('0x4a')](_0x369d('0x5a'),_0x7ba3e5);updateStatus(_0x56c98e);_0xde27de(ut['message'](_0x369d('0x5b')));});});};Fax['prototype'][_0x369d('0x5c')]=function(_0x2ecc06){var _0x2492fb=this;return new BPromise(function(_0x38efd7,_0x23dcd9){var _0x561331=_0x2492fb[_0x369d('0x5d')](_0x2492fb['faxAccounts'][_0x2ecc06['FaxAccountId']][_0x369d('0x5e')],_0x2ecc06);if(_0x561331[_0x369d('0x5f')]){_0x38efd7(ut[_0x369d('0x36')](_0x369d('0x60')));}else{_0x23dcd9(ut[_0x369d('0x36')](_0x561331[_0x369d('0x36')]));}});};function originate(_0x341d93,_0x11ac7d,_0x55a811){return new BPromise(function(_0x461782,_0x24e70d){if(_0x55a811){var _0x4c741d=util[_0x369d('0x61')](_0x369d('0x62'),path[_0x369d('0x38')](_0x341d93['path'])[_0x369d('0x24')],_0x341d93['path']);gs[_0x369d('0x63')](_0x4c741d)[_0x369d('0x49')](function(){_0x341d93[_0x369d('0x4')]=util[_0x369d('0x61')](_0x369d('0x64'),path[_0x369d('0x38')](_0x341d93[_0x369d('0x4')])['dir'],path[_0x369d('0x38')](_0x341d93[_0x369d('0x4')])['name']);_0x11ac7d[_0x369d('0x65')]=_0x341d93['path'];ut[_0x369d('0x4a')](_0x369d('0x66'),'');ami[_0x369d('0x67')](ut['variablesAction'](_0x341d93,_0x11ac7d))[_0x369d('0x49')](function(_0x2cbe15){_0x461782(_0x2cbe15);})['catch'](function(_0x8740ed){_0x24e70d(_0x8740ed);});})[_0x369d('0x3d')](function(_0xb94d21){_0x24e70d(_0xb94d21);});}else{ami['Action'](ut[_0x369d('0x68')](_0x341d93,_0x11ac7d))[_0x369d('0x49')](function(_0x3db9b9){_0x461782(_0x3db9b9);})[_0x369d('0x3d')](function(_0x46c137){_0x24e70d(_0x46c137);});}});}Fax['prototype'][_0x369d('0x56')]=function(_0xa05657,_0x45fadd){var _0x4560d8=this;return new BPromise(function(_0x1e0a41,_0x5ebc42){var _0x586972=uuid['v4']();var _0x3c8615=ut[_0x369d('0x69')](_0xa05657,_0x45fadd);_0x4560d8[_0x369d('0xf')][_0x586972]=new Action(_0x586972,_0x45fadd,_0xa05657);var _0x11b348=_0x4560d8[_0x369d('0xf')][_0x586972];if(path[_0x369d('0x38')](_0xa05657['path'])[_0x369d('0x6a')]===_0x369d('0x39')){originate(_0x11b348,_0x3c8615,!![])['then'](function(_0x6c8235){_0x1e0a41(_0x6c8235);})['catch'](function(_0x4936eb){_0x5ebc42(_0x4936eb);});}else{originate(_0x11b348,_0x3c8615,![])['then'](function(_0x2b791a){_0x1e0a41(_0x2b791a);})[_0x369d('0x3d')](function(_0x5b2c2f){_0x5ebc42(_0x5b2c2f);});}});};Fax[_0x369d('0x1c')]['isTrunkReachable']=function(_0x26faf4){return!_['isNil'](_0x26faf4)&&!_['isNil'](_0x26faf4[_0x369d('0x24')])&&!_[_0x369d('0x6b')](_0x26faf4[_0x369d('0x6c')])&&_0x26faf4[_0x369d('0x6c')]&&!_[_0x369d('0x6b')](this['trunks'][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])])&&!_[_0x369d('0x6b')](this[_0x369d('0xe')][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')])&&(this['trunks'][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')]==='reachable'||this[_0x369d('0xe')][util['format'](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')]===_0x369d('0x6e'));};Fax[_0x369d('0x1c')][_0x369d('0x5d')]=function(_0x3fa663,_0x3582fe){if(!this[_0x369d('0x6f')](_0x3fa663)){ut[_0x369d('0x4a')](_0x369d('0x70'),_[_0x369d('0x6b')](_0x3fa663)?'':_0x3fa663[_0x369d('0x24')]+_0x369d('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x369d('0x6b')](_0x3582fe['fax'])){ut['logger'](_0x369d('0x72'),JSON[_0x369d('0x40')](_0x3582fe));return{'isValid':![],'message':_0x369d('0x73')};}if(_[_0x369d('0x6b')](_0x3582fe[_0x369d('0x4')])){ut[_0x369d('0x4a')](_0x369d('0x74'),JSON[_0x369d('0x40')](_0x3582fe));return{'isValid':![],'message':_0x369d('0x75')};}return{'isValid':!![],'message':_0x369d('0x76')};};module[_0x369d('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 36a5dfc..21b89d0 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 _0x5be6=['preview','lodash','../rpc/faxAccount','error','inspect','notify','then','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x1fb2b8,_0x132168){var _0x2ad125=function(_0x465157){while(--_0x465157){_0x1fb2b8['push'](_0x1fb2b8['shift']());}};_0x2ad125(++_0x132168);}(_0x5be6,0x1aa));var _0x65be=function(_0x2748d3,_0x1a74c8){_0x2748d3=_0x2748d3-0x0;var _0x3472d6=_0x5be6[_0x2748d3];return _0x3472d6;};'use strict';var util=require(_0x65be('0x0'));var BPromise=require(_0x65be('0x1'));var logger=require(_0x65be('0x2'))(_0x65be('0x3'));var _=require(_0x65be('0x4'));var faxAccount=require(_0x65be('0x5'));function loggerCatch(_0x997e0f){return function(_0x583f8d){logger[_0x65be('0x6')](_0x997e0f,util[_0x65be('0x7')](_0x583f8d,{'showHidden':![],'depth':null}));};}exports[_0x65be('0x8')]=function(_0x28803e,_0x5a4e1a){return BPromise['resolve']()[_0x65be('0x9')](faxAccount[_0x65be('0x8')](_0x28803e,_0x5a4e1a))['catch'](loggerCatch(_0x65be('0xa')));}; \ No newline at end of file +var _0xd20d=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd20d,0x123));var _0xdd20=function(_0x3a33f5,_0x296b4e){_0x3a33f5=_0x3a33f5-0x0;var _0x205a56=_0xd20d[_0x3a33f5];return _0x205a56;};'use strict';var util=require(_0xdd20('0x0'));var BPromise=require(_0xdd20('0x1'));var logger=require(_0xdd20('0x2'))('preview');var _=require(_0xdd20('0x3'));var faxAccount=require(_0xdd20('0x4'));function loggerCatch(_0x55807b){return function(_0x523a0){logger[_0xdd20('0x5')](_0x55807b,util[_0xdd20('0x6')](_0x523a0,{'showHidden':![],'depth':null}));};}exports[_0xdd20('0x7')]=function(_0x8338af,_0x48faaf){return BPromise[_0xdd20('0x8')]()[_0xdd20('0x9')](faxAccount[_0xdd20('0x7')](_0x8338af,_0x48faaf))[_0xdd20('0xa')](loggerCatch(_0xdd20('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 84943e4..56a4c2d 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 _0x9761=['../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x9761,0x121));var _0x1976=function(_0x5ba1a4,_0x372c8c){_0x5ba1a4=_0x5ba1a4-0x0;var _0x826504=_0x9761[_0x5ba1a4];return _0x826504;};'use strict';var util=require(_0x1976('0x0'));var logger=require(_0x1976('0x1'))(_0x1976('0x2'));var BPromise=require(_0x1976('0x3'));var exec=require(_0x1976('0x4'))['exec'];exports[_0x1976('0x5')]=function(_0x17b4a2){return new BPromise(function(_0x516b50,_0x232149){exec(_0x17b4a2,function(_0x53f738,_0x947d1a,_0x450d6b){logger['info']('Exec\x20gs',_0x947d1a);if(_0x53f738){logger[_0x1976('0x6')](_0x1976('0x7'),_0x1976('0x8'),util[_0x1976('0x9')](_0x53f738,{'showHidden':![],'depth':null}),_0x947d1a,_0x450d6b);_0x232149(_0x53f738);}_0x516b50(_0x947d1a);});});}; \ No newline at end of file +var _0x37fd=['../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','util'];(function(_0x287fe0,_0x3a4b91){var _0x591669=function(_0x27da45){while(--_0x27da45){_0x287fe0['push'](_0x287fe0['shift']());}};_0x591669(++_0x3a4b91);}(_0x37fd,0x7d));var _0xd37f=function(_0x140d2f,_0x2ad576){_0x140d2f=_0x140d2f-0x0;var _0x1a04c6=_0x37fd[_0x140d2f];return _0x1a04c6;};'use strict';var util=require(_0xd37f('0x0'));var logger=require(_0xd37f('0x1'))(_0xd37f('0x2'));var BPromise=require(_0xd37f('0x3'));var exec=require(_0xd37f('0x4'))['exec'];exports[_0xd37f('0x5')]=function(_0x1ca1f4){return new BPromise(function(_0x4032dc,_0x55fc5b){exec(_0x1ca1f4,function(_0x19242c,_0x110dc2,_0x30aa50){logger[_0xd37f('0x6')](_0xd37f('0x7'),_0x110dc2);if(_0x19242c){logger[_0xd37f('0x6')](_0xd37f('0x7'),_0xd37f('0x8'),util['inspect'](_0x19242c,{'showHidden':![],'depth':null}),_0x110dc2,_0x30aa50);_0x55fc5b(_0x19242c);}_0x4032dc(_0x110dc2);});});}; \ 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 287905c..304881d 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 _0x3dae=['maxrate','format','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','fax','message','logger','info','inspect','addVariables','headerinfo','minrate'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3dae,0x1d8));var _0xe3da=function(_0x22affd,_0x4aee0d){_0x22affd=_0x22affd-0x0;var _0x200951=_0x3dae[_0x22affd];return _0x200951;};'use strict';var util=require(_0xe3da('0x0'));var _=require(_0xe3da('0x1'));var moment=require(_0xe3da('0x2'));var logger=require('../../../../config/logger')(_0xe3da('0x3'));exports[_0xe3da('0x4')]=function(_0x46dd87){return{'message':_0x46dd87};};exports[_0xe3da('0x5')]=function(_0x30a463,_0x3020cc){logger[_0xe3da('0x6')](_0x30a463,util[_0xe3da('0x7')](_0x3020cc,{'showHidden':![],'depth':null}));};exports[_0xe3da('0x8')]=function(_0x2bbe4f,_0x445634){var _0x5acde6={'XMF-ECM':_0x445634['ecm'],'XMF-HEADERINFO':_0x445634[_0xe3da('0x9')],'XMF-MINRATE':_0x445634[_0xe3da('0xa')],'XMF-MAXRATE':_0x445634[_0xe3da('0xb')],'XMF-MODEM':util[_0xe3da('0xc')](_0xe3da('0xd'),_0x445634['modem']),'XMF-GATEWAY':_0x445634['gateway'],'XMF-FAXDETECT':_0x445634[_0xe3da('0xe')],'XMF-T38TIMEOUT':_0x445634[_0xe3da('0xf')],'XMF-LOCALSTATIONID':_0x445634[_0xe3da('0x10')],'XMF-PATH':_0x2bbe4f[_0xe3da('0x11')]};return _0x5acde6;};exports[_0xe3da('0x12')]=function(_0x2872db,_0x26a846){return{'actionid':_0x2872db[_0xe3da('0x13')],'action':_0xe3da('0x14'),'channel':_0x2872db['channel'],'Exten':_0xe3da('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0xe3da('0xc')](_0xe3da('0x16'),_0x2872db[_0xe3da('0x9')]?_0x2872db[_0xe3da('0x9')]:'',_0x2872db[_0xe3da('0x10')]),'variable':_0x26a846,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2872db['uniqueid']};}; \ No newline at end of file +var _0x6469=['t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','moment','../../../../config/logger','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6469,0x110));var _0x9646=function(_0x10cc01,_0x2984bd){_0x10cc01=_0x10cc01-0x0;var _0x465a0e=_0x6469[_0x10cc01];return _0x465a0e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9646('0x0'));var logger=require(_0x9646('0x1'))('fax');exports[_0x9646('0x2')]=function(_0x4bc845){return{'message':_0x4bc845};};exports[_0x9646('0x3')]=function(_0x533696,_0x2fa2fb){logger[_0x9646('0x4')](_0x533696,util[_0x9646('0x5')](_0x2fa2fb,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x215f2e,_0x1ef873){var _0x1ba6ab={'XMF-ECM':_0x1ef873[_0x9646('0x6')],'XMF-HEADERINFO':_0x1ef873[_0x9646('0x7')],'XMF-MINRATE':_0x1ef873[_0x9646('0x8')],'XMF-MAXRATE':_0x1ef873[_0x9646('0x9')],'XMF-MODEM':util[_0x9646('0xa')](_0x9646('0xb'),_0x1ef873[_0x9646('0xc')]),'XMF-GATEWAY':_0x1ef873['gateway'],'XMF-FAXDETECT':_0x1ef873[_0x9646('0xd')],'XMF-T38TIMEOUT':_0x1ef873[_0x9646('0xe')],'XMF-LOCALSTATIONID':_0x1ef873[_0x9646('0xf')],'XMF-PATH':_0x215f2e[_0x9646('0x10')]};return _0x1ba6ab;};exports[_0x9646('0x11')]=function(_0x1e609c,_0x1b7c3f){return{'actionid':_0x1e609c[_0x9646('0x12')],'action':_0x9646('0x13'),'channel':_0x1e609c['channel'],'Exten':_0x9646('0x14'),'Context':_0x9646('0x15'),'Priority':'1','callerid':util[_0x9646('0xa')]('\x22%s\x22\x20<%s>',_0x1e609c['headerinfo']?_0x1e609c['headerinfo']:'',_0x1e609c['localstationid']),'variable':_0x1b7c3f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1e609c['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1617baa..40f60bb 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 _0x8e8e=['getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','[index.js][initParams]','inspect','listen','catch','error','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','getAgents','initAgents','then','getTelephones','getTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts'];(function(_0x27b6f3,_0x310347){var _0x220f54=function(_0x2dda65){while(--_0x2dda65){_0x27b6f3['push'](_0x27b6f3['shift']());}};_0x220f54(++_0x310347);}(_0x8e8e,0x16c));var _0xe8e8=function(_0x549a7c,_0x27b454){_0x549a7c=_0x549a7c-0x0;var _0x1c17f9=_0x8e8e[_0x549a7c];return _0x1c17f9;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require('./server');var Realtime=require(_0xe8e8('0x0'));var Report=require(_0xe8e8('0x1'));var Acw=require('./acw');var Trigger=require(_0xe8e8('0x2'));var Dialer=require(_0xe8e8('0x3'));var Preview=require(_0xe8e8('0x4'));var Fax=require('./fax');var user=require(_0xe8e8('0x5'));var voiceQueue=require(_0xe8e8('0x6'));var voiceQueueReport=require(_0xe8e8('0x7'));var voiceCallReport=require(_0xe8e8('0x8'));var trunk=require(_0xe8e8('0x9'));var trigger=require(_0xe8e8('0xa'));var template=require(_0xe8e8('0xb'));var cmHopperHistory=require(_0xe8e8('0xc'));var campaign=require(_0xe8e8('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xe8e8('0xe'));var zendesk=require(_0xe8e8('0xf'));var salesforce=require(_0xe8e8('0x10'));var sugarcrm=require(_0xe8e8('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xe8e8('0x12'));var vtiger=require(_0xe8e8('0x13'));var freshsales=require(_0xe8e8('0x14'));var servicenow=require(_0xe8e8('0x15'));var dynamics365=require(_0xe8e8('0x16'));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 logger=require(_0xe8e8('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe8e8('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe8e8('0x18')](_0xe8e8('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe8e8('0x1a')]()['then'](user[_0xe8e8('0x1b')]())['then'](realtime[_0xe8e8('0x1c')]())[_0xe8e8('0x1d')](user[_0xe8e8('0x1e')]())['then'](realtime['initTelephones']())[_0xe8e8('0x1d')](trunk[_0xe8e8('0x1f')]())['then'](realtime['initTrunks']())[_0xe8e8('0x1d')](voiceQueue['getVoiceQueues']())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x20')]())[_0xe8e8('0x1d')](trigger['getTriggers']())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x21')]())[_0xe8e8('0x1d')](template[_0xe8e8('0x22')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x23')]())[_0xe8e8('0x1d')](zendesk[_0xe8e8('0x24')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x25')]())[_0xe8e8('0x1d')](salesforce['getSalesforceAccounts']())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x26')]())[_0xe8e8('0x1d')](sugarcrm[_0xe8e8('0x27')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x28')]())['then'](freshdesk[_0xe8e8('0x29')]())['then'](realtime[_0xe8e8('0x2a')]())[_0xe8e8('0x1d')](desk[_0xe8e8('0x2b')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x2c')]())[_0xe8e8('0x1d')](zoho[_0xe8e8('0x2d')]())['then'](realtime[_0xe8e8('0x2e')]())[_0xe8e8('0x1d')](vtiger['getVtigerAccounts']())['then'](realtime[_0xe8e8('0x2f')]())[_0xe8e8('0x1d')](freshsales[_0xe8e8('0x30')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x31')]())[_0xe8e8('0x1d')](servicenow[_0xe8e8('0x32')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x33')]())[_0xe8e8('0x1d')](dynamics365[_0xe8e8('0x34')]())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0xe8e8('0x35')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x36')]())['then'](voiceExtension[_0xe8e8('0x37')]())['then'](realtime[_0xe8e8('0x38')]())[_0xe8e8('0x1d')](faxAccount['getFaxAccounts']())['then'](realtime[_0xe8e8('0x39')]())[_0xe8e8('0x1d')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0xe8e8('0x3a')]())[_0xe8e8('0x1d')](realtime['initVoiceQueueReports']())[_0xe8e8('0x1d')](cmHopperHistory[_0xe8e8('0x3b')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xe8e8('0x1d')](cmHopperHistory[_0xe8e8('0x3c')]())['then'](realtime[_0xe8e8('0x3d')]())['then'](voiceCallReport[_0xe8e8('0x3e')]())[_0xe8e8('0x1d')](realtime[_0xe8e8('0x3f')]())['catch'](function(_0x46148b){logger['error'](_0xe8e8('0x40'),util[_0xe8e8('0x41')](_0x46148b,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe8e8('0x42')](realtime,preview,fax)[_0xe8e8('0x1d')](function(_0x292c37){return initRealtime();})[_0xe8e8('0x1d')](function(){return initParams();})[_0xe8e8('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe8e8('0x43')](function(_0x22bcdf){logger[_0xe8e8('0x44')]('[index.js][main]',util['inspect'](_0x22bcdf,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x99f9=['ami','get','hour','initAgents','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getZohoAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','catch','[index.js][main]','util','moment','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger'];(function(_0x326acc,_0x1b2638){var _0x302fa2=function(_0xe38a75){while(--_0xe38a75){_0x326acc['push'](_0x326acc['shift']());}};_0x302fa2(++_0x1b2638);}(_0x99f9,0x118));var _0x999f=function(_0x49e168,_0x1ba140){_0x49e168=_0x49e168-0x0;var _0xccb8f3=_0x99f9[_0x49e168];return _0xccb8f3;};'use strict';var BPromise=require('bluebird');var util=require(_0x999f('0x0'));var moment=require(_0x999f('0x1'));var server=require('./server');var Realtime=require(_0x999f('0x2'));var Report=require('./report');var Acw=require(_0x999f('0x3'));var Trigger=require(_0x999f('0x4'));var Dialer=require(_0x999f('0x5'));var Preview=require(_0x999f('0x6'));var Fax=require(_0x999f('0x7'));var user=require(_0x999f('0x8'));var voiceQueue=require(_0x999f('0x9'));var voiceQueueReport=require(_0x999f('0xa'));var voiceCallReport=require(_0x999f('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x999f('0xc'));var cmHopperHistory=require(_0x999f('0xd'));var campaign=require(_0x999f('0xe'));var voiceExtension=require(_0x999f('0xf'));var faxAccount=require(_0x999f('0x10'));var zendesk=require(_0x999f('0x11'));var salesforce=require(_0x999f('0x12'));var sugarcrm=require(_0x999f('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x999f('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x999f('0x15'));var freshsales=require(_0x999f('0x16'));var servicenow=require(_0x999f('0x17'));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 logger=require(_0x999f('0x18'))(_0x999f('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x999f('0x1a')](_0x999f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())['then'](realtime[_0x999f('0x1c')]())[_0x999f('0x1d')](user['getTelephones']())[_0x999f('0x1d')](realtime[_0x999f('0x1e')]())[_0x999f('0x1d')](trunk[_0x999f('0x1f')]())[_0x999f('0x1d')](realtime[_0x999f('0x20')]())[_0x999f('0x1d')](voiceQueue[_0x999f('0x21')]())[_0x999f('0x1d')](realtime[_0x999f('0x22')]())['then'](trigger[_0x999f('0x23')]())[_0x999f('0x1d')](realtime[_0x999f('0x24')]())[_0x999f('0x1d')](template[_0x999f('0x25')]())[_0x999f('0x1d')](realtime[_0x999f('0x26')]())[_0x999f('0x1d')](zendesk['getZendeskAccounts']())[_0x999f('0x1d')](realtime[_0x999f('0x27')]())[_0x999f('0x1d')](salesforce[_0x999f('0x28')]())['then'](realtime[_0x999f('0x29')]())[_0x999f('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x999f('0x1d')](realtime[_0x999f('0x2a')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x999f('0x1d')](realtime['initFreshdeskAccounts']())[_0x999f('0x1d')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x999f('0x1d')](zoho[_0x999f('0x2b')]())['then'](realtime['initZohoAccounts']())[_0x999f('0x1d')](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0x999f('0x1d')](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x999f('0x2c')]())[_0x999f('0x1d')](realtime['initServicenowAccounts']())[_0x999f('0x1d')](dynamics365[_0x999f('0x2d')]())[_0x999f('0x1d')](realtime[_0x999f('0x2e')]())[_0x999f('0x1d')](campaign['getCampaigns']())[_0x999f('0x1d')](realtime[_0x999f('0x2f')]())[_0x999f('0x1d')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x999f('0x30')]())['then'](faxAccount[_0x999f('0x31')]())['then'](realtime['initFaxAccounts']())[_0x999f('0x1d')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x999f('0x32')]())[_0x999f('0x1d')](realtime[_0x999f('0x33')]())[_0x999f('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x999f('0x1d')](realtime[_0x999f('0x34')]())[_0x999f('0x1d')](cmHopperHistory[_0x999f('0x35')]())[_0x999f('0x1d')](realtime[_0x999f('0x36')]())[_0x999f('0x1d')](voiceCallReport[_0x999f('0x37')]())['then'](realtime[_0x999f('0x38')]())['catch'](function(_0x1a6afc){logger[_0x999f('0x39')]('[index.js][initParams]',util[_0x999f('0x3a')](_0x1a6afc,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x2ad1c6){return initRealtime();})[_0x999f('0x1d')](function(){return initParams();})[_0x999f('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x999f('0x3b')](function(_0x1bdcfe){logger[_0x999f('0x39')](_0x999f('0x3c'),util[_0x999f('0x3a')](_0x1bdcfe,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3efacb6..bf2b1a5 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x210b26,_0x220e39){var _0x50f135=function(_0x182903){while(--_0x182903){_0x210b26['push'](_0x210b26['shift']());}};_0x50f135(++_0x220e39);}(_0x70e0,0x17b));var _0x070e=function(_0x5ec31a,_0x8ff212){_0x5ec31a=_0x5ec31a-0x0;var _0x3e4d9d=_0x70e0[_0x5ec31a];return _0x3e4d9d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 07895f5..96aec38 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 _0x12d3=['exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x5531b4,_0x4d9d33){var _0x344b6d=function(_0x273879){while(--_0x273879){_0x5531b4['push'](_0x5531b4['shift']());}};_0x344b6d(++_0x4d9d33);}(_0x12d3,0x105));var _0x312d=function(_0xc80cf7,_0x1985cf){_0xc80cf7=_0xc80cf7-0x0;var _0x5b2e7f=_0x12d3[_0xc80cf7];return _0x5b2e7f;};'use strict';function Campaign(_0x3edc1e){this['id']=_0x3edc1e['id']||0x0;this['name']=_0x3edc1e[_0x312d('0x0')]||'';this[_0x312d('0x1')]=_0x3edc1e[_0x312d('0x1')]||_0x312d('0x2');this[_0x312d('0x3')]=0x0;this['temp']=0x0;this[_0x312d('0x4')]=0x0;this[_0x312d('0x5')]=0x0;this[_0x312d('0x6')]='';this[_0x312d('0x7')]=!![];this[_0x312d('0x8')]=_0x3edc1e[_0x312d('0x8')];this[_0x312d('0x9')]=_0x3edc1e[_0x312d('0x9')];this['dialTimezone']=_0x3edc1e[_0x312d('0xa')]||null;this[_0x312d('0xb')]=_0x3edc1e[_0x312d('0xb')]?_0x3edc1e[_0x312d('0xb')]:null;this[_0x312d('0xc')]=_0x3edc1e[_0x312d('0xc')];this[_0x312d('0xd')]=_0x3edc1e[_0x312d('0xd')];this[_0x312d('0xe')]=_0x3edc1e['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x3edc1e[_0x312d('0xf')];this[_0x312d('0x10')]=_0x3edc1e[_0x312d('0x10')];this[_0x312d('0x11')]=_0x3edc1e[_0x312d('0x11')];this[_0x312d('0x12')]=_0x3edc1e[_0x312d('0x12')];this[_0x312d('0x13')]=_0x3edc1e[_0x312d('0x13')];this[_0x312d('0x14')]=_0x3edc1e[_0x312d('0x14')];this['dialGlobalMaxRetry']=_0x3edc1e[_0x312d('0x15')];this[_0x312d('0x16')]=_0x3edc1e[_0x312d('0x16')]||0x3;this[_0x312d('0x17')]=_0x3edc1e[_0x312d('0x17')]||0x96;this[_0x312d('0x18')]=_0x3edc1e['dialDropMaxRetry']||0x3;this[_0x312d('0x19')]=_0x3edc1e[_0x312d('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x3edc1e[_0x312d('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x3edc1e[_0x312d('0x1b')]||0x96;this[_0x312d('0x1c')]=_0x3edc1e[_0x312d('0x1c')]||0x3;this[_0x312d('0x1d')]=_0x3edc1e['dialMachineRetryFrequency']||0x96;this[_0x312d('0x1e')]=_0x3edc1e['dialAgentRejectMaxRetry']||0x3;this[_0x312d('0x1f')]=_0x3edc1e[_0x312d('0x1f')]||0x96;this[_0x312d('0x20')]=_0x3edc1e[_0x312d('0x20')]||_0x312d('0x21');this[_0x312d('0x22')]=_0x3edc1e[_0x312d('0x22')]||undefined;this[_0x312d('0x23')]=_0x3edc1e[_0x312d('0x23')]||undefined;this['dialCutDigit']=_0x3edc1e[_0x312d('0x24')]||undefined;this[_0x312d('0x25')]=_0x3edc1e[_0x312d('0x25')]?_0x3edc1e['TrunkBackup']:undefined;this[_0x312d('0x26')]=_0x3edc1e[_0x312d('0x26')]?_0x3edc1e['Trunk']:undefined;this['Interval']=_0x3edc1e[_0x312d('0x27')]?_0x3edc1e[_0x312d('0x27')]:undefined;this['SquareProject']=_0x3edc1e['SquareProject']?_0x3edc1e[_0x312d('0x28')]:undefined;this[_0x312d('0x29')]=_0x3edc1e[_0x312d('0x28')]?_0x3edc1e[_0x312d('0x28')]['name']:undefined;this['dialAMDActive']=_0x3edc1e['dialAMDActive']||![];this[_0x312d('0x2a')]=_0x3edc1e[_0x312d('0x2a')];this[_0x312d('0x2b')]=_0x3edc1e[_0x312d('0x2b')];this[_0x312d('0x2c')]=_0x3edc1e[_0x312d('0x2c')];this[_0x312d('0x2d')]=_0x3edc1e[_0x312d('0x2d')];this[_0x312d('0x2e')]=_0x3edc1e[_0x312d('0x2e')];this[_0x312d('0x2f')]=_0x3edc1e[_0x312d('0x2f')];this[_0x312d('0x30')]=_0x3edc1e[_0x312d('0x30')];this['dialAMDSilenceThreshold']=_0x3edc1e[_0x312d('0x31')];this[_0x312d('0x32')]=_0x3edc1e[_0x312d('0x32')];}module[_0x312d('0x33')]=Campaign; \ No newline at end of file +var _0x4f1c=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency'];(function(_0x434fee,_0x5ab0a0){var _0x320a46=function(_0x170e79){while(--_0x170e79){_0x434fee['push'](_0x434fee['shift']());}};_0x320a46(++_0x5ab0a0);}(_0x4f1c,0xd9));var _0xc4f1=function(_0x22e2af,_0xb3bb1e){_0x22e2af=_0x22e2af-0x0;var _0x19f455=_0x4f1c[_0x22e2af];return _0x19f455;};'use strict';function Campaign(_0x1d8c4b){this['id']=_0x1d8c4b['id']||0x0;this[_0xc4f1('0x0')]=_0x1d8c4b[_0xc4f1('0x0')]||'';this[_0xc4f1('0x1')]=_0x1d8c4b[_0xc4f1('0x1')]||'campaign';this[_0xc4f1('0x2')]=0x0;this[_0xc4f1('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xc4f1('0x4')]=0x0;this[_0xc4f1('0x5')]='';this[_0xc4f1('0x6')]=!![];this[_0xc4f1('0x7')]=_0x1d8c4b[_0xc4f1('0x7')];this[_0xc4f1('0x8')]=_0x1d8c4b[_0xc4f1('0x8')];this[_0xc4f1('0x9')]=_0x1d8c4b[_0xc4f1('0x9')]||null;this['dialGlobalInterval']=_0x1d8c4b[_0xc4f1('0xa')]?_0x1d8c4b[_0xc4f1('0xa')]:null;this[_0xc4f1('0xb')]=_0x1d8c4b['dialOriginateCallerIdName'];this[_0xc4f1('0xc')]=_0x1d8c4b[_0xc4f1('0xc')];this[_0xc4f1('0xd')]=_0x1d8c4b[_0xc4f1('0xd')]||0x1e;this[_0xc4f1('0xe')]=_0x1d8c4b['dialCongestionMaxRetry'];this[_0xc4f1('0xf')]=_0x1d8c4b[_0xc4f1('0xf')];this[_0xc4f1('0x10')]=_0x1d8c4b[_0xc4f1('0x10')];this['dialBusyRetryFrequency']=_0x1d8c4b['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1d8c4b[_0xc4f1('0x11')];this[_0xc4f1('0x12')]=_0x1d8c4b[_0xc4f1('0x12')];this[_0xc4f1('0x13')]=_0x1d8c4b[_0xc4f1('0x13')];this[_0xc4f1('0x14')]=_0x1d8c4b[_0xc4f1('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1d8c4b[_0xc4f1('0x15')]||0x96;this['dialDropMaxRetry']=_0x1d8c4b['dialDropMaxRetry']||0x3;this[_0xc4f1('0x16')]=_0x1d8c4b[_0xc4f1('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x1d8c4b[_0xc4f1('0x17')]||0x3;this[_0xc4f1('0x18')]=_0x1d8c4b[_0xc4f1('0x18')]||0x96;this[_0xc4f1('0x19')]=_0x1d8c4b[_0xc4f1('0x19')]||0x3;this[_0xc4f1('0x1a')]=_0x1d8c4b[_0xc4f1('0x1a')]||0x96;this[_0xc4f1('0x1b')]=_0x1d8c4b[_0xc4f1('0x1b')]||0x3;this[_0xc4f1('0x1c')]=_0x1d8c4b[_0xc4f1('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x1d8c4b[_0xc4f1('0x1d')]||_0xc4f1('0x1e');this[_0xc4f1('0x1f')]=_0x1d8c4b[_0xc4f1('0x1f')]||undefined;this[_0xc4f1('0x20')]=_0x1d8c4b[_0xc4f1('0x20')]||undefined;this['dialCutDigit']=_0x1d8c4b[_0xc4f1('0x21')]||undefined;this[_0xc4f1('0x22')]=_0x1d8c4b[_0xc4f1('0x22')]?_0x1d8c4b['TrunkBackup']:undefined;this['Trunk']=_0x1d8c4b[_0xc4f1('0x23')]?_0x1d8c4b[_0xc4f1('0x23')]:undefined;this[_0xc4f1('0x24')]=_0x1d8c4b['Interval']?_0x1d8c4b[_0xc4f1('0x24')]:undefined;this[_0xc4f1('0x25')]=_0x1d8c4b[_0xc4f1('0x25')]?_0x1d8c4b['SquareProject']:undefined;this[_0xc4f1('0x26')]=_0x1d8c4b[_0xc4f1('0x25')]?_0x1d8c4b[_0xc4f1('0x25')][_0xc4f1('0x0')]:undefined;this[_0xc4f1('0x27')]=_0x1d8c4b[_0xc4f1('0x27')]||![];this['dialAMDInitialSilence']=_0x1d8c4b['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1d8c4b['dialAMDGreeting'];this[_0xc4f1('0x28')]=_0x1d8c4b[_0xc4f1('0x28')];this[_0xc4f1('0x29')]=_0x1d8c4b[_0xc4f1('0x29')];this[_0xc4f1('0x2a')]=_0x1d8c4b[_0xc4f1('0x2a')];this['dialAMDBetweenWordsSilence']=_0x1d8c4b[_0xc4f1('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x1d8c4b[_0xc4f1('0x2c')];this[_0xc4f1('0x2d')]=_0x1d8c4b['dialAMDSilenceThreshold'];this[_0xc4f1('0x2e')]=_0x1d8c4b['dialAMDMaximumWordLength'];}module[_0xc4f1('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3e85cb6..c4562b8 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 _0x4d5a=['channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','linkedid','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','mohtime','exports'];(function(_0x1d3f1c,_0x2ec30f){var _0x436522=function(_0x5b2277){while(--_0x5b2277){_0x1d3f1c['push'](_0x1d3f1c['shift']());}};_0x436522(++_0x2ec30f);}(_0x4d5a,0x15e));var _0xa4d5=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4d5a[_0xb0f7c3];return _0x28ea68;};'use strict';function Channel(){this['starttime']=null;this[_0xa4d5('0x0')]='';this[_0xa4d5('0x1')]='';this[_0xa4d5('0x2')]=0x0;this['calleridname']='';this[_0xa4d5('0x3')]=undefined;this[_0xa4d5('0x4')]=undefined;this[_0xa4d5('0x5')]=0x0;this[_0xa4d5('0x6')]='';this['uniqueid']=0x0;this[_0xa4d5('0x7')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xa4d5('0x8')]=null;this[_0xa4d5('0x9')]=null;this[_0xa4d5('0xa')]=![];this[_0xa4d5('0xb')]=![];this[_0xa4d5('0xc')]='';this[_0xa4d5('0xd')]='';this[_0xa4d5('0xe')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xa4d5('0xf')]=null;this[_0xa4d5('0x10')]=null;this[_0xa4d5('0x11')]=null;this[_0xa4d5('0x12')]=![];this[_0xa4d5('0x13')]=null;this[_0xa4d5('0x14')]=null;this[_0xa4d5('0x15')]=[];this[_0xa4d5('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0xa4d5('0x17')]=0x0;}module[_0xa4d5('0x18')]=Channel; \ No newline at end of file +var _0x2eba=['duration','billableseconds','tag','disposition','monitor','queue','monitors','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','accountcode','uniqueid','linkedid','exten','answered','abandoned','lastdata'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0x2eba,0xc7));var _0xa2eb=function(_0x2cb15f,_0x3481cb){_0x2cb15f=_0x2cb15f-0x0;var _0xdc40ef=_0x2eba[_0x2cb15f];return _0xdc40ef;};'use strict';function Channel(){this['starttime']=null;this[_0xa2eb('0x0')]='';this[_0xa2eb('0x1')]='';this[_0xa2eb('0x2')]=0x0;this[_0xa2eb('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa2eb('0x4')]=0x0;this['context']='';this[_0xa2eb('0x5')]=0x0;this[_0xa2eb('0x6')]=0x0;this[_0xa2eb('0x7')]=0x0;this[_0xa2eb('0x8')]=![];this['answertime']=null;this['endtime']=null;this['unmanaged']=![];this[_0xa2eb('0x9')]=![];this['lastapplication']='';this[_0xa2eb('0xa')]='';this[_0xa2eb('0xb')]=0x0;this[_0xa2eb('0xc')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0xa2eb('0xd')]=null;this[_0xa2eb('0xe')]=null;this[_0xa2eb('0xf')]=![];this['monitorFilename']=null;this[_0xa2eb('0x10')]=null;this[_0xa2eb('0x11')]=[];this['transfercalleridnum']=undefined;this[_0xa2eb('0x12')]=undefined;this['transferType']=undefined;this[_0xa2eb('0x13')]=0x0;}module[_0xa2eb('0x14')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 95821e8..8986f13 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 _0xdd15=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x445ec5,_0x347617){var _0x373724=function(_0x63b996){while(--_0x63b996){_0x445ec5['push'](_0x445ec5['shift']());}};_0x373724(++_0x347617);}(_0xdd15,0x126));var _0x5dd1=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xdd15[_0x5a95fa];return _0x1a61b8;};'use strict';function DeskAccount(_0x5447ec){this['id']=_0x5447ec['id']||0x0;this[_0x5dd1('0x0')]=_0x5447ec[_0x5dd1('0x0')]||'';this[_0x5dd1('0x1')]=_0x5447ec['username']||'';this['remoteUri']=_0x5447ec[_0x5dd1('0x2')]||'';this[_0x5dd1('0x3')]=_0x5447ec[_0x5dd1('0x3')]||'';this[_0x5dd1('0x4')]=_0x5447ec[_0x5dd1('0x4')]||'';this[_0x5dd1('0x5')]=_0x5447ec['consumerKey']||'';this[_0x5dd1('0x6')]=_0x5447ec[_0x5dd1('0x6')]||'';this[_0x5dd1('0x7')]=_0x5447ec[_0x5dd1('0x7')]||'';this[_0x5dd1('0x8')]=_0x5447ec[_0x5dd1('0x8')]||'';this[_0x5dd1('0x9')]=_0x5447ec[_0x5dd1('0x9')]||'';this[_0x5dd1('0xa')]=_0x5447ec[_0x5dd1('0xa')]||'';this[_0x5dd1('0xb')]=_0x5447ec[_0x5dd1('0xb')]||{};}module[_0x5dd1('0xc')]=DeskAccount; \ No newline at end of file +var _0x3462=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x245546,_0x2d5269){var _0x1ebb5a=function(_0x25d614){while(--_0x25d614){_0x245546['push'](_0x245546['shift']());}};_0x1ebb5a(++_0x2d5269);}(_0x3462,0x15f));var _0x2346=function(_0x169c11,_0x4cbe14){_0x169c11=_0x169c11-0x0;var _0x2115e8=_0x3462[_0x169c11];return _0x2115e8;};'use strict';function DeskAccount(_0x16ef90){this['id']=_0x16ef90['id']||0x0;this[_0x2346('0x0')]=_0x16ef90[_0x2346('0x0')]||'';this[_0x2346('0x1')]=_0x16ef90[_0x2346('0x1')]||'';this['remoteUri']=_0x16ef90[_0x2346('0x2')]||'';this[_0x2346('0x3')]=_0x16ef90[_0x2346('0x3')]||'';this[_0x2346('0x4')]=_0x16ef90[_0x2346('0x4')]||'';this[_0x2346('0x5')]=_0x16ef90[_0x2346('0x5')]||'';this[_0x2346('0x6')]=_0x16ef90[_0x2346('0x6')]||'';this[_0x2346('0x7')]=_0x16ef90['token']||'';this[_0x2346('0x8')]=_0x16ef90[_0x2346('0x8')]||'';this['type']=_0x16ef90[_0x2346('0x9')]||'';this[_0x2346('0xa')]=_0x16ef90['serverUrl']||'';this['Configurations']=_0x16ef90[_0x2346('0xb')]||{};}module[_0x2346('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 79a0413..f01067e 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 _0x6e24=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e24,0x129));var _0x46e2=function(_0x2ec67c,_0x4194bf){_0x2ec67c=_0x2ec67c-0x0;var _0x7c79e0=_0x6e24[_0x2ec67c];return _0x7c79e0;};'use strict';function Dynamics365Account(_0x353147){this['id']=_0x353147['id']||0x0;this[_0x46e2('0x0')]=_0x353147[_0x46e2('0x0')]||'';this[_0x46e2('0x1')]=_0x353147[_0x46e2('0x1')]||'';this['password']=_0x353147[_0x46e2('0x2')]||'';this[_0x46e2('0x3')]=_0x353147[_0x46e2('0x3')]||'';this[_0x46e2('0x4')]=_0x353147[_0x46e2('0x4')]||'';this[_0x46e2('0x5')]=_0x353147[_0x46e2('0x5')]||'';this['clientSecret']=_0x353147[_0x46e2('0x6')]||{};this['serverUrl']=_0x353147[_0x46e2('0x7')]||'';this[_0x46e2('0x8')]=_0x353147[_0x46e2('0x8')]||![];this[_0x46e2('0x9')]=_0x353147[_0x46e2('0x9')]||{};this[_0x46e2('0xa')]=_0x353147['CloudProvider']||{};}module[_0x46e2('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xcc13=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x135762,_0x238b42){var _0x3e3d17=function(_0x591751){while(--_0x591751){_0x135762['push'](_0x135762['shift']());}};_0x3e3d17(++_0x238b42);}(_0xcc13,0x1e4));var _0x3cc1=function(_0x3bebd1,_0x5bd765){_0x3bebd1=_0x3bebd1-0x0;var _0x5e9236=_0xcc13[_0x3bebd1];return _0x5e9236;};'use strict';function Dynamics365Account(_0x52a859){this['id']=_0x52a859['id']||0x0;this['name']=_0x52a859['name']||'';this['username']=_0x52a859[_0x3cc1('0x0')]||'';this[_0x3cc1('0x1')]=_0x52a859[_0x3cc1('0x1')]||'';this['remoteUri']=_0x52a859[_0x3cc1('0x2')]||'';this[_0x3cc1('0x3')]=_0x52a859[_0x3cc1('0x3')]||'';this[_0x3cc1('0x4')]=_0x52a859[_0x3cc1('0x4')]||'';this[_0x3cc1('0x5')]=_0x52a859['clientSecret']||{};this[_0x3cc1('0x6')]=_0x52a859[_0x3cc1('0x6')]||'';this[_0x3cc1('0x7')]=_0x52a859[_0x3cc1('0x7')]||![];this[_0x3cc1('0x8')]=_0x52a859['Configurations']||{};this[_0x3cc1('0x9')]=_0x52a859['CloudProvider']||{};}module[_0x3cc1('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 47b7652..1d0d070 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 _0x4f27=['minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x5734a2,_0x257cac){var _0x29b681=function(_0x3c7c39){while(--_0x3c7c39){_0x5734a2['push'](_0x5734a2['shift']());}};_0x29b681(++_0x257cac);}(_0x4f27,0x10b));var _0x74f2=function(_0x4777dc,_0xbce636){_0x4777dc=_0x4777dc-0x0;var _0x16d933=_0x4f27[_0x4777dc];return _0x16d933;};'use strict';function FaxAccount(_0x237bd1){this['id']=_0x237bd1['id']||0x0;this['name']=_0x237bd1[_0x74f2('0x0')]||'';this[_0x74f2('0x1')]=_0x237bd1[_0x74f2('0x1')];this['ecm']=_0x237bd1[_0x74f2('0x2')];this[_0x74f2('0x3')]=_0x237bd1[_0x74f2('0x3')];this[_0x74f2('0x4')]=_0x237bd1['localstationid'];this[_0x74f2('0x5')]=_0x237bd1[_0x74f2('0x5')]||0x960;this['maxrate']=_0x237bd1[_0x74f2('0x6')]||0x3840;this[_0x74f2('0x7')]=_0x237bd1[_0x74f2('0x7')]||'v17,v27,v29';this[_0x74f2('0x8')]=_0x237bd1[_0x74f2('0x8')]||'no';this[_0x74f2('0x9')]=_0x237bd1[_0x74f2('0x9')]||'no';this[_0x74f2('0xa')]=_0x237bd1[_0x74f2('0xa')]||0x1388;this[_0x74f2('0xb')]=_0x237bd1[_0x74f2('0xb')]||_0x74f2('0xc');this[_0x74f2('0xd')]=_0x237bd1[_0x74f2('0xd')]?_0x237bd1[_0x74f2('0xd')]:undefined;this[_0x74f2('0xe')]=_0x237bd1[_0x74f2('0xe')];this[_0x74f2('0xf')]=_0x237bd1['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x12b7=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem'];(function(_0x4f0159,_0xaf2d85){var _0x2b53a8=function(_0x34e528){while(--_0x34e528){_0x4f0159['push'](_0x4f0159['shift']());}};_0x2b53a8(++_0xaf2d85);}(_0x12b7,0x1a9));var _0x712b=function(_0x5755e5,_0x105949){_0x5755e5=_0x5755e5-0x0;var _0x5b61ba=_0x12b7[_0x5755e5];return _0x5b61ba;};'use strict';function FaxAccount(_0x144b42){this['id']=_0x144b42['id']||0x0;this[_0x712b('0x0')]=_0x144b42['name']||'';this[_0x712b('0x1')]=_0x144b42['description'];this[_0x712b('0x2')]=_0x144b42[_0x712b('0x2')];this[_0x712b('0x3')]=_0x144b42['headerinfo'];this['localstationid']=_0x144b42['localstationid'];this['minrate']=_0x144b42[_0x712b('0x4')]||0x960;this[_0x712b('0x5')]=_0x144b42[_0x712b('0x5')]||0x3840;this[_0x712b('0x6')]=_0x144b42[_0x712b('0x6')]||_0x712b('0x7');this[_0x712b('0x8')]=_0x144b42['gateway']||'no';this[_0x712b('0x9')]=_0x144b42[_0x712b('0x9')]||'no';this[_0x712b('0xa')]=_0x144b42[_0x712b('0xa')]||0x1388;this[_0x712b('0xb')]=_0x144b42['tech']||_0x712b('0xc');this[_0x712b('0xd')]=_0x144b42[_0x712b('0xd')]?_0x144b42[_0x712b('0xd')]:undefined;this['ListId']=_0x144b42['ListId'];this[_0x712b('0xe')]=_0x144b42['key'];}module[_0x712b('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ef27812..15e9c70 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 _0x2e2c=['Configurations','exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0x2f4990,_0x5343b4){var _0x4ec711=function(_0x2098fc){while(--_0x2098fc){_0x2f4990['push'](_0x2f4990['shift']());}};_0x4ec711(++_0x5343b4);}(_0x2e2c,0x17c));var _0xc2e2=function(_0x138b2c,_0x142181){_0x138b2c=_0x138b2c-0x0;var _0xa8b921=_0x2e2c[_0x138b2c];return _0xa8b921;};'use strict';function FreshdeskAccount(_0x42743a){this['id']=_0x42743a['id']||0x0;this[_0xc2e2('0x0')]=_0x42743a[_0xc2e2('0x0')]||'';this[_0xc2e2('0x1')]=_0x42743a['username']||'';this[_0xc2e2('0x2')]=_0x42743a['token']||'';this[_0xc2e2('0x3')]=_0x42743a[_0xc2e2('0x3')]||'';this[_0xc2e2('0x4')]=_0x42743a[_0xc2e2('0x4')]||'';this[_0xc2e2('0x5')]=_0x42743a[_0xc2e2('0x5')]||{};}module[_0xc2e2('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xa3da=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xa3da,0x99));var _0xaa3d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa3da[_0x5c351c];return _0x26f3b3;};'use strict';function FreshdeskAccount(_0x291b64){this['id']=_0x291b64['id']||0x0;this[_0xaa3d('0x0')]=_0x291b64[_0xaa3d('0x0')]||'';this[_0xaa3d('0x1')]=_0x291b64['username']||'';this[_0xaa3d('0x2')]=_0x291b64[_0xaa3d('0x3')]||'';this[_0xaa3d('0x4')]=_0x291b64[_0xaa3d('0x4')]||'';this['serverUrl']=_0x291b64[_0xaa3d('0x5')]||'';this[_0xaa3d('0x6')]=_0x291b64[_0xaa3d('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 862dc19..aae2ca3 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 _0x1a44=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x4014c8,_0x38efb6){var _0x194847=function(_0x83288a){while(--_0x83288a){_0x4014c8['push'](_0x4014c8['shift']());}};_0x194847(++_0x38efb6);}(_0x1a44,0xc4));var _0x41a4=function(_0x16b34d,_0x4c739b){_0x16b34d=_0x16b34d-0x0;var _0x13a439=_0x1a44[_0x16b34d];return _0x13a439;};'use strict';function FreshsalesAccount(_0x3b9374){this['id']=_0x3b9374['id']||0x0;this['name']=_0x3b9374[_0x41a4('0x0')]||'';this[_0x41a4('0x1')]=_0x3b9374[_0x41a4('0x1')]||'';this[_0x41a4('0x2')]=_0x3b9374[_0x41a4('0x3')]||'';this[_0x41a4('0x4')]=_0x3b9374[_0x41a4('0x4')]||'';this['serverUrl']=_0x3b9374[_0x41a4('0x5')]||'';this[_0x41a4('0x6')]=_0x3b9374[_0x41a4('0x6')]||{};}module[_0x41a4('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x1a0b=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x5540c3,_0x42c118){var _0x51316d=function(_0x3550db){while(--_0x3550db){_0x5540c3['push'](_0x5540c3['shift']());}};_0x51316d(++_0x42c118);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x1c59c5,_0x5e99fb){_0x1c59c5=_0x1c59c5-0x0;var _0x5c0c51=_0x1a0b[_0x1c59c5];return _0x5c0c51;};'use strict';function FreshsalesAccount(_0xe98786){this['id']=_0xe98786['id']||0x0;this['name']=_0xe98786[_0xb1a0('0x0')]||'';this[_0xb1a0('0x1')]=_0xe98786[_0xb1a0('0x1')]||'';this[_0xb1a0('0x2')]=_0xe98786[_0xb1a0('0x3')]||'';this[_0xb1a0('0x4')]=_0xe98786[_0xb1a0('0x4')]||'';this[_0xb1a0('0x5')]=_0xe98786[_0xb1a0('0x5')]||'';this[_0xb1a0('0x6')]=_0xe98786[_0xb1a0('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 94b3d1a..c10ca15 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 _0xf1b4=['holdtime','assigned','lastAssignedTo','motionChannel','mohtime','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','exten','priority'];(function(_0x1dbf53,_0x5c2da0){var _0x1d264b=function(_0x5bfcd2){while(--_0x5bfcd2){_0x1dbf53['push'](_0x1dbf53['shift']());}};_0x1d264b(++_0x5c2da0);}(_0xf1b4,0x102));var _0x4f1b=function(_0x7642c,_0x2ec4b0){_0x7642c=_0x7642c-0x0;var _0x5412fd=_0xf1b4[_0x7642c];return _0x5412fd;};'use strict';function QueueReport(){this[_0x4f1b('0x0')]='inbound';this[_0x4f1b('0x1')]='';this[_0x4f1b('0x2')]='';this[_0x4f1b('0x3')]='';this[_0x4f1b('0x4')]='';this[_0x4f1b('0x5')]=null;this[_0x4f1b('0x6')]=null;this['position']=0x1;this[_0x4f1b('0x7')]=0x1;this[_0x4f1b('0x8')]=![];this[_0x4f1b('0x9')]=null;this[_0x4f1b('0xa')]=![];this[_0x4f1b('0xb')]=null;this['queuecallerexit']=![];this[_0x4f1b('0xc')]=null;this[_0x4f1b('0xd')]=0x1;this[_0x4f1b('0xe')]='';this['connectedlinenum']='';this[_0x4f1b('0xf')]='';this['accountcode']='';this['context']='';this[_0x4f1b('0x10')]='';this[_0x4f1b('0x11')]='';this[_0x4f1b('0x12')]=0x0;this[_0x4f1b('0x13')]=![];this[_0x4f1b('0x14')]='';this[_0x4f1b('0x15')]='voice';this[_0x4f1b('0x16')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x397c=['lastAssignedTo','motionChannel','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','accountcode','priority','holdtime','assigned'];(function(_0x52953e,_0x5e6812){var _0x4c48f8=function(_0xb81a32){while(--_0xb81a32){_0x52953e['push'](_0x52953e['shift']());}};_0x4c48f8(++_0x5e6812);}(_0x397c,0xcb));var _0xc397=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x397c[_0x22f8ab];return _0x2a70e5;};'use strict';function QueueReport(){this[_0xc397('0x0')]=_0xc397('0x1');this[_0xc397('0x2')]='';this[_0xc397('0x3')]='';this['calleridname']='';this[_0xc397('0x4')]='';this['queuecallerjoinAt']=null;this[_0xc397('0x5')]=null;this['position']=0x1;this['count']=0x1;this[_0xc397('0x6')]=![];this[_0xc397('0x7')]=null;this[_0xc397('0x8')]=![];this[_0xc397('0x9')]=null;this[_0xc397('0xa')]=![];this[_0xc397('0xb')]=null;this['originalposition']=0x1;this[_0xc397('0xc')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xc397('0xd')]='';this['context']='';this['exten']='';this[_0xc397('0xe')]='';this[_0xc397('0xf')]=0x0;this[_0xc397('0x10')]=![];this[_0xc397('0x11')]='';this[_0xc397('0x12')]='voice';this['mohtime']=0x0;this['variables']={};}module[_0xc397('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index aab0f84..0d577da 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 _0xde69=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x5e32f3,_0x3386c1){var _0x4d4e03=function(_0xe86f5){while(--_0xe86f5){_0x5e32f3['push'](_0x5e32f3['shift']());}};_0x4d4e03(++_0x3386c1);}(_0xde69,0x187));var _0x9de6=function(_0x5c1911,_0x5063d9){_0x5c1911=_0x5c1911-0x0;var _0x360290=_0xde69[_0x5c1911];return _0x360290;};'use strict';function SalesforceAccount(_0xb77332){this['id']=_0xb77332['id']||0x0;this['name']=_0xb77332[_0x9de6('0x0')]||'';this[_0x9de6('0x1')]=_0xb77332[_0x9de6('0x1')]||'';this[_0x9de6('0x2')]=_0xb77332[_0x9de6('0x2')]||'';this[_0x9de6('0x3')]=_0xb77332[_0x9de6('0x3')]||'';this['clientId']=_0xb77332[_0x9de6('0x4')]||'';this[_0x9de6('0x5')]=_0xb77332[_0x9de6('0x5')]||'';this[_0x9de6('0x6')]=_0xb77332[_0x9de6('0x6')]||'';this[_0x9de6('0x7')]=_0xb77332[_0x9de6('0x7')]||'integrationTab';this['serverUrl']=_0xb77332[_0x9de6('0x8')]||'';this[_0x9de6('0x9')]=_0xb77332['Configurations']||{};}module[_0x9de6('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xa343=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x28f780,_0x3f1bd8){var _0x1b02cc=function(_0x2dec3a){while(--_0x2dec3a){_0x28f780['push'](_0x28f780['shift']());}};_0x1b02cc(++_0x3f1bd8);}(_0xa343,0x1a1));var _0x3a34=function(_0x2cac01,_0x2e8b3d){_0x2cac01=_0x2cac01-0x0;var _0x2257b7=_0xa343[_0x2cac01];return _0x2257b7;};'use strict';function SalesforceAccount(_0x35b1fc){this['id']=_0x35b1fc['id']||0x0;this[_0x3a34('0x0')]=_0x35b1fc[_0x3a34('0x0')]||'';this['username']=_0x35b1fc['username']||'';this[_0x3a34('0x1')]=_0x35b1fc[_0x3a34('0x1')]||'';this[_0x3a34('0x2')]=_0x35b1fc[_0x3a34('0x2')]||'';this[_0x3a34('0x3')]=_0x35b1fc[_0x3a34('0x3')]||'';this[_0x3a34('0x4')]=_0x35b1fc[_0x3a34('0x4')]||'';this[_0x3a34('0x5')]=_0x35b1fc[_0x3a34('0x5')]||'';this[_0x3a34('0x6')]=_0x35b1fc[_0x3a34('0x6')]||_0x3a34('0x7');this[_0x3a34('0x8')]=_0x35b1fc[_0x3a34('0x8')]||'';this[_0x3a34('0x9')]=_0x35b1fc[_0x3a34('0x9')]||{};}module[_0x3a34('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9de70db..186a03d 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 _0x54e8=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x54e8,0x7d));var _0x854e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x54e8[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x5b89ad){this['id']=_0x5b89ad['id']||0x0;this[_0x854e('0x0')]=_0x5b89ad['name']||'';this[_0x854e('0x1')]=_0x5b89ad[_0x854e('0x1')]||'';this[_0x854e('0x2')]=_0x5b89ad['password']||'';this[_0x854e('0x3')]=_0x5b89ad[_0x854e('0x3')]||'';this[_0x854e('0x4')]=_0x5b89ad['serverUrl']||'';this[_0x854e('0x5')]=_0x5b89ad[_0x854e('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x8193=['Configurations','exports','username','password','remoteUri','serverUrl'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x8193,0xf2));var _0x3819=function(_0x21a3ac,_0x386a4b){_0x21a3ac=_0x21a3ac-0x0;var _0x164fec=_0x8193[_0x21a3ac];return _0x164fec;};'use strict';function ServicenowAccount(_0x4344f9){this['id']=_0x4344f9['id']||0x0;this['name']=_0x4344f9['name']||'';this[_0x3819('0x0')]=_0x4344f9[_0x3819('0x0')]||'';this[_0x3819('0x1')]=_0x4344f9[_0x3819('0x1')]||'';this[_0x3819('0x2')]=_0x4344f9[_0x3819('0x2')]||'';this[_0x3819('0x3')]=_0x4344f9[_0x3819('0x3')]||'';this[_0x3819('0x4')]=_0x4344f9['Configurations']||{};}module[_0x3819('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 2b963cc..1011b63 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 _0x98f8=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2bea3b,_0x25bd71){var _0x14d73a=function(_0x286ceb){while(--_0x286ceb){_0x2bea3b['push'](_0x2bea3b['shift']());}};_0x14d73a(++_0x25bd71);}(_0x98f8,0x1cc));var _0x898f=function(_0x5ed064,_0x9f9ed1){_0x5ed064=_0x5ed064-0x0;var _0x1a31f5=_0x98f8[_0x5ed064];return _0x1a31f5;};'use strict';function SugarcrmAccount(_0x31cfed){this['id']=_0x31cfed['id']||0x0;this[_0x898f('0x0')]=_0x31cfed[_0x898f('0x0')]||'';this['username']=_0x31cfed[_0x898f('0x1')]||'';this[_0x898f('0x2')]=_0x31cfed['password']||'';this[_0x898f('0x3')]=_0x31cfed[_0x898f('0x3')]||'';this[_0x898f('0x4')]=_0x31cfed[_0x898f('0x4')]||'';this[_0x898f('0x5')]=_0x31cfed[_0x898f('0x5')]||{};}module[_0x898f('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x2f20=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x5a037a,_0x44a3fc){var _0x28ff57=function(_0x13d49f){while(--_0x13d49f){_0x5a037a['push'](_0x5a037a['shift']());}};_0x28ff57(++_0x44a3fc);}(_0x2f20,0x92));var _0x02f2=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x2f20[_0x3fba9f];return _0x192cf1;};'use strict';function SugarcrmAccount(_0x22e5ed){this['id']=_0x22e5ed['id']||0x0;this[_0x02f2('0x0')]=_0x22e5ed[_0x02f2('0x0')]||'';this[_0x02f2('0x1')]=_0x22e5ed[_0x02f2('0x1')]||'';this['password']=_0x22e5ed[_0x02f2('0x2')]||'';this[_0x02f2('0x3')]=_0x22e5ed[_0x02f2('0x3')]||'';this[_0x02f2('0x4')]=_0x22e5ed['serverUrl']||'';this[_0x02f2('0x5')]=_0x22e5ed[_0x02f2('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e40e220..daea1cc 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 _0x1516=['address','name','accountcode','state','unknown','stateTime','status'];(function(_0x3d20f2,_0x27df9c){var _0x99d343=function(_0x479f01){while(--_0x479f01){_0x3d20f2['push'](_0x3d20f2['shift']());}};_0x99d343(++_0x27df9c);}(_0x1516,0xb0));var _0x6151=function(_0x4d78e5,_0xebddf9){_0x4d78e5=_0x4d78e5-0x0;var _0x25491c=_0x1516[_0x4d78e5];return _0x25491c;};'use strict';function Telephone(_0x508329){this['id']=_0x508329['id']||0x0;this[_0x6151('0x0')]=_0x508329[_0x6151('0x0')]||'';this['accountcode']=_0x508329[_0x6151('0x1')]||'';this[_0x6151('0x2')]=_0x6151('0x3');this[_0x6151('0x4')]=0x0;this[_0x6151('0x5')]='unknown';this[_0x6151('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x16a3=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x4734c8,_0x69cadb){var _0x46640d=function(_0x116833){while(--_0x116833){_0x4734c8['push'](_0x4734c8['shift']());}};_0x46640d(++_0x69cadb);}(_0x16a3,0x1e0));var _0x316a=function(_0x5828d0,_0x2c3e93){_0x5828d0=_0x5828d0-0x0;var _0x239b02=_0x16a3[_0x5828d0];return _0x239b02;};'use strict';function Telephone(_0x2d574f){this['id']=_0x2d574f['id']||0x0;this['name']=_0x2d574f[_0x316a('0x0')]||'';this[_0x316a('0x1')]=_0x2d574f[_0x316a('0x1')]||'';this[_0x316a('0x2')]=_0x316a('0x3');this[_0x316a('0x4')]=0x0;this[_0x316a('0x5')]=_0x316a('0x3');this[_0x316a('0x6')]='';}module[_0x316a('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b5aef54..b3a378b 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 _0xb10b=['name','html'];(function(_0x3b450d,_0x19d474){var _0x4b10ed=function(_0x20927e){while(--_0x20927e){_0x3b450d['push'](_0x3b450d['shift']());}};_0x4b10ed(++_0x19d474);}(_0xb10b,0x12a));var _0xbb10=function(_0x20f52e,_0x596d5e){_0x20f52e=_0x20f52e-0x0;var _0x1489ca=_0xb10b[_0x20f52e];return _0x1489ca;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x3f3779,_0xd11796){var _0xb6c512=function(_0x4577a5){while(--_0x4577a5){_0x3f3779['push'](_0x3f3779['shift']());}};_0xb6c512(++_0xd11796);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('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 ea7a3d0..0556d44 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 _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x35f85b,_0x562ce3){var _0x416768=function(_0x25074f){while(--_0x25074f){_0x35f85b['push'](_0x35f85b['shift']());}};_0x416768(++_0x562ce3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x209c9a,_0x22a36b){_0x209c9a=_0x209c9a-0x0;var _0x461243=_0x5f2f[_0x209c9a];return _0x461243;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x263d59,_0x15729f){var _0x3aa3ed=function(_0x2f4437){while(--_0x2f4437){_0x263d59['push'](_0x263d59['shift']());}};_0x3aa3ed(++_0x15729f);}(_0x757a,0xde));var _0xa757=function(_0x3bf18c,_0x3d87a7){_0x3bf18c=_0x3bf18c-0x0;var _0x511cf7=_0x757a[_0x3bf18c];return _0x511cf7;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index bfb83c4..84bb4a8 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 _0xce0e=['domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','registry','indexOf','host'];(function(_0x48a6b2,_0x38fb06){var _0x2b64dc=function(_0x5e9643){while(--_0x5e9643){_0x48a6b2['push'](_0x48a6b2['shift']());}};_0x2b64dc(++_0x38fb06);}(_0xce0e,0x17f));var _0xece0=function(_0x34215b,_0x1759ea){_0x34215b=_0x34215b-0x0;var _0x110305=_0xce0e[_0x34215b];return _0x110305;};'use strict';function Trunk(_0xf88dbc){this['id']=_0xf88dbc['id']||0x0;this['active']=_0xf88dbc[_0xece0('0x0')]||![];this[_0xece0('0x1')]=_0xf88dbc['name']||'';this[_0xece0('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xece0('0x3');this['registry']=_0xf88dbc[_0xece0('0x4')]&&_0xf88dbc[_0xece0('0x4')][_0xece0('0x5')](':')?_0xf88dbc[_0xece0('0x4')]['split'](':')[0x0]:'';this[_0xece0('0x6')]='';this['port']='';this[_0xece0('0x7')]='';this[_0xece0('0x8')]='';this[_0xece0('0x9')]='';this[_0xece0('0xa')]=_0xece0('0x3');this[_0xece0('0xb')]='';this[_0xece0('0xc')]='';this['defaultuser']=_0xf88dbc[_0xece0('0xd')]||'';}module[_0xece0('0xe')]=Trunk; \ No newline at end of file +var _0x690a=['defaultuser','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x690a,0xe2));var _0xa690=function(_0x294303,_0x10c8ea){_0x294303=_0x294303-0x0;var _0x29c840=_0x690a[_0x294303];return _0x29c840;};'use strict';function Trunk(_0x160c29){this['id']=_0x160c29['id']||0x0;this[_0xa690('0x0')]=_0x160c29[_0xa690('0x0')]||![];this[_0xa690('0x1')]=_0x160c29[_0xa690('0x1')]||'';this[_0xa690('0x2')]='unknown';this[_0xa690('0x3')]=0x0;this[_0xa690('0x4')]=_0xa690('0x5');this[_0xa690('0x6')]=_0x160c29[_0xa690('0x6')]&&_0x160c29[_0xa690('0x6')][_0xa690('0x7')](':')?_0x160c29[_0xa690('0x6')][_0xa690('0x8')](':')[0x0]:'';this[_0xa690('0x9')]='';this['port']='';this[_0xa690('0xa')]='';this[_0xa690('0xb')]='';this[_0xa690('0xc')]='';this[_0xa690('0xd')]=_0xa690('0x5');this['registrationtime']='';this['address']='';this[_0xa690('0xe')]=_0x160c29[_0xa690('0xe')]||'';}module[_0xa690('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e8831d6..2d4fb52 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 _0x147e=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x147e,0x1a4));var _0xe147=function(_0x466832,_0x3a4ce7){_0x466832=_0x466832-0x0;var _0x3476f5=_0x147e[_0x466832];return _0x3476f5;};'use strict';function voiceExtension(_0x6d7202){this['id']=_0x6d7202['id']||0x0;this[_0xe147('0x0')]=_0x6d7202['exten']||'';this[_0xe147('0x1')]=_0x6d7202[_0xe147('0x1')]||_0xe147('0x2');this['mandatoryDisposition']=_0x6d7202[_0xe147('0x3')]||![];}module[_0xe147('0x4')]=voiceExtension; \ No newline at end of file +var _0x7a79=['mandatoryDisposition','exports','recordingFormat','none'];(function(_0x33ae39,_0x3768f0){var _0x1e4afc=function(_0x182a2a){while(--_0x182a2a){_0x33ae39['push'](_0x33ae39['shift']());}};_0x1e4afc(++_0x3768f0);}(_0x7a79,0x86));var _0x97a7=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x7a79[_0x3bad26];return _0x42e1ff;};'use strict';function voiceExtension(_0x5250dd){this['id']=_0x5250dd['id']||0x0;this['exten']=_0x5250dd['exten']||'';this[_0x97a7('0x0')]=_0x5250dd[_0x97a7('0x0')]||_0x97a7('0x1');this[_0x97a7('0x2')]=_0x5250dd['mandatoryDisposition']||![];}module[_0x97a7('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c75110c..45963af 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 _0x0fea=['exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0fea,0x80));var _0xa0fe=function(_0x3dcc78,_0x5a3972){_0x3dcc78=_0x3dcc78-0x0;var _0x4c173c=_0x0fea[_0x3dcc78];return _0x4c173c;};'use strict';var statusDesc=['unknown',_0xa0fe('0x0'),_0xa0fe('0x1'),_0xa0fe('0x2'),_0xa0fe('0x3'),_0xa0fe('0x4'),_0xa0fe('0x5'),_0xa0fe('0x6'),_0xa0fe('0x7')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xa0fe('0x8')};var strategy={'rrmemory':_0xa0fe('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x136fca){this['id']=_0x136fca['id']||0x0;this[_0xa0fe('0xa')]=_0x136fca[_0xa0fe('0xa')]||'';this[_0xa0fe('0xb')]=_0x136fca[_0xa0fe('0xb')]||'';this[_0xa0fe('0xc')]=_0x136fca[_0xa0fe('0xc')]||_0xa0fe('0xd');this['waiting']=0x0;this[_0xa0fe('0xe')]=0x0;this[_0xa0fe('0xf')]=0x0;this[_0xa0fe('0x10')]=0x0;this[_0xa0fe('0x11')]=0x0;this[_0xa0fe('0x12')]=0x0;this[_0xa0fe('0x13')]=0x0;this[_0xa0fe('0x14')]=0x0;this['abandoned']=0x0;this[_0xa0fe('0x15')]=0x0;this[_0xa0fe('0x16')]=0x0;this[_0xa0fe('0x17')]=_0x136fca['acw']||![];this[_0xa0fe('0x18')]=_0x136fca[_0xa0fe('0x18')]||0xa;this[_0xa0fe('0x19')]=_0x136fca['autopause']||'no';this[_0xa0fe('0x1a')]=!![];this[_0xa0fe('0x1b')]='';this[_0xa0fe('0x1c')]=0x0;this[_0xa0fe('0x1d')]=0x0;this[_0xa0fe('0x1e')]=_0x136fca[_0xa0fe('0x1e')]||null;this['dialGlobalInterval']=_0x136fca[_0xa0fe('0x1f')]?_0x136fca[_0xa0fe('0x1f')]:null;this[_0xa0fe('0x20')]=_0x136fca[_0xa0fe('0x20')];this['dialMethod']=_0x136fca[_0xa0fe('0x21')]||_0xa0fe('0x22');this['dialLimitChannel']=_0x136fca[_0xa0fe('0x23')]||0x0;this[_0xa0fe('0x24')]=_0x136fca[_0xa0fe('0x24')]||0x0;this[_0xa0fe('0x25')]=_0x136fca[_0xa0fe('0x25')]||0x1;this['dialPredictiveOptimization']=_0x136fca['dialPredictiveOptimization']||_0xa0fe('0x26');this[_0xa0fe('0x27')]=_0x136fca[_0xa0fe('0x27')]||0.03;this[_0xa0fe('0x28')]=_0x136fca[_0xa0fe('0x28')]||0x258;this[_0xa0fe('0x29')]=_0x136fca[_0xa0fe('0x29')]||_0xa0fe('0x2a');this[_0xa0fe('0x2b')]=_0x136fca[_0xa0fe('0x2b')]||_0xa0fe('0x2a');this[_0xa0fe('0x2c')]=_0x136fca['dialOriginateTimeout']||0x1e;this[_0xa0fe('0x2d')]=_0x136fca[_0xa0fe('0x2d')]||_0xa0fe('0x2e');this[_0xa0fe('0x2f')]=_0x136fca['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x136fca[_0xa0fe('0x30')]||undefined;this[_0xa0fe('0x31')]=_0x136fca[_0xa0fe('0x31')]||0x3;this[_0xa0fe('0x32')]=_0x136fca[_0xa0fe('0x32')]||0x96;this[_0xa0fe('0x33')]=_0x136fca['dialBusyMaxRetry']||0x3;this[_0xa0fe('0x34')]=_0x136fca['dialBusyRetryFrequency']||0x96;this[_0xa0fe('0x35')]=_0x136fca[_0xa0fe('0x35')]||0x3;this[_0xa0fe('0x36')]=_0x136fca['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x136fca['dialNoSuchNumberMaxRetry']||0x3;this[_0xa0fe('0x37')]=_0x136fca[_0xa0fe('0x37')]||0x96;this[_0xa0fe('0x38')]=_0x136fca[_0xa0fe('0x38')]||0x3;this[_0xa0fe('0x39')]=_0x136fca[_0xa0fe('0x39')]||0x96;this[_0xa0fe('0x3a')]=_0x136fca['dialAbandonedMaxRetry']||0x3;this[_0xa0fe('0x3b')]=_0x136fca[_0xa0fe('0x3b')]||0x96;this[_0xa0fe('0x3c')]=_0x136fca[_0xa0fe('0x3c')]||0x3;this[_0xa0fe('0x3d')]=_0x136fca[_0xa0fe('0x3d')]||0x96;this[_0xa0fe('0x3e')]=_0x136fca['dialAgentRejectMaxRetry']||0x3;this[_0xa0fe('0x3f')]=_0x136fca['dialAgentRejectRetryFrequency']||0x96;this[_0xa0fe('0x40')]=_0x136fca['dialGlobalMaxRetry']||0x4;this[_0xa0fe('0x41')]=_0x136fca[_0xa0fe('0x41')]?_0x136fca[_0xa0fe('0x41')]:undefined;this[_0xa0fe('0x42')]=_0x136fca[_0xa0fe('0x42')]?_0x136fca[_0xa0fe('0x42')]:undefined;this[_0xa0fe('0x43')]=_0x136fca[_0xa0fe('0x43')]||undefined;this['Interval']=_0x136fca['Interval']?_0x136fca[_0xa0fe('0x44')]:undefined;this[_0xa0fe('0x45')]=_0x136fca[_0xa0fe('0x45')]||_0xa0fe('0x46');this[_0xa0fe('0x47')]=_0x136fca[_0xa0fe('0x47')]||undefined;this[_0xa0fe('0x48')]=_0x136fca[_0xa0fe('0x48')]||undefined;this[_0xa0fe('0x49')]=strategy[_0x136fca['strategy']]||_0xa0fe('0x9');this[_0xa0fe('0x4a')]=!![];this[_0xa0fe('0x4b')]=_0x136fca[_0xa0fe('0x4b')]||![];this[_0xa0fe('0x4c')]=_0x136fca[_0xa0fe('0x4c')];this[_0xa0fe('0x4d')]=_0x136fca['dialAMDGreeting'];this[_0xa0fe('0x4e')]=_0x136fca[_0xa0fe('0x4e')];this[_0xa0fe('0x4f')]=_0x136fca[_0xa0fe('0x4f')];this[_0xa0fe('0x50')]=_0x136fca[_0xa0fe('0x50')];this[_0xa0fe('0x51')]=_0x136fca[_0xa0fe('0x51')];this['dialAMDMaximumNumberOfWords']=_0x136fca['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x136fca[_0xa0fe('0x52')];this[_0xa0fe('0x53')]=_0x136fca[_0xa0fe('0x53')];this[_0xa0fe('0x54')]=0x0;this[_0xa0fe('0x55')]=0x0;this[_0xa0fe('0x56')]=_0x136fca[_0xa0fe('0x56')];this[_0xa0fe('0x57')]=0x0;this[_0xa0fe('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xa0fe('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa0fe('0x5a')]=0x0;this[_0xa0fe('0x5b')]=0x0;this[_0xa0fe('0x5c')]=0x0;this[_0xa0fe('0x5d')]=0x0;this[_0xa0fe('0x5e')]=0x0;this[_0xa0fe('0x5f')]=0x0;this[_0xa0fe('0x60')]=0x0;this['outboundReCallsDay']=0x0;this[_0xa0fe('0x61')]=0x0;this['startProgressive']=undefined;this[_0xa0fe('0x62')]=undefined;this[_0xa0fe('0x63')]=undefined;this[_0xa0fe('0x64')]=1.05;this[_0xa0fe('0x65')]=0x0;this[_0xa0fe('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xa0fe('0x67')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xa0fe('0x68')]=0x0;this[_0xa0fe('0x69')]=0x0;this[_0xa0fe('0x6a')]=0x0;this[_0xa0fe('0x6b')]=_0x136fca[_0xa0fe('0x6c')]||0x14;this[_0xa0fe('0x6d')]=_0x136fca[_0xa0fe('0x6c')]||0xa;this[_0xa0fe('0x6e')]=0x0;this[_0xa0fe('0x6f')]=0x0;this[_0xa0fe('0x70')]=0x1;this[_0xa0fe('0x71')]=0x0;this[_0xa0fe('0x72')]=0x0;this[_0xa0fe('0x73')]=0x0;this[_0xa0fe('0x74')]=0x0;this['dialRecallMeTimeout']=_0x136fca[_0xa0fe('0x75')]||0x1e;this[_0xa0fe('0x76')]=_0x136fca[_0xa0fe('0x76')]||![];this[_0xa0fe('0x77')]=!!_0x136fca[_0xa0fe('0x77')]||![];this[_0xa0fe('0x78')]=!!_0x136fca[_0xa0fe('0x78')]||![];this[_0xa0fe('0x79')]=_0x136fca['dialQueueProject2']||undefined;this[_0xa0fe('0x7a')]=_0x136fca[_0xa0fe('0x7a')]||![];this[_0xa0fe('0x7b')]=_0x136fca[_0xa0fe('0x7b')]||![];this[_0xa0fe('0xb')]=monitorFormat[_0x136fca[_0xa0fe('0xb')]]?monitorFormat[_0x136fca[_0xa0fe('0xb')]]:undefined;this[_0xa0fe('0x7c')]=_0x136fca[_0xa0fe('0x7c')]||![];this['mandatoryDispositionPause']=_0x136fca[_0xa0fe('0x7d')]?_0x136fca[_0xa0fe('0x7d')]:undefined;}module[_0xa0fe('0x7e')]=VoiceQueue; \ No newline at end of file +var _0x9792=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x32f2f5,_0x2b8188){var _0x3a3364=function(_0x2c40f4){while(--_0x2c40f4){_0x32f2f5['push'](_0x32f2f5['shift']());}};_0x3a3364(++_0x2b8188);}(_0x9792,0xb9));var _0x2979=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9792[_0x19950b];return _0x3c6b41;};'use strict';var statusDesc=[_0x2979('0x0'),_0x2979('0x1'),_0x2979('0x2'),_0x2979('0x3'),_0x2979('0x4'),'unavailable','ringing',_0x2979('0x5'),'onhold'];var monitorFormat={'wav':_0x2979('0x6'),'wav49':_0x2979('0x7'),'gsm':_0x2979('0x8')};var strategy={'rrmemory':_0x2979('0x9'),'roundrobin':_0x2979('0xa')};function VoiceQueue(_0x38f523){this['id']=_0x38f523['id']||0x0;this['name']=_0x38f523['name']||'';this['monitor_format']=_0x38f523[_0x2979('0xb')]||'';this[_0x2979('0xc')]=_0x38f523[_0x2979('0xc')]||'inbound';this[_0x2979('0xd')]=0x0;this[_0x2979('0xe')]=0x0;this[_0x2979('0xf')]=0x0;this[_0x2979('0x10')]=0x0;this[_0x2979('0x11')]=0x0;this[_0x2979('0x12')]=0x0;this[_0x2979('0x13')]=0x0;this['unmanaged']=0x0;this[_0x2979('0x14')]=0x0;this['loggedIn']=0x0;this[_0x2979('0x15')]=0x0;this[_0x2979('0x16')]=_0x38f523[_0x2979('0x16')]||![];this[_0x2979('0x17')]=_0x38f523[_0x2979('0x17')]||0xa;this[_0x2979('0x18')]=_0x38f523[_0x2979('0x18')]||'no';this[_0x2979('0x19')]=!![];this[_0x2979('0x1a')]='';this[_0x2979('0x1b')]=0x0;this[_0x2979('0x1c')]=0x0;this[_0x2979('0x1d')]=_0x38f523[_0x2979('0x1d')]||null;this[_0x2979('0x1e')]=_0x38f523[_0x2979('0x1e')]?_0x38f523[_0x2979('0x1e')]:null;this[_0x2979('0x1f')]=_0x38f523[_0x2979('0x1f')];this[_0x2979('0x20')]=_0x38f523[_0x2979('0x20')]||_0x2979('0x21');this[_0x2979('0x22')]=_0x38f523[_0x2979('0x22')]||0x0;this[_0x2979('0x23')]=_0x38f523[_0x2979('0x23')]||0x0;this['dialPowerLevel']=_0x38f523['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x38f523[_0x2979('0x24')]||_0x2979('0x25');this[_0x2979('0x26')]=_0x38f523[_0x2979('0x26')]||0.03;this[_0x2979('0x27')]=_0x38f523[_0x2979('0x27')]||0x258;this[_0x2979('0x28')]=_0x38f523['dialOriginateCallerIdName']||_0x2979('0x29');this[_0x2979('0x2a')]=_0x38f523['dialOriginateCallerIdNumber']||_0x2979('0x29');this[_0x2979('0x2b')]=_0x38f523['dialOriginateTimeout']||0x1e;this[_0x2979('0x2c')]=_0x38f523[_0x2979('0x2c')]||_0x2979('0x2d');this[_0x2979('0x2e')]=_0x38f523['dialQueueTimeout']||0x3;this[_0x2979('0x2f')]=_0x38f523[_0x2979('0x2f')]||undefined;this[_0x2979('0x30')]=_0x38f523[_0x2979('0x30')]||0x3;this[_0x2979('0x31')]=_0x38f523['dialCongestionRetryFrequency']||0x96;this[_0x2979('0x32')]=_0x38f523[_0x2979('0x32')]||0x3;this[_0x2979('0x33')]=_0x38f523[_0x2979('0x33')]||0x96;this[_0x2979('0x34')]=_0x38f523[_0x2979('0x34')]||0x3;this[_0x2979('0x35')]=_0x38f523[_0x2979('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x38f523[_0x2979('0x36')]||0x3;this[_0x2979('0x37')]=_0x38f523[_0x2979('0x37')]||0x96;this[_0x2979('0x38')]=_0x38f523[_0x2979('0x38')]||0x3;this['dialDropRetryFrequency']=_0x38f523['dialDropRetryFrequency']||0x96;this[_0x2979('0x39')]=_0x38f523[_0x2979('0x39')]||0x3;this[_0x2979('0x3a')]=_0x38f523[_0x2979('0x3a')]||0x96;this[_0x2979('0x3b')]=_0x38f523['dialMachineMaxRetry']||0x3;this[_0x2979('0x3c')]=_0x38f523[_0x2979('0x3c')]||0x96;this[_0x2979('0x3d')]=_0x38f523[_0x2979('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x38f523[_0x2979('0x3e')]||0x96;this[_0x2979('0x3f')]=_0x38f523[_0x2979('0x3f')]||0x4;this['Trunk']=_0x38f523[_0x2979('0x40')]?_0x38f523[_0x2979('0x40')]:undefined;this[_0x2979('0x41')]=_0x38f523['TrunkBackup']?_0x38f523[_0x2979('0x41')]:undefined;this[_0x2979('0x42')]=_0x38f523[_0x2979('0x42')]||undefined;this['Interval']=_0x38f523['Interval']?_0x38f523[_0x2979('0x43')]:undefined;this[_0x2979('0x44')]=_0x38f523['dialOrderByScheduledAt']||'DESC';this[_0x2979('0x45')]=_0x38f523[_0x2979('0x45')]||undefined;this['dialCutDigit']=_0x38f523['dialCutDigit']||undefined;this[_0x2979('0x46')]=strategy[_0x38f523[_0x2979('0x46')]]||_0x2979('0x9');this[_0x2979('0x47')]=!![];this[_0x2979('0x48')]=_0x38f523[_0x2979('0x48')]||![];this[_0x2979('0x49')]=_0x38f523['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x38f523[_0x2979('0x4a')];this[_0x2979('0x4b')]=_0x38f523[_0x2979('0x4b')];this[_0x2979('0x4c')]=_0x38f523[_0x2979('0x4c')];this[_0x2979('0x4d')]=_0x38f523[_0x2979('0x4d')];this[_0x2979('0x4e')]=_0x38f523['dialAMDBetweenWordsSilence'];this[_0x2979('0x4f')]=_0x38f523[_0x2979('0x4f')];this[_0x2979('0x50')]=_0x38f523[_0x2979('0x50')];this[_0x2979('0x51')]=_0x38f523[_0x2979('0x51')];this[_0x2979('0x52')]=0x0;this['pTalking']=0x0;this[_0x2979('0x53')]=_0x38f523[_0x2979('0x53')];this[_0x2979('0x54')]=0x0;this[_0x2979('0x55')]=0x0;this[_0x2979('0x56')]=0x0;this[_0x2979('0x57')]=0x0;this[_0x2979('0x58')]=0x0;this[_0x2979('0x59')]=0x0;this[_0x2979('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x2979('0x5b')]=0x0;this[_0x2979('0x5c')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x2979('0x5d')]=undefined;this[_0x2979('0x5e')]=undefined;this[_0x2979('0x5f')]=undefined;this[_0x2979('0x60')]=1.05;this[_0x2979('0x61')]=0x0;this[_0x2979('0x62')]=0x0;this[_0x2979('0x63')]=0x0;this[_0x2979('0x64')]=0x0;this[_0x2979('0x65')]=0x0;this[_0x2979('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2979('0x67')]=0x0;this[_0x2979('0x68')]=_0x38f523[_0x2979('0x69')]||0x14;this[_0x2979('0x6a')]=_0x38f523['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x2979('0x6b')]=0x1;this[_0x2979('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this[_0x2979('0x6d')]=0x0;this[_0x2979('0x6e')]=0x0;this[_0x2979('0x6f')]=_0x38f523['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x38f523['dialRecallInQueue']||![];this[_0x2979('0x70')]=!!_0x38f523['dialPreviewAutoRecallMe']||![];this[_0x2979('0x71')]=!!_0x38f523[_0x2979('0x71')]||![];this['dialQueueProject2']=_0x38f523[_0x2979('0x72')]||undefined;this[_0x2979('0x73')]=_0x38f523[_0x2979('0x73')]||![];this[_0x2979('0x74')]=_0x38f523[_0x2979('0x74')]||![];this[_0x2979('0xb')]=monitorFormat[_0x38f523['monitor_format']]?monitorFormat[_0x38f523[_0x2979('0xb')]]:undefined;this['mandatoryDisposition']=_0x38f523[_0x2979('0x75')]||![];this[_0x2979('0x76')]=_0x38f523[_0x2979('0x76')]?_0x38f523[_0x2979('0x76')]:undefined;}module[_0x2979('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a572543..9f70f08 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 _0x4616=['Configurations','exports','name','username','accessKey','serverUrl'];(function(_0x31a715,_0x5e27d7){var _0x41c35a=function(_0x4a73d9){while(--_0x4a73d9){_0x31a715['push'](_0x31a715['shift']());}};_0x41c35a(++_0x5e27d7);}(_0x4616,0x176));var _0x6461=function(_0x1df93e,_0x169d5b){_0x1df93e=_0x1df93e-0x0;var _0x31d4ec=_0x4616[_0x1df93e];return _0x31d4ec;};'use strict';function VtigerAccount(_0x1c63a0){this['id']=_0x1c63a0['id']||0x0;this[_0x6461('0x0')]=_0x1c63a0[_0x6461('0x0')]||'';this[_0x6461('0x1')]=_0x1c63a0[_0x6461('0x1')]||'';this[_0x6461('0x2')]=_0x1c63a0[_0x6461('0x2')]||'';this['remoteUri']=_0x1c63a0['remoteUri']||'';this['serverUrl']=_0x1c63a0[_0x6461('0x3')]||'';this[_0x6461('0x4')]=_0x1c63a0[_0x6461('0x4')]||{};}module[_0x6461('0x5')]=VtigerAccount; \ No newline at end of file +var _0xe698=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1e2c3b,_0x5bf556){var _0x379590=function(_0x1839c2){while(--_0x1839c2){_0x1e2c3b['push'](_0x1e2c3b['shift']());}};_0x379590(++_0x5bf556);}(_0xe698,0xd7));var _0x8e69=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe698[_0x19950b];return _0x3c6b41;};'use strict';function VtigerAccount(_0x2229e8){this['id']=_0x2229e8['id']||0x0;this['name']=_0x2229e8[_0x8e69('0x0')]||'';this[_0x8e69('0x1')]=_0x2229e8[_0x8e69('0x1')]||'';this[_0x8e69('0x2')]=_0x2229e8[_0x8e69('0x2')]||'';this[_0x8e69('0x3')]=_0x2229e8['remoteUri']||'';this[_0x8e69('0x4')]=_0x2229e8[_0x8e69('0x4')]||'';this[_0x8e69('0x5')]=_0x2229e8[_0x8e69('0x5')]||{};}module[_0x8e69('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 40a5551..02919f6 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 _0x92bb=['remoteUri','authType','type','integrationTab','serverUrl','exports','name','username','password','token'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x92bb,0x1b4));var _0xb92b=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x92bb[_0x49e584];return _0x58b1be;};'use strict';function ZendeskAccount(_0x446527){this['id']=_0x446527['id']||0x0;this[_0xb92b('0x0')]=_0x446527[_0xb92b('0x0')]||'';this[_0xb92b('0x1')]=_0x446527[_0xb92b('0x1')]||'';this['password']=_0x446527[_0xb92b('0x2')]||'';this[_0xb92b('0x3')]=_0x446527['token']||'';this[_0xb92b('0x4')]=_0x446527[_0xb92b('0x4')]||'';this['authType']=_0x446527[_0xb92b('0x5')]||'';this[_0xb92b('0x6')]=_0x446527[_0xb92b('0x6')]||_0xb92b('0x7');this[_0xb92b('0x8')]=_0x446527[_0xb92b('0x8')]||'';this['Configurations']=_0x446527['Configurations']||{};}module[_0xb92b('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xd270=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password'];(function(_0x271329,_0x391784){var _0x9cc80d=function(_0x33c321){while(--_0x33c321){_0x271329['push'](_0x271329['shift']());}};_0x9cc80d(++_0x391784);}(_0xd270,0x1b7));var _0x0d27=function(_0x5494fa,_0x3e1301){_0x5494fa=_0x5494fa-0x0;var _0x38993b=_0xd270[_0x5494fa];return _0x38993b;};'use strict';function ZendeskAccount(_0x158f2a){this['id']=_0x158f2a['id']||0x0;this['name']=_0x158f2a['name']||'';this[_0x0d27('0x0')]=_0x158f2a[_0x0d27('0x0')]||'';this[_0x0d27('0x1')]=_0x158f2a[_0x0d27('0x1')]||'';this['token']=_0x158f2a['token']||'';this[_0x0d27('0x2')]=_0x158f2a[_0x0d27('0x2')]||'';this[_0x0d27('0x3')]=_0x158f2a['authType']||'';this[_0x0d27('0x4')]=_0x158f2a[_0x0d27('0x4')]||_0x0d27('0x5');this[_0x0d27('0x6')]=_0x158f2a['serverUrl']||'';this[_0x0d27('0x7')]=_0x158f2a['Configurations']||{};}module[_0x0d27('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index acfc6dc..8702819 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 _0x2f0b=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x4d242d,_0x34ce2a){var _0xd265f2=function(_0x501dc6){while(--_0x501dc6){_0x4d242d['push'](_0x4d242d['shift']());}};_0xd265f2(++_0x34ce2a);}(_0x2f0b,0x14b));var _0xb2f0=function(_0x28527a,_0x2a5d57){_0x28527a=_0x28527a-0x0;var _0x209fae=_0x2f0b[_0x28527a];return _0x209fae;};'use strict';function ZohoAccount(_0x16d9a3){this['id']=_0x16d9a3['id']||0x0;this[_0xb2f0('0x0')]=_0x16d9a3['name']||'';this[_0xb2f0('0x1')]=_0x16d9a3[_0xb2f0('0x1')]||'';this['host']=_0x16d9a3[_0xb2f0('0x2')]||'';this['zone']=_0x16d9a3[_0xb2f0('0x3')]||'';this[_0xb2f0('0x4')]=_0x16d9a3[_0xb2f0('0x4')]||'';this[_0xb2f0('0x5')]=_0x16d9a3[_0xb2f0('0x5')]||'';this[_0xb2f0('0x6')]=_0x16d9a3[_0xb2f0('0x6')]||'';this[_0xb2f0('0x7')]=_0x16d9a3[_0xb2f0('0x7')]||'';this[_0xb2f0('0x8')]=_0x16d9a3[_0xb2f0('0x8')]||'';this['Configurations']=_0x16d9a3[_0xb2f0('0x9')]||{};}module[_0xb2f0('0xa')]=ZohoAccount; \ No newline at end of file +var _0x7a63=['code','refreshToken','Configurations','name','description','host','zone','clientSecret','serverUrl'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0x7a63,0x1e9));var _0x37a6=function(_0xe5520b,_0x5e0a35){_0xe5520b=_0xe5520b-0x0;var _0x5d862c=_0x7a63[_0xe5520b];return _0x5d862c;};'use strict';function ZohoAccount(_0x1707cc){this['id']=_0x1707cc['id']||0x0;this[_0x37a6('0x0')]=_0x1707cc[_0x37a6('0x0')]||'';this[_0x37a6('0x1')]=_0x1707cc[_0x37a6('0x1')]||'';this[_0x37a6('0x2')]=_0x1707cc['host']||'';this[_0x37a6('0x3')]=_0x1707cc[_0x37a6('0x3')]||'';this['clientId']=_0x1707cc['clientId']||'';this['clientSecret']=_0x1707cc[_0x37a6('0x4')]||'';this[_0x37a6('0x5')]=_0x1707cc[_0x37a6('0x5')]||'';this['code']=_0x1707cc[_0x37a6('0x6')]||'';this['refreshToken']=_0x1707cc[_0x37a6('0x7')]||'';this[_0x37a6('0x8')]=_0x1707cc[_0x37a6('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6795ebd..cdecbba 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 _0x156c=['isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','lodash'];(function(_0x33924e,_0x2e42e0){var _0x4c39fd=function(_0x5f3740){while(--_0x5f3740){_0x33924e['push'](_0x33924e['shift']());}};_0x4c39fd(++_0x2e42e0);}(_0x156c,0x1df));var _0xc156=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x156c[_0x20ef64];return _0x3707d8;};'use strict';var util=require('util');var _=require(_0xc156('0x0'));var moment=require('moment');function checkNameSurname(_0x18ed86,_0x31013a,_0x32dc71){var _0xad3d39='';if(!_[_0xc156('0x1')](_0x31013a)&&'string'===typeof _0x31013a){_0xad3d39+=_0x31013a;}if(!_[_0xc156('0x1')](_0x32dc71)&&_0xc156('0x2')===typeof _0x32dc71){_0xad3d39+='\x20'+_0x32dc71;}if(_0xad3d39!==''){return _0xad3d39;}return _0x18ed86;}function Action(_0x286142,_0x4d85c4,_0x507cc8,_0x4d3383,_0x5f40e9){this['uniqueid']=_0x507cc8||undefined;this[_0xc156('0x3')]=_0x286142['id'];this[_0xc156('0x4')]=_0x4d85c4['name'];this[_0xc156('0x5')]=_0x4d85c4['type'];this[_0xc156('0x6')]=_0xc156('0x4');this[_0xc156('0x7')]=![];this[_0xc156('0x8')]=_[_0xc156('0x1')](_0x286142['Agent'])?undefined:_0x286142[_0xc156('0x9')][_0xc156('0xa')];this['channelAgent']=this['membername']?util['format']('SIP/%s',this[_0xc156('0x8')]):_0x4d3383||undefined;this[_0xc156('0xb')]=checkNameSurname(_0x286142[_0xc156('0xc')][_0xc156('0xd')],_0x286142[_0xc156('0xc')][_0xc156('0xe')],_0x286142['Contact'][_0xc156('0xf')]);this[_0xc156('0x10')]=_0x286142[_0xc156('0x10')]||![];this['calleridnum']=_0x286142[_0xc156('0xc')]['phone'];this[_0xc156('0x11')]=_0x286142[_0xc156('0x11')];this[_0xc156('0x12')]=_0x286142['countbusyretry']||0x0;this['countcongestionretry']=_0x286142['countcongestionretry']||0x0;this['countnoanswerretry']=_0x286142[_0xc156('0x13')]||0x0;this[_0xc156('0x14')]=(_0x286142[_0xc156('0x12')]||0x0)+(_0x286142['countcongestionretry']||0x0)+(_0x286142[_0xc156('0x13')]||0x0)+(_0x286142[_0xc156('0x15')]||0x0)+(_0x286142[_0xc156('0x16')]||0x0)+(_0x286142[_0xc156('0x17')]||0x0)+(_0x286142[_0xc156('0x18')]||0x0)+(_0x286142[_0xc156('0x19')]||0x0);this[_0xc156('0x15')]=_0x286142[_0xc156('0x15')]||0x0;this['countdropretry']=_0x286142[_0xc156('0x16')]||0x0;this[_0xc156('0x17')]=_0x286142['countabandonedretry']||0x0;this['countmachineretry']=_0x286142[_0xc156('0x18')]||0x0;this['countagentrejectretry']=_0x286142[_0xc156('0x19')]||0x0;this['callback']=_0x286142[_0xc156('0x1a')];this['callbackuniqueid']=_0x286142[_0xc156('0x1b')];this[_0xc156('0x1c')]=_0x286142[_0xc156('0x1c')];this[_0xc156('0x1d')]=_0x286142[_0xc156('0x1d')];this['ContactId']=_0x286142[_0xc156('0x1e')];this[_0xc156('0x1f')]=_0x286142[_0xc156('0x1f')];this['UserId']=_['isNil'](_0x286142[_0xc156('0x9')])?_0x286142[_0xc156('0x20')]:_0x286142[_0xc156('0x9')]['id'];this[_0xc156('0x21')]=_0x286142[_0xc156('0x21')];this['originatecalleridnum']='';this[_0xc156('0x22')]='';}Action['prototype'][_0xc156('0x23')]=function(){return util[_0xc156('0x24')](_0xc156('0x25'),this[_0xc156('0xb')],this[_0xc156('0x26')]);};module[_0xc156('0x27')]=Action; \ No newline at end of file +var _0x35f3=['countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','isNil','string','uniqueid','idContact','queue','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x59cb43,_0xa451a){var _0x1bdcc5=function(_0x46f5e9){while(--_0x46f5e9){_0x59cb43['push'](_0x59cb43['shift']());}};_0x1bdcc5(++_0xa451a);}(_0x35f3,0xdb));var _0x335f=function(_0x31dc9e,_0x4e9999){_0x31dc9e=_0x31dc9e-0x0;var _0x114dff=_0x35f3[_0x31dc9e];return _0x114dff;};'use strict';var util=require(_0x335f('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x426606,_0x313b18,_0x475487){var _0x20966e='';if(!_[_0x335f('0x1')](_0x313b18)&&_0x335f('0x2')===typeof _0x313b18){_0x20966e+=_0x313b18;}if(!_[_0x335f('0x1')](_0x475487)&&_0x335f('0x2')===typeof _0x475487){_0x20966e+='\x20'+_0x475487;}if(_0x20966e!==''){return _0x20966e;}return _0x426606;}function Action(_0x29f62b,_0x3f9e8c,_0x48d67f,_0x49589f,_0x29f7dd){this[_0x335f('0x3')]=_0x48d67f||undefined;this[_0x335f('0x4')]=_0x29f62b['id'];this[_0x335f('0x5')]=_0x3f9e8c['name'];this[_0x335f('0x6')]=_0x3f9e8c['type'];this['campaigntype']=_0x335f('0x5');this[_0x335f('0x7')]=![];this[_0x335f('0x8')]=_['isNil'](_0x29f62b[_0x335f('0x9')])?undefined:_0x29f62b['Agent']['name'];this[_0x335f('0xa')]=this['membername']?util[_0x335f('0xb')](_0x335f('0xc'),this['membername']):_0x49589f||undefined;this[_0x335f('0xd')]=checkNameSurname(_0x29f62b[_0x335f('0xe')][_0x335f('0xf')],_0x29f62b[_0x335f('0xe')][_0x335f('0x10')],_0x29f62b['Contact'][_0x335f('0x11')]);this['active']=_0x29f62b[_0x335f('0x12')]||![];this[_0x335f('0x13')]=_0x29f62b[_0x335f('0xe')][_0x335f('0xf')];this['scheduledat']=_0x29f62b[_0x335f('0x14')];this[_0x335f('0x15')]=_0x29f62b[_0x335f('0x15')]||0x0;this['countcongestionretry']=_0x29f62b[_0x335f('0x16')]||0x0;this[_0x335f('0x17')]=_0x29f62b['countnoanswerretry']||0x0;this[_0x335f('0x18')]=(_0x29f62b[_0x335f('0x15')]||0x0)+(_0x29f62b[_0x335f('0x16')]||0x0)+(_0x29f62b[_0x335f('0x17')]||0x0)+(_0x29f62b[_0x335f('0x19')]||0x0)+(_0x29f62b['countdropretry']||0x0)+(_0x29f62b[_0x335f('0x1a')]||0x0)+(_0x29f62b[_0x335f('0x1b')]||0x0)+(_0x29f62b[_0x335f('0x1c')]||0x0);this[_0x335f('0x19')]=_0x29f62b[_0x335f('0x19')]||0x0;this[_0x335f('0x1d')]=_0x29f62b[_0x335f('0x1d')]||0x0;this[_0x335f('0x1a')]=_0x29f62b['countabandonedretry']||0x0;this['countmachineretry']=_0x29f62b['countmachineretry']||0x0;this[_0x335f('0x1c')]=_0x29f62b['countagentrejectretry']||0x0;this[_0x335f('0x1e')]=_0x29f62b[_0x335f('0x1e')];this[_0x335f('0x1f')]=_0x29f62b[_0x335f('0x1f')];this[_0x335f('0x20')]=_0x29f62b[_0x335f('0x20')];this['recallme']=_0x29f62b['recallme'];this['ContactId']=_0x29f62b['ContactId'];this['ListId']=_0x29f62b['ListId'];this[_0x335f('0x21')]=_[_0x335f('0x1')](_0x29f62b[_0x335f('0x9')])?_0x29f62b['UserId']:_0x29f62b['Agent']['id'];this[_0x335f('0x22')]=_0x29f62b[_0x335f('0x22')];this[_0x335f('0x23')]='';this[_0x335f('0x24')]='';}Action['prototype'][_0x335f('0x25')]=function(){return util['format'](_0x335f('0x26'),this['calleridname'],this[_0x335f('0x27')]);};module[_0x335f('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 03edeca..fe9cc2c 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 _0xcb66=['execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlockContact','disableContact','recallme','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Agent','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','dialCutDigit','trim','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','OriginateError','[originateFailure][logOriginateFailure]','responsetime','isFailure','idContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','dialend','syncDialEnd','bind','newexten','syncNewExten','syncVarSet','loopCampaigns','type','outbound','name','answered','available','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','hasOwnProperty','clockClearZombieChannels','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','actions','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','starttime','format','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','pTalking','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0xcb66,0x19f));var _0x6cb6=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xcb66[_0x45d3f0];return _0x314b79;};'use strict';var util=require('util');var _=require(_0x6cb6('0x0'));var BPromise=require(_0x6cb6('0x1'));var uuid=require(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var md5=require(_0x6cb6('0x4'));var Redis=require('ioredis');var config=require(_0x6cb6('0x5'));var logger=require(_0x6cb6('0x6'))(_0x6cb6('0x7'));var loggerAction=require(_0x6cb6('0x6'))(_0x6cb6('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x6cb6('0x9'));var ut=require(_0x6cb6('0xa'));config[_0x6cb6('0xb')]=_[_0x6cb6('0xc')](config[_0x6cb6('0xb')],{'host':_0x6cb6('0xd'),'port':0x18eb});var io=require(_0x6cb6('0xe'))(new Redis(config[_0x6cb6('0xb')]));var Sequence=function(){};Sequence[_0x6cb6('0xf')][_0x6cb6('0x10')]=function(_0x3aa2b5){this[_0x6cb6('0x11')]=this[_0x6cb6('0x11')]?this['tail']['finally'](_0x3aa2b5):_0x3aa2b5();};function Preview(_0x576aea){this['sequence']=new Sequence();this[_0x6cb6('0x12')]=_0x576aea[_0x6cb6('0x13')];this[_0x6cb6('0x14')]=_0x576aea[_0x6cb6('0x14')];this['actions']={};this[_0x6cb6('0x15')]=_0x576aea[_0x6cb6('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x6cb6('0x16'),this[_0x6cb6('0x17')]['bind'](this));ami['on'](_0x6cb6('0x18'),this[_0x6cb6('0x19')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x6cb6('0x1a'),this[_0x6cb6('0x1b')][_0x6cb6('0x1c')](this));ami['on'](_0x6cb6('0x1d'),this[_0x6cb6('0x1e')][_0x6cb6('0x1c')](this));ami['on']('varset',this[_0x6cb6('0x1f')][_0x6cb6('0x1c')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x6cb6('0x20')](this[_0x6cb6('0x12')]);}function emit(_0x407455,_0x2d41c4,_0xc5dea0){io['to'](_0x407455)['emit'](_0x2d41c4,_0xc5dea0);}function emitCampaignPreview(_0x520c9e){if(_0x520c9e[_0x6cb6('0x21')]===_0x6cb6('0x22')){var _0x1c4bcd={'id':_0x520c9e['id'],'name':_0x520c9e[_0x6cb6('0x23')],'strategy':_0x520c9e['strategy'],'answered':_0x520c9e[_0x6cb6('0x24')],'available':_0x520c9e[_0x6cb6('0x25')],'loggedIn':_0x520c9e['loggedIn'],'pTalking':_0x520c9e['pTalking'],'sumBillable':_0x520c9e[_0x6cb6('0x26')],'sumDuration':_0x520c9e['sumDuration'],'sumHoldTime':_0x520c9e[_0x6cb6('0x27')]||0x0,'talking':_0x520c9e[_0x6cb6('0x28')],'total':_0x520c9e[_0x6cb6('0x29')],'type':_0x520c9e[_0x6cb6('0x21')],'unmanaged':_0x520c9e[_0x6cb6('0x2a')],'abandoned':_0x520c9e[_0x6cb6('0x2b')],'waiting':_0x520c9e[_0x6cb6('0x2c')],'loggedInDb':_0x520c9e[_0x6cb6('0x2d')],'dialActive':_0x520c9e[_0x6cb6('0x2e')],'dialMethod':_0x520c9e[_0x6cb6('0x2f')],'dialOriginateCallerIdName':_0x520c9e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x520c9e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x520c9e['dialOriginateTimeout'],'dialPrefix':_0x520c9e[_0x6cb6('0x30')],'outboundAnswerAgiCallsDay':_0x520c9e[_0x6cb6('0x31')],'outboundAnswerCallsDay':_0x520c9e[_0x6cb6('0x32')],'outboundBlacklistCallsDay':_0x520c9e[_0x6cb6('0x33')],'outboundBusyCallsDay':_0x520c9e[_0x6cb6('0x34')],'outboundCongestionCallsDay':_0x520c9e[_0x6cb6('0x35')],'outboundDropCallsDayACS':_0x520c9e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x520c9e[_0x6cb6('0x36')],'outboundDropCallsDayTimeout':_0x520c9e['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x520c9e[_0x6cb6('0x37')],'outboundNoSuchCallsDay':_0x520c9e['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x520c9e[_0x6cb6('0x38')],'outboundReCallsDay':_0x520c9e[_0x6cb6('0x39')],'outboundRejectCallsDay':_0x520c9e[_0x6cb6('0x3a')],'outboundUnknownCallsDay':_0x520c9e['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x520c9e[_0x6cb6('0x3b')],'predictiveIntervalAnsweredCalls':_0x520c9e[_0x6cb6('0x3c')],'predictiveIntervalAvgHoldtime':_0x520c9e[_0x6cb6('0x3d')],'predictiveIntervalAvgTalktime':_0x520c9e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x520c9e[_0x6cb6('0x3e')],'predictiveIntervalDroppedCallsTimeout':_0x520c9e[_0x6cb6('0x3f')],'predictiveIntervalErlangCalls':_0x520c9e[_0x6cb6('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x520c9e['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x520c9e[_0x6cb6('0x41')],'predictiveIntervalMultiplicativeFactor':_0x520c9e[_0x6cb6('0x42')],'predictiveIntervalPauses':_0x520c9e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x520c9e[_0x6cb6('0x43')],'predictiveIntervalTotalCalls':_0x520c9e[_0x6cb6('0x44')],'message':_0x520c9e[_0x6cb6('0x45')],'originated':_0x520c9e[_0x6cb6('0x46')],'erlangCalls':_0x520c9e[_0x6cb6('0x47')],'erlangCallToSecond':_0x520c9e[_0x6cb6('0x48')],'erlangAbandonmentRate':_0x520c9e[_0x6cb6('0x49')],'erlangBusyFactor':_0x520c9e[_0x6cb6('0x4a')],'startPredictive':_0x520c9e[_0x6cb6('0x4b')],'startProgressive':_0x520c9e[_0x6cb6('0x4c')]};if(_0x520c9e['Trunk']){_0x1c4bcd[_0x6cb6('0x4d')]={'id':_0x520c9e[_0x6cb6('0x4d')]['id'],'name':_0x520c9e[_0x6cb6('0x4d')][_0x6cb6('0x23')],'active':_0x520c9e['Trunk']['active'],'callerid':_0x520c9e['Trunk'][_0x6cb6('0x4e')]};}if(_0x520c9e[_0x6cb6('0x4f')]){_0x1c4bcd[_0x6cb6('0x4f')]={'id':_0x520c9e[_0x6cb6('0x4f')]['id'],'name':_0x520c9e[_0x6cb6('0x4f')][_0x6cb6('0x23')]};}var _0x317c84=md5(JSON[_0x6cb6('0x50')](_0x1c4bcd));if(_0x520c9e['md5']!==_0x317c84){_0x520c9e[_0x6cb6('0x4')]=_0x317c84;emit(util['format'](_0x6cb6('0x51'),_0x1c4bcd[_0x6cb6('0x23')]),_0x6cb6('0x52'),_0x1c4bcd);}}}function emitVoiceQueueChannelRemove(_0x20a881){logger[_0x6cb6('0x53')](_0x6cb6('0x54'),JSON[_0x6cb6('0x50')](_0x20a881));emit(util['format'](_0x6cb6('0x51'),_0x20a881['name']),_0x6cb6('0x55'),_0x20a881);io[_0x6cb6('0x56')](_0x6cb6('0x57'),_0x20a881);}function notSendMessagesQueue(_0x5a60a0){if(_0x5a60a0['sendMessageOneNotActive']){if(_0x5a60a0[_0x6cb6('0x46')]===0x0&&_0x5a60a0['pTalking']===0x0){_0x5a60a0[_0x6cb6('0x58')]=![];_0x5a60a0[_0x6cb6('0x25')]=0x0;_0x5a60a0[_0x6cb6('0x59')]=0x0;_0x5a60a0[_0x6cb6('0x45')]=_0x6cb6('0x5a');ut[_0x6cb6('0x5b')](_0x6cb6('0x5c'),_0x5a60a0['name']+_0x6cb6('0x5d'));}else{_0x5a60a0[_0x6cb6('0x45')]='IS_DISACTIVED';ut[_0x6cb6('0x5b')](_0x6cb6('0x5c'),_0x5a60a0[_0x6cb6('0x23')]+_0x6cb6('0x5e'));}emitCampaignPreview(_0x5a60a0);}}Preview[_0x6cb6('0xf')][_0x6cb6('0x20')]=function(){var _0x571cba=this;setInterval(function(){_0x571cba['syncCampaigns']();},0x7cf);};Preview[_0x6cb6('0xf')]['syncCampaigns']=function(){var _0x588ea4=this[_0x6cb6('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x428d65 in _0x588ea4){if(_0x588ea4[_0x6cb6('0x5f')](_0x428d65)&&(_0x588ea4[_0x428d65]['dialMethod']==='preview'||_0x588ea4[_0x428d65][_0x6cb6('0x2f')]==='booked')&&_0x588ea4[_0x428d65][_0x6cb6('0x21')]===_0x6cb6('0x22')){if(this['clockClearZombieChannels']>0x7){this[_0x6cb6('0x60')]=0x0;this[_0x6cb6('0x61')]();}}if(_0x588ea4['hasOwnProperty'](_0x428d65)&&_0x588ea4[_0x428d65][_0x6cb6('0x2f')]==='preview'&&_0x588ea4[_0x428d65][_0x6cb6('0x21')]===_0x6cb6('0x22')){if(_0x588ea4[_0x428d65]['dialActive']){this[_0x6cb6('0x62')](_0x588ea4[_0x428d65]);if(_0x588ea4[_0x428d65][_0x6cb6('0x63')])this['recallMe'](_0x588ea4[_0x428d65]);}else{notSendMessagesQueue(_0x588ea4[_0x428d65]);}}}};Preview['prototype'][_0x6cb6('0x64')]=function(_0x22dcc5){var _0x1d301f=this;this['sequence'][_0x6cb6('0x10')](function(){if(!_[_0x6cb6('0x65')](_0x1d301f['actions'][_0x22dcc5])){loggerAction[_0x6cb6('0x53')](_0x6cb6('0x66'),_0x22dcc5,_0x6cb6('0x67'),_0x1d301f['actions'][_0x22dcc5][_0x6cb6('0x68')],_0x6cb6('0x69'),JSON[_0x6cb6('0x50')](_0x1d301f[_0x6cb6('0x12')][_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x68')]]['originated']),_0x6cb6('0x6b'),JSON['stringify'](_0x1d301f['campaignsPreview'][_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x68')]]['pTalking']),JSON[_0x6cb6('0x50')](_0x1d301f['actions'][_0x22dcc5][_0x6cb6('0x6c')]),JSON[_0x6cb6('0x50')](_[_0x6cb6('0x6d')](_0x1d301f['actions'][_0x22dcc5],[_0x6cb6('0x6e'),_0x6cb6('0x6f'),_0x6cb6('0x70'),'ListId'])));return ami[_0x6cb6('0x71')]({'action':'status','channel':_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x72')]})[_0x6cb6('0x73')](function(_0x5da497){if(_0x5da497['message']===_0x6cb6('0x74')){setTimeout(function(){if(_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5]){ut[_0x6cb6('0x75')](_0x1d301f['campaignsPreview'][_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x68')]],_0x6cb6('0x76'));if(_0x1d301f['actions'][_0x22dcc5][_0x6cb6('0x6c')]===!![]){ut[_0x6cb6('0x77')](_0x1d301f[_0x6cb6('0x12')][_0x1d301f['actions'][_0x22dcc5][_0x6cb6('0x68')]],_0x6cb6('0x76'));ut[_0x6cb6('0x78')](_0x6cb6('0x79')+_0x22dcc5,_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x68')]);}ut[_0x6cb6('0x78')](_0x6cb6('0x7a')+_0x22dcc5,_0x1d301f[_0x6cb6('0x6a')][_0x22dcc5][_0x6cb6('0x68')]);delete _0x1d301f[_0x6cb6('0x6a')][_0x22dcc5];}},0x2328);}});}});};Preview[_0x6cb6('0xf')]['clearZombieChannels']=function(){var _0xf5519a=this;loggerAction[_0x6cb6('0x53')]('[action]',_[_0x6cb6('0x7b')](this[_0x6cb6('0x6a')]));for(var _0x5929e7 in this[_0x6cb6('0x6a')]){if(_0xf5519a[_0x6cb6('0x6a')][_0x6cb6('0x5f')](_0x5929e7)){_0xf5519a['clearZombieChannel'](_0x5929e7);}}};Preview[_0x6cb6('0xf')][_0x6cb6('0x7c')]=function(_0x46ae66){var _0x3dba03=this;rpcDb[_0x6cb6('0x7d')](_0x46ae66['id'],ut[_0x6cb6('0x7e')](this[_0x6cb6('0x15')]))[_0x6cb6('0x7f')](function(_0x4e36d8){if(!_[_0x6cb6('0x65')](_0x4e36d8)){for(var _0x4e9c3f=0x0;_0x4e9c3f<_0x4e36d8[_0x6cb6('0x80')];_0x4e9c3f+=0x1){if(ut[_0x6cb6('0x81')](_0x4e36d8[_0x4e9c3f]['scheduledat'])<_0x46ae66[_0x6cb6('0x82')]*0x3c){if(_0x4e36d8[_0x4e9c3f]['Agent']&&!_0x4e36d8[_0x4e9c3f]['Agent'][_0x6cb6('0x83')]){_0x3dba03[_0x6cb6('0x84')](_0x4e36d8[_0x4e9c3f]['id'])[_0x6cb6('0x7f')](ut[_0x6cb6('0x85')](_0x6cb6('0x86')))['catch'](ut[_0x6cb6('0x85')](_0x6cb6('0x86')));}else{rpcDb['disableContact'](_0x4e36d8[_0x4e9c3f]['id']);}}else{var _0x2e9ff9=new Action(_0x4e36d8[_0x4e9c3f],_0x46ae66);_0x2e9ff9[_0x6cb6('0x87')]=moment()[_0x6cb6('0x88')]('YYYY-MM-DD\x20HH:mm:ss');_0x46ae66[_0x6cb6('0x39')]+=0x1;ut[_0x6cb6('0x89')](_0x2e9ff9,0x17,_0x6cb6('0x8a'));if(_0x46ae66[_0x6cb6('0x8b')]){rpcDb[_0x6cb6('0x8c')](ut['createBody'](_0x4e36d8[_0x4e9c3f]));rpcDb[_0x6cb6('0x8d')](_0x2e9ff9,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x6cb6('0x89')](_0x2e9ff9,0x16,'RecallFailedTimeout');rpcDb[_0x6cb6('0x8d')](_0x2e9ff9,_0x6cb6('0x8e'));rpcDb[_0x6cb6('0x8f')](_0x2e9ff9,_0x6cb6('0x8e'));}}}}})[_0x6cb6('0x73')](ut['logger2'](_0x6cb6('0x90')));};Preview[_0x6cb6('0xf')][_0x6cb6('0x62')]=function(_0x1118bf){_0x1118bf[_0x6cb6('0x58')]=!![];if(ut[_0x6cb6('0x91')](_0x1118bf['loggedIn'])){_0x1118bf['message']=_0x6cb6('0x92');}else if(!ut[_0x6cb6('0x93')](_0x1118bf[_0x6cb6('0x2e')])){_0x1118bf['message']=_0x6cb6('0x5a');}else if(!this[_0x6cb6('0x94')](_0x1118bf[_0x6cb6('0x4d')])){if(!this['isTrunkReachable'](_0x1118bf[_0x6cb6('0x95')])){_0x1118bf[_0x6cb6('0x45')]=_0x6cb6('0x96');}else{_0x1118bf[_0x6cb6('0x45')]='ACTIVE';}}else{_0x1118bf[_0x6cb6('0x45')]='ACTIVE';}emitCampaignPreview(_0x1118bf);};Preview[_0x6cb6('0xf')][_0x6cb6('0x97')]=function(_0x2296c7,_0x510c5b,_0x4d9517){var _0x6fad2e=this;var _0x301b33=this['actions'][_0x510c5b];var _0x3fa194=this['campaignsPreview'][_0x301b33[_0x6cb6('0x68')]];var _0x52b4b6;if(_0x3fa194){switch(_0x4d9517){case'1':_0x3fa194['outboundNoSuchCallsDay']+=0x1;_0x301b33['countnosuchnumberretry']+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x0,_0x6cb6('0x9a'));ami['emit']('custom:agentnosuchnumber',ut[_0x6cb6('0x9b')](_0x301b33,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x301b33,_0x6cb6('0x9c'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut[_0x6cb6('0x9e')](_0x301b33,0xf,'Global');rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0x9f'));}else{if(_0x301b33[_0x6cb6('0xa0')]>=_0x3fa194['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x301b33,_0x6cb6('0x9f'));}else{rpcDb['rescheduleContact'](ut[_0x6cb6('0xa1')](_0x301b33,'countnosuchnumberretry',_0x3fa194['dialNoSuchNumberRetryFrequency']),_0x301b33[_0x6cb6('0xa2')],_0x301b33[_0x6cb6('0xa3')]);}}delete this[_0x6cb6('0x6a')][_0x2296c7[_0x6cb6('0xa4')]];break;case _0x6cb6('0xa5'):var _0x2c3d4c=moment()[_0x6cb6('0x88')](_0x6cb6('0xa6'));_0x301b33['responsetime']=_0x2c3d4c;_0x301b33[_0x6cb6('0xa7')]=_0x2c3d4c;_0x301b33[_0x6cb6('0x6c')]=!![];_0x3fa194[_0x6cb6('0xa8')]+=0x1;logger[_0x6cb6('0x53')](_0x6cb6('0xa9'),_0x301b33[_0x6cb6('0xaa')],_0x6cb6('0xab'),_0x3fa194[_0x6cb6('0x23')],_0x6cb6('0x6b'),_0x3fa194['pTalking']);ami['emit']('custom:agentconnect',ut['buildObj'](_0x301b33,_0x6cb6('0xac'),this['campaignsPreview'][_0x301b33[_0x6cb6('0x68')]]));if(_0x3fa194[_0x6cb6('0xad')]){ami[_0x6cb6('0x56')](_0x6cb6('0xae'),ut[_0x6cb6('0xaf')](_0x301b33));}break;case'16':ami[_0x6cb6('0x56')](_0x6cb6('0xb0'),ut[_0x6cb6('0x9b')](_0x301b33,_0x6cb6('0xb1'),this[_0x6cb6('0x12')][_0x301b33[_0x6cb6('0x68')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x301b33,'complete'));_0x3fa194[_0x6cb6('0x32')]+=0x1;_0x3fa194[_0x6cb6('0x29')]+=0x1;_0x3fa194[_0x6cb6('0x24')]+=0x1;ut[_0x6cb6('0x77')](_0x3fa194,_0x6cb6('0xb2'));_0x301b33[_0x6cb6('0x98')]=ut['totalGlobal'](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x4,'Answer');rpcDb[_0x6cb6('0x8d')](_0x301b33,_0x6cb6('0xb3'));rpcDb[_0x6cb6('0x8f')](_0x301b33,_0x6cb6('0xb4'));rpcDb[_0x6cb6('0xb5')](_0x301b33);_0x3fa194[_0x6cb6('0xb6')]+=_0x301b33[_0x6cb6('0xb7')];_0x3fa194['sumBillable']+=_0x301b33['talktime'];logger['info'](_0x6cb6('0xb8'),_0x301b33[_0x6cb6('0xaa')],_0x6cb6('0xab'),_0x3fa194[_0x6cb6('0x23')],_0x6cb6('0x6b'),_0x3fa194[_0x6cb6('0xa8')]);delete this[_0x6cb6('0x6a')][_0x2296c7[_0x6cb6('0xa4')]];break;case _0x6cb6('0xb9'):_0x3fa194['outboundBusyCallsDay']+=0x1;_0x301b33[_0x6cb6('0xba')]+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x5,_0x6cb6('0xbb'));ami[_0x6cb6('0x56')](_0x6cb6('0xbc'),ut['buildObj'](_0x301b33,_0x6cb6('0xbd')));rpcDb[_0x6cb6('0x8d')](_0x301b33,_0x6cb6('0xbe'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut['cloneAction'](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xc0'));}else{if(_0x301b33[_0x6cb6('0xba')]>=_0x3fa194[_0x6cb6('0xc1')]){rpcDb['createCustomerFinal'](_0x301b33,_0x6cb6('0xbe'));}else{rpcDb[_0x6cb6('0xc2')](ut[_0x6cb6('0xa1')](_0x301b33,_0x6cb6('0xba'),_0x3fa194[_0x6cb6('0xc3')]),_0x301b33[_0x6cb6('0xa2')],_0x301b33[_0x6cb6('0xa3')]);}}break;case _0x6cb6('0xc4'):_0x3fa194[_0x6cb6('0x37')]+=0x1;_0x301b33[_0x6cb6('0xc5')]+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut['logCustomer'](_0x301b33,0x3,_0x6cb6('0xc6'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x301b33,_0x6cb6('0xc7')));rpcDb['createCustomerHistory'](_0x301b33,_0x6cb6('0xc8'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut[_0x6cb6('0x9e')](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xc9'));}else{if(_0x301b33[_0x6cb6('0xc5')]>=_0x3fa194[_0x6cb6('0xca')]){rpcDb[_0x6cb6('0x8f')](_0x301b33,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x6cb6('0xc2')](ut[_0x6cb6('0xa1')](_0x301b33,'countnoanswerretry',_0x3fa194[_0x6cb6('0xcb')]),_0x301b33['unlockAgent'],_0x301b33[_0x6cb6('0xa3')]);}}break;case _0x6cb6('0xcc'):_0x3fa194[_0x6cb6('0x35')]+=0x1;_0x301b33[_0x6cb6('0xcd')]+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x8,'Congestion');ami[_0x6cb6('0x56')](_0x6cb6('0xce'),ut['buildObj'](_0x301b33,_0x6cb6('0xcf')));rpcDb['createCustomerHistory'](_0x301b33,_0x6cb6('0xd0'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194['dialGlobalMaxRetry']){_0x52b4b6=ut[_0x6cb6('0x9e')](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xd1'));}else{if(_0x301b33[_0x6cb6('0xcd')]>=_0x3fa194[_0x6cb6('0xd2')]){rpcDb['createCustomerFinal'](_0x301b33,_0x6cb6('0xd0'));}else{rpcDb[_0x6cb6('0xc2')](ut[_0x6cb6('0xa1')](_0x301b33,_0x6cb6('0xcd'),_0x3fa194[_0x6cb6('0xc3')]),_0x301b33[_0x6cb6('0xa2')],_0x301b33['activeContact']);}}break;case _0x6cb6('0xd3'):_0x3fa194['outboundRejectCallsDay']+=0x1;_0x301b33['countagentrejectretry']+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut['logCustomer'](_0x301b33,0x14,_0x6cb6('0xd4'));ami[_0x6cb6('0x56')]('custom:agentreject',ut[_0x6cb6('0x9b')](_0x301b33,_0x6cb6('0xd5')));rpcDb[_0x6cb6('0x8d')](_0x301b33,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut[_0x6cb6('0x9e')](_0x301b33,0x14,_0x6cb6('0xd4'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xd6'));}else{if(_0x301b33[_0x6cb6('0xd7')]>=_0x3fa194[_0x6cb6('0xd8')]){rpcDb[_0x6cb6('0x8f')](_0x301b33,_0x6cb6('0xd6'));}else{rpcDb[_0x6cb6('0xc2')](ut[_0x6cb6('0xa1')](_0x301b33,'countagentrejectretry',_0x3fa194[_0x6cb6('0xd9')]),_0x301b33[_0x6cb6('0xa2')],_0x301b33[_0x6cb6('0xa3')]);}}break;case _0x6cb6('0xda'):_0x3fa194[_0x6cb6('0x3b')]+=0x1;_0x301b33[_0x6cb6('0xdb')]+=0x1;_0x301b33['countglobal']=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0xb,_0x6cb6('0xdc'));rpcDb['createCustomerHistory'](_0x301b33,_0x6cb6('0xdd'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194['dialGlobalMaxRetry']){_0x52b4b6=ut['cloneAction'](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb['createCustomerFinal'](_0x52b4b6,_0x6cb6('0xdd'));}else{if(_0x301b33[_0x6cb6('0xde')]>=_0x3fa194['dialAbandonedMaxRety']){rpcDb[_0x6cb6('0x8f')](_0x301b33,_0x6cb6('0xdd'));}else{rpcDb[_0x6cb6('0xc2')](ut[_0x6cb6('0xa1')](_0x301b33,_0x6cb6('0xdb'),_0x3fa194[_0x6cb6('0xdf')]),_0x301b33[_0x6cb6('0xa2')],_0x301b33[_0x6cb6('0xa3')]);}}break;case'18':_0x3fa194[_0x6cb6('0xe0')]+=0x1;_0x301b33[_0x6cb6('0xe1')]+=0x1;_0x301b33['countglobal']=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x12,_0x2296c7[_0x6cb6('0xe2')]||_0x2296c7[_0x6cb6('0xe3')]);ami[_0x6cb6('0x56')]('custom:amd',ut['buildObj'](_0x301b33,'amd'));rpcDb[_0x6cb6('0x8d')](_0x301b33,_0x6cb6('0xe4'));if(ut[_0x6cb6('0x99')](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut['cloneAction'](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xe4'));}else{rpcDb[_0x6cb6('0x8f')](_0x301b33,_0x6cb6('0xe4'));}delete this['actions'][_0x2296c7[_0x6cb6('0xa4')]];break;case'19':_0x3fa194[_0x6cb6('0xe0')]+=0x1;_0x301b33[_0x6cb6('0x98')]=ut[_0x6cb6('0x99')](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0x13,_0x2296c7[_0x6cb6('0xe2')]||_0x2296c7[_0x6cb6('0xe3')]);ami[_0x6cb6('0x56')](_0x6cb6('0xe5'),ut[_0x6cb6('0x9b')](_0x301b33,_0x6cb6('0xe6')));rpcDb[_0x6cb6('0x8d')](_0x301b33,_0x6cb6('0xe7'));if(ut['totalGlobal'](_0x301b33)>=_0x3fa194[_0x6cb6('0x9d')]){_0x52b4b6=ut[_0x6cb6('0x9e')](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,_0x6cb6('0xe7'));}else{rpcDb[_0x6cb6('0x8f')](_0x301b33,'[callProgressDetectingCustomer][machine]');}delete this[_0x6cb6('0x6a')][_0x2296c7['linkedid']];break;default:if(_0x301b33[_0x6cb6('0x6c')]){ut[_0x6cb6('0x77')](_0x3fa194,_0x6cb6('0xe8'));ut[_0x6cb6('0x78')](_0x6cb6('0xe9')+_0x3fa194[_0x6cb6('0x23')],_0x2296c7);}_0x3fa194[_0x6cb6('0xe0')]+=0x1;_0x301b33['countglobal']=ut['totalGlobal'](_0x301b33);ut[_0x6cb6('0x89')](_0x301b33,0xc,_0x2296c7[_0x6cb6('0xe2')]||_0x2296c7['dialstatus']);rpcDb[_0x6cb6('0x8d')](_0x301b33,_0x6cb6('0xea'));if(ut['totalGlobal'](_0x301b33)>=_0x3fa194['dialGlobalMaxRetry']){_0x52b4b6=ut['cloneAction'](_0x301b33,0xf,_0x6cb6('0xbf'));rpcDb[_0x6cb6('0x8f')](_0x52b4b6,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x6cb6('0x8f')](_0x301b33,_0x6cb6('0xeb'));}delete this[_0x6cb6('0x6a')][_0x2296c7['linkedid']];}if(!(_0x301b33[_0x6cb6('0x6c')]&&_0x4d9517==='16')){ut['updateOriginated'](_0x3fa194,'[callProgressDetectingCustomer]');logger['info'](_0x6cb6('0xec'),_0x301b33['uniqueid'],_0x6cb6('0xab'),_0x3fa194[_0x6cb6('0x23')],_0x6cb6('0x69'),_0x3fa194['originated']);}if(_0x4d9517!==_0x6cb6('0xa5')){delete this['actions'][_0x2296c7['linkedid']];delete this[_0x6cb6('0x6a')][_0x2296c7[_0x6cb6('0xed')]];}}};Preview[_0x6cb6('0xf')][_0x6cb6('0xee')]=function(_0x3c19c5,_0x323db3,_0x5ac4cd){if(_[_0x6cb6('0xef')](_0x323db3)&&_0x6cb6('0xf0')!==typeof _0x323db3){return;}if(_[_0x6cb6('0xef')](_0x5ac4cd)&&_0x6cb6('0xf0')!==typeof _0x5ac4cd){return;}switch(_0x5ac4cd['reason']){case'0':ut[_0x6cb6('0xf1')](_0x3c19c5,0x0,_0x6cb6('0x9a'));rpcDb[_0x6cb6('0xf2')](_0x3c19c5,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x6cb6('0xf1')](_0x3c19c5,0x3,_0x6cb6('0xc6'));rpcDb[_0x6cb6('0xf2')](_0x3c19c5,_0x6cb6('0xf3'));break;case'5':ut['logAgent'](_0x3c19c5,0x5,_0x6cb6('0xbb'));rpcDb[_0x6cb6('0xf2')](_0x3c19c5,_0x6cb6('0xf4'));break;case'8':ut['logAgent'](_0x3c19c5,0x8,_0x6cb6('0xf5'));rpcDb[_0x6cb6('0xf2')](_0x3c19c5,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x6cb6('0xf1')](_0x3c19c5,0x16,_0x6cb6('0xf6'));rpcDb[_0x6cb6('0xf2')](_0x3c19c5,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x6cb6('0xf1')](_0x3c19c5,0xc,_0x5ac4cd['reason']);rpcDb['createAgentHistory'](_0x3c19c5,_0x6cb6('0xf7'));}ut['updateOriginated'](_0x323db3,_0x6cb6('0xf8'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x3c19c5[_0x6cb6('0xaa')],'\x20Queue',_0x323db3['name'],_0x6cb6('0x69'),_0x323db3[_0x6cb6('0x46')]);delete this[_0x6cb6('0x6a')][_0x3c19c5[_0x6cb6('0xaa')]];};Preview[_0x6cb6('0xf')][_0x6cb6('0xf9')]=function(_0x12ca36,_0x3a5dc3,_0x279907,_0x32a4a3,_0x28b3c3){var _0x50eb01=this;return new BPromise(function(_0x390c7c,_0x3def60){if(_['isNil'](_0x3a5dc3)||_[_0x6cb6('0x65')](_0x3a5dc3[_0x6cb6('0xfa')])||_['isNil'](_0x3a5dc3[_0x6cb6('0xfa')][_0x6cb6('0xfb')])||_['isNil'](_0x3a5dc3[_0x6cb6('0x70')])){_0x3def60(ut['message'](_0x6cb6('0xfc'),_0x32a4a3,_0x28b3c3));return;}var _0xbe2986=uuid['v4']();var _0x2ab101=_0x50eb01[_0x6cb6('0x12')][_0x3a5dc3[_0x6cb6('0x67')][_0x6cb6('0x23')]];var _0x3f9fe3=_0x279907?_0x50eb01[_0x6cb6('0x15')][_0x279907]['id']:undefined;_0x50eb01['actions'][_0xbe2986]=new Action(_0x3a5dc3,_0x2ab101,_0xbe2986,_0x279907,_0x3f9fe3);var _0x106d36=_0x50eb01['actions'][_0xbe2986];_0x106d36[_0x6cb6('0xa2')]=_0x32a4a3;_0x106d36['activeContact']=_0x28b3c3;_0x106d36[_0x6cb6('0xfd')]=_0x279907;if(_[_0x6cb6('0xfe')](_0x12ca36)){_0x50eb01[_0x6cb6('0xff')](_0x106d36,_0x2ab101,_0x3a5dc3,_0x279907)[_0x6cb6('0x7f')](function(_0x5bbb1d){logger['info'](_0x6cb6('0x100'),_0x6cb6('0x101')+_0x106d36[_0x6cb6('0x68')]+_0x6cb6('0x102')+_0x106d36['idContact'],JSON[_0x6cb6('0x50')](_0x5bbb1d));ami[_0x6cb6('0x56')](_0x6cb6('0x103'),ut[_0x6cb6('0x9b')](_0x106d36,_0x6cb6('0x104'),_0x50eb01[_0x6cb6('0x12')][_0x106d36[_0x6cb6('0x68')]]));_0x390c7c(ut['message'](_0x6cb6('0x105')));})[_0x6cb6('0x73')](function(_0x13998b){ut[_0x6cb6('0x5b')](_0x6cb6('0x106'),_0x13998b);_0x3def60(ut[_0x6cb6('0x45')]('Call\x20failed',_0x32a4a3,_0x28b3c3));});}else{_0x2ab101[_0x6cb6('0x33')]+=0x1;ut[_0x6cb6('0x107')](_0x106d36);rpcDb[_0x6cb6('0x108')](_0x106d36,'[Blacklist][error]');delete _0x50eb01[_0x6cb6('0x6a')][_0xbe2986];_0x3def60(ut[_0x6cb6('0x45')](_0x6cb6('0x109'),_0x32a4a3,_0x28b3c3));}});};Preview['prototype'][_0x6cb6('0x94')]=function(_0x5431ff){return!_[_0x6cb6('0x65')](_0x5431ff)&&!_['isNil'](_0x5431ff[_0x6cb6('0x23')])&&!_[_0x6cb6('0x65')](_0x5431ff['active'])&&_0x5431ff['active']&&!_['isNil'](this['trunks'][util[_0x6cb6('0x88')](_0x6cb6('0x10a'),_0x5431ff[_0x6cb6('0x23')])])&&!_[_0x6cb6('0x65')](this[_0x6cb6('0x14')][util['format']('SIP/%s',_0x5431ff[_0x6cb6('0x23')])][_0x6cb6('0x10b')])&&(this[_0x6cb6('0x14')][util[_0x6cb6('0x88')](_0x6cb6('0x10a'),_0x5431ff[_0x6cb6('0x23')])]['status']===_0x6cb6('0x10c')||this[_0x6cb6('0x14')][util[_0x6cb6('0x88')](_0x6cb6('0x10a'),_0x5431ff[_0x6cb6('0x23')])]['status']===_0x6cb6('0x10d'));};Preview[_0x6cb6('0xf')][_0x6cb6('0x84')]=function(_0x2faeec,_0x2b4b3c){var _0x586319=this;return new BPromise(function(_0x451792,_0x4cad27){_0x586319[_0x6cb6('0x10e')](_0x2faeec,_0x2b4b3c)[_0x6cb6('0x7f')](function(_0x364542){_0x451792(_[_0x6cb6('0x6d')](_0x364542,['message']));})[_0x6cb6('0x73')](function(_0x5acd6d){if(_0x5acd6d['unlock']){rpcDb[_0x6cb6('0x10f')](_0x2faeec);}if(_0x5acd6d['active']){rpcDb[_0x6cb6('0x110')](_0x2faeec);}_0x4cad27(_[_0x6cb6('0x6d')](_0x5acd6d,[_0x6cb6('0x45')]));});});};Preview['prototype'][_0x6cb6('0x10e')]=function(_0x20dc69,_0x3464a0){var _0x32e063=this;return new BPromise(function(_0x662b7d,_0x7c98ba){var _0x41a111,_0x22d89b;rpcDb['getContactPreview'](_0x20dc69)[_0x6cb6('0x7f')](function(_0x48efe8){if(!_[_0x6cb6('0x65')](_0x48efe8[0x0])){_0x22d89b=_0x48efe8[0x0]['recallme']?![]:!![];_0x41a111=_0x48efe8[0x0][_0x6cb6('0x111')]?!![]:![];_0x41a111=_0x3464a0?!![]:_0x41a111;}var _0x766ccd=_0x32e063['validateContact'](_0x48efe8);if(_0x766ccd[_0x6cb6('0x112')]){rpcDb['checkIsBlackList'](_['pick'](_0x48efe8[0x0],[_0x6cb6('0x70'),_0x6cb6('0x113')]))[_0x6cb6('0x7f')](function(_0x3468c3){_0x32e063[_0x6cb6('0xf9')](_0x3468c3,_0x48efe8[0x0],_0x3464a0,_0x22d89b,_0x41a111)[_0x6cb6('0x7f')](function(_0x71125b){_0x662b7d(_0x71125b);})[_0x6cb6('0x73')](function(_0x3ca2ba){_0x7c98ba(_0x3ca2ba);});})[_0x6cb6('0x73')](function(_0x1a2b0c){ut[_0x6cb6('0x5b')](_0x6cb6('0x114'),_0x1a2b0c);_0x7c98ba(ut[_0x6cb6('0x45')]('Call\x20unsuccessful',_0x22d89b,_0x41a111));});}else{_0x7c98ba(ut[_0x6cb6('0x45')](_0x766ccd['message'],_0x22d89b,_0x41a111));}})[_0x6cb6('0x73')](function(_0x59709c){ut[_0x6cb6('0x5b')](_0x6cb6('0x115'),_0x59709c);_0x7c98ba(ut['message'](_0x6cb6('0x116'),![],!![]));});});};Preview[_0x6cb6('0xf')]['validateContact']=function(_0x4c7b6c){if(_['isNil'](_0x4c7b6c)||_[_0x6cb6('0xfe')](_0x4c7b6c)||!_['isNil'](_0x4c7b6c[0x0][_0x6cb6('0x117')])&&_['isNil'](_0x4c7b6c[0x0][_0x6cb6('0x117')][_0x6cb6('0x23')])){ut[_0x6cb6('0x5b')]('[Preview][validateContact][Empty\x20Contact]',_0x4c7b6c);return{'isValid':![],'message':_0x6cb6('0x118')};}var _0x5e3bb9=this[_0x6cb6('0x12')][_0x4c7b6c[0x0][_0x6cb6('0x67')][_0x6cb6('0x23')]];_0x5e3bb9[_0x6cb6('0x45')]=_0x6cb6('0x119');if(_[_0x6cb6('0x65')](_0x5e3bb9)){ut[_0x6cb6('0x5b')](_0x6cb6('0x11a'),_0x5e3bb9);return{'isValid':![],'message':_0x6cb6('0x11b')};}if(!this['isTrunkReachable'](_0x5e3bb9['Trunk'])){ut[_0x6cb6('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x6cb6('0x11c')+_0x5e3bb9[_0x6cb6('0x23')]+_0x6cb6('0x11d'));if(!this['isTrunkReachable'](_0x5e3bb9[_0x6cb6('0x95')])){ut[_0x6cb6('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x5e3bb9[_0x6cb6('0x23')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x6cb6('0x11e')};}}if(!ut['isActive'](_0x5e3bb9[_0x6cb6('0x2e')])){ut[_0x6cb6('0x5b')](_0x6cb6('0x11f'),_0x5e3bb9['name']+_0x6cb6('0x120'));return{'isValid':![],'message':_0x6cb6('0x11c')+_0x5e3bb9[_0x6cb6('0x23')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x6cb6('0x121')};};Preview['prototype'][_0x6cb6('0xff')]=function(_0x3dc6ae,_0x132afb,_0x4516f7,_0x1a4db1){var _0x395b4d=this;return new BPromise(function(_0x3697c9,_0x49bf91){var _0x526de0=_0x3dc6ae[_0x6cb6('0xaa')];var _0x205065=_0x395b4d[_0x6cb6('0x94')](_0x132afb[_0x6cb6('0x4d')])?util[_0x6cb6('0x88')](_0x6cb6('0x122'),_0x132afb['Trunk'][_0x6cb6('0x23')],_['isNil'](_0x132afb[_0x6cb6('0x30')])?'':_0x132afb['dialPrefix']['trim']()||'',_0x132afb['dialCutDigit']>0x0?_0x4516f7[_0x6cb6('0xfa')][_0x6cb6('0xfb')][_0x6cb6('0x123')](_0x132afb[_0x6cb6('0x124')]):_0x4516f7[_0x6cb6('0xfa')][_0x6cb6('0xfb')]):util[_0x6cb6('0x88')](_0x6cb6('0x122'),_[_0x6cb6('0x65')](_0x132afb['TrunkBackup'])?_0x132afb[_0x6cb6('0x4d')][_0x6cb6('0x23')]:_0x132afb[_0x6cb6('0x95')]['name'],_[_0x6cb6('0x65')](_0x132afb[_0x6cb6('0x30')])?'':_0x132afb[_0x6cb6('0x30')][_0x6cb6('0x125')]()||'',_0x132afb[_0x6cb6('0x124')]>0x0?_0x4516f7[_0x6cb6('0xfa')]['phone'][_0x6cb6('0x123')](_0x132afb[_0x6cb6('0x124')]):_0x4516f7[_0x6cb6('0xfa')][_0x6cb6('0xfb')]);var _0x31461d=_0x395b4d[_0x6cb6('0x94')](_0x132afb['Trunk'])?ut[_0x6cb6('0x126')](_0x132afb[_0x6cb6('0x4d')]['callerid'],_0x132afb[_0x6cb6('0x127')],_0x132afb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x6cb6('0x128')](_0x132afb[_0x6cb6('0x129')],_0x132afb[_0x6cb6('0x12a')]):_0x132afb['dialOriginateCallerIdNumber']):ut[_0x6cb6('0x126')](_['isNil'](_0x132afb[_0x6cb6('0x95')])?_0x132afb[_0x6cb6('0x4d')]['callerid']:_0x132afb[_0x6cb6('0x95')][_0x6cb6('0x4e')],_0x132afb[_0x6cb6('0x127')],_0x132afb[_0x6cb6('0x12a')]>0x0?ut[_0x6cb6('0x128')](_0x132afb[_0x6cb6('0x129')],_0x132afb[_0x6cb6('0x12a')]):_0x132afb[_0x6cb6('0x129')]);if(_0x31461d){_0x3dc6ae[_0x6cb6('0x12b')]=ut[_0x6cb6('0x12c')](_0x31461d);_0x3dc6ae[_0x6cb6('0x12d')]=ut[_0x6cb6('0x12e')](_0x31461d);}var _0x258432=ut[_0x6cb6('0x12f')](_0x132afb,_0x4516f7,_0x205065,_0x31461d,_0x526de0,_0x3dc6ae);_[_0x6cb6('0x130')](_0x3dc6ae,ut[_0x6cb6('0x131')](_0x258432));_0x3dc6ae['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x6cb6('0x71')](ut['variablesAction'](_0x3dc6ae,_0x132afb,_0x258432,_0x3dc6ae['activeContact'],_0x1a4db1))[_0x6cb6('0x7f')](function(_0x16a57a){_0x132afb[_0x6cb6('0x46')]+=0x1;logger['info']('[originated][increment]',_0x526de0,_0x6cb6('0xab'),_0x132afb[_0x6cb6('0x23')],'originated:\x20',_0x132afb[_0x6cb6('0x46')]);_0x3697c9(_0x16a57a);})[_0x6cb6('0x73')](function(_0x1872a4){ut['logAgent'](_0x3dc6ae,0xe,_0x6cb6('0x132'));rpcDb[_0x6cb6('0xf2')](_0x3dc6ae,_0x6cb6('0x133'));_0x49bf91(_0x1872a4);});});};Preview[_0x6cb6('0xf')][_0x6cb6('0x1e')]=function(_0x3112a9){if(this[_0x6cb6('0x6a')][_0x3112a9[_0x6cb6('0xa4')]]){this[_0x6cb6('0x6a')][_0x3112a9[_0x6cb6('0xa4')]]['channel']=_0x3112a9[_0x6cb6('0x72')];}};Preview[_0x6cb6('0xf')][_0x6cb6('0x17')]=function(_0x14ac2b){var _0x205b45=this;var _0x4ee55e=this[_0x6cb6('0x6a')][_0x14ac2b['actionid']];if(_0x4ee55e){if(_0x4ee55e['lookAgent']&&this[_0x6cb6('0x15')][_0x4ee55e[_0x6cb6('0xfd')]]){ut['logLookAgent'](_0x4ee55e,this['agents'][_0x4ee55e[_0x6cb6('0xfd')]][_0x6cb6('0x23')],this['agents'][_0x4ee55e['lookAgent']]['id']);}var _0x33318a=_['clone'](_0x4ee55e);_0x33318a[_0x6cb6('0x134')]=moment()['format'](_0x6cb6('0xa6'));var _0x1f48ad=_0x205b45[_0x6cb6('0x12')][_0x4ee55e[_0x6cb6('0x68')]];if(ut[_0x6cb6('0x135')](_0x14ac2b['response'])){if(_0x4ee55e[_0x6cb6('0xa2')]){rpcDb[_0x6cb6('0x10f')](_0x4ee55e[_0x6cb6('0x136')]);}if(_0x4ee55e[_0x6cb6('0xa3')]){rpcDb[_0x6cb6('0x110')](_0x4ee55e['idContact']);}ami['emit'](_0x6cb6('0x137'),ut[_0x6cb6('0x9b')](_0x4ee55e,_0x6cb6('0x138'),this['campaignsPreview'][_0x4ee55e[_0x6cb6('0x68')]]));this['callProgressDetectingAgent'](_0x33318a,_0x1f48ad,_0x14ac2b);}else{_0x4ee55e[_0x6cb6('0x87')]=moment()[_0x6cb6('0x88')](_0x6cb6('0xa6'));ut['logAgent'](_0x33318a,0x4,_0x6cb6('0x139'));rpcDb[_0x6cb6('0xf2')](_0x33318a,_0x6cb6('0x13a'));}}};Preview[_0x6cb6('0xf')][_0x6cb6('0x19')]=function(_0xc93473){var _0xd65f5d=this;var _0x4a58a2=this[_0x6cb6('0x6a')][_0xc93473[_0x6cb6('0xa4')]];var _0x7089cf;if(_0x4a58a2){_0x7089cf=this[_0x6cb6('0x12')][_0x4a58a2[_0x6cb6('0x68')]];logger['info'](_0x6cb6('0x13b'),_0xc93473[_0x6cb6('0xa4')],'\x20Queue',_0x7089cf[_0x6cb6('0x23')],'pTalking:\x20',_0x7089cf[_0x6cb6('0xa8')]);}if(this['actions'][_0xc93473['linkedid']]&&_0xc93473[_0x6cb6('0xa4')]!==_0xc93473[_0x6cb6('0xaa')]){if(_0xc93473[_0x6cb6('0x13c')]==='16'&&this[_0x6cb6('0x6a')][_0xc93473[_0x6cb6('0xa4')]][_0x6cb6('0x6c')]){this[_0x6cb6('0x97')](_0xc93473,_0xc93473[_0x6cb6('0xa4')],_0xc93473['cause']);}else if(this[_0x6cb6('0x6a')][_0xc93473[_0x6cb6('0xa4')]][_0x6cb6('0x6c')]){logger[_0x6cb6('0x53')](_0x6cb6('0x13d'),_0xc93473[_0x6cb6('0xa4')],_0xc93473[_0x6cb6('0x13c')],_0x6cb6('0xab'),_0x7089cf['name'],'pTalking:\x20',_0x7089cf[_0x6cb6('0xa8')]);this[_0x6cb6('0x97')](_0xc93473,_0xc93473[_0x6cb6('0xa4')],_0xc93473['cause']);}}else if(_0x4a58a2&&_['isNil'](_0x4a58a2['statedesc'])&&_0x7089cf[_0x6cb6('0x13e')]&&_0xc93473[_0x6cb6('0xa4')]===_0xc93473[_0x6cb6('0xaa')]&&_[_0x6cb6('0x65')](_0xc93473[_0x6cb6('0x13f')])&&_0xc93473[_0x6cb6('0x13c')]==='16'&&_0xc93473[_0x6cb6('0x140')]==='6'&&_[_0x6cb6('0xef')](_0x4a58a2[_0x6cb6('0x141')])){if(_0x4a58a2[_0x6cb6('0xa2')]){rpcDb['unlockContact'](_0x4a58a2[_0x6cb6('0x136')]);}if(_0x4a58a2[_0x6cb6('0xa3')]){rpcDb[_0x6cb6('0x110')](_0x4a58a2[_0x6cb6('0x136')]);}_0xc93473[_0x6cb6('0x13f')]='22';this[_0x6cb6('0xee')](_0x4a58a2,_0x7089cf,_0xc93473);}else if(_0x4a58a2&&_0x4a58a2[_0x6cb6('0x141')]){if(_0xc93473[_0x6cb6('0x13c')]==='16'&&this[_0x6cb6('0x6a')][_0xc93473[_0x6cb6('0xa4')]][_0x6cb6('0x6c')]){logger[_0x6cb6('0x53')](_0x6cb6('0x142'),_0xc93473[_0x6cb6('0xa4')],_0xc93473['cause'],_0x6cb6('0xab'),_0x7089cf[_0x6cb6('0x23')],_0x6cb6('0x6b'),_0x7089cf['pTalking']);this[_0x6cb6('0x97')](_0xc93473,_0xc93473['linkedid'],_0xc93473[_0x6cb6('0x13c')]);}else if(this[_0x6cb6('0x6a')][_0xc93473[_0x6cb6('0xa4')]]['dialAnswer']){logger['info'](_0x6cb6('0x13d'),_0xc93473[_0x6cb6('0xa4')],_0xc93473[_0x6cb6('0x13c')],'\x20Queue',_0x7089cf['name'],_0x6cb6('0x6b'),_0x7089cf['pTalking']);this[_0x6cb6('0x97')](_0xc93473,_0xc93473['linkedid'],_0xc93473[_0x6cb6('0x13c')]);}}};Preview['prototype'][_0x6cb6('0x1b')]=function(_0x31eabc){if(this[_0x6cb6('0x6a')][_0x31eabc[_0x6cb6('0xed')]]&&_0x31eabc[_0x6cb6('0xed')]!==_0x31eabc['destuniqueid']){this[_0x6cb6('0x97')](_0x31eabc,_0x31eabc['destlinkedid'],_0x31eabc['dialstatus']);}};Preview['prototype'][_0x6cb6('0x143')]=function(_0x50aa48){if(this['actions'][_0x50aa48[_0x6cb6('0xa4')]]&&_0x50aa48[_0x6cb6('0xa4')]!==_0x50aa48[_0x6cb6('0xaa')]&&!this[_0x6cb6('0x6a')][_0x50aa48[_0x6cb6('0xa4')]]['dialAnswer']){if(_0x50aa48['cause']==='1'){this[_0x6cb6('0x97')](_0x50aa48,_0x50aa48[_0x6cb6('0xa4')],_0x50aa48[_0x6cb6('0x13c')]);}}};Preview[_0x6cb6('0xf')][_0x6cb6('0x144')]=function(_0x2b2b31,_0x64c1be,_0x59d338){if(this['actions'][_0x2b2b31]){if(_['isNil'](this[_0x6cb6('0x6a')][_0x2b2b31][_0x6cb6('0x145')])){this[_0x6cb6('0x6a')][_0x2b2b31][_0x6cb6('0x145')]={};}this['actions'][_0x2b2b31][_0x6cb6('0x145')][_0x64c1be]=_0x59d338;}};Preview[_0x6cb6('0xf')][_0x6cb6('0x1f')]=function(_0xa5b527){try{if(!_['isNil'](_0xa5b527)){if(ut[_0x6cb6('0x146')](_[_0x6cb6('0x147')](_0xa5b527[_0x6cb6('0x148')])[0x0])){this[_0x6cb6('0x144')](_0xa5b527[_0x6cb6('0xaa')],_[_0x6cb6('0x147')](_0xa5b527[_0x6cb6('0x148')])[0x0],_0xa5b527['value']);}}}catch(_0x4d5acc){logger[_0x6cb6('0x149')](_0x6cb6('0x14a'),util[_0x6cb6('0x14b')](_0x4d5acc,{'showHidden':![],'depth':null}));}};Preview[_0x6cb6('0xf')]['syncAttendedTransfer']=function(_0x5f4658){if(_0x5f4658){if(this[_0x6cb6('0x6a')][_0x5f4658[_0x6cb6('0x14c')]]){this['actions'][_0x5f4658[_0x6cb6('0x14c')]][_0x6cb6('0x141')]=!![];}}};Preview[_0x6cb6('0xf')]['syncBlindTransfer']=function(_0x27fe67){if(_0x27fe67){if(this['actions'][_0x27fe67['transfererlinkedid']]){this[_0x6cb6('0x6a')][_0x27fe67[_0x6cb6('0x14d')]][_0x6cb6('0x141')]=!![];}}};module[_0x6cb6('0x14e')]=Preview; \ No newline at end of file +var _0x24ca=['dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','updateOriginated','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','idContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','disableContact','starttime','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','unlockAgent','activeContact','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt'];(function(_0x2602a5,_0x1d38ab){var _0x22bb16=function(_0x268bc6){while(--_0x268bc6){_0x2602a5['push'](_0x2602a5['shift']());}};_0x22bb16(++_0x1d38ab);}(_0x24ca,0x8c));var _0xa24c=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0x24ca[_0x2fbcf6];return _0x3e7265;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xa24c('0x1'));var moment=require('moment');var md5=require(_0xa24c('0x2'));var Redis=require(_0xa24c('0x3'));var config=require(_0xa24c('0x4'));var logger=require('../../../config/logger')(_0xa24c('0x5'));var loggerAction=require(_0xa24c('0x6'))(_0xa24c('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xa24c('0x8'));config[_0xa24c('0x9')]=_[_0xa24c('0xa')](config[_0xa24c('0x9')],{'host':_0xa24c('0xb'),'port':0x18eb});var io=require(_0xa24c('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xa24c('0xd')][_0xa24c('0xe')]=function(_0x355882){this['tail']=this['tail']?this[_0xa24c('0xf')][_0xa24c('0x10')](_0x355882):_0x355882();};function Preview(_0x2da0c3){this[_0xa24c('0x11')]=new Sequence();this[_0xa24c('0x12')]=_0x2da0c3[_0xa24c('0x13')];this['trunks']=_0x2da0c3['trunks'];this['actions']={};this[_0xa24c('0x14')]=_0x2da0c3[_0xa24c('0x14')];this[_0xa24c('0x15')]=0x0;ami['on'](_0xa24c('0x16'),this[_0xa24c('0x17')]['bind'](this));ami['on'](_0xa24c('0x18'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0xa24c('0x19')][_0xa24c('0x1a')](this));ami['on'](_0xa24c('0x1b'),this[_0xa24c('0x1c')][_0xa24c('0x1a')](this));ami['on'](_0xa24c('0x1d'),this[_0xa24c('0x1e')][_0xa24c('0x1a')](this));ami['on'](_0xa24c('0x1f'),this[_0xa24c('0x20')][_0xa24c('0x1a')](this));ami['on'](_0xa24c('0x21'),this[_0xa24c('0x22')][_0xa24c('0x1a')](this));ami['on']('blindtransfer',this[_0xa24c('0x23')]['bind'](this));this[_0xa24c('0x24')](this[_0xa24c('0x12')]);}function emit(_0x8c3949,_0x37e20e,_0x240f6c){io['to'](_0x8c3949)[_0xa24c('0x25')](_0x37e20e,_0x240f6c);}function emitCampaignPreview(_0x38dfdc){if(_0x38dfdc[_0xa24c('0x26')]===_0xa24c('0x27')){var _0x2ec5ad={'id':_0x38dfdc['id'],'name':_0x38dfdc[_0xa24c('0x28')],'strategy':_0x38dfdc['strategy'],'answered':_0x38dfdc['answered'],'available':_0x38dfdc[_0xa24c('0x29')],'loggedIn':_0x38dfdc[_0xa24c('0x2a')],'pTalking':_0x38dfdc[_0xa24c('0x2b')],'sumBillable':_0x38dfdc[_0xa24c('0x2c')],'sumDuration':_0x38dfdc[_0xa24c('0x2d')],'sumHoldTime':_0x38dfdc[_0xa24c('0x2e')]||0x0,'talking':_0x38dfdc[_0xa24c('0x2f')],'total':_0x38dfdc[_0xa24c('0x30')],'type':_0x38dfdc[_0xa24c('0x26')],'unmanaged':_0x38dfdc['unmanaged'],'abandoned':_0x38dfdc[_0xa24c('0x31')],'waiting':_0x38dfdc['waiting'],'loggedInDb':_0x38dfdc[_0xa24c('0x32')],'dialActive':_0x38dfdc[_0xa24c('0x33')],'dialMethod':_0x38dfdc[_0xa24c('0x34')],'dialOriginateCallerIdName':_0x38dfdc[_0xa24c('0x35')],'dialOriginateCallerIdNumber':_0x38dfdc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x38dfdc['dialOriginateTimeout'],'dialPrefix':_0x38dfdc['dialPrefix'],'outboundAnswerAgiCallsDay':_0x38dfdc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x38dfdc[_0xa24c('0x36')],'outboundBlacklistCallsDay':_0x38dfdc[_0xa24c('0x37')],'outboundBusyCallsDay':_0x38dfdc[_0xa24c('0x38')],'outboundCongestionCallsDay':_0x38dfdc[_0xa24c('0x39')],'outboundDropCallsDayACS':_0x38dfdc[_0xa24c('0x3a')],'outboundDropCallsDayCallersExit':_0x38dfdc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x38dfdc['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x38dfdc[_0xa24c('0x3b')],'outboundNoSuchCallsDay':_0x38dfdc[_0xa24c('0x3c')],'outboundOriginateFailureCallsDay':_0x38dfdc[_0xa24c('0x3d')],'outboundReCallsDay':_0x38dfdc[_0xa24c('0x3e')],'outboundRejectCallsDay':_0x38dfdc[_0xa24c('0x3f')],'outboundUnknownCallsDay':_0x38dfdc[_0xa24c('0x40')],'outboundAbandonedCallsDay':_0x38dfdc[_0xa24c('0x41')],'predictiveIntervalAnsweredCalls':_0x38dfdc[_0xa24c('0x42')],'predictiveIntervalAvgHoldtime':_0x38dfdc[_0xa24c('0x43')],'predictiveIntervalAvgTalktime':_0x38dfdc[_0xa24c('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x38dfdc['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x38dfdc[_0xa24c('0x45')],'predictiveIntervalErlangCalls':_0x38dfdc[_0xa24c('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x38dfdc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x38dfdc[_0xa24c('0x47')],'predictiveIntervalMultiplicativeFactor':_0x38dfdc[_0xa24c('0x48')],'predictiveIntervalPauses':_0x38dfdc[_0xa24c('0x49')],'predictiveIntervalAvailable':_0x38dfdc[_0xa24c('0x4a')],'predictiveIntervalTotalCalls':_0x38dfdc[_0xa24c('0x4b')],'message':_0x38dfdc[_0xa24c('0x4c')],'originated':_0x38dfdc[_0xa24c('0x4d')],'erlangCalls':_0x38dfdc[_0xa24c('0x4e')],'erlangCallToSecond':_0x38dfdc[_0xa24c('0x4f')],'erlangAbandonmentRate':_0x38dfdc[_0xa24c('0x50')],'erlangBusyFactor':_0x38dfdc['erlangBusyFactor'],'startPredictive':_0x38dfdc['startPredictive'],'startProgressive':_0x38dfdc['startProgressive']};if(_0x38dfdc[_0xa24c('0x51')]){_0x2ec5ad['Trunk']={'id':_0x38dfdc[_0xa24c('0x51')]['id'],'name':_0x38dfdc[_0xa24c('0x51')][_0xa24c('0x28')],'active':_0x38dfdc['Trunk'][_0xa24c('0x52')],'callerid':_0x38dfdc[_0xa24c('0x51')][_0xa24c('0x53')]};}if(_0x38dfdc['Interval']){_0x2ec5ad[_0xa24c('0x54')]={'id':_0x38dfdc[_0xa24c('0x54')]['id'],'name':_0x38dfdc['Interval'][_0xa24c('0x28')]};}var _0x22fd0f=md5(JSON[_0xa24c('0x55')](_0x2ec5ad));if(_0x38dfdc['md5']!==_0x22fd0f){_0x38dfdc[_0xa24c('0x2')]=_0x22fd0f;emit(util[_0xa24c('0x56')](_0xa24c('0x57'),_0x2ec5ad[_0xa24c('0x28')]),_0xa24c('0x58'),_0x2ec5ad);}}}function emitVoiceQueueChannelRemove(_0x4a9d2d){logger[_0xa24c('0x59')](_0xa24c('0x5a'),JSON['stringify'](_0x4a9d2d));emit(util[_0xa24c('0x56')](_0xa24c('0x57'),_0x4a9d2d[_0xa24c('0x28')]),'voice_queue_channel:remove',_0x4a9d2d);io['emit'](_0xa24c('0x5b'),_0x4a9d2d);}function notSendMessagesQueue(_0xa5c873){if(_0xa5c873[_0xa24c('0x5c')]){if(_0xa5c873[_0xa24c('0x4d')]===0x0&&_0xa5c873[_0xa24c('0x2b')]===0x0){_0xa5c873[_0xa24c('0x5c')]=![];_0xa5c873['available']=0x0;_0xa5c873[_0xa24c('0x5d')]=0x0;_0xa5c873[_0xa24c('0x4c')]=_0xa24c('0x5e');ut[_0xa24c('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xa5c873[_0xa24c('0x28')]+_0xa24c('0x60'));}else{_0xa5c873[_0xa24c('0x4c')]=_0xa24c('0x61');ut[_0xa24c('0x5f')](_0xa24c('0x62'),_0xa5c873[_0xa24c('0x28')]+'\x20is\x20disactive');}emitCampaignPreview(_0xa5c873);}}Preview['prototype'][_0xa24c('0x24')]=function(){var _0x4dde63=this;setInterval(function(){_0x4dde63[_0xa24c('0x63')]();},0x7cf);};Preview['prototype'][_0xa24c('0x63')]=function(){var _0x214627=this[_0xa24c('0x12')];this[_0xa24c('0x15')]+=0x1;for(var _0x21328f in _0x214627){if(_0x214627[_0xa24c('0x64')](_0x21328f)&&(_0x214627[_0x21328f][_0xa24c('0x34')]===_0xa24c('0x5')||_0x214627[_0x21328f][_0xa24c('0x34')]===_0xa24c('0x65'))&&_0x214627[_0x21328f][_0xa24c('0x26')]===_0xa24c('0x27')){if(this[_0xa24c('0x15')]>0x7){this[_0xa24c('0x15')]=0x0;this[_0xa24c('0x66')]();}}if(_0x214627[_0xa24c('0x64')](_0x21328f)&&_0x214627[_0x21328f]['dialMethod']===_0xa24c('0x5')&&_0x214627[_0x21328f][_0xa24c('0x26')]===_0xa24c('0x27')){if(_0x214627[_0x21328f]['dialActive']){this[_0xa24c('0x67')](_0x214627[_0x21328f]);if(_0x214627[_0x21328f][_0xa24c('0x68')])this[_0xa24c('0x69')](_0x214627[_0x21328f]);}else{notSendMessagesQueue(_0x214627[_0x21328f]);}}}};Preview[_0xa24c('0xd')]['clearZombieChannel']=function(_0x67a84e){var _0x3703fc=this;this[_0xa24c('0x11')][_0xa24c('0xe')](function(){if(!_[_0xa24c('0x6a')](_0x3703fc[_0xa24c('0x6b')][_0x67a84e])){loggerAction[_0xa24c('0x59')](_0xa24c('0x6c'),_0x67a84e,_0xa24c('0x6d'),_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x6e')],_0xa24c('0x6f'),JSON[_0xa24c('0x55')](_0x3703fc['campaignsPreview'][_0x3703fc[_0xa24c('0x6b')][_0x67a84e]['queue']][_0xa24c('0x4d')]),_0xa24c('0x70'),JSON[_0xa24c('0x55')](_0x3703fc[_0xa24c('0x12')][_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x6e')]][_0xa24c('0x2b')]),JSON[_0xa24c('0x55')](_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x71')]),JSON[_0xa24c('0x55')](_[_0xa24c('0x72')](_0x3703fc[_0xa24c('0x6b')][_0x67a84e],['contactId',_0xa24c('0x73'),_0xa24c('0x74'),_0xa24c('0x75')])));return ami[_0xa24c('0x76')]({'action':'status','channel':_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x77')]})[_0xa24c('0x78')](function(_0x4f3778){if(_0x4f3778['message']===_0xa24c('0x79')){setTimeout(function(){if(_0x3703fc[_0xa24c('0x6b')][_0x67a84e]){ut['updateOriginated'](_0x3703fc[_0xa24c('0x12')][_0x3703fc[_0xa24c('0x6b')][_0x67a84e]['queue']],_0xa24c('0x7a'));if(_0x3703fc['actions'][_0x67a84e]['dialAnswer']===!![]){ut[_0xa24c('0x7b')](_0x3703fc['campaignsPreview'][_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x6e')]],'[clearZombieChannel]');ut[_0xa24c('0x7c')](_0xa24c('0x7d')+_0x67a84e,_0x3703fc[_0xa24c('0x6b')][_0x67a84e][_0xa24c('0x6e')]);}ut['loggerError'](_0xa24c('0x7e')+_0x67a84e,_0x3703fc['actions'][_0x67a84e][_0xa24c('0x6e')]);delete _0x3703fc[_0xa24c('0x6b')][_0x67a84e];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x2cabd8=this;loggerAction[_0xa24c('0x59')](_0xa24c('0x7f'),_[_0xa24c('0x80')](this[_0xa24c('0x6b')]));for(var _0x5f2564 in this[_0xa24c('0x6b')]){if(_0x2cabd8['actions'][_0xa24c('0x64')](_0x5f2564)){_0x2cabd8['clearZombieChannel'](_0x5f2564);}}};Preview['prototype']['recallMe']=function(_0x3fc3d9){var _0x5c4834=this;rpcDb['getContactRecallMe'](_0x3fc3d9['id'],ut[_0xa24c('0x81')](this['agents']))[_0xa24c('0x82')](function(_0x143bdb){if(!_[_0xa24c('0x6a')](_0x143bdb)){for(var _0x14c819=0x0;_0x14c819<_0x143bdb[_0xa24c('0x83')];_0x14c819+=0x1){if(ut[_0xa24c('0x84')](_0x143bdb[_0x14c819][_0xa24c('0x85')])<_0x3fc3d9[_0xa24c('0x86')]*0x3c){if(_0x143bdb[_0x14c819]['Agent']&&!_0x143bdb[_0x14c819]['Agent'][_0xa24c('0x87')]){_0x5c4834[_0xa24c('0x88')](_0x143bdb[_0x14c819]['id'])['then'](ut[_0xa24c('0x89')](_0xa24c('0x8a')))['catch'](ut[_0xa24c('0x89')](_0xa24c('0x8a')));}else{rpcDb[_0xa24c('0x8b')](_0x143bdb[_0x14c819]['id']);}}else{var _0x4ee0cb=new Action(_0x143bdb[_0x14c819],_0x3fc3d9);_0x4ee0cb[_0xa24c('0x8c')]=moment()[_0xa24c('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fc3d9[_0xa24c('0x3e')]+=0x1;ut['logCustomer'](_0x4ee0cb,0x17,_0xa24c('0x8d'));if(_0x3fc3d9[_0xa24c('0x8e')]){rpcDb[_0xa24c('0x8f')](ut[_0xa24c('0x90')](_0x143bdb[_0x14c819]));rpcDb[_0xa24c('0x91')](_0x4ee0cb,_0xa24c('0x92'));}else{ut[_0xa24c('0x93')](_0x4ee0cb,0x16,_0xa24c('0x94'));rpcDb[_0xa24c('0x91')](_0x4ee0cb,_0xa24c('0x95'));rpcDb[_0xa24c('0x96')](_0x4ee0cb,_0xa24c('0x95'));}}}}})[_0xa24c('0x78')](ut[_0xa24c('0x89')](_0xa24c('0x97')));};Preview[_0xa24c('0xd')][_0xa24c('0x67')]=function(_0x46aded){_0x46aded['sendMessageOneNotActive']=!![];if(ut[_0xa24c('0x98')](_0x46aded['loggedIn'])){_0x46aded[_0xa24c('0x4c')]=_0xa24c('0x99');}else if(!ut[_0xa24c('0x9a')](_0x46aded[_0xa24c('0x33')])){_0x46aded['message']='NOT_ACTIVE';}else if(!this[_0xa24c('0x9b')](_0x46aded[_0xa24c('0x51')])){if(!this[_0xa24c('0x9b')](_0x46aded['TrunkBackup'])){_0x46aded[_0xa24c('0x4c')]=_0xa24c('0x9c');}else{_0x46aded[_0xa24c('0x4c')]=_0xa24c('0x9d');}}else{_0x46aded[_0xa24c('0x4c')]=_0xa24c('0x9d');}emitCampaignPreview(_0x46aded);};Preview[_0xa24c('0xd')][_0xa24c('0x9e')]=function(_0x26d04f,_0xb113c3,_0x2cb64e){var _0x19c87a=this;var _0x3b68d7=this[_0xa24c('0x6b')][_0xb113c3];var _0x34acae=this[_0xa24c('0x12')][_0x3b68d7[_0xa24c('0x6e')]];var _0x179e70;if(_0x34acae){switch(_0x2cb64e){case'1':_0x34acae[_0xa24c('0x3c')]+=0x1;_0x3b68d7[_0xa24c('0x9f')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut[_0xa24c('0x93')](_0x3b68d7,0x0,_0xa24c('0xa2'));ami[_0xa24c('0x25')](_0xa24c('0xa3'),ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xa5')));rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xa6'));if(ut['totalGlobal'](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut['cloneAction'](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xa9'));}else{if(_0x3b68d7[_0xa24c('0x9f')]>=_0x34acae['dialNoSuchNumberMaxRetry']){rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xa9'));}else{rpcDb[_0xa24c('0xaa')](ut['scheduledAt'](_0x3b68d7,_0xa24c('0x9f'),_0x34acae['dialNoSuchNumberRetryFrequency']),_0x3b68d7[_0xa24c('0xab')],_0x3b68d7[_0xa24c('0xac')]);}}delete this[_0xa24c('0x6b')][_0x26d04f['linkedid']];break;case _0xa24c('0xad'):var _0x846186=moment()['format'](_0xa24c('0xae'));_0x3b68d7[_0xa24c('0xaf')]=_0x846186;_0x3b68d7[_0xa24c('0xb0')]=_0x846186;_0x3b68d7[_0xa24c('0x71')]=!![];_0x34acae[_0xa24c('0x2b')]+=0x1;logger[_0xa24c('0x59')](_0xa24c('0xb1'),_0x3b68d7[_0xa24c('0xb2')],_0xa24c('0xb3'),_0x34acae[_0xa24c('0x28')],_0xa24c('0x70'),_0x34acae[_0xa24c('0x2b')]);ami[_0xa24c('0x25')](_0xa24c('0xb4'),ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xb5'),this['campaignsPreview'][_0x3b68d7[_0xa24c('0x6e')]]));if(_0x34acae[_0xa24c('0xb6')]){ami[_0xa24c('0x25')](_0xa24c('0xb7'),ut[_0xa24c('0xb8')](_0x3b68d7));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xb9'),this[_0xa24c('0x12')][_0x3b68d7[_0xa24c('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0xa24c('0xa4')](_0x3b68d7,'complete'));_0x34acae[_0xa24c('0x36')]+=0x1;_0x34acae[_0xa24c('0x30')]+=0x1;_0x34acae[_0xa24c('0xba')]+=0x1;ut['decrementTalkink'](_0x34acae,_0xa24c('0xbb'));_0x3b68d7['countglobal']=ut['totalGlobal'](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0x4,_0xa24c('0xbc'));rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xbd'));rpcDb[_0xa24c('0x96')](_0x3b68d7,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xa24c('0xbe')](_0x3b68d7);_0x34acae[_0xa24c('0x2d')]+=_0x3b68d7[_0xa24c('0xbf')];_0x34acae[_0xa24c('0x2c')]+=_0x3b68d7[_0xa24c('0xbf')];logger['info'](_0xa24c('0xc0'),_0x3b68d7[_0xa24c('0xb2')],'\x20Queue',_0x34acae['name'],_0xa24c('0x70'),_0x34acae[_0xa24c('0x2b')]);delete this[_0xa24c('0x6b')][_0x26d04f[_0xa24c('0xc1')]];break;case _0xa24c('0xc2'):_0x34acae[_0xa24c('0x38')]+=0x1;_0x3b68d7[_0xa24c('0xc3')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut['totalGlobal'](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0x5,_0xa24c('0xc4'));ami[_0xa24c('0x25')](_0xa24c('0xc5'),ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xc6')));rpcDb['createCustomerHistory'](_0x3b68d7,_0xa24c('0xc7'));if(ut['totalGlobal'](_0x3b68d7)>=_0x34acae['dialGlobalMaxRetry']){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb['createCustomerFinal'](_0x179e70,_0xa24c('0xc9'));}else{if(_0x3b68d7[_0xa24c('0xc3')]>=_0x34acae[_0xa24c('0xca')]){rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0xa24c('0xcb')](_0x3b68d7,_0xa24c('0xc3'),_0x34acae[_0xa24c('0xcc')]),_0x3b68d7[_0xa24c('0xab')],_0x3b68d7[_0xa24c('0xac')]);}}break;case _0xa24c('0xcd'):_0x34acae[_0xa24c('0x3b')]+=0x1;_0x3b68d7[_0xa24c('0xce')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut[_0xa24c('0x93')](_0x3b68d7,0x3,_0xa24c('0xcf'));ami[_0xa24c('0x25')]('custom:agentnoanswer',ut['buildObj'](_0x3b68d7,_0xa24c('0xd0')));rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xd1'));if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xd2'));}else{if(_0x3b68d7[_0xa24c('0xce')]>=_0x34acae[_0xa24c('0xd3')]){rpcDb['createCustomerFinal'](_0x3b68d7,_0xa24c('0xd1'));}else{rpcDb[_0xa24c('0xaa')](ut[_0xa24c('0xcb')](_0x3b68d7,_0xa24c('0xce'),_0x34acae[_0xa24c('0xd4')]),_0x3b68d7[_0xa24c('0xab')],_0x3b68d7['activeContact']);}}break;case _0xa24c('0xd5'):_0x34acae[_0xa24c('0x39')]+=0x1;_0x3b68d7[_0xa24c('0xd6')]+=0x1;_0x3b68d7['countglobal']=ut[_0xa24c('0xa1')](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0x8,_0xa24c('0xd7'));ami[_0xa24c('0x25')](_0xa24c('0xd8'),ut['buildObj'](_0x3b68d7,_0xa24c('0xd9')));rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xda'));if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xdb'));}else{if(_0x3b68d7[_0xa24c('0xd6')]>=_0x34acae[_0xa24c('0xdc')]){rpcDb[_0xa24c('0x96')](_0x3b68d7,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa24c('0xaa')](ut[_0xa24c('0xcb')](_0x3b68d7,_0xa24c('0xd6'),_0x34acae[_0xa24c('0xcc')]),_0x3b68d7[_0xa24c('0xab')],_0x3b68d7['activeContact']);}}break;case _0xa24c('0xdd'):_0x34acae['outboundRejectCallsDay']+=0x1;_0x3b68d7[_0xa24c('0xde')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0x14,_0xa24c('0xdf'));ami['emit'](_0xa24c('0xe0'),ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xe1')));rpcDb['createCustomerHistory'](_0x3b68d7,_0xa24c('0xe2'));if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae['dialGlobalMaxRetry']){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0x14,_0xa24c('0xdf'));rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xe3'));}else{if(_0x3b68d7[_0xa24c('0xde')]>=_0x34acae[_0xa24c('0xe4')]){rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xe3'));}else{rpcDb[_0xa24c('0xaa')](ut[_0xa24c('0xcb')](_0x3b68d7,_0xa24c('0xde'),_0x34acae[_0xa24c('0xe5')]),_0x3b68d7['unlockAgent'],_0x3b68d7[_0xa24c('0xac')]);}}break;case _0xa24c('0xe6'):_0x34acae[_0xa24c('0x41')]+=0x1;_0x3b68d7['countabandonedretry']+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut[_0xa24c('0x93')](_0x3b68d7,0xb,'Abandoned');rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xe7'));if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb['createCustomerFinal'](_0x179e70,_0xa24c('0xe7'));}else{if(_0x3b68d7[_0xa24c('0xe8')]>=_0x34acae[_0xa24c('0xe9')]){rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xe7'));}else{rpcDb['rescheduleContact'](ut[_0xa24c('0xcb')](_0x3b68d7,_0xa24c('0xea'),_0x34acae[_0xa24c('0xeb')]),_0x3b68d7[_0xa24c('0xab')],_0x3b68d7[_0xa24c('0xac')]);}}break;case'18':_0x34acae['outboundUnknownCallsDay']+=0x1;_0x3b68d7['countmachineretry']+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0x12,_0x26d04f[_0xa24c('0xec')]||_0x26d04f[_0xa24c('0xed')]);ami[_0xa24c('0x25')](_0xa24c('0xee'),ut['buildObj'](_0x3b68d7,_0xa24c('0xef')));rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xf0'));if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae['dialGlobalMaxRetry']){_0x179e70=ut['cloneAction'](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xf0'));}else{rpcDb[_0xa24c('0x96')](_0x3b68d7,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xa24c('0x6b')][_0x26d04f[_0xa24c('0xc1')]];break;case'19':_0x34acae[_0xa24c('0x40')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut[_0xa24c('0xa1')](_0x3b68d7);ut[_0xa24c('0x93')](_0x3b68d7,0x13,_0x26d04f[_0xa24c('0xec')]||_0x26d04f[_0xa24c('0xed')]);ami[_0xa24c('0x25')](_0xa24c('0xee'),ut[_0xa24c('0xa4')](_0x3b68d7,_0xa24c('0xef')));rpcDb[_0xa24c('0x91')](_0x3b68d7,'[callProgressDetectingCustomer][machine]');if(ut[_0xa24c('0xa1')](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,_0xa24c('0xa8'));rpcDb[_0xa24c('0x96')](_0x179e70,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xf1'));}delete this['actions'][_0x26d04f['linkedid']];break;default:if(_0x3b68d7['dialAnswer']){ut[_0xa24c('0x7b')](_0x34acae,'[default]');ut[_0xa24c('0x7c')](_0xa24c('0xf2')+_0x34acae['name'],_0x26d04f);}_0x34acae[_0xa24c('0x40')]+=0x1;_0x3b68d7[_0xa24c('0xa0')]=ut['totalGlobal'](_0x3b68d7);ut['logCustomer'](_0x3b68d7,0xc,_0x26d04f[_0xa24c('0xec')]||_0x26d04f[_0xa24c('0xed')]);rpcDb[_0xa24c('0x91')](_0x3b68d7,_0xa24c('0xf3'));if(ut['totalGlobal'](_0x3b68d7)>=_0x34acae[_0xa24c('0xa7')]){_0x179e70=ut[_0xa24c('0xc8')](_0x3b68d7,0xf,'Global');rpcDb[_0xa24c('0x96')](_0x179e70,_0xa24c('0xf4'));}else{rpcDb[_0xa24c('0x96')](_0x3b68d7,_0xa24c('0xf4'));}delete this[_0xa24c('0x6b')][_0x26d04f[_0xa24c('0xc1')]];}if(!(_0x3b68d7[_0xa24c('0x71')]&&_0x2cb64e==='16')){ut['updateOriginated'](_0x34acae,'[callProgressDetectingCustomer]');logger[_0xa24c('0x59')](_0xa24c('0xf5'),_0x3b68d7['uniqueid'],'\x20Queue',_0x34acae[_0xa24c('0x28')],_0xa24c('0x6f'),_0x34acae[_0xa24c('0x4d')]);}if(_0x2cb64e!=='ANSWER'){delete this[_0xa24c('0x6b')][_0x26d04f[_0xa24c('0xc1')]];delete this[_0xa24c('0x6b')][_0x26d04f[_0xa24c('0xf6')]];}}};Preview[_0xa24c('0xd')][_0xa24c('0xf7')]=function(_0x58fd7,_0x352f29,_0x54cd76){if(_['isUndefined'](_0x352f29)&&_0xa24c('0xf8')!==typeof _0x352f29){return;}if(_[_0xa24c('0xf9')](_0x54cd76)&&'object'!==typeof _0x54cd76){return;}switch(_0x54cd76['reason']){case'0':ut[_0xa24c('0xfa')](_0x58fd7,0x0,_0xa24c('0xa2'));rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0xfc'));break;case'3':ut[_0xa24c('0xfa')](_0x58fd7,0x3,_0xa24c('0xcf'));rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0xfd'));break;case'5':ut['logAgent'](_0x58fd7,0x5,_0xa24c('0xc4'));rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0xfe'));break;case'8':ut[_0xa24c('0xfa')](_0x58fd7,0x8,_0xa24c('0xd7'));rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0xff'));break;case'22':ut[_0xa24c('0xfa')](_0x58fd7,0x16,_0xa24c('0x100'));rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0x101'));break;default:ut[_0xa24c('0xfa')](_0x58fd7,0xc,_0x54cd76[_0xa24c('0x102')]);rpcDb[_0xa24c('0xfb')](_0x58fd7,_0xa24c('0xff'));}ut[_0xa24c('0x103')](_0x352f29,'[callProgressDetectingAgent]');logger['info'](_0xa24c('0x104'),_0x58fd7[_0xa24c('0xb2')],_0xa24c('0xb3'),_0x352f29[_0xa24c('0x28')],_0xa24c('0x6f'),_0x352f29[_0xa24c('0x4d')]);delete this[_0xa24c('0x6b')][_0x58fd7['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x4ef03e,_0x4d9695,_0xeaef09,_0x28f207,_0x363ce0){var _0x494094=this;return new BPromise(function(_0xd6d9a,_0x44d5a4){if(_[_0xa24c('0x6a')](_0x4d9695)||_['isNil'](_0x4d9695[_0xa24c('0x105')])||_['isNil'](_0x4d9695[_0xa24c('0x105')][_0xa24c('0x106')])||_[_0xa24c('0x6a')](_0x4d9695[_0xa24c('0x74')])){_0x44d5a4(ut['message']('Contact\x20is\x20undefined',_0x28f207,_0x363ce0));return;}var _0x5d5398=uuid['v4']();var _0x3da105=_0x494094[_0xa24c('0x12')][_0x4d9695['Queue'][_0xa24c('0x28')]];var _0x57eb5b=_0xeaef09?_0x494094[_0xa24c('0x14')][_0xeaef09]['id']:undefined;_0x494094[_0xa24c('0x6b')][_0x5d5398]=new Action(_0x4d9695,_0x3da105,_0x5d5398,_0xeaef09,_0x57eb5b);var _0x112a98=_0x494094[_0xa24c('0x6b')][_0x5d5398];_0x112a98[_0xa24c('0xab')]=_0x28f207;_0x112a98[_0xa24c('0xac')]=_0x363ce0;_0x112a98[_0xa24c('0x107')]=_0xeaef09;if(_[_0xa24c('0x108')](_0x4ef03e)){_0x494094[_0xa24c('0x109')](_0x112a98,_0x3da105,_0x4d9695,_0xeaef09)[_0xa24c('0x82')](function(_0x24a843){logger['info']('[Preview][execCall][success]',_0xa24c('0x10a')+_0x112a98[_0xa24c('0x6e')]+_0xa24c('0x10b')+_0x112a98['idContact'],JSON[_0xa24c('0x55')](_0x24a843));ami[_0xa24c('0x25')](_0xa24c('0x10c'),ut[_0xa24c('0xa4')](_0x112a98,_0xa24c('0x10d'),_0x494094[_0xa24c('0x12')][_0x112a98['queue']]));_0xd6d9a(ut[_0xa24c('0x4c')]('Calling'));})[_0xa24c('0x78')](function(_0x2509b6){ut[_0xa24c('0x5f')](_0xa24c('0x10e'),_0x2509b6);_0x44d5a4(ut[_0xa24c('0x4c')](_0xa24c('0x10f'),_0x28f207,_0x363ce0));});}else{_0x3da105[_0xa24c('0x37')]+=0x1;ut['logBlacklist'](_0x112a98);rpcDb[_0xa24c('0x110')](_0x112a98,_0xa24c('0x111'));delete _0x494094[_0xa24c('0x6b')][_0x5d5398];_0x44d5a4(ut[_0xa24c('0x4c')](_0xa24c('0x112'),_0x28f207,_0x363ce0));}});};Preview[_0xa24c('0xd')]['isTrunkReachable']=function(_0x268414){return!_[_0xa24c('0x6a')](_0x268414)&&!_['isNil'](_0x268414['name'])&&!_[_0xa24c('0x6a')](_0x268414[_0xa24c('0x52')])&&_0x268414[_0xa24c('0x52')]&&!_['isNil'](this[_0xa24c('0x113')][util[_0xa24c('0x56')](_0xa24c('0x114'),_0x268414[_0xa24c('0x28')])])&&!_[_0xa24c('0x6a')](this[_0xa24c('0x113')][util[_0xa24c('0x56')]('SIP/%s',_0x268414['name'])]['status'])&&(this[_0xa24c('0x113')][util[_0xa24c('0x56')](_0xa24c('0x114'),_0x268414[_0xa24c('0x28')])]['status']===_0xa24c('0x115')||this['trunks'][util['format']('SIP/%s',_0x268414[_0xa24c('0x28')])]['status']===_0xa24c('0x116'));};Preview[_0xa24c('0xd')][_0xa24c('0x88')]=function(_0x137ff9,_0x4783e3){var _0x23e6b5=this;return new BPromise(function(_0x360463,_0xd08a1f){_0x23e6b5[_0xa24c('0x117')](_0x137ff9,_0x4783e3)[_0xa24c('0x82')](function(_0x31013c){_0x360463(_[_0xa24c('0x72')](_0x31013c,['message']));})[_0xa24c('0x78')](function(_0x76d731){if(_0x76d731[_0xa24c('0x118')]){rpcDb[_0xa24c('0x119')](_0x137ff9);}if(_0x76d731[_0xa24c('0x52')]){rpcDb[_0xa24c('0x8b')](_0x137ff9);}_0xd08a1f(_['pick'](_0x76d731,[_0xa24c('0x4c')]));});});};Preview['prototype']['execRun']=function(_0x1dc858,_0x521e45){var _0x510ce5=this;return new BPromise(function(_0x100548,_0x3f9ff2){var _0x41448e,_0x4b53d4;rpcDb['getContactPreview'](_0x1dc858)[_0xa24c('0x82')](function(_0x4ec9a7){if(!_['isNil'](_0x4ec9a7[0x0])){_0x4b53d4=_0x4ec9a7[0x0]['recallme']?![]:!![];_0x41448e=_0x4ec9a7[0x0][_0xa24c('0x11a')]?!![]:![];_0x41448e=_0x521e45?!![]:_0x41448e;}var _0x48275e=_0x510ce5[_0xa24c('0x11b')](_0x4ec9a7);if(_0x48275e[_0xa24c('0x11c')]){rpcDb[_0xa24c('0x11d')](_['pick'](_0x4ec9a7[0x0],[_0xa24c('0x74'),_0xa24c('0x11e')]))[_0xa24c('0x82')](function(_0x25436b){_0x510ce5['checkInBlack'](_0x25436b,_0x4ec9a7[0x0],_0x521e45,_0x4b53d4,_0x41448e)[_0xa24c('0x82')](function(_0xc41066){_0x100548(_0xc41066);})[_0xa24c('0x78')](function(_0x20cba8){_0x3f9ff2(_0x20cba8);});})[_0xa24c('0x78')](function(_0x41138e){ut[_0xa24c('0x5f')](_0xa24c('0x11f'),_0x41138e);_0x3f9ff2(ut[_0xa24c('0x4c')]('Call\x20unsuccessful',_0x4b53d4,_0x41448e));});}else{_0x3f9ff2(ut['message'](_0x48275e[_0xa24c('0x4c')],_0x4b53d4,_0x41448e));}})['catch'](function(_0x4a8fe7){ut[_0xa24c('0x5f')](_0xa24c('0x120'),_0x4a8fe7);_0x3f9ff2(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xa24c('0x11b')]=function(_0x43d5a0){if(_[_0xa24c('0x6a')](_0x43d5a0)||_[_0xa24c('0x108')](_0x43d5a0)||!_[_0xa24c('0x6a')](_0x43d5a0[0x0]['Agent'])&&_['isNil'](_0x43d5a0[0x0][_0xa24c('0x121')][_0xa24c('0x28')])){ut['logger'](_0xa24c('0x122'),_0x43d5a0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x5c575e=this[_0xa24c('0x12')][_0x43d5a0[0x0][_0xa24c('0x6d')][_0xa24c('0x28')]];_0x5c575e[_0xa24c('0x4c')]='ACTIVE';if(_['isNil'](_0x5c575e)){ut[_0xa24c('0x5f')](_0xa24c('0x123'),_0x5c575e);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xa24c('0x9b')](_0x5c575e[_0xa24c('0x51')])){ut[_0xa24c('0x5f')](_0xa24c('0x124'),'campaign\x20Name:\x20'+_0x5c575e['name']+_0xa24c('0x125'));if(!this['isTrunkReachable'](_0x5c575e[_0xa24c('0x126')])){ut['logger'](_0xa24c('0x124'),_0x5c575e['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xa24c('0x127')};}}if(!ut['isActive'](_0x5c575e[_0xa24c('0x33')])){ut[_0xa24c('0x5f')](_0xa24c('0x128'),_0x5c575e[_0xa24c('0x28')]+_0xa24c('0x129'));return{'isValid':![],'message':_0xa24c('0x12a')+_0x5c575e['name']+_0xa24c('0x129')};}return{'isValid':!![],'message':_0xa24c('0x12b')};};Preview[_0xa24c('0xd')][_0xa24c('0x109')]=function(_0x32819a,_0x5ce5b6,_0x167d1e,_0x4194f7){var _0x5e44a4=this;return new BPromise(function(_0x154fe3,_0x14fc72){var _0x1230e9=_0x32819a[_0xa24c('0xb2')];var _0x42791a=_0x5e44a4[_0xa24c('0x9b')](_0x5ce5b6[_0xa24c('0x51')])?util[_0xa24c('0x56')](_0xa24c('0x12c'),_0x5ce5b6['Trunk'][_0xa24c('0x28')],_[_0xa24c('0x6a')](_0x5ce5b6['dialPrefix'])?'':_0x5ce5b6['dialPrefix'][_0xa24c('0x12d')]()||'',_0x5ce5b6[_0xa24c('0x12e')]>0x0?_0x167d1e[_0xa24c('0x105')][_0xa24c('0x106')]['substring'](_0x5ce5b6['dialCutDigit']):_0x167d1e[_0xa24c('0x105')][_0xa24c('0x106')]):util[_0xa24c('0x56')](_0xa24c('0x12c'),_['isNil'](_0x5ce5b6[_0xa24c('0x126')])?_0x5ce5b6[_0xa24c('0x51')][_0xa24c('0x28')]:_0x5ce5b6[_0xa24c('0x126')]['name'],_[_0xa24c('0x6a')](_0x5ce5b6[_0xa24c('0x12f')])?'':_0x5ce5b6[_0xa24c('0x12f')][_0xa24c('0x12d')]()||'',_0x5ce5b6[_0xa24c('0x12e')]>0x0?_0x167d1e[_0xa24c('0x105')][_0xa24c('0x106')][_0xa24c('0x130')](_0x5ce5b6[_0xa24c('0x12e')]):_0x167d1e[_0xa24c('0x105')][_0xa24c('0x106')]);var _0x20e4b7=_0x5e44a4['isTrunkReachable'](_0x5ce5b6[_0xa24c('0x51')])?ut['getCallerId'](_0x5ce5b6['Trunk']['callerid'],_0x5ce5b6['dialOriginateCallerIdName'],_0x5ce5b6[_0xa24c('0x131')]>0x0?ut['getCallerIdRandom'](_0x5ce5b6['dialOriginateCallerIdNumber'],_0x5ce5b6['dialRandomLastDigitCallerIdNumber']):_0x5ce5b6[_0xa24c('0x132')]):ut[_0xa24c('0x133')](_[_0xa24c('0x6a')](_0x5ce5b6['TrunkBackup'])?_0x5ce5b6['Trunk'][_0xa24c('0x53')]:_0x5ce5b6[_0xa24c('0x126')][_0xa24c('0x53')],_0x5ce5b6[_0xa24c('0x35')],_0x5ce5b6[_0xa24c('0x131')]>0x0?ut[_0xa24c('0x134')](_0x5ce5b6[_0xa24c('0x132')],_0x5ce5b6[_0xa24c('0x131')]):_0x5ce5b6['dialOriginateCallerIdNumber']);if(_0x20e4b7){_0x32819a[_0xa24c('0x135')]=ut[_0xa24c('0x136')](_0x20e4b7);_0x32819a[_0xa24c('0x137')]=ut[_0xa24c('0x138')](_0x20e4b7);}var _0x4e676a=ut['addVariables'](_0x5ce5b6,_0x167d1e,_0x42791a,_0x20e4b7,_0x1230e9,_0x32819a);_[_0xa24c('0x139')](_0x32819a,ut[_0xa24c('0x13a')](_0x4e676a));_0x32819a[_0xa24c('0x8c')]=moment()[_0xa24c('0x56')](_0xa24c('0xae'));ami['Action'](ut['variablesAction'](_0x32819a,_0x5ce5b6,_0x4e676a,_0x32819a[_0xa24c('0xac')],_0x4194f7))['then'](function(_0xcbc692){_0x5ce5b6[_0xa24c('0x4d')]+=0x1;logger[_0xa24c('0x59')](_0xa24c('0x13b'),_0x1230e9,_0xa24c('0xb3'),_0x5ce5b6[_0xa24c('0x28')],_0xa24c('0x6f'),_0x5ce5b6['originated']);_0x154fe3(_0xcbc692);})[_0xa24c('0x78')](function(_0x4dc309){ut['logAgent'](_0x32819a,0xe,_0xa24c('0x13c'));rpcDb[_0xa24c('0xfb')](_0x32819a,_0xa24c('0x13d'));_0x14fc72(_0x4dc309);});});};Preview[_0xa24c('0xd')][_0xa24c('0x1e')]=function(_0x477649){if(this[_0xa24c('0x6b')][_0x477649[_0xa24c('0xc1')]]){this[_0xa24c('0x6b')][_0x477649[_0xa24c('0xc1')]][_0xa24c('0x77')]=_0x477649['channel'];}};Preview['prototype'][_0xa24c('0x17')]=function(_0xf7e8d2){var _0x39e3d5=this;var _0x5f0468=this[_0xa24c('0x6b')][_0xf7e8d2[_0xa24c('0x13e')]];if(_0x5f0468){if(_0x5f0468['lookAgent']&&this[_0xa24c('0x14')][_0x5f0468[_0xa24c('0x107')]]){ut[_0xa24c('0x13f')](_0x5f0468,this[_0xa24c('0x14')][_0x5f0468[_0xa24c('0x107')]]['name'],this[_0xa24c('0x14')][_0x5f0468[_0xa24c('0x107')]]['id']);}var _0x3abc23=_['clone'](_0x5f0468);_0x3abc23[_0xa24c('0xaf')]=moment()[_0xa24c('0x56')](_0xa24c('0xae'));var _0x319500=_0x39e3d5[_0xa24c('0x12')][_0x5f0468[_0xa24c('0x6e')]];if(ut[_0xa24c('0x140')](_0xf7e8d2[_0xa24c('0x141')])){if(_0x5f0468[_0xa24c('0xab')]){rpcDb[_0xa24c('0x119')](_0x5f0468['idContact']);}if(_0x5f0468[_0xa24c('0xac')]){rpcDb['disableContact'](_0x5f0468[_0xa24c('0x142')]);}ami[_0xa24c('0x25')](_0xa24c('0x143'),ut[_0xa24c('0xa4')](_0x5f0468,'rejected',this[_0xa24c('0x12')][_0x5f0468[_0xa24c('0x6e')]]));this[_0xa24c('0xf7')](_0x3abc23,_0x319500,_0xf7e8d2);}else{_0x5f0468[_0xa24c('0x8c')]=moment()['format'](_0xa24c('0xae'));ut[_0xa24c('0xfa')](_0x3abc23,0x4,_0xa24c('0xbc'));rpcDb[_0xa24c('0xfb')](_0x3abc23,_0xa24c('0x144'));}}};Preview[_0xa24c('0xd')]['syncHangup']=function(_0x1409d0){var _0x343c46=this;var _0x10ff10=this[_0xa24c('0x6b')][_0x1409d0[_0xa24c('0xc1')]];var _0x39062d;if(_0x10ff10){_0x39062d=this[_0xa24c('0x12')][_0x10ff10[_0xa24c('0x6e')]];logger['info'](_0xa24c('0x145'),_0x1409d0[_0xa24c('0xc1')],_0xa24c('0xb3'),_0x39062d['name'],_0xa24c('0x70'),_0x39062d[_0xa24c('0x2b')]);}if(this[_0xa24c('0x6b')][_0x1409d0[_0xa24c('0xc1')]]&&_0x1409d0[_0xa24c('0xc1')]!==_0x1409d0[_0xa24c('0xb2')]){if(_0x1409d0['cause']==='16'&&this[_0xa24c('0x6b')][_0x1409d0[_0xa24c('0xc1')]][_0xa24c('0x71')]){this[_0xa24c('0x9e')](_0x1409d0,_0x1409d0[_0xa24c('0xc1')],_0x1409d0['cause']);}else if(this['actions'][_0x1409d0['linkedid']][_0xa24c('0x71')]){logger['info'](_0xa24c('0x146'),_0x1409d0[_0xa24c('0xc1')],_0x1409d0[_0xa24c('0x147')],_0xa24c('0xb3'),_0x39062d['name'],'pTalking:\x20',_0x39062d[_0xa24c('0x2b')]);this['callProgressDetectingCustomer'](_0x1409d0,_0x1409d0['linkedid'],_0x1409d0['cause']);}}else if(_0x10ff10&&_[_0xa24c('0x6a')](_0x10ff10['statedesc'])&&_0x39062d[_0xa24c('0x148')]&&_0x1409d0[_0xa24c('0xc1')]===_0x1409d0[_0xa24c('0xb2')]&&_[_0xa24c('0x6a')](_0x1409d0[_0xa24c('0x102')])&&_0x1409d0['cause']==='16'&&_0x1409d0[_0xa24c('0x149')]==='6'&&_[_0xa24c('0xf9')](_0x10ff10[_0xa24c('0x14a')])){if(_0x10ff10['unlockAgent']){rpcDb[_0xa24c('0x119')](_0x10ff10['idContact']);}if(_0x10ff10[_0xa24c('0xac')]){rpcDb[_0xa24c('0x8b')](_0x10ff10[_0xa24c('0x142')]);}_0x1409d0[_0xa24c('0x102')]='22';this['callProgressDetectingAgent'](_0x10ff10,_0x39062d,_0x1409d0);}else if(_0x10ff10&&_0x10ff10[_0xa24c('0x14a')]){if(_0x1409d0['cause']==='16'&&this[_0xa24c('0x6b')][_0x1409d0[_0xa24c('0xc1')]][_0xa24c('0x71')]){logger[_0xa24c('0x59')](_0xa24c('0x14b'),_0x1409d0[_0xa24c('0xc1')],_0x1409d0[_0xa24c('0x147')],_0xa24c('0xb3'),_0x39062d[_0xa24c('0x28')],_0xa24c('0x70'),_0x39062d[_0xa24c('0x2b')]);this[_0xa24c('0x9e')](_0x1409d0,_0x1409d0['linkedid'],_0x1409d0['cause']);}else if(this[_0xa24c('0x6b')][_0x1409d0[_0xa24c('0xc1')]]['dialAnswer']){logger[_0xa24c('0x59')](_0xa24c('0x146'),_0x1409d0[_0xa24c('0xc1')],_0x1409d0['cause'],_0xa24c('0xb3'),_0x39062d[_0xa24c('0x28')],_0xa24c('0x70'),_0x39062d['pTalking']);this[_0xa24c('0x9e')](_0x1409d0,_0x1409d0[_0xa24c('0xc1')],_0x1409d0[_0xa24c('0x147')]);}}};Preview[_0xa24c('0xd')][_0xa24c('0x1c')]=function(_0xff0b2a){if(this[_0xa24c('0x6b')][_0xff0b2a['destlinkedid']]&&_0xff0b2a['destlinkedid']!==_0xff0b2a[_0xa24c('0x14c')]){this[_0xa24c('0x9e')](_0xff0b2a,_0xff0b2a['destlinkedid'],_0xff0b2a[_0xa24c('0xed')]);}};Preview[_0xa24c('0xd')][_0xa24c('0x19')]=function(_0x71f339){if(this[_0xa24c('0x6b')][_0x71f339[_0xa24c('0xc1')]]&&_0x71f339['linkedid']!==_0x71f339[_0xa24c('0xb2')]&&!this[_0xa24c('0x6b')][_0x71f339[_0xa24c('0xc1')]][_0xa24c('0x71')]){if(_0x71f339['cause']==='1'){this[_0xa24c('0x9e')](_0x71f339,_0x71f339[_0xa24c('0xc1')],_0x71f339[_0xa24c('0x147')]);}}};Preview[_0xa24c('0xd')][_0xa24c('0x14d')]=function(_0x40d0fe,_0x5abbae,_0x37adca){if(this[_0xa24c('0x6b')][_0x40d0fe]){if(_[_0xa24c('0x6a')](this[_0xa24c('0x6b')][_0x40d0fe][_0xa24c('0x14e')])){this[_0xa24c('0x6b')][_0x40d0fe][_0xa24c('0x14e')]={};}this[_0xa24c('0x6b')][_0x40d0fe][_0xa24c('0x14e')][_0x5abbae]=_0x37adca;}};Preview[_0xa24c('0xd')][_0xa24c('0x20')]=function(_0x261c52){try{if(!_[_0xa24c('0x6a')](_0x261c52)){if(ut['filterKey'](_[_0xa24c('0x14f')](_0x261c52[_0xa24c('0x150')])[0x0])){this[_0xa24c('0x14d')](_0x261c52[_0xa24c('0xb2')],_[_0xa24c('0x14f')](_0x261c52[_0xa24c('0x150')])[0x0],_0x261c52[_0xa24c('0x151')]);}}}catch(_0x3aafd6){logger[_0xa24c('0x152')](_0xa24c('0x153'),util[_0xa24c('0x154')](_0x3aafd6,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xa24c('0x22')]=function(_0x1a7006){if(_0x1a7006){if(this[_0xa24c('0x6b')][_0x1a7006[_0xa24c('0x155')]]){this[_0xa24c('0x6b')][_0x1a7006['transfertargetlinkedid']][_0xa24c('0x14a')]=!![];}}};Preview[_0xa24c('0xd')]['syncBlindTransfer']=function(_0x11c6ce){if(_0x11c6ce){if(this[_0xa24c('0x6b')][_0x11c6ce[_0xa24c('0x156')]]){this[_0xa24c('0x6b')][_0x11c6ce[_0xa24c('0x156')]]['transfer']=!![];}}};module[_0xa24c('0x157')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index e1138f3..c22ec17 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 _0x2252=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','UserId','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x351717,_0x14a939){var _0x2734a6=function(_0x2fcf5f){while(--_0x2fcf5f){_0x351717['push'](_0x351717['shift']());}};_0x2734a6(++_0x14a939);}(_0x2252,0x75));var _0x2225=function(_0x13ea46,_0x43fb4b){_0x13ea46=_0x13ea46-0x0;var _0x5a245c=_0x2252[_0x13ea46];return _0x5a245c;};'use strict';var util=require(_0x2225('0x0'));var BPromise=require(_0x2225('0x1'));var logger=require(_0x2225('0x2'))(_0x2225('0x3'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x2225('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x2225('0x5'));var voiceQueueReport=require(_0x2225('0x6'));function loggerCatch(_0x52caf3){return function(_0xbe2a79){logger['error'](_0x52caf3,util[_0x2225('0x7')](_0xbe2a79,{'showHidden':![],'depth':null}));};}function create(_0x48bffa){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopperHistory[_0x2225('0xa')](_0x48bffa))[_0x2225('0xb')](loggerCatch(_0x2225('0xc')));}function createAgent(_0x326144){return BPromise[_0x2225('0x8')]()['then'](agentReportPreview[_0x2225('0xa')](_0x326144))[_0x2225('0xb')](loggerCatch(_0x2225('0xc')));}function moveContact(_0xff96ba){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopper[_0x2225('0xd')](_0xff96ba,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2225('0xe')]=function(_0x5a5608){return BPromise['resolve']()[_0x2225('0x9')](cmHopperBlack['checkIsBlackList'](_0x5a5608))[_0x2225('0xb')](loggerCatch(_0x2225('0xf')));};exports['getContactPreview']=function(_0x4b6867){return BPromise[_0x2225('0x8')]()['then'](cmHopper[_0x2225('0x10')](_0x4b6867))[_0x2225('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x2225('0xa')]=function(_0x4228c6,_0x236ee2){create(_0x4228c6)[_0x2225('0xb')](loggerCatch(_0x236ee2));moveContact(_0x4228c6)['catch'](loggerCatch(_0x236ee2));};exports[_0x2225('0x11')]=function(_0x9ab206,_0xcbec33){createAgent(_0x9ab206)[_0x2225('0xb')](loggerCatch(_0xcbec33));};exports['createCustomerHistory']=function(_0x46c285,_0x4f6d7a){create(_0x46c285)[_0x2225('0xb')](loggerCatch(_0x4f6d7a));};exports['createCustomerFinal']=function(_0x2fc9ad,_0x332efe){moveContact(_0x2fc9ad)[_0x2225('0xb')](loggerCatch(_0x332efe));};exports['rescheduleContact']=function(_0x1e2888,_0x21c3e6,_0x4df90a){if(_0x21c3e6){_0x1e2888[_0x2225('0x12')]=null;}if(_0x4df90a){_0x1e2888[_0x2225('0x13')]=![];}return BPromise['resolve']()[_0x2225('0x9')](cmHopper[_0x2225('0x14')](_0x1e2888))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2225('0x15')]=function(_0xd82175){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopper[_0x2225('0x15')](_0xd82175))[_0x2225('0xb')](loggerCatch('[countReScheduled]\x20'));};exports[_0x2225('0x16')]=function(_0x3327e8){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopper['unlockContact']({'UserId':null},_0x3327e8,0x1))['catch'](loggerCatch(_0x2225('0x17')));};exports[_0x2225('0x18')]=function(_0x50aa52){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopper['unlockContact']({'active':![]},_0x50aa52,0x1))[_0x2225('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0x2225('0x19')]=function(_0x99389c){var _0x13817b={};_0x13817b[_0x2225('0x1a')]=_0x99389c[_0x2225('0x1a')];_0x13817b['uniqueid']=_0x99389c[_0x2225('0x1b')];_0x13817b[_0x2225('0x1c')]=_0x99389c[_0x2225('0x1c')];_0x13817b[_0x2225('0x1d')]=_0x99389c['calleridname'];_0x13817b[_0x2225('0x1e')]=_0x99389c[_0x2225('0x1e')];_0x13817b[_0x2225('0x1f')]=_0x99389c[_0x2225('0x20')];_0x13817b[_0x2225('0x21')]=_0x99389c[_0x2225('0x20')];_0x13817b['queuecallercomplete']=0x1;_0x13817b[_0x2225('0x22')]=_0x99389c[_0x2225('0x23')];_0x13817b[_0x2225('0x24')]=_0x99389c[_0x2225('0x25')];_0x13817b[_0x2225('0x26')]='from-sip';_0x13817b[_0x2225('0x27')]=_0x2225('0x28');_0x13817b[_0x2225('0x29')]=0x0;_0x13817b['assigned']=0x1;_0x13817b[_0x2225('0x2a')]=_0x99389c[_0x2225('0x25')];_0x13817b['queuecallerexitreason']=_0x2225('0x2b');return BPromise[_0x2225('0x8')]()['then'](voiceQueueReport[_0x2225('0x2c')](_0x13817b))['catch'](loggerCatch(_0x2225('0x2d')));};exports[_0x2225('0x2e')]=function(_0x15112b,_0x6cbe5b){return BPromise['resolve']()[_0x2225('0x9')](cmHopper[_0x2225('0x2e')](_0x15112b,_0x6cbe5b))[_0x2225('0xb')](loggerCatch(_0x2225('0x2f')));};exports['rescheduleContactInQueue']=function(_0xfdf316){return BPromise[_0x2225('0x8')]()[_0x2225('0x9')](cmHopper[_0x2225('0x14')](_0xfdf316,!![],!![]))[_0x2225('0xb')](loggerCatch(_0x2225('0x30')));}; \ No newline at end of file +var _0x58cd=['createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20'];(function(_0x3a3f6d,_0x579219){var _0x396dc8=function(_0x351e53){while(--_0x351e53){_0x3a3f6d['push'](_0x3a3f6d['shift']());}};_0x396dc8(++_0x579219);}(_0x58cd,0x13a));var _0xd58c=function(_0x5e70d7,_0x440570){_0x5e70d7=_0x5e70d7-0x0;var _0xf2a6df=_0x58cd[_0x5e70d7];return _0xf2a6df;};'use strict';var util=require(_0xd58c('0x0'));var BPromise=require(_0xd58c('0x1'));var logger=require(_0xd58c('0x2'))(_0xd58c('0x3'));var _=require('lodash');var cmHopper=require(_0xd58c('0x4'));var cmHopperFinal=require(_0xd58c('0x5'));var cmHopperHistory=require(_0xd58c('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xd58c('0x7'));var agentReportPreview=require(_0xd58c('0x8'));var voiceQueueReport=require(_0xd58c('0x9'));function loggerCatch(_0x1efae7){return function(_0x1dbb2c){logger[_0xd58c('0xa')](_0x1efae7,util[_0xd58c('0xb')](_0x1dbb2c,{'showHidden':![],'depth':null}));};}function create(_0x134330){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopperHistory['createHistory'](_0x134330))[_0xd58c('0xe')](loggerCatch(_0xd58c('0xf')));}function createAgent(_0xeb8538){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](agentReportPreview[_0xd58c('0x10')](_0xeb8538))['catch'](loggerCatch(_0xd58c('0xf')));}function moveContact(_0x16e0d9){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopper[_0xd58c('0x11')](_0x16e0d9,!![]))[_0xd58c('0xe')](loggerCatch(_0xd58c('0x12')));}exports[_0xd58c('0x13')]=function(_0x48c6c6){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopperBlack[_0xd58c('0x13')](_0x48c6c6))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xd58c('0x14')]=function(_0x1a4c42){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopper[_0xd58c('0x14')](_0x1a4c42))[_0xd58c('0xe')](loggerCatch(_0xd58c('0x15')));};exports[_0xd58c('0x10')]=function(_0x4c8233,_0x3c643d){create(_0x4c8233)[_0xd58c('0xe')](loggerCatch(_0x3c643d));moveContact(_0x4c8233)[_0xd58c('0xe')](loggerCatch(_0x3c643d));};exports['createAgentHistory']=function(_0x5f0402,_0x8207c3){createAgent(_0x5f0402)[_0xd58c('0xe')](loggerCatch(_0x8207c3));};exports[_0xd58c('0x16')]=function(_0x5a67cd,_0x221652){create(_0x5a67cd)[_0xd58c('0xe')](loggerCatch(_0x221652));};exports[_0xd58c('0x17')]=function(_0x23930a,_0x266d59){moveContact(_0x23930a)['catch'](loggerCatch(_0x266d59));};exports[_0xd58c('0x18')]=function(_0x14927e,_0x1dce70,_0x24be50){if(_0x1dce70){_0x14927e[_0xd58c('0x19')]=null;}if(_0x24be50){_0x14927e[_0xd58c('0x1a')]=![];}return BPromise['resolve']()[_0xd58c('0xd')](cmHopper[_0xd58c('0x18')](_0x14927e))[_0xd58c('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xd58c('0x1b')]=function(_0x4ccdf0){return BPromise['resolve']()[_0xd58c('0xd')](cmHopper[_0xd58c('0x1b')](_0x4ccdf0))['catch'](loggerCatch(_0xd58c('0x1c')));};exports[_0xd58c('0x1d')]=function(_0x311df8){return BPromise['resolve']()[_0xd58c('0xd')](cmHopper[_0xd58c('0x1d')]({'UserId':null},_0x311df8,0x1))[_0xd58c('0xe')](loggerCatch(_0xd58c('0x1e')));};exports[_0xd58c('0x1f')]=function(_0x4a64e2){return BPromise['resolve']()[_0xd58c('0xd')](cmHopper[_0xd58c('0x1d')]({'active':![]},_0x4a64e2,0x1))[_0xd58c('0xe')](loggerCatch(_0xd58c('0x20')));};exports[_0xd58c('0x21')]=function(_0x59238c){var _0x32a8e6={};_0x32a8e6[_0xd58c('0x22')]=_0x59238c[_0xd58c('0x22')];_0x32a8e6[_0xd58c('0x23')]=_0x59238c['uniqueid'];_0x32a8e6[_0xd58c('0x24')]=_0x59238c['calleridnum'];_0x32a8e6['calleridname']=_0x59238c[_0xd58c('0x25')];_0x32a8e6['queue']=_0x59238c['queue'];_0x32a8e6[_0xd58c('0x26')]=_0x59238c[_0xd58c('0x27')];_0x32a8e6['queuecallerleaveAt']=_0x59238c[_0xd58c('0x27')];_0x32a8e6[_0xd58c('0x28')]=0x1;_0x32a8e6[_0xd58c('0x29')]=_0x59238c[_0xd58c('0x2a')];_0x32a8e6[_0xd58c('0x2b')]=_0x59238c[_0xd58c('0x2c')];_0x32a8e6[_0xd58c('0x2d')]='from-sip';_0x32a8e6['exten']=_0xd58c('0x2e');_0x32a8e6[_0xd58c('0x2f')]=0x0;_0x32a8e6[_0xd58c('0x30')]=0x1;_0x32a8e6['lastAssignedTo']=_0x59238c['membername'];_0x32a8e6[_0xd58c('0x31')]=_0xd58c('0x32');return BPromise['resolve']()[_0xd58c('0xd')](voiceQueueReport[_0xd58c('0x33')](_0x32a8e6))['catch'](loggerCatch(_0xd58c('0x34')));};exports['getContactRecallMe']=function(_0x376e62,_0x5e3c2a){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopper[_0xd58c('0x35')](_0x376e62,_0x5e3c2a))[_0xd58c('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xd58c('0x36')]=function(_0x27e239){return BPromise[_0xd58c('0xc')]()[_0xd58c('0xd')](cmHopper['rescheduleContact'](_0x27e239,!![],!![]))[_0xd58c('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 3a9dd30..8691c6d 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 _0x83e9=['env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','dialOriginateTimeout','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','Contact','tags','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','CampaignId','idContact','type','dialAnswer','active','scheduledat','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x83e9,0x1ab));var _0x983e=function(_0x69473,_0x1cbe33){_0x69473=_0x69473-0x0;var _0x50bff3=_0x83e9[_0x69473];return _0x50bff3;};'use strict';var util=require(_0x983e('0x0'));var _=require(_0x983e('0x1'));var moment=require(_0x983e('0x2'));var logger=require(_0x983e('0x3'))(_0x983e('0x4'));var ipAgi=process[_0x983e('0x5')][_0x983e('0x6')]||_0x983e('0x7');function getSeconds(_0x4dc965,_0x42c4d6){var _0x3151c2=moment(_0x4dc965)[_0x983e('0x8')](0x0);var _0x18e430=moment(_0x42c4d6)[_0x983e('0x8')](0x0);return _0x3151c2[_0x983e('0x9')](_0x18e430,_0x983e('0xa'));}exports[_0x983e('0xb')]=function(_0x216c73){return function(_0x47c806){logger[_0x983e('0xc')](_0x216c73,util['inspect'](_0x47c806,{'showHidden':![],'depth':null}));};};exports[_0x983e('0xd')]=function(_0x28c73c,_0x1fcb1e){logger[_0x983e('0xe')](_0x28c73c,util[_0x983e('0xf')](_0x1fcb1e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3acfd9,_0x577e01){logger['error'](_0x3acfd9,util[_0x983e('0xf')](_0x577e01,{'showHidden':![],'depth':null}));};exports[_0x983e('0x10')]=function(_0x3f4628){return function(_0x1e298b){logger['info'](_0x3f4628,util[_0x983e('0xf')](_0x1e298b,{'showHidden':![],'depth':null}));};};exports[_0x983e('0x11')]=function(_0x353be2,_0x306148,_0x275961){return{'message':_0x353be2,'unlock':_0x306148,'active':_0x275961};};exports[_0x983e('0x12')]=function(_0x5491ca,_0x4edfe0,_0x4b0a73){if(!_[_0x983e('0x13')](_0x4b0a73)&&_0x983e('0x14')===typeof _0x4b0a73&&!_[_0x983e('0x15')](_0x4b0a73)){if(!_[_0x983e('0x13')](_0x4edfe0)&&_0x983e('0x14')===typeof _0x4edfe0&&!_[_0x983e('0x15')](_0x4edfe0)){return util[_0x983e('0x16')](_0x983e('0x17'),_0x4edfe0,_0x4b0a73);}return util[_0x983e('0x16')](_0x983e('0x17'),_0x4b0a73,_0x4b0a73);}if(!_[_0x983e('0x13')](_0x5491ca)&&'string'===typeof _0x5491ca&&!_[_0x983e('0x15')](_0x5491ca)){return _0x5491ca;}return'\x22\x22\x20<>';};exports[_0x983e('0x18')]=function(_0x1f1dd8){if(_[_0x983e('0x19')](_0x1f1dd8)){return![];}return _0x1f1dd8;};exports[_0x983e('0x1a')]=function(_0x5c5613,_0x4ee683,_0x1b4985,_0x1268de,_0x537a50,_0x567cb1){var _0x1e531c={'XMD-QUEUE':_0x4ee683[_0x983e('0x1b')]?_0x4ee683['Queue'][_0x983e('0x1c')]:'','XMD-CALLERID':_0x1268de,'XMD-CALLERID-PREVIEW':_0x567cb1?util[_0x983e('0x16')](_0x983e('0x17'),_0x567cb1[_0x983e('0x1d')],_0x567cb1[_0x983e('0x1e')]):_0x1268de,'XMD-DIALID':_0x537a50,'XMD-CONTACTID':_0x4ee683['ContactId'],'XMD-CDRTYPE':_0x983e('0x1f'),'CALLERID(all)':_0x1268de,'XMD-VOICEQUEUEID':_0x4ee683['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1b4985,'XMD-DIALTIMEOUT':_0x5c5613[_0x983e('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x983e('0x16')]('\x22rtTxX%s%s\x22',_0x5c5613[_0x983e('0x21')]?'g':'',_[_0x983e('0x15')](_0x5c5613[_0x983e('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5c5613['dialPreviewUrl']||'','XMD-AGI':_0x5c5613[_0x983e('0x23')]?util[_0x983e('0x16')](_0x983e('0x24'),ipAgi,_0x5c5613['dialQueueProject']):_0x983e('0x25'),'XMD-AGIAFTER':_0x5c5613[_0x983e('0x21')]?util['format'](_0x983e('0x24'),ipAgi,_0x5c5613[_0x983e('0x21')]):_0x983e('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x567cb1?_0x567cb1['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x567cb1?_0x567cb1[_0x983e('0x26')]:'','XMD-DESTINATION':_0x983e('0x27'),'SIPADDHEADER':_0x983e('0x28')};if(!_[_0x983e('0x15')](_0x5c5613['monitor_format'])){_0x1e531c[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5c5613[_0x983e('0x22')];_0x1e531c[util[_0x983e('0x16')]('%s',_0x983e('0x29'))]=_0x537a50;}if(_0x4ee683&&_0x4ee683['Contact']){for(var _0x14405b in _0x4ee683['Contact']){if(_0x4ee683['Contact'][_0x983e('0x2a')](_0x14405b)){if(!_[_0x983e('0x19')](_0x4ee683[_0x983e('0x2b')][_0x14405b])&&_0x14405b!=='id'&&_0x14405b!==_0x983e('0x2c')&&_0x14405b!=='createdAt'&&_0x14405b!==_0x983e('0x2d')){_0x1e531c[util[_0x983e('0x16')](_0x983e('0x2e'),_0x983e('0x2f'),_[_0x983e('0x30')](_0x14405b))]=_0x4ee683[_0x983e('0x2b')][_0x14405b];}}}}return _0x1e531c;};exports['toLowerVariables']=function(_0x3f3844){var _0x39570c={};for(var _0x282085 in _0x3f3844){if(_0x3f3844[_0x983e('0x2a')](_0x282085)){_0x39570c[util[_0x983e('0x16')]('%s',_['toLower'](_0x282085))]=_0x3f3844[_0x282085];}}return{'variables':_0x39570c};};exports[_0x983e('0x31')]=function(_0xadde6b,_0x307580){if(!_['isNil'](_0xadde6b)){if(_0xadde6b['hasOwnProperty'](_0x983e('0x32'))){if(_0xadde6b[_0x983e('0x32')]>0x0){_0xadde6b[_0x983e('0x32')]-=0x1;}else{logger[_0x983e('0xc')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x307580);}}}else{logger[_0x983e('0xc')](_0x983e('0x33'),_0x307580);}};exports[_0x983e('0x34')]=function(_0x5ac33f){var _0xe485bb=moment()[_0x983e('0x16')](_0x983e('0x35'));_0x5ac33f[_0x983e('0x36')]=0xd;_0x5ac33f['statedesc']=_0x983e('0x37');_0x5ac33f[_0x983e('0x38')]=_0xe485bb;_0x5ac33f[_0x983e('0x39')]=_0xe485bb;_0x5ac33f[_0x983e('0x3a')]=_0xe485bb;};exports['logAgent']=function(_0x5af4d0,_0x10c9c7,_0x20d3b1){var _0x23600b=moment()[_0x983e('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x5af4d0[_0x983e('0x36')]=_0x10c9c7;_0x5af4d0[_0x983e('0x3b')]=_0x20d3b1;_0x5af4d0[_0x983e('0x39')]=_0x23600b;_0x5af4d0[_0x983e('0x3c')]=getSeconds(_0x5af4d0['responsetime'],_0x5af4d0['starttime']);};exports[_0x983e('0x3d')]=function(_0xebf483,_0x385301,_0x43943f){_0xebf483['membername']=_0x385301;_0xebf483[_0x983e('0x3e')]=_0x43943f;};exports[_0x983e('0x3f')]=function(_0x349ba1,_0x212f6a,_0x372402){var _0x5652bb=moment()['format'](_0x983e('0x35'));_0x349ba1['state']=_0x212f6a;_0x349ba1[_0x983e('0x3b')]=_0x372402;_0x349ba1['responsetime']=_0x349ba1[_0x983e('0x39')]?_0x349ba1['responsetime']:_0x5652bb;_0x349ba1[_0x983e('0x3a')]=_0x349ba1[_0x983e('0x3a')]?_0x349ba1[_0x983e('0x3a')]:_0x5652bb;_0x349ba1[_0x983e('0x3c')]=getSeconds(_0x349ba1[_0x983e('0x39')]||0x0,_0x349ba1[_0x983e('0x38')]||0x0);_0x349ba1[_0x983e('0x40')]=_0x349ba1[_0x983e('0x41')]?getSeconds(_0x349ba1['endtime'],_0x349ba1['answertime']):0x0;};exports['isFailure']=function(_0x1b23c7){return _0x1b23c7===_0x983e('0x42');};exports[_0x983e('0x43')]=function(_0x2c2a7,_0xa4fa54,_0x50a109,_0x2de88c,_0x260818){var _0x202b37=_0x2de88c?_0x983e('0x44'):_0x2c2a7[_0x983e('0x1d')];_0x202b37=_0x260818?_0x983e('0x45'):_0x202b37;return{'actionid':_0x2c2a7[_0x983e('0x46')],'action':_0x983e('0x47'),'channel':_0x2c2a7[_0x983e('0x48')],'callerid':util['format'](_0x983e('0x17'),_0x202b37,_0x2c2a7[_0x983e('0x1e')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x50a109,'timeout':(_0xa4fa54[_0x983e('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c2a7[_0x983e('0x46')]};};exports['totalGlobal']=function(_0x17ccf8){return _0x17ccf8['countbusyretry']+_0x17ccf8[_0x983e('0x4a')]+_0x17ccf8[_0x983e('0x4b')]+_0x17ccf8[_0x983e('0x4c')]+_0x17ccf8[_0x983e('0x4d')];};exports['cloneAction']=function(_0xb68874){var _0x401238=_[_0x983e('0x4e')](_0xb68874);_0x401238[_0x983e('0x36')]=0xf;_0x401238[_0x983e('0x3b')]=_0x983e('0x4f');return _0x401238;};exports[_0x983e('0x50')]=function(_0x2e29e9,_0x32371b,_0x55db97){var _0x232fb0={};_0x232fb0[_0x32371b]=_0x2e29e9[_0x32371b];_0x232fb0['active']=![];_0x232fb0['scheduledat']=moment()[_0x983e('0x51')](_0x55db97,_0x983e('0x52'))[_0x983e('0x16')](_0x983e('0x35'));_0x232fb0[_0x983e('0x53')]=_0x2e29e9[_0x983e('0x53')];_0x232fb0[_0x983e('0x54')]=_0x2e29e9[_0x983e('0x54')];_0x232fb0[_0x983e('0x55')]=_0x2e29e9['VoiceQueueId']||undefined;return _0x232fb0;};exports[_0x983e('0x56')]=function(_0x3c568c,_0x2fb835){if(!_[_0x983e('0x19')](_0x3c568c)){if(_0x3c568c[_0x983e('0x57')]>0x0){_0x3c568c[_0x983e('0x57')]-=0x1;}else{logger[_0x983e('0xc')](_0x2fb835,_0x983e('0x58'));}}else{logger[_0x983e('0xc')](_0x2fb835,_0x983e('0x59'));}};exports[_0x983e('0x5a')]=function(_0x4a0171){if(_0x4a0171<=0x0){return!![];}return![];};exports[_0x983e('0x5b')]=function(_0x3cc155,_0x3f039d,_0x3ede23){_0x3cc155[_0x983e('0x5c')]=_0x3f039d;_0x3cc155[_0x983e('0x1c')]=_0x3cc155['queue'];_0x3cc155[_0x983e('0x5d')]=_0x3cc155[_0x983e('0x48')];_0x3cc155['motionChannel']=_0x983e('0x5e');if(_0x3ede23){_0x3cc155['mandatoryDisposition']=_0x3ede23[_0x983e('0x5f')];}return _0x3cc155;};exports[_0x983e('0x60')]=function(_0x1298ba){var _0x4dea9d={};_0x4dea9d[_0x983e('0x61')]=_0x1298ba[_0x983e('0x61')];_0x4dea9d[_0x983e('0x5d')]=_0x1298ba[_0x983e('0x48')];_0x4dea9d[_0x983e('0x46')]=_0x1298ba[_0x983e('0x46')];return _0x4dea9d;};exports[_0x983e('0x62')]=function(_0x3d421e){var _0x20b5c6=[];for(var _0x5f3b04 in _0x3d421e){if(_0x3d421e['hasOwnProperty'](_0x5f3b04)){if(!_[_0x983e('0x19')](_0x3d421e[_0x5f3b04])&&_0x3d421e[_0x5f3b04][_0x983e('0x36')]===_0x983e('0x63')&&_0x3d421e[_0x5f3b04][_0x983e('0x64')]===_0x983e('0x65')){_0x20b5c6[_0x983e('0x66')](_0x3d421e[_0x5f3b04]['id']);}}}return _0x20b5c6;};exports[_0x983e('0x67')]=function(_0x8e751d){var _0x49e2bc=moment()[_0x983e('0x8')](0x0);var _0x46d43b=moment(_0x8e751d)[_0x983e('0x8')](0x0);return _0x49e2bc['diff'](_0x46d43b,_0x983e('0xa'));};exports['createBody']=function(_0x90ab88){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x90ab88[_0x983e('0x53')],'ListId':_0x90ab88[_0x983e('0x54')],'VoiceQueueId':_0x90ab88[_0x983e('0x55')]||undefined,'CampaignId':_0x90ab88[_0x983e('0x68')]||undefined};};exports['filterKey']=function(_0x2e2468){if(_0x2e2468==='uniqueid'||_0x2e2468===_0x983e('0x69')||_0x2e2468==='queue'||_0x2e2468===_0x983e('0x6a')||_0x2e2468==='campaigntype'||_0x2e2468===_0x983e('0x6b')||_0x2e2468==='membername'||_0x2e2468===_0x983e('0x48')||_0x2e2468===_0x983e('0x1d')||_0x2e2468===_0x983e('0x6c')||_0x2e2468===_0x983e('0x1e')||_0x2e2468===_0x983e('0x6d')||_0x2e2468==='countbusyretry'||_0x2e2468===_0x983e('0x4a')||_0x2e2468===_0x983e('0x4b')||_0x2e2468===_0x983e('0x6e')||_0x2e2468===_0x983e('0x6f')||_0x2e2468===_0x983e('0x70')||_0x2e2468==='callbackat'||_0x2e2468===_0x983e('0x71')||_0x2e2468===_0x983e('0x53')||_0x2e2468===_0x983e('0x54')||_0x2e2468===_0x983e('0x3e')||_0x2e2468===_0x983e('0x55')||_0x2e2468===_0x983e('0x72')||_0x2e2468===_0x983e('0x73')||_0x2e2468===_0x983e('0x74')||_0x2e2468===_0x983e('0x75')||_0x2e2468===_0x983e('0x76')||_0x2e2468===_0x983e('0x77')||_0x2e2468===_0x983e('0x78')||_0x2e2468===_0x983e('0x79')||_0x2e2468===_0x983e('0x7a')||_0x2e2468===_0x983e('0x7b')||_0x2e2468==='xmd-contactid'||_0x2e2468===_0x983e('0x7c')||_0x2e2468===_0x983e('0x7d')||_0x2e2468===_0x983e('0x7e')||_0x2e2468===_0x983e('0x7f')||_0x2e2468===_0x983e('0x80')||_0x2e2468===_0x983e('0x81')||_0x2e2468==='rtpaudioqosjitter'||_0x2e2468==='rtpaudioqosjitterbridged'||_0x2e2468===_0x983e('0x82')||_0x2e2468===_0x983e('0x83')||_0x2e2468===_0x983e('0x84')||_0x2e2468===_0x983e('0x85')||_0x2e2468===_0x983e('0x80')||_0x2e2468==='rtpaudioqosbridged'||_0x2e2468==='rtpaudioqosjitter'||_0x2e2468===_0x983e('0x86')||_0x2e2468===_0x983e('0x82')||_0x2e2468==='rtpaudioqoslossbridged'||_0x2e2468==='rtpaudioqosrtt'||_0x2e2468===_0x983e('0x85')||_0x2e2468===_0x983e('0x87')||_0x2e2468==='bridgepvtcallid'||_0x2e2468===_0x983e('0x36')||_0x2e2468===_0x983e('0x3b')){return![];}return!![];};exports[_0x983e('0x88')]=function(_0x273589,_0x1f9e5f){var _0x940a81,_0x236791,_0x4837ae;if(_0x1f9e5f<=0x0){_0x1f9e5f=0x1;}_0x940a81=new RegExp(_0x983e('0x89')+_0x1f9e5f+'}$');_0x236791=Math[_0x983e('0x8a')](0xa,_0x1f9e5f-0x1);_0x4837ae=Math[_0x983e('0x8a')](0xa,_0x1f9e5f)-0x1;return util[_0x983e('0x16')]('%s',_[_0x983e('0x8b')](_0x273589,_0x940a81,_[_0x983e('0x8c')](_0x236791,_0x4837ae)));};exports[_0x983e('0x8d')]=function(_0x37c6d2){var _0x4bd35c=_0x37c6d2[_0x983e('0x8e')](/"(.*?)"/);return _0x4bd35c?_0x4bd35c[0x1]:_0x37c6d2;};exports[_0x983e('0x8f')]=function(_0x15022a){var _0x5dccb2=_0x15022a[_0x983e('0x8e')](/<(.*?)>/);return _0x5dccb2?_0x5dccb2[0x1]:_0x15022a;}; \ No newline at end of file +var _0x98f6=['extractCalleridNumber','util','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','logger','info','inspect','loggerError','logger2','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','updatedAt','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','channelAgent','from-sip','uniqueid','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','name','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','reachable','push','seconds','createBody','CampaignId','filterKey','idContact','type','membername','calleridnum','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0x98f6,0x1b1));var _0x698f=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x98f6[_0x20a558];return _0x53d3f7;};'use strict';var util=require(_0x698f('0x0'));var _=require(_0x698f('0x1'));var moment=require(_0x698f('0x2'));var logger=require(_0x698f('0x3'))('preview');var ipAgi=process['env'][_0x698f('0x4')]||_0x698f('0x5');function getSeconds(_0xfcaf8f,_0x3eae9b){var _0x2e0e0c=moment(_0xfcaf8f)[_0x698f('0x6')](0x0);var _0x4e62d6=moment(_0x3eae9b)[_0x698f('0x6')](0x0);return _0x2e0e0c[_0x698f('0x7')](_0x4e62d6,'seconds');}exports[_0x698f('0x8')]=function(_0x277663){return function(_0x286155){logger[_0x698f('0x9')](_0x277663,util['inspect'](_0x286155,{'showHidden':![],'depth':null}));};};exports[_0x698f('0xa')]=function(_0x3b8a43,_0x37e76b){logger[_0x698f('0xb')](_0x3b8a43,util[_0x698f('0xc')](_0x37e76b,{'showHidden':![],'depth':null}));};exports[_0x698f('0xd')]=function(_0x4b7476,_0x18ab3f){logger['error'](_0x4b7476,util[_0x698f('0xc')](_0x18ab3f,{'showHidden':![],'depth':null}));};exports[_0x698f('0xe')]=function(_0x589dbc){return function(_0x42af46){logger[_0x698f('0xb')](_0x589dbc,util[_0x698f('0xc')](_0x42af46,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x36905c,_0x4b89c7,_0x301f82){return{'message':_0x36905c,'unlock':_0x4b89c7,'active':_0x301f82};};exports[_0x698f('0xf')]=function(_0x24d9bb,_0x59d81f,_0x205b25){if(!_['isUndefined'](_0x205b25)&&'string'===typeof _0x205b25&&!_[_0x698f('0x10')](_0x205b25)){if(!_[_0x698f('0x11')](_0x59d81f)&&_0x698f('0x12')===typeof _0x59d81f&&!_[_0x698f('0x10')](_0x59d81f)){return util[_0x698f('0x13')](_0x698f('0x14'),_0x59d81f,_0x205b25);}return util[_0x698f('0x13')](_0x698f('0x14'),_0x205b25,_0x205b25);}if(!_['isUndefined'](_0x24d9bb)&&_0x698f('0x12')===typeof _0x24d9bb&&!_['isEmpty'](_0x24d9bb)){return _0x24d9bb;}return'\x22\x22\x20<>';};exports[_0x698f('0x15')]=function(_0x3f4ce6){if(_['isNil'](_0x3f4ce6)){return![];}return _0x3f4ce6;};exports[_0x698f('0x16')]=function(_0x50d775,_0x183c1a,_0x175c49,_0x56c3d0,_0xf19d99,_0xd8ade8){var _0x32b00a={'XMD-QUEUE':_0x183c1a[_0x698f('0x17')]?_0x183c1a[_0x698f('0x17')]['name']:'','XMD-CALLERID':_0x56c3d0,'XMD-CALLERID-PREVIEW':_0xd8ade8?util[_0x698f('0x13')](_0x698f('0x14'),_0xd8ade8['calleridname'],_0xd8ade8['calleridnum']):_0x56c3d0,'XMD-DIALID':_0xf19d99,'XMD-CONTACTID':_0x183c1a[_0x698f('0x18')],'XMD-CDRTYPE':_0x698f('0x19'),'CALLERID(all)':_0x56c3d0,'XMD-VOICEQUEUEID':_0x183c1a[_0x698f('0x1a')],'XMD-DIALCHANNEL':_0x175c49,'XMD-DIALTIMEOUT':_0x50d775['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x698f('0x13')](_0x698f('0x1b'),_0x50d775['dialQueueProject2']?'g':'',_[_0x698f('0x10')](_0x50d775[_0x698f('0x1c')])?'':_0x698f('0x1d')),'XMD-DIALURL':_0x50d775[_0x698f('0x1e')]||'','XMD-AGI':_0x50d775[_0x698f('0x1f')]?util['format'](_0x698f('0x20'),ipAgi,_0x50d775['dialQueueProject']):_0x698f('0x21'),'XMD-AGIAFTER':_0x50d775[_0x698f('0x22')]?util[_0x698f('0x13')](_0x698f('0x20'),ipAgi,_0x50d775[_0x698f('0x22')]):_0x698f('0x21'),'XMD-ORIGINATECALLERIDNUM':_0xd8ade8?_0xd8ade8[_0x698f('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0xd8ade8?_0xd8ade8[_0x698f('0x24')]:'','XMD-DESTINATION':_0x698f('0x25'),'SIPADDHEADER':_0x698f('0x26')};if(!_['isEmpty'](_0x50d775[_0x698f('0x1c')])){_0x32b00a[util['format']('%s',_0x698f('0x27'))]=_0x50d775['monitor_format'];_0x32b00a[util[_0x698f('0x13')]('%s',_0x698f('0x28'))]=_0xf19d99;}if(_0x183c1a&&_0x183c1a['Contact']){for(var _0xefecf9 in _0x183c1a[_0x698f('0x29')]){if(_0x183c1a[_0x698f('0x29')][_0x698f('0x2a')](_0xefecf9)){if(!_[_0x698f('0x2b')](_0x183c1a['Contact'][_0xefecf9])&&_0xefecf9!=='id'&&_0xefecf9!==_0x698f('0x2c')&&_0xefecf9!=='createdAt'&&_0xefecf9!==_0x698f('0x2d')){_0x32b00a[util[_0x698f('0x13')]('%s%s',_0x698f('0x2e'),_[_0x698f('0x2f')](_0xefecf9))]=_0x183c1a[_0x698f('0x29')][_0xefecf9];}}}}return _0x32b00a;};exports['toLowerVariables']=function(_0x30f410){var _0x44521e={};for(var _0x3e90c4 in _0x30f410){if(_0x30f410[_0x698f('0x2a')](_0x3e90c4)){_0x44521e[util[_0x698f('0x13')]('%s',_[_0x698f('0x30')](_0x3e90c4))]=_0x30f410[_0x3e90c4];}}return{'variables':_0x44521e};};exports['updateOriginated']=function(_0x481f3d,_0x5d1cf9){if(!_[_0x698f('0x2b')](_0x481f3d)){if(_0x481f3d[_0x698f('0x2a')]('originated')){if(_0x481f3d[_0x698f('0x31')]>0x0){_0x481f3d['originated']-=0x1;}else{logger[_0x698f('0x9')](_0x698f('0x32'),_0x5d1cf9);}}}else{logger['error'](_0x698f('0x33'),_0x5d1cf9);}};exports[_0x698f('0x34')]=function(_0x5b1078){var _0x4043d2=moment()[_0x698f('0x13')](_0x698f('0x35'));_0x5b1078[_0x698f('0x36')]=0xd;_0x5b1078['statedesc']=_0x698f('0x37');_0x5b1078[_0x698f('0x38')]=_0x4043d2;_0x5b1078[_0x698f('0x39')]=_0x4043d2;_0x5b1078[_0x698f('0x3a')]=_0x4043d2;};exports[_0x698f('0x3b')]=function(_0x4be07b,_0x47b3af,_0x4be508){var _0x5b62af=moment()['format'](_0x698f('0x35'));_0x4be07b[_0x698f('0x36')]=_0x47b3af;_0x4be07b[_0x698f('0x3c')]=_0x4be508;_0x4be07b['responsetime']=_0x5b62af;_0x4be07b[_0x698f('0x3d')]=getSeconds(_0x4be07b[_0x698f('0x39')],_0x4be07b['starttime']);};exports[_0x698f('0x3e')]=function(_0x4d45ab,_0x68439b,_0x5ce627){_0x4d45ab['membername']=_0x68439b;_0x4d45ab[_0x698f('0x3f')]=_0x5ce627;};exports['logCustomer']=function(_0x1325d2,_0x171562,_0x1e8536){var _0x1112c8=moment()[_0x698f('0x13')](_0x698f('0x35'));_0x1325d2[_0x698f('0x36')]=_0x171562;_0x1325d2[_0x698f('0x3c')]=_0x1e8536;_0x1325d2[_0x698f('0x39')]=_0x1325d2[_0x698f('0x39')]?_0x1325d2[_0x698f('0x39')]:_0x1112c8;_0x1325d2[_0x698f('0x3a')]=_0x1325d2['endtime']?_0x1325d2[_0x698f('0x3a')]:_0x1112c8;_0x1325d2[_0x698f('0x3d')]=getSeconds(_0x1325d2['responsetime']||0x0,_0x1325d2[_0x698f('0x38')]||0x0);_0x1325d2[_0x698f('0x40')]=_0x1325d2[_0x698f('0x41')]?getSeconds(_0x1325d2[_0x698f('0x3a')],_0x1325d2['answertime']):0x0;};exports[_0x698f('0x42')]=function(_0x4e89e4){return _0x4e89e4===_0x698f('0x43');};exports[_0x698f('0x44')]=function(_0x419023,_0x13d8c8,_0x11f558,_0x5ee639,_0x555a83){var _0x4a6d5a=_0x5ee639?_0x698f('0x45'):_0x419023[_0x698f('0x46')];_0x4a6d5a=_0x555a83?_0x698f('0x47'):_0x4a6d5a;return{'actionid':_0x419023['uniqueid'],'action':'originate','channel':_0x419023[_0x698f('0x48')],'callerid':util[_0x698f('0x13')](_0x698f('0x14'),_0x4a6d5a,_0x419023['calleridnum']),'Exten':_0x698f('0x25'),'Context':_0x698f('0x49'),'Priority':'1','variable':_0x11f558,'timeout':(_0x13d8c8['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x419023[_0x698f('0x4a')]};};exports['totalGlobal']=function(_0x5b12db){return _0x5b12db[_0x698f('0x4b')]+_0x5b12db[_0x698f('0x4c')]+_0x5b12db['countnoanswerretry']+_0x5b12db[_0x698f('0x4d')]+_0x5b12db[_0x698f('0x4e')];};exports[_0x698f('0x4f')]=function(_0x148b82){var _0x1e0026=_[_0x698f('0x50')](_0x148b82);_0x1e0026[_0x698f('0x36')]=0xf;_0x1e0026[_0x698f('0x3c')]=_0x698f('0x51');return _0x1e0026;};exports['scheduledAt']=function(_0x5cf6cf,_0x25e66d,_0x27621f){var _0x2c1068={};_0x2c1068[_0x25e66d]=_0x5cf6cf[_0x25e66d];_0x2c1068[_0x698f('0x52')]=![];_0x2c1068['scheduledat']=moment()['add'](_0x27621f,_0x698f('0x53'))[_0x698f('0x13')](_0x698f('0x35'));_0x2c1068[_0x698f('0x18')]=_0x5cf6cf['ContactId'];_0x2c1068[_0x698f('0x54')]=_0x5cf6cf[_0x698f('0x54')];_0x2c1068[_0x698f('0x1a')]=_0x5cf6cf[_0x698f('0x1a')]||undefined;return _0x2c1068;};exports[_0x698f('0x55')]=function(_0x1b4153,_0x8223cb){if(!_[_0x698f('0x2b')](_0x1b4153)){if(_0x1b4153[_0x698f('0x56')]>0x0){_0x1b4153[_0x698f('0x56')]-=0x1;}else{logger[_0x698f('0x9')](_0x8223cb,_0x698f('0x57'));}}else{logger[_0x698f('0x9')](_0x8223cb,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x698f('0x58')]=function(_0x509a25){if(_0x509a25<=0x0){return!![];}return![];};exports[_0x698f('0x59')]=function(_0x4d7638,_0x4bfcb3,_0x433c16){_0x4d7638[_0x698f('0x5a')]=_0x4bfcb3;_0x4d7638[_0x698f('0x5b')]=_0x4d7638[_0x698f('0x5c')];_0x4d7638['interface']=_0x4d7638[_0x698f('0x48')];_0x4d7638[_0x698f('0x5d')]=_0x698f('0x5e');if(_0x433c16){_0x4d7638['mandatoryDisposition']=_0x433c16[_0x698f('0x5f')];}return _0x4d7638;};exports[_0x698f('0x60')]=function(_0x44f143){var _0x5872d9={};_0x5872d9[_0x698f('0x5c')]=_0x44f143[_0x698f('0x5c')];_0x5872d9[_0x698f('0x61')]=_0x44f143[_0x698f('0x48')];_0x5872d9[_0x698f('0x4a')]=_0x44f143[_0x698f('0x4a')];return _0x5872d9;};exports[_0x698f('0x62')]=function(_0x3ac75e){var _0xfd643f=[];for(var _0x251586 in _0x3ac75e){if(_0x3ac75e['hasOwnProperty'](_0x251586)){if(!_[_0x698f('0x2b')](_0x3ac75e[_0x251586])&&_0x3ac75e[_0x251586]['state']===_0x698f('0x63')&&_0x3ac75e[_0x251586]['status']===_0x698f('0x64')){_0xfd643f[_0x698f('0x65')](_0x3ac75e[_0x251586]['id']);}}}return _0xfd643f;};exports['getDiff']=function(_0x348050){var _0xe3a2dc=moment()[_0x698f('0x6')](0x0);var _0x1d1379=moment(_0x348050)[_0x698f('0x6')](0x0);return _0xe3a2dc[_0x698f('0x7')](_0x1d1379,_0x698f('0x66'));};exports[_0x698f('0x67')]=function(_0x3d9c8b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d9c8b[_0x698f('0x18')],'ListId':_0x3d9c8b[_0x698f('0x54')],'VoiceQueueId':_0x3d9c8b[_0x698f('0x1a')]||undefined,'CampaignId':_0x3d9c8b[_0x698f('0x68')]||undefined};};exports[_0x698f('0x69')]=function(_0x1669c5){if(_0x1669c5===_0x698f('0x4a')||_0x1669c5===_0x698f('0x6a')||_0x1669c5==='queue'||_0x1669c5===_0x698f('0x6b')||_0x1669c5==='campaigntype'||_0x1669c5==='dialAnswer'||_0x1669c5===_0x698f('0x6c')||_0x1669c5===_0x698f('0x48')||_0x1669c5===_0x698f('0x46')||_0x1669c5===_0x698f('0x52')||_0x1669c5===_0x698f('0x6d')||_0x1669c5==='scheduledat'||_0x1669c5===_0x698f('0x4b')||_0x1669c5===_0x698f('0x4c')||_0x1669c5==='countnoanswerretry'||_0x1669c5===_0x698f('0x6e')||_0x1669c5===_0x698f('0x6f')||_0x1669c5===_0x698f('0x70')||_0x1669c5==='callbackat'||_0x1669c5===_0x698f('0x71')||_0x1669c5==='ContactId'||_0x1669c5===_0x698f('0x54')||_0x1669c5===_0x698f('0x3f')||_0x1669c5===_0x698f('0x1a')||_0x1669c5===_0x698f('0x72')||_0x1669c5===_0x698f('0x73')||_0x1669c5===_0x698f('0x74')||_0x1669c5===_0x698f('0x75')||_0x1669c5===_0x698f('0x76')||_0x1669c5===_0x698f('0x77')||_0x1669c5===_0x698f('0x78')||_0x1669c5===_0x698f('0x79')||_0x1669c5===_0x698f('0x7a')||_0x1669c5===_0x698f('0x7b')||_0x1669c5===_0x698f('0x7c')||_0x1669c5==='xmd-cdrtype'||_0x1669c5===_0x698f('0x7d')||_0x1669c5===_0x698f('0x7e')||_0x1669c5===_0x698f('0x7f')||_0x1669c5===_0x698f('0x80')||_0x1669c5==='rtpaudioqosbridged'||_0x1669c5===_0x698f('0x81')||_0x1669c5==='rtpaudioqosjitterbridged'||_0x1669c5===_0x698f('0x82')||_0x1669c5===_0x698f('0x83')||_0x1669c5===_0x698f('0x84')||_0x1669c5===_0x698f('0x85')||_0x1669c5==='rtpaudioqos'||_0x1669c5===_0x698f('0x86')||_0x1669c5===_0x698f('0x81')||_0x1669c5===_0x698f('0x87')||_0x1669c5===_0x698f('0x82')||_0x1669c5===_0x698f('0x83')||_0x1669c5===_0x698f('0x84')||_0x1669c5==='rtpaudioqosrttbridged'||_0x1669c5===_0x698f('0x88')||_0x1669c5===_0x698f('0x89')||_0x1669c5===_0x698f('0x36')||_0x1669c5===_0x698f('0x3c')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5af81a,_0x1cef7b){var _0x361b52,_0x5e2f0f,_0x4e947c;if(_0x1cef7b<=0x0){_0x1cef7b=0x1;}_0x361b52=new RegExp(_0x698f('0x8a')+_0x1cef7b+'}$');_0x5e2f0f=Math[_0x698f('0x8b')](0xa,_0x1cef7b-0x1);_0x4e947c=Math['pow'](0xa,_0x1cef7b)-0x1;return util[_0x698f('0x13')]('%s',_[_0x698f('0x8c')](_0x5af81a,_0x361b52,_['random'](_0x5e2f0f,_0x4e947c)));};exports[_0x698f('0x8d')]=function(_0x4aa875){var _0x54d0c4=_0x4aa875[_0x698f('0x8e')](/"(.*?)"/);return _0x54d0c4?_0x54d0c4[0x1]:_0x4aa875;};exports[_0x698f('0x8f')]=function(_0x1edd4a){var _0x3e876e=_0x1edd4a[_0x698f('0x8e')](/<(.*?)>/);return _0x3e876e?_0x3e876e[0x1]:_0x1edd4a;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f616027..e33b131 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 _0xf9fb=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x10985a,_0x5a1c42){var _0x96bb6d=function(_0x4173fb){while(--_0x4173fb){_0x10985a['push'](_0x10985a['shift']());}};_0x96bb6d(++_0x5a1c42);}(_0xf9fb,0x178));var _0xbf9f=function(_0x3e2d45,_0x428962){_0x3e2d45=_0x3e2d45-0x0;var _0x377197=_0xf9fb[_0x3e2d45];return _0x377197;};'use strict';exports[_0xbf9f('0x0')]={'queue':{'type':_0xbf9f('0x1'),'required':!![]},'interface':{'type':_0xbf9f('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xbf9f('0x2'),'required':![]}};exports[_0xbf9f('0x3')]={'queue':{'type':_0xbf9f('0x1'),'required':!![]},'interface':{'type':_0xbf9f('0x1'),'required':!![]}};exports[_0xbf9f('0x4')]={'interface':{'type':_0xbf9f('0x1'),'required':!![]},'paused':{'type':_0xbf9f('0x2')},'reason':{'type':'string','required':![]}};exports[_0xbf9f('0x5')]={'module':{'type':_0xbf9f('0x1'),'required':![]}};exports[_0xbf9f('0x6')]={'uniqueid':{'type':_0xbf9f('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xbf9f('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xbf9f('0x1')}};exports[_0xbf9f('0x7')]={'uniqueid':{'type':_0xbf9f('0x1'),'required':!![]}};exports[_0xbf9f('0x8')]={'uniqueid':{'type':_0xbf9f('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xbf9f('0x1')}}; \ No newline at end of file +var _0x5e6b=['boolean','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0xfba05f,_0x56a358){var _0x5efd6b=function(_0x449c61){while(--_0x449c61){_0xfba05f['push'](_0xfba05f['shift']());}};_0x5efd6b(++_0x56a358);}(_0x5e6b,0x73));var _0xb5e6=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x5e6b[_0x585d81];return _0x1aca0d;};'use strict';exports[_0xb5e6('0x0')]={'queue':{'type':_0xb5e6('0x1'),'required':!![]},'interface':{'type':_0xb5e6('0x1'),'required':!![]},'membername':{'type':_0xb5e6('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xb5e6('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xb5e6('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xb5e6('0x3')]={'interface':{'type':_0xb5e6('0x1'),'required':!![]},'paused':{'type':_0xb5e6('0x2')},'reason':{'type':_0xb5e6('0x1'),'required':![]}};exports[_0xb5e6('0x4')]={'module':{'type':_0xb5e6('0x1'),'required':![]}};exports[_0xb5e6('0x5')]={'uniqueid':{'type':_0xb5e6('0x1'),'required':!![]}};exports[_0xb5e6('0x6')]={'uniqueid':{'type':_0xb5e6('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xb5e6('0x1')},'mixmonitorid':{'type':_0xb5e6('0x1')}};exports[_0xb5e6('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xb5e6('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xb5e6('0x1'),'required':!![]},'context':{'type':_0xb5e6('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2bb7908..29ed3ce 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 _0x6c15=['merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','mergeFromDatabase','prototype','length','interface','isUndefined','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6c15,0x85));var _0x56c1=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0x6c15[_0x24c405];return _0x383aef;};'use strict';var BPromise=require('bluebird');var util=require(_0x56c1('0x0'));var _=require(_0x56c1('0x1'));var moment=require('moment');var Agent=require(_0x56c1('0x2'));var Telephone=require(_0x56c1('0x3'));var Trunk=require(_0x56c1('0x4'));var VoiceQueue=require(_0x56c1('0x5'));var Trigger=require(_0x56c1('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x56c1('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x56c1('0x8'));var FreshdeskAccount=require(_0x56c1('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x56c1('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x56c1('0xb'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x56c1('0xc'));var FaxAccount=require(_0x56c1('0xd'));var Realtime=function(){this[_0x56c1('0xe')]={};this['telephones']={};this[_0x56c1('0xf')]={};this[_0x56c1('0x10')]={};this[_0x56c1('0x11')]={};this[_0x56c1('0x12')]={};this[_0x56c1('0x13')]={};this[_0x56c1('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x56c1('0x15')]={};this[_0x56c1('0x16')]={};this[_0x56c1('0x17')]={};this['outboundChannels']={};this[_0x56c1('0x18')]={};this[_0x56c1('0x19')]={};this['zendeskAccounts']={};this[_0x56c1('0x1a')]={};this[_0x56c1('0x1b')]={};this[_0x56c1('0x1c')]={};this[_0x56c1('0x1d')]={};this['deskAccounts']={};this[_0x56c1('0x1e')]={};this[_0x56c1('0x1f')]={};this[_0x56c1('0x20')]={};this['freshsalesAccounts']={};this[_0x56c1('0x21')]={};};function freeIsNotKey(_0xd5aa55,_0x173a3b,_0x49a604){var _0x2768f0=_[_0x56c1('0x22')](_0xd5aa55,function(_0x48142a,_0x738efa){return _0x48142a[_0x49a604];});for(var _0x2fa1f1 in _0x173a3b){if(_0x173a3b[_0x56c1('0x23')](_0x2fa1f1)){if(!_0x2768f0[_0x2fa1f1]){delete _0x173a3b[_0x2fa1f1];}}}}function freeIsNotKeySip(_0x597fa8,_0x351139){var _0x315c92=_[_0x56c1('0x22')](_0x597fa8,function(_0x3f984e,_0x1b2719){return util[_0x56c1('0x24')](_0x56c1('0x25'),_0x3f984e[_0x56c1('0x26')]);});for(var _0x510012 in _0x351139){if(_0x351139[_0x56c1('0x23')](_0x510012)){if(!_0x315c92[_0x510012]){delete _0x351139[_0x510012];}}}}function freeIsNotKeyAgent(_0x396fd1,_0x26a869){var _0x216dfa=_[_0x56c1('0x22')](_0x396fd1,function(_0x503ab9,_0x4921b0){var _0x86e519=_[_0x56c1('0x27')](_0x503ab9['interface'])?util[_0x56c1('0x24')](_0x56c1('0x25'),_0x503ab9[_0x56c1('0x26')]):_0x503ab9['interface'];return _0x86e519;});for(var _0x2c95bc in _0x26a869){if(_0x26a869[_0x56c1('0x23')](_0x2c95bc)){if(!_0x216dfa[_0x2c95bc]){delete _0x26a869[_0x2c95bc];}}}}function clearVoiceCallReports(_0x5958){_0x5958[_0x56c1('0x28')]=0x0;_0x5958[_0x56c1('0x29')]=0x0;_0x5958[_0x56c1('0x2a')]=0x0;_0x5958['sumDuration']=0x0;_0x5958[_0x56c1('0x2b')]=0x0;}function clearCampaigns(_0x429b8a){if(!_['isEmpty'](_0x429b8a)){for(var _0x26d316 in _0x429b8a){if(_0x429b8a['hasOwnProperty'](_0x26d316)){_0x429b8a[_0x26d316][_0x56c1('0x2c')]=0x0;_0x429b8a[_0x26d316][_0x56c1('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x2073eb){if(!_[_0x56c1('0x2e')](_0x2073eb)){for(var _0x5eb6a3 in _0x2073eb){if(_0x2073eb[_0x56c1('0x23')](_0x5eb6a3)){_0x2073eb[_0x5eb6a3][_0x56c1('0x28')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x29')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x2f')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x30')]=0x0;_0x2073eb[_0x5eb6a3]['sumHoldTime']=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x31')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x2b')]=0x0;_0x2073eb[_0x5eb6a3]['outboundAnswerAgiCallsDay']=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x32')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x33')]=0x0;_0x2073eb[_0x5eb6a3]['outboundCongestionCallsDay']=0x0;_0x2073eb[_0x5eb6a3]['outboundNoSuchCallsDay']=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x34')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x35')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x36')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x37')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x38')]=0x0;_0x2073eb[_0x5eb6a3]['outboundRejectCallsDay']=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x39')]=0x0;_0x2073eb[_0x5eb6a3][_0x56c1('0x3a')]=0x0;_0x2073eb[_0x5eb6a3]['outboundAnswerCallsDay']=0x0;_0x2073eb[_0x5eb6a3]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x56c1('0x3b')]=function(_0x16cc83,_0x357038){for(var _0x66571f in _0x357038){if(_0x16cc83[_0x56c1('0x23')](_0x66571f)){_0x16cc83[_0x66571f]=_0x357038[_0x66571f];}}};Realtime[_0x56c1('0x3c')]['initAgents']=function(){var _0x55e8de=this;return function(_0x3c95b4){if(_0x3c95b4){freeIsNotKeyAgent(_0x3c95b4,_0x55e8de[_0x56c1('0xe')]);for(var _0x290808=0x0,_0x488d80={},_0x395b69={};_0x290808<_0x3c95b4[_0x56c1('0x3d')];_0x290808+=0x1){_0x488d80=_0x3c95b4[_0x290808];var _0x3de06d=_[_0x56c1('0x27')](_0x488d80[_0x56c1('0x3e')])?util['format']('SIP/%s',_0x488d80[_0x56c1('0x26')]):_0x488d80[_0x56c1('0x3e')];if(_[_0x56c1('0x3f')](_0x55e8de[_0x56c1('0xe')][_0x3de06d])){_0x55e8de[_0x56c1('0xe')][_0x3de06d]=new Agent(_0x488d80);}else{_0x55e8de[_0x56c1('0x3b')](_0x55e8de[_0x56c1('0xe')][_0x3de06d],_0x488d80);}}}return _0x55e8de[_0x56c1('0xe')];};};Realtime['prototype'][_0x56c1('0x40')]=function(){var _0x2c267a=this;return function(_0x768249){if(_0x768249){freeIsNotKeySip(_0x768249,_0x2c267a[_0x56c1('0x41')]);for(var _0x52e436=0x0,_0xb3d046={},_0x414214={};_0x52e436<_0x768249['length'];_0x52e436+=0x1){_0xb3d046=_0x768249[_0x52e436];if(_['isUndefined'](_0x2c267a['telephones'][util[_0x56c1('0x24')]('SIP/%s',_0xb3d046[_0x56c1('0x26')])])){_0x2c267a[_0x56c1('0x41')][util[_0x56c1('0x24')](_0x56c1('0x25'),_0xb3d046['name'])]=new Telephone(_0xb3d046);}else{_0x2c267a['mergeFromDatabase'](_0x2c267a[_0x56c1('0x41')][util[_0x56c1('0x24')](_0x56c1('0x25'),_0xb3d046[_0x56c1('0x26')])],_0xb3d046);}}}return _0x2c267a[_0x56c1('0x41')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x42')]=function(){var _0x4e7ea8=this;return function(_0x24afda){if(_0x24afda){freeIsNotKeySip(_0x24afda,_0x4e7ea8[_0x56c1('0xf')]);for(var _0x46b4b3=0x0,_0xf96358={},_0x482910={};_0x46b4b3<_0x24afda['length'];_0x46b4b3+=0x1){_0xf96358=_0x24afda[_0x46b4b3];if(_[_0x56c1('0x3f')](_0x4e7ea8[_0x56c1('0xf')][util['format'](_0x56c1('0x25'),_0xf96358[_0x56c1('0x26')])])){_0x4e7ea8[_0x56c1('0xf')][util[_0x56c1('0x24')](_0x56c1('0x25'),_0xf96358['name'])]=new Trunk(_0xf96358);}else{_0x4e7ea8[_0x56c1('0x3b')](_0x4e7ea8['trunks'][util['format']('SIP/%s',_0xf96358['name'])],_0xf96358);}}}return _0x4e7ea8[_0x56c1('0xf')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x43')]=function(){var _0x4cd49b=this;return function(_0x496e22){if(_0x496e22){freeIsNotKey(_0x496e22,_0x4cd49b[_0x56c1('0x10')],_0x56c1('0x26'));for(var _0x30d650=0x0,_0x2759fd={},_0x1f786a={};_0x30d650<_0x496e22[_0x56c1('0x3d')];_0x30d650+=0x1){_0x2759fd=_0x496e22[_0x30d650];if(_[_0x56c1('0x3f')](_0x4cd49b[_0x56c1('0x10')][_0x2759fd[_0x56c1('0x26')]])){_0x4cd49b[_0x56c1('0x10')][_0x2759fd[_0x56c1('0x26')]]=new VoiceQueue(_0x2759fd);}else{_0x4cd49b[_0x56c1('0x3b')](_0x4cd49b[_0x56c1('0x10')][_0x2759fd[_0x56c1('0x26')]],_0x2759fd);}}}return _0x4cd49b[_0x56c1('0x10')];};};Realtime['prototype'][_0x56c1('0x44')]=function(){var _0x996463=this;return function(_0x4eae5d){if(_0x4eae5d){freeIsNotKey(_0x4eae5d,_0x996463[_0x56c1('0x11')],'id');for(var _0x51a033=0x0,_0x2da992={},_0x57b337={};_0x51a033<_0x4eae5d['length'];_0x51a033+=0x1){_0x2da992=_0x4eae5d[_0x51a033];if(_[_0x56c1('0x3f')](_0x996463[_0x56c1('0x11')][_0x2da992['id']])){_0x996463[_0x56c1('0x11')][_0x2da992['id']]=new Trigger(_0x2da992);}else{_0x996463[_0x56c1('0x3b')](_0x996463[_0x56c1('0x11')][_0x2da992['id']],_0x2da992);}}}return _0x996463[_0x56c1('0x11')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x45')]=function(){var _0x2364a7=this;return function(_0x571646){if(_0x571646){freeIsNotKey(_0x571646,_0x2364a7[_0x56c1('0x13')],'id');for(var _0x2654e6=0x0,_0x4ffc06={},_0x5c00b0={};_0x2654e6<_0x571646[_0x56c1('0x3d')];_0x2654e6+=0x1){_0x4ffc06=_0x571646[_0x2654e6];if(_['isUndefined'](_0x2364a7['templates'][_0x4ffc06['id']])){_0x2364a7[_0x56c1('0x13')][_0x4ffc06['id']]=new Template(_0x4ffc06);}else{_0x2364a7[_0x56c1('0x3b')](_0x2364a7['templates'][_0x4ffc06['id']],_0x4ffc06);}}}return _0x2364a7[_0x56c1('0x13')];};};Realtime['prototype'][_0x56c1('0x46')]=function(){var _0x4129d0=this;return function(_0x2d0084){if(_0x2d0084){freeIsNotKey(_0x2d0084,_0x4129d0[_0x56c1('0x47')],'id');for(var _0x2f07f9=0x0,_0x2aaee0={},_0xedb729={};_0x2f07f9<_0x2d0084[_0x56c1('0x3d')];_0x2f07f9+=0x1){_0x2aaee0=_0x2d0084[_0x2f07f9];if(_[_0x56c1('0x3f')](_0x4129d0[_0x56c1('0x47')][_0x2aaee0['id']])){_0x4129d0[_0x56c1('0x47')][_0x2aaee0['id']]=new ZendeskAccount(_0x2aaee0);}else{_0x4129d0[_0x56c1('0x3b')](_0x4129d0['zendeskAccounts'][_0x2aaee0['id']],_0x2aaee0);}}}return _0x4129d0[_0x56c1('0x47')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x48')]=function(){var _0x579b2e=this;return function(_0x5765b4){if(_0x5765b4){freeIsNotKey(_0x5765b4,_0x579b2e[_0x56c1('0x1a')],'id');for(var _0x133cb5=0x0,_0x4784db={},_0x1bce2c={};_0x133cb5<_0x5765b4[_0x56c1('0x3d')];_0x133cb5+=0x1){_0x4784db=_0x5765b4[_0x133cb5];if(_[_0x56c1('0x3f')](_0x579b2e[_0x56c1('0x1a')][_0x4784db['id']])){_0x579b2e['salesforceAccounts'][_0x4784db['id']]=new SalesforceAccount(_0x4784db);}else{_0x579b2e[_0x56c1('0x3b')](_0x579b2e[_0x56c1('0x1a')][_0x4784db['id']],_0x4784db);}}}return _0x579b2e[_0x56c1('0x1a')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x49')]=function(){var _0x49e11c=this;return function(_0x434eea){if(_0x434eea){freeIsNotKey(_0x434eea,_0x49e11c[_0x56c1('0x1c')],'id');for(var _0x5f1b16=0x0,_0x29dfef={},_0x131564={};_0x5f1b16<_0x434eea[_0x56c1('0x3d')];_0x5f1b16+=0x1){_0x29dfef=_0x434eea[_0x5f1b16];if(_['isUndefined'](_0x49e11c[_0x56c1('0x1c')][_0x29dfef['id']])){_0x49e11c[_0x56c1('0x1c')][_0x29dfef['id']]=new FreshdeskAccount(_0x29dfef);}else{_0x49e11c[_0x56c1('0x3b')](_0x49e11c['freshdeskAccounts'][_0x29dfef['id']],_0x29dfef);}}}return _0x49e11c[_0x56c1('0x1c')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x4a')]=function(){var _0x165fa8=this;return function(_0x28980b){if(_0x28980b){freeIsNotKey(_0x28980b,_0x165fa8['zohoAccounts'],'id');for(var _0x53d242=0x0,_0x239928={},_0x56752d={};_0x53d242<_0x28980b[_0x56c1('0x3d')];_0x53d242+=0x1){_0x239928=_0x28980b[_0x53d242];if(_['isUndefined'](_0x165fa8[_0x56c1('0x1d')][_0x239928['id']])){_0x165fa8[_0x56c1('0x1d')][_0x239928['id']]=new ZohoAccount(_0x239928);}else{_0x165fa8[_0x56c1('0x3b')](_0x165fa8['zohoAccounts'][_0x239928['id']],_0x239928);}}}return _0x165fa8['zohoAccounts'];};};Realtime['prototype'][_0x56c1('0x4b')]=function(){var _0x1e5228=this;return function(_0x945808){if(_0x945808){freeIsNotKey(_0x945808,_0x1e5228[_0x56c1('0x4c')],'id');for(var _0x1850b6=0x0,_0x1805ac={},_0x438f27={};_0x1850b6<_0x945808[_0x56c1('0x3d')];_0x1850b6+=0x1){_0x1805ac=_0x945808[_0x1850b6];if(_[_0x56c1('0x3f')](_0x1e5228[_0x56c1('0x4c')][_0x1805ac['id']])){_0x1e5228['deskAccounts'][_0x1805ac['id']]=new DeskAccount(_0x1805ac);}else{_0x1e5228[_0x56c1('0x3b')](_0x1e5228[_0x56c1('0x4c')][_0x1805ac['id']],_0x1805ac);}}}return _0x1e5228[_0x56c1('0x4c')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x4d')]=function(){var _0x1d53b6=this;return function(_0x510fd7){if(_0x510fd7){freeIsNotKey(_0x510fd7,_0x1d53b6['sugarcrmAccounts'],'id');for(var _0x1f4eda=0x0,_0x16d81b={},_0x544670={};_0x1f4eda<_0x510fd7[_0x56c1('0x3d')];_0x1f4eda+=0x1){_0x16d81b=_0x510fd7[_0x1f4eda];if(_['isUndefined'](_0x1d53b6[_0x56c1('0x1b')][_0x16d81b['id']])){_0x1d53b6[_0x56c1('0x1b')][_0x16d81b['id']]=new SugarcrmAccount(_0x16d81b);}else{_0x1d53b6[_0x56c1('0x3b')](_0x1d53b6[_0x56c1('0x1b')][_0x16d81b['id']],_0x16d81b);}}}return _0x1d53b6[_0x56c1('0x1b')];};};Realtime[_0x56c1('0x3c')]['initVtigerAccounts']=function(){var _0x10b67c=this;return function(_0x474b0e){if(_0x474b0e){freeIsNotKey(_0x474b0e,_0x10b67c['vtigerAccounts'],'id');for(var _0x42661d=0x0,_0x37d549={},_0x48e1c8={};_0x42661d<_0x474b0e[_0x56c1('0x3d')];_0x42661d+=0x1){_0x37d549=_0x474b0e[_0x42661d];if(_['isUndefined'](_0x10b67c[_0x56c1('0x1e')][_0x37d549['id']])){_0x10b67c[_0x56c1('0x1e')][_0x37d549['id']]=new VtigerAccount(_0x37d549);}else{_0x10b67c[_0x56c1('0x3b')](_0x10b67c[_0x56c1('0x1e')][_0x37d549['id']],_0x37d549);}}}return _0x10b67c['vtigerAccounts'];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x4e')]=function(){var _0x5bb63f=this;return function(_0x32b370){if(_0x32b370){freeIsNotKey(_0x32b370,_0x5bb63f[_0x56c1('0x1f')],'id');for(var _0x32897e=0x0,_0x54a25f={},_0x448e8b={};_0x32897e<_0x32b370[_0x56c1('0x3d')];_0x32897e+=0x1){_0x54a25f=_0x32b370[_0x32897e];if(_[_0x56c1('0x3f')](_0x5bb63f[_0x56c1('0x1f')][_0x54a25f['id']])){_0x5bb63f[_0x56c1('0x1f')][_0x54a25f['id']]=new ServicenowAccount(_0x54a25f);}else{_0x5bb63f[_0x56c1('0x3b')](_0x5bb63f[_0x56c1('0x1f')][_0x54a25f['id']],_0x54a25f);}}}return _0x5bb63f[_0x56c1('0x1f')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x4f')]=function(){var _0xd19e52=this;return function(_0x11dab9){if(_0x11dab9){freeIsNotKey(_0x11dab9,_0xd19e52[_0x56c1('0x20')],'id');for(var _0x47d740=0x0,_0x2f7f80={},_0xc95d81={};_0x47d740<_0x11dab9[_0x56c1('0x3d')];_0x47d740+=0x1){_0x2f7f80=_0x11dab9[_0x47d740];if(_[_0x56c1('0x3f')](_0xd19e52[_0x56c1('0x20')][_0x2f7f80['id']])){_0xd19e52[_0x56c1('0x20')][_0x2f7f80['id']]=new Dynamics365Account(_0x2f7f80);}else{_0xd19e52[_0x56c1('0x3b')](_0xd19e52[_0x56c1('0x20')][_0x2f7f80['id']],_0x2f7f80);}}}return _0xd19e52['dynamics365Accounts'];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x50')]=function(){var _0x1ed7f7=this;return function(_0xec74b5){if(_0xec74b5){freeIsNotKey(_0xec74b5,_0x1ed7f7[_0x56c1('0x51')],'id');for(var _0x402529=0x0,_0x513c3b={},_0x370c14={};_0x402529<_0xec74b5[_0x56c1('0x3d')];_0x402529+=0x1){_0x513c3b=_0xec74b5[_0x402529];if(_[_0x56c1('0x3f')](_0x1ed7f7[_0x56c1('0x51')][_0x513c3b['id']])){_0x1ed7f7[_0x56c1('0x51')][_0x513c3b['id']]=new FreshsalesAccount(_0x513c3b);}else{_0x1ed7f7['mergeFromDatabase'](_0x1ed7f7['freshsalesAccounts'][_0x513c3b['id']],_0x513c3b);}}}return _0x1ed7f7[_0x56c1('0x51')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x52')]=function(){var _0x53b427=this;return function(_0x2e966d){for(var _0x50ba48=0x0;_0x50ba48<_0x2e966d[_0x56c1('0x3d')];_0x50ba48+=0x1){_[_0x56c1('0x53')](_0x53b427[_0x56c1('0x10')][_0x2e966d[_0x50ba48][_0x56c1('0x26')]],_0x2e966d[_0x50ba48]);}return _0x53b427['voiceQueues'];};};Realtime[_0x56c1('0x3c')]['initVoiceQueueReports']=function(){var _0x10c18c=this;return function(_0x581700){clearVoiceQueues(_0x10c18c[_0x56c1('0x10')]);if(_0x581700){_0x581700=_[_0x56c1('0x54')](_0x581700,_0x56c1('0x55'));for(var _0x18834e in _0x581700){if(_0x581700[_0x56c1('0x23')](_0x18834e)){var _0x1f4a61={};for(var _0x563914=0x0;_0x563914<_0x581700[_0x18834e][_0x56c1('0x3d')];_0x563914+=0x1){var _0x165e8d=_0x581700[_0x18834e][_0x563914][_0x56c1('0x56')];if(_0x10c18c[_0x56c1('0x10')][_0x165e8d]){if(_0x581700[_0x18834e][_0x563914][_0x56c1('0x57')]){_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x2f')]+=0x1;}if(_0x581700[_0x18834e][_0x563914][_0x56c1('0x58')]){_0x10c18c['voiceQueues'][_0x165e8d]['abandoned']+=0x1;}_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x2a')]+=moment(_0x581700[_0x18834e][_0x563914]['queuecallerleaveAt'])[_0x56c1('0x59')](moment(_0x581700[_0x18834e][_0x563914]['queuecallerjoinAt']),_0x56c1('0x5a'))||0x0;if(_0x563914===_0x581700[_0x18834e][_0x56c1('0x3d')]-0x1){_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x31')]+=moment(_0x581700[_0x18834e][_0x563914][_0x56c1('0x5b')]||_0x581700[_0x18834e][_0x563914][_0x56c1('0x5c')]||_0x581700[_0x18834e][_0x563914][_0x56c1('0x5d')])[_0x56c1('0x59')](moment(_0x581700[_0x18834e][_0x563914][_0x56c1('0x5e')]),'seconds')||0x0;_0x10c18c['voiceQueues'][_0x165e8d][_0x56c1('0x28')]+=0x1;if(_0x581700[_0x18834e][_0x563914][_0x56c1('0x5f')]){_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x29')]+=0x1;_0x10c18c['voiceQueues'][_0x165e8d][_0x56c1('0x2b')]+=moment(_0x581700[_0x18834e][_0x563914][_0x56c1('0x5b')])[_0x56c1('0x59')](moment(_0x581700[_0x18834e][_0x563914][_0x56c1('0x60')]),'seconds')||0x0;}}else{_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x31')]+=_0x10c18c[_0x56c1('0x10')][_0x165e8d][_0x56c1('0x2a')]||0x0;}}}}}}return _0x10c18c['voiceQueues'];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x61')]=function(){var _0xf512bc=this;return function(_0x1dfb98){clearVoiceCallReports(_0xf512bc[_0x56c1('0x14')]);if(_0x1dfb98){for(var _0x21ec55=0x0;_0x21ec55<_0x1dfb98[_0x56c1('0x3d')];_0x21ec55+=0x1){_0xf512bc[_0x56c1('0x14')][_0x56c1('0x28')]+=0x1;_0xf512bc['outbound'][_0x56c1('0x31')]+=_0x1dfb98[_0x21ec55][_0x56c1('0x62')];if(_0x1dfb98[_0x21ec55][_0x56c1('0x63')]===_0x56c1('0x64')){_0xf512bc[_0x56c1('0x14')][_0x56c1('0x29')]+=0x1;_0xf512bc[_0x56c1('0x14')]['sumHoldTime']+=_0x1dfb98[_0x21ec55][_0x56c1('0x62')]-_0x1dfb98[_0x21ec55]['billableseconds']||0x0;_0xf512bc['outbound'][_0x56c1('0x2b')]+=_0x1dfb98[_0x21ec55][_0x56c1('0x65')];}}}return _0xf512bc[_0x56c1('0x14')];};};Realtime[_0x56c1('0x3c')][_0x56c1('0x66')]=function(){var _0x64d1f6=this;return function(_0x112801){if(_0x112801){freeIsNotKey(_0x112801,_0x64d1f6[_0x56c1('0x12')],_0x56c1('0x26'));for(var _0x20c1b0=0x0,_0x28fd0f={};_0x20c1b0<_0x112801[_0x56c1('0x3d')];_0x20c1b0+=0x1){_0x28fd0f=_0x112801[_0x20c1b0];if(_[_0x56c1('0x3f')](_0x64d1f6[_0x56c1('0x12')][_0x28fd0f[_0x56c1('0x26')]])){_0x64d1f6['campaigns'][_0x28fd0f['name']]=new Campaign(_0x28fd0f);}else{_0x64d1f6[_0x56c1('0x3b')](_0x64d1f6[_0x56c1('0x12')][_0x28fd0f[_0x56c1('0x26')]],_0x28fd0f);_0x64d1f6[_0x56c1('0x12')][_0x28fd0f[_0x56c1('0x26')]][_0x56c1('0x67')]=_0x28fd0f['SquareProject']?_0x28fd0f[_0x56c1('0x68')][_0x56c1('0x26')]:undefined;}}}return _0x64d1f6['campaigns'];};};Realtime['prototype'][_0x56c1('0x69')]=function(){var _0x24a09c=this;return function(_0x65e86e){if(_0x65e86e){freeIsNotKey(_0x65e86e,_0x24a09c['voiceExtensions'],'id');for(var _0x5723af=0x0,_0x2ba710={};_0x5723af<_0x65e86e[_0x56c1('0x3d')];_0x5723af+=0x1){_0x2ba710=_0x65e86e[_0x5723af];if(_[_0x56c1('0x3f')](_0x24a09c[_0x56c1('0x15')][_0x2ba710['id']])){_0x24a09c[_0x56c1('0x15')][_0x2ba710['id']]=new VoiceExtension(_0x2ba710);}else{_0x24a09c['mergeFromDatabase'](_0x24a09c[_0x56c1('0x15')][_0x2ba710['id']],_0x2ba710);}}}return _0x24a09c[_0x56c1('0x15')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x139f63=this;return function(_0x1c734a){clearCampaigns(_0x139f63[_0x56c1('0x12')]);for(var _0x4d208f=0x0;_0x4d208f<_0x1c734a[_0x56c1('0x3d')];_0x4d208f+=0x1){_[_0x56c1('0x53')](_0x139f63['campaigns'][_0x1c734a[_0x4d208f][_0x56c1('0x26')]],_0x1c734a[_0x4d208f]);}return _0x139f63[_0x56c1('0x12')];};};Realtime['prototype'][_0x56c1('0x6a')]=function(){var _0x289ba7=this;return function(_0x20238c){if(_0x20238c){freeIsNotKey(_0x20238c,_0x289ba7[_0x56c1('0x21')],'id');for(var _0x48c60f=0x0,_0x369899={},_0x29a39a={};_0x48c60f<_0x20238c[_0x56c1('0x3d')];_0x48c60f+=0x1){_0x369899=_0x20238c[_0x48c60f];if(_['isUndefined'](_0x289ba7[_0x56c1('0x21')][_0x369899['id']])){_0x289ba7[_0x56c1('0x21')][_0x369899['id']]=new FaxAccount(_0x369899);}else{_0x289ba7[_0x56c1('0x3b')](_0x289ba7['faxAccounts'][_0x369899['id']],_0x369899);}}}return _0x289ba7[_0x56c1('0x21')];};};module[_0x56c1('0x6b')]=Realtime; \ No newline at end of file +var _0x9b3d=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty'];(function(_0x5a0bab,_0x168def){var _0x32b15a=function(_0x52f391){while(--_0x52f391){_0x5a0bab['push'](_0x5a0bab['shift']());}};_0x32b15a(++_0x168def);}(_0x9b3d,0xa9));var _0xd9b3=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0x9b3d[_0x4a7e98];return _0x27d10d;};'use strict';var BPromise=require(_0xd9b3('0x0'));var util=require(_0xd9b3('0x1'));var _=require(_0xd9b3('0x2'));var moment=require('moment');var Agent=require(_0xd9b3('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xd9b3('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xd9b3('0x5'));var Campaign=require(_0xd9b3('0x6'));var VoiceExtension=require(_0xd9b3('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xd9b3('0x8'));var FreshdeskAccount=require(_0xd9b3('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xd9b3('0xa'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xd9b3('0xb'));var FreshsalesAccount=require(_0xd9b3('0xc'));var FaxAccount=require(_0xd9b3('0xd'));var Realtime=function(){this[_0xd9b3('0xe')]={};this[_0xd9b3('0xf')]={};this[_0xd9b3('0x10')]={};this[_0xd9b3('0x11')]={};this[_0xd9b3('0x12')]={};this[_0xd9b3('0x13')]={};this[_0xd9b3('0x14')]={};this[_0xd9b3('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xd9b3('0x16')]={};this[_0xd9b3('0x17')]={};this[_0xd9b3('0x18')]={};this[_0xd9b3('0x19')]={};this[_0xd9b3('0x1a')]={};this[_0xd9b3('0x1b')]={};this[_0xd9b3('0x1c')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xd9b3('0x1d')]={};this[_0xd9b3('0x1e')]={};this['vtigerAccounts']={};this[_0xd9b3('0x1f')]={};this['dynamics365Accounts']={};this[_0xd9b3('0x20')]={};this[_0xd9b3('0x21')]={};};function freeIsNotKey(_0x6b1dbd,_0x250f12,_0x47d1be){var _0x1f9023=_[_0xd9b3('0x22')](_0x6b1dbd,function(_0x23b05b,_0x6bd82c){return _0x23b05b[_0x47d1be];});for(var _0x643d3c in _0x250f12){if(_0x250f12[_0xd9b3('0x23')](_0x643d3c)){if(!_0x1f9023[_0x643d3c]){delete _0x250f12[_0x643d3c];}}}}function freeIsNotKeySip(_0x1f8f74,_0x42281f){var _0x143edc=_['mapKeys'](_0x1f8f74,function(_0x344bb8,_0x86917f){return util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x344bb8['name']);});for(var _0x5e8e71 in _0x42281f){if(_0x42281f['hasOwnProperty'](_0x5e8e71)){if(!_0x143edc[_0x5e8e71]){delete _0x42281f[_0x5e8e71];}}}}function freeIsNotKeyAgent(_0x33b04f,_0x1a69d6){var _0x2a312b=_[_0xd9b3('0x22')](_0x33b04f,function(_0x1a7329,_0x466d0d){var _0xcaa886=_[_0xd9b3('0x26')](_0x1a7329[_0xd9b3('0x27')])?util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x1a7329[_0xd9b3('0x28')]):_0x1a7329['interface'];return _0xcaa886;});for(var _0x24aa53 in _0x1a69d6){if(_0x1a69d6['hasOwnProperty'](_0x24aa53)){if(!_0x2a312b[_0x24aa53]){delete _0x1a69d6[_0x24aa53];}}}}function clearVoiceCallReports(_0x4cfe93){_0x4cfe93[_0xd9b3('0x29')]=0x0;_0x4cfe93[_0xd9b3('0x2a')]=0x0;_0x4cfe93[_0xd9b3('0x2b')]=0x0;_0x4cfe93[_0xd9b3('0x2c')]=0x0;_0x4cfe93[_0xd9b3('0x2d')]=0x0;}function clearCampaigns(_0x5d40b9){if(!_[_0xd9b3('0x2e')](_0x5d40b9)){for(var _0x20206b in _0x5d40b9){if(_0x5d40b9[_0xd9b3('0x23')](_0x20206b)){_0x5d40b9[_0x20206b][_0xd9b3('0x2f')]=0x0;_0x5d40b9[_0x20206b][_0xd9b3('0x30')]=0x0;}}}}function clearVoiceQueues(_0x33cd1c){if(!_[_0xd9b3('0x2e')](_0x33cd1c)){for(var _0x10d4f2 in _0x33cd1c){if(_0x33cd1c[_0xd9b3('0x23')](_0x10d4f2)){_0x33cd1c[_0x10d4f2]['total']=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x2a')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x31')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x32')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x2b')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x2c')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x2d')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x33')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x34')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x35')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x36')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x37')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x38')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x39')]=0x0;_0x33cd1c[_0x10d4f2]['outboundDropCallsDayCallersExit']=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3a')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3b')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3c')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3d')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x33')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3e')]=0x0;_0x33cd1c[_0x10d4f2][_0xd9b3('0x3f')]=!![];}}}}Realtime['prototype'][_0xd9b3('0x40')]=function(_0x4d8f7d,_0x137a73){for(var _0x4430a5 in _0x137a73){if(_0x4d8f7d[_0xd9b3('0x23')](_0x4430a5)){_0x4d8f7d[_0x4430a5]=_0x137a73[_0x4430a5];}}};Realtime[_0xd9b3('0x41')][_0xd9b3('0x42')]=function(){var _0x35b3c9=this;return function(_0x1ba686){if(_0x1ba686){freeIsNotKeyAgent(_0x1ba686,_0x35b3c9[_0xd9b3('0xe')]);for(var _0x27abec=0x0,_0x4ca313={},_0x5bf94c={};_0x27abec<_0x1ba686[_0xd9b3('0x43')];_0x27abec+=0x1){_0x4ca313=_0x1ba686[_0x27abec];var _0xf0813c=_['isNil'](_0x4ca313[_0xd9b3('0x27')])?util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x4ca313['name']):_0x4ca313[_0xd9b3('0x27')];if(_[_0xd9b3('0x44')](_0x35b3c9[_0xd9b3('0xe')][_0xf0813c])){_0x35b3c9['agents'][_0xf0813c]=new Agent(_0x4ca313);}else{_0x35b3c9[_0xd9b3('0x40')](_0x35b3c9[_0xd9b3('0xe')][_0xf0813c],_0x4ca313);}}}return _0x35b3c9[_0xd9b3('0xe')];};};Realtime['prototype'][_0xd9b3('0x45')]=function(){var _0x3af5cc=this;return function(_0xb5c87f){if(_0xb5c87f){freeIsNotKeySip(_0xb5c87f,_0x3af5cc[_0xd9b3('0xf')]);for(var _0x413c81=0x0,_0x2778f0={},_0x40a89f={};_0x413c81<_0xb5c87f['length'];_0x413c81+=0x1){_0x2778f0=_0xb5c87f[_0x413c81];if(_['isUndefined'](_0x3af5cc[_0xd9b3('0xf')][util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x2778f0[_0xd9b3('0x28')])])){_0x3af5cc[_0xd9b3('0xf')][util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x2778f0[_0xd9b3('0x28')])]=new Telephone(_0x2778f0);}else{_0x3af5cc[_0xd9b3('0x40')](_0x3af5cc[_0xd9b3('0xf')][util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x2778f0[_0xd9b3('0x28')])],_0x2778f0);}}}return _0x3af5cc['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x4542e0=this;return function(_0x1673df){if(_0x1673df){freeIsNotKeySip(_0x1673df,_0x4542e0[_0xd9b3('0x10')]);for(var _0x3876bf=0x0,_0x2faf99={},_0x41c0dd={};_0x3876bf<_0x1673df['length'];_0x3876bf+=0x1){_0x2faf99=_0x1673df[_0x3876bf];if(_[_0xd9b3('0x44')](_0x4542e0[_0xd9b3('0x10')][util[_0xd9b3('0x24')]('SIP/%s',_0x2faf99[_0xd9b3('0x28')])])){_0x4542e0[_0xd9b3('0x10')][util[_0xd9b3('0x24')]('SIP/%s',_0x2faf99[_0xd9b3('0x28')])]=new Trunk(_0x2faf99);}else{_0x4542e0[_0xd9b3('0x40')](_0x4542e0['trunks'][util[_0xd9b3('0x24')](_0xd9b3('0x25'),_0x2faf99[_0xd9b3('0x28')])],_0x2faf99);}}}return _0x4542e0[_0xd9b3('0x10')];};};Realtime['prototype'][_0xd9b3('0x46')]=function(){var _0x11e51e=this;return function(_0x485c93){if(_0x485c93){freeIsNotKey(_0x485c93,_0x11e51e[_0xd9b3('0x11')],'name');for(var _0x201912=0x0,_0x531382={},_0x514365={};_0x201912<_0x485c93[_0xd9b3('0x43')];_0x201912+=0x1){_0x531382=_0x485c93[_0x201912];if(_[_0xd9b3('0x44')](_0x11e51e[_0xd9b3('0x11')][_0x531382['name']])){_0x11e51e['voiceQueues'][_0x531382[_0xd9b3('0x28')]]=new VoiceQueue(_0x531382);}else{_0x11e51e[_0xd9b3('0x40')](_0x11e51e['voiceQueues'][_0x531382[_0xd9b3('0x28')]],_0x531382);}}}return _0x11e51e[_0xd9b3('0x11')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x47')]=function(){var _0x1e5a67=this;return function(_0x365624){if(_0x365624){freeIsNotKey(_0x365624,_0x1e5a67[_0xd9b3('0x12')],'id');for(var _0x320829=0x0,_0x2948e5={},_0x548078={};_0x320829<_0x365624[_0xd9b3('0x43')];_0x320829+=0x1){_0x2948e5=_0x365624[_0x320829];if(_[_0xd9b3('0x44')](_0x1e5a67[_0xd9b3('0x12')][_0x2948e5['id']])){_0x1e5a67[_0xd9b3('0x12')][_0x2948e5['id']]=new Trigger(_0x2948e5);}else{_0x1e5a67['mergeFromDatabase'](_0x1e5a67['triggers'][_0x2948e5['id']],_0x2948e5);}}}return _0x1e5a67[_0xd9b3('0x12')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x48')]=function(){var _0x510709=this;return function(_0x49dc64){if(_0x49dc64){freeIsNotKey(_0x49dc64,_0x510709[_0xd9b3('0x14')],'id');for(var _0x1c7573=0x0,_0x4ddec9={},_0x122272={};_0x1c7573<_0x49dc64[_0xd9b3('0x43')];_0x1c7573+=0x1){_0x4ddec9=_0x49dc64[_0x1c7573];if(_[_0xd9b3('0x44')](_0x510709[_0xd9b3('0x14')][_0x4ddec9['id']])){_0x510709[_0xd9b3('0x14')][_0x4ddec9['id']]=new Template(_0x4ddec9);}else{_0x510709[_0xd9b3('0x40')](_0x510709['templates'][_0x4ddec9['id']],_0x4ddec9);}}}return _0x510709[_0xd9b3('0x14')];};};Realtime['prototype'][_0xd9b3('0x49')]=function(){var _0x5672ca=this;return function(_0x32410d){if(_0x32410d){freeIsNotKey(_0x32410d,_0x5672ca[_0xd9b3('0x1b')],'id');for(var _0x52aa30=0x0,_0x32fed8={},_0x15b977={};_0x52aa30<_0x32410d[_0xd9b3('0x43')];_0x52aa30+=0x1){_0x32fed8=_0x32410d[_0x52aa30];if(_[_0xd9b3('0x44')](_0x5672ca[_0xd9b3('0x1b')][_0x32fed8['id']])){_0x5672ca[_0xd9b3('0x1b')][_0x32fed8['id']]=new ZendeskAccount(_0x32fed8);}else{_0x5672ca[_0xd9b3('0x40')](_0x5672ca[_0xd9b3('0x1b')][_0x32fed8['id']],_0x32fed8);}}}return _0x5672ca[_0xd9b3('0x1b')];};};Realtime['prototype'][_0xd9b3('0x4a')]=function(){var _0xbcce13=this;return function(_0x3d5918){if(_0x3d5918){freeIsNotKey(_0x3d5918,_0xbcce13[_0xd9b3('0x1c')],'id');for(var _0x272d01=0x0,_0x5f3542={},_0x5f4a61={};_0x272d01<_0x3d5918['length'];_0x272d01+=0x1){_0x5f3542=_0x3d5918[_0x272d01];if(_['isUndefined'](_0xbcce13['salesforceAccounts'][_0x5f3542['id']])){_0xbcce13[_0xd9b3('0x1c')][_0x5f3542['id']]=new SalesforceAccount(_0x5f3542);}else{_0xbcce13['mergeFromDatabase'](_0xbcce13['salesforceAccounts'][_0x5f3542['id']],_0x5f3542);}}}return _0xbcce13[_0xd9b3('0x1c')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x4b')]=function(){var _0x30b989=this;return function(_0x2efd3e){if(_0x2efd3e){freeIsNotKey(_0x2efd3e,_0x30b989[_0xd9b3('0x4c')],'id');for(var _0x52f2bc=0x0,_0x51162e={},_0x1492af={};_0x52f2bc<_0x2efd3e[_0xd9b3('0x43')];_0x52f2bc+=0x1){_0x51162e=_0x2efd3e[_0x52f2bc];if(_[_0xd9b3('0x44')](_0x30b989[_0xd9b3('0x4c')][_0x51162e['id']])){_0x30b989['freshdeskAccounts'][_0x51162e['id']]=new FreshdeskAccount(_0x51162e);}else{_0x30b989[_0xd9b3('0x40')](_0x30b989[_0xd9b3('0x4c')][_0x51162e['id']],_0x51162e);}}}return _0x30b989[_0xd9b3('0x4c')];};};Realtime[_0xd9b3('0x41')]['initZohoAccounts']=function(){var _0xdbbfc4=this;return function(_0x1c9459){if(_0x1c9459){freeIsNotKey(_0x1c9459,_0xdbbfc4[_0xd9b3('0x1d')],'id');for(var _0x449a5d=0x0,_0x1a183b={},_0x8cc456={};_0x449a5d<_0x1c9459['length'];_0x449a5d+=0x1){_0x1a183b=_0x1c9459[_0x449a5d];if(_[_0xd9b3('0x44')](_0xdbbfc4[_0xd9b3('0x1d')][_0x1a183b['id']])){_0xdbbfc4[_0xd9b3('0x1d')][_0x1a183b['id']]=new ZohoAccount(_0x1a183b);}else{_0xdbbfc4[_0xd9b3('0x40')](_0xdbbfc4[_0xd9b3('0x1d')][_0x1a183b['id']],_0x1a183b);}}}return _0xdbbfc4[_0xd9b3('0x1d')];};};Realtime['prototype'][_0xd9b3('0x4d')]=function(){var _0x4123db=this;return function(_0x2db924){if(_0x2db924){freeIsNotKey(_0x2db924,_0x4123db[_0xd9b3('0x1e')],'id');for(var _0x4e2890=0x0,_0x5bab91={},_0x4ae268={};_0x4e2890<_0x2db924['length'];_0x4e2890+=0x1){_0x5bab91=_0x2db924[_0x4e2890];if(_['isUndefined'](_0x4123db[_0xd9b3('0x1e')][_0x5bab91['id']])){_0x4123db[_0xd9b3('0x1e')][_0x5bab91['id']]=new DeskAccount(_0x5bab91);}else{_0x4123db[_0xd9b3('0x40')](_0x4123db['deskAccounts'][_0x5bab91['id']],_0x5bab91);}}}return _0x4123db[_0xd9b3('0x1e')];};};Realtime['prototype'][_0xd9b3('0x4e')]=function(){var _0x2a60a3=this;return function(_0x2e0a6f){if(_0x2e0a6f){freeIsNotKey(_0x2e0a6f,_0x2a60a3[_0xd9b3('0x4f')],'id');for(var _0x4ce2c2=0x0,_0x2ee188={},_0x4edbb9={};_0x4ce2c2<_0x2e0a6f[_0xd9b3('0x43')];_0x4ce2c2+=0x1){_0x2ee188=_0x2e0a6f[_0x4ce2c2];if(_[_0xd9b3('0x44')](_0x2a60a3[_0xd9b3('0x4f')][_0x2ee188['id']])){_0x2a60a3[_0xd9b3('0x4f')][_0x2ee188['id']]=new SugarcrmAccount(_0x2ee188);}else{_0x2a60a3['mergeFromDatabase'](_0x2a60a3['sugarcrmAccounts'][_0x2ee188['id']],_0x2ee188);}}}return _0x2a60a3[_0xd9b3('0x4f')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x50')]=function(){var _0x241534=this;return function(_0x1dba72){if(_0x1dba72){freeIsNotKey(_0x1dba72,_0x241534['vtigerAccounts'],'id');for(var _0x7dc53e=0x0,_0x4e5bc9={},_0x28fc74={};_0x7dc53e<_0x1dba72[_0xd9b3('0x43')];_0x7dc53e+=0x1){_0x4e5bc9=_0x1dba72[_0x7dc53e];if(_[_0xd9b3('0x44')](_0x241534[_0xd9b3('0x51')][_0x4e5bc9['id']])){_0x241534['vtigerAccounts'][_0x4e5bc9['id']]=new VtigerAccount(_0x4e5bc9);}else{_0x241534[_0xd9b3('0x40')](_0x241534[_0xd9b3('0x51')][_0x4e5bc9['id']],_0x4e5bc9);}}}return _0x241534['vtigerAccounts'];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x52')]=function(){var _0x499a14=this;return function(_0x3601ac){if(_0x3601ac){freeIsNotKey(_0x3601ac,_0x499a14[_0xd9b3('0x1f')],'id');for(var _0x2e1d8c=0x0,_0x32e70d={},_0x5f02f9={};_0x2e1d8c<_0x3601ac['length'];_0x2e1d8c+=0x1){_0x32e70d=_0x3601ac[_0x2e1d8c];if(_[_0xd9b3('0x44')](_0x499a14[_0xd9b3('0x1f')][_0x32e70d['id']])){_0x499a14[_0xd9b3('0x1f')][_0x32e70d['id']]=new ServicenowAccount(_0x32e70d);}else{_0x499a14[_0xd9b3('0x40')](_0x499a14['servicenowAccounts'][_0x32e70d['id']],_0x32e70d);}}}return _0x499a14[_0xd9b3('0x1f')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x53')]=function(){var _0x11b059=this;return function(_0x303687){if(_0x303687){freeIsNotKey(_0x303687,_0x11b059[_0xd9b3('0x54')],'id');for(var _0x2c0b6b=0x0,_0x25d26f={},_0x578eac={};_0x2c0b6b<_0x303687[_0xd9b3('0x43')];_0x2c0b6b+=0x1){_0x25d26f=_0x303687[_0x2c0b6b];if(_['isUndefined'](_0x11b059[_0xd9b3('0x54')][_0x25d26f['id']])){_0x11b059[_0xd9b3('0x54')][_0x25d26f['id']]=new Dynamics365Account(_0x25d26f);}else{_0x11b059['mergeFromDatabase'](_0x11b059[_0xd9b3('0x54')][_0x25d26f['id']],_0x25d26f);}}}return _0x11b059[_0xd9b3('0x54')];};};Realtime[_0xd9b3('0x41')]['initFreshsalesAccounts']=function(){var _0x21c6f2=this;return function(_0x4976ca){if(_0x4976ca){freeIsNotKey(_0x4976ca,_0x21c6f2[_0xd9b3('0x20')],'id');for(var _0x5eae89=0x0,_0x3397a3={},_0x3ea44c={};_0x5eae89<_0x4976ca[_0xd9b3('0x43')];_0x5eae89+=0x1){_0x3397a3=_0x4976ca[_0x5eae89];if(_[_0xd9b3('0x44')](_0x21c6f2['freshsalesAccounts'][_0x3397a3['id']])){_0x21c6f2[_0xd9b3('0x20')][_0x3397a3['id']]=new FreshsalesAccount(_0x3397a3);}else{_0x21c6f2[_0xd9b3('0x40')](_0x21c6f2['freshsalesAccounts'][_0x3397a3['id']],_0x3397a3);}}}return _0x21c6f2[_0xd9b3('0x20')];};};Realtime['prototype'][_0xd9b3('0x55')]=function(){var _0x29ab6f=this;return function(_0x204daf){for(var _0x1e0537=0x0;_0x1e0537<_0x204daf[_0xd9b3('0x43')];_0x1e0537+=0x1){_[_0xd9b3('0x56')](_0x29ab6f[_0xd9b3('0x11')][_0x204daf[_0x1e0537][_0xd9b3('0x28')]],_0x204daf[_0x1e0537]);}return _0x29ab6f[_0xd9b3('0x11')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x57')]=function(){var _0x7b3776=this;return function(_0x82a07d){clearVoiceQueues(_0x7b3776[_0xd9b3('0x11')]);if(_0x82a07d){_0x82a07d=_['groupBy'](_0x82a07d,_0xd9b3('0x58'));for(var _0x16f6dd in _0x82a07d){if(_0x82a07d[_0xd9b3('0x23')](_0x16f6dd)){var _0x1e81cd={};for(var _0x46a4db=0x0;_0x46a4db<_0x82a07d[_0x16f6dd][_0xd9b3('0x43')];_0x46a4db+=0x1){var _0x56eb31=_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x59')];if(_0x7b3776[_0xd9b3('0x11')][_0x56eb31]){if(_0x82a07d[_0x16f6dd][_0x46a4db]['queuecallerexit']){_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x31')]+=0x1;}if(_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5a')]){_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x32')]+=0x1;}_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x2b')]+=moment(_0x82a07d[_0x16f6dd][_0x46a4db]['queuecallerleaveAt'])[_0xd9b3('0x5b')](moment(_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5c')]),_0xd9b3('0x5d'))||0x0;if(_0x46a4db===_0x82a07d[_0x16f6dd][_0xd9b3('0x43')]-0x1){_0x7b3776['voiceQueues'][_0x56eb31]['sumDuration']+=moment(_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5e')]||_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5f')]||_0x82a07d[_0x16f6dd][_0x46a4db]['queuecallerexitAt'])[_0xd9b3('0x5b')](moment(_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5c')]),_0xd9b3('0x5d'))||0x0;_0x7b3776['voiceQueues'][_0x56eb31][_0xd9b3('0x29')]+=0x1;if(_0x82a07d[_0x16f6dd][_0x46a4db]['queuecallercomplete']){_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x2a')]+=0x1;_0x7b3776['voiceQueues'][_0x56eb31][_0xd9b3('0x2d')]+=moment(_0x82a07d[_0x16f6dd][_0x46a4db][_0xd9b3('0x5e')])['diff'](moment(_0x82a07d[_0x16f6dd][_0x46a4db]['queuecallerleaveAt']),_0xd9b3('0x5d'))||0x0;}}else{_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x2c')]+=_0x7b3776[_0xd9b3('0x11')][_0x56eb31][_0xd9b3('0x2b')]||0x0;}}}}}}return _0x7b3776[_0xd9b3('0x11')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x60')]=function(){var _0x4f261d=this;return function(_0x2926a8){clearVoiceCallReports(_0x4f261d[_0xd9b3('0x15')]);if(_0x2926a8){for(var _0x3eec73=0x0;_0x3eec73<_0x2926a8['length'];_0x3eec73+=0x1){_0x4f261d[_0xd9b3('0x15')]['total']+=0x1;_0x4f261d['outbound'][_0xd9b3('0x2c')]+=_0x2926a8[_0x3eec73][_0xd9b3('0x61')];if(_0x2926a8[_0x3eec73]['disposition']===_0xd9b3('0x62')){_0x4f261d[_0xd9b3('0x15')][_0xd9b3('0x2a')]+=0x1;_0x4f261d[_0xd9b3('0x15')][_0xd9b3('0x2b')]+=_0x2926a8[_0x3eec73]['duration']-_0x2926a8[_0x3eec73]['billableseconds']||0x0;_0x4f261d[_0xd9b3('0x15')][_0xd9b3('0x2d')]+=_0x2926a8[_0x3eec73][_0xd9b3('0x63')];}}}return _0x4f261d[_0xd9b3('0x15')];};};Realtime['prototype'][_0xd9b3('0x64')]=function(){var _0x604533=this;return function(_0xab6fbf){if(_0xab6fbf){freeIsNotKey(_0xab6fbf,_0x604533[_0xd9b3('0x13')],_0xd9b3('0x28'));for(var _0x43aa13=0x0,_0x254dd9={};_0x43aa13<_0xab6fbf[_0xd9b3('0x43')];_0x43aa13+=0x1){_0x254dd9=_0xab6fbf[_0x43aa13];if(_[_0xd9b3('0x44')](_0x604533[_0xd9b3('0x13')][_0x254dd9[_0xd9b3('0x28')]])){_0x604533[_0xd9b3('0x13')][_0x254dd9[_0xd9b3('0x28')]]=new Campaign(_0x254dd9);}else{_0x604533[_0xd9b3('0x40')](_0x604533[_0xd9b3('0x13')][_0x254dd9['name']],_0x254dd9);_0x604533[_0xd9b3('0x13')][_0x254dd9[_0xd9b3('0x28')]][_0xd9b3('0x65')]=_0x254dd9[_0xd9b3('0x66')]?_0x254dd9[_0xd9b3('0x66')][_0xd9b3('0x28')]:undefined;}}}return _0x604533[_0xd9b3('0x13')];};};Realtime['prototype'][_0xd9b3('0x67')]=function(){var _0x26b8b4=this;return function(_0x3d848b){if(_0x3d848b){freeIsNotKey(_0x3d848b,_0x26b8b4[_0xd9b3('0x68')],'id');for(var _0x4ea289=0x0,_0x11a002={};_0x4ea289<_0x3d848b['length'];_0x4ea289+=0x1){_0x11a002=_0x3d848b[_0x4ea289];if(_['isUndefined'](_0x26b8b4[_0xd9b3('0x68')][_0x11a002['id']])){_0x26b8b4['voiceExtensions'][_0x11a002['id']]=new VoiceExtension(_0x11a002);}else{_0x26b8b4[_0xd9b3('0x40')](_0x26b8b4['voiceExtensions'][_0x11a002['id']],_0x11a002);}}}return _0x26b8b4[_0xd9b3('0x68')];};};Realtime['prototype'][_0xd9b3('0x69')]=function(){var _0x7ece3a=this;return function(_0x2ff38b){clearCampaigns(_0x7ece3a[_0xd9b3('0x13')]);for(var _0x1699a1=0x0;_0x1699a1<_0x2ff38b[_0xd9b3('0x43')];_0x1699a1+=0x1){_[_0xd9b3('0x56')](_0x7ece3a[_0xd9b3('0x13')][_0x2ff38b[_0x1699a1][_0xd9b3('0x28')]],_0x2ff38b[_0x1699a1]);}return _0x7ece3a[_0xd9b3('0x13')];};};Realtime[_0xd9b3('0x41')][_0xd9b3('0x6a')]=function(){var _0x3081fc=this;return function(_0x44dcb7){if(_0x44dcb7){freeIsNotKey(_0x44dcb7,_0x3081fc[_0xd9b3('0x21')],'id');for(var _0x3744f3=0x0,_0x2a4588={},_0x397572={};_0x3744f3<_0x44dcb7[_0xd9b3('0x43')];_0x3744f3+=0x1){_0x2a4588=_0x44dcb7[_0x3744f3];if(_[_0xd9b3('0x44')](_0x3081fc[_0xd9b3('0x21')][_0x2a4588['id']])){_0x3081fc[_0xd9b3('0x21')][_0x2a4588['id']]=new FaxAccount(_0x2a4588);}else{_0x3081fc[_0xd9b3('0x40')](_0x3081fc[_0xd9b3('0x21')][_0x2a4588['id']],_0x2a4588);}}}return _0x3081fc[_0xd9b3('0x21')];};};module[_0xd9b3('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 da150ba..2f2dc2e 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 _0x672a=['./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','create','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','split','monitor','monitors','monitorFilename','filename','xcally-motion-preview','connectedlinename','isArray','startsWith','Local','indexOf','phone','substring','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport'];(function(_0x275072,_0x43d345){var _0x3ab676=function(_0x4ed976){while(--_0x4ed976){_0x275072['push'](_0x275072['shift']());}};_0x3ab676(++_0x43d345);}(_0x672a,0x1bf));var _0xa672=function(_0x22fd6a,_0x50be64){_0x22fd6a=_0x22fd6a-0x0;var _0x31a7fe=_0x672a[_0x22fd6a];return _0x31a7fe;};'use strict';var _=require(_0xa672('0x0'));var moment=require(_0xa672('0x1'));var util=require(_0xa672('0x2'));var config=require(_0xa672('0x3'));var ami=require(_0xa672('0x4'));var RpcVoiceAgentReport=require(_0xa672('0x5'));var RpcVoiceCallReport=require(_0xa672('0x6'));var RpcVoiceDialReport=require(_0xa672('0x7'));var RpcMemberReport=require(_0xa672('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa672('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa672('0xa'));var VoiceCallReport=require(_0xa672('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xa672('0xc'));var UserReport=require(_0xa672('0xd'));function Report(_0x4f649f){this[_0xa672('0xe')]=_0x4f649f;this[_0xa672('0xf')]=_0x4f649f[_0xa672('0xf')];this[_0xa672('0x10')]=_0x4f649f[_0xa672('0x10')];}Report[_0xa672('0x11')][_0xa672('0x12')]=function(_0x11a41d){var _0x4bfd92=new VoiceQueueReport(this[_0xa672('0xe')]);var _0xcb9cc6=new VoiceAgentReport(this[_0xa672('0xe')]);var _0xaa6514=new VoiceDialReport(this['realtime']);var _0x4d1889=new VoiceCallReport(this[_0xa672('0xe')]);var _0x550968=new UserReport(this['realtime']);if(config[_0xa672('0x13')]&&config[_0xa672('0x13')]['disabled']){ami['on'](_0xa672('0x14'),this['voiceQueueReport'][_0xa672('0x15')](this));ami['on'](_0xa672('0x16'),this['voiceCallReport'][_0xa672('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0xa672('0x17')][_0xa672('0x15')](this));ami['on'](_0xa672('0x18'),this[_0xa672('0x19')][_0xa672('0x15')](this));ami['on'](_0xa672('0x1a'),this[_0xa672('0x1b')][_0xa672('0x15')](this));ami['on'](_0xa672('0x1c'),this[_0xa672('0x1d')]['bind'](this));}};Report[_0xa672('0x11')][_0xa672('0x1e')]=function(_0x21724e){var _0x42aba8;_0x42aba8=_['find'](this[_0xa672('0xf')],function(_0x1cf93e){return _0x1cf93e[_0xa672('0x1f')]==_0x21724e||_0x1cf93e[_0xa672('0x20')]==_0x21724e;});if(_[_0xa672('0x21')](_0x42aba8)){var _0x59db32=_[_0xa672('0x22')](this[_0xa672('0x10')],function(_0x405627){return _0x405627[_0xa672('0x1f')]==_0x21724e||_0x405627[_0xa672('0x20')]==_0x21724e;});if(_0x59db32){_0x42aba8=_['find'](this['agents'],function(_0x127210){return _0x127210[_0xa672('0x23')]==util[_0xa672('0x24')](_0xa672('0x25'),_0x59db32[_0xa672('0x20')]);});}}return _0x42aba8;};Report[_0xa672('0x11')]['voiceQueueReport']=function(_0x43694f){for(var _0x55d1f2=0x0;_0x55d1f2<_0x43694f[_0xa672('0x26')];_0x55d1f2+=0x1){var _0x5179a4=this['findAgent'](_0x43694f[_0x55d1f2][_0xa672('0x27')]);if(_0x5179a4){_0x43694f[_0x55d1f2]['accountcode']=_0x5179a4[_0xa672('0x1f')];_0x43694f[_0x55d1f2][_0xa672('0x28')]=!![];_0x43694f[_0x55d1f2]['lastAssignedTo']=_0x5179a4[_0xa672('0x20')];_0x43694f[_0x55d1f2][_0xa672('0x23')]=_[_0xa672('0x21')](_0x5179a4[_0xa672('0x23')])?util['format']('SIP/%s',_0x5179a4[_0xa672('0x20')]):_0x5179a4[_0xa672('0x23')];if(_0x43694f[_0x55d1f2][_0xa672('0x29')]){_0x43694f[_0x55d1f2][_0xa672('0x2a')]=moment()[_0xa672('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x43694f[_0x55d1f2][_0xa672('0x2b')]){_0x43694f[_0x55d1f2][_0xa672('0x2c')]=moment()[_0xa672('0x24')](_0xa672('0x2d'));}RpcMemberReport[_0xa672('0x2e')](_0x43694f[_0x55d1f2]);}RpcVoiceQueueReport[_0xa672('0x2f')](_0x43694f[_0x55d1f2]);}};function extractCalleridNumber(_0x22f71a){var _0x5f0353=_0x22f71a['match'](/<(.*?)>/);return _0x5f0353?_0x5f0353[0x1]:_0x22f71a;}Report[_0xa672('0x11')][_0xa672('0x30')]=function(_0xcc30a1){for(var _0x7c3ba8=0x0;_0x7c3ba8','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','getCallType','UserId','split','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','lodash','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','getAgentByInternal','keys'];(function(_0x32060f,_0x1ad0fc){var _0x4e0ade=function(_0x223b7f){while(--_0x223b7f){_0x32060f['push'](_0x32060f['shift']());}};_0x4e0ade(++_0x1ad0fc);}(_0xdf2d,0x88));var _0xddf2=function(_0x10776d,_0x340cae){_0x10776d=_0x10776d-0x0;var _0x1d0b9c=_0xdf2d[_0x10776d];return _0x1d0b9c;};'use strict';var _=require(_0xddf2('0x0'));var moment=require(_0xddf2('0x1'));var util=require(_0xddf2('0x2'));var config=require('../../../config/environment');var ami=require(_0xddf2('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xddf2('0x4'));var RpcVoiceDialReport=require(_0xddf2('0x5'));var RpcMemberReport=require(_0xddf2('0x6'));var RpcVoiceQueueReport=require(_0xddf2('0x7'));var RpcVoiceRecording=require(_0xddf2('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xddf2('0x9'));var VoiceCallReport=require(_0xddf2('0xa'));var VoiceAgentReport=require(_0xddf2('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xddf2('0xc'));function Report(_0x3a3732){this[_0xddf2('0xd')]=_0x3a3732;this[_0xddf2('0xe')]=_0x3a3732[_0xddf2('0xe')];this[_0xddf2('0xf')]=_0x3a3732[_0xddf2('0xf')];}Report[_0xddf2('0x10')][_0xddf2('0x11')]=function(_0xb763ca){var _0x2b31b7=new VoiceQueueReport(this[_0xddf2('0xd')]);var _0x905881=new VoiceAgentReport(this['realtime']);var _0x13e2a8=new VoiceDialReport(this[_0xddf2('0xd')]);var _0x199a16=new VoiceCallReport(this[_0xddf2('0xd')]);var _0x5209bf=new UserReport(this[_0xddf2('0xd')]);if(config[_0xddf2('0x12')]&&config[_0xddf2('0x12')][_0xddf2('0x13')]){ami['on'](_0xddf2('0x14'),this[_0xddf2('0x15')]['bind'](this));ami['on'](_0xddf2('0x16'),this[_0xddf2('0x17')][_0xddf2('0x18')](this));ami['on'](_0xddf2('0x19'),this[_0xddf2('0x1a')][_0xddf2('0x18')](this));ami['on'](_0xddf2('0x1b'),this[_0xddf2('0x1c')][_0xddf2('0x18')](this));ami['on'](_0xddf2('0x1d'),this[_0xddf2('0x1e')][_0xddf2('0x18')](this));ami['on']('attendedtransfer',this[_0xddf2('0x1f')][_0xddf2('0x18')](this));}};Report[_0xddf2('0x10')][_0xddf2('0x20')]=function(_0x4890d4){var _0x1c5a43;_0x1c5a43=_[_0xddf2('0x21')](this[_0xddf2('0xe')],function(_0x912c9a){return _0x912c9a[_0xddf2('0x22')]==_0x4890d4||_0x912c9a['name']==_0x4890d4;});if(_['isNil'](_0x1c5a43)){var _0x364991=_[_0xddf2('0x21')](this[_0xddf2('0xf')],function(_0x27f336){return _0x27f336[_0xddf2('0x22')]==_0x4890d4||_0x27f336[_0xddf2('0x23')]==_0x4890d4;});if(_0x364991){_0x1c5a43=_[_0xddf2('0x21')](this[_0xddf2('0xe')],function(_0x1eae77){return _0x1eae77[_0xddf2('0x24')]==util[_0xddf2('0x25')](_0xddf2('0x26'),_0x364991['name']);});}}return _0x1c5a43;};Report[_0xddf2('0x10')][_0xddf2('0x15')]=function(_0x7c171e){for(var _0x209d14=0x0;_0x209d14<_0x7c171e[_0xddf2('0x27')];_0x209d14+=0x1){var _0x1a2502=this['findAgent'](_0x7c171e[_0x209d14][_0xddf2('0x28')]);if(_0x1a2502){_0x7c171e[_0x209d14][_0xddf2('0x22')]=_0x1a2502[_0xddf2('0x22')];_0x7c171e[_0x209d14][_0xddf2('0x29')]=!![];_0x7c171e[_0x209d14][_0xddf2('0x2a')]=_0x1a2502['name'];_0x7c171e[_0x209d14][_0xddf2('0x24')]=_[_0xddf2('0x2b')](_0x1a2502[_0xddf2('0x24')])?util['format'](_0xddf2('0x26'),_0x1a2502[_0xddf2('0x23')]):_0x1a2502['interface'];if(_0x7c171e[_0x209d14]['queuecallercomplete']){_0x7c171e[_0x209d14][_0xddf2('0x2c')]=moment()[_0xddf2('0x25')](_0xddf2('0x2d'));}if(_0x7c171e[_0x209d14][_0xddf2('0x2e')]){_0x7c171e[_0x209d14][_0xddf2('0x2f')]=moment()[_0xddf2('0x25')](_0xddf2('0x2d'));}RpcMemberReport[_0xddf2('0x15')](_0x7c171e[_0x209d14]);}RpcVoiceQueueReport['create'](_0x7c171e[_0x209d14]);}};function extractCalleridNumber(_0x91de5f){var _0x355a02=_0x91de5f['match'](/<(.*?)>/);return _0x355a02?_0x355a02[0x1]:_0x91de5f;}Report['prototype'][_0xddf2('0x30')]=function(_0x2d8d03){for(var _0x122b44=0x0;_0x122b440x0?_0x7718a9:0x0;this[_0xb805('0x11')][_0x51ae06[_0xb805('0x68')]][_0xb805('0x2c')]=this[_0xb805('0x11')][_0x51ae06[_0xb805('0x68')]]['talking']>_[_0xb805('0x6c')](_0x51ae06[_0xb805('0x6e')])?_[_0xb805('0x6c')](_0x51ae06[_0xb805('0x6e')]):this['voiceQueues'][_0x51ae06[_0xb805('0x68')]][_0xb805('0x2c')];this[_0xb805('0x4f')](this[_0xb805('0x11')][_0x51ae06['queue']],_0xb805('0x6f'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xb805('0x37')](this[_0xb805('0x11')][_0x51ae06['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xb805('0x70'),this[_0xb805('0x11')][_0x51ae06[_0xb805('0x68')]]);}}}catch(_0x4a886a){logger[_0xb805('0x35')](_0xb805('0x67'),util[_0xb805('0x37')](_0x4a886a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb805('0x71')]=function(_0x30e9ff){logger[_0xb805('0x5f')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xb805('0x37')](_0x30e9ff,{'showHidden':![],'depth':null}));this[_0xb805('0x12')]=!![];};VoiceQueueReport[_0xb805('0xa')][_0xb805('0x17')]=function(_0x3996f3){try{if(this[_0xb805('0x62')](_0x3996f3)){logger[_0xb805('0x5f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3996f3['uniqueid'],util[_0xb805('0x37')](_0x3996f3,{'showHidden':![],'depth':null}));if(_[_0xb805('0x63')](this['queueReports'][_0x3996f3['uniqueid']]))this[_0xb805('0x38')][_0x3996f3[_0xb805('0x42')]]=[];if(_[_0xb805('0x63')](this['channels'][_0x3996f3[_0xb805('0x42')]]))this[_0xb805('0xf')][_0x3996f3[_0xb805('0x42')]]={};var _0x46f4ae=new QueueReport();_0x46f4ae[_0xb805('0x4c')]=_0x3996f3[_0xb805('0x68')];_0x46f4ae[_0xb805('0x50')]=this[_0xb805('0x11')][_0x46f4ae[_0xb805('0x4c')]]&&this[_0xb805('0x11')][_0x46f4ae[_0xb805('0x4c')]][_0xb805('0x50')]?this[_0xb805('0x11')][_0x46f4ae['name']][_0xb805('0x50')]||_0xb805('0x51'):_0xb805('0x51');_0x46f4ae['queue']=_0x3996f3[_0xb805('0x68')];_0x46f4ae['queuecallerjoinAt']=moment()[_0xb805('0x4b')](_0xb805('0x72'));_0x46f4ae[_0xb805('0x73')]=_0x3996f3[_0xb805('0x73')];_0x46f4ae[_0xb805('0x74')]=_0x3996f3[_0xb805('0x74')];_0x46f4ae['uniqueid']=_0x3996f3[_0xb805('0x42')];_0x46f4ae['routealias']=this[_0xb805('0xf')][_0x3996f3[_0xb805('0x42')]][_0xb805('0x75')];logger[_0xb805('0x76')](_0xb805('0x77'),_0x46f4ae[_0xb805('0x4c')],_0x46f4ae[_0xb805('0x50')]);_[_0xb805('0x78')](_0x46f4ae,_[_0xb805('0x79')](_0x3996f3,_[_0xb805('0x7a')](_0x46f4ae)));this['queueReports'][_0x3996f3[_0xb805('0x42')]][_0xb805('0x7b')](_0x46f4ae);this[_0xb805('0xf')][_0x3996f3[_0xb805('0x42')]]=_0x46f4ae;this[_0xb805('0x3f')](_0x46f4ae,_0xb805('0x7c'));}}catch(_0x5c42d1){logger['error'](_0xb805('0x7d'),_0x3996f3[_0xb805('0x42')],util['inspect'](_0x5c42d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')][_0xb805('0x7e')]=function(_0x426097){try{if(this[_0xb805('0x62')](_0x426097)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x426097['uniqueid'],util[_0xb805('0x37')](_0x426097,{'showHidden':![],'depth':null}));if(this[_0xb805('0x38')][_0x426097['uniqueid']]){var _0x334228=_[_0xb805('0x7f')](this[_0xb805('0x38')][_0x426097[_0xb805('0x42')]]);_0x334228[_0xb805('0x80')]=![];_0x334228['queuecallercompleteAt']=null;_0x334228[_0xb805('0x81')]=_0x426097[_0xb805('0x81')];_0x334228['originalposition']=_0x426097[_0xb805('0x82')];_0x334228[_0xb805('0x18')]=!![];_0x334228[_0xb805('0x83')]=moment()[_0xb805('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x334228[_0xb805('0x49')]=_0xb805('0x84');_0x334228[_0xb805('0x85')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x334228[_0xb805('0x4c')],_0x334228[_0xb805('0x50')]);this[_0xb805('0xf')][_0x426097[_0xb805('0x42')]]=_0x334228;this[_0xb805('0x47')](_0x334228,_0xb805('0x18'));}}}catch(_0x2b4278){logger['error'](_0xb805('0x86'),_0x426097[_0xb805('0x42')],util['inspect'](_0x2b4278,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')]['syncQueueCallerLeave']=function(_0x276cc8){try{if(this[_0xb805('0x62')](_0x276cc8)){logger[_0xb805('0x5f')](_0xb805('0x87'),_0x276cc8[_0xb805('0x42')],util[_0xb805('0x37')](_0x276cc8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x276cc8[_0xb805('0x42')]]){var _0x50ea02=_['last'](this[_0xb805('0x38')][_0x276cc8[_0xb805('0x42')]]);_0x50ea02['queuecallerleaveAt']=moment()['format'](_0xb805('0x72'));_0x50ea02['connectedlinenum']=_0x276cc8['connectedlinenum'];_0x50ea02[_0xb805('0x88')]=_0x276cc8[_0xb805('0x88')];logger['info'](_0xb805('0x89'),_0x50ea02[_0xb805('0x4c')],_0x50ea02[_0xb805('0x50')],_0x276cc8[_0xb805('0x8a')],_0x276cc8[_0xb805('0x88')]);this[_0xb805('0xf')][_0x276cc8[_0xb805('0x42')]]=_0x50ea02;this[_0xb805('0x3f')](_0x50ea02,_0xb805('0x19'));}}}catch(_0xb5fe13){logger[_0xb805('0x35')](_0xb805('0x87'),_0x276cc8['uniqueid'],util[_0xb805('0x37')](_0xb5fe13,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')][_0xb805('0x1d')]=function(_0x462218){try{if(this[_0xb805('0x62')](_0x462218)){logger[_0xb805('0x5f')]('[%s][voiceQueueReport][agentconnect]',_0x462218[_0xb805('0x42')],util[_0xb805('0x37')](_0x462218,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x462218[_0xb805('0x42')]]){var _0x4663de=_['last'](this[_0xb805('0x38')][_0x462218['uniqueid']]);_0x4663de[_0xb805('0x80')]=!![];_0x4663de['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xb805('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4663de['name'],_0x4663de['type']);}}}catch(_0x56ca9f){logger[_0xb805('0x35')](_0xb805('0x8b'),_0x462218[_0xb805('0x42')],util[_0xb805('0x37')](_0x56ca9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')][_0xb805('0x1b')]=function(_0x536da9){try{if(this[_0xb805('0x62')](_0x536da9)){logger[_0xb805('0x5f')](_0xb805('0x8c'),_0x536da9['uniqueid'],util['inspect'](_0x536da9,{'showHidden':![],'depth':null}));if(this[_0xb805('0x38')][_0x536da9[_0xb805('0x42')]]){var _0x450720=_[_0xb805('0x7f')](this[_0xb805('0x38')][_0x536da9[_0xb805('0x42')]]);_0x450720['queuecallerabandon']=![];_0x450720[_0xb805('0x83')]=null;_0x450720['assigned']=!![];_0x450720[_0xb805('0x85')]=_0x536da9[_0xb805('0x8d')];_0x450720['holdtime']=_0x536da9['holdtime'];_0x450720['queuecallercomplete']=!![];_0x450720[_0xb805('0x8e')]=![];_0x450720[_0xb805('0x8f')]=null;if(!_0x450720['transfer']){if(_0x536da9[_0xb805('0x90')]==_0xb805('0x91')){_0x450720[_0xb805('0x49')]='COMPLETED';logger[_0xb805('0x76')](_0xb805('0x92'),_0x450720[_0xb805('0x4c')],_0x450720['type']);}else{if(_['startsWith'](_0x536da9['channel'][_0xb805('0x93')](),'local/')){if(this[_0xb805('0x38')][_0x536da9[_0xb805('0x94')]]){var _0x308204=_['last'](this[_0xb805('0x38')][_0x536da9[_0xb805('0x94')]]);_0x308204[_0xb805('0x80')]=![];_0x308204['queuecallerexit']=!![];_0x308204[_0xb805('0x8f')]=moment(_0x450720[_0xb805('0x95')])[_0xb805('0x96')](_0x536da9[_0xb805('0x81')],_0xb805('0x97'))[_0xb805('0x4b')](_0xb805('0x72'));_0x308204[_0xb805('0x49')]=_0xb805('0x98');_0x308204['transfer']=!![];_0x308204[_0xb805('0x99')]=_0xb805('0x9a');_0x308204['transferexten']=_0x536da9[_0xb805('0x9b')];_0x308204[_0xb805('0x9c')]=_0x536da9[_0xb805('0x42')];logger[_0xb805('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x308204[_0xb805('0x4c')],_0x308204[_0xb805('0x50')]);var _0x54ae09=this[_0xb805('0x38')][_0x536da9['linkedid']];this[_0xb805('0x38')][_0x536da9['linkedid']]=this[_0xb805('0x38')][_0x536da9[_0xb805('0x42')]];this[_0xb805('0x38')][_0x536da9[_0xb805('0x42')]]=_0x54ae09;}}else{_0x450720[_0xb805('0x49')]=_0xb805('0x9d')+_0x536da9[_0xb805('0x90')][_0xb805('0x9e')]();logger[_0xb805('0x76')](_0xb805('0x9f'),_0x450720['name'],_0x450720[_0xb805('0x50')],_0x450720[_0xb805('0x49')]);}}}this['channels'][_0x536da9[_0xb805('0x42')]]=_0x450720;this[_0xb805('0x47')](_0x450720,'agentcomplete');}}}catch(_0x27a34d){logger[_0xb805('0x35')](_0xb805('0x8c'),_0x536da9['uniqueid'],util[_0xb805('0x37')](_0x27a34d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')][_0xb805('0x1f')]=function(_0x4a549e){try{if(this[_0xb805('0x62')](_0x4a549e)){logger[_0xb805('0x5f')](_0xb805('0xa0'),_0x4a549e[_0xb805('0x42')],util[_0xb805('0x37')](_0x4a549e,{'showHidden':![],'depth':null}));this['addVariable'](_0x4a549e[_0xb805('0x42')],_[_0xb805('0x7a')](_0x4a549e[_0xb805('0xa1')])[0x0],_0x4a549e[_0xb805('0xa2')]);if(this[_0xb805('0x38')][_0x4a549e[_0xb805('0x42')]]){var _0x25a27c=_[_0xb805('0x7f')](this[_0xb805('0x38')][_0x4a549e[_0xb805('0x42')]]);if(_0x25a27c){if(this[_0xb805('0x62')](_0x4a549e[_0xb805('0xa1')])&&this[_0xb805('0x62')](_0x4a549e[_0xb805('0xa1')][_0xb805('0xa3')])){switch(_0x4a549e[_0xb805('0xa2')]){case'CONTINUE':_0x25a27c['queuecallerexit']=![];_0x25a27c[_0xb805('0x8f')]=null;break;case'TIMEOUT':_0x25a27c[_0xb805('0xa4')]=_0xb805('0xa5');_0x25a27c[_0xb805('0x8e')]=!![];_0x25a27c[_0xb805('0x8f')]=moment()[_0xb805('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x25a27c[_0xb805('0xa6')]=moment()['format'](_0xb805('0x72'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4a549e[_0xb805('0x42')],util['inspect'](_0x25a27c,{'showHidden':![],'depth':null}));ami[_0xb805('0x43')](_0xb805('0xa7'),_0x25a27c);break;default:_0x25a27c[_0xb805('0x8e')]=!![];_0x25a27c[_0xb805('0x8f')]=moment()[_0xb805('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x25a27c[_0xb805('0xa6')]=moment()[_0xb805('0x4b')](_0xb805('0x72'));}_0x25a27c[_0xb805('0x18')]=![];_0x25a27c[_0xb805('0x83')]=null;_0x25a27c[_0xb805('0x49')]=_0x4a549e[_0xb805('0xa2')];this['channels'][_0x4a549e[_0xb805('0x42')]]=_0x25a27c;this['emitVoiceQueueChannelRemove'](_0x25a27c,_0xb805('0x1e'));}else if(this['isNotNull'](_0x4a549e[_0xb805('0xa1')])&&this['isNotNull'](_0x4a549e[_0xb805('0xa1')][_0xb805('0xa8')])){if(!_0x25a27c[_0xb805('0x18')]){_0x25a27c[_0xb805('0x8e')]=!![];_0x25a27c['queuecallerexitAt']=moment()[_0xb805('0x4b')](_0xb805('0x72'));_0x25a27c[_0xb805('0x49')]=_0xb805('0xa9');_0x25a27c[_0xb805('0xa6')]=moment()[_0xb805('0x4b')](_0xb805('0x72'));this[_0xb805('0xf')][_0x4a549e[_0xb805('0x42')]]=_0x25a27c;}}logger[_0xb805('0x76')](_0xb805('0xaa'),_0x4a549e[_0xb805('0x42')],_0x25a27c[_0xb805('0x4c')],_0x25a27c[_0xb805('0x50')],_[_0xb805('0x7a')](_0x4a549e['variable'])[0x0],_0x4a549e[_0xb805('0xa2')]);_0x25a27c['variables']=this[_0xb805('0x14')][_0x4a549e[_0xb805('0x42')]];}}}}catch(_0x50d5e0){logger[_0xb805('0x35')]('[%s][voiceQueueReport][varset]',_0x4a549e[_0xb805('0x42')],util[_0xb805('0x37')](_0x50d5e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb805('0xa')][_0xb805('0xab')]=function(_0x31f1fe,_0x45b720,_0x53255b){var _0xa4cee3=['rtpaudioqos',_0xb805('0xac'),_0xb805('0xad'),'rtpaudioqosjitterbridged',_0xb805('0xae'),_0xb805('0xaf'),_0xb805('0xb0'),_0xb805('0xb1'),_0xb805('0xb2'),'sipuri','bridgepeer',_0xb805('0xb3'),_0xb805('0xb4'),_0xb805('0xb5'),_0xb805('0xb6'),_0xb805('0xb7'),_0xb805('0x8d'),_0xb805('0xb8'),_0xb805('0xb9')];if(!_[_0xb805('0x30')](_0x45b720)&&!_[_0xb805('0xba')](_0xa4cee3,_0x45b720)){if(_[_0xb805('0x63')](this[_0xb805('0x14')][_0x31f1fe])){this['variables'][_0x31f1fe]={};}this['variables'][_0x31f1fe][_0x45b720]=_0x53255b;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x18fad4){try{if(this[_0xb805('0x62')](_0x18fad4)){logger[_0xb805('0x5f')](_0xb805('0xbb'),_0x18fad4['uniqueid'],util[_0xb805('0x37')](_0x18fad4,{'showHidden':![],'depth':null}));if(this[_0xb805('0x38')][_0x18fad4[_0xb805('0x42')]]){for(var _0x841e6d=0x0,_0x3fcd74={};_0x841e6d0x0?_0x1862a8:0x0;this[_0xc01e('0x16')][_0x375b10[_0xc01e('0x75')]][_0xc01e('0x60')]=this['voiceQueues'][_0x375b10[_0xc01e('0x75')]][_0xc01e('0x60')]>_[_0xc01e('0x7a')](_0x375b10[_0xc01e('0x7c')])?_[_0xc01e('0x7a')](_0x375b10[_0xc01e('0x7c')]):this['voiceQueues'][_0x375b10[_0xc01e('0x75')]][_0xc01e('0x60')];this[_0xc01e('0x59')](this['voiceQueues'][_0x375b10['queue']],_0xc01e('0x18'));}logger[_0xc01e('0x4b')](_0xc01e('0x7d'),util['inspect'](this[_0xc01e('0x16')][_0x375b10[_0xc01e('0x75')]],{'showHidden':![],'depth':null}));ami[_0xc01e('0x4a')](_0xc01e('0x7e'),this['voiceQueues'][_0x375b10[_0xc01e('0x75')]]);}}}catch(_0x5e68b8){logger['error'](_0xc01e('0x73'),util['inspect'](_0x5e68b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc01e('0x1c')]=function(_0x1dd7e9){logger[_0xc01e('0x4b')](_0xc01e('0x7f'),util[_0xc01e('0x43')](_0x1dd7e9,{'showHidden':![],'depth':null}));this[_0xc01e('0x71')]=!![];};VoiceQueueReport[_0xc01e('0xd')][_0xc01e('0x1e')]=function(_0x235e94){try{if(this[_0xc01e('0x6c')](_0x235e94)){logger[_0xc01e('0x4b')](_0xc01e('0x80'),_0x235e94[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x235e94,{'showHidden':![],'depth':null}));if(_[_0xc01e('0x6d')](this[_0xc01e('0x12')][_0x235e94['uniqueid']]))this['queueReports'][_0x235e94[_0xc01e('0x4e')]]=[];if(_['isUndefined'](this[_0xc01e('0x14')][_0x235e94['uniqueid']]))this[_0xc01e('0x14')][_0x235e94['uniqueid']]={};var _0x127c26=new QueueReport();_0x127c26[_0xc01e('0x56')]=_0x235e94[_0xc01e('0x75')];_0x127c26[_0xc01e('0x5a')]=this[_0xc01e('0x16')][_0x127c26[_0xc01e('0x56')]]&&this[_0xc01e('0x16')][_0x127c26[_0xc01e('0x56')]][_0xc01e('0x5a')]?this[_0xc01e('0x16')][_0x127c26[_0xc01e('0x56')]][_0xc01e('0x5a')]||_0xc01e('0x5b'):_0xc01e('0x5b');_0x127c26[_0xc01e('0x75')]=_0x235e94[_0xc01e('0x75')];_0x127c26['queuecallerjoinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x127c26['position']=_0x235e94[_0xc01e('0x81')];_0x127c26['count']=_0x235e94[_0xc01e('0x82')];_0x127c26[_0xc01e('0x4e')]=_0x235e94[_0xc01e('0x4e')];_0x127c26['routealias']=this[_0xc01e('0x14')][_0x235e94['uniqueid']][_0xc01e('0x83')];logger[_0xc01e('0x76')](_0xc01e('0x84'),_0x127c26[_0xc01e('0x56')],_0x127c26[_0xc01e('0x5a')]);_[_0xc01e('0x85')](_0x127c26,_[_0xc01e('0x86')](_0x235e94,_[_0xc01e('0x87')](_0x127c26)));this[_0xc01e('0x12')][_0x235e94[_0xc01e('0x4e')]][_0xc01e('0x88')](_0x127c26);this[_0xc01e('0x14')][_0x235e94[_0xc01e('0x4e')]]=_0x127c26;this['emitVoiceQueueChannelSave'](_0x127c26,_0xc01e('0x1d'));}}catch(_0x7b1c32){logger[_0xc01e('0x41')](_0xc01e('0x80'),_0x235e94['uniqueid'],util[_0xc01e('0x43')](_0x7b1c32,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc01e('0x89')]=function(_0x44a609){try{if(this['isNotNull'](_0x44a609)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x44a609[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x44a609,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44a609['uniqueid']]){var _0x47fe18=_[_0xc01e('0x8a')](this[_0xc01e('0x12')][_0x44a609[_0xc01e('0x4e')]]);_0x47fe18[_0xc01e('0x8b')]=![];_0x47fe18[_0xc01e('0x8c')]=null;_0x47fe18[_0xc01e('0x8d')]=_0x44a609[_0xc01e('0x8d')];_0x47fe18[_0xc01e('0x8e')]=_0x44a609[_0xc01e('0x8e')];_0x47fe18[_0xc01e('0x1f')]=!![];_0x47fe18[_0xc01e('0x8f')]=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));_0x47fe18['queuecallerexitreason']=_0xc01e('0x91');_0x47fe18[_0xc01e('0x92')]=null;logger[_0xc01e('0x76')](_0xc01e('0x93'),_0x47fe18[_0xc01e('0x56')],_0x47fe18['type']);this['channels'][_0x44a609['uniqueid']]=_0x47fe18;this[_0xc01e('0x52')](_0x47fe18,_0xc01e('0x1f'));}}}catch(_0x491f48){logger['error'](_0xc01e('0x94'),_0x44a609['uniqueid'],util['inspect'](_0x491f48,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc01e('0xd')][_0xc01e('0x21')]=function(_0x33dd6e){try{if(this[_0xc01e('0x6c')](_0x33dd6e)){logger[_0xc01e('0x4b')]('[%s][voiceQueueReport][queuecallerleave]',_0x33dd6e[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x33dd6e,{'showHidden':![],'depth':null}));if(this[_0xc01e('0x12')][_0x33dd6e['uniqueid']]){var _0x3f51c0=_[_0xc01e('0x8a')](this[_0xc01e('0x12')][_0x33dd6e[_0xc01e('0x4e')]]);_0x3f51c0['queuecallerleaveAt']=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));_0x3f51c0[_0xc01e('0x95')]=_0x33dd6e[_0xc01e('0x95')];_0x3f51c0[_0xc01e('0x96')]=_0x33dd6e[_0xc01e('0x96')];logger['info'](_0xc01e('0x97'),_0x3f51c0[_0xc01e('0x56')],_0x3f51c0[_0xc01e('0x5a')],_0x33dd6e[_0xc01e('0x95')],_0x33dd6e[_0xc01e('0x96')]);this[_0xc01e('0x14')][_0x33dd6e[_0xc01e('0x4e')]]=_0x3f51c0;this[_0xc01e('0x98')](_0x3f51c0,'queuecallerleave');}}}catch(_0x197686){logger[_0xc01e('0x41')](_0xc01e('0x99'),_0x33dd6e[_0xc01e('0x4e')],util['inspect'](_0x197686,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc01e('0xd')]['syncAgentConnect']=function(_0xe80801){try{if(this[_0xc01e('0x6c')](_0xe80801)){logger['debug'](_0xc01e('0x9a'),_0xe80801[_0xc01e('0x4e')],util['inspect'](_0xe80801,{'showHidden':![],'depth':null}));if(this[_0xc01e('0x12')][_0xe80801['uniqueid']]){var _0x55dd99=_[_0xc01e('0x8a')](this[_0xc01e('0x12')][_0xe80801['uniqueid']]);_0x55dd99[_0xc01e('0x8b')]=!![];_0x55dd99['queuecallerexitreason']=_0xc01e('0x9b');logger['info'](_0xc01e('0x9c'),_0x55dd99[_0xc01e('0x56')],_0x55dd99[_0xc01e('0x5a')]);}}}catch(_0x5163e2){logger[_0xc01e('0x41')](_0xc01e('0x9a'),_0xe80801[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x5163e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc01e('0xd')][_0xc01e('0x22')]=function(_0x4da88b){try{if(this[_0xc01e('0x6c')](_0x4da88b)){logger[_0xc01e('0x4b')](_0xc01e('0x9d'),_0x4da88b[_0xc01e('0x4e')],util['inspect'](_0x4da88b,{'showHidden':![],'depth':null}));if(this[_0xc01e('0x12')][_0x4da88b['uniqueid']]){var _0x3a35ca=_[_0xc01e('0x8a')](this[_0xc01e('0x12')][_0x4da88b[_0xc01e('0x4e')]]);_0x3a35ca[_0xc01e('0x1f')]=![];_0x3a35ca[_0xc01e('0x8f')]=null;_0x3a35ca[_0xc01e('0x9e')]=!![];_0x3a35ca['lastAssignedTo']=_0x4da88b[_0xc01e('0x9f')];_0x3a35ca[_0xc01e('0x8d')]=_0x4da88b[_0xc01e('0x8d')];_0x3a35ca[_0xc01e('0x8b')]=!![];_0x3a35ca[_0xc01e('0xa0')]=![];_0x3a35ca['queuecallerexitAt']=null;if(!_0x3a35ca[_0xc01e('0xa1')]){if(_0x4da88b['reason']==_0xc01e('0xa1')){_0x3a35ca[_0xc01e('0x54')]=_0xc01e('0xa2');logger[_0xc01e('0x76')](_0xc01e('0xa3'),_0x3a35ca[_0xc01e('0x56')],_0x3a35ca[_0xc01e('0x5a')]);}else{if(_['startsWith'](_0x4da88b[_0xc01e('0x3e')]['toLowerCase'](),_0xc01e('0xa4'))){if(this['queueReports'][_0x4da88b[_0xc01e('0xa5')]]){var _0x1c64d4=_[_0xc01e('0x8a')](this[_0xc01e('0x12')][_0x4da88b[_0xc01e('0xa5')]]);_0x1c64d4[_0xc01e('0x8b')]=![];_0x1c64d4[_0xc01e('0xa0')]=!![];_0x1c64d4['queuecallerexitAt']=moment(_0x3a35ca[_0xc01e('0xa6')])[_0xc01e('0xa7')](_0x4da88b[_0xc01e('0x8d')],_0xc01e('0xa8'))[_0xc01e('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c64d4['queuecallerexitreason']='FORWARDTRANSFER';_0x1c64d4['transfer']=!![];_0x1c64d4['transfertype']=_0xc01e('0xa9');_0x1c64d4[_0xc01e('0xaa')]=_0x4da88b['destexten'];_0x1c64d4[_0xc01e('0xab')]=_0x4da88b[_0xc01e('0x4e')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1c64d4[_0xc01e('0x56')],_0x1c64d4[_0xc01e('0x5a')]);var _0x2f56b5=this['queueReports'][_0x4da88b[_0xc01e('0xa5')]];this[_0xc01e('0x12')][_0x4da88b['linkedid']]=this[_0xc01e('0x12')][_0x4da88b[_0xc01e('0x4e')]];this[_0xc01e('0x12')][_0x4da88b[_0xc01e('0x4e')]]=_0x2f56b5;}}else{_0x3a35ca['queuecallerexitreason']='COMPLETEDBY'+_0x4da88b[_0xc01e('0xac')][_0xc01e('0xad')]();logger[_0xc01e('0x76')](_0xc01e('0xae'),_0x3a35ca[_0xc01e('0x56')],_0x3a35ca[_0xc01e('0x5a')],_0x3a35ca['queuecallerexitreason']);}}}this[_0xc01e('0x14')][_0x4da88b[_0xc01e('0x4e')]]=_0x3a35ca;this[_0xc01e('0x52')](_0x3a35ca,_0xc01e('0xaf'));}}}catch(_0xa87f4c){logger[_0xc01e('0x41')](_0xc01e('0x9d'),_0x4da88b[_0xc01e('0x4e')],util['inspect'](_0xa87f4c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc01e('0xd')]['syncVarSet']=function(_0x1b48ef){try{if(this['isNotNull'](_0x1b48ef)){logger[_0xc01e('0x4b')](_0xc01e('0xb0'),_0x1b48ef[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x1b48ef,{'showHidden':![],'depth':null}));this[_0xc01e('0xb1')](_0x1b48ef[_0xc01e('0x4e')],_['keys'](_0x1b48ef[_0xc01e('0xb2')])[0x0],_0x1b48ef[_0xc01e('0xb3')]);if(this[_0xc01e('0x12')][_0x1b48ef[_0xc01e('0x4e')]]){var _0x4ed659=_['last'](this[_0xc01e('0x12')][_0x1b48ef['uniqueid']]);if(_0x4ed659){if(this['isNotNull'](_0x1b48ef[_0xc01e('0xb2')])&&this[_0xc01e('0x6c')](_0x1b48ef[_0xc01e('0xb2')][_0xc01e('0xb4')])){switch(_0x1b48ef['value']){case _0xc01e('0xb5'):_0x4ed659['queuecallerexit']=![];_0x4ed659[_0xc01e('0xb6')]=null;break;case _0xc01e('0xb7'):_0x4ed659[_0xc01e('0xb8')]=_0xc01e('0xb9');_0x4ed659[_0xc01e('0xa0')]=!![];_0x4ed659[_0xc01e('0xb6')]=moment()['format'](_0xc01e('0x90'));_0x4ed659[_0xc01e('0xba')]=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));logger[_0xc01e('0x4b')](_0xc01e('0xbb'),_0x1b48ef['uniqueid'],util[_0xc01e('0x43')](_0x4ed659,{'showHidden':![],'depth':null}));ami[_0xc01e('0x4a')](_0xc01e('0xbc'),_0x4ed659);break;default:_0x4ed659[_0xc01e('0xa0')]=!![];_0x4ed659[_0xc01e('0xb6')]=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));_0x4ed659[_0xc01e('0xba')]=moment()[_0xc01e('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ed659[_0xc01e('0x1f')]=![];_0x4ed659[_0xc01e('0x8f')]=null;_0x4ed659['queuecallerexitreason']=_0x1b48ef[_0xc01e('0xb3')];this['channels'][_0x1b48ef[_0xc01e('0x4e')]]=_0x4ed659;this['emitVoiceQueueChannelRemove'](_0x4ed659,_0xc01e('0x25'));}else if(this[_0xc01e('0x6c')](_0x1b48ef[_0xc01e('0xb2')])&&this[_0xc01e('0x6c')](_0x1b48ef[_0xc01e('0xb2')][_0xc01e('0xbd')])){if(!_0x4ed659['queuecallerabandon']){_0x4ed659[_0xc01e('0xa0')]=!![];_0x4ed659[_0xc01e('0xb6')]=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));_0x4ed659['queuecallerexitreason']=_0xc01e('0xbe');_0x4ed659[_0xc01e('0xba')]=moment()[_0xc01e('0x4f')](_0xc01e('0x90'));this[_0xc01e('0x14')][_0x1b48ef[_0xc01e('0x4e')]]=_0x4ed659;}}logger[_0xc01e('0x76')](_0xc01e('0xbf'),_0x1b48ef[_0xc01e('0x4e')],_0x4ed659[_0xc01e('0x56')],_0x4ed659['type'],_['keys'](_0x1b48ef['variable'])[0x0],_0x1b48ef[_0xc01e('0xb3')]);_0x4ed659[_0xc01e('0x45')]=this[_0xc01e('0x45')][_0x1b48ef[_0xc01e('0x4e')]];}}}}catch(_0x436890){logger['error'](_0xc01e('0xb0'),_0x1b48ef[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x436890,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc01e('0xd')][_0xc01e('0xb1')]=function(_0x5511a0,_0x597f13,_0x498635){var _0x19229c=[_0xc01e('0xc0'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xc01e('0xc1'),'rtpaudioqosloss',_0xc01e('0xc2'),_0xc01e('0xc3'),'rtpaudioqosrttbridged',_0xc01e('0xc4'),_0xc01e('0xc5'),_0xc01e('0xc6'),_0xc01e('0xc7'),'membercalls',_0xc01e('0xc8'),_0xc01e('0xc9'),_0xc01e('0xca'),_0xc01e('0x9f'),_0xc01e('0xcb'),_0xc01e('0xcc')];if(!_[_0xc01e('0x3c')](_0x597f13)&&!_[_0xc01e('0xcd')](_0x19229c,_0x597f13)){if(_['isUndefined'](this[_0xc01e('0x45')][_0x5511a0])){this[_0xc01e('0x45')][_0x5511a0]={};}this[_0xc01e('0x45')][_0x5511a0][_0x597f13]=_0x498635;}};VoiceQueueReport[_0xc01e('0xd')][_0xc01e('0x28')]=function(_0x18ab17){try{if(this[_0xc01e('0x6c')](_0x18ab17)){logger['debug'](_0xc01e('0xce'),_0x18ab17[_0xc01e('0x4e')],util[_0xc01e('0x43')](_0x18ab17,{'showHidden':![],'depth':null}));if(this[_0xc01e('0x12')][_0x18ab17[_0xc01e('0x4e')]]){for(var _0x328925=0x0,_0x234d40={};_0x328925=0x0?moment(_0x1acd38['endtime'])[_0xff9a('0xf')](_0x1acd38[_0xff9a('0x1c')],_0xff9a('0x10')):null,'data1':_0xff9a('0x1d'),'data2':_0x1acd38[_0xff9a('0x16')],'data3':_0x1acd38[_0xff9a('0x13')],'data4':_0x1acd38[_0xff9a('0x1e')]||null,'role':'agent','internal':_0x1acd38[_0xff9a('0x16')]?_[_0xff9a('0x17')](_0x1acd38['accountcode']):undefined,'uniqueid':_0x1acd38[_0xff9a('0x1f')]},'log':_0xff9a('0x7')});}; \ No newline at end of file +var _0xd630=['../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','voice','endtime','outbound','exten','moment','lodash','util'];(function(_0x5b19ae,_0x2fef9e){var _0x367f6a=function(_0x1bcbf1){while(--_0x1bcbf1){_0x5b19ae['push'](_0x5b19ae['shift']());}};_0x367f6a(++_0x2fef9e);}(_0xd630,0xed));var _0x0d63=function(_0x225b89,_0xf48a7){_0x225b89=_0x225b89-0x0;var _0x4eb12f=_0xd630[_0x225b89];return _0x4eb12f;};'use strict';var moment=require(_0x0d63('0x0'));var _=require(_0x0d63('0x1'));var util=require(_0x0d63('0x2'));var client=require(_0x0d63('0x3'));exports[_0x0d63('0x4')]=function(_0xd902cb){var _0x3c9e70=_0xd902cb[_0x0d63('0x5')]||_0xd902cb[_0x0d63('0x6')];return client[_0x0d63('0x7')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0xd902cb[_0x0d63('0x8')],'interface':_[_0x0d63('0x9')](_0xd902cb[_0x0d63('0xa')])?util[_0x0d63('0xb')](_0x0d63('0xc'),_0xd902cb[_0x0d63('0x8')]):_0xd902cb[_0x0d63('0xa')],'type':_0x0d63('0xd'),'enterAt':_0xd902cb[_0x0d63('0xe')],'exitAt':_0x3c9e70,'duration':moment(_0x3c9e70)[_0x0d63('0xf')](_0xd902cb['queuecallerleaveAt'],_0x0d63('0x10')),'data1':_0x0d63('0x11'),'data2':_0xd902cb[_0x0d63('0x12')],'data3':_0xd902cb['exten'],'data4':null,'data5':_0xd902cb[_0x0d63('0x13')],'role':_0x0d63('0x14'),'internal':_0xd902cb[_0x0d63('0x15')]?_[_0x0d63('0x16')](_0xd902cb[_0x0d63('0x15')]):undefined,'uniqueid':_0xd902cb[_0x0d63('0x17')]},'log':_0x0d63('0x18')});};exports[_0x0d63('0x19')]=function(_0x299685){return client['Request'](_0x0d63('0x18'),{'body':{'channel':_0x0d63('0x1a'),'membername':_0x299685['membername'],'interface':_0x299685[_0x0d63('0xa')],'type':_0x0d63('0xd'),'enterAt':_0x299685['starttime'],'exitAt':_0x299685[_0x0d63('0x1b')],'duration':moment(_0x299685[_0x0d63('0x1b')])['diff'](_0x299685['starttime'],_0x0d63('0x10'))>=0x0?moment(_0x299685[_0x0d63('0x1b')])[_0x0d63('0xf')](_0x299685['starttime'],'seconds'):null,'data1':_0x0d63('0x1c'),'data2':_0x299685[_0x0d63('0x15')],'data3':_0x299685[_0x0d63('0x1d')],'data4':_0x299685['dialstring']||null,'role':_0x0d63('0x14'),'internal':_0x299685['accountcode']?_[_0x0d63('0x16')](_0x299685['accountcode']):undefined,'uniqueid':_0x299685[_0x0d63('0x17')]},'log':_0x0d63('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 32d5a74..e2ac57a 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x826c=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x263da6,_0x9bc8ee){var _0x3ecebd=function(_0x15e9fb){while(--_0x15e9fb){_0x263da6['push'](_0x263da6['shift']());}};_0x3ecebd(++_0x9bc8ee);}(_0x826c,0xc8));var _0xc826=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x826c[_0x2bd88d];return _0x5516d4;};'use strict';var client=require(_0xc826('0x0'));exports[_0xc826('0x1')]=function(){return client[_0xc826('0x2')](_0xc826('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc826('0x4'),_0xc826('0x5')]},'log':_0xc826('0x6')});}; \ No newline at end of file +var _0x4dfc=['previewRecallmeReminderInterval','GetSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x4dfc,0xda));var _0xc4df=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0x4dfc[_0x38fbc2];return _0x43c7d4;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0xc4df('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc4df('0x1'),_0xc4df('0x2')]},'log':_0xc4df('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3937272..11321c6 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 _0xd159=['name','../client','getTemplates','GetTemplate'];(function(_0x2d2e48,_0x9e4ad1){var _0x22bcd3=function(_0x5f36e9){while(--_0x5f36e9){_0x2d2e48['push'](_0x2d2e48['shift']());}};_0x22bcd3(++_0x9e4ad1);}(_0xd159,0x19d));var _0x9d15=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd159[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x9d15('0x0'));exports[_0x9d15('0x1')]=function(_0x3f9fcf){return function(_0x25c6df){return client['Request'](_0x9d15('0x2'),{'options':{'raw':!![],'attributes':['id',_0x9d15('0x3'),'html']},'log':_0x9d15('0x2')});};}; \ No newline at end of file +var _0xd35e=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x43f2d0,_0x56ac4e){var _0x1fa5a2=function(_0x225e57){while(--_0x225e57){_0x43f2d0['push'](_0x43f2d0['shift']());}};_0x1fa5a2(++_0x56ac4e);}(_0xd35e,0x14a));var _0xed35=function(_0x335ef5,_0x1a74a9){_0x335ef5=_0x335ef5-0x0;var _0xc51af9=_0xd35e[_0x335ef5];return _0xc51af9;};'use strict';var client=require(_0xed35('0x0'));exports[_0xed35('0x1')]=function(_0x2e9f27){return function(_0x449514){return client[_0xed35('0x2')](_0xed35('0x3'),{'options':{'raw':!![],'attributes':['id',_0xed35('0x4'),_0xed35('0x5')]},'log':_0xed35('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index fa5b9b3..602d223 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 _0x2d7d=['data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','field','operator','value','Action','Actions','action','data2','data4'];(function(_0x18776a,_0x4fecab){var _0x484e4a=function(_0x2c8722){while(--_0x2c8722){_0x18776a['push'](_0x18776a['shift']());}};_0x484e4a(++_0x4fecab);}(_0x2d7d,0x1e8));var _0xd2d7=function(_0x56ce18,_0xcd810d){_0x56ce18=_0x56ce18-0x0;var _0x4b2636=_0x2d7d[_0x56ce18];return _0x4b2636;};'use strict';var client=require(_0xd2d7('0x0'));exports[_0xd2d7('0x1')]=function(_0x438924){return function(_0x21b9c0){return client[_0xd2d7('0x2')](_0xd2d7('0x3'),{'options':{'raw':![],'attributes':['id',_0xd2d7('0x4'),_0xd2d7('0x5'),_0xd2d7('0x6')],'include':[{'model':_0xd2d7('0x7'),'as':'AllConditions','attributes':['id',_0xd2d7('0x8'),_0xd2d7('0x9'),_0xd2d7('0xa')]},{'model':_0xd2d7('0x7'),'as':'AnyConditions','attributes':['id',_0xd2d7('0x8'),_0xd2d7('0x9'),'value']},{'model':_0xd2d7('0xb'),'as':_0xd2d7('0xc'),'attributes':['id',_0xd2d7('0xd'),'data1',_0xd2d7('0xe'),'data3',_0xd2d7('0xf'),_0xd2d7('0x10'),_0xd2d7('0x11'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xb041=['Actions','action','data1','data2','data3','data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','value','operator','Action'];(function(_0x4c00e1,_0xa87c75){var _0x498951=function(_0x5231ae){while(--_0x5231ae){_0x4c00e1['push'](_0x4c00e1['shift']());}};_0x498951(++_0xa87c75);}(_0xb041,0x10b));var _0x1b04=function(_0x5e3287,_0x3f35ad){_0x5e3287=_0x5e3287-0x0;var _0x48b04d=_0xb041[_0x5e3287];return _0x48b04d;};'use strict';var client=require(_0x1b04('0x0'));exports[_0x1b04('0x1')]=function(_0x19384a){return function(_0x302222){return client[_0x1b04('0x2')](_0x1b04('0x3'),{'options':{'raw':![],'attributes':['id',_0x1b04('0x4'),_0x1b04('0x5'),_0x1b04('0x6')],'include':[{'model':_0x1b04('0x7'),'as':_0x1b04('0x8'),'attributes':['id',_0x1b04('0x9'),'operator',_0x1b04('0xa')]},{'model':'Condition','as':'AnyConditions','attributes':['id','field',_0x1b04('0xb'),_0x1b04('0xa')]},{'model':_0x1b04('0xc'),'as':_0x1b04('0xd'),'attributes':['id',_0x1b04('0xe'),_0x1b04('0xf'),_0x1b04('0x10'),_0x1b04('0x11'),'data4',_0x1b04('0x12'),_0x1b04('0x13'),'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 d5f9d7b..aa1a865 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 _0xfd2f=['../client','getTrunks','Request','name','registry','GetTrunk'];(function(_0x5d10b8,_0x524d52){var _0x27ea71=function(_0x40d655){while(--_0x40d655){_0x5d10b8['push'](_0x5d10b8['shift']());}};_0x27ea71(++_0x524d52);}(_0xfd2f,0x14a));var _0xffd2=function(_0x19aa51,_0x34de58){_0x19aa51=_0x19aa51-0x0;var _0x17c70a=_0xfd2f[_0x19aa51];return _0x17c70a;};'use strict';var client=require(_0xffd2('0x0'));exports[_0xffd2('0x1')]=function(_0x296e43){return function(_0x5204b6){return client[_0xffd2('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xffd2('0x3'),_0xffd2('0x4'),'defaultuser']},'log':_0xffd2('0x5')});};}; \ No newline at end of file +var _0x6658=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x1e259c,_0x27c300){var _0x16d6e8=function(_0x2f345c){while(--_0x2f345c){_0x1e259c['push'](_0x1e259c['shift']());}};_0x16d6e8(++_0x27c300);}(_0x6658,0x198));var _0x8665=function(_0x35f6ff,_0x52f92f){_0x35f6ff=_0x35f6ff-0x0;var _0x59b239=_0x6658[_0x35f6ff];return _0x59b239;};'use strict';var client=require(_0x8665('0x0'));exports[_0x8665('0x1')]=function(_0x2d027a){return function(_0x1a6b0b){return client[_0x8665('0x2')](_0x8665('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8665('0x4'),_0x8665('0x5'),'defaultuser']},'log':_0x8665('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a9b0015..646e468 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x32d29d,_0x2825ae){var _0x4db019=function(_0x209f42){while(--_0x209f42){_0x32d29d['push'](_0x32d29d['shift']());}};_0x4db019(++_0x2825ae);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe706,0xa3));var _0x6e70=function(_0x2e5a17,_0x558f0e){_0x2e5a17=_0x2e5a17-0x0;var _0x24f53d=_0xe706[_0x2e5a17];return _0x24f53d;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6988ae5..7e745e9 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 _0x3c3c=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0xb63224,_0x271a76){var _0x420d01=function(_0x4c5191){while(--_0x4c5191){_0xb63224['push'](_0xb63224['shift']());}};_0x420d01(++_0x271a76);}(_0x3c3c,0x14c));var _0xc3c3=function(_0x5dadcf,_0x50af73){_0x5dadcf=_0x5dadcf-0x0;var _0x5b437e=_0x3c3c[_0x5dadcf];return _0x5b437e;};'use strict';var client=require(_0xc3c3('0x0'));exports[_0xc3c3('0x1')]=function(_0x1047f7){return client['Request'](_0xc3c3('0x2'),{'body':_0x1047f7,'log':_0xc3c3('0x2')});};exports[_0xc3c3('0x3')]=function(_0x32dbd6,_0x1178d3,_0xa9a6b9){return client[_0xc3c3('0x4')](_0xc3c3('0x5'),{'body':_0x32dbd6,'options':{'where':{'uniqueid':_0x1178d3,'interface':_0xa9a6b9,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x1740=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x2e8b61,_0x214d43){var _0x1c1165=function(_0x40c08b){while(--_0x40c08b){_0x2e8b61['push'](_0x2e8b61['shift']());}};_0x1c1165(++_0x214d43);}(_0x1740,0x6e));var _0x0174=function(_0x45ec64,_0x558688){_0x45ec64=_0x45ec64-0x0;var _0x596452=_0x1740[_0x45ec64];return _0x596452;};'use strict';var client=require(_0x0174('0x0'));exports['create']=function(_0x1bd00f){return client[_0x0174('0x1')](_0x0174('0x2'),{'body':_0x1bd00f,'log':_0x0174('0x2')});};exports[_0x0174('0x3')]=function(_0x317681,_0x2007d1,_0x5c860d){return client[_0x0174('0x1')]('UpdateVoiceAgentReport',{'body':_0x317681,'options':{'where':{'uniqueid':_0x2007d1,'interface':_0x5c860d,'agentcomplete':!![]}},'log':_0x0174('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9417565..75188ff 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 _0x981c=['../client','create','Request','CreateVoiceCallReport','merge','calleridnum','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x454498,_0x1d118b){var _0xc4ab7d=function(_0x1604fc){while(--_0x1604fc){_0x454498['push'](_0x454498['shift']());}};_0xc4ab7d(++_0x1d118b);}(_0x981c,0x1ca));var _0xc981=function(_0x3f1956,_0xce632d){_0x3f1956=_0x3f1956-0x0;var _0x2364c7=_0x981c[_0x3f1956];return _0x2364c7;};'use strict';var moment=require(_0xc981('0x0'));var util=require(_0xc981('0x1'));var _=require('lodash');var client=require(_0xc981('0x2'));exports[_0xc981('0x3')]=function(_0x50c0dc){return client[_0xc981('0x4')](_0xc981('0x5'),{'body':_[_0xc981('0x6')](_0x50c0dc,{'source':_0x50c0dc[_0xc981('0x7')],'destinationcontext':_0x50c0dc['context'],'callerid':_0x50c0dc['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xc981('0x5')});};exports[_0xc981('0x8')]=function(){return function(){return client[_0xc981('0x4')](_0xc981('0x9'),{'options':{'where':{'type':[_0xc981('0xa')],'createdAt':{'$between':[moment()[_0xc981('0xb')]('day')[_0xc981('0xc')](_0xc981('0xd')),moment()['endOf'](_0xc981('0xe'))[_0xc981('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xc981('0xf'),_0xc981('0x10'),_0xc981('0x11'),_0xc981('0x12')]},'log':_0xc981('0x13')});};}; \ No newline at end of file +var _0x70eb=['duration','billableseconds','GetVoiceCallReports','util','lodash','../client','Request','CreateVoiceCallReport','context','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x19b3f8,_0x150751){var _0x22c3a1=function(_0x16bf0a){while(--_0x16bf0a){_0x19b3f8['push'](_0x19b3f8['shift']());}};_0x22c3a1(++_0x150751);}(_0x70eb,0x1f0));var _0xb70e=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x70eb[_0x5416db];return _0x243e35;};'use strict';var moment=require('moment');var util=require(_0xb70e('0x0'));var _=require(_0xb70e('0x1'));var client=require(_0xb70e('0x2'));exports['create']=function(_0x1e4725){return client[_0xb70e('0x3')](_0xb70e('0x4'),{'body':_['merge'](_0x1e4725,{'source':_0x1e4725['calleridnum'],'destinationcontext':_0x1e4725[_0xb70e('0x5')],'callerid':_0x1e4725['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xb70e('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xb70e('0x3')](_0xb70e('0x6'),{'options':{'where':{'type':[_0xb70e('0x7')],'createdAt':{'$between':[moment()[_0xb70e('0x8')](_0xb70e('0x9'))[_0xb70e('0xa')](_0xb70e('0xb')),moment()[_0xb70e('0xc')](_0xb70e('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xb70e('0xd'),'disposition',_0xb70e('0xe'),_0xb70e('0xf')]},'log':_0xb70e('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d4b8f9a..2afeb56 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 _0x5e42=['create','Request','CreateVoiceDialReport','../client'];(function(_0x14ab72,_0x3b4f2f){var _0x3954d4=function(_0x52c4fd){while(--_0x52c4fd){_0x14ab72['push'](_0x14ab72['shift']());}};_0x3954d4(++_0x3b4f2f);}(_0x5e42,0x17f));var _0x25e4=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x5e42[_0x2d982d];return _0x4f36b0;};'use strict';var client=require(_0x25e4('0x0'));exports[_0x25e4('0x1')]=function(_0x12ed5c){return client[_0x25e4('0x2')](_0x25e4('0x3'),{'body':_0x12ed5c,'log':_0x25e4('0x3')});}; \ No newline at end of file +var _0x748e=['Request','CreateVoiceDialReport','../client','create'];(function(_0x1e992d,_0x52eca6){var _0x1d9157=function(_0x502107){while(--_0x502107){_0x1e992d['push'](_0x1e992d['shift']());}};_0x1d9157(++_0x52eca6);}(_0x748e,0xaa));var _0xe748=function(_0x1d7bc0,_0x50a455){_0x1d7bc0=_0x1d7bc0-0x0;var _0x15a179=_0x748e[_0x1d7bc0];return _0x15a179;};'use strict';var client=require(_0xe748('0x0'));exports[_0xe748('0x1')]=function(_0x32d1c9){return client[_0xe748('0x2')](_0xe748('0x3'),{'body':_0x32d1c9,'log':_0xe748('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 73c09a6..111357d 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 _0x8a55=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x4e5aca,_0x4480f5){var _0x3c488a=function(_0x3b18de){while(--_0x3b18de){_0x4e5aca['push'](_0x4e5aca['shift']());}};_0x3c488a(++_0x4480f5);}(_0x8a55,0x185));var _0x58a5=function(_0x321527,_0xf0731c){_0x321527=_0x321527-0x0;var _0x7c7562=_0x8a55[_0x321527];return _0x7c7562;};'use strict';var client=require(_0x58a5('0x0'));exports[_0x58a5('0x1')]=function(){return function(){return client[_0x58a5('0x2')](_0x58a5('0x3'),{'options':{'raw':!![],'attributes':['id',_0x58a5('0x4'),_0x58a5('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x58a5('0x1')});};}; \ No newline at end of file +var _0xa571=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x59137b,_0x20880e){var _0x267490=function(_0xcec6de){while(--_0xcec6de){_0x59137b['push'](_0x59137b['shift']());}};_0x267490(++_0x20880e);}(_0xa571,0x107));var _0x1a57=function(_0x473a99,_0x2f7c2f){_0x473a99=_0x473a99-0x0;var _0x3f6dfa=_0xa571[_0x473a99];return _0x3f6dfa;};'use strict';var client=require(_0x1a57('0x0'));exports[_0x1a57('0x1')]=function(){return function(){return client[_0x1a57('0x2')](_0x1a57('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x1a57('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x1a57('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 406e041..014c70b 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 _0x19a5=['dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x400165,_0x3062e0){var _0xeeb520=function(_0x55da8a){while(--_0x55da8a){_0x400165['push'](_0x400165['shift']());}};_0xeeb520(++_0x3062e0);}(_0x19a5,0x17e));var _0x519a=function(_0x59e6d8,_0x27a890){_0x59e6d8=_0x59e6d8-0x0;var _0xa3e821=_0x19a5[_0x59e6d8];return _0xa3e821;};'use strict';var client=require(_0x519a('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x519a('0x1')](_0x519a('0x2'),{'options':{'raw':![],'attributes':['id',_0x519a('0x3'),_0x519a('0x4'),_0x519a('0x5'),_0x519a('0x6'),_0x519a('0x7'),_0x519a('0x8'),_0x519a('0x9'),'dialMethod',_0x519a('0xa'),_0x519a('0xb'),'dialPowerLevel',_0x519a('0xc'),_0x519a('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x519a('0xe'),_0x519a('0xf'),_0x519a('0x10'),_0x519a('0x11'),_0x519a('0x12'),_0x519a('0x13'),_0x519a('0x14'),'dialBusyRetryFrequency',_0x519a('0x15'),_0x519a('0x16'),_0x519a('0x17'),_0x519a('0x18'),'dialGlobalInterval',_0x519a('0x19'),_0x519a('0x1a'),_0x519a('0x1b'),_0x519a('0x1c'),_0x519a('0x1d'),_0x519a('0x1e'),'dialAMDTotalAnalysisTime',_0x519a('0x1f'),'dialAMDBetweenWordsSilence',_0x519a('0x20'),'dialAMDSilenceThreshold',_0x519a('0x21'),_0x519a('0x22'),_0x519a('0x23'),'dialRecallInQueue','dialOrderByScheduledAt',_0x519a('0x24'),_0x519a('0x25'),_0x519a('0x26'),_0x519a('0x7'),_0x519a('0x27'),'dialRandomLastDigitCallerIdNumber',_0x519a('0x28'),_0x519a('0x29'),_0x519a('0x2a'),_0x519a('0x2b'),_0x519a('0x2c'),_0x519a('0x2d'),'dialAbandonedRetryFrequency',_0x519a('0x2e'),_0x519a('0x2f'),_0x519a('0x30'),_0x519a('0x31'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x519a('0x32'),_0x519a('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x519a('0x34'),'as':_0x519a('0x34'),'attributes':['id',_0x519a('0x3'),'callerid',_0x519a('0x35')]},{'model':_0x519a('0x36'),'as':_0x519a('0x37'),'attributes':['id','name']},{'model':'Trunk','as':_0x519a('0x38'),'attributes':['id',_0x519a('0x3'),'callerid',_0x519a('0x35')]},{'model':_0x519a('0x39'),'as':'Interval','attributes':['id',_0x519a('0x3')],'include':[{'model':_0x519a('0x39'),'as':_0x519a('0x3a'),'attributes':['id','name','interval']}]}]},'log':_0x519a('0x3b')});};}; \ No newline at end of file +var _0xf891=['dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'];(function(_0x286e80,_0x5da797){var _0x2fbab3=function(_0x1630fd){while(--_0x1630fd){_0x286e80['push'](_0x286e80['shift']());}};_0x2fbab3(++_0x5da797);}(_0xf891,0x199));var _0x1f89=function(_0x1a841c,_0x4cb15c){_0x1a841c=_0x1a841c-0x0;var _0x51e58a=_0xf891[_0x1a841c];return _0x51e58a;};'use strict';var client=require(_0x1f89('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x1f89('0x1')](_0x1f89('0x2'),{'options':{'raw':![],'attributes':['id',_0x1f89('0x3'),_0x1f89('0x4'),'acwTimeout',_0x1f89('0x5'),_0x1f89('0x6'),'type',_0x1f89('0x7'),_0x1f89('0x8'),'dialLimitChannel','dialLimitQueue',_0x1f89('0x9'),_0x1f89('0xa'),'dialPredictiveOptimizationPercentage',_0x1f89('0xb'),_0x1f89('0xc'),'dialOriginateCallerIdNumber',_0x1f89('0xd'),_0x1f89('0xe'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0x1f89('0xf'),_0x1f89('0x10'),_0x1f89('0x11'),_0x1f89('0x12'),_0x1f89('0x13'),'dialGlobalMaxRetry','dialTimezone',_0x1f89('0x14'),_0x1f89('0x15'),_0x1f89('0x16'),_0x1f89('0x17'),_0x1f89('0x18'),'dialAMDGreeting',_0x1f89('0x19'),'dialAMDTotalAnalysisTime',_0x1f89('0x1a'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x1f89('0x1b'),_0x1f89('0x1c'),_0x1f89('0x1d'),'dialRecallMeTimeout',_0x1f89('0x1e'),_0x1f89('0x1f'),_0x1f89('0x20'),_0x1f89('0x21'),_0x1f89('0x22'),_0x1f89('0x6'),_0x1f89('0x23'),'dialRandomLastDigitCallerIdNumber',_0x1f89('0x24'),_0x1f89('0x25'),'dialNoSuchNumberRetryFrequency',_0x1f89('0x26'),'dialDropRetryFrequency',_0x1f89('0x27'),_0x1f89('0x28'),_0x1f89('0x29'),'dialMachineRetryFrequency',_0x1f89('0x2a'),_0x1f89('0x2b'),_0x1f89('0x2c'),_0x1f89('0x2d'),_0x1f89('0x2e'),_0x1f89('0x2f'),_0x1f89('0x30')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x1f89('0x3'),_0x1f89('0x31'),_0x1f89('0x32')]},{'model':_0x1f89('0x33'),'as':_0x1f89('0x34'),'attributes':['id','name']},{'model':'Trunk','as':_0x1f89('0x35'),'attributes':['id','name',_0x1f89('0x31'),'active']},{'model':_0x1f89('0x36'),'as':'Interval','attributes':['id',_0x1f89('0x3')],'include':[{'model':_0x1f89('0x36'),'as':_0x1f89('0x37'),'attributes':['id',_0x1f89('0x3'),'interval']}]}]},'log':_0x1f89('0x38')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index fc9d114..e71d7f4 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 _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4a9431,_0x14063f){var _0x2517cf=function(_0x30d274){while(--_0x30d274){_0x4a9431['push'](_0x4a9431['shift']());}};_0x2517cf(++_0x14063f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x374c27,_0x49f59f){var _0x1737e9=function(_0x3c97cb){while(--_0x3c97cb){_0x374c27['push'](_0x374c27['shift']());}};_0x1737e9(++_0x49f59f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 78a07bf..39a934a 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 _0x9ff5=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x345ad4,_0x36c6e3){var _0x2227a9=function(_0x18d62c){while(--_0x18d62c){_0x345ad4['push'](_0x345ad4['shift']());}};_0x2227a9(++_0x36c6e3);}(_0x9ff5,0x1c0));var _0x59ff=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x9ff5[_0x29d915];return _0x160f86;};'use strict';var client=require(_0x59ff('0x0'));exports[_0x59ff('0x1')]=function(_0x4524a7){return function(){return client[_0x59ff('0x2')](_0x59ff('0x3'),{'options':{'where':{'VoiceQueueId':_0x4524a7,'paused':!![]},'raw':!![]},'log':_0x59ff('0x1')});};}; \ No newline at end of file +var _0x158f=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x7cebaf,_0x37d37c){var _0xcd1075=function(_0x275f3f){while(--_0x275f3f){_0x7cebaf['push'](_0x7cebaf['shift']());}};_0xcd1075(++_0x37d37c);}(_0x158f,0x179));var _0xf158=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x158f[_0x5ba549];return _0x36e3a1;};'use strict';var client=require('../client');exports[_0xf158('0x0')]=function(_0xafaca4){return function(){return client['Request'](_0xf158('0x1'),{'options':{'where':{'VoiceQueueId':_0xafaca4,'paused':!![]},'raw':!![]},'log':_0xf158('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index fe1cd5d..398731b 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4fe6cd,_0x3b44a6){var _0x201412=function(_0x567f92){while(--_0x567f92){_0x4fe6cd['push'](_0x4fe6cd['shift']());}};_0x201412(++_0x3b44a6);}(_0x7a54,0x106));var _0x47a5=function(_0x3ebf87,_0x597ee7){_0x3ebf87=_0x3ebf87-0x0;var _0x532085=_0x7a54[_0x3ebf87];return _0x532085;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5f4b93,_0x84454f){var _0x2199ee=function(_0x3be57f){while(--_0x3be57f){_0x5f4b93['push'](_0x5f4b93['shift']());}};_0x2199ee(++_0x84454f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index c1dca9f..ebc2069 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 _0xe81d=['origtransfererexten','attended','../client','transfers','blindTransfer','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','CreateVoiceTransferReport','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext'];(function(_0x15b16b,_0x439e72){var _0x20d17c=function(_0x4661a3){while(--_0x4661a3){_0x15b16b['push'](_0x15b16b['shift']());}};_0x20d17c(++_0x439e72);}(_0xe81d,0x1b0));var _0xde81=function(_0x10e0b4,_0xf09cac){_0x10e0b4=_0x10e0b4-0x0;var _0x226470=_0xe81d[_0x10e0b4];return _0x226470;};'use strict';var client=require(_0xde81('0x0'));exports[_0xde81('0x1')]={};exports[_0xde81('0x2')]=function(_0x453426){return client[_0xde81('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x453426['result'],'transfererchannel':_0x453426[_0xde81('0x4')],'transferercalleridnum':_0x453426[_0xde81('0x5')],'transferercalleridname':_0x453426[_0xde81('0x6')],'transfererconnectedlinenum':_0x453426['transfererconnectedlinenum'],'transfererconnectedlinename':_0x453426[_0xde81('0x7')],'transfereraccountcode':_0x453426[_0xde81('0x8')],'transferercontext':_0x453426[_0xde81('0x9')],'transfererexten':_0x453426[_0xde81('0xa')],'transfererlinkedid':_0x453426[_0xde81('0xb')],'transfereechannel':_0x453426[_0xde81('0xc')],'transfereecalleridnum':_0x453426[_0xde81('0xd')],'transfereecalleridname':_0x453426[_0xde81('0xe')],'transfereeconnectedlinenum':_0x453426[_0xde81('0xf')],'transfereeconnectedlinename':_0x453426[_0xde81('0x10')],'transfereeaccountcode':_0x453426[_0xde81('0x11')],'transfereecontext':_0x453426[_0xde81('0x12')],'transfereeexten':_0x453426[_0xde81('0x13')],'transfereelinkedid':_0x453426[_0xde81('0x14')],'isexternal':_0x453426[_0xde81('0x15')],'context':_0x453426['context'],'extension':_0x453426[_0xde81('0x16')],'type':_0xde81('0x17')},'log':'CreateVoiceTransferReport'});};exports[_0xde81('0x18')]=function(_0x1c17a7){return client[_0xde81('0x3')](_0xde81('0x19'),{'body':{'result':_0x1c17a7['result'],'transfererchannel':_0x1c17a7['origtransfererchannel'],'transferercalleridnum':_0x1c17a7[_0xde81('0x1a')],'transferercalleridname':_0x1c17a7[_0xde81('0x1b')],'transfererconnectedlinenum':_0x1c17a7[_0xde81('0x1c')],'transfererconnectedlinename':_0x1c17a7['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1c17a7[_0xde81('0x1d')],'transferercontext':_0x1c17a7[_0xde81('0x1e')],'transfererexten':_0x1c17a7[_0xde81('0x1f')],'transfererlinkedid':_0x1c17a7[_0xde81('0x20')],'transfereechannel':_0x1c17a7['transfertargetchannel'],'transfereecalleridnum':_0x1c17a7[_0xde81('0x21')],'transfereecalleridname':_0x1c17a7[_0xde81('0x22')],'transfereeconnectedlinenum':_0x1c17a7[_0xde81('0x23')],'transfereeconnectedlinename':_0x1c17a7[_0xde81('0x24')],'transfereeaccountcode':_0x1c17a7[_0xde81('0x25')],'transfereecontext':_0x1c17a7[_0xde81('0x26')],'transfereeexten':_0x1c17a7['transfertargetexten'],'transfereelinkedid':_0x1c17a7[_0xde81('0x27')],'isexternal':_0x1c17a7['isexternal'],'context':_0x1c17a7[_0xde81('0x28')],'extension':_0x1c17a7[_0xde81('0x29')],'type':_0xde81('0x2a')},'log':_0xde81('0x19')});}; \ No newline at end of file +var _0x5666=['transfereeaccountcode','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','attended','transfers','blindTransfer','Request','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x18c3f7,_0x329e47){var _0x530af3=function(_0x32be52){while(--_0x32be52){_0x18c3f7['push'](_0x18c3f7['shift']());}};_0x530af3(++_0x329e47);}(_0x5666,0x86));var _0x6566=function(_0x4faf22,_0x3839d9){_0x4faf22=_0x4faf22-0x0;var _0x42302e=_0x5666[_0x4faf22];return _0x42302e;};'use strict';var client=require('../client');exports[_0x6566('0x0')]={};exports[_0x6566('0x1')]=function(_0x505997){return client[_0x6566('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x505997[_0x6566('0x3')],'transfererchannel':_0x505997['transfererchannel'],'transferercalleridnum':_0x505997[_0x6566('0x4')],'transferercalleridname':_0x505997[_0x6566('0x5')],'transfererconnectedlinenum':_0x505997[_0x6566('0x6')],'transfererconnectedlinename':_0x505997['transfererconnectedlinename'],'transfereraccountcode':_0x505997[_0x6566('0x7')],'transferercontext':_0x505997[_0x6566('0x8')],'transfererexten':_0x505997[_0x6566('0x9')],'transfererlinkedid':_0x505997['transfererlinkedid'],'transfereechannel':_0x505997[_0x6566('0xa')],'transfereecalleridnum':_0x505997['transfereecalleridnum'],'transfereecalleridname':_0x505997[_0x6566('0xb')],'transfereeconnectedlinenum':_0x505997[_0x6566('0xc')],'transfereeconnectedlinename':_0x505997[_0x6566('0xd')],'transfereeaccountcode':_0x505997[_0x6566('0xe')],'transfereecontext':_0x505997['transfereecontext'],'transfereeexten':_0x505997[_0x6566('0xf')],'transfereelinkedid':_0x505997['transfereelinkedid'],'isexternal':_0x505997[_0x6566('0x10')],'context':_0x505997[_0x6566('0x11')],'extension':_0x505997[_0x6566('0x12')],'type':_0x6566('0x13')},'log':_0x6566('0x14')});};exports['attendedTransfer']=function(_0x1069dc){return client[_0x6566('0x2')](_0x6566('0x14'),{'body':{'result':_0x1069dc['result'],'transfererchannel':_0x1069dc[_0x6566('0x15')],'transferercalleridnum':_0x1069dc[_0x6566('0x16')],'transferercalleridname':_0x1069dc[_0x6566('0x17')],'transfererconnectedlinenum':_0x1069dc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1069dc[_0x6566('0x18')],'transfereraccountcode':_0x1069dc[_0x6566('0x19')],'transferercontext':_0x1069dc[_0x6566('0x1a')],'transfererexten':_0x1069dc[_0x6566('0x1b')],'transfererlinkedid':_0x1069dc[_0x6566('0x1c')],'transfereechannel':_0x1069dc[_0x6566('0x1d')],'transfereecalleridnum':_0x1069dc[_0x6566('0x1e')],'transfereecalleridname':_0x1069dc[_0x6566('0x1f')],'transfereeconnectedlinenum':_0x1069dc[_0x6566('0x20')],'transfereeconnectedlinename':_0x1069dc[_0x6566('0x21')],'transfereeaccountcode':_0x1069dc['transfertargetaccountcode'],'transfereecontext':_0x1069dc[_0x6566('0x22')],'transfereeexten':_0x1069dc[_0x6566('0x23')],'transfereelinkedid':_0x1069dc['transfertargetlinkedid'],'isexternal':_0x1069dc[_0x6566('0x10')],'context':_0x1069dc['origtransferercontext'],'extension':_0x1069dc['origtransfererexten'],'type':_0x6566('0x24')},'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 e91dfa9..27875f0 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 _0xe714=['abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','isConnected','resolve','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','faxAccounts','send','checkAfterSend','server','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','moment','../properties','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','join','pick','action','Reload','Action','then','message','error','username','ami\x20disconnected','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumHoldTime','talking','type'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xe714,0xe2));var _0x4e71=function(_0x1205ee,_0x43012a){_0x1205ee=_0x1205ee-0x0;var _0x19fcd0=_0xe714[_0x1205ee];return _0x19fcd0;};'use strict';var _=require(_0x4e71('0x0'));var util=require('util');var jayson=require(_0x4e71('0x1'));var schema=require(_0x4e71('0x2'));var BPromise=require(_0x4e71('0x3'));var moment=require(_0x4e71('0x4'));var config=require('../../../config/environment');var properties=require(_0x4e71('0x5'));var ami=require('../ami');exports[_0x4e71('0x6')]=function(_0x19e056,_0x28ce78,_0x204a19){return new BPromise(function(_0xfe1559,_0x1f1d35){var _0x55b1cc={'QueuePause':function(_0x3b0a3a){return new Promise(function(_0x32b6d0,_0xda346c){var _0x564d0f=util[_0x4e71('0x7')]('%s/%s',_0x4e71('0x8'),_0x3b0a3a[_0x4e71('0x9')]);if(_0x19e056[_0x4e71('0xa')]&&_0x19e056[_0x4e71('0xa')][_0x564d0f]&&_0x19e056[_0x4e71('0xa')][_0x564d0f][_0x4e71('0xb')]){_0x19e056[_0x4e71('0xa')][_0x564d0f][_0x4e71('0xc')]();}if(_0x19e056['agents'][_0x564d0f]){_0x19e056[_0x4e71('0xd')][_0x564d0f][_0x4e71('0xe')]({'statePause':_0x3b0a3a['pause']?!![]:![]});}_0x32b6d0({'code':0xc8,'message':_0x4e71('0xf')});});},'Reload':function(_0x311b12){var _0x5775b0=this;return new Promise(function(_0x139d96,_0x2e416e){if(ami['isConnected']()==![]){return _0x2e416e(_0x5775b0['error'](0x1f4,[config[_0x4e71('0x10')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x4e71('0x11')]('\x20')));}_0x311b12=_[_0x4e71('0x12')](_0x311b12,_['keys'](properties['module']));_0x311b12[_0x4e71('0x13')]=_0x4e71('0x14');return ami[_0x4e71('0x15')](_0x311b12)[_0x4e71('0x16')](function(_0x40f288){_0x139d96({'code':0xc8,'message':_0x40f288[_0x4e71('0x17')]});})['catch'](function(_0x18b745){_0x2e416e(_0x5775b0[_0x4e71('0x18')](0x1f5,_0x18b745['message']));});});},'Command':function(_0x38416f){var _0x20b3ef=this;return new Promise(function(_0x59ac5a,_0x573bad){if(ami['isConnected']()==![]){return _0x573bad(_0x20b3ef[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}_0x38416f=_[_0x4e71('0x12')](_0x38416f,_0x4e71('0x1b'));_0x38416f[_0x4e71('0x13')]=_0x4e71('0x1c');return ami[_0x4e71('0x15')](_0x38416f)[_0x4e71('0x16')](function(_0x5e90f0){_0x59ac5a({'code':0xc8,'message':_0x5e90f0['content']});})['catch'](function(_0x5b6584){_0x573bad(_0x20b3ef[_0x4e71('0x18')](0x1f5,_0x5b6584[_0x4e71('0x17')]));});});},'VoiceQueues':function(_0x31705d){return new Promise(function(_0x4ab095,_0x35f181){var _0x237057=[];for(var _0x564afb in _0x19e056[_0x4e71('0x1d')]){if(_0x19e056[_0x4e71('0x1d')][_0x4e71('0x1e')](_0x564afb)){var _0x53b08a=_0x19e056['voiceQueues'][_0x564afb];var _0xede8c0={'id':_0x53b08a['id'],'name':_0x53b08a[_0x4e71('0x9')],'strategy':_0x53b08a[_0x4e71('0x1f')],'answered':_0x53b08a[_0x4e71('0x20')],'available':_0x53b08a[_0x4e71('0x21')],'loggedIn':_0x53b08a[_0x4e71('0x22')],'pTalking':_0x53b08a['pTalking'],'sumBillable':_0x53b08a['sumBillable'],'sumDuration':_0x53b08a['sumDuration'],'sumHoldTime':_0x53b08a[_0x4e71('0x23')]||0x0,'talking':_0x53b08a[_0x4e71('0x24')],'total':_0x53b08a['total'],'type':_0x53b08a[_0x4e71('0x25')],'unmanaged':_0x53b08a['unmanaged'],'abandoned':_0x53b08a[_0x4e71('0x26')],'waiting':_0x53b08a[_0x4e71('0x27')],'loggedInDb':_0x53b08a[_0x4e71('0x28')]};if(_0x53b08a[_0x4e71('0x25')]===_0x4e71('0x29')){_0xede8c0['dialActive']=_0x53b08a[_0x4e71('0x2a')];_0xede8c0['dialMethod']=_0x53b08a[_0x4e71('0x2b')];_0xede8c0[_0x4e71('0x2c')]=_0x53b08a[_0x4e71('0x2c')];_0xede8c0[_0x4e71('0x2d')]=_0x53b08a[_0x4e71('0x2d')];_0xede8c0['dialOriginateTimeout']=_0x53b08a['dialOriginateTimeout'];_0xede8c0['dialPrefix']=_0x53b08a[_0x4e71('0x2e')];_0xede8c0[_0x4e71('0x2f')]=_0x53b08a['temp'];_0xede8c0[_0x4e71('0x30')]=_0x53b08a[_0x4e71('0x30')];_0xede8c0['outboundAnswerCallsDay']=_0x53b08a['outboundAnswerCallsDay'];_0xede8c0[_0x4e71('0x31')]=_0x53b08a[_0x4e71('0x31')];_0xede8c0['outboundBusyCallsDay']=_0x53b08a[_0x4e71('0x32')];_0xede8c0[_0x4e71('0x33')]=_0x53b08a['outboundCongestionCallsDay'];_0xede8c0[_0x4e71('0x34')]=_0x53b08a[_0x4e71('0x34')];_0xede8c0[_0x4e71('0x35')]=_0x53b08a['outboundDropCallsDayCallersExit'];_0xede8c0[_0x4e71('0x36')]=_0x53b08a[_0x4e71('0x36')];_0xede8c0[_0x4e71('0x37')]=_0x53b08a[_0x4e71('0x37')];_0xede8c0[_0x4e71('0x38')]=_0x53b08a['outboundNoSuchCallsDay'];_0xede8c0[_0x4e71('0x39')]=_0x53b08a[_0x4e71('0x39')];_0xede8c0[_0x4e71('0x3a')]=_0x53b08a[_0x4e71('0x3a')];_0xede8c0[_0x4e71('0x3b')]=_0x53b08a['outboundRejectCallsDay'];_0xede8c0['outboundUnknownCallsDay']=_0x53b08a[_0x4e71('0x3c')];_0xede8c0[_0x4e71('0x3d')]=_0x53b08a[_0x4e71('0x3d')];_0xede8c0[_0x4e71('0x3e')]=_0x53b08a[_0x4e71('0x3e')];_0xede8c0['predictiveIntervalAvgTalktime']=_0x53b08a[_0x4e71('0x3f')];_0xede8c0['predictiveIntervalDroppedCallsCallersExit']=_0x53b08a[_0x4e71('0x40')];_0xede8c0['predictiveIntervalDroppedCallsTimeout']=_0x53b08a[_0x4e71('0x41')];_0xede8c0[_0x4e71('0x42')]=_0x53b08a['predictiveIntervalErlangCalls'];_0xede8c0[_0x4e71('0x43')]=_0x53b08a[_0x4e71('0x43')];_0xede8c0[_0x4e71('0x44')]=_0x53b08a[_0x4e71('0x44')];_0xede8c0[_0x4e71('0x45')]=_0x53b08a[_0x4e71('0x45')];_0xede8c0[_0x4e71('0x46')]=_0x53b08a[_0x4e71('0x46')];_0xede8c0[_0x4e71('0x47')]=_0x53b08a['predictiveIntervalAvailable'];_0xede8c0['predictiveIntervalTotalCalls']=_0x53b08a[_0x4e71('0x48')];_0xede8c0[_0x4e71('0x17')]=_0x53b08a[_0x4e71('0x17')];_0xede8c0[_0x4e71('0x49')]=_0x53b08a['originated'];_0xede8c0['erlangCalls']=_0x53b08a[_0x4e71('0x4a')];_0xede8c0[_0x4e71('0x4b')]=_0x53b08a[_0x4e71('0x4b')];_0xede8c0[_0x4e71('0x4c')]=_0x53b08a[_0x4e71('0x4c')];_0xede8c0[_0x4e71('0x4d')]=_0x53b08a[_0x4e71('0x4d')];_0xede8c0[_0x4e71('0x4e')]=_0x53b08a[_0x4e71('0x4e')];_0xede8c0[_0x4e71('0x4f')]=_0x53b08a[_0x4e71('0x4f')];}if(_0x53b08a[_0x4e71('0x50')]){_0xede8c0['Trunk']={'id':_0x53b08a[_0x4e71('0x50')]['id'],'name':_0x53b08a[_0x4e71('0x50')][_0x4e71('0x9')],'active':_0x53b08a['Trunk']['active'],'callerid':_0x53b08a['Trunk']['callerid']};}if(_0x53b08a[_0x4e71('0x51')]){_0xede8c0[_0x4e71('0x51')]={'id':_0x53b08a['Interval']['id'],'name':_0x53b08a['Interval']['name']};}_0x237057[_0x4e71('0x52')](_0xede8c0);}}_0x4ab095({'count':_0x237057[_0x4e71('0x53')],'rows':_0x237057});});},'UpdateVoiceQueue':function(_0x11c6c8){return new Promise(function(_0x390b9c,_0x3daa67){var _0x259273=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x1d')],{'id':parseInt(_0x11c6c8['id'])});var _0x3e2e47=_[_0x4e71('0x55')](_0x11c6c8,['id']);if(_0x259273){for(var _0x55b025 in _0x3e2e47){if(typeof _0x3e2e47[_0x55b025]!==_0x4e71('0x56')&&typeof _0x259273[_0x55b025]!==_0x4e71('0x56')){_0x259273[_0x55b025]=_0x3e2e47[_0x55b025];}}_0x390b9c(_0x259273);}else{_0x3daa67();}});},'VoiceChannels':function(_0x5e6345){return new Promise(function(_0x43a710,_0x37964e){var _0x5a7a22=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x58')]);_0x43a710({'count':_0x5a7a22[_0x4e71('0x53')],'rows':_0x5a7a22});});},'VoiceChannelMixMonitor':function(_0x355d0c){var _0x4ca022=this;return new Promise(function(_0x450663,_0x4cc90a){if(ami['isConnected']()==![]){return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x5004c2=schema(properties[_0x4e71('0x59')])[_0x4e71('0x2')](_0x355d0c);if(_0x5004c2[_0x4e71('0x53')]>0x0){return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f4,_[_0x4e71('0x5a')](_0x5004c2,'message')['join'](',\x20')));}var _0x362334=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x58')],{'uniqueid':_0x355d0c[_0x4e71('0x5b')]});if(_0x362334&&_0x362334[_0x4e71('0x5c')]){var _0x149e71=util[_0x4e71('0x7')](_0x4e71('0x5d'),_0x355d0c[_0x4e71('0x5e')]||_0x355d0c[_0x4e71('0x5b')],_0x355d0c['format']||_0x4e71('0x5f'));return ami[_0x4e71('0x15')]({'action':_0x4e71('0x60'),'channel':_0x362334[_0x4e71('0x5c')],'file':_0x149e71,'options':_0x4e71('0x61')})[_0x4e71('0x16')](function(_0x1385ef){var _0x3622d8=_[_0x4e71('0x54')](_0x362334[_0x4e71('0x62')],{'filename':_0x4e71('0x63')+_0x149e71[_0x4e71('0x64')]()});if(_[_0x4e71('0x65')](_0x3622d8)){_0x362334['monitors'][_0x4e71('0x52')]({'filename':_0x4e71('0x63')+_0x149e71[_0x4e71('0x64')](),'createdAt':moment()[_0x4e71('0x7')](_0x4e71('0x66')),'mixmonitorid':_0x1385ef[_0x4e71('0x67')],'status':_0x4e71('0x68')});}else{_0x3622d8['mixmonitorid']=_0x1385ef[_0x4e71('0x67')];_0x3622d8['status']=_0x4e71('0x68');}_0x450663({'code':0xc8,'message':[_0x355d0c[_0x4e71('0x5b')],_0x4e71('0x69'),_0x1385ef['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x1385ef[_0x4e71('0x67')]});})[_0x4e71('0x6a')](function(_0x34910c){_0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f5,[_0x355d0c['uniqueid'],_0x34910c[_0x4e71('0x17')]['toLowerCase']()][_0x4e71('0x11')]('\x20')));});}else{return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x58561c){var _0x419417=this;return new Promise(function(_0x18cd5b,_0x3d09a9){if(ami[_0x4e71('0x6c')]()==![]){return _0x3d09a9(_0x419417[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')]['username'],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x231250=schema(properties[_0x4e71('0x59')])[_0x4e71('0x2')](_0x58561c);if(_0x231250[_0x4e71('0x53')]>0x0){return _0x3d09a9(_0x419417['error'](0x1f4,_[_0x4e71('0x5a')](_0x231250,_0x4e71('0x17'))[_0x4e71('0x11')](',\x20')));}var _0x4a04b3=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x58')],{'uniqueid':_0x58561c[_0x4e71('0x5b')]});if(_0x4a04b3){return BPromise[_0x4e71('0x6d')]()[_0x4e71('0x16')](function(){if(_0x4a04b3[_0x4e71('0x5c')]){return ami['Action']({'action':_0x4e71('0x6e'),'channel':_0x4a04b3['channel'],'mixmonitorid':_0x58561c[_0x4e71('0x67')]})['catch'](function(_0x436022){});}})['then'](function(){if(_0x4a04b3[_0x4e71('0x6f')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x6e'),'channel':_0x4a04b3[_0x4e71('0x6f')],'mixmonitorid':_0x58561c[_0x4e71('0x67')]})['catch'](function(_0x18c394){});}})[_0x4e71('0x16')](function(_0x274c38){var _0x276c78=_[_0x4e71('0x54')](_0x4a04b3[_0x4e71('0x62')],{'mixmonitorid':_0x58561c['mixmonitorid']});if(_0x276c78){_0x276c78['status']='stop';}})[_0x4e71('0x16')](function(){var _0x2cd3fd=util['format']('%s.%s',_0x58561c['filename']||_0x58561c[_0x4e71('0x5b')],_0x58561c[_0x4e71('0x7')]||'wav');var _0x1f7623=_[_0x4e71('0x54')](_0x4a04b3[_0x4e71('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x2cd3fd['toLowerCase']()});if(_0x1f7623){_0x1f7623[_0x4e71('0x70')]=_0x4e71('0x71');}})[_0x4e71('0x16')](function(){_0x18cd5b({'code':0xc8,'message':[_0x58561c['uniqueid'],'StopMixMonitor\x20Success'][_0x4e71('0x11')]('\x20')});})[_0x4e71('0x6a')](function(_0x4a066c){_0x3d09a9(_0x419417['error'](0x1f5,[_0x58561c[_0x4e71('0x5b')],_0x4a066c[_0x4e71('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3d09a9(_0x419417['error'](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannels':function(_0x38d593){return new Promise(function(_0x53e962,_0xeaf4c8){var _0x5aedd3=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x72')]);_0x53e962({'count':_0x5aedd3[_0x4e71('0x53')],'rows':_0x5aedd3});});},'VoiceQueuesChannel':function(_0x12ead0){var _0x22b4d4=this;return new Promise(function(_0x3b9f60,_0x300b9a){var _0x5337d8=schema(properties[_0x4e71('0x73')])[_0x4e71('0x2')](_0x12ead0);if(_0x5337d8['length']>0x0){return _0x300b9a(_0x22b4d4[_0x4e71('0x18')](0x1f4,_[_0x4e71('0x5a')](_0x5337d8,_0x4e71('0x17'))[_0x4e71('0x11')](',\x20')));}var _0x31501c=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x72')],{'uniqueid':_0x12ead0[_0x4e71('0x5b')]});if(_0x31501c){_0x3b9f60(_0x31501c);}else{return _0x300b9a(_0x22b4d4[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x183cf2){var _0x50ec2e=this;return new Promise(function(_0x1a3554,_0x3a5531){if(ami['isConnected']()==![]){return _0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x3dc233=schema(properties[_0x4e71('0x74')])['validate'](_0x183cf2);if(_0x3dc233[_0x4e71('0x53')]>0x0){return _0x3a5531(_0x50ec2e['error'](0x1f4,_[_0x4e71('0x5a')](_0x3dc233,'message')[_0x4e71('0x11')](',\x20')));}var _0x1c96b9=_[_0x4e71('0x54')](_0x19e056['queueChannels'],{'uniqueid':_0x183cf2['uniqueid']});if(_0x1c96b9&&_0x1c96b9[_0x4e71('0x5c')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x75'),'channel':_0x1c96b9[_0x4e71('0x5c')]})[_0x4e71('0x16')](function(_0xeb27c5){_0x1a3554({'code':0xc8,'message':[_0x183cf2['uniqueid'],_0xeb27c5[_0x4e71('0x17')][_0x4e71('0x64')]()]['join']('\x20')});})['catch'](function(_0x4e155d){_0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f5,[_0x183cf2[_0x4e71('0x5b')],_0x4e155d['message'][_0x4e71('0x64')]()][_0x4e71('0x11')]('\x20')));});}else{return _0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x31e64a){var _0x5b965d=this;return new Promise(function(_0x4600c4,_0x4b1bba){if(ami[_0x4e71('0x6c')]()==![]){return _0x4b1bba(_0x5b965d[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],'ami\x20disconnected']['join']('\x20')));}var _0x3c516e=schema(properties[_0x4e71('0x76')])[_0x4e71('0x2')](_0x31e64a);if(_0x3c516e[_0x4e71('0x53')]>0x0){return _0x4b1bba(_0x5b965d['error'](0x1f4,_[_0x4e71('0x5a')](_0x3c516e,_0x4e71('0x17'))['join'](',\x20')));}var _0x1b644f=_[_0x4e71('0x54')](_0x19e056['queueChannels'],{'uniqueid':_0x31e64a[_0x4e71('0x5b')]});if(_0x1b644f&&_0x1b644f[_0x4e71('0x5c')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x77'),'channel':_0x1b644f['channel'],'exten':_0x31e64a[_0x4e71('0x78')],'context':_0x31e64a[_0x4e71('0x79')]||_0x1b644f[_0x4e71('0x79')],'priority':0x1})[_0x4e71('0x16')](function(_0x301c2a){_0x4600c4({'code':0xc8,'message':[_0x31e64a[_0x4e71('0x5b')],_0x301c2a[_0x4e71('0x17')][_0x4e71('0x64')]()]['join']('\x20')});})[_0x4e71('0x6a')](function(_0x3af198){_0x4b1bba(_0x5b965d['error'](0x1f5,[_0x31e64a['uniqueid'],_0x3af198[_0x4e71('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4b1bba(_0x5b965d[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'Agents':function(_0x11aa61){return new Promise(function(_0x1fc7cb,_0x79266e){var _0x125d9e=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0xd')]);_0x1fc7cb({'count':_0x125d9e[_0x4e71('0x53')],'rows':_0x125d9e});});},'Telephones':function(_0x4b4aaa){return new Promise(function(_0x3d5ff1,_0x1b1d77){var _0xfc3c7d=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7a')]);_0x3d5ff1({'count':_0xfc3c7d['length'],'rows':_0xfc3c7d});});},'Trunks':function(_0xd25de3){return new Promise(function(_0x2a3439,_0x541348){var _0x29a739=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7b')]);_0x2a3439({'count':_0x29a739[_0x4e71('0x53')],'rows':_0x29a739});});},'OutboundChannels':function(_0x49f352){return new Promise(function(_0x1481d4,_0xfd6926){var _0x15e526=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7c')]);_0x1481d4({'count':_0x15e526['length'],'rows':_0x15e526});});},'Outbound':function(_0x56d7f0){return new Promise(function(_0x338166,_0xc836c8){_0x338166(_0x19e056[_0x4e71('0x29')]);});},'Campaigns':function(_0x570636){return new Promise(function(_0x5efb18,_0x491253){var _0x2a1b26=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7d')]);_0x5efb18({'count':_0x2a1b26[_0x4e71('0x53')],'rows':_0x2a1b26});});},'VoiceQueuesPreview':function(_0x1d883b){var _0x594a9a=this;return new Promise(function(_0x4dcde4,_0x2705a4){_0x28ce78[_0x4e71('0x7e')](_0x1d883b['id'])[_0x4e71('0x16')](function(_0x428bbd){_0x4dcde4({'code':0xc8,'message':_0x428bbd[_0x4e71('0x17')]});})[_0x4e71('0x6a')](function(_0x323576){_0x2705a4(_0x594a9a['error'](0x1f4,_0x323576[_0x4e71('0x17')]));});});},'EventManager':function(_0x1d93d6){var _0x461144=this;return new Promise(function(_0x2ee25b,_0x55b9cd){if(!_0x1d93d6['event']){return _0x55b9cd(_0x461144['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0x1d93d6['event'],_0x1d93d6[_0x4e71('0x17')]);_0x2ee25b({'code':0xc8,'message':_0x1d93d6});});},'FaxAccounts':function(_0x22c77a){return new Promise(function(_0x47ad27,_0xf43f7d){var _0x4e3658=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7f')]);_0x47ad27({'count':_0x4e3658[_0x4e71('0x53')],'rows':_0x4e3658});});},'SendFax':function(_0x1e3f4f){var _0x14ea6f=this;return new Promise(function(_0x58a79e,_0x96a336){_0x204a19[_0x4e71('0x80')](_0x1e3f4f)['then'](function(_0x252246){_0x58a79e({'code':0xc8,'message':_0x252246[_0x4e71('0x17')]});})[_0x4e71('0x6a')](function(_0x5a05b2){_0x96a336(_0x14ea6f[_0x4e71('0x18')](0x1f4,_0x5a05b2[_0x4e71('0x17')]));});});},'CheckAfterSend':function(_0xf281ac){var _0x1598b9=this;return new Promise(function(_0x128a8d,_0x2ba20f){_0x204a19[_0x4e71('0x81')](_0xf281ac)[_0x4e71('0x16')](function(_0x248f3f){_0x128a8d({'code':0xc8,'message':_0x248f3f['message']});})[_0x4e71('0x6a')](function(_0x14eb37){_0x2ba20f(_0x1598b9['error'](0x1f4,_0x14eb37['message']));});});}};var _0x4fb0df=jayson[_0x4e71('0x82')](_0x55b1cc)['http']();_0x4fb0df['on']('error',function(_0x226ba6){return _0x1f1d35(_0x226ba6);});_0x4fb0df[_0x4e71('0x6')](0x232a,'127.0.0.1',function(){console['log'](_0x4e71('0x83'),0x232a);return _0xfe1559('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x444e=['loggedInDb','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','push','find','omit','undefined','values','channels','length','voicechannel','validate','map','uniqueid','filename','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','../../../config/environment','../ami','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','total','type','unmanaged','abandoned'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x444e,0xe8));var _0xe444=function(_0x20f638,_0x590867){_0x20f638=_0x20f638-0x0;var _0x4fc65b=_0x444e[_0x20f638];return _0x4fc65b;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var jayson=require(_0xe444('0x1'));var schema=require('validate');var BPromise=require(_0xe444('0x2'));var moment=require('moment');var config=require(_0xe444('0x3'));var properties=require('../properties');var ami=require(_0xe444('0x4'));exports[_0xe444('0x5')]=function(_0x91763c,_0x394fc1,_0x36ac3b){return new BPromise(function(_0x1ddb27,_0x4834c7){var _0xfbd88b={'QueuePause':function(_0x4b5b7d){return new Promise(function(_0x29a2b7,_0x482b98){var _0x3199dd=util[_0xe444('0x6')](_0xe444('0x7'),'SIP',_0x4b5b7d['name']);if(_0x91763c[_0xe444('0x8')]&&_0x91763c[_0xe444('0x8')][_0x3199dd]&&_0x91763c['timers'][_0x3199dd][_0xe444('0x9')]){_0x91763c['timers'][_0x3199dd]['updateAcw']();}if(_0x91763c[_0xe444('0xa')][_0x3199dd]){_0x91763c['agents'][_0x3199dd][_0xe444('0xb')]({'statePause':_0x4b5b7d[_0xe444('0xc')]?!![]:![]});}_0x29a2b7({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x28c3e4){var _0x4f046c=this;return new Promise(function(_0x5ba044,_0x32e7f9){if(ami[_0xe444('0xd')]()==![]){return _0x32e7f9(_0x4f046c['error'](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk'][_0xe444('0xf')],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}_0x28c3e4=_[_0xe444('0x12')](_0x28c3e4,_[_0xe444('0x13')](properties[_0xe444('0x14')]));_0x28c3e4[_0xe444('0x15')]=_0xe444('0x16');return ami[_0xe444('0x17')](_0x28c3e4)[_0xe444('0x18')](function(_0x236bc4){_0x5ba044({'code':0xc8,'message':_0x236bc4[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x4e2711){_0x32e7f9(_0x4f046c[_0xe444('0x1b')](0x1f5,_0x4e2711[_0xe444('0x19')]));});});},'Command':function(_0x12eb54){var _0x2f6a4a=this;return new Promise(function(_0x58fd40,_0x306e05){if(ami[_0xe444('0xd')]()==![]){return _0x306e05(_0x2f6a4a[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config[_0xe444('0xe')]['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}_0x12eb54=_['pick'](_0x12eb54,_0xe444('0x1c'));_0x12eb54['action']=_0xe444('0x1d');return ami[_0xe444('0x17')](_0x12eb54)[_0xe444('0x18')](function(_0x322c07){_0x58fd40({'code':0xc8,'message':_0x322c07[_0xe444('0x1e')]});})['catch'](function(_0x527bf5){_0x306e05(_0x2f6a4a[_0xe444('0x1b')](0x1f5,_0x527bf5[_0xe444('0x19')]));});});},'VoiceQueues':function(_0x1ac266){return new Promise(function(_0x1ff6d2,_0x2a03a2){var _0x5e0311=[];for(var _0x3c9cf7 in _0x91763c[_0xe444('0x1f')]){if(_0x91763c['voiceQueues'][_0xe444('0x20')](_0x3c9cf7)){var _0x4f4412=_0x91763c[_0xe444('0x1f')][_0x3c9cf7];var _0x26ca6f={'id':_0x4f4412['id'],'name':_0x4f4412[_0xe444('0x21')],'strategy':_0x4f4412[_0xe444('0x22')],'answered':_0x4f4412[_0xe444('0x23')],'available':_0x4f4412['available'],'loggedIn':_0x4f4412[_0xe444('0x24')],'pTalking':_0x4f4412[_0xe444('0x25')],'sumBillable':_0x4f4412[_0xe444('0x26')],'sumDuration':_0x4f4412[_0xe444('0x27')],'sumHoldTime':_0x4f4412['sumHoldTime']||0x0,'talking':_0x4f4412['talking'],'total':_0x4f4412[_0xe444('0x28')],'type':_0x4f4412[_0xe444('0x29')],'unmanaged':_0x4f4412[_0xe444('0x2a')],'abandoned':_0x4f4412[_0xe444('0x2b')],'waiting':_0x4f4412['waiting'],'loggedInDb':_0x4f4412[_0xe444('0x2c')]};if(_0x4f4412[_0xe444('0x29')]===_0xe444('0x2d')){_0x26ca6f[_0xe444('0x2e')]=_0x4f4412['dialActive'];_0x26ca6f['dialMethod']=_0x4f4412['dialMethod'];_0x26ca6f[_0xe444('0x2f')]=_0x4f4412[_0xe444('0x2f')];_0x26ca6f[_0xe444('0x30')]=_0x4f4412[_0xe444('0x30')];_0x26ca6f[_0xe444('0x31')]=_0x4f4412['dialOriginateTimeout'];_0x26ca6f[_0xe444('0x32')]=_0x4f4412[_0xe444('0x32')];_0x26ca6f[_0xe444('0x33')]=_0x4f4412['temp'];_0x26ca6f[_0xe444('0x34')]=_0x4f4412['outboundAnswerAgiCallsDay'];_0x26ca6f['outboundAnswerCallsDay']=_0x4f4412[_0xe444('0x35')];_0x26ca6f[_0xe444('0x36')]=_0x4f4412['outboundBlacklistCallsDay'];_0x26ca6f[_0xe444('0x37')]=_0x4f4412['outboundBusyCallsDay'];_0x26ca6f[_0xe444('0x38')]=_0x4f4412['outboundCongestionCallsDay'];_0x26ca6f['outboundDropCallsDayACS']=_0x4f4412[_0xe444('0x39')];_0x26ca6f['outboundDropCallsDayCallersExit']=_0x4f4412[_0xe444('0x3a')];_0x26ca6f[_0xe444('0x3b')]=_0x4f4412[_0xe444('0x3b')];_0x26ca6f[_0xe444('0x3c')]=_0x4f4412['outboundNoAnswerCallsDay'];_0x26ca6f[_0xe444('0x3d')]=_0x4f4412[_0xe444('0x3d')];_0x26ca6f[_0xe444('0x3e')]=_0x4f4412['outboundOriginateFailureCallsDay'];_0x26ca6f[_0xe444('0x3f')]=_0x4f4412['outboundReCallsDay'];_0x26ca6f[_0xe444('0x40')]=_0x4f4412[_0xe444('0x40')];_0x26ca6f[_0xe444('0x41')]=_0x4f4412['outboundUnknownCallsDay'];_0x26ca6f['predictiveIntervalAnsweredCalls']=_0x4f4412[_0xe444('0x42')];_0x26ca6f[_0xe444('0x43')]=_0x4f4412[_0xe444('0x43')];_0x26ca6f[_0xe444('0x44')]=_0x4f4412[_0xe444('0x44')];_0x26ca6f[_0xe444('0x45')]=_0x4f4412[_0xe444('0x45')];_0x26ca6f['predictiveIntervalDroppedCallsTimeout']=_0x4f4412['predictiveIntervalDroppedCallsTimeout'];_0x26ca6f[_0xe444('0x46')]=_0x4f4412['predictiveIntervalErlangCalls'];_0x26ca6f[_0xe444('0x47')]=_0x4f4412['predictiveIntervalErlangCallsDroppedCalls'];_0x26ca6f[_0xe444('0x48')]=_0x4f4412[_0xe444('0x48')];_0x26ca6f[_0xe444('0x49')]=_0x4f4412[_0xe444('0x49')];_0x26ca6f[_0xe444('0x4a')]=_0x4f4412[_0xe444('0x4a')];_0x26ca6f['predictiveIntervalAvailable']=_0x4f4412[_0xe444('0x4b')];_0x26ca6f[_0xe444('0x4c')]=_0x4f4412[_0xe444('0x4c')];_0x26ca6f[_0xe444('0x19')]=_0x4f4412['message'];_0x26ca6f[_0xe444('0x4d')]=_0x4f4412[_0xe444('0x4d')];_0x26ca6f[_0xe444('0x4e')]=_0x4f4412[_0xe444('0x4e')];_0x26ca6f[_0xe444('0x4f')]=_0x4f4412[_0xe444('0x4f')];_0x26ca6f[_0xe444('0x50')]=_0x4f4412[_0xe444('0x50')];_0x26ca6f[_0xe444('0x51')]=_0x4f4412['erlangBusyFactor'];_0x26ca6f['startPredictive']=_0x4f4412['startPredictive'];_0x26ca6f[_0xe444('0x52')]=_0x4f4412[_0xe444('0x52')];}if(_0x4f4412[_0xe444('0x53')]){_0x26ca6f[_0xe444('0x53')]={'id':_0x4f4412[_0xe444('0x53')]['id'],'name':_0x4f4412['Trunk']['name'],'active':_0x4f4412[_0xe444('0x53')][_0xe444('0x54')],'callerid':_0x4f4412[_0xe444('0x53')]['callerid']};}if(_0x4f4412[_0xe444('0x55')]){_0x26ca6f[_0xe444('0x55')]={'id':_0x4f4412[_0xe444('0x55')]['id'],'name':_0x4f4412[_0xe444('0x55')][_0xe444('0x21')]};}_0x5e0311[_0xe444('0x56')](_0x26ca6f);}}_0x1ff6d2({'count':_0x5e0311['length'],'rows':_0x5e0311});});},'UpdateVoiceQueue':function(_0x595f81){return new Promise(function(_0x3c8636,_0x2f550f){var _0x2eba87=_[_0xe444('0x57')](_0x91763c['voiceQueues'],{'id':parseInt(_0x595f81['id'])});var _0x13b92d=_[_0xe444('0x58')](_0x595f81,['id']);if(_0x2eba87){for(var _0x3549d0 in _0x13b92d){if(typeof _0x13b92d[_0x3549d0]!==_0xe444('0x59')&&typeof _0x2eba87[_0x3549d0]!==_0xe444('0x59')){_0x2eba87[_0x3549d0]=_0x13b92d[_0x3549d0];}}_0x3c8636(_0x2eba87);}else{_0x2f550f();}});},'VoiceChannels':function(_0x300cea){return new Promise(function(_0x10b183,_0x26d4d3){var _0x4ae871=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x5b')]);_0x10b183({'count':_0x4ae871[_0xe444('0x5c')],'rows':_0x4ae871});});},'VoiceChannelMixMonitor':function(_0x4cb019){var _0x124fc3=this;return new Promise(function(_0x51ce26,_0x5736a2){if(ami['isConnected']()==![]){return _0x5736a2(_0x124fc3[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk']['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x53bde2=schema(properties[_0xe444('0x5d')])[_0xe444('0x5e')](_0x4cb019);if(_0x53bde2[_0xe444('0x5c')]>0x0){return _0x5736a2(_0x124fc3['error'](0x1f4,_[_0xe444('0x5f')](_0x53bde2,'message')[_0xe444('0x11')](',\x20')));}var _0x3f65d3=_['find'](_0x91763c['channels'],{'uniqueid':_0x4cb019[_0xe444('0x60')]});if(_0x3f65d3&&_0x3f65d3['channel']){var _0x251c70=util[_0xe444('0x6')]('%s.%s',_0x4cb019[_0xe444('0x61')]||_0x4cb019[_0xe444('0x60')],_0x4cb019[_0xe444('0x6')]||_0xe444('0x62'));return ami[_0xe444('0x17')]({'action':_0xe444('0x63'),'channel':_0x3f65d3[_0xe444('0x64')],'file':_0x251c70,'options':_0xe444('0x65')})[_0xe444('0x18')](function(_0x34482f){var _0x3286b6=_[_0xe444('0x57')](_0x3f65d3['monitors'],{'filename':_0xe444('0x66')+_0x251c70[_0xe444('0x67')]()});if(_['isNil'](_0x3286b6)){_0x3f65d3[_0xe444('0x68')]['push']({'filename':_0xe444('0x66')+_0x251c70['toLowerCase'](),'createdAt':moment()[_0xe444('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x34482f[_0xe444('0x69')],'status':_0xe444('0x6a')});}else{_0x3286b6[_0xe444('0x69')]=_0x34482f[_0xe444('0x69')];_0x3286b6[_0xe444('0x6b')]='rec';}_0x51ce26({'code':0xc8,'message':[_0x4cb019[_0xe444('0x60')],_0xe444('0x6c'),_0x34482f['mixmonitorid']][_0xe444('0x11')]('\x20'),'mixmonitorid':_0x34482f[_0xe444('0x69')]});})[_0xe444('0x1a')](function(_0x372909){_0x5736a2(_0x124fc3['error'](0x1f5,[_0x4cb019[_0xe444('0x60')],_0x372909[_0xe444('0x19')]['toLowerCase']()][_0xe444('0x11')]('\x20')));});}else{return _0x5736a2(_0x124fc3[_0xe444('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x486d5c){var _0x1bd0dc=this;return new Promise(function(_0x35793c,_0x31f478){if(ami[_0xe444('0xd')]()==![]){return _0x31f478(_0x1bd0dc['error'](0x1f4,[config[_0xe444('0xe')]['ip'],config['asterisk'][_0xe444('0xf')],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x152feb=schema(properties[_0xe444('0x5d')])['validate'](_0x486d5c);if(_0x152feb[_0xe444('0x5c')]>0x0){return _0x31f478(_0x1bd0dc[_0xe444('0x1b')](0x1f4,_['map'](_0x152feb,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x3a9acf=_[_0xe444('0x57')](_0x91763c[_0xe444('0x5b')],{'uniqueid':_0x486d5c[_0xe444('0x60')]});if(_0x3a9acf){return BPromise[_0xe444('0x6d')]()[_0xe444('0x18')](function(){if(_0x3a9acf[_0xe444('0x64')]){return ami[_0xe444('0x17')]({'action':_0xe444('0x6e'),'channel':_0x3a9acf['channel'],'mixmonitorid':_0x486d5c[_0xe444('0x69')]})[_0xe444('0x1a')](function(_0x4d91e3){});}})[_0xe444('0x18')](function(){if(_0x3a9acf['destinationchannel']){return ami[_0xe444('0x17')]({'action':_0xe444('0x6e'),'channel':_0x3a9acf[_0xe444('0x6f')],'mixmonitorid':_0x486d5c[_0xe444('0x69')]})['catch'](function(_0x28bdc2){});}})[_0xe444('0x18')](function(_0x5a0cb4){var _0xa45ffa=_[_0xe444('0x57')](_0x3a9acf['monitors'],{'mixmonitorid':_0x486d5c[_0xe444('0x69')]});if(_0xa45ffa){_0xa45ffa[_0xe444('0x6b')]=_0xe444('0x70');}})['then'](function(){var _0x849c5c=util[_0xe444('0x6')]('%s.%s',_0x486d5c[_0xe444('0x61')]||_0x486d5c[_0xe444('0x60')],_0x486d5c[_0xe444('0x6')]||_0xe444('0x62'));var _0x392a3a=_[_0xe444('0x57')](_0x3a9acf[_0xe444('0x68')],{'filename':_0xe444('0x66')+_0x849c5c['toLowerCase']()});if(_0x392a3a){_0x392a3a[_0xe444('0x6b')]=_0xe444('0x70');}})[_0xe444('0x18')](function(){_0x35793c({'code':0xc8,'message':[_0x486d5c[_0xe444('0x60')],'StopMixMonitor\x20Success'][_0xe444('0x11')]('\x20')});})[_0xe444('0x1a')](function(_0x37e49f){_0x31f478(_0x1bd0dc['error'](0x1f5,[_0x486d5c[_0xe444('0x60')],_0x37e49f[_0xe444('0x19')][_0xe444('0x67')]()][_0xe444('0x11')]('\x20')));});}else{return _0x31f478(_0x1bd0dc[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannels':function(_0x32f7ed){return new Promise(function(_0x365d7f,_0x36a6a3){var _0x4d6bd4=_[_0xe444('0x5a')](_0x91763c['queueChannels']);_0x365d7f({'count':_0x4d6bd4[_0xe444('0x5c')],'rows':_0x4d6bd4});});},'VoiceQueuesChannel':function(_0x289b59){var _0x458851=this;return new Promise(function(_0x499246,_0x4ca57c){var _0x37533c=schema(properties['voicequeuechannel'])[_0xe444('0x5e')](_0x289b59);if(_0x37533c[_0xe444('0x5c')]>0x0){return _0x4ca57c(_0x458851[_0xe444('0x1b')](0x1f4,_['map'](_0x37533c,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x1edb83=_[_0xe444('0x57')](_0x91763c[_0xe444('0x72')],{'uniqueid':_0x289b59['uniqueid']});if(_0x1edb83){_0x499246(_0x1edb83);}else{return _0x4ca57c(_0x458851['error'](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x5bb065){var _0x151a8f=this;return new Promise(function(_0x153bd8,_0x2ad3e3){if(ami['isConnected']()==![]){return _0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0xe444('0xe')][_0xe444('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x4a1328=schema(properties[_0xe444('0x73')])['validate'](_0x5bb065);if(_0x4a1328[_0xe444('0x5c')]>0x0){return _0x2ad3e3(_0x151a8f['error'](0x1f4,_['map'](_0x4a1328,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x1398c2=_[_0xe444('0x57')](_0x91763c['queueChannels'],{'uniqueid':_0x5bb065['uniqueid']});if(_0x1398c2&&_0x1398c2[_0xe444('0x64')]){return ami['Action']({'action':_0xe444('0x74'),'channel':_0x1398c2[_0xe444('0x64')]})['then'](function(_0x5e863f){_0x153bd8({'code':0xc8,'message':[_0x5bb065[_0xe444('0x60')],_0x5e863f[_0xe444('0x19')][_0xe444('0x67')]()][_0xe444('0x11')]('\x20')});})[_0xe444('0x1a')](function(_0x192834){_0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f5,[_0x5bb065[_0xe444('0x60')],_0x192834['message'][_0xe444('0x67')]()]['join']('\x20')));});}else{return _0x2ad3e3(_0x151a8f[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x3ae01f){var _0x43796f=this;return new Promise(function(_0x57a209,_0x354c3a){if(ami[_0xe444('0xd')]()==![]){return _0x354c3a(_0x43796f[_0xe444('0x1b')](0x1f4,[config[_0xe444('0xe')]['ip'],config[_0xe444('0xe')]['username'],_0xe444('0x10')][_0xe444('0x11')]('\x20')));}var _0x1d7b58=schema(properties[_0xe444('0x75')])[_0xe444('0x5e')](_0x3ae01f);if(_0x1d7b58[_0xe444('0x5c')]>0x0){return _0x354c3a(_0x43796f['error'](0x1f4,_[_0xe444('0x5f')](_0x1d7b58,_0xe444('0x19'))[_0xe444('0x11')](',\x20')));}var _0x4cfc14=_['find'](_0x91763c[_0xe444('0x72')],{'uniqueid':_0x3ae01f[_0xe444('0x60')]});if(_0x4cfc14&&_0x4cfc14[_0xe444('0x64')]){return ami[_0xe444('0x17')]({'action':_0xe444('0x76'),'channel':_0x4cfc14[_0xe444('0x64')],'exten':_0x3ae01f[_0xe444('0x77')],'context':_0x3ae01f['context']||_0x4cfc14[_0xe444('0x78')],'priority':0x1})[_0xe444('0x18')](function(_0x40261a){_0x57a209({'code':0xc8,'message':[_0x3ae01f['uniqueid'],_0x40261a[_0xe444('0x19')][_0xe444('0x67')]()]['join']('\x20')});})[_0xe444('0x1a')](function(_0x50fca3){_0x354c3a(_0x43796f['error'](0x1f5,[_0x3ae01f[_0xe444('0x60')],_0x50fca3[_0xe444('0x19')][_0xe444('0x67')]()]['join']('\x20')));});}else{return _0x354c3a(_0x43796f[_0xe444('0x1b')](0x1f5,_0xe444('0x71')));}});},'Agents':function(_0x3be23c){return new Promise(function(_0x51b876,_0x225dc4){var _0x241ea0=_['values'](_0x91763c[_0xe444('0xa')]);_0x51b876({'count':_0x241ea0['length'],'rows':_0x241ea0});});},'Telephones':function(_0x656676){return new Promise(function(_0x538968,_0x1372a7){var _0x5605cf=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x79')]);_0x538968({'count':_0x5605cf[_0xe444('0x5c')],'rows':_0x5605cf});});},'Trunks':function(_0xe57d6b){return new Promise(function(_0x292ecc,_0x26d26d){var _0x517f69=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x7a')]);_0x292ecc({'count':_0x517f69[_0xe444('0x5c')],'rows':_0x517f69});});},'OutboundChannels':function(_0x252f5d){return new Promise(function(_0xcf8b68,_0x29e74c){var _0x5b67eb=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x7b')]);_0xcf8b68({'count':_0x5b67eb[_0xe444('0x5c')],'rows':_0x5b67eb});});},'Outbound':function(_0x146199){return new Promise(function(_0x4cda77,_0x5a3f3e){_0x4cda77(_0x91763c[_0xe444('0x2d')]);});},'Campaigns':function(_0x4df1fc){return new Promise(function(_0x32e5b6,_0x120f49){var _0x356445=_['values'](_0x91763c[_0xe444('0x7c')]);_0x32e5b6({'count':_0x356445['length'],'rows':_0x356445});});},'VoiceQueuesPreview':function(_0x191d33){var _0x36d9be=this;return new Promise(function(_0x601c26,_0x3f1842){_0x394fc1[_0xe444('0x7d')](_0x191d33['id'])[_0xe444('0x18')](function(_0x1ef277){_0x601c26({'code':0xc8,'message':_0x1ef277[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x3ec157){_0x3f1842(_0x36d9be[_0xe444('0x1b')](0x1f4,_0x3ec157[_0xe444('0x19')]));});});},'EventManager':function(_0x34deff){var _0x502f03=this;return new Promise(function(_0x3bea13,_0x507864){if(!_0x34deff[_0xe444('0x7e')]){return _0x507864(_0x502f03[_0xe444('0x1b')](0x1f4,_0xe444('0x7f')));}ami[_0xe444('0x80')](_0xe444('0x81')+_0x34deff[_0xe444('0x7e')],_0x34deff[_0xe444('0x19')]);_0x3bea13({'code':0xc8,'message':_0x34deff});});},'FaxAccounts':function(_0x806511){return new Promise(function(_0x5a7c24,_0x32d87f){var _0xbe9eef=_[_0xe444('0x5a')](_0x91763c[_0xe444('0x82')]);_0x5a7c24({'count':_0xbe9eef[_0xe444('0x5c')],'rows':_0xbe9eef});});},'SendFax':function(_0x5e31ef){var _0x1fa6fa=this;return new Promise(function(_0x4e7bfe,_0x1fa8ca){_0x36ac3b[_0xe444('0x83')](_0x5e31ef)['then'](function(_0x5a6ff4){_0x4e7bfe({'code':0xc8,'message':_0x5a6ff4[_0xe444('0x19')]});})[_0xe444('0x1a')](function(_0x592b5a){_0x1fa8ca(_0x1fa6fa[_0xe444('0x1b')](0x1f4,_0x592b5a[_0xe444('0x19')]));});});},'CheckAfterSend':function(_0x26792f){var _0x1505f5=this;return new Promise(function(_0x52bf94,_0x18d289){_0x36ac3b['checkAfterSend'](_0x26792f)[_0xe444('0x18')](function(_0x16532c){_0x52bf94({'code':0xc8,'message':_0x16532c['message']});})[_0xe444('0x1a')](function(_0xc46db3){_0x18d289(_0x1505f5[_0xe444('0x1b')](0x1f4,_0xc46db3[_0xe444('0x19')]));});});}};var _0x1b2ec0=jayson[_0xe444('0x84')](_0xfbd88b)[_0xe444('0x85')]();_0x1b2ec0['on'](_0xe444('0x1b'),function(_0x4692b5){return _0x4834c7(_0x4692b5);});_0x1b2ec0[_0xe444('0x5')](0x232a,_0xe444('0x86'),function(){console[_0xe444('0x87')](_0xe444('0x88'),0x232a);return _0x1ddb27(_0xe444('0x89')+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 5de62ce..1579bac 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 _0x70e0=['[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','data4','firstName','calleridname','','destcalleridname','Unknown','then','createContact'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x70e0,0x17b));var _0x070e=function(_0x29e246,_0x3329b0){_0x29e246=_0x29e246-0x0;var _0x2fc83c=_0x70e0[_0x29e246];return _0x2fc83c;};'use strict';var _=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var Redis=require(_0x070e('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x070e('0x3'))(_0x070e('0x4'));var cmContactRpc=require(_0x070e('0x5'));config[_0x070e('0x6')]=_['defaults'](config[_0x070e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x7'))(new Redis(config['redis']));function emit(_0x56e420,_0x5032e5,_0x35ab0c,_0x1e11f0,_0x604664){logger[_0x070e('0x8')](_0x070e('0x9'),_0x56e420,_0x5032e5['id'],_0x35ab0c,_0x1e11f0,JSON[_0x070e('0xa')](_0x604664));io['to'](_0x35ab0c)[_0x070e('0xb')](_0x1e11f0,_0x604664);}exports['exec']=function(_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37){var _0xb8d819,_0xa927a2;var _0xffcdd6={};var _0x25cfe1=Number(_0x2e3e5e[_0x070e('0xc')]);var _0x39d2b9=_0x2e3e5e[_0x070e('0xd')]?Boolean(Number(_0x2e3e5e[_0x070e('0xd')])):![];var _0x52da3b;var _0x5dca0f=![];if(!_[_0x070e('0xe')](_0x2e3e5e['data5'])){if(_0x2e3e5e['data5']=='1')_0x5dca0f=!![];}if(!_0x5dca0f){if(_0x12bb37['xmd-contactid']){_0xffcdd6['id']=_0x12bb37[_0x070e('0xf')];}}if(!_0xffcdd6['id']){_0xffcdd6[_0x070e('0x10')]=_0x25cfe1;_0x52da3b=_0x2e3e5e['data3']&&_0x2e3e5e['data3']!=='0'?_0x2e3e5e[_0x070e('0x11')][_0x070e('0x12')](','):[_0x070e('0x13')];_0xffcdd6[_0x070e('0x14')]=_['map'](_0x52da3b,function(_0x49861b){var _0x17e2e4={};_0x17e2e4[_0x49861b]=_0x12bb37[_0x070e('0x15')]?_0x12bb37[_0x070e('0x16')]:_0x12bb37[_0x070e('0x17')];return _0x17e2e4;});}var _0x364b3f=['id','firstName',_0x070e('0x18'),_0x070e('0x13'),_0x070e('0x19'),_0x070e('0x1a'),_0x070e('0x10'),'createdAt','scheduledAt','updatedAt'];var _0x9907cf=_[_0x070e('0x1b')](_0x364b3f,_0x52da3b);BPromise[_0x070e('0x1c')]()['then'](cmContactRpc[_0x070e('0x1d')]({'attributes':_0x9907cf,'where':_0xffcdd6}))['then'](function(_0xf8dd5d){_0xa927a2=_0xf8dd5d;if(!_[_0x070e('0x1e')](_0xa927a2)){if(_0xa927a2[_0x070e('0x1f')]===0x1){_0xb8d819=_0xa927a2[0x0];logger[_0x070e('0x8')](_0x070e('0x20'),_0x12bb37[_0x070e('0x21')],_0x50f4eb['id'],_0xb8d819['id']);}else{logger[_0x070e('0x8')](_0x070e('0x22'),_0x12bb37['uniqueid'],_0x50f4eb['id'],_[_0x070e('0x23')](_0xa927a2,'id')[_0x070e('0x24')](','));}return;}else{logger[_0x070e('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x12bb37[_0x070e('0x21')],_0x50f4eb['id']);var _0x5f3e9d={'ListId':_0x25cfe1};var _0x4a2dbd=_0x2e3e5e[_0x070e('0x25')]&&_0x2e3e5e[_0x070e('0x25')]!=='0'?_0x2e3e5e[_0x070e('0x25')]:_0x070e('0x13');if(_0x39d2b9){logger[_0x070e('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x12bb37[_0x070e('0x21')],_0x50f4eb['id']);_0x5f3e9d[_0x4a2dbd]=_[_0x070e('0xe')](_0x12bb37[_0x070e('0x15')])?_0x12bb37[_0x070e('0x17')]:_0x12bb37[_0x070e('0x16')];if(_[_0x070e('0xe')](_0x12bb37[_0x070e('0x15')])){_0x5f3e9d[_0x070e('0x26')]=_0x12bb37['calleridname']&&_0x12bb37[_0x070e('0x27')]!==_0x070e('0x28')?_0x12bb37[_0x070e('0x27')]:'Unknown';}else{_0x5f3e9d['firstName']=_0x12bb37[_0x070e('0x29')]&&_0x12bb37[_0x070e('0x29')]!==_0x070e('0x28')?_0x12bb37['destcalleridname']:_0x070e('0x2a');}return BPromise[_0x070e('0x1c')]()[_0x070e('0x2b')](cmContactRpc[_0x070e('0x2c')](_0x5f3e9d))['then'](function(_0x5bf522){_0xb8d819=_0x5bf522;_0xa927a2['push'](_0x5bf522);if(_0xb8d819){logger['info'](_0x070e('0x2d'),_0x12bb37['uniqueid'],_0x50f4eb['id'],_0xb8d819['id']);}return;});}else{logger[_0x070e('0x8')](_0x070e('0x2e'),_0x12bb37['uniqueid'],_0x50f4eb['id']);_0x5f3e9d[_0x4a2dbd]=_['isNil'](_0x12bb37[_0x070e('0x15')])?_0x12bb37[_0x070e('0x17')]:_0x12bb37['destcalleridnum'];if(_['isNil'](_0x12bb37[_0x070e('0x15')])){_0x5f3e9d[_0x070e('0x26')]=_0x12bb37[_0x070e('0x27')]&&_0x12bb37[_0x070e('0x27')]!==_0x070e('0x28')?_0x12bb37['calleridname']:'Unknown';}else{_0x5f3e9d[_0x070e('0x26')]=_0x12bb37[_0x070e('0x29')]&&_0x12bb37[_0x070e('0x29')]!==_0x070e('0x28')?_0x12bb37[_0x070e('0x29')]:'Unknown';}_0xb8d819=_0x5f3e9d;_0xa927a2[_0x070e('0x2f')](_0x5f3e9d);return;}}})[_0x070e('0x2b')](function(){if(_0x49b2fb){emit(_0x12bb37['uniqueid'],_0x50f4eb,util[_0x070e('0x30')](_0x070e('0x31'),_0x49b2fb['name']),util['format']('trigger:%s',_0x2e3e5e[_0x070e('0x32')][_0x070e('0x33')]()),{'evt':_[_0x070e('0x34')](_0x12bb37,{'autoCreate':_0x39d2b9}),'contact':_0xb8d819===undefined?{}:_0xb8d819,'contacts':_0xa927a2[_0x070e('0x1f')]===0x0?undefined:_0xa927a2});}});}; \ No newline at end of file +var _0x032e=['format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s',''];(function(_0x5a6253,_0x4dd0b5){var _0x5816b3=function(_0x448846){while(--_0x448846){_0x5a6253['push'](_0x5a6253['shift']());}};_0x5816b3(++_0x4dd0b5);}(_0x032e,0x124));var _0xe032=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x032e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe032('0x0'));var BPromise=require('bluebird');var Redis=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe032('0x3'));var cmContactRpc=require(_0xe032('0x4'));config[_0xe032('0x5')]=_[_0xe032('0x6')](config[_0xe032('0x5')],{'host':_0xe032('0x7'),'port':0x18eb});var io=require(_0xe032('0x8'))(new Redis(config[_0xe032('0x5')]));function emit(_0x37432f,_0x1576c8,_0x3289b0,_0xd84027,_0xaf3907){logger[_0xe032('0x9')](_0xe032('0xa'),_0x37432f,_0x1576c8['id'],_0x3289b0,_0xd84027,JSON[_0xe032('0xb')](_0xaf3907));io['to'](_0x3289b0)[_0xe032('0xc')](_0xd84027,_0xaf3907);}exports[_0xe032('0xd')]=function(_0x4aec53,_0x1382e1,_0x1ce2ae,_0x13c126){var _0x42e2ba,_0x244f93;var _0x21883b={};var _0x2194fc=Number(_0x1ce2ae['data1']);var _0x646979=_0x1ce2ae[_0xe032('0xe')]?Boolean(Number(_0x1ce2ae[_0xe032('0xe')])):![];var _0x1a53ab;var _0x4aee44=![];if(!_[_0xe032('0xf')](_0x1ce2ae[_0xe032('0x10')])){if(_0x1ce2ae[_0xe032('0x10')]=='1')_0x4aee44=!![];}if(!_0x4aee44){if(_0x13c126[_0xe032('0x11')]){_0x21883b['id']=_0x13c126[_0xe032('0x11')];}}if(!_0x21883b['id']){_0x21883b[_0xe032('0x12')]=_0x2194fc;_0x1a53ab=_0x1ce2ae[_0xe032('0x13')]&&_0x1ce2ae['data3']!=='0'?_0x1ce2ae[_0xe032('0x13')][_0xe032('0x14')](','):[_0xe032('0x15')];_0x21883b[_0xe032('0x16')]=_[_0xe032('0x17')](_0x1a53ab,function(_0x208b00){var _0x4cdab3={};_0x4cdab3[_0x208b00]=_0x13c126[_0xe032('0x18')]?_0x13c126[_0xe032('0x19')]:_0x13c126[_0xe032('0x1a')];return _0x4cdab3;});}var _0x41d2a5=['id',_0xe032('0x1b'),'lastName','phone','mobile',_0xe032('0x1c'),'ListId',_0xe032('0x1d'),_0xe032('0x1e'),_0xe032('0x1f')];var _0x2aa342=_[_0xe032('0x20')](_0x41d2a5,_0x1a53ab);BPromise[_0xe032('0x21')]()[_0xe032('0x22')](cmContactRpc['getContacts']({'attributes':_0x2aa342,'where':_0x21883b}))[_0xe032('0x22')](function(_0x866c81){_0x244f93=_0x866c81;if(!_[_0xe032('0x23')](_0x244f93)){if(_0x244f93[_0xe032('0x24')]===0x1){_0x42e2ba=_0x244f93[0x0];logger[_0xe032('0x9')](_0xe032('0x25'),_0x13c126[_0xe032('0x26')],_0x1382e1['id'],_0x42e2ba['id']);}else{logger[_0xe032('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x13c126['uniqueid'],_0x1382e1['id'],_['map'](_0x244f93,'id')[_0xe032('0x27')](','));}return;}else{logger[_0xe032('0x9')](_0xe032('0x28'),_0x13c126[_0xe032('0x26')],_0x1382e1['id']);var _0x2bfe8f={'ListId':_0x2194fc};var _0x200671=_0x1ce2ae[_0xe032('0x29')]&&_0x1ce2ae[_0xe032('0x29')]!=='0'?_0x1ce2ae[_0xe032('0x29')]:_0xe032('0x15');if(_0x646979){logger['info'](_0xe032('0x2a'),_0x13c126[_0xe032('0x26')],_0x1382e1['id']);_0x2bfe8f[_0x200671]=_[_0xe032('0xf')](_0x13c126[_0xe032('0x18')])?_0x13c126['calleridnum']:_0x13c126['destcalleridnum'];if(_[_0xe032('0xf')](_0x13c126[_0xe032('0x18')])){_0x2bfe8f[_0xe032('0x1b')]=_0x13c126[_0xe032('0x2b')]&&_0x13c126['calleridname']!==''?_0x13c126['calleridname']:_0xe032('0x2c');}else{_0x2bfe8f[_0xe032('0x1b')]=_0x13c126[_0xe032('0x2d')]&&_0x13c126[_0xe032('0x2d')]!==''?_0x13c126[_0xe032('0x2d')]:_0xe032('0x2c');}return BPromise[_0xe032('0x21')]()[_0xe032('0x22')](cmContactRpc[_0xe032('0x2e')](_0x2bfe8f))['then'](function(_0xd90bd5){_0x42e2ba=_0xd90bd5;_0x244f93[_0xe032('0x2f')](_0xd90bd5);if(_0x42e2ba){logger[_0xe032('0x9')](_0xe032('0x30'),_0x13c126['uniqueid'],_0x1382e1['id'],_0x42e2ba['id']);}return;});}else{logger[_0xe032('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x13c126[_0xe032('0x26')],_0x1382e1['id']);_0x2bfe8f[_0x200671]=_['isNil'](_0x13c126[_0xe032('0x18')])?_0x13c126['calleridnum']:_0x13c126[_0xe032('0x19')];if(_['isNil'](_0x13c126[_0xe032('0x18')])){_0x2bfe8f[_0xe032('0x1b')]=_0x13c126['calleridname']&&_0x13c126[_0xe032('0x2b')]!==_0xe032('0x31')?_0x13c126[_0xe032('0x2b')]:_0xe032('0x2c');}else{_0x2bfe8f['firstName']=_0x13c126[_0xe032('0x2d')]&&_0x13c126['destcalleridname']!==_0xe032('0x31')?_0x13c126[_0xe032('0x2d')]:'Unknown';}_0x42e2ba=_0x2bfe8f;_0x244f93[_0xe032('0x2f')](_0x2bfe8f);return;}}})[_0xe032('0x22')](function(){if(_0x4aec53){emit(_0x13c126['uniqueid'],_0x1382e1,util[_0xe032('0x32')](_0xe032('0x33'),_0x4aec53[_0xe032('0x34')]),util[_0xe032('0x32')](_0xe032('0x35'),_0x1ce2ae[_0xe032('0x36')][_0xe032('0x37')]()),{'evt':_[_0xe032('0x38')](_0x13c126,{'autoCreate':_0x646979}),'contact':_0x42e2ba===undefined?{}:_0x42e2ba,'contacts':_0x244f93[_0xe032('0x24')]===0x0?undefined:_0x244f93});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 38bdfb0..506a250 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 _0xbd0a=['TemplateId','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','600','winArguments','render','format','user:%s','trigger:%s:%s','toLowerCase','data1','merge','jscripty','name','trigger:%s','integration','exec','queue','routeId','urlforward','script','parse','search','replace','AllConditions','every','channel','AnyConditions','checkConditions','field','chat','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','created','equals','exports','util','url','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','salesforceAccounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','clone','undefined','motionChannel','voice','checkTriggers','status','checkTrigger','variables','Actions','length','interface','action','contactmanager','motionbar','browser'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x534a00,_0x765776){_0x534a00=_0x534a00-0x0;var _0xac529d=_0xbd0a[_0x534a00];return _0xac529d;};'use strict';var util=require(_0xabd0('0x0'));var _=require('lodash');var url=require(_0xabd0('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xabd0('0x2'));var cmContact=require(_0xabd0('0x3'));var script=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var logger=require(_0xabd0('0x6'))(_0xabd0('0x7'));var ami=require(_0xabd0('0x8'));config[_0xabd0('0x9')]=_[_0xabd0('0xa')](config['redis'],{'host':_0xabd0('0xb'),'port':0x18eb});var io=require(_0xabd0('0xc'))(new Redis(config[_0xabd0('0x9')]));var operators={'equals':function(_0x57f735,_0x37cc47){return _0x57f735==_0x37cc47;},'not_equals':function(_0x4830c4,_0x151048){return _0x4830c4!=_0x151048;}};var barAndWebActions=[_0xabd0('0xd'),_0xabd0('0x1'),_0xabd0('0xe')];function Trigger(_0x50fc2d){this[_0xabd0('0xf')]=_0x50fc2d['triggers'];this[_0xabd0('0x10')]=_0x50fc2d[_0xabd0('0x10')];this[_0xabd0('0x11')]=_0x50fc2d[_0xabd0('0x11')];this[_0xabd0('0x12')]=_0x50fc2d[_0xabd0('0x12')];this['voiceExtensions']=_0x50fc2d[_0xabd0('0x13')];this['zendeskAccounts']=_0x50fc2d[_0xabd0('0x14')];this[_0xabd0('0x15')]=_0x50fc2d['freshdeskAccounts'];this['salesforceAccounts']=_0x50fc2d['salesforceAccounts'];this['sugarcrmAccounts']=_0x50fc2d[_0xabd0('0x16')];this[_0xabd0('0x17')]=_0x50fc2d[_0xabd0('0x17')];this[_0xabd0('0x18')]=_0x50fc2d[_0xabd0('0x18')];this[_0xabd0('0x19')]=_0x50fc2d[_0xabd0('0x19')];this[_0xabd0('0x1a')]=_0x50fc2d[_0xabd0('0x1a')];this['dynamics365Accounts']=_0x50fc2d[_0xabd0('0x1b')];this['freshsalesAccounts']=_0x50fc2d['freshsalesAccounts'];this[_0xabd0('0x1c')]={'zendesk':this[_0xabd0('0x14')],'salesforce':this[_0xabd0('0x1d')],'freshdesk':this[_0xabd0('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xabd0('0x17')],'desk':this[_0xabd0('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xabd0('0x1e')],'servicenow':this[_0xabd0('0x1a')]};ami['on']('custom:agentcalled',this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x21'),this[_0xabd0('0x1f')]['bind'](this));ami['on'](_0xabd0('0x22'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x23'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x24'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x25'),this['syncCustomEvent'][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x26'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x27'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x28'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x29'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x2a'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on']('custom:timeout',this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x2b'),this[_0xabd0('0x2c')]['bind'](this));ami['on'](_0xabd0('0x2d'),this[_0xabd0('0x2c')][_0xabd0('0x20')](this));ami['on']('custom:dialend',this[_0xabd0('0x2c')][_0xabd0('0x20')](this));ami['on']('custom:newinteraction',this[_0xabd0('0x1f')]['bind'](this));ami['on'](_0xabd0('0x2e'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x2f'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on']('custom:incomingmessage',this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x30'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x31'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x32'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));ami['on'](_0xabd0('0x33'),this[_0xabd0('0x1f')][_0xabd0('0x20')](this));}Trigger[_0xabd0('0x34')]['emit']=function(_0x500b5c,_0x598af3,_0x3b843a){logger[_0xabd0('0x35')](_0x500b5c,_0x598af3,JSON[_0xabd0('0x36')](_0x3b843a));io['to'](_0x500b5c)[_0xabd0('0x37')](_0x598af3,_0x3b843a);};Trigger[_0xabd0('0x34')]['syncCustomEvent']=function(_0x5aaf21){var _0x4d11bc=_[_0xabd0('0x38')](_0x5aaf21);if(typeof _0x4d11bc['motionChannel']===_0xabd0('0x39')){_0x4d11bc[_0xabd0('0x3a')]=_0xabd0('0x3b');}this[_0xabd0('0x3c')](_0x4d11bc);};Trigger[_0xabd0('0x34')][_0xabd0('0x2c')]=function(_0x69329a){if(this[_0xabd0('0x10')][_0x69329a['interface']]){this[_0xabd0('0x1f')](_0x69329a);}};Trigger['prototype']['checkTriggers']=function(_0x1c611c){var _0x2841f2;for(var _0xea7d59 in this[_0xabd0('0xf')]){if(this[_0xabd0('0xf')]['hasOwnProperty'](_0xea7d59)){if(this[_0xabd0('0xf')][_0xea7d59][_0xabd0('0x3d')]){_0x2841f2=this[_0xabd0('0x3e')](this[_0xabd0('0xf')][_0xea7d59],_0x1c611c);if(_0x2841f2){_['merge'](_0x1c611c,_0x1c611c[_0xabd0('0x3f')]);for(var _0x41d397=0x0,_0x1c498f,_0x331581,_0x2ce76a;_0x41d3970x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x2305cb,_0x1ded24){var _0x2cc2ac=function(_0x55dcc4){while(--_0x55dcc4){_0x2305cb['push'](_0x2305cb['shift']());}};_0x2cc2ac(++_0x1ded24);}(_0x7217,0x19e));var _0x7721=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7217[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 36d5ce6..49140d9 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 _0x9aa2=['isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','catch','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','calleridnum','replace','%2b','value','telephone1','contactid','nothing','forEach','includes','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Descriptions','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','remoteUri','username','password','then','access_token','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','userEmail','email','length','internalemailaddress'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9aa2,0x191));var _0x29aa=function(_0x574fff,_0x4ca368){_0x574fff=_0x574fff-0x0;var _0x1d6692=_0x9aa2[_0x574fff];return _0x1d6692;};'use strict';var _=require(_0x29aa('0x0'));var rp=require(_0x29aa('0x1'));var util=require(_0x29aa('0x2'));var intUtil=require(_0x29aa('0x3'));var md5=require(_0x29aa('0x4'));var Redis=require(_0x29aa('0x5'));var logger=require(_0x29aa('0x6'))(_0x29aa('0x7'));var config=require(_0x29aa('0x8'));config[_0x29aa('0x9')]=_[_0x29aa('0xa')](config['redis'],{'host':_0x29aa('0xb'),'port':0x18eb});var io=require(_0x29aa('0xc'))(new Redis(config[_0x29aa('0x9')]));function getAuthToken(_0x1e98de,_0x4d52b2,_0x2590ea){if(_0x1e98de[_0x29aa('0xd')]){_0x1e98de['remoteUri']=_0x1e98de[_0x29aa('0xe')][_0x29aa('0xf')];_0x1e98de[_0x29aa('0x10')]=_0x1e98de['CloudProvider'][_0x29aa('0x11')];return Promise[_0x29aa('0x12')](_0x1e98de[_0x29aa('0xe')][_0x29aa('0x13')]);}var _0xb8b782={'method':_0x29aa('0x14'),'uri':_0x4d52b2,'form':{'client_id':_0x1e98de[_0x29aa('0x15')],'resource':_0x1e98de[_0x29aa('0x16')],'username':_0x1e98de[_0x29aa('0x17')],'password':_0x1e98de[_0x29aa('0x18')],'grant_type':_0x29aa('0x18'),'client_secret':_0x1e98de['clientSecret']},'json':!![]};return rp(_0xb8b782)[_0x29aa('0x19')](function(_0x3a4cb1){return _0x3a4cb1[_0x29aa('0x1a')];})['catch'](function(_0x573b51){logger[_0x29aa('0x1b')]('['+[_0x2590ea['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x573b51[_0x29aa('0x1c')];});}function getUser(_0x27596a,_0x3aff37,_0x3714af,_0x12d877,_0x3c04eb,_0x32ccb6){return new Promise(function(_0xbe263,_0x234f7c){return getAuthToken(_0x3aff37,_0x12d877,_0x32ccb6)[_0x29aa('0x19')](function(_0x485260){var _0x353339={'method':_0x29aa('0x1d'),'uri':_0x3c04eb+_0x29aa('0x1e'),'headers':{'Authorization':_0x29aa('0x1f')+_0x485260,'OData-Version':_0x29aa('0x20')},'json':!![]};return rp(_0x353339);})[_0x29aa('0x19')](function(_0x2d4e79){var _0x4628b8=_0x2d4e79['value'];var _0x98889a=![];var _0x3e3797=null;if(!_[_0x29aa('0x21')](_0x3714af)){if(intUtil[_0x29aa('0x22')](_0x3714af['email'])){_0x27596a[_0x29aa('0x23')]=_0x3714af[_0x29aa('0x24')];for(_0x3e3797=0x0;_0x3e3797<_0x4628b8[_0x29aa('0x25')];_0x3e3797++){if(_0x4628b8[_0x3e3797][_0x29aa('0x26')]===_0x3714af[_0x29aa('0x24')]&&!_0x4628b8[_0x3e3797][_0x29aa('0x27')]){_0x98889a=!![];logger['info']('['+[_0x32ccb6[_0x29aa('0x28')]()]+_0x29aa('0x29')+_0x4628b8[_0x3e3797][_0x29aa('0x2a')]+'!');_0x27596a['userId']=_0x4628b8[_0x3e3797][_0x29aa('0x2a')];}}}}if(!_0x98889a){logger[_0x29aa('0x2b')]('['+[_0x32ccb6[_0x29aa('0x28')]()]+_0x29aa('0x2c'));_0x27596a['userEmail']=_0x3aff37[_0x29aa('0x17')];for(_0x3e3797=0x0;_0x3e3797<_0x4628b8[_0x29aa('0x25')];_0x3e3797++){if(_0x4628b8[_0x3e3797][_0x29aa('0x26')]===_0x3aff37[_0x29aa('0x17')]){_0x27596a[_0x29aa('0x2d')]=_0x4628b8[_0x3e3797]['systemuserid'];}}}_0xbe263(_0x27596a);})[_0x29aa('0x2e')](function(_0x48c5d2){_0x234f7c(_0x48c5d2['message']);});});}function createEndUser(_0x344d5e,_0x59648b,_0x37bdc6,_0x4a7641,_0x1fc199,_0x4c57f8){return new Promise(function(_0x3b60ef,_0x3b1400){return getAuthToken(_0x59648b,_0x37bdc6,_0x4c57f8)[_0x29aa('0x19')](function(_0x1c4ae8){var _0x40571c=_0x4c57f8[_0x29aa('0x2f')]()===_0x29aa('0x30')?_0x1fc199[_0x29aa('0x31')]:_0x1fc199['calleridnum'];var _0x39ee62={'method':'POST','uri':_0x4a7641+_0x29aa('0x32'),'body':{'telephone1':_0x40571c,'fullname':_0x40571c,'firstname':_0x40571c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x29aa('0x33')+_0x344d5e[_0x29aa('0x2d')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1c4ae8,'OData-Version':_0x29aa('0x20')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x39ee62);})['then'](function(_0x44e04c){var _0x1e7a1c=_0x44e04c[_0x29aa('0x34')]['odata-entityid'];var _0x4c23ae=_0x1e7a1c[_0x29aa('0x35')](_0x1e7a1c['lastIndexOf']('(')+0x1,_0x1e7a1c[_0x29aa('0x36')](')'));_0x344d5e[_0x29aa('0x37')]=_0x4c23ae;_0x3b60ef(_0x344d5e);})[_0x29aa('0x2e')](function(_0x4f1051){_0x3b1400(_0x4f1051[_0x29aa('0x1c')]);});});}function getEndUser(_0x552261,_0x401c34,_0x135688,_0x54c915,_0x29c0ba,_0x492311,_0x51d572){var _0x3d619b=_0x492311[_0x29aa('0x2f')]()===_0x29aa('0x30')?_0x29c0ba['destcalleridnum']:_0x29c0ba[_0x29aa('0x38')];return getAuthToken(_0x401c34,_0x135688,_0x492311)[_0x29aa('0x19')](function(_0x2fc022){var _0x2b9594={'method':_0x29aa('0x1d'),'uri':_0x54c915+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x3d619b[_0x29aa('0x39')]('+',_0x29aa('0x3a'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x2fc022,'If-None-Match':null,'OData-Version':_0x29aa('0x20')},'json':!![]};return rp(_0x2b9594);})[_0x29aa('0x19')](function(_0x47319d){var _0x1bcd7e=![];if(!_0x47319d)return _0x1bcd7e;var _0x55b1fb=_0x47319d[_0x29aa('0x3b')];for(var _0x7df65d=0x0;_0x7df65d<_0x55b1fb[_0x29aa('0x25')];_0x7df65d++){if(_0x55b1fb[_0x7df65d][_0x29aa('0x3c')]===_0x3d619b){_0x1bcd7e=!![];_0x552261[_0x29aa('0x37')]=_0x55b1fb[_0x7df65d][_0x29aa('0x3d')];}}return _0x1bcd7e;})[_0x29aa('0x19')](function(_0x5c0dd3){if(_0x5c0dd3)return _0x552261;if(_0x51d572===_0x29aa('0x3e')){logger['info']('['+[_0x492311[_0x29aa('0x28')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x552261;}return createEndUser(_0x552261,_0x401c34,_0x135688,_0x54c915,_0x29c0ba,_0x492311)[_0x29aa('0x19')](function(_0x295997){logger['info']('['+[_0x492311[_0x29aa('0x28')]()]+']\x20Enduser\x20created!',_0x295997[_0x29aa('0x37')]);return _0x295997;});});}function getCustomFields(_0x4db39a,_0x21c553,_0x1dae6e){var _0x542010={};if(_0x4db39a[_0x29aa('0x25')]>0x0){_[_0x29aa('0x3f')](_0x4db39a,function(_0x12062a){if(_[_0x29aa('0x40')]([_0x29aa('0x41'),_0x29aa('0x42')],_0x12062a['type'])&&_0x12062a[_0x29aa('0x43')]&&!_0x12062a[_0x29aa('0x44')]){var _0x278ce1=_0x12062a[_0x29aa('0x45')]['toLowerCase']();var _0x1ea817=_0x278ce1[_0x29aa('0x35')](0x0,_0x278ce1[_0x29aa('0x46')]('_'));var _0x2ecae9=_0x278ce1[_0x29aa('0x35')](_0x278ce1[_0x29aa('0x46')]('_')+0x1);if(_0x1ea817===_0x1dae6e){_0x542010[_0x2ecae9]=_0x12062a[_0x29aa('0x47')];}}});}return _0x542010;}function getTicket(_0x192161,_0x4d38e6,_0x308136,_0x3285fb,_0x481cd2,_0x447852,_0x2bd890){return new Promise(function(_0x14a36d,_0x37d150){var _0x1050ff;return getAuthToken(_0x4d38e6,_0x308136,_0x2bd890)[_0x29aa('0x19')](function(_0x1f389b){if(_0x447852[_0x29aa('0x48')]===_0x29aa('0x49')){_0x1050ff={'method':_0x29aa('0x14'),'uri':_0x3285fb+'incidents','body':Object[_0x29aa('0x4a')]({},{'title':intUtil[_0x29aa('0x4b')](_0x447852[_0x29aa('0x4c')],_0x481cd2,'\x20'),'description':intUtil[_0x29aa('0x4b')](_0x447852['Descriptions'],_0x481cd2,'\x0a'),'customerid_contact@odata.bind':_0x192161[_0x29aa('0x37')]?_0x29aa('0x4d')+_0x192161[_0x29aa('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x192161['userId']+')','caseorigincode':'1'},getCustomFields(_0x447852[_0x29aa('0x4e')],_0x481cd2,_0x447852[_0x29aa('0x48')])),'headers':{'Authorization':_0x29aa('0x1f')+_0x1f389b,'OData-Version':_0x29aa('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x447852[_0x29aa('0x48')]===_0x29aa('0x4f')){var _0x43ae8b=_0x192161[_0x29aa('0x37')]?[{'partyid_systemuser@odata.bind':_0x29aa('0x33')+_0x192161[_0x29aa('0x2d')]+')','participationtypemask':_0x192161[_0x29aa('0x50')]===_0x29aa('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0x29aa('0x4d')+_0x192161[_0x29aa('0x37')]+')','participationtypemask':_0x192161[_0x29aa('0x50')]===_0x29aa('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x29aa('0x33')+_0x192161[_0x29aa('0x2d')]+')','participationtypemask':_0x192161[_0x29aa('0x50')]===_0x29aa('0x51')?0x2:0x1}];_0x1050ff={'method':_0x29aa('0x14'),'uri':_0x3285fb+_0x29aa('0x52'),'body':Object[_0x29aa('0x4a')]({},{'subject':intUtil['getString'](_0x447852[_0x29aa('0x4c')],_0x481cd2,'\x20'),'phonenumber':String(_0x481cd2['calleridnum']),'description':intUtil[_0x29aa('0x4b')](_0x447852[_0x29aa('0x53')],_0x481cd2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x192161[_0x29aa('0x37')]?_0x29aa('0x4d')+_0x192161[_0x29aa('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x192161[_0x29aa('0x2d')]+')','directioncode':_0x192161[_0x29aa('0x50')]===_0x29aa('0x51')?![]:!![],'phonecall_activity_parties':_0x43ae8b},getCustomFields(_0x447852[_0x29aa('0x4e')],_0x481cd2,_0x447852['ticketType'])),'headers':{'Authorization':_0x29aa('0x1f')+_0x1f389b,'OData-Version':_0x29aa('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1050ff);})[_0x29aa('0x19')](function(_0x79e131){var _0x1c7c1e=_0x79e131[_0x29aa('0x34')][_0x29aa('0x54')];var _0x2fd1a0=_0x1c7c1e[_0x29aa('0x35')](_0x1c7c1e['lastIndexOf']('(')+0x1,_0x1c7c1e[_0x29aa('0x36')](')'));_0x192161[_0x29aa('0x55')]=_0x2fd1a0;_0x14a36d(_0x192161);})['catch'](function(_0x1a1548){_0x37d150(_0x1a1548['message']);});});}function emit(_0x4660e7,_0x226c12,_0x47f201,_0x12d618){var _0xf354bc={'uri':util[_0x29aa('0x56')](_0x29aa('0x57'),_0x4660e7,_0x47f201,_0x12d618)};io['to'](util['format'](_0x29aa('0x58'),_0x226c12))[_0x29aa('0x59')](_0x29aa('0x5a'),_0xf354bc);}exports['cs']=function(_0x12f6e4,_0x4b7ccc,_0x4ed6a0,_0x524597,_0x3ef25a,_0x425183,_0x585735,_0x5249ed){var _0x4c6d9b={};_0x425183[_0x29aa('0x16')]=_0x425183['modernAuthentication']?intUtil[_0x29aa('0x5b')](_0x425183[_0x29aa('0xe')][_0x29aa('0xf')]):intUtil[_0x29aa('0x5b')](_0x425183['remoteUri']);_0x425183[_0x29aa('0x5c')]=intUtil[_0x29aa('0x5b')](_0x425183['serverUrl']);_0x4c6d9b[_0x29aa('0x50')]=_0x5249ed===_0x29aa('0x51')||_0x5249ed==='unmanaged'?_0x29aa('0x51'):_0x29aa('0x30');var _0x5ce04=_0x425183[_0x29aa('0xd')]?util[_0x29aa('0x56')](_0x29aa('0x5d'),_0x425183[_0x29aa('0xe')][_0x29aa('0xf')]):util['format'](_0x29aa('0x5d'),_0x425183[_0x29aa('0x16')]);var _0x4f0883=util['format'](_0x29aa('0x5e'),_0x425183[_0x29aa('0x10')]);var _0x9dbb9a=util[_0x29aa('0x56')](_0x29aa('0x5f'),_0x425183[_0x29aa('0x5c')],_0x4b7ccc[_0x29aa('0x60')],md5(_0x4b7ccc['uniqueid']));if(_0x3ef25a&&_0x3ef25a[_0x29aa('0x61')]){logger[_0x29aa('0x2b')](_0x29aa('0x62'),_0x29aa('0x63'));_0x4b7ccc['recordingURL']=_0x9dbb9a;}else if(_0x585735&&_0x585735[_0x29aa('0x64')]&&_0x585735[_0x29aa('0x64')]!==_0x29aa('0x65')){logger['info'](_0x29aa('0x66'),_0x29aa('0x63'));_0x4b7ccc['recordingURL']=_0x9dbb9a;}else{_0x4b7ccc['recordingURL']='';}return getUser(_0x4c6d9b,_0x425183,_0x524597,_0x4f0883,_0x5ce04,_0x5249ed)[_0x29aa('0x19')](function(_0x5de8e5){logger[_0x29aa('0x2b')]('['+_0x5249ed[_0x29aa('0x28')]()+_0x29aa('0x67'),_0x5de8e5[_0x29aa('0x2d')]);logger[_0x29aa('0x2b')]('['+_0x5249ed[_0x29aa('0x28')]()+_0x29aa('0x68'),_0x5de8e5[_0x29aa('0x23')]);return getEndUser(_0x5de8e5,_0x425183,_0x4f0883,_0x5ce04,_0x4b7ccc,_0x5249ed,_0x4ed6a0['moduleCreate']);})[_0x29aa('0x19')](function(_0x10a23d){logger['info']('['+_0x5249ed[_0x29aa('0x28')]()+_0x29aa('0x69'),_0x10a23d[_0x29aa('0x37')]);logger[_0x29aa('0x2b')]('['+_0x5249ed[_0x29aa('0x28')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4b7ccc['calleridnum']);return getTicket(_0x10a23d,_0x425183,_0x4f0883,_0x5ce04,_0x4b7ccc,_0x4ed6a0,_0x5249ed);})['then'](function(_0x65bf01){logger[_0x29aa('0x2b')](util[_0x29aa('0x56')]('['+_0x5249ed[_0x29aa('0x28')]()+_0x29aa('0x6a'),_0x4ed6a0['ticketType'],_0x65bf01[_0x29aa('0x55')]));logger[_0x29aa('0x2b')](util['format']('['+_0x5249ed[_0x29aa('0x28')]()+']\x20Call\x20direction:\x20%s',_0x5249ed));if(_0x5249ed!==_0x29aa('0x6b')){logger[_0x29aa('0x2b')]('['+_0x5249ed[_0x29aa('0x28')]()+']',_0x29aa('0x6c'));emit(_0x425183[_0x29aa('0x16')],_0x524597[_0x29aa('0x6d')],_0x4ed6a0[_0x29aa('0x48')],_0x65bf01['ticketId']);}})[_0x29aa('0x2e')](function(_0x5762d4){logger[_0x29aa('0x1b')]('['+_0x5249ed[_0x29aa('0x28')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x5762d4['message']);});}; \ No newline at end of file +var _0xef8b=['%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','data7','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','dynamics365','redis','defaults','localhost','CloudProvider','tenantId','data2','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token',']\x20Wrong\x20credentials!','message','GET','isNil','validateEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','info','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','contacts','/systemusers(','userId','Bearer\x20','4.0','headers','odata-entityid','substring','enduserId','destcalleridnum','calleridnum','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','picklist','type','nameField','customField','idField','indexOf','ticketType','assign','Subjects','getString','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','lastIndexOf','ticketId','format'];(function(_0x6cb205,_0x4e835d){var _0x2291d6=function(_0x5e1aca){while(--_0x5e1aca){_0x6cb205['push'](_0x6cb205['shift']());}};_0x2291d6(++_0x4e835d);}(_0xef8b,0xee));var _0xbef8=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0xef8b[_0x5be8cc];return _0x5f1b7e;};'use strict';var _=require(_0xbef8('0x0'));var rp=require('request-promise');var util=require(_0xbef8('0x1'));var intUtil=require(_0xbef8('0x2'));var md5=require(_0xbef8('0x3'));var Redis=require(_0xbef8('0x4'));var logger=require('../../../../config/logger')(_0xbef8('0x5'));var config=require('../../../../config/environment');config[_0xbef8('0x6')]=_[_0xbef8('0x7')](config[_0xbef8('0x6')],{'host':_0xbef8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbef8('0x6')]));function getAuthToken(_0x506f97,_0x43f722,_0x1a45fd){if(_0x506f97['modernAuthentication']){_0x506f97['remoteUri']=_0x506f97[_0xbef8('0x9')]['data7'];_0x506f97[_0xbef8('0xa')]=_0x506f97[_0xbef8('0x9')][_0xbef8('0xb')];return Promise[_0xbef8('0xc')](_0x506f97[_0xbef8('0x9')][_0xbef8('0xd')]);}var _0x18a148={'method':_0xbef8('0xe'),'uri':_0x43f722,'form':{'client_id':_0x506f97[_0xbef8('0xf')],'resource':_0x506f97[_0xbef8('0x10')],'username':_0x506f97[_0xbef8('0x11')],'password':_0x506f97[_0xbef8('0x12')],'grant_type':_0xbef8('0x12'),'client_secret':_0x506f97[_0xbef8('0x13')]},'json':!![]};return rp(_0x18a148)[_0xbef8('0x14')](function(_0x5f3a69){return _0x5f3a69[_0xbef8('0x15')];})['catch'](function(_0x39040f){logger['error']('['+[_0x1a45fd['toUpperCase']()]+_0xbef8('0x16'));return _0x39040f[_0xbef8('0x17')];});}function getUser(_0x369bfc,_0x29de49,_0x361793,_0x4a8885,_0x2dfac7,_0x1ac530){return new Promise(function(_0x4066d0,_0x2e21e8){return getAuthToken(_0x29de49,_0x4a8885,_0x1ac530)['then'](function(_0x2fe907){var _0x13c46f={'method':_0xbef8('0x18'),'uri':_0x2dfac7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x2fe907,'OData-Version':'4.0'},'json':!![]};return rp(_0x13c46f);})['then'](function(_0x14e5a5){var _0x17e09b=_0x14e5a5['value'];var _0x15eb93=![];var _0x3bc86a=null;if(!_[_0xbef8('0x19')](_0x361793)){if(intUtil[_0xbef8('0x1a')](_0x361793['email'])){_0x369bfc['userEmail']=_0x361793[_0xbef8('0x1b')];for(_0x3bc86a=0x0;_0x3bc86a<_0x17e09b[_0xbef8('0x1c')];_0x3bc86a++){if(_0x17e09b[_0x3bc86a][_0xbef8('0x1d')]===_0x361793[_0xbef8('0x1b')]&&!_0x17e09b[_0x3bc86a]['isdisabled']){_0x15eb93=!![];logger['info']('['+[_0x1ac530['toUpperCase']()]+_0xbef8('0x1e')+_0x17e09b[_0x3bc86a][_0xbef8('0x1f')]+'!');_0x369bfc['userId']=_0x17e09b[_0x3bc86a][_0xbef8('0x1f')];}}}}if(!_0x15eb93){logger[_0xbef8('0x20')]('['+[_0x1ac530[_0xbef8('0x21')]()]+_0xbef8('0x22'));_0x369bfc['userEmail']=_0x29de49[_0xbef8('0x11')];for(_0x3bc86a=0x0;_0x3bc86a<_0x17e09b['length'];_0x3bc86a++){if(_0x17e09b[_0x3bc86a][_0xbef8('0x1d')]===_0x29de49[_0xbef8('0x11')]){_0x369bfc['userId']=_0x17e09b[_0x3bc86a][_0xbef8('0x1f')];}}}_0x4066d0(_0x369bfc);})[_0xbef8('0x23')](function(_0x294e89){_0x2e21e8(_0x294e89[_0xbef8('0x17')]);});});}function createEndUser(_0xd99615,_0x28665c,_0xd29f19,_0x281845,_0x3e8af9,_0x2d212b){return new Promise(function(_0x28c20f,_0x903524){return getAuthToken(_0x28665c,_0xd29f19,_0x2d212b)[_0xbef8('0x14')](function(_0x4f69fe){var _0x50d3ef=_0x2d212b[_0xbef8('0x24')]()===_0xbef8('0x25')?_0x3e8af9['destcalleridnum']:_0x3e8af9['calleridnum'];var _0x1dac87={'method':'POST','uri':_0x281845+_0xbef8('0x26'),'body':{'telephone1':_0x50d3ef,'fullname':_0x50d3ef,'firstname':_0x50d3ef,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbef8('0x27')+_0xd99615[_0xbef8('0x28')]+')'},'headers':{'Authorization':_0xbef8('0x29')+_0x4f69fe,'OData-Version':_0xbef8('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1dac87);})[_0xbef8('0x14')](function(_0x4dae53){var _0x423c33=_0x4dae53[_0xbef8('0x2b')][_0xbef8('0x2c')];var _0x36665a=_0x423c33[_0xbef8('0x2d')](_0x423c33['lastIndexOf']('(')+0x1,_0x423c33['lastIndexOf'](')'));_0xd99615[_0xbef8('0x2e')]=_0x36665a;_0x28c20f(_0xd99615);})['catch'](function(_0x1d5e7f){_0x903524(_0x1d5e7f[_0xbef8('0x17')]);});});}function getEndUser(_0x47449b,_0x38546b,_0x1185ea,_0x1a235f,_0x4996bf,_0x17e31d,_0xe5144d){var _0xc3d0d5=_0x17e31d[_0xbef8('0x24')]()===_0xbef8('0x25')?_0x4996bf[_0xbef8('0x2f')]:_0x4996bf[_0xbef8('0x30')];return getAuthToken(_0x38546b,_0x1185ea,_0x17e31d)[_0xbef8('0x14')](function(_0x25b896){var _0x3c6e6b={'method':_0xbef8('0x18'),'uri':_0x1a235f+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0xc3d0d5[_0xbef8('0x31')]('+',_0xbef8('0x32'))+'\x27','headers':{'Authorization':_0xbef8('0x29')+_0x25b896,'If-None-Match':null,'OData-Version':_0xbef8('0x2a')},'json':!![]};return rp(_0x3c6e6b);})[_0xbef8('0x14')](function(_0x19c546){var _0x14db97=![];if(!_0x19c546)return _0x14db97;var _0xd820c0=_0x19c546['value'];for(var _0x5ce473=0x0;_0x5ce473<_0xd820c0[_0xbef8('0x1c')];_0x5ce473++){if(_0xd820c0[_0x5ce473][_0xbef8('0x33')]===_0xc3d0d5){_0x14db97=!![];_0x47449b[_0xbef8('0x2e')]=_0xd820c0[_0x5ce473][_0xbef8('0x34')];}}return _0x14db97;})[_0xbef8('0x14')](function(_0x598fde){if(_0x598fde)return _0x47449b;if(_0xe5144d===_0xbef8('0x35')){logger[_0xbef8('0x20')]('['+[_0x17e31d[_0xbef8('0x21')]()]+_0xbef8('0x36'));return _0x47449b;}return createEndUser(_0x47449b,_0x38546b,_0x1185ea,_0x1a235f,_0x4996bf,_0x17e31d)[_0xbef8('0x14')](function(_0x152abf){logger[_0xbef8('0x20')]('['+[_0x17e31d['toUpperCase']()]+']\x20Enduser\x20created!',_0x152abf['enduserId']);return _0x152abf;});});}function getCustomFields(_0x15fb17,_0x27f0fd,_0x217221){var _0x43bee2={};if(_0x15fb17[_0xbef8('0x1c')]>0x0){_[_0xbef8('0x37')](_0x15fb17,function(_0x578ea5){if(_[_0xbef8('0x38')](['string',_0xbef8('0x39')],_0x578ea5[_0xbef8('0x3a')])&&_0x578ea5[_0xbef8('0x3b')]&&!_0x578ea5[_0xbef8('0x3c')]){var _0x3163a4=_0x578ea5[_0xbef8('0x3d')][_0xbef8('0x24')]();var _0x4f53e8=_0x3163a4[_0xbef8('0x2d')](0x0,_0x3163a4[_0xbef8('0x3e')]('_'));var _0x5b0d3e=_0x3163a4[_0xbef8('0x2d')](_0x3163a4['indexOf']('_')+0x1);if(_0x4f53e8===_0x217221){_0x43bee2[_0x5b0d3e]=_0x578ea5['content'];}}});}return _0x43bee2;}function getTicket(_0x4394f4,_0x21b726,_0x23423c,_0x1dce00,_0x1ed2bf,_0x22530e,_0x21136c){return new Promise(function(_0x1137c8,_0x52fa43){var _0x29ee74;return getAuthToken(_0x21b726,_0x23423c,_0x21136c)[_0xbef8('0x14')](function(_0xcc9358){if(_0x22530e[_0xbef8('0x3f')]==='incident'){_0x29ee74={'method':_0xbef8('0xe'),'uri':_0x1dce00+'incidents','body':Object[_0xbef8('0x40')]({},{'title':intUtil['getString'](_0x22530e[_0xbef8('0x41')],_0x1ed2bf,'\x20'),'description':intUtil[_0xbef8('0x42')](_0x22530e[_0xbef8('0x43')],_0x1ed2bf,'\x0a'),'customerid_contact@odata.bind':_0x4394f4[_0xbef8('0x2e')]?'/contacts('+_0x4394f4[_0xbef8('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4394f4[_0xbef8('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x22530e[_0xbef8('0x44')],_0x1ed2bf,_0x22530e['ticketType'])),'headers':{'Authorization':_0xbef8('0x29')+_0xcc9358,'OData-Version':_0xbef8('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x22530e['ticketType']===_0xbef8('0x45')){var _0x3ebec3=_0x4394f4[_0xbef8('0x2e')]?[{'partyid_systemuser@odata.bind':_0xbef8('0x27')+_0x4394f4['userId']+')','participationtypemask':_0x4394f4[_0xbef8('0x46')]===_0xbef8('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xbef8('0x48')+_0x4394f4[_0xbef8('0x2e')]+')','participationtypemask':_0x4394f4[_0xbef8('0x46')]===_0xbef8('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xbef8('0x27')+_0x4394f4['userId']+')','participationtypemask':_0x4394f4[_0xbef8('0x46')]===_0xbef8('0x47')?0x2:0x1}];_0x29ee74={'method':_0xbef8('0xe'),'uri':_0x1dce00+_0xbef8('0x49'),'body':Object[_0xbef8('0x40')]({},{'subject':intUtil[_0xbef8('0x42')](_0x22530e[_0xbef8('0x41')],_0x1ed2bf,'\x20'),'phonenumber':String(_0x1ed2bf[_0xbef8('0x30')]),'description':intUtil['getString'](_0x22530e['Descriptions'],_0x1ed2bf,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4394f4[_0xbef8('0x2e')]?_0xbef8('0x48')+_0x4394f4[_0xbef8('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4394f4[_0xbef8('0x28')]+')','directioncode':_0x4394f4['callDirection']===_0xbef8('0x47')?![]:!![],'phonecall_activity_parties':_0x3ebec3},getCustomFields(_0x22530e[_0xbef8('0x44')],_0x1ed2bf,_0x22530e[_0xbef8('0x3f')])),'headers':{'Authorization':_0xbef8('0x29')+_0xcc9358,'OData-Version':_0xbef8('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x29ee74);})['then'](function(_0x49be55){var _0x47112a=_0x49be55['headers']['odata-entityid'];var _0x3cd678=_0x47112a['substring'](_0x47112a[_0xbef8('0x4a')]('(')+0x1,_0x47112a[_0xbef8('0x4a')](')'));_0x4394f4[_0xbef8('0x4b')]=_0x3cd678;_0x1137c8(_0x4394f4);})[_0xbef8('0x23')](function(_0x44c506){_0x52fa43(_0x44c506['message']);});});}function emit(_0x91a400,_0x4aef3f,_0x2f4036,_0x4e05e7){var _0x2f698c={'uri':util[_0xbef8('0x4c')](_0xbef8('0x4d'),_0x91a400,_0x2f4036,_0x4e05e7)};io['to'](util[_0xbef8('0x4c')](_0xbef8('0x4e'),_0x4aef3f))[_0xbef8('0x4f')](_0xbef8('0x50'),_0x2f698c);}exports['cs']=function(_0x3a4826,_0x1e4f4c,_0x480ddc,_0x3676a3,_0x2ab31f,_0x190d29,_0x1cdc0e,_0x24c220){var _0x26fc81={};_0x190d29[_0xbef8('0x10')]=_0x190d29[_0xbef8('0x51')]?intUtil[_0xbef8('0x52')](_0x190d29[_0xbef8('0x9')]['data7']):intUtil[_0xbef8('0x52')](_0x190d29[_0xbef8('0x10')]);_0x190d29[_0xbef8('0x53')]=intUtil[_0xbef8('0x52')](_0x190d29['serverUrl']);_0x26fc81['callDirection']=_0x24c220===_0xbef8('0x47')||_0x24c220===_0xbef8('0x54')?_0xbef8('0x47'):_0xbef8('0x25');var _0x5a8579=_0x190d29['modernAuthentication']?util[_0xbef8('0x4c')](_0xbef8('0x55'),_0x190d29[_0xbef8('0x9')][_0xbef8('0x56')]):util['format'](_0xbef8('0x55'),_0x190d29['remoteUri']);var _0x481d5f=util[_0xbef8('0x4c')]('https://login.microsoftonline.com/%s/oauth2/token',_0x190d29[_0xbef8('0xa')]);var _0x1eebd2=util[_0xbef8('0x4c')](_0xbef8('0x57'),_0x190d29[_0xbef8('0x53')],_0x1e4f4c[_0xbef8('0x58')],md5(_0x1e4f4c[_0xbef8('0x58')]));if(_0x2ab31f&&_0x2ab31f[_0xbef8('0x59')]){logger['info'](_0xbef8('0x5a'),_0xbef8('0x5b'));_0x1e4f4c[_0xbef8('0x5c')]=_0x1eebd2;}else if(_0x1cdc0e&&_0x1cdc0e['recordingFormat']&&_0x1cdc0e[_0xbef8('0x5d')]!==_0xbef8('0x5e')){logger[_0xbef8('0x20')]('[OUTBOUND]',_0xbef8('0x5b'));_0x1e4f4c[_0xbef8('0x5c')]=_0x1eebd2;}else{_0x1e4f4c['recordingURL']='';}return getUser(_0x26fc81,_0x190d29,_0x3676a3,_0x481d5f,_0x5a8579,_0x24c220)[_0xbef8('0x14')](function(_0x46e616){logger[_0xbef8('0x20')]('['+_0x24c220['toUpperCase']()+_0xbef8('0x5f'),_0x46e616['userId']);logger[_0xbef8('0x20')]('['+_0x24c220[_0xbef8('0x21')]()+_0xbef8('0x60'),_0x46e616[_0xbef8('0x61')]);return getEndUser(_0x46e616,_0x190d29,_0x481d5f,_0x5a8579,_0x1e4f4c,_0x24c220,_0x480ddc[_0xbef8('0x62')]);})['then'](function(_0x7ad453){logger[_0xbef8('0x20')]('['+_0x24c220[_0xbef8('0x21')]()+_0xbef8('0x63'),_0x7ad453[_0xbef8('0x2e')]);logger[_0xbef8('0x20')]('['+_0x24c220[_0xbef8('0x21')]()+_0xbef8('0x64'),_0x1e4f4c[_0xbef8('0x30')]);return getTicket(_0x7ad453,_0x190d29,_0x481d5f,_0x5a8579,_0x1e4f4c,_0x480ddc,_0x24c220);})['then'](function(_0x523265){logger[_0xbef8('0x20')](util[_0xbef8('0x4c')]('['+_0x24c220['toUpperCase']()+_0xbef8('0x65'),_0x480ddc[_0xbef8('0x3f')],_0x523265[_0xbef8('0x4b')]));logger[_0xbef8('0x20')](util[_0xbef8('0x4c')]('['+_0x24c220[_0xbef8('0x21')]()+_0xbef8('0x66'),_0x24c220));if(_0x24c220!==_0xbef8('0x54')){logger['info']('['+_0x24c220[_0xbef8('0x21')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x190d29[_0xbef8('0x10')],_0x3676a3[_0xbef8('0x67')],_0x480ddc[_0xbef8('0x3f')],_0x523265[_0xbef8('0x4b')]);}})[_0xbef8('0x23')](function(_0x5eea17){logger['error']('['+_0x24c220[_0xbef8('0x21')]()+_0xbef8('0x68'),_0x5eea17[_0xbef8('0x17')]);});}; \ 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 5d0a0d1..e12aa9c 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 _0xb6d5=['../../../../config/environment','freshdesk','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','then','Ticket\x20created!','validateEmail','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','push','content','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','stringify','lastevent','calleridnum','The\x20Enduser\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util'];(function(_0x160c3e,_0x5e1c5f){var _0x338f2a=function(_0x260cad){while(--_0x260cad){_0x160c3e['push'](_0x160c3e['shift']());}};_0x338f2a(++_0x5e1c5f);}(_0xb6d5,0x157));var _0x5b6d=function(_0x3d007f,_0x52f761){_0x3d007f=_0x3d007f-0x0;var _0x341999=_0xb6d5[_0x3d007f];return _0x341999;};'use strict';var _=require(_0x5b6d('0x0'));var rp=require(_0x5b6d('0x1'));var md5=require(_0x5b6d('0x2'));var util=require(_0x5b6d('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5b6d('0x4'));var config=require(_0x5b6d('0x5'));var logger=require('../../../../config/logger')(_0x5b6d('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x5b6d('0x7')};function emit(_0x2a35a4,_0x3b3b56,_0x3258a3){io['to'](_0x2a35a4)[_0x5b6d('0x8')](_0x3b3b56,_0x3258a3);}function getTicket(_0x2a8d78,_0x73ad6b,_0x5d265e,_0x59dacd,_0x152041){logger[_0x5b6d('0x9')](_0x5b6d('0xa'));var _0x1c3a0a=_[_0x5b6d('0xb')]({'responder_id':_0x73ad6b['id'],'requester_id':_0x5d265e['id'],'name':util[_0x5b6d('0xc')](_0x5b6d('0xd'),_0x152041[_0x5b6d('0xe')]),'phone':_0x152041['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5b6d('0xf')](_0x59dacd['Subjects'],_0x152041,'\x20'),'description':intUtil[_0x5b6d('0xf')](_0x59dacd[_0x5b6d('0x10')],_0x152041,_0x5b6d('0x11')),'tags':getTags(_0x59dacd['Tags'],_0x5b6d('0x12'))},getCustomFields(_0x59dacd[_0x5b6d('0x13')],_0x152041));_0x1c3a0a[_0x5b6d('0x14')]=_[_0x5b6d('0x15')](_[_0x5b6d('0x16')](_0x1c3a0a[_0x5b6d('0x14')],'id'),_0x5b6d('0x17'));return request({'uri':util['format']('%s/api/v2/tickets',_0x2a8d78['remoteUri']),'method':'POST','body':_0x1c3a0a})[_0x5b6d('0x18')](function(_0x31996f){logger[_0x5b6d('0x9')](_0x5b6d('0x19'));return _0x31996f;});}function getUser(_0x16370c,_0x5ea329){if(intUtil[_0x5b6d('0x1a')](_0x5ea329)){return request({'uri':util[_0x5b6d('0xc')]('%s/api/v2/agents',_0x16370c[_0x5b6d('0x1b')]),'qs':{'email':_0x5ea329}})[_0x5b6d('0x18')](function(_0x333523){if(_0x333523[_0x5b6d('0x1c')]){logger['info'](_0x5b6d('0x1d'));return _[_0x5b6d('0x1e')](_0x333523,function(_0xa1e46){return _0xa1e46[_0x5b6d('0x1f')][_0x5b6d('0x20')]===_0x5ea329;});}else{logger[_0x5b6d('0x9')](_0x5b6d('0x21'));return request({'uri':util['format'](_0x5b6d('0x22'),_0x16370c[_0x5b6d('0x1b')])})[_0x5b6d('0x18')](function(_0x3a438a){logger[_0x5b6d('0x9')]('Admin\x20account\x20selected.');return _0x3a438a;});}});}else{logger[_0x5b6d('0x9')](_0x5b6d('0x23'));return request({'uri':util[_0x5b6d('0xc')](_0x5b6d('0x22'),_0x16370c[_0x5b6d('0x1b')])})[_0x5b6d('0x18')](function(_0x196d56){logger[_0x5b6d('0x9')](_0x5b6d('0x24'));return _0x196d56;});}}function getEndUser(_0xb30a13,_0x13065d,_0x259b6a){logger[_0x5b6d('0x9')]('Searching\x20enduser\x20with\x20phone',_0x259b6a);return request({'uri':util[_0x5b6d('0xc')](_0x5b6d('0x25'),_0xb30a13[_0x5b6d('0x1b')]),'qs':{'phone':_0x259b6a}})['then'](function(_0x52e207){if(_0x52e207[_0x5b6d('0x1c')]){logger['info']('Enduser\x20found!');return _[_0x5b6d('0x1e')](_0x52e207,{'phone':_0x259b6a});}else{logger[_0x5b6d('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5b6d('0xc')](_0x5b6d('0x25'),_0xb30a13[_0x5b6d('0x1b')]),'method':'POST','body':{'name':_0x13065d,'phone':_0x259b6a}})[_0x5b6d('0x18')](function(_0x4d809d){logger[_0x5b6d('0x9')](_0x5b6d('0x26'));return _0x4d809d;});}});}function getAuth(_0x2e1236){return util[_0x5b6d('0xc')](_0x5b6d('0x27'),new Buffer(_0x2e1236[_0x5b6d('0x28')]+':X')[_0x5b6d('0x29')](_0x5b6d('0x2a')));}function request(_0x107d40){logger[_0x5b6d('0x2b')](_0x5b6d('0x2c'),JSON['stringify'](_0x107d40));return rp(_[_0x5b6d('0x2d')](_0x107d40,{'method':_0x5b6d('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x3b5967,_0x5f1bc2){var _0x5f6efd=[];if(_0x3b5967&&_0x3b5967[_0x5b6d('0x1c')]>0x0){_0x5f6efd=_[_0x5b6d('0x2f')](_0x3b5967,_0x5f1bc2);}return _0x5f6efd;}function getCustomFields(_0x3147c5,_0x2af18d){var _0xa78ced=[];var _0x5d975d={'custom_fields':[]};if(_0x3147c5[_0x5b6d('0x1c')]>0x0){_[_0x5b6d('0x30')](_0x3147c5,function(_0x8146d2){if(_[_0x5b6d('0x31')]([_0x5b6d('0x32'),_0x5b6d('0x33')],_0x8146d2[_0x5b6d('0x34')])&&_0x8146d2[_0x5b6d('0x35')]&&!_0x8146d2[_0x5b6d('0x36')]){_0x5d975d[_0x8146d2[_0x5b6d('0x35')][_0x5b6d('0x37')]()]=_0x8146d2['content'][_0x5b6d('0x29')]();}else if(_['includes']([_0x5b6d('0x32'),_0x5b6d('0x33')],_0x8146d2[_0x5b6d('0x34')])&&_0x8146d2[_0x5b6d('0x38')]&&_0x8146d2['customField']){_0x5d975d['custom_fields'][_0x5b6d('0x39')]({'id':_0x8146d2['idField'],'value':_0x8146d2[_0x5b6d('0x3a')][_0x5b6d('0x29')]()});}else if(_0x8146d2[_0x5b6d('0x34')]==='variable'&&_0x8146d2['variableName']&&_0x8146d2[_0x5b6d('0x38')]&&_0x8146d2[_0x5b6d('0x36')]){_0x2af18d[_0x8146d2[_0x5b6d('0x3b')]]&&_0x5d975d[_0x5b6d('0x14')][_0x5b6d('0x39')]({'id':_0x8146d2['idField'],'value':_0x2af18d[_0x8146d2[_0x5b6d('0x3b')]][_0x5b6d('0x29')]()});}else if(_0x8146d2[_0x5b6d('0x34')]==='customVariable'&&_0x8146d2['Variable']&&_0x8146d2[_0x5b6d('0x3c')][_0x5b6d('0x12')]&&_0x8146d2[_0x5b6d('0x38')]&&_0x8146d2[_0x5b6d('0x36')]){_0x2af18d[_0x8146d2[_0x5b6d('0x3c')][_0x5b6d('0x12')][_0x5b6d('0x37')]()]&&_0x5d975d[_0x5b6d('0x14')][_0x5b6d('0x39')]({'id':_0x8146d2[_0x5b6d('0x38')],'value':_0x2af18d[_0x8146d2[_0x5b6d('0x3c')][_0x5b6d('0x12')][_0x5b6d('0x37')]()]['toString']()});}});}return _0x5d975d;}exports['queue']=function(_0x356299,_0x619c08,_0x560d53,_0x3d8841,_0x1d0451,_0x4236e3){var _0x108e82,_0x234514;_0x4236e3[_0x5b6d('0x1b')]=intUtil[_0x5b6d('0x3d')](_0x4236e3[_0x5b6d('0x1b')]);_0x4236e3[_0x5b6d('0x3e')]=intUtil['stripTrailingSlash'](_0x4236e3[_0x5b6d('0x3e')]);if(_0x1d0451&&_0x1d0451[_0x5b6d('0x3f')]){logger[_0x5b6d('0x9')]('[QUEUE]',_0x5b6d('0x40'));_0x619c08[_0x5b6d('0x41')]=util[_0x5b6d('0xc')](_0x5b6d('0x42'),_0x4236e3[_0x5b6d('0x3e')],_0x619c08[_0x5b6d('0x43')],md5(_0x619c08[_0x5b6d('0x43')]));}else{_0x619c08[_0x5b6d('0x41')]='';}headers[_0x5b6d('0x44')]=getAuth(_0x4236e3);return getUser(_0x4236e3,_0x3d8841['email'])[_0x5b6d('0x18')](function(_0x5686b0){_0x108e82=_0x5686b0;logger[_0x5b6d('0x9')](_0x5b6d('0x45'),_0x108e82['id']);return getEndUser(_0x4236e3,_0x619c08['calleridname'],_0x619c08['calleridnum']);})[_0x5b6d('0x18')](function(_0x31bc39){_0x234514=_0x31bc39;logger[_0x5b6d('0x9')]('The\x20Enduser\x20ID\x20is:',_0x234514['id']);return getTicket(_0x4236e3,_0x108e82,_0x234514,_0x560d53,_0x619c08);})[_0x5b6d('0x18')](function(_0x231386){if(_0x231386&&_0x231386['id']){logger[_0x5b6d('0x9')]('Ticket\x20created!');logger[_0x5b6d('0x9')](_0x5b6d('0x46'),_0x231386['id']);logger[_0x5b6d('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5b6d('0xc')]('user:%s',_0x3d8841[_0x5b6d('0x12')]),_0x5b6d('0x47'),{'uri':util[_0x5b6d('0xc')](_0x5b6d('0x48'),_0x4236e3[_0x5b6d('0x1b')],_0x231386['id'])});}})[_0x5b6d('0x49')](function(_0x48918b){logger[_0x5b6d('0x4a')]('[QUEUE]',JSON['stringify'](_0x48918b));});};exports[_0x5b6d('0x4b')]=function(_0x4f8e5c,_0x86f2a6,_0x44019e,_0x62723e,_0x477288,_0x439dff,_0x294958){var _0x2cf000,_0x3cd02d;_0x439dff[_0x5b6d('0x1b')]=intUtil['stripTrailingSlash'](_0x439dff['remoteUri']);_0x439dff[_0x5b6d('0x3e')]=intUtil[_0x5b6d('0x3d')](_0x439dff[_0x5b6d('0x3e')]);if(_0x294958&&_0x294958[_0x5b6d('0x4c')]&&_0x294958[_0x5b6d('0x4c')]!==_0x5b6d('0x4d')){logger[_0x5b6d('0x9')](_0x5b6d('0x4e'),_0x5b6d('0x40'));_0x86f2a6[_0x5b6d('0x41')]=util[_0x5b6d('0xc')](_0x5b6d('0x42'),_0x439dff['serverUrl'],_0x86f2a6[_0x5b6d('0x43')],md5(_0x86f2a6[_0x5b6d('0x43')]));}headers[_0x5b6d('0x44')]=getAuth(_0x439dff);return getUser(_0x439dff,_0x62723e['email'])[_0x5b6d('0x18')](function(_0x2001f2){_0x2cf000=_0x2001f2;logger[_0x5b6d('0x9')](_0x5b6d('0x45'),_0x2cf000['id']);return getEndUser(_0x439dff,_0x86f2a6['destcalleridname'],_0x86f2a6[_0x5b6d('0x4f')]);})['then'](function(_0x219ee3){_0x3cd02d=_0x219ee3;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3cd02d['id']);return getTicket(_0x439dff,_0x2cf000,_0x3cd02d,_0x44019e,_0x86f2a6);})[_0x5b6d('0x18')](function(_0x349431){if(_0x349431&&_0x349431['id']){logger[_0x5b6d('0x9')](_0x5b6d('0x19'));logger['info'](_0x5b6d('0x46'),_0x349431['id']);logger['info'](_0x5b6d('0x4e'),_0x5b6d('0x50'));emit(util[_0x5b6d('0xc')](_0x5b6d('0x51'),_0x62723e[_0x5b6d('0x12')]),'trigger:browser:url',{'uri':util[_0x5b6d('0xc')]('%s/helpdesk/tickets/%d',_0x439dff['remoteUri'],_0x349431['id'])});}})[_0x5b6d('0x49')](function(_0x533b1b){logger[_0x5b6d('0x4a')](_0x5b6d('0x4e'),JSON[_0x5b6d('0x52')](_0x533b1b));});};exports['unmanaged']=function(_0x594fce,_0x26f289,_0x249c40,_0x2c6572,_0x298a25,_0x24b5a7){var _0x2c63e3,_0x42ad02;_0x24b5a7[_0x5b6d('0x1b')]=intUtil[_0x5b6d('0x3d')](_0x24b5a7['remoteUri']);_0x24b5a7[_0x5b6d('0x3e')]=intUtil[_0x5b6d('0x3d')](_0x24b5a7[_0x5b6d('0x3e')]);if(_0x298a25&&_0x298a25[_0x5b6d('0x3f')]){logger[_0x5b6d('0x9')]('['+_0x26f289[_0x5b6d('0x53')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x26f289[_0x5b6d('0x41')]=util['format'](_0x5b6d('0x42'),_0x24b5a7[_0x5b6d('0x3e')],_0x26f289['uniqueid'],md5(_0x26f289[_0x5b6d('0x43')]));}else{_0x26f289[_0x5b6d('0x41')]='';}headers[_0x5b6d('0x44')]=getAuth(_0x24b5a7);return getUser(_0x24b5a7,'')[_0x5b6d('0x18')](function(_0x57bfc9){_0x2c63e3=_0x57bfc9;logger['info'](_0x5b6d('0x45'),_0x2c63e3['id']);return getEndUser(_0x24b5a7,_0x26f289[_0x5b6d('0xe')],_0x26f289[_0x5b6d('0x54')]);})[_0x5b6d('0x18')](function(_0x26c4c5){_0x42ad02=_0x26c4c5;logger['info'](_0x5b6d('0x55'),_0x42ad02['id']);return getTicket(_0x24b5a7,_0x2c63e3,_0x42ad02,_0x249c40,_0x26f289);})[_0x5b6d('0x18')](function(_0x65fc16){if(_0x65fc16){logger[_0x5b6d('0x9')](_0x5b6d('0x19'));logger[_0x5b6d('0x9')](_0x5b6d('0x46'),_0x65fc16['id']);}})[_0x5b6d('0x49')](function(_0x5de1c9){logger['error']('['+_0x26f289['lastevent'][_0x5b6d('0x56')]()+']',JSON[_0x5b6d('0x52')](_0x5de1c9));});}; \ No newline at end of file +var _0xe265=['uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','outbound','recordingFormat','none','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','md5','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!'];(function(_0x2d1dc3,_0x72ffdf){var _0x2640e3=function(_0x30cde1){while(--_0x30cde1){_0x2d1dc3['push'](_0x2d1dc3['shift']());}};_0x2640e3(++_0x72ffdf);}(_0xe265,0x182));var _0x5e26=function(_0x24d370,_0x2f11d2){_0x24d370=_0x24d370-0x0;var _0x14f82d=_0xe265[_0x24d370];return _0x14f82d;};'use strict';var _=require(_0x5e26('0x0'));var rp=require('request-promise');var md5=require(_0x5e26('0x1'));var util=require('util');var Redis=require(_0x5e26('0x2'));var intUtil=require(_0x5e26('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5e26('0x4'))('freshdesk');config[_0x5e26('0x5')]=_[_0x5e26('0x6')](config[_0x5e26('0x5')],{'host':_0x5e26('0x7'),'port':0x18eb});var io=require(_0x5e26('0x8'))(new Redis(config[_0x5e26('0x5')]));var headers={'Content-Type':_0x5e26('0x9'),'Accept':_0x5e26('0x9')};function emit(_0x599e42,_0x5b2dc8,_0x2457a6){io['to'](_0x599e42)[_0x5e26('0xa')](_0x5b2dc8,_0x2457a6);}function getTicket(_0x4a5fcd,_0x42f466,_0x82a22,_0x484503,_0x53bab6){logger[_0x5e26('0xb')]('Creating\x20new\x20ticket...');var _0x49b01c=_[_0x5e26('0xc')]({'responder_id':_0x42f466['id'],'requester_id':_0x82a22['id'],'name':util[_0x5e26('0xd')](_0x5e26('0xe'),_0x53bab6[_0x5e26('0xf')]),'phone':_0x53bab6[_0x5e26('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x484503[_0x5e26('0x11')],_0x53bab6,'\x20'),'description':intUtil[_0x5e26('0x12')](_0x484503[_0x5e26('0x13')],_0x53bab6,'
'),'tags':getTags(_0x484503[_0x5e26('0x14')],_0x5e26('0x15'))},getCustomFields(_0x484503['Fields'],_0x53bab6));_0x49b01c[_0x5e26('0x16')]=_[_0x5e26('0x17')](_[_0x5e26('0x18')](_0x49b01c[_0x5e26('0x16')],'id'),_0x5e26('0x19'));return request({'uri':util[_0x5e26('0xd')](_0x5e26('0x1a'),_0x4a5fcd[_0x5e26('0x1b')]),'method':_0x5e26('0x1c'),'body':_0x49b01c})[_0x5e26('0x1d')](function(_0x51df59){logger[_0x5e26('0xb')](_0x5e26('0x1e'));return _0x51df59;});}function getUser(_0x373814,_0x38010f){if(intUtil['validateEmail'](_0x38010f)){return request({'uri':util[_0x5e26('0xd')](_0x5e26('0x1f'),_0x373814[_0x5e26('0x1b')]),'qs':{'email':_0x38010f}})[_0x5e26('0x1d')](function(_0x3de3d4){if(_0x3de3d4['length']){logger['info']('Agent\x20found!');return _[_0x5e26('0x20')](_0x3de3d4,function(_0x1af7e8){return _0x1af7e8['contact'][_0x5e26('0x21')]===_0x38010f;});}else{logger[_0x5e26('0xb')](_0x5e26('0x22'));return request({'uri':util[_0x5e26('0xd')](_0x5e26('0x23'),_0x373814['remoteUri'])})[_0x5e26('0x1d')](function(_0x2d1897){logger['info'](_0x5e26('0x24'));return _0x2d1897;});}});}else{logger[_0x5e26('0xb')](_0x5e26('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x373814['remoteUri'])})['then'](function(_0x4c7a49){logger[_0x5e26('0xb')](_0x5e26('0x24'));return _0x4c7a49;});}}function getEndUser(_0x4e391f,_0x1b85d0,_0x2415ad){logger[_0x5e26('0xb')]('Searching\x20enduser\x20with\x20phone',_0x2415ad);return request({'uri':util[_0x5e26('0xd')](_0x5e26('0x26'),_0x4e391f[_0x5e26('0x1b')]),'qs':{'phone':_0x2415ad}})['then'](function(_0x223f49){if(_0x223f49[_0x5e26('0x27')]){logger[_0x5e26('0xb')]('Enduser\x20found!');return _[_0x5e26('0x20')](_0x223f49,{'phone':_0x2415ad});}else{logger[_0x5e26('0xb')](_0x5e26('0x28'));return request({'uri':util['format'](_0x5e26('0x26'),_0x4e391f[_0x5e26('0x1b')]),'method':_0x5e26('0x1c'),'body':{'name':_0x1b85d0,'phone':_0x2415ad}})[_0x5e26('0x1d')](function(_0xb2b7d9){logger[_0x5e26('0xb')](_0x5e26('0x29'));return _0xb2b7d9;});}});}function getAuth(_0x35dfbe){return util[_0x5e26('0xd')](_0x5e26('0x2a'),new Buffer(_0x35dfbe[_0x5e26('0x2b')]+':X')[_0x5e26('0x2c')](_0x5e26('0x2d')));}function request(_0x48451e){logger[_0x5e26('0x2e')](_0x5e26('0x2f'),JSON[_0x5e26('0x30')](_0x48451e));return rp(_[_0x5e26('0x6')](_0x48451e,{'method':_0x5e26('0x31'),'headers':headers,'json':!![]}));}function getTags(_0xd11959,_0x117b05){var _0x1a90f0=[];if(_0xd11959&&_0xd11959[_0x5e26('0x27')]>0x0){_0x1a90f0=_[_0x5e26('0x32')](_0xd11959,_0x117b05);}return _0x1a90f0;}function getCustomFields(_0x2a1fe2,_0x11bb71){var _0x4e2574=[];var _0x384cf4={'custom_fields':[]};if(_0x2a1fe2[_0x5e26('0x27')]>0x0){_['forEach'](_0x2a1fe2,function(_0x550e8a){if(_[_0x5e26('0x33')]([_0x5e26('0x34'),_0x5e26('0x35')],_0x550e8a[_0x5e26('0x36')])&&_0x550e8a[_0x5e26('0x37')]&&!_0x550e8a[_0x5e26('0x38')]){_0x384cf4[_0x550e8a[_0x5e26('0x37')][_0x5e26('0x39')]()]=_0x550e8a[_0x5e26('0x3a')]['toString']();}else if(_['includes'](['string','picklist'],_0x550e8a[_0x5e26('0x36')])&&_0x550e8a[_0x5e26('0x3b')]&&_0x550e8a[_0x5e26('0x38')]){_0x384cf4['custom_fields'][_0x5e26('0x3c')]({'id':_0x550e8a[_0x5e26('0x3b')],'value':_0x550e8a[_0x5e26('0x3a')][_0x5e26('0x2c')]()});}else if(_0x550e8a[_0x5e26('0x36')]===_0x5e26('0x3d')&&_0x550e8a[_0x5e26('0x3e')]&&_0x550e8a[_0x5e26('0x3b')]&&_0x550e8a[_0x5e26('0x38')]){_0x11bb71[_0x550e8a[_0x5e26('0x3e')]]&&_0x384cf4[_0x5e26('0x16')][_0x5e26('0x3c')]({'id':_0x550e8a[_0x5e26('0x3b')],'value':_0x11bb71[_0x550e8a['variableName']][_0x5e26('0x2c')]()});}else if(_0x550e8a[_0x5e26('0x36')]===_0x5e26('0x3f')&&_0x550e8a[_0x5e26('0x40')]&&_0x550e8a[_0x5e26('0x40')][_0x5e26('0x15')]&&_0x550e8a['idField']&&_0x550e8a[_0x5e26('0x38')]){_0x11bb71[_0x550e8a[_0x5e26('0x40')][_0x5e26('0x15')][_0x5e26('0x39')]()]&&_0x384cf4[_0x5e26('0x16')]['push']({'id':_0x550e8a[_0x5e26('0x3b')],'value':_0x11bb71[_0x550e8a[_0x5e26('0x40')][_0x5e26('0x15')][_0x5e26('0x39')]()][_0x5e26('0x2c')]()});}});}return _0x384cf4;}exports['queue']=function(_0x178aae,_0x3cc583,_0x2d02bd,_0x35c8ce,_0xc8e5e0,_0x4a8960){var _0x4469c9,_0x403665;_0x4a8960[_0x5e26('0x1b')]=intUtil[_0x5e26('0x41')](_0x4a8960[_0x5e26('0x1b')]);_0x4a8960[_0x5e26('0x42')]=intUtil[_0x5e26('0x41')](_0x4a8960[_0x5e26('0x42')]);if(_0xc8e5e0&&_0xc8e5e0[_0x5e26('0x43')]){logger[_0x5e26('0xb')]('[QUEUE]',_0x5e26('0x44'));_0x3cc583['recordingURL']=util[_0x5e26('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a8960['serverUrl'],_0x3cc583['uniqueid'],md5(_0x3cc583[_0x5e26('0x45')]));}else{_0x3cc583[_0x5e26('0x46')]='';}headers[_0x5e26('0x47')]=getAuth(_0x4a8960);return getUser(_0x4a8960,_0x35c8ce[_0x5e26('0x21')])[_0x5e26('0x1d')](function(_0x26bbb0){_0x4469c9=_0x26bbb0;logger[_0x5e26('0xb')](_0x5e26('0x48'),_0x4469c9['id']);return getEndUser(_0x4a8960,_0x3cc583[_0x5e26('0xf')],_0x3cc583[_0x5e26('0x10')]);})[_0x5e26('0x1d')](function(_0x3f243a){_0x403665=_0x3f243a;logger[_0x5e26('0xb')](_0x5e26('0x49'),_0x403665['id']);return getTicket(_0x4a8960,_0x4469c9,_0x403665,_0x2d02bd,_0x3cc583);})[_0x5e26('0x1d')](function(_0x19756c){if(_0x19756c&&_0x19756c['id']){logger[_0x5e26('0xb')](_0x5e26('0x1e'));logger['info'](_0x5e26('0x4a'),_0x19756c['id']);logger[_0x5e26('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5e26('0xd')](_0x5e26('0x4b'),_0x35c8ce[_0x5e26('0x15')]),_0x5e26('0x4c'),{'uri':util[_0x5e26('0xd')](_0x5e26('0x4d'),_0x4a8960[_0x5e26('0x1b')],_0x19756c['id'])});}})[_0x5e26('0x4e')](function(_0x1444cb){logger[_0x5e26('0x4f')](_0x5e26('0x50'),JSON[_0x5e26('0x30')](_0x1444cb));});};exports[_0x5e26('0x51')]=function(_0x5c591e,_0x4117c3,_0xa09680,_0xfbb7dd,_0x2eac27,_0x1c6a55,_0x5d3d40){var _0x1a4ed2,_0x451816;_0x1c6a55[_0x5e26('0x1b')]=intUtil[_0x5e26('0x41')](_0x1c6a55['remoteUri']);_0x1c6a55[_0x5e26('0x42')]=intUtil[_0x5e26('0x41')](_0x1c6a55['serverUrl']);if(_0x5d3d40&&_0x5d3d40['recordingFormat']&&_0x5d3d40[_0x5e26('0x52')]!==_0x5e26('0x53')){logger[_0x5e26('0xb')]('[OUTBOUND]',_0x5e26('0x44'));_0x4117c3[_0x5e26('0x46')]=util[_0x5e26('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c6a55[_0x5e26('0x42')],_0x4117c3[_0x5e26('0x45')],md5(_0x4117c3[_0x5e26('0x45')]));}headers['Authorization']=getAuth(_0x1c6a55);return getUser(_0x1c6a55,_0xfbb7dd['email'])[_0x5e26('0x1d')](function(_0x57aa17){_0x1a4ed2=_0x57aa17;logger['info'](_0x5e26('0x48'),_0x1a4ed2['id']);return getEndUser(_0x1c6a55,_0x4117c3[_0x5e26('0x54')],_0x4117c3['destcalleridnum']);})[_0x5e26('0x1d')](function(_0x20d3a4){_0x451816=_0x20d3a4;logger['info'](_0x5e26('0x49'),_0x451816['id']);return getTicket(_0x1c6a55,_0x1a4ed2,_0x451816,_0xa09680,_0x4117c3);})[_0x5e26('0x1d')](function(_0x434f5d){if(_0x434f5d&&_0x434f5d['id']){logger[_0x5e26('0xb')]('Ticket\x20created!');logger[_0x5e26('0xb')](_0x5e26('0x4a'),_0x434f5d['id']);logger['info']('[OUTBOUND]',_0x5e26('0x55'));emit(util[_0x5e26('0xd')](_0x5e26('0x4b'),_0xfbb7dd['name']),_0x5e26('0x4c'),{'uri':util['format'](_0x5e26('0x4d'),_0x1c6a55[_0x5e26('0x1b')],_0x434f5d['id'])});}})[_0x5e26('0x4e')](function(_0x42ff3e){logger[_0x5e26('0x4f')](_0x5e26('0x56'),JSON[_0x5e26('0x30')](_0x42ff3e));});};exports[_0x5e26('0x57')]=function(_0x4928d2,_0x70b1d6,_0x10f48e,_0x460b11,_0x5025d8,_0x351234){var _0xf613ec,_0xa7470b;_0x351234['remoteUri']=intUtil['stripTrailingSlash'](_0x351234[_0x5e26('0x1b')]);_0x351234['serverUrl']=intUtil[_0x5e26('0x41')](_0x351234[_0x5e26('0x42')]);if(_0x5025d8&&_0x5025d8[_0x5e26('0x43')]){logger[_0x5e26('0xb')]('['+_0x70b1d6[_0x5e26('0x58')][_0x5e26('0x59')]()+']','Recording\x20is\x20enabled!');_0x70b1d6['recordingURL']=util[_0x5e26('0xd')](_0x5e26('0x5a'),_0x351234[_0x5e26('0x42')],_0x70b1d6[_0x5e26('0x45')],md5(_0x70b1d6[_0x5e26('0x45')]));}else{_0x70b1d6['recordingURL']='';}headers[_0x5e26('0x47')]=getAuth(_0x351234);return getUser(_0x351234,'')[_0x5e26('0x1d')](function(_0x4f7c9a){_0xf613ec=_0x4f7c9a;logger['info'](_0x5e26('0x48'),_0xf613ec['id']);return getEndUser(_0x351234,_0x70b1d6[_0x5e26('0xf')],_0x70b1d6['calleridnum']);})['then'](function(_0x390e93){_0xa7470b=_0x390e93;logger[_0x5e26('0xb')](_0x5e26('0x49'),_0xa7470b['id']);return getTicket(_0x351234,_0xf613ec,_0xa7470b,_0x10f48e,_0x70b1d6);})[_0x5e26('0x1d')](function(_0x364fd4){if(_0x364fd4){logger[_0x5e26('0xb')](_0x5e26('0x1e'));logger[_0x5e26('0xb')](_0x5e26('0x4a'),_0x364fd4['id']);}})['catch'](function(_0x325345){logger[_0x5e26('0x4f')]('['+_0x70b1d6[_0x5e26('0x58')][_0x5e26('0x59')]()+']',JSON[_0x5e26('0x30')](_0x325345));});}; \ 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 b3e8a68..5603d52 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 _0xc151=['/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET'];(function(_0x3cb5ee,_0x24a50c){var _0x5d4a2e=function(_0x246d2e){while(--_0x246d2e){_0x3cb5ee['push'](_0x3cb5ee['shift']());}};_0x5d4a2e(++_0x24a50c);}(_0xc151,0x144));var _0x1c15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc151[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1c15('0x0'));var rp=require('request-promise');var md5=require(_0x1c15('0x1'));var util=require(_0x1c15('0x2'));var moment=require(_0x1c15('0x3'));var Promise=require(_0x1c15('0x4'));var Redis=require(_0x1c15('0x5'));var intUtil=require(_0x1c15('0x6'));var config=require(_0x1c15('0x7'));var logger=require('../../../../config/logger')('freshsales');config[_0x1c15('0x8')]=_[_0x1c15('0x9')](config[_0x1c15('0x8')],{'host':_0x1c15('0xa'),'port':0x18eb});var io=require(_0x1c15('0xb'))(new Redis(config[_0x1c15('0x8')]));function getAdminId(_0x5e70fd,_0x4eeaa4,_0x332ebe,_0x2ebf0a){return new Promise(function(_0x5b92c7,_0x528d3b){var _0x20560e=![];var _0x563f56={'method':'GET','uri':_0x2ebf0a+'/api/selector/owners','json':!![]};_0x563f56[_0x1c15('0xc')]=_0x332ebe;logger['info'](_0x1c15('0xd'));return rp(_0x563f56)[_0x1c15('0xe')](function(_0x2480c2){if(_0x2480c2){var _0x52ac1c=_0x2480c2[_0x1c15('0xf')];var _0x5964ec=null;for(_0x5964ec=0x0;_0x5964ec<_0x52ac1c[_0x1c15('0x10')];_0x5964ec++){if(_0x52ac1c[_0x5964ec][_0x1c15('0x11')]===_0x5e70fd[_0x1c15('0x12')]){_0x5e70fd['adminId']=_0x52ac1c[_0x5964ec]['id'];_0x20560e=!![];}}if(_0x20560e){logger[_0x1c15('0x13')](_0x1c15('0x14'),_0x5e70fd[_0x1c15('0x15')]);_0x5b92c7(_0x5e70fd);}else{_0x528d3b({'statusCode':0x194,'message':_0x1c15('0x16')});}}else{_0x528d3b({'statusCode':0x194,'message':_0x1c15('0x16')});}})[_0x1c15('0x17')](function(_0x1f7be5){logger[_0x1c15('0x18')]('['+[_0x4eeaa4[_0x1c15('0x19')]()]+']',_0x1f7be5[_0x1c15('0x1a')]);_0x528d3b(_0x1f7be5);});});}function getUser(_0x4efa69,_0x212b3a,_0x4226a2){return function(_0x47601c){return new Promise(function(_0x5eb86d,_0x4dd58e){var _0x2ce083={'method':_0x1c15('0x1b'),'uri':_0x4226a2+_0x1c15('0x1c'),'json':!![]};_0x2ce083[_0x1c15('0xc')]=_0x212b3a;logger[_0x1c15('0x13')](_0x1c15('0x1d'));return rp(_0x2ce083)[_0x1c15('0xe')](function(_0x4a2ff6){if(_0x4a2ff6){var _0x37d48e=_0x4a2ff6[_0x1c15('0xf')];var _0x18e4c5=![];var _0x458097=null;if(_0x47601c['agentEmail']!==null){logger[_0x1c15('0x13')](_0x1c15('0x1e'),_0x47601c[_0x1c15('0x1f')]);_0x47601c[_0x1c15('0x20')]=_0x47601c['agentEmail'];for(_0x458097=0x0;_0x458097<_0x37d48e[_0x1c15('0x10')];_0x458097++){if(_0x37d48e[_0x458097][_0x1c15('0x11')]===_0x47601c['agentEmail']){_0x18e4c5=!![];_0x47601c[_0x1c15('0x21')]=_0x37d48e[_0x458097]['id'];logger['info'](_0x1c15('0x22'),_0x47601c[_0x1c15('0x21')]);}}}if(!_0x18e4c5){logger[_0x1c15('0x13')](_0x1c15('0x23'));_0x47601c[_0x1c15('0x20')]=_0x47601c[_0x1c15('0x12')];_0x47601c[_0x1c15('0x21')]=_0x47601c[_0x1c15('0x15')];_0x18e4c5=!![];}if(_0x18e4c5){_0x5eb86d(_0x47601c);}else{_0x4dd58e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4dd58e({'statusCode':0x194,'message':_0x1c15('0x16')});}})['catch'](function(_0x448f8c){logger[_0x1c15('0x18')]('['+[_0x4efa69[_0x1c15('0x19')]()]+']',_0x448f8c[_0x1c15('0x1a')]);_0x4dd58e(_0x448f8c);});});};}function searchContact(_0x297019,_0x115929,_0x484ca8,_0x1fface){return new Promise(function(_0x1b26be,_0x49a71a){var _0x53c04e={'method':'GET','headers':_0x115929,'uri':_0x297019+'/api/lookup?q='+_0x1fface+_0x1c15('0x24')+_0x484ca8+'&entities=contact','json':!![]};rp(_0x53c04e)[_0x1c15('0xe')](function(_0x310fc8){var _0x2ade31=_[_0x1c15('0x25')](_0x310fc8[_0x1c15('0x26')][_0x1c15('0x26')],[_0x484ca8,_0x1fface]);_0x1b26be(_0x2ade31);})['catch'](function(_0x1a58e1){_0x49a71a(_0x1a58e1);});});}function getEndUser(_0x24b75b,_0x17e961,_0x1e1d76){return function(_0x51b88e){return new Promise(function(_0x158a0a,_0x23021e){logger[_0x1c15('0x13')](util[_0x1c15('0x27')](_0x1c15('0x28'),_0x51b88e[_0x1c15('0x29')]));searchContact(_0x1e1d76,_0x17e961,'mobile_number',_0x51b88e[_0x1c15('0x29')])[_0x1c15('0xe')](function(_0x78270b){if(_0x78270b){_0x51b88e['endUserId']=_0x78270b['id'];logger[_0x1c15('0x13')](_0x1c15('0x2a'),_0x51b88e['endUserId']);return _0x158a0a(_0x51b88e);}searchContact(_0x1e1d76,_0x17e961,'work_number',_0x51b88e[_0x1c15('0x29')])[_0x1c15('0xe')](function(_0x1aa3f8){if(_0x1aa3f8){_0x51b88e[_0x1c15('0x2b')]=_0x1aa3f8['id'];logger[_0x1c15('0x13')](_0x1c15('0x2c'),_0x51b88e[_0x1c15('0x2b')]);return _0x158a0a(_0x51b88e);}createEndUser(_0x51b88e,_0x24b75b,_0x17e961,_0x1e1d76)['then'](function(_0x19f1f){logger['info'](_0x1c15('0x2d'),_0x19f1f[_0x1c15('0x2b')]);return _0x158a0a(_0x19f1f);});});})['catch'](function(_0xafd4f0){_0x23021e(_0xafd4f0);});});};}function createEndUser(_0x789f38,_0x259e46,_0xacc75f,_0x5eb671){return new Promise(function(_0x218781,_0x4cf809){var _0x47467f=moment();var _0x2b2dc7={'method':_0x1c15('0x2e'),'uri':_0x5eb671+_0x1c15('0x2f'),'body':{'contact':{'last_name':_0x789f38[_0x1c15('0x29')],'work_number':_0x789f38[_0x1c15('0x29')],'mobile_number':_0x789f38['contactNumber'],'owner_id':_0x789f38['userId'],'created_at':_0x47467f[_0x1c15('0x27')](_0x1c15('0x30'))}},'json':!![]};_0x2b2dc7[_0x1c15('0xc')]=_0xacc75f;logger[_0x1c15('0x13')](_0x1c15('0x31'));return rp(_0x2b2dc7)[_0x1c15('0xe')](function(_0x4f0ebf){_0x789f38['endUserId']=_0x4f0ebf[_0x1c15('0x32')]['id'];_0x218781(_0x789f38);})[_0x1c15('0x17')](function(_0x28e3c0){logger[_0x1c15('0x18')]('['+[_0x259e46[_0x1c15('0x19')]()]+']',_0x28e3c0[_0x1c15('0x1a')]);_0x4cf809(_0x28e3c0['message']);});});}function getTicket(_0x4c25c6,_0x37301b,_0x4292a3,_0x3e5764,_0x37a5e5){return function(_0x4e2681){logger[_0x1c15('0x13')](_0x1c15('0x33'));return new Promise(function(_0x556e1,_0x3071c4){var _0x123a39=moment();var _0x5dc98d={'method':'POST','uri':_0x4292a3+_0x1c15('0x34'),'body':{'title':intUtil[_0x1c15('0x35')](_0x3e5764[_0x1c15('0x36')],_0x37a5e5,'\x20'),'description':intUtil[_0x1c15('0x35')](_0x3e5764[_0x1c15('0x37')],_0x37a5e5,'\x0a'),'owner_id':_0x4e2681[_0x1c15('0x21')],'creater_id':_0x4e2681['adminId'],'targetable_id':_0x4e2681['endUserId'],'targetable_type':_0x1c15('0x38'),'created_at':_0x123a39[_0x1c15('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x123a39[_0x1c15('0x39')](0x1e,'m')[_0x1c15('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5dc98d[_0x1c15('0xc')]=_0x37301b;return rp(_0x5dc98d)[_0x1c15('0xe')](function(_0x45009d){_0x4e2681[_0x1c15('0x3a')]=_0x45009d[_0x1c15('0x3b')]['id'];logger[_0x1c15('0x13')](_0x1c15('0x3c'),_0x4e2681[_0x1c15('0x3a')]);_0x556e1(_0x4e2681);})['catch'](function(_0x36796e){logger[_0x1c15('0x18')]('['+[_0x4c25c6['toUpperCase']()]+']',_0x36796e[_0x1c15('0x1a')]);_0x3071c4(_0x36796e['message']);});});};}function emit(_0x313acf,_0x3e837c,_0x56108b){var _0x33d5a8={'uri':_0x313acf+_0x1c15('0x3d')+_0x56108b};io['to'](util['format'](_0x1c15('0x3e'),_0x3e837c))['emit'](_0x1c15('0x3f'),_0x33d5a8);}exports['cs']=function(_0x18efd0,_0x35c8cb,_0x45b977,_0x22a0d8,_0x4b2f81,_0x22edda,_0x463058,_0x20d045){var _0x776db3={};var _0x414a25={'Authorization':_0x1c15('0x40')+_0x22edda[_0x1c15('0x41')]};_0x22edda[_0x1c15('0x42')]=intUtil['stripTrailingSlash'](_0x22edda['remoteUri']);_0x22edda[_0x1c15('0x43')]=intUtil[_0x1c15('0x44')](_0x22edda['serverUrl']);var _0x5b7544=_0x22edda[_0x1c15('0x42')];_0x776db3[_0x1c15('0x12')]=_0x22edda['username'];_0x776db3[_0x1c15('0x29')]=_0x20d045[_0x1c15('0x45')]()==='outbound'?_0x35c8cb[_0x1c15('0x46')]:_0x35c8cb[_0x1c15('0x47')];_0x776db3[_0x1c15('0x48')]=_0x20d045===_0x1c15('0x49')||_0x20d045===_0x1c15('0x4a')?_0x1c15('0x49'):_0x1c15('0x4b');if(_0x22a0d8){_0x776db3[_0x1c15('0x1f')]=_0x22a0d8[_0x1c15('0x11')];}var _0x5d020c=util[_0x1c15('0x27')](_0x1c15('0x4c'),_0x22edda['serverUrl'],_0x35c8cb[_0x1c15('0x4d')],md5(_0x35c8cb[_0x1c15('0x4d')]));if(_0x4b2f81&&_0x4b2f81[_0x1c15('0x4e')]){logger[_0x1c15('0x13')](_0x1c15('0x4f'),_0x1c15('0x50'));_0x35c8cb[_0x1c15('0x51')]=_0x5d020c;}else if(_0x463058&&_0x463058['recordingFormat']&&_0x463058[_0x1c15('0x52')]!=='none'){logger['info'](_0x1c15('0x53'),_0x1c15('0x50'));_0x35c8cb[_0x1c15('0x51')]=_0x5d020c;}else{_0x35c8cb[_0x1c15('0x51')]='';}return getAdminId(_0x776db3,_0x20d045,_0x414a25,_0x5b7544)[_0x1c15('0xe')](getUser(_0x20d045,_0x414a25,_0x5b7544))[_0x1c15('0xe')](getEndUser(_0x20d045,_0x414a25,_0x5b7544))[_0x1c15('0xe')](getTicket(_0x20d045,_0x414a25,_0x5b7544,_0x45b977,_0x35c8cb))[_0x1c15('0xe')](function(_0x2377de){logger[_0x1c15('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x2377de['ticketId']));if(_0x20d045!==_0x1c15('0x4a')){logger['info']('['+[_0x20d045[_0x1c15('0x19')]()]+']',_0x1c15('0x54'));emit(_0x5b7544,_0x22a0d8[_0x1c15('0x55')],_0x2377de['endUserId']);}})[_0x1c15('0x17')](function(_0x2809c0){logger[_0x1c15('0x18')]('['+[_0x20d045[_0x1c15('0x19')]()]+_0x1c15('0x56'),util[_0x1c15('0x57')](_0x2809c0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1c44=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','email','userId','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','endUserId','Contact\x20found\x20mobile_number:','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','Contact','add','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format'];(function(_0x435713,_0x5dd205){var _0x4ed61e=function(_0x1bfda2){while(--_0x1bfda2){_0x435713['push'](_0x435713['shift']());}};_0x4ed61e(++_0x5dd205);}(_0x1c44,0x103));var _0x41c4=function(_0x26baf1,_0x20c7a6){_0x26baf1=_0x26baf1-0x0;var _0x50a163=_0x1c44[_0x26baf1];return _0x50a163;};'use strict';var _=require(_0x41c4('0x0'));var rp=require(_0x41c4('0x1'));var md5=require(_0x41c4('0x2'));var util=require(_0x41c4('0x3'));var moment=require(_0x41c4('0x4'));var Promise=require(_0x41c4('0x5'));var Redis=require(_0x41c4('0x6'));var intUtil=require(_0x41c4('0x7'));var config=require(_0x41c4('0x8'));var logger=require('../../../../config/logger')(_0x41c4('0x9'));config[_0x41c4('0xa')]=_['defaults'](config[_0x41c4('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x41c4('0xb'))(new Redis(config[_0x41c4('0xa')]));function getAdminId(_0x1751b0,_0x2e3b82,_0x113d35,_0x544586){return new Promise(function(_0x43c742,_0x2ba5b8){var _0x9e352f=![];var _0x20fad0={'method':_0x41c4('0xc'),'uri':_0x544586+_0x41c4('0xd'),'json':!![]};_0x20fad0[_0x41c4('0xe')]=_0x113d35;logger[_0x41c4('0xf')]('Getting\x20admin\x20information');return rp(_0x20fad0)[_0x41c4('0x10')](function(_0x36d6d7){if(_0x36d6d7){var _0x1ebaf4=_0x36d6d7[_0x41c4('0x11')];var _0x34bcbb=null;for(_0x34bcbb=0x0;_0x34bcbb<_0x1ebaf4['length'];_0x34bcbb++){if(_0x1ebaf4[_0x34bcbb]['email']===_0x1751b0[_0x41c4('0x12')]){_0x1751b0['adminId']=_0x1ebaf4[_0x34bcbb]['id'];_0x9e352f=!![];}}if(_0x9e352f){logger[_0x41c4('0xf')](_0x41c4('0x13'),_0x1751b0[_0x41c4('0x14')]);_0x43c742(_0x1751b0);}else{_0x2ba5b8({'statusCode':0x194,'message':_0x41c4('0x15')});}}else{_0x2ba5b8({'statusCode':0x194,'message':_0x41c4('0x15')});}})['catch'](function(_0x10eb8a){logger[_0x41c4('0x16')]('['+[_0x2e3b82[_0x41c4('0x17')]()]+']',_0x10eb8a[_0x41c4('0x18')]);_0x2ba5b8(_0x10eb8a);});});}function getUser(_0x12c973,_0x102972,_0x148c13){return function(_0x5344c0){return new Promise(function(_0x27f07a,_0x18463f){var _0x4eec92={'method':_0x41c4('0xc'),'uri':_0x148c13+_0x41c4('0xd'),'json':!![]};_0x4eec92['headers']=_0x102972;logger[_0x41c4('0xf')](_0x41c4('0x19'));return rp(_0x4eec92)[_0x41c4('0x10')](function(_0x4a78ae){if(_0x4a78ae){var _0x1cc401=_0x4a78ae[_0x41c4('0x11')];var _0x500b3e=![];var _0x43a5d3=null;if(_0x5344c0[_0x41c4('0x1a')]!==null){logger['info'](_0x41c4('0x1b'),_0x5344c0['agentEmail']);_0x5344c0[_0x41c4('0x1c')]=_0x5344c0['agentEmail'];for(_0x43a5d3=0x0;_0x43a5d3<_0x1cc401[_0x41c4('0x1d')];_0x43a5d3++){if(_0x1cc401[_0x43a5d3][_0x41c4('0x1e')]===_0x5344c0[_0x41c4('0x1a')]){_0x500b3e=!![];_0x5344c0['userId']=_0x1cc401[_0x43a5d3]['id'];logger[_0x41c4('0xf')]('User\x20found:',_0x5344c0[_0x41c4('0x1f')]);}}}if(!_0x500b3e){logger[_0x41c4('0xf')]('Admin\x20selected');_0x5344c0['userEmail']=_0x5344c0[_0x41c4('0x12')];_0x5344c0[_0x41c4('0x1f')]=_0x5344c0[_0x41c4('0x14')];_0x500b3e=!![];}if(_0x500b3e){_0x27f07a(_0x5344c0);}else{_0x18463f({'statusCode':0x194,'message':_0x41c4('0x15')});}}else{_0x18463f({'statusCode':0x194,'message':_0x41c4('0x15')});}})[_0x41c4('0x20')](function(_0x255a60){logger['error']('['+[_0x12c973['toUpperCase']()]+']',_0x255a60['message']);_0x18463f(_0x255a60);});});};}function searchContact(_0x47d604,_0x110e81,_0x244e71,_0x489a99){return new Promise(function(_0x4baf11,_0x473a71){var _0x5699e4={'method':'GET','headers':_0x110e81,'uri':_0x47d604+_0x41c4('0x21')+_0x489a99+_0x41c4('0x22')+_0x244e71+_0x41c4('0x23'),'json':!![]};rp(_0x5699e4)[_0x41c4('0x10')](function(_0x350d5f){var _0x2cddec=_[_0x41c4('0x24')](_0x350d5f[_0x41c4('0x25')]['contacts'],[_0x244e71,_0x489a99]);_0x4baf11(_0x2cddec);})[_0x41c4('0x20')](function(_0x31a067){_0x473a71(_0x31a067);});});}function getEndUser(_0x45a943,_0x203e0a,_0x566052){return function(_0x50217c){return new Promise(function(_0x5fdc3a,_0x52a8d1){logger[_0x41c4('0xf')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x50217c['contactNumber']));searchContact(_0x566052,_0x203e0a,'mobile_number',_0x50217c['contactNumber'])[_0x41c4('0x10')](function(_0x456eac){if(_0x456eac){_0x50217c[_0x41c4('0x26')]=_0x456eac['id'];logger['info'](_0x41c4('0x27'),_0x50217c['endUserId']);return _0x5fdc3a(_0x50217c);}searchContact(_0x566052,_0x203e0a,'work_number',_0x50217c[_0x41c4('0x28')])[_0x41c4('0x10')](function(_0x1c382d){if(_0x1c382d){_0x50217c['endUserId']=_0x1c382d['id'];logger['info'](_0x41c4('0x29'),_0x50217c[_0x41c4('0x26')]);return _0x5fdc3a(_0x50217c);}createEndUser(_0x50217c,_0x45a943,_0x203e0a,_0x566052)[_0x41c4('0x10')](function(_0x452816){logger[_0x41c4('0xf')](_0x41c4('0x2a'),_0x452816[_0x41c4('0x26')]);return _0x5fdc3a(_0x452816);});});})[_0x41c4('0x20')](function(_0x213e19){_0x52a8d1(_0x213e19);});});};}function createEndUser(_0x60a4f,_0x209d24,_0x5858df,_0x55160b){return new Promise(function(_0xb70b1b,_0x15047b){var _0x420c4a=moment();var _0x581324={'method':'POST','uri':_0x55160b+_0x41c4('0x2b'),'body':{'contact':{'last_name':_0x60a4f[_0x41c4('0x28')],'work_number':_0x60a4f['contactNumber'],'mobile_number':_0x60a4f[_0x41c4('0x28')],'owner_id':_0x60a4f[_0x41c4('0x1f')],'created_at':_0x420c4a[_0x41c4('0x2c')](_0x41c4('0x2d'))}},'json':!![]};_0x581324[_0x41c4('0xe')]=_0x5858df;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x581324)[_0x41c4('0x10')](function(_0x4e962c){_0x60a4f[_0x41c4('0x26')]=_0x4e962c[_0x41c4('0x2e')]['id'];_0xb70b1b(_0x60a4f);})[_0x41c4('0x20')](function(_0xf0f656){logger['error']('['+[_0x209d24[_0x41c4('0x17')]()]+']',_0xf0f656['message']);_0x15047b(_0xf0f656['message']);});});}function getTicket(_0x205faf,_0x222fc2,_0x38b6f6,_0x16d3a3,_0x295624){return function(_0x316865){logger[_0x41c4('0xf')](_0x41c4('0x2f'));return new Promise(function(_0x2a2350,_0x3d6d85){var _0x2983a4=moment();var _0x26e5aa={'method':_0x41c4('0x30'),'uri':_0x38b6f6+_0x41c4('0x31'),'body':{'title':intUtil[_0x41c4('0x32')](_0x16d3a3['Subjects'],_0x295624,'\x20'),'description':intUtil['getString'](_0x16d3a3[_0x41c4('0x33')],_0x295624,'\x0a'),'owner_id':_0x316865[_0x41c4('0x1f')],'creater_id':_0x316865[_0x41c4('0x14')],'targetable_id':_0x316865[_0x41c4('0x26')],'targetable_type':_0x41c4('0x34'),'created_at':_0x2983a4['format'](_0x41c4('0x2d')),'due_date':_0x2983a4[_0x41c4('0x35')](0x1e,'m')[_0x41c4('0x2c')](_0x41c4('0x2d'))},'json':!![]};_0x26e5aa['headers']=_0x222fc2;return rp(_0x26e5aa)[_0x41c4('0x10')](function(_0x5a579f){_0x316865[_0x41c4('0x36')]=_0x5a579f['task']['id'];logger['info'](_0x41c4('0x37'),_0x316865[_0x41c4('0x36')]);_0x2a2350(_0x316865);})[_0x41c4('0x20')](function(_0x5d720f){logger[_0x41c4('0x16')]('['+[_0x205faf['toUpperCase']()]+']',_0x5d720f[_0x41c4('0x18')]);_0x3d6d85(_0x5d720f[_0x41c4('0x18')]);});});};}function emit(_0x1f80d9,_0xb1d128,_0x3e9e8b){var _0x1e0af7={'uri':_0x1f80d9+'/contacts/'+_0x3e9e8b};io['to'](util[_0x41c4('0x2c')](_0x41c4('0x38'),_0xb1d128))[_0x41c4('0x39')](_0x41c4('0x3a'),_0x1e0af7);}exports['cs']=function(_0x1f7a09,_0xafd2be,_0x45ef04,_0x2babff,_0x1c851a,_0x3d7199,_0x45fbce,_0x12833d){var _0x3b9c90={};var _0x224547={'Authorization':_0x41c4('0x3b')+_0x3d7199[_0x41c4('0x3c')]};_0x3d7199['remoteUri']=intUtil[_0x41c4('0x3d')](_0x3d7199['remoteUri']);_0x3d7199[_0x41c4('0x3e')]=intUtil[_0x41c4('0x3d')](_0x3d7199['serverUrl']);var _0x1c35c3=_0x3d7199[_0x41c4('0x3f')];_0x3b9c90['adminEmail']=_0x3d7199[_0x41c4('0x40')];_0x3b9c90['contactNumber']=_0x12833d['toLowerCase']()===_0x41c4('0x41')?_0xafd2be[_0x41c4('0x42')]:_0xafd2be[_0x41c4('0x43')];_0x3b9c90['callDirection']=_0x12833d===_0x41c4('0x44')||_0x12833d===_0x41c4('0x45')?_0x41c4('0x44'):_0x41c4('0x41');if(_0x2babff){_0x3b9c90[_0x41c4('0x1a')]=_0x2babff[_0x41c4('0x1e')];}var _0x3d9399=util[_0x41c4('0x2c')](_0x41c4('0x46'),_0x3d7199[_0x41c4('0x3e')],_0xafd2be[_0x41c4('0x47')],md5(_0xafd2be[_0x41c4('0x47')]));if(_0x1c851a&&_0x1c851a[_0x41c4('0x48')]){logger[_0x41c4('0xf')](_0x41c4('0x49'),_0x41c4('0x4a'));_0xafd2be[_0x41c4('0x4b')]=_0x3d9399;}else if(_0x45fbce&&_0x45fbce['recordingFormat']&&_0x45fbce[_0x41c4('0x4c')]!==_0x41c4('0x4d')){logger[_0x41c4('0xf')](_0x41c4('0x4e'),_0x41c4('0x4a'));_0xafd2be[_0x41c4('0x4b')]=_0x3d9399;}else{_0xafd2be['recordingURL']='';}return getAdminId(_0x3b9c90,_0x12833d,_0x224547,_0x1c35c3)[_0x41c4('0x10')](getUser(_0x12833d,_0x224547,_0x1c35c3))[_0x41c4('0x10')](getEndUser(_0x12833d,_0x224547,_0x1c35c3))[_0x41c4('0x10')](getTicket(_0x12833d,_0x224547,_0x1c35c3,_0x45ef04,_0xafd2be))[_0x41c4('0x10')](function(_0x43723c){logger['info'](util[_0x41c4('0x2c')](_0x41c4('0x4f'),_0x43723c[_0x41c4('0x36')]));if(_0x12833d!==_0x41c4('0x45')){logger[_0x41c4('0xf')]('['+[_0x12833d['toUpperCase']()]+']',_0x41c4('0x50'));emit(_0x1c35c3,_0x2babff[_0x41c4('0x51')],_0x43723c[_0x41c4('0x26')]);}})[_0x41c4('0x20')](function(_0x256369){logger[_0x41c4('0x16')]('['+[_0x12833d['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x41c4('0x52')](_0x256369,{'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 ae6c2ed..2e47af1 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 _0x9009=['data2','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','desk','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase'];(function(_0x471a7c,_0x4f4f33){var _0x28b797=function(_0x432543){while(--_0x432543){_0x471a7c['push'](_0x471a7c['shift']());}};_0x28b797(++_0x4f4f33);}(_0x9009,0xce));var _0x9900=function(_0x44758c,_0x2d28f2){_0x44758c=_0x44758c-0x0;var _0x22c811=_0x9009[_0x44758c];return _0x22c811;};'use strict';var _=require(_0x9900('0x0'));var util=require(_0x9900('0x1'));var zendesk=require(_0x9900('0x2'));var salesforce=require(_0x9900('0x3'));var sugarcrm=require(_0x9900('0x4'));var freshdesk=require(_0x9900('0x5'));var zoho=require('./zoho');var desk=require(_0x9900('0x6'));var vtiger=require(_0x9900('0x7'));var servicenow=require(_0x9900('0x8'));var dynamics365=require(_0x9900('0x9'));var freshsales=require(_0x9900('0xa'));var integrations=[_0x9900('0xb'),_0x9900('0xc'),'sugarcrm','freshdesk',_0x9900('0xd'),'desk',_0x9900('0xe'),_0x9900('0xf'),_0x9900('0x10'),_0x9900('0x11')];exports[_0x9900('0x12')]=function(_0x16dcf1,_0x2cd813,_0x353048,_0x1287bc,_0x17ade2,_0x4c4bfa){if(_0x353048){if(_[_0x9900('0x13')](integrations,_0x16dcf1[_0x9900('0x14')]['toLowerCase']())){try{var _0x570c55=null;var _0x578a0f='';var _0x3145be=_0x353048[_0x16dcf1[_0x9900('0x14')][_0x9900('0x15')]()];if(_0x3145be){var _0x9b6c0c=_0x3145be[_0x16dcf1[_0x9900('0x16')]];if(_0x9b6c0c){var _0xb940b6=_['find'](_0x9b6c0c[_0x9900('0x17')],{'id':parseInt(_0x16dcf1[_0x9900('0x18')],0xa)});if(_0xb940b6){if(_0x1287bc){if(_0x17ade2&&_0x2cd813['queue']){_0x578a0f=_0x9900('0x19');}else if(_0x2cd813[_0x9900('0x1a')]){_0x578a0f='outbound';}else{console[_0x9900('0x1b')](_0x9900('0x1c'),_0x2cd813);}}else{_0x578a0f=_0x9900('0x1d');}switch(_0x16dcf1[_0x9900('0x14')][_0x9900('0x15')]()){case _0x9900('0xb'):zendesk[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case _0x9900('0xc'):salesforce[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case _0x9900('0x1e'):sugarcrm[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case'freshdesk':freshdesk[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case _0x9900('0xd'):zoho[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case _0x9900('0x1f'):desk[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case _0x9900('0xe'):vtiger[_0x578a0f](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa);break;case'freshsales':freshsales['cs'](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa,_0x578a0f);break;case _0x9900('0x11'):servicenow['cs'](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa,_0x578a0f);break;case _0x9900('0xf'):dynamics365['cs'](_0x16dcf1,_0x2cd813,_0xb940b6,_0x1287bc,_0x17ade2,_0x9b6c0c,_0x4c4bfa,_0x578a0f);break;default:console[_0x9900('0x1b')](_0x9900('0x20'));}}else{_0x570c55=require('../../../../config/logger')(_0x16dcf1[_0x9900('0x14')][_0x9900('0x15')]());_0x570c55[_0x9900('0x21')](_0x9900('0x22'),util[_0x9900('0x23')](_0x9900('0x24'),_0x16dcf1[_0x9900('0x14')]['toLowerCase'](),_0x16dcf1[_0x9900('0x18')]));}}else{_0x570c55=require('../../../../config/logger')(_0x16dcf1[_0x9900('0x14')][_0x9900('0x15')]());_0x570c55[_0x9900('0x21')]('[EXEC]',util['format'](_0x9900('0x25'),_0x16dcf1['data1'][_0x9900('0x15')](),_0x16dcf1['data2']));}}else{}}catch(_0x146da2){console[_0x9900('0x21')](_0x146da2);}}}}; \ No newline at end of file +var _0x007f=['Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshdesk','freshsales','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','toLowerCase','data1','find'];(function(_0x52b4a9,_0x659ba9){var _0x5042cc=function(_0x346ea2){while(--_0x346ea2){_0x52b4a9['push'](_0x52b4a9['shift']());}};_0x5042cc(++_0x659ba9);}(_0x007f,0xdf));var _0xf007=function(_0x57e50b,_0x16e856){_0x57e50b=_0x57e50b-0x0;var _0x4a1016=_0x007f[_0x57e50b];return _0x4a1016;};'use strict';var _=require(_0xf007('0x0'));var util=require(_0xf007('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xf007('0x2'));var sugarcrm=require(_0xf007('0x3'));var freshdesk=require(_0xf007('0x4'));var zoho=require(_0xf007('0x5'));var desk=require(_0xf007('0x6'));var vtiger=require(_0xf007('0x7'));var servicenow=require(_0xf007('0x8'));var dynamics365=require(_0xf007('0x9'));var freshsales=require(_0xf007('0xa'));var integrations=[_0xf007('0xb'),'salesforce',_0xf007('0xc'),'freshdesk',_0xf007('0xd'),_0xf007('0xe'),_0xf007('0xf'),_0xf007('0x10'),'freshsales',_0xf007('0x11')];exports[_0xf007('0x12')]=function(_0xbe45a4,_0x510783,_0x187daa,_0x4c7900,_0xcbbf6f,_0x4897b3){if(_0x187daa){if(_[_0xf007('0x13')](integrations,_0xbe45a4['data1'][_0xf007('0x14')]())){try{var _0x5d76fe=null;var _0x479ee0='';var _0x31c1fb=_0x187daa[_0xbe45a4[_0xf007('0x15')][_0xf007('0x14')]()];if(_0x31c1fb){var _0x4f4eba=_0x31c1fb[_0xbe45a4['data2']];if(_0x4f4eba){var _0x326c5b=_[_0xf007('0x16')](_0x4f4eba[_0xf007('0x17')],{'id':parseInt(_0xbe45a4[_0xf007('0x18')],0xa)});if(_0x326c5b){if(_0x4c7900){if(_0xcbbf6f&&_0x510783[_0xf007('0x19')]){_0x479ee0=_0xf007('0x19');}else if(_0x510783[_0xf007('0x1a')]){_0x479ee0=_0xf007('0x1b');}else{console[_0xf007('0x1c')](_0xf007('0x1d'),_0x510783);}}else{_0x479ee0=_0xf007('0x1e');}switch(_0xbe45a4[_0xf007('0x15')][_0xf007('0x14')]()){case _0xf007('0xb'):zendesk[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0x1f'):salesforce[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0xc'):sugarcrm[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0x20'):freshdesk[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0xd'):zoho[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case'desk':desk[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0xf'):vtiger[_0x479ee0](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3);break;case _0xf007('0x21'):freshsales['cs'](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3,_0x479ee0);break;case'servicenow':servicenow['cs'](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3,_0x479ee0);break;case _0xf007('0x10'):dynamics365['cs'](_0xbe45a4,_0x510783,_0x326c5b,_0x4c7900,_0xcbbf6f,_0x4f4eba,_0x4897b3,_0x479ee0);break;default:console[_0xf007('0x1c')]('unknown\x20integration');}}else{_0x5d76fe=require(_0xf007('0x22'))(_0xbe45a4[_0xf007('0x15')][_0xf007('0x14')]());_0x5d76fe[_0xf007('0x23')](_0xf007('0x24'),util[_0xf007('0x25')](_0xf007('0x26'),_0xbe45a4[_0xf007('0x15')][_0xf007('0x14')](),_0xbe45a4['data3']));}}else{_0x5d76fe=require(_0xf007('0x22'))(_0xbe45a4[_0xf007('0x15')][_0xf007('0x14')]());_0x5d76fe['error']('[EXEC]',util['format'](_0xf007('0x27'),_0xbe45a4[_0xf007('0x15')]['toLowerCase'](),_0xbe45a4[_0xf007('0x28')]));}}else{}}catch(_0x1eb94f){console[_0xf007('0x23')](_0x1eb94f);}}}}; \ 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 aa416b1..2a219a4 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 _0x7c7c=['queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','error','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','calleridname','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','then','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','length','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','execute','Contact','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','picklist','idField','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','serverUrl','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields'];(function(_0x41a7ac,_0x4a7566){var _0x5a110a=function(_0x30943b){while(--_0x30943b){_0x41a7ac['push'](_0x41a7ac['shift']());}};_0x5a110a(++_0x4a7566);}(_0x7c7c,0x9d));var _0xc7c7=function(_0x302638,_0x3773ad){_0x302638=_0x302638-0x0;var _0x47528c=_0x7c7c[_0x302638];return _0x47528c;};'use strict';var _=require('lodash');var rp=require(_0xc7c7('0x0'));var moment=require(_0xc7c7('0x1'));var BPromise=require(_0xc7c7('0x2'));var md5=require('md5');var jsforce=require(_0xc7c7('0x3'));var util=require(_0xc7c7('0x4'));var Redis=require(_0xc7c7('0x5'));var intUtil=require('./util');var config=require(_0xc7c7('0x6'));var logger=require('../../../../config/logger')('salesforce');config[_0xc7c7('0x7')]=_[_0xc7c7('0x8')](config[_0xc7c7('0x7')],{'host':_0xc7c7('0x9'),'port':0x18eb});var io=require(_0xc7c7('0xa'))(new Redis(config[_0xc7c7('0x7')]));function emit(_0x190e76,_0x250a74,_0x5e55a1){io['to'](_0x190e76)[_0xc7c7('0xb')](_0x250a74,_0x5e55a1);}function getTicket(_0x3c22b4,_0x2f2d95,_0x560b6d,_0xac922f,_0x1598d6,_0x314454,_0x137d41,_0x14ceeb){var _0x5d07c1=Object['assign']({},{'OwnerId':_0x2f2d95['id'],'Subject':intUtil[_0xc7c7('0xc')](_0xac922f[_0xc7c7('0xd')],_0x1598d6,'\x20'),'Description':intUtil[_0xc7c7('0xc')](_0xac922f[_0xc7c7('0xe')],_0x1598d6,'\x0a')},getCustomFields(_0x314454,_0x1598d6));if(_0x560b6d){if(_0xac922f[_0xc7c7('0xf')]===_0xc7c7('0x10')){_0x5d07c1[_0xc7c7('0x11')]=moment[_0xc7c7('0x12')]();_0x5d07c1['IsReminderSet']=![];_0x5d07c1[_0xc7c7('0x13')]=![];if(_0x560b6d[_0xc7c7('0x14')]===_0xc7c7('0x15')||_0x560b6d[_0xc7c7('0x14')]===_0xc7c7('0x16')){_0x5d07c1[_0xc7c7('0x17')]=_0x560b6d['id'];}else if(_0x560b6d[_0xc7c7('0x14')]===_0xc7c7('0x18')){_0x5d07c1[_0xc7c7('0x19')]=_0x560b6d['id'];}}else if(_0xac922f['ticketType']==='Case'){if(_0x560b6d[_0xc7c7('0x14')]==='contact'){_0x5d07c1[_0xc7c7('0x1a')]=_0x560b6d['id'];}else if(_0x560b6d[_0xc7c7('0x14')]===_0xc7c7('0x18')){_0x5d07c1[_0xc7c7('0x1b')]=_0x560b6d['id'];}else if(_0x560b6d[_0xc7c7('0x14')]==='lead'&&_0xac922f[_0xc7c7('0x1c')]){_0x5d07c1[_0xac922f[_0xc7c7('0x1c')]]=_0x560b6d['id'];}else{logger[_0xc7c7('0x1d')](_0xc7c7('0x1e'));}}}return _0x137d41[_0xc7c7('0x1f')](_0xac922f[_0xc7c7('0xf')])['create'](_0x5d07c1);}function getUser(_0x240f3f,_0x44fdc2,_0x50b223){if(!_[_0xc7c7('0x20')](_0x44fdc2)&&intUtil['validateEmail'](_0x44fdc2)){var _0x27b1d1={'Email':_0x44fdc2};var _0x12f1a1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x50b223[_0xc7c7('0x1f')]('User')['find'](_0x27b1d1,_0x12f1a1)['execute']()[_0xc7c7('0x21')](function(_0x27d7e0){if(_0x27d7e0['length']){var _0xe659ae=_[_0xc7c7('0x22')](_0x27d7e0,function(_0x3c38c7){return _0x3c38c7[_0xc7c7('0x23')]===_0x44fdc2;});if(_0xe659ae){logger[_0xc7c7('0x1d')](_0xc7c7('0x24'),_0x44fdc2);return BPromise[_0xc7c7('0x25')]({'id':_0xe659ae['Id'],'name':_0xe659ae[_0xc7c7('0x26')]});}}else{logger[_0xc7c7('0x1d')](_0xc7c7('0x27'),_0x44fdc2);return _0x50b223[_0xc7c7('0x28')]()['then'](function(_0x51c97f){return BPromise[_0xc7c7('0x25')]({'id':_0x51c97f[_0xc7c7('0x29')],'name':_0x51c97f[_0xc7c7('0x2a')]});});}});}else{logger[_0xc7c7('0x1d')](_0xc7c7('0x27'),_0x44fdc2);return _0x50b223[_0xc7c7('0x28')]()[_0xc7c7('0x21')](function(_0x3bc55c){return BPromise[_0xc7c7('0x25')]({'id':_0x3bc55c[_0xc7c7('0x29')],'name':_0x3bc55c['display_name']});});}}function getEndUser(_0x12ec4b,_0xfbfb0c,_0x2b08fc,_0x3acc0c,_0x160448){var _0x547b75={'$or':{'Phone':_0x3acc0c}};var _0xc727d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc7c7('0x25')]()[_0xc7c7('0x21')](function(){logger[_0xc7c7('0x1d')](_0xc7c7('0x2b'),_0x3acc0c,_0xfbfb0c[_0xc7c7('0x2c')]);switch(_0xfbfb0c['moduleSearch']){case'contact_lead':var _0x1bcab7=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x2e')]){var _0x5bc2bb={};_0x5bc2bb[_0xfbfb0c[_0xc7c7('0x2e')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x1bcab7['$or'],_0x5bc2bb);}return _0x160448[_0xc7c7('0x1f')]('Contact')[_0xc7c7('0x22')](_0x1bcab7,_0xc727d)['execute']()[_0xc7c7('0x21')](function(_0x3b8934){if(_0x3b8934&&_0x3b8934[_0xc7c7('0x30')]){return _0x3b8934;}else{var _0x5eda88=_['cloneDeep'](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x31')]){var _0x26259d={};_0x26259d[_0xfbfb0c[_0xc7c7('0x31')]]=_0x3acc0c;_['merge'](_0x5eda88[_0xc7c7('0x32')],_0x26259d);}return _0x160448[_0xc7c7('0x1f')](_0xc7c7('0x33'))[_0xc7c7('0x22')](_0x5eda88,_0xc727d);}});case _0xc7c7('0x34'):var _0x5554f3=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x35')]){var _0x5bc2bb={};_0x5bc2bb[_0xfbfb0c[_0xc7c7('0x35')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x5554f3[_0xc7c7('0x32')],_0x5bc2bb);}return _0x160448['sobject']('Account')[_0xc7c7('0x22')](_0x5554f3,_0xc727d)[_0xc7c7('0x36')]()[_0xc7c7('0x21')](function(_0xcf9700){if(_0xcf9700&&_0xcf9700['length']){return _0xcf9700;}else{var _0x5e67ef=_['cloneDeep'](_0x547b75);if(_0xfbfb0c['additionalSearchContact']){var _0x327a87={};_0x327a87[_0xfbfb0c[_0xc7c7('0x2e')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x5e67ef[_0xc7c7('0x32')],_0x327a87);}return _0x160448[_0xc7c7('0x1f')]('Contact')[_0xc7c7('0x22')](_0x5e67ef,_0xc727d)['then'](function(_0x4f5f31){if(_0x4f5f31&&_0x4f5f31[_0xc7c7('0x30')]){return _0x4f5f31;}else{var _0x750da1=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c['additionalSearchLead']){var _0x1c9d9b={};_0x1c9d9b[_0xfbfb0c[_0xc7c7('0x31')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x750da1[_0xc7c7('0x32')],_0x1c9d9b);}return _0x160448[_0xc7c7('0x1f')](_0xc7c7('0x33'))[_0xc7c7('0x22')](_0x750da1,_0xc727d);}});}});case'contact':var _0x1bcab7=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x2e')]){var _0x5bc2bb={};_0x5bc2bb[_0xfbfb0c[_0xc7c7('0x2e')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x1bcab7[_0xc7c7('0x32')],_0x5bc2bb);}return _0x160448['sobject'](_0xc7c7('0x37'))[_0xc7c7('0x22')](_0x1bcab7,_0xc727d)[_0xc7c7('0x36')]();case _0xc7c7('0x16'):var _0x274c51=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x31')]){var _0x5bc2bb={};_0x5bc2bb[_0xfbfb0c[_0xc7c7('0x31')]]=_0x3acc0c;_['merge'](_0x274c51[_0xc7c7('0x32')],_0x5bc2bb);}return _0x160448['sobject']('Lead')[_0xc7c7('0x22')](_0x274c51,_0xc727d);case _0xc7c7('0x18'):var _0x5554f3=_[_0xc7c7('0x2d')](_0x547b75);if(_0xfbfb0c[_0xc7c7('0x35')]){var _0x5bc2bb={};_0x5bc2bb[_0xfbfb0c[_0xc7c7('0x35')]]=_0x3acc0c;_[_0xc7c7('0x2f')](_0x5554f3[_0xc7c7('0x32')],_0x5bc2bb);}return _0x160448['sobject'](_0xc7c7('0x38'))[_0xc7c7('0x22')](_0x5554f3,_0xc727d);default:return null;}})[_0xc7c7('0x21')](function(_0x4ffbb1){if(_0x4ffbb1&&_0x4ffbb1[_0xc7c7('0x30')]){var _0x3b220f=_[_0xc7c7('0x39')](_0x4ffbb1);if(_0x3b220f){return BPromise[_0xc7c7('0x25')]({'id':_0x3b220f['Id'],'name':_0x3b220f[_0xc7c7('0x26')],'phone':_0x3b220f[_0xc7c7('0x3a')],'endUserType':_0x3b220f[_0xc7c7('0x3b')][_0xc7c7('0x3c')][_0xc7c7('0x3d')]()});}}})[_0xc7c7('0x21')](function(_0x4d0dfd){if(_0x4d0dfd){logger[_0xc7c7('0x1d')](_0xc7c7('0x3e'),_0x4d0dfd[_0xc7c7('0x14')],_0x3acc0c);return BPromise[_0xc7c7('0x25')](_0x4d0dfd);}else{logger[_0xc7c7('0x1d')](_0xc7c7('0x3f'),_0x3acc0c);var _0x50ecb6={'Phone':_0x3acc0c};if(_0xfbfb0c[_0xc7c7('0x40')]){if(_0xfbfb0c[_0xc7c7('0x40')]==='contact'){logger[_0xc7c7('0x1d')](_0xc7c7('0x41'),_0x3acc0c,_0xfbfb0c[_0xc7c7('0x40')]);_0x50ecb6[_0xc7c7('0x42')]=_0x2b08fc!==_0xc7c7('0x43')?_0x2b08fc:util[_0xc7c7('0x44')](_0xc7c7('0x45'),_0x3acc0c);}else if(_0xfbfb0c[_0xc7c7('0x40')]===_0xc7c7('0x16')){logger[_0xc7c7('0x1d')](_0xc7c7('0x41'),_0x3acc0c,_0xfbfb0c['moduleCreate']);_0x50ecb6[_0xc7c7('0x42')]=_0x2b08fc!==_0xc7c7('0x43')?_0x2b08fc:util['format'](_0xc7c7('0x45'),_0x3acc0c);_0x50ecb6[_0xc7c7('0x46')]=_0xc7c7('0x47');}else if(_0xfbfb0c[_0xc7c7('0x40')]===_0xc7c7('0x18')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3acc0c,_0xfbfb0c[_0xc7c7('0x40')]);_0x50ecb6[_0xc7c7('0x26')]=_0x2b08fc!==_0xc7c7('0x43')?_0x2b08fc:util['format'](_0xc7c7('0x45'),_0x3acc0c);}else{return null;}}return _0x160448[_0xc7c7('0x1f')](_[_0xc7c7('0x48')](_0xfbfb0c[_0xc7c7('0x40')]))[_0xc7c7('0x49')](_0x50ecb6)[_0xc7c7('0x21')](function(_0x524cf3){return BPromise[_0xc7c7('0x25')]({'id':_0x524cf3['id'],'endUserType':_0xfbfb0c[_0xc7c7('0x40')]});});}});}function getCustomFields(_0x4b2072,_0x3dbc7f){var _0x5b554d={};if(_0x4b2072['length']>0x0){_[_0xc7c7('0x4a')](_0x4b2072,function(_0x11cdc6){if(_[_0xc7c7('0x4b')](['string',_0xc7c7('0x4c')],_0x11cdc6[_0xc7c7('0x3c')])&&_0x11cdc6[_0xc7c7('0x4d')]){_0x5b554d[_0x11cdc6[_0xc7c7('0x4d')]]=_0x11cdc6['content']['toString']();}else if(_0x11cdc6['type']===_0xc7c7('0x4e')&&_0x11cdc6['variableName']&&_0x11cdc6[_0xc7c7('0x4d')]){_0x3dbc7f[_0x11cdc6[_0xc7c7('0x4f')]]&&(_0x5b554d[_0x11cdc6[_0xc7c7('0x4d')]]=_0x3dbc7f[_0x11cdc6[_0xc7c7('0x4f')]][_0xc7c7('0x50')]());}else if(_0x11cdc6[_0xc7c7('0x3c')]===_0xc7c7('0x51')&&_0x11cdc6[_0xc7c7('0x52')]&&_0x11cdc6[_0xc7c7('0x52')]['name']&&_0x11cdc6[_0xc7c7('0x4d')]){_0x3dbc7f[_0x11cdc6[_0xc7c7('0x52')][_0xc7c7('0x53')][_0xc7c7('0x3d')]()]&&(_0x5b554d[_0x11cdc6[_0xc7c7('0x4d')]]=_0x3dbc7f[_0x11cdc6[_0xc7c7('0x52')]['name']['toLowerCase']()][_0xc7c7('0x50')]());}});}return _0x5b554d;}function getConnection(_0x49ce24){var _0xfc0fb8=_0x49ce24[_0xc7c7('0x54')][_0xc7c7('0x55')](_0x49ce24['securityToken']);var _0x18de4b=new jsforce[(_0xc7c7('0x56'))]({'oauth2':{'loginUrl':_0x49ce24['remoteUri']||_0xc7c7('0x57'),'clientId':_0x49ce24[_0xc7c7('0x58')],'clientSecret':_0x49ce24[_0xc7c7('0x59')]}});return _0x18de4b['login'](_0x49ce24['username'],_0xfc0fb8)[_0xc7c7('0x21')](function(){logger[_0xc7c7('0x1d')](_0xc7c7('0x5a'));return _0x18de4b;});}exports['queue']=function(_0x31694d,_0x7025f,_0x39fcb7,_0x1a8dea,_0x270e16,_0x222aec){var _0x54f556,_0x2a0b95,_0x5b4ea1,_0x3d4c54;_0x222aec[_0xc7c7('0x5b')]=intUtil['stripTrailingSlash'](_0x222aec[_0xc7c7('0x5b')]);_0x222aec[_0xc7c7('0x5c')]=intUtil['stripTrailingSlash'](_0x222aec[_0xc7c7('0x5c')]);if(_0x270e16&&_0x270e16[_0xc7c7('0x5d')]){logger[_0xc7c7('0x1d')](_0xc7c7('0x5e'),'Recording\x20is\x20enabled!');_0x7025f[_0xc7c7('0x5f')]=util[_0xc7c7('0x44')](_0xc7c7('0x60'),_0x222aec[_0xc7c7('0x5b')],_0x7025f[_0xc7c7('0x61')],md5(_0x7025f[_0xc7c7('0x61')]));}else{_0x7025f['recordingURL']='';}return getConnection(_0x222aec)[_0xc7c7('0x21')](function(_0x3705a6){_0x3d4c54=_0x3705a6;return getUser(_0x222aec,_0x1a8dea[_0xc7c7('0x62')],_0x3d4c54);})[_0xc7c7('0x21')](function(_0x44a2cf){_0x54f556=_0x44a2cf;return getEndUser(_0x222aec,_0x39fcb7,_0x7025f['calleridname'],_0x7025f[_0xc7c7('0x63')],_0x3d4c54);})[_0xc7c7('0x21')](function(_0x3a4242){_0x2a0b95=_0x3a4242;return getTicket(_0x222aec,_0x54f556,_0x2a0b95,_0x39fcb7,_0x7025f,_0x39fcb7[_0xc7c7('0x64')],_0x3d4c54,_0xc7c7('0x65'));})[_0xc7c7('0x21')](function(_0x4b5337){_0x5b4ea1=_0x4b5337;logger[_0xc7c7('0x1d')](_0xc7c7('0x66'),_0x5b4ea1['id']);logger['info'](_0xc7c7('0x67'),_0x5b4ea1['id'],_0x1a8dea[_0xc7c7('0x53')],_0x222aec[_0xc7c7('0x3c')]);switch(_0x222aec[_0xc7c7('0x3c')]){case _0xc7c7('0x68'):emit(util[_0xc7c7('0x44')](_0xc7c7('0x69'),_0x1a8dea[_0xc7c7('0x53')]),'trigger:salesforce:display',{'recordId':_0x5b4ea1['id']});break;case _0xc7c7('0x6a'):emit(util[_0xc7c7('0x44')](_0xc7c7('0x69'),_0x1a8dea[_0xc7c7('0x53')]),_0xc7c7('0x6b'),{'uri':util['format'](_0xc7c7('0x6c'),_0x3d4c54[_0xc7c7('0x6d')],_0x5b4ea1['id'])});break;default:logger['error'](_0xc7c7('0x6e'));}})[_0xc7c7('0x6f')](function(_0x198d05){logger['error'](_0xc7c7('0x5e'),_0x198d05);});};exports[_0xc7c7('0x70')]=function(_0x4cc35a,_0x1d4297,_0x42b6ee,_0x28957d,_0x5ad28a,_0x1557f0,_0x2b7516){var _0x184c2f,_0x3fdf10,_0x490673,_0x1f4384;_0x1557f0[_0xc7c7('0x5b')]=intUtil[_0xc7c7('0x71')](_0x1557f0['serverUrl']);_0x1557f0[_0xc7c7('0x5c')]=intUtil['stripTrailingSlash'](_0x1557f0[_0xc7c7('0x5c')]);if(_0x2b7516&&_0x2b7516['recordingFormat']&&_0x2b7516[_0xc7c7('0x72')]!=='none'){logger['info'](_0xc7c7('0x73'),_0xc7c7('0x74'));_0x1d4297[_0xc7c7('0x5f')]=util[_0xc7c7('0x44')](_0xc7c7('0x60'),_0x1557f0[_0xc7c7('0x5b')],_0x1d4297[_0xc7c7('0x61')],md5(_0x1d4297['uniqueid']));}return getConnection(_0x1557f0)['then'](function(_0x230dd8){_0x1f4384=_0x230dd8;return getUser(_0x1557f0,_0x28957d['email'],_0x1f4384);})[_0xc7c7('0x21')](function(_0x10e15d){_0x184c2f=_0x10e15d;return getEndUser(_0x1557f0,_0x42b6ee,_0x1d4297[_0xc7c7('0x75')],_0x1d4297[_0xc7c7('0x76')],_0x1f4384);})[_0xc7c7('0x21')](function(_0xe36ed3){_0x3fdf10=_0xe36ed3;return getTicket(_0x1557f0,_0x184c2f,_0x3fdf10,_0x42b6ee,_0x1d4297,_0x42b6ee['Fields'],_0x1f4384,_0xc7c7('0x70'));})[_0xc7c7('0x21')](function(_0x147c1a){_0x490673=_0x147c1a;logger[_0xc7c7('0x1d')](_0xc7c7('0x77'),_0x490673['id']);logger[_0xc7c7('0x1d')](_0xc7c7('0x78'),_0x490673['id'],_0x28957d[_0xc7c7('0x53')],_0x1557f0[_0xc7c7('0x3c')]);switch(_0x1557f0['type']){case _0xc7c7('0x68'):emit(util[_0xc7c7('0x44')](_0xc7c7('0x69'),_0x28957d['name']),_0xc7c7('0x79'),{'recordId':_0x490673['id']});break;case'newTab':emit(util[_0xc7c7('0x44')](_0xc7c7('0x69'),_0x28957d[_0xc7c7('0x53')]),'trigger:browser:url',{'uri':util[_0xc7c7('0x44')]('%s/%s/e',_0x1f4384['instanceUrl'],_0x490673['id'])});break;default:logger[_0xc7c7('0x7a')](_0xc7c7('0x73'),_0xc7c7('0x7b'));}})[_0xc7c7('0x6f')](function(_0x590c47){logger[_0xc7c7('0x7a')]('[OUTBOUND]',_0x590c47);});};exports[_0xc7c7('0x7c')]=function(_0x1f4d94,_0x4125c8,_0x3f1856,_0x55712b,_0x4c8c1e,_0x45ec7d){var _0x5ee3f4,_0xa79fcc,_0x54c790,_0x30c72d;_0x45ec7d['serverUrl']=intUtil[_0xc7c7('0x71')](_0x45ec7d[_0xc7c7('0x5b')]);_0x45ec7d[_0xc7c7('0x5c')]=intUtil['stripTrailingSlash'](_0x45ec7d['remoteUri']);if(_0x4c8c1e&&_0x4c8c1e[_0xc7c7('0x5d')]){logger['info']('['+_0x4125c8['lastevent']['toUpperCase']()+']',_0xc7c7('0x74'));_0x4125c8['recordingURL']=util[_0xc7c7('0x44')](_0xc7c7('0x60'),_0x45ec7d[_0xc7c7('0x5b')],_0x4125c8[_0xc7c7('0x61')],md5(_0x4125c8[_0xc7c7('0x61')]));}else{_0x4125c8['recordingURL']='';}return getConnection(_0x45ec7d)[_0xc7c7('0x21')](function(_0x34f88c){_0x30c72d=_0x34f88c;if(!_[_0xc7c7('0x20')](_0x55712b)){return getUser(_0x45ec7d,_0x55712b[_0xc7c7('0x53')],_0x30c72d);}else{return getUser(_0x45ec7d,null,_0x30c72d);}})['then'](function(_0x9b6e4b){_0x5ee3f4=_0x9b6e4b;return getEndUser(_0x45ec7d,_0x3f1856,_0x4125c8[_0xc7c7('0x7d')],_0x4125c8[_0xc7c7('0x63')],_0x30c72d);})[_0xc7c7('0x21')](function(_0x5f394){_0xa79fcc=_0x5f394;return getTicket(_0x45ec7d,_0x5ee3f4,_0xa79fcc,_0x3f1856,_0x4125c8,_0x3f1856[_0xc7c7('0x64')],_0x30c72d);})[_0xc7c7('0x21')](function(_0x3f6cab){_0x54c790=_0x3f6cab;logger[_0xc7c7('0x1d')]('['+_0x4125c8[_0xc7c7('0x7e')][_0xc7c7('0x7f')]()+']\x20Ticket\x20%s\x20created.',_0x54c790['id']);logger[_0xc7c7('0x1d')]('['+_0x4125c8[_0xc7c7('0x7e')]['toUpperCase']()+_0xc7c7('0x80'),_0x45ec7d['type']);})[_0xc7c7('0x6f')](function(_0x31ea36){logger[_0xc7c7('0x7a')]('['+_0x4125c8['lastevent'][_0xc7c7('0x7f')]()+']',_0x31ea36);});}; \ No newline at end of file +var _0x7226=['additionalSearchAccount','Account','Contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','No\x20Company','upperFirst','includes','string','picklist','idField','toString','variableName','Variable','name','toLowerCase','password','concat','remoteUri','clientId','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','ioredis','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','assign','Subjects','getString','Task','ActivityDate','utc','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','ticketType','create','isNil','validateEmail','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','sobject','additionalSearchLead','Lead','account_contact_lead'];(function(_0x114aad,_0x5df4a2){var _0x35dfc8=function(_0x44958d){while(--_0x44958d){_0x114aad['push'](_0x114aad['shift']());}};_0x35dfc8(++_0x5df4a2);}(_0x7226,0x138));var _0x6722=function(_0x4eaa30,_0x4255cf){_0x4eaa30=_0x4eaa30-0x0;var _0x20f148=_0x7226[_0x4eaa30];return _0x20f148;};'use strict';var _=require(_0x6722('0x0'));var rp=require(_0x6722('0x1'));var moment=require(_0x6722('0x2'));var BPromise=require(_0x6722('0x3'));var md5=require('md5');var jsforce=require(_0x6722('0x4'));var util=require('util');var Redis=require(_0x6722('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x6722('0x6'))(_0x6722('0x7'));config[_0x6722('0x8')]=_[_0x6722('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6722('0xa'))(new Redis(config[_0x6722('0x8')]));function emit(_0x3a7b43,_0x37f4f5,_0x4ac1ca){io['to'](_0x3a7b43)['emit'](_0x37f4f5,_0x4ac1ca);}function getTicket(_0x3e2415,_0x13fbcf,_0x52a6ed,_0x2678a3,_0x1b44ce,_0x2a23e0,_0x4c234c,_0x735009){var _0xd04964=Object[_0x6722('0xb')]({},{'OwnerId':_0x13fbcf['id'],'Subject':intUtil['getString'](_0x2678a3[_0x6722('0xc')],_0x1b44ce,'\x20'),'Description':intUtil[_0x6722('0xd')](_0x2678a3['Descriptions'],_0x1b44ce,'\x0a')},getCustomFields(_0x2a23e0,_0x1b44ce));if(_0x52a6ed){if(_0x2678a3['ticketType']===_0x6722('0xe')){_0xd04964[_0x6722('0xf')]=moment[_0x6722('0x10')]();_0xd04964['IsReminderSet']=![];_0xd04964['IsRecurrence']=![];if(_0x52a6ed[_0x6722('0x11')]==='contact'||_0x52a6ed[_0x6722('0x11')]===_0x6722('0x12')){_0xd04964[_0x6722('0x13')]=_0x52a6ed['id'];}else if(_0x52a6ed[_0x6722('0x11')]===_0x6722('0x14')){_0xd04964[_0x6722('0x15')]=_0x52a6ed['id'];}}else if(_0x2678a3['ticketType']===_0x6722('0x16')){if(_0x52a6ed[_0x6722('0x11')]===_0x6722('0x17')){_0xd04964[_0x6722('0x18')]=_0x52a6ed['id'];}else if(_0x52a6ed[_0x6722('0x11')]===_0x6722('0x14')){_0xd04964[_0x6722('0x19')]=_0x52a6ed['id'];}else if(_0x52a6ed[_0x6722('0x11')]===_0x6722('0x12')&&_0x2678a3[_0x6722('0x1a')]){_0xd04964[_0x2678a3[_0x6722('0x1a')]]=_0x52a6ed['id'];}else{logger[_0x6722('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4c234c['sobject'](_0x2678a3[_0x6722('0x1c')])[_0x6722('0x1d')](_0xd04964);}function getUser(_0x32abe2,_0x337ceb,_0x1aeaa3){if(!_[_0x6722('0x1e')](_0x337ceb)&&intUtil[_0x6722('0x1f')](_0x337ceb)){var _0x5dc227={'Email':_0x337ceb};var _0x3f0e37={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1aeaa3['sobject']('User')[_0x6722('0x20')](_0x5dc227,_0x3f0e37)[_0x6722('0x21')]()[_0x6722('0x22')](function(_0x1ff80f){if(_0x1ff80f[_0x6722('0x23')]){var _0x723ad1=_['find'](_0x1ff80f,function(_0x1f3615){return _0x1f3615['Email']===_0x337ceb;});if(_0x723ad1){logger[_0x6722('0x1b')](_0x6722('0x24'),_0x337ceb);return BPromise[_0x6722('0x25')]({'id':_0x723ad1['Id'],'name':_0x723ad1[_0x6722('0x26')]});}}else{logger[_0x6722('0x1b')](_0x6722('0x27'),_0x337ceb);return _0x1aeaa3[_0x6722('0x28')]()[_0x6722('0x22')](function(_0x47e9f0){return BPromise[_0x6722('0x25')]({'id':_0x47e9f0[_0x6722('0x29')],'name':_0x47e9f0[_0x6722('0x2a')]});});}});}else{logger[_0x6722('0x1b')](_0x6722('0x27'),_0x337ceb);return _0x1aeaa3['identity']()[_0x6722('0x22')](function(_0x358d2f){return BPromise[_0x6722('0x25')]({'id':_0x358d2f[_0x6722('0x29')],'name':_0x358d2f['display_name']});});}}function getEndUser(_0x73ce5f,_0x2d903f,_0x285457,_0x1f8d23,_0x246144){var _0x959f03={'$or':{'Phone':_0x1f8d23}};var _0x209e34={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x6722('0x22')](function(){logger['info'](_0x6722('0x2b'),_0x1f8d23,_0x2d903f[_0x6722('0x2c')]);switch(_0x2d903f[_0x6722('0x2c')]){case _0x6722('0x2d'):var _0x5e9e05=_[_0x6722('0x2e')](_0x959f03);if(_0x2d903f[_0x6722('0x2f')]){var _0x42bac5={};_0x42bac5[_0x2d903f[_0x6722('0x2f')]]=_0x1f8d23;_[_0x6722('0x30')](_0x5e9e05[_0x6722('0x31')],_0x42bac5);}return _0x246144[_0x6722('0x32')]('Contact')['find'](_0x5e9e05,_0x209e34)[_0x6722('0x21')]()[_0x6722('0x22')](function(_0x74c743){if(_0x74c743&&_0x74c743[_0x6722('0x23')]){return _0x74c743;}else{var _0x314661=_['cloneDeep'](_0x959f03);if(_0x2d903f[_0x6722('0x33')]){var _0x4d7ca3={};_0x4d7ca3[_0x2d903f['additionalSearchLead']]=_0x1f8d23;_[_0x6722('0x30')](_0x314661['$or'],_0x4d7ca3);}return _0x246144[_0x6722('0x32')](_0x6722('0x34'))[_0x6722('0x20')](_0x314661,_0x209e34);}});case _0x6722('0x35'):var _0x3134ff=_['cloneDeep'](_0x959f03);if(_0x2d903f[_0x6722('0x36')]){var _0x42bac5={};_0x42bac5[_0x2d903f[_0x6722('0x36')]]=_0x1f8d23;_[_0x6722('0x30')](_0x3134ff[_0x6722('0x31')],_0x42bac5);}return _0x246144[_0x6722('0x32')](_0x6722('0x37'))['find'](_0x3134ff,_0x209e34)[_0x6722('0x21')]()[_0x6722('0x22')](function(_0x412bf7){if(_0x412bf7&&_0x412bf7[_0x6722('0x23')]){return _0x412bf7;}else{var _0xc6845f=_['cloneDeep'](_0x959f03);if(_0x2d903f['additionalSearchContact']){var _0x3e9bc4={};_0x3e9bc4[_0x2d903f['additionalSearchContact']]=_0x1f8d23;_[_0x6722('0x30')](_0xc6845f[_0x6722('0x31')],_0x3e9bc4);}return _0x246144[_0x6722('0x32')]('Contact')['find'](_0xc6845f,_0x209e34)['then'](function(_0x354118){if(_0x354118&&_0x354118[_0x6722('0x23')]){return _0x354118;}else{var _0x7ccdf7=_[_0x6722('0x2e')](_0x959f03);if(_0x2d903f['additionalSearchLead']){var _0x25a571={};_0x25a571[_0x2d903f[_0x6722('0x33')]]=_0x1f8d23;_[_0x6722('0x30')](_0x7ccdf7[_0x6722('0x31')],_0x25a571);}return _0x246144[_0x6722('0x32')](_0x6722('0x34'))[_0x6722('0x20')](_0x7ccdf7,_0x209e34);}});}});case'contact':var _0x5e9e05=_[_0x6722('0x2e')](_0x959f03);if(_0x2d903f[_0x6722('0x2f')]){var _0x42bac5={};_0x42bac5[_0x2d903f[_0x6722('0x2f')]]=_0x1f8d23;_[_0x6722('0x30')](_0x5e9e05[_0x6722('0x31')],_0x42bac5);}return _0x246144[_0x6722('0x32')](_0x6722('0x38'))[_0x6722('0x20')](_0x5e9e05,_0x209e34)[_0x6722('0x21')]();case'lead':var _0x546c00=_[_0x6722('0x2e')](_0x959f03);if(_0x2d903f[_0x6722('0x33')]){var _0x42bac5={};_0x42bac5[_0x2d903f[_0x6722('0x33')]]=_0x1f8d23;_[_0x6722('0x30')](_0x546c00[_0x6722('0x31')],_0x42bac5);}return _0x246144['sobject']('Lead')[_0x6722('0x20')](_0x546c00,_0x209e34);case _0x6722('0x14'):var _0x3134ff=_['cloneDeep'](_0x959f03);if(_0x2d903f[_0x6722('0x36')]){var _0x42bac5={};_0x42bac5[_0x2d903f[_0x6722('0x36')]]=_0x1f8d23;_['merge'](_0x3134ff[_0x6722('0x31')],_0x42bac5);}return _0x246144[_0x6722('0x32')]('Account')[_0x6722('0x20')](_0x3134ff,_0x209e34);default:return null;}})['then'](function(_0x586bb4){if(_0x586bb4&&_0x586bb4['length']){var _0x317eae=_[_0x6722('0x39')](_0x586bb4);if(_0x317eae){return BPromise[_0x6722('0x25')]({'id':_0x317eae['Id'],'name':_0x317eae['Name'],'phone':_0x317eae[_0x6722('0x3a')],'endUserType':_0x317eae[_0x6722('0x3b')][_0x6722('0x3c')]['toLowerCase']()});}}})[_0x6722('0x22')](function(_0x5503af){if(_0x5503af){logger[_0x6722('0x1b')](_0x6722('0x3d'),_0x5503af[_0x6722('0x11')],_0x1f8d23);return BPromise['resolve'](_0x5503af);}else{logger[_0x6722('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x1f8d23);var _0x42efb3={'Phone':_0x1f8d23};if(_0x2d903f[_0x6722('0x3e')]){if(_0x2d903f[_0x6722('0x3e')]===_0x6722('0x17')){logger['info'](_0x6722('0x3f'),_0x1f8d23,_0x2d903f[_0x6722('0x3e')]);_0x42efb3[_0x6722('0x40')]=_0x285457!==''?_0x285457:util[_0x6722('0x41')](_0x6722('0x42'),_0x1f8d23);}else if(_0x2d903f['moduleCreate']==='lead'){logger['info'](_0x6722('0x3f'),_0x1f8d23,_0x2d903f[_0x6722('0x3e')]);_0x42efb3[_0x6722('0x40')]=_0x285457!==''?_0x285457:util[_0x6722('0x41')](_0x6722('0x42'),_0x1f8d23);_0x42efb3['Company']=_0x6722('0x43');}else if(_0x2d903f[_0x6722('0x3e')]==='account'){logger[_0x6722('0x1b')](_0x6722('0x3f'),_0x1f8d23,_0x2d903f['moduleCreate']);_0x42efb3[_0x6722('0x26')]=_0x285457!==''?_0x285457:util[_0x6722('0x41')]('Caller\x20-\x20%s',_0x1f8d23);}else{return null;}}return _0x246144[_0x6722('0x32')](_[_0x6722('0x44')](_0x2d903f['moduleCreate']))[_0x6722('0x1d')](_0x42efb3)[_0x6722('0x22')](function(_0x77d1a0){return BPromise[_0x6722('0x25')]({'id':_0x77d1a0['id'],'endUserType':_0x2d903f[_0x6722('0x3e')]});});}});}function getCustomFields(_0x2bbbab,_0x8eedef){var _0x109fda={};if(_0x2bbbab[_0x6722('0x23')]>0x0){_['forEach'](_0x2bbbab,function(_0x25f2fe){if(_[_0x6722('0x45')]([_0x6722('0x46'),_0x6722('0x47')],_0x25f2fe[_0x6722('0x3c')])&&_0x25f2fe[_0x6722('0x48')]){_0x109fda[_0x25f2fe[_0x6722('0x48')]]=_0x25f2fe['content'][_0x6722('0x49')]();}else if(_0x25f2fe[_0x6722('0x3c')]==='variable'&&_0x25f2fe[_0x6722('0x4a')]&&_0x25f2fe[_0x6722('0x48')]){_0x8eedef[_0x25f2fe[_0x6722('0x4a')]]&&(_0x109fda[_0x25f2fe[_0x6722('0x48')]]=_0x8eedef[_0x25f2fe[_0x6722('0x4a')]][_0x6722('0x49')]());}else if(_0x25f2fe[_0x6722('0x3c')]==='customVariable'&&_0x25f2fe[_0x6722('0x4b')]&&_0x25f2fe['Variable'][_0x6722('0x4c')]&&_0x25f2fe['idField']){_0x8eedef[_0x25f2fe[_0x6722('0x4b')]['name'][_0x6722('0x4d')]()]&&(_0x109fda[_0x25f2fe[_0x6722('0x48')]]=_0x8eedef[_0x25f2fe[_0x6722('0x4b')]['name'][_0x6722('0x4d')]()][_0x6722('0x49')]());}});}return _0x109fda;}function getConnection(_0x32456d){var _0x8063a3=_0x32456d[_0x6722('0x4e')][_0x6722('0x4f')](_0x32456d['securityToken']);var _0x45bb89=new jsforce['Connection']({'oauth2':{'loginUrl':_0x32456d[_0x6722('0x50')]||'https://login.salesforce.com','clientId':_0x32456d[_0x6722('0x51')],'clientSecret':_0x32456d['clientSecret']}});return _0x45bb89[_0x6722('0x52')](_0x32456d[_0x6722('0x53')],_0x8063a3)[_0x6722('0x22')](function(){logger['info'](_0x6722('0x54'));return _0x45bb89;});}exports[_0x6722('0x55')]=function(_0x5e47b3,_0x12c7e2,_0x487324,_0x1a655b,_0x5b12e6,_0x17c2fb){var _0x36d2e5,_0x4348eb,_0x518db5,_0x5b8a5d;_0x17c2fb['serverUrl']=intUtil[_0x6722('0x56')](_0x17c2fb[_0x6722('0x57')]);_0x17c2fb[_0x6722('0x50')]=intUtil['stripTrailingSlash'](_0x17c2fb[_0x6722('0x50')]);if(_0x5b12e6&&_0x5b12e6['monitor_format']){logger[_0x6722('0x1b')](_0x6722('0x58'),_0x6722('0x59'));_0x12c7e2['recordingURL']=util['format'](_0x6722('0x5a'),_0x17c2fb[_0x6722('0x57')],_0x12c7e2['uniqueid'],md5(_0x12c7e2[_0x6722('0x5b')]));}else{_0x12c7e2[_0x6722('0x5c')]='';}return getConnection(_0x17c2fb)['then'](function(_0x3d46be){_0x5b8a5d=_0x3d46be;return getUser(_0x17c2fb,_0x1a655b['email'],_0x5b8a5d);})[_0x6722('0x22')](function(_0x5eddba){_0x36d2e5=_0x5eddba;return getEndUser(_0x17c2fb,_0x487324,_0x12c7e2[_0x6722('0x5d')],_0x12c7e2[_0x6722('0x5e')],_0x5b8a5d);})['then'](function(_0x28e752){_0x4348eb=_0x28e752;return getTicket(_0x17c2fb,_0x36d2e5,_0x4348eb,_0x487324,_0x12c7e2,_0x487324[_0x6722('0x5f')],_0x5b8a5d,_0x6722('0x55'));})[_0x6722('0x22')](function(_0x3029a1){_0x518db5=_0x3029a1;logger[_0x6722('0x1b')](_0x6722('0x60'),_0x518db5['id']);logger['info'](_0x6722('0x61'),_0x518db5['id'],_0x1a655b[_0x6722('0x4c')],_0x17c2fb[_0x6722('0x3c')]);switch(_0x17c2fb[_0x6722('0x3c')]){case _0x6722('0x62'):emit(util[_0x6722('0x41')](_0x6722('0x63'),_0x1a655b[_0x6722('0x4c')]),_0x6722('0x64'),{'recordId':_0x518db5['id']});break;case _0x6722('0x65'):emit(util[_0x6722('0x41')](_0x6722('0x63'),_0x1a655b[_0x6722('0x4c')]),_0x6722('0x66'),{'uri':util[_0x6722('0x41')](_0x6722('0x67'),_0x5b8a5d['instanceUrl'],_0x518db5['id'])});break;default:logger[_0x6722('0x68')](_0x6722('0x69'));}})[_0x6722('0x6a')](function(_0xf807cd){logger[_0x6722('0x68')](_0x6722('0x58'),_0xf807cd);});};exports[_0x6722('0x6b')]=function(_0x32c737,_0x41231c,_0x1bf2b9,_0x33ea43,_0x23575b,_0x4fba77,_0x28063d){var _0x53bd1a,_0x153192,_0x3abef,_0x46ccea;_0x4fba77[_0x6722('0x57')]=intUtil[_0x6722('0x56')](_0x4fba77[_0x6722('0x57')]);_0x4fba77[_0x6722('0x50')]=intUtil['stripTrailingSlash'](_0x4fba77[_0x6722('0x50')]);if(_0x28063d&&_0x28063d[_0x6722('0x6c')]&&_0x28063d[_0x6722('0x6c')]!==_0x6722('0x6d')){logger[_0x6722('0x1b')]('[OUTBOUND]',_0x6722('0x59'));_0x41231c[_0x6722('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4fba77['serverUrl'],_0x41231c['uniqueid'],md5(_0x41231c[_0x6722('0x5b')]));}return getConnection(_0x4fba77)['then'](function(_0x55bf0a){_0x46ccea=_0x55bf0a;return getUser(_0x4fba77,_0x33ea43[_0x6722('0x6e')],_0x46ccea);})[_0x6722('0x22')](function(_0x3287cf){_0x53bd1a=_0x3287cf;return getEndUser(_0x4fba77,_0x1bf2b9,_0x41231c[_0x6722('0x6f')],_0x41231c[_0x6722('0x70')],_0x46ccea);})[_0x6722('0x22')](function(_0x19def6){_0x153192=_0x19def6;return getTicket(_0x4fba77,_0x53bd1a,_0x153192,_0x1bf2b9,_0x41231c,_0x1bf2b9[_0x6722('0x5f')],_0x46ccea,_0x6722('0x6b'));})[_0x6722('0x22')](function(_0x15498a){_0x3abef=_0x15498a;logger[_0x6722('0x1b')](_0x6722('0x71'),_0x3abef['id']);logger[_0x6722('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3abef['id'],_0x33ea43[_0x6722('0x4c')],_0x4fba77[_0x6722('0x3c')]);switch(_0x4fba77[_0x6722('0x3c')]){case _0x6722('0x62'):emit(util[_0x6722('0x41')](_0x6722('0x63'),_0x33ea43[_0x6722('0x4c')]),'trigger:salesforce:display',{'recordId':_0x3abef['id']});break;case _0x6722('0x65'):emit(util['format'](_0x6722('0x63'),_0x33ea43[_0x6722('0x4c')]),_0x6722('0x66'),{'uri':util[_0x6722('0x41')](_0x6722('0x67'),_0x46ccea[_0x6722('0x72')],_0x3abef['id'])});break;default:logger[_0x6722('0x68')](_0x6722('0x73'),_0x6722('0x74'));}})['catch'](function(_0xa184a8){logger[_0x6722('0x68')]('[OUTBOUND]',_0xa184a8);});};exports['unmanaged']=function(_0x541c1c,_0x3a68d1,_0x3aac82,_0x48e6ee,_0x1a48da,_0x4660fd){var _0x38d7ae,_0x5aed12,_0x4b1cb7,_0x46ccb7;_0x4660fd[_0x6722('0x57')]=intUtil[_0x6722('0x56')](_0x4660fd[_0x6722('0x57')]);_0x4660fd[_0x6722('0x50')]=intUtil[_0x6722('0x56')](_0x4660fd['remoteUri']);if(_0x1a48da&&_0x1a48da[_0x6722('0x75')]){logger[_0x6722('0x1b')]('['+_0x3a68d1['lastevent'][_0x6722('0x76')]()+']',_0x6722('0x59'));_0x3a68d1[_0x6722('0x5c')]=util['format'](_0x6722('0x5a'),_0x4660fd[_0x6722('0x57')],_0x3a68d1[_0x6722('0x5b')],md5(_0x3a68d1[_0x6722('0x5b')]));}else{_0x3a68d1[_0x6722('0x5c')]='';}return getConnection(_0x4660fd)['then'](function(_0x317765){_0x46ccb7=_0x317765;if(!_[_0x6722('0x1e')](_0x48e6ee)){return getUser(_0x4660fd,_0x48e6ee[_0x6722('0x4c')],_0x46ccb7);}else{return getUser(_0x4660fd,null,_0x46ccb7);}})[_0x6722('0x22')](function(_0x428df7){_0x38d7ae=_0x428df7;return getEndUser(_0x4660fd,_0x3aac82,_0x3a68d1[_0x6722('0x5d')],_0x3a68d1[_0x6722('0x5e')],_0x46ccb7);})['then'](function(_0x5b4817){_0x5aed12=_0x5b4817;return getTicket(_0x4660fd,_0x38d7ae,_0x5aed12,_0x3aac82,_0x3a68d1,_0x3aac82[_0x6722('0x5f')],_0x46ccb7);})['then'](function(_0x2706b8){_0x4b1cb7=_0x2706b8;logger['info']('['+_0x3a68d1[_0x6722('0x77')][_0x6722('0x76')]()+_0x6722('0x78'),_0x4b1cb7['id']);logger[_0x6722('0x1b')]('['+_0x3a68d1[_0x6722('0x77')][_0x6722('0x76')]()+_0x6722('0x79'),_0x4660fd['type']);})['catch'](function(_0x51f089){logger['error']('['+_0x3a68d1[_0x6722('0x77')][_0x6722('0x76')]()+']',_0x51f089);});}; \ 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 bc3b077..12e882d 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 _0xcc36=['error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','sys_id','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident\x20-\x20','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminEmail','],\x20getUser\x20crm'];(function(_0x4706a5,_0x49f8b1){var _0x34c2c2=function(_0x4b92b3){while(--_0x4b92b3){_0x4706a5['push'](_0x4706a5['shift']());}};_0x34c2c2(++_0x49f8b1);}(_0xcc36,0x1a4));var _0x6cc3=function(_0x13f562,_0x1c5ef1){_0x13f562=_0x13f562-0x0;var _0x408664=_0xcc36[_0x13f562];return _0x408664;};'use strict';var _=require(_0x6cc3('0x0'));var Promise=require(_0x6cc3('0x1'));var rp=require(_0x6cc3('0x2'));var util=require(_0x6cc3('0x3'));var md5=require(_0x6cc3('0x4'));var Redis=require(_0x6cc3('0x5'));var intUtil=require(_0x6cc3('0x6'));var config=require(_0x6cc3('0x7'));var logger=require(_0x6cc3('0x8'))('servicenow');config[_0x6cc3('0x9')]=_[_0x6cc3('0xa')](config[_0x6cc3('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x6cc3('0xb'))(new Redis(config['redis']));function getAdminUser(_0x1f4866,_0x561ba4,_0x58d61a,_0x4be4ca,_0x453290,_0x8ebfcd){return new Promise(function(_0x4e7c33,_0x1aa65b){var _0x41a1f7={'method':_0x6cc3('0xc'),'uri':_0x4be4ca+_0x6cc3('0xd')+'&'+_0x453290+'&'+_0x8ebfcd,'auth':_0x561ba4,'json':!![]};return rp(_0x41a1f7)['then'](function(_0x5eef0a){if(_0x5eef0a['result'][_0x6cc3('0xe')]>0x0){_0x58d61a[_0x6cc3('0xf')]=_0x5eef0a[_0x6cc3('0x10')][0x0]['sys_id'];}logger[_0x6cc3('0x11')]('['+[_0x1f4866['toUpperCase']()]+_0x6cc3('0x12'),_0x58d61a);_0x4e7c33(_0x58d61a);})[_0x6cc3('0x13')](function(_0x85cce0){logger['error']('['+[_0x1f4866[_0x6cc3('0x14')]()]+']',_0x85cce0[_0x6cc3('0x15')]);_0x1aa65b(_0x85cce0[_0x6cc3('0x15')]);});});}function getUser(_0x2df63b,_0x50a113,_0x449544,_0xaf5d70,_0x17481a){return function(_0x12cb05){logger[_0x6cc3('0x11')]('['+[_0x2df63b[_0x6cc3('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x12cb05);return new Promise(function(_0x47462c,_0x72958d){if(intUtil[_0x6cc3('0x16')](_0x12cb05['userEmail'])){var _0x3ec9cf={'method':_0x6cc3('0xc'),'uri':_0x449544+_0x6cc3('0x17')+_0x12cb05[_0x6cc3('0x18')]+'&'+_0xaf5d70+'&'+_0x17481a,'auth':_0x50a113,'json':!![]};logger[_0x6cc3('0x11')]('['+[_0x2df63b[_0x6cc3('0x14')]()]+_0x6cc3('0x19'),_0x3ec9cf);return rp(_0x3ec9cf)[_0x6cc3('0x1a')](function(_0x532852){logger['info']('['+[_0x2df63b[_0x6cc3('0x14')]()]+'],\x20getUser\x20entity',_0x532852);if(_0x532852[_0x6cc3('0x10')][_0x6cc3('0xe')]>0x0&&String(_0x532852[_0x6cc3('0x10')][0x0][_0x6cc3('0x1b')])===_0x6cc3('0x1c')){_0x12cb05[_0x6cc3('0x1d')]=_0x532852[_0x6cc3('0x10')][0x0]['sys_id'];}else{_0x12cb05[_0x6cc3('0x1d')]=_0x12cb05[_0x6cc3('0xf')];_0x12cb05[_0x6cc3('0x18')]=_0x12cb05[_0x6cc3('0x1e')];}logger[_0x6cc3('0x11')]('['+[_0x2df63b[_0x6cc3('0x14')]()]+_0x6cc3('0x1f'),_0x12cb05);_0x47462c(_0x12cb05);})[_0x6cc3('0x13')](function(_0x5224e6){logger[_0x6cc3('0x20')]('['+[_0x2df63b[_0x6cc3('0x14')]()]+']',_0x5224e6['message']);_0x72958d(_0x5224e6[_0x6cc3('0x15')]);});}else{logger[_0x6cc3('0x11')]('['+[_0x2df63b[_0x6cc3('0x14')]()]+_0x6cc3('0x21'));_0x12cb05[_0x6cc3('0x1d')]=_0x12cb05[_0x6cc3('0xf')];_0x12cb05[_0x6cc3('0x18')]=_0x12cb05[_0x6cc3('0x1e')];_0x47462c(_0x12cb05);}});};}function createEndUser(_0x507bdb,_0x5c95da,_0x5ba3e6,_0x595a27,_0x4239c4){logger[_0x6cc3('0x11')]('['+[_0x507bdb[_0x6cc3('0x14')]()]+_0x6cc3('0x22'),_0x5ba3e6);return new Promise(function(_0x223c7c,_0x488d6e){var _0x24cea1={'method':_0x6cc3('0x23'),'uri':_0x595a27+_0x6cc3('0x24')+_0x4239c4,'body':{'user_name':_0x5ba3e6[_0x6cc3('0x25')],'roles':_0x6cc3('0x26'),'first_name':_0x5ba3e6[_0x6cc3('0x25')],'active':'true','date_format':_0x6cc3('0x27'),'phone':_0x5ba3e6[_0x6cc3('0x25')]},'auth':_0x5c95da,'json':!![]};return rp(_0x24cea1)[_0x6cc3('0x1a')](function(_0xbd2db8){logger[_0x6cc3('0x11')]('['+[_0x507bdb[_0x6cc3('0x14')]()]+'],\x20EndUser\x20schema',_0xbd2db8[_0x6cc3('0x10')]);_0x5ba3e6[_0x6cc3('0x28')]=_0xbd2db8['result']['sys_id'];_0x223c7c(_0x5ba3e6);})[_0x6cc3('0x13')](function(_0x1f0163){logger['error']('['+[_0x507bdb[_0x6cc3('0x14')]()]+']',_0x1f0163[_0x6cc3('0x15')]);_0x488d6e(_0x1f0163['message']);});});}function getEndUser(_0x112ff9,_0x50f782,_0x8ccfe8,_0xf0a9d3,_0x1fe2fb){return function(_0x3930ee){logger[_0x6cc3('0x11')]('['+[_0x112ff9[_0x6cc3('0x14')]()]+_0x6cc3('0x29'),_0x3930ee);return new Promise(function(_0x4f84a1,_0x27ec80){var _0x53061c={'method':'GET','uri':_0x8ccfe8+_0x6cc3('0x2a')+_0x3930ee[_0x6cc3('0x25')]+'&'+_0xf0a9d3+'&'+_0x1fe2fb,'auth':_0x50f782,'json':!![]};return rp(_0x53061c)[_0x6cc3('0x1a')](function(_0x2919aa){if(_0x2919aa['result']['length']>0x0){_0x3930ee[_0x6cc3('0x28')]=_0x2919aa[_0x6cc3('0x10')][0x0][_0x6cc3('0x2b')];logger[_0x6cc3('0x11')]('['+[_0x112ff9[_0x6cc3('0x14')]()]+_0x6cc3('0x2c'),_0x3930ee);_0x4f84a1(_0x3930ee);}else{return createEndUser(_0x112ff9,_0x50f782,_0x3930ee,_0x8ccfe8,_0xf0a9d3)['then'](function(_0x3e26a0){logger['info']('['+[_0x112ff9[_0x6cc3('0x14')]()]+_0x6cc3('0x2d'),_0x3e26a0);_0x4f84a1(_0x3e26a0);});}})[_0x6cc3('0x13')](function(_0x52d1ac){logger[_0x6cc3('0x20')]('['+[_0x112ff9[_0x6cc3('0x14')]()]+']',_0x52d1ac[_0x6cc3('0x15')]);_0x27ec80(_0x52d1ac[_0x6cc3('0x15')]);});});};}function getCustomFields(_0x3b93e3,_0x246f79){var _0x57ac9c={};if(_0x3b93e3[_0x6cc3('0xe')]>0x0){_['forEach'](_0x3b93e3,function(_0x4e8579){if(_[_0x6cc3('0x2e')]([_0x6cc3('0x2f'),_0x6cc3('0x30')],_0x4e8579[_0x6cc3('0x31')])&&_0x4e8579[_0x6cc3('0x32')]&&!_0x4e8579[_0x6cc3('0x33')]){_0x57ac9c[_0x4e8579[_0x6cc3('0x32')][_0x6cc3('0x34')]()]=_0x4e8579[_0x6cc3('0x35')][_0x6cc3('0x36')]();}else if(_[_0x6cc3('0x2e')]([_0x6cc3('0x2f'),_0x6cc3('0x30')],_0x4e8579['type'])&&_0x4e8579[_0x6cc3('0x37')]&&_0x4e8579[_0x6cc3('0x33')]){_0x57ac9c[_0x4e8579[_0x6cc3('0x37')][_0x6cc3('0x34')]()]=_0x4e8579[_0x6cc3('0x35')][_0x6cc3('0x36')]();}else if(_0x4e8579[_0x6cc3('0x31')]===_0x6cc3('0x38')&&_0x4e8579[_0x6cc3('0x39')]&&_0x4e8579[_0x6cc3('0x37')]&&_0x4e8579[_0x6cc3('0x33')]){_0x57ac9c[_0x4e8579[_0x6cc3('0x37')][_0x6cc3('0x34')]()]=_0x246f79[_0x4e8579[_0x6cc3('0x39')]][_0x6cc3('0x36')]();}else if(_0x4e8579[_0x6cc3('0x31')]===_0x6cc3('0x3a')&&_0x4e8579['Variable']&&_0x4e8579['Variable'][_0x6cc3('0x3b')]&&_0x4e8579[_0x6cc3('0x37')]&&_0x4e8579['customField']){_0x57ac9c[_0x4e8579[_0x6cc3('0x37')][_0x6cc3('0x34')]()]=_0x246f79[_0x4e8579[_0x6cc3('0x3c')][_0x6cc3('0x3b')][_0x6cc3('0x34')]()][_0x6cc3('0x36')]();}});}return _0x57ac9c;}function getTicket(_0x5b44ce,_0x319521,_0x472125,_0xf46347,_0x12d257,_0x7cfe51){return function(_0x2bcf09){logger[_0x6cc3('0x11')]('['+[_0x5b44ce[_0x6cc3('0x14')]()]+_0x6cc3('0x3d'),_0x2bcf09);return new Promise(function(_0x3cfd4c,_0x3c9ab9){var _0x55ddc5=_0x5b44ce[_0x6cc3('0x34')]()==='outbound'?_0x2bcf09['userId']:_0x2bcf09['endUserId'];var _0x49f9e9={'method':_0x6cc3('0x23'),'uri':_0x472125+_0x6cc3('0x3e')+'?'+_0x7cfe51,'body':Object[_0x6cc3('0x3f')]({},{'active':_0x6cc3('0x1c'),'caller_id':_0x55ddc5,'assigned_to':_0x2bcf09[_0x6cc3('0x1d')],'short_description':intUtil[_0x6cc3('0x40')](_0xf46347[_0x6cc3('0x41')],_0x12d257,'\x20'),'description':intUtil[_0x6cc3('0x40')](_0xf46347[_0x6cc3('0x42')],_0x12d257,'\x0a')},getCustomFields(_0xf46347[_0x6cc3('0x43')],_0x12d257)),'auth':_0x319521,'json':!![]};return rp(_0x49f9e9)[_0x6cc3('0x1a')](function(_0x209e6a){logger[_0x6cc3('0x11')]('['+[_0x5b44ce[_0x6cc3('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x209e6a['result']);_0x2bcf09[_0x6cc3('0x44')]=_0x209e6a[_0x6cc3('0x10')][_0x6cc3('0x2b')];_0x2bcf09[_0x6cc3('0x45')]=_0x209e6a[_0x6cc3('0x10')][_0x6cc3('0x46')];logger[_0x6cc3('0x11')]('['+[_0x5b44ce[_0x6cc3('0x14')]()]+_0x6cc3('0x47'),_0x2bcf09);_0x3cfd4c(_0x2bcf09);})[_0x6cc3('0x13')](function(_0x13b89d){logger[_0x6cc3('0x20')]('['+[_0x5b44ce['toUpperCase']()]+']',_0x13b89d[_0x6cc3('0x15')]);_0x3c9ab9(_0x13b89d['message']);});});};}function createRemoteTag(_0x5c8bd2,_0x189990,_0x250068,_0x482f69){return new Promise(function(_0x40f4e6,_0x1815b4){var _0x167c45={'method':_0x6cc3('0x23'),'uri':_0x250068+_0x6cc3('0x48')+'?'+_0x482f69,'body':{'short_description':_0x5c8bd2,'global':!![],'active':!![],'name':_0x5c8bd2},'auth':_0x189990,'json':!![]};return rp(_0x167c45)[_0x6cc3('0x1a')](function(_0x3c2522){var _0x4c33b6=_0x3c2522[_0x6cc3('0x10')][_0x6cc3('0x2b')];_0x40f4e6(_0x4c33b6);});});}function getRemoteTag(_0x525347,_0x40a40c,_0x29d6fb,_0x580111,_0x56b6b9){return new Promise(function(_0x2cd920,_0x6bf5f6){var _0x315a40={'method':_0x6cc3('0xc'),'uri':_0x29d6fb+'label'+'?sysparm_query=name%3D'+_0x525347+'&'+_0x580111,'auth':_0x40a40c,'json':!![]};return rp(_0x315a40)[_0x6cc3('0x1a')](function(_0x51fcaf){if(_0x51fcaf[_0x6cc3('0x10')]['length']>0x0){var _0x14de8b=_0x51fcaf[_0x6cc3('0x10')][0x0]['sys_id'];_0x2cd920(_0x14de8b);}else{return createRemoteTag(_0x525347,_0x40a40c,_0x29d6fb,_0x580111)[_0x6cc3('0x1a')](function(_0x267b83){_0x2cd920(_0x267b83);});}});});}function assignTagToIncident(_0x4ebab3,_0x414cd5,_0x1fabca,_0x478975,_0x581f34){return new Promise(function(_0x3aeca4,_0x34de70){var _0x461954={'method':_0x6cc3('0x23'),'uri':_0x1fabca+_0x6cc3('0x49')+'?'+_0x581f34,'body':{'label':_0x4ebab3,'table':_0x6cc3('0x3e'),'id_type':'Incident','table_key':_0x478975['ticketId'],'title':_0x6cc3('0x4a')+_0x478975['ticketNumber'],'id_display':_0x478975[_0x6cc3('0x45')]},'auth':_0x414cd5,'json':!![]};return rp(_0x461954)[_0x6cc3('0x1a')](function(_0x2e6306){_0x3aeca4();})[_0x6cc3('0x13')](function(){_0x3aeca4();});});}function manageTags(_0x119ac7,_0x3a3356,_0x58ac85,_0x3bf6be,_0x17b01a,_0x2ead38,_0x12687a){return new Promise(function(_0x46fc3a,_0x5c7df8){var _0x360b4f=[];_0x3a3356[_0x6cc3('0x4b')](function(_0x3f9740){_0x360b4f[_0x6cc3('0x4c')](getRemoteTag(_0x3f9740,_0x58ac85,_0x3bf6be,_0x2ead38,_0x12687a));});return Promise[_0x6cc3('0x4d')](_0x360b4f)[_0x6cc3('0x1a')](function(_0x27bf2e){if(_0x27bf2e['length']){logger['info']('['+[_0x119ac7[_0x6cc3('0x14')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x27bf2e);var _0x283805=[];_0x27bf2e[_0x6cc3('0x4b')](function(_0x26bc07){_0x283805[_0x6cc3('0x4c')](assignTagToIncident(_0x26bc07,_0x58ac85,_0x3bf6be,_0x17b01a,_0x2ead38));});return Promise[_0x6cc3('0x4d')](_0x283805)[_0x6cc3('0x1a')](function(){_0x46fc3a();})[_0x6cc3('0x13')](function(){_0x46fc3a();});}else{_0x46fc3a();}});});}function getTags(_0x474870,_0xb4dfb,_0x5cc4a3,_0x3e08a3,_0x255de1,_0x3f3c30){return function(_0x803874){return new Promise(function(_0x5da115,_0x155bfc){var _0x1f7223=[];var _0x4b36c2=_0x3e08a3[_0x6cc3('0x4e')];if(_0x4b36c2&&_0x4b36c2[_0x6cc3('0xe')]>0x0){_0x1f7223=_[_0x6cc3('0x4f')](_0x4b36c2,_0x6cc3('0x3b'));}if(_0x1f7223[_0x6cc3('0xe')]>0x0){return manageTags(_0x474870,_0x1f7223,_0xb4dfb,_0x5cc4a3,_0x803874,_0x255de1,_0x3f3c30)[_0x6cc3('0x1a')](function(){_0x5da115(_0x803874);});}else{_0x5da115(_0x803874);}});};}function emit(_0x5540e3,_0xea7b8,_0x460b2f){var _0x16cbc9=_0x6cc3('0x50')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x6cc3('0x51');var _0x2bd103={'uri':_0x5540e3+_0x6cc3('0x52')+_0x460b2f+_0x16cbc9};io['to'](util[_0x6cc3('0x53')](_0x6cc3('0x54'),_0xea7b8))[_0x6cc3('0x55')]('trigger:browser:url',_0x2bd103);}exports['cs']=function(_0x30d8e5,_0x2c3b60,_0x1ce181,_0x355386,_0x3c30ca,_0x1f2c1e,_0x3527bb,_0x44dd6b){var _0x435a55={};var _0x396296={'user':_0x1f2c1e[_0x6cc3('0x56')],'pass':_0x1f2c1e[_0x6cc3('0x57')]};var _0x4fd646=_0x6cc3('0x58');var _0x568669=_0x6cc3('0x59');_0x1f2c1e[_0x6cc3('0x5a')]=intUtil[_0x6cc3('0x5b')](_0x1f2c1e[_0x6cc3('0x5a')]);_0x1f2c1e[_0x6cc3('0x5c')]=intUtil['stripTrailingSlash'](_0x1f2c1e[_0x6cc3('0x5c')]);var _0x1d6a91=util[_0x6cc3('0x53')](_0x6cc3('0x5d'),_0x1f2c1e['remoteUri']);_0x435a55[_0x6cc3('0x18')]=!_['isNil'](_0x355386)?_0x355386[_0x6cc3('0x5e')]:null;_0x435a55[_0x6cc3('0x1e')]=_0x1f2c1e[_0x6cc3('0x5e')];_0x435a55[_0x6cc3('0x25')]=_0x44dd6b[_0x6cc3('0x34')]()===_0x6cc3('0x5f')?_0x2c3b60[_0x6cc3('0x60')]:_0x2c3b60[_0x6cc3('0x61')];_0x435a55[_0x6cc3('0x62')]=_0x44dd6b===_0x6cc3('0x63')||_0x44dd6b==='unmanaged'?'queue':_0x6cc3('0x5f');var _0x34fadc=util[_0x6cc3('0x53')](_0x6cc3('0x64'),_0x1f2c1e['serverUrl'],_0x2c3b60[_0x6cc3('0x65')],md5(_0x2c3b60[_0x6cc3('0x65')]));if(_0x3c30ca&&_0x3c30ca[_0x6cc3('0x66')]){logger[_0x6cc3('0x11')]('[QUEUE]',_0x6cc3('0x67'));_0x2c3b60[_0x6cc3('0x68')]=_0x34fadc;}else if(_0x3527bb&&_0x3527bb['recordingFormat']&&_0x3527bb[_0x6cc3('0x69')]!==_0x6cc3('0x6a')){logger['info'](_0x6cc3('0x6b'),_0x6cc3('0x67'));_0x2c3b60[_0x6cc3('0x68')]=_0x34fadc;}else{_0x2c3b60[_0x6cc3('0x68')]='';}return getAdminUser(_0x44dd6b,_0x396296,_0x435a55,_0x1d6a91,_0x568669,_0x4fd646)['then'](getUser(_0x44dd6b,_0x396296,_0x1d6a91,_0x568669,_0x4fd646))['then'](getEndUser(_0x44dd6b,_0x396296,_0x1d6a91,_0x568669,_0x4fd646))['then'](getTicket(_0x44dd6b,_0x396296,_0x1d6a91,_0x1ce181,_0x2c3b60,_0x568669))[_0x6cc3('0x1a')](function(_0x457765){logger[_0x6cc3('0x11')](util['format'](_0x6cc3('0x6c'),_0x457765['ticketId']));logger[_0x6cc3('0x11')](util['format'](_0x6cc3('0x6d'),_0x44dd6b));if(_0x44dd6b!==_0x6cc3('0x6e')){logger[_0x6cc3('0x11')]('['+[_0x44dd6b['toUpperCase']()]+']',_0x6cc3('0x6f'));emit(_0x1f2c1e[_0x6cc3('0x5a')],_0x355386[_0x6cc3('0x3b')],_0x457765[_0x6cc3('0x44')]);}})[_0x6cc3('0x13')](function(_0x4d08c2){logger[_0x6cc3('0x20')]('['+[_0x44dd6b[_0x6cc3('0x14')]()]+_0x6cc3('0x70'),util['inspect'](_0x4d08c2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbffd=['../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','sys_id','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','info','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','customField','nameField','toLowerCase','content','toString','includes','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','Incident','ticketId','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','stripTrailingSlash','serverUrl','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','md5','ioredis','./util'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xbffd,0xd8));var _0xdbff=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xbffd[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xdbff('0x0'));var util=require('util');var md5=require(_0xdbff('0x1'));var Redis=require(_0xdbff('0x2'));var intUtil=require(_0xdbff('0x3'));var config=require(_0xdbff('0x4'));var logger=require('../../../../config/logger')('servicenow');config[_0xdbff('0x5')]=_[_0xdbff('0x6')](config[_0xdbff('0x5')],{'host':_0xdbff('0x7'),'port':0x18eb});var io=require(_0xdbff('0x8'))(new Redis(config[_0xdbff('0x5')]));function getAdminUser(_0xb7cfbd,_0x4d0047,_0x50bf4f,_0x11205a,_0xaacbc,_0x3152ec){return new Promise(function(_0x255c49,_0xbe5794){var _0x5145c2={'method':_0xdbff('0x9'),'uri':_0x11205a+_0xdbff('0xa')+'&'+_0xaacbc+'&'+_0x3152ec,'auth':_0x4d0047,'json':!![]};return rp(_0x5145c2)['then'](function(_0x1c4840){if(_0x1c4840['result'][_0xdbff('0xb')]>0x0){_0x50bf4f[_0xdbff('0xc')]=_0x1c4840[_0xdbff('0xd')][0x0][_0xdbff('0xe')];}logger['info']('['+[_0xb7cfbd['toUpperCase']()]+_0xdbff('0xf'),_0x50bf4f);_0x255c49(_0x50bf4f);})[_0xdbff('0x10')](function(_0x453e15){logger[_0xdbff('0x11')]('['+[_0xb7cfbd[_0xdbff('0x12')]()]+']',_0x453e15[_0xdbff('0x13')]);_0xbe5794(_0x453e15[_0xdbff('0x13')]);});});}function getUser(_0x49d895,_0x594769,_0x1d2075,_0xe26c14,_0x35aa98){return function(_0x3cb9ca){logger[_0xdbff('0x14')]('['+[_0x49d895['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x3cb9ca);return new Promise(function(_0x2923b5,_0x429120){if(intUtil['validateEmail'](_0x3cb9ca[_0xdbff('0x15')])){var _0x3f1355={'method':_0xdbff('0x9'),'uri':_0x1d2075+_0xdbff('0x16')+_0x3cb9ca[_0xdbff('0x15')]+'&'+_0xe26c14+'&'+_0x35aa98,'auth':_0x594769,'json':!![]};logger[_0xdbff('0x14')]('['+[_0x49d895[_0xdbff('0x12')]()]+_0xdbff('0x17'),_0x3f1355);return rp(_0x3f1355)[_0xdbff('0x18')](function(_0x1cadfc){logger['info']('['+[_0x49d895[_0xdbff('0x12')]()]+_0xdbff('0x19'),_0x1cadfc);if(_0x1cadfc[_0xdbff('0xd')]['length']>0x0&&String(_0x1cadfc[_0xdbff('0xd')][0x0]['active'])===_0xdbff('0x1a')){_0x3cb9ca['userId']=_0x1cadfc[_0xdbff('0xd')][0x0][_0xdbff('0xe')];}else{_0x3cb9ca[_0xdbff('0x1b')]=_0x3cb9ca[_0xdbff('0xc')];_0x3cb9ca[_0xdbff('0x15')]=_0x3cb9ca['adminEmail'];}logger[_0xdbff('0x14')]('['+[_0x49d895[_0xdbff('0x12')]()]+_0xdbff('0x1c'),_0x3cb9ca);_0x2923b5(_0x3cb9ca);})[_0xdbff('0x10')](function(_0x1e43ca){logger[_0xdbff('0x11')]('['+[_0x49d895[_0xdbff('0x12')]()]+']',_0x1e43ca[_0xdbff('0x13')]);_0x429120(_0x1e43ca[_0xdbff('0x13')]);});}else{logger[_0xdbff('0x14')]('['+[_0x49d895[_0xdbff('0x12')]()]+_0xdbff('0x1d'));_0x3cb9ca['userId']=_0x3cb9ca[_0xdbff('0xc')];_0x3cb9ca[_0xdbff('0x15')]=_0x3cb9ca['adminEmail'];_0x2923b5(_0x3cb9ca);}});};}function createEndUser(_0x2b1a1b,_0xc4bac5,_0x4dfff3,_0x176c50,_0x28a8da){logger['info']('['+[_0x2b1a1b['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4dfff3);return new Promise(function(_0x32b460,_0x270070){var _0x57e891={'method':_0xdbff('0x1e'),'uri':_0x176c50+_0xdbff('0x1f')+_0x28a8da,'body':{'user_name':_0x4dfff3[_0xdbff('0x20')],'roles':_0xdbff('0x21'),'first_name':_0x4dfff3[_0xdbff('0x20')],'active':_0xdbff('0x1a'),'date_format':_0xdbff('0x22'),'phone':_0x4dfff3[_0xdbff('0x20')]},'auth':_0xc4bac5,'json':!![]};return rp(_0x57e891)['then'](function(_0x5b5a39){logger[_0xdbff('0x14')]('['+[_0x2b1a1b[_0xdbff('0x12')]()]+_0xdbff('0x23'),_0x5b5a39['result']);_0x4dfff3[_0xdbff('0x24')]=_0x5b5a39[_0xdbff('0xd')][_0xdbff('0xe')];_0x32b460(_0x4dfff3);})[_0xdbff('0x10')](function(_0x3a4adc){logger[_0xdbff('0x11')]('['+[_0x2b1a1b[_0xdbff('0x12')]()]+']',_0x3a4adc[_0xdbff('0x13')]);_0x270070(_0x3a4adc[_0xdbff('0x13')]);});});}function getEndUser(_0x48f315,_0xd54309,_0x283992,_0x4efb99,_0x32c367){return function(_0x3723b4){logger[_0xdbff('0x14')]('['+[_0x48f315[_0xdbff('0x12')]()]+_0xdbff('0x25'),_0x3723b4);return new Promise(function(_0x4877b3,_0x1e350f){var _0x5ab500={'method':_0xdbff('0x9'),'uri':_0x283992+_0xdbff('0x26')+_0x3723b4[_0xdbff('0x20')]+'&'+_0x4efb99+'&'+_0x32c367,'auth':_0xd54309,'json':!![]};return rp(_0x5ab500)['then'](function(_0x3f9422){if(_0x3f9422['result'][_0xdbff('0xb')]>0x0){_0x3723b4[_0xdbff('0x24')]=_0x3f9422['result'][0x0][_0xdbff('0xe')];logger[_0xdbff('0x14')]('['+[_0x48f315[_0xdbff('0x12')]()]+_0xdbff('0x27'),_0x3723b4);_0x4877b3(_0x3723b4);}else{return createEndUser(_0x48f315,_0xd54309,_0x3723b4,_0x283992,_0x4efb99)[_0xdbff('0x18')](function(_0x3953be){logger[_0xdbff('0x14')]('['+[_0x48f315[_0xdbff('0x12')]()]+_0xdbff('0x28'),_0x3953be);_0x4877b3(_0x3953be);});}})[_0xdbff('0x10')](function(_0x1e45f4){logger['error']('['+[_0x48f315[_0xdbff('0x12')]()]+']',_0x1e45f4[_0xdbff('0x13')]);_0x1e350f(_0x1e45f4[_0xdbff('0x13')]);});});};}function getCustomFields(_0xe1b9c5,_0x124861){var _0x4f10f9={};if(_0xe1b9c5[_0xdbff('0xb')]>0x0){_[_0xdbff('0x29')](_0xe1b9c5,function(_0x38289a){if(_['includes'](['string',_0xdbff('0x2a')],_0x38289a[_0xdbff('0x2b')])&&_0x38289a['nameField']&&!_0x38289a[_0xdbff('0x2c')]){_0x4f10f9[_0x38289a[_0xdbff('0x2d')][_0xdbff('0x2e')]()]=_0x38289a[_0xdbff('0x2f')][_0xdbff('0x30')]();}else if(_[_0xdbff('0x31')]([_0xdbff('0x32'),_0xdbff('0x2a')],_0x38289a[_0xdbff('0x2b')])&&_0x38289a[_0xdbff('0x33')]&&_0x38289a['customField']){_0x4f10f9[_0x38289a[_0xdbff('0x33')][_0xdbff('0x2e')]()]=_0x38289a[_0xdbff('0x2f')][_0xdbff('0x30')]();}else if(_0x38289a[_0xdbff('0x2b')]===_0xdbff('0x34')&&_0x38289a[_0xdbff('0x35')]&&_0x38289a['idField']&&_0x38289a[_0xdbff('0x2c')]){_0x4f10f9[_0x38289a['idField'][_0xdbff('0x2e')]()]=_0x124861[_0x38289a[_0xdbff('0x35')]][_0xdbff('0x30')]();}else if(_0x38289a[_0xdbff('0x2b')]===_0xdbff('0x36')&&_0x38289a[_0xdbff('0x37')]&&_0x38289a[_0xdbff('0x37')][_0xdbff('0x38')]&&_0x38289a[_0xdbff('0x33')]&&_0x38289a[_0xdbff('0x2c')]){_0x4f10f9[_0x38289a[_0xdbff('0x33')][_0xdbff('0x2e')]()]=_0x124861[_0x38289a[_0xdbff('0x37')][_0xdbff('0x38')]['toLowerCase']()][_0xdbff('0x30')]();}});}return _0x4f10f9;}function getTicket(_0x336c66,_0x2df634,_0x21e1f2,_0x4d758b,_0x54600e,_0x4223ac){return function(_0x43d4d2){logger[_0xdbff('0x14')]('['+[_0x336c66[_0xdbff('0x12')]()]+_0xdbff('0x39'),_0x43d4d2);return new Promise(function(_0x4d9915,_0x383f3a){var _0x49486f=_0x336c66[_0xdbff('0x2e')]()===_0xdbff('0x3a')?_0x43d4d2['userId']:_0x43d4d2[_0xdbff('0x24')];var _0x18c35d={'method':_0xdbff('0x1e'),'uri':_0x21e1f2+_0xdbff('0x3b')+'?'+_0x4223ac,'body':Object[_0xdbff('0x3c')]({},{'active':_0xdbff('0x1a'),'caller_id':_0x49486f,'assigned_to':_0x43d4d2[_0xdbff('0x1b')],'short_description':intUtil[_0xdbff('0x3d')](_0x4d758b[_0xdbff('0x3e')],_0x54600e,'\x20'),'description':intUtil['getString'](_0x4d758b[_0xdbff('0x3f')],_0x54600e,'\x0a')},getCustomFields(_0x4d758b[_0xdbff('0x40')],_0x54600e)),'auth':_0x2df634,'json':!![]};return rp(_0x18c35d)[_0xdbff('0x18')](function(_0x84ff6c){logger[_0xdbff('0x14')]('['+[_0x336c66['toUpperCase']()]+_0xdbff('0x41'),_0x84ff6c[_0xdbff('0xd')]);_0x43d4d2['ticketId']=_0x84ff6c[_0xdbff('0xd')][_0xdbff('0xe')];_0x43d4d2[_0xdbff('0x42')]=_0x84ff6c[_0xdbff('0xd')][_0xdbff('0x43')];logger[_0xdbff('0x14')]('['+[_0x336c66[_0xdbff('0x12')]()]+']\x20getTicket\x20crm',_0x43d4d2);_0x4d9915(_0x43d4d2);})[_0xdbff('0x10')](function(_0x48f927){logger['error']('['+[_0x336c66['toUpperCase']()]+']',_0x48f927['message']);_0x383f3a(_0x48f927[_0xdbff('0x13')]);});});};}function createRemoteTag(_0x53d14b,_0x14a38e,_0x1f42f0,_0x278e21){return new Promise(function(_0x1563cd,_0x384443){var _0x29c0d1={'method':'POST','uri':_0x1f42f0+'label'+'?'+_0x278e21,'body':{'short_description':_0x53d14b,'global':!![],'active':!![],'name':_0x53d14b},'auth':_0x14a38e,'json':!![]};return rp(_0x29c0d1)['then'](function(_0x1a315b){var _0x3238a2=_0x1a315b[_0xdbff('0xd')][_0xdbff('0xe')];_0x1563cd(_0x3238a2);});});}function getRemoteTag(_0x3ef336,_0x164d3a,_0x2b5c25,_0x3768f4,_0x121ff1){return new Promise(function(_0x2b9cb6,_0x4ea32d){var _0x5cf7cf={'method':_0xdbff('0x9'),'uri':_0x2b5c25+'label'+'?sysparm_query=name%3D'+_0x3ef336+'&'+_0x3768f4,'auth':_0x164d3a,'json':!![]};return rp(_0x5cf7cf)[_0xdbff('0x18')](function(_0x9e2efe){if(_0x9e2efe[_0xdbff('0xd')][_0xdbff('0xb')]>0x0){var _0x23e51c=_0x9e2efe[_0xdbff('0xd')][0x0]['sys_id'];_0x2b9cb6(_0x23e51c);}else{return createRemoteTag(_0x3ef336,_0x164d3a,_0x2b5c25,_0x3768f4)[_0xdbff('0x18')](function(_0x356d8a){_0x2b9cb6(_0x356d8a);});}});});}function assignTagToIncident(_0x3f0aba,_0x5ab610,_0x1db4d6,_0x37cfdf,_0x40208b){return new Promise(function(_0x58b5a0,_0x337a3b){var _0x45d893={'method':'POST','uri':_0x1db4d6+'label_entry'+'?'+_0x40208b,'body':{'label':_0x3f0aba,'table':_0xdbff('0x3b'),'id_type':_0xdbff('0x44'),'table_key':_0x37cfdf[_0xdbff('0x45')],'title':_0xdbff('0x46')+_0x37cfdf[_0xdbff('0x42')],'id_display':_0x37cfdf[_0xdbff('0x42')]},'auth':_0x5ab610,'json':!![]};return rp(_0x45d893)[_0xdbff('0x18')](function(_0x3a8b50){_0x58b5a0();})[_0xdbff('0x10')](function(){_0x58b5a0();});});}function manageTags(_0x5800ca,_0x16d995,_0x2bf32e,_0x151525,_0x5ca9a0,_0x4b3093,_0x58f40a){return new Promise(function(_0x1e50da,_0x1258a0){var _0x156468=[];_0x16d995[_0xdbff('0x29')](function(_0x8256c4){_0x156468[_0xdbff('0x47')](getRemoteTag(_0x8256c4,_0x2bf32e,_0x151525,_0x4b3093,_0x58f40a));});return Promise['all'](_0x156468)[_0xdbff('0x18')](function(_0x12973a){if(_0x12973a[_0xdbff('0xb')]){logger[_0xdbff('0x14')]('['+[_0x5800ca[_0xdbff('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x12973a);var _0x493567=[];_0x12973a[_0xdbff('0x29')](function(_0x31183a){_0x493567[_0xdbff('0x47')](assignTagToIncident(_0x31183a,_0x2bf32e,_0x151525,_0x5ca9a0,_0x4b3093));});return Promise[_0xdbff('0x48')](_0x493567)['then'](function(){_0x1e50da();})[_0xdbff('0x10')](function(){_0x1e50da();});}else{_0x1e50da();}});});}function getTags(_0x20c319,_0x4825b8,_0x166bf5,_0x4e422d,_0x14bc0e,_0x465a37){return function(_0x103236){return new Promise(function(_0x43ae8c,_0x5bbe75){var _0x4d2b86=[];var _0x118da5=_0x4e422d[_0xdbff('0x49')];if(_0x118da5&&_0x118da5[_0xdbff('0xb')]>0x0){_0x4d2b86=_[_0xdbff('0x4a')](_0x118da5,_0xdbff('0x38'));}if(_0x4d2b86[_0xdbff('0xb')]>0x0){return manageTags(_0x20c319,_0x4d2b86,_0x4825b8,_0x166bf5,_0x103236,_0x14bc0e,_0x465a37)['then'](function(){_0x43ae8c(_0x103236);});}else{_0x43ae8c(_0x103236);}});};}function emit(_0x1a0b46,_0x227af3,_0x4b160a){var _0x39f124=_0xdbff('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xdbff('0x4c')+'%255EORDERBYDESCnumber';var _0x5636cc={'uri':_0x1a0b46+_0xdbff('0x4d')+_0x4b160a+_0x39f124};io['to'](util[_0xdbff('0x4e')](_0xdbff('0x4f'),_0x227af3))[_0xdbff('0x50')](_0xdbff('0x51'),_0x5636cc);}exports['cs']=function(_0x21ae50,_0x716bfb,_0x52a3be,_0x4b57fc,_0xb217d,_0x33c923,_0x30ef29,_0x343950){var _0x241f78={};var _0x32eba3={'user':_0x33c923[_0xdbff('0x52')],'pass':_0x33c923[_0xdbff('0x53')]};var _0xe9170f='sysparm_limit=1';var _0x4ad025=_0xdbff('0x54');_0x33c923['remoteUri']=intUtil[_0xdbff('0x55')](_0x33c923['remoteUri']);_0x33c923[_0xdbff('0x56')]=intUtil[_0xdbff('0x55')](_0x33c923['serverUrl']);var _0x194cf7=util[_0xdbff('0x4e')](_0xdbff('0x57'),_0x33c923[_0xdbff('0x58')]);_0x241f78[_0xdbff('0x15')]=!_[_0xdbff('0x59')](_0x4b57fc)?_0x4b57fc['email']:null;_0x241f78['adminEmail']=_0x33c923[_0xdbff('0x5a')];_0x241f78[_0xdbff('0x20')]=_0x343950['toLowerCase']()===_0xdbff('0x3a')?_0x716bfb[_0xdbff('0x5b')]:_0x716bfb[_0xdbff('0x5c')];_0x241f78[_0xdbff('0x5d')]=_0x343950==='queue'||_0x343950===_0xdbff('0x5e')?_0xdbff('0x5f'):'outbound';var _0x39a9e5=util[_0xdbff('0x4e')](_0xdbff('0x60'),_0x33c923[_0xdbff('0x56')],_0x716bfb[_0xdbff('0x61')],md5(_0x716bfb[_0xdbff('0x61')]));if(_0xb217d&&_0xb217d[_0xdbff('0x62')]){logger[_0xdbff('0x14')](_0xdbff('0x63'),_0xdbff('0x64'));_0x716bfb[_0xdbff('0x65')]=_0x39a9e5;}else if(_0x30ef29&&_0x30ef29[_0xdbff('0x66')]&&_0x30ef29[_0xdbff('0x66')]!==_0xdbff('0x67')){logger[_0xdbff('0x14')](_0xdbff('0x68'),_0xdbff('0x64'));_0x716bfb[_0xdbff('0x65')]=_0x39a9e5;}else{_0x716bfb['recordingURL']='';}return getAdminUser(_0x343950,_0x32eba3,_0x241f78,_0x194cf7,_0x4ad025,_0xe9170f)['then'](getUser(_0x343950,_0x32eba3,_0x194cf7,_0x4ad025,_0xe9170f))[_0xdbff('0x18')](getEndUser(_0x343950,_0x32eba3,_0x194cf7,_0x4ad025,_0xe9170f))[_0xdbff('0x18')](getTicket(_0x343950,_0x32eba3,_0x194cf7,_0x52a3be,_0x716bfb,_0x4ad025))['then'](function(_0x34fefa){logger[_0xdbff('0x14')](util['format'](_0xdbff('0x69'),_0x34fefa['ticketId']));logger['info'](util[_0xdbff('0x4e')](_0xdbff('0x6a'),_0x343950));if(_0x343950!==_0xdbff('0x5e')){logger[_0xdbff('0x14')]('['+[_0x343950[_0xdbff('0x12')]()]+']',_0xdbff('0x6b'));emit(_0x33c923[_0xdbff('0x58')],_0x4b57fc[_0xdbff('0x38')],_0x34fefa[_0xdbff('0x45')]);}})['catch'](function(_0x5dcb6c){logger[_0xdbff('0x11')]('['+[_0x343950[_0xdbff('0x12')]()]+_0xdbff('0x6c'),util[_0xdbff('0x6d')](_0x5dcb6c,{'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 5837890..4efffbe 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 _0x86a4=['then','entry_list','length','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','Fields','Outbound','contacts','user:%s','unmanaged','lastevent','toUpperCase','lodash','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','info','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_type','Contacts','parent_name','name','direction','forEach','variableName','push','idField','JSON','stringify','Calls','format','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200'];(function(_0x4ffee4,_0x1db54d){var _0x5e9fe4=function(_0x5d3216){while(--_0x5d3216){_0x4ffee4['push'](_0x4ffee4['shift']());}};_0x5e9fe4(++_0x1db54d);}(_0x86a4,0x1b2));var _0x486a=function(_0x17563f,_0x2e11a8){_0x17563f=_0x17563f-0x0;var _0xb8c075=_0x86a4[_0x17563f];return _0xb8c075;};'use strict';var _=require(_0x486a('0x0'));var rp=require('request-promise');var BPromise=require(_0x486a('0x1'));var md5=require(_0x486a('0x2'));var util=require('util');var Redis=require(_0x486a('0x3'));var intUtil=require('./util');var config=require(_0x486a('0x4'));var logger=require(_0x486a('0x5'))(_0x486a('0x6'));config[_0x486a('0x7')]=_[_0x486a('0x8')](config['redis'],{'host':_0x486a('0x9'),'port':0x18eb});var io=require(_0x486a('0xa'))(new Redis(config[_0x486a('0x7')]));var def={'method':'POST','json':!![]};function emit(_0xc2de01,_0x4408b6,_0x285809){io['to'](_0xc2de01)['emit'](_0x4408b6,_0x285809);}function getTicket(_0x1d97b6,_0x5219f2,_0x1c4a9b,_0x5d0b27,_0x4f6fad,_0x70e624,_0x1969c1,_0x4a5a96){logger[_0x486a('0xb')]('Creating\x20new\x20ticket...');var _0x10ec5a=new Date();var _0x2f3cae=[{'name':'name','value':intUtil['getString'](_0x5d0b27[_0x486a('0xc')],_0x4f6fad,'\x20')},{'name':_0x486a('0xd'),'value':_0x5219f2['id']},{'name':_0x486a('0xe'),'value':_0x5219f2['id']},{'name':_0x486a('0xf'),'value':intUtil['getString'](_0x5d0b27[_0x486a('0x10')],_0x4f6fad,'\x0a')},{'name':_0x486a('0x11'),'value':_0x10ec5a[_0x486a('0x12')]()[_0x486a('0x13')](0x0,0x13)[_0x486a('0x14')]('T','\x20')},{'name':_0x486a('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1c4a9b['id']},{'name':_0x486a('0x16'),'value':_0x486a('0x17')},{'name':_0x486a('0x18'),'value':_0x1c4a9b[_0x486a('0x19')]},{'name':_0x486a('0x1a'),'value':_0x4a5a96}];if(_0x70e624['length']){_[_0x486a('0x1b')](_0x70e624,function(_0x3bb101){if(_0x4f6fad[_0x3bb101[_0x486a('0x1c')]]){_0x2f3cae[_0x486a('0x1d')]({'name':_0x3bb101[_0x486a('0x1e')],'value':_0x4f6fad[_0x3bb101[_0x486a('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x486a('0x1f'),'response_type':_0x486a('0x1f'),'rest_data':JSON[_0x486a('0x20')]({'session':_0x1969c1['id'],'module_name':_0x486a('0x21'),'name_value_list':_0x2f3cae})}});}function getAuth(_0x114e57){return util[_0x486a('0x22')]('Basic\x20%s',new Buffer(_0x114e57[_0x486a('0x23')]+':X')[_0x486a('0x24')](_0x486a('0x25')));}function getServerInfo(_0x553234){return request({'form':{'method':'get_server_info','input_type':_0x486a('0x1f'),'response_type':_0x486a('0x1f'),'rest_data':JSON[_0x486a('0x20')]({'session':_0x553234['id']})}});}function getUser(_0x44c6b7,_0x5564e7,_0x59e18e){if(!_[_0x486a('0x26')](_0x5564e7)){logger[_0x486a('0xb')](_0x486a('0x27'),_0x5564e7);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x486a('0x1f'),'rest_data':JSON['stringify']({'session':_0x59e18e['id'],'module_name':_0x486a('0x28'),'query':util[_0x486a('0x22')](_0x486a('0x29'),_0x5564e7),'order_by':'','offset':'0','select_fields':['id',_0x486a('0x19'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x486a('0x2a')](function(_0x540069){if(_0x540069[_0x486a('0x2b')][_0x486a('0x2c')]){var _0xbd443e=_[_0x486a('0x2d')](_0x540069[_0x486a('0x2b')],function(_0x4eeb42){return _0x4eeb42[_0x486a('0x2e')][_0x486a('0x2f')][_0x486a('0x30')]===_0x5564e7;});if(_0xbd443e){logger[_0x486a('0xb')](_0x486a('0x31'));return BPromise[_0x486a('0x32')]({'id':_0xbd443e[_0x486a('0x2e')]['id'][_0x486a('0x30')],'name':_0xbd443e[_0x486a('0x2e')][_0x486a('0x19')][_0x486a('0x30')]});}}logger[_0x486a('0xb')](_0x486a('0x33'));return BPromise[_0x486a('0x32')]({'id':_0x59e18e[_0x486a('0x2e')][_0x486a('0x34')][_0x486a('0x30')],'name':_0x59e18e[_0x486a('0x2e')][_0x486a('0x2f')][_0x486a('0x30')]});});}else{logger[_0x486a('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x486a('0x32')]({'id':_0x59e18e[_0x486a('0x2e')][_0x486a('0x34')][_0x486a('0x30')],'name':_0x59e18e['name_value_list'][_0x486a('0x2f')]['value']});}}function getEndUser(_0x2ee45f,_0x259b93,_0x4eb4e2,_0x4ed8dc){logger[_0x486a('0xb')]('Searching\x20enduser\x20with\x20phone',_0x4eb4e2);return request({'form':{'method':_0x486a('0x35'),'input_type':_0x486a('0x1f'),'response_type':_0x486a('0x1f'),'rest_data':JSON[_0x486a('0x20')]({'session':_0x4ed8dc['id'],'module_name':_0x486a('0x17'),'query':util[_0x486a('0x22')](_0x486a('0x36'),_0x4eb4e2),'order_by':'','offset':'0','select_fields':['id',_0x486a('0x19'),_0x486a('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x486a('0x2a')](function(_0x410d75){if(_0x410d75[_0x486a('0x2b')][_0x486a('0x2c')]){var _0x3ef0c9=_[_0x486a('0x2d')](_0x410d75['entry_list'],function(_0x5f289c){return _0x5f289c[_0x486a('0x2e')][_0x486a('0x37')]['value']===_0x4eb4e2;});if(_0x3ef0c9){logger[_0x486a('0xb')]('Enduser\x20found!');return BPromise[_0x486a('0x32')]({'id':_0x3ef0c9[_0x486a('0x2e')]['id']['value'],'name':_0x3ef0c9['name_value_list'][_0x486a('0x19')][_0x486a('0x30')],'phone':_0x3ef0c9[_0x486a('0x2e')][_0x486a('0x37')][_0x486a('0x30')]});}}else{logger[_0x486a('0xb')](_0x486a('0x38'));return request({'form':{'method':_0x486a('0x39'),'input_type':_0x486a('0x1f'),'response_type':'JSON','rest_data':JSON[_0x486a('0x20')]({'session':_0x4ed8dc['id'],'module_name':_0x486a('0x17'),'name_value_list':[{'name':_0x486a('0x3a'),'value':_0x259b93!==''?_0x259b93:util['format']('Caller\x20-\x20%s',_0x4eb4e2)},{'name':_0x486a('0x37'),'value':_0x4eb4e2}]})}})[_0x486a('0x2a')](function(_0x5e37c6){logger[_0x486a('0xb')](_0x486a('0x3b'));return BPromise[_0x486a('0x32')]({'id':_0x5e37c6['id'],'name':_0x5e37c6[_0x486a('0x2b')][_0x486a('0x3a')][_0x486a('0x30')],'phone':_0x5e37c6[_0x486a('0x2b')][_0x486a('0x37')][_0x486a('0x30')]});});}});}function request(_0xff18f2){logger[_0x486a('0x3c')](_0x486a('0x3d'),JSON[_0x486a('0x20')](_0xff18f2));return rp(_[_0x486a('0x3e')](def,_0xff18f2));}function getTags(_0x125540,_0x5512e1){var _0x21748c=[];if(_0x125540&&_0x125540[_0x486a('0x2c')]>0x0){_0x21748c=_[_0x486a('0x3f')](_0x125540,_0x5512e1);}return _0x21748c;}function getCustomFields(_0x45437b,_0x2291b7){var _0x1b6b4c=[];var _0x1502cf={'custom_fields':[]};if(_0x45437b['length']>0x0){_[_0x486a('0x1b')](_0x45437b,function(_0x3a0a30){if(_0x3a0a30[_0x486a('0x40')]===_0x486a('0x41')&&_0x3a0a30[_0x486a('0x42')]&&!_0x3a0a30[_0x486a('0x43')]){_0x1502cf[_0x3a0a30['nameField'][_0x486a('0x44')]()]=_0x3a0a30[_0x486a('0x45')][_0x486a('0x24')]();}else if(_0x3a0a30[_0x486a('0x40')]==='string'&&_0x3a0a30[_0x486a('0x1e')]&&_0x3a0a30['customField']){_0x1502cf[_0x486a('0x46')]['push']({'id':_0x3a0a30[_0x486a('0x1e')],'value':_0x3a0a30['content'][_0x486a('0x24')]()});}else if(_0x3a0a30['type']==='variable'&&_0x3a0a30['variableName']&&_0x3a0a30[_0x486a('0x1e')]&&_0x3a0a30[_0x486a('0x43')]){_0x2291b7[_0x3a0a30[_0x486a('0x1c')]]&&_0x1502cf[_0x486a('0x46')][_0x486a('0x1d')]({'id':_0x3a0a30['idField'],'value':_0x2291b7[_0x3a0a30[_0x486a('0x1c')]]['toString']()});}else if(_0x3a0a30[_0x486a('0x40')]===_0x486a('0x47')&&_0x3a0a30[_0x486a('0x48')]&&_0x3a0a30[_0x486a('0x48')][_0x486a('0x19')]&&_0x3a0a30[_0x486a('0x1e')]&&_0x3a0a30['customField']){_0x2291b7[_0x3a0a30[_0x486a('0x48')][_0x486a('0x19')][_0x486a('0x44')]()]&&_0x1502cf[_0x486a('0x46')]['push']({'id':_0x3a0a30[_0x486a('0x1e')],'value':_0x2291b7[_0x3a0a30[_0x486a('0x48')]['name']['toLowerCase']()][_0x486a('0x24')]()});}});}return _0x1502cf;}function getConnection(_0x35253d){return request({'method':'POST','form':{'method':_0x486a('0x49'),'input_type':_0x486a('0x1f'),'response_type':'JSON','rest_data':JSON[_0x486a('0x20')]({'user_auth':{'user_name':_0x35253d[_0x486a('0x4a')],'password':_0x35253d[_0x486a('0x4b')],'encryption':_0x486a('0x4c')},'application':_0x486a('0x4d')})}})[_0x486a('0x2a')](function(_0x52dea4){var _0x31f746=_0x52dea4;if(_0x31f746['id']){def[_0x486a('0x4e')]=_0x31f746['id'];return BPromise['resolve'](_0x31f746);}else{throw new Error(util[_0x486a('0x22')](_0x486a('0x4f'),_0x35253d['id']));}});}function setRelationship(_0x384220,_0x1581de,_0x16972c,_0x4d31ef){return request({'form':{'method':_0x486a('0x50'),'input_type':_0x486a('0x1f'),'response_type':_0x486a('0x1f'),'rest_data':JSON[_0x486a('0x20')]({'session':_0x384220['id'],'module_name':_0x486a('0x21'),'module_id':_0x16972c['id'],'link_field_name':_0x4d31ef,'related_ids':[_0x1581de['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x486a('0x51')]=function(_0x11ca62,_0x3db654,_0x2c3339,_0x5aa333,_0xaf89b0,_0xbe4c2f){var _0x501897,_0x4bb0cc,_0x311d35,_0x40995c;_0xbe4c2f['remoteUri']=intUtil[_0x486a('0x52')](_0xbe4c2f[_0x486a('0x53')]);_0xbe4c2f['serverUrl']=intUtil['stripTrailingSlash'](_0xbe4c2f[_0x486a('0x54')]);def[_0x486a('0x55')]=util[_0x486a('0x22')]('%s/service/v4_1/rest.php',_0xbe4c2f[_0x486a('0x53')]);if(_0xaf89b0&&_0xaf89b0[_0x486a('0x56')]){logger[_0x486a('0xb')](_0x486a('0x57'),_0x486a('0x58'));_0x3db654['recordingURL']=util['format'](_0x486a('0x59'),_0xbe4c2f[_0x486a('0x54')],_0x3db654[_0x486a('0x5a')],md5(_0x3db654['uniqueid']));}else{_0x3db654['recordingURL']='';}return getConnection(_0xbe4c2f)[_0x486a('0x2a')](function(_0x374d9d){_0x40995c=_0x374d9d;return getUser(_0xbe4c2f,_0x5aa333[_0x486a('0x19')],_0x40995c);})['then'](function(_0x1a9730){_0x501897=_0x1a9730;logger[_0x486a('0xb')](_0x486a('0x5b'),_0x501897['id']);return getEndUser(_0xbe4c2f,_0x3db654['calleridname'],_0x3db654[_0x486a('0x5c')],_0x40995c);})[_0x486a('0x2a')](function(_0x4a84dd){_0x4bb0cc=_0x4a84dd;logger[_0x486a('0xb')](_0x486a('0x5d'),_0x4bb0cc['id']);return getTicket(_0xbe4c2f,_0x501897,_0x4bb0cc,_0x2c3339,_0x3db654,_0x2c3339['Fields'],_0x40995c,_0x486a('0x5e'));})['then'](function(_0x1e8e2a){_0x311d35=_0x1e8e2a;logger[_0x486a('0xb')](_0x486a('0x5f'));logger[_0x486a('0xb')](_0x486a('0x60'),_0x311d35['id']);return setRelationship(_0x40995c,_0x501897,_0x311d35,_0x486a('0x61'));})[_0x486a('0x2a')](function(){return setRelationship(_0x40995c,_0x4bb0cc,_0x311d35,'contacts');})[_0x486a('0x2a')](function(){return getServerInfo(_0x40995c);})[_0x486a('0x2a')](function(_0x23685c){var _0x2de0e2=parseInt(_0x23685c[_0x486a('0x62')][_0x486a('0x63')](0x0));var _0x12174d=util[_0x486a('0x22')](_0x486a('0x64'),_0xbe4c2f[_0x486a('0x53')],_0x311d35['id']);if(_0x2de0e2>0x6){_0x12174d=util[_0x486a('0x22')](_0x486a('0x65'),_0xbe4c2f[_0x486a('0x53')],_0x311d35['id']);}logger['info'](_0x486a('0x57'),_0x486a('0x66'));emit(util['format']('user:%s',_0x5aa333[_0x486a('0x19')]),_0x486a('0x67'),{'uri':_0x12174d});})[_0x486a('0x68')](function(_0x196d47){logger[_0x486a('0x69')](_0x486a('0x57'),JSON['stringify'](_0x196d47));});};exports['outbound']=function(_0xf8332,_0x4a2774,_0x3a58e5,_0x6f6081,_0x3ce2fc,_0x4a80c3,_0x160ddf){var _0x32d87d,_0x43a0e2,_0xae4034,_0x54d7c6;_0x4a80c3[_0x486a('0x53')]=intUtil[_0x486a('0x52')](_0x4a80c3['remoteUri']);_0x4a80c3[_0x486a('0x54')]=intUtil[_0x486a('0x52')](_0x4a80c3[_0x486a('0x54')]);def[_0x486a('0x55')]=util[_0x486a('0x22')](_0x486a('0x6a'),_0x4a80c3[_0x486a('0x53')]);if(_0x160ddf&&_0x160ddf[_0x486a('0x6b')]&&_0x160ddf[_0x486a('0x6b')]!==_0x486a('0x6c')){logger[_0x486a('0xb')](_0x486a('0x6d'),'Recording\x20is\x20enabled!');_0x4a2774[_0x486a('0x6e')]=util[_0x486a('0x22')](_0x486a('0x59'),_0x4a80c3[_0x486a('0x54')],_0x4a2774[_0x486a('0x5a')],md5(_0x4a2774[_0x486a('0x5a')]));}return getConnection(_0x4a80c3)[_0x486a('0x2a')](function(_0x1bbb48){_0x54d7c6=_0x1bbb48;return getUser(_0x4a80c3,_0x6f6081[_0x486a('0x19')],_0x54d7c6);})[_0x486a('0x2a')](function(_0x2bb452){_0x32d87d=_0x2bb452;logger[_0x486a('0xb')]('The\x20User\x20ID\x20is:',_0x32d87d['id']);return getEndUser(_0x4a80c3,_0x4a2774[_0x486a('0x6f')],_0x4a2774['destcalleridnum'],_0x54d7c6);})[_0x486a('0x2a')](function(_0x11f29e){_0x43a0e2=_0x11f29e;logger[_0x486a('0xb')](_0x486a('0x5d'),_0x43a0e2['id']);return getTicket(_0x4a80c3,_0x32d87d,_0x43a0e2,_0x3a58e5,_0x4a2774,_0x3a58e5[_0x486a('0x70')],_0x54d7c6,_0x486a('0x71'));})[_0x486a('0x2a')](function(_0x7cc310){_0xae4034=_0x7cc310;logger[_0x486a('0xb')](_0x486a('0x5f'));logger[_0x486a('0xb')](_0x486a('0x60'),_0xae4034['id']);return setRelationship(_0x54d7c6,_0x32d87d,_0xae4034,_0x486a('0x61'));})[_0x486a('0x2a')](function(){return setRelationship(_0x54d7c6,_0x43a0e2,_0xae4034,_0x486a('0x72'));})[_0x486a('0x2a')](function(){return getServerInfo(_0x54d7c6);})[_0x486a('0x2a')](function(_0x27fe60){var _0x4adaf7=parseInt(_0x27fe60[_0x486a('0x62')][_0x486a('0x63')](0x0));var _0x38661=util[_0x486a('0x22')](_0x486a('0x64'),_0x4a80c3['remoteUri'],_0xae4034['id']);if(_0x4adaf7>0x6){_0x38661=util[_0x486a('0x22')](_0x486a('0x65'),_0x4a80c3['remoteUri'],_0xae4034['id']);}logger['info'](_0x486a('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x486a('0x22')](_0x486a('0x73'),_0x6f6081[_0x486a('0x19')]),_0x486a('0x67'),{'uri':_0x38661});})[_0x486a('0x68')](function(_0x29745a){logger['error'](_0x486a('0x6d'),JSON[_0x486a('0x20')](_0x29745a));});};exports[_0x486a('0x74')]=function(_0x25dfd3,_0x586584,_0x921a1f,_0x24209d,_0x3cca3a,_0x37a814){var _0x493510,_0x62a6f,_0x3c3eae,_0x4e5eea;_0x37a814[_0x486a('0x53')]=intUtil[_0x486a('0x52')](_0x37a814['remoteUri']);_0x37a814[_0x486a('0x54')]=intUtil[_0x486a('0x52')](_0x37a814[_0x486a('0x54')]);def['uri']=util[_0x486a('0x22')]('%s/service/v4_1/rest.php',_0x37a814['remoteUri']);if(_0x3cca3a&&_0x3cca3a[_0x486a('0x56')]){logger[_0x486a('0xb')]('['+_0x586584[_0x486a('0x75')][_0x486a('0x76')]()+']',_0x486a('0x58'));_0x586584[_0x486a('0x6e')]=util[_0x486a('0x22')](_0x486a('0x59'),_0x37a814['serverUrl'],_0x586584[_0x486a('0x5a')],md5(_0x586584[_0x486a('0x5a')]));}else{_0x586584[_0x486a('0x6e')]='';}return getConnection(_0x37a814)['then'](function(_0x1eb4de){_0x4e5eea=_0x1eb4de;if(!_['isNil'](_0x24209d)){return getUser(_0x37a814,_0x24209d['name'],_0x4e5eea);}else{return getUser(_0x37a814,null,_0x4e5eea);}})[_0x486a('0x2a')](function(_0x1b14cb){_0x493510=_0x1b14cb;logger[_0x486a('0xb')](_0x486a('0x5b'),_0x493510['id']);return getEndUser(_0x37a814,_0x586584['calleridname'],_0x586584[_0x486a('0x5c')],_0x4e5eea);})['then'](function(_0x58c6cd){_0x62a6f=_0x58c6cd;logger['info'](_0x486a('0x5d'),_0x62a6f['id']);return getTicket(_0x37a814,_0x493510,_0x62a6f,_0x921a1f,_0x586584,_0x921a1f[_0x486a('0x70')],_0x4e5eea,_0x486a('0x5e'));})[_0x486a('0x2a')](function(_0x24d116){_0x3c3eae=_0x24d116;logger[_0x486a('0xb')](_0x486a('0x5f'));logger[_0x486a('0xb')](_0x486a('0x60'),_0x3c3eae['id']);return setRelationship(_0x4e5eea,_0x493510,_0x3c3eae,_0x486a('0x61'));})['then'](function(){return setRelationship(_0x4e5eea,_0x62a6f,_0x3c3eae,_0x486a('0x72'));})['then'](function(){return getServerInfo(_0x4e5eea);})[_0x486a('0x68')](function(_0xcafc60){logger[_0x486a('0x69')]('['+_0x586584['lastevent']['toUpperCase']()+']',JSON[_0x486a('0x20')](_0xcafc60));});}; \ No newline at end of file +var _0x5481=['POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20Enduser\x20ID\x20is:','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','error','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridname','Fields','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by','description','Descriptions','slice','replace','duration_minutes','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','resolve','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','then','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','nameField','customField','content','string','variable','customVariable','Variable'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x5481,0x19d));var _0x1548=function(_0x46ac04,_0x2e6b08){_0x46ac04=_0x46ac04-0x0;var _0x3190eb=_0x5481[_0x46ac04];return _0x3190eb;};'use strict';var _=require(_0x1548('0x0'));var rp=require(_0x1548('0x1'));var BPromise=require(_0x1548('0x2'));var md5=require(_0x1548('0x3'));var util=require(_0x1548('0x4'));var Redis=require(_0x1548('0x5'));var intUtil=require(_0x1548('0x6'));var config=require(_0x1548('0x7'));var logger=require(_0x1548('0x8'))(_0x1548('0x9'));config[_0x1548('0xa')]=_[_0x1548('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1548('0xc'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x20e774,_0x1ed1ac,_0x56c491){io['to'](_0x20e774)[_0x1548('0xd')](_0x1ed1ac,_0x56c491);}function getTicket(_0x5c3228,_0x2ab173,_0x5dc7f9,_0x558849,_0x158399,_0x1e1f5e,_0x1e35a1,_0x2c1277){logger[_0x1548('0xe')](_0x1548('0xf'));var _0xd35de8=new Date();var _0xc9cb93=[{'name':'name','value':intUtil[_0x1548('0x10')](_0x558849['Subjects'],_0x158399,'\x20')},{'name':_0x1548('0x11'),'value':_0x2ab173['id']},{'name':_0x1548('0x12'),'value':_0x2ab173['id']},{'name':_0x1548('0x13'),'value':intUtil[_0x1548('0x10')](_0x558849[_0x1548('0x14')],_0x158399,'\x0a')},{'name':'date_start','value':_0xd35de8['toISOString']()[_0x1548('0x15')](0x0,0x13)[_0x1548('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x1548('0x17'),'value':'15'},{'name':_0x1548('0x18'),'value':_0x5dc7f9['id']},{'name':_0x1548('0x19'),'value':_0x1548('0x1a')},{'name':'parent_name','value':_0x5dc7f9[_0x1548('0x1b')]},{'name':_0x1548('0x1c'),'value':_0x2c1277}];if(_0x1e1f5e[_0x1548('0x1d')]){_[_0x1548('0x1e')](_0x1e1f5e,function(_0x274d70){if(_0x158399[_0x274d70[_0x1548('0x1f')]]){_0xc9cb93[_0x1548('0x20')]({'name':_0x274d70[_0x1548('0x21')],'value':_0x158399[_0x274d70[_0x1548('0x1f')]]});}});}return request({'form':{'method':_0x1548('0x22'),'input_type':_0x1548('0x23'),'response_type':_0x1548('0x23'),'rest_data':JSON[_0x1548('0x24')]({'session':_0x1e35a1['id'],'module_name':_0x1548('0x25'),'name_value_list':_0xc9cb93})}});}function getAuth(_0x162fda){return util[_0x1548('0x26')](_0x1548('0x27'),new Buffer(_0x162fda[_0x1548('0x28')]+':X')[_0x1548('0x29')](_0x1548('0x2a')));}function getServerInfo(_0x274557){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x1548('0x23'),'rest_data':JSON['stringify']({'session':_0x274557['id']})}});}function getUser(_0xaf6fff,_0x33573e,_0x249b69){if(!_[_0x1548('0x2b')](_0x33573e)){logger[_0x1548('0xe')](_0x1548('0x2c'),_0x33573e);return request({'form':{'method':_0x1548('0x2d'),'input_type':_0x1548('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x249b69['id'],'module_name':_0x1548('0x2e'),'query':util[_0x1548('0x26')](_0x1548('0x2f'),_0x33573e),'order_by':'','offset':'0','select_fields':['id','name',_0x1548('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4837db){if(_0x4837db[_0x1548('0x31')]['length']){var _0x375b89=_[_0x1548('0x32')](_0x4837db[_0x1548('0x31')],function(_0x4384f8){return _0x4384f8['name_value_list'][_0x1548('0x30')]['value']===_0x33573e;});if(_0x375b89){logger['info']('Agent\x20found!');return BPromise[_0x1548('0x33')]({'id':_0x375b89[_0x1548('0x34')]['id'][_0x1548('0x35')],'name':_0x375b89[_0x1548('0x34')][_0x1548('0x1b')]['value']});}}logger['info'](_0x1548('0x36'));return BPromise[_0x1548('0x33')]({'id':_0x249b69[_0x1548('0x34')][_0x1548('0x37')][_0x1548('0x35')],'name':_0x249b69[_0x1548('0x34')]['user_name']['value']});});}else{logger[_0x1548('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1548('0x33')]({'id':_0x249b69[_0x1548('0x34')][_0x1548('0x37')]['value'],'name':_0x249b69[_0x1548('0x34')][_0x1548('0x30')]['value']});}}function getEndUser(_0xe608c2,_0x2efc8c,_0x3e8f91,_0x50a625){logger[_0x1548('0xe')]('Searching\x20enduser\x20with\x20phone',_0x3e8f91);return request({'form':{'method':_0x1548('0x2d'),'input_type':_0x1548('0x23'),'response_type':_0x1548('0x23'),'rest_data':JSON[_0x1548('0x24')]({'session':_0x50a625['id'],'module_name':'Contacts','query':util[_0x1548('0x26')](_0x1548('0x38'),_0x3e8f91),'order_by':'','offset':'0','select_fields':['id',_0x1548('0x1b'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1548('0x39')](function(_0x53fd83){if(_0x53fd83['entry_list']['length']){var _0x42b02b=_[_0x1548('0x32')](_0x53fd83[_0x1548('0x31')],function(_0x2d9bd6){return _0x2d9bd6['name_value_list'][_0x1548('0x3a')][_0x1548('0x35')]===_0x3e8f91;});if(_0x42b02b){logger[_0x1548('0xe')](_0x1548('0x3b'));return BPromise[_0x1548('0x33')]({'id':_0x42b02b['name_value_list']['id'][_0x1548('0x35')],'name':_0x42b02b[_0x1548('0x34')][_0x1548('0x1b')][_0x1548('0x35')],'phone':_0x42b02b[_0x1548('0x34')][_0x1548('0x3a')][_0x1548('0x35')]});}}else{logger[_0x1548('0xe')](_0x1548('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x1548('0x23'),'response_type':'JSON','rest_data':JSON[_0x1548('0x24')]({'session':_0x50a625['id'],'module_name':_0x1548('0x1a'),'name_value_list':[{'name':'first_name','value':_0x2efc8c!==_0x1548('0x3d')?_0x2efc8c:util['format'](_0x1548('0x3e'),_0x3e8f91)},{'name':_0x1548('0x3a'),'value':_0x3e8f91}]})}})[_0x1548('0x39')](function(_0x27633b){logger[_0x1548('0xe')](_0x1548('0x3f'));return BPromise['resolve']({'id':_0x27633b['id'],'name':_0x27633b['entry_list']['first_name']['value'],'phone':_0x27633b['entry_list'][_0x1548('0x3a')][_0x1548('0x35')]});});}});}function request(_0x5ff782){logger[_0x1548('0x40')](_0x1548('0x41'),JSON['stringify'](_0x5ff782));return rp(_[_0x1548('0x42')](def,_0x5ff782));}function getTags(_0x57e23b,_0x5606e4){var _0x2767a0=[];if(_0x57e23b&&_0x57e23b[_0x1548('0x1d')]>0x0){_0x2767a0=_['map'](_0x57e23b,_0x5606e4);}return _0x2767a0;}function getCustomFields(_0x1c49c5,_0x45a74f){var _0x9e11ab=[];var _0x24f279={'custom_fields':[]};if(_0x1c49c5[_0x1548('0x1d')]>0x0){_[_0x1548('0x1e')](_0x1c49c5,function(_0x19e5c4){if(_0x19e5c4[_0x1548('0x43')]==='string'&&_0x19e5c4[_0x1548('0x44')]&&!_0x19e5c4[_0x1548('0x45')]){_0x24f279[_0x19e5c4['nameField']['toLowerCase']()]=_0x19e5c4[_0x1548('0x46')]['toString']();}else if(_0x19e5c4[_0x1548('0x43')]===_0x1548('0x47')&&_0x19e5c4[_0x1548('0x21')]&&_0x19e5c4[_0x1548('0x45')]){_0x24f279['custom_fields'][_0x1548('0x20')]({'id':_0x19e5c4['idField'],'value':_0x19e5c4[_0x1548('0x46')][_0x1548('0x29')]()});}else if(_0x19e5c4[_0x1548('0x43')]===_0x1548('0x48')&&_0x19e5c4[_0x1548('0x1f')]&&_0x19e5c4['idField']&&_0x19e5c4[_0x1548('0x45')]){_0x45a74f[_0x19e5c4['variableName']]&&_0x24f279['custom_fields'][_0x1548('0x20')]({'id':_0x19e5c4[_0x1548('0x21')],'value':_0x45a74f[_0x19e5c4[_0x1548('0x1f')]][_0x1548('0x29')]()});}else if(_0x19e5c4[_0x1548('0x43')]===_0x1548('0x49')&&_0x19e5c4[_0x1548('0x4a')]&&_0x19e5c4[_0x1548('0x4a')][_0x1548('0x1b')]&&_0x19e5c4[_0x1548('0x21')]&&_0x19e5c4[_0x1548('0x45')]){_0x45a74f[_0x19e5c4[_0x1548('0x4a')][_0x1548('0x1b')]['toLowerCase']()]&&_0x24f279['custom_fields'][_0x1548('0x20')]({'id':_0x19e5c4[_0x1548('0x21')],'value':_0x45a74f[_0x19e5c4[_0x1548('0x4a')][_0x1548('0x1b')]['toLowerCase']()][_0x1548('0x29')]()});}});}return _0x24f279;}function getConnection(_0xa876f6){return request({'method':_0x1548('0x4b'),'form':{'method':_0x1548('0x4c'),'input_type':_0x1548('0x23'),'response_type':_0x1548('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xa876f6[_0x1548('0x4d')],'password':_0xa876f6[_0x1548('0x4e')],'encryption':_0x1548('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x1548('0x39')](function(_0x46ccf2){var _0x551687=_0x46ccf2;if(_0x551687['id']){def[_0x1548('0x50')]=_0x551687['id'];return BPromise[_0x1548('0x33')](_0x551687);}else{throw new Error(util[_0x1548('0x26')](_0x1548('0x51'),_0xa876f6['id']));}});}function setRelationship(_0x7393c1,_0x4f42a,_0x3af588,_0x24eba6){return request({'form':{'method':_0x1548('0x52'),'input_type':_0x1548('0x23'),'response_type':_0x1548('0x23'),'rest_data':JSON['stringify']({'session':_0x7393c1['id'],'module_name':_0x1548('0x25'),'module_id':_0x3af588['id'],'link_field_name':_0x24eba6,'related_ids':[_0x4f42a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1548('0x53')]=function(_0xfefa67,_0x56228f,_0x31914e,_0x5751e2,_0x7a431a,_0x55b68b){var _0x1f73af,_0x560dde,_0xedf445,_0x35bef8;_0x55b68b[_0x1548('0x54')]=intUtil[_0x1548('0x55')](_0x55b68b['remoteUri']);_0x55b68b[_0x1548('0x56')]=intUtil['stripTrailingSlash'](_0x55b68b[_0x1548('0x56')]);def[_0x1548('0x57')]=util['format'](_0x1548('0x58'),_0x55b68b[_0x1548('0x54')]);if(_0x7a431a&&_0x7a431a[_0x1548('0x59')]){logger[_0x1548('0xe')](_0x1548('0x5a'),'Recording\x20is\x20enabled!');_0x56228f['recordingURL']=util[_0x1548('0x26')](_0x1548('0x5b'),_0x55b68b[_0x1548('0x56')],_0x56228f[_0x1548('0x5c')],md5(_0x56228f[_0x1548('0x5c')]));}else{_0x56228f[_0x1548('0x5d')]='';}return getConnection(_0x55b68b)[_0x1548('0x39')](function(_0x5a9433){_0x35bef8=_0x5a9433;return getUser(_0x55b68b,_0x5751e2[_0x1548('0x1b')],_0x35bef8);})[_0x1548('0x39')](function(_0x54bbd1){_0x1f73af=_0x54bbd1;logger[_0x1548('0xe')]('The\x20User\x20ID\x20is:',_0x1f73af['id']);return getEndUser(_0x55b68b,_0x56228f['calleridname'],_0x56228f['calleridnum'],_0x35bef8);})['then'](function(_0x3f9473){_0x560dde=_0x3f9473;logger['info'](_0x1548('0x5e'),_0x560dde['id']);return getTicket(_0x55b68b,_0x1f73af,_0x560dde,_0x31914e,_0x56228f,_0x31914e['Fields'],_0x35bef8,'Inbound');})['then'](function(_0x2be968){_0xedf445=_0x2be968;logger['info']('Ticket\x20created!');logger[_0x1548('0xe')]('The\x20Ticket\x20ID\x20is:',_0xedf445['id']);return setRelationship(_0x35bef8,_0x1f73af,_0xedf445,_0x1548('0x5f'));})[_0x1548('0x39')](function(){return setRelationship(_0x35bef8,_0x560dde,_0xedf445,_0x1548('0x60'));})[_0x1548('0x39')](function(){return getServerInfo(_0x35bef8);})['then'](function(_0x4f3b37){var _0x5cad5a=parseInt(_0x4f3b37['version'][_0x1548('0x61')](0x0));var _0x4c13c6=util[_0x1548('0x26')](_0x1548('0x62'),_0x55b68b[_0x1548('0x54')],_0xedf445['id']);if(_0x5cad5a>0x6){_0x4c13c6=util[_0x1548('0x26')](_0x1548('0x63'),_0x55b68b['remoteUri'],_0xedf445['id']);}logger[_0x1548('0xe')](_0x1548('0x5a'),_0x1548('0x64'));emit(util[_0x1548('0x26')](_0x1548('0x65'),_0x5751e2['name']),_0x1548('0x66'),{'uri':_0x4c13c6});})[_0x1548('0x67')](function(_0x15f80a){logger['error'](_0x1548('0x5a'),JSON[_0x1548('0x24')](_0x15f80a));});};exports[_0x1548('0x68')]=function(_0x1ad407,_0x3eb9ca,_0x52caf7,_0x2a22a4,_0x2a8ff9,_0x14dab6,_0x121e74){var _0x140cac,_0x395d33,_0x3a7ae9,_0x5031cc;_0x14dab6[_0x1548('0x54')]=intUtil['stripTrailingSlash'](_0x14dab6['remoteUri']);_0x14dab6[_0x1548('0x56')]=intUtil[_0x1548('0x55')](_0x14dab6[_0x1548('0x56')]);def[_0x1548('0x57')]=util[_0x1548('0x26')]('%s/service/v4_1/rest.php',_0x14dab6[_0x1548('0x54')]);if(_0x121e74&&_0x121e74[_0x1548('0x69')]&&_0x121e74['recordingFormat']!==_0x1548('0x6a')){logger[_0x1548('0xe')](_0x1548('0x6b'),'Recording\x20is\x20enabled!');_0x3eb9ca['recordingURL']=util[_0x1548('0x26')](_0x1548('0x5b'),_0x14dab6[_0x1548('0x56')],_0x3eb9ca[_0x1548('0x5c')],md5(_0x3eb9ca[_0x1548('0x5c')]));}return getConnection(_0x14dab6)[_0x1548('0x39')](function(_0x485908){_0x5031cc=_0x485908;return getUser(_0x14dab6,_0x2a22a4['name'],_0x5031cc);})[_0x1548('0x39')](function(_0x5bed9b){_0x140cac=_0x5bed9b;logger[_0x1548('0xe')](_0x1548('0x6c'),_0x140cac['id']);return getEndUser(_0x14dab6,_0x3eb9ca[_0x1548('0x6d')],_0x3eb9ca[_0x1548('0x6e')],_0x5031cc);})[_0x1548('0x39')](function(_0x304e96){_0x395d33=_0x304e96;logger[_0x1548('0xe')]('The\x20Enduser\x20ID\x20is:',_0x395d33['id']);return getTicket(_0x14dab6,_0x140cac,_0x395d33,_0x52caf7,_0x3eb9ca,_0x52caf7['Fields'],_0x5031cc,_0x1548('0x6f'));})[_0x1548('0x39')](function(_0x330463){_0x3a7ae9=_0x330463;logger['info'](_0x1548('0x70'));logger['info'](_0x1548('0x71'),_0x3a7ae9['id']);return setRelationship(_0x5031cc,_0x140cac,_0x3a7ae9,_0x1548('0x5f'));})[_0x1548('0x39')](function(){return setRelationship(_0x5031cc,_0x395d33,_0x3a7ae9,_0x1548('0x60'));})[_0x1548('0x39')](function(){return getServerInfo(_0x5031cc);})[_0x1548('0x39')](function(_0x3de52f){var _0xa39a0f=parseInt(_0x3de52f[_0x1548('0x72')][_0x1548('0x61')](0x0));var _0x252e4d=util[_0x1548('0x26')](_0x1548('0x62'),_0x14dab6['remoteUri'],_0x3a7ae9['id']);if(_0xa39a0f>0x6){_0x252e4d=util[_0x1548('0x26')](_0x1548('0x63'),_0x14dab6['remoteUri'],_0x3a7ae9['id']);}logger[_0x1548('0xe')](_0x1548('0x6b'),_0x1548('0x64'));emit(util[_0x1548('0x26')](_0x1548('0x65'),_0x2a22a4[_0x1548('0x1b')]),_0x1548('0x66'),{'uri':_0x252e4d});})[_0x1548('0x67')](function(_0x326d0e){logger[_0x1548('0x73')](_0x1548('0x6b'),JSON[_0x1548('0x24')](_0x326d0e));});};exports[_0x1548('0x74')]=function(_0x467509,_0x305efa,_0x42d786,_0x5b2989,_0x16b7c2,_0x293e09){var _0x57e36d,_0x3f2748,_0x2107b4,_0xcd7306;_0x293e09[_0x1548('0x54')]=intUtil[_0x1548('0x55')](_0x293e09[_0x1548('0x54')]);_0x293e09[_0x1548('0x56')]=intUtil['stripTrailingSlash'](_0x293e09['serverUrl']);def[_0x1548('0x57')]=util['format'](_0x1548('0x58'),_0x293e09['remoteUri']);if(_0x16b7c2&&_0x16b7c2[_0x1548('0x59')]){logger['info']('['+_0x305efa[_0x1548('0x75')][_0x1548('0x76')]()+']',_0x1548('0x77'));_0x305efa[_0x1548('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x293e09[_0x1548('0x56')],_0x305efa['uniqueid'],md5(_0x305efa[_0x1548('0x5c')]));}else{_0x305efa['recordingURL']='';}return getConnection(_0x293e09)['then'](function(_0x505d7c){_0xcd7306=_0x505d7c;if(!_['isNil'](_0x5b2989)){return getUser(_0x293e09,_0x5b2989['name'],_0xcd7306);}else{return getUser(_0x293e09,null,_0xcd7306);}})['then'](function(_0x5111cc){_0x57e36d=_0x5111cc;logger[_0x1548('0xe')](_0x1548('0x6c'),_0x57e36d['id']);return getEndUser(_0x293e09,_0x305efa[_0x1548('0x78')],_0x305efa['calleridnum'],_0xcd7306);})[_0x1548('0x39')](function(_0xa549b2){_0x3f2748=_0xa549b2;logger['info'](_0x1548('0x5e'),_0x3f2748['id']);return getTicket(_0x293e09,_0x57e36d,_0x3f2748,_0x42d786,_0x305efa,_0x42d786[_0x1548('0x79')],_0xcd7306,'Inbound');})[_0x1548('0x39')](function(_0x3729b3){_0x2107b4=_0x3729b3;logger[_0x1548('0xe')](_0x1548('0x70'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2107b4['id']);return setRelationship(_0xcd7306,_0x57e36d,_0x2107b4,_0x1548('0x5f'));})[_0x1548('0x39')](function(){return setRelationship(_0xcd7306,_0x3f2748,_0x2107b4,_0x1548('0x60'));})[_0x1548('0x39')](function(){return getServerInfo(_0xcd7306);})[_0x1548('0x67')](function(_0x3d5414){logger[_0x1548('0x73')]('['+_0x305efa[_0x1548('0x75')]['toUpperCase']()+']',JSON[_0x1548('0x24')](_0x3d5414));});}; \ 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 8205cc3..9a5fc3c 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 _0x1c28=['customVariable','Variable','name','toLowerCase','key','format','%s:\x20%s','keyContent','keyType','variable','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','sortBy','length','type','string','push','content','variableName','toString'];(function(_0x329742,_0x2f5e88){var _0x1f8118=function(_0x16526b){while(--_0x16526b){_0x329742['push'](_0x329742['shift']());}};_0x1f8118(++_0x2f5e88);}(_0x1c28,0x97));var _0x81c2=function(_0x73b089,_0x373377){_0x73b089=_0x73b089-0x0;var _0x40db50=_0x1c28[_0x73b089];return _0x40db50;};'use strict';var _=require(_0x81c2('0x0'));var util=require(_0x81c2('0x1'));exports[_0x81c2('0x2')]=function(_0x14fb08,_0x2b08ae,_0x56b3ff){var _0x2aea56=[];if(_0x14fb08['length']>0x0){var _0x47ca74=_[_0x81c2('0x3')](_0x14fb08,['id']);for(var _0x43bc62=0x0;_0x43bc62<_0x47ca74[_0x81c2('0x4')];_0x43bc62++){var _0x32bad3=_0x47ca74[_0x43bc62];if(_0x32bad3[_0x81c2('0x5')]===_0x81c2('0x6')){_0x2aea56[_0x81c2('0x7')](_0x32bad3[_0x81c2('0x8')]);}else if(_0x32bad3[_0x81c2('0x5')]==='variable'&&_0x32bad3[_0x81c2('0x9')]){_0x2b08ae[_0x32bad3[_0x81c2('0x9')]]&&_0x2aea56['push'](_0x2b08ae[_0x32bad3[_0x81c2('0x9')]][_0x81c2('0xa')]());}else if(_0x32bad3[_0x81c2('0x5')]===_0x81c2('0xb')&&_0x32bad3[_0x81c2('0xc')]&&_0x32bad3[_0x81c2('0xc')][_0x81c2('0xd')]){_0x2b08ae[_0x32bad3[_0x81c2('0xc')][_0x81c2('0xd')][_0x81c2('0xe')]()]&&_0x2aea56[_0x81c2('0x7')](_0x2b08ae[_0x32bad3[_0x81c2('0xc')][_0x81c2('0xd')][_0x81c2('0xe')]()]['toString']());}else if(_0x32bad3[_0x81c2('0x5')]==='keyValue'){if(_0x32bad3['keyType']==='string'&&_0x32bad3[_0x81c2('0xf')]){_0x2aea56['push'](util[_0x81c2('0x10')](_0x81c2('0x11'),_0x32bad3['key'],_0x32bad3[_0x81c2('0x12')]));}else if(_0x32bad3[_0x81c2('0x13')]===_0x81c2('0x14')&&_0x32bad3[_0x81c2('0x9')]&&_0x32bad3[_0x81c2('0xf')]){_0x2b08ae[_0x32bad3[_0x81c2('0x9')]]&&_0x2aea56[_0x81c2('0x7')](util[_0x81c2('0x10')](_0x81c2('0x11'),_0x32bad3[_0x81c2('0xf')],_0x2b08ae[_0x32bad3[_0x81c2('0x9')]]));}else if(_0x32bad3[_0x81c2('0x13')]===_0x81c2('0xb')&&_0x32bad3['Variable']&&_0x32bad3[_0x81c2('0xc')]['name']&&_0x32bad3['key']){_0x2b08ae[_0x32bad3[_0x81c2('0xc')]['name'][_0x81c2('0xe')]()]&&_0x2aea56[_0x81c2('0x7')](util[_0x81c2('0x10')](_0x81c2('0x11'),_0x32bad3['key'],_0x2b08ae[_0x32bad3[_0x81c2('0xc')][_0x81c2('0xd')][_0x81c2('0xe')]()]));}}}}return _0x2aea56[_0x81c2('0x15')](_0x56b3ff);};exports[_0x81c2('0x16')]=function(_0xc01609){var _0x206b2d=_0xc01609['slice'](-0x1);if(_0x206b2d==='/'){_0xc01609=_0xc01609[_0x81c2('0x17')](0x0,_0xc01609[_0x81c2('0x18')](_0x206b2d));}return _0xc01609;};exports[_0x81c2('0x19')]=function(_0xddeb08){if(!_[_0x81c2('0x1a')](_0xddeb08)&&_0xddeb08!==''){var _0x364b22=/^(([^<>()\[\]\\.,;:\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 _0x364b22['test'](String(_0xddeb08)[_0x81c2('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xead4=['slice','substring','validateEmail','isNil','test','util','getString','length','sortBy','type','content','variable','variableName','toString','Variable','name','toLowerCase','push','string','format','%s:\x20%s','keyType','key','customVariable'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xead4,0x1e5));var _0x4ead=function(_0x27a954,_0x5ac46d){_0x27a954=_0x27a954-0x0;var _0x10c3a7=_0xead4[_0x27a954];return _0x10c3a7;};'use strict';var _=require('lodash');var util=require(_0x4ead('0x0'));exports[_0x4ead('0x1')]=function(_0x2af8f4,_0xbe397e,_0xdae177){var _0x353d0c=[];if(_0x2af8f4[_0x4ead('0x2')]>0x0){var _0x110313=_[_0x4ead('0x3')](_0x2af8f4,['id']);for(var _0x403a81=0x0;_0x403a81<_0x110313[_0x4ead('0x2')];_0x403a81++){var _0x2e2d1d=_0x110313[_0x403a81];if(_0x2e2d1d[_0x4ead('0x4')]==='string'){_0x353d0c['push'](_0x2e2d1d[_0x4ead('0x5')]);}else if(_0x2e2d1d[_0x4ead('0x4')]===_0x4ead('0x6')&&_0x2e2d1d[_0x4ead('0x7')]){_0xbe397e[_0x2e2d1d[_0x4ead('0x7')]]&&_0x353d0c['push'](_0xbe397e[_0x2e2d1d[_0x4ead('0x7')]][_0x4ead('0x8')]());}else if(_0x2e2d1d[_0x4ead('0x4')]==='customVariable'&&_0x2e2d1d[_0x4ead('0x9')]&&_0x2e2d1d['Variable'][_0x4ead('0xa')]){_0xbe397e[_0x2e2d1d[_0x4ead('0x9')][_0x4ead('0xa')][_0x4ead('0xb')]()]&&_0x353d0c[_0x4ead('0xc')](_0xbe397e[_0x2e2d1d[_0x4ead('0x9')][_0x4ead('0xa')]['toLowerCase']()][_0x4ead('0x8')]());}else if(_0x2e2d1d['type']==='keyValue'){if(_0x2e2d1d['keyType']===_0x4ead('0xd')&&_0x2e2d1d['key']){_0x353d0c['push'](util[_0x4ead('0xe')](_0x4ead('0xf'),_0x2e2d1d['key'],_0x2e2d1d['keyContent']));}else if(_0x2e2d1d[_0x4ead('0x10')]===_0x4ead('0x6')&&_0x2e2d1d[_0x4ead('0x7')]&&_0x2e2d1d[_0x4ead('0x11')]){_0xbe397e[_0x2e2d1d[_0x4ead('0x7')]]&&_0x353d0c[_0x4ead('0xc')](util[_0x4ead('0xe')](_0x4ead('0xf'),_0x2e2d1d['key'],_0xbe397e[_0x2e2d1d[_0x4ead('0x7')]]));}else if(_0x2e2d1d[_0x4ead('0x10')]===_0x4ead('0x12')&&_0x2e2d1d['Variable']&&_0x2e2d1d['Variable'][_0x4ead('0xa')]&&_0x2e2d1d[_0x4ead('0x11')]){_0xbe397e[_0x2e2d1d[_0x4ead('0x9')]['name'][_0x4ead('0xb')]()]&&_0x353d0c['push'](util[_0x4ead('0xe')]('%s:\x20%s',_0x2e2d1d[_0x4ead('0x11')],_0xbe397e[_0x2e2d1d['Variable'][_0x4ead('0xa')]['toLowerCase']()]));}}}}return _0x353d0c['join'](_0xdae177);};exports['stripTrailingSlash']=function(_0x44014c){var _0x29b221=_0x44014c[_0x4ead('0x13')](-0x1);if(_0x29b221==='/'){_0x44014c=_0x44014c[_0x4ead('0x14')](0x0,_0x44014c['lastIndexOf'](_0x29b221));}return _0x44014c;};exports[_0x4ead('0x15')]=function(_0x32ac5d){if(!_[_0x4ead('0x16')](_0x32ac5d)&&_0x32ac5d!==''){var _0x51ca4d=/^(([^<>()\[\]\\.,;:\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 _0x51ca4d[_0x4ead('0x17')](String(_0x32ac5d)['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 fd827f8..9f32d18 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x5be91f,_0x4d839b){var _0x1a536b=function(_0xde0995){while(--_0xde0995){_0x5be91f['push'](_0x5be91f['shift']());}};_0x1a536b(++_0x4d839b);}(_0x34e8,0x12c));var _0x834e=function(_0x39ba53,_0x37837d){_0x39ba53=_0x39ba53-0x0;var _0x1ea8ac=_0x34e8[_0x39ba53];return _0x1ea8ac;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','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','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');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 emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 c579fbb..dc12f10 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 _0xaaeb=['authType','%s:%s','username','token','%s/token:%s','toString','base64','[HTTP]','stringify','GET','map','includes','string','type','nameField','customField','content','picklist','custom_fields','push','idField','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','calleridname','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','find','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','then','Enduser\x20created.'];(function(_0xdacb65,_0x14527d){var _0x200b74=function(_0x3b9504){while(--_0x3b9504){_0xdacb65['push'](_0xdacb65['shift']());}};_0x200b74(++_0x14527d);}(_0xaaeb,0x1e6));var _0xbaae=function(_0x268396,_0x864c1c){_0x268396=_0x268396-0x0;var _0x2d7b5d=_0xaaeb[_0x268396];return _0x2d7b5d;};'use strict';var _=require(_0xbaae('0x0'));var rp=require(_0xbaae('0x1'));var md5=require(_0xbaae('0x2'));var util=require(_0xbaae('0x3'));var Redis=require(_0xbaae('0x4'));var intUtil=require(_0xbaae('0x5'));var config=require('../../../../config/environment');var logger=require(_0xbaae('0x6'))(_0xbaae('0x7'));config[_0xbaae('0x8')]=_[_0xbaae('0x9')](config[_0xbaae('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbaae('0x8')]));function emit(_0x1133ae,_0x1e4ce4,_0x145317){io['to'](_0x1133ae)['emit'](_0x1e4ce4,_0x145317);}var headers={'Content-Type':'application/json','Accept':_0xbaae('0xa')};function getTicket(_0x26d429,_0x2b26b8,_0x434334,_0x56ab56,_0x3d7b40){logger[_0xbaae('0xb')](_0xbaae('0xc'));return request({'uri':util[_0xbaae('0xd')](_0xbaae('0xe'),_0x26d429[_0xbaae('0xf')]),'method':_0xbaae('0x10'),'body':{'ticket':_[_0xbaae('0x11')]({'requester_id':_0x434334['id'],'submitter_id':_0x2b26b8?_0x2b26b8['id']:undefined,'assignee_id':_0x2b26b8?_0x2b26b8['id']:undefined,'tags':getTags(_0x56ab56[_0xbaae('0x12')],_0xbaae('0x13')),'subject':intUtil[_0xbaae('0x14')](_0x56ab56[_0xbaae('0x15')],_0x3d7b40,'\x20'),'description':intUtil[_0xbaae('0x14')](_0x56ab56[_0xbaae('0x16')],_0x3d7b40,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x56ab56[_0xbaae('0x16')],_0x3d7b40,'\x0a')}},getCustomFields(_0x56ab56['Fields'],_0x3d7b40))}})['then'](function(_0x419cd4){logger[_0xbaae('0xb')](_0xbaae('0x17'));return _0x419cd4[_0xbaae('0x18')];});}function getUser(_0x32affc,_0x15a66f){if(intUtil[_0xbaae('0x19')](_0x15a66f)){logger[_0xbaae('0xb')](_0xbaae('0x1a'),_0x15a66f);return request({'uri':util[_0xbaae('0xd')](_0xbaae('0x1b'),_0x32affc[_0xbaae('0xf')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x15a66f)}})['then'](function(_0x4c23b1){if(_0x4c23b1['count']){logger['info']('Agent\x20found!');return _[_0xbaae('0x1c')](_0x4c23b1[_0xbaae('0x1d')],{'email':_0x15a66f,'role':_0xbaae('0x1e')});}else{logger[_0xbaae('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xbaae('0xd')](_0xbaae('0x1f'),_0x32affc['remoteUri'])})['then'](function(_0x3efa9c){logger[_0xbaae('0xb')]('Admin\x20account\x20selected.');return _0x3efa9c[_0xbaae('0x20')];});}});}else{logger[_0xbaae('0xb')](_0xbaae('0x21'));return request({'uri':util['format'](_0xbaae('0x1f'),_0x32affc['remoteUri'])})['then'](function(_0x2ed39a){logger[_0xbaae('0xb')](_0xbaae('0x22'));return _0x2ed39a['user'];});}}function getEndUser(_0x658d6,_0x189619,_0x4fba07){logger[_0xbaae('0xb')]('Searching\x20enduser\x20with\x20phone',_0x4fba07);return request({'uri':util[_0xbaae('0xd')](_0xbaae('0x1b'),_0x658d6[_0xbaae('0xf')]),'qs':{'query':util[_0xbaae('0xd')](_0xbaae('0x23'),_0x4fba07)}})['then'](function(_0x2d582a){var _0x559404;if(_0x2d582a['results'][_0xbaae('0x24')]){_0x2d582a['results']=_['filter'](_0x2d582a[_0xbaae('0x1d')],{'suspended':![],'role':_0xbaae('0x25')});if(_0x2d582a['results']['length']){_0x559404=_[_0xbaae('0x26')](_0x2d582a[_0xbaae('0x1d')]);}}if(_0x559404){logger['info'](_0xbaae('0x27'));return _0x559404;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbaae('0xd')](_0xbaae('0x28'),_0x658d6[_0xbaae('0xf')]),'method':_0xbaae('0x10'),'body':{'user':{'role':'end-user','name':util[_0xbaae('0xd')](_0xbaae('0x29'),_0x189619||_0x4fba07),'phone':_0x4fba07}}})[_0xbaae('0x2a')](function(_0x695458){logger['info'](_0xbaae('0x2b'));return _0x695458[_0xbaae('0x20')];});}});}function getAuth(_0x553d4e){var _0x54a814;if(_0x553d4e[_0xbaae('0x2c')]==='password'){_0x54a814=util[_0xbaae('0xd')](_0xbaae('0x2d'),_0x553d4e[_0xbaae('0x2e')],_0x553d4e['password']);}else if(_0x553d4e['authType']===_0xbaae('0x2f')){_0x54a814=util[_0xbaae('0xd')](_0xbaae('0x30'),_0x553d4e['username'],_0x553d4e['token']);}return util[_0xbaae('0xd')]('Basic\x20%s',new Buffer(_0x54a814)[_0xbaae('0x31')](_0xbaae('0x32')));}function request(_0x1a5582){logger['debug'](_0xbaae('0x33'),JSON[_0xbaae('0x34')](_0x1a5582));return rp(_['defaults'](_0x1a5582,{'method':_0xbaae('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x1847e3,_0x505d1a){var _0x5be390=[];if(_0x1847e3&&_0x1847e3[_0xbaae('0x24')]>0x0){_0x5be390=_[_0xbaae('0x36')](_0x1847e3,_0x505d1a);}return _0x5be390;}function getCustomFields(_0x1e2869,_0x3a95f9){var _0x4fc853=[];var _0x10739e={'custom_fields':[]};if(_0x1e2869['length']>0x0){_['forEach'](_0x1e2869,function(_0x5c2061){if(_[_0xbaae('0x37')]([_0xbaae('0x38'),'picklist'],_0x5c2061[_0xbaae('0x39')])&&_0x5c2061[_0xbaae('0x3a')]&&!_0x5c2061[_0xbaae('0x3b')]){_0x10739e[_0x5c2061['nameField']['toLowerCase']()]=_0x5c2061[_0xbaae('0x3c')][_0xbaae('0x31')]();}else if(_[_0xbaae('0x37')]([_0xbaae('0x38'),_0xbaae('0x3d')],_0x5c2061['type'])&&_0x5c2061['idField']&&_0x5c2061['customField']){_0x10739e[_0xbaae('0x3e')][_0xbaae('0x3f')]({'id':_0x5c2061[_0xbaae('0x40')],'value':_0x5c2061[_0xbaae('0x3c')]['toString']()});}else if(_0x5c2061[_0xbaae('0x39')]==='variable'&&_0x5c2061[_0xbaae('0x41')]&&_0x5c2061[_0xbaae('0x40')]&&_0x5c2061[_0xbaae('0x3b')]){_0x3a95f9[_0x5c2061[_0xbaae('0x41')]]&&_0x10739e[_0xbaae('0x3e')][_0xbaae('0x3f')]({'id':_0x5c2061['idField'],'value':_0x3a95f9[_0x5c2061['variableName']][_0xbaae('0x31')]()});}else if(_0x5c2061[_0xbaae('0x39')]===_0xbaae('0x42')&&_0x5c2061[_0xbaae('0x43')]&&_0x5c2061[_0xbaae('0x43')][_0xbaae('0x13')]&&_0x5c2061['idField']&&_0x5c2061[_0xbaae('0x3b')]){_0x3a95f9[_0x5c2061[_0xbaae('0x43')][_0xbaae('0x13')][_0xbaae('0x44')]()]&&_0x10739e[_0xbaae('0x3e')][_0xbaae('0x3f')]({'id':_0x5c2061[_0xbaae('0x40')],'value':_0x3a95f9[_0x5c2061[_0xbaae('0x43')][_0xbaae('0x13')][_0xbaae('0x44')]()][_0xbaae('0x31')]()});}});}return _0x10739e;}exports['queue']=function(_0x107de1,_0x511190,_0x5b3373,_0x4ac0e5,_0x5c7de6,_0x3e4f8d){var _0x3f2973,_0x3fd9f3;_0x3e4f8d[_0xbaae('0xf')]=intUtil[_0xbaae('0x45')](_0x3e4f8d['remoteUri']);_0x3e4f8d[_0xbaae('0x46')]=intUtil[_0xbaae('0x45')](_0x3e4f8d[_0xbaae('0x46')]);if(_0x5c7de6&&_0x5c7de6['monitor_format']){logger[_0xbaae('0xb')](_0xbaae('0x47'),_0xbaae('0x48'));_0x511190[_0xbaae('0x49')]=util[_0xbaae('0xd')](_0xbaae('0x4a'),_0x3e4f8d[_0xbaae('0x46')],_0x511190[_0xbaae('0x4b')],md5(_0x511190[_0xbaae('0x4b')]));}else{_0x511190[_0xbaae('0x49')]='';}headers[_0xbaae('0x4c')]=getAuth(_0x3e4f8d);return getUser(_0x3e4f8d,_0x4ac0e5['email'])['then'](function(_0x2f2370){_0x3f2973=_0x2f2370;logger[_0xbaae('0xb')](_0xbaae('0x4d'),_0x3f2973['id']);return getEndUser(_0x3e4f8d,_0x511190['calleridname'],_0x511190['calleridnum']);})[_0xbaae('0x2a')](function(_0x357321){_0x3fd9f3=_0x357321;logger[_0xbaae('0xb')](_0xbaae('0x4e'),_0x3fd9f3['id']);return getTicket(_0x3e4f8d,_0x3f2973,_0x3fd9f3,_0x5b3373,_0x511190);})[_0xbaae('0x2a')](function(_0xf8ae93){if(_0xf8ae93){logger['info']('The\x20Ticket\x20ID\x20is:',_0xf8ae93['id']);switch(_0x3e4f8d['type']){case'integrationTab':logger['info'](_0xbaae('0x47'),_0xbaae('0x4f'));return request({'uri':util[_0xbaae('0xd')](_0xbaae('0x50'),_0x3e4f8d[_0xbaae('0xf')],_0x3f2973['id'],_0xf8ae93['id']),'method':_0xbaae('0x10')});case _0xbaae('0x51'):logger[_0xbaae('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbaae('0xd')](_0xbaae('0x52'),_0x4ac0e5[_0xbaae('0x13')]),_0xbaae('0x53'),{'uri':util['format'](_0xbaae('0x54'),_0x3e4f8d['remoteUri'][_0xbaae('0x55')](_0xbaae('0x56'),''),_0xf8ae93['id'])});break;default:logger[_0xbaae('0x57')](_0xbaae('0x47'),_0xbaae('0x58'));}}})[_0xbaae('0x59')](function(_0x27e1e4){logger[_0xbaae('0x57')](_0xbaae('0x5a'),util['inspect'](_0x27e1e4,{'showHidden':!![],'depth':null}));});};exports[_0xbaae('0x5b')]=function(_0x55cd2e,_0x168401,_0x306535,_0x454f02,_0x279ca6,_0x591f5c,_0x34145f){var _0x17c596,_0x300b96;_0x591f5c[_0xbaae('0xf')]=intUtil['stripTrailingSlash'](_0x591f5c[_0xbaae('0xf')]);_0x591f5c[_0xbaae('0x46')]=intUtil['stripTrailingSlash'](_0x591f5c['serverUrl']);if(_0x34145f&&_0x34145f[_0xbaae('0x5c')]&&_0x34145f[_0xbaae('0x5c')]!==_0xbaae('0x5d')){logger['info'](_0xbaae('0x5e'),_0xbaae('0x48'));_0x168401[_0xbaae('0x49')]=util[_0xbaae('0xd')](_0xbaae('0x4a'),_0x591f5c['serverUrl'],_0x168401['uniqueid'],md5(_0x168401[_0xbaae('0x4b')]));}headers['Authorization']=getAuth(_0x591f5c);return getUser(_0x591f5c,_0x454f02['email'])[_0xbaae('0x2a')](function(_0x36e52f){_0x17c596=_0x36e52f;logger[_0xbaae('0xb')](_0xbaae('0x4d'),_0x17c596['id']);return getEndUser(_0x591f5c,_0x168401[_0xbaae('0x5f')],_0x168401['destcalleridnum']);})[_0xbaae('0x2a')](function(_0x48cf15){_0x300b96=_0x48cf15;logger[_0xbaae('0xb')](_0xbaae('0x4e'),_0x300b96['id']);return getTicket(_0x591f5c,_0x17c596,_0x300b96,_0x306535,_0x168401);})[_0xbaae('0x2a')](function(_0x399592){if(_0x399592){logger['info'](_0xbaae('0x60'),_0x399592['id']);switch(_0x591f5c[_0xbaae('0x39')]){case'integrationTab':logger['info'](_0xbaae('0x5e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xbaae('0x50'),_0x591f5c[_0xbaae('0xf')],_0x17c596['id'],_0x399592['id']),'method':_0xbaae('0x10')});case'newTab':logger[_0xbaae('0xb')](_0xbaae('0x5e'),_0xbaae('0x61'));emit(util[_0xbaae('0xd')](_0xbaae('0x52'),_0x454f02[_0xbaae('0x13')]),_0xbaae('0x53'),{'uri':util[_0xbaae('0xd')](_0xbaae('0x54'),_0x591f5c[_0xbaae('0xf')][_0xbaae('0x55')](_0xbaae('0x56'),''),_0x399592['id'])});break;default:logger[_0xbaae('0x57')](_0xbaae('0x5e'),_0xbaae('0x58'));}}})['catch'](function(_0x3ffacf){logger[_0xbaae('0x57')](_0xbaae('0x62'),util[_0xbaae('0x63')](_0x3ffacf,{'showHidden':!![],'depth':null}));});};exports[_0xbaae('0x64')]=function(_0x21ddcb,_0xe91c5d,_0x51109c,_0x8083d0,_0x2b6c08,_0xcc14e5){var _0xac3c3,_0x2bd0d7;_0xcc14e5[_0xbaae('0xf')]=intUtil[_0xbaae('0x45')](_0xcc14e5[_0xbaae('0xf')]);_0xcc14e5['serverUrl']=intUtil[_0xbaae('0x45')](_0xcc14e5[_0xbaae('0x46')]);if(_0x2b6c08&&_0x2b6c08['monitor_format']){logger['info']('['+_0xe91c5d['lastevent'][_0xbaae('0x65')]()+']','Recording\x20is\x20enabled!');_0xe91c5d['recordingURL']=util[_0xbaae('0xd')](_0xbaae('0x4a'),_0xcc14e5[_0xbaae('0x46')],_0xe91c5d['uniqueid'],md5(_0xe91c5d[_0xbaae('0x4b')]));}else{_0xe91c5d[_0xbaae('0x49')]='';}headers['Authorization']=getAuth(_0xcc14e5);return getUser(_0xcc14e5)[_0xbaae('0x2a')](function(_0x6e36ef){_0xac3c3=_0x6e36ef;logger[_0xbaae('0xb')]('The\x20User\x20ID\x20is:',_0xac3c3['id']);return getEndUser(_0xcc14e5,_0xe91c5d[_0xbaae('0x66')],_0xe91c5d[_0xbaae('0x67')]);})[_0xbaae('0x2a')](function(_0x216fe3){_0x2bd0d7=_0x216fe3;logger[_0xbaae('0xb')](_0xbaae('0x4e'),_0x2bd0d7['id']);return getTicket(_0xcc14e5,_0xac3c3,_0x2bd0d7,_0x51109c,_0xe91c5d);})[_0xbaae('0x2a')](function(_0x174bf4){if(_0x174bf4){logger[_0xbaae('0xb')](_0xbaae('0x60'),_0x174bf4['id']);}})[_0xbaae('0x59')](function(_0x167ba2){logger[_0xbaae('0x57')]('['+_0xe91c5d[_0xbaae('0x68')][_0xbaae('0x65')]()+']'+_0xbaae('0x69'),util[_0xbaae('0x63')](_0x167ba2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6921=['forEach','includes','type','customField','nameField','toLowerCase','content','string','picklist','idField','custom_fields','push','variable','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','ioredis','./util','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','then','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','results','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','base64','stringify','map'];(function(_0x28d3ad,_0x3fe4f9){var _0x15d280=function(_0x394cc4){while(--_0x394cc4){_0x28d3ad['push'](_0x28d3ad['shift']());}};_0x15d280(++_0x3fe4f9);}(_0x6921,0x1d8));var _0x1692=function(_0x2b82c1,_0x2eac45){_0x2b82c1=_0x2b82c1-0x0;var _0x108999=_0x6921[_0x2b82c1];return _0x108999;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1692('0x0'));var util=require('util');var Redis=require(_0x1692('0x1'));var intUtil=require(_0x1692('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1692('0x3'));config[_0x1692('0x4')]=_[_0x1692('0x5')](config[_0x1692('0x4')],{'host':_0x1692('0x6'),'port':0x18eb});var io=require(_0x1692('0x7'))(new Redis(config[_0x1692('0x4')]));function emit(_0x265a0e,_0x427940,_0xffd34a){io['to'](_0x265a0e)['emit'](_0x427940,_0xffd34a);}var headers={'Content-Type':_0x1692('0x8'),'Accept':_0x1692('0x8')};function getTicket(_0x2d917c,_0x58d4ef,_0x4ad29e,_0x5d0e9f,_0xf647c5){logger[_0x1692('0x9')](_0x1692('0xa'));return request({'uri':util['format'](_0x1692('0xb'),_0x2d917c['remoteUri']),'method':_0x1692('0xc'),'body':{'ticket':_[_0x1692('0xd')]({'requester_id':_0x4ad29e['id'],'submitter_id':_0x58d4ef?_0x58d4ef['id']:undefined,'assignee_id':_0x58d4ef?_0x58d4ef['id']:undefined,'tags':getTags(_0x5d0e9f[_0x1692('0xe')],_0x1692('0xf')),'subject':intUtil['getString'](_0x5d0e9f[_0x1692('0x10')],_0xf647c5,'\x20'),'description':intUtil[_0x1692('0x11')](_0x5d0e9f['Descriptions'],_0xf647c5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1692('0x11')](_0x5d0e9f[_0x1692('0x12')],_0xf647c5,'\x0a')}},getCustomFields(_0x5d0e9f[_0x1692('0x13')],_0xf647c5))}})['then'](function(_0x47b7cd){logger[_0x1692('0x9')](_0x1692('0x14'));return _0x47b7cd[_0x1692('0x15')];});}function getUser(_0x256089,_0x51565e){if(intUtil['validateEmail'](_0x51565e)){logger[_0x1692('0x9')](_0x1692('0x16'),_0x51565e);return request({'uri':util['format'](_0x1692('0x17'),_0x256089['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x51565e)}})[_0x1692('0x18')](function(_0x12d125){if(_0x12d125[_0x1692('0x19')]){logger[_0x1692('0x9')]('Agent\x20found!');return _[_0x1692('0x1a')](_0x12d125['results'],{'email':_0x51565e,'role':_0x1692('0x1b')});}else{logger[_0x1692('0x9')](_0x1692('0x1c'));return request({'uri':util[_0x1692('0x1d')](_0x1692('0x1e'),_0x256089[_0x1692('0x1f')])})[_0x1692('0x18')](function(_0x547aaf){logger[_0x1692('0x9')]('Admin\x20account\x20selected.');return _0x547aaf['user'];});}});}else{logger[_0x1692('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1692('0x1d')]('%s/users/me.json',_0x256089[_0x1692('0x1f')])})[_0x1692('0x18')](function(_0x4df8b5){logger[_0x1692('0x9')](_0x1692('0x20'));return _0x4df8b5[_0x1692('0x21')];});}}function getEndUser(_0x34ba77,_0x549952,_0x472860){logger[_0x1692('0x9')](_0x1692('0x22'),_0x472860);return request({'uri':util[_0x1692('0x1d')](_0x1692('0x17'),_0x34ba77[_0x1692('0x1f')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x472860)}})[_0x1692('0x18')](function(_0x5d8f88){var _0x5a89ef;if(_0x5d8f88['results'][_0x1692('0x23')]){_0x5d8f88['results']=_[_0x1692('0x24')](_0x5d8f88['results'],{'suspended':![],'role':_0x1692('0x25')});if(_0x5d8f88['results'][_0x1692('0x23')]){_0x5a89ef=_[_0x1692('0x26')](_0x5d8f88[_0x1692('0x27')]);}}if(_0x5a89ef){logger[_0x1692('0x9')](_0x1692('0x28'));return _0x5a89ef;}else{logger[_0x1692('0x9')](_0x1692('0x29'));return request({'uri':util[_0x1692('0x1d')](_0x1692('0x2a'),_0x34ba77[_0x1692('0x1f')]),'method':_0x1692('0xc'),'body':{'user':{'role':_0x1692('0x25'),'name':util[_0x1692('0x1d')]('Caller\x20-\x20%s',_0x549952||_0x472860),'phone':_0x472860}}})[_0x1692('0x18')](function(_0x91fed4){logger[_0x1692('0x9')]('Enduser\x20created.');return _0x91fed4[_0x1692('0x21')];});}});}function getAuth(_0x54fa02){var _0x24072e;if(_0x54fa02[_0x1692('0x2b')]===_0x1692('0x2c')){_0x24072e=util['format'](_0x1692('0x2d'),_0x54fa02['username'],_0x54fa02['password']);}else if(_0x54fa02['authType']===_0x1692('0x2e')){_0x24072e=util[_0x1692('0x1d')](_0x1692('0x2f'),_0x54fa02['username'],_0x54fa02[_0x1692('0x2e')]);}return util['format'](_0x1692('0x30'),new Buffer(_0x24072e)[_0x1692('0x31')](_0x1692('0x32')));}function request(_0x5207f6){logger['debug']('[HTTP]',JSON[_0x1692('0x33')](_0x5207f6));return rp(_[_0x1692('0x5')](_0x5207f6,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1f3619,_0x4e5621){var _0x1bd362=[];if(_0x1f3619&&_0x1f3619[_0x1692('0x23')]>0x0){_0x1bd362=_[_0x1692('0x34')](_0x1f3619,_0x4e5621);}return _0x1bd362;}function getCustomFields(_0x4d7c80,_0x2676c3){var _0x125445=[];var _0x3a1e38={'custom_fields':[]};if(_0x4d7c80[_0x1692('0x23')]>0x0){_[_0x1692('0x35')](_0x4d7c80,function(_0x6515ea){if(_[_0x1692('0x36')](['string','picklist'],_0x6515ea[_0x1692('0x37')])&&_0x6515ea['nameField']&&!_0x6515ea[_0x1692('0x38')]){_0x3a1e38[_0x6515ea[_0x1692('0x39')][_0x1692('0x3a')]()]=_0x6515ea[_0x1692('0x3b')][_0x1692('0x31')]();}else if(_[_0x1692('0x36')]([_0x1692('0x3c'),_0x1692('0x3d')],_0x6515ea[_0x1692('0x37')])&&_0x6515ea[_0x1692('0x3e')]&&_0x6515ea[_0x1692('0x38')]){_0x3a1e38[_0x1692('0x3f')][_0x1692('0x40')]({'id':_0x6515ea[_0x1692('0x3e')],'value':_0x6515ea['content'][_0x1692('0x31')]()});}else if(_0x6515ea[_0x1692('0x37')]===_0x1692('0x41')&&_0x6515ea[_0x1692('0x42')]&&_0x6515ea[_0x1692('0x3e')]&&_0x6515ea[_0x1692('0x38')]){_0x2676c3[_0x6515ea['variableName']]&&_0x3a1e38[_0x1692('0x3f')][_0x1692('0x40')]({'id':_0x6515ea[_0x1692('0x3e')],'value':_0x2676c3[_0x6515ea[_0x1692('0x42')]][_0x1692('0x31')]()});}else if(_0x6515ea[_0x1692('0x37')]==='customVariable'&&_0x6515ea[_0x1692('0x43')]&&_0x6515ea['Variable']['name']&&_0x6515ea[_0x1692('0x3e')]&&_0x6515ea[_0x1692('0x38')]){_0x2676c3[_0x6515ea[_0x1692('0x43')][_0x1692('0xf')][_0x1692('0x3a')]()]&&_0x3a1e38[_0x1692('0x3f')][_0x1692('0x40')]({'id':_0x6515ea[_0x1692('0x3e')],'value':_0x2676c3[_0x6515ea[_0x1692('0x43')][_0x1692('0xf')][_0x1692('0x3a')]()][_0x1692('0x31')]()});}});}return _0x3a1e38;}exports['queue']=function(_0x229b25,_0x50b1bd,_0x22623f,_0x4bf023,_0x2cdaaf,_0x52cfc2){var _0xfed861,_0x39f16f;_0x52cfc2['remoteUri']=intUtil[_0x1692('0x44')](_0x52cfc2[_0x1692('0x1f')]);_0x52cfc2[_0x1692('0x45')]=intUtil[_0x1692('0x44')](_0x52cfc2[_0x1692('0x45')]);if(_0x2cdaaf&&_0x2cdaaf['monitor_format']){logger['info'](_0x1692('0x46'),_0x1692('0x47'));_0x50b1bd[_0x1692('0x48')]=util[_0x1692('0x1d')](_0x1692('0x49'),_0x52cfc2[_0x1692('0x45')],_0x50b1bd[_0x1692('0x4a')],md5(_0x50b1bd['uniqueid']));}else{_0x50b1bd[_0x1692('0x48')]='';}headers[_0x1692('0x4b')]=getAuth(_0x52cfc2);return getUser(_0x52cfc2,_0x4bf023[_0x1692('0x4c')])[_0x1692('0x18')](function(_0x9b480d){_0xfed861=_0x9b480d;logger[_0x1692('0x9')]('The\x20User\x20ID\x20is:',_0xfed861['id']);return getEndUser(_0x52cfc2,_0x50b1bd[_0x1692('0x4d')],_0x50b1bd[_0x1692('0x4e')]);})[_0x1692('0x18')](function(_0x593165){_0x39f16f=_0x593165;logger[_0x1692('0x9')](_0x1692('0x4f'),_0x39f16f['id']);return getTicket(_0x52cfc2,_0xfed861,_0x39f16f,_0x22623f,_0x50b1bd);})['then'](function(_0x29b279){if(_0x29b279){logger[_0x1692('0x9')]('The\x20Ticket\x20ID\x20is:',_0x29b279['id']);switch(_0x52cfc2['type']){case'integrationTab':logger[_0x1692('0x9')](_0x1692('0x46'),_0x1692('0x50'));return request({'uri':util['format'](_0x1692('0x51'),_0x52cfc2[_0x1692('0x1f')],_0xfed861['id'],_0x29b279['id']),'method':_0x1692('0xc')});case _0x1692('0x52'):logger['info'](_0x1692('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1692('0x1d')](_0x1692('0x53'),_0x4bf023[_0x1692('0xf')]),'trigger:browser:url',{'uri':util['format'](_0x1692('0x54'),_0x52cfc2[_0x1692('0x1f')][_0x1692('0x55')](_0x1692('0x56'),''),_0x29b279['id'])});break;default:logger[_0x1692('0x57')]('[QUEUE]',_0x1692('0x58'));}}})[_0x1692('0x59')](function(_0x177a55){logger[_0x1692('0x57')](_0x1692('0x5a'),util['inspect'](_0x177a55,{'showHidden':!![],'depth':null}));});};exports[_0x1692('0x5b')]=function(_0xa2cac7,_0x3a2a4b,_0x5a8ae4,_0x6edc50,_0x4031f4,_0x14cfdf,_0x246b87){var _0x898e83,_0x5d8922;_0x14cfdf[_0x1692('0x1f')]=intUtil['stripTrailingSlash'](_0x14cfdf[_0x1692('0x1f')]);_0x14cfdf[_0x1692('0x45')]=intUtil[_0x1692('0x44')](_0x14cfdf['serverUrl']);if(_0x246b87&&_0x246b87[_0x1692('0x5c')]&&_0x246b87[_0x1692('0x5c')]!==_0x1692('0x5d')){logger[_0x1692('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3a2a4b[_0x1692('0x48')]=util[_0x1692('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14cfdf['serverUrl'],_0x3a2a4b[_0x1692('0x4a')],md5(_0x3a2a4b[_0x1692('0x4a')]));}headers['Authorization']=getAuth(_0x14cfdf);return getUser(_0x14cfdf,_0x6edc50[_0x1692('0x4c')])['then'](function(_0x5eeb13){_0x898e83=_0x5eeb13;logger[_0x1692('0x9')]('The\x20User\x20ID\x20is:',_0x898e83['id']);return getEndUser(_0x14cfdf,_0x3a2a4b['destcalleridname'],_0x3a2a4b[_0x1692('0x5e')]);})[_0x1692('0x18')](function(_0x3bc448){_0x5d8922=_0x3bc448;logger[_0x1692('0x9')](_0x1692('0x4f'),_0x5d8922['id']);return getTicket(_0x14cfdf,_0x898e83,_0x5d8922,_0x5a8ae4,_0x3a2a4b);})[_0x1692('0x18')](function(_0x2d67fc){if(_0x2d67fc){logger['info'](_0x1692('0x5f'),_0x2d67fc['id']);switch(_0x14cfdf[_0x1692('0x37')]){case'integrationTab':logger[_0x1692('0x9')]('[OUTBOUND]',_0x1692('0x50'));return request({'uri':util[_0x1692('0x1d')](_0x1692('0x51'),_0x14cfdf[_0x1692('0x1f')],_0x898e83['id'],_0x2d67fc['id']),'method':_0x1692('0xc')});case'newTab':logger[_0x1692('0x9')](_0x1692('0x60'),_0x1692('0x61'));emit(util[_0x1692('0x1d')](_0x1692('0x53'),_0x6edc50[_0x1692('0xf')]),'trigger:browser:url',{'uri':util[_0x1692('0x1d')](_0x1692('0x54'),_0x14cfdf['remoteUri']['replace'](_0x1692('0x56'),''),_0x2d67fc['id'])});break;default:logger[_0x1692('0x57')]('[OUTBOUND]',_0x1692('0x58'));}}})[_0x1692('0x59')](function(_0xf6db9c){logger[_0x1692('0x57')](_0x1692('0x62'),util[_0x1692('0x63')](_0xf6db9c,{'showHidden':!![],'depth':null}));});};exports[_0x1692('0x64')]=function(_0x12d24b,_0xa2e11a,_0x19e24c,_0x337dd9,_0x502acb,_0x3eb5ba){var _0x2f9bbf,_0x136893;_0x3eb5ba[_0x1692('0x1f')]=intUtil['stripTrailingSlash'](_0x3eb5ba['remoteUri']);_0x3eb5ba[_0x1692('0x45')]=intUtil[_0x1692('0x44')](_0x3eb5ba[_0x1692('0x45')]);if(_0x502acb&&_0x502acb[_0x1692('0x65')]){logger[_0x1692('0x9')]('['+_0xa2e11a[_0x1692('0x66')][_0x1692('0x67')]()+']',_0x1692('0x47'));_0xa2e11a[_0x1692('0x48')]=util[_0x1692('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eb5ba[_0x1692('0x45')],_0xa2e11a['uniqueid'],md5(_0xa2e11a['uniqueid']));}else{_0xa2e11a[_0x1692('0x48')]='';}headers[_0x1692('0x4b')]=getAuth(_0x3eb5ba);return getUser(_0x3eb5ba)['then'](function(_0x5bcd88){_0x2f9bbf=_0x5bcd88;logger[_0x1692('0x9')]('The\x20User\x20ID\x20is:',_0x2f9bbf['id']);return getEndUser(_0x3eb5ba,_0xa2e11a['calleridname'],_0xa2e11a[_0x1692('0x4e')]);})[_0x1692('0x18')](function(_0x463b64){_0x136893=_0x463b64;logger[_0x1692('0x9')](_0x1692('0x4f'),_0x136893['id']);return getTicket(_0x3eb5ba,_0x2f9bbf,_0x136893,_0x19e24c,_0xa2e11a);})[_0x1692('0x18')](function(_0x10fbf9){if(_0x10fbf9){logger['info'](_0x1692('0x5f'),_0x10fbf9['id']);}})[_0x1692('0x59')](function(_0x45dbfb){logger[_0x1692('0x57')]('['+_0xa2e11a[_0x1692('0x66')]['toUpperCase']()+']'+_0x1692('0x68'),util[_0x1692('0x63')](_0x45dbfb,{'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 46559fe..72b1691 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 _0xdab5=['Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','Last_Name','What_Id','First_Name','talktime','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','starttime','agentcalledAt','Inbound','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','[QUEUE]','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','lastevent','lodash','request-promise','./util','ioredis','../../../../config/environment','zoho','defaults','redis','localhost','emit','debug','stringify','length','forEach','includes','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','GET','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','getString'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdab5,0x165));var _0x5dab=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xdab5[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x5dab('0x0'));var rp=require(_0x5dab('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x5dab('0x2'));var moment=require('moment');var Redis=require(_0x5dab('0x3'));var BPromise=require('bluebird');var config=require(_0x5dab('0x4'));var logger=require('../../../../config/logger')(_0x5dab('0x5'));config['redis']=_[_0x5dab('0x6')](config[_0x5dab('0x7')],{'host':_0x5dab('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x13fab0,_0xd849d2,_0x1b3824){io['to'](_0x13fab0)[_0x5dab('0x9')](_0xd849d2,_0x1b3824);}function request(_0x25f3a5){logger[_0x5dab('0xa')]('[HTTP]',JSON[_0x5dab('0xb')](_0x25f3a5));return rp(_0x25f3a5);}function getCustomFields(_0x4c94a8,_0x504cd4){var _0x4eb463={};if(_0x4c94a8[_0x5dab('0xc')]>0x0){_[_0x5dab('0xd')](_0x4c94a8,function(_0x4118cc){if(_[_0x5dab('0xe')](['string',_0x5dab('0xf')],_0x4118cc[_0x5dab('0x10')])&&_0x4118cc[_0x5dab('0x11')]){_0x4eb463[_0x4118cc['idField']]=_0x4118cc['content'][_0x5dab('0x12')]();}else if(_0x4118cc['type']==='variable'&&_0x4118cc[_0x5dab('0x13')]&&_0x4118cc[_0x5dab('0x11')]&&_0x504cd4[_0x4118cc[_0x5dab('0x13')]]){_0x4eb463[_0x4118cc[_0x5dab('0x11')]]=_0x504cd4[_0x4118cc['variableName']][_0x5dab('0x12')]();}else if(_0x4118cc[_0x5dab('0x10')]==='customVariable'&&_0x4118cc['Variable']&&_0x4118cc[_0x5dab('0x14')][_0x5dab('0x15')]&&_0x4118cc[_0x5dab('0x11')]&&_0x504cd4[_0x4118cc[_0x5dab('0x14')][_0x5dab('0x15')][_0x5dab('0x16')]()]){_0x4eb463[_0x4118cc[_0x5dab('0x11')]]=_0x504cd4[_0x4118cc[_0x5dab('0x14')][_0x5dab('0x15')][_0x5dab('0x16')]()][_0x5dab('0x12')]();}});}return _0x4eb463;}function getName(_0x37ed56){if(_0x37ed56[_0x5dab('0x17')]('\x20')>0x0){var _0x5e3e1c=_0x37ed56[_0x5dab('0x18')](/ (.+)/);if(_0x5e3e1c[0x1]){return _0x5e3e1c;}}return[_0x37ed56,_0x37ed56];}var accountsTokens={};function getAccessToken(_0x375112){return new Promise(function(_0xfa0719,_0x22b6ea){if(!_[_0x5dab('0x19')](accountsTokens[_0x375112['id']])&&!_[_0x5dab('0x19')](accountsTokens[_0x375112['id']][_0x5dab('0x1a')])){if(moment()[_0x5dab('0x1b')](accountsTokens[_0x375112['id']][_0x5dab('0x1c')])){_0xfa0719(accountsTokens[_0x375112['id']]['access_token']);}}var _0x246ff8;switch(_0x375112[_0x5dab('0x1d')]){case'US':_0x246ff8='https://accounts.zoho.com';break;case'AU':_0x246ff8=_0x5dab('0x1e');break;case'EU':_0x246ff8=_0x5dab('0x1f');break;case'IN':_0x246ff8=_0x5dab('0x20');break;case'CN':_0x246ff8=_0x5dab('0x21');break;default:_0x246ff8=_0x5dab('0x1f');break;}var _0xb01efb={'method':_0x5dab('0x22'),'uri':_0x246ff8+_0x5dab('0x23'),'qs':{'refresh_token':_0x375112['refreshToken'],'client_id':_0x375112[_0x5dab('0x24')],'client_secret':_0x375112[_0x5dab('0x25')],'grant_type':_0x5dab('0x26')},'json':!![]};return rp(_0xb01efb)[_0x5dab('0x27')](function(_0x41d68c){accountsTokens[_0x375112['id']]={'access_token':_0x41d68c[_0x5dab('0x1a')],'expires_in':moment()[_0x5dab('0x28')](_0x41d68c[_0x5dab('0x1c')],'seconds')};_0xfa0719(_0x41d68c[_0x5dab('0x1a')]);})[_0x5dab('0x29')](function(_0x29aa08){logger['error'](_0x5dab('0x2a'),_0x29aa08[_0x5dab('0x2b')]);_0x22b6ea(_0x29aa08);});});}function getUser(_0x273967,_0x1280b4,_0xda6a01,_0x1fd791){logger['info'](_0x5dab('0x2c'));return request({'method':'GET','uri':util[_0x5dab('0x2d')](_0x5dab('0x2e'),_0x1280b4),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x273967},'json':!![]})[_0x5dab('0x27')](function(_0x3170bf){if(_0x3170bf[_0x5dab('0x2f')]){var _0x5e19ae=-0x1;if(_[_0x5dab('0x30')](_0x3170bf[_0x5dab('0x2f')])){if(!_['isNil'](_0x1fd791)){_0x5e19ae=_[_0x5dab('0x31')](_0x3170bf[_0x5dab('0x2f')],function(_0x4dfbf1){return _0x4dfbf1[_0x5dab('0x32')]===_0x1fd791;});}if(_0x5e19ae>=0x0){logger[_0x5dab('0x33')](_0x5dab('0x34'));}else{logger[_0x5dab('0x33')](_0x5dab('0x35'));_0x5e19ae=_['findIndex'](_0x3170bf[_0x5dab('0x2f')],function(_0x1390c3){return _0x1390c3[_0x5dab('0x36')][_0x5dab('0x15')]===_0x5dab('0x37');});}return _0x3170bf[_0x5dab('0x2f')][_0x5e19ae];}else{if(_0x3170bf[_0x5dab('0x38')][_0x5dab('0x36')][_0x5dab('0x15')]==='Administrator'){logger[_0x5dab('0x33')](_0x5dab('0x35'));user=_0x3170bf[_0x5dab('0x38')];return user;}else{logger[_0x5dab('0x39')](_0x5dab('0x3a'),JSON['stringify'](_0x3170bf));throw new Error(_0x5dab('0x3b')+JSON[_0x5dab('0xb')](_0x3170bf));}}}else{logger[_0x5dab('0x39')](_0x5dab('0x3a'),JSON[_0x5dab('0xb')](_0x3170bf));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5dab('0xb')](_0x3170bf));}})['catch'](function(_0x1047d9){console[_0x5dab('0x39')](_0x1047d9);});}function getZohoUser(_0x486ad9,_0x931b70){return new BPromise(function(_0x31d420,_0x3345e9){request(_0x486ad9)[_0x5dab('0x27')](function(_0x18054e){var _0x3f564d=null;if(_0x18054e){_0x3f564d=_0x18054e[_0x5dab('0x3c')][0x0];_0x3f564d['enduserType']=_0x931b70;}_0x31d420(_0x3f564d);})[_0x5dab('0x29')](function(_0x237e2d){_0x3345e9(_0x237e2d);});});}function createEndUser(_0x191865,_0x48c737,_0x450e47,_0x1186bb,_0xb74c00,_0x5fb900){var _0x450e47=getName(_0x450e47);return request({'method':_0x5dab('0x22'),'uri':_0x5dab('0x3d')+_0x48c737+_0x5dab('0x3e')+_[_0x5dab('0x3f')](_0x5fb900[_0x5dab('0x40')])+'s','body':{'data':[{'Last_Name':_0x450e47[0x1],'First_Name':_0x450e47[0x0],'Phone':_0x1186bb,'Owner':{'name':!_[_0x5dab('0x19')](_0xb74c00[_0x5dab('0x41')][_0x5dab('0x15')])?_0xb74c00[_0x5dab('0x41')]['name']:!_[_0x5dab('0x19')](_0xb74c00[_0x5dab('0x42')])?_0xb74c00[_0x5dab('0x42')]+'\x20'+_0xb74c00[_0x5dab('0x43')]:_0xb74c00['last_name'],'id':_0xb74c00['id']}}]},'headers':{'Authorization':_0x5dab('0x44')+_0x191865},'json':!![]})[_0x5dab('0x27')](function(_0x3f38d9){if(_0x3f38d9&&_0x3f38d9['data'][0x0][_0x5dab('0x45')]===_0x5dab('0x46')){var _0x24efb5=_0x3f38d9[_0x5dab('0x3c')][0x0][_0x5dab('0x47')];_0x24efb5['enduserType']=_['startCase'](_0x5fb900[_0x5dab('0x40')])+'s';return _0x24efb5;}logger[_0x5dab('0x39')](_0x5dab('0x3a'),JSON[_0x5dab('0xb')](data));throw new Error(_0x5dab('0x48')+JSON[_0x5dab('0xb')](data));})[_0x5dab('0x29')](function(_0x19f384){console[_0x5dab('0x49')]('CREATE\x20ERROR',_0x19f384);});}function getEndUser(_0x8ef9be,_0x54f499,_0x16d7b8,_0x11c070,_0x5c15d7,_0x20c8d0,_0xf3c647){var _0x8cbd77={'method':_0x5dab('0x4a'),'uri':'','headers':{'Authorization':_0x5dab('0x44')+_0x8ef9be},'json':!![]};switch(_0xf3c647[_0x5dab('0x4b')]){case'contact_lead':_0x8cbd77[_0x5dab('0x4c')]=_0x5dab('0x3d')+_0x54f499+_0x5dab('0x4d')+_0x5c15d7+'))';return getZohoUser(_0x8cbd77,_0x5dab('0x4e'))[_0x5dab('0x27')](function(_0x15a860){if(_0x15a860)return _0x15a860;_0x8cbd77[_0x5dab('0x4c')]=_0x5dab('0x3d')+_0x54f499+_0x5dab('0x4f')+_0x5c15d7+'))';return getZohoUser(_0x8cbd77,_0x5dab('0x50'))['then'](function(_0x431ccf){if(_0x431ccf)return _0x431ccf;if(_0xf3c647[_0x5dab('0x40')]!=_0x5dab('0x51')){return createEndUser(_0x8ef9be,_0x54f499,_0x11c070,_0x5c15d7,_0x20c8d0,_0xf3c647);}else{return{};}});});break;case _0x5dab('0x52'):_0x8cbd77[_0x5dab('0x4c')]='https://www.zohoapis.'+_0x54f499+_0x5dab('0x4d')+_0x5c15d7+'))';return getZohoUser(_0x8cbd77,_0x5dab('0x4e'))['then'](function(_0x21f945){if(_0x21f945)return _0x21f945;if(_0xf3c647[_0x5dab('0x40')]!='nothing'){return createEndUser(_0x8ef9be,_0x54f499,_0x11c070,_0x5c15d7,_0x20c8d0,_0xf3c647);}else{return{};}});break;case _0x5dab('0x53'):_0x8cbd77[_0x5dab('0x4c')]='https://www.zohoapis.'+_0x54f499+_0x5dab('0x4f')+_0x5c15d7+'))';return getZohoUser(_0x8cbd77,'Leads')[_0x5dab('0x27')](function(_0x19b49c){if(_0x19b49c)return _0x19b49c;if(_0xf3c647[_0x5dab('0x40')]!=_0x5dab('0x51')){return createEndUser(_0x8ef9be,_0x54f499,_0x11c070,_0x5c15d7,_0x20c8d0,_0xf3c647);}else{return{};}});break;}}function getCall(_0x967e30,_0x56e1dd,_0x2c773c,_0x299982,_0x29eea8,_0x407020,_0x55adc2,_0x34ec7d){logger[_0x5dab('0x33')](_0x5dab('0x54'));var _0x481624={};_0x481624[_0x5dab('0x55')]={'name':!_['isNil'](_0x299982['role'][_0x5dab('0x15')])&&!_['isNil'](_0x299982[_0x5dab('0x36')][_0x5dab('0x15')])&&_0x299982[_0x5dab('0x36')][_0x5dab('0x15')]==='administrator'?_0x299982[_0x5dab('0x41')]['name']:!_[_0x5dab('0x19')](_0x299982[_0x5dab('0x42')])?_0x299982[_0x5dab('0x42')]+'\x20'+_0x299982[_0x5dab('0x43')]:_0x299982[_0x5dab('0x43')],'id':_0x299982['id']};_0x481624['Subject']=intUtil[_0x5dab('0x56')](_0x407020[_0x5dab('0x57')],_0x55adc2,'\x20');_0x481624[_0x5dab('0x58')]=intUtil[_0x5dab('0x56')](_0x407020[_0x5dab('0x59')],_0x55adc2,'\x0a');if(_0x29eea8[_0x5dab('0x5a')]===_0x5dab('0x4e')){_0x481624[_0x5dab('0x5b')]={'name':!_[_0x5dab('0x19')](_0x29eea8[_0x5dab('0x5c')])?_0x29eea8[_0x5dab('0x5c')]:!_[_0x5dab('0x19')](_0x29eea8['First_Name'])?_0x29eea8['First_Name']+'\x20'+_0x29eea8[_0x5dab('0x5d')]:_0x29eea8[_0x5dab('0x5d')],'id':_0x29eea8['id']};}if(_0x29eea8['enduserType']===_0x5dab('0x50')){_0x481624[_0x5dab('0x5e')]={'name':!_['isNil'](_0x29eea8[_0x5dab('0x5c')])?_0x29eea8[_0x5dab('0x5c')]:!_[_0x5dab('0x19')](_0x29eea8[_0x5dab('0x5f')])?_0x29eea8['First_Name']+'\x20'+_0x29eea8[_0x5dab('0x5d')]:_0x29eea8[_0x5dab('0x5d')],'id':_0x29eea8['id']};_0x481624['$se_module']=_[_0x5dab('0x3f')](_0x29eea8[_0x5dab('0x5a')]);}if(_0x55adc2[_0x5dab('0x60')]){_0x481624['Call_Duration']=moment[_0x5dab('0x61')](parseInt(_0x55adc2[_0x5dab('0x60')])*0x3e8)['format']('mm:ss');}else if(_0x55adc2[_0x5dab('0x62')]&&_0x55adc2[_0x5dab('0x63')]){_0x481624['Call_Duration']=moment[_0x5dab('0x61')](moment(_0x55adc2[_0x5dab('0x63')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x55adc2['starttime'],_0x5dab('0x64'))))['format'](_0x5dab('0x65'));}switch(_0x55adc2['lastevent']){case _0x5dab('0x66'):_0x481624[_0x5dab('0x67')]='Called';break;case _0x5dab('0x68'):case _0x5dab('0x69'):_0x481624['Call_Result']=_0x5dab('0x6a');break;case _0x5dab('0x6b'):_0x481624[_0x5dab('0x67')]=_0x5dab('0x6c');break;case _0x5dab('0x6d'):_0x481624[_0x5dab('0x67')]='Abandoned';break;case _0x5dab('0x6e'):_0x481624[_0x5dab('0x67')]=_0x5dab('0x6f');default:}_0x481624[_0x5dab('0x70')]=(_0x34ec7d==='outbound'?moment(_0x55adc2[_0x5dab('0x71')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x55adc2[_0x5dab('0x72')])[_0x5dab('0x2d')](_0x5dab('0x64')))||moment()[_0x5dab('0x2d')](_0x5dab('0x64'));_0x481624['Call_Type']=_0x34ec7d||_0x5dab('0x73');_0x481624=_['merge'](_0x481624,getCustomFields(_0x407020['Fields'],_0x55adc2));return request({'method':_0x5dab('0x22'),'uri':_0x5dab('0x3d')+_0x56e1dd+_0x5dab('0x74'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x967e30},'body':{'data':[_0x481624]},'json':!![]})[_0x5dab('0x27')](function(_0x4b104a){if(_0x4b104a&&_0x4b104a[_0x5dab('0x3c')][0x0]['code']===_0x5dab('0x46')){logger['info'](_0x5dab('0x75'));return{'id':_0x4b104a['data'][0x0][_0x5dab('0x47')]['id']};}})[_0x5dab('0x29')](function(_0x195664){logger[_0x5dab('0x33')](_0x5dab('0x76'),_0x195664[_0x5dab('0x2b')]);console['log'](_0x5dab('0x76'),_0x195664);});}exports[_0x5dab('0x77')]=function(_0x63e7e3,_0x1b8752,_0x358ea3,_0x2feb44,_0x5011af,_0x1b85ad){var _0x1e2db5,_0x181c49,_0xb79577;_0x1b85ad[_0x5dab('0x78')]=intUtil[_0x5dab('0x79')](_0x1b85ad['host']);_0x1b85ad['serverUrl']=intUtil[_0x5dab('0x79')](_0x1b85ad[_0x5dab('0x7a')]);if(_0x5011af&&_0x5011af[_0x5dab('0x7b')]){logger[_0x5dab('0x33')]('[QUEUE]',_0x5dab('0x7c'));_0x1b8752[_0x5dab('0x7d')]=_0x1b85ad[_0x5dab('0x7a')]+_0x5dab('0x7e')+_0x1b8752['uniqueid']+_0x5dab('0x7f')+md5(_0x1b8752[_0x5dab('0x80')]);}else{_0x1b8752[_0x5dab('0x7d')]='';}var _0x5a0911=_0x1b85ad['host']==='zoho.eu'?'eu':_0x5dab('0x81');return getAccessToken(_0x1b85ad)[_0x5dab('0x27')](function(_0x5ac5fb){_0xb79577=_0x5ac5fb;return getUser(_0xb79577,_0x5a0911,_0x1b85ad,_0x2feb44['email']);})[_0x5dab('0x27')](function(_0x578a6e){_0x1e2db5=_0x578a6e;logger[_0x5dab('0x33')](_0x5dab('0x82'),_0x1e2db5['id']);return getEndUser(_0xb79577,_0x5a0911,_0x1b85ad,_0x1b8752[_0x5dab('0x83')],_0x1b8752[_0x5dab('0x84')],_0x1e2db5,_0x358ea3);})[_0x5dab('0x27')](function(_0x93811b){_0x181c49=_0x93811b;return getCall(_0xb79577,_0x5a0911,_0x1b85ad,_0x1e2db5,_0x181c49,_0x358ea3,_0x1b8752,_0x5dab('0x73'));})[_0x5dab('0x27')](function(_0x450db4){if(_0x450db4){logger[_0x5dab('0x33')]('The\x20Call\x20ID\x20is:',_0x450db4['id']);logger[_0x5dab('0x33')](_0x5dab('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5dab('0x2d')]('user:%s',_0x2feb44[_0x5dab('0x15')]),'trigger:browser:url',{'uri':_0x5dab('0x86')+_0x1b85ad[_0x5dab('0x78')]+_0x5dab('0x87')+_0x450db4['id']});}})[_0x5dab('0x29')](function(_0x3f69a3){logger['error'](_0x5dab('0x85'),JSON[_0x5dab('0xb')](_0x3f69a3));});};exports[_0x5dab('0x88')]=function(_0xc260ee,_0x4b84e7,_0x18d87d,_0x47ff91,_0x217198,_0x3428be,_0x4f80ce){var _0x17bed3,_0x39b0bd,_0x38a3ce;_0x3428be['host']=intUtil['stripTrailingSlash'](_0x3428be[_0x5dab('0x78')]);_0x3428be['serverUrl']=intUtil['stripTrailingSlash'](_0x3428be['serverUrl']);if(_0x4f80ce&&_0x4f80ce[_0x5dab('0x89')]&&_0x4f80ce['recordingFormat']!==_0x5dab('0x8a')){logger[_0x5dab('0x33')](_0x5dab('0x8b'),'Recording\x20is\x20enabled!');_0x4b84e7['recordingURL']=_0x3428be[_0x5dab('0x7a')]+_0x5dab('0x7e')+_0x4b84e7[_0x5dab('0x80')]+_0x5dab('0x7f')+md5(_0x4b84e7[_0x5dab('0x80')]);}var _0x5403d9=_0x3428be[_0x5dab('0x78')]===_0x5dab('0x8c')?'eu':_0x5dab('0x81');return getAccessToken(_0x3428be)[_0x5dab('0x27')](function(_0x2fefee){_0x38a3ce=_0x2fefee;return getUser(_0x38a3ce,_0x5403d9,_0x3428be,_0x47ff91[_0x5dab('0x32')]);})[_0x5dab('0x27')](function(_0x5e02bf){_0x17bed3=_0x5e02bf;logger[_0x5dab('0x33')](_0x5dab('0x82'),_0x17bed3['id']);return getEndUser(_0x38a3ce,_0x5403d9,_0x3428be,_0x4b84e7[_0x5dab('0x8d')],_0x4b84e7[_0x5dab('0x8e')],_0x17bed3,_0x18d87d);})[_0x5dab('0x27')](function(_0x50971a){_0x39b0bd=_0x50971a;return getCall(_0x38a3ce,_0x5403d9,_0x3428be,_0x17bed3,_0x39b0bd,_0x18d87d,_0x4b84e7,_0x5dab('0x8f'));})[_0x5dab('0x27')](function(_0x383d46){if(_0x383d46){logger[_0x5dab('0x33')]('The\x20Call\x20ID\x20is:',_0x383d46['id']);logger['info']('[OUTBOUND]',_0x5dab('0x90'));emit(util[_0x5dab('0x2d')](_0x5dab('0x91'),_0x47ff91['name']),_0x5dab('0x92'),{'uri':_0x5dab('0x86')+_0x3428be[_0x5dab('0x78')]+_0x5dab('0x87')+_0x383d46['id']});}})['catch'](function(_0x44699c){logger[_0x5dab('0x39')](_0x5dab('0x8b'),JSON[_0x5dab('0xb')](_0x44699c));});};exports['unmanaged']=function(_0xfc87fb,_0x35c075,_0x48cdc3,_0x23c357,_0x507541,_0x1754a0){var _0xcc90f7,_0x4cf7d0,_0x39ec98;_0x1754a0[_0x5dab('0x78')]=intUtil[_0x5dab('0x79')](_0x1754a0[_0x5dab('0x78')]);_0x1754a0[_0x5dab('0x7a')]=intUtil['stripTrailingSlash'](_0x1754a0[_0x5dab('0x7a')]);if(_0x507541&&_0x507541[_0x5dab('0x7b')]){logger['info']('['+_0x35c075[_0x5dab('0x93')]['toUpperCase']()+']',_0x5dab('0x7c'));_0x35c075['recordingURL']=_0x1754a0[_0x5dab('0x7a')]+_0x5dab('0x7e')+_0x35c075['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x35c075[_0x5dab('0x80')]);}else{_0x35c075[_0x5dab('0x7d')]='';}var _0x343d5c=_0x1754a0[_0x5dab('0x78')]===_0x5dab('0x8c')?'eu':'com';return getAccessToken(_0x1754a0)[_0x5dab('0x27')](function(_0x478d50){_0x39ec98=_0x478d50;return getUser(_0x39ec98,_0x343d5c,_0x1754a0);})['then'](function(_0x18a1ef){_0xcc90f7=_0x18a1ef;logger['info'](_0x5dab('0x82'),_0xcc90f7['id']);return getEndUser(_0x39ec98,_0x343d5c,_0x1754a0,_0x35c075[_0x5dab('0x83')],_0x35c075[_0x5dab('0x84')],_0xcc90f7,_0x48cdc3);})['then'](function(_0x159f89){_0x4cf7d0=_0x159f89;return getCall(_0x39ec98,_0x343d5c,_0x1754a0,_0xcc90f7,_0x4cf7d0,_0x48cdc3,_0x35c075,'Inbound');})[_0x5dab('0x27')](function(_0x18371f){if(_0x18371f){logger['info']('The\x20Call\x20ID\x20is:',_0x18371f['id']);}})[_0x5dab('0x29')](function(_0x40be2a){logger[_0x5dab('0x39')]('['+_0x35c075['lastevent']['toUpperCase']()+']',JSON[_0x5dab('0xb')](_0x40be2a));});}; \ No newline at end of file +var _0x31f0=['clientSecret','refresh_token','seconds','catch','error','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','name','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','getString','Subjects','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','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]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','user:%s','toUpperCase','lodash','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','variable','variableName','toString','customVariable','Variable','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId'];(function(_0x3d9dfd,_0x1f6811){var _0x56156e=function(_0x2a7796){while(--_0x2a7796){_0x3d9dfd['push'](_0x3d9dfd['shift']());}};_0x56156e(++_0x1f6811);}(_0x31f0,0x1a0));var _0x031f=function(_0x1ed7b8,_0x48df9a){_0x1ed7b8=_0x1ed7b8-0x0;var _0x40e035=_0x31f0[_0x1ed7b8];return _0x40e035;};'use strict';var _=require(_0x031f('0x0'));var rp=require(_0x031f('0x1'));var md5=require('md5');var util=require(_0x031f('0x2'));var intUtil=require('./util');var moment=require(_0x031f('0x3'));var Redis=require(_0x031f('0x4'));var BPromise=require(_0x031f('0x5'));var config=require(_0x031f('0x6'));var logger=require(_0x031f('0x7'))(_0x031f('0x8'));config[_0x031f('0x9')]=_['defaults'](config[_0x031f('0x9')],{'host':_0x031f('0xa'),'port':0x18eb});var io=require(_0x031f('0xb'))(new Redis(config[_0x031f('0x9')]));function emit(_0x4bd5dd,_0xb856c1,_0x2e7017){io['to'](_0x4bd5dd)[_0x031f('0xc')](_0xb856c1,_0x2e7017);}function request(_0xcfa1be){logger[_0x031f('0xd')](_0x031f('0xe'),JSON[_0x031f('0xf')](_0xcfa1be));return rp(_0xcfa1be);}function getCustomFields(_0x16412f,_0x408202){var _0x19abea={};if(_0x16412f[_0x031f('0x10')]>0x0){_[_0x031f('0x11')](_0x16412f,function(_0x6eceb6){if(_[_0x031f('0x12')](['string',_0x031f('0x13')],_0x6eceb6[_0x031f('0x14')])&&_0x6eceb6[_0x031f('0x15')]){_0x19abea[_0x6eceb6[_0x031f('0x15')]]=_0x6eceb6['content']['toString']();}else if(_0x6eceb6[_0x031f('0x14')]===_0x031f('0x16')&&_0x6eceb6[_0x031f('0x17')]&&_0x6eceb6[_0x031f('0x15')]&&_0x408202[_0x6eceb6[_0x031f('0x17')]]){_0x19abea[_0x6eceb6[_0x031f('0x15')]]=_0x408202[_0x6eceb6[_0x031f('0x17')]][_0x031f('0x18')]();}else if(_0x6eceb6[_0x031f('0x14')]===_0x031f('0x19')&&_0x6eceb6[_0x031f('0x1a')]&&_0x6eceb6['Variable']['name']&&_0x6eceb6[_0x031f('0x15')]&&_0x408202[_0x6eceb6[_0x031f('0x1a')]['name'][_0x031f('0x1b')]()]){_0x19abea[_0x6eceb6['idField']]=_0x408202[_0x6eceb6[_0x031f('0x1a')]['name'][_0x031f('0x1b')]()][_0x031f('0x18')]();}});}return _0x19abea;}function getName(_0x2bd85c){if(_0x2bd85c[_0x031f('0x1c')]('\x20')>0x0){var _0x3c8cb1=_0x2bd85c['split'](/ (.+)/);if(_0x3c8cb1[0x1]){return _0x3c8cb1;}}return[_0x2bd85c,_0x2bd85c];}var accountsTokens={};function getAccessToken(_0x4a91d3){return new Promise(function(_0x141f56,_0xd3352d){if(!_[_0x031f('0x1d')](accountsTokens[_0x4a91d3['id']])&&!_[_0x031f('0x1d')](accountsTokens[_0x4a91d3['id']][_0x031f('0x1e')])){if(moment()[_0x031f('0x1f')](accountsTokens[_0x4a91d3['id']][_0x031f('0x20')])){_0x141f56(accountsTokens[_0x4a91d3['id']]['access_token']);}}var _0x1694e9;switch(_0x4a91d3['zone']){case'US':_0x1694e9=_0x031f('0x21');break;case'AU':_0x1694e9='https://accounts.zoho.com.au';break;case'EU':_0x1694e9=_0x031f('0x22');break;case'IN':_0x1694e9=_0x031f('0x23');break;case'CN':_0x1694e9=_0x031f('0x24');break;default:_0x1694e9=_0x031f('0x22');break;}var _0x36cf57={'method':_0x031f('0x25'),'uri':_0x1694e9+_0x031f('0x26'),'qs':{'refresh_token':_0x4a91d3['refreshToken'],'client_id':_0x4a91d3[_0x031f('0x27')],'client_secret':_0x4a91d3[_0x031f('0x28')],'grant_type':_0x031f('0x29')},'json':!![]};return rp(_0x36cf57)['then'](function(_0x45139c){accountsTokens[_0x4a91d3['id']]={'access_token':_0x45139c[_0x031f('0x1e')],'expires_in':moment()['add'](_0x45139c[_0x031f('0x20')],_0x031f('0x2a'))};_0x141f56(_0x45139c[_0x031f('0x1e')]);})[_0x031f('0x2b')](function(_0x3d21f0){logger[_0x031f('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x3d21f0['stack']);_0xd3352d(_0x3d21f0);});});}function getUser(_0x22f781,_0xc8b30d,_0x1a86c,_0x483851){logger[_0x031f('0x2d')](_0x031f('0x2e'));return request({'method':_0x031f('0x2f'),'uri':util[_0x031f('0x30')](_0x031f('0x31'),_0xc8b30d),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x031f('0x32')+_0x22f781},'json':!![]})[_0x031f('0x33')](function(_0x1ab378){if(_0x1ab378[_0x031f('0x34')]){var _0x85d559=-0x1;if(_[_0x031f('0x35')](_0x1ab378['users'])){if(!_['isNil'](_0x483851)){_0x85d559=_['findIndex'](_0x1ab378[_0x031f('0x34')],function(_0x436ecc){return _0x436ecc['email']===_0x483851;});}if(_0x85d559>=0x0){logger[_0x031f('0x2d')](_0x031f('0x36'));}else{logger['info'](_0x031f('0x37'));_0x85d559=_['findIndex'](_0x1ab378[_0x031f('0x34')],function(_0x57aa22){return _0x57aa22[_0x031f('0x38')][_0x031f('0x39')]==='Administrator';});}return _0x1ab378[_0x031f('0x34')][_0x85d559];}else{if(_0x1ab378[_0x031f('0x3a')]['profile'][_0x031f('0x39')]===_0x031f('0x3b')){logger[_0x031f('0x2d')](_0x031f('0x37'));user=_0x1ab378[_0x031f('0x3a')];return user;}else{logger['error'](_0x031f('0x3c'),JSON[_0x031f('0xf')](_0x1ab378));throw new Error(_0x031f('0x3d')+JSON[_0x031f('0xf')](_0x1ab378));}}}else{logger['error'](_0x031f('0x3c'),JSON[_0x031f('0xf')](_0x1ab378));throw new Error(_0x031f('0x3d')+JSON['stringify'](_0x1ab378));}})[_0x031f('0x2b')](function(_0x24a42b){console[_0x031f('0x2c')](_0x24a42b);});}function getZohoUser(_0x15d650,_0x6d3bc1){return new BPromise(function(_0x44a3ce,_0x51a5c4){request(_0x15d650)[_0x031f('0x33')](function(_0x31b9e6){var _0x44dfbd=null;if(_0x31b9e6){_0x44dfbd=_0x31b9e6[_0x031f('0x3e')][0x0];_0x44dfbd['enduserType']=_0x6d3bc1;}_0x44a3ce(_0x44dfbd);})[_0x031f('0x2b')](function(_0x4b1f9f){_0x51a5c4(_0x4b1f9f);});});}function createEndUser(_0x443d67,_0x50377c,_0xf3f173,_0x41a6b7,_0x380609,_0x56a8a7){var _0xf3f173=getName(_0xf3f173);return request({'method':_0x031f('0x25'),'uri':_0x031f('0x3f')+_0x50377c+'/crm/v2/'+_[_0x031f('0x40')](_0x56a8a7[_0x031f('0x41')])+'s','body':{'data':[{'Last_Name':_0xf3f173[0x1],'First_Name':_0xf3f173[0x0],'Phone':_0x41a6b7,'Owner':{'name':!_[_0x031f('0x1d')](_0x380609[_0x031f('0x42')][_0x031f('0x39')])?_0x380609[_0x031f('0x42')][_0x031f('0x39')]:!_['isNil'](_0x380609['first_name'])?_0x380609[_0x031f('0x43')]+'\x20'+_0x380609[_0x031f('0x44')]:_0x380609['last_name'],'id':_0x380609['id']}}]},'headers':{'Authorization':_0x031f('0x32')+_0x443d67},'json':!![]})[_0x031f('0x33')](function(_0x380a35){if(_0x380a35&&_0x380a35[_0x031f('0x3e')][0x0][_0x031f('0x45')]==='SUCCESS'){var _0x456433=_0x380a35[_0x031f('0x3e')][0x0][_0x031f('0x46')];_0x456433['enduserType']=_[_0x031f('0x40')](_0x56a8a7[_0x031f('0x41')])+'s';return _0x456433;}logger[_0x031f('0x2c')](_0x031f('0x3c'),JSON['stringify'](data));throw new Error(_0x031f('0x47')+JSON[_0x031f('0xf')](data));})[_0x031f('0x2b')](function(_0x453863){console[_0x031f('0x48')](_0x031f('0x49'),_0x453863);});}function getEndUser(_0x2f91ce,_0x21c3a9,_0x5b7aef,_0x5dc27e,_0x212ff5,_0x43e9ab,_0x17be87){var _0xf080da={'method':_0x031f('0x2f'),'uri':'','headers':{'Authorization':_0x031f('0x32')+_0x2f91ce},'json':!![]};switch(_0x17be87[_0x031f('0x4a')]){case'contact_lead':_0xf080da[_0x031f('0x4b')]=_0x031f('0x3f')+_0x21c3a9+_0x031f('0x4c')+_0x212ff5+'))';return getZohoUser(_0xf080da,'Contacts')['then'](function(_0x42fa63){if(_0x42fa63)return _0x42fa63;_0xf080da['uri']=_0x031f('0x3f')+_0x21c3a9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x212ff5+'))';return getZohoUser(_0xf080da,_0x031f('0x4d'))[_0x031f('0x33')](function(_0x2e59bd){if(_0x2e59bd)return _0x2e59bd;if(_0x17be87[_0x031f('0x41')]!='nothing'){return createEndUser(_0x2f91ce,_0x21c3a9,_0x5dc27e,_0x212ff5,_0x43e9ab,_0x17be87);}else{return{};}});});break;case _0x031f('0x4e'):_0xf080da[_0x031f('0x4b')]=_0x031f('0x3f')+_0x21c3a9+_0x031f('0x4c')+_0x212ff5+'))';return getZohoUser(_0xf080da,'Contacts')[_0x031f('0x33')](function(_0x3163f3){if(_0x3163f3)return _0x3163f3;if(_0x17be87[_0x031f('0x41')]!=_0x031f('0x4f')){return createEndUser(_0x2f91ce,_0x21c3a9,_0x5dc27e,_0x212ff5,_0x43e9ab,_0x17be87);}else{return{};}});break;case _0x031f('0x50'):_0xf080da[_0x031f('0x4b')]=_0x031f('0x3f')+_0x21c3a9+_0x031f('0x51')+_0x212ff5+'))';return getZohoUser(_0xf080da,_0x031f('0x4d'))[_0x031f('0x33')](function(_0x393c82){if(_0x393c82)return _0x393c82;if(_0x17be87[_0x031f('0x41')]!='nothing'){return createEndUser(_0x2f91ce,_0x21c3a9,_0x5dc27e,_0x212ff5,_0x43e9ab,_0x17be87);}else{return{};}});break;}}function getCall(_0x11c452,_0x37320a,_0x5af1c3,_0x3801d6,_0x23344d,_0x38f71f,_0x27ce93,_0x26e167){logger[_0x031f('0x2d')](_0x031f('0x52'));var _0x159d46={};_0x159d46[_0x031f('0x53')]={'name':!_['isNil'](_0x3801d6[_0x031f('0x42')][_0x031f('0x39')])&&!_['isNil'](_0x3801d6[_0x031f('0x38')][_0x031f('0x39')])&&_0x3801d6[_0x031f('0x38')]['name']==='administrator'?_0x3801d6[_0x031f('0x42')][_0x031f('0x39')]:!_['isNil'](_0x3801d6[_0x031f('0x43')])?_0x3801d6[_0x031f('0x43')]+'\x20'+_0x3801d6[_0x031f('0x44')]:_0x3801d6[_0x031f('0x44')],'id':_0x3801d6['id']};_0x159d46['Subject']=intUtil[_0x031f('0x54')](_0x38f71f[_0x031f('0x55')],_0x27ce93,'\x20');_0x159d46['Description']=intUtil['getString'](_0x38f71f['Descriptions'],_0x27ce93,'\x0a');if(_0x23344d[_0x031f('0x56')]==='Contacts'){_0x159d46[_0x031f('0x57')]={'name':!_[_0x031f('0x1d')](_0x23344d[_0x031f('0x58')])?_0x23344d[_0x031f('0x58')]:!_[_0x031f('0x1d')](_0x23344d[_0x031f('0x59')])?_0x23344d[_0x031f('0x59')]+'\x20'+_0x23344d[_0x031f('0x5a')]:_0x23344d[_0x031f('0x5a')],'id':_0x23344d['id']};}if(_0x23344d[_0x031f('0x56')]===_0x031f('0x4d')){_0x159d46[_0x031f('0x5b')]={'name':!_[_0x031f('0x1d')](_0x23344d[_0x031f('0x58')])?_0x23344d[_0x031f('0x58')]:!_[_0x031f('0x1d')](_0x23344d[_0x031f('0x59')])?_0x23344d[_0x031f('0x59')]+'\x20'+_0x23344d[_0x031f('0x5a')]:_0x23344d[_0x031f('0x5a')],'id':_0x23344d['id']};_0x159d46[_0x031f('0x5c')]=_[_0x031f('0x40')](_0x23344d[_0x031f('0x56')]);}if(_0x27ce93[_0x031f('0x5d')]){_0x159d46[_0x031f('0x5e')]=moment[_0x031f('0x5f')](parseInt(_0x27ce93[_0x031f('0x5d')])*0x3e8)['format']('mm:ss');}else if(_0x27ce93['answertime']&&_0x27ce93[_0x031f('0x60')]){_0x159d46[_0x031f('0x5e')]=moment[_0x031f('0x5f')](moment(_0x27ce93[_0x031f('0x60')],_0x031f('0x61'))['diff'](moment(_0x27ce93[_0x031f('0x62')],'YYYY-MM-DDTHH:mm:ss')))['format']('mm:ss');}switch(_0x27ce93[_0x031f('0x63')]){case _0x031f('0x64'):_0x159d46['Call_Result']=_0x031f('0x65');break;case _0x031f('0x66'):case _0x031f('0x67'):_0x159d46[_0x031f('0x68')]=_0x031f('0x69');break;case _0x031f('0x6a'):_0x159d46[_0x031f('0x68')]=_0x031f('0x6b');break;case _0x031f('0x6c'):_0x159d46[_0x031f('0x68')]='Abandoned';break;case _0x031f('0x6d'):_0x159d46[_0x031f('0x68')]=_0x031f('0x6e');default:}_0x159d46[_0x031f('0x6f')]=(_0x26e167===_0x031f('0x70')?moment(_0x27ce93[_0x031f('0x62')])[_0x031f('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x27ce93[_0x031f('0x71')])[_0x031f('0x30')](_0x031f('0x61')))||moment()[_0x031f('0x30')](_0x031f('0x61'));_0x159d46[_0x031f('0x72')]=_0x26e167||_0x031f('0x73');_0x159d46=_['merge'](_0x159d46,getCustomFields(_0x38f71f[_0x031f('0x74')],_0x27ce93));return request({'method':_0x031f('0x25'),'uri':_0x031f('0x3f')+_0x37320a+_0x031f('0x75'),'headers':{'Authorization':_0x031f('0x32')+_0x11c452},'body':{'data':[_0x159d46]},'json':!![]})[_0x031f('0x33')](function(_0x1b8a44){if(_0x1b8a44&&_0x1b8a44[_0x031f('0x3e')][0x0][_0x031f('0x45')]===_0x031f('0x76')){logger['info'](_0x031f('0x77'));return{'id':_0x1b8a44[_0x031f('0x3e')][0x0]['details']['id']};}})[_0x031f('0x2b')](function(_0x5c701e){logger[_0x031f('0x2d')](_0x031f('0x78'),_0x5c701e[_0x031f('0x79')]);console['log'](_0x031f('0x78'),_0x5c701e);});}exports[_0x031f('0x7a')]=function(_0x1b59f1,_0x35f717,_0x3a1fea,_0x2a0dd2,_0xb002f,_0x507acf){var _0x5b27b6,_0x2c3cec,_0x5aaabe;_0x507acf[_0x031f('0x7b')]=intUtil[_0x031f('0x7c')](_0x507acf[_0x031f('0x7b')]);_0x507acf[_0x031f('0x7d')]=intUtil[_0x031f('0x7c')](_0x507acf[_0x031f('0x7d')]);if(_0xb002f&&_0xb002f[_0x031f('0x7e')]){logger['info'](_0x031f('0x7f'),'Recording\x20is\x20enabled!');_0x35f717['recordingURL']=_0x507acf[_0x031f('0x7d')]+_0x031f('0x80')+_0x35f717['uniqueid']+_0x031f('0x81')+md5(_0x35f717[_0x031f('0x82')]);}else{_0x35f717[_0x031f('0x83')]='';}var _0x553465=_0x507acf['host']===_0x031f('0x84')?'eu':_0x031f('0x85');return getAccessToken(_0x507acf)['then'](function(_0x51817e){_0x5aaabe=_0x51817e;return getUser(_0x5aaabe,_0x553465,_0x507acf,_0x2a0dd2[_0x031f('0x86')]);})[_0x031f('0x33')](function(_0x18603c){_0x5b27b6=_0x18603c;logger[_0x031f('0x2d')](_0x031f('0x87'),_0x5b27b6['id']);return getEndUser(_0x5aaabe,_0x553465,_0x507acf,_0x35f717[_0x031f('0x88')],_0x35f717[_0x031f('0x89')],_0x5b27b6,_0x3a1fea);})[_0x031f('0x33')](function(_0x1c3007){_0x2c3cec=_0x1c3007;return getCall(_0x5aaabe,_0x553465,_0x507acf,_0x5b27b6,_0x2c3cec,_0x3a1fea,_0x35f717,_0x031f('0x73'));})[_0x031f('0x33')](function(_0x2a582e){if(_0x2a582e){logger['info'](_0x031f('0x8a'),_0x2a582e['id']);logger[_0x031f('0x2d')](_0x031f('0x7f'),_0x031f('0x8b'));emit(util[_0x031f('0x30')]('user:%s',_0x2a0dd2['name']),_0x031f('0x8c'),{'uri':_0x031f('0x8d')+_0x507acf[_0x031f('0x7b')]+_0x031f('0x8e')+_0x2a582e['id']});}})[_0x031f('0x2b')](function(_0x27bc69){logger[_0x031f('0x2c')](_0x031f('0x7f'),JSON[_0x031f('0xf')](_0x27bc69));});};exports[_0x031f('0x70')]=function(_0x91a075,_0x4dd467,_0x58472d,_0x325665,_0x5a53f2,_0x3541dd,_0x193843){var _0x5628d0,_0x40f943,_0x39fd99;_0x3541dd[_0x031f('0x7b')]=intUtil[_0x031f('0x7c')](_0x3541dd[_0x031f('0x7b')]);_0x3541dd[_0x031f('0x7d')]=intUtil[_0x031f('0x7c')](_0x3541dd[_0x031f('0x7d')]);if(_0x193843&&_0x193843[_0x031f('0x8f')]&&_0x193843[_0x031f('0x8f')]!==_0x031f('0x90')){logger[_0x031f('0x2d')](_0x031f('0x91'),_0x031f('0x92'));_0x4dd467[_0x031f('0x83')]=_0x3541dd['serverUrl']+_0x031f('0x80')+_0x4dd467[_0x031f('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x4dd467['uniqueid']);}var _0x23ad8=_0x3541dd[_0x031f('0x7b')]===_0x031f('0x84')?'eu':_0x031f('0x85');return getAccessToken(_0x3541dd)['then'](function(_0x55d866){_0x39fd99=_0x55d866;return getUser(_0x39fd99,_0x23ad8,_0x3541dd,_0x325665[_0x031f('0x86')]);})['then'](function(_0xea931a){_0x5628d0=_0xea931a;logger['info']('The\x20User\x20ID\x20is:',_0x5628d0['id']);return getEndUser(_0x39fd99,_0x23ad8,_0x3541dd,_0x4dd467[_0x031f('0x93')],_0x4dd467[_0x031f('0x94')],_0x5628d0,_0x58472d);})['then'](function(_0x5b2932){_0x40f943=_0x5b2932;return getCall(_0x39fd99,_0x23ad8,_0x3541dd,_0x5628d0,_0x40f943,_0x58472d,_0x4dd467,_0x031f('0x95'));})['then'](function(_0x2737c0){if(_0x2737c0){logger[_0x031f('0x2d')](_0x031f('0x8a'),_0x2737c0['id']);logger[_0x031f('0x2d')](_0x031f('0x91'),_0x031f('0x8b'));emit(util['format'](_0x031f('0x96'),_0x325665[_0x031f('0x39')]),_0x031f('0x8c'),{'uri':'https://crm.'+_0x3541dd[_0x031f('0x7b')]+_0x031f('0x8e')+_0x2737c0['id']});}})[_0x031f('0x2b')](function(_0x418597){logger[_0x031f('0x2c')]('[OUTBOUND]',JSON[_0x031f('0xf')](_0x418597));});};exports['unmanaged']=function(_0x150649,_0x37ce16,_0x37e5bf,_0x59cd27,_0x3ee02e,_0x572b4b){var _0x25d28e,_0xbc0dbb,_0x1a9261;_0x572b4b[_0x031f('0x7b')]=intUtil['stripTrailingSlash'](_0x572b4b[_0x031f('0x7b')]);_0x572b4b[_0x031f('0x7d')]=intUtil[_0x031f('0x7c')](_0x572b4b[_0x031f('0x7d')]);if(_0x3ee02e&&_0x3ee02e['monitor_format']){logger[_0x031f('0x2d')]('['+_0x37ce16[_0x031f('0x63')][_0x031f('0x97')]()+']','Recording\x20is\x20enabled!');_0x37ce16[_0x031f('0x83')]=_0x572b4b[_0x031f('0x7d')]+_0x031f('0x80')+_0x37ce16[_0x031f('0x82')]+_0x031f('0x81')+md5(_0x37ce16[_0x031f('0x82')]);}else{_0x37ce16[_0x031f('0x83')]='';}var _0x733266=_0x572b4b['host']===_0x031f('0x84')?'eu':_0x031f('0x85');return getAccessToken(_0x572b4b)[_0x031f('0x33')](function(_0x339a07){_0x1a9261=_0x339a07;return getUser(_0x1a9261,_0x733266,_0x572b4b);})[_0x031f('0x33')](function(_0x366f35){_0x25d28e=_0x366f35;logger['info'](_0x031f('0x87'),_0x25d28e['id']);return getEndUser(_0x1a9261,_0x733266,_0x572b4b,_0x37ce16[_0x031f('0x88')],_0x37ce16[_0x031f('0x89')],_0x25d28e,_0x37e5bf);})[_0x031f('0x33')](function(_0x560ca4){_0xbc0dbb=_0x560ca4;return getCall(_0x1a9261,_0x733266,_0x572b4b,_0x25d28e,_0xbc0dbb,_0x37e5bf,_0x37ce16,_0x031f('0x73'));})['then'](function(_0x4b782b){if(_0x4b782b){logger[_0x031f('0x2d')](_0x031f('0x8a'),_0x4b782b['id']);}})[_0x031f('0x2b')](function(_0x3626e3){logger['error']('['+_0x37ce16['lastevent'][_0x031f('0x97')]()+']',JSON[_0x031f('0xf')](_0x3626e3));});}; \ 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 5a85d9c..7994dc7 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 _0x8bb1=['util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','render','data3','exec','error','info'];(function(_0x30e604,_0x3199ae){var _0xf3dbc4=function(_0xcf47f4){while(--_0xcf47f4){_0x30e604['push'](_0x30e604['shift']());}};_0xf3dbc4(++_0x3199ae);}(_0x8bb1,0x144));var _0x18bb=function(_0x1f2325,_0x5f31af){_0x1f2325=_0x1f2325-0x0;var _0x90c8a4=_0x8bb1[_0x1f2325];return _0x90c8a4;};'use strict';var util=require(_0x18bb('0x0'));var sh=require(_0x18bb('0x1'));var Mustache=require(_0x18bb('0x2'));var logger=require(_0x18bb('0x3'))(_0x18bb('0x4'));exports['exec']=function(_0x4cdffa,_0x1bb92c){var _0x52158d=_0x4cdffa['data2']?_0x4cdffa[_0x18bb('0x5')]:_0x18bb('0x6');var _0x68ac0c=_0x4cdffa['data3']?Mustache[_0x18bb('0x7')](_0x4cdffa[_0x18bb('0x8')],_0x1bb92c):_0x1bb92c;sh[_0x18bb('0x9')](_0x68ac0c,function(_0x28501d,_0x2607ca,_0x2eb763){if(_0x28501d!==0x0){logger[_0x18bb('0xa')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x52158d,_0x68ac0c,_0x28501d,_0x2eb763));}else{logger[_0x18bb('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x52158d,_0x68ac0c,_0x2607ca));}});}; \ No newline at end of file +var _0xee9f=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','../../../../config/logger','trigger','data2','Script','data3','render','error'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0xee9f,0xab));var _0xfee9=function(_0x301bbc,_0x434a33){_0x301bbc=_0x301bbc-0x0;var _0x3bd743=_0xee9f[_0x301bbc];return _0x3bd743;};'use strict';var util=require(_0xfee9('0x0'));var sh=require(_0xfee9('0x1'));var Mustache=require('mustache');var logger=require(_0xfee9('0x2'))(_0xfee9('0x3'));exports['exec']=function(_0x356e10,_0x28b26a){var _0x1bf607=_0x356e10[_0xfee9('0x4')]?_0x356e10['data2']:_0xfee9('0x5');var _0x1995bf=_0x356e10[_0xfee9('0x6')]?Mustache[_0xfee9('0x7')](_0x356e10[_0xfee9('0x6')],_0x28b26a):_0x28b26a;sh['exec'](_0x1995bf,function(_0x29e1a6,_0x3946a2,_0x41e5da){if(_0x29e1a6!==0x0){logger[_0xfee9('0x8')](util[_0xfee9('0x9')](_0xfee9('0xa'),_0x1bf607,_0x1995bf,_0x29e1a6,_0x41e5da));}else{logger[_0xfee9('0xb')](util[_0xfee9('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x1bf607,_0x1995bf,_0x3946a2));}});}; \ 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 43f93c8..47ef8af 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 _0x91fa=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','GET','POST','PUT','data7','body','stack'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x91fa,0x1e7));var _0xa91f=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x91fa[_0x148879];return _0x4f7027;};'use strict';var rp=require(_0xa91f('0x0'));var util=require(_0xa91f('0x1'));var _=require(_0xa91f('0x2'));var Mustache=require(_0xa91f('0x3'));var logger=require(_0xa91f('0x4'))(_0xa91f('0x5'));exports[_0xa91f('0x6')]=function(_0x488c16,_0x1986fe){var _0x494993,_0x5ef000;var _0x45f4f8={'method':_0x488c16[_0xa91f('0x7')][_0xa91f('0x8')](),'uri':Mustache[_0xa91f('0x9')](_0x488c16[_0xa91f('0xa')],_0x1986fe),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x488c16[_0xa91f('0xb')])===_0xa91f('0xc')&&parseInt(_0x488c16['data5'])>=0x1&&parseInt(_0x488c16[_0xa91f('0xb')])<=0xa?parseInt(_0x488c16['data5'])*0x3e8:0x5*0x3e8};try{_0x45f4f8[_0xa91f('0xd')]=_0x488c16[_0xa91f('0xe')]?JSON[_0xa91f('0xf')](Mustache['render'](_0x488c16[_0xa91f('0xe')],_0x1986fe)):{};}catch(_0x282584){logger[_0xa91f('0x10')](_0x282584['stack']);}switch(_0x488c16['data1'][_0xa91f('0x8')]()){case _0xa91f('0x11'):case'DELETE':_0x494993=null;_0x45f4f8['qs']=_0x1986fe;break;case _0xa91f('0x12'):case _0xa91f('0x13'):if(_0x488c16[_0xa91f('0x14')]){try{_0x494993=JSON[_0xa91f('0xf')](Mustache['render'](_0x488c16[_0xa91f('0x14')],_0x1986fe));_0x45f4f8[_0xa91f('0x15')]=_0x494993;}catch(_0x239b7a){logger[_0xa91f('0x10')](_0x239b7a[_0xa91f('0x16')]);logger['error'](_0xa91f('0x17'));}}else{_0x494993=_0x1986fe;_0x45f4f8[_0xa91f('0x15')]=_0x494993;}break;}logger['info'](util[_0xa91f('0x18')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x488c16[_0xa91f('0x7')],_0x488c16['data2'],JSON['stringify'](_0x45f4f8)));rp(_0x45f4f8)[_0xa91f('0x19')](function(_0x2fbd34){_0x494993=!_[_0xa91f('0x1a')](_0x494993)?',\x20request\x20body:\x20'+_0x494993:'';_0x5ef000=typeof _0x2fbd34[_0xa91f('0x15')]===_0xa91f('0x1b')?JSON[_0xa91f('0x1c')](_0x2fbd34[_0xa91f('0x15')]):_0x2fbd34[_0xa91f('0x15')];logger[_0xa91f('0x1d')](util['format'](_0xa91f('0x1e'),_0x488c16[_0xa91f('0x7')],_0x488c16['data2'],_0x2fbd34['statusCode'],_0x5ef000));})[_0xa91f('0x1f')](function(_0x385f34){logger[_0xa91f('0x10')](util[_0xa91f('0x18')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x488c16[_0xa91f('0x7')],_0x488c16[_0xa91f('0xa')],_0x385f34[_0xa91f('0x20')],_0x385f34['name'],_0x385f34[_0xa91f('0x21')]));});}; \ No newline at end of file +var _0x7aa2=['stack','data1','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','isNil','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','../../../../config/logger','toUpperCase','render','data2','data5','number','data6','parse','error'];(function(_0x5c5b0e,_0x583e3c){var _0x28e2c9=function(_0x209f7d){while(--_0x209f7d){_0x5c5b0e['push'](_0x5c5b0e['shift']());}};_0x28e2c9(++_0x583e3c);}(_0x7aa2,0xfa));var _0x27aa=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x7aa2[_0x399d76];return _0x3b19a1;};'use strict';var rp=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x27aa('0x2'))('trigger');exports['exec']=function(_0x23dec8,_0x279fbe){var _0x18fd6f,_0x248009;var _0x3cd7ae={'method':_0x23dec8['data1'][_0x27aa('0x3')](),'uri':Mustache[_0x27aa('0x4')](_0x23dec8[_0x27aa('0x5')],_0x279fbe),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x23dec8[_0x27aa('0x6')])===_0x27aa('0x7')&&parseInt(_0x23dec8['data5'])>=0x1&&parseInt(_0x23dec8[_0x27aa('0x6')])<=0xa?parseInt(_0x23dec8[_0x27aa('0x6')])*0x3e8:0x5*0x3e8};try{_0x3cd7ae['headers']=_0x23dec8[_0x27aa('0x8')]?JSON[_0x27aa('0x9')](Mustache[_0x27aa('0x4')](_0x23dec8[_0x27aa('0x8')],_0x279fbe)):{};}catch(_0x3c23c7){logger[_0x27aa('0xa')](_0x3c23c7[_0x27aa('0xb')]);}switch(_0x23dec8[_0x27aa('0xc')][_0x27aa('0x3')]()){case _0x27aa('0xd'):case'DELETE':_0x18fd6f=null;_0x3cd7ae['qs']=_0x279fbe;break;case _0x27aa('0xe'):case _0x27aa('0xf'):if(_0x23dec8['data7']){try{_0x18fd6f=JSON[_0x27aa('0x9')](Mustache[_0x27aa('0x4')](_0x23dec8[_0x27aa('0x10')],_0x279fbe));_0x3cd7ae[_0x27aa('0x11')]=_0x18fd6f;}catch(_0x1f3d36){logger[_0x27aa('0xa')](_0x1f3d36[_0x27aa('0xb')]);logger[_0x27aa('0xa')](_0x27aa('0x12'));}}else{_0x18fd6f=_0x279fbe;_0x3cd7ae['body']=_0x18fd6f;}break;}logger[_0x27aa('0x13')](util[_0x27aa('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x23dec8[_0x27aa('0xc')],_0x23dec8[_0x27aa('0x5')],JSON['stringify'](_0x3cd7ae)));rp(_0x3cd7ae)['then'](function(_0x92a2c3){_0x18fd6f=!_[_0x27aa('0x15')](_0x18fd6f)?',\x20request\x20body:\x20'+_0x18fd6f:'';_0x248009=typeof _0x92a2c3[_0x27aa('0x11')]===_0x27aa('0x16')?JSON[_0x27aa('0x17')](_0x92a2c3[_0x27aa('0x11')]):_0x92a2c3[_0x27aa('0x11')];logger[_0x27aa('0x13')](util[_0x27aa('0x14')](_0x27aa('0x18'),_0x23dec8[_0x27aa('0xc')],_0x23dec8[_0x27aa('0x5')],_0x92a2c3[_0x27aa('0x19')],_0x248009));})[_0x27aa('0x1a')](function(_0x42a5de){logger[_0x27aa('0xa')](util[_0x27aa('0x14')](_0x27aa('0x1b'),_0x23dec8['data1'],_0x23dec8[_0x27aa('0x5')],_0x42a5de['statusCode'],_0x42a5de['name'],_0x42a5de[_0x27aa('0x1c')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5108c57..65e62b1 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 _0x2221=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2221,0xc0));var _0x1222=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2221[_0x2b4411];return _0x8e41ef;};'use strict';var jayson=require(_0x1222('0x0'));var BPromise=require(_0x1222('0x1'));var logger=require(_0x1222('0x2'))(_0x1222('0x3'));var client=jayson[_0x1222('0x4')][_0x1222('0x5')]({'port':0x2329});client['Request']=function(_0x1a807b,_0x262fa7){return new BPromise(function(_0x3dea2a,_0x511ff5){return client[_0x1222('0x6')](_0x1a807b,_0x262fa7)[_0x1222('0x7')](function(_0x450fad){logger[_0x1222('0x8')](_0x1222('0x9'),'routing',_0x1a807b,_0x262fa7,_0x450fad);if(_0x450fad[_0x1222('0xa')]){logger[_0x1222('0xa')](_0x1222('0x9'),_0x1222('0x3'),_0x1a807b,_0x450fad['error'][_0x1222('0xb')],_0x262fa7);return _0x511ff5(_0x450fad[_0x1222('0xa')][_0x1222('0xb')]);}else{return _0x3dea2a(_0x450fad[_0x1222('0xc')]);}})[_0x1222('0xd')](function(_0x4f1e50){logger[_0x1222('0xa')](_0x1222('0x9'),_0x1222('0x3'),_0x1a807b,_0x4f1e50,_0x262fa7);return _0x511ff5(_0x4f1e50);});});};module[_0x1222('0xe')]=client; \ No newline at end of file +var _0x5a1e=['then','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x358c67,_0x5c9ce9){var _0x2c8532=function(_0x17734e){while(--_0x17734e){_0x358c67['push'](_0x358c67['shift']());}};_0x2c8532(++_0x5c9ce9);}(_0x5a1e,0x130));var _0xe5a1=function(_0x6949f1,_0x106daa){_0x6949f1=_0x6949f1-0x0;var _0x2d7590=_0x5a1e[_0x6949f1];return _0x2d7590;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe5a1('0x0'));var logger=require(_0xe5a1('0x1'))(_0xe5a1('0x2'));var client=jayson[_0xe5a1('0x3')]['http']({'port':0x2329});client['Request']=function(_0x39e680,_0x1ab6ea){return new BPromise(function(_0x55dbd2,_0x490ce8){return client['request'](_0x39e680,_0x1ab6ea)[_0xe5a1('0x4')](function(_0x29b1a3){logger['debug'](_0xe5a1('0x5'),_0xe5a1('0x2'),_0x39e680,_0x1ab6ea,_0x29b1a3);if(_0x29b1a3[_0xe5a1('0x6')]){logger['error'](_0xe5a1('0x5'),'routing',_0x39e680,_0x29b1a3[_0xe5a1('0x6')][_0xe5a1('0x7')],_0x1ab6ea);return _0x490ce8(_0x29b1a3['error']['message']);}else{return _0x55dbd2(_0x29b1a3[_0xe5a1('0x8')]);}})[_0xe5a1('0x9')](function(_0x4498ed){logger[_0xe5a1('0x6')](_0xe5a1('0x5'),'routing',_0x39e680,_0x4498ed,_0x1ab6ea);return _0x490ce8(_0x4498ed);});});};module[_0xe5a1('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d7df596..36dbf0f 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 _0x80b9=['catch','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','loginMailFrequency'];(function(_0xb36ab4,_0x5ddbe1){var _0x1d75a9=function(_0x4a6be9){while(--_0x4a6be9){_0xb36ab4['push'](_0xb36ab4['shift']());}};_0x1d75a9(++_0x5ddbe1);}(_0x80b9,0x142));var _0x980b=function(_0x2663db,_0x3e9a78){_0x2663db=_0x2663db-0x0;var _0x17ce1a=_0x80b9[_0x2663db];return _0x17ce1a;};'use strict';var server=require(_0x980b('0x0'));var Realtime=require(_0x980b('0x1'));var EmailChannel=require(_0x980b('0x2'));var mailAccount=require(_0x980b('0x3'));var setting=require(_0x980b('0x4'));var logger=require('../../config/logger')(_0x980b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x980b('0x6')]()[_0x980b('0x7')](mailAccount[_0x980b('0x8')]())[_0x980b('0x7')](realtime[_0x980b('0x9')]())[_0x980b('0x7')](function(){email[_0x980b('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x980b('0xb')](realtime,email)[_0x980b('0x7')](function(){return initRealtime();})[_0x980b('0x7')](function(){return setting[_0x980b('0xc')]();})[_0x980b('0x7')](function(_0x2c1a25){return setInterval(initRealtime,_0x2c1a25[_0x980b('0xd')]*0x3e8);})[_0x980b('0xe')](function(_0x3aa0b9){logger[_0x980b('0xf')]('Email\x20service\x20initialization',_0x3aa0b9);});}main(); \ No newline at end of file +var _0xb681=['refresh','mailAccounts','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts'];(function(_0x46a355,_0x1b5f1a){var _0x60e91e=function(_0x528faf){while(--_0x528faf){_0x46a355['push'](_0x46a355['shift']());}};_0x60e91e(++_0x1b5f1a);}(_0xb681,0xc8));var _0x1b68=function(_0x2bf9ed,_0x1b4a6a){_0x2bf9ed=_0x2bf9ed-0x0;var _0xc43470=_0xb681[_0x2bf9ed];return _0xc43470;};'use strict';var server=require(_0x1b68('0x0'));var Realtime=require(_0x1b68('0x1'));var EmailChannel=require(_0x1b68('0x2'));var mailAccount=require(_0x1b68('0x3'));var setting=require(_0x1b68('0x4'));var logger=require(_0x1b68('0x5'))(_0x1b68('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x1b68('0x7')](mailAccount[_0x1b68('0x8')]())[_0x1b68('0x7')](realtime[_0x1b68('0x9')]())['then'](function(){email[_0x1b68('0xa')](realtime[_0x1b68('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x1b68('0x7')](function(){return setting[_0x1b68('0xc')]();})['then'](function(_0xe89a46){return setInterval(initRealtime,_0xe89a46[_0x1b68('0xd')]*0x3e8);})[_0x1b68('0xe')](function(_0x168a09){logger['error']('Email\x20service\x20initialization',_0x168a09);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4624ffe..373db19 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 _0x6993=['handleImapEnd','error','isNil','disabled','connected','messages','emit','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','Smtp','verify','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','name','active','Imap','status','messageStatus','total','stringify','md5','refresh','service','provider','custom','imapAccounts','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6993,0x7c));var _0x3699=function(_0x316b3e,_0x47b154){_0x316b3e=_0x316b3e-0x0;var _0x45ba95=_0x6993[_0x316b3e];return _0x45ba95;};'use strict';var _=require(_0x3699('0x0'));var moment=require(_0x3699('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x3699('0x2'));var config=require(_0x3699('0x3'));var logger=require(_0x3699('0x4'))('email');config[_0x3699('0x5')]=_['defaults'](config[_0x3699('0x5')],{'host':_0x3699('0x6'),'port':0x18eb});var io=require(_0x3699('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x3699('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3699('0x9'));var md5Accounts={};function EmailChannel(_0x333228){logger[_0x3699('0xa')](_0x3699('0xb'));this[_0x3699('0xc')]=_0x333228['mailAccounts'];this['imapAccounts']={};this[_0x3699('0xd')]=new EmailSmtp();}EmailChannel[_0x3699('0xe')]['emit']=function(_0x222dc0){var _0x32bf58=this[_0x3699('0xc')][_0x222dc0];var _0x353a6d={'id':_0x32bf58['id'],'name':_0x32bf58[_0x3699('0xf')],'key':_0x32bf58['key'],'active':_0x32bf58[_0x3699('0x10')],'Imap':{'status':_0x32bf58[_0x3699('0x11')][_0x3699('0x12')],'messageStatus':_0x32bf58['Imap'][_0x3699('0x13')],'total':_0x32bf58[_0x3699('0x11')][_0x3699('0x14')]}};if(_['isNil'](md5Accounts[_0x222dc0])){md5Accounts[_0x222dc0]={};}var _0xede5dc=md5(JSON[_0x3699('0x15')](_0x353a6d));if(md5Accounts[_0x222dc0][_0x3699('0x16')]!==_0xede5dc){md5Accounts[_0x222dc0][_0x3699('0x16')]=_0xede5dc;io['emit']('mailAccount:update',_0x353a6d);}};EmailChannel['prototype'][_0x3699('0x17')]=function(_0x572de6){for(var _0x17d011 in _0x572de6){if(_0x572de6['hasOwnProperty'](_0x17d011)){if(_0x572de6[_0x17d011][_0x3699('0x11')]&&_0x572de6[_0x17d011][_0x3699('0x10')]){var _0x105a65=_0x572de6[_0x17d011][_0x3699('0x11')];if(!_0x105a65[_0x3699('0x18')]&&_0x572de6[_0x17d011][_0x3699('0x19')]!==_0x3699('0x1a'))_0x105a65[_0x3699('0x18')]=_0x572de6[_0x17d011][_0x3699('0x19')];if(!this[_0x3699('0x1b')][_0x3699('0x1c')](_0x105a65['id'])){this[_0x3699('0x1b')][_0x105a65['id']]=new EmailImap(_0x105a65,_0x572de6[_0x17d011][_0x3699('0x1d')]);this[_0x3699('0x1b')][_0x105a65['id']]['on'](_0x3699('0x1e'),this[_0x3699('0x1f')][_0x3699('0x20')](this,_0x17d011));this[_0x3699('0x1b')][_0x105a65['id']]['on'](_0x3699('0x1d'),this[_0x3699('0x21')][_0x3699('0x20')](this,_0x17d011));this[_0x3699('0x1b')][_0x105a65['id']]['on'](_0x3699('0x22'),this[_0x3699('0x23')]['bind'](this,_0x17d011));this[_0x3699('0x1b')][_0x105a65['id']]['on'](_0x3699('0x24'),this['handleImapError'][_0x3699('0x20')](this,_0x17d011));}}else{if(_[_0x3699('0x25')](this['mailAccounts'][_0x17d011]['Imap'])){this[_0x3699('0xc')][_0x17d011][_0x3699('0x11')]={};}this[_0x3699('0xc')][_0x17d011][_0x3699('0x11')][_0x3699('0x12')]=_0x3699('0x26');this[_0x3699('0xc')][_0x17d011][_0x3699('0x11')][_0x3699('0x13')]='';this['emit'](_0x17d011);}}}};EmailChannel[_0x3699('0xe')][_0x3699('0x1f')]=function(_0xf4dd20,_0x42bd3b){if(this['mailAccounts'][_0xf4dd20]){this[_0x3699('0xc')][_0xf4dd20][_0x3699('0x11')][_0x3699('0x12')]=_0x3699('0x27');this[_0x3699('0xc')][_0xf4dd20][_0x3699('0x11')][_0x3699('0x13')]=_0x42bd3b[_0x3699('0xf')];if(_0x42bd3b[_0x3699('0x28')]){this[_0x3699('0xc')][_0xf4dd20]['Imap'][_0x3699('0x14')]=_0x42bd3b[_0x3699('0x28')]['total'];}return this[_0x3699('0x29')](_0xf4dd20);}};EmailChannel[_0x3699('0xe')][_0x3699('0x21')]=function(_0x3443cb,_0x4c690e){logger[_0x3699('0xa')](_0x3699('0x2a'),_0x4c690e['firstName'],_0x4c690e[_0x3699('0x2b')],_0x4c690e['from'],_0x3443cb);if(this['mailAccounts'][_0x3443cb]){return mailAccount[_0x3699('0x2c')](_0x3443cb,_0x4c690e)[_0x3699('0x2d')](function(_0x3226fb){if(_0x3226fb){logger[_0x3699('0xa')](_0x3699('0x2e'));}})[_0x3699('0x2f')](function(_0x27b3e9){logger['error'](_0x3699('0x30'),JSON[_0x3699('0x15')](_0x27b3e9));});}};EmailChannel[_0x3699('0xe')][_0x3699('0x23')]=function(_0x84be76){if(this[_0x3699('0xc')][_0x84be76]&&this[_0x3699('0xc')][_0x84be76][_0x3699('0x11')]){if(this['imapAccounts'][this['mailAccounts'][_0x84be76]['Imap']['id']]){delete this[_0x3699('0x1b')][this['mailAccounts'][_0x84be76][_0x3699('0x11')]['id']];}this[_0x3699('0xc')][_0x84be76]['Imap']['lastSync']=moment();this[_0x3699('0x29')](_0x84be76);}};EmailChannel[_0x3699('0xe')]['handleImapError']=function(_0x2110c7,_0x4dd7b2){if(this[_0x3699('0xc')][_0x2110c7]){this[_0x3699('0xc')][_0x2110c7][_0x3699('0x11')][_0x3699('0x12')]=_0x3699('0x24');this[_0x3699('0xc')][_0x2110c7]['Imap'][_0x3699('0x13')]=_0x4dd7b2;return this[_0x3699('0x29')](_0x2110c7);}};EmailChannel[_0x3699('0xe')][_0x3699('0x31')]=function(_0x2299d4,_0x45d678){return this[_0x3699('0xd')]['send'](_0x2299d4,_0x45d678);};EmailChannel[_0x3699('0xe')]['verifySmtp']=function(_0x1ca93d){var _0x37c1cc=this;if(this[_0x3699('0xc')][_0x1ca93d['id']]){if(_[_0x3699('0x25')](this[_0x3699('0xc')][_0x1ca93d['id']][_0x3699('0x32')])){this[_0x3699('0xc')][_0x1ca93d['id']][_0x3699('0x32')]={};}this['mailAccounts'][_0x1ca93d['id']][_0x3699('0x32')]['lastSync']=moment();return new BPromise(function(_0x1fe7d3,_0x55627e){return _0x37c1cc[_0x3699('0xd')][_0x3699('0x33')](_0x1ca93d)[_0x3699('0x2d')](function(_0x509856){_0x37c1cc[_0x3699('0xc')][_0x1ca93d['id']][_0x3699('0x32')]['status']='verified';_0x37c1cc[_0x3699('0xc')][_0x1ca93d['id']][_0x3699('0x32')][_0x3699('0x13')]='';_0x37c1cc[_0x3699('0x29')](_0x1ca93d['id']);_0x1fe7d3(_0x509856);})[_0x3699('0x2f')](function(_0x4514ee){_0x37c1cc[_0x3699('0xc')][_0x1ca93d['id']][_0x3699('0x32')][_0x3699('0x12')]=_0x3699('0x24');_0x37c1cc[_0x3699('0xc')][_0x1ca93d['id']]['Smtp'][_0x3699('0x13')]=_0x4514ee;_0x37c1cc['emit'](_0x1ca93d['id']);_0x55627e(_0x4514ee);});});}return this['smtp'][_0x3699('0x33')](_0x1ca93d);};module[_0x3699('0x34')]=EmailChannel; \ No newline at end of file +var _0xc2a5=['connected','messages','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','error','handleImapEnd','lastSync','verifySmtp','Smtp','catch','verify','exports','moment','bluebird','md5','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','hasOwnProperty','active','service','custom','provider','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapError','disabled'];(function(_0x3bf270,_0x565421){var _0x26ec83=function(_0x27633a){while(--_0x27633a){_0x3bf270['push'](_0x3bf270['shift']());}};_0x26ec83(++_0x565421);}(_0xc2a5,0x11a));var _0x5c2a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc2a5[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var moment=require(_0x5c2a('0x0'));var BPromise=require(_0x5c2a('0x1'));var md5=require(_0x5c2a('0x2'));var Redis=require('ioredis');var config=require(_0x5c2a('0x3'));var logger=require('../../../config/logger')(_0x5c2a('0x4'));config[_0x5c2a('0x5')]=_[_0x5c2a('0x6')](config[_0x5c2a('0x5')],{'host':_0x5c2a('0x7'),'port':0x18eb});var io=require(_0x5c2a('0x8'))(new Redis(config[_0x5c2a('0x5')]));var EmailImap=require(_0x5c2a('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5c7600){logger['info'](_0x5c2a('0xa'));this['mailAccounts']=_0x5c7600[_0x5c2a('0xb')];this['imapAccounts']={};this[_0x5c2a('0xc')]=new EmailSmtp();}EmailChannel[_0x5c2a('0xd')][_0x5c2a('0xe')]=function(_0x56fa2f){var _0x2f29e5=this[_0x5c2a('0xb')][_0x56fa2f];var _0x960152={'id':_0x2f29e5['id'],'name':_0x2f29e5[_0x5c2a('0xf')],'key':_0x2f29e5['key'],'active':_0x2f29e5['active'],'Imap':{'status':_0x2f29e5[_0x5c2a('0x10')][_0x5c2a('0x11')],'messageStatus':_0x2f29e5[_0x5c2a('0x10')][_0x5c2a('0x12')],'total':_0x2f29e5[_0x5c2a('0x10')][_0x5c2a('0x13')]}};if(_[_0x5c2a('0x14')](md5Accounts[_0x56fa2f])){md5Accounts[_0x56fa2f]={};}var _0x1f3961=md5(JSON[_0x5c2a('0x15')](_0x960152));if(md5Accounts[_0x56fa2f]['md5']!==_0x1f3961){md5Accounts[_0x56fa2f][_0x5c2a('0x2')]=_0x1f3961;io['emit'](_0x5c2a('0x16'),_0x960152);}};EmailChannel['prototype']['refresh']=function(_0x31d874){for(var _0x393495 in _0x31d874){if(_0x31d874[_0x5c2a('0x17')](_0x393495)){if(_0x31d874[_0x393495][_0x5c2a('0x10')]&&_0x31d874[_0x393495][_0x5c2a('0x18')]){var _0x528e1b=_0x31d874[_0x393495]['Imap'];if(!_0x528e1b[_0x5c2a('0x19')]&&_0x31d874[_0x393495]['provider']!==_0x5c2a('0x1a'))_0x528e1b[_0x5c2a('0x19')]=_0x31d874[_0x393495][_0x5c2a('0x1b')];if(!this[_0x5c2a('0x1c')][_0x5c2a('0x17')](_0x528e1b['id'])){this['imapAccounts'][_0x528e1b['id']]=new EmailImap(_0x528e1b,_0x31d874[_0x393495][_0x5c2a('0x4')]);this[_0x5c2a('0x1c')][_0x528e1b['id']]['on'](_0x5c2a('0x1d'),this[_0x5c2a('0x1e')][_0x5c2a('0x1f')](this,_0x393495));this[_0x5c2a('0x1c')][_0x528e1b['id']]['on'](_0x5c2a('0x4'),this[_0x5c2a('0x20')]['bind'](this,_0x393495));this[_0x5c2a('0x1c')][_0x528e1b['id']]['on'](_0x5c2a('0x21'),this['handleImapEnd'][_0x5c2a('0x1f')](this,_0x393495));this[_0x5c2a('0x1c')][_0x528e1b['id']]['on']('error',this[_0x5c2a('0x22')]['bind'](this,_0x393495));}}else{if(_[_0x5c2a('0x14')](this[_0x5c2a('0xb')][_0x393495][_0x5c2a('0x10')])){this[_0x5c2a('0xb')][_0x393495][_0x5c2a('0x10')]={};}this[_0x5c2a('0xb')][_0x393495]['Imap'][_0x5c2a('0x11')]=_0x5c2a('0x23');this[_0x5c2a('0xb')][_0x393495][_0x5c2a('0x10')][_0x5c2a('0x12')]='';this[_0x5c2a('0xe')](_0x393495);}}}};EmailChannel[_0x5c2a('0xd')][_0x5c2a('0x1e')]=function(_0x395fbc,_0x2b5fb0){if(this[_0x5c2a('0xb')][_0x395fbc]){this[_0x5c2a('0xb')][_0x395fbc]['Imap']['status']=_0x5c2a('0x24');this['mailAccounts'][_0x395fbc][_0x5c2a('0x10')][_0x5c2a('0x12')]=_0x2b5fb0[_0x5c2a('0xf')];if(_0x2b5fb0['messages']){this[_0x5c2a('0xb')][_0x395fbc][_0x5c2a('0x10')][_0x5c2a('0x13')]=_0x2b5fb0[_0x5c2a('0x25')][_0x5c2a('0x13')];}return this[_0x5c2a('0xe')](_0x395fbc);}};EmailChannel['prototype'][_0x5c2a('0x20')]=function(_0x46d9a9,_0x29c55b){logger[_0x5c2a('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x29c55b[_0x5c2a('0x27')],_0x29c55b[_0x5c2a('0x28')],_0x29c55b[_0x5c2a('0x29')],_0x46d9a9);if(this['mailAccounts'][_0x46d9a9]){return mailAccount[_0x5c2a('0x2a')](_0x46d9a9,_0x29c55b)[_0x5c2a('0x2b')](function(_0x197e04){if(_0x197e04){logger[_0x5c2a('0x26')](_0x5c2a('0x2c'));}})['catch'](function(_0x1d67b2){logger[_0x5c2a('0x2d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x1d67b2));});}};EmailChannel['prototype'][_0x5c2a('0x2e')]=function(_0x50eaa2){if(this[_0x5c2a('0xb')][_0x50eaa2]&&this[_0x5c2a('0xb')][_0x50eaa2][_0x5c2a('0x10')]){if(this[_0x5c2a('0x1c')][this[_0x5c2a('0xb')][_0x50eaa2][_0x5c2a('0x10')]['id']]){delete this[_0x5c2a('0x1c')][this[_0x5c2a('0xb')][_0x50eaa2][_0x5c2a('0x10')]['id']];}this[_0x5c2a('0xb')][_0x50eaa2][_0x5c2a('0x10')][_0x5c2a('0x2f')]=moment();this['emit'](_0x50eaa2);}};EmailChannel[_0x5c2a('0xd')][_0x5c2a('0x22')]=function(_0x7c07b0,_0x2a1f56){if(this['mailAccounts'][_0x7c07b0]){this[_0x5c2a('0xb')][_0x7c07b0][_0x5c2a('0x10')][_0x5c2a('0x11')]=_0x5c2a('0x2d');this['mailAccounts'][_0x7c07b0]['Imap'][_0x5c2a('0x12')]=_0x2a1f56;return this['emit'](_0x7c07b0);}};EmailChannel[_0x5c2a('0xd')]['sendMail']=function(_0x31e62e,_0x2e5747){return this[_0x5c2a('0xc')]['send'](_0x31e62e,_0x2e5747);};EmailChannel['prototype'][_0x5c2a('0x30')]=function(_0xb6a43e){var _0x25321a=this;if(this[_0x5c2a('0xb')][_0xb6a43e['id']]){if(_[_0x5c2a('0x14')](this['mailAccounts'][_0xb6a43e['id']][_0x5c2a('0x31')])){this[_0x5c2a('0xb')][_0xb6a43e['id']][_0x5c2a('0x31')]={};}this[_0x5c2a('0xb')][_0xb6a43e['id']][_0x5c2a('0x31')][_0x5c2a('0x2f')]=moment();return new BPromise(function(_0x4b14c6,_0x32b19f){return _0x25321a[_0x5c2a('0xc')]['verify'](_0xb6a43e)[_0x5c2a('0x2b')](function(_0x4616b8){_0x25321a[_0x5c2a('0xb')][_0xb6a43e['id']][_0x5c2a('0x31')][_0x5c2a('0x11')]='verified';_0x25321a['mailAccounts'][_0xb6a43e['id']][_0x5c2a('0x31')][_0x5c2a('0x12')]='';_0x25321a['emit'](_0xb6a43e['id']);_0x4b14c6(_0x4616b8);})[_0x5c2a('0x32')](function(_0x2658ed){_0x25321a['mailAccounts'][_0xb6a43e['id']]['Smtp'][_0x5c2a('0x11')]='error';_0x25321a[_0x5c2a('0xb')][_0xb6a43e['id']][_0x5c2a('0x31')][_0x5c2a('0x12')]=_0x2658ed;_0x25321a['emit'](_0xb6a43e['id']);_0x32b19f(_0x2658ed);});});}return this['smtp'][_0x5c2a('0x33')](_0xb6a43e);};module[_0x5c2a('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 66903a0..04f4054 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 _0x4819=['host','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','email','stringify','textCode','upperFirst','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','once','handleReady','end','handleEnd','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','password','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','data5'];(function(_0x4cb106,_0x177ed9){var _0x425d5c=function(_0x28ffbc){while(--_0x28ffbc){_0x4cb106['push'](_0x4cb106['shift']());}};_0x425d5c(++_0x177ed9);}(_0x4819,0xcd));var _0x9481=function(_0x392ca0,_0x41916f){_0x392ca0=_0x392ca0-0x0;var _0x289124=_0x4819[_0x392ca0];return _0x289124;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var Imap=require(_0x9481('0x1'));var simpleParser=require(_0x9481('0x2'))[_0x9481('0x3')];var Iconv=require(_0x9481('0x4'))[_0x9481('0x5')];var EventEmitter=require(_0x9481('0x6'))[_0x9481('0x7')];var utils=require(_0x9481('0x8'));var logger=require(_0x9481('0x9'))('email');function EmailImap(_0x4d9e3a,_0x5def07){this['mailbox']=_0x9481('0xa');this[_0x9481('0xb')]=this[_0x9481('0xc')](_0x4d9e3a,_0x5def07);this[_0x9481('0x1')]=new Imap(this[_0x9481('0xb')]);this['imap'][_0x9481('0xd')]('ready',this[_0x9481('0xe')]['bind'](this));this[_0x9481('0x1')][_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x10')][_0x9481('0x11')](this));this[_0x9481('0x1')]['on'](_0x9481('0x12'),this[_0x9481('0x13')][_0x9481('0x11')](this));this['imap']['connect']();}util[_0x9481('0x14')](EmailImap,EventEmitter);EmailImap[_0x9481('0x15')][_0x9481('0xc')]=function(_0x28fcb6,_0x3d23c2){var _0xc7a0b5={'connTimeout':_0x28fcb6[_0x9481('0x16')]?_0x28fcb6['connTimeout']*0x3e8:0x2710,'authTimeout':_0x28fcb6[_0x9481('0x17')]?_0x28fcb6[_0x9481('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x28fcb6[_0x9481('0x18')])){if(_0x28fcb6['authentication']){_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6[_0x9481('0x1a')];}_0xc7a0b5['host']=_0x28fcb6['host'];_0xc7a0b5[_0x9481('0x1b')]=_0x28fcb6['port']||0x3e1;if(_0x28fcb6['tls']){_0xc7a0b5[_0x9481('0x1c')]=!![];}else{_0xc7a0b5[_0x9481('0x1c')]=![];_0xc7a0b5[_0x9481('0x1d')]=_0x9481('0x1e');}}else{if(_0x28fcb6[_0x9481('0x1f')]){_0xc7a0b5[_0x9481('0x20')]=utils['generateXOAuth2Token'](_0x28fcb6[_0x9481('0x21')][_0x9481('0x22')],_0x28fcb6[_0x9481('0x19')]);_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];}else{_0xc7a0b5['user']=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6['password'];}_0xc7a0b5[_0x9481('0x23')]=utils[_0x9481('0x24')](_0x28fcb6[_0x9481('0x18')]);_0xc7a0b5[_0x9481('0x1b')]=0x3e1;_0xc7a0b5[_0x9481('0x1c')]=!![];}_0xc7a0b5['email']=_0x3d23c2||_0x28fcb6[_0x9481('0x19')]||_0x9481('0x25');return _0xc7a0b5;};EmailImap['prototype']['handleReady']=function(){this[_0x9481('0x1')][_0x9481('0x26')](this['mailbox'],![],this[_0x9481('0x27')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x27')]=function(_0x5a1300,_0x14f03e){if(_0x5a1300){this[_0x9481('0x13')](_0x5a1300,!![]);}else{this[_0x9481('0x28')]('box',_0x14f03e);this[_0x9481('0x29')]();}};EmailImap['prototype'][_0x9481('0x2a')]=function(_0xe153ab){if(_0xe153ab){this[_0x9481('0x13')](_0xe153ab,!![]);}else{this[_0x9481('0x1')][_0x9481('0xf')]();}};EmailImap['prototype'][_0x9481('0x29')]=function(){this[_0x9481('0x1')][_0x9481('0x2b')](['UNSEEN'],this['handleReadUnseen'][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2c')]=function(_0x2b33f8,_0x5d9926){if(_0x2b33f8){this['handleError'](_0x2b33f8,!![]);}else{if(_0x5d9926['length']){try{var _0x29e6b6=this['imap'][_0x9481('0x2d')](_0x5d9926,{'bodies':'','markSeen':!![]});_0x29e6b6['on']('message',this[_0x9481('0x2e')][_0x9481('0x11')](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0x12'),this[_0x9481('0x2f')]['bind'](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x30')]['bind'](this));}catch(_0x30063f){logger[_0x9481('0x12')](_0x30063f);}}else{this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));}}};EmailImap['prototype'][_0x9481('0x2e')]=function(_0x53af85){_0x53af85['on'](_0x9481('0x32'),this[_0x9481('0x33')][_0x9481('0x11')](this));_0x53af85[_0x9481('0xd')](_0x9481('0x34'),this[_0x9481('0x35')]['bind'](this));_0x53af85[_0x9481('0xd')](_0x9481('0xf'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x9481('0x15')]['handleMessageBody']=function(_0x224b88){simpleParser(_0x224b88,{'Iconv':Iconv},this[_0x9481('0x36')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x9481('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x9481('0x15')]['handleSimpleParser']=function(_0x2ce972,_0x4d6a13){if(_0x2ce972){logger[_0x9481('0x12')](_0x2ce972);}else{var _0x22e916=this;utils[_0x9481('0x37')](this[_0x9481('0xb')],_0x4d6a13,function(_0x97dc3e){_0x22e916[_0x9481('0x28')](_0x9481('0x38'),_0x97dc3e);});}};EmailImap['prototype'][_0x9481('0x30')]=function(){this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2f')]=function(_0x4e081d){this[_0x9481('0x13')](_0x4e081d);this[_0x9481('0x1')]['closeBox'](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x10')]=function(){this[_0x9481('0x28')]('end');};EmailImap[_0x9481('0x15')]['handleError']=function(_0x23811a,_0xcc7f31){logger['error']('handleError',this[_0x9481('0xb')][_0x9481('0x38')],JSON[_0x9481('0x39')](_0x23811a));var _0x4c4caf='';if(_0x23811a){if(_0x23811a[_0x9481('0x3a')]){_0x4c4caf=_0x23811a[_0x9481('0x3a')];}else{for(var _0x5502ad in _0x23811a){if(_0x23811a['hasOwnProperty'](_0x5502ad)){_0x4c4caf+=_[_0x9481('0x3b')](_0x5502ad)+':\x20'+_0x23811a[_0x5502ad]+'\x0a';}}}}if(_0xcc7f31){this['imap'][_0x9481('0xf')]();}else{this[_0x9481('0x28')](_0x9481('0x12'),_0x4c4caf);this[_0x9481('0x28')](_0x9481('0xf'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xeff8=['port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','email','handleFetchEnd','handleCloseBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','getAccount','imap','account','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host'];(function(_0x41604c,_0x3fb07c){var _0x1ea71a=function(_0x2c3ec2){while(--_0x2c3ec2){_0x41604c['push'](_0x41604c['shift']());}};_0x1ea71a(++_0x3fb07c);}(_0xeff8,0x186));var _0x8eff=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xeff8[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var Imap=require('imap');var simpleParser=require(_0x8eff('0x2'))[_0x8eff('0x3')];var Iconv=require(_0x8eff('0x4'))['Iconv'];var EventEmitter=require(_0x8eff('0x5'))[_0x8eff('0x6')];var utils=require(_0x8eff('0x7'));var logger=require(_0x8eff('0x8'))('email');function EmailImap(_0x469641,_0xb54063){this[_0x8eff('0x9')]=_0x8eff('0xa');this['account']=this[_0x8eff('0xb')](_0x469641,_0xb54063);this[_0x8eff('0xc')]=new Imap(this[_0x8eff('0xd')]);this[_0x8eff('0xc')]['once']('ready',this[_0x8eff('0xe')][_0x8eff('0xf')](this));this[_0x8eff('0xc')]['once'](_0x8eff('0x10'),this[_0x8eff('0x11')]['bind'](this));this[_0x8eff('0xc')]['on'](_0x8eff('0x12'),this['handleError']['bind'](this));this[_0x8eff('0xc')][_0x8eff('0x13')]();}util[_0x8eff('0x14')](EmailImap,EventEmitter);EmailImap[_0x8eff('0x15')][_0x8eff('0xb')]=function(_0x56efdf,_0x3e7c01){var _0x212a2e={'connTimeout':_0x56efdf[_0x8eff('0x16')]?_0x56efdf[_0x8eff('0x16')]*0x3e8:0x2710,'authTimeout':_0x56efdf[_0x8eff('0x17')]?_0x56efdf[_0x8eff('0x17')]*0x3e8:0x1388};if(_[_0x8eff('0x18')](_0x56efdf[_0x8eff('0x19')])){if(_0x56efdf[_0x8eff('0x1a')]){_0x212a2e[_0x8eff('0x1b')]=_0x56efdf[_0x8eff('0x1b')];_0x212a2e['password']=_0x56efdf[_0x8eff('0x1c')];}_0x212a2e[_0x8eff('0x1d')]=_0x56efdf[_0x8eff('0x1d')];_0x212a2e[_0x8eff('0x1e')]=_0x56efdf[_0x8eff('0x1e')]||0x3e1;if(_0x56efdf[_0x8eff('0x1f')]){_0x212a2e[_0x8eff('0x1f')]=!![];}else{_0x212a2e[_0x8eff('0x1f')]=![];_0x212a2e[_0x8eff('0x20')]=_0x8eff('0x21');}}else{if(_0x56efdf[_0x8eff('0x22')]){_0x212a2e[_0x8eff('0x23')]=utils[_0x8eff('0x24')](_0x56efdf[_0x8eff('0x25')][_0x8eff('0x26')],_0x56efdf[_0x8eff('0x1b')]);_0x212a2e['user']=_0x56efdf[_0x8eff('0x1b')];}else{_0x212a2e[_0x8eff('0x1b')]=_0x56efdf['user'];_0x212a2e[_0x8eff('0x1c')]=_0x56efdf['password'];}_0x212a2e[_0x8eff('0x1d')]=utils[_0x8eff('0x27')](_0x56efdf[_0x8eff('0x19')]);_0x212a2e[_0x8eff('0x1e')]=0x3e1;_0x212a2e[_0x8eff('0x1f')]=!![];}_0x212a2e['email']=_0x3e7c01||_0x56efdf[_0x8eff('0x1b')]||_0x8eff('0x28');return _0x212a2e;};EmailImap['prototype'][_0x8eff('0xe')]=function(){this[_0x8eff('0xc')][_0x8eff('0x29')](this[_0x8eff('0x9')],![],this[_0x8eff('0x2a')][_0x8eff('0xf')](this));};EmailImap[_0x8eff('0x15')][_0x8eff('0x2a')]=function(_0x516173,_0x3e1607){if(_0x516173){this[_0x8eff('0x2b')](_0x516173,!![]);}else{this[_0x8eff('0x2c')](_0x8eff('0x2d'),_0x3e1607);this[_0x8eff('0x2e')]();}};EmailImap[_0x8eff('0x15')]['handleCloseBox']=function(_0x4ed3b8){if(_0x4ed3b8){this[_0x8eff('0x2b')](_0x4ed3b8,!![]);}else{this[_0x8eff('0xc')][_0x8eff('0x10')]();}};EmailImap['prototype'][_0x8eff('0x2e')]=function(){this[_0x8eff('0xc')][_0x8eff('0x2f')]([_0x8eff('0x30')],this[_0x8eff('0x31')][_0x8eff('0xf')](this));};EmailImap[_0x8eff('0x15')][_0x8eff('0x31')]=function(_0x36a613,_0x1e9a8a){if(_0x36a613){this[_0x8eff('0x2b')](_0x36a613,!![]);}else{if(_0x1e9a8a[_0x8eff('0x32')]){try{var _0x5e0ecb=this[_0x8eff('0xc')][_0x8eff('0x33')](_0x1e9a8a,{'bodies':'','markSeen':!![]});_0x5e0ecb['on'](_0x8eff('0x34'),this[_0x8eff('0x35')]['bind'](this));_0x5e0ecb[_0x8eff('0x36')](_0x8eff('0x12'),this['handleFetchError']['bind'](this));_0x5e0ecb[_0x8eff('0x36')](_0x8eff('0x10'),this['handleFetchEnd']['bind'](this));}catch(_0x51ec38){logger[_0x8eff('0x12')](_0x51ec38);}}else{this['imap'][_0x8eff('0x37')](!![],this['handleCloseBox'][_0x8eff('0xf')](this));}}};EmailImap[_0x8eff('0x15')][_0x8eff('0x35')]=function(_0x1dcab3){_0x1dcab3['on'](_0x8eff('0x38'),this[_0x8eff('0x39')]['bind'](this));_0x1dcab3[_0x8eff('0x36')]('attributes',this[_0x8eff('0x3a')]['bind'](this));_0x1dcab3[_0x8eff('0x36')](_0x8eff('0x10'),this[_0x8eff('0x3b')][_0x8eff('0xf')](this));};EmailImap['prototype'][_0x8eff('0x39')]=function(_0x170a33){simpleParser(_0x170a33,{'Iconv':Iconv},this[_0x8eff('0x3c')]['bind'](this));};EmailImap[_0x8eff('0x15')][_0x8eff('0x3a')]=function(){};EmailImap[_0x8eff('0x15')][_0x8eff('0x3b')]=function(){};EmailImap[_0x8eff('0x15')][_0x8eff('0x3c')]=function(_0x29f68e,_0x26da7a){if(_0x29f68e){logger[_0x8eff('0x12')](_0x29f68e);}else{var _0x5c1277=this;utils['parser'](this[_0x8eff('0xd')],_0x26da7a,function(_0x114f8e){_0x5c1277[_0x8eff('0x2c')](_0x8eff('0x3d'),_0x114f8e);});}};EmailImap[_0x8eff('0x15')][_0x8eff('0x3e')]=function(){this[_0x8eff('0xc')]['closeBox'](!![],this[_0x8eff('0x3f')][_0x8eff('0xf')](this));};EmailImap['prototype'][_0x8eff('0x40')]=function(_0x1ad6b3){this[_0x8eff('0x2b')](_0x1ad6b3);this[_0x8eff('0xc')][_0x8eff('0x37')](!![],this[_0x8eff('0x3f')][_0x8eff('0xf')](this));};EmailImap[_0x8eff('0x15')][_0x8eff('0x11')]=function(){this['emit'](_0x8eff('0x10'));};EmailImap[_0x8eff('0x15')][_0x8eff('0x2b')]=function(_0x2fa131,_0x1a5460){logger['error'](_0x8eff('0x2b'),this['account'][_0x8eff('0x3d')],JSON[_0x8eff('0x41')](_0x2fa131));var _0x1e9d99='';if(_0x2fa131){if(_0x2fa131[_0x8eff('0x42')]){_0x1e9d99=_0x2fa131['textCode'];}else{for(var _0xa0eabb in _0x2fa131){if(_0x2fa131[_0x8eff('0x43')](_0xa0eabb)){_0x1e9d99+=_[_0x8eff('0x44')](_0xa0eabb)+':\x20'+_0x2fa131[_0xa0eabb]+'\x0a';}}}}if(_0x1a5460){this['imap']['end']();}else{this[_0x8eff('0x2c')](_0x8eff('0x12'),_0x1e9d99);this[_0x8eff('0x2c')](_0x8eff('0x10'));}};module[_0x8eff('0x45')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6229b3d..950dec7 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 _0xac1b=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac1b,0x1d1));var _0xbac1=function(_0x2ce873,_0x58d518){_0x2ce873=_0x2ce873-0x0;var _0x47e543=_0xac1b[_0x2ce873];return _0x47e543;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xbac1('0x0'));function EmailSmtp(){}EmailSmtp[_0xbac1('0x1')][_0xbac1('0x2')]=function(_0x2d8ee2,_0x12fa36){return new Promise(function(_0xd0191c,_0x2c4249){var _0x1443c6=nodemailer[_0xbac1('0x3')](_0x2d8ee2);_0x1443c6[_0xbac1('0x4')]('compile',inlineBase64());_0x1443c6[_0xbac1('0x5')](_0x12fa36,function(_0x2cb185,_0x5d0571){if(_0x2cb185){_0x2c4249(_0x2cb185[_0xbac1('0x6')]());}else{_0xd0191c(_0x5d0571);}});});};EmailSmtp[_0xbac1('0x1')][_0xbac1('0x7')]=function(_0x53b469){return new Promise(function(_0x251986,_0x1781fb){var _0x116d88=nodemailer[_0xbac1('0x3')](_0x53b469);_0x116d88['verify'](function(_0x2e0e97,_0x271091){if(_0x2e0e97){_0x1781fb(_0x2e0e97[_0xbac1('0x6')]());}else{if(_0x271091){_0x251986(_0x271091);}else{_0x1781fb(_0xbac1('0x8'));}}});});};module[_0xbac1('0x9')]=EmailSmtp; \ No newline at end of file +var _0xdf35=['exports','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','verify','toString','Not\x20verifired'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xdf35,0x1af));var _0x5df3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdf35[_0x4b369d];return _0x571a98;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x5df3('0x0'));function EmailSmtp(){}EmailSmtp[_0x5df3('0x1')]['send']=function(_0x3eaf5,_0x12efc4){return new Promise(function(_0x3077ab,_0x473796){var _0x48d4f1=nodemailer[_0x5df3('0x2')](_0x3eaf5);_0x48d4f1[_0x5df3('0x3')](_0x5df3('0x4'),inlineBase64());_0x48d4f1[_0x5df3('0x5')](_0x12efc4,function(_0x45faed,_0x162b33){if(_0x45faed){_0x473796(_0x45faed['toString']());}else{_0x3077ab(_0x162b33);}});});};EmailSmtp[_0x5df3('0x1')][_0x5df3('0x6')]=function(_0x20039c){return new Promise(function(_0x3df01f,_0x13edd7){var _0x5a8e8d=nodemailer[_0x5df3('0x2')](_0x20039c);_0x5a8e8d['verify'](function(_0x48a2d9,_0x59e72a){if(_0x48a2d9){_0x13edd7(_0x48a2d9[_0x5df3('0x7')]());}else{if(_0x59e72a){_0x3df01f(_0x59e72a);}else{_0x13edd7(_0x5df3('0x8'));}}});});};module[_0x5df3('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 03f59ea..6aefa41 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 _0xa327=['toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf','split','length','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','body','textAsHtml','originTo','message','originCc','bcc','attach','type','attachment','attachment-','format','now','join','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20'];(function(_0x44450c,_0x39f7e0){var _0x4e53ad=function(_0x578047){while(--_0x578047){_0x44450c['push'](_0x44450c['shift']());}};_0x4e53ad(++_0x39f7e0);}(_0xa327,0xe9));var _0x7a32=function(_0x1b1ead,_0x380037){_0x1b1ead=_0x1b1ead-0x0;var _0x52bba3=_0xa327[_0x1b1ead];return _0x52bba3;};'use strict';var _=require(_0x7a32('0x0'));var moment=require(_0x7a32('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7a32('0x2'));var util=require(_0x7a32('0x3'));var tnef=require(_0x7a32('0x4'));var logger=require(_0x7a32('0x5'))(_0x7a32('0x6'));var config=require('../../../config/environment');function getAddress(_0x2aa49d){var _0x6bfdb5=_[_0x7a32('0x7')](_0x2aa49d[_0x7a32('0x8')]);return _0x6bfdb5&&_0x6bfdb5['address']?_0x6bfdb5[_0x7a32('0x9')]:_0x7a32('0xa')+random[_0x7a32('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x13bf0e){var _0x19aa1e=_[_0x7a32('0x7')](_0x13bf0e[_0x7a32('0x8')]);if(_0x19aa1e&&_0x19aa1e[_0x7a32('0xc')]){if(_0x19aa1e[_0x7a32('0xc')]==_0x19aa1e[_0x7a32('0x9')]){return _0x19aa1e[_0x7a32('0xc')][_0x7a32('0xd')](0x0,_0x19aa1e[_0x7a32('0xc')][_0x7a32('0xe')]('@'));}var _0x54a9f1=_0x19aa1e[_0x7a32('0xc')][_0x7a32('0xf')](/\s+/);return _0x54a9f1[_0x7a32('0x10')]>0x1?_0x54a9f1['slice'](0x0,-0x1)['join']('\x20'):_0x19aa1e[_0x7a32('0xc')];}return'Anonymous';}function getLastName(_0x95f8c7){var _0x1ba843=_['head'](_0x95f8c7[_0x7a32('0x8')]);if(_0x1ba843&&_0x1ba843[_0x7a32('0xc')]){var _0x53629d=_0x1ba843[_0x7a32('0xc')][_0x7a32('0xf')](/\s+/);return _0x53629d[_0x7a32('0x10')]>0x1?_0x53629d['pop']():'';}return'';}function getMails(_0x51d858,_0x9ccd75){var _0x51eb74='';for(var _0x4b2d81=0x0;_0x4b2d81<_0x9ccd75['value']['length'];_0x4b2d81+=0x1){if(_0x9ccd75['value'][_0x4b2d81]['address']!==_0x51d858){if(!_[_0x7a32('0x11')](_0x51eb74)){_0x51eb74+=',';}_0x51eb74+=_0x9ccd75[_0x7a32('0x8')][_0x4b2d81]['name']||_0x9ccd75[_0x7a32('0x8')][_0x4b2d81][_0x7a32('0x9')]||'';_0x51eb74+='\x20<';_0x51eb74+=_0x9ccd75[_0x7a32('0x8')][_0x4b2d81][_0x7a32('0x9')]?_0x9ccd75[_0x7a32('0x8')][_0x4b2d81]['address']:'anonymous'+random[_0x7a32('0xb')](0x6)+_0x7a32('0x12');_0x51eb74+='>';}}return _0x51eb74;}function parseEmail(_0x1b5ea5,_0x18e4a2,_0x38c296){if(_0x18e4a2[_0x7a32('0x13')]){var _0x168d88=/)<[^<]*)*<\/script>/gi;while(_0x168d88[_0x7a32('0x14')](_0x18e4a2[_0x7a32('0x13')])){_0x18e4a2[_0x7a32('0x13')]=_0x18e4a2[_0x7a32('0x13')]['replace'](_0x168d88,'');}if(_0x18e4a2[_0x7a32('0x13')][_0x7a32('0x15')](_0x7a32('0x16'))){var _0x47a8ca=[];_0x18e4a2[_0x7a32('0x17')]['forEach'](_0xcf0bd5=>{_0x47a8ca[_0x7a32('0x18')](_0xcf0bd5[_0x7a32('0x19')]);});var _0x4b6443=/]+>/g;var _0x205df1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x794dbb=_0x18e4a2[_0x7a32('0x13')][_0x7a32('0x1a')](_0x205df1,_0x7a32('0x1b'));var _0x4cd444=_0x794dbb[_0x7a32('0x1a')](_0x4b6443,_0x7a32('0x1c'));for(let _0x74ccee=0x0;_0x74ccee<_0x47a8ca[_0x7a32('0x10')];_0x74ccee++){var _0x3a6239=_0x4cd444['replace'](_0x7a32('0x1c'),_0x7a32('0x1d')+_0x47a8ca[_0x74ccee]+'\x20]');_0x4cd444=_0x3a6239;}_0x18e4a2[_0x7a32('0x13')]=_0x4cd444;}_0x38c296[_0x7a32('0x1e')]=_0x18e4a2[_0x7a32('0x13')];}else{_0x38c296[_0x7a32('0x1e')]=_0x18e4a2[_0x7a32('0x1f')];}if(_0x38c296[_0x7a32('0x1e')]){_0x38c296[_0x7a32('0x1e')]=_0x38c296['body'][_0x7a32('0x1a')](/0x0){var _0x22779d=[_0x7a32('0x31'),_0x7a32('0x32'),_0x7a32('0x33')];for(var _0x339ae3=0x0;_0x339ae3<_0x18e4a2[_0x7a32('0x30')][_0x7a32('0x10')];_0x339ae3++){var _0x5597c0=_['indexOf'](_0x22779d,_0x18e4a2[_0x7a32('0x30')][_0x339ae3]['line']);if(_0x5597c0>=0x0){_0x38c296['isAutoreply']=!![];}}}return _0x38c296;}exports['parser']=function(_0x7ac7f1,_0x1e93fc,_0x47ae90){var _0x4d3c60={'from':getAddress(_0x1e93fc['from']),'firstName':getFirstName(_0x1e93fc[_0x7a32('0x34')]),'lastName':getLastName(_0x1e93fc[_0x7a32('0x34')]),'mapKey':_0x7a32('0x6'),'message':{'from':getMails(_0x7ac7f1['email'],_0x1e93fc[_0x7a32('0x34')]),'to':_0x7ac7f1[_0x7a32('0x6')],'cc':'','subject':_0x1e93fc[_0x7a32('0x35')]||'','messageId':_0x1e93fc[_0x7a32('0x36')],'inReplyTo':_0x1e93fc[_0x7a32('0x37')],'sentAt':moment(_0x1e93fc[_0x7a32('0x38')])[_0x7a32('0x28')](_0x7a32('0x39')),'attach':![],'attachments':[]}};if(!_0x1e93fc['html']&&!_0x1e93fc[_0x7a32('0x1f')]){var _0x4ed1b2=_['filter'](_0x1e93fc['attachments'],{'contentType':'application/ms-tnef'});if(_0x4ed1b2[_0x7a32('0x10')]){logger[_0x7a32('0x3a')](util[_0x7a32('0x28')](_0x7a32('0x3b'),_0x1e93fc[_0x7a32('0x36')]));tnef[_0x7a32('0x3c')](_[_0x7a32('0x3d')](_0x4ed1b2)['content'],function(_0x181931,_0x1d4118){if(_0x1d4118){_0x1e93fc[_0x7a32('0x13')]=_0x1d4118[_0x7a32('0x3e')]||'

Empty\x20message

';if(_0x1d4118[_0x7a32('0x3f')]){for(var _0x59934f=0x0;_0x59934f<_0x1d4118['Attachments'][_0x7a32('0x10')];_0x59934f++){var _0x1142de=_0x1d4118[_0x7a32('0x3f')][_0x59934f];_0x4d3c60['message'][_0x7a32('0x17')][_0x7a32('0x18')]({'filename':_0x1142de[_0x7a32('0x40')],'content':Buffer[_0x7a32('0x34')](_0x1142de[_0x7a32('0x41')])});}}}_0x47ae90(parseEmail(_0x7ac7f1,_0x1e93fc,_0x4d3c60));});}else{_0x1e93fc[_0x7a32('0x13')]='

Empty\x20message

';_0x47ae90(parseEmail(_0x7ac7f1,_0x1e93fc,_0x4d3c60));}}else{_0x47ae90(parseEmail(_0x7ac7f1,_0x1e93fc,_0x4d3c60));}};exports['getHost']=function(_0x90294e){switch(_0x90294e){case'gmail':return _0x7a32('0x42');case _0x7a32('0x43'):return _0x7a32('0x44');case'hotmail':return _0x7a32('0x45');case'outlook365':return _0x7a32('0x46');}return _0x7a32('0x47');};exports[_0x7a32('0x48')]=function(_0x54e76f,_0x6b512a){var _0x576e1a=[_0x7a32('0x49')+(_0x6b512a||''),_0x7a32('0x4a')+_0x54e76f,'',''];return Buffer[_0x7a32('0x34')](_0x576e1a[_0x7a32('0x2a')](''),'utf-8')[_0x7a32('0x4b')](_0x7a32('0x4c'));}; \ No newline at end of file +var _0xf82f=['127.0.0.1','user=','auth=Bearer\x20','utf-8','base64','lodash','randomstring','path','util','node-tnef','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','length','slice','join','Anonymous','split','isEmpty','html','replace','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com'];(function(_0x2dc293,_0xbd4e34){var _0x5b0e0a=function(_0x318d16){while(--_0x318d16){_0x2dc293['push'](_0x2dc293['shift']());}};_0x5b0e0a(++_0xbd4e34);}(_0xf82f,0xec));var _0xff82=function(_0x5706c3,_0x208e27){_0x5706c3=_0x5706c3-0x0;var _0x3d9f36=_0xf82f[_0x5706c3];return _0x3d9f36;};'use strict';var _=require(_0xff82('0x0'));var moment=require('moment');var random=require(_0xff82('0x1'));var fs=require('fs');var path=require(_0xff82('0x2'));var util=require(_0xff82('0x3'));var tnef=require(_0xff82('0x4'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x1f7f58){var _0xf3feaa=_['head'](_0x1f7f58[_0xff82('0x5')]);return _0xf3feaa&&_0xf3feaa[_0xff82('0x6')]?_0xf3feaa['address']:_0xff82('0x7')+random[_0xff82('0x8')](0x6)+_0xff82('0x9');}function getFirstName(_0x5bb773){var _0x58d0b3=_[_0xff82('0xa')](_0x5bb773[_0xff82('0x5')]);if(_0x58d0b3&&_0x58d0b3[_0xff82('0xb')]){if(_0x58d0b3[_0xff82('0xb')]==_0x58d0b3['address']){return _0x58d0b3[_0xff82('0xb')][_0xff82('0xc')](0x0,_0x58d0b3['name'][_0xff82('0xd')]('@'));}var _0x3783af=_0x58d0b3[_0xff82('0xb')]['split'](/\s+/);return _0x3783af[_0xff82('0xe')]>0x1?_0x3783af[_0xff82('0xf')](0x0,-0x1)[_0xff82('0x10')]('\x20'):_0x58d0b3['name'];}return _0xff82('0x11');}function getLastName(_0x267308){var _0x56f6b7=_[_0xff82('0xa')](_0x267308[_0xff82('0x5')]);if(_0x56f6b7&&_0x56f6b7[_0xff82('0xb')]){var _0x26e23b=_0x56f6b7['name'][_0xff82('0x12')](/\s+/);return _0x26e23b[_0xff82('0xe')]>0x1?_0x26e23b['pop']():'';}return'';}function getMails(_0x134bbc,_0x15172a){var _0x178a92='';for(var _0x32fdc7=0x0;_0x32fdc7<_0x15172a[_0xff82('0x5')][_0xff82('0xe')];_0x32fdc7+=0x1){if(_0x15172a['value'][_0x32fdc7]['address']!==_0x134bbc){if(!_[_0xff82('0x13')](_0x178a92)){_0x178a92+=',';}_0x178a92+=_0x15172a['value'][_0x32fdc7][_0xff82('0xb')]||_0x15172a[_0xff82('0x5')][_0x32fdc7][_0xff82('0x6')]||'';_0x178a92+='\x20<';_0x178a92+=_0x15172a[_0xff82('0x5')][_0x32fdc7][_0xff82('0x6')]?_0x15172a[_0xff82('0x5')][_0x32fdc7]['address']:_0xff82('0x7')+random[_0xff82('0x8')](0x6)+_0xff82('0x9');_0x178a92+='>';}}return _0x178a92;}function parseEmail(_0x20e49d,_0x313f40,_0x26bcd6){if(_0x313f40[_0xff82('0x14')]){var _0x4926e4=/)<[^<]*)*<\/script>/gi;while(_0x4926e4['test'](_0x313f40[_0xff82('0x14')])){_0x313f40[_0xff82('0x14')]=_0x313f40[_0xff82('0x14')][_0xff82('0x15')](_0x4926e4,'');}if(_0x313f40[_0xff82('0x14')]['includes'](_0xff82('0x16'))){var _0x361bc7=[];_0x313f40[_0xff82('0x17')][_0xff82('0x18')](_0x56b387=>{_0x361bc7[_0xff82('0x19')](_0x56b387[_0xff82('0x1a')]);});var _0x3df948=/]+>/g;var _0x124e3b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x36c1a1=_0x313f40[_0xff82('0x14')]['replace'](_0x124e3b,_0xff82('0x1b'));var _0x5d2e83=_0x36c1a1[_0xff82('0x15')](_0x3df948,'_IMG');for(let _0x41db38=0x0;_0x41db38<_0x361bc7[_0xff82('0xe')];_0x41db38++){var _0x2b41bd=_0x5d2e83[_0xff82('0x15')]('_IMG',_0xff82('0x1c')+_0x361bc7[_0x41db38]+'\x20]');_0x5d2e83=_0x2b41bd;}_0x313f40[_0xff82('0x14')]=_0x5d2e83;}_0x26bcd6[_0xff82('0x1d')]=_0x313f40[_0xff82('0x14')];}else{_0x26bcd6[_0xff82('0x1d')]=_0x313f40[_0xff82('0x1e')];}if(_0x26bcd6['body']){_0x26bcd6[_0xff82('0x1d')]=_0x26bcd6[_0xff82('0x1d')]['replace'](/0x0){var _0x4b4c39=[_0xff82('0x2e'),_0xff82('0x2f'),_0xff82('0x30')];for(var _0x4f29a2=0x0;_0x4f29a2<_0x313f40['headerLines'][_0xff82('0xe')];_0x4f29a2++){var _0x249c1e=_['indexOf'](_0x4b4c39,_0x313f40[_0xff82('0x2d')][_0x4f29a2][_0xff82('0x31')]);if(_0x249c1e>=0x0){_0x26bcd6[_0xff82('0x32')]=!![];}}}return _0x26bcd6;}exports['parser']=function(_0x4bd7d9,_0x310e7c,_0x5bc4bf){var _0x355526={'from':getAddress(_0x310e7c['from']),'firstName':getFirstName(_0x310e7c[_0xff82('0x33')]),'lastName':getLastName(_0x310e7c['from']),'mapKey':_0xff82('0x22'),'message':{'from':getMails(_0x4bd7d9[_0xff82('0x22')],_0x310e7c['from']),'to':_0x4bd7d9['email'],'cc':'','subject':_0x310e7c[_0xff82('0x34')]||'','messageId':_0x310e7c[_0xff82('0x35')],'inReplyTo':_0x310e7c['inReplyTo'],'sentAt':moment(_0x310e7c[_0xff82('0x36')])[_0xff82('0x28')](_0xff82('0x37')),'attach':![],'attachments':[]}};if(!_0x310e7c[_0xff82('0x14')]&&!_0x310e7c['textAsHtml']){var _0xd6e9c1=_[_0xff82('0x38')](_0x310e7c[_0xff82('0x17')],{'contentType':_0xff82('0x39')});if(_0xd6e9c1[_0xff82('0xe')]){logger[_0xff82('0x3a')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x310e7c[_0xff82('0x35')]));tnef['parseBuffer'](_[_0xff82('0x3b')](_0xd6e9c1)[_0xff82('0x2b')],function(_0xe893a7,_0x4abb2d){if(_0x4abb2d){_0x310e7c[_0xff82('0x14')]=_0x4abb2d[_0xff82('0x3c')]||_0xff82('0x3d');if(_0x4abb2d[_0xff82('0x3e')]){for(var _0x2fa474=0x0;_0x2fa474<_0x4abb2d['Attachments'][_0xff82('0xe')];_0x2fa474++){var _0x22380c=_0x4abb2d[_0xff82('0x3e')][_0x2fa474];_0x355526[_0xff82('0x20')][_0xff82('0x17')][_0xff82('0x19')]({'filename':_0x22380c[_0xff82('0x3f')],'content':Buffer[_0xff82('0x33')](_0x22380c[_0xff82('0x40')])});}}}_0x5bc4bf(parseEmail(_0x4bd7d9,_0x310e7c,_0x355526));});}else{_0x310e7c[_0xff82('0x14')]=_0xff82('0x3d');_0x5bc4bf(parseEmail(_0x4bd7d9,_0x310e7c,_0x355526));}}else{_0x5bc4bf(parseEmail(_0x4bd7d9,_0x310e7c,_0x355526));}};exports['getHost']=function(_0x2d7605){switch(_0x2d7605){case _0xff82('0x41'):return _0xff82('0x42');case _0xff82('0x43'):return _0xff82('0x44');case'hotmail':return _0xff82('0x45');case _0xff82('0x46'):return _0xff82('0x47');}return _0xff82('0x48');};exports['generateXOAuth2Token']=function(_0x268490,_0x572e77){var _0x33297a=[_0xff82('0x49')+(_0x572e77||''),_0xff82('0x4a')+_0x268490,'',''];return Buffer['from'](_0x33297a[_0xff82('0x10')](''),_0xff82('0x4b'))['toString'](_0xff82('0x4c'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8547e50..21cfc0d 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8303=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x8303,0x18a));var _0x3830=function(_0x3c86b0,_0x3fc076){_0x3c86b0=_0x3c86b0-0x0;var _0x419d5a=_0x8303[_0x3c86b0];return _0x419d5a;};'use strict';var _=require(_0x3830('0x0'));function MailAccount(_0x399bdd){this['id']=_0x399bdd['id']||0x0;this[_0x3830('0x1')]=_0x399bdd[_0x3830('0x1')]||_0x3830('0x2');this[_0x3830('0x3')]=_0x399bdd[_0x3830('0x3')]||_0x3830('0x4');this[_0x3830('0x5')]=_0x399bdd['active']||![];this[_0x3830('0x6')]=_0x399bdd[_0x3830('0x6')]||[];this[_0x3830('0x7')]=_0x399bdd[_0x3830('0x7')]||[];}module[_0x3830('0x8')]=MailAccount; \ No newline at end of file +var _0x25fe=['active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x56fd7f,_0x4f3507){var _0x2bdb48=function(_0x21abad){while(--_0x21abad){_0x56fd7f['push'](_0x56fd7f['shift']());}};_0x2bdb48(++_0x4f3507);}(_0x25fe,0xdc));var _0xe25f=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x25fe[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require(_0xe25f('0x0'));function MailAccount(_0x15b5cd){this['id']=_0x15b5cd['id']||0x0;this[_0xe25f('0x1')]=_0x15b5cd['name']||_0xe25f('0x2');this[_0xe25f('0x3')]=_0x15b5cd[_0xe25f('0x3')]||'SERV';this[_0xe25f('0x4')]=_0x15b5cd[_0xe25f('0x4')]||![];this[_0xe25f('0x5')]=_0x15b5cd[_0xe25f('0x5')]||[];this[_0xe25f('0x6')]=_0x15b5cd[_0xe25f('0x6')]||[];}module[_0xe25f('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4c747e9..5353e46 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe721=['lodash','../model/mailAccount','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','exports'];(function(_0x14b45b,_0x221a13){var _0x5dc747=function(_0x5a5213){while(--_0x5a5213){_0x14b45b['push'](_0x14b45b['shift']());}};_0x5dc747(++_0x221a13);}(_0xe721,0x138));var _0x1e72=function(_0x3b3557,_0x4cbfe3){_0x3b3557=_0x3b3557-0x0;var _0xabe310=_0xe721[_0x3b3557];return _0xabe310;};'use strict';var _=require(_0x1e72('0x0'));var MailAccount=require(_0x1e72('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x19deee,_0x3e71df,_0x3c38b2){var _0x5b829e=_[_0x1e72('0x2')](_0x19deee,function(_0x35c368,_0x3ba5a4){return _0x35c368[_0x3c38b2];});for(var _0x2bc54b in _0x3e71df){if(_0x3e71df['hasOwnProperty'](_0x2bc54b)){if(!_0x5b829e[_0x2bc54b]){delete _0x3e71df[_0x2bc54b];}}}}Realtime['prototype'][_0x1e72('0x3')]=function(_0x1fd081,_0x3f281f){for(var _0x15a6ba in _0x3f281f){if(_0x1fd081[_0x1e72('0x4')](_0x15a6ba)){_0x1fd081[_0x15a6ba]=_0x3f281f[_0x15a6ba];}}};Realtime[_0x1e72('0x5')][_0x1e72('0x6')]=function(){var _0x307ca1=this;return function(_0x14de95){if(_0x14de95){freeIsNotKey(_0x14de95,_0x307ca1[_0x1e72('0x7')],'id');for(var _0x196995=0x0,_0x1daf2a={},_0xd71792={};_0x196995<_0x14de95[_0x1e72('0x8')];_0x196995+=0x1){_0x1daf2a=_0x14de95[_0x196995];if(_[_0x1e72('0x9')](_0x307ca1[_0x1e72('0x7')][_0x1daf2a['id']])){_0x307ca1[_0x1e72('0x7')][_0x1daf2a['id']]=new MailAccount(_0x1daf2a);}else{_[_0x1e72('0xa')](_0x307ca1['mailAccounts'][_0x1daf2a['id']],_0x1daf2a);}}}return _0x307ca1[_0x1e72('0x7')];};};module[_0x1e72('0xb')]=Realtime; \ No newline at end of file +var _0xd5b0=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge'];(function(_0xf43cb,_0x465374){var _0x14e869=function(_0x454719){while(--_0x454719){_0xf43cb['push'](_0xf43cb['shift']());}};_0x14e869(++_0x465374);}(_0xd5b0,0x135));var _0x0d5b=function(_0x28fbfa,_0x159c9a){_0x28fbfa=_0x28fbfa-0x0;var _0x4b7bae=_0xd5b0[_0x28fbfa];return _0x4b7bae;};'use strict';var _=require(_0x0d5b('0x0'));var MailAccount=require(_0x0d5b('0x1'));var Realtime=function(){this[_0x0d5b('0x2')]={};};function freeIsNotKey(_0x290cd3,_0x5c6d75,_0x58a9ae){var _0x57f064=_[_0x0d5b('0x3')](_0x290cd3,function(_0x28185b,_0x193037){return _0x28185b[_0x58a9ae];});for(var _0x5ddb2c in _0x5c6d75){if(_0x5c6d75['hasOwnProperty'](_0x5ddb2c)){if(!_0x57f064[_0x5ddb2c]){delete _0x5c6d75[_0x5ddb2c];}}}}Realtime[_0x0d5b('0x4')][_0x0d5b('0x5')]=function(_0xce84fd,_0xf07d64){for(var _0x44c0ce in _0xf07d64){if(_0xce84fd['hasOwnProperty'](_0x44c0ce)){_0xce84fd[_0x44c0ce]=_0xf07d64[_0x44c0ce];}}};Realtime['prototype'][_0x0d5b('0x6')]=function(){var _0xb45d03=this;return function(_0x3eab58){if(_0x3eab58){freeIsNotKey(_0x3eab58,_0xb45d03[_0x0d5b('0x2')],'id');for(var _0x5d9c36=0x0,_0x44d4bf={},_0x1feca2={};_0x5d9c36<_0x3eab58[_0x0d5b('0x7')];_0x5d9c36+=0x1){_0x44d4bf=_0x3eab58[_0x5d9c36];if(_[_0x0d5b('0x8')](_0xb45d03[_0x0d5b('0x2')][_0x44d4bf['id']])){_0xb45d03[_0x0d5b('0x2')][_0x44d4bf['id']]=new MailAccount(_0x44d4bf);}else{_[_0x0d5b('0x9')](_0xb45d03['mailAccounts'][_0x44d4bf['id']],_0x44d4bf);}}}return _0xb45d03['mailAccounts'];};};module[_0x0d5b('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 139ab7f..ae34ff4 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x352b=['name','provider','active','key','ListId','TemplateId','CloudProvider','service','type','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x352b,0x1c8));var _0xb352=function(_0x14ac84,_0x175e20){_0x14ac84=_0x14ac84-0x0;var _0x361a0f=_0x352b[_0x14ac84];return _0x361a0f;};'use strict';var client=require(_0xb352('0x0'));exports[_0xb352('0x1')]=function(){return function(){return client['Request'](_0xb352('0x2'),{'options':{'attributes':['id',_0xb352('0x3'),_0xb352('0x4'),'service','email',_0xb352('0x5'),_0xb352('0x6'),_0xb352('0x7'),_0xb352('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xb352('0x9'),'attributes':['id','name',_0xb352('0xa'),'type','data5'],'as':_0xb352('0x9')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','attributes':['id','name','service',_0xb352('0xb'),_0xb352('0xc')],'as':_0xb352('0x9')}]}]},'log':_0xb352('0xd')});};};exports[_0xb352('0xe')]=function(_0x3ff6b7,_0xf0669){return client[_0xb352('0xf')](_0xb352('0x10'),{'account':{'id':_0x3ff6b7},'body':_0xf0669,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x9048=['MailServerOut','Smtp','notify','NotifyMailAccount','../client','Request','service','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','name','type','data5'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0x9048,0xf2));var _0x8904=function(_0x40bc97,_0xa6503b){_0x40bc97=_0x40bc97-0x0;var _0x3b5d13=_0x9048[_0x40bc97];return _0x3b5d13;};'use strict';var client=require(_0x8904('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8904('0x1')]('GetMailAccount',{'options':{'attributes':['id','name','provider',_0x8904('0x2'),_0x8904('0x3'),'active',_0x8904('0x4'),_0x8904('0x5'),_0x8904('0x6')],'raw':![],'include':[{'model':_0x8904('0x7'),'as':_0x8904('0x8'),'include':[{'model':_0x8904('0x9'),'attributes':['id',_0x8904('0xa'),_0x8904('0x2'),_0x8904('0xb'),_0x8904('0xc')],'as':_0x8904('0x9')}]},{'model':_0x8904('0xd'),'as':_0x8904('0xe'),'include':[{'model':_0x8904('0x9'),'attributes':['id','name','service',_0x8904('0xb'),'data5'],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x8904('0xf')]=function(_0x548d60,_0x1b1a6e){return client[_0x8904('0x1')](_0x8904('0x10'),{'account':{'id':_0x548d60},'body':_0x1b1a6e,'log':_0x8904('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 683ae47..7e551d8 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ca5=['getSettings','Request','loginMailFrequency','GetSettings','../client'];(function(_0x1781c7,_0x3eef16){var _0xf00270=function(_0x3fc04e){while(--_0x3fc04e){_0x1781c7['push'](_0x1781c7['shift']());}};_0xf00270(++_0x3eef16);}(_0x3ca5,0xcc));var _0x53ca=function(_0x36ab81,_0x256598){_0x36ab81=_0x36ab81-0x0;var _0x4370bb=_0x3ca5[_0x36ab81];return _0x4370bb;};'use strict';var client=require(_0x53ca('0x0'));exports[_0x53ca('0x1')]=function(){return client[_0x53ca('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x53ca('0x3')]},'log':_0x53ca('0x4')});}; \ No newline at end of file +var _0xd02b=['../client','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x18efc2,_0x35d1cb){var _0x2a92a7=function(_0x11b2ec){while(--_0x11b2ec){_0x18efc2['push'](_0x18efc2['shift']());}};_0x2a92a7(++_0x35d1cb);}(_0xd02b,0xb9));var _0xbd02=function(_0x4fd471,_0x1f4ab4){_0x4fd471=_0x4fd471-0x0;var _0x3dbc37=_0xd02b[_0x4fd471];return _0x3dbc37;};'use strict';var client=require(_0xbd02('0x0'));exports['getSettings']=function(){return client[_0xbd02('0x1')](_0xbd02('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbd02('0x3')]},'log':_0xbd02('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index fba9bfd..db8c623 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 97e9bb4..68800cc 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0e6=['websocket','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io'];(function(_0x40767a,_0x279a0a){var _0x3ef876=function(_0x3ef58d){while(--_0x3ef58d){_0x40767a['push'](_0x40767a['shift']());}};_0x3ef876(++_0x279a0a);}(_0xd0e6,0xfa));var _0x6d0e=function(_0x39fbbc,_0x9d36ab){_0x39fbbc=_0x39fbbc-0x0;var _0x1c171d=_0xd0e6[_0x39fbbc];return _0x1c171d;};'use strict';var _=require(_0x6d0e('0x0'));var http=require(_0x6d0e('0x1'));var express=require('express');var sticky=require(_0x6d0e('0x2'));var Redis=require(_0x6d0e('0x3'));var config=require(_0x6d0e('0x4'));var app=express();var server=http[_0x6d0e('0x5')](app);server[_0x6d0e('0x6')]=0xdbba0;if(sticky[_0x6d0e('0x7')](server,config[_0x6d0e('0x8')])){var socketio=require(_0x6d0e('0x9'))(server,{'transports':[_0x6d0e('0xa'),_0x6d0e('0xb')]});config[_0x6d0e('0xc')]=_['defaults'](config['redis'],{'host':_0x6d0e('0xd'),'port':0x18eb});socketio[_0x6d0e('0xe')](require(_0x6d0e('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x6d0e('0xc')])}));require(_0x6d0e('0x10'))[_0x6d0e('0x11')]();require(_0x6d0e('0x12'))[_0x6d0e('0x11')](socketio);require(_0x6d0e('0x13'))[_0x6d0e('0x11')](app);require(_0x6d0e('0x14'))['default'](app);}else{server[_0x6d0e('0x15')](_0x6d0e('0x16'),function(){console[_0x6d0e('0x17')](_0x6d0e('0x18'),config[_0x6d0e('0x8')]);});}exports=module[_0x6d0e('0x19')]=app; \ No newline at end of file +var _0x70e2=['once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','ioredis','createServer','timeout','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes'];(function(_0x1ae212,_0x326175){var _0x114025=function(_0xc8a28){while(--_0xc8a28){_0x1ae212['push'](_0x1ae212['shift']());}};_0x114025(++_0x326175);}(_0x70e2,0x1d2));var _0x270e=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x70e2[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x270e('0x0'));var http=require('http');var express=require(_0x270e('0x1'));var sticky=require('sticky-session');var Redis=require(_0x270e('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x270e('0x3')](app);server[_0x270e('0x4')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x270e('0x5'))(server,{'transports':[_0x270e('0x6'),_0x270e('0x7')]});config['redis']=_[_0x270e('0x8')](config[_0x270e('0x9')],{'host':_0x270e('0xa'),'port':0x18eb});socketio[_0x270e('0xb')](require(_0x270e('0xc'))({'pubClient':new Redis(config[_0x270e('0x9')]),'subClient':new Redis(config[_0x270e('0x9')])}));require(_0x270e('0xd'))[_0x270e('0xe')]();require(_0x270e('0xf'))['default'](socketio);require('../../config/express')[_0x270e('0xe')](app);require(_0x270e('0x10'))[_0x270e('0xe')](app);}else{server[_0x270e('0x11')](_0x270e('0x12'),function(){console[_0x270e('0x13')](_0x270e('0x14'),config[_0x270e('0x15')]);});}exports=module[_0x270e('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index a289ea6..9833c93 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x584e=['then','debug','rpc','routing','error','message','result','exports','jayson/promise','Request','request'];(function(_0x53f715,_0x52587b){var _0x16c757=function(_0x5cc9bf){while(--_0x5cc9bf){_0x53f715['push'](_0x53f715['shift']());}};_0x16c757(++_0x52587b);}(_0x584e,0x81));var _0xe584=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x584e[_0x557f5f];return _0x196eba;};'use strict';var jayson=require(_0xe584('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson['client']['http']({'port':0x2329});client[_0xe584('0x1')]=function(_0x1ec788,_0x4aefe6){return new BPromise(function(_0x1c842e,_0x4d5da1){return client[_0xe584('0x2')](_0x1ec788,_0x4aefe6)[_0xe584('0x3')](function(_0x5daed5){logger[_0xe584('0x4')](_0xe584('0x5'),_0xe584('0x6'),_0x1ec788,_0x4aefe6,_0x5daed5);if(_0x5daed5[_0xe584('0x7')]){logger[_0xe584('0x7')](_0xe584('0x5'),_0xe584('0x6'),_0x1ec788,_0x5daed5[_0xe584('0x7')][_0xe584('0x8')],_0x4aefe6);return _0x4d5da1(_0x5daed5[_0xe584('0x7')]['message']);}else{return _0x1c842e(_0x5daed5[_0xe584('0x9')]);}})['catch'](function(_0x4102ff){logger[_0xe584('0x7')](_0xe584('0x5'),_0xe584('0x6'),_0x1ec788,_0x4102ff,_0x4aefe6);return _0x4d5da1(_0x4102ff);});});};module[_0xe584('0xa')]=client; \ No newline at end of file +var _0x7d14=['bluebird','routing','client','Request','request','debug','rpc','error','message','result','exports','jayson/promise'];(function(_0x420cd4,_0x20169b){var _0x2cdc13=function(_0x989219){while(--_0x989219){_0x420cd4['push'](_0x420cd4['shift']());}};_0x2cdc13(++_0x20169b);}(_0x7d14,0x107));var _0x47d1=function(_0x56313e,_0x5db7ff){_0x56313e=_0x56313e-0x0;var _0x396cd0=_0x7d14[_0x56313e];return _0x396cd0;};'use strict';var jayson=require(_0x47d1('0x0'));var BPromise=require(_0x47d1('0x1'));var logger=require('../../config/logger')(_0x47d1('0x2'));var client=jayson[_0x47d1('0x3')]['http']({'port':0x2329});client[_0x47d1('0x4')]=function(_0x1f6044,_0x46ddde){return new BPromise(function(_0x23e0be,_0x1dbab3){return client[_0x47d1('0x5')](_0x1f6044,_0x46ddde)['then'](function(_0x23323a){logger[_0x47d1('0x6')](_0x47d1('0x7'),_0x47d1('0x2'),_0x1f6044,_0x46ddde,_0x23323a);if(_0x23323a['error']){logger[_0x47d1('0x8')](_0x47d1('0x7'),'routing',_0x1f6044,_0x23323a[_0x47d1('0x8')][_0x47d1('0x9')],_0x46ddde);return _0x1dbab3(_0x23323a[_0x47d1('0x8')][_0x47d1('0x9')]);}else{return _0x23e0be(_0x23323a[_0x47d1('0xa')]);}})['catch'](function(_0x555413){logger[_0x47d1('0x8')](_0x47d1('0x7'),'routing',_0x1f6044,_0x555413,_0x46ddde);return _0x1dbab3(_0x555413);});});};module[_0x47d1('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 307a9e0..a9aee4d 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3f=['./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime'];(function(_0x40ded3,_0x367d47){var _0x49c50d=function(_0x3215e3){while(--_0x3215e3){_0x40ded3['push'](_0x40ded3['shift']());}};_0x49c50d(++_0x367d47);}(_0x0b3f,0x105));var _0xf0b3=function(_0x2037d9,_0x335021){_0x2037d9=_0x2037d9-0x0;var _0x2e004e=_0x0b3f[_0x2037d9];return _0x2e004e;};'use strict';var BPromise=require(_0xf0b3('0x0'));var server=require(_0xf0b3('0x1'));var Realtime=require(_0xf0b3('0x2'));var user=require(_0xf0b3('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xf0b3('0x4'));var chatQueue=require(_0xf0b3('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xf0b3('0x6'));var faxQueue=require(_0xf0b3('0x7'));var whatsappQueue=require(_0xf0b3('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xf0b3('0x9')](user[_0xf0b3('0xa')]())['then'](realtime['initAgents']())['then'](interval[_0xf0b3('0xb')]())['then'](realtime[_0xf0b3('0xc')]())['then'](openchannelQueue[_0xf0b3('0xd')]())['then'](realtime[_0xf0b3('0xe')]())['then'](chatQueue[_0xf0b3('0xf')]())[_0xf0b3('0x9')](realtime[_0xf0b3('0x10')]())['then'](smsQueue[_0xf0b3('0x11')]())[_0xf0b3('0x9')](realtime[_0xf0b3('0x12')]())[_0xf0b3('0x9')](mailQueue[_0xf0b3('0x13')]())[_0xf0b3('0x9')](realtime['initMailQueues']())[_0xf0b3('0x9')](faxQueue[_0xf0b3('0x14')]())[_0xf0b3('0x9')](realtime['initFaxQueues']())[_0xf0b3('0x9')](whatsappQueue['getWhatsappQueues']())[_0xf0b3('0x9')](realtime[_0xf0b3('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0xf0b3('0x16')](realtime)['then'](function(_0x5dfb19){return initRealtime();})[_0xf0b3('0x9')](function(_0x4924aa){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1901fc){console[_0xf0b3('0x17')](_0x1901fc);});}main(); \ No newline at end of file +var _0x384b=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/interval'];(function(_0xad8706,_0x3f7662){var _0x4d1d6c=function(_0x3f5ad7){while(--_0x3f5ad7){_0xad8706['push'](_0xad8706['shift']());}};_0x4d1d6c(++_0x3f7662);}(_0x384b,0xd9));var _0xb384=function(_0x1b5994,_0x33a804){_0x1b5994=_0x1b5994-0x0;var _0x537fa7=_0x384b[_0x1b5994];return _0x537fa7;};'use strict';var BPromise=require(_0xb384('0x0'));var server=require(_0xb384('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xb384('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xb384('0x3'));var smsQueue=require(_0xb384('0x4'));var mailQueue=require(_0xb384('0x5'));var faxQueue=require(_0xb384('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xb384('0x7')]()['then'](user['getAgents']())[_0xb384('0x8')](realtime[_0xb384('0x9')]())['then'](interval['getIntervals']())[_0xb384('0x8')](realtime[_0xb384('0xa')]())[_0xb384('0x8')](openchannelQueue[_0xb384('0xb')]())[_0xb384('0x8')](realtime[_0xb384('0xc')]())['then'](chatQueue['getChatQueues']())[_0xb384('0x8')](realtime['initChatQueues']())[_0xb384('0x8')](smsQueue[_0xb384('0xd')]())[_0xb384('0x8')](realtime[_0xb384('0xe')]())[_0xb384('0x8')](mailQueue[_0xb384('0xf')]())[_0xb384('0x8')](realtime['initMailQueues']())['then'](faxQueue[_0xb384('0x10')]())[_0xb384('0x8')](realtime[_0xb384('0x11')]())[_0xb384('0x8')](whatsappQueue[_0xb384('0x12')]())[_0xb384('0x8')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xb384('0x13')](realtime)[_0xb384('0x8')](function(_0x5cfa98){return initRealtime();})['then'](function(_0x1cc2f4){return setInterval(initRealtime,0x1388);})[_0xb384('0x14')](function(_0x4114e8){console[_0xb384('0x15')](_0x4114e8);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index cec2e7b..b6a4eb5 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x549922,_0x10be1e){var _0x1fde78=function(_0x12f92b){while(--_0x12f92b){_0x549922['push'](_0x549922['shift']());}};_0x1fde78(++_0x10be1e);}(_0x2ef3,0xba));var _0x32ef=function(_0x233a88,_0x1aa397){_0x233a88=_0x233a88-0x0;var _0x407a28=_0x2ef3[_0x233a88];return _0x407a28;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3e3748,_0x118608){var _0x467996=function(_0x475275){while(--_0x475275){_0x3e3748['push'](_0x3e3748['shift']());}};_0x467996(++_0x118608);}(_0x326f,0xd1));var _0xf326=function(_0x5ba8ac,_0x15aabf){_0x5ba8ac=_0x5ba8ac-0x0;var _0xf91aa6=_0x326f[_0x5ba8ac];return _0xf91aa6;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index e237785..5cedd23 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0828=['http','request','error','message','result','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x29cf89,_0x10ce1f){var _0x34ac61=function(_0x5b29c2){while(--_0x5b29c2){_0x29cf89['push'](_0x29cf89['shift']());}};_0x34ac61(++_0x10ce1f);}(_0x0828,0x17a));var _0x8082=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0828[_0x618414];return _0x21c19a;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x8082('0x0'));var client=jayson[_0x8082('0x1')][_0x8082('0x2')]({'port':0x232b});function request(_0xcdbddc,_0x1e56eb){return new BPromise(function(_0x4c5de8,_0xa34ad1){return client[_0x8082('0x3')](_0xcdbddc,_0x1e56eb)['then'](function(_0x506464){if(_0x506464['error']){return _0xa34ad1(_0x506464[_0x8082('0x4')][_0x8082('0x5')]);}else{return _0x4c5de8(_0x506464[_0x8082('0x6')]);}})[_0x8082('0x7')](function(_0xc4b85c){return _0xa34ad1(_0xc4b85c);});});}exports[_0x8082('0x8')]=function(_0x22f4f8,_0x33bc9a){return request(_0x8082('0x9'),{'account':_0x22f4f8,'message':_0x33bc9a});}; \ No newline at end of file +var _0xd7a9=['sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','result','catch'];(function(_0x2dfb6a,_0x3ddcdb){var _0x1ae0a6=function(_0x3ca00c){while(--_0x3ca00c){_0x2dfb6a['push'](_0x2dfb6a['shift']());}};_0x1ae0a6(++_0x3ddcdb);}(_0xd7a9,0x1cd));var _0x9d7a=function(_0x3be358,_0x47b502){_0x3be358=_0x3be358-0x0;var _0x2fa33a=_0xd7a9[_0x3be358];return _0x2fa33a;};'use strict';var BPromise=require(_0x9d7a('0x0'));var jayson=require(_0x9d7a('0x1'));var client=jayson[_0x9d7a('0x2')][_0x9d7a('0x3')]({'port':0x232b});function request(_0x2a3ee2,_0x22d566){return new BPromise(function(_0x3fe566,_0x1fed36){return client[_0x9d7a('0x4')](_0x2a3ee2,_0x22d566)[_0x9d7a('0x5')](function(_0x457321){if(_0x457321['error']){return _0x1fed36(_0x457321[_0x9d7a('0x6')]['message']);}else{return _0x3fe566(_0x457321[_0x9d7a('0x7')]);}})[_0x9d7a('0x8')](function(_0x11eec4){return _0x1fed36(_0x11eec4);});});}exports[_0x9d7a('0x9')]=function(_0x3d3b11,_0x283721){return request('SendMail',{'account':_0x3d3b11,'message':_0x283721});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index cccf0c7..88e0ad8 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6138=['defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','format','smsPause','smsStatus','whatsappStatusTime','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6138,0x1a5));var _0x8613=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6138[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x8613('0x0'));var moment=require(_0x8613('0x1'));var md5=require(_0x8613('0x2'));var Redis=require(_0x8613('0x3'));var config=require(_0x8613('0x4'));config[_0x8613('0x5')]=_[_0x8613('0x6')](config[_0x8613('0x5')],{'host':_0x8613('0x7'),'port':0x18eb});var io=require(_0x8613('0x8'))(new Redis(config[_0x8613('0x5')]));function Agent(_0x107bb4){this['id']=_0x107bb4['id']||0x0;this['name']=_0x107bb4[_0x8613('0x9')]||'';this['online']=_0x107bb4[_0x8613('0xa')]||!![];this[_0x8613('0xb')]=_0x107bb4[_0x8613('0xb')]||![];this['chatPause']=_0x107bb4[_0x8613('0xc')]||![];this[_0x8613('0xd')]=_0x107bb4[_0x8613('0xd')]||![];this[_0x8613('0xe')]=_0x107bb4[_0x8613('0xe')]||![];this['smsPause']=_0x107bb4['smsPause']||![];this[_0x8613('0xf')]=_0x107bb4[_0x8613('0xf')]||![];this[_0x8613('0x10')]=_0x8613('0x11');this['chatStatusTime']=0x0;this['chatCapacity']=_0x107bb4[_0x8613('0x12')]||0x0;this[_0x8613('0x13')]=0x0;this[_0x8613('0x14')]='unknown';this[_0x8613('0x15')]=0x0;this[_0x8613('0x16')]=_0x107bb4[_0x8613('0x16')]||0x0;this[_0x8613('0x17')]=0x0;this[_0x8613('0x18')]=_0x8613('0x11');this[_0x8613('0x19')]=0x0;this[_0x8613('0x1a')]=_0x107bb4[_0x8613('0x1a')]||0x0;this[_0x8613('0x1b')]=0x0;this['smsStatus']=_0x8613('0x11');this[_0x8613('0x1c')]=0x0;this[_0x8613('0x1d')]=_0x107bb4[_0x8613('0x1d')]||0x0;this[_0x8613('0x1e')]=0x0;this[_0x8613('0x1f')]='unknown';this['whatsappStatusTime']=0x0;this[_0x8613('0x20')]=_0x107bb4[_0x8613('0x20')]||0x0;this[_0x8613('0x21')]=0x0;this[_0x8613('0x22')]='unknown';this[_0x8613('0x23')]=0x0;this['openchannelCapacity']=_0x107bb4[_0x8613('0x24')]||0x0;this[_0x8613('0x25')]=0x0;this[_0x8613('0x26')]=![];this[_0x8613('0x27')]=undefined;this[_0x8613('0x2')]='';this[_0x8613('0x28')]();}Agent[_0x8613('0x29')][_0x8613('0x2a')]=function(_0x44a446){if(this[_0x44a446+_0x8613('0x2b')]>0x0){if(this[_0x44a446+_0x8613('0x2c')]>0x0&&this[_0x44a446+'CurrentCapacity']>=this[_0x44a446+'Capacity']){return'maxcapacity';}else{return _0x8613('0x2d');}}else{return'idle';}};Agent[_0x8613('0x29')]['updateRealtime']=function(){var _0x45f065=[_0x8613('0x2e'),_0x8613('0x2f'),'openchannel',_0x8613('0x30'),_0x8613('0x31'),_0x8613('0x32')];for(var _0x2d26ee=0x0;_0x2d26ee<_0x45f065[_0x8613('0x33')];_0x2d26ee+=0x1){var _0x284812=this[_0x8613('0x2a')](_0x45f065[_0x2d26ee]);if(this[_0x45f065[_0x2d26ee]+_0x8613('0x34')]!==_0x284812){this[_0x45f065[_0x2d26ee]+_0x8613('0x35')]=_['toNumber'](moment()[_0x8613('0x36')]('x'));}this[_0x45f065[_0x2d26ee]+'Status']=_0x284812;}var _0x8656e6={'id':this['id'],'name':this[_0x8613('0x9')],'online':this[_0x8613('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x8613('0xc')],'mailPause':this[_0x8613('0xd')],'smsPause':this[_0x8613('0x37')],'faxPause':this[_0x8613('0xe')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x8613('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x8613('0x18')],'faxStatusTime':this[_0x8613('0x19')],'faxCapacity':this[_0x8613('0x1a')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x8613('0x38')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x8613('0x39')],'whatsappCapacity':this[_0x8613('0x20')],'whatsappCurrentCapacity':this[_0x8613('0x21')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x8613('0x24')],'openchannelCurrentCapacity':this[_0x8613('0x25')],'busy':this[_0x8613('0x26')],'busyQueue':this[_0x8613('0x27')]};var _0x585eae=md5(JSON[_0x8613('0x3a')](_0x8656e6));if(this['md5']!==_0x585eae){this[_0x8613('0x2')]=_0x585eae;io[_0x8613('0x3b')](_0x8613('0x3c'),_0x8656e6);}};module['exports']=Agent; \ No newline at end of file +var _0x20cc=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','openchannel','fax','whatsapp','length','Status','StatusTime','toNumber','whatsappStatusTime','openchannelCurrentCapacity','user:save','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity'];(function(_0x1872d7,_0x23d7f4){var _0x4b68d8=function(_0x5dc506){while(--_0x5dc506){_0x1872d7['push'](_0x1872d7['shift']());}};_0x4b68d8(++_0x23d7f4);}(_0x20cc,0x196));var _0xc20c=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x20cc[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0xc20c('0x0'));var moment=require(_0xc20c('0x1'));var md5=require(_0xc20c('0x2'));var Redis=require('ioredis');var config=require(_0xc20c('0x3'));config[_0xc20c('0x4')]=_[_0xc20c('0x5')](config[_0xc20c('0x4')],{'host':_0xc20c('0x6'),'port':0x18eb});var io=require(_0xc20c('0x7'))(new Redis(config[_0xc20c('0x4')]));function Agent(_0x2d311c){this['id']=_0x2d311c['id']||0x0;this[_0xc20c('0x8')]=_0x2d311c[_0xc20c('0x8')]||'';this[_0xc20c('0x9')]=_0x2d311c[_0xc20c('0x9')]||!![];this['voicePause']=_0x2d311c[_0xc20c('0xa')]||![];this[_0xc20c('0xb')]=_0x2d311c['chatPause']||![];this[_0xc20c('0xc')]=_0x2d311c[_0xc20c('0xc')]||![];this['faxPause']=_0x2d311c[_0xc20c('0xd')]||![];this[_0xc20c('0xe')]=_0x2d311c[_0xc20c('0xe')]||![];this[_0xc20c('0xf')]=_0x2d311c[_0xc20c('0xf')]||![];this['chatStatus']=_0xc20c('0x10');this[_0xc20c('0x11')]=0x0;this[_0xc20c('0x12')]=_0x2d311c[_0xc20c('0x12')]||0x0;this[_0xc20c('0x13')]=0x0;this[_0xc20c('0x14')]=_0xc20c('0x10');this[_0xc20c('0x15')]=0x0;this[_0xc20c('0x16')]=_0x2d311c['mailCapacity']||0x0;this[_0xc20c('0x17')]=0x0;this['faxStatus']=_0xc20c('0x10');this[_0xc20c('0x18')]=0x0;this[_0xc20c('0x19')]=_0x2d311c[_0xc20c('0x19')]||0x0;this[_0xc20c('0x1a')]=0x0;this[_0xc20c('0x1b')]=_0xc20c('0x10');this[_0xc20c('0x1c')]=0x0;this[_0xc20c('0x1d')]=_0x2d311c[_0xc20c('0x1d')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xc20c('0x1e')]=_0xc20c('0x10');this['whatsappStatusTime']=0x0;this[_0xc20c('0x1f')]=_0x2d311c[_0xc20c('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xc20c('0x10');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x2d311c[_0xc20c('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xc20c('0x21')]=![];this[_0xc20c('0x22')]=undefined;this[_0xc20c('0x2')]='';this['updateRealtime']();}Agent[_0xc20c('0x23')][_0xc20c('0x24')]=function(_0x1dae6c){if(this[_0x1dae6c+_0xc20c('0x25')]>0x0){if(this[_0x1dae6c+_0xc20c('0x26')]>0x0&&this[_0x1dae6c+'CurrentCapacity']>=this[_0x1dae6c+_0xc20c('0x26')]){return _0xc20c('0x27');}else{return _0xc20c('0x28');}}else{return _0xc20c('0x29');}};Agent[_0xc20c('0x23')][_0xc20c('0x2a')]=function(){var _0x195971=[_0xc20c('0x2b'),'chat',_0xc20c('0x2c'),_0xc20c('0x2d'),'sms',_0xc20c('0x2e')];for(var _0x4f43a2=0x0;_0x4f43a2<_0x195971[_0xc20c('0x2f')];_0x4f43a2+=0x1){var _0xa55d11=this[_0xc20c('0x24')](_0x195971[_0x4f43a2]);if(this[_0x195971[_0x4f43a2]+_0xc20c('0x30')]!==_0xa55d11){this[_0x195971[_0x4f43a2]+_0xc20c('0x31')]=_[_0xc20c('0x32')](moment()['format']('x'));}this[_0x195971[_0x4f43a2]+_0xc20c('0x30')]=_0xa55d11;}var _0x5a6a94={'id':this['id'],'name':this[_0xc20c('0x8')],'online':this['online'],'voicePause':this[_0xc20c('0xa')],'chatPause':this[_0xc20c('0xb')],'mailPause':this[_0xc20c('0xc')],'smsPause':this[_0xc20c('0xe')],'faxPause':this[_0xc20c('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xc20c('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xc20c('0x13')],'mailStatus':this[_0xc20c('0x14')],'mailStatusTime':this[_0xc20c('0x15')],'mailCapacity':this[_0xc20c('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xc20c('0x19')],'faxCurrentCapacity':this[_0xc20c('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xc20c('0x1c')],'smsCapacity':this[_0xc20c('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xc20c('0x1e')],'whatsappStatusTime':this[_0xc20c('0x33')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xc20c('0x20')],'openchannelCurrentCapacity':this[_0xc20c('0x34')],'busy':this[_0xc20c('0x21')],'busyQueue':this[_0xc20c('0x22')]};var _0xbdaf1f=md5(JSON['stringify'](_0x5a6a94));if(this[_0xc20c('0x2')]!==_0xbdaf1f){this[_0xc20c('0x2')]=_0xbdaf1f;io['emit'](_0xc20c('0x35'),_0x5a6a94);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d4dce13..4c99295 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 _0xf405=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','loggedIn','chatPause','available','stringify','md5','chat:queue:%s','emit','chat_queue:save','exports','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0xf405,0x1a9));var _0x5f40=function(_0x51ff06,_0x1065ae){_0x51ff06=_0x51ff06-0x0;var _0x2a9087=_0xf405[_0x51ff06];return _0x2a9087;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x5f40('0x0'));var Redis=require('ioredis');var config=require(_0x5f40('0x1'));config[_0x5f40('0x2')]=_['defaults'](config[_0x5f40('0x2')],{'host':_0x5f40('0x3'),'port':0x18eb});var io=require(_0x5f40('0x4'))(new Redis(config[_0x5f40('0x2')]));function ChatQueue(_0x15e4ea){this['id']=_0x15e4ea['id']||0x0;this[_0x5f40('0x5')]=_0x15e4ea[_0x5f40('0x5')]||'';this[_0x5f40('0x6')]=_0x15e4ea[_0x5f40('0x6')]||0xa;this[_0x5f40('0x7')]=_0x15e4ea[_0x5f40('0x7')]||_0x5f40('0x8');this[_0x5f40('0x9')]=_0x15e4ea['Agents'];this[_0x5f40('0xa')]={};this[_0x5f40('0xb')]=0x0;this['md5']='';this[_0x5f40('0xc')]();this[_0x5f40('0xd')]();}ChatQueue[_0x5f40('0xe')]['updateRouting']=function(){var _0x1adfe4=this[_0x5f40('0xa')][_0x5f40('0xf')];this[_0x5f40('0xa')]=_[_0x5f40('0x10')](this[_0x5f40('0x9')],'id');this[_0x5f40('0xa')]['_rr']=_0x1adfe4;};ChatQueue['prototype'][_0x5f40('0xd')]=function(){this['loggedIn']=0x0;this[_0x5f40('0x11')]=0x0;for(var _0x4dc0da=0x0;_0x4dc0da=0x0?this[_0x5f40('0x14')]:0x0;var _0x4520a6={'id':this['id'],'available':this[_0x5f40('0x14')],'loggedIn':this[_0x5f40('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x2adad5=md5(JSON[_0x5f40('0x15')](_0x4520a6));if(this[_0x5f40('0x16')]!==_0x2adad5){this['md5']=_0x2adad5;io['to'](util['format'](_0x5f40('0x17'),_0x4520a6[_0x5f40('0x5')]))[_0x5f40('0x18')](_0x5f40('0x19'),_0x4520a6);}};module[_0x5f40('0x1a')]=ChatQueue; \ No newline at end of file +var _0xd007=['emit','chat_queue:save','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','map','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s'];(function(_0x3ea10f,_0x179252){var _0xae757f=function(_0x48d520){while(--_0x48d520){_0x3ea10f['push'](_0x3ea10f['shift']());}};_0xae757f(++_0x179252);}(_0xd007,0x1c2));var _0x7d00=function(_0x138468,_0x56982e){_0x138468=_0x138468-0x0;var _0x2b064d=_0xd007[_0x138468];return _0x2b064d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7d00('0x0'));var Redis=require('ioredis');var config=require(_0x7d00('0x1'));config[_0x7d00('0x2')]=_[_0x7d00('0x3')](config['redis'],{'host':_0x7d00('0x4'),'port':0x18eb});var io=require(_0x7d00('0x5'))(new Redis(config['redis']));function ChatQueue(_0x54c865){this['id']=_0x54c865['id']||0x0;this[_0x7d00('0x6')]=_0x54c865[_0x7d00('0x6')]||'';this[_0x7d00('0x7')]=_0x54c865[_0x7d00('0x7')]||0xa;this[_0x7d00('0x8')]=_0x54c865['strategy']||_0x7d00('0x9');this[_0x7d00('0xa')]=_0x54c865[_0x7d00('0xa')];this[_0x7d00('0xb')]={};this['waiting']=0x0;this[_0x7d00('0xc')]='';this[_0x7d00('0xd')]();this[_0x7d00('0xe')]();}ChatQueue[_0x7d00('0xf')][_0x7d00('0xd')]=function(){var _0x12763a=this[_0x7d00('0xb')]['_rr'];this[_0x7d00('0xb')]=_[_0x7d00('0x10')](this[_0x7d00('0xa')],'id');this[_0x7d00('0xb')]['_rr']=_0x12763a;};ChatQueue[_0x7d00('0xf')][_0x7d00('0xe')]=function(){this['loggedIn']=0x0;this[_0x7d00('0x11')]=0x0;for(var _0xcc12bd=0x0;_0xcc12bd=0x0?this['available']:0x0;var _0x2b2fec={'id':this['id'],'available':this[_0x7d00('0x16')],'loggedIn':this[_0x7d00('0x14')],'name':this['name'],'paused':this[_0x7d00('0x11')],'waiting':this['waiting']};var _0x573866=md5(JSON[_0x7d00('0x17')](_0x2b2fec));if(this['md5']!==_0x573866){this[_0x7d00('0xc')]=_0x573866;io['to'](util[_0x7d00('0x18')](_0x7d00('0x19'),_0x2b2fec[_0x7d00('0x6')]))[_0x7d00('0x1a')](_0x7d00('0x1b'),_0x2b2fec);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index ce2547e..7ea2177 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 _0xadbd=['waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','paused','length','loggedIn','faxPause','available'];(function(_0x4ca1d5,_0x1b7935){var _0x48695a=function(_0x4fe487){while(--_0x4fe487){_0x4ca1d5['push'](_0x4ca1d5['shift']());}};_0x48695a(++_0x1b7935);}(_0xadbd,0xe0));var _0xdadb=function(_0x472a58,_0x3c2993){_0x472a58=_0x472a58-0x0;var _0x35c87e=_0xadbd[_0x472a58];return _0x35c87e;};'use strict';var _=require(_0xdadb('0x0'));var md5=require(_0xdadb('0x1'));var util=require(_0xdadb('0x2'));var Redis=require(_0xdadb('0x3'));var config=require(_0xdadb('0x4'));config[_0xdadb('0x5')]=_[_0xdadb('0x6')](config[_0xdadb('0x5')],{'host':_0xdadb('0x7'),'port':0x18eb});var io=require(_0xdadb('0x8'))(new Redis(config['redis']));function FaxQueue(_0x19e213){this['id']=_0x19e213['id']||0x0;this[_0xdadb('0x9')]=_0x19e213['name']||'';this[_0xdadb('0xa')]=_0x19e213[_0xdadb('0xa')]||0xa;this['strategy']=_0x19e213[_0xdadb('0xb')]||'beepall';this[_0xdadb('0xc')]=_0x19e213['Agents'];this[_0xdadb('0xd')]={};this['waiting']=0x0;this[_0xdadb('0x1')]='';this[_0xdadb('0xe')]();this[_0xdadb('0xf')]();}FaxQueue[_0xdadb('0x10')]['updateRouting']=function(){var _0x2e4691=this[_0xdadb('0xd')]['_rr'];this[_0xdadb('0xd')]=_[_0xdadb('0x11')](this[_0xdadb('0xc')],'id');this[_0xdadb('0xd')][_0xdadb('0x12')]=_0x2e4691;};FaxQueue[_0xdadb('0x10')][_0xdadb('0xf')]=function(){this['loggedIn']=0x0;this[_0xdadb('0x13')]=0x0;for(var _0x360465=0x0;_0x360465=0x0?this['available']:0x0;var _0xbc49ff={'id':this['id'],'available':this[_0xdadb('0x17')],'loggedIn':this[_0xdadb('0x15')],'name':this['name'],'paused':this[_0xdadb('0x13')],'waiting':this[_0xdadb('0x18')]};var _0x379524=md5(JSON[_0xdadb('0x19')](_0xbc49ff));if(this['md5']!==_0x379524){this[_0xdadb('0x1')]=_0x379524;io['to'](util[_0xdadb('0x1a')](_0xdadb('0x1b'),_0xbc49ff['name']))[_0xdadb('0x1c')](_0xdadb('0x1d'),_0xbc49ff);}};module[_0xdadb('0x1e')]=FaxQueue; \ No newline at end of file +var _0x015b=['updateRealtime','loggedIn','length','paused','available','stringify','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr'];(function(_0x1f7420,_0x46922d){var _0x5574ac=function(_0x48f0e4){while(--_0x48f0e4){_0x1f7420['push'](_0x1f7420['shift']());}};_0x5574ac(++_0x46922d);}(_0x015b,0x10e));var _0xb015=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x015b[_0x11f249];return _0x5c3656;};'use strict';var _=require(_0xb015('0x0'));var md5=require(_0xb015('0x1'));var util=require(_0xb015('0x2'));var Redis=require(_0xb015('0x3'));var config=require(_0xb015('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb015('0x5'))(new Redis(config[_0xb015('0x6')]));function FaxQueue(_0x245b4f){this['id']=_0x245b4f['id']||0x0;this[_0xb015('0x7')]=_0x245b4f[_0xb015('0x7')]||'';this[_0xb015('0x8')]=_0x245b4f[_0xb015('0x8')]||0xa;this[_0xb015('0x9')]=_0x245b4f[_0xb015('0x9')]||'beepall';this[_0xb015('0xa')]=_0x245b4f[_0xb015('0xa')];this[_0xb015('0xb')]={};this[_0xb015('0xc')]=0x0;this[_0xb015('0x1')]='';this[_0xb015('0xd')]();this['updateRealtime']();}FaxQueue[_0xb015('0xe')]['updateRouting']=function(){var _0x11fb78=this['mapAgentsId'][_0xb015('0xf')];this[_0xb015('0xb')]=_['map'](this[_0xb015('0xa')],'id');this['mapAgentsId'][_0xb015('0xf')]=_0x11fb78;};FaxQueue[_0xb015('0xe')][_0xb015('0x10')]=function(){this[_0xb015('0x11')]=0x0;this['paused']=0x0;for(var _0x3c5443=0x0;_0x3c5443=0x0?this[_0xb015('0x14')]:0x0;var _0x15c50c={'id':this['id'],'available':this[_0xb015('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xb015('0x7')],'paused':this['paused'],'waiting':this[_0xb015('0xc')]};var _0x225607=md5(JSON[_0xb015('0x15')](_0x15c50c));if(this[_0xb015('0x1')]!==_0x225607){this[_0xb015('0x1')]=_0x225607;io['to'](util[_0xb015('0x16')]('fax:queue:%s',_0x15c50c['name']))[_0xb015('0x17')](_0xb015('0x18'),_0x15c50c);}};module[_0xb015('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 d94353c..82b4478 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 _0xa074=['exports','name','Intervals'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa074,0x1b1));var _0x4a07=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa074[_0x42cae2];return _0x5f256f;};'use strict';function Interval(_0x47ab85){this['id']=_0x47ab85['id']||0x0;this['name']=_0x47ab85[_0x4a07('0x0')]||'';this[_0x4a07('0x1')]=_0x47ab85[_0x4a07('0x1')]||{};}module[_0x4a07('0x2')]=Interval; \ No newline at end of file +var _0x076f=['Intervals','exports','name'];(function(_0x414fe5,_0x342c98){var _0x562d7b=function(_0x199169){while(--_0x199169){_0x414fe5['push'](_0x414fe5['shift']());}};_0x562d7b(++_0x342c98);}(_0x076f,0x197));var _0xf076=function(_0x32de8c,_0x2bfb6d){_0x32de8c=_0x32de8c-0x0;var _0x3f8c0d=_0x076f[_0x32de8c];return _0x3f8c0d;};'use strict';function Interval(_0x97b7f0){this['id']=_0x97b7f0['id']||0x0;this['name']=_0x97b7f0[_0xf076('0x0')]||'';this['Intervals']=_0x97b7f0[_0xf076('0x1')]||{};}module[_0xf076('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 08cb229..a712bfd 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 _0x746a=['ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','mailPause','available','waiting','format','mail_queue:save','exports','lodash','util'];(function(_0x188bfe,_0x2517cc){var _0x1a9efa=function(_0x361964){while(--_0x361964){_0x188bfe['push'](_0x188bfe['shift']());}};_0x1a9efa(++_0x2517cc);}(_0x746a,0x1b1));var _0xa746=function(_0x373340,_0x17f7d9){_0x373340=_0x373340-0x0;var _0x17378c=_0x746a[_0x373340];return _0x17378c;};'use strict';var _=require(_0xa746('0x0'));var md5=require('md5');var util=require(_0xa746('0x1'));var Redis=require(_0xa746('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xa746('0x3')](config[_0xa746('0x4')],{'host':_0xa746('0x5'),'port':0x18eb});var io=require(_0xa746('0x6'))(new Redis(config[_0xa746('0x4')]));function MailQueue(_0x1fb77f){this['id']=_0x1fb77f['id']||0x0;this[_0xa746('0x7')]=_0x1fb77f[_0xa746('0x7')]||'';this[_0xa746('0x8')]=_0x1fb77f[_0xa746('0x8')]||0xa;this['strategy']=_0x1fb77f[_0xa746('0x9')]||_0xa746('0xa');this['Agents']=_0x1fb77f[_0xa746('0xb')];this[_0xa746('0xc')]={};this['waiting']=0x0;this[_0xa746('0xd')]='';this[_0xa746('0xe')]();this[_0xa746('0xf')]();}MailQueue['prototype'][_0xa746('0xe')]=function(){var _0x38d9bb=this[_0xa746('0xc')][_0xa746('0x10')];this[_0xa746('0xc')]=_[_0xa746('0x11')](this[_0xa746('0xb')],'id');this[_0xa746('0xc')][_0xa746('0x10')]=_0x38d9bb;};MailQueue[_0xa746('0x12')][_0xa746('0xf')]=function(){this['loggedIn']=0x0;this[_0xa746('0x13')]=0x0;for(var _0x406f94=0x0;_0x406f94=0x0?this[_0xa746('0x18')]:0x0;var _0x5dc394={'id':this['id'],'available':this[_0xa746('0x18')],'loggedIn':this[_0xa746('0x16')],'name':this[_0xa746('0x7')],'paused':this[_0xa746('0x13')],'waiting':this[_0xa746('0x19')]};var _0x519632=md5(JSON['stringify'](_0x5dc394));if(this['md5']!==_0x519632){this[_0xa746('0xd')]=_0x519632;io['to'](util[_0xa746('0x1a')]('mail:queue:%s',_0x5dc394['name']))['emit'](_0xa746('0x1b'),_0x5dc394);}};module[_0xa746('0x1c')]=MailQueue; \ No newline at end of file +var _0x9800=['exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','paused','available','waiting','stringify','format','emit','mail_queue:save'];(function(_0x4c5232,_0x270c3e){var _0x47ade2=function(_0xf67096){while(--_0xf67096){_0x4c5232['push'](_0x4c5232['shift']());}};_0x47ade2(++_0x270c3e);}(_0x9800,0xa9));var _0x0980=function(_0x97833d,_0x4d6c31){_0x97833d=_0x97833d-0x0;var _0x49e829=_0x9800[_0x97833d];return _0x49e829;};'use strict';var _=require(_0x0980('0x0'));var md5=require(_0x0980('0x1'));var util=require(_0x0980('0x2'));var Redis=require('ioredis');var config=require(_0x0980('0x3'));config[_0x0980('0x4')]=_[_0x0980('0x5')](config[_0x0980('0x4')],{'host':_0x0980('0x6'),'port':0x18eb});var io=require(_0x0980('0x7'))(new Redis(config['redis']));function MailQueue(_0x5a8c5a){this['id']=_0x5a8c5a['id']||0x0;this[_0x0980('0x8')]=_0x5a8c5a[_0x0980('0x8')]||'';this[_0x0980('0x9')]=_0x5a8c5a[_0x0980('0x9')]||0xa;this[_0x0980('0xa')]=_0x5a8c5a[_0x0980('0xa')]||'beepall';this[_0x0980('0xb')]=_0x5a8c5a[_0x0980('0xb')];this[_0x0980('0xc')]={};this['waiting']=0x0;this[_0x0980('0x1')]='';this[_0x0980('0xd')]();this[_0x0980('0xe')]();}MailQueue[_0x0980('0xf')][_0x0980('0xd')]=function(){var _0x3a018c=this[_0x0980('0xc')][_0x0980('0x10')];this[_0x0980('0xc')]=_[_0x0980('0x11')](this['Agents'],'id');this[_0x0980('0xc')][_0x0980('0x10')]=_0x3a018c;};MailQueue['prototype']['updateRealtime']=function(){this[_0x0980('0x12')]=0x0;this['paused']=0x0;for(var _0x4f8dab=0x0;_0x4f8dab=0x0?this['available']:0x0;var _0x542a40={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x0980('0x8')],'paused':this[_0x0980('0x14')],'waiting':this[_0x0980('0x16')]};var _0x4334ac=md5(JSON[_0x0980('0x17')](_0x542a40));if(this['md5']!==_0x4334ac){this[_0x0980('0x1')]=_0x4334ac;io['to'](util[_0x0980('0x18')]('mail:queue:%s',_0x542a40[_0x0980('0x8')]))[_0x0980('0x19')](_0x0980('0x1a'),_0x542a40);}};module[_0x0980('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f99ae39..405f06e 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x567be0,_0x4a60b6){var _0x38cab1=function(_0x46b343){while(--_0x46b343){_0x567be0['push'](_0x567be0['shift']());}};_0x38cab1(++_0x4a60b6);}(_0x814b,0x1a2));var _0xb814=function(_0x32f193,_0x612afc){_0x32f193=_0x32f193-0x0;var _0x5bb92e=_0x814b[_0x32f193];return _0x5bb92e;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x326f,0xd1));var _0xf326=function(_0x59fe84,_0xcd7a7e){_0x59fe84=_0x59fe84-0x0;var _0x81332=_0x326f[_0x59fe84];return _0x81332;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 136bfb7..ea1cd57 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 _0xde64=['sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify','format'];(function(_0x44bb15,_0x3fc1e9){var _0x4fdd05=function(_0x744b60){while(--_0x744b60){_0x44bb15['push'](_0x44bb15['shift']());}};_0x4fdd05(++_0x3fc1e9);}(_0xde64,0x17c));var _0x4de6=function(_0x19991d,_0x12ca7b){_0x19991d=_0x19991d-0x0;var _0x337f98=_0xde64[_0x19991d];return _0x337f98;};'use strict';var _=require(_0x4de6('0x0'));var md5=require(_0x4de6('0x1'));var util=require(_0x4de6('0x2'));var Redis=require(_0x4de6('0x3'));var config=require(_0x4de6('0x4'));config[_0x4de6('0x5')]=_['defaults'](config[_0x4de6('0x5')],{'host':_0x4de6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0xe0bed){this['id']=_0xe0bed['id']||0x0;this[_0x4de6('0x7')]=_0xe0bed['name']||'';this['timeout']=_0xe0bed[_0x4de6('0x8')]||0xa;this[_0x4de6('0x9')]=_0xe0bed[_0x4de6('0x9')]||_0x4de6('0xa');this[_0x4de6('0xb')]=_0xe0bed[_0x4de6('0xb')];this['mapAgentsId']={};this[_0x4de6('0xc')]=0x0;this[_0x4de6('0x1')]='';this[_0x4de6('0xd')]();this['updateRealtime']();}SmsQueue[_0x4de6('0xe')][_0x4de6('0xd')]=function(){var _0x2e205b=this[_0x4de6('0xf')][_0x4de6('0x10')];this['mapAgentsId']=_[_0x4de6('0x11')](this[_0x4de6('0xb')],'id');this[_0x4de6('0xf')]['_rr']=_0x2e205b;};SmsQueue[_0x4de6('0xe')][_0x4de6('0x12')]=function(){this[_0x4de6('0x13')]=0x0;this[_0x4de6('0x14')]=0x0;for(var _0x58b0c1=0x0;_0x58b0c1=0x0?this[_0x4de6('0x16')]:0x0;var _0x5aacb4={'id':this['id'],'available':this[_0x4de6('0x16')],'loggedIn':this[_0x4de6('0x13')],'name':this[_0x4de6('0x7')],'paused':this[_0x4de6('0x14')],'waiting':this[_0x4de6('0xc')]};var _0x360cf7=md5(JSON[_0x4de6('0x17')](_0x5aacb4));if(this[_0x4de6('0x1')]!==_0x360cf7){this[_0x4de6('0x1')]=_0x360cf7;io['to'](util[_0x4de6('0x18')]('sms:queue:%s',_0x5aacb4[_0x4de6('0x7')]))['emit'](_0x4de6('0x19'),_0x5aacb4);}};module[_0x4de6('0x1a')]=SmsQueue; \ No newline at end of file +var _0xe94a=['timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x32b76e,_0x14b20f){var _0x45177f=function(_0x44a335){while(--_0x44a335){_0x32b76e['push'](_0x32b76e['shift']());}};_0x45177f(++_0x14b20f);}(_0xe94a,0x1c7));var _0xae94=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0xe94a[_0x212a37];return _0x5d0bf9;};'use strict';var _=require(_0xae94('0x0'));var md5=require(_0xae94('0x1'));var util=require(_0xae94('0x2'));var Redis=require('ioredis');var config=require(_0xae94('0x3'));config[_0xae94('0x4')]=_[_0xae94('0x5')](config[_0xae94('0x4')],{'host':_0xae94('0x6'),'port':0x18eb});var io=require(_0xae94('0x7'))(new Redis(config['redis']));function SmsQueue(_0x429d6d){this['id']=_0x429d6d['id']||0x0;this[_0xae94('0x8')]=_0x429d6d[_0xae94('0x8')]||'';this[_0xae94('0x9')]=_0x429d6d[_0xae94('0x9')]||0xa;this['strategy']=_0x429d6d['strategy']||_0xae94('0xa');this[_0xae94('0xb')]=_0x429d6d['Agents'];this[_0xae94('0xc')]={};this[_0xae94('0xd')]=0x0;this[_0xae94('0x1')]='';this[_0xae94('0xe')]();this[_0xae94('0xf')]();}SmsQueue[_0xae94('0x10')][_0xae94('0xe')]=function(){var _0x3e24c6=this['mapAgentsId']['_rr'];this[_0xae94('0xc')]=_[_0xae94('0x11')](this['Agents'],'id');this[_0xae94('0xc')]['_rr']=_0x3e24c6;};SmsQueue[_0xae94('0x10')][_0xae94('0xf')]=function(){this[_0xae94('0x12')]=0x0;this[_0xae94('0x13')]=0x0;for(var _0x223e35=0x0;_0x223e35=0x0?this[_0xae94('0x16')]:0x0;var _0x382b4a={'id':this['id'],'available':this[_0xae94('0x16')],'loggedIn':this[_0xae94('0x12')],'name':this['name'],'paused':this[_0xae94('0x13')],'waiting':this[_0xae94('0xd')]};var _0x5a0cdd=md5(JSON[_0xae94('0x17')](_0x382b4a));if(this[_0xae94('0x1')]!==_0x5a0cdd){this['md5']=_0x5a0cdd;io['to'](util[_0xae94('0x18')](_0xae94('0x19'),_0x382b4a[_0xae94('0x8')]))[_0xae94('0x1a')](_0xae94('0x1b'),_0x382b4a);}};module[_0xae94('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index b74ac6d..c90ea7a 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d2f=['format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','whatsappPause','available','waiting','stringify'];(function(_0x4e28e2,_0x287b19){var _0x9bd1ee=function(_0xcee473){while(--_0xcee473){_0x4e28e2['push'](_0x4e28e2['shift']());}};_0x9bd1ee(++_0x287b19);}(_0x2d2f,0x165));var _0xf2d2=function(_0x182a8d,_0xe7c25){_0x182a8d=_0x182a8d-0x0;var _0x2e345f=_0x2d2f[_0x182a8d];return _0x2e345f;};'use strict';var _=require(_0xf2d2('0x0'));var md5=require(_0xf2d2('0x1'));var util=require(_0xf2d2('0x2'));var Redis=require(_0xf2d2('0x3'));var config=require(_0xf2d2('0x4'));config[_0xf2d2('0x5')]=_[_0xf2d2('0x6')](config[_0xf2d2('0x5')],{'host':_0xf2d2('0x7'),'port':0x18eb});var io=require(_0xf2d2('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x399c8e){this['id']=_0x399c8e['id']||0x0;this[_0xf2d2('0x9')]=_0x399c8e[_0xf2d2('0x9')]||'';this[_0xf2d2('0xa')]=_0x399c8e['timeout']||0xa;this[_0xf2d2('0xb')]=_0x399c8e[_0xf2d2('0xb')]||_0xf2d2('0xc');this[_0xf2d2('0xd')]=_0x399c8e[_0xf2d2('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xf2d2('0xe')]();this[_0xf2d2('0xf')]();}WhatsappQueue[_0xf2d2('0x10')]['updateRouting']=function(){var _0xdd9670=this[_0xf2d2('0x11')][_0xf2d2('0x12')];this['mapAgentsId']=_[_0xf2d2('0x13')](this[_0xf2d2('0xd')],'id');this[_0xf2d2('0x11')][_0xf2d2('0x12')]=_0xdd9670;};WhatsappQueue[_0xf2d2('0x10')][_0xf2d2('0xf')]=function(){this[_0xf2d2('0x14')]=0x0;this[_0xf2d2('0x15')]=0x0;for(var _0x1d1fef=0x0;_0x1d1fef=0x0?this[_0xf2d2('0x18')]:0x0;var _0x3b90c1={'id':this['id'],'available':this[_0xf2d2('0x18')],'loggedIn':this[_0xf2d2('0x14')],'name':this[_0xf2d2('0x9')],'paused':this['paused'],'waiting':this[_0xf2d2('0x19')]};var _0x4a65eb=md5(JSON[_0xf2d2('0x1a')](_0x3b90c1));if(this[_0xf2d2('0x1')]!==_0x4a65eb){this[_0xf2d2('0x1')]=_0x4a65eb;io['to'](util[_0xf2d2('0x1b')](_0xf2d2('0x1c'),_0x3b90c1[_0xf2d2('0x9')]))[_0xf2d2('0x1d')](_0xf2d2('0x1e'),_0x3b90c1);}};module[_0xf2d2('0x1f')]=WhatsappQueue; \ No newline at end of file +var _0x5438=['timeout','strategy','Agents','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','length','whatsappPause','paused','available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name'];(function(_0x13745c,_0x302072){var _0x143fcb=function(_0x54a73a){while(--_0x54a73a){_0x13745c['push'](_0x13745c['shift']());}};_0x143fcb(++_0x302072);}(_0x5438,0x12c));var _0x8543=function(_0x1968ef,_0x5218db){_0x1968ef=_0x1968ef-0x0;var _0x2d2dfa=_0x5438[_0x1968ef];return _0x2d2dfa;};'use strict';var _=require('lodash');var md5=require(_0x8543('0x0'));var util=require(_0x8543('0x1'));var Redis=require(_0x8543('0x2'));var config=require(_0x8543('0x3'));config[_0x8543('0x4')]=_[_0x8543('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8543('0x6'))(new Redis(config[_0x8543('0x4')]));function WhatsappQueue(_0x10544e){this['id']=_0x10544e['id']||0x0;this[_0x8543('0x7')]=_0x10544e[_0x8543('0x7')]||'';this['timeout']=_0x10544e[_0x8543('0x8')]||0xa;this[_0x8543('0x9')]=_0x10544e[_0x8543('0x9')]||'beepall';this[_0x8543('0xa')]=_0x10544e[_0x8543('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8543('0x0')]='';this[_0x8543('0xb')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x8543('0xb')]=function(){var _0x3c1abf=this[_0x8543('0xc')][_0x8543('0xd')];this[_0x8543('0xc')]=_[_0x8543('0xe')](this[_0x8543('0xa')],'id');this[_0x8543('0xc')]['_rr']=_0x3c1abf;};WhatsappQueue[_0x8543('0xf')][_0x8543('0x10')]=function(){this[_0x8543('0x11')]=0x0;this['paused']=0x0;for(var _0x1ae8c5=0x0;_0x1ae8c5=0x0?this[_0x8543('0x15')]:0x0;var _0x375cc4={'id':this['id'],'available':this[_0x8543('0x15')],'loggedIn':this[_0x8543('0x11')],'name':this[_0x8543('0x7')],'paused':this[_0x8543('0x14')],'waiting':this[_0x8543('0x16')]};var _0x9a4af6=md5(JSON[_0x8543('0x17')](_0x375cc4));if(this[_0x8543('0x0')]!==_0x9a4af6){this[_0x8543('0x0')]=_0x9a4af6;io['to'](util['format'](_0x8543('0x18'),_0x375cc4[_0x8543('0x7')]))[_0x8543('0x19')](_0x8543('0x1a'),_0x375cc4);}};module[_0x8543('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 0a6b03e..671ed34 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x31bdcd,_0x3b41da){var _0x1a956e=function(_0x14a28f){while(--_0x14a28f){_0x31bdcd['push'](_0x31bdcd['shift']());}};_0x1a956e(++_0x3b41da);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xb10b[_0x1f83a5];return _0x45edf0;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1ce3b2,_0x3bd4b7){var _0x25245c=function(_0x47c0b1){while(--_0x47c0b1){_0x1ce3b2['push'](_0x1ce3b2['shift']());}};_0x25245c(++_0x3bd4b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb10b[_0x5d2803];return _0xdcad2c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index b0f02da..b0c44f1 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 _0x8d4f=['addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x473cb0,_0x493954){var _0x3c7329=function(_0x5c7d18){while(--_0x5c7d18){_0x473cb0['push'](_0x473cb0['shift']());}};_0x3c7329(++_0x493954);}(_0x8d4f,0xd9));var _0xf8d4=function(_0x31c133,_0x3075f7){_0x31c133=_0x31c133-0x0;var _0x596121=_0x8d4f[_0x31c133];return _0x596121;};'use strict';var client=require('../client');exports[_0xf8d4('0x0')]=function(_0x15ca7d,_0x5cf69b){return client[_0xf8d4('0x1')](_0xf8d4('0x2'),{'body':_0x5cf69b,'options':{'where':{'id':_0x15ca7d}},'log':_0xf8d4('0x3')});};exports[_0xf8d4('0x4')]=function(_0x2ca4ad,_0x9b984e){return client[_0xf8d4('0x1')]('AddTagsToChatInteraction',{'body':_0x9b984e,'options':{'where':{'id':_0x2ca4ad}},'log':_0xf8d4('0x5')});}; \ No newline at end of file +var _0x5046=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x5046,0x1a8));var _0x6504=function(_0x22f759,_0x9a5480){_0x22f759=_0x22f759-0x0;var _0x3ff41b=_0x5046[_0x22f759];return _0x3ff41b;};'use strict';var client=require('../client');exports[_0x6504('0x0')]=function(_0x275fdf,_0x14e80a){return client['Request'](_0x6504('0x1'),{'body':_0x14e80a,'options':{'where':{'id':_0x275fdf}},'log':_0x6504('0x2')});};exports[_0x6504('0x3')]=function(_0x42ce19,_0x3d701d){return client[_0x6504('0x4')](_0x6504('0x5'),{'body':_0x3d701d,'options':{'where':{'id':_0x42ce19}},'log':_0x6504('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 7fb55d8..3624760 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 _0xf480=['../client','create','Request','createChatMessage'];(function(_0x51721a,_0x3cae19){var _0x1282d5=function(_0x4621d0){while(--_0x4621d0){_0x51721a['push'](_0x51721a['shift']());}};_0x1282d5(++_0x3cae19);}(_0xf480,0x1b4));var _0x0f48=function(_0x31baeb,_0x54c016){_0x31baeb=_0x31baeb-0x0;var _0x11736b=_0xf480[_0x31baeb];return _0x11736b;};'use strict';var client=require(_0x0f48('0x0'));exports[_0x0f48('0x1')]=function(_0xa89fb6){return client[_0x0f48('0x2')]('CreateChatMessage',{'body':_0xa89fb6,'log':_0x0f48('0x3')});}; \ No newline at end of file +var _0x666f=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x7a7072,_0x127e1f){var _0x16df93=function(_0x3467a9){while(--_0x3467a9){_0x7a7072['push'](_0x7a7072['shift']());}};_0x16df93(++_0x127e1f);}(_0x666f,0x19f));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0xf666('0x0'));exports[_0xf666('0x1')]=function(_0x599d7c){return client['Request'](_0xf666('0x2'),{'body':_0x599d7c,'log':_0xf666('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 1b7c74a..6a48fb5 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 _0x41f2=['getChatQueues','GetChatQueue','name','timeout','strategy','Agents','chatPause','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x41f2,0x14f));var _0x241f=function(_0x22b2d6,_0x2427c6){_0x22b2d6=_0x22b2d6-0x0;var _0x3771e4=_0x41f2[_0x22b2d6];return _0x3771e4;};'use strict';var client=require(_0x241f('0x0'));exports[_0x241f('0x1')]=function(){return function(){return client['Request'](_0x241f('0x2'),{'options':{'raw':![],'attributes':['id',_0x241f('0x3'),_0x241f('0x4'),_0x241f('0x5')],'include':[{'model':'User','as':_0x241f('0x6'),'attributes':['id',_0x241f('0x3'),'online',_0x241f('0x7')]}]},'log':_0x241f('0x1')});};}; \ No newline at end of file +var _0xfd20=['getChatQueues','name','timeout','User','online','chatPause'];(function(_0x466a3d,_0x35f671){var _0x1d1d39=function(_0x29791f){while(--_0x29791f){_0x466a3d['push'](_0x466a3d['shift']());}};_0x1d1d39(++_0x35f671);}(_0xfd20,0x66));var _0x0fd2=function(_0x3d7f78,_0x17e4d0){_0x3d7f78=_0x3d7f78-0x0;var _0x3bf252=_0xfd20[_0x3d7f78];return _0x3bf252;};'use strict';var client=require('../client');exports[_0x0fd2('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x2'),'strategy'],'include':[{'model':_0x0fd2('0x3'),'as':'Agents','attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x4'),_0x0fd2('0x5')]}]},'log':_0x0fd2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index eaf7bef..1bc3de5 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 _0xb205=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb205,0xf0));var _0x5b20=function(_0x4896fe,_0x5e2b86){_0x4896fe=_0x4896fe-0x0;var _0x1b909f=_0xb205[_0x4896fe];return _0x1b909f;};'use strict';var client=require(_0x5b20('0x0'));exports[_0x5b20('0x1')]=function(_0x3edef1){return client[_0x5b20('0x2')](_0x5b20('0x3'),{'body':_0x3edef1,'log':'CreateChatQueueReport'});};exports['update']=function(_0x37fe91,_0x573200){return client[_0x5b20('0x2')](_0x5b20('0x4'),{'body':_0x573200,'options':{'where':{'uniqueid':_0x37fe91},'order':[['id','DESC']],'limit':0x1},'log':_0x5b20('0x4')});}; \ No newline at end of file +var _0xe80c=['CreateChatQueueReport','UpdateChatQueueReport','create','Request'];(function(_0x315c69,_0x360597){var _0x1513ad=function(_0x219e5a){while(--_0x219e5a){_0x315c69['push'](_0x315c69['shift']());}};_0x1513ad(++_0x360597);}(_0xe80c,0x1c2));var _0xce80=function(_0x199dc5,_0x3223ab){_0x199dc5=_0x199dc5-0x0;var _0x16ceb3=_0xe80c[_0x199dc5];return _0x16ceb3;};'use strict';var client=require('../client');exports[_0xce80('0x0')]=function(_0x3ba4d9){return client[_0xce80('0x1')](_0xce80('0x2'),{'body':_0x3ba4d9,'log':_0xce80('0x2')});};exports['update']=function(_0x40be3f,_0xd0d912){return client[_0xce80('0x1')](_0xce80('0x3'),{'body':_0xd0d912,'options':{'where':{'uniqueid':_0x40be3f},'order':[['id','DESC']],'limit':0x1},'log':_0xce80('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 69fb3c5..c1eed20 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1cb460,_0x598254){var _0x4697be=function(_0x13de7e){while(--_0x13de7e){_0x1cb460['push'](_0x1cb460['shift']());}};_0x4697be(++_0x598254);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7a54,0x106));var _0x47a5=function(_0x94abd3,_0x167549){_0x94abd3=_0x94abd3-0x0;var _0x469923=_0x7a54[_0x94abd3];return _0x469923;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 59ed94e..5a82f4a 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 _0xc173=['CreateFaxMessage','createFaxMessage','create','Request'];(function(_0x5e657a,_0x4ec4c9){var _0x4aeefd=function(_0x31042d){while(--_0x31042d){_0x5e657a['push'](_0x5e657a['shift']());}};_0x4aeefd(++_0x4ec4c9);}(_0xc173,0x172));var _0x3c17=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc173[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x3c17('0x0')]=function(_0x413349){return client[_0x3c17('0x1')](_0x3c17('0x2'),{'body':_0x413349,'log':_0x3c17('0x3')});}; \ No newline at end of file +var _0x836d=['CreateFaxMessage','../client','Request'];(function(_0x550888,_0x321175){var _0x19bbbe=function(_0x5ef397){while(--_0x5ef397){_0x550888['push'](_0x550888['shift']());}};_0x19bbbe(++_0x321175);}(_0x836d,0x1de));var _0xd836=function(_0x2b8e07,_0x5638bc){_0x2b8e07=_0x2b8e07-0x0;var _0x2afb4c=_0x836d[_0x2b8e07];return _0x2afb4c;};'use strict';var client=require(_0xd836('0x0'));exports['create']=function(_0x332af0){return client[_0xd836('0x1')](_0xd836('0x2'),{'body':_0x332af0,'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 a8acb44..d4d7109 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 _0x3e2c=['getFaxQueues','Request','GetFaxQueue','name','strategy','User','faxPause','../client'];(function(_0x5f2e8e,_0x166dab){var _0x502714=function(_0x75e74d){while(--_0x75e74d){_0x5f2e8e['push'](_0x5f2e8e['shift']());}};_0x502714(++_0x166dab);}(_0x3e2c,0xbf));var _0xc3e2=function(_0xd8f7bd,_0x45dc8c){_0xd8f7bd=_0xd8f7bd-0x0;var _0x1bd5ee=_0x3e2c[_0xd8f7bd];return _0x1bd5ee;};'use strict';var client=require(_0xc3e2('0x0'));exports[_0xc3e2('0x1')]=function(){return function(){return client[_0xc3e2('0x2')](_0xc3e2('0x3'),{'options':{'raw':![],'attributes':['id',_0xc3e2('0x4'),'timeout',_0xc3e2('0x5')],'include':[{'model':_0xc3e2('0x6'),'as':'Agents','attributes':['id',_0xc3e2('0x4'),'online',_0xc3e2('0x7')]}]},'log':_0xc3e2('0x1')});};}; \ No newline at end of file +var _0xbb44=['online','faxPause','getFaxQueues','../client','GetFaxQueue','timeout','User','name'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xbb44,0x18b));var _0x4bb4=function(_0x150825,_0x8faa4a){_0x150825=_0x150825-0x0;var _0x1af298=_0xbb44[_0x150825];return _0x1af298;};'use strict';var client=require(_0x4bb4('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x4bb4('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x4bb4('0x2'),'strategy'],'include':[{'model':_0x4bb4('0x3'),'as':'Agents','attributes':['id',_0x4bb4('0x4'),_0x4bb4('0x5'),_0x4bb4('0x6')]}]},'log':_0x4bb4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index dc608d0..49866a4 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 _0x41c4=['UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport','update'];(function(_0x358ac9,_0x2b719b){var _0x2e26cc=function(_0x2e231f){while(--_0x2e231f){_0x358ac9['push'](_0x358ac9['shift']());}};_0x2e26cc(++_0x2b719b);}(_0x41c4,0x1ee));var _0x441c=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x41c4[_0x341e0f];return _0x59555a;};'use strict';var client=require('../client');exports[_0x441c('0x0')]=function(_0x159deb){return client[_0x441c('0x1')](_0x441c('0x2'),{'body':_0x159deb,'log':_0x441c('0x2')});};exports[_0x441c('0x3')]=function(_0x3610a6,_0x3961f9){return client['Request'](_0x441c('0x4'),{'body':_0x3961f9,'options':{'where':{'uniqueid':_0x3610a6},'order':[['id',_0x441c('0x5')]],'limit':0x1},'log':_0x441c('0x4')});}; \ No newline at end of file +var _0xf231=['DESC','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x582dc0,_0x5a359a){var _0x14a981=function(_0x3cbe6e){while(--_0x3cbe6e){_0x582dc0['push'](_0x582dc0['shift']());}};_0x14a981(++_0x5a359a);}(_0xf231,0x13d));var _0x1f23=function(_0x1ee0bc,_0x202166){_0x1ee0bc=_0x1ee0bc-0x0;var _0x2570c6=_0xf231[_0x1ee0bc];return _0x2570c6;};'use strict';var client=require(_0x1f23('0x0'));exports[_0x1f23('0x1')]=function(_0x29e9a8){return client[_0x1f23('0x2')]('CreateFaxQueueReport',{'body':_0x29e9a8,'log':_0x1f23('0x3')});};exports[_0x1f23('0x4')]=function(_0x4d94b6,_0x24f0b8){return client[_0x1f23('0x2')]('UpdateFaxQueueReport',{'body':_0x24f0b8,'options':{'where':{'uniqueid':_0x4d94b6},'order':[['id',_0x1f23('0x5')]],'limit':0x1},'log':_0x1f23('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c1be51f..c7900b1 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 _0xd279=['name','Interval','interval','getIntervals','Request','GetInterval'];(function(_0x3c271a,_0x594ffd){var _0x1a964d=function(_0x33b0f1){while(--_0x33b0f1){_0x3c271a['push'](_0x3c271a['shift']());}};_0x1a964d(++_0x594ffd);}(_0xd279,0x129));var _0x9d27=function(_0x271d10,_0x5348db){_0x271d10=_0x271d10-0x0;var _0x479491=_0xd279[_0x271d10];return _0x479491;};'use strict';var client=require('../client');exports[_0x9d27('0x0')]=function(){return function(){return client[_0x9d27('0x1')](_0x9d27('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9d27('0x3')],'include':[{'model':_0x9d27('0x4'),'as':'Intervals','attributes':['id',_0x9d27('0x3'),_0x9d27('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x955d=['Intervals','interval','../client','getIntervals','name'];(function(_0x1066bc,_0x4fb11e){var _0x592de5=function(_0x5840ca){while(--_0x5840ca){_0x1066bc['push'](_0x1066bc['shift']());}};_0x592de5(++_0x4fb11e);}(_0x955d,0x66));var _0xd955=function(_0xfded00,_0x49e297){_0xfded00=_0xfded00-0x0;var _0x1c83a6=_0x955d[_0xfded00];return _0x1c83a6;};'use strict';var client=require(_0xd955('0x0'));exports[_0xd955('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd955('0x2')],'include':[{'model':'Interval','as':_0xd955('0x3'),'attributes':['id',_0xd955('0x2'),_0xd955('0x4')]}]},'log':_0xd955('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f66e68d..8f26e5d 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 _0x0b0e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x435150,_0x591cd9){var _0x13b3a4=function(_0x44eb28){while(--_0x44eb28){_0x435150['push'](_0x435150['shift']());}};_0x13b3a4(++_0x591cd9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d3b05,_0x334c57){_0x3d3b05=_0x3d3b05-0x0;var _0x2c6ca3=_0x0b0e[_0x3d3b05];return _0x2c6ca3;};'use strict';var client=require(_0xe0b0('0x0'));exports['update']=function(_0xc416e3,_0x536e9b){return client[_0xe0b0('0x1')](_0xe0b0('0x2'),{'body':_0x536e9b,'options':{'where':{'id':_0xc416e3}},'log':_0xe0b0('0x3')});};exports[_0xe0b0('0x4')]=function(_0x28040c,_0x38a058){return client[_0xe0b0('0x1')](_0xe0b0('0x5'),{'body':_0x38a058,'options':{'where':{'id':_0x28040c}},'log':_0xe0b0('0x6')});}; \ No newline at end of file +var _0x6a95=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6a95,0x1db));var _0x56a9=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x6a95[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x15574a,_0xce37aa){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'body':_0xce37aa,'options':{'where':{'id':_0x15574a}},'log':_0x56a9('0x4')});};exports['addTags']=function(_0x512f52,_0x12cd60){return client[_0x56a9('0x2')](_0x56a9('0x5'),{'body':_0x12cd60,'options':{'where':{'id':_0x512f52}},'log':_0x56a9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 96484d5..884a2e5 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 _0x298b=['Request','CreateMailMessage','create'];(function(_0x3fd513,_0x144a3c){var _0x241b48=function(_0xe46855){while(--_0xe46855){_0x3fd513['push'](_0x3fd513['shift']());}};_0x241b48(++_0x144a3c);}(_0x298b,0x185));var _0xb298=function(_0x5940d9,_0x173c58){_0x5940d9=_0x5940d9-0x0;var _0xc1f892=_0x298b[_0x5940d9];return _0xc1f892;};'use strict';var client=require('../client');exports[_0xb298('0x0')]=function(_0x3b3365){return client[_0xb298('0x1')](_0xb298('0x2'),{'body':_0x3b3365,'log':'createMailMessage'});}; \ No newline at end of file +var _0xe1b0=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x10649b,_0xb97f60){var _0x2b35a5=function(_0x1490df){while(--_0x1490df){_0x10649b['push'](_0x10649b['shift']());}};_0x2b35a5(++_0xb97f60);}(_0xe1b0,0x1b2));var _0x0e1b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe1b0[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x0e1b('0x0'));exports[_0x0e1b('0x1')]=function(_0x4f3b58){return client[_0x0e1b('0x2')](_0x0e1b('0x3'),{'body':_0x4f3b58,'log':_0x0e1b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index be9533c..c730a64 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 _0xf546=['online','mailPause','../client','getMailQueues','Request','timeout','User','Agents'];(function(_0x555cda,_0x20b2b1){var _0x115cc2=function(_0x4ff864){while(--_0x4ff864){_0x555cda['push'](_0x555cda['shift']());}};_0x115cc2(++_0x20b2b1);}(_0xf546,0x1a2));var _0x6f54=function(_0x5ac0c1,_0x4a11fe){_0x5ac0c1=_0x5ac0c1-0x0;var _0x588e74=_0xf546[_0x5ac0c1];return _0x588e74;};'use strict';var client=require(_0x6f54('0x0'));exports[_0x6f54('0x1')]=function(){return function(){return client[_0x6f54('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x6f54('0x3'),'strategy'],'include':[{'model':_0x6f54('0x4'),'as':_0x6f54('0x5'),'attributes':['id','name',_0x6f54('0x6'),_0x6f54('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xc86e=['mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x126af7,_0x25fa06){var _0x25b500=function(_0x10ffe7){while(--_0x10ffe7){_0x126af7['push'](_0x126af7['shift']());}};_0x25b500(++_0x25fa06);}(_0xc86e,0xd0));var _0xec86=function(_0x182b51,_0x455b54){_0x182b51=_0x182b51-0x0;var _0x102ee6=_0xc86e[_0x182b51];return _0x102ee6;};'use strict';var client=require(_0xec86('0x0'));exports[_0xec86('0x1')]=function(){return function(){return client['Request'](_0xec86('0x2'),{'options':{'raw':![],'attributes':['id',_0xec86('0x3'),_0xec86('0x4'),_0xec86('0x5')],'include':[{'model':_0xec86('0x6'),'as':_0xec86('0x7'),'attributes':['id',_0xec86('0x3'),'online',_0xec86('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index cf60c2b..7814f4b 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 _0x02e9=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x36a587,_0xfa49ec){var _0x1e3bf3=function(_0x4bb51e){while(--_0x4bb51e){_0x36a587['push'](_0x36a587['shift']());}};_0x1e3bf3(++_0xfa49ec);}(_0x02e9,0x116));var _0x902e=function(_0x1b91bb,_0xaeac0){_0x1b91bb=_0x1b91bb-0x0;var _0x14b81a=_0x02e9[_0x1b91bb];return _0x14b81a;};'use strict';var client=require(_0x902e('0x0'));exports[_0x902e('0x1')]=function(_0x44fa3c){return client[_0x902e('0x2')](_0x902e('0x3'),{'body':_0x44fa3c,'log':_0x902e('0x3')});};exports[_0x902e('0x4')]=function(_0x42d579,_0x13e5ee){return client[_0x902e('0x2')](_0x902e('0x5'),{'body':_0x13e5ee,'options':{'where':{'uniqueid':_0x42d579},'order':[['id',_0x902e('0x6')]],'limit':0x1},'log':_0x902e('0x5')});}; \ No newline at end of file +var _0xd879=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x321d29,_0x5bc076){var _0x169c5f=function(_0xd9a38b){while(--_0xd9a38b){_0x321d29['push'](_0x321d29['shift']());}};_0x169c5f(++_0x5bc076);}(_0xd879,0xb9));var _0x9d87=function(_0x3dd92d,_0x83ec3b){_0x3dd92d=_0x3dd92d-0x0;var _0x439704=_0xd879[_0x3dd92d];return _0x439704;};'use strict';var client=require(_0x9d87('0x0'));exports[_0x9d87('0x1')]=function(_0x2698db){return client[_0x9d87('0x2')](_0x9d87('0x3'),{'body':_0x2698db,'log':_0x9d87('0x3')});};exports[_0x9d87('0x4')]=function(_0x5f14f0,_0x38e7ee){return client[_0x9d87('0x2')](_0x9d87('0x5'),{'body':_0x38e7ee,'options':{'where':{'uniqueid':_0x5f14f0},'order':[['id','DESC']],'limit':0x1},'log':_0x9d87('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 7ed55fc..e608ffb 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 _0xc178=['addTags','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc178,0x89));var _0x8c17=function(_0x5206fc,_0x2eec61){_0x5206fc=_0x5206fc-0x0;var _0x12acf6=_0xc178[_0x5206fc];return _0x12acf6;};'use strict';var client=require('../client');exports[_0x8c17('0x0')]=function(_0x2055f6,_0x31f178){return client[_0x8c17('0x1')](_0x8c17('0x2'),{'body':_0x31f178,'options':{'where':{'id':_0x2055f6}},'log':'updateOpenchannelInteraction'});};exports[_0x8c17('0x3')]=function(_0x561dba,_0xdb5c17){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0xdb5c17,'options':{'where':{'id':_0x561dba}},'log':_0x8c17('0x4')});}; \ No newline at end of file +var _0x8d0f=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0x8d0f,0x191));var _0xf8d0=function(_0x636388,_0x7067f5){_0x636388=_0x636388-0x0;var _0x4043ee=_0x8d0f[_0x636388];return _0x4043ee;};'use strict';var client=require(_0xf8d0('0x0'));exports[_0xf8d0('0x1')]=function(_0x462a59,_0x2371dc){return client[_0xf8d0('0x2')](_0xf8d0('0x3'),{'body':_0x2371dc,'options':{'where':{'id':_0x462a59}},'log':_0xf8d0('0x4')});};exports[_0xf8d0('0x5')]=function(_0x3f2533,_0x1e70ef){return client[_0xf8d0('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x1e70ef,'options':{'where':{'id':_0x3f2533}},'log':_0xf8d0('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index dd51095..7a6d30c 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 _0xe503=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x5f7c24,_0x16eb48){var _0x1a5554=function(_0x1160f5){while(--_0x1160f5){_0x5f7c24['push'](_0x5f7c24['shift']());}};_0x1a5554(++_0x16eb48);}(_0xe503,0x1db));var _0x3e50=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xe503[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0x3e50('0x0'));exports[_0x3e50('0x1')]=function(_0x44492){return client[_0x3e50('0x2')](_0x3e50('0x3'),{'body':_0x44492,'log':_0x3e50('0x4')});}; \ No newline at end of file +var _0x35eb=['createOpenchannelMessage','../client','create','CreateOpenchannelMessage'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x35eb,0x139));var _0xb35e=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x35eb[_0x11f226];return _0x30be77;};'use strict';var client=require(_0xb35e('0x0'));exports[_0xb35e('0x1')]=function(_0x3a7bd9){return client['Request'](_0xb35e('0x2'),{'body':_0x3a7bd9,'log':_0xb35e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index c1097a3..492eadd 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 _0xbd5d=['strategy','User','Agents','online','../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x3737b2,_0x36cfa5){var _0x514a0a=function(_0x3762ad){while(--_0x3762ad){_0x3737b2['push'](_0x3737b2['shift']());}};_0x514a0a(++_0x36cfa5);}(_0xbd5d,0x13f));var _0xdbd5=function(_0x43a851,_0x221be4){_0x43a851=_0x43a851-0x0;var _0x4763b0=_0xbd5d[_0x43a851];return _0x4763b0;};'use strict';var client=require(_0xdbd5('0x0'));exports[_0xdbd5('0x1')]=function(){return function(){return client['Request'](_0xdbd5('0x2'),{'options':{'raw':![],'attributes':['id',_0xdbd5('0x3'),_0xdbd5('0x4'),_0xdbd5('0x5')],'include':[{'model':_0xdbd5('0x6'),'as':_0xdbd5('0x7'),'attributes':['id','name',_0xdbd5('0x8'),'openchannelPause']}]},'log':_0xdbd5('0x1')});};}; \ No newline at end of file +var _0xb001=['User','name','online','../client','Request','GetOpenchannelQueue','strategy'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xb001,0x7a));var _0x1b00=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xb001[_0x4d613c];return _0x301fe3;};'use strict';var client=require(_0x1b00('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x1b00('0x1')](_0x1b00('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x1b00('0x3')],'include':[{'model':_0x1b00('0x4'),'as':'Agents','attributes':['id',_0x1b00('0x5'),_0x1b00('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7496c0f..5a30834 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 _0xf2f5=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x52bd23,_0x2642cd){var _0x5bda83=function(_0x1fca7d){while(--_0x1fca7d){_0x52bd23['push'](_0x52bd23['shift']());}};_0x5bda83(++_0x2642cd);}(_0xf2f5,0x179));var _0x5f2f=function(_0x1f831c,_0xb78236){_0x1f831c=_0x1f831c-0x0;var _0x5e7a13=_0xf2f5[_0x1f831c];return _0x5e7a13;};'use strict';var client=require(_0x5f2f('0x0'));exports['create']=function(_0x2a5f7f){return client['Request'](_0x5f2f('0x1'),{'body':_0x2a5f7f,'log':_0x5f2f('0x1')});};exports[_0x5f2f('0x2')]=function(_0x9ae152,_0x420447){return client[_0x5f2f('0x3')](_0x5f2f('0x4'),{'body':_0x420447,'options':{'where':{'uniqueid':_0x9ae152},'order':[['id',_0x5f2f('0x5')]],'limit':0x1},'log':_0x5f2f('0x4')});}; \ No newline at end of file +var _0x3948=['update','Request','UpdateOpenchannelQueueReport','DESC','../client','CreateOpenchannelQueueReport'];(function(_0x5f47ae,_0x598e64){var _0x5d57fa=function(_0x3ca851){while(--_0x3ca851){_0x5f47ae['push'](_0x5f47ae['shift']());}};_0x5d57fa(++_0x598e64);}(_0x3948,0x196));var _0x8394=function(_0xe46029,_0x216cf3){_0xe46029=_0xe46029-0x0;var _0x4448d1=_0x3948[_0xe46029];return _0x4448d1;};'use strict';var client=require(_0x8394('0x0'));exports['create']=function(_0x39f6f9){return client['Request'](_0x8394('0x1'),{'body':_0x39f6f9,'log':'CreateOpenchannelQueueReport'});};exports[_0x8394('0x2')]=function(_0x9fd35b,_0x9e42ef){return client[_0x8394('0x3')](_0x8394('0x4'),{'body':_0x9e42ef,'options':{'where':{'uniqueid':_0x9fd35b},'order':[['id',_0x8394('0x5')]],'limit':0x1},'log':_0x8394('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index cb66474..553b8bb 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 _0x0a34=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x0a34,0x12a));var _0x40a3=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x0a34[_0x1573ea];return _0x51c0e2;};'use strict';var client=require(_0x40a3('0x0'));exports[_0x40a3('0x1')]=function(_0x4fa072,_0x33897b){return client[_0x40a3('0x2')](_0x40a3('0x3'),{'body':_0x33897b,'options':{'where':{'id':_0x4fa072}},'log':'updateSmsInteraction'});};exports[_0x40a3('0x4')]=function(_0x3b6860,_0x3a8eb0){return client['Request'](_0x40a3('0x5'),{'body':_0x3a8eb0,'options':{'where':{'id':_0x3b6860}},'log':_0x40a3('0x6')});}; \ No newline at end of file +var _0x78b7=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x78b7,0x194));var _0x778b=function(_0x366e9e,_0x3c61c0){_0x366e9e=_0x366e9e-0x0;var _0x44088b=_0x78b7[_0x366e9e];return _0x44088b;};'use strict';var client=require(_0x778b('0x0'));exports[_0x778b('0x1')]=function(_0x5d5912,_0x377816){return client[_0x778b('0x2')](_0x778b('0x3'),{'body':_0x377816,'options':{'where':{'id':_0x5d5912}},'log':_0x778b('0x4')});};exports[_0x778b('0x5')]=function(_0x4d298d,_0x4c91f3){return client[_0x778b('0x2')](_0x778b('0x6'),{'body':_0x4c91f3,'options':{'where':{'id':_0x4d298d}},'log':_0x778b('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f071eec..1c3a068 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 _0x4d30=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x1820ff,_0x430d6c){var _0x30bb5d=function(_0xbe851f){while(--_0xbe851f){_0x1820ff['push'](_0x1820ff['shift']());}};_0x30bb5d(++_0x430d6c);}(_0x4d30,0x74));var _0x04d3=function(_0x4bfa7c,_0x3e8ff8){_0x4bfa7c=_0x4bfa7c-0x0;var _0x3b5658=_0x4d30[_0x4bfa7c];return _0x3b5658;};'use strict';var client=require(_0x04d3('0x0'));exports[_0x04d3('0x1')]=function(_0x3f2b10){return client[_0x04d3('0x2')](_0x04d3('0x3'),{'body':_0x3f2b10,'log':_0x04d3('0x4')});}; \ No newline at end of file +var _0xfc82=['../client','create','CreateSmsMessage'];(function(_0x110d59,_0x50c4fb){var _0x2fce64=function(_0xc1dcd8){while(--_0xc1dcd8){_0x110d59['push'](_0x110d59['shift']());}};_0x2fce64(++_0x50c4fb);}(_0xfc82,0xba));var _0x2fc8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xfc82[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x2fc8('0x0'));exports[_0x2fc8('0x1')]=function(_0x23ec1b){return client['Request'](_0x2fc8('0x2'),{'body':_0x23ec1b,'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 2770ee1..3b83dfa 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x5428a0,_0x349834){var _0x63df75=function(_0x11ae26){while(--_0x11ae26){_0x5428a0['push'](_0x5428a0['shift']());}};_0x63df75(++_0x349834);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x2b08a9,_0x175ab4){var _0x31a6dd=function(_0x225aac){while(--_0x225aac){_0x2b08a9['push'](_0x2b08a9['shift']());}};_0x31a6dd(++_0x175ab4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6d6c8a1..048aeef 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5e69c2,_0xf69886){var _0x80a1d6=function(_0x3a466e){while(--_0x3a466e){_0x5e69c2['push'](_0x5e69c2['shift']());}};_0x80a1d6(++_0xf69886);}(_0x3e74,0x175));var _0x43e7=function(_0x7098fd,_0x477d36){_0x7098fd=_0x7098fd-0x0;var _0x32267f=_0x3e74[_0x7098fd];return _0x32267f;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x9f9241,_0x4e7fe2){var _0x1dc46a=function(_0x39fc4e){while(--_0x39fc4e){_0x9f9241['push'](_0x9f9241['shift']());}};_0x1dc46a(++_0x4e7fe2);}(_0x70e0,0x17b));var _0x070e=function(_0x27e56f,_0x4e6fb3){_0x27e56f=_0x27e56f-0x0;var _0x5f049b=_0x70e0[_0x27e56f];return _0x5f049b;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 36928b1..3a82c07 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 _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x4e1a6b,_0x405ac7){var _0x35ac17=function(_0x4270ae){while(--_0x4270ae){_0x4e1a6b['push'](_0x4e1a6b['shift']());}};_0x35ac17(++_0x405ac7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x5f051a,_0x3c74fc){var _0xb5fe94=function(_0x698040){while(--_0x698040){_0x5f051a['push'](_0x5f051a['shift']());}};_0xb5fe94(++_0x3c74fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index a2038b9..352d538 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1d3=['../client','update','Request','updateWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1f4c06,_0x1c26e7){var _0x5d6ab2=function(_0x5006a2){while(--_0x5006a2){_0x1f4c06['push'](_0x1f4c06['shift']());}};_0x5d6ab2(++_0x1c26e7);}(_0xe1d3,0x159));var _0x3e1d=function(_0x1019c0,_0x3eead0){_0x1019c0=_0x1019c0-0x0;var _0x21aa25=_0xe1d3[_0x1019c0];return _0x21aa25;};'use strict';var client=require(_0x3e1d('0x0'));exports[_0x3e1d('0x1')]=function(_0x1aa7c7,_0x1340c7){return client[_0x3e1d('0x2')]('UpdateWhatsappInteraction',{'body':_0x1340c7,'options':{'where':{'id':_0x1aa7c7}},'log':_0x3e1d('0x3')});};exports['addTags']=function(_0x23f59b,_0x38df15){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x38df15,'options':{'where':{'id':_0x23f59b}},'log':_0x3e1d('0x4')});}; \ No newline at end of file +var _0x0ec6=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x9f54a1,_0x398ca6){var _0x3c54fa=function(_0x323c74){while(--_0x323c74){_0x9f54a1['push'](_0x9f54a1['shift']());}};_0x3c54fa(++_0x398ca6);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x4c865c,_0x6a8fb9){_0x4c865c=_0x4c865c-0x0;var _0x21073f=_0x0ec6[_0x4c865c];return _0x21073f;};'use strict';var client=require(_0x60ec('0x0'));exports['update']=function(_0x50217e,_0x1bf878){return client[_0x60ec('0x1')](_0x60ec('0x2'),{'body':_0x1bf878,'options':{'where':{'id':_0x50217e}},'log':_0x60ec('0x3')});};exports[_0x60ec('0x4')]=function(_0x262ed6,_0x392a91){return client['Request'](_0x60ec('0x5'),{'body':_0x392a91,'options':{'where':{'id':_0x262ed6}},'log':_0x60ec('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index e12ca58..5712658 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b55=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x164d1b,_0xd40312){var _0x2143b8=function(_0x5859eb){while(--_0x5859eb){_0x164d1b['push'](_0x164d1b['shift']());}};_0x2143b8(++_0xd40312);}(_0x7b55,0xdb));var _0x57b5=function(_0x15bfa5,_0x57efbb){_0x15bfa5=_0x15bfa5-0x0;var _0x119235=_0x7b55[_0x15bfa5];return _0x119235;};'use strict';var client=require(_0x57b5('0x0'));exports[_0x57b5('0x1')]=function(_0x56637e){return client['Request'](_0x57b5('0x2'),{'body':_0x56637e,'log':_0x57b5('0x3')});}; \ No newline at end of file +var _0xe532=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x32ebd6,_0x407ff4){var _0x73ca55=function(_0x620091){while(--_0x620091){_0x32ebd6['push'](_0x32ebd6['shift']());}};_0x73ca55(++_0x407ff4);}(_0xe532,0x9a));var _0x2e53=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xe532[_0x59bcb1];return _0x4a737f;};'use strict';var client=require('../client');exports[_0x2e53('0x0')]=function(_0xd1436c){return client[_0x2e53('0x1')](_0x2e53('0x2'),{'body':_0xd1436c,'log':_0x2e53('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3dcc622..2b42d9f 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb472=['whatsappPause','getWhatsappQueues','../client','Request','name','User','Agents','online'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0xb472,0xda));var _0x2b47=function(_0x26da1c,_0x1562d5){_0x26da1c=_0x26da1c-0x0;var _0x53ae51=_0xb472[_0x26da1c];return _0x53ae51;};'use strict';var client=require(_0x2b47('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x2b47('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x2b47('0x2'),'timeout','strategy'],'include':[{'model':_0x2b47('0x3'),'as':_0x2b47('0x4'),'attributes':['id',_0x2b47('0x2'),_0x2b47('0x5'),_0x2b47('0x6')]}]},'log':_0x2b47('0x7')});};}; \ No newline at end of file +var _0xbdc3=['online','../client','getWhatsappQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x4e2dab,_0x55bcc4){var _0x28e7d6=function(_0x31cc26){while(--_0x31cc26){_0x4e2dab['push'](_0x4e2dab['shift']());}};_0x28e7d6(++_0x55bcc4);}(_0xbdc3,0xb5));var _0x3bdc=function(_0x329eb3,_0x8e2ffd){_0x329eb3=_0x329eb3-0x0;var _0x3ad946=_0xbdc3[_0x329eb3];return _0x3ad946;};'use strict';var client=require(_0x3bdc('0x0'));exports[_0x3bdc('0x1')]=function(){return function(){return client[_0x3bdc('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x3bdc('0x3'),_0x3bdc('0x4'),_0x3bdc('0x5')],'include':[{'model':_0x3bdc('0x6'),'as':_0x3bdc('0x7'),'attributes':['id',_0x3bdc('0x3'),_0x3bdc('0x8'),'whatsappPause']}]},'log':_0x3bdc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 9da7d41..028fe3e 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c90=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x57e4dc,_0x371fb8){var _0x57d132=function(_0x38d6a4){while(--_0x38d6a4){_0x57e4dc['push'](_0x57e4dc['shift']());}};_0x57d132(++_0x371fb8);}(_0x4c90,0x1ae));var _0x04c9=function(_0x5c227d,_0x23bb40){_0x5c227d=_0x5c227d-0x0;var _0x33986a=_0x4c90[_0x5c227d];return _0x33986a;};'use strict';var client=require(_0x04c9('0x0'));exports[_0x04c9('0x1')]=function(_0x347ba5){return client[_0x04c9('0x2')]('CreateWhatsappQueueReport',{'body':_0x347ba5,'log':_0x04c9('0x3')});};exports[_0x04c9('0x4')]=function(_0x459283,_0x2a0a74){return client['Request'](_0x04c9('0x5'),{'body':_0x2a0a74,'options':{'where':{'uniqueid':_0x459283},'order':[['id',_0x04c9('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x28e0=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x28e0,0x1a3));var _0x028e=function(_0x4792bb,_0x5a8427){_0x4792bb=_0x4792bb-0x0;var _0x38cad0=_0x28e0[_0x4792bb];return _0x38cad0;};'use strict';var client=require('../client');exports[_0x028e('0x0')]=function(_0x437ecf){return client[_0x028e('0x1')]('CreateWhatsappQueueReport',{'body':_0x437ecf,'log':_0x028e('0x2')});};exports[_0x028e('0x3')]=function(_0x1d2af1,_0x3bd5d2){return client[_0x028e('0x1')](_0x028e('0x4'),{'body':_0x3bd5d2,'options':{'where':{'uniqueid':_0x1d2af1},'order':[['id','DESC']],'limit':0x1},'log':_0x028e('0x4')});}; \ 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 0e60635..7b78028 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 _0x4fdc=['atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue'];(function(_0x2cd068,_0x7a0a83){var _0x1f2d00=function(_0x9842dc){while(--_0x9842dc){_0x2cd068['push'](_0x2cd068['shift']());}};_0x1f2d00(++_0x7a0a83);}(_0x4fdc,0xad));var _0xc4fd=function(_0x68b071,_0x482457){_0x68b071=_0x68b071-0x0;var _0x507994=_0x4fdc[_0x68b071];return _0x507994;};'use strict';var schema=require(_0xc4fd('0x0'));var _=require(_0xc4fd('0x1'));var util=require(_0xc4fd('0x2'));var seqqueue=require(_0xc4fd('0x3'));var logger=require(_0xc4fd('0x4'))('routing');var strategy=require(_0xc4fd('0x5'));var queue=schema({'name':{'type':_0xc4fd('0x6'),'required':!![],'message':_0xc4fd('0x7')},'timeout':{'type':_0xc4fd('0x8'),'message':_0xc4fd('0x9')}});function writeLog(_0x36e6db,_0x21436f,_0x483f11){return logger[_0xc4fd('0xa')](util[_0xc4fd('0xb')](_0xc4fd('0xc'),_0x36e6db,_0x21436f[_0xc4fd('0xd')],_0x483f11));}function handleFindAgent(_0x5e0f33){return function(_0x230202){return _0x230202[_0xc4fd('0xd')][_0xc4fd('0xe')]()===_0x5e0f33[_0xc4fd('0xe')]();};}exports[_0xc4fd('0xf')]=function(_0x2aac07,_0x2eac8f,_0x50b254,_0x403574){return function(_0x2ca2e3){try{var _0x2f9246={'name':_0x2eac8f[0x0],'timeout':_0x2eac8f[0x1]};var _0x33a18e=queue[_0xc4fd('0x0')](_0x2f9246,{'typecast':!![]});if(_0x33a18e[_0xc4fd('0x10')]){logger[_0xc4fd('0x11')](_0xc4fd('0x12'),_0x2aac07,_[_0xc4fd('0x13')](_0x33a18e,_0xc4fd('0x14'))[_0xc4fd('0x15')](',\x20'));_0x2ca2e3[_0xc4fd('0x16')]();}else{var _0x58f24f=_[_0xc4fd('0x17')](_0x50b254[_0xc4fd('0x18')],handleFindAgent(_0x2f9246[_0xc4fd('0xd')]));if(_0x58f24f){var _0x1f90a3=(_0x2f9246[_0xc4fd('0x19')]||0xa)*0x3e8;var _0x2237ab,_0x5e8675;var _0x489f71=seqqueue[_0xc4fd('0x1a')](_0x1f90a3);_0x489f71['id']=_0x2aac07;_0x489f71[_0xc4fd('0x1b')]=_0x1f90a3;_0x489f71[_0xc4fd('0x1c')]=_0x403574[_0xc4fd('0x1c')];writeLog(_0x2aac07,_0x58f24f,util[_0xc4fd('0xb')](_0xc4fd('0x1d'),_0x1f90a3));_0x50b254['rules'][_0x2aac07]['on'](_0xc4fd('0x1e'),function(){logger[_0xc4fd('0xa')](_0xc4fd('0x1f'),_0x2aac07);clearTimeout(_0x5e8675);_0x5e8675=undefined;_0x489f71[_0xc4fd('0x20')]();if(_0x50b254['rules'][_0x2aac07]){delete _0x50b254[_0xc4fd('0x21')][_0x2aac07];}_0x2ca2e3['stop']();});_0x50b254[_0xc4fd('0x21')][_0x2aac07]['on'](_0xc4fd('0x22'),function(){if(_0x50b254['rules'][_0x2aac07]){delete _0x50b254[_0xc4fd('0x21')][_0x2aac07];}});_0x5e8675=setTimeout(function(){logger[_0xc4fd('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x2aac07);clearTimeout(_0x5e8675);_0x489f71[_0xc4fd('0x20')]();_0x2ca2e3[_0xc4fd('0x23')]();},_0x1f90a3);strategy['agent'](_0x489f71,_0x58f24f,_0x50b254,_0x403574);}else{logger[_0xc4fd('0x11')](_0xc4fd('0x24'),_0x2aac07,_0x2f9246['name']);_0x2ca2e3['stop']();}}}catch(_0x23856){console[_0xc4fd('0x25')](_0x23856);logger[_0xc4fd('0x11')](_0xc4fd('0x26'),_0x2aac07,_0x23856[_0xc4fd('0x27')]);_0x2ca2e3['stop']();}};}; \ No newline at end of file +var _0x88f3=['length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','atimeout','channel','START:%s','end','rules','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence'];(function(_0x146bf6,_0x3a3461){var _0x4af2c3=function(_0x3df6a6){while(--_0x3df6a6){_0x146bf6['push'](_0x146bf6['shift']());}};_0x4af2c3(++_0x3a3461);}(_0x88f3,0x13e));var _0x388f=function(_0x351c71,_0x1652b9){_0x351c71=_0x351c71-0x0;var _0x1a5391=_0x88f3[_0x351c71];return _0x1a5391;};'use strict';var schema=require('validate');var _=require(_0x388f('0x0'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x388f('0x1'))(_0x388f('0x2'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x388f('0x3'),'required':!![],'message':_0x388f('0x4')},'timeout':{'type':_0x388f('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4d3f1b,_0x138f74,_0x4af154){return logger[_0x388f('0x6')](util[_0x388f('0x7')](_0x388f('0x8'),_0x4d3f1b,_0x138f74[_0x388f('0x9')],_0x4af154));}function handleFindAgent(_0x58c4f7){return function(_0x146b17){return _0x146b17[_0x388f('0x9')]['toLowerCase']()===_0x58c4f7[_0x388f('0xa')]();};}exports[_0x388f('0xb')]=function(_0x285c5d,_0x165e3c,_0x43644a,_0xa81c0d){return function(_0xc68c3e){try{var _0x53033c={'name':_0x165e3c[0x0],'timeout':_0x165e3c[0x1]};var _0xca6b87=queue['validate'](_0x53033c,{'typecast':!![]});if(_0xca6b87[_0x388f('0xc')]){logger[_0x388f('0xd')](_0x388f('0xe'),_0x285c5d,_[_0x388f('0xf')](_0xca6b87,'message')[_0x388f('0x10')](',\x20'));_0xc68c3e[_0x388f('0x11')]();}else{var _0x14f2d2=_[_0x388f('0x12')](_0x43644a[_0x388f('0x13')],handleFindAgent(_0x53033c['name']));if(_0x14f2d2){var _0x10e927=(_0x53033c['timeout']||0xa)*0x3e8;var _0x4179ff,_0x1499b2;var _0x5af023=seqqueue['createQueue'](_0x10e927);_0x5af023['id']=_0x285c5d;_0x5af023[_0x388f('0x14')]=_0x10e927;_0x5af023[_0x388f('0x15')]=_0xa81c0d['channel'];writeLog(_0x285c5d,_0x14f2d2,util[_0x388f('0x7')](_0x388f('0x16'),_0x10e927));_0x43644a['rules'][_0x285c5d]['on'](_0x388f('0x17'),function(){logger[_0x388f('0x6')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x285c5d);clearTimeout(_0x1499b2);_0x1499b2=undefined;_0x5af023['close']();if(_0x43644a[_0x388f('0x18')][_0x285c5d]){delete _0x43644a[_0x388f('0x18')][_0x285c5d];}_0xc68c3e[_0x388f('0x11')]();});_0x43644a[_0x388f('0x18')][_0x285c5d]['on']('complete',function(){if(_0x43644a[_0x388f('0x18')][_0x285c5d]){delete _0x43644a[_0x388f('0x18')][_0x285c5d];}});_0x1499b2=setTimeout(function(){logger[_0x388f('0x6')](_0x388f('0x19'),_0x285c5d);clearTimeout(_0x1499b2);_0x5af023[_0x388f('0x1a')]();_0xc68c3e[_0x388f('0x1b')]();},_0x10e927);strategy[_0x388f('0x1c')](_0x5af023,_0x14f2d2,_0x43644a,_0xa81c0d);}else{logger[_0x388f('0xd')](_0x388f('0x1d'),_0x285c5d,_0x53033c[_0x388f('0x9')]);_0xc68c3e[_0x388f('0x11')]();}}}catch(_0x704712){console[_0x388f('0x1e')](_0x704712);logger[_0x388f('0xd')](_0x388f('0x1f'),_0x285c5d,_0x704712[_0x388f('0x20')]);_0xc68c3e[_0x388f('0x11')]();}};}; \ 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 47c604a..26e1b52 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 _0x4156=['getMustacheRender','Message','then','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','amazonlex','providerName','providerResponse','stringify','create','dialogState','Failed','next','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','created','body'];(function(_0x3c9dee,_0x2b9c23){var _0x4fc04d=function(_0x39ad70){while(--_0x39ad70){_0x3c9dee['push'](_0x3c9dee['shift']());}};_0x4fc04d(++_0x2b9c23);}(_0x4156,0x74));var _0x6415=function(_0x48fea6,_0x3af571){_0x48fea6=_0x48fea6-0x0;var _0x2fd2e2=_0x4156[_0x48fea6];return _0x2fd2e2;};'use strict';var _=require(_0x6415('0x0'));var moment=require(_0x6415('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6415('0x2'));var logger=require(_0x6415('0x3'))(_0x6415('0x4'));var rpc={'chatMessage':require(_0x6415('0x5')),'openchannelMessage':require(_0x6415('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6415('0x7')),'faxMessage':require(_0x6415('0x8')),'whatsappMessage':require(_0x6415('0x9'))};exports[_0x6415('0xa')]=function(_0x2caee6,_0x57b8b3){return function(_0x503a0c){try{if(!_['isNil'](this[_0x6415('0xb')]['UserId'])){logger[_0x6415('0xc')](_0x6415('0xd'),_0x2caee6,_0x6415('0xe'));return _0x503a0c['next']();}var _0x183950={'ContactId':this[_0x6415('0xf')]['id'],'sentAt':moment()[_0x6415('0x10')](_0x6415('0x11')),'direction':_0x6415('0x12')};if(this[_0x6415('0x13')]===_0x6415('0x14')||this[_0x6415('0x13')]==='whatsapp'){_0x183950[_0x6415('0x15')]=this[_0x6415('0xb')][_0x6415('0x15')];}var _0xbecfb8=this[_0x6415('0x13')];if(_0xbecfb8==='chat'){_0x183950[_0x6415('0x16')]=this[_0x6415('0x17')]['id'];}else{_0x183950[_[_0x6415('0x18')](_0xbecfb8)+_0x6415('0x19')]=this[_0x6415('0x17')]['id'];}_0x183950[_['upperFirst'](_0xbecfb8)+'InteractionId']=this[_0x6415('0xb')]['id'];if(this[_0x6415('0xb')][_0x6415('0x1a')]){var _0x50695e=_0x57b8b3[0x4];if(!_['isEmpty'](_0x50695e)){_0x183950[_0x6415('0x1b')]=utils[_0x6415('0x1c')](_0x50695e,this);return rpc[_0xbecfb8+_0x6415('0x1d')]['create'](_0x183950)[_0x6415('0x1e')](function(_0x9b8e72){logger[_0x6415('0xc')](_0x6415('0xd'),_0x2caee6,_0x183950[_0x6415('0x1b')]);})['catch'](function(_0x577140){logger[_0x6415('0x1f')](_0x6415('0xd'),_0x2caee6,JSON['stringify'](_0x577140));})[_0x6415('0x20')](function(){logger[_0x6415('0xc')](_0x6415('0x21'),_0x2caee6);_0x503a0c[_0x6415('0x22')]();});}else{logger[_0x6415('0xc')](_0x6415('0x23'),_0x2caee6);_0x503a0c['stop']();}}else{var _0x500825=this;var _0x122427=new AWS[(_0x6415('0x24'))]({'accessKeyId':_0x57b8b3[0x0],'secretAccessKey':_0x57b8b3[0x1],'region':_0x57b8b3[0x2]});var _0x21e9a4={'botAlias':_0x6415('0x25'),'botName':_0x57b8b3[0x3],'inputText':this[_0x6415('0x26')][_0x6415('0x1b')],'userId':this['channel']+':'+this[_0x6415('0xb')]['id']['toString']()};_0x122427[_0x6415('0x27')](_0x21e9a4,function(_0x450d59,_0x50b4b7){if(_0x450d59){logger[_0x6415('0x1f')](_0x6415('0xd'),_0x2caee6,_0x450d59[_0x6415('0x26')]);_0x503a0c['next']();}else if(_0x50b4b7&&_0x50b4b7['message']){_0x500825[_0x6415('0x1b')][_0x6415('0x28')]=_0x50b4b7;_0x183950[_0x6415('0x1b')]=_0x50b4b7[_0x6415('0x26')];_0x183950[_0x6415('0x29')]=_0x6415('0x28');_0x183950[_0x6415('0x2a')]=JSON[_0x6415('0x2b')](_0x50b4b7);return rpc[_0xbecfb8+_0x6415('0x1d')][_0x6415('0x2c')](_0x183950)[_0x6415('0x1e')](function(_0x40f6e8){logger[_0x6415('0xc')](_0x6415('0xd'),_0x2caee6,_0x183950[_0x6415('0x1b')]);if(_0x50b4b7[_0x6415('0x2d')]==_0x6415('0x2e')){_0x503a0c['next']();}else{_0x503a0c[_0x6415('0x22')]();}})['catch'](function(_0x1e95aa){logger[_0x6415('0x1f')](_0x6415('0xd'),_0x2caee6,JSON[_0x6415('0x2b')](_0x1e95aa));_0x503a0c[_0x6415('0x2f')]();});}else{_0x503a0c[_0x6415('0x2f')]();}});}}catch(_0x4e6a44){logger['error'](_0x6415('0xd'),_0x2caee6,JSON[_0x6415('0x2b')](_0x4e6a44));_0x503a0c[_0x6415('0x22')]();}};}; \ No newline at end of file +var _0x6cb9=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','phone','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','error','providerName','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x2179ae,_0xe2e338){var _0x56322b=function(_0x45897d){while(--_0x45897d){_0x2179ae['push'](_0x2179ae['shift']());}};_0x56322b(++_0xe2e338);}(_0x6cb9,0x182));var _0x96cb=function(_0x2a921d,_0x1d54c9){_0x2a921d=_0x2a921d-0x0;var _0x341cd9=_0x6cb9[_0x2a921d];return _0x341cd9;};'use strict';var _=require('lodash');var moment=require(_0x96cb('0x0'));var AWS=require(_0x96cb('0x1'));var utils=require(_0x96cb('0x2'));var logger=require(_0x96cb('0x3'))(_0x96cb('0x4'));var rpc={'chatMessage':require(_0x96cb('0x5')),'openchannelMessage':require(_0x96cb('0x6')),'mailMessage':require(_0x96cb('0x7')),'smsMessage':require(_0x96cb('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x96cb('0x9'))};exports[_0x96cb('0xa')]=function(_0x2f1b80,_0x28d74b){return function(_0x4aa991){try{if(!_['isNil'](this[_0x96cb('0xb')][_0x96cb('0xc')])){logger['info'](_0x96cb('0xd'),_0x2f1b80,_0x96cb('0xe'));return _0x4aa991[_0x96cb('0xf')]();}var _0xe37b48={'ContactId':this[_0x96cb('0x10')]['id'],'sentAt':moment()[_0x96cb('0x11')](_0x96cb('0x12')),'direction':_0x96cb('0x13')};if(this['channel']==='sms'||this['channel']==='whatsapp'){_0xe37b48[_0x96cb('0x14')]=this[_0x96cb('0xb')]['phone'];}var _0x519fde=this[_0x96cb('0x15')];if(_0x519fde===_0x96cb('0x16')){_0xe37b48[_0x96cb('0x17')]=this['account']['id'];}else{_0xe37b48[_[_0x96cb('0x18')](_0x519fde)+_0x96cb('0x19')]=this[_0x96cb('0x1a')]['id'];}_0xe37b48[_[_0x96cb('0x18')](_0x519fde)+_0x96cb('0x1b')]=this[_0x96cb('0xb')]['id'];if(this[_0x96cb('0xb')][_0x96cb('0x1c')]){var _0x44e925=_0x28d74b[0x4];if(!_[_0x96cb('0x1d')](_0x44e925)){_0xe37b48[_0x96cb('0x1e')]=utils[_0x96cb('0x1f')](_0x44e925,this);return rpc[_0x519fde+_0x96cb('0x20')][_0x96cb('0x21')](_0xe37b48)[_0x96cb('0x22')](function(_0x330b41){logger[_0x96cb('0x23')](_0x96cb('0xd'),_0x2f1b80,_0xe37b48['body']);})['catch'](function(_0x33b38c){logger['error'](_0x96cb('0xd'),_0x2f1b80,JSON[_0x96cb('0x24')](_0x33b38c));})[_0x96cb('0x25')](function(){logger[_0x96cb('0x23')](_0x96cb('0x26'),_0x2f1b80);_0x4aa991[_0x96cb('0x27')]();});}else{logger[_0x96cb('0x23')](_0x96cb('0x28'),_0x2f1b80);_0x4aa991[_0x96cb('0x27')]();}}else{var _0x3c07b3=this;var _0xa844a7=new AWS[(_0x96cb('0x29'))]({'accessKeyId':_0x28d74b[0x0],'secretAccessKey':_0x28d74b[0x1],'region':_0x28d74b[0x2]});var _0x681000={'botAlias':_0x96cb('0x2a'),'botName':_0x28d74b[0x3],'inputText':this[_0x96cb('0x2b')][_0x96cb('0x1e')],'userId':this[_0x96cb('0x15')]+':'+this[_0x96cb('0xb')]['id'][_0x96cb('0x2c')]()};_0xa844a7['postText'](_0x681000,function(_0x5d4ca4,_0x219080){if(_0x5d4ca4){logger[_0x96cb('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x2f1b80,_0x5d4ca4[_0x96cb('0x2b')]);_0x4aa991['next']();}else if(_0x219080&&_0x219080[_0x96cb('0x2b')]){_0x3c07b3['body']['amazonlex']=_0x219080;_0xe37b48[_0x96cb('0x1e')]=_0x219080['message'];_0xe37b48[_0x96cb('0x2e')]='amazonlex';_0xe37b48['providerResponse']=JSON[_0x96cb('0x24')](_0x219080);return rpc[_0x519fde+'Message'][_0x96cb('0x21')](_0xe37b48)['then'](function(_0x389e80){logger[_0x96cb('0x23')]('[%s][AMAZONLEX]\x20%s',_0x2f1b80,_0xe37b48[_0x96cb('0x1e')]);if(_0x219080[_0x96cb('0x2f')]==_0x96cb('0x30')){_0x4aa991[_0x96cb('0xf')]();}else{_0x4aa991[_0x96cb('0x27')]();}})['catch'](function(_0x5e5f11){logger[_0x96cb('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x2f1b80,JSON[_0x96cb('0x24')](_0x5e5f11));_0x4aa991[_0x96cb('0xf')]();});}else{_0x4aa991[_0x96cb('0xf')]();}});}}catch(_0x10080e){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2f1b80,JSON[_0x96cb('0x24')](_0x10080e));_0x4aa991[_0x96cb('0x27')]();}};}; \ 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 b6890d2..e979c1c 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 _0x7880=['error','stringify','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','autoreplyExecuted','update','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','out','getMustacheRender','message','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','Message','inReplyTo','','replace','','headers','auto-replied','All','auto_reply','account','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','catch'];(function(_0x3a2e39,_0xc84639){var _0x58d6f9=function(_0x36606f){while(--_0x36606f){_0x3a2e39['push'](_0x3a2e39['shift']());}};_0x58d6f9(++_0xc84639);}(_0x7880,0x1f4));var _0x0788=function(_0x16af15,_0x55bc76){_0x16af15=_0x16af15-0x0;var _0xfeda8a=_0x7880[_0x16af15];return _0xfeda8a;};'use strict';var _=require('lodash');var moment=require(_0x0788('0x0'));var utils=require(_0x0788('0x1'));var logger=require(_0x0788('0x2'))(_0x0788('0x3'));var rpc={'chatMessage':require(_0x0788('0x4')),'openchannelMessage':require(_0x0788('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0788('0x6')),'faxMessage':require(_0x0788('0x7')),'whatsappMessage':require(_0x0788('0x8')),'chatInteraction':require(_0x0788('0x9')),'openchannelInteraction':require(_0x0788('0xa')),'mailInteraction':require(_0x0788('0xb')),'smsInteraction':require(_0x0788('0xc')),'faxInteraction':require(_0x0788('0xd')),'whatsappInteraction':require(_0x0788('0xe'))};var mailRpc=require(_0x0788('0xf'));exports['consequence']=function(_0x1497dd,_0x49f53b,_0xabaf81,_0x53b2f2){return function(_0x433c26){try{var _0x3c6d18=this[_0x0788('0x10')];if(_0x3c6d18===_0x0788('0x11')&&_0x53b2f2[_0x0788('0x12')]['isAutoreply']){logger[_0x0788('0x13')](_0x0788('0x14'),_0x1497dd,_0x0788('0x15'));return _0x433c26[_0x0788('0x16')]();}if(_0x49f53b[0x0]==='1'&&(_[_0x0788('0x17')](this[_0x0788('0x18')][_0x0788('0x19')])||!this['interaction'][_0x0788('0x19')])){logger[_0x0788('0x13')](_0x0788('0x14'),_0x1497dd,_0x0788('0x1a'));return _0x433c26['next']();}if(_0x49f53b[0x0]==='2'&&this[_0x0788('0x18')]['autoreplyExecuted']){logger[_0x0788('0x13')](_0x0788('0x1b'),_0x1497dd,_0x0788('0x1c'));return _0x433c26[_0x0788('0x16')]();}var _0x2ddd1a={'ContactId':this[_0x0788('0x1d')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0788('0x1e')};if(this[_0x0788('0x10')]==='mail'){_0x2ddd1a[_0x0788('0x12')]=utils[_0x0788('0x1f')](_0x49f53b[0x2],this);}else{_0x2ddd1a[_0x0788('0x12')]=utils['getMustacheRender'](_0x49f53b[0x1],this);}if(this[_0x0788('0x20')]){_0x2ddd1a['to']=this[_0x0788('0x20')]['from']||'';if(this[_0x0788('0x10')]==='mail'&&_0x49f53b[0x1]==='1'){_0x2ddd1a['cc']=this[_0x0788('0x20')]['cc']||'';}_0x2ddd1a['from']=this[_0x0788('0x20')]['to']||'';_0x2ddd1a[_0x0788('0x21')]=this[_0x0788('0x20')][_0x0788('0x21')]||'';_0x2ddd1a[_0x0788('0x22')]=!![];if(this['message']['subject']){_0x2ddd1a[_0x0788('0x23')]='';_0x2ddd1a[_0x0788('0x23')]+=_[_0x0788('0x24')](this[_0x0788('0x20')]['subject'],'Re:')?'':_0x0788('0x25');_0x2ddd1a[_0x0788('0x23')]+=this[_0x0788('0x20')]['subject'];}}if(this['channel']===_0x0788('0x26')){_0x2ddd1a[_0x0788('0x27')]=this['account']['id'];}else{_0x2ddd1a[_['upperFirst'](this[_0x0788('0x10')])+_0x0788('0x28')]=this['account']['id'];}_0x2ddd1a[_[_0x0788('0x29')](this[_0x0788('0x10')])+_0x0788('0x2a')]=this[_0x0788('0x18')]['id'];var _0xf9ba32=this[_0x0788('0x18')];if(rpc[this[_0x0788('0x10')]+_0x0788('0x2b')]){if(this['channel']==='mail'){_0x2ddd1a[_0x0788('0x2c')]=this[_0x0788('0x20')]['messageId'];_0x2ddd1a['html']=_0x0788('0x2d')+_[_0x0788('0x2e')](_0x2ddd1a[_0x0788('0x12')],_0x0788('0x2f'),_0x0788('0x30'))+_0x0788('0x31');_0x2ddd1a[_0x0788('0x32')]={'Auto-Submitted':_0x0788('0x33'),'X-Auto-Response-Suppress':_0x0788('0x34'),'Precedence':_0x0788('0x35')};return mailRpc['sendMailMessage'](this[_0x0788('0x36')][_0x0788('0x37')],_0x2ddd1a)[_0x0788('0x38')](function(_0x2a64e4){logger[_0x0788('0x13')](_0x0788('0x39'),_0x1497dd);_0x2ddd1a[_0x0788('0x3a')]=_0x2a64e4[_0x0788('0x20')][_0x0788('0x3a')];return rpc[_0x3c6d18+_0x0788('0x2b')]['create'](_0x2ddd1a);})['then'](function(_0x5947d3){logger['info']('[%s][AUTOREPLY]\x20%s',_0x1497dd,JSON['stringify'](_0x5947d3));})[_0x0788('0x3b')](function(_0x38a4ae){logger[_0x0788('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0x1497dd,JSON[_0x0788('0x3d')](_0x38a4ae));})[_0x0788('0x3e')](function(){Promise[_0x0788('0x3f')]()[_0x0788('0x38')](function(){if(_0x49f53b[0x0]!=='2'||_0xf9ba32['autoreplyExecuted'])return;return rpc[_0x3c6d18+_0x0788('0x40')]['update'](_0xf9ba32['id'],{'autoreplyExecuted':!![]})[_0x0788('0x38')](function(_0x4fcde3){logger[_0x0788('0x13')](_0x0788('0x1b'),_0x1497dd,JSON['stringify'](_0x4fcde3));})[_0x0788('0x3b')](function(_0x151c96){logger['error'](_0x0788('0x41'),_0x1497dd,JSON['stringify'](_0x151c96));});})[_0x0788('0x38')](function(){_0x433c26['next']();});});}else{return rpc[this[_0x0788('0x10')]+'Message'][_0x0788('0x42')](_0x2ddd1a)['then'](function(){logger['info'](_0x0788('0x14'),_0x1497dd,_0x2ddd1a[_0x0788('0x12')]);})[_0x0788('0x3b')](function(_0x2d17b0){logger[_0x0788('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x1497dd,JSON['stringify'](_0x2d17b0));})['finally'](function(){Promise['resolve']()[_0x0788('0x38')](function(){if(_0x49f53b[0x0]!=='2'||_0xf9ba32[_0x0788('0x43')])return;return rpc[_0x3c6d18+_0x0788('0x40')][_0x0788('0x44')](_0xf9ba32['id'],{'autoreplyExecuted':!![]})[_0x0788('0x38')](function(_0x5993ad){logger['info'](_0x0788('0x1b'),_0x1497dd,JSON[_0x0788('0x3d')](_0x5993ad));})[_0x0788('0x3b')](function(_0x29e09a){logger[_0x0788('0x3c')](_0x0788('0x41'),_0x1497dd,JSON[_0x0788('0x3d')](_0x29e09a));});})[_0x0788('0x38')](function(){_0x433c26[_0x0788('0x16')]();});});}}}catch(_0x50e8f5){logger['error'](_0x0788('0x14'),_0x1497dd,JSON[_0x0788('0x3d')](_0x50e8f5));_0x433c26[_0x0788('0x45')]();}};}; \ No newline at end of file +var _0x791f=['[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','next','created','interaction','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','update'];(function(_0x1d4fcf,_0xe3a32f){var _0x2611b6=function(_0x2e53aa){while(--_0x2e53aa){_0x1d4fcf['push'](_0x1d4fcf['shift']());}};_0x2611b6(++_0xe3a32f);}(_0x791f,0x112));var _0xf791=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x791f[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf791('0x0'));var moment=require('moment');var utils=require(_0xf791('0x1'));var logger=require(_0xf791('0x2'))(_0xf791('0x3'));var rpc={'chatMessage':require(_0xf791('0x4')),'openchannelMessage':require(_0xf791('0x5')),'mailMessage':require(_0xf791('0x6')),'smsMessage':require(_0xf791('0x7')),'faxMessage':require(_0xf791('0x8')),'whatsappMessage':require(_0xf791('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf791('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xf791('0xb')),'faxInteraction':require(_0xf791('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xf791('0xd'));exports[_0xf791('0xe')]=function(_0x35c27a,_0x48d493,_0x9c987c,_0x5a7c0b){return function(_0x363f2d){try{var _0x59ad28=this[_0xf791('0xf')];if(_0x59ad28===_0xf791('0x10')&&_0x5a7c0b[_0xf791('0x11')][_0xf791('0x12')]){logger['info'](_0xf791('0x13'),_0x35c27a,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x363f2d[_0xf791('0x14')]();}if(_0x48d493[0x0]==='1'&&(_['isNil'](this['interaction'][_0xf791('0x15')])||!this[_0xf791('0x16')][_0xf791('0x15')])){logger[_0xf791('0x17')]('[%s][AUTOREPLY]\x20%s',_0x35c27a,_0xf791('0x18'));return _0x363f2d[_0xf791('0x14')]();}if(_0x48d493[0x0]==='2'&&this[_0xf791('0x16')][_0xf791('0x19')]){logger[_0xf791('0x17')](_0xf791('0x1a'),_0x35c27a,_0xf791('0x1b'));return _0x363f2d[_0xf791('0x14')]();}var _0x224e23={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf791('0x1c')](_0xf791('0x1d')),'direction':_0xf791('0x1e')};if(this[_0xf791('0xf')]===_0xf791('0x10')){_0x224e23[_0xf791('0x11')]=utils['getMustacheRender'](_0x48d493[0x2],this);}else{_0x224e23[_0xf791('0x11')]=utils['getMustacheRender'](_0x48d493[0x1],this);}if(this[_0xf791('0x1f')]){_0x224e23['to']=this['message'][_0xf791('0x20')]||'';if(this['channel']===_0xf791('0x10')&&_0x48d493[0x1]==='1'){_0x224e23['cc']=this[_0xf791('0x1f')]['cc']||'';}_0x224e23[_0xf791('0x20')]=this['message']['to']||'';_0x224e23[_0xf791('0x21')]=this[_0xf791('0x1f')]['phone']||'';_0x224e23['read']=!![];if(this[_0xf791('0x1f')]['subject']){_0x224e23[_0xf791('0x22')]='';_0x224e23[_0xf791('0x22')]+=_['startsWith'](this[_0xf791('0x1f')][_0xf791('0x22')],_0xf791('0x23'))?'':_0xf791('0x24');_0x224e23[_0xf791('0x22')]+=this[_0xf791('0x1f')]['subject'];}}if(this[_0xf791('0xf')]==='chat'){_0x224e23[_0xf791('0x25')]=this[_0xf791('0x26')]['id'];}else{_0x224e23[_[_0xf791('0x27')](this['channel'])+_0xf791('0x28')]=this[_0xf791('0x26')]['id'];}_0x224e23[_[_0xf791('0x27')](this[_0xf791('0xf')])+_0xf791('0x29')]=this[_0xf791('0x16')]['id'];var _0x28faaa=this['interaction'];if(rpc[this['channel']+_0xf791('0x2a')]){if(this[_0xf791('0xf')]===_0xf791('0x10')){_0x224e23[_0xf791('0x2b')]=this['message'][_0xf791('0x2c')];_0x224e23[_0xf791('0x2d')]=_0xf791('0x2e')+_[_0xf791('0x2f')](_0x224e23[_0xf791('0x11')],_0xf791('0x30'),_0xf791('0x31'))+_0xf791('0x32');_0x224e23[_0xf791('0x33')]={'Auto-Submitted':_0xf791('0x34'),'X-Auto-Response-Suppress':_0xf791('0x35'),'Precedence':_0xf791('0x36')};return mailRpc[_0xf791('0x37')](this[_0xf791('0x26')]['smtpOptions'],_0x224e23)['then'](function(_0x29dedc){logger[_0xf791('0x17')](_0xf791('0x38'),_0x35c27a);_0x224e23['messageId']=_0x29dedc[_0xf791('0x1f')][_0xf791('0x2c')];return rpc[_0x59ad28+_0xf791('0x2a')]['create'](_0x224e23);})['then'](function(_0x1b4c8a){logger['info'](_0xf791('0x13'),_0x35c27a,JSON[_0xf791('0x39')](_0x1b4c8a));})[_0xf791('0x3a')](function(_0xf5e666){logger[_0xf791('0x3b')](_0xf791('0x3c'),_0x35c27a,JSON['stringify'](_0xf5e666));})[_0xf791('0x3d')](function(){Promise[_0xf791('0x3e')]()[_0xf791('0x3f')](function(){if(_0x48d493[0x0]!=='2'||_0x28faaa[_0xf791('0x19')])return;return rpc[_0x59ad28+_0xf791('0x40')][_0xf791('0x41')](_0x28faaa['id'],{'autoreplyExecuted':!![]})[_0xf791('0x3f')](function(_0x9534b2){logger['info'](_0xf791('0x1a'),_0x35c27a,JSON[_0xf791('0x39')](_0x9534b2));})['catch'](function(_0x823fc9){logger[_0xf791('0x3b')](_0xf791('0x42'),_0x35c27a,JSON['stringify'](_0x823fc9));});})[_0xf791('0x3f')](function(){_0x363f2d[_0xf791('0x14')]();});});}else{return rpc[this[_0xf791('0xf')]+_0xf791('0x2a')]['create'](_0x224e23)['then'](function(){logger[_0xf791('0x17')](_0xf791('0x13'),_0x35c27a,_0x224e23[_0xf791('0x11')]);})['catch'](function(_0x1820f6){logger[_0xf791('0x3b')](_0xf791('0x13'),_0x35c27a,JSON[_0xf791('0x39')](_0x1820f6));})[_0xf791('0x3d')](function(){Promise[_0xf791('0x3e')]()[_0xf791('0x3f')](function(){if(_0x48d493[0x0]!=='2'||_0x28faaa[_0xf791('0x19')])return;return rpc[_0x59ad28+_0xf791('0x40')][_0xf791('0x41')](_0x28faaa['id'],{'autoreplyExecuted':!![]})[_0xf791('0x3f')](function(_0x558524){logger[_0xf791('0x17')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x35c27a,JSON[_0xf791('0x39')](_0x558524));})[_0xf791('0x3a')](function(_0x35b158){logger['error'](_0xf791('0x42'),_0x35c27a,JSON[_0xf791('0x39')](_0x35b158));});})[_0xf791('0x3f')](function(){_0x363f2d['next']();});});}}}catch(_0x553c31){logger[_0xf791('0x3b')](_0xf791('0x13'),_0x35c27a,JSON[_0xf791('0x39')](_0x553c31));_0x363f2d[_0xf791('0x43')]();}};}; \ 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 032a0d3..85ce6c0 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 _0x43a7=['[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x43a7,0x1b9));var _0x743a=function(_0x1e4c55,_0x1415eb){_0x1e4c55=_0x1e4c55-0x0;var _0x511ab5=_0x43a7[_0x1e4c55];return _0x511ab5;};'use strict';var moment=require(_0x743a('0x0'));var logger=require(_0x743a('0x1'))('routing');var rpc={'chatInteraction':require(_0x743a('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x743a('0x3')),'mailInteraction':require(_0x743a('0x4')),'faxInteraction':require(_0x743a('0x5')),'whatsappInteraction':require(_0x743a('0x6'))};exports[_0x743a('0x7')]=function(_0x5120e7,_0x3512ec,_0x2b8abd,_0x10a7c7){return function(_0x285263){try{logger['info'](_0x743a('0x8'),_0x5120e7,_0x3512ec[0x0]);var _0xef4dd3={'closed':0x1,'closedAt':moment()['format'](_0x743a('0x9')),'closeReason':'system','disposition':_0x3512ec[0x0]};if(rpc[_0x10a7c7[_0x743a('0xa')]+_0x743a('0xb')]){rpc[_0x10a7c7[_0x743a('0xa')]+_0x743a('0xb')][_0x743a('0xc')](_0x10a7c7['interaction']['id'],_0xef4dd3)[_0x743a('0xd')](function(_0x235702){logger[_0x743a('0xe')](_0x743a('0xf'),_0x5120e7,_0x10a7c7[_0x743a('0x10')]['id']);})[_0x743a('0x11')](function(_0x377e24){logger[_0x743a('0x12')](_0x743a('0x13'),_0x5120e7,JSON['stringify'](_0x377e24));})[_0x743a('0x14')](function(){_0x285263[_0x743a('0x15')]();});}}catch(_0x3d3d1e){logger['error'](_0x743a('0x13'),_0x5120e7,JSON[_0x743a('0x16')](_0x3d3d1e));_0x285263[_0x743a('0x15')]();}};}; \ No newline at end of file +var _0x462b=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x3e05f1,_0xfb82da){var _0x163164=function(_0x41717e){while(--_0x41717e){_0x3e05f1['push'](_0x3e05f1['shift']());}};_0x163164(++_0xfb82da);}(_0x462b,0x94));var _0xb462=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x462b[_0x17d9e3];return _0x14192d;};'use strict';var moment=require('moment');var logger=require(_0xb462('0x0'))(_0xb462('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb462('0x2')),'smsInteraction':require(_0xb462('0x3')),'mailInteraction':require(_0xb462('0x4')),'faxInteraction':require(_0xb462('0x5')),'whatsappInteraction':require(_0xb462('0x6'))};exports['consequence']=function(_0x4d4603,_0x3df052,_0x225c6f,_0x525c43){return function(_0x3acf38){try{logger[_0xb462('0x7')](_0xb462('0x8'),_0x4d4603,_0x3df052[0x0]);var _0x3f669f={'closed':0x1,'closedAt':moment()[_0xb462('0x9')](_0xb462('0xa')),'closeReason':'system','disposition':_0x3df052[0x0]};if(rpc[_0x525c43[_0xb462('0xb')]+_0xb462('0xc')]){rpc[_0x525c43[_0xb462('0xb')]+'Interaction']['update'](_0x525c43[_0xb462('0xd')]['id'],_0x3f669f)[_0xb462('0xe')](function(_0x563d65){logger[_0xb462('0x7')](_0xb462('0xf'),_0x4d4603,_0x525c43[_0xb462('0xd')]['id']);})['catch'](function(_0x5e841e){logger['error'](_0xb462('0x10'),_0x4d4603,JSON[_0xb462('0x11')](_0x5e841e));})['finally'](function(){_0x3acf38[_0xb462('0x12')]();});}}catch(_0x1a59c0){logger['error']('[%s][CLOSE]\x20%s',_0x4d4603,JSON[_0xb462('0x11')](_0x1a59c0));_0x3acf38[_0xb462('0x12')]();}};}; \ 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 2b316ae..4419f4d 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 _0xa93e=['whatsapp','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','stringify','finally','stop','textRequest','dialogflow','fulfillment','providerName','result','metadata','endConversation','next','message','apiai-promise','md5','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xa93e,0x1df));var _0xea93=function(_0x553517,_0xb6da24){_0x553517=_0x553517-0x0;var _0x33e6a1=_0xa93e[_0x553517];return _0x33e6a1;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xea93('0x0'));var md5=require(_0xea93('0x1'));var utils=require('./utils');var logger=require(_0xea93('0x2'))('routing');var rpc={'chatMessage':require(_0xea93('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xea93('0x4')),'faxMessage':require(_0xea93('0x5')),'whatsappMessage':require(_0xea93('0x6'))};exports[_0xea93('0x7')]=function(_0x477a7d,_0x3d53bd){return function(_0x54ebdf){try{if(!_[_0xea93('0x8')](this['interaction']['UserId'])){logger['info'](_0xea93('0x9'),_0x477a7d,_0xea93('0xa'));return _0x54ebdf['next']();}var _0x1229f9={'ContactId':this[_0xea93('0xb')]['id'],'sentAt':moment()['format'](_0xea93('0xc')),'direction':_0xea93('0xd')};if(this[_0xea93('0xe')]===_0xea93('0xf')||this[_0xea93('0xe')]===_0xea93('0x10')){_0x1229f9['phone']=this[_0xea93('0x11')]['phone'];}var _0x495c28=this[_0xea93('0xe')];if(_0x495c28===_0xea93('0x12')){_0x1229f9[_0xea93('0x13')]=this[_0xea93('0x14')]['id'];}else{_0x1229f9[_[_0xea93('0x15')](_0x495c28)+_0xea93('0x16')]=this['account']['id'];}_0x1229f9[_[_0xea93('0x15')](_0x495c28)+'InteractionId']=this[_0xea93('0x11')]['id'];if(this[_0xea93('0x11')][_0xea93('0x17')]){var _0x3e912c=_0x3d53bd[0x2];if(!_[_0xea93('0x18')](_0x3e912c)){_0x1229f9[_0xea93('0x19')]=utils[_0xea93('0x1a')](_0x3e912c,this);return rpc[_0x495c28+_0xea93('0x1b')][_0xea93('0x1c')](_0x1229f9)[_0xea93('0x1d')](function(_0x771685){logger[_0xea93('0x1e')](_0xea93('0x9'),_0x477a7d,_0x1229f9['body']);})[_0xea93('0x1f')](function(_0x5430a4){logger[_0xea93('0x20')](_0xea93('0x9'),_0x477a7d,JSON[_0xea93('0x21')](_0x5430a4));})[_0xea93('0x22')](function(){logger[_0xea93('0x1e')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x477a7d);_0x54ebdf[_0xea93('0x23')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x477a7d);_0x54ebdf[_0xea93('0x23')]();}}else{var _0x36cd31=this;var _0x622e1b=apiai(_0x3d53bd[0x0],{'language':_0x3d53bd[0x1]||'en'});return _0x622e1b[_0xea93('0x24')](this['message'][_0xea93('0x19')],{'sessionId':md5(this[_0xea93('0x11')]['id'])})[_0xea93('0x1d')](function(_0x404b74){_0x36cd31[_0xea93('0x19')][_0xea93('0x25')]=_0x404b74;_0x1229f9[_0xea93('0x19')]=_0x404b74['result'][_0xea93('0x26')]['speech'];_0x1229f9[_0xea93('0x27')]=_0xea93('0x25');_0x1229f9['providerResponse']=JSON[_0xea93('0x21')](_0x404b74);return rpc[_0x495c28+_0xea93('0x1b')][_0xea93('0x1c')](_0x1229f9)[_0xea93('0x1d')](function(_0x5f01ca){logger[_0xea93('0x1e')](_0xea93('0x9'),_0x477a7d,_0x1229f9['body']);if(_0x404b74[_0xea93('0x28')][_0xea93('0x29')][_0xea93('0x2a')]){_0x54ebdf[_0xea93('0x2b')]();}else{_0x54ebdf['stop']();}})[_0xea93('0x1f')](function(_0x166850){logger[_0xea93('0x20')](_0xea93('0x9'),_0x477a7d,JSON[_0xea93('0x21')](_0x166850));_0x54ebdf[_0xea93('0x2b')]();});})['catch'](function(_0x297fb5){logger[_0xea93('0x20')](_0xea93('0x9'),_0x477a7d,_0x297fb5[_0xea93('0x2c')]);_0x54ebdf[_0xea93('0x2b')]();});}}catch(_0x5af7ae){logger[_0xea93('0x20')](_0xea93('0x9'),_0x477a7d,JSON['stringify'](_0x5af7ae));_0x54ebdf[_0xea93('0x23')]();}};}; \ No newline at end of file +var _0x37cc=['consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','create','body','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','fulfillment','providerName','providerResponse','metadata','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x29e1b5,_0x34af48){var _0x5c1479=function(_0x333892){while(--_0x333892){_0x29e1b5['push'](_0x29e1b5['shift']());}};_0x5c1479(++_0x34af48);}(_0x37cc,0x185));var _0xc37c=function(_0x4d1c00,_0x449133){_0x4d1c00=_0x4d1c00-0x0;var _0x239935=_0x37cc[_0x4d1c00];return _0x239935;};'use strict';var _=require(_0xc37c('0x0'));var moment=require(_0xc37c('0x1'));var apiai=require(_0xc37c('0x2'));var md5=require(_0xc37c('0x3'));var utils=require(_0xc37c('0x4'));var logger=require(_0xc37c('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc37c('0x6')),'mailMessage':require(_0xc37c('0x7')),'smsMessage':require(_0xc37c('0x8')),'faxMessage':require(_0xc37c('0x9')),'whatsappMessage':require(_0xc37c('0xa'))};exports[_0xc37c('0xb')]=function(_0xd8f098,_0x1eaa97){return function(_0x3c5c63){try{if(!_['isNil'](this[_0xc37c('0xc')][_0xc37c('0xd')])){logger[_0xc37c('0xe')](_0xc37c('0xf'),_0xd8f098,_0xc37c('0x10'));return _0x3c5c63['next']();}var _0xccce4e={'ContactId':this[_0xc37c('0x11')]['id'],'sentAt':moment()[_0xc37c('0x12')](_0xc37c('0x13')),'direction':_0xc37c('0x14')};if(this[_0xc37c('0x15')]===_0xc37c('0x16')||this[_0xc37c('0x15')]===_0xc37c('0x17')){_0xccce4e[_0xc37c('0x18')]=this[_0xc37c('0xc')]['phone'];}var _0x518d90=this[_0xc37c('0x15')];if(_0x518d90===_0xc37c('0x19')){_0xccce4e[_0xc37c('0x1a')]=this[_0xc37c('0x1b')]['id'];}else{_0xccce4e[_[_0xc37c('0x1c')](_0x518d90)+_0xc37c('0x1d')]=this['account']['id'];}_0xccce4e[_[_0xc37c('0x1c')](_0x518d90)+'InteractionId']=this[_0xc37c('0xc')]['id'];if(this[_0xc37c('0xc')][_0xc37c('0x1e')]){var _0xb00fb1=_0x1eaa97[0x2];if(!_[_0xc37c('0x1f')](_0xb00fb1)){_0xccce4e['body']=utils['getMustacheRender'](_0xb00fb1,this);return rpc[_0x518d90+'Message'][_0xc37c('0x20')](_0xccce4e)['then'](function(_0x370c2f){logger[_0xc37c('0xe')]('[%s][DIALOGFLOW]\x20%s',_0xd8f098,_0xccce4e[_0xc37c('0x21')]);})[_0xc37c('0x22')](function(_0x593820){logger[_0xc37c('0x23')]('[%s][DIALOGFLOW]\x20%s',_0xd8f098,JSON[_0xc37c('0x24')](_0x593820));})['finally'](function(){logger[_0xc37c('0xe')](_0xc37c('0x25'),_0xd8f098);_0x3c5c63[_0xc37c('0x26')]();});}else{logger[_0xc37c('0xe')](_0xc37c('0x27'),_0xd8f098);_0x3c5c63['stop']();}}else{var _0x148334=this;var _0x33aa68=apiai(_0x1eaa97[0x0],{'language':_0x1eaa97[0x1]||'en'});return _0x33aa68[_0xc37c('0x28')](this[_0xc37c('0x29')][_0xc37c('0x21')],{'sessionId':md5(this[_0xc37c('0xc')]['id'])})[_0xc37c('0x2a')](function(_0x70e0b5){_0x148334[_0xc37c('0x21')][_0xc37c('0x2b')]=_0x70e0b5;_0xccce4e[_0xc37c('0x21')]=_0x70e0b5[_0xc37c('0x2c')][_0xc37c('0x2d')]['speech'];_0xccce4e[_0xc37c('0x2e')]=_0xc37c('0x2b');_0xccce4e[_0xc37c('0x2f')]=JSON[_0xc37c('0x24')](_0x70e0b5);return rpc[_0x518d90+'Message'][_0xc37c('0x20')](_0xccce4e)[_0xc37c('0x2a')](function(_0x45cce8){logger[_0xc37c('0xe')](_0xc37c('0xf'),_0xd8f098,_0xccce4e[_0xc37c('0x21')]);if(_0x70e0b5[_0xc37c('0x2c')][_0xc37c('0x30')]['endConversation']){_0x3c5c63[_0xc37c('0x31')]();}else{_0x3c5c63[_0xc37c('0x26')]();}})[_0xc37c('0x22')](function(_0x39d78e){logger[_0xc37c('0x23')](_0xc37c('0xf'),_0xd8f098,JSON[_0xc37c('0x24')](_0x39d78e));_0x3c5c63[_0xc37c('0x31')]();});})[_0xc37c('0x22')](function(_0x472d58){logger[_0xc37c('0x23')](_0xc37c('0xf'),_0xd8f098,_0x472d58[_0xc37c('0x29')]);_0x3c5c63['next']();});}}catch(_0x1690f3){logger[_0xc37c('0x23')]('[%s][DIALOGFLOW]\x20%s',_0xd8f098,JSON['stringify'](_0x1690f3));_0x3c5c63[_0xc37c('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index bc3c054..27431bd 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7af2=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','length','dialogflowV2','diagnosticInfo','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','fulfillmentText','all','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','body','Message','then','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7af2,0x1b5));var _0x27af=function(_0x4e5504,_0x2be6a6){_0x4e5504=_0x4e5504-0x0;var _0x424a9e=_0x7af2[_0x4e5504];return _0x424a9e;};'use strict';var _=require(_0x27af('0x0'));var dialogflow=require(_0x27af('0x1'));var md5=require('md5');var moment=require(_0x27af('0x2'));var Promise=require(_0x27af('0x3'));var logger=require(_0x27af('0x4'))(_0x27af('0x5'));var utils=require(_0x27af('0x6'));var rpc={'chatMessage':require(_0x27af('0x7')),'openchannelMessage':require(_0x27af('0x8')),'mailMessage':require(_0x27af('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x27af('0xa'))};function createMessage(_0x1525c7,_0x418716,_0x444d85,_0x374157){return new Promise(function(_0xd42bc1,_0x26ae5a){var _0x4fbb18=_['clone'](_0x444d85);_0x4fbb18[_0x27af('0xb')]=_0x374157;return rpc[_0x418716+_0x27af('0xc')]['create'](_0x4fbb18)[_0x27af('0xd')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1525c7,_0x4fbb18[_0x27af('0xb')]);_0xd42bc1();})[_0x27af('0xe')](function(_0x4c1225){logger[_0x27af('0xf')](_0x27af('0x10'),_0x1525c7,JSON[_0x27af('0x11')](_0x4c1225));_0x26ae5a(_0x4c1225);});});}exports[_0x27af('0x12')]=function(_0x16329d,_0x5458ed){return function(_0x3434de){try{if(!_[_0x27af('0x13')](this[_0x27af('0x14')]['UserId'])){logger[_0x27af('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x16329d,_0x27af('0x16'));return _0x3434de[_0x27af('0x17')]();}var _0x2761fe={'ContactId':this[_0x27af('0x18')]['id'],'sentAt':moment()[_0x27af('0x19')](_0x27af('0x1a')),'direction':_0x27af('0x1b')};if(this[_0x27af('0x1c')]===_0x27af('0x1d')||this[_0x27af('0x1c')]===_0x27af('0x1e')){_0x2761fe[_0x27af('0x1f')]=this[_0x27af('0x14')][_0x27af('0x1f')];}var _0x3beaed=this[_0x27af('0x1c')];if(_0x3beaed==='chat'){_0x2761fe[_0x27af('0x20')]=this[_0x27af('0x21')]['id'];}else{_0x2761fe[_[_0x27af('0x22')](_0x3beaed)+_0x27af('0x23')]=this[_0x27af('0x21')]['id'];}_0x2761fe[_['upperFirst'](_0x3beaed)+_0x27af('0x24')]=this[_0x27af('0x14')]['id'];if(this[_0x27af('0x14')][_0x27af('0x25')]){var _0x270db9=_0x5458ed[0x4];if(!_['isEmpty'](_0x270db9)){_0x2761fe['body']=utils[_0x27af('0x26')](_0x270db9,this);return rpc[_0x3beaed+_0x27af('0xc')][_0x27af('0x27')](_0x2761fe)['then'](function(_0x4fc3d5){logger[_0x27af('0x15')](_0x27af('0x10'),_0x16329d,_0x2761fe[_0x27af('0xb')]);})[_0x27af('0xe')](function(_0x5a49d8){logger[_0x27af('0xf')](_0x27af('0x10'),_0x16329d,JSON[_0x27af('0x11')](_0x5a49d8));})['finally'](function(){logger[_0x27af('0x15')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x16329d);_0x3434de['stop']();});}else{logger[_0x27af('0x15')](_0x27af('0x28'),_0x16329d);_0x3434de[_0x27af('0x29')]();}}else{var _0x76c93e=this;var _0x6bff27=_0x5458ed[0x2]['replace'](/\\n/g,'\x0a');var _0x3cd36e={'credentials':{'private_key':_0x6bff27,'client_email':_0x5458ed[0x1]}};var _0x37ba1f=new dialogflow[(_0x27af('0x2a'))](_0x3cd36e);var _0x24f14a=_0x37ba1f[_0x27af('0x2b')](_0x5458ed[0x0],md5(_0x76c93e['interaction']['id']));var _0x2b9973={'session':_0x24f14a,'queryInput':{'text':{'text':_0x76c93e['message'][_0x27af('0xb')],'languageCode':_0x5458ed[0x3]||'en'}}};return _0x37ba1f['detectIntent'](_0x2b9973)[_0x27af('0xd')](function(_0x11e10d){if(_0x11e10d&&_0x11e10d[_0x27af('0x2c')]){_0x76c93e[_0x27af('0xb')][_0x27af('0x2d')]=_0x11e10d;var _0x2b3aa7=_0x11e10d[0x0];var _0x894526=_0x2b3aa7['queryResult'][_0x27af('0x2e')]&&_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x2e')][_0x27af('0x30')]?_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x2e')][_0x27af('0x30')]['end_conversation'][_0x27af('0x31')]:![];_0x76c93e['body'][_0x27af('0x32')]=_0x2b3aa7['queryResult']['action'];_0x76c93e[_0x27af('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2b3aa7[_0x27af('0x2f')]['allRequiredParamsPresent'];_0x76c93e['body'][_0x27af('0x33')]=_0x2b3aa7['queryResult'][_0x27af('0x2e')]&&_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x2e')][_0x27af('0x30')]?_0x2b3aa7[_0x27af('0x2f')]['diagnosticInfo'][_0x27af('0x30')]['end_conversation'][_0x27af('0x31')]:![];_0x76c93e[_0x27af('0xb')][_0x27af('0x34')]=_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x35')][_0x27af('0x36')];_0x76c93e[_0x27af('0xb')][_0x27af('0x37')]=_0x2b3aa7[_0x27af('0x2f')]['intent'][_0x27af('0x38')];_0x76c93e['body'][_0x27af('0x39')]=_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x35')]['isFallback'];_0x76c93e[_0x27af('0xb')]['DIALOGFLOWV2_LANGUAGECODE']=_0x2b3aa7['queryResult'][_0x27af('0x3a')];_0x76c93e[_0x27af('0xb')][_0x27af('0x3b')]=_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x3c')];_0x76c93e[_0x27af('0xb')][_0x27af('0x3d')]=_0x2b3aa7[_0x27af('0x2f')][_0x27af('0x3e')];_0x2761fe['providerName']=_0x27af('0x2d');_0x2761fe[_0x27af('0x3f')]=JSON[_0x27af('0x11')](_0x11e10d);var _0x584849=[];for(var _0x5d8029=0x0;_0x5d8029<_0x11e10d[_0x27af('0x2c')];_0x5d8029++){var _0x393174=_0x11e10d[_0x5d8029];if(_0x393174&&_0x393174['queryResult']&&_0x393174[_0x27af('0x2f')]['fulfillmentText']){_0x584849[_0x27af('0x40')](createMessage(_0x16329d,_0x3beaed,_0x2761fe,_0x393174[_0x27af('0x2f')][_0x27af('0x41')]));}}return Promise[_0x27af('0x42')](_0x584849)[_0x27af('0xd')](function(){if(_0x894526){_0x3434de[_0x27af('0x17')]();}else{_0x3434de['stop']();}})['catch'](function(_0x2860a9){logger[_0x27af('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x16329d,JSON['stringify'](_0x2860a9));_0x3434de[_0x27af('0x17')]();});}})[_0x27af('0xe')](function(_0x5733a7){logger[_0x27af('0xf')](_0x27af('0x10'),_0x16329d,_0x5733a7['message']);_0x3434de[_0x27af('0x17')]();});}}catch(_0x4075bd){logger[_0x27af('0xf')](_0x27af('0x10'),_0x16329d,JSON[_0x27af('0x11')](_0x4075bd));_0x3434de[_0x27af('0x29')]();}};}; \ No newline at end of file +var _0xcc62=['md5','bluebird','../../../../config/logger','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','then','catch','error','stringify','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','InteractionId','getMustacheRender','Message','create','[%s][DIALOGFLOWV2]\x20%s','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','fields','queryResult','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','lodash'];(function(_0x3490f1,_0x484136){var _0xe83fa0=function(_0x3533bf){while(--_0x3533bf){_0x3490f1['push'](_0x3490f1['shift']());}};_0xe83fa0(++_0x484136);}(_0xcc62,0x10b));var _0x2cc6=function(_0x19c6b6,_0x344fae){_0x19c6b6=_0x19c6b6-0x0;var _0x3ab731=_0xcc62[_0x19c6b6];return _0x3ab731;};'use strict';var _=require(_0x2cc6('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x2cc6('0x1'));var moment=require('moment');var Promise=require(_0x2cc6('0x2'));var logger=require(_0x2cc6('0x3'))('routing');var utils=require(_0x2cc6('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2cc6('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2cc6('0x6')),'faxMessage':require(_0x2cc6('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x3a9654,_0x544e60,_0x9bd555,_0x2b4cff){return new Promise(function(_0x2babfe,_0x5a9ca9){var _0x42bee4=_['clone'](_0x9bd555);_0x42bee4[_0x2cc6('0x8')]=_0x2b4cff;return rpc[_0x544e60+'Message']['create'](_0x42bee4)[_0x2cc6('0x9')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x3a9654,_0x42bee4[_0x2cc6('0x8')]);_0x2babfe();})[_0x2cc6('0xa')](function(_0x3679ae){logger[_0x2cc6('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x3a9654,JSON[_0x2cc6('0xc')](_0x3679ae));_0x5a9ca9(_0x3679ae);});});}exports[_0x2cc6('0xd')]=function(_0x4f420b,_0x555841){return function(_0x18841a){try{if(!_['isNil'](this[_0x2cc6('0xe')][_0x2cc6('0xf')])){logger[_0x2cc6('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4f420b,_0x2cc6('0x11'));return _0x18841a[_0x2cc6('0x12')]();}var _0x1b87f8={'ContactId':this[_0x2cc6('0x13')]['id'],'sentAt':moment()[_0x2cc6('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2cc6('0x15')};if(this[_0x2cc6('0x16')]===_0x2cc6('0x17')||this[_0x2cc6('0x16')]===_0x2cc6('0x18')){_0x1b87f8[_0x2cc6('0x19')]=this['interaction'][_0x2cc6('0x19')];}var _0x3e4170=this[_0x2cc6('0x16')];if(_0x3e4170==='chat'){_0x1b87f8[_0x2cc6('0x1a')]=this[_0x2cc6('0x1b')]['id'];}else{_0x1b87f8[_[_0x2cc6('0x1c')](_0x3e4170)+'AccountId']=this[_0x2cc6('0x1b')]['id'];}_0x1b87f8[_[_0x2cc6('0x1c')](_0x3e4170)+_0x2cc6('0x1d')]=this['interaction']['id'];if(this[_0x2cc6('0xe')]['created']){var _0x5d2936=_0x555841[0x4];if(!_['isEmpty'](_0x5d2936)){_0x1b87f8[_0x2cc6('0x8')]=utils[_0x2cc6('0x1e')](_0x5d2936,this);return rpc[_0x3e4170+_0x2cc6('0x1f')][_0x2cc6('0x20')](_0x1b87f8)[_0x2cc6('0x9')](function(_0x424fb8){logger[_0x2cc6('0x10')](_0x2cc6('0x21'),_0x4f420b,_0x1b87f8['body']);})[_0x2cc6('0xa')](function(_0x3165e4){logger[_0x2cc6('0xb')](_0x2cc6('0x21'),_0x4f420b,JSON[_0x2cc6('0xc')](_0x3165e4));})[_0x2cc6('0x22')](function(){logger['info'](_0x2cc6('0x23'),_0x4f420b);_0x18841a[_0x2cc6('0x24')]();});}else{logger[_0x2cc6('0x10')](_0x2cc6('0x25'),_0x4f420b);_0x18841a['stop']();}}else{var _0x428f37=this;var _0x51c3c3=_0x555841[0x2][_0x2cc6('0x26')](/\\n/g,'\x0a');var _0x14a587={'credentials':{'private_key':_0x51c3c3,'client_email':_0x555841[0x1]}};var _0x2ef9ef=new dialogflow['SessionsClient'](_0x14a587);var _0x42961e=_0x2ef9ef[_0x2cc6('0x27')](_0x555841[0x0],md5(_0x428f37[_0x2cc6('0xe')]['id']));var _0xad9d0f={'session':_0x42961e,'queryInput':{'text':{'text':_0x428f37[_0x2cc6('0x28')][_0x2cc6('0x8')],'languageCode':_0x555841[0x3]||'en'}}};return _0x2ef9ef[_0x2cc6('0x29')](_0xad9d0f)[_0x2cc6('0x9')](function(_0x127edc){if(_0x127edc&&_0x127edc[_0x2cc6('0x2a')]){_0x428f37[_0x2cc6('0x8')][_0x2cc6('0x2b')]=_0x127edc;var _0xb529a8=_0x127edc[0x0];var _0x1c3525=_0xb529a8['queryResult'][_0x2cc6('0x2c')]&&_0xb529a8['queryResult'][_0x2cc6('0x2c')][_0x2cc6('0x2d')]?_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x2c')][_0x2cc6('0x2d')][_0x2cc6('0x2f')][_0x2cc6('0x30')]:![];_0x428f37['body']['DIALOGFLOWV2_ACTION']=_0xb529a8['queryResult'][_0x2cc6('0x31')];_0x428f37[_0x2cc6('0x8')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x32')];_0x428f37['body'][_0x2cc6('0x33')]=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x2c')]&&_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x2c')][_0x2cc6('0x2d')]?_0xb529a8[_0x2cc6('0x2e')]['diagnosticInfo'][_0x2cc6('0x2d')][_0x2cc6('0x2f')]['boolValue']:![];_0x428f37[_0x2cc6('0x8')][_0x2cc6('0x34')]=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x35')][_0x2cc6('0x36')];_0x428f37[_0x2cc6('0x8')][_0x2cc6('0x37')]=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x35')]['displayName'];_0x428f37[_0x2cc6('0x8')][_0x2cc6('0x38')]=_0xb529a8['queryResult'][_0x2cc6('0x35')][_0x2cc6('0x39')];_0x428f37['body'][_0x2cc6('0x3a')]=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x3b')];_0x428f37['body']['DIALOGFLOWV2_QUERYTEXT']=_0xb529a8[_0x2cc6('0x2e')][_0x2cc6('0x3c')];_0x428f37[_0x2cc6('0x8')][_0x2cc6('0x3d')]=_0xb529a8[_0x2cc6('0x2e')]['intentDetectionConfidence'];_0x1b87f8[_0x2cc6('0x3e')]=_0x2cc6('0x2b');_0x1b87f8[_0x2cc6('0x3f')]=JSON[_0x2cc6('0xc')](_0x127edc);var _0x11c095=[];for(var _0x2bf637=0x0;_0x2bf637<_0x127edc[_0x2cc6('0x2a')];_0x2bf637++){var _0x5c9f44=_0x127edc[_0x2bf637];if(_0x5c9f44&&_0x5c9f44[_0x2cc6('0x2e')]&&_0x5c9f44[_0x2cc6('0x2e')][_0x2cc6('0x40')]){_0x11c095[_0x2cc6('0x41')](createMessage(_0x4f420b,_0x3e4170,_0x1b87f8,_0x5c9f44['queryResult']['fulfillmentText']));}}return Promise[_0x2cc6('0x42')](_0x11c095)[_0x2cc6('0x9')](function(){if(_0x1c3525){_0x18841a[_0x2cc6('0x12')]();}else{_0x18841a[_0x2cc6('0x24')]();}})[_0x2cc6('0xa')](function(_0x3e3c40){logger[_0x2cc6('0xb')](_0x2cc6('0x21'),_0x4f420b,JSON[_0x2cc6('0xc')](_0x3e3c40));_0x18841a[_0x2cc6('0x12')]();});}})[_0x2cc6('0xa')](function(_0x31a8a5){logger['error'](_0x2cc6('0x21'),_0x4f420b,_0x31a8a5[_0x2cc6('0x28')]);_0x18841a[_0x2cc6('0x12')]();});}}catch(_0x30c280){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4f420b,JSON['stringify'](_0x30c280));_0x18841a[_0x2cc6('0x24')]();}};}; \ 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 77fdb4b..ed41f8d 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 _0xd651=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','info','next','findIndex','rules'];(function(_0x3ba380,_0x4ff1b1){var _0x4447ee=function(_0x1ef86e){while(--_0x1ef86e){_0x3ba380['push'](_0x3ba380['shift']());}};_0x4447ee(++_0x4ff1b1);}(_0xd651,0x1c5));var _0x1d65=function(_0x1dd30c,_0x4e6d39){_0x1dd30c=_0x1dd30c-0x0;var _0x55e6fa=_0xd651[_0x1dd30c];return _0x55e6fa;};'use strict';var schema=require(_0x1d65('0x0'));var _=require(_0x1d65('0x1'));var htmlToText=require(_0x1d65('0x2'));var utils=require(_0x1d65('0x3'));var logger=require(_0x1d65('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x1d65('0x5')},'priorityTrue':{'type':_0x1d65('0x6'),'message':_0x1d65('0x7')},'priorityFalse':{'type':_0x1d65('0x6'),'message':_0x1d65('0x8')}});exports['consequence']=function(_0x2f00be,_0xea41e8){return function(_0x3bed1f){try{var _0x33a625={'condition':htmlToText[_0x1d65('0x9')](utils[_0x1d65('0xa')](_0xea41e8[0x0],this),{'wordwrap':![]})[_0x1d65('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xea41e8[0x1],'priorityFalse':_0xea41e8[0x2]};var _0x13eb92=gotoif[_0x1d65('0x0')](_0x33a625,{'typecast':!![]});if(_0x13eb92[_0x1d65('0xc')]){logger['error'](_0x1d65('0xd'),_0x2f00be,_[_0x1d65('0xe')](_0x13eb92,_0x1d65('0xf'))[_0x1d65('0x10')](',\x20'));_0x3bed1f['stop']();}else{try{var _0x125d24=eval('('+_0x33a625[_0x1d65('0x11')]+')');var _0x840caa=_0x125d24?_0x33a625[_0x1d65('0x12')]:_0x33a625['priorityFalse'];logger[_0x1d65('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2f00be,_0x33a625[_0x1d65('0x11')],_0x125d24,_0x840caa||_0x1d65('0x14'));if(_0x840caa){var _0x99530c=_[_0x1d65('0x15')](_0x3bed1f[_0x1d65('0x16')](),{'p':_0x840caa});if(_0x99530c>=0x0){logger['info'](_0x1d65('0x17'),_0x2f00be,_0x840caa||_0x1d65('0x14'),_0x99530c);_0x3bed1f[_0x1d65('0x14')](_0x99530c);}else{logger[_0x1d65('0x13')](_0x1d65('0x18'),_0x2f00be,_0x840caa||_0x1d65('0x14'));_0x3bed1f[_0x1d65('0x19')]();}}else{_0x3bed1f[_0x1d65('0x14')]();}}catch(_0x209ac9){logger[_0x1d65('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2f00be,_0x209ac9[_0x1d65('0xf')]);_0x3bed1f['stop']();}}}catch(_0x623d1b){logger[_0x1d65('0x1a')]('[%s][GOTOIF]\x20%s',_0x2f00be,JSON[_0x1d65('0x1b')](_0x623d1b));_0x3bed1f[_0x1d65('0x19')]();}};}; \ No newline at end of file +var _0x1556=['next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./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','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x1c9757,_0x9d46b){var _0x54a07d=function(_0x4f3f4e){while(--_0x4f3f4e){_0x1c9757['push'](_0x1c9757['shift']());}};_0x54a07d(++_0x9d46b);}(_0x1556,0xf6));var _0x6155=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1556[_0x59ee6f];return _0x4c0979;};'use strict';var schema=require(_0x6155('0x0'));var _=require(_0x6155('0x1'));var htmlToText=require(_0x6155('0x2'));var utils=require(_0x6155('0x3'));var logger=require(_0x6155('0x4'))(_0x6155('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x6155('0x6')},'priorityTrue':{'type':_0x6155('0x7'),'message':_0x6155('0x8')},'priorityFalse':{'type':_0x6155('0x7'),'message':_0x6155('0x9')}});exports[_0x6155('0xa')]=function(_0x2218ba,_0xcaf806){return function(_0x4213ab){try{var _0x28c6f7={'condition':htmlToText[_0x6155('0xb')](utils[_0x6155('0xc')](_0xcaf806[0x0],this),{'wordwrap':![]})[_0x6155('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xcaf806[0x1],'priorityFalse':_0xcaf806[0x2]};var _0x18421f=gotoif[_0x6155('0x0')](_0x28c6f7,{'typecast':!![]});if(_0x18421f[_0x6155('0xe')]){logger[_0x6155('0xf')](_0x6155('0x10'),_0x2218ba,_[_0x6155('0x11')](_0x18421f,_0x6155('0x12'))[_0x6155('0x13')](',\x20'));_0x4213ab[_0x6155('0x14')]();}else{try{var _0x16a651=eval('('+_0x28c6f7[_0x6155('0x15')]+')');var _0x31aab1=_0x16a651?_0x28c6f7['priorityTrue']:_0x28c6f7['priorityFalse'];logger[_0x6155('0x16')](_0x6155('0x17'),_0x2218ba,_0x28c6f7[_0x6155('0x15')],_0x16a651,_0x31aab1||_0x6155('0x18'));if(_0x31aab1){var _0x49562d=_[_0x6155('0x19')](_0x4213ab[_0x6155('0x1a')](),{'p':_0x31aab1});if(_0x49562d>=0x0){logger[_0x6155('0x16')](_0x6155('0x1b'),_0x2218ba,_0x31aab1||_0x6155('0x18'),_0x49562d);_0x4213ab['next'](_0x49562d);}else{logger['info'](_0x6155('0x1c'),_0x2218ba,_0x31aab1||_0x6155('0x18'));_0x4213ab[_0x6155('0x14')]();}}else{_0x4213ab[_0x6155('0x18')]();}}catch(_0x3c8ede){logger[_0x6155('0xf')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2218ba,_0x3c8ede[_0x6155('0x12')]);_0x4213ab['stop']();}}}catch(_0xc46ddb){logger[_0x6155('0xf')]('[%s][GOTOIF]\x20%s',_0x2218ba,JSON[_0x6155('0x1d')](_0xc46ddb));_0x4213ab['stop']();}};}; \ 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 887da80..616166c 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 _0xbeb8=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','join','stop'];(function(_0x27c61e,_0x44334c){var _0x3f0f22=function(_0x363562){while(--_0x363562){_0x27c61e['push'](_0x27c61e['shift']());}};_0x3f0f22(++_0x44334c);}(_0xbeb8,0x15c));var _0x8beb=function(_0x29ee2c,_0x57dcb0){_0x29ee2c=_0x29ee2c-0x0;var _0x212068=_0xbeb8[_0x29ee2c];return _0x212068;};'use strict';var schema=require(_0x8beb('0x0'));var _=require('lodash');var logger=require(_0x8beb('0x1'))(_0x8beb('0x2'));var gotop=schema({'priority':{'type':_0x8beb('0x3'),'required':!![],'message':_0x8beb('0x4')}});exports[_0x8beb('0x5')]=function(_0x17f21b,_0x5473a0){return function(_0x4a2ba8){try{var _0x571f2e={'priority':_0x5473a0[0x0]};var _0x5e574d=gotop['validate'](_0x571f2e,{'typecast':!![]});if(_0x5e574d[_0x8beb('0x6')]){logger[_0x8beb('0x7')](_0x8beb('0x8'),_0x17f21b,_[_0x8beb('0x9')](_0x5e574d,'message')[_0x8beb('0xa')](',\x20'));_0x4a2ba8[_0x8beb('0xb')]();}else{logger[_0x8beb('0xc')](_0x8beb('0xd'),_0x17f21b,_0x571f2e['priority']);if(_0x571f2e[_0x8beb('0xe')]){var _0x25a360=_[_0x8beb('0xf')](_0x4a2ba8['rules'](),{'p':_0x571f2e['priority']});if(_0x25a360>=0x0){logger['info'](_0x8beb('0x10'),_0x17f21b,_0x571f2e[_0x8beb('0xe')]||_0x8beb('0x11'),_0x25a360);_0x4a2ba8['next'](_0x25a360);}else{logger[_0x8beb('0xc')](_0x8beb('0x12'),_0x17f21b,_0x571f2e[_0x8beb('0xe')]||'next');_0x4a2ba8[_0x8beb('0xb')]();}}else{_0x4a2ba8[_0x8beb('0x11')]();}}}catch(_0x4456e0){logger[_0x8beb('0x7')](_0x8beb('0x8'),_0x17f21b,JSON[_0x8beb('0x13')](_0x4456e0));_0x4a2ba8[_0x8beb('0xb')]();}};}; \ No newline at end of file +var _0x2cb5=['message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x2cb5,0x1eb));var _0x52cb=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x2cb5[_0x11155f];return _0xd07e48;};'use strict';var schema=require(_0x52cb('0x0'));var _=require(_0x52cb('0x1'));var logger=require(_0x52cb('0x2'))('routing');var gotop=schema({'priority':{'type':_0x52cb('0x3'),'required':!![],'message':_0x52cb('0x4')}});exports[_0x52cb('0x5')]=function(_0x3219a5,_0x1199d3){return function(_0x2be2f7){try{var _0x3a6d34={'priority':_0x1199d3[0x0]};var _0x3f6073=gotop[_0x52cb('0x0')](_0x3a6d34,{'typecast':!![]});if(_0x3f6073[_0x52cb('0x6')]){logger[_0x52cb('0x7')]('[%s][GOTOP]\x20%s',_0x3219a5,_[_0x52cb('0x8')](_0x3f6073,_0x52cb('0x9'))['join'](',\x20'));_0x2be2f7[_0x52cb('0xa')]();}else{logger[_0x52cb('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x3219a5,_0x3a6d34[_0x52cb('0xc')]);if(_0x3a6d34['priority']){var _0x519d40=_[_0x52cb('0xd')](_0x2be2f7[_0x52cb('0xe')](),{'p':_0x3a6d34[_0x52cb('0xc')]});if(_0x519d40>=0x0){logger['info'](_0x52cb('0xf'),_0x3219a5,_0x3a6d34['priority']||_0x52cb('0x10'),_0x519d40);_0x2be2f7['next'](_0x519d40);}else{logger['info'](_0x52cb('0x11'),_0x3219a5,_0x3a6d34[_0x52cb('0xc')]||_0x52cb('0x10'));_0x2be2f7[_0x52cb('0xa')]();}}else{_0x2be2f7[_0x52cb('0x10')]();}}}catch(_0x267820){logger[_0x52cb('0x7')](_0x52cb('0x12'),_0x3219a5,JSON[_0x52cb('0x13')](_0x267820));_0x2be2f7['stop']();}};}; \ 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 b0a210a..7b17dc5 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 _0x2547=['upperFirst','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','AccountId','account'];(function(_0x2f8bc5,_0x12e3d1){var _0x2e4207=function(_0x217405){while(--_0x217405){_0x2f8bc5['push'](_0x2f8bc5['shift']());}};_0x2e4207(++_0x12e3d1);}(_0x2547,0x1cd));var _0x7254=function(_0x451006,_0x329488){_0x451006=_0x451006-0x0;var _0x27f2b6=_0x2547[_0x451006];return _0x27f2b6;};'use strict';var _=require('lodash');var utils=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var rpc={'chatMessage':require(_0x7254('0x3')),'openchannelMessage':require(_0x7254('0x4')),'mailMessage':require(_0x7254('0x5')),'smsMessage':require(_0x7254('0x6')),'faxMessage':require(_0x7254('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7254('0x8')]=function(_0x59705f,_0x67f427){return function(_0x119f66){try{var _0x4b845f={'body':utils[_0x7254('0x9')](_0x67f427[0x0],this),'ContactId':this[_0x7254('0xa')]['id']};if(this[_0x7254('0xb')]==='chat'){_0x4b845f[_0x7254('0xc')]=this['account']['id'];}else{_0x4b845f[_['upperFirst'](this['channel'])+_0x7254('0xd')]=this[_0x7254('0xe')]['id'];}_0x4b845f[_[_0x7254('0xf')](this[_0x7254('0xb')])+_0x7254('0x10')]=this[_0x7254('0x11')]['id'];if(rpc[this['channel']+_0x7254('0x12')]){return rpc[this['channel']+_0x7254('0x12')]['create'](_0x4b845f)[_0x7254('0x13')](function(_0x2bfff8){logger[_0x7254('0x14')](_0x7254('0x15'),_0x59705f,_0x4b845f[_0x7254('0x16')]);_0x119f66[_0x7254('0x17')]();})[_0x7254('0x18')](function(_0x21cecc){logger[_0x7254('0x19')](_0x7254('0x15'),_0x59705f,JSON[_0x7254('0x1a')](_0x21cecc));_0x119f66[_0x7254('0x1b')]();});}}catch(_0x163c8c){logger['error'](_0x7254('0x15'),_0x59705f,JSON[_0x7254('0x1a')](_0x163c8c));_0x119f66[_0x7254('0x1b')]();}};}; \ No newline at end of file +var _0xe54c=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','info','body','next','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe54c,0x79));var _0xce54=function(_0x1ad659,_0x1ab26a){_0x1ad659=_0x1ad659-0x0;var _0x56d7e2=_0xe54c[_0x1ad659];return _0x56d7e2;};'use strict';var _=require(_0xce54('0x0'));var utils=require(_0xce54('0x1'));var logger=require(_0xce54('0x2'))(_0xce54('0x3'));var rpc={'chatMessage':require(_0xce54('0x4')),'openchannelMessage':require(_0xce54('0x5')),'mailMessage':require(_0xce54('0x6')),'smsMessage':require(_0xce54('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xce54('0x8'))};exports['consequence']=function(_0x3f58ce,_0x2f47e9){return function(_0x48e7bb){try{var _0x50941={'body':utils['getMustacheRender'](_0x2f47e9[0x0],this),'ContactId':this[_0xce54('0x9')]['id']};if(this[_0xce54('0xa')]==='chat'){_0x50941[_0xce54('0xb')]=this[_0xce54('0xc')]['id'];}else{_0x50941[_[_0xce54('0xd')](this[_0xce54('0xa')])+_0xce54('0xe')]=this[_0xce54('0xc')]['id'];}_0x50941[_[_0xce54('0xd')](this[_0xce54('0xa')])+_0xce54('0xf')]=this[_0xce54('0x10')]['id'];if(rpc[this[_0xce54('0xa')]+_0xce54('0x11')]){return rpc[this[_0xce54('0xa')]+_0xce54('0x11')]['create'](_0x50941)['then'](function(_0x5a0562){logger[_0xce54('0x12')]('[%s][MESSAGE]\x20%s',_0x3f58ce,_0x50941[_0xce54('0x13')]);_0x48e7bb[_0xce54('0x14')]();})['catch'](function(_0x586520){logger[_0xce54('0x15')](_0xce54('0x16'),_0x3f58ce,JSON[_0xce54('0x17')](_0x586520));_0x48e7bb[_0xce54('0x18')]();});}}catch(_0x3c8569){logger['error']('[%s][MESSAGE]\x20%s',_0x3f58ce,JSON[_0xce54('0x17')](_0x3c8569));_0x48e7bb[_0xce54('0x18')]();}};}; \ 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 b9675b1..7169281 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 _0xde52=['getMustacheRender','./utils','../../../../config/logger','routing','[%s][NOOP]\x20%s'];(function(_0x1e006d,_0x2f2065){var _0x301712=function(_0x48e408){while(--_0x48e408){_0x1e006d['push'](_0x1e006d['shift']());}};_0x301712(++_0x2f2065);}(_0xde52,0xa6));var _0x2de5=function(_0x175756,_0x4450bc){_0x175756=_0x175756-0x0;var _0x3be0a6=_0xde52[_0x175756];return _0x3be0a6;};'use strict';var utils=require(_0x2de5('0x0'));var logger=require(_0x2de5('0x1'))(_0x2de5('0x2'));exports['consequence']=function(_0x2547b4,_0x1d1d3e){return function(_0x290d02){try{logger['info'](_0x2de5('0x3'),_0x2547b4,utils[_0x2de5('0x4')](_0x1d1d3e[0x0],this));_0x290d02['next']();}catch(_0x4c6711){logger['error'](_0x2de5('0x3'),_0x2547b4,JSON['stringify'](_0x4c6711));_0x290d02['stop']();}};}; \ No newline at end of file +var _0x1737=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stop'];(function(_0x258224,_0x35aa4b){var _0x38e526=function(_0x123faf){while(--_0x123faf){_0x258224['push'](_0x258224['shift']());}};_0x38e526(++_0x35aa4b);}(_0x1737,0x6c));var _0x7173=function(_0x38353e,_0x346e2e){_0x38353e=_0x38353e-0x0;var _0x13672c=_0x1737[_0x38353e];return _0x13672c;};'use strict';var utils=require(_0x7173('0x0'));var logger=require(_0x7173('0x1'))(_0x7173('0x2'));exports[_0x7173('0x3')]=function(_0x1deb0c,_0x4e1d16){return function(_0x60b072){try{logger[_0x7173('0x4')](_0x7173('0x5'),_0x1deb0c,utils[_0x7173('0x6')](_0x4e1d16[0x0],this));_0x60b072['next']();}catch(_0xe996f){logger[_0x7173('0x7')]('[%s][NOOP]\x20%s',_0x1deb0c,JSON['stringify'](_0xe996f));_0x60b072[_0x7173('0x8')]();}};}; \ 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 6f41c57..b29f735 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 _0x6db8=['queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','body','update','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','redis','defaults','localhost','queue_id','account'];(function(_0x1aeb39,_0x2e8404){var _0x439790=function(_0x199911){while(--_0x199911){_0x1aeb39['push'](_0x1aeb39['shift']());}};_0x439790(++_0x2e8404);}(_0x6db8,0x1d3));var _0x86db=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x6db8[_0x489b87];return _0x1823b6;};'use strict';var schema=require(_0x86db('0x0'));var _=require(_0x86db('0x1'));var util=require(_0x86db('0x2'));var seqqueue=require(_0x86db('0x3'));var moment=require(_0x86db('0x4'));var Redis=require(_0x86db('0x5'));var config=require(_0x86db('0x6'));var logger=require('../../../../config/logger')(_0x86db('0x7'));var strategy=require('./strategy');config[_0x86db('0x8')]=_[_0x86db('0x9')](config[_0x86db('0x8')],{'host':_0x86db('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x86db('0xb'),_0x86db('0xc'),_0x86db('0xd'),_0x86db('0xe'),_0x86db('0xf')];function emit(_0x25bfa,_0x21a5aa,_0x580734){io['to'](_0x25bfa)[_0x86db('0x10')](_0x21a5aa,_0x580734);}function emitChannelQueueInteraction(_0x24b483,_0x2ee896,_0x7c45c3,_0x5c4d55,_0x20d0bf,_0x1af72c,_0x46a23a,_0x19b564){var _0x5a61cb=_[_0x86db('0x11')](_0x7c45c3);_0x5a61cb[_0x86db('0xb')]=_0x19b564;_0x5a61cb['queue']=_0x2ee896;_0x5a61cb[_0x86db('0xc')]=_0x5c4d55;_0x5a61cb['id']=_0x20d0bf;if(_0x1af72c){_0x46a23a[util['format'](_0x86db('0x12'),_0x24b483)][_0x20d0bf]=_[_0x86db('0x13')](_0x5a61cb,attributes);}else{delete _0x46a23a[util[_0x86db('0x14')](_0x86db('0x12'),_0x24b483)][_0x20d0bf];}emit(util[_0x86db('0x14')]('%s:queue:%s',_0x24b483,_0x2ee896),util[_0x86db('0x14')](_0x86db('0x15'),_0x24b483,_0x1af72c?_0x86db('0x16'):_0x86db('0x17')),_[_0x86db('0x13')](_0x5a61cb,attributes));}var rpc={'openchannelQueueReport':require(_0x86db('0x18')),'mailQueueReport':require(_0x86db('0x19')),'chatQueueReport':require(_0x86db('0x1a')),'smsQueueReport':require(_0x86db('0x1b')),'faxQueueReport':require(_0x86db('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x86db('0x1d'),'message':_0x86db('0x1e')}});function startRouting(_0x558e61,_0xd2dd88,_0x417889,_0x281982){if(_0x558e61&&_0xd2dd88&&_0x417889){_0xd2dd88[_0x86db('0x1f')]+=0x1;var _0x2dcee8={'uniqueid':_0x558e61,'from':_0x417889['body']?_0x417889['body'][_0x86db('0xe')]:'','joinAt':moment()[_0x86db('0x14')](_0x86db('0x20')),'ContactId':_0x417889[_0x86db('0x21')]?_0x417889[_0x86db('0x21')]['id']:null,'ListId':_0x417889['list']?_0x417889[_0x86db('0x22')]['id']:null};_0x2dcee8[_[_0x86db('0x23')](_0x417889[_0x86db('0x24')])+_0x86db('0x25')]=_0xd2dd88['id']||null;_0x2dcee8[_['upperFirst'](_0x417889['channel'])+_0x86db('0x26')]=_0x417889[_0x86db('0x27')]?_0x417889[_0x86db('0x27')]['id']:null;_0x2dcee8[_[_0x86db('0x23')](_0x417889[_0x86db('0x24')])+_0x86db('0x28')]=_0x417889[_0x86db('0x29')]?_0x417889['message']['id']:null;_0x2dcee8[_[_0x86db('0x23')](_0x417889[_0x86db('0x24')])+(_0x417889[_0x86db('0x24')]!==_0x86db('0x2a')?'AccountId':_0x86db('0x2b'))]=_0x417889['account']?_0x417889['account']['id']:null;logger['info'](util[_0x86db('0x14')](_0x86db('0x2c'),_0x558e61,_0xd2dd88[_0x86db('0x2d')]));emitChannelQueueInteraction(_0x417889[_0x86db('0x24')],_0xd2dd88[_0x86db('0x2d')],_0x2dcee8,_0x417889[_0x86db('0xc')][_0x86db('0x2d')],_0x417889[_0x86db('0x29')]['id'],!![],_0x281982,_0xd2dd88['id']);if(rpc[_0x417889[_0x86db('0x24')]+_0x86db('0x2e')]){return rpc[_0x417889[_0x86db('0x24')]+'QueueReport'][_0x86db('0x2f')](_0x2dcee8)[_0x86db('0x30')](function(_0x3b7424){logger[_0x86db('0x31')](_0x86db('0x32'));});}}}function stopRouting(_0x46c45d,_0x8e0333,_0x2545b2,_0x53b4d8){if(_0x46c45d&&_0x8e0333){_0x8e0333[_0x86db('0x1f')]-=0x1;var _0x27b66f={'leaveAt':moment()[_0x86db('0x14')](_0x86db('0x20')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x86db('0x33')};logger[_0x86db('0x34')](util[_0x86db('0x14')](_0x86db('0x35'),_0x46c45d,_0x8e0333[_0x86db('0x2d')]));emitChannelQueueInteraction(_0x2545b2['channel'],_0x8e0333[_0x86db('0x2d')],_0x2545b2[_0x86db('0x36')],_0x2545b2[_0x86db('0xc')]['name'],_0x2545b2['message']['id'],![],_0x53b4d8,_0x8e0333['id']);if(rpc[_0x2545b2[_0x86db('0x24')]+_0x86db('0x2e')]){return rpc[_0x2545b2[_0x86db('0x24')]+_0x86db('0x2e')][_0x86db('0x37')](_0x46c45d,_0x27b66f)[_0x86db('0x30')](function(_0xe7e6e2){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x5e8b00,_0x109baf,_0x5d182c,_0x2270a4){if(_0x5e8b00&&_0x109baf){_0x109baf['waiting']-=0x1;var _0x3ffa46={'leaveAt':moment()[_0x86db('0x14')](_0x86db('0x20')),'exitAt':moment()[_0x86db('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x86db('0x34')](util[_0x86db('0x14')](_0x86db('0x38'),_0x5e8b00,_0x109baf['name']));emitChannelQueueInteraction(_0x5d182c['channel'],_0x109baf[_0x86db('0x2d')],_0x5d182c[_0x86db('0x36')],_0x5d182c[_0x86db('0xc')]['name'],_0x5d182c[_0x86db('0x29')]['id'],![],_0x2270a4);if(rpc[_0x5d182c[_0x86db('0x24')]+_0x86db('0x2e')]){return rpc[_0x5d182c[_0x86db('0x24')]+_0x86db('0x2e')][_0x86db('0x37')](_0x5e8b00,_0x3ffa46)['catch'](function(_0x15b43f){logger[_0x86db('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x3c1000){return function(_0x5084c0){return _0x5084c0[_0x86db('0x2d')][_0x86db('0x39')]()===_0x3c1000['toLowerCase']();};}exports[_0x86db('0x3a')]=function(_0x7c5f19,_0x158e54,_0x2d95d6,_0x56d943){return function(_0x5654d5){try{var _0x268cb9={'name':_0x158e54[0x0],'timeout':_0x158e54[0x1]};var _0x411f16=queue[_0x86db('0x0')](_0x268cb9,{'typecast':!![]});if(_0x411f16[_0x86db('0x3b')]){logger[_0x86db('0x31')](_0x86db('0x3c'),_0x7c5f19,_[_0x86db('0x3d')](_0x411f16,_0x86db('0x29'))['join'](',\x20'));_0x5654d5[_0x86db('0x3e')]();}else{var _0x46c98b=_[_0x86db('0x3f')](_0x2d95d6[_0x56d943['channel']+_0x86db('0x40')],handleFindQueue(_0x268cb9[_0x86db('0x2d')]));if(_0x46c98b){startRouting(_0x7c5f19,_0x46c98b,_0x56d943,_0x2d95d6);var _0x559b28=(_0x46c98b['timeout']||0xa)*0x3e8;var _0x2dcb34=(_0x268cb9[_0x86db('0x41')]||0x14)*0x3e8;var _0x296260,_0x2d38db;if(_0x559b28>_0x2dcb34){_0x2dcb34=_0x559b28;}var _0x2cbe82=seqqueue[_0x86db('0x42')](_0x559b28);_0x2cbe82['id']=_0x7c5f19;_0x2cbe82[_0x86db('0x43')]=_0x559b28;_0x2cbe82[_0x86db('0x44')]=_0x2dcb34;_0x2cbe82[_0x86db('0x24')]=_0x56d943[_0x86db('0x24')];_0x2d95d6['rules'][_0x7c5f19]['on'](_0x86db('0x45'),function(){logger['info'](_0x86db('0x46'),_0x7c5f19);stopRouting(_0x7c5f19,_0x46c98b,_0x56d943,_0x2d95d6);clearTimeout(_0x296260);_0x296260=undefined;_0x2cbe82[_0x86db('0x47')](!![]);if(_0x2d95d6[_0x86db('0x48')][_0x7c5f19]){delete _0x2d95d6[_0x86db('0x48')][_0x7c5f19];}_0x5654d5['stop']();});_0x2d95d6[_0x86db('0x48')][_0x7c5f19]['on'](_0x86db('0x49'),function(){if(_0x2d95d6[_0x86db('0x48')][_0x7c5f19]){delete _0x2d95d6[_0x86db('0x48')][_0x7c5f19];}});_0x296260=setTimeout(function(){logger[_0x86db('0x34')](_0x86db('0x4a'),_0x7c5f19);endRouting(_0x7c5f19,_0x46c98b,_0x56d943,_0x2d95d6);clearTimeout(_0x296260);_0x2cbe82[_0x86db('0x47')](!![]);_0x5654d5[_0x86db('0x4b')]();},_0x2dcb34);switch(_0x46c98b[_0x86db('0x4c')]){case _0x86db('0x4d'):strategy[_0x86db('0x4d')](_0x2cbe82,_0x46c98b,_0x2d95d6,_0x56d943);break;default:strategy[_0x86db('0x4e')](_0x2cbe82,_0x46c98b,_0x2d95d6,_0x56d943);}}else{logger[_0x86db('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x7c5f19,_0x268cb9['name']);_0x5654d5[_0x86db('0x3e')]();}}}catch(_0x21624a){console['log'](_0x21624a);logger[_0x86db('0x31')](_0x86db('0x3c'),_0x7c5f19,_0x21624a[_0x86db('0x4f')]);_0x5654d5[_0x86db('0x3e')]();}};}; \ No newline at end of file +var _0xd178=['waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','stop','Queues','createQueue','atimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','account','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','from','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','info','name','QueueReport','error','create\x20queue\x20report'];(function(_0x20f7c9,_0x58f651){var _0x202944=function(_0x5507d3){while(--_0x5507d3){_0x20f7c9['push'](_0x20f7c9['shift']());}};_0x202944(++_0x58f651);}(_0xd178,0xb5));var _0x8d17=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd178[_0x3635ce];return _0x97ecd0;};'use strict';var schema=require('validate');var _=require(_0x8d17('0x0'));var util=require(_0x8d17('0x1'));var seqqueue=require(_0x8d17('0x2'));var moment=require(_0x8d17('0x3'));var Redis=require(_0x8d17('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8d17('0x5'))(_0x8d17('0x6'));var strategy=require('./strategy');config['redis']=_[_0x8d17('0x7')](config[_0x8d17('0x8')],{'host':_0x8d17('0x9'),'port':0x18eb});var io=require(_0x8d17('0xa'))(new Redis(config[_0x8d17('0x8')]));var attributes=['id','queue_id',_0x8d17('0xb'),'queue','from',_0x8d17('0xc')];function emit(_0x547c2f,_0x27fe21,_0x4fdefb){io['to'](_0x547c2f)[_0x8d17('0xd')](_0x27fe21,_0x4fdefb);}function emitChannelQueueInteraction(_0x45c3e8,_0x50d47e,_0x5c37da,_0x4b4d61,_0x4f1d8e,_0x440147,_0x5448cd,_0x489a9c){var _0x15208e=_[_0x8d17('0xe')](_0x5c37da);_0x15208e['queue_id']=_0x489a9c;_0x15208e[_0x8d17('0xf')]=_0x50d47e;_0x15208e[_0x8d17('0xb')]=_0x4b4d61;_0x15208e['id']=_0x4f1d8e;if(_0x440147){_0x5448cd[util[_0x8d17('0x10')](_0x8d17('0x11'),_0x45c3e8)][_0x4f1d8e]=_[_0x8d17('0x12')](_0x15208e,attributes);}else{delete _0x5448cd[util['format'](_0x8d17('0x11'),_0x45c3e8)][_0x4f1d8e];}emit(util[_0x8d17('0x10')]('%s:queue:%s',_0x45c3e8,_0x50d47e),util[_0x8d17('0x10')](_0x8d17('0x13'),_0x45c3e8,_0x440147?_0x8d17('0x14'):'remove'),_[_0x8d17('0x12')](_0x15208e,attributes));}var rpc={'openchannelQueueReport':require(_0x8d17('0x15')),'mailQueueReport':require(_0x8d17('0x16')),'chatQueueReport':require(_0x8d17('0x17')),'smsQueueReport':require(_0x8d17('0x18')),'faxQueueReport':require(_0x8d17('0x19')),'whatsappQueueReport':require(_0x8d17('0x1a'))};var queue=schema({'name':{'type':_0x8d17('0x1b'),'required':!![],'message':_0x8d17('0x1c')},'timeout':{'type':'number','message':_0x8d17('0x1d')}});function startRouting(_0x144b4c,_0x28307c,_0x913918,_0x4fdfd1){if(_0x144b4c&&_0x28307c&&_0x913918){_0x28307c['waiting']+=0x1;var _0x585bb0={'uniqueid':_0x144b4c,'from':_0x913918[_0x8d17('0x1e')]?_0x913918[_0x8d17('0x1e')][_0x8d17('0x1f')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x913918[_0x8d17('0x20')]?_0x913918['contact']['id']:null,'ListId':_0x913918['list']?_0x913918[_0x8d17('0x21')]['id']:null};_0x585bb0[_['upperFirst'](_0x913918[_0x8d17('0x22')])+_0x8d17('0x23')]=_0x28307c['id']||null;_0x585bb0[_[_0x8d17('0x24')](_0x913918[_0x8d17('0x22')])+_0x8d17('0x25')]=_0x913918[_0x8d17('0x26')]?_0x913918[_0x8d17('0x26')]['id']:null;_0x585bb0[_[_0x8d17('0x24')](_0x913918[_0x8d17('0x22')])+'MessageId']=_0x913918[_0x8d17('0x27')]?_0x913918[_0x8d17('0x27')]['id']:null;_0x585bb0[_[_0x8d17('0x24')](_0x913918['channel'])+(_0x913918[_0x8d17('0x22')]!==_0x8d17('0x28')?_0x8d17('0x29'):'WebsiteId')]=_0x913918[_0x8d17('0xb')]?_0x913918[_0x8d17('0xb')]['id']:null;logger[_0x8d17('0x2a')](util[_0x8d17('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x144b4c,_0x28307c[_0x8d17('0x2b')]));emitChannelQueueInteraction(_0x913918[_0x8d17('0x22')],_0x28307c[_0x8d17('0x2b')],_0x585bb0,_0x913918['account'][_0x8d17('0x2b')],_0x913918[_0x8d17('0x27')]['id'],!![],_0x4fdfd1,_0x28307c['id']);if(rpc[_0x913918[_0x8d17('0x22')]+_0x8d17('0x2c')]){return rpc[_0x913918[_0x8d17('0x22')]+_0x8d17('0x2c')]['create'](_0x585bb0)['catch'](function(_0x15beae){logger[_0x8d17('0x2d')](_0x8d17('0x2e'));});}}}function stopRouting(_0x17d4a4,_0x447091,_0xf06641,_0x4af9ca){if(_0x17d4a4&&_0x447091){_0x447091[_0x8d17('0x2f')]-=0x1;var _0x4f494d={'leaveAt':moment()['format'](_0x8d17('0x30')),'acceptAt':moment()[_0x8d17('0x10')](_0x8d17('0x30')),'reason':_0x8d17('0x31')};logger[_0x8d17('0x2a')](util[_0x8d17('0x10')](_0x8d17('0x32'),_0x17d4a4,_0x447091[_0x8d17('0x2b')]));emitChannelQueueInteraction(_0xf06641[_0x8d17('0x22')],_0x447091[_0x8d17('0x2b')],_0xf06641[_0x8d17('0x1e')],_0xf06641['account']['name'],_0xf06641[_0x8d17('0x27')]['id'],![],_0x4af9ca,_0x447091['id']);if(rpc[_0xf06641[_0x8d17('0x22')]+_0x8d17('0x2c')]){return rpc[_0xf06641[_0x8d17('0x22')]+'QueueReport']['update'](_0x17d4a4,_0x4f494d)[_0x8d17('0x33')](function(_0x3dafa5){logger[_0x8d17('0x2d')](_0x8d17('0x34'));});}}}function endRouting(_0x449f9e,_0x433bd5,_0x4d3582,_0x776610){if(_0x449f9e&&_0x433bd5){_0x433bd5[_0x8d17('0x2f')]-=0x1;var _0x340903={'leaveAt':moment()[_0x8d17('0x10')](_0x8d17('0x30')),'exitAt':moment()[_0x8d17('0x10')](_0x8d17('0x30')),'reason':_0x8d17('0x35')};logger[_0x8d17('0x2a')](util['format'](_0x8d17('0x36'),_0x449f9e,_0x433bd5[_0x8d17('0x2b')]));emitChannelQueueInteraction(_0x4d3582[_0x8d17('0x22')],_0x433bd5[_0x8d17('0x2b')],_0x4d3582['body'],_0x4d3582[_0x8d17('0xb')][_0x8d17('0x2b')],_0x4d3582[_0x8d17('0x27')]['id'],![],_0x776610);if(rpc[_0x4d3582[_0x8d17('0x22')]+_0x8d17('0x2c')]){return rpc[_0x4d3582[_0x8d17('0x22')]+_0x8d17('0x2c')][_0x8d17('0x37')](_0x449f9e,_0x340903)['catch'](function(_0x248a5b){logger[_0x8d17('0x2d')](_0x8d17('0x34'));});}}}function handleFindQueue(_0x223824){return function(_0x2397f7){return _0x2397f7[_0x8d17('0x2b')]['toLowerCase']()===_0x223824[_0x8d17('0x38')]();};}exports[_0x8d17('0x39')]=function(_0xecf818,_0x1dec21,_0x21cc62,_0x69cee6){return function(_0x570aa0){try{var _0x136cec={'name':_0x1dec21[0x0],'timeout':_0x1dec21[0x1]};var _0x163826=queue[_0x8d17('0x3a')](_0x136cec,{'typecast':!![]});if(_0x163826[_0x8d17('0x3b')]){logger['error'](_0x8d17('0x3c'),_0xecf818,_['map'](_0x163826,_0x8d17('0x27'))[_0x8d17('0x3d')](',\x20'));_0x570aa0[_0x8d17('0x3e')]();}else{var _0x314dea=_['find'](_0x21cc62[_0x69cee6[_0x8d17('0x22')]+_0x8d17('0x3f')],handleFindQueue(_0x136cec[_0x8d17('0x2b')]));if(_0x314dea){startRouting(_0xecf818,_0x314dea,_0x69cee6,_0x21cc62);var _0x7292de=(_0x314dea[_0x8d17('0x35')]||0xa)*0x3e8;var _0x3f6c4d=(_0x136cec[_0x8d17('0x35')]||0x14)*0x3e8;var _0x3c6878,_0xda7800;if(_0x7292de>_0x3f6c4d){_0x3f6c4d=_0x7292de;}var _0xab85ce=seqqueue[_0x8d17('0x40')](_0x7292de);_0xab85ce['id']=_0xecf818;_0xab85ce[_0x8d17('0x41')]=_0x7292de;_0xab85ce['qtimeout']=_0x3f6c4d;_0xab85ce[_0x8d17('0x22')]=_0x69cee6[_0x8d17('0x22')];_0x21cc62['rules'][_0xecf818]['on']('end',function(){logger[_0x8d17('0x2a')](_0x8d17('0x42'),_0xecf818);stopRouting(_0xecf818,_0x314dea,_0x69cee6,_0x21cc62);clearTimeout(_0x3c6878);_0x3c6878=undefined;_0xab85ce['close'](!![]);if(_0x21cc62[_0x8d17('0x43')][_0xecf818]){delete _0x21cc62[_0x8d17('0x43')][_0xecf818];}_0x570aa0['stop']();});_0x21cc62['rules'][_0xecf818]['on'](_0x8d17('0x44'),function(){if(_0x21cc62[_0x8d17('0x43')][_0xecf818]){delete _0x21cc62[_0x8d17('0x43')][_0xecf818];}});_0x3c6878=setTimeout(function(){logger[_0x8d17('0x2a')](_0x8d17('0x45'),_0xecf818);endRouting(_0xecf818,_0x314dea,_0x69cee6,_0x21cc62);clearTimeout(_0x3c6878);_0xab85ce[_0x8d17('0x46')](!![]);_0x570aa0[_0x8d17('0x47')]();},_0x3f6c4d);switch(_0x314dea['strategy']){case'rrmemory':strategy[_0x8d17('0x48')](_0xab85ce,_0x314dea,_0x21cc62,_0x69cee6);break;default:strategy[_0x8d17('0x49')](_0xab85ce,_0x314dea,_0x21cc62,_0x69cee6);}}else{logger[_0x8d17('0x2d')](_0x8d17('0x4a'),_0xecf818,_0x136cec[_0x8d17('0x2b')]);_0x570aa0[_0x8d17('0x3e')]();}}}catch(_0x42ed98){console['log'](_0x42ed98);logger[_0x8d17('0x2d')](_0x8d17('0x3c'),_0xecf818,_0x42ed98[_0x8d17('0x4b')]);_0x570aa0[_0x8d17('0x3e')]();}};}; \ 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 020f70f..bbd47a6 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 _0x19a0=['isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available'];(function(_0xa41df9,_0x20fed0){var _0x342a45=function(_0x5832c5){while(--_0x5832c5){_0xa41df9['push'](_0xa41df9['shift']());}};_0x342a45(++_0x20fed0);}(_0x19a0,0x17b));var _0x019a=function(_0x4a9e7f,_0x5e6ab0){_0x4a9e7f=_0x4a9e7f-0x0;var _0x4e8543=_0x19a0[_0x4a9e7f];return _0x4e8543;};'use strict';var _=require(_0x019a('0x0'));var uuid=require(_0x019a('0x1'));var util=require(_0x019a('0x2'));var logger=require(_0x019a('0x3'))(_0x019a('0x4'));var Agent=function(_0x17142d,_0x22e7f5,_0x35750f,_0x560b41){this[_0x019a('0x5')]=uuid['v4']();this[_0x019a('0x6')]=_0x17142d;this[_0x019a('0x7')]=_0x22e7f5;this['realtime']=_0x35750f;this['routing']=_0x560b41;this[_0x019a('0x6')][_0x019a('0x8')](this['handleRun'][_0x019a('0x9')](this),this[_0x019a('0xa')]['bind'](this));this[_0x019a('0x6')]['on'](_0x019a('0xb'),this['handleTimeout'][_0x019a('0x9')](this));this[_0x019a('0x6')]['on'](_0x019a('0xc'),this[_0x019a('0xd')][_0x019a('0x9')](this));};Agent['prototype'][_0x019a('0x8')]=function(){this[_0x019a('0x6')][_0x019a('0x8')](this[_0x019a('0xe')][_0x019a('0x9')](this),this[_0x019a('0xa')][_0x019a('0x9')](this));};Agent[_0x019a('0xf')][_0x019a('0xd')]=function(){this[_0x019a('0xa')](!![]);};Agent['prototype'][_0x019a('0xe')]=function(_0x29336d){logger[_0x019a('0x10')](_0x019a('0x11'),this['squeue']['id'],this[_0x019a('0x7')]['id']);if(_['isNil'](this[_0x019a('0x12')]['agents'][this[_0x019a('0x7')]['id']])){logger[_0x019a('0x10')](_0x019a('0x13'),this[_0x019a('0x6')]['id'],this[_0x019a('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0x019a('0x14')]||util['isAgentAvailable'](this[_0x019a('0x6')]['id'],this['realtime'][_0x019a('0x15')][this[_0x019a('0x7')]['id']],this[_0x019a('0x6')][_0x019a('0x16')],![])){this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']][_0x019a('0x17')]=!![];this[_0x019a('0x12')]['agents'][this[_0x019a('0x7')]['id']][_0x019a('0x18')]=undefined;util[_0x019a('0x19')](this[_0x019a('0x5')],this[_0x019a('0x6')]['id'],this['realtime'][_0x019a('0x15')][this[_0x019a('0x7')]['id']],null,this[_0x019a('0x4')]);util[_0x019a('0x1a')](this[_0x019a('0x6')]['id'],this[_0x019a('0x12')][_0x019a('0x15')][this['agent']['id']],_0x019a('0x1b')+(this[_0x019a('0x4')]['forcedOwnership']?':FORCED':''));}else{logger[_0x019a('0x10')](_0x019a('0x1c'),this[_0x019a('0x6')]['id'],this[_0x019a('0x7')]['id']);setTimeout(this[_0x019a('0x8')][_0x019a('0x9')](this),0x3e8);}}};Agent['prototype'][_0x019a('0xa')]=function(_0x298d45){if(_[_0x019a('0x1d')](this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']])){return logger[_0x019a('0x10')](_0x019a('0x13'),this[_0x019a('0x6')]['id'],this[_0x019a('0x7')]['id']);}else{logger[_0x019a('0x10')](_0x019a('0x1e'),this[_0x019a('0x6')]['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x019a('0x6')]['id'],this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']],null,this[_0x019a('0x4')]);this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']][_0x019a('0x17')]=![];this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']][_0x019a('0x18')]=undefined;util[_0x019a('0x1a')](this['squeue']['id'],this[_0x019a('0x12')][_0x019a('0x15')][this[_0x019a('0x7')]['id']],_0x298d45?_0x019a('0x1f'):_0x019a('0x20'));}if(!_0x298d45){setTimeout(this[_0x019a('0x8')][_0x019a('0x9')](this),0x3e8);}};function agent(_0x271047,_0x5bb0fa,_0x2ed4a0,_0x367531){return new Agent(_0x271047,_0x5bb0fa,_0x2ed4a0,_0x367531);}module[_0x019a('0x21')]=agent; \ No newline at end of file +var _0xf4bf=['squeue','drained','handleDrained','push','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','lodash','uuid','./util','routing','notificationId','agent','realtime','handleTimeout','bind'];(function(_0x1e385e,_0x3bc402){var _0x336c83=function(_0x2a2312){while(--_0x2a2312){_0x1e385e['push'](_0x1e385e['shift']());}};_0x336c83(++_0x3bc402);}(_0xf4bf,0xc2));var _0xff4b=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xf4bf[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0xff4b('0x0'));var uuid=require(_0xff4b('0x1'));var util=require(_0xff4b('0x2'));var logger=require('../../../../../config/logger')(_0xff4b('0x3'));var Agent=function(_0x19fcdc,_0x1d9e9b,_0xba2d5d,_0x3eaf65){this[_0xff4b('0x4')]=uuid['v4']();this['squeue']=_0x19fcdc;this[_0xff4b('0x5')]=_0x1d9e9b;this[_0xff4b('0x6')]=_0xba2d5d;this['routing']=_0x3eaf65;this['squeue']['push'](this['handleRun']['bind'](this),this[_0xff4b('0x7')][_0xff4b('0x8')](this));this[_0xff4b('0x9')]['on']('timeout',this[_0xff4b('0x7')][_0xff4b('0x8')](this));this[_0xff4b('0x9')]['on'](_0xff4b('0xa'),this[_0xff4b('0xb')]['bind'](this));};Agent['prototype'][_0xff4b('0xc')]=function(){this['squeue'][_0xff4b('0xc')](this['handleRun'][_0xff4b('0x8')](this),this[_0xff4b('0x7')][_0xff4b('0x8')](this));};Agent[_0xff4b('0xd')][_0xff4b('0xb')]=function(){this[_0xff4b('0x7')](!![]);};Agent[_0xff4b('0xd')][_0xff4b('0xe')]=function(_0x711a94){logger['info'](_0xff4b('0xf'),this[_0xff4b('0x9')]['id'],this[_0xff4b('0x5')]['id']);if(_[_0xff4b('0x10')](this[_0xff4b('0x6')][_0xff4b('0x11')][this[_0xff4b('0x5')]['id']])){logger[_0xff4b('0x12')](_0xff4b('0x13'),this['squeue']['id'],this[_0xff4b('0x5')]['id']);setTimeout(this[_0xff4b('0xc')][_0xff4b('0x8')](this),0x3e8);}else{if(this[_0xff4b('0x3')][_0xff4b('0x14')]||util['isAgentAvailable'](this[_0xff4b('0x9')]['id'],this[_0xff4b('0x6')][_0xff4b('0x11')][this[_0xff4b('0x5')]['id']],this['squeue']['channel'],![])){this[_0xff4b('0x6')][_0xff4b('0x11')][this['agent']['id']][_0xff4b('0x15')]=!![];this[_0xff4b('0x6')]['agents'][this[_0xff4b('0x5')]['id']][_0xff4b('0x16')]=undefined;util['showNotification'](this[_0xff4b('0x4')],this[_0xff4b('0x9')]['id'],this[_0xff4b('0x6')]['agents'][this['agent']['id']],null,this[_0xff4b('0x3')]);util[_0xff4b('0x17')](this[_0xff4b('0x9')]['id'],this[_0xff4b('0x6')][_0xff4b('0x11')][this[_0xff4b('0x5')]['id']],_0xff4b('0x18')+(this[_0xff4b('0x3')][_0xff4b('0x14')]?':FORCED':''));}else{logger[_0xff4b('0x12')](_0xff4b('0x19'),this['squeue']['id'],this[_0xff4b('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype'][_0xff4b('0x7')]=function(_0x1b9b7d){if(_[_0xff4b('0x10')](this[_0xff4b('0x6')]['agents'][this[_0xff4b('0x5')]['id']])){return logger[_0xff4b('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xff4b('0x5')]['id']);}else{logger[_0xff4b('0x12')](_0xff4b('0x1a'),this[_0xff4b('0x9')]['id'],this[_0xff4b('0x5')]['id']);util[_0xff4b('0x1b')](this[_0xff4b('0x4')],this['squeue']['id'],this['realtime'][_0xff4b('0x11')][this[_0xff4b('0x5')]['id']],null,this[_0xff4b('0x3')]);this['realtime'][_0xff4b('0x11')][this[_0xff4b('0x5')]['id']][_0xff4b('0x15')]=![];this[_0xff4b('0x6')][_0xff4b('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0xff4b('0x17')](this[_0xff4b('0x9')]['id'],this[_0xff4b('0x6')]['agents'][this[_0xff4b('0x5')]['id']],_0x1b9b7d?'STOP':_0xff4b('0x1c'));}if(!_0x1b9b7d){setTimeout(this[_0xff4b('0xc')][_0xff4b('0x8')](this),0x3e8);}};function agent(_0x6e3905,_0x12ba9d,_0xb34324,_0x39158d){return new Agent(_0x6e3905,_0x12ba9d,_0xb34324,_0x39158d);}module['exports']=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 3b06d16..c78f733 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 _0xe9e8=['info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents'];(function(_0x572085,_0x3f1a4b){var _0x530829=function(_0x436f31){while(--_0x436f31){_0x572085['push'](_0x572085['shift']());}};_0x530829(++_0x3f1a4b);}(_0xe9e8,0x179));var _0x8e9e=function(_0x1da772,_0x5a372b){_0x1da772=_0x1da772-0x0;var _0x5b67b1=_0xe9e8[_0x1da772];return _0x5b67b1;};'use strict';var _=require(_0x8e9e('0x0'));var uuid=require(_0x8e9e('0x1'));var util=require(_0x8e9e('0x2'));var logger=require(_0x8e9e('0x3'))(_0x8e9e('0x4'));var Beepall=function(_0x349180,_0x398891,_0x48f1bc,_0x1508fb){this['notificationId']=uuid['v4']();this[_0x8e9e('0x5')]=_0x349180;this[_0x8e9e('0x6')]=_0x398891;this[_0x8e9e('0x7')]=_0x48f1bc;this['routing']=_0x1508fb;this['squeue'][_0x8e9e('0x8')](this[_0x8e9e('0x9')][_0x8e9e('0xa')](this),this[_0x8e9e('0xb')][_0x8e9e('0xa')](this));this[_0x8e9e('0x5')]['on']('timeout',this['handleTimeout'][_0x8e9e('0xa')](this));this[_0x8e9e('0x5')]['on'](_0x8e9e('0xc'),this[_0x8e9e('0xd')][_0x8e9e('0xa')](this));};Beepall[_0x8e9e('0xe')][_0x8e9e('0x8')]=function(){this[_0x8e9e('0x5')][_0x8e9e('0x8')](this[_0x8e9e('0x9')][_0x8e9e('0xa')](this),this[_0x8e9e('0xb')][_0x8e9e('0xa')](this));};Beepall[_0x8e9e('0xe')]['handleDrained']=function(_0x2e1144){this[_0x8e9e('0xb')](!![]);};Beepall[_0x8e9e('0xe')][_0x8e9e('0x9')]=function(_0x5397cf){var _0x3847a6=!![];if(!_['isNil'](this[_0x8e9e('0x6')])&&!_[_0x8e9e('0xf')](this[_0x8e9e('0x6')]['Agents'])&&this['queue'][_0x8e9e('0x10')][_0x8e9e('0x11')]>0x0){for(var _0x5b62ca=0x0,_0x1bddc7;_0x5b62ca0x0){for(var _0x7126d5=0x0,_0x55c868;_0x7126d50x0&&_0x3b73f6[_0x4ec57a+_0x1499('0x25')]>=_0x3b73f6[_0x4ec57a+_0x1499('0x24')]){writeLog(_0x223f4c,_0x3b73f6,_0x4ec57a[_0x1499('0x26')]()+_0x1499('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x3e5ed1,_0x573b51,_0x5022a4,_0x516f29,_0x21d204){return sendNotification(!![],_0x3e5ed1,_0x573b51,_0x5022a4,_0x516f29,_0x21d204);};exports[_0x1499('0x28')]=function(_0x40932a,_0x1b460b,_0x3dad86,_0x388513,_0x3dd534){return sendNotification(![],_0x40932a,_0x1b460b,_0x3dad86,_0x388513,_0x3dd534);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x68b3=['hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification'];(function(_0x26fd0b,_0x131ad5){var _0x28184c=function(_0x57a82f){while(--_0x57a82f){_0x26fd0b['push'](_0x26fd0b['shift']());}};_0x28184c(++_0x131ad5);}(_0x68b3,0x1d8));var _0x368b=function(_0x39d276,_0x4e889e){_0x39d276=_0x39d276-0x0;var _0x5caf46=_0x68b3[_0x39d276];return _0x5caf46;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var utils=require(_0x368b('0x2'));var Mustache=require(_0x368b('0x3'));var Redis=require(_0x368b('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x368b('0x5'))(_0x368b('0x6'));config[_0x368b('0x7')]=_[_0x368b('0x8')](config['redis'],{'host':_0x368b('0x9'),'port':0x18eb});var io=require(_0x368b('0xa'))(new Redis(config[_0x368b('0x7')]));function emit(_0x23584a,_0x4406c8,_0x127c1e){io['to'](_0x23584a)[_0x368b('0xb')](_0x4406c8,_0x127c1e);}function sendNotification(_0x142d05,_0x23622f,_0x1f64d8,_0x2a7b9f,_0x5a46f9,_0x160e12){io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f['name']))[_0x368b('0xb')](_0x368b('0xe'),_0x2a7b9f);var _0x253e4b=_0x160e12||{};var _0x5924a6=_0x1f64d8[_0x368b('0xf')]('.');var _0x847dcb={'uniqueid':_0x23622f,'channel':_0x5924a6[0x0],'id':_0x5924a6[0x1],'title':_0x5924a6[0x0]+'\x20interaction','interactionId':_0x5924a6[0x2],'queue':_0x5a46f9?_0x5a46f9[_0x368b('0x10')]:null,'sound':_0x253e4b[_0x368b('0x11')][_0x368b('0x12')],'shake':_0x253e4b[_0x368b('0x11')][_0x368b('0x13')]};try{if(!_0x253e4b['body']){_0x253e4b[_0x368b('0x14')]={};}if(_0x5a46f9){_0x253e4b[_0x368b('0x14')]['queue']=_0x5a46f9;}else if(_0x253e4b[_0x368b('0x14')][_0x368b('0x15')]){delete _0x253e4b[_0x368b('0x14')]['queue'];}_0x847dcb[_0x368b('0x16')]=utils[_0x368b('0x17')](_0x253e4b[_0x368b('0x11')]['notificationTemplate'],_0x253e4b);}catch(_0x102407){_0x847dcb[_0x368b('0x16')]=_0x368b('0x18');logger['error'](util['format'](_0x368b('0x19'),_0x23622f,_0x102407[_0x368b('0x1a')]));}io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f[_0x368b('0x10')]))['emit'](util[_0x368b('0xc')](_0x368b('0x1b'),_0x142d05?_0x368b('0x1c'):_0x368b('0x1d')),_0x847dcb);}function writeLog(_0x23da8f,_0x26b206,_0x397185){return logger[_0x368b('0x1e')](util['format'](_0x368b('0x1f'),_0x23da8f,_0x26b206[_0x368b('0x10')],_0x397185));}exports[_0x368b('0x20')]=function(_0xc0f7af,_0x286853,_0x4c2fca,_0x286641){if(_0x286853[_0x368b('0x21')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x22'));return![];}if(!_0x286853[_0x368b('0x23')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x24'));return![];}if(_0x286853[_0x4c2fca+_0x368b('0x25')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x26'));return![];}if(_0x286641&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x28'))&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x29'))){if(_0x286853[_0x4c2fca+_0x368b('0x28')]>0x0&&_0x286853[_0x4c2fca+_0x368b('0x29')]>=_0x286853[_0x4c2fca+_0x368b('0x28')]){writeLog(_0xc0f7af,_0x286853,_0x4c2fca[_0x368b('0x2a')]()+_0x368b('0x2b'));return![];}}return!![];};exports[_0x368b('0x2c')]=function(_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627){return sendNotification(!![],_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627);};exports[_0x368b('0x2d')]=function(_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52){return sendNotification(![],_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52);};exports[_0x368b('0x2e')]=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 a19f44f..fb18fd7 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 _0x7eb9=['stringify','validate','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error'];(function(_0x5be365,_0x26187f){var _0x237c7a=function(_0x49b276){while(--_0x49b276){_0x5be365['push'](_0x5be365['shift']());}};_0x237c7a(++_0x26187f);}(_0x7eb9,0xd9));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var schema=require(_0x97eb('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x97eb('0x1'));var logger=require('../../../../config/logger')(_0x97eb('0x2'));var system=schema({'command':{'type':_0x97eb('0x3'),'required':!![],'message':_0x97eb('0x4')}});exports[_0x97eb('0x5')]=function(_0x5066c1,_0x350cc1){return function(_0x4897e6){try{var _0x5f78f4={'command':_0x350cc1[0x0]};var _0x5327d4=system[_0x97eb('0x0')](_0x5f78f4,{'typecast':!![]});if(_0x5327d4['length']){logger['error'](_0x97eb('0x6'),_0x5066c1,_['map'](_0x5327d4,_0x97eb('0x7'))[_0x97eb('0x8')](',\x20'));logger[_0x97eb('0x9')](_0x97eb('0xa'),_0x5066c1);_0x4897e6[_0x97eb('0xb')]();}else{var _0x4d9ad7=this;var _0x48bd42=utils[_0x97eb('0xc')](_0x350cc1[0x0],this);logger[_0x97eb('0x9')](_0x97eb('0xd'),_0x5066c1,_0x48bd42);sh[_0x97eb('0xe')](_[_0x97eb('0xf')](_0x48bd42),function(_0x564f3c,_0x1bbddc){logger[_0x97eb('0x9')](_0x97eb('0x10'),_0x5066c1,_0x564f3c);if(_0x564f3c==0x0){var _0x37e165=_0x1bbddc[_0x97eb('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x97eb('0x12')](_0x350cc1[0x1])||_[_0x97eb('0x13')](_0x350cc1[0x1])){logger[_0x97eb('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x5066c1);_0x4d9ad7[_0x97eb('0x14')][_0x350cc1[0x1]]=_0x37e165;}else{logger[_0x97eb('0x9')](_0x97eb('0x15'),_0x5066c1,_0x350cc1[0x1],_0x37e165);_0x4d9ad7['body'][_0x350cc1[0x1]]=_0x37e165;}}_0x4897e6[_0x97eb('0xb')]();});}}catch(_0x19477a){logger[_0x97eb('0x16')]('[%s][SYSTEM]\x20%s',_0x5066c1,_['isObject'](_0x19477a)?JSON[_0x97eb('0x17')](_0x19477a):_0x19477a);logger[_0x97eb('0x9')](_0x97eb('0xa'),_0x5066c1);_0x4897e6[_0x97eb('0xb')]();}};}; \ No newline at end of file +var _0xe3f2=['error','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','validate','shelljs','lodash','./utils','routing','string','length'];(function(_0x122dea,_0x459955){var _0xbc6d09=function(_0x40d49a){while(--_0x40d49a){_0x122dea['push'](_0x122dea['shift']());}};_0xbc6d09(++_0x459955);}(_0xe3f2,0x101));var _0x2e3f=function(_0x21ad8e,_0x2e5222){_0x21ad8e=_0x21ad8e-0x0;var _0x10c5ab=_0xe3f2[_0x21ad8e];return _0x10c5ab;};'use strict';var schema=require(_0x2e3f('0x0'));var sh=require(_0x2e3f('0x1'));var _=require(_0x2e3f('0x2'));var utils=require(_0x2e3f('0x3'));var logger=require('../../../../config/logger')(_0x2e3f('0x4'));var system=schema({'command':{'type':_0x2e3f('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x580f88,_0x174208){return function(_0x482a38){try{var _0x19756d={'command':_0x174208[0x0]};var _0x101606=system[_0x2e3f('0x0')](_0x19756d,{'typecast':!![]});if(_0x101606[_0x2e3f('0x6')]){logger[_0x2e3f('0x7')]('[%s][SYSTEM]\x20%s',_0x580f88,_[_0x2e3f('0x8')](_0x101606,_0x2e3f('0x9'))['join'](',\x20'));logger[_0x2e3f('0xa')](_0x2e3f('0xb'),_0x580f88);_0x482a38[_0x2e3f('0xc')]();}else{var _0x201822=this;var _0x2e7854=utils[_0x2e3f('0xd')](_0x174208[0x0],this);logger[_0x2e3f('0xa')](_0x2e3f('0xe'),_0x580f88,_0x2e7854);sh[_0x2e3f('0xf')](_['trim'](_0x2e7854),function(_0x27afaa,_0x3fdbe6){logger[_0x2e3f('0xa')](_0x2e3f('0x10'),_0x580f88,_0x27afaa);if(_0x27afaa==0x0){var _0x2b0721=_0x3fdbe6[_0x2e3f('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x2e3f('0x12')](_0x174208[0x1])||_[_0x2e3f('0x13')](_0x174208[0x1])){logger['info'](_0x2e3f('0x14'),_0x580f88);_0x201822[_0x2e3f('0x15')][_0x174208[0x1]]=_0x2b0721;}else{logger[_0x2e3f('0xa')](_0x2e3f('0x16'),_0x580f88,_0x174208[0x1],_0x2b0721);_0x201822[_0x2e3f('0x15')][_0x174208[0x1]]=_0x2b0721;}}_0x482a38[_0x2e3f('0xc')]();});}}catch(_0x2cd1cb){logger[_0x2e3f('0x7')](_0x2e3f('0x17'),_0x580f88,_['isObject'](_0x2cd1cb)?JSON['stringify'](_0x2cd1cb):_0x2cd1cb);logger[_0x2e3f('0xa')](_0x2e3f('0xb'),_0x580f88);_0x482a38[_0x2e3f('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 239d2ab..60680f6 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 _0x05fa=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x823f65,_0x539aae){var _0x3adcff=function(_0x5e70bf){while(--_0x5e70bf){_0x823f65['push'](_0x823f65['shift']());}};_0x3adcff(++_0x539aae);}(_0x05fa,0xe3));var _0xa05f=function(_0x4dbda8,_0xbce830){_0x4dbda8=_0x4dbda8-0x0;var _0x1149ed=_0x05fa[_0x4dbda8];return _0x1149ed;};'use strict';var schema=require('validate');var _=require(_0xa05f('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xa05f('0x1')),'smsInteraction':require(_0xa05f('0x2')),'mailInteraction':require(_0xa05f('0x3')),'faxInteraction':require(_0xa05f('0x4')),'whatsappInteraction':require(_0xa05f('0x5'))};var logger=require(_0xa05f('0x6'))(_0xa05f('0x7'));var tag=schema({'tag':{'type':_0xa05f('0x8'),'required':!![],'message':_0xa05f('0x9')}});exports[_0xa05f('0xa')]=function(_0x234210,_0x5389e1,_0x26a27a,_0x2b0275){return function(_0x252f96){try{var _0x3adac5={'tag':_0x5389e1[0x0]};var _0x152ad5=tag[_0xa05f('0xb')](_0x3adac5,{'typecast':!![]});if(_0x152ad5[_0xa05f('0xc')]){logger[_0xa05f('0xd')](_0xa05f('0xe'),_0x234210,_[_0xa05f('0xf')](_0x152ad5,_0xa05f('0x10'))['join'](',\x20'));logger['info'](_0xa05f('0x11'),_0x234210);_0x252f96[_0xa05f('0x12')]();}else{var _0x50d801={'ids':[_0x5389e1[0x0]]};if(rpc[_0x2b0275[_0xa05f('0x13')]+_0xa05f('0x14')]){rpc[_0x2b0275['channel']+_0xa05f('0x14')]['addTags'](_0x2b0275[_0xa05f('0x15')]['id'],_0x50d801)[_0xa05f('0x16')](function(_0x45353d){logger[_0xa05f('0x17')](_0xa05f('0x18'),_0x234210,_0x5389e1[0x1],_0x2b0275[_0xa05f('0x13')],_0x2b0275[_0xa05f('0x15')]['id']);})[_0xa05f('0x19')](function(_0x4b1db2){logger[_0xa05f('0xd')]('[%s][TAG]\x20%s',_0x234210,JSON[_0xa05f('0x1a')](_0x4b1db2));logger['info'](_0xa05f('0x11'),_0x234210);})[_0xa05f('0x1b')](function(){_0x252f96[_0xa05f('0x12')]();});}}}catch(_0x17706f){logger[_0xa05f('0xd')](_0xa05f('0xe'),_0x234210,_[_0xa05f('0x1c')](_0x17706f)?JSON['stringify'](_0x17706f):_0x17706f);logger[_0xa05f('0x17')](_0xa05f('0x11'),_0x234210);_0x252f96['next']();}};}; \ No newline at end of file +var _0x4b79=['finally','isObject','lodash','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','catch','error','[%s][TAG]\x20%s','stringify'];(function(_0x3e90ec,_0x4781b3){var _0x2d9f68=function(_0x4004f3){while(--_0x4004f3){_0x3e90ec['push'](_0x3e90ec['shift']());}};_0x2d9f68(++_0x4781b3);}(_0x4b79,0xca));var _0x94b7=function(_0xd046da,_0x590cb0){_0xd046da=_0xd046da-0x0;var _0x28f1cb=_0x4b79[_0xd046da];return _0x28f1cb;};'use strict';var schema=require('validate');var _=require(_0x94b7('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x94b7('0x1')),'mailInteraction':require(_0x94b7('0x2')),'faxInteraction':require(_0x94b7('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x94b7('0x4'))('routing');var tag=schema({'tag':{'type':_0x94b7('0x5'),'required':!![],'message':_0x94b7('0x6')}});exports[_0x94b7('0x7')]=function(_0x53ca80,_0xce44e,_0x40dba8,_0x30c65a){return function(_0x1b0e92){try{var _0x4a03f7={'tag':_0xce44e[0x0]};var _0x40ca23=tag[_0x94b7('0x8')](_0x4a03f7,{'typecast':!![]});if(_0x40ca23[_0x94b7('0x9')]){logger['error']('[%s][TAG]\x20%s',_0x53ca80,_['map'](_0x40ca23,_0x94b7('0xa'))[_0x94b7('0xb')](',\x20'));logger['info'](_0x94b7('0xc'),_0x53ca80);_0x1b0e92[_0x94b7('0xd')]();}else{var _0x3ae89e={'ids':[_0xce44e[0x0]]};if(rpc[_0x30c65a[_0x94b7('0xe')]+'Interaction']){rpc[_0x30c65a[_0x94b7('0xe')]+_0x94b7('0xf')]['addTags'](_0x30c65a[_0x94b7('0x10')]['id'],_0x3ae89e)[_0x94b7('0x11')](function(_0x11d393){logger[_0x94b7('0x12')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x53ca80,_0xce44e[0x1],_0x30c65a[_0x94b7('0xe')],_0x30c65a['interaction']['id']);})[_0x94b7('0x13')](function(_0x25eba3){logger[_0x94b7('0x14')](_0x94b7('0x15'),_0x53ca80,JSON[_0x94b7('0x16')](_0x25eba3));logger[_0x94b7('0x12')](_0x94b7('0xc'),_0x53ca80);})[_0x94b7('0x17')](function(){_0x1b0e92[_0x94b7('0xd')]();});}}}catch(_0x3e4629){logger[_0x94b7('0x14')]('[%s][TAG]\x20%s',_0x53ca80,_[_0x94b7('0x18')](_0x3e4629)?JSON[_0x94b7('0x16')](_0x3e4629):_0x3e4629);logger[_0x94b7('0x12')](_0x94b7('0xc'),_0x53ca80);_0x1b0e92['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index ea58b58..d3c6be8 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1533=['stringify','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params'];(function(_0x4daf46,_0xe43030){var _0xee3928=function(_0x3ec6b6){while(--_0x3ec6b6){_0x4daf46['push'](_0x4daf46['shift']());}};_0xee3928(++_0xe43030);}(_0x1533,0x1cb));var _0x3153=function(_0x3211fe,_0x61867f){_0x3211fe=_0x3211fe-0x0;var _0x20b1db=_0x1533[_0x3211fe];return _0x20b1db;};'use strict';var rp=require(_0x3153('0x0'));var logger=require(_0x3153('0x1'))(_0x3153('0x2'));var _=require(_0x3153('0x3'));var arr=[];exports['consequence']=function(_0x3a2f03,_0x1602a8){return function(_0x48d09d){var _0x466861=_0x1602a8[0xa];var _0x4c1124=_0x1602a8[0xb];var _0x3a4f8e=_0x1602a8[0xc];var _0x56b17b=_0x1602a8[0xd];var _0x5cc41e=_0x1602a8[0xe];var _0x2c20a7=_0x1602a8[0xf]['replace'](/\n/g,_0x3153('0x4'));var _0x40e86c=_0x1602a8[0x10][_0x3153('0x5')](/\n/g,'\x20');if(!arr[_0x3153('0x6')](_0x4c1124)){arr[_0x3153('0x7')](_0x4c1124);var _0x23b6c0=_0x1602a8[0x3];var _0x503307=_0x1602a8[0x4];var _0x26bec2=_0x1602a8[0x1];var _0x3a0acb=_0x1602a8[0x0];var _0x2d425b={};_0x2d425b[_0x3153('0x8')]=_0x1602a8[0x8]+_0x3153('0x9')+_0x3a4f8e+'|'+_0x466861+'|'+_0x56b17b+'|'+_0x4c1124+'|'+_0x5cc41e;_0x2d425b[_0x3153('0xa')]=_0x1602a8[0x7]+'?params='+_0x3a4f8e+'|'+_0x466861+'|'+_0x56b17b+'|'+_0x4c1124+'|'+_0x5cc41e+'|'+_0x2c20a7+'|'+_0x40e86c;_0x2d425b[_0x3153('0xb')]=_0x1602a8[0x9];var _0x43cd5f={};_0x43cd5f[_0x3153('0xc')]=_0x3153('0xd');_0x43cd5f[_0x3153('0xe')]=_0x3153('0xf');var _0x58ca2a=[];_0x58ca2a[_0x3153('0x7')](_0x1602a8[0x2]);_0x58ca2a[_0x3153('0x7')](_0x1602a8[0x5]);_0x58ca2a['push'](_0x1602a8[0x6]);_0x43cd5f[_0x3153('0x10')]=_0x58ca2a;_0x43cd5f['id']=0x1;var _0x16f8cd=JSON[_0x3153('0x11')](_0x43cd5f);var _0x2a5450={'encoding':_0x3153('0x12'),'method':_0x3153('0x13'),'timeout':0x2710,'url':_0x23b6c0,'headers':{'Content-Type':_0x3153('0x14')},'body':_0x16f8cd};return rp(_0x2a5450)[_0x3153('0x15')](function(_0x30301b){const _0x4a4288=JSON[_0x3153('0x16')](_0x30301b);if(!_0x4a4288['result'][_0x3153('0x17')]){throw new Error(_0x3153('0x18'));}var _0x4e5ef5=_0x4c1124;var _0x5aa4f2=_0x3153('0x19')+_0x26bec2+_0x3153('0x1a')+_0x3a0acb+_0x3153('0x1b')+_0x4e5ef5+_0x3153('0x1c')+JSON[_0x3153('0x11')](_0x2d425b);var _0x5bd590=_0x503307+'?'+_0x5aa4f2;return rp(_0x5bd590);})['then'](function(_0x299261){logger[_0x3153('0x1d')](_0x3153('0x1e'),_0x3a2f03,_0x299261);_0x48d09d[_0x3153('0x1f')]();})['catch'](function(_0x16eef1){logger['error'](_0x3153('0x20'),_0x3a2f03,_['isObject'](_0x16eef1)?JSON[_0x3153('0x11')](_0x16eef1):_0x16eef1);_0x48d09d['stop']();});}else{logger['info'](_0x3153('0x21'),_0x3a2f03);_0x48d09d['next']();}};}; \ No newline at end of file +var _0xc807=['error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash','consequence','replace','\x20-\x20','urlOnRing','title','jsonrpc','2.0','login','push','stringify','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch'];(function(_0x4ad553,_0x586c5a){var _0x136750=function(_0x11dfbc){while(--_0x11dfbc){_0x4ad553['push'](_0x4ad553['shift']());}};_0x136750(++_0x586c5a);}(_0xc807,0x12e));var _0x7c80=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xc807[_0x2f1762];return _0x8ab21;};'use strict';var rp=require(_0x7c80('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x7c80('0x1'));var arr=[];exports[_0x7c80('0x2')]=function(_0x276081,_0x528c15){return function(_0x4224df){var _0x3f1809=_0x528c15[0xa];var _0xd1ec3d=_0x528c15[0xb];var _0x2a62c7=_0x528c15[0xc];var _0x5333f2=_0x528c15[0xd];var _0x495cc9=_0x528c15[0xe];var _0x193022=_0x528c15[0xf][_0x7c80('0x3')](/\n/g,_0x7c80('0x4'));var _0x303f4d=_0x528c15[0x10][_0x7c80('0x3')](/\n/g,'\x20');if(!arr['includes'](_0xd1ec3d)){arr['push'](_0xd1ec3d);var _0x3deb13=_0x528c15[0x3];var _0x42ad02=_0x528c15[0x4];var _0x4385c2=_0x528c15[0x1];var _0x1e0598=_0x528c15[0x0];var _0x3f77b5={};_0x3f77b5['urlOnAnswer']=_0x528c15[0x8]+'?params='+_0x2a62c7+'|'+_0x3f1809+'|'+_0x5333f2+'|'+_0xd1ec3d+'|'+_0x495cc9;_0x3f77b5[_0x7c80('0x5')]=_0x528c15[0x7]+'?params='+_0x2a62c7+'|'+_0x3f1809+'|'+_0x5333f2+'|'+_0xd1ec3d+'|'+_0x495cc9+'|'+_0x193022+'|'+_0x303f4d;_0x3f77b5[_0x7c80('0x6')]=_0x528c15[0x9];var _0x5b1125={};_0x5b1125[_0x7c80('0x7')]=_0x7c80('0x8');_0x5b1125['method']=_0x7c80('0x9');var _0x2aae37=[];_0x2aae37[_0x7c80('0xa')](_0x528c15[0x2]);_0x2aae37[_0x7c80('0xa')](_0x528c15[0x5]);_0x2aae37[_0x7c80('0xa')](_0x528c15[0x6]);_0x5b1125['params']=_0x2aae37;_0x5b1125['id']=0x1;var _0x17ae77=JSON[_0x7c80('0xb')](_0x5b1125);var _0x138964={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x3deb13,'headers':{'Content-Type':_0x7c80('0xc')},'body':_0x17ae77};return rp(_0x138964)[_0x7c80('0xd')](function(_0x8e3f01){const _0x10c3a9=JSON[_0x7c80('0xe')](_0x8e3f01);if(!_0x10c3a9[_0x7c80('0xf')]['logged']){throw new Error(_0x7c80('0x10'));}var _0xba22ef=_0xd1ec3d;var _0x589078='channelId='+_0x4385c2+'&serviceId='+_0x1e0598+'&sessionId='+_0xba22ef+_0x7c80('0x11')+JSON['stringify'](_0x3f77b5);var _0x32844f=_0x42ad02+'?'+_0x589078;return rp(_0x32844f);})[_0x7c80('0xd')](function(_0x5ba956){logger[_0x7c80('0x12')](_0x7c80('0x13'),_0x276081,_0x5ba956);_0x4224df[_0x7c80('0x14')]();})[_0x7c80('0x15')](function(_0x4b7a59){logger[_0x7c80('0x16')](_0x7c80('0x17'),_0x276081,_[_0x7c80('0x18')](_0x4b7a59)?JSON[_0x7c80('0xb')](_0x4b7a59):_0x4b7a59);_0x4224df[_0x7c80('0x14')]();});}else{logger['info'](_0x7c80('0x19'),_0x276081);_0x4224df[_0x7c80('0x1a')]();}};}; \ 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 de1c1cc..7fd5f46 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1beceb,_0x488927){var _0x2389c8=function(_0x31d378){while(--_0x31d378){_0x1beceb['push'](_0x1beceb['shift']());}};_0x2389c8(++_0x488927);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x200135,_0x4715db){var _0x64353d=function(_0x585c6e){while(--_0x585c6e){_0x200135['push'](_0x200135['shift']());}};_0x64353d(++_0x4715db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index a3271cc..4d8efc7 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 _0xc577=['length','existsSync','join','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','getMustacheRender','notificationTemplate','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','matchPath','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','end','stack','capacity','hasOwnProperty','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray'];(function(_0x3ea4bc,_0x141be9){var _0x38bd86=function(_0x4e5e89){while(--_0x4e5e89){_0x3ea4bc['push'](_0x3ea4bc['shift']());}};_0x38bd86(++_0x141be9);}(_0xc577,0x172));var _0x7c57=function(_0x1753e0,_0x32ccd4){_0x1753e0=_0x1753e0-0x0;var _0xc9f908=_0xc577[_0x1753e0];return _0xc9f908;};'use strict';var _=require(_0x7c57('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x7c57('0x1'));var BPromise=require(_0x7c57('0x2'));var uuid=require(_0x7c57('0x3'));var utils=require(_0x7c57('0x4'));var config=require(_0x7c57('0x5'));var logger=require(_0x7c57('0x6'))(_0x7c57('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7c57('0x8')),'chatQueueReport':require(_0x7c57('0x9')),'smsQueueReport':require(_0x7c57('0xa')),'faxQueueReport':require(_0x7c57('0xb')),'whatsappQueueReport':require(_0x7c57('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4e5cb2,_0x5c7ffb,_0x1f8143){return util['format'](_0x7c57('0xd'),_0x4e5cb2,_0x5c7ffb||0x0,_0x1f8143||0x0);}function getIntervals(_0x2e63cc,_0x11dd41){var _0x3665f9=[];if(!_['isNil'](_0x11dd41[_0x7c57('0xe')])&&!_[_0x7c57('0xf')](_0x2e63cc[_0x11dd41['IntervalId']])&&!_[_0x7c57('0xf')](_0x2e63cc[_0x11dd41[_0x7c57('0xe')]][_0x7c57('0x10')])){_0x3665f9=_[_0x7c57('0x11')](_0x2e63cc[_0x11dd41[_0x7c57('0xe')]][_0x7c57('0x10')],_0x7c57('0x12'));}else if(!_['isNil'](_0x11dd41['interval'])){_0x3665f9=[_0x11dd41['interval']];}return _0x3665f9;}exports[_0x7c57('0x13')]=function(_0x373a4b){_0x373a4b[_0x7c57('0x14')]={};return new BPromise(function(_0x43d1fd,_0x2ce3ca){var _0x11903b={'Start':function(_0x1ba2d0){var _0x14ce67=this;return new Promise(function(_0x517d8a,_0x532e93){if(_0x1ba2d0){try{var _0x2a34a=[];var _0x2975f0=getId(_0x1ba2d0[_0x7c57('0x15')],_0x1ba2d0[_0x7c57('0x16')]?_0x1ba2d0[_0x7c57('0x16')]['id']:0x0,_0x1ba2d0['interaction']?_0x1ba2d0[_0x7c57('0x17')]['id']:0x0);if(_0x1ba2d0[_0x7c57('0x18')]&&_[_0x7c57('0x19')](_0x1ba2d0[_0x7c57('0x18')])&&_0x1ba2d0[_0x7c57('0x18')][_0x7c57('0x1a')]){for(var _0x2931c4=0x0;_0x2931c4<_0x1ba2d0[_0x7c57('0x18')][_0x7c57('0x1a')];_0x2931c4+=0x1){var _0x5488b7=_0x1ba2d0[_0x7c57('0x18')][_0x2931c4];if(fs[_0x7c57('0x1b')](path[_0x7c57('0x1c')](__dirname,_0x7c57('0x18'),_0x5488b7['app']+'.js'))){var _0x4c4140=[];switch(_0x5488b7[_0x7c57('0x1d')][_0x7c57('0x1e')]()){case'autoreply':var _0x434a3e=_0x5488b7[_0x7c57('0x1f')][_0x7c57('0x20')](',');if(_0x1ba2d0[_0x7c57('0x15')]===_0x7c57('0x21')){_0x4c4140[_0x7c57('0x22')](_0x434a3e[0x0]);_0x4c4140[_0x7c57('0x22')](_0x434a3e[0x1]);_0x4c4140['push'](_0x434a3e[_0x7c57('0x23')](0x2,_0x434a3e[_0x7c57('0x1a')])[_0x7c57('0x1c')](','));}else{_0x4c4140[_0x7c57('0x22')](_0x434a3e[0x0]);_0x4c4140[_0x7c57('0x22')](_0x434a3e[_0x7c57('0x23')](0x1,_0x434a3e[_0x7c57('0x1a')])[_0x7c57('0x1c')](','));}break;case _0x7c57('0x24'):var _0x4b8747=_0x5488b7['appdata'][_0x7c57('0x20')](',');_0x4c4140[_0x7c57('0x22')](_0x4b8747[0x0]);_0x4c4140[_0x7c57('0x22')](_0x4b8747[0x1]);_0x4c4140['push'](_0x4b8747[_0x7c57('0x23')](0x2,_0x4b8747['length'])['join'](','));break;case'dialogflowv2':var _0x1d5b54=_0x5488b7[_0x7c57('0x1f')]['split'](',');_0x4c4140[_0x7c57('0x22')](_0x1d5b54[0x0]);_0x4c4140[_0x7c57('0x22')](_0x1d5b54[0x1]);_0x4c4140[_0x7c57('0x22')](_0x1d5b54[0x2]);_0x4c4140['push'](_0x1d5b54[0x3]);_0x4c4140[_0x7c57('0x22')](_0x1d5b54[_0x7c57('0x23')](0x4,_0x1d5b54[_0x7c57('0x1a')])['join'](','));break;case _0x7c57('0x25'):var _0x3abf85=_0x5488b7[_0x7c57('0x1f')][_0x7c57('0x20')](',');_0x4c4140[_0x7c57('0x22')](_0x3abf85[0x0]);_0x4c4140[_0x7c57('0x22')](_0x3abf85[0x1]);_0x4c4140[_0x7c57('0x22')](_0x3abf85[0x2]);_0x4c4140[_0x7c57('0x22')](_0x3abf85[0x3]);_0x4c4140[_0x7c57('0x22')](_0x3abf85[_0x7c57('0x23')](0x4,_0x3abf85['length'])[_0x7c57('0x1c')](','));break;case _0x7c57('0x16'):_0x4c4140['push'](_0x5488b7[_0x7c57('0x1f')]);break;case _0x7c57('0x26'):_0x4c4140[_0x7c57('0x22')](_0x5488b7['TagId']);_0x4c4140[_0x7c57('0x22')](_0x5488b7[_0x7c57('0x1f')]);break;case'tvox':var _0x18dc6d=utils[_0x7c57('0x27')](_0x1ba2d0['account'][_0x7c57('0x28')],_0x1ba2d0);var _0x291960=_0x5488b7[_0x7c57('0x1f')][_0x7c57('0x20')](',');_0x4c4140['push'](_0x291960[0x0]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x1]);_0x4c4140['push'](_0x291960[0x2]);_0x4c4140['push'](_0x291960[0x3]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x4]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x5]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x6]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x7]);_0x4c4140['push'](_0x291960[0x8]);_0x4c4140[_0x7c57('0x22')](_0x291960[0x9]);_0x4c4140[_0x7c57('0x22')](_0x291960[0xa]);_0x4c4140[_0x7c57('0x22')](_0x1ba2d0[_0x7c57('0x17')]['id']);_0x4c4140[_0x7c57('0x22')](_0x1ba2d0[_0x7c57('0x16')]['id']);_0x4c4140[_0x7c57('0x22')](_0x5488b7['ChatWebsiteId']);_0x4c4140[_0x7c57('0x22')](_0x1ba2d0[_0x7c57('0x17')][_0x7c57('0x29')]);_0x4c4140[_0x7c57('0x22')](_0x1ba2d0['body'][_0x7c57('0x2a')]);_0x4c4140[_0x7c57('0x22')](_0x18dc6d);break;default:_0x4c4140=_[_0x7c57('0xf')](_0x5488b7[_0x7c57('0x1f')])?[]:_0x5488b7['appdata'][_0x7c57('0x20')](',');}var _0x3eb133={'id':util[_0x7c57('0x2b')](_0x7c57('0x2c'),_0x2975f0,_0x5488b7['id'],_0x5488b7[_0x7c57('0x1d')]),'condition':require(_0x7c57('0x2d'))[_0x7c57('0x2e')](_0x2975f0,getIntervals(_0x373a4b[_0x7c57('0x2f')],_0x5488b7),_0x373a4b),'consequence':require(_0x7c57('0x30')+_0x5488b7['app'])[_0x7c57('0x31')](_0x2975f0,_0x4c4140,_0x373a4b,_0x1ba2d0),'p':_0x5488b7['priority']||0x0};logger[_0x7c57('0x32')](_0x7c57('0x33'),_0x3eb133['id'],_0x7c57('0x34'),getIntervals(_0x373a4b[_0x7c57('0x2f')],_0x5488b7)['join'](_0x7c57('0x35')));_0x2a34a['push'](_0x3eb133);}else{logger[_0x7c57('0x36')](_0x7c57('0x37'),path[_0x7c57('0x1c')](__dirname,_0x7c57('0x18'),_0x5488b7[_0x7c57('0x1d')]+_0x7c57('0x38')));}}_0x373a4b[_0x7c57('0x14')][_0x2975f0]=new RuleEngine(_0x2a34a);_0x373a4b['rules'][_0x2975f0][_0x7c57('0x39')](_0x1ba2d0,function(_0x3ae8e4){logger['info'](_0x7c57('0x3a'),JSON['stringify'](_0x3ae8e4[_0x7c57('0x3b')]));if(_0x373a4b[_0x7c57('0x14')][_0x2975f0]){_0x373a4b[_0x7c57('0x14')][_0x2975f0]['emit'](_0x7c57('0x3c'));}});return _0x517d8a({'code':0xc8,'message':_0x1ba2d0});}else{logger[_0x7c57('0x32')]('No\x20applications\x20to\x20execute');return _0x517d8a({'code':0xc8,'message':_0x1ba2d0});}}catch(_0x2345fc){logger['error'](_0x2345fc['stack']);return _0x532e93(_0x14ce67[_0x7c57('0x36')](0x1f4,_0x2345fc));}}return _0x532e93(_0x7c57('0x3d'));});},'AcceptMessage':function(_0x17779b){var _0x50a577=this;return new Promise(function(_0x247e3e,_0x3f3e40){if(_0x17779b[_0x7c57('0x3e')]&&_0x17779b['agent']['id']){if(_0x373a4b[_0x7c57('0x3f')][_0x17779b[_0x7c57('0x3e')]['id']]){_0x373a4b[_0x7c57('0x3f')][_0x17779b['agent']['id']][_0x7c57('0x40')]=![];_0x373a4b[_0x7c57('0x3f')][_0x17779b[_0x7c57('0x3e')]['id']][_0x7c57('0x41')]=undefined;}}if(_0x17779b['message']&&_0x17779b[_0x7c57('0x16')]['id']){try{var _0x2ac8a2=getId(_0x17779b[_0x7c57('0x15')],_0x17779b['message']?_0x17779b[_0x7c57('0x16')]['id']:0x0,_0x17779b[_0x7c57('0x17')]?_0x17779b[_0x7c57('0x17')]['id']:0x0);if(_0x373a4b[_0x7c57('0x14')][_0x2ac8a2]){_0x373a4b['rules'][_0x2ac8a2][_0x7c57('0x42')]('end');if(rpc[_0x17779b[_0x7c57('0x15')]+_0x7c57('0x43')]){rpc[_0x17779b[_0x7c57('0x15')]+_0x7c57('0x43')][_0x7c57('0x44')](_0x2ac8a2,{'UserId':_0x17779b['message'][_0x7c57('0x45')]})['catch'](function(_0x5be52f){logger[_0x7c57('0x36')](_0x7c57('0x46'));});}}return _0x247e3e({'code':0xc8,'message':_0x17779b});}catch(_0x573f7f){logger[_0x7c57('0x36')](_0x573f7f['stack']);return _0x3f3e40(_0x50a577[_0x7c57('0x36')](0x1f4,_0x573f7f));}}logger[_0x7c57('0x36')](_0x7c57('0x47'));return _0x3f3e40(_0x50a577['error'](0x1f4,_0x7c57('0x47')));});},'RejectMessage':function(_0x4208db){var _0x11cafd=this;return new Promise(function(_0x32d0f6,_0x1b36dd){if(_0x4208db['agent']&&_0x4208db[_0x7c57('0x3e')]['id']){try{if(_0x373a4b[_0x7c57('0x3f')][_0x4208db[_0x7c57('0x3e')]['id']]){_0x373a4b[_0x7c57('0x3f')][_0x4208db[_0x7c57('0x3e')]['id']][_0x7c57('0x40')]=![];_0x373a4b[_0x7c57('0x3f')][_0x4208db[_0x7c57('0x3e')]['id']]['busyQueue']=undefined;}return _0x32d0f6({'code':0xc8,'message':_0x4208db});}catch(_0x5ae07e){logger[_0x7c57('0x36')](_0x5ae07e['stack']);return _0x1b36dd(_0x11cafd['error'](0x1f4,_0x5ae07e));}}logger[_0x7c57('0x36')](_0x7c57('0x47'));return _0x1b36dd(_0x11cafd[_0x7c57('0x36')](0x1f4,_0x7c57('0x47')));});},'AbandonInteraction':function(_0x58973c){var _0x367906=this;return new Promise(function(_0x541033,_0x1b0f50){if(_0x58973c['channel']&&_0x58973c[_0x7c57('0x17')]&&_0x58973c[_0x7c57('0x17')]['id']){try{var _0x3b3602=getId(_0x58973c[_0x7c57('0x15')],_0x58973c[_0x7c57('0x16')]?_0x58973c[_0x7c57('0x16')]['id']:0x0,_0x58973c[_0x7c57('0x17')]?_0x58973c[_0x7c57('0x17')]['id']:0x0);if(_0x373a4b['rules'][_0x3b3602]){_0x373a4b[_0x7c57('0x14')][_0x3b3602]['emit'](_0x7c57('0x48'));}return _0x541033({'code':0xc8,'message':_0x58973c});}catch(_0x4ef04d){logger[_0x7c57('0x36')](_0x4ef04d[_0x7c57('0x49')]);return _0x1b0f50(_0x367906[_0x7c57('0x36')](0x1f4,_0x4ef04d));}}logger[_0x7c57('0x36')](_0x7c57('0x47'));return _0x1b0f50(_0x367906[_0x7c57('0x36')](0x1f4,_0x7c57('0x47')));});},'AgentCapacity':function(_0x505040){var _0xdbddfa=this;return new Promise(function(_0x4045c9,_0x2fbc22){if(_0x373a4b['agents']['hasOwnProperty'](_0x505040['id'])){for(var _0x19c80b in _0x505040[_0x7c57('0x4a')]){if(_0x505040[_0x7c57('0x4a')][_0x7c57('0x4b')](_0x19c80b)){if(_0x373a4b[_0x7c57('0x3f')][_0x505040['id']]['hasOwnProperty'](_0x19c80b+'CurrentCapacity')){_0x373a4b[_0x7c57('0x3f')][_0x505040['id']][_0x19c80b+'CurrentCapacity']=parseInt(_0x505040[_0x7c57('0x4a')][_0x19c80b],0xa);}}}_0x373a4b[_0x7c57('0x3f')][_0x505040['id']][_0x7c57('0x4c')]();return _0x4045c9({'code':0xc8,'message':_0x373a4b[_0x7c57('0x3f')][_0x505040['id']]});}else{return _0x2fbc22(_0xdbddfa[_0x7c57('0x36')](0x1f4,_0x7c57('0x4d')));}});},'Agents':function(_0x18781a){return new Promise(function(_0x4cb334,_0x436c9a){var _0x4407ef=_[_0x7c57('0x4e')](_0x373a4b[_0x7c57('0x3f')]);_0x4cb334({'count':_0x4407ef['length'],'rows':_0x4407ef});});},'ChatQueues':function(_0x209545){return new Promise(function(_0x4a88a1,_0x15820b){var _0x4ead13=[];for(var _0x1c0676 in _0x373a4b[_0x7c57('0x4f')]){if(_0x373a4b[_0x7c57('0x4f')][_0x7c57('0x4b')](_0x1c0676)){var _0x41882a=_0x373a4b[_0x7c57('0x4f')][_0x1c0676];var _0xa3b052={'id':_0x41882a['id'],'available':_0x41882a[_0x7c57('0x50')],'loggedIn':_0x41882a[_0x7c57('0x51')],'name':_0x41882a[_0x7c57('0x52')],'paused':_0x41882a[_0x7c57('0x53')],'waiting':_0x41882a[_0x7c57('0x54')]};_0x4ead13[_0x7c57('0x22')](_0xa3b052);}}_0x4a88a1({'count':_0x4ead13[_0x7c57('0x1a')],'rows':_0x4ead13});});},'MailQueues':function(_0xdf9cfb){return new Promise(function(_0x4f65a3,_0x539dd4){var _0x2e7f2d=[];for(var _0x54221f in _0x373a4b['mailQueues']){if(_0x373a4b[_0x7c57('0x55')][_0x7c57('0x4b')](_0x54221f)){var _0x275f7c=_0x373a4b[_0x7c57('0x55')][_0x54221f];var _0x1c4219={'id':_0x275f7c['id'],'available':_0x275f7c[_0x7c57('0x50')],'loggedIn':_0x275f7c[_0x7c57('0x51')],'name':_0x275f7c['name'],'paused':_0x275f7c['paused'],'waiting':_0x275f7c[_0x7c57('0x54')]};_0x2e7f2d['push'](_0x1c4219);}}_0x4f65a3({'count':_0x2e7f2d[_0x7c57('0x1a')],'rows':_0x2e7f2d});});},'OpenchannelQueues':function(_0x52d643){return new Promise(function(_0x9b0eb4,_0x516be3){var _0x48d408=[];for(var _0x315854 in _0x373a4b['openchannelQueues']){if(_0x373a4b[_0x7c57('0x56')][_0x7c57('0x4b')](_0x315854)){var _0x10d976=_0x373a4b[_0x7c57('0x56')][_0x315854];var _0x3e0011={'id':_0x10d976['id'],'available':_0x10d976['available'],'loggedIn':_0x10d976[_0x7c57('0x51')],'name':_0x10d976[_0x7c57('0x52')],'paused':_0x10d976['paused'],'waiting':_0x10d976['waiting']};_0x48d408['push'](_0x3e0011);}}_0x9b0eb4({'count':_0x48d408[_0x7c57('0x1a')],'rows':_0x48d408});});},'SmsQueues':function(_0x187fd6){return new Promise(function(_0xa368f6,_0x433013){var _0x41b0f8=[];for(var _0xd2d549 in _0x373a4b[_0x7c57('0x57')]){if(_0x373a4b[_0x7c57('0x57')][_0x7c57('0x4b')](_0xd2d549)){var _0x4f6dcf=_0x373a4b['smsQueues'][_0xd2d549];var _0x4a903e={'id':_0x4f6dcf['id'],'available':_0x4f6dcf[_0x7c57('0x50')],'loggedIn':_0x4f6dcf[_0x7c57('0x51')],'name':_0x4f6dcf['name'],'paused':_0x4f6dcf['paused'],'waiting':_0x4f6dcf[_0x7c57('0x54')]};_0x41b0f8[_0x7c57('0x22')](_0x4a903e);}}_0xa368f6({'count':_0x41b0f8['length'],'rows':_0x41b0f8});});},'FaxQueues':function(_0x12cdbe){return new Promise(function(_0x5dd007,_0x2f9844){var _0x2313dc=[];for(var _0x4b7649 in _0x373a4b[_0x7c57('0x58')]){if(_0x373a4b['faxQueues'][_0x7c57('0x4b')](_0x4b7649)){var _0x852b1c=_0x373a4b['faxQueues'][_0x4b7649];var _0x335a1d={'id':_0x852b1c['id'],'available':_0x852b1c['available'],'loggedIn':_0x852b1c[_0x7c57('0x51')],'name':_0x852b1c[_0x7c57('0x52')],'paused':_0x852b1c['paused'],'waiting':_0x852b1c[_0x7c57('0x54')]};_0x2313dc['push'](_0x335a1d);}}_0x5dd007({'count':_0x2313dc['length'],'rows':_0x2313dc});});},'WhatsappQueues':function(_0x106c37){return new Promise(function(_0x8e2637,_0x4a169e){var _0x2bb3bb=[];for(var _0x2cb72a in _0x373a4b[_0x7c57('0x59')]){if(_0x373a4b['whatsappQueues']['hasOwnProperty'](_0x2cb72a)){var _0x5a32da=_0x373a4b['whatsappQueues'][_0x2cb72a];var _0x3bd0d6={'id':_0x5a32da['id'],'available':_0x5a32da[_0x7c57('0x50')],'loggedIn':_0x5a32da[_0x7c57('0x51')],'name':_0x5a32da[_0x7c57('0x52')],'paused':_0x5a32da[_0x7c57('0x53')],'waiting':_0x5a32da['waiting']};_0x2bb3bb[_0x7c57('0x22')](_0x3bd0d6);}}_0x8e2637({'count':_0x2bb3bb[_0x7c57('0x1a')],'rows':_0x2bb3bb});});},'ChatQueuesWaitingInteractions':function(_0xf22d4c){return new Promise(function(_0x1c328b,_0x516623){var _0x178530=_[_0x7c57('0x4e')](_0x373a4b[_0x7c57('0x5a')]);_0x1c328b({'count':_0x178530[_0x7c57('0x1a')],'rows':_0x178530});});},'MailQueuesWaitingInteractions':function(_0x5691d8){return new Promise(function(_0x1051e0,_0x19870a){var _0x4a7c71=_[_0x7c57('0x4e')](_0x373a4b['mailQueuesWaitingInteractions']);_0x1051e0({'count':_0x4a7c71[_0x7c57('0x1a')],'rows':_0x4a7c71});});},'OpenchannelQueuesWaitingInteractions':function(_0x556baf){return new Promise(function(_0xa52702,_0x449e3f){var _0x2e3850=_[_0x7c57('0x4e')](_0x373a4b['openchannelQueuesWaitingInteractions']);_0xa52702({'count':_0x2e3850[_0x7c57('0x1a')],'rows':_0x2e3850});});},'SmsQueuesWaitingInteractions':function(_0x272cc9){return new Promise(function(_0x7e72f1,_0x51b05c){var _0x47f097=_[_0x7c57('0x4e')](_0x373a4b[_0x7c57('0x5b')]);_0x7e72f1({'count':_0x47f097[_0x7c57('0x1a')],'rows':_0x47f097});});},'FaxQueuesWaitingInteractions':function(_0x100757){return new Promise(function(_0x3030eb,_0x4634b8){var _0x218ef7=_[_0x7c57('0x4e')](_0x373a4b[_0x7c57('0x5c')]);_0x3030eb({'count':_0x218ef7['length'],'rows':_0x218ef7});});},'WhatsappQueuesWaitingInteractions':function(_0x3d51ce){return new Promise(function(_0x4a1459,_0x22f41e){var _0x1eb2c4=_[_0x7c57('0x4e')](_0x373a4b[_0x7c57('0x5d')]);_0x4a1459({'count':_0x1eb2c4[_0x7c57('0x1a')],'rows':_0x1eb2c4});});}};var _0x3167b8=jayson[_0x7c57('0x5e')](_0x11903b)[_0x7c57('0x5f')]();_0x3167b8['on'](_0x7c57('0x36'),function(_0x52fe57){logger['error'](JSON[_0x7c57('0x60')](_0x52fe57));return _0x2ce3ca(_0x52fe57);});_0x3167b8['listen'](0x232c,'127.0.0.1',function(){console[_0x7c57('0x61')](_0x7c57('0x62'),0x232c);return _0x43d1fd('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xb688=['openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length','existsSync','join','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','priority','info','on\x20interval','\x20|\x20','error','app','.js','rules','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','end','QueueReport','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','openchannelQueues','name','paused','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xb688,0xcf));var _0x8b68=function(_0x3671b9,_0x4d51a2){_0x3671b9=_0x3671b9-0x0;var _0x25eea0=_0xb688[_0x3671b9];return _0x25eea0;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var fs=require('fs');var jayson=require(_0x8b68('0x2'));var BPromise=require(_0x8b68('0x3'));var uuid=require(_0x8b68('0x4'));var utils=require(_0x8b68('0x5'));var config=require('../../../config/environment');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var rpc={'openchannelQueueReport':require(_0x8b68('0x8')),'mailQueueReport':require(_0x8b68('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x8b68('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8b68('0xb'))};var RuleEngine=require(_0x8b68('0xc'));function getId(_0x130892,_0xa5571b,_0x132617){return util[_0x8b68('0xd')](_0x8b68('0xe'),_0x130892,_0xa5571b||0x0,_0x132617||0x0);}function getIntervals(_0x21d944,_0x24e0b0){var _0x2f2e3c=[];if(!_[_0x8b68('0xf')](_0x24e0b0[_0x8b68('0x10')])&&!_[_0x8b68('0xf')](_0x21d944[_0x24e0b0['IntervalId']])&&!_[_0x8b68('0xf')](_0x21d944[_0x24e0b0[_0x8b68('0x10')]][_0x8b68('0x11')])){_0x2f2e3c=_[_0x8b68('0x12')](_0x21d944[_0x24e0b0[_0x8b68('0x10')]][_0x8b68('0x11')],_0x8b68('0x13'));}else if(!_[_0x8b68('0xf')](_0x24e0b0[_0x8b68('0x13')])){_0x2f2e3c=[_0x24e0b0['interval']];}return _0x2f2e3c;}exports[_0x8b68('0x14')]=function(_0x509033){_0x509033['rules']={};return new BPromise(function(_0x22f75b,_0x1554d6){var _0x27d717={'Start':function(_0x5d3468){var _0x5c8d0e=this;return new Promise(function(_0x23bd52,_0x5c1e44){if(_0x5d3468){try{var _0x136f1b=[];var _0xb44923=getId(_0x5d3468[_0x8b68('0x15')],_0x5d3468[_0x8b68('0x16')]?_0x5d3468['message']['id']:0x0,_0x5d3468[_0x8b68('0x17')]?_0x5d3468[_0x8b68('0x17')]['id']:0x0);if(_0x5d3468['applications']&&_[_0x8b68('0x18')](_0x5d3468[_0x8b68('0x19')])&&_0x5d3468[_0x8b68('0x19')][_0x8b68('0x1a')]){for(var _0x38b7a7=0x0;_0x38b7a7<_0x5d3468['applications'][_0x8b68('0x1a')];_0x38b7a7+=0x1){var _0x4b4b0f=_0x5d3468[_0x8b68('0x19')][_0x38b7a7];if(fs[_0x8b68('0x1b')](path[_0x8b68('0x1c')](__dirname,_0x8b68('0x19'),_0x4b4b0f['app']+'.js'))){var _0x23edc1=[];switch(_0x4b4b0f['app'][_0x8b68('0x1d')]()){case _0x8b68('0x1e'):var _0x13aee5=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');if(_0x5d3468[_0x8b68('0x15')]==='mail'){_0x23edc1[_0x8b68('0x21')](_0x13aee5[0x0]);_0x23edc1[_0x8b68('0x21')](_0x13aee5[0x1]);_0x23edc1['push'](_0x13aee5[_0x8b68('0x22')](0x2,_0x13aee5[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));}else{_0x23edc1['push'](_0x13aee5[0x0]);_0x23edc1['push'](_0x13aee5['slice'](0x1,_0x13aee5[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));}break;case _0x8b68('0x23'):var _0x583476=_0x4b4b0f[_0x8b68('0x1f')]['split'](',');_0x23edc1['push'](_0x583476[0x0]);_0x23edc1[_0x8b68('0x21')](_0x583476[0x1]);_0x23edc1['push'](_0x583476[_0x8b68('0x22')](0x2,_0x583476[_0x8b68('0x1a')])['join'](','));break;case'dialogflowv2':var _0x357635=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x357635[0x0]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x1]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x2]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x3]);_0x23edc1['push'](_0x357635[_0x8b68('0x22')](0x4,_0x357635['length'])[_0x8b68('0x1c')](','));break;case _0x8b68('0x24'):var _0x4c276f=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x4c276f[0x0]);_0x23edc1['push'](_0x4c276f[0x1]);_0x23edc1['push'](_0x4c276f[0x2]);_0x23edc1[_0x8b68('0x21')](_0x4c276f[0x3]);_0x23edc1[_0x8b68('0x21')](_0x4c276f[_0x8b68('0x22')](0x4,_0x4c276f[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));break;case _0x8b68('0x16'):_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x1f')]);break;case _0x8b68('0x25'):_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x26')]);_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x1f')]);break;case _0x8b68('0x27'):var _0x10aca9=utils[_0x8b68('0x28')](_0x5d3468[_0x8b68('0x29')][_0x8b68('0x2a')],_0x5d3468);var _0x120b34=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x120b34[0x0]);_0x23edc1['push'](_0x120b34[0x1]);_0x23edc1['push'](_0x120b34[0x2]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x3]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x4]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x5]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x6]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x7]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x8]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x9]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0xa]);_0x23edc1['push'](_0x5d3468[_0x8b68('0x17')]['id']);_0x23edc1[_0x8b68('0x21')](_0x5d3468[_0x8b68('0x16')]['id']);_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x2b')]);_0x23edc1[_0x8b68('0x21')](_0x5d3468[_0x8b68('0x17')][_0x8b68('0x2c')]);_0x23edc1['push'](_0x5d3468[_0x8b68('0x2d')][_0x8b68('0x2d')]);_0x23edc1[_0x8b68('0x21')](_0x10aca9);break;default:_0x23edc1=_[_0x8b68('0xf')](_0x4b4b0f[_0x8b68('0x1f')])?[]:_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');}var _0x50a9c6={'id':util[_0x8b68('0xd')](_0x8b68('0x2e'),_0xb44923,_0x4b4b0f['id'],_0x4b4b0f['app']),'condition':require(_0x8b68('0x2f'))[_0x8b68('0x30')](_0xb44923,getIntervals(_0x509033['intervals'],_0x4b4b0f),_0x509033),'consequence':require('./applications/'+_0x4b4b0f['app'])['consequence'](_0xb44923,_0x23edc1,_0x509033,_0x5d3468),'p':_0x4b4b0f[_0x8b68('0x31')]||0x0};logger[_0x8b68('0x32')]('Push\x20new\x20rule',_0x50a9c6['id'],_0x8b68('0x33'),getIntervals(_0x509033['intervals'],_0x4b4b0f)[_0x8b68('0x1c')](_0x8b68('0x34')));_0x136f1b['push'](_0x50a9c6);}else{logger[_0x8b68('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x4b4b0f[_0x8b68('0x36')]+_0x8b68('0x37')));}}_0x509033[_0x8b68('0x38')][_0xb44923]=new RuleEngine(_0x136f1b);_0x509033[_0x8b68('0x38')][_0xb44923]['execute'](_0x5d3468,function(_0x20162a){logger['info'](_0x8b68('0x39'),JSON[_0x8b68('0x3a')](_0x20162a['matchPath']));if(_0x509033[_0x8b68('0x38')][_0xb44923]){_0x509033[_0x8b68('0x38')][_0xb44923][_0x8b68('0x3b')](_0x8b68('0x3c'));}});return _0x23bd52({'code':0xc8,'message':_0x5d3468});}else{logger['info'](_0x8b68('0x3d'));return _0x23bd52({'code':0xc8,'message':_0x5d3468});}}catch(_0x478527){logger[_0x8b68('0x35')](_0x478527[_0x8b68('0x3e')]);return _0x5c1e44(_0x5c8d0e[_0x8b68('0x35')](0x1f4,_0x478527));}}return _0x5c1e44(_0x8b68('0x3f'));});},'AcceptMessage':function(_0x41d9a2){var _0x69fdbe=this;return new Promise(function(_0x29e265,_0x20df07){if(_0x41d9a2[_0x8b68('0x40')]&&_0x41d9a2[_0x8b68('0x40')]['id']){if(_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]){_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]['busy']=![];_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]['busyQueue']=undefined;}}if(_0x41d9a2[_0x8b68('0x16')]&&_0x41d9a2['message']['id']){try{var _0x58cf66=getId(_0x41d9a2['channel'],_0x41d9a2[_0x8b68('0x16')]?_0x41d9a2[_0x8b68('0x16')]['id']:0x0,_0x41d9a2[_0x8b68('0x17')]?_0x41d9a2[_0x8b68('0x17')]['id']:0x0);if(_0x509033['rules'][_0x58cf66]){_0x509033['rules'][_0x58cf66][_0x8b68('0x3b')](_0x8b68('0x42'));if(rpc[_0x41d9a2[_0x8b68('0x15')]+'QueueReport']){rpc[_0x41d9a2[_0x8b68('0x15')]+_0x8b68('0x43')]['update'](_0x58cf66,{'UserId':_0x41d9a2[_0x8b68('0x16')][_0x8b68('0x44')]})['catch'](function(_0x18a9ae){logger[_0x8b68('0x35')]('error\x20update\x20queue\x20report');});}}return _0x29e265({'code':0xc8,'message':_0x41d9a2});}catch(_0x3f7f89){logger[_0x8b68('0x35')](_0x3f7f89['stack']);return _0x20df07(_0x69fdbe['error'](0x1f4,_0x3f7f89));}}logger['error'](_0x8b68('0x45'));return _0x20df07(_0x69fdbe[_0x8b68('0x35')](0x1f4,_0x8b68('0x45')));});},'RejectMessage':function(_0x3d4b4f){var _0x55aad3=this;return new Promise(function(_0x5a1711,_0x4492fd){if(_0x3d4b4f[_0x8b68('0x40')]&&_0x3d4b4f[_0x8b68('0x40')]['id']){try{if(_0x509033['agents'][_0x3d4b4f[_0x8b68('0x40')]['id']]){_0x509033[_0x8b68('0x41')][_0x3d4b4f[_0x8b68('0x40')]['id']]['busy']=![];_0x509033[_0x8b68('0x41')][_0x3d4b4f['agent']['id']][_0x8b68('0x46')]=undefined;}return _0x5a1711({'code':0xc8,'message':_0x3d4b4f});}catch(_0x3efb0e){logger['error'](_0x3efb0e[_0x8b68('0x3e')]);return _0x4492fd(_0x55aad3[_0x8b68('0x35')](0x1f4,_0x3efb0e));}}logger[_0x8b68('0x35')](_0x8b68('0x45'));return _0x4492fd(_0x55aad3[_0x8b68('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x241166){var _0x3f3e43=this;return new Promise(function(_0x32cd05,_0x31a090){if(_0x241166[_0x8b68('0x15')]&&_0x241166[_0x8b68('0x17')]&&_0x241166[_0x8b68('0x17')]['id']){try{var _0x3096b3=getId(_0x241166['channel'],_0x241166[_0x8b68('0x16')]?_0x241166[_0x8b68('0x16')]['id']:0x0,_0x241166[_0x8b68('0x17')]?_0x241166[_0x8b68('0x17')]['id']:0x0);if(_0x509033[_0x8b68('0x38')][_0x3096b3]){_0x509033[_0x8b68('0x38')][_0x3096b3][_0x8b68('0x3b')](_0x8b68('0x42'));}return _0x32cd05({'code':0xc8,'message':_0x241166});}catch(_0x6d63cb){logger[_0x8b68('0x35')](_0x6d63cb[_0x8b68('0x3e')]);return _0x31a090(_0x3f3e43[_0x8b68('0x35')](0x1f4,_0x6d63cb));}}logger[_0x8b68('0x35')](_0x8b68('0x45'));return _0x31a090(_0x3f3e43[_0x8b68('0x35')](0x1f4,_0x8b68('0x45')));});},'AgentCapacity':function(_0xf07a90){var _0x3da7b4=this;return new Promise(function(_0xae90f0,_0x1de9ce){if(_0x509033['agents'][_0x8b68('0x47')](_0xf07a90['id'])){for(var _0x51e17b in _0xf07a90['capacity']){if(_0xf07a90[_0x8b68('0x48')]['hasOwnProperty'](_0x51e17b)){if(_0x509033[_0x8b68('0x41')][_0xf07a90['id']][_0x8b68('0x47')](_0x51e17b+_0x8b68('0x49'))){_0x509033['agents'][_0xf07a90['id']][_0x51e17b+_0x8b68('0x49')]=parseInt(_0xf07a90[_0x8b68('0x48')][_0x51e17b],0xa);}}}_0x509033[_0x8b68('0x41')][_0xf07a90['id']][_0x8b68('0x4a')]();return _0xae90f0({'code':0xc8,'message':_0x509033[_0x8b68('0x41')][_0xf07a90['id']]});}else{return _0x1de9ce(_0x3da7b4[_0x8b68('0x35')](0x1f4,_0x8b68('0x4b')));}});},'Agents':function(_0x4f0aff){return new Promise(function(_0x586a5e,_0x20aac1){var _0x4224f5=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x41')]);_0x586a5e({'count':_0x4224f5[_0x8b68('0x1a')],'rows':_0x4224f5});});},'ChatQueues':function(_0x37da34){return new Promise(function(_0x2d1519,_0x314f1e){var _0x3bf22b=[];for(var _0x36d47a in _0x509033[_0x8b68('0x4d')]){if(_0x509033[_0x8b68('0x4d')][_0x8b68('0x47')](_0x36d47a)){var _0x195f82=_0x509033[_0x8b68('0x4d')][_0x36d47a];var _0x414096={'id':_0x195f82['id'],'available':_0x195f82[_0x8b68('0x4e')],'loggedIn':_0x195f82[_0x8b68('0x4f')],'name':_0x195f82['name'],'paused':_0x195f82['paused'],'waiting':_0x195f82[_0x8b68('0x50')]};_0x3bf22b[_0x8b68('0x21')](_0x414096);}}_0x2d1519({'count':_0x3bf22b['length'],'rows':_0x3bf22b});});},'MailQueues':function(_0x48d57a){return new Promise(function(_0x574aca,_0x39a04e){var _0x3d6c17=[];for(var _0xd5f52e in _0x509033[_0x8b68('0x51')]){if(_0x509033[_0x8b68('0x51')]['hasOwnProperty'](_0xd5f52e)){var _0x1c358b=_0x509033[_0x8b68('0x51')][_0xd5f52e];var _0x5c24f8={'id':_0x1c358b['id'],'available':_0x1c358b[_0x8b68('0x4e')],'loggedIn':_0x1c358b['loggedIn'],'name':_0x1c358b['name'],'paused':_0x1c358b['paused'],'waiting':_0x1c358b[_0x8b68('0x50')]};_0x3d6c17[_0x8b68('0x21')](_0x5c24f8);}}_0x574aca({'count':_0x3d6c17[_0x8b68('0x1a')],'rows':_0x3d6c17});});},'OpenchannelQueues':function(_0x7269fd){return new Promise(function(_0x864b6b,_0x1fc24c){var _0x35b22b=[];for(var _0x34456d in _0x509033[_0x8b68('0x52')]){if(_0x509033[_0x8b68('0x52')]['hasOwnProperty'](_0x34456d)){var _0x3a8d15=_0x509033[_0x8b68('0x52')][_0x34456d];var _0x310ec9={'id':_0x3a8d15['id'],'available':_0x3a8d15['available'],'loggedIn':_0x3a8d15['loggedIn'],'name':_0x3a8d15[_0x8b68('0x53')],'paused':_0x3a8d15[_0x8b68('0x54')],'waiting':_0x3a8d15['waiting']};_0x35b22b[_0x8b68('0x21')](_0x310ec9);}}_0x864b6b({'count':_0x35b22b[_0x8b68('0x1a')],'rows':_0x35b22b});});},'SmsQueues':function(_0x29bff7){return new Promise(function(_0x2c2f6d,_0x50fd2c){var _0x96e526=[];for(var _0x4925a4 in _0x509033['smsQueues']){if(_0x509033[_0x8b68('0x55')]['hasOwnProperty'](_0x4925a4)){var _0xe9550=_0x509033[_0x8b68('0x55')][_0x4925a4];var _0x5e40f4={'id':_0xe9550['id'],'available':_0xe9550[_0x8b68('0x4e')],'loggedIn':_0xe9550[_0x8b68('0x4f')],'name':_0xe9550[_0x8b68('0x53')],'paused':_0xe9550[_0x8b68('0x54')],'waiting':_0xe9550[_0x8b68('0x50')]};_0x96e526['push'](_0x5e40f4);}}_0x2c2f6d({'count':_0x96e526[_0x8b68('0x1a')],'rows':_0x96e526});});},'FaxQueues':function(_0x2e6daf){return new Promise(function(_0xa0ed41,_0x2f87e8){var _0x34c7d8=[];for(var _0x49efb7 in _0x509033['faxQueues']){if(_0x509033[_0x8b68('0x56')]['hasOwnProperty'](_0x49efb7)){var _0x2d442a=_0x509033[_0x8b68('0x56')][_0x49efb7];var _0x16e769={'id':_0x2d442a['id'],'available':_0x2d442a[_0x8b68('0x4e')],'loggedIn':_0x2d442a[_0x8b68('0x4f')],'name':_0x2d442a[_0x8b68('0x53')],'paused':_0x2d442a[_0x8b68('0x54')],'waiting':_0x2d442a['waiting']};_0x34c7d8[_0x8b68('0x21')](_0x16e769);}}_0xa0ed41({'count':_0x34c7d8['length'],'rows':_0x34c7d8});});},'WhatsappQueues':function(_0x3aaaed){return new Promise(function(_0x2caa28,_0xc8c3c){var _0x4e0fb4=[];for(var _0x3141d3 in _0x509033['whatsappQueues']){if(_0x509033[_0x8b68('0x57')]['hasOwnProperty'](_0x3141d3)){var _0x3da555=_0x509033[_0x8b68('0x57')][_0x3141d3];var _0x644d83={'id':_0x3da555['id'],'available':_0x3da555['available'],'loggedIn':_0x3da555[_0x8b68('0x4f')],'name':_0x3da555[_0x8b68('0x53')],'paused':_0x3da555[_0x8b68('0x54')],'waiting':_0x3da555[_0x8b68('0x50')]};_0x4e0fb4[_0x8b68('0x21')](_0x644d83);}}_0x2caa28({'count':_0x4e0fb4[_0x8b68('0x1a')],'rows':_0x4e0fb4});});},'ChatQueuesWaitingInteractions':function(_0x33a02f){return new Promise(function(_0x3ae1f8,_0x395b82){var _0x5a807b=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x58')]);_0x3ae1f8({'count':_0x5a807b[_0x8b68('0x1a')],'rows':_0x5a807b});});},'MailQueuesWaitingInteractions':function(_0x1e4c28){return new Promise(function(_0x71095b,_0x543468){var _0x3dfd43=_['values'](_0x509033[_0x8b68('0x59')]);_0x71095b({'count':_0x3dfd43[_0x8b68('0x1a')],'rows':_0x3dfd43});});},'OpenchannelQueuesWaitingInteractions':function(_0x524763){return new Promise(function(_0x20c8b4,_0x75af51){var _0xa7890f=_['values'](_0x509033[_0x8b68('0x5a')]);_0x20c8b4({'count':_0xa7890f[_0x8b68('0x1a')],'rows':_0xa7890f});});},'SmsQueuesWaitingInteractions':function(_0x43a874){return new Promise(function(_0x3b260a,_0x115cb7){var _0x42464c=_['values'](_0x509033[_0x8b68('0x5b')]);_0x3b260a({'count':_0x42464c[_0x8b68('0x1a')],'rows':_0x42464c});});},'FaxQueuesWaitingInteractions':function(_0x3d38eb){return new Promise(function(_0x4e5d13,_0x45e75f){var _0xde4083=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x5c')]);_0x4e5d13({'count':_0xde4083[_0x8b68('0x1a')],'rows':_0xde4083});});},'WhatsappQueuesWaitingInteractions':function(_0x377045){return new Promise(function(_0x320f42,_0x4e49ec){var _0x23cc54=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x5d')]);_0x320f42({'count':_0x23cc54['length'],'rows':_0x23cc54});});}};var _0x570629=jayson[_0x8b68('0x5e')](_0x27d717)[_0x8b68('0x5f')]();_0x570629['on'](_0x8b68('0x35'),function(_0x131a30){logger[_0x8b68('0x35')](JSON['stringify'](_0x131a30));return _0x1554d6(_0x131a30);});_0x570629[_0x8b68('0x14')](0x232c,_0x8b68('0x60'),function(){console[_0x8b68('0x61')](_0x8b68('0x62'),0x232c);return _0x22f75b('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 2cfaef2..9d646c7 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 _0xa4b9=['request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','jayson/promise','lodash','routing','http'];(function(_0x4a1865,_0x8b5329){var _0x18f3f4=function(_0x8d7a14){while(--_0x8d7a14){_0x4a1865['push'](_0x4a1865['shift']());}};_0x18f3f4(++_0x8b5329);}(_0xa4b9,0x19f));var _0x9a4b=function(_0x1def75,_0x28303){_0x1def75=_0x1def75-0x0;var _0xb37bf2=_0xa4b9[_0x1def75];return _0xb37bf2;};'use strict';var util=require(_0x9a4b('0x0'));var BPromise=require('bluebird');var jayson=require(_0x9a4b('0x1'));var _=require(_0x9a4b('0x2'));var logger=require('../../../config/logger')(_0x9a4b('0x3'));var client=jayson['client'][_0x9a4b('0x4')]({'port':0x232a});function request(_0x5a30a6,_0x2b4738){return new BPromise(function(_0x5bbb76,_0x30d5c5){return client[_0x9a4b('0x5')](_0x5a30a6,_0x2b4738)[_0x9a4b('0x6')](function(_0x33f071){if(_0x33f071[_0x9a4b('0x7')]){return _0x30d5c5(_0x33f071[_0x9a4b('0x7')][_0x9a4b('0x8')]);}else{return _0x5bbb76(_0x33f071[_0x9a4b('0x9')]);}})[_0x9a4b('0xa')](function(_0x2295c5){return _0x30d5c5(_0x2295c5);});});}exports[_0x9a4b('0xb')]=function(_0x3c6647,_0x19950c,_0x443948){return function(_0x526ae3){if(_0x443948[_0x9a4b('0xc')]&&!_0x443948['rules'][_0x3c6647]){logger['info'](_0x9a4b('0xd'),_0x3c6647);return _0x526ae3[_0x9a4b('0xe')]();}var _0x3c30f8=[];for(var _0x151ead=0x0;_0x151ead<_0x19950c[_0x9a4b('0xf')];_0x151ead+=0x1){_0x3c30f8[_0x9a4b('0x10')](request(_0x9a4b('0x11'),{'command':util[_0x9a4b('0x12')](_0x9a4b('0x13'),_0x19950c[_0x151ead])})[_0x9a4b('0x6')](function(_0x20ab89){return _0x20ab89&&_0x20ab89['message']&&_0x20ab89[_0x9a4b('0x8')][_0x9a4b('0x14')](_0x9a4b('0x15'))>=0x0?!![]:![];})[_0x9a4b('0xa')](function(_0x37bd7c){logger['error'](_0x9a4b('0x16'),_0x3c6647,_0x19950c[_0x151ead]);}));}BPromise['all'](_0x3c30f8)['then'](function(_0xfc76be){var _0x2f024d=_['some'](_0xfc76be);logger[_0x9a4b('0x17')](_0x9a4b('0x18'),_0x3c6647,_0x19950c[_0x9a4b('0x19')](_0x9a4b('0x1a')),_0x2f024d);_0x526ae3[_0x9a4b('0x1b')](_0x2f024d);})['catch'](function(_0x2c64df){console['log'](_0x2c64df);logger[_0x9a4b('0x7')](_0x9a4b('0x18'),_0x3c6647,_0x19950c[_0x9a4b('0x19')](_0x9a4b('0x1a')),_0x2c64df['stack']);_0x526ae3[_0x9a4b('0xe')]();});};}; \ No newline at end of file +var _0x98b4=['[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stop','bluebird','jayson/promise','../../../config/logger','routing','client','http','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','Command','true','[%s][INTERVAL]\x20%s','some'];(function(_0x448a56,_0x3cd4d1){var _0x1ba466=function(_0x39feff){while(--_0x39feff){_0x448a56['push'](_0x448a56['shift']());}};_0x1ba466(++_0x3cd4d1);}(_0x98b4,0x10e));var _0x498b=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x98b4[_0x1ccdf7];return _0x52a0ae;};'use strict';var util=require('util');var BPromise=require(_0x498b('0x0'));var jayson=require(_0x498b('0x1'));var _=require('lodash');var logger=require(_0x498b('0x2'))(_0x498b('0x3'));var client=jayson[_0x498b('0x4')][_0x498b('0x5')]({'port':0x232a});function request(_0x57a77a,_0x395a17){return new BPromise(function(_0x4b6740,_0x5a6846){return client['request'](_0x57a77a,_0x395a17)[_0x498b('0x6')](function(_0x1d7ca5){if(_0x1d7ca5[_0x498b('0x7')]){return _0x5a6846(_0x1d7ca5[_0x498b('0x7')][_0x498b('0x8')]);}else{return _0x4b6740(_0x1d7ca5['result']);}})[_0x498b('0x9')](function(_0x325e4a){return _0x5a6846(_0x325e4a);});});}exports[_0x498b('0xa')]=function(_0x2077ff,_0x581b02,_0x190b79){return function(_0x41dde1){if(_0x190b79['rules']&&!_0x190b79[_0x498b('0xb')][_0x2077ff]){logger[_0x498b('0xc')](_0x498b('0xd'),_0x2077ff);return _0x41dde1['stop']();}var _0x1c2813=[];for(var _0x20ad45=0x0;_0x20ad45<_0x581b02['length'];_0x20ad45+=0x1){_0x1c2813['push'](request(_0x498b('0xe'),{'command':util['format']('iftime\x20%s',_0x581b02[_0x20ad45])})[_0x498b('0x6')](function(_0xe5534b){return _0xe5534b&&_0xe5534b[_0x498b('0x8')]&&_0xe5534b[_0x498b('0x8')]['indexOf'](_0x498b('0xf'))>=0x0?!![]:![];})[_0x498b('0x9')](function(_0x10d21f){logger['error'](_0x498b('0x10'),_0x2077ff,_0x581b02[_0x20ad45]);}));}BPromise['all'](_0x1c2813)[_0x498b('0x6')](function(_0x1a15e3){var _0x53fca7=_[_0x498b('0x11')](_0x1a15e3);logger[_0x498b('0xc')](_0x498b('0x12'),_0x2077ff,_0x581b02['join']('\x20|\x20'),_0x53fca7);_0x41dde1[_0x498b('0x13')](_0x53fca7);})['catch'](function(_0x110f1d){console[_0x498b('0x14')](_0x110f1d);logger[_0x498b('0x7')](_0x498b('0x12'),_0x2077ff,_0x581b02[_0x498b('0x15')](_0x498b('0x16')),_0x110f1d['stack']);_0x41dde1[_0x498b('0x17')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 9339df8..47aacd4 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 _0xeffd=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','push','[%s][agents][agentringnoanswer]','forIn','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid'];(function(_0x39294a,_0x3bf6a4){var _0xc41dca=function(_0x567e96){while(--_0x567e96){_0x39294a['push'](_0x39294a['shift']());}};_0xc41dca(++_0x3bf6a4);}(_0xeffd,0x6b));var _0xdeff=function(_0x5373d0,_0x4d40da){_0x5373d0=_0x5373d0-0x0;var _0x94540e=_0xeffd[_0x5373d0];return _0x94540e;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var utils=require(_0xdeff('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xd8f1d6,_0x281a05){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x4'),_0xd8f1d6[_0xdeff('0x5')],_0xd8f1d6[_0xdeff('0x6')],_0xd8f1d6[_0xdeff('0x7')],_0xd8f1d6[_0xdeff('0x8')],_0xd8f1d6[_0xdeff('0x9')],_0xd8f1d6[_0xdeff('0xa')],_0xd8f1d6[_0xdeff('0xb')],_0xd8f1d6[_0xdeff('0xc')]));if(_0xd8f1d6[_0xdeff('0x7')]){utils[_0xdeff('0xd')](_0xd8f1d6[_0xdeff('0x7')])['then'](function(_0x3ae201){if(_0x3ae201){_0xd8f1d6[_0xdeff('0xe')]=_0x3ae201[_0xdeff('0xe')];_0xd8f1d6['agentacw']=_0xd8f1d6[_0xdeff('0xf')]?_0x3ae201[_0xdeff('0x10')]:![];_0xd8f1d6[_0xdeff('0x11')]=_0xd8f1d6[_0xdeff('0x12')]?_0x3ae201[_0xdeff('0x13')]:0x0;}utils[_0xdeff('0x14')](_0xdeff('0x15'),_0xd8f1d6);});}else{utils[_0xdeff('0x14')]('CreateVoiceAgentReport',_0xd8f1d6);}if(_0x281a05){delete transfers[_0xd8f1d6[_0xdeff('0x5')]];}else{delete agents[_0xd8f1d6[_0xdeff('0x16')]];}}exports['agentcalled']=function(_0x2e614c){try{utils['debug'](util['format'](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x2e614c);agents[_0x2e614c[_0xdeff('0x16')]]=_0x2e614c;agents[_0x2e614c[_0xdeff('0x16')]]['agentcalledAt']=utils[_0xdeff('0x18')]();agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x19');agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xb')]=null;agents[_0x2e614c['destuniqueid']]['connectedlinename']=null;utils[_0xdeff('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2e614c[_0xdeff('0x5')],agents[_0x2e614c[_0xdeff('0x16')]]['membername'],_0x2e614c[_0xdeff('0x16')]));}catch(_0x42e98e){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x42e98e);}};exports[_0xdeff('0x1b')]=function(_0x919c93){try{if(!_['isNil'](agents[_0x919c93['destuniqueid']])){utils['debug'](util[_0xdeff('0x3')]('[%s][agents][agentringnoanswer]',_0x919c93[_0xdeff('0x5')]),_0x919c93);utils[_0xdeff('0x2')](util['format'](_0xdeff('0x1c'),_0x919c93[_0xdeff('0x5')],agents[_0x919c93['destuniqueid']]['membername'],_0x919c93[_0xdeff('0x16')]));agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1b')]=!![];agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1d')]=utils['now']();agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1f')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]]['holdtime']=_0x919c93[_0xdeff('0x20')]?parseInt(_0x919c93[_0xdeff('0x20')])/0x3e8:0x0;agents[_0x919c93['destuniqueid']]['talktime']=0x0;unanswered[_0xdeff('0x21')](_0x919c93[_0xdeff('0x16')]);}}catch(_0x16b2d0){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x22'),_0x919c93[_0xdeff('0x5')]),_0x16b2d0);}};exports['queuecallerabandon']=function(_0x331ddc){try{_[_0xdeff('0x23')](agents,function(_0x34e258,_0x5045b8){if(_0x34e258['uniqueid']==_0x331ddc[_0xdeff('0x5')]&&!_['includes'](unanswered,_0x34e258[_0xdeff('0x16')])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][queuecallerabandon]',_0x331ddc[_0xdeff('0x5')]),_0x331ddc);utils['info'](util['format'](_0xdeff('0x25'),_0x331ddc[_0xdeff('0x5')],_0x34e258[_0xdeff('0x8')],_0x34e258[_0xdeff('0x16')]));_0x34e258['agentringnoanswer']=!![];_0x34e258[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x34e258[_0xdeff('0xc')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x1f')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x27')]=_0x331ddc['holdtime'];_0x34e258[_0xdeff('0x28')]=0x0;writeDB(_0x34e258);}});}catch(_0x5cef77){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x29'),_0x331ddc[_0xdeff('0x5')]),_0x5cef77);}};exports[_0xdeff('0x2a')]=function(_0x965c5b){try{if(agents[_0x965c5b['destuniqueid']]){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentconnect]',_0x965c5b[_0xdeff('0x5')]),_0x965c5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x2b'),_0x965c5b[_0xdeff('0x5')],agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x965c5b[_0xdeff('0x16')]));agents[_0x965c5b['destuniqueid']][_0xdeff('0x2c')]=utils['now']();agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0xb')]=_0x965c5b[_0xdeff('0xb')];agents[_0x965c5b['destuniqueid']][_0xdeff('0x2d')]=_0x965c5b[_0xdeff('0x2d')];agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x27')]=_0x965c5b[_0xdeff('0x20')];agents[_0x965c5b['destuniqueid']][_0xdeff('0xc')]='connect';_[_0xdeff('0x23')](agents,function(_0x14f1d0,_0x518280){if(_0x14f1d0[_0xdeff('0x16')]!=_0x965c5b[_0xdeff('0x16')]&&_0x14f1d0[_0xdeff('0x5')]==_0x965c5b[_0xdeff('0x5')]){_0x14f1d0[_0xdeff('0x28')]=0x0;_0x14f1d0['holdtime']=_0x965c5b[_0xdeff('0x20')];_0x14f1d0[_0xdeff('0x1b')]=!![];_0x14f1d0[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x14f1d0[_0xdeff('0xc')]='answered_elsewhere';_0x14f1d0['reason']=_0xdeff('0x2e');_0x14f1d0[_0xdeff('0x2f')]=_0x965c5b[_0xdeff('0x16')];_0x14f1d0[_0xdeff('0x30')]=_0x965c5b[_0xdeff('0x8')];writeDB(_0x14f1d0);}});}}catch(_0x289f70){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x31'),_0x965c5b[_0xdeff('0x5')]),_0x289f70);}};exports[_0xdeff('0xf')]=function(_0x54fa5b){try{if(!_[_0xdeff('0x32')](agents[_0x54fa5b[_0xdeff('0x16')]])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0x54fa5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x33'),_0x54fa5b[_0xdeff('0x5')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x54fa5b[_0xdeff('0x16')]));agents[_0x54fa5b['destuniqueid']][_0xdeff('0xf')]=!![];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')]=utils[_0xdeff('0x18')]();agents[_0x54fa5b[_0xdeff('0x16')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x2c')]);agents[_0x54fa5b['destuniqueid']][_0xdeff('0x1f')]=_0x54fa5b['reason'];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x36');writeDB(agents[_0x54fa5b[_0xdeff('0x16')]]);}}catch(_0xf58aa6){utils[_0xdeff('0x1a')](util['format']('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0xf58aa6);}};exports[_0xdeff('0x37')]=function(_0x3dc206){try{if(!_['isNil'](agents[_0x3dc206['transfereruniqueid']])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]',_0x3dc206[_0xdeff('0x5')]),_0x3dc206);utils[_0xdeff('0x2')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x3dc206[_0xdeff('0x5')],agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x8')],agents[_0x3dc206['transfereruniqueid']][_0xdeff('0x5')]));agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x39')]=!![];agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x3a')]=_0xdeff('0x3b');agents[_0x3dc206[_0xdeff('0x38')]]['transferexten']=_0x3dc206[_0xdeff('0x3c')];agents[_0x3dc206[_0xdeff('0x38')]]['transferuniqueid']=agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x5')];}}catch(_0x2967b4){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3d'),_0x3dc206[_0xdeff('0x5')]),_0x2967b4);}};exports[_0xdeff('0x3e')]=function(_0x5ca032){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032['origtransfereruniqueid']),_0x5ca032);if(_0x5ca032['origtransfereruniqueid']==_0x5ca032[_0xdeff('0x40')]){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x41')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032['origtransfereruniqueid'],agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x41')]]['transfer']=!![];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x3a')]=_0xdeff('0x43');agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x44')]=_0x5ca032[_0xdeff('0x45')];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032[_0xdeff('0x47')];}if(_0x5ca032['transfereeuniqueid']&&agents[_0x5ca032[_0xdeff('0x48')]]){agents[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x48')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x48')]]);transfers[_0x5ca032['transfereeuniqueid']]['calleridnum']=agents[_0x5ca032[_0xdeff('0x41')]]['calleridnum'];transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x4a')]=agents[_0x5ca032[_0xdeff('0x41')]][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x48')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x2c')]=utils[_0xdeff('0x18')]();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x2;}}else if(_0x5ca032[_0xdeff('0x41')]==_0x5ca032['secondtransfererlinkedid']){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x47')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032[_0xdeff('0x47')],agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x47')]]['transfer']=!![];agents[_0x5ca032[_0xdeff('0x47')]]['transfertype']=_0xdeff('0x43');agents[_0x5ca032[_0xdeff('0x47')]]['transferexten']=_0x5ca032[_0xdeff('0x4b')];agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032['secondtransfereruniqueid'];}if(_0x5ca032['transfertargetuniqueid']&&agents[_0x5ca032[_0xdeff('0x4c')]]){agents[_0x5ca032[_0xdeff('0x4c')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x4c')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x4c')]]);transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0xa')]=agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0xa')];transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4a')]=agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x4c')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x2c')]=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4d')]=0x2;}}}catch(_0x194eed){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032[_0xdeff('0x47')]),_0x194eed);}};exports[_0xdeff('0x4e')]=function(_0x5ab2c5){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0x5ab2c5);if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5['uniqueid']]['reason']==='timeout'){if(_0x5ab2c5[_0xdeff('0x50')]==='21'){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=_0xdeff('0x51');agents[_0x5ab2c5['uniqueid']]['lastevent']=_0xdeff('0x51');}utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x8')],agents[_0x5ab2c5[_0xdeff('0x5')]]['reason'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);var _0x452fd4=unanswered[_0xdeff('0x53')](_0x5ab2c5[_0xdeff('0x5')]);if(_0x452fd4>-0x1){unanswered[_0xdeff('0x54')](_0x452fd4,0x1);}}if(transfers[_0x5ab2c5[_0xdeff('0x5')]]){transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')]=utils['now']();transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x28')]=utils[_0xdeff('0x35')](transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x34')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x2c')]);transfers[_0x5ab2c5[_0xdeff('0x5')]]['reason']=_0xdeff('0x55');transfers[_0x5ab2c5[_0xdeff('0x5')]]['lastevent']=_0xdeff('0x36');utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x8')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(transfers[_0x5ab2c5['uniqueid']],!![]);}if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];agents[_0x5ab2c5[_0xdeff('0x5')]]['agentcompleteAt']=utils[_0xdeff('0x18')]();agents[_0x5ab2c5[_0xdeff('0x5')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')],agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']);agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x39')]?_0xdeff('0x39'):_0xdeff('0x55');agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]=_0xdeff('0x36');utils['info'](util[_0xdeff('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5['uniqueid']]['membername'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],agents[_0x5ab2c5['uniqueid']][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);}}catch(_0xd49939){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0xd49939);}}; \ No newline at end of file +var _0xfe57=['agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','agentconnect','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentcomplete','acw','agentacw','CreateVoiceAgentReport','request','agentcalled','destuniqueid','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x5bf701,_0x2f215c){var _0x3c6a72=function(_0x3c3d25){while(--_0x3c3d25){_0x5bf701['push'](_0x5bf701['shift']());}};_0x3c6a72(++_0x2f215c);}(_0xfe57,0x195));var _0x7fe5=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0xfe57[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x581f71,_0x3f7dca){utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x4'),_0x581f71[_0x7fe5('0x5')],_0x581f71[_0x7fe5('0x6')],_0x581f71[_0x7fe5('0x7')],_0x581f71[_0x7fe5('0x8')],_0x581f71[_0x7fe5('0x9')],_0x581f71[_0x7fe5('0xa')],_0x581f71[_0x7fe5('0xb')],_0x581f71[_0x7fe5('0xc')]));if(_0x581f71[_0x7fe5('0x7')]){utils['getVoiceQueueByName'](_0x581f71[_0x7fe5('0x7')])['then'](function(_0x3564f1){if(_0x3564f1){_0x581f71[_0x7fe5('0xd')]=_0x3564f1['type'];_0x581f71['agentacw']=_0x581f71[_0x7fe5('0xe')]?_0x3564f1[_0x7fe5('0xf')]:![];_0x581f71['acwtime']=_0x581f71[_0x7fe5('0x10')]?_0x3564f1['acwTimeout']:0x0;}utils['request'](_0x7fe5('0x11'),_0x581f71);});}else{utils[_0x7fe5('0x12')](_0x7fe5('0x11'),_0x581f71);}if(_0x3f7dca){delete transfers[_0x581f71[_0x7fe5('0x5')]];}else{delete agents[_0x581f71['destuniqueid']];}}exports[_0x7fe5('0x13')]=function(_0x16bed9){try{utils['debug'](util[_0x7fe5('0x3')]('[%s][agents][agentcalled]',_0x16bed9[_0x7fe5('0x5')]),_0x16bed9);agents[_0x16bed9[_0x7fe5('0x14')]]=_0x16bed9;agents[_0x16bed9['destuniqueid']][_0x7fe5('0x15')]=utils['now']();agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0xc')]=_0x7fe5('0x16');agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0xb')]=null;agents[_0x16bed9[_0x7fe5('0x14')]]['connectedlinename']=null;utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x17'),_0x16bed9[_0x7fe5('0x5')],agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0x8')],_0x16bed9[_0x7fe5('0x14')]));}catch(_0x29b0bd){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')]('[%s][agents][agentcalled]',_0x16bed9['uniqueid']),_0x29b0bd);}};exports[_0x7fe5('0x19')]=function(_0x459c2d){try{if(!_[_0x7fe5('0x1a')](agents[_0x459c2d[_0x7fe5('0x14')]])){utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x1c'),_0x459c2d[_0x7fe5('0x5')]),_0x459c2d);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x1d'),_0x459c2d[_0x7fe5('0x5')],agents[_0x459c2d['destuniqueid']][_0x7fe5('0x8')],_0x459c2d[_0x7fe5('0x14')]));agents[_0x459c2d[_0x7fe5('0x14')]]['agentringnoanswer']=!![];agents[_0x459c2d[_0x7fe5('0x14')]]['agentringnoanswerAt']=utils[_0x7fe5('0x1e')]();agents[_0x459c2d['destuniqueid']][_0x7fe5('0xc')]=_0x7fe5('0x1f');agents[_0x459c2d[_0x7fe5('0x14')]][_0x7fe5('0x20')]=_0x7fe5('0x1f');agents[_0x459c2d[_0x7fe5('0x14')]]['holdtime']=_0x459c2d['ringtime']?parseInt(_0x459c2d[_0x7fe5('0x21')])/0x3e8:0x0;agents[_0x459c2d[_0x7fe5('0x14')]][_0x7fe5('0x22')]=0x0;unanswered[_0x7fe5('0x23')](_0x459c2d['destuniqueid']);}}catch(_0x46f816){utils['error'](util[_0x7fe5('0x3')](_0x7fe5('0x1c'),_0x459c2d[_0x7fe5('0x5')]),_0x46f816);}};exports[_0x7fe5('0x24')]=function(_0x1f8572){try{_[_0x7fe5('0x25')](agents,function(_0x5c07f0,_0xe521c6){if(_0x5c07f0[_0x7fe5('0x5')]==_0x1f8572['uniqueid']&&!_[_0x7fe5('0x26')](unanswered,_0x5c07f0[_0x7fe5('0x14')])){utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x27'),_0x1f8572['uniqueid']),_0x1f8572);utils['info'](util[_0x7fe5('0x3')](_0x7fe5('0x28'),_0x1f8572[_0x7fe5('0x5')],_0x5c07f0[_0x7fe5('0x8')],_0x5c07f0['destuniqueid']));_0x5c07f0[_0x7fe5('0x19')]=!![];_0x5c07f0[_0x7fe5('0x29')]=utils[_0x7fe5('0x1e')]();_0x5c07f0[_0x7fe5('0xc')]=_0x7fe5('0x2a');_0x5c07f0[_0x7fe5('0x20')]='abandoned';_0x5c07f0[_0x7fe5('0x2b')]=_0x1f8572[_0x7fe5('0x2b')];_0x5c07f0[_0x7fe5('0x22')]=0x0;writeDB(_0x5c07f0);}});}catch(_0x39cfe9){utils['error'](util['format'](_0x7fe5('0x27'),_0x1f8572['uniqueid']),_0x39cfe9);}};exports[_0x7fe5('0x2c')]=function(_0x513680){try{if(agents[_0x513680[_0x7fe5('0x14')]]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x513680['uniqueid']),_0x513680);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x513680[_0x7fe5('0x5')],agents[_0x513680[_0x7fe5('0x14')]]['membername'],_0x513680[_0x7fe5('0x14')]));agents[_0x513680['destuniqueid']]['agentconnectAt']=utils[_0x7fe5('0x1e')]();agents[_0x513680[_0x7fe5('0x14')]][_0x7fe5('0xb')]=_0x513680[_0x7fe5('0xb')];agents[_0x513680[_0x7fe5('0x14')]]['connectedlinename']=_0x513680[_0x7fe5('0x2d')];agents[_0x513680[_0x7fe5('0x14')]]['holdtime']=_0x513680[_0x7fe5('0x21')];agents[_0x513680[_0x7fe5('0x14')]][_0x7fe5('0xc')]=_0x7fe5('0x2e');_[_0x7fe5('0x25')](agents,function(_0x1c81c8,_0x1a14e3){if(_0x1c81c8['destuniqueid']!=_0x513680['destuniqueid']&&_0x1c81c8[_0x7fe5('0x5')]==_0x513680['uniqueid']){_0x1c81c8[_0x7fe5('0x22')]=0x0;_0x1c81c8[_0x7fe5('0x2b')]=_0x513680['ringtime'];_0x1c81c8[_0x7fe5('0x19')]=!![];_0x1c81c8[_0x7fe5('0x29')]=utils[_0x7fe5('0x1e')]();_0x1c81c8[_0x7fe5('0xc')]=_0x7fe5('0x2f');_0x1c81c8[_0x7fe5('0x20')]=_0x7fe5('0x2f');_0x1c81c8['answeredelsewheredestinationuniqueid']=_0x513680['destuniqueid'];_0x1c81c8[_0x7fe5('0x30')]=_0x513680['membername'];writeDB(_0x1c81c8);}});}}catch(_0xad0b05){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x31'),_0x513680['uniqueid']),_0xad0b05);}};exports[_0x7fe5('0xe')]=function(_0x5439bc){try{if(!_['isNil'](agents[_0x5439bc[_0x7fe5('0x14')]])){utils[_0x7fe5('0x1b')](util['format'](_0x7fe5('0x32'),_0x5439bc[_0x7fe5('0x5')]),_0x5439bc);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x33'),_0x5439bc['uniqueid'],agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x8')],_0x5439bc['destuniqueid']));agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0xe')]=!![];agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x34')]=utils['now']();agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x22')]=utils[_0x7fe5('0x35')](agents[_0x5439bc['destuniqueid']][_0x7fe5('0x34')],agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x36')]);agents[_0x5439bc['destuniqueid']][_0x7fe5('0x20')]=_0x5439bc[_0x7fe5('0x20')];agents[_0x5439bc[_0x7fe5('0x14')]]['lastevent']=_0x7fe5('0x37');writeDB(agents[_0x5439bc[_0x7fe5('0x14')]]);}}catch(_0x1ac93a){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x32'),_0x5439bc[_0x7fe5('0x5')]),_0x1ac93a);}};exports[_0x7fe5('0x38')]=function(_0x446f01){try{if(!_[_0x7fe5('0x1a')](agents[_0x446f01[_0x7fe5('0x39')]])){utils['debug'](util['format']('[%s][agents][blindtransfer]',_0x446f01['uniqueid']),_0x446f01);utils[_0x7fe5('0x2')](util['format'](_0x7fe5('0x3a'),_0x446f01[_0x7fe5('0x5')],agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x8')],agents[_0x446f01[_0x7fe5('0x39')]]['uniqueid']));agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3b')]=!![];agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3c')]=_0x7fe5('0x3d');agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3e')]=_0x446f01[_0x7fe5('0x3f')];agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x40')]=agents[_0x446f01['transfereruniqueid']][_0x7fe5('0x5')];}}catch(_0x401d05){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x41'),_0x446f01[_0x7fe5('0x5')]),_0x401d05);}};exports['attendedtransfer']=function(_0x31a196){try{utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x42'),_0x31a196[_0x7fe5('0x43')]),_0x31a196);if(_0x31a196[_0x7fe5('0x43')]==_0x31a196[_0x7fe5('0x44')]){if(!_['isNil'](agents[_0x31a196[_0x7fe5('0x45')]])){utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x46'),_0x31a196[_0x7fe5('0x43')],agents[_0x31a196['secondtransfereruniqueid']][_0x7fe5('0x8')]));agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x3b')]=!![];agents[_0x31a196[_0x7fe5('0x45')]]['transfertype']=_0x7fe5('0x47');agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x3e')]=_0x31a196[_0x7fe5('0x48')];agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x40')]=_0x31a196[_0x7fe5('0x43')];}if(_0x31a196[_0x7fe5('0x49')]&&agents[_0x31a196[_0x7fe5('0x49')]]){agents[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x4a')]=0x1;transfers[_0x31a196['transfereeuniqueid']]=_[_0x7fe5('0x4b')](agents[_0x31a196[_0x7fe5('0x49')]]);transfers[_0x31a196[_0x7fe5('0x49')]]['calleridnum']=agents[_0x31a196['secondtransfereruniqueid']][_0x7fe5('0xa')];transfers[_0x31a196['transfereeuniqueid']][_0x7fe5('0x4c')]=agents[_0x31a196[_0x7fe5('0x45')]]['calleridname'];transfers[_0x31a196[_0x7fe5('0x49')]]['agentcalledAt']=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x36')]=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x2b')]=0x0;transfers[_0x31a196['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x31a196[_0x7fe5('0x45')]==_0x31a196[_0x7fe5('0x4d')]){if(!_[_0x7fe5('0x1a')](agents[_0x31a196[_0x7fe5('0x43')]])){utils[_0x7fe5('0x2')](util['format'](_0x7fe5('0x46'),_0x31a196[_0x7fe5('0x43')],agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x8')]));agents[_0x31a196[_0x7fe5('0x43')]]['transfer']=!![];agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x3c')]=_0x7fe5('0x47');agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x3e')]=_0x31a196[_0x7fe5('0x4e')];agents[_0x31a196[_0x7fe5('0x43')]]['transferuniqueid']=_0x31a196[_0x7fe5('0x45')];}if(_0x31a196[_0x7fe5('0x4f')]&&agents[_0x31a196[_0x7fe5('0x4f')]]){agents[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x4a')]=0x1;transfers[_0x31a196[_0x7fe5('0x4f')]]=_[_0x7fe5('0x4b')](agents[_0x31a196['transfertargetuniqueid']]);transfers[_0x31a196['transfertargetuniqueid']][_0x7fe5('0xa')]=agents[_0x31a196['origtransfereruniqueid']][_0x7fe5('0xa')];transfers[_0x31a196['transfertargetuniqueid']][_0x7fe5('0x4c')]=agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x4c')];transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x15')]=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x36')]=utils['now']();transfers[_0x31a196[_0x7fe5('0x4f')]]['holdtime']=0x0;transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x4a')]=0x2;}}}catch(_0x36ac40){utils['error'](util[_0x7fe5('0x3')](_0x7fe5('0x42'),_0x31a196[_0x7fe5('0x43')]),_0x36ac40);}};exports[_0x7fe5('0x50')]=function(_0x31404b){try{utils[_0x7fe5('0x1b')](util['format'](_0x7fe5('0x51'),_0x31404b[_0x7fe5('0x5')]),_0x31404b);if(agents[_0x31404b['uniqueid']]&&agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')]==='timeout'){if(_0x31404b[_0x7fe5('0x52')]==='21'){agents[_0x31404b['uniqueid']][_0x7fe5('0x20')]=_0x7fe5('0x53');agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xc')]=_0x7fe5('0x53');}utils['info'](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],agents[_0x31404b[_0x7fe5('0x5')]]['reason'],agents[_0x31404b[_0x7fe5('0x5')]]['lastevent']));writeDB(agents[_0x31404b[_0x7fe5('0x5')]]);var _0x2e3b94=unanswered['indexOf'](_0x31404b[_0x7fe5('0x5')]);if(_0x2e3b94>-0x1){unanswered[_0x7fe5('0x54')](_0x2e3b94,0x1);}}if(transfers[_0x31404b['uniqueid']]){transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xe')]=!![];transfers[_0x31404b[_0x7fe5('0x5')]]['agentcompleteAt']=utils[_0x7fe5('0x1e')]();transfers[_0x31404b[_0x7fe5('0x5')]]['talktime']=utils[_0x7fe5('0x35')](transfers[_0x31404b[_0x7fe5('0x5')]]['agentcompleteAt'],transfers[_0x31404b[_0x7fe5('0x5')]]['agentconnectAt']);transfers[_0x31404b['uniqueid']][_0x7fe5('0x20')]=_0x7fe5('0x55');transfers[_0x31404b['uniqueid']]['lastevent']=_0x7fe5('0x37');utils['info'](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')],transfers[_0x31404b['uniqueid']][_0x7fe5('0xc')]));writeDB(transfers[_0x31404b[_0x7fe5('0x5')]],!![]);}if(agents[_0x31404b[_0x7fe5('0x5')]]&&agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x36')]){agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xe')]=!![];agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x34')]=utils[_0x7fe5('0x1e')]();agents[_0x31404b['uniqueid']][_0x7fe5('0x22')]=utils[_0x7fe5('0x35')](agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x34')],agents[_0x31404b[_0x7fe5('0x5')]]['agentconnectAt']);agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')]=agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x3b')]?_0x7fe5('0x3b'):_0x7fe5('0x55');agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xc')]=_0x7fe5('0x37');utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')],agents[_0x31404b['uniqueid']][_0x7fe5('0xc')]));writeDB(agents[_0x31404b[_0x7fe5('0x5')]]);}}catch(_0x226ada){utils['error'](util['format']('[%s][agents][hangup]',_0x31404b[_0x7fe5('0x5')]),_0x226ada);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ff9f7ad..1f631b0 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 _0xcf98=['source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','cdr','split','lastIndexOf','includes','noop','execif','set','gotoif','lastdata','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','now','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','value'];(function(_0x4ede5d,_0x2754e7){var _0x112279=function(_0x3adc7a){while(--_0x3adc7a){_0x4ede5d['push'](_0x4ede5d['shift']());}};_0x112279(++_0x2754e7);}(_0xcf98,0x8d));var _0x8cf9=function(_0x22f68d,_0x467621){_0x22f68d=_0x22f68d-0x0;var _0x54af6e=_0xcf98[_0x22f68d];return _0x54af6e;};'use strict';var _=require('lodash');var util=require(_0x8cf9('0x0'));var utils=require(_0x8cf9('0x1'));var transfers=require(_0x8cf9('0x2'));var dispositions=[_0x8cf9('0x3'),_0x8cf9('0x4'),'FAILED','NO\x20ANSWER',_0x8cf9('0x3'),_0x8cf9('0x3'),_0x8cf9('0x5'),_0x8cf9('0x6'),_0x8cf9('0x4'),_0x8cf9('0x4'),_0x8cf9('0x4')];var channels={};function writeDB(_0x29fb1e){var _0x11c3b5;if(transfers[_0x8cf9('0x7')][_0x29fb1e[_0x8cf9('0x8')]]){_0x11c3b5=_0x29fb1e['uniqueid'];_0x29fb1e[_0x8cf9('0x8')]=transfers[_0x8cf9('0x7')][_0x29fb1e['uniqueid']][_0x8cf9('0x9')];}utils['info'](util[_0x8cf9('0xa')](_0x8cf9('0xb'),_0x29fb1e[_0x8cf9('0x8')],_0x29fb1e[_0x8cf9('0xc')],_0x29fb1e[_0x8cf9('0xd')],_0x29fb1e[_0x8cf9('0xe')],_0x29fb1e[_0x8cf9('0xf')],_0x29fb1e['calleridnum'],_0x29fb1e[_0x8cf9('0x10')],_0x29fb1e['lastevent']));if(_0x29fb1e['accountcode']){utils['getUserByInternal'](_0x29fb1e[_0x8cf9('0x11')])['then'](function(_0x5c3482){if(_0x5c3482){_0x29fb1e[_0x8cf9('0x12')]=_0x5c3482['id'];}utils[_0x8cf9('0x13')](_0x8cf9('0x14'),_0x29fb1e);});}else{utils['request'](_0x8cf9('0x14'),_0x29fb1e);}if(channels[_0x29fb1e[_0x8cf9('0x8')]]){delete channels[_0x29fb1e['uniqueid']];}else if(_0x11c3b5&&channels[_0x11c3b5]){if(!transfers[_0x8cf9('0x7')][_0x11c3b5][_0x8cf9('0x15')])delete transfers[_0x8cf9('0x7')][_0x11c3b5];delete channels[_0x11c3b5];}}exports[_0x8cf9('0x16')]=function(_0xbba7f9){try{utils[_0x8cf9('0x17')](util[_0x8cf9('0xa')](_0x8cf9('0x18'),_0xbba7f9[_0x8cf9('0x8')]),_0xbba7f9);if(_0xbba7f9[_0x8cf9('0x8')]==_0xbba7f9[_0x8cf9('0x19')]&&_0xbba7f9[_0x8cf9('0xc')]!=_0x8cf9('0x1a')){utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x1c'),_0xbba7f9['uniqueid'],_0xbba7f9['context'],_0xbba7f9[_0x8cf9('0x1d')]));channels[_0xbba7f9['uniqueid']]={'uniqueid':_0xbba7f9[_0x8cf9('0x8')],'accountcode':_0xbba7f9[_0x8cf9('0x11')],'source':_0xbba7f9[_0x8cf9('0x1e')],'destination':_0xbba7f9[_0x8cf9('0x1d')],'destinationcontext':_0xbba7f9[_0x8cf9('0x1f')],'channel':_0xbba7f9[_0x8cf9('0xc')],'starttime':utils[_0x8cf9('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x8cf9('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x17b252){utils['error'](util['format'](_0x8cf9('0x18'),_0xbba7f9[_0x8cf9('0x8')]),_0x17b252);}};exports['newstate']=function(_0x284c2d){try{utils['debug'](util['format'](_0x8cf9('0x21'),_0x284c2d[_0x8cf9('0x8')]),_0x284c2d);if(!_['isNil'](channels[_0x284c2d[_0x8cf9('0x8')]])&&_0x284c2d[_0x8cf9('0x22')]==0x6){utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x23'),_0x284c2d['uniqueid'],_0x284c2d['context'],_0x284c2d[_0x8cf9('0xc')]));if(_[_0x8cf9('0x24')](channels[_0x284c2d[_0x8cf9('0x8')]][_0x8cf9('0x25')])){channels[_0x284c2d[_0x8cf9('0x8')]][_0x8cf9('0x25')]=utils[_0x8cf9('0x20')]();}}else if(!_[_0x8cf9('0x24')](channels[_0x284c2d[_0x8cf9('0x19')]])&&_0x284c2d['channelstate']==0x6&&_0x284c2d['context']!=_0x8cf9('0x26')){utils['info'](util[_0x8cf9('0xa')](_0x8cf9('0x27'),_0x284c2d[_0x8cf9('0x8')],_0x284c2d[_0x8cf9('0x19')],_0x284c2d['context'],_0x284c2d[_0x8cf9('0xc')]));channels[_0x284c2d[_0x8cf9('0x19')]][_0x8cf9('0x11')]=_0x284c2d[_0x8cf9('0x11')];channels[_0x284c2d[_0x8cf9('0x19')]][_0x8cf9('0x28')]=_0x284c2d[_0x8cf9('0xc')];if(_['isNil'](channels[_0x284c2d['linkedid']][_0x8cf9('0x29')])){channels[_0x284c2d[_0x8cf9('0x19')]][_0x8cf9('0x29')]=utils[_0x8cf9('0x20')]();}channels[_0x284c2d[_0x8cf9('0x19')]][_0x8cf9('0x2a')]=dispositions[_['toNumber'](_0x284c2d[_0x8cf9('0x22')])]||_0x8cf9('0x5');}}catch(_0xe8a9f4){utils[_0x8cf9('0x2b')](util[_0x8cf9('0xa')](_0x8cf9('0x21'),_0x284c2d[_0x8cf9('0x8')]),_0xe8a9f4);}};exports[_0x8cf9('0x2c')]=function(_0x5e7ba6){try{if(!_[_0x8cf9('0x24')](channels[_0x5e7ba6[_0x8cf9('0x8')]])){utils[_0x8cf9('0x17')](util['format'](_0x8cf9('0x2d'),_0x5e7ba6['uniqueid']),_0x5e7ba6);if(_[_0x8cf9('0x24')](channels[_0x5e7ba6['uniqueid']][_0x8cf9('0x2e')])){channels[_0x5e7ba6['uniqueid']][_0x8cf9('0x2e')]=_0x5e7ba6['calleridname']+'\x20<'+_0x5e7ba6[_0x8cf9('0x1e')]+'>';}utils['info'](util['format'](_0x8cf9('0x2f'),_0x5e7ba6['uniqueid'],channels[_0x5e7ba6[_0x8cf9('0x8')]]['callerid'],_0x5e7ba6[_0x8cf9('0x30')]));channels[_0x5e7ba6['uniqueid']][_0x8cf9('0x31')]=utils[_0x8cf9('0x20')]();channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x32')]=utils[_0x8cf9('0x33')](channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x31')],channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x34')]);channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x35')]=channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x29')]?utils[_0x8cf9('0x33')](channels[_0x5e7ba6['uniqueid']][_0x8cf9('0x31')],channels[_0x5e7ba6[_0x8cf9('0x8')]][_0x8cf9('0x29')]):0x0;writeDB(channels[_0x5e7ba6[_0x8cf9('0x8')]]);}}catch(_0x2c0d3f){utils[_0x8cf9('0x2b')](util[_0x8cf9('0xa')]('[%s][calls][hangup]',_0x5e7ba6[_0x8cf9('0x8')]),_0x2c0d3f);}};exports[_0x8cf9('0x36')]=function(_0x2d89af){try{if(!_[_0x8cf9('0x24')](channels[_0x2d89af['localtwolinkedid']])){utils[_0x8cf9('0x17')](util[_0x8cf9('0xa')](_0x8cf9('0x37'),_0x2d89af[_0x8cf9('0x38')]),_0x2d89af);if(channels[_0x2d89af[_0x8cf9('0x39')]][_0x8cf9('0xc')]==_0x2d89af[_0x8cf9('0x3a')]){utils['info'](util[_0x8cf9('0xa')](_0x8cf9('0x3b'),_0x2d89af[_0x8cf9('0x38')],_0x2d89af[_0x8cf9('0x39')],_0x2d89af['secondtransfererchannel']));channels[_0x2d89af['localtwolinkedid']][_0x8cf9('0x28')]=_0x2d89af[_0x8cf9('0x3c')];channels[_0x2d89af['localtwolinkedid']][_0x8cf9('0x3d')]=_0x8cf9('0x3e');}else if(channels[_0x2d89af[_0x8cf9('0x39')]][_0x8cf9('0xc')]=_0x2d89af[_0x8cf9('0x3f')]){utils[_0x8cf9('0x1b')](util['format'](_0x8cf9('0x3b'),_0x2d89af[_0x8cf9('0x38')],_0x2d89af['localtwolinkedid'],_0x2d89af[_0x8cf9('0x40')]));channels[_0x2d89af[_0x8cf9('0x39')]][_0x8cf9('0x28')]=_0x2d89af['origtransfererchannel'];channels[_0x2d89af[_0x8cf9('0x39')]][_0x8cf9('0x3d')]='_attended';}}}catch(_0x1bf9a2){utils['error'](util['format'](_0x8cf9('0x37'),_0x2d89af[_0x8cf9('0x38')]),_0x1bf9a2);}};exports[_0x8cf9('0x41')]=function(_0x46c547){try{if(!_[_0x8cf9('0x24')](channels[_0x46c547[_0x8cf9('0x8')]])){utils[_0x8cf9('0x17')](util['format'](_0x8cf9('0x42'),_0x46c547[_0x8cf9('0x8')]),_0x46c547);channels[_0x46c547[_0x8cf9('0x8')]][_0x8cf9('0x43')]=utils['now']();utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x44'),_0x46c547['uniqueid'],channels[_0x46c547['uniqueid']]['musiconholdstartAt']));}}catch(_0x18d6a9){utils[_0x8cf9('0x2b')](util['format'](_0x8cf9('0x42'),_0x46c547[_0x8cf9('0x8')]),_0x18d6a9);}};exports[_0x8cf9('0x45')]=function(_0x199768){try{if(!_[_0x8cf9('0x24')](channels[_0x199768['uniqueid']])){utils[_0x8cf9('0x17')](util[_0x8cf9('0xa')](_0x8cf9('0x46'),_0x199768[_0x8cf9('0x8')]),_0x199768);if(!_[_0x8cf9('0x24')](channels[_0x199768[_0x8cf9('0x8')]][_0x8cf9('0x43')])){channels[_0x199768['uniqueid']][_0x8cf9('0x47')]+=utils[_0x8cf9('0x33')](utils[_0x8cf9('0x20')](),channels[_0x199768[_0x8cf9('0x8')]][_0x8cf9('0x43')]);utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x48'),_0x199768[_0x8cf9('0x8')],channels[_0x199768[_0x8cf9('0x8')]][_0x8cf9('0x47')]));delete channels[_0x199768[_0x8cf9('0x8')]][_0x8cf9('0x43')];}}}catch(_0x5b25e1){utils[_0x8cf9('0x2b')](util[_0x8cf9('0xa')]('[%s][calls][musiconholdstop]',_0x199768[_0x8cf9('0x8')]),_0x5b25e1);}};exports[_0x8cf9('0x49')]=function(_0x367450){try{if(!_[_0x8cf9('0x24')](channels[_0x367450[_0x8cf9('0x8')]])){utils[_0x8cf9('0x17')](util[_0x8cf9('0xa')](_0x8cf9('0x4a'),_0x367450[_0x8cf9('0x8')]),_0x367450);if(!_[_0x8cf9('0x24')](_0x367450[_0x8cf9('0x4b')]['xmd-originatecalleridnum'])){utils[_0x8cf9('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x367450[_0x8cf9('0x8')],_0x367450[_0x8cf9('0x4c')]));channels[_0x367450['uniqueid']][_0x8cf9('0x4d')]=_0x367450[_0x8cf9('0x4c')];}if(!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x4e')])){utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x4f'),_0x367450[_0x8cf9('0x8')],_0x367450['value']));channels[_0x367450[_0x8cf9('0x8')]]['destination']=_0x367450[_0x8cf9('0x4c')];channels[_0x367450['uniqueid']]['callerid']='\x22'+_0x367450[_0x8cf9('0x4c')]+'\x22\x20<'+_0x367450[_0x8cf9('0x4c')]+'>';}if(!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x50')])||!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x51')])){utils['info'](util['format'](_0x8cf9('0x52'),_0x367450[_0x8cf9('0x8')],!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x50')])?'xmd-callerid-preview':_0x8cf9('0x51'),_0x367450[_0x8cf9('0x4c')]));channels[_0x367450['uniqueid']]['callerid']=_0x367450[_0x8cf9('0x4c')];}if(!_[_0x8cf9('0x24')](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x53')])||!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x54')])){utils[_0x8cf9('0x1b')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x367450[_0x8cf9('0x8')],!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x53')])?_0x8cf9('0x53'):_0x8cf9('0x54'),_0x367450['value']));channels[_0x367450['uniqueid']][_0x8cf9('0x55')]=_0x8cf9('0x56');channels[_0x367450['uniqueid']]['lastdata']=_0x367450[_0x8cf9('0x4c')];channels[_0x367450[_0x8cf9('0x8')]][_0x8cf9('0xd')]=!![];}if(!_[_0x8cf9('0x24')](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x57')])){utils[_0x8cf9('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x367450['uniqueid'],_0x367450[_0x8cf9('0x4c')]));channels[_0x367450['uniqueid']]['ContactId']=_0x367450['value'];}if(!_['isNil'](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x58')])){utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x367450[_0x8cf9('0x8')],_0x367450['value']));channels[_0x367450['uniqueid']][_0x8cf9('0x59')]=_0x367450['value'];}if(!_[_0x8cf9('0x24')](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x5a')])){utils['info'](util[_0x8cf9('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x367450[_0x8cf9('0x8')],_0x367450[_0x8cf9('0x4c')]));channels[_0x367450[_0x8cf9('0x8')]][_0x8cf9('0x5b')]=_0x367450[_0x8cf9('0x4c')];}if(!_[_0x8cf9('0x24')](_0x367450[_0x8cf9('0x4b')][_0x8cf9('0x5c')])){utils[_0x8cf9('0x1b')](util['format'](_0x8cf9('0x5d'),_0x367450['uniqueid'],_0x367450[_0x8cf9('0x4c')]));channels[_0x367450[_0x8cf9('0x8')]][_0x8cf9('0x5c')]=_0x367450[_0x8cf9('0x4c')];}}}catch(_0x25b57d){utils[_0x8cf9('0x2b')](util[_0x8cf9('0xa')](_0x8cf9('0x4a'),_0x367450[_0x8cf9('0x8')]),_0x25b57d);}};exports[_0x8cf9('0x5e')]=function(_0x27bffd){try{if(!_[_0x8cf9('0x24')](channels[_0x27bffd[_0x8cf9('0x8')]])){utils['debug'](util[_0x8cf9('0xa')](_0x8cf9('0x5f'),_0x27bffd[_0x8cf9('0x8')]),_0x27bffd);utils[_0x8cf9('0x1b')](util[_0x8cf9('0xa')](_0x8cf9('0x60'),_0x27bffd[_0x8cf9('0x8')],_0x27bffd['application'],_0x27bffd[_0x8cf9('0x61')]));if(_0x27bffd[_0x8cf9('0x62')][_0x8cf9('0x63')]()=='set'&&_['startsWith'](_0x27bffd[_0x8cf9('0x61')][_0x8cf9('0x63')](),_0x8cf9('0x64'))){var _0x32c94a=_0x27bffd[_0x8cf9('0x61')][_0x8cf9('0x65')]('=');var _0x5cc80e=_0x32c94a[0x0]['substring'](_0x32c94a[0x0][_0x8cf9('0x66')]('(')+0x1,_0x32c94a[0x0][_0x8cf9('0x66')](')'));var _0x2bdfcb=_0x32c94a[0x1];channels[_0x27bffd['uniqueid']][_0x5cc80e]=_0x2bdfcb;}if(!_[_0x8cf9('0x67')]([_0x8cf9('0x2c'),_0x8cf9('0x68'),_0x8cf9('0x69'),_0x8cf9('0x6a'),_0x8cf9('0x6b')],_0x27bffd[_0x8cf9('0x62')][_0x8cf9('0x63')]())){channels[_0x27bffd[_0x8cf9('0x8')]][_0x8cf9('0x55')]=_0x27bffd[_0x8cf9('0x62')];channels[_0x27bffd[_0x8cf9('0x8')]][_0x8cf9('0x6c')]=_0x27bffd['appdata'];}}}catch(_0x234e21){utils[_0x8cf9('0x2b')](util[_0x8cf9('0xa')](_0x8cf9('0x5f'),_0x27bffd['uniqueid']),_0x234e21);}}; \ No newline at end of file +var _0x430c=['linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug'];(function(_0x18f658,_0x28cc17){var _0x522d40=function(_0x452a99){while(--_0x452a99){_0x18f658['push'](_0x18f658['shift']());}};_0x522d40(++_0x28cc17);}(_0x430c,0x1a1));var _0xc430=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x430c[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xc430('0x1'));var dispositions=[_0xc430('0x2'),_0xc430('0x3'),'FAILED','NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0xc430('0x4'),_0xc430('0x5'),'FAILED',_0xc430('0x3'),'FAILED'];var channels={};function writeDB(_0x212354){var _0x2e51c6;if(transfers[_0xc430('0x6')][_0x212354[_0xc430('0x7')]]){_0x2e51c6=_0x212354[_0xc430('0x7')];_0x212354[_0xc430('0x7')]=transfers[_0xc430('0x6')][_0x212354[_0xc430('0x7')]][_0xc430('0x8')];}utils['info'](util[_0xc430('0x9')](_0xc430('0xa'),_0x212354['uniqueid'],_0x212354[_0xc430('0xb')],_0x212354['queue'],_0x212354[_0xc430('0xc')],_0x212354['interface'],_0x212354[_0xc430('0xd')],_0x212354[_0xc430('0xe')],_0x212354[_0xc430('0xf')]));if(_0x212354[_0xc430('0x10')]){utils[_0xc430('0x11')](_0x212354[_0xc430('0x10')])[_0xc430('0x12')](function(_0x54d851){if(_0x54d851){_0x212354['UserId']=_0x54d851['id'];}utils[_0xc430('0x13')](_0xc430('0x14'),_0x212354);});}else{utils[_0xc430('0x13')](_0xc430('0x14'),_0x212354);}if(channels[_0x212354[_0xc430('0x7')]]){delete channels[_0x212354['uniqueid']];}else if(_0x2e51c6&&channels[_0x2e51c6]){if(!transfers[_0xc430('0x6')][_0x2e51c6]['recording'])delete transfers['blinds'][_0x2e51c6];delete channels[_0x2e51c6];}}exports[_0xc430('0x15')]=function(_0x3d02df){try{utils[_0xc430('0x16')](util['format']('[%s][calls][newchannel]',_0x3d02df[_0xc430('0x7')]),_0x3d02df);if(_0x3d02df['uniqueid']==_0x3d02df[_0xc430('0x17')]&&_0x3d02df['channel']!='OutgoingSpoolFailed'){utils[_0xc430('0x18')](util['format'](_0xc430('0x19'),_0x3d02df[_0xc430('0x7')],_0x3d02df[_0xc430('0x1a')],_0x3d02df[_0xc430('0x1b')]));channels[_0x3d02df[_0xc430('0x7')]]={'uniqueid':_0x3d02df['uniqueid'],'accountcode':_0x3d02df[_0xc430('0x10')],'source':_0x3d02df['calleridnum'],'destination':_0x3d02df['exten'],'destinationcontext':_0x3d02df[_0xc430('0x1a')],'channel':_0x3d02df[_0xc430('0xb')],'starttime':utils[_0xc430('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xc430('0x1d')};}}catch(_0x57d26e){utils[_0xc430('0x1e')](util[_0xc430('0x9')]('[%s][calls][newchannel]',_0x3d02df[_0xc430('0x7')]),_0x57d26e);}};exports[_0xc430('0x1f')]=function(_0x48f67a){try{utils[_0xc430('0x16')](util['format'](_0xc430('0x20'),_0x48f67a['uniqueid']),_0x48f67a);if(!_[_0xc430('0x21')](channels[_0x48f67a[_0xc430('0x7')]])&&_0x48f67a['channelstate']==0x6){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x22'),_0x48f67a[_0xc430('0x7')],_0x48f67a[_0xc430('0x1a')],_0x48f67a['channel']));if(_[_0xc430('0x21')](channels[_0x48f67a[_0xc430('0x7')]][_0xc430('0x23')])){channels[_0x48f67a[_0xc430('0x7')]]['systemanswertime']=utils[_0xc430('0x1c')]();}}else if(!_['isNil'](channels[_0x48f67a[_0xc430('0x17')]])&&_0x48f67a['channelstate']==0x6&&_0x48f67a[_0xc430('0x1a')]!=_0xc430('0x24')){utils[_0xc430('0x18')](util[_0xc430('0x9')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x48f67a[_0xc430('0x7')],_0x48f67a[_0xc430('0x17')],_0x48f67a[_0xc430('0x1a')],_0x48f67a[_0xc430('0xb')]));channels[_0x48f67a['linkedid']][_0xc430('0x10')]=_0x48f67a[_0xc430('0x10')];channels[_0x48f67a['linkedid']][_0xc430('0x25')]=_0x48f67a['channel'];if(_['isNil'](channels[_0x48f67a[_0xc430('0x17')]][_0xc430('0x26')])){channels[_0x48f67a[_0xc430('0x17')]][_0xc430('0x26')]=utils[_0xc430('0x1c')]();}channels[_0x48f67a[_0xc430('0x17')]][_0xc430('0x27')]=dispositions[_[_0xc430('0x28')](_0x48f67a['channelstate'])]||_0xc430('0x4');}}catch(_0x4c7fc8){utils[_0xc430('0x1e')](util[_0xc430('0x9')](_0xc430('0x20'),_0x48f67a[_0xc430('0x7')]),_0x4c7fc8);}};exports['hangup']=function(_0x2848ae){try{if(!_['isNil'](channels[_0x2848ae['uniqueid']])){utils[_0xc430('0x16')](util[_0xc430('0x9')]('[%s][calls][hangup]',_0x2848ae[_0xc430('0x7')]),_0x2848ae);if(_[_0xc430('0x21')](channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x29')])){channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x29')]=_0x2848ae[_0xc430('0x2a')]+'\x20<'+_0x2848ae[_0xc430('0xd')]+'>';}utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x2b'),_0x2848ae[_0xc430('0x7')],channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x29')],_0x2848ae[_0xc430('0x2c')]));channels[_0x2848ae['uniqueid']][_0xc430('0x2d')]=utils[_0xc430('0x1c')]();channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x2e')]=utils['diffTime'](channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x2d')],channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x2f')]);channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x30')]=channels[_0x2848ae['uniqueid']][_0xc430('0x26')]?utils[_0xc430('0x31')](channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x2d')],channels[_0x2848ae[_0xc430('0x7')]][_0xc430('0x26')]):0x0;writeDB(channels[_0x2848ae[_0xc430('0x7')]]);}}catch(_0x2cde1e){utils[_0xc430('0x1e')](util[_0xc430('0x9')](_0xc430('0x32'),_0x2848ae[_0xc430('0x7')]),_0x2cde1e);}};exports[_0xc430('0x33')]=function(_0xa5ef4c){try{if(!_['isNil'](channels[_0xa5ef4c['localtwolinkedid']])){utils['debug'](util[_0xc430('0x9')](_0xc430('0x34'),_0xa5ef4c[_0xc430('0x35')]),_0xa5ef4c);if(channels[_0xa5ef4c[_0xc430('0x36')]][_0xc430('0xb')]==_0xa5ef4c[_0xc430('0x37')]){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x38'),_0xa5ef4c[_0xc430('0x35')],_0xa5ef4c[_0xc430('0x36')],_0xa5ef4c[_0xc430('0x39')]));channels[_0xa5ef4c[_0xc430('0x36')]][_0xc430('0x25')]=_0xa5ef4c[_0xc430('0x39')];channels[_0xa5ef4c[_0xc430('0x36')]]['userfield']=_0xc430('0x3a');}else if(channels[_0xa5ef4c[_0xc430('0x36')]][_0xc430('0xb')]=_0xa5ef4c[_0xc430('0x3b')]){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x38'),_0xa5ef4c[_0xc430('0x35')],_0xa5ef4c['localtwolinkedid'],_0xa5ef4c[_0xc430('0x3c')]));channels[_0xa5ef4c['localtwolinkedid']][_0xc430('0x25')]=_0xa5ef4c[_0xc430('0x3c')];channels[_0xa5ef4c['localtwolinkedid']]['userfield']=_0xc430('0x3a');}}}catch(_0x4986d4){utils['error'](util[_0xc430('0x9')]('[%s][calls][attendedtransfer]',_0xa5ef4c[_0xc430('0x35')]),_0x4986d4);}};exports[_0xc430('0x3d')]=function(_0xe2d510){try{if(!_['isNil'](channels[_0xe2d510[_0xc430('0x7')]])){utils[_0xc430('0x16')](util[_0xc430('0x9')]('[%s][calls][musiconholdstart]',_0xe2d510[_0xc430('0x7')]),_0xe2d510);channels[_0xe2d510[_0xc430('0x7')]][_0xc430('0x3e')]=utils[_0xc430('0x1c')]();utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x3f'),_0xe2d510['uniqueid'],channels[_0xe2d510[_0xc430('0x7')]][_0xc430('0x3e')]));}}catch(_0x2df2f2){utils['error'](util[_0xc430('0x9')](_0xc430('0x40'),_0xe2d510[_0xc430('0x7')]),_0x2df2f2);}};exports[_0xc430('0x41')]=function(_0x5b93e1){try{if(!_[_0xc430('0x21')](channels[_0x5b93e1['uniqueid']])){utils[_0xc430('0x16')](util[_0xc430('0x9')](_0xc430('0x42'),_0x5b93e1[_0xc430('0x7')]),_0x5b93e1);if(!_[_0xc430('0x21')](channels[_0x5b93e1[_0xc430('0x7')]]['musiconholdstartAt'])){channels[_0x5b93e1[_0xc430('0x7')]][_0xc430('0x43')]+=utils['diffTime'](utils[_0xc430('0x1c')](),channels[_0x5b93e1[_0xc430('0x7')]][_0xc430('0x3e')]);utils[_0xc430('0x18')](util['format'](_0xc430('0x44'),_0x5b93e1['uniqueid'],channels[_0x5b93e1[_0xc430('0x7')]][_0xc430('0x43')]));delete channels[_0x5b93e1[_0xc430('0x7')]][_0xc430('0x3e')];}}}catch(_0x532d98){utils[_0xc430('0x1e')](util[_0xc430('0x9')]('[%s][calls][musiconholdstop]',_0x5b93e1['uniqueid']),_0x532d98);}};exports[_0xc430('0x45')]=function(_0x274760){try{if(!_[_0xc430('0x21')](channels[_0x274760[_0xc430('0x7')]])){utils[_0xc430('0x16')](util[_0xc430('0x9')](_0xc430('0x46'),_0x274760['uniqueid']),_0x274760);if(!_[_0xc430('0x21')](_0x274760['variable'][_0xc430('0x47')])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x48'),_0x274760[_0xc430('0x7')],_0x274760[_0xc430('0x49')]));channels[_0x274760['uniqueid']][_0xc430('0x4a')]=_0x274760[_0xc430('0x49')];}if(!_[_0xc430('0x21')](_0x274760[_0xc430('0x4b')][_0xc430('0x4c')])){utils[_0xc430('0x18')](util[_0xc430('0x9')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x274760[_0xc430('0x7')],_0x274760['value']));channels[_0x274760[_0xc430('0x7')]]['destination']=_0x274760[_0xc430('0x49')];channels[_0x274760[_0xc430('0x7')]][_0xc430('0x29')]='\x22'+_0x274760[_0xc430('0x49')]+_0xc430('0x4d')+_0x274760[_0xc430('0x49')]+'>';}if(!_['isNil'](_0x274760[_0xc430('0x4b')][_0xc430('0x4e')])||!_['isNil'](_0x274760['variable'][_0xc430('0x4f')])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x50'),_0x274760[_0xc430('0x7')],!_[_0xc430('0x21')](_0x274760[_0xc430('0x4b')][_0xc430('0x4e')])?_0xc430('0x4e'):_0xc430('0x4f'),_0x274760[_0xc430('0x49')]));channels[_0x274760[_0xc430('0x7')]]['callerid']=_0x274760['value'];}if(!_[_0xc430('0x21')](_0x274760['variable'][_0xc430('0x51')])||!_[_0xc430('0x21')](_0x274760['variable'][_0xc430('0x52')])){utils['info'](util['format'](_0xc430('0x50'),_0x274760[_0xc430('0x7')],!_['isNil'](_0x274760[_0xc430('0x4b')]['xmd-queue'])?'xmd-queue':_0xc430('0x52'),_0x274760[_0xc430('0x49')]));channels[_0x274760[_0xc430('0x7')]][_0xc430('0x53')]='Queue';channels[_0x274760[_0xc430('0x7')]][_0xc430('0x54')]=_0x274760[_0xc430('0x49')];channels[_0x274760[_0xc430('0x7')]]['queue']=!![];}if(!_[_0xc430('0x21')](_0x274760[_0xc430('0x4b')][_0xc430('0x55')])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x56'),_0x274760[_0xc430('0x7')],_0x274760[_0xc430('0x49')]));channels[_0x274760[_0xc430('0x7')]][_0xc430('0x57')]=_0x274760[_0xc430('0x49')];}if(!_['isNil'](_0x274760['variable']['xmd-cdrtype'])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x58'),_0x274760['uniqueid'],_0x274760['value']));channels[_0x274760[_0xc430('0x7')]][_0xc430('0x59')]=_0x274760[_0xc430('0x49')];}if(!_[_0xc430('0x21')](_0x274760[_0xc430('0x4b')][_0xc430('0x5a')])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x5b'),_0x274760[_0xc430('0x7')],_0x274760['value']));channels[_0x274760[_0xc430('0x7')]][_0xc430('0x5c')]=_0x274760[_0xc430('0x49')];}if(!_['isNil'](_0x274760['variable']['sipcallid'])){utils[_0xc430('0x18')](util[_0xc430('0x9')](_0xc430('0x5d'),_0x274760[_0xc430('0x7')],_0x274760['value']));channels[_0x274760[_0xc430('0x7')]][_0xc430('0x5e')]=_0x274760[_0xc430('0x49')];}}}catch(_0x5286cc){utils[_0xc430('0x1e')](util['format'](_0xc430('0x46'),_0x274760[_0xc430('0x7')]),_0x5286cc);}};exports[_0xc430('0x5f')]=function(_0x91aea8){try{if(!_[_0xc430('0x21')](channels[_0x91aea8['uniqueid']])){utils[_0xc430('0x16')](util[_0xc430('0x9')](_0xc430('0x60'),_0x91aea8[_0xc430('0x7')]),_0x91aea8);utils['info'](util['format'](_0xc430('0x61'),_0x91aea8['uniqueid'],_0x91aea8['application'],_0x91aea8[_0xc430('0x62')]));if(_0x91aea8[_0xc430('0x63')]['toLowerCase']()==_0xc430('0x64')&&_[_0xc430('0x65')](_0x91aea8[_0xc430('0x62')][_0xc430('0x66')](),_0xc430('0x67'))){var _0x12da25=_0x91aea8['appdata'][_0xc430('0x68')]('=');var _0x4754b1=_0x12da25[0x0][_0xc430('0x69')](_0x12da25[0x0][_0xc430('0x6a')]('(')+0x1,_0x12da25[0x0]['lastIndexOf'](')'));var _0x3d5b62=_0x12da25[0x1];channels[_0x91aea8[_0xc430('0x7')]][_0x4754b1]=_0x3d5b62;}if(!_[_0xc430('0x6b')](['hangup',_0xc430('0x6c'),'execif','set',_0xc430('0x6d')],_0x91aea8['application'][_0xc430('0x66')]())){channels[_0x91aea8['uniqueid']][_0xc430('0x53')]=_0x91aea8[_0xc430('0x63')];channels[_0x91aea8['uniqueid']][_0xc430('0x54')]=_0x91aea8[_0xc430('0x62')];}}}catch(_0x5c90a1){utils[_0xc430('0x1e')](util[_0xc430('0x9')]('[%s][calls][newexten]',_0x91aea8[_0xc430('0x7')]),_0x5c90a1);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 2e3088e..603d2d8 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 _0x7a19=['managerevent','connect','[core]\x20connected','shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x7a19,0x145));var _0x97a1=function(_0x336e05,_0xa238e5){_0x336e05=_0x336e05-0x0;var _0x1f4196=_0x7a19[_0x336e05];return _0x1f4196;};'use strict';var utils=require('./utils');exports[_0x97a1('0x0')]=function(){utils['info'](_0x97a1('0x1'));};exports[_0x97a1('0x2')]=function(){utils[_0x97a1('0x3')](_0x97a1('0x4'));};exports[_0x97a1('0x5')]=function(){utils['info'](_0x97a1('0x6'));};exports[_0x97a1('0x7')]=function(_0x4cc93b){utils[_0x97a1('0x7')](_0x97a1('0x8'),_0x4cc93b);};exports[_0x97a1('0x9')]=function(){utils[_0x97a1('0x3')](_0x97a1('0xa'));};exports[_0x97a1('0xb')]=function(_0x17466d){}; \ No newline at end of file +var _0xdf85=['./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf85,0x12c));var _0x5df8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdf85[_0x4e676e];return _0x336a3c;};'use strict';var utils=require(_0x5df8('0x0'));exports[_0x5df8('0x1')]=function(){utils[_0x5df8('0x2')](_0x5df8('0x3'));};exports['shutdown']=function(){utils[_0x5df8('0x2')](_0x5df8('0x4'));};exports[_0x5df8('0x5')]=function(){utils[_0x5df8('0x2')](_0x5df8('0x6'));};exports[_0x5df8('0x7')]=function(_0x31776e){utils[_0x5df8('0x7')](_0x5df8('0x8'),_0x31776e);};exports[_0x5df8('0x9')]=function(){utils['info'](_0x5df8('0xa'));};exports[_0x5df8('0xb')]=function(_0x29f51d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3666156..4053516 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 _0xa990=['dialbegin','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','[%s][dials][hangup]','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value'];(function(_0x4328ea,_0x25dd4d){var _0x207463=function(_0x29184a){while(--_0x29184a){_0x4328ea['push'](_0x4328ea['shift']());}};_0x207463(++_0x25dd4d);}(_0xa990,0x1eb));var _0x0a99=function(_0x5b034f,_0x231c4c){_0x5b034f=_0x5b034f-0x0;var _0x3c8dd9=_0xa990[_0x5b034f];return _0x3c8dd9;};'use strict';var _=require('lodash');var util=require(_0x0a99('0x0'));var utils=require(_0x0a99('0x1'));var dials={};function writeDB(_0x52e60f){utils[_0x0a99('0x2')](util['format'](_0x0a99('0x3'),_0x52e60f['uniqueid'],_0x52e60f[_0x0a99('0x4')],_0x52e60f['dialstring'],_0x52e60f[_0x0a99('0x5')],_0x52e60f[_0x0a99('0x6')],_0x52e60f[_0x0a99('0x7')]));utils['request'](_0x0a99('0x8'),_0x52e60f);delete dials[_0x52e60f[_0x0a99('0x9')]];}exports['newexten']=function(_0x4be1c8){try{utils[_0x0a99('0xa')](util[_0x0a99('0xb')](_0x0a99('0xc'),_0x4be1c8[_0x0a99('0x9')]),_0x4be1c8);utils[_0x0a99('0x2')](util[_0x0a99('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4be1c8[_0x0a99('0x9')],_0x4be1c8['application'],_0x4be1c8['appdata']));if(_0x4be1c8['application'][_0x0a99('0xd')]()==_0x0a99('0xe')&&_[_0x0a99('0xf')](_0x4be1c8[_0x0a99('0x10')][_0x0a99('0xd')](),_0x0a99('0x11'))){var _0x131c57=_0x4be1c8[_0x0a99('0x10')][_0x0a99('0x12')]('=');dials[_0x4be1c8[_0x0a99('0x9')]]={'routeId':_0x131c57[0x1]};}}catch(_0x4cd0dd){utils[_0x0a99('0x13')](util[_0x0a99('0xb')]('[%s][dials][newexten]',_0x4be1c8['uniqueid']),_0x4cd0dd);}};exports[_0x0a99('0x14')]=function(_0x3a0c9a){try{utils['debug'](util['format'](_0x0a99('0x15'),_0x3a0c9a['uniqueid']),_0x3a0c9a);if(!_[_0x0a99('0x16')](_0x3a0c9a[_0x0a99('0x17')][_0x0a99('0x18')])){utils[_0x0a99('0x2')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3a0c9a['uniqueid'],_0x3a0c9a[_0x0a99('0x19')]));dials[_0x3a0c9a[_0x0a99('0x9')]]={'routeId':_0x3a0c9a[_0x0a99('0x19')]};}}catch(_0x53d570){utils[_0x0a99('0x13')](util[_0x0a99('0xb')](_0x0a99('0x15'),_0x3a0c9a[_0x0a99('0x9')]),_0x53d570);}};exports[_0x0a99('0x1a')]=function(_0x9c90e7){try{if(!_[_0x0a99('0x16')](dials[_0x9c90e7['uniqueid']])){utils[_0x0a99('0xa')](util[_0x0a99('0xb')]('[%s][dials][dialbegin]',_0x9c90e7['uniqueid']),_0x9c90e7);dials[_0x9c90e7[_0x0a99('0x9')]]=_[_0x0a99('0x1b')](dials[_0x9c90e7[_0x0a99('0x9')]],_0x9c90e7);dials[_0x9c90e7['uniqueid']][_0x0a99('0x1c')]=utils[_0x0a99('0x1d')]();dials[_0x9c90e7[_0x0a99('0x9')]][_0x0a99('0x1e')]=_0x0a99('0x1f');utils[_0x0a99('0x2')](util[_0x0a99('0xb')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x9c90e7['uniqueid'],dials[_0x9c90e7[_0x0a99('0x9')]][_0x0a99('0x1c')]));}}catch(_0x31db33){utils['error'](util[_0x0a99('0xb')]('[%s][dials][dialbegin]',_0x9c90e7[_0x0a99('0x9')]),_0x31db33);}};exports[_0x0a99('0x20')]=function(_0x172489){try{if(!_['isNil'](dials[_0x172489['uniqueid']])){utils[_0x0a99('0xa')](util[_0x0a99('0xb')](_0x0a99('0x21'),_0x172489[_0x0a99('0x9')]),_0x172489);dials[_0x172489['uniqueid']]['dialstatus']=_0x172489[_0x0a99('0x7')];if(_0x172489[_0x0a99('0x7')]==_0x0a99('0x22')){dials[_0x172489[_0x0a99('0x9')]]=_['assign'](dials[_0x172489['uniqueid']],_0x172489);dials[_0x172489[_0x0a99('0x9')]]['answertime']=utils[_0x0a99('0x1d')]();dials[_0x172489[_0x0a99('0x9')]][_0x0a99('0x1e')]=_0x0a99('0x23');utils[_0x0a99('0x2')](util[_0x0a99('0xb')](_0x0a99('0x24'),_0x172489[_0x0a99('0x9')],_0x172489[_0x0a99('0x7')],dials[_0x172489[_0x0a99('0x9')]][_0x0a99('0x25')]));}else{utils[_0x0a99('0x2')](util[_0x0a99('0xb')](_0x0a99('0x26'),_0x172489[_0x0a99('0x9')],_0x172489[_0x0a99('0x7')]));}}}catch(_0x7e9275){utils[_0x0a99('0x13')](util[_0x0a99('0xb')](_0x0a99('0x21'),_0x172489['uniqueid']),_0x7e9275);}};exports[_0x0a99('0x27')]=function(_0xdd3cbd){try{if(!_[_0x0a99('0x16')](dials[_0xdd3cbd[_0x0a99('0x9')]])){utils['debug'](util[_0x0a99('0xb')]('[%s][dials][hangup]',_0xdd3cbd['uniqueid']),_0xdd3cbd);utils[_0x0a99('0x2')](util[_0x0a99('0xb')](_0x0a99('0x28'),_0xdd3cbd[_0x0a99('0x9')],_0xdd3cbd['calleridnum'],_0xdd3cbd[_0x0a99('0x29')],_0xdd3cbd['cause-txt']));dials[_0xdd3cbd[_0x0a99('0x9')]]=_[_0x0a99('0x1b')](dials[_0xdd3cbd[_0x0a99('0x9')]],{'endtime':utils[_0x0a99('0x1d')](),'lastevent':_0x0a99('0x2a')});dials[_0xdd3cbd[_0x0a99('0x9')]][_0x0a99('0x2b')]=utils[_0x0a99('0x2c')](dials[_0xdd3cbd['uniqueid']][_0x0a99('0x2d')],dials[_0xdd3cbd[_0x0a99('0x9')]][_0x0a99('0x1c')]);dials[_0xdd3cbd[_0x0a99('0x9')]]['holdtime']=utils[_0x0a99('0x2c')](dials[_0xdd3cbd[_0x0a99('0x9')]]['answertime']||dials[_0xdd3cbd[_0x0a99('0x9')]][_0x0a99('0x2d')],dials[_0xdd3cbd[_0x0a99('0x9')]]['starttime']);dials[_0xdd3cbd[_0x0a99('0x9')]]['billableseconds']=dials[_0xdd3cbd[_0x0a99('0x9')]][_0x0a99('0x25')]?utils[_0x0a99('0x2c')](dials[_0xdd3cbd[_0x0a99('0x9')]][_0x0a99('0x2d')],dials[_0xdd3cbd[_0x0a99('0x9')]]['answertime']):0x0;writeDB(dials[_0xdd3cbd[_0x0a99('0x9')]]);}}catch(_0x2076e8){utils['error'](util[_0x0a99('0xb')](_0x0a99('0x2e'),_0xdd3cbd['uniqueid']),_0x2076e8);}}; \ No newline at end of file +var _0x6290=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','assign','complete','diffTime','endtime','holdtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','now','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup'];(function(_0x803f9a,_0x53ef86){var _0x49bb25=function(_0x3af989){while(--_0x3af989){_0x803f9a['push'](_0x803f9a['shift']());}};_0x49bb25(++_0x53ef86);}(_0x6290,0x1a8));var _0x0629=function(_0x1448c6,_0x40e6ff){_0x1448c6=_0x1448c6-0x0;var _0x382e9f=_0x6290[_0x1448c6];return _0x382e9f;};'use strict';var _=require(_0x0629('0x0'));var util=require(_0x0629('0x1'));var utils=require(_0x0629('0x2'));var dials={};function writeDB(_0x41cd36){utils[_0x0629('0x3')](util[_0x0629('0x4')](_0x0629('0x5'),_0x41cd36[_0x0629('0x6')],_0x41cd36[_0x0629('0x7')],_0x41cd36[_0x0629('0x8')],_0x41cd36['calleridnum'],_0x41cd36['connectedlinenum'],_0x41cd36[_0x0629('0x9')]));utils['request'](_0x0629('0xa'),_0x41cd36);delete dials[_0x41cd36[_0x0629('0x6')]];}exports['newexten']=function(_0x3dc9b5){try{utils[_0x0629('0xb')](util['format'](_0x0629('0xc'),_0x3dc9b5[_0x0629('0x6')]),_0x3dc9b5);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3dc9b5[_0x0629('0x6')],_0x3dc9b5[_0x0629('0xd')],_0x3dc9b5[_0x0629('0xe')]));if(_0x3dc9b5[_0x0629('0xd')]['toLowerCase']()=='set'&&_['startsWith'](_0x3dc9b5[_0x0629('0xe')][_0x0629('0xf')](),_0x0629('0x10'))){var _0xc4c5c3=_0x3dc9b5[_0x0629('0xe')][_0x0629('0x11')]('=');dials[_0x3dc9b5[_0x0629('0x6')]]={'routeId':_0xc4c5c3[0x1]};}}catch(_0x370a8c){utils[_0x0629('0x12')](util[_0x0629('0x4')](_0x0629('0xc'),_0x3dc9b5[_0x0629('0x6')]),_0x370a8c);}};exports[_0x0629('0x13')]=function(_0x424d62){try{utils['debug'](util[_0x0629('0x4')](_0x0629('0x14'),_0x424d62[_0x0629('0x6')]),_0x424d62);if(!_[_0x0629('0x15')](_0x424d62['variable'][_0x0629('0x16')])){utils[_0x0629('0x3')](util[_0x0629('0x4')](_0x0629('0x17'),_0x424d62[_0x0629('0x6')],_0x424d62[_0x0629('0x18')]));dials[_0x424d62['uniqueid']]={'routeId':_0x424d62['value']};}}catch(_0x1086cf){utils[_0x0629('0x12')](util[_0x0629('0x4')](_0x0629('0x14'),_0x424d62[_0x0629('0x6')]),_0x1086cf);}};exports[_0x0629('0x19')]=function(_0x24bf1c){try{if(!_[_0x0629('0x15')](dials[_0x24bf1c[_0x0629('0x6')]])){utils['debug'](util[_0x0629('0x4')](_0x0629('0x1a'),_0x24bf1c[_0x0629('0x6')]),_0x24bf1c);dials[_0x24bf1c[_0x0629('0x6')]]=_['assign'](dials[_0x24bf1c[_0x0629('0x6')]],_0x24bf1c);dials[_0x24bf1c[_0x0629('0x6')]]['starttime']=utils[_0x0629('0x1b')]();dials[_0x24bf1c[_0x0629('0x6')]]['lastevent']='called';utils[_0x0629('0x3')](util[_0x0629('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x24bf1c[_0x0629('0x6')],dials[_0x24bf1c[_0x0629('0x6')]][_0x0629('0x1c')]));}}catch(_0x234946){utils['error'](util[_0x0629('0x4')](_0x0629('0x1a'),_0x24bf1c[_0x0629('0x6')]),_0x234946);}};exports[_0x0629('0x1d')]=function(_0x246f09){try{if(!_['isNil'](dials[_0x246f09[_0x0629('0x6')]])){utils[_0x0629('0xb')](util[_0x0629('0x4')](_0x0629('0x1e'),_0x246f09[_0x0629('0x6')]),_0x246f09);dials[_0x246f09['uniqueid']][_0x0629('0x9')]=_0x246f09['dialstatus'];if(_0x246f09[_0x0629('0x9')]==_0x0629('0x1f')){dials[_0x246f09[_0x0629('0x6')]]=_['assign'](dials[_0x246f09[_0x0629('0x6')]],_0x246f09);dials[_0x246f09['uniqueid']][_0x0629('0x20')]=utils[_0x0629('0x1b')]();dials[_0x246f09[_0x0629('0x6')]]['lastevent']='connect';utils['info'](util['format'](_0x0629('0x21'),_0x246f09[_0x0629('0x6')],_0x246f09[_0x0629('0x9')],dials[_0x246f09[_0x0629('0x6')]][_0x0629('0x20')]));}else{utils[_0x0629('0x3')](util[_0x0629('0x4')](_0x0629('0x22'),_0x246f09[_0x0629('0x6')],_0x246f09[_0x0629('0x9')]));}}}catch(_0x24266e){utils[_0x0629('0x12')](util['format'](_0x0629('0x1e'),_0x246f09[_0x0629('0x6')]),_0x24266e);}};exports[_0x0629('0x23')]=function(_0xf86d8f){try{if(!_[_0x0629('0x15')](dials[_0xf86d8f[_0x0629('0x6')]])){utils[_0x0629('0xb')](util[_0x0629('0x4')](_0x0629('0x24'),_0xf86d8f[_0x0629('0x6')]),_0xf86d8f);utils[_0x0629('0x3')](util[_0x0629('0x4')](_0x0629('0x25'),_0xf86d8f[_0x0629('0x6')],_0xf86d8f[_0x0629('0x26')],_0xf86d8f[_0x0629('0x27')],_0xf86d8f[_0x0629('0x28')]));dials[_0xf86d8f['uniqueid']]=_[_0x0629('0x29')](dials[_0xf86d8f[_0x0629('0x6')]],{'endtime':utils[_0x0629('0x1b')](),'lastevent':_0x0629('0x2a')});dials[_0xf86d8f['uniqueid']]['duration']=utils[_0x0629('0x2b')](dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x2c')],dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x1c')]);dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x2d')]=utils[_0x0629('0x2b')](dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x20')]||dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x2c')],dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x1c')]);dials[_0xf86d8f[_0x0629('0x6')]]['billableseconds']=dials[_0xf86d8f['uniqueid']][_0x0629('0x20')]?utils['diffTime'](dials[_0xf86d8f[_0x0629('0x6')]]['endtime'],dials[_0xf86d8f[_0x0629('0x6')]][_0x0629('0x20')]):0x0;writeDB(dials[_0xf86d8f[_0x0629('0x6')]]);}}catch(_0xd0e1a1){utils[_0x0629('0x12')](util[_0x0629('0x4')](_0x0629('0x24'),_0xf86d8f[_0x0629('0x6')]),_0xd0e1a1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 623980d..9446186 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 _0x1403=['uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer'];(function(_0x583405,_0x1a0d4b){var _0x30810b=function(_0x40119b){while(--_0x40119b){_0x583405['push'](_0x583405['shift']());}};_0x30810b(++_0x1a0d4b);}(_0x1403,0xf4));var _0x3140=function(_0x1092e5,_0x172aa4){_0x1092e5=_0x1092e5-0x0;var _0xe9ee69=_0x1403[_0x1092e5];return _0xe9ee69;};var AsteriskManager=require(_0x3140('0x0'));var config=require(_0x3140('0x1'));var utils=require(_0x3140('0x2'));var util=require(_0x3140('0x3'));var isXDREnabled=config[_0x3140('0x4')]&&config['xdr'][_0x3140('0x5')]?!config[_0x3140('0x4')][_0x3140('0x5')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config['xdr']&&config[_0x3140('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x3140('0x6')][_0x3140('0x7')],config['asterisk']['ip'],config[_0x3140('0x6')][_0x3140('0x8')],config[_0x3140('0x6')][_0x3140('0x9')],!![]);ami[_0x3140('0xa')]();if(!isXDREnabled){utils[_0x3140('0xb')](_0x3140('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3140('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x3140('0xd'));var queues=require(_0x3140('0xe'));var recordings=require(_0x3140('0xf'));var members=require('./members.controller');var dials=require(_0x3140('0x10'));var transfers=require(_0x3140('0x11'));var core=require(_0x3140('0x12'));ami['on'](_0x3140('0x13'),core[_0x3140('0x13')]);ami['on'](_0x3140('0x14'),core[_0x3140('0x14')]);ami['on'](_0x3140('0x15'),core['fullybooted']);ami['on'](_0x3140('0x16'),core[_0x3140('0x16')]);ami['on'](_0x3140('0x17'),core[_0x3140('0x17')]);ami['on'](_0x3140('0x18'),core[_0x3140('0x18')]);ami['on'](_0x3140('0x19'),function(_0x4a4e8d){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')]('[%s][index][devicestatechange]',_0x4a4e8d[_0x3140('0x1c')]),_0x4a4e8d);members['devicestatechange'](_0x4a4e8d);}catch(_0x2ba371){utils[_0x3140('0x16')](util[_0x3140('0x1b')]('[%s][index][devicestatechange]',_0x4a4e8d[_0x3140('0x1c')]),_0x2ba371);}});ami['on'](_0x3140('0x1d'),function(_0x2eefba){try{utils['debug'](util[_0x3140('0x1b')]('[%s][index][agentcalled]',_0x2eefba['uniqueid']),_0x2eefba);agents[_0x3140('0x1d')](_0x2eefba);}catch(_0xa23b27){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x1e'),_0x2eefba['uniqueid']),_0xa23b27);}});ami['on'](_0x3140('0x1f'),function(_0x3c2d1d){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')]('[%s][index][agentringnoanswer]',_0x3c2d1d[_0x3140('0x20')]),_0x3c2d1d);agents[_0x3140('0x1f')](_0x3c2d1d);}catch(_0x335ac5){utils[_0x3140('0x16')](util['format'](_0x3140('0x21'),_0x3c2d1d['uniqueid']),_0x335ac5);}});ami['on'](_0x3140('0x22'),function(_0x384852){try{utils['debug'](util[_0x3140('0x1b')]('[%s][index][agentconnect]',_0x384852[_0x3140('0x20')]),_0x384852);agents[_0x3140('0x22')](_0x384852);queues[_0x3140('0x22')](_0x384852);}catch(_0x38c171){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x23'),_0x384852['uniqueid']),_0x38c171);}});ami['on']('agentcomplete',function(_0xbe7c69){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x24'),_0xbe7c69[_0x3140('0x20')]),_0xbe7c69);agents[_0x3140('0x25')](_0xbe7c69);queues[_0x3140('0x25')](_0xbe7c69);members[_0x3140('0x25')](_0xbe7c69);}catch(_0x4d4c79){utils['error'](util[_0x3140('0x1b')](_0x3140('0x24'),_0xbe7c69[_0x3140('0x20')]),_0x4d4c79);}});ami['on'](_0x3140('0x26'),function(_0x501071){try{utils['debug'](util[_0x3140('0x1b')]('[%s][index][queuecallerabandon]',_0x501071['uniqueid']),_0x501071);agents[_0x3140('0x26')](_0x501071);queues[_0x3140('0x26')](_0x501071);}catch(_0x844354){utils['error'](util['format'](_0x3140('0x27'),_0x501071[_0x3140('0x20')]),_0x844354);}});ami['on'](_0x3140('0x28'),function(_0xb8a69a){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x29'),_0xb8a69a[_0x3140('0x20')]),_0xb8a69a);queues['queuecallerjoin'](_0xb8a69a);recordings[_0x3140('0x28')](_0xb8a69a);}catch(_0x25a422){utils[_0x3140('0x16')](util[_0x3140('0x1b')]('[%s][index][queuecallerjoin]',_0xb8a69a[_0x3140('0x20')]),_0x25a422);}});ami['on'](_0x3140('0x2a'),function(_0x21ced8){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x2b'),_0x21ced8[_0x3140('0x20')]),_0x21ced8);queues['queuecallerleave'](_0x21ced8);}catch(_0x522ed7){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x2b'),_0x21ced8[_0x3140('0x20')]),_0x522ed7);}});ami['on'](_0x3140('0x2c'),function(_0x569a6d){try{utils[_0x3140('0x1a')](util['format'](_0x3140('0x2d'),_0x569a6d['uniqueid']),_0x569a6d);queues[_0x3140('0x2c')](_0x569a6d);calls[_0x3140('0x2c')](_0x569a6d);}catch(_0x18842c){utils['error'](util[_0x3140('0x1b')]('[%s][index][musiconholdstart]',_0x569a6d['uniqueid']),_0x18842c);}});ami['on'](_0x3140('0x2e'),function(_0x5c7234){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x2f'),_0x5c7234[_0x3140('0x20')]),_0x5c7234);queues[_0x3140('0x2e')](_0x5c7234);calls[_0x3140('0x2e')](_0x5c7234);}catch(_0x22ca75){utils[_0x3140('0x16')](util['format'](_0x3140('0x2f'),_0x5c7234[_0x3140('0x20')]),_0x22ca75);}});ami['on'](_0x3140('0x30'),function(_0x25c03a){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')]('[%s][index][newstate]',_0x25c03a[_0x3140('0x20')]),_0x25c03a);calls['newstate'](_0x25c03a);recordings[_0x3140('0x30')](_0x25c03a);}catch(_0x4bb541){utils[_0x3140('0x16')](util['format'](_0x3140('0x31'),_0x25c03a[_0x3140('0x20')]),_0x4bb541);}});ami['on'](_0x3140('0x32'),function(_0x1e335e){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')]('[%s][index][hangup]',_0x1e335e[_0x3140('0x20')]),_0x1e335e);calls[_0x3140('0x32')](_0x1e335e);recordings['hangup'](_0x1e335e);dials['hangup'](_0x1e335e);agents[_0x3140('0x32')](_0x1e335e);queues[_0x3140('0x32')](_0x1e335e);}catch(_0x8a1b1c){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x33'),_0x1e335e['uniqueid']),_0x8a1b1c);}});ami['on'](_0x3140('0x34'),function(_0x28bd98){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x35'),_0x28bd98[_0x3140('0x20')]),_0x28bd98);members['cdr'](_0x28bd98);}catch(_0x2e36f4){utils['error'](util['format'](_0x3140('0x35'),_0x28bd98[_0x3140('0x20')]),_0x2e36f4);}});ami['on']('blindtransfer',function(_0x3088d0){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x36'),_0x3088d0[_0x3140('0x20')]),_0x3088d0);queues['blindtransfer'](_0x3088d0);agents['blindtransfer'](_0x3088d0);transfers[_0x3140('0x37')](_0x3088d0);recordings[_0x3140('0x37')](_0x3088d0);}catch(_0x328cd0){utils[_0x3140('0x16')](util[_0x3140('0x1b')]('[%s][index][blindtransfer]',_0x3088d0[_0x3140('0x20')]),_0x328cd0);}});ami['on']('attendedtransfer',function(_0x2b3447){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x38'),_0x2b3447[_0x3140('0x39')]),_0x2b3447);queues[_0x3140('0x3a')](_0x2b3447);transfers['attendedtransfer'](_0x2b3447);agents[_0x3140('0x3a')](_0x2b3447);calls[_0x3140('0x3a')](_0x2b3447);}catch(_0x512f9c){utils['error'](util['format'](_0x3140('0x38'),_0x2b3447['origtransfereruniqueid']),_0x512f9c);}});ami['on'](_0x3140('0x3b'),function(_0x5f2fce){try{utils['debug'](util[_0x3140('0x1b')]('[%s][index][varset]',_0x5f2fce[_0x3140('0x20')]),_0x5f2fce);queues['varset'](_0x5f2fce);recordings[_0x3140('0x3b')](_0x5f2fce);calls['varset'](_0x5f2fce);dials[_0x3140('0x3b')](_0x5f2fce);}catch(_0x212242){utils[_0x3140('0x16')](util[_0x3140('0x1b')]('[%s][index][varset]',_0x5f2fce[_0x3140('0x20')]),_0x212242);}});ami['on'](_0x3140('0x3c'),function(_0x492858){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x3d'),_0x492858[_0x3140('0x20')]),_0x492858);calls['newexten'](_0x492858);recordings['newexten'](_0x492858);dials[_0x3140('0x3c')](_0x492858);}catch(_0x35c5f7){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x3d'),_0x492858[_0x3140('0x20')]),_0x35c5f7);}});ami['on'](_0x3140('0x3e'),function(_0x3c0eb8){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x3f'),_0x3c0eb8['uniqueid']),_0x3c0eb8);calls[_0x3140('0x3e')](_0x3c0eb8);recordings[_0x3140('0x3e')](_0x3c0eb8);}catch(_0x23c82a){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x3f'),_0x3c0eb8[_0x3140('0x20')]),_0x23c82a);}});ami['on'](_0x3140('0x40'),function(_0x8ce238){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x41'),_0x8ce238[_0x3140('0x20')]),_0x8ce238);dials[_0x3140('0x40')](_0x8ce238);}catch(_0xf03c09){utils['error'](util[_0x3140('0x1b')](_0x3140('0x42'),_0x8ce238['uniqueid']),_0xf03c09);}});ami['on'](_0x3140('0x43'),function(_0x206c8e){try{utils[_0x3140('0x1a')](util[_0x3140('0x1b')](_0x3140('0x44'),_0x206c8e[_0x3140('0x20')]),_0x206c8e);dials['dialend'](_0x206c8e);}catch(_0x18e12c){utils[_0x3140('0x16')](util[_0x3140('0x1b')](_0x3140('0x44'),_0x206c8e[_0x3140('0x20')]),_0x18e12c);}});} \ No newline at end of file +var _0x7328=['./dials.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','debug','format','device','error','[%s][index][devicestatechange]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','production','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x5745d0,_0x249a9a){var _0x3eaa5d=function(_0x27c97e){while(--_0x27c97e){_0x5745d0['push'](_0x5745d0['shift']());}};_0x3eaa5d(++_0x249a9a);}(_0x7328,0x1d8));var _0x8732=function(_0x564dd2,_0x148fa5){_0x564dd2=_0x564dd2-0x0;var _0x47bb3a=_0x7328[_0x564dd2];return _0x47bb3a;};var AsteriskManager=require(_0x8732('0x0'));var config=require('../../config/environment');var utils=require(_0x8732('0x1'));var util=require(_0x8732('0x2'));var isXDREnabled=config[_0x8732('0x3')]&&config['xdr'][_0x8732('0x4')]?!config[_0x8732('0x3')][_0x8732('0x4')]:!![];var isProduction=config['env']===_0x8732('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0x8732('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x8732('0x6')][_0x8732('0x7')],config[_0x8732('0x6')]['ip'],config[_0x8732('0x6')][_0x8732('0x8')],config[_0x8732('0x6')]['password'],!![]);ami[_0x8732('0x9')]();if(!isXDREnabled){utils['info'](_0x8732('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8732('0xb')](_0x8732('0xc'));}else{var agents=require(_0x8732('0xd'));var calls=require(_0x8732('0xe'));var queues=require(_0x8732('0xf'));var recordings=require(_0x8732('0x10'));var members=require(_0x8732('0x11'));var dials=require(_0x8732('0x12'));var transfers=require('./transfers.controller');var core=require(_0x8732('0x13'));ami['on'](_0x8732('0x14'),core[_0x8732('0x14')]);ami['on'](_0x8732('0x15'),core[_0x8732('0x15')]);ami['on'](_0x8732('0x16'),core[_0x8732('0x16')]);ami['on']('error',core['error']);ami['on'](_0x8732('0x17'),core[_0x8732('0x17')]);ami['on']('managerevent',core[_0x8732('0x18')]);ami['on'](_0x8732('0x19'),function(_0x28295e){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')]('[%s][index][devicestatechange]',_0x28295e[_0x8732('0x1c')]),_0x28295e);members[_0x8732('0x19')](_0x28295e);}catch(_0x55e7f0){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x1e'),_0x28295e[_0x8732('0x1c')]),_0x55e7f0);}});ami['on'](_0x8732('0x1f'),function(_0x55ab56){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')]('[%s][index][agentcalled]',_0x55ab56[_0x8732('0x20')]),_0x55ab56);agents[_0x8732('0x1f')](_0x55ab56);}catch(_0x42154d){utils['error'](util[_0x8732('0x1b')]('[%s][index][agentcalled]',_0x55ab56[_0x8732('0x20')]),_0x42154d);}});ami['on'](_0x8732('0x21'),function(_0xd682d){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x22'),_0xd682d['uniqueid']),_0xd682d);agents['agentringnoanswer'](_0xd682d);}catch(_0x117d9e){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x22'),_0xd682d[_0x8732('0x20')]),_0x117d9e);}});ami['on'](_0x8732('0x23'),function(_0x568969){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x24'),_0x568969['uniqueid']),_0x568969);agents[_0x8732('0x23')](_0x568969);queues[_0x8732('0x23')](_0x568969);}catch(_0x14b704){utils[_0x8732('0x1d')](util['format']('[%s][index][agentconnect]',_0x568969['uniqueid']),_0x14b704);}});ami['on']('agentcomplete',function(_0x335063){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x25'),_0x335063[_0x8732('0x20')]),_0x335063);agents[_0x8732('0x26')](_0x335063);queues[_0x8732('0x26')](_0x335063);members[_0x8732('0x26')](_0x335063);}catch(_0x4c4f6a){utils[_0x8732('0x1d')](util['format'](_0x8732('0x25'),_0x335063[_0x8732('0x20')]),_0x4c4f6a);}});ami['on'](_0x8732('0x27'),function(_0x142928){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x28'),_0x142928['uniqueid']),_0x142928);agents['queuecallerabandon'](_0x142928);queues[_0x8732('0x27')](_0x142928);}catch(_0x233596){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x28'),_0x142928[_0x8732('0x20')]),_0x233596);}});ami['on'](_0x8732('0x29'),function(_0x19b7fb){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x2a'),_0x19b7fb['uniqueid']),_0x19b7fb);queues[_0x8732('0x29')](_0x19b7fb);recordings[_0x8732('0x29')](_0x19b7fb);}catch(_0x67b3e7){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x2a'),_0x19b7fb[_0x8732('0x20')]),_0x67b3e7);}});ami['on'](_0x8732('0x2b'),function(_0xce5a4e){try{utils[_0x8732('0x1a')](util['format'](_0x8732('0x2c'),_0xce5a4e[_0x8732('0x20')]),_0xce5a4e);queues[_0x8732('0x2b')](_0xce5a4e);}catch(_0x5e8046){utils[_0x8732('0x1d')](util['format'](_0x8732('0x2c'),_0xce5a4e['uniqueid']),_0x5e8046);}});ami['on'](_0x8732('0x2d'),function(_0x587afc){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x2e'),_0x587afc[_0x8732('0x20')]),_0x587afc);queues[_0x8732('0x2d')](_0x587afc);calls[_0x8732('0x2d')](_0x587afc);}catch(_0x3b817e){utils['error'](util[_0x8732('0x1b')]('[%s][index][musiconholdstart]',_0x587afc[_0x8732('0x20')]),_0x3b817e);}});ami['on'](_0x8732('0x2f'),function(_0x31c6af){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')]('[%s][index][musiconholdstop]',_0x31c6af[_0x8732('0x20')]),_0x31c6af);queues[_0x8732('0x2f')](_0x31c6af);calls['musiconholdstop'](_0x31c6af);}catch(_0x546e70){utils[_0x8732('0x1d')](util[_0x8732('0x1b')]('[%s][index][musiconholdstop]',_0x31c6af['uniqueid']),_0x546e70);}});ami['on'](_0x8732('0x30'),function(_0x1e74cd){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')]('[%s][index][newstate]',_0x1e74cd[_0x8732('0x20')]),_0x1e74cd);calls[_0x8732('0x30')](_0x1e74cd);recordings[_0x8732('0x30')](_0x1e74cd);}catch(_0x56f36f){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x31'),_0x1e74cd[_0x8732('0x20')]),_0x56f36f);}});ami['on'](_0x8732('0x32'),function(_0x9154e2){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x33'),_0x9154e2['uniqueid']),_0x9154e2);calls[_0x8732('0x32')](_0x9154e2);recordings[_0x8732('0x32')](_0x9154e2);dials['hangup'](_0x9154e2);agents[_0x8732('0x32')](_0x9154e2);queues['hangup'](_0x9154e2);}catch(_0x5280f7){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x33'),_0x9154e2['uniqueid']),_0x5280f7);}});ami['on'](_0x8732('0x34'),function(_0x255af3){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x35'),_0x255af3[_0x8732('0x20')]),_0x255af3);members[_0x8732('0x34')](_0x255af3);}catch(_0x526fac){utils[_0x8732('0x1d')](util['format'](_0x8732('0x35'),_0x255af3['uniqueid']),_0x526fac);}});ami['on']('blindtransfer',function(_0x18d2da){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x36'),_0x18d2da['uniqueid']),_0x18d2da);queues['blindtransfer'](_0x18d2da);agents[_0x8732('0x37')](_0x18d2da);transfers['blindtransfer'](_0x18d2da);recordings[_0x8732('0x37')](_0x18d2da);}catch(_0x108b95){utils[_0x8732('0x1d')](util['format']('[%s][index][blindtransfer]',_0x18d2da[_0x8732('0x20')]),_0x108b95);}});ami['on'](_0x8732('0x38'),function(_0x45e079){try{utils[_0x8732('0x1a')](util['format'](_0x8732('0x39'),_0x45e079[_0x8732('0x3a')]),_0x45e079);queues[_0x8732('0x38')](_0x45e079);transfers[_0x8732('0x38')](_0x45e079);agents['attendedtransfer'](_0x45e079);calls['attendedtransfer'](_0x45e079);}catch(_0x5958ee){utils['error'](util[_0x8732('0x1b')](_0x8732('0x39'),_0x45e079[_0x8732('0x3a')]),_0x5958ee);}});ami['on']('varset',function(_0x525c44){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')]('[%s][index][varset]',_0x525c44[_0x8732('0x20')]),_0x525c44);queues[_0x8732('0x3b')](_0x525c44);recordings['varset'](_0x525c44);calls['varset'](_0x525c44);dials[_0x8732('0x3b')](_0x525c44);}catch(_0x2dd3bd){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x3c'),_0x525c44[_0x8732('0x20')]),_0x2dd3bd);}});ami['on'](_0x8732('0x3d'),function(_0x33cffb){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x3e'),_0x33cffb['uniqueid']),_0x33cffb);calls[_0x8732('0x3d')](_0x33cffb);recordings[_0x8732('0x3d')](_0x33cffb);dials[_0x8732('0x3d')](_0x33cffb);}catch(_0x3370b4){utils['error'](util[_0x8732('0x1b')](_0x8732('0x3e'),_0x33cffb[_0x8732('0x20')]),_0x3370b4);}});ami['on'](_0x8732('0x3f'),function(_0x3c3480){try{utils[_0x8732('0x1a')](util['format'](_0x8732('0x40'),_0x3c3480[_0x8732('0x20')]),_0x3c3480);calls[_0x8732('0x3f')](_0x3c3480);recordings['newchannel'](_0x3c3480);}catch(_0x42b48e){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x40'),_0x3c3480[_0x8732('0x20')]),_0x42b48e);}});ami['on'](_0x8732('0x41'),function(_0x4912be){try{utils['debug'](util[_0x8732('0x1b')](_0x8732('0x42'),_0x4912be[_0x8732('0x20')]),_0x4912be);dials[_0x8732('0x41')](_0x4912be);}catch(_0x1f8c8f){utils[_0x8732('0x1d')](util[_0x8732('0x1b')](_0x8732('0x43'),_0x4912be[_0x8732('0x20')]),_0x1f8c8f);}});ami['on'](_0x8732('0x44'),function(_0x40d98f){try{utils[_0x8732('0x1a')](util[_0x8732('0x1b')](_0x8732('0x45'),_0x40d98f[_0x8732('0x20')]),_0x40d98f);dials[_0x8732('0x44')](_0x40d98f);}catch(_0x43c463){utils['error'](util[_0x8732('0x1b')]('[%s][index][dialend]',_0x40d98f[_0x8732('0x20')]),_0x43c463);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index ca81b98..a61f726 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 _0xdab2=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','isNil','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','exitAt','diffTime','[%s][members][agentcomplete]'];(function(_0x53d3b0,_0x62aa42){var _0x44f608=function(_0x47f276){while(--_0x47f276){_0x53d3b0['push'](_0x53d3b0['shift']());}};_0x44f608(++_0x62aa42);}(_0xdab2,0x15c));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var utils=require(_0x2dab('0x2'));var members={};var exclude=[_0x2dab('0x3'),_0x2dab('0x4')];function writeDB(_0xf9b7cc){utils[_0x2dab('0x5')](util['format'](_0x2dab('0x6'),_0xf9b7cc[_0x2dab('0x7')],_0xf9b7cc[_0x2dab('0x8')],_0xf9b7cc[_0x2dab('0x9')],_0xf9b7cc[_0x2dab('0xa')],_0xf9b7cc[_0x2dab('0xb')],_0xf9b7cc[_0x2dab('0xc')]));if(_0xf9b7cc['interface']){utils['getUserByInterface'](_0xf9b7cc['interface'])[_0x2dab('0xd')](function(_0x5be29c){if(_0x5be29c){_0xf9b7cc['membername']=_0x5be29c['name'];_0xf9b7cc['internal']=_0x5be29c[_0x2dab('0xe')];utils[_0x2dab('0xf')](_0x2dab('0x10'),_0xf9b7cc);}else{utils[_0x2dab('0x11')](_0xf9b7cc[_0x2dab('0x8')][_0x2dab('0x12')]('/')[0x1])[_0x2dab('0xd')](function(_0x14a42e){if(_0x14a42e){_0xf9b7cc[_0x2dab('0xb')]=_0x14a42e['name'];_0xf9b7cc[_0x2dab('0xe')]=_0x14a42e['internal'];utils[_0x2dab('0xf')](_0x2dab('0x10'),_0xf9b7cc);}});}})['catch'](function(_0x59b78b){utils[_0x2dab('0x13')](util[_0x2dab('0x14')](_0x2dab('0x15'),_0xf9b7cc['uniqueid']),_0x59b78b);});}delete members[_0xf9b7cc[_0x2dab('0x8')]];}function startsWith(_0x5f5791,_0x5d7f73){return _['some'](_0x5f5791,function(_0x5ea60d){return _['startsWith'](_0x5d7f73,_0x5ea60d);});}exports[_0x2dab('0x16')]=function(_0x3c1512){try{utils[_0x2dab('0x17')](util[_0x2dab('0x14')](_0x2dab('0x18'),members[_0x3c1512['device']]?members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]:_0x3c1512['device']),_0x3c1512);utils[_0x2dab('0x5')](util[_0x2dab('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3c1512[_0x2dab('0x19')]]?members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]:_0x3c1512[_0x2dab('0x19')],_0x3c1512[_0x2dab('0x1a')],_0x3c1512[_0x2dab('0x19')]));switch(_0x3c1512[_0x2dab('0x1a')]){case _0x2dab('0x1b'):case _0x2dab('0x1c'):if(!startsWith(exclude,_0x3c1512[_0x2dab('0x19')])){members[_0x3c1512[_0x2dab('0x19')]]={'channel':_0x2dab('0x1d'),'interface':_0x3c1512[_0x2dab('0x19')],'type':_0x2dab('0x1e'),'enterAt':utils[_0x2dab('0x1f')](),'role':'agent'};}break;case _0x2dab('0x20'):if(!_['isNil'](members[_0x3c1512[_0x2dab('0x19')]])){members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x21')]=utils[_0x2dab('0x1f')]();members[_0x3c1512[_0x2dab('0x19')]]['duration']=utils[_0x2dab('0x22')](members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x21')],members[_0x3c1512[_0x2dab('0x19')]]['enterAt']);if(members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]){writeDB(members[_0x3c1512['device']]);}}break;default:break;}}catch(_0x418061){utils[_0x2dab('0x13')](util[_0x2dab('0x14')]('[%s][members][devicestatechange]',members[_0x3c1512[_0x2dab('0x19')]]?members[_0x3c1512['device']][_0x2dab('0x7')]:_0x3c1512[_0x2dab('0x19')]),_0x418061);}};exports['agentcomplete']=function(_0x3401e8){try{if(!_['isNil'](members[_0x3401e8[_0x2dab('0x8')]])){utils['debug'](util['format'](_0x2dab('0x23'),_0x3401e8['uniqueid']),_0x3401e8);utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x24'),_0x3401e8['uniqueid'],_0x3401e8[_0x2dab('0x8')],_0x3401e8[_0x2dab('0x25')]));members[_0x3401e8[_0x2dab('0x8')]]=_[_0x2dab('0x26')](members[_0x3401e8[_0x2dab('0x8')]],{'data4':_0x3401e8[_0x2dab('0x25')],'uniqueid':_0x3401e8[_0x2dab('0x7')]});}}catch(_0x45543a){utils[_0x2dab('0x13')](util[_0x2dab('0x14')](_0x2dab('0x23'),_0x3401e8[_0x2dab('0x7')]),_0x45543a);}};exports[_0x2dab('0x27')]=function(_0x3f063c){try{utils[_0x2dab('0x17')](util['format']('[%s][members][cdr]',_0x3f063c['uniqueid']),_0x3f063c);if(_0x3f063c[_0x2dab('0x9')]){var _0x5b4828=_0x3f063c['channel'][_0x2dab('0x12')]('-')[0x0];if(!_[_0x2dab('0x28')](members[_0x5b4828])){members[_0x5b4828]=_[_0x2dab('0x26')](members[_0x5b4828],{'data1':members[_0x5b4828]['data1']||_0x3f063c[_0x2dab('0xc')],'data2':members[_0x5b4828][_0x2dab('0xa')]||_0x3f063c[_0x2dab('0x29')],'data3':members[_0x5b4828][_0x2dab('0x2a')]||_0x3f063c[_0x2dab('0x2b')],'uniqueid':members[_0x5b4828][_0x2dab('0x7')]||_0x3f063c['uniqueid']});utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x2c'),_0x3f063c[_0x2dab('0x7')],members[_0x5b4828][_0x2dab('0x2d')],members[_0x5b4828][_0x2dab('0xa')],members[_0x5b4828][_0x2dab('0x2a')]));if(members[_0x5b4828][_0x2dab('0x21')]){writeDB(members[_0x5b4828]);}}}if(_0x3f063c[_0x2dab('0x2e')]){var _0x4a393d=_0x3f063c[_0x2dab('0x2e')][_0x2dab('0x12')]('-')[0x0];if(!_[_0x2dab('0x28')](members[_0x4a393d])){members[_0x4a393d]=_[_0x2dab('0x26')](members[_0x4a393d],{'data1':members[_0x4a393d][_0x2dab('0x2d')]||_0x3f063c[_0x2dab('0xc')],'data2':members[_0x4a393d][_0x2dab('0xa')]||_0x3f063c[_0x2dab('0x29')],'data3':members[_0x4a393d]['data3']||_0x3f063c[_0x2dab('0x2b')],'uniqueid':members[_0x4a393d][_0x2dab('0x7')]||_0x3f063c[_0x2dab('0x7')]});utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x2c'),_0x3f063c[_0x2dab('0x7')],members[_0x4a393d][_0x2dab('0x2d')],members[_0x4a393d][_0x2dab('0xa')],members[_0x4a393d]['data3']));if(members[_0x4a393d][_0x2dab('0x21')]){writeDB(members[_0x4a393d]);}}}}catch(_0x54fd6a){utils['error'](util[_0x2dab('0x14')](_0x2dab('0x2f'),_0x3f063c[_0x2dab('0x7')]),_0x54fd6a);}}; \ No newline at end of file +var _0x63c4=['data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','state','INUSE','voice','now','agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','data1','type','source'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x63c4,0x1c6));var _0x463c=function(_0x1f1c43,_0x5c7b7f){_0x1f1c43=_0x1f1c43-0x0;var _0x49b676=_0x63c4[_0x1f1c43];return _0x49b676;};'use strict';var _=require(_0x463c('0x0'));var util=require(_0x463c('0x1'));var utils=require(_0x463c('0x2'));var members={};var exclude=[_0x463c('0x3'),_0x463c('0x4')];function writeDB(_0x37fc1e){utils[_0x463c('0x5')](util[_0x463c('0x6')](_0x463c('0x7'),_0x37fc1e['uniqueid'],_0x37fc1e[_0x463c('0x8')],_0x37fc1e[_0x463c('0x9')],_0x37fc1e[_0x463c('0xa')],_0x37fc1e[_0x463c('0xb')],_0x37fc1e['type']));if(_0x37fc1e[_0x463c('0x8')]){utils[_0x463c('0xc')](_0x37fc1e[_0x463c('0x8')])[_0x463c('0xd')](function(_0x37d114){if(_0x37d114){_0x37fc1e['membername']=_0x37d114[_0x463c('0xe')];_0x37fc1e[_0x463c('0xf')]=_0x37d114['internal'];utils[_0x463c('0x10')](_0x463c('0x11'),_0x37fc1e);}else{utils[_0x463c('0x12')](_0x37fc1e[_0x463c('0x8')][_0x463c('0x13')]('/')[0x1])['then'](function(_0x1540c5){if(_0x1540c5){_0x37fc1e[_0x463c('0xb')]=_0x1540c5['name'];_0x37fc1e['internal']=_0x1540c5['internal'];utils[_0x463c('0x10')](_0x463c('0x11'),_0x37fc1e);}});}})['catch'](function(_0x76c843){utils[_0x463c('0x14')](util['format']('[%s][members][writeDB]',_0x37fc1e['uniqueid']),_0x76c843);});}delete members[_0x37fc1e[_0x463c('0x8')]];}function startsWith(_0x87e15f,_0xf49a35){return _[_0x463c('0x15')](_0x87e15f,function(_0x4d984e){return _[_0x463c('0x16')](_0xf49a35,_0x4d984e);});}exports[_0x463c('0x17')]=function(_0x3fec53){try{utils[_0x463c('0x18')](util[_0x463c('0x6')](_0x463c('0x19'),members[_0x3fec53[_0x463c('0x1a')]]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53['device']),_0x3fec53);utils['info'](util[_0x463c('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3fec53['device']]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53[_0x463c('0x1a')],_0x3fec53[_0x463c('0x1c')],_0x3fec53['device']));switch(_0x3fec53['state']){case _0x463c('0x1d'):case'BUSY':if(!startsWith(exclude,_0x3fec53[_0x463c('0x1a')])){members[_0x3fec53['device']]={'channel':_0x463c('0x1e'),'interface':_0x3fec53['device'],'type':'TALKING','enterAt':utils[_0x463c('0x1f')](),'role':_0x463c('0x20')};}break;case _0x463c('0x21'):if(!_['isNil'](members[_0x3fec53[_0x463c('0x1a')]])){members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x22')]=utils['now']();members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x23')]=utils['diffTime'](members[_0x3fec53[_0x463c('0x1a')]]['exitAt'],members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x24')]);if(members[_0x3fec53[_0x463c('0x1a')]]['uniqueid']){writeDB(members[_0x3fec53[_0x463c('0x1a')]]);}}break;default:break;}}catch(_0x3f5762){utils['error'](util['format'](_0x463c('0x19'),members[_0x3fec53[_0x463c('0x1a')]]?members[_0x3fec53[_0x463c('0x1a')]][_0x463c('0x1b')]:_0x3fec53[_0x463c('0x1a')]),_0x3f5762);}};exports[_0x463c('0x25')]=function(_0x5a7ee3){try{if(!_[_0x463c('0x26')](members[_0x5a7ee3[_0x463c('0x8')]])){utils['debug'](util['format'](_0x463c('0x27'),_0x5a7ee3[_0x463c('0x1b')]),_0x5a7ee3);utils['info'](util['format'](_0x463c('0x28'),_0x5a7ee3['uniqueid'],_0x5a7ee3['interface'],_0x5a7ee3['queue']));members[_0x5a7ee3[_0x463c('0x8')]]=_[_0x463c('0x29')](members[_0x5a7ee3['interface']],{'data4':_0x5a7ee3['queue'],'uniqueid':_0x5a7ee3['uniqueid']});}}catch(_0x2543dd){utils[_0x463c('0x14')](util[_0x463c('0x6')](_0x463c('0x27'),_0x5a7ee3[_0x463c('0x1b')]),_0x2543dd);}};exports[_0x463c('0x2a')]=function(_0x1497d8){try{utils[_0x463c('0x18')](util[_0x463c('0x6')]('[%s][members][cdr]',_0x1497d8[_0x463c('0x1b')]),_0x1497d8);if(_0x1497d8[_0x463c('0x9')]){var _0x15781d=_0x1497d8[_0x463c('0x9')]['split']('-')[0x0];if(!_['isNil'](members[_0x15781d])){members[_0x15781d]=_[_0x463c('0x29')](members[_0x15781d],{'data1':members[_0x15781d][_0x463c('0x2b')]||_0x1497d8[_0x463c('0x2c')],'data2':members[_0x15781d][_0x463c('0xa')]||_0x1497d8[_0x463c('0x2d')],'data3':members[_0x15781d][_0x463c('0x2e')]||_0x1497d8['destination'],'uniqueid':members[_0x15781d][_0x463c('0x1b')]||_0x1497d8[_0x463c('0x1b')]});utils[_0x463c('0x5')](util['format'](_0x463c('0x2f'),_0x1497d8[_0x463c('0x1b')],members[_0x15781d]['data1'],members[_0x15781d][_0x463c('0xa')],members[_0x15781d][_0x463c('0x2e')]));if(members[_0x15781d][_0x463c('0x22')]){writeDB(members[_0x15781d]);}}}if(_0x1497d8[_0x463c('0x30')]){var _0x3d2a2a=_0x1497d8[_0x463c('0x30')]['split']('-')[0x0];if(!_[_0x463c('0x26')](members[_0x3d2a2a])){members[_0x3d2a2a]=_[_0x463c('0x29')](members[_0x3d2a2a],{'data1':members[_0x3d2a2a]['data1']||_0x1497d8[_0x463c('0x2c')],'data2':members[_0x3d2a2a][_0x463c('0xa')]||_0x1497d8['source'],'data3':members[_0x3d2a2a]['data3']||_0x1497d8[_0x463c('0x31')],'uniqueid':members[_0x3d2a2a][_0x463c('0x1b')]||_0x1497d8[_0x463c('0x1b')]});utils[_0x463c('0x5')](util[_0x463c('0x6')](_0x463c('0x2f'),_0x1497d8['uniqueid'],members[_0x3d2a2a]['data1'],members[_0x3d2a2a][_0x463c('0xa')],members[_0x3d2a2a][_0x463c('0x2e')]));if(members[_0x3d2a2a][_0x463c('0x22')]){writeDB(members[_0x3d2a2a]);}}}}catch(_0x13731f){utils[_0x463c('0x14')](util[_0x463c('0x6')]('[%s][members][cdr]',_0x1497d8['uniqueid']),_0x13731f);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d9d724b..8fd6ddd 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 _0x23fa=['attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','mohtime','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','queuecallerexitreason','then','type','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER'];(function(_0x30a194,_0x3b71ea){var _0x4ae949=function(_0x2fc542){while(--_0x2fc542){_0x30a194['push'](_0x30a194['shift']());}};_0x4ae949(++_0x3b71ea);}(_0x23fa,0x80));var _0xa23f=function(_0x1b6a94,_0x532c07){_0x1b6a94=_0x1b6a94-0x0;var _0x1fdc7f=_0x23fa[_0x1b6a94];return _0x1fdc7f;};'use strict';var _=require(_0xa23f('0x0'));var util=require(_0xa23f('0x1'));var utils=require(_0xa23f('0x2'));var queues={};function writeDB(_0x25cc74){utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x5'),_0x25cc74[_0xa23f('0x6')],_0x25cc74[_0xa23f('0x7')],_0x25cc74[_0xa23f('0x8')],_0x25cc74[_0xa23f('0x9')],_0x25cc74['calleridnum'],_0x25cc74['accountcode'],_0x25cc74[_0xa23f('0xa')]));if(_0x25cc74[_0xa23f('0x8')]){utils['getVoiceQueueByName'](_0x25cc74['queue'])[_0xa23f('0xb')](function(_0x1434f8){if(_0x1434f8){_0x25cc74['type']=_0x1434f8[_0xa23f('0xc')];}utils['request']('CreateVoiceQueueReport',_0x25cc74);});}else{utils['request']('CreateVoiceQueueReport',_0x25cc74);}if(_0x25cc74[_0xa23f('0xd')]){delete queues[_0x25cc74[_0xa23f('0xd')]];}else{delete queues[_0x25cc74[_0xa23f('0x6')]];}}exports['queuecallerjoin']=function(_0x15a2cf){try{utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0xf'),_0x15a2cf[_0xa23f('0x6')]),_0x15a2cf);utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x10'),_0x15a2cf['uniqueid'],_0x15a2cf[_0xa23f('0x8')],_0x15a2cf[_0xa23f('0x11')]));queues[_0x15a2cf[_0xa23f('0x6')]]=_['assign'](_0x15a2cf,{'originalposition':_0x15a2cf['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x350a39){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0xf'),_0x15a2cf[_0xa23f('0x6')]),_0x350a39);}};exports['hangup']=function(_0x2a46fd){try{if(!_[_0xa23f('0x13')](queues[_0x2a46fd[_0xa23f('0x6')]])){utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x14'),_0x2a46fd[_0xa23f('0x6')]),_0x2a46fd);if(queues[_0x2a46fd[_0xa23f('0x6')]][_0xa23f('0x15')]){if(!queues[_0x2a46fd[_0xa23f('0x6')]][_0xa23f('0x16')]&&!queues[_0x2a46fd[_0xa23f('0x6')]]['queuecallerexit']){queues[_0x2a46fd[_0xa23f('0x6')]][_0xa23f('0x17')]=!![];queues[_0x2a46fd['uniqueid']][_0xa23f('0x18')]=utils[_0xa23f('0x19')]();queues[_0x2a46fd[_0xa23f('0x6')]]['queuecallerexitreason']=_0xa23f('0x1a');}utils['info'](util[_0xa23f('0x4')](_0xa23f('0x1b'),_0x2a46fd[_0xa23f('0x6')],queues[_0x2a46fd['uniqueid']][_0xa23f('0x1c')],queues[_0x2a46fd['uniqueid']][_0xa23f('0xa')]));writeDB(queues[_0x2a46fd[_0xa23f('0x6')]]);}else if(queues[_0x2a46fd[_0xa23f('0x6')]]['transfereduniqueid']){utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x1d'),_0x2a46fd[_0xa23f('0x6')],queues[_0x2a46fd[_0xa23f('0x6')]]['name'],queues[_0x2a46fd['uniqueid']]['transfereduniqueid']));queues[queues[_0x2a46fd[_0xa23f('0x6')]][_0xa23f('0xd')]]=queues[_0x2a46fd['uniqueid']];queues[queues[_0x2a46fd[_0xa23f('0x6')]][_0xa23f('0xd')]][_0xa23f('0x1e')]=0x2;delete queues[_0x2a46fd['uniqueid']];}}}catch(_0x1582ec){utils['error'](util[_0xa23f('0x4')](_0xa23f('0x14'),_0x2a46fd[_0xa23f('0x6')]),_0x1582ec);}};exports[_0xa23f('0x1f')]=function(_0x204137){try{utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x20'),_0x204137[_0xa23f('0x6')]),_0x204137);if(!_['isNil'](_0x204137[_0xa23f('0x21')][_0xa23f('0x22')])&&_0x204137[_0xa23f('0x23')][_0xa23f('0x24')]()!==_0xa23f('0x25')){if(!_['isNil'](queues[_0x204137['uniqueid']])){queues[_0x204137['uniqueid']][_0xa23f('0x16')]=![];queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x26')]=null;queues[_0x204137['uniqueid']][_0xa23f('0x27')]=!![];queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x28')]=utils[_0xa23f('0x19')]();queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0xa')]=_0x204137[_0xa23f('0x23')][_0xa23f('0x24')]();utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x29'),_0x204137[_0xa23f('0x6')],queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x1c')],_0x204137[_0xa23f('0x23')],queues[_0x204137['uniqueid']][_0xa23f('0xa')]));writeDB(queues[_0x204137[_0xa23f('0x6')]]);}}else if(!_['isNil'](_0x204137[_0xa23f('0x21')]['queueposition'])){if(!_[_0xa23f('0x13')](queues[_0x204137[_0xa23f('0x6')]])&&!queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x16')]){queues[_0x204137['uniqueid']]['queuecallerabandon']=![];queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x26')]=null;queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x27')]=!![];queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0x28')]=utils['now']();queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0xa')]=_0xa23f('0x2a');utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x2b'),_0x204137[_0xa23f('0x6')],queues[_0x204137['uniqueid']][_0xa23f('0x1c')],_0x204137[_0xa23f('0x23')],queues[_0x204137[_0xa23f('0x6')]][_0xa23f('0xa')]));}}}catch(_0x552766){utils['error'](util[_0xa23f('0x4')]('[%s][queues][varset]',_0x204137['uniqueid']),_0x552766);}};exports[_0xa23f('0x16')]=function(_0xa8ca25){try{if(!_[_0xa23f('0x13')](queues[_0xa8ca25[_0xa23f('0x6')]])){utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x2c'),_0xa8ca25[_0xa23f('0x6')]),_0xa8ca25);queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0x27')]=![];queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0x28')]=null;queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0x16')]=!![];queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0x26')]=utils['now']();queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0xa')]=_0xa23f('0x2d');utils[_0xa23f('0x3')](util['format'](_0xa23f('0x2e'),_0xa8ca25[_0xa23f('0x6')],queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0x1c')],queues[_0xa8ca25[_0xa23f('0x6')]][_0xa23f('0xa')]));}}catch(_0x483470){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x2c'),_0xa8ca25[_0xa23f('0x6')]),_0x483470);}};exports['queuecallerleave']=function(_0x120643){try{if(!_[_0xa23f('0x13')](queues[_0x120643[_0xa23f('0x6')]])){utils[_0xa23f('0xe')](util[_0xa23f('0x4')]('[%s][queues][queuecallerleave]',_0x120643[_0xa23f('0x6')]),_0x120643);utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x2f'),_0x120643[_0xa23f('0x6')],queues[_0x120643['uniqueid']][_0xa23f('0x1c')],_0x120643[_0xa23f('0x30')],_0x120643[_0xa23f('0x31')]));queues[_0x120643[_0xa23f('0x6')]]['queuecallerleave']=!![];queues[_0x120643[_0xa23f('0x6')]][_0xa23f('0x15')]=utils['now']();queues[_0x120643['uniqueid']][_0xa23f('0x32')]=utils[_0xa23f('0x33')](queues[_0x120643['uniqueid']][_0xa23f('0x15')],queues[_0x120643[_0xa23f('0x6')]][_0xa23f('0x34')]);queues[_0x120643[_0xa23f('0x6')]][_0xa23f('0x11')]=_0x120643[_0xa23f('0x11')];queues[_0x120643[_0xa23f('0x6')]][_0xa23f('0x35')]=_0x120643[_0xa23f('0x35')];queues[_0x120643[_0xa23f('0x6')]]['connectedlinenum']=_0x120643[_0xa23f('0x30')];queues[_0x120643['uniqueid']]['connectedlinename']=_0x120643[_0xa23f('0x31')];}}catch(_0x3a7739){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x36'),_0x120643[_0xa23f('0x6')]),_0x3a7739);}};exports[_0xa23f('0x37')]=function(_0x4b4e36){try{if(!_[_0xa23f('0x13')](queues[_0x4b4e36[_0xa23f('0x6')]])){utils['debug'](util[_0xa23f('0x4')](_0xa23f('0x38'),_0x4b4e36[_0xa23f('0x6')]),_0x4b4e36);utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x39'),_0x4b4e36[_0xa23f('0x6')],queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x1c')],_0x4b4e36['membername'],_0x4b4e36[_0xa23f('0x3a')]));queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x16')]=![];queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x16')]=![];queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x26')]=null;queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x27')]=![];queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0xa')]=null;queues[_0x4b4e36[_0xa23f('0x6')]][_0xa23f('0x28')]=null;queues[_0x4b4e36['uniqueid']]['assigned']=!![];queues[_0x4b4e36['uniqueid']][_0xa23f('0x3b')]=_0x4b4e36[_0xa23f('0x3a')];queues[_0x4b4e36[_0xa23f('0x6')]]['lastAssignedTo']=_0x4b4e36[_0xa23f('0x3c')];}}catch(_0x2a147e){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x38'),_0x4b4e36['uniqueid']),_0x2a147e);}};exports[_0xa23f('0x3d')]=function(_0x251092){try{if(!_[_0xa23f('0x13')](queues[_0x251092[_0xa23f('0x6')]])){if(queues[_0x251092['uniqueid']][_0xa23f('0x15')]){utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x3e'),_0x251092['uniqueid']),_0x251092);queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x16')]=![];queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x16')]=![];queues[_0x251092['uniqueid']]['queuecallerabandonAt']=null;queues[_0x251092['uniqueid']]['queuecallerexit']=![];queues[_0x251092['uniqueid']][_0xa23f('0x28')]=null;queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x3f')]=!![];queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x9')]=_0x251092['membername'];queues[_0x251092[_0xa23f('0x6')]]['queuecallercomplete']=!![];queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x18')]=utils[_0xa23f('0x19')]();if(_0x251092['reason']==_0xa23f('0x40')){if(!queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0x40')]){queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0xa')]=_0xa23f('0x41');}}else{queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0xa')]=_0xa23f('0x42')+_0x251092[_0xa23f('0x43')][_0xa23f('0x24')]();}utils[_0xa23f('0x3')](util[_0xa23f('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x251092['uniqueid'],queues[_0x251092[_0xa23f('0x6')]]['name'],_0x251092['membername'],queues[_0x251092[_0xa23f('0x6')]][_0xa23f('0xa')]));writeDB(queues[_0x251092[_0xa23f('0x6')]]);}}}catch(_0x36fa22){utils['error'](util['format'](_0xa23f('0x3e'),_0x251092['uniqueid']),_0x36fa22);}};exports[_0xa23f('0x44')]=function(_0x591c2e){try{if(!_['isNil'](queues[_0x591c2e[_0xa23f('0x45')]])){utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x46'),_0x591c2e[_0xa23f('0x6')]),_0x591c2e);queues[_0x591c2e[_0xa23f('0x45')]][_0xa23f('0x40')]=!![];queues[_0x591c2e[_0xa23f('0x45')]][_0xa23f('0x47')]=_0xa23f('0x48');queues[_0x591c2e[_0xa23f('0x45')]][_0xa23f('0x49')]=_0x591c2e['extension'];queues[_0x591c2e[_0xa23f('0x45')]][_0xa23f('0x4a')]=_0x591c2e[_0xa23f('0x45')];queues[_0x591c2e['transfereeuniqueid']]['queuecallerexitreason']=_0xa23f('0x4b');utils[_0xa23f('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x591c2e[_0xa23f('0x6')],queues[_0x591c2e[_0xa23f('0x45')]][_0xa23f('0x1c')],_0x591c2e[_0xa23f('0x45')],_0x591c2e['extension']));}}catch(_0x2837bc){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x46'),_0x591c2e[_0xa23f('0x6')]),_0x2837bc);}};exports[_0xa23f('0x4c')]=function(_0x28464e){try{utils[_0xa23f('0xe')](util[_0xa23f('0x4')](_0xa23f('0x4d'),_0x28464e[_0xa23f('0x4e')]),_0x28464e);if(_0x28464e[_0xa23f('0x4e')]==_0x28464e[_0xa23f('0x4f')]){if(!_['isNil'](queues[_0x28464e[_0xa23f('0x50')]])){utils[_0xa23f('0x3')](util['format'](_0xa23f('0x51'),_0x28464e['origtransfereruniqueid'],queues[_0x28464e['secondtransfererlinkedid']][_0xa23f('0x1c')],_0x28464e['origtransfererexten']));queues[_0x28464e['secondtransfererlinkedid']][_0xa23f('0x40')]=!![];queues[_0x28464e['secondtransfererlinkedid']]['transfertype']=_0xa23f('0x52');queues[_0x28464e[_0xa23f('0x50')]]['transferexten']=_0x28464e[_0xa23f('0x53')];queues[_0x28464e[_0xa23f('0x50')]][_0xa23f('0x4a')]=_0x28464e[_0xa23f('0x4e')];queues[_0x28464e[_0xa23f('0x50')]][_0xa23f('0xa')]=_0xa23f('0x54');}if(!_['isNil'](queues[_0x28464e[_0xa23f('0x4f')]])){if(_0x28464e[_0xa23f('0x55')]&&queues[_0x28464e[_0xa23f('0x55')]]){queues[_0x28464e[_0xa23f('0x55')]][_0xa23f('0x1e')]=0x1;queues[_0x28464e['transfereeuniqueid']]=_[_0xa23f('0x56')](queues[_0x28464e[_0xa23f('0x55')]]);queues[_0x28464e[_0xa23f('0x45')]][_0xa23f('0xd')]=_0x28464e['transfertargetuniqueid'];queues[_0x28464e[_0xa23f('0x45')]][_0xa23f('0x1e')]=0x2;queues[_0x28464e['transfereeuniqueid']]['calleridnum']=queues[_0x28464e[_0xa23f('0x50')]][_0xa23f('0x57')];queues[_0x28464e[_0xa23f('0x45')]]['calleridname']=queues[_0x28464e[_0xa23f('0x50')]][_0xa23f('0x58')];queues[_0x28464e[_0xa23f('0x45')]][_0xa23f('0x34')]=utils[_0xa23f('0x19')]();queues[_0x28464e[_0xa23f('0x45')]]['queuecallerleaveAt']=utils[_0xa23f('0x19')]();queues[_0x28464e[_0xa23f('0x45')]][_0xa23f('0x32')]=0x0;queues[_0x28464e['transfereeuniqueid']]['mohtime']=0x0;utils[_0xa23f('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x28464e['origtransfereruniqueid'],queues[_0x28464e[_0xa23f('0x45')]]['name'],queues[_0x28464e[_0xa23f('0x45')]][_0xa23f('0x57')],queues[_0x28464e[_0xa23f('0x45')]]['calleridname']));}else{utils[_0xa23f('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x28464e['origtransfereruniqueid'],queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0x1c')],_0x28464e[_0xa23f('0x50')]));queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0xd')]=_0x28464e[_0xa23f('0x50')];}}}else if(_0x28464e[_0xa23f('0x59')]==_0x28464e[_0xa23f('0x50')]){if(!_['isNil'](queues[_0x28464e[_0xa23f('0x4f')]])){utils[_0xa23f('0x3')](util[_0xa23f('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x28464e[_0xa23f('0x4e')],queues[_0x28464e[_0xa23f('0x4f')]]['name'],_0x28464e[_0xa23f('0x59')],_0x28464e['secondtransfererexten']));queues[_0x28464e[_0xa23f('0x4f')]]['transfer']=!![];queues[_0x28464e['origtransfererlinkedid']][_0xa23f('0x47')]=_0xa23f('0x52');queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0x49')]=_0x28464e[_0xa23f('0x5a')];queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0x4a')]=_0x28464e[_0xa23f('0x59')];queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0xa')]=_0xa23f('0x54');}if(!_[_0xa23f('0x13')](queues[_0x28464e[_0xa23f('0x50')]])){if(_0x28464e[_0xa23f('0x5b')]&&queues[_0x28464e[_0xa23f('0x5b')]]){queues[_0x28464e[_0xa23f('0x5b')]][_0xa23f('0x1e')]=0x1;queues[_0x28464e[_0xa23f('0x5c')]]=_[_0xa23f('0x56')](queues[_0x28464e[_0xa23f('0x5b')]]);queues[_0x28464e[_0xa23f('0x5c')]]['transfereduniqueid']=_0x28464e[_0xa23f('0x5c')];queues[_0x28464e[_0xa23f('0x5c')]][_0xa23f('0x1e')]=0x2;queues[_0x28464e[_0xa23f('0x5c')]][_0xa23f('0x57')]=queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0x57')];queues[_0x28464e[_0xa23f('0x5c')]]['calleridname']=queues[_0x28464e[_0xa23f('0x4f')]][_0xa23f('0x58')];queues[_0x28464e[_0xa23f('0x5c')]]['queuecallerjoinAt']=utils[_0xa23f('0x19')]();queues[_0x28464e['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xa23f('0x19')]();queues[_0x28464e['transfertargetuniqueid']][_0xa23f('0x32')]=0x0;queues[_0x28464e[_0xa23f('0x5c')]]['mohtime']=0x0;utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x5d'),_0x28464e[_0xa23f('0x4e')],queues[_0x28464e[_0xa23f('0x5c')]][_0xa23f('0x1c')],queues[_0x28464e[_0xa23f('0x5c')]][_0xa23f('0xd')],queues[_0x28464e[_0xa23f('0x5c')]]['calleridnum'],queues[_0x28464e[_0xa23f('0x5c')]][_0xa23f('0x58')]));}else{utils[_0xa23f('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x28464e[_0xa23f('0x4e')],queues[_0x28464e[_0xa23f('0x50')]]['name'],_0x28464e['origtransfererlinkedid']));queues[_0x28464e[_0xa23f('0x50')]][_0xa23f('0xd')]=_0x28464e[_0xa23f('0x4f')];}}}}catch(_0x17cc9b){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x4d'),_0x28464e[_0xa23f('0x4e')]),_0x17cc9b);}};exports[_0xa23f('0x5e')]=function(_0x470cc1){try{if(!_['isNil'](queues[_0x470cc1['uniqueid']])){utils['debug'](util[_0xa23f('0x4')]('[%s][queues][musiconholdstart]',_0x470cc1[_0xa23f('0x6')]),_0x470cc1);queues[_0x470cc1[_0xa23f('0x6')]][_0xa23f('0x5f')]=utils[_0xa23f('0x19')]();utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x60'),_0x470cc1[_0xa23f('0x6')],queues[_0x470cc1[_0xa23f('0x6')]][_0xa23f('0x1c')],queues[_0x470cc1[_0xa23f('0x6')]][_0xa23f('0x5f')]));}}catch(_0x13dbf3){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x61'),_0x470cc1[_0xa23f('0x6')]),_0x13dbf3);}};exports[_0xa23f('0x62')]=function(_0x2ed83c){try{if(!_[_0xa23f('0x13')](queues[_0x2ed83c[_0xa23f('0x6')]])){if(!_[_0xa23f('0x13')](queues[_0x2ed83c['uniqueid']][_0xa23f('0x5f')])){utils['debug'](util[_0xa23f('0x4')]('[%s][queues][musiconholdstop]',_0x2ed83c[_0xa23f('0x6')]),_0x2ed83c);queues[_0x2ed83c[_0xa23f('0x6')]]['mohtime']+=utils[_0xa23f('0x33')](utils['now'](),queues[_0x2ed83c[_0xa23f('0x6')]][_0xa23f('0x5f')]);utils[_0xa23f('0x3')](util[_0xa23f('0x4')](_0xa23f('0x63'),_0x2ed83c['uniqueid'],queues[_0x2ed83c[_0xa23f('0x6')]][_0xa23f('0x1c')],queues[_0x2ed83c['uniqueid']][_0xa23f('0x64')]));delete queues[_0x2ed83c[_0xa23f('0x6')]][_0xa23f('0x5f')];}}}catch(_0x20dccc){utils[_0xa23f('0x12')](util[_0xa23f('0x4')](_0xa23f('0x65'),_0x2ed83c['uniqueid']),_0x20dccc);}}; \ No newline at end of file +var _0xa61d=['transfertargetuniqueid','clone','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid'];(function(_0x532943,_0xfaa83f){var _0x3915b0=function(_0x333e3c){while(--_0x333e3c){_0x532943['push'](_0x532943['shift']());}};_0x3915b0(++_0xfaa83f);}(_0xa61d,0x76));var _0xda61=function(_0x135d2a,_0x546cd1){_0x135d2a=_0x135d2a-0x0;var _0xae488=_0xa61d[_0x135d2a];return _0xae488;};'use strict';var _=require(_0xda61('0x0'));var util=require(_0xda61('0x1'));var utils=require(_0xda61('0x2'));var queues={};function writeDB(_0x3550d5){utils[_0xda61('0x3')](util['format'](_0xda61('0x4'),_0x3550d5[_0xda61('0x5')],_0x3550d5[_0xda61('0x6')],_0x3550d5['queue'],_0x3550d5[_0xda61('0x7')],_0x3550d5[_0xda61('0x8')],_0x3550d5[_0xda61('0x9')],_0x3550d5[_0xda61('0xa')]));if(_0x3550d5['queue']){utils[_0xda61('0xb')](_0x3550d5[_0xda61('0xc')])[_0xda61('0xd')](function(_0x2c40fa){if(_0x2c40fa){_0x3550d5[_0xda61('0xe')]=_0x2c40fa[_0xda61('0xe')];}utils['request'](_0xda61('0xf'),_0x3550d5);});}else{utils['request'](_0xda61('0xf'),_0x3550d5);}if(_0x3550d5[_0xda61('0x10')]){delete queues[_0x3550d5[_0xda61('0x10')]];}else{delete queues[_0x3550d5['uniqueid']];}}exports['queuecallerjoin']=function(_0x307e93){try{utils[_0xda61('0x11')](util[_0xda61('0x12')](_0xda61('0x13'),_0x307e93[_0xda61('0x5')]),_0x307e93);utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x14'),_0x307e93['uniqueid'],_0x307e93['queue'],_0x307e93['position']));queues[_0x307e93['uniqueid']]=_['assign'](_0x307e93,{'originalposition':_0x307e93[_0xda61('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x38c47f){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x13'),_0x307e93['uniqueid']),_0x38c47f);}};exports[_0xda61('0x17')]=function(_0xc14a2e){try{if(!_['isNil'](queues[_0xc14a2e[_0xda61('0x5')]])){utils['debug'](util[_0xda61('0x12')](_0xda61('0x18'),_0xc14a2e[_0xda61('0x5')]),_0xc14a2e);if(queues[_0xc14a2e[_0xda61('0x5')]]['queuecallerleaveAt']){if(!queues[_0xc14a2e[_0xda61('0x5')]][_0xda61('0x19')]&&!queues[_0xc14a2e[_0xda61('0x5')]][_0xda61('0x1a')]){queues[_0xc14a2e[_0xda61('0x5')]]['queuecallercomplete']=!![];queues[_0xc14a2e[_0xda61('0x5')]]['queuecallercompleteAt']=utils['now']();queues[_0xc14a2e[_0xda61('0x5')]][_0xda61('0xa')]='COMPLETEDBYAGENT';}utils[_0xda61('0x3')](util['format'](_0xda61('0x1b'),_0xc14a2e[_0xda61('0x5')],queues[_0xc14a2e[_0xda61('0x5')]][_0xda61('0x1c')],queues[_0xc14a2e[_0xda61('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xc14a2e[_0xda61('0x5')]]);}else if(queues[_0xc14a2e['uniqueid']][_0xda61('0x10')]){utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x1d'),_0xc14a2e[_0xda61('0x5')],queues[_0xc14a2e['uniqueid']][_0xda61('0x1c')],queues[_0xc14a2e['uniqueid']][_0xda61('0x10')]));queues[queues[_0xc14a2e['uniqueid']]['transfereduniqueid']]=queues[_0xc14a2e[_0xda61('0x5')]];queues[queues[_0xc14a2e[_0xda61('0x5')]][_0xda61('0x10')]][_0xda61('0x1e')]=0x2;delete queues[_0xc14a2e[_0xda61('0x5')]];}}}catch(_0x1a0753){utils['error'](util['format'](_0xda61('0x18'),_0xc14a2e[_0xda61('0x5')]),_0x1a0753);}};exports[_0xda61('0x1f')]=function(_0x51a57a){try{utils[_0xda61('0x11')](util[_0xda61('0x12')](_0xda61('0x20'),_0x51a57a[_0xda61('0x5')]),_0x51a57a);if(!_[_0xda61('0x21')](_0x51a57a[_0xda61('0x22')]['queuestatus'])&&_0x51a57a[_0xda61('0x23')][_0xda61('0x24')]()!==_0xda61('0x25')){if(!_[_0xda61('0x21')](queues[_0x51a57a[_0xda61('0x5')]])){queues[_0x51a57a[_0xda61('0x5')]]['queuecallerabandon']=![];queues[_0x51a57a['uniqueid']][_0xda61('0x26')]=null;queues[_0x51a57a['uniqueid']][_0xda61('0x1a')]=!![];queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0x27')]=utils[_0xda61('0x28')]();queues[_0x51a57a[_0xda61('0x5')]]['queuecallerexitreason']=_0x51a57a[_0xda61('0x23')][_0xda61('0x24')]();utils[_0xda61('0x3')](util[_0xda61('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x51a57a[_0xda61('0x5')],queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0x1c')],_0x51a57a[_0xda61('0x23')],queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0xa')]));writeDB(queues[_0x51a57a[_0xda61('0x5')]]);}}else if(!_[_0xda61('0x21')](_0x51a57a[_0xda61('0x22')][_0xda61('0x29')])){if(!_['isNil'](queues[_0x51a57a[_0xda61('0x5')]])&&!queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0x19')]){queues[_0x51a57a[_0xda61('0x5')]]['queuecallerabandon']=![];queues[_0x51a57a['uniqueid']][_0xda61('0x26')]=null;queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0x1a')]=!![];queues[_0x51a57a['uniqueid']][_0xda61('0x27')]=utils[_0xda61('0x28')]();queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0xa')]=_0xda61('0x2a');utils['info'](util[_0xda61('0x12')](_0xda61('0x2b'),_0x51a57a[_0xda61('0x5')],queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0x1c')],_0x51a57a[_0xda61('0x23')],queues[_0x51a57a[_0xda61('0x5')]][_0xda61('0xa')]));}}}catch(_0x1a1a4e){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x20'),_0x51a57a[_0xda61('0x5')]),_0x1a1a4e);}};exports[_0xda61('0x19')]=function(_0x582be3){try{if(!_[_0xda61('0x21')](queues[_0x582be3[_0xda61('0x5')]])){utils[_0xda61('0x11')](util['format'](_0xda61('0x2c'),_0x582be3['uniqueid']),_0x582be3);queues[_0x582be3[_0xda61('0x5')]][_0xda61('0x1a')]=![];queues[_0x582be3[_0xda61('0x5')]][_0xda61('0x27')]=null;queues[_0x582be3[_0xda61('0x5')]][_0xda61('0x19')]=!![];queues[_0x582be3['uniqueid']]['queuecallerabandonAt']=utils[_0xda61('0x28')]();queues[_0x582be3[_0xda61('0x5')]][_0xda61('0xa')]=_0xda61('0x2d');utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x2e'),_0x582be3[_0xda61('0x5')],queues[_0x582be3[_0xda61('0x5')]]['name'],queues[_0x582be3[_0xda61('0x5')]][_0xda61('0xa')]));}}catch(_0x2380e2){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x2c'),_0x582be3[_0xda61('0x5')]),_0x2380e2);}};exports[_0xda61('0x2f')]=function(_0x49d3c1){try{if(!_[_0xda61('0x21')](queues[_0x49d3c1[_0xda61('0x5')]])){utils[_0xda61('0x11')](util[_0xda61('0x12')](_0xda61('0x30'),_0x49d3c1['uniqueid']),_0x49d3c1);utils[_0xda61('0x3')](util['format'](_0xda61('0x31'),_0x49d3c1[_0xda61('0x5')],queues[_0x49d3c1[_0xda61('0x5')]][_0xda61('0x1c')],_0x49d3c1[_0xda61('0x32')],_0x49d3c1[_0xda61('0x33')]));queues[_0x49d3c1[_0xda61('0x5')]][_0xda61('0x2f')]=!![];queues[_0x49d3c1[_0xda61('0x5')]][_0xda61('0x34')]=utils[_0xda61('0x28')]();queues[_0x49d3c1[_0xda61('0x5')]]['holdtime']=utils[_0xda61('0x35')](queues[_0x49d3c1[_0xda61('0x5')]]['queuecallerleaveAt'],queues[_0x49d3c1['uniqueid']]['queuecallerjoinAt']);queues[_0x49d3c1[_0xda61('0x5')]][_0xda61('0x15')]=_0x49d3c1[_0xda61('0x15')];queues[_0x49d3c1[_0xda61('0x5')]][_0xda61('0x36')]=_0x49d3c1[_0xda61('0x36')];queues[_0x49d3c1['uniqueid']][_0xda61('0x32')]=_0x49d3c1['connectedlinenum'];queues[_0x49d3c1[_0xda61('0x5')]]['connectedlinename']=_0x49d3c1['connectedlinename'];}}catch(_0x46e61c){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x30'),_0x49d3c1[_0xda61('0x5')]),_0x46e61c);}};exports[_0xda61('0x37')]=function(_0x5149d6){try{if(!_[_0xda61('0x21')](queues[_0x5149d6[_0xda61('0x5')]])){utils[_0xda61('0x11')](util['format'](_0xda61('0x38'),_0x5149d6[_0xda61('0x5')]),_0x5149d6);utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x39'),_0x5149d6[_0xda61('0x5')],queues[_0x5149d6['uniqueid']][_0xda61('0x1c')],_0x5149d6[_0xda61('0x3a')],_0x5149d6[_0xda61('0x3b')]));queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0x19')]=![];queues[_0x5149d6[_0xda61('0x5')]]['queuecallerabandon']=![];queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0x26')]=null;queues[_0x5149d6['uniqueid']][_0xda61('0x1a')]=![];queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0xa')]=null;queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0x27')]=null;queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0x3c')]=!![];queues[_0x5149d6[_0xda61('0x5')]]['accountcode']=_0x5149d6['destaccountcode'];queues[_0x5149d6[_0xda61('0x5')]][_0xda61('0x7')]=_0x5149d6[_0xda61('0x3a')];}}catch(_0x22a141){utils[_0xda61('0x16')](util[_0xda61('0x12')]('[%s][queues][agentconnect]',_0x5149d6['uniqueid']),_0x22a141);}};exports[_0xda61('0x3d')]=function(_0x3ef687){try{if(!_[_0xda61('0x21')](queues[_0x3ef687[_0xda61('0x5')]])){if(queues[_0x3ef687[_0xda61('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0xda61('0x12')](_0xda61('0x3e'),_0x3ef687[_0xda61('0x5')]),_0x3ef687);queues[_0x3ef687['uniqueid']][_0xda61('0x19')]=![];queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x19')]=![];queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x26')]=null;queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x1a')]=![];queues[_0x3ef687['uniqueid']][_0xda61('0x27')]=null;queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x3c')]=!![];queues[_0x3ef687[_0xda61('0x5')]]['lastAssignedTo']=_0x3ef687[_0xda61('0x3a')];queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x3f')]=!![];queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x40')]=utils[_0xda61('0x28')]();if(_0x3ef687[_0xda61('0x41')]==_0xda61('0x42')){if(!queues[_0x3ef687[_0xda61('0x5')]][_0xda61('0x42')]){queues[_0x3ef687[_0xda61('0x5')]]['queuecallerexitreason']=_0xda61('0x43');}}else{queues[_0x3ef687[_0xda61('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x3ef687[_0xda61('0x41')]['toUpperCase']();}utils['info'](util['format'](_0xda61('0x44'),_0x3ef687[_0xda61('0x5')],queues[_0x3ef687['uniqueid']][_0xda61('0x1c')],_0x3ef687['membername'],queues[_0x3ef687[_0xda61('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x3ef687[_0xda61('0x5')]]);}}}catch(_0x467b8f){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x3e'),_0x3ef687[_0xda61('0x5')]),_0x467b8f);}};exports[_0xda61('0x45')]=function(_0x1cec21){try{if(!_[_0xda61('0x21')](queues[_0x1cec21[_0xda61('0x46')]])){utils[_0xda61('0x11')](util[_0xda61('0x12')](_0xda61('0x47'),_0x1cec21[_0xda61('0x5')]),_0x1cec21);queues[_0x1cec21[_0xda61('0x46')]]['transfer']=!![];queues[_0x1cec21[_0xda61('0x46')]][_0xda61('0x48')]=_0xda61('0x49');queues[_0x1cec21['transfereeuniqueid']][_0xda61('0x4a')]=_0x1cec21['extension'];queues[_0x1cec21[_0xda61('0x46')]][_0xda61('0x4b')]=_0x1cec21[_0xda61('0x46')];queues[_0x1cec21[_0xda61('0x46')]][_0xda61('0xa')]=_0xda61('0x4c');utils[_0xda61('0x3')](util[_0xda61('0x12')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1cec21['uniqueid'],queues[_0x1cec21[_0xda61('0x46')]][_0xda61('0x1c')],_0x1cec21[_0xda61('0x46')],_0x1cec21[_0xda61('0x4d')]));}}catch(_0x4284e6){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x47'),_0x1cec21['uniqueid']),_0x4284e6);}};exports[_0xda61('0x4e')]=function(_0x4e550c){try{utils[_0xda61('0x11')](util[_0xda61('0x12')](_0xda61('0x4f'),_0x4e550c[_0xda61('0x50')]),_0x4e550c);if(_0x4e550c['origtransfereruniqueid']==_0x4e550c[_0xda61('0x51')]){if(!_[_0xda61('0x21')](queues[_0x4e550c[_0xda61('0x52')]])){utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x53'),_0x4e550c[_0xda61('0x50')],queues[_0x4e550c[_0xda61('0x52')]][_0xda61('0x1c')],_0x4e550c[_0xda61('0x54')]));queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x42')]=!![];queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x48')]=_0xda61('0x55');queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x4a')]=_0x4e550c[_0xda61('0x54')];queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x4b')]=_0x4e550c[_0xda61('0x50')];queues[_0x4e550c['secondtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xda61('0x21')](queues[_0x4e550c['origtransfererlinkedid']])){if(_0x4e550c[_0xda61('0x56')]&&queues[_0x4e550c[_0xda61('0x56')]]){queues[_0x4e550c[_0xda61('0x56')]]['queuecallerenterreason']=0x1;queues[_0x4e550c[_0xda61('0x46')]]=_['clone'](queues[_0x4e550c[_0xda61('0x56')]]);queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x10')]=_0x4e550c['transfertargetuniqueid'];queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x1e')]=0x2;queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x8')]=queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x8')];queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x57')]=queues[_0x4e550c[_0xda61('0x52')]][_0xda61('0x57')];queues[_0x4e550c['transfereeuniqueid']][_0xda61('0x58')]=utils[_0xda61('0x28')]();queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x34')]=utils[_0xda61('0x28')]();queues[_0x4e550c[_0xda61('0x46')]]['holdtime']=0x0;queues[_0x4e550c[_0xda61('0x46')]]['mohtime']=0x0;utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x59'),_0x4e550c['origtransfereruniqueid'],queues[_0x4e550c['transfereeuniqueid']]['name'],queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x8')],queues[_0x4e550c[_0xda61('0x46')]][_0xda61('0x57')]));}else{utils[_0xda61('0x3')](util['format'](_0xda61('0x5a'),_0x4e550c[_0xda61('0x50')],queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x1c')],_0x4e550c[_0xda61('0x52')]));queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x10')]=_0x4e550c[_0xda61('0x52')];}}}else if(_0x4e550c['secondtransfereruniqueid']==_0x4e550c[_0xda61('0x52')]){if(!_[_0xda61('0x21')](queues[_0x4e550c[_0xda61('0x51')]])){utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x5b'),_0x4e550c[_0xda61('0x50')],queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x1c')],_0x4e550c[_0xda61('0x5c')],_0x4e550c[_0xda61('0x5d')]));queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x42')]=!![];queues[_0x4e550c['origtransfererlinkedid']]['transfertype']=_0xda61('0x55');queues[_0x4e550c['origtransfererlinkedid']][_0xda61('0x4a')]=_0x4e550c[_0xda61('0x5d')];queues[_0x4e550c[_0xda61('0x51')]]['transferuniqueid']=_0x4e550c[_0xda61('0x5c')];queues[_0x4e550c[_0xda61('0x51')]]['queuecallerexitreason']=_0xda61('0x5e');}if(!_['isNil'](queues[_0x4e550c[_0xda61('0x52')]])){if(_0x4e550c['transfertargetlinkedid']&&queues[_0x4e550c[_0xda61('0x5f')]]){queues[_0x4e550c[_0xda61('0x5f')]][_0xda61('0x1e')]=0x1;queues[_0x4e550c[_0xda61('0x60')]]=_[_0xda61('0x61')](queues[_0x4e550c[_0xda61('0x5f')]]);queues[_0x4e550c['transfertargetuniqueid']]['transfereduniqueid']=_0x4e550c['transfertargetuniqueid'];queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x1e')]=0x2;queues[_0x4e550c['transfertargetuniqueid']]['calleridnum']=queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x8')];queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x57')]=queues[_0x4e550c[_0xda61('0x51')]][_0xda61('0x57')];queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x58')]=utils[_0xda61('0x28')]();queues[_0x4e550c['transfertargetuniqueid']][_0xda61('0x34')]=utils[_0xda61('0x28')]();queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x62')]=0x0;queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x63')]=0x0;utils['info'](util[_0xda61('0x12')](_0xda61('0x64'),_0x4e550c[_0xda61('0x50')],queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x1c')],queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x10')],queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x8')],queues[_0x4e550c[_0xda61('0x60')]][_0xda61('0x57')]));}else{utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x5a'),_0x4e550c[_0xda61('0x50')],queues[_0x4e550c[_0xda61('0x52')]][_0xda61('0x1c')],_0x4e550c[_0xda61('0x51')]));queues[_0x4e550c['secondtransfererlinkedid']][_0xda61('0x10')]=_0x4e550c[_0xda61('0x51')];}}}}catch(_0x4aaf99){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x4f'),_0x4e550c[_0xda61('0x50')]),_0x4aaf99);}};exports['musiconholdstart']=function(_0x1ecb4a){try{if(!_[_0xda61('0x21')](queues[_0x1ecb4a[_0xda61('0x5')]])){utils[_0xda61('0x11')](util[_0xda61('0x12')]('[%s][queues][musiconholdstart]',_0x1ecb4a[_0xda61('0x5')]),_0x1ecb4a);queues[_0x1ecb4a[_0xda61('0x5')]][_0xda61('0x65')]=utils[_0xda61('0x28')]();utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x66'),_0x1ecb4a[_0xda61('0x5')],queues[_0x1ecb4a[_0xda61('0x5')]][_0xda61('0x1c')],queues[_0x1ecb4a[_0xda61('0x5')]][_0xda61('0x65')]));}}catch(_0x312a1a){utils[_0xda61('0x16')](util[_0xda61('0x12')](_0xda61('0x67'),_0x1ecb4a[_0xda61('0x5')]),_0x312a1a);}};exports[_0xda61('0x68')]=function(_0x50b8ea){try{if(!_[_0xda61('0x21')](queues[_0x50b8ea[_0xda61('0x5')]])){if(!_[_0xda61('0x21')](queues[_0x50b8ea[_0xda61('0x5')]]['musiconholdstartAt'])){utils[_0xda61('0x11')](util['format'](_0xda61('0x69'),_0x50b8ea[_0xda61('0x5')]),_0x50b8ea);queues[_0x50b8ea[_0xda61('0x5')]][_0xda61('0x63')]+=utils[_0xda61('0x35')](utils[_0xda61('0x28')](),queues[_0x50b8ea[_0xda61('0x5')]][_0xda61('0x65')]);utils[_0xda61('0x3')](util[_0xda61('0x12')](_0xda61('0x6a'),_0x50b8ea[_0xda61('0x5')],queues[_0x50b8ea[_0xda61('0x5')]][_0xda61('0x1c')],queues[_0x50b8ea[_0xda61('0x5')]][_0xda61('0x63')]));delete queues[_0x50b8ea[_0xda61('0x5')]][_0xda61('0x65')];}}}catch(_0xceb3bf){utils[_0xda61('0x16')](util[_0xda61('0x12')]('[%s][queues][musiconholdstop]',_0x50b8ea['uniqueid']),_0xceb3bf);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index bd3c2b6..ec68427 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 _0xdd93=['uniqueid','getUserByInternal','accountcode','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','varset','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','error','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]'];(function(_0x3c8611,_0x21326d){var _0x2f3730=function(_0x537b84){while(--_0x537b84){_0x3c8611['push'](_0x3c8611['shift']());}};_0x2f3730(++_0x21326d);}(_0xdd93,0xc6));var _0x3dd9=function(_0x18e88a,_0x54015d){_0x18e88a=_0x18e88a-0x0;var _0x1ed508=_0xdd93[_0x18e88a];return _0x1ed508;};'use strict';var _=require(_0x3dd9('0x0'));var util=require(_0x3dd9('0x1'));var utils=require('./utils');var transfers=require(_0x3dd9('0x2'));var recordings={};function writeDB(_0x3e4c7a){var _0x24379c;utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')](_0x3dd9('0x5'),_0x3e4c7a[_0x3dd9('0x6')]));if(transfers['blinds'][_0x3e4c7a[_0x3dd9('0x6')]]){_0x24379c=_0x3e4c7a[_0x3dd9('0x6')];_0x3e4c7a['uniqueid']=transfers['blinds'][_0x3e4c7a[_0x3dd9('0x6')]]['transfereeuniqueid'];}if(_0x3e4c7a['accountcode']){utils[_0x3dd9('0x7')](_0x3e4c7a[_0x3dd9('0x8')])['then'](function(_0x46db3c){if(_0x46db3c){_0x3e4c7a['membername']=_0x46db3c['name'];_0x3e4c7a[_0x3dd9('0x9')]=_0x46db3c['id'];}utils['request']('CreateVoiceRecording',_0x3e4c7a);});}else{utils[_0x3dd9('0xa')](_0x3dd9('0xb'),_0x3e4c7a);}if(_0x24379c)delete transfers[_0x3dd9('0xc')][_0x24379c];}exports[_0x3dd9('0xd')]=function(_0x4fa83){try{utils[_0x3dd9('0xe')](util['format'](_0x3dd9('0xf'),_0x4fa83[_0x3dd9('0x6')]),_0x4fa83);if(_0x4fa83['uniqueid']==_0x4fa83[_0x3dd9('0x10')]){utils[_0x3dd9('0x3')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x4fa83[_0x3dd9('0x6')],_0x4fa83[_0x3dd9('0x11')],_0x4fa83['exten']));recordings[_0x4fa83[_0x3dd9('0x6')]]={'uniqueid':_0x4fa83['uniqueid'],'accountcode':_0x4fa83['accountcode'],'exten':_0x4fa83[_0x3dd9('0x12')],'context':_0x4fa83[_0x3dd9('0x11')],'channel':_0x4fa83[_0x3dd9('0x13')],'monitors':[]};}}catch(_0x27157c){utils['error'](util['format'](_0x3dd9('0xf'),_0x4fa83[_0x3dd9('0x6')]),_0x27157c);}};exports[_0x3dd9('0x14')]=function(_0x276fff){try{utils[_0x3dd9('0xe')](util[_0x3dd9('0x4')](_0x3dd9('0x15'),_0x276fff[_0x3dd9('0x6')]),_0x276fff);if(!_[_0x3dd9('0x16')](recordings[_0x276fff[_0x3dd9('0x6')]])&&_0x276fff['channelstate']==0x6){utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')](_0x3dd9('0x17'),_0x276fff[_0x3dd9('0x6')],_0x276fff[_0x3dd9('0x11')],_0x276fff['channel']));}else if(!_[_0x3dd9('0x16')](recordings[_0x276fff[_0x3dd9('0x10')]])&&_0x276fff[_0x3dd9('0x18')]==0x6&&_0x276fff[_0x3dd9('0x11')]!=_0x3dd9('0x19')){utils[_0x3dd9('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x276fff['uniqueid'],_0x276fff[_0x3dd9('0x10')],_0x276fff[_0x3dd9('0x11')],_0x276fff[_0x3dd9('0x13')]));recordings[_0x276fff[_0x3dd9('0x10')]][_0x3dd9('0x8')]=_0x276fff[_0x3dd9('0x8')];}}catch(_0x263a25){utils['error'](util['format'](_0x3dd9('0x15'),_0x276fff[_0x3dd9('0x6')]),_0x263a25);}};exports[_0x3dd9('0x1a')]=function(_0x513b25){try{if(!_['isNil'](_0x513b25['variable'])&&!_[_0x3dd9('0x16')](_0x513b25['variable'][_0x3dd9('0x1b')])){utils[_0x3dd9('0xe')](util[_0x3dd9('0x4')](_0x3dd9('0x1c'),_0x513b25[_0x3dd9('0x6')]),_0x513b25);utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')](_0x3dd9('0x1d'),_0x513b25[_0x3dd9('0x6')],_0x513b25['variable'],_0x513b25[_0x3dd9('0x1e')]));if(_['endsWith'](_0x513b25[_0x3dd9('0x1e')],_0x3dd9('0x1f'))){_0x513b25[_0x3dd9('0x1e')]=_0x513b25[_0x3dd9('0x1e')][_0x3dd9('0x20')](_0x3dd9('0x1f'),_0x3dd9('0x21'));}if(recordings[_0x513b25[_0x3dd9('0x10')]]){var _0x4b7ad7=_[_0x3dd9('0x22')](recordings[_0x513b25[_0x3dd9('0x10')]][_0x3dd9('0x23')],{'value':_0x513b25['value']});if(_[_0x3dd9('0x16')](_0x4b7ad7)){recordings[_0x513b25['linkedid']][_0x3dd9('0x23')][_0x3dd9('0x24')]({'value':_0x513b25[_0x3dd9('0x1e')]});}}}}catch(_0x3bf09f){utils['error'](util['format'](_0x3dd9('0x1c'),_0x513b25[_0x3dd9('0x6')]),_0x3bf09f);}};exports[_0x3dd9('0x25')]=function(_0x1fcec6){try{if(!_[_0x3dd9('0x16')](recordings[_0x1fcec6[_0x3dd9('0x6')]])){utils['debug'](util['format'](_0x3dd9('0x26'),_0x1fcec6['uniqueid']),_0x1fcec6);utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1fcec6[_0x3dd9('0x6')],_0x1fcec6[_0x3dd9('0x27')],_0x1fcec6[_0x3dd9('0x28')],_0x1fcec6['cause-txt']));recordings[_0x1fcec6['uniqueid']][_0x3dd9('0x27')]=_0x1fcec6[_0x3dd9('0x27')];recordings[_0x1fcec6[_0x3dd9('0x6')]][_0x3dd9('0x28')]=_0x1fcec6['calleridname'];recordings[_0x1fcec6['uniqueid']][_0x3dd9('0x29')]=_0x1fcec6[_0x3dd9('0x29')];recordings[_0x1fcec6[_0x3dd9('0x6')]][_0x3dd9('0x2a')]=_0x1fcec6[_0x3dd9('0x2a')];if(recordings[_0x1fcec6['uniqueid']][_0x3dd9('0x2b')]==_0x3dd9('0x2c')&&recordings[_0x1fcec6[_0x3dd9('0x6')]][_0x3dd9('0x8')]){recordings[_0x1fcec6['uniqueid']]['connectedlinenum']=recordings[_0x1fcec6[_0x3dd9('0x6')]][_0x3dd9('0x8')];recordings[_0x1fcec6[_0x3dd9('0x6')]][_0x3dd9('0x2a')]='';}recordings[_0x1fcec6['uniqueid']]['monitors']['forEach'](function(_0x342370){var _0x4b3949=_[_0x3dd9('0x2d')](recordings[_0x1fcec6[_0x3dd9('0x6')]]);_0x4b3949[_0x3dd9('0x1e')]=_0x342370[_0x3dd9('0x1e')];writeDB(_0x4b3949);});delete recordings[_0x1fcec6['uniqueid']];}}catch(_0x59f56e){utils[_0x3dd9('0x2e')](util['format'](_0x3dd9('0x26'),_0x1fcec6[_0x3dd9('0x6')]),_0x59f56e);}};exports[_0x3dd9('0x2f')]=function(_0x4560dd){try{if(!_['isNil'](recordings[_0x4560dd[_0x3dd9('0x6')]])){utils[_0x3dd9('0xe')](util[_0x3dd9('0x4')](_0x3dd9('0x30'),_0x4560dd[_0x3dd9('0x6')]),_0x4560dd);utils['info'](util[_0x3dd9('0x4')](_0x3dd9('0x31'),_0x4560dd[_0x3dd9('0x6')],_0x4560dd[_0x3dd9('0x32')],_0x4560dd['appdata']));if(_0x4560dd['application'][_0x3dd9('0x33')]()=='set'&&_[_0x3dd9('0x34')](_0x4560dd[_0x3dd9('0x35')]['toLowerCase'](),_0x3dd9('0x36'))){var _0x5a2f26=_0x4560dd['appdata'][_0x3dd9('0x37')]('=');var _0x346891=_0x5a2f26[0x0][_0x3dd9('0x38')](_0x5a2f26[0x0][_0x3dd9('0x39')]('(')+0x1,_0x5a2f26[0x0][_0x3dd9('0x39')](')'));var _0x2bf33d=_0x5a2f26[0x1];recordings[_0x4560dd[_0x3dd9('0x6')]][_0x346891]=_0x2bf33d;}}}catch(_0x2521e2){utils[_0x3dd9('0x2e')](util['format'](_0x3dd9('0x30'),_0x4560dd[_0x3dd9('0x6')]),_0x2521e2);}};exports[_0x3dd9('0x3a')]=function(_0x1d0f23){try{if(!_[_0x3dd9('0x16')](recordings[_0x1d0f23[_0x3dd9('0x6')]])){utils['debug'](util[_0x3dd9('0x4')]('[%s][recordings][queuecallerjoin]',_0x1d0f23[_0x3dd9('0x6')]),_0x1d0f23);utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1d0f23[_0x3dd9('0x6')],_0x1d0f23[_0x3dd9('0x3b')]));recordings[_0x1d0f23[_0x3dd9('0x6')]][_0x3dd9('0x3b')]=_0x1d0f23[_0x3dd9('0x3b')];}}catch(_0x42c3d7){utils[_0x3dd9('0x2e')](util[_0x3dd9('0x4')]('[%s][recordings][queuecallerjoin]',_0x1d0f23[_0x3dd9('0x6')]),_0x42c3d7);}};exports[_0x3dd9('0x3c')]=function(_0x51612a){try{utils[_0x3dd9('0xe')](util['format'](_0x3dd9('0x3d'),_0x51612a[_0x3dd9('0x6')]),_0x51612a);utils[_0x3dd9('0x3')](util[_0x3dd9('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x51612a[_0x3dd9('0x6')],_0x51612a[_0x3dd9('0x3e')],_0x51612a[_0x3dd9('0x3f')],_0x51612a[_0x3dd9('0x40')],_0x51612a[_0x3dd9('0x41')]));if(recordings[_0x51612a['transfereruniqueid']]&&transfers[_0x3dd9('0xc')][_0x51612a[_0x3dd9('0x42')]]){transfers[_0x3dd9('0xc')][_0x51612a[_0x3dd9('0x42')]][_0x3dd9('0x43')]=!![];}}catch(_0x38f7c3){utils[_0x3dd9('0x2e')](util[_0x3dd9('0x4')](_0x3dd9('0x3d'),_0x51612a[_0x3dd9('0x6')]),_0x38f7c3);}}; \ No newline at end of file +var _0x2d53=['channel','error','[%s][recordings][newchannel]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','./transfers.controller','info','format','uniqueid','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','linkedid','context'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x2d53,0x10d));var _0x32d5=function(_0x1acc03,_0x1794d6){_0x1acc03=_0x1acc03-0x0;var _0x51bc63=_0x2d53[_0x1acc03];return _0x51bc63;};'use strict';var _=require(_0x32d5('0x0'));var util=require('util');var utils=require(_0x32d5('0x1'));var transfers=require(_0x32d5('0x2'));var recordings={};function writeDB(_0x8dbd9a){var _0x1dae5c;utils[_0x32d5('0x3')](util[_0x32d5('0x4')]('[%s][recordings][writeDB]',_0x8dbd9a['uniqueid']));if(transfers['blinds'][_0x8dbd9a[_0x32d5('0x5')]]){_0x1dae5c=_0x8dbd9a[_0x32d5('0x5')];_0x8dbd9a[_0x32d5('0x5')]=transfers['blinds'][_0x8dbd9a[_0x32d5('0x5')]][_0x32d5('0x6')];}if(_0x8dbd9a[_0x32d5('0x7')]){utils['getUserByInternal'](_0x8dbd9a[_0x32d5('0x7')])[_0x32d5('0x8')](function(_0x57535a){if(_0x57535a){_0x8dbd9a[_0x32d5('0x9')]=_0x57535a[_0x32d5('0xa')];_0x8dbd9a[_0x32d5('0xb')]=_0x57535a['id'];}utils[_0x32d5('0xc')](_0x32d5('0xd'),_0x8dbd9a);});}else{utils[_0x32d5('0xc')](_0x32d5('0xd'),_0x8dbd9a);}if(_0x1dae5c)delete transfers[_0x32d5('0xe')][_0x1dae5c];}exports[_0x32d5('0xf')]=function(_0x741789){try{utils[_0x32d5('0x10')](util[_0x32d5('0x4')]('[%s][recordings][newchannel]',_0x741789[_0x32d5('0x5')]),_0x741789);if(_0x741789[_0x32d5('0x5')]==_0x741789[_0x32d5('0x11')]){utils[_0x32d5('0x3')](util[_0x32d5('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x741789[_0x32d5('0x5')],_0x741789[_0x32d5('0x12')],_0x741789['exten']));recordings[_0x741789['uniqueid']]={'uniqueid':_0x741789[_0x32d5('0x5')],'accountcode':_0x741789[_0x32d5('0x7')],'exten':_0x741789['exten'],'context':_0x741789['context'],'channel':_0x741789[_0x32d5('0x13')],'monitors':[]};}}catch(_0x4a5f46){utils[_0x32d5('0x14')](util[_0x32d5('0x4')](_0x32d5('0x15'),_0x741789[_0x32d5('0x5')]),_0x4a5f46);}};exports['newstate']=function(_0x482734){try{utils[_0x32d5('0x10')](util[_0x32d5('0x4')]('[%s][recordings][newstate]',_0x482734[_0x32d5('0x5')]),_0x482734);if(!_[_0x32d5('0x16')](recordings[_0x482734[_0x32d5('0x5')]])&&_0x482734[_0x32d5('0x17')]==0x6){utils['info'](util['format'](_0x32d5('0x18'),_0x482734['uniqueid'],_0x482734[_0x32d5('0x12')],_0x482734[_0x32d5('0x13')]));}else if(!_[_0x32d5('0x16')](recordings[_0x482734[_0x32d5('0x11')]])&&_0x482734['channelstate']==0x6&&_0x482734['context']!=_0x32d5('0x19')){utils[_0x32d5('0x3')](util['format'](_0x32d5('0x1a'),_0x482734['uniqueid'],_0x482734[_0x32d5('0x11')],_0x482734[_0x32d5('0x12')],_0x482734[_0x32d5('0x13')]));recordings[_0x482734[_0x32d5('0x11')]][_0x32d5('0x7')]=_0x482734[_0x32d5('0x7')];}}catch(_0x14fee3){utils['error'](util[_0x32d5('0x4')](_0x32d5('0x1b'),_0x482734[_0x32d5('0x5')]),_0x14fee3);}};exports[_0x32d5('0x1c')]=function(_0x2e9719){try{if(!_[_0x32d5('0x16')](_0x2e9719[_0x32d5('0x1d')])&&!_['isNil'](_0x2e9719[_0x32d5('0x1d')][_0x32d5('0x1e')])){utils['debug'](util[_0x32d5('0x4')](_0x32d5('0x1f'),_0x2e9719[_0x32d5('0x5')]),_0x2e9719);utils[_0x32d5('0x3')](util['format'](_0x32d5('0x20'),_0x2e9719[_0x32d5('0x5')],_0x2e9719[_0x32d5('0x1d')],_0x2e9719['value']));if(_[_0x32d5('0x21')](_0x2e9719['value'],'.wav49')){_0x2e9719[_0x32d5('0x22')]=_0x2e9719[_0x32d5('0x22')][_0x32d5('0x23')](_0x32d5('0x24'),'.WAV');}if(recordings[_0x2e9719[_0x32d5('0x11')]]){var _0x44ab8e=_[_0x32d5('0x25')](recordings[_0x2e9719[_0x32d5('0x11')]][_0x32d5('0x26')],{'value':_0x2e9719['value']});if(_[_0x32d5('0x16')](_0x44ab8e)){recordings[_0x2e9719[_0x32d5('0x11')]][_0x32d5('0x26')][_0x32d5('0x27')]({'value':_0x2e9719[_0x32d5('0x22')]});}}}}catch(_0x13bf44){utils['error'](util[_0x32d5('0x4')](_0x32d5('0x1f'),_0x2e9719[_0x32d5('0x5')]),_0x13bf44);}};exports[_0x32d5('0x28')]=function(_0x309eb6){try{if(!_[_0x32d5('0x16')](recordings[_0x309eb6[_0x32d5('0x5')]])){utils[_0x32d5('0x10')](util['format'](_0x32d5('0x29'),_0x309eb6['uniqueid']),_0x309eb6);utils[_0x32d5('0x3')](util['format'](_0x32d5('0x2a'),_0x309eb6[_0x32d5('0x5')],_0x309eb6[_0x32d5('0x2b')],_0x309eb6[_0x32d5('0x2c')],_0x309eb6[_0x32d5('0x2d')]));recordings[_0x309eb6[_0x32d5('0x5')]][_0x32d5('0x2b')]=_0x309eb6['calleridnum'];recordings[_0x309eb6[_0x32d5('0x5')]][_0x32d5('0x2c')]=_0x309eb6[_0x32d5('0x2c')];recordings[_0x309eb6[_0x32d5('0x5')]]['connectedlinenum']=_0x309eb6[_0x32d5('0x2e')];recordings[_0x309eb6[_0x32d5('0x5')]][_0x32d5('0x2f')]=_0x309eb6['connectedlinename'];if(recordings[_0x309eb6['uniqueid']]['type']=='outbound'&&recordings[_0x309eb6[_0x32d5('0x5')]]['accountcode']){recordings[_0x309eb6['uniqueid']][_0x32d5('0x2e')]=recordings[_0x309eb6['uniqueid']][_0x32d5('0x7')];recordings[_0x309eb6[_0x32d5('0x5')]][_0x32d5('0x2f')]='';}recordings[_0x309eb6[_0x32d5('0x5')]][_0x32d5('0x26')][_0x32d5('0x30')](function(_0x46bbe9){var _0x4ab36e=_['clone'](recordings[_0x309eb6[_0x32d5('0x5')]]);_0x4ab36e[_0x32d5('0x22')]=_0x46bbe9[_0x32d5('0x22')];writeDB(_0x4ab36e);});delete recordings[_0x309eb6[_0x32d5('0x5')]];}}catch(_0x22092b){utils['error'](util[_0x32d5('0x4')](_0x32d5('0x29'),_0x309eb6[_0x32d5('0x5')]),_0x22092b);}};exports[_0x32d5('0x31')]=function(_0x39fb9b){try{if(!_['isNil'](recordings[_0x39fb9b[_0x32d5('0x5')]])){utils[_0x32d5('0x10')](util[_0x32d5('0x4')](_0x32d5('0x32'),_0x39fb9b['uniqueid']),_0x39fb9b);utils['info'](util[_0x32d5('0x4')](_0x32d5('0x33'),_0x39fb9b[_0x32d5('0x5')],_0x39fb9b[_0x32d5('0x34')],_0x39fb9b[_0x32d5('0x35')]));if(_0x39fb9b[_0x32d5('0x34')][_0x32d5('0x36')]()==_0x32d5('0x37')&&_[_0x32d5('0x38')](_0x39fb9b['appdata'][_0x32d5('0x36')](),_0x32d5('0x39'))){var _0x4b736c=_0x39fb9b[_0x32d5('0x35')][_0x32d5('0x3a')]('=');var _0x837382=_0x4b736c[0x0]['substring'](_0x4b736c[0x0]['lastIndexOf']('(')+0x1,_0x4b736c[0x0][_0x32d5('0x3b')](')'));var _0x2f8790=_0x4b736c[0x1];recordings[_0x39fb9b[_0x32d5('0x5')]][_0x837382]=_0x2f8790;}}}catch(_0x145a5a){utils[_0x32d5('0x14')](util[_0x32d5('0x4')]('[%s][recordings][newexten]',_0x39fb9b[_0x32d5('0x5')]),_0x145a5a);}};exports[_0x32d5('0x3c')]=function(_0x200b90){try{if(!_[_0x32d5('0x16')](recordings[_0x200b90[_0x32d5('0x5')]])){utils[_0x32d5('0x10')](util['format'](_0x32d5('0x3d'),_0x200b90[_0x32d5('0x5')]),_0x200b90);utils[_0x32d5('0x3')](util['format'](_0x32d5('0x3e'),_0x200b90[_0x32d5('0x5')],_0x200b90[_0x32d5('0x3f')]));recordings[_0x200b90[_0x32d5('0x5')]][_0x32d5('0x3f')]=_0x200b90[_0x32d5('0x3f')];}}catch(_0x40342c){utils['error'](util[_0x32d5('0x4')](_0x32d5('0x3d'),_0x200b90[_0x32d5('0x5')]),_0x40342c);}};exports[_0x32d5('0x40')]=function(_0x47d1cc){try{utils[_0x32d5('0x10')](util[_0x32d5('0x4')](_0x32d5('0x41'),_0x47d1cc[_0x32d5('0x5')]),_0x47d1cc);utils[_0x32d5('0x3')](util[_0x32d5('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x47d1cc['uniqueid'],_0x47d1cc[_0x32d5('0x42')],_0x47d1cc[_0x32d5('0x43')],_0x47d1cc[_0x32d5('0x44')],_0x47d1cc[_0x32d5('0x45')]));if(recordings[_0x47d1cc[_0x32d5('0x46')]]&&transfers[_0x32d5('0xe')][_0x47d1cc[_0x32d5('0x46')]]){transfers['blinds'][_0x47d1cc[_0x32d5('0x46')]][_0x32d5('0x47')]=!![];}}catch(_0x39e69d){utils['error'](util[_0x32d5('0x4')](_0x32d5('0x41'),_0x47d1cc['uniqueid']),_0x39e69d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 1a3bd7d..65e008e 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 _0x6b50=['transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x289fd4,_0xd34ba6){var _0x3d4a88=function(_0x2a3726){while(--_0x2a3726){_0x289fd4['push'](_0x289fd4['shift']());}};_0x3d4a88(++_0xd34ba6);}(_0x6b50,0xcb));var _0x06b5=function(_0x386363,_0x20ec0a){_0x386363=_0x386363-0x0;var _0x21a430=_0x6b50[_0x386363];return _0x21a430;};'use strict';var _=require(_0x06b5('0x0'));var util=require(_0x06b5('0x1'));var utils=require(_0x06b5('0x2'));function writeDB(_0x539cac){utils[_0x06b5('0x3')](util[_0x06b5('0x4')](_0x06b5('0x5'),_0x539cac['type']===_0x06b5('0x6')?_0x539cac['origtransfereruniqueid']:_0x539cac[_0x06b5('0x7')],_0x539cac[_0x06b5('0x8')]));utils[_0x06b5('0x9')]('CreateVoiceTransferReport',_0x539cac);}exports[_0x06b5('0xa')]={};exports[_0x06b5('0xb')]=function(_0x208cd2){try{utils[_0x06b5('0xc')](util['format']('[%s][transfers][blindtransfer]',_0x208cd2['uniqueid']),_0x208cd2);utils[_0x06b5('0x3')](util[_0x06b5('0x4')](_0x06b5('0xd'),_0x208cd2[_0x06b5('0x7')],_0x208cd2[_0x06b5('0xe')],_0x208cd2['transferercalleridname'],_0x208cd2['transfereecalleridnum'],_0x208cd2[_0x06b5('0xf')]));_0x208cd2[_0x06b5('0x8')]=_0x06b5('0x10');exports['blinds'][_0x208cd2[_0x06b5('0x11')]]=_0x208cd2;writeDB(_0x208cd2);}catch(_0x711cf0){utils[_0x06b5('0x12')](util[_0x06b5('0x4')](_0x06b5('0x13'),_0x208cd2[_0x06b5('0x7')]),_0x711cf0);}};exports[_0x06b5('0x14')]=function(_0x44e6ed){try{utils['debug'](util[_0x06b5('0x4')](_0x06b5('0x15'),_0x44e6ed[_0x06b5('0x16')]),_0x44e6ed);utils[_0x06b5('0x3')](util[_0x06b5('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x44e6ed['origtransfereruniqueid'],_0x44e6ed[_0x06b5('0x17')],_0x44e6ed[_0x06b5('0x18')],_0x44e6ed[_0x06b5('0x19')],_0x44e6ed['transfertargetcalleridname']));_0x44e6ed=_[_0x06b5('0x1a')](_0x44e6ed,{'transfererchannel':_0x44e6ed[_0x06b5('0x1b')],'transferercalleridnum':_0x44e6ed[_0x06b5('0x17')],'transferercalleridname':_0x44e6ed[_0x06b5('0x18')],'transfererconnectedlinenum':_0x44e6ed[_0x06b5('0x1c')],'transfererconnectedlinename':_0x44e6ed['secondtransfererconnectedlinename'],'transfereraccountcode':_0x44e6ed[_0x06b5('0x1d')],'transferercontext':_0x44e6ed['secondtransferercontext'],'transfererexten':_0x44e6ed['secondtransfererexten'],'transfererlinkedid':_0x44e6ed[_0x06b5('0x1e')],'context':_0x44e6ed[_0x06b5('0x1f')],'extension':_0x44e6ed[_0x06b5('0x20')],'type':'attended'});if(_[_0x06b5('0x21')](_0x44e6ed[_0x06b5('0x22')])){_0x44e6ed=_[_0x06b5('0x1a')](_0x44e6ed,{'transfereechannel':_0x44e6ed['transfertargetchannel'],'transfereecalleridnum':_0x44e6ed['transfertargetcalleridnum'],'transfereecalleridname':_0x44e6ed[_0x06b5('0x23')],'transfereeconnectedlinenum':_0x44e6ed[_0x06b5('0x24')],'transfereeconnectedlinename':_0x44e6ed[_0x06b5('0x25')],'transfereeaccountcode':_0x44e6ed['transfertargetaccountcode'],'transfereecontext':_0x44e6ed[_0x06b5('0x26')],'transfereeexten':_0x44e6ed['transfertargetexten'],'transfereelinkedid':_0x44e6ed[_0x06b5('0x27')]});}writeDB(_0x44e6ed);}catch(_0x3b97ad){utils[_0x06b5('0x12')](util['format'](_0x06b5('0x15'),_0x44e6ed[_0x06b5('0x16')]),_0x3b97ad);}}; \ No newline at end of file +var _0x49ce=['origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererexten','origtransferercontext'];(function(_0x2a5409,_0x5ad407){var _0x1f9c1d=function(_0x37d2a6){while(--_0x37d2a6){_0x2a5409['push'](_0x2a5409['shift']());}};_0x1f9c1d(++_0x5ad407);}(_0x49ce,0x179));var _0xe49c=function(_0x31bbf7,_0x292c9a){_0x31bbf7=_0x31bbf7-0x0;var _0x1469f3=_0x49ce[_0x31bbf7];return _0x1469f3;};'use strict';var _=require(_0xe49c('0x0'));var util=require(_0xe49c('0x1'));var utils=require(_0xe49c('0x2'));function writeDB(_0x15d845){utils['info'](util[_0xe49c('0x3')](_0xe49c('0x4'),_0x15d845['type']==='attended'?_0x15d845[_0xe49c('0x5')]:_0x15d845['uniqueid'],_0x15d845[_0xe49c('0x6')]));utils[_0xe49c('0x7')](_0xe49c('0x8'),_0x15d845);}exports[_0xe49c('0x9')]={};exports[_0xe49c('0xa')]=function(_0xb90106){try{utils['debug'](util[_0xe49c('0x3')]('[%s][transfers][blindtransfer]',_0xb90106[_0xe49c('0xb')]),_0xb90106);utils[_0xe49c('0xc')](util[_0xe49c('0x3')](_0xe49c('0xd'),_0xb90106['uniqueid'],_0xb90106['transferercalleridnum'],_0xb90106[_0xe49c('0xe')],_0xb90106[_0xe49c('0xf')],_0xb90106[_0xe49c('0x10')]));_0xb90106[_0xe49c('0x6')]=_0xe49c('0x11');exports[_0xe49c('0x9')][_0xb90106[_0xe49c('0x12')]]=_0xb90106;writeDB(_0xb90106);}catch(_0x33eb80){utils[_0xe49c('0x13')](util[_0xe49c('0x3')](_0xe49c('0x14'),_0xb90106['uniqueid']),_0x33eb80);}};exports[_0xe49c('0x15')]=function(_0x352043){try{utils[_0xe49c('0x16')](util[_0xe49c('0x3')](_0xe49c('0x17'),_0x352043[_0xe49c('0x5')]),_0x352043);utils[_0xe49c('0xc')](util[_0xe49c('0x3')](_0xe49c('0x18'),_0x352043[_0xe49c('0x5')],_0x352043[_0xe49c('0x19')],_0x352043[_0xe49c('0x1a')],_0x352043[_0xe49c('0x1b')],_0x352043[_0xe49c('0x1c')]));_0x352043=_[_0xe49c('0x1d')](_0x352043,{'transfererchannel':_0x352043[_0xe49c('0x1e')],'transferercalleridnum':_0x352043[_0xe49c('0x19')],'transferercalleridname':_0x352043['origtransferercalleridname'],'transfererconnectedlinenum':_0x352043['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x352043['secondtransfererconnectedlinename'],'transfereraccountcode':_0x352043['origtransfereraccountcode'],'transferercontext':_0x352043['secondtransferercontext'],'transfererexten':_0x352043[_0xe49c('0x1f')],'transfererlinkedid':_0x352043['origtransfererlinkedid'],'context':_0x352043[_0xe49c('0x20')],'extension':_0x352043[_0xe49c('0x21')],'type':'attended'});if(_[_0xe49c('0x22')](_0x352043[_0xe49c('0x23')])){_0x352043=_[_0xe49c('0x1d')](_0x352043,{'transfereechannel':_0x352043[_0xe49c('0x24')],'transfereecalleridnum':_0x352043[_0xe49c('0x1b')],'transfereecalleridname':_0x352043[_0xe49c('0x1c')],'transfereeconnectedlinenum':_0x352043[_0xe49c('0x25')],'transfereeconnectedlinename':_0x352043['transfertargetconnectedlinename'],'transfereeaccountcode':_0x352043['transfertargetaccountcode'],'transfereecontext':_0x352043[_0xe49c('0x26')],'transfereeexten':_0x352043[_0xe49c('0x27')],'transfereelinkedid':_0x352043[_0xe49c('0x28')]});}writeDB(_0x352043);}catch(_0x114d7c){utils[_0xe49c('0x13')](util[_0xe49c('0x3')](_0xe49c('0x17'),_0x352043[_0xe49c('0x5')]),_0x114d7c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 92046e0..f27ce37 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 _0xcf6d=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','http','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xcf6d,0x16a));var _0xdcf6=function(_0xebfc09,_0x3556b0){_0xebfc09=_0xebfc09-0x0;var _0x52832d=_0xcf6d[_0xebfc09];return _0x52832d;};'use strict';var BPromise=require(_0xdcf6('0x0'));var jayson=require('jayson/promise');var moment=require(_0xdcf6('0x1'));var util=require(_0xdcf6('0x2'));var client=jayson['client'][_0xdcf6('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xdcf6('0x4'));exports['info']=function(_0x18250c,_0xb853a0){logger[_0xdcf6('0x5')](_0x18250c,_0xb853a0?util['inspect'](_0xb853a0,{'showHidden':![],'depth':null}):'');};exports[_0xdcf6('0x6')]=function(_0x5c81dd,_0x72b9fb){logger[_0xdcf6('0x6')](_0x5c81dd,_0x72b9fb?util['inspect'](_0x72b9fb,{'showHidden':![],'depth':null}):'');};exports[_0xdcf6('0x7')]=function(_0x2d1b04,_0x3104e4){logger['error'](_0x2d1b04,_0x3104e4?util[_0xdcf6('0x8')](_0x3104e4,{'showHidden':![],'depth':null}):'');};exports[_0xdcf6('0x9')]=function(_0x2afde1,_0x528635){return client[_0xdcf6('0x9')](_0x2afde1,{'body':_0x528635})[_0xdcf6('0xa')](function(_0x4880ae){logger['debug'](_0xdcf6('0xb'),_0x2afde1,_0x4880ae?util[_0xdcf6('0x8')](_0x4880ae,{'showHidden':![],'depth':null}):'');})[_0xdcf6('0xc')](function(_0x383179){logger[_0xdcf6('0x7')](_0xdcf6('0xb'),_0x2afde1,_0x383179?util['inspect'](_0x383179,{'showHidden':![],'depth':null}):'');});};function getUser(_0x79baf9){return client[_0xdcf6('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xdcf6('0xd'),_0xdcf6('0xe')],'where':_0x79baf9,'limit':0x1}})[_0xdcf6('0xa')](function(_0x1107c8){logger['debug'](_0xdcf6('0xf'),JSON[_0xdcf6('0x10')](_0x79baf9),_0x1107c8?util['inspect'](_0x1107c8,{'showHidden':![],'depth':null}):'');return _0x1107c8['result'][_0xdcf6('0x11')]?_0x1107c8[_0xdcf6('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x2a8a3e){return new BPromise(function(_0x2e73d3,_0x37072d){if(_0x2a8a3e){return getUser({'internal':_0x2a8a3e})[_0xdcf6('0xa')](function(_0x9249ad){logger['info'](_0xdcf6('0x13'),_0x2a8a3e,_0x9249ad?_0xdcf6('0x14'):_0xdcf6('0x15'));return _0x2e73d3(_0x9249ad);})[_0xdcf6('0xc')](function(_0x315306){logger[_0xdcf6('0x7')](_0xdcf6('0x16'),_0x315306?util[_0xdcf6('0x8')](_0x315306,{'showHidden':![],'depth':null}):'');return _0x2e73d3(null);});}return _0x2e73d3(null);});};exports[_0xdcf6('0x17')]=function(_0x386ecf){return new BPromise(function(_0x25f2d6,_0x26ba51){if(_0x386ecf){return getUser({'interface':_0x386ecf})[_0xdcf6('0xa')](function(_0x4c5056){logger[_0xdcf6('0x5')](_0xdcf6('0x18'),_0x386ecf,_0x4c5056?_0xdcf6('0x14'):_0xdcf6('0x15'));return _0x25f2d6(_0x4c5056);})[_0xdcf6('0xc')](function(_0x167154){logger[_0xdcf6('0x7')]('[utils][getUserByInterface]',_0x167154?util[_0xdcf6('0x8')](_0x167154,{'showHidden':![],'depth':null}):'');return _0x25f2d6(null);});}return _0x25f2d6(null);});};exports['getUserByName']=function(_0x360635){return new BPromise(function(_0x280e26,_0x1d237a){if(_0x360635){return getUser({'name':_0x360635})[_0xdcf6('0xa')](function(_0x554c58){logger[_0xdcf6('0x5')](_0xdcf6('0x19'),_0x360635,_0x554c58?_0xdcf6('0x14'):'notfound');return _0x280e26(_0x554c58);})[_0xdcf6('0xc')](function(_0x441d19){logger[_0xdcf6('0x7')](_0xdcf6('0x1a'),_0x441d19?util['inspect'](_0x441d19,{'showHidden':![],'depth':null}):'');return _0x280e26(null);});}return _0x280e26(null);});};exports[_0xdcf6('0x1b')]=function(_0x25427d){return new BPromise(function(_0x134428,_0x225a98){if(_0x25427d){return client[_0xdcf6('0x9')](_0xdcf6('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xdcf6('0xd'),'type','acw',_0xdcf6('0x1d')],'where':{'name':_0x25427d},'limit':0x1}})['then'](function(_0x473d83){logger[_0xdcf6('0x6')](_0xdcf6('0x1e'),_0x25427d,_0x473d83?util[_0xdcf6('0x8')](_0x473d83,{'showHidden':![],'depth':null}):'');logger[_0xdcf6('0x5')](_0xdcf6('0x1f'),_0x25427d,_0x473d83?_0xdcf6('0x14'):_0xdcf6('0x15'));return _0x134428(_0x473d83[_0xdcf6('0x12')][_0xdcf6('0x11')]?_0x473d83['result'][0x0]:null);})['catch'](function(_0xc0809a){logger[_0xdcf6('0x7')](_0xdcf6('0x20'),_0xc0809a?util['inspect'](_0xc0809a,{'showHidden':![],'depth':null}):'');return _0x134428(null);});}return _0x134428(null);});};exports[_0xdcf6('0x21')]=function(_0x4cae72,_0x5e9f65){return moment(_0x4cae72)[_0xdcf6('0x22')](_0x5e9f65,_0xdcf6('0x23'))[_0xdcf6('0x24')](_0xdcf6('0x25'));};exports['subtractTime']=function(_0x2b4767,_0x3938e1){return moment(_0x2b4767)['subtract'](_0x3938e1,'seconds')[_0xdcf6('0x24')](_0xdcf6('0x25'));};exports[_0xdcf6('0x26')]=function(_0x32112d,_0x448a9d){return moment(_0x32112d)[_0xdcf6('0x27')](moment(_0x448a9d),'seconds');};exports[_0xdcf6('0x28')]=function(_0x40ebaa,_0x14f05c){return parseInt(_0x40ebaa,0xa)+parseInt(_0x14f05c,0xa);};exports[_0xdcf6('0x29')]=function(){return moment()[_0xdcf6('0x24')](_0xdcf6('0x25'));};exports['isAfter']=function(_0x4b07ae,_0x51455b){if(_0x51455b){return moment(_0x4b07ae)[_0xdcf6('0x2a')](_0x51455b);}return!![];};exports[_0xdcf6('0x2b')]=function(_0x4eb801,_0x20a2bb){if(_0x20a2bb){return moment(_0x4eb801)[_0xdcf6('0x2b')](_0x20a2bb);}else if(_0x4eb801){return!![];}return![];}; \ No newline at end of file +var _0x53ec=['util','client','http','xdr','inspect','error','request','catch','GetUser','internal','name','interface','then','debug','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','getUserByName','info','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x53ec,0x192));var _0xc53e=function(_0x401ec9,_0x77c73f){_0x401ec9=_0x401ec9-0x0;var _0x8ef3a1=_0x53ec[_0x401ec9];return _0x8ef3a1;};'use strict';var BPromise=require(_0xc53e('0x0'));var jayson=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var util=require(_0xc53e('0x3'));var client=jayson[_0xc53e('0x4')][_0xc53e('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xc53e('0x6'));exports['info']=function(_0x2b90f6,_0x38033d){logger['info'](_0x2b90f6,_0x38033d?util[_0xc53e('0x7')](_0x38033d,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x41a9e8,_0x2de88b){logger['debug'](_0x41a9e8,_0x2de88b?util[_0xc53e('0x7')](_0x2de88b,{'showHidden':![],'depth':null}):'');};exports[_0xc53e('0x8')]=function(_0x8b231f,_0x2cb51d){logger[_0xc53e('0x8')](_0x8b231f,_0x2cb51d?util[_0xc53e('0x7')](_0x2cb51d,{'showHidden':![],'depth':null}):'');};exports[_0xc53e('0x9')]=function(_0x361e9d,_0xa98198){return client['request'](_0x361e9d,{'body':_0xa98198})['then'](function(_0x35128a){logger['debug']('[utils][request]\x20name:%s',_0x361e9d,_0x35128a?util[_0xc53e('0x7')](_0x35128a,{'showHidden':![],'depth':null}):'');})[_0xc53e('0xa')](function(_0x863fa){logger[_0xc53e('0x8')]('[utils][request]\x20name:%s',_0x361e9d,_0x863fa?util['inspect'](_0x863fa,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1c06cd){return client[_0xc53e('0x9')](_0xc53e('0xb'),{'options':{'raw':!![],'attributes':['id',_0xc53e('0xc'),_0xc53e('0xd'),_0xc53e('0xe')],'where':_0x1c06cd,'limit':0x1}})[_0xc53e('0xf')](function(_0x19c0d1){logger[_0xc53e('0x10')](_0xc53e('0x11'),JSON['stringify'](_0x1c06cd),_0x19c0d1?util[_0xc53e('0x7')](_0x19c0d1,{'showHidden':![],'depth':null}):'');return _0x19c0d1[_0xc53e('0x12')][_0xc53e('0x13')]?_0x19c0d1[_0xc53e('0x12')][0x0]:null;});}exports[_0xc53e('0x14')]=function(_0x270c78){return new BPromise(function(_0x164016,_0x2d4ebb){if(_0x270c78){return getUser({'internal':_0x270c78})[_0xc53e('0xf')](function(_0x5d1098){logger['info'](_0xc53e('0x15'),_0x270c78,_0x5d1098?_0xc53e('0x16'):_0xc53e('0x17'));return _0x164016(_0x5d1098);})[_0xc53e('0xa')](function(_0x20066e){logger[_0xc53e('0x8')](_0xc53e('0x18'),_0x20066e?util[_0xc53e('0x7')](_0x20066e,{'showHidden':![],'depth':null}):'');return _0x164016(null);});}return _0x164016(null);});};exports[_0xc53e('0x19')]=function(_0x401af6){return new BPromise(function(_0x17d825,_0x44fd93){if(_0x401af6){return getUser({'interface':_0x401af6})[_0xc53e('0xf')](function(_0x4fb695){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x401af6,_0x4fb695?_0xc53e('0x16'):_0xc53e('0x17'));return _0x17d825(_0x4fb695);})[_0xc53e('0xa')](function(_0x4015c8){logger[_0xc53e('0x8')]('[utils][getUserByInterface]',_0x4015c8?util['inspect'](_0x4015c8,{'showHidden':![],'depth':null}):'');return _0x17d825(null);});}return _0x17d825(null);});};exports[_0xc53e('0x1a')]=function(_0x496167){return new BPromise(function(_0x1ae55e,_0x3a5ce8){if(_0x496167){return getUser({'name':_0x496167})[_0xc53e('0xf')](function(_0x1166e6){logger[_0xc53e('0x1b')]('[utils][getUserByName]\x20name:%s\x20%s',_0x496167,_0x1166e6?_0xc53e('0x16'):'notfound');return _0x1ae55e(_0x1166e6);})['catch'](function(_0x5c65d3){logger[_0xc53e('0x8')]('[utils][getUserByName]',_0x5c65d3?util[_0xc53e('0x7')](_0x5c65d3,{'showHidden':![],'depth':null}):'');return _0x1ae55e(null);});}return _0x1ae55e(null);});};exports['getVoiceQueueByName']=function(_0x24a77e){return new BPromise(function(_0x5112d2,_0x5ce216){if(_0x24a77e){return client[_0xc53e('0x9')](_0xc53e('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xc53e('0xd'),_0xc53e('0x1d'),_0xc53e('0x1e'),_0xc53e('0x1f')],'where':{'name':_0x24a77e},'limit':0x1}})[_0xc53e('0xf')](function(_0x2a2ca9){logger['debug'](_0xc53e('0x20'),_0x24a77e,_0x2a2ca9?util[_0xc53e('0x7')](_0x2a2ca9,{'showHidden':![],'depth':null}):'');logger[_0xc53e('0x1b')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x24a77e,_0x2a2ca9?_0xc53e('0x16'):'notfound');return _0x5112d2(_0x2a2ca9[_0xc53e('0x12')][_0xc53e('0x13')]?_0x2a2ca9['result'][0x0]:null);})['catch'](function(_0x3cd8a1){logger[_0xc53e('0x8')](_0xc53e('0x21'),_0x3cd8a1?util[_0xc53e('0x7')](_0x3cd8a1,{'showHidden':![],'depth':null}):'');return _0x5112d2(null);});}return _0x5112d2(null);});};exports[_0xc53e('0x22')]=function(_0x45fedc,_0x40a8db){return moment(_0x45fedc)[_0xc53e('0x23')](_0x40a8db,'seconds')[_0xc53e('0x24')](_0xc53e('0x25'));};exports[_0xc53e('0x26')]=function(_0x17ad32,_0x1eca5b){return moment(_0x17ad32)[_0xc53e('0x27')](_0x1eca5b,_0xc53e('0x28'))[_0xc53e('0x24')](_0xc53e('0x25'));};exports['diffTime']=function(_0x3e395c,_0x48d7d0){return moment(_0x3e395c)[_0xc53e('0x29')](moment(_0x48d7d0),_0xc53e('0x28'));};exports['sumTime']=function(_0x37452a,_0x154f8b){return parseInt(_0x37452a,0xa)+parseInt(_0x154f8b,0xa);};exports[_0xc53e('0x2a')]=function(){return moment()['format'](_0xc53e('0x25'));};exports[_0xc53e('0x2b')]=function(_0x10a90d,_0x78eb5e){if(_0x78eb5e){return moment(_0x10a90d)[_0xc53e('0x2b')](_0x78eb5e);}return!![];};exports[_0xc53e('0x2c')]=function(_0x312c1b,_0x482085){if(_0x482085){return moment(_0x312c1b)[_0xc53e('0x2c')](_0x482085);}else if(_0x312c1b){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index fcb9f7d..9363156 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2c4=['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','connection','statusCode','other','agent_name','test','url','setupLoggers','fs-extra','express-winston','path','util','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','name','ensureDir','then','catch','user','data','timestamp','error','api','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','remoteAddress','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device'];(function(_0x4df343,_0x1470d8){var _0x5cfd7c=function(_0x1d63d3){while(--_0x1d63d3){_0x4df343['push'](_0x4df343['shift']());}};_0x5cfd7c(++_0x1470d8);}(_0xe2c4,0x182));var _0x4e2c=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xe2c4[_0x88cd7b];return _0x56fcc8;};var fs=require(_0x4e2c('0x0'));var _=require('lodash');var ewinston=require(_0x4e2c('0x1'));var path=require(_0x4e2c('0x2'));var util=require(_0x4e2c('0x3'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x4e2c('0x4'))[_0x4e2c('0x5')];var maskSensitiveData=require(_0x4e2c('0x6'))[_0x4e2c('0x7')];function ClientSideLogger(){function _0x8fde61(_0x4c13c9){var _0x284f91=path[_0x4e2c('0x8')](_0x4e2c('0x9'),_0x4e2c('0xa'),_0x4e2c('0xb'));var _0xe9e66e=path[_0x4e2c('0x8')](_0x4e2c('0xc'),_0x4c13c9['role']+'-'+_0x4c13c9[_0x4e2c('0xd')]);return fs[_0x4e2c('0xe')](path['join'](_0x284f91,_0xe9e66e))[_0x4e2c('0xf')](function(){var _0x1c1570=fileLogger(_0x4e2c('0xc'),path[_0x4e2c('0x8')](_0x284f91,_0xe9e66e));return _0x1c1570;})[_0x4e2c('0x10')](function(_0x359f96){throw _0x359f96;});}this[_0x4e2c('0xa')]=function(_0x4ce419,_0x3bc0a5,_0x1ab5c2,_0x3cbd22){return _0x8fde61(_0x4ce419[_0x4e2c('0x11')])[_0x4e2c('0xf')](function(_0x1de8cc){var _0x5e96f9=_0x1de8cc[_0x3bc0a5];return _0x5e96f9;})[_0x4e2c('0xf')](function(_0x3cbd24){var _0x34726f=_0x4ce419[_0x4e2c('0x11')]?_0x4ce419[_0x4e2c('0x11')]['id']:'no-user';var _0x21d1cc=_0x3cbd22[_0x4e2c('0x12')];var _0x22ff4d=_0x3cbd22[_0x4e2c('0x13')];var _0x5d743b=new Date(Number(_0x22ff4d));return _0x3cbd24(_0x34726f,_0x5d743b,_0x1ab5c2,_0x21d1cc);})[_0x4e2c('0x10')](function(_0x4c4421){fileLogger(_0x4e2c('0xc'))[_0x4e2c('0x14')](_0x4c4421);});};}function setupLoggers(_0x1c2d92){return new Promise(function(_0x195b9c){var _0x49a5be=new ClientSideLogger();var _0x26670c=fileLogger(_0x4e2c('0x15'));var _0x2e68f0=fileLogger('auth');_0x1c2d92['set'](_0x4e2c('0x16'),_0x49a5be);_0x1c2d92[_0x4e2c('0x17')](ewinston['logger']({'winstonInstance':_0x26670c,'meta':![],'statusLevels':!![],'msg':function(_0x8c0138,_0x5b2269){var _0x1eb929=_0x4e2c('0x18');if(!_[_0x4e2c('0x19')](_0x8c0138[_0x4e2c('0x1a')])){_0x1eb929+=_0x4e2c('0x1b');var _0x53544d=_0x8c0138[_0x4e2c('0x1a')];maskSensitiveData(_0x53544d);}return safeTemplate(util[_0x4e2c('0x1c')](_0x1eb929,_0x8c0138['method'],_0x8c0138[_0x4e2c('0x1d')]['x-forwarded-for']?_0x8c0138[_0x4e2c('0x1d')][_0x4e2c('0x1e')]:_0x8c0138['connection'][_0x4e2c('0x1f')]||_0x8c0138['ip'],_0x8c0138['url'],_0x5b2269['statusCode'],_0x5b2269[_0x4e2c('0x20')],_0x8c0138[_0x4e2c('0x11')]?_0x8c0138['user']['id']:null,_0x8c0138[_0x4e2c('0x11')]?_0x8c0138[_0x4e2c('0x11')][_0x4e2c('0xd')]:null,_0x8c0138[_0x4e2c('0x11')]?_0x8c0138[_0x4e2c('0x11')][_0x4e2c('0x21')]:null,_0x53544d?util[_0x4e2c('0x22')](_0x53544d,![],null):''));}}));_0x1c2d92[_0x4e2c('0x17')](ewinston['logger']({'winstonInstance':_0x2e68f0,'meta':![],'statusLevels':!![],'msg':function(_0x326b3b,_0x1cb564){var _0x16ddf5=_0x4e2c('0x23');if(_0x326b3b[_0x4e2c('0x1a')]&&_0x326b3b['body'][_0x4e2c('0x24')]&&_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x25')]){_0x16ddf5=_0x4e2c('0x26');}return util[_0x4e2c('0x1c')](_0x16ddf5,_0x326b3b[_0x4e2c('0x27')],_0x326b3b[_0x4e2c('0x1d')][_0x4e2c('0x1e')]?_0x326b3b[_0x4e2c('0x1d')]['x-forwarded-for']:_0x326b3b[_0x4e2c('0x28')][_0x4e2c('0x1f')]||_0x326b3b['ip'],_0x326b3b['url'],_0x1cb564[_0x4e2c('0x29')],_0x1cb564[_0x4e2c('0x20')],_0x326b3b[_0x4e2c('0x11')]?_0x326b3b['user']['id']:null,_0x326b3b[_0x4e2c('0x11')]?_0x326b3b[_0x4e2c('0x11')][_0x4e2c('0xd')]:null,_0x326b3b['user']?_0x326b3b[_0x4e2c('0x11')][_0x4e2c('0x21')]:null,_0x326b3b[_0x4e2c('0x1a')]&&_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x24')]?_0x326b3b[_0x4e2c('0x1a')]['device']:_0x4e2c('0x2a'),_0x326b3b[_0x4e2c('0x1a')]&&_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x25')]?_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x25')]:'',_0x326b3b[_0x4e2c('0x1a')]&&_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x2b')]?_0x326b3b[_0x4e2c('0x1a')][_0x4e2c('0x2b')]:'');},'ignoreRoute':function(_0xf5e3da){var _0x3c56b3=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3c56b3[_0x4e2c('0x2c')](_0xf5e3da[_0x4e2c('0x2d')]);}}));return _0x195b9c();});}exports[_0x4e2c('0x2e')]=setupLoggers; \ No newline at end of file +var _0xe81c=['error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','url','statusCode','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','responseTime','agent_id','agent_name','test','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','role','name','ensureDir','then','client','catch','user','no-user','data','timestamp'];(function(_0x585667,_0x493fd7){var _0x2e0da9=function(_0x3defff){while(--_0x3defff){_0x585667['push'](_0x585667['shift']());}};_0x2e0da9(++_0x493fd7);}(_0xe81c,0xde));var _0xce81=function(_0x49b984,_0x387c83){_0x49b984=_0x49b984-0x0;var _0x49d1e0=_0xe81c[_0x49b984];return _0x49d1e0;};var fs=require(_0xce81('0x0'));var _=require(_0xce81('0x1'));var ewinston=require(_0xce81('0x2'));var path=require(_0xce81('0x3'));var util=require(_0xce81('0x4'));var fileLogger=require(_0xce81('0x5'))[_0xce81('0x6')];var safeTemplate=require(_0xce81('0x7'))[_0xce81('0x8')];var maskSensitiveData=require(_0xce81('0x9'))['maskSensitiveData'];function ClientSideLogger(){function _0xba2bbd(_0x2fea69){var _0x15bae6=path[_0xce81('0xa')](_0xce81('0xb'),_0xce81('0xc'),'xcally');var _0x36ac0c=path[_0xce81('0xa')]('client',_0x2fea69[_0xce81('0xd')]+'-'+_0x2fea69[_0xce81('0xe')]);return fs[_0xce81('0xf')](path['join'](_0x15bae6,_0x36ac0c))[_0xce81('0x10')](function(){var _0x17d747=fileLogger(_0xce81('0x11'),path[_0xce81('0xa')](_0x15bae6,_0x36ac0c));return _0x17d747;})[_0xce81('0x12')](function(_0x2b4b41){throw _0x2b4b41;});}this[_0xce81('0xc')]=function(_0x586a93,_0xe9d5aa,_0x228f2a,_0x2f4388){return _0xba2bbd(_0x586a93[_0xce81('0x13')])[_0xce81('0x10')](function(_0x2bb684){var _0x47b94c=_0x2bb684[_0xe9d5aa];return _0x47b94c;})['then'](function(_0x48b75f){var _0xc24447=_0x586a93['user']?_0x586a93[_0xce81('0x13')]['id']:_0xce81('0x14');var _0x12ccd9=_0x2f4388[_0xce81('0x15')];var _0x1c0cef=_0x2f4388[_0xce81('0x16')];var _0x43568e=new Date(Number(_0x1c0cef));return _0x48b75f(_0xc24447,_0x43568e,_0x228f2a,_0x12ccd9);})['catch'](function(_0x2737d6){fileLogger(_0xce81('0x11'))[_0xce81('0x17')](_0x2737d6);});};}function setupLoggers(_0x5686b){return new Promise(function(_0x294a77){var _0x4c88f5=new ClientSideLogger();var _0x43e630=fileLogger(_0xce81('0x18'));var _0x2671da=fileLogger(_0xce81('0x19'));_0x5686b[_0xce81('0x1a')](_0xce81('0x1b'),_0x4c88f5);_0x5686b['use'](ewinston[_0xce81('0x1c')]({'winstonInstance':_0x43e630,'meta':![],'statusLevels':!![],'msg':function(_0x59b315,_0x3af281){var _0x25637c=_0xce81('0x1d');if(!_[_0xce81('0x1e')](_0x59b315[_0xce81('0x1f')])){_0x25637c+=_0xce81('0x20');var _0x7ad646=_0x59b315[_0xce81('0x1f')];maskSensitiveData(_0x7ad646);}return safeTemplate(util[_0xce81('0x21')](_0x25637c,_0x59b315[_0xce81('0x22')],_0x59b315['headers'][_0xce81('0x23')]?_0x59b315['headers']['x-forwarded-for']:_0x59b315[_0xce81('0x24')][_0xce81('0x25')]||_0x59b315['ip'],_0x59b315[_0xce81('0x26')],_0x3af281[_0xce81('0x27')],_0x3af281['responseTime'],_0x59b315[_0xce81('0x13')]?_0x59b315[_0xce81('0x13')]['id']:null,_0x59b315[_0xce81('0x13')]?_0x59b315[_0xce81('0x13')][_0xce81('0xe')]:null,_0x59b315[_0xce81('0x13')]?_0x59b315[_0xce81('0x13')][_0xce81('0xd')]:null,_0x7ad646?util['inspect'](_0x7ad646,![],null):''));}}));_0x5686b[_0xce81('0x28')](ewinston[_0xce81('0x1c')]({'winstonInstance':_0x2671da,'meta':![],'statusLevels':!![],'msg':function(_0x136bd1,_0x3b2b19){var _0x377b7=_0xce81('0x29');if(_0x136bd1[_0xce81('0x1f')]&&_0x136bd1[_0xce81('0x1f')][_0xce81('0x2a')]&&_0x136bd1[_0xce81('0x1f')]['agent_id']){_0x377b7=_0xce81('0x2b');}return util['format'](_0x377b7,_0x136bd1[_0xce81('0x22')],_0x136bd1[_0xce81('0x2c')]['x-forwarded-for']?_0x136bd1[_0xce81('0x2c')][_0xce81('0x23')]:_0x136bd1['connection'][_0xce81('0x25')]||_0x136bd1['ip'],_0x136bd1[_0xce81('0x26')],_0x3b2b19[_0xce81('0x27')],_0x3b2b19[_0xce81('0x2d')],_0x136bd1[_0xce81('0x13')]?_0x136bd1[_0xce81('0x13')]['id']:null,_0x136bd1[_0xce81('0x13')]?_0x136bd1['user'][_0xce81('0xe')]:null,_0x136bd1['user']?_0x136bd1[_0xce81('0x13')][_0xce81('0xd')]:null,_0x136bd1['body']&&_0x136bd1['body'][_0xce81('0x2a')]?_0x136bd1[_0xce81('0x1f')][_0xce81('0x2a')]:'other',_0x136bd1['body']&&_0x136bd1['body'][_0xce81('0x2e')]?_0x136bd1[_0xce81('0x1f')][_0xce81('0x2e')]:'',_0x136bd1['body']&&_0x136bd1[_0xce81('0x1f')][_0xce81('0x2f')]?_0x136bd1[_0xce81('0x1f')][_0xce81('0x2f')]:'');},'ignoreRoute':function(_0xe77781){var _0x51830d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x51830d[_0xce81('0x30')](_0xe77781[_0xce81('0x26')]);}}));return _0x294a77();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f10d618..f6fbdba 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1833=['path','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','bold\x20yellow','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','}}}','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','warn','Logger','transports','File','error','consoleLogger','fileLogger'];(function(_0x5c1641,_0x5724c6){var _0x6f22a0=function(_0x4f8027){while(--_0x4f8027){_0x5c1641['push'](_0x5c1641['shift']());}};_0x6f22a0(++_0x5724c6);}(_0x1833,0x128));var _0x3183=function(_0x7c6de5,_0x526675){_0x7c6de5=_0x7c6de5-0x0;var _0x2d9b40=_0x1833[_0x7c6de5];return _0x2d9b40;};'use strict';var path=require(_0x3183('0x0'));var util=require('util');var moment=require('moment');var winston=require(_0x3183('0x1'));var config=require(_0x3183('0x2'));var debugLevel=config[_0x3183('0x3')]?config['debugLevel'][_0x3183('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x3183('0x5'),'error':'red','warn':_0x3183('0x6'),'info':'white','print':'bold\x20white','success':_0x3183('0x7'),'http':_0x3183('0x8'),'verbose':_0x3183('0x9'),'debug':_0x3183('0xa'),'silly':_0x3183('0xb')};winston[_0x3183('0xc')](XC_LOG_COLORS);function getLogFileName(_0x34a7a9,_0x255c59,_0x51c65a){var _0x1a8b41=_0x34a7a9||_0x3183('0xd');return path[_0x3183('0xe')](_0x1a8b41,util[_0x3183('0xf')](_0x3183('0x10'),_0x255c59,_0x51c65a));}function formatter(_0x275d8b,_0xbf74f){_0xbf74f['message']=_0xbf74f[_0x3183('0x11')]['replace'](/@@{/g,_0x3183('0x12'))['replace'](/}@@/g,'}}}')[_0x3183('0x13')](/@{/g,'{{')[_0x3183('0x13')](/}@/g,'}}');return util[_0x3183('0xf')](_0x3183('0x14'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0xbf74f[_0x3183('0x15')][_0x3183('0x16')](),_0x275d8b,_0xbf74f[_0x3183('0x11')]);}function fileFormat(_0x313a28,_0x58f4b5){_0x58f4b5['message']=_0x58f4b5['message'][_0x3183('0x13')](/@@{/g,_0x3183('0x12'))[_0x3183('0x13')](/}@@/g,_0x3183('0x17'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x32afb4=_0x58f4b5['meta']&&Object[_0x3183('0x18')](_0x58f4b5[_0x3183('0x19')])[_0x3183('0x1a')]?'\x0a\x09'+JSON[_0x3183('0x1b')](_0x58f4b5[_0x3183('0x19')]):'';return util[_0x3183('0xf')](_0x3183('0x1c'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x58f4b5[_0x3183('0x15')][_0x3183('0x16')](),_0x313a28,_0x58f4b5['message'],_0x32afb4);}function consoleLogger(){var _0x2592e3=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x3183('0x1d'))]({'level':_0x3183('0x1e'),'json':![],'formatter':function(_0x5d165d){return formatter('',_0x5d165d);}})]});return _0x2592e3;}function fileLogger(_0x189984,_0x488330){var _0x266fc8=new winston[(_0x3183('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3183('0x20'))][(_0x3183('0x21'))]({'name':util[_0x3183('0xf')]('%s-%s',_0x189984,_0x3183('0x22')),'filename':getLogFileName(_0x488330,_0x189984,_0x3183('0x22')),'level':_0x3183('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xba82d5){return fileFormat(_0x189984,_0xba82d5);}}),new winston[(_0x3183('0x20'))]['File']({'name':util['format']('%s-%s',_0x189984,debugLevel),'filename':getLogFileName(_0x488330,_0x189984,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24dd13){return fileFormat(_0x189984,_0x24dd13);}}),new winston[(_0x3183('0x20'))]['Console']({'level':_0x3183('0x1e'),'json':![],'formatter':function(_0x6b306){return fileFormat(_0x189984,_0x6b306);}})]});return _0x266fc8;}exports[_0x3183('0x23')]=consoleLogger;exports[_0x3183('0x24')]=fileLogger; \ No newline at end of file +var _0x5628=['info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','Logger','transports','warn','format','%s-%s','error','File','Console','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase'];(function(_0x474c7e,_0x131f66){var _0x284608=function(_0x5c4841){while(--_0x5c4841){_0x474c7e['push'](_0x474c7e['shift']());}};_0x284608(++_0x131f66);}(_0x5628,0x1aa));var _0x8562=function(_0xf8bd19,_0x476c09){_0xf8bd19=_0xf8bd19-0x0;var _0x376ded=_0x5628[_0xf8bd19];return _0x376ded;};'use strict';var path=require(_0x8562('0x0'));var util=require(_0x8562('0x1'));var moment=require(_0x8562('0x2'));var winston=require('winston');var config=require(_0x8562('0x3'));var debugLevel=config[_0x8562('0x4')]?config[_0x8562('0x4')][_0x8562('0x5')]():_0x8562('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x8562('0x7'),'error':_0x8562('0x8'),'warn':'bold\x20yellow','info':_0x8562('0x9'),'print':_0x8562('0xa'),'success':_0x8562('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0x8562('0xc')};winston[_0x8562('0xd')](XC_LOG_COLORS);function getLogFileName(_0x479c4c,_0x116de4,_0x41a117){var _0x259ba5=_0x479c4c||_0x8562('0xe');return path[_0x8562('0xf')](_0x259ba5,util['format'](_0x8562('0x10'),_0x116de4,_0x41a117));}function formatter(_0x1c0152,_0x4261cc){_0x4261cc['message']=_0x4261cc[_0x8562('0x11')][_0x8562('0x12')](/@@{/g,_0x8562('0x13'))[_0x8562('0x12')](/}@@/g,_0x8562('0x14'))[_0x8562('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x8562('0x15'),moment()['format'](_0x8562('0x16')),_0x4261cc[_0x8562('0x17')][_0x8562('0x18')](),_0x1c0152,_0x4261cc[_0x8562('0x11')]);}function fileFormat(_0x1c490f,_0x273505){_0x273505[_0x8562('0x11')]=_0x273505[_0x8562('0x11')][_0x8562('0x12')](/@@{/g,_0x8562('0x13'))['replace'](/}@@/g,_0x8562('0x14'))[_0x8562('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x3db70c=_0x273505[_0x8562('0x19')]&&Object['keys'](_0x273505[_0x8562('0x19')])['length']?'\x0a\x09'+JSON['stringify'](_0x273505[_0x8562('0x19')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x8562('0x16')),_0x273505[_0x8562('0x17')][_0x8562('0x18')](),_0x1c490f,_0x273505[_0x8562('0x11')],_0x3db70c);}function consoleLogger(){var _0x338982=new winston[(_0x8562('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8562('0x1b'))]['Console']({'level':_0x8562('0x1c'),'json':![],'formatter':function(_0xdddea){return formatter('',_0xdddea);}})]});return _0x338982;}function fileLogger(_0x3cf7fa,_0x29dc9a){var _0x27a96f=new winston[(_0x8562('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x8562('0x1d')](_0x8562('0x1e'),_0x3cf7fa,_0x8562('0x1f')),'filename':getLogFileName(_0x29dc9a,_0x3cf7fa,_0x8562('0x1f')),'level':_0x8562('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4e73ae){return fileFormat(_0x3cf7fa,_0x4e73ae);}}),new winston[(_0x8562('0x1b'))][(_0x8562('0x20'))]({'name':util[_0x8562('0x1d')](_0x8562('0x1e'),_0x3cf7fa,debugLevel),'filename':getLogFileName(_0x29dc9a,_0x3cf7fa,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x50d86a){return fileFormat(_0x3cf7fa,_0x50d86a);}}),new winston['transports'][(_0x8562('0x21'))]({'level':_0x8562('0x1c'),'json':![],'formatter':function(_0x20733a){return fileFormat(_0x3cf7fa,_0x20733a);}})]});return _0x27a96f;}exports[_0x8562('0x22')]=consoleLogger;exports[_0x8562('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 288f654..e5bcc53 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x295572,_0x58a177){var _0x285bef=function(_0x3d284e){while(--_0x3d284e){_0x295572['push'](_0x295572['shift']());}};_0x285bef(++_0x58a177);}(_0x2ef3,0xba));var _0x32ef=function(_0x935462,_0x574370){_0x935462=_0x935462-0x0;var _0x1a96db=_0x2ef3[_0x935462];return _0x1a96db;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x1967,0x173));var _0x7196=function(_0x1461ca,_0x13f374){_0x1461ca=_0x1461ca-0x0;var _0x1957d6=_0x1967[_0x1461ca];return _0x1957d6;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index fe61bad..3ceb536 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x5338a8,_0x2c9f71){var _0x3be932=function(_0x2c50a8){while(--_0x2c50a8){_0x5338a8['push'](_0x5338a8['shift']());}};_0x3be932(++_0x2c9f71);}(_0xef0f,0x168));var _0xfef0=function(_0x5d0366,_0x573b72){_0x5d0366=_0x5d0366-0x0;var _0x3ba36c=_0xef0f[_0x5d0366];return _0x3ba36c;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate; \ No newline at end of file +var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x4c058f,_0x18e432){_0x4c058f=_0x4c058f-0x0;var _0x19df4d=_0xf4f4[_0x4c058f];return _0x19df4d;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('0x9')]=safeTemplate; \ No newline at end of file -- 1.7.1